From: Andrea Bianco Date: Wed, 23 Feb 2022 23:58:57 +0000 (+0100) Subject: Built motion from commit 5ad77b03.|2.6.3 X-Git-Url: http://repos.xcallymotion.com/base/%22https:/wiki.xcallymotion.com/display/XMV//%22%7B%7Blicense.openchannel?a=commitdiff_plain;h=4654f942e28a2c3a8a0884007858c33464233b0e;p=motion2.git Built motion from commit 5ad77b03.|2.6.3 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 6950324..90592aa 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-02-20T22:03:11.851Z", + "time": "2022-02-23T23:52:32.838Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 77496af..9cd79d3 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-02-20T22:03:11.851Z", + "time": "2022-02-23T23:52:32.838Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/public/app/forgot/i18n/pt-BR.json b/public/app/forgot/i18n/pt-BR.json index caa1d08..f024ec7 100644 --- a/public/app/forgot/i18n/pt-BR.json +++ b/public/app/forgot/i18n/pt-BR.json @@ -2,7 +2,7 @@ "FORGOTPASSWORD": { "TITLE": "Recupere sua senha", "EMAIL_ADRESS": "Endereço de e-mail", - "SEND_RESET_LINK": "ENVIAR LINK PARA RESET", + "SEND_RESET_LINK": "Enviar link para reset", "GO_BACK": "Volte para o login", "LINK_SENT": "Link enviado", "LINNK_SENT_MESSAGE": "Um e-mail contendo um link para redefinir sua senha foi enviado para o seu endereço!", diff --git a/public/app/login/i18n/pt-BR.json b/public/app/login/i18n/pt-BR.json index bffb47d..d9f974d 100644 --- a/public/app/login/i18n/pt-BR.json +++ b/public/app/login/i18n/pt-BR.json @@ -10,7 +10,7 @@ "REMEMBER_ME": "Lembrar-me", "FORGOT_PASSWORD": "Esqueceu a senha?", "LOG_IN": "Entrar", - "OR": "OU", + "OR": "Ou", "WITH_GOOGLE": "Logar com o Google", "WITH_FACEBOOK": "Logar com o Facebook", "DONT_HAVE_ACCOUNT": "Não tem conta?", diff --git a/public/app/main/apps/analytics/i18n/de.json b/public/app/main/apps/analytics/i18n/de.json index f771c4b..e6b577a 100644 --- a/public/app/main/apps/analytics/i18n/de.json +++ b/public/app/main/apps/analytics/i18n/de.json @@ -1,20 +1,20 @@ { "ANALYTICS": { "NAME": "Name", - "ANALYTICS": "Reporting", - "METRICS": "Eigene Kennzahlen", - "ID": "ID", + "ANALYTICS": "Analytics", + "METRICS": "Kennzahlen", + "ID": "Id", "TABLE": "Tabelle", "DESCRIPTION": "Beschreibung", "SEARCH_FOR_ANYONE": "Suche", - "METRIC": "MYSQL-Ausdruck. Beispiel: DATE(queuecallerjoinat)", + "METRIC": "Metrik", "ERRORS": { - "NAME_REQUIRED": "Name erforderlich", - "METRIC_REQUIRED": "Metrik erforderlich", - "COLUMN_REQUIRED": "Spalte erforderlich", - "VALUE_REQUIRED": "Wert erforderlich", - "CUSTOM_METRIC_REQUIRED": "Benutzerdef. Metrik erforderlich", - "ALIAS_REQUIRED": "Alias erforderlich" + "NAME_REQUIRED": "Pflichtfeld", + "METRIC_REQUIRED": "Pflichtfeld", + "COLUMN_REQUIRED": "Pflichtfeld", + "VALUE_REQUIRED": "Pflichtfeld", + "CUSTOM_METRIC_REQUIRED": "Pflichtfeld", + "ALIAS_REQUIRED": "Pflichtfeld" }, "NEW_METRIC": "Neue Metrik", "ADD_METRIC": "Metrik hinzufügen", @@ -22,11 +22,11 @@ "DELETE_METRIC": "Metrik löschen", "SAVE": "Speichern", "BACK": "Zurück", - "SELECTED": "Ausgewählt", + "SELECTED": "Ausgewählte", "SELECT_ALL": "Alles auswählen", "SELECT_NONE": "Nichts auswählen", "TYPE": "Typ", - "EXTRACTEDREPORTS": "Ausgeführte Berichte", + "EXTRACTEDREPORTS": "Extrahierte Berichte", "DATE_RANGE_FROM": "Datum von", "DATE_RANGE_TO": "Datum bis", "GENERATED_AT": "Generiert am", @@ -38,7 +38,7 @@ "NEW_REPORT": "Neuer Bericht", "ADD_REPORT": "Bericht hinzufügen", "COPY_REPORT": "Bericht kopieren", - "PREVIEW_REPORT": "Vorschau Bericht", + "PREVIEW_REPORT": "Berichtvorschau", "RUN_REPORT": "Bericht ausführen", "DOWNLOAD_JSON_REPORT": "Bericht exportieren JSON", "EDIT_REPORT": "Bericht bearbeiten", @@ -50,7 +50,7 @@ "ERROR": "Fehler", "QUERY_ERROR": "Abfragefehler", "MESSAGE": "Nachricht", - "CLOSE": "Schließen", + "CLOSE": "Schliessen", "FORMAT": "Format", "SETTINGS": "Einstellungen", "GENERAL": "Allgemein", @@ -61,7 +61,7 @@ "COLUMN": "Spalte", "VALUE": "Wert", "PREVIEW": "Vorschau", - "LIMITED_RESULT": "Ansicht begrenzt", + "LIMITED_RESULT": "Ergebins begrenzt", "NO_DATA": "Keine Daten", "CONDITIONS": "Bedingungen", "ALIAS": "Alias", @@ -75,9 +75,9 @@ "NO_METRIC_FOUND": "Keine Metrik gefunden", "NO_AVAILABLE_INFO": "keine Informationen verfügbar", "CUSTOM_METRIC": "Benutzerdefinierte Metrik", - "DELETE_EXTRACTEDREPORT": "Bericht löschen", - "EDIT_EXTRACTEDREPORT": "Bericht bearbeiten", - "DOWNLOAD_EXTRACTEDREPORT": "Bericht herunterladen", + "DELETE_EXTRACTEDREPORT": "Extrahierte Berichte löschen", + "EDIT_EXTRACTEDREPORT": "Extrahierte Berichte bearbeiten", + "DOWNLOAD_EXTRACTEDREPORT": "Extrahierte Berichte herunterladen", "PAGE": "Seite", "ROWSPERPAGE": "Zeilen pro Seite", "OF": "von", diff --git a/public/app/main/apps/analytics/i18n/nl.json b/public/app/main/apps/analytics/i18n/nl.json index 784ce48..c214138 100644 --- a/public/app/main/apps/analytics/i18n/nl.json +++ b/public/app/main/apps/analytics/i18n/nl.json @@ -1,56 +1,56 @@ { "ANALYTICS": { "NAME": "Naam", - "ANALYTICS": "Analyses", - "METRICS": "Statistieken", + "ANALYTICS": "Analytics", + "METRICS": "Metrieken", "ID": "Id", "TABLE": "Tabel", "DESCRIPTION": "Beschrijving", - "SEARCH_FOR_ANYONE": "Zoeken", - "METRIC": "Statistiek", + "SEARCH_FOR_ANYONE": "Zoeken voor iedereen", + "METRIC": "Metrisch", "ERRORS": { - "NAME_REQUIRED": "Verplicht veld", - "METRIC_REQUIRED": "Verplicht veld", - "COLUMN_REQUIRED": "Verplicht veld", - "VALUE_REQUIRED": "Verplicht veld", - "CUSTOM_METRIC_REQUIRED": "Verplicht veld", - "ALIAS_REQUIRED": "Verplicht veld" + "NAME_REQUIRED": "De naam is verplicht", + "METRIC_REQUIRED": "De metrische is vereist", + "COLUMN_REQUIRED": "De kolom is vereist", + "VALUE_REQUIRED": "De waarde is vereist", + "CUSTOM_METRIC_REQUIRED": "De aangepaste metrisch is vereist", + "ALIAS_REQUIRED": "De alias is vereist" }, - "NEW_METRIC": "Nieuwe Statistiek", - "ADD_METRIC": "Statistiek Toevoegen", - "EDIT_METRIC": "Statistiek Bewerken", - "DELETE_METRIC": "Statistiek Verwijderen", + "NEW_METRIC": "Nieuwe metrisch", + "ADD_METRIC": "Voeg metrisch", + "EDIT_METRIC": "Edit metrisch", + "DELETE_METRIC": "Verwijder metrisch", "SAVE": "Opslaan", "BACK": "Terug", "SELECTED": "Geselecteerd", - "SELECT_ALL": "Selecteer Alles", - "SELECT_NONE": "Selecteer Geen", + "SELECT_ALL": "Alles selecteren", + "SELECT_NONE": "Selecteer None (Geen).", "TYPE": "Type", - "EXTRACTEDREPORTS": "Resultaten", + "EXTRACTEDREPORTS": "Uitgepakte rapporten", "DATE_RANGE_FROM": "Datumbereik Van", "DATE_RANGE_TO": "Datumbereik Tot", - "GENERATED_AT": "Gegenereerd Op", + "GENERATED_AT": "Gegenereerd.", "STATUS": "Status", - "OUTPUT": "Resultaat", + "OUTPUT": "Uitgang", "REPORTS": "Rapporten", "SEARCH_FOR_FOLDER": "Zoeken naar map", - "CREATED_AT": "Gegenereerd Op", - "NEW_REPORT": "Nieuw Rapport", - "ADD_REPORT": "Rapport Toevoegen", - "COPY_REPORT": "Raport Kopiëren", - "PREVIEW_REPORT": "Voorbeeldrapport", - "RUN_REPORT": "Rapport Genereren", - "DOWNLOAD_JSON_REPORT": "Rapportgegevens Exporteren JSON", - "EDIT_REPORT": "Rapport Bewerken", - "DELETE_REPORT": "Rapport Verwijderen", - "CREATE": "Map Nanmaken", - "RENAME": "Map Hernoemen", - "REMOVE": "Map Verwijderen", - "SELECT_NODE": "Map Selecteren", + "CREATED_AT": "Gemaakt op", + "NEW_REPORT": "Nieuw rapport", + "ADD_REPORT": "Rapport toevoegen", + "COPY_REPORT": "Kopie rapport", + "PREVIEW_REPORT": "Voorbeeldrapport.", + "RUN_REPORT": "Rapport uitvoeren", + "DOWNLOAD_JSON_REPORT": "Rapportgegevens exporteren JSON", + "EDIT_REPORT": "Rapport bewerken", + "DELETE_REPORT": "Rapport verwijderen", + "CREATE": "Map maken", + "RENAME": "Naam van map wijzigen", + "REMOVE": "Map verwijderen", + "SELECT_NODE": "Map selecteren", "ERROR": "Fout", "QUERY_ERROR": "Query fout", "MESSAGE": "Bericht", - "CLOSE": "Sluiten", + "CLOSE": "Dicht", "FORMAT": "Formaat", "SETTINGS": "Instellingen", "GENERAL": "Algemeen", @@ -62,22 +62,22 @@ "VALUE": "Waarde", "PREVIEW": "Afdrukvoorbeeld", "LIMITED_RESULT": "*Beperkte resultaten", - "NO_DATA": "Geen resultaten gevonden", + "NO_DATA": "Geen gegevens resultaten", "CONDITIONS": "Voorwaarden", "ALIAS": "Alias", "FUNCTION": "Functie", - "GROUP_BY": "Groeperen Op", - "ORDER_BY": "Sorteren op Op", + "GROUP_BY": "Groeperen op", + "ORDER_BY": "Order By", "ADD_REPORTFIELD": "Veld toevoegen", - "EDIT_REPORTFIELD": "Invoerveld Bewerken", - "DELETE_REPORTFIELD": "Veld Verwijderen", - "METRIC_NAME": "Statistiek", - "NO_METRIC_FOUND": "Geen statistieken gevonden", + "EDIT_REPORTFIELD": "Invoerveld", + "DELETE_REPORTFIELD": "Veld wissen", + "METRIC_NAME": "Metrisch", + "NO_METRIC_FOUND": "Geen metrische gevonden", "NO_AVAILABLE_INFO": "Geen beschikbare informatie", - "CUSTOM_METRIC": "Aangepaste Statistiek", - "DELETE_EXTRACTEDREPORT": "Rapport Verwijderen", - "EDIT_EXTRACTEDREPORT": "Rapport Bewerken", - "DOWNLOAD_EXTRACTEDREPORT": "Rapport Downloaden", + "CUSTOM_METRIC": "Aangepaste metrisch", + "DELETE_EXTRACTEDREPORT": "Verwijder geëxtraheerd verslag", + "EDIT_EXTRACTEDREPORT": "Edit geëxtraheerd verslag", + "DOWNLOAD_EXTRACTEDREPORT": "Download geëxtraheerd verslag", "PAGE": "Pagina", "ROWSPERPAGE": "Rijen per pagina", "OF": "Van", diff --git a/public/app/main/apps/analytics/i18n/pt-BR.json b/public/app/main/apps/analytics/i18n/pt-BR.json index 1128309..c1efa84 100644 --- a/public/app/main/apps/analytics/i18n/pt-BR.json +++ b/public/app/main/apps/analytics/i18n/pt-BR.json @@ -41,8 +41,8 @@ "NEW_REPORT": "Novo relatório", "ADD_REPORT": "Adicionar relatório", "COPY_REPORT": "Copiar relatório", - "PREVIEW_REPORT": "Pré-visualizar relatório", - "RUN_REPORT": "Gerar relatório", + "PREVIEW_REPORT": "Pré-visualização do relatório", + "RUN_REPORT": "Executar relatório", "DOWNLOAD_JSON_REPORT": "Exportar relatório JSON", "EDIT_REPORT": "Editar relatório", "DELETE_REPORT": "Excluir relatório", @@ -64,7 +64,7 @@ "COLUMN": "Coluna", "VALUE": "Valor", "PREVIEW": "Visualizar", - "LIMITED_RESULT": "Resultados limitados", + "LIMITED_RESULT": "* Resultados limitados", "NO_DATA": "Nenhum resultado de dados", "CONDITIONS": "Condições", "ALIAS": "Alias", @@ -84,6 +84,6 @@ "PAGE": "Página", "ROWSPERPAGE": "Linhas por página", "OF": "do", - "WEB_REPORT": "Relatório da web" + "WEB_REPORT": "Relatório web" } } diff --git a/public/app/main/apps/callysquare/i18n/de.json b/public/app/main/apps/callysquare/i18n/de.json index e40e468..43d5be6 100644 --- a/public/app/main/apps/callysquare/i18n/de.json +++ b/public/app/main/apps/callysquare/i18n/de.json @@ -1,20 +1,20 @@ { "CALLYSQUARE": { - "ACCOUNT_ID": "Konto", - "ADDUSER_PROJECTS": "Benutzer zum Projekt hinzufügen", + "ACCOUNT_ID": "Account", + "ADDUSER_PROJECTS": "Benutzer zu dem Projekt hinzufügen", "ADD_ODBC": "ODBC hinzufügen", "ADD_PROJECT": "Projekt hinzufügen", - "ADD_VARIABLE": "Variabel hinzufügen", + "ADD_VARIABLE": "Variable hinzufügen", "AGENTS": "Agenten", - "AGI": "Skript", + "AGI": "AGI", "ALL_USERS": "Alle Benutzer", "ANSWER": "Antwort", "APIKEY": "API-Schlüssel", "APPID": "App-ID", - "APPLICATION": "Anwendung", - "APPSECRET": "App-Secret", - "ARGS": "Argumente", - "ATTACHMENT_NAME": "Anhangsname", + "APPLICATION": "Application", + "APPSECRET": "App Geheimnis", + "ARGS": "Arguments", + "ATTACHMENT_NAME": "Name des Anhangs", "ATTACHMENT_PATH": "Anhangspfad", "ATTACHMENT_TYPE": "Anhangstyp", "AUDIO": "Audio", @@ -22,10 +22,10 @@ "AWSLEX": "Amazon Lex", "AWSPOLLY": "AWS Polly", "AWS_ACCESS_KEY_ID": "Zugangsschlüssel-ID", - "AWS_BOT_NAME": "BOT-Name", - "AWS_LEX_REGION": "Lex-Region", - "AWS_POLLY_REGION": "Polly-Region", - "AWS_POLLY_VOICE": "Polly-Sprache", + "AWS_BOT_NAME": "Bot-Name", + "AWS_LEX_REGION": "Region", + "AWS_POLLY_REGION": "Region", + "AWS_POLLY_VOICE": "Sprache", "AWS_SECRET_ACCESS_KEY": "Geheimer Zugangsschlüssel", "AWS_TEXT_TYPE": "Texttyp", "BACK": "Zurück", @@ -34,13 +34,13 @@ "BODY": "Body", "CALLBACK": "Rückruf", "CALLBACK_PRIORITY": "Priorität", - "CALLYSQUARE": "Callflow-Editor", + "CALLYSQUARE": "Cally Square", "CC": "CC", "CHOOSE_ATTACHMENT": "Anhang wählen", "CLOSE": "Schließen", - "COMMAND": "Eingabe", - "COMPUTEDVARIABLES": "Skriptpfad für berechnete Variabeln", - "CONDITION": "Bedingung", + "COMMAND": "Befehlen", + "COMPUTEDVARIABLES": "Skriptpfad für berechnete Variablen", + "CONDITION": "Voraussetzung", "CONTEXT": "Kontext", "COPY": "Kopieren", "COPY_PROJECT": "Projekt kopieren", @@ -61,7 +61,7 @@ "DIGIT": "Maximale Ziffern", "DIGITS": "Ziffern", "DOWNLOAD_SQUARERECORDING": "Aufnahme hochladen", - "DROP_TO_UPLOAD": "HIER ABLEGEN ZUM UPLOADEN", + "DROP_TO_UPLOAD": "ABLEGEN ZUM UPLOADEN", "DROP_TO_UPLOAD_MESSAGE": "Sie können hier auch Dateien hochladen. Nur XML- max.5 MB", "DSN": "DSN", "EDIT": "Bearbeiten", @@ -71,20 +71,20 @@ "EDIT_XML": "XML bearbeiten", "END": "Ende", "ERRORS": { - "DSN_REQUIRED": "DSN erforderlich", - "FIELD_REQUIRED": "Feld erforderlich", - "NAME_REQUIRED": "Name erforderlich", - "PROJECT_REQUIRED": "Projekt erforderlich", - "URL_REQUIRED": "URL erforderlich" + "DSN_REQUIRED": "Pflichtfeld", + "FIELD_REQUIRED": "Pflichtfeld", + "NAME_REQUIRED": "Pflichtfeld", + "PROJECT_REQUIRED": "Pflichtfeld", + "URL_REQUIRED": "Pflichtfeld" }, "ESCAPE_DIGITS": "Escape Digits", "EXTEN": "Erweitern", - "EXTENSION": "Nebenstelle/Ziel", + "EXTENSION": "Erweiterung", "EXT_DIAL": "Wählen extern", - "FILE": "Datei", + "FILE": "Dateiname", "FILENAME": "Dateiname", - "FILE_ID": "Datei ID", - "FINALLY": "Am Ende", + "FILE_ID": "Audio", + "FINALLY": "Schliesslich", "FINDBY": "Suchen nach", "GETDIGITS": "Ziffern erhalten", "GETSECRETDIGITS": "Geheime Ziffern erhalten", @@ -133,7 +133,7 @@ "LUMENVOXTTS": "Lumenvox Text-To-Speech", "MACRO": "Macro", "MAILBOX": "Mailbox", - "MATH": "Mathematik", + "MATH": "Math", "MAXDIGIT": "Maximum Ziffern", "MENU": "Menü", "METHOD": "Methode", @@ -163,11 +163,11 @@ "OPERATION": "Operation", "OPTIONS": "Optionen", "OPTS": "Optionen", - "OUTPUT": "Ausgabe", + "OUTPUT": "Ausgang", "PAGE": "Seite", "PASSWORD": "Passwort", "PAUSE": "Pause", - "PAUSE_ID": "Pausen ID", + "PAUSE_ID": "Pause ID", "PERMISSIONADD_PROJECTS": "Benutzer zu dem Projekt hinzufügen", "PHONE": "Telefon", "PLAYBACK": "Wiedergabe", @@ -175,22 +175,22 @@ "PRIORITY": "Priorität", "PROJECT": "Projekt", "PROJECTS": "Projekte", - "PROJECT_ID": "Projekt ID", - "QUERY": "Query", + "PROJECT_ID": "Projekt", + "QUERY": "Abfrage", "QUEUE": "Warteschlange", - "QUEUE_ID": "Warteschlangen ID", - "RAWBODY": "Textkörper", + "QUEUE_ID": "Warteschlange ID", + "RAWBODY": "Body", "RAWHEADERS": "Überschriften", - "RECORD": "Aufzeichnung", - "RECORDINGFORMAT": "Aufzeichnungsformat", + "RECORD": "Aufnahme", + "RECORDINGFORMAT": "Aufnahme Format", "RESPONSE": "Antwort Timeout", "RESTAPI": "Rest API", - "RETRY": "Wiederholen", + "RETRY": "Wiederholungen", "ROWSPERPAGE": "Zeilen pro Seite", "SAVE": "Speichern", - "SAYDIGITS": "Ziffern sagen", - "SAYNUMBER": "Nummer sagen", - "SAYPHONETIC": "Phonetische Ansage", + "SAYDIGITS": "Say Digits", + "SAYNUMBER": "Say number", + "SAYPHONETIC": "Say Phonetics", "SEARCH_FOR_ANYONE": "Suchen", "SELECTED": "Ausgewählt", "SELECTED_USERS": "Ausgewählte Benutzer", @@ -204,27 +204,27 @@ "SESTEKTTS": "Sestek TTS", "SET": "Set", "SIP_ID": "SIP", - "SMS_ACCOUNT_ID": "ID Konto für SMS", + "SMS_ACCOUNT_ID": "Konto", "SMS_TEXT": "Text", - "SPEED": "Geschwindigkeit", - "SQUARERECORDINGS": "Aufzeichnungen", - "SSMLGENDER": "Geschlecht Stimme", + "SPEED": "Speed", + "SQUARERECORDINGS": "Aufnahmen", + "SSMLGENDER": "Geschlecht", "START": "Start", "SUBJECT": "Betreff", "SUBPROJECT": "Sub-Projekt", "SYSTEM": "System", "TELEPHONES": "Telefone", - "TEMPLATE_ID": "Vorlagen ID", + "TEMPLATE_ID": "Vorlage", "TEST_ODBC": "Test ODBC", "TEXT": "Text", "TILDEASR": "Tilde ASR", "TIMEOUT": "Timeout", - "TO": "An", + "TO": "To", "TRUNK_NAME": "Trunk", "TTS": "Google Text-To-Speech", "UNIQUEID": "Eindeutige ID", "UNPAUSE": "Pause beenden", - "UPDATE_DESCRIPTION": "Beschreibung aktualisieren", + "UPDATE_DESCRIPTION": "Update Beschreibung", "UPDATE_INFO": "Info aktualisieren", "URI": "URI", "URL": "URL", @@ -238,7 +238,7 @@ "DIALOGFLOWV2": "DialogflowV2", "DIALOGFLOWV2_LANGUAGE": "Sprache", "DIALOGFLOWV2_PROJECT_ID": "Projekt-ID", - "PRIVATE_KEY": "Privater Schlüssel", + "PRIVATE_KEY": "Privat Schlüssel", "DIALTIMEZONE": "Zeitzone wählen" } } diff --git a/public/app/main/apps/callysquare/i18n/nl.json b/public/app/main/apps/callysquare/i18n/nl.json index dbe19f3..0f1fe4e 100644 --- a/public/app/main/apps/callysquare/i18n/nl.json +++ b/public/app/main/apps/callysquare/i18n/nl.json @@ -2,203 +2,203 @@ "CALLYSQUARE": { "ACCOUNT_ID": "Account", "ADDUSER_PROJECTS": "Gebruikers toevoegen aan project", - "ADD_ODBC": "ODBC Toevoegen", - "ADD_PROJECT": "Project Toevoegen", - "ADD_VARIABLE": "Variabele Toevoegen", + "ADD_ODBC": "Voeg ODBC", + "ADD_PROJECT": "Voeg Project", + "ADD_VARIABLE": "Variabele toevoegen", "AGENTS": "Agenten", "AGI": "AGI", "ALL_USERS": "Alle gebruikers", - "ANSWER": "Antwoorden", - "APIKEY": "API key", + "ANSWER": "Answer", + "APIKEY": "API sleutel", "APPID": "App ID", - "APPLICATION": "Applicatie", - "APPSECRET": "App secret", + "APPLICATION": "Application", + "APPSECRET": "App geheim", "ARGS": "Arguments", "ATTACHMENT_NAME": "Bijlagenaam", - "ATTACHMENT_PATH": "Bijlage pad", - "ATTACHMENT_TYPE": "Type bijlage", + "ATTACHMENT_PATH": "Attachment pad", + "ATTACHMENT_TYPE": "Type aansluiting", "AUDIO": "Audio", "AUDIOENCODING": "Audiocodering", "AWSLEX": "Amazon Lex", - "AWSPOLLY": "Amazon Polly", - "AWS_ACCESS_KEY_ID": "Access key ID", + "AWSPOLLY": "AWS Polly", + "AWS_ACCESS_KEY_ID": "Toegangstoets ID", "AWS_BOT_NAME": "Botnaam", "AWS_LEX_REGION": "Regio", "AWS_POLLY_REGION": "Regio", "AWS_POLLY_VOICE": "Spraak", - "AWS_SECRET_ACCESS_KEY": "Access key", - "AWS_TEXT_TYPE": "Soort bericht", + "AWS_SECRET_ACCESS_KEY": "Geheime sleutel", + "AWS_TEXT_TYPE": "Bericht soort", "BACK": "Terug", "BCC": "BCC", "BEEP": "Beep", - "BODY": "Inhoud", - "CALLBACK": "Terugbellen", + "BODY": "Lichaam", + "CALLBACK": "Callback", "CALLBACK_PRIORITY": "Prioriteit", - "CALLYSQUARE": "Cally Square", + "CALLYSQUARE": "Schrijfsnelheid Square", "CC": "CC", - "CHOOSE_ATTACHMENT": "Kies een bijlage", - "CLOSE": "Sluiten", - "COMMAND": "Commando", + "CHOOSE_ATTACHMENT": "Kies voorzetstuk", + "CLOSE": "Dicht", + "COMMAND": "Command", "COMPUTEDVARIABLES": "Scriptpad voor berekende variabelen", - "CONDITION": "Voorwaarde", + "CONDITION": "Condition", "CONTEXT": "Context", "COPY": "Kopiëren", - "COPY_PROJECT": "Project Kopiëren", - "CREATED_AT": "Gemaakt Op", - "CUSTOM_ACTION": "Aangepaste Actie", - "CUSTOM_ACTION_DATA": "Aangepaste Actiegegevens", - "CUSTOM_APP": "Aangepaste Applicatie", + "COPY_PROJECT": "Kopieer Project", + "CREATED_AT": "Gemaakt op", + "CUSTOM_ACTION": "Aangepaste actie", + "CUSTOM_ACTION_DATA": "Aangepaste actiegegevens", + "CUSTOM_APP": "Custom Application", "DATABASE": "Database", - "DELAY": "Vertraging", + "DELAY": "Delay", "DELETE": "Verwijderen", - "DELETE_ODBC": "ODBC Verwijderen", - "DELETE_PROJECT": "Project Verwijderen", - "DELETE_SQUARERECORDING": "Opname Verwijderen", + "DELETE_ODBC": "Verwijderen van ODBC", + "DELETE_PROJECT": "Project verwijderen", + "DELETE_SQUARERECORDING": "Wis vierkant opnemen", "DESCRIPTION": "Beschrijving", - "DIAL": "Bel", - "DIALOGFLOW": "Dialoogstroom", + "DIAL": "Dial", + "DIALOGFLOW": "Dialogflow", "DIALOGFLOW_LANGUAGE": "Taal", - "DIGIT": "Maximaal aantal cijfers", - "DIGITS": "Cijfers", - "DOWNLOAD_SQUARERECORDING": "Opnames Downloaden", - "DROP_TO_UPLOAD": "Bestanden slepen om te uploaden", - "DROP_TO_UPLOAD_MESSAGE": "U kunt ook bestanden hiernaartoe slepen om ze te uploaden. Alleen XML - Max. 5MB", + "DIGIT": "Max Digits", + "DIGITS": "Digits", + "DOWNLOAD_SQUARERECORDING": "Download vierkante opnemen", + "DROP_TO_UPLOAD": "DROP om te uploaden", + "DROP_TO_UPLOAD_MESSAGE": "U kunt ook bestanden hier neer te uploaden. Alleen XML - Max. 5MB", "DSN": "DSN", - "EDIT": "Bewerken", - "EDIT_ODBC": "ODBC Bewerken", - "EDIT_PROJECT": "Project Bewerken", - "EDIT_SQUARERECORDING": "Opnames Bewerken", - "EDIT_XML": "XML aanpassen", - "END": "Einde", + "EDIT": "Edit", + "EDIT_ODBC": "Edit ODBC", + "EDIT_PROJECT": "Edit Project", + "EDIT_SQUARERECORDING": "Edit plein opnemen", + "EDIT_XML": "Edit XML", + "END": "End", "ERRORS": { - "DSN_REQUIRED": "Verplicht veld", - "FIELD_REQUIRED": "Verplicht veld", - "NAME_REQUIRED": "Verplicht veld", - "PROJECT_REQUIRED": "Verplicht veld", + "DSN_REQUIRED": "Het DSN is vereist", + "FIELD_REQUIRED": "Het is een verplicht veld", + "NAME_REQUIRED": "De naam is verplicht", + "PROJECT_REQUIRED": "Het project is vereist", "URL_REQUIRED": "Verplicht veld" }, - "ESCAPE_DIGITS": "Escape cijfers", + "ESCAPE_DIGITS": "Escape Digits", "EXTEN": "Uitbreiding", - "EXTENSION": "Extensie", - "EXT_DIAL": "Bellen naar extern", - "FILE": "Bestand", + "EXTENSION": "Extension", + "EXT_DIAL": "External Dial", + "FILE": "Filename", "FILENAME": "Bestandsnaam", "FILE_ID": "Audio", - "FINALLY": "Ten slotte", + "FINALLY": "Finally", "FINDBY": "Zoek naar", - "GETDIGITS": "Cijfers opvragen", - "GETSECRETDIGITS": "Geheime cijfers opvragen", - "GOAL": "Doel", - "GOALNAME": "Doelnaam", + "GETDIGITS": "Get Digits", + "GETSECRETDIGITS": "Get Secret Digits", + "GOAL": "Goal", + "GOALNAME": "Goal Name", "GOOGLEASR": "GoogleASR", "GOOGLE_ASR_LANGUAGE": "Taal", "GOOGLE_CLOUD_TTS": "Google Cloud TTS", - "GOOGLE_CLOUD_TTS_TEXT_TYPE": "Soort bericht", - "GOOGLE_TTS_LANGUAGE": "Taal", + "GOOGLE_CLOUD_TTS_TEXT_TYPE": "Bericht soort", + "GOOGLE_TTS_LANGUAGE": "Language", "GOSUB": "GoSub", "GOTOC": "GoTo", "GOTOIF": "GoToIf", "GOTOIFTIME": "GoToIfTime", "GO_TO_PROJECTS": "Ga naar projecten", "GRAMMAR": "Grammatica", - "HANGUP": "Ophangen", + "HANGUP": "Hangup", "HEADERS": "Kopteksten", "HELP": { - "BCC": "U kunt meerdere adressen toevoegen door ze te scheiden met een komma (bijvoorbeeld John.doe@xcally.com, jane.miller@xcally.com)", - "CC": "U kunt meerdere adressen toevoegen door ze te scheiden met een komma (bijvoorbeeld John.doe@xcally.com, jane.miller@xcally.com)", + "BCC": "U kunt meerdere adressen met een komma (bijvoorbeeld John.doe@xcally.com, jane.miller@xcally.com)", + "CC": "U kunt meerdere adressen met een komma (bijvoorbeeld John.doe@xcally.com, jane.miller@xcally.com)", "DSN": "Voorbeeld: DRIVER=MySQL;SERVER=127.0.0.1;uid=xcall;pwd=wachtwoord;DATABASE=motion", "MAILBOX": "Mailbox@context", "MAX_TEXT_TTS": "Het maximale aantal ondersteunde tekens is 200", - "TO": "U kunt meerdere adressen toevoegen door ze te scheiden met een komma (bijvoorbeeld John.doe@xcally.com, jane.miller@xcally.com)" + "TO": "U kunt meerdere adressen met een komma (bijvoorbeeld John.doe@xcally.com, jane.miller@xcally.com)" }, - "HIDDENDIGITSNUM": "Verborgen Cijfer Nummer", - "HIDDENDIGITSPOS": "Verborgen Cijfer Positie", - "ID": "ID", + "HIDDENDIGITSNUM": "Hiddden Digits Number", + "HIDDENDIGITSPOS": "Hidden Digits Position", + "ID": "Id", "IMPORT": "Importeren", - "IMPORT_XML": "Importeer XML", + "IMPORT_XML": "Import XML", "INTERVAL_ID": "Interval", - "INTKEY": "Toets voor onderbreken", + "INTKEY": "Interrupt Key", "ISPEECHASR": "ISpeech ASR", "ISPEECHTTS": "ISpeech Text-To-Speech", - "ISPEECH_ASR_LANGUAGE": "Taal", - "ISPEECH_TTS_LANGUAGE": "Taal", - "KEY": "Sleutel", + "ISPEECH_ASR_LANGUAGE": "Language", + "ISPEECH_TTS_LANGUAGE": "Language", + "KEY": "Key", "LABEL": "Label", "LANGUAGECODE": "Taalcode", - "LASTNAME": "Achternaam", - "LIST_ID": "Lijst", - "LOGIN": "Inloggen", + "LASTNAME": "Last Name", + "LIST_ID": "List", + "LOGIN": "Log in", "LOGOUT": "Uitloggen", "LUMENVOXASR": "Lumenvox ASR", "LUMENVOXTTS": "Lumenvox Text-To-Speech", "MACRO": "Macro", "MAILBOX": "Mailbox", - "MATH": "Wiskundefuncties", - "MAXDIGIT": "Maximaal aantal cijfers", + "MATH": "Math", + "MAXDIGIT": "Maximum Digits", "MENU": "Menu", "METHOD": "Methode", - "MINDIGIT": "Minimaal aantal cijfers", + "MINDIGIT": "Minimum Digits", "MODEL": "Model", "MRCPRECOG": "MRCPRecog", "MRCPSYNTH": "MRCPSynth", "NAME": "Naam", "NDAACTIVITY_TYPE": "Soort activiteit", - "NDAGENERATE_AUDIO": "Audiobestand genereren", + "NDAGENERATE_AUDIO": "Genereer audiobestand", "NDASSISTANT_URL": "NDASSISTANT URL", "NDAUTH_URL": "NDAUTH-URL", - "NEW": "Nieuw", - "NEW_ODBC": "Nieuwe ODBC Verbinding", - "NEW_PROJECT": "Nieuw Project", - "NEW_VARIABLE": "Nieuwe Variabele", + "NEW": "Nieuwe", + "NEW_ODBC": "Nieuwe ODBC verbinding", + "NEW_PROJECT": "Nieuw project", + "NEW_VARIABLE": "Nieuwe variabele", "NOOP": "NoOp", "NOTES": "Aantekeningen", "NO_AVAILABLE_INFO": "Geen beschikbare informatie", - "NUMBER": "Nummer", + "NUMBER": "Number", "ODBC": "ODBC", - "ODBC_ID": "ODBC Verbinding", + "ODBC_ID": "ODBC Connection", "OF": "Van", "OPEN": "Open", "OPEN_NEW_WINDOW": "Open in een nieuw venster", - "OPEN_PROJECT": "Project Openen", - "OPERATION": "Operatie", - "OPTIONS": "Opties", - "OPTS": "Opties", - "OUTPUT": "Resultaat", + "OPEN_PROJECT": "Project openen", + "OPERATION": "Operation", + "OPTIONS": "Options", + "OPTS": "Options", + "OUTPUT": "Output", "PAGE": "Pagina", "PASSWORD": "Wachtwoord", "PAUSE": "Pauze", - "PAUSE_ID": "Soort pauze", + "PAUSE_ID": "Pauzeer type", "PERMISSIONADD_PROJECTS": "Gebruikers toevoegen aan project", "PHONE": "Telefoon", - "PLAYBACK": "Afspelen", - "POSITION": "Positie", - "PRIORITY": "Prioriteit", + "PLAYBACK": "Playback", + "POSITION": "Position", + "PRIORITY": "Priority", "PROJECT": "Project", "PROJECTS": "Projecten", "PROJECT_ID": "Project", "QUERY": "Query", "QUEUE": "Queue", "QUEUE_ID": "Queue", - "RAWBODY": "Inhoud", + "RAWBODY": "Lichaam", "RAWHEADERS": "Kopteksten", - "RECORD": "Opname", - "RECORDINGFORMAT": "Opnameformaat", - "RESPONSE": "Reactie Timeout", + "RECORD": "Record", + "RECORDINGFORMAT": "Recording Format", + "RESPONSE": "Response Timeout", "RESTAPI": "Rest API", - "RETRY": "Pogingen", + "RETRY": "Retries", "ROWSPERPAGE": "Rijen per pagina", "SAVE": "Opslaan", - "SAYDIGITS": "Cijfers uitspreken", - "SAYNUMBER": "Nummer uitspreken", - "SAYPHONETIC": "Fonetisch uitspreken", - "SEARCH_FOR_ANYONE": "Zoeken", + "SAYDIGITS": "Say Digits", + "SAYNUMBER": "Say number", + "SAYPHONETIC": "Say Phonetics", + "SEARCH_FOR_ANYONE": "Zoeken voor iedereen", "SELECTED": "Geselecteerd", - "SELECTED_USERS": "Geselecteerde Gebruikers", - "SELECT_ALL": "Selecteer Alles ", - "SELECT_NONE": "Selecteer Geen.", + "SELECTED_USERS": "Geselecteerde gebruikers", + "SELECT_ALL": "Alles selecteren", + "SELECT_NONE": "Selecteer None (Geen).", "SENDFAX": "Fax verzenden", - "SENDMAIL": "Mail verzenden", - "SENDSMS": "SMS verzenden", + "SENDMAIL": "Send Mail", + "SENDSMS": "Send SMS", "SESTEKASR": "Sestek ASR", "SESTEKNDA": "Sestek NDA", "SESTEKTTS": "Sestek TTS", @@ -207,38 +207,38 @@ "SMS_ACCOUNT_ID": "Account", "SMS_TEXT": "Text", "SPEED": "Speed", - "SQUARERECORDINGS": "Opnames", + "SQUARERECORDINGS": "Vierkante opnamen", "SSMLGENDER": "Geslacht", "START": "Start", - "SUBJECT": "Onderwerp", + "SUBJECT": "Subject", "SUBPROJECT": "Sub Project", - "SYSTEM": "Systeem", + "SYSTEM": "System", "TELEPHONES": "Telefoons", - "TEMPLATE_ID": "Sjabloon", + "TEMPLATE_ID": "Template", "TEST_ODBC": "Test ODBC", "TEXT": "Text", "TILDEASR": "Tilde ASR", "TIMEOUT": "Timeout", - "TO": "Naar", + "TO": "To", "TRUNK_NAME": "Trunk", "TTS": "Google Text-To-Speech", "UNIQUEID": "Unieke ID", "UNPAUSE": "Einde pauze", "UPDATE_DESCRIPTION": "Beschrijving van update", - "UPDATE_INFO": "Gegevens Bijwerken", + "UPDATE_INFO": "Gegevens bijwerken", "URI": "URI", "URL": "URL", "USERNAME": "Gebruikersnaam", "USERS": "Gebruikers", - "VARIABLE_ID": "Variabele", - "VARIABLE_VALUE": "Waarde", + "VARIABLE_ID": "Variable", + "VARIABLE_VALUE": "Value", "VOICEMAIL": "Voicemail", - "VSWITCH": "Variabele schakelaar", + "VSWITCH": "Variable Switch", "CLIENT_EMAIL": "E-mail van de klant", "DIALOGFLOWV2": "DialogflowV2", "DIALOGFLOWV2_LANGUAGE": "Taal", "DIALOGFLOWV2_PROJECT_ID": "Project-ID", - "PRIVATE_KEY": "Geheime sleutel", + "PRIVATE_KEY": "Prive sleutel", "DIALTIMEZONE": "Kies tijdzone" } } diff --git a/public/app/main/apps/callysquare/i18n/pt-BR.json b/public/app/main/apps/callysquare/i18n/pt-BR.json index 97801f3..42dd4c2 100644 --- a/public/app/main/apps/callysquare/i18n/pt-BR.json +++ b/public/app/main/apps/callysquare/i18n/pt-BR.json @@ -12,21 +12,21 @@ "APIKEY": "Chave API", "APPID": "ID do aplicativo", "APPLICATION": "Aplicação", - "APPSECRET": "App Senha", + "APPSECRET": "App Secret", "ARGS": "Argumentos", "ATTACHMENT_NAME": "Nome do anexo", "ATTACHMENT_PATH": "Caminho de anexos", "ATTACHMENT_TYPE": "Tipo de anexo", - "AUDIO": "Audio", + "AUDIO": "Áudio", "AUDIOENCODING": "Codificação de áudio", "AWSLEX": "AWS Lex", "AWSPOLLY": "AWS Polly", - "AWS_ACCESS_KEY_ID": "Access Key ID", + "AWS_ACCESS_KEY_ID": "Access key ID", "AWS_BOT_NAME": "Nome BOT", "AWS_LEX_REGION": "Região", "AWS_POLLY_REGION": "Região", "AWS_POLLY_VOICE": "Voz", - "AWS_SECRET_ACCESS_KEY": "Secret Access Key", + "AWS_SECRET_ACCESS_KEY": "AWS Secret Access Key", "AWS_TEXT_TYPE": "Tipo de texto", "BACK": "Voltar", "BCC": "BCC", @@ -45,11 +45,11 @@ "COPY": "Copiar", "COPY_PROJECT": "Copiar projeto", "CREATED_AT": "Criado em", - "CUSTOM_ACTION": "Ação Personalizada", + "CUSTOM_ACTION": "Ação personalizada", "CUSTOM_ACTION_DATA": "Dados de ação personalizada", - "CUSTOM_APP": "Aplicativo Personalizado", + "CUSTOM_APP": "Aplicativo personalizado", "DATABASE": "Base de dados", - "DELAY": "delay [min]", + "DELAY": "Delay [min]", "DELETE": "Excluir", "DELETE_ODBC": "Deletar ODBC", "DELETE_PROJECT": "Deletar projeto", @@ -58,10 +58,10 @@ "DIAL": "Discar", "DIALOGFLOW": "Dialogflow", "DIALOGFLOW_LANGUAGE": "Idioma", - "DIGIT": "Dígito", + "DIGIT": "Max dígitos", "DIGITS": "Dígitos", "DOWNLOAD_SQUARERECORDING": "Download gravação", - "DROP_TO_UPLOAD": "Soltar para UPLOAD", + "DROP_TO_UPLOAD": "Soltar para upload", "DROP_TO_UPLOAD_MESSAGE": "Você também pode soltar arquivos aqui para fazer o upload. Apenas XML - Máx. 5MB", "DSN": "DSN", "EDIT": "Editar", @@ -77,13 +77,13 @@ "PROJECT_REQUIRED": "Campo obrigatório", "URL_REQUIRED": "Campo obrigatório" }, - "ESCAPE_DIGITS": "Dígitos de Escape", + "ESCAPE_DIGITS": "Dígitos de escape", "EXTEN": "Exten", "EXTENSION": "Extensão", - "EXT_DIAL": "Discagem Externa", + "EXT_DIAL": "Discagem externa", "FILE": "Nome do arquivo", "FILENAME": "Nome do arquivo", - "FILE_ID": "Áudio", + "FILE_ID": "Audio", "FINALLY": "Finalmente", "FINDBY": "Encontrar por", "GETDIGITS": "Obter dígitos", @@ -117,9 +117,9 @@ "IMPORT": "Importar", "IMPORT_XML": "Importar XML", "INTERVAL_ID": "Intervalo", - "INTKEY": "Interrupt Key", + "INTKEY": "Interrupt key", "ISPEECHASR": "iSpeech ASR", - "ISPEECHTTS": "iSpeech Text-To-Speech", + "ISPEECHTTS": "iSpeech TTS", "ISPEECH_ASR_LANGUAGE": "Idioma", "ISPEECH_TTS_LANGUAGE": "Idioma", "KEY": "Key", @@ -188,8 +188,8 @@ "RETRY": "Repetições", "ROWSPERPAGE": "Linhas por página", "SAVE": "Salvar", - "SAYDIGITS": "Falar Digitos", - "SAYNUMBER": "Falar número", + "SAYDIGITS": "Say Digits", + "SAYNUMBER": "Say number", "SAYPHONETIC": "Say Phonetics", "SEARCH_FOR_ANYONE": "Procurar", "SELECTED": "Selecionado", @@ -202,7 +202,7 @@ "SESTEKASR": "Sestek ASR", "SESTEKNDA": "Sestek NDA", "SESTEKTTS": "Sestek TTS", - "SET": "Aplicar", + "SET": "Set", "SIP_ID": "SIP", "SMS_ACCOUNT_ID": "Conta", "SMS_TEXT": "Texto", @@ -225,7 +225,7 @@ "UNIQUEID": "Unique ID", "UNPAUSE": "Fim da Pausa", "UPDATE_DESCRIPTION": "Atualizar descrição", - "UPDATE_INFO": "Atualizar informação", + "UPDATE_INFO": "Informação de atualização", "URI": "URI", "URL": "URL", "USERNAME": "Nome de usuário", @@ -233,7 +233,7 @@ "VARIABLE_ID": "Variável", "VARIABLE_VALUE": "Valor", "VOICEMAIL": "Correio de voz", - "VSWITCH": "Variable Switch", + "VSWITCH": "Variable switch", "CLIENT_EMAIL": "Email do cliente", "DIALOGFLOWV2": "DialogflowV2", "DIALOGFLOWV2_LANGUAGE": "Língua", diff --git a/public/app/main/apps/chat/i18n/de.json b/public/app/main/apps/chat/i18n/de.json index 112cad3..9fd2be8 100644 --- a/public/app/main/apps/chat/i18n/de.json +++ b/public/app/main/apps/chat/i18n/de.json @@ -2,149 +2,149 @@ "CHAT": { "AMAZONLEX": "Amazon Lex", "TEXT": "Text", - "TIMES": "Anzeigehäufigkeit automatische Antwort", + "TIMES": "Anzahl der Zeiten pro Interaktion", "EDIT_AUTOREPLY": "Automatische Antwort bearbeiten", "AUTOREPLY": "Automatische Antwort", "NEW_CHATDISPOSITION": "Neue Chat-Qualifizierung", - "ENABLECUSTOMERATTACHMENT": "Kunde darf Anhänge im Chat hochladen", - "OFFLINE_CHAT_BUTTON": "Text auf dem Button zum Hinterlassen einer Nachricht, wenn Chat offline", - "OFFLINESTATUS": "Verhalten - Chat ist offline (Außerhalb Geschäftszeiten)", + "ENABLECUSTOMERATTACHMENT": "Kundenanhänge aktivieren", + "OFFLINE_CHAT_BUTTON": "Button Chat offline", + "OFFLINESTATUS": "Offline Status", "NAME": "Name", "CHATQUEUES": "Chat-Warteschlangen", "SEARCH_FOR_ANYONE": "Suche", - "STRATEGY": "Verteilungsstrategie an freie Agenten", - "AGENT_TIMEOUT": "Klingelzeit (in Sekunden), bevor Weiterleitung an den nächsten Agenten erfolgt", + "STRATEGY": "Strategie", + "AGENT_TIMEOUT": "Agent Timeout", "DESCRIPTION": "Beschreibung", - "KEY": "Kurzname", + "KEY": "Schlüssel", "ALIAS": "Alias-Name", - "VARIABLE": "Variabel", - "INTERVAL": "Zeitplanung", - "EDIT_CLOSE": "Interaktion schließen und Qualifizierung hinzufügen", + "VARIABLE": "Variable", + "INTERVAL": "Intervall", + "EDIT_CLOSE": "Bearbeitung abschließen", "TIMEZONE": "Zeitzone", "MESSAGE": "Nachricht", - "ADVANCED": "Skript und Zeitplanung", - "FORWARDTRANSCRIPT": "Kunde kann Chatverlauf per E-Mail anfordern", - "FORWARDTRANSCRIPTMESSAGE": "Einleitungstext für die automatische E-Mail", - "SKIPMESSAGEBUTTON": "Text auf dem Button zum Überspringen der Bewertung/Feedback nach einem Chat", + "ADVANCED": "Erweitert", + "FORWARDTRANSCRIPT": "Transkript weiterleiten", + "FORWARDTRANSCRIPTMESSAGE": "Transkript-Nachricht weiterleiten", + "SKIPMESSAGEBUTTON": "Nachrichtenbutton überspringen", "EDIT_MESSAGE": "Nachricht bearbeiten", - "CONDITION_AGREEMENT": "Chatbedingungen zustimmen", + "CONDITION_AGREEMENT": "Konditionelle Vereinbarung", "NONE": "Nichts", "PRIORITY": "Priorität", - "ONLINESTATUS": "Verhalten - Chat ist online", - "UNMANAGEDSTATUS": "Verhalten - Chat ist nicht verfügbar", - "AUTOCLOSE": "Automatisches Abweisen, wenn kein Agent verfügbar", - "ENABLEUNMANAGEDNOTE": "Automatische Nachricht, wenn Chat nicht verfügbar", - "UNMANAGEDMESSAGE": "Hier Nachricht für den Kunden eingeben, wenn der Chat nicht verfügbar ist", - "SKIPUNMANAGED": "Text auf dem Button zum Beenden des Chats ohne Hinterlassen einer Nachricht", - "SENDUNMANAGED": "Text auf dem Button zum Beenden des Chats mit Hinterlassen einer Nachricht", + "ONLINESTATUS": "Online Status", + "UNMANAGEDSTATUS": "Status nicht bearbeitet", + "AUTOCLOSE": "Automatisches Schließen aktivieren", + "ENABLEUNMANAGEDNOTE": "Unbearbeitete Nachricht aktivieren", + "UNMANAGEDMESSAGE": "Unbearbeitete Nachricht", + "SKIPUNMANAGED": "Nachricht überspringen", + "SENDUNMANAGED": "Nachricht senden", "WEBSITESCRIPT": "Webseiten-Skript", "DELETE_OFFLINEMESSAGE": "Löschen", - "OFFLINEMESSAGES": "Offline-Nachrichten", - "FORWARD_OFFLINE": "Offline-Nachrichten per E-Mail weiterleiten (extern)", + "OFFLINEMESSAGES": "Offline Nachrichten", + "FORWARD_OFFLINE": "Offline weiterleiten", "SHOW_OFFLINEMESSAGE": "Anzeigen", - "FORWARD_OFFLINE_ADDRESS": "Empfängeradresse eingeben", - "CLOSINGFORM": "Verhalten bei Chatende", - "ENABLERATING": "Bewertung ermöglichen", + "FORWARD_OFFLINE_ADDRESS": "Offline-Adresse weiterleiten", + "CLOSINGFORM": "Formular schließen", + "ENABLERATING": "Bewertung aktivieren", "ENABLECUSTOMERWRITING": "Kunde kann schreiben, bevor Chat akzeptiert wird", - "ENABLEFEEDBACK": "Feedback ermöglichen", + "ENABLEFEEDBACK": "Feedback aktivieren", "RATINGTYPE": "Bewertungstyp", - "CLOSINGMESSAGE": "Nachricht bei Chatende", - "CLOSINGMESSAGEBUTTON": "Text auf dem Button zum Beenden des Chats", - "RATINGSTARSNUMBER": "Anzahl der Bewertungssterne (1-5)", - "EDIT_GOTOIF": "Bedingung bearbeiten und Priorität zuweisen", + "CLOSINGMESSAGE": "Abschluss Nachricht", + "CLOSINGMESSAGEBUTTON": "Button für Abschluss Nachricht", + "RATINGSTARSNUMBER": "Anzahl der Bewertungssterne", + "EDIT_GOTOIF": "GotoIf bearbeiten", "CONDITION": "Bedingung", - "TRUEPRIORITY": "Priorität, wenn erfüllt (true)", - "FALSEPRIORITY": "Priorität, wenn nicht erfüllt (false)", + "TRUEPRIORITY": "Wahre Priorität", + "FALSEPRIORITY": "Falsche Priorität", "VALUE": "Wert", "WEBSITEALIAS": "Website-Alias", "ERRORS": { - "TEXT_REQUIRED": "Text erforderlich", - "SENDUNMANAGED_REQUIRED": "Text erforderlich", - "SENDUNMANAGED_MAX_LENGTH": "Text darf nicht länger als {{max}} Zeichen sein", - "SKIPUNMANAGED_MAX_LENGTH": "Text darf nicht länger als {{max}} Zeichen sein", - "UNMANAGEDMESSAGE_MAX_LENGTH": "Text darf nicht länger als {{max}} Zeichen sein", - "WEBSITEALIAS_MAX_LENGTH": "Name darf nicht länger als {{max}} Zeichen sein", - "AGENT_REQUIRED": "Agent erforderlich", - "QUEUE_REQUIRED": "Warteschlange erforderlich", - "CONDITION_REQUIRED": "Bedingung (Variabel oder Wert) erforderlich", - "PRIORITY_REQUIRED": "Priorität erforderlich", - "TRUEPRIORITY_REQUIRED": "Priorität bei zutreffender Bedingung erforderlich", - "FALSEPRIORITY_REQUIRED": "Priorität bei nicht zutreffender Bedingung erforderlich", - "NAME_REQUIRED": "Name erforderlich", - "LIST_REQUIRED": "Liste erforderlich", - "AGENT_TIMEOUT_REQUIRED": "Zeitüberschreitung Agent erforderlich", - "MOTIONADDRESS_REQUIRED": "Adresse erforderlich", - "DISPOSITION_REQUIRED": "Qualifizierung erforderlich", - "MOTIONADDRESS_MUST_VALID_URL": "URL Format ungültig", - "EMAIL_MUST_BE_VALID": "E-Mail Format ungültig", - "ADDRESS_REQUIRED": "Adresse erforderlich", - "ADDRESS_MUST_VALID_URL": "URL Format ungültig", - "ENQUIRY_FORWARDING_ADDRESS_REQUIRED": "E-Mail Adresse erforderlich", - "ACCEPTURL_MUST_VALID_URL": "URL Format ungültig", - "TIMEOUT_REQUIRED": "Zeitüberschreitung erforderlich", - "REJECTURL_MUST_VALID_URL": "URL Format ungültig", - "CLOSEURL_MUST_VALID_URL": "URL Format ungültig", - "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Priorität muss größer oder gleich sein als", - "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Priorität bei Bedingung erfüllt muss größer oder gleich sein als", - "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Priorität bei Bedingung nicht erfüllt muss größer oder gleich sein als", - "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung muss größer oder gleich sein als", - "POLLING_INTERVAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Aktualisierungsintervall muss größer oder gleich sein als", - "WAITINGMESSAGE_REQUIRED": "Wartenachricht erforderlich", - "WAITINGTITLE_REQUIRED": "Titel während Warten erforderlich", - "KEY_MAX_LENGTH": "Wert darf nicht länger als {{max}} Zeichen sein", - "KEY_REQUIRED": "Eingabe erforderlich", - "WAITINGMESSAGE_MAX_LENGTH": "Text darf nicht länger als {{max}} Zeichen sein", - "WAITINGTITLE_MAX_LENGTH": "Titel darf nicht länger als {{max}} Zeichen sein", - "RATINGSTARSNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Anzahl muss größer oder gleich sein als", - "HEADER_OFFLINE_MAX_LENGTH": "Titel darf nicht länger als {{max}} Zeichen sein", - "OFFLINE_CHAT_BUTTON_MAX_LENGTH": "Text darf nicht länger als {{max}} Zeichen sein", - "CLOSINGQUESTION_MAX_LENGTH": "Text darf nicht länger als {{max}} Zeichen sein", - "TEXT_MAX_LENGTH": "Text darf nicht länger als {{max}} Zeichen sein", - "VALUE_REQUIRED": "Wert erforderlich", - "OFFLINEMESSAGESUBJECT_MAX_LENGTH": "Text darf nicht länger als {{max}} Zeichen sein", - "OFFLINEMESSAGEBODY_MAX_LENGTH": "Text darf nicht länger als {{max}} Zeichen sein", - "PLACEHOLDERMESSAGE_MAX_LENGTH": "Text darf nicht länger als {{max}} Zeichen sein", - "NOTETITLE_MAX_LENGTH": "Text darf nicht länger als {{max}} Zeichen sein", - "FORMSUBMITSUCCESSMESSAGE_MAX_LENGTH": "Text darf nicht länger als {{max}} Zeichen sein", - "FORMSUBMITFAILUREMESSAGE_MAX_LENGTH": "Text darf nicht länger als {{max}} Zeichen sein", - "FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Schriftgröße muss größer oder gleich sein als", - "FONTSIZE_REQUIRED": "Schriftgröße erforderlich", - "COMMAND_REQUIRED": "Eingabe erforderlich", + "TEXT_REQUIRED": "Pflichtfeld", + "SENDUNMANAGED_REQUIRED": "Pflichtfeld", + "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", + "PRIORITY_REQUIRED": "Pflichtfeld", + "TRUEPRIORITY_REQUIRED": "Pflichtfeld", + "FALSEPRIORITY_REQUIRED": "Pflichtfeld", + "NAME_REQUIRED": "Pflichtfeld", + "LIST_REQUIRED": "Pflichtfeld", + "AGENT_TIMEOUT_REQUIRED": "Pflichtfeld", + "MOTIONADDRESS_REQUIRED": "Pflichtfeld", + "DISPOSITION_REQUIRED": "Pflichtfeld", + "MOTIONADDRESS_MUST_VALID_URL": "Falsches Format", + "EMAIL_MUST_BE_VALID": "Falsches Format", + "ADDRESS_REQUIRED": "Pflichtfeld", + "ADDRESS_MUST_VALID_URL": "Falsches Format", + "ENQUIRY_FORWARDING_ADDRESS_REQUIRED": "Pflichtfeld", + "ACCEPTURL_MUST_VALID_URL": "Falsches Format", + "TIMEOUT_REQUIRED": "Pflichtfeld", + "REJECTURL_MUST_VALID_URL": "Falsches Format", + "CLOSEURL_MUST_VALID_URL": "Falsches Format", + "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": "Wert darf eine maximale Länge haben von {{max}} ", + "KEY_REQUIRED": "Pflichtfeld", + "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": "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": "Wert muss größer oder gleich sein als", - "NAME_MUST_VALID_PATTERN": "Ungültiges Format Name", - "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung Agent muss kleiner oder gleich sein als", - "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung Agent muss kleiner oder gleich sein als", + "NAME_MUST_VALID_PATTERN": "Falsches Format", + "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": "Auf zugewiesenen Agenten warten erforderlich", + "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Pflichtfeld", "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": "Eingabe erforderlich", - "CUSTOMERALIAS_MAX_LENGTH": "Text darf nicht länger als {{max}} Zeichen sein", - "TAG_REQUIRED": "Eingabe erforderlich", - "MESSAGEFONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Schriftgröße muss größer oder gleich sein als", - "MESSAGEFONTSIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Schriftgröße muss kleiner oder gleich sein als", - "MESSAGEFONTSIZE_REQUIRED": "Schriftgröße erforderlich", - "AGENTALIAS_REQUIRED": "Agenten-Alias erforderlich", - "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung muss größer oder gleich sein als", - "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung muss kleiner oder gleich sein als", - "AGENTTRANSFERTIMEOUT_REQUIRED": "Zeitüberschreitung erforderlich", - "CUSTOMERALIAS_REQUIRED": "Kunden-Alias erforderlich", - "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung muss größer oder gleich sein als", - "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung muss kleiner oder gleich sein als", - "QUEUETRANSFERTIMEOUT_REQUIRED": "Zeitüberschreitung erforderlich", - "SYSTEMALIAS_MAX_LENGTH": "Name darf nicht länger als {{max}} Zeichen sein", - "SYSTEMALIAS_REQUIRED": "System-Alias erforderlich", - "ACCESSKEYID_REQUIRED": "ZugangsID erforderlich", - "BOTNAME_REQUIRED": "Name des BOT-Assistenten erforderlich", - "SECRETACCESSKEY_REQUIRED": "Eingabe erforderlich", - "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "PausenID während Qualifizierung erforderlich", - "VIDAOOAPIKEY_REQUIRED": "Vidaoo API-Zugang erforderlich", - "CLIENTEMAIL_REQUIRED": "E-Mail des Kunden erforderlich", - "PRIVATEKEY_REQUIRED": "Privater Schlüssel erforderlich", - "PROJECTID_REQUIRED": "Projekt-ID erforderlich", - "VIDAOOTOPIC_REQUIRED": "Vidaoo-Thema erforderlich", - "EMAIL_ACCOUNT_REQUIRED": "E-Mail erforderlich" + "VERTICALPOSITION_REQUIRED": "Pflichtfeld", + "CUSTOMERALIAS_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}} ", + "TAG_REQUIRED": "Pflichtfeld", + "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": "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": "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": "Wert darf eine maximale Länge haben von {{max}} ", + "SYSTEMALIAS_REQUIRED": "Pflichtfeld", + "ACCESSKEYID_REQUIRED": "Pflichtfeld", + "BOTNAME_REQUIRED": "Pflichtfeld", + "SECRETACCESSKEY_REQUIRED": "Pflichtfeld", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Pflichtfeld", + "VIDAOOAPIKEY_REQUIRED": "Pflichtfeld", + "CLIENTEMAIL_REQUIRED": "Pflichtfeld", + "PRIVATEKEY_REQUIRED": "Pflichtfeld", + "PROJECTID_REQUIRED": "Pflichtfeld", + "VIDAOOTOPIC_REQUIRED": "Pflichtfeld", + "EMAIL_ACCOUNT_REQUIRED": "Pflichtfeld" }, "CM_FIELD": "Kontaktmanager-Feld", "CHATPROACTIVEACTIONS": "Proaktive Anfragen", @@ -155,25 +155,25 @@ "NO_CHATPROACTIVEACTION_AVAILABLE": "Keine proaktiven Anfragen verfügbar", "NO_OFFLINEMESSAGE_AVAILABLE": "Keine Offline-Nachrichten verfügbar", "MOUSEOVER": "Mouse-Over", - "TIMEOUT": "Zeitüberschreitung", + "TIMEOUT": "Timeout", "TYPE": "Typ", - "SELECTOR": "Auswahl/Bereich", + "SELECTOR": "Selektion", "AGENT": "Agent", - "GOTO": "GeheZu (GoTo)", - "GOTOIF": "GeheZuWenn (GoToIf)", - "NOOP": "Log erstellen (NoOp)", + "GOTO": "Goto", + "GOTOIF": "GotoIf", + "NOOP": "Noop", "QUEUE": "Warteschlange", - "BUILDER": "Formularerstellung", + "BUILDER": "Builder", "PREVIEW": "Vorschau", "EDIT_AGENT": "Agenten bearbeiten", "EDIT_QUEUE": "Warteschlange bearbeiten", - "EDIT_GOTO": "GeheZu bearbeiten", - "EDIT_GOTOIf": "GeheZuWenn bearbeiten", - "EDIT_NOOP": "Log-Erstellung bearbeiten", + "EDIT_GOTO": "Goto bearbeiten", + "EDIT_GOTOIf": "GotoIf bearbeiten", + "EDIT_NOOP": "Noop bearbeiten", "ADD_CHATQUEUE": "Chat-Warteschlange hinzufügen", "EDIT_CHATQUEUE": "Chat-Warteschlange bearbeiten", "DELETE_CHATQUEUE": "Chat-Warteschlange löschen", - "SETTINGS": "Allg. Einstellungen", + "SETTINGS": "Einstellungen", "SAVE": "Speichern", "SCRIPT": "Skript", "TOKEN": "Token", @@ -185,7 +185,7 @@ "EDIT_CHATWEBSITE": "Chat-Webseite bearbeiten", "DELETE_CHATWEBSITE": "Chat-Webseite löschen", "LIST": "Liste", - "SNIPPET": "Chat-Widget", + "SNIPPET": "Snippet", "FORMS": "Formulare", "UP": "Nach Oben", "DOWN": "Nach Unten", @@ -193,9 +193,9 @@ "PROACTIVEACTIONS": "Proaktive Anfragen", "DISPOSITIONS": "Qualifizierungen", "WEBHOOKS": "WebHooks", - "ACTIONS": "Routing", + "ACTIONS": "Aktionen", "FIDELITY": "Treue", - "APPEARANCE": "Darstellung Widget", + "APPEARANCE": "Darstellung", "MAINCOLOR": "Hauptfarbe", "FOCUSCOLOR": "Fokusfarbe", "BUTTONCOLOR": "Buttonfarbe", @@ -204,79 +204,79 @@ "DEFAULT": "Standard", "WHITELABEL": "White Label", "LOGO": "Logo", - "DOWNLOADTRANSCRIPT": "Kunde darf Chatverlauf herunterladen (.csv-Datei)", - "ENQUIRY_ENABLE": "Anfrage ermöglichen", + "DOWNLOADTRANSCRIPT": "Transkript herunterladen", + "ENQUIRY_ENABLE": "Anfrage aktivieren", "ENQUIRY_FORWARDING": "Weiterleitung von Anfragen", - "ENQUIRY_FORWARDING_ADDRESS": "Weiterleitungsadresse für Anfragen", + "ENQUIRY_FORWARDING_ADDRESS": "Anfrage-Weiterleitungsadresse", "LABELS": "Labels", - "HEADER_ONLINE": "Kopfzeile auf Widget, wenn Chat geöffnet", - "ONLINE_MESSAGE": "Nachricht wenn online", - "NAME_TITLE": "Titel", - "USERNAME_PLACEHOLDER": "Nutzernamen", + "HEADER_ONLINE": "Online-Kopfzeile", + "ONLINE_MESSAGE": "Online Nachricht", + "NAME_TITLE": "Name Titel", + "USERNAME_PLACEHOLDER": "Platzhalter für Nutzernamen", "EMAIL_TITLE": "E-Mail Titel", - "EMAIL_PLACEHOLDER": "E-Mail Adresse", - "START_CHAT_BUTTON": "Text auf dem Button zum Starten des Chats", - "AGENTS_BUSY": "Alle Agenten besetzt", - "HEADER_OFFLINE": "Kopfzeile auf Widget, wenn Chat nicht geöffnet", - "OFFLINE_MESSAGE": "Nachricht wenn offline", - "MESSAGE_TITLE": "Titel der Nachricht", - "ENQUIRY_MESSAGE_PLACEHOLDER": "Nachricht", - "ENQUIRY_BUTTON": "Text auf dem Button zum Starten der Anfrage", - "RATING_MESSAGE": "Nachricht zur Bewertung", - "RATING_SEND": "Bewertung absenden", - "RATING_SKIP": "Bewertung überspringen", - "ONLINE": "Formularbuilder online", - "OFFLINE": "Formularbuilder offline", - "PROACTIVE": "Proaktive Anfrage", + "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": "Nachricht Titel", + "ENQUIRY_MESSAGE_PLACEHOLDER": "Platzhalter für Nachrichteneingabe", + "ENQUIRY_BUTTON": "Anfrage-Button", + "RATING_MESSAGE": "Bewertungsnachricht", + "RATING_SEND": "Button Bewertung senden", + "RATING_SKIP": "Button Bewertung überspringen", + "ONLINE": "Online", + "OFFLINE": "Offline", + "PROACTIVE": "Proaktiv", "ACCEPT": "Akzeptieren", "ACCEPTMETHOD": "Methode akzeptieren", "ACCEPTURL": "URL akzeptieren", "REJECT": "Ablehnen", "REJECTMETHOD": "Methode ablehnen", "REJECTURL": "URL ablehnen", - "CLOSE": "Schließen und Qualifizieren", + "CLOSE": "Schließen", "CLOSEMETHOD": "Methode schließen", "CLOSEURL": "URL schließen", "EMBEDDING": "Einbetten", "GENERAL": "Allgemein", - "SELECTED": "Ausgewählt", + "SELECTED": "Ausgewählte", "SELECT_ALL": "Alles auswählen", "SELECT_NONE": "Nichts auswählen", "BACK": "Zurück", "HELP": { "MAPKEY": "Das folgende Feld aus dem Kontaktmanager:", - "FROMKEY": "wird in dem Chat-Widget wie folgt zugeordnet:", + "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@test.com, jane.miller@test.com)", + "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", + "NAME": "Nur Zahlen, Buchstaben und Sonderzeichen (._) werden unterstützt.", "LIST": "Liste für die Zuordnung aus dem Kontaktmanager", - "KEY": "Der Kurzname der Chat-Webseite (max. 5 Zeichen), welcher im Agententab bei eingehender Interaktion angezeigt wird", - "INTEVAL": "Wählen Sie hier aus einem in den Werkzeugen definiertem Zeitintervall aus", + "KEY": "Website-Kurzname (5 Zeichen), der auf der Registerkarte \"Agent\" angezeigt wird", + "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": "Dem Kunden anbieten, den Chatverlauf nach Abschluss per E-Mail zu versenden", - "AUTOCLOSE": "Trennt die Verbindung zum Chat, wenn innerhalb der Öffnungszeiten kein Agent verfügbar ist. Der Kunde kann optional eine Nachricht hinterlassen", + "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 nimmt. Hinweis: Hierdurch werden keine Chats in den Status \"unbearbeitet\" gesetzt", - "INTERVAL": "Zeitintervall auswählen", - "HIDEWHENOFFLINE": "Blendet das Widget aus, wenn der Chat offline ist", - "AGENTIDENTIFIER": "Agentenkennung innerhalb der Chat-Sitzung im Widget", + "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": "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": "Prozentualer Abstand in Prozent vom oberen Bildschirmrand", - "WELCOMEMESSAGE": "Automatische Begrüßungsnachricht. Leer lassen, um keine automatische Nachricht zu senden", + "WELCOMEMESSAGE": "Leer lassen, um keine Nachricht zu senden", "MANDATORYDISPOSITION": "Qualifizierung erforderlich", "MANDATORYDISPOSITIONPAUSEID": "PausenID bei erforderlicher Qualifizierung" }, "ADDRESS": "Adresse", - "ONLINESTATE": "Status Online", - "OFFLINESTATE": "Status Offline", - "RATINGSTATE": "Status Bewertung", + "ONLINESTATE": "Online Status", + "OFFLINESTATE": "Offline Status", + "RATINGSTATE": "Bewertungsstatus", "ENQUIRY": "Anfrage", - "OFFLINETEMPLATE": "Vorlage wenn offline", + "OFFLINETEMPLATE": "Offline Vorlage", "CHATDISPOSITIONS": "Chat-Qualifizierungen", "NO_CHATDISPOSITION_AVAILABLE": "Keine Qualifizierung verfügbar", "ADD_CHATDISPOSITION": "Qualifizierung hinzufügen", @@ -319,13 +319,13 @@ "NOTES": "Notizen", "NO_INTERACTION_AVAILABLE": "Keine Interaktionen verfügbar", "SELECTED_WEBSITE": "Ausgewählte Webseite", - "GOTOP": "Priorität setzen (GoToP)", - "EDIT_GOTOP": "GoToP bearbeiten", + "GOTOP": "Gotop", + "EDIT_GOTOP": "Gotop bearbeiten", "SELECT_WEBSITE": "Webseite auswählen", "INFO": "Info", - "OFFLINEMESSAGES_CHATWEBSITE": "Direkt zu Offline-Nachrichten", - "WAITINGTITLE": "Kopfzeile während auf einen freien Agenten gewartet wird", - "WAITINGMESSAGE": "Nachricht während Warten", + "OFFLINEMESSAGES_CHATWEBSITE": "Zu Offline-Nachrichten gehen", + "WAITINGTITLE": "Titel während Warten", + "WAITINGMESSAGE": "Wartenachricht", "RATING": "Bewertung", "NO_RATINGVALUE": "Keine Bewertung", "AGENTSADD_QUEUE": "Agenten zur Chat-Warteschlange hinzufügen", @@ -344,8 +344,8 @@ "AGENTS": "Agenten", "FULLNAME": "Vollständiger Name", "INTERNAL": "Intern", - "PHONE_STATE": "Status Nebenstelle", - "PHONE_STATUS": "Status SIP", + "PHONE_STATE": "Telefonstatus", + "PHONE_STATUS": "Telefonstatus", "LOGOUT": "Abmelden", "UNPAUSE": "Pause beenden", "AGENTADD_QUEUE": "Agenten zur Chat-Warteschlange hinzufügen", @@ -358,56 +358,56 @@ "IN_USE": "In Verwendung", "VOICE": "Anrufe", "NO_AGENT_ONLINE": "Kein Agent Online", - "GOTOREALTIME_CHATQUEUE": "Direkt zur Echtzeit-Warteschlange", + "GOTOREALTIME_CHATQUEUE": "Zur Echtzeit-Warteschlange für Chat gehen", "PARTIALPAUSE": "Teilpause", "BUSY": "Besetzt", "TIMER": "Timer", - "IDLE": "Leerlauf", + "IDLE": "Inaktiv", "CAPACITY": "Kapazität", "TAGS": "Tags", "SHOWAGENTAVATAR": "Persönlichen Agenten-Avatar anzeigen", "AGENTAVATAR": "Agenten-Avatar", - "SPYINTERACTION": "Chat anzeigen", - "INTERACTIONS_CHATWEBSITE": "Direkt zu Interaktionen", + "SPYINTERACTION": "Mitlesen", + "INTERACTIONS_CHATWEBSITE": "Zu den Interaktionen gehen", "REFRESH_INTERACTIONS": "Interaktionen aktualisieren", - "CLOSINGQUESTION": "Frage beim Beenden des Chats", + "CLOSINGQUESTION": "Abschlussfrage", "WEBSCRIPT": "Webskript", "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 für Offline-Interaktionen", - "OFFLINEMESSAGEBODY": "Text der Nachricht für Offline-Interaktionen", - "FORMSUBMITSUCCESSMESSAGE": "Nachricht, wenn Formular erfolgreich versendet", - "FORMSUBMITFAILUREMESSAGE": "Nachricht bei Fehlern im Formular", - "PLACEHOLDERMESSAGE": "Nachricht", - "NOTETITLE": "Text für Nachrichtenbereich", + "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": "Eingabe", "EDIT_SYSTEM": "System bearbeiten", "SYSTEM": "System", - "NOTIFICATION": "Benachrichtigung für Agenten", + "NOTIFICATION": "Benachrichtigung", "NOTIFICATIONSHAKE": "Schütteln", - "NOTIFICATIONSOUND": "Sound abspielen", + "NOTIFICATIONSOUND": "Klingeln", "NOTIFICATIONTEMPLATE": "Vorlage", "HIDEWHENOFFLINE": "Ausblenden, wenn offline", "INSERT_MESSAGE_HERE": "Nachricht hier eingeben", - "AGENTALIAS": "Agenten-Alias", + "AGENTALIAS": "Agent Alias", "AGENTFULLNAME": "Vollständiger Name des Agenten", - "AGENTIDENTIFIER": "Identifikation Agent", - "WAITFORTHEASSIGNEDAGENT": "Zeit (in Sekunden), wie lange ein aktiver Chat bei einem Agenten verbleibt, wenn sich dieser abmeldet", - "ALIGNMENT": "Ausrichtung Widget", - "BOTTOM_RIGHT": "Unten Rechts", - "LEFT": "Linker Bildschirmrand", - "RIGHT": "Linker Bildschirmrand", + "AGENTIDENTIFIER": "Identifikator", + "WAITFORTHEASSIGNEDAGENT": "Warten auf den zugewiesenen Mitarbeiter", + "ALIGNMENT": "Ausrichtung", + "BOTTOM_RIGHT": "Unten rechts", + "LEFT": "Links", + "RIGHT": "Richtig", "VERTICALALIGNMENT": "Vertikale Ausrichtung", "POSITION": "Position", "VERTICALPOSITION": "Vertikale Position", - "SNIPPETSWIPEOUT": "Widget ausklappen", - "ALTERNATE": "Abwechselnd", + "SNIPPETSWIPEOUT": "Snippet ausschieben", + "ALTERNATE": "Wechseln", "CENTERED": "Zentriert", "CUSTOMERAVATAR": "Kunden-Avatar", "DEFAULTTITLE": "Standardtitel", @@ -419,33 +419,33 @@ "AGENTADD_CHATWEBSITE": "Agenten zur Chat-Website hinzufügen", "BACKGROUNDCOLOR": "Hintergrundfarbe", "MESSAGEFONTSIZE": "Schriftgröße der Nachricht", - "AGENTTRANSFER": "Transfer an Agenten erlauben", - "AGENTTRANSFERTIMEOUT": "Zeitüberschreitung für Agententransfer", - "DIALOGFLOW": "Google Dialogflow", + "AGENTTRANSFER": "Agententransfer", + "AGENTTRANSFERTIMEOUT": "Agententransfer-Timeout", + "DIALOGFLOW": "Dialogflow", "EDIT_DIALOGFLOW": "Dialogflow bearbeiten", "LANGUAGE": "Sprache", - "QUEUETRANSFER": "Transfer in Warteschlange erlauben", - "QUEUETRANSFERTIMEOUT": "Zeitüberschreitung für Warteschlangentransfer", - "SYSTEMALIAS": "System-Alias", + "QUEUETRANSFER": "Transfer in Warteschlange", + "QUEUETRANSFERTIMEOUT": "Timeout bei der Warteschlangenübertragung", + "SYSTEMALIAS": "Systemalias", "SYSTEMAVATAR": "System-Avatar", "TRANSFER": "Transfer", "WELCOMEMESSAGE": "Willkommensnachricht", - "ENABLECUSTOMERCHECKMARKS": "Bestätigung Nachricht erhalten/gelesen anzeigen", + "ENABLECUSTOMERCHECKMARKS": "Bestätigung Nachricht erhalten/gelesen", "CANNEDANSWERS": "Textvorlagen", - "CHATCANNEDANSWERS": "Chat-Textbausteine", + "CHATCANNEDANSWERS": "Textvorlagen", "DOWNLOAD_INTERACTION": "Herunterladen", "LOGIN_TIME": "Zeit angemeldet", "PAUSE_TIME": "Zeit in Pause", "ACCESSKEYID": "Zugangsschlüssel-ID", - "BOTNAME": "Name des BOTs", + "BOTNAME": "Botname", "EDIT_AMAZONLEX": "Amazon Lex bearbeiten", "LEXREGION": "Region", "SECRETACCESSKEY": "Geheimer Zugangsschlüssel", "TEAMS_ASSOCIATION": "Teamzuweisung", "MANDATORYDISPOSITION": "Qualifizierung erforderlich", - "MANDATORYDISPOSITIONPAUSEID": "PausenID während Qualifizierung", - "ENABLESENDBUTTON": "\"Nachricht senden\" Button für Kunden anzeigen (ansonsten Senden nur durch ENTER)", - "FEEDBACKTITLE": "Text auf dem Button für Feedback", + "MANDATORYDISPOSITIONPAUSEID": "PausenID, wenn Qualifizierung erforderlich", + "ENABLESENDBUTTON": "Senden-Button aktivieren", + "FEEDBACKTITLE": "Feedback-Titel", "TOOLTIP_SCREENRECORDING_OFF": "Bildschirmaufzeichnung verfügbar", "TOOLTIP_SCREENRECORDING_ON": "Bildschirmaufzeichnung läuft", "DOWNLOAD_WITHOUT_ATTACHMENTS": "Herunterladen ohne Anhänge", @@ -456,13 +456,13 @@ "VIDAOOESCALATION": "Videoanruf starten", "VIDAOOSESSION": "Videoanruf starten", "VIDEO": "Video", - "CLIENTEMAIL": "E-Mail des Kunden", - "DIALOGFLOWV2": "Google Dialogflow V2", + "CLIENTEMAIL": "Kunden-E-Mail", + "DIALOGFLOWV2": "Dialogflow V2", "EDIT_DIALOGFLOWV2": "Dialogflow V2 bearbeiten", "PRIVATEKEY": "Privater Schlüssel", "PROJECTID": "Projekt-ID", - "EMAIL_ACCOUNT": "E-Mail Konto", - "OPEN_NEW_INTERACTION": "Offline-Nachrichten per E-Mail innerhalb des Systems verwalten", + "EMAIL_ACCOUNT": "Email-Konto", + "OPEN_NEW_INTERACTION": "Neue Interaktion öffnen", "SUBJECT": "Betreff", "ADD_NOTE": "Notiz hinzufügen", "CANNED_ANSWER_NOT_FOUND": "Keine Textvorlagen gefunden", @@ -472,12 +472,12 @@ "VIDAOOTOPIC": "Vidaoo-Thema", "CHANNELID": "Kanal ID", "EDIT_TVOX": "TVox bearbeiten", - "MOTIONTITLE": "Motion-Titel", - "MOTIONURL": "Motion-URL", - "MOTIONURLONANSWER": "Motion-URLL bei Antwort", - "MOTIONURLONRING": "Motion-URL bei Klingeln", + "MOTIONTITLE": "Bewegungstitel", + "MOTIONURL": "Bewegungs-URL", + "MOTIONURLONANSWER": "Bewegungs-URL bei Antwort", + "MOTIONURLONRING": "Bewegungs-URL auf Ring", "SERVICEID": "Service-ID", - "SERVICENAME": "Servicename", + "SERVICENAME": "Dienstname", "TVOX": "TVox", "TVOXIP": "TVox IP-Adresse", "TVOXLOGINURL": "TVox-Login-REST-URL", diff --git a/public/app/main/apps/chat/i18n/nl.json b/public/app/main/apps/chat/i18n/nl.json index 20f6e0a..d094697 100644 --- a/public/app/main/apps/chat/i18n/nl.json +++ b/public/app/main/apps/chat/i18n/nl.json @@ -3,15 +3,15 @@ "AMAZONLEX": "Amazon Lex", "TEXT": "Tekst", "TIMES": "Aantal keren per interactie", - "EDIT_AUTOREPLY": "Automatisch Antwoord Bewerken", - "AUTOREPLY": "Automatisch Antwoord", - "NEW_CHATDISPOSITION": "Nieuwe Chat Dispositie", - "ENABLECUSTOMERATTACHMENT": "Klantbijlage Inschakelen", + "EDIT_AUTOREPLY": "Edit automatisch antwoord", + "AUTOREPLY": "Automatisch antwoord", + "NEW_CHATDISPOSITION": "Nieuwe chat dispositie", + "ENABLECUSTOMERATTACHMENT": "Kan een klant voorzetstukken", "OFFLINE_CHAT_BUTTON": "'Offline Chat' knop", - "OFFLINESTATUS": "Status Offline", + "OFFLINESTATUS": "Status offline", "NAME": "Naam", "CHATQUEUES": "Chatwachtrijen", - "SEARCH_FOR_ANYONE": "Zoeken", + "SEARCH_FOR_ANYONE": "Zoeken voor iedereen", "STRATEGY": "Strategie", "AGENT_TIMEOUT": "Time-out agent", "DESCRIPTION": "Beschrijving", @@ -19,94 +19,94 @@ "ALIAS": "Alias", "VARIABLE": "Variabele", "INTERVAL": "Interval", - "EDIT_CLOSE": "Bewerken Sluiten", + "EDIT_CLOSE": "Edit dicht", "TIMEZONE": "Tijdzone", "MESSAGE": "Bericht", "ADVANCED": "Geavanceerd", - "FORWARDTRANSCRIPT": "Transcriptie doorsturen", - "FORWARDTRANSCRIPTMESSAGE": "Transcriptie bericht doorsturen", - "SKIPMESSAGEBUTTON": "Bericht Overslaan Knop", - "EDIT_MESSAGE": "Bericht Bewerken", - "CONDITION_AGREEMENT": "Akkoord met de voorwaarden", + "FORWARDTRANSCRIPT": "Vooruit transcript", + "FORWARDTRANSCRIPTMESSAGE": "Vooruit Transcript bericht", + "SKIPMESSAGEBUTTON": "Bericht overslaan knop", + "EDIT_MESSAGE": "Bericht wijzigen", + "CONDITION_AGREEMENT": "Voorwaarde akkoord", "NONE": "Geen", "PRIORITY": "Prioriteit", - "ONLINESTATUS": "Online Status", + "ONLINESTATUS": "Online status", "UNMANAGEDSTATUS": "Onbeheerde Status", - "AUTOCLOSE": "Automatisch Sluiten Inschakelen", - "ENABLEUNMANAGEDNOTE": "Onbeheerd Bericht Inschakelen", + "AUTOCLOSE": "Autoclose inschakelen", + "ENABLEUNMANAGEDNOTE": "Om onbeheerde bericht", "UNMANAGEDMESSAGE": "Bericht", "SKIPUNMANAGED": "Bericht overslaan", "SENDUNMANAGED": "Bericht verzenden", "WEBSITESCRIPT": "Website Script", "DELETE_OFFLINEMESSAGE": "Verwijderen", "OFFLINEMESSAGES": "Offline berichten", - "FORWARD_OFFLINE": "Offline doorsturen", - "SHOW_OFFLINEMESSAGE": "Offline Bericht Weergeven", - "FORWARD_OFFLINE_ADDRESS": "Offline adresboek doorsturen", - "CLOSINGFORM": "Formulier Sluiten", - "ENABLERATING": "Rating Inschakelen", - "ENABLECUSTOMERWRITING": "Laat de klant schrijven voordat de agent accepteert", + "FORWARD_OFFLINE": "Vooruit Offline", + "SHOW_OFFLINEMESSAGE": "Toon", + "FORWARD_OFFLINE_ADDRESS": "Vooruit Offline adresboek", + "CLOSINGFORM": "Formulier sluiten", + "ENABLERATING": "Rating inschakelen", + "ENABLECUSTOMERWRITING": "Laat de klant tevoren schriftelijk gemachtigde accepteren", "ENABLEFEEDBACK": "Feedback mogelijk", - "RATINGTYPE": "Type Rating", + "RATINGTYPE": "Waardering Type", "CLOSINGMESSAGE": "Bericht sluiten", - "CLOSINGMESSAGEBUTTON": "Knop om het bericht te sluiten", - "RATINGSTARSNUMBER": "Rating", - "EDIT_GOTOIF": "GotoIf Bewerken", + "CLOSINGMESSAGEBUTTON": "Sluiten Berichtentoets", + "RATINGSTARSNUMBER": "Rating Stars nummer", + "EDIT_GOTOIF": "GotoIf bewerken", "CONDITION": "Voorwaarde", - "TRUEPRIORITY": "Prioriteit", - "FALSEPRIORITY": "Geen prioriteit", + "TRUEPRIORITY": "Echte prioriteit", + "FALSEPRIORITY": "False prioriteit", "VALUE": "Waarde", "WEBSITEALIAS": "Website Alias", "ERRORS": { - "TEXT_REQUIRED": "Verplicht veld", - "SENDUNMANAGED_REQUIRED": "Verplicht veld", - "SENDUNMANAGED_MAX_LENGTH": "De waarde mag maximaal {{max.}} karakters lang zijn", - "SKIPUNMANAGED_MAX_LENGTH": "De waarde mag maximaal {{max.}} karakters lang zijn", - "UNMANAGEDMESSAGE_MAX_LENGTH": "De waarde mag maximaal {{max.}} karakters lang zijn", - "WEBSITEALIAS_MAX_LENGTH": "De waarde mag maximaal {{max.}} karakters lang zijn", - "AGENT_REQUIRED": "Verplicht veld", - "QUEUE_REQUIRED": "Verplicht veld", - "CONDITION_REQUIRED": "Verplicht veld", - "PRIORITY_REQUIRED": "Verplicht veld", - "TRUEPRIORITY_REQUIRED": "Verplicht veld", - "FALSEPRIORITY_REQUIRED": "Verplicht veld", - "NAME_REQUIRED": "Verplicht veld", - "LIST_REQUIRED": "Verplicht veld", - "AGENT_TIMEOUT_REQUIRED": "Verplicht veld", - "MOTIONADDRESS_REQUIRED": "Verplicht veld", - "DISPOSITION_REQUIRED": "Verplicht veld", - "MOTIONADDRESS_MUST_VALID_URL": "Ongeldig formaat", - "EMAIL_MUST_BE_VALID": "Verplicht veld", - "ADDRESS_REQUIRED": "Verplicht veld", - "ADDRESS_MUST_VALID_URL": "Ongeldig formaat", - "ENQUIRY_FORWARDING_ADDRESS_REQUIRED": "Verplicht veld", - "ACCEPTURL_MUST_VALID_URL": "Ongeldig formaat", - "TIMEOUT_REQUIRED": "Verplicht veld", - "REJECTURL_MUST_VALID_URL": "Ongeldig formaat", - "CLOSEURL_MUST_VALID_URL": "Ongeldig formaat", - "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "De waarde moet groter zijn dan of gelijk aan", - "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "De waarde moet groter zijn dan of gelijk aan", - "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "De waarde moet groter zijn dan of gelijk aan", - "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "De waarde moet groter zijn dan of gelijk aann", - "POLLING_INTERVAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "De waarde moet groter zijn dan of gelijk aan", - "WAITINGMESSAGE_REQUIRED": "Verplicht veld", - "WAITINGTITLE_REQUIRED": "Verplicht veld", - "KEY_MAX_LENGTH": "Verplicht veld", - "KEY_REQUIRED": "Verplicht veld", - "WAITINGMESSAGE_MAX_LENGTH": "De waarde mag maximaal {{max.}} karakters lang zijn", - "WAITINGTITLE_MAX_LENGTH": "De waarde mag maximaal {{max.}} karakters lang zijn", - "RATINGSTARSNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO": "De waarde moet kleiner zijn dan of gelijk aan", - "HEADER_OFFLINE_MAX_LENGTH": "De waarde mag maximaal {{max.}} karakters lang zijn", - "OFFLINE_CHAT_BUTTON_MAX_LENGTH": "De waarde mag maximaal {{max.}} karakters lang zijn", - "CLOSINGQUESTION_MAX_LENGTH": "De waarde mag maximaal {{max.}} karakters lang zijn", - "TEXT_MAX_LENGTH": "De waarde mag maximaal {{max.}} karakters lang zijn", + "TEXT_REQUIRED": "De tekst is vereist", + "SENDUNMANAGED_REQUIRED": "Het is een verplicht veld", + "SENDUNMANAGED_MAX_LENGTH": "Het gebied moet een maximale lengte van {{max.}}", + "SKIPUNMANAGED_MAX_LENGTH": "Het gebied moet een maximale lengte van {{max.}}", + "UNMANAGEDMESSAGE_MAX_LENGTH": "Het gebied moet een maximale lengte van {{max.}}", + "WEBSITEALIAS_MAX_LENGTH": "Alias moet hebben een maximale lengte van {{max.}}", + "AGENT_REQUIRED": "De Agent is vereist", + "QUEUE_REQUIRED": "De wachtrij is vereist", + "CONDITION_REQUIRED": "De conditie is vereist", + "PRIORITY_REQUIRED": "De prioriteit is vereist.", + "TRUEPRIORITY_REQUIRED": "De prioriteit is vereist.", + "FALSEPRIORITY_REQUIRED": "De prioriteit is vereist.", + "NAME_REQUIRED": "De naam is verplicht", + "LIST_REQUIRED": "De lijst is vereist", + "AGENT_TIMEOUT_REQUIRED": "De Agent Timeout is vereist", + "MOTIONADDRESS_REQUIRED": "De Motion Adres is vereist.", + "DISPOSITION_REQUIRED": "De Dispositie is vereist", + "MOTIONADDRESS_MUST_VALID_URL": "De Motion adres moet worden geschreven in een geldige indeling", + "EMAIL_MUST_BE_VALID": "E-mail moet een geldig e-mailadres in.", + "ADDRESS_REQUIRED": "Het adres is vereist.", + "ADDRESS_MUST_VALID_URL": "Het adres moet worden geschreven in een geldige indeling", + "ENQUIRY_FORWARDING_ADDRESS_REQUIRED": "Het onderzoek Doorstuuradres is vereist", + "ACCEPTURL_MUST_VALID_URL": "Accepteer URL moet worden geschreven in een geldige indeling", + "TIMEOUT_REQUIRED": "De timeout is vereist", + "REJECTURL_MUST_VALID_URL": "De afwijzing URL moet worden geschreven in een geldige indeling", + "CLOSEURL_MUST_VALID_URL": "De nauwe URL moet worden geschreven in een geldige indeling", + "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "De prioriteit moet groter zijn dan of gelijk aan", + "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "De echte prioriteit moet groter zijn dan of gelijk aan", + "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "De valse prioriteit moet groter zijn dan of gelijk aan", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "De time-out moet groter zijn dan of gelijk aan", + "POLLING_INTERVAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "De polling moet groter zijn dan of gelijk aan", + "WAITINGMESSAGE_REQUIRED": "De Wachtmelding is vereist", + "WAITINGTITLE_REQUIRED": "De wachtende Titel is vereist", + "KEY_MAX_LENGTH": "Sleutel moet een lengte gelijk aan {{max.}}", + "KEY_REQUIRED": "De sleutel is vereist", + "WAITINGMESSAGE_MAX_LENGTH": "De Wachtmelding moet beschikken over een maximale lengte van {{max.}}", + "WAITINGTITLE_MAX_LENGTH": "De wachtende titel moeten een maximale lengte van {{max.}}", + "RATINGSTARSNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO": "De Rating Stars nummer moet kleiner dan of gelijk aan", + "HEADER_OFFLINE_MAX_LENGTH": "De waarde moet hebben een maximale lengte van {{max.}}", + "OFFLINE_CHAT_BUTTON_MAX_LENGTH": "De waarde moet hebben een maximale lengte van {{max.}}", + "CLOSINGQUESTION_MAX_LENGTH": "De waarde moet hebben een maximale lengte van {{max.}}", + "TEXT_MAX_LENGTH": "De waarde moet een maximale lengte hebben die gelijk is aan {{max}}", "VALUE_REQUIRED": "Verplicht veld", - "OFFLINEMESSAGESUBJECT_MAX_LENGTH": "De waarde mag maximaal {{max.}} karakters lang zijn", - "OFFLINEMESSAGEBODY_MAX_LENGTH": "De waarde mag maximaal {{max.}} karakters lang zijn", - "PLACEHOLDERMESSAGE_MAX_LENGTH": "De waarde mag maximaal {{max.}} karakters lang zijn", - "NOTETITLE_MAX_LENGTH": "De waarde mag maximaal {{max.}} karakters lang zijn", - "FORMSUBMITSUCCESSMESSAGE_MAX_LENGTH": "De waarde mag maximaal {{max.}} karakters lang zijn", - "FORMSUBMITFAILUREMESSAGE_MAX_LENGTH": "De waarde mag maximaal {{max.}} karakters lang zijn", + "OFFLINEMESSAGESUBJECT_MAX_LENGTH": "De waarde moet een maximale lengte hebben die gelijk is aan {{max}}", + "OFFLINEMESSAGEBODY_MAX_LENGTH": "De waarde moet een maximale lengte hebben die gelijk is aan {{max}}", + "PLACEHOLDERMESSAGE_MAX_LENGTH": "De waarde moet een maximale lengte hebben die gelijk is aan {{max}}", + "NOTETITLE_MAX_LENGTH": "De waarde moet een maximale lengte hebben die gelijk is aan {{max}}", + "FORMSUBMITSUCCESSMESSAGE_MAX_LENGTH": "De waarde moet een maximale lengte hebben die gelijk is aan {{max}}", + "FORMSUBMITFAILUREMESSAGE_MAX_LENGTH": "De waarde moet een maximale lengte hebben die gelijk is aan {{max}}", "FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "De waarde moet groter zijn dan of gelijk aan", "FONTSIZE_REQUIRED": "Verplicht veld", "COMMAND_REQUIRED": "Verplicht veld", @@ -120,7 +120,7 @@ "VERTICALPOSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "De waarde moet groter zijn dan of gelijk aan", "VERTICALPOSITION_MUST_BE_LESS_THAN_OR_EQUAL_TO": "De waarde moet kleiner zijn dan of gelijk aan", "VERTICALPOSITION_REQUIRED": "Verplicht veld", - "CUSTOMERALIAS_MAX_LENGTH": "De waarde mag maximaal {{max.}} karakters lang zijn", + "CUSTOMERALIAS_MAX_LENGTH": "De waarde moet een maximale lengte hebben die gelijk is aan {{max}}", "TAG_REQUIRED": "Verplicht veld", "MESSAGEFONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "De waarde moet groter zijn dan of gelijk aan", "MESSAGEFONTSIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "De waarde moet kleiner zijn dan of gelijk aan", @@ -133,7 +133,7 @@ "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "De waarde moet groter zijn dan of gelijk aan", "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "De waarde moet kleiner zijn dan of gelijk aan", "QUEUETRANSFERTIMEOUT_REQUIRED": "Verplicht veld", - "SYSTEMALIAS_MAX_LENGTH": "De waarde mag maximaal {{max.}} karakters lang zijn", + "SYSTEMALIAS_MAX_LENGTH": "De waarde moet een maximale lengte hebben die gelijk is aan {{max}}", "SYSTEMALIAS_REQUIRED": "Verplicht veld", "ACCESSKEYID_REQUIRED": "Verplicht veld", "BOTNAME_REQUIRED": "Verplicht veld", @@ -147,13 +147,13 @@ "EMAIL_ACCOUNT_REQUIRED": "Verplicht veld" }, "CM_FIELD": "Contact Manager veld", - "CHATPROACTIVEACTIONS": "Proactieve Acties", - "NEW_CHATPROACTIVEACTION": "Nieuwe Proactieve Actie", - "EDIT_CHATPROACTIVEACTION": "Proactieve Actie Bewerken", - "DELETE_CHATPROACTIVEACTION": "Proactieve Actie Verwijderen", - "ADD_CHATPROACTIVEACTION": "Proactieve Actie Toevoegen", + "CHATPROACTIVEACTIONS": "Proactieve acties", + "NEW_CHATPROACTIVEACTION": "Nieuwe proactieve actie", + "EDIT_CHATPROACTIVEACTION": "Edit Pro-actief optreden", + "DELETE_CHATPROACTIVEACTION": "Verwijder proactief optreden", + "ADD_CHATPROACTIVEACTION": "Voeg proactief optreden", "NO_CHATPROACTIVEACTION_AVAILABLE": "Geen proactieve acties beschikbaar.", - "NO_OFFLINEMESSAGE_AVAILABLE": "Geen offline berichten beschikbaar.", + "NO_OFFLINEMESSAGE_AVAILABLE": "Geen Offline berichten beschikbaar.", "MOUSEOVER": "Muis Over", "TIMEOUT": "Timeout", "TYPE": "Type", @@ -165,14 +165,14 @@ "QUEUE": "Wachtrij", "BUILDER": "Builder", "PREVIEW": "Afdrukvoorbeeld", - "EDIT_AGENT": "Agent Bewerken", - "EDIT_QUEUE": "Wachtrij Bewerken", - "EDIT_GOTO": "Ga naar Bewerken", - "EDIT_GOTOIf": "GotoIf Bewerken", - "EDIT_NOOP": "Noop Bewerken", - "ADD_CHATQUEUE": "Chat Wachtrij Toevoegen", - "EDIT_CHATQUEUE": "Chat Wachtrij Bewerken", - "DELETE_CHATQUEUE": "Chat wachtrij Verwijderen", + "EDIT_AGENT": "Edit Agent", + "EDIT_QUEUE": "Wachtrij bewerken", + "EDIT_GOTO": "Ga naar bewerken", + "EDIT_GOTOIf": "GotoIf bewerken", + "EDIT_NOOP": "Noop bewerken", + "ADD_CHATQUEUE": "Voeg wachtrij voor chatten", + "EDIT_CHATQUEUE": "Edit wachtrij voor chatten", + "DELETE_CHATQUEUE": "Verwijder Chat wachtrij", "SETTINGS": "Instellingen", "SAVE": "Opslaan", "SCRIPT": "Script", @@ -181,9 +181,9 @@ "CHATWEBSITES": "Chat websites", "MOTIONADDRESS": "Motion adres", "MOTIONPROXY": "Proxy of Motion domein", - "ADD_CHATWEBSITE": "Chat Website Toevoegen", - "EDIT_CHATWEBSITE": "Chat Website Bewerken", - "DELETE_CHATWEBSITE": "Chat Website verwijderen", + "ADD_CHATWEBSITE": "Voeg Chat Website", + "EDIT_CHATWEBSITE": "Edit Chat Website", + "DELETE_CHATWEBSITE": "Verwijder Chat Website", "LIST": "Lijst", "SNIPPET": "Snapshot", "FORMS": "Formulieren", @@ -199,93 +199,93 @@ "MAINCOLOR": "Hoofdkleur", "FOCUSCOLOR": "Focuskleur", "BUTTONCOLOR": "Kleur", - "HEADERSHAPE": "Koptekst opmaak", + "HEADERSHAPE": "Vorm van het maaibord", "ANIMATION": "Animatie", "DEFAULT": "Standaard", "WHITELABEL": "White Label", "LOGO": "Logo", - "DOWNLOADTRANSCRIPT": "Transcriptie downloaden", - "ENQUIRY_ENABLE": "Navragen inschakelen", - "ENQUIRY_FORWARDING": "Navraag doorsturen", - "ENQUIRY_FORWARDING_ADDRESS": "Doorstuuradres voor navraag", + "DOWNLOADTRANSCRIPT": "Download transcript", + "ENQUIRY_ENABLE": "Onderzoek inschakelen", + "ENQUIRY_FORWARDING": "Onderzoek doorsturen", + "ENQUIRY_FORWARDING_ADDRESS": "Onderzoek Doorstuuradres", "LABELS": "Labels", - "HEADER_ONLINE": "Online koptekst", + "HEADER_ONLINE": "Online voorzetstuk", "ONLINE_MESSAGE": "Online bericht", - "NAME_TITLE": "Naam Label", - "USERNAME_PLACEHOLDER": "Gebruikersnaam Placeholder", - "EMAIL_TITLE": "E-mail label", - "EMAIL_PLACEHOLDER": "E-mail Placeholder", + "NAME_TITLE": "Naam Input Label", + "USERNAME_PLACEHOLDER": "Gebruikersnaam Input Placeholder", + "EMAIL_TITLE": "E-mail input label", + "EMAIL_PLACEHOLDER": "E-mail Input Placeholder", "START_CHAT_BUTTON": "'Start Chat' knop", - "AGENTS_BUSY": "Agent zijn drukbezet bericht", - "HEADER_OFFLINE": "Offline koptekst", + "AGENTS_BUSY": "Drukbezette Agents bericht", + "HEADER_OFFLINE": "Offline voorzetstuk", "OFFLINE_MESSAGE": "Offline berichten", "MESSAGE_TITLE": "Bericht Label", - "ENQUIRY_MESSAGE_PLACEHOLDER": "Navraag bericht Placeholder", - "ENQUIRY_BUTTON": "Navraag knoptekst", - "RATING_MESSAGE": "Rating Bericht", - "RATING_SEND": "Rating Verzendknop Tekst", - "RATING_SKIP": "Rating Overslaan Knoptekst", + "ENQUIRY_MESSAGE_PLACEHOLDER": "Onderzoek bericht Input Placeholder", + "ENQUIRY_BUTTON": "Onderzoek knop tekst", + "RATING_MESSAGE": "Waardering bericht", + "RATING_SEND": "Rating Verzendknop tekst", + "RATING_SKIP": "Rating Skip knop tekst", "ONLINE": "Online", "OFFLINE": "Offline", "PROACTIVE": "Proactief", "ACCEPT": "Accepteren", - "ACCEPTMETHOD": "Methode accepteren", + "ACCEPTMETHOD": "Accepteren methode", "ACCEPTURL": "URL accepteren", "REJECT": "Afwijzen", "REJECTMETHOD": "Methode afwijzen", "REJECTURL": "URL afwijzen", "CLOSE": "Dicht", - "CLOSEMETHOD": "Methode sluiten", - "CLOSEURL": "URL sluiten", + "CLOSEMETHOD": "Sluit methode", + "CLOSEURL": "Sluit URL", "EMBEDDING": "Insluiten", "GENERAL": "Algemeen", "SELECTED": "Geselecteerd", - "SELECT_ALL": "Selecteer Alles", - "SELECT_NONE": "Selecteer Geen", + "SELECT_ALL": "Alles selecteren", + "SELECT_NONE": "Selecteer None (Geen).", "BACK": "Terug", "HELP": { - "MAPKEY": "Het volgende Motion Contact Manager veld:", - "FROMKEY": "zal worden toegewezen aan uw Motion Chat snippet als:", + "MAPKEY": "De volgende motie Contact Manager veld:", + "FROMKEY": "Wordt toegewezen die u in uw ontwerpresolutie Chat fragment zoals:", "TOKEN": "Website Motion Token", "COPYSCRIPTTOCLIPBOARD": "Kopieer en plak dit script in uw website", - "FORWARD_OFFLINE": "U kunt meerdere adressen toevoegen door ze te scheiden met een komma (bijvoorbeeld John.doe@xcally.com, jane.miller@xcally.com)", - "MOTIONADDRESS": "Gebruik de volgende notatie: ://[:]. Voorbeeld: https://X.Y.Z.W", - "MOTIONPROXY": "Gebruik volgende notatie: ://[:]. Voorbeeld: https://X.Y.Z.W", + "FORWARD_OFFLINE": "U kunt meerdere adressen met een komma (bijvoorbeeld John.doe@xcally.com, jane.miller@xcally.com)", + "MOTIONADDRESS": "Voer in de volgende notatie: ://[:]. Voorbeeld: https://X.Y.Z.W", + "MOTIONPROXY": "Voer in de volgende notatie: ://[:]. Voorbeeld: https://X.Y.Z.W", "NAME": "Alleen cijfers, letters en speciale tekens (_) worden ondersteund", - "LIST": "Contact Manager lijst wordt gebruikt om contactpersonen te koppelen", - "KEY": "De korte naam (5 tekens) van de Website die wordt weergegeven op het Agent tabblad", - "INTEVAL": "Moet worden geselecteerd uit de lijst van beschikbare intervallen", + "LIST": "Contact Manager lijst gebruikt om contactpersonen koppelen", + "KEY": "Website korte naam (5 tekens) weergegeven op het tabblad Agent", + "INTEVAL": "Die moeten worden gekozen uit de lijst van beschikbare intervallen", "TIMEZONE": "Selecteer één optie in de lijst (standaard=local timezone)", - "ENABLERATING": "Inschakelen als u wilt dat de website bezoeker een Rating kan achterlaten", - "ENABLEFEEDBACK": "Inschakelen als u wilt dat de website bezoeker feedback kan achterlaten (maximaal 150 tekens)", - "FORWARDTRANSCRIPT": "Inschakelen als u wilt dat de website bezoeker wordt gevraagd om de een transcriptie van de chat te ontvangen via e-mail", - "AUTOCLOSE": "Inschakelen als u dat wilt chatsessies worden gesloten als Onbeheerd indien er geen agent beschikbaar is. Meer informatie over: https://wiki.xcallymotion.com/display/XMV/Chat Websites#ChatWebsites-Snippet", - "ENABLEUNMANAGEDNOTE": "Inschakelen als u wilt dat de bezoeker een bericht ontvangt wanneer alle agenten bezet zijn en de chat onbeheerd is", - "ENABLECUSTOMERWRITING": "Inschakelen als u wilt dat de chat begint zonder te wachten op een beschikbare agent (let op: wanneer ingeschakeld, zullen chats nooit onbeheerd zijn). Meer informatie vindt u op: https://wiki.xcallymotion.com/display/XMV/Chat Websites#ChatWebsites-Snippet", + "ENABLERATING": "Het inschakelen als u wilt dat de website bezoeker kan de interactie op het einde", + "ENABLEFEEDBACK": "Het inschakelen als u wilt dat de website bezoeker kan een terugkoppeling (maximaal 150 tekens) aan het einde", + "FORWARDTRANSCRIPT": "Het inschakelen als u wilt dat de website bezoeker wordt gevraagd een Transcript voor chatten via mail", + "AUTOCLOSE": "Inschakelen als u dat wilt chatsessies worden gesloten als onbeheerde indien er geen agent beschikbaar is. Meer informatie over: https://wiki.xcallymotion.com/display/XMV/Chat Websites#ChatWebsites-Snippet", + "ENABLEUNMANAGEDNOTE": "Het inschakelen als u wilt dat de bezoeker een bericht wanneer alle agenten bezig zijn en de chat gets onbeheerde", + "ENABLECUSTOMERWRITING": "Het inschakelen als u wilt dat de chat begint zonder te wachten op een beschikbare agent (let op: als u, uw chats nooit onbeheerd). Meer informatie vindt u op: https://wiki.xcallymotion.com/display/XMV/Chat Websites#ChatWebsites-Snippet", "INTERVAL": "Selecteer één optie in de lijst", - "HIDEWHENOFFLINE": "Verbergt de Chat snippet wanneer deze offline is", - "AGENTIDENTIFIER": "Vertegenwoordigt de agent-ID in de chatsessie in de Chat snippet", - "WEBSITEALIAS": "Een prefix voor het samenstellen van de agentnaam (prefix + Agentnummer) zichtbaar voor de web bezoeker tijdens de chatsessie", + "HIDEWHENOFFLINE": "Verbergt het fragment wanneer het offline is", + "AGENTIDENTIFIER": "Vertegenwoordigt de agent-ID in de chatsessie in het fragment", + "WEBSITEALIAS": "Een voorvoegsel gebruikt om samen de agentnaam (voorvoegsel Agentnummer) afgebeeld op het web bezoeker tijdens de chatsessie", "VERTICALPOSITION": "Vertegenwoordigt de afstand in percentage vanaf de bovenkant", - "WELCOMEMESSAGE": "Leeglaten als u geen welkomstbericht wilt verzenden", - "MANDATORYDISPOSITION": "Verplichte Dispositie", + "WELCOMEMESSAGE": "Laat leeg als u geen welkomstbericht wilt verzenden", + "MANDATORYDISPOSITION": "Verplichte regeling", "MANDATORYDISPOSITIONPAUSEID": "Pauze om te gebruiken als verplichte dispositie is ingeschakeld" }, "ADDRESS": "Adres", - "ONLINESTATE": "Online status", - "OFFLINESTATE": "Offline status", - "RATINGSTATE": "Waarding status", - "ENQUIRY": "Navraag", - "OFFLINETEMPLATE": "Offline sjabloon", - "CHATDISPOSITIONS": "Chat Disposities", - "NO_CHATDISPOSITION_AVAILABLE": "Geen disposities beschikbaar voor chat", - "ADD_CHATDISPOSITION": "Chat dispositie Toevoegen", + "ONLINESTATE": "De status Online (Actief)", + "OFFLINESTATE": "Offline staat", + "RATINGSTATE": "Rating staat", + "ENQUIRY": "Onderzoek", + "OFFLINETEMPLATE": "Offline Template", + "CHATDISPOSITIONS": "Chat dispositieven", + "NO_CHATDISPOSITION_AVAILABLE": "No Chat Dispositieven beschikbaar", + "ADD_CHATDISPOSITION": "Voeg Chat dispositie", "DELETE": "Verwijderen", - "EDIT_CHATDISPOSITION": "Chat dispositie Bewerken", - "DELETE_CHATDISPOSITION": "Chat dispositie Verwijderen", + "EDIT_CHATDISPOSITION": "Edit Chat dispositie", + "DELETE_CHATDISPOSITION": "Verwijder Chat dispositie", "CHAT": "Chat", "ID": "Id", - "NEW_CHATQUEUE": "Nieuwe chat wachtrij", + "NEW_CHATQUEUE": "Nieuwe wachtrij voor chatten", "NEW_CHATWEBSITE": "Nieuwe Chat Website", "ROUNDED": "Afgerond", "SQUARED": "Kwadraat", @@ -309,8 +309,8 @@ "SELECT_STATUS": "Selecteer een status", "FILTER": "Filter", "FILTERS": "Filters", - "TEAMADD_CHATQUEUE": "Team aan chat wachtrij Toevoegen", - "AGENTADD_CHATQUEUE": "Agent aan chat wachtrij Toevoegen", + "TEAMADD_CHATQUEUE": "Toevoegen aan wachtrij voor chatten", + "AGENTADD_CHATQUEUE": "Voeg Agent naar wachtrij voor chatten", "ALL_AGENTS": "Alle gebruikers zijn agenten", "SELECTED_AGENTS": "Geselecteerde agenten", "CLOSEDAT": "Gesloten", @@ -318,17 +318,17 @@ "CREATEDAT": "Gemaakt op", "NOTES": "Aantekeningen", "NO_INTERACTION_AVAILABLE": "Geen interacties beschikbaar", - "SELECTED_WEBSITE": "Selecteer een website", + "SELECTED_WEBSITE": "Kies een website", "GOTOP": "Gotop", - "EDIT_GOTOP": "Gotop Bewerken", - "SELECT_WEBSITE": "Selecteer een website", + "EDIT_GOTOP": "Gotop bewerken", + "SELECT_WEBSITE": "Kies een website", "INFO": "Info", "OFFLINEMESSAGES_CHATWEBSITE": "Ga naar offline-meldingen", - "WAITINGTITLE": "Wachtmelding titel", + "WAITINGTITLE": "Waiting titel", "WAITINGMESSAGE": "Wachtmelding", - "RATING": "Rating", - "NO_RATINGVALUE": "Geen Rating", - "AGENTSADD_QUEUE": "Agent aan chat wachtrij toevoegen", + "RATING": "Waardering", + "NO_RATINGVALUE": "Geen waardering", + "AGENTSADD_QUEUE": "Voeg Agent naar wachtrij voor chatten", "QUEUES": "Wachtrijen", "LOGGED_IN": "Aangemeld", "PAUSED": "Gepauzeerd", @@ -348,10 +348,10 @@ "PHONE_STATUS": "Telefoonstatus", "LOGOUT": "Afmelden", "UNPAUSE": "Einde pauze", - "AGENTADD_QUEUE": "Agent toevoegen aan chat wachtrij", + "AGENTADD_QUEUE": "Voeg Agent naar wachtrij voor chatten", "DEFAULT_PAUSE": "Standaardinstellingen voor pauze", "UNKNOWN": "Onbekend", - "UNREGISTERED": "Niet geregistreerd", + "UNREGISTERED": "Unregistered", "UNAVAILABLE": "Niet beschikbaar", "NOT_INUSE": "Niet in gebruik", "REACHABLE": "Bereikbaar", @@ -359,35 +359,35 @@ "VOICE": "Spraak", "NO_AGENT_ONLINE": "Geen Agent Online", "GOTOREALTIME_CHATQUEUE": "Ga naar Realtime wachtrij voor chatten", - "PARTIALPAUSE": "Tijdelijk onderbreken", + "PARTIALPAUSE": "Gedeeltelijk onderbreken", "BUSY": "Bezet", "TIMER": "Timer", - "IDLE": "Idle", + "IDLE": "Stationair toerental", "CAPACITY": "Capaciteit", "TAGS": "Tags", - "SHOWAGENTAVATAR": "Agent Avatar Weergeven", + "SHOWAGENTAVATAR": "Persoonlijke agent avatar", "AGENTAVATAR": "Agent Avatar", "SPYINTERACTION": "Spy", "INTERACTIONS_CHATWEBSITE": "Ga naar interacties", - "REFRESH_INTERACTIONS": "Interacties Vernieuwen", - "CLOSINGQUESTION": "Vraag Sluiten", + "REFRESH_INTERACTIONS": "Interacties vernieuwen", + "CLOSINGQUESTION": "Sluiten vraag", "WEBSCRIPT": "Web Script", - "NO_CHATCANNEDANSWER_AVAILABLE": "Geen standaard antwoorden beschikbaar", - "NEW_CHATCANNEDANSWER": "Nieuw Standaard Antwoord", - "ADD_CHATCANNEDANSWER": "Standaard Antwoord Toevoegen", - "EDIT_CHATCANNEDANSWER": "Standaard Antwoord Bewerken", - "DELETE_CHATCANNEDANSWER": "Standaard Antwoord Verwijderen", - "OFFLINEMESSAGESUBJECT": "Onderwerp", - "OFFLINEMESSAGEBODY": "Inhoud", - "FORMSUBMITSUCCESSMESSAGE": "Formulier verzenden succesbericht", + "NO_CHATCANNEDANSWER_AVAILABLE": "Geen ingeblikte antwoorden beschikbaar", + "NEW_CHATCANNEDANSWER": "Nieuw ingebouwd antwoord", + "ADD_CHATCANNEDANSWER": "Voeg ingebed antwoord toe", + "EDIT_CHATCANNEDANSWER": "Bewerk", + "DELETE_CHATCANNEDANSWER": "Verwijder", + "OFFLINEMESSAGESUBJECT": "Bericht Onderwerp", + "OFFLINEMESSAGEBODY": "Bericht lichaam", + "FORMSUBMITSUCCESSMESSAGE": "Formulier verzendingssuccesbericht", "FORMSUBMITFAILUREMESSAGE": "Formulier verzenden mislukt bericht", - "PLACEHOLDERMESSAGE": "Placeholder bericht", - "NOTETITLE": "Notitie Titel", - "DELETE_INTERACTION": "Interactie Verwijderen", + "PLACEHOLDERMESSAGE": "Plaatsaanduiding voor berichten", + "NOTETITLE": "De titel van Note", + "DELETE_INTERACTION": "Interactie verwijderen", "FONTSIZE": "Lettertypegrootte", "TEXTCOLOR": "Tekst kleur", "COMMAND": "Opdracht", - "EDIT_SYSTEM": "Systeem Bewerken", + "EDIT_SYSTEM": "Systeem bewerken", "SYSTEM": "Systeem", "NOTIFICATION": "Kennisgeving", "NOTIFICATIONSHAKE": "Schudden", @@ -396,10 +396,10 @@ "HIDEWHENOFFLINE": "Verbergen", "INSERT_MESSAGE_HERE": "Voer hier uw sms-bericht in", "AGENTALIAS": "Agent Alias", - "AGENTFULLNAME": "Agent volledige naam", + "AGENTFULLNAME": "Agent Volledige naam", "AGENTIDENTIFIER": "Identifier", "WAITFORTHEASSIGNEDAGENT": "Wacht op de toegewezen agent", - "ALIGNMENT": "Uitlijning", + "ALIGNMENT": "opstelling", "BOTTOM_RIGHT": "Rechts onder", "LEFT": "Links", "RIGHT": "Rechts", @@ -411,45 +411,45 @@ "CENTERED": "centered", "CUSTOMERAVATAR": "Avatar klant", "DEFAULTTITLE": "Standaard titel", - "MESSAGESALIGNMENT": "Bericht Uitlijning", - "SHOWCUSTOMERAVATAR": "Klantavatar Weergeven", + "MESSAGESALIGNMENT": "Berichten Afstemming", + "SHOWCUSTOMERAVATAR": "Toon klantavatar", "EDIT_TAG": "Bewerk label", "TAG": "Label", "CUSTOMERALIAS": "Klantalias", - "AGENTADD_CHATWEBSITE": "Agent aan chatwebsite Toevoegen", + "AGENTADD_CHATWEBSITE": "Agent toevoegen aan chatwebsite", "BACKGROUNDCOLOR": "Achtergrond kleur", "MESSAGEFONTSIZE": "Grootte van berichtlettertype", "AGENTTRANSFER": "Agent Transfer", "AGENTTRANSFERTIMEOUT": "Agent Transfer Timeout", "DIALOGFLOW": "Dialogflow", - "EDIT_DIALOGFLOW": "Dialogflow Bewerken", + "EDIT_DIALOGFLOW": "Bewerk Dialogflow", "LANGUAGE": "Taal", - "QUEUETRANSFER": "Wachtrij Overdracht", - "QUEUETRANSFERTIMEOUT": "Wachtrij Overdracht Timeout", + "QUEUETRANSFER": "Wachtrijoverdracht", + "QUEUETRANSFERTIMEOUT": "Wachtrij Transfer Timeout", "SYSTEMALIAS": "Systeemalias", "SYSTEMAVATAR": "Systeemavatar", "TRANSFER": "Overdracht", - "WELCOMEMESSAGE": "Welkomstbericht", - "ENABLECUSTOMERCHECKMARKS": "Afgeleverd/gelezen door klant melding inschakelen", - "CANNEDANSWERS": "Standaard Antwoorden", - "CHATCANNEDANSWERS": "Standaard Antwoorden", - "DOWNLOAD_INTERACTION": "Interactie Downloaden", + "WELCOMEMESSAGE": "Welkoms bericht", + "ENABLECUSTOMERCHECKMARKS": "Schakel door klant geleverde / gelezen meldingen in", + "CANNEDANSWERS": "Ingeblikte antwoorden", + "CHATCANNEDANSWERS": "Ingeblikte antwoorden", + "DOWNLOAD_INTERACTION": "Download", "LOGIN_TIME": "Aanmeldtijd", "PAUSE_TIME": "Pauzetijd", "ACCESSKEYID": "Toegang Key ID", "BOTNAME": "Botnaam", "EDIT_AMAZONLEX": "Bewerk Amazon Lex", "LEXREGION": "Regio", - "SECRETACCESSKEY": "Geheime Sleutel", + "SECRETACCESSKEY": "Geheime toegangssleutel", "TEAMS_ASSOCIATION": "Teams Association", "MANDATORYDISPOSITION": "Verplichte regeling", "MANDATORYDISPOSITIONPAUSEID": "Pauze om te gebruiken als verplichte dispositie is ingeschakeld", - "ENABLESENDBUTTON": "Verzendknop Inschakelen", + "ENABLESENDBUTTON": "Schakel de verzendknop in", "FEEDBACKTITLE": "Feedbacktitel", "TOOLTIP_SCREENRECORDING_OFF": "Schermopname beschikbaar", "TOOLTIP_SCREENRECORDING_ON": "Schermopname bezig", - "DOWNLOAD_WITHOUT_ATTACHMENTS": "Zonder bijlagen Downloaden", - "DOWNLOAD_WITH_ATTACHMENTS": "Met bijlagen Downloaden", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download zonder bijlagen", + "DOWNLOAD_WITH_ATTACHMENTS": "Download met bijlagen", "LASTMESSAGE": "Laatste bericht", "VIDAOO": "Vidaoo", "VIDAOOAPIKEY": "Vidaoo Api-sleutel", @@ -458,21 +458,21 @@ "VIDEO": "Video", "CLIENTEMAIL": "E-mail van de klant", "DIALOGFLOWV2": "Dialogflow V2", - "EDIT_DIALOGFLOWV2": "Dialogflow V2 Bewerken", - "PRIVATEKEY": "Privé-sleutel", + "EDIT_DIALOGFLOWV2": "Bewerk Dialogflow V2", + "PRIVATEKEY": "Prive sleutel", "PROJECTID": "Project-ID", "EMAIL_ACCOUNT": "Email account", - "OPEN_NEW_INTERACTION": "Nieuwe interactie Openen", + "OPEN_NEW_INTERACTION": "Open nieuwe interactie", "SUBJECT": "Onderwerpen", - "ADD_NOTE": "Notitie Toevoegen", + "ADD_NOTE": "Notitie toevoegen", "CANNED_ANSWER_NOT_FOUND": "Er zijn geen standaardantwoorden gevonden", "NOTE": "Opmerking", "VIDAOOMETADATA": "Vidaoo-metagegevens", "VIDAOONOTE": "Vidaoo Opmerking", "VIDAOOTOPIC": "Vidaoo-onderwerp", "CHANNELID": "Kanaal Nr", - "EDIT_TVOX": "TVox Bewerken", - "MOTIONTITLE": "Titel", + "EDIT_TVOX": "TVox bewerken", + "MOTIONTITLE": "Bewegingstitel", "MOTIONURL": "Bewegings-URL", "MOTIONURLONANSWER": "Bewegings-URL bij antwoord", "MOTIONURLONRING": "Bewegings-URL op bel", diff --git a/public/app/main/apps/chat/i18n/pt-BR.json b/public/app/main/apps/chat/i18n/pt-BR.json index 8a05182..ffaddae 100644 --- a/public/app/main/apps/chat/i18n/pt-BR.json +++ b/public/app/main/apps/chat/i18n/pt-BR.json @@ -5,7 +5,7 @@ "ACCESSKEYID": "Access Key ID", "SECRETACCESSKEY": "Secret Access Key", "LEXREGION": "Região", - "BOTNAME": "Nome do bot", + "BOTNAME": "Nome do BOT", "LOGIN_TIME": "Tempo de login", "PAUSE_TIME": "Tempo de pausa", "DOWNLOAD_INTERACTION": "Download", @@ -13,7 +13,7 @@ "TRANSFER": "Transferir", "QUEUETRANSFER": "Transferência de fila", "QUEUETRANSFERTIMEOUT": "Tempo limite de transferência da fila", - "AGENTTRANSFER": "Transferência de Agente", + "AGENTTRANSFER": "Transferência de agente", "AGENTTRANSFERTIMEOUT": "Tempo limite de transferência do agente", "SYSTEMAVATAR": "Avatar do sistema", "SYSTEMALIAS": "Apelido do sistema", @@ -24,13 +24,13 @@ "BACKGROUNDCOLOR": "Cor de fundo", "MESSAGEFONTSIZE": "Tamanho da fonte da mensagem", "TAG": "Tag", - "EDIT_TAG": "Editar Tag", + "EDIT_TAG": "Editar tag", "CUSTOMERALIAS": "Apelido ​​do cliente", "SNIPPETSWIPEOUT": "Snippet deslize para fora", "CUSTOMERAVATAR": "Avatar do cliente", "SHOWCUSTOMERAVATAR": "Mostrar avatar do cliente", - "DEFAULTTITLE": "Título Padrão", - "MESSAGESALIGNMENT": "Alinhamento de Mensagens", + "DEFAULTTITLE": "Título padrão", + "MESSAGESALIGNMENT": "Alinhamento de mensagens", "ALTERNATE": "Alternar", "CENTERED": "Centralizado", "POSITION": "Posição", @@ -43,8 +43,8 @@ "WAITFORTHEASSIGNEDAGENT": "Aguarde o agente atribuído", "AGENTIDENTIFIER": "Identificador", "WEBSITEALIAS": "Nome do site", - "AGENTALIAS": "Nome do Agente", - "AGENTFULLNAME": "Nome Completo do Agente", + "AGENTALIAS": "Nome do agente", + "AGENTFULLNAME": "Nome completo do agente", "INSERT_MESSAGE_HERE": "Insira sua mensagem de texto aqui", "HIDEWHENOFFLINE": "Ocultar", "NOTIFICATION": "Notificação", @@ -52,11 +52,11 @@ "NOTIFICATIONSHAKE": "Vibrar", "NOTIFICATIONTEMPLATE": "Modelo", "SYSTEM": "Sistema", - "EDIT_SYSTEM": "Editar Sistema", + "EDIT_SYSTEM": "Editar sistema", "COMMAND": "Comando", "TEXTCOLOR": "Cor do texto", "FONTSIZE": "Tamanho da fonte", - "WEBSCRIPT": "Web Script", + "WEBSCRIPT": "Web script", "CANNEDANSWERS": "Modelo de resposta", "CHATCANNEDANSWERS": "Modelo de resposta", "NO_CHATCANNEDANSWER_AVAILABLE": "Não há respostas prontas disponíveis", @@ -77,10 +77,10 @@ "SPYINTERACTION": "Spy", "NO_AGENT_ONLINE": "Nenhum agente online", "GOTOREALTIME_CHATQUEUE": "Ir para a fila de chat em tempo real", - "PARTIALPAUSE": "Pausa Parcial", + "PARTIALPAUSE": "Pausa parcial", "BUSY": "Ocupado", "TIMER": "Cronômetro", - "IDLE": "Ocioso", + "IDLE": "Disponível", "CAPACITY": "Capacidade", "AGENTSADD_QUEUE": "Adicionar agente à fila de chat", "QUEUES": "Filas", @@ -122,15 +122,15 @@ "ALIAS": "Alias", "VARIABLE": "Variável", "INTERVAL": "Intervalo", - "EDIT_CLOSE": "Editar Fechar", + "EDIT_CLOSE": "Editar encerramento", "TIMEZONE": "Fuso horário", "MESSAGE": "Messagem", "ADVANCED": "Avançado", - "FORWARDTRANSCRIPT": "Encaminhar Transcrição", - "FORWARDTRANSCRIPTMESSAGE": "Mensagem de Transcrição Direta", + "FORWARDTRANSCRIPT": "Encaminhar transcrição", + "FORWARDTRANSCRIPTMESSAGE": "Mensagem de transcrição direta", "SKIPMESSAGEBUTTON": "Ignorar botão de mensagem", "EDIT_MESSAGE": "Editar mensagem", - "CONDITION_AGREEMENT": "Contrato de Condição", + "CONDITION_AGREEMENT": "Contrato de condição", "NONE": "Nenhum", "PRIORITY": "Prioridade", "ONLINESTATUS": "Status online", @@ -140,43 +140,43 @@ "UNMANAGEDMESSAGE": "Messagem", "SKIPUNMANAGED": "Pular Mensagem", "SENDUNMANAGED": "Enviar mensagem", - "WEBSITESCRIPT": "Website Script", + "WEBSITESCRIPT": "Website script", "DELETE_OFFLINEMESSAGE": "Excluir", - "OFFLINEMESSAGES": "Mensagens Offline", - "FORWARD_OFFLINE": "Encaminhar off-line", + "OFFLINEMESSAGES": "Mensagens offline", + "FORWARD_OFFLINE": "Encaminhar offline", "SHOW_OFFLINEMESSAGE": "Mostrar", "FORWARD_OFFLINE_ADDRESS": "Endereço offline de encaminhamento", - "CLOSINGFORM": "Formulário de Fechamento", - "ENABLERATING": "Ativar Classificação", + "CLOSINGFORM": "Formulário de encerramento", + "ENABLERATING": "Ativar classificação", "ENABLECUSTOMERWRITING": "Permitir que o cliente escreva antes de aceitar o agente", "ENABLEFEEDBACK": "Ativar feedback", - "RATINGTYPE": "Tipo de Avaliação", - "CLOSINGMESSAGE": "Mensagem de Encerramento", + "RATINGTYPE": "Tipo de avaliação", + "CLOSINGMESSAGE": "Mensagem de encerramento", "CLOSINGMESSAGEBUTTON": "Fechando o botão da mensagem", "RATINGSTARSNUMBER": "Número de estrelas de avaliação", "EDIT_GOTOIF": "Editar GotoIf", "CONDITION": "Condição", "TRUEPRIORITY": "Verdadeira prioridade", - "FALSEPRIORITY": "Falsa Prioridade", + "FALSEPRIORITY": "Falsa prioridade", "VALUE": "Valor", "ERRORS": { - "BOTNAME_REQUIRED": "Campo Obrigatório", - "SECRETACCESSKEY_REQUIRED": "Campo Obrigatório", - "ACCESSKEYID_REQUIRED": "Campo Obrigatório", + "BOTNAME_REQUIRED": "Campo obrigatório", + "SECRETACCESSKEY_REQUIRED": "Campo obrigatório", + "ACCESSKEYID_REQUIRED": "Campo obrigatório", "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "O valor deve ser menor ou igual a", "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "O valor deve ser maior ou igual a", - "QUEUETRANSFERTIMEOUT_REQUIRED": "Campo Obrigatório", + "QUEUETRANSFERTIMEOUT_REQUIRED": "Campo obrigatório", "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "O valor deve ser menor ou igual a", "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "O valor deve ser maior ou igual a", - "AGENTTRANSFERTIMEOUT_REQUIRED": "Campo Obrigatório", - "CUSTOMERALIAS_REQUIRED": "Campo Obrigatório", - "AGENTALIAS_REQUIRED": "Campo Obrigatório", - "SYSTEMALIAS_REQUIRED": "Campo Obrigatório", + "AGENTTRANSFERTIMEOUT_REQUIRED": "Campo obrigatório", + "CUSTOMERALIAS_REQUIRED": "Campo obrigatório", + "AGENTALIAS_REQUIRED": "Campo obrigatório", + "SYSTEMALIAS_REQUIRED": "Campo obrigatório", "MESSAGEFONTSIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "O valor deve ser menor ou igual a", "MESSAGEFONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "O valor deve ser maior ou igual a", - "MESSAGEFONTSIZE_REQUIRED": "Campo Obrigatório", - "TAG_REQUIRED": "Campo Obrigatório", - "VERTICALPOSITION_REQUIRED": "Campo Obrigatório", + "MESSAGEFONTSIZE_REQUIRED": "Campo obrigatório", + "TAG_REQUIRED": "Campo obrigatório", + "VERTICALPOSITION_REQUIRED": "Campo obrigatório", "VERTICALPOSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "O valor deve ser maior ou igual a", "VERTICALPOSITION_MUST_BE_LESS_THAN_OR_EQUAL_TO": "O valor deve ser menor ou igual a", "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "O valor deve ser menor ou igual a", @@ -186,11 +186,11 @@ "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "O valor deve ser menor ou igual a", "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "O valor deve ser maior ou igual a", "NAME_MUST_VALID_PATTERN": "Formato incorreto", - "COMMAND_REQUIRED": "Campo Obrigatório", + "COMMAND_REQUIRED": "Campo obrigatório", "FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "O valor deve ser maior ou igual a", - "FONTSIZE_REQUIRED": "Campo Obrigatório", + "FONTSIZE_REQUIRED": "Campo obrigatório", "TEXT_MAX_LENGTH": "O valor deve ter um tamanho máximo igual a {{max}}", - "VALUE_REQUIRED": "Campo Obrigatório", + "VALUE_REQUIRED": "Campo obrigatório", "CUSTOMERALIAS_MAX_LENGTH": "O valor deve ter um tamanho máximo igual a {{max}}", "SYSTEMALIAS_MAX_LENGTH": "O valor deve ter um tamanho máximo igual a {{max}}", "OFFLINEMESSAGESUBJECT_MAX_LENGTH": "O valor deve ter um tamanho máximo igual a {{max}}", @@ -202,30 +202,30 @@ "CLOSINGQUESTION_MAX_LENGTH": "O valor deve ter um tamanho máximo igual a {{max}}", "HEADER_OFFLINE_MAX_LENGTH": "O valor deve ter um tamanho máximo igual a {{max}}", "OFFLINE_CHAT_BUTTON_MAX_LENGTH": "O valor deve ter um tamanho máximo igual a {{max}}", - "TEXT_REQUIRED": "Campo Obrigatório", - "SENDUNMANAGED_REQUIRED": "Campo Obrigatório", + "TEXT_REQUIRED": "Campo obrigatório", + "SENDUNMANAGED_REQUIRED": "Campo obrigatório", "SENDUNMANAGED_MAX_LENGTH": "O valor deve ter um tamanho máximo igual a {{max}}", "SKIPUNMANAGED_MAX_LENGTH": "O valor deve ter um tamanho máximo igual a {{max}}", "UNMANAGEDMESSAGE_MAX_LENGTH": "O valor deve ter um tamanho máximo igual a {{max}}", "WEBSITEALIAS_MAX_LENGTH": "O valor deve ter um tamanho máximo igual a {{max}}", - "AGENT_REQUIRED": "Campo Obrigatório", - "QUEUE_REQUIRED": "Campo Obrigatório", - "CONDITION_REQUIRED": "Campo Obrigatório", - "PRIORITY_REQUIRED": "Campo Obrigatório", - "TRUEPRIORITY_REQUIRED": "Campo Obrigatório", - "FALSEPRIORITY_REQUIRED": "Campo Obrigatório", - "NAME_REQUIRED": "Campo Obrigatório", - "LIST_REQUIRED": "Campo Obrigatório", - "AGENT_TIMEOUT_REQUIRED": "Campo Obrigatório", - "MOTIONADDRESS_REQUIRED": "Campo Obrigatório", - "DISPOSITION_REQUIRED": "Campo Obrigatório", + "AGENT_REQUIRED": "Campo obrigatório", + "QUEUE_REQUIRED": "Campo obrigatório", + "CONDITION_REQUIRED": "Campo obrigatório", + "PRIORITY_REQUIRED": "Campo obrigatório", + "TRUEPRIORITY_REQUIRED": "Campo obrigatório", + "FALSEPRIORITY_REQUIRED": "Campo obrigatório", + "NAME_REQUIRED": "Campo obrigatório", + "LIST_REQUIRED": "Campo obrigatório", + "AGENT_TIMEOUT_REQUIRED": "Campo obrigatório", + "MOTIONADDRESS_REQUIRED": "Campo obrigatório", + "DISPOSITION_REQUIRED": "Campo obrigatório", "MOTIONADDRESS_MUST_VALID_URL": "Formato incorreto", "EMAIL_MUST_BE_VALID": "Formato incorreto", - "ADDRESS_REQUIRED": "Campo Obrigatório", + "ADDRESS_REQUIRED": "Campo obrigatório", "ADDRESS_MUST_VALID_URL": "Formato incorreto", - "ENQUIRY_FORWARDING_ADDRESS_REQUIRED": "Campo Obrigatório", + "ENQUIRY_FORWARDING_ADDRESS_REQUIRED": "Campo obrigatório", "ACCEPTURL_MUST_VALID_URL": "Formato incorreto", - "TIMEOUT_REQUIRED": "Campo Obrigatório", + "TIMEOUT_REQUIRED": "Campo obrigatório", "REJECTURL_MUST_VALID_URL": "Formato incorreto", "CLOSEURL_MUST_VALID_URL": "Formato incorreto", "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "O valor deve ser maior ou igual a", @@ -233,30 +233,30 @@ "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "O valor deve ser maior ou igual a", "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "O valor deve ser maior ou igual a", "POLLING_INTERVAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "O valor deve ser maior ou igual a", - "WAITINGMESSAGE_REQUIRED": "Campo Obrigatório", - "WAITINGTITLE_REQUIRED": "Campo Obrigatório", + "WAITINGMESSAGE_REQUIRED": "Campo obrigatório", + "WAITINGTITLE_REQUIRED": "Campo obrigatório", "KEY_MAX_LENGTH": "O valor deve ter um tamanho máximo igual a {{max}}", - "KEY_REQUIRED": "Campo Obrigatório", + "KEY_REQUIRED": "Campo obrigatório", "WAITINGMESSAGE_MAX_LENGTH": "O valor deve ter um tamanho máximo igual a {{max}}", "WAITINGTITLE_MAX_LENGTH": "O valor deve ter um tamanho máximo igual a {{max}}", "RATINGSTARSNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO": "O valor deve ser menor ou igual a", "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Campo obrigatório", - "VIDAOOAPIKEY_REQUIRED": "Campo Obrigatório", - "CLIENTEMAIL_REQUIRED": "Campo Obrigatório", - "PRIVATEKEY_REQUIRED": "Campo Obrigatório", - "PROJECTID_REQUIRED": "Campo Obrigatório", - "VIDAOOTOPIC_REQUIRED": "Campo Obrigatório", + "VIDAOOAPIKEY_REQUIRED": "Campo obrigatório", + "CLIENTEMAIL_REQUIRED": "Campo obrigatório", + "PRIVATEKEY_REQUIRED": "Campo obrigatório", + "PROJECTID_REQUIRED": "Campo obrigatório", + "VIDAOOTOPIC_REQUIRED": "Campo obrigatório", "EMAIL_ACCOUNT_REQUIRED": "Campo obrigatório" }, - "CM_FIELD": "Contact Manager Field", + "CM_FIELD": "Campo Contact Manager", "CHATPROACTIVEACTIONS": "Ações proativas", "NEW_CHATPROACTIVEACTION": "Nova ação proativa", "EDIT_CHATPROACTIVEACTION": "Editar ação proativa", "DELETE_CHATPROACTIVEACTION": "Excluir ação proativa", "ADD_CHATPROACTIVEACTION": "Adicionar ação proativa", "NO_CHATPROACTIVEACTION_AVAILABLE": "Nenhuma ação proativa disponível", - "NO_OFFLINEMESSAGE_AVAILABLE": "Nenhuma mensagem off-line disponível", - "MOUSEOVER": "Mouse Over", + "NO_OFFLINEMESSAGE_AVAILABLE": "Nenhuma mensagem offline disponível", + "MOUSEOVER": "Mouse over", "TIMEOUT": "Tempo esgotado", "TYPE": "Tipo", "SELECTOR": "Seletor", @@ -298,35 +298,35 @@ "ACTIONS": "Ações", "FIDELITY": "Fidelidade", "APPEARANCE": "Aparência", - "MAINCOLOR": "Cor Principal", + "MAINCOLOR": "Cor principal", "FOCUSCOLOR": "Cor de foco", - "BUTTONCOLOR": "Cor do botao", + "BUTTONCOLOR": "Cor do botão", "HEADERSHAPE": "Forma de cabeçalho", "ANIMATION": "Animação", "DEFAULT": "Padrão", "WHITELABEL": "White Label", "LOGO": "Logo", - "DOWNLOADTRANSCRIPT": "Download Transcrição", + "DOWNLOADTRANSCRIPT": "Download transcrição", "ENQUIRY_ENABLE": "Enquiry Enable", "ENQUIRY_FORWARDING": "Enquiry Forwarding", "ENQUIRY_FORWARDING_ADDRESS": "Enquiry Forwarding Address", "LABELS": "Labels", - "HEADER_ONLINE": "Cabeçalho on-line", - "ONLINE_MESSAGE": "Mensagem Online", + "HEADER_ONLINE": "Cabeçalho online", + "ONLINE_MESSAGE": "Mensagem online", "NAME_TITLE": "Nome da etiqueta de entrada", "USERNAME_PLACEHOLDER": "Local de entrada de nome de usuário", "EMAIL_TITLE": "Etiqueta de entrada de e-mail", "EMAIL_PLACEHOLDER": "Espaço reservado para entrada de e-mail", "START_CHAT_BUTTON": "Botão 'Iniciar chat'", - "AGENTS_BUSY": "Mensagem de Agentes Ocupados", - "HEADER_OFFLINE": "Cabeçalho Offline", - "OFFLINE_MESSAGE": "Mensagem Offline", - "MESSAGE_TITLE": "Rótulo de Mensagem", + "AGENTS_BUSY": "Mensagem de agentes ocupados", + "HEADER_OFFLINE": "Cabeçalho offline", + "OFFLINE_MESSAGE": "Mensagem offline", + "MESSAGE_TITLE": "Título de Mensagem", "ENQUIRY_MESSAGE_PLACEHOLDER": "Espaço reservado para entrada de mensagem de consulta", "ENQUIRY_BUTTON": "Texto do botão de consulta", - "RATING_MESSAGE": "Mensagem de Avaliação", + "RATING_MESSAGE": "Mensagem de avaliação", "RATING_SEND": "Texto do botão de envio de classificação", - "RATING_SKIP": "Texto do botão Ignorar classificação", + "RATING_SKIP": "Texto do botão ignorar classificação", "ONLINE": "Online", "OFFLINE": "Offline", "PROACTIVE": "Proativo", @@ -334,10 +334,10 @@ "ACCEPTMETHOD": "Aceitar Metodo", "ACCEPTURL": "Aceitar URL", "REJECT": "Rejeitar", - "REJECTMETHOD": "Rejeitar Metodo", + "REJECTMETHOD": "Rejeitar método", "REJECTURL": "Rejeitar URL", "CLOSE": "Fechar", - "CLOSEMETHOD": "Fechar Metodo", + "CLOSEMETHOD": "Fechar método", "CLOSEURL": "Fechar URL", "EMBEDDING": "Incorporação", "GENERAL": "Geral", @@ -367,7 +367,7 @@ "MOTIONADDRESS": "O campo deve ter o seguinte formato: : // [: ]. Exemplo: https: //X.Y.Z.W", "MOTIONPROXY": "O campo deve ter o seguinte formato: : // [: ]. Exemplo: https: //X.Y.Z.W", "NAME": "Somente números, letras e caracteres específicos (._) são suportados", - "LIST": "Lista do Gerenciador de contatos usada para associar os contatos", + "LIST": "Lista do Gerenciar Contatos", "INTERVAL": "Selecione um da lista", "WELCOMEMESSAGE": "Deixe em branco se não quiser enviar nenhuma mensagem de boas-vindas", "MANDATORYDISPOSITION": "Disposição obrigatória", @@ -375,11 +375,11 @@ }, "ADDRESS": "Endereço", "ONLINESTATE": "Status online", - "OFFLINESTATE": "Status Offline", - "RATINGSTATE": "Status de Avaliação", + "OFFLINESTATE": "Status offline", + "RATINGSTATE": "Status de avaliação", "ENQUIRY": "Enquiry", - "OFFLINETEMPLATE": "Modelo Offline", - "CHATDISPOSITIONS": "Disposições de Chat", + "OFFLINETEMPLATE": "Modelo offline", + "CHATDISPOSITIONS": "Disposições de chat", "NO_CHATDISPOSITION_AVAILABLE": "Nenhuma disposição de chat disponível", "ADD_CHATDISPOSITION": "Adicionar disposição de chat", "DELETE": "Excluir", @@ -392,8 +392,8 @@ "SQUARED": "Squared", "NO_AVAILABLE_INFO": "Nenhuma informação disponível", "ALL_TEAMS": "Todas as equipes", - "SELECTED_TEAMS": "Equipes Selecionadas", - "PAGE": "Pagina", + "SELECTED_TEAMS": "Equipes selecionadas", + "PAGE": "Página", "ROWSPERPAGE": "Linhas por página", "OF": "of", "CONTACT": "Contato", @@ -413,7 +413,7 @@ "TEAMADD_CHATQUEUE": "Adicionar equipe à fila de chat", "AGENTADD_CHATQUEUE": "Adicionar agente à fila de chat", "ALL_AGENTS": "Todos os agentes", - "SELECTED_AGENTS": "Agentes Selecionados", + "SELECTED_AGENTS": "Agentes selecionados", "CLOSEDAT": "Fechado em", "DISPOSITION": "Disposição", "CREATEDAT": "Criado em", @@ -425,11 +425,11 @@ "SELECT_WEBSITE": "Selecione um site", "INFO": "Info", "OFFLINEMESSAGES_CHATWEBSITE": "Ir para mensagens off-line", - "WAITINGTITLE": "Esperando Título", + "WAITINGTITLE": "Esperando título", "WAITINGMESSAGE": "Mensagem de espera", "RATING": "Avaliação", "NO_RATINGVALUE": "Sem avaliação", - "DEFAULT_PAUSE": "Pausa Padrão", + "DEFAULT_PAUSE": "Pausa padrão", "UNKNOWN": "Desconhecido", "UNREGISTERED": "Não registrado", "UNAVAILABLE": "Indisponível", @@ -444,15 +444,15 @@ "TEAMS_ASSOCIATION": "Associação de equipes", "MANDATORYDISPOSITION": "Disposição obrigatória", "MANDATORYDISPOSITIONPAUSEID": "Pausar para usar se a disposição obrigatória estiver ativada", - "ENABLESENDBUTTON": "Ativar botão Enviar", - "FEEDBACKTITLE": "Título do Feedback", + "ENABLESENDBUTTON": "Ativar botão enviar", + "FEEDBACKTITLE": "Título do feedback", "TOOLTIP_SCREENRECORDING_OFF": "Gravação de tela disponível", "TOOLTIP_SCREENRECORDING_ON": "Gravação de tela em andamento", "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download sem anexos", "DOWNLOAD_WITH_ATTACHMENTS": "Download com anexos", "LASTMESSAGE": "Última mensagem", "VIDAOO": "Vidaoo", - "VIDAOOAPIKEY": "Vidaoo Api Key", + "VIDAOOAPIKEY": "Vidaoo API Key", "VIDAOOESCALATION": "Iniciar videochamada", "VIDAOOSESSION": "Iniciar videochamada", "VIDEO": "Vídeo", @@ -472,12 +472,12 @@ "VIDAOOTOPIC": "Tema Vidaoo", "CHANNELID": "ID do canal", "EDIT_TVOX": "Editar TVox", - "MOTIONTITLE": "Título de Movimento", - "MOTIONURL": "URL de movimento", - "MOTIONURLONANSWER": "URL de movimento na resposta", - "MOTIONURLONRING": "URL de movimento no anel", + "MOTIONTITLE": "Título Motion", + "MOTIONURL": "URL Motion", + "MOTIONURLONANSWER": "Motion URL answer", + "MOTIONURLONRING": "Motion URL ring", "SERVICEID": "ID de serviço", - "SERVICENAME": "Nome do Serviço", + "SERVICENAME": "Nome do serviço", "TVOX": "TVox", "TVOXIP": "Endereço IP da TVox", "TVOXLOGINURL": "URL REST de login da TVox", diff --git a/public/app/main/apps/contactmanager/i18n/de.json b/public/app/main/apps/contactmanager/i18n/de.json index c3d27cc..dc22557 100644 --- a/public/app/main/apps/contactmanager/i18n/de.json +++ b/public/app/main/apps/contactmanager/i18n/de.json @@ -1,6 +1,6 @@ { "CONTACTMANAGER": { - "VOICEQUEUEID": "ID Anruf-Warteschlange", + "VOICEQUEUEID": "ID Warteschlange für Sprachanrufe", "CAMPAIGNID": "Kampagnen-ID", "STATE": "Status", "NAME": "Name", @@ -9,36 +9,36 @@ "STATUS": "Status", "STARTTIME": "Startzeit", "ENDTIME": "Endzeit", - "MOTION_BULL": "Outbound-Dialer", - "HOPPER": "Kontakte in Ausführung", - "FINAL": "Kontakte abgeschlossen", - "HISTORY": "Kontaktverlauf", + "MOTION_BULL": "Motion Bull", + "HOPPER": "Hopper", + "FINAL": "Hopper final", + "HISTORY": "Hopper historisch", "SCHEDULEDAT": "Geplant am", "SEARCH_FOR_ANYONE": "Suche", "EDIT_LIST": "Liste bearbeiten", - "EDIT_HOPPER": "Kontakte in Ausführung bearbeiten", + "EDIT_HOPPER": "Hopper bearbeiten", "DELETE_LIST": "Liste löschen", - "DELETE_HOPPER": "Kontakte in Ausführung löschen", - "RELOAD": "Neu Laden", - "NO_COMPANIES": "Keine Unternehmen vorhanden", + "DELETE_HOPPER": "Hopper löschen", + "RELOAD": "Neu laden", + "NO_COMPANIES": "Kein Unternehmen", "NO_AVAILABLE_ITEMS": "Keine Einträge verfügbar", "ADD": "Hinzufügen", "ERRORS": { - "NAME_REQUIRED": "Nachname erforderlich", - "FIRSTNAME_REQUIRED": "Vorname erforderlich", - "PHONE_REQUIRED": "Telefonnummer erforderlich", - "ALIAS_REQUIRED": "Alias erforderlich", - "VALUE_REQUIRED": "Wert erforderlich", - "EMAIL_MUST_VALID": "Ungültiges Format E-Mail", + "NAME_REQUIRED": "Name ist erforderlich", + "FIRSTNAME_REQUIRED": "Vorname ist erforderlich", + "PHONE_REQUIRED": "Telefonnummer ist erforderlich", + "ALIAS_REQUIRED": "Alias ist erforderlich", + "VALUE_REQUIRED": "Wert ist erforderlich", + "EMAIL_MUST_VALID": "Falsches Format", "PHONEBAR_API": "Statusprüfung für die MotionBar und des Remote-Switches für den Agenten", - "ACTIONTYPE_REQUIRED": "Aktionstyp erforderlich", - "CLICKTOACTION_REQUIRED": "Aktion bei Klick erforderlich" + "ACTIONTYPE_REQUIRED": "Pflichtfeld", + "CLICKTOACTION_REQUIRED": "Pflichtfeld" }, "DESCRIPTION": "Beschreibung", "DISPOSITION": "Qualifizierung", "DISPOSITIONS": "Qualifizierungen", - "VOICEDISPOSITIONS": "Anruf-Qualifizierungen", - "NEW_VOICEDISPOSITION": "Neue Qualifizierung", + "VOICEDISPOSITIONS": "Anrufqualifizierungen", + "NEW_VOICEDISPOSITION": "Neue Anrufqualifizierung", "CUSTOM_FIELDS": "Benutzerdefinierte Felder", "ADD_LIST": "Liste hinzufügen", "BACK": "Zurück", @@ -64,8 +64,8 @@ "DELETE_CONTACT": "Kontakt löschen", "CREATED_AT": "Erstellt am", "SAVE": "Speichern", - "DETAIL": "Details", - "PERSONAL_INFO": "Persönliche Informationen", + "DETAIL": "Detail", + "PERSONAL_INFO": "Persönliche Infos", "MOBILE": "Mobiltelefon", "FAX": "Fax", "TAGS": "Tags", @@ -84,7 +84,7 @@ "CUSTOMFIELDS": "Benutzerdefinierte Felder", "NO_CUSTOMFIELD_AVAILABLE": "Keine benutzerdefinierten Felder verfügbar", "ADD_TAG": "Tag hinzufügen", - "NO_TAG": "Keine Tags vorhanden", + "NO_TAG": "Keine Tags", "ALIAS": "Alias", "TYPE": "Typ", "VALUE": "Wert", @@ -112,7 +112,7 @@ "POSTAL_CODE": "Postleitzahl", "SHIPMENTADDRESS": "Lieferadresse", "COPY_CONTACT": "Kontakt kopieren", - "GOTOCONTACTS_LIST": "Zur Kontaktliste gehen", + "GOTOCONTACTS_LIST": "Kontakte anzeigen", "GOTOCONTACTS_COMPANY": "Kontakte anzeigen", "ADD_AGENT_TO_LIST": "Agenten zur Liste hinzufügen", "AGENTADD_LIST": "Agenten zur Liste hinzufügen", @@ -120,7 +120,7 @@ "NONE": "Nichts", "FULLNAME": "Vollständiger Name", "CHECK_DUPLICATES": "auf Duplikate prüfen", - "DUPLICATES": "Duplikate prüfen", + "DUPLICATES": "Duplikate", "UPLOAD_CSV": "Hochladen von CSV-Datei", "TAG": "Tag", "UPLOAD": "Hochladen", @@ -152,14 +152,14 @@ "PAGE": "Seite", "ROWSPERPAGE": "Zeilen pro Seite", "OF": "von", - "SOCIAL": "Social Media", + "SOCIAL": "Social", "ROW": "Reihe", "EXPORT_ERRORS": "Fehler-Log exportieren", "UPLOAD_COMPLETED": "Hochladen abgeschlossen", - "STOP": "Anhalten", + "STOP": "Stopp", "SELECT_FILE": "Datei auswählen", "IMPORT_CONTACTS": "Kontakte importieren", - "MOTIONDIALER": "Outbound-Dialer", + "MOTIONDIALER": "Motion Bull", "PREFIX": "Vorwahl wählen", "PRIORITY": "Priorität", "USERID": "Agent-ID abrufen", diff --git a/public/app/main/apps/contactmanager/i18n/nl.json b/public/app/main/apps/contactmanager/i18n/nl.json index caf032b..6a8b39d 100644 --- a/public/app/main/apps/contactmanager/i18n/nl.json +++ b/public/app/main/apps/contactmanager/i18n/nl.json @@ -11,57 +11,57 @@ "ENDTIME": "Eindtijd", "MOTION_BULL": "Motion Bull", "HOPPER": "Trechter", - "FINAL": "Trechter def.", - "HISTORY": "Trechter Geschiedenis", + "FINAL": "Hopper def.", + "HISTORY": "Hopper Geschiedenis", "SCHEDULEDAT": "Gepland op", - "SEARCH_FOR_ANYONE": "Zoeken", - "EDIT_LIST": "Lijst bewerken Bewerken", - "EDIT_HOPPER": "Trechter", - "DELETE_LIST": "Lijst Verwijderen", - "DELETE_HOPPER": "Trechter Verwijderen", - "RELOAD": "Herladen", + "SEARCH_FOR_ANYONE": "Zoeken voor iedereen", + "EDIT_LIST": "Edit List (Lijst bewerken", + "EDIT_HOPPER": "Edit Hopper", + "DELETE_LIST": "Lijst wissen", + "DELETE_HOPPER": "Hopper verwijderen", + "RELOAD": "Reload", "NO_COMPANIES": "Geen enkele onderneming", "NO_AVAILABLE_ITEMS": "Geen beschikbare items", "ADD": "Toevoegen", "ERRORS": { - "NAME_REQUIRED": "Verplicht veld", - "FIRSTNAME_REQUIRED": "Verplicht veld", - "PHONE_REQUIRED": "Verplicht veld", - "ALIAS_REQUIRED": "Verplicht veld", - "VALUE_REQUIRED": "Verplicht veld", - "EMAIL_MUST_VALID": "Ongeldig formaat", + "NAME_REQUIRED": "De naam is verplicht", + "FIRSTNAME_REQUIRED": "De Voornaam is verplicht", + "PHONE_REQUIRED": "Het telefoonnummer is verplicht", + "ALIAS_REQUIRED": "De alias is vereist", + "VALUE_REQUIRED": "De waarde is vereist", + "EMAIL_MUST_VALID": "Het e-mailadres moet worden geschreven in een geldige indeling", "PHONEBAR_API": "Controleer of de MotionBar draait en dat de afstandsbediening voor de agent is ingeschakeld", "ACTIONTYPE_REQUIRED": "Verplicht veld", "CLICKTOACTION_REQUIRED": "Verplicht veld" }, "DESCRIPTION": "Beschrijving", - "DISPOSITION": "Dispositie", - "DISPOSITIONS": "Disposities", - "VOICEDISPOSITIONS": "Spraak disposities", - "NEW_VOICEDISPOSITION": "Nieuw spraak dispositie", - "CUSTOM_FIELDS": "Aangepaste Velden", - "ADD_LIST": "Lijst Toevoegen", + "DISPOSITION": "Afvoeren", + "DISPOSITIONS": "Dispositions", + "VOICEDISPOSITIONS": "Voice dispositieven", + "NEW_VOICEDISPOSITION": "Nieuw spraakbericht dispositie", + "CUSTOM_FIELDS": "Aangepaste velden", + "ADD_LIST": "Lijst toevoegen", "BACK": "Terug", "SELECTED": "Geselecteerd", - "SELECT_ALL": "Selecteer Alles", - "SELECT_NONE": "Selecteer Geen", + "SELECT_ALL": "Alles selecteren", + "SELECT_NONE": "Selecteer None (Geen).", "COMPANIES": "Bedrijven", - "EDIT_COMPANY": "Bedrijf Bewerken", - "DELETE_COMPANY": "Bedrijf Verwijderen", + "EDIT_COMPANY": "Bedrijf wijzigen", + "DELETE_COMPANY": "Bedrijf verwijderen", "PHONE": "Telefoon", "EMAIL": "E-mail", - "ADD_COMPANY": "Bedrijf Toevoegen", + "ADD_COMPANY": "Bedrijf toevoegen", "CONTACTS": "Contactpersonen", - "NEW_LIST": "Nieuwe Lijst", + "NEW_LIST": "Nieuwe lijst", "FIRSTNAME": "Voornaam", "LASTNAME": "Achternaam", "LIST": "Lijst", "COMPANY": "Bedrijf", - "ADD_CONTACT": "Contactpersoon Toevoegen", - "EDIT_CONTACT": "Contactpersoon Bewerken", + "ADD_CONTACT": "Contactpersoon toevoegen", + "EDIT_CONTACT": "Contactpersoon bewerken", "MERGE_CONTACT": "Merge Contact", "DUPLICATE_CONTACT": "Dubbele contactpersoon", - "DELETE_CONTACT": "Contactpersoon Verwijderen", + "DELETE_CONTACT": "Contactpersoon verwijderen", "CREATED_AT": "Gemaakt op", "SAVE": "Opslaan", "DETAIL": "Detail", @@ -76,34 +76,34 @@ "STREET": "Straat", "POSTALCODE": "Postcode", "DELETE": "Verwijderen", - "DELETE_ALL": "Alles Verwijderen", + "DELETE_ALL": "Alles verwijderen", "CONTACTMANAGER": "Contact Manager", "ID": "Id", "SETTINGS": "Instellingen", "GENERAL": "Algemeen", - "CUSTOMFIELDS": "Aangepaste Velden", + "CUSTOMFIELDS": "Aangepaste velden", "NO_CUSTOMFIELD_AVAILABLE": "Geen aangepaste velden", - "ADD_TAG": "Tag Toevoegen", + "ADD_TAG": "Tag toevoegen", "NO_TAG": "Geen Tags", "ALIAS": "Alias", "TYPE": "Type", "VALUE": "Waarde", - "ADD_CUSTOMFIELD": "Aangepast veld Toevoegen", - "EDIT_CUSTOMFIELD": "Aangepaste veld Bewerken", - "DELETE_CUSTOMFIELD": "Aangepaste veld Bewerken", + "ADD_CUSTOMFIELD": "Aangepast veld toevoegen", + "EDIT_CUSTOMFIELD": "Bewerk aangepaste veld", + "DELETE_CUSTOMFIELD": "Verwijder aangepaste veld", "NEW_COMPANY": "Nieuwe onderneming", "NEW_CONTACT": "Nieuwe contactpersoon", "NEW_TAG": "Nieuwe Tag", - "UPLOAD_CONTACTS": "Contact uploadeden", - "FINISH": "Voltooid", + "UPLOAD_CONTACTS": "Upload Contact", + "FINISH": "Afwerking", "SUCCESS": "Succes", "FAILURE": "Defect", "ALL_CONTACTS": "Alle contactpersonen", "NEW_CUSTOMFIELD": "Nieuwe aangepaste veld", - "NO_VOICEDISPOSITION_AVAILABLE": "Geen spraakmemo disposities beschikbaar", - "ADD_VOICEDISPOSITION": "Spraak dispositie Toevoegen", - "EDIT_VOICEDISPOSITION": "Spraak dispositie Bewerken", - "DELETE_VOICEDISPOSITION": "Spraak dispositie Verwijderen", + "NO_VOICEDISPOSITION_AVAILABLE": "Geen spraakmemo dispositieven beschikbaar", + "ADD_VOICEDISPOSITION": "Voeg spraak dispositie", + "EDIT_VOICEDISPOSITION": "Edit Voice dispositie", + "DELETE_VOICEDISPOSITION": "Alle spraakberichten dispositie", "VAT": "Btw", "COMPANYID": "Bedrijf ID", "WEBSITE": "Website", @@ -130,14 +130,14 @@ "DATEOFBIRTH": "Geboortedatum", "NOTES": "Aantekeningen", "EXPORTCSVCONTACTS_LIST": "Exporteren naar CSV", - "GOTO_LIST": "Contactpersonen Weergeven", - "GOTO_COMPANY": "Contactpersonen Weergeven", + "GOTO_LIST": "Contactpersonen weergeven", + "GOTO_COMPANY": "Contactpersonen weergeven", "REQUIRED": "Vereist", - "GLOBALCUSTOMFIELDS": "Aangepaste Velden", - "NEW_GLOBALCUSTOMFIELD": "Nieuw aangepast veld", - "ADD_GLOBALCUSTOMFIELD": "Aangepast veld Toevoegen", - "EDIT_GLOBALCUSTOMFIELD": "Aangepaste veld Bewerken", - "DELETE_GLOBALCUSTOMFIELD": "Aangepaste veld Verwijderen", + "GLOBALCUSTOMFIELDS": "Wereldwijde Aangepaste velden", + "NEW_GLOBALCUSTOMFIELD": "Nieuwe aangepaste velden", + "ADD_GLOBALCUSTOMFIELD": "Aangepast veld toevoegen", + "EDIT_GLOBALCUSTOMFIELD": "Bewerk aangepaste veld", + "DELETE_GLOBALCUSTOMFIELD": "Verwijder aangepaste veld", "JSCRIPTY": "Jscripty", "SESSIONS": "Sessies", "AGENT": "Agent", @@ -147,7 +147,7 @@ "SELECT_TAGS": "Selecteer één of meer tags", "HELP": { "PHONEBAR_API": "Om klik-en-bel een telefoonnummer en controleert u of de afstandsbediening is ingeschakeld voor de agent", - "PHONEBAR_API_MESSAGE": "Als u click-to-call wilt inschakelen, voegt u een telefoonnummer in en vinkt u het bedienen op afstand aan om de agent in te schakelen" + "PHONEBAR_API_MESSAGE": "Als u click-to-call wilt inschakelen, voegt u een telefoonnummer in en vinkt u de afstandsbedieningsschakelaar aan om de agent in te schakelen" }, "PAGE": "Pagina", "ROWSPERPAGE": "Rijen per pagina", @@ -166,9 +166,9 @@ "CUSTOMER_JOURNEY": "Customer Journey", "SELECT_TAG": "Selecteer tags", "ALL": "Allemaal", - "BILLINGINFORMATION": "Facturatie gegevens", + "BILLINGINFORMATION": "facturatie gegevens", "COMPANY_FISCAL_TYPE": "Bedrijf Fiscaal Type", - "CREATE": "Aanmaken", + "CREATE": "creëren", "EUROPE": "Europa", "EXPIREDAY": "Vervaldagen", "FLATDISCOUNT": "Bedrijfskorting", diff --git a/public/app/main/apps/contactmanager/i18n/pt-BR.json b/public/app/main/apps/contactmanager/i18n/pt-BR.json index ad3aafe..c7f8a2f 100644 --- a/public/app/main/apps/contactmanager/i18n/pt-BR.json +++ b/public/app/main/apps/contactmanager/i18n/pt-BR.json @@ -1,25 +1,25 @@ { "CONTACTMANAGER": { "SELECT_TAG": "Selecione tags", - "CUSTOMER_JOURNEY": "Jornada do Cliente", + "CUSTOMER_JOURNEY": "Jornada do cliente", "USERID": "Lembrar ID do agente", "PRIORITY": "Prioridade", "MOTIONDIALER": "Motion Bull", "IMPORT_CONTACTS": "Importar contatos", "PREFIX": "Prefixo de discagem", - "VOICEQUEUEID": "ID da Fila de Voz", + "VOICEQUEUEID": "ID da fila de voz", "CAMPAIGNID": "ID da campanha", "STATE": "Estado", "NAME": "Nome", "LISTS": "Listas", - "UNIQUEID": "ID unico", + "UNIQUEID": "ID único", "STATUS": "Status", "STARTTIME": "Início", "ENDTIME": "Fim", "MOTION_BULL": "Motion Bull", "HOPPER": "Funil", "FINAL": "Final do funil", - "HISTORY": "Histórico do funil", + "HISTORY": "História do funil", "SCHEDULEDAT": "Agendado em", "SEARCH_FOR_ANYONE": "Procurar", "EDIT_LIST": "Editar lista", @@ -42,16 +42,16 @@ "CLICKTOACTION_REQUIRED": "Campo obrigatório" }, "DESCRIPTION": "Descrição", - "DISPOSITION": "Descrição", - "DISPOSITIONS": "Descrição", + "DISPOSITION": "Disposição", + "DISPOSITIONS": "Disposições", "VOICEDISPOSITIONS": "Disposições de voz", "NEW_VOICEDISPOSITION": "Nova disposição de voz", - "CUSTOM_FIELDS": "Campos personalizados", + "CUSTOM_FIELDS": "Os campos personalizados", "ADD_LIST": "Adicionar lista", "BACK": "Voltar", "SELECTED": "Selecionado", "SELECT_ALL": "Selecionar todos", - "SELECT_NONE": "Selecionar Nenhum", + "SELECT_NONE": "Selecionar nenhum", "COMPANIES": "Empresas", "EDIT_COMPANY": "Editar empresa", "DELETE_COMPANY": "Excluir empresa", @@ -59,8 +59,8 @@ "EMAIL": "Email", "ADD_COMPANY": "Adicionar empresa", "CONTACTS": "Contatos", - "NEW_LIST": "Nova Lista", - "FIRSTNAME": "Primeiro Nome", + "NEW_LIST": "Nova lista", + "FIRSTNAME": "Primeiro nome", "LASTNAME": "Sobrenome", "LIST": "Lista", "COMPANY": "Empresa", @@ -72,7 +72,7 @@ "CREATED_AT": "Criado em", "SAVE": "Salvar", "DETAIL": "Detalhes", - "PERSONAL_INFO": "Informação Pessoal", + "PERSONAL_INFO": "Informação pessoal", "MOBILE": "Celular", "FAX": "Fax", "TAGS": "Tags", @@ -84,40 +84,40 @@ "POSTALCODE": "CEP", "DELETE": "Excluir", "DELETE_ALL": "Excluir tudo", - "CONTACTMANAGER": "Gestão de contatos", + "CONTACTMANAGER": "Gerenciar contatos", "ID": "Id", "SETTINGS": "Configurações", "GENERAL": "Geral", "CUSTOMFIELDS": "Campos personalizados", "NO_CUSTOMFIELD_AVAILABLE": "Nenhum campo personalizado disponível", "ADD_TAG": "Adicionar tag", - "NO_TAG": "Sem Tags", + "NO_TAG": "Sem tags", "ALIAS": "Apelido", "TYPE": "Tipo", "VALUE": "Valor", "ADD_CUSTOMFIELD": "Adicionar campo personalizado", "EDIT_CUSTOMFIELD": "Editar campo personalizado", "DELETE_CUSTOMFIELD": "Excluir campo personalizado", - "NEW_COMPANY": "Nova Empresa", - "NEW_CONTACT": "Novo Contato", - "NEW_TAG": "Nova Tag", + "NEW_COMPANY": "Nova empresa", + "NEW_CONTACT": "Novo contato", + "NEW_TAG": "Nova tag", "UPLOAD_CONTACTS": "Atualizar contatos", "FINISH": "Terminar", "SUCCESS": "Sucesso", "FAILURE": "Falha", - "ALL_CONTACTS": "Todos os Contatos", + "ALL_CONTACTS": "Todos os contatos", "NEW_CUSTOMFIELD": "Novo campo personalizado", "NO_VOICEDISPOSITION_AVAILABLE": "Nenhuma disposição de voz disponível", "ADD_VOICEDISPOSITION": "Adicionar disposição de voz", "EDIT_VOICEDISPOSITION": "Editar disposição de voz", "DELETE_VOICEDISPOSITION": "Excluir disposição de voz", "VAT": "VAT", - "COMPANYID": "ID Empresa", + "COMPANYID": "ID empresa", "WEBSITE": "Website", "EMAIL_DOMAIN": "Domínio de email", "ADDRESS": "Endereço", "POSTAL_CODE": "CEP", - "SHIPMENTADDRESS": "Endereço de Envio", + "SHIPMENTADDRESS": "Endereço de envio", "COPY_CONTACT": "Copiar contato", "GOTOCONTACTS_LIST": "Mostrar contatos", "GOTOCONTACTS_COMPANY": "Mostrar contatos", @@ -125,14 +125,14 @@ "AGENTADD_LIST": "Adicionar agentes à lista", "NO_AVAILABLE_INFO": "Nenhuma informação disponível", "NONE": "Nenhum", - "FULLNAME": "Nome COmpleto", + "FULLNAME": "Nome completo", "CHECK_DUPLICATES": "Verificar duplicados", "DUPLICATES": "Duplicatas", "UPLOAD_CSV": "Envio CSV", "TAG": "Tag", "UPLOAD": "Envio", "ALL_AGENTS": "Todos os agentes", - "SELECTED_AGENTS": "Agentes Selecionados", + "SELECTED_AGENTS": "Agentes selecionados", "DATE_OF_BIRTH": "Data de nascimento", "DATEOFBIRTH": "Data de nascimento", "NOTES": "Notas", @@ -140,11 +140,11 @@ "GOTO_LIST": "Mostrar contatos", "GOTO_COMPANY": "Mostrar contatos", "REQUIRED": "Requeridos", - "GLOBALCUSTOMFIELDS": "Campos personalizados", - "NEW_GLOBALCUSTOMFIELD": "Novos campos personalizados", - "ADD_GLOBALCUSTOMFIELD": "Adicionar campo personalizado", - "EDIT_GLOBALCUSTOMFIELD": "Editar campo personalizado", - "DELETE_GLOBALCUSTOMFIELD": "Excluir campo personalizado", + "GLOBALCUSTOMFIELDS": "Campos personalizados globais", + "NEW_GLOBALCUSTOMFIELD": "Novo campo personalizado global", + "ADD_GLOBALCUSTOMFIELD": "Adicionar campo personalizado global", + "EDIT_GLOBALCUSTOMFIELD": "Editar campo personalizado global", + "DELETE_GLOBALCUSTOMFIELD": "Excluir campo personalizado global", "JSCRIPTY": "Jscripty", "SESSIONS": "Sessões", "AGENT": "Agente", @@ -168,19 +168,19 @@ "ALL": "Tudo", "BILLINGINFORMATION": "Informações de pagamento", "COMPANY_FISCAL_TYPE": "Tipo fiscal da empresa", - "CREATE": "Criado", + "CREATE": "Crio", "EUROPE": "Europa", - "EXPIREDAY": "Dias para vencimento", + "EXPIREDAY": "Dias de vencimento", "FLATDISCOUNT": "Desconto da empresa", - "INVOICEARTICLE": "Artigos de Direito", - "ISOCODE": "Código ISO", + "INVOICEARTICLE": "Artigos de fatura", + "ISOCODE": "Código nacional ISO", "PAYMENTMETHOD": "Forma de pagamento", "PIVA": "Número de IVA", "RELATIONSHIP": "Relacionamento ...", "RELATIONSHIPCOMPANY": " ... com", "SDICODE": "Código SDI", "SOCIAL_CAPITAL": "Capital social", - "VATNUMBER_CF": "Código fiscal / IVA", + "VATNUMBER_CF": "Código VAT / IVA", "RECALLME": "Lembre-me", "ACTIONTYPE": "Tipo de acão", "CLICKTOACTION": "Clique para ação", diff --git a/public/app/main/apps/dashboards/i18n/de.json b/public/app/main/apps/dashboards/i18n/de.json index a193596..6015548 100644 --- a/public/app/main/apps/dashboards/i18n/de.json +++ b/public/app/main/apps/dashboards/i18n/de.json @@ -11,36 +11,36 @@ "SUBJECT": "Betreff", "REFERER": "Referer", "ACCOUNT": "Konto", - "WEBSITE": "Webseite", + "WEBSITE": "Website", "AGENT": "Agent", "CREATED_AT": "Erstellt am", "CLOSED_AT": "Geschlossen am", "DISPOSITION": "Qualifizierung", "CONTACT": "Kontakt", "INTERACTION": "Interaktion", - "BROWSER_NAME": "Name Browser", - "BROWSER_VERSION": "Version Broweer", - "OS_NAME": "Name Betriebssystem", - "OS_VERSION": "Version Betriebssystem", + "BROWSER_NAME": "Browser Name", + "BROWSER_VERSION": "Browser Version", + "OS_NAME": "Betriebssystem Name", + "OS_VERSION": "Betriebssystem Version", "DEVICE_MODEL": "Gerätemodell", "DEVICE_VENDOR": "Gerätehersteller", "DEVICE_TYPE": "Gerätetyp", - "RECALLME": "Pers. Wiedervorlage", - "DROP_RATE": "Drop-Rate", - "DROPPED": "Abgebrochen (Drop)", - "DROPPED_TEXT": "Anzahl vom System aufgelegt", - "DETAIL": "Details", - "MOTION_BULL": "Outbound Dialer", + "RECALLME": "Rückruf anfordern", + "DROP_RATE": "Abbruchrate Anrufe", + "DROPPED": "Abgebrochen", + "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": "Aufzeichnungen", - "TODAY_MOTION_BULL_STATS": "Tagesstatistiken - ausgehende Warteschlangen", - "ORIGINATED": "Angewählt", - "ORIGINATED_TEXT": "Anzahl angewählter Anrufe", + "TODAY_MOTION_BULL_STATS": "Tagesstatistiken Warteschlangen", + "ORIGINATED": "Gewählt", + "ORIGINATED_TEXT": "Anrufe aus der Warteschlange gewählt", "UPDATE": "Aktualisieren", "MORE": "Mehr", - "MOTIONDIALER": "Outbound Dialer", + "MOTIONDIALER": "Motion Dialer", "DISPOSE": "Qualifizieren", "QUEUES": "Warteschlangen", "DIALER_CALL": "Dialer-Anruf", @@ -58,8 +58,8 @@ "PERSONAL_INFO": "Persönliche Infos", "SOLD": "Verkauft", "SPECIAL": "Speziell", - "BLACKLIST": "Schwarze Liste", - "RESCHEDULE": "Allg. Wiedervorlage", + "BLACKLIST": "Blacklist", + "RESCHEDULE": "erneut Planen", "FIRSTNAME": "Vorname", "LASTNAME": "Nachname", "MOBILE": "Mobilnummer", @@ -73,16 +73,16 @@ "CUSTOM_FIELDS": "Benutzerdefinierte Felder", "GENERAL": "Allgemein", "VOICE": "Sprachanrufe", - "TODAY_IVR_CAMPAIGNS_STATS": "Tagesstatistiken - IVR-Kampagnen", + "TODAY_IVR_CAMPAIGNS_STATS": "IVR-Tagesstatistiken", "TODAY_INBOUND_STATS": "Tagesstatistiken - eingehende Warteschlangen", "TODAY_OUTBOUND_STATS": "Tagesstatistiken - ausgehende Warteschlangen", - "WAITING": "Wartend", + "WAITING": "Anrufe in Warteschlange", "TALKING": "Im Gespräch", "INBOUND_ANSWERED": "Angenommen eingehend", "OUTBOUND_ANSWERED": "Angenommen ausgehend", "ABANDONED": "Abgebrochen", "TOTAL_OFFERED": "Gesamt angeboten", - "AVG_HOLD_TIME": "DS. Wartezeit", + "AVG_HOLD_TIME": "Durchschnittliche Wartezeit", "INBOUND_ANSWER_RATE": "Antwortrate eingehend", "OUTBOUND_ANSWER_RATE": "Antwortrate ausgehend", "ABANDON_RATE": "Abbruchrate", @@ -91,51 +91,51 @@ "TOT_DURATION": "Gesamtdauer", "AVG_DURATION": "Durchschnittliche Dauer", "HELP": { - "ORIGINATEDLIMITED": "Übersicht zu automatischen Outbound-Kampagnen per IVR. Anzahl Anrufe gewählt zu Anzahl Anrufe unvollständig (keine freien Leitungen, keine Agenten, etc.)", - "DROPPED": "Gesamtzahl der vom System aufgelegten Anrufe, weil zum Zeitpunkt der Verbindung kein Agent frei war (Drop-Call)", - "DROP_RATE": "Abbruchrate der vom System aufgelegten Anrufe (Drop-Calls) im Vergleich zu allen Anrufen ", - "WAITING": "Gesamtzahl aller wartenden Interaktionen in der Warteschlange", - "OUTBOUND_ANSWERED": "Gesamtzahl aller ausgehenden Anrufe, welche von der Gegenstelle beantwortet wurden", - "ABANDONED": "Gesamtzahl der Chats, welche vom Kunden nicht beendet wurden", - "TOTAL_OFFERED": "Gesamtanzahl aller angebotenen Interaktionen. (Je nach Kanal Summe aus \"Geöffnet\", \"Bearbeitet\", \"Ausgelaufen\" und \"nicht Bearbeitet\")", + "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 ausgehenden Anrufe mit Antwort der Gegenstelle im Vergleich zu allen ausgehenden Anrufen", - "ABANDON_RATE": "Rate aller eingehenden Anrufe, bei denen der Kunde aufgelegt hat, bevor mit einem Agenten gesprochen wurde im Vergleich zu allen eingehenden Anrufen", - "UNMANAGED": "Gesamtzahl aller Chats, welche vom Kunden abgebrochen wurden, bevor ein Agent verfügbar war.", - "TOTAL": "Gesamtzahl aller ausgehenden Anrufe, welche von Agenten gewählt wurden", - "TOT_DURATION": "esamtdauer aller ausgehenden Anrufe, welche von Agenten gewählt wurden", - "AVG_DURATION": "Durchschnittliche Dauer aller ausgehenden Anrufe", - "ORIGINATED": "Gesamtzahl aller Wählversuche für ausgehende Anrufe. Beinhaltet auch Systemergebnisse wie z.B. \"Besetzt\", Anrufbeantworter\", etc.", - "ABANDONED_RATE": "Rate aller eingehenden Chats, welche vor der Verbindung mit einem Agenten vom Kunden abgebrochen wurden im Vergleich zu allen eingehenden Chats", - "AVG_MANAGED_TIME": "Die durchschnittliche Zeit welche ein Agent für die Bearbeitung eines Chats benötigt hat. (Klingeln beim Agenten + Bearbeitung des Chats + Nacharbeit)", - "MANAGED": "Gesamtzahl der durch einen Agenten bearbeiteten Interaktionen. (Status: geschlossen)", - "MANAGED_RATE": "Rate aller bearbeiteten Interaktionen (Status: geschlossen) im Vergleich zu allen eingehenden Interaktionen", - "OPENED": "Gesamtanzahl aller derzeit geöffneten Interaktionen", - "UNMANAGED_RATE": "Rate der heutigen Interaktionen, welche noch nicht bearbeitet wurden im Vergleich zu allen eingegangenen Interaktionen", - "VOICE_ABANDONED": "Gesamtzahl aller in der Warteschlange abgebrochenen Anrufe im Vergleich zu allen eingehenden Anrufen. Hinweis: Anrufe, die wegen voreingestellter Zeitüberschreitung und \"Betreten der Warteschlange, obwohl keine Agenten angemeldet waren\" abgebrochen sind, werden nicht berücksichtigt.", - "VOICE_ANSWERED": "Gesamtanzahl aller eingehenden Anrufe, welche durch einen Agenten entgegengenommen wurden", - "VOICE_ANSWER_RATE": "Rate aller durch einen Agenten beantworteten Anrufe im Vergleich zu allen eingehenden Anrufen", - "VOICE_AVG_HOLD_TIME": "Durchschnittliche Wartezeit in der Warteschlange bis zur Beantwortung des Anrufes durch einen Agenten", - "VOICE_AVG_TALK_TIME": "Durchschnittliche Gesprächszeit für alle eingehenden Anrufe", - "VOICE_TALKING": "Gesamtzahl der aktiven Gespräche über alle eingehenden Warteschlangen", - "VOICE_TOTAL_OFFERED": "Gesamtzahl aller angebotenen Anrufe (\"Abgeschlossen\", \"Verloren\" und \"nicht Bearbeitet\"). Hinweis: Anrufe, welche bereits in der IVR abgebrochen sind, werden nicht berücksichtigt.", - "VOICE_UNMANAGED": "Gesamtzahl aller nicht bearbeiteten Anrufe, welche durch die Systemeinstellungen abgebrochen wurden. (Bsp: Zeitüberschreitung innerhalb der Warteschlange; Überlauf in eine andere Warteschlange; Betreten oder Verbleiben in der Warteschlange, wenn keine Agenten mehr angemeldet sind.)", - "VOICE_WAITING": "Gesamtzahl der aktuell wartenden Anrufe über alle eingehenden Warteschlangen", + "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": "Genaue Übereinstimmung der Suchbegriffe", - "LIKE_FILTER": "Variable Übereinstimmung der Suchbegriffe" + "EXACT_MATCH_FILTER": "Suche nach einer genauen Übereinstimmung der Suchbegriffe", + "LIKE_FILTER": "Suche nach variablen Übereinstimmungen der Suchbegriffe" }, "ERRORS": { - "FIRSTNAME_REQUIRED": "Vorname erforderlich", - "PHONE_REQUIRED": "Telefonnummer erforderlich", - "DISPOSITION_REQUIRED": "Qualifizierung erforderlich", - "AGENT_REQUIRED": "Agent erforderlich", - "QUEUE_REQUIRED": "Warteschlange erforderlich", - "CAMPAIGN_REQUIRED": "Kampagne erforderlich", - "FAILED_INITIALIZATION": "Fehler während Initialisierung" + "FIRSTNAME_REQUIRED": "Der erste Name ist erforderlich", + "PHONE_REQUIRED": "Die Telefonnummer ist erforderlich", + "DISPOSITION_REQUIRED": "Pflichtfeld", + "AGENT_REQUIRED": "Pflichtfeld", + "QUEUE_REQUIRED": "Pflichtfeld", + "CAMPAIGN_REQUIRED": "Pflichtfeld", + "FAILED_INITIALIZATION": "Fehler während der Initialisierung" }, - "NO_AVAILABLE_INFO": "Keine Informationen vorhanden", - "WELCOME_TO_MOTION": "Willkommen!", + "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": "Kontaktmanager", @@ -147,16 +147,16 @@ "NEW_CONTACT": "Neuer Kontakt", "PHONE": "Telefon", "SAVE": "Speichern", - "INBOUND_WAITING_CALLS": "Liste der wartenden Anrufe", - "CONTACTS": "Globale Kontakte", - "MYCONTACTS": "Von mir bearbeitete Kontakte", + "INBOUND_WAITING_CALLS": "Wartende Anrufe (Eingehend)", + "CONTACTS": "Kontakte", + "MYCONTACTS": "Meine Kontakte", "ADD_CONTACT": "Kontakt hinzufügen", "RELOAD": "Neu Laden", "WAITING_TEXT": "Wartende Interaktionen", "TALKING_TEXT": "Aktive Anrufe", "INBOUND_ANSWERED_TEXT": "Angenommene Anrufe", - "ABANDONED_TEXT": "Gesamt abgebrochene Interaktionen", - "DROP_RATE_TEXT": "Rate vom System aufgelegt", + "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", @@ -165,12 +165,12 @@ "TOTAL_TEXT": "Gesamt ausgehende Anrufe", "OUTBOUND_ANSWERED_TEXT": "Beantwortete Anrufe (Ausgehend) ", "TOT_DURATION_TEXT": "Gesamtdauer ausgehender Anrufe ", - "AVG_DURATION_TEXT": "Durchschnittl. Dauer (Ausgehend)", - "OUTBOUND_ANSWER_RATE_TEXT": "Antwortrate ausgehende 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": "Text eingeben und Senden mit Eingabetaste", + "REPLY_PLACEHOLDER": "Text eingeben und ENTER drücken zum Senden", "CONTACT_INFO": "Kontaktinformationen", "CLOSE_AND_DISPOSE": "Schließen und Qualifizieren", "DISPOSITIONS": "Qualifizierungen", @@ -179,10 +179,10 @@ "REJECT": "Ablehnen", "CLOSED": "Geschlossen", "INFO": "Information", - "NOTE": "Anmerkung", + "NOTE": "Hinweis", "ACCEPT_ELSEWHERE": "Von anderem Teilnehmer angenommen", "ATTENTION": "Achtung", - "SOCIAL": "Social-Media", + "SOCIAL": "Sozial", "NO_JSCRIPTY_PROJECTS_AVAILABLE": "Keine Jscripty-Projekte verfügbar", "OPENED": "Geöffnet", "FILTER": "Filter", @@ -193,7 +193,7 @@ "INTERACTIONS": "Interaktionen", "STARTEDAT": "Begonnen am", "STATUS": "Status", - "OPEN": "Offen", + "OPEN": "Öffnen", "SHOW": "Anzeigen", "ME": "ICH", "NOT_ASSIGNED": "Nicht zugewiesen", @@ -213,13 +213,13 @@ "HIDE_DETAILS": "Details ausblenden", "EXTERNAL_URL": "Externer Link", "SET_AS": "Festlegen als", - "PENDING": "Warten auf Rückmeldung", + "PENDING": "Ausstehend", "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": "Warteschlangen filtern", + "FILTER_VOICE_QUEUES": "Anrufwarteschlangen filtern", "LOADING_INTERACTION": "Interaktion wird geladen", "JANUARY": "Januar", "FEBRUARY": "Februar", @@ -251,71 +251,71 @@ "YESTERDAY": "Gestern", "TODAY": "Heute", "SELECT_DATE": "Datum auswählen", - "SELECT_DATE_RANGE": "Datumsbereich wählen", - "CLEAR": "Zurücksetzen", - "CALL_NUMBER": "Nummer Anrufen", - "TRANSFER_NUMBER": "Transfer an Nummer", + "SELECT_DATE_RANGE": "Wählen Sie einen Datumsbereich", + "CLEAR": "Löschen", + "CALL_NUMBER": "Anrufen", + "TRANSFER_NUMBER": "Transfer", "CALL_SAVED": "Anruf erfolgreich gespeichert", "CALL_DISPOSED": "Anruf erfolgreich qualifiziert", - "CHANNEL_WAITING_TEXT": "Liste der wartenden Interaktionen", + "CHANNEL_WAITING_TEXT": "Wartende Interaktionen", "CHANNEL_QUEUE": "Warteschlange", - "CHANNEL_FROM": "Von", + "CHANNEL_FROM": "von", "MARK_AS_UNREAD": "Als ungelesen markieren", "SELECT_AGENT": "Agenten auswählen", "READ": "Gelesen", "SELECT_READ_UNREAD": "Wählen ob Lesen/Ungelesen", "SELECT_SUBSTATUS": "Zwischenstatus auswählen", "UNREAD": "Ungelesen", - "ABANDONAT": "Abgebrochen am", + "ABANDONAT": "Abgebrochen", "ABANDONEDQUEUECALLS": "Abgebrochene Anrufe", "FREE": "Frei", "LASTASSIGNEDTO": "Zuletzt zugewiesen an", "QUEUE": "Warteschlange", - "QUEUECALLEREXITAT": "Warteschlange verlassen am", + "QUEUECALLEREXITAT": "Abgebrochen", "QUEUECALLEREXITREASON": "Grund", "RESERVED": "Reserviert", "SELECT_CAMPAIGN": "Warteschlange auswählen", "ASSIGNTO": "Zuweisen", - "CLICKRELOAD": "Sie haben neue verpasste Anrufe. Bitte Seite neu Laden.", + "CLICKRELOAD": "Verpasste Anrufe! Bitte Seite erneut laden", "NOTAVAILABLE": "Nicht verfügbar", "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 Qualifizierung ausgewählt", - "ABANDONED_RATE": "Abbruchrate Chat", - "ABANDONED_RATE_TEXT": "Abgebrochene Chats", - "AVG_MANAGED_TIME": "DS. Bearbeitungszeit", - "AVG_MANAGED_TIME_TEXT": "Durchschnittliche Bearbeitungszeit", + "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 bearbeitete Interaktionen", - "MANAGED_TEXT": "Ges. Interaktionen bearbeitet", - "OPENED_TEXT": "Ges. Interaktionen geöffnet", - "TODAY_INTERACTIONS_STATS": "Tagesstatistiken - weitere Kanäle", + "MANAGED_RATE_TEXT": "Rate der bearbeiteten Interaktionen", + "MANAGED_TEXT": "Interaktionen bearbeitet", + "OPENED_TEXT": "Interaktionen geöffnet", + "TODAY_INTERACTIONS_STATS": "Interaktionen Tagesstatistiken", "UNMANAGED_RATE": "Rate nicht Bearbeitet", - "UNMANAGED_RATE_TEXT": "Rate nicht bearbeitete Interaktionen", - "VOICE_ABANDONED": "Gesamt Abgebrochen", - "VOICE_ABANDONED_TEXT": "Gesamt abgebrochene Anrufe", + "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 abgebrochene Anrufe", - "VOICE_ANSWERED": "Gesamt Angenommen", - "VOICE_ANSWERED_TEXT": "Gesamt angenommene Anrufe", + "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": "Antwortrate", - "VOICE_ANSWER_RATE_TEXT": "Rate angenommener Anrufe", - "VOICE_AVG_HOLD_TIME": "DS. Wartezeit", - "VOICE_AVG_HOLD_TIME_TEXT": "DS. Wartezeit (Eingehend)", - "VOICE_AVG_TALK_TIME": "DS. Gesprächszeit", - "VOICE_AVG_TALK_TIME_TEXT": "Durchschnittl. Gesprächszeit", - "VOICE_TALKING": "Derzeit im Gespräch", - "VOICE_TALKING_TEXT": "Gesamt aktive Anrufe", + "VOICE_ANSWER_RATE_TEXT": "Rate angenommener Anrufe in der Warteschlange", + "VOICE_AVG_HOLD_TIME": "Durchschnittliche Wartezeit", + "VOICE_AVG_HOLD_TIME_TEXT": "Durchschnittliche Wartezeit aller Sprachanrufe", + "VOICE_AVG_TALK_TIME": "Durchschnittliche Gesprächszeit", + "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": "Gesamt angeboten", - "VOICE_TOTAL_OFFERED_TEXT": "Gesamt angebotene Anrufe (Eingehend)", + "VOICE_TOTAL_OFFERED_TEXT": "Gesamtzahl der angebotenen Anrufe in der Warteschlange", "VOICE_UNMANAGED": "Nicht bearbeitet", - "VOICE_UNMANAGED_TEXT": "Ges. nicht bearbeitete Anrufe", + "VOICE_UNMANAGED_TEXT": "Nicht bearbeitete Anrufe in der Warteschlange", "VOICE_WAITING": "Wartende Anrufe", - "VOICE_WAITING_TEXT": "Gesamt wartende Anrufe", + "VOICE_WAITING_TEXT": "Wartende Anrufe in der Warteschlange", "DOWNLOAD": "Herunterladen", "SCHEDULED_CALLS": "Geplante Anrufe", "PRIVATE": "Persönlich", @@ -325,14 +325,14 @@ "INTERACTION_CLOSED": "Interaktion erfolgreich geschlossen", "INTERACTION_CLOSED_DISPOSED": "Interaktion erfolgreich geschlossen und qualifiziert", "INTERACTION_DISPOSED": "Interaktion erfolgreich qualifiziert", - "ASSIGNED_TO_OTHERS": "Einem anderen Nutzer zugewiesen", + "ASSIGNED_TO_OTHERS": "An Andere zugewiesen", "SELECT_ALL": "Alles auswählen", - "CHAT_INTERACTIONS": "Interaktionen per Chat", - "FAX_INTERACTIONS": "Interaktionen per Fax", + "CHAT_INTERACTIONS": "Chat-Interaktionen", + "FAX_INTERACTIONS": "Fax-Interaktionen", "ID": "ID", - "MAIL_INTERACTIONS": "Interaktionen per E-Mail", - "OPENCHANNEL_INTERACTIONS": "Interaktionen über den offenen Kanal", - "SMS_INTERACTIONS": "Interaktionen per SMS", + "MAIL_INTERACTIONS": "E-Mail-Interaktionen", + "OPENCHANNEL_INTERACTIONS": "Offener-Kanal-Interaktionen", + "SMS_INTERACTIONS": "SMS-Interaktionen", "CANCEL": "Abbrechen", "DRAFT": "Entwurf speichern", "DRAFT_SAVE_WARNING_MESSAGE": "Für diese Interaktion ist bereits ein Entwurf gespeichert. Möchten Sie diesen überschreiben?", @@ -346,9 +346,9 @@ "ADD_PRODUCTPRICELIST": "PRODUKT HINZUFÜGEN", "AGENTFULLNAME": "Agent", "ALL_COMPANIES": "Alle Unternehmen", - "ALL_PRODUCTS": "Alle Produkte", - "ALL_STATUS": "Alle Status", - "ALL_STEP": "Alle Schritte", + "ALL_PRODUCTS": "Alles", + "ALL_STATUS": "Alles", + "ALL_STEP": "Alles", "ALL_WORKFLOW": "Alle Arbeitsabläufe", "ATTENDACELASTINVOICE": "Letzte Rechnung", "ATTENDACENEXTINVOICE": "Nächste Rechnung", @@ -362,7 +362,7 @@ "COMPANYCITY": "Stadt", "COMPANYCOUNTRY": "Land", "COMPANYDESC": "Beschreibung", - "COMPANYEMAIL": "E-Mail", + "COMPANYEMAIL": "Email", "COMPANYFAX": "Fax", "COMPANYNAME": "Unternehmen", "COMPANYNATION": "Staat", @@ -387,7 +387,7 @@ "DOSSIER_INFO": "Information", "ENDDATE": "Ablaufdatum", "FROM": "von", - "GRAPHINVOICES": "Diagramm der Rechnung", + "GRAPHINVOICES": "Diagramm der Rechnungsemission", "INASSET": "Kapital", "INVOICE": "RECHNUNG", "INVOICEDETAILS": "RECHNUNGS-DETAILS", @@ -415,13 +415,13 @@ "NEXTINVOICE": "Nächste Rechnung", "NOTES": "Notizen", "NO_PRODUCTINVOICE_AVAILABLE": "Kein Produkt verfügbar", - "NO_PRODUCTPRICELIST_AVAILABLE": "Keine Preislisten verfügbar", - "NO_PRODUCTPROFORMA_AVAILABLE": "Keine Pro-Forma verfügbar", + "NO_PRODUCTPRICELIST_AVAILABLE": "Keine Daten verfügbar", + "NO_PRODUCTPROFORMA_AVAILABLE": "Keine Daten verfügbar", "NUMBER": "Nummer", "OPENDATE": "Öffnungsdatum", "ORDER": "Bestellung", "ORDERCLIENTCODE": "Kundennummer", - "ORDERID": "Bestellnummer", + "ORDERID": "Bestellung ID ", "ORDERNOTES": "Notizen", "ORDERSTATUS": "Status", "ORDER_INFO": "Bestellung", @@ -500,12 +500,12 @@ "SELECT_WORKFLOWSTEPS": "Arbeitsablaufstatus auswählen", "STARTDATE": "Rechnungsdatum", "STATE": "Status", - "STEP": "Schritt", + "STEP": "Stufe", "SUBSCRIPTIONDETAIL": "Detail", "SUBSCRIPTIONNAME": "Abonnement", "SUBSCRIPTIONS": "KUNDENPLAN", "TAX": "MwSt", - "TO": "auf", + "TO": "Zu", "TOTALPAYMENTS": "Gesamtzahlungen", "UPDATED_AT": "Geändert am", "UPDATE_PRODUCT": "Produkt aktualisieren", @@ -522,7 +522,7 @@ "ENDING_DATE": "Enddatum", "ENDING_VALUE": "Endwert", "ENDS_WITH": "endet mit", - "EQUALS": "ist gleich", + "EQUALS": "gleich", "IS_AMONG": "ist unter", "IS_BETWEEN": "ist zwischen", "IS_GREATER_THAN": "ist größer als", @@ -548,7 +548,7 @@ "SELECT_QUEUE": "Warteschlange auswählen", "VIDAOOSESSION": "Videoanruf starten", "WHATSAPP": "WhatsApp Connector", - "WHATSAPP_INTERACTIONS": "Interaktionen per WhatsApp", + "WHATSAPP_INTERACTIONS": "WhatsApp-Interaktionen", "LAST_UPDATED": "Zuletzt aktualisiert", "MATCHING_FIELD": "Übereinstimmendes Feld", "MULTIPLE_CONTACTS_FOUND": "Mehrere Kontakte für Nummer gefunden", @@ -556,15 +556,15 @@ "SELECT_CONTACT": "Kontakt auswählen", "WHICH_ONE_TO_USE": "Welcher Eintrag soll verwendet werden?", "NO_WHATSAPP_ACCOUNTS_AVAILABLE": "Kein WhatsApp-Konto verfügbar", - "SECOND_LEVEL_DISPOSITION": "Qualifizierung Ebene 2", - "THIRD_LEVEL_DISPOSITION": "Qualifizierung Ebene 3", + "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": "Erstellt am", + "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 Internetverbindung prüfen.", "NO_RESULTS_AVAILABLE": "Keine Ergebnisse verfügbar", - "AVAILABLE": "Verfügbar", + "AVAILABLE": "Erhältlich", "CONFIRM": "Bestätigen Sie", "FILTERS": "Filter", "FILTER_CHAT_WEBSITES": "Chat-Websites filtern", diff --git a/public/app/main/apps/dashboards/i18n/nl.json b/public/app/main/apps/dashboards/i18n/nl.json index d0a7ac7..55e3cf9 100644 --- a/public/app/main/apps/dashboards/i18n/nl.json +++ b/public/app/main/apps/dashboards/i18n/nl.json @@ -2,48 +2,48 @@ "DASHBOARDS": { "HOME": "Home", "CHAT": "Chat", - "MAIL": "E-mail", + "MAIL": "Email", "SMS": "Sms", - "OPENCHANNEL": "Open Kanaal", + "OPENCHANNEL": "Open Channel", "FAX": "Fax", - "RATING": "Rating", + "RATING": "Waardering", "FEEDBACK": "Feedback", "SUBJECT": "Onderwerp", - "REFERER": "Referentie", + "REFERER": "Referer", "ACCOUNT": "Account", "WEBSITE": "Website", "AGENT": "Agent", "CREATED_AT": "Gemaakt op", "CLOSED_AT": "Gesloten", - "DISPOSITION": "Dispositie", + "DISPOSITION": "Afvoeren", "CONTACT": "Neem contact op met", "INTERACTION": "Interactie", "BROWSER_NAME": "Browsernaam", "BROWSER_VERSION": "Browserversie", "OS_NAME": "Naam besturingssysteem", "OS_VERSION": "Versie van besturingssysteem", - "DEVICE_MODEL": "Apparaat model", + "DEVICE_MODEL": "Apparaatmodel", "DEVICE_VENDOR": "Apparaat", - "DEVICE_TYPE": "Apparaat type", - "RECALLME": "Bel mij terug", - "DROP_RATE": "Wegvalpercentage", + "DEVICE_TYPE": "Apparaattype", + "RECALLME": "Recall Me", + "DROP_RATE": "Daalsnelheid", "DROPPED": "Weggevallen", - "DROPPED_TEXT": "Weggevallen wachtrij oproepen", + "DROPPED_TEXT": "Verbrede Wachtrij oproepen", "DETAIL": "Detail", "MOTION_BULL": "Motion Bull", "LIMITED": "Beperkt", - "LIMITED_TEXT": "Afkomst/limiet gesprekken afkomstig uit IVR-Campagnes", + "LIMITED_TEXT": "Campagnes afkomstige gesprekken/Limited", "DASHBOARDS": "Dashboards", "RECORDINGS": "Opnamen", - "TODAY_MOTION_BULL_STATS": "De Motion Bull stats. van vandaag", + "TODAY_MOTION_BULL_STATS": "Vandaag Motion Bull Stats", "ORIGINATED": "Oorsprong", - "ORIGINATED_TEXT": "Gesprekken afkomstig uit wachtrij", + "ORIGINATED_TEXT": "Wachtrij afkomstige gesprekken", "UPDATE": "Update", "MORE": "Meer", "MOTIONDIALER": "Motion Bull", - "DISPOSE": "Opruimen", + "DISPOSE": "Afvoeren", "QUEUES": "Wachtrijen", - "DIALER_CALL": "Dialer", + "DIALER_CALL": "Oproepen beller", "ELAPSED_TIME": "Verstreken tijd", "EDIT": "Bewerken", "MERGE": "Samenvoegen", @@ -72,62 +72,62 @@ "POSTALCODE": "Postcode", "CUSTOM_FIELDS": "Aangepaste velden", "GENERAL": "Algemeen", - "VOICE": "Telefonie", - "TODAY_IVR_CAMPAIGNS_STATS": "IVR-campagne Statistieken Van vandaag", - "TODAY_INBOUND_STATS": "Inkomende Statistieken (Wachtrij) Van Vandaag", - "TODAY_OUTBOUND_STATS": "Uitgaande Statistieken Van Vandaag ", - "WAITING": "Wachtend", - "TALKING": "In gesprek", + "VOICE": "Spraak", + "TODAY_IVR_CAMPAIGNS_STATS": "Vandaag Ivr campagnes Stats", + "TODAY_INBOUND_STATS": "Vandaag Inbound Stats", + "TODAY_OUTBOUND_STATS": "Vandaag Outbound Stats", + "WAITING": "Wachten", + "TALKING": "Spreken", "INBOUND_ANSWERED": "Beantwoord", "OUTBOUND_ANSWERED": "Beantwoord", "ABANDONED": "Verlaten", - "TOTAL_OFFERED": "Tot. aangeboden", - "AVG_HOLD_TIME": "Gem. wachttijd", - "INBOUND_ANSWER_RATE": "Antwoordpercentage", - "OUTBOUND_ANSWER_RATE": "Antwoordpercentage", - "ABANDON_RATE": "Verlatingspercentage", - "UNMANAGED": "Onbeheerd", + "TOTAL_OFFERED": "Totaal beschikbaar", + "AVG_HOLD_TIME": "Gemiddelde wachttijd", + "INBOUND_ANSWER_RATE": "Antwoord tarief", + "OUTBOUND_ANSWER_RATE": "Antwoord tarief", + "ABANDON_RATE": "Snelheid verlaten", + "UNMANAGED": "Onbeheerde", "TOTAL": "Totaal", "TOT_DURATION": "Totale duur", "AVG_DURATION": "Gemiddelde duur", "HELP": { "ORIGINATEDLIMITED": "Campagnes afkomstige gesprekken/Limited", - "DROPPED": "Het totale aantal weggevallen wachtrij oproepen, gezien alle gemaakte wachtrijen.", - "DROP_RATE": "Het wegvalpercentage van wachtrij oproepen", - "WAITING": "Het totale aantal wachtrij oproepen, gezien alle gemaakte wachtrijen", + "DROPPED": "Het totale aantal daalde wachtrij oproepen, gezien alle gemaakte wachtrijen.", + "DROP_RATE": "Om de terugvalsnelheid van de wachtrij oproepen", + "WAITING": "Het totale aantal Wachtrij oproepen, gezien alle gemaakte wachtrijen", "OUTBOUND_ANSWERED": "Het totale aantal voltooide uitgaande gesprekken", - "ABANDONED": "Het totale aantal verlaten wachtrij oproepen, gezien alle gemaakte wachtrijen. Oproepen die worden verlaten voor time-out en joinempty worden niet meegeteld bij deze waarde", - "TOTAL_OFFERED": "Het totale aantal aangeboden wachtrij oproepen (voltooide + verlaten). Gesprekken die eindigde in de IVR en niet in de wachtrij komen, worden niet meegeteld bij deze waarde", - "AVG_HOLD_TIME": "De gemiddelde wachttijd van de wachtrij, gemiddelde wachttijd van het gesprek voor het door een agent wordt beantwoord, gezien alle wachtrijen", - "OUTBOUND_ANSWER_RATE": "Het antwoordpercentage van van alle uitgaande oproepen", - "ABANDON_RATE": "Het verlatingspercentage van alle wachtrij oproepen", + "ABANDONED": "Het totale aantal verlaten oproepen wachtrij, gezien alle gemaakte wachtrijen. Merk op dat de oproepen die worden verlaten voor time-out en joinempty worden niet meegeteld bij deze waarde", + "TOTAL_OFFERED": "Het totale aantal oproepen wachtrij (voltooide verlaten). Merk op dat de gesprekken die eindigde in de IVR, zonder dat u in de wachtrij, worden niet meegeteld bij deze waarde", + "AVG_HOLD_TIME": "De gemiddelde wachtrij wachttijd, zijnde de gemiddelde tijd van het gesprek te wachten voor een agent wordt beantwoord, gezien alle wachtrijen", + "OUTBOUND_ANSWER_RATE": "Het antwoord van alle uitgaande oproepen", + "ABANDON_RATE": "De Snelheid verlaten van alle Oproepen wachtrij", "UNMANAGED": "Het totale aantal onbeheerde wachtrij oproepen, gezien alle gemaakte wachtrijen. Het bevat de oproepen die worden verlaten voor time-out, joinempty, leavewhenempty en exitwithkey", "TOTAL": "Het totale aantal uitgaande gesprekken", "TOT_DURATION": "De totale duur van alle uitgaande oproepen", "AVG_DURATION": "De gemiddelde duur van alle uitgaande oproepen", - "ORIGINATED": "Het totale aantal gesprekken uit de wachtrij", - "ABANDONED_RATE": "De verlatingsperentage van alle interacties", - "AVG_MANAGED_TIME": "De gemiddelde interactie tijd, de gemiddelde tijd doorgebracht tijdens een gesprek", + "ORIGINATED": "Het totale aantal gesprekken dat uit de wachtrij campagnes", + "ABANDONED_RATE": "De vertrekfrequentie van alle interacties", + "AVG_MANAGED_TIME": "De gemiddelde interactie Beheerde tijd, namelijk de gemiddelde tijd doorgebracht tijdens een gesprek", "MANAGED": "Het totale aantal voltooide interacties", - "MANAGED_RATE": "De beheerde afhandelingssnelheid van alle interacties", + "MANAGED_RATE": "De beheerde snelheid van alle interacties", "OPENED": "Het totale aantal actieve interacties", - "UNMANAGED_RATE": "De onbeheerde afhandelingssnelheid van alle interacties", - "VOICE_ABANDONED": "Het totale aantal verlaten wachtrij oproepen, rekening houdend met alle bestaande wachtrijen. Oproepen die worden verlaten wegens time-out en joinempty niet worden overwogen", - "VOICE_ANSWERED": "Het totale aantal voltooide wachtrij oproepen, voor alle bestaande wachtrijen", - "VOICE_ANSWER_RATE": "Het antwoordpercentage van alle wachtrij oproepen", - "VOICE_AVG_HOLD_TIME": "De gemiddelde wachttijd voor wachtrij oproepen, de gemiddelde besteden tijd bij het wachten op een agent, voor alle bestaande wachtrijen", - "VOICE_AVG_TALK_TIME": "De gemiddelde gespreksduur van wachtrij oproepen, namelijk de gemiddelde tijd die tijdens het gesprek is doorgebracht, voor alle bestaande wachtrijen", - "VOICE_TALKING": "Het totale aantal actieve wachtrij oproepen voor alle bestaande wachtrijen", - "VOICE_TOTAL_OFFERED": "Het totale aantal wachtrijgesprekken (voltooid + verlaten). Oproepen die binnenkomen in een IVR en niet uitkomen in een wachtrij, niet zullen worden beschouwd", - "VOICE_UNMANAGED": "Het totale aantal onbeheerde wachtrij oproepen, voor alle bestaande wachtrijen. Het bevat de oproepen die worden verlaten wegens time-out, joinempty, leavewhenempty en exitwithkey (zie asterisk-document voor meer informatie)", - "VOICE_WAITING": "Het totale aantal wachtende wachtrij oproepen, voor alle bestaande wachtrijen", + "UNMANAGED_RATE": "De onbeheerde snelheid van alle interacties", + "VOICE_ABANDONED": "Het totale aantal verlaten wachtrij-oproepen, rekening houdend met alle bestaande wachtrijen. Merk op dat de oproepen die worden verlaten wegens time-out en joinempty niet worden overwogen", + "VOICE_ANSWERED": "Het totale aantal voltooide wachtrij-oproepen, voor alle bestaande wachtrijen", + "VOICE_ANSWER_RATE": "Het antwoordpercentage van alle wachtrijsoproepen", + "VOICE_AVG_HOLD_TIME": "De wachttijd van de gemiddelde wachtrij, namelijk de gemiddelde tijd besteed aan het wachten op een agent om te antwoorden, voor alle bestaande wachtrijen", + "VOICE_AVG_TALK_TIME": "De gemiddelde wachttijd voor de wachtrij, namelijk de gemiddelde tijd die tijdens het gesprek is doorgebracht, voor alle bestaande wachtrijen", + "VOICE_TALKING": "Het totale aantal actieve wachtrij-oproepen voor alle bestaande wachtrijen", + "VOICE_TOTAL_OFFERED": "Het totale aantal wachtrijgesprekken (voltooid + verlaten). Merk op dat de oproepen die binnenkomen in een IVR en niet in een wachtrij, niet zullen worden beschouwd", + "VOICE_UNMANAGED": "Het totale aantal onbeheerde wachtrij-oproepen, voor alle bestaande wachtrijen. Het bevat de oproepen die worden verlaten wegens time-out, joinempty, leavewanneerempty en exitwithkey (zie asterisk-document voor meer informatie)", + "VOICE_WAITING": "Het totale aantal wachtende wachtrij-oproepen, voor alle bestaande wachtrijen", "MANDATORY_DISPOSITION_ENABLED": "Verplichte plaatsing ingeschakeld voor dit account", "EXACT_MATCH_FILTER": "Zoek naar een exacte overeenkomst", "LIKE_FILTER": "Zoek naar het opgegeven patroon" }, "ERRORS": { - "FIRSTNAME_REQUIRED": "Verplicht veld", - "PHONE_REQUIRED": "Verplicht veld", + "FIRSTNAME_REQUIRED": "De Voornaam is verplicht", + "PHONE_REQUIRED": "Het telefoonnummer is verplicht", "DISPOSITION_REQUIRED": "Verplicht veld", "AGENT_REQUIRED": "Verplicht veld", "QUEUE_REQUIRED": "Verplicht veld", @@ -140,27 +140,27 @@ "ADD": "Toevoegen", "CONTACTMANAGER": "Contact Manager", "DASHBOARD": "Dashboard", - "EDIT_CONTACT": "Contactpersoon Bewerken", + "EDIT_CONTACT": "Contactpersoon bewerken", "EMAIL": "E-mail", - "FULLNAME": "Volledige naam", + "FULLNAME": "Fullname", "LIST": "Lijst", - "NEW_CONTACT": "Nieuw contactpersoon", + "NEW_CONTACT": "Nieuwe contactpersoon", "PHONE": "Telefoon", "SAVE": "Opslaan", - "INBOUND_WAITING_CALLS": "Inkomende oproepen in wachtstand", + "INBOUND_WAITING_CALLS": "Inkomende gesprekken in wachtstand", "CONTACTS": "Contactpersonen", "MYCONTACTS": "Mijn contactpersonen", - "ADD_CONTACT": "Contactpersoon Toevoegen", - "RELOAD": "Herladen", + "ADD_CONTACT": "Contactpersoon toevoegen", + "RELOAD": "Reload", "WAITING_TEXT": "Wachtrij oproepen", "TALKING_TEXT": "Actieve Wachtrij oproepen", - "INBOUND_ANSWERED_TEXT": "Beantwoorde wachtrij oproepen", + "INBOUND_ANSWERED_TEXT": "Beantwoord oproepen wachtrij", "ABANDONED_TEXT": "Wachtrij verlaten oproepen", - "DROP_RATE_TEXT": "Oproepen wachtrij wegvalsnelheid", + "DROP_RATE_TEXT": "Oproepen wachtrij daalsnelheid", "TOTAL_OFFERED_TEXT": "Totale gesprekken", "AVG_HOLD_TIME_TEXT": "Wachtrij gesprekken - Gem. tijd in wacht", "AVG_TALK_TIME_TEXT": "Wachtrij Spreektijd gesprekken", - "INBOUND_ANSWER_RATE_TEXT": "Antwoordpercentage wachtrij oproepen", + "INBOUND_ANSWER_RATE_TEXT": "Wachtrij oproepen beantwoorden tarief", "UNMANAGED_TEXT": "Onbeheerde Wachtrij oproepen", "TOTAL_TEXT": "Totaal uitgaande gesprekken", "OUTBOUND_ANSWERED_TEXT": "Uitgaande beantwoorde gesprekken", @@ -172,8 +172,8 @@ "OF": "Van", "REPLY_PLACEHOLDER": "Typ en druk op enter om een bericht te verzenden.", "CONTACT_INFO": "Contact Info", - "CLOSE_AND_DISPOSE": "Afronden", - "DISPOSITIONS": "Disposities", + "CLOSE_AND_DISPOSE": "Dicht en afvoeren", + "DISPOSITIONS": "Dispositions", "CLOSE_WITHOUT_DISPOSE": "Sluiten zonder lever", "ACCEPT": "Accepteren", "REJECT": "Afwijzen", @@ -187,14 +187,14 @@ "OPENED": "Open", "FILTER": "Filter", "SELECT_STATUS": "Selecteer Status.", - "SELECT_ACCOUNT": "Selecteren Account", - "SELECT_WEBSITE": "Selecteer Website", + "SELECT_ACCOUNT": "Account selecteren", + "SELECT_WEBSITE": "Selecteer website", "ALL": "Alle", "INTERACTIONS": "Interacties", "STARTEDAT": "Gestart op", "STATUS": "Status", "OPEN": "Open", - "SHOW": "Weergeven", + "SHOW": "Toon", "ME": "Me", "NOT_ASSIGNED": "Niet toegewezen", "UNKNOWN": "Onbekend", @@ -202,44 +202,44 @@ "LAST_MESSAGE": "Laatste bericht", "USER": "Gebruiker", "TAGS": "Tags", - "SELECT_TAG": "Selecteer Label", + "SELECT_TAG": "Selecteer label", "TYPE": "Type", "SOURCE": "Bron", "DESTINATION": "Bestemming", "CALLERID": "Beller-ID", "END_AT": "Eindigt op", "DURATION": "Duur", - "SHOW_DETAILS": "Details Weergeven", - "HIDE_DETAILS": "Details Verbergen", + "SHOW_DETAILS": "Details weergeven", + "HIDE_DETAILS": "Details verbergen", "EXTERNAL_URL": "Externe link", "SET_AS": "Instellen als", "PENDING": "In afwachting", - "CANNED_ANSWER_NOT_FOUND": "Geen standaard antwoorden gevonden", - "CANNED_ANSWER_SEARCH": "Voer een tekst in om te zoeken in een standaard antwoord", + "CANNED_ANSWER_NOT_FOUND": "Geen ingeblikte antwoorden gevonden", + "CANNED_ANSWER_SEARCH": "Voer een tekst te zoeken in een ingeblikt antwoord", "NO_MAIL_ACCOUNTS_AVAILABLE": "Geen e-mailaccounts beschikbaar", "NO_FAX_ACCOUNTS_AVAILABLE": "Geen Fax rekeningen beschikbaar", "NO_SMS_ACCOUNTS_AVAILABLE": "Geen SMS Accounts beschikbaar", - "FILTER_VOICE_QUEUES": "Filter voice wachtrijen", + "FILTER_VOICE_QUEUES": "Filter Voice Wachtrijen", "LOADING_INTERACTION": "We laden de interactie ...", - "JANUARY": "Januari", - "FEBRUARY": "Februari", - "MARCH": "Maart", - "APRIL": "April", - "MAY": "Mei", - "JUNE": "Juni", - "JULY": "Juli", - "AUGUST": "Augustus", - "SEPTEMBER": "September", - "OCTOBER": "Oktober", - "NOVEMBER": "November", - "DECEMBER": "December", - "MON": "Ma", - "TUE": "Di", - "WED": "Wo", - "THU": "Do", - "FRI": "Vr", + "JANUARY": "januari-", + "FEBRUARY": "februari", + "MARCH": "maart", + "APRIL": "april", + "MAY": "mei", + "JUNE": "juni-", + "JULY": "juli-", + "AUGUST": "augustus", + "SEPTEMBER": "september", + "OCTOBER": "oktober", + "NOVEMBER": "november", + "DECEMBER": "december", + "MON": "ma", + "TUE": "Din", + "WED": "trouwen", + "THU": "Don", + "FRI": "vr", "SAT": "Za", - "SUN": "Zo", + "SUN": "Zon", "DELETE": "Verwijder", "LAST_3_DAYS": "Laatste 3 dagen", "LAST_YEAR": "Afgelopen jaar", @@ -251,19 +251,19 @@ "YESTERDAY": "Gisteren", "TODAY": "Vandaag", "SELECT_DATE": "Selecteer Startdatum", - "SELECT_DATE_RANGE": "Selecteer Datumbereik", - "CLEAR": "Leegmaken", - "CALL_NUMBER": "Telefoonnummer", - "TRANSFER_NUMBER": "Overdrachtsnummer", - "CALL_SAVED": "Gesprek correct opgeslagen", - "CALL_DISPOSED": "Gesprec correct afgesloten", - "CHANNEL_WAITING_TEXT": "Wachtende interacties", + "SELECT_DATE_RANGE": "Selecteer datumbereik", + "CLEAR": "Duidelijk", + "CALL_NUMBER": "telefoontje", + "TRANSFER_NUMBER": "Overdracht", + "CALL_SAVED": "Bel correct opgeslagen", + "CALL_DISPOSED": "Roep op de juiste manier", + "CHANNEL_WAITING_TEXT": "Waiting Queue Interactions", "CHANNEL_QUEUE": "Wachtrij", "CHANNEL_FROM": "Van", - "MARK_AS_UNREAD": "Markeren als Ongelezen", + "MARK_AS_UNREAD": "markeren als ongelezen", "SELECT_AGENT": "Selecteer Agent", "READ": "Lezen", - "SELECT_READ_UNREAD": "Selecteer gelezen / ongelezen", + "SELECT_READ_UNREAD": "Selecteer Lezen / ongelezen", "SELECT_SUBSTATUS": "Selecteer Substatus", "UNREAD": "Ongelezen", "ABANDONAT": "Verlaten", @@ -271,17 +271,17 @@ "FREE": "Gratis", "LASTASSIGNEDTO": "Laatst toegewezen aan", "QUEUE": "Wachtrij", - "QUEUECALLEREXITAT": "Beller heeft wachtrij verlaten om", + "QUEUECALLEREXITAT": "Liet vallen", "QUEUECALLEREXITREASON": "Reden", "RESERVED": "Gereserveerd", - "SELECT_CAMPAIGN": "Selecteer een Wachtrij", + "SELECT_CAMPAIGN": "Selecteer een wachtrij", "ASSIGNTO": "Toewijzen", - "CLICKRELOAD": "Nieuwe verlaten oproepenu0021 Herladen alstublieft", + "CLICKRELOAD": "Nieuwe achtergelaten oproepen! Herladen alstublieft", "NOTAVAILABLE": "Niet beschikbaar", "CURRENTLY_IN_USE_BY": "Momenteel in gebruik door", "CUSTOMER_JOURNEY": "Customer Journey", "NO_DATA_AVAILABLE": "Geen gegevens beschikbaar", - "AGENTS": "Agenten", + "AGENTS": "agenten", "TRANSFER": "Overdracht", "NO_DISPOSITION_SET": "Geen dispositie ingesteld", "ABANDONED_RATE": "Verlaten tarief", @@ -326,25 +326,25 @@ "INTERACTION_CLOSED_DISPOSED": "Interactie correct gesloten en weggegooid", "INTERACTION_DISPOSED": "Interactie correct verwijderd", "ASSIGNED_TO_OTHERS": "Toegewezen aan anderen", - "SELECT_ALL": "Selecteer Alles", + "SELECT_ALL": "Selecteer alles", "CHAT_INTERACTIONS": "Chat interacties", "FAX_INTERACTIONS": "Fax interacties", "ID": "ID", "MAIL_INTERACTIONS": "E-mail interacties", "OPENCHANNEL_INTERACTIONS": "Open kanaal interacties", "SMS_INTERACTIONS": "SMS-interacties", - "CANCEL": "Annuleren", + "CANCEL": "annuleren", "DRAFT": "Droogte", "DRAFT_SAVE_WARNING_MESSAGE": "Er is al een concept opgeslagen voor deze interactie. Weet je zeker dat je het wilt overschrijven?", "DRAFT_SAVE_WARNING_TITLE": "Bestaand concept overschrijven?", - "OVERWRITE": "Overschrijven", + "OVERWRITE": "overschrijven", "SAVE_AS_DRAFT": "Opslaan als concept", "UNTITLED": "Ongetiteld", - "UPDATE_DRAFT": "Concept Bijwerken", + "UPDATE_DRAFT": "Concept bijwerken", "NO_AVAILABLE_INTERACTION": "Geen beschikbare interactie", "ACCOUNTINGDOC": "boekhouding", - "ADD_PRODUCTPRICELIST": "Product Toevoegen", - "AGENTFULLNAME": "Agent", + "ADD_PRODUCTPRICELIST": "PRODUCT TOEVOEGEN", + "AGENTFULLNAME": "Middel", "ALL_COMPANIES": "Alle bedrijven", "ALL_PRODUCTS": "Allemaal", "ALL_STATUS": "Allemaal", @@ -375,7 +375,7 @@ "CREDITNOTE": "KREDIET NOTA", "CREDITNOTEDETAILS": "Detail creditnota", "CREDITNOTE_INFO": "Credit Note", - "DELETE_PRODUCT": "Product Verwijderen", + "DELETE_PRODUCT": "Product verwijderen", "DEPOSIT": "STORTING", "DETAILS": "Details", "DISCOUNT": "Korting", @@ -489,26 +489,26 @@ "REQUESTNAME": "Verzoek naam", "REQUESTNOTES": "Verzoek om opmerkingen", "REQUEST_INFO": "Verzoek", - "SELECT_COMPANY": "Selecteer Bedrijf", - "SELECT_PERIOD": "Selecteer Bereik", + "SELECT_COMPANY": "Selecteer bedrijf", + "SELECT_PERIOD": "Selecteer bereik", "SELECT_PERIOD_CREATION": "Selecteer Aanmaakdatum", "SELECT_PERIOD_EXPIRE": "Selecteer Vervaldatum", - "SELECT_PERIOD_START": "Selecteer een Datum", - "SELECT_PRODUCT": "Selecteer Product", - "SELECT_PRODUCTTYPE": "Selecteer Type", - "SELECT_WORKFLOW": "Selecteer Workflow", - "SELECT_WORKFLOWSTEPS": "Selecteer Workflow stappen", + "SELECT_PERIOD_START": "Selecteer een datum", + "SELECT_PRODUCT": "Selecteer product", + "SELECT_PRODUCTTYPE": "Selecteer type", + "SELECT_WORKFLOW": "Selecteer workflow", + "SELECT_WORKFLOWSTEPS": "Selecteer Werkstroomstatus", "STARTDATE": "Factuur datum", "STATE": "Staat", "STEP": "Stap", "SUBSCRIPTIONDETAIL": "Detail", "SUBSCRIPTIONNAME": "Abonnement", - "SUBSCRIPTIONS": "Abonnementen", + "SUBSCRIPTIONS": "KLANTenschema", "TAX": "Belasting", "TO": "Naar", "TOTALPAYMENTS": "Totaal betalingen", "UPDATED_AT": "Gewijzigd op", - "UPDATE_PRODUCT": "Product Bijwerken", + "UPDATE_PRODUCT": "Product bijwerken", "WORKFLOW": "Selecteer workflow", "YEARS": "jaren", "CUSTOMER_IP": "Oorspronkelijk IP-adres", @@ -533,9 +533,9 @@ "IS_NOT_EQUAL": "Is niet gelijk aan", "MEET_ALL_CONDITIONS": "Voldoe aan alle voorwaarden", "MEET_ANY_CONDITIONS": "Voldoe aan minstens één voorwaarde", - "NEW_CONDITION": "nieuwe voorwaarden", - "SELECT_FIELD": "Selecteer Veld", - "SELECT_OPERATOR": "Selecteer Operator", + "NEW_CONDITION": "nieuwe conditie", + "SELECT_FIELD": "Selecteer veld", + "SELECT_OPERATOR": "Selecteer operator", "STARTING_DATE": "Begin datum", "STARTING_VALUE": "Startwaarde", "STARTS_WITH": "Begint met", @@ -545,7 +545,7 @@ "CHOOSE": "Kiezen", "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download zonder bijlagen", "DOWNLOAD_WITH_ATTACHMENTS": "Download met bijlagen", - "SELECT_QUEUE": "Selecteer een Wachtrij", + "SELECT_QUEUE": "Selecteer een wachtrij", "VIDAOOSESSION": "Start videogesprek", "WHATSAPP": "WhatsApp-aansluiting", "WHATSAPP_INTERACTIONS": "WhatsApp Connector-interacties", @@ -553,20 +553,20 @@ "MATCHING_FIELD": "Overeenkomend veld", "MULTIPLE_CONTACTS_FOUND": "Meerdere contacten gevonden voor nummer", "SELECT": "Selecteer", - "SELECT_CONTACT": "Selecteer Contact", + "SELECT_CONTACT": "Selecteer contact", "WHICH_ONE_TO_USE": "Welke wil je gebruiken?", "NO_WHATSAPP_ACCOUNTS_AVAILABLE": "Geen Whatsapp-account beschikbaar", "SECOND_LEVEL_DISPOSITION": "Tweede niveau dispositie", "THIRD_LEVEL_DISPOSITION": "Dispositie op het derde niveau", - "LICENSE_EXPIRE_REMAINING_DAYS": "Uw licentie verloopt bijnau0021 Neem contact op met uw beheerder", + "LICENSE_EXPIRE_REMAINING_DAYS": "Uw licentie verloopt bijna! Neem contact op met uw beheerder", "CREATEDAT": "Gemaakt bij", "ELAPSED_ANSWERED": "Verstreken tijd sinds het gesprek is gestart", "ELAPSED_DISPOSED": "Verstreken tijd sinds het gesprek is beëindigd", "LOST_CONNECTION": "Problemen met netwerkconnectiviteit ervaren. Controleer uw internetverbinding.", "NO_RESULTS_AVAILABLE": "Geen resultaten beschikbaar", - "AUTOCLOSE": "Het contacttabblad automatisch sluiten na verwijdering", + "AUTOCLOSE": "Sluit het contacttabblad automatisch na verwijdering", "AGENT_PRESENCE": "Aanwezigheid van agent", - "SELECT_TEAM": "Selecteer Team", + "SELECT_TEAM": "Selecteer team", "AVAILABLE": "Beschikbaar", "CONFIRM": "Bevestigen", "FILTERS": "Filters", diff --git a/public/app/main/apps/fax/i18n/de.json b/public/app/main/apps/fax/i18n/de.json index d1303ac..e63ae66 100644 --- a/public/app/main/apps/fax/i18n/de.json +++ b/public/app/main/apps/fax/i18n/de.json @@ -1,88 +1,88 @@ { "FAX": { - "TEAMADD_FAXQUEUE": "Team zur Warteschlange hinzufügen", - "AGENTADD_FAXQUEUE": "Agenten zur Warteschlange hinzufügen", + "TEAMADD_FAXQUEUE": "Team zur Faxwarteschlange hinzufügen", + "AGENTADD_FAXQUEUE": "Agent Fax Warteschlange hinzufügen", "NAME": "Name", - "FAXQUEUES": "Fax-Warteschlangen", - "SEARCH_FOR_ANYONE": "Suche", + "FAXQUEUES": "Fax Warteschlangen", + "SEARCH_FOR_ANYONE": "Suche für Jedermann", "ERRORS": { - "NAME_REQUIRED": "Name erforderlich", - "AGENT_TIMEOUT_REQUIRED": "Zeitüberschreitung Agent erforderlich", - "MOTIONADDRESS_REQUIRED": "Adresse erforderlich", - "MOTIONADDRESS_MUST_VALID_URL": "Ungültiges Format Adresse", - "LOCALSTATIONID_REQUIRED": "Lokale Nebenstelle erforderlich", - "MODEM_REQUIRED": "Modem/Fax-Adapter erforderlich", - "GATEWAY_REQUIRED": "Gateway erforderlich", - "FAXDETECT_REQUIRED": "FAX-Erkennung erforderlich", - "T38TIMEOUT_REQUIRED": "T.38-Timeout erforderlich", - "TIMEOUT_REQUIRED": "Zeitüberschreitung erforderlich", - "HEADERINFO_REQUIRED": "Kopfzeile erforderlich", - "TRUNK_REQUIRED": "Trunk erforderlich", - "LIST_REQUIRED": "Liste erforderlich", - "KEY_MAX_LENGTH": "Wert darf nicht länger als {{max}} Zeichen sein", - "KEY_REQUIRED": "Schlüssel erforderlich", - "AGENT_REQUIRED": "Agent erforderlich", - "QUEUE_REQUIRED": "Warteschlange erforderlich", - "TRUEPRIORITY_REQUIRED": "Priorität bei zutreffender Bedingung erforderlich", - "FALSEPRIORITY_REQUIRED": "Priorität bei nicht zutreffender Bedingung erforderlich", - "CONDITION_REQUIRED": "Bedingung erforderlich", - "PRIORITY_REQUIRED": "Priorität erforderlich", - "DISPOSITION_REQUIRED": "Qualifizierung erforderlich", - "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Priorität muss größer oder gleich sein als", - "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Priorität bei Bedingung erfüllt muss größer oder gleich sein als", - "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Priorität bei Bedingung nicht erfüllt muss größer oder gleich sein als", - "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung muss größer oder gleich sein als", - "TEXT_MAX_LENGTH": "Wert darf nicht länger als {{max}} Zeichen sein", - "TEXT_REQUIRED": "Text erforderlich", - "VALUE_REQUIRED": "Wert erforderlich", - "COMMAND_REQUIRED": "Eingabe erforderlich", - "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", - "NAME_MUST_VALID_PATTERN": "Ungültiges Format Name", - "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung muss kleiner oder gleich sein als", - "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung Agent 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": "Auf zugewiesenen Agenten warten erforderlich", - "TAG_REQUIRED": "Tag erforderlich", - "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung muss größer oder gleich sein als", - "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung muss kleiner oder gleich sein als", - "AGENTTRANSFERTIMEOUT_REQUIRED": "Zeitüberschreitung Agententransfer erforderlich", - "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung muss größer oder gleich sein als", - "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung muss kleiner oder gleich sein als", - "QUEUETRANSFERTIMEOUT_REQUIRED": "Zeitüberschreitung Warteschlangentransfer erforderlich", - "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "PausenID während Qualifizierung 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", + "LOCALSTATIONID_REQUIRED": "Die lokale Station-ID ist erforderlich", + "MODEM_REQUIRED": "Das Modem erforderlich.", + "GATEWAY_REQUIRED": "Das Gateway ist erforderlich", + "FAXDETECT_REQUIRED": "Die FAX Erkennung erforderlich ist", + "T38TIMEOUT_REQUIRED": "Die T.38-Timeout ist erforderlich", + "TIMEOUT_REQUIRED": "Der Timeout ist erforderlich", + "HEADERINFO_REQUIRED": "Die Information in der Kopfzeile sind erforderlich", + "TRUNK_REQUIRED": "Der Stamm ist erforderlich", + "LIST_REQUIRED": "Die Liste ist erforderlich", + "KEY_MAX_LENGTH": "Schlüssel muss eine maximale Länge von {{max}}", + "KEY_REQUIRED": "Der Schlüssel ist erforderlich", + "AGENT_REQUIRED": "Pflichtfeld", + "QUEUE_REQUIRED": "Pflichtfeld", + "TRUEPRIORITY_REQUIRED": "Pflichtfeld", + "FALSEPRIORITY_REQUIRED": "Pflichtfeld", + "CONDITION_REQUIRED": "Pflichtfeld", + "PRIORITY_REQUIRED": "Pflichtfeld", + "DISPOSITION_REQUIRED": "Pflichtfeld", + "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 als oder gleich", + "TEXT_MAX_LENGTH": "Der Wert muss eine maximale Länge von {{max}} haben", + "TEXT_REQUIRED": "Pflichtfeld", + "VALUE_REQUIRED": "Pflichtfeld", + "COMMAND_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", + "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_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_REQUIRED": "Pflichtfeld", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Sie sollten einen Pausenstatus angeben, wenn Sie eine Zwangsdisposition haben" }, - "STRATEGY": "Verteilungsstrategie", - "AGENT_TIMEOUT": "Zeitüberschreitung Agent", + "STRATEGY": "Strategie", + "AGENT_TIMEOUT": "Agent Timeout", "DESCRIPTION": "Beschreibung", - "ADD_FAXQUEUE": "Fax-Warteschlange hinzufügen", - "EDIT_FAXQUEUE": "Fax-Warteschlange bearbeiten", - "DELETE_FAXQUEUE": "Fax-Warteschlange löschen", + "ADD_FAXQUEUE": "Warteschlange hinzufügen Fax", + "EDIT_FAXQUEUE": "Bearbeiten Fax Warteschlange", + "DELETE_FAXQUEUE": "Fax Löschen der Warteschlange", "CREATED_AT": "Erstellt am", "SAVE": "Speichern", "SETTINGS": "Einstellungen", "GENERAL": "Allgemein", - "FAXACCOUNTS": "Fax-Konten", + "FAXACCOUNTS": "Fax Konten", "MOTIONADDRESS": "Motion Adresse", - "ADD_FAXACCOUNT": "Fax-Konto hinzufügen", - "EDIT_FAXACCOUNT": "Fax-Konto bearbeiten", - "DELETE_FAXACCOUNT": "Fax-Konto löschen", - "DISPOSITIONS": "Bedingungen", + "ADD_FAXACCOUNT": "Fax Konto hinzufügen", + "EDIT_FAXACCOUNT": "Fax Konto bearbeiten", + "DELETE_FAXACCOUNT": "Fax Konto löschen.", + "DISPOSITIONS": "Bestimmungen", "WEBHOOKS": "WebHooks", - "ACTIONS": "Routing", + "ACTIONS": "Aktionen", "LIST": "Liste", "FIDELITY": "Treue", "ACCEPT": "Akzeptieren", - "ACCEPTMETHOD": "Methode akzeptieren", + "ACCEPTMETHOD": "Die Methode", "ACCEPTURL": "URL akzeptieren", "REJECT": "Ablehnen", "REJECTMETHOD": "Methode ablehnen", "REJECTURL": "URL ablehnen", - "CLOSE": "Schließen und Qualifizieren", - "CLOSEMETHOD": "Methode schließen", - "CLOSEURL": "URL schließen", - "TRUNK": "SIP-Trunk", - "LOCALSTATIONID": "ID lokale Nebenstelle", + "CLOSE": "In der Nähe", + "CLOSEMETHOD": "In der Nähe Methode", + "CLOSEURL": "Der URL", + "TRUNK": "Amtsleitung", + "LOCALSTATIONID": "Lokale Station Identifier", "HELP": { "LOCALSTATIONID": "Lokale Station Identifier (Telefonnummer).", "HEADERINFO": "Ausgehende Faxkopfzeile.", @@ -94,10 +94,10 @@ "MINRATE": "Minimale Übertragungsrate eingestellt, bevor das Getriebe. Mögliche Werte sind: 2400, 4800, 7200, 9600, 12000 oder 14400.", "MAXRATE": "Maximale Übertragungsrate eingestellt, bevor das Getriebe. Mögliche Werte sind: 2400, 4800, 7200, 9600, 12000 oder 14400.", "NAME": "Nur Zahlen, Buchstaben und Sonderzeichen (._) werden unterstützt.", - "MANDATORYDISPOSITION": "Qualifizierung erforderlich", - "MANDATORYDISPOSITIONPAUSEID": "Pausenstatus während der Qualifizierung" + "MANDATORYDISPOSITION": "Zwingende Disposition", + "MANDATORYDISPOSITIONPAUSEID": "Status für Zwangsdisposition anhalten" }, - "ADVANCED": "Erweitert", + "ADVANCED": "Erweiterte", "ECM": "ECM", "MINRATE": "Min. Geschwindigkeit", "MAXRATE": "Max. Geschwindigkeit", @@ -105,157 +105,157 @@ "GATEWAY": "Gateway", "FAXDETECT": "Fax Erkennung", "T38TIMEOUT": "T.38-Timeout", - "SIP": "SIP", + "SIP": "Technologie", "HEADERINFO": "Header-info", - "SELECTED": "Ausgewählt", - "SELECT_ALL": "Alles auswählen", - "SELECT_NONE": "Nichts auswählen", + "SELECTED": "Ausgewählte", + "SELECT_ALL": "Alle auswählen", + "SELECT_NONE": "Wählen Sie \"Keine\"", "BACK": "Zurück", "FAX": "Fax", - "ID": "ID", - "TIMEOUT": "Zeitüberschreitung", - "FAXDISPOSITIONS": "Qualifizierung", - "NO_FAXDISPOSITION_AVAILABLE": "Keine Qualifizierung verfügbar", - "NEW_FAXDISPOSITION": "Neue Qualifizierung", - "ADD_FAXDISPOSITION": "Qualifizierung hinzufügen", - "EDIT_FAXDISPOSITION": "Qualifizierung bearbeiten", - "DELETE_FAXDISPOSITION": "Qualifizierung löschen", + "ID": "Id", + "TIMEOUT": "Timeout", + "FAXDISPOSITIONS": "Fax Disposition", + "NO_FAXDISPOSITION_AVAILABLE": "Kein Fax Dispositionen verfügbar", + "NEW_FAXDISPOSITION": "Neue Fax Disposition", + "ADD_FAXDISPOSITION": "Fax Disposition hinzufügen", + "EDIT_FAXDISPOSITION": "Fax Disposition bearbeiten", + "DELETE_FAXDISPOSITION": "Fax Disposition löschen", "NEW_FAXQUEUE": "Neue Warteschlange", - "NEW_FAXACCOUNT": "Neues Fax-Konto", - "NO_AVAILABLE_INFO": "Keine Informationen verfügbar", - "ALL_TEAMS": "Alle Teams", + "NEW_FAXACCOUNT": "Neue Fax Konto", + "NO_AVAILABLE_INFO": "Keine verfügbaren Info", + "ALL_TEAMS": "Alle Mannschaften", "SELECTED_TEAMS": "Ausgewählte Teams", "PAGE": "Seite", "ROWSPERPAGE": "Zeilen pro Seite", - "OF": "von", + "OF": "Von", "DELETE": "Löschen", "KEY": "Schlüssel", "ALL_AGENTS": "Alle Agenten", "SELECTED_AGENTS": "Ausgewählte Agenten", "FILTER": "Filter", "SELECT_STATUS": "Status auswählen", - "ALL": "Alles", + "ALL": "Alle", "CLOSED": "Geschlossen", - "OPENED": "Offen", + "OPENED": "Geöffnet", "SELECT_ACCOUNT": "Konto auswählen", - "INTERACTIONS": "Interaktionen", + "INTERACTIONS": "Wechselwirkungen", "CONTACT": "Kontakt", "STARTEDAT": "Gestartet am", "STATUS": "Status", "ACCOUNT": "Konto", - "GOTO_FAXACCOUNT": "Direkt zur Echtzeit-Warteschlange", + "GOTO_FAXACCOUNT": "In Echtzeit, Faxgerät", "ACCOUNTS": "Konten", - "GOTOREALTIME_FAXACCOUNT": "Direkt zur Echtzeitansicht Fax-Konten", + "GOTOREALTIME_FAXACCOUNT": "In Echtzeit, Faxgerät", "TRUNK_STATUS": "Trunk Status", - "TRUNKS": "SIP-Trunks", + "TRUNKS": "Amtsleitungen", "REGISTRY": "Registrierung", - "NO_REGISTRY": "Nicht registriert", + "NO_REGISTRY": "Keine Registry", "PAUSE": "Pause", - "INFO": "Informationen", - "FULLNAME": "Vollständiger Name", - "INTERNAL": "Intern", - "PHONE_STATE": "Statis Nebenstelle", - "PHONE_STATUS": "SIP-Status Nebenstelle", + "INFO": "Info", + "FULLNAME": "Fullname", + "INTERNAL": "Interne", + "PHONE_STATE": "Telefonstatus", + "PHONE_STATUS": "Telefonstatus", "LOGOUT": "An-/Abmelden", - "DEFAULT_PAUSE": "Standardpause", - "AGENTADD_QUEUE": "Agent zur Warteschlange hinzufügen", - "AGENTSADD_QUEUE": "Agenten zur Warteschlange hinzufügen", - "UNPAUSE": "Pause abbrechen", + "DEFAULT_PAUSE": "Standard Pause", + "AGENTADD_QUEUE": "Agent Fax Warteschlange hinzufügen", + "AGENTSADD_QUEUE": "Agenten zu Fax Warteschlange hinzufügen", + "UNPAUSE": "Pause", "AGENTS": "Agenten", "QUEUES": "Warteschlangen", "LOGGED_IN": "Angemeldet", - "PAUSED": "in Pause", + "PAUSED": "Angehalten", "READY": "Bereit", "WAITING": "Warten", "PRIORITY": "Priorität", - "CONDITION": "Bedingung", - "TRUEPRIORITY": "Priorität, wenn erfüllt (true)", - "FALSEPRIORITY": "Priorität, wenn nicht erfüllt (false)", + "CONDITION": "Zustand", + "TRUEPRIORITY": "Wahre Priorität", + "FALSEPRIORITY": "Falsche Priorität", "VALUE": "Wert", - "EDIT_AGENT": "Agenten bearbeiten", - "EDIT_GOTO": "\"GeheZu\" bearbeiten", - "EDIT_NOOP": "Log-Erstellung bearbeiten", - "EDIT_GOTOP": "GoToP bearbeiten", - "EDIT_GOTOIF": "Bedingung bearbeiten und Priorität zuweisen", - "EDIT_QUEUE": "Warteschlange bearbeiten", - "EDIT_CLOSE": "Verhalten bei Schließen bearbeiten", + "EDIT_AGENT": "Agent bearbeiten", + "EDIT_GOTO": "Bearbeiten Gehe zu", + "EDIT_NOOP": "Bearbeiten Noop", + "EDIT_GOTOP": "GotoP bearbeiten", + "EDIT_GOTOIF": "Bearbeiten GotoIf", + "EDIT_QUEUE": "Fax Warteschlange bearbeiten", + "EDIT_CLOSE": "Bearbeiten Schließen", "QUEUE": "Warteschlange", - "GOTOIF": "GeheZuWenn (GoToIf)", - "GOTOP": "Priorität zuweisen (GoToP)", - "NOOP": "Log erstellen (NoOp)", + "GOTOIF": "GotoIf", + "GOTOP": "GotoP", + "NOOP": "Noop", "AGENT": "Agent", - "NOTES": "Anmerkungen", - "CLOSEDAT": "Geschlossen am", - "DISPOSITION": "Qualifizierung", + "NOTES": "Hinweise", + "CLOSEDAT": "Geschlossen", + "DISPOSITION": "Disposition", "REALTIME": "Echtzeit", "UNKNOWN": "Unbekannt", - "UNREGISTERED": "Nicht registriert", + "UNREGISTERED": "Unregistrierte", "UNAVAILABLE": "Nicht verfügbar", - "NOT_INUSE": "Nicht in Verwendung", + "NOT_INUSE": "Nicht in Gebrauch", "REACHABLE": "Erreichbar", - "IN_USE": "In Verwendung", - "VOICE": "Anrufe", + "IN_USE": "Im Einsatz", + "VOICE": "Voice", "CHAT": "Chat", "MAIL": "E-Mail", "SMS": "SMS", "OPENCHANNEL": "Offener Kanal", "NO_AGENT_ONLINE": "Kein Agent Online", - "GOTOREALTIME_FAXQUEUE": "Zur Echtzeitansicht Warteschlange", - "EDIT_TRUNK": "Trunk bearbeiten", + "GOTOREALTIME_FAXQUEUE": "In Echtzeit Fax Warteschlange", + "EDIT_TRUNK": "Bearbeiten Trunk", "REGISTERED": "Registriert", - "EDIT_ACCOUNT": "Fax-Konto bearbeiten", - "PARTIALPAUSE": "Teilpause", + "EDIT_ACCOUNT": "Fax Konto bearbeiten", + "PARTIALPAUSE": "Teilweise Pause", "BUSY": "Besetzt", "TIMER": "Timer", "IDLE": "Leerlauf", "CAPACITY": "Kapazität", - "TOTAL": "Gesamt", - "IN": "Eingehend", - "OUT": "Ausgehend", - "NO_INTERACTION_AVAILABLE": "Keine Interaktionen verfügbar", + "TOTAL": "Insgesamt", + "IN": "In", + "OUT": "Aus", + "NO_INTERACTION_AVAILABLE": "Es sind keine Wechselwirkungen zur Verfügung", "TAGS": "Tags", "REPLY": "Antwort", "SEND": "Senden", - "TO": "An", + "TO": "Zu", "FROM": "Von", - "INTERACTIONS_FAXACCOUNT": "Direkt zu den Interaktionen", - "REFRESH_INTERACTIONS": "Interaktionen aktualisieren", - "NO_FAXCANNEDANSWER_AVAILABLE": "Keine Textvorlagen verfügbar", - "NEW_FAXCANNEDANSWER": "Neue Textvorlage", - "ADD_FAXCANNEDANSWER": "Textvorlage hinzufügen", - "EDIT_CHATCANNEDANSWER": "Textvorlage bearbeiten", - "DELETE_CHATCANNEDANSWER": "Textvorlage löschen", - "SPYINTERACTION": "Anzeigen", + "INTERACTIONS_FAXACCOUNT": "Zu Wechselwirkungen gehen", + "REFRESH_INTERACTIONS": "Aktualisieren Interaktionen", + "NO_FAXCANNEDANSWER_AVAILABLE": "Keine vordefinierten Antworten verfügbar", + "NEW_FAXCANNEDANSWER": "Neue vordefinierte Antwort", + "ADD_FAXCANNEDANSWER": "Vordefinierte Antwort hinzufügen", + "EDIT_CHATCANNEDANSWER": "Vordefinierte Antwort bearbeiten", + "DELETE_CHATCANNEDANSWER": "Vordefinierte Antwort löschen", + "SPYINTERACTION": "Spion", "DELETE_INTERACTION": "Interaktion löschen", - "COMMAND": "Eingabe", + "COMMAND": "Befehl", "EDIT_SYSTEM": "System bearbeiten", "SYSTEM": "System", - "VARIABLE": "Variabel", + "VARIABLE": "Variable", "NOTIFICATION": "Benachrichtigung", - "NOTIFICATIONSHAKE": "Schütteln", - "NOTIFICATIONSOUND": "Sound abspielen", + "NOTIFICATIONSHAKE": "Shake", + "NOTIFICATIONSOUND": "Klingen", "NOTIFICATIONTEMPLATE": "Vorlage", - "WAITFORTHEASSIGNEDAGENT": "Auf zugewiesenen Agenten warten", + "WAITFORTHEASSIGNEDAGENT": "Warte auf den zugewiesenen Agenten", "EDIT_TAG": "Tag bearbeiten", - "TAG": "Tag", - "AGENTADD_FAXACCOUNT": "Agenten zum Fax-Konto hinzufügen", - "AGENTTRANSFER": "Transfer an Agenten erlauben", + "TAG": "Etikett", + "AGENTADD_FAXACCOUNT": "Fügen Sie dem Faxkonto einen Agenten hinzu", + "AGENTTRANSFER": "Agent Transfer", "AGENTTRANSFERTIMEOUT": "Zeitüberschreitung für Agententransfer", - "QUEUETRANSFER": "Transfer in Warteschlange erlauben", - "QUEUETRANSFERTIMEOUT": "Zeitüberschreitung für Warteschlangentransfer", + "QUEUETRANSFER": "Warteschlangenübertragung", + "QUEUETRANSFERTIMEOUT": "Warteschlangenübertragungs-Timeout", "TRANSFER": "Transfer", - "CANNEDANSWERS": "Textvorlagen", - "DOWNLOAD_INTERACTION": "Interaktion herunterladen", - "FAXCANNEDANSWERS": "Textvorlagen für Fax", - "LOGIN_TIME": "Zeit angemeldet", - "PAUSE_TIME": "Zeit in Pause", - "TEAMS_ASSOCIATION": "Teamzuweisung", - "MANDATORYDISPOSITION": "Qualifizierung erforderlich", - "MANDATORYDISPOSITIONPAUSEID": "PausenID während Qualifizierung", - "TOOLTIP_SCREENRECORDING_OFF": "Bildschiemaufzeichnung verfügbar", - "TOOLTIP_SCREENRECORDING_ON": "Bildschirmaufzeichnung läuft", - "DOWNLOAD_WITHOUT_ATTACHMENTS": "Herunterladen ohne Anhänge", - "DOWNLOAD_WITH_ATTACHMENTS": "Herunterladen inkl. Anhänge", + "CANNEDANSWERS": "Vordefinierte Antworten", + "DOWNLOAD_INTERACTION": "Herunterladen", + "FAXCANNEDANSWERS": "Vordefinierte Antworten", + "LOGIN_TIME": "Login-Zeit", + "PAUSE_TIME": "Pausenzeit", + "TEAMS_ASSOCIATION": "Vereinigung der Mannschaften", + "MANDATORYDISPOSITION": "Zwingende Disposition", + "MANDATORYDISPOSITIONPAUSEID": "Status pausieren, wenn die Disposition obligatorisch ist", + "TOOLTIP_SCREENRECORDING_OFF": "Bildschirmaufnahme verfügbar", + "TOOLTIP_SCREENRECORDING_ON": "Bildschirmaufnahme läuft", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download ohne Anhänge", + "DOWNLOAD_WITH_ATTACHMENTS": "Mit Anhängen herunterladen", "LASTMESSAGE": "Letzte Nachricht" } } diff --git a/public/app/main/apps/fax/i18n/nl.json b/public/app/main/apps/fax/i18n/nl.json index 5eed611..1bff537 100644 --- a/public/app/main/apps/fax/i18n/nl.json +++ b/public/app/main/apps/fax/i18n/nl.json @@ -1,26 +1,26 @@ { "FAX": { - "TEAMADD_FAXQUEUE": "Team aan Fax wachtrij Toevoegen", - "AGENTADD_FAXQUEUE": "Agent aan Fax wachtrij Toevoegen", + "TEAMADD_FAXQUEUE": "Voeg Team Fax wachtrij", + "AGENTADD_FAXQUEUE": "Voeg Agent Fax wachtrij", "NAME": "Naam", "FAXQUEUES": "Faxwachtrijen", - "SEARCH_FOR_ANYONE": "Zoeken", + "SEARCH_FOR_ANYONE": "Zoeken voor iedereen", "ERRORS": { - "NAME_REQUIRED": "Verplicht veld", - "AGENT_TIMEOUT_REQUIRED": "Verplicht veld", - "MOTIONADDRESS_REQUIRED": "Verplicht veld", - "MOTIONADDRESS_MUST_VALID_URL": "Verplicht veld", - "LOCALSTATIONID_REQUIRED": "Verplicht veld", - "MODEM_REQUIRED": "Verplicht veld", - "GATEWAY_REQUIRED": "Verplicht veld", - "FAXDETECT_REQUIRED": "Verplicht veld", - "T38TIMEOUT_REQUIRED": "Verplicht veld", - "TIMEOUT_REQUIRED": "Verplicht veld", - "HEADERINFO_REQUIRED": "Verplicht veld", - "TRUNK_REQUIRED": "Verplicht veld", - "LIST_REQUIRED": "Verplicht veld", + "NAME_REQUIRED": "De naam is verplicht", + "AGENT_TIMEOUT_REQUIRED": "De Agent Timeout is vereist", + "MOTIONADDRESS_REQUIRED": "De Motion Adres is vereist.", + "MOTIONADDRESS_MUST_VALID_URL": "De Motion adres moet worden geschreven in een geldige indeling", + "LOCALSTATIONID_REQUIRED": "Het lokale station-id is vereist", + "MODEM_REQUIRED": "De modem vereist.", + "GATEWAY_REQUIRED": "De gateway is vereist", + "FAXDETECT_REQUIRED": "De Fax detectie is vereist", + "T38TIMEOUT_REQUIRED": "Het T.38 Timeout is vereist", + "TIMEOUT_REQUIRED": "De timeout is vereist", + "HEADERINFO_REQUIRED": "De header info zijn vereist", + "TRUNK_REQUIRED": "De kofferruimte is vereist", + "LIST_REQUIRED": "De lijst is vereist", "KEY_MAX_LENGTH": "Sleutel moet een lengte gelijk aan {{max.}}", - "KEY_REQUIRED": "Verplicht veld", + "KEY_REQUIRED": "De sleutel is vereist", "AGENT_REQUIRED": "Verplicht veld", "QUEUE_REQUIRED": "Verplicht veld", "TRUEPRIORITY_REQUIRED": "Verplicht veld", @@ -53,35 +53,35 @@ "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "U moet een pauzestatus opgeven wanneer u zich in een verplichte opstelling bevindt" }, "STRATEGY": "Strategie", - "AGENT_TIMEOUT": "Time-out Agent", + "AGENT_TIMEOUT": "Time-out agent", "DESCRIPTION": "Beschrijving", - "ADD_FAXQUEUE": "Fax Wachtrij Toevoegen", - "EDIT_FAXQUEUE": "Fax Wachtrij Bewerken", - "DELETE_FAXQUEUE": "Fax Wachtrij Verwijderen", + "ADD_FAXQUEUE": "Voeg Fax wachtrij", + "EDIT_FAXQUEUE": "Edit Fax wachtrij", + "DELETE_FAXQUEUE": "Verwijder Fax wachtrij", "CREATED_AT": "Gemaakt op", "SAVE": "Opslaan", "SETTINGS": "Instellingen", "GENERAL": "Algemeen", "FAXACCOUNTS": "Fax Accounts", - "MOTIONADDRESS": "Motion Adres", - "ADD_FAXACCOUNT": "Fax Account Toevoegen", - "EDIT_FAXACCOUNT": "Fax Account Bewerken", - "DELETE_FAXACCOUNT": "Fax Account Verwijderen", + "MOTIONADDRESS": "Motion adres", + "ADD_FAXACCOUNT": "Voeg Fax Account", + "EDIT_FAXACCOUNT": "Edit Fax Account", + "DELETE_FAXACCOUNT": "Verwijder Fax Account", "DISPOSITIONS": "Dispositions", "WEBHOOKS": "WebHooks", "ACTIONS": "Acties", "LIST": "Lijst", "FIDELITY": "Hifi-geluid", "ACCEPT": "Accepteren", - "ACCEPTMETHOD": "Mehode Accepteren", - "ACCEPTURL": "URL Sccepteren", + "ACCEPTMETHOD": "Accepteren methode", + "ACCEPTURL": "URL accepteren", "REJECT": "Afwijzen", "REJECTMETHOD": "Methode afwijzen", "REJECTURL": "URL afwijzen", "CLOSE": "Dicht", - "CLOSEMETHOD": "Methode Sluiten", - "CLOSEURL": "URL Sluiten", - "TRUNK": "Trunk", + "CLOSEMETHOD": "Sluit methode", + "CLOSEURL": "Sluit URL", + "TRUNK": "Transmissielijn", "LOCALSTATIONID": "Lokaal station Identifier", "HELP": { "LOCALSTATIONID": "Lokaal station Identifier (telefoonnummer).", @@ -91,11 +91,11 @@ "FAXDETECT": "Fax inschakelen detectie met optionele timeout in seconden (ja/t38/CNG/[out]/NO).", "T38TIMEOUT": "De time-out wordt gebruikt voor T.38 onderhandeling. De minimumwaarde is 1000.", "ECM": "Fout Connection Mode (ECM).", - "MINRATE": "Min overdrachtssnelheid instellen. Mogelijke waarden zijn: 2400, 4800, 7200, 9600, 12000 of 14400.", + "MINRATE": "Min overdrachtssnelheid instellen voordat de versnellingsbak. Mogelijke waarden zijn: 2400, 4800, 7200, 9600, 12000 of 14400.", "MAXRATE": "Maximale overdrachtsnelheid ingesteld voor verzending. Mogelijke waarden zijn: 2400, 4800, 7200, 9600, 12000 of 14400.", "NAME": "Alleen cijfers, letters en speciale tekens (_) worden ondersteund", "MANDATORYDISPOSITION": "Verplichte regeling", - "MANDATORYDISPOSITIONPAUSEID": "Pauzestatus voor verplichte Dispositie" + "MANDATORYDISPOSITIONPAUSEID": "Pauzestatus voor verplichte dispositie" }, "ADVANCED": "Geavanceerd", "ECM": "ECM", @@ -108,36 +108,36 @@ "SIP": "Technologie", "HEADERINFO": "Header Info", "SELECTED": "Geselecteerd", - "SELECT_ALL": "Selecteer Alles", - "SELECT_NONE": "Selecteer Geen", + "SELECT_ALL": "Alles selecteren", + "SELECT_NONE": "Selecteer None (Geen).", "BACK": "Terug", "FAX": "Fax", "ID": "Id", "TIMEOUT": "Timeout", - "FAXDISPOSITIONS": "Fax Disposities", - "NO_FAXDISPOSITION_AVAILABLE": "Geen Fax Disposities beschikbaar", - "NEW_FAXDISPOSITION": "Nieuwe Fax Dispositie", + "FAXDISPOSITIONS": "Fax dispositieven", + "NO_FAXDISPOSITION_AVAILABLE": "Geen Fax Dispositieven beschikbaar", + "NEW_FAXDISPOSITION": "Nieuwe fax dispositie", "ADD_FAXDISPOSITION": "Voeg Fax dispositie", - "EDIT_FAXDISPOSITION": "Edit Fax Dispositie", - "DELETE_FAXDISPOSITION": "Verwijder Fax Dispositie", - "NEW_FAXQUEUE": "Nieuwe Fax Wachtrij", - "NEW_FAXACCOUNT": "Nieuw Fax Account", + "EDIT_FAXDISPOSITION": "Edit Fax dispositie", + "DELETE_FAXDISPOSITION": "Verwijder Fax dispositie", + "NEW_FAXQUEUE": "Nieuwe fax wachtrij", + "NEW_FAXACCOUNT": "Nieuwe fax Account", "NO_AVAILABLE_INFO": "Geen beschikbare informatie", - "ALL_TEAMS": "Alle Teams", - "SELECTED_TEAMS": "Geselecteerde Teams", + "ALL_TEAMS": "Alle teams", + "SELECTED_TEAMS": "Geselecteerde teams", "PAGE": "Pagina", "ROWSPERPAGE": "Rijen per pagina", "OF": "Van", "DELETE": "Verwijderen", "KEY": "Sleutel", "ALL_AGENTS": "Alle gebruikers zijn agenten", - "SELECTED_AGENTS": "Geselecteerde Agenten", + "SELECTED_AGENTS": "Geselecteerde agenten", "FILTER": "Filter", "SELECT_STATUS": "Selecteer Status.", "ALL": "Alle", "CLOSED": "Gesloten", "OPENED": "Geopend", - "SELECT_ACCOUNT": "Selecteer Account", + "SELECT_ACCOUNT": "Account selecteren", "INTERACTIONS": "Interacties", "CONTACT": "Neem contact op met", "STARTEDAT": "Gestart op", @@ -172,13 +172,13 @@ "TRUEPRIORITY": "Echte prioriteit", "FALSEPRIORITY": "False prioriteit", "VALUE": "Waarde", - "EDIT_AGENT": "Agent Bewerken", - "EDIT_GOTO": "Ga naar Bewerken", + "EDIT_AGENT": "Edit Agent", + "EDIT_GOTO": "Ga naar bewerken", "EDIT_NOOP": "Noop bewerken", "EDIT_GOTOP": "GotoP bewerken", "EDIT_GOTOIF": "GotoIf bewerken", - "EDIT_QUEUE": "Fax wachtrij Bewerken", - "EDIT_CLOSE": "Bewerken Sluiten", + "EDIT_QUEUE": "Edit Fax wachtrij", + "EDIT_CLOSE": "Edit dicht", "QUEUE": "Wachtrij", "GOTOIF": "GotoIf", "GOTOP": "GotoP", @@ -189,12 +189,12 @@ "DISPOSITION": "Afvoeren", "REALTIME": "Realtime", "UNKNOWN": "Onbekend", - "UNREGISTERED": "Niet geregistreerd", + "UNREGISTERED": "Unregistered", "UNAVAILABLE": "Niet beschikbaar", "NOT_INUSE": "Niet in gebruik", "REACHABLE": "Bereikbaar", "IN_USE": "In gebruik", - "VOICE": "Telefonie", + "VOICE": "Spraak", "CHAT": "Chat", "MAIL": "Mail", "SMS": "SMS", @@ -222,13 +222,13 @@ "REFRESH_INTERACTIONS": "Interacties vernieuwen", "NO_FAXCANNEDANSWER_AVAILABLE": "Geen ingeblikte antwoorden beschikbaar", "NEW_FAXCANNEDANSWER": "Nieuw ingebouwd antwoord", - "ADD_FAXCANNEDANSWER": "Standaard antwoord Toevoegen", - "EDIT_CHATCANNEDANSWER": "Standaard antwoord bewerken", - "DELETE_CHATCANNEDANSWER": "Standaard antwoord verwijderen", + "ADD_FAXCANNEDANSWER": "Voeg ingebed antwoord toe", + "EDIT_CHATCANNEDANSWER": "Ingebouwd antwoord bewerken", + "DELETE_CHATCANNEDANSWER": "Ingebouwd antwoord verwijderen", "SPYINTERACTION": "Spion", - "DELETE_INTERACTION": "Interactie Verwijderen", + "DELETE_INTERACTION": "Interactie verwijderen", "COMMAND": "Opdracht", - "EDIT_SYSTEM": "Systeem Bewerken", + "EDIT_SYSTEM": "Systeem bewerken", "SYSTEM": "Systeem", "VARIABLE": "veranderlijk", "NOTIFICATION": "Kennisgeving", @@ -236,17 +236,17 @@ "NOTIFICATIONSOUND": "Geluid", "NOTIFICATIONTEMPLATE": "Sjabloon", "WAITFORTHEASSIGNEDAGENT": "Wacht op de toegewezen agent", - "EDIT_TAG": "Label Bewerken", + "EDIT_TAG": "Bewerk label", "TAG": "Label", - "AGENTADD_FAXACCOUNT": "Agent aan faxaccount Toevoegen", + "AGENTADD_FAXACCOUNT": "Agent toevoegen aan faxaccount", "AGENTTRANSFER": "Agent Transfer", "AGENTTRANSFERTIMEOUT": "Agent Transfer Timeout", "QUEUETRANSFER": "Wachtrijoverdracht", "QUEUETRANSFERTIMEOUT": "Wachtrij Transfer Timeout", "TRANSFER": "Overdracht", - "CANNEDANSWERS": "Standaard antwoorden", + "CANNEDANSWERS": "Ingeblikte antwoorden", "DOWNLOAD_INTERACTION": "Download", - "FAXCANNEDANSWERS": "Standaard antwoorden", + "FAXCANNEDANSWERS": "Ingeblikte antwoorden", "LOGIN_TIME": "Aanmeldtijd", "PAUSE_TIME": "Pauzetijd", "TEAMS_ASSOCIATION": "Teams Association", diff --git a/public/app/main/apps/fax/i18n/pt-BR.json b/public/app/main/apps/fax/i18n/pt-BR.json index 3b562c6..0b91115 100644 --- a/public/app/main/apps/fax/i18n/pt-BR.json +++ b/public/app/main/apps/fax/i18n/pt-BR.json @@ -41,7 +41,7 @@ "PARTIALPAUSE": "Pausa Parcial", "BUSY": "Ocupado", "TIMER": "Tempo", - "IDLE": "Ocioso", + "IDLE": "Disponível", "CAPACITY": "Capacidade", "GOTO_FAXACCOUNT": "Ir para fax em tempo real", "ACCOUNTS": "Contas", diff --git a/public/app/main/apps/help/i18n/pt-BR.json b/public/app/main/apps/help/i18n/pt-BR.json index 3f58330..86fc6e0 100644 --- a/public/app/main/apps/help/i18n/pt-BR.json +++ b/public/app/main/apps/help/i18n/pt-BR.json @@ -1,8 +1,8 @@ { "HELP": { "ABOUT": "Sobre", - "CONTACT_US": "Contate-Nos", + "CONTACT_US": "Fale conosco", "HELP": "Ajuda", - "USEFUL_LINKS": "Links Úteis" + "USEFUL_LINKS": "Links úteis" } } diff --git a/public/app/main/apps/integrations/i18n/nl.json b/public/app/main/apps/integrations/i18n/nl.json index f907009..387af87 100644 --- a/public/app/main/apps/integrations/i18n/nl.json +++ b/public/app/main/apps/integrations/i18n/nl.json @@ -8,42 +8,42 @@ "URI": "URL", "BACK": "Terug", "SELECTED": "Geselecteerd", - "SELECT_ALL": "Selecteer Alles", - "SELECT_NONE": "Selecteer Geen", - "EDIT_ZENDESKACCOUNT": "Zendesk Account Bewerken", - "DELETE_ZENDESKACCOUNT": "Zendesk Account Verwijderen", - "NEW_ZENDESKACCOUNT": "Nieuw Zendesk Account", + "SELECT_ALL": "Alles selecteren", + "SELECT_NONE": "Selecteer None (Geen).", + "EDIT_ZENDESKACCOUNT": "Edit Zendesk Account", + "DELETE_ZENDESKACCOUNT": "Verwijder Zendesk Account", + "NEW_ZENDESKACCOUNT": "Nieuwe Zendesk Account", "AUTHTYPE": "Authentication Type (Verificatietype)", "PASSWORD": "Wachtwoord", - "CONFIRM_PASSWORD": "Wachtwoord Bevestigen", + "CONFIRM_PASSWORD": "Wachtwoord bevestigen", "TOKEN": "Token", - "MOTIONPROXYADDRESS": "Motion of Proxy IP Adres", + "MOTIONPROXYADDRESS": "Beweging of Proxy IP Adres", "DESCRIPTION": "Beschrijving", - "ADD_ZENDESKACCOUNT": "Zendesk Account Toevoegen", + "ADD_ZENDESKACCOUNT": "Voeg Zendesk Account", "ERRORS": { - "NAME_REQUIRED": "Verplicht veld", - "USERNAME_REQUIRED": "Verplicht veld", - "URI_REQUIRED": "Verplicht veld", + "NAME_REQUIRED": "De naam is verplicht", + "USERNAME_REQUIRED": "De gebruikersnaam is vereist", + "URI_REQUIRED": "De URL is vereist", "URI_MUST_VALID_URL": "De URL (Uniform Resource Identifier) moet worden geschreven in een geldige indeling", - "PASSWORD_REQUIRED": "Verplicht veld", - "CONFIRM_NOT_MATCH": "De wachtwoorden komen niet overeen", + "PASSWORD_REQUIRED": "Het wachtwoord is vereist", + "CONFIRM_NOT_MATCH": "De wachtwoorden Don' t match", "TOKEN_REQUIRED": "Het token is vereist", "MOTIONPROXYADDRESS_MUST_VALID_URL": "Het adres moet worden geschreven in een geldige indeling", "CLIENTID_REQUIRED": "De klant-ID is vereist.", "CLIENTSECRET_REQUIRED": "De Cliënt geheim is vereist", "SECURITYTOKEN_REQUIRED": "De Security token is vereist", - "APIKEY_REQUIRED": "Verplicht veld", - "CONTENT_REQUIRED": "Verplicht veld", - "VARIABLENAME_REQUIRED": "Verplicht veld", - "KEY_REQUIRED": "Verplicht veld", - "TYPE_REQUIRED": "Verplicht veld", - "VALUE_REQUIRED": "Verplicht veld", - "FIELD_REQUIRED": "Verplicht veld", - "CONSUMERKEY_REQUIRED": "Verplicht veld", - "CONSUMERSECRET_REQUIRED": "Verplicht veld", - "TOKENSECRET_REQUIRED": "Verplicht veld", - "HOST_REQUIRED": "Verplicht veld", - "AUTHTOKEN_REQUIRED": "Verplicht veld", + "APIKEY_REQUIRED": "De API Key nodig", + "CONTENT_REQUIRED": "De inhoud is vereist", + "VARIABLENAME_REQUIRED": "De variabele is vereist", + "KEY_REQUIRED": "De sleutel is vereist", + "TYPE_REQUIRED": "Het type is vereist", + "VALUE_REQUIRED": "De waarde is vereist", + "FIELD_REQUIRED": "Het is een verplicht veld", + "CONSUMERKEY_REQUIRED": "De consument sleutel is vereist", + "CONSUMERSECRET_REQUIRED": "De consument geheim is vereist", + "TOKENSECRET_REQUIRED": "Het token geheim is vereist", + "HOST_REQUIRED": "De host is vereist", + "AUTHTOKEN_REQUIRED": "De exporteur Token is vereist", "ACCESS_KEY_REQUIRED": "Verplicht veld", "VTIGER_USER_NAME_REQUIRED": "Verplicht veld", "TENANTID_REQUIRED": "Verplicht veld", @@ -74,70 +74,70 @@ "GENERAL": "Algemeen", "CREATED_AT": "Gemaakt op", "SAVE": "Opslaan", - "NO_ZENDESKCONFIGURATION_AVAILABLE": "Geen Zendesk configuraties beschikbaar", + "NO_ZENDESKCONFIGURATION_AVAILABLE": "Nee Zendesk configuraties beschikbaar", "NEW_ZENDESKCONFIGURATION": "Nieuwe Zendesk configuratie", - "ADD_ZENDESKCONFIGURATION": "Zendesk configuratie Toevoegen", - "EDIT_ZENDESKCONFIGURATION": "Zendesk configuratie Bewerken", - "DELETE_ZENDESKCONFIGURATION": "Zendesk configuratie Verwijderen", + "ADD_ZENDESKCONFIGURATION": "Voeg Zendesk configuratie", + "EDIT_ZENDESKCONFIGURATION": "Edit Zendesk configuratie", + "DELETE_ZENDESKCONFIGURATION": "Verwijder Zendesk configuratie", "NO_SALESFORCECONFIGURATION_AVAILABLE": "Geen Salesforce-configuraties beschikbaar", "NEW_SALESFORCECONFIGURATION": "Nieuwe Salesforce-configuratie", - "ADD_SALESFORCECONFIGURATION": "Salesforce-configuratie Toevoegen", - "EDIT_SALESFORCECONFIGURATION": "Salesforce-configuratie Bewerken", - "DELETE_SALESFORCECONFIGURATION": "Salesforce-configuratie Verwijderen", - "NO_SUGARCRMCONFIGURATION_AVAILABLE": "Geen SugarCRM configuraties beschikbaar", + "ADD_SALESFORCECONFIGURATION": "Voeg Salesforce-configuratie", + "EDIT_SALESFORCECONFIGURATION": "Edit Salesforce-configuratie", + "DELETE_SALESFORCECONFIGURATION": "Verwijder Salesforce-configuratie", + "NO_SUGARCRMCONFIGURATION_AVAILABLE": "Nee SugarCRM configuraties beschikbaar", "NEW_SUGARCRMCONFIGURATION": "Nieuwe SugarCRM Configuratie", - "ADD_SUGARCRMCONFIGURATION": "SugarCRM Configuratie Toevoegen", - "EDIT_SUGARCRMCONFIGURATION": "SugarCRM Configuratie Bewerken", - "DELETE_SUGARCRMCONFIGURATION": "SugarCRM Configuratie Verwijderen", - "NO_FRESHDESKCONFIGURATION_AVAILABLE": "Geen Freshdesk configuraties beschikbaar", + "ADD_SUGARCRMCONFIGURATION": "Voeg SugarCRM Configuratie", + "EDIT_SUGARCRMCONFIGURATION": "Edit SugarCRM Configuratie", + "DELETE_SUGARCRMCONFIGURATION": "Verwijder SugarCRM Configuratie", + "NO_FRESHDESKCONFIGURATION_AVAILABLE": "Nee Freshdesk configuraties beschikbaar", "NEW_FRESHDESKCONFIGURATION": "Nieuwe Freshdesk configuratie", - "ADD_FRESHDESKCONFIGURATION": "Freshdesk configuratie Toevoegen", - "EDIT_FRESHDESKCONFIGURATION": "Freshdesk configuratie Bewerken", - "DELETE_FRESHDESKCONFIGURATION": "Freshdesk configuratie Verwijderen", + "ADD_FRESHDESKCONFIGURATION": "Voeg Freshdesk configuratie", + "EDIT_FRESHDESKCONFIGURATION": "Edit Freshdesk configuratie", + "DELETE_FRESHDESKCONFIGURATION": "Verwijder Freshdesk configuratie", "SALESFORCEACCOUNTS": "Salesforce-accounts", - "EDIT_SALESFORCEACCOUNT": "Salesforce-account Bewerken", - "DELETE_SALESFORCEACCOUNT": "Salesforce-account Verwijderen", - "NEW_SALESFORCEACCOUNT": "Nieuw Salesforce-account", - "ADD_SALESFORCEACCOUNT": "Salesforce-account Toevoegen", + "EDIT_SALESFORCEACCOUNT": "Edit Salesforce-account", + "DELETE_SALESFORCEACCOUNT": "Verwijder Salesforce-account", + "NEW_SALESFORCEACCOUNT": "Nieuwe Salesforce-account", + "ADD_SALESFORCEACCOUNT": "Voeg Salesforce-account", "CLIENTID": "Klantnr.", "CLIENTSECRET": "Opdrachtgever geheim", "SECURITYTOKEN": "Beveiligingstoken", "SEARCH_FOR_ANYONE": "Zoeken voor iedereen", "APIKEY": "Api-sleutel", "FRESHDESKACCOUNTS": "Freshdesk Accounts", - "EDIT_FRESHDESKACCOUNT": "Freshdesk Account Bewerken", - "DELETE_FRESHDESKACCOUNT": "Freshdesk Account Verwijderen", - "NEW_FRESHDESKACCOUNT": "Nieuw Freshdesk Account", - "ADD_FRESHDESKACCOUNT": "Freshdesk Account Toevoegen", + "EDIT_FRESHDESKACCOUNT": "Edit Freshdesk Account", + "DELETE_FRESHDESKACCOUNT": "Verwijder Freshdesk Account", + "NEW_FRESHDESKACCOUNT": "Nieuwe Freshdesk Account", + "ADD_FRESHDESKACCOUNT": "Voeg Freshdesk Account", "SUGARCRMACCOUNTS": "SugarCRM Accounts", - "EDIT_SUGARCRMACCOUNT": "SugarCRM Account Bewerken", - "DELETE_SUGARCRMACCOUNT": "SugarCRM Account Verwijderen", - "NEW_SUGARCRMACCOUNT": "Nieuw SugarCRM Account", - "ADD_SUGARCRMACCOUNT": "SugarCRM Account Toevoegen", + "EDIT_SUGARCRMACCOUNT": "Edit SugarCRM Account", + "DELETE_SUGARCRMACCOUNT": "Verwijder SugarCRM Account", + "NEW_SUGARCRMACCOUNT": "Nieuwe SugarCRM Account", + "ADD_SUGARCRMACCOUNT": "Voeg SugarCRM Account", "CONFIGURATIONS": "Configuraties", "NO_CONFIGURATION_AVAILABLE": "Geen configuraties beschikbaar", "NEW_CONFIGURATION": "Nieuwe configuratie", - "ADD_CONFIGURATION": "Dialoogvenster Configuratie Toevoegen", - "EDIT_CONFIGURATION": "Configuratie Bewerken", - "DELETE_CONFIGURATION": "Configuratie Verwijderen", + "ADD_CONFIGURATION": "Dialoogvenster Configuratie toevoegen", + "EDIT_CONFIGURATION": "Configuratie bewerken", + "DELETE_CONFIGURATION": "Configuratie verwijderen", "SUBJECTS": "Onderwerpen", "DESCRIPTIONS": "Beschrijvingen", "FIELDS": "Velden", "TAGS": "Tags", "TYPE": "Type", "CONTENT": "Inhoud", - "EDIT_SUBJECT": "Onderwerp Bewerken", - "DELETE_SUBJECT": "Onderwerp Verwijderen", + "EDIT_SUBJECT": "Onderwerp bewerken", + "DELETE_SUBJECT": "Onderwerp verwijderen", "NEW_SUBJECT": "Nieuw onderwerp", - "ADD_SUBJECT": "Onderwerp Toevoegen", - "EDIT_DESCRIPTION": "Beschrijving Bewerken", - "DELETE_DESCRIPTION": "Beschrijving Verwijderen", + "ADD_SUBJECT": "Onderwerp toevoegen", + "EDIT_DESCRIPTION": "Edit description (beschrijving bewerken)", + "DELETE_DESCRIPTION": "Beschrijving verwijderen", "NEW_DESCRIPTION": "Nieuwe beschrijving", - "ADD_DESCRIPTION": "Beschrijving Toevoegen", - "EDIT_FIELD": "Invoerveld Bewerken", - "DELETE_FIELD": "Veld Verwijderen", + "ADD_DESCRIPTION": "Voeg de beschrijving", + "EDIT_FIELD": "Invoerveld", + "DELETE_FIELD": "Veld wissen", "NEW_FIELD": "Nieuw veld", - "ADD_FIELD": "Veld Toevoegen", + "ADD_FIELD": "Veld toevoegen", "ADD": "Toevoegen", "VOICE": "Spraak", "MAIL": "Mail", @@ -159,28 +159,28 @@ "INTEGRATION_TAB": "Tabblad integratie", "NEW_TAB": "Nieuw tabblad", "DESKACCOUNTS": "Bureau Accounts", - "EDIT_DESKACCOUNT": "Desk Account Bewerken", + "EDIT_DESKACCOUNT": "Edit Desk Account", "TEST_DESKACCOUNT": "Test Desk Account", - "DELETE_DESKACCOUNT": "Desk Account Verwijderen", + "DELETE_DESKACCOUNT": "Verwijder Desk Account", "CONSUMERKEY": "Toets voor consumenten", "CONSUMERSECRET": "Consument geheim", "TOKENSECRET": "Token geheim", - "ADD_DESKACCOUNT": "Desk Account Toevoegen", - "NEW_DESKACCOUNT": "Nieuw Desk Account", - "ADD_DESKCONFIGURATION": "Desk-configuratie Toevoegen", + "ADD_DESKACCOUNT": "Voeg Desk Account", + "NEW_DESKACCOUNT": "Nieuwe Desk Account", + "ADD_DESKCONFIGURATION": "Voeg Desk-configuratie", "NEW_DESKCONFIGURATION": "Nieuwe Desk-configuratie", - "DELETE_DESKCONFIGURATION": "Desk-configuratie Verwijderen", + "DELETE_DESKCONFIGURATION": "Verwijder Desk-configuratie", "ZOHOACCOUNTS": "Zoho Accounts", - "EDIT_ZOHOACCOUNT": "Zoho Account Bewerken", + "EDIT_ZOHOACCOUNT": "Edit Zoho Account", "TEST_ZOHOACCOUNT": "Test Zoho Account", - "DELETE_ZOHOACCOUNT": "Zoho Account Verwijderen", - "ADD_ZOHOACCOUNT": "Zoho Account Toevoegen", - "NEW_ZOHOACCOUNT": "Nieuw Zoho Account", - "ADD_ZOHOCONFIGURATION": "Zoho configuratie Toevoegen", + "DELETE_ZOHOACCOUNT": "Verwijder Zoho Account", + "ADD_ZOHOACCOUNT": "Voeg Zoho Account", + "NEW_ZOHOACCOUNT": "Nieuwe Zoho Account", + "ADD_ZOHOCONFIGURATION": "Voeg Zoho configuratie", "NEW_ZOHOCONFIGURATION": "Nieuwe Zoho configuratie", "AUTHTOKEN": "Autorisatie Token", "HOST": "Host", - "DELETE_ZOHOCONFIGURATION": "Zoho configuratie Verwijderen", + "DELETE_ZOHOCONFIGURATION": "Verwijder Zoho configuratie", "PAGE": "Pagina", "ROWSPERPAGE": "Rijen per pagina", "OF": "Van", @@ -188,38 +188,38 @@ "MODULE_SEARCH": "Module zoeken", "MODULE_CREATE": "Module aanmaken", "ACCESS_KEY": "vTiger Toegangssleutel", - "ADD_VTIGERACCOUNT": "vTiger-account Toevoegen", - "ADD_VTIGERCONFIGURATION": "vTiger-configuratie Toevoegen", - "DELETE_VTIGERACCOUNT": "vTiger Account Verwijderen", - "DELETE_VTIGERCONFIGURATION": "vTiger-configuratie Verwijderen", - "EDIT_VTIGERACCOUNT": "vTiger-account Bewerken", + "ADD_VTIGERACCOUNT": "Voeg een nieuw vTiger-account toe", + "ADD_VTIGERCONFIGURATION": "Voeg vTiger-configuratie toe", + "DELETE_VTIGERACCOUNT": "Verwijder vTiger Account", + "DELETE_VTIGERCONFIGURATION": "Verwijder vTiger-configuratie", + "EDIT_VTIGERACCOUNT": "Bewerk vTiger-account", "MODULE_NAME": "vTiger Module naam", "NEW_VTIGERACCOUNT": "Nieuw vTiger-account", - "NEW_VTIGERCONFIGURATION": "Nieuwe vTiger-configuratie", + "NEW_VTIGERCONFIGURATION": "Maak vTiger-configuratie", "TEST_VTIGERACCOUNT": "Test vTiger-account", "VTIGERACCOUNTS": "vTiger-accounts", "VTIGER_USER_NAME": "vTiger-gebruikersnaam", - "ADD_DYNAMICS365ACCOUNT": "Dynamics365-account Toevoegen", - "ADD_DYNAMICS365CONFIGURATION": "Dynamics365-configuratie Toevoegen", + "ADD_DYNAMICS365ACCOUNT": "Voeg een nieuw Dynamics365-account toe", + "ADD_DYNAMICS365CONFIGURATION": "Dynamics365-configuratie toevoegen", "CASE": "Geval", - "DELETE_DYNAMICS365ACCOUNT": "Dynamics365-account Verwijderen", - "DELETE_DYNAMICS365CONFIGURATION": "Dynamics365-configuratie Verwijderen", + "DELETE_DYNAMICS365ACCOUNT": "Dynamics365-account verwijderen", + "DELETE_DYNAMICS365CONFIGURATION": "Dynamics365-configuratie verwijderen", "DYNAMICS365ACCOUNTS": "Dynamics365-accounts", - "EDIT_DYNAMICS365ACCOUNT": "Dynamics365-account Bewerken", + "EDIT_DYNAMICS365ACCOUNT": "Dynamics365-account bewerken", "NEW_DYNAMICS365ACCOUNT": "Nieuw Dynamics365-account", - "NEW_DYNAMICS365CONFIGURATION": "Nieuwe Dynamics365-configuratie", + "NEW_DYNAMICS365CONFIGURATION": "Maak een Dynamics365-configuratie", "PHONECALL": "Telefoongesprek", "TENANTID": "Huurder-ID", "TEST_DYNAMICS365ACCOUNT": "Test Dynamics365-account", "TICKETTYPE": "Tickettype", - "ADD_SERVICENOWACCOUNT": "Nieuw ServiceNow-account Toevoegen", - "ADD_SERVICENOWCONFIGURATION": "ServiceNow-configuratie Toevoegen", - "DELETE_SERVICENOWACCOUNT": "ServiceNow-account Verwijderen", - "DELETE_SERVICENOWCONFIGURATION": "ServiceNow-configuratie Verwijderen", - "EDIT_SERVICENOWACCOUNT": "ServiceNow-account Bewerken", + "ADD_SERVICENOWACCOUNT": "Nieuw ServiceNow-account toevoegen", + "ADD_SERVICENOWCONFIGURATION": "ServiceNow-configuratie toevoegen", + "DELETE_SERVICENOWACCOUNT": "ServiceNow-account verwijderen", + "DELETE_SERVICENOWCONFIGURATION": "ServiceNow-configuratie verwijderen", + "EDIT_SERVICENOWACCOUNT": "ServiceNow-account bewerken", "EMAIL": "E-mail", "NEW_SERVICENOWACCOUNT": "Nieuw ServiceNow-account", - "NEW_SERVICENOWCONFIGURATION": "Nieuw ServiceNow-configuratie", + "NEW_SERVICENOWCONFIGURATION": "Maak ServiceNow-configuratie", "SERVICENOWACCOUNTS": "ServiceNow Accounts", "TEST_SERVICENOWACCOUNT": "Test ServiceNow Account", "TASK": "Taak", @@ -229,12 +229,12 @@ "CONTACTS": "Contact", "LEADS": "Lood", "MODULECREATE": "Module maken", - "ADD_FRESHSALESACCOUNT": "Freshsales-account Toevoegen", - "ADD_FRESHSALESCONFIGURATION": "Freshsales-configuratie Toevoegen", - "DELETE_FRESHSALESACCOUNT": "Freshsales-account Verwijderen", - "DELETE_FRESHSALESCONFIGURATION": "Freshsales Configuration Verwijderen", - "EDIT_FRESHSALESACCOUNT": "Freshsales-account Bewerken", - "EDIT_FRESHSALESCONFIGURATION": "Freshsales-configuratie Bewerken", + "ADD_FRESHSALESACCOUNT": "Voeg Freshsales-account toe", + "ADD_FRESHSALESCONFIGURATION": "Voeg Freshsales-configuratie toe", + "DELETE_FRESHSALESACCOUNT": "Freshsales-account verwijderen", + "DELETE_FRESHSALESCONFIGURATION": "Verwijder Freshsales Configuration", + "EDIT_FRESHSALESACCOUNT": "Bewerk Freshsales-account", + "EDIT_FRESHSALESCONFIGURATION": "Bewerk Freshsales-configuratie", "FRESHSALESACCOUNTS": "Freshsales Accounts", "NEW_FRESHSALESACCOUNT": "Nieuw Freshsales-account", "NEW_FRESHSALESCONFIGURATION": "Nieuwe Freshsales-configuratie", diff --git a/public/app/main/apps/integrations/i18n/pt-BR.json b/public/app/main/apps/integrations/i18n/pt-BR.json index 7c99ef6..66c41f9 100644 --- a/public/app/main/apps/integrations/i18n/pt-BR.json +++ b/public/app/main/apps/integrations/i18n/pt-BR.json @@ -161,18 +161,18 @@ "TEST_SALESFORCEACCOUNT": "Testar conta do Salesforce", "INTEGRATION_TAB": "Guia Integração", "NEW_TAB": "Nova aba", - "DESKACCOUNTS": "Contas de mesa", - "EDIT_DESKACCOUNT": "Editar conta de mesa", - "TEST_DESKACCOUNT": "Conta de teste de mesa", - "DELETE_DESKACCOUNT": "Excluir conta de mesa", + "DESKACCOUNTS": "Contas Desk.com", + "EDIT_DESKACCOUNT": "Editar conta Desk.com", + "TEST_DESKACCOUNT": "Testar conta Desk.com", + "DELETE_DESKACCOUNT": "Excluir conta Desk.com", "CONSUMERKEY": "Chave do consumidor", "CONSUMERSECRET": "Consumidor secreto", "TOKENSECRET": "Segredo do Token", - "ADD_DESKACCOUNT": "Adicionar conta de mesa", - "NEW_DESKACCOUNT": "Nova conta de mesa", - "ADD_DESKCONFIGURATION": "Adicionar configuração de mesa", - "NEW_DESKCONFIGURATION": "Nova configuração de mesa", - "DELETE_DESKCONFIGURATION": "Excluir configuração da mesa", + "ADD_DESKACCOUNT": "Adicionar conta Desk.com", + "NEW_DESKACCOUNT": "Nova conta Desk.com", + "ADD_DESKCONFIGURATION": "Adicionar configuração Desk.com", + "NEW_DESKCONFIGURATION": "Nova configuração Desk.com", + "DELETE_DESKCONFIGURATION": "Excluir configuração Desk.com", "ZOHOACCOUNTS": "Contas Zoho", "EDIT_ZOHOACCOUNT": "Editar conta Zoho", "TEST_ZOHOACCOUNT": "Testar Conta Zoho", @@ -230,16 +230,16 @@ "LEADS": "Conduzir", "MODULECREATE": "Criar módulo", "ADD_FRESHSALESACCOUNT": "Adicionar conta Freshsales", - "ADD_FRESHSALESCONFIGURATION": "Adicionar configuração de vendas frescas", + "ADD_FRESHSALESCONFIGURATION": "Adicionar configuração Freshsales", "DELETE_FRESHSALESACCOUNT": "Excluir conta Freshsales", - "DELETE_FRESHSALESCONFIGURATION": "Excluir configuração de vendas recentes", - "EDIT_FRESHSALESACCOUNT": "Editar conta de vendas frescas", - "EDIT_FRESHSALESCONFIGURATION": "Editar configuração de vendas frescas", - "FRESHSALESACCOUNTS": "Contas de vendas frescas", - "NEW_FRESHSALESACCOUNT": "Nova conta de vendas frescas", - "NEW_FRESHSALESCONFIGURATION": "Nova configuração de vendas frescas", - "NO_FRESHSALESCONFIGURATION_AVAILABLE": "Nenhuma configuração de vendas frescas disponível", - "TEST_FRESHSALESACCOUNT": "Conta de teste de vendas frescas", + "DELETE_FRESHSALESCONFIGURATION": "Excluir configuração Freshsales", + "EDIT_FRESHSALESACCOUNT": "Editar conta Freshsales", + "EDIT_FRESHSALESCONFIGURATION": "Editar configuração Freshsales", + "FRESHSALESACCOUNTS": "Contas Freshsales", + "NEW_FRESHSALESACCOUNT": "Nova conta Freshsales", + "NEW_FRESHSALESCONFIGURATION": "Nova configuração Freshsales", + "NO_FRESHSALESCONFIGURATION_AVAILABLE": "Nenhuma configuração Freshsales disponível", + "TEST_FRESHSALESACCOUNT": "Testar conta Freshsales", "ADDITIONALSEARCHACCOUNT": "Conta de pesquisa adicional", "ADDITIONALSEARCHCONTACT": "Contato de pesquisa adicional", "ADDITIONALSEARCHLEAD": "Lead de pesquisa adicional", diff --git a/public/app/main/apps/jscripty/i18n/de.json b/public/app/main/apps/jscripty/i18n/de.json index 25c5da4..40b33e8 100644 --- a/public/app/main/apps/jscripty/i18n/de.json +++ b/public/app/main/apps/jscripty/i18n/de.json @@ -1,17 +1,17 @@ { "JSCRIPTY": { "NAME": "Name", - "SEARCH_FOR_ANYONE": "Suche", + "SEARCH_FOR_ANYONE": "Suche für Jedermann", "BACK": "Zurück", - "SELECTED": "Ausgewählt", - "SELECT_ALL": "Alles auswählen", - "SELECT_NONE": "Nichts auswählen", + "SELECTED": "Ausgewählte", + "SELECT_ALL": "Alle auswählen", + "SELECT_NONE": "Wählen Sie \"Keine\"", "DESCRIPTION": "Beschreibung", "ERRORS": { - "NAME_REQUIRED": "Name erforderlich", - "PROJECT_REQUIRED": "Projekt erforderlich", - "FIELD_REQUIRED": "Feld erforderlich", - "NAME_MUST_VALID_PATTERN": "Ungültiges Format Name" + "NAME_REQUIRED": "Der Name ist erforderlich", + "PROJECT_REQUIRED": "Das Projekt ist erforderlich", + "FIELD_REQUIRED": "Das Feld ist erforderlich.", + "NAME_MUST_VALID_PATTERN": "Der Name muss in einem gültigen Format geschrieben werden" }, "SAVE": "Speichern", "PROJECTS": "Projekte", @@ -19,7 +19,7 @@ "EDIT_PROJECT": "Projekt bearbeiten", "DELETE_PROJECT": "Projekt löschen", "JSCRIPTY": "Jscripty", - "ID": "ID", + "ID": "Id", "PROJECT": "Projekt", "CREATED_AT": "Erstellt am", "NEW_PROJECT": "Neues Projekt", @@ -31,198 +31,198 @@ "OPEN_CONTACT": "Kontakt öffnen", "HELP": { "NAME": "Nur Zahlen, Buchstaben und Sonderzeichen (._) werden unterstützt.", - "ENABLEUNCOMPLETESAVE": "Speichert die Eingaben, auch wenn Formular noch nicht abgeschlossen", - "SENDUNPAUSEONSUBMIT": "Agentenpause nach Absenden des Formulars beenden" + "ENABLEUNCOMPLETESAVE": "Die dem Bedienplatz-Sitzung zu speichern, auch wenn die Umfrage ist noch nicht abgeschlossen", + "SENDUNPAUSEONSUBMIT": "Beenden Sie am Ende der Umfrage automatisch die Pause des Agenten" }, "PAGE": "Seite", "ROWSPERPAGE": "Zeilen pro Seite", - "OF": "von", - "JSCRIPTYSESSIONS": "Script-Sitzungen", + "OF": "Von", + "JSCRIPTYSESSIONS": "Projektsitzungen", "SESSIONS": "Sitzungen", "STARTTIME": "Startzeit", "ENDTIME": "Endzeit", "MEMBERNAME": "Mitgliedsname", - "CALLERIDNUM": "Telefonnummer des Anrufers", + "CALLERIDNUM": "Rufnummer des Anrufers", "NO_SESSION_AVAILABLE": "Keine Sitzungen verfügbar", - "SESSION_RESULTS": "Ergebnisse", - "SHOW_QUESTIONS_SESSION": "Ergebnisse anzeigen", + "SESSION_RESULTS": "Sitzung Ergebnisse", + "SHOW_QUESTIONS_SESSION": "Sitzung Ergebnisse anzeigen", "ANSWERS": "Antworten", "NO_RESULTS_AVAILABLE": "Keine Ergebnisse verfügbar", - "TOTAL": "Gesamt", + "TOTAL": "Insgesamt", "ANSWER": "Antwort", - "EXPORT_TO_CSV": "In CSV-Datei exportieren", + "EXPORT_TO_CSV": "Export in CSV", "NO_ANSWERS_AVAILABLE": "Keine Antworten vorhanden", - "DELETE_SESSION": "Sitzung löschen", + "DELETE_SESSION": "Session löschen", "RESET_SESSION": "Sitzung neu starten", "YES": "Ja", - "NO": "Nein", - "DO_YOU_WANT_TO_RESET_SESSION": "Sitzung wirklich zurücksetzen?", + "NO": "Keine", + "DO_YOU_WANT_TO_RESET_SESSION": "Möchten Sie die Sitzung zurücksetzen?", "ALL_SURVEY_DATA_WILL_BE_LOST": "Alle Antworten auf die Umfragen gehen verloren!", - "ENABLEUNCOMPLETESAVE": "Speichern wenn unvollständig", + "ENABLEUNCOMPLETESAVE": "Aktivieren Sie unvollständig speichern", "SUBMIT": "Senden", "PROJECT_NOT_AVAILABLE": "Projekt ist nicht verfügbar. Bitte wenden Sie sich an den Administrator", - "COMPLETE": "Abgeschlossen", - "CLONE_PROJECT": "Projekt duplizieren", - "SESSIONS_PROJECT": "Direkt zu den Sitzungen gehen", - "SENDUNPAUSEONSUBMIT": "Agentenpause nach Absenden beenden" + "COMPLETE": "Komplette", + "CLONE_PROJECT": "Klonprojekt", + "SESSIONS_PROJECT": "Gehe zu den Sitzungen", + "SENDUNPAUSEONSUBMIT": "Agent beim Senden abschalten" }, "mwForm": { "form": { - "name": "Titel", - "name.placeholder": "Titel hier eingeben", - "description": "Beschreibung" + "name": "Title", + "name.placeholder": "Form title", + "description": "Description" }, "buttons": { - "addPage": "Seite hinzufügen", - "moveDown": "Nach Unten bewegen", - "moveUp": "Nach Oben bewegen", - "removePage": "Seite löschen", - "remove": "Löschen", - "addElement": "Element hinzufügen", - "questionReady": "Bereit", - "next": "Weiter", - "back": "Zurück", - "submit": "Übermitteln", - "begin": "Start", - "fold": "Einklappen", - "unfold": "Ausklappen", - "edit": "Anpassen", - "clone": "Duplizieren", - "view": "Ansicht" + "addPage": "Add page", + "moveDown": "Move down", + "moveUp": "Move up", + "removePage": "Remove page", + "remove": "Remove", + "addElement": "Add element", + "questionReady": "Ready", + "next": "Next", + "back": "Back", + "submit": "Submit", + "begin": "Begin", + "fold": "Fold", + "unfold": "Unfold", + "edit": "Edit", + "clone": "Clone", + "view": "View" }, "page": { "tab": { - "heading": "Seite {{page}} von {{allPages}}" + "heading": "Page {{page}} of {{allPages}}" }, "elements": { - "empty": "Leere Seite" + "empty": "Empty page" }, - "pageWithNameCheckbox": "Benannt", - "name": "Seitenname" + "pageWithNameCheckbox": "named", + "name": "Page name" }, "pageFlow": { - "afterPage": "Nächste Seite {{page}}:", - "afterQuestionAnswer": "Seitenwechsel basierend auf Antwort", - "goToPage": "Gehe zu Seite {{page.number}}", - "goToNextPage": "Zur nächsten Seite", - "submitForm": "Formular übermitteln" + "afterPage": "After page {{page}}:", + "afterQuestionAnswer": "Go to page based on answer", + "goToPage": "Go to page {{page.number}}", + "goToNextPage": "Continue to next page", + "submitForm": "Submit form" }, "elements": { - "question": "Frage", - "image": "Bild", - "paragraph": "Paragraf" + "question": "Question", + "image": "Image", + "paragraph": "Paragraph" }, "question": { "types": { "text": { - "name": "Kurztext" + "name": "Short text" }, "textarea": { - "name": "Langer Text" + "name": "Long text" }, "radio": { - "name": "Radio-Button" + "name": "Radio" }, "select": { - "name": "Auswahl" + "name": "Select" }, "checkbox": { - "name": "Checkboxen" + "name": "Checkboxes" }, "grid": { - "name": "Raster" + "name": "Grid" }, "priority": { - "name": "Priorität" + "name": "Priority" }, "division": { - "name": "Abteilung" + "name": "Division" }, "number": { - "name": "Nummer" + "name": "Number" }, "date": { - "name": "Datum" + "name": "Date" }, "datetime": { - "name": "Zeitstempel" + "name": "Datetime" }, "time": { - "name": "Zeit" + "name": "Time" }, "email": { - "name": "E-Mail" + "name": "Email" }, "range": { - "name": "Bereich" + "name": "Range" }, "url": { "name": "URL" } }, - "text": "Fragetext", - "type": "Fragetyp", - "required": "Erforderlich", + "text": "Question text", + "type": "Question type", + "required": "Required", "preview": { - "text": "Kurztext", - "textarea": "Langer Text", - "otherAnswer": "Weitere" + "text": "Short answer text", + "textarea": "Long answer text", + "otherAnswer": "Other" }, "division": { - "quantity": "Anzahl", - "unit": "Einheit", - "assignedSumLabel": "Label Zugewiesen", - "fromRequiredLabel": "Label Absender erforderlich" + "quantity": "Quantity", + "unit": "Unit label", + "assignedSumLabel": "Assigned", + "fromRequiredLabel": "from required" }, "priority": { - "sorted": "Sortiert", - "available": "Verfügbar", - "clickToAddItem": "Klicken, um Element hinzuzufügen" + "sorted": "Sorted", + "available": "Available", + "clickToAddItem": "Click to add item" }, "grid": { - "cellInputType": "Eingabetyp", + "cellInputType": "Cell input type", "cellInputTypes": { - "radio": "Radio-Button", + "radio": "Radio", "checkbox": "Checkbox", "text": "Text", - "number": "Checkbox", - "date": "Datum", - "time": "Zeit" + "number": "Number", + "date": "Date", + "time": "Time" }, - "rowLabel": "Zeile {{row}}", - "clickToAddRow": "Klicken, um Zeile hinzuzufügen", - "columnLabel": "Spalte {{col}}", - "clickToAddColumn": "Klicken, um Spalte hinzuzufügen" + "rowLabel": "Row {{row}}", + "clickToAddRow": "Click to add row", + "columnLabel": "Column {{col}}", + "clickToAddColumn": "Click to add column" }, "range": { - "from": "Bereich von", - "to": "bis" + "from": "Range from", + "to": "to" }, "number": { "min": "Min", "max": "Max" }, - "orLabel": "oder ", - "otherLabel": "Weitere: ", - "userAnswer": "Antwort Nutzer", + "orLabel": "or ", + "otherLabel": "Other: ", + "userAnswer": "User answer", "buttons": { - "addOption": "Klicken, um Option hinzuzufügen", - "addOther": "Weitere hinzufügen" + "addOption": "Click to add option", + "addOther": "Add 'Other'" } }, "image": { - "selectImageButton": "Bild auswählen", - "caption": "Screenshot einfügen" + "selectImageButton": "Select image", + "caption": "Image caption" }, "paragraph": { - "placeholder": "Text für Paragrafen eingeben" + "placeholder": "Enter paragraph text" }, "confirmationPage": { - "title": "Bestätigungsseite", - "customMessage": "Nachricht erfolgreiche Übermittlung", - "defaultMessage": "Ihre Eingaben wurden gespeichert", - "errorMessage": "Fehler beim Speichern Ihrer Eingaben", - "pendingMessage": "Ihre Eingaben werden gespeichert" + "title": "Confirmation page", + "customMessage": "Custom confirmation message", + "defaultMessage": "Your response has been saved", + "errorMessage": "Error! Your response has not been saved", + "pendingMessage": "Your response is being saved." } } } diff --git a/public/app/main/apps/jscripty/i18n/pt-BR.json b/public/app/main/apps/jscripty/i18n/pt-BR.json index a39d9fd..1aa6dcf 100644 --- a/public/app/main/apps/jscripty/i18n/pt-BR.json +++ b/public/app/main/apps/jscripty/i18n/pt-BR.json @@ -1,6 +1,6 @@ { "JSCRIPTY": { - "CLONE_PROJECT": "Projeto Clone", + "CLONE_PROJECT": "Clonar projeto", "NAME": "Nome", "SEARCH_FOR_ANYONE": "Procurar", "BACK": "Voltar", @@ -16,17 +16,17 @@ }, "SAVE": "Salvar", "PROJECTS": "Projetos", - "ADD_PROJECT": "Adicionar Projeto", - "EDIT_PROJECT": "Editar Projeto", - "DELETE_PROJECT": "Excluir Projeto", + "ADD_PROJECT": "Adicionar projeto", + "EDIT_PROJECT": "Editar projeto", + "DELETE_PROJECT": "Excluir projeto", "JSCRIPTY": "Jscripty", "ID": "Id", "PROJECT": "Projeto", "CREATED_AT": "Criado em", - "NEW_PROJECT": "Novo Projeto", + "NEW_PROJECT": "Novo projeto", "EDIT": "Editar", "SETTINGS": "Configurações", - "GENERAL": "Feral", + "GENERAL": "General", "BUILDER": "Builder", "PREVIEW": "Visualizar", "OPEN_CONTACT": "Contato aberto", diff --git a/public/app/main/apps/mail/i18n/de.json b/public/app/main/apps/mail/i18n/de.json index c2b9ea0..e258a20 100644 --- a/public/app/main/apps/mail/i18n/de.json +++ b/public/app/main/apps/mail/i18n/de.json @@ -1,197 +1,197 @@ { "MAIL": { "TEXT": "Text", - "TIMES": "Zeitstempel", - "EDIT_AUTOREPLY": "Automatische Antwort bearbeiten", + "TIMES": "Die Anzahl der Zeiten pro Interaktion", + "EDIT_AUTOREPLY": "Bearbeiten Sie automatische Antwort", "AUTOREPLY": "Automatische Antwort", - "SHOW_AUTOREPLY": "Automatische Antwort anzeigen", + "SHOW_AUTOREPLY": "Die automatische Antwort anzeigen", "SHOW_DETAILS": "Details anzeigen", "HIDE_DETAILS": "Details ausblenden", - "TO": "An", + "TO": "Zu", "FROM": "Von", "DATE": "Datum", - "CC": "CC", - "REPLY": "Antworten", + "CC": "Cc", + "REPLY": "Antwort", "REPLY_ALL": "Allen antworten", - "FORWARD": "Weiterleiten", + "FORWARD": "Vorwärts", "SUBJECT": "Betreff", - "BCC": "BCC", + "BCC": "Bcc", "SEND": "Senden", "ATTACHMENT": "Anhang", "ATTACHMENTS": "Anhänge", "NAME": "Name", "MAILQUEUES": "E-Mail Warteschlangen", - "SEARCH_FOR_ANYONE": "Suche", + "SEARCH_FOR_ANYONE": "Suche für Jedermann", "STRATEGY": "Strategie", "ERRORS": { - "TEXT_REQUIRED": "Text erforderlich", - "NAME_REQUIRED": "Name erforderlich", - "AGENT_TIMEOUT_REQUIRED": "Zeitüberschreitung Agent erforderlich", - "EMAIL_ADDRESS_REQUIRED": "E-Mail Adresse erforderlich", - "EMAIL_ADDRESS_MUST_VALID": "Ungültiges Format E-Mail", - "HOST_REQUIRED": "Host erforderlich", - "USERNAME_REQUIRED": "Nutzername erforderlich", - "PORT_REQUIRED": "Port erforderlich", - "CONNTIMEOUT_REQUIRED": "Zeitüberschreitung Verbindung erforderlich", - "AUTHTIMEOUT_REQUIRED": "Zeitüberschreitung für Authentifizierung erforderlich", - "ACCEPTURL_MUST_VALID_URL": "Format ungültig URL", - "TIMEOUT_REQUIRED": "Zeitüberschreitung erforderlich", - "REJECTURL_MUST_VALID_URL": "Format Ungültig URL bei Ablehnen", - "CLOSEURL_MUST_VALID_URL": "Format ungültig URL bei Schließen", - "AGENT_REQUIRED": "Agent erforderlich", - "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung muss größer oder gleich sein als", - "DISPOSITION_REQUIRED": "Qualifizierung erforderlich", - "CONDITION_REQUIRED": "Bedingung erforderlich", - "TRUEPRIORITY_REQUIRED": "Priorität bei \"true\" erforderlich", - "FALSEPRIORITY_REQUIRED": "Priorität bei \"false\" erforderlich", - "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Priorität bei \"true\" muss größer oder gleich sein als", - "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Priorität bei \"false\" muss größer oder gleich sein als", - "PRIORITY_REQUIRED": "Priorität erforderlich", - "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Priorität muss größer oder gleich sein als", - "QUEUE_REQUIRED": "Warteschlange erforderlich", - "LIST_REQUIRED": "Liste erforderlich", - "PASSWORD_REQUIRED": "Passwort erforderlich", - "SERVICE_REQUIRED": "Dienst erforderlich,", - "IMAP_HOST_REQUIRED": "IMAP-Host erforderlich", - "IMAP_PORT_REQUIRED": "IMAP-Port erforderlich", - "SMTP_HOST_REQUIRED": "SMTP-Host erforderlich", - "SMTP_PORT_REQUIRED": "SMTP-Port erforderlich", - "CONFIRM_NOT_MATCH": "Die Passwörter stimmen nicht überein", - "KEY_MAX_LENGTH": "Schlüssel darf eine maximale Länge von {{max}} haben", - "KEY_REQUIRED": "Schlüssel erforderlich", - "TEXT_MAX_LENGTH": "Text darf eine maximale Länge von {{max}} haben", - "VALUE_REQUIRED": "Wert erforderlich", - "FONT_SIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Schriftgröße muss größer oder gleich sein als", - "FONT_SIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Schriftgröße muss kleiner oder gleich sein als", - "FONT_SIZE_REQUIRED": "Schriftgröße erforderlich", - "COMMAND_REQUIRED": "Eingabe erforderlich", - "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung Agent muss größer oder gleich sein als", - "NAME_MUST_VALID_PATTERN": "Format ungültig Name", - "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung muss kleiner oder gleich sein als", - "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung Agent muss kleiner oder gleich sein als", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wartezeit Agent muss größer oder gleich sein als", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Wartezeit Agent muss kleiner oder gleich sein als", - "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Wartezeit Agent erforderlich", - "TAG_REQUIRED": "Tag erforderlich", - "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung Transfer an Agent muss größer oder gleich sein als", - "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung Transfer an Agent muss kleiner oder gleich sein als", - "AGENTTRANSFERTIMEOUT_REQUIRED": "Zeitüberschreitung Transfer an Agent erforderlich", - "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung Transfer an Warteschlange muss größer oder gleich sein als", - "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung Transfer an Warteschlange muss kleiner oder gleich sein als", - "QUEUETRANSFERTIMEOUT_REQUIRED": "Zeitüberschreitung Transfer an Warteschlange erforderlich", - "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "PausenID bei Qualifizierung erforderlich", - "REPLY_TYPE_REQUIRED": "Antworttyp erforderlich", + "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", + "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", + "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_REQUIRED": "Pflichtfeld", + "COMMAND_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", + "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_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_REQUIRED": "Pflichtfeld", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Pflichtfeld", + "REPLY_TYPE_REQUIRED": "Pflichtfeld", "FIELD_REQUIRED": "Pflichtfeld" }, - "AGENT_TIMEOUT": "Zeitüberschreitung Agent", + "AGENT_TIMEOUT": "Agent Timeout", "DESCRIPTION": "Beschreibung", "ADD_MAILQUEUE": "E-Mail Warteschlange hinzufügen", "EDIT_MAILQUEUE": "E-Mail Warteschlange bearbeiten", "DELETE_MAILQUEUE": "E-Mail Warteschlange löschen", "SETTINGS": "Einstellungen", - "GENERAL": "Allgemeine Einstellungen", + "GENERAL": "Allgemein", "SAVE": "Speichern", "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 Konto löschen", - "DISPOSITIONS": "Qualifizierungen", + "EDIT_MAILACCOUNT": "E-Mail-Konto bearbeiten", + "DELETE_MAILACCOUNT": "E-Mail-Konten löschen", + "DISPOSITIONS": "Bestimmungen", "WEBHOOKS": "WebHooks", - "ACTIONS": "Routing", - "OTHERS": "Weitere", + "ACTIONS": "Aktionen", + "OTHERS": "Andere", "LIST": "Liste", "TEMPLATE": "Vorlage", "FIDELITY": "Treue", - "SERVICE": "Dienst", + "SERVICE": "Service", "CREATED_AT": "Erstellt am", "ACCEPT": "Akzeptieren", - "ACCEPTMETHOD": "Methode akzeptieren", + "ACCEPTMETHOD": "Die Methode", "ACCEPTURL": "URL akzeptieren", "REJECT": "Ablehnen", "REJECTMETHOD": "Methode ablehnen", "REJECTURL": "URL ablehnen", - "CLOSE": "Schließen", - "CLOSEMETHOD": "Methode schließen", - "CLOSEURL": "URL schließen", - "WHITELABEL": "WhiteLabel", - "SIGNATURE": "Signatur", + "CLOSE": "In der Nähe", + "CLOSEMETHOD": "In der Nähe Methode", + "CLOSEURL": "Der URL", + "WHITELABEL": "White Label", + "SIGNATURE": "Unterschrift", "IMAP": "IMAP", "HOST": "Host", - "USERNAME": "Nutzername", - "PORT": "Port", + "USERNAME": "Benutzername", + "PORT": "Hafen", "MAILBOX": "Mailbox", "FILTER": "Filter", - "CONNTIMEOUT": "Zeitüberschreitung Verbindung (Sek)", - "AUTHTIMEOUT": "Zeitüberschreitung Authentifizierung (Sek)", + "CONNTIMEOUT": "Connection Timeout [sek]", + "AUTHTIMEOUT": "Authentication Timeout [sek]", "DELETE": "E-Mails vom Server löschen", "SSL": "SSL", "KEEPALIVE": "Keepalive", - "POLLING": "Abfrageintervall", + "POLLING": "Polling", "SMTP": "SMTP", - "SELECTED": "Ausgewählt", - "SELECT_ALL": "Alles auswählen", - "SELECT_NONE": "Nichts auswählen", + "SELECTED": "Ausgewählte", + "SELECT_ALL": "Alle auswählen", + "SELECT_NONE": "Wählen Sie \"Keine\"", "BACK": "Zurück", "MAIL": "E-Mail", - "ID": "ID", - "TIMEOUT": "Zeitüberschreitung", + "ID": "Id", + "TIMEOUT": "Timeout", "PASSWORD": "Passwort", - "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", + "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", "NEW_MAILQUEUE": "Neue E-Mail Warteschlange", - "NEW_MAILACCOUNT": "Neues E-Mail Konto", - "NO_AVAILABLE_INFO": "Keine Informationen verfügbar", - "ALL_TEAMS": "Alle Teams", + "NEW_MAILACCOUNT": "Neue E-Mail Konto", + "NO_AVAILABLE_INFO": "Keine verfügbaren Info", + "ALL_TEAMS": "Alle Mannschaften", "SELECTED_TEAMS": "Ausgewählte Teams", "HELP": { "NAME": "Nur Zahlen, Buchstaben und Sonderzeichen (._) werden unterstützt.", - "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", + "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", "FONT_SIZE": "Standard Schriftgröße", - "MARK_AS_UNREAD": "Deaktivieren/Aktivieren um die letzte Nachricht einer Interaktion als ungelesen zu markieren", - "MANDATORYDISPOSITION": "Qualifizierung erforderlich", - "MANDATORYDISPOSITIONPAUSEID": "PausenID während Qualifizierung", + "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", "CLOUD_PROVIDER": "Für die Authentifizierung verwendeter Cloud-Anbieter" }, "PAGE": "Seite", "ROWSPERPAGE": "Zeilen pro Seite", - "OF": "von", - "TEAMADD_MAILQUEUE": "Team zur Warteschlange hinzufügen", - "AGENTADD_MAILQUEUE": "Agenten zur Warteschlange hinzufügen", + "OF": "Von", + "TEAMADD_MAILQUEUE": "Team Chat Warteschlange hinzufügen", + "AGENTADD_MAILQUEUE": "Agent zu Chatten Warteschlange hinzufügen", "ALL_AGENTS": "Alle Agenten", "SELECTED_AGENTS": "Ausgewählte Agenten", "AGENT": "Agent", - "EDIT_AGENT": "Agenten bearbeiten", - "EDIT_CLOSE": "Verhalten bei Schließen bearbeiten", - "DISPOSITION": "Qualifizierung", - "GOTOIF": "GeheZuWenn (GoToIf)", - "EDIT_GOTOIF": "Bedingung bearbeiten und Priorität zuweisen", - "CONDITION": "Bedingung", - "TRUEPRIORITY": "Priorität, wenn erfüllt (true)", - "FALSEPRIORITY": "Priorität, wenn nicht erfüllt (false)", - "GOTOP": "Priorität setzen (GoToP)", - "EDIT_GOTOP": "GoToP bearbeiten", + "EDIT_AGENT": "Agent bearbeiten", + "EDIT_CLOSE": "Bearbeiten Schließen", + "DISPOSITION": "Disposition", + "GOTOIF": "GotoIf", + "EDIT_GOTOIF": "Bearbeiten GotoIf", + "CONDITION": "Zustand", + "TRUEPRIORITY": "Wahre Priorität", + "FALSEPRIORITY": "Falsche Priorität", + "GOTOP": "GotoP", + "EDIT_GOTOP": "GotoP bearbeiten", "PRIORITY": "Priorität", - "NOOP": "Log erstellen (NoOp)", - "EDIT_NOOP": "Log-Erstellung bearbeiten", + "NOOP": "Noop", + "EDIT_NOOP": "Bearbeiten Noop", "VALUE": "Wert", "QUEUE": "Warteschlange", "EDIT_QUEUE": "Warteschlange bearbeiten", - "INTERACTIONS": "Interaktionen", - "STARTEDAT": "Startdatum", + "INTERACTIONS": "Wechselwirkungen", + "STARTEDAT": "Gestartet am", "CONTACT": "Kontakt", - "CLOSEDAT": "Geschlossen am", - "NOTES": "Anmerkungen", - "NO_INTERACTION_AVAILABLE": "Keine neuen Interaktionen verfügbar", + "CLOSEDAT": "Geschlossen", + "NOTES": "Hinweise", + "NO_INTERACTION_AVAILABLE": "Es sind keine Wechselwirkungen zur Verfügung", "ACTIVE": "Aktiv", - "SECURE": "Sicher", + "SECURE": "Sichere", "AUTHENTICATION": "Authentifizierung", "SMTP_HOST": "SMTP-Host", "SMTP_PORT": "SMTP-Port", @@ -199,129 +199,129 @@ "IMAP_PORT": "IMAP-Port", "CONFIRM_PASSWORD": "Passwort bestätigen", "SELECT_STATUS": "Status auswählen", - "OPENED": "Geöffnet", + "OPENED": "Öffnen", "CLOSED": "Geschlossen", "ALL": "Alle", "SELECT_ACCOUNT": "Konto auswählen", "STATUS": "Status", "ACCOUNT": "Konto", - "OPEN": "Offen", + "OPEN": "Öffnen", "KEY": "Schlüssel", "SMTPSERVICE": "SMTP-Dienst", - "UNPAUSE": "Pause abbrechen", - "DEFAULT_PAUSE": "Standardpause", + "UNPAUSE": "Pause beenden", + "DEFAULT_PAUSE": "Standard Pause", "LOGOUT": "An-/Abmelden", - "AGENTADD_QUEUE": "Agenten zur Warteschlange hinzufügen", - "VOICE": "Anrufe", + "AGENTADD_QUEUE": "Agent E-Mail Warteschlange hinzufügen", + "VOICE": "Voice", "CHAT": "Chat", - "SMS": "SMS", - "OPENCHANNEL": "Offener Kanal", + "SMS": "Sms", + "OPENCHANNEL": "Channel öffnen", "FAX": "Fax", "REALTIME": "Echtzeit", "AGENTS": "Agenten", "QUEUES": "Warteschlangen", "ACCOUNTS": "Konten", - "FULLNAME": "Vollständiger Name", - "INTERNAL": "Intern", - "PHONE_STATE": "Status Nebenstelle", - "PHONE_STATUS": "SIP-Status Nebenstelle", + "FULLNAME": "Voller Name", + "INTERNAL": "Interne", + "PHONE_STATE": "Telefonstatus", + "PHONE_STATUS": "Telefonstatus", "PAUSE": "Pause", "LOGGED_IN": "Angemeldet", "PAUSED": "Angehalten", "READY": "Bereit", "WAITING": "Warten", - "TOTAL": "Gesamt", - "IN": "Eingehend", - "OUT": "Ausgehend", + "TOTAL": "Insgesamt", + "IN": "In", + "OUT": "Aus", "IMAP_STATUS": "IMAP-Status", "SMTP_STATUS": "SMTP-Status", "DISABLED": "Deaktiviert", "CONNECTED": "Verbunden", - "NEVER_VERIFIED": "Noch nicht verifiziert", + "NEVER_VERIFIED": "Nie verifiziert", "ERROR": "Fehler", "EDIT_ACCOUNT": "Konto bearbeiten", - "VERIFY_SMTP": "SMTP-Einstellungen prüfen", + "VERIFY_SMTP": "Überprüfen Sie die SMTP-", "VERIFIED": "Überprüft", - "VERIFYSMTP_MAILACCOUNT": "SMTP-Accounteinstellungen prüfen", - "GOTOREALTIME_MAILACCOUNT": "Direkt zur Echtzeitansicht Konto", - "GOTO_MAILACCOUNT": "Zum E-Mail Konto gehen", + "VERIFYSMTP_MAILACCOUNT": "Überprüfen Sie die SMTP-", + "GOTOREALTIME_MAILACCOUNT": "In Echtzeit, E-Mail Konto", + "GOTO_MAILACCOUNT": "In Echtzeit, E-Mail Konto", "UNKNOWN": "Unbekannt", - "UNREGISTERED": "Nicht registriert", + "UNREGISTERED": "Unregistrierte", "UNAVAILABLE": "Nicht verfügbar", - "NOT_INUSE": "Nicht in Verwendung", + "NOT_INUSE": "Nicht in Gebrauch", "REACHABLE": "Erreichbar", - "IN_USE": "In Verwendung", - "AGENTSADD_QUEUE": "Agenten zur Warteschlange hinzufügen", - "INFO": "Information", + "IN_USE": "Im Einsatz", + "AGENTSADD_QUEUE": "Agenten zu Warteschlange hinzufügen", + "INFO": "Info", "NO_AGENT_ONLINE": "Kein Agent Online", - "GOTOREALTIME_MAILQUEUE": "Direkt zur Echtzeit-Warteschlange", - "PARTIALPAUSE": "Teilpause", + "GOTOREALTIME_MAILQUEUE": "In Echtzeit, E-Mail Warteschlange", + "PARTIALPAUSE": "Lastschriftzahlung teilweise Pause", "BUSY": "Besetzt", "TIMER": "Timer", "IDLE": "Leerlauf", "CAPACITY": "Kapazität", - "SPYINTERACTION": "Anzeigen", + "SPYINTERACTION": "Spy", "ADD_NOTE": "Notiz hinzufügen", - "NOTE": "Notiz", + "NOTE": "Hinweis", "TAGS": "Tags", - "INTERACTIONS_MAILACCOUNT": "Direkt zu den Interaktionen", - "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", + "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", "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": "Zwischenstatus hinzufügen", - "DELETE_MAILSUBSTATUS": "Zwischenstatus löschen", - "EDIT_MAILSUBSTATUS": "Zwischenstatus bearbeiten", - "MAILSUBSTATUSES": "E-Mail Zwischenstatus", - "NEW_MAILSUBSTATUS": "Neuer Zwischenstatus", - "SEND_AS": "Senden als", - "COMMAND": "Eingabe", + "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", "EDIT_SYSTEM": "System bearbeiten", "SYSTEM": "System", - "VARIABLE": "Variabel", + "VARIABLE": "Variable", "NOTIFICATION": "Benachrichtigung", - "NOTIFICATIONSHAKE": "Schütteln", - "NOTIFICATIONSOUND": "Sound abspielen", + "NOTIFICATIONSHAKE": "Shake", + "NOTIFICATIONSOUND": "Klingen", "NOTIFICATIONTEMPLATE": "Vorlage", - "WAITFORTHEASSIGNEDAGENT": "Auf zugewiesenen Agenten warten", + "WAITFORTHEASSIGNEDAGENT": "Warte auf den zugewiesenen Agenten", "EDIT_TAG": "Tag bearbeiten", - "TAG": "Tag", - "AGENTTRANSFER": "Transfer an Agenten erlauben", - "AGENTTRANSFERTIMEOUT": "Zeitüberschreitung für Agententransfer", - "QUEUETRANSFER": "Transfer in Warteschlange erlauben", - "QUEUETRANSFERTIMEOUT": "Zeitüberschreitung für Warteschlangentransfer", - "TRANSFER": "Weiterleitung", - "AGENTADD_MAILACCOUNT": "Agenten zum E-Mail Konto hinzufügen", + "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", "YOU_ARE_REGISTERED_AS_A": "Sie sind registriert als", - "CANNEDANSWERS": "Textvorlagen", - "DOWNLOAD_INTERACTION": "Interaktion herunterladen", - "MAILCANNEDANSWERS": "E-Mail Textvorlagen", - "LOGIN_TIME": "Zeit angemeldet", - "PAUSE_TIME": "Zeit in Pause", + "CANNEDANSWERS": "Vordefinierte Antworten", + "DOWNLOAD_INTERACTION": "Herunterladen", + "MAILCANNEDANSWERS": "Vordefinierte Antworten", + "LOGIN_TIME": "Login-Zeit", + "PAUSE_TIME": "Pausenzeit", "DOWNLOAD": "Herunterladen", - "DOWNLOAD_WITHOUT_ATTACHMENTS": "Herunterladen ohne Anhänge", - "DOWNLOAD_WITH_ATTACHMENTS": "Herunterladen inkl. Anhänge", - "TEAMS_ASSOCIATION": "Teamzuweisung", - "MANDATORYDISPOSITION": "Qualifizierung erforderlich", - "MANDATORYDISPOSITIONPAUSEID": "PausenID während Qualifizierung", - "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", + "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", "LASTMESSAGE": "Letzte Nachricht", "REPLY_TYPE": "Antworttyp", "CLOUD_PROVIDER": "Cloud-Anbieter", diff --git a/public/app/main/apps/mail/i18n/pt-BR.json b/public/app/main/apps/mail/i18n/pt-BR.json index 702bc58..3c1e70e 100644 --- a/public/app/main/apps/mail/i18n/pt-BR.json +++ b/public/app/main/apps/mail/i18n/pt-BR.json @@ -24,9 +24,9 @@ "COMMAND": "Comando", "VARIABLE": "Variável", "SEND_AS": "Enviar como", - "NEW_MAILSUBSTATUS": "Novo substatus", - "ADD_MAILSUBSTATUS": "Adicionar substatus", - "MAILSUBSTATUSES": "Substatus do email", + "NEW_MAILSUBSTATUS": "Novo Sub Status", + "ADD_MAILSUBSTATUS": "Adicionar status de sub", + "MAILSUBSTATUSES": "Sub-status do email", "EDIT_MAILSUBSTATUS": "Editar", "DELETE_MAILSUBSTATUS": "Excluir", "FONT_FAMILY": "Família de fontes", @@ -43,7 +43,7 @@ "SHOW_ORIGINAL_MESSAGE": "Mostrar mensagem original", "PENDING": "Pendente", "SEND_AS_PENDING": "Enviar como pendente", - "SEND_AND_CLOSE": "Enviar e fechar", + "SEND_AND_CLOSE": "Enviar e Fechar", "CANNED_ANSWER_NOT_FOUND": "Nenhuma resposta predefinida foi encontrada", "CANNED_ANSWER_SEARCH": "Digite um texto para pesquisar uma resposta automática", "SPYINTERACTION": "Espião", @@ -52,10 +52,10 @@ "TAGS": "Tags", "NO_AGENT_ONLINE": "Nenhum agente online", "GOTOREALTIME_MAILQUEUE": "Ir para a fila de email em tempo real", - "PARTIALPAUSE": "Pausa parcial", + "PARTIALPAUSE": "Pausa Parcial", "BUSY": "Ocupado", "TIMER": "Cronômetro", - "IDLE": "Ocioso", + "IDLE": "Disponível", "CAPACITY": "Capacidade", "UNPAUSE": "Fim da Pausa", "DEFAULT_PAUSE": "Pausa Padrão", @@ -63,7 +63,7 @@ "AGENTADD_QUEUE": "Adicionar agente à fila de email", "VOICE": "Voz", "CHAT": "Chat", - "SMS": "SMS", + "SMS": "Sms", "OPENCHANNEL": "Open channel", "FAX": "Fax", "REALTIME": "Tempo real", @@ -86,12 +86,12 @@ "SMTP_STATUS": "SMTP Status", "DISABLED": "Desativado", "CONNECTED": "Conectado", - "NEVER_VERIFIED": "Nunca verificado", + "NEVER_VERIFIED": "Nunca Verificado", "ERROR": "Erro", "EDIT_ACCOUNT": "Editar conta", - "VERIFY_SMTP": "Verificar SMTP", + "VERIFY_SMTP": "Verificar o SMTP", "VERIFIED": "Verificado", - "VERIFYSMTP_MAILACCOUNT": "Verificar SMTP", + "VERIFYSMTP_MAILACCOUNT": "Verificar o SMTP", "GOTOREALTIME_MAILACCOUNT": "Ir para a conta de e-mail em tempo real", "GOTO_MAILACCOUNT": "Ir para a conta de e-mail em tempo real", "TEXT": "Texto", @@ -108,7 +108,7 @@ "REPLY": "Resposta", "REPLY_ALL": "Responder todos", "FORWARD": "Frente", - "SUBJECT": "Assunto", + "SUBJECT": "Sujeito", "BCC": "Bcc", "SEND": "Enviar", "ATTACHMENT": "Anexo", @@ -116,7 +116,7 @@ "NAME": "Nome", "MAILQUEUES": "Fila de Emails", "SEARCH_FOR_ANYONE": "Procurar", - "STRATEGY": "Estratégia", + "STRATEGY": "Estrategia", "ERRORS": { "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", @@ -187,7 +187,7 @@ "SAVE": "Salvar", "MAILACCOUNTS": "Contas de Email", "EMAIL_ADDRESS": "Endereço de Email", - "ADD_MAILACCOUNT": "Adicionar conta de email", + "ADD_MAILACCOUNT": "Adicionar conta de Email", "EDIT_MAILACCOUNT": "Editar conta de Email", "DELETE_MAILACCOUNT": "Excluir conta de Email", "DISPOSITIONS": "Disposições", @@ -203,12 +203,12 @@ "ACCEPTMETHOD": "Aceite o método", "ACCEPTURL": "Aceitar URL", "REJECT": "Rejeitar", - "REJECTMETHOD": "Rejeitar método", + "REJECTMETHOD": "Rejeitar Método", "REJECTURL": "Rejeitar URL", "CLOSE": "Fechar", "CLOSEMETHOD": "Fechar Metodo", "CLOSEURL": "Fechar URL", - "WHITELABEL": "Campo em branco", + "WHITELABEL": "White Label", "SIGNATURE": "Assinatura", "IMAP": "IMAP", "HOST": "Host", @@ -241,7 +241,7 @@ "NEW_MAILACCOUNT": "Nova conta de email", "NO_AVAILABLE_INFO": "Nenhuma informação disponível", "ALL_TEAMS": "Todas as equipes", - "SELECTED_TEAMS": "Equipes selecionadas", + "SELECTED_TEAMS": "Equipes Selecionadas", "HELP": { "FONT_FAMILY": "Default Font Family", "FONT_SIZE": "Default Font Size", @@ -254,13 +254,13 @@ "MANDATORYDISPOSITIONPAUSEID": "Pausar para usar quando a disposição obrigatória estiver ativada", "CLOUD_PROVIDER": "Provedor de nuvem usado para autenticação" }, - "PAGE": "Página", - "ROWSPERPAGE": "Linhas por página", + "PAGE": "Pagina", + "ROWSPERPAGE": "Linhas por Página", "OF": "do", "TEAMADD_MAILQUEUE": "Adicionar equipe à fila de email", "AGENTADD_MAILQUEUE": "Adicionar agente à fila de email", "ALL_AGENTS": "Todos os agentes", - "SELECTED_AGENTS": "Agentes selecionados", + "SELECTED_AGENTS": "Agentes Selecionados", "AGENT": "Agente", "EDIT_AGENT": "Editar agente", "EDIT_CLOSE": "Editar Fechar", @@ -269,7 +269,7 @@ "EDIT_GOTOIF": "Editar GotoIf", "CONDITION": "Condição", "TRUEPRIORITY": "Verdadeira prioridade", - "FALSEPRIORITY": "Falsa Prioridade", + "FALSEPRIORITY": "Falsa prioridade", "GOTOP": "GotoP", "EDIT_GOTOP": "Editar GotoP", "PRIORITY": "Prioridade", @@ -293,7 +293,7 @@ "IMAP_PORT": "IMAP Port", "CONFIRM_PASSWORD": "Confirme a Senha", "SELECT_STATUS": "Selecione o status", - "OPENED": "Aberto", + "OPENED": "Abrir", "CLOSED": "Fechadas", "ALL": "Todos", "SELECT_ACCOUNT": "Selecione uma conta", @@ -311,12 +311,12 @@ "AGENTSADD_QUEUE": "Adicionar agentes à fila de email", "INFO": "Info", "INTERACTIONS_MAILACCOUNT": "Ir para Interações", - "REFRESH_INTERACTIONS": "Atualizar interações", + "REFRESH_INTERACTIONS": "Atualizar Interações", "DELETE_INTERACTION": "Excluir interação", "AGENTADD_MAILACCOUNT": "Adicionar agente à conta de email", "TEAMS_ASSOCIATION": "Associação de equipes", "MANDATORYDISPOSITION": "Disposição obrigatória", - "MANDATORYDISPOSITIONPAUSEID": "Pausa obrigatória para disposição", + "MANDATORYDISPOSITIONPAUSEID": "Pausar para usar se a disposição obrigatória estiver ativada", "ADVANCED": "Avançado", "TOOLTIP_SCREENRECORDING_OFF": "Gravação de tela disponível", "TOOLTIP_SCREENRECORDING_ON": "Gravação de tela em andamento", diff --git a/public/app/main/apps/motiondialer/i18n/de.json b/public/app/main/apps/motiondialer/i18n/de.json index 3c09c82..52050f2 100644 --- a/public/app/main/apps/motiondialer/i18n/de.json +++ b/public/app/main/apps/motiondialer/i18n/de.json @@ -1,596 +1,596 @@ { "MOTIONDIALER": { - "MOVE_HOPPERFINAL": "Kontakt bewegen zu Abgeschlossen", + "MOVE_HOPPERFINAL": "Kontakt wiederherstellen", "RESTORECONTACTS": "Kontakte wiederherstellen", - "NO_SUCH_NUMBER": "Gegenstelle nicht gefunden", - "DIALORDERBYSCHEDULEDAT": "Reihenfolge Wählen nach Planungsdatum", - "ASC": "Aufsteigend", - "DESC": "Absteigend", - "RECALLAGENT": "Agenten erneut anrufen", - "DIALRECALLINQUEUE": "In der Warteschlange anrufen", - "DIALRECALLMETIMEOUT": "Zeitlimit Reservierung Anruf [min]", - "RECALLME": "Wiedervorlage an Agenten", + "NO_SUCH_NUMBER": "Keine solche Nummer", + "DIALORDERBYSCHEDULEDAT": "Bestellung Durch scheduledat", + "ASC": "ASC", + "DESC": "DESC", + "RECALLAGENT": "Agent abrufen", + "DIALRECALLINQUEUE": "In der Warteschlange abrufen", + "DIALRECALLMETIMEOUT": "Erinnere mich Timeout [min]", + "RECALLME": "Mich erinnern", "RECALLFAILEDTIMEOUT": "Rückruf fehlgeschlagen", - "PREVIEW_CAMPAIGN": "Vorschau-Kampagne", - "PREVIEW_CAMPAIGNS": "Vorschau-Kampagnen", - "AMD": "Anrufbeantwortererkennung (AMD)", - "AMDTOTALANALYSISTIME": "Zeit für Analyse AB", - "AMDACTIVE": "AB-Erkennung aktiv", - "AMDINITIALSILENCE": "AB-Erkennung Stille bei Aufbau", - "AMDGREETING": "AB-Erkennung Nachricht", + "PREVIEW_CAMPAIGN": "Vorschau Kampagnen", + "PREVIEW_CAMPAIGNS": "Vorschau Kampagnen", + "AMD": "Sternchen Anrufbeantwortererkennung (AMD)", + "AMDTOTALANALYSISTIME": "Insgesamt Analyse Zeit", + "AMDACTIVE": "AMD", + "AMDINITIALSILENCE": "Erste Stille", + "AMDGREETING": "Gruß", "AMDAFTERGREETINGSILENCE": "Stille nach Begrüßung", - "AMDSILENCETHRESHOLD": "Stille Schwellwert", - "AMDMINWORDLENGTH": "Min. Wortlänge", - "AMDBETWEENWORDSSILENCE": "Stille zwischen 2 Worten", - "AMDMAXIMUMWORDLENGTH": "Max. Wortlänge", - "AMDMAXIMUMNUMBEROFWORDS": "Maximale Anzahl Wörter", - "GOTO_QUEUECAMPAIGN": "Direkt zur Warteschlange", - "GOTOREALTIME_QUEUECAMPAIGN": "Direkt zur Echtzeit-Warteschlange", - "GOTO_IVRCAMPAIGN": "Direkt zur IVR-Kampagne", - "GOTOREALTIME_IVRCAMPAIGN": "Direkt zur Echtzeit-Warteschlange (IVR)", + "AMDSILENCETHRESHOLD": "Stille Schwellenwert", + "AMDMINWORDLENGTH": "Min. Wort Länge", + "AMDBETWEENWORDSSILENCE": "Die Stille zwischen den Worten", + "AMDMAXIMUMWORDLENGTH": "Maximale Wortlänge", + "AMDMAXIMUMNUMBEROFWORDS": "Maximale Anzahl der Wörter", + "GOTO_QUEUECAMPAIGN": "In Echtzeit, wenn Warteschlange Kampagnen gehen", + "GOTOREALTIME_QUEUECAMPAIGN": "In Echtzeit, wenn Warteschlange Kampagnen gehen", + "GOTO_IVRCAMPAIGN": "In Echtzeit, Ivr-Kampagnen gehen", + "GOTOREALTIME_IVRCAMPAIGN": "In Echtzeit, Ivr-Kampagnen gehen", "LOGOUT": "An-/Abmelden", "EDIT_CAMPAIGN": "Kampagne bearbeiten", - "LIMITED": "Limitiert", - "IVR_CAMPAIGNS": "IVR-Kampagnen", - "MOTIONDIALER": "Outbound-Dialer", - "QUEUECAMPAIGNS": "Kampagnen", + "LIMITED": "Begrenzt", + "IVR_CAMPAIGNS": "Ivr-Kampagnen", + "MOTIONDIALER": "Motion Bull", + "QUEUECAMPAIGNS": "Warteschlange Kampagnen", "IVRCAMPAIGNS": "IVR-Kampagnen", "MANAGED": "Verwaltet", "AVAILABLE_CONTACTS_FINISHED": "Kontakte abgeschlossen", - "HISTORY": "Verlauf", - "SCHEDULEDAT": "Geplant am", - "HOPPERBLACKS": "Schwarze Liste Kontakte in Ausführung", - "NO_HOPPERBLACK_AVAILABLE": "Keine Einträge vorhanden", - "HOPPERFINALS": "Kontakte abgeschlossen", - "NO_HOPPERFINAL_AVAILABLE": "Keine Einträge vorhanden", - "HOPPERHISTORIES": "Kontaktverlauf", - "NO_HOPPERHISTORY_AVAILABLE": "Keine Einträge vorhanden", - "DELETE_HOPPERHISTORY": "Verlauf löschen", - "DELETE_HOPPERFINAL": "Abgeschlossenen Kontakt löschen", - "CONTACTID": "KontaktID", + "HISTORY": "Geschichte", + "SCHEDULEDAT": "Geplant für", + "HOPPERBLACKS": "Hopper Blacklist", + "NO_HOPPERBLACK_AVAILABLE": "Keine Reihen verfügbar", + "HOPPERFINALS": "Hopper Endg.", + "NO_HOPPERFINAL_AVAILABLE": "Keine Reihen verfügbar", + "HOPPERHISTORIES": "Hopper Geschichte", + "NO_HOPPERHISTORY_AVAILABLE": "Keine Reihen verfügbar", + "DELETE_HOPPERHISTORY": "Löschen", + "DELETE_HOPPERFINAL": "Löschen", + "CONTACTID": "Kontakt-ID", "STARTTIME": "Startzeit", - "RESPONSETIME": "Antwortzeit", + "RESPONSETIME": "Reaktionszeit", "ENDTIME": "Endzeit", "STATUS": "Status", - "HOPPERS": "Kontakte in Ausführung", - "NO_HOPPER_AVAILABLE": "Keine Informationen verfügbar", - "EDIT_HOPPER": "Kontakte in Ausführung bearbeiten", - "DELETE_HOPPER": "Kontakte in Ausführung löschen", - "FINAL": "Abgeschlossen", + "HOPPERS": "Hopper", + "NO_HOPPER_AVAILABLE": "Keine Reihen verfügbar", + "EDIT_HOPPER": "Bearbeiten Hopper", + "DELETE_HOPPER": "Löschen Hopper", + "FINAL": "Endg.", "BLACKLIST": "Schwarze Liste", "NAME": "Name", - "VOICEQUEUES": "Anruf-Warteschlangen", - "SEARCH_FOR_ANYONE": "Suche", + "VOICEQUEUES": "Voice Warteschlangen", + "SEARCH_FOR_ANYONE": "Suche für Jedermann", "BACK": "Zurück", - "SELECTED": "Ausgewählt", - "SELECT_ALL": "Alles auswählen", - "SELECT_NONE": "Nichts auswählen", - "DELETE_VOICEDISPOSITION": "Qualifizierung für Anrufe löschen", - "EDIT_VOICEDISPOSITION": "Qualifizierung für Anrufe bearbeiten", - "EDIT_VOICEQUEUE": "Warteschlange bearbeiten", + "SELECTED": "Ausgewählte", + "SELECT_ALL": "Alle auswählen", + "SELECT_NONE": "Wählen Sie \"Keine\"", + "DELETE_VOICEDISPOSITION": "Löschen Stimme Disposition", + "EDIT_VOICEDISPOSITION": "Edit Voice Disposition", + "EDIT_VOICEQUEUE": "Edit Voice Warteschlange", "DELETE_VOICEQUEUE": "Warteschlange löschen", - "MOHSOUNDS": "Wartemusik", + "MOHSOUNDS": "Moh-Sounds", "STRATEGY": "Strategie", "DESCRIPTION": "Beschreibung", "INTERVAL": "Zeitintervall", - "ADD_VOICEQUEUE": "Anruf-Warteschlange hinzufügen", - "NEW_QUEUECAMPAIGN": "Neue Warteschlangen-Kampagne", + "ADD_VOICEQUEUE": "Voice Warteschlange hinzufügen", + "NEW_QUEUECAMPAIGN": "Neue Warteschlange Kampagne", "ACTIVE": "Aktiv", "METHOD": "Methode", - "POWERLEVEL": "Level Power-Dialing", - "DROPRATE": "Droprate", - "AGENTBUSYFACTOR": "Faktor Agent besetzt", - "PREDICTIVEOPTIMIZATION": "Optimierung Predictive-Dialing", - "PREDICTIVEOPTIMIZATIONPERCENTAGE": "Prozentsatz Optimierung Predictive-Dialing", - "PREDICTIVEINTERVAL": "Intervall Predictive-Dialing", - "ADD_QUEUECAMPAIGN": "Kampagne hinzufügen", + "POWERLEVEL": "Leistung", + "DROPRATE": "Absenkgeschwindigkeit", + "AGENTBUSYFACTOR": "Agent besetzt Faktor", + "PREDICTIVEOPTIMIZATION": "Prädiktive Optimierung", + "PREDICTIVEOPTIMIZATIONPERCENTAGE": "Prädiktive Optimierung Prozentsatz", + "PREDICTIVEINTERVAL": "Predictive Intervall", + "ADD_QUEUECAMPAIGN": "Warteschlange hinzufügen Kampagne", "CAMPAIGN": "Kampagne", "MAXCONCURRENTCALLS": "Max. Anzahl gleichzeitiger Anrufe", - "CONCURRENTCALLS": "Anzahl gleichzeitiger Anrufe", - "ORIGINATE": "Rufaufbau", - "ORIGINATECALLERIDNAME": "Name Anrufer-ID", - "ORIGINATECALLERIDNUMBER": "Angezeigte Nummer", - "ORIGINATETIMEOUT": "Zeitüberschreitung Rufaufbau", + "CONCURRENTCALLS": "Max. Anzahl gleichzeitiger Anrufe", + "ORIGINATE": "Stammen", + "ORIGINATECALLERIDNAME": "Die Anrufer-ID-Namen", + "ORIGINATECALLERIDNUMBER": "Anrufer-ID-Nummer", + "ORIGINATETIMEOUT": "Stammen Timeout", "QUEUEOPTIONS": "Warteschlangenoptionen", - "QUEUETIMEOUT": "Zeitüberschreitung Warteschlange", - "CALLYSQUAREPROJECT": "Call-Flow Projekt", - "RETRYANDFREQUENCY": "Automatische Wiedervorlage", + "QUEUETIMEOUT": "Warteschlange Timeout", + "CALLYSQUAREPROJECT": "Cally Square Projekt", + "RETRYANDFREQUENCY": "Wiederholen Sie Einstellungen", "GLOBAL": "Global", - "GLOBALMAXRETRY": "Max. Wiederversuche", - "CONGESTION": "Leitungen belegt", - "CONGESTIONMAXRETRY": "Max. Wiederversuche bei \"Leitungen belegt\"", - "CONGESTIONRETRYTIME": "Erneuter Versuch nach (Minuten)", - "BUSYMAXRETRY": "Max. Wiederversuche bei \"Besetzt\"", - "BUSYRETRYTIME": "Erneuter Versuch nach (Minuten)", + "GLOBALMAXRETRY": "Max. Wiederholungen", + "CONGESTION": "Überlastung", + "CONGESTIONMAXRETRY": "Max. Wiederholungen", + "CONGESTIONRETRYTIME": "Wiederholen Zeit [min]", + "BUSYMAXRETRY": "Max. Wiederholungen", + "BUSYRETRYTIME": "Wiederholen Zeit [min]", "NOANSWER": "Keine Antwort", - "NOANSWERMAXRETRY": "Max. Wiederversuche bei \"keine Antwort\"", - "NOANSWERRETRYTIME": "Erneuter Versuch nach (Minuten)", - "QUEUE_PARAMS": "Warteschlangen-Parameter", - "ORIGINATED": "Ursprung", + "NOANSWERMAXRETRY": "Max. Wiederholungen", + "NOANSWERRETRYTIME": "Wiederholen Zeit [min]", + "QUEUE_PARAMS": "Queue Parameter", + "ORIGINATED": "Entstanden", "MESSAGE": "Nachricht", - "DROPPED": "Vom System aufgelegt (Drop)", + "DROPPED": "Zurück", "CREATED_AT": "Erstellt am", "LEGEND": { "CUSTOM_APPLICATION": "(*) - Benutzerdefinierte Anwendung." }, "ERRORS": { - "DIALRECALLMETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss gröpßer oder gleich sein als", - "DIALRECALLMETIMEOUT_REQUIRED": "Zeitüberschreitung Wiederversuch erforderlich", - "NAME_MUST_VALID_PATTERN": "Ungültiges Format Name", - "PREFIX_MUST_VALID_PATTERN": "Ungültiges Format Präfix", - "NAME_REQUIRED": "Name erforderlich", - "TIMEOUT_REQUIRED": "Zeitüberschreitung erforderlich", - "PHONENUMBER_REQUIRED": "Telefonnummer erforderlich", - "CONTEXT_REQUIRED": "Kontext erforderlich", - "DESTINATIONPATTERN_REQUIRED": "Ziel-Pattern erforderlich", - "FULLNAME_REQUIRED": "Vollständiger Name erforderlich", - "EMAIL_REQUUIRED": "E-Mail erforderlich", - "EMAIL_MUST_VALID": "Ungültiges Format E-Mail", - "MAILBOX_REQUIRED": "Mailbox erforderlich", - "PASSWORD_REQUIRED": "Passwort erforderlich", + "DIALRECALLMETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer als oder gleich", + "DIALRECALLMETIMEOUT_REQUIRED": "Pflichtfeld", + "NAME_MUST_VALID_PATTERN": "Name gültig sein muss eine gültige Muster", + "PREFIX_MUST_VALID_PATTERN": "Präfix gültig sein muss eine gültige Muster", + "NAME_REQUIRED": "Der Name ist erforderlich", + "TIMEOUT_REQUIRED": "Der Timeout ist erforderlich", + "PHONENUMBER_REQUIRED": "Die Telefonnummer ist erforderlich", + "CONTEXT_REQUIRED": "Der Kontext ist erforderlich", + "DESTINATIONPATTERN_REQUIRED": "Das Ziel-pattern ist erforderlich", + "FULLNAME_REQUIRED": "Der vollständige Name ist erforderlich", + "EMAIL_REQUUIRED": "Die E-Mail ist erforderlich", + "EMAIL_MUST_VALID": "Die E-Mail muss ein gültiges Format geschrieben werden", + "MAILBOX_REQUIRED": "Die Mailbox muss angegeben werden", + "PASSWORD_REQUIRED": "Das Kennwort ist erforderlich", "CONFIRM_NOT_MATCH": "Die Passwörter stimmen nicht überein.", - "TIMEZONE_REQUIRED": "Zeitzone erforderlich", - "PREFIX_REQUIRED": "Präfix erforderlich", - "OPTIONS_REQUIRED": "Optionen erforderlich", - "AFTERCALLWORKDURATION_REQUIRED": "Dauer Nacharbeit erforderlich", - "TECHNOLOGY/RESOURCE_REQUIRED": "Ressource erforderlich", - "PHONE_REQUIRED": "Telefonnummer erforderlich", - "VALUE_REQUIRED": "Wert erforderlich", - "EXTENSION_REQUIRED": "Nebenstelle erforderlich", - "PRIORITY_REQUIRED": "Priorität erforderlich", - "GLOBALMAXRETRY_REQUIRED": "Max. Wiederversuche erforderlich", - "CONGESTIONMAXRETRY_REQUIRED": "Max. Wiederversuche erforderlich", - "CONGESTIONRETRYTIME_REQUIRED": "Zeit für frühesten Wiederversuch erforderlich", - "BUSYMAXRETRY_REQUIRED": "Max. Wiederversuche erforderlich", - "BUSYRETRYTIME_REQUIRED": "Zeit für frühesten Wiederversuch erforderlich", - "NOANSWERMAXRETRY_REQUIRED": "Max. Wiederversuche erforderlich", - "NOANSWERRETRYTIME_REQUIRED": "Zeit für frühesten Wiederversuch erforderlich", - "QUEUETIMEOUT_REQUIRED": "Zeitüberschreitung Warteschlange erforderlich", - "ORIGINATETIMEOUT_REQUIRED": "Zeitüberschreitung Rufaufbau erforderlich", - "GLOBALINTERVAL_REQUIRED": "Globale Zeitplanung erforderlich", - "MAXCONCURRENTCALLS_REQUIRED": "Wert für max. Anzahl gleichzeitiger Anrufe erforderlich", - "CONCURRENTCALLS_REQUIRED": "Wert für Anzahl gleichzeitiger Anrufe erforderlich", - "POWERLEVEL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", - "PREDICTIVEOPTIMIZATIONPERCENTAGE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Optimierung Predictive-Dialing muss größer oder gleich sein als", - "PREDICTIVEINTERVAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Intervall Predictive-Dialing muss größer oder gleich sein als", - "MAXCONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Max. Anzahl gleichzeitiger Anrufe muss größer oder gleich sein als", - "ORIGINATETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung Rufaufbau muss größer oder gleich sein als", - "QUEUETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung Warteschlange muss größer oder gleich sein als", - "AGENTTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung Agent muss größer oder gleich sein als", - "RETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wiederversuch muss größer oder gleich sein als", - "WRAPUPTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Nacharbeitszeit muss größer oder gleich sein als", - "WEIGHT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Gewichtung muss größer oder gleich sein als", - "GLOBALMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Globaler Wert für Wiederholungen muss größer oder gleich sein als", - "CONGESTIONMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Max. Wiederversuche bei Leitungsstau muss größer oder gleich sein als", - "CONGESTIONRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeit für Wiederversuche bei Leitungsstau muss größer oder gleich sein als", - "BUSYMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Max. Anzahl Wiederversuche bei Besetzt muss größer oder gleich sein als", - "BUSYRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeit für Wiederversuch bei Besetzt muss größer oder gleich sein als", - "NOANSWERMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Max. Anzahl Wiederversuche bei keiner Antwort muss größer oder gleich sein als", - "NOANSWERRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung bei keiner Antwort muss größer oder gleich sein als", - "CONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert gleichzeitige Anrufe muss größer oder gleich sein als", - "POWERLEVEL_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Level bei Power-Dialing muss kleiner oder gleich sein als", - "PREDICTIVEOPTIMIZATIONPERCENTAGE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Prozentsatz Optimierung Predictive-Dialing muss kleiner oder gleich sein als", - "PREDICTIVEINTERVAL_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Intervall bei Predictive-Dialing muss kleiner oder gleich sein als", - "MAXCONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Max. Anzahl gleichzeitiger Anrufe muss kleiner oder gleich sein als", - "ORIGINATETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung bei Rufaufbau muss kleiner oder gleich sein als", - "QUEUETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung Warteschlange muss kleiner oder gleich sein als", - "GLOBALMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Max. Anzahl globaler Wiederversuche muss kleiner oder gleich sein als", - "CONGESTIONMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Max. Wiederversuche bei Leitungsstau muss kleiner oder gleich sein als", - "CONGESTIONRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung bei Leitungsstau muss kleiner oder gleich sein als", - "BUSYMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Max. Anzahl Wiederversuche bei Besetzt muss kleiner oder gleich sein als", - "BUSYRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeit Wiederversuch bei Besetzt muss kleiner oder gleich sein als", - "NOANSWERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Max. Anzahl Wiederversuche bei keiner Antwort muss kleiner oder gleich sein als", - "NOANSWERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung bei keiner Antwort muss kleiner oder gleich sein als", - "CONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Anzahl gleichzeitiger Anrufe muss kleiner oder gleich sein als", - "EMAIL_REQUIRED": "E-Mail erforderlich", - "AGENTTIMEOUT_REQUIRED": "Zeitüberschreitung Agent erforderlich", - "INTERVAL_REQUIRED": "Zeitintervall erforderlich", - "RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zufällige letzte Ziffer muss kleiner oder gleich sein als", - "RANDOMLASTDIGITCALLERIDNUMBER_REQUIRED": "Zufällige letzte Ziffer erforderlich", - "CUTDIGIT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Abgeschnittene Nummer muss größer oder gleich sein als", - "CUTDIGIT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Abgeschnittene Nummer muss kleiner oder gleich sein als", - "CUTDIGIT_REQUIRED": "Abgeschnittene Nummer erforderlich", - "RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein als", - "AGENT_REQUIRED": "Agent erforderlich", - "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Pausen-ID bei Qualifizierung erforderlich", - "ABANDONEDMAXRETRY_REQUIRED": "Wert erforderlich", - "ABANDONEDRETRYTIME_REQUIRED": "Wert erforderlich", - "AGENTREJECTMAXRETRY_REQUIRED": "Max. Wiederversuche Agent erforderlich", - "AGENTREJECTRETRYTIME_REQUIRED": "Zeitüberschreitung Agent erforderlich", - "DROPMAXRETRY_REQUIRED": "Max. Drop-Rate erforderlich", - "DROPRETRYTIME_REQUIRED": "Zeit für Wiederversuch bei Drop-Call erforderlich", - "MACHINEMAXRETRY_REQUIRED": "Max. Anzahl Wiederversuche bei Anrufbeantworter erforderlich", - "MACHINERETRYTIME_REQUIRED": "Zeitüberschreitung bei Anrufbeantworter erforderlich", - "NOSUCHNUMBERMAXRETRY_REQUIRED": "Max. Anzahl Wiederversuche bei falscher Nummer erforderlich", - "NOSUCHNUMBERRETRYTIME_REQUIRED": "Zeit nach falscher Nummer erforderlich", - "CALLYSQUAREPROJECT_REQUIRED": "Call-Flow Projekt erforderlich", - "TRUNK_REQUIRED": "SIP-Trunk erforderlich", - "ABANDONEDMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Max. Anzahl Wiederversuche bei Nummer nicht erreicht muss kleiner oder gleich sein als", - "ABANDONEDRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeit bei Nummer nicht erreicht muss kleiner oder gleich sein als", - "AGENTREJECTMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Max. Anzahl Wiederversuche bei Ablehnung durch Agenten muss kleiner oder gleich sein als", - "AGENTREJECTRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeit bei Ablehnung durch Agenten muss kleiner oder gleich sein als", - "DROPMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Max. Wiederversuche bei Drop-Call muss kleiner oder gleich sein als", - "DROPRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeit nach Drop-Call muss kleiner oder gleich sein als", - "MACHINEMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Max. Anzahl Wiederversuche bei Anrufbeantworter muss kleiner oder gleich sein als", - "MACHINERETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeit bei Anrufbeantworter muss kleiner oder gleich sein als", - "NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Max. Anzahl Wiederversuche bei falscher Nummer muss kleiner oder gleich sein als", - "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeit bei falscher Nummer muss kleiner oder gleich sein als", + "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 ist erforderlich", + "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", + "GLOBALMAXRETRY_REQUIRED": "Max. Wiederholungen ist erforderlich", + "CONGESTIONMAXRETRY_REQUIRED": "Max. Wiederholungen ist erforderlich", + "CONGESTIONRETRYTIME_REQUIRED": "Zeit für Wiederholungen ist erforderlich", + "BUSYMAXRETRY_REQUIRED": "Max. Wiederholungen ist erforderlich", + "BUSYRETRYTIME_REQUIRED": "Zeit für Wiederholungen ist erforderlich", + "NOANSWERMAXRETRY_REQUIRED": "Max. Wiederholungen ist erforderlich", + "NOANSWERRETRYTIME_REQUIRED": "Zeit für Wiederholungen ist erforderlich", + "QUEUETIMEOUT_REQUIRED": "Warteschlange Timeout ist erforderlich", + "ORIGINATETIMEOUT_REQUIRED": "Stammen Timeout ist erforderlich", + "GLOBALINTERVAL_REQUIRED": "Globale Intervall ist erforderlich", + "MAXCONCURRENTCALLS_REQUIRED": "Der Wert für die maximale Anzahl gleichzeitiger Anrufe ist erforderlich", + "CONCURRENTCALLS_REQUIRED": "Der Wert für die Anzahl gleichzeitiger Anrufe ist erforderlich", + "POWERLEVEL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die Leistung muss größer als oder gleich", + "PREDICTIVEOPTIMIZATIONPERCENTAGE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die prädiktive Optimierung Prozentsatz muss größer als oder gleich", + "PREDICTIVEINTERVAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die prädiktive Intervall muss größer als oder gleich", + "MAXCONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die maximale Anzahl gleichzeitiger Anrufe muss größer als oder gleich", + "ORIGINATETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die stammen Timeout muss größer als oder gleich", + "QUEUETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die Warteschlange Timeout muss größer als oder gleich", + "AGENTTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Agent Timeout 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", + "GLOBALMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die globale Max wiederholen muss größer als oder gleich", + "CONGESTIONMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die Überlastung Max wiederholen muss größer als oder gleich", + "CONGESTIONRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die Verkehrsüberlastung erneut Zeit muss größer als oder gleich", + "BUSYMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die geschäftige Max wiederholen muss größer als oder gleich", + "BUSYRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die geschäftige Zeit für Wiederholungen muss größer als oder gleich", + "NOANSWERMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die Antwort Nein Max wiederholen muss größer als oder gleich", + "NOANSWERRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die Zeitüberschreitung für keine Antwort Zeit für Wiederholungen muss größer als oder gleich", + "CONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die gleichzeitige Anrufe muss größer als oder gleich", + "POWERLEVEL_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Die Leistung muss kleiner als oder gleich", + "PREDICTIVEOPTIMIZATIONPERCENTAGE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Die prädiktive Optimierung Prozentsatz muss kleiner als oder gleich", + "PREDICTIVEINTERVAL_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Die prädiktive Intervall muss kleiner als oder gleich", + "MAXCONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Die maximale Anzahl gleichzeitiger Anrufe muss kleiner als oder gleich", + "ORIGINATETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Die stammen Timeout muss kleiner als oder gleich", + "QUEUETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Die Warteschlange Timeout muss kleiner als oder gleich", + "GLOBALMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Die globale Max wiederholen muss kleiner als oder gleich", + "CONGESTIONMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Die Überlastung Max wiederholen muss kleiner als oder gleich", + "CONGESTIONRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Die Überlastung Zeit für Wiederholungen muss kleiner als oder gleich", + "BUSYMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Die geschäftige Max wiederholen muss kleiner als oder gleich", + "BUSYRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Die geschäftige Zeit für Wiederholungen muss kleiner als oder gleich", + "NOANSWERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Die Antwort Nein Max wiederholen muss kleiner als oder gleich", + "NOANSWERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Die Zeitüberschreitung für keine Antwort Zeit für Wiederholungen muss kleiner als oder gleich", + "CONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Die gleichzeitige Anrufe muss kleiner als oder gleich", + "EMAIL_REQUIRED": "Pflichtfeld", + "AGENTTIMEOUT_REQUIRED": "Pflichtfeld", + "INTERVAL_REQUIRED": "Pflichtfeld", + "RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", + "RANDOMLASTDIGITCALLERIDNUMBER_REQUIRED": "Pflichtfeld", + "CUTDIGIT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", + "CUTDIGIT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", + "CUTDIGIT_REQUIRED": "Pflichtfeld", + "RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", + "AGENT_REQUIRED": "Pflichtfeld", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Pflichtfeld", + "ABANDONEDMAXRETRY_REQUIRED": "Pflichtfeld", + "ABANDONEDRETRYTIME_REQUIRED": "Pflichtfeld", + "AGENTREJECTMAXRETRY_REQUIRED": "Pflichtfeld", + "AGENTREJECTRETRYTIME_REQUIRED": "Pflichtfeld", + "DROPMAXRETRY_REQUIRED": "Pflichtfeld", + "DROPRETRYTIME_REQUIRED": "Pflichtfeld", + "MACHINEMAXRETRY_REQUIRED": "Pflichtfeld", + "MACHINERETRYTIME_REQUIRED": "Pflichtfeld", + "NOSUCHNUMBERMAXRETRY_REQUIRED": "Pflichtfeld", + "NOSUCHNUMBERRETRYTIME_REQUIRED": "Pflichtfeld", + "CALLYSQUAREPROJECT_REQUIRED": "Pflichtfeld", + "TRUNK_REQUIRED": "Pflichtfeld", + "ABANDONEDMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", + "ABANDONEDRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", + "AGENTREJECTMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", + "AGENTREJECTRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", + "DROPMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", + "DROPRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", + "MACHINEMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", + "MACHINERETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", + "NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", + "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", "CALLADDITIONALPHONEAFTERMIN_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Rufen Sie add.phone nach min. sollte größer oder gleich sein", "CALLADDITIONALPHONEAFTERMIN_REQUIRED": "Pflichtfeld" }, "GENERAL": "Allgemein", - "AGENTTIMEOUT": "Zeitüberschreitung Agent", + "AGENTTIMEOUT": "Agent Timeout", "MAXLENGTH": "Maximale Länge", "RETRY": "Erneut versuchen", - "WRAPUPTIME": "Zeit Nacharbeit", - "WEIGHT": "Gewichtung", - "JOINWHENEMPTY": "Beitreten, wenn leer", + "WRAPUPTIME": "Wrapup Zeit", + "WEIGHT": "Gewicht", + "JOINWHENEMPTY": "Melden Sie wenn sie leer", "LEAVEWHENEMPTY": "Verlassen, wenn leer", "HELP": { - "DIALORDERBYSCHEDULEDAT": "Reihenfolge Anwahl nach Planung", - "DIALRECALLINQUEUE": "Anwahl in Warteschlange", - "DIALRECALLMETIMEOUT": "Zeit (Min) für Reservierung des Anrufes an Agenten", - "PRIORITY": "Priorität", - "AMDMAXIMUMWORDLENGTH": "Maximale Wortlänge für die Anrufbeantworter-Erkennung", - "AMDMINWORDLENGTH": "Minimale Wortlänge für die Anrufbeantworter-Erkennung", - "AMDSILENCETHRESHOLD": "Sobald die durchschnittliche Lautstärke von Geräuschen diesen Wert (Skala 0 bis 32767) unterschreitet, wird Stille interpretiert", - "AMDTOTALANALYSISTIME": "Maximale Zeit für eine Erkennung von Anrufbeantworter oder reale Person", - "AMDAFTERGREETINGSILENCE": "Stille nach der Feststellung einer Begrüßung. Wenn überschritten, wird der Anruf als \"reale Person\" klassifiziert", - "AMDGREETING": "Maximale Länge für eine Begrüßungsnachricht. Wenn überschritten, wird der Anruf als Anrufbeantworter klassifiziert", - "AMDINITIALSILENCE": "Maximale Stille vor der Begrüßungsnachricht. Wenn überschritten, wird der Anruf als Anrufbeantworter klassifiziert", - "AMDACTIVE": "Aktivieren oder Deaktivieren der Anrufbeantworter-Erkennung", - "AMDBETWEENWORDSSILENCE": "Minimale Dauer der Pause nach einem Wort, bevor ein neues Wort erkannt werden kann", - "AMDMAXIMUMNUMBEROFWORDS": "Maximale Anzahl der Wörter in der Begrüßung. Wenn erreicht, wird der Anruf als Anrufbeantworter klassifiziert", - "CALLYSQUAREPROJECT": "Legen Sie hier einen Call-Flow für den ausgehenden Anruf fest, bevor dieser in die Warteschleife geleitet wird", - "PREFIX": "Vorwahl (Präfix)", + "DIALORDERBYSCHEDULEDAT": "Sie Kontakte von Hopper (absteigend oder aufsteigend).", + "DIALRECALLINQUEUE": "Planen Sie für die Agenten in der Warteschlange", + "DIALRECALLMETIMEOUT": "Zeitintervall (in Minuten), für die mir der Gültigkeitsdauer", + "PRIORITY": "Priorität in der Liste", + "AMDMAXIMUMWORDLENGTH": "Zulässige Höchstdauer von einer einzigen Stimme auszusprechen.", + "AMDMINWORDLENGTH": "Minimale Dauer eines Voice ein Wort betrachtet zu werden.", + "AMDSILENCETHRESHOLD": "Wenn die durchschnittliche Höhe der Lärm in einer Probe, die diesen Wert nicht erreichen, aus einer Skala von 0 bis 32767, dann werden wir es als Stille betrachten", + "AMDTOTALANALYSISTIME": "Maximale Zeit für den Algorithmus, ob die Audio stellt ein Mensch oder eine Maschine zu entscheiden erlaubt", + "AMDAFTERGREETINGSILENCE": "Stille nach der Feststellung einer Begrüßung. Wenn die Zeit überschritten wird, dann ist das Ergebnis der Erkennung als Mensch", + "AMDGREETING": "Maximale Länge für eine Grußansage. Wenn die Zeit überschritten wird, dann ist das Ergebnis der Erkennung als Maschine", + "AMDINITIALSILENCE": "\"Längstmögliche Stille Dauer, bevor Sie die Grußansage auf. Wenn die Zeit überschritten wird, dann ist das Ergebnis der Erkennung als Maschine", + "AMDACTIVE": "Aktivieren oder Deaktivieren von Anrufbeantwortern Erkennung Versuche", + "AMDBETWEENWORDSSILENCE": "Minimale Dauer der Stille nach einem Wort, die Audio, die als neues Wort folgt in Betracht zu ziehen", + "AMDMAXIMUMNUMBEROFWORDS": "Maximale Anzahl der Wörter in der Begrüßung. Wenn es erreicht wird, dann ist das Ergebnis der Erkennung als Maschine", + "CALLYSQUAREPROJECT": "Wenn Sie ein IVR-Projekt aus der Liste aus, das Wählsystem den Anruf an den IVR-Dienst, bevor Sie ihn in einer Warteschlange.", + "PREFIX": "Vorwahl", "ACTIVE": "Aktiv", - "AGENTTIMEOUT": "Definiert die Zeit (in Sekunden), in der die Nebenstelle des Agenten klingelt", - "MAXLENGTH": "Maximale Anzahl von Anrufen in der Warteschlange (0 = keine Begrenzung)", - "RETRY": "Definiert wie Lange (Sekunden) auf eine Antwort des Agenten gewartet wird, bevor der Anruf beim nächsten Agenten klingelt", - "WRAPUPTIME": "Zeit (in Sekunden), in welcher der Agent nach einem Anruf nicht verfügbar ist", - "WEIGHT": "Gewichtung der Warteschlangen untereinander, sofern die Agenten auf mehr als einer Warteschlange arbeiten", - "JOINWHENEMPTY": "Definiert, ob ein Anruf in die Warteschleife eintreten kann, wenn keine Agenten verfügbar sind", - "LEAVEWHENEMPTY": "Trennt den Anruf in der Warteschleife, sofern keine Agenten verfügbar sind", - "ANNOUNCEFREQUENCY": "Definiert, wie oft dem Anrufer die aktuelle Warteposition und/oder die erwartete Wartezeit angesagt wird. (0 zum Deaktivieren dieser Funktion)", - "MINANNOUNCEFREQUENCY": "Minimale Ansage der Warteposition/Wartezeit. Nützlich, wenn der Anrufer die Warteposition oft wechselt", - "PERIODICANNOUNCEFREQUENCY": "Intervall für sich Widerholende Ansagen an den Anrufer", - "ANNOUNCEPOSITIONLIMIT": "Warteposition wird nur ab dem eingestellten Wert angesagt", - "AFTERCALLWORKDURATION": "Die Dauer der Nacharbeit nach einem Anruf (Sekunden)", - "MEMBERDELAY": "Verzögert die Zustellung des Anrufes an den Agenten um den eingestellten Wert (Sekunden)", - "MUSICONHOLD": "Definiert die Wartemusik innerhalb der Warteschlange", - "ANNOUNCETOAGENT": "Spielt dem Agenten eine Mitteilung über den Ursprung des Anrufes vor der Annahme", - "RANDOMPERIODICANNOUNCE": "Bei \"Ja\" werden die definierten Ansagen in einer zufälligen Reihenfolge abgespielt", - "ANNOUNCEHOLDTIME": "Definiert, ob die geschätzte Wartezeit zusätzlich zur Wartemusik abgespielt wird. (Ja/Nein/nur ein Mal)", - "ANNOUNCECALLERPOSITION": "Definiert, ob die aktuelle Warteposition des Anrufers angesagt wird. Nein = Niemals; Ja = Immer; Limit = nur wenn innerhalb des Limits für Warteposition; Mehr = wenn überhalb des Limits für Warteposition", - "REPORTHOLDTIMEAGENT": "Ermöglicht dem Agenten, die Wartezeit des Anrufers zu hören", - "PERIODICANNOUNCE": "Reihenfolge der Ansagen innerhalb der Warteschlange", - "HOLDTIMEANNOUNCE": "Wählt die Audiodatei (Hochladen einer Datei im Menü \"Werkzeuge\") für die Ansage der Wartezeit. Bsp: \"Ihre geschätzte Wartezeit beträgt\" Wenn leer, wird keine Ansage abgespielt", - "YOUARENEXTANNOUNCE": "Wählt die Audiodatei (Hochladen einer Datei im Menü \"Werkzeuge\") für die Ansage der ersten Position in der Warteschlange. Bsp: \"Der nächste freie Mitarbeiter wird Ihren Anruf in Kürze entgegennehmen\" Wenn leer, wird keine Ansage abgespielt", - "THEREAREANNOUNCE": "Erster Teil der Ansage für die bereits wartenden Anrufe. Bsp: \"Vor Ihnen befinden sich noch..:\"; Wenn leer, wird keine Ansage abgespielt", - "WAITINGCALLSANNOUNCE": "Zweiter Teil der Ansage für die bereits wartenden Anrufe. Bsp: \"...Anrufe in der Warteschlange\"; Wenn leer, wird keine Ansage abgespielt", - "ESTIMATEDHOLDTIMEANNOUNCE": "Wählt die Audiodatei (Hochladen einer Datei im Menü \"Werkzeuge\") für die Ansage der geschätzten Wartezeit. Bsp: \"Ihre aktuelle Wartezeit beträgt ca....\" Wenn leer, wird keine Ansage abgespielt", - "MINUTESANNOUNCE": "Wählt die Audiodatei (Hochladen einer Datei im Menü \"Werkzeuge\") für das Wort \"Minuten\". Wenn leer, wird keine Ansage abgespielt", - "MINUTEANNOUNCE": "Wählt die Audiodatei (Hochladen einer Datei im Menü \"Werkzeuge\") für das Wort \"Minute\". Wenn leer, wird keine Ansage abgespielt", - "SECONDSANNOUNCE": "Wählt die Audiodatei (Hochladen einer Datei im Menü \"Werkzeuge\") für das Wort \"Sekunden\". Wenn leer, wird keine Ansage abgespielt", - "THANKYOUANNOUNCE": "Wählt die Audiodatei (Hochladen einer Datei im Menü \"Werkzeuge\") für eine Ansage zum Dank. Bsp: \"Vielen Dank für Ihre Geduld\" Wenn leer, wird keine Ansage abgespielt", - "AFTERCALLWORK": "Wenn aktiviert, wird der Agent nach jedem Anruf in eine definierbare Pause zur Nacharbeit gesetzt", - "AUTOPAUSE": "Legt fest, ob der Agent in eine automatische pause gesetzt wird, sofern dieser den aktuellen Anruf nicht innerhalb der definierten Zeit entgegennimmt. Wenn ja, wird der Agent in allen zugewiesenen Kampagnen auf Pause gesetzt. ", - "RINGINUSE": "Aktivieren/Deaktivieren der Anrufzustellung wenn der Status der Nebenstelle Besetzt ist", - "TIMEOUTRESTART": "Wenn ja, wird die Zeitüberschreitung bei Agenten mit \"Besetzt\" oder \"Verbindungsfehler\"-Status übersprungen", - "MONITORFORMAT": "Definiert das Dateiformat für Gesprächsaufzeichnungen. Wenn leer, findet keine Gesprächsaufzeichnung statt.", - "CONTEXT": "Ermöglicht einem Anrufer, durch Drücken einer einzelnen Taste, die Warteschlange zu verlassen.", - "SETINTERFACEVARIABLES": "Wenn aktiviert, können aufgenommene Variabeln vor einem Anruf an den Agenten weitergegeben werden. (Siehe Wiki)", - "SETQUEUEVARIABLES": "Wenn aktiviert, können aufgenommene Variabeln nach dem Verlassen der Warteschlange an den Agenten weitergegeben werden. (Siehe Wiki)", - "SETQUEUEENTRYVARIABLES": "Wenn aktiviert, können aufgenommene Variabeln beim Eintreten in die Warteschlange an den Agenten weitergegeben werden. (Siehe Wiki)", - "RECORDING": "Automatische Gesprächsaufzeichnung Deaktivieren/Aktivieren", - "VOICEMAIL_CONTEXT": "Kontext für Voicemail", - "METHOD": "Wählform für Outbound-Dialing", - "POWERLEVEL": "Anzahl der anzurufenden Kontakte pro verfügbarem Agent", - "PREDICTIVEOPTIMIZATION": "Faktor zur Optimierung des Predictive-Dialing", - "PREDICTIVEOPTIMIZATIONPERCENTAGE": "Prozentsatz basierend auf dem eingestellten Optimierungsfaktor", - "PREDICTIVEINTERVAL": "Zeitintervall (in Minuten) innerhalb dessen die Berechnung der angebotenen (Predictive-) Anrufe stattfindet", - "MAXCONCURRENTCALLS": "Maximale Anzahl gleichzeitiger Anwahlen für die Outboundkampagne (0 = keine Begrenzung)", - "CONCURRENTCALLS": "Anzahl gleichzeitiger Anwahlen für die Outboundkampagne", - "ORIGINATECALLERIDNAME": "Name (ID) des ausgehenden Anrufes", - "ORIGINATECALLERIDNUMBER": "Angezeigte Nummer des ausgehenden Anrufes", - "ORIGINATETIMEOUT": "Zeit (in Sekunden) für die Entgegennahme eines ausgehenden Anrufes. Nach Ablauf der Zeit wird der Anruf als \"keine Antwort\" klassifiziert", - "QUEUETIMEOUT": "Zeit (in Sekunden) in welcher ein ausgehender Anruf in der Warteschleife gehalten wird, bevor das System auflegt (Drop-Call). Min: 1 Sek - Max: 999 Sek", - "GLOBALMAXRETRY": "Maximale Anzahl an Anrufversuchen, bevor der Kontakt verworfen wird", - "CONGESTIONMAXRETRY": "Maximale Anzahl an Anrufversuchen, bevor der Kontakt verworfen wird. (Sofern der Anruf in einen Leitungsstau führt)", - "CONGESTIONRETRYTIME": "Zeit (in Minuten), bevor ein Anruf resultierend aus Leitungsstau erneut gewählt wird.", - "NOANSWERMAXRETRY": "Maximale Anzahl Wiederversuche bei keiner Antwort", - "NOANSWERRETRYTIME": "Min. Zeit (in Minuten), für einen Wiederversuch nach Ergebnis \"keine Antwort\"", - "GLOBALINTERVAL": "Globales Zeitintervall, in welchem der Dialer ausgehende Anrufe tätigt. ", + "AGENTTIMEOUT": "Gibt die Anzahl von Sekunden, die ein Agent Gerät klingeln.", + "MAXLENGTH": "Gibt die maximale Anzahl der Anrufer in der Wartezeit in der Warteschlange. Ein Wert von Null bedeutet, dass eine unbegrenzte Anzahl von Anrufern in der Warteschlange erlaubt sind.", + "RETRY": "Gibt die Anzahl der Sekunden, bevor das nächste Mitglied in der Warteschlange, wenn der Wert für das Zeitlimit ausgeschöpft ist, während versucht wird, eine Mitglied der Warteschlange, um an den Zahnkranz zu warten.", + "WRAPUPTIME": "Die Anzahl der Sekunden, die ein Mitglied in einer Warteschlange nicht mehr verfügbar, nachdem Sie einen Anruf halten.", + "WEIGHT": "Legt das Gewicht einer Warteschlange. Eine Warteschlange mit einem höheren Gewicht definiert wird erste Priorität erhalten, wenn die Mitglieder mit mehreren Warteschlangen zugeordnet sind.", + "JOINWHENEMPTY": "Steuert, ob ein Anrufer in der Warteschlange hinzugefügt wird, wenn keine Mitglieder vorhanden sind.", + "LEAVEWHENEMPTY": "Verwendet, um zu steuern, ob Anrufer aus der Warteschlange gekickt werden, wenn Mitglieder nicht mehr Anrufe verfügbar sind.", + "ANNOUNCEFREQUENCY": "Legt fest, wie oft wir die Position des Anrufers und/verkünden sollten oder geschätzte Wartezeit in der Warteschlange. Stellen Sie diesen Wert auf Null zu deaktivieren.", + "MINANNOUNCEFREQUENCY": "Gibt die minimale Zeit, die verstreichen muss, bevor wir die Position des Anrufers in der Warteschlange erneut zu verkünden. Dies wird verwendet, wenn der Anrufer häufig ändern kann, wird der Anrufer hören mehrere Updates in einem kurzen Zeitraum zu verhindern.", + "PERIODICANNOUNCEFREQUENCY": "Gibt an, wie oft wir in regelmäßigen Abständen Mitteilungen an den Anrufer machen sollte.", + "ANNOUNCEPOSITIONLIMIT": "Wenn Sie definiert haben verkünden - Position als entweder einzuschränken oder mehr.", + "AFTERCALLWORKDURATION": "Die Dauer der Pause durch die Option \"Arbeit nach Anruf ausgelöst", + "MEMBERDELAY": "Verwendet, wenn es eine Verzögerung, bevor der Anrufer und Warteschlange Mitglied miteinander verbunden werden möchten.", + "MUSICONHOLD": "Setzt die Musik klasse von einer bestimmten Warteschlange verwendet werden.", + "ANNOUNCETOAGENT": "Für das Spielen eine Ansage, die auf den Agenten, der den Anruf entgegengenommen, in der Regel verwendet, um ihn wissen zu lassen, was der Anrufer Warteschlange kommt.", + "RANDOMPERIODICANNOUNCE": "Wenn \"yes\" festgelegt ist, wird die definierte in regelmäßigen Abständen Mitteilungen in einer zufälligen Reihenfolge wiedergeben.", + "ANNOUNCEHOLDTIME": "Legt fest, ob die geschätzte Wartezeit zusammen mit dem in regelmäßigen Abständen Mitteilungen gespielt werden sollte.", + "ANNOUNCECALLERPOSITION": "Legt fest, ob die Position des Anrufers in der Warteschlange zu Ihrem angekündigt werden sollte. Ist Nein eingestellt, wird die Position wird nie bekannt gegeben. Wenn Sie auf \"Ja\" setzen, wird die Position des Anrufers wird immer bekannt gegeben werden. Wenn der Wert eingestellt ist, wird der Anrufer ihre Position in der Warteschlange hört nur, wenn er sich innerhalb der Grenze von verkünden - Position - Grenzwert festgelegt werden. Wenn der Wert auf mehr eingestellt ist, wird der Anrufer ihre Position zu hören, wenn Sie über die Anzahl von verkünden - Position - Grenzwert definiert ist.", + "REPORTHOLDTIMEAGENT": "Ermöglicht die Berichterstattung des Anrufers Haltezeit auf die Warteschlange, die vor dem Bridging.", + "PERIODICANNOUNCE": "Eine Reihe von in regelmäßigen Abständen Mitteilungen gespielt zu werden, spielte in der Reihenfolge, in der sie definiert sind.", + "HOLDTIMEANNOUNCE": "Wenn nicht angegeben, wird der Standardwert spielen (\"hold\"). Wenn auf einen leeren Wert gesetzt ist, wird die Aufforderung nicht gespielt werden.", + "YOUARENEXTANNOUNCE": "Wenn nicht angegeben, wird der Standardwert (\" Jetzt sind Sie in erster Linie\"). Wenn auf einen leeren Wert gesetzt ist, wird die Aufforderung nicht gespielt werden.", + "THEREAREANNOUNCE": "Wenn nicht angegeben, wird der Standardwert spielen (\"Es gibt\"). Wenn auf einen leeren Wert gesetzt ist, wird die Aufforderung nicht gespielt werden.", + "WAITINGCALLSANNOUNCE": "Wenn nicht angegeben, wird der Standardwert (\"Wartende Anrufe\"). Wenn auf einen leeren Wert gesetzt ist, wird die Aufforderung nicht gespielt werden.", + "ESTIMATEDHOLDTIMEANNOUNCE": "Wenn nicht angegeben, wird der Standardwert spielen (\"Das Voraussichtliche Wartezeit\"). Wenn auf einen leeren Wert gesetzt ist, wird die Aufforderung nicht gespielt werden.", + "MINUTESANNOUNCE": "Wenn nicht angegeben, wird der Standardwert spielen (\"min\"). Wenn auf einen leeren Wert gesetzt ist, wird die Aufforderung nicht gespielt werden.", + "MINUTEANNOUNCE": "Wenn nicht angegeben, wird der Standardwert (\"Minute\"). Wenn auf einen leeren Wert gesetzt ist, wird die Aufforderung nicht gespielt werden.", + "SECONDSANNOUNCE": "Wenn nicht angegeben, wird der Standardwert spielen (\"Sekunden\"). Wenn auf einen leeren Wert gesetzt ist, wird die Aufforderung nicht gespielt werden.", + "THANKYOUANNOUNCE": "Wenn nicht angegeben, wird der Standardwert spielen (\"Vielen Dank für Ihr Geduld\"). Wenn auf einen leeren Wert gesetzt ist, wird die Aufforderung nicht gespielt werden.", + "AFTERCALLWORK": "Wenn aktiv, wird für den Agenten in Pause nach einer abgeschlossenen Anruf in die Warteschlange eingestellt werden.", + "AUTOPAUSE": "Aktiviert/deaktiviert das automatische Anhalten der Mitglieder, die es versäumen, um einen Anruf zu beantworten. Wenn aktiv Ursachen dieses Mitglied in allen Warteschlangen er ist Mitglied der angehalten zu werden.", + "RINGINUSE": "Verwendet Senden von Anrufen an Mitglieder, deren Status im Einsatz ist zu vermeiden.", + "TIMEOUTRESTART": "Wenn die Einstellung Ja lautet, setzt den Timeout für einen Agenten zu beantworten, wenn entweder ein Besetztzeichen oder Staus Status aus dem Kanal empfangen wird.", + "MONITORFORMAT": "Gibt das Dateiformat zu verwenden, wenn Sie die Aufnahme. Wenn der Monitor-Format deaktiviert ist, werden die Anrufe nicht aufgezeichnet werden.", + "CONTEXT": "Kann ein Anrufer in die Warteschlange verlassen Sie durch Drücken einer einzigen MFV-Ziffer. Wenn ein Kontext angegeben ist und der Anrufer gibt eine Reihe, kann diese Ziffer wird der Versuch unternommen, im Rahmen angegebenen ausgeziffert werden, und Nummernplan Ausführung wird es weiter.", + "SETINTERFACEVARIABLES": "Wenn die Einstellung Ja lautet, gerade vor der Anrufer mit einer Warteschlange Mitglied überbrückt werden einige Variablen gesetzt werden (siehe Wiki)", + "SETQUEUEVARIABLES": "Wenn die Einstellung Ja lautet, gerade vor der Anrufer mit einer Warteschlange Mitglied überbrückt werden, und kurz vor dem Anrufer die Warteschlange verlassen einige Variablen gesetzt werden (siehe Wiki)", + "SETQUEUEENTRYVARIABLES": "Wenn die Einstellung Ja lautet, gerade vor der Anrufer mit einer Warteschlange Mitglied überbrückt werden einige Variablen gesetzt werden (siehe Wiki)", + "RECORDING": "Die Anrufaufzeichnung aktivieren", + "VOICEMAIL_CONTEXT": "Im Zusammenhang mit der relativen Erweiterung.", + "METHOD": "Outbound Dialer Methode.", + "POWERLEVEL": "Anzahl der Kontakte, für einen verfügbaren Agenten.", + "PREDICTIVEOPTIMIZATION": "Ein Faktor in der vorbestimmten Algorithmus zu optimieren.", + "PREDICTIVEOPTIMIZATIONPERCENTAGE": "Prozentsatz, der auf die ausgewählten prädiktive Optimierung Faktor", + "PREDICTIVEINTERVAL": "Zeitintervall in Minuten mit prädiktiver Algorithmus berücksichtigt werden Anrufe zu berechnen für die Optimierung der prädiktive Optimierung Faktor zu generieren", + "MAXCONCURRENTCALLS": "Die maximale Anzahl gleichzeitiger Anrufe, die vom Outbound Dialer entstanden sein wird.", + "CONCURRENTCALLS": "Die maximale Anzahl gleichzeitiger Anrufe, die vom Outbound Dialer für diese Kampagne entstanden sein wird.", + "ORIGINATECALLERIDNAME": "Ausgehende Anrufer-ID-Namen", + "ORIGINATECALLERIDNUMBER": "Ausgehende Anrufer-ID-Nummer", + "ORIGINATETIMEOUT": "Zeit in Sekunden, die ausgehende Anrufe mit Ursprung Verbindung herzustellen. Wenn die Busverbindungen nicht hergestellt ist, wird der Status stammen, wird keine Antwort sein.", + "QUEUETIMEOUT": "Zeit (in Sekunden) ein Anruf in der Warteschlange warten, bevor es gelöscht wird (Min 1 und Max. 999)", + "GLOBALMAXRETRY": "Maximale Anzahl, wie oft ein Kontakt genannt wird, bevor es geschlossen", + "CONGESTIONMAXRETRY": "Maximale Anzahl, wie oft ein Kontakt konnte nicht für Staus Grund genannt wird, bevor es geschlossen", + "CONGESTIONRETRYTIME": "Zeit in Minuten, bevor Sie es erneut versuchen einen Kontakt für Staus Grund fehlgeschlagen zu erreichen.", + "NOANSWERMAXRETRY": "Maximale Anzahl, wie oft ein Kontakt konnte nicht für Keine Antwort Grund genannt wird, bevor es geschlossen", + "NOANSWERRETRYTIME": "Zeit in Minuten, bevor Sie es erneut versuchen einen Kontakt für Keine Antwort Reason zu erreichen.", + "GLOBALINTERVAL": "Globale Zeit, in der sich der Dialer erlaubt ist, Kontakte zu nennen. Bitte achten Sie, wenn Sie dieses Feld nicht ändern. Wir sind nicht verantwortlich oder haftbar für die Nichteinhaltung mit Autodialer Gesetze und Bestimmungen einzuhalten.", "NAME": "Nur Zahlen, Buchstaben und Sonderzeichen (._) werden unterstützt.", - "TIMEOUT": "Anzahl Sekunden in denen ein Anruf bei einem Agenten klingelt, bevor der nächste Agent angefragt wird", - "CALLYSQUAREPROJECTPREVIEW": "Call-Flow wird vor der Zustellung an einen Agenten verwendet (Outbound-IVR)", - "CALLYSQUAREPROJECTPREVIEW2": "Call-Flow für den Transfer, wenn Anrufer aufgelegt hat oder nicht erreichbar ist", - "RUNIFHANGUPAGENT": "Call-Flow auch dann starten, wenn der Agent aufgelegt hat", - "CALLYSQUAREPROJECT2": "Call-Flow zur Weiterleitung des Anrufes nach der Warteschlange - Definiert durch Zeitüberschreitung", - "RANDOMLASTDIGITCALLERIDNUMBER": "Wenn der Wert größer als 0, werden die jeweils letzten Ziffern der ausgehenden Nummer zufällig generiert. (Hinweis: es dürfen nur real existierende und registrierte Nummern verwendet werden)", - "BUSYMAXRETRY": "Maximale Anzahl Wiederversuche bei \"Besetzt\" oder \"Fehlgeschlagen\"", - "BUSYRETRYTIME": "Zeit (in Minuten), für Wiederversuch bei \"Besetzt\" oder \"Fehlgeschlagen\"", - "MANDATORYDISPOSITIONPAUSEID": "Agentenstatus während der Qualifizierung eines Kontaktes", - "PREDICTIVEMAXTHRESHOLD": "Sofern der Prozentsatz der freien Agenten innerhalb des definierten Zeitraumes höher als der vorhergesagte Zeitraum ist, findet eine neue Kalkulation statt.", - "PREDICTIVEMINTHRESHOLD": "Sofern der Prozentsatz der freien Agenten innerhalb des definierten Zeitraumes niedriger als der vorhergesagte Zeitraum ist, findet eine neue Kalkulation statt.", - "ABANDONEDMAXRETRY": "Maximale Anzahl Wiederversuche bei \"Verlassen\"", - "ABANDONEDRETRYTIME": "Zeit (in Minuten), für Wiederversuch bei \"Verlassen\"", - "AGENTREJECTMAXRETRY": "Maximale Anzahl Wiederversuche, sofern der Anruf von einem Agenten abgelehnt wurde", - "AGENTREJECTRETRYTIME": "Zeit (in Minuten), vor einem Wiederversuch, wenn der Anruf von einem Agenten abgelehnt wurde", - "DROPMAXRETRY": "Maximale Anzahl Wiederversuche, beim Auflegen des System (Drop-Call)", - "DROPRETRYTIME": "Zeit (in Minuten), vor einem Wiederversuch beim Auflegen des Systems (Drop-Call)", - "MACHINEMAXRETRY": "Maximale Anzahl Wiederversuche wenn ein Anrufbeantworter erkannt wurde", - "MACHINERETRYTIME": "Zeit (in Minuten), vor einem Wiederversuch wenn ein Anrufbeantworter erkannt wurde", - "NOSUCHNUMBERETRYTIME": "Zeit (in Minuten), vor einem Wiederversuch bei \"Nummer falsch\" ", - "NOSUCHNUMBERMAXRETRY": "Maximale Anzahl Wiederversuche bei \"Nummer falsch\"", - "NOSUCHNUMBERRETRYTIME": "Zeit (in Minuten), vor einem Wiederversuch bei \"Nummer falsch\" ", + "TIMEOUT": "Gibt die Anzahl von Sekunden an, die ein Gerät klingeln.", + "CALLYSQUAREPROJECTPREVIEW": "Wenn Sie ein IVR-Projekt auswählen, leitet der Dialer den Anruf an das IVR weiter, wenn ein Agent antwortet (das IVR wird an den Agenten weitergeleitet).", + "CALLYSQUAREPROJECTPREVIEW2": "Wenn Sie ein IVR-Projekt auswählen, leitet der Dialer den Anruf an das IVR weiter, wenn ein Client aufgelegt oder nicht erreichbar ist (das IVR wird an den Agenten weitergeleitet).", + "RUNIFHANGUPAGENT": "Führen Sie Cally Square Project nach, auch wenn der Agent den Anruf auflegt", + "CALLYSQUAREPROJECT2": "Wenn Sie ein IVR-Projekt auswählen, leitet der Dialer den Anruf nach der Warteschlange an das IVR weiter. (Wenn die Warteschlange nach einer Zeitüberschreitung endet)", + "RANDOMLASTDIGITCALLERIDNUMBER": "Wenn es größer als 0 ist, erzeugt es die letzten Nummern zufällig aus der Nummer der abgehenden Anrufer-ID", + "BUSYMAXRETRY": "Maximale Anzahl, wie oft ein Kontakt angerufen wird, bevor er als geschlossen betrachtet wird, wenn der Anruf wegen Besetzt fehlschlägt", + "BUSYRETRYTIME": "Zeit in Minuten, bevor erneut versucht wird, einen fehlgeschlagenen Kontakt anzurufen, weil er beschäftigt ist", + "MANDATORYDISPOSITIONPAUSEID": "Pausenstatus, der während der Zwangsdisposition festgelegt werden soll", + "PREDICTIVEMAXTHRESHOLD": "Wenn der Prozentsatz der im Zeitfenster verfügbaren Agenten im Vergleich zu den zum Zeitpunkt der Vorhersage verfügbaren Agenten den konfigurierten Maximalwert überschreitet, berechnet die Vorhersage die Vorhersage neu.", + "PREDICTIVEMINTHRESHOLD": "Wenn der Prozentsatz der im Zeitfenster verfügbaren Agenten im Vergleich zu den zum Zeitpunkt der Vorhersage verfügbaren Agenten den konfigurierten Mindestgrenzwert überschreitet, berechnet die Vorhersage die Vorhersage neu.", + "ABANDONEDMAXRETRY": "Maximale Häufigkeit, mit der ein Kontakt angerufen wird, bevor er als geschlossen betrachtet wird, wenn der Anruf zum Abbrechen fehlgeschlagen ist", + "ABANDONEDRETRYTIME": "Zeit in Minuten, bevor versucht wird, einen fehlgeschlagenen Kontakt aufgrund eines Abbruchs erneut anzurufen", + "AGENTREJECTMAXRETRY": "Maximale Häufigkeit, mit der ein Kontakt angerufen wird, bevor er als geschlossen betrachtet wird, wenn der Anruf für die Ablehnung des Agenten fehlgeschlagen ist", + "AGENTREJECTRETRYTIME": "Zeit in Minuten, bevor versucht wird, einen fehlgeschlagenen Kontakt aufgrund einer Ablehnung des Agenten erneut anzurufen", + "DROPMAXRETRY": "Maximale Häufigkeit, mit der ein Kontakt angerufen wird, bevor er als geschlossen betrachtet wird, wenn der Anruf nicht beendet werden konnte", + "DROPRETRYTIME": "Zeit in Minuten, bevor versucht wird, einen fehlgeschlagenen Kontakt aufgrund eines Verbindungsabbruchs erneut anzurufen", + "MACHINEMAXRETRY": "Maximale Häufigkeit, mit der ein Kontakt angerufen wird, bevor er als geschlossen betrachtet wird, wenn der Anruf für die Maschine fehlgeschlagen ist", + "MACHINERETRYTIME": "Zeit in Minuten, bevor versucht wird, einen fehlgeschlagenen Kontakt aufgrund der Maschine erneut anzurufen", + "NOSUCHNUMBERETRYTIME": "Zeit in Minuten, bevor versucht wird, einen fehlgeschlagenen Kontakt erneut anzurufen, da keine solche Nummer vorhanden ist", + "NOSUCHNUMBERMAXRETRY": "Maximale Häufigkeit, mit der ein Kontakt angerufen wird, bevor er als geschlossen betrachtet wird, wenn der Anruf für keine solche Nummer fehlgeschlagen ist", + "NOSUCHNUMBERRETRYTIME": "Zeit in Minuten, bevor versucht wird, einen fehlgeschlagenen Kontakt erneut anzurufen, da keine solche Nummer vorhanden ist", "PREVIEW_AUTO_RECALL_ME": "Wenn aktiviert, generiert das System automatisch die Wiederanrufe für den Agent automatisch. Wenn deaktiviert, müssen diese Anrufe manuell geplant werden", "PREVIEW_RECALL_ME_REMINDER": "Wenn aktiviert, sendet das System n Minuten (entsprechend dem in den allgemeinen Einstellungen eingestellten Zeitintervall) eine Benachrichtigung an den Agenten, bevor die Rückrufnachricht generiert wird", "TIMEZONE": "Zeitzone angeben" }, - "MUSICONHOLD": "Wartemusik", - "ANNOUNCETOAGENT": "Ansagenachricht für Agenten", - "ANNOUNCEMENTS": "Ansagen", - "ADVANCEDPREVIEW": "Erweitert", - "ADVANCED": "Erweiterte Einstellungen", - "ADVANCE": "Erweitert", - "ANNOUNCEFREQUENCY": "Ansagefrequenz", - "MINANNOUNCEFREQUENCY": "Min. Frequenz Ansage", - "PERIODICANNOUNCEFREQUENCY": "Frequenz wiederkehrende Ansagen", - "RANDOMPERIODICANNOUNCE": "Zufälliges Abspielen der Ansagen", - "ANNOUNCEHOLDTIME": "Wartezeit ansagen", - "ANNOUNCECALLERPOSITION": "Warteposition ansagen", - "ANNOUNCEPOSITIONLIMIT": "Limit für Ansage Warteposition", - "REPORTHOLDTIMEAGENT": "Wartezeit dem Agenten ansagen", - "PERIODICANNOUNCE": "Wiederkehrende Ansagen", - "HOLDTIMEANNOUNCE": "Audiodatei für Ansage Wartezeit", - "YOUARENEXTANNOUNCE": "Audiodatei für Ansage der ersten Position", - "THEREAREANNOUNCE": "1. Teil Audiodatei für Ansage der bereits wartenden Anrufer", - "WAITINGCALLSANNOUNCE": "2. Teil Audiodatei für Ansage der bereits wartenden Anrufer", - "ESTIMATEDHOLDTIMEANNOUNCE": "Audiodatei für die Information zur geschätzten Wartezeit", - "MINUTESANNOUNCE": "Audiodatei für die Ansage \"Minuten\"", - "MINUTEANNOUNCE": "Audiodatei für die Ansage \"Minute\" ", - "SECONDSANNOUNCE": "Audiodatei für die Ansage \"Sekunden\"", - "THANKYOUANNOUNCE": "Audiodatei für die Ansage mit Dank für Geduld", - "AUTOPAUSE": "Automatische Pause bei keiner Antwort", - "AFTERCALLWORK": "Nacharbeit", - "AFTERCALLWORKDURATION": "Dauer Nacharbeit", - "RINGINUSE": "Klingeln bei Besetzt", - "MEMBERDELAY": "Anrufsverzögerung", - "TIMEOUTRESTART": "Zeitüberschreitung neu Starten", - "MONITORFORMAT": "Format für Gesprächsaufzeichnungen", - "SETINTERFACEVARIABLES": "Interface Variabeln definieren", - "SETQUEUEVARIABLES": "Warteschlangenvariabeln definieren", - "SETQUEUEENTRYVARIABLES": "Variabeln bei Eintritt definieren", - "CONTEXT": "Kontext Austritt aus Warteschlange", + "MUSICONHOLD": "Musik auf Halten", + "ANNOUNCETOAGENT": "Verkünden auf Agenten", + "ANNOUNCEMENTS": "Ankündigungen", + "ADVANCEDPREVIEW": "Erweiterte", + "ADVANCED": "Erweiterte", + "ADVANCE": "Erweiterte", + "ANNOUNCEFREQUENCY": "Frequenz ankündigen", + "MINANNOUNCEFREQUENCY": "Minimale verkünden Frequenz", + "PERIODICANNOUNCEFREQUENCY": "Periodische verkünden Frequenz", + "RANDOMPERIODICANNOUNCE": "Random Periodische verkünden", + "ANNOUNCEHOLDTIME": "Verkünden. Haltezeit", + "ANNOUNCECALLERPOSITION": "Verkünden Anrufer Position", + "ANNOUNCEPOSITIONLIMIT": "Verkünden Position Limit", + "REPORTHOLDTIMEAGENT": "Bericht Bedienplatz Haltezeit", + "PERIODICANNOUNCE": "Periodische verkünden", + "HOLDTIMEANNOUNCE": "Hold Zeit verkünden", + "YOUARENEXTANNOUNCE": "\"Sie sind weiter' verkünden", + "THEREAREANNOUNCE": "'Es gibt' verkünden", + "WAITINGCALLSANNOUNCE": "Wartende Anrufe verkünden", + "ESTIMATEDHOLDTIMEANNOUNCE": "Halten Sie die geschätzte Zeit verkünden", + "MINUTESANNOUNCE": "Minuten ankündigen", + "MINUTEANNOUNCE": "Minute verkünden", + "SECONDSANNOUNCE": "Sekunden verkünden", + "THANKYOUANNOUNCE": "\"Danke\" ankündigen", + "AUTOPAUSE": "Auto Pause", + "AFTERCALLWORK": "Arbeit nach Anruf", + "AFTERCALLWORKDURATION": "Arbeit nach Anruf Dauer", + "RINGINUSE": "Ring im Einsatz", + "MEMBERDELAY": "Die Verzögerung", + "TIMEOUTRESTART": "Timeout neu starten", + "MONITORFORMAT": "Aufzeichnungsformat", + "SETINTERFACEVARIABLES": "Set Interface Variablen", + "SETQUEUEVARIABLES": "Stellen Variablen", + "SETQUEUEENTRYVARIABLES": "Stellen ENTRY-Variablen", + "CONTEXT": "Kontext", "SAVE": "Speichern", "SETTINGS": "Einstellungen", - "INBOUNDROUTES": "Eingehende Routen", + "INBOUNDROUTES": "Ankommende Routen", "PHONENUMBER": "Telefonnummer", - "ADD_INBOUNDROUTE": "Eingehende Route hinzufügen", - "EDIT_INBOUNDROUTE": "Eingehende Route bearbeiten", - "DELETE_INBOUNDROUTE": "Eingehende Route löschen", - "ACTIONS": "Routing", - "OUTBOUNDROUTES": "Ausgehende Routen", - "DESTINATIONPATTERN": "Ziel-Pattern", - "ADD_OUTBOUNDROUTE": "Ausgehende Route hinzufügen", - "EDIT_OUTBOUNDROUTE": "Ausgehende Route bearbeiten", - "DELETE_OUTBOUNDROUTE": "Ausgehende Route löschen", - "CUTDIGITS": "Ziffern abschneiden", - "RECORDING": "Gesprächsaufzeichnung", + "ADD_INBOUNDROUTE": "Ankommende Route hinzufügen", + "EDIT_INBOUNDROUTE": "Bearbeiten Sie Eingehende Route", + "DELETE_INBOUNDROUTE": "Löschen Sie Eingehende Route", + "ACTIONS": "Aktionen", + "OUTBOUNDROUTES": "Abgehende Routen", + "DESTINATIONPATTERN": "Ziel Muster", + "ADD_OUTBOUNDROUTE": "Abgehende Route hinzufügen", + "EDIT_OUTBOUNDROUTE": "Abgehende Route bearbeiten", + "DELETE_OUTBOUNDROUTE": "Abgehende Route löschen", + "CUTDIGITS": "Schneiden Sie Ziffern", + "RECORDING": "Aufnahme", "RECORDINGFORMAT": "Aufzeichnungsformat", "INTERNALROUTES": "Interne Routen", - "ADD_INTERNALROUTE": "Interne Route hinzufügen", + "ADD_INTERNALROUTE": "Fügen Sie interne Route", "EDIT_INTERNALROUTE": "Interne Route bearbeiten", "DELETE_INTERNALROUTE": "Interne Route löschen", "CONTEXTS": "Kontexte", - "ADD_CONTEXT": "Kontext hinzufügen", - "EDIT_CONTEXT": "Kontext bearbeiten", - "DELETE_CONTEXT": "Kontext löschen", + "ADD_CONTEXT": "Rahmen hinzufügen", + "EDIT_CONTEXT": "Bearbeiten Kontext", + "DELETE_CONTEXT": "Löschen von Rahmen", "VOICEMAILS": "Voicemails", "ADD_VOICEMAIL": "Voicemail hinzufügen", - "EDIT_VOICEMAIL": "Voicemail bearbeiten", + "EDIT_VOICEMAIL": "Bearbeiten von Voicemail", "DELETE_VOICEMAIL": "Voicemail löschen", - "FULLNAME": "Vollständiger Name", + "FULLNAME": "Voller Name", "EMAIL": "E-Mail", "MAILBOX": "Mailbox", - "PASSWORD": "Passwort", + "PASSWORD": "Kennwort", "CONFIRM_PASSWORD": "Passwort bestätigen", "TIMEZONE": "Zeitzone", - "ATTACH": "Voicemail als E-Mail-Anhang senden", - "ENVELOPE": "Zeit und Datum ansagen", + "ATTACH": "Befestigen", + "ENVELOPE": "Umschlag", "DELETE": "Löschen", - "EMAILBODY": "E-Mail Text", + "EMAILBODY": "E-Mail-Text", "EMAILSUBJECT": "E-Mail Betreff", - "MAXSECONDS": "Max. Dauer (Sekunden) Voicemail", - "MAXMESSAGES": "Max. Nachrichten pro Mailbox", + "MAXSECONDS": "Max Sekunden", + "MAXMESSAGES": "Max. Nachrichten", "MESSAGES": "Nachrichten", "SORT": "Sortieren", - "ADD_MUSICONHOLD": "Wartemusik hinzufügen", - "MUSICONHOLDS": "Wartemusik", - "EDIT_MUSICONHOLD": "Wartemusik bearbeiten", - "DELETE_MUSICONHOLD": "Wartemusik löschen", - "DIRECTORY": "Lokales Verzeichnis", + "ADD_MUSICONHOLD": "Musik auf Halten", + "MUSICONHOLDS": "Musik auf Halten", + "EDIT_MUSICONHOLD": "Bearbeiten Musik auf Halten", + "DELETE_MUSICONHOLD": "Löschen Sie Musik auf Halten", + "DIRECTORY": "Verzeichnis", "AUDIOFILES": "Audiodateien", - "RECORDINGS": "Aufzeichnungen", - "CHANSPY": "Listen-In (Chanspy)", + "RECORDINGS": "Aufnahmen", + "CHANSPY": "ChanSpy", "PREFIX": "Präfix", "OPTIONS": "Optionen", - "AUTH": "Authentifizierung", - "ADD_CHANSPY": "Listen-In hinzufügen", - "EDIT_CHANSPY": "Listen-In bearbeiten", - "DELETE_CHANSPY": "Listen-In löschen", + "AUTH": "Auth", + "ADD_CHANSPY": "Chanspy hinzufügen", + "EDIT_CHANSPY": "Bearbeiten ChanSpy", + "DELETE_CHANSPY": "Löschen ChanSpy", "AGENTS": "Agenten", "TELEPHONES": "Telefone", "QUEUES": "Warteschlangen", - "QUEUE_CALLS": "Anrufe in Warteschlange", - "QUEUE_PARAMETERS": "Warteschlangen-Parameter", + "QUEUE_CALLS": "Anrufe aus der Warteschlange", + "QUEUE_PARAMETERS": "Queue Parameter", "ABANDONED_CALLS": "Abgebrochene Anrufe", "OUTBOUND_CALLS": "Ausgehende Anrufe", - "AGI": "Skript", + "AGI": "AGI", "DIAL": "Wählen", - "INTERNALDIAL": "Intern wählen", - "EXTERNALDIAL": "Extern wählen", - "RINGGROUP": "Rufgruppe zuweisen", + "INTERNALDIAL": "Interne Wahl", + "EXTERNALDIAL": "Externes Wählen", + "RINGGROUP": "Ring Gruppe", "PLAYBACK": "Wiedergabe", "QUEUE": "Warteschlange", - "SET": "Einstellen (Set)", + "SET": "Einstellen", "VOICEMAIL": "Voicemail", "GOTO": "Gehe zu", "HANGUP": "Auflegen", - "CUSTOM": "Benutzerdefiniert", - "PROJECT": "Call-Flow Projekt", - "TECHNOLOGY/RESOURCE": "Technologie / Ressource (z.B.: SIP/1003)", + "CUSTOM": "Benutzerdefinierte", + "PROJECT": "Cally-Square Projekt", + "TECHNOLOGY/RESOURCE": "Technologie / Ressource", "URL": "URL", - "EDIT_APP": "Anwendung bearbeiten", - "EDIT_INTERVAL": "Zeitintervall bearbeiten", + "EDIT_APP": "Bearbeiten Anwendung", + "EDIT_INTERVAL": "Bearbeiten Intervall", "DELETE_APP": "Anwendung löschen", - "INTERVALS": "Zeitintervalle", + "INTERVALS": "Intervalle", "USER": "Benutzer", - "TRUNK": "SIP-Trunk", + "TRUNK": "Amtsleitung", "PHONE": "Telefon", "AUDIO_FILES": "Audiodateien", - "ANNOUNCE_OVERRIDES": "Ansage überschreiben", + "ANNOUNCE_OVERRIDES": "Verkünden überschreibt", "MACRO": "Makro", "GOSUB": "GoSub", "RULE": "Regel", "POSITION": "Position", "ANSWER": "Antwort", "VALUE": "Wert", - "MAILBOX@CONTEXT": "Mailbox@Context", - "EXTENSION": "Nebenstelle", + "MAILBOX@CONTEXT": "Mailbox @ Rahmen", + "EXTENSION": "Erweiterung", "PRIORITY": "Priorität", - "HANGUP_CAUSE": "Auflegegrund", - "OUTBOUNDDIAL": "Ausgehend wählen", + "HANGUP_CAUSE": "Auflegen verursachen", + "OUTBOUNDDIAL": "Für ausgehende Anrufe wählen", "CALLER_ID": "Anrufer-ID", "NO_MESSAGE_AVAILABLE": "Keine Meldungen vorhanden", "NO_SOUND_AVAILABLE": "Kein Ton verfügbar", - "VOICERECORDINGS": "Sprachaufzeichnungen", - "CHANSPIES": "Listen-Ins", - "VOICE": "Anrufe", + "VOICERECORDINGS": "Sprachaufnahmen", + "CHANSPIES": "ChanSpy", + "VOICE": "Voice", "REALTIME": "Echtzeit", - "ID": "ID", + "ID": "Id", "VOICEMAIL_CONTEXT": "Kontext", "NO_MOHSOUND_AVAILABLE": "Keine Wartemusik verfügbar", "FILE": "Datei", - "ADD_MOHSOUND": "Wartemusik hinzufügen", - "DOWNLOAD_MOHSOUND": "Wartemusik herunterladen", - "DELETE_MOHSOUND": "Wartemusik löschen", + "ADD_MOHSOUND": "Musik hinzufügen Auf Klang", + "DOWNLOAD_MOHSOUND": "Download Music On Hold Sound", + "DELETE_MOHSOUND": "Löschen Sie Musik auf Halten Sound", "UNIQUEID": "Eindeutige ID", "AGENT": "Agent", "TYPE": "Typ", "RATING": "Bewertung", "AUDIO": "Audio", "DATE": "Datum", - "NEW_VOICEQUEUE": "Neue Anruf-Warteschlange", + "NEW_VOICEQUEUE": "Neue Stimme Warteschlange", "NEW_INBOUNDROUTE": "Neue eingehende Route", "NEW_OUTBOUNDROUTE": "Neue ausgehende Route", "NEW_INTERNALROUTE": "Neue interne Route", - "NEW_CONTEXT": "Neuer Kontext", + "NEW_CONTEXT": "Neuen Kontext", "NEW_VOICEMAIL": "Neue Voicemail", - "NEW_MUSICONHOLD": "Neue Wartemusik", - "NEW_CHANSPY": "Neues Listen-In", - "PENALTY": "Verzögerung", - "ADD_TEAM_TO_VOICEQUEUE": "Team zu Warteschlange hinzufügen", - "ADD_AGENT_TO_VOICEQUEUE": "Agenten zu Warteschlange hinzufügen", + "NEW_MUSICONHOLD": "Neue Musik auf Halten", + "NEW_CHANSPY": "Neue ChanSpy", + "PENALTY": "Strafe", + "ADD_TEAM_TO_VOICEQUEUE": "Team Voice Warteschlange hinzufügen", + "ADD_AGENT_TO_VOICEQUEUE": "Agent Voice Warteschlange hinzufügen", "EDIT_DIAL": "Kurzwahl bearbeiten", - "EDIT_AGI": "Skript bearbeiten", + "EDIT_AGI": "Bearbeiten AGI", "EDIT_INTERNALDIAL": "Interne Kurzwahl bearbeiten", "EDIT_EXTERNALDIAL": "Externe Kurzwahl bearbeiten", - "EDIT_RINGGROUP": "Rufgruppe bearbeiten", - "EDIT_PLAYBACK": "Wiedergabe bearbeiten", + "EDIT_RINGGROUP": "Gruppe bearbeiten", + "EDIT_PLAYBACK": "Bearbeiten Wiedergabe", "EDIT_QUEUE": "Warteschlange bearbeiten", "EDIT_SET": "Bearbeiten", - "EDIT_GOTO": "\"Gehe-zu\" bearbeiten", - "EDIT_HANGUP": "Auflegen bearbeiten", - "EDIT_CUSTOM": "Benutzerdef. Einstellungen bearbeiten", + "EDIT_GOTO": "Bearbeiten Gehe zu", + "EDIT_HANGUP": "Bearbeiten auflegen", + "EDIT_CUSTOM": "Bearbeiten Benutzerdefinierte", "DURATION": "Dauer", "RECEIVED_AT": "Eingegangen am", "YES": "Ja", - "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 = Nummer geändert", - "HANGUPCAUSE_27": "27 = Ziel außer Funktion", + "NO": "Keine", + "HANGUPCAUSE_1": "1 = Nicht zugewiesene Nummer", + "HANGUPCAUSE_16": "16=Normail Anruf löschen", + "HANGUPCAUSE_17": "17 = Benutzer besetzt", + "HANGUPCAUSE_18": "18 = Kein Benutzer reagiert (Telefon Gerät nicht angeschlossen)", + "HANGUPCAUSE_21": "21 = Anruf abgewiesen", + "HANGUPCAUSE_22": "22 = Anzahl geändert", + "HANGUPCAUSE_27": "27 = Ziel nicht in Ordnung", "HANGUPCAUSE_38": "38 = Netzwerk nicht in der richtigen Reihenfolge", "HANGUPCAUSE_41": "41 = Temporärer Ausfall", - "RANDOM": "Zufall", + "RANDOM": "Random", "ALPHABETICAL": "Alphabetisch", "NO_APPS_AVAILABLE": "Keine Anwendungen verfügbar", - "DOWNLOAD_VOICERECORDING": "Sprachaufzeichnung herunterladen", - "DELETE_VOICERECORDING": "Sprachaufzeichnung löschen", - "INTERNAL": "Intern", - "PHONE_STATE": "Status Nebenstelle", - "PHONE_STATUS": "SIP-Status Nebenstelle", + "DOWNLOAD_VOICERECORDING": "Download Voice Recording", + "DELETE_VOICERECORDING": "Löschen Sprachaufzeichnung", + "INTERNAL": "Interne", + "PHONE_STATE": "Telefonstatus", + "PHONE_STATUS": "Telefonstatus", "REGISTERED": "Registriert", - "UNREGISTERED": "Nicht registriert", - "LAGGED": "Verzögert", + "UNREGISTERED": "Unregistrierte", + "LAGGED": "Zurück", "REACHABLE": "Erreichbar", "UNREACHABLE": "Nicht erreichbar", "UNKNOWN": "Unbekannt", - "NOT_INUSE": "Nicht in Verwendung", - "INUSE": "In Verwendung", + "NOT_INUSE": "Nicht in Gebrauch", + "INUSE": "Im Einsatz", "BUSY": "Besetzt", "INVALID": "Ungültig", "UNAVAILABLE": "Nicht verfügbar", "RINGING": "Klingeln", - "ONHOLD": "Halten", - "RING": "Klingeln", - "UP": "Status", - "INFO": "Information", - "TRUNKS": "SIP-Trunks", + "ONHOLD": "Auf Halten", + "RING": "Ring", + "UP": "Bis", + "INFO": "Info", + "TRUNKS": "Amtsleitungen", "REGISTRY": "Registrierung", - "NO_REGISTRY": "Keine Registrierung", + "NO_REGISTRY": "Keine registry", "LOGGED_IN": "Angemeldet", "PAUSED": "Angehalten", - "DISPOSITION": "Qualifizierung", + "DISPOSITION": "Disposition", "WAITING": "Warten", - "TALKING": "Im Gespräch", - "DID": "DID", + "TALKING": "Sprechen", + "DID": "Haben", "CALLER": "Anrufer", - "TOTAL": "Gesamt", + "TOTAL": "Insgesamt", "ANSWERED": "Beantwortet", "ABANDONED": "Abgebrochen", - "UNMANAGED": "Nicht verwaltet", + "UNMANAGED": "Nicht verwaltete", "REDIRECT_TO_NUMBER": "Umleitung zu einer Nummer", - "REDIRECT_TO_AGENT": "Umleiten zu einem Agenten", + "REDIRECT_TO_AGENT": "Umleiten zu: Ein Agent", "CLOSING": "Schließen", - "AVG_HOLD_TIME": "Durchschnittl. Wartezeit", - "AVG_DURATION": "Durchschnittl. Dauer", - "AVG_BILLABLE": "Durchschnittl. fakturierbar", + "AVG_HOLD_TIME": "Durchschnittl. Warteschleifenzeit", + "AVG_DURATION": "Av-Dauer", + "AVG_BILLABLE": "Avg Fakturierbaren", "SOURCE": "Quelle", "DESTINATION": "Ziel", "REJECTED": "Abgelehnt", "FAILED": "Fehlgeschlagen", - "CALLED": "Angerufen", + "CALLED": "Aufgerufen", "CONNECTED": "Verbunden", "NO_RATING": "Keine Bewertung", - "EDIT_VOICERECORDING": "Sprachaufzeichnung bearbeiten/bewerten", + "EDIT_VOICERECORDING": "Edit Voice Recording", "APPLICATION_NAME": "Name der Anwendung", "ARGUMENTS": "Argumente", "EDIT_QUEUECAMPAIGN": "Kampagne bearbeiten", "LISTADD_QUEUECAMPAIGN": "Liste hinzufügen", - "BLACKLISTADD_QUEUECAMPAIGN": "Schwarze Liste hinzufügen", - "TEAMADD_QUEUECAMPAIGN": "Team hinzufügen", + "BLACKLISTADD_QUEUECAMPAIGN": "Blacklist hinzufügen", + "TEAMADD_QUEUECAMPAIGN": "Gruppe hinzufügen", "AGENTADD_QUEUECAMPAIGN": "Agent hinzufügen", "DELETE_QUEUECAMPAIGN": "Kampagne löschen", - "DELETE_IVRCAMPAIGN": "IVR-Kampagne löschen", + "DELETE_IVRCAMPAIGN": "Kampagne löschen", "EDIT_IVRCAMPAIGN": "Kampagne bearbeiten", "NEW_IVRCAMPAIGN": "Neue IVR-Kampagne", - "ADD_IVRCAMPAIGN": "IVR-Kampagne hinzufügen", + "ADD_IVRCAMPAIGN": "Hinzufügen IVR-Kampagne", "LISTADD_IVRCAMPAIGN": "Liste hinzufügen", - "BLACKLISTADD_IVRCAMPAIGN": "Schwarze Liste hinzufügen", - "ENABLED": "Aktiv", + "BLACKLISTADD_IVRCAMPAIGN": "Blacklist hinzufügen", + "ENABLED": "Aktiviert", "READY": "Bereit", "PAUSE": "Pause", - "UNPAUSE": "Pause abbrechen", - "DEFAULT_PAUSE": "Standardpause", - "AGENTADD_QUEUE": "Agent zur Warteschlange hinzufügen", - "AGENTSADD_QUEUE": "Agenten zur Warteschlange hinzufügen", - "ALL_TEAMS": "Alle Teams", + "UNPAUSE": "Pause", + "DEFAULT_PAUSE": "Standard Pause", + "AGENTADD_QUEUE": "Kampagne hinzufügen Agent in der Warteschlange", + "AGENTSADD_QUEUE": "Agents hinzufügen Kampagne in die Warteschlange", + "ALL_TEAMS": "Alle Mannschaften", "SELECTED_TEAMS": "Ausgewählte Teams", "ALL_LISTS": "Alle Listen", "SELECTED_LISTS": "Ausgewählte Listen", @@ -599,100 +599,100 @@ "WAITING_FOR_AGENT": "Warten auf Agenten", "TOTAL_OFFERED": "Insgesamt", "RUNNING": "Ausgeführt", - "TRUNK_IS_NOT_REACHABLE": "SIP-Trunk nicht erreichbar", - "AGENTS_NOT_LOGGED": "Keine Agenten angemeldet", + "TRUNK_IS_NOT_REACHABLE": "Trunk ist nicht erreichbar.", + "AGENTS_NOT_LOGGED": "Agent nicht angemeldet", "NOT_ACTIVE": "Nicht Aktiv", - "IS_DISACTIVED": "Deaktiviert", - "BACKUPTRUNK": "Backup SIP-Trunk", - "GLOBALINTERVAL": "Globales Intervall", - "RESCHEDULED_CONTACTS": "Erneut geplante Kontakte", - "INTERVAL_IS_OVERTIME": "Intervall außerhalb der Begrenzung", - "GLOBAL_INTERVAL_IS_OVERTIME": "Globales Intervall außerhalb der Begrenzung", + "IS_DISACTIVED": "Ist Disactived", + "BACKUPTRUNK": "Backup Trunk", + "GLOBALINTERVAL": "Globale Intervall", + "RESCHEDULED_CONTACTS": "Neu geplanten Kontakte", + "INTERVAL_IS_OVERTIME": "Intervall ist Überstunden", + "GLOBAL_INTERVAL_IS_OVERTIME": "Aus Intervall (Global)", "INTERVAL_IS_NULL": "Intervall ist Null", - "TIMEZONE_UNKNOW": "Zeitzone unbekannt", + "TIMEZONE_UNKNOW": "Zeitzone Unknow", "INTERVAL_IS_EMPTY": "Intervall ist leer", - "TOTAL_MANAGED": "Insgesamt bearbeitet", - "OPEN": "Offen", - "FRESH": "Neu", + "TOTAL_MANAGED": "Insgesamt verwaltet", + "OPEN": "Öffnen", + "FRESH": "Frische", "CLOSED": "Geschlossen", "ALWAYS": "Immer", - "NEVER": "Niemals", + "NEVER": "Nie", "ONLY_IF_OPEN": "Nur wenn offen", - "CHECKDUPLICATE": "Auf Duplikate prüfen", + "CHECKDUPLICATE": "Duplizieren", "PAGE": "Seite", "ROWSPERPAGE": "Zeilen pro Seite", - "OF": "von", - "TIMEOUT": "Zeitüberschreitung", + "OF": "Von", + "TIMEOUT": "Timeout", "CHAT": "Chat", "MAIL": "E-Mail", "SMS": "SMS", "OPENCHANNEL": "Offener Kanal", "FAX": "Fax", "NO_AGENT_ONLINE": "Kein Agent Online", - "PARTIALPAUSE": "Teilpause", + "PARTIALPAUSE": "Lastschriftzahlung teilweise Pause", "ALL": "Alle", "IDLE": "Leerlauf", "TIMER": "Timer", - "NO_AVAILABLE_INFO": "Keine Informationen verfügbar", - "CALLYSQUAREPROJECTPREVIEW": "Call-Flow bei Vorschau ", - "CALLYSQUAREPROJECTPREVIEW2": "Call-Flow nach Vorschau", - "RUNIFHANGUPAGENT": "Ausführen, nachdem Agent aufgelegt hat", - "CALLYSQUAREPROJECT2": "Call-Flow nach Warteschlange", + "NO_AVAILABLE_INFO": "Keine verfügbaren Informationen", + "CALLYSQUAREPROJECTPREVIEW": "Cally Square Projektvorschau", + "CALLYSQUAREPROJECTPREVIEW2": "Cally Square Projekt nach Vorschau", + "RUNIFHANGUPAGENT": "Führen Sie Cally Square Project nach, auch wenn der Agent den Anruf auflegt", + "CALLYSQUAREPROJECT2": "Cally Square Projekt nach der Warteschlange", "RESET": "Zurücksetzen", - "RESETLIST": "Liste zurücksetzen", - "RESETLIST_IVRCAMPAIGN": "Listen IVR-Kampagne zurücksetzen ", - "RESETLIST_QUEUECAMPAIGN": "Listen Kampagne zurücksetzen", - "SELECTALL": "Alles auswählen", - "UNSELECTALL": "Nichts auswählen", + "RESETLIST": "Listen zurücksetzen", + "RESETLIST_IVRCAMPAIGN": "Listen zurücksetzen", + "RESETLIST_QUEUECAMPAIGN": "Listen zurücksetzen", + "SELECTALL": "Wählen Sie Alle", + "UNSELECTALL": "Alles wiederufen", "HOPPERWIDGET": "Zusammenfassung", - "ABANDONEDCALLS": "Abgebrochene Anrufe", - "CLONE_QUEUECAMPAIGN": "Kampagne duplizieren", - "CLONE_IVRCAMPAIGN": "IVR-Kampagne duplizieren", - "RANDOMLASTDIGITCALLERIDNUMBER": "Zufällige letzte Ziffer ausgehende Nummer", - "CUTDIGIT": "Ziffern abschneiden", - "LOGIN_TIME": "Zeit angemeldet", - "PAUSE_TIME": "Zeit in Pause", + "ABANDONEDCALLS": "Verlassene Warteschlangenanrufe", + "CLONE_QUEUECAMPAIGN": "Warteschlangen-Kampagne klonen", + "CLONE_IVRCAMPAIGN": "Kampagne klonen", + "RANDOMLASTDIGITCALLERIDNUMBER": "Zufällige ausgehende Anrufer-ID-Nummer", + "CUTDIGIT": "Ziffern ausschneiden", + "LOGIN_TIME": "Login-Zeit", + "PAUSE_TIME": "Pausenzeit", "RECALLINQUEUE": "Rückruf in der Warteschlange", "REFRESH_SCHEDULED_CALLS": "Geplante Anrufe aktualisieren", "SCHEDULED_CALLS": "Geplante Anrufe", - "SELECT_CAMPAIGN": "Kampagne auswählen", + "SELECT_CAMPAIGN": "Wählen Sie Kampagne", "SELECT_DATE": "Datum auswählen", - "SELECT_TYPE": "Typ auswählen", - "TEAMS_ASSOCIATION": "Teamzuweisung", - "ANSWERING_MACHINE": "Anrufbeantworter", - "MANDATORYDISPOSITION": "Qualifizierung erforderlich", - "MANDATORYDISPOSITIONPAUSEID": "Pause während Qualifizierung", + "SELECT_TYPE": "Art auswählen", + "TEAMS_ASSOCIATION": "Vereinigung der Mannschaften", + "ANSWERING_MACHINE": "Antwortmaschine", + "MANDATORYDISPOSITION": "Zwingende Disposition", + "MANDATORYDISPOSITIONPAUSEID": "Status der obligatorischen Dispositionspause", "ANSWERED_CALLS": "Beantwortete Anrufe", "AVG_TALK_TIME": "Durchschnittliche Gesprächszeit", "CURRENT_INTERVAL": "Aktuelles Intervall", "DATA_COLLECTION_IN_PROGRESSIVE": "Datenerfassung in Progressive", - "ONE_CALL_EVERY": "Ein Anruf pro Teilnehmer", - "PREDICTIVEMAXTHRESHOLD": "Max Schwellwert für Predictive (%)", - "PREDICTIVEMINTHRESHOLD": "Min Schwellwert für Predictive (%)", - "PREDICTIVE_IS_NOT_RUNNING": "Predictive-Dialing nicht aktiv", - "PREDICTIVE_IS_RUNNING": "Predictive-Dialing aktiv", + "ONE_CALL_EVERY": "Ein Anruf für jeden", + "PREDICTIVEMAXTHRESHOLD": "Voraussagender maximaler Schwellenwert [%]", + "PREDICTIVEMINTHRESHOLD": "Predictive Min Threshold [%]", + "PREDICTIVE_IS_NOT_RUNNING": "Predictive läuft nicht", + "PREDICTIVE_IS_RUNNING": "Predictive läuft", "PREVIOUS_INTERVAL": "Vorheriges Intervall", - "SHOW_PREDICTIVE_QUEUE_CAMPAIGN_INFO": "Informationen bei Vorschau zeigen", - "THRESHOLDS": "Schwellwerte", - "TOTAL_CALLS": "Anrufe gesamt", - "ABANDONEDMAXRETRY": "Max. Wiederversuche bei \"Abandon\"", - "ABANDONEDRETRYTIME": "Frühester Wiederversuch nach (Min)", - "AGENTREJECT": "Ablehnung durch Agenten", - "AGENTREJECTMAXRETRY": "Max. Wiederversuche bei \"Ablehnung durch Agenten\"", - "AGENTREJECTRETRYTIME": "Frühester Wiederversuch nach (Min)", - "DROP": "Aufgelegt vom System (Drop-Call)", - "DROPMAXRETRY": "Max Wiederversuche bei Drop-Calls", - "DROPRETRYTIME": "Frühester Wiederversuch nach (Min)", - "MACHINE": "Anrufbeantworter", - "MACHINEMAXRETRY": "Max Wiederversuche bei Anrufbeantworter", - "MACHINERETRYTIME": "Frühester Wiederversuch nach (Min)", - "NOSUCHNUMBER": "Gegenstelle nicht gefunden", - "NOSUCHNUMBERMAXRETRY": "Max Wiederversuche bei Gegenstelle nicht gefunden", - "NOSUCHNUMBERRETRYTIME": "Frühester Wiederversuch nach (Min)", - "TOOLTIP_SCREENRECORDING_OFF": "Bildschirmaufzeichnung verfügbar", - "TOOLTIP_SCREENRECORDING_ON": "Bildschirmaufzeichnung läuft", - "SECOND_LEVEL_DISPOSITION": "Qualifizierung 2. Ebene", - "THIRD_LEVEL_DISPOSITION": "Qualifikation 3. Ebene", + "SHOW_PREDICTIVE_QUEUE_CAMPAIGN_INFO": "Vorhersage-Info anzeigen", + "THRESHOLDS": "Schwellenwerte", + "TOTAL_CALLS": "Anrufe insgesamt", + "ABANDONEDMAXRETRY": "Max Wiederholungen", + "ABANDONEDRETRYTIME": "Wiederholungszeit [min]", + "AGENTREJECT": "Agent ablehnen", + "AGENTREJECTMAXRETRY": "Max Wiederholungen", + "AGENTREJECTRETRYTIME": "Wiederholungszeit [min]", + "DROP": "Fallen", + "DROPMAXRETRY": "Max Wiederholungen", + "DROPRETRYTIME": "Wiederholungszeit [min]", + "MACHINE": "Maschine", + "MACHINEMAXRETRY": "Max Wiederholungen", + "MACHINERETRYTIME": "Wiederholungszeit [min]", + "NOSUCHNUMBER": "Keine solche Nummer", + "NOSUCHNUMBERMAXRETRY": "Max Wiederholungen", + "NOSUCHNUMBERRETRYTIME": "Wiederholungszeit [min]", + "TOOLTIP_SCREENRECORDING_OFF": "Bildschirmaufnahme verfügbar", + "TOOLTIP_SCREENRECORDING_ON": "Bildschirmaufnahme läuft", + "SECOND_LEVEL_DISPOSITION": "Disposition der zweiten Ebene", + "THIRD_LEVEL_DISPOSITION": "Disposition der dritten Ebene", "PREVIEW_AUTO_RECALL_ME": "Rückrufe automatisieren", "PREVIEW_RECALL_ME_REMINDER": "Recall Me Erinnerung", "ADDITIONALPHONES": "Zusätzliche Telefone", diff --git a/public/app/main/apps/motiondialer/i18n/pt-BR.json b/public/app/main/apps/motiondialer/i18n/pt-BR.json index 6f70beb..b761bec 100644 --- a/public/app/main/apps/motiondialer/i18n/pt-BR.json +++ b/public/app/main/apps/motiondialer/i18n/pt-BR.json @@ -23,7 +23,7 @@ "NO_AGENT_ONLINE": "Nenhum agente online", "PARTIALPAUSE": "Pausa Parcial", "ALL": "Todos", - "IDLE": "Ocioso", + "IDLE": "Disponível", "TIMER": "Tempo", "MOVE_HOPPERFINAL": "Restaurar contato", "RESTORECONTACTS": "Restaurar Contatos", diff --git a/public/app/main/apps/openchannel/i18n/de.json b/public/app/main/apps/openchannel/i18n/de.json index d234e7a..0ef1225 100644 --- a/public/app/main/apps/openchannel/i18n/de.json +++ b/public/app/main/apps/openchannel/i18n/de.json @@ -1,271 +1,271 @@ { "OPENCHANNEL": { "TEXT": "Text", - "TIMES": "Zeitstempel", - "EDIT_AUTOREPLY": "Automatische Antwort bearbeiten", + "TIMES": "Die Anzahl der Zeiten pro Interaktion", + "EDIT_AUTOREPLY": "Bearbeiten Sie automatische Antwort", "AUTOREPLY": "Automatische Antwort", "NAME": "Name", - "OPENCHANNELQUEUES": "Warteschlangen", - "SEARCH_FOR_ANYONE": "Suche", + "OPENCHANNELQUEUES": "Offener Kanal Warteschlangen", + "SEARCH_FOR_ANYONE": "Suche für Jedermann", "ERRORS": { - "TEXT_REQUIRED": "Text erforderlich", - "NAME_REQUIRED": "Name erforderlich", - "AGENT_TIMEOUT_REQUIRED": "Zeitüberschreitung Agent erforderlich", - "MOTIONADDRESS_REQUIRED": "Adresse erforderlich", - "MOTIONADDRESS_MUST_VALID_URL": "Ungültiges Format Adresse", - "ACCEPTURL_MUST_VALID_URL": "Ungültiges Format URL", - "TIMEOUT_REQUIRED": "Zeitüberschreitung erforderlich", - "REJECTURL_MUST_VALID_URL": "Ungültiges Format URL bei Erhalt", - "CLOSEURL_MUST_VALID_URL": "Ungültiges Format URL bei Schließen", - "REPLYURI_REQUIRED": "URL bei Antwort erforderlich", - "REPLYURI_MUST_VALID_URL": "Ungültiges Format URL bei Antwort", - "PRIORITY_REQUIRED": "Priorität erforderlich", - "CONDITION_REQUIRED": "Bedingung erforderlich", - "TRUEPRIORITY_REQUIRED": "Priorität bei zutreffender Bedingung erforderlich", - "FALSEPRIORITY_REQUIRED": "Priorität bei nicht zutreffender Bedingung erforderlich", - "AGENT_REQUIRED": "Agent erforderlich", - "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung muss größer oder gleich sein als", - "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Priorität muss größer oder gleich sein als", - "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Priorität bei Bedingung erfüllt muss größer oder gleich sein als", - "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Priorität bei Bedingung nicht erfüllt muss größer oder gleich sein als", - "DISPOSITION_REQUIRED": "Qualifizierung erforderlich", - "QUEUE_REQUIRED": "Warteschlange erforderlich", - "KEY_MAX_LENGTH": "Wert darf nicht länger als {{max}} Zeichen sein", - "TEXT_MAX_LENGTH": "Text darf nicht länger als {{max}} Zeichen sein", - "VALUE_REQUIRED": "Wert erforderlich", - "COMMAND_REQUIRED": "Eingabe erforderlich", - "LIST_REQUIRED": "Liste erforderlich", - "KEY_REQUIRED": "Schlüssel erforderlich", - "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung Agent muss größer oder gleich sein als", - "NAME_MUST_VALID_PATTERN": "Ungültiges Format Name", - "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung muss kleiner oder gleich sein als", - "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung Agent 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": "Auf zugewiesenen Agenten warten erforderlich", - "TAG_REQUIRED": "Tag erforderlich", - "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung muss größer oder gleich sein als", - "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung muss kleiner oder gleich sein als", - "AGENTTRANSFERTIMEOUT_REQUIRED": "Zeitüberschreitung Agententransfer erforderlich", - "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung muss größer oder gleich sein als", - "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung muss kleiner oder gleich sein als", - "QUEUETRANSFERTIMEOUT_REQUIRED": "Zeitüberschreitung Warteschlangentransfer erforderlich", - "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "PausenID während Qualifizierung erforderlich", - "ACCESSKEYID_REQUIRED": "Zugangsschlüssel-ID erforderlich", - "BOTNAME_REQUIRED": "BOT-Name erforderlich", - "SECRETACCESSKEY_REQUIRED": "Geheimer Schlüssel erforderlich", - "CLIENTEMAIL_REQUIRED": "Kunden E-Mail erforderlich", - "PRIVATEKEY_REQUIRED": "Privater Schlüssel erforderlich", - "PROJECTID_REQUIRED": "ProjektID erforderlich" + "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", + "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", + "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", + "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", + "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_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_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", + "CLIENTEMAIL_REQUIRED": "Pflichtfeld", + "PRIVATEKEY_REQUIRED": "Pflichtfeld", + "PROJECTID_REQUIRED": "Pflichtfeld" }, - "STRATEGY": "Verteilungsstrategie", + "STRATEGY": "Strategie", "AGENT": "Agent", - "GOTO": "GeheZu (GoTo)", - "GOTOIF": "GeheZuWenn (GoToIf)", - "NOOP": "Log erstellen (NoOp)", + "GOTO": "Gehe zu", + "GOTOIF": "Gotoif", + "NOOP": "Noop", "QUEUE": "Warteschlange", - "EDIT_AGENT": "Agenten bearbeiten", - "EDIT_GOTO": "\"GeheZu\" bearbeiten", - "EDIT_NOOP": "Log-Erstellung bearbeiten", - "EDIT_GOTOIF": "Bedingung bearbeiten und Priorität zuweisen", + "EDIT_AGENT": "Agent bearbeiten", + "EDIT_GOTO": "Bearbeiten Gehe zu", + "EDIT_NOOP": "Bearbeiten Noop", + "EDIT_GOTOIF": "Bearbeiten Gotoif", "EDIT_QUEUE": "Warteschlange bearbeiten", - "CONDITION": "Bedingung", - "TRUEPRIORITY": "Priorität, wenn erfüllt (true)", - "FALSEPRIORITY": "Priorität, wenn nicht erfüllt (false)", + "CONDITION": "Zustand", + "TRUEPRIORITY": "Wahre Priorität", + "FALSEPRIORITY": "Falsche Priorität", "VALUE": "Wert", "PRIORITY": "Priorität", - "AGENT_TIMEOUT": "Zeitüberschreitung Agent", + "AGENT_TIMEOUT": "Agent Timeout", "DESCRIPTION": "Beschreibung", - "ADD_OPENCHANNELQUEUE": "Warteschlange hinzufügen", - "EDIT_OPENCHANNELQUEUE": "Warteschlange bearbeiten", - "DELETE_OPENCHANNELQUEUE": "Warteschlange löschen", - "PENALTY": "Verzögerung", + "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", "TEAMADD_OPENCHANNELQUEUE": "Team zur Warteschlange hinzufügen", - "AGENTADD_OPENCHANNELQUEUE": "Agenten zur Warteschlange hinzufügen", + "AGENTADD_OPENCHANNELQUEUE": "Agent zur Warteschlange hinzufügen", "ALL_AGENTS": "Alle Agenten", "SELECTED_AGENTS": "Ausgewählte Agenten", "CREATED_AT": "Erstellt am", "SAVE": "Speichern", "SETTINGS": "Einstellungen", "GENERAL": "Allgemein", - "OPENCHANNELACCOUNTS": "Konten offener Kanal", + "OPENCHANNELACCOUNTS": "Offener Kanal Konten", "MOTIONADDRESS": "Motion Adresse", - "ADD_OPENCHANNELACCOUNT": "Konto offener Kanal hinzufügen", - "EDIT_OPENCHANNELACCOUNT": "Konto offener Kanal bearbeiten", - "DELETE_OPENCHANNELACCOUNT": "Konto offener Kanal löschen", + "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.", "API": "API", - "DISPOSITIONS": "Qualifizierungen", + "DISPOSITIONS": "Bestimmungen", "WEBHOOKS": "WebHooks", - "ACTIONS": "Routing", + "ACTIONS": "Aktionen", "LIST": "Liste", "FIDELITY": "Treue", "ACCEPT": "Akzeptieren", - "ACCEPTMETHOD": "Methode akzeptieren", + "ACCEPTMETHOD": "Die Methode", "ACCEPTURL": "URL akzeptieren", "REJECT": "Ablehnen", "REJECTMETHOD": "Methode ablehnen", "REJECTURL": "URL ablehnen", - "CLOSE": "Schließen", - "CLOSEMETHOD": "Methode schließen", - "CLOSEURL": "URL schließen", - "SELECTED": "Ausgewählt", - "SELECT_ALL": "Alles auswählen", - "SELECT_NONE": "Nichts auswählen", + "CLOSE": "In der Nähe", + "CLOSEMETHOD": "In der Nähe Methode", + "CLOSEURL": "Der URL", + "SELECTED": "Ausgewählte", + "SELECT_ALL": "Alle auswählen", + "SELECT_NONE": "Wählen Sie \"Keine\"", "BACK": "Zurück", "OPENCHANNEL": "Offener Kanal", - "ID": "ID", - "TIMEOUT": "Zeitüberschreitung", - "OPENCHANNELDISPOSITIONS": "Qualifizierungen offener Kanal", - "NO_OPENCHANNELDISPOSITION_AVAILABLE": "Keine Qualifizierungen verfügbar", - "NEW_OPENCHANNELDISPOSITION": "Neue Qualifizierung", - "ADD_OPENCHANNELDISPOSITION": "Qualifizierung 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", + "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", "SELECTED_TEAMS": "Ausgewählte Teams", "REPLYURI": "Antwort URL", - "RECEIVEURI": "URL bei Erhalt", + "RECEIVEURI": "Erhalten URL", "HELP": { - "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", + "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", "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 aqui ", "RECEIVEURI": "Cadeia de caracteres da API gerada automaticamente para ser usada para receber mensagens dentro de seu canal aberto a partir do aplicativo externo (usando o método POST). Clique no botão da área de transferência para copiá-lo", "REPLYURI": "O URL que o canal aberto irá chamar ao enviar ou responder a uma mensagem. Para obter mais detalhes, consulte o documento aqui ", "NAME": "Somente números, letras e caracteres específicos (._) são suportados", - "LIST": "Lista de contatos", + "LIST": "Lista de contatos do gerenciador usada para associar contatos", "MANDATORYDISPOSITION": "Disposição obrigatória", "MANDATORYDISPOSITIONPAUSEID": "Pausar para usar se a disposição obrigatória estiver ativada", "WELCOMEMESSAGE": "Esta é a primeira mensagem enviada ao contator" }, "PAGE": "Página", - "ROWSPERPAGE": "Linhas por página", + "ROWSPERPAGE": "Linhas por Página", "OF": "do", "CONTACT": "Contato", "STARTEDAT": "Começou às", @@ -203,9 +203,9 @@ "SELECT_ACCOUNT": "Selecione uma conta", "GOTOP": "Gotop", "EDIT_GOTOP": "Editar Gotop", - "EDIT_CLOSE": "Editar fechamento", + "EDIT_CLOSE": "Editar Fechar", "INFO": "Informação", - "KEY": "Chave", + "KEY": "Key", "UNKNOWN": "Desconhecido", "UNREGISTERED": "Não registrado", "UNAVAILABLE": "Indisponível", @@ -214,14 +214,14 @@ "IN_USE": "Em uso", "AGENTS": "Agentes", "QUEUES": "Filas", - "FULLNAME": "Nome completo", + "FULLNAME": "Nome Completo", "INTERNAL": "Interno", "PHONE_STATE": "Estado do telefone", "PHONE_STATUS": "Status do telefone", "PAUSE": "Pausa", "LOGOUT": "Sair", "AGENTADD_QUEUE": "Adicionar agente à fila de Open Channel", - "UNPAUSE": "Sair da pausa", + "UNPAUSE": "Finalizar Pausa", "DEFAULT_PAUSE": "Pausa padrão", "LOGGED_IN": "Logado", "PAUSED": "Pausado", @@ -232,28 +232,28 @@ "MAIL": "Email", "SMS": "SMS", "FAX": "Fax", - "AGENTSADD_QUEUE": "Adicionar agentes à fila do Open Channel", - "INTERACTIONS_OPENCHANNELACCOUNT": "Ir para interações", - "REFRESH_INTERACTIONS": "Atualizar interações", + "AGENTSADD_QUEUE": "Adicionar agentes à fila de Open Channel", + "INTERACTIONS_OPENCHANNELACCOUNT": "Ir para Interações", + "REFRESH_INTERACTIONS": "Atualizar Interações", "DELETE_INTERACTION": "Excluir interação", "AGENTADD_OPENCHANNELACCOUNT": "Adicionar agente à conta do Openchannel", - "CANNED_ANSWER_SEARCH": "Digite um texto para pesquisar uma resposta pronta", - "CANNED_ANSWER_NOT_FOUND": "Nenhuma resposta pronta foi encontrada", + "CANNED_ANSWER_SEARCH": "Digite um texto para pesquisar uma resposta automática", + "CANNED_ANSWER_NOT_FOUND": "Nenhuma resposta automática foi encontrada", "SEND": "Enviar", "TO": "Para", - "MAPKEY": "Mapkey", + "MAPKEY": "Map Key", "TEAMS_ASSOCIATION": "Associação de equipes", "MANDATORYDISPOSITION": "Disposição obrigatória", - "MANDATORYDISPOSITIONPAUSEID": "ID de pausa de disposição obrigatória", - "DIALOGFLOW": "Dialogflow", - "EDIT_DIALOGFLOW": "Editar configuração do Dialogflow", + "MANDATORYDISPOSITIONPAUSEID": "Pausar para usar se a disposição obrigatória estiver ativada", + "DIALOGFLOW": "Fluxo de Diálogo", + "EDIT_DIALOGFLOW": "Editar configuração do fluxo de diálogo", "LANGUAGE": "Língua", "WELCOMEMESSAGE": "Mensagem de boas-vindas", "ACCESSKEYID": "ID da chave de acesso", "AMAZONLEX": "AmazonLex", - "BOTNAME": "Nome do BOT", + "BOTNAME": "Nome do bot", "EDIT_AMAZONLEX": "Editar configuração de Lex", - "LEXREGION": "Região de LEX", + "LEXREGION": "Região", "SECRETACCESSKEY": "Segredo da chave de acesso", "TOOLTIP_SCREENRECORDING_OFF": "Gravação de tela disponível", "TOOLTIP_SCREENRECORDING_ON": "Gravação de tela em andamento", @@ -262,7 +262,7 @@ "LASTMESSAGE": "Última mensagem", "CLIENTEMAIL": "Email do cliente", "DIALOGFLOWV2": "Dialogflow V2", - "EDIT_DIALOGFLOWV2": "Editar DialogflowV2", + "EDIT_DIALOGFLOWV2": "Editar Dialogflow V2", "PRIVATEKEY": "Chave privada", "PROJECTID": "ID do projeto", "ADD_NOTE": "Adicionar nota", diff --git a/public/app/main/apps/settings/i18n/de.json b/public/app/main/apps/settings/i18n/de.json index 6b076e6..aa643d6 100644 --- a/public/app/main/apps/settings/i18n/de.json +++ b/public/app/main/apps/settings/i18n/de.json @@ -1,69 +1,69 @@ { "SETTINGS": { - "PREFERRED": "Bevorzugtes Logo", - "DEFAULT_PREFERRED": "Standard bevorzugtes Logo", + "PREFERRED": "Preferred Logo", + "DEFAULT_PREFERRED": "Default Preferred Logo", "MOTIONBAR": "Motionbar", "WEBRTC": "WebRTC", "RELOAD": "Neu laden", - "VERIFY": "Einstellungen testen", + "VERIFY": "Überprüfen Sie, ob", "INTERFACE": "Schnittstelle", "UPDATING": "Aktualisierung", "REMOTE_VERSION": "Remote-Version", "NO_NEW_VERSION_AVAILABLE": "Keine neue Version verfügbar", - "TOP_N_PROCESSES": "Top {{value}} Prozesse", - "SYSTEM": "System und Server", - "FILE_SYSTEM": "Dateisystem", + "TOP_N_PROCESSES": "Top {{Wert}} Prozesse", + "SYSTEM": "System", + "FILE_SYSTEM": "File System", "PROCESSES": "Prozesse", - "MOUNT_POINT": "Mount", - "AVG_LOAD": "Durchschnittliche Auslastung", + "MOUNT_POINT": "Berg", + "AVG_LOAD": "AVG Laden", "TOTAL": "Gesamt", - "USED": "in Verwendung", - "FREE": "Frei", + "USED": "Verwendet", + "FREE": "Kostenlos", "NAME": "Name", "STATE": "Zustand", "CHAT": "Chat", "MAIL": "E-Mail", - "MESSAGING": "SMS", + "MESSAGING": "Sms", "FAX": "Fax", "OPENCHANNEL": "Offener Kanal", "AGENTS": "Agenten", "USERS": "Benutzer", - "TELEPHONES": "Endgeräte", + "TELEPHONES": "Telefone", "STAFF": "Personal", - "CHANNELS": "Kanäle", + "CHANNELS": "Tv", "MODULES": "Module", - "CM": "Kontaktmanager", + "CM": "Contacts Manager", "DIALER": "Dialer", "JSCRIPTY": "Jscripty", - "CUSTOM": "WhiteLabel", - "UPDATE": "Aktualisieren", + "CUSTOM": "Anpassung", + "UPDATE": "Update", "OTHERS": "Andere", "SETTINGS": "Einstellungen", "GENERAL": "Allgemein", - "SMTP": "SMTP-Einstellungen", + "SMTP": "SMTP", "NETWORKS": "Netzwerke", - "UPDATES": "System-Updates", + "UPDATES": "Aktuelles", "LICENSE": "Lizenz", - "ID": "ID", - "MIN_INTERNAL": "Min. interne Durchwahl", - "MIN_MAILBOX": "Min Mailbox-ID", + "ID": "Id", + "MIN_INTERNAL": "Min. Interne", + "MIN_MAILBOX": "Min Mailbox", "INSTALLED_AT": "Installiert", - "SEARCH_FOR_ANYONE": "Suche", - "EDIT_GENERAL": "Bearbeiten Allgemein", - "SECURE_PASSWORD": "Sicheres Passwort", + "SEARCH_FOR_ANYONE": "Suche für Jedermann", + "EDIT_GENERAL": "Allgemein bearbeiten", + "SECURE_PASSWORD": "Sicheres Kennwort", "LOGO": "Logo", - "DEFAULT_LOGO": "Logo für Anwendung", - "DEFAULT_LOGIN_LOGO": "Logo auf Anmeldebildschirm", - "WHITELABEL": "WhiteLabel", + "DEFAULT_LOGO": "Standard Logo", + "DEFAULT_LOGIN_LOGO": "Login Logo", + "WHITELABEL": "White Label", "CREATED_AT": "Erstellt am", "SAVE": "Speichern", - "SMTP_SERVICE": "SMTP-Dienst", + "SMTP_SERVICE": "Service", "SMTP_HOST": "SMTP-Host", "SMTP_USERNAME": "SMTP-Benutzername", "DESCRIPTION": "Beschreibung", "SMTP_PASSWORD": "SMTP-Passwort", "SMTP_PORT": "SMTP-Port", - "SMTP_SECURE": "Sicheren SMTP verwenden", + "SMTP_SECURE": "Sichere", "TYPE": "Typ", "ADDRESS": "Adresse", "NEW_NETWORK": "Neues Netzwerk", @@ -71,67 +71,67 @@ "HELP": { "ADDRESS": "Die Adresse des Netzwerks", "LOCALNETADDRESS": "IP-Adresse/Subnetzmaske", - "SMTP_SECURE": "TLS für SMTP deaktivieren/aktivieren", - "SMTP_USERNAME": "Nutzername für die Authentifizierung", - "SMTP_PASSWORD": "Passwort für die Authentifizierung", - "EMAILADDRESS": "E-Mail Adresse für die Authentifizierung (Von-Feld)", + "SMTP_SECURE": "Bei true wird die Verbindung TLS verwenden, wenn eine Verbindung zu Server", + "SMTP_USERNAME": "Benutzername für die Authentifizierung verwendet werden", + "SMTP_PASSWORD": "Kennwort für die Authentifizierung verwendet werden", + "EMAILADDRESS": "Geben Sie die E-Mail-Adresse der Nachricht (von)", "SECURITY_SUITE": "Aktiviert das sichere Passwort-Format, das obligatorische Zurücksetzen des Passworts nach der ersten Anmeldung und den Ablauf des Passworts nach 90 Tagen", - "MOTIONBARREMEMBERME": "Aktivieren/Deaktivieren der Funktion \"Merken\" in MotionPhonebar", + "MOTIONBARREMEMBERME": "Aktivieren / Deaktivieren der Funktion \"Merken\" in Motion Phonebar", "RTLSUPPORT": "Aktiviert die RTL-Unterstützung für Arabisch, Persisch und Hebräisch", - "DEFAULTSCREENRECORDINGPATH": "Interner Pfad für die Speicherung von Bildschirmaufzeichnungen (leer lassen für den Standardpfad des Videoordners)", - "LOGINMAILFREQUENCY": "Bitte den E-Mail Dienst nach Änderung der Frequenz neu starten", + "DEFAULTSCREENRECORDINGPATH": "Geben Sie den Pfad ein, in dem die Bildschirmaufzeichnungsdateien auf dem Agent-Computer gespeichert werden sollen (leer lassen für den Standardpfad für den Videoordner).", + "LOGINMAILFREQUENCY": "Bitte denken Sie daran, den EMAIL-Dienst jedes Mal neu zu starten, wenn dieser Parameter geändert wurde", "PASSWORD": "Passwort", "USERNAME": "Nutzername", - "ENFORCE_PASSWORD_HISTORY": "Passwortverlauf prüfen", - "PASSWORD_HISTORY_LIMIT": "Max. Anzahl der zuletzt verwendeten Passwörter", - "SEARCH_ON_ENTER_KEY": "Suche nach Drücken der Eingabetaste starten", - "INTERACTIONS_RELOAD_TIMEOUT": "Zeitintervall in Sekunden, in welchem Interaktionen neu geladen werden (0 = Echtzeitaktualisierung)", + "ENFORCE_PASSWORD_HISTORY": "Aktiviert die Validierung anhand zuvor verwendeter Kennwörter", + "PASSWORD_HISTORY_LIMIT": "Anzahl der zuletzt zu überprüfenden eindeutigen Kennwörter", + "SEARCH_ON_ENTER_KEY": "Beginnen Sie erst mit der Suche, nachdem der Agent die Eingabetaste gedrückt hat", + "INTERACTIONS_RELOAD_TIMEOUT": "Zeitintervall in Sekunden, nach dem Interaktionen neu geladen werden (0 = Echtzeitaktualisierung)", "PRIVACY_POLICY": "Anzahl der Zeichen, die durch ein Sternchen (*) ersetzt werden (0 = alle Zeichen)", "CLIENT_SECRET": "Das Geheimnis ist nach dem Speichern der Konfiguration nicht mehr sichtbar. Bewahren Sie es sicher auf, wenn Sie es woanders verwenden möchten.", "LIMIT_TABS": "Maximale Anzahl möglicher geöffneter Interaktionsregisterkarten", "PREVIEW_RECALLME_REMINDER_INTERVAL": "Zeitintervall in Minuten, vor dem eine Benachrichtigung an den Agenten gesendet wird, die ihn über den durchzuführenden Vorschaurückruf informiert" }, "ERRORS": { - "ADDRESS_REQUIRED": "Adresse erforderlich", - "MIN_INTERNAL_REQUIRED": "Minimale interne Durchwahl erforderlich", - "MIN_MAILBOX_REQUIRED": "Mailbox erforderlich", - "NAME_REQUIRED": "Name erforderlich", - "HEADER_WHITELABEL_REQUIRED": "WhiteLabel erforderlich", + "ADDRESS_REQUIRED": "Die Adresse ist erforderlich", + "MIN_INTERNAL_REQUIRED": "Die minimale interne ist erforderlich", + "MIN_MAILBOX_REQUIRED": "Die Mailbox ist erforderlich", + "NAME_REQUIRED": "Der Name ist erforderlich", + "HEADER_WHITELABEL_REQUIRED": "Die whitelabel ist erforderlich", "LOCALNETADDRESS_REQUIRED": "Localnet Adresse erforderlich", - "LOCALNETADDRESS_MUST_VALID_PATTERN": "Ungültiges Format Localnet Adresse", - "ADDRESS_MUST_VALID_PATTERN": "Ungültiges Format Adresse", - "ACCOUNTNAME_REQUIRED": "Kontoname erforderlich", - "SMTP_USERNAME_REQUIRED": "Benutzername erforderlich", - "PASSWORD_REQUIRED": "Passwort erforderlich", - "SMTP_HOST_REQUIRED": "SMTP-Host erforderlich", - "SMTP_PORT_REQUIRED": "SMTP-Port erforderlich", - "MIN_INTERNAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Min. interne Durchwahl muss größer oder gleich sein als", - "MIN_MAILBOX_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Min. Mailbox muss größer oder gleich sein als", - "PAGE_TITLE_REQUIRED": "Seitentitel erforderlich", - "EMAIL_REQUIRED": "E-Mail erforderlich", - "PLAN_REQUIRED": "Plan erforderlich", - "MOTIONBARAUTOUPDATERURL_MUST_VALID_URL": "Ungültiges Format URL", - "MOTIONBARAUTOUPDATERURL_REQUIRED": "URL MotionBar erforderlich", - "EMAIL_MUST_VALID": "Ungültiges Format E-Mail", - "LICENSE_REQUIRED": "Lizenz erforderlich", - "CHATTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein als", - "CHATTIMEOUT_REQUIRED": "Zeitüberschreitung Chat erforderlich", - "ALLOWEDLOGINATTEMPTS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein als", - "ALLOWEDLOGINATTEMPTS_REQUIRED": "Max. Anzahl Anmeldeversuche erforderlich", - "BLOCKDURATION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein als", - "BLOCKDURATION_REQUIRED": "Dauer der Sperrung erforderlich", - "LOGINMAILFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein als", - "LOGINMAILFREQUENCY_REQUIRED": "Frequenz für Abrufen E-Mail erforderlich", - "USERNAME_REQUIRED": "Nutzername erforderlich", - "ACCESSKEY_REQUIRED": "Zugangsschlüssel erforderlich", - "BUCKET_REQUIRED": "Eingabe erforderlich", - "LANGUAGE_REQUIRED": "Sprache erforderlich", - "SECRETACCESSKEY_REQUIRED": "Geheimer Zugangsschlüssel erforderlich", - "SENTIMENTACCOUNT_REQUIRED": "Konto für Sentimentanalyse erforderlich", - "SENTIMENTREGION_REQUIRED": "Region für Sentimentanalyse erforderlich", - "SERVICE_REQUIRED": "Dienst erforderlich", - "TRANSCRIBEACCOUNT_REQUIRED": "Konto zur Transkribierung erforderlich", - "TRANSCRIBEREGION_REQUIRED": "Region für Transkribierung erforderlich", + "LOCALNETADDRESS_MUST_VALID_PATTERN": "Localnet gültig sein muss eine gültige Muster", + "ADDRESS_MUST_VALID_PATTERN": "Adresse muss eine gültige Muster sein", + "ACCOUNTNAME_REQUIRED": "Das Konto Name ist erforderlich", + "SMTP_USERNAME_REQUIRED": "Der Benutzername ist erforderlich", + "PASSWORD_REQUIRED": "Das Kennwort ist erforderlich", + "SMTP_HOST_REQUIRED": "Der Host wird benötigt", + "SMTP_PORT_REQUIRED": "Der Port ist erforderlich", + "MIN_INTERNAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die Min-internen muss größer als oder gleich", + "MIN_MAILBOX_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die Min-Mailbox muss größer als oder gleich", + "PAGE_TITLE_REQUIRED": "Pflichtfeld", + "EMAIL_REQUIRED": "Pflichtfeld", + "PLAN_REQUIRED": "Pflichtfeld", + "MOTIONBARAUTOUPDATERURL_MUST_VALID_URL": "Falsches Format", + "MOTIONBARAUTOUPDATERURL_REQUIRED": "Pflichtfeld", + "EMAIL_MUST_VALID": "Falsches Format", + "LICENSE_REQUIRED": "Pflichtfeld", + "CHATTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", + "CHATTIMEOUT_REQUIRED": "Pflichtfeld", + "ALLOWEDLOGINATTEMPTS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", + "ALLOWEDLOGINATTEMPTS_REQUIRED": "Pflichtfeld", + "BLOCKDURATION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", + "BLOCKDURATION_REQUIRED": "Pflichtfeld", + "LOGINMAILFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", + "LOGINMAILFREQUENCY_REQUIRED": "Pflichtfeld", + "USERNAME_REQUIRED": "Pflichtfeld", + "ACCESSKEY_REQUIRED": "Pflichtfeld", + "BUCKET_REQUIRED": "Pflichtfeld", + "LANGUAGE_REQUIRED": "Pflichtfeld", + "SECRETACCESSKEY_REQUIRED": "Pflichtfeld", + "SENTIMENTACCOUNT_REQUIRED": "Pflichtfeld", + "SENTIMENTREGION_REQUIRED": "Pflichtfeld", + "SERVICE_REQUIRED": "Pflichtfeld", + "TRANSCRIBEACCOUNT_REQUIRED": "Pflichtfeld", + "TRANSCRIBEREGION_REQUIRED": "Pflichtfeld", "FIELD_REQUIRED": "Pflichtfeld", "PREVIEW_RECALLME_REMINDER_INTERVAL_REQUIRED": "Pflichtfeld", "WRONG_FORMAT": "Falsches Format", @@ -140,100 +140,100 @@ "EDIT_NETWORK": "Netzwerk bearbeiten", "DELETE_NETWORK": "Netzwerk löschen", "BACK": "Zurück", - "SELECTED": "Ausgewählt", - "SELECT_ALL": "Alles auswählen", - "SELECT_NONE": "Nichts auswählen", + "SELECTED": "Ausgewählte", + "SELECT_ALL": "Alle auswählen", + "SELECT_NONE": "Wählen Sie \"Keine\"", "EXPIRATION_DATE": "Ablaufdatum", "REQUEST_LICENSE": "Lizenz anfordern", "EMAIL": "E-Mail", "SEND": "Senden", "PLAN": "Plan", - "MONTH_TO_MONTH": "Monatlich", - "MOTION_PROCESS_MANAGEMENT": "Prozessverwaltung", + "MONTH_TO_MONTH": "Von Monat zu Monat", + "MOTION_PROCESS_MANAGEMENT": "Motion Process Management", "USEFUL_COMMANDS": "Nützliche Befehle", "COMMAND": "Befehl", "PM2_LIST": "Eine Liste aller Prozesse", "PM2_START": "Starten eines Prozesses durch ID oder Name", - "PM2_STOP": "Stoppen Sie einen Prozess-ID oder Name, fügen Sie\n\"All\", um alle aktiven Prozesse zu stoppen", + "PM2_STOP": "Stoppen Sie einen Prozess-ID oder Name, fügen Sie \"Alle\", um alle aktiven Prozesse", "PM2_RESTART": "Starten Sie einen Prozess, durch ID oder Name", "PM2_LOGS": "Alle Protokolle Stream Datei, oder spezifische eines Prozess-ID oder Name", "PASSWORD": "Passwort", - "NO_AVAILABLE_INFO": "Keine Informationen verfügbar", - "STUNADDR": "STUN-Adresse", + "NO_AVAILABLE_INFO": "Keine verfügbaren Info", + "STUNADDR": "Die STUN-Adresse", "CHANGELOG": "Changelog", "CURRENT_VERSION": "Aktuelle Version", - "CUSTOMIZATIONS": "WhiteLabel", + "CUSTOMIZATIONS": "Anpassungen", "LOCALNETADDRESS": "Localnet Adresse", "NEW_VERSION": "Neue Version", "TRIAL_VERSION": "Testversion", "TOKEN": "Token", - "NEW_TOKEN_DETECTED": "Neuer Token erkannt", - "EXPIRATION_GRAY_PERIOD": "Ablauf Testperiode", - "NEW_TOKEN": "Neuer Token", + "NEW_TOKEN_DETECTED": "Neue Token erkannt", + "EXPIRATION_GRAY_PERIOD": "Grau Zeitraum Ablauf", + "NEW_TOKEN": "Neue Token", "PRICES": "Preise", "UPDATE_LICENSE": "Lizenz aktualisieren", - "LOGOLOGIN": "Login-Logo", - "EXPIRATION_REASON": "Ablaufgrund", - "GLOBAL": "Globale Einstellungen", + "LOGOLOGIN": "Login Logo", + "EXPIRATION_REASON": "Ablauf Grund", + "GLOBAL": "Global", "SMTP_AUTHENTICATION": "Authentifizierung", - "LICENSE_REQUEST_SENT": "Vielen Dank! Die Lizenz wurde angefragt. Bei Fragen wenden Sie sich bitte an unseren Support.", - "ACCOUNTNAME": "Kontoname", - "EMAILADDRESS": "E-Mail Adresse", - "OLD_TOKEN": "Alter Token", + "LICENSE_REQUEST_SENT": "Vielen Dank! Die Lizenzierung Team wird Sie in Ihrem Konto so schnell wie möglich um Ihre Wünsche zu genehmigen: erhalten Sie eine e-Mail, wenn die Änderungen wirksam werden. Lesen Sie bitte für weitere Informationen an License@xcally.com.", + "ACCOUNTNAME": "Konto Name", + "EMAILADDRESS": "E-mail Adresse", + "OLD_TOKEN": "Alte Token", "SEND_EMAIL_TO": "E-Mail senden an", - "JIRA_ERROR_MESSAGE": "Fehler bei der Anforderung der Lizenz. Bitte kontaktieren Sie unseren Support.", + "JIRA_ERROR_MESSAGE": "Fehler während der Lizenz anfordern. Bitte kontaktieren Sie unser Team bei License@xcally.com mit Ihrer Anfrage", "PAGE": "Seite", "ROWSPERPAGE": "Zeilen pro Seite", - "OF": "von", - "SMTP_SSL": "SMTP verwendet SSL-Verschlüsselung", + "OF": "Von", + "SMTP_SSL": "SMTP-SSL", "ENABLED": "Aktiviert", "DISABLED": "Deaktiviert", "UNLIMITED_CHANNELS": "Unbegrenzte Anzahl von Kanälen", - "PAGE_TITLE": "Seitentitel", - "DEFAULT_PAGE_TITLE": "Standard-Seitentitel", - "CALLYSQUARE": "CallySquare", - "DEFAULT_HEADER_WHITELABEL": "WhiteLabel Standardfußzeile", - "HEADER_WHITELABEL": "WhiteLabel Fußzeile", - "EXPIRATION_REASON_MESSAGE_CHANGED": "Die eindeutige ID des Systems wurde aufgrund der Änderungen aktualisiert. Bitte kontaktieren Sie unseren Support.", - "CALL_RECORDING_ENCRYPTION": "Verschlüsselung Gesprächsaufzeichnungen", - "TURNADDR": "TURN-Adresse", - "TURN_USERNAME": "TURN-Nutzername", - "TURN_PASSWORD": "TURN-Passwort", - "PERPETUAL": "Dauerlizenz", + "PAGE_TITLE": "Titel der Seite", + "DEFAULT_PAGE_TITLE": "Standard Seitentitel", + "CALLYSQUARE": "Cally Square", + "DEFAULT_HEADER_WHITELABEL": "White Label Standardfußzeile", + "HEADER_WHITELABEL": "White Label Fußzeile", + "EXPIRATION_REASON_MESSAGE_CHANGED": "Ihre Maschine eindeutige Id wurde aufgrund einer Änderung an Ihrem System aktualisiert. Kontakt xCALLY Motion Support Team Ihre alte und Ihre neue uuid zu senden.", + "CALL_RECORDING_ENCRYPTION": "Sprachaufnahme-Verschlüsselung", + "TURNADDR": "Adresse", + "TURN_USERNAME": "TURN Benutzername", + "TURN_PASSWORD": "Passwort ändern", + "PERPETUAL": "Unaufhörlich", "SECURITY_SUITE": "Sicherheitssuite", "ANNUALLY": "Jährlich", - "MOTIONBARAUTOUPDATER": "Automatisches Updates MotionBar", - "MOTIONBARAUTOUPDATERURL": "URL für automatische Updates", - "JAWS": "JAWS", + "MOTIONBARAUTOUPDATER": "Automatischer Updater", + "MOTIONBARAUTOUPDATERURL": "Automatische Updater-URL", + "JAWS": "Jaws", "ENABLEEMAILPREVIEW": "E-Mail-Vorschau aktivieren", "REPORT": "Bericht", - "SPLIT": "Teilen", - "SPLITSIZECSV": "Berichtgröße teilen [CSV-Format]", - "SPLITSIZEPDF": "Berichtgröße teilen [PDF-Format]", - "SPLITSIZEXLSX": "Berichtgröße teilen [XLSX-Format]", - "AGENTOMNIDESKTOPINTERFACE": "Omnichannel Agentenanwendung", + "SPLIT": "Bericht teilen", + "SPLITSIZECSV": "Berichtgröße teilen [CSV-Datensätze]", + "SPLITSIZEPDF": "Split-Berichtsgröße [PDF-Datensätze]", + "SPLITSIZEXLSX": "Split-Berichtsgröße [XLSX-Datensätze]", + "AGENTOMNIDESKTOPINTERFACE": "Agent Omni Desktopschnittstelle", "MESSAGESALIGNMENT": "Nachrichtenausrichtung", - "ENTER_LICENSE": "Lizenz einfügen", - "EXPIRATION_CHANGED_ADVISE": "Bitte wenden Sie sich an unseren Support und halten Sie Ihre alte und neue UUID bereit.", + "ENTER_LICENSE": "Geben Sie Ihre Lizenz ein", + "EXPIRATION_CHANGED_ADVISE": "Wenden Sie sich an das xCALLY Motion License Team und senden Sie Ihre alte und Ihre neue Uuid.", "EXPIRATION_REASON_MESSAGE_DISABLED": "Ihre Lizenz wurde deaktiviert.", "UPDATE_LICENSE_MANUALLY": "Möchten Sie Ihre Lizenz manuell aktualisieren?", "ADDONS": "Add-Ons", "SESSIONS": "Sitzungen", - "VIRTUAL": "Chat", - "VOICE": "Sprachanrufe", - "CHATTIMEOUT": "Automatisches Schließen Chat nach", - "MOTIONBARREMEMBERME": "Anmeldedaten merken", + "VIRTUAL": "Plaudern", + "VOICE": "Stimme", + "CHATTIMEOUT": "Chat schließt Interaktionszeitlimit", + "MOTIONBARREMEMBERME": "Erinnere dich an mich", "RTLSUPPORT": "RTL-Unterstützung", - "DEFAULTSCREENRECORDINGPATH": "Pfad für Bildschirmaufzeichnungen", - "SCREENRECORDING": "Bildschirmaufzeichnung", + "DEFAULTSCREENRECORDINGPATH": "Bildschirmaufzeichnungspfad", + "SCREENRECORDING": "Bildschirmaufnahme", "VIDEO": "Video", - "BLOCKDURATION": "Dauer automatisches Sperren (Minuten)", + "BLOCKDURATION": "Minuten vor dem automatischen Entsperren warten", "SECURITY": "Sicherheit", - "ALLOWEDLOGINATTEMPTS": "Zulässige Anmeldeversuche vor dem Sperren des Benutzers/Agenten", + "ALLOWEDLOGINATTEMPTS": "Zulässige Anmeldeversuche vor dem Sperren des Benutzers / Agenten", "DEFAULT_FAVICON": "Standard-Favicon", "FAVICON": "Favicon", - "IMAPGENERALSETTINGS": "IMAP-Einstellungen", - "LOGINMAILFREQUENCY": "Frequenz Mail-Login (Sek.)", + "IMAPGENERALSETTINGS": "IMAP", + "LOGINMAILFREQUENCY": "Anmelde-Mail-Häufigkeit (Sek.)", "USERNAME": "Nutzername", "GOOGLE_SSO_ENABLED": "Google SSO aktiviert", "SSO": "SSO", @@ -242,33 +242,33 @@ "AI": "A.I. Werkzeuge", "AITOOLS": "A.I. Werkzeuge", "APPZONE": "App Zone", - "BUCKET": "Korb", + "BUCKET": "Eimer", "DELETE": "Löschen", "DELETE_CLOUDPROVIDER": "Konto löschen", "EDIT_CLOUDPROVIDER": "Konto bearbeiten", "LANGUAGE": "Sprache", "NEW_CLOUDPROVIDER": "Neues Konto", "SECRETACCESSKEY": "Geheimer Zugangsschlüssel", - "SENTIMENTACCOUNT": "Konto für Sentimentanalyse", - "SENTIMENTANALYSIS": "Sentimentanalyse", - "SENTIMENTREGION": "Region für Sentimentanalyse", - "SERVICE": "Dienst", + "SENTIMENTACCOUNT": "Sentiment Analysis Account", + "SENTIMENTANALYSIS": "Stimmungsanalyse", + "SENTIMENTREGION": "Sentiment Analysis Region", + "SERVICE": "Bedienung", "TRANSCRIBE": "Transkribieren", - "TRANSCRIBEACCOUNT": "Transkription Konto", - "TRANSCRIBEREGION": "Transkription Region", + "TRANSCRIBEACCOUNT": "Konto transkribieren", + "TRANSCRIBEREGION": "Region transkribieren", "WHATSAPP": "WhatsApp Connector", - "ENFORCE_PASSWORD_HISTORY": "Speichern Passwortverlauf", - "PASSWORD_HISTORY_LIMIT": "Max gespeicherte Passwörter", - "SEARCH_ON_ENTER_KEY": "Suche durch Drücken der Eingabetaste starten", - "CHAT_INTERACTIONS_RELOAD_TIMEOUT": "Zeitlimit für das erneute Laden von Chat-Interaktionen", + "ENFORCE_PASSWORD_HISTORY": "Kennwortverlauf erzwingen", + "PASSWORD_HISTORY_LIMIT": "Kennwortverlaufslimit", + "SEARCH_ON_ENTER_KEY": "Suchen Sie mit der Eingabetaste", + "CHAT_INTERACTIONS_RELOAD_TIMEOUT": "Zeitüberschreitung beim erneuten Laden von Chat-Interaktionen", "MAIL_INTERACTIONS_RELOAD_TIMEOUT": "Zeitlimit für das erneute Laden von E-Mail-Interaktionen", - "OPENCHANNEL_INTERACTIONS_RELOAD_TIMEOUT": "Zeitlimit für das erneute Laden von Open Channel-Interaktionen", - "SMS_INTERACTIONS_RELOAD_TIMEOUT": "Zeitlimit für das erneute Laden von SMS-Interaktionen", - "WHATSAPP_INTERACTIONS_RELOAD_TIMEOUT": "Zeitlimit für das erneute Laden von WhatsApp-Interaktionen ", - "PRIVACY_POLICY_EMAIL": "Maskierung von E-Mail Adressen", - "PRIVACY_POLICY_NAME": "Maskierung von Kundennamen", - "PRIVACY_POLICY_NUMBER": "Maskierung von Nummern", - "STOP_RECORDING_ON_VOICE_CALL_TRANSFER": "Gesprächsaufzeichnung bei Transfer stoppen", + "OPENCHANNEL_INTERACTIONS_RELOAD_TIMEOUT": "Zeitüberschreitung beim erneuten Laden von Open Channel-Interaktionen", + "SMS_INTERACTIONS_RELOAD_TIMEOUT": "Zeitüberschreitung beim erneuten Laden von SMS-Interaktionen", + "WHATSAPP_INTERACTIONS_RELOAD_TIMEOUT": "WhatsApp Connector-Interaktionen laden das Zeitlimit neu", + "PRIVACY_POLICY_EMAIL": "Datenschutzerklärung für E-Mail-Adressen", + "PRIVACY_POLICY_NAME": "Datenschutzerklärung für Namen", + "PRIVACY_POLICY_NUMBER": "Datenschutzerklärung für Nummern", + "STOP_RECORDING_ON_VOICE_CALL_TRANSFER": "Beenden Sie die Aufzeichnung bei Sprachanrufweiterleitung", "AD_SSO_ENABLED": "Active Directory SSO aktiviert", "APPLICATION_ID": "Anwendungs-ID", "AUTHENTICATE": "Authentifizieren", diff --git a/public/app/main/apps/settings/i18n/pt-BR.json b/public/app/main/apps/settings/i18n/pt-BR.json index 5ccbf9c..58f29ba 100644 --- a/public/app/main/apps/settings/i18n/pt-BR.json +++ b/public/app/main/apps/settings/i18n/pt-BR.json @@ -1,6 +1,6 @@ { "SETTINGS": { - "PREFERRED": "Logotipo Preferido", + "PREFERRED": "Logotipo preferido", "DEFAULT_PREFERRED": "Logotipo preferido padrão", "MOTIONBARREMEMBERME": "Lembre de mim", "CHATTIMEOUT": "Tempo limite de interação de fechamento de chat", @@ -27,7 +27,7 @@ "CALLYSQUARE": "Cally Square", "ENABLED": "Ativado", "DISABLED": "Desativado", - "UNLIMITED_CHANNELS": "Canais Ilimitados", + "UNLIMITED_CHANNELS": "Canais ilimitados", "RELOAD": "Recarregar", "VERIFY": "Verificar", "INTERFACE": "Interface", diff --git a/public/app/main/apps/sms/i18n/de.json b/public/app/main/apps/sms/i18n/de.json index 9a01507..cddbe68 100644 --- a/public/app/main/apps/sms/i18n/de.json +++ b/public/app/main/apps/sms/i18n/de.json @@ -3,72 +3,72 @@ "KEY": "Schlüssel", "NAME": "Name", "SMSQUEUES": "SMS-Warteschlangen", - "SEARCH_FOR_ANYONE": "Suche", - "STRATEGY": "Verteilungsstrategie", + "SEARCH_FOR_ANYONE": "Suche für Jedermann", + "STRATEGY": "Strategie", "ERRORS": { - "KEY_MAX_LENGTH": "Wert darf nicht länger als {{max}} Zeichen sein", - "KEY_REQUIRED": "Schlüssel erforderlich", - "NAME_REQUIRED": "Name erforderlich", - "AGENT_TIMEOUT_REQUIRED": "Zeitüberschreitung Agent erforderlich", - "PHONE_REQUIRED": "Telefonnummer erforderlich", - "SID_REQUIRED": "SID erforderlich", - "TOKEN_REQUIRED": "Token erforderlich", - "USERNAME_REQUIRED": "Nutzername erforderlich", - "PASSWORD_REQUIRED": "Passwort erforderlich", - "MOTIONADDRESS_REQUIRED": "Adresse erforderlich", - "MOTIONADDRESS_MUST_VALID_URL": "Ungültiges Format Adresse", - "ACCEPTURL_MUST_VALID_URL": "Ungültiges Format URL", - "TIMEOUT_REQUIRED": "Zeitüberschreitung erforderlich", - "REJECTURL_MUST_VALID_URL": "Ungültiges Format URL bei Ablehnen", - "CLOSEURL_MUST_VALID_URL": "Ungültiges Format URL bei Schließen", - "TYPE_REQUIRED": "Typ erforderlich", - "LIST_REQUIRED": "Liste erforderlich", - "PRIORITY_REQUIRED": "Priorität erforderlich", - "CONDITION_REQUIRED": "Bedingung erforderlich", - "TRUEPRIORITY_REQUIRED": "Priorität bei zutreffender Bedingung erforderlich", - "FALSEPRIORITY_REQUIRED": "Priorität bei nicht zutreffender Bedingung erforderlich", - "AGENT_REQUIRED": "Agent erforderlich", - "QUEUE_REQUIRED": "Warteschlange erforderlich", - "DISPOSITION_REQUIRED": "Qualifizierung erforderlich", - "ACCOUNTSID_REQUIRED": "Konto-SID erforderlich", - "AUTHTOKEN_REQUIRED": "Token für Authentifizierung erforderlich", - "MOTIONPROXY_REQUIRED": "Proxy erforderlich", - "MOTIONPROXY_MUST_VALID_URL": "Ungültiges Format Proxy", - "TEXT_MAX_LENGTH": "Text darf nicht länger als {{max}} Zeichen sein", - "TEXT_REQUIRED": "Text erforderlich", - "VALUE_REQUIRED": "Wert erforderlich", - "SENDERSTRING_MAX_LENGTH": "Wert darf nicht länger als {{max}} Zeichen sein", - "SENDERSTRING_MUST_VALID_PATTERN": "Ungültiges Format SENDER", - "METHOD_REQUIRED": "Methode erforderlich", - "AUTHID_REQUIRED": "AUTH_ID erforderlich", - "COMMAND_REQUIRED": "Eingabe erforderlich", - "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung Agent muss größer oder gleich sein als", - "NAME_MUST_VALID_PATTERN": "Ungültiges Format Name", - "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung muss kleiner oder gleich sein als", - "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung Agent 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": "Auf zugewiesenen Agenten warten erforderlich", - "TAG_REQUIRED": "Tag erforderlich", - "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung muss größer oder gleich sein als", - "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung muss kleiner oder gleich sein als", - "AGENTTRANSFERTIMEOUT_REQUIRED": "Zeitüberschreitung Agententransfer erforderlich", - "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung muss größer oder gleich sein als", - "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung muss kleiner oder gleich sein als", - "QUEUETRANSFERTIMEOUT_REQUIRED": "Zeitüberschreitung Warteschlangentransfer erforderlich", - "APIKEY_REQUIRED": "API-Key erforderlich", - "BASEURL_REQUIRED": "Base_URL erforderlich", - "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "PausenID während Qualifizierung erforderlich", - "ACCESSKEYID_REQUIRED": "Zugangsschlüssel-ID erforderlich", - "BOTNAME_REQUIRED": "BOTName erforderlich", - "SECRETACCESSKEY_REQUIRED": "Geheimer Zugangsschlüssen erforderlich", - "CLIENTEMAIL_REQUIRED": "Kunden E-Mail erforderlich", - "PRIVATEKEY_REQUIRED": "Privater Schlüssel erforderlich", - "PROJECTID_REQUIRED": "ProjektID erforderlich", - "ACCOUNTID_REQUIRED": "AccountID erforderlich", - "APPLICATIONID_REQUIRED": "AnwendungsID erforderlich" + "KEY_MAX_LENGTH": "Schlüssel muss eine maximale Länge von {{max}}", + "KEY_REQUIRED": "Schlüssel ist erforderlich", + "NAME_REQUIRED": "Der Name ist erforderlich", + "AGENT_TIMEOUT_REQUIRED": "Der Agent Timeout ist erforderlich", + "PHONE_REQUIRED": "Die Telefonnummer ist erforderlich", + "SID_REQUIRED": "Die SID ist erforderlich", + "TOKEN_REQUIRED": "Das Token ist erforderlich", + "USERNAME_REQUIRED": "Der Benutzername ist erforderlich", + "PASSWORD_REQUIRED": "Das Kennwort 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", + "TYPE_REQUIRED": "Der Typ ist erforderlich", + "LIST_REQUIRED": "Die Liste ist erforderlich", + "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", + "AGENT_REQUIRED": "Der Agent ist erforderlich", + "QUEUE_REQUIRED": "Die Warteschlange ist erforderlich", + "DISPOSITION_REQUIRED": "Die Disposition ist erforderlich", + "ACCOUNTSID_REQUIRED": "Konto SID ist erforderlich", + "AUTHTOKEN_REQUIRED": "Auth Token ist erforderlich", + "MOTIONPROXY_REQUIRED": "Pflichtfeld", + "MOTIONPROXY_MUST_VALID_URL": "Falsches Format", + "TEXT_MAX_LENGTH": "Der Wert muss eine maximale Länge von {{max}} haben", + "TEXT_REQUIRED": "Pflichtfeld", + "VALUE_REQUIRED": "Pflichtfeld", + "SENDERSTRING_MAX_LENGTH": "Der Wert muss eine maximale Länge von {{max}} haben", + "SENDERSTRING_MUST_VALID_PATTERN": "Falsches Format", + "METHOD_REQUIRED": "Pflichtfeld", + "AUTHID_REQUIRED": "Pflichtfeld", + "COMMAND_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", + "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_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_REQUIRED": "Pflichtfeld", + "APIKEY_REQUIRED": "Pflichtfeld", + "BASEURL_REQUIRED": "Pflichtfeld", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Pflichtfeld", + "ACCESSKEYID_REQUIRED": "Die Zugangsschlüssel-ID ist erforderlich", + "BOTNAME_REQUIRED": "Bot Name ist erforderlich", + "SECRETACCESSKEY_REQUIRED": "Zugriffsschlüsselgeheimnis ist erforderlich", + "CLIENTEMAIL_REQUIRED": "Pflichtfeld", + "PRIVATEKEY_REQUIRED": "Pflichtfeld", + "PROJECTID_REQUIRED": "Pflichtfeld", + "ACCOUNTID_REQUIRED": "Pflichtfeld", + "APPLICATIONID_REQUIRED": "Pflichtfeld" }, - "AGENT_TIMEOUT": "Zeitüberschreitung Agent", + "AGENT_TIMEOUT": "Agent Timeout", "DESCRIPTION": "Beschreibung", "ADD_SMSQUEUE": "SMS-Warteschlange hinzufügen", "EDIT_SMSQUEUE": "SMS-Warteschlange bearbeiten", @@ -83,213 +83,213 @@ "SID": "SID", "TOKEN": "Token", "SMSTYPE": "SMS-Typ", - "USERNAME": "Nutzername", + "USERNAME": "Benutzername", "PASSWORD": "Passwort", "MOTIONADDRESS": "Motion Adresse", "ADD_SMSACCOUNT": "SMS-Konto hinzufügen", "EDIT_SMSACCOUNT": "SMS-Konto bearbeiten", - "DELETE_SMSACCOUNT": "SMS-Konto löschen", + "DELETE_SMSACCOUNT": "SMS-Konto löschen.", "LIST": "Liste", "FIDELITY": "Treue", "API": "API", - "DISPOSITIONS": "Qualifizierungen", + "DISPOSITIONS": "Bestimmungen", "WEBHOOKS": "WebHooks", - "ACTIONS": "Routing", + "ACTIONS": "Aktionen", "ACCEPT": "Akzeptieren", - "ACCEPTMETHOD": "Methode akzeptieren", + "ACCEPTMETHOD": "Die Methode", "ACCEPTURL": "URL akzeptieren", "REJECT": "Ablehnen", "REJECTMETHOD": "Methode ablehnen", "REJECTURL": "URL ablehnen", - "CLOSE": "Schließen und Qualifizieren", - "CLOSEMETHOD": "Methode schließen", - "CLOSEURL": "URL schließen", - "SELECTED": "Ausgewählt", - "SELECT_ALL": "Alles auswählen", - "SELECT_NONE": "Nichts auswählen", + "CLOSE": "In der Nähe", + "CLOSEMETHOD": "In der Nähe Methode", + "CLOSEURL": "Der URL", + "SELECTED": "Ausgewählte", + "SELECT_ALL": "Alle auswählen", + "SELECT_NONE": "Wählen Sie \"Keine\"", "BACK": "Zurück", "SMS": "SMS", - "ID": "ID", + "ID": "Id", "CONFIRM_PASSWORD": "Passwort bestätigen", - "SMSDISPOSITIONS": "SMS-Qualifizierungen", - "NO_SMSDISPOSITION_AVAILABLE": "Keine Qualifizierungen vorhanden", - "NEW_SMSDISPOSITION": "Neue Qualifizierung", - "ADD_SMSDISPOSITION": "Qualifizierung hinzufügen", - "EDIT_SMSDISPOSITION": "Qualifizierung bearbeiten", - "DELETE_SMSDISPOSITION": "Qualifizierung löschen", + "SMSDISPOSITIONS": "SMS-Bestimmungen", + "NO_SMSDISPOSITION_AVAILABLE": "Keine SMS-Verfügungen zur Verfügung", + "NEW_SMSDISPOSITION": "Neue SMS-Disposition", + "ADD_SMSDISPOSITION": "SMS-Disposition", + "EDIT_SMSDISPOSITION": "Bearbeiten Sie SMS-Disposition", + "DELETE_SMSDISPOSITION": "SMS löschen Disposition", "NEW_SMSQUEUE": "Neue SMS-Warteschlange", "NEW_SMSACCOUNT": "Neue SMS-Konto", - "NO_AVAILABLE_INFO": "Keine Informationen verfügbar", - "ALL_TEAMS": "Alle Teams", + "NO_AVAILABLE_INFO": "Keine verfügbaren Info", + "ALL_TEAMS": "Alle Mannschaften", "SELECTED_TEAMS": "Ausgewählte Teams", "HELP": { "NAME": "Nur Zahlen, Buchstaben und Sonderzeichen (._) werden unterstützt.", - "LIST": "Kontaktmanage- Liste zu verknüpfen von Kontakten", + "LIST": "Contact Manager Liste zu verknüpfen von Kontakten", "RECEIVEURL": "Dies ist die automatisch generierte API-String müssen Sie die Nachrichten in Ihrem Konto von Ihrem SMS-Anbieter zu erhalten (POST-Methode verwendet werden muss). Drücken Sie die Zwischenablage, um Sie in die Zwischenablage zu kopieren.", "MOTIONPROXY": "Das Feld muss das folgende Format haben: ://[:]. Beispiel: https://X.Y.Z.W", "DELIVERYREPORTURL": "Dies ist die automatisch generierte API-Zeichenfolge, die Sie verwenden müssen, um den Zustellungsbericht gesendeter Nachrichten von Ihrem SMS-Anbieter zu empfangen (die POST-Methode muss verwendet werden): Klicken Sie auf die Zwischenablage, um sie zu kopieren", - "MANDATORYDISPOSITION": "Qualifizierung erforderlich", - "MANDATORYDISPOSITIONPAUSEID": "Pausenstatus während der Qualifizierung", - "WELCOMEMESSAGE": "Erste Nachricht bei neuen Interaktionen" + "MANDATORYDISPOSITION": "Zwingende Disposition", + "MANDATORYDISPOSITIONPAUSEID": "Anhalten, um zu verwenden, wenn die obligatorische Disposition aktiviert ist", + "WELCOMEMESSAGE": "Dies ist die erste Antwortnachricht, die an neue Interaktionen gesendet wird" }, "PAGE": "Seite", "ROWSPERPAGE": "Zeilen pro Seite", - "OF": "von", + "OF": "Von", "TEAMADD_SMSQUEUE": "Team zur Warteschlange hinzufügen", - "AGENTADD_SMSQUEUE": "Agenten zur Warteschlange hinzufügen", + "AGENTADD_SMSQUEUE": "Agent zur Warteschlange hinzufügen", "ALL_AGENTS": "Alle Agenten", "SELECTED_AGENTS": "Ausgewählte Agenten", - "RECEIVEURL": "URL erhalten", + "RECEIVEURL": "Erhalten URL", "INTERACTION": "Interaktion", - "INTERACTIONS": "Interaktionen", - "NO_INTERACTION_AVAILABLE": "Keine Interaktionen vorhanden", + "INTERACTIONS": "Wechselwirkungen", + "NO_INTERACTION_AVAILABLE": "Es sind keine Wechselwirkungen zur Verfügung", "CONTACT": "Kontakt", "STARTEDAT": "Gestartet am", "AGENT": "Agent", - "CLOSEDAT": "Geschlossen am", - "DISPOSITION": "Qualifizierung", - "NOTES": "Anmerkungen", - "GOTO": "GeheZu (GoTo)", - "GOTOIF": "GeheZuWenn (GoToIf)", - "NOOP": "Log erstellen (NoOp)", + "CLOSEDAT": "Geschlossen", + "DISPOSITION": "Disposition", + "NOTES": "Hinweise", + "GOTO": "Gehe zu", + "GOTOIF": "Gotoif", + "NOOP": "Noop", "QUEUE": "Warteschlange", - "TIMEOUT": "Zeitüberschreitung", + "TIMEOUT": "Timeout", "VALUE": "Wert", - "EDIT_AGENT": "Agenten bearbeiten", - "EDIT_GOTO": "\"GeheZu\" bearbeiten", - "EDIT_NOOP": "Log-Erstellung bearbeiten", - "EDIT_GOTOIF": "Bedingung bearbeiten und Priorität zuweisen", + "EDIT_AGENT": "Agent bearbeiten", + "EDIT_GOTO": "Bearbeiten Gehe zu", + "EDIT_NOOP": "Bearbeiten Noop", + "EDIT_GOTOIF": "Bearbeiten Gotoif", "EDIT_QUEUE": "Warteschlange bearbeiten", - "CONDITION": "Bedingung", - "TRUEPRIORITY": "Priorität bei zutreffender Bedingung erforderlich", - "FALSEPRIORITY": "Priorität bei nicht zutreffender Bedingung erforderlich", + "CONDITION": "Zustand", + "TRUEPRIORITY": "Wahre Priorität", + "FALSEPRIORITY": "Falsche Priorität", "PRIORITY": "Priorität", - "GOTOP": "Priorität zuweisen (GoToP)", - "EDIT_GOTOP": "GoToP bearbeiten", - "EDIT_CLOSE": "Verhalten bei Schließen bearbeiten", + "GOTOP": "Gotop", + "EDIT_GOTOP": "Gotop bearbeiten", + "EDIT_CLOSE": "Bearbeiten Schließen", "FILTER": "Filter", - "SELECT_STATUS": "Status wählen", - "ALL": "Alles", - "SELECT_ACCOUNT": "Konto wählen", - "OPENED": "Geöffnet", + "SELECT_STATUS": "Wählen Sie einen Status", + "ALL": "Alle", + "SELECT_ACCOUNT": "Wählen Sie ein Konto", + "OPENED": "Öffnen", "CLOSED": "Geschlossen", "STATUS": "Status", "ACCOUNT": "Konto", - "OPEN": "Offen", - "INFO": "Information", + "OPEN": "Öffnen", + "INFO": "Info", "ACCOUNTSID": "Konto SID", "AUTHTOKEN": "Auth Token", "PROXY": "Proxy", - "ADVANCED": "Erweitert", + "ADVANCED": "Erweiterte", "MOTIONPROXY": "Proxy oder Motion Domain", "REALTIME": "Echtzeit", "UNKNOWN": "Unbekannt", - "UNREGISTERED": "Nicht registriert", + "UNREGISTERED": "Unregistrierte", "UNAVAILABLE": "Nicht verfügbar", - "NOT_INUSE": "Nicht in Verwendung", + "NOT_INUSE": "Nicht in Gebrauch", "REACHABLE": "Erreichbar", - "IN_USE": "In Verwendung", + "IN_USE": "Im Einsatz", "AGENTS": "Agenten", "QUEUES": "Warteschlangen", - "FULLNAME": "Vollständiger Name", - "INTERNAL": "Intern", - "PHONE_STATE": "Status Nebenstelle", - "PHONE_STATUS": "SIP-Status Nebenstelle", + "FULLNAME": "Fullname", + "INTERNAL": "Interne", + "PHONE_STATE": "Telefonstatus", + "PHONE_STATUS": "Telefonstatus", "PAUSE": "Pause", "LOGOUT": "An-/Abmelden", - "AGENTADD_QUEUE": "Agenten zur Warteschlange hinzufügen", - "UNPAUSE": "Pause abbrechen", - "DEFAULT_PAUSE": "Standardpause", + "AGENTADD_QUEUE": "Agent SMS-Warteschlange hinzufügen", + "UNPAUSE": "Pause beenden", + "DEFAULT_PAUSE": "Standard Pause", "LOGGED_IN": "Angemeldet", - "PAUSED": "in Pause", + "PAUSED": "Angehalten", "READY": "Bereit", "WAITING": "Warten", - "VOICE": "Anrufe", + "VOICE": "Voice", "CHAT": "Chat", "MAIL": "E-Mail", - "OPENCHANNEL": "Offener Kanal", + "OPENCHANNEL": "Channel öffnen", "FAX": "Fax", - "AGENTSADD_QUEUE": "Agenten zur SMS-Warteschlange hinzufügen", + "AGENTSADD_QUEUE": "Agenten zu SMS-Warteschlange hinzufügen", "NO_AGENT_ONLINE": "Kein Agent Online", - "GOTOREALTIME_SMSQUEUE": "Direkt zur Echtzeit-Warteschlange", - "PARTIALPAUSE": "Teilpause", + "GOTOREALTIME_SMSQUEUE": "In Echtzeit, SMS-Warteschlange", + "PARTIALPAUSE": "Lastschriftzahlung teilweise Pause", "BUSY": "Besetzt", "TIMER": "Timer", "IDLE": "Leerlauf", "CAPACITY": "Kapazität", "SEND": "Senden", - "TO": "An", + "TO": "Zu", "MESSAGE": "Nachricht", "TAGS": "Tags", - "INTERACTIONS_SMSACCOUNT": "Zu den Interaktionen gehen", - "REFRESH_INTERACTIONS": "Interaktionen aktualisieren", - "CANNED_ANSWER_NOT_FOUND": "Keine Textvorlagen verfügbar", - "CANNED_ANSWER_SEARCH": "Nach Textvorlagen suchen", - "NO_SMSDISPOSITIONS_AVAILABLE": "Keine Qualifizierungen verfügbar", - "NO_SMSCANNEDANSWER_AVAILABLE": "Keine Textvorlagen vorhanden", - "NEW_SMSCANNEDANSWER": "Neue Textvorlage", - "ADD_SMSCANNEDANSWER": "Textvorlage hinzufügen", - "EDIT_SMSCANNEDANSWER": "Textvorlage bearbeiten", - "DELETE_SMSCANNEDANSWER": "Textvorlage löschen", - "DELIVERYREPORTURL": "URL bei Erhalt", + "INTERACTIONS_SMSACCOUNT": "Zu Wechselwirkungen gehen", + "REFRESH_INTERACTIONS": "Aktualisieren Interaktionen", + "CANNED_ANSWER_NOT_FOUND": "Es wurden keine vordefinierten Antworten gefunden", + "CANNED_ANSWER_SEARCH": "Geben Sie einen Text ein, um eine vordefinerte Antwort zu suchen", + "NO_SMSDISPOSITIONS_AVAILABLE": "Keine Sms-Disposition verfügbar", + "NO_SMSCANNEDANSWER_AVAILABLE": "Keine vordefinierten Antworten verfügbar", + "NEW_SMSCANNEDANSWER": "Neue vordefinierte Antwort", + "ADD_SMSCANNEDANSWER": "Vordefinierte Antwort hinzufügen", + "EDIT_SMSCANNEDANSWER": "Vordefinierte Antwort bearbeiten", + "DELETE_SMSCANNEDANSWER": "Vordefinierte Antwort löschen", + "DELIVERYREPORTURL": "Zustellungsbericht-URL", "DELETE": "Löschen", - "SENDERSTRING": "Absenderkennung", + "SENDERSTRING": "Absenderzeichenfolge", "DELIVERYREPORT": "Sendebericht", "METHOD": "Methode", "ADD_NOTE": "Notiz hinzufügen", "NOTE": "Hinweis", - "SPYINTERACTION": "Anzeigen", + "SPYINTERACTION": "Spion", "AUTOREPLY": "Automatische Antwort", - "EDIT_AUTOREPLY": "Automatische Antwort bearbeiten", - "TIMES": "Zeiten", + "EDIT_AUTOREPLY": "Bearbeiten Sie die automatische Antwort", + "TIMES": "Anzahl der Male pro Interaktion", "TEXT": "Text", - "INSERT_MESSAGE_HERE": "Nachricht hier einfügen", + "INSERT_MESSAGE_HERE": "Fügen Sie hier Ihre Textnachricht ein", "DELETE_INTERACTION": "Interaktion löschen", "AUTHID": "Authentifizierungs-ID", - "COMMAND": "Eingabe", + "COMMAND": "Befehl", "EDIT_SYSTEM": "System bearbeiten", "SYSTEM": "System", - "VARIABLE": "Variabel", + "VARIABLE": "Variable", "NOTIFICATION": "Benachrichtigung", - "NOTIFICATIONSHAKE": "Schütteln", - "NOTIFICATIONSOUND": "Sound abspielen", + "NOTIFICATIONSHAKE": "Shake", + "NOTIFICATIONSOUND": "Klingen", "NOTIFICATIONTEMPLATE": "Vorlage", - "WAITFORTHEASSIGNEDAGENT": "Auf zugewiesenen Agenten warten", + "WAITFORTHEASSIGNEDAGENT": "Warte auf den zugewiesenen Agenten", "EDIT_TAG": "Tag bearbeiten", - "TAG": "Tag", - "AGENTADD_SMSACCOUNT": "Agenten zum SMS-Konto hinzufügen", - "AGENTTRANSFER": "Transfer an Agenten erlauben", + "TAG": "Etikett", + "AGENTADD_SMSACCOUNT": "Fügen Sie einen Agenten zum SMS-Konto hinzu", + "AGENTTRANSFER": "Agent Transfer", "AGENTTRANSFERTIMEOUT": "Zeitüberschreitung für Agententransfer", - "QUEUETRANSFER": "Transfer in Warteschlange erlauben", - "QUEUETRANSFERTIMEOUT": "Zeitüberschreitung für Warteschlangentransfer", + "QUEUETRANSFER": "Warteschlangenübertragung", + "QUEUETRANSFERTIMEOUT": "Warteschlangenübertragungs-Timeout", "TRANSFER": "Transfer", - "CANNEDANSWERS": "Textvorlagen", - "DOWNLOAD_INTERACTION": "Interaktion herunterladen", - "SMSCANNEDANSWERS": "SMS-Textvorlagen", - "LOGIN_TIME": "Zeit angemeldet", - "PAUSE_TIME": "Zeit in Pause", + "CANNEDANSWERS": "Vordefinierte Antworten", + "DOWNLOAD_INTERACTION": "Herunterladen", + "SMSCANNEDANSWERS": "Vordefinierte Antworten", + "LOGIN_TIME": "Login-Zeit", + "PAUSE_TIME": "Pausenzeit", "APIKEY": "API-Schlüssel", - "BASEURL": "Base_URL", - "TEAMS_ASSOCIATION": "Teamzuweisung", - "MANDATORYDISPOSITION": "Qualifizierung erforderlich", - "MANDATORYDISPOSITIONPAUSEID": "PausenID während Qualifizierung", + "BASEURL": "Basis-URL", + "TEAMS_ASSOCIATION": "Vereinigung der Mannschaften", + "MANDATORYDISPOSITION": "Zwingende Disposition", + "MANDATORYDISPOSITIONPAUSEID": "Anhalten, um zu verwenden, wenn die obligatorische Disposition aktiviert ist", "ACCESSKEYID": "Zugriffsschlüssel-ID", "AMAZONLEX": "AmazonLex", - "BOTNAME": "BOT-Name", - "DIALOGFLOW": "Google DialogFlow", - "EDIT_AMAZONLEX": "Lex-Konfiguration bearbeiten", - "EDIT_DIALOGFLOW": "DialogFlow-Konfiguration bearbeiten", + "BOTNAME": "Bot Name", + "DIALOGFLOW": "DialogFlow", + "EDIT_AMAZONLEX": "Bearbeiten Sie die Lex-Konfiguration", + "EDIT_DIALOGFLOW": "Bearbeiten Sie die DialogFlow-Konfiguration", "LANGUAGE": "Sprache", - "LEXREGION": "Lex Region", - "SECRETACCESSKEY": "Geheimer Zugangsschlüssel", + "LEXREGION": "Region", + "SECRETACCESSKEY": "Zugriffsschlüsselgeheimnis", "WELCOMEMESSAGE": "Willkommensnachricht", - "DOWNLOAD_WITHOUT_ATTACHMENT": "Herunterladen ohne Anhänge", - "DOWNLOAD_WITH_ATTACHMENT": "Herunterladen inkl. Anhänge", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Ohne Anhang herunterladen", + "DOWNLOAD_WITH_ATTACHMENT": "Download mit Anhang", "LASTMESSAGE": "Letzte Nachricht", - "CLIENTEMAIL": "Kunden E-Mail", + "CLIENTEMAIL": "Kunden-E-Mail", "DIALOGFLOWV2": "Dialogflow V2", "EDIT_DIALOGFLOWV2": "Dialogflow V2 bearbeiten", - "PRIVATEKEY": "Privater Schlüssel", + "PRIVATEKEY": "Privat Schlüssel", "PROJECTID": "Projekt-ID", "ACCOUNTID": "Konto-ID", "APPLICATIONID": "Anwendungs-ID" diff --git a/public/app/main/apps/sms/i18n/pt-BR.json b/public/app/main/apps/sms/i18n/pt-BR.json index 6d60e30..bca1c51 100644 --- a/public/app/main/apps/sms/i18n/pt-BR.json +++ b/public/app/main/apps/sms/i18n/pt-BR.json @@ -52,12 +52,12 @@ "PARTIALPAUSE": "Pausa parcial", "BUSY": "Ocupado", "TIMER": "Tempo", - "IDLE": "Ocioso", + "IDLE": "Disponível", "CAPACITY": "Capacidade", "PROXY": "Proxy", "ADVANCED": "Avançado", "MOTIONPROXY": "Proxy ou Dominio do Motion", - "REALTIME": "Tempo Real", + "REALTIME": "Tempo real", "KEY": "Key", "NAME": "Nome", "SMSQUEUES": "Filas de SMS", diff --git a/public/app/main/apps/staff/i18n/de.json b/public/app/main/apps/staff/i18n/de.json index 163a056..a46e611 100644 --- a/public/app/main/apps/staff/i18n/de.json +++ b/public/app/main/apps/staff/i18n/de.json @@ -1,188 +1,188 @@ { "STAFF": { - "CONTEXT": "Kontext (Wählplan)", - "RINGINUSE": "Nebenstelle klingelt auch wenn Nutzer Besetzt", + "CONTEXT": "Kontext", + "RINGINUSE": "Ring im Einsatz", "USERS": "Benutzer", "AGENTS": "Agenten", - "TOGGLE_SIDENAV": "Navigationsleiste umschalten", - "SEARCH_FOR_ANYONE": "Suche", + "TOGGLE_SIDENAV": "Um sidenav", + "SEARCH_FOR_ANYONE": "Suche für Jedermann", "BACK": "Zurück", - "MULTI_SELECT_TOGGLE": "Mehrfachauswahl ja/nein", - "SELECT_ALL": "Alles auswählen", - "SELECT_NONE": "Nichts auswählen", - "SELECTED": "Ausgewählt", + "MULTI_SELECT_TOGGLE": "Wählen Sie toggle multi", + "SELECT_ALL": "Alle auswählen", + "SELECT_NONE": "Wählen Sie \"Keine\"", + "SELECTED": "Ausgewählte", "DELETE_SELECTED": "Auswahl löschen", "EXPORT_SELECTED": "Auswahl exportieren", "ALL_USERS": "Alle Benutzer", "ALL_AGENTS": "Alle Agenten", "SORT": "Sortieren", "NAME": "Name", - "FULLNAME": "Vollständiger Name", + "FULLNAME": "Voller Name", "A_TO_Z": "(A bis Z)", "Z_TO_A": "(Z bis A)", "MORE": "Mehr", "DELETE_USER": "Benutzer löschen", "EDIT_USER": "Benutzer bearbeiten", - "DELETE_AGENT": "Agenten löschen", - "EDIT_AGENT": "Agenten bearbeiten", + "DELETE_AGENT": "Bedienplatz löschen", + "EDIT_AGENT": "Agent bearbeiten", "DELETE": "Löschen", "SAVE": "Speichern", "ADD_USER": "Benutzer hinzufügen", "ADD_AGENT": "AGENT HINZUFÜGEN", - "NO_RESULTS": "Keine Ergebnisse", + "NO_RESULTS": "Keine Ergebnisse.", "CLOSE_DIALOG": "Dialog schließen", - "NAME_REQUIRED": "Name (erforderlich)", - "USERNAME": "Nutzername", + "NAME_REQUIRED": "Name (erforderlich).", + "USERNAME": "Benutzername", "SHOW_ALL_FIELDS": "Alle Felder anzeigen", "PHONE_NUMBER": "Telefonnummer", "EMAIL": "E-Mail", "PASSWORD": "Passwort", "ERRORS": { - "FULLNAME_REQUIRED": "Vollständiger Name erforderlich", - "USERNAME_REQUIRED": "Benutzername erforderlich", - "EMAIL_REQUIRED": "E-Mail erforderlich", - "PASSWORD_REQUIRED": "Passwort erforderlich", - "CONFIRM_NOT_MATCH": "Die Passwörter stimmen nicht überein", - "EMAIL_MUST_VALID": "E-Mail Format ungültig", - "ACCOUNTNAME_REQUIRED": "Konto erforderlich", - "NAME_REQUIRED": "Name erforderlich", - "HOST_REQUIRED": "Host erforderlich", - "CHATCAPACITY_REQUIRED": "Kapazität Chat erforderlich", - "MAILCAPACITY_REQUIRED": "Kapazität E-Msil erforderlich", - "FAXCAPACITY_REQUIRED": "Kapazität Fax erforderlich", - "SMSCAPACITY_REQUIRED": "Kapazität SMS erforderlich", - "OPENCHANNELCAPACITY_REQUIRED": "Kapazität offener Kanal erforderlich", - "SIPEXPIRES_REQUIRED": "SIP-Ablaufdatum erforderlich", - "SIPPORT_REQUIRED": "SIP-Port erforderlich", - "UNCONDITIONALNUMBER_REQUIRED": "Zielrufnummer erforderlich", - "NOREPLYNUMBER_REQUIRED": "Nummer bei keiner Antwort erforderlich", - "BUSYNUMBER_REQUIRED": "Nummer bei Besetzt erforderlich", - "USERNAME_MUST_VALID_PATTERN": "Benutzername ungültig {{regex}}.", - "REMOTECONTROLPORT_REQUIRED": "Port für Remote erforderlich", - "CHATCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Kapazität Chat muss größer oder gleich sein als", - "MAILCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Kapazität E-Mail muss größer oder gleich sein als", - "FAXCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Kapazität Fax muss größer oder gleich sein als", - "OPENCHANNELCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Kapazität offener Kanal muss größer oder gleich sein als", - "AUTOANSWERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", - "AUTOANSWERDELAY_REQUIRED": "Verzögerung bei automatischer Antwort erforderlich", - "MONITOREXTENSION_REQUIRED": "Nebenstelle erforderlich", + "FULLNAME_REQUIRED": "Der Fullname ist erforderlich", + "USERNAME_REQUIRED": "Der Benutzername ist erforderlich", + "EMAIL_REQUIRED": "Die E-Mail ist erforderlich", + "PASSWORD_REQUIRED": "Das Kennwort ist erforderlich", + "CONFIRM_NOT_MATCH": "Die Kennwörter stimmen nicht überein.", + "EMAIL_MUST_VALID": "Die e-Mail muss in einem gültigen Format", + "ACCOUNTNAME_REQUIRED": "Der Account ist erforderlich.", + "NAME_REQUIRED": "Der Name ist erforderlich", + "HOST_REQUIRED": "Der Host wird benötigt", + "CHATCAPACITY_REQUIRED": "Die Kapazität ist erforderlich", + "MAILCAPACITY_REQUIRED": "Die E-Mail Kapazität erforderlich ist", + "FAXCAPACITY_REQUIRED": "Die Kapazität ist erforderlich", + "SMSCAPACITY_REQUIRED": "Die SMS-Kapazität erforderlich ist", + "OPENCHANNELCAPACITY_REQUIRED": "Der Offene Kanal Kapazität erforderlich ist", + "SIPEXPIRES_REQUIRED": "Der SIP-Ablauf ist erforderlich", + "SIPPORT_REQUIRED": "Die SIP-Port erforderlich.", + "UNCONDITIONALNUMBER_REQUIRED": "Die Zielrufnummer ist erforderlich", + "NOREPLYNUMBER_REQUIRED": "Die Nummer ist keine Antwort erforderlich", + "BUSYNUMBER_REQUIRED": "Die besetzt ist erforderlich", + "USERNAME_MUST_VALID_PATTERN": "Der Benutzername muss gültige {{regex}}.", + "REMOTECONTROLPORT_REQUIRED": "Die Fernbedienung Anschluss erforderlich", + "CHATCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Chat Kapazität muss größer als oder gleich", + "MAILCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die E-Mail Kapazität muss größer als oder gleich", + "FAXCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Das Fax Kapazität muss größer als oder gleich", + "OPENCHANNELCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der offene Kanal Kapazität muss größer als oder gleich", + "AUTOANSWERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer als oder gleich", + "AUTOANSWERDELAY_REQUIRED": "Pflichtfeld", + "MONITOREXTENSION_REQUIRED": "Pflichtfeld", "ENCRYPTION": "SRTP (Secure Realtime Protocol) Verschlüsselung", - "DTLSCERTFILE_REQUIRED": "Zertifikat erforderlich", - "DTLSPRIVATEKEY_REQUIRED": "Privater Schlüssel erforderlich", - "SECURE_PASSWORD_PATTERN": "Das Passwort muss mindestens 8 Zeichen lang sein und 1 Kleinbuchstaben, 1 Großbuchstaben, 1 Zahl und 1 Sonderzeichen enthalten", - "ALLOWCODECS_REQUIRED": "Erlaubte Codecs erforderlich", - "CRUDPERMISSIONS_REQUIRED": "Berechtigungen erforderlich", - "USERPROFILE_REQUIRED": "Nutzerprofil erforderlich", - "PASSWORD_OLDPASSWORD_MATCH": "Neues und altes Passwort dürfen nicht gleich sein", - "CONFIRM_REQUIRED": "Bestätigung erforderlich", - "WHATSAPPCAPACITY_REQUIRED": "Kapazität WhatsApp erforderlich" + "DTLSCERTFILE_REQUIRED": "Pflichtfeld", + "DTLSPRIVATEKEY_REQUIRED": "Pflichtfeld", + "SECURE_PASSWORD_PATTERN": "Das Passwort muss mindestens 8 Zeichen lang sein und 1 Kleinbuchstabe, 1 Großbuchstabe, 1 Zahl und 1 Sonderzeichen haben ~! @", + "ALLOWCODECS_REQUIRED": "Pflichtfeld", + "CRUDPERMISSIONS_REQUIRED": "Pflichtfeld", + "USERPROFILE_REQUIRED": "Pflichtfeld", + "PASSWORD_OLDPASSWORD_MATCH": "Das neue Passwort muss sich vom vorherigen Passwort unterscheiden", + "CONFIRM_REQUIRED": "Pflichtfeld", + "WHATSAPPCAPACITY_REQUIRED": "Pflichtfeld" }, - "ACCOUNT": "Nutzerdaten", - "VOICE": "Einstellungen Telefonie", + "ACCOUNT": "Konto", + "VOICE": "Voice", "CREATED_AT": "Erstellt am", "ROLE": "Rolle", - "PERSONAL_INFO": "Persönliche Informationen", + "PERSONAL_INFO": "Persönliche Infos", "DESCRIPTION": "Beschreibung", - "CHANGE_AVATAR": "Avatar ändern", + "CHANGE_AVATAR": "Avatar ändern.", "GENERAL": "Allgemein", - "INTERNAL": "Interne Durchwahl", - "TRANSPORT": "Transport", - "ALLOWCODECS": "Erlaubte Codecs", + "INTERNAL": "Interne", + "TRANSPORT": "Verkehr", + "ALLOWCODECS": "Codecs erlaubt", "HELP": { - "ALLOWCODECS": "Erlaubt Codecs in der Reihenfolge der Auflistung", - "TRANSPORT": "Festlegen der Standardeinstellungen für das Transportprotokoll. Die Reihenfolge bestimmt den primären Standard.", - "HOST": "Definiert die Ermittlung des Clients. Wenn sich die Nebenstelle selbst registrieren soll \"dynamic\" anstelle der Host-IP verwenden ", - "NAT": "Ändert das Verhaltes des Asterisk-Telefonieservers für Nebenstellen hinter einer Firewall- Sofern eine der per Komma getrennten Optionen 'no', werden alle anderen Einstellungen ignoriert und der Server setzt ein 'nat=no'", + "ALLOWCODECS": "Erlaubt Codecs in der Reihenfolge ihrer Präferenz", + "TRANSPORT": "Festlegen der Standardeinstellungen für Transporte. Die Reihenfolge bestimmt den primären Standard.", + "HOST": "Wie finden Sie die Client-IP oder den Host-Namen. Wenn Sie möchten, dass das Telefon zu registrieren, verwenden Sie das Schlüsselwort Dynamic anstelle von Host-IP.", + "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.", "SIPEXPIRES": "Standardeinstellung: 160", "SIPPORT": "Standardeinstellung: 5160", - "TYPE": "Definiert die Rolle des SIP innerhalb des Telefoniservers. User: eingehende Authentifizierung - Peer: ausgehende Authentifizierung - Friend: beide Varianten", - "CHATCAPACITY": "Maximale Anzahl an gleichzeitigen Chat-Interaktionen pro Agent. (0 = unbegrenzt)", - "MAILCAPACITY": "Maximale Anzahl an gleichzeitigen E-Mail-Interaktionen pro Agent. (0 = unbegrenzt)", - "FAXCAPACITY": "Maximale Anzahl an gleichzeitigen Fax-Interaktionen pro Agent. (0 = unbegrenzt)", - "SMSCAPACITY": "Maximale Anzahl an gleichzeitigen SMS-Interaktionen pro Agent. (0 = unbegrenzt)", - "OPENCHANNELCAPACITY": "Maximale Anzahl an gleichzeitigen Interaktionen im offenen Kanal pro Agent. (0 = unbegrenzt)", - "CALLGROUP": "Rufgruppe", - "PICKUPGROUP": "Übernahmegruppe", + "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.", + "CHATCAPACITY": "Null bedeutet unbegrenzt.", + "MAILCAPACITY": "Null bedeutet unbegrenzt.", + "FAXCAPACITY": "Null bedeutet unbegrenzt.", + "SMSCAPACITY": "Null bedeutet unbegrenzt.", + "OPENCHANNELCAPACITY": "Null bedeutet unbegrenzt.", + "CALLGROUP": "Legt der Agent callgroup", + "PICKUPGROUP": "Definiert die Gruppen in denen der Agent Anrufe annehmen können", "USERNAME": "Nur Zahlen, Buchstaben und Sonderzeichen (._) werden unterstützt.", "ENCRYPTION": "SRTP (Secure Realtime Protocol) Verschlüsselung", "LAST_PASSWORD_RESET_AT": "Letztes Datum und Uhrzeit, zu der das Passwort geändert wurde. Wenn die Allgemeinen Einstellungen für Secure Suite aktiviert sind, läuft das Passwort nach 90 Tagen ab.", - "DTLSCERTFILE": "Verknüpfen Sie das gültige TLS-Zertifikat (.crt-Datei). Standardwert: '/etc/pki/tls/certs/motion.crt'.", - "DTLSPRIVATEKEY": "Verknüpfen Sie den privaten Schlüssel des Zertifikats (.key-Datei). Standardwert: '/etc/pki/tls/private/motion.key'.", + "DTLSCERTFILE": "Verknüpfen Sie mit dem gültigen TLS-Zertifikat (.crt-Datei). Standardwert: '/etc/pki/tls/certs/motion.crt'.", + "DTLSPRIVATEKEY": "Verknüpfen Sie mit dem privaten Schlüssel des Zertifikats (.key-Datei). Standardwert: '/etc/pki/tls/private/motion.key'.", "SAVE_PERMISSIONS": "Jeder Abschnitt, der ausstehende Änderungen enthält, wird gespeichert", - "CUSTOM_DASHBOARDS_PERMISSIONS": "Berechtigungen für benutzerdefinierte Dashboards werden im Werkzeuge-Modul verwaltet", + "CUSTOM_DASHBOARDS_PERMISSIONS": "Berechtigungen für benutzerdefinierte Dashboards werden im Modul Tools verwaltet", "APIKEY": "Verwenden Sie die Schaltfläche \"API-Schlüsselmanager\" in der Symbolleiste, um diesen Schlüssel zu verwalten", - "ENABLEAUTOMATICSCREENRECORDING": "Funktionalität ist nur für Sprachkanäle verfügbar", - "BLOCKED": "Zugriff auf System ermöglichen/sperren", - "DISABLED": "Nutzer Aktivieren/Deaktivieren", - "WHATSAPPCAPACITY": "Maximale Anzahl an gleichzeitigen WhatsApp-Interaktionen pro Agent. 0 für unbegrenzt", + "ENABLEAUTOMATICSCREENRECORDING": "Die Funktionalität ist nur für Sprachkanäle verfügbar", + "BLOCKED": "Zugriff sperren / entsperren", + "DISABLED": "Zum Deaktivieren auswählen / Zum Reaktivieren deaktivieren", + "WHATSAPPCAPACITY": "Maximale Anzahl gleichzeitiger Kanalinteraktionen pro Agent (0 = unbegrenzt)", "MASK_SENSITIVE_DATA": "Maskieren Sie vertrauliche Daten in der gesamten Anwendung (z. B. Telefonnummern und E-Mail-Adressen).", "WSS_PORT": "Standard: 8089", "AD_SSO_ENABLED": "Melden Sie sich mit Ihren Active Directory-Anmeldeinformationen an" }, - "NEW_PASSWORD": "Neues Passwort", + "NEW_PASSWORD": "Neues Kennwort", "CONFIRM_PASSWORD": "Passwort bestätigen", "CHANGE_PASSWORD": "Passwort ändern", - "CHANGEPASSWORD_AGENT": "Passwort für Agenten ändern", - "CHANGEPASSWORD_USER": "Passwort für Nutzer ändern", - "CHANGEPASSWORD_TELEPHONE": "Passwort für Endgerät ändern", - "LOGININPAUSE": "Pause nach Anmelden", + "CHANGEPASSWORD_AGENT": "Passwort ändern", + "CHANGEPASSWORD_USER": "Passwort ändern", + "CHANGEPASSWORD_TELEPHONE": "Passwort ändern", + "LOGININPAUSE": "Geben Sie Ihren Benutzernamen und Ihr Passwort In der Pause", "HOST": "Host", "NAT": "NAT", - "CHANSPY": "Mithören zulassen", - "OTHER_CHANNELS": "Parallele Kanäle", - "CHATCAPACITY": "Kapazität Chat", - "MAILCAPACITY": "Kapazität E-Mail", - "FAXCAPACITY": "Kapazität Fax", - "SMSCAPACITY": "Kapazität SMS", - "OPENCHANNELCAPACITY": "Kapazität offener Kanal", + "CHANSPY": "ChanSpy", + "OTHER_CHANNELS": "Andere Kanäle", + "CHATCAPACITY": "Chat Kapazität", + "MAILCAPACITY": "E-Kapazität", + "FAXCAPACITY": "Fax Kapazität", + "SMSCAPACITY": "Sms-Kapazität", + "OPENCHANNELCAPACITY": "Offener Kanal Kapazität", "MOTIONBAR": "Motion Bar", "SETTINGS": "Einstellungen", - "AUTOANSWER": "Anruf automatisch annehmen", - "ENABLESETTINGS": "Darf Einstellungen sehen", + "AUTOANSWER": "\"Autom. Antwort\"", + "ENABLESETTINGS": "Einstellungen aktivieren", "CALL_FORWARDING": "Anrufweiterleitung", - "UNCONDITIONAL": "Generelle Anrufweiterleitung", - "UNCONDITIONALNUMBER": "Nummer für generelle Weiterleitung", - "NOREPLY": "Bei keiner Antwort", - "NOREPLYNUMBER": "Nummer Weiterleitung keine Antwort", - "BUSY": "Bei Besetzt", - "BUSYNUMBER": "Nummer Weiterleitung Besetzt", - "REMOTE_CONTROL": "Externe Steuerung (z.B. für Click2Dial)", - "REMOTECONTROL": "Externe Steuerung erlauben", - "REMOTECONTROLPORT": "Port für externe Steuerung (Standard: 9888)", + "UNCONDITIONAL": "Unbedingte", + "UNCONDITIONALNUMBER": "Uneingeschränkte Anzahl", + "NOREPLY": "Keine Antwort", + "NOREPLYNUMBER": "\"Keine Antwort\"-Nummer", + "BUSY": "Besetzt", + "BUSYNUMBER": "Nummer besetzt", + "REMOTE_CONTROL": "Fernbedienung", + "REMOTECONTROL": "Fernbedienung", + "REMOTECONTROLPORT": "Fernbedienung", "SIP": "SIP", - "SIPEXPIRES": "SIP-Aktualisierungsintervall", + "SIPEXPIRES": "SIP läuft [sec]", "SIPPORT": "SIP-Port", - "PENALTY": "Verzögerung", - "ACCOUNTNAME": "Kontoname", - "ADD_TELEPHONE": "Endgerät hinzufügen", - "EDIT_TELEPHONE": "Endgerät bearbeiten", - "DELETE_TELEPHONE": "Endgerät löschen", + "PENALTY": "Strafe", + "ACCOUNTNAME": "Account Name", + "ADD_TELEPHONE": "Telefon hinzufügen", + "EDIT_TELEPHONE": "Telefon bearbeiten", + "DELETE_TELEPHONE": "Telefon löschen", "TEAMS": "Teams", "DELETE_TEAM": "Team löschen", - "AGENTADD_TEAM": "Agenten zu einem Team hinzufügen", - "EDIT_TEAM": "Team bearbeiten", + "AGENTADD_TEAM": "Hinzufügen von Agenten zu einer Gruppe", + "EDIT_TEAM": "Team bearbeiten.", "TYPE": "Typ", - "TELEPHONES": "Endgeräte", - "CALLERID": "Standard angezeigte Nummer (Caller-ID)", - "ENABLERECORDING": "Darf Aufzeichnung starten/stoppen", + "TELEPHONES": "Telefone", + "CALLERID": "Die Anrufer-ID", + "ENABLERECORDING": "Aktivieren der Aufzeichnung", "STAFF": "Personal", - "ID": "ID", + "ID": "Id", "NEW_USER": "Neuer Benutzer", "NEW_AGENT": "Neuer Agent", "NEW_TELEPHONE": "Neues Telefon", "NEW_TEAM": "Neues Team", "ADD_TEAM": "Team hinzufügen", - "JOIN_QUEUE": "In Warteschlange beitreten", - "CAPACITY": "Gleichzeitige Bearbeitung der Kommunikationskanäle", + "JOIN_QUEUE": "Melden Sie Warteschlange", + "CAPACITY": "Kapazität", "AUTOINTERNAL": "Interne Nummer automatisch generieren", - "ADD_AGENT_TO_TEAM": "Agenten zum Team hinzufügen", - "TEAMADD_AGENT": "Zum Team hinzufügen", - "NO_AVAILABLE_INFO": "Keine Informationen verfügbar", + "ADD_AGENT_TO_TEAM": "Hinzufügen von Agenten zu einer Gruppe", + "TEAMADD_AGENT": "Agent zu Gruppe hinzufügen", + "NO_AVAILABLE_INFO": "Keine verfügbaren Info", "PERMISSIONS": "Berechtigungen", - "ADD_AGENT_TO_QUEUE": "Agenten zur Warteschlange hinzufügen", + "ADD_AGENT_TO_QUEUE": "Agent zur Warteschlange hinzufügen", "ALL_MODULES_AVAILABLE": "Alle Module verfügbar", - "CALLGROUP": "Anrufgruppe", - "PICKUPGROUP": "Pick-Up Gruppe", + "CALLGROUP": "Gruppenruf", + "PICKUPGROUP": "Übernahmegruppe", "ADD_AGENT_TO_QUEUE_CAMPAIGNS": "Agenten hinzufügen - ausgehende Anrufe", "ADD_AGENT_TO_VOICE_QUEUES": "Agenten hinzufügen - eingehende Anrufe", "ADD_AGENT_TO_CHAT_QUEUES": "Agenten hinzufügen - Chat-Warteschlangen", @@ -190,13 +190,13 @@ "ADD_AGENT_TO_SMS_QUEUES": "Agenten hinzufügen - SMS-Warteschlangen", "ADD_AGENT_TO_OPENCHANNEL_QUEUES": "Agenten hinzufügen - offener Kanal-Warteschlangen", "ADD_AGENT_TO_FAX_QUEUES": "Agenten hinzufügen - Fax-Warteschlangen", - "QUEUEADD_USER_VOICE_INBOUND": "Nutzer hinzufügen - eingehende Anrufe", - "QUEUEADD_USER_CHAT_INBOUND": "Nutzer hinzufügen - eingehende Chats", - "QUEUEADD_USER_MAIL_INBOUND": "Nutzer hinzufügen - eingehende E-Mails", - "QUEUEADD_USER_SMS_INBOUND": "Nutzer hinzufügen - eingehende SMS", - "QUEUEADD_USER_OPENCHANNEL_INBOUND": "Nutzer hinzufügen - eingehender offener Kanal", - "QUEUEADD_USER_FAX_INBOUND": "Nutzer hinzufügen - eingehende Faxe", - "ALL_TEAMS": "Alle Teams", + "QUEUEADD_USER_VOICE_INBOUND": "Benutzer stimme Warteschlangen hinzufügen", + "QUEUEADD_USER_CHAT_INBOUND": "Benutzer zu chatten Warteschlangen hinzufügen", + "QUEUEADD_USER_MAIL_INBOUND": "Benutzer Mail Warteschlangen hinzufügen", + "QUEUEADD_USER_SMS_INBOUND": "Benutzer von SMS-Warteschlangen hinzufügen", + "QUEUEADD_USER_OPENCHANNEL_INBOUND": "Benutzer zum offenen Kanal Warteschlangen hinzufügen", + "QUEUEADD_USER_FAX_INBOUND": "Benutzer fax Warteschlangen hinzufügen", + "ALL_TEAMS": "Alle Mannschaften", "SELECTED_TEAMS": "Ausgewählte Teams", "SELECTED_AGENTS": "Ausgewählte Agenten", "ALL_QUEUE_CAMPAIGNS": "Alle Warteschlangen - ausgehende Anrufe", @@ -214,52 +214,52 @@ "ALL_FAX_QUEUES": "Alle Warteschlangen - Fax", "SELECTED_FAX_QUEUES": "Ausgewählte Warteschlangen - Fax", "VOICEMAIL": "Voicemail", - "SHOWWEBCONTROL": "Verbindungstyp", + "SHOWWEBCONTROL": "Anzeigen Web Control", "PAGE": "Seite", "ROWSPERPAGE": "Zeilen pro Seite", - "OF": "von", + "OF": "Von", "CALLFORWARDING": "Anrufweiterleitung", - "DND": "Darf \"Nicht Stören\" Status setzen", - "UNANSWEREDCALLBADGE": "Unbeantwortete Anrufe im Icon anzeigen", - "ENABLEDTMFTONE": "Darf DTMF-Töne senden", - "AUTOANSWERDELAY": "Automatische Antwort nach", + "DND": "Während der Pause nicht stören", + "UNANSWEREDCALLBADGE": "Zeige unbeantwortete Anruf Abzeichen", + "ENABLEDTMFTONE": "Dtmf-Töne aktivieren", + "AUTOANSWERDELAY": "Auto Antwortverzögerung", "ENCRYPTION": "Verschlüsselung", "CHANNELS": "Kanäle", "CHAT": "Chat", - "SMS": "SMS", + "SMS": "Sms", "OPENCHANNEL": "Offener Kanal", "FAX": "Fax", - "QUEUEADD_USER_VOICE_OUTBOUND": "Nutzer zu ausgehender Warteschlange hinzufügen", - "MONITOREXTENSION": "Nebenstelle des Nutzers aufzeichnen", + "QUEUEADD_USER_VOICE_OUTBOUND": "Benutzer in Warteschlange Kampagnen hinzufügen", + "MONITOREXTENSION": "Anrufe an die Nebenstelle des Benutzers aufzeichnen", "NO_PASSWORD_CHANGE": "Keine Passwortänderung", "SECURITY_SUITE": "Sicherheitssuite", - "LAST_PASSWORD_RESET_AT": "Passwort zuletzt zurückgesetzt am:", - "SIP_WEBRTC": "SIP/WebRTC", - "SETTINGS_WEBRTC": "Einstellungen", + "LAST_PASSWORD_RESET_AT": "Letzte Passwort zurücksetzen um", + "SIP_WEBRTC": "Schluck", + "SETTINGS_WEBRTC": "die Einstellungen", "WEBRTC": "WebRTC", "DTLSCERTFILE": "TLS-Zertifikat", - "DTLSPRIVATEKEY": "Privater Schlüssel des TLS-Zertifikats", - "EDITPERMISSIONS": "Berechtigungen verwalten", - "READANDEDIT": "Lesen und Bearbeiten", - "READANDEDITANDDELETE": "Lesen, Bearbeiten und Löschen", - "GENERAL_PERMISSIONS": "Allgemein", - "ENABLEMESSENGER": "Internen Messenger aktivieren", - "OUTBOUNDPROXY": "Outbound-Proxy", + "DTLSPRIVATEKEY": "Der private Schlüssel des TLS-Zertifikats", + "EDITPERMISSIONS": "Bearbeiten von Berechtigungen", + "READANDEDIT": "Lesen, Bearbeiten", + "READANDEDITANDDELETE": "Lesen, Bearbeiten, Löschen", + "GENERAL_PERMISSIONS": "Allgemeines", + "ENABLEMESSENGER": "Aktivieren Sie den internen Messenger", + "OUTBOUNDPROXY": "Oubound-Proxy", "PHONE": "Telefon", "MOBILE": "Handy, Mobiltelefon", "ALIAS": "Alias", "ENABLEJAWSINTEGRATION": "Jaws-Integration aktivieren", "PREFIXREQUIRED": "Präfix erforderlich", - "ENABLEVIDEORECORDING": "Videoaufzeichnung aktivieren", + "ENABLEVIDEORECORDING": "Aktiviere Videoaufnahme", "OLD_PASSWORD": "Altes Passwort", "ALL_CHATQUEUES": "Alle Chat-Warteschlangen", - "ALL_CHATWEBSITES": "Alle Chat-Webseiten", - "ALL_FAXACCOUNTS": "Alle Fax-Konten", - "ALL_FAXQUEUES": "Alle Fax-Warteschlangen", + "ALL_CHATWEBSITES": "Alle Chat-Websites", + "ALL_FAXACCOUNTS": "Alle Faxkonten", + "ALL_FAXQUEUES": "Alle Faxwarteschlangen", "ALL_MAILACCOUNTS": "Alle E-Mail-Konten", "ALL_MAILQUEUES": "Alle E-Mail-Warteschlangen", - "ALL_OPENCHANNELACCOUNTS": "Alle offener Kanal-Konten", - "ALL_OPENCHANNELQUEUES": "Alle offener Kanal-Warteschlangen", + "ALL_OPENCHANNELACCOUNTS": "Alle offenen Channel-Konten", + "ALL_OPENCHANNELQUEUES": "Alle offenen Kanalwarteschlangen", "ALL_PROJECTS": "Alle Cally Square-Projekte", "ALL_QUEUECAMPAIGNS": "Alle Queue-Kampagnen", "ALL_SMSACCOUNTS": "Alle SMS-Konten", @@ -268,33 +268,33 @@ "MANAGE_PERMISSIONS": "Berechtigungen verwalten", "SELECTED_CHATQUEUES": "Ausgewählte E-Mail-Warteschlangen", "SELECTED_CHATWEBSITES": "Ausgewählte Chat-Websites", - "SELECTED_FAXACCOUNTS": "Ausgewählte Fax-Konten", - "SELECTED_FAXQUEUES": "Ausgewählte Fax-Warteschlangen", + "SELECTED_FAXACCOUNTS": "Ausgewählte Faxkonten", + "SELECTED_FAXQUEUES": "Ausgewählte Faxwarteschlangen", "SELECTED_MAILACCOUNTS": "Ausgewählte E-Mail-Konten", "SELECTED_MAILQUEUES": "Ausgewählte Chat-Warteschlangen", - "SELECTED_OPENCHANNELACCOUNTS": "Ausgewählte offener Kanal-Konten", - "SELECTED_OPENCHANNELQUEUES": "Ausgewählte offene Kanal-Warteschlangen", + "SELECTED_OPENCHANNELACCOUNTS": "Ausgewählte offene Channel-Konten", + "SELECTED_OPENCHANNELQUEUES": "Ausgewählte offene Kanalwarteschlangen", "SELECTED_PROJECTS": "Ausgewählte Projekte von Cally Square", "SELECTED_QUEUECAMPAIGNS": "Ausgewählte Queue-Kampagnen", "SELECTED_SMSACCOUNTS": "Ausgewählte SMS-Konten", "SELECTED_SMSQUEUES": "Ausgewählte SMS-Warteschlangen", - "SELECTED_VOICEQUEUES": "Ausgewählte Anruf-Warteschlangen", + "SELECTED_VOICEQUEUES": "Ausgewählte Sprachwarteschlangen", "USERADD_CHATQUEUES": "Chat-Warteschlange zum Benutzer hinzufügen", "USERADD_CHATWEBSITES": "Chat-Website zum Benutzer hinzufügen", "USERADD_FAXACCOUNTS": "Faxkonto zum Benutzer hinzufügen", - "USERADD_FAXQUEUES": "Fax-Warteschlange zum Benutzer hinzufügen", + "USERADD_FAXQUEUES": "Faxwarteschlange zum Benutzer hinzufügen", "USERADD_MAILACCOUNTS": "E-Mail-Konto zum Benutzer hinzufügen", "USERADD_MAILQUEUES": "E-Mail-Warteschlange zum Benutzer hinzufügen", - "USERADD_OPENCHANNELACCOUNTS": "Offener Kanal-Konto zum Benutzer hinzufügen", - "USERADD_OPENCHANNELQUEUES": "Offener Kanal-Warteschlange zum Benutzer hinzufügen", + "USERADD_OPENCHANNELACCOUNTS": "Open Channel-Konto zum Benutzer hinzufügen", + "USERADD_OPENCHANNELQUEUES": "Open Channel-Warteschlange zum Benutzer hinzufügen", "USERADD_PROJECTS": "Cally Square-Projekt zum Benutzer hinzufügen", "USERADD_QUEUECAMPAIGNS": "Queue-Kampagne zum Benutzer hinzufügen", "USERADD_SMSACCOUNTS": "SMS-Konto zum Benutzer hinzufügen", "USERADD_SMSQUEUES": "SMS-Warteschlange zum Benutzer hinzufügen", - "USERADD_VOICEQUEUES": "Anruf-Warteschlange zum Benutzer hinzufügen", - "HOTDESK": "Wechselnder Arbeitsplatz", + "USERADD_VOICEQUEUES": "Sprachwarteschlange zum Benutzer hinzufügen", + "HOTDESK": "Heißer Schreibtisch", "ADD_USERPROFILE": "Benutzerprofil hinzufügen", - "CANCEL": "Abbrechen", + "CANCEL": "Stornieren", "CLONE_USERPROFILE": "Benutzerprofil klonen", "CLOSE": "Schließen", "CONFIRM": "Bestätigen", @@ -308,38 +308,38 @@ "PERMISSIONS_ALL_RESOURCES": "Alle Ressourcen", "PERMISSIONS_AUTO_ASSOCIATION_INFO": "Ordnen Sie dem Benutzerprofil automatisch alle aktuellen und zukünftigen Ressourcen dieses Abschnitts zu", "PERMISSIONS_MANAGE": "Verwalten", - "PERMISSIONS_PLACEHOLDER_SEARCH": "Suche", + "PERMISSIONS_PLACEHOLDER_SEARCH": "Suche...", "PERMISSIONS_SECTION_HIDE": "Abschnitt für den Benutzer ausblenden", "PERMISSIONS_SECTION_SHOW": "Abschnitt dem Benutzer anzeigen", "PERMISSIONS_SECTION_TITLE": "{{sectionName}} Berechtigungen", "PERMISSIONS_SELECTED_RESOURCES": "Ausgewählte Ressourcen", - "PERMISSIONS_SELECT_REPORT_TYPE": "Berichtstyp wählen", - "PERMISSIONS_SELECT_SECTION": "Abschnitt auswählen", - "PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE": "Kein Zugriff auf den ausgewählten Bereich", + "PERMISSIONS_SELECT_REPORT_TYPE": "Wählen Sie den Berichtstyp", + "PERMISSIONS_SELECT_SECTION": "Wählen Sie einen Abschnitt aus", + "PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE": "Sie dürfen nicht auf den ausgewählten Bereich zugreifen", "PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE": "Unbefugte Handlung", - "PERMISSIONS_WARNING_CLOSE": "Es wurden Änderungen nicht gespeichert. Fortfahren?", + "PERMISSIONS_WARNING_CLOSE": "Du hast nicht gespeicherte Änderungen. Möchten Sie den Vorgang wirklich ohne Speichern beenden?", "PERMISSIONS_WARNING_ENABLE_ALL": "Alle {{sectionName}} Unterabschnitte und ihre Ressourcen werden aktiviert. Sind Sie sicher, dass Sie fortfahren möchten?", - "QUEUES_ASSOCIATION": "{{channel}} Warteschlangen-Zuweisung", + "QUEUES_ASSOCIATION": "{{channel}} Queues Association", "READ_PERMISSION": "Lesen", "REPORT_TYPE": "Berichtstyp", "SECTIONS": "Abschnitte", "SUMMARY": "Zusammenfassung", - "TEAMS_ASSOCIATION": "Teamzuweisung", + "TEAMS_ASSOCIATION": "Vereinigung der Mannschaften", "USERPROFILE": "Benutzerprofil", - "USERPROFILES": "Benutzerprofile", - "PERMISSIONS_UNAUTHORIZED_CREATION_MESSAGE": "Keine Berechtigung zum Erstellen der Ressource", - "VIDEOSUPPORT": "Videounterstützung aktivieren", + "USERPROFILES": "Benutzerprofil", + "PERMISSIONS_UNAUTHORIZED_CREATION_MESSAGE": "Sie dürfen die Ressource nicht erstellen", + "VIDEOSUPPORT": "Video-Unterstützung", "APIKEY": "API-Schlüssel", - "APIKEYMANAGER_USER": "API-Schlüsselverwaltung", - "GENERATE": "Erneut generieren", + "APIKEYMANAGER_USER": "API Key Manager", + "GENERATE": "(Regenerieren", "MANAGE_API_KEY": "API-Schlüsselmanager", - "REMOVE": "Entfernen", - "ENABLEAUTOMATICSCREENRECORDING": "Automatische Bildschirmaufzeichnung aktivieren", - "ENABLESCREENRECORDINGBYAGENT": "Bildschirmaufzeichnung durch Agenten aktivieren", - "ENABLEVIDEOECORDING": "Videoaufzeichnung aktivieren", + "REMOVE": "Löschen", + "ENABLEAUTOMATICSCREENRECORDING": "Aktivieren Sie die automatische Bildschirmaufnahme", + "ENABLESCREENRECORDINGBYAGENT": "Aktivieren Sie die Bildschirmaufzeichnung nach Agent", + "ENABLEVIDEOECORDING": "Videoaufnahme aktivieren", "BLOCKED": "Gesperrt", "DISABLED": "Deaktiviert", - "REGENERATE": "Erneut generieren", + "REGENERATE": "Regenerieren", "ALL_WHATSAPP_QUEUES": "Alle WhatsApp-Warteschlangen", "ALL_WHATSAPPACCOUNTS": "Alle WhatsApp-Konten", "ALL_WHATSAPPQUEUES": "Alle Whataspp-Warteschlangen", @@ -349,45 +349,45 @@ "SELECTED_WHATSAPPACCOUNTS": "Ausgewählte WhatsApp-Konten", "SELECTED_WHATSAPPQUEUES": "Ausgewählte WhatsApp-Warteschlangen", "USERADD_WHATSAPPACCOUNTS": "WhatsApp-Konto zum Benutzer hinzufügen", - "USERADD_WHATSAPPQUEUES": "Whataspp-Warteschlange dem Benutzer hinzufügen", + "USERADD_WHATSAPPQUEUES": "Fügen Sie dem Benutzer die Whataspp-Warteschlange hinzu", "WHATSAPP": "WhatsApp Connector", - "WHATSAPPCAPACITY": "Kapazität Whatsapp", - "MASK_SENSITIVE_DATA": "Pers. Kundendaten verbergen", + "WHATSAPPCAPACITY": "WhatsApp Connector-Kapazität", + "MASK_SENSITIVE_DATA": "Sensitive Daten maskieren", "WSS_PORT": "WSS-Port", - "ATTACHMENTS": "Darf Anhänge herunterladen", - "CALLYSQUARE_RECORDINGS": "Darf Aufzeichnungen aus dem CallFlow herunterladen", - "CONTACT_MANAGER_LISTS": "Darf Listen aus dem Kontaktmanager herunterladen", + "ATTACHMENTS": "Anhänge", + "CALLYSQUARE_RECORDINGS": "Cally Square-Aufnahmen", + "CONTACT_MANAGER_LISTS": "Kontaktmanagerlisten", "DOWNLOADS": "Downloads", "DOWNLOAD_PERMISSIONS": "Download-Berechtigungen", - "JSCRIPTY_SESSIONS": "Darf Jscripty-Sitzungen herunterladen", - "OMNICHANNEL_INTERACTIONS": "Darf alle Kanalübergreifenden Interaktionen herunterladen", - "SCREEN_RECORDINGS": "Darf Bildschirmaufzeichnungen herunterladen", - "VOICE_RECORDINGS": "Darf Sprachaufzeichnungen herunterladen", + "JSCRIPTY_SESSIONS": "Jscripty-Sitzungen", + "OMNICHANNEL_INTERACTIONS": "Omnichannel-Interaktionen", + "SCREEN_RECORDINGS": "Bildschirmaufnahmen", + "VOICE_RECORDINGS": "Sprachaufnahmen", "IGNORE_AGENT_BREAK_STATUS_FOR_PREVIEW_CALLS": "Darf Outbound-Preview auch während Pause durchführen", "SELECT_RECALLME_CAMPAIGN": "Darf Auswahl für Outbound-Kampagne treffen", - "QUEUEADD_AGENT_VOICE_OUTBOUND": "Agenten hinzufügen - ausgehende Anrufe", - "QUEUEADD_AGENT_VOICE_INBOUND": "Agenten hinzufügen - eingehende Anrufe", - "QUEUEADD_AGENT_CHAT_INBOUND": "Agenten hinzufügen - Chat-Warteschlangen", - "QUEUEADD_AGENT_MAIL_INBOUND": "Agenten hinzufügen - E-Mail-Warteschlangen", - "QUEUEADD_AGENT_SMS_INBOUND": "Agenten hinzufügen - SMS-Warteschlangen", - "QUEUEADD_AGENT_OPENCHANNEL_INBOUND": "Agenten hinzufügen - offener Kanal-Warteschlangen", - "QUEUEADD_AGENT_FAX_INBOUND": "Agenten hinzufügen - Fax-Warteschlangen", - "ALL_QUEUES_VOICE_OUTBOUND": "Alle Warteschlangen - ausgehende Anrufe", - "SELECTED_QUEUES_VOICE_OUTBOUND": "Gewählte Warteschlangen - ausgehende Anrufe", - "ALL_QUEUES_VOICE_INBOUND": "Alle Warteschlangen - eingehende Anrufe", - "SELECTED_QUEUES_VOICE_INBOUND": "Ausgewählte Warteschlangen - eingehende Anrufe", - "ALL_QUEUES_CHAT_INBOUND": "Alle Warteschlangen - Chat", - "SELECTED_QUEUES_CHAT_INBOUND": "Ausgewählte Warteschlangen - Chat", - "ALL_QUEUES_MAIL_INBOUND": "Alle Warteschlangen - E-Mail", - "SELECTED_QUEUES_MAIL_INBOUND": "Ausgewählte Warteschlangen - E-Mail", - "ALL_QUEUES_SMS_INBOUND": "Alle Warteschlangen - SMS", - "SELECTED_QUEUES_SMS_INBOUND": "Ausgewählte Warteschlangen - SMS", - "ALL_QUEUES_OPENCHANNEL_INBOUND": "Alle Warteschlangen - offener Kanal", - "SELECTED_QUEUES_OPENCHANNEL_INBOUND": "Ausgewählte Warteschlangen - offener Kanal", - "ALL_QUEUES_FAX_INBOUND": "Alle Warteschlangen - Fax", - "SELECTED_QUEUES_FAX_INBOUND": "Ausgewählte Warteschlangen - Fax", + "QUEUEADD_AGENT_VOICE_OUTBOUND": "Agent in der Warteschlange Kampagnen hinzufügen", + "QUEUEADD_AGENT_VOICE_INBOUND": "Agent Voice Warteschlangen hinzufügen", + "QUEUEADD_AGENT_CHAT_INBOUND": "Agent zu chatten Warteschlangen hinzufügen", + "QUEUEADD_AGENT_MAIL_INBOUND": "Agent Mail Warteschlangen hinzufügen", + "QUEUEADD_AGENT_SMS_INBOUND": "Agent sms-Warteschlangen hinzufügen", + "QUEUEADD_AGENT_OPENCHANNEL_INBOUND": "Agent zu offenen Kanal Warteschlangen hinzufügen", + "QUEUEADD_AGENT_FAX_INBOUND": "Agent fax Warteschlangen hinzufügen", + "ALL_QUEUES_VOICE_OUTBOUND": "Alle Queue Kampagnen", + "SELECTED_QUEUES_VOICE_OUTBOUND": "Ausgewählte Warteschlange Kampagnen", + "ALL_QUEUES_VOICE_INBOUND": "Alle Warteschlangen", + "SELECTED_QUEUES_VOICE_INBOUND": "Ausgewählte Voice Warteschlangen", + "ALL_QUEUES_CHAT_INBOUND": "Alle Chat Warteschlangen", + "SELECTED_QUEUES_CHAT_INBOUND": "Ausgewählte Chat-warteschlangen", + "ALL_QUEUES_MAIL_INBOUND": "Alle E-Mail-Warteschlangen", + "SELECTED_QUEUES_MAIL_INBOUND": "Ausgewählte Mail Warteschlangen", + "ALL_QUEUES_SMS_INBOUND": "Alle SMS-Warteschlangen", + "SELECTED_QUEUES_SMS_INBOUND": "Ausgewählte SMS-Warteschlangen", + "ALL_QUEUES_OPENCHANNEL_INBOUND": "Alle offenen Kanal Warteschlangen", + "SELECTED_QUEUES_OPENCHANNEL_INBOUND": "Ausgewählten Offenen Kanal Warteschlangen", + "ALL_QUEUES_FAX_INBOUND": "Alle Fax Warteschlangen", + "SELECTED_QUEUES_FAX_INBOUND": "Ausgewählte Fax Warteschlangen", "ALL_QUEUES_WHATSAPP_INBOUND": "Alle WhatsApp-Warteschlangen", - "QUEUEADD_AGENT_WHATSAPP_INBOUND": "Agenten zu WhatsApp-Warteschlangen hinzufügen", + "QUEUEADD_AGENT_WHATSAPP_INBOUND": "Agent zu WhatsApp-Warteschlangen hinzufügen", "SELECTED_QUEUES_WHATSAPP_INBOUND": "Ausgewählte WhatsApp-Warteschlangen", "AD_SSO_ENABLED": "Active Directory-SSO", "AUTHENTICATION": "Authentifizierung", diff --git a/public/app/main/apps/staff/i18n/pt-BR.json b/public/app/main/apps/staff/i18n/pt-BR.json index 31c8d9c..7bfe301 100644 --- a/public/app/main/apps/staff/i18n/pt-BR.json +++ b/public/app/main/apps/staff/i18n/pt-BR.json @@ -2,11 +2,11 @@ "STAFF": { "HOTDESK": "Hot desk", "ENABLEVIDEORECORDING": "Ativar gravação de vídeo", - "OLD_PASSWORD": "Senha Antiga", - "ENABLEJAWSINTEGRATION": "Ativar Integração de Jaws", + "OLD_PASSWORD": "Senha antiga", + "ENABLEJAWSINTEGRATION": "Ativar integração de Jaws", "ALIAS": "Alias", "NO_PASSWORD_CHANGE": "Nenhuma mudança de senha", - "SECURITY_SUITE": "Suíte de Segurança", + "SECURITY_SUITE": "Suíte de segurança", "LAST_PASSWORD_RESET_AT": "Última redefinição de senha em", "SIP_WEBRTC": "Sip", "SETTINGS_WEBRTC": "Definições", @@ -20,7 +20,7 @@ "TOGGLE_SIDENAV": "Toggle sidenav", "SEARCH_FOR_ANYONE": "Procurar", "BACK": "Voltar", - "MULTI_SELECT_TOGGLE": "multi select toggle", + "MULTI_SELECT_TOGGLE": "Multi select toggle", "SELECT_ALL": "Selecionar tudo", "SELECT_NONE": "Selecione nenhum", "SELECTED": "Selecionado", @@ -28,20 +28,20 @@ "EXPORT_SELECTED": "Exportar selecionado", "ALL_USERS": "Todos os usuários", "ALL_AGENTS": "Todos os agentes", - "SORT": "ordenar", + "SORT": "Ordenar", "NAME": "Nome", - "FULLNAME": "Nome Completo", + "FULLNAME": "Nome completo", "A_TO_Z": "(A a Z)", "Z_TO_A": "(Z a A)", "MORE": "Mais", - "DELETE_USER": "Excluir Usuário", - "EDIT_USER": "Editar Usuário", - "DELETE_AGENT": "Excluir Agente", - "EDIT_AGENT": "Editar Agente", + "DELETE_USER": "Excluir usuário", + "EDIT_USER": "Editar usuário", + "DELETE_AGENT": "Excluir agente", + "EDIT_AGENT": "Editar agente", "DELETE": "Excluir", "SAVE": "Salvar", - "ADD_USER": "Adicionar Usuário", - "ADD_AGENT": "Adicionar Agente", + "ADD_USER": "Adicionar usuário", + "ADD_AGENT": "Adicionar agente", "NO_RESULTS": "Nenhum resultado ..", "CLOSE_DIALOG": "Fechar a caixa de diálogo", "NAME_REQUIRED": "Nome (obrigatório)", @@ -146,50 +146,50 @@ "CHATCAPACITY": "Capacidade do Chat", "MAILCAPACITY": "Capacidade de Email", "FAXCAPACITY": "Capacidade do Fax", - "SMSCAPACITY": "Capacidade do Sms", - "OPENCHANNELCAPACITY": "Capacidade do Open Channel", + "SMSCAPACITY": "Capacidade do SMS", + "OPENCHANNELCAPACITY": "Capacidade do OpenChannel", "MOTIONBAR": "Motion Bar", "SETTINGS": "Definições", "AUTOANSWER": "Resposta automática", - "ENABLESETTINGS": "Habilitar Definições", - "CALL_FORWARDING": "Encaminhamento de Chamadas", + "ENABLESETTINGS": "Habilitar configurações", + "CALL_FORWARDING": "Encaminhamento de chamadas", "UNCONDITIONAL": "Incondicional", - "UNCONDITIONALNUMBER": "Número Incondicional", + "UNCONDITIONALNUMBER": "Número incondicional", "NOREPLY": "Sem resposta", "NOREPLYNUMBER": "Nenhum número de resposta", "BUSY": "Ocupado", - "BUSYNUMBER": "Número Ocupado", + "BUSYNUMBER": "Número ocupado", "REMOTE_CONTROL": "Controle remoto", "REMOTECONTROL": "Controle remoto", - "REMOTECONTROLPORT": "Porta de Controle remoto", + "REMOTECONTROLPORT": "Porta de controle remoto", "SIP": "SIP", "SIPEXPIRES": "SIP Expira [seg]", "SIPPORT": "Porta SIP", "PENALTY": "Prioridade", "ACCOUNTNAME": "Nome da conta", - "ADD_TELEPHONE": "Adicionar Ramal", - "EDIT_TELEPHONE": "Editar Ramal", - "DELETE_TELEPHONE": "Excluir Ramal", - "TEAMS": "Grupos", - "DELETE_TEAM": "Excluir Grupo", - "AGENTADD_TEAM": "Adicionar agentes no grupo", - "EDIT_TEAM": "Editar Grupo", + "ADD_TELEPHONE": "Adicionar Ramal Adm", + "EDIT_TELEPHONE": "Editar Ramal Adm", + "DELETE_TELEPHONE": "Excluir Ramal Adm", + "TEAMS": "Equipes", + "DELETE_TEAM": "Excluir Equipe", + "AGENTADD_TEAM": "Adicionar agentes na equipe", + "EDIT_TEAM": "Editar Equipe", "TYPE": "Tipo", - "TELEPHONES": "Ramais", + "TELEPHONES": "Ramais Adm", "CALLERID": "Identificador de chamadas", "ENABLERECORDING": "Ativar gravação", - "STAFF": "Equipe", + "STAFF": "Colaboradores", "ID": "Id", - "NEW_USER": "Novo Usuário", - "NEW_AGENT": "Novo Agente", - "NEW_TELEPHONE": "Novo Ramal", - "NEW_TEAM": "Novo Grupo", - "ADD_TEAM": "Adicionar Grupo", + "NEW_USER": "Novo usuário", + "NEW_AGENT": "Novo agente", + "NEW_TELEPHONE": "Novo ramal adm", + "NEW_TEAM": "Nova equipe", + "ADD_TEAM": "Adicionar equipe", "JOIN_QUEUE": "Junte-se à fila", "CAPACITY": "Capacidade", "AUTOINTERNAL": "Auto gerar número interno", - "ADD_AGENT_TO_TEAM": "Adicionar agente no grupo", - "TEAMADD_AGENT": "Adicionar agente no grupo", + "ADD_AGENT_TO_TEAM": "Adicionar agente na equipe", + "TEAMADD_AGENT": "Adicionar agente na equipe", "NO_AVAILABLE_INFO": "Nenhuma informação disponível", "PERMISSIONS": "Permissões", "ADD_AGENT_TO_QUEUE": "Adicionar agente à fila", @@ -209,8 +209,8 @@ "QUEUEADD_USER_SMS_INBOUND": "Adicionar usuário às filas do SMS", "QUEUEADD_USER_OPENCHANNEL_INBOUND": "Adicionar usuário para filas do Open Channel", "QUEUEADD_USER_FAX_INBOUND": "Adicionar usuário às filas de fax", - "ALL_TEAMS": "Todos os grupos", - "SELECTED_TEAMS": "Grupos Selecionados", + "ALL_TEAMS": "Todas as equipes", + "SELECTED_TEAMS": "Equipes Selecionadas", "SELECTED_AGENTS": "Agentes Selecionados", "ALL_QUEUE_CAMPAIGNS": "Todas as campanhas de filas", "SELECTED_QUEUE_CAMPAIGNS": "Campanhas de Filas Selecionadas", @@ -239,8 +239,8 @@ "ENCRYPTION": "Encriptação", "CHANNELS": "Canais", "CHAT": "Chat", - "SMS": "Sms", - "OPENCHANNEL": "Open Channel", + "SMS": "SMS", + "OPENCHANNEL": "OpenChannel", "FAX": "Fax", "QUEUEADD_USER_VOICE_OUTBOUND": "Adicionar usuário a campanhas de fila", "MONITOREXTENSION": "Gravar chamadas para a extensão do usuário", @@ -252,7 +252,7 @@ "OUTBOUNDPROXY": "Proxy de saída", "PHONE": "Telefone", "MOBILE": "Celular", - "PREFIXREQUIRED": "Prefixo Obrigatório", + "PREFIXREQUIRED": "Prefixo obrigatório", "MANAGE_PERMISSIONS": "Gerenciar Permissões", "USERADD_VOICEQUEUES": "Adicionar fila de voz ao usuário", "ALL_VOICEQUEUES": "Todas as filas de voz", @@ -324,14 +324,14 @@ "REPORT_TYPE": "Tipo de relatório", "SECTIONS": "Seções", "SUMMARY": "Resumo", - "TEAMS_ASSOCIATION": "Associação de grupos", + "TEAMS_ASSOCIATION": "Associação de equipes", "USERPROFILE": "Perfil de usuário", "USERPROFILES": "Perfis de usuário", "PERMISSIONS_UNAUTHORIZED_CREATION_MESSAGE": "Você não tem permissão para criar o recurso", "VIDEOSUPPORT": "Suporte de vídeo", "APIKEY": "Chave API", "APIKEYMANAGER_USER": "Gerenciador de chaves da API", - "GENERATE": "(Regenerado", + "GENERATE": "Generate", "MANAGE_API_KEY": "Gerenciador de chaves da API", "REMOVE": "Remover", "ENABLEAUTOMATICSCREENRECORDING": "Ativar gravação automática de tela", @@ -339,7 +339,7 @@ "ENABLEVIDEOECORDING": "Ativar gravação de vídeo", "BLOCKED": "Bloqueado", "DISABLED": "Desativado", - "REGENERATE": "Regenerado", + "REGENERATE": "Regenerate", "ALL_WHATSAPP_QUEUES": "Todas as filas de WhatsApp", "ALL_WHATSAPPACCOUNTS": "Todas as contas WhatsApp", "ALL_WHATSAPPQUEUES": "Todas as filas Whataspp", @@ -356,13 +356,13 @@ "WSS_PORT": "Porta WSS", "ATTACHMENTS": "Anexos", "CALLYSQUARE_RECORDINGS": "Gravações da Cally Square", - "CONTACT_MANAGER_LISTS": "Listas de gerenciadores de contatos", - "DOWNLOADS": "Transferências", + "CONTACT_MANAGER_LISTS": "Listas de gestão de contatos", + "DOWNLOADS": "Downloads", "DOWNLOAD_PERMISSIONS": "Permissões de download", "JSCRIPTY_SESSIONS": "Sessões Jscripty", "OMNICHANNEL_INTERACTIONS": "Interações Omnichannel", "SCREEN_RECORDINGS": "Gravações de tela", - "VOICE_RECORDINGS": "Gravações de Voz", + "VOICE_RECORDINGS": "Gravações de voz", "IGNORE_AGENT_BREAK_STATUS_FOR_PREVIEW_CALLS": "Ignorar o status de interrupção do agente para chamadas de visualização", "SELECT_RECALLME_CAMPAIGN": "Selecione a campanha Recall Me", "QUEUEADD_AGENT_VOICE_OUTBOUND": "Adicionar agente a campanhas de fila", diff --git a/public/app/main/apps/tools/i18n/de.json b/public/app/main/apps/tools/i18n/de.json index 4489cf0..4904d14 100644 --- a/public/app/main/apps/tools/i18n/de.json +++ b/public/app/main/apps/tools/i18n/de.json @@ -1,216 +1,216 @@ { "TOOLS": { - "BOT": "BOT", + "BOT": "Voicebot", "CALL": "Anruf", "NAME": "Name", - "TRUNKS": "SIP-Trunks", - "SEARCH_FOR_ANYONE": "Suche", + "TRUNKS": "Amtsleitungen", + "SEARCH_FOR_ANYONE": "Suche für Jedermann", "ERRORS": { - "NAME_REQUIRED": "Name erforderlich", - "HOST_REQUIRED": "Host erforderlich", - "DEFAULTUSER_REQUIRED": "Standardnutzer erforderlich", - "CALLERID_REQUIRED": "CallerID erforderlich", - "KEY_REQUIRED": "Schlüssel erforderlich", - "CONFIRM_NOT_MATCH": "Die Passwörter stimmen nicht überein", - "VALIDITYSTART_REQUIRED": "Startzeit erforderlich", - "VALIDITYEND_REQUIRED": "Endzeit erforderlich", - "MONTHDAY_REQUIRED": "Monats-Tag erforderlich", - "HOUR_REQUIRED": "Stunde erforderlich", - "CONTENT_REQUIRED": "Inhalt erforderlich", - "URL_REQUIRED": "URL erfoderlich", - "URL_MUST_VALID_URL": "Ungültiges Format URL", - "APPLICATION_REQUIRED": "Anwendung erforderlich", - "ARGUMENTS_REQUIRED": "Bedingungen erforderlich", - "NAME_MUST_VALID_PATTERN": "Ungültiges Format Name", - "POLLING_INTERVAL_REQUIRED": "Abfrageintervall erforderlich", - "TITLE_REQUIRED": "Titel erforderlich", - "EMAILADDRESS_REQUIRED": "E-Mail Adresse erforderlich", - "EVENTVARIABLES_REQUIRED": "Variablen erforderlich", - "TYPE_REQUIRED": "Typ erforderlich", - "VALUE_REQUIRED": "Wert erforderlich", - "ACCOUNT_REQUIRED": "Konto erforderlich", - "FIELD_REQUIRED": "Feld erforderlich", - "INTEGRATION_REQUIRED": "Integration erforderlich", - "LIST_REQUIRED": "Liste erforderlich", - "TEMPLATE_REQUIRED": "Vorlage erforderlich", - "AUTOCREATECONTACT_REQUIRED": "Kontakterstellung erforderlich", - "OUTBOUNDROUTE_REQUIRED": "Ausgehende Route erforderlich", - "QUEUE_REQUIRED": "Warteschlange erforderlich", - "TIME_RANGE_TO_REQUIRED": "Zeitintervall erforderlich", - "WEEK_DAYS_TO_REQUIRED": "Wochentage erforderlich", - "MONTH_DAYS_TO_REQUIRED": "Monats-Tag erforderlich", - "MONTH_TO_REQUIRED": "Monat erforderlich", + "NAME_REQUIRED": "Der Name ist erforderlich", + "HOST_REQUIRED": "Der Host wird benötigt", + "DEFAULTUSER_REQUIRED": "Der Standardbenutzer ist erforderlich", + "CALLERID_REQUIRED": "Die Anrufer-ID ist erforderlich", + "KEY_REQUIRED": "Der Schlüssel ist erforderlich", + "CONFIRM_NOT_MATCH": "Die Kennwörter nicht übereinstimmen", + "VALIDITYSTART_REQUIRED": "Die Startzeit ist erforderlich", + "VALIDITYEND_REQUIRED": "Das Ende der Zeit ist erforderlich", + "MONTHDAY_REQUIRED": "Tag des Monats ist erforderlich", + "HOUR_REQUIRED": "Die Stunde ist erforderlich", + "CONTENT_REQUIRED": "Der Inhalt ist erforderlich", + "URL_REQUIRED": "Die URL ist erforderlich", + "URL_MUST_VALID_URL": "Die URL muss gültig sein", + "APPLICATION_REQUIRED": "Die Anwendung ist erforderlich", + "ARGUMENTS_REQUIRED": "Die Argumente sind erforderlich", + "NAME_MUST_VALID_PATTERN": "Der Name muss in einem gültigen Format geschrieben werden", + "POLLING_INTERVAL_REQUIRED": "Das Abfrageintervall ist erforderlich", + "TITLE_REQUIRED": "Der Titel ist erforderlich", + "EMAILADDRESS_REQUIRED": "Die E-Mail Adresse ist erforderlich", + "EVENTVARIABLES_REQUIRED": "Pflichtfeld", + "TYPE_REQUIRED": "Pflichtfeld", + "VALUE_REQUIRED": "Pflichtfeld", + "ACCOUNT_REQUIRED": "Pflichtfeld", + "FIELD_REQUIRED": "Pflichtfeld", + "INTEGRATION_REQUIRED": "Pflichtfeld", + "LIST_REQUIRED": "Pflichtfeld", + "TEMPLATE_REQUIRED": "Pflichtfeld", + "AUTOCREATECONTACT_REQUIRED": "Pflichtfeld", + "OUTBOUNDROUTE_REQUIRED": "Pflichtfeld", + "QUEUE_REQUIRED": "Pflichtfeld", + "TIME_RANGE_TO_REQUIRED": "Pflichtfeld", + "WEEK_DAYS_TO_REQUIRED": "Pflichtfeld", + "MONTH_DAYS_TO_REQUIRED": "Pflichtfeld", + "MONTH_TO_REQUIRED": "Pflichtfeld", "TIME_RANGE_FROM_INVALID": "Falsches Format", "TIME_RANGE_TO_INVALID": "Falsches Format", "CHANNEL_REQUIRED": "Pflichtfeld", - "ACTION_REQUIRED": "Aktion erforderlich", - "CONFIGURATION_REQUIRED": "Konfiguration erforderlich", - "PROJECT_REQUIRED": "Projekt erforderlich", - "LOCATION_REQUIRED": "Standort erforderlich", - "FONTSIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Wert muss kleiner oder gleich sein als", - "FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", - "FONTSIZE_REQUIRED": "Schriftgröße erforderlich", - "PATH_REQUIRED": "Pfad erforderlich", - "FORMAT_REQUIRED": "Format erforderlich", - "REPORT_REQUIRED": "Report erforderlich", - "REFRESH_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", - "REFRESH_REQUIRED": "Aktualisierungsintervall erforderlich", - "TITLE_MAX_LENGTH": "Titel darf eine maximale Länge von {{max}} haben", - "NAME_MAX_LENGTH": "Name darf eine maximale Länge von {{max}} haben", - "OUTPUT_REQUIRED": "Ausgabeformat erforderlich", - "REPORTFOLDER_REQUIRED": "Ordner erforderlich", - "REPORTSUBFOLDER_REQUIRED": "Unterordner erforderlich", - "REPORTTYPE_REQUIRED": "Reporttyp erforderlich", - "AGENT_REQUIRED": "Agent erforderlich", - "INFO_REQUIRED": "Information erforderlich", - "SCRIPT_REQUIRED": "Skript erforderlich", - "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": "Timeout erforderlich", - "AUTOCREATE_FIELD_REQUIRED": "Automatisches Erstellen erforderlich", + "ACTION_REQUIRED": "Pflichtfeld", + "CONFIGURATION_REQUIRED": "Pflichtfeld", + "PROJECT_REQUIRED": "Pflichtfeld", + "LOCATION_REQUIRED": "Pflichtfeld", + "FONTSIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", + "FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", + "FONTSIZE_REQUIRED": "Pflichtfeld", + "PATH_REQUIRED": "Pflichtfeld", + "FORMAT_REQUIRED": "Pflichtfeld", + "REPORT_REQUIRED": "Pflichtfeld", + "REFRESH_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", + "REFRESH_REQUIRED": "Pflichtfeld", + "TITLE_MAX_LENGTH": "Der Wert muss eine maximale Länge von {{max}} haben", + "NAME_MAX_LENGTH": "Der Wert muss eine maximale Länge von {{max}} haben", + "OUTPUT_REQUIRED": "Pflichtfeld", + "REPORTFOLDER_REQUIRED": "Pflichtfeld", + "REPORTSUBFOLDER_REQUIRED": "Pflichtfeld", + "REPORTTYPE_REQUIRED": "Pflichtfeld", + "AGENT_REQUIRED": "Pflichtfeld", + "INFO_REQUIRED": "Pflichtfeld", + "SCRIPT_REQUIRED": "Pflichtfeld", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", + "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", + "TIMEOUT_REQUIRED": "Pflichtfeld", + "AUTOCREATE_FIELD_REQUIRED": "Pflichtfeld", "IGNOREDIALERCONTACTID_REQUIRED": "KontaktID erforderlich" }, "HOST": "Host", - "SECRET": "Secret", - "DEFAULTUSER": "Standardnutzer", + "SECRET": "Geheimnis", + "DEFAULTUSER": "Default User", "DESCRIPTION": "Beschreibung", - "ADD_TRUNK": "Trunk hinzufügen", + "ADD_TRUNK": "Amtsleitung hinzufügen", "HELP": { - "SECRET": "Kennwort für die Authentifizierung, wenden Sie sich an den Systemadministrator.", + "SECRET": "Kennwort für die Authentifizierung, wenden Sie sich an den Anbieter.", "HOST": "Die Domäne oder den Hostnamen für den Anbieter.", - "DEFAULTUSER": "Authentifizierung Benutzername, wenden Sie sich an Ihren Anbieter.", + "DEFAULTUSER": "Authentifizierung Benutzernamen, wenden Sie sich an den Anbieter.", "CALLERID": "Die Anrufer-ID im Format \"name\" .", - "REGISTRY": "Die SIP-Registry, 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. Senden Sie ausgehende Anrufe zu diesem Server, anstelle direkt zum Endgerät. Nur gültig für Typ \"Peer\".", - "PORT": "Die Nummer des Ports, zu dem Sie eine Verbindung herstellen möchten.", - "CONTEXT": "Der zu verwendende Kontext für den Trunk", - "TYPE": "Definiert die SIP-Rolle innerhalb der Anwendung. User: Authentifizierung für eingehende Verbindungen; Peer: für ausgehende Verbindungen - Friend: 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. Dadurch höhere CPU-Belastung", - "NAT": "Ändert das Verhaltes des Asterisk-Telefonieservers für Nebenstellen hinter einer Firewall- Sofern eine der per Komma getrennten Optionen 'no', werden alle anderen Einstellungen ignoriert und der Server setzt ein 'nat=no'", - "QUALIFY": "Wenn aktiv, sendet der Telefonieserver in regelmäßigen Abständen ein Kommando, um die Erreichbarkeit der Gegenstelle zu überwachen", - "ALLOWCODECS": "Erlaubte Codecs in der Reihenfolge der Auflistung", - "INSECURE": "Erlaubt unsichere Einstellungen für peer", - "CALL_LIMIT": "Maximale Anzahl aller gleichzeitigen Anrufe (Ein- und Ausgehend)", - "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.", + "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.", + "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.", + "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).", "TRANSPORT": "Festlegen der Standardeinstellungen für Transporte. Die Reihenfolge bestimmt den primären Standard.", - "OTHERFIELDS": "Weitere Felder zum Konfiguration des SIP-Trunks hinzufügen. Standard Asterisk-Format (key=value). Neue Zeile erstellen pro neuem Feld", - "EMAILADDRESS": "Mehrere Adressen mit Komma getrennt eingeben: (z. b. John.doe@xcally.com, jane.miller@xcally.com)", + "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)", "NAME": "Nur Zahlen, Buchstaben und Sonderzeichen (._) werden unterstützt.", - "EVENTVARIABLES": "Fügt die Event-Variablen der URL hinzu", + "EVENTVARIABLES": "Wenn aktiviert, Es fügt alle Event Variablen an die Url", "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": "(RAW-JSON-Format) Wenn nicht ausgefüllt, wird der Standardwert verwendet", + "BODY": "Wenn nicht ausgefüllt, wird der Standardwert gesendet", "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 ...)", "MANAGED": "Die Gesamtzahl der abgeschlossenen Interaktionen", "OPENED": "Die Gesamtzahl der aktiven Interaktionen", - "HEADERS": "Hinweis: Der Header-Abschnitt muss im RAW-JSON-Format {\"key\": \"value\"} vorliegen. Hinweis: 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." + "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." }, "EDIT_TRUNK": "Trunk bearbeiten", - "DELETE_TRUNK": "Trunk löschen", + "DELETE_TRUNK": "Löschen Sie Trunk", "CREATED_AT": "Erstellt am", "SETTINGS": "Einstellungen", - "ADVANCED": "Erweitert", + "ADVANCED": "Erweiterte", "OTHER": "Andere", "ACTIVE": "Aktiv", "CONTEXT": "Kontext", - "CALLERID": "Anruferidentifikation (Caller-ID)", + "CALLERID": "Die Anrufer-ID", "TYPE": "Typ", - "DTMFMODE": "DTMF-Modus", + "DTMFMODE": "Mfv-Modus", "NAT": "NAT", - "QUALIFY": "Trunk überwachen (SIP-Qualify)", - "ALLOWCODECS": "Erlaubte Codecs", + "QUALIFY": "Qualifizieren", + "ALLOWCODECS": "Codecs erlaubt", "INSECURE": "Unsicher", "REGISTRY": "Registrierung", - "DIRECTMEDIA": "Direct Media", + "DIRECTMEDIA": "Direkte Medien", "CALLCOUNTER": "Anrufzähler", - "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", + "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", "ENCRYPTION": "Verschlüsselung", - "PORT": "Port", - "TRANSPORT": "Transport", + "PORT": "Hafen", + "TRANSPORT": "Verkehr", "SAVE": "Speichern", - "VARIABLES": "Variabeln", - "ADD_VARIABLE": "Variabel hinzufügen", - "EDIT_VARIABLE": "Variabel bearbeiten", - "DELETE_VARIABLE": "Variabel löschen", - "SELECTED": "Ausgewählt", - "SELECT_ALL": "Alles auswählen", - "SELECT_NONE": "Nichts auswählen", + "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\"", "TAGS": "Tags", - "ADD_TAG": "Tag hinzufügen", - "EDIT_TAG": "Tag bearbeiten", - "DELETE_TAG": "Tag löschen", + "ADD_TAG": "Variable hinzufügen", + "EDIT_TAG": "Variable bearbeiten", + "DELETE_TAG": "Variable löschen", "PAUSES": "Pausen", "ADD_PAUSE": "Pause hinzufügen", "EDIT_PAUSE": "Pause bearbeiten", "DELETE_PAUSE": "Pause löschen", - "ADD_CANNEDANSWER": "Textbaustein hinzufügen", - "EDIT_CANNEDANSWER": "Textbaustein bearbeiten", - "DELETE_CANNEDANSWER": "Textbaustein löschen", + "ADD_CANNEDANSWER": "Vordefinierte Antwort hinzufügen", + "EDIT_CANNEDANSWER": "Vordefinierte Antwort bearbeiten", + "DELETE_CANNEDANSWER": "Vordefinierte Antwort löschen", "KEY": "Schlüssel", "VALUE": "Wert", - "SOUNDS": "Audiodateien", - "EDIT_SOUND": "Audiodatei bearbeiten", - "DELETE_SOUND": "Audiodatei löschen", - "FINISH": "Beenden", - "DROP_TO_UPLOAD": "Hier hineinziehen für Upload", + "SOUNDS": "Sounds", + "EDIT_SOUND": "Ton bearbeiten", + "DELETE_SOUND": "Sound löschen", + "FINISH": "Fertig stellen", + "DROP_TO_UPLOAD": "Drop hochladen", "TRIGGERS": "Trigger", - "EDIT_TRIGGER": "Trigger bearbeiten", - "DELETE_TRIGGER": "Trigger löschen", + "EDIT_TRIGGER": "Auslöser bearbeiten", + "DELETE_TRIGGER": "Auslöser löschen", "ADD_TRIGGER": "Trigger hinzufügen", "DELETE": "Löschen", - "AUTOMATIONS": "Automation", - "EDIT_AUTOMATION": "Automation bearbeiten", + "AUTOMATIONS": "Automatisierungen", + "EDIT_AUTOMATION": "Bearbeiten einer Automation", "DELETE_AUTOMATION": "Automation löschen", "ADD_AUTOMATION": "Automation hinzufügen", - "INTERVALS": "Zeitintervalle", + "INTERVALS": "Intervalle", "EDIT_INTERVAL": "Intervall bearbeiten", - "DELETE_INTERVAL": "Intervall löschen", + "DELETE_INTERVAL": "Intervall für Löschen.", "ADD_INTERVAL": "Intervall hinzufügen", "TOOLS": "Werkzeuge", - "ID": "ID", + "ID": "Id", "AUDIO": "Audio", - "DOWNLOAD_SOUND": "Audiodatei herunterladen", - "UPLOAD_SOUND": "Audiodatei hochladen", + "DOWNLOAD_SOUND": "Download Sound", + "UPLOAD_SOUND": "Werkzeuge", "CHANNEL": "Kanal", - "NEW_TRIGGER": "Neuer Trigger", + "NEW_TRIGGER": "Neue Trigger", "GENERAL": "Allgemein", - "STATUS": "Trigger aktiv", + "STATUS": "Status", "CONDITIONS&ACTIONS": "Bedingungen und Aktionen", - "ALLCONDITIONS": "Alle Bedingungen werden erfüllt", - "ANYCONDITIONS": "Einige Bedingungen werden erfüllt", - "ACTIONS": "Aktionen", + "ALLCONDITIONS": "Alle diese Bedingungen erfüllen:", + "ANYCONDITIONS": "Treffen diese Voraussetzungen:", + "ACTIONS": "Aktionen:", "NEW_AUTOMATION": "Neue Automation", - "TIMEOUT": "Zeitüberschreitung", + "TIMEOUT": "Timeout", "PEERSTATUS": "Peer Status", - "CALL_LIMIT": "Anrufe limitieren", - "OTHERFIELDS": "Zusätzliche SIP-Felder", - "NEW_VARIABLE": "Neue Variabel", + "CALL_LIMIT": "Anrufe beschränken", + "OTHERFIELDS": "Andere Felder", + "NEW_VARIABLE": "Neue Variable", "NEW_TAG": "Neuer Tag", "NEW_PAUSE": "Neue Pause", - "NEW_CANNEDANSWER": "Neue Textvorlage", + "NEW_CANNEDANSWER": "Neue vordefinierte Antwort", "CONFIRM_PASSWORD": "Passwort bestätigen", - "NEW_TRUNK": "Neuer Trunk", - "FROM": "von", - "TO": "an", - "WEEKDAY": "Wochentag", - "MONTHDAY": "Monatstag", + "NEW_TRUNK": "Neue Leitung", + "FROM": "Von", + "TO": "Zu", + "WEEKDAY": "Woche Tag", + "MONTHDAY": "Monat Tag", "MONTH": "Monat", "ALWAYS": "Immer", "MON": "Montag", @@ -233,24 +233,24 @@ "NOV": "November", "DEC": "Dezember", "PASSWORD": "Passwort", - "CUSTOMDASHBOARDS": "Benutzerdef. Dashboards", + "CUSTOMDASHBOARDS": "Benutzerdefinierte Dashboards", "NEW_CUSTOMDASHBOARD": "Neues benutzerdefiniertes Dashboard", - "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", + "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", "SENDMAIL": "E-Mail senden", "CONFIGURATION": "Konfiguration", "MAIL": "E-Mail", "REPORTTYPE": "Berichtstyp", "REPORT": "Bericht", - "OUTPUT": "Ausgabeformat", + "OUTPUT": "Ausgang", "EXECUTEON": "Ausführung", - "REPORTRANGE": "Bereich", + "REPORTRANGE": "Berichtsbereich", "VALIDITYSTART": "Startzeit", "VALIDITYEND": "Endzeit", "EXECUTEEVERY": "Alle ausführen", @@ -261,10 +261,10 @@ "WEEKLY": "Wöchentlich", "MONTHLY": "Monatlich", "PREVIOUS_DAY": "Vorheriger Tag", - "LAST_SEVEN_DAYS": "Letzte 7 Tage", - "LAST_THIRTY_DAYS": "Letzte 30 Tage", + "LAST_SEVEN_DAYS": "Letzte sieben Tage", + "LAST_THIRTY_DAYS": "33 verbotenen letzte Tage", "LAST_MONTH": "Letzter Monat", - "WEEKDAYS": "Wochentage", + "WEEKDAYS": "Woche Tage", "HOUR": "Stunde", "DEFAULT": "Standard", "CSV": "CSV", @@ -272,7 +272,7 @@ "15MIN": "15 Minuten", "30MIN": "30 Minuten", "1H": "1 Stunde", - "VOICE": "Sprachanrufe", + "VOICE": "Voice", "CHAT": "Chat", "SMS": "SMS", "OPENCHANNEL": "Offener Kanal", @@ -283,8 +283,8 @@ "ADD_TEMPLATE": "Vorlage hinzufügen", "CONTENT": "Inhalt", "FIELD": "Feld", - "NO_ANYCONDITION_AVAILABLE": "Keine Bedingung verfügbar", - "NO_ALLCONDITION_AVAILABLE": "Keine Bedingung verfügbar", + "NO_ANYCONDITION_AVAILABLE": "Keine Bedingungen verfügbar", + "NO_ALLCONDITION_AVAILABLE": "Keine Bedingungen verfügbar", "NO_ACTION_AVAILABLE": "Keine Aktionen verfügbar", "ACTION": "Aktion", "EDIT_ANYCONDITION": "Bedingung bearbeiten", @@ -297,19 +297,19 @@ "ADD_ALLCONDITION": "Bedingung hinzufügen", "EDIT_ACTION": "Aktion bearbeiten", "DELETE_ACTION": "Aktion löschen", - "NEW_ACTION": "Neue Aktion", + "NEW_ACTION": "Neue Maßnahme", "ADD_ACTION": "Aktion hinzufügen", "QUEUE": "Warteschlange", "CALL_STATUS": "Anrufstatus", - "OUTBOUNDROUTE": "Ausgehende Routen", - "EQUALS": "ist gleich", - "NOT_EQUALS": "ist nicht gleich", - "CONTACT_MANAGER": "Kontaktmanager", + "OUTBOUNDROUTE": "Abgehende Routen", + "EQUALS": "Ist gleich", + "NOT_EQUALS": "Nicht gleich", + "CONTACT_MANAGER": "Contacts Manager", "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", @@ -318,87 +318,87 @@ "ARGUMENTS": "Argumente", "NO_APPS_AVAILABLE": "Keine Anwendungen verfügbar", "NEW_INTERVAL": "Neues Intervall", - "OPERATOR": "Operator", + "OPERATOR": "Betreiber", "NO_INTERVALS_AVAILABLE": "Keine Intervalle zur Verfügung", "YES": "Ja", - "NO": "Nein", + "NO": "Keine", "SUBJECT": "Betreff", - "NO_AVAILABLE_INFO": "Keine Informationen verfügbar", + "NO_AVAILABLE_INFO": "Keine verfügbaren Info", "BROWSER": "Browser", "INTERVAL": "Intervall", - "INFO": "Information", + "INFO": "Info", "TIME_RANGE": "Zeitbereich", - "WEEK_DAYS": "Wochentage", - "MONTH_DAYS": "Monatstage", + "WEEK_DAYS": "Woche Tage", + "MONTH_DAYS": "Monat Tage", "MONTHS": "Monate", - "DROP_TO_UPLOAD_MESSAGE": "Dateien hier hinein ziehen zum Hochladen. Unterstütze Formate: .mp3, .wav, .gsm; Max. Dateigröße: 15 MB", + "DROP_TO_UPLOAD_MESSAGE": "Sie können auch Audiodateien hier ablegen\" hochzuladen. Nur MP3-, WAV-, GSM-Max. 15 MB", "POLLING_INTERVAL": "Abfrageintervall (Sekunden)", - "DASHBOARD": "Dashboard", - "NEW_DASHBOARDITEM": "Neues Dashboard-Widget", + "DASHBOARD": "Armaturenbrett", + "NEW_DASHBOARDITEM": "Neue Dashboard Widget", "COUNTER": "Zähler", "IFRAME": "IFrame", "CLOCK": "Uhr", - "ADD_DASHBOARDITEM": "Dashboard-Widget hinzufügen", - "EDIT_WIDGET": "Widget bearbeiten", - "DELETE_WIDGET": "Widget löschen", - "FLIP_WIDGET": "Widget drehen", + "ADD_DASHBOARDITEM": "Dashboard Widget hinzufügen", + "EDIT_WIDGET": "Bearbeiten Widget", + "DELETE_WIDGET": "Löschen Widget", + "FLIP_WIDGET": "Flip Widget", "TITLE": "Titel", "UPDATE": "Aktualisieren", "LAYOUT": "Layout", "BACKGROUND_COLOR": "Hintergrundfarbe", "FOREGROUND_COLOR": "Vordergrundfarbe", - "FOREGROUND_TITLE_COLOR": "Titelfarbe", - "THEME": "Design-Thema", - "LIGHT": "Hell", + "FOREGROUND_TITLE_COLOR": "Vordergrund Titel Farbe", + "THEME": "Thema", + "LIGHT": "Licht", "DARK": "Dunkel", "TIMEZONE": "Zeitzone", - "DIGITAL_FORMAT": "Digitales Datumsformat", + "DIGITAL_FORMAT": "Digitale Datum Format", "TOOLS_QUERY": "Abfrage", - "SELECT": "Auswählen", - "WHERE": "where", + "SELECT": "Wählen Sie", + "WHERE": "Wo", "BACK": "Zurück", "PROJECT": "Projekt", - "GOTOREALTIME_TRUNK": "Direkt zum Echtzeitmonitoring für SIP-Trunks", - "GOTO_TRUNK": "Direkt zum SIP-Trunk gehen", - "CRON": "Versand", + "GOTOREALTIME_TRUNK": "In Echtzeit, Trunk gehen", + "GOTO_TRUNK": "Um die Leitungsbündel gehen", + "CRON": "Cron", "MINUTES": "Minuten", "HOURLY": "Stündlich", "YEARLY": "Jährlich", - "EVERY": "Jede(n)", + "EVERY": "Jede", "MINUTE": "Minute", - "ON_SECOND": "Zur Sekunde", - "HOUR_ON_MINUTE": "Stunde zur Minute", - "AND_SECOND": "und Sekunde", - "DAY_AT": "Am Tag", + "ON_SECOND": "Im 2.", + "HOUR_ON_MINUTE": "Stunde Minute", + "AND_SECOND": "Und 2.", + "DAY_AT": "Tag an", "START_TIME": "Startzeit", - "ON_THE": "Am", - "OF_EVERY": "An jedem", + "ON_THE": "Auf der", + "OF_EVERY": "Jedes", "MONTH_AT": "Monat", - "AT": "um", + "AT": "An", "LAST": "Letzte", "LASTUNIT": "Einheit", "MAILACCOUNT": "E-Mail Konto", - "OF": "von", - "PAST_THE_HOUR": "Minuten nach voller Stunde", + "OF": "Von", + "PAST_THE_HOUR": "Nach der vollen Stunde", "DAY": "Tag", "WEEK": "Woche", "YEAR": "Jahr", - "ON": "Am", + "ON": "Auf", "PAI": "P-Asserted-Identity", "PAGE": "Seite", "ROWSPERPAGE": "Zeilen pro Seite", - "OUTBOUND_ROUTE": "Ausgehende Routen", - "EVENTVARIABLES": "Event-Variablen", + "OUTBOUND_ROUTE": "Abgehende Routen", + "EVENTVARIABLES": "Bei Variablen", "FAX": "Fax", "INTERACTION": "Interaktion", "MESSAGE": "Nachricht", - "T38PT_UDPTL": "Redundanz, maxdatagram = 400", - "AUTOCREATECONTACT": "Automatische Kontakterstellung", + "T38PT_UDPTL": "T38 pt Udptl", + "AUTOCREATECONTACT": "Erstellen Sie automatisch", "COLOR": "Farbe", - "LOCATION": "Standort", - "NEW_TAB": "Neuer Tab", + "LOCATION": "Lage", + "NEW_TAB": "Neue Registerkarte", "NEW_WINDOW": "Neues Fenster", - "WINDOWWIDTH": "Fensterbreite (px)", + "WINDOWWIDTH": "Fenster Breite (px)", "WINDOWHEIGHT": "Fensterhöhe (px)", "EDIT_DASHBOARDITEM": "Dashboard-Widget bearbeiten", "FONTSIZE": "Schriftgröße", @@ -408,68 +408,68 @@ "FOREGROUND": "Vordergrund", "NONE": "Keiner", "TOTAL": "Gesamt", - "ABANDONED": "Abgebrochen", + "ABANDONED": "Verlassen", "WAITING": "Warten", - "TALKING": "im Gespräch", - "ANSWERED": "Beantwortet", - "UNMANAGED": "Nicht bearbeitet", + "TALKING": "Reden", + "ANSWERED": "Antwortete", + "UNMANAGED": "Nicht verwaltet", "CUSTOMTYPE": "Benutzerdefiniert [Pfad]", - "WEBREPORT": "Interner Report", + "WEBREPORT": "Webbericht", "PIECHART": "Kuchendiagramm", "MULTIBARCHART": "Multibar-Diagramm", "MOVE_WIDGET": "Widget verschieben", - "USERADD_CUSTOMDASHBOARD": "Berechtigungen hinzufügen", - "GOTODASHBOARD_CUSTOMDASHBOARD": "Vorschau Dashboard", - "GOTO_CUSTOMDASHBOARD": "Vorschau Dashboard", - "METRIC": "Metrik", - "FILTERVOICEQUEUES": "Anruf-Warteschlangen filtern", + "USERADD_CUSTOMDASHBOARD": "Hinzufügen von Benutzerberechtigungen", + "GOTODASHBOARD_CUSTOMDASHBOARD": "Gehe zum Vorschau-Dashboard", + "GOTO_CUSTOMDASHBOARD": "Gehe zum Vorschau-Dashboard", + "METRIC": "Metrisch", + "FILTERVOICEQUEUES": "Voice-Warteschlangen filtern", "SERIE1": "Serie 1", "SERIE2": "Serie 2", "SERIE3": "Serie 3", - "REFRESH": "Aktualisieren [S]", + "REFRESH": "Aktualisieren [s]", "FORMAT": "Format", "PATH": "Absoluter Pfad", "ALL_USERS": "Alle Nutzer", - "SELECTED_USERS": "Ausgewählte Nutzer", + "SELECTED_USERS": "Ausgewählte Benutzer", "ADD_WIDGET": "Widget hinzufügen", - "NEXTCONTACT": "Nächster Kontakt", + "NEXTCONTACT": "Nächster", "SENDIFEMPTY": "Senden, wenn leer", - "CANCEL": "Abbrechen", + "CANCEL": "Stornieren", "UPLOADING": "Hochladen", - "EMAILBCCADDRESS": "BCC", - "EMAILCCADDRESS": "CC", - "RUN_SCHEDULE": "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": "Globale Textbausteine", + "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", "REPORTFOLDER": "Berichtsordner", - "REPORTSUBFOLDER": "Unterordner", - "PREVIOUSCONTACT": "Vorheriger Kontakt", + "REPORTSUBFOLDER": "Unterordner melden", + "PREVIOUSCONTACT": "Bisherige", "VIDEOSUPPORT": "Video-Unterstützung", "AGENT": "Agent", "HEADERS": "Überschriften", "SCRIPT": "Skript", - "SCRIPT_INFO": "Information", + "SCRIPT_INFO": "Info", "SCRIPT_TYPE": "Art", "MOTION_TAB": "Neue Registerkarte \"Agent Dashboard\"", "WHATSAPP": "WhatsApp Connector", "AUTOCREATE_FIELD": "Feld automatisch erstellen", - "GLOBALS": "Globale Werte", + "GLOBALS": "Globals", "SEARCH_FIELDS": "Suchfelder", "STANDARD": "Standard", "MOTION_BAR": "Motion Bar", "ALL": "Alle", - "ALL_DISPOSITIONS": "Alle Qualifizierungen", - "FIRST_LEVEL_DISPOSITION": "Qualifizierung Ebene 1", - "LEVEL": "Ebene", - "SECOND_LEVEL_DISPOSITION": "Qualifizierung Ebene 2", - "SELECT_LEVEL": "Ebene auswählen", - "TITLEFONTSIZE": "Schriftgröße Titel", + "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", "ADD_CONTACTITEMTYPE": "Hinzufügen", "CONTACTITEMTYPE": "Kontaktartikeltypen", "NEW_CONTACTITEMTYPE": "Neuer Kontaktelementtyp", diff --git a/public/app/main/apps/tools/i18n/pt-BR.json b/public/app/main/apps/tools/i18n/pt-BR.json index 89475fd..60b1a08 100644 --- a/public/app/main/apps/tools/i18n/pt-BR.json +++ b/public/app/main/apps/tools/i18n/pt-BR.json @@ -1,16 +1,16 @@ { "TOOLS": { "BOT": "Voicebot", - "CLONE_TRUNK": "Clonar Tronco", + "CLONE_TRUNK": "Clonar tronco", "DISPOSITIONS": "Disposições", - "NEW_DISPOSITION": "Nova Disposição", - "ADD_DISPOSITION": "Adicionar Disposição", - "EDIT_DISPOSITION": "Editar Disposição", - "DELETE_DISPOSITION": "Excluir Disposição", + "NEW_DISPOSITION": "Nova disposição", + "ADD_DISPOSITION": "Adicionar disposição", + "EDIT_DISPOSITION": "Editar disposição", + "DELETE_DISPOSITION": "Excluir disposição", "RUN_SCHEDULE": "Horário de execução", "SENDIFEMPTY": "Enviar se vazio", "NEXTCONTACT": "Próximo", - "OUTBOUND_ROUTE": "Rota de Saída", + "OUTBOUND_ROUTE": "Rota de saída", "EDIT_DASHBOARDITEM": "Editar widget do painel", "FONTSIZE": "Tamanho da fonte", "CLONE_CUSTOMDASHBOARD": "Clonar Dashboard Personalizado", @@ -41,8 +41,8 @@ "FORMAT": "Formato", "PATH": "Caminho absoluto", "ALL_USERS": "Todos os usuários", - "SELECTED_USERS": "Usuários Selecionados", - "ADD_WIDGET": "Adicionar Widget", + "SELECTED_USERS": "Usuários selecionados", + "ADD_WIDGET": "Adicionar widget", "COLOR": "Cor", "FAX": "Fax", "INTERACTION": "Interação", @@ -164,8 +164,8 @@ "MANAGED": "O número total de interações concluídas", "OPENED": "O número total de interações ativas" }, - "EDIT_TRUNK": "Editar Tronco", - "DELETE_TRUNK": "Excluir Tronco", + "EDIT_TRUNK": "Editar tronco", + "DELETE_TRUNK": "Excluir tronco", "CREATED_AT": "Criado em", "SETTINGS": "Definições", "ADVANCED": "Avançado", @@ -180,7 +180,7 @@ "ALLOWCODECS": "Codecs permitidos", "INSECURE": "Inseguro", "REGISTRY": "Registro", - "DIRECTMEDIA": "Mídia Direta", + "DIRECTMEDIA": "Direct media", "CALLCOUNTER": "Contador de chamadas", "FROMDOMAIN": "Do domínio", "FROMUSER": "Do usuário", @@ -193,9 +193,9 @@ "TRANSPORT": "Transporte", "SAVE": "Salvar", "VARIABLES": "Variáveis", - "ADD_VARIABLE": "Adicionar Variáveis", - "EDIT_VARIABLE": "Editar Variáveis", - "DELETE_VARIABLE": "Excluir Variáveis", + "ADD_VARIABLE": "Adicionar variáveis", + "EDIT_VARIABLE": "Editar variáveis", + "DELETE_VARIABLE": "Excluir variáveis", "SELECTED": "Selecionado", "SELECT_ALL": "Selecione todos", "SELECT_NONE": "Selecione nenhum", @@ -204,59 +204,59 @@ "EDIT_TAG": "Editar Tag", "DELETE_TAG": "Excluir Tag", "PAUSES": "Pausas", - "ADD_PAUSE": "Adicionar Pausas", - "EDIT_PAUSE": "Editar Pausas", - "DELETE_PAUSE": "Excluir Pausas", - "CANNEDANSWERS": "Respostas Prontas", - "ADD_CANNEDANSWER": "Adicionar Resposta Pronta", - "EDIT_CANNEDANSWER": "Editar Resposta Pronta", - "DELETE_CANNEDANSWER": "Excluir Resposta Pronta", + "ADD_PAUSE": "Adicionar pausas", + "EDIT_PAUSE": "Editar pausas", + "DELETE_PAUSE": "Excluir pausas", + "CANNEDANSWERS": "Respostas pré-definidas", + "ADD_CANNEDANSWER": "Adicionar resposta pré-definida", + "EDIT_CANNEDANSWER": "Editar resposta pré-definida", + "DELETE_CANNEDANSWER": "Excluir resposta pré-definida", "KEY": "Key", "VALUE": "Valor", - "SOUNDS": "Sons", - "EDIT_SOUND": "Editar Som", - "DELETE_SOUND": " Ecluir Som", + "SOUNDS": "Áudios", + "EDIT_SOUND": "Editar áudio", + "DELETE_SOUND": " Ecluir áudio", "CANCEL": "Cancelar", "FINISH": "Finalizar", - "DROP_TO_UPLOAD": "Largar para fazer o upload", + "DROP_TO_UPLOAD": "Soltar para fazer o upload", "UPLOADING": "Uploading", - "TRIGGERS": "Gatilhos", - "EDIT_TRIGGER": "Editar Gatilhos", - "DELETE_TRIGGER": "Excluir Gatilhos", - "ADD_TRIGGER": "Adicionar Gatilhos", + "TRIGGERS": "Triggers", + "EDIT_TRIGGER": "Editar trigger", + "DELETE_TRIGGER": "Excluir trigger", + "ADD_TRIGGER": "Adicionar trigger", "DELETE": "Excluir", "AUTOMATIONS": "Automações", - "EDIT_AUTOMATION": "Editar Automações", - "DELETE_AUTOMATION": "Excluir Automações", - "ADD_AUTOMATION": "Adicionar Automações", + "EDIT_AUTOMATION": "Editar automações", + "DELETE_AUTOMATION": "Excluir automações", + "ADD_AUTOMATION": "Adicionar automações", "INTERVALS": "Intervalos", - "EDIT_INTERVAL": "Editar Intervalo", - "DELETE_INTERVAL": "Excluir Intervalo", - "ADD_INTERVAL": "Adicionar Intervalo", + "EDIT_INTERVAL": "Editar intervalo", + "DELETE_INTERVAL": "Excluir intervalo", + "ADD_INTERVAL": "Adicionar intervalo", "TOOLS": "Ferramentas", "ID": "Id", - "AUDIO": "Audio", - "DOWNLOAD_SOUND": "Download Som", + "AUDIO": "Áudio", + "DOWNLOAD_SOUND": "Download áudio", "UPLOAD_SOUND": "Ferramentas", "CHANNEL": "Canal", - "NEW_TRIGGER": "Novo Gatilho", + "NEW_TRIGGER": "Nova trigger", "GENERAL": "Geral", "STATUS": "Status", "CONDITIONS&ACTIONS": "Condições e ações", "ALLCONDITIONS": "Conheça todas estas condições:", "ANYCONDITIONS": "Conheça qualquer uma destas condições:", "ACTIONS": "Ações:", - "NEW_AUTOMATION": "Nova Automação", + "NEW_AUTOMATION": "Nova automação", "TIMEOUT": "Tempo esgotado", - "PEERSTATUS": "Status de par Status", + "PEERSTATUS": "Peer status", "CALL_LIMIT": "Limite de chamadas", "OTHERFIELDS": "Outros campos", - "NEW_VARIABLE": "Nova Variável", - "NEW_TAG": "Nova Tag", - "NEW_PAUSE": "Nova Pausa", - "NEW_CANNEDANSWER": "Nova Resposta Pronta", - "CONFIRM_PASSWORD": "Confirme a Senha", - "NEW_TRUNK": "Novo Tronco", + "NEW_VARIABLE": "Nova variável", + "NEW_TAG": "Nova tag", + "NEW_PAUSE": "Nova pausa", + "NEW_CANNEDANSWER": "Nova resposta pré-definida", + "CONFIRM_PASSWORD": "Confirme a senha", + "NEW_TRUNK": "Novo tronco", "FROM": "De ", "TO": "Para", "WEEKDAY": "Dia da semana", @@ -293,7 +293,7 @@ "ADD_SCHEDULE": "Adicionar Agendador", "EDIT_SCHEDULE": "Editar Agendador", "DELETE_SCHEDULE": "Excluir Agendador", - "SENDMAIL": "Enviar Email", + "SENDMAIL": "Enviar email", "CONFIGURATION": "Configuração", "MAIL": "Email", "REPORTTYPE": "Tipo de relatório", @@ -348,15 +348,15 @@ "NEW_ALLCONDITION": "Nova condição", "ADD_ALLCONDITION": "Adicionar condição", "EDIT_ACTION": "Editar Ação", - "DELETE_ACTION": "Excluir Ação", - "NEW_ACTION": "Nova Ação", - "ADD_ACTION": "Adicionar Ação", + "DELETE_ACTION": "Excluir ação", + "NEW_ACTION": "Nova ação", + "ADD_ACTION": "Adicionar ação", "QUEUE": "Fila", - "CALL_STATUS": "Status da Chamada", - "OUTBOUNDROUTE": "Rota de Saída", + "CALL_STATUS": "Status da chamada", + "OUTBOUNDROUTE": "Rota de saída", "EQUALS": "Igual a", "NOT_EQUALS": "Não é igual a", - "CONTACT_MANAGER": "Gerente de contatos", + "CONTACT_MANAGER": "Gestão Contatos", "INTEGRATIONS": "Integrações", "MOTIONBAR": "Motion Bar", "JSCRIPTY": "Jscripty", diff --git a/public/app/main/apps/voice/i18n/de.json b/public/app/main/apps/voice/i18n/de.json index 0339802..832ae56 100644 --- a/public/app/main/apps/voice/i18n/de.json +++ b/public/app/main/apps/voice/i18n/de.json @@ -1,408 +1,408 @@ { "VOICE": { - "GOTO_VOICEQUEUE": "Zur Anruf-Warteschlange gehen", - "GOTOREALTIME_VOICEQUEUE": "Direkt zur Echtzeit-Warteschlange", + "GOTO_VOICEQUEUE": "Zu Realtime Voice Warteschlangen gehen", + "GOTOREALTIME_VOICEQUEUE": "Zu Realtime Voice Warteschlangen gehen", "NAME": "Name", "LOGOUT": "An-/Abmelden", - "VOICEQUEUES": "Warteschlangen", - "SEARCH_FOR_ANYONE": "Suche", + "VOICEQUEUES": "Voice Warteschlangen", + "SEARCH_FOR_ANYONE": "Suche für Jedermann", "BACK": "Zurück", - "SELECTED": "Ausgewählt", - "SELECT_ALL": "Alles auswählen", - "SELECT_NONE": "Nichts auswählen", - "DELETE_VOICEDISPOSITION": "Qualifizierung löschen", - "EDIT_VOICEDISPOSITION": "Qualifizierung bearbeiten", - "EDIT_VOICEQUEUE": "Warteschlange bearbeiten", + "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": "Wartemusik", - "STRATEGY": "Verteilungsstrategie", + "MOHSOUNDS": "Die MOH-Sounds", + "STRATEGY": "Strategie", "DESCRIPTION": "Beschreibung", - "ADD_VOICEQUEUE": "Warteschlangen hinzufügen", + "ADD_VOICEQUEUE": "Hinzufügen von Warteschlangen", "CREATED_AT": "Erstellt am", - "CANT_PLAY_GSM_AUDIO_FILES": "GMS-Audiodateien können nicht abgespielt werden", + "CANT_PLAY_GSM_AUDIO_FILES": "Nicht gsm-Audiodateien", "APPLICATIONS_LIST": "Liste der Anwendungen", "LEGEND": { "CUSTOM_APPLICATION": "(*) - Benutzerdefinierte Anwendung." }, "ERRORS": { - "NAME_REQUIRED": "Name erforderlich", - "APPLICATION_NAME_REQUIRED": "Name der Anwendung erforderlich", - "TIMEOUT_REQUIRED": "Timeout erforderlich", - "PHONENUMBER_REQUIRED": "Telefonnummer erforderlich", - "CONTEXT_REQUIRED": "Kontext erforderlich", - "DESTINATIONPATTERN_REQUIRED": "Ziel-Pattern erforderlich", - "FULLNAME_REQUIRED": "Vollständiger Name erforderlich", - "EMAIL_REQUIRED": "E-Mail erforderlich", - "EMAIL_MUST_VALID": "Ungültiges Format E-Mail", - "MAILBOX_REQUIRED": "Mailbox erforderlich", - "PASSWORD_REQUIRED": "Passwort erforderlich", - "CONFIRM_NOT_MATCH": "Die Passwörter stimmen nicht überein", - "TIMEZONE_REQUIRED": "Zeitzone erforderlich", - "PREFIX_REQUIRED": "Präfix erforderlich", - "OPTIONS_REQUIRED": "Bedingungen Erforderlich", - "AFTERCALLWORKDURATION_REQUIRED": "Dauer Nacharbeit erforderlich", - "TECHNOLOGY/RESOURCE_REQUIRED": "Ressource erforderlich", - "PHONE_REQUIRED": "Telefonnummer erforderlich", - "VALUE_REQUIRED": "Wert erforderlich", - "EXTENSION_REQUIRED": "Nebenstelle erforderlich", - "PRIORITY_REQUIRED": "Priorität erforderlich", - "NAME_MUST_VALID_PATTERN": "Ungültiger Name Format", - "APPLICATION_REQUIRED": "Anwendung 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": "Format ungültig Anrufer-ID (alle)", - "OUTBOUNDROUTE_REQUIRED": "Ausgehende Route erforderlich", - "VARIABLE_REQUIRED": "Variabel erforderlich", - "CALLER_ID_MUST_VALID_PATTERN": "Format ungültig Anrufer-ID", - "TRUNK_REQUIRED": "SIP-Trunk erforderlich", - "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "PausenID während Qualifizierung erforderlich", - "PROJECT_REQUIRED": "Projekt erforderlich", - "PENALTY_REQUIRED": "Wert für Verzögerung erforderlich" + "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", + "CALLERIDALL_MUST_VALID_PATTERN": "Falsches Format", + "OUTBOUNDROUTE_REQUIRED": "Pflichtfeld", + "VARIABLE_REQUIRED": "Pflichtfeld", + "CALLER_ID_MUST_VALID_PATTERN": "Falsches Format", + "TRUNK_REQUIRED": "Pflichtfeld", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Pflichtfeld", + "PROJECT_REQUIRED": "Pflichtfeld", + "PENALTY_REQUIRED": "Sie müssen einen Wert für die Strafe angeben" }, "GENERAL": "Allgemein", - "TIMEOUT": "Max. Klingelzeit Nebenstelle", + "TIMEOUT": "Timeout", "MAXLENGTH": "Maximale Länge", - "RETRY": "Erneut versuchen", - "WRAPUPTIME": "Nacharbeitszeit", - "WEIGHT": "Gewichtung", - "JOINWHENEMPTY": "Beitreten, wenn leer", - "LEAVEWHENEMPTY": "Verlassen, wenn leer", + "RETRY": "Versuchen Sie es erneut", + "WRAPUPTIME": "-Zeit", + "WEIGHT": "Gewicht", + "JOINWHENEMPTY": "Melden Sie wenn sie leer sind", + "LEAVEWHENEMPTY": "Wenn sie leer lassen", "HELP": { - "TIMEOUT": "Zeitüberschreitung Klingeln (Sekunden)", - "MAXLENGTH": "Maximaler Anrufer in der Warteschlange. Wenn Wert 0, dann keine Begrenzung.", - "RETRY": "Definiert wie Lange (Sekunden) auf eine Antwort des Agenten gewartet wird, bevor der Anruf beim nächsten Agenten klingelt", - "WRAPUPTIME": "Zeit (in Sekunden), in welcher der Agent nach einem Anruf nicht verfügbar ist", - "WEIGHT": "Gewichtung der Warteschlangen untereinander, sofern die Agenten auf mehr als einer Warteschlange arbeiten", - "JOINWHENEMPTY": "Definiert, ob ein Anruf in die Warteschleife eintreten kann, wenn keine Agenten verfügbar sind", - "LEAVEWHENEMPTY": "Trennt den Anruf in der Warteschleife, sofern keine Agenten verfügbar sind", - "ANNOUNCEFREQUENCY": "Definiert, wie oft dem Anrufer die aktuelle Warteposition und/oder die erwartete Wartezeit angesagt wird. (0 zum Deaktivieren dieser Funktion)", - "MINANNOUNCEFREQUENCY": "Minimale Ansage der Warteposition/Wartezeit. Nützlich, wenn der Anrufer die Warteposition oft wechselt", - "PERIODICANNOUNCEFREQUENCY": "Intervall für sich Wiederholende Ansagen an den Anrufer", - "ANNOUNCEPOSITIONLIMIT": "Warteposition wird nur ab dem eingestellten Wert angesagt", - "AFTERCALLWORKDURATION": "Die Dauer der Nacharbeit nach einem Anruf (Sekunden)", - "MEMBERDELAY": "Verzögert die Zustellung des Anrufes an den Agenten um den eingestellten Wert (Sekunden)", - "MUSICONHOLD": "Definiert die Wartemusik innerhalb der Warteschlange", - "ANNOUNCETOAGENT": "Spielt dem Agenten eine Mitteilung über den Ursprung des Anrufes vor der Annahme", - "RANDOMPERIODICANNOUNCE": "Bei \"Ja\" werden die definierten Ansagen in einer zufälligen Reihenfolge abgespielt", - "ANNOUNCEHOLDTIME": "Definiert, ob die geschätzte Wartezeit zusätzlich zur Wartemusik abgespielt wird. (Ja/Nein/nur ein Mal)", - "ANNOUNCECALLERPOSITION": "Definiert, ob die aktuelle Warteposition des Anrufers angesagt wird. Nein = Niemals; Ja = Immer; Limit = nur wenn innerhalb des Limits für Warteposition; Mehr = wenn überhalb des Limits für Warteposition", - "REPORTHOLDTIMEAGENT": "Der Agent bekommt nach dem Annehmen und Verbinden des Anrufes die Wartezeit des Kunden angesagt", - "PERIODICANNOUNCE": "Reihenfolge der Ansagen innerhalb der Warteschlange", - "HOLDTIMEANNOUNCE": "Wählt die Audiodatei (Hochladen einer Datei im Menü \"Werkzeuge\") für die Ansage der Wartezeit. Bsp: \"Ihre geschätzte Wartezeit beträgt\" Wenn leer, wird keine Ansage abgespielt", - "YOUARENEXTANNOUNCE": "Wählt die Audiodatei (Hochladen einer Datei im Menü \"Werkzeuge\") für die Ansage der ersten Position in der Warteschlange. Bsp: \"Der nächste freie Mitarbeiter wird Ihren Anruf in Kürze entgegennehmen\" Wenn leer, wird keine Ansage abgespielt", - "THEREAREANNOUNCE": "Erster Teil der Ansage für die bereits wartenden Anrufe. Bsp: \"Vor Ihnen befinden sich noch..:\"; Wenn leer, wird keine Ansage abgespielt", - "WAITINGCALLSANNOUNCE": "Zweiter Teil der Ansage für die bereits wartenden Anrufe. Bsp: \"...Anrufe in der Warteschlange\"; Wenn leer, wird keine Ansage abgespielt", - "ESTIMATEDHOLDTIMEANNOUNCE": "Wählt die Audiodatei (Hochladen einer Datei im Menü \"Werkzeuge\") für die Ansage der geschätzten Wartezeit. Bsp: \"Ihre aktuelle Wartezeit beträgt ca....\" Wenn leer, wird keine Ansage abgespielt", - "MINUTESANNOUNCE": "Wählt die Audiodatei (Hochladen einer Datei im Menü \"Werkzeuge\") für das Wort \"Minuten\". Wenn leer, wird keine Ansage abgespielt", - "MINUTEANNOUNCE": "Wählt die Audiodatei (Hochladen einer Datei im Menü \"Werkzeuge\") für das Wort \"Minute\". Wenn leer, wird keine Ansage abgespielt", - "SECONDSANNOUNCE": "Wählt die Audiodatei (Hochladen einer Datei im Menü \"Werkzeuge\") für das Wort \"Sekunden\". Wenn leer, wird keine Ansage abgespielt", - "THANKYOUANNOUNCE": "Wählt die Audiodatei (Hochladen einer Datei im Menü \"Werkzeuge\") für eine Ansage zum Dank. Bsp: \"Vielen Dank für Ihre Geduld\" Wenn leer, wird keine Ansage abgespielt", - "AFTERCALLWORK": "Wenn aktiviert, wird der Agent nach jedem Anruf in eine zeitlich definierbare Pause zur Nacharbeit gesetzt", - "AUTOPAUSE": "Legt fest, ob der Agent in eine automatische Pause gesetzt wird, sofern dieser den aktuellen Anruf nicht innerhalb der definierten Zeit entgegennimmt. Wenn ja, wird der Agent in allen zugewiesenen Kampagnen auf Pause gesetzt. ", - "RINGINUSE": "Aktivieren/Deaktivieren der Anrufzustellung wenn der Status der Nebenstelle Besetzt 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": "Wenn aktiviert, können aufgenommene Variabeln vor einem Anruf an den Agenten weitergegeben werden. (Siehe Wiki)", - "SETQUEUEVARIABLES": "Wenn aktiviert, können aufgenommene Variabeln nach dem Verlassen der Warteschlange an den Agenten weitergegeben werden. (Siehe Wiki)", - "SETQUEUEENTRYVARIABLES": "Wenn aktiviert, können aufgenommene Variabeln beim Eintreten in die Warteschlange an den Agenten weitergegeben werden. (Siehe Wiki)", - "RECORDING": "Automatische Gesprächsaufzeichnung Aktivieren/Deaktivieren", - "VOICEMAIL_CONTEXT": "Kontext für Voicemail", + "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)", + "RECORDING": "Aktivieren der Aufzeichnung", + "VOICEMAIL_CONTEXT": "Im Rahmen der relativen Erweiterung.", "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": "Agentenstatus während der Qualifizierung eines Kontaktes", - "SERVICELEVEL": "Einstellungen für Service-Level (Standard = 0, kein SL). (Anrufe werden innerhalb des Service Level-Zeitrahmens beantwortet)", - "MONITORFORMAT": "Definiert das Dateiformat für Gesprächsaufzeichnungen. Wenn leer, findet keine Gesprächsaufzeichnung statt.", + "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 Einstellungen der Route wurden geändert. Bitte nicht vergessen, zu Speichern." }, - "MUSICONHOLD": "Wartemusik", - "ANNOUNCETOAGENT": "Ansagenachricht für Agenten", - "ANNOUNCEMENTS": "Ansagen", - "ADVANCED": "Erweitert", - "ANNOUNCEFREQUENCY": "Ansagefrequenz", - "MINANNOUNCEFREQUENCY": "Min. Frequenz Ansage", - "PERIODICANNOUNCEFREQUENCY": "Frequenz wiederkehrende Ansagen", - "RANDOMPERIODICANNOUNCE": "Zufälliges Abspielen der Ansagen", - "ANNOUNCEHOLDTIME": "Wartezeit ansagen", - "ANNOUNCECALLERPOSITION": "Warteposition ansagen", - "ANNOUNCEPOSITIONLIMIT": "Limit für Ansage Warteposition", - "REPORTHOLDTIMEAGENT": "Wartezeit dem Agenten ansagen", - "PERIODICANNOUNCE": "Wiederkehrende Ansagen", - "HOLDTIMEANNOUNCE": "Audiodatei für Ansage Wartezeit", - "YOUARENEXTANNOUNCE": "Audiodatei für Ansage der ersten Position", - "THEREAREANNOUNCE": "1. Teil Audiodatei für Ansage der bereits wartenden Anrufer", - "WAITINGCALLSANNOUNCE": "2. Teil Audiodatei für Ansage der bereits wartenden Anrufer", - "ESTIMATEDHOLDTIMEANNOUNCE": "Audiodatei für die Information zur geschätzten Wartezeit", - "MINUTESANNOUNCE": "Audiodatei für die Ansage \"Minuten\"", - "MINUTEANNOUNCE": "Audiodatei für die Ansage \"Minute\" ", - "SECONDSANNOUNCE": "Audiodatei für die Ansage \"Sekunden\"", - "THANKYOUANNOUNCE": "Audiodatei für die Ansage mit Dank für Geduld", - "AUTOPAUSE": "Automatische Pause bei keiner Antwort", - "AFTERCALLWORK": "Nacharbeit", - "AFTERCALLWORKDURATION": "Dauer Nacharbeit", - "RINGINUSE": "Klingeln bei Besetzt", - "MEMBERDELAY": "Anrufsverzögerung", - "TIMEOUTRESTART": "Zeitüberschreitung neu Starten", - "MONITORFORMAT": "Format für Gesprächsaufzeichnungen", - "SETINTERFACEVARIABLES": "Interface Variabeln definieren", - "SETQUEUEVARIABLES": "Warteschlangenvariabeln definieren", - "SETQUEUEENTRYVARIABLES": "Variabeln bei Eintritt definieren", + "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,", + "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", + "MONITORFORMAT": "Aufzeichnungsformat", + "SETINTERFACEVARIABLES": "Die Interface- Variablen", + "SETQUEUEVARIABLES": "Die Warteschlange Variablen", + "SETQUEUEENTRYVARIABLES": "Die Warteschlange ENTRY-Variablen", "VARIABLE": "Variable", - "CONTEXT": "Kontext Austritt aus Warteschlange", + "CONTEXT": "Kontext", "SAVE": "Speichern", "SETTINGS": "Einstellungen", - "INBOUNDROUTES": "Eingehende Routen", + "INBOUNDROUTES": "Ankommende Routen", "PHONENUMBER": "Telefonnummer", "ADD_INBOUNDROUTE": "Eingehende Route hinzufügen", - "EDIT_INBOUNDROUTE": "Eingehende Route bearbeiten", - "DELETE_INBOUNDROUTE": "Eingehende Route löschen", - "ACTIONS": "Routing", - "OUTBOUNDROUTES": "Ausgehende Routen", - "DESTINATIONPATTERN": "Ziel-Pattern", + "EDIT_INBOUNDROUTE": "Route für eingehende Anrufe bearbeiten.", + "DELETE_INBOUNDROUTE": "Löschen der Route für eingehende Anrufe", + "ACTIONS": "Aktionen", + "OUTBOUNDROUTES": "Abgehende Routen", + "DESTINATIONPATTERN": "Ziel Muster", "ADD_OUTBOUNDROUTE": "Ausgehende Route hinzufügen", - "EDIT_OUTBOUNDROUTE": "Ausgehende Route bearbeiten", - "DELETE_OUTBOUNDROUTE": "Ausgehende Route löschen", - "CUTDIGITS": "Ziffern abschneiden", - "RECORDING": "Aufzeichnung", + "EDIT_OUTBOUNDROUTE": "Abgehende Route bearbeiten", + "DELETE_OUTBOUNDROUTE": "Abgehende Route löschen", + "CUTDIGITS": "Die Ziffern", + "RECORDING": "Aufnahme", "RECORDINGFORMAT": "Aufzeichnungsformat", "INTERNALROUTES": "Interne Routen", - "ADD_INTERNALROUTE": "Interne Route hinzufügen", + "ADD_INTERNALROUTE": "Fügen Sie interne Routen", "EDIT_INTERNALROUTE": "Interne Route bearbeiten", - "DELETE_INTERNALROUTE": "Interne Route löschen", + "DELETE_INTERNALROUTE": "Interne Routen löschen", "CONTEXTS": "Kontexte", - "ADD_CONTEXT": "Kontext hinzufügen", + "ADD_CONTEXT": "Rahmen hinzufügen", "EDIT_CONTEXT": "Kontext bearbeiten", - "DELETE_CONTEXT": "Kontext löschen", - "VOICEMAILS": "Voicemails", - "ADD_VOICEMAIL": "Voicemail hinzufügen", - "EDIT_VOICEMAIL": "Voicemail bearbeiten", + "DELETE_CONTEXT": "Löschen von Rahmen", + "VOICEMAILS": "Von Voicemails", + "ADD_VOICEMAIL": "Fügen Sie Voicemail", + "EDIT_VOICEMAIL": "Bearbeiten von Voicemail", "DELETE_VOICEMAIL": "Voicemail löschen", - "FULLNAME": "Vollständiger Name", + "FULLNAME": "Voller Name", "EMAIL": "E-Mail", "MAILBOX": "Mailbox", "PASSWORD": "Passwort", "CONFIRM_PASSWORD": "Passwort bestätigen", "TIMEZONE": "Zeitzone", - "ATTACH": "Anhang", - "ENVELOPE": "Datum und Zeit ansagen", - "DELETE": "Datei Löschen nach E-Mailversand", + "ATTACH": "Befestigen Sie", + "ENVELOPE": "Umschlag", + "DELETE": "Löschen", "EMAILBODY": "E-Mail-Text", - "EMAILSUBJECT": "E-Mail Betreff", - "MAXSECONDS": "Max. Länge der Nachricht (Sekunden)", - "MAXMESSAGES": "Max. Nachrichten in Mailbox", + "EMAILSUBJECT": "Betreff der E-Mail", + "MAXSECONDS": "In Sekunden", + "MAXMESSAGES": "Max. Nachrichten", "MESSAGES": "Nachrichten", "SORT": "Sortieren", - "ADD_MUSICONHOLD": "Wartemusik hinzufügen", - "MUSICONHOLDS": "Wartemusik", - "EDIT_MUSICONHOLD": "Wartemusik bearbeiten", - "DELETE_MUSICONHOLD": "Wartemusik löschen", + "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", "DIRECTORY": "Verzeichnis", "AUDIOFILES": "Audiodateien", - "RECORDINGS": "Aufzeichnungen", - "CHANSPY": "Listen-In (Chanspy)", + "RECORDINGS": "Aufnahmen", + "CHANSPY": "ChanSpy", "PREFIX": "Präfix", "OPTIONS": "Optionen", - "AUTH": "Authentifizierung", - "ADD_CHANSPY": "Listen-In hinzufügen", - "EDIT_CHANSPY": "Listen-In bearbeiten", - "DELETE_CHANSPY": "Listen-In löschen", + "AUTH": "Auth", + "ADD_CHANSPY": "Fügen Sie ChanSpy", + "EDIT_CHANSPY": "Bearbeiten Sie ChanSpy", + "DELETE_CHANSPY": "Löschen Sie ChanSpy", "AGENTS": "Agenten", "TELEPHONES": "Telefone", "QUEUES": "Warteschlangen", - "QUEUE_CALLS": "Anrufe in Warteschlange", - "QUEUE_PARAMETERS": "Warteschlangen-Parameter", + "QUEUE_CALLS": "Anrufe aus einer Warteschlange", + "QUEUE_PARAMETERS": "Queue Parameter", "ABANDONED_CALLS": "Abgebrochene Anrufe", "OUTBOUND_CALLS": "Ausgehende Anrufe", "AGI": "AGI", - "DIAL": "Wählen", + "DIAL": "Kurzwahl", "CALLYSQUARE": "CallySquare", - "INTERNALDIAL": "Intern wählen", - "EXTERNALDIAL": "Extern wählen", - "RINGGROUP": "Rufgruppe", + "INTERNALDIAL": "Interne Wahl", + "EXTERNALDIAL": "Externes Wählen", + "RINGGROUP": "Ring-Gruppe", "PLAYBACK": "Wiedergabe", "QUEUE": "Warteschlange", - "SET": "Einstellen (Set)", + "SET": "Set", "VOICEMAIL": "Voicemail", "GOTO": "Gehe zu", "HANGUP": "Auflegen", - "CUSTOM": "Benutzerdefiniert", - "PROJECT": "Call-Flow Projekt", - "TECHNOLOGY/RESOURCE": "Technologie-/Ressource (Z.B. SIP/1003)", + "CUSTOM": "Benutzerdefinierte", + "PROJECT": "Cally-Square Projekt", + "TECHNOLOGY/RESOURCE": "Technologie-/Ressourcen", "URL": "URL", - "EDIT_APP": "Anwendung bearbeiten", - "EDIT_INTERVAL": "Zeitintervall bearbeiten", + "EDIT_APP": "Anwendung bearbeiten.", + "EDIT_INTERVAL": "Intervall bearbeiten", "DELETE_APP": "Anwendung löschen", - "INTERVALS": "Zeitintervalle", + "INTERVALS": "Intervalle", "USER": "Benutzer", - "TRUNK": "SIP-Trunk", + "TRUNK": "Amtsleitung", "PHONE": "Telefon", "AUDIO_FILES": "Audiodateien", - "ANNOUNCE_OVERRIDES": "Ansage überschreiben", + "ANNOUNCE_OVERRIDES": "Überschreibt ankündigen", "MACRO": "Makro", "GOSUB": "GoSub", "RULE": "Regel", "POSITION": "Position", - "ANSWER": "Antwort vom System", + "ANSWER": "Antwort", "VALUE": "Wert", "MAILBOX@CONTEXT": "Mailbox@Kontext", - "EXTENSION": "Nebenstelle", + "EXTENSION": "Erweiterung", "PRIORITY": "Priorität", - "HANGUP_CAUSE": "Auflegegrund", - "OUTBOUNDDIAL": "Ausgehend wählen", - "CALLER_ID": "Anrufer-ID", + "HANGUP_CAUSE": "Ursache auflegen", + "OUTBOUNDDIAL": "Wählen Sie für abgehende Anrufe", + "CALLER_ID": "Die Anrufer-ID", "NO_MESSAGE_AVAILABLE": "Keine Meldungen vorhanden", "NO_SOUND_AVAILABLE": "Kein Ton verfügbar", - "VOICERECORDINGS": "Sprachaufzeichnungen", - "CHANSPIES": "Listen-Ins", - "VOICE": "Anrufe", + "VOICERECORDINGS": "Sprachaufnahmen", + "CHANSPIES": "Chan Spies", + "VOICE": "Voice", "REALTIME": "Echtzeit", - "ID": "ID", + "ID": "Id", "VOICEMAIL_CONTEXT": "Kontext", "NO_MOHSOUND_AVAILABLE": "Keine Wartemusik verfügbar", "FILE": "Datei", - "ADD_MOHSOUND": "Wartemusik hinzufügen", - "DOWNLOAD_MOHSOUND": "Wartemusik herunterladen", - "DELETE_MOHSOUND": "Wartemusik löschen", + "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", "UNIQUEID": "Eindeutige ID", "AGENT": "Agent", "TYPE": "Typ", "RATING": "Bewertung", "AUDIO": "Audio", "DATE": "Datum", - "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_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_VOICEMAIL": "Neue Voicemail", - "NEW_MUSICONHOLD": "Neue Wartemusik", - "NEW_CHANSPY": "Neues 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": "Kurzwahl bearbeiten", + "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.", "EDIT_AGI": "AGI bearbeiten", - "EDIT_INTERNALDIAL": "Interne Kurzwahl bearbeiten", - "EDIT_EXTERNALDIAL": "Externe Kurzwahl 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", + "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", "DURATION": "Dauer", - "RECEIVED_AT": "Eingegangen am", + "RECEIVED_AT": "Empfangen am", "YES": "Ja", - "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)", + "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)", "HANGUPCAUSE_21": "21 = Anruf abgelehnt", - "HANGUPCAUSE_22": "22 = Nummer geändert", - "HANGUPCAUSE_27": "27 = Ziel nicht verfügbar", - "HANGUPCAUSE_38": "38 = Netzwerk nicht verfügbar", + "HANGUPCAUSE_22": "22 = Anzahl geändert", + "HANGUPCAUSE_27": "27 = Ziel nicht in Ordnung", + "HANGUPCAUSE_38": "38 = Netzwerk aus, um", "HANGUPCAUSE_41": "41 = vorübergehende Störung", - "RANDOM": "Zufall", + "RANDOM": "Random", "ALPHABETICAL": "Alphabetisch", "NO_APPS_AVAILABLE": "Keine Anwendungen verfügbar", - "DOWNLOAD_VOICERECORDING": "Sprachaufzeichnung herunterladen", - "DELETE_VOICERECORDING": "Sprachaufzeichnung löschen", - "INTERNAL": "Intern", - "PHONE_STATE": "Status Nebenstelle", - "PHONE_STATUS": "SIP-Status Nebenstelle", - "TRUNK_STATUS": "Status Trunk", + "DOWNLOAD_VOICERECORDING": "Download Voice Recording", + "DELETE_VOICERECORDING": "Löschen von Voice Recording", + "INTERNAL": "Interne", + "PHONE_STATE": "Telefonstatus", + "PHONE_STATUS": "Telefonstatus", + "TRUNK_STATUS": "Trunk Status", "REGISTERED": "Registriert", - "UNREGISTERED": "Nicht registriert", - "LAGGED": "Verzögert", + "UNREGISTERED": "Unregistrierte", + "LAGGED": "Zurück", "REACHABLE": "Erreichbar", "UNREACHABLE": "Nicht erreichbar", "UNKNOWN": "Unbekannt", - "NOT_INUSE": "Nicht in Verwendung", - "INUSE": "In Verwendung", + "NOT_INUSE": "Nicht in Gebrauch", + "INUSE": "Im Einsatz", "BUSY": "Besetzt", "INVALID": "Ungültig", "UNAVAILABLE": "Nicht verfügbar", "RINGING": "Klingeln", - "ONHOLD": "Halten", - "RING": "Klingeln", - "UP": "Status", - "INFO": "Information", - "TRUNKS": "SIP-Trunks", + "ONHOLD": "Auf Halten", + "RING": "Ring", + "UP": "Bis", + "INFO": "Info", + "TRUNKS": "Amtsleitungen", "REGISTRY": "Registrierung", - "NO_REGISTRY": "Keine Registrierung", + "NO_REGISTRY": "Keine registry", "LOGGED_IN": "Angemeldet", "PAUSED": "Angehalten", - "WAITING": "Wartezustand", - "TALKING": "Im Gespräch", - "DID": "DID", + "WAITING": "Warten", + "TALKING": "Sprechen", + "DID": "Haben", "CALLER": "Anrufer", - "TOTAL": "Gesamt", + "TOTAL": "Insgesamt", "ANSWERED": "Beantwortet", "ABANDONED": "Abgebrochen", - "UNMANAGED": "Nicht bearbeitet", - "AVG_HOLD_TIME": "Durchschnittliche Wartezeit", - "AVG_DURATION": "Durchschnittliche Dauer", - "AVG_BILLABLE": "Durchschnittliche abrechenbare Zeit", - "SOURCE": "Ursprung", + "UNMANAGED": "Nicht verwaltete", + "AVG_HOLD_TIME": "Durchschnittl. Warteschleifenzeit", + "AVG_DURATION": "Av-Dauer", + "AVG_BILLABLE": "Avg Fakturierbaren", + "SOURCE": "Quelle", "DESTINATION": "Ziel", "REJECTED": "Abgelehnt", "FAILED": "Fehlgeschlagen", - "CALLED": "Angerufen", + "CALLED": "Aufgerufen", "CONNECTED": "Verbunden", "NO_RATING": "Keine Bewertung", - "EDIT_VOICERECORDING": "Sprachaufzeichnung bearbeiten", + "EDIT_VOICERECORDING": "Edit Voice Recording", "APPLICATION_NAME": "Name der Anwendung", "ARGUMENTS": "Argumente", - "NO_AVAILABLE_INFO": "Keine Informationen verfügbar", - "ADD_AGENT_TO_QUEUE": "Agenten zur Warteschlange hinzufügen", - "DEFAULT_PAUSE": "Standard Pause", + "NO_AVAILABLE_INFO": "Keine verfügbaren Info", + "ADD_AGENT_TO_QUEUE": "Agent zur Warteschlange hinzufügen", + "DEFAULT_PAUSE": "Standard PAUSE", "PAUSE": "Pause", - "UNPAUSE": "Fortsetzen", - "REDIRECT_TO_NUMBER": "Weiterleiten an Nummer", - "REDIRECT_TO_AGENT": "Weiterleiten an Agenten", - "AGENTADD_VOICEQUEUE": "Agenten zu Warteschlange hinzufügen", + "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", "APPLICATION": "Anwendung", "FILES": "Dateien", "FORMAT": "Format", "MODE": "Modus", "RECORD": "Datensatz", - "TEAMADD_VOICEQUEUE": "Team zur Warteschlange hinzufügen", - "NEW_MOHSOUND": "Neue Wartemusik", - "DOWNLOAD_MESSAGE": "Herunterladen", + "TEAMADD_VOICEQUEUE": "Hinzufügen Team voicequeue", + "NEW_MOHSOUND": "Neue Musik auf Halten", + "DOWNLOAD_MESSAGE": "Download", "DELETE_MESSAGE": "Löschen", "QUEUE_PARAMS": "Queue Parameter", - "TOTAL_OFFERED": "Gesamt", + "TOTAL_OFFERED": "Insgesamt", "READY": "Bereit", - "AGENTADD_QUEUE": "Agenten zur Warteschlange hinzufügen", - "AGENTSADD_QUEUE": "Agenten zur Warteschlangen hinzufügen", - "ALL_TEAMS": "Alle Teams", + "AGENTADD_QUEUE": "Agent hinzufügen Warteschlangen zu Voice", + "AGENTSADD_QUEUE": "Hinzufügen von Agenten der Warteschlange an die Mailbox", + "ALL_TEAMS": "Alle Mannschaften", "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": "Wählverhalten ausgehend bearbeiten", - "ACCOUNTNAME": "Kontoname", + "EDIT_OUTBOUNDDIAL": "Bearbeiten ausgehenden DFÜ", + "ACCOUNTNAME": "Konto Name", "PAGE": "Seite", "ROWSPERPAGE": "Zeilen pro Seite", - "OF": "von", - "DISPOSITION": "Qualifizierung", + "OF": "Von", + "DISPOSITION": "Disposition", "WAITING_FOR_AGENTS": "Warten auf Agenten", "CHAT": "Chat", "MAIL": "E-Mail", @@ -410,72 +410,72 @@ "OPENCHANNEL": "Offener Kanal", "FAX": "Fax", "NO_AGENT_ONLINE": "Kein Agent Online", - "PARTIALPAUSE": "Teilpause", + "PARTIALPAUSE": "Teilweise Pause", "STATUS": "Status", "TIMER": "Timer", "ALL": "Alle", "IDLE": "Leerlauf", - "EDIT_TRUNK": "Trunk bearbeiten", + "EDIT_TRUNK": "Bearbeiten Trunk", "ACTIVE": "Aktiv", - "CLEAR": "Leeren", + "CLEAR": "klar", "CALLS": "Anrufe", - "STARTEDAT": "Startdatum", - "ENDEDAT": "Enddatum", - "TAG": "Tag", - "DETAILS": "Details", + "STARTEDAT": "Fing an bei", + "ENDEDAT": "Beendet bei", + "TAG": "Etikett", + "DETAILS": "Einzelheiten", "BILLABLESECONDS": "Abrechenbare Sekunden", - "ANSWEREDAT": "Beantwortet am", - "NOTE": "Notiz", + "ANSWEREDAT": "Beantwortet bei", + "NOTE": "Hinweis", "CLOSE": "Schließen", - "SELECT_DATE": "Startdatum auswählen", - "SELECT_TYPE": "Typ auswählen", - "ABANDONEDCALLS": "Abgebrochene Anrufe", + "SELECT_DATE": "Wählen Sie Startdatum", + "SELECT_TYPE": "Art auswählen", + "ABANDONEDCALLS": "Verlassene Warteschlangenanrufe", "ADD_VOICEPREFIX": "Präfix hinzufügen", - "AGENTADD_VOICEPREFIX": "Agentenpräfix hinzufügen", + "AGENTADD_VOICEPREFIX": "Fügen Sie Agent zu Präfix hinzu", "DELETE_VOICEPREFIX": "Präfix löschen", "EDIT_VOICEPREFIX": "Präfix bearbeiten", "NEW_VOICEPREFIX": "Neues Präfix", - "VOICEPREFIXES": "Präfixe für Sprachanrufe", + "VOICEPREFIXES": "Vorgegebene Präfixe", "CALLERIDALL": "Anruferidentifikation", "OUTBOUNDROUTE": "Ausgehende Route", - "LOGIN_TIME": "Zeit angemeldet", - "PAUSE_TIME": "Zeit in Pause", + "LOGIN_TIME": "Login-Zeit", + "PAUSE_TIME": "Pausenzeit", "DIALER": "Dialer", - "INBOUND": "Eingehend", + "INBOUND": "Eingehende", "OUTBOUND": "Ausgehend", - "MANDATORYDISPOSITION": "Qualifikation erforderlich", - "MANDATORYDISPOSITIONPAUSEID": "PausenID bei erforderlicher Qualifizierung", - "TEAMS_ASSOCIATION": "Teamzuweisung", + "MANDATORYDISPOSITION": "Zwingende Disposition", + "MANDATORYDISPOSITIONPAUSEID": "Status der obligatorischen Dispositionspause", + "TEAMS_ASSOCIATION": "Vereinigung der Mannschaften", "CANT_DOWNLOAD_THIS_FILE": "Diese Datei kann nicht heruntergeladen werden", "FILE_NOT_FOUND": "Datei nicht gefunden", "SCREENRECORDING": "Bildschirmaufzeichnung verwalten", - "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", + "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", "DOWNLOADTRANSCRIBE_VOICERECORDING": "Transkript herunterladen", "FAILUREREASON": "Fehlergrund", - "RUNSENTIMENT_VOICERECORDING": "Starten Sprachaufzeichnung inkl. Sentiment", - "RUNTRANSCRIBESENTIMENT_VOICERECORDING": "Transkription und Sentinemtaufzeichnung starten", - "RUNTRANSCRIBE_VOICERECORDING": "Transkription starten", - "SENTIMENT": "Sentiment", - "SENTIMENTANALYSIS": "Sentiment-Analyse", + "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", "SENTIMENT_MIXED": "Gemischt", "SENTIMENT_NEGATIVE": "Negativ", "SENTIMENT_NEUTRAL": "Neutral", "SENTIMENT_POSITIVE": "Positiv", "TEXT": "Text", "TRANSCRIBE": "Transkribieren", - "TRANSCRIBESTATUS_COMPLETED": "Transkription abgeschlossen", - "TRANSCRIBESTATUS_FAILED": "Transkription fehlgeschlagen", + "TRANSCRIBESTATUS_COMPLETED": "Abgeschlossen", + "TRANSCRIBESTATUS_FAILED": "Gescheitert", "TRANSCRIBESTATUS_IN_PROGRESS": "In Bearbeitung", "TRANSCRIBESTATUS_NEW": "Neu", "TRANSCRIPT": "Transkript", "TRANSCRIPTANALYSIS": "Transkript & Analyse", "SERVICELEVEL": "Service Level", - "SECOND_LEVEL_DISPOSITION": "Qualifizierung 2. Ebene", - "THIRD_LEVEL_DISPOSITION": "Qualifizierung 3. Ebene", + "SECOND_LEVEL_DISPOSITION": "Disposition der zweiten Ebene", + "THIRD_LEVEL_DISPOSITION": "Disposition der dritten Ebene", "TEAMADD_VOICEPREFIX": "Team zum Präfix hinzufügen", "ALIAS": "Alias", "MAXCAPACITY": "Max. Kapazität erreicht", diff --git a/public/app/main/apps/voice/i18n/pt-BR.json b/public/app/main/apps/voice/i18n/pt-BR.json index 91c94ea..9a6a538 100644 --- a/public/app/main/apps/voice/i18n/pt-BR.json +++ b/public/app/main/apps/voice/i18n/pt-BR.json @@ -11,7 +11,7 @@ "TIMER": "Cronômetro", "ALL": "Todos", "IDLE": "Ocioso", - "EDIT_TRUNK": "Editar Tronco", + "EDIT_TRUNK": "Editar tronco", "GOTO_VOICEQUEUE": "Ir para filas de voz em tempo real", "GOTOREALTIME_VOICEQUEUE": "Ir para filas de voz em tempo real", "NAME": "Nome", @@ -262,7 +262,7 @@ "TRUNK": "Tronco", "PHONE": "Telefone", "AUDIO_FILES": "Arquivos de áudio", - "ANNOUNCE_OVERRIDES": "Anunciar Substituto", + "ANNOUNCE_OVERRIDES": "Anuncio substituto", "MACRO": "Macro", "GOSUB": "GoSub", "RULE": "Regra", @@ -332,12 +332,12 @@ "RANDOM": "Aleatória", "ALPHABETICAL": "Alfabético", "NO_APPS_AVAILABLE": "Não há aplicativos disponíveis", - "DOWNLOAD_VOICERECORDING": "Download Gravação de Voz", + "DOWNLOAD_VOICERECORDING": "Download gravação de voz", "DELETE_VOICERECORDING": "Excluir gravação de voz", "INTERNAL": "Interno", "PHONE_STATE": "Estado do telefone", "PHONE_STATUS": "Status do telefone", - "TRUNK_STATUS": "Status do Tronco", + "TRUNK_STATUS": "Status do tronco", "REGISTERED": "Registrado", "UNREGISTERED": "Não registrado", "LAGGED": "Atrasado", @@ -352,7 +352,7 @@ "RINGING": "Tocando", "ONHOLD": "Em espera", "RING": "Tocar", - "UP": "Cima", + "UP": "Up", "INFO": "Informação", "TRUNKS": "Troncos", "REGISTRY": "Registro", @@ -378,11 +378,11 @@ "CONNECTED": "Conectado", "NO_RATING": "Sem avaliação", "EDIT_VOICERECORDING": "Editar gravação de voz", - "APPLICATION_NAME": "Nome da Aplicação", + "APPLICATION_NAME": "Nome da aplicação", "ARGUMENTS": "Argumentos", "NO_AVAILABLE_INFO": "Nenhuma informação disponível", "ADD_AGENT_TO_QUEUE": "Adicionar agente à fila", - "DEFAULT_PAUSE": "PAUSA PADRÃO", + "DEFAULT_PAUSE": "Pausa Padrão", "PAUSE": "Pausa", "UNPAUSE": "Fim Pausa", "REDIRECT_TO_NUMBER": "Redirecionar para número", @@ -403,16 +403,16 @@ "AGENTADD_QUEUE": "Adicionar agente à fila de voz", "AGENTSADD_QUEUE": "Adicionar agentes à fila de voz", "ALL_TEAMS": "Todas as equipes", - "SELECTED_TEAMS": "Equipes Selecionadas", + "SELECTED_TEAMS": "Equipes selecionadas", "ALL_AGENTS": "Todos os agentes", - "SELECTED_AGENTS": "Agentes Selecionados", + "SELECTED_AGENTS": "Agentes selecionados", "CLOSING": "Fechamento", "TAGS": "Tags", - "WAITING_FOR_AGENT": "Aguardando Agentes", + "WAITING_FOR_AGENT": "Aguardando agentes", "EDIT_OUTBOUNDDIAL": "Editar discagem de saída", "ACCOUNTNAME": "Nome da conta", "PAGE": "Página", - "ROWSPERPAGE": "Linhas por Página", + "ROWSPERPAGE": "Linhas por página", "OF": "do", "DISPOSITION": "Disposição", "CHAT": "Chat", @@ -456,7 +456,7 @@ "WRONG_EXTENSION": "O arquivo apresenta a extensão incorreta", "DOWNLOADTRANSCRIBE_VOICERECORDING": "Baixar transcrição", "FAILUREREASON": "Razão da falha", - "RUNSENTIMENT_VOICERECORDING": "Executar Sentiment", + "RUNSENTIMENT_VOICERECORDING": "Executar sentimento", "RUNTRANSCRIBESENTIMENT_VOICERECORDING": "Executar transcrição e sentimento", "RUNTRANSCRIBE_VOICERECORDING": "Executar a transcrição", "SENTIMENT": "Sentimento", @@ -474,7 +474,7 @@ "TRANSCRIPT": "Transcrição", "TRANSCRIPTANALYSIS": "Transcrição e Análise", "SERVICELEVEL": "Nível de serviço", - "SECOND_LEVEL_DISPOSITION": "Disposição de Segundo Nível", + "SECOND_LEVEL_DISPOSITION": "Disposição de segundo Nível", "THIRD_LEVEL_DISPOSITION": "Disposição de terceiro nível", "TEAMADD_VOICEPREFIX": "Adicionar equipe ao prefixo", "ALIAS": "Pseudônimo", diff --git a/public/app/main/apps/whatsapp/i18n/de.json b/public/app/main/apps/whatsapp/i18n/de.json index be4500b..978ed15 100644 --- a/public/app/main/apps/whatsapp/i18n/de.json +++ b/public/app/main/apps/whatsapp/i18n/de.json @@ -1,245 +1,245 @@ { "WHATSAPP": { "ERRORS": { - "ACCESSKEYID_REQUIRED": "Zugangsschlüssel erforderlich", - "ACCOUNTSID_REQUIRED": "Konto-ID erforderlich", - "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung Transfer muss größer oder gleich sein als", - "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung Transfer muss kleiner oder gleich sein als", - "AGENTTRANSFERTIMEOUT_REQUIRED": "Zeitüberschreitung erforderlich", - "AGENT_REQUIRED": "Agent erforderlich", - "AGENT_TIMEOUT_REQUIRED": "Zeitüberschreitung Agent erforderlich", - "AUTHTOKEN_REQUIRED": "Token für Authentifizierung erforderlich", - "BOTNAME_REQUIRED": "BOT-Name erforderlich", - "COMMAND_REQUIRED": "Eingabe erforderlich", - "CONDITION_REQUIRED": "Bedingung erforderlich", - "DESCRIPTION_REQUIRED": "Beschreibung erforderlich", - "DISPOSITION_REQUIRED": "Qualifizierung erforderlich", - "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Priorität bei Bedingung nicht erfüllt muss größer oder gleich sein als", - "FALSEPRIORITY_REQUIRED": "Priorität bei nicht zutreffender Bedingung erforderlich", - "KEY_MAX_LENGTH": "Wert darf nicht länger als {{max}} Zeichen sein", - "KEY_REQUIRED": "Schlüssel erforderlich", - "LANGUAGE_REQUIRED": "Sprache erforderlich", - "LEXREGION_REQUIRED": "Lex-Region erforderlich", - "LIST_REQUIRED": "Liste erforderlich", - "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "PausenID während Qualifizierung erforderlich", - "NAME_REQUIRED": "Name erforderlich", - "PHONE_REQUIRED": "Telefonnummer erforderlich", - "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", - "PRIORITY_REQUIRED": "Priorität erforderlich", - "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung Warteschlangentransfer muss größer oder gleich sein als", - "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung Warteschlangentransfer muss kleiner oder gleich sein als", - "QUEUETRANSFERTIMEOUT_REQUIRED": "Zeitüberschreitung erforderlich", - "QUEUE_REQUIRED": "Warteschlange erforderlich", - "SECRETACCESSKEY_REQUIRED": "Geheimer Zugangsschlüssel erforderlich", - "TAG_REQUIRED": "Tag erforderlich", - "TEXT_REQUIRED": "Text erforderlich", - "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung muss größer oder gleich sein als", - "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung muss kleiner oder gleich sein als", - "TIMEOUT_REQUIRED": "Zeitüberschreitung erforderlich", - "TIMES_REQUIRED": "Zeiten erforderlich", - "TOKEN_REQUIRED": "Token erforderlich", - "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Priorität bei Bedingung erfüllt muss größer oder gleich sein als", - "TRUEPRIORITY_REQUIRED": "Priorität bei zutreffender Bedingung erforderlich", - "TYPE_REQUIRED": "Typ erforderlich", - "VALUE_REQUIRED": "Wert erforderlich", - "VARIABLE_REQUIRED": "Variabel erforderlich", - "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": "Auf zugewiesenen Agenten warten erforderlich", - "WELCOMEMESSAGE_MAX_LENGTH": "Text darf nicht länger als {{max}} Zeichen sein", - "WELCOMEMESSAGE_REQUIRED": "Willkommensnachricht erforderlich", - "CLIENTEMAIL_REQUIRED": "Kunden E-Mail erforderlich", - "PRIVATEKEY_REQUIRED": "Privater Schlüssel erforderlich", - "PROJECTID_REQUIRED": "Projekt-ID erforderlich", + "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_REQUIRED": "Pflichtfeld", + "AGENT_REQUIRED": "Pflichtfeld", + "AGENT_TIMEOUT_REQUIRED": "Pflichtfeld", + "AUTHTOKEN_REQUIRED": "Pflichtfeld", + "BOTNAME_REQUIRED": "Pflichtfeld", + "COMMAND_REQUIRED": "Pflichtfeld", + "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_REQUIRED": "Pflichtfeld", + "KEY_MAX_LENGTH": "Der Wert muss eine maximale Länge von {{max}} haben", + "KEY_REQUIRED": "Pflichtfeld", + "LANGUAGE_REQUIRED": "Pflichtfeld", + "LEXREGION_REQUIRED": "Pflichtfeld", + "LIST_REQUIRED": "Pflichtfeld", + "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_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_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_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_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_REQUIRED": "Pflichtfeld", + "WELCOMEMESSAGE_MAX_LENGTH": "Der Wert muss eine maximale Länge von {{max}} haben", + "WELCOMEMESSAGE_REQUIRED": "Pflichtfeld", + "CLIENTEMAIL_REQUIRED": "Pflichtfeld", + "PRIVATEKEY_REQUIRED": "Pflichtfeld", + "PROJECTID_REQUIRED": "Pflichtfeld", "BASEURL_REQUIRED": "Base_URL erforderlich" }, "HELP": { - "LIST": "Liste für die Zuordnung von Kontakten", - "MANDATORYDISPOSITION": "Qualifizierung erforderlich", - "MANDATORYDISPOSITIONPAUSEID": "PausenID bei erforderlicher Qualifizierung", + "LIST": "Kontaktmanagerliste zum Zuordnen von Kontakten", + "MANDATORYDISPOSITION": "Obligatorische Disposition", + "MANDATORYDISPOSITIONPAUSEID": "Pause, um zu verwenden, wenn die obligatorische Disposition aktiviert ist", "MOTIONPROXY": "Das Feld muss das folgende Format haben: : // [: ]. Beispiel: https: //X.Y.Z.W", - "NAME": "Es werden nur Zahlen, Buchstaben und Sonderzeichen (._) unterstützt", + "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": "Erste Nachricht bei eintreffen einer neuen Interaktion" + "WELCOMEMESSAGE": "Dies ist die erste Antwortnachricht, die an neue Interaktionen gesendet wird" }, - "ACCESSKEYID": "Access-Key ID", - "ACCOUNTSID": "Konto-ID", - "ACTIONS": "Routing", + "ACCESSKEYID": "Zugriffsschlüssel-ID", + "ACCOUNTSID": "Konto-SID", + "ACTIONS": "Aktionen", "ADD_NOTE": "Notiz hinzufügen", - "ADD_WHATSAPPACCOUNT": "WhatsApp-Konto hinzufügen", - "ADD_WHATSAPPCANNEDANSWER": "WhatsApp Textvorlage hinzufügen", - "ADD_WHATSAPPDISPOSITION": "WhatsApp Qualifizierung hinzufügen", + "ADD_WHATSAPPACCOUNT": "Hinzufügen", + "ADD_WHATSAPPCANNEDANSWER": "Vordefinierte Antwort hinzufügen", + "ADD_WHATSAPPDISPOSITION": "WhatsApp Disposition hinzufügen", "ADD_WHATSAPPQUEUE": "WhatsApp-Warteschlange hinzufügen", - "ADVANCED": "Erweitert", + "ADVANCED": "Fortgeschrittene", "AGENT": "Agent", - "AGENTADD_QUEUE": "Agenten zur Warteschlange hinzufügen", - "AGENTADD_WHATSAPPACCOUNT": "Agenten zum WhatsApp-Konto hinzufügen", - "AGENTADD_WHATSAPPQUEUE": "Agenten zur Warteschlange hinzufügen", + "AGENTADD_QUEUE": "Agent zur WhatsApp-Warteschlange hinzufügen", + "AGENTADD_WHATSAPPACCOUNT": "Agent zum WhatsApp-Konto hinzufügen", + "AGENTADD_WHATSAPPQUEUE": "Agent zur WhatsApp-Warteschlange hinzufügen", "AGENTS": "Agenten", - "AGENTSADD_QUEUE": "Agenten zur Warteschlange hinzufügen", - "AGENTTRANSFER": "Transfer an Agenten erlauben", - "AGENTTRANSFERTIMEOUT": "Zeitüberschreitung Agententransfer", - "AGENT_TIMEOUT": "Zeitüberschreitung Agent", + "AGENTSADD_QUEUE": "Hinzufügen von Agenten zur WhatsApp-Warteschlange", + "AGENTTRANSFER": "Agententransfer", + "AGENTTRANSFERTIMEOUT": "Zeitüberschreitung bei der Agentenübertragung", + "AGENT_TIMEOUT": "Agent Timeout", "ALL": "Alles", "ALL_AGENTS": "Alle Agenten", "ALL_TEAMS": "Alle Teams", "AMAZONLEX": "AmazonLex", - "AUTHTOKEN": "Authentifizierungs-Token", + "AUTHTOKEN": "Auth Token", "AUTOREPLY": "Automatische Antwort", "BACK": "Zurück", - "BOTNAME": "BOT-Name", + "BOTNAME": "Bot Name", "BUSY": "Beschäftigt", - "CANNEDANSWERS": "Textvorlagen", - "CANNED_ANSWER_NOT_FOUND": "Keine Textvorlagen gefunden", - "CANNED_ANSWER_SEARCH": "Nach Textvorlagen suchen", + "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", "CAPACITY": "Kapazität", "CLOSE": "Schließen", "CLOSED": "Geschlossen", "CLOSEMETHOD": "Methode schließen", "CLOSEURL": "URL schließen", - "COMMAND": "Eingabe", + "COMMAND": "Befehl", "CONDITION": "Bedingung", "CONTACT": "Kontakt", - "CREATED_AT": "Erstellt am", - "DEFAULT_PAUSE": "Standardpause", + "CREATED_AT": "Hergestellt in", + "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": "Textvorlage löschen", - "DELETE_WHATSAPPDISPOSITION": "Qualifizierung löschen", + "DELETE_WHATSAPPCANNEDANSWER": "Vordefinierte Antwort löschen", + "DELETE_WHATSAPPDISPOSITION": "WhatsApp-Disposition löschen", "DELETE_WHATSAPPQUEUE": "WhatsApp-Warteschlange löschen", "DESCRIPTION": "Beschreibung", - "DIALOGFLOW": "Google DialogFlow", - "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", + "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", "EDIT_AUTOREPLY": "Automatische Antwort bearbeiten", - "EDIT_CLOSE": "Bearbeitung abschließen", - "EDIT_DIALOGFLOW": "DialogFlow-Konfiguration bearbeiten", - "EDIT_GOTOIF": "Bedingung bearbeiten und Priorität zuweisen", - "EDIT_GOTOP": "\"GeheZu\" bearbeiten", - "EDIT_NOOP": "Log-Erstellung bearbeiten", + "EDIT_CLOSE": "Bearbeiten Schließen", + "EDIT_DIALOGFLOW": "Bearbeiten Sie die DialogFlow-Konfiguration", + "EDIT_GOTOIF": "Bearbeiten Sie Gotoif", + "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": "Textvorlage bearbeiten", - "EDIT_WHATSAPPDISPOSITION": "Whatsapp-Qualifizierung bearbeiten", - "EDIT_WHATSAPPQUEUE": "Whatsapp Warteschlange bearbeiten", - "FALSEPRIORITY": "Priorität, wenn nicht erfüllt (false)", - "GENERAL": "Allgemein", - "GOTOIF": "GeheZuWenn (GoToIf)", - "GOTOP": "Priorität zuweisen (GoToP)", - "GOTOREALTIME_WHATSAPPQUEUE": "Direkt zur Echtzeit-Warteschlange", - "GO_TO_WHATSAPPACCOUNTS": "Direkt zum WhatsApp-Konto", - "ID": "ID", + "EDIT_WHATSAPPCANNEDANSWER": "Vordefinierte Antwort bearbeiten", + "EDIT_WHATSAPPDISPOSITION": "WhatsApp-Disposition bearbeiten", + "EDIT_WHATSAPPQUEUE": "Bearbeiten Sie die WhatsApp-Warteschlange", + "FALSEPRIORITY": "Falsche Priorität", + "GENERAL": "Allgemeines", + "GOTOIF": "Gotoif", + "GOTOP": "Zum Seitenanfang", + "GOTOREALTIME_WHATSAPPQUEUE": "Wechseln Sie zur WhatsApp-Warteschlange in Echtzeit", + "GO_TO_WHATSAPPACCOUNTS": "Gehe zu Konto", + "ID": "Ich würde", "IDLE": "Leerlauf", "INSERT_MESSAGE_HERE": "Nachricht hier einfügen", "INTERACTIONS": "Interaktionen", - "INTERACTIONS_WHATSAPPACCOUNT": "Zu den Interaktionen gehen", + "INTERACTIONS_WHATSAPPACCOUNT": "Gehen Sie zu Interaktionen", "KEY": "Schlüssel", "LANGUAGE": "Sprache", "LASTMESSAGE": "Letzte Nachricht", - "LEXREGION": "LexRegion", - "LIST": "Liste", - "LOGGED_IN": "Angemeldet", - "LOGIN_TIME": "Zeit angemeldet", - "LOGOUT": "Abgemeldet", - "MANDATORYDISPOSITION": "Qualifizierung erforderlich", - "MANDATORYDISPOSITIONPAUSEID": "PausenID während Qualifizierung", + "LEXREGION": "Region", + "LIST": "Aufführen", + "LOGGED_IN": "Eingeloggt (SIP verbunden)", + "LOGIN_TIME": "Anmeldezeit", + "LOGOUT": "Ausloggen", + "MANDATORYDISPOSITION": "Obligatorische Disposition", + "MANDATORYDISPOSITIONPAUSEID": "Pause, um zu verwenden, wenn die obligatorische Disposition aktiviert ist", "MORE": "Mehr", - "MOTIONPROXY": "Proxy", + "MOTIONPROXY": "Proxy- oder Bewegungsdomäne", "MULTI_SELECT_TOGGLE": "Mehrfachauswahl umschalten", "NAME": "Name", "NEW_WHATSAPPACCOUNT": "Neues WhatsApp-Konto", - "NEW_WHATSAPPCANNEDANSWER": "Neue WhatsApp-Textvorlage", - "NEW_WHATSAPPDISPOSITION": "Neue WhatsApp-Qualifizierung", + "NEW_WHATSAPPCANNEDANSWER": "Neue vordefinierte WhatsApp-Antwort", + "NEW_WHATSAPPDISPOSITION": "Neue WhatsApp-Disposition", "NEW_WHATSAPPQUEUE": "Neue WhatsApp-Warteschlange", - "NOOP": "Log erstellen (NoOp)", - "NOTE": "Anmerkung", + "NOOP": "Noop", + "NOTE": "Hinweis", "NOTIFICATION": "Benachrichtigung", - "NOTIFICATIONSHAKE": "Schütteln", - "NOTIFICATIONSOUND": "Sound abspielen", + "NOTIFICATIONSHAKE": "Shake", + "NOTIFICATIONSOUND": "Klang", "NOTIFICATIONTEMPLATE": "Vorlage", "NO_AGENT_ONLINE": "Kein Agent online", - "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_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_WHATSAPP_ACCOUNTS_AVAILABLE": "Keine WhatsApp-Konten verfügbar", "OF": "von", "OPENED": "Geöffnet", "PAGE": "Seite", "PARTIALPAUSE": "Teilpause", "PAUSE": "Pause", - "PAUSED": "in Pause", - "PAUSE_TIME": "Zeit in Pause", + "PAUSED": "Pause", + "PAUSE_TIME": "Pausenzeit", "PHONE": "Telefon", "PRIORITY": "Priorität", "PROXY": "Proxy", "QUEUE": "Warteschlange", "QUEUES": "Warteschlangen", - "QUEUETRANSFER": "Transfer an Warteschlange erlauben", - "QUEUETRANSFERTIMEOUT": "Zeitüberschreitung für Warteschlangentransfer", + "QUEUETRANSFER": "Warteschlangenübertragung", + "QUEUETRANSFERTIMEOUT": "Zeitüberschreitung bei der Warteschlangenübertragung", "READY": "Bereit", "REALTIME": "Echtzeit", - "RECEIVEURL": "URL für Erhalt", + "RECEIVEURL": "URL erhalten", "REFRESH_INTERACTIONS": "Interaktionen aktualisieren", - "REMOTE": "Remote", + "REMOTE": "Fernbedienung", "ROWSPERPAGE": "Zeilen pro Seite", - "SAVE": "Speichern", - "SCREENRECORDING": "Bildschirmaufzeichnung", + "SAVE": "sparen", + "SCREENRECORDING": "Bildschirmaufzeichnung verwalten", "SEARCH_FOR_ANYONE": "Suche", - "SECRETACCESSKEY": "Geheimer Schlüssel", + "SECRETACCESSKEY": "Zugriffsschlüsselgeheimnis", "SELECTED": "Ausgewählt", "SELECTED_AGENTS": "Ausgewählte Agenten", "SELECTED_TEAMS": "Ausgewählte Teams", - "SELECT_ALL": "Alles auswählen", - "SELECT_NONE": "Nichts auswählen", + "SELECT_ALL": "Wählen Sie Alle", + "SELECT_NONE": "Nichts ausgewählt", "SEND": "Senden", - "SETTINGS": "Einstellungen", - "SPYINTERACTION": "Anzeigen", - "STARTEDAT": "Startdatum", - "START_SCREENRECORDING": "Bildschirmaufzeichnung starten", + "SETTINGS": "die Einstellungen", + "SPYINTERACTION": "Spionage-Interaktion", + "STARTEDAT": "Fing an bei", + "START_SCREENRECORDING": "Bildschirmaufnahme starten", "STATUS": "Status", "STOP_SCREENRECORDING": "Bildschirmaufzeichnung stoppen", - "STRATEGY": "Verteilungsstrategie", + "STRATEGY": "Strategie", "SYSTEM": "System", - "TAG": "Tag", - "TAGS": "Tags", + "TAG": "Etikett", + "TAGS": "Stichworte", "TEAMADD_WHATSAPPQUEUE": "Team zur WhatsApp-Warteschlange hinzufügen", - "TEAMS_ASSOCIATION": "Teamzuweisung", + "TEAMS_ASSOCIATION": "Mannschaftsverband", "TEXT": "Text", - "TIMEOUT": "Zeitüberschreitung", + "TIMEOUT": "Auszeit", "TIMER": "Timer", - "TIMES": "Zeiten", - "TO": "an", - "TOKEN": "Token", - "TOOLTIP_SCREENRECORDING_OFF": "Bildschirmaufzeichnung verfügbar", - "TOOLTIP_SCREENRECORDING_ON": "Bildschirmaufzeichnung läuft", - "TRANSFER": "Weiterleiten", - "TRUEPRIORITY": "Priorität, wenn erfüllt (true)", - "TYPE": "Typ", - "UNPAUSE": "Pause abbrechen", + "TIMES": "Mal", + "TO": "Zu", + "TOKEN": "Zeichen", + "TOOLTIP_SCREENRECORDING_OFF": "Bildschirmaufnahme verfügbar", + "TOOLTIP_SCREENRECORDING_ON": "Bildschirmaufnahme läuft", + "TRANSFER": "Transfer", + "TRUEPRIORITY": "Wahre Priorität", + "TYPE": "Art", + "UNPAUSE": "Pause beenden", "VALUE": "Wert", - "VARIABLE": "Variabel", - "WAITFORTHEASSIGNEDAGENT": "Auf zugewiesenen Agenten warten", + "VARIABLE": "Variable", + "WAITFORTHEASSIGNEDAGENT": "Warten Sie auf den zugewiesenen Agenten", "WAITING": "Warten", "WELCOMEMESSAGE": "Willkommensnachricht", "WHATSAPP": "WhatsApp Connector", "WHATSAPPACCOUNTS": "WhatsApp-Konten", - "WHATSAPPCANNEDANSWERS": "WhatsApp-Textvorlagen", - "WHATSAPPDISPOSITIONS": "WhatsApp-Qualifizierungen", + "WHATSAPPCANNEDANSWERS": "WhatsApp vordefinierte Antworten", + "WHATSAPPDISPOSITIONS": "WhatsApp Dispositionen", "WHATSAPPQUEUES": "WhatsApp-Warteschlangen", - "CLIENTEMAIL": "Kunden E-Mail", + "CLIENTEMAIL": "Kunden-E-Mail", "DIALOGFLOWV2": "Dialogflow V2", "EDIT_DIALOGFLOWV2": "Dialogflow V2 bearbeiten", - "PRIVATEKEY": "Privater Schlüssel", + "PRIVATEKEY": "Privat Schlüssel", "PROJECTID": "Projekt-ID", "BASEURL": "Base_URL", "DELIVERYREPORTURL": "URL für Erhalt" diff --git a/public/app/main/apps/whatsapp/i18n/pt-BR.json b/public/app/main/apps/whatsapp/i18n/pt-BR.json index 97549f4..8d833e7 100644 --- a/public/app/main/apps/whatsapp/i18n/pt-BR.json +++ b/public/app/main/apps/whatsapp/i18n/pt-BR.json @@ -1,60 +1,60 @@ { "WHATSAPP": { "ERRORS": { - "ACCESSKEYID_REQUIRED": "Campo Obrigatório", - "ACCOUNTSID_REQUIRED": "Campo Obrigatório", + "ACCESSKEYID_REQUIRED": "Campo obrigatório", + "ACCOUNTSID_REQUIRED": "Campo obrigatório", "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "O valor deve ser maior ou igual a", "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "O valor deve ser menor ou igual a", - "AGENTTRANSFERTIMEOUT_REQUIRED": "Campo Obrigatório", - "AGENT_REQUIRED": "Campo Obrigatório", - "AGENT_TIMEOUT_REQUIRED": "Campo Obrigatório", - "AUTHTOKEN_REQUIRED": "Campo Obrigatório", - "BOTNAME_REQUIRED": "Campo Obrigatório", - "COMMAND_REQUIRED": "Campo Obrigatório", - "CONDITION_REQUIRED": "Campo Obrigatório", - "DESCRIPTION_REQUIRED": "Campo Obrigatório", - "DISPOSITION_REQUIRED": "Campo Obrigatório", + "AGENTTRANSFERTIMEOUT_REQUIRED": "Campo obrigatório", + "AGENT_REQUIRED": "Campo obrigatório", + "AGENT_TIMEOUT_REQUIRED": "Campo obrigatório", + "AUTHTOKEN_REQUIRED": "Campo obrigatório", + "BOTNAME_REQUIRED": "Campo obrigatório", + "COMMAND_REQUIRED": "Campo obrigatório", + "CONDITION_REQUIRED": "Campo obrigatório", + "DESCRIPTION_REQUIRED": "Campo obrigatório", + "DISPOSITION_REQUIRED": "Campo obrigatório", "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "O valor deve ser maior ou igual a", - "FALSEPRIORITY_REQUIRED": "Campo Obrigatório", + "FALSEPRIORITY_REQUIRED": "Campo obrigatório", "KEY_MAX_LENGTH": "O valor deve ter um comprimento máximo igual a {{max}}", - "KEY_REQUIRED": "Campo Obrigatório", - "LANGUAGE_REQUIRED": "Campo Mandtório", - "LEXREGION_REQUIRED": "Campo Obrigatório", - "LIST_REQUIRED": "Campo Obrigatório", - "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Campo Obrigatório", - "NAME_REQUIRED": "Campo Obrigatório", - "PHONE_REQUIRED": "Campo Obrigatório", + "KEY_REQUIRED": "Campo obrigatório", + "LANGUAGE_REQUIRED": "Campo obrigatório", + "LEXREGION_REQUIRED": "Campo obrigatório", + "LIST_REQUIRED": "Campo obrigatório", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Campo obrigatório", + "NAME_REQUIRED": "Campo obrigatório", + "PHONE_REQUIRED": "Campo obrigatório", "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "O valor deve ser maior ou igual a", - "PRIORITY_REQUIRED": "Campo Obrigatório", + "PRIORITY_REQUIRED": "Campo obrigatório", "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "O valor deve ser maior ou igual a", "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "O valor deve ser menor ou igual a", - "QUEUETRANSFERTIMEOUT_REQUIRED": "Campo Obrigatório", - "QUEUE_REQUIRED": "Campo Obrigatório", - "SECRETACCESSKEY_REQUIRED": "Campo Obrigatório", - "TAG_REQUIRED": "Campo Obrigatório", - "TEXT_REQUIRED": "Campo Obrigatório", + "QUEUETRANSFERTIMEOUT_REQUIRED": "Campo obrigatório", + "QUEUE_REQUIRED": "Campo obrigatório", + "SECRETACCESSKEY_REQUIRED": "Campo obrigatório", + "TAG_REQUIRED": "Campo obrigatório", + "TEXT_REQUIRED": "Campo obrigatório", "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "O valor deve ser maior ou igual a", "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "O valor deve ser menor ou igual a", - "TIMEOUT_REQUIRED": "Campo Obrigatório", - "TIMES_REQUIRED": "Campo Obrigatório", - "TOKEN_REQUIRED": "Campo Obrigatório", + "TIMEOUT_REQUIRED": "Campo obrigatório", + "TIMES_REQUIRED": "Campo obrigatório", + "TOKEN_REQUIRED": "Campo obrigatório", "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "O valor deve ser maior ou igual a", - "TRUEPRIORITY_REQUIRED": "Campo Obrigatório", - "TYPE_REQUIRED": "Campo Obrigatório", - "VALUE_REQUIRED": "Campo Obrigatório", - "VARIABLE_REQUIRED": "Campo Obrigatório", + "TRUEPRIORITY_REQUIRED": "Campo obrigatório", + "TYPE_REQUIRED": "Campo obrigatório", + "VALUE_REQUIRED": "Campo obrigatório", + "VARIABLE_REQUIRED": "Campo obrigatório", "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "O valor deve ser maior ou igual a", "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "O valor deve ser menor ou igual a", - "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Campo Obrigatório", + "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Campo obrigatório", "WELCOMEMESSAGE_MAX_LENGTH": "O valor deve ter um comprimento máximo igual a {{max}}", - "WELCOMEMESSAGE_REQUIRED": "Campo Obrigatório", - "CLIENTEMAIL_REQUIRED": "Campo Obrigatório", - "PRIVATEKEY_REQUIRED": "Campo Obrigatório", - "PROJECTID_REQUIRED": "Campo Obrigatório", + "WELCOMEMESSAGE_REQUIRED": "Campo obrigatório", + "CLIENTEMAIL_REQUIRED": "Campo obrigatório", + "PRIVATEKEY_REQUIRED": "Campo obrigatório", + "PROJECTID_REQUIRED": "Campo obrigatório", "BASEURL_REQUIRED": "Campo Obrigatório" }, "HELP": { - "LIST": "Lista do gerenciador de contatos usada para associar contatos", + "LIST": "Lista do Gestão de Contatos usada para associar contatos", "MANDATORYDISPOSITION": "Disposição obrigatória", "MANDATORYDISPOSITIONPAUSEID": "Faça uma pausa para usar quando a disposição obrigatória estiver habilitada", "MOTIONPROXY": "O campo deve ter o seguinte formato: : // [: ]. Exemplo: https: //X.Y.Z.W", @@ -89,19 +89,19 @@ "BACK": "Costas", "BOTNAME": "Nome do bot", "BUSY": "Ocupado", - "CANNEDANSWERS": "Respostas enlatadas", - "CANNED_ANSWER_NOT_FOUND": "Nenhuma resposta automática foi encontrada", - "CANNED_ANSWER_SEARCH": "Insira um texto para pesquisar uma resposta automática", + "CANNEDANSWERS": "Respostas pré-definidas", + "CANNED_ANSWER_NOT_FOUND": "Nenhuma resposta pré-definidas foi encontrada", + "CANNED_ANSWER_SEARCH": "Insira um texto para pesquisar uma resposta pré-definidas", "CAPACITY": "Capacidade", "CLOSE": "Perto", "CLOSED": "Fechadas", "CLOSEMETHOD": "Método Fechar", "CLOSEURL": "Fechar URL", "COMMAND": "Comando", - "CONDITION": "Doença", + "CONDITION": "Condição", "CONTACT": "Contato", "CREATED_AT": "Criado em", - "DEFAULT_PAUSE": "PAUSA PADRÃO", + "DEFAULT_PAUSE": "Pausa pafrão", "DELETE": "Excluir", "DELETE_INTERACTION": "Excluir interação", "DELETE_SELECTED": "Excluir selecionado", @@ -113,32 +113,32 @@ "DIALOGFLOW": "DialogFlow", "DISPOSITION": "Disposição", "DISPOSITIONS": "Disposições", - "DOWNLOAD_INTERACTION": "Baixar", - "DOWNLOAD_WITHOUT_ATTACHMENTS": "Baixar sem anexos", - "DOWNLOAD_WITH_ATTACHMENTS": "Baixar com anexos", - "EDIT_AGENT": "Editar Agente", - "EDIT_AMAZONLEX": "Editar configuração Lex", + "DOWNLOAD_INTERACTION": "Download", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download sem anexos", + "DOWNLOAD_WITH_ATTACHMENTS": "Download com anexos", + "EDIT_AGENT": "Editar agente", + "EDIT_AMAZONLEX": "Editar configuração AmazonLex", "EDIT_AUTOREPLY": "Editar resposta automática", - "EDIT_CLOSE": "Editar Fechar", + "EDIT_CLOSE": "Editar encerramento", "EDIT_DIALOGFLOW": "Editar configuração do DialogFlow", "EDIT_GOTOIF": "Editar Gotoif", "EDIT_GOTOP": "Editar Gotop", "EDIT_NOOP": "Editar Noop", "EDIT_QUEUE": "Editar fila", - "EDIT_SYSTEM": "Editar Sistema", - "EDIT_TAG": "Editar etiqueta", + "EDIT_SYSTEM": "Editar sistema", + "EDIT_TAG": "Editar TAG", "EDIT_WHATSAPPACCOUNT": "Editar conta WhatsApp", "EDIT_WHATSAPPCANNEDANSWER": "Editar", "EDIT_WHATSAPPDISPOSITION": "Editar disposição do WhatsApp", "EDIT_WHATSAPPQUEUE": "Editar fila de WhatsApp", - "FALSEPRIORITY": "Falsa Prioridade", + "FALSEPRIORITY": "Falsa prioridade", "GENERAL": "Geral", "GOTOIF": "Gotoif", "GOTOP": "Seja o melhor", "GOTOREALTIME_WHATSAPPQUEUE": "Vá para a fila de WhatsApp em tempo real", "GO_TO_WHATSAPPACCOUNTS": "Ir para a conta", - "ID": "Eu iria", - "IDLE": "Ocioso", + "ID": "Id", + "IDLE": "Disponível", "INSERT_MESSAGE_HERE": "Insira a mensagem aqui", "INTERACTIONS": "Interações", "INTERACTIONS_WHATSAPPACCOUNT": "Vá para Interações", @@ -148,16 +148,16 @@ "LEXREGION": "Região", "LIST": "Lista", "LOGGED_IN": "Conectado (SIP conectado)", - "LOGIN_TIME": "Hora de Login", + "LOGIN_TIME": "Hora de login", "LOGOUT": "Sair", - "MANDATORYDISPOSITION": "Disposição Obrigatória", + "MANDATORYDISPOSITION": "Disposição obrigatória", "MANDATORYDISPOSITIONPAUSEID": "Faça uma pausa para usar quando a disposição obrigatória estiver habilitada", "MORE": "Mais", - "MOTIONPROXY": "Domínio de proxy ou movimento", + "MOTIONPROXY": "Motion Proxy", "MULTI_SELECT_TOGGLE": "Alternância de seleção múltipla", "NAME": "Nome", "NEW_WHATSAPPACCOUNT": "Nova conta WhatsApp", - "NEW_WHATSAPPCANNEDANSWER": "Nova resposta predeterminada do WhatsApp", + "NEW_WHATSAPPCANNEDANSWER": "Nova resposta pré-definidas do WhatsApp", "NEW_WHATSAPPDISPOSITION": "Nova disposição do WhatsApp", "NEW_WHATSAPPQUEUE": "Nova fila de WhatsApp", "NOOP": "Noop", @@ -197,13 +197,13 @@ "SEARCH_FOR_ANYONE": "Procurar", "SECRETACCESSKEY": "Chave secreta de acesso", "SELECTED": "Selecionado", - "SELECTED_AGENTS": "Agentes Selecionados", - "SELECTED_TEAMS": "Times Selecionados", + "SELECTED_AGENTS": "Agentes selecionados", + "SELECTED_TEAMS": "Equipes selecionados", "SELECT_ALL": "Selecionar tudo", "SELECT_NONE": "Selecione nenhum", "SEND": "Enviar", "SETTINGS": "Configurações", - "SPYINTERACTION": "Interação de espião", + "SPYINTERACTION": "Espionar interação", "STARTEDAT": "Começou às", "START_SCREENRECORDING": "Iniciar gravação de tela", "STATUS": "Status", @@ -233,9 +233,9 @@ "WELCOMEMESSAGE": "Mensagem de boas-vindas", "WHATSAPP": "Conector WhatsApp", "WHATSAPPACCOUNTS": "Contas WhatsApp", - "WHATSAPPCANNEDANSWERS": "Respostas predeterminadas do WhatsApp", - "WHATSAPPDISPOSITIONS": "Dispositivos do WhatsApp", - "WHATSAPPQUEUES": "WhatsApp Queues", + "WHATSAPPCANNEDANSWERS": "Respostas pré-definidas do WhatsApp", + "WHATSAPPDISPOSITIONS": "Disposições do WhatsApp", + "WHATSAPPQUEUES": "WhatsApp Filas", "CLIENTEMAIL": "Email do cliente", "DIALOGFLOWV2": "Dialogflow V2", "EDIT_DIALOGFLOWV2": "Editar Dialogflow V2", diff --git a/public/app/quick-panel/i18n/pt-BR.json b/public/app/quick-panel/i18n/pt-BR.json index 477aad5..c7b067f 100644 --- a/public/app/quick-panel/i18n/pt-BR.json +++ b/public/app/quick-panel/i18n/pt-BR.json @@ -35,7 +35,7 @@ "NOVEMBER": "Novembro", "DECEMBER": "Dezembro", "CHAT": "CHAT", - "ACTIVITY": "ATIVIDADE", + "ACTIVITY": "Atividade", "FRIENDS": "Amigos", "APP_SERVERS": "Servidores de Aplicativos", "USER_STATS": "Estatísticas do usuário", @@ -43,14 +43,14 @@ "NOTES": "Notas", "QUICK_SETTINGS": "Configurações rápidas", "NOTIFICATIONS": "Notificações", - "CLOUD_SYNC": "Sincronizar Nuvem", - "RETRO_THRUSTERS": "Retro Propulsores", + "CLOUD_SYNC": "Sincronizar nuvem", + "RETRO_THRUSTERS": "Retro propulsores", "RECENT": "Recente", "START_NEW_CHAT": "Começar novo Chat", "BACK": "Voltar", "CALL": "Chamada", "MORE": "Mais", - "SEND_MESSAGE": "Enviar Mensagem", + "SEND_MESSAGE": "Enviar mensagem", "REPLY_PLACEHOLDER": "Digite e aperte enter para enviar mensagem", "CONTACT_XCALLY_MOTION_SUPPORT": "Entre em contato com xCALLY Motion Support", "EXPIRATION_DATE": "Data de validade", @@ -67,7 +67,7 @@ "MESSENGER_DISABLED": "A mensagem interna está desativada para este agente!", "WARNING": "Aviso", "ERRORS": { - "NAME_REQUIRED": "Campo Obrigatório" + "NAME_REQUIRED": "Campo obrigatório" } } } diff --git a/public/app/toolbar/i18n/pt-BR.json b/public/app/toolbar/i18n/pt-BR.json index c33884e..5ce0d41 100644 --- a/public/app/toolbar/i18n/pt-BR.json +++ b/public/app/toolbar/i18n/pt-BR.json @@ -22,7 +22,7 @@ "TRANSFER": "Transferir", "TARGET": "Objetivo", "CANCEL": "Cancelar", - "FILENAME": "Nome do Arquivo", + "FILENAME": "Nome do arquivo", "STATUS": "Status", "ACTIONS": "Ações", "SPEAKER": "Alto-falante", @@ -70,10 +70,10 @@ "PERSIAN": "Persa", "LATVIAN": "Latvian", "POLISH": "Polonês", - "LOGIN_TIME": "Hora do Login", + "LOGIN_TIME": "Hora do login", "PAUSE_TIME": "Tempo de pausa", "PREVIEW": "Visualizar", - "CONFIRM_PASSWORD": "Confirme a Senha", + "CONFIRM_PASSWORD": "Confirme a senha", "NEW_PASSWORD": "Nova senha", "OLD_PASSWORD": "Senha antiga", "SAVE": "Salvar", diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 6be2369..47d3873 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 _0x3f59=['integration','motionbar','jscripty','urlForward','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','urlForward[body]','exports','VIRTUAL','getDataValue','action','STRING','contactManager'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x3f59,0x12a));var _0x93f5=function(_0x310e1c,_0x5dadc5){_0x310e1c=_0x310e1c-0x0;var _0x248f99=_0x3f59[_0x310e1c];return _0x248f99;};'use strict';var Sequelize=require('sequelize');module[_0x93f5('0x0')]={'name':{'type':Sequelize[_0x93f5('0x1')],'get':function(_0x60f814){return this[_0x93f5('0x2')](_0x93f5('0x3'));}},'action':{'type':Sequelize[_0x93f5('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x93f5('0x5'),_0x93f5('0x6'),_0x93f5('0x7'),_0x93f5('0x8'),_0x93f5('0x9'),_0x93f5('0xa'),'bot',_0x93f5('0xb')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x93f5('0xc')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x93f5('0xd')},'data2':{'type':Sequelize[_0x93f5('0x4')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x93f5('0x4')](0x1000),'comment':_0x93f5('0xe')},'data4':{'type':Sequelize[_0x93f5('0x4')](0x1000),'comments':_0x93f5('0xf')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x93f5('0x10')},'data6':{'type':Sequelize[_0x93f5('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x93f5('0x11')],'comments':_0x93f5('0x12')}}; \ No newline at end of file +var _0xf6be=['sequelize','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT'];(function(_0xeb57c0,_0x362132){var _0x4bdc15=function(_0x2e94fa){while(--_0x2e94fa){_0xeb57c0['push'](_0xeb57c0['shift']());}};_0x4bdc15(++_0x362132);}(_0xf6be,0x80));var _0xef6b=function(_0x131e60,_0x5352ce){_0x131e60=_0x131e60-0x0;var _0x4bc497=_0xf6be[_0x131e60];return _0x4bc497;};'use strict';var Sequelize=require(_0xef6b('0x0'));module['exports']={'name':{'type':Sequelize[_0xef6b('0x1')],'get':function(_0x5c8ccb){return this[_0xef6b('0x2')](_0xef6b('0x3'));}},'action':{'type':Sequelize[_0xef6b('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xef6b('0x5'),_0xef6b('0x6'),_0xef6b('0x7'),_0xef6b('0x8'),'urlForward',_0xef6b('0x9'),'bot',_0xef6b('0xa')]],'msg':_0xef6b('0xb')}},'comment':_0xef6b('0xb')},'data1':{'type':Sequelize[_0xef6b('0x4')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0xef6b('0x4')](0x1000),'comment':_0xef6b('0xc')},'data3':{'type':Sequelize[_0xef6b('0x4')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0xef6b('0xd')},'data5':{'type':Sequelize[_0xef6b('0x4')](0x1000),'comments':_0xef6b('0xe')},'data6':{'type':Sequelize[_0xef6b('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0xef6b('0xf')],'comments':'urlForward[body]'}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 4a4c6a6..3f0d93f 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 _0x3bd0=['then','destroy','sendStatus','error','name','send','update','body','Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','count','Content-Range','save'];(function(_0x3f2fbe,_0x4ac149){var _0x17ce20=function(_0x32506c){while(--_0x32506c){_0x3f2fbe['push'](_0x3f2fbe['shift']());}};_0x17ce20(++_0x4ac149);}(_0x3bd0,0x102));var _0x03bd=function(_0x48c03c,_0x3a0d41){_0x48c03c=_0x48c03c-0x0;var _0x33b898=_0x3bd0[_0x48c03c];return _0x33b898;};'use strict';var emlformat=require(_0x03bd('0x0'));var rimraf=require(_0x03bd('0x1'));var zipdir=require(_0x03bd('0x2'));var jsonpatch=require(_0x03bd('0x3'));var rp=require(_0x03bd('0x4'));var moment=require(_0x03bd('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x03bd('0x6'));var util=require(_0x03bd('0x7'));var path=require(_0x03bd('0x8'));var sox=require(_0x03bd('0x9'));var csv=require(_0x03bd('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x03bd('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x03bd('0xc'));var deskjs=require(_0x03bd('0xd'));var toCsv=require(_0x03bd('0xa'));var querystring=require('querystring');var Papa=require(_0x03bd('0xe'));var Redis=require('ioredis');var authService=require(_0x03bd('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x03bd('0x10'));var hardwareService=require(_0x03bd('0x11'));var logger=require(_0x03bd('0x12'))('api');var utils=require(_0x03bd('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x03bd('0x14'));var db=require(_0x03bd('0x15'))['db'];function respondWithStatusCode(_0x45e827,_0x439d29){_0x439d29=_0x439d29||0xcc;return function(_0x5a3c3d){if(_0x5a3c3d){return _0x45e827['sendStatus'](_0x439d29);}return _0x45e827[_0x03bd('0x16')](_0x439d29)[_0x03bd('0x17')]();};}function respondWithResult(_0x1e1d34,_0x2503bb){_0x2503bb=_0x2503bb||0xc8;return function(_0x3383b2){if(_0x3383b2){return _0x1e1d34[_0x03bd('0x16')](_0x2503bb)[_0x03bd('0x18')](_0x3383b2);}};}function respondWithFilteredResult(_0x44cfcc,_0x3eb5f0){return function(_0x30e580){if(_0x30e580){var _0x816b6=typeof _0x3eb5f0[_0x03bd('0x19')]==='undefined'&&typeof _0x3eb5f0['limit']==='undefined';var _0x50d502=_0x30e580[_0x03bd('0x1a')];var _0x5a9cf0=_0x816b6?0x0:_0x3eb5f0['offset'];var _0x250e11=_0x816b6?_0x30e580['count']:_0x3eb5f0[_0x03bd('0x19')]+_0x3eb5f0['limit'];var _0x215caa;if(_0x250e11>=_0x50d502){_0x250e11=_0x50d502;_0x215caa=0xc8;}else{_0x215caa=0xce;}_0x44cfcc[_0x03bd('0x16')](_0x215caa);return _0x44cfcc['set'](_0x03bd('0x1b'),_0x5a9cf0+'-'+_0x250e11+'/'+_0x50d502)[_0x03bd('0x18')](_0x30e580);}return null;};}function patchUpdates(_0x299f4b){return function(_0xcb91fd){try{jsonpatch['apply'](_0xcb91fd,_0x299f4b,!![]);}catch(_0x20359d){return BPromise['reject'](_0x20359d);}return _0xcb91fd[_0x03bd('0x1c')]();};}function saveUpdates(_0x1d4278,_0x144ad5){return function(_0x10ed2a){if(_0x10ed2a){return _0x10ed2a['update'](_0x1d4278)[_0x03bd('0x1d')](function(_0x1f4ce6){return _0x1f4ce6;});}return null;};}function removeEntity(_0x4a6043,_0x19f1c7){return function(_0x154760){if(_0x154760){return _0x154760[_0x03bd('0x1e')]()[_0x03bd('0x1d')](function(){_0x4a6043[_0x03bd('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0xda63a7,_0x4eeebd){return function(_0xf74e25){if(!_0xf74e25){_0xda63a7[_0x03bd('0x1f')](0x194);}return _0xf74e25;};}function handleError(_0x5a9d1d,_0x5231a1){_0x5231a1=_0x5231a1||0x1f4;return function(_0x1b90a9){logger[_0x03bd('0x20')](_0x1b90a9['stack']);if(_0x1b90a9[_0x03bd('0x21')]){delete _0x1b90a9['name'];}_0x5a9d1d['status'](_0x5231a1)[_0x03bd('0x22')](_0x1b90a9);};}exports[_0x03bd('0x23')]=function(_0x534ab7,_0x526e50){if(_0x534ab7[_0x03bd('0x24')]['id']){delete _0x534ab7[_0x03bd('0x24')]['id'];}return db[_0x03bd('0x25')][_0x03bd('0x26')]({'where':{'id':_0x534ab7[_0x03bd('0x27')]['id']}})[_0x03bd('0x1d')](handleEntityNotFound(_0x526e50,null))[_0x03bd('0x1d')](saveUpdates(_0x534ab7['body'],null))[_0x03bd('0x1d')](respondWithResult(_0x526e50,null))[_0x03bd('0x28')](handleError(_0x526e50,null));};exports[_0x03bd('0x1e')]=function(_0x23f87e,_0x449bb2){return db[_0x03bd('0x25')][_0x03bd('0x26')]({'where':{'id':_0x23f87e[_0x03bd('0x27')]['id']}})['then'](handleEntityNotFound(_0x449bb2,null))[_0x03bd('0x1d')](removeEntity(_0x449bb2,null))[_0x03bd('0x28')](handleError(_0x449bb2,null));}; \ No newline at end of file +var _0x4e9c=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','end','sendStatus','error','name','Action','find','params','body','catch','destroy','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0x17a647,_0x2bbe12){var _0x219a38=function(_0x131c5d){while(--_0x131c5d){_0x17a647['push'](_0x17a647['shift']());}};_0x219a38(++_0x2bbe12);}(_0x4e9c,0xc8));var _0xc4e9=function(_0x5780b8,_0xb6f7f0){_0x5780b8=_0x5780b8-0x0;var _0x2b958a=_0x4e9c[_0x5780b8];return _0x2b958a;};'use strict';var emlformat=require(_0xc4e9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc4e9('0x1'));var jsonpatch=require(_0xc4e9('0x2'));var rp=require(_0xc4e9('0x3'));var moment=require(_0xc4e9('0x4'));var BPromise=require(_0xc4e9('0x5'));var Mustache=require(_0xc4e9('0x6'));var util=require(_0xc4e9('0x7'));var path=require(_0xc4e9('0x8'));var sox=require(_0xc4e9('0x9'));var csv=require(_0xc4e9('0xa'));var ejs=require(_0xc4e9('0xb'));var fs=require('fs');var fs_extra=require(_0xc4e9('0xc'));var _=require(_0xc4e9('0xd'));var squel=require(_0xc4e9('0xe'));var crypto=require(_0xc4e9('0xf'));var jsforce=require(_0xc4e9('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xc4e9('0xa'));var querystring=require(_0xc4e9('0x11'));var Papa=require(_0xc4e9('0x12'));var Redis=require(_0xc4e9('0x13'));var authService=require(_0xc4e9('0x14'));var qs=require(_0xc4e9('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc4e9('0x16'));var logger=require(_0xc4e9('0x17'))('api');var utils=require(_0xc4e9('0x18'));var config=require(_0xc4e9('0x19'));var licenseUtil=require(_0xc4e9('0x1a'));var db=require(_0xc4e9('0x1b'))['db'];function respondWithStatusCode(_0x165ec1,_0x1b3201){_0x1b3201=_0x1b3201||0xcc;return function(_0x5742a1){if(_0x5742a1){return _0x165ec1['sendStatus'](_0x1b3201);}return _0x165ec1[_0xc4e9('0x1c')](_0x1b3201)['end']();};}function respondWithResult(_0x57d911,_0x33c8a3){_0x33c8a3=_0x33c8a3||0xc8;return function(_0x1c64c6){if(_0x1c64c6){return _0x57d911[_0xc4e9('0x1c')](_0x33c8a3)[_0xc4e9('0x1d')](_0x1c64c6);}};}function respondWithFilteredResult(_0x3ba59d,_0x8b7a0f){return function(_0x209666){if(_0x209666){var _0x493c62=typeof _0x8b7a0f['offset']===_0xc4e9('0x1e')&&typeof _0x8b7a0f[_0xc4e9('0x1f')]===_0xc4e9('0x1e');var _0x214ae8=_0x209666[_0xc4e9('0x20')];var _0x13398f=_0x493c62?0x0:_0x8b7a0f[_0xc4e9('0x21')];var _0x5ee4b2=_0x493c62?_0x209666[_0xc4e9('0x20')]:_0x8b7a0f['offset']+_0x8b7a0f[_0xc4e9('0x1f')];var _0x3467e5;if(_0x5ee4b2>=_0x214ae8){_0x5ee4b2=_0x214ae8;_0x3467e5=0xc8;}else{_0x3467e5=0xce;}_0x3ba59d[_0xc4e9('0x1c')](_0x3467e5);return _0x3ba59d[_0xc4e9('0x22')](_0xc4e9('0x23'),_0x13398f+'-'+_0x5ee4b2+'/'+_0x214ae8)[_0xc4e9('0x1d')](_0x209666);}return null;};}function patchUpdates(_0x1ee750){return function(_0x47b184){try{jsonpatch[_0xc4e9('0x24')](_0x47b184,_0x1ee750,!![]);}catch(_0x282119){return BPromise[_0xc4e9('0x25')](_0x282119);}return _0x47b184[_0xc4e9('0x26')]();};}function saveUpdates(_0x4e61f6,_0x44001d){return function(_0x5d7e21){if(_0x5d7e21){return _0x5d7e21[_0xc4e9('0x27')](_0x4e61f6)[_0xc4e9('0x28')](function(_0x1e9798){return _0x1e9798;});}return null;};}function removeEntity(_0x41c61b,_0x592905){return function(_0x6c2bb4){if(_0x6c2bb4){return _0x6c2bb4['destroy']()[_0xc4e9('0x28')](function(){_0x41c61b['status'](0xcc)[_0xc4e9('0x29')]();});}};}function handleEntityNotFound(_0x212f67,_0x535641){return function(_0x28b918){if(!_0x28b918){_0x212f67[_0xc4e9('0x2a')](0x194);}return _0x28b918;};}function handleError(_0x3b15e5,_0x408239){_0x408239=_0x408239||0x1f4;return function(_0x5c9b6a){logger[_0xc4e9('0x2b')](_0x5c9b6a['stack']);if(_0x5c9b6a[_0xc4e9('0x2c')]){delete _0x5c9b6a[_0xc4e9('0x2c')];}_0x3b15e5['status'](_0x408239)['send'](_0x5c9b6a);};}exports['update']=function(_0xbcd942,_0x2b66cc){if(_0xbcd942['body']['id']){delete _0xbcd942['body']['id'];}return db[_0xc4e9('0x2d')][_0xc4e9('0x2e')]({'where':{'id':_0xbcd942[_0xc4e9('0x2f')]['id']}})[_0xc4e9('0x28')](handleEntityNotFound(_0x2b66cc,null))['then'](saveUpdates(_0xbcd942[_0xc4e9('0x30')],null))[_0xc4e9('0x28')](respondWithResult(_0x2b66cc,null))[_0xc4e9('0x31')](handleError(_0x2b66cc,null));};exports[_0xc4e9('0x32')]=function(_0x3e3023,_0x3708be){return db[_0xc4e9('0x2d')][_0xc4e9('0x2e')]({'where':{'id':_0x3e3023[_0xc4e9('0x2f')]['id']}})[_0xc4e9('0x28')](handleEntityNotFound(_0x3708be,null))[_0xc4e9('0x28')](removeEntity(_0x3708be,null))[_0xc4e9('0x31')](handleError(_0x3708be,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 1105ced..553e81b 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 _0x5293=['../../config/logger','moment','path','../../config/environment','./action.attributes','exports','util'];(function(_0x232c13,_0x2103e6){var _0x31227d=function(_0x43a997){while(--_0x43a997){_0x232c13['push'](_0x232c13['shift']());}};_0x31227d(++_0x2103e6);}(_0x5293,0x110));var _0x3529=function(_0x3cb3ca,_0x44d697){_0x3cb3ca=_0x3cb3ca-0x0;var _0x214366=_0x5293[_0x3cb3ca];return _0x214366;};'use strict';var _=require('lodash');var util=require(_0x3529('0x0'));var logger=require(_0x3529('0x1'))('api');var moment=require(_0x3529('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3529('0x3'));var rimraf=require('rimraf');var config=require(_0x3529('0x4'));var attributes=require(_0x3529('0x5'));module[_0x3529('0x6')]=function(_0xfa6dc0,_0x470387){return _0xfa6dc0['define']('Action',attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3093=['define','Action','tools_actions','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports'];(function(_0xa38f77,_0x583280){var _0x4ca09b=function(_0x4735fb){while(--_0x4735fb){_0xa38f77['push'](_0xa38f77['shift']());}};_0x4ca09b(++_0x583280);}(_0x3093,0x183));var _0x3309=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x3093[_0x6131cd];return _0x47e916;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3309('0x0'))('api');var moment=require(_0x3309('0x1'));var BPromise=require(_0x3309('0x2'));var rp=require(_0x3309('0x3'));var fs=require('fs');var path=require(_0x3309('0x4'));var rimraf=require(_0x3309('0x5'));var config=require(_0x3309('0x6'));var attributes=require(_0x3309('0x7'));module[_0x3309('0x8')]=function(_0x1d3143,_0x31c3a6){return _0x1d3143[_0x3309('0x9')](_0x3309('0xa'),attributes,{'tableName':_0x3309('0xb'),'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 4bc2576..bce11df 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x3d7afe,_0xcf50f7){var _0x13abff=function(_0x43e09e){while(--_0x43e09e){_0x3d7afe['push'](_0x3d7afe['shift']());}};_0x13abff(++_0xcf50f7);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc4aa[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _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(_0x20c809,_0x26b566){var _0x1064a1=function(_0x39c6db){while(--_0x39c6db){_0x20c809['push'](_0x20c809['shift']());}};_0x1064a1(++_0x26b566);}(_0x5fab,0x177));var _0xb5fa=function(_0x111ee6,_0xd8a3ea){_0x111ee6=_0x111ee6-0x0;var _0x8bbb51=_0x5fab[_0x111ee6];return _0x8bbb51;};'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 diff --git a/server/api/action/index.js b/server/api/action/index.js index a8c8a82..51f1d52 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 _0xabb8=['path','express','Router','fs-extra','../../components/auth/service','/:id','isAuthenticated','update','destroy','exports','multer','util'];(function(_0x5b5af1,_0x1db01b){var _0x45ab7b=function(_0x1e353a){while(--_0x1e353a){_0x5b5af1['push'](_0x5b5af1['shift']());}};_0x45ab7b(++_0x1db01b);}(_0xabb8,0x14e));var _0x8abb=function(_0x37bea4,_0x4e138c){_0x37bea4=_0x37bea4-0x0;var _0x14bcda=_0xabb8[_0x37bea4];return _0x14bcda;};'use strict';var multer=require(_0x8abb('0x0'));var util=require(_0x8abb('0x1'));var path=require(_0x8abb('0x2'));var timeout=require('connect-timeout');var express=require(_0x8abb('0x3'));var router=express[_0x8abb('0x4')]();var fs_extra=require(_0x8abb('0x5'));var auth=require(_0x8abb('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./action.controller');router['put'](_0x8abb('0x7'),auth[_0x8abb('0x8')](),controller[_0x8abb('0x9')]);router['delete'](_0x8abb('0x7'),auth[_0x8abb('0x8')](),controller[_0x8abb('0xa')]);module[_0x8abb('0xb')]=router; \ No newline at end of file +var _0x168d=['destroy','multer','path','express','../../components/auth/service','../../config/environment','./action.controller','/:id','isAuthenticated','update','delete'];(function(_0x1280c0,_0x30b8a2){var _0x33c650=function(_0x35176c){while(--_0x35176c){_0x1280c0['push'](_0x1280c0['shift']());}};_0x33c650(++_0x30b8a2);}(_0x168d,0x135));var _0xd168=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x168d[_0x1969a7];return _0x3d665f;};'use strict';var multer=require(_0xd168('0x0'));var util=require('util');var path=require(_0xd168('0x1'));var timeout=require('connect-timeout');var express=require(_0xd168('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd168('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xd168('0x4'));var controller=require(_0xd168('0x5'));router['put'](_0xd168('0x6'),auth[_0xd168('0x7')](),controller[_0xd168('0x8')]);router[_0xd168('0x9')](_0xd168('0x6'),auth[_0xd168('0x7')](),controller[_0xd168('0xa')]);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 edca369..0153aa6 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 _0xabce=['exports','STRING','TEXT','sequelize'];(function(_0x11d61c,_0x575479){var _0x46ad35=function(_0x4b0d00){while(--_0x4b0d00){_0x11d61c['push'](_0x11d61c['shift']());}};_0x46ad35(++_0x575479);}(_0xabce,0x103));var _0xeabc=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xabce[_0x4fc9e6];return _0x551d28;};'use strict';var Sequelize=require(_0xeabc('0x0'));module[_0xeabc('0x1')]={'name':{'type':Sequelize[_0xeabc('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xeabc('0x2')]},'parent':{'type':Sequelize[_0xeabc('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xeabc('0x3')]}}; \ No newline at end of file +var _0xeda8=['sequelize','exports','STRING','TEXT'];(function(_0x3ac558,_0x185f81){var _0x26cc90=function(_0x126c6c){while(--_0x126c6c){_0x3ac558['push'](_0x3ac558['shift']());}};_0x26cc90(++_0x185f81);}(_0xeda8,0x104));var _0x8eda=function(_0x132458,_0xe53c09){_0x132458=_0x132458-0x0;var _0x4221dc=_0xeda8[_0x132458];return _0x4221dc;};'use strict';var Sequelize=require(_0x8eda('0x0'));module[_0x8eda('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eda('0x2')]},'parent':{'type':Sequelize[_0x8eda('0x2')]},'table':{'type':Sequelize[_0x8eda('0x2')]},'conditions':{'type':Sequelize[_0x8eda('0x3')]},'joins':{'type':Sequelize[_0x8eda('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 2148365..e0d252c 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 _0x88de=['VIRTUAL','options','include','findAll','rows','catch','show','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','params','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','select','from','table','MetricId','metric','replace','function','format','groupBy','orderBy','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','AnalyticMetric','keyBy','alias','clone','output','web','fullPath','generate','csv','custom','AnalyticExtractedReport','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','right_join','SEC_TO_TIME(%s)','DESC','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/utils','../../mysqldb','status','end','undefined','count','offset','limit','json','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','sendStatus','error','stack','name','send','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0x2cbd58,_0x278e75){var _0x42ef2a=function(_0x4d2ceb){while(--_0x4d2ceb){_0x2cbd58['push'](_0x2cbd58['shift']());}};_0x42ef2a(++_0x278e75);}(_0x88de,0x19c));var _0xe88d=function(_0x3e131a,_0x3bf61f){_0x3e131a=_0x3e131a-0x0;var _0x2eeb65=_0x88de[_0x3e131a];return _0x2eeb65;};'use strict';var emlformat=require(_0xe88d('0x0'));var rimraf=require(_0xe88d('0x1'));var zipdir=require(_0xe88d('0x2'));var jsonpatch=require(_0xe88d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe88d('0x4'));var util=require(_0xe88d('0x5'));var path=require('path');var sox=require(_0xe88d('0x6'));var csv=require('to-csv');var ejs=require(_0xe88d('0x7'));var fs=require('fs');var fs_extra=require(_0xe88d('0x8'));var _=require(_0xe88d('0x9'));var squel=require(_0xe88d('0xa'));var crypto=require(_0xe88d('0xb'));var jsforce=require(_0xe88d('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe88d('0xd'));var Papa=require(_0xe88d('0xe'));var Redis=require(_0xe88d('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe88d('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xe88d('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe88d('0x12'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0xae04e2,_0x2af552){_0x2af552=_0x2af552||0xcc;return function(_0x3e911a){if(_0x3e911a){return _0xae04e2['sendStatus'](_0x2af552);}return _0xae04e2[_0xe88d('0x13')](_0x2af552)[_0xe88d('0x14')]();};}function respondWithResult(_0x48cca9,_0xe8d11a){_0xe8d11a=_0xe8d11a||0xc8;return function(_0x22f678){if(_0x22f678){return _0x48cca9[_0xe88d('0x13')](_0xe8d11a)['json'](_0x22f678);}};}function respondWithFilteredResult(_0x369107,_0x5bc2f8){return function(_0x4d15df){if(_0x4d15df){var _0x5d0221=typeof _0x5bc2f8['offset']===_0xe88d('0x15')&&typeof _0x5bc2f8['limit']===_0xe88d('0x15');var _0x395fbd=_0x4d15df[_0xe88d('0x16')];var _0x137c43=_0x5d0221?0x0:_0x5bc2f8[_0xe88d('0x17')];var _0x57dc7b=_0x5d0221?_0x4d15df[_0xe88d('0x16')]:_0x5bc2f8[_0xe88d('0x17')]+_0x5bc2f8[_0xe88d('0x18')];var _0x1ff01a;if(_0x57dc7b>=_0x395fbd){_0x57dc7b=_0x395fbd;_0x1ff01a=0xc8;}else{_0x1ff01a=0xce;}_0x369107[_0xe88d('0x13')](_0x1ff01a);return _0x369107['set']('Content-Range',_0x137c43+'-'+_0x57dc7b+'/'+_0x395fbd)[_0xe88d('0x19')](_0x4d15df);}return null;};}function patchUpdates(_0x434c58){return function(_0x6042fd){try{jsonpatch[_0xe88d('0x1a')](_0x6042fd,_0x434c58,!![]);}catch(_0x476d58){return BPromise[_0xe88d('0x1b')](_0x476d58);}return _0x6042fd[_0xe88d('0x1c')]();};}function saveUpdates(_0x52c091,_0x48e6c2){return function(_0xda39c0){if(_0xda39c0){return _0xda39c0[_0xe88d('0x1d')](_0x52c091)[_0xe88d('0x1e')](function(_0x343aeb){return _0x343aeb;});}return null;};}function removeEntity(_0x525fa4,_0x33bd69){return function(_0x51fece){if(_0x51fece){return _0x51fece[_0xe88d('0x1f')]()[_0xe88d('0x1e')](function(){var _0x1232fd=_0x51fece[_0xe88d('0x20')]({'plain':!![]});var _0x1a695a=_0xe88d('0x21');return db[_0xe88d('0x22')][_0xe88d('0x1f')]({'where':{'type':_0x1a695a,'resourceId':_0x1232fd['id']}})['then'](function(){return _0x51fece;});})[_0xe88d('0x1e')](function(){_0x525fa4[_0xe88d('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27c5c2,_0x1e3009){return function(_0xdd34fc){if(!_0xdd34fc){_0x27c5c2[_0xe88d('0x23')](0x194);}return _0xdd34fc;};}function handleError(_0x3c08ca,_0x56b91d){_0x56b91d=_0x56b91d||0x1f4;return function(_0x49c53b){logger[_0xe88d('0x24')](_0x49c53b[_0xe88d('0x25')]);if(_0x49c53b[_0xe88d('0x26')]){delete _0x49c53b[_0xe88d('0x26')];}_0x3c08ca[_0xe88d('0x13')](_0x56b91d)[_0xe88d('0x27')](_0x49c53b);};}exports['index']=function(_0x926442,_0x71660f){var _0x4f060a={},_0x24d421={},_0x3f6c86={'count':0x0,'rows':[]};var _0x4c6353=_[_0xe88d('0x28')](db[_0xe88d('0x29')][_0xe88d('0x2a')],function(_0x5573a7){return{'name':_0x5573a7[_0xe88d('0x2b')],'type':_0x5573a7[_0xe88d('0x2c')][_0xe88d('0x2d')]};});_0x24d421['model']=_[_0xe88d('0x28')](_0x4c6353,_0xe88d('0x26'));_0x24d421[_0xe88d('0x2e')]=_[_0xe88d('0x2f')](_0x926442[_0xe88d('0x2e')]);_0x24d421[_0xe88d('0x30')]=_[_0xe88d('0x31')](_0x24d421['model'],_0x24d421[_0xe88d('0x2e')]);_0x4f060a[_0xe88d('0x32')]=_[_0xe88d('0x31')](_0x24d421[_0xe88d('0x33')],qs[_0xe88d('0x34')](_0x926442['query']['fields']));_0x4f060a['attributes']=_0x4f060a['attributes'][_0xe88d('0x35')]?_0x4f060a[_0xe88d('0x32')]:_0x24d421[_0xe88d('0x33')];if(!_0x926442[_0xe88d('0x2e')][_0xe88d('0x36')](_0xe88d('0x37'))){_0x4f060a[_0xe88d('0x18')]=qs['limit'](_0x926442[_0xe88d('0x2e')]['limit']);_0x4f060a[_0xe88d('0x17')]=qs[_0xe88d('0x17')](_0x926442[_0xe88d('0x2e')]['offset']);}_0x4f060a[_0xe88d('0x38')]=qs[_0xe88d('0x39')](_0x926442[_0xe88d('0x2e')][_0xe88d('0x39')]);_0x4f060a[_0xe88d('0x3a')]=qs[_0xe88d('0x30')](_[_0xe88d('0x3b')](_0x926442[_0xe88d('0x2e')],_0x24d421[_0xe88d('0x30')]),_0x4c6353);if(_0x926442[_0xe88d('0x2e')][_0xe88d('0x3c')]){_0x4f060a[_0xe88d('0x3a')]=_[_0xe88d('0x3d')](_0x4f060a['where'],{'$or':_[_0xe88d('0x28')](_0x4c6353,function(_0x5235e8){if(_0x5235e8[_0xe88d('0x2c')]!==_0xe88d('0x3e')){var _0x55b57e={};_0x55b57e[_0x5235e8['name']]={'$like':'%'+_0x926442[_0xe88d('0x2e')][_0xe88d('0x3c')]+'%'};return _0x55b57e;}})});}_0x4f060a=_[_0xe88d('0x3d')]({},_0x4f060a,_0x926442[_0xe88d('0x3f')]);var _0x210834={'where':_0x4f060a[_0xe88d('0x3a')]};return db[_0xe88d('0x29')][_0xe88d('0x16')](_0x210834)[_0xe88d('0x1e')](function(_0x62026b){_0x3f6c86[_0xe88d('0x16')]=_0x62026b;if(_0x926442[_0xe88d('0x2e')]['includeAll']){_0x4f060a[_0xe88d('0x40')]=[{'all':!![]}];}return db[_0xe88d('0x29')][_0xe88d('0x41')](_0x4f060a);})[_0xe88d('0x1e')](function(_0x381b8c){_0x3f6c86[_0xe88d('0x42')]=_0x381b8c;return _0x3f6c86;})['then'](respondWithFilteredResult(_0x71660f,_0x4f060a))[_0xe88d('0x43')](handleError(_0x71660f,null));};exports[_0xe88d('0x44')]=function(_0x39928c,_0x2ac560){var _0x232645={'raw':![],'where':{'id':_0x39928c['params']['id']}},_0x304388={};_0x304388[_0xe88d('0x33')]=_[_0xe88d('0x2f')](db[_0xe88d('0x29')][_0xe88d('0x2a')]);_0x304388[_0xe88d('0x2e')]=_['keys'](_0x39928c[_0xe88d('0x2e')]);_0x304388[_0xe88d('0x30')]=_[_0xe88d('0x31')](_0x304388[_0xe88d('0x33')],_0x304388['query']);_0x232645[_0xe88d('0x32')]=_['intersection'](_0x304388[_0xe88d('0x33')],qs['fields'](_0x39928c[_0xe88d('0x2e')][_0xe88d('0x34')]));_0x232645['attributes']=_0x232645[_0xe88d('0x32')]['length']?_0x232645[_0xe88d('0x32')]:_0x304388[_0xe88d('0x33')];if(_0x39928c[_0xe88d('0x2e')]['includeAll']){_0x232645[_0xe88d('0x40')]=[{'all':!![]}];}_0x232645=_['merge']({},_0x232645,_0x39928c[_0xe88d('0x3f')]);return db[_0xe88d('0x29')][_0xe88d('0x45')](_0x232645)['then'](handleEntityNotFound(_0x2ac560,null))[_0xe88d('0x1e')](respondWithResult(_0x2ac560,null))[_0xe88d('0x43')](handleError(_0x2ac560,null));};exports[_0xe88d('0x46')]=function(_0x1b3462,_0x565c84){return db[_0xe88d('0x29')]['create'](_0x1b3462['body'],{})['then'](function(_0x10f110){var _0x2f2cd3=_0x1b3462[_0xe88d('0x47')]['get']({'plain':!![]});if(!_0x2f2cd3)throw new Error(_0xe88d('0x48'));if(_0x2f2cd3[_0xe88d('0x49')]===_0xe88d('0x47')){var _0x5608e3=_0x10f110['get']({'plain':!![]});var _0x11bbc7=_0xe88d('0x4a');return db['UserProfileSection'][_0xe88d('0x45')]({'where':{'name':_0x11bbc7,'userProfileId':_0x2f2cd3[_0xe88d('0x4b')]},'raw':!![]})[_0xe88d('0x1e')](function(_0x4b1337){if(_0x4b1337&&_0x4b1337[_0xe88d('0x4c')]===0x0){return db[_0xe88d('0x22')]['create']({'name':_0x5608e3[_0xe88d('0x26')],'resourceId':_0x5608e3['id'],'type':_0xe88d('0x21'),'sectionId':_0x4b1337['id']},{})[_0xe88d('0x1e')](function(){return _0x10f110;});}else{return _0x10f110;}})[_0xe88d('0x43')](function(_0x2e5d40){logger[_0xe88d('0x24')](_0xe88d('0x4d'),_0x2e5d40);throw _0x2e5d40;});}return _0x10f110;})['then'](respondWithResult(_0x565c84,0xc9))[_0xe88d('0x43')](handleError(_0x565c84,null));};exports[_0xe88d('0x1d')]=function(_0x5188f6,_0x3fd3a2){if(_0x5188f6['body']['id']){delete _0x5188f6['body']['id'];}return db[_0xe88d('0x29')][_0xe88d('0x45')]({'where':{'id':_0x5188f6['params']['id']}})[_0xe88d('0x1e')](handleEntityNotFound(_0x3fd3a2,null))[_0xe88d('0x1e')](saveUpdates(_0x5188f6['body'],null))['then'](respondWithResult(_0x3fd3a2,null))[_0xe88d('0x43')](handleError(_0x3fd3a2,null));};exports[_0xe88d('0x1f')]=function(_0x3edcb2,_0xe3979f){return db[_0xe88d('0x29')]['find']({'where':{'id':_0x3edcb2['params']['id']}})[_0xe88d('0x1e')](handleEntityNotFound(_0xe3979f,null))['then'](removeEntity(_0xe3979f,null))[_0xe88d('0x43')](handleError(_0xe3979f,null));};exports['preview']=function(_0x1fa43c,_0x2aea5c){var _0x539c25=0xa;var _0x4960fd=[_0xe88d('0x4e'),_0xe88d('0x4f'),'right_join',_0xe88d('0x50')];var _0x2eae57={'SUM':_0xe88d('0x51'),'COUNT':_0xe88d('0x52'),'COUNT DISTINCT':_0xe88d('0x53'),'MAX':_0xe88d('0x54'),'MIN':_0xe88d('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xe88d('0x56'),'GROUP_CONCAT ASC':_0xe88d('0x57'),'GROUP_CONCAT DESC':_0xe88d('0x58')};var _0x4e5b50={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xe88d('0x59'),'HOUR':_0xe88d('0x5a'),'ROUND':_0xe88d('0x5b'),'UNIX_TIMESTAMP':_0xe88d('0x5c')};var _0x374812=function(_0x15f5c5){return!_[_0xe88d('0x5d')]([_0xe88d('0x5e'),_0xe88d('0x5f'),_0xe88d('0x60'),_0xe88d('0x61')],_0x15f5c5);};var _0x4b30d4=function(_0x9df0af){if(!_0x9df0af||!_0x9df0af[_0xe88d('0x62')][_0xe88d('0x35')]){return'';}for(var _0x3b2421='(',_0x438106=0x0;_0x438106<_0x9df0af['rules'][_0xe88d('0x35')];_0x438106+=0x1){_0x438106>0x0&&(_0x3b2421+='\x20'+_0x9df0af[_0xe88d('0x63')]+'\x20');_0x3b2421+=_0x9df0af[_0xe88d('0x62')][_0x438106]['group']?_0x4b30d4(_0x9df0af['rules'][_0x438106][_0xe88d('0x64')]):_0x9df0af[_0xe88d('0x62')][_0x438106][_0xe88d('0x65')]+'\x20'+_0x9df0af['rules'][_0x438106][_0xe88d('0x66')]+(_0x374812(_0x9df0af['rules'][_0x438106][_0xe88d('0x66')])?'\x20'+_0x9df0af['rules'][_0x438106][_0xe88d('0x67')]:'');}return _0x3b2421+')';};var _0x5d88da={'where':{'id':_0x1fa43c[_0xe88d('0x68')]['id']}},_0x49ad86,_0x32e9ce,_0x48c039,_0x2d6800,_0x212de9;_0x5d88da=_[_0xe88d('0x3d')]({},_0x5d88da,_0x1fa43c['options']);return db[_0xe88d('0x29')][_0xe88d('0x45')](_0x5d88da)[_0xe88d('0x1e')](function(_0xccd58f){if(_0xccd58f){_0x49ad86=_0xccd58f;return _0xccd58f[_0xe88d('0x69')]();}return null;})[_0xe88d('0x1e')](function(_0x4507ed){if(_0x4507ed){if(!_0x4507ed[_0xe88d('0x35')]){throw new db[(_0xe88d('0x6a'))][(_0xe88d('0x6b'))](_0xe88d('0x6c'),0x193);}_0x32e9ce=_0x4507ed;return db['AnalyticMetric'][_0xe88d('0x41')]({'raw':!![]});}return null;})[_0xe88d('0x1e')](function(_0x2ff5fd){if(_0x2ff5fd){_0x48c039=_['keyBy'](_0x2ff5fd,'id');var _0x55cde1;var _0x123df9=squel[_0xe88d('0x6d')]();_0x123df9[_0xe88d('0x6e')](_0x49ad86[_0xe88d('0x6f')]);for(var _0x37aa50=0x0;_0x37aa50<_0x32e9ce[_0xe88d('0x35')];_0x37aa50+=0x1){_0x55cde1=_0x32e9ce[_0x37aa50][_0xe88d('0x70')]?_0x48c039[_0x32e9ce[_0x37aa50][_0xe88d('0x70')]][_0xe88d('0x71')]:_0x32e9ce[_0x37aa50]['field'];_0x55cde1=_0x32e9ce[_0x37aa50]['function']?_[_0xe88d('0x72')](_0x2eae57[_0x32e9ce[_0x37aa50][_0xe88d('0x73')]],'%s',_0x55cde1):_0x55cde1;_0x55cde1=_0x32e9ce[_0x37aa50][_0xe88d('0x74')]?_[_0xe88d('0x72')](_0x4e5b50[_0x32e9ce[_0x37aa50][_0xe88d('0x74')]],'%s',_0x55cde1):_0x55cde1;if(_0x32e9ce[_0x37aa50][_0xe88d('0x75')]){_0x123df9[_0xe88d('0x64')](_0x55cde1);}_0x32e9ce[_0x37aa50][_0xe88d('0x76')]&&_0x123df9['order'](_0x55cde1,_0x32e9ce[_0x37aa50][_0xe88d('0x76')]==='DESC'?![]:!![]);_0x123df9[_0xe88d('0x65')](_0x55cde1,_0x32e9ce[_0x37aa50]['alias']||_0x55cde1);}if(_0x49ad86[_0xe88d('0x77')]){_0x49ad86[_0xe88d('0x77')]=JSON[_0xe88d('0x78')](_0x49ad86['joins']);for(var _0xe1894f=0x0;_0xe1894f<_0x49ad86[_0xe88d('0x77')][_0xe88d('0x35')];_0xe1894f+=0x1){if(_0x49ad86[_0xe88d('0x77')][_0xe1894f][_0xe88d('0x2c')]&&_['includes'](_0x4960fd,_0x49ad86[_0xe88d('0x77')][_0xe1894f][_0xe88d('0x2c')])&&_0x49ad86[_0xe88d('0x77')][_0xe1894f][_0xe88d('0x79')]&&_0x49ad86[_0xe88d('0x77')][_0xe1894f][_0xe88d('0x7a')]&&_0x49ad86['joins'][_0xe1894f][_0xe88d('0x7b')]){_0x123df9[_0x49ad86[_0xe88d('0x77')][_0xe1894f][_0xe88d('0x2c')]](_0x49ad86[_0xe88d('0x77')][_0xe1894f][_0xe88d('0x7a')],null,util['format'](_0xe88d('0x7c'),_0x49ad86[_0xe88d('0x6f')],_0x49ad86[_0xe88d('0x77')][_0xe1894f][_0xe88d('0x79')],_0x49ad86[_0xe88d('0x77')][_0xe1894f][_0xe88d('0x7a')],_0x49ad86[_0xe88d('0x77')][_0xe1894f][_0xe88d('0x7b')]));}}}if(_0x49ad86[_0xe88d('0x7d')]){_0x49ad86[_0xe88d('0x7d')]=JSON[_0xe88d('0x78')](_0x49ad86[_0xe88d('0x7d')]);_0x123df9[_0xe88d('0x3a')](_0x4b30d4(_0x49ad86[_0xe88d('0x7d')]['group']));}_0x212de9=_0x123df9['clone']();_0x123df9[_0xe88d('0x18')](_0x539c25);_0x123df9[_0xe88d('0x17')](0x0);logger[_0xe88d('0x7e')](_0xe88d('0x7f'),_0x123df9[_0xe88d('0x80')]());return dbH['sequelize'][_0xe88d('0x2e')](_0x123df9[_0xe88d('0x80')](),{'type':dbH[_0xe88d('0x81')][_0xe88d('0x82')][_0xe88d('0x83')]});}})[_0xe88d('0x1e')](respondWithResult(_0x2aea5c,null))['catch'](handleError(_0x2aea5c,null));};function runReport(_0x2a4e90,_0x4e844d,_0x547f8f){var _0x2ba701=_0x4e844d[_0xe88d('0x26')];var _0x524288=0xa;var _0x146519=[_0xe88d('0x4e'),_0xe88d('0x4f'),'right_join',_0xe88d('0x50')];var _0x3ce607={'SUM':_0xe88d('0x51'),'COUNT':_0xe88d('0x52'),'COUNT DISTINCT':_0xe88d('0x53'),'MAX':_0xe88d('0x54'),'MIN':_0xe88d('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xe88d('0x57'),'GROUP_CONCAT DESC':_0xe88d('0x58')};var _0x364b1c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xe88d('0x5a'),'ROUND':_0xe88d('0x5b'),'UNIX_TIMESTAMP':_0xe88d('0x5c')};var _0x1aa8c4=function(_0x220001){return!_[_0xe88d('0x5d')]([_0xe88d('0x5e'),_0xe88d('0x5f'),_0xe88d('0x60'),_0xe88d('0x61')],_0x220001);};var _0x256efe=function(_0x592a91){if(!_0x592a91||!_0x592a91['rules'][_0xe88d('0x35')]){return'';}for(var _0x1a81ad='(',_0x35b329=0x0;_0x35b329<_0x592a91[_0xe88d('0x62')][_0xe88d('0x35')];_0x35b329+=0x1){_0x35b329>0x0&&(_0x1a81ad+='\x20'+_0x592a91['operator']+'\x20');_0x1a81ad+=_0x592a91[_0xe88d('0x62')][_0x35b329][_0xe88d('0x64')]?_0x256efe(_0x592a91[_0xe88d('0x62')][_0x35b329]['group']):_0x592a91[_0xe88d('0x62')][_0x35b329]['field']+'\x20'+_0x592a91[_0xe88d('0x62')][_0x35b329][_0xe88d('0x66')]+(_0x1aa8c4(_0x592a91['rules'][_0x35b329]['condition'])?'\x20'+_0x592a91[_0xe88d('0x62')][_0x35b329][_0xe88d('0x67')]:'');}return _0x1a81ad+')';};var _0x1bffdc={'where':{'id':_0x2a4e90['id']}},_0x1b8142,_0x1e1721,_0x55300d,_0x41c79e,_0x1c3072;_0x1bffdc=_[_0xe88d('0x3d')]({},_0x1bffdc,_0x547f8f);return db[_0xe88d('0x29')]['find'](_0x1bffdc)['then'](function(_0x46e533){if(_0x46e533){_0x1b8142=_0x46e533;return _0x46e533[_0xe88d('0x69')]();}return null;})['then'](function(_0x2908b7){if(_0x2908b7){if(!_0x2908b7[_0xe88d('0x35')]){throw new db[(_0xe88d('0x6a'))]['ValidationErrorItem'](_0xe88d('0x6c'),0x193);}_0x1e1721=_0x2908b7;return db[_0xe88d('0x84')][_0xe88d('0x41')]({'raw':!![]});}return null;})[_0xe88d('0x1e')](function(_0x42bbc3){if(_0x42bbc3){_0x55300d=_[_0xe88d('0x85')](_0x42bbc3,'id');var _0x316754;var _0x30268c=squel[_0xe88d('0x6d')]();_0x30268c[_0xe88d('0x6e')](_0x1b8142[_0xe88d('0x6f')]);for(var _0x829a63=0x0;_0x829a63<_0x1e1721[_0xe88d('0x35')];_0x829a63+=0x1){_0x316754=_0x1e1721[_0x829a63][_0xe88d('0x70')]?_0x55300d[_0x1e1721[_0x829a63][_0xe88d('0x70')]][_0xe88d('0x71')]:_0x1e1721[_0x829a63]['field'];_0x316754=_0x1e1721[_0x829a63][_0xe88d('0x73')]?_[_0xe88d('0x72')](_0x3ce607[_0x1e1721[_0x829a63][_0xe88d('0x73')]],'%s',_0x316754):_0x316754;_0x316754=_0x1e1721[_0x829a63][_0xe88d('0x74')]?_[_0xe88d('0x72')](_0x364b1c[_0x1e1721[_0x829a63][_0xe88d('0x74')]],'%s',_0x316754):_0x316754;if(_0x1e1721[_0x829a63][_0xe88d('0x75')]){_0x30268c[_0xe88d('0x64')](_0x316754);}_0x1e1721[_0x829a63][_0xe88d('0x76')]&&_0x30268c[_0xe88d('0x38')](_0x316754,_0x1e1721[_0x829a63][_0xe88d('0x76')]==='DESC'?![]:!![]);_0x30268c[_0xe88d('0x65')](_0x316754,_0x1e1721[_0x829a63][_0xe88d('0x86')]||_0x316754);}if(_0x1b8142[_0xe88d('0x77')]){_0x1b8142[_0xe88d('0x77')]=JSON[_0xe88d('0x78')](_0x1b8142[_0xe88d('0x77')]);for(var _0x523109=0x0;_0x523109<_0x1b8142['joins'][_0xe88d('0x35')];_0x523109+=0x1){if(_0x1b8142[_0xe88d('0x77')][_0x523109]['type']&&_['includes'](_0x146519,_0x1b8142[_0xe88d('0x77')][_0x523109][_0xe88d('0x2c')])&&_0x1b8142['joins'][_0x523109][_0xe88d('0x79')]&&_0x1b8142[_0xe88d('0x77')][_0x523109][_0xe88d('0x7a')]&&_0x1b8142[_0xe88d('0x77')][_0x523109][_0xe88d('0x7b')]){_0x30268c[_0x1b8142[_0xe88d('0x77')][_0x523109][_0xe88d('0x2c')]](_0x1b8142[_0xe88d('0x77')][_0x523109]['foreignTable'],null,util[_0xe88d('0x74')](_0xe88d('0x7c'),_0x1b8142[_0xe88d('0x6f')],_0x1b8142[_0xe88d('0x77')][_0x523109][_0xe88d('0x79')],_0x1b8142[_0xe88d('0x77')][_0x523109][_0xe88d('0x7a')],_0x1b8142[_0xe88d('0x77')][_0x523109][_0xe88d('0x7b')]));}}}if(_0x1b8142['conditions']){_0x1b8142[_0xe88d('0x7d')]=JSON[_0xe88d('0x78')](_0x1b8142[_0xe88d('0x7d')]);_0x30268c['where'](_0x256efe(_0x1b8142[_0xe88d('0x7d')][_0xe88d('0x64')]));}_0x1c3072=_0x30268c[_0xe88d('0x87')]();_0x30268c[_0xe88d('0x18')](_0x524288);_0x30268c['offset'](0x0);return;}})[_0xe88d('0x1e')](function(){if(_0x4e844d[_0xe88d('0x88')]===_0xe88d('0x89')){return null;}var _0xb39dcf=_[_0xe88d('0x3d')](_0x4e844d,{'name':_0x4e844d[_0xe88d('0x8a')]||_0x4e844d[_0xe88d('0x26')]||_0x1b8142[_0xe88d('0x26')],'basename':_0x2ba701,'savename':util[_0xe88d('0x74')]('%s-%s.%s',_0x4e844d[_0xe88d('0x26')]||_0x1b8142[_0xe88d('0x26')],require('randomstring')[_0xe88d('0x8b')](0x4),_0x4e844d[_0xe88d('0x88')]||_0xe88d('0x8c')),'reportId':_0x1b8142['id'],'reportType':_0xe88d('0x8d')});return db[_0xe88d('0x8e')][_0xe88d('0x46')](_0xb39dcf,{'raw':!![]});})[_0xe88d('0x1e')](function(_0x424130){if(_0x1b8142[_0xe88d('0x6f')]==='cdr'){_0x1c3072['where'](_0x1b8142[_0xe88d('0x6f')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x4e844d[_0xe88d('0x8f')],_0x4e844d[_0xe88d('0x90')]);}else{_0x1c3072[_0xe88d('0x3a')](_0x1b8142[_0xe88d('0x6f')]+_0xe88d('0x91'),_0x4e844d[_0xe88d('0x8f')],_0x4e844d['endDate']);}if(_0x424130){logger[_0xe88d('0x92')](_0xe88d('0x93'),_0x1c3072['toString']());require('child_process')[_0xe88d('0x94')](path[_0xe88d('0x4e')](__dirname,_0xe88d('0x95'),_0x424130[_0xe88d('0x88')]),[_0x424130['id'],_0x1c3072[_0xe88d('0x80')](),path[_0xe88d('0x4e')](__dirname,_0xe88d('0x96'),_0x424130[_0xe88d('0x97')]),_0x2ba701]);return _0x424130;}else{var _0x469e66=squel[_0xe88d('0x6d')]();_0x469e66[_0xe88d('0x6e')]('('+_0x1c3072['toString']()+')',_0xe88d('0x98'));_0x469e66[_0xe88d('0x65')](_0xe88d('0x99'),_0xe88d('0x16'));_0x1c3072[_0xe88d('0x18')](_0x4e844d[_0xe88d('0x18')]||_0x524288);_0x1c3072[_0xe88d('0x17')](_0x4e844d[_0xe88d('0x17')]||0x0);return dbH[_0xe88d('0x81')]['query'](_0x469e66[_0xe88d('0x80')](),{'type':dbH['sequelize']['QueryTypes']['SELECT']})[_0xe88d('0x1e')](function(_0x4aa5c7){if(!_0x4aa5c7[_0xe88d('0x35')]){_0x41c79e=0x0;}else{_0x41c79e=_0x4aa5c7[0x0][_0xe88d('0x16')]||0x0;}return dbH[_0xe88d('0x81')][_0xe88d('0x2e')](_0x1c3072[_0xe88d('0x80')](),{'type':dbH[_0xe88d('0x81')][_0xe88d('0x82')][_0xe88d('0x83')]});})[_0xe88d('0x1e')](function(_0x3c2864){return{'rows':_0x3c2864||[],'count':_0x41c79e};});}});}exports['run']=function(_0x11ff67,_0x2bf33c){return runReport(_0x11ff67[_0xe88d('0x68')],_0x11ff67['query'],_0x11ff67[_0xe88d('0x3f')])[_0xe88d('0x1e')](respondWithResult(_0x2bf33c,null))[_0xe88d('0x43')](handleError(_0x2bf33c,null));};exports[_0xe88d('0x9a')]=runReport;exports[_0xe88d('0x2e')]=function(_0x34ee5b,_0x35f89f){var _0x850bc3=0xa;var _0xa71e3e=['join',_0xe88d('0x4f'),_0xe88d('0x9b'),_0xe88d('0x50')];var _0x2107e7={'SUM':_0xe88d('0x51'),'COUNT':_0xe88d('0x52'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xe88d('0x54'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xe88d('0x56'),'GROUP_CONCAT ASC':_0xe88d('0x57'),'GROUP_CONCAT DESC':_0xe88d('0x58')};var _0xe55d4c={'SEC_TO_TIME':_0xe88d('0x9c'),'DATE':'DATE(%s)','HOUR':_0xe88d('0x5a'),'ROUND':_0xe88d('0x5b'),'UNIX_TIMESTAMP':_0xe88d('0x5c')};var _0x20ec53=function(_0x2c4cbb){return!_[_0xe88d('0x5d')]([_0xe88d('0x5e'),_0xe88d('0x5f'),_0xe88d('0x60'),'IS\x20NOT\x20EMPTY'],_0x2c4cbb);};var _0x2b77bb=function(_0x235c41){if(!_0x235c41||!_0x235c41['rules'][_0xe88d('0x35')]){return'';}for(var _0x32450a='(',_0x577550=0x0;_0x577550<_0x235c41[_0xe88d('0x62')]['length'];_0x577550+=0x1){_0x577550>0x0&&(_0x32450a+='\x20'+_0x235c41[_0xe88d('0x63')]+'\x20');_0x32450a+=_0x235c41[_0xe88d('0x62')][_0x577550]['group']?_0x2b77bb(_0x235c41[_0xe88d('0x62')][_0x577550][_0xe88d('0x64')]):_0x235c41[_0xe88d('0x62')][_0x577550]['field']+'\x20'+_0x235c41['rules'][_0x577550][_0xe88d('0x66')]+(_0x20ec53(_0x235c41[_0xe88d('0x62')][_0x577550][_0xe88d('0x66')])?'\x20'+_0x235c41[_0xe88d('0x62')][_0x577550]['value']:'');}return _0x32450a+')';};var _0x13a5c3={'where':{'id':_0x34ee5b[_0xe88d('0x68')]['id']}},_0x4e0ed5,_0x36ee24,_0x1b7d2b,_0x244f91,_0x15bf23;_0x13a5c3=_[_0xe88d('0x3d')]({},_0x13a5c3,_0x34ee5b['options']);return db[_0xe88d('0x29')][_0xe88d('0x45')](_0x13a5c3)['then'](function(_0x10315d){if(_0x10315d){_0x4e0ed5=_0x10315d;return _0x10315d[_0xe88d('0x69')]();}return null;})[_0xe88d('0x1e')](function(_0x4831e7){if(_0x4831e7){if(!_0x4831e7['length']){throw new db[(_0xe88d('0x6a'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x36ee24=_0x4831e7;return db[_0xe88d('0x84')][_0xe88d('0x41')]({'raw':!![]});}return null;})[_0xe88d('0x1e')](function(_0x3a5c3a){if(_0x3a5c3a){_0x1b7d2b=_[_0xe88d('0x85')](_0x3a5c3a,'id');var _0x593877;var _0x1467cd=squel[_0xe88d('0x6d')]();_0x1467cd[_0xe88d('0x6e')](_0x4e0ed5[_0xe88d('0x6f')]);for(var _0x2bbc67=0x0;_0x2bbc67<_0x36ee24[_0xe88d('0x35')];_0x2bbc67+=0x1){_0x593877=_0x36ee24[_0x2bbc67]['MetricId']?_0x1b7d2b[_0x36ee24[_0x2bbc67][_0xe88d('0x70')]][_0xe88d('0x71')]:_0x36ee24[_0x2bbc67][_0xe88d('0x65')];_0x593877=_0x36ee24[_0x2bbc67][_0xe88d('0x73')]?_[_0xe88d('0x72')](_0x2107e7[_0x36ee24[_0x2bbc67][_0xe88d('0x73')]],'%s',_0x593877):_0x593877;_0x593877=_0x36ee24[_0x2bbc67][_0xe88d('0x74')]?_['replace'](_0xe55d4c[_0x36ee24[_0x2bbc67][_0xe88d('0x74')]],'%s',_0x593877):_0x593877;if(_0x36ee24[_0x2bbc67][_0xe88d('0x75')]){_0x1467cd[_0xe88d('0x64')](_0x593877);}_0x36ee24[_0x2bbc67][_0xe88d('0x76')]&&_0x1467cd[_0xe88d('0x38')](_0x593877,_0x36ee24[_0x2bbc67][_0xe88d('0x76')]===_0xe88d('0x9d')?![]:!![]);_0x1467cd[_0xe88d('0x65')](_0x593877,_0x36ee24[_0x2bbc67][_0xe88d('0x86')]||_0x593877);}if(_0x4e0ed5[_0xe88d('0x77')]){_0x4e0ed5[_0xe88d('0x77')]=JSON[_0xe88d('0x78')](_0x4e0ed5[_0xe88d('0x77')]);for(var _0x33a849=0x0;_0x33a849<_0x4e0ed5['joins'][_0xe88d('0x35')];_0x33a849+=0x1){if(_0x4e0ed5['joins'][_0x33a849][_0xe88d('0x2c')]&&_['includes'](_0xa71e3e,_0x4e0ed5[_0xe88d('0x77')][_0x33a849][_0xe88d('0x2c')])&&_0x4e0ed5[_0xe88d('0x77')][_0x33a849][_0xe88d('0x79')]&&_0x4e0ed5[_0xe88d('0x77')][_0x33a849][_0xe88d('0x7a')]&&_0x4e0ed5[_0xe88d('0x77')][_0x33a849][_0xe88d('0x7b')]){_0x1467cd[_0x4e0ed5[_0xe88d('0x77')][_0x33a849]['type']](_0x4e0ed5['joins'][_0x33a849][_0xe88d('0x7a')],null,util['format'](_0xe88d('0x7c'),_0x4e0ed5[_0xe88d('0x6f')],_0x4e0ed5[_0xe88d('0x77')][_0x33a849][_0xe88d('0x79')],_0x4e0ed5[_0xe88d('0x77')][_0x33a849][_0xe88d('0x7a')],_0x4e0ed5[_0xe88d('0x77')][_0x33a849][_0xe88d('0x7b')]));}}}if(_0x4e0ed5[_0xe88d('0x7d')]){_0x4e0ed5[_0xe88d('0x7d')]=JSON[_0xe88d('0x78')](_0x4e0ed5['conditions']);_0x1467cd['where'](_0x2b77bb(_0x4e0ed5['conditions'][_0xe88d('0x64')]));}_0x15bf23=_0x1467cd[_0xe88d('0x87')]();_0x1467cd[_0xe88d('0x18')](_0x850bc3);_0x1467cd[_0xe88d('0x17')](0x0);logger[_0xe88d('0x7e')](_0xe88d('0x7f'),_0x1467cd[_0xe88d('0x80')]());return dbH['sequelize']['query'](_0x1467cd[_0xe88d('0x80')](),{'type':dbH['sequelize'][_0xe88d('0x82')][_0xe88d('0x83')]});}})[_0xe88d('0x1e')](function(){return{'sql':_0x15bf23[_0xe88d('0x80')]()};})['then'](respondWithResult(_0x35f89f,null))[_0xe88d('0x43')](handleError(_0x35f89f,null));}; \ No newline at end of file +var _0xca87=['%s.%s\x20=\x20%s.%s','conditions','parse','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SUM(%s)','COUNT(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','keyBy','groupBy','clone','output','web','%s-%s.%s','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','fork','../../components/export/','../../files/reports','COUNT(*)','SELECT','runReport','Sequelize','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','undefined','count','offset','json','apply','save','update','destroy','then','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','join','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)','includes','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','MetricId','metric','field','function','replace','format','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey'];(function(_0x6dfec,_0x2a2cf7){var _0x5ee20b=function(_0x266c57){while(--_0x266c57){_0x6dfec['push'](_0x6dfec['shift']());}};_0x5ee20b(++_0x2a2cf7);}(_0xca87,0xc6));var _0x7ca8=function(_0x310e3b,_0x4e6536){_0x310e3b=_0x310e3b-0x0;var _0x3b2836=_0xca87[_0x310e3b];return _0x3b2836;};'use strict';var emlformat=require(_0x7ca8('0x0'));var rimraf=require(_0x7ca8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7ca8('0x2'));var moment=require(_0x7ca8('0x3'));var BPromise=require(_0x7ca8('0x4'));var Mustache=require(_0x7ca8('0x5'));var util=require(_0x7ca8('0x6'));var path=require(_0x7ca8('0x7'));var sox=require('sox');var csv=require(_0x7ca8('0x8'));var ejs=require(_0x7ca8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7ca8('0xa'));var crypto=require('crypto');var jsforce=require(_0x7ca8('0xb'));var deskjs=require(_0x7ca8('0xc'));var toCsv=require(_0x7ca8('0x8'));var querystring=require(_0x7ca8('0xd'));var Papa=require(_0x7ca8('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7ca8('0xf'));var as=require(_0x7ca8('0x10'));var hardwareService=require(_0x7ca8('0x11'));var logger=require(_0x7ca8('0x12'))(_0x7ca8('0x13'));var utils=require(_0x7ca8('0x14'));var config=require(_0x7ca8('0x15'));var licenseUtil=require(_0x7ca8('0x16'));var db=require(_0x7ca8('0x17'))['db'];var dbH=require(_0x7ca8('0x17'))[_0x7ca8('0x18')];function respondWithStatusCode(_0x2fdc61,_0x21986b){_0x21986b=_0x21986b||0xcc;return function(_0x14f6bb){if(_0x14f6bb){return _0x2fdc61['sendStatus'](_0x21986b);}return _0x2fdc61[_0x7ca8('0x19')](_0x21986b)[_0x7ca8('0x1a')]();};}function respondWithResult(_0x34b8ca,_0x3a44bb){_0x3a44bb=_0x3a44bb||0xc8;return function(_0xddecef){if(_0xddecef){return _0x34b8ca[_0x7ca8('0x19')](_0x3a44bb)['json'](_0xddecef);}};}function respondWithFilteredResult(_0x15d67b,_0x29fccb){return function(_0x195c4e){if(_0x195c4e){var _0x541509=typeof _0x29fccb['offset']==='undefined'&&typeof _0x29fccb['limit']===_0x7ca8('0x1b');var _0x446612=_0x195c4e[_0x7ca8('0x1c')];var _0x1857d0=_0x541509?0x0:_0x29fccb[_0x7ca8('0x1d')];var _0x105bfb=_0x541509?_0x195c4e[_0x7ca8('0x1c')]:_0x29fccb[_0x7ca8('0x1d')]+_0x29fccb['limit'];var _0x443c83;if(_0x105bfb>=_0x446612){_0x105bfb=_0x446612;_0x443c83=0xc8;}else{_0x443c83=0xce;}_0x15d67b[_0x7ca8('0x19')](_0x443c83);return _0x15d67b['set']('Content-Range',_0x1857d0+'-'+_0x105bfb+'/'+_0x446612)[_0x7ca8('0x1e')](_0x195c4e);}return null;};}function patchUpdates(_0x5ab2d4){return function(_0x5ce9f4){try{jsonpatch[_0x7ca8('0x1f')](_0x5ce9f4,_0x5ab2d4,!![]);}catch(_0x45caa4){return BPromise['reject'](_0x45caa4);}return _0x5ce9f4[_0x7ca8('0x20')]();};}function saveUpdates(_0x4ebff6,_0x352ffa){return function(_0x340969){if(_0x340969){return _0x340969[_0x7ca8('0x21')](_0x4ebff6)['then'](function(_0x38115f){return _0x38115f;});}return null;};}function removeEntity(_0x5ecffe,_0x1eecfd){return function(_0x247a09){if(_0x247a09){return _0x247a09[_0x7ca8('0x22')]()[_0x7ca8('0x23')](function(){var _0xc23208=_0x247a09[_0x7ca8('0x24')]({'plain':!![]});var _0x37cd01='CustomReports';return db[_0x7ca8('0x25')][_0x7ca8('0x22')]({'where':{'type':_0x37cd01,'resourceId':_0xc23208['id']}})['then'](function(){return _0x247a09;});})[_0x7ca8('0x23')](function(){_0x5ecffe['status'](0xcc)[_0x7ca8('0x1a')]();});}};}function handleEntityNotFound(_0x56d448,_0x1ef11b){return function(_0x1f67f0){if(!_0x1f67f0){_0x56d448[_0x7ca8('0x26')](0x194);}return _0x1f67f0;};}function handleError(_0xccf768,_0x5ac69b){_0x5ac69b=_0x5ac69b||0x1f4;return function(_0x24b424){logger[_0x7ca8('0x27')](_0x24b424[_0x7ca8('0x28')]);if(_0x24b424[_0x7ca8('0x29')]){delete _0x24b424[_0x7ca8('0x29')];}_0xccf768['status'](_0x5ac69b)[_0x7ca8('0x2a')](_0x24b424);};}exports[_0x7ca8('0x2b')]=function(_0x197876,_0x1ae1ce){var _0x409beb={},_0x3128d1={},_0x36f9b5={'count':0x0,'rows':[]};var _0x50dbf2=_[_0x7ca8('0x2c')](db[_0x7ca8('0x2d')][_0x7ca8('0x2e')],function(_0x1f5d85){return{'name':_0x1f5d85[_0x7ca8('0x2f')],'type':_0x1f5d85['type']['key']};});_0x3128d1[_0x7ca8('0x30')]=_[_0x7ca8('0x2c')](_0x50dbf2,_0x7ca8('0x29'));_0x3128d1['query']=_['keys'](_0x197876[_0x7ca8('0x31')]);_0x3128d1[_0x7ca8('0x32')]=_[_0x7ca8('0x33')](_0x3128d1['model'],_0x3128d1[_0x7ca8('0x31')]);_0x409beb['attributes']=_[_0x7ca8('0x33')](_0x3128d1[_0x7ca8('0x30')],qs[_0x7ca8('0x34')](_0x197876[_0x7ca8('0x31')][_0x7ca8('0x34')]));_0x409beb[_0x7ca8('0x35')]=_0x409beb[_0x7ca8('0x35')][_0x7ca8('0x36')]?_0x409beb[_0x7ca8('0x35')]:_0x3128d1[_0x7ca8('0x30')];if(!_0x197876['query'][_0x7ca8('0x37')](_0x7ca8('0x38'))){_0x409beb[_0x7ca8('0x39')]=qs[_0x7ca8('0x39')](_0x197876[_0x7ca8('0x31')]['limit']);_0x409beb[_0x7ca8('0x1d')]=qs[_0x7ca8('0x1d')](_0x197876[_0x7ca8('0x31')]['offset']);}_0x409beb[_0x7ca8('0x3a')]=qs[_0x7ca8('0x3b')](_0x197876[_0x7ca8('0x31')][_0x7ca8('0x3b')]);_0x409beb['where']=qs[_0x7ca8('0x32')](_[_0x7ca8('0x3c')](_0x197876[_0x7ca8('0x31')],_0x3128d1[_0x7ca8('0x32')]),_0x50dbf2);if(_0x197876[_0x7ca8('0x31')][_0x7ca8('0x3d')]){_0x409beb[_0x7ca8('0x3e')]=_[_0x7ca8('0x3f')](_0x409beb[_0x7ca8('0x3e')],{'$or':_[_0x7ca8('0x2c')](_0x50dbf2,function(_0x2403a1){if(_0x2403a1[_0x7ca8('0x40')]!==_0x7ca8('0x41')){var _0x40e10e={};_0x40e10e[_0x2403a1[_0x7ca8('0x29')]]={'$like':'%'+_0x197876[_0x7ca8('0x31')]['filter']+'%'};return _0x40e10e;}})});}_0x409beb=_['merge']({},_0x409beb,_0x197876[_0x7ca8('0x42')]);var _0x4435e2={'where':_0x409beb['where']};return db['AnalyticCustomReport'][_0x7ca8('0x1c')](_0x4435e2)['then'](function(_0x4bda20){_0x36f9b5['count']=_0x4bda20;if(_0x197876['query'][_0x7ca8('0x43')]){_0x409beb[_0x7ca8('0x44')]=[{'all':!![]}];}return db[_0x7ca8('0x2d')][_0x7ca8('0x45')](_0x409beb);})['then'](function(_0x4af9cc){_0x36f9b5[_0x7ca8('0x46')]=_0x4af9cc;return _0x36f9b5;})[_0x7ca8('0x23')](respondWithFilteredResult(_0x1ae1ce,_0x409beb))[_0x7ca8('0x47')](handleError(_0x1ae1ce,null));};exports['show']=function(_0x5f152c,_0x308d56){var _0x26ae1d={'raw':![],'where':{'id':_0x5f152c['params']['id']}},_0x28fe63={};_0x28fe63['model']=_['keys'](db[_0x7ca8('0x2d')]['rawAttributes']);_0x28fe63[_0x7ca8('0x31')]=_['keys'](_0x5f152c[_0x7ca8('0x31')]);_0x28fe63[_0x7ca8('0x32')]=_[_0x7ca8('0x33')](_0x28fe63['model'],_0x28fe63['query']);_0x26ae1d[_0x7ca8('0x35')]=_[_0x7ca8('0x33')](_0x28fe63[_0x7ca8('0x30')],qs[_0x7ca8('0x34')](_0x5f152c['query']['fields']));_0x26ae1d[_0x7ca8('0x35')]=_0x26ae1d[_0x7ca8('0x35')][_0x7ca8('0x36')]?_0x26ae1d['attributes']:_0x28fe63[_0x7ca8('0x30')];if(_0x5f152c[_0x7ca8('0x31')][_0x7ca8('0x43')]){_0x26ae1d[_0x7ca8('0x44')]=[{'all':!![]}];}_0x26ae1d=_[_0x7ca8('0x3f')]({},_0x26ae1d,_0x5f152c[_0x7ca8('0x42')]);return db['AnalyticCustomReport']['find'](_0x26ae1d)[_0x7ca8('0x23')](handleEntityNotFound(_0x308d56,null))[_0x7ca8('0x23')](respondWithResult(_0x308d56,null))[_0x7ca8('0x47')](handleError(_0x308d56,null));};exports['create']=function(_0x1736a8,_0x13763f){return db[_0x7ca8('0x2d')][_0x7ca8('0x48')](_0x1736a8[_0x7ca8('0x49')],{})['then'](function(_0x3ed641){var _0x4cb92e=_0x1736a8[_0x7ca8('0x4a')][_0x7ca8('0x24')]({'plain':!![]});if(!_0x4cb92e)throw new Error(_0x7ca8('0x4b'));if(_0x4cb92e[_0x7ca8('0x4c')]==='user'){var _0x5b3399=_0x3ed641['get']({'plain':!![]});var _0x1a6407=_0x7ca8('0x4d');return db[_0x7ca8('0x4e')][_0x7ca8('0x4f')]({'where':{'name':_0x1a6407,'userProfileId':_0x4cb92e[_0x7ca8('0x50')]},'raw':!![]})[_0x7ca8('0x23')](function(_0x52424a){if(_0x52424a&&_0x52424a['autoAssociation']===0x0){return db[_0x7ca8('0x25')][_0x7ca8('0x48')]({'name':_0x5b3399[_0x7ca8('0x29')],'resourceId':_0x5b3399['id'],'type':'CustomReports','sectionId':_0x52424a['id']},{})['then'](function(){return _0x3ed641;});}else{return _0x3ed641;}})[_0x7ca8('0x47')](function(_0x383c22){logger[_0x7ca8('0x27')](_0x7ca8('0x51'),_0x383c22);throw _0x383c22;});}return _0x3ed641;})[_0x7ca8('0x23')](respondWithResult(_0x13763f,0xc9))[_0x7ca8('0x47')](handleError(_0x13763f,null));};exports['update']=function(_0x1fb5a6,_0x36f940){if(_0x1fb5a6[_0x7ca8('0x49')]['id']){delete _0x1fb5a6[_0x7ca8('0x49')]['id'];}return db[_0x7ca8('0x2d')][_0x7ca8('0x4f')]({'where':{'id':_0x1fb5a6['params']['id']}})[_0x7ca8('0x23')](handleEntityNotFound(_0x36f940,null))['then'](saveUpdates(_0x1fb5a6['body'],null))[_0x7ca8('0x23')](respondWithResult(_0x36f940,null))['catch'](handleError(_0x36f940,null));};exports['destroy']=function(_0x214cca,_0x3478c6){return db[_0x7ca8('0x2d')]['find']({'where':{'id':_0x214cca[_0x7ca8('0x52')]['id']}})['then'](handleEntityNotFound(_0x3478c6,null))[_0x7ca8('0x23')](removeEntity(_0x3478c6,null))[_0x7ca8('0x47')](handleError(_0x3478c6,null));};exports['preview']=function(_0x21568e,_0x4ef80e){var _0x2bf168=0xa;var _0x11714b=[_0x7ca8('0x53'),_0x7ca8('0x54'),_0x7ca8('0x55'),_0x7ca8('0x56')];var _0x240883={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x7ca8('0x57'),'MAX':_0x7ca8('0x58'),'MIN':_0x7ca8('0x59'),'AVG':_0x7ca8('0x5a'),'GROUP_CONCAT':_0x7ca8('0x5b'),'GROUP_CONCAT ASC':_0x7ca8('0x5c'),'GROUP_CONCAT DESC':_0x7ca8('0x5d')};var _0x57f453={'SEC_TO_TIME':_0x7ca8('0x5e'),'DATE':_0x7ca8('0x5f'),'HOUR':_0x7ca8('0x60'),'ROUND':_0x7ca8('0x61'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4919a0=function(_0x2b9077){return!_[_0x7ca8('0x62')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x7ca8('0x63'),_0x7ca8('0x64')],_0x2b9077);};var _0x2410dc=function(_0x2c600a){if(!_0x2c600a||!_0x2c600a[_0x7ca8('0x65')][_0x7ca8('0x36')]){return'';}for(var _0x474e78='(',_0x1b98b2=0x0;_0x1b98b2<_0x2c600a[_0x7ca8('0x65')][_0x7ca8('0x36')];_0x1b98b2+=0x1){_0x1b98b2>0x0&&(_0x474e78+='\x20'+_0x2c600a[_0x7ca8('0x66')]+'\x20');_0x474e78+=_0x2c600a[_0x7ca8('0x65')][_0x1b98b2][_0x7ca8('0x67')]?_0x2410dc(_0x2c600a[_0x7ca8('0x65')][_0x1b98b2][_0x7ca8('0x67')]):_0x2c600a['rules'][_0x1b98b2]['field']+'\x20'+_0x2c600a[_0x7ca8('0x65')][_0x1b98b2][_0x7ca8('0x68')]+(_0x4919a0(_0x2c600a['rules'][_0x1b98b2][_0x7ca8('0x68')])?'\x20'+_0x2c600a[_0x7ca8('0x65')][_0x1b98b2][_0x7ca8('0x69')]:'');}return _0x474e78+')';};var _0x3b195b={'where':{'id':_0x21568e['params']['id']}},_0x273a4a,_0x7e3de9,_0xe184dd,_0x17ef99,_0x732de6;_0x3b195b=_[_0x7ca8('0x3f')]({},_0x3b195b,_0x21568e[_0x7ca8('0x42')]);return db[_0x7ca8('0x2d')]['find'](_0x3b195b)['then'](function(_0x3d5488){if(_0x3d5488){_0x273a4a=_0x3d5488;return _0x3d5488[_0x7ca8('0x6a')]();}return null;})[_0x7ca8('0x23')](function(_0x5e5bee){if(_0x5e5bee){if(!_0x5e5bee[_0x7ca8('0x36')]){throw new db['Sequelize'][(_0x7ca8('0x6b'))](_0x7ca8('0x6c'),0x193);}_0x7e3de9=_0x5e5bee;return db[_0x7ca8('0x6d')][_0x7ca8('0x45')]({'raw':!![]});}return null;})[_0x7ca8('0x23')](function(_0xaeb74e){if(_0xaeb74e){_0xe184dd=_['keyBy'](_0xaeb74e,'id');var _0x1b21f0;var _0x57ee10=squel[_0x7ca8('0x6e')]();_0x57ee10[_0x7ca8('0x6f')](_0x273a4a[_0x7ca8('0x70')]);for(var _0x294854=0x0;_0x294854<_0x7e3de9['length'];_0x294854+=0x1){_0x1b21f0=_0x7e3de9[_0x294854][_0x7ca8('0x71')]?_0xe184dd[_0x7e3de9[_0x294854][_0x7ca8('0x71')]][_0x7ca8('0x72')]:_0x7e3de9[_0x294854][_0x7ca8('0x73')];_0x1b21f0=_0x7e3de9[_0x294854][_0x7ca8('0x74')]?_[_0x7ca8('0x75')](_0x240883[_0x7e3de9[_0x294854][_0x7ca8('0x74')]],'%s',_0x1b21f0):_0x1b21f0;_0x1b21f0=_0x7e3de9[_0x294854][_0x7ca8('0x76')]?_[_0x7ca8('0x75')](_0x57f453[_0x7e3de9[_0x294854]['format']],'%s',_0x1b21f0):_0x1b21f0;if(_0x7e3de9[_0x294854]['groupBy']){_0x57ee10[_0x7ca8('0x67')](_0x1b21f0);}_0x7e3de9[_0x294854]['orderBy']&&_0x57ee10[_0x7ca8('0x3a')](_0x1b21f0,_0x7e3de9[_0x294854][_0x7ca8('0x77')]===_0x7ca8('0x78')?![]:!![]);_0x57ee10[_0x7ca8('0x73')](_0x1b21f0,_0x7e3de9[_0x294854][_0x7ca8('0x79')]||_0x1b21f0);}if(_0x273a4a[_0x7ca8('0x7a')]){_0x273a4a['joins']=JSON['parse'](_0x273a4a['joins']);for(var _0x10c860=0x0;_0x10c860<_0x273a4a[_0x7ca8('0x7a')][_0x7ca8('0x36')];_0x10c860+=0x1){if(_0x273a4a[_0x7ca8('0x7a')][_0x10c860][_0x7ca8('0x40')]&&_[_0x7ca8('0x62')](_0x11714b,_0x273a4a[_0x7ca8('0x7a')][_0x10c860][_0x7ca8('0x40')])&&_0x273a4a[_0x7ca8('0x7a')][_0x10c860][_0x7ca8('0x7b')]&&_0x273a4a[_0x7ca8('0x7a')][_0x10c860][_0x7ca8('0x7c')]&&_0x273a4a['joins'][_0x10c860][_0x7ca8('0x7d')]){_0x57ee10[_0x273a4a[_0x7ca8('0x7a')][_0x10c860]['type']](_0x273a4a['joins'][_0x10c860][_0x7ca8('0x7c')],null,util[_0x7ca8('0x76')](_0x7ca8('0x7e'),_0x273a4a[_0x7ca8('0x70')],_0x273a4a[_0x7ca8('0x7a')][_0x10c860][_0x7ca8('0x7b')],_0x273a4a[_0x7ca8('0x7a')][_0x10c860][_0x7ca8('0x7c')],_0x273a4a[_0x7ca8('0x7a')][_0x10c860]['foreignKey']));}}}if(_0x273a4a[_0x7ca8('0x7f')]){_0x273a4a[_0x7ca8('0x7f')]=JSON[_0x7ca8('0x80')](_0x273a4a[_0x7ca8('0x7f')]);_0x57ee10[_0x7ca8('0x3e')](_0x2410dc(_0x273a4a[_0x7ca8('0x7f')][_0x7ca8('0x67')]));}_0x732de6=_0x57ee10['clone']();_0x57ee10[_0x7ca8('0x39')](_0x2bf168);_0x57ee10[_0x7ca8('0x1d')](0x0);logger[_0x7ca8('0x81')](_0x7ca8('0x82'),_0x57ee10[_0x7ca8('0x83')]());return dbH[_0x7ca8('0x84')]['query'](_0x57ee10[_0x7ca8('0x83')](),{'type':dbH[_0x7ca8('0x84')][_0x7ca8('0x85')]['SELECT']});}})[_0x7ca8('0x23')](respondWithResult(_0x4ef80e,null))[_0x7ca8('0x47')](handleError(_0x4ef80e,null));};function runReport(_0x3a4e93,_0x533fc5,_0x2a4d3b){var _0x19276b=_0x533fc5[_0x7ca8('0x29')];var _0x17d19a=0xa;var _0x1c6a32=[_0x7ca8('0x53'),_0x7ca8('0x54'),_0x7ca8('0x55'),'cross_join'];var _0x51e226={'SUM':_0x7ca8('0x86'),'COUNT':_0x7ca8('0x87'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7ca8('0x58'),'MIN':'MIN(%s)','AVG':_0x7ca8('0x5a'),'GROUP_CONCAT':_0x7ca8('0x5b'),'GROUP_CONCAT ASC':_0x7ca8('0x5c'),'GROUP_CONCAT DESC':_0x7ca8('0x5d')};var _0x188c35={'SEC_TO_TIME':_0x7ca8('0x5e'),'DATE':'DATE(%s)','HOUR':_0x7ca8('0x60'),'ROUND':_0x7ca8('0x61'),'UNIX_TIMESTAMP':_0x7ca8('0x88')};var _0x18a287=function(_0xba3d33){return!_[_0x7ca8('0x62')]([_0x7ca8('0x89'),_0x7ca8('0x8a'),_0x7ca8('0x63'),_0x7ca8('0x64')],_0xba3d33);};var _0x259cfd=function(_0x331725){if(!_0x331725||!_0x331725['rules'][_0x7ca8('0x36')]){return'';}for(var _0x32afbb='(',_0x23ea55=0x0;_0x23ea55<_0x331725[_0x7ca8('0x65')]['length'];_0x23ea55+=0x1){_0x23ea55>0x0&&(_0x32afbb+='\x20'+_0x331725[_0x7ca8('0x66')]+'\x20');_0x32afbb+=_0x331725['rules'][_0x23ea55][_0x7ca8('0x67')]?_0x259cfd(_0x331725['rules'][_0x23ea55][_0x7ca8('0x67')]):_0x331725[_0x7ca8('0x65')][_0x23ea55][_0x7ca8('0x73')]+'\x20'+_0x331725[_0x7ca8('0x65')][_0x23ea55][_0x7ca8('0x68')]+(_0x18a287(_0x331725[_0x7ca8('0x65')][_0x23ea55][_0x7ca8('0x68')])?'\x20'+_0x331725[_0x7ca8('0x65')][_0x23ea55][_0x7ca8('0x69')]:'');}return _0x32afbb+')';};var _0x19a175={'where':{'id':_0x3a4e93['id']}},_0x21eab0,_0x524080,_0x4ebe1a,_0x6b73ad,_0x4e9401;_0x19a175=_['merge']({},_0x19a175,_0x2a4d3b);return db[_0x7ca8('0x2d')][_0x7ca8('0x4f')](_0x19a175)[_0x7ca8('0x23')](function(_0x2467fb){if(_0x2467fb){_0x21eab0=_0x2467fb;return _0x2467fb[_0x7ca8('0x6a')]();}return null;})[_0x7ca8('0x23')](function(_0x29de7b){if(_0x29de7b){if(!_0x29de7b[_0x7ca8('0x36')]){throw new db['Sequelize'][(_0x7ca8('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x524080=_0x29de7b;return db[_0x7ca8('0x6d')]['findAll']({'raw':!![]});}return null;})[_0x7ca8('0x23')](function(_0x59c8aa){if(_0x59c8aa){_0x4ebe1a=_[_0x7ca8('0x8b')](_0x59c8aa,'id');var _0x5a9e3e;var _0x42ec5f=squel[_0x7ca8('0x6e')]();_0x42ec5f['from'](_0x21eab0[_0x7ca8('0x70')]);for(var _0x159fb2=0x0;_0x159fb2<_0x524080['length'];_0x159fb2+=0x1){_0x5a9e3e=_0x524080[_0x159fb2]['MetricId']?_0x4ebe1a[_0x524080[_0x159fb2]['MetricId']][_0x7ca8('0x72')]:_0x524080[_0x159fb2][_0x7ca8('0x73')];_0x5a9e3e=_0x524080[_0x159fb2][_0x7ca8('0x74')]?_[_0x7ca8('0x75')](_0x51e226[_0x524080[_0x159fb2]['function']],'%s',_0x5a9e3e):_0x5a9e3e;_0x5a9e3e=_0x524080[_0x159fb2][_0x7ca8('0x76')]?_['replace'](_0x188c35[_0x524080[_0x159fb2][_0x7ca8('0x76')]],'%s',_0x5a9e3e):_0x5a9e3e;if(_0x524080[_0x159fb2][_0x7ca8('0x8c')]){_0x42ec5f['group'](_0x5a9e3e);}_0x524080[_0x159fb2]['orderBy']&&_0x42ec5f[_0x7ca8('0x3a')](_0x5a9e3e,_0x524080[_0x159fb2][_0x7ca8('0x77')]===_0x7ca8('0x78')?![]:!![]);_0x42ec5f[_0x7ca8('0x73')](_0x5a9e3e,_0x524080[_0x159fb2][_0x7ca8('0x79')]||_0x5a9e3e);}if(_0x21eab0['joins']){_0x21eab0[_0x7ca8('0x7a')]=JSON[_0x7ca8('0x80')](_0x21eab0[_0x7ca8('0x7a')]);for(var _0x40ffef=0x0;_0x40ffef<_0x21eab0[_0x7ca8('0x7a')][_0x7ca8('0x36')];_0x40ffef+=0x1){if(_0x21eab0[_0x7ca8('0x7a')][_0x40ffef][_0x7ca8('0x40')]&&_[_0x7ca8('0x62')](_0x1c6a32,_0x21eab0[_0x7ca8('0x7a')][_0x40ffef][_0x7ca8('0x40')])&&_0x21eab0[_0x7ca8('0x7a')][_0x40ffef]['parentKey']&&_0x21eab0[_0x7ca8('0x7a')][_0x40ffef][_0x7ca8('0x7c')]&&_0x21eab0['joins'][_0x40ffef][_0x7ca8('0x7d')]){_0x42ec5f[_0x21eab0[_0x7ca8('0x7a')][_0x40ffef][_0x7ca8('0x40')]](_0x21eab0[_0x7ca8('0x7a')][_0x40ffef][_0x7ca8('0x7c')],null,util[_0x7ca8('0x76')](_0x7ca8('0x7e'),_0x21eab0['table'],_0x21eab0[_0x7ca8('0x7a')][_0x40ffef][_0x7ca8('0x7b')],_0x21eab0['joins'][_0x40ffef][_0x7ca8('0x7c')],_0x21eab0[_0x7ca8('0x7a')][_0x40ffef]['foreignKey']));}}}if(_0x21eab0[_0x7ca8('0x7f')]){_0x21eab0[_0x7ca8('0x7f')]=JSON[_0x7ca8('0x80')](_0x21eab0['conditions']);_0x42ec5f[_0x7ca8('0x3e')](_0x259cfd(_0x21eab0[_0x7ca8('0x7f')][_0x7ca8('0x67')]));}_0x4e9401=_0x42ec5f[_0x7ca8('0x8d')]();_0x42ec5f[_0x7ca8('0x39')](_0x17d19a);_0x42ec5f[_0x7ca8('0x1d')](0x0);return;}})[_0x7ca8('0x23')](function(){if(_0x533fc5[_0x7ca8('0x8e')]===_0x7ca8('0x8f')){return null;}var _0x4aa5c6=_[_0x7ca8('0x3f')](_0x533fc5,{'name':_0x533fc5['fullPath']||_0x533fc5[_0x7ca8('0x29')]||_0x21eab0['name'],'basename':_0x19276b,'savename':util[_0x7ca8('0x76')](_0x7ca8('0x90'),_0x533fc5[_0x7ca8('0x29')]||_0x21eab0['name'],require('randomstring')[_0x7ca8('0x91')](0x4),_0x533fc5[_0x7ca8('0x8e')]||_0x7ca8('0x92')),'reportId':_0x21eab0['id'],'reportType':_0x7ca8('0x93')});return db[_0x7ca8('0x94')][_0x7ca8('0x48')](_0x4aa5c6,{'raw':!![]});})[_0x7ca8('0x23')](function(_0x2c341f){if(_0x21eab0[_0x7ca8('0x70')]===_0x7ca8('0x95')){_0x4e9401['where'](_0x21eab0['table']+_0x7ca8('0x96'),_0x533fc5[_0x7ca8('0x97')],_0x533fc5['endDate']);}else{_0x4e9401[_0x7ca8('0x3e')](_0x21eab0[_0x7ca8('0x70')]+_0x7ca8('0x98'),_0x533fc5[_0x7ca8('0x97')],_0x533fc5[_0x7ca8('0x99')]);}if(_0x2c341f){logger['info'](_0x7ca8('0x9a'),_0x4e9401[_0x7ca8('0x83')]());require('child_process')[_0x7ca8('0x9b')](path['join'](__dirname,_0x7ca8('0x9c'),_0x2c341f[_0x7ca8('0x8e')]),[_0x2c341f['id'],_0x4e9401[_0x7ca8('0x83')](),path[_0x7ca8('0x53')](__dirname,_0x7ca8('0x9d'),_0x2c341f['savename']),_0x19276b]);return _0x2c341f;}else{var _0x55c70b=squel[_0x7ca8('0x6e')]();_0x55c70b[_0x7ca8('0x6f')]('('+_0x4e9401[_0x7ca8('0x83')]()+')','countTable');_0x55c70b[_0x7ca8('0x73')](_0x7ca8('0x9e'),_0x7ca8('0x1c'));_0x4e9401[_0x7ca8('0x39')](_0x533fc5[_0x7ca8('0x39')]||_0x17d19a);_0x4e9401['offset'](_0x533fc5[_0x7ca8('0x1d')]||0x0);return dbH[_0x7ca8('0x84')][_0x7ca8('0x31')](_0x55c70b['toString'](),{'type':dbH[_0x7ca8('0x84')][_0x7ca8('0x85')][_0x7ca8('0x9f')]})[_0x7ca8('0x23')](function(_0x4cd8df){if(!_0x4cd8df[_0x7ca8('0x36')]){_0x6b73ad=0x0;}else{_0x6b73ad=_0x4cd8df[0x0]['count']||0x0;}return dbH[_0x7ca8('0x84')][_0x7ca8('0x31')](_0x4e9401['toString'](),{'type':dbH[_0x7ca8('0x84')]['QueryTypes'][_0x7ca8('0x9f')]});})[_0x7ca8('0x23')](function(_0x44ea9b){return{'rows':_0x44ea9b||[],'count':_0x6b73ad};});}});}exports['run']=function(_0x23ce28,_0x1ac859){return runReport(_0x23ce28[_0x7ca8('0x52')],_0x23ce28['query'],_0x23ce28[_0x7ca8('0x42')])[_0x7ca8('0x23')](respondWithResult(_0x1ac859,null))[_0x7ca8('0x47')](handleError(_0x1ac859,null));};exports[_0x7ca8('0xa0')]=runReport;exports[_0x7ca8('0x31')]=function(_0x30b651,_0x223440){var _0x1175c9=0xa;var _0x120c8b=['join',_0x7ca8('0x54'),_0x7ca8('0x55'),_0x7ca8('0x56')];var _0x5b4ef2={'SUM':_0x7ca8('0x86'),'COUNT':_0x7ca8('0x87'),'COUNT DISTINCT':_0x7ca8('0x57'),'MAX':_0x7ca8('0x58'),'MIN':_0x7ca8('0x59'),'AVG':_0x7ca8('0x5a'),'GROUP_CONCAT':_0x7ca8('0x5b'),'GROUP_CONCAT ASC':_0x7ca8('0x5c'),'GROUP_CONCAT DESC':_0x7ca8('0x5d')};var _0x27663f={'SEC_TO_TIME':_0x7ca8('0x5e'),'DATE':_0x7ca8('0x5f'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x7ca8('0x88')};var _0x57df96=function(_0x11dca9){return!_[_0x7ca8('0x62')]([_0x7ca8('0x89'),_0x7ca8('0x8a'),'IS\x20EMPTY',_0x7ca8('0x64')],_0x11dca9);};var _0x5967c5=function(_0x460300){if(!_0x460300||!_0x460300['rules'][_0x7ca8('0x36')]){return'';}for(var _0x1931d6='(',_0xb9952d=0x0;_0xb9952d<_0x460300[_0x7ca8('0x65')][_0x7ca8('0x36')];_0xb9952d+=0x1){_0xb9952d>0x0&&(_0x1931d6+='\x20'+_0x460300[_0x7ca8('0x66')]+'\x20');_0x1931d6+=_0x460300[_0x7ca8('0x65')][_0xb9952d][_0x7ca8('0x67')]?_0x5967c5(_0x460300[_0x7ca8('0x65')][_0xb9952d][_0x7ca8('0x67')]):_0x460300[_0x7ca8('0x65')][_0xb9952d][_0x7ca8('0x73')]+'\x20'+_0x460300['rules'][_0xb9952d]['condition']+(_0x57df96(_0x460300[_0x7ca8('0x65')][_0xb9952d][_0x7ca8('0x68')])?'\x20'+_0x460300[_0x7ca8('0x65')][_0xb9952d][_0x7ca8('0x69')]:'');}return _0x1931d6+')';};var _0x10f34a={'where':{'id':_0x30b651[_0x7ca8('0x52')]['id']}},_0x5052b0,_0x26bed6,_0x16007f,_0x202fee,_0x408265;_0x10f34a=_['merge']({},_0x10f34a,_0x30b651[_0x7ca8('0x42')]);return db[_0x7ca8('0x2d')]['find'](_0x10f34a)[_0x7ca8('0x23')](function(_0x872980){if(_0x872980){_0x5052b0=_0x872980;return _0x872980[_0x7ca8('0x6a')]();}return null;})['then'](function(_0x5731b1){if(_0x5731b1){if(!_0x5731b1[_0x7ca8('0x36')]){throw new db[(_0x7ca8('0xa1'))][(_0x7ca8('0x6b'))](_0x7ca8('0x6c'),0x193);}_0x26bed6=_0x5731b1;return db[_0x7ca8('0x6d')][_0x7ca8('0x45')]({'raw':!![]});}return null;})[_0x7ca8('0x23')](function(_0x2cc49d){if(_0x2cc49d){_0x16007f=_['keyBy'](_0x2cc49d,'id');var _0x5e708d;var _0x168701=squel['select']();_0x168701[_0x7ca8('0x6f')](_0x5052b0[_0x7ca8('0x70')]);for(var _0x9c5da=0x0;_0x9c5da<_0x26bed6[_0x7ca8('0x36')];_0x9c5da+=0x1){_0x5e708d=_0x26bed6[_0x9c5da][_0x7ca8('0x71')]?_0x16007f[_0x26bed6[_0x9c5da][_0x7ca8('0x71')]][_0x7ca8('0x72')]:_0x26bed6[_0x9c5da][_0x7ca8('0x73')];_0x5e708d=_0x26bed6[_0x9c5da][_0x7ca8('0x74')]?_['replace'](_0x5b4ef2[_0x26bed6[_0x9c5da][_0x7ca8('0x74')]],'%s',_0x5e708d):_0x5e708d;_0x5e708d=_0x26bed6[_0x9c5da][_0x7ca8('0x76')]?_[_0x7ca8('0x75')](_0x27663f[_0x26bed6[_0x9c5da]['format']],'%s',_0x5e708d):_0x5e708d;if(_0x26bed6[_0x9c5da][_0x7ca8('0x8c')]){_0x168701[_0x7ca8('0x67')](_0x5e708d);}_0x26bed6[_0x9c5da][_0x7ca8('0x77')]&&_0x168701[_0x7ca8('0x3a')](_0x5e708d,_0x26bed6[_0x9c5da]['orderBy']===_0x7ca8('0x78')?![]:!![]);_0x168701[_0x7ca8('0x73')](_0x5e708d,_0x26bed6[_0x9c5da][_0x7ca8('0x79')]||_0x5e708d);}if(_0x5052b0[_0x7ca8('0x7a')]){_0x5052b0[_0x7ca8('0x7a')]=JSON[_0x7ca8('0x80')](_0x5052b0[_0x7ca8('0x7a')]);for(var _0x4af899=0x0;_0x4af899<_0x5052b0['joins'][_0x7ca8('0x36')];_0x4af899+=0x1){if(_0x5052b0['joins'][_0x4af899][_0x7ca8('0x40')]&&_['includes'](_0x120c8b,_0x5052b0['joins'][_0x4af899]['type'])&&_0x5052b0[_0x7ca8('0x7a')][_0x4af899][_0x7ca8('0x7b')]&&_0x5052b0[_0x7ca8('0x7a')][_0x4af899]['foreignTable']&&_0x5052b0[_0x7ca8('0x7a')][_0x4af899]['foreignKey']){_0x168701[_0x5052b0[_0x7ca8('0x7a')][_0x4af899][_0x7ca8('0x40')]](_0x5052b0[_0x7ca8('0x7a')][_0x4af899]['foreignTable'],null,util[_0x7ca8('0x76')]('%s.%s\x20=\x20%s.%s',_0x5052b0['table'],_0x5052b0['joins'][_0x4af899][_0x7ca8('0x7b')],_0x5052b0['joins'][_0x4af899]['foreignTable'],_0x5052b0['joins'][_0x4af899][_0x7ca8('0x7d')]));}}}if(_0x5052b0[_0x7ca8('0x7f')]){_0x5052b0['conditions']=JSON[_0x7ca8('0x80')](_0x5052b0[_0x7ca8('0x7f')]);_0x168701[_0x7ca8('0x3e')](_0x5967c5(_0x5052b0['conditions'][_0x7ca8('0x67')]));}_0x408265=_0x168701[_0x7ca8('0x8d')]();_0x168701[_0x7ca8('0x39')](_0x1175c9);_0x168701[_0x7ca8('0x1d')](0x0);logger[_0x7ca8('0x81')]('Limited\x20Query:',_0x168701[_0x7ca8('0x83')]());return dbH[_0x7ca8('0x84')][_0x7ca8('0x31')](_0x168701[_0x7ca8('0x83')](),{'type':dbH[_0x7ca8('0x84')][_0x7ca8('0x85')][_0x7ca8('0x9f')]});}})[_0x7ca8('0x23')](function(){return{'sql':_0x408265[_0x7ca8('0x83')]()};})[_0x7ca8('0x23')](respondWithResult(_0x223440,null))[_0x7ca8('0x47')](handleError(_0x223440,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index b730b01..6d52a84 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 _0x322d=['analytics_custom_reports','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','AnalyticCustomReport'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x322d,0x121));var _0xd322=function(_0x39346a,_0x5c3ed1){_0x39346a=_0x39346a-0x0;var _0x335564=_0x322d[_0x39346a];return _0x335564;};'use strict';var _=require(_0xd322('0x0'));var util=require('util');var logger=require(_0xd322('0x1'))('api');var moment=require(_0xd322('0x2'));var BPromise=require(_0xd322('0x3'));var rp=require(_0xd322('0x4'));var fs=require('fs');var path=require(_0xd322('0x5'));var rimraf=require(_0xd322('0x6'));var config=require(_0xd322('0x7'));var attributes=require(_0xd322('0x8'));module[_0xd322('0x9')]=function(_0x582a6d,_0x11c722){return _0x582a6d['define'](_0xd322('0xa'),attributes,{'tableName':_0xd322('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x04da=['AnalyticCustomReport','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define'];(function(_0x3a0579,_0x17d535){var _0xa6faf3=function(_0x17a11b){while(--_0x17a11b){_0x3a0579['push'](_0x3a0579['shift']());}};_0xa6faf3(++_0x17d535);}(_0x04da,0xf8));var _0xa04d=function(_0x11ba46,_0x1d6752){_0x11ba46=_0x11ba46-0x0;var _0x1c8c6f=_0x04da[_0x11ba46];return _0x1c8c6f;};'use strict';var _=require(_0xa04d('0x0'));var util=require(_0xa04d('0x1'));var logger=require(_0xa04d('0x2'))(_0xa04d('0x3'));var moment=require('moment');var BPromise=require(_0xa04d('0x4'));var rp=require(_0xa04d('0x5'));var fs=require('fs');var path=require(_0xa04d('0x6'));var rimraf=require(_0xa04d('0x7'));var config=require(_0xa04d('0x8'));var attributes=require(_0xa04d('0x9'));module[_0xa04d('0xa')]=function(_0x1ebe7d,_0x17dd87){return _0x1ebe7d[_0xa04d('0xb')](_0xa04d('0xc'),attributes,{'tableName':'analytics_custom_reports','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 929d86c..9151b74 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 _0x4de0=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x737a1f,_0x235fef){var _0x16eba1=function(_0x292aa8){while(--_0x292aa8){_0x737a1f['push'](_0x737a1f['shift']());}};_0x16eba1(++_0x235fef);}(_0x4de0,0x180));var _0x04de=function(_0xce23fd,_0x11e801){_0xce23fd=_0xce23fd-0x0;var _0x29f125=_0x4de0[_0xce23fd];return _0x29f125;};'use strict';var _=require(_0x04de('0x0'));var util=require(_0x04de('0x1'));var moment=require(_0x04de('0x2'));var BPromise=require(_0x04de('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x04de('0x4'));var db=require(_0x04de('0x5'))['db'];var utils=require(_0x04de('0x6'));var logger=require(_0x04de('0x7'))(_0x04de('0x8'));var config=require(_0x04de('0x9'));var jayson=require(_0x04de('0xa'));var client=jayson[_0x04de('0xb')][_0x04de('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x385a2e,_0x4e696d,_0x30f2d0){return new BPromise(function(_0x1b9363,_0x5aca32){return client['request'](_0x385a2e,_0x30f2d0)[_0x04de('0xd')](function(_0x12e636){logger[_0x04de('0xe')](_0x04de('0xf'),_0x4e696d,_0x04de('0x10'));logger['debug'](_0x04de('0x11'),_0x4e696d,_0x04de('0x10'),JSON[_0x04de('0x12')](_0x12e636));if(_0x12e636[_0x04de('0x13')]){if(_0x12e636[_0x04de('0x13')][_0x04de('0x14')]===0x1f4){logger['error'](_0x04de('0xf'),_0x4e696d,_0x12e636['error'][_0x04de('0x15')]);return _0x5aca32(_0x12e636[_0x04de('0x13')][_0x04de('0x15')]);}logger[_0x04de('0x13')](_0x04de('0xf'),_0x4e696d,_0x12e636[_0x04de('0x13')][_0x04de('0x15')]);return _0x1b9363(_0x12e636[_0x04de('0x13')][_0x04de('0x15')]);}else{logger[_0x04de('0xe')](_0x04de('0xf'),_0x4e696d,_0x04de('0x10'));_0x1b9363(_0x12e636[_0x04de('0x16')][_0x04de('0x15')]);}})[_0x04de('0x17')](function(_0x296f0e){logger[_0x04de('0x13')](_0x04de('0xf'),_0x4e696d,_0x296f0e);_0x5aca32(_0x296f0e);});});} \ No newline at end of file +var _0x6cfc=['message','request\x20sent','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x434010,_0x591dd5){var _0x37cab1=function(_0x4fab0b){while(--_0x4fab0b){_0x434010['push'](_0x434010['shift']());}};_0x37cab1(++_0x591dd5);}(_0x6cfc,0x18b));var _0xc6cf=function(_0x1ad926,_0x3e1fed){_0x1ad926=_0x1ad926-0x0;var _0x1b81dc=_0x6cfc[_0x1ad926];return _0x1b81dc;};'use strict';var _=require(_0xc6cf('0x0'));var util=require(_0xc6cf('0x1'));var moment=require(_0xc6cf('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc6cf('0x3'));var db=require(_0xc6cf('0x4'))['db'];var utils=require(_0xc6cf('0x5'));var logger=require(_0xc6cf('0x6'))(_0xc6cf('0x7'));var config=require('../../config/environment');var jayson=require(_0xc6cf('0x8'));var client=jayson[_0xc6cf('0x9')][_0xc6cf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1cefb6,_0x41376c,_0x373a27){return new BPromise(function(_0x1b8c21,_0x4d98f9){return client[_0xc6cf('0xb')](_0x1cefb6,_0x373a27)['then'](function(_0xe7c29d){logger[_0xc6cf('0xc')](_0xc6cf('0xd'),_0x41376c,'request\x20sent');logger[_0xc6cf('0xe')](_0xc6cf('0xf'),_0x41376c,'request\x20sent',JSON[_0xc6cf('0x10')](_0xe7c29d));if(_0xe7c29d[_0xc6cf('0x11')]){if(_0xe7c29d['error'][_0xc6cf('0x12')]===0x1f4){logger['error'](_0xc6cf('0xd'),_0x41376c,_0xe7c29d[_0xc6cf('0x11')][_0xc6cf('0x13')]);return _0x4d98f9(_0xe7c29d[_0xc6cf('0x11')][_0xc6cf('0x13')]);}logger[_0xc6cf('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x41376c,_0xe7c29d[_0xc6cf('0x11')]['message']);return _0x1b8c21(_0xe7c29d[_0xc6cf('0x11')]['message']);}else{logger['info'](_0xc6cf('0xd'),_0x41376c,_0xc6cf('0x14'));_0x1b8c21(_0xe7c29d[_0xc6cf('0x15')][_0xc6cf('0x13')]);}})[_0xc6cf('0x16')](function(_0x54c3ce){logger[_0xc6cf('0x11')](_0xc6cf('0xd'),_0x41376c,_0x54c3ce);_0x4d98f9(_0x54c3ce);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index dc62c52..4009484 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 _0x550b=['/:id','show','preview','/:id/query','query','post','create','update','destroy','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','get'];(function(_0x196e76,_0xf6c4e0){var _0x3c2f0a=function(_0x102d58){while(--_0x102d58){_0x196e76['push'](_0x196e76['shift']());}};_0x3c2f0a(++_0xf6c4e0);}(_0x550b,0x149));var _0xb550=function(_0x67f95e,_0x3ca797){_0x67f95e=_0x67f95e-0x0;var _0x538f5a=_0x550b[_0x67f95e];return _0x538f5a;};'use strict';var multer=require(_0xb550('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb550('0x1'));var router=express[_0xb550('0x2')]();var fs_extra=require(_0xb550('0x3'));var auth=require(_0xb550('0x4'));var interaction=require(_0xb550('0x5'));var config=require(_0xb550('0x6'));var controller=require(_0xb550('0x7'));router['get']('/',auth[_0xb550('0x8')](),controller[_0xb550('0x9')]);router[_0xb550('0xa')](_0xb550('0xb'),auth[_0xb550('0x8')](),controller[_0xb550('0xc')]);router[_0xb550('0xa')]('/:id/preview',auth['isAuthenticated'](),controller[_0xb550('0xd')]);router[_0xb550('0xa')]('/:id/run',auth[_0xb550('0x8')](),controller['run']);router['get'](_0xb550('0xe'),auth['isAuthenticated'](),controller[_0xb550('0xf')]);router[_0xb550('0x10')]('/',auth[_0xb550('0x8')](),controller[_0xb550('0x11')]);router['put']('/:id',auth[_0xb550('0x8')](),controller[_0xb550('0x12')]);router['delete'](_0xb550('0xb'),auth[_0xb550('0x8')](),controller[_0xb550('0x13')]);module['exports']=router; \ No newline at end of file +var _0x053a=['/:id','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','get','show','/:id/preview','/:id/run','run','/:id/query','query','create','put'];(function(_0x9976e1,_0x4cf78e){var _0x265fdc=function(_0x4dce7d){while(--_0x4dce7d){_0x9976e1['push'](_0x9976e1['shift']());}};_0x265fdc(++_0x4cf78e);}(_0x053a,0x146));var _0xa053=function(_0x259b6f,_0x1fd325){_0x259b6f=_0x259b6f-0x0;var _0x3cdefe=_0x053a[_0x259b6f];return _0x3cdefe;};'use strict';var multer=require('multer');var util=require(_0xa053('0x0'));var path=require(_0xa053('0x1'));var timeout=require(_0xa053('0x2'));var express=require(_0xa053('0x3'));var router=express[_0xa053('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa053('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa053('0x6'));var controller=require(_0xa053('0x7'));router['get']('/',auth[_0xa053('0x8')](),controller[_0xa053('0x9')]);router[_0xa053('0xa')]('/:id',auth[_0xa053('0x8')](),controller[_0xa053('0xb')]);router['get'](_0xa053('0xc'),auth[_0xa053('0x8')](),controller['preview']);router[_0xa053('0xa')](_0xa053('0xd'),auth['isAuthenticated'](),controller[_0xa053('0xe')]);router[_0xa053('0xa')](_0xa053('0xf'),auth[_0xa053('0x8')](),controller[_0xa053('0x10')]);router['post']('/',auth[_0xa053('0x8')](),controller[_0xa053('0x11')]);router[_0xa053('0x12')](_0xa053('0x13'),auth[_0xa053('0x8')](),controller['update']);router[_0xa053('0x14')](_0xa053('0x13'),auth[_0xa053('0x8')](),controller[_0xa053('0x15')]);module[_0xa053('0x16')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 55dcc97..015f62c 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 _0x6f47=['TEXT','exports','STRING'];(function(_0x9fd79e,_0x3bcc82){var _0xde794f=function(_0x15dfbe){while(--_0x15dfbe){_0x9fd79e['push'](_0x9fd79e['shift']());}};_0xde794f(++_0x3bcc82);}(_0x6f47,0xc7));var _0x76f4=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x6f47[_0x45d3f0];return _0x314b79;};'use strict';var Sequelize=require('sequelize');module[_0x76f4('0x0')]={'name':{'type':Sequelize[_0x76f4('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x76f4('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x76f4('0x2')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x7217=['sequelize','STRING','TEXT'];(function(_0x4597c4,_0x15fc2d){var _0x45674f=function(_0x3cf7a0){while(--_0x3cf7a0){_0x4597c4['push'](_0x4597c4['shift']());}};_0x45674f(++_0x15fc2d);}(_0x7217,0x19e));var _0x7721=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0x7217[_0x3899d1];return _0xeb4a7d;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'name':{'type':Sequelize[_0x7721('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7721('0x1')]},'parent':{'type':Sequelize[_0x7721('0x1')]},'table':{'type':Sequelize[_0x7721('0x1')]},'conditions':{'type':Sequelize[_0x7721('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 c9eccbc..d036492 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 _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(_0x2d2f17,_0x2bd8a9){var _0x5a49ae=function(_0x1383d2){while(--_0x1383d2){_0x2d2f17['push'](_0x2d2f17['shift']());}};_0x5a49ae(++_0x2bd8a9);}(_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 +var _0xba34=['save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','create','body','user','role','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','COUNT(%s)','AVG(%s)','IS\x20NOT\x20NULL','value','order','output','%s-%s.%s','randomstring','generate','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','fork','countTable','QueryTypes','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','Please\x20insert\x20at\x20least\x20one\x20field','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject'];(function(_0x3d78b5,_0x4936ed){var _0x380d7b=function(_0x1b7bf8){while(--_0x1b7bf8){_0x3d78b5['push'](_0x3d78b5['shift']());}};_0x380d7b(++_0x4936ed);}(_0xba34,0x119));var _0x4ba3=function(_0x41010d,_0x3cf8af){_0x41010d=_0x41010d-0x0;var _0xc5383e=_0xba34[_0x41010d];return _0xc5383e;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];var dbH=require(_0x4ba3('0x19'))['dbH'];function respondWithStatusCode(_0x256f02,_0x4419b4){_0x4419b4=_0x4419b4||0xcc;return function(_0x29e498){if(_0x29e498){return _0x256f02[_0x4ba3('0x1a')](_0x4419b4);}return _0x256f02[_0x4ba3('0x1b')](_0x4419b4)[_0x4ba3('0x1c')]();};}function respondWithResult(_0x3a74f7,_0x12ac90){_0x12ac90=_0x12ac90||0xc8;return function(_0x1dec48){if(_0x1dec48){return _0x3a74f7[_0x4ba3('0x1b')](_0x12ac90)[_0x4ba3('0x1d')](_0x1dec48);}};}function respondWithFilteredResult(_0x301359,_0x29a9d1){return function(_0x25f584){if(_0x25f584){var _0x40e75b=typeof _0x29a9d1[_0x4ba3('0x1e')]==='undefined'&&typeof _0x29a9d1[_0x4ba3('0x1f')]===_0x4ba3('0x20');var _0x5ff7ce=_0x25f584[_0x4ba3('0x21')];var _0x556290=_0x40e75b?0x0:_0x29a9d1[_0x4ba3('0x1e')];var _0xe4eff9=_0x40e75b?_0x25f584[_0x4ba3('0x21')]:_0x29a9d1[_0x4ba3('0x1e')]+_0x29a9d1[_0x4ba3('0x1f')];var _0x125944;if(_0xe4eff9>=_0x5ff7ce){_0xe4eff9=_0x5ff7ce;_0x125944=0xc8;}else{_0x125944=0xce;}_0x301359['status'](_0x125944);return _0x301359['set'](_0x4ba3('0x22'),_0x556290+'-'+_0xe4eff9+'/'+_0x5ff7ce)['json'](_0x25f584);}return null;};}function patchUpdates(_0x18dff5){return function(_0x163967){try{jsonpatch[_0x4ba3('0x23')](_0x163967,_0x18dff5,!![]);}catch(_0xbc7023){return BPromise[_0x4ba3('0x24')](_0xbc7023);}return _0x163967[_0x4ba3('0x25')]();};}function saveUpdates(_0x4a0823,_0x143c78){return function(_0x1f87e1){if(_0x1f87e1){return _0x1f87e1['update'](_0x4a0823)[_0x4ba3('0x26')](function(_0x4ffe39){return _0x4ffe39;});}return null;};}function removeEntity(_0x1ae4de,_0x18abb3){return function(_0x11a917){if(_0x11a917){return _0x11a917[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){var _0xe29a49=_0x11a917[_0x4ba3('0x28')]({'plain':!![]});var _0xe1f7d2=_0x4ba3('0x29');return db[_0x4ba3('0x2a')]['destroy']({'where':{'type':_0xe1f7d2,'resourceId':_0xe29a49['id']}})[_0x4ba3('0x26')](function(){return _0x11a917;});})[_0x4ba3('0x26')](function(){_0x1ae4de[_0x4ba3('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10537e,_0x1fe5e2){return function(_0x44d78c){if(!_0x44d78c){_0x10537e['sendStatus'](0x194);}return _0x44d78c;};}function handleError(_0x10cae6,_0x843276){_0x843276=_0x843276||0x1f4;return function(_0x34ecb4){logger[_0x4ba3('0x2b')](_0x34ecb4['stack']);if(_0x34ecb4['name']){delete _0x34ecb4[_0x4ba3('0x2c')];}_0x10cae6[_0x4ba3('0x1b')](_0x843276)[_0x4ba3('0x2d')](_0x34ecb4);};}exports[_0x4ba3('0x2e')]=function(_0x2cb5d5,_0x11f88f){var _0x48b3b7={},_0x27444b={},_0x28f36c={'count':0x0,'rows':[]};var _0x24d8fc=_[_0x4ba3('0x2f')](db[_0x4ba3('0x30')][_0x4ba3('0x31')],function(_0x457236){return{'name':_0x457236[_0x4ba3('0x32')],'type':_0x457236[_0x4ba3('0x33')][_0x4ba3('0x34')]};});_0x27444b['model']=_['map'](_0x24d8fc,'name');_0x27444b[_0x4ba3('0x35')]=_[_0x4ba3('0x36')](_0x2cb5d5[_0x4ba3('0x35')]);_0x27444b[_0x4ba3('0x37')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],_0x27444b[_0x4ba3('0x35')]);_0x48b3b7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x2cb5d5[_0x4ba3('0x35')]['fields']));_0x48b3b7[_0x4ba3('0x3a')]=_0x48b3b7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x48b3b7['attributes']:_0x27444b[_0x4ba3('0x39')];if(!_0x2cb5d5['query'][_0x4ba3('0x3d')](_0x4ba3('0x3e'))){_0x48b3b7[_0x4ba3('0x1f')]=qs[_0x4ba3('0x1f')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1f')]);_0x48b3b7['offset']=qs[_0x4ba3('0x1e')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1e')]);}_0x48b3b7['order']=qs[_0x4ba3('0x3f')](_0x2cb5d5[_0x4ba3('0x35')]['sort']);_0x48b3b7[_0x4ba3('0x40')]=qs['filters'](_['pick'](_0x2cb5d5[_0x4ba3('0x35')],_0x27444b[_0x4ba3('0x37')]),_0x24d8fc);if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x41')]){_0x48b3b7[_0x4ba3('0x40')]=_['merge'](_0x48b3b7[_0x4ba3('0x40')],{'$or':_[_0x4ba3('0x2f')](_0x24d8fc,function(_0x46d2ca){if(_0x46d2ca[_0x4ba3('0x33')]!==_0x4ba3('0x42')){var _0x2acc92={};_0x2acc92[_0x46d2ca[_0x4ba3('0x2c')]]={'$like':'%'+_0x2cb5d5[_0x4ba3('0x35')]['filter']+'%'};return _0x2acc92;}})});}_0x48b3b7=_[_0x4ba3('0x43')]({},_0x48b3b7,_0x2cb5d5[_0x4ba3('0x44')]);var _0x3cb07f={'where':_0x48b3b7[_0x4ba3('0x40')]};return db[_0x4ba3('0x30')][_0x4ba3('0x21')](_0x3cb07f)[_0x4ba3('0x26')](function(_0xdcc2a2){_0x28f36c[_0x4ba3('0x21')]=_0xdcc2a2;if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x45')]){_0x48b3b7[_0x4ba3('0x46')]=[{'all':!![]}];}return db[_0x4ba3('0x30')][_0x4ba3('0x47')](_0x48b3b7);})['then'](function(_0x5af671){_0x28f36c['rows']=_0x5af671;return _0x28f36c;})['then'](respondWithFilteredResult(_0x11f88f,_0x48b3b7))['catch'](handleError(_0x11f88f,null));};exports[_0x4ba3('0x48')]=function(_0x5c4659,_0x29e74d){var _0x5567c7={'raw':!![],'where':{'id':_0x5c4659[_0x4ba3('0x49')]['id']}},_0x53d6eb={};_0x53d6eb[_0x4ba3('0x39')]=_[_0x4ba3('0x36')](db[_0x4ba3('0x30')]['rawAttributes']);_0x53d6eb[_0x4ba3('0x35')]=_['keys'](_0x5c4659[_0x4ba3('0x35')]);_0x53d6eb['filters']=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],_0x53d6eb[_0x4ba3('0x35')]);_0x5567c7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x5c4659['query'][_0x4ba3('0x3b')]));_0x5567c7[_0x4ba3('0x3a')]=_0x5567c7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x5567c7[_0x4ba3('0x3a')]:_0x53d6eb['model'];if(_0x5c4659['query'][_0x4ba3('0x45')]){_0x5567c7[_0x4ba3('0x46')]=[{'all':!![]}];}_0x5567c7=_[_0x4ba3('0x43')]({},_0x5567c7,_0x5c4659['options']);return db[_0x4ba3('0x30')][_0x4ba3('0x4a')](_0x5567c7)[_0x4ba3('0x26')](handleEntityNotFound(_0x29e74d,null))['then'](respondWithResult(_0x29e74d,null))['catch'](handleError(_0x29e74d,null));};exports[_0x4ba3('0x4b')]=function(_0x482a83,_0x439acf){return db[_0x4ba3('0x30')][_0x4ba3('0x4b')](_0x482a83[_0x4ba3('0x4c')],{})[_0x4ba3('0x26')](function(_0x213eb0){var _0x590739=_0x482a83[_0x4ba3('0x4d')][_0x4ba3('0x28')]({'plain':!![]});if(!_0x590739)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x590739[_0x4ba3('0x4e')]===_0x4ba3('0x4d')){var _0x156c2d=_0x213eb0[_0x4ba3('0x28')]({'plain':!![]});var _0x360472='Reports';return db[_0x4ba3('0x4f')][_0x4ba3('0x4a')]({'where':{'name':_0x360472,'userProfileId':_0x590739['userProfileId']},'raw':!![]})[_0x4ba3('0x26')](function(_0x19d70f){if(_0x19d70f&&_0x19d70f[_0x4ba3('0x50')]===0x0){return db[_0x4ba3('0x2a')][_0x4ba3('0x4b')]({'name':_0x156c2d[_0x4ba3('0x2c')],'resourceId':_0x156c2d['id'],'type':_0x4ba3('0x29'),'sectionId':_0x19d70f['id']},{})[_0x4ba3('0x26')](function(){return _0x213eb0;});}else{return _0x213eb0;}})[_0x4ba3('0x51')](function(_0x428a27){logger[_0x4ba3('0x2b')](_0x4ba3('0x52'),_0x428a27);throw _0x428a27;});}return _0x213eb0;})[_0x4ba3('0x26')](respondWithResult(_0x439acf,0xc9))[_0x4ba3('0x51')](handleError(_0x439acf,null));};exports[_0x4ba3('0x53')]=function(_0x48a3d4,_0x5e7ed5){if(_0x48a3d4['body']['id']){delete _0x48a3d4[_0x4ba3('0x4c')]['id'];}return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x48a3d4[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x5e7ed5,null))['then'](saveUpdates(_0x48a3d4[_0x4ba3('0x4c')],null))[_0x4ba3('0x26')](respondWithResult(_0x5e7ed5,null))[_0x4ba3('0x51')](handleError(_0x5e7ed5,null));};exports[_0x4ba3('0x27')]=function(_0x5359d1,_0x1e83fb){return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x5359d1[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x1e83fb,null))[_0x4ba3('0x26')](removeEntity(_0x1e83fb,null))[_0x4ba3('0x51')](handleError(_0x1e83fb,null));};exports[_0x4ba3('0x54')]=function(_0x328314,_0x4fa64d){var _0x20c849=0xa;var _0x42bb4b=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x40827a={'SUM':_0x4ba3('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':_0x4ba3('0x5b'),'MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x4cc10a={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4ba3('0x62')};var _0xaef1b=function(_0x2a48fe){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),'IS\x20NOT\x20NULL',_0x4ba3('0x65'),_0x4ba3('0x66')],_0x2a48fe);};var _0x34cc21=function(_0x469ef0){if(!_0x469ef0||!_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')]){return'';}for(var _0x3fdf7f='(',_0x38699e=0x0;_0x38699e<_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')];_0x38699e+=0x1){_0x38699e>0x0&&(_0x3fdf7f+='\x20'+_0x469ef0[_0x4ba3('0x68')]+'\x20');_0x3fdf7f+=_0x469ef0['rules'][_0x38699e][_0x4ba3('0x69')]?_0x34cc21(_0x469ef0[_0x4ba3('0x67')][_0x38699e]['group']):_0x469ef0['rules'][_0x38699e][_0x4ba3('0x6a')]+'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['condition']+(_0xaef1b(_0x469ef0[_0x4ba3('0x67')][_0x38699e][_0x4ba3('0x6b')])?'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['value']:'');}return _0x3fdf7f+')';};var _0x1f5815={'where':{'id':_0x328314['params']['id']}},_0x46224,_0x1af489,_0x11209b,_0x24a75a,_0x3a4838;_0x1f5815=_[_0x4ba3('0x43')]({},_0x1f5815,_0x328314[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x1f5815)[_0x4ba3('0x26')](function(_0x2f8bcc){if(_0x2f8bcc){_0x46224=_0x2f8bcc;return _0x2f8bcc[_0x4ba3('0x6c')]();}return null;})[_0x4ba3('0x26')](function(_0x21c8b1){if(_0x21c8b1){if(!_0x21c8b1[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1af489=_0x21c8b1;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})['then'](function(_0x13ee2c){if(_0x13ee2c){_0x11209b=_[_0x4ba3('0x6f')](_0x13ee2c,'id');var _0x442d66;var _0x5c7fc2=squel[_0x4ba3('0x70')]();_0x5c7fc2[_0x4ba3('0x71')](_0x46224[_0x4ba3('0x72')]);for(var _0x5baf26=0x0;_0x5baf26<_0x1af489[_0x4ba3('0x3c')];_0x5baf26+=0x1){_0x442d66=_0x1af489[_0x5baf26]['MetricId']?_0x11209b[_0x1af489[_0x5baf26][_0x4ba3('0x73')]][_0x4ba3('0x74')]:_0x1af489[_0x5baf26]['field'];_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x40827a[_0x1af489[_0x5baf26][_0x4ba3('0x75')]],'%s',_0x442d66):_0x442d66;_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x4cc10a[_0x1af489[_0x5baf26][_0x4ba3('0x77')]],'%s',_0x442d66):_0x442d66;if(_0x1af489[_0x5baf26][_0x4ba3('0x78')]){_0x5c7fc2[_0x4ba3('0x69')](_0x442d66);}_0x1af489[_0x5baf26][_0x4ba3('0x79')]&&_0x5c7fc2['order'](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x5c7fc2[_0x4ba3('0x6a')](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x7b')]||_0x442d66);}if(_0x46224[_0x4ba3('0x7c')]){_0x46224[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x7c')]);for(var _0x365d94=0x0;_0x365d94<_0x46224[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x365d94+=0x1){if(_0x46224[_0x4ba3('0x7c')][_0x365d94]['type']&&_[_0x4ba3('0x63')](_0x42bb4b,_0x46224[_0x4ba3('0x7c')][_0x365d94]['type'])&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7e')]&&_0x46224['joins'][_0x365d94]['foreignTable']&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]){_0x5c7fc2[_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x33')]](_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x46224['table'],_0x46224[_0x4ba3('0x7c')][_0x365d94]['parentKey'],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]));}}}if(_0x46224[_0x4ba3('0x82')]){_0x46224[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x82')]);_0x5c7fc2['where'](_0x34cc21(_0x46224[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x3a4838=_0x5c7fc2[_0x4ba3('0x83')]();_0x5c7fc2['limit'](_0x20c849);_0x5c7fc2[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x5c7fc2[_0x4ba3('0x86')]());return dbH[_0x4ba3('0x87')][_0x4ba3('0x35')](_0x5c7fc2[_0x4ba3('0x86')](),{'type':dbH['sequelize']['QueryTypes'][_0x4ba3('0x88')]});}})['then'](respondWithResult(_0x4fa64d,null))[_0x4ba3('0x51')](handleError(_0x4fa64d,null));};function runReport(_0x15508f,_0x108679,_0x20f7db){var _0x5a3c63=_0x108679['name'];var _0x2d16e5=0xa;var _0x2b2132=['join',_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x1e8232={'SUM':_0x4ba3('0x59'),'COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':_0x4ba3('0x8a'),'GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x13dbc4={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5aa412=function(_0x4ec70e){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),_0x4ba3('0x65'),_0x4ba3('0x66')],_0x4ec70e);};var _0x333a97=function(_0x30d7a9){if(!_0x30d7a9||!_0x30d7a9['rules'][_0x4ba3('0x3c')]){return'';}for(var _0x4cd4a2='(',_0x31a725=0x0;_0x31a725<_0x30d7a9['rules'][_0x4ba3('0x3c')];_0x31a725+=0x1){_0x31a725>0x0&&(_0x4cd4a2+='\x20'+_0x30d7a9[_0x4ba3('0x68')]+'\x20');_0x4cd4a2+=_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x69')]?_0x333a97(_0x30d7a9[_0x4ba3('0x67')][_0x31a725]['group']):_0x30d7a9['rules'][_0x31a725][_0x4ba3('0x6a')]+'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')]+(_0x5aa412(_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')])?'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x8c')]:'');}return _0x4cd4a2+')';};var _0x3d8606={'where':{'id':_0x15508f['id']}},_0x2d00e3,_0x35441e,_0x217ea4,_0x40dcee,_0x5ea9d0;_0x3d8606=_[_0x4ba3('0x43')]({},_0x3d8606,_0x20f7db);return db['AnalyticDefaultReport'][_0x4ba3('0x4a')](_0x3d8606)[_0x4ba3('0x26')](function(_0x17b970){if(_0x17b970){_0x2d00e3=_0x17b970;return _0x17b970[_0x4ba3('0x6c')]();}return null;})['then'](function(_0x2a2dc2){if(_0x2a2dc2){if(!_0x2a2dc2[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x35441e=_0x2a2dc2;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0x3188c8){if(_0x3188c8){_0x217ea4=_['keyBy'](_0x3188c8,'id');var _0x2f793a;var _0x1194a5=squel[_0x4ba3('0x70')]();_0x1194a5[_0x4ba3('0x71')](_0x2d00e3[_0x4ba3('0x72')]);for(var _0x1e2134=0x0;_0x1e2134<_0x35441e['length'];_0x1e2134+=0x1){_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x73')]?_0x217ea4[_0x35441e[_0x1e2134]['MetricId']][_0x4ba3('0x74')]:_0x35441e[_0x1e2134][_0x4ba3('0x6a')];_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x1e8232[_0x35441e[_0x1e2134]['function']],'%s',_0x2f793a):_0x2f793a;_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x13dbc4[_0x35441e[_0x1e2134]['format']],'%s',_0x2f793a):_0x2f793a;if(_0x35441e[_0x1e2134][_0x4ba3('0x78')]){_0x1194a5['group'](_0x2f793a);}_0x35441e[_0x1e2134][_0x4ba3('0x79')]&&_0x1194a5[_0x4ba3('0x8d')](_0x2f793a,_0x35441e[_0x1e2134][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x1194a5[_0x4ba3('0x6a')](_0x2f793a,_0x35441e[_0x1e2134]['alias']||_0x2f793a);}if(_0x2d00e3['joins']){_0x2d00e3[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x7c')]);for(var _0x56244e=0x0;_0x56244e<_0x2d00e3[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x56244e+=0x1){if(_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x2b2132,_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')])&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')]&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')]&&_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x7f')]){_0x1194a5[_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')]](_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x2d00e3[_0x4ba3('0x72')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e]['foreignKey']));}}}if(_0x2d00e3['conditions']){_0x2d00e3[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x82')]);_0x1194a5[_0x4ba3('0x40')](_0x333a97(_0x2d00e3[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x5ea9d0=_0x1194a5[_0x4ba3('0x83')]();_0x1194a5['limit'](_0x2d16e5);_0x1194a5['offset'](0x0);return;}})[_0x4ba3('0x26')](function(){if(_0x108679[_0x4ba3('0x8e')]==='web'){return null;}var _0x4fb6b5=_['merge'](_0x108679,{'name':_0x108679['fullPath']||_0x108679[_0x4ba3('0x2c')]||_0x2d00e3[_0x4ba3('0x2c')],'basename':_0x5a3c63,'savename':util[_0x4ba3('0x77')](_0x4ba3('0x8f'),_0x108679[_0x4ba3('0x2c')]||_0x2d00e3['name'],require(_0x4ba3('0x90'))[_0x4ba3('0x91')](0x4),_0x108679[_0x4ba3('0x8e')]||'csv'),'reportId':_0x2d00e3['id'],'reportType':'default'});return db['AnalyticExtractedReport']['create'](_0x4fb6b5,{'raw':!![]});})[_0x4ba3('0x26')](function(_0x17d501){if(_0x2d00e3[_0x4ba3('0x72')]===_0x4ba3('0x92')){_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3['table']+_0x4ba3('0x93'),_0x108679['startDate'],_0x108679[_0x4ba3('0x94')]);}else{_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3[_0x4ba3('0x72')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x108679[_0x4ba3('0x95')],_0x108679[_0x4ba3('0x94')]);}if(_0x17d501){logger[_0x4ba3('0x96')](_0x4ba3('0x97'),_0x5ea9d0['toString']());require('child_process')[_0x4ba3('0x98')](path[_0x4ba3('0x55')](__dirname,'../../components/export/',_0x17d501[_0x4ba3('0x8e')]),[_0x17d501['id'],_0x5ea9d0['toString'](),path['join'](__dirname,'../../files/reports',_0x17d501['savename']),_0x5a3c63]);return _0x17d501;}else{var _0x2d2ca3=squel[_0x4ba3('0x70')]();_0x2d2ca3[_0x4ba3('0x71')]('('+_0x5ea9d0[_0x4ba3('0x86')]()+')',_0x4ba3('0x99'));_0x2d2ca3['field']('COUNT(*)',_0x4ba3('0x21'));_0x5ea9d0['limit'](_0x108679[_0x4ba3('0x1f')]||_0x2d16e5);_0x5ea9d0[_0x4ba3('0x1e')](_0x108679[_0x4ba3('0x1e')]||0x0);return dbH['sequelize'][_0x4ba3('0x35')](_0x2d2ca3[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]})[_0x4ba3('0x26')](function(_0xc938c){if(!_0xc938c[_0x4ba3('0x3c')]){_0x40dcee=0x0;}else{_0x40dcee=_0xc938c[0x0][_0x4ba3('0x21')]||0x0;}return dbH['sequelize']['query'](_0x5ea9d0[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]});})[_0x4ba3('0x26')](function(_0xd97c26){return{'rows':_0xd97c26||[],'count':_0x40dcee};});}});}exports['run']=function(_0x1fbdc7,_0x9e45ec){return runReport(_0x1fbdc7['params'],_0x1fbdc7[_0x4ba3('0x35')],_0x1fbdc7[_0x4ba3('0x44')])[_0x4ba3('0x26')](respondWithResult(_0x9e45ec,null))[_0x4ba3('0x51')](handleError(_0x9e45ec,null));};exports[_0x4ba3('0x9b')]=runReport;exports[_0x4ba3('0x35')]=function(_0xddfb0c,_0x41c531){var _0x25bf75=0xa;var _0x18bd77=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x2e812b={'SUM':'SUM(%s)','COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':_0x4ba3('0x9c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5dc74f={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':'DATE(%s)','HOUR':_0x4ba3('0x61'),'ROUND':_0x4ba3('0x9d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1590f0=function(_0x5efab9){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),'IS\x20EMPTY',_0x4ba3('0x66')],_0x5efab9);};var _0x4d3262=function(_0x4ad4d3){if(!_0x4ad4d3||!_0x4ad4d3[_0x4ba3('0x67')]['length']){return'';}for(var _0x4529a3='(',_0x9b9c64=0x0;_0x9b9c64<_0x4ad4d3[_0x4ba3('0x67')]['length'];_0x9b9c64+=0x1){_0x9b9c64>0x0&&(_0x4529a3+='\x20'+_0x4ad4d3['operator']+'\x20');_0x4529a3+=_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]?_0x4d3262(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]):_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64]['field']+'\x20'+_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')]+(_0x1590f0(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')])?'\x20'+_0x4ad4d3['rules'][_0x9b9c64][_0x4ba3('0x8c')]:'');}return _0x4529a3+')';};var _0x3073c5={'where':{'id':_0xddfb0c[_0x4ba3('0x49')]['id']}},_0x3d1c11,_0xa41747,_0x25c92c,_0x422a8d,_0x225746;_0x3073c5=_[_0x4ba3('0x43')]({},_0x3073c5,_0xddfb0c[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x3073c5)[_0x4ba3('0x26')](function(_0x3db4c2){if(_0x3db4c2){_0x3d1c11=_0x3db4c2;return _0x3db4c2['getFields']();}return null;})[_0x4ba3('0x26')](function(_0x4a8449){if(_0x4a8449){if(!_0x4a8449[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))](_0x4ba3('0x9e'),0x193);}_0xa41747=_0x4a8449;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0xfaf98a){if(_0xfaf98a){_0x25c92c=_['keyBy'](_0xfaf98a,'id');var _0x30c904;var _0x267801=squel[_0x4ba3('0x70')]();_0x267801[_0x4ba3('0x71')](_0x3d1c11['table']);for(var _0x1bae1b=0x0;_0x1bae1b<_0xa41747[_0x4ba3('0x3c')];_0x1bae1b+=0x1){_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x73')]?_0x25c92c[_0xa41747[_0x1bae1b][_0x4ba3('0x73')]]['metric']:_0xa41747[_0x1bae1b][_0x4ba3('0x6a')];_0x30c904=_0xa41747[_0x1bae1b]['function']?_[_0x4ba3('0x76')](_0x2e812b[_0xa41747[_0x1bae1b][_0x4ba3('0x75')]],'%s',_0x30c904):_0x30c904;_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x5dc74f[_0xa41747[_0x1bae1b]['format']],'%s',_0x30c904):_0x30c904;if(_0xa41747[_0x1bae1b]['groupBy']){_0x267801[_0x4ba3('0x69')](_0x30c904);}_0xa41747[_0x1bae1b][_0x4ba3('0x79')]&&_0x267801[_0x4ba3('0x8d')](_0x30c904,_0xa41747[_0x1bae1b]['orderBy']==='DESC'?![]:!![]);_0x267801[_0x4ba3('0x6a')](_0x30c904,_0xa41747[_0x1bae1b][_0x4ba3('0x7b')]||_0x30c904);}if(_0x3d1c11[_0x4ba3('0x7c')]){_0x3d1c11[_0x4ba3('0x7c')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x7c')]);for(var _0x2f4966=0x0;_0x2f4966<_0x3d1c11[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x2f4966+=0x1){if(_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x18bd77,_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')])&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x80')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7f')]){_0x267801[_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]](_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x3d1c11[_0x4ba3('0x72')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],_0x3d1c11['joins'][_0x2f4966][_0x4ba3('0x7f')]));}}}if(_0x3d1c11[_0x4ba3('0x82')]){_0x3d1c11[_0x4ba3('0x82')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x82')]);_0x267801[_0x4ba3('0x40')](_0x4d3262(_0x3d1c11[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x225746=_0x267801[_0x4ba3('0x83')]();_0x267801[_0x4ba3('0x1f')](_0x25bf75);_0x267801[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x267801['toString']());return dbH[_0x4ba3('0x87')]['query'](_0x267801['toString'](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')]['SELECT']});}})[_0x4ba3('0x26')](function(){return{'sql':_0x225746[_0x4ba3('0x86')]()};})[_0x4ba3('0x26')](respondWithResult(_0x41c531,null))[_0x4ba3('0x51')](handleError(_0x41c531,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 9e7fcb1..3d66ffd 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 _0x9398=['exports','define','analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticDefaultReport.attributes'];(function(_0x65b5cd,_0x178e0c){var _0x3cd15f=function(_0x556a83){while(--_0x556a83){_0x65b5cd['push'](_0x65b5cd['shift']());}};_0x3cd15f(++_0x178e0c);}(_0x9398,0x155));var _0x8939=function(_0x13449a,_0x176433){_0x13449a=_0x13449a-0x0;var _0x5ccb70=_0x9398[_0x13449a];return _0x5ccb70;};'use strict';var _=require(_0x8939('0x0'));var util=require(_0x8939('0x1'));var logger=require(_0x8939('0x2'))(_0x8939('0x3'));var moment=require(_0x8939('0x4'));var BPromise=require(_0x8939('0x5'));var rp=require(_0x8939('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8939('0x7'));var config=require(_0x8939('0x8'));var attributes=require(_0x8939('0x9'));module[_0x8939('0xa')]=function(_0x2032c2,_0x2c2b51){return _0x2032c2[_0x8939('0xb')]('AnalyticDefaultReport',attributes,{'tableName':_0x8939('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xce8b=['exports','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xce8b,0x189));var _0xbce8=function(_0x54f3e8,_0x3ed493){_0x54f3e8=_0x54f3e8-0x0;var _0x267b37=_0xce8b[_0x54f3e8];return _0x267b37;};'use strict';var _=require(_0xbce8('0x0'));var util=require(_0xbce8('0x1'));var logger=require(_0xbce8('0x2'))(_0xbce8('0x3'));var moment=require('moment');var BPromise=require(_0xbce8('0x4'));var rp=require(_0xbce8('0x5'));var fs=require('fs');var path=require(_0xbce8('0x6'));var rimraf=require(_0xbce8('0x7'));var config=require(_0xbce8('0x8'));var attributes=require(_0xbce8('0x9'));module[_0xbce8('0xa')]=function(_0x472b0b,_0x30f72a){return _0x472b0b['define'](_0xbce8('0xb'),attributes,{'tableName':_0xbce8('0xc'),'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 9244fe9..f7b6141 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 _0x62b4=['http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x272282,_0x2e94a0){var _0xedf511=function(_0x5d1ab6){while(--_0x5d1ab6){_0x272282['push'](_0x272282['shift']());}};_0xedf511(++_0x2e94a0);}(_0x62b4,0x1a4));var _0x462b=function(_0x50e40b,_0x338d17){_0x50e40b=_0x50e40b-0x0;var _0x2608b7=_0x62b4[_0x50e40b];return _0x2608b7;};'use strict';var _=require(_0x462b('0x0'));var util=require(_0x462b('0x1'));var moment=require(_0x462b('0x2'));var BPromise=require(_0x462b('0x3'));var rs=require(_0x462b('0x4'));var fs=require('fs');var Redis=require(_0x462b('0x5'));var db=require(_0x462b('0x6'))['db'];var utils=require(_0x462b('0x7'));var logger=require(_0x462b('0x8'))(_0x462b('0x9'));var config=require('../../config/environment');var jayson=require(_0x462b('0xa'));var client=jayson[_0x462b('0xb')][_0x462b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x414dc6,_0x1c821d,_0x1f0ff3){return new BPromise(function(_0x272b29,_0x39a72f){return client[_0x462b('0xd')](_0x414dc6,_0x1f0ff3)[_0x462b('0xe')](function(_0x1cb140){logger[_0x462b('0xf')](_0x462b('0x10'),_0x1c821d,_0x462b('0x11'));logger['debug'](_0x462b('0x12'),_0x1c821d,'request\x20sent',JSON[_0x462b('0x13')](_0x1cb140));if(_0x1cb140[_0x462b('0x14')]){if(_0x1cb140[_0x462b('0x14')]['code']===0x1f4){logger[_0x462b('0x14')](_0x462b('0x10'),_0x1c821d,_0x1cb140[_0x462b('0x14')][_0x462b('0x15')]);return _0x39a72f(_0x1cb140[_0x462b('0x14')][_0x462b('0x15')]);}logger['error'](_0x462b('0x10'),_0x1c821d,_0x1cb140[_0x462b('0x14')][_0x462b('0x15')]);return _0x272b29(_0x1cb140[_0x462b('0x14')][_0x462b('0x15')]);}else{logger[_0x462b('0xf')](_0x462b('0x10'),_0x1c821d,_0x462b('0x11'));_0x272b29(_0x1cb140[_0x462b('0x16')][_0x462b('0x15')]);}})[_0x462b('0x17')](function(_0x5d5535){logger['error'](_0x462b('0x10'),_0x1c821d,_0x5d5535);_0x39a72f(_0x5d5535);});});} \ No newline at end of file +var _0x7c1a=['jayson/promise','http','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','util','moment','../../mysqldb','rpc','../../config/environment'];(function(_0x41824b,_0x50aa9c){var _0x1c6602=function(_0x410dbb){while(--_0x410dbb){_0x41824b['push'](_0x41824b['shift']());}};_0x1c6602(++_0x50aa9c);}(_0x7c1a,0x19b));var _0xa7c1=function(_0xd48dda,_0x53b6da){_0xd48dda=_0xd48dda-0x0;var _0x51b3d2=_0x7c1a[_0xd48dda];return _0x51b3d2;};'use strict';var _=require('lodash');var util=require(_0xa7c1('0x0'));var moment=require(_0xa7c1('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa7c1('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa7c1('0x3'));var config=require(_0xa7c1('0x4'));var jayson=require(_0xa7c1('0x5'));var client=jayson['client'][_0xa7c1('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x49adf3,_0x284de2,_0x2864ec){return new BPromise(function(_0x20406a,_0x3be950){return client['request'](_0x49adf3,_0x2864ec)[_0xa7c1('0x7')](function(_0x32a153){logger['info'](_0xa7c1('0x8'),_0x284de2,_0xa7c1('0x9'));logger[_0xa7c1('0xa')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x284de2,_0xa7c1('0x9'),JSON['stringify'](_0x32a153));if(_0x32a153['error']){if(_0x32a153[_0xa7c1('0xb')][_0xa7c1('0xc')]===0x1f4){logger[_0xa7c1('0xb')](_0xa7c1('0x8'),_0x284de2,_0x32a153[_0xa7c1('0xb')][_0xa7c1('0xd')]);return _0x3be950(_0x32a153[_0xa7c1('0xb')][_0xa7c1('0xd')]);}logger[_0xa7c1('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x284de2,_0x32a153[_0xa7c1('0xb')]['message']);return _0x20406a(_0x32a153[_0xa7c1('0xb')][_0xa7c1('0xd')]);}else{logger['info'](_0xa7c1('0x8'),_0x284de2,'request\x20sent');_0x20406a(_0x32a153[_0xa7c1('0xe')][_0xa7c1('0xd')]);}})[_0xa7c1('0xf')](function(_0x13930a){logger[_0xa7c1('0xb')](_0xa7c1('0x8'),_0x284de2,_0x13930a);_0x3be950(_0x13930a);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 7550bf0..27b09d8 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 _0xc27a=['../../components/interaction/service','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','run','/:id/query','query','post','create','update','exports','multer','util','path','connect-timeout','fs-extra'];(function(_0x673e91,_0x5066f8){var _0x3ee5cb=function(_0x2b30d2){while(--_0x2b30d2){_0x673e91['push'](_0x673e91['shift']());}};_0x3ee5cb(++_0x5066f8);}(_0xc27a,0x1b4));var _0xac27=function(_0x173f10,_0x35db61){_0x173f10=_0x173f10-0x0;var _0x53142d=_0xc27a[_0x173f10];return _0x53142d;};'use strict';var multer=require(_0xac27('0x0'));var util=require(_0xac27('0x1'));var path=require(_0xac27('0x2'));var timeout=require(_0xac27('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xac27('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xac27('0x5'));var config=require('../../config/environment');var controller=require(_0xac27('0x6'));router[_0xac27('0x7')]('/',auth[_0xac27('0x8')](),controller[_0xac27('0x9')]);router[_0xac27('0x7')](_0xac27('0xa'),auth[_0xac27('0x8')](),controller[_0xac27('0xb')]);router[_0xac27('0x7')](_0xac27('0xc'),auth[_0xac27('0x8')](),controller[_0xac27('0xd')]);router[_0xac27('0x7')]('/:id/run',auth[_0xac27('0x8')](),controller[_0xac27('0xe')]);router[_0xac27('0x7')](_0xac27('0xf'),auth[_0xac27('0x8')](),controller[_0xac27('0x10')]);router[_0xac27('0x11')]('/',auth[_0xac27('0x8')](),controller[_0xac27('0x12')]);router['put'](_0xac27('0xa'),auth[_0xac27('0x8')](),controller[_0xac27('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xac27('0x14')]=router; \ No newline at end of file +var _0x58d0=['get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1c51c4,_0x2b4371){var _0x26e4d1=function(_0x51f825){while(--_0x51f825){_0x1c51c4['push'](_0x1c51c4['shift']());}};_0x26e4d1(++_0x2b4371);}(_0x58d0,0xd0));var _0x058d=function(_0x126af7,_0x25fa06){_0x126af7=_0x126af7-0x0;var _0x25b500=_0x58d0[_0x126af7];return _0x25b500;};'use strict';var multer=require(_0x058d('0x0'));var util=require(_0x058d('0x1'));var path=require(_0x058d('0x2'));var timeout=require(_0x058d('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x058d('0x4'));var auth=require(_0x058d('0x5'));var interaction=require(_0x058d('0x6'));var config=require(_0x058d('0x7'));var controller=require('./analyticDefaultReport.controller');router[_0x058d('0x8')]('/',auth[_0x058d('0x9')](),controller[_0x058d('0xa')]);router['get'](_0x058d('0xb'),auth[_0x058d('0x9')](),controller[_0x058d('0xc')]);router[_0x058d('0x8')](_0x058d('0xd'),auth[_0x058d('0x9')](),controller[_0x058d('0xe')]);router[_0x058d('0x8')](_0x058d('0xf'),auth[_0x058d('0x9')](),controller[_0x058d('0x10')]);router[_0x058d('0x8')](_0x058d('0x11'),auth[_0x058d('0x9')](),controller[_0x058d('0x12')]);router[_0x058d('0x13')]('/',auth[_0x058d('0x9')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x058d('0x14')]);router[_0x058d('0x15')]('/:id',auth[_0x058d('0x9')](),controller[_0x058d('0x16')]);module[_0x058d('0x17')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 11ad4ad..0cd16d2 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 _0x8b98=['STRING','csv','xlsx','DATE','Loading','ENUM','manual','scheduled','UNSIGNED','sequelize','moment','exports'];(function(_0x23514c,_0x3db65b){var _0x5076c8=function(_0x44fe9c){while(--_0x44fe9c){_0x23514c['push'](_0x23514c['shift']());}};_0x5076c8(++_0x3db65b);}(_0x8b98,0x17d));var _0x88b9=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x8b98[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0x88b9('0x0'));var moment=require(_0x88b9('0x1'));module[_0x88b9('0x2')]={'name':{'type':Sequelize[_0x88b9('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x88b9('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x88b9('0x4'),'pdf',_0x88b9('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x88b9('0x6')]},'endDate':{'type':Sequelize[_0x88b9('0x6')]},'status':{'type':Sequelize[_0x88b9('0x3')],'defaultValue':_0x88b9('0x7')},'type':{'type':Sequelize[_0x88b9('0x8')](_0x88b9('0x9'),_0x88b9('0xa')),'allowNull':![],'defaultValue':_0x88b9('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x88b9('0xb')]},'reportType':{'type':Sequelize[_0x88b9('0x3')]}}; \ No newline at end of file +var _0x8542=['DATE','Loading','manual','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','xlsx'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0x8542,0x1a6));var _0x2854=function(_0x437849,_0x43c676){_0x437849=_0x437849-0x0;var _0x572a7e=_0x8542[_0x437849];return _0x572a7e;};'use strict';var Sequelize=require(_0x2854('0x0'));var moment=require(_0x2854('0x1'));module[_0x2854('0x2')]={'name':{'type':Sequelize[_0x2854('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x2854('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x2854('0x4')](_0x2854('0x5'),'pdf',_0x2854('0x6')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x2854('0x7')]},'endDate':{'type':Sequelize[_0x2854('0x7')]},'status':{'type':Sequelize[_0x2854('0x3')],'defaultValue':_0x2854('0x8')},'type':{'type':Sequelize[_0x2854('0x4')](_0x2854('0x9'),'scheduled'),'allowNull':![],'defaultValue':_0x2854('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x2854('0xa')]},'reportType':{'type':Sequelize[_0x2854('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index f0a8483..0e24f52 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 _0xd7c1=['status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','get','ExtractedReports','UserProfileResource','then','error','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','download','basename','output','root','server/files/reports','savename','Sequelize','ValidationError','join','format','%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','sox','to-csv','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xd7c1,0x157));var _0x1d7c=function(_0x5ebe73,_0x13080f){_0x5ebe73=_0x5ebe73-0x0;var _0x292268=_0xd7c1[_0x5ebe73];return _0x292268;};'use strict';var emlformat=require(_0x1d7c('0x0'));var rimraf=require(_0x1d7c('0x1'));var zipdir=require(_0x1d7c('0x2'));var jsonpatch=require(_0x1d7c('0x3'));var rp=require('request-promise');var moment=require(_0x1d7c('0x4'));var BPromise=require(_0x1d7c('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x1d7c('0x6'));var csv=require(_0x1d7c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1d7c('0x8'));var squel=require(_0x1d7c('0x9'));var crypto=require(_0x1d7c('0xa'));var jsforce=require(_0x1d7c('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1d7c('0x7'));var querystring=require(_0x1d7c('0xc'));var Papa=require('papaparse');var Redis=require(_0x1d7c('0xd'));var authService=require(_0x1d7c('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x1d7c('0xf'));var hardwareService=require(_0x1d7c('0x10'));var logger=require(_0x1d7c('0x11'))('api');var utils=require(_0x1d7c('0x12'));var config=require(_0x1d7c('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4749b0,_0x5b60f9){_0x5b60f9=_0x5b60f9||0xcc;return function(_0x10c4d7){if(_0x10c4d7){return _0x4749b0[_0x1d7c('0x14')](_0x5b60f9);}return _0x4749b0[_0x1d7c('0x15')](_0x5b60f9)[_0x1d7c('0x16')]();};}function respondWithResult(_0x16ac37,_0x2ca323){_0x2ca323=_0x2ca323||0xc8;return function(_0x4b3509){if(_0x4b3509){return _0x16ac37[_0x1d7c('0x15')](_0x2ca323)[_0x1d7c('0x17')](_0x4b3509);}};}function respondWithFilteredResult(_0x2d4e7d,_0x2bcfff){return function(_0x3a7cea){if(_0x3a7cea){var _0x2c5f68=typeof _0x2bcfff[_0x1d7c('0x18')]===_0x1d7c('0x19')&&typeof _0x2bcfff[_0x1d7c('0x1a')]==='undefined';var _0x44608d=_0x3a7cea[_0x1d7c('0x1b')];var _0x44ebbb=_0x2c5f68?0x0:_0x2bcfff[_0x1d7c('0x18')];var _0x10f0ab=_0x2c5f68?_0x3a7cea['count']:_0x2bcfff[_0x1d7c('0x18')]+_0x2bcfff['limit'];var _0x4468ab;if(_0x10f0ab>=_0x44608d){_0x10f0ab=_0x44608d;_0x4468ab=0xc8;}else{_0x4468ab=0xce;}_0x2d4e7d[_0x1d7c('0x15')](_0x4468ab);return _0x2d4e7d[_0x1d7c('0x1c')](_0x1d7c('0x1d'),_0x44ebbb+'-'+_0x10f0ab+'/'+_0x44608d)[_0x1d7c('0x17')](_0x3a7cea);}return null;};}function patchUpdates(_0xf152f6){return function(_0x9ab8b){try{jsonpatch['apply'](_0x9ab8b,_0xf152f6,!![]);}catch(_0x124b25){return BPromise[_0x1d7c('0x1e')](_0x124b25);}return _0x9ab8b[_0x1d7c('0x1f')]();};}function saveUpdates(_0x1bc202,_0x96d5c6){return function(_0x22aaab){if(_0x22aaab){return _0x22aaab[_0x1d7c('0x20')](_0x1bc202)['then'](function(_0x104450){return _0x104450;});}return null;};}function removeEntity(_0x53dcc9,_0x1a2d06){return function(_0x2d0046){if(_0x2d0046){return _0x2d0046[_0x1d7c('0x21')]()['then'](function(){var _0x75c386=_0x2d0046[_0x1d7c('0x22')]({'plain':!![]});var _0x41add0=_0x1d7c('0x23');return db[_0x1d7c('0x24')][_0x1d7c('0x21')]({'where':{'type':_0x41add0,'resourceId':_0x75c386['id']}})['then'](function(){return _0x2d0046;});})[_0x1d7c('0x25')](function(){_0x53dcc9[_0x1d7c('0x15')](0xcc)[_0x1d7c('0x16')]();});}};}function handleEntityNotFound(_0x43bedc,_0x73f147){return function(_0x45d31d){if(!_0x45d31d){_0x43bedc[_0x1d7c('0x14')](0x194);}return _0x45d31d;};}function handleError(_0x3b3d6b,_0x4deac3){_0x4deac3=_0x4deac3||0x1f4;return function(_0x56cab1){logger[_0x1d7c('0x26')](_0x56cab1['stack']);if(_0x56cab1[_0x1d7c('0x27')]){delete _0x56cab1[_0x1d7c('0x27')];}_0x3b3d6b[_0x1d7c('0x15')](_0x4deac3)[_0x1d7c('0x28')](_0x56cab1);};}exports[_0x1d7c('0x29')]=function(_0x52be96,_0x2b0b64){var _0x218d4f={},_0x4077f1={},_0x3ef545={'count':0x0,'rows':[]};var _0x1de682=_[_0x1d7c('0x2a')](db[_0x1d7c('0x2b')][_0x1d7c('0x2c')],function(_0x596ef7){return{'name':_0x596ef7[_0x1d7c('0x2d')],'type':_0x596ef7[_0x1d7c('0x2e')][_0x1d7c('0x2f')]};});_0x4077f1[_0x1d7c('0x30')]=_['map'](_0x1de682,'name');_0x4077f1[_0x1d7c('0x31')]=_[_0x1d7c('0x32')](_0x52be96['query']);_0x4077f1[_0x1d7c('0x33')]=_['intersection'](_0x4077f1['model'],_0x4077f1[_0x1d7c('0x31')]);_0x218d4f[_0x1d7c('0x34')]=_[_0x1d7c('0x35')](_0x4077f1[_0x1d7c('0x30')],qs[_0x1d7c('0x36')](_0x52be96[_0x1d7c('0x31')][_0x1d7c('0x36')]));_0x218d4f[_0x1d7c('0x34')]=_0x218d4f[_0x1d7c('0x34')][_0x1d7c('0x37')]?_0x218d4f[_0x1d7c('0x34')]:_0x4077f1[_0x1d7c('0x30')];if(!_0x52be96[_0x1d7c('0x31')][_0x1d7c('0x38')](_0x1d7c('0x39'))){_0x218d4f[_0x1d7c('0x1a')]=qs[_0x1d7c('0x1a')](_0x52be96[_0x1d7c('0x31')][_0x1d7c('0x1a')]);_0x218d4f[_0x1d7c('0x18')]=qs[_0x1d7c('0x18')](_0x52be96[_0x1d7c('0x31')][_0x1d7c('0x18')]);}_0x218d4f[_0x1d7c('0x3a')]=qs[_0x1d7c('0x3b')](_0x52be96[_0x1d7c('0x31')][_0x1d7c('0x3b')]);_0x218d4f[_0x1d7c('0x3c')]=qs[_0x1d7c('0x33')](_[_0x1d7c('0x3d')](_0x52be96[_0x1d7c('0x31')],_0x4077f1[_0x1d7c('0x33')]),_0x1de682);if(_0x52be96[_0x1d7c('0x31')][_0x1d7c('0x3e')]){_0x218d4f[_0x1d7c('0x3c')]=_[_0x1d7c('0x3f')](_0x218d4f[_0x1d7c('0x3c')],{'$or':_[_0x1d7c('0x2a')](_0x1de682,function(_0x5d0354){if(_0x5d0354[_0x1d7c('0x2e')]!==_0x1d7c('0x40')){var _0x2f6845={};_0x2f6845[_0x5d0354['name']]={'$like':'%'+_0x52be96[_0x1d7c('0x31')]['filter']+'%'};return _0x2f6845;}})});}_0x218d4f=_['merge']({},_0x218d4f,_0x52be96[_0x1d7c('0x41')]);var _0x3fb9a5={'where':_0x218d4f[_0x1d7c('0x3c')]};return db[_0x1d7c('0x2b')][_0x1d7c('0x1b')](_0x3fb9a5)[_0x1d7c('0x25')](function(_0x4a68c8){_0x3ef545[_0x1d7c('0x1b')]=_0x4a68c8;if(_0x52be96[_0x1d7c('0x31')][_0x1d7c('0x42')]){_0x218d4f[_0x1d7c('0x43')]=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x218d4f);})[_0x1d7c('0x25')](function(_0x54a05a){_0x3ef545['rows']=_0x54a05a;return _0x3ef545;})['then'](respondWithFilteredResult(_0x2b0b64,_0x218d4f))[_0x1d7c('0x44')](handleError(_0x2b0b64,null));};exports[_0x1d7c('0x45')]=function(_0xcc1e73,_0x2f93e2){var _0x511d90={'raw':!![],'where':{'id':_0xcc1e73[_0x1d7c('0x46')]['id']}},_0x5696ea={};_0x5696ea[_0x1d7c('0x30')]=_[_0x1d7c('0x32')](db[_0x1d7c('0x2b')][_0x1d7c('0x2c')]);_0x5696ea[_0x1d7c('0x31')]=_[_0x1d7c('0x32')](_0xcc1e73['query']);_0x5696ea[_0x1d7c('0x33')]=_[_0x1d7c('0x35')](_0x5696ea[_0x1d7c('0x30')],_0x5696ea['query']);_0x511d90[_0x1d7c('0x34')]=_[_0x1d7c('0x35')](_0x5696ea[_0x1d7c('0x30')],qs['fields'](_0xcc1e73['query'][_0x1d7c('0x36')]));_0x511d90[_0x1d7c('0x34')]=_0x511d90[_0x1d7c('0x34')]['length']?_0x511d90['attributes']:_0x5696ea['model'];if(_0xcc1e73['query'][_0x1d7c('0x42')]){_0x511d90[_0x1d7c('0x43')]=[{'all':!![]}];}_0x511d90=_[_0x1d7c('0x3f')]({},_0x511d90,_0xcc1e73['options']);return db[_0x1d7c('0x2b')][_0x1d7c('0x47')](_0x511d90)[_0x1d7c('0x25')](handleEntityNotFound(_0x2f93e2,null))[_0x1d7c('0x25')](respondWithResult(_0x2f93e2,null))[_0x1d7c('0x44')](handleError(_0x2f93e2,null));};exports[_0x1d7c('0x48')]=function(_0x56e9fb,_0x2061c6){return db[_0x1d7c('0x2b')]['create'](_0x56e9fb[_0x1d7c('0x49')],{})[_0x1d7c('0x25')](function(_0x5081c4){var _0x227e28=_0x56e9fb[_0x1d7c('0x4a')]['get']({'plain':!![]});if(!_0x227e28)throw new Error(_0x1d7c('0x4b'));if(_0x227e28[_0x1d7c('0x4c')]===_0x1d7c('0x4a')){var _0x38f4a6=_0x5081c4[_0x1d7c('0x22')]({'plain':!![]});var _0x1a3ef4=_0x1d7c('0x23');return db[_0x1d7c('0x4d')]['find']({'where':{'name':_0x1a3ef4,'userProfileId':_0x227e28[_0x1d7c('0x4e')]},'raw':!![]})[_0x1d7c('0x25')](function(_0x149511){if(_0x149511&&_0x149511[_0x1d7c('0x4f')]===0x0){return db[_0x1d7c('0x24')][_0x1d7c('0x48')]({'name':_0x38f4a6[_0x1d7c('0x27')],'resourceId':_0x38f4a6['id'],'type':_0x149511[_0x1d7c('0x27')],'sectionId':_0x149511['id']},{})[_0x1d7c('0x25')](function(){return _0x5081c4;});}else{return _0x5081c4;}})[_0x1d7c('0x44')](function(_0x27a561){logger[_0x1d7c('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x27a561);throw _0x27a561;});}return _0x5081c4;})['then'](respondWithResult(_0x2061c6,0xc9))[_0x1d7c('0x44')](handleError(_0x2061c6,null));};exports[_0x1d7c('0x20')]=function(_0x51d240,_0x11537e){if(_0x51d240['body']['id']){delete _0x51d240['body']['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x51d240[_0x1d7c('0x46')]['id']}})[_0x1d7c('0x25')](handleEntityNotFound(_0x11537e,null))['then'](saveUpdates(_0x51d240[_0x1d7c('0x49')],null))[_0x1d7c('0x25')](respondWithResult(_0x11537e,null))[_0x1d7c('0x44')](handleError(_0x11537e,null));};exports['destroy']=function(_0x5c8d26,_0x25ae40){return db[_0x1d7c('0x2b')][_0x1d7c('0x47')]({'where':{'id':_0x5c8d26[_0x1d7c('0x46')]['id']}})[_0x1d7c('0x25')](handleEntityNotFound(_0x25ae40,null))[_0x1d7c('0x25')](removeEntity(_0x25ae40,null))['catch'](handleError(_0x25ae40,null));};exports[_0x1d7c('0x50')]=function(_0x31373a,_0x1eaa54,_0x52b830){return db[_0x1d7c('0x2b')][_0x1d7c('0x47')]({'where':{'id':_0x31373a[_0x1d7c('0x46')]['id']},'attributes':[_0x1d7c('0x27'),_0x1d7c('0x51'),'savename',_0x1d7c('0x52')],'raw':!![]})[_0x1d7c('0x25')](handleEntityNotFound(_0x1eaa54,null))[_0x1d7c('0x25')](function(_0x2408e4){if(_0x2408e4){if(!fs['existsSync'](path['join'](config[_0x1d7c('0x53')],_0x1d7c('0x54'),_0x2408e4[_0x1d7c('0x55')]))){throw new db[(_0x1d7c('0x56'))][(_0x1d7c('0x57'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x31373a['query']['exists']){return _0x1eaa54['sendStatus'](0xc8);}return _0x1eaa54[_0x1d7c('0x50')](path[_0x1d7c('0x58')](config[_0x1d7c('0x53')],'server/files/reports',_0x2408e4[_0x1d7c('0x55')]),util[_0x1d7c('0x59')](_0x1d7c('0x5a'),_0x2408e4[_0x1d7c('0x51')]||_0x2408e4[_0x1d7c('0x27')],_0x2408e4[_0x1d7c('0x52')]['toLowerCase']()));}})[_0x1d7c('0x44')](handleError(_0x1eaa54,null));}; \ No newline at end of file +var _0x3139=['root','savename','output','toLowerCase','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','update','then','ExtractedReports','destroy','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','keys','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','include','findAll','rows','catch','show','params','length','options','create','body','user','role','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','existsSync','server/files/reports','Sequelize','ValidationError','join'];(function(_0x20beae,_0x5eac6d){var _0xf5725=function(_0x926a3b){while(--_0x926a3b){_0x20beae['push'](_0x20beae['shift']());}};_0xf5725(++_0x5eac6d);}(_0x3139,0x15c));var _0x9313=function(_0x1e79a3,_0x3b3464){_0x1e79a3=_0x1e79a3-0x0;var _0x4a92ae=_0x3139[_0x1e79a3];return _0x4a92ae;};'use strict';var emlformat=require(_0x9313('0x0'));var rimraf=require(_0x9313('0x1'));var zipdir=require(_0x9313('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9313('0x3'));var moment=require(_0x9313('0x4'));var BPromise=require(_0x9313('0x5'));var Mustache=require(_0x9313('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x9313('0x7'));var ejs=require(_0x9313('0x8'));var fs=require('fs');var fs_extra=require(_0x9313('0x9'));var _=require('lodash');var squel=require(_0x9313('0xa'));var crypto=require('crypto');var jsforce=require(_0x9313('0xb'));var deskjs=require(_0x9313('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9313('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x9313('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9313('0xf'));var logger=require('../../config/logger')(_0x9313('0x10'));var utils=require(_0x9313('0x11'));var config=require(_0x9313('0x12'));var licenseUtil=require(_0x9313('0x13'));var db=require(_0x9313('0x14'))['db'];function respondWithStatusCode(_0x3eba59,_0x3ddc89){_0x3ddc89=_0x3ddc89||0xcc;return function(_0x4600e5){if(_0x4600e5){return _0x3eba59[_0x9313('0x15')](_0x3ddc89);}return _0x3eba59[_0x9313('0x16')](_0x3ddc89)[_0x9313('0x17')]();};}function respondWithResult(_0xba69ad,_0x63a74e){_0x63a74e=_0x63a74e||0xc8;return function(_0x44bb10){if(_0x44bb10){return _0xba69ad[_0x9313('0x16')](_0x63a74e)['json'](_0x44bb10);}};}function respondWithFilteredResult(_0x240d31,_0x4e775a){return function(_0x14df51){if(_0x14df51){var _0x1966d1=typeof _0x4e775a[_0x9313('0x18')]===_0x9313('0x19')&&typeof _0x4e775a[_0x9313('0x1a')]==='undefined';var _0x5232b7=_0x14df51[_0x9313('0x1b')];var _0x3429db=_0x1966d1?0x0:_0x4e775a[_0x9313('0x18')];var _0x4adf9d=_0x1966d1?_0x14df51[_0x9313('0x1b')]:_0x4e775a[_0x9313('0x18')]+_0x4e775a[_0x9313('0x1a')];var _0x5d8209;if(_0x4adf9d>=_0x5232b7){_0x4adf9d=_0x5232b7;_0x5d8209=0xc8;}else{_0x5d8209=0xce;}_0x240d31[_0x9313('0x16')](_0x5d8209);return _0x240d31['set'](_0x9313('0x1c'),_0x3429db+'-'+_0x4adf9d+'/'+_0x5232b7)[_0x9313('0x1d')](_0x14df51);}return null;};}function patchUpdates(_0x44cdf3){return function(_0x34e117){try{jsonpatch[_0x9313('0x1e')](_0x34e117,_0x44cdf3,!![]);}catch(_0x4ea1e1){return BPromise['reject'](_0x4ea1e1);}return _0x34e117['save']();};}function saveUpdates(_0x2a6c43,_0x2e1665){return function(_0x2a1339){if(_0x2a1339){return _0x2a1339[_0x9313('0x1f')](_0x2a6c43)[_0x9313('0x20')](function(_0x87a281){return _0x87a281;});}return null;};}function removeEntity(_0x3114e2,_0x4c647e){return function(_0x170989){if(_0x170989){return _0x170989['destroy']()[_0x9313('0x20')](function(){var _0x3be07f=_0x170989['get']({'plain':!![]});var _0x560de3=_0x9313('0x21');return db['UserProfileResource'][_0x9313('0x22')]({'where':{'type':_0x560de3,'resourceId':_0x3be07f['id']}})[_0x9313('0x20')](function(){return _0x170989;});})['then'](function(){_0x3114e2[_0x9313('0x16')](0xcc)[_0x9313('0x17')]();});}};}function handleEntityNotFound(_0x157b02,_0xc54b0){return function(_0x4c046a){if(!_0x4c046a){_0x157b02[_0x9313('0x15')](0x194);}return _0x4c046a;};}function handleError(_0xd9efb1,_0x185d00){_0x185d00=_0x185d00||0x1f4;return function(_0x4e4731){logger[_0x9313('0x23')](_0x4e4731[_0x9313('0x24')]);if(_0x4e4731[_0x9313('0x25')]){delete _0x4e4731[_0x9313('0x25')];}_0xd9efb1['status'](_0x185d00)[_0x9313('0x26')](_0x4e4731);};}exports[_0x9313('0x27')]=function(_0x2302e2,_0x4ca678){var _0x2fc2d3={},_0x8602c6={},_0x3385f8={'count':0x0,'rows':[]};var _0x439171=_[_0x9313('0x28')](db[_0x9313('0x29')][_0x9313('0x2a')],function(_0x5cc7d9){return{'name':_0x5cc7d9[_0x9313('0x2b')],'type':_0x5cc7d9[_0x9313('0x2c')]['key']};});_0x8602c6['model']=_[_0x9313('0x28')](_0x439171,_0x9313('0x25'));_0x8602c6['query']=_[_0x9313('0x2d')](_0x2302e2[_0x9313('0x2e')]);_0x8602c6[_0x9313('0x2f')]=_['intersection'](_0x8602c6[_0x9313('0x30')],_0x8602c6[_0x9313('0x2e')]);_0x2fc2d3[_0x9313('0x31')]=_[_0x9313('0x32')](_0x8602c6[_0x9313('0x30')],qs[_0x9313('0x33')](_0x2302e2[_0x9313('0x2e')][_0x9313('0x33')]));_0x2fc2d3[_0x9313('0x31')]=_0x2fc2d3['attributes']['length']?_0x2fc2d3[_0x9313('0x31')]:_0x8602c6[_0x9313('0x30')];if(!_0x2302e2[_0x9313('0x2e')][_0x9313('0x34')](_0x9313('0x35'))){_0x2fc2d3['limit']=qs[_0x9313('0x1a')](_0x2302e2[_0x9313('0x2e')][_0x9313('0x1a')]);_0x2fc2d3[_0x9313('0x18')]=qs['offset'](_0x2302e2[_0x9313('0x2e')][_0x9313('0x18')]);}_0x2fc2d3['order']=qs[_0x9313('0x36')](_0x2302e2[_0x9313('0x2e')][_0x9313('0x36')]);_0x2fc2d3[_0x9313('0x37')]=qs[_0x9313('0x2f')](_[_0x9313('0x38')](_0x2302e2[_0x9313('0x2e')],_0x8602c6[_0x9313('0x2f')]),_0x439171);if(_0x2302e2[_0x9313('0x2e')][_0x9313('0x39')]){_0x2fc2d3[_0x9313('0x37')]=_[_0x9313('0x3a')](_0x2fc2d3[_0x9313('0x37')],{'$or':_[_0x9313('0x28')](_0x439171,function(_0x1aa82a){if(_0x1aa82a['type']!=='VIRTUAL'){var _0x4ff8ee={};_0x4ff8ee[_0x1aa82a[_0x9313('0x25')]]={'$like':'%'+_0x2302e2[_0x9313('0x2e')][_0x9313('0x39')]+'%'};return _0x4ff8ee;}})});}_0x2fc2d3=_['merge']({},_0x2fc2d3,_0x2302e2['options']);var _0x386e2b={'where':_0x2fc2d3[_0x9313('0x37')]};return db[_0x9313('0x29')][_0x9313('0x1b')](_0x386e2b)[_0x9313('0x20')](function(_0x3ea60b){_0x3385f8[_0x9313('0x1b')]=_0x3ea60b;if(_0x2302e2[_0x9313('0x2e')]['includeAll']){_0x2fc2d3[_0x9313('0x3b')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x9313('0x3c')](_0x2fc2d3);})[_0x9313('0x20')](function(_0x46158){_0x3385f8[_0x9313('0x3d')]=_0x46158;return _0x3385f8;})[_0x9313('0x20')](respondWithFilteredResult(_0x4ca678,_0x2fc2d3))[_0x9313('0x3e')](handleError(_0x4ca678,null));};exports[_0x9313('0x3f')]=function(_0x49272d,_0x3b3fcf){var _0x38994b={'raw':!![],'where':{'id':_0x49272d[_0x9313('0x40')]['id']}},_0x49b020={};_0x49b020[_0x9313('0x30')]=_['keys'](db['AnalyticExtractedReport'][_0x9313('0x2a')]);_0x49b020[_0x9313('0x2e')]=_[_0x9313('0x2d')](_0x49272d[_0x9313('0x2e')]);_0x49b020['filters']=_['intersection'](_0x49b020[_0x9313('0x30')],_0x49b020[_0x9313('0x2e')]);_0x38994b[_0x9313('0x31')]=_[_0x9313('0x32')](_0x49b020[_0x9313('0x30')],qs[_0x9313('0x33')](_0x49272d[_0x9313('0x2e')]['fields']));_0x38994b[_0x9313('0x31')]=_0x38994b['attributes'][_0x9313('0x41')]?_0x38994b[_0x9313('0x31')]:_0x49b020[_0x9313('0x30')];if(_0x49272d[_0x9313('0x2e')]['includeAll']){_0x38994b[_0x9313('0x3b')]=[{'all':!![]}];}_0x38994b=_[_0x9313('0x3a')]({},_0x38994b,_0x49272d[_0x9313('0x42')]);return db[_0x9313('0x29')]['find'](_0x38994b)[_0x9313('0x20')](handleEntityNotFound(_0x3b3fcf,null))['then'](respondWithResult(_0x3b3fcf,null))[_0x9313('0x3e')](handleError(_0x3b3fcf,null));};exports[_0x9313('0x43')]=function(_0x36c901,_0x522617){return db[_0x9313('0x29')][_0x9313('0x43')](_0x36c901[_0x9313('0x44')],{})['then'](function(_0x4e2d88){var _0x2ddec5=_0x36c901[_0x9313('0x45')]['get']({'plain':!![]});if(!_0x2ddec5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2ddec5[_0x9313('0x46')]===_0x9313('0x45')){var _0x496ff5=_0x4e2d88['get']({'plain':!![]});var _0x492021='ExtractedReports';return db['UserProfileSection'][_0x9313('0x47')]({'where':{'name':_0x492021,'userProfileId':_0x2ddec5['userProfileId']},'raw':!![]})[_0x9313('0x20')](function(_0x8bcb51){if(_0x8bcb51&&_0x8bcb51[_0x9313('0x48')]===0x0){return db[_0x9313('0x49')][_0x9313('0x43')]({'name':_0x496ff5[_0x9313('0x25')],'resourceId':_0x496ff5['id'],'type':_0x8bcb51[_0x9313('0x25')],'sectionId':_0x8bcb51['id']},{})[_0x9313('0x20')](function(){return _0x4e2d88;});}else{return _0x4e2d88;}})[_0x9313('0x3e')](function(_0x186ab5){logger[_0x9313('0x23')](_0x9313('0x4a'),_0x186ab5);throw _0x186ab5;});}return _0x4e2d88;})[_0x9313('0x20')](respondWithResult(_0x522617,0xc9))[_0x9313('0x3e')](handleError(_0x522617,null));};exports['update']=function(_0x376ce3,_0x10779d){if(_0x376ce3[_0x9313('0x44')]['id']){delete _0x376ce3['body']['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x376ce3[_0x9313('0x40')]['id']}})[_0x9313('0x20')](handleEntityNotFound(_0x10779d,null))[_0x9313('0x20')](saveUpdates(_0x376ce3['body'],null))[_0x9313('0x20')](respondWithResult(_0x10779d,null))[_0x9313('0x3e')](handleError(_0x10779d,null));};exports[_0x9313('0x22')]=function(_0x4b1df3,_0x1d77f8){return db[_0x9313('0x29')][_0x9313('0x47')]({'where':{'id':_0x4b1df3[_0x9313('0x40')]['id']}})[_0x9313('0x20')](handleEntityNotFound(_0x1d77f8,null))['then'](removeEntity(_0x1d77f8,null))['catch'](handleError(_0x1d77f8,null));};exports[_0x9313('0x4b')]=function(_0x1275a6,_0x4d9fa3,_0x520c60){return db[_0x9313('0x29')]['find']({'where':{'id':_0x1275a6['params']['id']},'attributes':['name',_0x9313('0x4c'),'savename','output'],'raw':!![]})[_0x9313('0x20')](handleEntityNotFound(_0x4d9fa3,null))['then'](function(_0x1cfe2f){if(_0x1cfe2f){if(!fs[_0x9313('0x4d')](path['join'](config['root'],_0x9313('0x4e'),_0x1cfe2f['savename']))){throw new db[(_0x9313('0x4f'))][(_0x9313('0x50'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x1275a6['query']['exists']){return _0x4d9fa3[_0x9313('0x15')](0xc8);}return _0x4d9fa3[_0x9313('0x4b')](path[_0x9313('0x51')](config[_0x9313('0x52')],'server/files/reports',_0x1cfe2f[_0x9313('0x53')]),util['format']('%s.%s',_0x1cfe2f[_0x9313('0x4c')]||_0x1cfe2f['name'],_0x1cfe2f[_0x9313('0x54')][_0x9313('0x55')]()));}})[_0x9313('0x3e')](handleError(_0x4d9fa3,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 68b7c6c..55088e3 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 _0xc64c=['AnalyticExtractedReport','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define'];(function(_0x53248c,_0x2b8fd6){var _0x127934=function(_0x4e2586){while(--_0x4e2586){_0x53248c['push'](_0x53248c['shift']());}};_0x127934(++_0x2b8fd6);}(_0xc64c,0x146));var _0xcc64=function(_0x143a91,_0x235332){_0x143a91=_0x143a91-0x0;var _0x1906f5=_0xc64c[_0x143a91];return _0x1906f5;};'use strict';var _=require(_0xcc64('0x0'));var util=require(_0xcc64('0x1'));var logger=require(_0xcc64('0x2'))('api');var moment=require(_0xcc64('0x3'));var BPromise=require(_0xcc64('0x4'));var rp=require(_0xcc64('0x5'));var fs=require('fs');var path=require(_0xcc64('0x6'));var rimraf=require(_0xcc64('0x7'));var config=require(_0xcc64('0x8'));var attributes=require(_0xcc64('0x9'));module[_0xcc64('0xa')]=function(_0x28cdaf,_0x119f08){return _0x28cdaf[_0xcc64('0xb')](_0xcc64('0xc'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ea6=['exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','moment','bluebird','rimraf','../../config/environment','./analyticExtractedReport.attributes'];(function(_0x24ee10,_0x5ce599){var _0x34e2ad=function(_0x3c038b){while(--_0x3c038b){_0x24ee10['push'](_0x24ee10['shift']());}};_0x34e2ad(++_0x5ce599);}(_0x4ea6,0x67));var _0x64ea=function(_0x207d2f,_0x44400f){_0x207d2f=_0x207d2f-0x0;var _0x3c3498=_0x4ea6[_0x207d2f];return _0x3c3498;};'use strict';var _=require(_0x64ea('0x0'));var util=require('util');var logger=require(_0x64ea('0x1'))('api');var moment=require(_0x64ea('0x2'));var BPromise=require(_0x64ea('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x64ea('0x4'));var config=require(_0x64ea('0x5'));var attributes=require(_0x64ea('0x6'));module[_0x64ea('0x7')]=function(_0xd2f178,_0x3e748a){return _0xd2f178[_0x64ea('0x8')](_0x64ea('0x9'),attributes,{'tableName':_0x64ea('0xa'),'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 39d4f87..be340a2 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 _0x46ba=['message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x472322,_0x26a31b){var _0x188ecb=function(_0x406a53){while(--_0x406a53){_0x472322['push'](_0x472322['shift']());}};_0x188ecb(++_0x26a31b);}(_0x46ba,0x8c));var _0xa46b=function(_0x7035f8,_0x1fe9ee){_0x7035f8=_0x7035f8-0x0;var _0x226777=_0x46ba[_0x7035f8];return _0x226777;};'use strict';var _=require('lodash');var util=require(_0xa46b('0x0'));var moment=require(_0xa46b('0x1'));var BPromise=require(_0xa46b('0x2'));var rs=require(_0xa46b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa46b('0x4'))['db'];var utils=require(_0xa46b('0x5'));var logger=require(_0xa46b('0x6'))(_0xa46b('0x7'));var config=require(_0xa46b('0x8'));var jayson=require(_0xa46b('0x9'));var client=jayson[_0xa46b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54f04b,_0x18e1a1,_0x4fc2a9){return new BPromise(function(_0x580fc6,_0x44d81f){return client[_0xa46b('0xb')](_0x54f04b,_0x4fc2a9)[_0xa46b('0xc')](function(_0x5d5def){logger[_0xa46b('0xd')](_0xa46b('0xe'),_0x18e1a1,_0xa46b('0xf'));logger[_0xa46b('0x10')](_0xa46b('0x11'),_0x18e1a1,'request\x20sent',JSON[_0xa46b('0x12')](_0x5d5def));if(_0x5d5def[_0xa46b('0x13')]){if(_0x5d5def['error'][_0xa46b('0x14')]===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x18e1a1,_0x5d5def['error'][_0xa46b('0x15')]);return _0x44d81f(_0x5d5def[_0xa46b('0x13')][_0xa46b('0x15')]);}logger[_0xa46b('0x13')](_0xa46b('0xe'),_0x18e1a1,_0x5d5def[_0xa46b('0x13')][_0xa46b('0x15')]);return _0x580fc6(_0x5d5def[_0xa46b('0x13')]['message']);}else{logger[_0xa46b('0xd')](_0xa46b('0xe'),_0x18e1a1,'request\x20sent');_0x580fc6(_0x5d5def[_0xa46b('0x16')][_0xa46b('0x15')]);}})['catch'](function(_0xe4d50b){logger[_0xa46b('0x13')](_0xa46b('0xe'),_0x18e1a1,_0xe4d50b);_0x44d81f(_0xe4d50b);});});} \ No newline at end of file +var _0x704f=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x584b4f,_0x3894cf){var _0x4a2261=function(_0x3cf8c9){while(--_0x3cf8c9){_0x584b4f['push'](_0x584b4f['shift']());}};_0x4a2261(++_0x3894cf);}(_0x704f,0xff));var _0xf704=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0x704f[_0x1ddedd];return _0xa3e1ac;};'use strict';var _=require(_0xf704('0x0'));var util=require(_0xf704('0x1'));var moment=require(_0xf704('0x2'));var BPromise=require(_0xf704('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf704('0x4'));var db=require(_0xf704('0x5'))['db'];var utils=require(_0xf704('0x6'));var logger=require(_0xf704('0x7'))('rpc');var config=require(_0xf704('0x8'));var jayson=require(_0xf704('0x9'));var client=jayson[_0xf704('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x442abf,_0x4af871,_0xa656d){return new BPromise(function(_0x208dbf,_0x241a9a){return client[_0xf704('0xb')](_0x442abf,_0xa656d)['then'](function(_0x218b41){logger[_0xf704('0xc')](_0xf704('0xd'),_0x4af871,_0xf704('0xe'));logger[_0xf704('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x4af871,_0xf704('0xe'),JSON['stringify'](_0x218b41));if(_0x218b41[_0xf704('0x10')]){if(_0x218b41[_0xf704('0x10')][_0xf704('0x11')]===0x1f4){logger[_0xf704('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x4af871,_0x218b41[_0xf704('0x10')][_0xf704('0x12')]);return _0x241a9a(_0x218b41[_0xf704('0x10')]['message']);}logger[_0xf704('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x4af871,_0x218b41[_0xf704('0x10')][_0xf704('0x12')]);return _0x208dbf(_0x218b41[_0xf704('0x10')]['message']);}else{logger[_0xf704('0xc')](_0xf704('0xd'),_0x4af871,_0xf704('0xe'));_0x208dbf(_0x218b41[_0xf704('0x13')]['message']);}})[_0xf704('0x14')](function(_0x23f950){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x4af871,_0x23f950);_0x241a9a(_0x23f950);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 6e0151d..657cc58 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 _0xf8cb=['/:id/download','download','create','update','delete','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','index','get','/:id'];(function(_0x16421a,_0x1eaf1e){var _0x28427a=function(_0x498551){while(--_0x498551){_0x16421a['push'](_0x16421a['shift']());}};_0x28427a(++_0x1eaf1e);}(_0xf8cb,0x15c));var _0xbf8c=function(_0x52cb3a,_0x166ed5){_0x52cb3a=_0x52cb3a-0x0;var _0x134363=_0xf8cb[_0x52cb3a];return _0x134363;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbf8c('0x0'));var timeout=require(_0xbf8c('0x1'));var express=require('express');var router=express[_0xbf8c('0x2')]();var fs_extra=require(_0xbf8c('0x3'));var auth=require(_0xbf8c('0x4'));var interaction=require(_0xbf8c('0x5'));var config=require(_0xbf8c('0x6'));var controller=require(_0xbf8c('0x7'));router['get']('/',auth[_0xbf8c('0x8')](),controller[_0xbf8c('0x9')]);router[_0xbf8c('0xa')](_0xbf8c('0xb'),auth[_0xbf8c('0x8')](),controller['show']);router[_0xbf8c('0xa')](_0xbf8c('0xc'),auth['isAuthenticated'](),controller[_0xbf8c('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbf8c('0xe')]);router['put'](_0xbf8c('0xb'),auth[_0xbf8c('0x8')](),controller[_0xbf8c('0xf')]);router[_0xbf8c('0x10')](_0xbf8c('0xb'),auth[_0xbf8c('0x8')](),controller['destroy']);module[_0xbf8c('0x11')]=router; \ No newline at end of file +var _0xe6a3=['get','index','isAuthenticated','show','/:id/download','download','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xe6a3,0x72));var _0x3e6a=function(_0x26d6d9,_0x431cb8){_0x26d6d9=_0x26d6d9-0x0;var _0x1b4875=_0xe6a3[_0x26d6d9];return _0x1b4875;};'use strict';var multer=require(_0x3e6a('0x0'));var util=require(_0x3e6a('0x1'));var path=require(_0x3e6a('0x2'));var timeout=require(_0x3e6a('0x3'));var express=require(_0x3e6a('0x4'));var router=express[_0x3e6a('0x5')]();var fs_extra=require(_0x3e6a('0x6'));var auth=require(_0x3e6a('0x7'));var interaction=require(_0x3e6a('0x8'));var config=require(_0x3e6a('0x9'));var controller=require(_0x3e6a('0xa'));router[_0x3e6a('0xb')]('/',auth['isAuthenticated'](),controller[_0x3e6a('0xc')]);router[_0x3e6a('0xb')]('/:id',auth[_0x3e6a('0xd')](),controller[_0x3e6a('0xe')]);router[_0x3e6a('0xb')](_0x3e6a('0xf'),auth[_0x3e6a('0xd')](),controller[_0x3e6a('0x10')]);router[_0x3e6a('0x11')]('/',auth[_0x3e6a('0xd')](),controller[_0x3e6a('0x12')]);router[_0x3e6a('0x13')](_0x3e6a('0x14'),auth['isAuthenticated'](),controller[_0x3e6a('0x15')]);router[_0x3e6a('0x16')](_0x3e6a('0x14'),auth['isAuthenticated'](),controller[_0x3e6a('0x17')]);module[_0x3e6a('0x18')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index bb61a23..4fb1ba4 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 _0xcd57=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x6d285c,_0x24d53d){var _0x290ad2=function(_0x3c60a6){while(--_0x3c60a6){_0x6d285c['push'](_0x6d285c['shift']());}};_0x290ad2(++_0x24d53d);}(_0xcd57,0x82));var _0x7cd5=function(_0x5e462b,_0x187b06){_0x5e462b=_0x5e462b-0x0;var _0xb01a65=_0xcd57[_0x5e462b];return _0xb01a65;};'use strict';var Sequelize=require(_0x7cd5('0x0'));module[_0x7cd5('0x1')]={'field':{'type':Sequelize[_0x7cd5('0x2')]},'alias':{'type':Sequelize[_0x7cd5('0x3')]},'function':{'type':Sequelize[_0x7cd5('0x3')]},'format':{'type':Sequelize[_0x7cd5('0x3')]},'groupBy':{'type':Sequelize[_0x7cd5('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x7cd5('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x5974=['STRING','BOOLEAN','exports','TEXT'];(function(_0x5effa6,_0x3b5c2e){var _0xd7022f=function(_0xd92fe8){while(--_0xd92fe8){_0x5effa6['push'](_0x5effa6['shift']());}};_0xd7022f(++_0x3b5c2e);}(_0x5974,0x112));var _0x4597=function(_0xa6df52,_0x1b8584){_0xa6df52=_0xa6df52-0x0;var _0x5edd57=_0x5974[_0xa6df52];return _0x5edd57;};'use strict';var Sequelize=require('sequelize');module[_0x4597('0x0')]={'field':{'type':Sequelize[_0x4597('0x1')]},'alias':{'type':Sequelize[_0x4597('0x2')]},'function':{'type':Sequelize[_0x4597('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x4597('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x4597('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index f0c1f9d..8104d5c 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 _0xfab5=['findAll','rows','catch','show','AnalyticFieldReport','find','create','bulkCreate','body','params','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','transaction','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','error','send','map','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','fields','length','nolimit','order','pick','filter','where','VIRTUAL','merge','options','includeAll','include'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0xfab5,0x1ea));var _0x5fab=function(_0x17c10a,_0xc9ee44){_0x17c10a=_0x17c10a-0x0;var _0x149440=_0xfab5[_0x17c10a];return _0x149440;};'use strict';var emlformat=require(_0x5fab('0x0'));var rimraf=require(_0x5fab('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5fab('0x2'));var moment=require(_0x5fab('0x3'));var BPromise=require(_0x5fab('0x4'));var Mustache=require(_0x5fab('0x5'));var util=require(_0x5fab('0x6'));var path=require(_0x5fab('0x7'));var sox=require('sox');var csv=require(_0x5fab('0x8'));var ejs=require(_0x5fab('0x9'));var fs=require('fs');var fs_extra=require(_0x5fab('0xa'));var _=require(_0x5fab('0xb'));var squel=require(_0x5fab('0xc'));var crypto=require('crypto');var jsforce=require(_0x5fab('0xd'));var deskjs=require(_0x5fab('0xe'));var toCsv=require(_0x5fab('0x8'));var querystring=require(_0x5fab('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5fab('0x10'));var qs=require(_0x5fab('0x11'));var as=require(_0x5fab('0x12'));var hardwareService=require(_0x5fab('0x13'));var logger=require(_0x5fab('0x14'))('api');var utils=require(_0x5fab('0x15'));var config=require(_0x5fab('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f2ab8,_0x244f54){_0x244f54=_0x244f54||0xcc;return function(_0x59c8e2){if(_0x59c8e2){return _0x3f2ab8[_0x5fab('0x17')](_0x244f54);}return _0x3f2ab8[_0x5fab('0x18')](_0x244f54)[_0x5fab('0x19')]();};}function respondWithResult(_0x420c8f,_0x19c4d7){_0x19c4d7=_0x19c4d7||0xc8;return function(_0x50f938){if(_0x50f938){return _0x420c8f['status'](_0x19c4d7)[_0x5fab('0x1a')](_0x50f938);}};}function respondWithFilteredResult(_0xb673e5,_0x13302c){return function(_0x2970a6){if(_0x2970a6){var _0x2b673d=typeof _0x13302c['offset']==='undefined'&&typeof _0x13302c[_0x5fab('0x1b')]==='undefined';var _0x2dd628=_0x2970a6[_0x5fab('0x1c')];var _0x15f918=_0x2b673d?0x0:_0x13302c[_0x5fab('0x1d')];var _0x39b0d9=_0x2b673d?_0x2970a6['count']:_0x13302c['offset']+_0x13302c['limit'];var _0x445567;if(_0x39b0d9>=_0x2dd628){_0x39b0d9=_0x2dd628;_0x445567=0xc8;}else{_0x445567=0xce;}_0xb673e5[_0x5fab('0x18')](_0x445567);return _0xb673e5[_0x5fab('0x1e')](_0x5fab('0x1f'),_0x15f918+'-'+_0x39b0d9+'/'+_0x2dd628)[_0x5fab('0x1a')](_0x2970a6);}return null;};}function patchUpdates(_0x1d9488){return function(_0x410679){try{jsonpatch[_0x5fab('0x20')](_0x410679,_0x1d9488,!![]);}catch(_0x407615){return BPromise['reject'](_0x407615);}return _0x410679[_0x5fab('0x21')]();};}function saveUpdates(_0x45b9aa,_0xb9c8b4){return function(_0x3b19f1){if(_0x3b19f1){return _0x3b19f1[_0x5fab('0x22')](_0x45b9aa)[_0x5fab('0x23')](function(_0xd024d0){return _0xd024d0;});}return null;};}function removeEntity(_0x4eb221,_0x286047){return function(_0x47a42c){if(_0x47a42c){return _0x47a42c[_0x5fab('0x24')]()[_0x5fab('0x23')](function(){_0x4eb221['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x312d60,_0x509278){return function(_0x26ddc9){if(!_0x26ddc9){_0x312d60[_0x5fab('0x17')](0x194);}return _0x26ddc9;};}function handleError(_0x2a8d4,_0x55a553){_0x55a553=_0x55a553||0x1f4;return function(_0x25fa21){logger[_0x5fab('0x25')](_0x25fa21['stack']);if(_0x25fa21['name']){delete _0x25fa21['name'];}_0x2a8d4[_0x5fab('0x18')](_0x55a553)[_0x5fab('0x26')](_0x25fa21);};}exports['index']=function(_0x4eb045,_0xf1acdf){var _0x40395a={},_0x5f4d40={},_0x32214c={'count':0x0,'rows':[]};var _0x59f20f=_[_0x5fab('0x27')](db['AnalyticFieldReport'][_0x5fab('0x28')],function(_0x30fe37){return{'name':_0x30fe37[_0x5fab('0x29')],'type':_0x30fe37[_0x5fab('0x2a')][_0x5fab('0x2b')]};});_0x5f4d40[_0x5fab('0x2c')]=_[_0x5fab('0x27')](_0x59f20f,_0x5fab('0x2d'));_0x5f4d40['query']=_[_0x5fab('0x2e')](_0x4eb045[_0x5fab('0x2f')]);_0x5f4d40[_0x5fab('0x30')]=_[_0x5fab('0x31')](_0x5f4d40[_0x5fab('0x2c')],_0x5f4d40[_0x5fab('0x2f')]);_0x40395a[_0x5fab('0x32')]=_[_0x5fab('0x31')](_0x5f4d40[_0x5fab('0x2c')],qs[_0x5fab('0x33')](_0x4eb045['query'][_0x5fab('0x33')]));_0x40395a['attributes']=_0x40395a[_0x5fab('0x32')][_0x5fab('0x34')]?_0x40395a[_0x5fab('0x32')]:_0x5f4d40[_0x5fab('0x2c')];if(!_0x4eb045[_0x5fab('0x2f')]['hasOwnProperty'](_0x5fab('0x35'))){_0x40395a[_0x5fab('0x1b')]=qs[_0x5fab('0x1b')](_0x4eb045[_0x5fab('0x2f')][_0x5fab('0x1b')]);_0x40395a[_0x5fab('0x1d')]=qs[_0x5fab('0x1d')](_0x4eb045[_0x5fab('0x2f')][_0x5fab('0x1d')]);}_0x40395a[_0x5fab('0x36')]=qs['sort'](_0x4eb045[_0x5fab('0x2f')]['sort']);_0x40395a['where']=qs[_0x5fab('0x30')](_[_0x5fab('0x37')](_0x4eb045[_0x5fab('0x2f')],_0x5f4d40[_0x5fab('0x30')]),_0x59f20f);if(_0x4eb045[_0x5fab('0x2f')][_0x5fab('0x38')]){_0x40395a[_0x5fab('0x39')]=_['merge'](_0x40395a[_0x5fab('0x39')],{'$or':_[_0x5fab('0x27')](_0x59f20f,function(_0x3ec1a8){if(_0x3ec1a8[_0x5fab('0x2a')]!==_0x5fab('0x3a')){var _0x392d5a={};_0x392d5a[_0x3ec1a8[_0x5fab('0x2d')]]={'$like':'%'+_0x4eb045[_0x5fab('0x2f')][_0x5fab('0x38')]+'%'};return _0x392d5a;}})});}_0x40395a=_[_0x5fab('0x3b')]({},_0x40395a,_0x4eb045[_0x5fab('0x3c')]);var _0x2df2d4={'where':_0x40395a['where']};return db['AnalyticFieldReport']['count'](_0x2df2d4)['then'](function(_0x40e7a2){_0x32214c[_0x5fab('0x1c')]=_0x40e7a2;if(_0x4eb045[_0x5fab('0x2f')][_0x5fab('0x3d')]){_0x40395a[_0x5fab('0x3e')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x5fab('0x3f')](_0x40395a);})['then'](function(_0x938027){_0x32214c[_0x5fab('0x40')]=_0x938027;return _0x32214c;})['then'](respondWithFilteredResult(_0xf1acdf,_0x40395a))[_0x5fab('0x41')](handleError(_0xf1acdf,null));};exports[_0x5fab('0x42')]=function(_0x33cae0,_0x12c8ed){var _0xd3238f={'raw':![],'where':{'id':_0x33cae0['params']['id']}},_0x24dd19={};_0x24dd19['model']=_[_0x5fab('0x2e')](db[_0x5fab('0x43')][_0x5fab('0x28')]);_0x24dd19[_0x5fab('0x2f')]=_[_0x5fab('0x2e')](_0x33cae0[_0x5fab('0x2f')]);_0x24dd19[_0x5fab('0x30')]=_[_0x5fab('0x31')](_0x24dd19[_0x5fab('0x2c')],_0x24dd19[_0x5fab('0x2f')]);_0xd3238f[_0x5fab('0x32')]=_[_0x5fab('0x31')](_0x24dd19['model'],qs[_0x5fab('0x33')](_0x33cae0[_0x5fab('0x2f')]['fields']));_0xd3238f[_0x5fab('0x32')]=_0xd3238f[_0x5fab('0x32')][_0x5fab('0x34')]?_0xd3238f[_0x5fab('0x32')]:_0x24dd19[_0x5fab('0x2c')];if(_0x33cae0[_0x5fab('0x2f')][_0x5fab('0x3d')]){_0xd3238f[_0x5fab('0x3e')]=[{'all':!![]}];}_0xd3238f=_[_0x5fab('0x3b')]({},_0xd3238f,_0x33cae0[_0x5fab('0x3c')]);return db[_0x5fab('0x43')][_0x5fab('0x44')](_0xd3238f)['then'](handleEntityNotFound(_0x12c8ed,null))['then'](respondWithResult(_0x12c8ed,null))['catch'](handleError(_0x12c8ed,null));};exports[_0x5fab('0x45')]=function(_0xdeedd4,_0x442a0a){return db[_0x5fab('0x43')]['create'](_0xdeedd4['body'],{})[_0x5fab('0x23')](respondWithResult(_0x442a0a,0xc9))[_0x5fab('0x41')](handleError(_0x442a0a,null));};exports[_0x5fab('0x46')]=function(_0x5ce646,_0xf161f5){return db['AnalyticFieldReport']['bulkCreate'](_0x5ce646[_0x5fab('0x47')],{'raw':![],'individualHooks':!![]})[_0x5fab('0x23')](respondWithResult(_0xf161f5,0xc9))[_0x5fab('0x41')](handleError(_0xf161f5,null));};exports['update']=function(_0x13faeb,_0x579de4){if(_0x13faeb[_0x5fab('0x47')]['id']){delete _0x13faeb[_0x5fab('0x47')]['id'];}return db[_0x5fab('0x43')][_0x5fab('0x44')]({'where':{'id':_0x13faeb[_0x5fab('0x48')]['id']}})['then'](handleEntityNotFound(_0x579de4,null))[_0x5fab('0x23')](saveUpdates(_0x13faeb[_0x5fab('0x47')],null))['then'](respondWithResult(_0x579de4,null))[_0x5fab('0x41')](handleError(_0x579de4,null));};exports[_0x5fab('0x24')]=function(_0x1641df,_0x26d72b){return db['AnalyticFieldReport']['find']({'where':{'id':_0x1641df[_0x5fab('0x48')]['id']}})[_0x5fab('0x23')](handleEntityNotFound(_0x26d72b,null))[_0x5fab('0x23')](removeEntity(_0x26d72b,null))[_0x5fab('0x41')](handleError(_0x26d72b,null));};exports[_0x5fab('0x49')]=function(_0x541c3d,_0xca17c0){return db[_0x5fab('0x43')][_0x5fab('0x24')]({'where':{'id':_0x541c3d['query'][_0x5fab('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0x5fab('0x23')](respondWithResult(_0xca17c0,0xcc))[_0x5fab('0x41')](handleError(_0xca17c0,null));};exports[_0x5fab('0x4b')]=function(_0x5156c8,_0x420331,_0x5508b3){return db[_0x5fab('0x4c')][_0x5fab('0x4d')]({'where':{'id':_0x5156c8[_0x5fab('0x48')]['id']}})[_0x5fab('0x23')](handleEntityNotFound(_0x420331,null))[_0x5fab('0x23')](function(_0x1d66a3){if(_0x1d66a3){return db['sequelize'][_0x5fab('0x4e')](function(_0x24773c){return db[_0x5fab('0x43')][_0x5fab('0x24')]({'where':{'CustomReportId':_0x5156c8['params']['id']},'transaction':_0x24773c})['then'](function(_0x3739d8){var _0x371a81=_[_0x5fab('0x27')](_0x5156c8[_0x5fab('0x47')],function(_0x2b9286){delete _0x2b9286['id'];_0x2b9286['CustomReportId']=_0x5156c8['params']['id'];return _0x2b9286;});return db[_0x5fab('0x43')][_0x5fab('0x46')](_0x371a81,{'transaction':_0x24773c});});})[_0x5fab('0x23')](function(){return db[_0x5fab('0x43')][_0x5fab('0x3f')]({'where':{'CustomReportId':_0x5156c8[_0x5fab('0x48')]['id']}});});}})[_0x5fab('0x23')](respondWithResult(_0x420331,null))['catch'](handleError(_0x420331,null));}; \ No newline at end of file +var _0x4b32=['filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','rows','show','params','find','create','body','catch','bulkCreate','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','findAll','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','error','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x425af8,_0x366c35){var _0x5c2eb1=function(_0x44785f){while(--_0x44785f){_0x425af8['push'](_0x425af8['shift']());}};_0x5c2eb1(++_0x366c35);}(_0x4b32,0x10b));var _0x24b3=function(_0x4c8c4d,_0x170fc3){_0x4c8c4d=_0x4c8c4d-0x0;var _0x7c72d2=_0x4b32[_0x4c8c4d];return _0x7c72d2;};'use strict';var emlformat=require(_0x24b3('0x0'));var rimraf=require(_0x24b3('0x1'));var zipdir=require(_0x24b3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x24b3('0x3'));var moment=require(_0x24b3('0x4'));var BPromise=require(_0x24b3('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x24b3('0x6'));var sox=require(_0x24b3('0x7'));var csv=require(_0x24b3('0x8'));var ejs=require(_0x24b3('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x24b3('0xa'));var squel=require(_0x24b3('0xb'));var crypto=require(_0x24b3('0xc'));var jsforce=require(_0x24b3('0xd'));var deskjs=require(_0x24b3('0xe'));var toCsv=require('to-csv');var querystring=require(_0x24b3('0xf'));var Papa=require(_0x24b3('0x10'));var Redis=require(_0x24b3('0x11'));var authService=require(_0x24b3('0x12'));var qs=require(_0x24b3('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x24b3('0x14'));var config=require(_0x24b3('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x24b3('0x16'))['db'];function respondWithStatusCode(_0x4eb7cc,_0x4f5baa){_0x4f5baa=_0x4f5baa||0xcc;return function(_0x289cdf){if(_0x289cdf){return _0x4eb7cc[_0x24b3('0x17')](_0x4f5baa);}return _0x4eb7cc[_0x24b3('0x18')](_0x4f5baa)[_0x24b3('0x19')]();};}function respondWithResult(_0x567679,_0x5e8de6){_0x5e8de6=_0x5e8de6||0xc8;return function(_0x2f33b5){if(_0x2f33b5){return _0x567679['status'](_0x5e8de6)[_0x24b3('0x1a')](_0x2f33b5);}};}function respondWithFilteredResult(_0x415fe5,_0x58e6be){return function(_0x12c601){if(_0x12c601){var _0xf6f7d7=typeof _0x58e6be[_0x24b3('0x1b')]===_0x24b3('0x1c')&&typeof _0x58e6be[_0x24b3('0x1d')]===_0x24b3('0x1c');var _0x24f2f3=_0x12c601[_0x24b3('0x1e')];var _0x4b9d82=_0xf6f7d7?0x0:_0x58e6be['offset'];var _0xc7e0a2=_0xf6f7d7?_0x12c601[_0x24b3('0x1e')]:_0x58e6be[_0x24b3('0x1b')]+_0x58e6be[_0x24b3('0x1d')];var _0xb45051;if(_0xc7e0a2>=_0x24f2f3){_0xc7e0a2=_0x24f2f3;_0xb45051=0xc8;}else{_0xb45051=0xce;}_0x415fe5['status'](_0xb45051);return _0x415fe5['set'](_0x24b3('0x1f'),_0x4b9d82+'-'+_0xc7e0a2+'/'+_0x24f2f3)['json'](_0x12c601);}return null;};}function patchUpdates(_0x294836){return function(_0x42496f){try{jsonpatch['apply'](_0x42496f,_0x294836,!![]);}catch(_0x4c1a7e){return BPromise[_0x24b3('0x20')](_0x4c1a7e);}return _0x42496f['save']();};}function saveUpdates(_0x5bae9c,_0x26fc51){return function(_0x54350b){if(_0x54350b){return _0x54350b[_0x24b3('0x21')](_0x5bae9c)[_0x24b3('0x22')](function(_0x380c10){return _0x380c10;});}return null;};}function removeEntity(_0x2ddc20,_0x52c204){return function(_0x32ecc1){if(_0x32ecc1){return _0x32ecc1[_0x24b3('0x23')]()['then'](function(){_0x2ddc20['status'](0xcc)[_0x24b3('0x19')]();});}};}function handleEntityNotFound(_0x4f5cc6,_0x1036a9){return function(_0x420e3c){if(!_0x420e3c){_0x4f5cc6['sendStatus'](0x194);}return _0x420e3c;};}function handleError(_0x3f3dcf,_0x102a7e){_0x102a7e=_0x102a7e||0x1f4;return function(_0x201167){logger[_0x24b3('0x24')](_0x201167['stack']);if(_0x201167[_0x24b3('0x25')]){delete _0x201167[_0x24b3('0x25')];}_0x3f3dcf[_0x24b3('0x18')](_0x102a7e)[_0x24b3('0x26')](_0x201167);};}exports[_0x24b3('0x27')]=function(_0x28f053,_0x5c7e15){var _0x275a7f={},_0x4383ce={},_0x12c9eb={'count':0x0,'rows':[]};var _0xb7adb7=_[_0x24b3('0x28')](db[_0x24b3('0x29')][_0x24b3('0x2a')],function(_0x73b2e2){return{'name':_0x73b2e2[_0x24b3('0x2b')],'type':_0x73b2e2[_0x24b3('0x2c')][_0x24b3('0x2d')]};});_0x4383ce[_0x24b3('0x2e')]=_[_0x24b3('0x28')](_0xb7adb7,_0x24b3('0x25'));_0x4383ce[_0x24b3('0x2f')]=_[_0x24b3('0x30')](_0x28f053[_0x24b3('0x2f')]);_0x4383ce[_0x24b3('0x31')]=_['intersection'](_0x4383ce[_0x24b3('0x2e')],_0x4383ce[_0x24b3('0x2f')]);_0x275a7f[_0x24b3('0x32')]=_[_0x24b3('0x33')](_0x4383ce[_0x24b3('0x2e')],qs[_0x24b3('0x34')](_0x28f053['query']['fields']));_0x275a7f['attributes']=_0x275a7f[_0x24b3('0x32')][_0x24b3('0x35')]?_0x275a7f[_0x24b3('0x32')]:_0x4383ce[_0x24b3('0x2e')];if(!_0x28f053[_0x24b3('0x2f')][_0x24b3('0x36')]('nolimit')){_0x275a7f[_0x24b3('0x1d')]=qs[_0x24b3('0x1d')](_0x28f053[_0x24b3('0x2f')][_0x24b3('0x1d')]);_0x275a7f[_0x24b3('0x1b')]=qs[_0x24b3('0x1b')](_0x28f053['query'][_0x24b3('0x1b')]);}_0x275a7f['order']=qs[_0x24b3('0x37')](_0x28f053[_0x24b3('0x2f')][_0x24b3('0x37')]);_0x275a7f[_0x24b3('0x38')]=qs[_0x24b3('0x31')](_[_0x24b3('0x39')](_0x28f053['query'],_0x4383ce[_0x24b3('0x31')]),_0xb7adb7);if(_0x28f053[_0x24b3('0x2f')]['filter']){_0x275a7f[_0x24b3('0x38')]=_['merge'](_0x275a7f[_0x24b3('0x38')],{'$or':_[_0x24b3('0x28')](_0xb7adb7,function(_0x39168e){if(_0x39168e[_0x24b3('0x2c')]!==_0x24b3('0x3a')){var _0x422ccc={};_0x422ccc[_0x39168e[_0x24b3('0x25')]]={'$like':'%'+_0x28f053[_0x24b3('0x2f')][_0x24b3('0x3b')]+'%'};return _0x422ccc;}})});}_0x275a7f=_[_0x24b3('0x3c')]({},_0x275a7f,_0x28f053[_0x24b3('0x3d')]);var _0x4c3071={'where':_0x275a7f['where']};return db[_0x24b3('0x29')][_0x24b3('0x1e')](_0x4c3071)[_0x24b3('0x22')](function(_0x92649e){_0x12c9eb[_0x24b3('0x1e')]=_0x92649e;if(_0x28f053['query'][_0x24b3('0x3e')]){_0x275a7f[_0x24b3('0x3f')]=[{'all':!![]}];}return db[_0x24b3('0x29')]['findAll'](_0x275a7f);})[_0x24b3('0x22')](function(_0x431c7e){_0x12c9eb[_0x24b3('0x40')]=_0x431c7e;return _0x12c9eb;})[_0x24b3('0x22')](respondWithFilteredResult(_0x5c7e15,_0x275a7f))['catch'](handleError(_0x5c7e15,null));};exports[_0x24b3('0x41')]=function(_0x360b88,_0x4ba54d){var _0x4c6de5={'raw':![],'where':{'id':_0x360b88[_0x24b3('0x42')]['id']}},_0x18511d={};_0x18511d['model']=_[_0x24b3('0x30')](db[_0x24b3('0x29')]['rawAttributes']);_0x18511d[_0x24b3('0x2f')]=_[_0x24b3('0x30')](_0x360b88[_0x24b3('0x2f')]);_0x18511d[_0x24b3('0x31')]=_[_0x24b3('0x33')](_0x18511d[_0x24b3('0x2e')],_0x18511d[_0x24b3('0x2f')]);_0x4c6de5[_0x24b3('0x32')]=_[_0x24b3('0x33')](_0x18511d[_0x24b3('0x2e')],qs[_0x24b3('0x34')](_0x360b88[_0x24b3('0x2f')][_0x24b3('0x34')]));_0x4c6de5[_0x24b3('0x32')]=_0x4c6de5[_0x24b3('0x32')]['length']?_0x4c6de5[_0x24b3('0x32')]:_0x18511d['model'];if(_0x360b88[_0x24b3('0x2f')][_0x24b3('0x3e')]){_0x4c6de5[_0x24b3('0x3f')]=[{'all':!![]}];}_0x4c6de5=_['merge']({},_0x4c6de5,_0x360b88[_0x24b3('0x3d')]);return db[_0x24b3('0x29')][_0x24b3('0x43')](_0x4c6de5)['then'](handleEntityNotFound(_0x4ba54d,null))[_0x24b3('0x22')](respondWithResult(_0x4ba54d,null))['catch'](handleError(_0x4ba54d,null));};exports[_0x24b3('0x44')]=function(_0xb68621,_0x395c16){return db['AnalyticFieldReport'][_0x24b3('0x44')](_0xb68621[_0x24b3('0x45')],{})[_0x24b3('0x22')](respondWithResult(_0x395c16,0xc9))[_0x24b3('0x46')](handleError(_0x395c16,null));};exports['bulkCreate']=function(_0x1bce44,_0x27cc13){return db['AnalyticFieldReport'][_0x24b3('0x47')](_0x1bce44[_0x24b3('0x45')],{'raw':![],'individualHooks':!![]})[_0x24b3('0x22')](respondWithResult(_0x27cc13,0xc9))['catch'](handleError(_0x27cc13,null));};exports[_0x24b3('0x21')]=function(_0x30ded9,_0x47ba05){if(_0x30ded9[_0x24b3('0x45')]['id']){delete _0x30ded9[_0x24b3('0x45')]['id'];}return db[_0x24b3('0x29')][_0x24b3('0x43')]({'where':{'id':_0x30ded9['params']['id']}})[_0x24b3('0x22')](handleEntityNotFound(_0x47ba05,null))['then'](saveUpdates(_0x30ded9[_0x24b3('0x45')],null))[_0x24b3('0x22')](respondWithResult(_0x47ba05,null))[_0x24b3('0x46')](handleError(_0x47ba05,null));};exports[_0x24b3('0x23')]=function(_0x5f236e,_0x7ea218){return db[_0x24b3('0x29')][_0x24b3('0x43')]({'where':{'id':_0x5f236e['params']['id']}})['then'](handleEntityNotFound(_0x7ea218,null))['then'](removeEntity(_0x7ea218,null))[_0x24b3('0x46')](handleError(_0x7ea218,null));};exports['bulkDestroy']=function(_0x507ac5,_0x11ab3d){return db[_0x24b3('0x29')][_0x24b3('0x23')]({'where':{'id':_0x507ac5['query']['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x11ab3d,0xcc))[_0x24b3('0x46')](handleError(_0x11ab3d,null));};exports[_0x24b3('0x48')]=function(_0x5c1a1e,_0x110742,_0xf8a99a){return db[_0x24b3('0x49')][_0x24b3('0x4a')]({'where':{'id':_0x5c1a1e[_0x24b3('0x42')]['id']}})[_0x24b3('0x22')](handleEntityNotFound(_0x110742,null))['then'](function(_0x532d00){if(_0x532d00){return db[_0x24b3('0x4b')][_0x24b3('0x4c')](function(_0x5a1821){return db[_0x24b3('0x29')][_0x24b3('0x23')]({'where':{'CustomReportId':_0x5c1a1e[_0x24b3('0x42')]['id']},'transaction':_0x5a1821})['then'](function(_0xa08144){var _0x421fac=_['map'](_0x5c1a1e['body'],function(_0x12ae00){delete _0x12ae00['id'];_0x12ae00[_0x24b3('0x4d')]=_0x5c1a1e['params']['id'];return _0x12ae00;});return db[_0x24b3('0x29')][_0x24b3('0x47')](_0x421fac,{'transaction':_0x5a1821});});})['then'](function(){return db[_0x24b3('0x29')][_0x24b3('0x4e')]({'where':{'CustomReportId':_0x5c1a1e[_0x24b3('0x42')]['id']}});});}})[_0x24b3('0x22')](respondWithResult(_0x110742,null))['catch'](handleError(_0x110742,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 0280af0..d004536 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 _0xa69d=['analytics_report_fields','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport'];(function(_0x8a7787,_0x198490){var _0x57676c=function(_0x1fd6cf){while(--_0x1fd6cf){_0x8a7787['push'](_0x8a7787['shift']());}};_0x57676c(++_0x198490);}(_0xa69d,0x71));var _0xda69=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa69d[_0x40ac5e];return _0x2839d6;};'use strict';var _=require(_0xda69('0x0'));var util=require(_0xda69('0x1'));var logger=require(_0xda69('0x2'))(_0xda69('0x3'));var moment=require(_0xda69('0x4'));var BPromise=require('bluebird');var rp=require(_0xda69('0x5'));var fs=require('fs');var path=require(_0xda69('0x6'));var rimraf=require(_0xda69('0x7'));var config=require(_0xda69('0x8'));var attributes=require(_0xda69('0x9'));module[_0xda69('0xa')]=function(_0xe8381f,_0x1b6e15){return _0xe8381f[_0xda69('0xb')](_0xda69('0xc'),attributes,{'tableName':_0xda69('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x77ea=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','define','AnalyticFieldReport'];(function(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0x77ea,0xc8));var _0xa77e=function(_0x229b90,_0xf796ec){_0x229b90=_0x229b90-0x0;var _0x57e1c5=_0x77ea[_0x229b90];return _0x57e1c5;};'use strict';var _=require(_0xa77e('0x0'));var util=require(_0xa77e('0x1'));var logger=require(_0xa77e('0x2'))(_0xa77e('0x3'));var moment=require(_0xa77e('0x4'));var BPromise=require(_0xa77e('0x5'));var rp=require(_0xa77e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa77e('0x7'));var attributes=require('./analyticFieldReport.attributes');module['exports']=function(_0x5d2ccd,_0x3d1259){return _0x5d2ccd[_0xa77e('0x8')](_0xa77e('0x9'),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 e00eb3d..178b70d 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 _0xd8ba=['AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x55ad10,_0xe59689){var _0xb4694b=function(_0x3302da){while(--_0x3302da){_0x55ad10['push'](_0x55ad10['shift']());}};_0xb4694b(++_0xe59689);}(_0xd8ba,0xed));var _0xad8b=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xd8ba[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xad8b('0x0'));var util=require(_0xad8b('0x1'));var moment=require(_0xad8b('0x2'));var BPromise=require(_0xad8b('0x3'));var rs=require(_0xad8b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xad8b('0x5'))['db'];var utils=require(_0xad8b('0x6'));var logger=require(_0xad8b('0x7'))('rpc');var config=require(_0xad8b('0x8'));var jayson=require(_0xad8b('0x9'));var client=jayson[_0xad8b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b808a,_0x38a525,_0x598aea){return new BPromise(function(_0x25503f,_0x43d372){return client[_0xad8b('0xb')](_0x2b808a,_0x598aea)['then'](function(_0x4727e4){logger['info'](_0xad8b('0xc'),_0x38a525,_0xad8b('0xd'));logger[_0xad8b('0xe')](_0xad8b('0xf'),_0x38a525,_0xad8b('0xd'),JSON['stringify'](_0x4727e4));if(_0x4727e4[_0xad8b('0x10')]){if(_0x4727e4[_0xad8b('0x10')]['code']===0x1f4){logger[_0xad8b('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x38a525,_0x4727e4[_0xad8b('0x10')][_0xad8b('0x11')]);return _0x43d372(_0x4727e4[_0xad8b('0x10')]['message']);}logger[_0xad8b('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x38a525,_0x4727e4[_0xad8b('0x10')][_0xad8b('0x11')]);return _0x25503f(_0x4727e4['error'][_0xad8b('0x11')]);}else{logger[_0xad8b('0x12')](_0xad8b('0xc'),_0x38a525,_0xad8b('0xd'));_0x25503f(_0x4727e4[_0xad8b('0x13')][_0xad8b('0x11')]);}})[_0xad8b('0x14')](function(_0x326859){logger[_0xad8b('0x10')](_0xad8b('0xc'),_0x38a525,_0x326859);_0x43d372(_0x326859);});});} \ No newline at end of file +var _0x363f=['jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment'];(function(_0x3c868c,_0x2cdb1a){var _0x50687d=function(_0x27b43b){while(--_0x27b43b){_0x3c868c['push'](_0x3c868c['shift']());}};_0x50687d(++_0x2cdb1a);}(_0x363f,0xd0));var _0xf363=function(_0x18daa2,_0x1362c9){_0x18daa2=_0x18daa2-0x0;var _0x46a063=_0x363f[_0x18daa2];return _0x46a063;};'use strict';var _=require(_0xf363('0x0'));var util=require(_0xf363('0x1'));var moment=require(_0xf363('0x2'));var BPromise=require('bluebird');var rs=require(_0xf363('0x3'));var fs=require('fs');var Redis=require(_0xf363('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf363('0x5'));var logger=require('../../config/logger')(_0xf363('0x6'));var config=require(_0xf363('0x7'));var jayson=require(_0xf363('0x8'));var client=jayson[_0xf363('0x9')][_0xf363('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc591e4,_0x39f991,_0x54ae55){return new BPromise(function(_0x3cb12f,_0xb41ce1){return client[_0xf363('0xb')](_0xc591e4,_0x54ae55)[_0xf363('0xc')](function(_0x2026f0){logger[_0xf363('0xd')](_0xf363('0xe'),_0x39f991,'request\x20sent');logger[_0xf363('0xf')](_0xf363('0x10'),_0x39f991,_0xf363('0x11'),JSON[_0xf363('0x12')](_0x2026f0));if(_0x2026f0[_0xf363('0x13')]){if(_0x2026f0[_0xf363('0x13')][_0xf363('0x14')]===0x1f4){logger[_0xf363('0x13')](_0xf363('0xe'),_0x39f991,_0x2026f0[_0xf363('0x13')][_0xf363('0x15')]);return _0xb41ce1(_0x2026f0['error'][_0xf363('0x15')]);}logger[_0xf363('0x13')](_0xf363('0xe'),_0x39f991,_0x2026f0[_0xf363('0x13')]['message']);return _0x3cb12f(_0x2026f0[_0xf363('0x13')][_0xf363('0x15')]);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x39f991,_0xf363('0x11'));_0x3cb12f(_0x2026f0[_0xf363('0x16')]['message']);}})[_0xf363('0x17')](function(_0x2d6221){logger[_0xf363('0x13')](_0xf363('0xe'),_0x39f991,_0x2d6221);_0xb41ce1(_0x2d6221);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index ce68e45..2672cbc 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(_0x23c104,_0x5c0c1d){var _0x2332e1=function(_0x3e5884){while(--_0x3e5884){_0x23c104['push'](_0x23c104['shift']());}};_0x2332e1(++_0x5c0c1d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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(_0x39118c,_0x1a03ed){var _0x2be2b0=function(_0x45078f){while(--_0x45078f){_0x39118c['push'](_0x39118c['shift']());}};_0x2be2b0(++_0x1a03ed);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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 1c2f4bb..c58ec90 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 _0xaa2d=['TEXT','STRING','exports'];(function(_0x22f6b8,_0x2fdce6){var _0x8c4ea5=function(_0x484b55){while(--_0x484b55){_0x22f6b8['push'](_0x22f6b8['shift']());}};_0x8c4ea5(++_0x2fdce6);}(_0xaa2d,0x11c));var _0xdaa2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaa2d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xdaa2('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xdaa2('0x1')]},'description':{'type':Sequelize[_0xdaa2('0x2')]}}; \ No newline at end of file +var _0x8a9d=['STRING','sequelize','exports','name'];(function(_0x14e68f,_0xcb7d3b){var _0x5d69f5=function(_0x3e2b79){while(--_0x3e2b79){_0x14e68f['push'](_0x14e68f['shift']());}};_0x5d69f5(++_0xcb7d3b);}(_0x8a9d,0x1ed));var _0xd8a9=function(_0x59eeaf,_0x56e107){_0x59eeaf=_0x59eeaf-0x0;var _0x119d61=_0x8a9d[_0x59eeaf];return _0x119d61;};'use strict';var Sequelize=require(_0xd8a9('0x0'));module[_0xd8a9('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd8a9('0x2')},'table':{'type':Sequelize[_0xd8a9('0x3')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xd8a9('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index cfa0815..a7b5064 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 _0x7fbe=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','AnalyticMetric','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','rows','show','params','create','body','role','user','Metrics','find','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x4be526,_0x5759ae){var _0x5bb241=function(_0xa1e5e8){while(--_0xa1e5e8){_0x4be526['push'](_0x4be526['shift']());}};_0x5bb241(++_0x5759ae);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x32c97a,_0x29b6fc){_0x32c97a=_0x32c97a-0x0;var _0x5de34d=_0x7fbe[_0x32c97a];return _0x5de34d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7fb('0x0'));var jsonpatch=require(_0xe7fb('0x1'));var rp=require(_0xe7fb('0x2'));var moment=require(_0xe7fb('0x3'));var BPromise=require(_0xe7fb('0x4'));var Mustache=require(_0xe7fb('0x5'));var util=require(_0xe7fb('0x6'));var path=require(_0xe7fb('0x7'));var sox=require(_0xe7fb('0x8'));var csv=require(_0xe7fb('0x9'));var ejs=require(_0xe7fb('0xa'));var fs=require('fs');var fs_extra=require(_0xe7fb('0xb'));var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0x9'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var licenseUtil=require(_0xe7fb('0x19'));var db=require(_0xe7fb('0x1a'))['db'];function respondWithStatusCode(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xcc;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0x1b')](_0x188e1d);}return _0x2437d4[_0xe7fb('0x1c')](_0x188e1d)['end']();};}function respondWithResult(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0xc8;return function(_0x5573ab){if(_0x5573ab){return _0x278b75[_0xe7fb('0x1c')](_0x2225e5)[_0xe7fb('0x1d')](_0x5573ab);}};}function respondWithFilteredResult(_0x482f7d,_0xa76acf){return function(_0x559129){if(_0x559129){var _0x12fff6=typeof _0xa76acf[_0xe7fb('0x1e')]===_0xe7fb('0x1f')&&typeof _0xa76acf[_0xe7fb('0x20')]==='undefined';var _0x892b0f=_0x559129['count'];var _0x293a47=_0x12fff6?0x0:_0xa76acf['offset'];var _0x1e77fd=_0x12fff6?_0x559129[_0xe7fb('0x21')]:_0xa76acf[_0xe7fb('0x1e')]+_0xa76acf[_0xe7fb('0x20')];var _0x5df1a1;if(_0x1e77fd>=_0x892b0f){_0x1e77fd=_0x892b0f;_0x5df1a1=0xc8;}else{_0x5df1a1=0xce;}_0x482f7d[_0xe7fb('0x1c')](_0x5df1a1);return _0x482f7d['set'](_0xe7fb('0x22'),_0x293a47+'-'+_0x1e77fd+'/'+_0x892b0f)['json'](_0x559129);}return null;};}function patchUpdates(_0x15f7a4){return function(_0x4ea664){try{jsonpatch[_0xe7fb('0x23')](_0x4ea664,_0x15f7a4,!![]);}catch(_0x135624){return BPromise['reject'](_0x135624);}return _0x4ea664[_0xe7fb('0x24')]();};}function saveUpdates(_0x4742bd,_0x3ae8f1){return function(_0x4dcb4b){if(_0x4dcb4b){return _0x4dcb4b[_0xe7fb('0x25')](_0x4742bd)[_0xe7fb('0x26')](function(_0x5da3d9){return _0x5da3d9;});}return null;};}function removeEntity(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(_0x35e4db){return _0x35e4db['destroy']()['then'](function(){var _0x4026b1=_0x35e4db[_0xe7fb('0x27')]({'plain':!![]});var _0x2996ae='Metrics';return db[_0xe7fb('0x28')][_0xe7fb('0x29')]({'where':{'type':_0x2996ae,'resourceId':_0x4026b1['id']}})[_0xe7fb('0x26')](function(){return _0x35e4db;});})[_0xe7fb('0x26')](function(){_0x5bea27[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x2a')]();});}};}function handleEntityNotFound(_0x380130,_0x59e015){return function(_0x5df9f2){if(!_0x5df9f2){_0x380130[_0xe7fb('0x1b')](0x194);}return _0x5df9f2;};}function handleError(_0x3bdee9,_0xead63){_0xead63=_0xead63||0x1f4;return function(_0x4fd290){logger[_0xe7fb('0x2b')](_0x4fd290[_0xe7fb('0x2c')]);if(_0x4fd290[_0xe7fb('0x2d')]){delete _0x4fd290[_0xe7fb('0x2d')];}_0x3bdee9[_0xe7fb('0x1c')](_0xead63)[_0xe7fb('0x2e')](_0x4fd290);};}exports[_0xe7fb('0x2f')]=function(_0x3dd0be,_0x4ce993){var _0x3d1fb5={},_0x1742f3={},_0x29d1ca={'count':0x0,'rows':[]};var _0x547a04=_['map'](db[_0xe7fb('0x30')]['rawAttributes'],function(_0xac56b4){return{'name':_0xac56b4[_0xe7fb('0x31')],'type':_0xac56b4[_0xe7fb('0x32')][_0xe7fb('0x33')]};});_0x1742f3['model']=_[_0xe7fb('0x34')](_0x547a04,_0xe7fb('0x2d'));_0x1742f3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x3dd0be[_0xe7fb('0x35')]);_0x1742f3['filters']=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],_0x1742f3[_0xe7fb('0x35')]);_0x3d1fb5[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],qs[_0xe7fb('0x3a')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3a')]));_0x3d1fb5['attributes']=_0x3d1fb5[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x3d1fb5[_0xe7fb('0x39')]:_0x1742f3['model'];if(!_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3c')](_0xe7fb('0x3d'))){_0x3d1fb5[_0xe7fb('0x20')]=qs[_0xe7fb('0x20')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x20')]);_0x3d1fb5[_0xe7fb('0x1e')]=qs[_0xe7fb('0x1e')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x1e')]);}_0x3d1fb5[_0xe7fb('0x3e')]=qs[_0xe7fb('0x3f')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3f')]);_0x3d1fb5[_0xe7fb('0x40')]=qs[_0xe7fb('0x41')](_[_0xe7fb('0x42')](_0x3dd0be[_0xe7fb('0x35')],_0x1742f3['filters']),_0x547a04);if(_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]){_0x3d1fb5[_0xe7fb('0x40')]=_[_0xe7fb('0x44')](_0x3d1fb5['where'],{'$or':_[_0xe7fb('0x34')](_0x547a04,function(_0x186418){if(_0x186418[_0xe7fb('0x32')]!==_0xe7fb('0x45')){var _0x49fe9d={};_0x49fe9d[_0x186418[_0xe7fb('0x2d')]]={'$like':'%'+_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]+'%'};return _0x49fe9d;}})});}_0x3d1fb5=_[_0xe7fb('0x44')]({},_0x3d1fb5,_0x3dd0be[_0xe7fb('0x46')]);var _0xb729fc={'where':_0x3d1fb5['where']};return db[_0xe7fb('0x30')][_0xe7fb('0x21')](_0xb729fc)[_0xe7fb('0x26')](function(_0x4b263d){_0x29d1ca[_0xe7fb('0x21')]=_0x4b263d;if(_0x3dd0be[_0xe7fb('0x35')]['includeAll']){_0x3d1fb5['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x3d1fb5);})['then'](function(_0x900d67){_0x29d1ca[_0xe7fb('0x47')]=_0x900d67;return _0x29d1ca;})[_0xe7fb('0x26')](respondWithFilteredResult(_0x4ce993,_0x3d1fb5))['catch'](handleError(_0x4ce993,null));};exports[_0xe7fb('0x48')]=function(_0x58d743,_0x19277f){var _0x32cfa4={'raw':!![],'where':{'id':_0x58d743[_0xe7fb('0x49')]['id']}},_0x4d29d3={};_0x4d29d3[_0xe7fb('0x38')]=_[_0xe7fb('0x36')](db[_0xe7fb('0x30')]['rawAttributes']);_0x4d29d3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x58d743[_0xe7fb('0x35')]);_0x4d29d3['filters']=_[_0xe7fb('0x37')](_0x4d29d3[_0xe7fb('0x38')],_0x4d29d3[_0xe7fb('0x35')]);_0x32cfa4[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x4d29d3['model'],qs[_0xe7fb('0x3a')](_0x58d743['query'][_0xe7fb('0x3a')]));_0x32cfa4[_0xe7fb('0x39')]=_0x32cfa4[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x32cfa4[_0xe7fb('0x39')]:_0x4d29d3['model'];if(_0x58d743[_0xe7fb('0x35')]['includeAll']){_0x32cfa4['include']=[{'all':!![]}];}_0x32cfa4=_[_0xe7fb('0x44')]({},_0x32cfa4,_0x58d743[_0xe7fb('0x46')]);return db[_0xe7fb('0x30')]['find'](_0x32cfa4)[_0xe7fb('0x26')](handleEntityNotFound(_0x19277f,null))[_0xe7fb('0x26')](respondWithResult(_0x19277f,null))['catch'](handleError(_0x19277f,null));};exports['create']=function(_0x284bcb,_0x42270b){return db[_0xe7fb('0x30')][_0xe7fb('0x4a')](_0x284bcb[_0xe7fb('0x4b')],{})[_0xe7fb('0x26')](function(_0x18a590){var _0x347177=_0x284bcb['user'][_0xe7fb('0x27')]({'plain':!![]});if(!_0x347177)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x347177[_0xe7fb('0x4c')]===_0xe7fb('0x4d')){var _0x5cedfb=_0x18a590[_0xe7fb('0x27')]({'plain':!![]});var _0x5efd24=_0xe7fb('0x4e');return db['UserProfileSection'][_0xe7fb('0x4f')]({'where':{'name':_0x5efd24,'userProfileId':_0x347177['userProfileId']},'raw':!![]})[_0xe7fb('0x26')](function(_0x59158c){if(_0x59158c&&_0x59158c[_0xe7fb('0x50')]===0x0){return db[_0xe7fb('0x28')][_0xe7fb('0x4a')]({'name':_0x5cedfb[_0xe7fb('0x2d')],'resourceId':_0x5cedfb['id'],'type':_0x59158c[_0xe7fb('0x2d')],'sectionId':_0x59158c['id']},{})[_0xe7fb('0x26')](function(){return _0x18a590;});}else{return _0x18a590;}})[_0xe7fb('0x51')](function(_0x582a4a){logger['error'](_0xe7fb('0x52'),_0x582a4a);throw _0x582a4a;});}return _0x18a590;})['then'](respondWithResult(_0x42270b,0xc9))['catch'](handleError(_0x42270b,null));};exports['update']=function(_0x50b8df,_0x539252){if(_0x50b8df[_0xe7fb('0x4b')]['id']){delete _0x50b8df[_0xe7fb('0x4b')]['id'];}return db[_0xe7fb('0x30')][_0xe7fb('0x4f')]({'where':{'id':_0x50b8df['params']['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x539252,null))[_0xe7fb('0x26')](saveUpdates(_0x50b8df[_0xe7fb('0x4b')],null))['then'](respondWithResult(_0x539252,null))['catch'](handleError(_0x539252,null));};exports[_0xe7fb('0x29')]=function(_0x377e5f,_0x300b8e){return db['AnalyticMetric'][_0xe7fb('0x4f')]({'where':{'id':_0x377e5f[_0xe7fb('0x49')]['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x300b8e,null))[_0xe7fb('0x26')](removeEntity(_0x300b8e,null))['catch'](handleError(_0x300b8e,null));}; \ No newline at end of file +var _0x8ef6=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','index','map','fieldName','key','model','keys','query','intersection','attributes','length','hasOwnProperty','order','sort','where','filters','filter','merge','type','VIRTUAL','options','AnalyticMetric','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x45bfb6,_0x3b7eb9){var _0x3ab5c4=function(_0xfd3baf){while(--_0xfd3baf){_0x45bfb6['push'](_0x45bfb6['shift']());}};_0x3ab5c4(++_0x3b7eb9);}(_0x8ef6,0xf2));var _0x68ef=function(_0x170d98,_0x32fd5f){_0x170d98=_0x170d98-0x0;var _0x1111dc=_0x8ef6[_0x170d98];return _0x1111dc;};'use strict';var emlformat=require(_0x68ef('0x0'));var rimraf=require(_0x68ef('0x1'));var zipdir=require(_0x68ef('0x2'));var jsonpatch=require(_0x68ef('0x3'));var rp=require(_0x68ef('0x4'));var moment=require(_0x68ef('0x5'));var BPromise=require(_0x68ef('0x6'));var Mustache=require('mustache');var util=require(_0x68ef('0x7'));var path=require(_0x68ef('0x8'));var sox=require(_0x68ef('0x9'));var csv=require(_0x68ef('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x68ef('0xb'));var squel=require(_0x68ef('0xc'));var crypto=require(_0x68ef('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x68ef('0xe'));var toCsv=require(_0x68ef('0xa'));var querystring=require(_0x68ef('0xf'));var Papa=require(_0x68ef('0x10'));var Redis=require(_0x68ef('0x11'));var authService=require(_0x68ef('0x12'));var qs=require(_0x68ef('0x13'));var as=require(_0x68ef('0x14'));var hardwareService=require(_0x68ef('0x15'));var logger=require(_0x68ef('0x16'))(_0x68ef('0x17'));var utils=require(_0x68ef('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x68ef('0x19'));var db=require(_0x68ef('0x1a'))['db'];function respondWithStatusCode(_0x1e117a,_0x454ef4){_0x454ef4=_0x454ef4||0xcc;return function(_0x40f253){if(_0x40f253){return _0x1e117a[_0x68ef('0x1b')](_0x454ef4);}return _0x1e117a['status'](_0x454ef4)[_0x68ef('0x1c')]();};}function respondWithResult(_0xc50cce,_0x2657c5){_0x2657c5=_0x2657c5||0xc8;return function(_0x47fbb5){if(_0x47fbb5){return _0xc50cce[_0x68ef('0x1d')](_0x2657c5)[_0x68ef('0x1e')](_0x47fbb5);}};}function respondWithFilteredResult(_0x24682d,_0x5005ba){return function(_0x35493d){if(_0x35493d){var _0x37c4cc=typeof _0x5005ba[_0x68ef('0x1f')]===_0x68ef('0x20')&&typeof _0x5005ba['limit']===_0x68ef('0x20');var _0x54139e=_0x35493d['count'];var _0x2633c1=_0x37c4cc?0x0:_0x5005ba[_0x68ef('0x1f')];var _0x4ade0d=_0x37c4cc?_0x35493d['count']:_0x5005ba[_0x68ef('0x1f')]+_0x5005ba[_0x68ef('0x21')];var _0x318514;if(_0x4ade0d>=_0x54139e){_0x4ade0d=_0x54139e;_0x318514=0xc8;}else{_0x318514=0xce;}_0x24682d['status'](_0x318514);return _0x24682d[_0x68ef('0x22')](_0x68ef('0x23'),_0x2633c1+'-'+_0x4ade0d+'/'+_0x54139e)[_0x68ef('0x1e')](_0x35493d);}return null;};}function patchUpdates(_0x5b246b){return function(_0x3c46d4){try{jsonpatch[_0x68ef('0x24')](_0x3c46d4,_0x5b246b,!![]);}catch(_0x5af19f){return BPromise[_0x68ef('0x25')](_0x5af19f);}return _0x3c46d4[_0x68ef('0x26')]();};}function saveUpdates(_0x19aa3d,_0x5ddec7){return function(_0x59723c){if(_0x59723c){return _0x59723c['update'](_0x19aa3d)[_0x68ef('0x27')](function(_0x2023f2){return _0x2023f2;});}return null;};}function removeEntity(_0x312cc9,_0x2e6e39){return function(_0x438b4c){if(_0x438b4c){return _0x438b4c[_0x68ef('0x28')]()[_0x68ef('0x27')](function(){var _0x49374f=_0x438b4c[_0x68ef('0x29')]({'plain':!![]});var _0x13280b='Metrics';return db[_0x68ef('0x2a')]['destroy']({'where':{'type':_0x13280b,'resourceId':_0x49374f['id']}})['then'](function(){return _0x438b4c;});})['then'](function(){_0x312cc9[_0x68ef('0x1d')](0xcc)[_0x68ef('0x1c')]();});}};}function handleEntityNotFound(_0x123041,_0x29518e){return function(_0x52e67e){if(!_0x52e67e){_0x123041['sendStatus'](0x194);}return _0x52e67e;};}function handleError(_0x1cbe4f,_0x28907a){_0x28907a=_0x28907a||0x1f4;return function(_0x7bf96){logger[_0x68ef('0x2b')](_0x7bf96[_0x68ef('0x2c')]);if(_0x7bf96[_0x68ef('0x2d')]){delete _0x7bf96[_0x68ef('0x2d')];}_0x1cbe4f[_0x68ef('0x1d')](_0x28907a)['send'](_0x7bf96);};}exports[_0x68ef('0x2e')]=function(_0x4314bd,_0x132d9e){var _0x4c25aa={},_0x370a8f={},_0x523120={'count':0x0,'rows':[]};var _0x133788=_[_0x68ef('0x2f')](db['AnalyticMetric']['rawAttributes'],function(_0x159395){return{'name':_0x159395[_0x68ef('0x30')],'type':_0x159395['type'][_0x68ef('0x31')]};});_0x370a8f[_0x68ef('0x32')]=_[_0x68ef('0x2f')](_0x133788,_0x68ef('0x2d'));_0x370a8f['query']=_[_0x68ef('0x33')](_0x4314bd[_0x68ef('0x34')]);_0x370a8f['filters']=_[_0x68ef('0x35')](_0x370a8f['model'],_0x370a8f[_0x68ef('0x34')]);_0x4c25aa[_0x68ef('0x36')]=_['intersection'](_0x370a8f[_0x68ef('0x32')],qs['fields'](_0x4314bd[_0x68ef('0x34')]['fields']));_0x4c25aa[_0x68ef('0x36')]=_0x4c25aa[_0x68ef('0x36')][_0x68ef('0x37')]?_0x4c25aa['attributes']:_0x370a8f[_0x68ef('0x32')];if(!_0x4314bd['query'][_0x68ef('0x38')]('nolimit')){_0x4c25aa[_0x68ef('0x21')]=qs[_0x68ef('0x21')](_0x4314bd[_0x68ef('0x34')][_0x68ef('0x21')]);_0x4c25aa[_0x68ef('0x1f')]=qs[_0x68ef('0x1f')](_0x4314bd['query'][_0x68ef('0x1f')]);}_0x4c25aa[_0x68ef('0x39')]=qs[_0x68ef('0x3a')](_0x4314bd['query'][_0x68ef('0x3a')]);_0x4c25aa[_0x68ef('0x3b')]=qs[_0x68ef('0x3c')](_['pick'](_0x4314bd['query'],_0x370a8f[_0x68ef('0x3c')]),_0x133788);if(_0x4314bd[_0x68ef('0x34')][_0x68ef('0x3d')]){_0x4c25aa[_0x68ef('0x3b')]=_[_0x68ef('0x3e')](_0x4c25aa[_0x68ef('0x3b')],{'$or':_[_0x68ef('0x2f')](_0x133788,function(_0x5b1246){if(_0x5b1246[_0x68ef('0x3f')]!==_0x68ef('0x40')){var _0x2f6ee0={};_0x2f6ee0[_0x5b1246[_0x68ef('0x2d')]]={'$like':'%'+_0x4314bd['query'][_0x68ef('0x3d')]+'%'};return _0x2f6ee0;}})});}_0x4c25aa=_[_0x68ef('0x3e')]({},_0x4c25aa,_0x4314bd[_0x68ef('0x41')]);var _0x410c10={'where':_0x4c25aa[_0x68ef('0x3b')]};return db[_0x68ef('0x42')]['count'](_0x410c10)[_0x68ef('0x27')](function(_0x3f7699){_0x523120[_0x68ef('0x43')]=_0x3f7699;if(_0x4314bd[_0x68ef('0x34')][_0x68ef('0x44')]){_0x4c25aa[_0x68ef('0x45')]=[{'all':!![]}];}return db[_0x68ef('0x42')][_0x68ef('0x46')](_0x4c25aa);})[_0x68ef('0x27')](function(_0x531096){_0x523120[_0x68ef('0x47')]=_0x531096;return _0x523120;})[_0x68ef('0x27')](respondWithFilteredResult(_0x132d9e,_0x4c25aa))[_0x68ef('0x48')](handleError(_0x132d9e,null));};exports[_0x68ef('0x49')]=function(_0xdeacf2,_0x183377){var _0xcac58f={'raw':!![],'where':{'id':_0xdeacf2[_0x68ef('0x4a')]['id']}},_0x576767={};_0x576767['model']=_[_0x68ef('0x33')](db[_0x68ef('0x42')][_0x68ef('0x4b')]);_0x576767[_0x68ef('0x34')]=_['keys'](_0xdeacf2[_0x68ef('0x34')]);_0x576767['filters']=_[_0x68ef('0x35')](_0x576767['model'],_0x576767[_0x68ef('0x34')]);_0xcac58f[_0x68ef('0x36')]=_[_0x68ef('0x35')](_0x576767['model'],qs['fields'](_0xdeacf2[_0x68ef('0x34')][_0x68ef('0x4c')]));_0xcac58f['attributes']=_0xcac58f['attributes']['length']?_0xcac58f[_0x68ef('0x36')]:_0x576767[_0x68ef('0x32')];if(_0xdeacf2[_0x68ef('0x34')][_0x68ef('0x44')]){_0xcac58f[_0x68ef('0x45')]=[{'all':!![]}];}_0xcac58f=_['merge']({},_0xcac58f,_0xdeacf2['options']);return db[_0x68ef('0x42')][_0x68ef('0x4d')](_0xcac58f)[_0x68ef('0x27')](handleEntityNotFound(_0x183377,null))[_0x68ef('0x27')](respondWithResult(_0x183377,null))['catch'](handleError(_0x183377,null));};exports[_0x68ef('0x4e')]=function(_0x474e5a,_0x1c9b6f){return db[_0x68ef('0x42')]['create'](_0x474e5a['body'],{})[_0x68ef('0x27')](function(_0x3c3074){var _0x566e7c=_0x474e5a[_0x68ef('0x4f')][_0x68ef('0x29')]({'plain':!![]});if(!_0x566e7c)throw new Error(_0x68ef('0x50'));if(_0x566e7c[_0x68ef('0x51')]===_0x68ef('0x4f')){var _0x4f0f77=_0x3c3074[_0x68ef('0x29')]({'plain':!![]});var _0x3984ca=_0x68ef('0x52');return db['UserProfileSection'][_0x68ef('0x4d')]({'where':{'name':_0x3984ca,'userProfileId':_0x566e7c[_0x68ef('0x53')]},'raw':!![]})[_0x68ef('0x27')](function(_0x50ef1f){if(_0x50ef1f&&_0x50ef1f[_0x68ef('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x4f0f77[_0x68ef('0x2d')],'resourceId':_0x4f0f77['id'],'type':_0x50ef1f['name'],'sectionId':_0x50ef1f['id']},{})[_0x68ef('0x27')](function(){return _0x3c3074;});}else{return _0x3c3074;}})[_0x68ef('0x48')](function(_0x53ebd){logger[_0x68ef('0x2b')](_0x68ef('0x55'),_0x53ebd);throw _0x53ebd;});}return _0x3c3074;})[_0x68ef('0x27')](respondWithResult(_0x1c9b6f,0xc9))[_0x68ef('0x48')](handleError(_0x1c9b6f,null));};exports[_0x68ef('0x56')]=function(_0x2b35f4,_0x247915){if(_0x2b35f4['body']['id']){delete _0x2b35f4['body']['id'];}return db[_0x68ef('0x42')][_0x68ef('0x4d')]({'where':{'id':_0x2b35f4[_0x68ef('0x4a')]['id']}})[_0x68ef('0x27')](handleEntityNotFound(_0x247915,null))[_0x68ef('0x27')](saveUpdates(_0x2b35f4[_0x68ef('0x57')],null))[_0x68ef('0x27')](respondWithResult(_0x247915,null))[_0x68ef('0x48')](handleError(_0x247915,null));};exports[_0x68ef('0x28')]=function(_0x4c2e9c,_0x5685bb){return db[_0x68ef('0x42')]['find']({'where':{'id':_0x4c2e9c[_0x68ef('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5685bb,null))[_0x68ef('0x27')](removeEntity(_0x5685bb,null))[_0x68ef('0x48')](handleError(_0x5685bb,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 9208119..0dda983 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 _0x9b8e=['exports','define','AnalyticMetric','analytics_metrics','lodash','../../config/logger','api','request-promise','rimraf','../../config/environment'];(function(_0x25cc95,_0x5e6485){var _0x1615f4=function(_0x507b4a){while(--_0x507b4a){_0x25cc95['push'](_0x25cc95['shift']());}};_0x1615f4(++_0x5e6485);}(_0x9b8e,0x158));var _0xe9b8=function(_0x1b1763,_0x258040){_0x1b1763=_0x1b1763-0x0;var _0x585952=_0x9b8e[_0x1b1763];return _0x585952;};'use strict';var _=require(_0xe9b8('0x0'));var util=require('util');var logger=require(_0xe9b8('0x1'))(_0xe9b8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe9b8('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe9b8('0x4'));var config=require(_0xe9b8('0x5'));var attributes=require('./analyticMetric.attributes');module[_0xe9b8('0x6')]=function(_0x3d24e3,_0x3f6b50){return _0x3d24e3[_0xe9b8('0x7')](_0xe9b8('0x8'),attributes,{'tableName':_0xe9b8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x042a=['../../config/environment','./analyticMetric.attributes','exports','AnalyticMetric','analytics_metrics','lodash','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x2114e3,_0x2c3028){var _0x6bff25=function(_0x197a39){while(--_0x197a39){_0x2114e3['push'](_0x2114e3['shift']());}};_0x6bff25(++_0x2c3028);}(_0x042a,0x1d9));var _0xa042=function(_0x3dca9b,_0x4824a8){_0x3dca9b=_0x3dca9b-0x0;var _0x4c1c1e=_0x042a[_0x3dca9b];return _0x4c1c1e;};'use strict';var _=require(_0xa042('0x0'));var util=require('util');var logger=require(_0xa042('0x1'))(_0xa042('0x2'));var moment=require(_0xa042('0x3'));var BPromise=require('bluebird');var rp=require(_0xa042('0x4'));var fs=require('fs');var path=require(_0xa042('0x5'));var rimraf=require(_0xa042('0x6'));var config=require(_0xa042('0x7'));var attributes=require(_0xa042('0x8'));module[_0xa042('0x9')]=function(_0x622ece,_0xc35608){return _0x622ece['define'](_0xa042('0xa'),attributes,{'tableName':_0xa042('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 8d91331..4aa4d3d 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 _0x9fec=['catch','lodash','util','moment','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','info','result'];(function(_0x56f74f,_0x152245){var _0x411bfc=function(_0x1a660b){while(--_0x1a660b){_0x56f74f['push'](_0x56f74f['shift']());}};_0x411bfc(++_0x152245);}(_0x9fec,0x94));var _0xc9fe=function(_0xcfc44,_0x179bc1){_0xcfc44=_0xcfc44-0x0;var _0x307a25=_0x9fec[_0xcfc44];return _0x307a25;};'use strict';var _=require(_0xc9fe('0x0'));var util=require(_0xc9fe('0x1'));var moment=require(_0xc9fe('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc9fe('0x3'));var logger=require(_0xc9fe('0x4'))(_0xc9fe('0x5'));var config=require('../../config/environment');var jayson=require(_0xc9fe('0x6'));var client=jayson[_0xc9fe('0x7')][_0xc9fe('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x15e325,_0x57111f,_0x789fa8){return new BPromise(function(_0x179e4d,_0x3fd641){return client[_0xc9fe('0x9')](_0x15e325,_0x789fa8)[_0xc9fe('0xa')](function(_0x13cd2c){logger['info'](_0xc9fe('0xb'),_0x57111f,_0xc9fe('0xc'));logger[_0xc9fe('0xd')](_0xc9fe('0xe'),_0x57111f,_0xc9fe('0xc'),JSON['stringify'](_0x13cd2c));if(_0x13cd2c[_0xc9fe('0xf')]){if(_0x13cd2c[_0xc9fe('0xf')][_0xc9fe('0x10')]===0x1f4){logger[_0xc9fe('0xf')](_0xc9fe('0xb'),_0x57111f,_0x13cd2c[_0xc9fe('0xf')]['message']);return _0x3fd641(_0x13cd2c['error'][_0xc9fe('0x11')]);}logger['error'](_0xc9fe('0xb'),_0x57111f,_0x13cd2c['error'][_0xc9fe('0x11')]);return _0x179e4d(_0x13cd2c[_0xc9fe('0xf')][_0xc9fe('0x11')]);}else{logger[_0xc9fe('0x12')](_0xc9fe('0xb'),_0x57111f,_0xc9fe('0xc'));_0x179e4d(_0x13cd2c[_0xc9fe('0x13')][_0xc9fe('0x11')]);}})[_0xc9fe('0x14')](function(_0x243d74){logger['error'](_0xc9fe('0xb'),_0x57111f,_0x243d74);_0x3fd641(_0x243d74);});});} \ No newline at end of file +var _0x58c9=['AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','catch','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x10d7f4,_0x525094){var _0x2d8a23=function(_0x47cb29){while(--_0x47cb29){_0x10d7f4['push'](_0x10d7f4['shift']());}};_0x2d8a23(++_0x525094);}(_0x58c9,0xa5));var _0x958c=function(_0x2c487e,_0x17e52f){_0x2c487e=_0x2c487e-0x0;var _0x4b563d=_0x58c9[_0x2c487e];return _0x4b563d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x958c('0x0'));var BPromise=require(_0x958c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x958c('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x958c('0x3'));var logger=require(_0x958c('0x4'))('rpc');var config=require(_0x958c('0x5'));var jayson=require(_0x958c('0x6'));var client=jayson[_0x958c('0x7')][_0x958c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5798f6,_0x3d2963,_0xa39736){return new BPromise(function(_0x5a20e3,_0x19582c){return client[_0x958c('0x9')](_0x5798f6,_0xa39736)[_0x958c('0xa')](function(_0x295a77){logger[_0x958c('0xb')](_0x958c('0xc'),_0x3d2963,_0x958c('0xd'));logger[_0x958c('0xe')](_0x958c('0xf'),_0x3d2963,_0x958c('0xd'),JSON['stringify'](_0x295a77));if(_0x295a77[_0x958c('0x10')]){if(_0x295a77[_0x958c('0x10')][_0x958c('0x11')]===0x1f4){logger[_0x958c('0x10')](_0x958c('0xc'),_0x3d2963,_0x295a77[_0x958c('0x10')][_0x958c('0x12')]);return _0x19582c(_0x295a77[_0x958c('0x10')][_0x958c('0x12')]);}logger[_0x958c('0x10')](_0x958c('0xc'),_0x3d2963,_0x295a77['error']['message']);return _0x5a20e3(_0x295a77[_0x958c('0x10')][_0x958c('0x12')]);}else{logger[_0x958c('0xb')]('AnalyticMetric,\x20%s,\x20%s',_0x3d2963,'request\x20sent');_0x5a20e3(_0x295a77['result'][_0x958c('0x12')]);}})[_0x958c('0x13')](function(_0x49ad33){logger[_0x958c('0x10')](_0x958c('0xc'),_0x3d2963,_0x49ad33);_0x19582c(_0x49ad33);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 6f44fb0..97ea360 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 _0xdfe7=['index','get','/:id','show','post','create','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticMetric.controller','isAuthenticated'];(function(_0x57b474,_0xff6fa3){var _0x459a67=function(_0x1a20fe){while(--_0x1a20fe){_0x57b474['push'](_0x57b474['shift']());}};_0x459a67(++_0xff6fa3);}(_0xdfe7,0xc8));var _0x7dfe=function(_0x5f3d05,_0x27a2a6){_0x5f3d05=_0x5f3d05-0x0;var _0x3381fe=_0xdfe7[_0x5f3d05];return _0x3381fe;};'use strict';var multer=require('multer');var util=require(_0x7dfe('0x0'));var path=require(_0x7dfe('0x1'));var timeout=require('connect-timeout');var express=require(_0x7dfe('0x2'));var router=express[_0x7dfe('0x3')]();var fs_extra=require(_0x7dfe('0x4'));var auth=require(_0x7dfe('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7dfe('0x6'));var controller=require(_0x7dfe('0x7'));router['get']('/',auth[_0x7dfe('0x8')](),controller[_0x7dfe('0x9')]);router[_0x7dfe('0xa')](_0x7dfe('0xb'),auth['isAuthenticated'](),controller[_0x7dfe('0xc')]);router[_0x7dfe('0xd')]('/',auth[_0x7dfe('0x8')](),controller[_0x7dfe('0xe')]);router['put'](_0x7dfe('0xb'),auth[_0x7dfe('0x8')](),controller[_0x7dfe('0xf')]);router[_0x7dfe('0x10')](_0x7dfe('0xb'),auth['isAuthenticated'](),controller[_0x7dfe('0x11')]);module[_0x7dfe('0x12')]=router; \ No newline at end of file +var _0x6bb4=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','/:id','create','put','update','delete','destroy','multer','util'];(function(_0x100ede,_0x38d51a){var _0x2d5919=function(_0x4a6b62){while(--_0x4a6b62){_0x100ede['push'](_0x100ede['shift']());}};_0x2d5919(++_0x38d51a);}(_0x6bb4,0x1a7));var _0x46bb=function(_0x2c503c,_0xd88a2a){_0x2c503c=_0x2c503c-0x0;var _0x39dce7=_0x6bb4[_0x2c503c];return _0x39dce7;};'use strict';var multer=require(_0x46bb('0x0'));var util=require(_0x46bb('0x1'));var path=require(_0x46bb('0x2'));var timeout=require('connect-timeout');var express=require(_0x46bb('0x3'));var router=express[_0x46bb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x46bb('0x5'));var interaction=require(_0x46bb('0x6'));var config=require(_0x46bb('0x7'));var controller=require(_0x46bb('0x8'));router[_0x46bb('0x9')]('/',auth[_0x46bb('0xa')](),controller['index']);router['get'](_0x46bb('0xb'),auth[_0x46bb('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x46bb('0xc')]);router[_0x46bb('0xd')]('/:id',auth[_0x46bb('0xa')](),controller[_0x46bb('0xe')]);router[_0x46bb('0xf')]('/:id',auth[_0x46bb('0xa')](),controller[_0x46bb('0x10')]);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 22fdc51..79e46f3 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 _0x4ed5=['exports','sequelize'];(function(_0x4fc6e2,_0x5d0446){var _0x5c3dce=function(_0x218c2c){while(--_0x218c2c){_0x4fc6e2['push'](_0x4fc6e2['shift']());}};_0x5c3dce(++_0x5d0446);}(_0x4ed5,0xb1));var _0x54ed=function(_0xd32547,_0x20725b){_0xd32547=_0xd32547-0x0;var _0x8c3f7e=_0x4ed5[_0xd32547];return _0x8c3f7e;};'use strict';var Sequelize=require(_0x54ed('0x0'));module[_0x54ed('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +var _0xe107=['sequelize'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xe107,0x17c));var _0x7e10=function(_0x5e4aeb,_0x45b6f0){_0x5e4aeb=_0x5e4aeb-0x0;var _0x814841=_0xe107[_0x5e4aeb];return _0x814841;};'use strict';var Sequelize=require(_0x7e10('0x0'));module['exports']={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index b0d45ad..0e8e91a 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 _0x2774=['sort','where','filter','merge','options','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','end','undefined','count','offset','limit','status','json','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','order'];(function(_0x4c3ceb,_0x110795){var _0x5f4843=function(_0x2588c3){while(--_0x2588c3){_0x4c3ceb['push'](_0x4c3ceb['shift']());}};_0x5f4843(++_0x110795);}(_0x2774,0xe6));var _0x4277=function(_0x240c0b,_0x82cd2e){_0x240c0b=_0x240c0b-0x0;var _0x5ad1fb=_0x2774[_0x240c0b];return _0x5ad1fb;};'use strict';var emlformat=require(_0x4277('0x0'));var rimraf=require(_0x4277('0x1'));var zipdir=require(_0x4277('0x2'));var jsonpatch=require(_0x4277('0x3'));var rp=require('request-promise');var moment=require(_0x4277('0x4'));var BPromise=require(_0x4277('0x5'));var Mustache=require(_0x4277('0x6'));var util=require(_0x4277('0x7'));var path=require(_0x4277('0x8'));var sox=require('sox');var csv=require(_0x4277('0x9'));var ejs=require(_0x4277('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4277('0xb'));var squel=require(_0x4277('0xc'));var crypto=require(_0x4277('0xd'));var jsforce=require(_0x4277('0xe'));var deskjs=require(_0x4277('0xf'));var toCsv=require(_0x4277('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4277('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4277('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4277('0x12'))(_0x4277('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4277('0x14'))['db'];function respondWithStatusCode(_0x5acc22,_0x294cbf){_0x294cbf=_0x294cbf||0xcc;return function(_0x349ca4){if(_0x349ca4){return _0x5acc22['sendStatus'](_0x294cbf);}return _0x5acc22['status'](_0x294cbf)[_0x4277('0x15')]();};}function respondWithResult(_0x4fe1d4,_0x58e751){_0x58e751=_0x58e751||0xc8;return function(_0x125b57){if(_0x125b57){return _0x4fe1d4['status'](_0x58e751)['json'](_0x125b57);}};}function respondWithFilteredResult(_0x4023ed,_0x2d9885){return function(_0x4fe90e){if(_0x4fe90e){var _0x253815=typeof _0x2d9885['offset']===_0x4277('0x16')&&typeof _0x2d9885['limit']===_0x4277('0x16');var _0x3a7dc9=_0x4fe90e[_0x4277('0x17')];var _0x4cf5cf=_0x253815?0x0:_0x2d9885[_0x4277('0x18')];var _0x4240f2=_0x253815?_0x4fe90e[_0x4277('0x17')]:_0x2d9885['offset']+_0x2d9885[_0x4277('0x19')];var _0x510fbc;if(_0x4240f2>=_0x3a7dc9){_0x4240f2=_0x3a7dc9;_0x510fbc=0xc8;}else{_0x510fbc=0xce;}_0x4023ed[_0x4277('0x1a')](_0x510fbc);return _0x4023ed['set']('Content-Range',_0x4cf5cf+'-'+_0x4240f2+'/'+_0x3a7dc9)[_0x4277('0x1b')](_0x4fe90e);}return null;};}function patchUpdates(_0x4dd4f5){return function(_0x30420f){try{jsonpatch[_0x4277('0x1c')](_0x30420f,_0x4dd4f5,!![]);}catch(_0x4516ef){return BPromise[_0x4277('0x1d')](_0x4516ef);}return _0x30420f[_0x4277('0x1e')]();};}function saveUpdates(_0x10109b,_0x2514d0){return function(_0x374b7f){if(_0x374b7f){return _0x374b7f['update'](_0x10109b)[_0x4277('0x1f')](function(_0x5d358b){return _0x5d358b;});}return null;};}function removeEntity(_0x4bf1c3,_0x1fe932){return function(_0x29e445){if(_0x29e445){return _0x29e445[_0x4277('0x20')]()[_0x4277('0x1f')](function(){_0x4bf1c3[_0x4277('0x1a')](0xcc)[_0x4277('0x15')]();});}};}function handleEntityNotFound(_0x4ac94a,_0xba3226){return function(_0x3affc5){if(!_0x3affc5){_0x4ac94a[_0x4277('0x21')](0x194);}return _0x3affc5;};}function handleError(_0x2a6062,_0x1411d6){_0x1411d6=_0x1411d6||0x1f4;return function(_0x4b7466){logger[_0x4277('0x22')](_0x4b7466[_0x4277('0x23')]);if(_0x4b7466[_0x4277('0x24')]){delete _0x4b7466[_0x4277('0x24')];}_0x2a6062[_0x4277('0x1a')](_0x1411d6)[_0x4277('0x25')](_0x4b7466);};}exports[_0x4277('0x26')]=function(_0x5e8884,_0x47502c){var _0x47e16f={},_0x32b99f={},_0x4a9ea6={'count':0x0,'rows':[]};var _0x57a54a=_[_0x4277('0x27')](db[_0x4277('0x28')][_0x4277('0x29')],function(_0x517bed){return{'name':_0x517bed[_0x4277('0x2a')],'type':_0x517bed[_0x4277('0x2b')][_0x4277('0x2c')]};});_0x32b99f['model']=_[_0x4277('0x27')](_0x57a54a,'name');_0x32b99f['query']=_[_0x4277('0x2d')](_0x5e8884[_0x4277('0x2e')]);_0x32b99f[_0x4277('0x2f')]=_[_0x4277('0x30')](_0x32b99f[_0x4277('0x31')],_0x32b99f[_0x4277('0x2e')]);_0x47e16f[_0x4277('0x32')]=_['intersection'](_0x32b99f['model'],qs[_0x4277('0x33')](_0x5e8884[_0x4277('0x2e')][_0x4277('0x33')]));_0x47e16f[_0x4277('0x32')]=_0x47e16f[_0x4277('0x32')]['length']?_0x47e16f[_0x4277('0x32')]:_0x32b99f[_0x4277('0x31')];if(!_0x5e8884[_0x4277('0x2e')][_0x4277('0x34')]('nolimit')){_0x47e16f['limit']=qs[_0x4277('0x19')](_0x5e8884[_0x4277('0x2e')][_0x4277('0x19')]);_0x47e16f['offset']=qs[_0x4277('0x18')](_0x5e8884[_0x4277('0x2e')]['offset']);}_0x47e16f[_0x4277('0x35')]=qs[_0x4277('0x36')](_0x5e8884[_0x4277('0x2e')][_0x4277('0x36')]);_0x47e16f[_0x4277('0x37')]=qs[_0x4277('0x2f')](_['pick'](_0x5e8884['query'],_0x32b99f[_0x4277('0x2f')]),_0x57a54a);if(_0x5e8884[_0x4277('0x2e')][_0x4277('0x38')]){_0x47e16f[_0x4277('0x37')]=_[_0x4277('0x39')](_0x47e16f[_0x4277('0x37')],{'$or':_[_0x4277('0x27')](_0x57a54a,function(_0xc55740){if(_0xc55740[_0x4277('0x2b')]!=='VIRTUAL'){var _0x394f04={};_0x394f04[_0xc55740['name']]={'$like':'%'+_0x5e8884[_0x4277('0x2e')][_0x4277('0x38')]+'%'};return _0x394f04;}})});}_0x47e16f=_[_0x4277('0x39')]({},_0x47e16f,_0x5e8884[_0x4277('0x3a')]);var _0x3a5f9c={'where':_0x47e16f[_0x4277('0x37')]};return db[_0x4277('0x28')][_0x4277('0x17')](_0x3a5f9c)[_0x4277('0x1f')](function(_0x4102e3){_0x4a9ea6[_0x4277('0x17')]=_0x4102e3;if(_0x5e8884[_0x4277('0x2e')][_0x4277('0x3b')]){_0x47e16f[_0x4277('0x3c')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x4277('0x3d')](_0x47e16f);})['then'](function(_0x597576){_0x4a9ea6[_0x4277('0x3e')]=_0x597576;return _0x4a9ea6;})[_0x4277('0x1f')](respondWithFilteredResult(_0x47502c,_0x47e16f))['catch'](handleError(_0x47502c,null));};exports[_0x4277('0x3f')]=function(_0x217b06,_0x3b1e6b){var _0x102b6c={'raw':!![],'where':{'id':_0x217b06[_0x4277('0x40')]['id']}},_0x27ae4d={};_0x27ae4d[_0x4277('0x31')]=_[_0x4277('0x2d')](db[_0x4277('0x28')][_0x4277('0x29')]);_0x27ae4d[_0x4277('0x2e')]=_[_0x4277('0x2d')](_0x217b06['query']);_0x27ae4d['filters']=_['intersection'](_0x27ae4d[_0x4277('0x31')],_0x27ae4d[_0x4277('0x2e')]);_0x102b6c['attributes']=_[_0x4277('0x30')](_0x27ae4d[_0x4277('0x31')],qs[_0x4277('0x33')](_0x217b06[_0x4277('0x2e')][_0x4277('0x33')]));_0x102b6c[_0x4277('0x32')]=_0x102b6c[_0x4277('0x32')][_0x4277('0x41')]?_0x102b6c[_0x4277('0x32')]:_0x27ae4d[_0x4277('0x31')];if(_0x217b06['query'][_0x4277('0x3b')]){_0x102b6c[_0x4277('0x3c')]=[{'all':!![]}];}_0x102b6c=_[_0x4277('0x39')]({},_0x102b6c,_0x217b06['options']);return db[_0x4277('0x28')][_0x4277('0x42')](_0x102b6c)[_0x4277('0x1f')](handleEntityNotFound(_0x3b1e6b,null))['then'](respondWithResult(_0x3b1e6b,null))[_0x4277('0x43')](handleError(_0x3b1e6b,null));};exports[_0x4277('0x44')]=function(_0x235595,_0x11d8ea){return db['AnalyticTreeReport'][_0x4277('0x44')](_0x235595[_0x4277('0x45')],{})[_0x4277('0x1f')](respondWithResult(_0x11d8ea,0xc9))[_0x4277('0x43')](handleError(_0x11d8ea,null));};exports[_0x4277('0x46')]=function(_0x383070,_0x6e03e8){if(_0x383070[_0x4277('0x45')]['id']){delete _0x383070[_0x4277('0x45')]['id'];}return db[_0x4277('0x28')][_0x4277('0x42')]({'where':{'id':_0x383070[_0x4277('0x40')]['id']}})[_0x4277('0x1f')](handleEntityNotFound(_0x6e03e8,null))[_0x4277('0x1f')](saveUpdates(_0x383070[_0x4277('0x45')],null))[_0x4277('0x1f')](respondWithResult(_0x6e03e8,null))['catch'](handleError(_0x6e03e8,null));};exports[_0x4277('0x20')]=function(_0x146057,_0x200a1b){return db[_0x4277('0x28')][_0x4277('0x42')]({'where':{'id':_0x146057[_0x4277('0x40')]['id']}})[_0x4277('0x1f')](handleEntityNotFound(_0x200a1b,null))['then'](removeEntity(_0x200a1b,null))['catch'](handleError(_0x200a1b,null));}; \ No newline at end of file +var _0x83d6=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','where','pick','filter','merge','type','VIRTUAL','options','then','includeAll','include','findAll','catch','show','fields','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs'];(function(_0x307f29,_0x25f477){var _0x5768b2=function(_0x43c947){while(--_0x43c947){_0x307f29['push'](_0x307f29['shift']());}};_0x5768b2(++_0x25f477);}(_0x83d6,0x1a9));var _0x683d=function(_0x2b860e,_0x29f7a0){_0x2b860e=_0x2b860e-0x0;var _0x47d5ce=_0x83d6[_0x2b860e];return _0x47d5ce;};'use strict';var emlformat=require(_0x683d('0x0'));var rimraf=require(_0x683d('0x1'));var zipdir=require(_0x683d('0x2'));var jsonpatch=require(_0x683d('0x3'));var rp=require(_0x683d('0x4'));var moment=require(_0x683d('0x5'));var BPromise=require(_0x683d('0x6'));var Mustache=require('mustache');var util=require(_0x683d('0x7'));var path=require(_0x683d('0x8'));var sox=require(_0x683d('0x9'));var csv=require(_0x683d('0xa'));var ejs=require(_0x683d('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x683d('0xc'));var squel=require(_0x683d('0xd'));var crypto=require(_0x683d('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x683d('0xf'));var toCsv=require(_0x683d('0xa'));var querystring=require(_0x683d('0x10'));var Papa=require('papaparse');var Redis=require(_0x683d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x683d('0x12'));var as=require(_0x683d('0x13'));var hardwareService=require(_0x683d('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x683d('0x15'));var config=require(_0x683d('0x16'));var licenseUtil=require(_0x683d('0x17'));var db=require(_0x683d('0x18'))['db'];function respondWithStatusCode(_0x135341,_0x9a40b8){_0x9a40b8=_0x9a40b8||0xcc;return function(_0x4f9c7a){if(_0x4f9c7a){return _0x135341[_0x683d('0x19')](_0x9a40b8);}return _0x135341[_0x683d('0x1a')](_0x9a40b8)['end']();};}function respondWithResult(_0x3a42a3,_0x48d78){_0x48d78=_0x48d78||0xc8;return function(_0x4c07fe){if(_0x4c07fe){return _0x3a42a3[_0x683d('0x1a')](_0x48d78)[_0x683d('0x1b')](_0x4c07fe);}};}function respondWithFilteredResult(_0x2e6f64,_0x195d54){return function(_0x12cc44){if(_0x12cc44){var _0x20abc7=typeof _0x195d54[_0x683d('0x1c')]===_0x683d('0x1d')&&typeof _0x195d54[_0x683d('0x1e')]===_0x683d('0x1d');var _0x4e34fa=_0x12cc44['count'];var _0x13691b=_0x20abc7?0x0:_0x195d54['offset'];var _0x50e97e=_0x20abc7?_0x12cc44[_0x683d('0x1f')]:_0x195d54[_0x683d('0x1c')]+_0x195d54[_0x683d('0x1e')];var _0x4db292;if(_0x50e97e>=_0x4e34fa){_0x50e97e=_0x4e34fa;_0x4db292=0xc8;}else{_0x4db292=0xce;}_0x2e6f64[_0x683d('0x1a')](_0x4db292);return _0x2e6f64[_0x683d('0x20')](_0x683d('0x21'),_0x13691b+'-'+_0x50e97e+'/'+_0x4e34fa)[_0x683d('0x1b')](_0x12cc44);}return null;};}function patchUpdates(_0xee96ed){return function(_0x441836){try{jsonpatch[_0x683d('0x22')](_0x441836,_0xee96ed,!![]);}catch(_0x19e4e0){return BPromise['reject'](_0x19e4e0);}return _0x441836[_0x683d('0x23')]();};}function saveUpdates(_0x4bdebf,_0xcf278b){return function(_0x13d1ae){if(_0x13d1ae){return _0x13d1ae[_0x683d('0x24')](_0x4bdebf)['then'](function(_0x6cf0a7){return _0x6cf0a7;});}return null;};}function removeEntity(_0xd19fbf,_0x46e580){return function(_0x222ab6){if(_0x222ab6){return _0x222ab6[_0x683d('0x25')]()['then'](function(){_0xd19fbf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a13c8,_0x20925b){return function(_0x50fb85){if(!_0x50fb85){_0x1a13c8[_0x683d('0x19')](0x194);}return _0x50fb85;};}function handleError(_0x572f08,_0x244826){_0x244826=_0x244826||0x1f4;return function(_0x147ced){logger[_0x683d('0x26')](_0x147ced[_0x683d('0x27')]);if(_0x147ced['name']){delete _0x147ced[_0x683d('0x28')];}_0x572f08[_0x683d('0x1a')](_0x244826)[_0x683d('0x29')](_0x147ced);};}exports[_0x683d('0x2a')]=function(_0x102714,_0x5345eb){var _0x4a4efb={},_0x2a62e9={},_0x5845e3={'count':0x0,'rows':[]};var _0x5a1e95=_[_0x683d('0x2b')](db[_0x683d('0x2c')][_0x683d('0x2d')],function(_0x41db33){return{'name':_0x41db33['fieldName'],'type':_0x41db33['type'][_0x683d('0x2e')]};});_0x2a62e9[_0x683d('0x2f')]=_[_0x683d('0x2b')](_0x5a1e95,_0x683d('0x28'));_0x2a62e9[_0x683d('0x30')]=_[_0x683d('0x31')](_0x102714[_0x683d('0x30')]);_0x2a62e9[_0x683d('0x32')]=_[_0x683d('0x33')](_0x2a62e9[_0x683d('0x2f')],_0x2a62e9['query']);_0x4a4efb[_0x683d('0x34')]=_[_0x683d('0x33')](_0x2a62e9['model'],qs['fields'](_0x102714[_0x683d('0x30')]['fields']));_0x4a4efb['attributes']=_0x4a4efb[_0x683d('0x34')][_0x683d('0x35')]?_0x4a4efb['attributes']:_0x2a62e9[_0x683d('0x2f')];if(!_0x102714[_0x683d('0x30')][_0x683d('0x36')](_0x683d('0x37'))){_0x4a4efb[_0x683d('0x1e')]=qs[_0x683d('0x1e')](_0x102714['query'][_0x683d('0x1e')]);_0x4a4efb[_0x683d('0x1c')]=qs[_0x683d('0x1c')](_0x102714['query']['offset']);}_0x4a4efb['order']=qs['sort'](_0x102714[_0x683d('0x30')]['sort']);_0x4a4efb[_0x683d('0x38')]=qs[_0x683d('0x32')](_[_0x683d('0x39')](_0x102714['query'],_0x2a62e9[_0x683d('0x32')]),_0x5a1e95);if(_0x102714[_0x683d('0x30')][_0x683d('0x3a')]){_0x4a4efb[_0x683d('0x38')]=_[_0x683d('0x3b')](_0x4a4efb[_0x683d('0x38')],{'$or':_[_0x683d('0x2b')](_0x5a1e95,function(_0x25914f){if(_0x25914f[_0x683d('0x3c')]!==_0x683d('0x3d')){var _0x54f6cb={};_0x54f6cb[_0x25914f['name']]={'$like':'%'+_0x102714[_0x683d('0x30')][_0x683d('0x3a')]+'%'};return _0x54f6cb;}})});}_0x4a4efb=_[_0x683d('0x3b')]({},_0x4a4efb,_0x102714[_0x683d('0x3e')]);var _0x624da3={'where':_0x4a4efb[_0x683d('0x38')]};return db[_0x683d('0x2c')][_0x683d('0x1f')](_0x624da3)[_0x683d('0x3f')](function(_0x787c75){_0x5845e3[_0x683d('0x1f')]=_0x787c75;if(_0x102714['query'][_0x683d('0x40')]){_0x4a4efb[_0x683d('0x41')]=[{'all':!![]}];}return db[_0x683d('0x2c')][_0x683d('0x42')](_0x4a4efb);})[_0x683d('0x3f')](function(_0x556c48){_0x5845e3['rows']=_0x556c48;return _0x5845e3;})[_0x683d('0x3f')](respondWithFilteredResult(_0x5345eb,_0x4a4efb))[_0x683d('0x43')](handleError(_0x5345eb,null));};exports[_0x683d('0x44')]=function(_0x3c8c9a,_0x3f2e0d){var _0x9d9050={'raw':!![],'where':{'id':_0x3c8c9a['params']['id']}},_0x5ddf78={};_0x5ddf78[_0x683d('0x2f')]=_[_0x683d('0x31')](db[_0x683d('0x2c')][_0x683d('0x2d')]);_0x5ddf78[_0x683d('0x30')]=_[_0x683d('0x31')](_0x3c8c9a[_0x683d('0x30')]);_0x5ddf78[_0x683d('0x32')]=_[_0x683d('0x33')](_0x5ddf78[_0x683d('0x2f')],_0x5ddf78[_0x683d('0x30')]);_0x9d9050[_0x683d('0x34')]=_['intersection'](_0x5ddf78[_0x683d('0x2f')],qs[_0x683d('0x45')](_0x3c8c9a[_0x683d('0x30')][_0x683d('0x45')]));_0x9d9050[_0x683d('0x34')]=_0x9d9050['attributes'][_0x683d('0x35')]?_0x9d9050['attributes']:_0x5ddf78['model'];if(_0x3c8c9a[_0x683d('0x30')][_0x683d('0x40')]){_0x9d9050[_0x683d('0x41')]=[{'all':!![]}];}_0x9d9050=_[_0x683d('0x3b')]({},_0x9d9050,_0x3c8c9a[_0x683d('0x3e')]);return db[_0x683d('0x2c')]['find'](_0x9d9050)['then'](handleEntityNotFound(_0x3f2e0d,null))['then'](respondWithResult(_0x3f2e0d,null))[_0x683d('0x43')](handleError(_0x3f2e0d,null));};exports[_0x683d('0x46')]=function(_0x171ffa,_0x1e5b95){return db['AnalyticTreeReport'][_0x683d('0x46')](_0x171ffa[_0x683d('0x47')],{})[_0x683d('0x3f')](respondWithResult(_0x1e5b95,0xc9))[_0x683d('0x43')](handleError(_0x1e5b95,null));};exports[_0x683d('0x24')]=function(_0x2fbf1e,_0xacdf8b){if(_0x2fbf1e[_0x683d('0x47')]['id']){delete _0x2fbf1e[_0x683d('0x47')]['id'];}return db[_0x683d('0x2c')][_0x683d('0x48')]({'where':{'id':_0x2fbf1e[_0x683d('0x49')]['id']}})[_0x683d('0x3f')](handleEntityNotFound(_0xacdf8b,null))[_0x683d('0x3f')](saveUpdates(_0x2fbf1e[_0x683d('0x47')],null))[_0x683d('0x3f')](respondWithResult(_0xacdf8b,null))[_0x683d('0x43')](handleError(_0xacdf8b,null));};exports['destroy']=function(_0x33557b,_0x46971e){return db['AnalyticTreeReport'][_0x683d('0x48')]({'where':{'id':_0x33557b['params']['id']}})[_0x683d('0x3f')](handleEntityNotFound(_0x46971e,null))[_0x683d('0x3f')](removeEntity(_0x46971e,null))[_0x683d('0x43')](handleError(_0x46971e,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index fefca93..3f68d4c 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 _0x300b=['path','rimraf','../../config/environment','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','moment','bluebird','request-promise'];(function(_0x27b75e,_0x126a74){var _0x4ca55e=function(_0x3b2023){while(--_0x3b2023){_0x27b75e['push'](_0x27b75e['shift']());}};_0x4ca55e(++_0x126a74);}(_0x300b,0x1db));var _0xb300=function(_0x4b3851,_0x1416fb){_0x4b3851=_0x4b3851-0x0;var _0x2cdc62=_0x300b[_0x4b3851];return _0x2cdc62;};'use strict';var _=require(_0xb300('0x0'));var util=require(_0xb300('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb300('0x2'));var BPromise=require(_0xb300('0x3'));var rp=require(_0xb300('0x4'));var fs=require('fs');var path=require(_0xb300('0x5'));var rimraf=require(_0xb300('0x6'));var config=require(_0xb300('0x7'));var attributes=require('./analyticTreeReport.attributes');module[_0xb300('0x8')]=function(_0x2c4d03,_0x1173e3){return _0x2c4d03[_0xb300('0x9')](_0xb300('0xa'),attributes,{'tableName':_0xb300('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb96e=['exports','define','AnalyticTreeReport','lodash','../../config/logger','moment','bluebird','rimraf','./analyticTreeReport.attributes'];(function(_0x2f4978,_0x44b858){var _0x168094=function(_0x2c7290){while(--_0x2c7290){_0x2f4978['push'](_0x2f4978['shift']());}};_0x168094(++_0x44b858);}(_0xb96e,0x1c5));var _0xeb96=function(_0x2bb919,_0x1a4a24){_0x2bb919=_0x2bb919-0x0;var _0x310a54=_0xb96e[_0x2bb919];return _0x310a54;};'use strict';var _=require(_0xeb96('0x0'));var util=require('util');var logger=require(_0xeb96('0x1'))('api');var moment=require(_0xeb96('0x2'));var BPromise=require(_0xeb96('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xeb96('0x4'));var config=require('../../config/environment');var attributes=require(_0xeb96('0x5'));module[_0xeb96('0x6')]=function(_0x13e787,_0x2d28ae){return _0x13e787[_0xeb96('0x7')](_0xeb96('0x8'),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 908ef40..3807032 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 _0x7a54=['info','AnalyticTreeReport,\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(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7a54,0x106));var _0x47a5=function(_0x473a6e,_0x1ed053){_0x473a6e=_0x473a6e-0x0;var _0x1102dc=_0x7a54[_0x473a6e];return _0x1102dc;};'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')]('AnalyticTreeReport,\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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x4ddcdb,_0x1ed622){var _0x567c3a=function(_0x12cfbb){while(--_0x12cfbb){_0x4ddcdb['push'](_0x4ddcdb['shift']());}};_0x567c3a(++_0x1ed622);}(_0xdb28,0x106));var _0x8db2=function(_0x32a1dc,_0x26ab46){_0x32a1dc=_0x32a1dc-0x0;var _0x9dfc28=_0xdb28[_0x32a1dc];return _0x9dfc28;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 4ed6c56..94f2a32 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 _0x32f2=['index','show','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated'];(function(_0x3a66fa,_0x399904){var _0x388cf9=function(_0x39be41){while(--_0x39be41){_0x3a66fa['push'](_0x3a66fa['shift']());}};_0x388cf9(++_0x399904);}(_0x32f2,0x1ac));var _0x232f=function(_0x30df82,_0x523785){_0x30df82=_0x30df82-0x0;var _0x4194f2=_0x32f2[_0x30df82];return _0x4194f2;};'use strict';var multer=require(_0x232f('0x0'));var util=require(_0x232f('0x1'));var path=require(_0x232f('0x2'));var timeout=require(_0x232f('0x3'));var express=require(_0x232f('0x4'));var router=express[_0x232f('0x5')]();var fs_extra=require(_0x232f('0x6'));var auth=require(_0x232f('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x232f('0x8'));var controller=require(_0x232f('0x9'));router[_0x232f('0xa')]('/',auth[_0x232f('0xb')](),controller[_0x232f('0xc')]);router[_0x232f('0xa')]('/:id',auth[_0x232f('0xb')](),controller[_0x232f('0xd')]);router['post']('/',auth[_0x232f('0xb')](),controller[_0x232f('0xe')]);router[_0x232f('0xf')](_0x232f('0x10'),auth[_0x232f('0xb')](),controller[_0x232f('0x11')]);router[_0x232f('0x12')]('/:id',auth[_0x232f('0xb')](),controller[_0x232f('0x13')]);module['exports']=router; \ No newline at end of file +var _0x7949=['../../config/environment','get','isAuthenticated','index','/:id','post','put','update','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/interaction/service'];(function(_0x335a62,_0xfafea4){var _0x249a9a=function(_0xb3a9a5){while(--_0xb3a9a5){_0x335a62['push'](_0x335a62['shift']());}};_0x249a9a(++_0xfafea4);}(_0x7949,0x11b));var _0x9794=function(_0x36c795,_0x23a422){_0x36c795=_0x36c795-0x0;var _0x35db48=_0x7949[_0x36c795];return _0x35db48;};'use strict';var multer=require('multer');var util=require(_0x9794('0x0'));var path=require(_0x9794('0x1'));var timeout=require(_0x9794('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9794('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9794('0x4'));var config=require(_0x9794('0x5'));var controller=require('./analyticTreeReport.controller');router[_0x9794('0x6')]('/',auth[_0x9794('0x7')](),controller[_0x9794('0x8')]);router['get'](_0x9794('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x9794('0xa')]('/',auth[_0x9794('0x7')](),controller['create']);router[_0x9794('0xb')]('/:id',auth[_0x9794('0x7')](),controller[_0x9794('0xc')]);router[_0x9794('0xd')]('/:id',auth[_0x9794('0x7')](),controller[_0x9794('0xe')]);module[_0x9794('0xf')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index c2a439f..01b45f3 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 _0xe107=['STRING','sequelize'];(function(_0x2f36d2,_0x24285c){var _0x147f7f=function(_0x41db50){while(--_0x41db50){_0x2f36d2['push'](_0x2f36d2['shift']());}};_0x147f7f(++_0x24285c);}(_0xe107,0xb3));var _0x7e10=function(_0x3bc799,_0x15f2d1){_0x3bc799=_0x3bc799-0x0;var _0x25d52b=_0xe107[_0x3bc799];return _0x25d52b;};'use strict';var Sequelize=require(_0x7e10('0x0'));module['exports']={'name':{'type':Sequelize[_0x7e10('0x1')]},'basename':{'type':Sequelize[_0x7e10('0x1')]},'type':{'type':Sequelize[_0x7e10('0x1')]}}; \ No newline at end of file +var _0x1c4d=['STRING','exports'];(function(_0x4c89d6,_0x139ce6){var _0x288238=function(_0x2860af){while(--_0x2860af){_0x4c89d6['push'](_0x4c89d6['shift']());}};_0x288238(++_0x139ce6);}(_0x1c4d,0x1d7));var _0xd1c4=function(_0x21b84d,_0x4da029){_0x21b84d=_0x21b84d-0x0;var _0x3bd8ef=_0x1c4d[_0x21b84d];return _0x3bd8ef;};'use strict';var Sequelize=require('sequelize');module[_0xd1c4('0x0')]={'name':{'type':Sequelize[_0xd1c4('0x1')]},'basename':{'type':Sequelize[_0xd1c4('0x1')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 5e636f1..99e6e47 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 _0x1665=['join','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','moment','path','to-csv','ejs','fs-extra','lodash','squel','crypto','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','count','set','Content-Range','reject','then','error','stack','send','index','map','fieldName','key','model','name','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filters','merge','type','VIRTUAL','filter','options','Attachment','include','findAll','rows','catch','rawAttributes','includeAll','find','clone','params','get','omit','updatedAt','body','createdAt','create','update','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId'];(function(_0x4556ac,_0x9dee55){var _0xc08b1e=function(_0x16a35d){while(--_0x16a35d){_0x4556ac['push'](_0x4556ac['shift']());}};_0xc08b1e(++_0x9dee55);}(_0x1665,0x1c5));var _0x5166=function(_0x180297,_0x56bb6d){_0x180297=_0x180297-0x0;var _0x1f7aae=_0x1665[_0x180297];return _0x1f7aae;};'use strict';var emlformat=require(_0x5166('0x0'));var rimraf=require(_0x5166('0x1'));var zipdir=require(_0x5166('0x2'));var jsonpatch=require(_0x5166('0x3'));var rp=require('request-promise');var moment=require(_0x5166('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x5166('0x5'));var sox=require('sox');var csv=require(_0x5166('0x6'));var ejs=require(_0x5166('0x7'));var fs=require('fs');var fs_extra=require(_0x5166('0x8'));var _=require(_0x5166('0x9'));var squel=require(_0x5166('0xa'));var crypto=require(_0x5166('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5166('0xc'));var toCsv=require(_0x5166('0x6'));var querystring=require('querystring');var Papa=require(_0x5166('0xd'));var Redis=require(_0x5166('0xe'));var authService=require(_0x5166('0xf'));var qs=require(_0x5166('0x10'));var as=require(_0x5166('0x11'));var hardwareService=require(_0x5166('0x12'));var logger=require(_0x5166('0x13'))('api');var utils=require(_0x5166('0x14'));var config=require(_0x5166('0x15'));var licenseUtil=require(_0x5166('0x16'));var db=require(_0x5166('0x17'))['db'];function respondWithStatusCode(_0x3d8ba1,_0x112cc3){_0x112cc3=_0x112cc3||0xcc;return function(_0x3b4e8f){if(_0x3b4e8f){return _0x3d8ba1[_0x5166('0x18')](_0x112cc3);}return _0x3d8ba1[_0x5166('0x19')](_0x112cc3)[_0x5166('0x1a')]();};}function respondWithResult(_0x46fcbe,_0x2ca39a){_0x2ca39a=_0x2ca39a||0xc8;return function(_0x24b519){if(_0x24b519){return _0x46fcbe['status'](_0x2ca39a)[_0x5166('0x1b')](_0x24b519);}};}function respondWithFilteredResult(_0x561b56,_0x3e0ea3){return function(_0xf7dffe){if(_0xf7dffe){var _0x4e2f24=typeof _0x3e0ea3[_0x5166('0x1c')]===_0x5166('0x1d')&&typeof _0x3e0ea3[_0x5166('0x1e')]===_0x5166('0x1d');var _0x1e9e68=_0xf7dffe[_0x5166('0x1f')];var _0x18b358=_0x4e2f24?0x0:_0x3e0ea3[_0x5166('0x1c')];var _0x78757d=_0x4e2f24?_0xf7dffe['count']:_0x3e0ea3[_0x5166('0x1c')]+_0x3e0ea3[_0x5166('0x1e')];var _0x1ff7a3;if(_0x78757d>=_0x1e9e68){_0x78757d=_0x1e9e68;_0x1ff7a3=0xc8;}else{_0x1ff7a3=0xce;}_0x561b56[_0x5166('0x19')](_0x1ff7a3);return _0x561b56[_0x5166('0x20')](_0x5166('0x21'),_0x18b358+'-'+_0x78757d+'/'+_0x1e9e68)[_0x5166('0x1b')](_0xf7dffe);}return null;};}function patchUpdates(_0x1f7907){return function(_0x140087){try{jsonpatch['apply'](_0x140087,_0x1f7907,!![]);}catch(_0x3d37c2){return BPromise[_0x5166('0x22')](_0x3d37c2);}return _0x140087['save']();};}function saveUpdates(_0x48498b,_0x3e9822){return function(_0x47a35b){if(_0x47a35b){return _0x47a35b['update'](_0x48498b)[_0x5166('0x23')](function(_0x4abe17){return _0x4abe17;});}return null;};}function removeEntity(_0x1cb02d,_0x19ffff){return function(_0x4ca095){if(_0x4ca095){return _0x4ca095['destroy']()['then'](function(){_0x1cb02d[_0x5166('0x19')](0xcc)[_0x5166('0x1a')]();});}};}function handleEntityNotFound(_0x4a1b93,_0xf2b1a0){return function(_0xb46239){if(!_0xb46239){_0x4a1b93[_0x5166('0x18')](0x194);}return _0xb46239;};}function handleError(_0x3c7def,_0x22220d){_0x22220d=_0x22220d||0x1f4;return function(_0xf4059){logger[_0x5166('0x24')](_0xf4059[_0x5166('0x25')]);if(_0xf4059['name']){delete _0xf4059['name'];}_0x3c7def[_0x5166('0x19')](_0x22220d)[_0x5166('0x26')](_0xf4059);};}exports[_0x5166('0x27')]=function(_0x581bcc,_0x2035bf){var _0x3c9f43={},_0x333bf1={},_0x15f39f={'count':0x0,'rows':[]};var _0x20135e=_[_0x5166('0x28')](db['Attachment']['rawAttributes'],function(_0x4288f0){return{'name':_0x4288f0[_0x5166('0x29')],'type':_0x4288f0['type'][_0x5166('0x2a')]};});_0x333bf1[_0x5166('0x2b')]=_['map'](_0x20135e,_0x5166('0x2c'));_0x333bf1['query']=_[_0x5166('0x2d')](_0x581bcc[_0x5166('0x2e')]);_0x333bf1['filters']=_[_0x5166('0x2f')](_0x333bf1[_0x5166('0x2b')],_0x333bf1['query']);_0x3c9f43[_0x5166('0x30')]=_[_0x5166('0x2f')](_0x333bf1[_0x5166('0x2b')],qs[_0x5166('0x31')](_0x581bcc[_0x5166('0x2e')]['fields']));_0x3c9f43['attributes']=_0x3c9f43['attributes'][_0x5166('0x32')]?_0x3c9f43['attributes']:_0x333bf1[_0x5166('0x2b')];if(!_0x581bcc['query']['hasOwnProperty'](_0x5166('0x33'))){_0x3c9f43[_0x5166('0x1e')]=qs[_0x5166('0x1e')](_0x581bcc[_0x5166('0x2e')]['limit']);_0x3c9f43[_0x5166('0x1c')]=qs['offset'](_0x581bcc[_0x5166('0x2e')]['offset']);}_0x3c9f43[_0x5166('0x34')]=qs[_0x5166('0x35')](_0x581bcc[_0x5166('0x2e')][_0x5166('0x35')]);_0x3c9f43[_0x5166('0x36')]=qs['filters'](_[_0x5166('0x37')](_0x581bcc['query'],_0x333bf1[_0x5166('0x38')]),_0x20135e);if(_0x581bcc[_0x5166('0x2e')]['filter']){_0x3c9f43[_0x5166('0x36')]=_[_0x5166('0x39')](_0x3c9f43[_0x5166('0x36')],{'$or':_[_0x5166('0x28')](_0x20135e,function(_0x55f7b7){if(_0x55f7b7[_0x5166('0x3a')]!==_0x5166('0x3b')){var _0x726a5d={};_0x726a5d[_0x55f7b7[_0x5166('0x2c')]]={'$like':'%'+_0x581bcc[_0x5166('0x2e')][_0x5166('0x3c')]+'%'};return _0x726a5d;}})});}_0x3c9f43=_['merge']({},_0x3c9f43,_0x581bcc[_0x5166('0x3d')]);var _0x49f86f={'where':_0x3c9f43[_0x5166('0x36')]};return db[_0x5166('0x3e')][_0x5166('0x1f')](_0x49f86f)[_0x5166('0x23')](function(_0x8d3b7c){_0x15f39f['count']=_0x8d3b7c;if(_0x581bcc['query']['includeAll']){_0x3c9f43[_0x5166('0x3f')]=[{'all':!![]}];}return db[_0x5166('0x3e')][_0x5166('0x40')](_0x3c9f43);})['then'](function(_0x2ea829){_0x15f39f[_0x5166('0x41')]=_0x2ea829;return _0x15f39f;})[_0x5166('0x23')](respondWithFilteredResult(_0x2035bf,_0x3c9f43))[_0x5166('0x42')](handleError(_0x2035bf,null));};exports['show']=function(_0x2c900f,_0x2195c5){var _0x3a1273={'raw':!![],'where':{'id':_0x2c900f['params']['id']}},_0x340251={};_0x340251[_0x5166('0x2b')]=_[_0x5166('0x2d')](db['Attachment'][_0x5166('0x43')]);_0x340251[_0x5166('0x2e')]=_[_0x5166('0x2d')](_0x2c900f[_0x5166('0x2e')]);_0x340251[_0x5166('0x38')]=_[_0x5166('0x2f')](_0x340251[_0x5166('0x2b')],_0x340251[_0x5166('0x2e')]);_0x3a1273[_0x5166('0x30')]=_[_0x5166('0x2f')](_0x340251[_0x5166('0x2b')],qs[_0x5166('0x31')](_0x2c900f[_0x5166('0x2e')]['fields']));_0x3a1273[_0x5166('0x30')]=_0x3a1273['attributes'][_0x5166('0x32')]?_0x3a1273[_0x5166('0x30')]:_0x340251[_0x5166('0x2b')];if(_0x2c900f[_0x5166('0x2e')][_0x5166('0x44')]){_0x3a1273[_0x5166('0x3f')]=[{'all':!![]}];}_0x3a1273=_['merge']({},_0x3a1273,_0x2c900f[_0x5166('0x3d')]);return db[_0x5166('0x3e')][_0x5166('0x45')](_0x3a1273)[_0x5166('0x23')](handleEntityNotFound(_0x2195c5,null))[_0x5166('0x23')](respondWithResult(_0x2195c5,null))[_0x5166('0x42')](handleError(_0x2195c5,null));};exports[_0x5166('0x46')]=function(_0x4035d8,_0xa598f){var _0x5f1030={'where':{'id':_0x4035d8[_0x5166('0x47')]['id']}},_0x3462bb={};_0x3462bb[_0x5166('0x2b')]=_['keys'](db[_0x5166('0x3e')][_0x5166('0x43')]);_0x5f1030['attributes']=_[_0x5166('0x2f')](_0x3462bb[_0x5166('0x2b')],qs['fields'](_0x4035d8['query']['fields']));_0x5f1030[_0x5166('0x30')]=_0x5f1030[_0x5166('0x30')][_0x5166('0x32')]?_0x5f1030[_0x5166('0x30')]:_0x3462bb['model'];if(_0x4035d8['query'][_0x5166('0x44')]){_0x5f1030[_0x5166('0x3f')]=[{'all':!![]}];}_0x5f1030=_['merge']({},_0x5f1030,_0x4035d8[_0x5166('0x3d')]);return db['Attachment'][_0x5166('0x45')](_0x5f1030)['then'](handleEntityNotFound(_0xa598f,null))['then'](function(_0x4b502e){if(_0x4b502e){var _0x17b8a3=_0x4b502e[_0x5166('0x48')]({'plain':!![]});_0x17b8a3=qs[_0x5166('0x49')](_0x17b8a3,['id','createdAt',_0x5166('0x4a')]);_0x4035d8[_0x5166('0x4b')]=_['omit'](_0x4035d8[_0x5166('0x4b')],['id',_0x5166('0x4c'),_0x5166('0x4a')]);return db[_0x5166('0x3e')][_0x5166('0x4d')](_[_0x5166('0x39')](_0x17b8a3,_0x4035d8[_0x5166('0x4b')]),{'include':_0x4035d8[_0x5166('0x2e')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x5166('0x23')](respondWithResult(_0xa598f,0xc9))[_0x5166('0x42')](handleError(_0xa598f,null));};exports[_0x5166('0x4e')]=function(_0x463366,_0x583ee8){if(_0x463366[_0x5166('0x4b')]['id']){delete _0x463366[_0x5166('0x4b')]['id'];}return db[_0x5166('0x3e')]['find']({'where':{'id':_0x463366[_0x5166('0x47')]['id']}})['then'](handleEntityNotFound(_0x583ee8,null))['then'](saveUpdates(_0x463366['body'],null))[_0x5166('0x23')](respondWithResult(_0x583ee8,null))[_0x5166('0x42')](handleError(_0x583ee8,null));};exports['destroy']=function(_0x6172ea,_0x3667b1){return db[_0x5166('0x3e')][_0x5166('0x45')]({'where':{'id':_0x6172ea[_0x5166('0x47')]['id']}})['then'](handleEntityNotFound(_0x3667b1,null))[_0x5166('0x23')](removeEntity(_0x3667b1,null))[_0x5166('0x42')](handleError(_0x3667b1,null));};exports[_0x5166('0x4d')]=function(_0x38b414,_0x5576b2,_0x51ad14){_0x38b414[_0x5166('0x4b')][_0x5166('0x2c')]=_0x38b414[_0x5166('0x4f')][_0x5166('0x50')];_0x38b414[_0x5166('0x4b')][_0x5166('0x51')]=_0x38b414[_0x5166('0x4f')][_0x5166('0x52')];_0x38b414[_0x5166('0x4b')][_0x5166('0x3a')]=_0x38b414[_0x5166('0x4f')][_0x5166('0x53')];return db[_0x5166('0x3e')][_0x5166('0x4d')](_0x38b414[_0x5166('0x4b')])[_0x5166('0x23')](respondWithResult(_0x5576b2,0xc9))[_0x5166('0x42')](handleError(_0x5576b2,null));};exports[_0x5166('0x54')]=function(_0x52da7f,_0x32ed64,_0x47a127){return db[_0x5166('0x3e')][_0x5166('0x55')]({'where':{'id':_0x52da7f[_0x5166('0x47')]['id']},'raw':!![]})[_0x5166('0x23')](handleEntityNotFound(_0x32ed64,null))[_0x5166('0x23')](function(_0x3cfd52){if(_0x3cfd52){var _0x1f1456=_0x3cfd52[_0x5166('0x56')]!==null;var _0x5084da=path[_0x5166('0x57')](config['root'],_0x5166('0x58'));if(_0x1f1456){_0x5084da=path[_0x5166('0x57')](_0x5084da,_0x5166('0x59'));}var _0x226204=path[_0x5166('0x57')](_0x5084da,_0x3cfd52[_0x5166('0x51')]);return _0x32ed64['download'](_0x226204);}})[_0x5166('0x42')](handleError(_0x32ed64,null));}; \ No newline at end of file +var _0x1a2a=['query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','Attachment','includeAll','include','rows','catch','show','params','keys','options','get','omit','createdAt','updatedAt','body','create','find','file','ChatOfflineMessageId','root','basename','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','key','model','map'];(function(_0x36b610,_0x50d36e){var _0xc24563=function(_0x418000){while(--_0x418000){_0x36b610['push'](_0x36b610['shift']());}};_0xc24563(++_0x50d36e);}(_0x1a2a,0xc9));var _0xa1a2=function(_0xd46333,_0x1b05c1){_0xd46333=_0xd46333-0x0;var _0x336108=_0x1a2a[_0xd46333];return _0x336108;};'use strict';var emlformat=require(_0xa1a2('0x0'));var rimraf=require(_0xa1a2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa1a2('0x2'));var rp=require(_0xa1a2('0x3'));var moment=require(_0xa1a2('0x4'));var BPromise=require(_0xa1a2('0x5'));var Mustache=require(_0xa1a2('0x6'));var util=require(_0xa1a2('0x7'));var path=require('path');var sox=require(_0xa1a2('0x8'));var csv=require(_0xa1a2('0x9'));var ejs=require(_0xa1a2('0xa'));var fs=require('fs');var fs_extra=require(_0xa1a2('0xb'));var _=require(_0xa1a2('0xc'));var squel=require('squel');var crypto=require(_0xa1a2('0xd'));var jsforce=require(_0xa1a2('0xe'));var deskjs=require(_0xa1a2('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa1a2('0x10'));var Papa=require(_0xa1a2('0x11'));var Redis=require(_0xa1a2('0x12'));var authService=require(_0xa1a2('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa1a2('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa1a2('0x15'));var utils=require('../../config/utils');var config=require(_0xa1a2('0x16'));var licenseUtil=require(_0xa1a2('0x17'));var db=require(_0xa1a2('0x18'))['db'];function respondWithStatusCode(_0x454b4b,_0x51bc3d){_0x51bc3d=_0x51bc3d||0xcc;return function(_0x419d34){if(_0x419d34){return _0x454b4b[_0xa1a2('0x19')](_0x51bc3d);}return _0x454b4b[_0xa1a2('0x1a')](_0x51bc3d)[_0xa1a2('0x1b')]();};}function respondWithResult(_0x580173,_0x1ab0ad){_0x1ab0ad=_0x1ab0ad||0xc8;return function(_0x123f17){if(_0x123f17){return _0x580173[_0xa1a2('0x1a')](_0x1ab0ad)['json'](_0x123f17);}};}function respondWithFilteredResult(_0x3e1408,_0x2f8e03){return function(_0x55954b){if(_0x55954b){var _0x517f66=typeof _0x2f8e03[_0xa1a2('0x1c')]==='undefined'&&typeof _0x2f8e03['limit']===_0xa1a2('0x1d');var _0x4e3bb0=_0x55954b['count'];var _0x1e196c=_0x517f66?0x0:_0x2f8e03['offset'];var _0x1679fa=_0x517f66?_0x55954b[_0xa1a2('0x1e')]:_0x2f8e03[_0xa1a2('0x1c')]+_0x2f8e03[_0xa1a2('0x1f')];var _0xfce3a7;if(_0x1679fa>=_0x4e3bb0){_0x1679fa=_0x4e3bb0;_0xfce3a7=0xc8;}else{_0xfce3a7=0xce;}_0x3e1408[_0xa1a2('0x1a')](_0xfce3a7);return _0x3e1408['set'](_0xa1a2('0x20'),_0x1e196c+'-'+_0x1679fa+'/'+_0x4e3bb0)['json'](_0x55954b);}return null;};}function patchUpdates(_0x2dbda4){return function(_0x2c7b64){try{jsonpatch[_0xa1a2('0x21')](_0x2c7b64,_0x2dbda4,!![]);}catch(_0x45b1a4){return BPromise['reject'](_0x45b1a4);}return _0x2c7b64[_0xa1a2('0x22')]();};}function saveUpdates(_0xf7cf05,_0x4381be){return function(_0x678ad6){if(_0x678ad6){return _0x678ad6[_0xa1a2('0x23')](_0xf7cf05)[_0xa1a2('0x24')](function(_0x1ff9ad){return _0x1ff9ad;});}return null;};}function removeEntity(_0x1b69e3,_0xfa3015){return function(_0x3b6580){if(_0x3b6580){return _0x3b6580[_0xa1a2('0x25')]()[_0xa1a2('0x24')](function(){_0x1b69e3['status'](0xcc)[_0xa1a2('0x1b')]();});}};}function handleEntityNotFound(_0x148d23,_0x275e10){return function(_0x311728){if(!_0x311728){_0x148d23[_0xa1a2('0x19')](0x194);}return _0x311728;};}function handleError(_0x3b5de1,_0x3c8336){_0x3c8336=_0x3c8336||0x1f4;return function(_0x17790d){logger[_0xa1a2('0x26')](_0x17790d[_0xa1a2('0x27')]);if(_0x17790d['name']){delete _0x17790d[_0xa1a2('0x28')];}_0x3b5de1[_0xa1a2('0x1a')](_0x3c8336)[_0xa1a2('0x29')](_0x17790d);};}exports[_0xa1a2('0x2a')]=function(_0x4fe3be,_0x503c98){var _0x3d0f13={},_0xabff97={},_0x4168f1={'count':0x0,'rows':[]};var _0x46fba0=_['map'](db['Attachment'][_0xa1a2('0x2b')],function(_0xc1ba7){return{'name':_0xc1ba7[_0xa1a2('0x2c')],'type':_0xc1ba7['type'][_0xa1a2('0x2d')]};});_0xabff97[_0xa1a2('0x2e')]=_[_0xa1a2('0x2f')](_0x46fba0,_0xa1a2('0x28'));_0xabff97[_0xa1a2('0x30')]=_['keys'](_0x4fe3be['query']);_0xabff97['filters']=_[_0xa1a2('0x31')](_0xabff97[_0xa1a2('0x2e')],_0xabff97[_0xa1a2('0x30')]);_0x3d0f13[_0xa1a2('0x32')]=_[_0xa1a2('0x31')](_0xabff97[_0xa1a2('0x2e')],qs[_0xa1a2('0x33')](_0x4fe3be[_0xa1a2('0x30')][_0xa1a2('0x33')]));_0x3d0f13[_0xa1a2('0x32')]=_0x3d0f13[_0xa1a2('0x32')][_0xa1a2('0x34')]?_0x3d0f13[_0xa1a2('0x32')]:_0xabff97[_0xa1a2('0x2e')];if(!_0x4fe3be[_0xa1a2('0x30')]['hasOwnProperty'](_0xa1a2('0x35'))){_0x3d0f13[_0xa1a2('0x1f')]=qs['limit'](_0x4fe3be[_0xa1a2('0x30')][_0xa1a2('0x1f')]);_0x3d0f13[_0xa1a2('0x1c')]=qs[_0xa1a2('0x1c')](_0x4fe3be['query'][_0xa1a2('0x1c')]);}_0x3d0f13[_0xa1a2('0x36')]=qs['sort'](_0x4fe3be[_0xa1a2('0x30')][_0xa1a2('0x37')]);_0x3d0f13[_0xa1a2('0x38')]=qs[_0xa1a2('0x39')](_[_0xa1a2('0x3a')](_0x4fe3be['query'],_0xabff97['filters']),_0x46fba0);if(_0x4fe3be[_0xa1a2('0x30')][_0xa1a2('0x3b')]){_0x3d0f13[_0xa1a2('0x38')]=_[_0xa1a2('0x3c')](_0x3d0f13['where'],{'$or':_['map'](_0x46fba0,function(_0x2a8848){if(_0x2a8848[_0xa1a2('0x3d')]!==_0xa1a2('0x3e')){var _0x3b1248={};_0x3b1248[_0x2a8848['name']]={'$like':'%'+_0x4fe3be[_0xa1a2('0x30')][_0xa1a2('0x3b')]+'%'};return _0x3b1248;}})});}_0x3d0f13=_[_0xa1a2('0x3c')]({},_0x3d0f13,_0x4fe3be['options']);var _0x107bad={'where':_0x3d0f13[_0xa1a2('0x38')]};return db[_0xa1a2('0x3f')][_0xa1a2('0x1e')](_0x107bad)[_0xa1a2('0x24')](function(_0x1b4b4d){_0x4168f1[_0xa1a2('0x1e')]=_0x1b4b4d;if(_0x4fe3be[_0xa1a2('0x30')][_0xa1a2('0x40')]){_0x3d0f13[_0xa1a2('0x41')]=[{'all':!![]}];}return db[_0xa1a2('0x3f')]['findAll'](_0x3d0f13);})[_0xa1a2('0x24')](function(_0x41dbf6){_0x4168f1[_0xa1a2('0x42')]=_0x41dbf6;return _0x4168f1;})[_0xa1a2('0x24')](respondWithFilteredResult(_0x503c98,_0x3d0f13))[_0xa1a2('0x43')](handleError(_0x503c98,null));};exports[_0xa1a2('0x44')]=function(_0x1a335b,_0x7016ca){var _0x4132ae={'raw':!![],'where':{'id':_0x1a335b[_0xa1a2('0x45')]['id']}},_0x146487={};_0x146487[_0xa1a2('0x2e')]=_[_0xa1a2('0x46')](db[_0xa1a2('0x3f')][_0xa1a2('0x2b')]);_0x146487[_0xa1a2('0x30')]=_[_0xa1a2('0x46')](_0x1a335b[_0xa1a2('0x30')]);_0x146487['filters']=_[_0xa1a2('0x31')](_0x146487['model'],_0x146487['query']);_0x4132ae[_0xa1a2('0x32')]=_['intersection'](_0x146487[_0xa1a2('0x2e')],qs[_0xa1a2('0x33')](_0x1a335b[_0xa1a2('0x30')][_0xa1a2('0x33')]));_0x4132ae[_0xa1a2('0x32')]=_0x4132ae[_0xa1a2('0x32')][_0xa1a2('0x34')]?_0x4132ae[_0xa1a2('0x32')]:_0x146487[_0xa1a2('0x2e')];if(_0x1a335b[_0xa1a2('0x30')]['includeAll']){_0x4132ae[_0xa1a2('0x41')]=[{'all':!![]}];}_0x4132ae=_[_0xa1a2('0x3c')]({},_0x4132ae,_0x1a335b[_0xa1a2('0x47')]);return db[_0xa1a2('0x3f')]['find'](_0x4132ae)[_0xa1a2('0x24')](handleEntityNotFound(_0x7016ca,null))[_0xa1a2('0x24')](respondWithResult(_0x7016ca,null))[_0xa1a2('0x43')](handleError(_0x7016ca,null));};exports['clone']=function(_0x403625,_0x21a86d){var _0x3e25b3={'where':{'id':_0x403625[_0xa1a2('0x45')]['id']}},_0x594ab2={};_0x594ab2[_0xa1a2('0x2e')]=_[_0xa1a2('0x46')](db[_0xa1a2('0x3f')][_0xa1a2('0x2b')]);_0x3e25b3[_0xa1a2('0x32')]=_[_0xa1a2('0x31')](_0x594ab2['model'],qs[_0xa1a2('0x33')](_0x403625[_0xa1a2('0x30')][_0xa1a2('0x33')]));_0x3e25b3['attributes']=_0x3e25b3['attributes'][_0xa1a2('0x34')]?_0x3e25b3['attributes']:_0x594ab2['model'];if(_0x403625[_0xa1a2('0x30')][_0xa1a2('0x40')]){_0x3e25b3[_0xa1a2('0x41')]=[{'all':!![]}];}_0x3e25b3=_[_0xa1a2('0x3c')]({},_0x3e25b3,_0x403625['options']);return db[_0xa1a2('0x3f')]['find'](_0x3e25b3)['then'](handleEntityNotFound(_0x21a86d,null))[_0xa1a2('0x24')](function(_0x5a6e4f){if(_0x5a6e4f){var _0x3e5595=_0x5a6e4f[_0xa1a2('0x48')]({'plain':!![]});_0x3e5595=qs[_0xa1a2('0x49')](_0x3e5595,['id',_0xa1a2('0x4a'),_0xa1a2('0x4b')]);_0x403625[_0xa1a2('0x4c')]=_[_0xa1a2('0x49')](_0x403625[_0xa1a2('0x4c')],['id',_0xa1a2('0x4a'),_0xa1a2('0x4b')]);return db[_0xa1a2('0x3f')][_0xa1a2('0x4d')](_['merge'](_0x3e5595,_0x403625[_0xa1a2('0x4c')]),{'include':_0x403625['query']['includeAll']?[{'all':!![]}]:undefined});}})[_0xa1a2('0x24')](respondWithResult(_0x21a86d,0xc9))[_0xa1a2('0x43')](handleError(_0x21a86d,null));};exports[_0xa1a2('0x23')]=function(_0x549c24,_0x152cec){if(_0x549c24[_0xa1a2('0x4c')]['id']){delete _0x549c24[_0xa1a2('0x4c')]['id'];}return db[_0xa1a2('0x3f')][_0xa1a2('0x4e')]({'where':{'id':_0x549c24['params']['id']}})[_0xa1a2('0x24')](handleEntityNotFound(_0x152cec,null))[_0xa1a2('0x24')](saveUpdates(_0x549c24[_0xa1a2('0x4c')],null))[_0xa1a2('0x24')](respondWithResult(_0x152cec,null))['catch'](handleError(_0x152cec,null));};exports[_0xa1a2('0x25')]=function(_0x41a965,_0x5f0bb0){return db[_0xa1a2('0x3f')][_0xa1a2('0x4e')]({'where':{'id':_0x41a965[_0xa1a2('0x45')]['id']}})[_0xa1a2('0x24')](handleEntityNotFound(_0x5f0bb0,null))['then'](removeEntity(_0x5f0bb0,null))[_0xa1a2('0x43')](handleError(_0x5f0bb0,null));};exports[_0xa1a2('0x4d')]=function(_0xe35ea,_0x5e7c48,_0xc46e0d){_0xe35ea[_0xa1a2('0x4c')][_0xa1a2('0x28')]=_0xe35ea[_0xa1a2('0x4f')]['originalname'];_0xe35ea[_0xa1a2('0x4c')]['basename']=_0xe35ea[_0xa1a2('0x4f')]['filename'];_0xe35ea[_0xa1a2('0x4c')]['type']=_0xe35ea['file']['mimetype'];return db['Attachment'][_0xa1a2('0x4d')](_0xe35ea['body'])[_0xa1a2('0x24')](respondWithResult(_0x5e7c48,0xc9))[_0xa1a2('0x43')](handleError(_0x5e7c48,null));};exports['download']=function(_0x3fba66,_0x5d4e59,_0x5149f0){return db[_0xa1a2('0x3f')]['findOne']({'where':{'id':_0x3fba66['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x5d4e59,null))[_0xa1a2('0x24')](function(_0x5d1ae9){if(_0x5d1ae9){var _0x638961=_0x5d1ae9[_0xa1a2('0x50')]!==null;var _0x5e6249=path['join'](config[_0xa1a2('0x51')],'server/files/attachments/');if(_0x638961){_0x5e6249=path['join'](_0x5e6249,'offline-chat/');}var _0x4bd318=path['join'](_0x5e6249,_0x5d1ae9[_0xa1a2('0x52')]);return _0x5d4e59['download'](_0x4bd318);}})[_0xa1a2('0x43')](handleError(_0x5d4e59,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 1e9ec5f..b1bdc2d 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 _0x133f=['attachments','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment'];(function(_0x4c3edd,_0x40f720){var _0x5b8db0=function(_0x5947c4){while(--_0x5947c4){_0x4c3edd['push'](_0x4c3edd['shift']());}};_0x5b8db0(++_0x40f720);}(_0x133f,0x112));var _0xf133=function(_0x9b64b2,_0x28fbc7){_0x9b64b2=_0x9b64b2-0x0;var _0x1ca2ad=_0x133f[_0x9b64b2];return _0x1ca2ad;};'use strict';var _=require(_0xf133('0x0'));var util=require(_0xf133('0x1'));var logger=require(_0xf133('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf133('0x3'));var rp=require(_0xf133('0x4'));var fs=require('fs');var path=require(_0xf133('0x5'));var rimraf=require(_0xf133('0x6'));var config=require(_0xf133('0x7'));var attributes=require(_0xf133('0x8'));module[_0xf133('0x9')]=function(_0x41e200,_0x5d6831){return _0x41e200[_0xf133('0xa')](_0xf133('0xb'),attributes,{'tableName':_0xf133('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc86f=['../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x57ff59,_0x4b9327){var _0x58e63f=function(_0x3b1072){while(--_0x3b1072){_0x57ff59['push'](_0x57ff59['shift']());}};_0x58e63f(++_0x4b9327);}(_0xc86f,0xca));var _0xfc86=function(_0xb1df1b,_0x3cc823){_0xb1df1b=_0xb1df1b-0x0;var _0x56863c=_0xc86f[_0xb1df1b];return _0x56863c;};'use strict';var _=require(_0xfc86('0x0'));var util=require(_0xfc86('0x1'));var logger=require(_0xfc86('0x2'))('api');var moment=require(_0xfc86('0x3'));var BPromise=require(_0xfc86('0x4'));var rp=require(_0xfc86('0x5'));var fs=require('fs');var path=require(_0xfc86('0x6'));var rimraf=require(_0xfc86('0x7'));var config=require(_0xfc86('0x8'));var attributes=require(_0xfc86('0x9'));module[_0xfc86('0xa')]=function(_0x372af2,_0x219e31){return _0x372af2[_0xfc86('0xb')](_0xfc86('0xc'),attributes,{'tableName':_0xfc86('0xd'),'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 47632c1..5c902e7 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 _0x6282=['../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateAttachment','create','options','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc'];(function(_0x438179,_0x136a2b){var _0x2632cd=function(_0x540673){while(--_0x540673){_0x438179['push'](_0x438179['shift']());}};_0x2632cd(++_0x136a2b);}(_0x6282,0x76));var _0x2628=function(_0x89cbc,_0x2c1df3){_0x89cbc=_0x89cbc-0x0;var _0x2131d2=_0x6282[_0x89cbc];return _0x2131d2;};'use strict';var _=require(_0x2628('0x0'));var util=require(_0x2628('0x1'));var moment=require(_0x2628('0x2'));var BPromise=require(_0x2628('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2628('0x4'))['db'];var utils=require(_0x2628('0x5'));var logger=require('../../config/logger')(_0x2628('0x6'));var config=require(_0x2628('0x7'));var jayson=require(_0x2628('0x8'));var client=jayson[_0x2628('0x9')][_0x2628('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50412a,_0xb6b945,_0x144ae8){return new BPromise(function(_0x2170a7,_0xbae7c3){return client[_0x2628('0xb')](_0x50412a,_0x144ae8)[_0x2628('0xc')](function(_0x403569){logger[_0x2628('0xd')](_0x2628('0xe'),_0xb6b945,_0x2628('0xf'));logger[_0x2628('0x10')](_0x2628('0x11'),_0xb6b945,_0x2628('0xf'),JSON[_0x2628('0x12')](_0x403569));if(_0x403569[_0x2628('0x13')]){if(_0x403569['error']['code']===0x1f4){logger[_0x2628('0x13')](_0x2628('0xe'),_0xb6b945,_0x403569[_0x2628('0x13')][_0x2628('0x14')]);return _0xbae7c3(_0x403569['error']['message']);}logger[_0x2628('0x13')](_0x2628('0xe'),_0xb6b945,_0x403569[_0x2628('0x13')][_0x2628('0x14')]);return _0x2170a7(_0x403569[_0x2628('0x13')]['message']);}else{logger[_0x2628('0xd')](_0x2628('0xe'),_0xb6b945,_0x2628('0xf'));_0x2170a7(_0x403569['result'][_0x2628('0x14')]);}})[_0x2628('0x15')](function(_0x51df16){logger[_0x2628('0x13')]('Attachment,\x20%s,\x20%s',_0xb6b945,_0x51df16);_0xbae7c3(_0x51df16);});});}exports[_0x2628('0x16')]=function(_0x374501){var _0x57a575=this;return new Promise(function(_0x2a6bed,_0x114fd2){return db['Attachment'][_0x2628('0x17')](_0x374501['body'],{'raw':_0x374501[_0x2628('0x18')]?_0x374501['options']['raw']===undefined?!![]:![]:!![]})[_0x2628('0xc')](function(_0xd4cec){logger[_0x2628('0xd')](_0x2628('0x16'),_0x374501);logger[_0x2628('0x10')](_0x2628('0x16'),_0x374501,JSON[_0x2628('0x12')](_0xd4cec));_0x2a6bed(_0xd4cec);})[_0x2628('0x15')](function(_0x1746fe){logger['error'](_0x2628('0x16'),_0x1746fe[_0x2628('0x14')],_0x374501);_0x114fd2(_0x57a575[_0x2628('0x13')](0x1f4,_0x1746fe[_0x2628('0x14')]));});});}; \ No newline at end of file +var _0x26c2=['http','request','then','Attachment,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','Attachment','body','options','raw','CreateAttachment','debug','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x26c2,0x130));var _0x226c=function(_0x53cdaf,_0x37acc9){_0x53cdaf=_0x53cdaf-0x0;var _0xbd41b2=_0x26c2[_0x53cdaf];return _0xbd41b2;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x226c('0x0'));var rs=require(_0x226c('0x1'));var fs=require('fs');var Redis=require(_0x226c('0x2'));var db=require(_0x226c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x226c('0x4'))(_0x226c('0x5'));var config=require('../../config/environment');var jayson=require(_0x226c('0x6'));var client=jayson[_0x226c('0x7')][_0x226c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c4e5d,_0x4306c9,_0x59804e){return new BPromise(function(_0x34cbc3,_0x461773){return client[_0x226c('0x9')](_0x3c4e5d,_0x59804e)[_0x226c('0xa')](function(_0x127f10){logger['info'](_0x226c('0xb'),_0x4306c9,_0x226c('0xc'));logger['debug']('Attachment,\x20%s,\x20%s,\x20%s',_0x4306c9,_0x226c('0xc'),JSON[_0x226c('0xd')](_0x127f10));if(_0x127f10[_0x226c('0xe')]){if(_0x127f10[_0x226c('0xe')][_0x226c('0xf')]===0x1f4){logger[_0x226c('0xe')](_0x226c('0xb'),_0x4306c9,_0x127f10['error']['message']);return _0x461773(_0x127f10[_0x226c('0xe')][_0x226c('0x10')]);}logger[_0x226c('0xe')](_0x226c('0xb'),_0x4306c9,_0x127f10['error']['message']);return _0x34cbc3(_0x127f10[_0x226c('0xe')][_0x226c('0x10')]);}else{logger[_0x226c('0x11')]('Attachment,\x20%s,\x20%s',_0x4306c9,'request\x20sent');_0x34cbc3(_0x127f10[_0x226c('0x12')][_0x226c('0x10')]);}})[_0x226c('0x13')](function(_0x45a804){logger[_0x226c('0xe')]('Attachment,\x20%s,\x20%s',_0x4306c9,_0x45a804);_0x461773(_0x45a804);});});}exports['CreateAttachment']=function(_0x5989e0){var _0x36fa74=this;return new Promise(function(_0x813b69,_0x37ee58){return db[_0x226c('0x14')]['create'](_0x5989e0[_0x226c('0x15')],{'raw':_0x5989e0[_0x226c('0x16')]?_0x5989e0[_0x226c('0x16')][_0x226c('0x17')]===undefined?!![]:![]:!![]})[_0x226c('0xa')](function(_0x3d412a){logger['info'](_0x226c('0x18'),_0x5989e0);logger[_0x226c('0x19')](_0x226c('0x18'),_0x5989e0,JSON[_0x226c('0xd')](_0x3d412a));_0x813b69(_0x3d412a);})[_0x226c('0x13')](function(_0x57eb9f){logger['error']('CreateAttachment',_0x57eb9f[_0x226c('0x10')],_0x5989e0);_0x37ee58(_0x36fa74[_0x226c('0xe')](0x1f4,_0x57eb9f['message']));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index a84c6b1..29ff1f3 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x0b0e,0x187));var _0xe0b0=function(_0xab0515,_0x4b8ab2){_0xab0515=_0xab0515-0x0;var _0x443d59=_0x0b0e[_0xab0515];return _0x443d59;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x5db657,_0x2f40b3){var _0x2d6e70=function(_0x358ed2){while(--_0x358ed2){_0x5db657['push'](_0x5db657['shift']());}};_0x2d6e70(++_0x2f40b3);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x5f66[_0x2b4411];return _0x8e41ef;};'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('./attachment.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['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index a36d6f8..8a4878c 100644 --- a/server/api/authActiveDirectory/authActiveDirectory.controller.js +++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc140=['bluebird','util','../../mysqldb','../../components/auth/service','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','domain','authenticate','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blockedAt','online','admin','user','agent','blocked','add','minutes','getLicense','catch','send','message','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','passport','passport-local','Strategy','moment','activedirectory2'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc140,0xeb));var _0x0c14=function(_0x651909,_0x15c6b4){_0x651909=_0x651909-0x0;var _0x572299=_0xc140[_0x651909];return _0x572299;};'use strict';var passport=require(_0x0c14('0x0'));var LocalStrategy=require(_0x0c14('0x1'))[_0x0c14('0x2')];var moment=require(_0x0c14('0x3'));var ActiveDirectory=require(_0x0c14('0x4'));var BPromise=require(_0x0c14('0x5'));var util=require(_0x0c14('0x6'));var db=require(_0x0c14('0x7'))['db'];var authService=require(_0x0c14('0x8'));var utils=require('../../config/utils');var config=require(_0x0c14('0x9'));var logger=require(_0x0c14('0xa'))(_0x0c14('0xb'));function isActiveDirectoryConfigured(_0x52db98){var _0x52a7b5=![];if(typeof _0x52db98[_0x0c14('0xc')]!==_0x0c14('0xd')){_0x52a7b5=_0x52db98['activedirectory'][_0x0c14('0xe')]&&_0x52db98[_0x0c14('0xc')][_0x0c14('0xf')]&&_0x52db98[_0x0c14('0xc')][_0x0c14('0x10')];}return _0x52a7b5;}function adAuthenticate(_0xbad4b8,_0xdf8ae7,_0x1dc7cd){return new BPromise(function(_0x3f8e54,_0x40de26){try{var _0x3c1685=new ActiveDirectory(_0xbad4b8);_0x3c1685[_0x0c14('0x11')](_0xdf8ae7,_0x1dc7cd,function(_0x4272d9,_0x140fc7){if(_0x4272d9){logger['error']('Error\x20authenticate\x20%s:\x20%s',_0xdf8ae7,util[_0x0c14('0x12')](_0x4272d9,{'showHidden':![],'depth':null}));_0x40de26(_0x0c14('0x13'));}else if(!_0x140fc7){logger[_0x0c14('0x14')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0xdf8ae7);_0x40de26(_0x0c14('0x13'));}else{_0x3f8e54(_0x140fc7);}});}catch(_0x1a599f){_0x40de26(_0x1a599f);}});}function ActiveDirectoryAuthenticate(_0x510f2a,_0x298b93,_0x48d92d,_0x419dde){var _0x3fb95d,_0x9d3d73;if(!isActiveDirectoryConfigured(config)){logger[_0x0c14('0x14')](_0x0c14('0x15'),_0x298b93);return _0x419dde(null,![],{'message':_0x0c14('0x13')});}return db['Setting'][_0x0c14('0x16')]({'where':{'id':0x1},'attributes':[_0x0c14('0x17'),_0x0c14('0x18')],'raw':!![]})[_0x0c14('0x19')](function(_0x5c82a4){_0x3fb95d=_0x5c82a4;if(!_0x3fb95d['adSsoEnabled']){logger[_0x0c14('0x14')](_0x0c14('0x1a'),_0x298b93);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x510f2a['findOne']({'attributes':['id',_0x0c14('0x1b'),_0x0c14('0x1c'),_0x0c14('0x1d'),_0x0c14('0x1e'),_0x0c14('0x1f'),'blocked',_0x0c14('0x20'),_0x0c14('0x21')],'where':{'name':_0x298b93,'role':{'$or':[_0x0c14('0x22'),_0x0c14('0x23'),_0x0c14('0x24')]},'adSsoEnabled':!![]}});})[_0x0c14('0x19')](function(_0x14abf2){if(!_0x14abf2||_0x14abf2&&_0x14abf2[_0x0c14('0x1b')]!==_0x298b93){throw new Error(_0x0c14('0x13'));}_0x9d3d73=_0x14abf2;var _0xcd694d=_0x9d3d73[_0x0c14('0x1b')]+'@'+config[_0x0c14('0xc')][_0x0c14('0x10')];return adAuthenticate(config['activedirectory'],_0xcd694d,_0x48d92d);})['then'](function(_0x405838){if(_0x9d3d73[_0x0c14('0x1f')]){throw new Error(_0x0c14('0x13'));}if(_0x3fb95d['blockDuration']>0x0){if(_0x9d3d73[_0x0c14('0x25')]){if(moment(_0x9d3d73[_0x0c14('0x20')])[_0x0c14('0x26')](_0x3fb95d[_0x0c14('0x18')],_0x0c14('0x27'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils['clearBlockUser'](_0x9d3d73,0x0,![],null)['then'](function(){return utils[_0x0c14('0x28')](_0x9d3d73);})['then'](function(){return _0x419dde(null,_0x9d3d73);});}else{return utils[_0x0c14('0x28')](_0x9d3d73)[_0x0c14('0x19')](function(){return _0x419dde(null,_0x9d3d73);});}}else{return utils[_0x0c14('0x28')](_0x9d3d73)[_0x0c14('0x19')](function(){return _0x419dde(null,_0x9d3d73);});}})[_0x0c14('0x29')](function(_0x25bfe0){return _0x419dde(null,![],_0x25bfe0);});}function handleError(_0x12da8e,_0x5dedd1,_0x22f0fa){return _0x12da8e['status'](_0x5dedd1||0x1f4)[_0x0c14('0x2a')]({'message':_0x22f0fa?_0x22f0fa[_0x0c14('0x2b')]||_0x22f0fa:''});}exports['login']=function(_0x30a3ca,_0x3ca3fa,_0xad64fa){passport[_0x0c14('0x11')](_0x0c14('0x2c'),function(_0x309bb8,_0x56ea3c,_0x4f82eb){var _0xc772e5=_0x309bb8||_0x4f82eb;if(_0xc772e5){return handleError(_0x3ca3fa,0x191,_0xc772e5);}if(!_0x56ea3c){return handleError(_0x3ca3fa,0x194,{'message':_0x0c14('0x2d')});}else{var _0x1cfb3e={'payload':{'id':_0x56ea3c['id'],'role':_0x56ea3c[_0x0c14('0x1e')]},'options':{'expiresIn':0x15180}};return authService[_0x0c14('0x2e')](_0x1cfb3e)[_0x0c14('0x19')](function(_0x1e431a){_0x3ca3fa[_0x0c14('0x2f')]({'id':_0x56ea3c['id'],'token':_0x1e431a,'statusCall':'','isAlreadyLogged':_0x56ea3c[_0x0c14('0x21')]});});}})(_0x30a3ca,_0x3ca3fa,_0xad64fa);};passport['use'](_0x0c14('0x2c'),new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x2d54c0,_0xae5fea,_0x28ebaa){return ActiveDirectoryAuthenticate(db['User'],_0x2d54c0,_0xae5fea,_0x28ebaa);})); \ No newline at end of file +var _0xa16e=['blocked','online','admin','user','agent','disabled','blockedAt','add','minutes','clearBlockUser','then','getLicense','send','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','User','passport','moment','bluebird','util','../../mysqldb','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','role'];(function(_0x445382,_0x5e63c3){var _0x552f4f=function(_0x22cea6){while(--_0x22cea6){_0x445382['push'](_0x445382['shift']());}};_0x552f4f(++_0x5e63c3);}(_0xa16e,0x133));var _0xea16=function(_0x3eb9fb,_0x5b8af6){_0x3eb9fb=_0x3eb9fb-0x0;var _0x4c9d13=_0xa16e[_0x3eb9fb];return _0x4c9d13;};'use strict';var passport=require(_0xea16('0x0'));var LocalStrategy=require('passport-local')['Strategy'];var moment=require(_0xea16('0x1'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0xea16('0x2'));var util=require(_0xea16('0x3'));var db=require(_0xea16('0x4'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xea16('0x5'));var config=require(_0xea16('0x6'));var logger=require(_0xea16('0x7'))(_0xea16('0x8'));function isActiveDirectoryConfigured(_0x20d943){var _0x28f55a=![];if(typeof _0x20d943[_0xea16('0x9')]!==_0xea16('0xa')){_0x28f55a=_0x20d943['activedirectory'][_0xea16('0xb')]&&_0x20d943[_0xea16('0x9')][_0xea16('0xc')]&&_0x20d943[_0xea16('0x9')][_0xea16('0xd')];}return _0x28f55a;}function adAuthenticate(_0x3a6012,_0x166af4,_0x39f145){return new BPromise(function(_0x492248,_0x1e4d8f){try{var _0x5125bb=new ActiveDirectory(_0x3a6012);_0x5125bb[_0xea16('0xe')](_0x166af4,_0x39f145,function(_0x53619f,_0x2fe24e){if(_0x53619f){logger[_0xea16('0xf')](_0xea16('0x10'),_0x166af4,util[_0xea16('0x11')](_0x53619f,{'showHidden':![],'depth':null}));_0x1e4d8f(_0xea16('0x12'));}else if(!_0x2fe24e){logger[_0xea16('0xf')](_0xea16('0x13'),_0x166af4);_0x1e4d8f(_0xea16('0x12'));}else{_0x492248(_0x2fe24e);}});}catch(_0x56a3e0){_0x1e4d8f(_0x56a3e0);}});}function ActiveDirectoryAuthenticate(_0x34995d,_0x52e507,_0x30b450,_0x57ec91){var _0x295b48,_0x11d6f8;if(!isActiveDirectoryConfigured(config)){logger[_0xea16('0xf')](_0xea16('0x14'),_0x52e507);return _0x57ec91(null,![],{'message':_0xea16('0x12')});}return db[_0xea16('0x15')][_0xea16('0x16')]({'where':{'id':0x1},'attributes':[_0xea16('0x17'),_0xea16('0x18')],'raw':!![]})['then'](function(_0xa9e50d){_0x295b48=_0xa9e50d;if(!_0x295b48['adSsoEnabled']){logger[_0xea16('0xf')](_0xea16('0x19'),_0x52e507);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x34995d[_0xea16('0x16')]({'attributes':['id',_0xea16('0x1a'),_0xea16('0x1b'),'salt',_0xea16('0x1c'),'disabled',_0xea16('0x1d'),'blockedAt',_0xea16('0x1e')],'where':{'name':_0x52e507,'role':{'$or':[_0xea16('0x1f'),_0xea16('0x20'),_0xea16('0x21')]},'adSsoEnabled':!![]}});})['then'](function(_0xc53ea7){if(!_0xc53ea7||_0xc53ea7&&_0xc53ea7[_0xea16('0x1a')]!==_0x52e507){throw new Error(_0xea16('0x12'));}_0x11d6f8=_0xc53ea7;var _0x1493c5=_0x11d6f8[_0xea16('0x1a')]+'@'+config[_0xea16('0x9')][_0xea16('0xd')];return adAuthenticate(config[_0xea16('0x9')],_0x1493c5,_0x30b450);})['then'](function(_0x3501e5){if(_0x11d6f8[_0xea16('0x22')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x295b48['blockDuration']>0x0){if(_0x11d6f8[_0xea16('0x1d')]){if(moment(_0x11d6f8[_0xea16('0x23')])[_0xea16('0x24')](_0x295b48[_0xea16('0x18')],_0xea16('0x25'))>moment()){throw new Error(_0xea16('0x12'));}return utils[_0xea16('0x26')](_0x11d6f8,0x0,![],null)[_0xea16('0x27')](function(){return utils[_0xea16('0x28')](_0x11d6f8);})[_0xea16('0x27')](function(){return _0x57ec91(null,_0x11d6f8);});}else{return utils['getLicense'](_0x11d6f8)[_0xea16('0x27')](function(){return _0x57ec91(null,_0x11d6f8);});}}else{return utils[_0xea16('0x28')](_0x11d6f8)['then'](function(){return _0x57ec91(null,_0x11d6f8);});}})['catch'](function(_0x28f4df){return _0x57ec91(null,![],_0x28f4df);});}function handleError(_0x559740,_0x5ce225,_0x179bc8){return _0x559740['status'](_0x5ce225||0x1f4)[_0xea16('0x29')]({'message':_0x179bc8?_0x179bc8['message']||_0x179bc8:''});}exports[_0xea16('0x2a')]=function(_0x4b09cf,_0x4c159f,_0x475f58){passport[_0xea16('0xe')](_0xea16('0x2b'),function(_0x2765cf,_0x31e1ef,_0x257398){var _0x50a107=_0x2765cf||_0x257398;if(_0x50a107){return handleError(_0x4c159f,0x191,_0x50a107);}if(!_0x31e1ef){return handleError(_0x4c159f,0x194,{'message':_0xea16('0x2c')});}else{var _0x387ed4={'payload':{'id':_0x31e1ef['id'],'role':_0x31e1ef['role']},'options':{'expiresIn':0x15180}};return authService[_0xea16('0x2d')](_0x387ed4)[_0xea16('0x27')](function(_0x1c4531){_0x4c159f[_0xea16('0x2e')]({'id':_0x31e1ef['id'],'token':_0x1c4531,'statusCall':'','isAlreadyLogged':_0x31e1ef[_0xea16('0x1e')]});});}})(_0x4b09cf,_0x4c159f,_0x475f58);};passport['use']('ad-login',new LocalStrategy({'usernameField':_0xea16('0x1a'),'passwordField':'password'},function(_0x5ac0c1,_0xc36f71,_0xc56334){return ActiveDirectoryAuthenticate(db[_0xea16('0x2f')],_0x5ac0c1,_0xc36f71,_0xc56334);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 893f77f..8a95f0f 100644 --- a/server/api/authActiveDirectory/index.js +++ b/server/api/authActiveDirectory/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x08c8=['post','exports','./authActiveDirectory.controller'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x08c8,0x74));var _0x808c=function(_0x125f70,_0x24b0cb){_0x125f70=_0x125f70-0x0;var _0x45666b=_0x08c8[_0x125f70];return _0x45666b;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0x808c('0x0'));router[_0x808c('0x1')]('/',controller['login']);module[_0x808c('0x2')]=router; \ No newline at end of file +var _0xd77a=['Router','./authActiveDirectory.controller','post','exports','express'];(function(_0x2cf7a5,_0x44dd28){var _0x241fba=function(_0x5fc7b4){while(--_0x5fc7b4){_0x2cf7a5['push'](_0x2cf7a5['shift']());}};_0x241fba(++_0x44dd28);}(_0xd77a,0xa9));var _0xad77=function(_0x108933,_0x5ca893){_0x108933=_0x108933-0x0;var _0x5e2958=_0xd77a[_0x108933];return _0x5e2958;};'use strict';var express=require(_0xad77('0x0'));var router=express[_0xad77('0x1')]();var controller=require(_0xad77('0x2'));router[_0xad77('0x3')]('/',controller['login']);module[_0xad77('0x4')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 816eab1..520b22d 100644 --- a/server/api/authGoogle/authGoogle.controller.js +++ b/server/api/authGoogle/authGoogle.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x494aab,_0x3b66e4){var _0x29cc18=function(_0xa69dd5){while(--_0xa69dd5){_0x494aab['push'](_0x494aab['shift']());}};_0x29cc18(++_0x3b66e4);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file +var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x42fbbc,_0x379028){var _0x2abf24=function(_0x3bdf26){while(--_0x3bdf26){_0x42fbbc['push'](_0x42fbbc['shift']());}};_0x2abf24(++_0x379028);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 222647d..20f6083 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 _0xec31=['Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','/callback','callback','login','exports','express','passport'];(function(_0x8a0dfe,_0x25015a){var _0x134296=function(_0x462534){while(--_0x462534){_0x8a0dfe['push'](_0x8a0dfe['shift']());}};_0x134296(++_0x25015a);}(_0xec31,0xa3));var _0x1ec3=function(_0x19719d,_0x2306e0){_0x19719d=_0x19719d-0x0;var _0x799191=_0xec31[_0x19719d];return _0x799191;};'use strict';var express=require(_0x1ec3('0x0'));var passport=require(_0x1ec3('0x1'));var router=express[_0x1ec3('0x2')]();var controller=require(_0x1ec3('0x3'));var userController=require(_0x1ec3('0x4'));var authService=require(_0x1ec3('0x5'));router[_0x1ec3('0x6')]('/',controller['login']);router[_0x1ec3('0x6')](_0x1ec3('0x7'),controller[_0x1ec3('0x8')],authService['isMiddleware'],userController[_0x1ec3('0x9')],authService['setTokenCookie']);module[_0x1ec3('0xa')]=router; \ No newline at end of file +var _0xe968=['passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','/callback','callback','isMiddleware','login','setTokenCookie','exports','express'];(function(_0x267166,_0x56456d){var _0x5cc698=function(_0xb07fef){while(--_0xb07fef){_0x267166['push'](_0x267166['shift']());}};_0x5cc698(++_0x56456d);}(_0xe968,0x110));var _0x8e96=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xe968[_0x3b380d];return _0x54502b;};'use strict';var express=require(_0x8e96('0x0'));var passport=require(_0x8e96('0x1'));var router=express[_0x8e96('0x2')]();var controller=require(_0x8e96('0x3'));var userController=require(_0x8e96('0x4'));var authService=require(_0x8e96('0x5'));router['get']('/',controller['login']);router[_0x8e96('0x6')](_0x8e96('0x7'),controller[_0x8e96('0x8')],authService[_0x8e96('0x9')],userController[_0x8e96('0xa')],authService[_0x8e96('0xb')]);module[_0x8e96('0xc')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 1f10d34..e882bf6 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 _0x476f=['send','message','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','params','token','enforcePasswordHistory','passwordHistoryLimit','securePassword','previousPasswords','validatePasswordHistory','password','save','Password\x20reset!','util','passport-local','Strategy','jayson/promise','randomstring','moment','../../components/auth/service','../../config/utils','client','Setting','findOne','allowedLoginAttempts','blockDuration','name','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','clearBlockUser','minutes','getLicense','catch','email','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','\x22%s\x22\x20<%s>','user','request','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status'];(function(_0x4d1487,_0x456e4e){var _0x9dd683=function(_0x29fd2d){while(--_0x29fd2d){_0x4d1487['push'](_0x4d1487['shift']());}};_0x9dd683(++_0x456e4e);}(_0x476f,0x1ba));var _0xf476=function(_0x2f239b,_0xb29360){_0x2f239b=_0x2f239b-0x0;var _0x5b279d=_0x476f[_0x2f239b];return _0x5b279d;};'use strict';var util=require(_0xf476('0x0'));var passport=require('passport');var LocalStrategy=require(_0xf476('0x1'))[_0xf476('0x2')];var jayson=require(_0xf476('0x3'));var _=require('lodash');var rs=require(_0xf476('0x4'));var moment=require(_0xf476('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0xf476('0x6'));var utils=require(_0xf476('0x7'));var client=jayson[_0xf476('0x8')]['http']({'port':0x232b});function localAuthenticate(_0x19ceb8,_0x3f84e6,_0x51caec,_0x2565c0){var _0x59db73,_0x463451;return db[_0xf476('0x9')][_0xf476('0xa')]({'where':{'id':0x1},'attributes':[_0xf476('0xb'),_0xf476('0xc')],'raw':!![]})['then'](function(_0x59ede4){_0x59db73=_0x59ede4;return _0x19ceb8[_0xf476('0xa')]({'attributes':['id',_0xf476('0xd'),'password',_0xf476('0xe'),_0xf476('0xf'),_0xf476('0x10'),_0xf476('0x11'),_0xf476('0x12'),_0xf476('0x13')],'where':{'name':_0x3f84e6,'role':{'$or':[_0xf476('0x14'),'user','agent']}}});})[_0xf476('0x15')](function(_0x420546){if(!_0x420546||_0x420546&&_0x420546[_0xf476('0xd')]!==_0x3f84e6){throw new Error(_0xf476('0x16'));}else{_0x463451=_0x420546;return _0x463451;}})['then'](function(){_0x463451[_0xf476('0x17')](_0x51caec,function(_0x121248,_0xd691fb){var _0x1c81b0=_0x463451['loginAttempts']+0x1;if(_0x121248){return _0x2565c0(_0x121248);}else if(!_0xd691fb){if(_0x463451[_0xf476('0x10')]){return _0x2565c0(null,![],{'message':_0xf476('0x16')});}else if(_0x59db73[_0xf476('0xb')]>0x0){if(_0x463451[_0xf476('0x11')]){if(_0x59db73[_0xf476('0xc')]>0x0){if(moment(_0x463451['blockedAt'])[_0xf476('0x18')](_0x59db73['blockDuration'],'minutes')>moment()){return _0x2565c0(null,![],{'message':_0xf476('0x16')});}else{return utils[_0xf476('0x19')](_0x463451,_0x1c81b0,![],null)[_0xf476('0x15')](function(){return _0x2565c0(null,![],{'message':_0xf476('0x16')});});}}else{return _0x2565c0(null,![],{'message':_0xf476('0x16')});}}else{if(_0x1c81b0>=_0x59db73['allowedLoginAttempts']){return utils[_0xf476('0x19')](_0x463451,0x0,!![],moment())[_0xf476('0x15')](function(){return _0x2565c0(null,![],{'message':_0xf476('0x16')});});}else{return utils[_0xf476('0x19')](_0x463451,_0x1c81b0,![],null)[_0xf476('0x15')](function(){return _0x2565c0(null,![],{'message':_0xf476('0x16')});});}}}else{return _0x2565c0(null,![],{'message':_0xf476('0x16')});}}else{if(_0x463451[_0xf476('0x10')]){return _0x2565c0(null,![],{'message':_0xf476('0x16')});}else if(_0x59db73[_0xf476('0xb')]>0x0){if(_0x463451[_0xf476('0x11')]){if(_0x59db73[_0xf476('0xc')]>0x0){if(moment(_0x463451[_0xf476('0x12')])[_0xf476('0x18')](_0x59db73[_0xf476('0xc')],_0xf476('0x1a'))>moment()){return _0x2565c0(null,![],{'message':_0xf476('0x16')});}else{return utils['clearBlockUser'](_0x463451,0x0,![],null)[_0xf476('0x15')](function(){return utils[_0xf476('0x1b')](_0x463451);})[_0xf476('0x15')](function(){return _0x2565c0(null,_0x463451);});}}else{return _0x2565c0(null,![],{'message':_0xf476('0x16')});}}else{return utils[_0xf476('0x19')](_0x463451,0x0,![],null)['then'](function(){return utils[_0xf476('0x1b')](_0x463451);})[_0xf476('0x15')](function(){return _0x2565c0(null,_0x463451);})[_0xf476('0x1c')](function(_0x417c43){return _0x2565c0(null,![],_0x417c43);});}}else{if(_0x463451['blocked']){return _0x2565c0(null,![],{'message':_0xf476('0x16')});}else{return utils['getLicense'](_0x463451)['then'](function(){return _0x2565c0(null,_0x463451);});}}}});})[_0xf476('0x1c')](function(_0x48f16f){return _0x2565c0(null,![],_0x48f16f);});}function sendServiceMail(_0x536acd){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id',_0xf476('0xd'),_0xf476('0x1d')],'include':[{'model':db['MailServerOut'],'as':_0xf476('0x1e'),'include':[{'model':db[_0xf476('0x1f')],'as':_0xf476('0x1f')}]}]})[_0xf476('0x15')](function(_0x542170){if(!_0x542170){throw new Error(_0xf476('0x20'));}var _0x666b71=_0x542170[_0xf476('0x21')]();var _0x44e442={'account':_0x666b71,'message':_[_0xf476('0x22')]({'from':util['format'](_0xf476('0x23'),_0x542170[_0xf476('0xd')],_0x542170[_0xf476('0x1d')]||_0x542170[_0xf476('0x1e')][_0xf476('0x24')])},_0x536acd)};return client[_0xf476('0x25')](_0xf476('0x26'),_0x44e442);})['then'](function(_0x397919){if(_0x397919[_0xf476('0x27')]){throw new Error(util[_0xf476('0x28')](_0xf476('0x29'),_0x397919[_0xf476('0x27')]['message']||JSON[_0xf476('0x2a')](_0x397919[_0xf476('0x27')])));}return!![];});}function handleError(_0xef30e8,_0x357c36,_0x3bf0e3){return _0xef30e8[_0xf476('0x2b')](_0x357c36||0x1f4)[_0xf476('0x2c')]({'message':_0x3bf0e3?_0x3bf0e3[_0xf476('0x2d')]||_0x3bf0e3:''});}exports[_0xf476('0x2e')]=function(_0x5aae2f,_0x23f7a9,_0x5a0247){passport['authenticate'](_0xf476('0x2f'),function(_0x4e0d13,_0x1f1137,_0x5ca010){var _0x203cc7=_0x4e0d13||_0x5ca010;if(_0x203cc7){return handleError(_0x23f7a9,0x191,_0x203cc7);}if(!_0x1f1137){return handleError(_0x23f7a9,0x194,{'message':_0xf476('0x30')});}else{var _0x8a040b={'payload':{'id':_0x1f1137['id'],'role':_0x1f1137[_0xf476('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0xf476('0x31')](_0x8a040b)['then'](function(_0x5a8b0d){_0x23f7a9[_0xf476('0x32')]({'id':_0x1f1137['id'],'token':_0x5a8b0d,'statusCall':'','isAlreadyLogged':_0x1f1137[_0xf476('0x33')]});});}})(_0x5aae2f,_0x23f7a9,_0x5a0247);};exports[_0xf476('0x34')]=function(_0x28f50a,_0x4ef1c2){if(!_0x28f50a[_0xf476('0x35')][_0xf476('0x1d')]){return handleError(_0x4ef1c2,0x1f4,{'message':_0xf476('0x36')});}var _0x4a2ceb=rs[_0xf476('0x37')]();_0x28f50a[_0xf476('0x35')]['email']=_0x28f50a['body'][_0xf476('0x1d')][_0xf476('0x38')]()['toLowerCase']();var _0x2bc8c4;return db[_0xf476('0x9')][_0xf476('0xa')]({'where':{'id':0x1},'attributes':[_0xf476('0xb'),_0xf476('0xc')],'raw':!![]})[_0xf476('0x15')](function(_0x32c3fa){_0x2bc8c4=_0x32c3fa;return db[_0xf476('0x39')][_0xf476('0x3a')]({'where':{'email':_0x28f50a['body'][_0xf476('0x1d')]}});})[_0xf476('0x15')](function(_0x3792c1){if(!_0x3792c1){throw new Error(_0xf476('0x3b'));}if(_0x3792c1[_0xf476('0x10')]){throw new Error(_0xf476('0x3c'));}if(_0x3792c1[_0xf476('0x11')]){if(moment(_0x3792c1[_0xf476('0x12')])[_0xf476('0x18')](_0x2bc8c4['blockDuration'],'minutes')>moment()){throw new Error(_0xf476('0x3d'));}else{_0x3792c1[_0xf476('0x11')]=![];_0x3792c1[_0xf476('0x12')]=null;}}_0x3792c1[_0xf476('0x3e')]=_0x4a2ceb;_0x3792c1[_0xf476('0x3f')]=Date[_0xf476('0x40')]()+0x36ee80;return _0x3792c1['save']();})['then'](function(){return sendServiceMail({'to':_0x28f50a['body']['email'],'subject':_0xf476('0x41'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xf476('0x42')+_0xf476('0x43')+_0x28f50a['headers']['host']+_0xf476('0x44')+_0x4a2ceb+'\x0a\x0a'+_0xf476('0x45')});})[_0xf476('0x15')](function(){_0x4ef1c2[_0xf476('0x2b')](0xc8)[_0xf476('0x2c')]({'message':_0xf476('0x46')});})['catch'](function(_0x201a14){return handleError(_0x4ef1c2,0x1f4,_0x201a14);});};exports['reset']=function(_0x4725d5,_0x45cbb2){return db[_0xf476('0x39')][_0xf476('0x3a')]({'where':{'resetPasswordToken':_0x4725d5[_0xf476('0x47')][_0xf476('0x48')],'resetPasswordExpires':{'$gt':Date[_0xf476('0x40')]()}}})[_0xf476('0x15')](function(_0xbb06e5){if(!_0xbb06e5){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting']['findOne']({'attributes':['id','securePassword',_0xf476('0x49'),_0xf476('0x4a')]})['then'](function(_0x315007){if(_0x315007[_0xf476('0x4b')])authService['validatePasswordPattern'](_0x4725d5[_0xf476('0x35')]['password']);if(!_0x315007[_0xf476('0x49')]||!_0xbb06e5[_0xf476('0x4c')])return _0xbb06e5;authService[_0xf476('0x4d')](_0x4725d5[_0xf476('0x35')][_0xf476('0x4e')],_0xbb06e5['previousPasswords'],_0x315007[_0xf476('0x4a')]);return _0xbb06e5;})[_0xf476('0x15')](function(){_0xbb06e5['password']=_0x4725d5[_0xf476('0x35')][_0xf476('0x4e')];_0xbb06e5['resetPasswordToken']=null;_0xbb06e5[_0xf476('0x3f')]=null;return _0xbb06e5[_0xf476('0x4f')]();});})[_0xf476('0x15')](function(){_0x45cbb2['status'](0xc8)[_0xf476('0x2c')]({'message':_0xf476('0x50')});})[_0xf476('0x1c')](function(_0x4c0f7c){return handleError(_0x45cbb2,0x1f4,_0x4c0f7c);});};passport['use']('local-login',new LocalStrategy({'usernameField':_0xf476('0xd'),'passwordField':'password'},function(_0x86dd70,_0x41b797,_0x88082){return localAuthenticate(db[_0xf476('0x39')],_0x86dd70,_0x41b797,_0x88082);})); \ No newline at end of file +var _0x4cd4=['The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','util','passport','passport-local','Strategy','jayson/promise','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','role','disabled','blocked','loginAttempts','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockedAt','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','local-login','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.'];(function(_0x3503ab,_0x1a6666){var _0x1e6bc4=function(_0x20dffa){while(--_0x20dffa){_0x3503ab['push'](_0x3503ab['shift']());}};_0x1e6bc4(++_0x1a6666);}(_0x4cd4,0x1b3));var _0x44cd=function(_0x324669,_0x55bbe8){_0x324669=_0x324669-0x0;var _0x320806=_0x4cd4[_0x324669];return _0x320806;};'use strict';var util=require(_0x44cd('0x0'));var passport=require(_0x44cd('0x1'));var LocalStrategy=require(_0x44cd('0x2'))[_0x44cd('0x3')];var jayson=require(_0x44cd('0x4'));var _=require(_0x44cd('0x5'));var rs=require('randomstring');var moment=require(_0x44cd('0x6'));var db=require(_0x44cd('0x7'))['db'];var authService=require(_0x44cd('0x8'));var utils=require(_0x44cd('0x9'));var client=jayson[_0x44cd('0xa')][_0x44cd('0xb')]({'port':0x232b});function localAuthenticate(_0x1e1d2b,_0x523536,_0x89e119,_0x49df17){var _0x2343c5,_0x3befd6;return db[_0x44cd('0xc')][_0x44cd('0xd')]({'where':{'id':0x1},'attributes':[_0x44cd('0xe'),_0x44cd('0xf')],'raw':!![]})[_0x44cd('0x10')](function(_0x24a4cd){_0x2343c5=_0x24a4cd;return _0x1e1d2b[_0x44cd('0xd')]({'attributes':['id',_0x44cd('0x11'),_0x44cd('0x12'),'salt',_0x44cd('0x13'),_0x44cd('0x14'),_0x44cd('0x15'),'blockedAt',_0x44cd('0x16')],'where':{'name':_0x523536,'role':{'$or':[_0x44cd('0x17'),_0x44cd('0x18'),'agent']}}});})[_0x44cd('0x10')](function(_0x305aca){if(!_0x305aca||_0x305aca&&_0x305aca[_0x44cd('0x11')]!==_0x523536){throw new Error(_0x44cd('0x19'));}else{_0x3befd6=_0x305aca;return _0x3befd6;}})['then'](function(){_0x3befd6[_0x44cd('0x1a')](_0x89e119,function(_0x55a16b,_0x46088c){var _0x12ad91=_0x3befd6[_0x44cd('0x16')]+0x1;if(_0x55a16b){return _0x49df17(_0x55a16b);}else if(!_0x46088c){if(_0x3befd6[_0x44cd('0x14')]){return _0x49df17(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x2343c5[_0x44cd('0xe')]>0x0){if(_0x3befd6['blocked']){if(_0x2343c5[_0x44cd('0xf')]>0x0){if(moment(_0x3befd6[_0x44cd('0x1b')])[_0x44cd('0x1c')](_0x2343c5[_0x44cd('0xf')],_0x44cd('0x1d'))>moment()){return _0x49df17(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x3befd6,_0x12ad91,![],null)[_0x44cd('0x10')](function(){return _0x49df17(null,![],{'message':_0x44cd('0x19')});});}}else{return _0x49df17(null,![],{'message':_0x44cd('0x19')});}}else{if(_0x12ad91>=_0x2343c5[_0x44cd('0xe')]){return utils[_0x44cd('0x1e')](_0x3befd6,0x0,!![],moment())[_0x44cd('0x10')](function(){return _0x49df17(null,![],{'message':_0x44cd('0x19')});});}else{return utils[_0x44cd('0x1e')](_0x3befd6,_0x12ad91,![],null)[_0x44cd('0x10')](function(){return _0x49df17(null,![],{'message':_0x44cd('0x19')});});}}}else{return _0x49df17(null,![],{'message':_0x44cd('0x19')});}}else{if(_0x3befd6[_0x44cd('0x14')]){return _0x49df17(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x2343c5['allowedLoginAttempts']>0x0){if(_0x3befd6[_0x44cd('0x15')]){if(_0x2343c5[_0x44cd('0xf')]>0x0){if(moment(_0x3befd6['blockedAt'])[_0x44cd('0x1c')](_0x2343c5[_0x44cd('0xf')],_0x44cd('0x1d'))>moment()){return _0x49df17(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x3befd6,0x0,![],null)[_0x44cd('0x10')](function(){return utils[_0x44cd('0x1f')](_0x3befd6);})[_0x44cd('0x10')](function(){return _0x49df17(null,_0x3befd6);});}}else{return _0x49df17(null,![],{'message':_0x44cd('0x19')});}}else{return utils[_0x44cd('0x1e')](_0x3befd6,0x0,![],null)[_0x44cd('0x10')](function(){return utils[_0x44cd('0x1f')](_0x3befd6);})[_0x44cd('0x10')](function(){return _0x49df17(null,_0x3befd6);})[_0x44cd('0x20')](function(_0x29bd67){return _0x49df17(null,![],_0x29bd67);});}}else{if(_0x3befd6[_0x44cd('0x15')]){return _0x49df17(null,![],{'message':_0x44cd('0x19')});}else{return utils[_0x44cd('0x1f')](_0x3befd6)['then'](function(){return _0x49df17(null,_0x3befd6);});}}}});})[_0x44cd('0x20')](function(_0x1d02e5){return _0x49df17(null,![],_0x1d02e5);});}function sendServiceMail(_0x114180){return db[_0x44cd('0x21')][_0x44cd('0x22')]({'where':{'service':!![]},'attributes':['id',_0x44cd('0x11'),_0x44cd('0x23')],'include':[{'model':db[_0x44cd('0x24')],'as':_0x44cd('0x25'),'include':[{'model':db[_0x44cd('0x26')],'as':_0x44cd('0x26')}]}]})[_0x44cd('0x10')](function(_0x5b29bd){if(!_0x5b29bd){throw new Error(_0x44cd('0x27'));}var _0x52147e=_0x5b29bd[_0x44cd('0x28')]();var _0x139f0b={'account':_0x52147e,'message':_[_0x44cd('0x29')]({'from':util[_0x44cd('0x2a')]('\x22%s\x22\x20<%s>',_0x5b29bd[_0x44cd('0x11')],_0x5b29bd['email']||_0x5b29bd[_0x44cd('0x25')]['user'])},_0x114180)};return client[_0x44cd('0x2b')](_0x44cd('0x2c'),_0x139f0b);})[_0x44cd('0x10')](function(_0x594fca){if(_0x594fca[_0x44cd('0x2d')]){throw new Error(util[_0x44cd('0x2a')](_0x44cd('0x2e'),_0x594fca[_0x44cd('0x2d')][_0x44cd('0x2f')]||JSON[_0x44cd('0x30')](_0x594fca['error'])));}return!![];});}function handleError(_0x152145,_0x34c587,_0xf6362e){return _0x152145[_0x44cd('0x31')](_0x34c587||0x1f4)[_0x44cd('0x32')]({'message':_0xf6362e?_0xf6362e[_0x44cd('0x2f')]||_0xf6362e:''});}exports['login']=function(_0x2f1824,_0x42e912,_0x3d2712){passport['authenticate'](_0x44cd('0x33'),function(_0x4b35d4,_0x338272,_0x5a35a4){var _0xe9ce7c=_0x4b35d4||_0x5a35a4;if(_0xe9ce7c){return handleError(_0x42e912,0x191,_0xe9ce7c);}if(!_0x338272){return handleError(_0x42e912,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x5113c7={'payload':{'id':_0x338272['id'],'role':_0x338272[_0x44cd('0x13')]},'options':{'expiresIn':0x15180}};return authService[_0x44cd('0x34')](_0x5113c7)[_0x44cd('0x10')](function(_0x2963da){_0x42e912['json']({'id':_0x338272['id'],'token':_0x2963da,'statusCall':'','isAlreadyLogged':_0x338272[_0x44cd('0x35')]});});}})(_0x2f1824,_0x42e912,_0x3d2712);};exports[_0x44cd('0x36')]=function(_0x54c7d5,_0x2a088b){if(!_0x54c7d5[_0x44cd('0x37')][_0x44cd('0x23')]){return handleError(_0x2a088b,0x1f4,{'message':_0x44cd('0x38')});}var _0x25ab16=rs[_0x44cd('0x39')]();_0x54c7d5[_0x44cd('0x37')]['email']=_0x54c7d5[_0x44cd('0x37')][_0x44cd('0x23')][_0x44cd('0x3a')]()[_0x44cd('0x3b')]();var _0x33e365;return db[_0x44cd('0xc')][_0x44cd('0xd')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x44cd('0x10')](function(_0x46ab82){_0x33e365=_0x46ab82;return db[_0x44cd('0x3c')][_0x44cd('0x22')]({'where':{'email':_0x54c7d5[_0x44cd('0x37')][_0x44cd('0x23')]}});})[_0x44cd('0x10')](function(_0x487b6a){if(!_0x487b6a){throw new Error(_0x44cd('0x3d'));}if(_0x487b6a[_0x44cd('0x14')]){throw new Error(_0x44cd('0x3e'));}if(_0x487b6a[_0x44cd('0x15')]){if(moment(_0x487b6a[_0x44cd('0x1b')])['add'](_0x33e365[_0x44cd('0xf')],_0x44cd('0x1d'))>moment()){throw new Error(_0x44cd('0x3f'));}else{_0x487b6a['blocked']=![];_0x487b6a[_0x44cd('0x1b')]=null;}}_0x487b6a[_0x44cd('0x40')]=_0x25ab16;_0x487b6a[_0x44cd('0x41')]=Date[_0x44cd('0x42')]()+0x36ee80;return _0x487b6a[_0x44cd('0x43')]();})[_0x44cd('0x10')](function(){return sendServiceMail({'to':_0x54c7d5['body'][_0x44cd('0x23')],'subject':_0x44cd('0x44'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x44cd('0x45')+_0x44cd('0x46')+_0x54c7d5[_0x44cd('0x47')][_0x44cd('0x48')]+_0x44cd('0x49')+_0x25ab16+'\x0a\x0a'+_0x44cd('0x4a')});})['then'](function(){_0x2a088b[_0x44cd('0x31')](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})[_0x44cd('0x20')](function(_0x1c8fbc){return handleError(_0x2a088b,0x1f4,_0x1c8fbc);});};exports['reset']=function(_0x33744e,_0x1f9e6a){return db[_0x44cd('0x3c')][_0x44cd('0x22')]({'where':{'resetPasswordToken':_0x33744e[_0x44cd('0x4b')][_0x44cd('0x4c')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x44cd('0x10')](function(_0x8dc812){if(!_0x8dc812){throw new Error(_0x44cd('0x4d'));}return db[_0x44cd('0xc')][_0x44cd('0xd')]({'attributes':['id',_0x44cd('0x4e'),_0x44cd('0x4f'),_0x44cd('0x50')]})[_0x44cd('0x10')](function(_0x552bec){if(_0x552bec[_0x44cd('0x4e')])authService['validatePasswordPattern'](_0x33744e[_0x44cd('0x37')][_0x44cd('0x12')]);if(!_0x552bec[_0x44cd('0x4f')]||!_0x8dc812[_0x44cd('0x51')])return _0x8dc812;authService[_0x44cd('0x52')](_0x33744e[_0x44cd('0x37')][_0x44cd('0x12')],_0x8dc812[_0x44cd('0x51')],_0x552bec['passwordHistoryLimit']);return _0x8dc812;})[_0x44cd('0x10')](function(){_0x8dc812[_0x44cd('0x12')]=_0x33744e[_0x44cd('0x37')][_0x44cd('0x12')];_0x8dc812[_0x44cd('0x40')]=null;_0x8dc812[_0x44cd('0x41')]=null;return _0x8dc812['save']();});})[_0x44cd('0x10')](function(){_0x1f9e6a['status'](0xc8)[_0x44cd('0x32')]({'message':'Password\x20reset!'});})['catch'](function(_0xedd0d5){return handleError(_0x1f9e6a,0x1f4,_0xedd0d5);});};passport['use'](_0x44cd('0x33'),new LocalStrategy({'usernameField':'name','passwordField':_0x44cd('0x12')},function(_0x2da4e8,_0x397f92,_0x5b267c){return localAuthenticate(db[_0x44cd('0x3c')],_0x2da4e8,_0x397f92,_0x5b267c);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index c3f5c07..d2d7cd1 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 _0xaed4=['/forgot','forgot','reset','Router','./authLocal.controller','post','login'];(function(_0x54c22f,_0x1ae6b6){var _0x128e35=function(_0x2541fc){while(--_0x2541fc){_0x54c22f['push'](_0x54c22f['shift']());}};_0x128e35(++_0x1ae6b6);}(_0xaed4,0x1ae));var _0x4aed=function(_0x301755,_0xd69dc3){_0x301755=_0x301755-0x0;var _0x2dac9a=_0xaed4[_0x301755];return _0x2dac9a;};'use strict';var express=require('express');var router=express[_0x4aed('0x0')]();var controller=require(_0x4aed('0x1'));router[_0x4aed('0x2')]('/',controller[_0x4aed('0x3')]);router[_0x4aed('0x2')](_0x4aed('0x4'),controller[_0x4aed('0x5')]);router[_0x4aed('0x2')]('/reset/:token',controller[_0x4aed('0x6')]);module['exports']=router; \ No newline at end of file +var _0x1619=['/reset/:token','reset','exports','Router','./authLocal.controller','post','login','/forgot','forgot'];(function(_0x4a1234,_0x46885f){var _0x1b9b14=function(_0x59dcd3){while(--_0x59dcd3){_0x4a1234['push'](_0x4a1234['shift']());}};_0x1b9b14(++_0x46885f);}(_0x1619,0x162));var _0x9161=function(_0x4a67ae,_0x51ac3d){_0x4a67ae=_0x4a67ae-0x0;var _0x53b8ad=_0x1619[_0x4a67ae];return _0x53b8ad;};'use strict';var express=require('express');var router=express[_0x9161('0x0')]();var controller=require(_0x9161('0x1'));router[_0x9161('0x2')]('/',controller[_0x9161('0x3')]);router[_0x9161('0x2')](_0x9161('0x4'),controller[_0x9161('0x5')]);router['post'](_0x9161('0x6'),controller[_0x9161('0x7')]);module[_0x9161('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 b8d2fba..0d7a8c7 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 _0x9beb=['sequelize','exports','STRING','INTEGER'];(function(_0x586923,_0x44fab2){var _0x4319e9=function(_0x238112){while(--_0x238112){_0x586923['push'](_0x586923['shift']());}};_0x4319e9(++_0x44fab2);}(_0x9beb,0x1e8));var _0xb9be=function(_0x4fa281,_0x2dd0f7){_0x4fa281=_0x4fa281-0x0;var _0x50e1f5=_0x9beb[_0x4fa281];return _0x50e1f5;};'use strict';var Sequelize=require(_0xb9be('0x0'));module[_0xb9be('0x1')]={'name':{'type':Sequelize[_0xb9be('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xb9be('0x2')]},'description':{'type':Sequelize[_0xb9be('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xb9be('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0x2a98=['BOOLEAN','INTEGER','sequelize','STRING'];(function(_0xe3cfba,_0x14d39e){var _0x3feb92=function(_0x9a4ab6){while(--_0x9a4ab6){_0xe3cfba['push'](_0xe3cfba['shift']());}};_0x3feb92(++_0x14d39e);}(_0x2a98,0xea));var _0x82a9=function(_0xffeec0,_0x36a534){_0xffeec0=_0xffeec0-0x0;var _0x5f50f4=_0x2a98[_0xffeec0];return _0x5f50f4;};'use strict';var Sequelize=require(_0x82a9('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x82a9('0x1')]},'description':{'type':Sequelize[_0x82a9('0x1')]},'status':{'type':Sequelize[_0x82a9('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x82a9('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 eba8691..146c2c2 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 _0xbac5=['fieldName','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','include','rows','show','params','includeAll','find','catch','create','body','ids','omit','getConditions','Condition','nolimit','addActions','Action','getActions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','apply','reject','then','destroy','error','stack','name','send','index','map','Automation','rawAttributes'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xbac5,0x172));var _0x5bac=function(_0x2dc7c9,_0x3a15f8){_0x2dc7c9=_0x2dc7c9-0x0;var _0x3e6536=_0xbac5[_0x2dc7c9];return _0x3e6536;};'use strict';var emlformat=require(_0x5bac('0x0'));var rimraf=require(_0x5bac('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5bac('0x2'));var rp=require(_0x5bac('0x3'));var moment=require(_0x5bac('0x4'));var BPromise=require(_0x5bac('0x5'));var Mustache=require('mustache');var util=require(_0x5bac('0x6'));var path=require(_0x5bac('0x7'));var sox=require(_0x5bac('0x8'));var csv=require(_0x5bac('0x9'));var ejs=require(_0x5bac('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5bac('0xb'));var squel=require(_0x5bac('0xc'));var crypto=require(_0x5bac('0xd'));var jsforce=require(_0x5bac('0xe'));var deskjs=require(_0x5bac('0xf'));var toCsv=require(_0x5bac('0x9'));var querystring=require('querystring');var Papa=require(_0x5bac('0x10'));var Redis=require(_0x5bac('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5bac('0x12'));var as=require(_0x5bac('0x13'));var hardwareService=require(_0x5bac('0x14'));var logger=require(_0x5bac('0x15'))(_0x5bac('0x16'));var utils=require('../../config/utils');var config=require(_0x5bac('0x17'));var licenseUtil=require(_0x5bac('0x18'));var db=require(_0x5bac('0x19'))['db'];function respondWithStatusCode(_0x3bd92a,_0xcd391d){_0xcd391d=_0xcd391d||0xcc;return function(_0x59f891){if(_0x59f891){return _0x3bd92a[_0x5bac('0x1a')](_0xcd391d);}return _0x3bd92a[_0x5bac('0x1b')](_0xcd391d)[_0x5bac('0x1c')]();};}function respondWithResult(_0x5269a0,_0x23cf9a){_0x23cf9a=_0x23cf9a||0xc8;return function(_0x5d4ed){if(_0x5d4ed){return _0x5269a0[_0x5bac('0x1b')](_0x23cf9a)[_0x5bac('0x1d')](_0x5d4ed);}};}function respondWithFilteredResult(_0x464ef2,_0x3d5535){return function(_0x310755){if(_0x310755){var _0x4c95cf=typeof _0x3d5535['offset']==='undefined'&&typeof _0x3d5535['limit']===_0x5bac('0x1e');var _0x345aa6=_0x310755[_0x5bac('0x1f')];var _0x58efd5=_0x4c95cf?0x0:_0x3d5535[_0x5bac('0x20')];var _0x5e734b=_0x4c95cf?_0x310755[_0x5bac('0x1f')]:_0x3d5535['offset']+_0x3d5535['limit'];var _0x196997;if(_0x5e734b>=_0x345aa6){_0x5e734b=_0x345aa6;_0x196997=0xc8;}else{_0x196997=0xce;}_0x464ef2[_0x5bac('0x1b')](_0x196997);return _0x464ef2['set']('Content-Range',_0x58efd5+'-'+_0x5e734b+'/'+_0x345aa6)['json'](_0x310755);}return null;};}function patchUpdates(_0x529a7e){return function(_0x8499af){try{jsonpatch[_0x5bac('0x21')](_0x8499af,_0x529a7e,!![]);}catch(_0x4d54bc){return BPromise[_0x5bac('0x22')](_0x4d54bc);}return _0x8499af['save']();};}function saveUpdates(_0x2cbf9e,_0x3de88e){return function(_0xa15698){if(_0xa15698){return _0xa15698['update'](_0x2cbf9e)[_0x5bac('0x23')](function(_0xd91ca6){return _0xd91ca6;});}return null;};}function removeEntity(_0x54b57d,_0x5af394){return function(_0x97370b){if(_0x97370b){return _0x97370b[_0x5bac('0x24')]()[_0x5bac('0x23')](function(){_0x54b57d['status'](0xcc)[_0x5bac('0x1c')]();});}};}function handleEntityNotFound(_0x3195c2,_0x1d23e1){return function(_0x451627){if(!_0x451627){_0x3195c2['sendStatus'](0x194);}return _0x451627;};}function handleError(_0x3a9e41,_0x26eea9){_0x26eea9=_0x26eea9||0x1f4;return function(_0x40c9ac){logger[_0x5bac('0x25')](_0x40c9ac[_0x5bac('0x26')]);if(_0x40c9ac[_0x5bac('0x27')]){delete _0x40c9ac[_0x5bac('0x27')];}_0x3a9e41['status'](_0x26eea9)[_0x5bac('0x28')](_0x40c9ac);};}exports[_0x5bac('0x29')]=function(_0x36945f,_0x1d42ed){var _0x293ba8={},_0x4735c0={},_0x28a6ec={'count':0x0,'rows':[]};var _0x4782d6=_[_0x5bac('0x2a')](db[_0x5bac('0x2b')][_0x5bac('0x2c')],function(_0x171291){return{'name':_0x171291[_0x5bac('0x2d')],'type':_0x171291['type'][_0x5bac('0x2e')]};});_0x4735c0[_0x5bac('0x2f')]=_[_0x5bac('0x2a')](_0x4782d6,_0x5bac('0x27'));_0x4735c0[_0x5bac('0x30')]=_[_0x5bac('0x31')](_0x36945f[_0x5bac('0x30')]);_0x4735c0['filters']=_['intersection'](_0x4735c0[_0x5bac('0x2f')],_0x4735c0['query']);_0x293ba8[_0x5bac('0x32')]=_[_0x5bac('0x33')](_0x4735c0[_0x5bac('0x2f')],qs['fields'](_0x36945f[_0x5bac('0x30')][_0x5bac('0x34')]));_0x293ba8[_0x5bac('0x32')]=_0x293ba8[_0x5bac('0x32')][_0x5bac('0x35')]?_0x293ba8['attributes']:_0x4735c0[_0x5bac('0x2f')];if(!_0x36945f[_0x5bac('0x30')][_0x5bac('0x36')]('nolimit')){_0x293ba8[_0x5bac('0x37')]=qs['limit'](_0x36945f[_0x5bac('0x30')][_0x5bac('0x37')]);_0x293ba8['offset']=qs[_0x5bac('0x20')](_0x36945f[_0x5bac('0x30')][_0x5bac('0x20')]);}_0x293ba8[_0x5bac('0x38')]=qs[_0x5bac('0x39')](_0x36945f[_0x5bac('0x30')][_0x5bac('0x39')]);_0x293ba8['where']=qs[_0x5bac('0x3a')](_[_0x5bac('0x3b')](_0x36945f[_0x5bac('0x30')],_0x4735c0[_0x5bac('0x3a')]),_0x4782d6);if(_0x36945f['query'][_0x5bac('0x3c')]){_0x293ba8[_0x5bac('0x3d')]=_[_0x5bac('0x3e')](_0x293ba8[_0x5bac('0x3d')],{'$or':_[_0x5bac('0x2a')](_0x4782d6,function(_0x458188){if(_0x458188[_0x5bac('0x3f')]!==_0x5bac('0x40')){var _0x1f0ba0={};_0x1f0ba0[_0x458188[_0x5bac('0x27')]]={'$like':'%'+_0x36945f[_0x5bac('0x30')][_0x5bac('0x3c')]+'%'};return _0x1f0ba0;}})});}_0x293ba8=_[_0x5bac('0x3e')]({},_0x293ba8,_0x36945f[_0x5bac('0x41')]);var _0x1bf2d8={'where':_0x293ba8['where']};return db[_0x5bac('0x2b')][_0x5bac('0x1f')](_0x1bf2d8)[_0x5bac('0x23')](function(_0x205f41){_0x28a6ec[_0x5bac('0x1f')]=_0x205f41;if(_0x36945f[_0x5bac('0x30')]['includeAll']){_0x293ba8[_0x5bac('0x42')]=[{'all':!![]}];}return db[_0x5bac('0x2b')]['findAll'](_0x293ba8);})[_0x5bac('0x23')](function(_0x3561b3){_0x28a6ec[_0x5bac('0x43')]=_0x3561b3;return _0x28a6ec;})[_0x5bac('0x23')](respondWithFilteredResult(_0x1d42ed,_0x293ba8))['catch'](handleError(_0x1d42ed,null));};exports[_0x5bac('0x44')]=function(_0x5133fe,_0xce22ec){var _0x5874e9={'raw':![],'where':{'id':_0x5133fe[_0x5bac('0x45')]['id']}},_0x418326={};_0x418326['model']=_[_0x5bac('0x31')](db['Automation'][_0x5bac('0x2c')]);_0x418326[_0x5bac('0x30')]=_['keys'](_0x5133fe[_0x5bac('0x30')]);_0x418326[_0x5bac('0x3a')]=_[_0x5bac('0x33')](_0x418326[_0x5bac('0x2f')],_0x418326[_0x5bac('0x30')]);_0x5874e9['attributes']=_['intersection'](_0x418326[_0x5bac('0x2f')],qs[_0x5bac('0x34')](_0x5133fe['query'][_0x5bac('0x34')]));_0x5874e9[_0x5bac('0x32')]=_0x5874e9[_0x5bac('0x32')]['length']?_0x5874e9[_0x5bac('0x32')]:_0x418326['model'];if(_0x5133fe[_0x5bac('0x30')][_0x5bac('0x46')]){_0x5874e9[_0x5bac('0x42')]=[{'all':!![]}];}_0x5874e9=_[_0x5bac('0x3e')]({},_0x5874e9,_0x5133fe['options']);return db[_0x5bac('0x2b')][_0x5bac('0x47')](_0x5874e9)['then'](handleEntityNotFound(_0xce22ec,null))['then'](respondWithResult(_0xce22ec,null))[_0x5bac('0x48')](handleError(_0xce22ec,null));};exports['create']=function(_0x2aa4db,_0x1593c7){return db[_0x5bac('0x2b')][_0x5bac('0x49')](_0x2aa4db[_0x5bac('0x4a')],{})[_0x5bac('0x23')](respondWithResult(_0x1593c7,0xc9))[_0x5bac('0x48')](handleError(_0x1593c7,null));};exports['update']=function(_0x49970b,_0x3fd252){if(_0x49970b[_0x5bac('0x4a')]['id']){delete _0x49970b[_0x5bac('0x4a')]['id'];}return db[_0x5bac('0x2b')][_0x5bac('0x47')]({'where':{'id':_0x49970b[_0x5bac('0x45')]['id']}})['then'](handleEntityNotFound(_0x3fd252,null))[_0x5bac('0x23')](saveUpdates(_0x49970b['body'],null))[_0x5bac('0x23')](respondWithResult(_0x3fd252,null))[_0x5bac('0x48')](handleError(_0x3fd252,null));};exports[_0x5bac('0x24')]=function(_0x4a7008,_0x243d07){return db[_0x5bac('0x2b')]['find']({'where':{'id':_0x4a7008[_0x5bac('0x45')]['id']}})[_0x5bac('0x23')](handleEntityNotFound(_0x243d07,null))[_0x5bac('0x23')](removeEntity(_0x243d07,null))[_0x5bac('0x48')](handleError(_0x243d07,null));};exports['addConditions']=function(_0x17595f,_0x3ec935,_0x2b5beb){return db['Condition'][_0x5bac('0x47')]({'where':{'id':_0x17595f['params']['id']}})['then'](handleEntityNotFound(_0x3ec935,null))[_0x5bac('0x23')](function(_0x5a5dad){if(_0x5a5dad){return _0x5a5dad['addConditions'](_0x17595f[_0x5bac('0x4a')][_0x5bac('0x4b')],_[_0x5bac('0x4c')](_0x17595f[_0x5bac('0x4a')],['ids','id'])||{});}})[_0x5bac('0x23')](respondWithResult(_0x3ec935,null))[_0x5bac('0x48')](handleError(_0x3ec935,null));};exports[_0x5bac('0x4d')]=function(_0x43c3d5,_0x126aa3,_0x12220a){var _0x458476={};var _0xe0c630={};var _0x5dd4f7;var _0x23c07a;return db[_0x5bac('0x2b')]['findOne']({'where':{'id':_0x43c3d5[_0x5bac('0x45')]['id']}})['then'](handleEntityNotFound(_0x126aa3,null))[_0x5bac('0x23')](function(_0x48a68c){if(_0x48a68c){_0x5dd4f7=_0x48a68c;_0xe0c630[_0x5bac('0x2f')]=_[_0x5bac('0x31')](db[_0x5bac('0x4e')][_0x5bac('0x2c')]);_0xe0c630[_0x5bac('0x30')]=_[_0x5bac('0x31')](_0x43c3d5[_0x5bac('0x30')]);_0xe0c630['filters']=_[_0x5bac('0x33')](_0xe0c630[_0x5bac('0x2f')],_0xe0c630[_0x5bac('0x30')]);_0x458476[_0x5bac('0x32')]=_[_0x5bac('0x33')](_0xe0c630[_0x5bac('0x2f')],qs[_0x5bac('0x34')](_0x43c3d5[_0x5bac('0x30')][_0x5bac('0x34')]));_0x458476[_0x5bac('0x32')]=_0x458476[_0x5bac('0x32')][_0x5bac('0x35')]?_0x458476[_0x5bac('0x32')]:_0xe0c630[_0x5bac('0x2f')];_0x458476[_0x5bac('0x38')]=qs[_0x5bac('0x39')](_0x43c3d5[_0x5bac('0x30')]['sort']);_0x458476[_0x5bac('0x3d')]=qs[_0x5bac('0x3a')](_[_0x5bac('0x3b')](_0x43c3d5[_0x5bac('0x30')],_0xe0c630['filters']));if(_0x43c3d5[_0x5bac('0x30')]['filter']){_0x458476[_0x5bac('0x3d')]=_[_0x5bac('0x3e')](_0x458476[_0x5bac('0x3d')],{'$or':_[_0x5bac('0x2a')](_0x458476[_0x5bac('0x32')],function(_0x226c0d){var _0x5bb9f4={};_0x5bb9f4[_0x226c0d]={'$like':'%'+_0x43c3d5['query'][_0x5bac('0x3c')]+'%'};return _0x5bb9f4;})});}_0x458476=_[_0x5bac('0x3e')]({},_0x458476,_0x43c3d5[_0x5bac('0x41')]);return _0x5dd4f7[_0x5bac('0x4d')](_0x458476);}})['then'](function(_0xd8ecab){if(_0xd8ecab){_0x23c07a=_0xd8ecab[_0x5bac('0x35')];if(!_0x43c3d5['query'][_0x5bac('0x36')](_0x5bac('0x4f'))){_0x458476[_0x5bac('0x37')]=qs[_0x5bac('0x37')](_0x43c3d5[_0x5bac('0x30')][_0x5bac('0x37')]);_0x458476[_0x5bac('0x20')]=qs[_0x5bac('0x20')](_0x43c3d5['query']['offset']);}return _0x5dd4f7[_0x5bac('0x4d')](_0x458476);}})['then'](function(_0x1b61c1){if(_0x1b61c1){return _0x1b61c1?{'count':_0x23c07a,'rows':_0x1b61c1}:null;}})[_0x5bac('0x23')](respondWithResult(_0x126aa3,null))['catch'](handleError(_0x126aa3,null));};exports[_0x5bac('0x50')]=function(_0x4bdd54,_0x5f3db0,_0x2f2354){return db[_0x5bac('0x51')][_0x5bac('0x47')]({'where':{'id':_0x4bdd54[_0x5bac('0x45')]['id']}})[_0x5bac('0x23')](handleEntityNotFound(_0x5f3db0,null))[_0x5bac('0x23')](function(_0x562f55){if(_0x562f55){return _0x562f55[_0x5bac('0x50')](_0x4bdd54[_0x5bac('0x4a')][_0x5bac('0x4b')],_[_0x5bac('0x4c')](_0x4bdd54[_0x5bac('0x4a')],['ids','id'])||{});}})['then'](respondWithResult(_0x5f3db0,null))['catch'](handleError(_0x5f3db0,null));};exports[_0x5bac('0x52')]=function(_0x5f5159,_0x57d506,_0x221f93){var _0x87d207={};var _0x612a3a={};var _0x2f0244;var _0x4b2e0c;return db['Automation']['findOne']({'where':{'id':_0x5f5159[_0x5bac('0x45')]['id']}})[_0x5bac('0x23')](handleEntityNotFound(_0x57d506,null))[_0x5bac('0x23')](function(_0x11d93f){if(_0x11d93f){_0x2f0244=_0x11d93f;_0x612a3a[_0x5bac('0x2f')]=_['keys'](db[_0x5bac('0x51')][_0x5bac('0x2c')]);_0x612a3a[_0x5bac('0x30')]=_['keys'](_0x5f5159[_0x5bac('0x30')]);_0x612a3a[_0x5bac('0x3a')]=_[_0x5bac('0x33')](_0x612a3a[_0x5bac('0x2f')],_0x612a3a[_0x5bac('0x30')]);_0x87d207[_0x5bac('0x32')]=_[_0x5bac('0x33')](_0x612a3a[_0x5bac('0x2f')],qs[_0x5bac('0x34')](_0x5f5159[_0x5bac('0x30')][_0x5bac('0x34')]));_0x87d207[_0x5bac('0x32')]=_0x87d207['attributes'][_0x5bac('0x35')]?_0x87d207[_0x5bac('0x32')]:_0x612a3a[_0x5bac('0x2f')];_0x87d207[_0x5bac('0x38')]=qs['sort'](_0x5f5159[_0x5bac('0x30')][_0x5bac('0x39')]);_0x87d207[_0x5bac('0x3d')]=qs[_0x5bac('0x3a')](_[_0x5bac('0x3b')](_0x5f5159[_0x5bac('0x30')],_0x612a3a[_0x5bac('0x3a')]));if(_0x5f5159[_0x5bac('0x30')][_0x5bac('0x3c')]){_0x87d207[_0x5bac('0x3d')]=_[_0x5bac('0x3e')](_0x87d207[_0x5bac('0x3d')],{'$or':_[_0x5bac('0x2a')](_0x87d207[_0x5bac('0x32')],function(_0x2ac430){var _0x1acfe2={};_0x1acfe2[_0x2ac430]={'$like':'%'+_0x5f5159[_0x5bac('0x30')][_0x5bac('0x3c')]+'%'};return _0x1acfe2;})});}_0x87d207=_['merge']({},_0x87d207,_0x5f5159['options']);return _0x2f0244[_0x5bac('0x52')](_0x87d207);}})[_0x5bac('0x23')](function(_0x19bba2){if(_0x19bba2){_0x4b2e0c=_0x19bba2[_0x5bac('0x35')];if(!_0x5f5159[_0x5bac('0x30')][_0x5bac('0x36')]('nolimit')){_0x87d207[_0x5bac('0x37')]=qs[_0x5bac('0x37')](_0x5f5159[_0x5bac('0x30')][_0x5bac('0x37')]);_0x87d207[_0x5bac('0x20')]=qs[_0x5bac('0x20')](_0x5f5159[_0x5bac('0x30')][_0x5bac('0x20')]);}return _0x2f0244['getActions'](_0x87d207);}})[_0x5bac('0x23')](function(_0x3b55e3){if(_0x3b55e3){return _0x3b55e3?{'count':_0x4b2e0c,'rows':_0x3b55e3}:null;}})[_0x5bac('0x23')](respondWithResult(_0x57d506,null))['catch'](handleError(_0x57d506,null));}; \ No newline at end of file +var _0x31e1=['to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','apply','then','destroy','send','index','map','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','Automation','includeAll','findAll','show','params','include','create','catch','update','body','find','addConditions','ids','getConditions','findOne','Condition','rawAttributes','nolimit','addActions','omit','getActions','Action','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x577971,_0x3414f4){var _0x137ab5=function(_0x510177){while(--_0x510177){_0x577971['push'](_0x577971['shift']());}};_0x137ab5(++_0x3414f4);}(_0x31e1,0xea));var _0x131e=function(_0x1e1ae7,_0x29bf67){_0x1e1ae7=_0x1e1ae7-0x0;var _0x2dedf2=_0x31e1[_0x1e1ae7];return _0x2dedf2;};'use strict';var emlformat=require(_0x131e('0x0'));var rimraf=require(_0x131e('0x1'));var zipdir=require(_0x131e('0x2'));var jsonpatch=require(_0x131e('0x3'));var rp=require('request-promise');var moment=require(_0x131e('0x4'));var BPromise=require(_0x131e('0x5'));var Mustache=require('mustache');var util=require(_0x131e('0x6'));var path=require(_0x131e('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x131e('0x8'));var fs=require('fs');var fs_extra=require(_0x131e('0x9'));var _=require(_0x131e('0xa'));var squel=require(_0x131e('0xb'));var crypto=require(_0x131e('0xc'));var jsforce=require(_0x131e('0xd'));var deskjs=require(_0x131e('0xe'));var toCsv=require(_0x131e('0xf'));var querystring=require('querystring');var Papa=require(_0x131e('0x10'));var Redis=require(_0x131e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x131e('0x12'));var as=require(_0x131e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x131e('0x14'))(_0x131e('0x15'));var utils=require(_0x131e('0x16'));var config=require(_0x131e('0x17'));var licenseUtil=require(_0x131e('0x18'));var db=require(_0x131e('0x19'))['db'];function respondWithStatusCode(_0x5285f1,_0x4cc0e9){_0x4cc0e9=_0x4cc0e9||0xcc;return function(_0x48f93e){if(_0x48f93e){return _0x5285f1[_0x131e('0x1a')](_0x4cc0e9);}return _0x5285f1[_0x131e('0x1b')](_0x4cc0e9)[_0x131e('0x1c')]();};}function respondWithResult(_0x476d60,_0x5547ac){_0x5547ac=_0x5547ac||0xc8;return function(_0x31c029){if(_0x31c029){return _0x476d60[_0x131e('0x1b')](_0x5547ac)[_0x131e('0x1d')](_0x31c029);}};}function respondWithFilteredResult(_0x12dcbf,_0x174b84){return function(_0x23ab2a){if(_0x23ab2a){var _0x26c94a=typeof _0x174b84[_0x131e('0x1e')]===_0x131e('0x1f')&&typeof _0x174b84['limit']===_0x131e('0x1f');var _0x4bfaff=_0x23ab2a['count'];var _0x33a478=_0x26c94a?0x0:_0x174b84[_0x131e('0x1e')];var _0x4a19b2=_0x26c94a?_0x23ab2a[_0x131e('0x20')]:_0x174b84[_0x131e('0x1e')]+_0x174b84[_0x131e('0x21')];var _0x5c731e;if(_0x4a19b2>=_0x4bfaff){_0x4a19b2=_0x4bfaff;_0x5c731e=0xc8;}else{_0x5c731e=0xce;}_0x12dcbf[_0x131e('0x1b')](_0x5c731e);return _0x12dcbf['set']('Content-Range',_0x33a478+'-'+_0x4a19b2+'/'+_0x4bfaff)[_0x131e('0x1d')](_0x23ab2a);}return null;};}function patchUpdates(_0x4f06af){return function(_0xb469db){try{jsonpatch[_0x131e('0x22')](_0xb469db,_0x4f06af,!![]);}catch(_0x2f11f9){return BPromise['reject'](_0x2f11f9);}return _0xb469db['save']();};}function saveUpdates(_0x3c6310,_0x5d9401){return function(_0x5bf452){if(_0x5bf452){return _0x5bf452['update'](_0x3c6310)[_0x131e('0x23')](function(_0x2aba23){return _0x2aba23;});}return null;};}function removeEntity(_0x42b025,_0xf7f30){return function(_0x5c5f10){if(_0x5c5f10){return _0x5c5f10[_0x131e('0x24')]()[_0x131e('0x23')](function(){_0x42b025[_0x131e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40125f,_0x9e53c9){return function(_0x5d807a){if(!_0x5d807a){_0x40125f[_0x131e('0x1a')](0x194);}return _0x5d807a;};}function handleError(_0x32b005,_0x4df08e){_0x4df08e=_0x4df08e||0x1f4;return function(_0x48caf6){logger['error'](_0x48caf6['stack']);if(_0x48caf6['name']){delete _0x48caf6['name'];}_0x32b005[_0x131e('0x1b')](_0x4df08e)[_0x131e('0x25')](_0x48caf6);};}exports[_0x131e('0x26')]=function(_0x2bf124,_0x1f4512){var _0x3ed7e8={},_0x443314={},_0x23dd88={'count':0x0,'rows':[]};var _0x1a21d4=_[_0x131e('0x27')](db['Automation']['rawAttributes'],function(_0x4d3a74){return{'name':_0x4d3a74[_0x131e('0x28')],'type':_0x4d3a74[_0x131e('0x29')][_0x131e('0x2a')]};});_0x443314[_0x131e('0x2b')]=_['map'](_0x1a21d4,_0x131e('0x2c'));_0x443314[_0x131e('0x2d')]=_[_0x131e('0x2e')](_0x2bf124[_0x131e('0x2d')]);_0x443314[_0x131e('0x2f')]=_[_0x131e('0x30')](_0x443314[_0x131e('0x2b')],_0x443314['query']);_0x3ed7e8['attributes']=_[_0x131e('0x30')](_0x443314[_0x131e('0x2b')],qs[_0x131e('0x31')](_0x2bf124[_0x131e('0x2d')][_0x131e('0x31')]));_0x3ed7e8[_0x131e('0x32')]=_0x3ed7e8[_0x131e('0x32')][_0x131e('0x33')]?_0x3ed7e8[_0x131e('0x32')]:_0x443314['model'];if(!_0x2bf124[_0x131e('0x2d')][_0x131e('0x34')]('nolimit')){_0x3ed7e8['limit']=qs[_0x131e('0x21')](_0x2bf124[_0x131e('0x2d')][_0x131e('0x21')]);_0x3ed7e8[_0x131e('0x1e')]=qs[_0x131e('0x1e')](_0x2bf124[_0x131e('0x2d')][_0x131e('0x1e')]);}_0x3ed7e8[_0x131e('0x35')]=qs[_0x131e('0x36')](_0x2bf124[_0x131e('0x2d')]['sort']);_0x3ed7e8['where']=qs['filters'](_[_0x131e('0x37')](_0x2bf124[_0x131e('0x2d')],_0x443314['filters']),_0x1a21d4);if(_0x2bf124[_0x131e('0x2d')][_0x131e('0x38')]){_0x3ed7e8[_0x131e('0x39')]=_[_0x131e('0x3a')](_0x3ed7e8[_0x131e('0x39')],{'$or':_['map'](_0x1a21d4,function(_0x65e2d9){if(_0x65e2d9[_0x131e('0x29')]!==_0x131e('0x3b')){var _0x6a6851={};_0x6a6851[_0x65e2d9[_0x131e('0x2c')]]={'$like':'%'+_0x2bf124[_0x131e('0x2d')][_0x131e('0x38')]+'%'};return _0x6a6851;}})});}_0x3ed7e8=_[_0x131e('0x3a')]({},_0x3ed7e8,_0x2bf124[_0x131e('0x3c')]);var _0x5b820d={'where':_0x3ed7e8['where']};return db[_0x131e('0x3d')][_0x131e('0x20')](_0x5b820d)[_0x131e('0x23')](function(_0x481d8d){_0x23dd88[_0x131e('0x20')]=_0x481d8d;if(_0x2bf124['query'][_0x131e('0x3e')]){_0x3ed7e8['include']=[{'all':!![]}];}return db[_0x131e('0x3d')][_0x131e('0x3f')](_0x3ed7e8);})[_0x131e('0x23')](function(_0x31e88d){_0x23dd88['rows']=_0x31e88d;return _0x23dd88;})[_0x131e('0x23')](respondWithFilteredResult(_0x1f4512,_0x3ed7e8))['catch'](handleError(_0x1f4512,null));};exports[_0x131e('0x40')]=function(_0x24e425,_0x229cd9){var _0x25b97f={'raw':![],'where':{'id':_0x24e425[_0x131e('0x41')]['id']}},_0x425fbb={};_0x425fbb['model']=_['keys'](db['Automation']['rawAttributes']);_0x425fbb[_0x131e('0x2d')]=_['keys'](_0x24e425[_0x131e('0x2d')]);_0x425fbb['filters']=_[_0x131e('0x30')](_0x425fbb[_0x131e('0x2b')],_0x425fbb[_0x131e('0x2d')]);_0x25b97f[_0x131e('0x32')]=_[_0x131e('0x30')](_0x425fbb['model'],qs[_0x131e('0x31')](_0x24e425[_0x131e('0x2d')][_0x131e('0x31')]));_0x25b97f[_0x131e('0x32')]=_0x25b97f[_0x131e('0x32')]['length']?_0x25b97f['attributes']:_0x425fbb[_0x131e('0x2b')];if(_0x24e425['query'][_0x131e('0x3e')]){_0x25b97f[_0x131e('0x42')]=[{'all':!![]}];}_0x25b97f=_[_0x131e('0x3a')]({},_0x25b97f,_0x24e425[_0x131e('0x3c')]);return db[_0x131e('0x3d')]['find'](_0x25b97f)['then'](handleEntityNotFound(_0x229cd9,null))[_0x131e('0x23')](respondWithResult(_0x229cd9,null))['catch'](handleError(_0x229cd9,null));};exports[_0x131e('0x43')]=function(_0x32af77,_0x3fca5e){return db[_0x131e('0x3d')]['create'](_0x32af77['body'],{})[_0x131e('0x23')](respondWithResult(_0x3fca5e,0xc9))[_0x131e('0x44')](handleError(_0x3fca5e,null));};exports[_0x131e('0x45')]=function(_0x384997,_0xb4d844){if(_0x384997[_0x131e('0x46')]['id']){delete _0x384997['body']['id'];}return db[_0x131e('0x3d')][_0x131e('0x47')]({'where':{'id':_0x384997[_0x131e('0x41')]['id']}})[_0x131e('0x23')](handleEntityNotFound(_0xb4d844,null))[_0x131e('0x23')](saveUpdates(_0x384997[_0x131e('0x46')],null))['then'](respondWithResult(_0xb4d844,null))[_0x131e('0x44')](handleError(_0xb4d844,null));};exports[_0x131e('0x24')]=function(_0x1ee69a,_0x484e03){return db['Automation'][_0x131e('0x47')]({'where':{'id':_0x1ee69a['params']['id']}})[_0x131e('0x23')](handleEntityNotFound(_0x484e03,null))[_0x131e('0x23')](removeEntity(_0x484e03,null))[_0x131e('0x44')](handleError(_0x484e03,null));};exports[_0x131e('0x48')]=function(_0x2b4541,_0x5d3397,_0x20ffb8){return db['Condition'][_0x131e('0x47')]({'where':{'id':_0x2b4541[_0x131e('0x41')]['id']}})[_0x131e('0x23')](handleEntityNotFound(_0x5d3397,null))[_0x131e('0x23')](function(_0x203a5e){if(_0x203a5e){return _0x203a5e[_0x131e('0x48')](_0x2b4541['body'][_0x131e('0x49')],_['omit'](_0x2b4541[_0x131e('0x46')],[_0x131e('0x49'),'id'])||{});}})[_0x131e('0x23')](respondWithResult(_0x5d3397,null))[_0x131e('0x44')](handleError(_0x5d3397,null));};exports[_0x131e('0x4a')]=function(_0x53d4a4,_0x3c0a4e,_0x28a091){var _0x29efb6={};var _0x3b8aa4={};var _0x40943f;var _0x2f69d4;return db[_0x131e('0x3d')][_0x131e('0x4b')]({'where':{'id':_0x53d4a4[_0x131e('0x41')]['id']}})[_0x131e('0x23')](handleEntityNotFound(_0x3c0a4e,null))[_0x131e('0x23')](function(_0x4f370b){if(_0x4f370b){_0x40943f=_0x4f370b;_0x3b8aa4[_0x131e('0x2b')]=_[_0x131e('0x2e')](db[_0x131e('0x4c')][_0x131e('0x4d')]);_0x3b8aa4[_0x131e('0x2d')]=_[_0x131e('0x2e')](_0x53d4a4[_0x131e('0x2d')]);_0x3b8aa4[_0x131e('0x2f')]=_[_0x131e('0x30')](_0x3b8aa4['model'],_0x3b8aa4[_0x131e('0x2d')]);_0x29efb6['attributes']=_['intersection'](_0x3b8aa4[_0x131e('0x2b')],qs[_0x131e('0x31')](_0x53d4a4[_0x131e('0x2d')]['fields']));_0x29efb6[_0x131e('0x32')]=_0x29efb6['attributes'][_0x131e('0x33')]?_0x29efb6[_0x131e('0x32')]:_0x3b8aa4[_0x131e('0x2b')];_0x29efb6[_0x131e('0x35')]=qs[_0x131e('0x36')](_0x53d4a4[_0x131e('0x2d')][_0x131e('0x36')]);_0x29efb6[_0x131e('0x39')]=qs[_0x131e('0x2f')](_[_0x131e('0x37')](_0x53d4a4[_0x131e('0x2d')],_0x3b8aa4['filters']));if(_0x53d4a4['query'][_0x131e('0x38')]){_0x29efb6[_0x131e('0x39')]=_[_0x131e('0x3a')](_0x29efb6[_0x131e('0x39')],{'$or':_[_0x131e('0x27')](_0x29efb6['attributes'],function(_0x3fc3be){var _0x1b3e86={};_0x1b3e86[_0x3fc3be]={'$like':'%'+_0x53d4a4[_0x131e('0x2d')][_0x131e('0x38')]+'%'};return _0x1b3e86;})});}_0x29efb6=_[_0x131e('0x3a')]({},_0x29efb6,_0x53d4a4[_0x131e('0x3c')]);return _0x40943f[_0x131e('0x4a')](_0x29efb6);}})[_0x131e('0x23')](function(_0x245602){if(_0x245602){_0x2f69d4=_0x245602[_0x131e('0x33')];if(!_0x53d4a4['query']['hasOwnProperty'](_0x131e('0x4e'))){_0x29efb6[_0x131e('0x21')]=qs[_0x131e('0x21')](_0x53d4a4[_0x131e('0x2d')]['limit']);_0x29efb6[_0x131e('0x1e')]=qs[_0x131e('0x1e')](_0x53d4a4[_0x131e('0x2d')][_0x131e('0x1e')]);}return _0x40943f[_0x131e('0x4a')](_0x29efb6);}})[_0x131e('0x23')](function(_0x570a2e){if(_0x570a2e){return _0x570a2e?{'count':_0x2f69d4,'rows':_0x570a2e}:null;}})[_0x131e('0x23')](respondWithResult(_0x3c0a4e,null))[_0x131e('0x44')](handleError(_0x3c0a4e,null));};exports[_0x131e('0x4f')]=function(_0x1149f1,_0x3a8e91,_0x302329){return db['Action'][_0x131e('0x47')]({'where':{'id':_0x1149f1[_0x131e('0x41')]['id']}})[_0x131e('0x23')](handleEntityNotFound(_0x3a8e91,null))[_0x131e('0x23')](function(_0x1b7436){if(_0x1b7436){return _0x1b7436['addActions'](_0x1149f1['body']['ids'],_[_0x131e('0x50')](_0x1149f1[_0x131e('0x46')],[_0x131e('0x49'),'id'])||{});}})['then'](respondWithResult(_0x3a8e91,null))['catch'](handleError(_0x3a8e91,null));};exports[_0x131e('0x51')]=function(_0x4c44a9,_0x16e205,_0x4a0b47){var _0x3d94dd={};var _0x39115e={};var _0x510459;var _0x516df1;return db[_0x131e('0x3d')][_0x131e('0x4b')]({'where':{'id':_0x4c44a9[_0x131e('0x41')]['id']}})[_0x131e('0x23')](handleEntityNotFound(_0x16e205,null))[_0x131e('0x23')](function(_0x447af0){if(_0x447af0){_0x510459=_0x447af0;_0x39115e[_0x131e('0x2b')]=_[_0x131e('0x2e')](db[_0x131e('0x52')]['rawAttributes']);_0x39115e['query']=_[_0x131e('0x2e')](_0x4c44a9[_0x131e('0x2d')]);_0x39115e[_0x131e('0x2f')]=_[_0x131e('0x30')](_0x39115e['model'],_0x39115e[_0x131e('0x2d')]);_0x3d94dd[_0x131e('0x32')]=_['intersection'](_0x39115e['model'],qs[_0x131e('0x31')](_0x4c44a9['query']['fields']));_0x3d94dd[_0x131e('0x32')]=_0x3d94dd[_0x131e('0x32')][_0x131e('0x33')]?_0x3d94dd[_0x131e('0x32')]:_0x39115e['model'];_0x3d94dd[_0x131e('0x35')]=qs[_0x131e('0x36')](_0x4c44a9[_0x131e('0x2d')]['sort']);_0x3d94dd['where']=qs['filters'](_['pick'](_0x4c44a9['query'],_0x39115e[_0x131e('0x2f')]));if(_0x4c44a9[_0x131e('0x2d')][_0x131e('0x38')]){_0x3d94dd[_0x131e('0x39')]=_[_0x131e('0x3a')](_0x3d94dd[_0x131e('0x39')],{'$or':_[_0x131e('0x27')](_0x3d94dd[_0x131e('0x32')],function(_0x2daf10){var _0x32d9f2={};_0x32d9f2[_0x2daf10]={'$like':'%'+_0x4c44a9[_0x131e('0x2d')][_0x131e('0x38')]+'%'};return _0x32d9f2;})});}_0x3d94dd=_[_0x131e('0x3a')]({},_0x3d94dd,_0x4c44a9[_0x131e('0x3c')]);return _0x510459[_0x131e('0x51')](_0x3d94dd);}})[_0x131e('0x23')](function(_0xb3aac4){if(_0xb3aac4){_0x516df1=_0xb3aac4['length'];if(!_0x4c44a9[_0x131e('0x2d')][_0x131e('0x34')](_0x131e('0x4e'))){_0x3d94dd[_0x131e('0x21')]=qs[_0x131e('0x21')](_0x4c44a9['query'][_0x131e('0x21')]);_0x3d94dd[_0x131e('0x1e')]=qs[_0x131e('0x1e')](_0x4c44a9[_0x131e('0x2d')]['offset']);}return _0x510459[_0x131e('0x51')](_0x3d94dd);}})[_0x131e('0x23')](function(_0x5778d3){if(_0x5778d3){return _0x5778d3?{'count':_0x516df1,'rows':_0x5778d3}:null;}})[_0x131e('0x23')](respondWithResult(_0x16e205,null))[_0x131e('0x44')](handleError(_0x16e205,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 519d823..7dc85b5 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 _0x4393=['path','rimraf','../../config/environment','./automation.attributes','define','tools_automations','lodash','util','../../config/logger','api','bluebird'];(function(_0x10b4b8,_0x450fea){var _0x424293=function(_0x58ad42){while(--_0x58ad42){_0x10b4b8['push'](_0x10b4b8['shift']());}};_0x424293(++_0x450fea);}(_0x4393,0x10e));var _0x3439=function(_0xbfd058,_0x1ee59){_0xbfd058=_0xbfd058-0x0;var _0x568cb1=_0x4393[_0xbfd058];return _0x568cb1;};'use strict';var _=require(_0x3439('0x0'));var util=require(_0x3439('0x1'));var logger=require(_0x3439('0x2'))(_0x3439('0x3'));var moment=require('moment');var BPromise=require(_0x3439('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3439('0x5'));var rimraf=require(_0x3439('0x6'));var config=require(_0x3439('0x7'));var attributes=require(_0x3439('0x8'));module['exports']=function(_0x499d42,_0x2f2689){return _0x499d42[_0x3439('0x9')]('Automation',attributes,{'tableName':_0x3439('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1578=['lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','Automation','tools_automations'];(function(_0x128387,_0x4dda41){var _0x266073=function(_0x2846f9){while(--_0x2846f9){_0x128387['push'](_0x128387['shift']());}};_0x266073(++_0x4dda41);}(_0x1578,0x144));var _0x8157=function(_0xd1aec5,_0x2dbd8e){_0xd1aec5=_0xd1aec5-0x0;var _0x560b3e=_0x1578[_0xd1aec5];return _0x560b3e;};'use strict';var _=require(_0x8157('0x0'));var util=require(_0x8157('0x1'));var logger=require('../../config/logger')(_0x8157('0x2'));var moment=require('moment');var BPromise=require(_0x8157('0x3'));var rp=require(_0x8157('0x4'));var fs=require('fs');var path=require(_0x8157('0x5'));var rimraf=require(_0x8157('0x6'));var config=require(_0x8157('0x7'));var attributes=require(_0x8157('0x8'));module[_0x8157('0x9')]=function(_0x1ca695,_0x1a98f5){return _0x1ca695['define'](_0x8157('0xa'),attributes,{'tableName':_0x8157('0xb'),'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 825db4a..bb1d8a4 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 _0xa3db=['client','http','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Automation,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment'];(function(_0x10852d,_0x4cdcc6){var _0x13a8d6=function(_0x2ece16){while(--_0x2ece16){_0x10852d['push'](_0x10852d['shift']());}};_0x13a8d6(++_0x4cdcc6);}(_0xa3db,0x10c));var _0xba3d=function(_0x46170,_0x4b2af3){_0x46170=_0x46170-0x0;var _0x46afd8=_0xa3db[_0x46170];return _0x46afd8;};'use strict';var _=require(_0xba3d('0x0'));var util=require(_0xba3d('0x1'));var moment=require(_0xba3d('0x2'));var BPromise=require(_0xba3d('0x3'));var rs=require(_0xba3d('0x4'));var fs=require('fs');var Redis=require(_0xba3d('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xba3d('0x6'))('rpc');var config=require(_0xba3d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xba3d('0x8')][_0xba3d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x477583,_0x1bacd7,_0x1bd181){return new BPromise(function(_0x426868,_0x3b69e9){return client[_0xba3d('0xa')](_0x477583,_0x1bd181)[_0xba3d('0xb')](function(_0x102fe6){logger[_0xba3d('0xc')]('Automation,\x20%s,\x20%s',_0x1bacd7,_0xba3d('0xd'));logger[_0xba3d('0xe')](_0xba3d('0xf'),_0x1bacd7,_0xba3d('0xd'),JSON[_0xba3d('0x10')](_0x102fe6));if(_0x102fe6['error']){if(_0x102fe6[_0xba3d('0x11')][_0xba3d('0x12')]===0x1f4){logger[_0xba3d('0x11')]('Automation,\x20%s,\x20%s',_0x1bacd7,_0x102fe6['error'][_0xba3d('0x13')]);return _0x3b69e9(_0x102fe6[_0xba3d('0x11')]['message']);}logger['error'](_0xba3d('0x14'),_0x1bacd7,_0x102fe6['error'][_0xba3d('0x13')]);return _0x426868(_0x102fe6[_0xba3d('0x11')][_0xba3d('0x13')]);}else{logger[_0xba3d('0xc')](_0xba3d('0x14'),_0x1bacd7,_0xba3d('0xd'));_0x426868(_0x102fe6[_0xba3d('0x15')][_0xba3d('0x13')]);}})[_0xba3d('0x16')](function(_0x2ce092){logger['error'](_0xba3d('0x14'),_0x1bacd7,_0x2ce092);_0x3b69e9(_0x2ce092);});});} \ No newline at end of file +var _0xf3a8=['message','catch','util','moment','randomstring','../../config/utils','rpc','jayson/promise','client','http','request','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xf3a8,0xf2));var _0x8f3a=function(_0x2113ca,_0x471610){_0x2113ca=_0x2113ca-0x0;var _0x2fc641=_0xf3a8[_0x2113ca];return _0x2fc641;};'use strict';var _=require('lodash');var util=require(_0x8f3a('0x0'));var moment=require(_0x8f3a('0x1'));var BPromise=require('bluebird');var rs=require(_0x8f3a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8f3a('0x3'));var logger=require('../../config/logger')(_0x8f3a('0x4'));var config=require('../../config/environment');var jayson=require(_0x8f3a('0x5'));var client=jayson[_0x8f3a('0x6')][_0x8f3a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x32bb3a,_0xc50ed8,_0x2e290d){return new BPromise(function(_0x3dc1ea,_0xcfad11){return client[_0x8f3a('0x8')](_0x32bb3a,_0x2e290d)['then'](function(_0x2164ba){logger['info'](_0x8f3a('0x9'),_0xc50ed8,_0x8f3a('0xa'));logger[_0x8f3a('0xb')](_0x8f3a('0xc'),_0xc50ed8,_0x8f3a('0xa'),JSON['stringify'](_0x2164ba));if(_0x2164ba[_0x8f3a('0xd')]){if(_0x2164ba[_0x8f3a('0xd')]['code']===0x1f4){logger[_0x8f3a('0xd')]('Automation,\x20%s,\x20%s',_0xc50ed8,_0x2164ba['error'][_0x8f3a('0xe')]);return _0xcfad11(_0x2164ba[_0x8f3a('0xd')]['message']);}logger[_0x8f3a('0xd')](_0x8f3a('0x9'),_0xc50ed8,_0x2164ba[_0x8f3a('0xd')]['message']);return _0x3dc1ea(_0x2164ba[_0x8f3a('0xd')][_0x8f3a('0xe')]);}else{logger['info'](_0x8f3a('0x9'),_0xc50ed8,_0x8f3a('0xa'));_0x3dc1ea(_0x2164ba['result'][_0x8f3a('0xe')]);}})[_0x8f3a('0xf')](function(_0x9bf803){logger[_0x8f3a('0xd')](_0x8f3a('0x9'),_0xc50ed8,_0x9bf803);_0xcfad11(_0x9bf803);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 5160433..86c7be7 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 _0xb717=['fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id','show','getConditions','/:id/actions','getActions','post','addConditions','put','update','destroy','multer','path','express','Router'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xb717,0x1b4));var _0x7b71=function(_0xa8ea96,_0x4bfe7b){_0xa8ea96=_0xa8ea96-0x0;var _0x306c8c=_0xb717[_0xa8ea96];return _0x306c8c;};'use strict';var multer=require(_0x7b71('0x0'));var util=require('util');var path=require(_0x7b71('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b71('0x2'));var router=express[_0x7b71('0x3')]();var fs_extra=require(_0x7b71('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7b71('0x5'));var config=require(_0x7b71('0x6'));var controller=require(_0x7b71('0x7'));router[_0x7b71('0x8')]('/',auth[_0x7b71('0x9')](),controller['index']);router[_0x7b71('0x8')](_0x7b71('0xa'),auth[_0x7b71('0x9')](),controller[_0x7b71('0xb')]);router[_0x7b71('0x8')]('/:id/conditions',auth[_0x7b71('0x9')](),controller[_0x7b71('0xc')]);router['get'](_0x7b71('0xd'),auth[_0x7b71('0x9')](),controller[_0x7b71('0xe')]);router['post']('/',auth[_0x7b71('0x9')](),controller['create']);router[_0x7b71('0xf')]('/:id/conditions',auth[_0x7b71('0x9')](),controller[_0x7b71('0x10')]);router[_0x7b71('0xf')](_0x7b71('0xd'),auth[_0x7b71('0x9')](),controller['addActions']);router[_0x7b71('0x11')]('/:id',auth[_0x7b71('0x9')](),controller[_0x7b71('0x12')]);router['delete'](_0x7b71('0xa'),auth[_0x7b71('0x9')](),controller[_0x7b71('0x13')]);module['exports']=router; \ No newline at end of file +var _0x5620=['/:id/conditions','getConditions','/:id/actions','getActions','create','post','addActions','put','update','delete','destroy','multer','path','connect-timeout','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x547fcb,_0x8fda67){var _0x275d17=function(_0x301cd1){while(--_0x301cd1){_0x547fcb['push'](_0x547fcb['shift']());}};_0x275d17(++_0x8fda67);}(_0x5620,0xbf));var _0x0562=function(_0xf7a9cf,_0x2cfa33){_0xf7a9cf=_0xf7a9cf-0x0;var _0x7fdc45=_0x5620[_0xf7a9cf];return _0x7fdc45;};'use strict';var multer=require(_0x0562('0x0'));var util=require('util');var path=require(_0x0562('0x1'));var timeout=require(_0x0562('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0562('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0562('0x4'));var controller=require('./automation.controller');router[_0x0562('0x5')]('/',auth[_0x0562('0x6')](),controller[_0x0562('0x7')]);router[_0x0562('0x5')](_0x0562('0x8'),auth[_0x0562('0x6')](),controller['show']);router['get'](_0x0562('0x9'),auth['isAuthenticated'](),controller[_0x0562('0xa')]);router[_0x0562('0x5')](_0x0562('0xb'),auth[_0x0562('0x6')](),controller[_0x0562('0xc')]);router['post']('/',auth[_0x0562('0x6')](),controller[_0x0562('0xd')]);router[_0x0562('0xe')](_0x0562('0x9'),auth[_0x0562('0x6')](),controller['addConditions']);router['post'](_0x0562('0xb'),auth[_0x0562('0x6')](),controller[_0x0562('0xf')]);router[_0x0562('0x10')]('/:id',auth[_0x0562('0x6')](),controller[_0x0562('0x11')]);router[_0x0562('0x12')](_0x0562('0x8'),auth['isAuthenticated'](),controller[_0x0562('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index cddaeea..e1b0959 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 _0x0a4b=['#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','name','ENUM','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence'];(function(_0xdf56aa,_0x4d9c15){var _0x82768=function(_0x56a69f){while(--_0x56a69f){_0xdf56aa['push'](_0xdf56aa['shift']());}};_0x82768(++_0x4d9c15);}(_0x0a4b,0x14b));var _0xb0a4=function(_0x99860,_0x4061f1){_0x99860=_0x99860-0x0;var _0x1d1c0b=_0x0a4b[_0x99860];return _0x1d1c0b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xb0a4('0x0'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xb0a4('0x1')](_0xb0a4('0x2')),'allowNull':![],'defaultValue':_0xb0a4('0x2')},'description':{'type':Sequelize[_0xb0a4('0x3')]},'active':{'type':Sequelize[_0xb0a4('0x4')],'defaultValue':0x0,'comment':_0xb0a4('0x5')},'limitCalls':{'type':Sequelize[_0xb0a4('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xb0a4('0x3')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb0a4('0x7')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb0a4('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb0a4('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xb0a4('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xb0a4('0x6')](0x3)[_0xb0a4('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb0a4('0xa')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb0a4('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xb0a4('0x6')](0x3)[_0xb0a4('0x8')],'defaultValue':0x3,'comment':_0xb0a4('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xb0a4('0x6')](0x5)[_0xb0a4('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb0a4('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0xb0a4('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xb0a4('0xe')},'dialTimezone':{'type':Sequelize[_0xb0a4('0x3')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xb0a4('0x3')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xb0a4('0x1')](_0xb0a4('0xf'),'never',_0xb0a4('0x10')),'defaultValue':_0xb0a4('0xf')},'dialAMDActive':{'type':Sequelize[_0xb0a4('0x4')],'defaultValue':0x0,'comment':_0xb0a4('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0xb0a4('0x6')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xb0a4('0x12')},'dialAMDGreeting':{'type':Sequelize[_0xb0a4('0x6')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xb0a4('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xb0a4('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xb0a4('0x6')](0x9)[_0xb0a4('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb0a4('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0xb0a4('0x6')](0x9)[_0xb0a4('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xb0a4('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xb0a4('0x6')](0x9)[_0xb0a4('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xb0a4('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xb0a4('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xb0a4('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xb0a4('0x6')](0x9)[_0xb0a4('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb0a4('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0xb0a4('0x1')]('DESC','ASC'),'defaultValue':_0xb0a4('0x19')},'dialPrefix':{'type':Sequelize[_0xb0a4('0x3')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xb0a4('0x6')](0x3)[_0xb0a4('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb0a4('0x1a')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb0a4('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb0a4('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb0a4('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xb0a4('0x6')](0x5)[_0xb0a4('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb0a4('0x1d')},'dialDropMaxRetry':{'type':Sequelize[_0xb0a4('0x6')](0x3)[_0xb0a4('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb0a4('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0xb0a4('0x6')](0x5)[_0xb0a4('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb0a4('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xb0a4('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xb0a4('0x6')](0x5)[_0xb0a4('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb0a4('0x20')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb0a4('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xb0a4('0x6')](0x5)[_0xb0a4('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xb0a4('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb0a4('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xb0a4('0x6')](0x5)[_0xb0a4('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb0a4('0x22')}}; \ No newline at end of file +var _0x7a40=['#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','STRING','ENUM','ivr','BOOLEAN','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)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence'];(function(_0x3cdae2,_0x21a4a7){var _0x571b3e=function(_0xce79f4){while(--_0xce79f4){_0x3cdae2['push'](_0x3cdae2['shift']());}};_0x571b3e(++_0x21a4a7);}(_0x7a40,0x197));var _0x07a4=function(_0xd91e91,_0x20829a){_0xd91e91=_0xd91e91-0x0;var _0x597823=_0x7a40[_0xd91e91];return _0x597823;};'use strict';var Sequelize=require(_0x07a4('0x0'));module[_0x07a4('0x1')]={'name':{'type':Sequelize[_0x07a4('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x07a4('0x3')](_0x07a4('0x4')),'allowNull':![],'defaultValue':_0x07a4('0x4')},'description':{'type':Sequelize[_0x07a4('0x2')]},'active':{'type':Sequelize[_0x07a4('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x07a4('0x6')](0x4)[_0x07a4('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x07a4('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x07a4('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x07a4('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x07a4('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x07a4('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x07a4('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x07a4('0x6')](0x5)[_0x07a4('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x07a4('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x07a4('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x07a4('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x07a4('0x7')],'defaultValue':0x3,'comment':_0x07a4('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x07a4('0x6')](0x5)[_0x07a4('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x07a4('0x6')](0x3)[_0x07a4('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x07a4('0xc')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x07a4('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x07a4('0x3')](_0x07a4('0xd'),_0x07a4('0xe'),_0x07a4('0xf')),'defaultValue':_0x07a4('0xd')},'dialAMDActive':{'type':Sequelize[_0x07a4('0x5')],'defaultValue':0x0,'comment':_0x07a4('0x10')},'dialAMDInitialSilence':{'type':Sequelize[_0x07a4('0x6')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x07a4('0x11')},'dialAMDGreeting':{'type':Sequelize[_0x07a4('0x6')](0x9)[_0x07a4('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x07a4('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x07a4('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x07a4('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x07a4('0x6')](0x9)[_0x07a4('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x07a4('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x07a4('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x07a4('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x07a4('0x6')](0x9)[_0x07a4('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x07a4('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x07a4('0x6')](0x5)[_0x07a4('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x07a4('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x07a4('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x07a4('0x18')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x07a4('0x19')),'defaultValue':_0x07a4('0x1a')},'dialPrefix':{'type':Sequelize[_0x07a4('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x07a4('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x07a4('0x1b')},'dialCutDigit':{'type':Sequelize[_0x07a4('0x6')](0x3)[_0x07a4('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x07a4('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x07a4('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x07a4('0x6')](0x5)[_0x07a4('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x07a4('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x07a4('0x1d')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x07a4('0x6')](0x3)[_0x07a4('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x07a4('0x1e')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x07a4('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x07a4('0x6')](0x3)[_0x07a4('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x07a4('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x07a4('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x07a4('0x20')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x07a4('0x6')](0x5)[_0x07a4('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index d00bde5..02520a1 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 _0x9205=['CmHopper','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_contacts','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','cmHopperId','OrderBy','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','YYYY-MM-DD\x20HH:mm:ss','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','get','IvrCampaigns','error','name','send','index','map','rawAttributes','type','model','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','includeAll','findAll','rows','catch','params','Campaign','keys','intersection','length','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','options','omit','createdAt','updatedAt','body','role','findOne','CampaignId','filter'];(function(_0x209723,_0x4c5ff8){var _0x4a9955=function(_0x24a0dd){while(--_0x24a0dd){_0x209723['push'](_0x209723['shift']());}};_0x4a9955(++_0x4c5ff8);}(_0x9205,0x14d));var _0x5920=function(_0x4e6364,_0x1b3ccc){_0x4e6364=_0x4e6364-0x0;var _0x470a03=_0x9205[_0x4e6364];return _0x470a03;};'use strict';var emlformat=require(_0x5920('0x0'));var rimraf=require(_0x5920('0x1'));var zipdir=require(_0x5920('0x2'));var jsonpatch=require(_0x5920('0x3'));var rp=require(_0x5920('0x4'));var moment=require(_0x5920('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5920('0x6'));var _=require('lodash');var squel=require(_0x5920('0x7'));var crypto=require(_0x5920('0x8'));var jsforce=require(_0x5920('0x9'));var deskjs=require(_0x5920('0xa'));var toCsv=require(_0x5920('0xb'));var querystring=require(_0x5920('0xc'));var Papa=require(_0x5920('0xd'));var Redis=require('ioredis');var authService=require(_0x5920('0xe'));var qs=require(_0x5920('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5920('0x10'));var logger=require(_0x5920('0x11'))(_0x5920('0x12'));var utils=require('../../config/utils');var config=require(_0x5920('0x13'));var licenseUtil=require(_0x5920('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x288132,_0x382ff8){_0x382ff8=_0x382ff8||0xcc;return function(_0x19a466){if(_0x19a466){return _0x288132[_0x5920('0x15')](_0x382ff8);}return _0x288132[_0x5920('0x16')](_0x382ff8)[_0x5920('0x17')]();};}function respondWithResult(_0x17e07a,_0x47a44b){_0x47a44b=_0x47a44b||0xc8;return function(_0x1cc5da){if(_0x1cc5da){return _0x17e07a[_0x5920('0x16')](_0x47a44b)[_0x5920('0x18')](_0x1cc5da);}};}function respondWithFilteredResult(_0x39872b,_0x3ad851){return function(_0x17339e){if(_0x17339e){var _0x4d4270=typeof _0x3ad851['offset']===_0x5920('0x19')&&typeof _0x3ad851[_0x5920('0x1a')]==='undefined';var _0x22cd40=_0x17339e[_0x5920('0x1b')];var _0x1801c1=_0x4d4270?0x0:_0x3ad851[_0x5920('0x1c')];var _0x34d93a=_0x4d4270?_0x17339e[_0x5920('0x1b')]:_0x3ad851[_0x5920('0x1c')]+_0x3ad851[_0x5920('0x1a')];var _0x49b091;if(_0x34d93a>=_0x22cd40){_0x34d93a=_0x22cd40;_0x49b091=0xc8;}else{_0x49b091=0xce;}_0x39872b[_0x5920('0x16')](_0x49b091);return _0x39872b[_0x5920('0x1d')](_0x5920('0x1e'),_0x1801c1+'-'+_0x34d93a+'/'+_0x22cd40)[_0x5920('0x18')](_0x17339e);}return null;};}function patchUpdates(_0x55776d){return function(_0x1f6fa6){try{jsonpatch[_0x5920('0x1f')](_0x1f6fa6,_0x55776d,!![]);}catch(_0x4a8571){return BPromise[_0x5920('0x20')](_0x4a8571);}return _0x1f6fa6['save']();};}function saveUpdates(_0x49eb65,_0x2a676f){return function(_0x180158){if(_0x180158){return _0x180158['update'](_0x49eb65)[_0x5920('0x21')](function(_0x1d0a4c){return _0x1d0a4c;});}return null;};}function removeEntity(_0xe15b75,_0x33dff7){return function(_0x2223cb){if(_0x2223cb){return _0x2223cb[_0x5920('0x22')]()[_0x5920('0x21')](function(){var _0x490e33=_0x2223cb[_0x5920('0x23')]({'plain':!![]});var _0x190825=_0x5920('0x24');return db['UserProfileResource'][_0x5920('0x22')]({'where':{'type':_0x190825,'resourceId':_0x490e33['id']}})[_0x5920('0x21')](function(){return _0x2223cb;});})[_0x5920('0x21')](function(){_0xe15b75[_0x5920('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ef5fa,_0x510bd1){return function(_0x337e16){if(!_0x337e16){_0x2ef5fa[_0x5920('0x15')](0x194);}return _0x337e16;};}function handleError(_0x402e54,_0x4cbfaf){_0x4cbfaf=_0x4cbfaf||0x1f4;return function(_0x20978){logger[_0x5920('0x25')](_0x20978['stack']);if(_0x20978[_0x5920('0x26')]){delete _0x20978[_0x5920('0x26')];}_0x402e54[_0x5920('0x16')](_0x4cbfaf)[_0x5920('0x27')](_0x20978);};}exports[_0x5920('0x28')]=function(_0x206c1b,_0x5154b2){var _0x59267e={},_0x5b3a3f={},_0x3475a8={'count':0x0,'rows':[]};var _0x41d72e=_[_0x5920('0x29')](db['Campaign'][_0x5920('0x2a')],function(_0x130476){return{'name':_0x130476['fieldName'],'type':_0x130476[_0x5920('0x2b')]['key']};});_0x5b3a3f[_0x5920('0x2c')]=_[_0x5920('0x29')](_0x41d72e,_0x5920('0x26'));_0x5b3a3f[_0x5920('0x2d')]=_['keys'](_0x206c1b[_0x5920('0x2d')]);_0x5b3a3f[_0x5920('0x2e')]=_['intersection'](_0x5b3a3f['model'],_0x5b3a3f[_0x5920('0x2d')]);_0x59267e[_0x5920('0x2f')]=_['intersection'](_0x5b3a3f['model'],qs[_0x5920('0x30')](_0x206c1b['query']['fields']));_0x59267e['attributes']=_0x59267e[_0x5920('0x2f')]['length']?_0x59267e[_0x5920('0x2f')]:_0x5b3a3f[_0x5920('0x2c')];if(!_0x206c1b[_0x5920('0x2d')][_0x5920('0x31')](_0x5920('0x32'))){_0x59267e['limit']=qs[_0x5920('0x1a')](_0x206c1b[_0x5920('0x2d')][_0x5920('0x1a')]);_0x59267e[_0x5920('0x1c')]=qs['offset'](_0x206c1b[_0x5920('0x2d')][_0x5920('0x1c')]);}_0x59267e[_0x5920('0x33')]=qs[_0x5920('0x34')](_0x206c1b[_0x5920('0x2d')][_0x5920('0x34')]);_0x59267e[_0x5920('0x35')]=qs[_0x5920('0x2e')](_[_0x5920('0x36')](_0x206c1b[_0x5920('0x2d')],_0x5b3a3f['filters']),_0x41d72e);if(_0x206c1b[_0x5920('0x2d')]['filter']){_0x59267e[_0x5920('0x35')]=_[_0x5920('0x37')](_0x59267e['where'],{'$or':_['map'](_0x41d72e,function(_0x9a4d5e){if(_0x9a4d5e[_0x5920('0x2b')]!=='VIRTUAL'){var _0x437c89={};_0x437c89[_0x9a4d5e[_0x5920('0x26')]]={'$like':'%'+_0x206c1b[_0x5920('0x2d')]['filter']+'%'};return _0x437c89;}})});}_0x59267e=_[_0x5920('0x37')]({},_0x59267e,_0x206c1b['options']);var _0x355c4f={'where':_0x59267e[_0x5920('0x35')]};return db['Campaign'][_0x5920('0x1b')](_0x355c4f)[_0x5920('0x21')](function(_0x5c8a08){_0x3475a8[_0x5920('0x1b')]=_0x5c8a08;if(_0x206c1b[_0x5920('0x2d')][_0x5920('0x38')]){_0x59267e['include']=[{'all':!![]}];}return db['Campaign'][_0x5920('0x39')](_0x59267e);})['then'](function(_0x51cf32){_0x3475a8[_0x5920('0x3a')]=_0x51cf32;return _0x3475a8;})[_0x5920('0x21')](respondWithFilteredResult(_0x5154b2,_0x59267e))[_0x5920('0x3b')](handleError(_0x5154b2,null));};exports['show']=function(_0x573618,_0x13dfb7){var _0x10b424={'raw':![],'where':{'id':_0x573618[_0x5920('0x3c')]['id']}},_0x13d405={};_0x13d405[_0x5920('0x2c')]=_['keys'](db[_0x5920('0x3d')][_0x5920('0x2a')]);_0x13d405[_0x5920('0x2d')]=_[_0x5920('0x3e')](_0x573618['query']);_0x13d405[_0x5920('0x2e')]=_[_0x5920('0x3f')](_0x13d405[_0x5920('0x2c')],_0x13d405[_0x5920('0x2d')]);_0x10b424[_0x5920('0x2f')]=_[_0x5920('0x3f')](_0x13d405[_0x5920('0x2c')],qs[_0x5920('0x30')](_0x573618[_0x5920('0x2d')]['fields']));_0x10b424[_0x5920('0x2f')]=_0x10b424[_0x5920('0x2f')][_0x5920('0x40')]?_0x10b424['attributes']:_0x13d405[_0x5920('0x2c')];if(_0x573618['query']['includeAll']){_0x10b424[_0x5920('0x41')]=[{'all':!![]}];}_0x10b424=_['merge']({},_0x10b424,_0x573618['options']);return db['Campaign'][_0x5920('0x42')](_0x10b424)['then'](handleEntityNotFound(_0x13dfb7,null))[_0x5920('0x21')](respondWithResult(_0x13dfb7,null))[_0x5920('0x3b')](handleError(_0x13dfb7,null));};exports[_0x5920('0x43')]=function(_0x11f5ef,_0x4b7c90){return db[_0x5920('0x3d')][_0x5920('0x43')](_0x11f5ef['body'],{})[_0x5920('0x21')](function(_0x450005){var _0x1323f7=_0x11f5ef[_0x5920('0x44')][_0x5920('0x23')]({'plain':!![]});if(!_0x1323f7)throw new Error(_0x5920('0x45'));if(_0x1323f7['role']===_0x5920('0x44')){var _0x36eed7=_0x450005[_0x5920('0x23')]({'plain':!![]});var _0x49f1f2=_0x5920('0x24');return db['UserProfileSection']['find']({'where':{'name':_0x49f1f2,'userProfileId':_0x1323f7[_0x5920('0x46')]},'raw':!![]})[_0x5920('0x21')](function(_0x4b293d){if(_0x4b293d&&_0x4b293d[_0x5920('0x47')]===0x0){return db[_0x5920('0x48')]['create']({'name':_0x36eed7['name'],'resourceId':_0x36eed7['id'],'type':_0x4b293d[_0x5920('0x26')],'sectionId':_0x4b293d['id']},{})[_0x5920('0x21')](function(){return _0x450005;});}else{return _0x450005;}})[_0x5920('0x3b')](function(_0x4e2102){logger['error'](_0x5920('0x49'),_0x4e2102);throw _0x4e2102;});}return _0x450005;})[_0x5920('0x21')](respondWithResult(_0x4b7c90,0xc9))['catch'](handleError(_0x4b7c90,null));};exports[_0x5920('0x4a')]=function(_0xea0d81,_0x5160d5){var _0x321c26={'where':{'id':_0xea0d81[_0x5920('0x3c')]['id']}},_0x1c7d94={};_0x1c7d94[_0x5920('0x2c')]=_['keys'](db[_0x5920('0x3d')][_0x5920('0x2a')]);_0x321c26[_0x5920('0x2f')]=_[_0x5920('0x3f')](_0x1c7d94[_0x5920('0x2c')],qs['fields'](_0xea0d81[_0x5920('0x2d')][_0x5920('0x30')]));_0x321c26[_0x5920('0x2f')]=_0x321c26[_0x5920('0x2f')][_0x5920('0x40')]?_0x321c26[_0x5920('0x2f')]:_0x1c7d94[_0x5920('0x2c')];if(_0xea0d81[_0x5920('0x2d')]['includeAll']){_0x321c26[_0x5920('0x41')]=[{'all':!![]}];}_0x321c26=_[_0x5920('0x37')]({},_0x321c26,_0xea0d81[_0x5920('0x4b')]);return db[_0x5920('0x3d')][_0x5920('0x42')](_0x321c26)[_0x5920('0x21')](handleEntityNotFound(_0x5160d5,null))[_0x5920('0x21')](function(_0x31d619){if(_0x31d619){var _0x45a3a7=_0x31d619['get']({'plain':!![]});_0x45a3a7=qs[_0x5920('0x4c')](_0x45a3a7,['id',_0x5920('0x4d'),_0x5920('0x4e')]);_0xea0d81['body']=_['omit'](_0xea0d81[_0x5920('0x4f')],['id','createdAt','updatedAt']);return db[_0x5920('0x3d')][_0x5920('0x43')](_[_0x5920('0x37')](_0x45a3a7,_0xea0d81[_0x5920('0x4f')]),{'include':_0xea0d81[_0x5920('0x2d')][_0x5920('0x38')]?[{'all':!![]}]:undefined})[_0x5920('0x21')](function(_0x2aee8a){var _0x42efe1=_0xea0d81[_0x5920('0x44')][_0x5920('0x23')]({'plain':!![]});if(!_0x42efe1)throw new Error(_0x5920('0x45'));if(_0x42efe1[_0x5920('0x50')]===_0x5920('0x44')){var _0x4fc4a7=_0x2aee8a[_0x5920('0x23')]({'plain':!![]});var _0x5b5b5b=_0x5920('0x24');return db['UserProfileSection']['find']({'where':{'name':_0x5b5b5b,'userProfileId':_0x42efe1[_0x5920('0x46')]},'raw':!![]})[_0x5920('0x21')](function(_0x373f81){if(_0x373f81&&_0x373f81['autoAssociation']===0x0){return db[_0x5920('0x48')]['create']({'name':_0x4fc4a7['name'],'resourceId':_0x4fc4a7['id'],'type':_0x373f81[_0x5920('0x26')],'sectionId':_0x373f81['id']},{})[_0x5920('0x21')](function(){return _0x2aee8a;});}else{return _0x2aee8a;}})[_0x5920('0x3b')](function(_0x3953f5){logger['error'](_0x5920('0x49'),_0x3953f5);throw _0x3953f5;});}return _0x2aee8a;});}})[_0x5920('0x21')](respondWithResult(_0x5160d5,0xc9))[_0x5920('0x3b')](handleError(_0x5160d5,null));};exports['update']=function(_0x86f647,_0x183248){if(_0x86f647[_0x5920('0x4f')]['id']){delete _0x86f647[_0x5920('0x4f')]['id'];}return db[_0x5920('0x3d')]['find']({'where':{'id':_0x86f647['params']['id']}})[_0x5920('0x21')](handleEntityNotFound(_0x183248,null))['then'](saveUpdates(_0x86f647[_0x5920('0x4f')],null))[_0x5920('0x21')](respondWithResult(_0x183248,null))[_0x5920('0x3b')](handleError(_0x183248,null));};exports[_0x5920('0x22')]=function(_0x2d237a,_0x1327b4){return db[_0x5920('0x3d')][_0x5920('0x42')]({'where':{'id':_0x2d237a[_0x5920('0x3c')]['id']}})[_0x5920('0x21')](handleEntityNotFound(_0x1327b4,null))[_0x5920('0x21')](removeEntity(_0x1327b4,null))[_0x5920('0x3b')](handleError(_0x1327b4,null));};exports['getHoppers']=function(_0x2fc7ac,_0x5780a8,_0x3b725a){var _0x18f42b={'raw':!![],'where':{}};var _0xcdf447={};var _0x34b1c6={'count':0x0,'rows':[]};return db[_0x5920('0x3d')][_0x5920('0x51')]({'where':{'id':_0x2fc7ac[_0x5920('0x3c')]['id']}})[_0x5920('0x21')](handleEntityNotFound(_0x5780a8,null))['then'](function(_0x5b563d){if(_0x5b563d){_0xcdf447[_0x5920('0x2c')]=_['keys'](db['CmHopper']['rawAttributes']);_0xcdf447[_0x5920('0x2d')]=_[_0x5920('0x3e')](_0x2fc7ac[_0x5920('0x2d')]);_0xcdf447['filters']=_['intersection'](_0xcdf447[_0x5920('0x2c')],_0xcdf447['query']);_0x18f42b[_0x5920('0x2f')]=_['intersection'](_0xcdf447['model'],qs[_0x5920('0x30')](_0x2fc7ac[_0x5920('0x2d')][_0x5920('0x30')]));_0x18f42b[_0x5920('0x2f')]=_0x18f42b[_0x5920('0x2f')][_0x5920('0x40')]?_0x18f42b['attributes']:_0xcdf447[_0x5920('0x2c')];if(!_0x2fc7ac[_0x5920('0x2d')][_0x5920('0x31')](_0x5920('0x32'))){_0x18f42b[_0x5920('0x1a')]=qs[_0x5920('0x1a')](_0x2fc7ac[_0x5920('0x2d')][_0x5920('0x1a')]);_0x18f42b[_0x5920('0x1c')]=qs[_0x5920('0x1c')](_0x2fc7ac['query'][_0x5920('0x1c')]);}_0x18f42b[_0x5920('0x33')]=qs[_0x5920('0x34')](_0x2fc7ac[_0x5920('0x2d')][_0x5920('0x34')]);_0x18f42b['where']=qs['filters'](_[_0x5920('0x36')](_0x2fc7ac['query'],_0xcdf447['filters']));_0x18f42b['where'][_0x5920('0x52')]=_0x5b563d['id'];if(_0x2fc7ac[_0x5920('0x2d')][_0x5920('0x53')]){_0x18f42b['where']=_['merge'](_0x18f42b['where'],{'$or':_[_0x5920('0x29')](_0x18f42b['attributes'],function(_0x1f9a2d){var _0x3e9276={};_0x3e9276[_0x1f9a2d]={'$like':'%'+_0x2fc7ac[_0x5920('0x2d')][_0x5920('0x53')]+'%'};return _0x3e9276;})});}_0x18f42b=_[_0x5920('0x37')]({},_0x18f42b,_0x2fc7ac[_0x5920('0x4b')]);return db[_0x5920('0x54')][_0x5920('0x1b')]({'where':_0x18f42b[_0x5920('0x35')]})['then'](function(_0x406d14){_0x34b1c6[_0x5920('0x1b')]=_0x406d14;if(_0x2fc7ac[_0x5920('0x2d')][_0x5920('0x38')]){_0x18f42b[_0x5920('0x41')]=[{'all':!![]}];}return db[_0x5920('0x54')][_0x5920('0x39')](_0x18f42b);})[_0x5920('0x21')](function(_0x309b66){_0x34b1c6[_0x5920('0x3a')]=_0x309b66;return _0x34b1c6;});}})[_0x5920('0x21')](respondWithFilteredResult(_0x5780a8,_0x18f42b))[_0x5920('0x3b')](handleError(_0x5780a8,null));};exports[_0x5920('0x55')]=function(_0x1df7fa,_0x400df5,_0x870fba){var _0x530253={'raw':!![],'where':{}};var _0x4d11f6={};var _0x1d066c={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x1df7fa[_0x5920('0x3c')]['id']}})['then'](handleEntityNotFound(_0x400df5,null))['then'](function(_0x280cac){if(_0x280cac){_0x4d11f6[_0x5920('0x2c')]=_['keys'](db[_0x5920('0x56')]['rawAttributes']);_0x4d11f6[_0x5920('0x2d')]=_[_0x5920('0x3e')](_0x1df7fa[_0x5920('0x2d')]);_0x4d11f6[_0x5920('0x2e')]=_[_0x5920('0x3f')](_0x4d11f6[_0x5920('0x2c')],_0x4d11f6['query']);_0x530253['attributes']=_[_0x5920('0x3f')](_0x4d11f6[_0x5920('0x2c')],qs[_0x5920('0x30')](_0x1df7fa[_0x5920('0x2d')][_0x5920('0x30')]));_0x530253['attributes']=_0x530253[_0x5920('0x2f')][_0x5920('0x40')]?_0x530253['attributes']:_0x4d11f6[_0x5920('0x2c')];if(!_0x1df7fa[_0x5920('0x2d')][_0x5920('0x31')]('nolimit')){_0x530253[_0x5920('0x1a')]=qs[_0x5920('0x1a')](_0x1df7fa[_0x5920('0x2d')][_0x5920('0x1a')]);_0x530253[_0x5920('0x1c')]=qs[_0x5920('0x1c')](_0x1df7fa[_0x5920('0x2d')][_0x5920('0x1c')]);}_0x530253[_0x5920('0x33')]=qs[_0x5920('0x34')](_0x1df7fa[_0x5920('0x2d')][_0x5920('0x34')]);_0x530253[_0x5920('0x35')]=qs[_0x5920('0x2e')](_['pick'](_0x1df7fa[_0x5920('0x2d')],_0x4d11f6[_0x5920('0x2e')]));_0x530253[_0x5920('0x35')][_0x5920('0x52')]=_0x280cac['id'];if(_0x1df7fa['query']['filter']){_0x530253[_0x5920('0x35')]=_['merge'](_0x530253['where'],{'$or':_[_0x5920('0x29')](_0x530253[_0x5920('0x2f')],function(_0x114c2f){var _0x523116={};_0x523116[_0x114c2f]={'$like':'%'+_0x1df7fa['query'][_0x5920('0x53')]+'%'};return _0x523116;})});}_0x530253=_[_0x5920('0x37')]({},_0x530253,_0x1df7fa[_0x5920('0x4b')]);return db[_0x5920('0x56')]['count']({'where':_0x530253[_0x5920('0x35')]})[_0x5920('0x21')](function(_0x476820){_0x1d066c[_0x5920('0x1b')]=_0x476820;if(_0x1df7fa[_0x5920('0x2d')][_0x5920('0x38')]){_0x530253['include']=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x530253);})[_0x5920('0x21')](function(_0x41e25a){_0x1d066c[_0x5920('0x3a')]=_0x41e25a;return _0x1d066c;});}})[_0x5920('0x21')](respondWithFilteredResult(_0x400df5,_0x530253))['catch'](handleError(_0x400df5,null));};exports['getHopperFinals']=function(_0x419347,_0x363ce1,_0x41e076){var _0x173861={'raw':!![],'where':{}};var _0x4ed9a0={};var _0xd55684={'count':0x0,'rows':[]};return db[_0x5920('0x3d')][_0x5920('0x51')]({'where':{'id':_0x419347[_0x5920('0x3c')]['id']}})['then'](handleEntityNotFound(_0x363ce1,null))[_0x5920('0x21')](function(_0x50257b){if(_0x50257b){_0x4ed9a0[_0x5920('0x2c')]=_['keys'](db[_0x5920('0x57')][_0x5920('0x2a')]);_0x4ed9a0[_0x5920('0x2d')]=_[_0x5920('0x3e')](_0x419347[_0x5920('0x2d')]);_0x4ed9a0['filters']=_[_0x5920('0x3f')](_0x4ed9a0[_0x5920('0x2c')],_0x4ed9a0[_0x5920('0x2d')]);_0x173861[_0x5920('0x2f')]=_[_0x5920('0x3f')](_0x4ed9a0['model'],qs[_0x5920('0x30')](_0x419347[_0x5920('0x2d')][_0x5920('0x30')]));_0x173861[_0x5920('0x2f')]=_0x173861[_0x5920('0x2f')][_0x5920('0x40')]?_0x173861['attributes']:_0x4ed9a0['model'];if(!_0x419347[_0x5920('0x2d')][_0x5920('0x31')](_0x5920('0x32'))){_0x173861['limit']=qs['limit'](_0x419347['query'][_0x5920('0x1a')]);_0x173861[_0x5920('0x1c')]=qs['offset'](_0x419347[_0x5920('0x2d')][_0x5920('0x1c')]);}_0x173861[_0x5920('0x33')]=qs[_0x5920('0x34')](_0x419347['query'][_0x5920('0x34')]);_0x173861[_0x5920('0x35')]=qs[_0x5920('0x2e')](_['pick'](_0x419347[_0x5920('0x2d')],_0x4ed9a0[_0x5920('0x2e')]));_0x173861['where'][_0x5920('0x52')]=_0x50257b['id'];if(_0x419347[_0x5920('0x2d')][_0x5920('0x53')]){_0x173861[_0x5920('0x35')]=_['merge'](_0x173861[_0x5920('0x35')],{'$or':_[_0x5920('0x29')](_0x173861['attributes'],function(_0x44666b){var _0x595048={};_0x595048[_0x44666b]={'$like':'%'+_0x419347[_0x5920('0x2d')][_0x5920('0x53')]+'%'};return _0x595048;})});}_0x173861=_[_0x5920('0x37')]({},_0x173861,_0x419347[_0x5920('0x4b')]);return db['CmHopperFinal'][_0x5920('0x1b')]({'where':_0x173861[_0x5920('0x35')]})['then'](function(_0x4f694a){_0xd55684[_0x5920('0x1b')]=_0x4f694a;if(_0x419347[_0x5920('0x2d')][_0x5920('0x38')]){_0x173861[_0x5920('0x41')]=[{'all':!![]}];}return db[_0x5920('0x57')][_0x5920('0x39')](_0x173861);})[_0x5920('0x21')](function(_0x3f3edc){_0xd55684['rows']=_0x3f3edc;return _0xd55684;});}})['then'](respondWithFilteredResult(_0x363ce1,_0x173861))[_0x5920('0x3b')](handleError(_0x363ce1,null));};exports[_0x5920('0x58')]=function(_0x36fffa,_0x3108b9,_0x4f5c04){var _0x1326d0={'raw':!![],'where':{}};var _0x2108f9={};var _0x48fc25={'count':0x0,'rows':[]};return db[_0x5920('0x3d')][_0x5920('0x51')]({'where':{'id':_0x36fffa[_0x5920('0x3c')]['id']}})[_0x5920('0x21')](handleEntityNotFound(_0x3108b9,null))[_0x5920('0x21')](function(_0xaed531){if(_0xaed531){_0x2108f9[_0x5920('0x2c')]=_[_0x5920('0x3e')](db[_0x5920('0x59')][_0x5920('0x2a')]);_0x2108f9['query']=_['keys'](_0x36fffa[_0x5920('0x2d')]);_0x2108f9[_0x5920('0x2e')]=_[_0x5920('0x3f')](_0x2108f9['model'],_0x2108f9[_0x5920('0x2d')]);_0x1326d0[_0x5920('0x2f')]=_[_0x5920('0x3f')](_0x2108f9['model'],qs[_0x5920('0x30')](_0x36fffa[_0x5920('0x2d')]['fields']));_0x1326d0[_0x5920('0x2f')]=_0x1326d0[_0x5920('0x2f')][_0x5920('0x40')]?_0x1326d0['attributes']:_0x2108f9[_0x5920('0x2c')];if(!_0x36fffa['query']['hasOwnProperty'](_0x5920('0x32'))){_0x1326d0[_0x5920('0x1a')]=qs[_0x5920('0x1a')](_0x36fffa[_0x5920('0x2d')][_0x5920('0x1a')]);_0x1326d0[_0x5920('0x1c')]=qs[_0x5920('0x1c')](_0x36fffa[_0x5920('0x2d')][_0x5920('0x1c')]);}_0x1326d0[_0x5920('0x33')]=qs[_0x5920('0x34')](_0x36fffa[_0x5920('0x2d')][_0x5920('0x34')]);_0x1326d0[_0x5920('0x35')]=qs[_0x5920('0x2e')](_[_0x5920('0x36')](_0x36fffa[_0x5920('0x2d')],_0x2108f9[_0x5920('0x2e')]));_0x1326d0['where']['CampaignId']=_0xaed531['id'];if(_0x36fffa[_0x5920('0x2d')][_0x5920('0x53')]){_0x1326d0[_0x5920('0x35')]=_[_0x5920('0x37')](_0x1326d0['where'],{'$or':_[_0x5920('0x29')](_0x1326d0['attributes'],function(_0x27f689){var _0x43294d={};_0x43294d[_0x27f689]={'$like':'%'+_0x36fffa['query'][_0x5920('0x53')]+'%'};return _0x43294d;})});}_0x1326d0=_[_0x5920('0x37')]({},_0x1326d0,_0x36fffa[_0x5920('0x4b')]);return db[_0x5920('0x59')][_0x5920('0x1b')]({'where':_0x1326d0[_0x5920('0x35')]})[_0x5920('0x21')](function(_0x4fddcf){_0x48fc25['count']=_0x4fddcf;if(_0x36fffa[_0x5920('0x2d')]['includeAll']){_0x1326d0[_0x5920('0x41')]=[{'all':!![]}];}return db[_0x5920('0x59')][_0x5920('0x39')](_0x1326d0);})[_0x5920('0x21')](function(_0x6b1f9f){_0x48fc25[_0x5920('0x3a')]=_0x6b1f9f;return _0x48fc25;});}})[_0x5920('0x21')](respondWithFilteredResult(_0x3108b9,_0x1326d0))[_0x5920('0x3b')](handleError(_0x3108b9,null));};exports[_0x5920('0x5a')]=function(_0x3b8c4b,_0x343834,_0x207412){var _0x144326={};var _0x4c52a8={};var _0x4bd427;var _0xd4b10c;return db[_0x5920('0x3d')][_0x5920('0x51')]({'where':{'id':_0x3b8c4b['params']['id']}})[_0x5920('0x21')](handleEntityNotFound(_0x343834,null))[_0x5920('0x21')](function(_0x4e7a4e){if(_0x4e7a4e){_0x4bd427=_0x4e7a4e;_0x4c52a8[_0x5920('0x2c')]=_['keys'](db[_0x5920('0x5b')][_0x5920('0x2a')]);_0x4c52a8[_0x5920('0x2d')]=_[_0x5920('0x3e')](_0x3b8c4b[_0x5920('0x2d')]);_0x4c52a8[_0x5920('0x2e')]=_[_0x5920('0x3f')](_0x4c52a8[_0x5920('0x2c')],_0x4c52a8[_0x5920('0x2d')]);_0x144326[_0x5920('0x2f')]=_[_0x5920('0x3f')](_0x4c52a8['model'],qs[_0x5920('0x30')](_0x3b8c4b['query'][_0x5920('0x30')]));_0x144326[_0x5920('0x2f')]=_0x144326[_0x5920('0x2f')][_0x5920('0x40')]?_0x144326[_0x5920('0x2f')]:_0x4c52a8['model'];_0x144326[_0x5920('0x33')]=qs[_0x5920('0x34')](_0x3b8c4b[_0x5920('0x2d')][_0x5920('0x34')]);_0x144326['where']=qs['filters'](_[_0x5920('0x36')](_0x3b8c4b[_0x5920('0x2d')],_0x4c52a8['filters']));if(_0x3b8c4b[_0x5920('0x2d')][_0x5920('0x53')]){_0x144326['where']=_[_0x5920('0x37')](_0x144326[_0x5920('0x35')],{'$or':_['map'](_0x144326['attributes'],function(_0x39e55a){var _0x23971e={};_0x23971e[_0x39e55a]={'$like':'%'+_0x3b8c4b[_0x5920('0x2d')][_0x5920('0x53')]+'%'};return _0x23971e;})});}_0x144326=_[_0x5920('0x37')]({},_0x144326,_0x3b8c4b[_0x5920('0x4b')]);return _0x4bd427[_0x5920('0x5a')](_0x144326);}})['then'](function(_0x257070){if(_0x257070){_0xd4b10c=_0x257070['length'];if(!_0x3b8c4b[_0x5920('0x2d')][_0x5920('0x31')](_0x5920('0x32'))){_0x144326[_0x5920('0x1a')]=qs[_0x5920('0x1a')](_0x3b8c4b['query'][_0x5920('0x1a')]);_0x144326[_0x5920('0x1c')]=qs[_0x5920('0x1c')](_0x3b8c4b['query'][_0x5920('0x1c')]);}return _0x4bd427[_0x5920('0x5a')](_0x144326);}})['then'](function(_0x371628){if(_0x371628){return _0x371628?{'count':_0xd4b10c,'rows':_0x371628}:null;}})[_0x5920('0x21')](respondWithResult(_0x343834,null))[_0x5920('0x3b')](handleError(_0x343834,null));};exports['addLists']=function(_0x470660,_0x56e96f,_0x5f16e9){var _0x408001,_0x29a233;var _0x2e3988=[];var _0x4dd875=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return db[_0x5920('0x3d')][_0x5920('0x42')]({'where':{'id':_0x470660[_0x5920('0x3c')]['id']}})['then'](handleEntityNotFound(_0x56e96f,null))[_0x5920('0x21')](function(_0x2c0bc6){if(_0x2c0bc6){_0x29a233=_0x2c0bc6;return _0x2c0bc6['addLists'](_0x470660[_0x5920('0x4f')][_0x5920('0x5c')],_[_0x5920('0x4c')](_0x470660[_0x5920('0x4f')],[_0x5920('0x5c'),'id'])||{});}return null;})[_0x5920('0x5d')](function(_0x4b117e){var _0x343d5d;var _0x15721d;_0x408001=_0x4b117e||[];var _0x878d3=[];if(_0x4b117e){for(var _0x16c39a=0x0;_0x16c39a<_0x4b117e[_0x5920('0x40')];_0x16c39a+=0x1){var _0x494b76=_0x4b117e[_0x16c39a][_0x5920('0x23')]({'plain':!![]});_0x29a233[_0x5920('0x5e')]=_0x470660[_0x5920('0x4f')][_0x5920('0x5e')]?_0x470660['body'][_0x5920('0x5e')]:_0x29a233['dialCheckDuplicateType'];switch(_0x29a233[_0x5920('0x5e')]){case _0x5920('0x5f'):_0x343d5d=squel[_0x5920('0x60')]()[_0x5920('0x61')](_0x5920('0x62'))[_0x5920('0x63')]([_0x5920('0x64'),_0x5920('0x65'),_0x5920('0x66'),_0x5920('0x67'),_0x5920('0x52'),_0x5920('0x4d'),_0x5920('0x4e')],squel[_0x5920('0x68')]()[_0x5920('0x69')](_0x5920('0x64'),_0x5920('0x64'))['field'](_0x5920('0x6a'),_0x5920('0x65'))[_0x5920('0x69')]('id',_0x5920('0x66'))[_0x5920('0x69')](_0x494b76[_0x5920('0x6b')][_0x5920('0x6c')](),'ListId')[_0x5920('0x69')](_0x470660[_0x5920('0x3c')]['id'][_0x5920('0x6c')](),'CampaignId')[_0x5920('0x69')]('\x27'+_0x4dd875+'\x27',_0x5920('0x4d'))[_0x5920('0x69')]('\x27'+_0x4dd875+'\x27',_0x5920('0x4e'))['from']('cm_contacts')[_0x5920('0x35')]('deletedAt\x20IS\x20NULL')[_0x5920('0x35')](_0x5920('0x6d'),_0x494b76[_0x5920('0x6b')]['toString']())[_0x5920('0x35')](_0x5920('0x6e'))['where'](_0x5920('0x6f'),squel[_0x5920('0x68')]()[_0x5920('0x69')](_0x5920('0x70'))[_0x5920('0x71')]('cm_hopper_final')[_0x5920('0x35')](_0x5920('0x72'),_0x470660['params']['id'][_0x5920('0x6c')]()))[_0x5920('0x35')](_0x5920('0x6f'),squel['select']()[_0x5920('0x69')](_0x5920('0x73'))[_0x5920('0x71')]('cm_hopper')[_0x5920('0x35')](_0x5920('0x72'),_0x470660[_0x5920('0x3c')]['id'][_0x5920('0x6c')]())))[_0x5920('0x6c')]();break;case _0x5920('0x74'):_0x343d5d=squel[_0x5920('0x60')]()['into'](_0x5920('0x62'))[_0x5920('0x63')]([_0x5920('0x64'),_0x5920('0x65'),_0x5920('0x66'),_0x5920('0x67'),_0x5920('0x52'),'createdAt',_0x5920('0x4e')],squel['select']()[_0x5920('0x69')](_0x5920('0x64'),'phone')[_0x5920('0x69')](_0x5920('0x6a'),_0x5920('0x65'))[_0x5920('0x69')]('id',_0x5920('0x66'))[_0x5920('0x69')](_0x494b76['CmListId'][_0x5920('0x6c')](),'ListId')[_0x5920('0x69')](_0x470660[_0x5920('0x3c')]['id']['toString'](),'CampaignId')[_0x5920('0x69')]('\x27'+_0x4dd875+'\x27','createdAt')[_0x5920('0x69')]('\x27'+_0x4dd875+'\x27',_0x5920('0x4e'))['from'](_0x5920('0x75'))[_0x5920('0x35')](_0x5920('0x76'))[_0x5920('0x35')](_0x5920('0x6d'),_0x494b76[_0x5920('0x6b')][_0x5920('0x6c')]())[_0x5920('0x35')](_0x5920('0x6e'))['where'](_0x5920('0x6f'),squel[_0x5920('0x68')]()[_0x5920('0x69')](_0x5920('0x73'))[_0x5920('0x71')](_0x5920('0x62'))['where']('CampaignId\x20=\x20?',_0x470660[_0x5920('0x3c')]['id'][_0x5920('0x6c')]())))['toString']();break;default:_0x343d5d=squel[_0x5920('0x60')]()[_0x5920('0x61')](_0x5920('0x62'))[_0x5920('0x63')]([_0x5920('0x64'),_0x5920('0x65'),_0x5920('0x66'),'ListId',_0x5920('0x52'),_0x5920('0x4d'),_0x5920('0x4e')],squel[_0x5920('0x68')]()['field'](_0x5920('0x64'),_0x5920('0x64'))[_0x5920('0x69')](_0x5920('0x6a'),_0x5920('0x65'))['field']('id',_0x5920('0x66'))['field'](_0x494b76[_0x5920('0x6b')][_0x5920('0x6c')](),_0x5920('0x67'))[_0x5920('0x69')](_0x470660[_0x5920('0x3c')]['id'][_0x5920('0x6c')](),'CampaignId')[_0x5920('0x69')]('\x27'+_0x4dd875+'\x27','createdAt')[_0x5920('0x69')]('\x27'+_0x4dd875+'\x27',_0x5920('0x4e'))[_0x5920('0x71')](_0x5920('0x75'))['where'](_0x5920('0x76'))[_0x5920('0x35')]('ListId\x20=\x20?',_0x494b76[_0x5920('0x6b')]['toString']())[_0x5920('0x35')](_0x5920('0x6e')))[_0x5920('0x6c')]();}_0x15721d=squel[_0x5920('0x60')]()[_0x5920('0x61')](_0x5920('0x77'))[_0x5920('0x63')]([_0x5920('0x78'),_0x5920('0x65'),'phone',_0x5920('0x79'),'createdAt',_0x5920('0x4e')],squel[_0x5920('0x68')]()[_0x5920('0x69')]('h.id','id')[_0x5920('0x69')](_0x5920('0x6a'),_0x5920('0x65'))[_0x5920('0x69')](_0x5920('0x7a'),_0x5920('0x64'))[_0x5920('0x69')](_0x5920('0x7b'),_0x5920('0x79'))['field']('\x27'+_0x4dd875+'\x27',_0x5920('0x4d'))[_0x5920('0x69')]('\x27'+_0x4dd875+'\x27',_0x5920('0x4e'))[_0x5920('0x71')](_0x5920('0x7c'),'ci')[_0x5920('0x7d')](_0x5920('0x62'),'h',_0x5920('0x7e'))[_0x5920('0x35')](_0x5920('0x7f'),_0x494b76['CmListId'][_0x5920('0x6c')]())[_0x5920('0x35')](_0x5920('0x80'),_0x470660[_0x5920('0x3c')]['id']['toString']())[_0x5920('0x35')](_0x5920('0x81'),_0x4dd875))['toString']();_0x878d3[_0x5920('0x82')](db[_0x5920('0x83')][_0x5920('0x2d')](_0x343d5d));_0x2e3988['push'](db[_0x5920('0x83')][_0x5920('0x2d')](_0x15721d));}return BPromise[_0x5920('0x84')](_0x878d3);}})[_0x5920('0x21')](function(){return BPromise['all'](_0x2e3988);})[_0x5920('0x21')](function(){return _0x408001;})['then'](respondWithResult(_0x56e96f,null))[_0x5920('0x3b')](handleError(_0x56e96f,null));};exports[_0x5920('0x85')]=function(_0x429713,_0x25c3fe,_0x3eb42c){return db[_0x5920('0x3d')]['find']({'where':{'id':_0x429713[_0x5920('0x3c')]['id']}})[_0x5920('0x21')](handleEntityNotFound(_0x25c3fe,null))[_0x5920('0x21')](function(_0x1b5f8a){if(_0x1b5f8a){return _0x1b5f8a[_0x5920('0x85')](_0x429713[_0x5920('0x2d')][_0x5920('0x5c')]);}})['then'](function(_0x5f1c03){if(_0x5f1c03){return db[_0x5920('0x54')][_0x5920('0x22')]({'where':{'ListId':_0x429713[_0x5920('0x2d')][_0x5920('0x5c')],'CampaignId':_0x429713[_0x5920('0x3c')]['id']}})['then'](function(){return _0x5f1c03;});}})[_0x5920('0x21')](respondWithStatusCode(_0x25c3fe,null))[_0x5920('0x3b')](handleError(_0x25c3fe,null));};exports[_0x5920('0x86')]=function(_0x543caf,_0x2be274,_0x4a1de7){var _0x1474e0={};var _0x5023f1={};var _0x17b2c7;var _0x4c8c81;return db['Campaign'][_0x5920('0x51')]({'where':{'id':_0x543caf[_0x5920('0x3c')]['id']}})[_0x5920('0x21')](handleEntityNotFound(_0x2be274,null))[_0x5920('0x21')](function(_0x2ae6b5){if(_0x2ae6b5){_0x17b2c7=_0x2ae6b5;_0x5023f1[_0x5920('0x2c')]=_['keys'](db[_0x5920('0x5b')][_0x5920('0x2a')]);_0x5023f1[_0x5920('0x2d')]=_['keys'](_0x543caf[_0x5920('0x2d')]);_0x5023f1[_0x5920('0x2e')]=_[_0x5920('0x3f')](_0x5023f1[_0x5920('0x2c')],_0x5023f1[_0x5920('0x2d')]);_0x1474e0[_0x5920('0x2f')]=_['intersection'](_0x5023f1['model'],qs['fields'](_0x543caf[_0x5920('0x2d')]['fields']));_0x1474e0[_0x5920('0x2f')]=_0x1474e0['attributes'][_0x5920('0x40')]?_0x1474e0['attributes']:_0x5023f1[_0x5920('0x2c')];_0x1474e0['order']=qs[_0x5920('0x34')](_0x543caf[_0x5920('0x2d')][_0x5920('0x34')]);_0x1474e0[_0x5920('0x35')]=qs[_0x5920('0x2e')](_[_0x5920('0x36')](_0x543caf[_0x5920('0x2d')],_0x5023f1[_0x5920('0x2e')]));if(_0x543caf[_0x5920('0x2d')][_0x5920('0x53')]){_0x1474e0[_0x5920('0x35')]=_['merge'](_0x1474e0[_0x5920('0x35')],{'$or':_[_0x5920('0x29')](_0x1474e0[_0x5920('0x2f')],function(_0x2180d8){var _0x185e71={};_0x185e71[_0x2180d8]={'$like':'%'+_0x543caf[_0x5920('0x2d')][_0x5920('0x53')]+'%'};return _0x185e71;})});}_0x1474e0=_[_0x5920('0x37')]({},_0x1474e0,_0x543caf['options']);return _0x17b2c7[_0x5920('0x86')](_0x1474e0);}})['then'](function(_0x2abd85){if(_0x2abd85){_0x4c8c81=_0x2abd85[_0x5920('0x40')];if(!_0x543caf[_0x5920('0x2d')][_0x5920('0x31')](_0x5920('0x32'))){_0x1474e0['limit']=qs['limit'](_0x543caf[_0x5920('0x2d')][_0x5920('0x1a')]);_0x1474e0['offset']=qs[_0x5920('0x1c')](_0x543caf[_0x5920('0x2d')]['offset']);}return _0x17b2c7[_0x5920('0x86')](_0x1474e0);}})[_0x5920('0x21')](function(_0x20a777){if(_0x20a777){return _0x20a777?{'count':_0x4c8c81,'rows':_0x20a777}:null;}})['then'](respondWithResult(_0x2be274,null))[_0x5920('0x3b')](handleError(_0x2be274,null));};exports['addBlackLists']=function(_0x38fcab,_0x47903d,_0x4bf8e7){var _0x181619,_0x331499;var _0x3643ca=[];var _0xd9cd16=moment()['format'](_0x5920('0x87'));return db['Campaign'][_0x5920('0x42')]({'where':{'id':_0x38fcab[_0x5920('0x3c')]['id']}})[_0x5920('0x21')](handleEntityNotFound(_0x47903d,null))[_0x5920('0x21')](function(_0x35073d){if(_0x35073d){_0x331499=_0x35073d;return _0x35073d[_0x5920('0x88')](_0x38fcab[_0x5920('0x4f')][_0x5920('0x5c')],_['omit'](_0x38fcab['body'],[_0x5920('0x5c'),'id'])||{});}return null;})[_0x5920('0x5d')](function(_0x9f55bd){var _0x50b289;var _0x186330;_0x181619=_0x9f55bd||[];var _0x113641=[];if(_0x9f55bd){for(var _0x304117=0x0;_0x304117<_0x9f55bd['length'];_0x304117+=0x1){var _0x446b51=_0x9f55bd[_0x304117]['get']({'plain':!![]});_0x50b289=squel['insert']()[_0x5920('0x61')](_0x5920('0x89'))['fromQuery']([_0x5920('0x64'),_0x5920('0x66'),_0x5920('0x67'),'CampaignId','createdAt',_0x5920('0x4e')],squel[_0x5920('0x68')]()[_0x5920('0x69')](_0x5920('0x64'),_0x5920('0x64'))[_0x5920('0x69')]('id','ContactId')[_0x5920('0x69')](_0x446b51[_0x5920('0x6b')]['toString'](),_0x5920('0x67'))[_0x5920('0x69')](_0x38fcab['params']['id'][_0x5920('0x6c')](),'CampaignId')[_0x5920('0x69')]('NOW()',_0x5920('0x4d'))[_0x5920('0x69')](_0x5920('0x6a'),_0x5920('0x4e'))[_0x5920('0x71')](_0x5920('0x75'))[_0x5920('0x35')](_0x5920('0x76'))[_0x5920('0x35')]('ListId\x20=\x20?',_0x446b51[_0x5920('0x6b')][_0x5920('0x6c')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x5920('0x6c')]();_0x113641[_0x5920('0x82')](db['sequelize'][_0x5920('0x2d')](_0x50b289));}return BPromise[_0x5920('0x84')](_0x113641);}})[_0x5920('0x21')](function(){return _0x181619;})[_0x5920('0x21')](respondWithResult(_0x47903d,null))[_0x5920('0x3b')](handleError(_0x47903d,null));};exports[_0x5920('0x8a')]=function(_0xb27cbd,_0x161a4a,_0x434f9b){return db[_0x5920('0x3d')][_0x5920('0x42')]({'where':{'id':_0xb27cbd['params']['id']}})['then'](handleEntityNotFound(_0x161a4a,null))[_0x5920('0x21')](function(_0x55320f){if(_0x55320f){return _0x55320f[_0x5920('0x8a')](_0xb27cbd[_0x5920('0x2d')][_0x5920('0x5c')]);}})[_0x5920('0x21')](function(_0x66822a){if(_0x66822a){return db['CmHopperBlack'][_0x5920('0x22')]({'where':{'ListId':_0xb27cbd[_0x5920('0x2d')]['ids'],'CampaignId':_0xb27cbd[_0x5920('0x3c')]['id']}})[_0x5920('0x21')](function(){return _0x66822a;});}})[_0x5920('0x21')](respondWithStatusCode(_0x161a4a,null))['catch'](handleError(_0x161a4a,null));}; \ No newline at end of file +var _0x8dab=['findOne','CmHopperBlack','CmList','getLists','addLists','format','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','select','field','NOW()','toString','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','CmListId','deletedAt\x20IS\x20NULL','fromQuery','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','cm_contact_has_items','join','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','stack','name','send','index','map','Campaign','rawAttributes','type','model','query','keys','attributes','intersection','fields','nolimit','sort','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','length','omit','createdAt','updatedAt','autoAssociation','update','getHoppers','CmHopper','hasOwnProperty','order','where','pick','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks'];(function(_0xed6ad9,_0x5bd53a){var _0x938526=function(_0x3e3278){while(--_0x3e3278){_0xed6ad9['push'](_0xed6ad9['shift']());}};_0x938526(++_0x5bd53a);}(_0x8dab,0x1ec));var _0xb8da=function(_0x402cf4,_0x2a60cb){_0x402cf4=_0x402cf4-0x0;var _0x42e3d0=_0x8dab[_0x402cf4];return _0x42e3d0;};'use strict';var emlformat=require(_0xb8da('0x0'));var rimraf=require(_0xb8da('0x1'));var zipdir=require(_0xb8da('0x2'));var jsonpatch=require(_0xb8da('0x3'));var rp=require(_0xb8da('0x4'));var moment=require(_0xb8da('0x5'));var BPromise=require(_0xb8da('0x6'));var Mustache=require(_0xb8da('0x7'));var util=require(_0xb8da('0x8'));var path=require(_0xb8da('0x9'));var sox=require(_0xb8da('0xa'));var csv=require(_0xb8da('0xb'));var ejs=require(_0xb8da('0xc'));var fs=require('fs');var fs_extra=require(_0xb8da('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb8da('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb8da('0xf'));var Papa=require(_0xb8da('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb8da('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb8da('0x12'));var logger=require(_0xb8da('0x13'))(_0xb8da('0x14'));var utils=require(_0xb8da('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f9235,_0x4152ea){_0x4152ea=_0x4152ea||0xcc;return function(_0x26ec23){if(_0x26ec23){return _0x3f9235[_0xb8da('0x16')](_0x4152ea);}return _0x3f9235['status'](_0x4152ea)[_0xb8da('0x17')]();};}function respondWithResult(_0x532e18,_0x501d8c){_0x501d8c=_0x501d8c||0xc8;return function(_0x451087){if(_0x451087){return _0x532e18['status'](_0x501d8c)[_0xb8da('0x18')](_0x451087);}};}function respondWithFilteredResult(_0x5f3b42,_0x1c634a){return function(_0x1b7159){if(_0x1b7159){var _0x4225dd=typeof _0x1c634a[_0xb8da('0x19')]==='undefined'&&typeof _0x1c634a[_0xb8da('0x1a')]===_0xb8da('0x1b');var _0x187d33=_0x1b7159[_0xb8da('0x1c')];var _0x4de878=_0x4225dd?0x0:_0x1c634a[_0xb8da('0x19')];var _0x2a799f=_0x4225dd?_0x1b7159[_0xb8da('0x1c')]:_0x1c634a[_0xb8da('0x19')]+_0x1c634a[_0xb8da('0x1a')];var _0xeda882;if(_0x2a799f>=_0x187d33){_0x2a799f=_0x187d33;_0xeda882=0xc8;}else{_0xeda882=0xce;}_0x5f3b42[_0xb8da('0x1d')](_0xeda882);return _0x5f3b42[_0xb8da('0x1e')](_0xb8da('0x1f'),_0x4de878+'-'+_0x2a799f+'/'+_0x187d33)[_0xb8da('0x18')](_0x1b7159);}return null;};}function patchUpdates(_0x54c95e){return function(_0x25e3eb){try{jsonpatch[_0xb8da('0x20')](_0x25e3eb,_0x54c95e,!![]);}catch(_0x217a92){return BPromise[_0xb8da('0x21')](_0x217a92);}return _0x25e3eb[_0xb8da('0x22')]();};}function saveUpdates(_0x2c9ceb,_0x26dda0){return function(_0x57b88a){if(_0x57b88a){return _0x57b88a['update'](_0x2c9ceb)[_0xb8da('0x23')](function(_0x59ab30){return _0x59ab30;});}return null;};}function removeEntity(_0x1efe29,_0x195d2e){return function(_0x3aba10){if(_0x3aba10){return _0x3aba10[_0xb8da('0x24')]()[_0xb8da('0x23')](function(){var _0xde2fc1=_0x3aba10[_0xb8da('0x25')]({'plain':!![]});var _0x85570f='IvrCampaigns';return db[_0xb8da('0x26')][_0xb8da('0x24')]({'where':{'type':_0x85570f,'resourceId':_0xde2fc1['id']}})[_0xb8da('0x23')](function(){return _0x3aba10;});})[_0xb8da('0x23')](function(){_0x1efe29['status'](0xcc)[_0xb8da('0x17')]();});}};}function handleEntityNotFound(_0x268f1c,_0x575381){return function(_0x5b4278){if(!_0x5b4278){_0x268f1c[_0xb8da('0x16')](0x194);}return _0x5b4278;};}function handleError(_0x25f676,_0x241f49){_0x241f49=_0x241f49||0x1f4;return function(_0x46d206){logger['error'](_0x46d206[_0xb8da('0x27')]);if(_0x46d206[_0xb8da('0x28')]){delete _0x46d206[_0xb8da('0x28')];}_0x25f676[_0xb8da('0x1d')](_0x241f49)[_0xb8da('0x29')](_0x46d206);};}exports[_0xb8da('0x2a')]=function(_0x393cc3,_0x1f0e38){var _0x4f3b28={},_0x5a0b03={},_0x3ed31e={'count':0x0,'rows':[]};var _0x1b11e2=_[_0xb8da('0x2b')](db[_0xb8da('0x2c')][_0xb8da('0x2d')],function(_0x46a801){return{'name':_0x46a801['fieldName'],'type':_0x46a801[_0xb8da('0x2e')]['key']};});_0x5a0b03[_0xb8da('0x2f')]=_[_0xb8da('0x2b')](_0x1b11e2,_0xb8da('0x28'));_0x5a0b03[_0xb8da('0x30')]=_[_0xb8da('0x31')](_0x393cc3['query']);_0x5a0b03['filters']=_['intersection'](_0x5a0b03['model'],_0x5a0b03['query']);_0x4f3b28[_0xb8da('0x32')]=_[_0xb8da('0x33')](_0x5a0b03[_0xb8da('0x2f')],qs[_0xb8da('0x34')](_0x393cc3[_0xb8da('0x30')][_0xb8da('0x34')]));_0x4f3b28['attributes']=_0x4f3b28[_0xb8da('0x32')]['length']?_0x4f3b28[_0xb8da('0x32')]:_0x5a0b03[_0xb8da('0x2f')];if(!_0x393cc3[_0xb8da('0x30')]['hasOwnProperty'](_0xb8da('0x35'))){_0x4f3b28['limit']=qs[_0xb8da('0x1a')](_0x393cc3[_0xb8da('0x30')][_0xb8da('0x1a')]);_0x4f3b28[_0xb8da('0x19')]=qs[_0xb8da('0x19')](_0x393cc3[_0xb8da('0x30')]['offset']);}_0x4f3b28['order']=qs[_0xb8da('0x36')](_0x393cc3[_0xb8da('0x30')]['sort']);_0x4f3b28['where']=qs['filters'](_['pick'](_0x393cc3[_0xb8da('0x30')],_0x5a0b03[_0xb8da('0x37')]),_0x1b11e2);if(_0x393cc3[_0xb8da('0x30')][_0xb8da('0x38')]){_0x4f3b28['where']=_[_0xb8da('0x39')](_0x4f3b28['where'],{'$or':_[_0xb8da('0x2b')](_0x1b11e2,function(_0x449478){if(_0x449478[_0xb8da('0x2e')]!==_0xb8da('0x3a')){var _0x18081b={};_0x18081b[_0x449478[_0xb8da('0x28')]]={'$like':'%'+_0x393cc3[_0xb8da('0x30')][_0xb8da('0x38')]+'%'};return _0x18081b;}})});}_0x4f3b28=_[_0xb8da('0x39')]({},_0x4f3b28,_0x393cc3[_0xb8da('0x3b')]);var _0x242f44={'where':_0x4f3b28['where']};return db['Campaign'][_0xb8da('0x1c')](_0x242f44)[_0xb8da('0x23')](function(_0x457854){_0x3ed31e[_0xb8da('0x1c')]=_0x457854;if(_0x393cc3[_0xb8da('0x30')][_0xb8da('0x3c')]){_0x4f3b28[_0xb8da('0x3d')]=[{'all':!![]}];}return db[_0xb8da('0x2c')][_0xb8da('0x3e')](_0x4f3b28);})[_0xb8da('0x23')](function(_0x5a708e){_0x3ed31e[_0xb8da('0x3f')]=_0x5a708e;return _0x3ed31e;})[_0xb8da('0x23')](respondWithFilteredResult(_0x1f0e38,_0x4f3b28))[_0xb8da('0x40')](handleError(_0x1f0e38,null));};exports[_0xb8da('0x41')]=function(_0x5718e5,_0x4d507b){var _0x614dd5={'raw':![],'where':{'id':_0x5718e5[_0xb8da('0x42')]['id']}},_0x858f00={};_0x858f00[_0xb8da('0x2f')]=_[_0xb8da('0x31')](db[_0xb8da('0x2c')][_0xb8da('0x2d')]);_0x858f00[_0xb8da('0x30')]=_[_0xb8da('0x31')](_0x5718e5[_0xb8da('0x30')]);_0x858f00[_0xb8da('0x37')]=_[_0xb8da('0x33')](_0x858f00[_0xb8da('0x2f')],_0x858f00[_0xb8da('0x30')]);_0x614dd5['attributes']=_['intersection'](_0x858f00[_0xb8da('0x2f')],qs[_0xb8da('0x34')](_0x5718e5['query'][_0xb8da('0x34')]));_0x614dd5['attributes']=_0x614dd5[_0xb8da('0x32')]['length']?_0x614dd5[_0xb8da('0x32')]:_0x858f00[_0xb8da('0x2f')];if(_0x5718e5['query'][_0xb8da('0x3c')]){_0x614dd5['include']=[{'all':!![]}];}_0x614dd5=_['merge']({},_0x614dd5,_0x5718e5['options']);return db[_0xb8da('0x2c')][_0xb8da('0x43')](_0x614dd5)[_0xb8da('0x23')](handleEntityNotFound(_0x4d507b,null))['then'](respondWithResult(_0x4d507b,null))['catch'](handleError(_0x4d507b,null));};exports[_0xb8da('0x44')]=function(_0x2dea3d,_0x240ae0){return db[_0xb8da('0x2c')][_0xb8da('0x44')](_0x2dea3d[_0xb8da('0x45')],{})[_0xb8da('0x23')](function(_0x5eae51){var _0x1c351f=_0x2dea3d[_0xb8da('0x46')]['get']({'plain':!![]});if(!_0x1c351f)throw new Error(_0xb8da('0x47'));if(_0x1c351f[_0xb8da('0x48')]===_0xb8da('0x46')){var _0xa05f6a=_0x5eae51[_0xb8da('0x25')]({'plain':!![]});var _0x5c0e9a=_0xb8da('0x49');return db[_0xb8da('0x4a')][_0xb8da('0x43')]({'where':{'name':_0x5c0e9a,'userProfileId':_0x1c351f[_0xb8da('0x4b')]},'raw':!![]})['then'](function(_0x45e344){if(_0x45e344&&_0x45e344['autoAssociation']===0x0){return db[_0xb8da('0x26')]['create']({'name':_0xa05f6a[_0xb8da('0x28')],'resourceId':_0xa05f6a['id'],'type':_0x45e344[_0xb8da('0x28')],'sectionId':_0x45e344['id']},{})[_0xb8da('0x23')](function(){return _0x5eae51;});}else{return _0x5eae51;}})[_0xb8da('0x40')](function(_0x573641){logger[_0xb8da('0x4c')](_0xb8da('0x4d'),_0x573641);throw _0x573641;});}return _0x5eae51;})[_0xb8da('0x23')](respondWithResult(_0x240ae0,0xc9))[_0xb8da('0x40')](handleError(_0x240ae0,null));};exports['clone']=function(_0x27fd1d,_0x414d61){var _0x400500={'where':{'id':_0x27fd1d[_0xb8da('0x42')]['id']}},_0x4a0e08={};_0x4a0e08[_0xb8da('0x2f')]=_[_0xb8da('0x31')](db[_0xb8da('0x2c')][_0xb8da('0x2d')]);_0x400500[_0xb8da('0x32')]=_[_0xb8da('0x33')](_0x4a0e08['model'],qs[_0xb8da('0x34')](_0x27fd1d['query'][_0xb8da('0x34')]));_0x400500[_0xb8da('0x32')]=_0x400500['attributes'][_0xb8da('0x4e')]?_0x400500[_0xb8da('0x32')]:_0x4a0e08[_0xb8da('0x2f')];if(_0x27fd1d['query'][_0xb8da('0x3c')]){_0x400500[_0xb8da('0x3d')]=[{'all':!![]}];}_0x400500=_[_0xb8da('0x39')]({},_0x400500,_0x27fd1d['options']);return db[_0xb8da('0x2c')][_0xb8da('0x43')](_0x400500)['then'](handleEntityNotFound(_0x414d61,null))[_0xb8da('0x23')](function(_0x46ce64){if(_0x46ce64){var _0x34207a=_0x46ce64['get']({'plain':!![]});_0x34207a=qs[_0xb8da('0x4f')](_0x34207a,['id',_0xb8da('0x50'),_0xb8da('0x51')]);_0x27fd1d['body']=_[_0xb8da('0x4f')](_0x27fd1d[_0xb8da('0x45')],['id',_0xb8da('0x50'),_0xb8da('0x51')]);return db[_0xb8da('0x2c')][_0xb8da('0x44')](_[_0xb8da('0x39')](_0x34207a,_0x27fd1d['body']),{'include':_0x27fd1d[_0xb8da('0x30')][_0xb8da('0x3c')]?[{'all':!![]}]:undefined})[_0xb8da('0x23')](function(_0x58c750){var _0x5a17a4=_0x27fd1d['user'][_0xb8da('0x25')]({'plain':!![]});if(!_0x5a17a4)throw new Error(_0xb8da('0x47'));if(_0x5a17a4[_0xb8da('0x48')]==='user'){var _0x5c428f=_0x58c750[_0xb8da('0x25')]({'plain':!![]});var _0x105b6c=_0xb8da('0x49');return db['UserProfileSection'][_0xb8da('0x43')]({'where':{'name':_0x105b6c,'userProfileId':_0x5a17a4[_0xb8da('0x4b')]},'raw':!![]})[_0xb8da('0x23')](function(_0x219956){if(_0x219956&&_0x219956[_0xb8da('0x52')]===0x0){return db[_0xb8da('0x26')][_0xb8da('0x44')]({'name':_0x5c428f['name'],'resourceId':_0x5c428f['id'],'type':_0x219956[_0xb8da('0x28')],'sectionId':_0x219956['id']},{})[_0xb8da('0x23')](function(){return _0x58c750;});}else{return _0x58c750;}})[_0xb8da('0x40')](function(_0x21aed3){logger['error'](_0xb8da('0x4d'),_0x21aed3);throw _0x21aed3;});}return _0x58c750;});}})[_0xb8da('0x23')](respondWithResult(_0x414d61,0xc9))['catch'](handleError(_0x414d61,null));};exports[_0xb8da('0x53')]=function(_0x240ee0,_0x3bff65){if(_0x240ee0['body']['id']){delete _0x240ee0[_0xb8da('0x45')]['id'];}return db[_0xb8da('0x2c')]['find']({'where':{'id':_0x240ee0[_0xb8da('0x42')]['id']}})['then'](handleEntityNotFound(_0x3bff65,null))[_0xb8da('0x23')](saveUpdates(_0x240ee0[_0xb8da('0x45')],null))['then'](respondWithResult(_0x3bff65,null))[_0xb8da('0x40')](handleError(_0x3bff65,null));};exports[_0xb8da('0x24')]=function(_0x582e7c,_0x49ada7){return db[_0xb8da('0x2c')]['find']({'where':{'id':_0x582e7c[_0xb8da('0x42')]['id']}})['then'](handleEntityNotFound(_0x49ada7,null))[_0xb8da('0x23')](removeEntity(_0x49ada7,null))['catch'](handleError(_0x49ada7,null));};exports[_0xb8da('0x54')]=function(_0x1f21fa,_0x39a757,_0x39bbf8){var _0x5637c5={'raw':!![],'where':{}};var _0x83e227={};var _0x29c388={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x1f21fa[_0xb8da('0x42')]['id']}})[_0xb8da('0x23')](handleEntityNotFound(_0x39a757,null))[_0xb8da('0x23')](function(_0x4fb0ab){if(_0x4fb0ab){_0x83e227[_0xb8da('0x2f')]=_[_0xb8da('0x31')](db[_0xb8da('0x55')][_0xb8da('0x2d')]);_0x83e227[_0xb8da('0x30')]=_[_0xb8da('0x31')](_0x1f21fa[_0xb8da('0x30')]);_0x83e227['filters']=_['intersection'](_0x83e227[_0xb8da('0x2f')],_0x83e227[_0xb8da('0x30')]);_0x5637c5[_0xb8da('0x32')]=_[_0xb8da('0x33')](_0x83e227[_0xb8da('0x2f')],qs[_0xb8da('0x34')](_0x1f21fa[_0xb8da('0x30')][_0xb8da('0x34')]));_0x5637c5[_0xb8da('0x32')]=_0x5637c5[_0xb8da('0x32')][_0xb8da('0x4e')]?_0x5637c5[_0xb8da('0x32')]:_0x83e227[_0xb8da('0x2f')];if(!_0x1f21fa[_0xb8da('0x30')][_0xb8da('0x56')]('nolimit')){_0x5637c5[_0xb8da('0x1a')]=qs['limit'](_0x1f21fa[_0xb8da('0x30')][_0xb8da('0x1a')]);_0x5637c5[_0xb8da('0x19')]=qs['offset'](_0x1f21fa[_0xb8da('0x30')]['offset']);}_0x5637c5[_0xb8da('0x57')]=qs[_0xb8da('0x36')](_0x1f21fa[_0xb8da('0x30')][_0xb8da('0x36')]);_0x5637c5[_0xb8da('0x58')]=qs[_0xb8da('0x37')](_[_0xb8da('0x59')](_0x1f21fa[_0xb8da('0x30')],_0x83e227[_0xb8da('0x37')]));_0x5637c5[_0xb8da('0x58')][_0xb8da('0x5a')]=_0x4fb0ab['id'];if(_0x1f21fa['query'][_0xb8da('0x38')]){_0x5637c5[_0xb8da('0x58')]=_[_0xb8da('0x39')](_0x5637c5[_0xb8da('0x58')],{'$or':_[_0xb8da('0x2b')](_0x5637c5[_0xb8da('0x32')],function(_0x5651a8){var _0x8ce608={};_0x8ce608[_0x5651a8]={'$like':'%'+_0x1f21fa['query'][_0xb8da('0x38')]+'%'};return _0x8ce608;})});}_0x5637c5=_['merge']({},_0x5637c5,_0x1f21fa[_0xb8da('0x3b')]);return db[_0xb8da('0x55')]['count']({'where':_0x5637c5[_0xb8da('0x58')]})['then'](function(_0x4dccf2){_0x29c388[_0xb8da('0x1c')]=_0x4dccf2;if(_0x1f21fa[_0xb8da('0x30')][_0xb8da('0x3c')]){_0x5637c5[_0xb8da('0x3d')]=[{'all':!![]}];}return db[_0xb8da('0x55')][_0xb8da('0x3e')](_0x5637c5);})[_0xb8da('0x23')](function(_0x2c310d){_0x29c388[_0xb8da('0x3f')]=_0x2c310d;return _0x29c388;});}})['then'](respondWithFilteredResult(_0x39a757,_0x5637c5))[_0xb8da('0x40')](handleError(_0x39a757,null));};exports[_0xb8da('0x5b')]=function(_0x4230b9,_0x5586b7,_0x1b6abb){var _0x14bb83={'raw':!![],'where':{}};var _0x4f2ffe={};var _0x428e33={'count':0x0,'rows':[]};return db[_0xb8da('0x2c')]['findOne']({'where':{'id':_0x4230b9[_0xb8da('0x42')]['id']}})[_0xb8da('0x23')](handleEntityNotFound(_0x5586b7,null))[_0xb8da('0x23')](function(_0x31c9f7){if(_0x31c9f7){_0x4f2ffe['model']=_[_0xb8da('0x31')](db['CmHopperHistory'][_0xb8da('0x2d')]);_0x4f2ffe[_0xb8da('0x30')]=_[_0xb8da('0x31')](_0x4230b9[_0xb8da('0x30')]);_0x4f2ffe['filters']=_['intersection'](_0x4f2ffe[_0xb8da('0x2f')],_0x4f2ffe[_0xb8da('0x30')]);_0x14bb83[_0xb8da('0x32')]=_[_0xb8da('0x33')](_0x4f2ffe[_0xb8da('0x2f')],qs[_0xb8da('0x34')](_0x4230b9['query']['fields']));_0x14bb83[_0xb8da('0x32')]=_0x14bb83[_0xb8da('0x32')]['length']?_0x14bb83[_0xb8da('0x32')]:_0x4f2ffe[_0xb8da('0x2f')];if(!_0x4230b9[_0xb8da('0x30')][_0xb8da('0x56')]('nolimit')){_0x14bb83[_0xb8da('0x1a')]=qs[_0xb8da('0x1a')](_0x4230b9[_0xb8da('0x30')]['limit']);_0x14bb83[_0xb8da('0x19')]=qs['offset'](_0x4230b9[_0xb8da('0x30')][_0xb8da('0x19')]);}_0x14bb83['order']=qs['sort'](_0x4230b9[_0xb8da('0x30')][_0xb8da('0x36')]);_0x14bb83['where']=qs[_0xb8da('0x37')](_[_0xb8da('0x59')](_0x4230b9['query'],_0x4f2ffe['filters']));_0x14bb83[_0xb8da('0x58')][_0xb8da('0x5a')]=_0x31c9f7['id'];if(_0x4230b9[_0xb8da('0x30')][_0xb8da('0x38')]){_0x14bb83[_0xb8da('0x58')]=_[_0xb8da('0x39')](_0x14bb83['where'],{'$or':_[_0xb8da('0x2b')](_0x14bb83[_0xb8da('0x32')],function(_0x30afa1){var _0x109cf7={};_0x109cf7[_0x30afa1]={'$like':'%'+_0x4230b9['query'][_0xb8da('0x38')]+'%'};return _0x109cf7;})});}_0x14bb83=_['merge']({},_0x14bb83,_0x4230b9[_0xb8da('0x3b')]);return db[_0xb8da('0x5c')][_0xb8da('0x1c')]({'where':_0x14bb83['where']})[_0xb8da('0x23')](function(_0xeada56){_0x428e33[_0xb8da('0x1c')]=_0xeada56;if(_0x4230b9[_0xb8da('0x30')][_0xb8da('0x3c')]){_0x14bb83[_0xb8da('0x3d')]=[{'all':!![]}];}return db[_0xb8da('0x5c')][_0xb8da('0x3e')](_0x14bb83);})[_0xb8da('0x23')](function(_0x5cafa2){_0x428e33[_0xb8da('0x3f')]=_0x5cafa2;return _0x428e33;});}})[_0xb8da('0x23')](respondWithFilteredResult(_0x5586b7,_0x14bb83))[_0xb8da('0x40')](handleError(_0x5586b7,null));};exports[_0xb8da('0x5d')]=function(_0x4ced1f,_0x54d923,_0x1cb02c){var _0x2f271a={'raw':!![],'where':{}};var _0x381e4b={};var _0x1a5163={'count':0x0,'rows':[]};return db[_0xb8da('0x2c')]['findOne']({'where':{'id':_0x4ced1f[_0xb8da('0x42')]['id']}})[_0xb8da('0x23')](handleEntityNotFound(_0x54d923,null))[_0xb8da('0x23')](function(_0x331fcd){if(_0x331fcd){_0x381e4b[_0xb8da('0x2f')]=_[_0xb8da('0x31')](db[_0xb8da('0x5e')][_0xb8da('0x2d')]);_0x381e4b['query']=_[_0xb8da('0x31')](_0x4ced1f[_0xb8da('0x30')]);_0x381e4b[_0xb8da('0x37')]=_[_0xb8da('0x33')](_0x381e4b['model'],_0x381e4b[_0xb8da('0x30')]);_0x2f271a[_0xb8da('0x32')]=_[_0xb8da('0x33')](_0x381e4b[_0xb8da('0x2f')],qs[_0xb8da('0x34')](_0x4ced1f[_0xb8da('0x30')][_0xb8da('0x34')]));_0x2f271a[_0xb8da('0x32')]=_0x2f271a[_0xb8da('0x32')][_0xb8da('0x4e')]?_0x2f271a[_0xb8da('0x32')]:_0x381e4b[_0xb8da('0x2f')];if(!_0x4ced1f[_0xb8da('0x30')][_0xb8da('0x56')]('nolimit')){_0x2f271a[_0xb8da('0x1a')]=qs[_0xb8da('0x1a')](_0x4ced1f[_0xb8da('0x30')][_0xb8da('0x1a')]);_0x2f271a[_0xb8da('0x19')]=qs['offset'](_0x4ced1f['query']['offset']);}_0x2f271a[_0xb8da('0x57')]=qs[_0xb8da('0x36')](_0x4ced1f[_0xb8da('0x30')][_0xb8da('0x36')]);_0x2f271a['where']=qs[_0xb8da('0x37')](_[_0xb8da('0x59')](_0x4ced1f[_0xb8da('0x30')],_0x381e4b[_0xb8da('0x37')]));_0x2f271a[_0xb8da('0x58')]['CampaignId']=_0x331fcd['id'];if(_0x4ced1f[_0xb8da('0x30')][_0xb8da('0x38')]){_0x2f271a['where']=_[_0xb8da('0x39')](_0x2f271a[_0xb8da('0x58')],{'$or':_[_0xb8da('0x2b')](_0x2f271a['attributes'],function(_0x12bbbf){var _0x4a850c={};_0x4a850c[_0x12bbbf]={'$like':'%'+_0x4ced1f[_0xb8da('0x30')][_0xb8da('0x38')]+'%'};return _0x4a850c;})});}_0x2f271a=_[_0xb8da('0x39')]({},_0x2f271a,_0x4ced1f[_0xb8da('0x3b')]);return db[_0xb8da('0x5e')][_0xb8da('0x1c')]({'where':_0x2f271a[_0xb8da('0x58')]})[_0xb8da('0x23')](function(_0x1a5f57){_0x1a5163[_0xb8da('0x1c')]=_0x1a5f57;if(_0x4ced1f[_0xb8da('0x30')][_0xb8da('0x3c')]){_0x2f271a['include']=[{'all':!![]}];}return db[_0xb8da('0x5e')][_0xb8da('0x3e')](_0x2f271a);})[_0xb8da('0x23')](function(_0x23b219){_0x1a5163[_0xb8da('0x3f')]=_0x23b219;return _0x1a5163;});}})[_0xb8da('0x23')](respondWithFilteredResult(_0x54d923,_0x2f271a))[_0xb8da('0x40')](handleError(_0x54d923,null));};exports[_0xb8da('0x5f')]=function(_0x5497cc,_0x214eb6,_0x47e543){var _0x64eec2={'raw':!![],'where':{}};var _0xc6db8c={};var _0x20ac5b={'count':0x0,'rows':[]};return db['Campaign'][_0xb8da('0x60')]({'where':{'id':_0x5497cc['params']['id']}})[_0xb8da('0x23')](handleEntityNotFound(_0x214eb6,null))[_0xb8da('0x23')](function(_0x561391){if(_0x561391){_0xc6db8c[_0xb8da('0x2f')]=_[_0xb8da('0x31')](db[_0xb8da('0x61')][_0xb8da('0x2d')]);_0xc6db8c['query']=_[_0xb8da('0x31')](_0x5497cc[_0xb8da('0x30')]);_0xc6db8c['filters']=_['intersection'](_0xc6db8c[_0xb8da('0x2f')],_0xc6db8c[_0xb8da('0x30')]);_0x64eec2[_0xb8da('0x32')]=_[_0xb8da('0x33')](_0xc6db8c[_0xb8da('0x2f')],qs['fields'](_0x5497cc[_0xb8da('0x30')][_0xb8da('0x34')]));_0x64eec2['attributes']=_0x64eec2[_0xb8da('0x32')][_0xb8da('0x4e')]?_0x64eec2['attributes']:_0xc6db8c[_0xb8da('0x2f')];if(!_0x5497cc[_0xb8da('0x30')][_0xb8da('0x56')](_0xb8da('0x35'))){_0x64eec2[_0xb8da('0x1a')]=qs[_0xb8da('0x1a')](_0x5497cc[_0xb8da('0x30')]['limit']);_0x64eec2['offset']=qs[_0xb8da('0x19')](_0x5497cc[_0xb8da('0x30')][_0xb8da('0x19')]);}_0x64eec2['order']=qs[_0xb8da('0x36')](_0x5497cc[_0xb8da('0x30')][_0xb8da('0x36')]);_0x64eec2['where']=qs[_0xb8da('0x37')](_[_0xb8da('0x59')](_0x5497cc[_0xb8da('0x30')],_0xc6db8c[_0xb8da('0x37')]));_0x64eec2[_0xb8da('0x58')][_0xb8da('0x5a')]=_0x561391['id'];if(_0x5497cc[_0xb8da('0x30')][_0xb8da('0x38')]){_0x64eec2['where']=_[_0xb8da('0x39')](_0x64eec2[_0xb8da('0x58')],{'$or':_[_0xb8da('0x2b')](_0x64eec2['attributes'],function(_0x2e9dbb){var _0x2b4e83={};_0x2b4e83[_0x2e9dbb]={'$like':'%'+_0x5497cc[_0xb8da('0x30')][_0xb8da('0x38')]+'%'};return _0x2b4e83;})});}_0x64eec2=_[_0xb8da('0x39')]({},_0x64eec2,_0x5497cc['options']);return db['CmHopperBlack']['count']({'where':_0x64eec2[_0xb8da('0x58')]})['then'](function(_0x2d18e0){_0x20ac5b[_0xb8da('0x1c')]=_0x2d18e0;if(_0x5497cc[_0xb8da('0x30')][_0xb8da('0x3c')]){_0x64eec2[_0xb8da('0x3d')]=[{'all':!![]}];}return db[_0xb8da('0x61')][_0xb8da('0x3e')](_0x64eec2);})[_0xb8da('0x23')](function(_0x2ab6fd){_0x20ac5b[_0xb8da('0x3f')]=_0x2ab6fd;return _0x20ac5b;});}})[_0xb8da('0x23')](respondWithFilteredResult(_0x214eb6,_0x64eec2))[_0xb8da('0x40')](handleError(_0x214eb6,null));};exports['getLists']=function(_0x21a583,_0x58437c,_0x1f6ee0){var _0x145cdd={};var _0x599f87={};var _0x5c197b;var _0x4328bb;return db[_0xb8da('0x2c')][_0xb8da('0x60')]({'where':{'id':_0x21a583[_0xb8da('0x42')]['id']}})[_0xb8da('0x23')](handleEntityNotFound(_0x58437c,null))['then'](function(_0x6c6b10){if(_0x6c6b10){_0x5c197b=_0x6c6b10;_0x599f87[_0xb8da('0x2f')]=_[_0xb8da('0x31')](db[_0xb8da('0x62')][_0xb8da('0x2d')]);_0x599f87[_0xb8da('0x30')]=_['keys'](_0x21a583[_0xb8da('0x30')]);_0x599f87['filters']=_['intersection'](_0x599f87[_0xb8da('0x2f')],_0x599f87[_0xb8da('0x30')]);_0x145cdd['attributes']=_[_0xb8da('0x33')](_0x599f87[_0xb8da('0x2f')],qs['fields'](_0x21a583['query']['fields']));_0x145cdd[_0xb8da('0x32')]=_0x145cdd[_0xb8da('0x32')][_0xb8da('0x4e')]?_0x145cdd[_0xb8da('0x32')]:_0x599f87[_0xb8da('0x2f')];_0x145cdd[_0xb8da('0x57')]=qs[_0xb8da('0x36')](_0x21a583[_0xb8da('0x30')][_0xb8da('0x36')]);_0x145cdd[_0xb8da('0x58')]=qs[_0xb8da('0x37')](_[_0xb8da('0x59')](_0x21a583['query'],_0x599f87['filters']));if(_0x21a583[_0xb8da('0x30')]['filter']){_0x145cdd['where']=_[_0xb8da('0x39')](_0x145cdd[_0xb8da('0x58')],{'$or':_[_0xb8da('0x2b')](_0x145cdd[_0xb8da('0x32')],function(_0x532d0d){var _0x50aa81={};_0x50aa81[_0x532d0d]={'$like':'%'+_0x21a583[_0xb8da('0x30')][_0xb8da('0x38')]+'%'};return _0x50aa81;})});}_0x145cdd=_[_0xb8da('0x39')]({},_0x145cdd,_0x21a583[_0xb8da('0x3b')]);return _0x5c197b[_0xb8da('0x63')](_0x145cdd);}})[_0xb8da('0x23')](function(_0x13e3ec){if(_0x13e3ec){_0x4328bb=_0x13e3ec[_0xb8da('0x4e')];if(!_0x21a583[_0xb8da('0x30')]['hasOwnProperty']('nolimit')){_0x145cdd[_0xb8da('0x1a')]=qs['limit'](_0x21a583[_0xb8da('0x30')][_0xb8da('0x1a')]);_0x145cdd[_0xb8da('0x19')]=qs['offset'](_0x21a583[_0xb8da('0x30')][_0xb8da('0x19')]);}return _0x5c197b[_0xb8da('0x63')](_0x145cdd);}})[_0xb8da('0x23')](function(_0x50e525){if(_0x50e525){return _0x50e525?{'count':_0x4328bb,'rows':_0x50e525}:null;}})[_0xb8da('0x23')](respondWithResult(_0x58437c,null))[_0xb8da('0x40')](handleError(_0x58437c,null));};exports[_0xb8da('0x64')]=function(_0x9705af,_0x4bc848,_0x4a5553){var _0x5f1acc,_0x4d5b00;var _0x2eb5f8=[];var _0x1cbb07=moment()[_0xb8da('0x65')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xb8da('0x2c')][_0xb8da('0x43')]({'where':{'id':_0x9705af['params']['id']}})[_0xb8da('0x23')](handleEntityNotFound(_0x4bc848,null))[_0xb8da('0x23')](function(_0x2e9794){if(_0x2e9794){_0x4d5b00=_0x2e9794;return _0x2e9794[_0xb8da('0x64')](_0x9705af[_0xb8da('0x45')][_0xb8da('0x66')],_['omit'](_0x9705af[_0xb8da('0x45')],[_0xb8da('0x66'),'id'])||{});}return null;})[_0xb8da('0x67')](function(_0x26e2cb){var _0x37ae4b;var _0x550f7e;_0x5f1acc=_0x26e2cb||[];var _0x5f36ce=[];if(_0x26e2cb){for(var _0x4f48ce=0x0;_0x4f48ce<_0x26e2cb[_0xb8da('0x4e')];_0x4f48ce+=0x1){var _0x1361fe=_0x26e2cb[_0x4f48ce][_0xb8da('0x25')]({'plain':!![]});_0x4d5b00[_0xb8da('0x68')]=_0x9705af[_0xb8da('0x45')]['dialCheckDuplicateType']?_0x9705af[_0xb8da('0x45')][_0xb8da('0x68')]:_0x4d5b00['dialCheckDuplicateType'];switch(_0x4d5b00[_0xb8da('0x68')]){case _0xb8da('0x69'):_0x37ae4b=squel[_0xb8da('0x6a')]()[_0xb8da('0x6b')](_0xb8da('0x6c'))['fromQuery']([_0xb8da('0x6d'),_0xb8da('0x6e'),_0xb8da('0x6f'),_0xb8da('0x70'),'CampaignId','createdAt',_0xb8da('0x51')],squel[_0xb8da('0x71')]()[_0xb8da('0x72')]('phone','phone')[_0xb8da('0x72')](_0xb8da('0x73'),_0xb8da('0x6e'))[_0xb8da('0x72')]('id',_0xb8da('0x6f'))[_0xb8da('0x72')](_0x1361fe['CmListId'][_0xb8da('0x74')](),_0xb8da('0x70'))[_0xb8da('0x72')](_0x9705af[_0xb8da('0x42')]['id']['toString'](),_0xb8da('0x5a'))[_0xb8da('0x72')]('\x27'+_0x1cbb07+'\x27',_0xb8da('0x50'))[_0xb8da('0x72')]('\x27'+_0x1cbb07+'\x27',_0xb8da('0x51'))['from'](_0xb8da('0x75'))['where']('deletedAt\x20IS\x20NULL')['where'](_0xb8da('0x76'),_0x1361fe['CmListId']['toString']())[_0xb8da('0x58')](_0xb8da('0x77'))[_0xb8da('0x58')](_0xb8da('0x78'),squel[_0xb8da('0x71')]()[_0xb8da('0x72')](_0xb8da('0x79'))[_0xb8da('0x7a')](_0xb8da('0x7b'))[_0xb8da('0x58')](_0xb8da('0x7c'),_0x9705af[_0xb8da('0x42')]['id'][_0xb8da('0x74')]()))[_0xb8da('0x58')](_0xb8da('0x78'),squel[_0xb8da('0x71')]()[_0xb8da('0x72')](_0xb8da('0x7d'))[_0xb8da('0x7a')](_0xb8da('0x6c'))['where'](_0xb8da('0x7c'),_0x9705af['params']['id']['toString']())))['toString']();break;case _0xb8da('0x7e'):_0x37ae4b=squel[_0xb8da('0x6a')]()[_0xb8da('0x6b')](_0xb8da('0x6c'))['fromQuery'](['phone',_0xb8da('0x6e'),_0xb8da('0x6f'),'ListId','CampaignId',_0xb8da('0x50'),_0xb8da('0x51')],squel[_0xb8da('0x71')]()[_0xb8da('0x72')](_0xb8da('0x6d'),_0xb8da('0x6d'))['field'](_0xb8da('0x73'),_0xb8da('0x6e'))[_0xb8da('0x72')]('id','ContactId')[_0xb8da('0x72')](_0x1361fe[_0xb8da('0x7f')]['toString'](),'ListId')[_0xb8da('0x72')](_0x9705af[_0xb8da('0x42')]['id'][_0xb8da('0x74')](),_0xb8da('0x5a'))['field']('\x27'+_0x1cbb07+'\x27','createdAt')['field']('\x27'+_0x1cbb07+'\x27',_0xb8da('0x51'))[_0xb8da('0x7a')](_0xb8da('0x75'))[_0xb8da('0x58')](_0xb8da('0x80'))[_0xb8da('0x58')](_0xb8da('0x76'),_0x1361fe[_0xb8da('0x7f')][_0xb8da('0x74')]())[_0xb8da('0x58')]('phone\x20IS\x20NOT\x20NULL')[_0xb8da('0x58')](_0xb8da('0x78'),squel[_0xb8da('0x71')]()[_0xb8da('0x72')](_0xb8da('0x7d'))['from'](_0xb8da('0x6c'))[_0xb8da('0x58')](_0xb8da('0x7c'),_0x9705af[_0xb8da('0x42')]['id'][_0xb8da('0x74')]())))[_0xb8da('0x74')]();break;default:_0x37ae4b=squel[_0xb8da('0x6a')]()[_0xb8da('0x6b')](_0xb8da('0x6c'))[_0xb8da('0x81')]([_0xb8da('0x6d'),_0xb8da('0x6e'),_0xb8da('0x6f'),_0xb8da('0x70'),_0xb8da('0x5a'),'createdAt','updatedAt'],squel[_0xb8da('0x71')]()['field'](_0xb8da('0x6d'),'phone')[_0xb8da('0x72')](_0xb8da('0x73'),'scheduledAt')[_0xb8da('0x72')]('id',_0xb8da('0x6f'))[_0xb8da('0x72')](_0x1361fe[_0xb8da('0x7f')][_0xb8da('0x74')](),_0xb8da('0x70'))[_0xb8da('0x72')](_0x9705af[_0xb8da('0x42')]['id'][_0xb8da('0x74')](),_0xb8da('0x5a'))[_0xb8da('0x72')]('\x27'+_0x1cbb07+'\x27',_0xb8da('0x50'))[_0xb8da('0x72')]('\x27'+_0x1cbb07+'\x27',_0xb8da('0x51'))[_0xb8da('0x7a')]('cm_contacts')[_0xb8da('0x58')](_0xb8da('0x80'))['where'](_0xb8da('0x76'),_0x1361fe[_0xb8da('0x7f')][_0xb8da('0x74')]())[_0xb8da('0x58')](_0xb8da('0x77')))['toString']();}_0x550f7e=squel[_0xb8da('0x6a')]()['into'](_0xb8da('0x82'))[_0xb8da('0x81')]([_0xb8da('0x83'),_0xb8da('0x6e'),'phone',_0xb8da('0x84'),_0xb8da('0x50'),_0xb8da('0x51')],squel[_0xb8da('0x71')]()[_0xb8da('0x72')](_0xb8da('0x85'),'id')[_0xb8da('0x72')](_0xb8da('0x73'),_0xb8da('0x6e'))[_0xb8da('0x72')](_0xb8da('0x86'),_0xb8da('0x6d'))[_0xb8da('0x72')]('ci.OrderBY',_0xb8da('0x84'))[_0xb8da('0x72')]('\x27'+_0x1cbb07+'\x27','createdAt')[_0xb8da('0x72')]('\x27'+_0x1cbb07+'\x27','updatedAt')[_0xb8da('0x7a')](_0xb8da('0x87'),'ci')[_0xb8da('0x88')](_0xb8da('0x6c'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0xb8da('0x58')](_0xb8da('0x89'),_0x1361fe[_0xb8da('0x7f')][_0xb8da('0x74')]())[_0xb8da('0x58')](_0xb8da('0x8a'),_0x9705af[_0xb8da('0x42')]['id'][_0xb8da('0x74')]())[_0xb8da('0x58')]('h.createdAt\x20=\x20?',_0x1cbb07))[_0xb8da('0x74')]();_0x5f36ce[_0xb8da('0x8b')](db[_0xb8da('0x8c')][_0xb8da('0x30')](_0x37ae4b));_0x2eb5f8[_0xb8da('0x8b')](db[_0xb8da('0x8c')][_0xb8da('0x30')](_0x550f7e));}return BPromise[_0xb8da('0x8d')](_0x5f36ce);}})['then'](function(){return BPromise['all'](_0x2eb5f8);})[_0xb8da('0x23')](function(){return _0x5f1acc;})['then'](respondWithResult(_0x4bc848,null))['catch'](handleError(_0x4bc848,null));};exports[_0xb8da('0x8e')]=function(_0x6b81e5,_0x488d15,_0x2cde2e){return db[_0xb8da('0x2c')][_0xb8da('0x43')]({'where':{'id':_0x6b81e5[_0xb8da('0x42')]['id']}})['then'](handleEntityNotFound(_0x488d15,null))[_0xb8da('0x23')](function(_0x5d6b45){if(_0x5d6b45){return _0x5d6b45['removeLists'](_0x6b81e5['query'][_0xb8da('0x66')]);}})['then'](function(_0x1dc90e){if(_0x1dc90e){return db['CmHopper'][_0xb8da('0x24')]({'where':{'ListId':_0x6b81e5['query'][_0xb8da('0x66')],'CampaignId':_0x6b81e5['params']['id']}})['then'](function(){return _0x1dc90e;});}})['then'](respondWithStatusCode(_0x488d15,null))[_0xb8da('0x40')](handleError(_0x488d15,null));};exports[_0xb8da('0x8f')]=function(_0x41a461,_0x10e011,_0x274fc1){var _0x56806e={};var _0x2f1385={};var _0x1d9a47;var _0x4cabb4;return db[_0xb8da('0x2c')][_0xb8da('0x60')]({'where':{'id':_0x41a461[_0xb8da('0x42')]['id']}})['then'](handleEntityNotFound(_0x10e011,null))[_0xb8da('0x23')](function(_0x2b078d){if(_0x2b078d){_0x1d9a47=_0x2b078d;_0x2f1385[_0xb8da('0x2f')]=_[_0xb8da('0x31')](db['CmList'][_0xb8da('0x2d')]);_0x2f1385[_0xb8da('0x30')]=_[_0xb8da('0x31')](_0x41a461['query']);_0x2f1385[_0xb8da('0x37')]=_[_0xb8da('0x33')](_0x2f1385[_0xb8da('0x2f')],_0x2f1385[_0xb8da('0x30')]);_0x56806e[_0xb8da('0x32')]=_[_0xb8da('0x33')](_0x2f1385[_0xb8da('0x2f')],qs[_0xb8da('0x34')](_0x41a461[_0xb8da('0x30')]['fields']));_0x56806e[_0xb8da('0x32')]=_0x56806e[_0xb8da('0x32')][_0xb8da('0x4e')]?_0x56806e[_0xb8da('0x32')]:_0x2f1385['model'];_0x56806e['order']=qs[_0xb8da('0x36')](_0x41a461[_0xb8da('0x30')][_0xb8da('0x36')]);_0x56806e[_0xb8da('0x58')]=qs['filters'](_[_0xb8da('0x59')](_0x41a461[_0xb8da('0x30')],_0x2f1385[_0xb8da('0x37')]));if(_0x41a461[_0xb8da('0x30')][_0xb8da('0x38')]){_0x56806e[_0xb8da('0x58')]=_[_0xb8da('0x39')](_0x56806e[_0xb8da('0x58')],{'$or':_[_0xb8da('0x2b')](_0x56806e[_0xb8da('0x32')],function(_0x32daf4){var _0xde153e={};_0xde153e[_0x32daf4]={'$like':'%'+_0x41a461[_0xb8da('0x30')][_0xb8da('0x38')]+'%'};return _0xde153e;})});}_0x56806e=_[_0xb8da('0x39')]({},_0x56806e,_0x41a461[_0xb8da('0x3b')]);return _0x1d9a47[_0xb8da('0x8f')](_0x56806e);}})[_0xb8da('0x23')](function(_0x1b298d){if(_0x1b298d){_0x4cabb4=_0x1b298d['length'];if(!_0x41a461[_0xb8da('0x30')][_0xb8da('0x56')](_0xb8da('0x35'))){_0x56806e[_0xb8da('0x1a')]=qs['limit'](_0x41a461[_0xb8da('0x30')][_0xb8da('0x1a')]);_0x56806e[_0xb8da('0x19')]=qs[_0xb8da('0x19')](_0x41a461[_0xb8da('0x30')][_0xb8da('0x19')]);}return _0x1d9a47[_0xb8da('0x8f')](_0x56806e);}})[_0xb8da('0x23')](function(_0x287027){if(_0x287027){return _0x287027?{'count':_0x4cabb4,'rows':_0x287027}:null;}})[_0xb8da('0x23')](respondWithResult(_0x10e011,null))[_0xb8da('0x40')](handleError(_0x10e011,null));};exports['addBlackLists']=function(_0x496003,_0x354668,_0xcd547d){var _0x694599,_0x12c107;var _0x4ef394=[];var _0x177548=moment()['format'](_0xb8da('0x90'));return db[_0xb8da('0x2c')][_0xb8da('0x43')]({'where':{'id':_0x496003[_0xb8da('0x42')]['id']}})[_0xb8da('0x23')](handleEntityNotFound(_0x354668,null))['then'](function(_0x1095fe){if(_0x1095fe){_0x12c107=_0x1095fe;return _0x1095fe['addBlackLists'](_0x496003[_0xb8da('0x45')][_0xb8da('0x66')],_['omit'](_0x496003[_0xb8da('0x45')],[_0xb8da('0x66'),'id'])||{});}return null;})['spread'](function(_0x5e053a){var _0xe091ca;var _0x496994;_0x694599=_0x5e053a||[];var _0x49dcaf=[];if(_0x5e053a){for(var _0x243f91=0x0;_0x243f91<_0x5e053a[_0xb8da('0x4e')];_0x243f91+=0x1){var _0x4f8335=_0x5e053a[_0x243f91][_0xb8da('0x25')]({'plain':!![]});_0xe091ca=squel[_0xb8da('0x6a')]()[_0xb8da('0x6b')](_0xb8da('0x91'))['fromQuery']([_0xb8da('0x6d'),_0xb8da('0x6f'),_0xb8da('0x70'),_0xb8da('0x5a'),_0xb8da('0x50'),_0xb8da('0x51')],squel[_0xb8da('0x71')]()[_0xb8da('0x72')](_0xb8da('0x6d'),_0xb8da('0x6d'))['field']('id',_0xb8da('0x6f'))[_0xb8da('0x72')](_0x4f8335['CmListId'][_0xb8da('0x74')](),_0xb8da('0x70'))[_0xb8da('0x72')](_0x496003[_0xb8da('0x42')]['id'][_0xb8da('0x74')](),_0xb8da('0x5a'))[_0xb8da('0x72')](_0xb8da('0x73'),_0xb8da('0x50'))['field']('NOW()',_0xb8da('0x51'))['from']('cm_contacts')[_0xb8da('0x58')](_0xb8da('0x80'))[_0xb8da('0x58')](_0xb8da('0x76'),_0x4f8335[_0xb8da('0x7f')]['toString']())[_0xb8da('0x58')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x49dcaf[_0xb8da('0x8b')](db[_0xb8da('0x8c')][_0xb8da('0x30')](_0xe091ca));}return BPromise[_0xb8da('0x8d')](_0x49dcaf);}})[_0xb8da('0x23')](function(){return _0x694599;})[_0xb8da('0x23')](respondWithResult(_0x354668,null))[_0xb8da('0x40')](handleError(_0x354668,null));};exports['removeBlackLists']=function(_0x382b42,_0x41db8a,_0x424d41){return db[_0xb8da('0x2c')][_0xb8da('0x43')]({'where':{'id':_0x382b42[_0xb8da('0x42')]['id']}})[_0xb8da('0x23')](handleEntityNotFound(_0x41db8a,null))[_0xb8da('0x23')](function(_0x4c0b72){if(_0x4c0b72){return _0x4c0b72[_0xb8da('0x92')](_0x382b42[_0xb8da('0x30')][_0xb8da('0x66')]);}})[_0xb8da('0x23')](function(_0x44fee3){if(_0x44fee3){return db['CmHopperBlack'][_0xb8da('0x24')]({'where':{'ListId':_0x382b42[_0xb8da('0x30')][_0xb8da('0x66')],'CampaignId':_0x382b42[_0xb8da('0x42')]['id']}})['then'](function(){return _0x44fee3;});}})[_0xb8da('0x23')](respondWithStatusCode(_0x41db8a,null))[_0xb8da('0x40')](handleError(_0x41db8a,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 6721b9f..b23d10f 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x4e291f,_0x202c9){var _0x3b2d52=function(_0x2004a8){while(--_0x2004a8){_0x4e291f['push'](_0x4e291f['shift']());}};_0x3b2d52(++_0x202c9);}(_0x7a54,0x106));var _0x47a5=function(_0x819713,_0x48562d){_0x819713=_0x819713-0x0;var _0x548c40=_0x7a54[_0x819713];return _0x548c40;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x117417,_0x214c67){var _0x5ba86d=function(_0x35ad70){while(--_0x35ad70){_0x117417['push'](_0x117417['shift']());}};_0x5ba86d(++_0x214c67);}(_0x7a54,0x106));var _0x47a5=function(_0x3289ad,_0x45b709){_0x3289ad=_0x3289ad-0x0;var _0x2cdce2=_0x7a54[_0x3289ad];return _0x2cdce2;};'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 12b7caa..7aea0bf 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 _0x2c6a=['where','attributes','limit','include','model','map','stringify','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','raw'];(function(_0x1211e2,_0x2745a5){var _0x4dbdb5=function(_0xe968fb){while(--_0xe968fb){_0x1211e2['push'](_0x1211e2['shift']());}};_0x4dbdb5(++_0x2745a5);}(_0x2c6a,0xa7));var _0xa2c6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2c6a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa2c6('0x0'));var util=require(_0xa2c6('0x1'));var moment=require(_0xa2c6('0x2'));var BPromise=require(_0xa2c6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa2c6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa2c6('0x5'))(_0xa2c6('0x6'));var config=require(_0xa2c6('0x7'));var jayson=require(_0xa2c6('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1a9131,_0x1fa65f,_0x3d1aa0){return new BPromise(function(_0x11aa17,_0x3c2894){return client[_0xa2c6('0x9')](_0x1a9131,_0x3d1aa0)[_0xa2c6('0xa')](function(_0x4b0bdf){logger[_0xa2c6('0xb')](_0xa2c6('0xc'),_0x1fa65f,_0xa2c6('0xd'));logger[_0xa2c6('0xe')]('Campaign,\x20%s,\x20%s,\x20%s',_0x1fa65f,_0xa2c6('0xd'),JSON['stringify'](_0x4b0bdf));if(_0x4b0bdf[_0xa2c6('0xf')]){if(_0x4b0bdf[_0xa2c6('0xf')][_0xa2c6('0x10')]===0x1f4){logger[_0xa2c6('0xf')]('Campaign,\x20%s,\x20%s',_0x1fa65f,_0x4b0bdf[_0xa2c6('0xf')][_0xa2c6('0x11')]);return _0x3c2894(_0x4b0bdf[_0xa2c6('0xf')]['message']);}logger[_0xa2c6('0xf')](_0xa2c6('0xc'),_0x1fa65f,_0x4b0bdf[_0xa2c6('0xf')][_0xa2c6('0x11')]);return _0x11aa17(_0x4b0bdf[_0xa2c6('0xf')]['message']);}else{logger[_0xa2c6('0xb')](_0xa2c6('0xc'),_0x1fa65f,_0xa2c6('0xd'));_0x11aa17(_0x4b0bdf[_0xa2c6('0x12')][_0xa2c6('0x11')]);}})[_0xa2c6('0x13')](function(_0x4fd220){logger[_0xa2c6('0xf')]('Campaign,\x20%s,\x20%s',_0x1fa65f,_0x4fd220);_0x3c2894(_0x4fd220);});});}exports[_0xa2c6('0x14')]=function(_0x114424){var _0x1cf0a9=this;return new Promise(function(_0x2479bd,_0x372ce3){return db[_0xa2c6('0x15')][_0xa2c6('0x16')]({'raw':_0x114424[_0xa2c6('0x17')]?_0x114424['options'][_0xa2c6('0x18')]===undefined?!![]:![]:!![],'where':_0x114424[_0xa2c6('0x17')]?_0x114424[_0xa2c6('0x17')][_0xa2c6('0x19')]||null:null,'attributes':_0x114424[_0xa2c6('0x17')]?_0x114424['options'][_0xa2c6('0x1a')]||null:null,'limit':_0x114424[_0xa2c6('0x17')]?_0x114424['options'][_0xa2c6('0x1b')]||null:null,'include':_0x114424['options']?_0x114424[_0xa2c6('0x17')][_0xa2c6('0x1c')]?_['map'](_0x114424[_0xa2c6('0x17')]['include'],function(_0x19a765){return{'model':db[_0x19a765[_0xa2c6('0x1d')]],'as':_0x19a765['as'],'attributes':_0x19a765[_0xa2c6('0x1a')],'include':_0x19a765[_0xa2c6('0x1c')]?_[_0xa2c6('0x1e')](_0x19a765['include'],function(_0x2ed646){return{'model':db[_0x2ed646['model']],'as':_0x2ed646['as'],'attributes':_0x2ed646[_0xa2c6('0x1a')],'include':_0x2ed646[_0xa2c6('0x1c')]?_['map'](_0x2ed646[_0xa2c6('0x1c')],function(_0x4485d4){return{'model':db[_0x4485d4[_0xa2c6('0x1d')]],'as':_0x4485d4['as'],'attributes':_0x4485d4[_0xa2c6('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa2c6('0xa')](function(_0x11a72c){logger[_0xa2c6('0xb')](_0xa2c6('0x14'),_0x114424);logger[_0xa2c6('0xe')]('GetCampaign',_0x114424,JSON[_0xa2c6('0x1f')](_0x11a72c));_0x2479bd(_0x11a72c);})[_0xa2c6('0x13')](function(_0x233284){logger[_0xa2c6('0xf')]('GetCampaign',_0x233284['message'],_0x114424);_0x372ce3(_0x1cf0a9['error'](0x1f4,_0x233284['message']));});});}; \ No newline at end of file +var _0xf0ba=['catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','then','info','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','Campaign,\x20%s,\x20%s','message','result'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0xf0ba,0x1ed));var _0xaf0b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf0ba[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xaf0b('0x0'));var util=require(_0xaf0b('0x1'));var moment=require(_0xaf0b('0x2'));var BPromise=require(_0xaf0b('0x3'));var rs=require(_0xaf0b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaf0b('0x5'))['db'];var utils=require(_0xaf0b('0x6'));var logger=require('../../config/logger')(_0xaf0b('0x7'));var config=require('../../config/environment');var jayson=require(_0xaf0b('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x53b32d,_0x1d260e,_0x17b6d5){return new BPromise(function(_0x3439d5,_0xd67a9){return client['request'](_0x53b32d,_0x17b6d5)[_0xaf0b('0x9')](function(_0x4242b1){logger[_0xaf0b('0xa')]('Campaign,\x20%s,\x20%s',_0x1d260e,_0xaf0b('0xb'));logger['debug'](_0xaf0b('0xc'),_0x1d260e,_0xaf0b('0xb'),JSON[_0xaf0b('0xd')](_0x4242b1));if(_0x4242b1['error']){if(_0x4242b1[_0xaf0b('0xe')][_0xaf0b('0xf')]===0x1f4){logger[_0xaf0b('0xe')](_0xaf0b('0x10'),_0x1d260e,_0x4242b1[_0xaf0b('0xe')][_0xaf0b('0x11')]);return _0xd67a9(_0x4242b1['error'][_0xaf0b('0x11')]);}logger[_0xaf0b('0xe')](_0xaf0b('0x10'),_0x1d260e,_0x4242b1[_0xaf0b('0xe')]['message']);return _0x3439d5(_0x4242b1[_0xaf0b('0xe')][_0xaf0b('0x11')]);}else{logger[_0xaf0b('0xa')](_0xaf0b('0x10'),_0x1d260e,_0xaf0b('0xb'));_0x3439d5(_0x4242b1[_0xaf0b('0x12')][_0xaf0b('0x11')]);}})[_0xaf0b('0x13')](function(_0x4885da){logger[_0xaf0b('0xe')]('Campaign,\x20%s,\x20%s',_0x1d260e,_0x4885da);_0xd67a9(_0x4885da);});});}exports[_0xaf0b('0x14')]=function(_0x1dd132){var _0x36b059=this;return new Promise(function(_0xbe0d1e,_0x3201ed){return db[_0xaf0b('0x15')][_0xaf0b('0x16')]({'raw':_0x1dd132[_0xaf0b('0x17')]?_0x1dd132[_0xaf0b('0x17')][_0xaf0b('0x18')]===undefined?!![]:![]:!![],'where':_0x1dd132['options']?_0x1dd132[_0xaf0b('0x17')][_0xaf0b('0x19')]||null:null,'attributes':_0x1dd132[_0xaf0b('0x17')]?_0x1dd132['options'][_0xaf0b('0x1a')]||null:null,'limit':_0x1dd132[_0xaf0b('0x17')]?_0x1dd132['options'][_0xaf0b('0x1b')]||null:null,'include':_0x1dd132[_0xaf0b('0x17')]?_0x1dd132[_0xaf0b('0x17')][_0xaf0b('0x1c')]?_[_0xaf0b('0x1d')](_0x1dd132['options']['include'],function(_0x4541c5){return{'model':db[_0x4541c5[_0xaf0b('0x1e')]],'as':_0x4541c5['as'],'attributes':_0x4541c5[_0xaf0b('0x1a')],'include':_0x4541c5[_0xaf0b('0x1c')]?_[_0xaf0b('0x1d')](_0x4541c5[_0xaf0b('0x1c')],function(_0x234040){return{'model':db[_0x234040[_0xaf0b('0x1e')]],'as':_0x234040['as'],'attributes':_0x234040['attributes'],'include':_0x234040[_0xaf0b('0x1c')]?_[_0xaf0b('0x1d')](_0x234040[_0xaf0b('0x1c')],function(_0x51cb2f){return{'model':db[_0x51cb2f[_0xaf0b('0x1e')]],'as':_0x51cb2f['as'],'attributes':_0x51cb2f[_0xaf0b('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5a3e1b){logger['info'](_0xaf0b('0x14'),_0x1dd132);logger[_0xaf0b('0x1f')](_0xaf0b('0x14'),_0x1dd132,JSON['stringify'](_0x5a3e1b));_0xbe0d1e(_0x5a3e1b);})[_0xaf0b('0x13')](function(_0x674048){logger[_0xaf0b('0xe')](_0xaf0b('0x14'),_0x674048[_0xaf0b('0x11')],_0x1dd132);_0x3201ed(_0x36b059[_0xaf0b('0xe')](0x1f4,_0x674048[_0xaf0b('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index ae87d12..3289d50 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 _0x4f20=['addBlackLists','update','delete','destroy','/:id/lists','removeLists','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','index','/:id','show','isAuthenticated','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','getBlackLists','create','post','/:id/blacklists'];(function(_0x2a0350,_0x249319){var _0x425220=function(_0x1d5f78){while(--_0x1d5f78){_0x2a0350['push'](_0x2a0350['shift']());}};_0x425220(++_0x249319);}(_0x4f20,0x86));var _0x04f2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4f20[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x04f2('0x0'));var path=require(_0x04f2('0x1'));var timeout=require(_0x04f2('0x2'));var express=require(_0x04f2('0x3'));var router=express['Router']();var fs_extra=require(_0x04f2('0x4'));var auth=require(_0x04f2('0x5'));var interaction=require(_0x04f2('0x6'));var config=require(_0x04f2('0x7'));var controller=require(_0x04f2('0x8'));router[_0x04f2('0x9')]('/',auth['isAuthenticated'](),controller[_0x04f2('0xa')]);router[_0x04f2('0x9')](_0x04f2('0xb'),auth['isAuthenticated'](),controller[_0x04f2('0xc')]);router['get']('/:id/hoppers',auth[_0x04f2('0xd')](),controller[_0x04f2('0xe')]);router['get'](_0x04f2('0xf'),auth[_0x04f2('0xd')](),controller[_0x04f2('0x10')]);router[_0x04f2('0x9')](_0x04f2('0x11'),auth['isAuthenticated'](),controller[_0x04f2('0x12')]);router['get'](_0x04f2('0x13'),auth[_0x04f2('0xd')](),controller[_0x04f2('0x14')]);router['get']('/:id/lists',auth['isAuthenticated'](),controller[_0x04f2('0x15')]);router[_0x04f2('0x9')]('/:id/blacklists',auth[_0x04f2('0xd')](),controller[_0x04f2('0x16')]);router['post']('/',auth[_0x04f2('0xd')](),controller[_0x04f2('0x17')]);router[_0x04f2('0x18')]('/:id/clone',auth[_0x04f2('0xd')](),controller['clone']);router[_0x04f2('0x18')]('/:id/lists',auth[_0x04f2('0xd')](),controller['addLists']);router[_0x04f2('0x18')](_0x04f2('0x19'),auth['isAuthenticated'](),controller[_0x04f2('0x1a')]);router['put'](_0x04f2('0xb'),auth[_0x04f2('0xd')](),controller[_0x04f2('0x1b')]);router[_0x04f2('0x1c')](_0x04f2('0xb'),auth[_0x04f2('0xd')](),controller[_0x04f2('0x1d')]);router[_0x04f2('0x1c')](_0x04f2('0x1e'),auth[_0x04f2('0xd')](),controller[_0x04f2('0x1f')]);router[_0x04f2('0x1c')]('/:id/blacklists',auth[_0x04f2('0xd')](),controller['removeBlackLists']);module['exports']=router; \ No newline at end of file +var _0x48db=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./campaign.controller','isAuthenticated','index','get','/:id','show','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','post','/:id/clone','clone','addBlackLists','put','destroy','delete','removeBlackLists','exports','path'];(function(_0x30d3bf,_0x58c72b){var _0x1e2f39=function(_0x2f0fe1){while(--_0x2f0fe1){_0x30d3bf['push'](_0x30d3bf['shift']());}};_0x1e2f39(++_0x58c72b);}(_0x48db,0x1cf));var _0xb48d=function(_0x13f129,_0x2fb87b){_0x13f129=_0x13f129-0x0;var _0x12145f=_0x48db[_0x13f129];return _0x12145f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb48d('0x0'));var timeout=require(_0xb48d('0x1'));var express=require(_0xb48d('0x2'));var router=express[_0xb48d('0x3')]();var fs_extra=require(_0xb48d('0x4'));var auth=require(_0xb48d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb48d('0x6'));var controller=require(_0xb48d('0x7'));router['get']('/',auth[_0xb48d('0x8')](),controller[_0xb48d('0x9')]);router[_0xb48d('0xa')](_0xb48d('0xb'),auth[_0xb48d('0x8')](),controller[_0xb48d('0xc')]);router['get']('/:id/hoppers',auth[_0xb48d('0x8')](),controller['getHoppers']);router[_0xb48d('0xa')](_0xb48d('0xd'),auth['isAuthenticated'](),controller[_0xb48d('0xe')]);router[_0xb48d('0xa')]('/:id/hopper_finals',auth[_0xb48d('0x8')](),controller[_0xb48d('0xf')]);router[_0xb48d('0xa')](_0xb48d('0x10'),auth[_0xb48d('0x8')](),controller[_0xb48d('0x11')]);router[_0xb48d('0xa')](_0xb48d('0x12'),auth['isAuthenticated'](),controller['getLists']);router[_0xb48d('0xa')](_0xb48d('0x13'),auth[_0xb48d('0x8')](),controller['getBlackLists']);router['post']('/',auth[_0xb48d('0x8')](),controller['create']);router[_0xb48d('0x14')](_0xb48d('0x15'),auth[_0xb48d('0x8')](),controller[_0xb48d('0x16')]);router[_0xb48d('0x14')](_0xb48d('0x12'),auth[_0xb48d('0x8')](),controller['addLists']);router[_0xb48d('0x14')]('/:id/blacklists',auth[_0xb48d('0x8')](),controller[_0xb48d('0x17')]);router[_0xb48d('0x18')](_0xb48d('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xb48d('0xb'),auth[_0xb48d('0x8')](),controller[_0xb48d('0x19')]);router[_0xb48d('0x1a')](_0xb48d('0x12'),auth[_0xb48d('0x8')](),controller['removeLists']);router[_0xb48d('0x1a')]('/:id/blacklists',auth[_0xb48d('0x8')](),controller[_0xb48d('0x1b')]);module[_0xb48d('0x1c')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 9fb2432..00b9eb3 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 _0xac8f=['sequelize','exports','STRING','TEXT','VIRTUAL','key'];(function(_0x4da0ea,_0x571773){var _0x3d1419=function(_0x1a8aa0){while(--_0x1a8aa0){_0x4da0ea['push'](_0x4da0ea['shift']());}};_0x3d1419(++_0x571773);}(_0xac8f,0x1b6));var _0xfac8=function(_0x296809,_0x1c9665){_0x296809=_0x296809-0x0;var _0x18c0d3=_0xac8f[_0x296809];return _0x18c0d3;};'use strict';var Sequelize=require(_0xfac8('0x0'));module[_0xfac8('0x1')]={'key':{'type':Sequelize[_0xfac8('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xfac8('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0xfac8('0x2')]},'name':{'type':Sequelize[_0xfac8('0x4')],'get':function(){return this['getDataValue'](_0xfac8('0x5'));}}}; \ No newline at end of file +var _0xcb5f=['key','sequelize','STRING','TEXT'];(function(_0x1ff10a,_0x590fda){var _0x40f3d9=function(_0x2f377a){while(--_0x2f377a){_0x1ff10a['push'](_0x1ff10a['shift']());}};_0x40f3d9(++_0x590fda);}(_0xcb5f,0x129));var _0xfcb5=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xcb5f[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xfcb5('0x0'));module['exports']={'key':{'type':Sequelize[_0xfcb5('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xfcb5('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xfcb5('0x1')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0xfcb5('0x3'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 9082eb7..2fb9a6c 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 _0xcb36=['options','includeAll','include','findAll','rows','catch','show','params','keys','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','set','apply','reject','save','update','then','destroy','CannedAnswers','UserProfileResource','sendStatus','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge'];(function(_0x4de1b1,_0x18c64c){var _0x639f27=function(_0x635e03){while(--_0x635e03){_0x4de1b1['push'](_0x4de1b1['shift']());}};_0x639f27(++_0x18c64c);}(_0xcb36,0x70));var _0x6cb3=function(_0x44bce4,_0x3e4372){_0x44bce4=_0x44bce4-0x0;var _0x50eb72=_0xcb36[_0x44bce4];return _0x50eb72;};'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(_0x6cb3('0x0'));var moment=require('moment');var BPromise=require(_0x6cb3('0x1'));var Mustache=require('mustache');var util=require(_0x6cb3('0x2'));var path=require(_0x6cb3('0x3'));var sox=require(_0x6cb3('0x4'));var csv=require(_0x6cb3('0x5'));var ejs=require(_0x6cb3('0x6'));var fs=require('fs');var fs_extra=require(_0x6cb3('0x7'));var _=require(_0x6cb3('0x8'));var squel=require(_0x6cb3('0x9'));var crypto=require('crypto');var jsforce=require(_0x6cb3('0xa'));var deskjs=require(_0x6cb3('0xb'));var toCsv=require(_0x6cb3('0x5'));var querystring=require('querystring');var Papa=require(_0x6cb3('0xc'));var Redis=require('ioredis');var authService=require(_0x6cb3('0xd'));var qs=require(_0x6cb3('0xe'));var as=require(_0x6cb3('0xf'));var hardwareService=require(_0x6cb3('0x10'));var logger=require(_0x6cb3('0x11'))(_0x6cb3('0x12'));var utils=require('../../config/utils');var config=require(_0x6cb3('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x6cb3('0x14'))['db'];function respondWithStatusCode(_0x18676b,_0x64ea6b){_0x64ea6b=_0x64ea6b||0xcc;return function(_0x1dc2eb){if(_0x1dc2eb){return _0x18676b['sendStatus'](_0x64ea6b);}return _0x18676b[_0x6cb3('0x15')](_0x64ea6b)[_0x6cb3('0x16')]();};}function respondWithResult(_0x4e5591,_0x71d69){_0x71d69=_0x71d69||0xc8;return function(_0x89a24b){if(_0x89a24b){return _0x4e5591['status'](_0x71d69)[_0x6cb3('0x17')](_0x89a24b);}};}function respondWithFilteredResult(_0x441d77,_0x12c87){return function(_0x34b869){if(_0x34b869){var _0x445782=typeof _0x12c87[_0x6cb3('0x18')]==='undefined'&&typeof _0x12c87['limit']===_0x6cb3('0x19');var _0x1d8ca3=_0x34b869['count'];var _0x28f19a=_0x445782?0x0:_0x12c87['offset'];var _0x763855=_0x445782?_0x34b869[_0x6cb3('0x1a')]:_0x12c87['offset']+_0x12c87['limit'];var _0x4af033;if(_0x763855>=_0x1d8ca3){_0x763855=_0x1d8ca3;_0x4af033=0xc8;}else{_0x4af033=0xce;}_0x441d77[_0x6cb3('0x15')](_0x4af033);return _0x441d77[_0x6cb3('0x1b')]('Content-Range',_0x28f19a+'-'+_0x763855+'/'+_0x1d8ca3)[_0x6cb3('0x17')](_0x34b869);}return null;};}function patchUpdates(_0x3e0b63){return function(_0x21925a){try{jsonpatch[_0x6cb3('0x1c')](_0x21925a,_0x3e0b63,!![]);}catch(_0x456833){return BPromise[_0x6cb3('0x1d')](_0x456833);}return _0x21925a[_0x6cb3('0x1e')]();};}function saveUpdates(_0x408f8f,_0x313b79){return function(_0x2aa7f7){if(_0x2aa7f7){return _0x2aa7f7[_0x6cb3('0x1f')](_0x408f8f)[_0x6cb3('0x20')](function(_0x5d0085){return _0x5d0085;});}return null;};}function removeEntity(_0x2780db,_0x3fc35d){return function(_0x3fee9e){if(_0x3fee9e){return _0x3fee9e[_0x6cb3('0x21')]()['then'](function(){var _0x59ec4f=_0x3fee9e['get']({'plain':!![]});var _0x503628=_0x6cb3('0x22');return db[_0x6cb3('0x23')]['destroy']({'where':{'type':_0x503628,'resourceId':_0x59ec4f['id']}})[_0x6cb3('0x20')](function(){return _0x3fee9e;});})[_0x6cb3('0x20')](function(){_0x2780db[_0x6cb3('0x15')](0xcc)[_0x6cb3('0x16')]();});}};}function handleEntityNotFound(_0x47fb02,_0x58c9ad){return function(_0x4d601a){if(!_0x4d601a){_0x47fb02[_0x6cb3('0x24')](0x194);}return _0x4d601a;};}function handleError(_0x50d825,_0x17aeab){_0x17aeab=_0x17aeab||0x1f4;return function(_0x8a545f){logger['error'](_0x8a545f['stack']);if(_0x8a545f[_0x6cb3('0x25')]){delete _0x8a545f['name'];}_0x50d825[_0x6cb3('0x15')](_0x17aeab)[_0x6cb3('0x26')](_0x8a545f);};}exports[_0x6cb3('0x27')]=function(_0x20f5e,_0x31a384){var _0x4d756b={},_0x2435ef={},_0x255df6={'count':0x0,'rows':[]};var _0x896e5e=_[_0x6cb3('0x28')](db[_0x6cb3('0x29')][_0x6cb3('0x2a')],function(_0x2d7542){return{'name':_0x2d7542[_0x6cb3('0x2b')],'type':_0x2d7542[_0x6cb3('0x2c')][_0x6cb3('0x2d')]};});_0x2435ef[_0x6cb3('0x2e')]=_['map'](_0x896e5e,_0x6cb3('0x25'));_0x2435ef['query']=_['keys'](_0x20f5e[_0x6cb3('0x2f')]);_0x2435ef[_0x6cb3('0x30')]=_[_0x6cb3('0x31')](_0x2435ef['model'],_0x2435ef[_0x6cb3('0x2f')]);_0x4d756b[_0x6cb3('0x32')]=_[_0x6cb3('0x31')](_0x2435ef[_0x6cb3('0x2e')],qs[_0x6cb3('0x33')](_0x20f5e[_0x6cb3('0x2f')]['fields']));_0x4d756b[_0x6cb3('0x32')]=_0x4d756b[_0x6cb3('0x32')][_0x6cb3('0x34')]?_0x4d756b['attributes']:_0x2435ef[_0x6cb3('0x2e')];if(!_0x20f5e[_0x6cb3('0x2f')][_0x6cb3('0x35')](_0x6cb3('0x36'))){_0x4d756b[_0x6cb3('0x37')]=qs['limit'](_0x20f5e[_0x6cb3('0x2f')][_0x6cb3('0x37')]);_0x4d756b[_0x6cb3('0x18')]=qs['offset'](_0x20f5e[_0x6cb3('0x2f')][_0x6cb3('0x18')]);}_0x4d756b[_0x6cb3('0x38')]=qs[_0x6cb3('0x39')](_0x20f5e[_0x6cb3('0x2f')]['sort']);_0x4d756b[_0x6cb3('0x3a')]=qs[_0x6cb3('0x30')](_[_0x6cb3('0x3b')](_0x20f5e[_0x6cb3('0x2f')],_0x2435ef[_0x6cb3('0x30')]),_0x896e5e);if(_0x20f5e[_0x6cb3('0x2f')][_0x6cb3('0x3c')]){_0x4d756b[_0x6cb3('0x3a')]=_[_0x6cb3('0x3d')](_0x4d756b['where'],{'$or':[{'key':{'$like':'%'+_0x20f5e['query']['filter']+'%'}},{'value':{'$like':'%'+_0x20f5e['query'][_0x6cb3('0x3c')]+'%'}}]});}_0x4d756b=_['merge']({},_0x4d756b,_0x20f5e[_0x6cb3('0x3e')]);var _0x212a2b={'where':_0x4d756b[_0x6cb3('0x3a')]};return db['CannedAnswer'][_0x6cb3('0x1a')](_0x212a2b)[_0x6cb3('0x20')](function(_0x543bab){_0x255df6[_0x6cb3('0x1a')]=_0x543bab;if(_0x20f5e[_0x6cb3('0x2f')][_0x6cb3('0x3f')]){_0x4d756b[_0x6cb3('0x40')]=[{'all':!![]}];}return db[_0x6cb3('0x29')][_0x6cb3('0x41')](_0x4d756b);})[_0x6cb3('0x20')](function(_0x15431e){_0x255df6[_0x6cb3('0x42')]=_0x15431e;return _0x255df6;})[_0x6cb3('0x20')](respondWithFilteredResult(_0x31a384,_0x4d756b))[_0x6cb3('0x43')](handleError(_0x31a384,null));};exports[_0x6cb3('0x44')]=function(_0x2cfb4d,_0x56bcfe){var _0x5b216a={'raw':!![],'where':{'id':_0x2cfb4d[_0x6cb3('0x45')]['id']}},_0x455096={};_0x455096[_0x6cb3('0x2e')]=_[_0x6cb3('0x46')](db[_0x6cb3('0x29')][_0x6cb3('0x2a')]);_0x455096['query']=_[_0x6cb3('0x46')](_0x2cfb4d[_0x6cb3('0x2f')]);_0x455096[_0x6cb3('0x30')]=_[_0x6cb3('0x31')](_0x455096[_0x6cb3('0x2e')],_0x455096[_0x6cb3('0x2f')]);_0x5b216a[_0x6cb3('0x32')]=_[_0x6cb3('0x31')](_0x455096['model'],qs[_0x6cb3('0x33')](_0x2cfb4d[_0x6cb3('0x2f')][_0x6cb3('0x33')]));_0x5b216a[_0x6cb3('0x32')]=_0x5b216a['attributes'][_0x6cb3('0x34')]?_0x5b216a[_0x6cb3('0x32')]:_0x455096[_0x6cb3('0x2e')];if(_0x2cfb4d[_0x6cb3('0x2f')]['includeAll']){_0x5b216a['include']=[{'all':!![]}];}_0x5b216a=_[_0x6cb3('0x3d')]({},_0x5b216a,_0x2cfb4d[_0x6cb3('0x3e')]);return db[_0x6cb3('0x29')][_0x6cb3('0x47')](_0x5b216a)[_0x6cb3('0x20')](handleEntityNotFound(_0x56bcfe,null))[_0x6cb3('0x20')](respondWithResult(_0x56bcfe,null))[_0x6cb3('0x43')](handleError(_0x56bcfe,null));};exports['update']=function(_0x488296,_0x22604c){if(_0x488296[_0x6cb3('0x48')]['id']){delete _0x488296['body']['id'];}return db[_0x6cb3('0x29')]['find']({'where':{'id':_0x488296[_0x6cb3('0x45')]['id']}})['then'](handleEntityNotFound(_0x22604c,null))[_0x6cb3('0x20')](saveUpdates(_0x488296[_0x6cb3('0x48')],null))['then'](respondWithResult(_0x22604c,null))['catch'](handleError(_0x22604c,null));};exports[_0x6cb3('0x21')]=function(_0x4e1838,_0x552f97){return db[_0x6cb3('0x29')][_0x6cb3('0x47')]({'where':{'id':_0x4e1838[_0x6cb3('0x45')]['id']}})[_0x6cb3('0x20')](handleEntityNotFound(_0x552f97,null))['then'](removeEntity(_0x552f97,null))[_0x6cb3('0x43')](handleError(_0x552f97,null));};exports[_0x6cb3('0x49')]=function(_0x2f3019,_0x120bae){var _0x63fc4c={'key':_0x2f3019['body'][_0x6cb3('0x2d')]};if(_0x2f3019[_0x6cb3('0x48')][_0x6cb3('0x4a')]){_0x63fc4c[_0x6cb3('0x4a')]=_0x2f3019[_0x6cb3('0x48')][_0x6cb3('0x4a')];}else if(_0x2f3019[_0x6cb3('0x48')][_0x6cb3('0x4b')]){_0x63fc4c[_0x6cb3('0x4b')]=_0x2f3019['body'][_0x6cb3('0x4b')];}else if(_0x2f3019[_0x6cb3('0x48')][_0x6cb3('0x4c')]){_0x63fc4c['OpenchannelAccountId']=_0x2f3019['body'][_0x6cb3('0x4c')];}else if(_0x2f3019['body'][_0x6cb3('0x4d')]){_0x63fc4c['ChatWebsiteId']=_0x2f3019[_0x6cb3('0x48')][_0x6cb3('0x4d')];}return db[_0x6cb3('0x29')][_0x6cb3('0x47')]({'where':_0x63fc4c})['then'](function(_0x42f787){if(_0x42f787){throw new db[(_0x6cb3('0x4e'))]['ValidationError'](_0x6cb3('0x4f'));}return db[_0x6cb3('0x29')]['create'](_0x2f3019['body']);})[_0x6cb3('0x20')](function(_0x11821a){var _0x55f06f=_0x2f3019[_0x6cb3('0x50')][_0x6cb3('0x51')]({'plain':!![]});if(!_0x55f06f)throw new Error(_0x6cb3('0x52'));if(_0x55f06f[_0x6cb3('0x53')]===_0x6cb3('0x50')){var _0x118c38=_0x11821a[_0x6cb3('0x51')]({'plain':!![]});return db['UserProfileSection'][_0x6cb3('0x47')]({'where':{'name':_0x6cb3('0x22'),'userProfileId':_0x55f06f['userProfileId']},'raw':!![]})[_0x6cb3('0x20')](function(_0x5e91d3){if(_0x5e91d3&&_0x5e91d3[_0x6cb3('0x54')]===0x0){return db['UserProfileResource'][_0x6cb3('0x49')]({'name':_0x118c38[_0x6cb3('0x25')],'resourceId':_0x118c38['id'],'type':_0x5e91d3[_0x6cb3('0x25')],'sectionId':_0x5e91d3['id']},{})[_0x6cb3('0x20')](function(){return _0x11821a;});}else{return _0x11821a;}})[_0x6cb3('0x43')](function(_0x35640f){logger[_0x6cb3('0x55')](_0x6cb3('0x56'),_0x35640f);throw _0x35640f;});}return _0x11821a;})[_0x6cb3('0x20')](respondWithResult(_0x120bae,0xc9))[_0x6cb3('0x43')](handleError(_0x120bae,null));}; \ No newline at end of file +var _0xe302=['set','apply','save','destroy','get','CannedAnswers','then','error','stack','name','map','CannedAnswer','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','where','filter','merge','includeAll','include','rows','length','find','catch','update','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count'];(function(_0x541b29,_0x59c1e1){var _0x518f84=function(_0x573034){while(--_0x573034){_0x541b29['push'](_0x541b29['shift']());}};_0x518f84(++_0x59c1e1);}(_0xe302,0xdd));var _0x2e30=function(_0x15cd58,_0x52b016){_0x15cd58=_0x15cd58-0x0;var _0x233c74=_0xe302[_0x15cd58];return _0x233c74;};'use strict';var emlformat=require(_0x2e30('0x0'));var rimraf=require(_0x2e30('0x1'));var zipdir=require(_0x2e30('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2e30('0x3'));var moment=require('moment');var BPromise=require(_0x2e30('0x4'));var Mustache=require(_0x2e30('0x5'));var util=require(_0x2e30('0x6'));var path=require(_0x2e30('0x7'));var sox=require(_0x2e30('0x8'));var csv=require(_0x2e30('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2e30('0xa'));var _=require(_0x2e30('0xb'));var squel=require(_0x2e30('0xc'));var crypto=require(_0x2e30('0xd'));var jsforce=require(_0x2e30('0xe'));var deskjs=require(_0x2e30('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2e30('0x10'));var Redis=require(_0x2e30('0x11'));var authService=require(_0x2e30('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2e30('0x13'));var logger=require(_0x2e30('0x14'))(_0x2e30('0x15'));var utils=require(_0x2e30('0x16'));var config=require(_0x2e30('0x17'));var licenseUtil=require(_0x2e30('0x18'));var db=require(_0x2e30('0x19'))['db'];function respondWithStatusCode(_0x3219ff,_0x4d38bb){_0x4d38bb=_0x4d38bb||0xcc;return function(_0x234d12){if(_0x234d12){return _0x3219ff[_0x2e30('0x1a')](_0x4d38bb);}return _0x3219ff['status'](_0x4d38bb)[_0x2e30('0x1b')]();};}function respondWithResult(_0x537f59,_0x354dac){_0x354dac=_0x354dac||0xc8;return function(_0x306098){if(_0x306098){return _0x537f59[_0x2e30('0x1c')](_0x354dac)[_0x2e30('0x1d')](_0x306098);}};}function respondWithFilteredResult(_0x3797bc,_0x90dbc0){return function(_0x5d14ef){if(_0x5d14ef){var _0x4c4731=typeof _0x90dbc0[_0x2e30('0x1e')]===_0x2e30('0x1f')&&typeof _0x90dbc0[_0x2e30('0x20')]===_0x2e30('0x1f');var _0x1c0d66=_0x5d14ef[_0x2e30('0x21')];var _0x1e7d0b=_0x4c4731?0x0:_0x90dbc0[_0x2e30('0x1e')];var _0x4cd52f=_0x4c4731?_0x5d14ef[_0x2e30('0x21')]:_0x90dbc0[_0x2e30('0x1e')]+_0x90dbc0[_0x2e30('0x20')];var _0x4c2a79;if(_0x4cd52f>=_0x1c0d66){_0x4cd52f=_0x1c0d66;_0x4c2a79=0xc8;}else{_0x4c2a79=0xce;}_0x3797bc[_0x2e30('0x1c')](_0x4c2a79);return _0x3797bc[_0x2e30('0x22')]('Content-Range',_0x1e7d0b+'-'+_0x4cd52f+'/'+_0x1c0d66)[_0x2e30('0x1d')](_0x5d14ef);}return null;};}function patchUpdates(_0xa8642c){return function(_0x1fa759){try{jsonpatch[_0x2e30('0x23')](_0x1fa759,_0xa8642c,!![]);}catch(_0x36e5a2){return BPromise['reject'](_0x36e5a2);}return _0x1fa759[_0x2e30('0x24')]();};}function saveUpdates(_0x59f159,_0x41537e){return function(_0x548e66){if(_0x548e66){return _0x548e66['update'](_0x59f159)['then'](function(_0x530a95){return _0x530a95;});}return null;};}function removeEntity(_0x5a85f0,_0x546c8c){return function(_0x30c07c){if(_0x30c07c){return _0x30c07c[_0x2e30('0x25')]()['then'](function(){var _0x4d4c6f=_0x30c07c[_0x2e30('0x26')]({'plain':!![]});var _0x32e9dd=_0x2e30('0x27');return db['UserProfileResource'][_0x2e30('0x25')]({'where':{'type':_0x32e9dd,'resourceId':_0x4d4c6f['id']}})[_0x2e30('0x28')](function(){return _0x30c07c;});})[_0x2e30('0x28')](function(){_0x5a85f0[_0x2e30('0x1c')](0xcc)[_0x2e30('0x1b')]();});}};}function handleEntityNotFound(_0x452661,_0x1a3e94){return function(_0x2d7263){if(!_0x2d7263){_0x452661[_0x2e30('0x1a')](0x194);}return _0x2d7263;};}function handleError(_0x118e7f,_0x5cfe24){_0x5cfe24=_0x5cfe24||0x1f4;return function(_0x1ce148){logger[_0x2e30('0x29')](_0x1ce148[_0x2e30('0x2a')]);if(_0x1ce148[_0x2e30('0x2b')]){delete _0x1ce148[_0x2e30('0x2b')];}_0x118e7f[_0x2e30('0x1c')](_0x5cfe24)['send'](_0x1ce148);};}exports['index']=function(_0x5dabe4,_0x55ae11){var _0x17e029={},_0x31cc59={},_0x17acca={'count':0x0,'rows':[]};var _0x39808c=_[_0x2e30('0x2c')](db[_0x2e30('0x2d')][_0x2e30('0x2e')],function(_0x4fb7d4){return{'name':_0x4fb7d4[_0x2e30('0x2f')],'type':_0x4fb7d4[_0x2e30('0x30')][_0x2e30('0x31')]};});_0x31cc59['model']=_[_0x2e30('0x2c')](_0x39808c,_0x2e30('0x2b'));_0x31cc59[_0x2e30('0x32')]=_[_0x2e30('0x33')](_0x5dabe4[_0x2e30('0x32')]);_0x31cc59[_0x2e30('0x34')]=_[_0x2e30('0x35')](_0x31cc59[_0x2e30('0x36')],_0x31cc59[_0x2e30('0x32')]);_0x17e029['attributes']=_[_0x2e30('0x35')](_0x31cc59[_0x2e30('0x36')],qs[_0x2e30('0x37')](_0x5dabe4[_0x2e30('0x32')][_0x2e30('0x37')]));_0x17e029[_0x2e30('0x38')]=_0x17e029['attributes']['length']?_0x17e029['attributes']:_0x31cc59[_0x2e30('0x36')];if(!_0x5dabe4['query'][_0x2e30('0x39')](_0x2e30('0x3a'))){_0x17e029[_0x2e30('0x20')]=qs['limit'](_0x5dabe4[_0x2e30('0x32')]['limit']);_0x17e029[_0x2e30('0x1e')]=qs[_0x2e30('0x1e')](_0x5dabe4['query']['offset']);}_0x17e029['order']=qs[_0x2e30('0x3b')](_0x5dabe4['query'][_0x2e30('0x3b')]);_0x17e029[_0x2e30('0x3c')]=qs[_0x2e30('0x34')](_['pick'](_0x5dabe4[_0x2e30('0x32')],_0x31cc59[_0x2e30('0x34')]),_0x39808c);if(_0x5dabe4[_0x2e30('0x32')][_0x2e30('0x3d')]){_0x17e029['where']=_[_0x2e30('0x3e')](_0x17e029[_0x2e30('0x3c')],{'$or':[{'key':{'$like':'%'+_0x5dabe4[_0x2e30('0x32')][_0x2e30('0x3d')]+'%'}},{'value':{'$like':'%'+_0x5dabe4[_0x2e30('0x32')][_0x2e30('0x3d')]+'%'}}]});}_0x17e029=_[_0x2e30('0x3e')]({},_0x17e029,_0x5dabe4['options']);var _0x512b16={'where':_0x17e029[_0x2e30('0x3c')]};return db[_0x2e30('0x2d')][_0x2e30('0x21')](_0x512b16)['then'](function(_0x3911f5){_0x17acca['count']=_0x3911f5;if(_0x5dabe4[_0x2e30('0x32')][_0x2e30('0x3f')]){_0x17e029[_0x2e30('0x40')]=[{'all':!![]}];}return db[_0x2e30('0x2d')]['findAll'](_0x17e029);})['then'](function(_0x280487){_0x17acca[_0x2e30('0x41')]=_0x280487;return _0x17acca;})[_0x2e30('0x28')](respondWithFilteredResult(_0x55ae11,_0x17e029))['catch'](handleError(_0x55ae11,null));};exports['show']=function(_0x377687,_0x330dda){var _0x1e8ce9={'raw':!![],'where':{'id':_0x377687['params']['id']}},_0x54e903={};_0x54e903[_0x2e30('0x36')]=_[_0x2e30('0x33')](db[_0x2e30('0x2d')][_0x2e30('0x2e')]);_0x54e903[_0x2e30('0x32')]=_[_0x2e30('0x33')](_0x377687['query']);_0x54e903[_0x2e30('0x34')]=_[_0x2e30('0x35')](_0x54e903[_0x2e30('0x36')],_0x54e903[_0x2e30('0x32')]);_0x1e8ce9['attributes']=_[_0x2e30('0x35')](_0x54e903[_0x2e30('0x36')],qs[_0x2e30('0x37')](_0x377687[_0x2e30('0x32')][_0x2e30('0x37')]));_0x1e8ce9[_0x2e30('0x38')]=_0x1e8ce9['attributes'][_0x2e30('0x42')]?_0x1e8ce9[_0x2e30('0x38')]:_0x54e903[_0x2e30('0x36')];if(_0x377687[_0x2e30('0x32')]['includeAll']){_0x1e8ce9[_0x2e30('0x40')]=[{'all':!![]}];}_0x1e8ce9=_[_0x2e30('0x3e')]({},_0x1e8ce9,_0x377687['options']);return db[_0x2e30('0x2d')][_0x2e30('0x43')](_0x1e8ce9)[_0x2e30('0x28')](handleEntityNotFound(_0x330dda,null))[_0x2e30('0x28')](respondWithResult(_0x330dda,null))[_0x2e30('0x44')](handleError(_0x330dda,null));};exports[_0x2e30('0x45')]=function(_0x525fbd,_0x5e4317){if(_0x525fbd[_0x2e30('0x46')]['id']){delete _0x525fbd['body']['id'];}return db[_0x2e30('0x2d')][_0x2e30('0x43')]({'where':{'id':_0x525fbd[_0x2e30('0x47')]['id']}})[_0x2e30('0x28')](handleEntityNotFound(_0x5e4317,null))[_0x2e30('0x28')](saveUpdates(_0x525fbd['body'],null))[_0x2e30('0x28')](respondWithResult(_0x5e4317,null))[_0x2e30('0x44')](handleError(_0x5e4317,null));};exports[_0x2e30('0x25')]=function(_0x2cbd2c,_0x4b62c1){return db[_0x2e30('0x2d')][_0x2e30('0x43')]({'where':{'id':_0x2cbd2c['params']['id']}})['then'](handleEntityNotFound(_0x4b62c1,null))['then'](removeEntity(_0x4b62c1,null))[_0x2e30('0x44')](handleError(_0x4b62c1,null));};exports[_0x2e30('0x48')]=function(_0x53171f,_0x311875){var _0x410a08={'key':_0x53171f['body'][_0x2e30('0x31')]};if(_0x53171f[_0x2e30('0x46')][_0x2e30('0x49')]){_0x410a08[_0x2e30('0x49')]=_0x53171f[_0x2e30('0x46')][_0x2e30('0x49')];}else if(_0x53171f['body'][_0x2e30('0x4a')]){_0x410a08[_0x2e30('0x4a')]=_0x53171f['body'][_0x2e30('0x4a')];}else if(_0x53171f['body'][_0x2e30('0x4b')]){_0x410a08['OpenchannelAccountId']=_0x53171f[_0x2e30('0x46')][_0x2e30('0x4b')];}else if(_0x53171f[_0x2e30('0x46')][_0x2e30('0x4c')]){_0x410a08[_0x2e30('0x4c')]=_0x53171f[_0x2e30('0x46')][_0x2e30('0x4c')];}return db[_0x2e30('0x2d')]['find']({'where':_0x410a08})[_0x2e30('0x28')](function(_0x422985){if(_0x422985){throw new db[(_0x2e30('0x4d'))]['ValidationError'](_0x2e30('0x4e'));}return db[_0x2e30('0x2d')][_0x2e30('0x48')](_0x53171f['body']);})['then'](function(_0x46c3aa){var _0x10f6fa=_0x53171f[_0x2e30('0x4f')][_0x2e30('0x26')]({'plain':!![]});if(!_0x10f6fa)throw new Error(_0x2e30('0x50'));if(_0x10f6fa[_0x2e30('0x51')]===_0x2e30('0x4f')){var _0x7f0ad1=_0x46c3aa[_0x2e30('0x26')]({'plain':!![]});return db[_0x2e30('0x52')][_0x2e30('0x43')]({'where':{'name':'CannedAnswers','userProfileId':_0x10f6fa[_0x2e30('0x53')]},'raw':!![]})['then'](function(_0x4c1f6b){if(_0x4c1f6b&&_0x4c1f6b['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x7f0ad1[_0x2e30('0x2b')],'resourceId':_0x7f0ad1['id'],'type':_0x4c1f6b[_0x2e30('0x2b')],'sectionId':_0x4c1f6b['id']},{})[_0x2e30('0x28')](function(){return _0x46c3aa;});}else{return _0x46c3aa;}})['catch'](function(_0x369c05){logger[_0x2e30('0x29')](_0x2e30('0x54'),_0x369c05);throw _0x369c05;});}return _0x46c3aa;})[_0x2e30('0x28')](respondWithResult(_0x311875,0xc9))[_0x2e30('0x44')](handleError(_0x311875,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 79897bd..f84a71e 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 _0xe8cd=['tools_canned_answers','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports'];(function(_0x380979,_0x55cdd2){var _0x22e825=function(_0x54b8c0){while(--_0x54b8c0){_0x380979['push'](_0x380979['shift']());}};_0x22e825(++_0x55cdd2);}(_0xe8cd,0x106));var _0xde8c=function(_0x1c470d,_0x81d66b){_0x1c470d=_0x1c470d-0x0;var _0x12141b=_0xe8cd[_0x1c470d];return _0x12141b;};'use strict';var _=require('lodash');var util=require(_0xde8c('0x0'));var logger=require(_0xde8c('0x1'))(_0xde8c('0x2'));var moment=require(_0xde8c('0x3'));var BPromise=require(_0xde8c('0x4'));var rp=require(_0xde8c('0x5'));var fs=require('fs');var path=require(_0xde8c('0x6'));var rimraf=require(_0xde8c('0x7'));var config=require(_0xde8c('0x8'));var attributes=require(_0xde8c('0x9'));module[_0xde8c('0xa')]=function(_0x55dc31,_0x1b9e2b){return _0x55dc31['define']('CannedAnswer',attributes,{'tableName':_0xde8c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xde8c('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xc592=['tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','./cannedAnswer.attributes','exports','define','CannedAnswer'];(function(_0x4a0c7c,_0x4b80e3){var _0x501130=function(_0x1525dc){while(--_0x1525dc){_0x4a0c7c['push'](_0x4a0c7c['shift']());}};_0x501130(++_0x4b80e3);}(_0xc592,0xd5));var _0x2c59=function(_0x115488,_0x393f77){_0x115488=_0x115488-0x0;var _0x1089fc=_0xc592[_0x115488];return _0x1089fc;};'use strict';var _=require(_0x2c59('0x0'));var util=require('util');var logger=require(_0x2c59('0x1'))(_0x2c59('0x2'));var moment=require(_0x2c59('0x3'));var BPromise=require(_0x2c59('0x4'));var rp=require(_0x2c59('0x5'));var fs=require('fs');var path=require(_0x2c59('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2c59('0x7'));module[_0x2c59('0x8')]=function(_0x5a5ada,_0x4fe3f9){return _0x5a5ada[_0x2c59('0x9')](_0x2c59('0xa'),attributes,{'tableName':_0x2c59('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2c59('0xc'),'collate':_0x2c59('0xd')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index c44336f..ff4e1a8 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(_0x4fd1b4,_0x43fb36){var _0x21f3bb=function(_0x39e7e2){while(--_0x39e7e2){_0x4fd1b4['push'](_0x4fd1b4['shift']());}};_0x21f3bb(++_0x43fb36);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var 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(_0x496146,_0x4d083a){var _0x919dd=function(_0x4c862e){while(--_0x4c862e){_0x496146['push'](_0x496146['shift']());}};_0x919dd(++_0x4d083a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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 1ccb4f0..e88bf3d 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 _0x3334=['../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','show','post','create','/:id','update','delete','destroy','exports','util','connect-timeout','Router','fs-extra'];(function(_0x45a0b8,_0x40c46d){var _0x221e45=function(_0x3f5508){while(--_0x3f5508){_0x45a0b8['push'](_0x45a0b8['shift']());}};_0x221e45(++_0x40c46d);}(_0x3334,0x13f));var _0x4333=function(_0x1ea6e5,_0x5638fd){_0x1ea6e5=_0x1ea6e5-0x0;var _0x5347d2=_0x3334[_0x1ea6e5];return _0x5347d2;};'use strict';var multer=require('multer');var util=require(_0x4333('0x0'));var path=require('path');var timeout=require(_0x4333('0x1'));var express=require('express');var router=express[_0x4333('0x2')]();var fs_extra=require(_0x4333('0x3'));var auth=require(_0x4333('0x4'));var interaction=require(_0x4333('0x5'));var config=require('../../config/environment');var controller=require(_0x4333('0x6'));router[_0x4333('0x7')]('/',auth[_0x4333('0x8')](),controller['index']);router[_0x4333('0x7')]('/:id',auth[_0x4333('0x8')](),controller[_0x4333('0x9')]);router[_0x4333('0xa')]('/',auth[_0x4333('0x8')](),controller[_0x4333('0xb')]);router['put'](_0x4333('0xc'),auth['isAuthenticated'](),controller[_0x4333('0xd')]);router[_0x4333('0xe')](_0x4333('0xc'),auth[_0x4333('0x8')](),controller[_0x4333('0xf')]);module[_0x4333('0x10')]=router; \ No newline at end of file +var _0x1c2d=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','create','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x3bc565,_0x1c9a3f){var _0x23ced3=function(_0x29dfa0){while(--_0x29dfa0){_0x3bc565['push'](_0x3bc565['shift']());}};_0x23ced3(++_0x1c9a3f);}(_0x1c2d,0x16d));var _0xd1c2=function(_0x3a34f2,_0x16d340){_0x3a34f2=_0x3a34f2-0x0;var _0x42847b=_0x1c2d[_0x3a34f2];return _0x42847b;};'use strict';var multer=require(_0xd1c2('0x0'));var util=require(_0xd1c2('0x1'));var path=require('path');var timeout=require(_0xd1c2('0x2'));var express=require(_0xd1c2('0x3'));var router=express[_0xd1c2('0x4')]();var fs_extra=require(_0xd1c2('0x5'));var auth=require(_0xd1c2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd1c2('0x7'));var controller=require('./cannedAnswer.controller');router[_0xd1c2('0x8')]('/',auth[_0xd1c2('0x9')](),controller[_0xd1c2('0xa')]);router['get'](_0xd1c2('0xb'),auth[_0xd1c2('0x9')](),controller['show']);router['post']('/',auth[_0xd1c2('0x9')](),controller[_0xd1c2('0xc')]);router['put'](_0xd1c2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xd1c2('0xd')](_0xd1c2('0xb'),auth[_0xd1c2('0x9')](),controller[_0xd1c2('0xe')]);module[_0xd1c2('0xf')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index dbd5325..0d50273 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 _0xe50e=['sequelize','STRING','INTEGER'];(function(_0x46e011,_0xf3affa){var _0x46fdea=function(_0x1651bb){while(--_0x1651bb){_0x46e011['push'](_0x46e011['shift']());}};_0x46fdea(++_0xf3affa);}(_0xe50e,0xf9));var _0xee50=function(_0x7bf57e,_0x2a5489){_0x7bf57e=_0x7bf57e-0x0;var _0x43b33d=_0xe50e[_0x7bf57e];return _0x43b33d;};'use strict';var Sequelize=require(_0xee50('0x0'));module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xee50('0x1')]},'src':{'type':Sequelize[_0xee50('0x1')]},'dst':{'type':Sequelize[_0xee50('0x1')]},'dcontext':{'type':Sequelize[_0xee50('0x1')]},'channel':{'type':Sequelize[_0xee50('0x1')]},'dstchannel':{'type':Sequelize[_0xee50('0x1')]},'lastapp':{'type':Sequelize[_0xee50('0x1')]},'lastdata':{'type':Sequelize[_0xee50('0x1')]},'duration':{'type':Sequelize[_0xee50('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xee50('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xee50('0x1')]},'amaflags':{'type':Sequelize[_0xee50('0x2')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xee50('0x1')]},'userfield':{'type':Sequelize[_0xee50('0x1')]},'uniqueid':{'type':Sequelize[_0xee50('0x1')]},'linkedid':{'type':Sequelize[_0xee50('0x1')]},'sequence':{'type':Sequelize[_0xee50('0x1')]},'peeraccount':{'type':Sequelize[_0xee50('0x1')]},'type':{'type':Sequelize[_0xee50('0x1')]},'tag':{'type':Sequelize[_0xee50('0x1')]}}; \ No newline at end of file +var _0x2621=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x389a45,_0x5a36cf){var _0x42d634=function(_0x4150a9){while(--_0x4150a9){_0x389a45['push'](_0x389a45['shift']());}};_0x42d634(++_0x5a36cf);}(_0x2621,0x1d2));var _0x1262=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2621[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x1262('0x0'));module[_0x1262('0x1')]={'calldate':{'type':Sequelize[_0x1262('0x2')],'allowNull':![],'defaultValue':_0x1262('0x3')},'clid':{'type':Sequelize[_0x1262('0x4')]},'src':{'type':Sequelize[_0x1262('0x4')]},'dst':{'type':Sequelize[_0x1262('0x4')]},'dcontext':{'type':Sequelize[_0x1262('0x4')]},'channel':{'type':Sequelize[_0x1262('0x4')]},'dstchannel':{'type':Sequelize[_0x1262('0x4')]},'lastapp':{'type':Sequelize[_0x1262('0x4')]},'lastdata':{'type':Sequelize[_0x1262('0x4')]},'duration':{'type':Sequelize[_0x1262('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x1262('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x1262('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x1262('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x1262('0x4')]},'sequence':{'type':Sequelize[_0x1262('0x4')]},'peeraccount':{'type':Sequelize[_0x1262('0x4')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x1262('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index ca98fe9..6c56400 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 _0xd6d2=['../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','Cdr','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','catch','show','params','rawAttributes','includeAll','find','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x1df090,_0x21b1ff){var _0x23f609=function(_0x522ac1){while(--_0x522ac1){_0x1df090['push'](_0x1df090['shift']());}};_0x23f609(++_0x21b1ff);}(_0xd6d2,0xcb));var _0x2d6d=function(_0x23adad,_0x1b0b3a){_0x23adad=_0x23adad-0x0;var _0x4b63c0=_0xd6d2[_0x23adad];return _0x4b63c0;};'use strict';var emlformat=require(_0x2d6d('0x0'));var rimraf=require(_0x2d6d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2d6d('0x2'));var rp=require(_0x2d6d('0x3'));var moment=require('moment');var BPromise=require(_0x2d6d('0x4'));var Mustache=require('mustache');var util=require(_0x2d6d('0x5'));var path=require(_0x2d6d('0x6'));var sox=require(_0x2d6d('0x7'));var csv=require('to-csv');var ejs=require(_0x2d6d('0x8'));var fs=require('fs');var fs_extra=require(_0x2d6d('0x9'));var _=require(_0x2d6d('0xa'));var squel=require(_0x2d6d('0xb'));var crypto=require(_0x2d6d('0xc'));var jsforce=require(_0x2d6d('0xd'));var deskjs=require(_0x2d6d('0xe'));var toCsv=require(_0x2d6d('0xf'));var querystring=require(_0x2d6d('0x10'));var Papa=require(_0x2d6d('0x11'));var Redis=require(_0x2d6d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x2d6d('0x13'));var as=require(_0x2d6d('0x14'));var hardwareService=require(_0x2d6d('0x15'));var logger=require(_0x2d6d('0x16'))(_0x2d6d('0x17'));var utils=require('../../config/utils');var config=require(_0x2d6d('0x18'));var licenseUtil=require(_0x2d6d('0x19'));var db=require(_0x2d6d('0x1a'))['db'];function respondWithStatusCode(_0x2ad9fc,_0x5c4bf6){_0x5c4bf6=_0x5c4bf6||0xcc;return function(_0x5ef174){if(_0x5ef174){return _0x2ad9fc[_0x2d6d('0x1b')](_0x5c4bf6);}return _0x2ad9fc[_0x2d6d('0x1c')](_0x5c4bf6)[_0x2d6d('0x1d')]();};}function respondWithResult(_0x3528de,_0x58bd29){_0x58bd29=_0x58bd29||0xc8;return function(_0x1ec6aa){if(_0x1ec6aa){return _0x3528de[_0x2d6d('0x1c')](_0x58bd29)['json'](_0x1ec6aa);}};}function respondWithFilteredResult(_0x586085,_0x370096){return function(_0x17340f){if(_0x17340f){var _0x109b49=typeof _0x370096['offset']===_0x2d6d('0x1e')&&typeof _0x370096['limit']==='undefined';var _0x4c3092=_0x17340f[_0x2d6d('0x1f')];var _0x4179f2=_0x109b49?0x0:_0x370096[_0x2d6d('0x20')];var _0x3c527e=_0x109b49?_0x17340f[_0x2d6d('0x1f')]:_0x370096[_0x2d6d('0x20')]+_0x370096[_0x2d6d('0x21')];var _0xa2c4a7;if(_0x3c527e>=_0x4c3092){_0x3c527e=_0x4c3092;_0xa2c4a7=0xc8;}else{_0xa2c4a7=0xce;}_0x586085[_0x2d6d('0x1c')](_0xa2c4a7);return _0x586085['set'](_0x2d6d('0x22'),_0x4179f2+'-'+_0x3c527e+'/'+_0x4c3092)[_0x2d6d('0x23')](_0x17340f);}return null;};}function patchUpdates(_0x5b0c61){return function(_0x227e44){try{jsonpatch[_0x2d6d('0x24')](_0x227e44,_0x5b0c61,!![]);}catch(_0x15cb80){return BPromise[_0x2d6d('0x25')](_0x15cb80);}return _0x227e44[_0x2d6d('0x26')]();};}function saveUpdates(_0x59234a,_0x4aaa62){return function(_0x42c2f2){if(_0x42c2f2){return _0x42c2f2[_0x2d6d('0x27')](_0x59234a)[_0x2d6d('0x28')](function(_0x585b54){return _0x585b54;});}return null;};}function removeEntity(_0x47eb0e,_0x3ae8ad){return function(_0x4e7ec8){if(_0x4e7ec8){return _0x4e7ec8['destroy']()['then'](function(){_0x47eb0e[_0x2d6d('0x1c')](0xcc)[_0x2d6d('0x1d')]();});}};}function handleEntityNotFound(_0x3da83d,_0x3f89dd){return function(_0x3e5a92){if(!_0x3e5a92){_0x3da83d['sendStatus'](0x194);}return _0x3e5a92;};}function handleError(_0x16634d,_0x1b4964){_0x1b4964=_0x1b4964||0x1f4;return function(_0x455e71){logger[_0x2d6d('0x29')](_0x455e71[_0x2d6d('0x2a')]);if(_0x455e71[_0x2d6d('0x2b')]){delete _0x455e71[_0x2d6d('0x2b')];}_0x16634d[_0x2d6d('0x1c')](_0x1b4964)[_0x2d6d('0x2c')](_0x455e71);};}exports['index']=function(_0x1016e1,_0x26d299){var _0x2e7b32={},_0x34d485={},_0x486963={'count':0x0,'rows':[]};var _0x317bde=_['map'](db[_0x2d6d('0x2d')]['rawAttributes'],function(_0x58bfc7){return{'name':_0x58bfc7[_0x2d6d('0x2e')],'type':_0x58bfc7['type'][_0x2d6d('0x2f')]};});_0x34d485[_0x2d6d('0x30')]=_['map'](_0x317bde,_0x2d6d('0x2b'));_0x34d485['query']=_[_0x2d6d('0x31')](_0x1016e1[_0x2d6d('0x32')]);_0x34d485[_0x2d6d('0x33')]=_[_0x2d6d('0x34')](_0x34d485[_0x2d6d('0x30')],_0x34d485[_0x2d6d('0x32')]);_0x2e7b32[_0x2d6d('0x35')]=_[_0x2d6d('0x34')](_0x34d485['model'],qs[_0x2d6d('0x36')](_0x1016e1[_0x2d6d('0x32')]['fields']));_0x2e7b32[_0x2d6d('0x35')]=_0x2e7b32[_0x2d6d('0x35')][_0x2d6d('0x37')]?_0x2e7b32[_0x2d6d('0x35')]:_0x34d485[_0x2d6d('0x30')];if(!_0x1016e1['query']['hasOwnProperty']('nolimit')){_0x2e7b32[_0x2d6d('0x21')]=qs[_0x2d6d('0x21')](_0x1016e1[_0x2d6d('0x32')]['limit']);_0x2e7b32[_0x2d6d('0x20')]=qs[_0x2d6d('0x20')](_0x1016e1[_0x2d6d('0x32')][_0x2d6d('0x20')]);}_0x2e7b32['order']=qs[_0x2d6d('0x38')](_0x1016e1[_0x2d6d('0x32')][_0x2d6d('0x38')]);_0x2e7b32[_0x2d6d('0x39')]=qs[_0x2d6d('0x33')](_[_0x2d6d('0x3a')](_0x1016e1[_0x2d6d('0x32')],_0x34d485['filters']),_0x317bde);if(_0x1016e1[_0x2d6d('0x32')][_0x2d6d('0x3b')]){_0x2e7b32[_0x2d6d('0x39')]=_[_0x2d6d('0x3c')](_0x2e7b32[_0x2d6d('0x39')],{'$or':_['map'](_0x317bde,function(_0x1cad57){if(_0x1cad57[_0x2d6d('0x3d')]!==_0x2d6d('0x3e')){var _0x4616df={};_0x4616df[_0x1cad57[_0x2d6d('0x2b')]]={'$like':'%'+_0x1016e1[_0x2d6d('0x32')][_0x2d6d('0x3b')]+'%'};return _0x4616df;}})});}_0x2e7b32=_[_0x2d6d('0x3c')]({},_0x2e7b32,_0x1016e1[_0x2d6d('0x3f')]);var _0x38cce8={'where':_0x2e7b32[_0x2d6d('0x39')]};return db[_0x2d6d('0x2d')][_0x2d6d('0x1f')](_0x38cce8)[_0x2d6d('0x28')](function(_0x34fc23){_0x486963[_0x2d6d('0x1f')]=_0x34fc23;if(_0x1016e1[_0x2d6d('0x32')]['includeAll']){_0x2e7b32[_0x2d6d('0x40')]=[{'all':!![]}];}return db[_0x2d6d('0x2d')][_0x2d6d('0x41')](_0x2e7b32);})[_0x2d6d('0x28')](function(_0x246d6e){_0x486963['rows']=_0x246d6e;return _0x486963;})[_0x2d6d('0x28')](respondWithFilteredResult(_0x26d299,_0x2e7b32))[_0x2d6d('0x42')](handleError(_0x26d299,null));};exports[_0x2d6d('0x43')]=function(_0x41ab2e,_0x543b4b){var _0x3b62b1={'raw':!![],'where':{'id':_0x41ab2e[_0x2d6d('0x44')]['id']}},_0x7f76ad={};_0x7f76ad[_0x2d6d('0x30')]=_[_0x2d6d('0x31')](db['Cdr'][_0x2d6d('0x45')]);_0x7f76ad[_0x2d6d('0x32')]=_['keys'](_0x41ab2e[_0x2d6d('0x32')]);_0x7f76ad[_0x2d6d('0x33')]=_[_0x2d6d('0x34')](_0x7f76ad['model'],_0x7f76ad[_0x2d6d('0x32')]);_0x3b62b1[_0x2d6d('0x35')]=_['intersection'](_0x7f76ad['model'],qs['fields'](_0x41ab2e[_0x2d6d('0x32')][_0x2d6d('0x36')]));_0x3b62b1['attributes']=_0x3b62b1[_0x2d6d('0x35')][_0x2d6d('0x37')]?_0x3b62b1[_0x2d6d('0x35')]:_0x7f76ad[_0x2d6d('0x30')];if(_0x41ab2e['query'][_0x2d6d('0x46')]){_0x3b62b1[_0x2d6d('0x40')]=[{'all':!![]}];}_0x3b62b1=_['merge']({},_0x3b62b1,_0x41ab2e[_0x2d6d('0x3f')]);return db[_0x2d6d('0x2d')][_0x2d6d('0x47')](_0x3b62b1)[_0x2d6d('0x28')](handleEntityNotFound(_0x543b4b,null))[_0x2d6d('0x28')](respondWithResult(_0x543b4b,null))[_0x2d6d('0x42')](handleError(_0x543b4b,null));};exports[_0x2d6d('0x48')]=function(_0x5ac5e9,_0xe6b038){return db[_0x2d6d('0x2d')][_0x2d6d('0x48')](_0x5ac5e9['body'],{})['then'](respondWithResult(_0xe6b038,0xc9))[_0x2d6d('0x42')](handleError(_0xe6b038,null));};exports[_0x2d6d('0x27')]=function(_0x422198,_0x4e5203){if(_0x422198[_0x2d6d('0x49')]['id']){delete _0x422198[_0x2d6d('0x49')]['id'];}return db['Cdr'][_0x2d6d('0x47')]({'where':{'id':_0x422198[_0x2d6d('0x44')]['id']}})[_0x2d6d('0x28')](handleEntityNotFound(_0x4e5203,null))[_0x2d6d('0x28')](saveUpdates(_0x422198[_0x2d6d('0x49')],null))[_0x2d6d('0x28')](respondWithResult(_0x4e5203,null))[_0x2d6d('0x42')](handleError(_0x4e5203,null));};exports[_0x2d6d('0x4a')]=function(_0x42c125,_0x1ca9a2){return db['Cdr'][_0x2d6d('0x47')]({'where':{'id':_0x42c125[_0x2d6d('0x44')]['id']}})[_0x2d6d('0x28')](handleEntityNotFound(_0x1ca9a2,null))['then'](removeEntity(_0x1ca9a2,null))[_0x2d6d('0x42')](handleError(_0x1ca9a2,null));};exports[_0x2d6d('0x4b')]=function(_0x3738b3,_0x2dbcdc){return db[_0x2d6d('0x2d')][_0x2d6d('0x4b')]()[_0x2d6d('0x28')](respondWithResult(_0x2dbcdc,null))['catch'](handleError(_0x2dbcdc,null));}; \ No newline at end of file +var _0xd6d6=['key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','Cdr','rawAttributes','fieldName','type'];(function(_0x4fdbce,_0x2370b9){var _0x234cf7=function(_0x25365c){while(--_0x25365c){_0x4fdbce['push'](_0x4fdbce['shift']());}};_0x234cf7(++_0x2370b9);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x3a8b05,_0x29d686){_0x3a8b05=_0x3a8b05-0x0;var _0x5568fb=_0xd6d6[_0x3a8b05];return _0x5568fb;};'use strict';var emlformat=require(_0x6d6d('0x0'));var rimraf=require(_0x6d6d('0x1'));var zipdir=require(_0x6d6d('0x2'));var jsonpatch=require(_0x6d6d('0x3'));var rp=require('request-promise');var moment=require(_0x6d6d('0x4'));var BPromise=require(_0x6d6d('0x5'));var Mustache=require(_0x6d6d('0x6'));var util=require(_0x6d6d('0x7'));var path=require(_0x6d6d('0x8'));var sox=require(_0x6d6d('0x9'));var csv=require(_0x6d6d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d6d('0xb'));var _=require(_0x6d6d('0xc'));var squel=require(_0x6d6d('0xd'));var crypto=require(_0x6d6d('0xe'));var jsforce=require(_0x6d6d('0xf'));var deskjs=require(_0x6d6d('0x10'));var toCsv=require(_0x6d6d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d6d('0x11'));var authService=require(_0x6d6d('0x12'));var qs=require(_0x6d6d('0x13'));var as=require(_0x6d6d('0x14'));var hardwareService=require(_0x6d6d('0x15'));var logger=require('../../config/logger')(_0x6d6d('0x16'));var utils=require(_0x6d6d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6d6d('0x18'))['db'];function respondWithStatusCode(_0x32146d,_0xe61c36){_0xe61c36=_0xe61c36||0xcc;return function(_0x3f8542){if(_0x3f8542){return _0x32146d[_0x6d6d('0x19')](_0xe61c36);}return _0x32146d[_0x6d6d('0x1a')](_0xe61c36)[_0x6d6d('0x1b')]();};}function respondWithResult(_0x2cb2dd,_0x5f4154){_0x5f4154=_0x5f4154||0xc8;return function(_0xd09ea7){if(_0xd09ea7){return _0x2cb2dd[_0x6d6d('0x1a')](_0x5f4154)[_0x6d6d('0x1c')](_0xd09ea7);}};}function respondWithFilteredResult(_0xa3b05d,_0x29cbd8){return function(_0x5d80c0){if(_0x5d80c0){var _0x2e6fdb=typeof _0x29cbd8['offset']===_0x6d6d('0x1d')&&typeof _0x29cbd8[_0x6d6d('0x1e')]===_0x6d6d('0x1d');var _0x4bb3d1=_0x5d80c0['count'];var _0x9e1e18=_0x2e6fdb?0x0:_0x29cbd8[_0x6d6d('0x1f')];var _0x2b59d4=_0x2e6fdb?_0x5d80c0[_0x6d6d('0x20')]:_0x29cbd8['offset']+_0x29cbd8['limit'];var _0x474873;if(_0x2b59d4>=_0x4bb3d1){_0x2b59d4=_0x4bb3d1;_0x474873=0xc8;}else{_0x474873=0xce;}_0xa3b05d['status'](_0x474873);return _0xa3b05d[_0x6d6d('0x21')](_0x6d6d('0x22'),_0x9e1e18+'-'+_0x2b59d4+'/'+_0x4bb3d1)[_0x6d6d('0x1c')](_0x5d80c0);}return null;};}function patchUpdates(_0x450352){return function(_0x40d35b){try{jsonpatch[_0x6d6d('0x23')](_0x40d35b,_0x450352,!![]);}catch(_0x164c67){return BPromise[_0x6d6d('0x24')](_0x164c67);}return _0x40d35b[_0x6d6d('0x25')]();};}function saveUpdates(_0x6f64e3,_0x24b10d){return function(_0x6e58e3){if(_0x6e58e3){return _0x6e58e3[_0x6d6d('0x26')](_0x6f64e3)[_0x6d6d('0x27')](function(_0x1f7f88){return _0x1f7f88;});}return null;};}function removeEntity(_0x25a02e,_0xced622){return function(_0x583b10){if(_0x583b10){return _0x583b10[_0x6d6d('0x28')]()[_0x6d6d('0x27')](function(){_0x25a02e[_0x6d6d('0x1a')](0xcc)[_0x6d6d('0x1b')]();});}};}function handleEntityNotFound(_0xf0df7f,_0x12fab2){return function(_0x554f8e){if(!_0x554f8e){_0xf0df7f[_0x6d6d('0x19')](0x194);}return _0x554f8e;};}function handleError(_0x2b5e31,_0x235451){_0x235451=_0x235451||0x1f4;return function(_0x126ac8){logger[_0x6d6d('0x29')](_0x126ac8[_0x6d6d('0x2a')]);if(_0x126ac8[_0x6d6d('0x2b')]){delete _0x126ac8['name'];}_0x2b5e31[_0x6d6d('0x1a')](_0x235451)[_0x6d6d('0x2c')](_0x126ac8);};}exports['index']=function(_0x553645,_0x3edcce){var _0x5273cd={},_0x8a9a84={},_0x57341f={'count':0x0,'rows':[]};var _0xde3272=_[_0x6d6d('0x2d')](db[_0x6d6d('0x2e')][_0x6d6d('0x2f')],function(_0x64d1f7){return{'name':_0x64d1f7[_0x6d6d('0x30')],'type':_0x64d1f7[_0x6d6d('0x31')][_0x6d6d('0x32')]};});_0x8a9a84[_0x6d6d('0x33')]=_[_0x6d6d('0x2d')](_0xde3272,'name');_0x8a9a84[_0x6d6d('0x34')]=_['keys'](_0x553645[_0x6d6d('0x34')]);_0x8a9a84[_0x6d6d('0x35')]=_[_0x6d6d('0x36')](_0x8a9a84[_0x6d6d('0x33')],_0x8a9a84['query']);_0x5273cd[_0x6d6d('0x37')]=_['intersection'](_0x8a9a84[_0x6d6d('0x33')],qs[_0x6d6d('0x38')](_0x553645['query'][_0x6d6d('0x38')]));_0x5273cd[_0x6d6d('0x37')]=_0x5273cd[_0x6d6d('0x37')][_0x6d6d('0x39')]?_0x5273cd[_0x6d6d('0x37')]:_0x8a9a84[_0x6d6d('0x33')];if(!_0x553645[_0x6d6d('0x34')][_0x6d6d('0x3a')](_0x6d6d('0x3b'))){_0x5273cd[_0x6d6d('0x1e')]=qs[_0x6d6d('0x1e')](_0x553645[_0x6d6d('0x34')][_0x6d6d('0x1e')]);_0x5273cd[_0x6d6d('0x1f')]=qs['offset'](_0x553645[_0x6d6d('0x34')][_0x6d6d('0x1f')]);}_0x5273cd[_0x6d6d('0x3c')]=qs[_0x6d6d('0x3d')](_0x553645['query']['sort']);_0x5273cd[_0x6d6d('0x3e')]=qs[_0x6d6d('0x35')](_[_0x6d6d('0x3f')](_0x553645['query'],_0x8a9a84[_0x6d6d('0x35')]),_0xde3272);if(_0x553645[_0x6d6d('0x34')][_0x6d6d('0x40')]){_0x5273cd[_0x6d6d('0x3e')]=_['merge'](_0x5273cd['where'],{'$or':_['map'](_0xde3272,function(_0x62620d){if(_0x62620d[_0x6d6d('0x31')]!==_0x6d6d('0x41')){var _0x22a49a={};_0x22a49a[_0x62620d['name']]={'$like':'%'+_0x553645[_0x6d6d('0x34')][_0x6d6d('0x40')]+'%'};return _0x22a49a;}})});}_0x5273cd=_[_0x6d6d('0x42')]({},_0x5273cd,_0x553645[_0x6d6d('0x43')]);var _0x3d632c={'where':_0x5273cd[_0x6d6d('0x3e')]};return db['Cdr'][_0x6d6d('0x20')](_0x3d632c)[_0x6d6d('0x27')](function(_0x42aff0){_0x57341f[_0x6d6d('0x20')]=_0x42aff0;if(_0x553645[_0x6d6d('0x34')][_0x6d6d('0x44')]){_0x5273cd[_0x6d6d('0x45')]=[{'all':!![]}];}return db['Cdr'][_0x6d6d('0x46')](_0x5273cd);})[_0x6d6d('0x27')](function(_0x16e177){_0x57341f[_0x6d6d('0x47')]=_0x16e177;return _0x57341f;})[_0x6d6d('0x27')](respondWithFilteredResult(_0x3edcce,_0x5273cd))['catch'](handleError(_0x3edcce,null));};exports[_0x6d6d('0x48')]=function(_0x39f2a9,_0x55dba8){var _0x452de2={'raw':!![],'where':{'id':_0x39f2a9[_0x6d6d('0x49')]['id']}},_0x50dc17={};_0x50dc17[_0x6d6d('0x33')]=_['keys'](db[_0x6d6d('0x2e')][_0x6d6d('0x2f')]);_0x50dc17[_0x6d6d('0x34')]=_[_0x6d6d('0x4a')](_0x39f2a9[_0x6d6d('0x34')]);_0x50dc17['filters']=_['intersection'](_0x50dc17[_0x6d6d('0x33')],_0x50dc17['query']);_0x452de2['attributes']=_[_0x6d6d('0x36')](_0x50dc17[_0x6d6d('0x33')],qs[_0x6d6d('0x38')](_0x39f2a9['query'][_0x6d6d('0x38')]));_0x452de2['attributes']=_0x452de2[_0x6d6d('0x37')][_0x6d6d('0x39')]?_0x452de2[_0x6d6d('0x37')]:_0x50dc17[_0x6d6d('0x33')];if(_0x39f2a9[_0x6d6d('0x34')][_0x6d6d('0x44')]){_0x452de2[_0x6d6d('0x45')]=[{'all':!![]}];}_0x452de2=_['merge']({},_0x452de2,_0x39f2a9[_0x6d6d('0x43')]);return db[_0x6d6d('0x2e')][_0x6d6d('0x4b')](_0x452de2)[_0x6d6d('0x27')](handleEntityNotFound(_0x55dba8,null))[_0x6d6d('0x27')](respondWithResult(_0x55dba8,null))[_0x6d6d('0x4c')](handleError(_0x55dba8,null));};exports[_0x6d6d('0x4d')]=function(_0x1d2b20,_0x24cec2){return db['Cdr']['create'](_0x1d2b20[_0x6d6d('0x4e')],{})[_0x6d6d('0x27')](respondWithResult(_0x24cec2,0xc9))[_0x6d6d('0x4c')](handleError(_0x24cec2,null));};exports[_0x6d6d('0x26')]=function(_0xe2a20e,_0x492834){if(_0xe2a20e[_0x6d6d('0x4e')]['id']){delete _0xe2a20e[_0x6d6d('0x4e')]['id'];}return db[_0x6d6d('0x2e')][_0x6d6d('0x4b')]({'where':{'id':_0xe2a20e[_0x6d6d('0x49')]['id']}})[_0x6d6d('0x27')](handleEntityNotFound(_0x492834,null))[_0x6d6d('0x27')](saveUpdates(_0xe2a20e[_0x6d6d('0x4e')],null))[_0x6d6d('0x27')](respondWithResult(_0x492834,null))[_0x6d6d('0x4c')](handleError(_0x492834,null));};exports[_0x6d6d('0x28')]=function(_0x175e26,_0x4d9811){return db[_0x6d6d('0x2e')][_0x6d6d('0x4b')]({'where':{'id':_0x175e26[_0x6d6d('0x49')]['id']}})[_0x6d6d('0x27')](handleEntityNotFound(_0x4d9811,null))[_0x6d6d('0x27')](removeEntity(_0x4d9811,null))['catch'](handleError(_0x4d9811,null));};exports[_0x6d6d('0x4f')]=function(_0x36bc5a,_0x45340b){return db['Cdr']['describe']()[_0x6d6d('0x27')](respondWithResult(_0x45340b,null))['catch'](handleError(_0x45340b,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 0bc9a0e..79b0b64 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(_0x328c01,_0x50cd1c){var _0x596b6d=function(_0x5872e1){while(--_0x5872e1){_0x328c01['push'](_0x328c01['shift']());}};_0x596b6d(++_0x50cd1c);}(_0x7a54,0x106));var _0x47a5=function(_0x56b28b,_0x1cb873){_0x56b28b=_0x56b28b-0x0;var _0x3c4879=_0x7a54[_0x56b28b];return _0x3c4879;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x2a9d4d,_0x37e68c){var _0xe32c68=function(_0x39bf87){while(--_0x39bf87){_0x2a9d4d['push'](_0x2a9d4d['shift']());}};_0xe32c68(++_0x37e68c);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index d6f1852..af935f9 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 _0xf496=['jayson/promise','client','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0xf496,0x1db));var _0x6f49=function(_0x354985,_0x295746){_0x354985=_0x354985-0x0;var _0x30152f=_0xf496[_0x354985];return _0x30152f;};'use strict';var _=require(_0x6f49('0x0'));var util=require('util');var moment=require(_0x6f49('0x1'));var BPromise=require('bluebird');var rs=require(_0x6f49('0x2'));var fs=require('fs');var Redis=require(_0x6f49('0x3'));var db=require(_0x6f49('0x4'))['db'];var utils=require(_0x6f49('0x5'));var logger=require(_0x6f49('0x6'))(_0x6f49('0x7'));var config=require(_0x6f49('0x8'));var jayson=require(_0x6f49('0x9'));var client=jayson[_0x6f49('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ada92,_0x5e6b08,_0x5c1916){return new BPromise(function(_0x39a5a3,_0x4bc2b9){return client[_0x6f49('0xb')](_0x4ada92,_0x5c1916)[_0x6f49('0xc')](function(_0x13180c){logger[_0x6f49('0xd')](_0x6f49('0xe'),_0x5e6b08,_0x6f49('0xf'));logger[_0x6f49('0x10')](_0x6f49('0x11'),_0x5e6b08,'request\x20sent',JSON[_0x6f49('0x12')](_0x13180c));if(_0x13180c[_0x6f49('0x13')]){if(_0x13180c[_0x6f49('0x13')]['code']===0x1f4){logger[_0x6f49('0x13')](_0x6f49('0xe'),_0x5e6b08,_0x13180c['error'][_0x6f49('0x14')]);return _0x4bc2b9(_0x13180c['error'][_0x6f49('0x14')]);}logger['error'](_0x6f49('0xe'),_0x5e6b08,_0x13180c['error'][_0x6f49('0x14')]);return _0x39a5a3(_0x13180c['error'][_0x6f49('0x14')]);}else{logger[_0x6f49('0xd')]('Cdr,\x20%s,\x20%s',_0x5e6b08,'request\x20sent');_0x39a5a3(_0x13180c[_0x6f49('0x15')]['message']);}})['catch'](function(_0x529caa){logger[_0x6f49('0x13')](_0x6f49('0xe'),_0x5e6b08,_0x529caa);_0x4bc2b9(_0x529caa);});});} \ No newline at end of file +var _0x70cf=['http','request','then','info','request\x20sent','debug','stringify','error','code','message','Cdr,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise','client'];(function(_0x8ac6fb,_0x34a863){var _0x5a76aa=function(_0xce8b64){while(--_0xce8b64){_0x8ac6fb['push'](_0x8ac6fb['shift']());}};_0x5a76aa(++_0x34a863);}(_0x70cf,0x133));var _0xf70c=function(_0x2b91c5,_0x3b6db5){_0x2b91c5=_0x2b91c5-0x0;var _0xbd5531=_0x70cf[_0x2b91c5];return _0xbd5531;};'use strict';var _=require(_0xf70c('0x0'));var util=require('util');var moment=require(_0xf70c('0x1'));var BPromise=require(_0xf70c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf70c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf70c('0x4'));var logger=require('../../config/logger')(_0xf70c('0x5'));var config=require('../../config/environment');var jayson=require(_0xf70c('0x6'));var client=jayson[_0xf70c('0x7')][_0xf70c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3eb42d,_0x779a26,_0x256924){return new BPromise(function(_0x14cc92,_0xc65c31){return client[_0xf70c('0x9')](_0x3eb42d,_0x256924)[_0xf70c('0xa')](function(_0x46f04a){logger[_0xf70c('0xb')]('Cdr,\x20%s,\x20%s',_0x779a26,_0xf70c('0xc'));logger[_0xf70c('0xd')]('Cdr,\x20%s,\x20%s,\x20%s',_0x779a26,_0xf70c('0xc'),JSON[_0xf70c('0xe')](_0x46f04a));if(_0x46f04a['error']){if(_0x46f04a[_0xf70c('0xf')][_0xf70c('0x10')]===0x1f4){logger[_0xf70c('0xf')]('Cdr,\x20%s,\x20%s',_0x779a26,_0x46f04a['error'][_0xf70c('0x11')]);return _0xc65c31(_0x46f04a[_0xf70c('0xf')][_0xf70c('0x11')]);}logger[_0xf70c('0xf')](_0xf70c('0x12'),_0x779a26,_0x46f04a[_0xf70c('0xf')][_0xf70c('0x11')]);return _0x14cc92(_0x46f04a[_0xf70c('0xf')]['message']);}else{logger[_0xf70c('0xb')](_0xf70c('0x12'),_0x779a26,_0xf70c('0xc'));_0x14cc92(_0x46f04a[_0xf70c('0x13')][_0xf70c('0x11')]);}})[_0xf70c('0x14')](function(_0x350c48){logger[_0xf70c('0xf')]('Cdr,\x20%s,\x20%s',_0x779a26,_0x350c48);_0xc65c31(_0x350c48);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index f48a140..deaf70f 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x3e4d9a,_0x449a9f){var _0x4124d3=function(_0x3dd192){while(--_0x3dd192){_0x3e4d9a['push'](_0x3e4d9a['shift']());}};_0x4124d3(++_0x449a9f);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +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(_0x3d6ac0,_0x1c52e2){var _0x359130=function(_0x49e579){while(--_0x49e579){_0x3d6ac0['push'](_0x3d6ac0['shift']());}};_0x359130(++_0x1c52e2);}(_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 693be85..14059ca 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 _0x8893=['STRING','INTEGER'];(function(_0x2b6f33,_0x3a2516){var _0x3776ac=function(_0x227067){while(--_0x227067){_0x2b6f33['push'](_0x2b6f33['shift']());}};_0x3776ac(++_0x3a2516);}(_0x8893,0xc5));var _0x3889=function(_0x48f202,_0x37f19f){_0x48f202=_0x48f202-0x0;var _0x2f6ca4=_0x8893[_0x48f202];return _0x2f6ca4;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x3889('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x3889('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x3889('0x1')]},'interval':{'type':Sequelize[_0x3889('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xcb77=['TEXT','*,*,*,*','exports','STRING'];(function(_0x20b216,_0x2f6bc4){var _0x4a7f19=function(_0x14212b){while(--_0x14212b){_0x20b216['push'](_0x20b216['shift']());}};_0x4a7f19(++_0x2f6bc4);}(_0xcb77,0x12e));var _0x7cb7=function(_0x867b0a,_0x587ccf){_0x867b0a=_0x867b0a-0x0;var _0x137438=_0xcb77[_0x867b0a];return _0x137438;};'use strict';var Sequelize=require('sequelize');module[_0x7cb7('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x7cb7('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x7cb7('0x2')]()},'description':{'type':Sequelize[_0x7cb7('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x7cb7('0x3')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index fcf8e9a..79bd994 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 _0xa4db=['update','then','end','error','name','show','params','model','ChatApplication','rawAttributes','keys','query','filters','intersection','fields','attributes','includeAll','include','merge','options','find','catch','body','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','count','Content-Range','json','apply','reject','save'];(function(_0xc29bb9,_0x1c17ed){var _0x1e9910=function(_0x2ab1f7){while(--_0x2ab1f7){_0xc29bb9['push'](_0xc29bb9['shift']());}};_0x1e9910(++_0x1c17ed);}(_0xa4db,0x139));var _0xba4d=function(_0x40ab30,_0x4011f2){_0x40ab30=_0x40ab30-0x0;var _0xae7b4c=_0xa4db[_0x40ab30];return _0xae7b4c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xba4d('0x0'));var rp=require(_0xba4d('0x1'));var moment=require(_0xba4d('0x2'));var BPromise=require(_0xba4d('0x3'));var Mustache=require(_0xba4d('0x4'));var util=require(_0xba4d('0x5'));var path=require('path');var sox=require(_0xba4d('0x6'));var csv=require('to-csv');var ejs=require(_0xba4d('0x7'));var fs=require('fs');var fs_extra=require(_0xba4d('0x8'));var _=require(_0xba4d('0x9'));var squel=require(_0xba4d('0xa'));var crypto=require(_0xba4d('0xb'));var jsforce=require(_0xba4d('0xc'));var deskjs=require(_0xba4d('0xd'));var toCsv=require(_0xba4d('0xe'));var querystring=require(_0xba4d('0xf'));var Papa=require('papaparse');var Redis=require(_0xba4d('0x10'));var authService=require(_0xba4d('0x11'));var qs=require(_0xba4d('0x12'));var as=require(_0xba4d('0x13'));var hardwareService=require(_0xba4d('0x14'));var logger=require(_0xba4d('0x15'))(_0xba4d('0x16'));var utils=require(_0xba4d('0x17'));var config=require(_0xba4d('0x18'));var licenseUtil=require(_0xba4d('0x19'));var db=require(_0xba4d('0x1a'))['db'];function respondWithStatusCode(_0x3256ef,_0x5a8ab5){_0x5a8ab5=_0x5a8ab5||0xcc;return function(_0x5a84f0){if(_0x5a84f0){return _0x3256ef['sendStatus'](_0x5a8ab5);}return _0x3256ef[_0xba4d('0x1b')](_0x5a8ab5)['end']();};}function respondWithResult(_0x4ae237,_0x393713){_0x393713=_0x393713||0xc8;return function(_0x42150e){if(_0x42150e){return _0x4ae237[_0xba4d('0x1b')](_0x393713)['json'](_0x42150e);}};}function respondWithFilteredResult(_0x5e6a43,_0x4cc2e5){return function(_0x3b256a){if(_0x3b256a){var _0x2981bd=typeof _0x4cc2e5[_0xba4d('0x1c')]==='undefined'&&typeof _0x4cc2e5['limit']==='undefined';var _0x5633bf=_0x3b256a['count'];var _0x5e533a=_0x2981bd?0x0:_0x4cc2e5[_0xba4d('0x1c')];var _0x4c9f27=_0x2981bd?_0x3b256a[_0xba4d('0x1d')]:_0x4cc2e5['offset']+_0x4cc2e5['limit'];var _0x4e46e2;if(_0x4c9f27>=_0x5633bf){_0x4c9f27=_0x5633bf;_0x4e46e2=0xc8;}else{_0x4e46e2=0xce;}_0x5e6a43['status'](_0x4e46e2);return _0x5e6a43['set'](_0xba4d('0x1e'),_0x5e533a+'-'+_0x4c9f27+'/'+_0x5633bf)[_0xba4d('0x1f')](_0x3b256a);}return null;};}function patchUpdates(_0x4ea891){return function(_0x480594){try{jsonpatch[_0xba4d('0x20')](_0x480594,_0x4ea891,!![]);}catch(_0x4bdd02){return BPromise[_0xba4d('0x21')](_0x4bdd02);}return _0x480594[_0xba4d('0x22')]();};}function saveUpdates(_0x7f641e,_0x46f7ff){return function(_0x3c1408){if(_0x3c1408){return _0x3c1408[_0xba4d('0x23')](_0x7f641e)[_0xba4d('0x24')](function(_0x19971d){return _0x19971d;});}return null;};}function removeEntity(_0x38184d,_0x13fdf3){return function(_0x2fac41){if(_0x2fac41){return _0x2fac41['destroy']()[_0xba4d('0x24')](function(){_0x38184d[_0xba4d('0x1b')](0xcc)[_0xba4d('0x25')]();});}};}function handleEntityNotFound(_0x34c3e9,_0x366f5c){return function(_0x49e2f6){if(!_0x49e2f6){_0x34c3e9['sendStatus'](0x194);}return _0x49e2f6;};}function handleError(_0x4c4324,_0xa39501){_0xa39501=_0xa39501||0x1f4;return function(_0x2a7bc3){logger[_0xba4d('0x26')](_0x2a7bc3['stack']);if(_0x2a7bc3[_0xba4d('0x27')]){delete _0x2a7bc3[_0xba4d('0x27')];}_0x4c4324['status'](_0xa39501)['send'](_0x2a7bc3);};}exports[_0xba4d('0x28')]=function(_0x1d1c51,_0x52d3f1){var _0x22a0d6={'raw':!![],'where':{'id':_0x1d1c51[_0xba4d('0x29')]['id']}},_0x4424d0={};_0x4424d0[_0xba4d('0x2a')]=_['keys'](db[_0xba4d('0x2b')][_0xba4d('0x2c')]);_0x4424d0['query']=_[_0xba4d('0x2d')](_0x1d1c51[_0xba4d('0x2e')]);_0x4424d0[_0xba4d('0x2f')]=_[_0xba4d('0x30')](_0x4424d0[_0xba4d('0x2a')],_0x4424d0['query']);_0x22a0d6['attributes']=_[_0xba4d('0x30')](_0x4424d0[_0xba4d('0x2a')],qs[_0xba4d('0x31')](_0x1d1c51['query'][_0xba4d('0x31')]));_0x22a0d6[_0xba4d('0x32')]=_0x22a0d6[_0xba4d('0x32')]['length']?_0x22a0d6['attributes']:_0x4424d0[_0xba4d('0x2a')];if(_0x1d1c51[_0xba4d('0x2e')][_0xba4d('0x33')]){_0x22a0d6[_0xba4d('0x34')]=[{'all':!![]}];}_0x22a0d6=_[_0xba4d('0x35')]({},_0x22a0d6,_0x1d1c51[_0xba4d('0x36')]);return db[_0xba4d('0x2b')][_0xba4d('0x37')](_0x22a0d6)[_0xba4d('0x24')](handleEntityNotFound(_0x52d3f1,null))[_0xba4d('0x24')](respondWithResult(_0x52d3f1,null))[_0xba4d('0x38')](handleError(_0x52d3f1,null));};exports['update']=function(_0x4fbb27,_0x39d26b){if(_0x4fbb27[_0xba4d('0x39')]['id']){delete _0x4fbb27[_0xba4d('0x39')]['id'];}return db[_0xba4d('0x2b')][_0xba4d('0x37')]({'where':{'id':_0x4fbb27['params']['id']}})['then'](handleEntityNotFound(_0x39d26b,null))[_0xba4d('0x24')](saveUpdates(_0x4fbb27[_0xba4d('0x39')],null))['then'](respondWithResult(_0x39d26b,null))['catch'](handleError(_0x39d26b,null));};exports['destroy']=function(_0x1be3a9,_0x36e82f){return db[_0xba4d('0x2b')][_0xba4d('0x37')]({'where':{'id':_0x1be3a9[_0xba4d('0x29')]['id']}})['then'](handleEntityNotFound(_0x36e82f,null))[_0xba4d('0x24')](removeEntity(_0x36e82f,null))[_0xba4d('0x38')](handleError(_0x36e82f,null));}; \ No newline at end of file +var _0x7217=['util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','then','error','stack','name','send','show','params','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','model','fields','include','merge','options','find','body','catch','zip-dir','request-promise','moment','bluebird','mustache'];(function(_0x31082a,_0x2d9653){var _0x1ed4dd=function(_0x3ea8c){while(--_0x3ea8c){_0x31082a['push'](_0x31082a['shift']());}};_0x1ed4dd(++_0x2d9653);}(_0x7217,0xa9));var _0x7721=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x7217[_0x491a7f];return _0x3d8f44;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7721('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7721('0x1'));var moment=require(_0x7721('0x2'));var BPromise=require(_0x7721('0x3'));var Mustache=require(_0x7721('0x4'));var util=require(_0x7721('0x5'));var path=require(_0x7721('0x6'));var sox=require(_0x7721('0x7'));var csv=require(_0x7721('0x8'));var ejs=require(_0x7721('0x9'));var fs=require('fs');var fs_extra=require(_0x7721('0xa'));var _=require('lodash');var squel=require(_0x7721('0xb'));var crypto=require(_0x7721('0xc'));var jsforce=require(_0x7721('0xd'));var deskjs=require(_0x7721('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7721('0xf'));var Papa=require(_0x7721('0x10'));var Redis=require('ioredis');var authService=require(_0x7721('0x11'));var qs=require(_0x7721('0x12'));var as=require(_0x7721('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7721('0x14'))(_0x7721('0x15'));var utils=require(_0x7721('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7721('0x17'));var db=require(_0x7721('0x18'))['db'];function respondWithStatusCode(_0x4db091,_0x290415){_0x290415=_0x290415||0xcc;return function(_0xcbb8d5){if(_0xcbb8d5){return _0x4db091['sendStatus'](_0x290415);}return _0x4db091[_0x7721('0x19')](_0x290415)[_0x7721('0x1a')]();};}function respondWithResult(_0xedb98,_0x36f8a0){_0x36f8a0=_0x36f8a0||0xc8;return function(_0x22a78b){if(_0x22a78b){return _0xedb98['status'](_0x36f8a0)[_0x7721('0x1b')](_0x22a78b);}};}function respondWithFilteredResult(_0x353249,_0x2fdfec){return function(_0x281dfd){if(_0x281dfd){var _0x488c09=typeof _0x2fdfec[_0x7721('0x1c')]==='undefined'&&typeof _0x2fdfec[_0x7721('0x1d')]==='undefined';var _0x378dfb=_0x281dfd['count'];var _0x4b64ab=_0x488c09?0x0:_0x2fdfec[_0x7721('0x1c')];var _0x499b28=_0x488c09?_0x281dfd[_0x7721('0x1e')]:_0x2fdfec['offset']+_0x2fdfec[_0x7721('0x1d')];var _0x19f3b4;if(_0x499b28>=_0x378dfb){_0x499b28=_0x378dfb;_0x19f3b4=0xc8;}else{_0x19f3b4=0xce;}_0x353249['status'](_0x19f3b4);return _0x353249[_0x7721('0x1f')](_0x7721('0x20'),_0x4b64ab+'-'+_0x499b28+'/'+_0x378dfb)[_0x7721('0x1b')](_0x281dfd);}return null;};}function patchUpdates(_0x519768){return function(_0x4083dd){try{jsonpatch['apply'](_0x4083dd,_0x519768,!![]);}catch(_0x49b37b){return BPromise[_0x7721('0x21')](_0x49b37b);}return _0x4083dd[_0x7721('0x22')]();};}function saveUpdates(_0x528664,_0x45c389){return function(_0x16c9c4){if(_0x16c9c4){return _0x16c9c4[_0x7721('0x23')](_0x528664)['then'](function(_0x159117){return _0x159117;});}return null;};}function removeEntity(_0x5b7e03,_0x6ab534){return function(_0x1c5511){if(_0x1c5511){return _0x1c5511['destroy']()[_0x7721('0x24')](function(){_0x5b7e03['status'](0xcc)[_0x7721('0x1a')]();});}};}function handleEntityNotFound(_0x6b932b,_0x179d10){return function(_0x126486){if(!_0x126486){_0x6b932b['sendStatus'](0x194);}return _0x126486;};}function handleError(_0x37cbc7,_0x1f3aff){_0x1f3aff=_0x1f3aff||0x1f4;return function(_0x43fa19){logger[_0x7721('0x25')](_0x43fa19[_0x7721('0x26')]);if(_0x43fa19['name']){delete _0x43fa19[_0x7721('0x27')];}_0x37cbc7[_0x7721('0x19')](_0x1f3aff)[_0x7721('0x28')](_0x43fa19);};}exports[_0x7721('0x29')]=function(_0xbb3ce4,_0x265f6d){var _0x1779cb={'raw':!![],'where':{'id':_0xbb3ce4[_0x7721('0x2a')]['id']}},_0x459d1f={};_0x459d1f['model']=_[_0x7721('0x2b')](db[_0x7721('0x2c')][_0x7721('0x2d')]);_0x459d1f[_0x7721('0x2e')]=_['keys'](_0xbb3ce4[_0x7721('0x2e')]);_0x459d1f[_0x7721('0x2f')]=_[_0x7721('0x30')](_0x459d1f['model'],_0x459d1f['query']);_0x1779cb[_0x7721('0x31')]=_[_0x7721('0x30')](_0x459d1f[_0x7721('0x32')],qs[_0x7721('0x33')](_0xbb3ce4[_0x7721('0x2e')][_0x7721('0x33')]));_0x1779cb[_0x7721('0x31')]=_0x1779cb[_0x7721('0x31')]['length']?_0x1779cb[_0x7721('0x31')]:_0x459d1f['model'];if(_0xbb3ce4[_0x7721('0x2e')]['includeAll']){_0x1779cb[_0x7721('0x34')]=[{'all':!![]}];}_0x1779cb=_[_0x7721('0x35')]({},_0x1779cb,_0xbb3ce4[_0x7721('0x36')]);return db[_0x7721('0x2c')][_0x7721('0x37')](_0x1779cb)[_0x7721('0x24')](handleEntityNotFound(_0x265f6d,null))[_0x7721('0x24')](respondWithResult(_0x265f6d,null))['catch'](handleError(_0x265f6d,null));};exports[_0x7721('0x23')]=function(_0x491d50,_0x27eef3){if(_0x491d50[_0x7721('0x38')]['id']){delete _0x491d50[_0x7721('0x38')]['id'];}return db['ChatApplication'][_0x7721('0x37')]({'where':{'id':_0x491d50[_0x7721('0x2a')]['id']}})['then'](handleEntityNotFound(_0x27eef3,null))[_0x7721('0x24')](saveUpdates(_0x491d50[_0x7721('0x38')],null))[_0x7721('0x24')](respondWithResult(_0x27eef3,null))[_0x7721('0x39')](handleError(_0x27eef3,null));};exports['destroy']=function(_0x2fb209,_0x3f6551){return db['ChatApplication'][_0x7721('0x37')]({'where':{'id':_0x2fb209['params']['id']}})[_0x7721('0x24')](handleEntityNotFound(_0x3f6551,null))['then'](removeEntity(_0x3f6551,null))['catch'](handleError(_0x3f6551,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 700ebdb..2ea2369 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 _0xa80f=['api','moment','request-promise','path','rimraf','./chatApplication.attributes','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xa80f,0x97));var _0xfa80=function(_0x566667,_0x3f99c2){_0x566667=_0x566667-0x0;var _0x277136=_0xa80f[_0x566667];return _0x277136;};'use strict';var _=require(_0xfa80('0x0'));var util=require(_0xfa80('0x1'));var logger=require(_0xfa80('0x2'))(_0xfa80('0x3'));var moment=require(_0xfa80('0x4'));var BPromise=require('bluebird');var rp=require(_0xfa80('0x5'));var fs=require('fs');var path=require(_0xfa80('0x6'));var rimraf=require(_0xfa80('0x7'));var config=require('../../config/environment');var attributes=require(_0xfa80('0x8'));module['exports']=function(_0x76908b,_0x1b132b){return _0x76908b[_0xfa80('0x9')](_0xfa80('0xa'),attributes,{'tableName':_0xfa80('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfa80('0xc'),'collate':_0xfa80('0xd')});}; \ No newline at end of file +var _0xa12b=['lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./chatApplication.attributes','define','chat_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xa12b,0xf0));var _0xba12=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa12b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xba12('0x0'));var util=require('util');var logger=require(_0xba12('0x1'))(_0xba12('0x2'));var moment=require(_0xba12('0x3'));var BPromise=require('bluebird');var rp=require(_0xba12('0x4'));var fs=require('fs');var path=require(_0xba12('0x5'));var rimraf=require('rimraf');var config=require(_0xba12('0x6'));var attributes=require(_0xba12('0x7'));module['exports']=function(_0x13c13c,_0x1970dd){return _0x13c13c[_0xba12('0x8')]('ChatApplication',attributes,{'tableName':_0xba12('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xba12('0xa'),'collate':_0xba12('0xb')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 4616771..62a17b5 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 _0x9515=['request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s'];(function(_0x10e006,_0x33ce66){var _0x14b0e5=function(_0x476fa5){while(--_0x476fa5){_0x10e006['push'](_0x10e006['shift']());}};_0x14b0e5(++_0x33ce66);}(_0x9515,0x1bd));var _0x5951=function(_0x547855,_0x1d4e56){_0x547855=_0x547855-0x0;var _0x1d39e5=_0x9515[_0x547855];return _0x1d39e5;};'use strict';var _=require(_0x5951('0x0'));var util=require('util');var moment=require(_0x5951('0x1'));var BPromise=require('bluebird');var rs=require(_0x5951('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5951('0x3'))['db'];var utils=require(_0x5951('0x4'));var logger=require(_0x5951('0x5'))(_0x5951('0x6'));var config=require(_0x5951('0x7'));var jayson=require(_0x5951('0x8'));var client=jayson[_0x5951('0x9')][_0x5951('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d89b4,_0x5a4cbf,_0x3420d9){return new BPromise(function(_0x47db2b,_0x502a5f){return client[_0x5951('0xb')](_0x5d89b4,_0x3420d9)[_0x5951('0xc')](function(_0x1f1810){logger[_0x5951('0xd')](_0x5951('0xe'),_0x5a4cbf,_0x5951('0xf'));logger[_0x5951('0x10')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x5a4cbf,_0x5951('0xf'),JSON[_0x5951('0x11')](_0x1f1810));if(_0x1f1810[_0x5951('0x12')]){if(_0x1f1810[_0x5951('0x12')][_0x5951('0x13')]===0x1f4){logger['error'](_0x5951('0xe'),_0x5a4cbf,_0x1f1810['error'][_0x5951('0x14')]);return _0x502a5f(_0x1f1810['error'][_0x5951('0x14')]);}logger[_0x5951('0x12')](_0x5951('0xe'),_0x5a4cbf,_0x1f1810['error'][_0x5951('0x14')]);return _0x47db2b(_0x1f1810[_0x5951('0x12')][_0x5951('0x14')]);}else{logger[_0x5951('0xd')](_0x5951('0xe'),_0x5a4cbf,'request\x20sent');_0x47db2b(_0x1f1810[_0x5951('0x15')][_0x5951('0x14')]);}})[_0x5951('0x16')](function(_0x453187){logger[_0x5951('0x12')](_0x5951('0xe'),_0x5a4cbf,_0x453187);_0x502a5f(_0x453187);});});} \ No newline at end of file +var _0x3805=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','info','ChatApplication,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x5f1cf7,_0x47d9a9){var _0x2ab77b=function(_0x3b8a33){while(--_0x3b8a33){_0x5f1cf7['push'](_0x5f1cf7['shift']());}};_0x2ab77b(++_0x47d9a9);}(_0x3805,0x151));var _0x5380=function(_0x11e239,_0x3cfa93){_0x11e239=_0x11e239-0x0;var _0x4b1ee8=_0x3805[_0x11e239];return _0x4b1ee8;};'use strict';var _=require(_0x5380('0x0'));var util=require(_0x5380('0x1'));var moment=require('moment');var BPromise=require(_0x5380('0x2'));var rs=require(_0x5380('0x3'));var fs=require('fs');var Redis=require(_0x5380('0x4'));var db=require(_0x5380('0x5'))['db'];var utils=require(_0x5380('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x5380('0x7'));var jayson=require(_0x5380('0x8'));var client=jayson['client'][_0x5380('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x13c173,_0x170246,_0x569133){return new BPromise(function(_0x421979,_0x32f227){return client['request'](_0x13c173,_0x569133)['then'](function(_0x15074f){logger[_0x5380('0xa')](_0x5380('0xb'),_0x170246,_0x5380('0xc'));logger['debug']('ChatApplication,\x20%s,\x20%s,\x20%s',_0x170246,_0x5380('0xc'),JSON['stringify'](_0x15074f));if(_0x15074f[_0x5380('0xd')]){if(_0x15074f[_0x5380('0xd')][_0x5380('0xe')]===0x1f4){logger[_0x5380('0xd')]('ChatApplication,\x20%s,\x20%s',_0x170246,_0x15074f[_0x5380('0xd')][_0x5380('0xf')]);return _0x32f227(_0x15074f['error'][_0x5380('0xf')]);}logger[_0x5380('0xd')]('ChatApplication,\x20%s,\x20%s',_0x170246,_0x15074f['error']['message']);return _0x421979(_0x15074f[_0x5380('0xd')][_0x5380('0xf')]);}else{logger[_0x5380('0xa')](_0x5380('0xb'),_0x170246,_0x5380('0xc'));_0x421979(_0x15074f[_0x5380('0x10')][_0x5380('0xf')]);}})[_0x5380('0x11')](function(_0x18c1ca){logger['error'](_0x5380('0xb'),_0x170246,_0x18c1ca);_0x32f227(_0x18c1ca);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 5fd39b2..55a6a1e 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 _0x70e2=['delete','exports','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./chatApplication.controller','get','/:id','show','put','update'];(function(_0x44583f,_0x148f5c){var _0x37229a=function(_0x528779){while(--_0x528779){_0x44583f['push'](_0x44583f['shift']());}};_0x37229a(++_0x148f5c);}(_0x70e2,0x13a));var _0x270e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x70e2[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require('multer');var util=require(_0x270e('0x0'));var path=require('path');var timeout=require(_0x270e('0x1'));var express=require('express');var router=express[_0x270e('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x270e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x270e('0x4'));var controller=require(_0x270e('0x5'));router[_0x270e('0x6')](_0x270e('0x7'),auth['isAuthenticated'](),controller[_0x270e('0x8')]);router[_0x270e('0x9')](_0x270e('0x7'),auth['isAuthenticated'](),controller[_0x270e('0xa')]);router[_0x270e('0xb')](_0x270e('0x7'),auth['isAuthenticated'](),controller['destroy']);module[_0x270e('0xc')]=router; \ No newline at end of file +var _0x1501=['get','/:id','isAuthenticated','put','update','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./chatApplication.controller'];(function(_0x520876,_0x31a8f1){var _0x33999a=function(_0x31e6dc){while(--_0x31e6dc){_0x520876['push'](_0x520876['shift']());}};_0x33999a(++_0x31a8f1);}(_0x1501,0x143));var _0x1150=function(_0x56ef1e,_0x3226f2){_0x56ef1e=_0x56ef1e-0x0;var _0x19e171=_0x1501[_0x56ef1e];return _0x19e171;};'use strict';var multer=require('multer');var util=require(_0x1150('0x0'));var path=require(_0x1150('0x1'));var timeout=require(_0x1150('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1150('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x1150('0x4'));var config=require(_0x1150('0x5'));var controller=require(_0x1150('0x6'));router[_0x1150('0x7')](_0x1150('0x8'),auth[_0x1150('0x9')](),controller['show']);router[_0x1150('0xa')](_0x1150('0x8'),auth[_0x1150('0x9')](),controller[_0x1150('0xb')]);router[_0x1150('0xc')](_0x1150('0x8'),auth['isAuthenticated'](),controller[_0x1150('0xd')]);module[_0x1150('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 8f96761..10636cb 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 _0xc2b4=['exports','STRING','sequelize'];(function(_0x23a4fd,_0x4f2190){var _0x4b2cd6=function(_0x4efca1){while(--_0x4efca1){_0x23a4fd['push'](_0x23a4fd['shift']());}};_0x4b2cd6(++_0x4f2190);}(_0xc2b4,0xc5));var _0x4c2b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc2b4[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4c2b('0x0'));module[_0x4c2b('0x1')]={'name':{'type':Sequelize[_0x4c2b('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x4c2b('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xbaee=['STRING','BOOLEAN','sequelize','exports'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0xbaee,0x186));var _0xebae=function(_0x111c05,_0x1a7e9c){_0x111c05=_0x111c05-0x0;var _0x1b59e2=_0xbaee[_0x111c05];return _0x1b59e2;};'use strict';var Sequelize=require(_0xebae('0x0'));module[_0xebae('0x1')]={'name':{'type':Sequelize[_0xebae('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xebae('0x2')]},'write':{'type':Sequelize[_0xebae('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index a28b3bd..52d3c9c 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 _0x81d6=['register','sendStatus','status','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','then','end','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','catch','show','params','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','omit','ids','getMembers','findOne','User','order','removeMembers','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter'];(function(_0x11c578,_0x58522b){var _0x57510c=function(_0x2d8856){while(--_0x2d8856){_0x11c578['push'](_0x11c578['shift']());}};_0x57510c(++_0x58522b);}(_0x81d6,0x1ce));var _0x681d=function(_0x485dac,_0x45ae87){_0x485dac=_0x485dac-0x0;var _0x539844=_0x81d6[_0x485dac];return _0x539844;};'use strict';var emlformat=require(_0x681d('0x0'));var rimraf=require(_0x681d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x681d('0x2'));var moment=require(_0x681d('0x3'));var BPromise=require(_0x681d('0x4'));var Mustache=require('mustache');var util=require(_0x681d('0x5'));var path=require('path');var sox=require(_0x681d('0x6'));var csv=require(_0x681d('0x7'));var ejs=require(_0x681d('0x8'));var fs=require('fs');var fs_extra=require(_0x681d('0x9'));var _=require('lodash');var squel=require(_0x681d('0xa'));var crypto=require(_0x681d('0xb'));var jsforce=require(_0x681d('0xc'));var deskjs=require(_0x681d('0xd'));var toCsv=require(_0x681d('0x7'));var querystring=require(_0x681d('0xe'));var Papa=require(_0x681d('0xf'));var Redis=require(_0x681d('0x10'));var authService=require(_0x681d('0x11'));var qs=require(_0x681d('0x12'));var as=require(_0x681d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x681d('0x14'))(_0x681d('0x15'));var utils=require(_0x681d('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x681d('0x17'));var db=require(_0x681d('0x18'))['db'];config['redis']=_[_0x681d('0x19')](config[_0x681d('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x681d('0x1b'))(new Redis(config[_0x681d('0x1a')]));require('./chatGroup.socket')[_0x681d('0x1c')](socket);function respondWithStatusCode(_0x5a2a29,_0x4e8585){_0x4e8585=_0x4e8585||0xcc;return function(_0x385bd6){if(_0x385bd6){return _0x5a2a29[_0x681d('0x1d')](_0x4e8585);}return _0x5a2a29[_0x681d('0x1e')](_0x4e8585)['end']();};}function respondWithResult(_0xeb9343,_0x3307ac){_0x3307ac=_0x3307ac||0xc8;return function(_0x45109a){if(_0x45109a){return _0xeb9343['status'](_0x3307ac)['json'](_0x45109a);}};}function respondWithFilteredResult(_0x5b80ab,_0x3752a4){return function(_0x57b0c3){if(_0x57b0c3){var _0x56769a=typeof _0x3752a4[_0x681d('0x1f')]===_0x681d('0x20')&&typeof _0x3752a4[_0x681d('0x21')]===_0x681d('0x20');var _0xf1bcc=_0x57b0c3['count'];var _0x4ac801=_0x56769a?0x0:_0x3752a4[_0x681d('0x1f')];var _0x1f7c77=_0x56769a?_0x57b0c3['count']:_0x3752a4[_0x681d('0x1f')]+_0x3752a4[_0x681d('0x21')];var _0x2d5212;if(_0x1f7c77>=_0xf1bcc){_0x1f7c77=_0xf1bcc;_0x2d5212=0xc8;}else{_0x2d5212=0xce;}_0x5b80ab[_0x681d('0x1e')](_0x2d5212);return _0x5b80ab[_0x681d('0x22')](_0x681d('0x23'),_0x4ac801+'-'+_0x1f7c77+'/'+_0xf1bcc)['json'](_0x57b0c3);}return null;};}function patchUpdates(_0x20fa42){return function(_0x4b23e0){try{jsonpatch[_0x681d('0x24')](_0x4b23e0,_0x20fa42,!![]);}catch(_0x7ae981){return BPromise[_0x681d('0x25')](_0x7ae981);}return _0x4b23e0[_0x681d('0x26')]();};}function saveUpdates(_0x5245c5,_0x4994f4){return function(_0x152769){if(_0x152769){return _0x152769[_0x681d('0x27')](_0x5245c5)['then'](function(_0x3c673c){return _0x3c673c;});}return null;};}function removeEntity(_0x25addb,_0x346601){return function(_0x1446e8){if(_0x1446e8){return _0x1446e8[_0x681d('0x28')]()[_0x681d('0x29')](function(){_0x25addb[_0x681d('0x1e')](0xcc)[_0x681d('0x2a')]();});}};}function handleEntityNotFound(_0x5b6cc2,_0x1b7d79){return function(_0x28f14f){if(!_0x28f14f){_0x5b6cc2[_0x681d('0x1d')](0x194);}return _0x28f14f;};}function handleError(_0x3abb9a,_0x5d3872){_0x5d3872=_0x5d3872||0x1f4;return function(_0x27236b){logger['error'](_0x27236b[_0x681d('0x2b')]);if(_0x27236b['name']){delete _0x27236b[_0x681d('0x2c')];}_0x3abb9a[_0x681d('0x1e')](_0x5d3872)[_0x681d('0x2d')](_0x27236b);};}exports[_0x681d('0x2e')]=function(_0x55d227,_0x42b22e){var _0x21e167={},_0x921d55={},_0xb07f60={'count':0x0,'rows':[]};var _0x37d2a6=_[_0x681d('0x2f')](db[_0x681d('0x30')][_0x681d('0x31')],function(_0x4c7936){return{'name':_0x4c7936[_0x681d('0x32')],'type':_0x4c7936[_0x681d('0x33')][_0x681d('0x34')]};});_0x921d55['model']=_[_0x681d('0x2f')](_0x37d2a6,_0x681d('0x2c'));_0x921d55['query']=_[_0x681d('0x35')](_0x55d227[_0x681d('0x36')]);_0x921d55[_0x681d('0x37')]=_[_0x681d('0x38')](_0x921d55[_0x681d('0x39')],_0x921d55[_0x681d('0x36')]);_0x21e167[_0x681d('0x3a')]=_['intersection'](_0x921d55[_0x681d('0x39')],qs[_0x681d('0x3b')](_0x55d227['query'][_0x681d('0x3b')]));_0x21e167['attributes']=_0x21e167[_0x681d('0x3a')][_0x681d('0x3c')]?_0x21e167[_0x681d('0x3a')]:_0x921d55[_0x681d('0x39')];if(!_0x55d227[_0x681d('0x36')][_0x681d('0x3d')](_0x681d('0x3e'))){_0x21e167['limit']=qs[_0x681d('0x21')](_0x55d227[_0x681d('0x36')][_0x681d('0x21')]);_0x21e167[_0x681d('0x1f')]=qs[_0x681d('0x1f')](_0x55d227['query'][_0x681d('0x1f')]);}_0x21e167['order']=qs[_0x681d('0x3f')](_0x55d227[_0x681d('0x36')]['sort']);_0x21e167[_0x681d('0x40')]=qs[_0x681d('0x37')](_[_0x681d('0x41')](_0x55d227[_0x681d('0x36')],_0x921d55[_0x681d('0x37')]),_0x37d2a6);if(_0x55d227[_0x681d('0x36')]['filter']){_0x21e167[_0x681d('0x40')]=_['merge'](_0x21e167[_0x681d('0x40')],{'$or':_[_0x681d('0x2f')](_0x37d2a6,function(_0x427dcd){if(_0x427dcd['type']!=='VIRTUAL'){var _0x495bc6={};_0x495bc6[_0x427dcd[_0x681d('0x2c')]]={'$like':'%'+_0x55d227['query'][_0x681d('0x42')]+'%'};return _0x495bc6;}})});}_0x21e167=_[_0x681d('0x43')]({},_0x21e167,_0x55d227[_0x681d('0x44')]);var _0x1d1c5b={'where':_0x21e167[_0x681d('0x40')]};return db['ChatGroup']['count'](_0x1d1c5b)[_0x681d('0x29')](function(_0x156106){_0xb07f60[_0x681d('0x45')]=_0x156106;if(_0x55d227[_0x681d('0x36')][_0x681d('0x46')]){_0x21e167[_0x681d('0x47')]=[{'all':!![]}];}return db[_0x681d('0x30')][_0x681d('0x48')](_0x21e167);})['then'](function(_0x5a76f8){_0xb07f60['rows']=_0x5a76f8;return _0xb07f60;})['then'](respondWithFilteredResult(_0x42b22e,_0x21e167))[_0x681d('0x49')](handleError(_0x42b22e,null));};exports[_0x681d('0x4a')]=function(_0x298d4b,_0x46ce3b){var _0x5c1de1={'raw':!![],'where':{'id':_0x298d4b[_0x681d('0x4b')]['id']}},_0x1e1cb4={};_0x1e1cb4[_0x681d('0x39')]=_[_0x681d('0x35')](db[_0x681d('0x30')][_0x681d('0x31')]);_0x1e1cb4[_0x681d('0x36')]=_[_0x681d('0x35')](_0x298d4b[_0x681d('0x36')]);_0x1e1cb4['filters']=_['intersection'](_0x1e1cb4['model'],_0x1e1cb4[_0x681d('0x36')]);_0x5c1de1['attributes']=_[_0x681d('0x38')](_0x1e1cb4[_0x681d('0x39')],qs['fields'](_0x298d4b['query'][_0x681d('0x3b')]));_0x5c1de1[_0x681d('0x3a')]=_0x5c1de1[_0x681d('0x3a')][_0x681d('0x3c')]?_0x5c1de1[_0x681d('0x3a')]:_0x1e1cb4[_0x681d('0x39')];if(_0x298d4b['query'][_0x681d('0x46')]){_0x5c1de1[_0x681d('0x47')]=[{'all':!![]}];}_0x5c1de1=_[_0x681d('0x43')]({},_0x5c1de1,_0x298d4b[_0x681d('0x44')]);return db[_0x681d('0x30')][_0x681d('0x4c')](_0x5c1de1)[_0x681d('0x29')](handleEntityNotFound(_0x46ce3b,null))['then'](respondWithResult(_0x46ce3b,null))[_0x681d('0x49')](handleError(_0x46ce3b,null));};exports[_0x681d('0x4d')]=function(_0x340974,_0x3dd19e){return db[_0x681d('0x30')][_0x681d('0x4d')](_0x340974[_0x681d('0x4e')],{})[_0x681d('0x29')](respondWithResult(_0x3dd19e,0xc9))[_0x681d('0x49')](handleError(_0x3dd19e,null));};exports[_0x681d('0x27')]=function(_0x29a8de,_0x290988){if(_0x29a8de['body']['id']){delete _0x29a8de['body']['id'];}return db[_0x681d('0x30')][_0x681d('0x4c')]({'where':{'id':_0x29a8de[_0x681d('0x4b')]['id']}})[_0x681d('0x29')](handleEntityNotFound(_0x290988,null))[_0x681d('0x29')](saveUpdates(_0x29a8de['body'],null))['then'](respondWithResult(_0x290988,null))[_0x681d('0x49')](handleError(_0x290988,null));};exports[_0x681d('0x28')]=function(_0x5a002a,_0x889f95){return db[_0x681d('0x30')][_0x681d('0x4c')]({'where':{'id':_0x5a002a[_0x681d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x889f95,null))['then'](removeEntity(_0x889f95,null))[_0x681d('0x49')](handleError(_0x889f95,null));};exports[_0x681d('0x4f')]=function(_0x4f75e7,_0x30a34b){return db[_0x681d('0x30')]['describe']()[_0x681d('0x29')](respondWithResult(_0x30a34b,null))[_0x681d('0x49')](handleError(_0x30a34b,null));};exports[_0x681d('0x50')]=function(_0x495ac4,_0x43fa91,_0x4dfc84){return db[_0x681d('0x51')][_0x681d('0x45')]({'where':{'ChatGroupId':_0x495ac4[_0x681d('0x4b')]['id'],'ToId':_0x495ac4[_0x681d('0x52')]['id'],'read':![]}})[_0x681d('0x29')](function(_0x33fe23){return{'id':_[_0x681d('0x53')](_0x495ac4[_0x681d('0x4b')]['id']),'count':_0x33fe23};})[_0x681d('0x29')](respondWithResult(_0x43fa91,null))[_0x681d('0x49')](handleError(_0x43fa91,null));};exports[_0x681d('0x54')]=function(_0x294fe1,_0x3da3fd,_0x143900){return db[_0x681d('0x30')][_0x681d('0x4c')]({'where':{'id':_0x294fe1[_0x681d('0x4b')]['id']}})[_0x681d('0x29')](handleEntityNotFound(_0x3da3fd,null))['then'](function(_0x68f592){if(_0x68f592){return _0x68f592[_0x681d('0x54')](_0x294fe1[_0x681d('0x4e')]['ids'],_[_0x681d('0x55')](_0x294fe1[_0x681d('0x4e')],[_0x681d('0x56'),'id'])||{});}})[_0x681d('0x29')](respondWithResult(_0x3da3fd,null))[_0x681d('0x49')](handleError(_0x3da3fd,null));};exports[_0x681d('0x57')]=function(_0x4dfd23,_0x352460,_0x1031f0){var _0x34ea1f={};var _0x2d0683={};var _0x5f7f72;var _0x37cbb3;return db['ChatGroup'][_0x681d('0x58')]({'where':{'id':_0x4dfd23[_0x681d('0x4b')]['id']}})[_0x681d('0x29')](handleEntityNotFound(_0x352460,null))[_0x681d('0x29')](function(_0x30ef4e){if(_0x30ef4e){_0x5f7f72=_0x30ef4e;_0x2d0683[_0x681d('0x39')]=_[_0x681d('0x35')](db[_0x681d('0x59')][_0x681d('0x31')]);_0x2d0683['query']=_[_0x681d('0x35')](_0x4dfd23[_0x681d('0x36')]);_0x2d0683[_0x681d('0x37')]=_[_0x681d('0x38')](_0x2d0683['model'],_0x2d0683[_0x681d('0x36')]);_0x34ea1f[_0x681d('0x3a')]=_[_0x681d('0x38')](_0x2d0683[_0x681d('0x39')],qs[_0x681d('0x3b')](_0x4dfd23[_0x681d('0x36')][_0x681d('0x3b')]));_0x34ea1f[_0x681d('0x3a')]=_0x34ea1f['attributes'][_0x681d('0x3c')]?_0x34ea1f[_0x681d('0x3a')]:_0x2d0683[_0x681d('0x39')];_0x34ea1f[_0x681d('0x5a')]=qs['sort'](_0x4dfd23[_0x681d('0x36')]['sort']);_0x34ea1f['where']=qs['filters'](_[_0x681d('0x41')](_0x4dfd23[_0x681d('0x36')],_0x2d0683['filters']));if(_0x4dfd23[_0x681d('0x36')][_0x681d('0x42')]){_0x34ea1f['where']=_['merge'](_0x34ea1f['where'],{'$or':_[_0x681d('0x2f')](_0x34ea1f['attributes'],function(_0x258762){var _0x54117e={};_0x54117e[_0x258762]={'$like':'%'+_0x4dfd23['query'][_0x681d('0x42')]+'%'};return _0x54117e;})});}_0x34ea1f=_[_0x681d('0x43')]({},_0x34ea1f,_0x4dfd23[_0x681d('0x44')]);return _0x5f7f72['getMembers'](_0x34ea1f);}})[_0x681d('0x29')](function(_0x5d3688){if(_0x5d3688){_0x37cbb3=_0x5d3688[_0x681d('0x3c')];if(!_0x4dfd23['query'][_0x681d('0x3d')]('nolimit')){_0x34ea1f['limit']=qs[_0x681d('0x21')](_0x4dfd23[_0x681d('0x36')][_0x681d('0x21')]);_0x34ea1f[_0x681d('0x1f')]=qs['offset'](_0x4dfd23[_0x681d('0x36')][_0x681d('0x1f')]);}return _0x5f7f72['getMembers'](_0x34ea1f);}})[_0x681d('0x29')](function(_0x974190){if(_0x974190){return _0x974190?{'count':_0x37cbb3,'rows':_0x974190}:null;}})[_0x681d('0x29')](respondWithResult(_0x352460,null))['catch'](handleError(_0x352460,null));};exports['removeMembers']=function(_0x163408,_0x56a040,_0x11e11d){return db[_0x681d('0x30')][_0x681d('0x4c')]({'where':{'id':_0x163408[_0x681d('0x4b')]['id']}})[_0x681d('0x29')](handleEntityNotFound(_0x56a040,null))['then'](function(_0x573287){if(_0x573287){return _0x573287[_0x681d('0x5b')](_0x163408['query'][_0x681d('0x56')]);}})['then'](respondWithStatusCode(_0x56a040,null))['catch'](handleError(_0x56a040,null));};exports['addMessage']=function(_0x2f396b,_0x4a8f01,_0x5aeda5){if(_0x2f396b[_0x681d('0x4e')]['id']){delete _0x2f396b['body']['id'];}return db[_0x681d('0x30')][_0x681d('0x4c')]({'where':{'id':_0x2f396b[_0x681d('0x4b')]['id']}})[_0x681d('0x29')](handleEntityNotFound(_0x4a8f01,null))[_0x681d('0x29')](function(_0x1a218a){if(_0x1a218a){_0x2f396b[_0x681d('0x4e')][_0x681d('0x5c')]=_0x1a218a['id'];return db[_0x681d('0x51')][_0x681d('0x4d')](_0x2f396b[_0x681d('0x4e')]);}})[_0x681d('0x29')](respondWithResult(_0x4a8f01,null))[_0x681d('0x49')](handleError(_0x4a8f01,null));};exports[_0x681d('0x5d')]=function(_0x3058f9,_0xeaa46d,_0x2113e1){var _0x2641c6={};var _0x24b63e={};var _0x3c19f1;var _0x2842f0;return db[_0x681d('0x30')][_0x681d('0x58')]({'where':{'id':_0x3058f9[_0x681d('0x4b')]['id']}})[_0x681d('0x29')](handleEntityNotFound(_0xeaa46d,null))[_0x681d('0x29')](function(_0x59b1ec){if(_0x59b1ec){_0x3c19f1=_0x59b1ec;_0x24b63e[_0x681d('0x39')]=_[_0x681d('0x35')](db[_0x681d('0x51')][_0x681d('0x31')]);_0x24b63e[_0x681d('0x36')]=_[_0x681d('0x35')](_0x3058f9['query']);_0x24b63e[_0x681d('0x37')]=_[_0x681d('0x38')](_0x24b63e['model'],_0x24b63e[_0x681d('0x36')]);_0x2641c6[_0x681d('0x3a')]=_[_0x681d('0x38')](_0x24b63e[_0x681d('0x39')],qs[_0x681d('0x3b')](_0x3058f9['query'][_0x681d('0x3b')]));_0x2641c6[_0x681d('0x3a')]=_0x2641c6['attributes'][_0x681d('0x3c')]?_0x2641c6['attributes']:_0x24b63e[_0x681d('0x39')];_0x2641c6[_0x681d('0x5a')]=qs[_0x681d('0x3f')](_0x3058f9[_0x681d('0x36')][_0x681d('0x3f')]);_0x2641c6[_0x681d('0x40')]=qs[_0x681d('0x37')](_[_0x681d('0x41')](_0x3058f9[_0x681d('0x36')],_0x24b63e['filters']));if(_0x3058f9[_0x681d('0x36')][_0x681d('0x42')]){_0x2641c6[_0x681d('0x40')]=_['merge'](_0x2641c6[_0x681d('0x40')],{'$or':_[_0x681d('0x2f')](_0x2641c6[_0x681d('0x3a')],function(_0x253b8c){var _0x2fe828={};_0x2fe828[_0x253b8c]={'$like':'%'+_0x3058f9[_0x681d('0x36')]['filter']+'%'};return _0x2fe828;})});}if(_0x3058f9[_0x681d('0x36')]['$gte']){var _0x5519a4=_0x3058f9[_0x681d('0x36')][_0x681d('0x5e')][_0x681d('0x5f')](',');var _0x18895c={};_0x18895c[_0x5519a4[0x0]]={'$gte':moment(_0x5519a4[0x1])[_0x681d('0x60')](_0x681d('0x61'))};_0x2641c6[_0x681d('0x40')]=_[_0x681d('0x43')](_0x2641c6[_0x681d('0x40')],_0x18895c);}_0x2641c6=_['merge']({},_0x2641c6,_0x3058f9[_0x681d('0x44')]);return _0x3c19f1['getMessages'](_0x2641c6);}})[_0x681d('0x29')](function(_0x52912d){if(_0x52912d){_0x2842f0=_0x52912d[_0x681d('0x3c')];if(!_0x3058f9['query'][_0x681d('0x3d')](_0x681d('0x3e'))){_0x2641c6['limit']=qs['limit'](_0x3058f9[_0x681d('0x36')][_0x681d('0x21')]);_0x2641c6[_0x681d('0x1f')]=qs[_0x681d('0x1f')](_0x3058f9[_0x681d('0x36')][_0x681d('0x1f')]);}return _0x3c19f1['getMessages'](_0x2641c6);}})[_0x681d('0x29')](function(_0x54d61d){if(_0x54d61d){return _0x54d61d?{'count':_0x2842f0,'rows':_0x54d61d}:null;}})[_0x681d('0x29')](respondWithResult(_0xeaa46d,null))[_0x681d('0x49')](handleError(_0xeaa46d,null));}; \ No newline at end of file +var _0x071f=['getMessages','format','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','save','then','error','stack','name','send','index','map','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','ChatGroup','includeAll','findAll','catch','show','include','update','body','params','destroy','find','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers','findOne','User','filters','options','removeMembers','addMessage','create'];(function(_0x4ac596,_0x95832e){var _0xd55ac5=function(_0x225fc9){while(--_0x225fc9){_0x4ac596['push'](_0x4ac596['shift']());}};_0xd55ac5(++_0x95832e);}(_0x071f,0x172));var _0xf071=function(_0x19ddfd,_0x1147c6){_0x19ddfd=_0x19ddfd-0x0;var _0x30a5f2=_0x071f[_0x19ddfd];return _0x30a5f2;};'use strict';var emlformat=require(_0xf071('0x0'));var rimraf=require(_0xf071('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf071('0x2'));var rp=require(_0xf071('0x3'));var moment=require(_0xf071('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf071('0x5'));var util=require(_0xf071('0x6'));var path=require(_0xf071('0x7'));var sox=require(_0xf071('0x8'));var csv=require(_0xf071('0x9'));var ejs=require(_0xf071('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf071('0xb'));var squel=require(_0xf071('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf071('0xd'));var toCsv=require(_0xf071('0x9'));var querystring=require(_0xf071('0xe'));var Papa=require('papaparse');var Redis=require(_0xf071('0xf'));var authService=require(_0xf071('0x10'));var qs=require(_0xf071('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf071('0x12'));var logger=require(_0xf071('0x13'))(_0xf071('0x14'));var utils=require('../../config/utils');var config=require(_0xf071('0x15'));var licenseUtil=require(_0xf071('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xf071('0x17')],{'host':_0xf071('0x18'),'port':0x18eb});var socket=require(_0xf071('0x19'))(new Redis(config[_0xf071('0x17')]));require(_0xf071('0x1a'))[_0xf071('0x1b')](socket);function respondWithStatusCode(_0x4219e7,_0x32696c){_0x32696c=_0x32696c||0xcc;return function(_0x4f51a3){if(_0x4f51a3){return _0x4219e7[_0xf071('0x1c')](_0x32696c);}return _0x4219e7[_0xf071('0x1d')](_0x32696c)[_0xf071('0x1e')]();};}function respondWithResult(_0xef2f78,_0x30f486){_0x30f486=_0x30f486||0xc8;return function(_0x4e95ce){if(_0x4e95ce){return _0xef2f78[_0xf071('0x1d')](_0x30f486)[_0xf071('0x1f')](_0x4e95ce);}};}function respondWithFilteredResult(_0x589a16,_0x462e3c){return function(_0x327d3b){if(_0x327d3b){var _0x29d339=typeof _0x462e3c[_0xf071('0x20')]==='undefined'&&typeof _0x462e3c[_0xf071('0x21')]===_0xf071('0x22');var _0x1c4c0d=_0x327d3b[_0xf071('0x23')];var _0x465799=_0x29d339?0x0:_0x462e3c['offset'];var _0x31b68f=_0x29d339?_0x327d3b[_0xf071('0x23')]:_0x462e3c[_0xf071('0x20')]+_0x462e3c[_0xf071('0x21')];var _0x4346bd;if(_0x31b68f>=_0x1c4c0d){_0x31b68f=_0x1c4c0d;_0x4346bd=0xc8;}else{_0x4346bd=0xce;}_0x589a16[_0xf071('0x1d')](_0x4346bd);return _0x589a16[_0xf071('0x24')]('Content-Range',_0x465799+'-'+_0x31b68f+'/'+_0x1c4c0d)[_0xf071('0x1f')](_0x327d3b);}return null;};}function patchUpdates(_0x5d4648){return function(_0x14937f){try{jsonpatch[_0xf071('0x25')](_0x14937f,_0x5d4648,!![]);}catch(_0x2feeb8){return BPromise['reject'](_0x2feeb8);}return _0x14937f[_0xf071('0x26')]();};}function saveUpdates(_0x4f1f33,_0x415dad){return function(_0x21bb0e){if(_0x21bb0e){return _0x21bb0e['update'](_0x4f1f33)[_0xf071('0x27')](function(_0x1aa9a9){return _0x1aa9a9;});}return null;};}function removeEntity(_0x400ba1,_0x29e5fc){return function(_0x2dfc9a){if(_0x2dfc9a){return _0x2dfc9a['destroy']()[_0xf071('0x27')](function(){_0x400ba1['status'](0xcc)[_0xf071('0x1e')]();});}};}function handleEntityNotFound(_0x1309cc,_0x428b8a){return function(_0x38283c){if(!_0x38283c){_0x1309cc[_0xf071('0x1c')](0x194);}return _0x38283c;};}function handleError(_0x461870,_0x33ab4d){_0x33ab4d=_0x33ab4d||0x1f4;return function(_0x3d02ba){logger[_0xf071('0x28')](_0x3d02ba[_0xf071('0x29')]);if(_0x3d02ba['name']){delete _0x3d02ba[_0xf071('0x2a')];}_0x461870[_0xf071('0x1d')](_0x33ab4d)[_0xf071('0x2b')](_0x3d02ba);};}exports[_0xf071('0x2c')]=function(_0x54a13d,_0x3794e3){var _0x4eb874={},_0x57c025={},_0x36211a={'count':0x0,'rows':[]};var _0x1acaaa=_[_0xf071('0x2d')](db['ChatGroup'][_0xf071('0x2e')],function(_0x11c845){return{'name':_0x11c845['fieldName'],'type':_0x11c845[_0xf071('0x2f')]['key']};});_0x57c025[_0xf071('0x30')]=_[_0xf071('0x2d')](_0x1acaaa,_0xf071('0x2a'));_0x57c025[_0xf071('0x31')]=_[_0xf071('0x32')](_0x54a13d[_0xf071('0x31')]);_0x57c025['filters']=_[_0xf071('0x33')](_0x57c025[_0xf071('0x30')],_0x57c025[_0xf071('0x31')]);_0x4eb874[_0xf071('0x34')]=_[_0xf071('0x33')](_0x57c025[_0xf071('0x30')],qs['fields'](_0x54a13d[_0xf071('0x31')][_0xf071('0x35')]));_0x4eb874[_0xf071('0x34')]=_0x4eb874[_0xf071('0x34')][_0xf071('0x36')]?_0x4eb874[_0xf071('0x34')]:_0x57c025[_0xf071('0x30')];if(!_0x54a13d[_0xf071('0x31')][_0xf071('0x37')](_0xf071('0x38'))){_0x4eb874[_0xf071('0x21')]=qs['limit'](_0x54a13d[_0xf071('0x31')][_0xf071('0x21')]);_0x4eb874[_0xf071('0x20')]=qs[_0xf071('0x20')](_0x54a13d['query']['offset']);}_0x4eb874[_0xf071('0x39')]=qs[_0xf071('0x3a')](_0x54a13d[_0xf071('0x31')][_0xf071('0x3a')]);_0x4eb874[_0xf071('0x3b')]=qs['filters'](_[_0xf071('0x3c')](_0x54a13d[_0xf071('0x31')],_0x57c025['filters']),_0x1acaaa);if(_0x54a13d[_0xf071('0x31')][_0xf071('0x3d')]){_0x4eb874[_0xf071('0x3b')]=_[_0xf071('0x3e')](_0x4eb874[_0xf071('0x3b')],{'$or':_[_0xf071('0x2d')](_0x1acaaa,function(_0x179979){if(_0x179979[_0xf071('0x2f')]!==_0xf071('0x3f')){var _0x443df9={};_0x443df9[_0x179979[_0xf071('0x2a')]]={'$like':'%'+_0x54a13d['query'][_0xf071('0x3d')]+'%'};return _0x443df9;}})});}_0x4eb874=_['merge']({},_0x4eb874,_0x54a13d['options']);var _0xb603b0={'where':_0x4eb874[_0xf071('0x3b')]};return db[_0xf071('0x40')][_0xf071('0x23')](_0xb603b0)[_0xf071('0x27')](function(_0x243651){_0x36211a['count']=_0x243651;if(_0x54a13d[_0xf071('0x31')][_0xf071('0x41')]){_0x4eb874['include']=[{'all':!![]}];}return db['ChatGroup'][_0xf071('0x42')](_0x4eb874);})[_0xf071('0x27')](function(_0x5c036d){_0x36211a['rows']=_0x5c036d;return _0x36211a;})[_0xf071('0x27')](respondWithFilteredResult(_0x3794e3,_0x4eb874))[_0xf071('0x43')](handleError(_0x3794e3,null));};exports[_0xf071('0x44')]=function(_0x369a71,_0x239095){var _0x1be94f={'raw':!![],'where':{'id':_0x369a71['params']['id']}},_0x3ce036={};_0x3ce036[_0xf071('0x30')]=_[_0xf071('0x32')](db['ChatGroup'][_0xf071('0x2e')]);_0x3ce036[_0xf071('0x31')]=_[_0xf071('0x32')](_0x369a71[_0xf071('0x31')]);_0x3ce036['filters']=_['intersection'](_0x3ce036[_0xf071('0x30')],_0x3ce036['query']);_0x1be94f['attributes']=_[_0xf071('0x33')](_0x3ce036['model'],qs[_0xf071('0x35')](_0x369a71[_0xf071('0x31')]['fields']));_0x1be94f['attributes']=_0x1be94f[_0xf071('0x34')][_0xf071('0x36')]?_0x1be94f['attributes']:_0x3ce036[_0xf071('0x30')];if(_0x369a71[_0xf071('0x31')][_0xf071('0x41')]){_0x1be94f[_0xf071('0x45')]=[{'all':!![]}];}_0x1be94f=_[_0xf071('0x3e')]({},_0x1be94f,_0x369a71['options']);return db[_0xf071('0x40')]['find'](_0x1be94f)[_0xf071('0x27')](handleEntityNotFound(_0x239095,null))[_0xf071('0x27')](respondWithResult(_0x239095,null))[_0xf071('0x43')](handleError(_0x239095,null));};exports['create']=function(_0x4d44ec,_0x5cc4fe){return db[_0xf071('0x40')]['create'](_0x4d44ec['body'],{})['then'](respondWithResult(_0x5cc4fe,0xc9))[_0xf071('0x43')](handleError(_0x5cc4fe,null));};exports[_0xf071('0x46')]=function(_0x34487a,_0x263a1a){if(_0x34487a[_0xf071('0x47')]['id']){delete _0x34487a[_0xf071('0x47')]['id'];}return db[_0xf071('0x40')]['find']({'where':{'id':_0x34487a[_0xf071('0x48')]['id']}})[_0xf071('0x27')](handleEntityNotFound(_0x263a1a,null))[_0xf071('0x27')](saveUpdates(_0x34487a[_0xf071('0x47')],null))[_0xf071('0x27')](respondWithResult(_0x263a1a,null))[_0xf071('0x43')](handleError(_0x263a1a,null));};exports[_0xf071('0x49')]=function(_0x37cc99,_0xe1b08c){return db[_0xf071('0x40')][_0xf071('0x4a')]({'where':{'id':_0x37cc99['params']['id']}})[_0xf071('0x27')](handleEntityNotFound(_0xe1b08c,null))[_0xf071('0x27')](removeEntity(_0xe1b08c,null))[_0xf071('0x43')](handleError(_0xe1b08c,null));};exports['describe']=function(_0x5c16aa,_0x30969d){return db['ChatGroup'][_0xf071('0x4b')]()[_0xf071('0x27')](respondWithResult(_0x30969d,null))['catch'](handleError(_0x30969d,null));};exports[_0xf071('0x4c')]=function(_0x4a03a6,_0x4aeab8,_0x113b21){return db[_0xf071('0x4d')][_0xf071('0x23')]({'where':{'ChatGroupId':_0x4a03a6[_0xf071('0x48')]['id'],'ToId':_0x4a03a6[_0xf071('0x4e')]['id'],'read':![]}})[_0xf071('0x27')](function(_0x36a115){return{'id':_[_0xf071('0x4f')](_0x4a03a6[_0xf071('0x48')]['id']),'count':_0x36a115};})[_0xf071('0x27')](respondWithResult(_0x4aeab8,null))[_0xf071('0x43')](handleError(_0x4aeab8,null));};exports[_0xf071('0x50')]=function(_0x47c7a3,_0x2c16c5,_0x4602a4){return db[_0xf071('0x40')]['find']({'where':{'id':_0x47c7a3[_0xf071('0x48')]['id']}})[_0xf071('0x27')](handleEntityNotFound(_0x2c16c5,null))[_0xf071('0x27')](function(_0x317fe5){if(_0x317fe5){return _0x317fe5[_0xf071('0x50')](_0x47c7a3[_0xf071('0x47')]['ids'],_['omit'](_0x47c7a3['body'],[_0xf071('0x51'),'id'])||{});}})[_0xf071('0x27')](respondWithResult(_0x2c16c5,null))[_0xf071('0x43')](handleError(_0x2c16c5,null));};exports[_0xf071('0x52')]=function(_0x15709f,_0x5bdc14,_0xbce11d){var _0x5156b2={};var _0x68b477={};var _0xa9124f;var _0x15e05b;return db['ChatGroup'][_0xf071('0x53')]({'where':{'id':_0x15709f[_0xf071('0x48')]['id']}})[_0xf071('0x27')](handleEntityNotFound(_0x5bdc14,null))['then'](function(_0xd30a27){if(_0xd30a27){_0xa9124f=_0xd30a27;_0x68b477[_0xf071('0x30')]=_['keys'](db[_0xf071('0x54')][_0xf071('0x2e')]);_0x68b477[_0xf071('0x31')]=_[_0xf071('0x32')](_0x15709f[_0xf071('0x31')]);_0x68b477[_0xf071('0x55')]=_[_0xf071('0x33')](_0x68b477[_0xf071('0x30')],_0x68b477['query']);_0x5156b2['attributes']=_[_0xf071('0x33')](_0x68b477[_0xf071('0x30')],qs['fields'](_0x15709f[_0xf071('0x31')][_0xf071('0x35')]));_0x5156b2[_0xf071('0x34')]=_0x5156b2['attributes'][_0xf071('0x36')]?_0x5156b2[_0xf071('0x34')]:_0x68b477[_0xf071('0x30')];_0x5156b2['order']=qs['sort'](_0x15709f[_0xf071('0x31')][_0xf071('0x3a')]);_0x5156b2[_0xf071('0x3b')]=qs[_0xf071('0x55')](_[_0xf071('0x3c')](_0x15709f[_0xf071('0x31')],_0x68b477[_0xf071('0x55')]));if(_0x15709f[_0xf071('0x31')][_0xf071('0x3d')]){_0x5156b2['where']=_['merge'](_0x5156b2[_0xf071('0x3b')],{'$or':_['map'](_0x5156b2[_0xf071('0x34')],function(_0x4815db){var _0x39c167={};_0x39c167[_0x4815db]={'$like':'%'+_0x15709f[_0xf071('0x31')][_0xf071('0x3d')]+'%'};return _0x39c167;})});}_0x5156b2=_[_0xf071('0x3e')]({},_0x5156b2,_0x15709f[_0xf071('0x56')]);return _0xa9124f[_0xf071('0x52')](_0x5156b2);}})[_0xf071('0x27')](function(_0x38f4fa){if(_0x38f4fa){_0x15e05b=_0x38f4fa['length'];if(!_0x15709f[_0xf071('0x31')][_0xf071('0x37')](_0xf071('0x38'))){_0x5156b2['limit']=qs[_0xf071('0x21')](_0x15709f['query']['limit']);_0x5156b2[_0xf071('0x20')]=qs[_0xf071('0x20')](_0x15709f['query'][_0xf071('0x20')]);}return _0xa9124f[_0xf071('0x52')](_0x5156b2);}})[_0xf071('0x27')](function(_0x433ac8){if(_0x433ac8){return _0x433ac8?{'count':_0x15e05b,'rows':_0x433ac8}:null;}})['then'](respondWithResult(_0x5bdc14,null))[_0xf071('0x43')](handleError(_0x5bdc14,null));};exports[_0xf071('0x57')]=function(_0x24fa57,_0x68dadd,_0x3f8faa){return db[_0xf071('0x40')]['find']({'where':{'id':_0x24fa57[_0xf071('0x48')]['id']}})[_0xf071('0x27')](handleEntityNotFound(_0x68dadd,null))['then'](function(_0x2d3daf){if(_0x2d3daf){return _0x2d3daf[_0xf071('0x57')](_0x24fa57['query'][_0xf071('0x51')]);}})['then'](respondWithStatusCode(_0x68dadd,null))[_0xf071('0x43')](handleError(_0x68dadd,null));};exports[_0xf071('0x58')]=function(_0x448619,_0x32dea4,_0x4221e7){if(_0x448619[_0xf071('0x47')]['id']){delete _0x448619[_0xf071('0x47')]['id'];}return db[_0xf071('0x40')][_0xf071('0x4a')]({'where':{'id':_0x448619[_0xf071('0x48')]['id']}})[_0xf071('0x27')](handleEntityNotFound(_0x32dea4,null))[_0xf071('0x27')](function(_0x38c519){if(_0x38c519){_0x448619[_0xf071('0x47')]['ChatGroupId']=_0x38c519['id'];return db['ChatInternalMessage'][_0xf071('0x59')](_0x448619[_0xf071('0x47')]);}})[_0xf071('0x27')](respondWithResult(_0x32dea4,null))[_0xf071('0x43')](handleError(_0x32dea4,null));};exports[_0xf071('0x5a')]=function(_0x341e54,_0x52f12c,_0x491774){var _0x335e48={};var _0x4e57ec={};var _0x1df270;var _0x273df4;return db[_0xf071('0x40')]['findOne']({'where':{'id':_0x341e54[_0xf071('0x48')]['id']}})[_0xf071('0x27')](handleEntityNotFound(_0x52f12c,null))[_0xf071('0x27')](function(_0x1e95eb){if(_0x1e95eb){_0x1df270=_0x1e95eb;_0x4e57ec['model']=_[_0xf071('0x32')](db['ChatInternalMessage']['rawAttributes']);_0x4e57ec[_0xf071('0x31')]=_[_0xf071('0x32')](_0x341e54[_0xf071('0x31')]);_0x4e57ec[_0xf071('0x55')]=_[_0xf071('0x33')](_0x4e57ec[_0xf071('0x30')],_0x4e57ec[_0xf071('0x31')]);_0x335e48[_0xf071('0x34')]=_['intersection'](_0x4e57ec[_0xf071('0x30')],qs[_0xf071('0x35')](_0x341e54[_0xf071('0x31')][_0xf071('0x35')]));_0x335e48[_0xf071('0x34')]=_0x335e48[_0xf071('0x34')][_0xf071('0x36')]?_0x335e48[_0xf071('0x34')]:_0x4e57ec['model'];_0x335e48[_0xf071('0x39')]=qs['sort'](_0x341e54['query'][_0xf071('0x3a')]);_0x335e48[_0xf071('0x3b')]=qs['filters'](_[_0xf071('0x3c')](_0x341e54[_0xf071('0x31')],_0x4e57ec[_0xf071('0x55')]));if(_0x341e54[_0xf071('0x31')][_0xf071('0x3d')]){_0x335e48[_0xf071('0x3b')]=_[_0xf071('0x3e')](_0x335e48[_0xf071('0x3b')],{'$or':_[_0xf071('0x2d')](_0x335e48[_0xf071('0x34')],function(_0x5a999a){var _0x1fc3ca={};_0x1fc3ca[_0x5a999a]={'$like':'%'+_0x341e54[_0xf071('0x31')][_0xf071('0x3d')]+'%'};return _0x1fc3ca;})});}if(_0x341e54['query']['$gte']){var _0x2cbc89=_0x341e54['query']['$gte']['split'](',');var _0x36d289={};_0x36d289[_0x2cbc89[0x0]]={'$gte':moment(_0x2cbc89[0x1])[_0xf071('0x5b')]('YYYY-MM-DD\x20HH:mm:ss')};_0x335e48['where']=_[_0xf071('0x3e')](_0x335e48[_0xf071('0x3b')],_0x36d289);}_0x335e48=_[_0xf071('0x3e')]({},_0x335e48,_0x341e54[_0xf071('0x56')]);return _0x1df270[_0xf071('0x5a')](_0x335e48);}})[_0xf071('0x27')](function(_0xd2850a){if(_0xd2850a){_0x273df4=_0xd2850a[_0xf071('0x36')];if(!_0x341e54[_0xf071('0x31')][_0xf071('0x37')](_0xf071('0x38'))){_0x335e48[_0xf071('0x21')]=qs[_0xf071('0x21')](_0x341e54[_0xf071('0x31')]['limit']);_0x335e48['offset']=qs['offset'](_0x341e54['query']['offset']);}return _0x1df270[_0xf071('0x5a')](_0x335e48);}})[_0xf071('0x27')](function(_0x4049a4){if(_0x4049a4){return _0x4049a4?{'count':_0x273df4,'rows':_0x4049a4}:null;}})['then'](respondWithResult(_0x52f12c,null))['catch'](handleError(_0x52f12c,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 930adab..09a113c 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 _0x3c91=['update','remove','emit','hasOwnProperty','events','../../mysqldb','ChatGroup'];(function(_0x5cabfd,_0x5dea47){var _0x4bc06c=function(_0x4a2fea){while(--_0x4a2fea){_0x5cabfd['push'](_0x5cabfd['shift']());}};_0x4bc06c(++_0x5dea47);}(_0x3c91,0x1af));var _0x13c9=function(_0x2105ed,_0x3d8ea2){_0x2105ed=_0x2105ed-0x0;var _0x8371e1=_0x3c91[_0x2105ed];return _0x8371e1;};'use strict';var EventEmitter=require(_0x13c9('0x0'));var ChatGroup=require(_0x13c9('0x1'))['db'][_0x13c9('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x13c9('0x3'),'afterDestroy':_0x13c9('0x4')};function emitEvent(_0x3e955c){return function(_0x4eec3a,_0x305980,_0x45854a){ChatGroupEvents[_0x13c9('0x5')](_0x3e955c+':'+_0x4eec3a['id'],_0x4eec3a);ChatGroupEvents[_0x13c9('0x5')](_0x3e955c,_0x4eec3a);_0x45854a(null);};}for(var e in events){if(events[_0x13c9('0x6')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0x3189=['update','remove','emit','hasOwnProperty','exports','events','ChatGroup','setMaxListeners','save'];(function(_0x3b8c4f,_0x3de4de){var _0x5793bc=function(_0x1baef8){while(--_0x1baef8){_0x3b8c4f['push'](_0x3b8c4f['shift']());}};_0x5793bc(++_0x3de4de);}(_0x3189,0x19a));var _0x9318=function(_0x2d2421,_0x3422d6){_0x2d2421=_0x2d2421-0x0;var _0x341708=_0x3189[_0x2d2421];return _0x341708;};'use strict';var EventEmitter=require(_0x9318('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0x9318('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x9318('0x2')](0x0);var events={'afterCreate':_0x9318('0x3'),'afterUpdate':_0x9318('0x4'),'afterDestroy':_0x9318('0x5')};function emitEvent(_0x5b33c1){return function(_0x6ee8e8,_0x88ded7,_0x2920b4){ChatGroupEvents[_0x9318('0x6')](_0x5b33c1+':'+_0x6ee8e8['id'],_0x6ee8e8);ChatGroupEvents[_0x9318('0x6')](_0x5b33c1,_0x6ee8e8);_0x2920b4(null);};}for(var e in events){if(events[_0x9318('0x7')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x9318('0x8')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index c7cf491..45cb756 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 _0x6be8=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatGroup','chat_groups','util','../../config/logger','api'];(function(_0x5a6cda,_0x23767e){var _0x2d660b=function(_0x3eae03){while(--_0x3eae03){_0x5a6cda['push'](_0x5a6cda['shift']());}};_0x2d660b(++_0x23767e);}(_0x6be8,0x190));var _0x86be=function(_0x31fe93,_0x323946){_0x31fe93=_0x31fe93-0x0;var _0x3d7768=_0x6be8[_0x31fe93];return _0x3d7768;};'use strict';var _=require('lodash');var util=require(_0x86be('0x0'));var logger=require(_0x86be('0x1'))(_0x86be('0x2'));var moment=require(_0x86be('0x3'));var BPromise=require(_0x86be('0x4'));var rp=require(_0x86be('0x5'));var fs=require('fs');var path=require(_0x86be('0x6'));var rimraf=require(_0x86be('0x7'));var config=require(_0x86be('0x8'));var attributes=require('./chatGroup.attributes');module[_0x86be('0x9')]=function(_0x3364a1,_0x237248){return _0x3364a1[_0x86be('0xa')](_0x86be('0xb'),attributes,{'tableName':_0x86be('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x848e=['path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','lodash','util','../../config/logger','api','moment'];(function(_0x126364,_0xeba548){var _0x4fc360=function(_0x13fddd){while(--_0x13fddd){_0x126364['push'](_0x126364['shift']());}};_0x4fc360(++_0xeba548);}(_0x848e,0xd3));var _0xe848=function(_0x18d945,_0x11e617){_0x18d945=_0x18d945-0x0;var _0x44328b=_0x848e[_0x18d945];return _0x44328b;};'use strict';var _=require(_0xe848('0x0'));var util=require(_0xe848('0x1'));var logger=require(_0xe848('0x2'))(_0xe848('0x3'));var moment=require(_0xe848('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe848('0x5'));var rimraf=require(_0xe848('0x6'));var config=require(_0xe848('0x7'));var attributes=require(_0xe848('0x8'));module[_0xe848('0x9')]=function(_0x2287ca,_0x491de1){return _0x2287ca[_0xe848('0xa')](_0xe848('0xb'),attributes,{'tableName':'chat_groups','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 2a98a14..c0524b8 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 _0xdab2=['request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','then','info','ChatGroup,\x20%s,\x20%s'];(function(_0x140f21,_0x3e9551){var _0x573a18=function(_0x2b85c0){while(--_0x2b85c0){_0x140f21['push'](_0x140f21['shift']());}};_0x573a18(++_0x3e9551);}(_0xdab2,0x130));var _0x2dab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdab2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2dab('0x0'));var util=require(_0x2dab('0x1'));var moment=require('moment');var BPromise=require(_0x2dab('0x2'));var rs=require(_0x2dab('0x3'));var fs=require('fs');var Redis=require(_0x2dab('0x4'));var db=require(_0x2dab('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2dab('0x6'))(_0x2dab('0x7'));var config=require(_0x2dab('0x8'));var jayson=require(_0x2dab('0x9'));var client=jayson[_0x2dab('0xa')][_0x2dab('0xb')]({'port':0x232a});config[_0x2dab('0xc')]=_[_0x2dab('0xd')](config[_0x2dab('0xc')],{'host':_0x2dab('0xe'),'port':0x18eb});var socket=require(_0x2dab('0xf'))(new Redis(config[_0x2dab('0xc')]));require(_0x2dab('0x10'))['register'](socket);function respondWithRpcPromise(_0x596950,_0x26852f,_0x18db7b){return new BPromise(function(_0x1e258e,_0x4bc28b){return client['request'](_0x596950,_0x18db7b)[_0x2dab('0x11')](function(_0x3e7252){logger[_0x2dab('0x12')](_0x2dab('0x13'),_0x26852f,_0x2dab('0x14'));logger['debug'](_0x2dab('0x15'),_0x26852f,_0x2dab('0x14'),JSON['stringify'](_0x3e7252));if(_0x3e7252[_0x2dab('0x16')]){if(_0x3e7252[_0x2dab('0x16')][_0x2dab('0x17')]===0x1f4){logger['error'](_0x2dab('0x13'),_0x26852f,_0x3e7252[_0x2dab('0x16')]['message']);return _0x4bc28b(_0x3e7252[_0x2dab('0x16')][_0x2dab('0x18')]);}logger[_0x2dab('0x16')](_0x2dab('0x13'),_0x26852f,_0x3e7252[_0x2dab('0x16')]['message']);return _0x1e258e(_0x3e7252[_0x2dab('0x16')][_0x2dab('0x18')]);}else{logger[_0x2dab('0x12')](_0x2dab('0x13'),_0x26852f,_0x2dab('0x14'));_0x1e258e(_0x3e7252[_0x2dab('0x19')]['message']);}})[_0x2dab('0x1a')](function(_0x366e7c){logger[_0x2dab('0x16')]('ChatGroup,\x20%s,\x20%s',_0x26852f,_0x366e7c);_0x4bc28b(_0x366e7c);});});} \ No newline at end of file +var _0xf61e=['client','http','defaults','localhost','socket.io-emitter','redis','./chatGroup.socket','register','request','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xcf539f,_0x569e47){var _0x3d9c50=function(_0x2864bc){while(--_0x2864bc){_0xcf539f['push'](_0xcf539f['shift']());}};_0x3d9c50(++_0x569e47);}(_0xf61e,0x82));var _0xef61=function(_0x41bcc3,_0x5cd04f){_0x41bcc3=_0x41bcc3-0x0;var _0x4b3c99=_0xf61e[_0x41bcc3];return _0x4b3c99;};'use strict';var _=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var moment=require(_0xef61('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xef61('0x3'));var db=require(_0xef61('0x4'))['db'];var utils=require(_0xef61('0x5'));var logger=require(_0xef61('0x6'))(_0xef61('0x7'));var config=require(_0xef61('0x8'));var jayson=require(_0xef61('0x9'));var client=jayson[_0xef61('0xa')][_0xef61('0xb')]({'port':0x232a});config['redis']=_[_0xef61('0xc')](config['redis'],{'host':_0xef61('0xd'),'port':0x18eb});var socket=require(_0xef61('0xe'))(new Redis(config[_0xef61('0xf')]));require(_0xef61('0x10'))[_0xef61('0x11')](socket);function respondWithRpcPromise(_0x5b68e9,_0x4bb153,_0x4e1f45){return new BPromise(function(_0x1721b4,_0x1e10c0){return client[_0xef61('0x12')](_0x5b68e9,_0x4e1f45)['then'](function(_0x1bfd11){logger['info'](_0xef61('0x13'),_0x4bb153,_0xef61('0x14'));logger[_0xef61('0x15')](_0xef61('0x16'),_0x4bb153,'request\x20sent',JSON[_0xef61('0x17')](_0x1bfd11));if(_0x1bfd11['error']){if(_0x1bfd11[_0xef61('0x18')][_0xef61('0x19')]===0x1f4){logger[_0xef61('0x18')](_0xef61('0x13'),_0x4bb153,_0x1bfd11[_0xef61('0x18')][_0xef61('0x1a')]);return _0x1e10c0(_0x1bfd11[_0xef61('0x18')]['message']);}logger[_0xef61('0x18')]('ChatGroup,\x20%s,\x20%s',_0x4bb153,_0x1bfd11[_0xef61('0x18')][_0xef61('0x1a')]);return _0x1721b4(_0x1bfd11[_0xef61('0x18')][_0xef61('0x1a')]);}else{logger[_0xef61('0x1b')]('ChatGroup,\x20%s,\x20%s',_0x4bb153,_0xef61('0x14'));_0x1721b4(_0x1bfd11['result'][_0xef61('0x1a')]);}})['catch'](function(_0x2368b3){logger[_0xef61('0x18')]('ChatGroup,\x20%s,\x20%s',_0x4bb153,_0x2368b3);_0x1e10c0(_0x2368b3);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 04d4a92..e6a2cd8 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 _0x7809=['removeListener','register','chatGroup:','./chatGroup.events','save','remove'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x7809,0xe1));var _0x9780=function(_0x430827,_0x124255){_0x430827=_0x430827-0x0;var _0x213ac4=_0x7809[_0x430827];return _0x213ac4;};'use strict';var ChatGroupEvents=require(_0x9780('0x0'));var events=[_0x9780('0x1'),_0x9780('0x2'),'update'];function createListener(_0x2a1337,_0x496433){return function(_0x36734c){_0x496433['emit'](_0x2a1337,_0x36734c);};}function removeListener(_0x53d150,_0x1cc06f){return function(){ChatGroupEvents[_0x9780('0x3')](_0x53d150,_0x1cc06f);};}exports[_0x9780('0x4')]=function(_0xc941da){for(var _0x4a68f9=0x0,_0x10b7cc=events['length'];_0x4a68f9<_0x10b7cc;_0x4a68f9++){var _0x1dac89=events[_0x4a68f9];var _0x43a7a7=createListener(_0x9780('0x5')+_0x1dac89,_0xc941da);ChatGroupEvents['on'](_0x1dac89,_0x43a7a7);}}; \ No newline at end of file +var _0xc0aa=['length','chatGroup:','./chatGroup.events','save','remove','update','emit'];(function(_0x3df1a8,_0x14c6a0){var _0x52e372=function(_0x1a8218){while(--_0x1a8218){_0x3df1a8['push'](_0x3df1a8['shift']());}};_0x52e372(++_0x14c6a0);}(_0xc0aa,0x136));var _0xac0a=function(_0x3aeef3,_0x5b039a){_0x3aeef3=_0x3aeef3-0x0;var _0x4844f8=_0xc0aa[_0x3aeef3];return _0x4844f8;};'use strict';var ChatGroupEvents=require(_0xac0a('0x0'));var events=[_0xac0a('0x1'),_0xac0a('0x2'),_0xac0a('0x3')];function createListener(_0x129334,_0x1f467b){return function(_0x413dd1){_0x1f467b[_0xac0a('0x4')](_0x129334,_0x413dd1);};}function removeListener(_0x5de74a,_0x55d52c){return function(){ChatGroupEvents['removeListener'](_0x5de74a,_0x55d52c);};}exports['register']=function(_0x2e4e16){for(var _0x332d2c=0x0,_0x891c9f=events[_0xac0a('0x5')];_0x332d2c<_0x891c9f;_0x332d2c++){var _0x3a99de=events[_0x332d2c];var _0x175f7e=createListener(_0xac0a('0x6')+_0x3a99de,_0x2e4e16);ChatGroupEvents['on'](_0x3a99de,_0x175f7e);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 308db93..ec4514f 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 _0xc60a=['isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','getMessages','create','post','/:id/messages','addMessage','update','delete','destroy','removeMembers','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','get'];(function(_0x1344d6,_0x2181e6){var _0xf45b24=function(_0x2d90c1){while(--_0x2d90c1){_0x1344d6['push'](_0x1344d6['shift']());}};_0xf45b24(++_0x2181e6);}(_0xc60a,0x6b));var _0xac60=function(_0x3e86b9,_0x4ffc72){_0x3e86b9=_0x3e86b9-0x0;var _0x5c02ea=_0xc60a[_0x3e86b9];return _0x5c02ea;};'use strict';var multer=require('multer');var util=require(_0xac60('0x0'));var path=require('path');var timeout=require(_0xac60('0x1'));var express=require(_0xac60('0x2'));var router=express[_0xac60('0x3')]();var fs_extra=require(_0xac60('0x4'));var auth=require(_0xac60('0x5'));var interaction=require(_0xac60('0x6'));var config=require('../../config/environment');var controller=require(_0xac60('0x7'));router[_0xac60('0x8')]('/',auth[_0xac60('0x9')](),controller[_0xac60('0xa')]);router[_0xac60('0x8')](_0xac60('0xb'),auth[_0xac60('0x9')](),controller[_0xac60('0xc')]);router[_0xac60('0x8')](_0xac60('0xd'),auth['isAuthenticated'](),controller[_0xac60('0xe')]);router[_0xac60('0x8')](_0xac60('0xf'),auth[_0xac60('0x9')](),controller[_0xac60('0x10')]);router[_0xac60('0x8')](_0xac60('0x11'),auth[_0xac60('0x9')](),controller[_0xac60('0x12')]);router[_0xac60('0x8')]('/:id/messages',auth[_0xac60('0x9')](),controller[_0xac60('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0xac60('0x14')]);router[_0xac60('0x15')](_0xac60('0x11'),auth[_0xac60('0x9')](),controller['addMembers']);router[_0xac60('0x15')](_0xac60('0x16'),auth[_0xac60('0x9')](),controller[_0xac60('0x17')]);router['put'](_0xac60('0xd'),auth[_0xac60('0x9')](),controller[_0xac60('0x18')]);router[_0xac60('0x19')](_0xac60('0xd'),auth[_0xac60('0x9')](),controller[_0xac60('0x1a')]);router['delete'](_0xac60('0x11'),auth[_0xac60('0x9')](),controller[_0xac60('0x1b')]);module[_0xac60('0x1c')]=router; \ No newline at end of file +var _0xb6b7=['/:id','delete','removeMembers','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','get','index','/describe','isAuthenticated','describe','show','getUnread','/:id/members','/:id/messages','getMessages','post','addMembers','addMessage'];(function(_0x307ff8,_0x42e75d){var _0x6ed34a=function(_0x2dbfed){while(--_0x2dbfed){_0x307ff8['push'](_0x307ff8['shift']());}};_0x6ed34a(++_0x42e75d);}(_0xb6b7,0x149));var _0x7b6b=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xb6b7[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x7b6b('0x0'));var util=require('util');var path=require(_0x7b6b('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b6b('0x2'));var router=express[_0x7b6b('0x3')]();var fs_extra=require(_0x7b6b('0x4'));var auth=require(_0x7b6b('0x5'));var interaction=require(_0x7b6b('0x6'));var config=require('../../config/environment');var controller=require(_0x7b6b('0x7'));router[_0x7b6b('0x8')]('/',auth['isAuthenticated'](),controller[_0x7b6b('0x9')]);router[_0x7b6b('0x8')](_0x7b6b('0xa'),auth[_0x7b6b('0xb')](),controller[_0x7b6b('0xc')]);router[_0x7b6b('0x8')]('/:id',auth[_0x7b6b('0xb')](),controller[_0x7b6b('0xd')]);router[_0x7b6b('0x8')]('/:id/unread',auth[_0x7b6b('0xb')](),controller[_0x7b6b('0xe')]);router[_0x7b6b('0x8')](_0x7b6b('0xf'),auth[_0x7b6b('0xb')](),controller['getMembers']);router[_0x7b6b('0x8')](_0x7b6b('0x10'),auth[_0x7b6b('0xb')](),controller[_0x7b6b('0x11')]);router[_0x7b6b('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7b6b('0x12')](_0x7b6b('0xf'),auth['isAuthenticated'](),controller[_0x7b6b('0x13')]);router[_0x7b6b('0x12')](_0x7b6b('0x10'),auth['isAuthenticated'](),controller[_0x7b6b('0x14')]);router['put'](_0x7b6b('0x15'),auth[_0x7b6b('0xb')](),controller['update']);router[_0x7b6b('0x16')](_0x7b6b('0x15'),auth[_0x7b6b('0xb')](),controller['destroy']);router[_0x7b6b('0x16')]('/:id/members',auth[_0x7b6b('0xb')](),controller[_0x7b6b('0x17')]);module[_0x7b6b('0x18')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index e13ad72..db9598f 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 _0x05b6=['thumb','TEXT','STRING','DATE','long','out','sequelize','BOOLEAN','INTEGER','ENUM','star'];(function(_0x51dfe3,_0x53b9b7){var _0x28d2a2=function(_0x3fe7f9){while(--_0x3fe7f9){_0x51dfe3['push'](_0x51dfe3['shift']());}};_0x28d2a2(++_0x53b9b7);}(_0x05b6,0x74));var _0x605b=function(_0x182094,_0x269200){_0x182094=_0x182094-0x0;var _0x2e74ff=_0x05b6[_0x182094];return _0x2e74ff;};'use strict';var Sequelize=require(_0x605b('0x0'));module['exports']={'closed':{'type':Sequelize[_0x605b('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x605b('0x2')]},'ratingType':{'type':Sequelize[_0x605b('0x3')](_0x605b('0x4'),_0x605b('0x5')),'defaultValue':_0x605b('0x4')},'ratingMessage':{'type':Sequelize[_0x605b('0x6')]},'pathTranscript':{'type':Sequelize[_0x605b('0x6')]},'mailTranscript':{'type':Sequelize[_0x605b('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x605b('0x8')]},'disposition':{'type':Sequelize[_0x605b('0x7')]},'secondDisposition':{'type':Sequelize[_0x605b('0x7')]},'thirdDisposition':{'type':Sequelize[_0x605b('0x7')]},'note':{'type':Sequelize[_0x605b('0x7')]},'browserName':{'type':Sequelize[_0x605b('0x7')]},'browserVersion':{'type':Sequelize[_0x605b('0x7')]},'osName':{'type':Sequelize[_0x605b('0x7')]},'osVersion':{'type':Sequelize[_0x605b('0x7')]},'deviceModel':{'type':Sequelize[_0x605b('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x605b('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0x605b('0x9'))},'read1stAt':{'type':Sequelize[_0x605b('0x8')]},'lastMsgAt':{'type':Sequelize[_0x605b('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x605b('0x3')]('in',_0x605b('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x605b('0x7')]},'customerPort':{'type':Sequelize[_0x605b('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x605b('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x605b('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0xefe3=['DATE','STRING','long','out','BOOLEAN','sequelize','ENUM','star','thumb','TEXT'];(function(_0x2b19c5,_0x35c198){var _0x4f7993=function(_0x301b9b){while(--_0x301b9b){_0x2b19c5['push'](_0x2b19c5['shift']());}};_0x4f7993(++_0x35c198);}(_0xefe3,0xf5));var _0x3efe=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xefe3[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x3efe('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x3efe('0x1')](_0x3efe('0x2'),_0x3efe('0x3')),'defaultValue':_0x3efe('0x2')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x3efe('0x4')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x3efe('0x5')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x3efe('0x6')]},'thirdDisposition':{'type':Sequelize[_0x3efe('0x6')]},'note':{'type':Sequelize[_0x3efe('0x6')]},'browserName':{'type':Sequelize[_0x3efe('0x6')]},'browserVersion':{'type':Sequelize[_0x3efe('0x6')]},'osName':{'type':Sequelize[_0x3efe('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x3efe('0x6')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x3efe('0x6')]},'referer':{'type':Sequelize[_0x3efe('0x4')]},'customerIp':{'type':Sequelize[_0x3efe('0x6')]},'formData':{'type':Sequelize[_0x3efe('0x4')](_0x3efe('0x7'))},'read1stAt':{'type':Sequelize[_0x3efe('0x5')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x3efe('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x3efe('0x6')]},'customerPort':{'type':Sequelize[_0x3efe('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x3efe('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x3efe('0x9')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 9a5baab..3a721b7 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 _0x4c4e=['YYYY-MM-DD\x20HH:mm:ss','include','findAll','getMyMessages','secret','includeAgent','alias','addTags','setTags','omit','spread','chatInteractionTags:save','removeTags','unix','files','server','attachments','transcript-%d-%s.zip','firstName','lastName','Owner','get','mkdirSync','N.A.','browserName','osName','customerIp','customerPort','existsSync','createReadStream','createWriteStream','renderFile','downloadInteraction.ejs','.pdf','Chat','createPdfFromHTML','unlinkSync','rimraf','request-promise','moment','bluebird','util','path','ejs','squel','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','client','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','undefined','count','offset','set','destroy','name','send','render','merge','body','contact','agent','account','Users','map','fullname','TagIds','Tags','split','push','waiting','talking','answered','abandoned','total','closed','UserId','disposition','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','pick','select','field','color','from','u.fullname','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','having','`\x20=\x200','Contact','operator','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','i.ChatWebsiteId\x20IN\x20?','concat','parse','$gte','$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)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','role','ChatWebsiteId','sequelize','toString','keyBy','ChatInteraction','a.key','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','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','rows','show','params','includeAll','options','create','update','describe','createVidaooSession','findOne','vidaooEscalation','vidaooTopic','vidaooMetadata','vidaooApiKey','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','follow','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','AbandonInteraction','file','originalname','basename','filename','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','offline-chat/','join','download','close','mailTranscript','root','server/files/chat/upload/','format','transcript-%s.txt','now','ChatWebsite','CmContact','Messages','agentAlias','System','customer','%s%d','Visitor','website_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','Smtp','CloudProvider','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','getMessages','hasOwnProperty'];(function(_0x4fcacc,_0x53e95c){var _0x72124b=function(_0xa9ea29){while(--_0xa9ea29){_0x4fcacc['push'](_0x4fcacc['shift']());}};_0x72124b(++_0x53e95c);}(_0x4c4e,0x152));var _0xe4c4=function(_0x596a4a,_0xc531cb){_0x596a4a=_0x596a4a-0x0;var _0x38b080=_0x4c4e[_0x596a4a];return _0x38b080;};'use strict';var rimraf=require(_0xe4c4('0x0'));var zipdir=require('zip-dir');var rp=require(_0xe4c4('0x1'));var moment=require(_0xe4c4('0x2'));var BPromise=require(_0xe4c4('0x3'));var Mustache=require('mustache');var util=require(_0xe4c4('0x4'));var path=require(_0xe4c4('0x5'));var ejs=require(_0xe4c4('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe4c4('0x7'));var Redis=require('ioredis');var qs=require(_0xe4c4('0x8'));var as=require(_0xe4c4('0x9'));var pdf=require(_0xe4c4('0xa'));var logger=require(_0xe4c4('0xb'))(_0xe4c4('0xc'));var config=require(_0xe4c4('0xd'));var db=require(_0xe4c4('0xe'))['db'];config[_0xe4c4('0xf')]=_['defaults'](config['redis'],{'host':_0xe4c4('0x10'),'port':0x18eb});var socket=require(_0xe4c4('0x11'))(new Redis(config[_0xe4c4('0xf')]));require(_0xe4c4('0x12'))[_0xe4c4('0x13')](socket);var jayson=require(_0xe4c4('0x14'));var client=jayson['client'][_0xe4c4('0x15')]({'port':0x232b});var client9004=jayson[_0xe4c4('0x16')][_0xe4c4('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x2483d0,_0x50bfab,_0x262083,_0x115802){return new BPromise(function(_0x515056,_0xe485ca){var _0x1a44e5=_0x115802||client;return _0x1a44e5['request'](_0x2483d0,_0x262083)[_0xe4c4('0x17')](function(_0x29766a){logger['info'](_0xe4c4('0x18'),_0x50bfab,_0xe4c4('0x19'));logger[_0xe4c4('0x1a')](_0xe4c4('0x1b'),_0x50bfab,_0xe4c4('0x19'),JSON[_0xe4c4('0x1c')](_0x29766a));if(_0x29766a[_0xe4c4('0x1d')]){if(_0x29766a[_0xe4c4('0x1d')][_0xe4c4('0x1e')]===0x1f4){logger[_0xe4c4('0x1d')](_0xe4c4('0x18'),_0x50bfab,_0x29766a[_0xe4c4('0x1d')][_0xe4c4('0x1f')]);return _0xe485ca(_0x29766a[_0xe4c4('0x1d')][_0xe4c4('0x1f')]);}logger['error'](_0xe4c4('0x18'),_0x50bfab,_0x29766a[_0xe4c4('0x1d')][_0xe4c4('0x1f')]);return _0x515056(_0x29766a[_0xe4c4('0x1d')]['message']);}else{logger[_0xe4c4('0x20')](_0xe4c4('0x18'),_0x50bfab,_0xe4c4('0x19'));_0x515056(_0x29766a[_0xe4c4('0x21')][_0xe4c4('0x1f')]);}})[_0xe4c4('0x22')](function(_0x1d4597){logger[_0xe4c4('0x1d')](_0xe4c4('0x18'),_0x50bfab,_0x1d4597);_0xe485ca(_0x1d4597);});});}function respondWithStatusCode(_0x1a7690,_0x210ee1){_0x210ee1=_0x210ee1||0xcc;return function(_0x3a6d39){if(_0x3a6d39){return _0x1a7690[_0xe4c4('0x23')](_0x210ee1);}return _0x1a7690[_0xe4c4('0x24')](_0x210ee1)[_0xe4c4('0x25')]();};}function respondWithResult(_0x59498e,_0x49cadc){_0x49cadc=_0x49cadc||0xc8;return function(_0x403a2c){if(_0x403a2c){return _0x59498e['status'](_0x49cadc)[_0xe4c4('0x26')](_0x403a2c);}};}function respondWithFilteredResult(_0x5374fd,_0x3adfcb){return function(_0x5efc4c){if(_0x5efc4c){var _0x34d667=typeof _0x3adfcb['offset']===_0xe4c4('0x27')&&typeof _0x3adfcb['limit']==='undefined';var _0x4cea1f=_0x5efc4c['count'];var _0x3221cd=_0x34d667?0x0:_0x3adfcb['offset'];var _0x5b5ea5=_0x34d667?_0x5efc4c[_0xe4c4('0x28')]:_0x3adfcb[_0xe4c4('0x29')]+_0x3adfcb['limit'];var _0x57ba43;if(_0x5b5ea5>=_0x4cea1f){_0x5b5ea5=_0x4cea1f;_0x57ba43=0xc8;}else{_0x57ba43=0xce;}_0x5374fd[_0xe4c4('0x24')](_0x57ba43);return _0x5374fd[_0xe4c4('0x2a')]('Content-Range',_0x3221cd+'-'+_0x5b5ea5+'/'+_0x4cea1f)[_0xe4c4('0x26')](_0x5efc4c);}return null;};}function saveUpdates(_0x2d0e2){return function(_0x3f60fc){if(_0x3f60fc){return _0x3f60fc['update'](_0x2d0e2)['then'](function(_0x46db7e){return _0x46db7e;});}return null;};}function removeEntity(_0x2c5652){return function(_0x12bde8){if(_0x12bde8){return _0x12bde8[_0xe4c4('0x2b')]()['then'](function(){_0x2c5652['status'](0xcc)[_0xe4c4('0x25')]();});}};}function handleEntityNotFound(_0x2e4282){return function(_0x5d0ba5){if(!_0x5d0ba5){_0x2e4282[_0xe4c4('0x23')](0x194);}return _0x5d0ba5;};}function handleError(_0x1ad3e6,_0x835e8c){_0x835e8c=_0x835e8c||0x1f4;return function(_0x59b5d1){logger[_0xe4c4('0x1d')](_0x59b5d1['stack']);if(_0x59b5d1[_0xe4c4('0x2c')]){delete _0x59b5d1[_0xe4c4('0x2c')];}_0x1ad3e6[_0xe4c4('0x24')](_0x835e8c)[_0xe4c4('0x2d')](_0x59b5d1);};}function getMustacheRender(_0x2bd5c1,_0x43c1ec){return Mustache[_0xe4c4('0x2e')](_0x2bd5c1,_[_0xe4c4('0x2f')](_0x43c1ec[_0xe4c4('0x30')],{'contact':_0x43c1ec[_0xe4c4('0x31')],'message':_0x43c1ec[_0xe4c4('0x1f')],'agent':_0x43c1ec[_0xe4c4('0x32')],'interaction':_0x43c1ec['interaction'],'account':_0x43c1ec[_0xe4c4('0x33')]}))||'';}function getInteractionUsers(_0x25eb81,_0x3d598a){return new BPromise(function(_0x518018,_0xac6cb4){try{if(_0x3d598a[_0x25eb81['id']]){_0x25eb81[_0xe4c4('0x34')]=_[_0xe4c4('0x35')](_0x3d598a[_0x25eb81['id']],function(_0x53eb5b){return{'id':_0x53eb5b['id'],'fullname':_0x53eb5b[_0xe4c4('0x36')]};});}}catch(_0xa2e734){_0xac6cb4(_0xa2e734);}_0x518018(_0x25eb81);});}function getInteractionTags(_0x4a3644,_0x1de955){return new BPromise(function(_0x413ec9,_0x10f243){try{if(_0x4a3644[_0xe4c4('0x37')]){_0x4a3644[_0xe4c4('0x38')]=[];_0x4a3644[_0xe4c4('0x37')][_0xe4c4('0x39')](',')['forEach'](function(_0x153df2){_0x4a3644[_0xe4c4('0x38')][_0xe4c4('0x3a')](_0x1de955[_0x153df2]);});}delete _0x4a3644[_0xe4c4('0x37')];}catch(_0x4c5551){_0x10f243(_0x4c5551);}_0x413ec9(_0x4a3644);});}function updateChatInteraction(_0x2362d6,_0xc50508,_0x4e6bd9){return new BPromise(function(_0xa5534c,_0x185959){return getInteractionUsers(_0x2362d6,_0x4e6bd9)['then'](function(_0x433f0c){return getInteractionTags(_0x433f0c,_0xc50508);})[_0xe4c4('0x17')](function(_0x127bcd){return getStateInteraction(_0x127bcd);})[_0xe4c4('0x17')](function(_0x370117){_0xa5534c(_0x370117);})[_0xe4c4('0x22')](function(_0x96dd48){_0x185959(_0x96dd48);});});}function getStateInteraction(_0x43201e){return new BPromise(function(_0x1e457c){_0x43201e[_0xe4c4('0x3b')]=0x0;_0x43201e[_0xe4c4('0x3c')]=0x0;_0x43201e[_0xe4c4('0x3d')]=0x0;_0x43201e['unmanaged']=0x0;_0x43201e[_0xe4c4('0x3e')]=0x0;_0x43201e[_0xe4c4('0x3f')]=0x0;if(!_0x43201e[_0xe4c4('0x40')]&&!_0x43201e[_0xe4c4('0x41')]){_0x43201e[_0xe4c4('0x3b')]+=0x1;}if(!_0x43201e[_0xe4c4('0x40')]&&_0x43201e['UserId']){_0x43201e[_0xe4c4('0x3c')]+=0x1;if(_0x43201e['waiting']){_0x43201e[_0xe4c4('0x3b')]-=0x1;}}if(_0x43201e[_0xe4c4('0x40')]&&_0x43201e[_0xe4c4('0x42')]===_0xe4c4('0x3e')){_0x43201e[_0xe4c4('0x3e')]+=0x1;if(_0x43201e['waiting']){_0x43201e['waiting']-=0x1;}}else if(_0x43201e[_0xe4c4('0x40')]&&!_0x43201e[_0xe4c4('0x41')]&&_0x43201e[_0xe4c4('0x42')]){_0x43201e['unmanaged']+=0x1;if(_0x43201e[_0xe4c4('0x3b')]){_0x43201e[_0xe4c4('0x3b')]-=0x1;}}else if(_0x43201e[_0xe4c4('0x40')]&&_0x43201e[_0xe4c4('0x41')]){_0x43201e['answered']+=0x1;if(_0x43201e[_0xe4c4('0x3c')]){_0x43201e[_0xe4c4('0x3c')]-=0x1;}}_0x43201e[_0xe4c4('0x3f')]+=0x1;_0x1e457c(_0x43201e);});}exports[_0xe4c4('0x43')]=function(_0x6bf1ee,_0x1e459e){var _0x1eda5e={},_0x176712={},_0x3ee4db={'count':0x0,'rows':[]};var _0x5c7c4d=_[_0xe4c4('0x35')](db['ChatInteraction'][_0xe4c4('0x44')],function(_0x7a40c2){return{'name':_0x7a40c2[_0xe4c4('0x45')],'type':_0x7a40c2[_0xe4c4('0x46')][_0xe4c4('0x47')]};});_0x176712[_0xe4c4('0x48')]=_[_0xe4c4('0x35')](_0x5c7c4d,_0xe4c4('0x2c'));_0x176712[_0xe4c4('0x49')]=_[_0xe4c4('0x4a')](_0x6bf1ee[_0xe4c4('0x49')]);_0x176712[_0xe4c4('0x4b')]=_[_0xe4c4('0x4c')](_0x176712[_0xe4c4('0x48')],_0x176712['query']);_0x1eda5e['attributes']=_[_0xe4c4('0x4c')](_0x176712[_0xe4c4('0x48')],qs['fields'](_0x6bf1ee[_0xe4c4('0x49')][_0xe4c4('0x4d')]));_0x1eda5e[_0xe4c4('0x4e')]=_0x1eda5e[_0xe4c4('0x4e')][_0xe4c4('0x4f')]?_0x1eda5e['attributes']:_0x176712[_0xe4c4('0x48')];if(!_0x6bf1ee[_0xe4c4('0x49')]['hasOwnProperty'](_0xe4c4('0x50'))){_0x1eda5e[_0xe4c4('0x51')]=qs['limit'](_0x6bf1ee[_0xe4c4('0x49')]['limit']);_0x1eda5e[_0xe4c4('0x29')]=qs[_0xe4c4('0x29')](_0x6bf1ee[_0xe4c4('0x49')][_0xe4c4('0x29')]);}_0x1eda5e[_0xe4c4('0x52')]=qs['sort'](_0x6bf1ee[_0xe4c4('0x49')][_0xe4c4('0x53')]);_0x1eda5e[_0xe4c4('0x54')]=qs[_0xe4c4('0x4b')](_[_0xe4c4('0x55')](_0x6bf1ee[_0xe4c4('0x49')],_0x176712[_0xe4c4('0x4b')]),_0x5c7c4d);var _0x3aa205=[];var _0x1a96ba=squel[_0xe4c4('0x56')]()[_0xe4c4('0x57')]('id')[_0xe4c4('0x57')](_0xe4c4('0x2c'))[_0xe4c4('0x57')](_0xe4c4('0x58'))[_0xe4c4('0x59')]('tools_tags');var _0x11a7b9=squel[_0xe4c4('0x56')]()[_0xe4c4('0x57')]('u.id')[_0xe4c4('0x57')](_0xe4c4('0x5a'))[_0xe4c4('0x57')]('ui.ChatInteractionId')[_0xe4c4('0x59')]('user_has_chat_interactions','ui')[_0xe4c4('0x5b')](_0xe4c4('0x5c'),'u',_0xe4c4('0x5d'));var _0x5b7194=squel['select']()[_0xe4c4('0x59')](_0xe4c4('0x5e'),'i')[_0xe4c4('0x5b')]('cm_contacts','c',_0xe4c4('0x5f'))['left_join']('users','o','o.id\x20=\x20i.UserId')['left_join'](_0xe4c4('0x60'),'a',_0xe4c4('0x61'))[_0xe4c4('0x5b')](_0xe4c4('0x62'),'me',_0xe4c4('0x63'))[_0xe4c4('0x5b')]('chat_interaction_has_tags','it',_0xe4c4('0x64'))[_0xe4c4('0x5b')](_0xe4c4('0x65'),'t',_0xe4c4('0x66'));var _0x261341=squel[_0xe4c4('0x67')]();var _0x554ddb=[];var _0x531137=squel[_0xe4c4('0x67')]();var _0x6f374e;if(_0x6bf1ee[_0xe4c4('0x49')][_0xe4c4('0x68')]){_0x6f374e=as[_0xe4c4('0x69')](_0x6bf1ee[_0xe4c4('0x49')][_0xe4c4('0x68')]);var _0x24e1a2=_0x6f374e[_0xe4c4('0x6a')];for(var _0x5a0cbd=0x0;_0x5a0cbd<_0x6f374e['conditions'][_0xe4c4('0x4f')];_0x5a0cbd++){var _0x56f32e=_0x6f374e[_0xe4c4('0x6b')][_0x5a0cbd];var _0x11ce76='i';var _0x2f33ea=_['find'](_0x5c7c4d,[_0xe4c4('0x2c'),_0x56f32e['field']]);if(!_0x2f33ea){switch(_0x56f32e[_0xe4c4('0x57')]){case'unreadMessages':if(_0x56f32e['value']==0x1){_0x5b7194[_0xe4c4('0x6c')]('`'+_0x56f32e[_0xe4c4('0x57')]+_0xe4c4('0x6d'));}else{_0x5b7194['having']('`'+_0x56f32e['field']+'`\x20>\x200');}break;case _0xe4c4('0x6e'):if(_0x56f32e[_0xe4c4('0x6f')]==='$substring'){if(_0x56f32e[_0xe4c4('0x70')][_0xe4c4('0x39')]('\x20')[_0xe4c4('0x4f')]>0x1){_0x261341[_0x24e1a2]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x56f32e[_0xe4c4('0x70')]),null);}else{var _0x2e9185='%'+_0x56f32e[_0xe4c4('0x70')]+'%';_0x261341[_0x24e1a2](_0xe4c4('0x71'),_0x2e9185,_0x2e9185,_0x2e9185);}}else{_0x2f33ea=_[_0xe4c4('0x72')](_0x5c7c4d,[_0xe4c4('0x2c'),'ContactId']);_0x56f32e[_0xe4c4('0x57')]=_0xe4c4('0x73');_0xb40f8a=as[_0xe4c4('0x74')](_0x11ce76,_0x2f33ea['type'],_0x56f32e);_0x261341[_0x24e1a2](_0xb40f8a[_0xe4c4('0x75')],_0xb40f8a[_0xe4c4('0x70')][_0xe4c4('0x76')],_0xb40f8a['value']['end']);}break;case _0xe4c4('0x77'):var _0x5dbd4d=_0x56f32e['value'][_0xe4c4('0x39')](',')[_0xe4c4('0x35')](function(_0x16c4c9){return Number(_0x16c4c9);});_0x5dbd4d[_0xe4c4('0x78')](function(_0x2d338b){_0x531137['or'](_0xe4c4('0x79'),'%,'+_0x2d338b+',%');});_0x554ddb=_[_0xe4c4('0x7a')](_0x554ddb,_0x5dbd4d);break;case _0xe4c4('0x7b'):if(_0x56f32e['operator']===_0xe4c4('0x7c')){_0x261341[_0x24e1a2](_0xe4c4('0x7d'),'%'+_0x56f32e['value']+'%',null);}else{_0x2f33ea=_['find'](_0x5c7c4d,[_0xe4c4('0x2c'),_0xe4c4('0x41')]);_0x56f32e[_0xe4c4('0x57')]=_0xe4c4('0x41');_0xb40f8a=as['buildExpression'](_0x11ce76,_0x2f33ea[_0xe4c4('0x46')],_0x56f32e);_0x261341[_0x24e1a2](_0xb40f8a[_0xe4c4('0x75')],_0xb40f8a[_0xe4c4('0x70')]['start'],_0xb40f8a['value'][_0xe4c4('0x25')]);}break;case _0xe4c4('0x30'):_0xb40f8a=as[_0xe4c4('0x74')]('me',null,_0x56f32e);_0x261341[_0x24e1a2](_0xb40f8a[_0xe4c4('0x75')],_0xb40f8a['value']['start'],_0xb40f8a[_0xe4c4('0x70')][_0xe4c4('0x25')]);break;}}else{var _0xb40f8a=as[_0xe4c4('0x74')](_0x11ce76,_0x2f33ea[_0xe4c4('0x46')],_0x56f32e);_0x261341[_0x24e1a2](_0xb40f8a['text'],_0xb40f8a[_0xe4c4('0x70')]['start'],_0xb40f8a[_0xe4c4('0x70')][_0xe4c4('0x25')]);}}}else{var _0x4a1fc0=_(_0x6bf1ee['query'])[_0xe4c4('0x4a')]()[_0xe4c4('0x35')](function(_0x250bb8){return _[_0xe4c4('0x7e')](_0x5c7c4d,[_0xe4c4('0x2c'),_0x250bb8])?_0x250bb8:undefined;})['compact']()['value']();if(!_['isEmpty'](_0x4a1fc0)){_0x4a1fc0[_0xe4c4('0x78')](function(_0x3285f4){if(_0x3285f4==='ChatWebsiteId'){_0x5b7194[_0xe4c4('0x54')](_0xe4c4('0x7f'),[][_0xe4c4('0x80')](_0x6bf1ee[_0xe4c4('0x49')][_0x3285f4]));}else if(_0x3285f4==='createdAt'){var _0x5ca600=JSON[_0xe4c4('0x81')](_0x6bf1ee[_0xe4c4('0x49')][_0x3285f4])[_0xe4c4('0x82')];var _0x25f215=JSON[_0xe4c4('0x81')](_0x6bf1ee[_0xe4c4('0x49')][_0x3285f4])[_0xe4c4('0x83')];_0x5b7194['where'](_0xe4c4('0x84'),_0x5ca600,_0x25f215);}else{if(_0x6bf1ee[_0xe4c4('0x49')][_0x3285f4]===_0xe4c4('0x85')){_0x5b7194[_0xe4c4('0x54')]('i.'+_0x3285f4+'\x20IS\x20NULL');}else{_0x5b7194[_0xe4c4('0x54')]('i.'+_0x3285f4+_0xe4c4('0x86'),_0x6bf1ee[_0xe4c4('0x49')][_0x3285f4]);}}});}if(_0x6bf1ee[_0xe4c4('0x49')]['read']){if(_0x6bf1ee[_0xe4c4('0x49')][_0xe4c4('0x87')]==0x1){_0x5b7194['having']('`unreadMessages`\x20=\x200');}else{_0x5b7194[_0xe4c4('0x6c')](_0xe4c4('0x88'));}}if(_0x6bf1ee[_0xe4c4('0x49')][_0xe4c4('0x89')]){_0x554ddb=_[_0xe4c4('0x8a')](_0x6bf1ee[_0xe4c4('0x49')][_0xe4c4('0x89')])?_0x6bf1ee[_0xe4c4('0x49')]['tag']:new Array(_0x6bf1ee['query'][_0xe4c4('0x89')]);_0x554ddb[_0xe4c4('0x78')](function(_0x2a76ce){_0x531137['or'](_0xe4c4('0x79'),'%,'+_0x2a76ce+',%');});}if(_0x6bf1ee[_0xe4c4('0x49')]['filter']){var _0x41aa14=_0x6bf1ee[_0xe4c4('0x49')][_0xe4c4('0x8b')][_0xe4c4('0x8c')]('\x5c','\x5c\x5c')[_0xe4c4('0x8c')](/'/g,'\x27\x27');if(qs[_0xe4c4('0x8d')](_0x41aa14)){_0x261341['or'](_0xe4c4('0x8e'),_0x41aa14+'%');}else{_0x261341['or'](_0xe4c4('0x8f'),qs[_0xe4c4('0x90')](_0x41aa14))['or'](_0xe4c4('0x91'),_0x41aa14+'%');}}}_0x5b7194[_0xe4c4('0x54')](_0x261341);_0x5b7194[_0xe4c4('0x92')](_0xe4c4('0x93'));var _0x289d20={'type':db[_0xe4c4('0x94')][_0xe4c4('0x95')]['SELECT'],'raw':!![]};var _0x4f2d02=_0x5b7194[_0xe4c4('0x96')]();_0x4f2d02['field'](_0xe4c4('0x93'));_0x4f2d02[_0xe4c4('0x57')](_0xe4c4('0x97'),_0xe4c4('0x98'));if(_0x1eda5e[_0xe4c4('0x52')]){_0x1eda5e[_0xe4c4('0x52')][_0xe4c4('0x78')](function(_0x2b9bf5){var _0x371947=_0x2b9bf5[0x0]===_0xe4c4('0x99')?_0x2b9bf5[0x0]:'i.'+_0x2b9bf5[0x0];_0x5b7194[_0xe4c4('0x52')](_0x371947,_0x2b9bf5[0x1]===_0xe4c4('0x9a')?![]:!![]);});}if(!_[_0xe4c4('0x9b')](_0x554ddb)){_0x5b7194['having'](_0x531137);_0x4f2d02[_0xe4c4('0x54')](_0xe4c4('0x9c'),_0x554ddb);}BPromise[_0xe4c4('0x9d')]()[_0xe4c4('0x17')](function(){if(!_0x6f374e){if(_0x6bf1ee[_0xe4c4('0x49')]['ChatWebsiteId'])return;_0x4f2d02[_0xe4c4('0x54')](_0xe4c4('0x9e'));_0x5b7194['where'](_0xe4c4('0x9e'));return;}if(_0x6bf1ee[_0xe4c4('0x9f')]['role']!=='agent')return;return _0x6bf1ee['user'][_0xe4c4('0xa0')]({'attributes':['id'],'raw':!![]})['then'](function(_0x441ca8){if(_[_0xe4c4('0x9b')](_0x441ca8)){_0x4f2d02[_0xe4c4('0x54')]('i.ChatWebsiteId\x20IS\x20NULL');_0x5b7194[_0xe4c4('0x54')](_0xe4c4('0xa1'));}else{_0x4f2d02[_0xe4c4('0x54')]('i.ChatWebsiteId\x20IN\x20?',_['map'](_0x441ca8,'id'));_0x5b7194['where'](_0xe4c4('0x7f'),_[_0xe4c4('0x35')](_0x441ca8,'id'));}});})[_0xe4c4('0x17')](function(){if(_0x6bf1ee['user'][_0xe4c4('0xa2')]===_0xe4c4('0x32')&&!_0x6f374e&&!_0x6bf1ee[_0xe4c4('0x49')][_0xe4c4('0xa3')])return[];return db[_0xe4c4('0xa4')]['query'](_0x4f2d02[_0xe4c4('0xa5')](),_0x289d20);})[_0xe4c4('0x17')](function(_0x24c9b0){_0x3ee4db['count']=_0x24c9b0[_0xe4c4('0x4f')];if(_0x3ee4db[_0xe4c4('0x28')]===0x0)return[];return db[_0xe4c4('0xa4')]['query'](_0x1a96ba[_0xe4c4('0xa5')](),_0x289d20)[_0xe4c4('0x17')](function(_0x47d67d){_0x3aa205=_[_0xe4c4('0xa6')](_0x47d67d,'id');_0x289d20=_[_0xe4c4('0x2f')](_0x289d20,{'model':db[_0xe4c4('0xa7')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x6bf1ee[_0xe4c4('0x49')][_0xe4c4('0x4d')]){_0x1eda5e[_0xe4c4('0x4e')][_0xe4c4('0x78')](function(_0x4df5c1){_0x5b7194['field']('i.'+_0x4df5c1);});}else{_0x5b7194[_0xe4c4('0x57')](_0xe4c4('0x97'),_0xe4c4('0x98'));_0x5b7194[_0xe4c4('0x57')](_0xe4c4('0xa8'),'Account.key');_0x5b7194[_0xe4c4('0x57')]('a.mandatoryDisposition',_0xe4c4('0xa9'));_0x5b7194[_0xe4c4('0x57')](_0xe4c4('0xaa'),'contactName');_0x5b7194['field']('i.*');_0x5b7194[_0xe4c4('0x57')](_0xe4c4('0xab'),_0xe4c4('0xac'));_0x5b7194[_0xe4c4('0x57')]('c.lastName',_0xe4c4('0xad'));_0x5b7194[_0xe4c4('0x57')](_0xe4c4('0xae'),_0xe4c4('0xaf'));_0x5b7194['field'](_0xe4c4('0xb0'),_0xe4c4('0xb1'));_0x5b7194['field']('c.mobile','Contact.mobile');_0x5b7194[_0xe4c4('0x57')](_0xe4c4('0xb2'),_0xe4c4('0xb3'));_0x5b7194[_0xe4c4('0x57')](_0xe4c4('0xb4'),_0xe4c4('0xb5'));_0x5b7194[_0xe4c4('0x57')](_0xe4c4('0xb6'),_0xe4c4('0xb7'));_0x5b7194[_0xe4c4('0x57')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x1eda5e[_0xe4c4('0x51')])_0x5b7194[_0xe4c4('0x51')](_0x1eda5e[_0xe4c4('0x51')]);if(_0x1eda5e['offset'])_0x5b7194[_0xe4c4('0x29')](_0x1eda5e[_0xe4c4('0x29')]);return db['sequelize'][_0xe4c4('0x49')](_0x5b7194['toString'](),_0x289d20);})[_0xe4c4('0x17')](function(_0x534dee){if(_0x534dee[_0xe4c4('0x4f')]>0x0)_0x11a7b9[_0xe4c4('0x54')](_0xe4c4('0xb8'),_[_0xe4c4('0x35')](_0x534dee,'id'));return db[_0xe4c4('0xa4')]['query'](_0x11a7b9['toString'](),_0x289d20)[_0xe4c4('0x17')](function(_0x5e827b){var _0x1d068a=_[_0xe4c4('0xb9')](_0x5e827b,_0xe4c4('0xba'));var _0x5138ff=[];_0x534dee[_0xe4c4('0x78')](function(_0x4b4377){_0x5138ff[_0xe4c4('0x3a')](updateChatInteraction(_0x4b4377,_0x3aa205,_0x1d068a));});return BPromise['all'](_0x5138ff);});});})['then'](function(_0x2fb74b){_0x3ee4db[_0xe4c4('0xbb')]=_0x2fb74b;return _0x3ee4db;})[_0xe4c4('0x17')](respondWithFilteredResult(_0x1e459e,_0x1eda5e))['catch'](handleError(_0x1e459e,null));};exports[_0xe4c4('0xbc')]=function(_0x42efa3,_0x123aab){var _0xd290c9={'raw':![],'where':{'id':_0x42efa3[_0xe4c4('0xbd')]['id']}},_0x5153ca={};_0x5153ca[_0xe4c4('0x48')]=_[_0xe4c4('0x4a')](db[_0xe4c4('0xa7')]['rawAttributes']);_0x5153ca['query']=_[_0xe4c4('0x4a')](_0x42efa3['query']);_0x5153ca[_0xe4c4('0x4b')]=_[_0xe4c4('0x4c')](_0x5153ca[_0xe4c4('0x48')],_0x5153ca[_0xe4c4('0x49')]);_0xd290c9['attributes']=_[_0xe4c4('0x4c')](_0x5153ca[_0xe4c4('0x48')],qs[_0xe4c4('0x4d')](_0x42efa3[_0xe4c4('0x49')]['fields']));_0xd290c9[_0xe4c4('0x4e')]=_0xd290c9['attributes']['length']?_0xd290c9['attributes']:_0x5153ca['model'];if(_0x42efa3[_0xe4c4('0x49')][_0xe4c4('0xbe')]){_0xd290c9['include']=[{'all':!![]}];}_0xd290c9=_[_0xe4c4('0x2f')]({},_0xd290c9,_0x42efa3[_0xe4c4('0xbf')]);return db[_0xe4c4('0xa7')][_0xe4c4('0x72')](_0xd290c9)['then'](handleEntityNotFound(_0x123aab,null))['then'](respondWithResult(_0x123aab,null))[_0xe4c4('0x22')](handleError(_0x123aab,null));};exports[_0xe4c4('0xc0')]=function(_0xc8168b,_0x2609d7){return db['ChatInteraction'][_0xe4c4('0xc0')](_0xc8168b[_0xe4c4('0x30')],{})[_0xe4c4('0x17')](respondWithResult(_0x2609d7,0xc9))['catch'](handleError(_0x2609d7,null));};exports[_0xe4c4('0xc1')]=function(_0x16968c,_0x435e7e){if(_0x16968c[_0xe4c4('0x30')]['id']){delete _0x16968c[_0xe4c4('0x30')]['id'];}return db[_0xe4c4('0xa7')][_0xe4c4('0x72')]({'where':{'id':_0x16968c[_0xe4c4('0xbd')]['id']}})['then'](handleEntityNotFound(_0x435e7e,null))[_0xe4c4('0x17')](saveUpdates(_0x16968c[_0xe4c4('0x30')],null))[_0xe4c4('0x17')](respondWithResult(_0x435e7e,null))['catch'](handleError(_0x435e7e,null));};exports[_0xe4c4('0x2b')]=function(_0x2006e1,_0x56ddaf){return db[_0xe4c4('0xa7')]['find']({'where':{'id':_0x2006e1['params']['id']}})[_0xe4c4('0x17')](handleEntityNotFound(_0x56ddaf,null))[_0xe4c4('0x17')](removeEntity(_0x56ddaf,null))[_0xe4c4('0x22')](handleError(_0x56ddaf,null));};exports['describe']=function(_0x2c4934,_0x4c2c11){return db[_0xe4c4('0xa7')][_0xe4c4('0xc2')]()[_0xe4c4('0x17')](respondWithResult(_0x4c2c11,null))[_0xe4c4('0x22')](handleError(_0x4c2c11,null));};exports[_0xe4c4('0xc3')]=function(_0x9935cb,_0x5a31ca){var _0x34baa7=_0x9935cb[_0xe4c4('0xbd')]['id'];var _0x36c1ce;var _0x27040f;var _0x1946e2;return db[_0xe4c4('0xa7')]['findOne']({'where':{'id':_0x34baa7}})[_0xe4c4('0x17')](function(_0x3f6e40){_0x36c1ce=_0x3f6e40;return db['ChatWebsite'][_0xe4c4('0xc4')]({'where':{'id':_0x3f6e40[_0xe4c4('0xa3')]},'attributes':['id','vidaooApiKey',_0xe4c4('0xc5'),_0xe4c4('0xc6'),'vidaooNote',_0xe4c4('0xc7')],'raw':!![]});})[_0xe4c4('0x17')](function(_0x30aeb4){if(_0x30aeb4&&_0x30aeb4[_0xe4c4('0xc8')]&&_0x30aeb4['vidaooEscalation']){_0x27040f=_0x30aeb4;var _0x270ad7={'interaction':{'id':_0x34baa7},'agent':{'id':_0x9935cb[_0xe4c4('0x9f')]['id'],'name':_0x9935cb[_0xe4c4('0x9f')][_0xe4c4('0x2c')],'fullname':_0x9935cb[_0xe4c4('0x9f')][_0xe4c4('0x36')],'email':_0x9935cb[_0xe4c4('0x9f')][_0xe4c4('0xc9')]},'contact':_0x9935cb[_0xe4c4('0x30')]['contact'],'account':_0x9935cb['body']['account']};var _0x145388={'rejectUnauthorized':![],'method':_0xe4c4('0xca'),'url':_0xe4c4('0xcb'),'headers':{'X-APIKEY':_0x30aeb4['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x9935cb[_0xe4c4('0x9f')][_0xe4c4('0xc9')]],'buttons':null,'topic':_0x27040f[_0xe4c4('0xc6')],'note':_[_0xe4c4('0xcc')](_0x27040f[_0xe4c4('0xcd')])?null:getMustacheRender(_0x27040f[_0xe4c4('0xcd')],_0x270ad7),'metadata':null},'redirect':_0xe4c4('0xce'),'json':!![]};try{if(!_[_0xe4c4('0xcc')](_0x27040f[_0xe4c4('0xc7')])){var _0x4f93dd=getMustacheRender(_0x27040f[_0xe4c4('0xc7')],_0x270ad7);var _0x3f01fb=JSON[_0xe4c4('0x81')](_0x4f93dd);_0x145388[_0xe4c4('0x30')][_0xe4c4('0xcf')]=_0x3f01fb;}}catch(_0x249246){throw new db[(_0xe4c4('0x94'))][(_0xe4c4('0xd0'))](_0xe4c4('0xd1'));}return rp(_0x145388);}else{throw new db[(_0xe4c4('0x94'))][(_0xe4c4('0xd0'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xe4c4('0x17')](function(_0x37ece1){_0x1946e2=_0x37ece1;if(_0x1946e2['id']){var _0x57f26b={'body':_0x1946e2[_0xe4c4('0xd2')],'ChatWebsiteId':_0x27040f['id'],'ChatInteractionId':_0x36c1ce['id'],'direction':_0xe4c4('0xd3'),'UserId':_0x9935cb[_0xe4c4('0x9f')]['id']};return db[_0xe4c4('0xd4')][_0xe4c4('0xc0')](_0x57f26b,{});}else{throw new db['Sequelize']['ValidationError'](_0xe4c4('0xd5'));}})[_0xe4c4('0x17')](function(){return _0x36c1ce[_0xe4c4('0xd6')]({'vidaooSessionId':_0x1946e2['id']});})[_0xe4c4('0x17')](respondWithResult(_0x5a31ca,null))[_0xe4c4('0x22')](handleError(_0x5a31ca,null));};exports['customUpdate']=function(_0x52b36e,_0x297c8e){if(_0x52b36e[_0xe4c4('0x30')]['id']){delete _0x52b36e[_0xe4c4('0x30')]['id'];}return db[_0xe4c4('0xa7')][_0xe4c4('0x72')]({'where':{'id':_0x52b36e[_0xe4c4('0xbd')]['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})['then'](handleEntityNotFound(_0x297c8e,null))[_0xe4c4('0x17')](saveUpdates(_0x52b36e['body'],null))[_0xe4c4('0x17')](respondWithResult(_0x297c8e,null))[_0xe4c4('0x22')](handleError(_0x297c8e,null));};exports[_0xe4c4('0xd7')]=function(_0x28c69e,_0x410f83){if(_0x28c69e[_0xe4c4('0x30')]['id']){delete _0x28c69e['body']['id'];}return db['ChatInteraction'][_0xe4c4('0x72')]({'where':{'id':_0x28c69e[_0xe4c4('0xbd')]['id']}})[_0xe4c4('0x17')](function(_0x5a9c3a){if(!_0x5a9c3a){logger[_0xe4c4('0x1d')](_0xe4c4('0xd8'),_0xe4c4('0xd7'),0x194,_0xe4c4('0xd9'));_0x410f83['sendStatus'](0x194);}else{if(_0x5a9c3a[_0xe4c4('0x41')]){throw new db[(_0xe4c4('0x94'))][(_0xe4c4('0xd0'))]('Interaction\x20already\x20assigned');}}return _0x5a9c3a;})[_0xe4c4('0x17')](function(_0x4e3287){if(_0x4e3287){return _0x4e3287[_0xe4c4('0xc1')]({'closed':_0x28c69e[_0xe4c4('0x30')][_0xe4c4('0x40')],'disposition':_0x28c69e[_0xe4c4('0x30')][_0xe4c4('0x42')]})[_0xe4c4('0x17')](function(_0x5f2b1c){return _0x5f2b1c;});}})[_0xe4c4('0x17')](function(){return respondWithRpcPromise(_0xe4c4('0xda'),_0xe4c4('0xd7'),_0x28c69e[_0xe4c4('0x30')],client9004);})[_0xe4c4('0x17')](respondWithResult(_0x410f83,null))[_0xe4c4('0x22')](handleError(_0x410f83,null));};exports['attachmentUpload']=function(_0x5cbd93,_0x2c8ba4){_0x5cbd93['body']['name']=_0x5cbd93[_0xe4c4('0xdb')][_0xe4c4('0xdc')];_0x5cbd93['body'][_0xe4c4('0xdd')]=_0x5cbd93[_0xe4c4('0xdb')][_0xe4c4('0xde')];_0x5cbd93[_0xe4c4('0x30')]['type']=_0x5cbd93[_0xe4c4('0xdb')]['mimetype'];return db[_0xe4c4('0xdf')]['create'](_0x5cbd93['body'])[_0xe4c4('0x17')](respondWithResult(_0x2c8ba4,0xc9))['catch'](handleError(_0x2c8ba4,null));};exports[_0xe4c4('0xe0')]=function(_0x2d57a2,_0x451f30){return db[_0xe4c4('0xa7')][_0xe4c4('0xc4')]({'where':{'id':_0x2d57a2[_0xe4c4('0xbd')]['id']},'raw':!![]})[_0xe4c4('0x17')](handleEntityNotFound(_0x451f30,null))[_0xe4c4('0x17')](function(_0x5a1e7e){if(_0x5a1e7e){if(_0x5a1e7e['closed']){return _0x451f30[_0xe4c4('0x24')](0x193)['json']({'status':0x193,'message':_0xe4c4('0xe1')});}return db[_0xe4c4('0xdf')][_0xe4c4('0xc4')]({'where':{'id':_0x2d57a2[_0xe4c4('0x49')][_0xe4c4('0xe2')]},'raw':!![]})[_0xe4c4('0x17')](handleEntityNotFound(_0x451f30,null));}})[_0xe4c4('0x17')](function(_0x51fc92){if(_0x51fc92){var _0x5e62a6=_0x51fc92[_0xe4c4('0xe3')]!==null;var _0x5f5cd0=path['join'](config['root'],'server/files/attachments/');if(_0x5e62a6){_0x5f5cd0=path['join'](_0x5f5cd0,_0xe4c4('0xe4'));}var _0x1433d7=path[_0xe4c4('0xe5')](_0x5f5cd0,_0x51fc92[_0xe4c4('0xdd')]);return _0x451f30[_0xe4c4('0xe6')](_0x1433d7);}})[_0xe4c4('0x22')](handleError(_0x451f30,null));};exports[_0xe4c4('0xe7')]=function(_0x624345,_0x56e875){var _0x4a1eee=null;var _0x44ef17=null;var _0x17c4f5=null;if(_0x624345[_0xe4c4('0x30')]['id']){delete _0x624345[_0xe4c4('0x30')]['id'];}if(_0x624345[_0xe4c4('0x30')][_0xe4c4('0xe8')]){_0x17c4f5=path[_0xe4c4('0xe5')](config[_0xe4c4('0xe9')],_0xe4c4('0xea'),util[_0xe4c4('0xeb')](_0xe4c4('0xec'),Date[_0xe4c4('0xed')]()));_0x624345['body']['pathTranscript']=_0x17c4f5;}return db['ChatInteraction'][_0xe4c4('0x72')]({'where':{'id':_0x624345[_0xe4c4('0xbd')]['id']},'include':[{'model':db[_0xe4c4('0xd4')],'as':'Messages','include':[{'model':db['User'],'as':_0xe4c4('0x7b')}]}]})[_0xe4c4('0x17')](handleEntityNotFound(_0x56e875,null))['then'](saveUpdates(_0x624345['body'],null))[_0xe4c4('0x17')](function(_0xb30f1e){if(_0xb30f1e){_0x4a1eee=_0xb30f1e;return db[_0xe4c4('0xee')][_0xe4c4('0x72')]({'where':{'id':_0x4a1eee[_0xe4c4('0xa3')]}});}})['then'](function(_0x1e7caa){if(_0x1e7caa){_0x44ef17=_0x1e7caa;return db[_0xe4c4('0xef')][_0xe4c4('0x72')]({'where':{'id':_0x4a1eee[_0xe4c4('0x73')]}});}})[_0xe4c4('0x17')](function(_0x478e19){if(_0x478e19){if(_0x17c4f5){var _0xcba7e3=null;for(var _0x3b8471=0x1;_0x3b8471<_0x4a1eee[_0xe4c4('0xf0')][_0xe4c4('0x4f')];++_0x3b8471){_0xcba7e3=_0x4a1eee[_0xe4c4('0xf0')][_0x3b8471];var _0x14e75f=_0xcba7e3[_0xe4c4('0x41')]?util[_0xe4c4('0xeb')]('%s%d',_0x44ef17[_0xe4c4('0xf1')],_0xcba7e3[_0xe4c4('0x41')]):_0xe4c4('0xf2');var _0x11159f=_0x624345[_0xe4c4('0x30')][_0xe4c4('0xf3')]||util[_0xe4c4('0xeb')](_0xe4c4('0xf4'),_0xe4c4('0xf5'),_0xcba7e3[_0xe4c4('0x73')]);switch(_0x44ef17['agentIdentifier']){case _0xe4c4('0xf6'):_0x14e75f=_0xcba7e3[_0xe4c4('0x41')]?util['format']('%s%d',_0x44ef17[_0xe4c4('0xf1')],_0xcba7e3[_0xe4c4('0x41')]):'System';break;case'agent_alias':_0x14e75f=_0xcba7e3[_0xe4c4('0x41')]?_0xcba7e3[_0xe4c4('0x7b')]['alias']||_0xcba7e3[_0xe4c4('0x7b')][_0xe4c4('0x36')]:_0xe4c4('0xf2');break;case _0xe4c4('0xf7'):_0x14e75f=_0xcba7e3[_0xe4c4('0x41')]?_0xcba7e3[_0xe4c4('0x7b')][_0xe4c4('0x36')]:_0xe4c4('0xf2');break;default:_0x14e75f=_0xcba7e3[_0xe4c4('0x41')]?util['format'](_0xe4c4('0xf4'),_0x44ef17[_0xe4c4('0xf1')],_0xcba7e3['UserId']):_0xe4c4('0xf2');}var _0x14624c=util[_0xe4c4('0xeb')](_0xe4c4('0xf8'),moment(_0xcba7e3[_0xe4c4('0xf9')])[_0xe4c4('0xeb')](_0xe4c4('0xfa')),_0xcba7e3[_0xe4c4('0xfb')]==='in'?_0x11159f:_0x14e75f,_0xcba7e3['body']);if(!_0xcba7e3['secret']){fs[_0xe4c4('0xfc')](_0x17c4f5,_0x14624c);}}return db[_0xe4c4('0xfd')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xe4c4('0xfe'),'raw':!![],'include':[{'model':db[_0xe4c4('0xff')],'as':_0xe4c4('0xff'),'raw':!![]}]}]});}}})[_0xe4c4('0x17')](function(_0x319cb2){if(!_0x319cb2||!_0x319cb2['Smtp']||!_0x624345[_0xe4c4('0x30')])return _0x4a1eee;var _0x422099=_0x319cb2['getSmtpOptions']();return respondWithRpcPromise(_0xe4c4('0x100'),_0xe4c4('0x101'),{'account':_0x422099,'message':{'from':util['format'](_0xe4c4('0x102'),_0x319cb2[_0xe4c4('0x2c')],_0x319cb2[_0xe4c4('0xc9')]||_0x319cb2['Smtp'][_0xe4c4('0x9f')]),'to':_0x624345['body'][_0xe4c4('0xe8')],'subject':_0xe4c4('0x103'),'text':util[_0xe4c4('0xeb')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x624345[_0xe4c4('0x30')][_0xe4c4('0xe8')]),'attachments':[{'path':_0x17c4f5}]}})[_0xe4c4('0x17')](function(){return _0x4a1eee;})[_0xe4c4('0x22')](function(_0x18b728){logger[_0xe4c4('0x1d')](_0x18b728);});})[_0xe4c4('0x17')](respondWithStatusCode(_0x56e875,0xc8))[_0xe4c4('0x22')](handleError(_0x56e875,null));};exports[_0xe4c4('0x104')]=function(_0x315bbb,_0x4f5a0f){return db[_0xe4c4('0xd4')][_0xe4c4('0x72')]({'where':{'id':_0x315bbb[_0xe4c4('0xbd')]['id']}})[_0xe4c4('0x17')](handleEntityNotFound(_0x4f5a0f,null))[_0xe4c4('0x17')](function(_0xe1c20d){if(_0xe1c20d){return _0xe1c20d[_0xe4c4('0x104')](_0x315bbb[_0xe4c4('0x30')][_0xe4c4('0x105')],_['omit'](_0x315bbb[_0xe4c4('0x30')],[_0xe4c4('0x105'),'id'])||{});}})[_0xe4c4('0x17')](respondWithResult(_0x4f5a0f,null))[_0xe4c4('0x22')](handleError(_0x4f5a0f,null));};exports[_0xe4c4('0x106')]=function(_0x17b5bc,_0x35506a){var _0x1f6e04={'raw':![],'where':{}};var _0x4f7790={};var _0x4444e0={'count':0x0,'rows':[]};return db[_0xe4c4('0xa7')][_0xe4c4('0xc4')]({'where':{'id':_0x17b5bc['params']['id']}})['then'](handleEntityNotFound(_0x35506a,null))['then'](function(_0x3e1c4a){if(_0x3e1c4a){_0x4f7790[_0xe4c4('0x48')]=_['keys'](db['ChatMessage']['rawAttributes']);_0x4f7790[_0xe4c4('0x49')]=_['keys'](_0x17b5bc[_0xe4c4('0x49')]);_0x4f7790[_0xe4c4('0x4b')]=_[_0xe4c4('0x4c')](_0x4f7790[_0xe4c4('0x48')],_0x4f7790[_0xe4c4('0x49')]);_0x1f6e04[_0xe4c4('0x4e')]=_[_0xe4c4('0x4c')](_0x4f7790[_0xe4c4('0x48')],qs[_0xe4c4('0x4d')](_0x17b5bc[_0xe4c4('0x49')][_0xe4c4('0x4d')]));_0x1f6e04[_0xe4c4('0x4e')]=_0x1f6e04[_0xe4c4('0x4e')][_0xe4c4('0x4f')]?_0x1f6e04[_0xe4c4('0x4e')]:_0x4f7790[_0xe4c4('0x48')];if(!_0x17b5bc['query'][_0xe4c4('0x107')](_0xe4c4('0x50'))){_0x1f6e04['limit']=qs[_0xe4c4('0x51')](_0x17b5bc[_0xe4c4('0x49')][_0xe4c4('0x51')]);_0x1f6e04[_0xe4c4('0x29')]=qs[_0xe4c4('0x29')](_0x17b5bc[_0xe4c4('0x49')][_0xe4c4('0x29')]);}_0x1f6e04[_0xe4c4('0x52')]=qs['sort'](_0x17b5bc['query'][_0xe4c4('0x53')]);_0x1f6e04['where']=qs['filters'](_[_0xe4c4('0x55')](_0x17b5bc[_0xe4c4('0x49')],_0x4f7790[_0xe4c4('0x4b')]));_0x1f6e04[_0xe4c4('0x54')][_0xe4c4('0xba')]=_0x3e1c4a['id'];if(_0x17b5bc['query']['filter']){_0x1f6e04[_0xe4c4('0x54')]=_[_0xe4c4('0x2f')](_0x1f6e04[_0xe4c4('0x54')],{'$or':_[_0xe4c4('0x35')](_0x1f6e04[_0xe4c4('0x4e')],function(_0x211371){var _0x570dd2={};_0x570dd2[_0x211371]={'$like':'%'+_0x17b5bc[_0xe4c4('0x49')][_0xe4c4('0x8b')]+'%'};return _0x570dd2;})});}if(_0x17b5bc[_0xe4c4('0x49')][_0xe4c4('0x82')]){var _0x46522f=_0x17b5bc[_0xe4c4('0x49')][_0xe4c4('0x82')][_0xe4c4('0x39')](',');var _0xe25125={};_0xe25125[_0x46522f[0x0]]={'$gte':moment(_0x46522f[0x1])[_0xe4c4('0xeb')](_0xe4c4('0x108'))};_0x1f6e04[_0xe4c4('0x54')]=_[_0xe4c4('0x2f')](_0x1f6e04[_0xe4c4('0x54')],_0xe25125);}_0x1f6e04=_[_0xe4c4('0x2f')]({},_0x1f6e04,_0x17b5bc[_0xe4c4('0xbf')]);return db[_0xe4c4('0xd4')][_0xe4c4('0x28')]({'where':_0x1f6e04[_0xe4c4('0x54')]})[_0xe4c4('0x17')](function(_0x18973e){_0x4444e0[_0xe4c4('0x28')]=_0x18973e;if(_0x17b5bc[_0xe4c4('0x49')][_0xe4c4('0xbe')]){_0x1f6e04[_0xe4c4('0x109')]=[{'all':!![]}];}return db['ChatMessage'][_0xe4c4('0x10a')](_0x1f6e04);})[_0xe4c4('0x17')](function(_0x438b19){_0x4444e0['rows']=_0x438b19;return _0x4444e0;});}})['then'](respondWithFilteredResult(_0x35506a,_0x1f6e04))['catch'](handleError(_0x35506a,null));};exports[_0xe4c4('0x10b')]=function(_0x1dc920,_0x1f8272){var _0x11bc93={'where':{}},_0x3fe1a4={},_0x589ad2={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xe4c4('0xc4')]({'where':{'id':_0x1dc920[_0xe4c4('0xbd')]['id']}})[_0xe4c4('0x17')](handleEntityNotFound(_0x1f8272,null))['then'](function(_0x22f09e){if(_0x22f09e){_0x3fe1a4[_0xe4c4('0x48')]=_[_0xe4c4('0x4a')](db['ChatMessage'][_0xe4c4('0x44')]);_0x3fe1a4['query']=_['keys'](_0x1dc920[_0xe4c4('0x49')]);_0x3fe1a4['filters']=_[_0xe4c4('0x4c')](_0x3fe1a4[_0xe4c4('0x48')],_0x3fe1a4[_0xe4c4('0x49')]);_0x11bc93['attributes']=_[_0xe4c4('0x4c')](_0x3fe1a4[_0xe4c4('0x48')],qs[_0xe4c4('0x4d')](_0x1dc920[_0xe4c4('0x49')][_0xe4c4('0x4d')]));_0x11bc93[_0xe4c4('0x4e')]=_0x11bc93[_0xe4c4('0x4e')][_0xe4c4('0x4f')]?_0x11bc93[_0xe4c4('0x4e')]:_0x3fe1a4[_0xe4c4('0x48')];if(!_0x1dc920[_0xe4c4('0x49')][_0xe4c4('0x107')]('nolimit')){_0x11bc93[_0xe4c4('0x51')]=qs[_0xe4c4('0x51')](_0x1dc920[_0xe4c4('0x49')][_0xe4c4('0x51')]);_0x11bc93[_0xe4c4('0x29')]=qs['offset'](_0x1dc920[_0xe4c4('0x49')][_0xe4c4('0x29')]);}_0x11bc93[_0xe4c4('0x52')]=qs['sort'](_0x1dc920[_0xe4c4('0x49')][_0xe4c4('0x53')]);_0x11bc93[_0xe4c4('0x54')]=qs[_0xe4c4('0x4b')](_[_0xe4c4('0x55')](_0x1dc920[_0xe4c4('0x49')],_0x3fe1a4[_0xe4c4('0x4b')]));_0x11bc93[_0xe4c4('0x54')][_0xe4c4('0xba')]=_0x22f09e['id'];if(_0x1dc920['query'][_0xe4c4('0x8b')]){_0x11bc93[_0xe4c4('0x54')]=_[_0xe4c4('0x2f')](_0x11bc93[_0xe4c4('0x54')],{'$or':_[_0xe4c4('0x35')](_0x11bc93[_0xe4c4('0x4e')],function(_0x4ca179){var _0x405cc4={};_0x405cc4[_0x4ca179]={'$like':'%'+_0x1dc920[_0xe4c4('0x49')][_0xe4c4('0x8b')]+'%'};return _0x405cc4;})});}_0x11bc93['where'][_0xe4c4('0x10c')]=![];if(_0x1dc920[_0xe4c4('0x49')]['id']){_0x11bc93[_0xe4c4('0x54')]['id']={'$gt':_0x1dc920['query']['id']};}_0x11bc93=_['merge']({},_0x11bc93,_0x1dc920[_0xe4c4('0xbf')]);return db[_0xe4c4('0xd4')][_0xe4c4('0x28')]({'where':_0x11bc93['where']})[_0xe4c4('0x17')](function(_0xf526b8){_0x589ad2[_0xe4c4('0x28')]=_0xf526b8;_0x11bc93['include']=[];if(_0x1dc920[_0xe4c4('0x49')][_0xe4c4('0x10d')]){_0x11bc93[_0xe4c4('0x109')][_0xe4c4('0x3a')]({'model':db[_0xe4c4('0x7b')],'as':_0xe4c4('0x7b'),'attributes':['id','fullname',_0xe4c4('0x10e')]});}if(_0x1dc920[_0xe4c4('0x49')][_0xe4c4('0xbe')]){_0x11bc93[_0xe4c4('0x109')]=[{'all':!![]}];}return db[_0xe4c4('0xd4')][_0xe4c4('0x10a')](_0x11bc93);})[_0xe4c4('0x17')](function(_0x16f993){_0x589ad2[_0xe4c4('0xbb')]=_0x16f993;return _0x589ad2;});}})[_0xe4c4('0x17')](respondWithFilteredResult(_0x1f8272,_0x11bc93))['catch'](handleError(_0x1f8272,null));};exports[_0xe4c4('0x10f')]=function(_0x571165,_0x1ac10e){return db['ChatInteraction'][_0xe4c4('0x72')]({'where':{'id':_0x571165['params']['id']}})['then'](handleEntityNotFound(_0x1ac10e,null))[_0xe4c4('0x17')](function(_0x16390e){if(_0x16390e){return _0x16390e[_0xe4c4('0x110')](_0x571165[_0xe4c4('0x30')][_0xe4c4('0x105')],_[_0xe4c4('0x111')](_0x571165[_0xe4c4('0x30')],[_0xe4c4('0x105'),'id'])||{})[_0xe4c4('0x112')](function(){return db[_0xe4c4('0x77')][_0xe4c4('0x10a')]({'attributes':['id',_0xe4c4('0x2c'),_0xe4c4('0x58')],'where':{'id':_0x571165['body'][_0xe4c4('0x105')]}});})[_0xe4c4('0x17')](function(_0x7b85b3){socket['emit'](_0xe4c4('0x113'),{'id':Number(_0x571165[_0xe4c4('0xbd')]['id']),'tags':_0x7b85b3||[]});return{'id':Number(_0x571165['params']['id']),'tags':_0x7b85b3||[]};});}})[_0xe4c4('0x17')](respondWithResult(_0x1ac10e,null))['catch'](handleError(_0x1ac10e,null));};exports[_0xe4c4('0x114')]=function(_0x3b4c6e,_0x51182a){return db[_0xe4c4('0xa7')][_0xe4c4('0x72')]({'where':{'id':_0x3b4c6e[_0xe4c4('0xbd')]['id']}})[_0xe4c4('0x17')](handleEntityNotFound(_0x51182a,null))[_0xe4c4('0x17')](function(_0x257ffc){if(_0x257ffc){return _0x257ffc[_0xe4c4('0x114')](_0x3b4c6e[_0xe4c4('0x49')][_0xe4c4('0x105')]);}})[_0xe4c4('0x17')](respondWithStatusCode(_0x51182a,null))[_0xe4c4('0x22')](handleError(_0x51182a,null));};exports[_0xe4c4('0xe6')]=function(_0x307198,_0x36169f){var _0x31ab16=moment()[_0xe4c4('0x115')]()['toString']();var _0x555318=path[_0xe4c4('0xe5')](config[_0xe4c4('0xe9')],'server',_0xe4c4('0x116'),'tmp');var _0x134d86=path['join'](config[_0xe4c4('0xe9')],_0xe4c4('0x117'),_0xe4c4('0x116'),_0xe4c4('0x118'));var _0x1fac1e=path[_0xe4c4('0xe5')](_0x555318,_0x31ab16);var _0x1caed0=util[_0xe4c4('0xeb')](_0xe4c4('0x119'),_0x307198[_0xe4c4('0xbd')]['id'],_0x31ab16);var _0x55cfe3=path[_0xe4c4('0xe5')](_0x555318,_0x1caed0);var _0x550c69=[];_0x550c69[_0xe4c4('0x3a')]({'model':db[_0xe4c4('0x7b')],'as':_0xe4c4('0x7b'),'attributes':['id',_0xe4c4('0x36')],'raw':!![]});_0x550c69[_0xe4c4('0x3a')]({'model':db[_0xe4c4('0xef')],'as':_0xe4c4('0x6e'),'attributes':['id',_0xe4c4('0x11a'),_0xe4c4('0x11b')],'raw':!![]});if(_0x307198[_0xe4c4('0x49')]['attachments']){_0x550c69['push']({'model':db['Attachment'],'as':_0xe4c4('0xdf'),'raw':!![]});}var _0x2391a1=[{'model':db['ChatMessage'],'as':'Messages','attributes':['id','body',_0xe4c4('0xf9'),_0xe4c4('0xfb'),_0xe4c4('0x10c'),_0xe4c4('0x87')],'include':_0x550c69}];_0x2391a1[_0xe4c4('0x3a')]({'model':db[_0xe4c4('0xee')],'as':'Account','attributes':['id',_0xe4c4('0x2c')]});_0x2391a1['push']({'model':db[_0xe4c4('0x7b')],'as':_0xe4c4('0x11c'),'attributes':['id','fullname']});return db[_0xe4c4('0xa7')][_0xe4c4('0x72')]({'where':{'id':_0x307198[_0xe4c4('0xbd')]['id']},'include':_0x2391a1})[_0xe4c4('0x17')](handleEntityNotFound(_0x36169f,null))[_0xe4c4('0x17')](function(_0x9581d){if(_0x9581d){var _0x22fc3f=_0x9581d[_0xe4c4('0x11d')]({'plain':!![]});fs[_0xe4c4('0x11e')](_0x1fac1e);var _0x200fa={'channel':'Chat','account':_0x22fc3f['Account'][_0xe4c4('0x2c')],'agent':_0x22fc3f['Owner']?_0x22fc3f['Owner'][_0xe4c4('0x36')]:_0xe4c4('0x11f'),'createdAt':moment(_0x22fc3f[_0xe4c4('0xf9')])[_0xe4c4('0xeb')](_0xe4c4('0x108'))[_0xe4c4('0xa5')](),'closedAt':_0x22fc3f[_0xe4c4('0x40')]?moment(_0x22fc3f['closedAt'])[_0xe4c4('0xeb')](_0xe4c4('0x108'))['toString']():'','disposition':_0x22fc3f[_0xe4c4('0x42')],'chatInfo':{'browser':_0x22fc3f[_0xe4c4('0x120')],'os':_0x22fc3f[_0xe4c4('0x121')],'referer':_0x22fc3f['referer'],'customerIp':_0x22fc3f[_0xe4c4('0x122')],'customerPort':_0x22fc3f[_0xe4c4('0x123')]?_0x22fc3f[_0xe4c4('0x123')]:_0xe4c4('0x11f')},'messages':_(_0x22fc3f[_0xe4c4('0xf0')])['tail']()['filter']({'secret':![]})[_0xe4c4('0x35')](function(_0x51b9a1){if(_0x51b9a1[_0xe4c4('0xdf')]){var _0x3b9327=path[_0xe4c4('0xe5')](_0x134d86,_0x51b9a1['Attachment']['basename']);if(fs[_0xe4c4('0x124')](_0x3b9327)){fs[_0xe4c4('0x125')](_0x3b9327)['pipe'](fs[_0xe4c4('0x126')](path[_0xe4c4('0xe5')](_0x1fac1e,_0x51b9a1[_0xe4c4('0xdf')][_0xe4c4('0xdd')])));}}return{'date':moment(_0x51b9a1[_0xe4c4('0xf9')])[_0xe4c4('0xeb')](_0xe4c4('0x108'))[_0xe4c4('0xa5')](),'sender':_0x51b9a1[_0xe4c4('0xfb')]===_0xe4c4('0xd3')?_0x51b9a1[_0xe4c4('0x7b')]?_0x51b9a1['User'][_0xe4c4('0x36')]:_0xe4c4('0xf2'):_0x51b9a1['Contact']['firstName']+(_0x51b9a1[_0xe4c4('0x6e')]['lastName']?'\x20'+_0x51b9a1[_0xe4c4('0x6e')][_0xe4c4('0x11b')]:''),'body':_0x51b9a1['Attachment']?_0x51b9a1[_0xe4c4('0xdf')][_0xe4c4('0xdd')]:_0x51b9a1[_0xe4c4('0x30')],'direction':_0x51b9a1[_0xe4c4('0xfb')]==='out'?'A':'C','secret':_0x51b9a1[_0xe4c4('0x10c')],'read':_0x51b9a1[_0xe4c4('0x87')],'attachment':_0x51b9a1[_0xe4c4('0xdf')]};})[_0xe4c4('0x70')]()};return ejs[_0xe4c4('0x127')](path[_0xe4c4('0xe5')](config['root'],'server','views',_0xe4c4('0x128')),{'interaction':_0x200fa})[_0xe4c4('0x17')](function(_0x6959bb){var _0x5592fe=path['join'](_0x1fac1e,'transcript-'+_0x22fc3f['id']+'-'+_0x31ab16+_0xe4c4('0x129'));var _0x1d2edf={'path':_0x5592fe,'channel':_0xe4c4('0x12a'),'interactionId':_0x22fc3f['id']};return pdf[_0xe4c4('0x12b')](_0x6959bb,_0x1d2edf);})[_0xe4c4('0x17')](function(){return new Promise(function(_0x4e2c79,_0x21db63){zipdir(_0x1fac1e,{'saveTo':_0x55cfe3},function(_0x17de87,_0x3d8d5b){if(_0x17de87)return _0x21db63(_0x17de87);return _0x4e2c79(_0x3d8d5b);});})[_0xe4c4('0x17')](function(){return new BPromise(function(_0x1a5597,_0x334d01){rimraf(_0x1fac1e,function(_0x28fbe4){if(_0x28fbe4)_0x334d01(_0x28fbe4);return _0x1a5597();});});})[_0xe4c4('0x17')](function(){return _0x36169f[_0xe4c4('0xe6')](_0x55cfe3,_0x1caed0,function(_0x247206){if(_0x247206){logger[_0xe4c4('0x1d')]('err',_0x247206);}else{fs[_0xe4c4('0x12c')](_0x55cfe3);}});});});}else{return _0x36169f[_0xe4c4('0x23')](0xc8);}})[_0xe4c4('0x22')](handleError(_0x36169f,null));}; \ No newline at end of file +var _0x0a9a=['Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','customUpdate','CmContact','abandon','Interaction\x20already\x20assigned','attachmentUpload','file','originalname','filename','attachmentDownload','findOne','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','mailTranscript','server/files/chat/upload/','now','pathTranscript','Messages','%s%d','agentAlias','System','customer','format','agentIdentifier','website_alias','agent_alias','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','CloudProvider','Smtp','getSmtpOptions','SendMail','sendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','ids','getMessages','YYYY-MM-DD\x20HH:mm:ss','options','findAll','rows','getMyMessages','includeAgent','addTags','emit','chatInteractionTags:save','removeTags','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','Account','Owner','get','mkdirSync','N.A.','closedAt','browserName','osName','referer','tail','basename','pipe','out','lastName','downloadInteraction.ejs','transcript-','.pdf','Chat','createPdfFromHTML','unlinkSync','zip-dir','moment','bluebird','mustache','util','ejs','lodash','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','api','../../mysqldb','redis','defaults','socket.io-emitter','jayson/promise','client','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','destroy','end','stack','name','send','render','merge','agent','interaction','account','map','fullname','TagIds','Tags','split','forEach','push','catch','waiting','talking','answered','abandoned','total','closed','UserId','disposition','unmanaged','index','ChatInteraction','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','field','color','from','tools_tags','select','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','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','expr','search','parseSearch','conditions','find','unreadMessages','having','`\x20=\x200','Contact','operator','$substring','value','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','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?','body','some','compact','where','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','t.id\x20IN\x20?','ChatWebsiteId','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','isEmpty','i.ChatWebsiteId\x20IS\x20NULL','role','toString','sequelize','keyBy','a.key','Account.key','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.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','show','includeAll','include','create','update','params','describe','createVidaooSession','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','metadata'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0a9a,0x183));var _0xa0a9=function(_0x3274aa,_0x3e7769){_0x3274aa=_0x3274aa-0x0;var _0x4f6415=_0x0a9a[_0x3274aa];return _0x4f6415;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xa0a9('0x0'));var rp=require('request-promise');var moment=require(_0xa0a9('0x1'));var BPromise=require(_0xa0a9('0x2'));var Mustache=require(_0xa0a9('0x3'));var util=require(_0xa0a9('0x4'));var path=require('path');var ejs=require(_0xa0a9('0x5'));var fs=require('fs');var _=require(_0xa0a9('0x6'));var squel=require('squel');var Redis=require(_0xa0a9('0x7'));var qs=require(_0xa0a9('0x8'));var as=require(_0xa0a9('0x9'));var pdf=require(_0xa0a9('0xa'));var logger=require('../../config/logger')(_0xa0a9('0xb'));var config=require('../../config/environment');var db=require(_0xa0a9('0xc'))['db'];config[_0xa0a9('0xd')]=_[_0xa0a9('0xe')](config[_0xa0a9('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xa0a9('0xf'))(new Redis(config[_0xa0a9('0xd')]));require('./chatInteraction.socket')['register'](socket);var jayson=require(_0xa0a9('0x10'));var client=jayson[_0xa0a9('0x11')]['http']({'port':0x232b});var client9004=jayson[_0xa0a9('0x11')]['http']({'port':0x232c});function respondWithRpcPromise(_0x1c39ff,_0x4b7913,_0xb87a94,_0x1ae2a7){return new BPromise(function(_0xa10656,_0x35e7cd){var _0x13833c=_0x1ae2a7||client;return _0x13833c['request'](_0x1c39ff,_0xb87a94)[_0xa0a9('0x12')](function(_0x9ef979){logger[_0xa0a9('0x13')](_0xa0a9('0x14'),_0x4b7913,_0xa0a9('0x15'));logger[_0xa0a9('0x16')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x4b7913,_0xa0a9('0x15'),JSON['stringify'](_0x9ef979));if(_0x9ef979['error']){if(_0x9ef979[_0xa0a9('0x17')][_0xa0a9('0x18')]===0x1f4){logger[_0xa0a9('0x17')](_0xa0a9('0x14'),_0x4b7913,_0x9ef979['error'][_0xa0a9('0x19')]);return _0x35e7cd(_0x9ef979[_0xa0a9('0x17')][_0xa0a9('0x19')]);}logger[_0xa0a9('0x17')](_0xa0a9('0x14'),_0x4b7913,_0x9ef979[_0xa0a9('0x17')]['message']);return _0xa10656(_0x9ef979[_0xa0a9('0x17')][_0xa0a9('0x19')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x4b7913,_0xa0a9('0x15'));_0xa10656(_0x9ef979[_0xa0a9('0x1a')][_0xa0a9('0x19')]);}})['catch'](function(_0x307d7e){logger['error'](_0xa0a9('0x14'),_0x4b7913,_0x307d7e);_0x35e7cd(_0x307d7e);});});}function respondWithStatusCode(_0x5e6148,_0x4d9dde){_0x4d9dde=_0x4d9dde||0xcc;return function(_0x504786){if(_0x504786){return _0x5e6148[_0xa0a9('0x1b')](_0x4d9dde);}return _0x5e6148[_0xa0a9('0x1c')](_0x4d9dde)['end']();};}function respondWithResult(_0x423d3a,_0x4fb909){_0x4fb909=_0x4fb909||0xc8;return function(_0x20b318){if(_0x20b318){return _0x423d3a[_0xa0a9('0x1c')](_0x4fb909)[_0xa0a9('0x1d')](_0x20b318);}};}function respondWithFilteredResult(_0x252a14,_0x503ef2){return function(_0x7c1502){if(_0x7c1502){var _0xe49d3b=typeof _0x503ef2[_0xa0a9('0x1e')]===_0xa0a9('0x1f')&&typeof _0x503ef2['limit']===_0xa0a9('0x1f');var _0x38e454=_0x7c1502[_0xa0a9('0x20')];var _0x5c446e=_0xe49d3b?0x0:_0x503ef2['offset'];var _0x2b3cbb=_0xe49d3b?_0x7c1502[_0xa0a9('0x20')]:_0x503ef2[_0xa0a9('0x1e')]+_0x503ef2[_0xa0a9('0x21')];var _0x4685c5;if(_0x2b3cbb>=_0x38e454){_0x2b3cbb=_0x38e454;_0x4685c5=0xc8;}else{_0x4685c5=0xce;}_0x252a14[_0xa0a9('0x1c')](_0x4685c5);return _0x252a14[_0xa0a9('0x22')](_0xa0a9('0x23'),_0x5c446e+'-'+_0x2b3cbb+'/'+_0x38e454)[_0xa0a9('0x1d')](_0x7c1502);}return null;};}function saveUpdates(_0x42024c){return function(_0x41e994){if(_0x41e994){return _0x41e994['update'](_0x42024c)[_0xa0a9('0x12')](function(_0x1957bf){return _0x1957bf;});}return null;};}function removeEntity(_0x4fc94a){return function(_0x2f21ea){if(_0x2f21ea){return _0x2f21ea[_0xa0a9('0x24')]()['then'](function(){_0x4fc94a['status'](0xcc)[_0xa0a9('0x25')]();});}};}function handleEntityNotFound(_0x5291e3){return function(_0x5a1095){if(!_0x5a1095){_0x5291e3[_0xa0a9('0x1b')](0x194);}return _0x5a1095;};}function handleError(_0x104936,_0x347cbf){_0x347cbf=_0x347cbf||0x1f4;return function(_0x1e83ac){logger[_0xa0a9('0x17')](_0x1e83ac[_0xa0a9('0x26')]);if(_0x1e83ac[_0xa0a9('0x27')]){delete _0x1e83ac['name'];}_0x104936[_0xa0a9('0x1c')](_0x347cbf)[_0xa0a9('0x28')](_0x1e83ac);};}function getMustacheRender(_0x539807,_0x46ef2b){return Mustache[_0xa0a9('0x29')](_0x539807,_[_0xa0a9('0x2a')](_0x46ef2b['body'],{'contact':_0x46ef2b['contact'],'message':_0x46ef2b[_0xa0a9('0x19')],'agent':_0x46ef2b[_0xa0a9('0x2b')],'interaction':_0x46ef2b[_0xa0a9('0x2c')],'account':_0x46ef2b[_0xa0a9('0x2d')]}))||'';}function getInteractionUsers(_0x520817,_0x70a275){return new BPromise(function(_0x19a122,_0x459485){try{if(_0x70a275[_0x520817['id']]){_0x520817['Users']=_[_0xa0a9('0x2e')](_0x70a275[_0x520817['id']],function(_0x3c74ea){return{'id':_0x3c74ea['id'],'fullname':_0x3c74ea[_0xa0a9('0x2f')]};});}}catch(_0x53dfd1){_0x459485(_0x53dfd1);}_0x19a122(_0x520817);});}function getInteractionTags(_0x3ae735,_0x2ed673){return new BPromise(function(_0x41c056,_0x3206a2){try{if(_0x3ae735[_0xa0a9('0x30')]){_0x3ae735[_0xa0a9('0x31')]=[];_0x3ae735[_0xa0a9('0x30')][_0xa0a9('0x32')](',')[_0xa0a9('0x33')](function(_0x2ea301){_0x3ae735[_0xa0a9('0x31')][_0xa0a9('0x34')](_0x2ed673[_0x2ea301]);});}delete _0x3ae735[_0xa0a9('0x30')];}catch(_0x1574cd){_0x3206a2(_0x1574cd);}_0x41c056(_0x3ae735);});}function updateChatInteraction(_0xaa6ef9,_0x1b1aff,_0x868447){return new BPromise(function(_0x54fe3f,_0x3f1e4f){return getInteractionUsers(_0xaa6ef9,_0x868447)[_0xa0a9('0x12')](function(_0x3d3769){return getInteractionTags(_0x3d3769,_0x1b1aff);})['then'](function(_0x757e10){return getStateInteraction(_0x757e10);})[_0xa0a9('0x12')](function(_0x91e37e){_0x54fe3f(_0x91e37e);})[_0xa0a9('0x35')](function(_0x48993c){_0x3f1e4f(_0x48993c);});});}function getStateInteraction(_0x26ffb8){return new BPromise(function(_0x44791e){_0x26ffb8[_0xa0a9('0x36')]=0x0;_0x26ffb8[_0xa0a9('0x37')]=0x0;_0x26ffb8[_0xa0a9('0x38')]=0x0;_0x26ffb8['unmanaged']=0x0;_0x26ffb8[_0xa0a9('0x39')]=0x0;_0x26ffb8[_0xa0a9('0x3a')]=0x0;if(!_0x26ffb8[_0xa0a9('0x3b')]&&!_0x26ffb8[_0xa0a9('0x3c')]){_0x26ffb8[_0xa0a9('0x36')]+=0x1;}if(!_0x26ffb8['closed']&&_0x26ffb8[_0xa0a9('0x3c')]){_0x26ffb8[_0xa0a9('0x37')]+=0x1;if(_0x26ffb8[_0xa0a9('0x36')]){_0x26ffb8[_0xa0a9('0x36')]-=0x1;}}if(_0x26ffb8[_0xa0a9('0x3b')]&&_0x26ffb8['disposition']===_0xa0a9('0x39')){_0x26ffb8[_0xa0a9('0x39')]+=0x1;if(_0x26ffb8['waiting']){_0x26ffb8['waiting']-=0x1;}}else if(_0x26ffb8[_0xa0a9('0x3b')]&&!_0x26ffb8[_0xa0a9('0x3c')]&&_0x26ffb8[_0xa0a9('0x3d')]){_0x26ffb8[_0xa0a9('0x3e')]+=0x1;if(_0x26ffb8['waiting']){_0x26ffb8[_0xa0a9('0x36')]-=0x1;}}else if(_0x26ffb8[_0xa0a9('0x3b')]&&_0x26ffb8[_0xa0a9('0x3c')]){_0x26ffb8[_0xa0a9('0x38')]+=0x1;if(_0x26ffb8[_0xa0a9('0x37')]){_0x26ffb8[_0xa0a9('0x37')]-=0x1;}}_0x26ffb8[_0xa0a9('0x3a')]+=0x1;_0x44791e(_0x26ffb8);});}exports[_0xa0a9('0x3f')]=function(_0xbdce0e,_0x1a7879){var _0xe82093={},_0x1b2172={},_0x2fcc76={'count':0x0,'rows':[]};var _0x3bb0fb=_[_0xa0a9('0x2e')](db[_0xa0a9('0x40')][_0xa0a9('0x41')],function(_0x54e917){return{'name':_0x54e917[_0xa0a9('0x42')],'type':_0x54e917['type'][_0xa0a9('0x43')]};});_0x1b2172[_0xa0a9('0x44')]=_[_0xa0a9('0x2e')](_0x3bb0fb,_0xa0a9('0x27'));_0x1b2172[_0xa0a9('0x45')]=_[_0xa0a9('0x46')](_0xbdce0e[_0xa0a9('0x45')]);_0x1b2172[_0xa0a9('0x47')]=_[_0xa0a9('0x48')](_0x1b2172['model'],_0x1b2172[_0xa0a9('0x45')]);_0xe82093[_0xa0a9('0x49')]=_[_0xa0a9('0x48')](_0x1b2172['model'],qs[_0xa0a9('0x4a')](_0xbdce0e[_0xa0a9('0x45')][_0xa0a9('0x4a')]));_0xe82093['attributes']=_0xe82093[_0xa0a9('0x49')][_0xa0a9('0x4b')]?_0xe82093[_0xa0a9('0x49')]:_0x1b2172[_0xa0a9('0x44')];if(!_0xbdce0e['query'][_0xa0a9('0x4c')](_0xa0a9('0x4d'))){_0xe82093[_0xa0a9('0x21')]=qs[_0xa0a9('0x21')](_0xbdce0e[_0xa0a9('0x45')][_0xa0a9('0x21')]);_0xe82093[_0xa0a9('0x1e')]=qs['offset'](_0xbdce0e[_0xa0a9('0x45')][_0xa0a9('0x1e')]);}_0xe82093['order']=qs[_0xa0a9('0x4e')](_0xbdce0e[_0xa0a9('0x45')][_0xa0a9('0x4e')]);_0xe82093['where']=qs['filters'](_[_0xa0a9('0x4f')](_0xbdce0e[_0xa0a9('0x45')],_0x1b2172[_0xa0a9('0x47')]),_0x3bb0fb);var _0x1397dd=[];var _0x51387d=squel['select']()[_0xa0a9('0x50')]('id')[_0xa0a9('0x50')]('name')['field'](_0xa0a9('0x51'))[_0xa0a9('0x52')](_0xa0a9('0x53'));var _0x31bc1b=squel[_0xa0a9('0x54')]()[_0xa0a9('0x50')](_0xa0a9('0x55'))[_0xa0a9('0x50')](_0xa0a9('0x56'))[_0xa0a9('0x50')](_0xa0a9('0x57'))['from'](_0xa0a9('0x58'),'ui')[_0xa0a9('0x59')](_0xa0a9('0x5a'),'u','u.id\x20=\x20ui.UserId');var _0x426ddc=squel[_0xa0a9('0x54')]()[_0xa0a9('0x52')]('chat_interactions','i')[_0xa0a9('0x59')](_0xa0a9('0x5b'),'c',_0xa0a9('0x5c'))[_0xa0a9('0x59')](_0xa0a9('0x5a'),'o',_0xa0a9('0x5d'))[_0xa0a9('0x59')]('chat_websites','a',_0xa0a9('0x5e'))[_0xa0a9('0x59')](_0xa0a9('0x5f'),'me',_0xa0a9('0x60'))[_0xa0a9('0x59')](_0xa0a9('0x61'),'it',_0xa0a9('0x62'))['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');var _0x40d0f5=squel['expr']();var _0x331a0a=[];var _0x5c8ce1=squel[_0xa0a9('0x63')]();var _0x3f9648;if(_0xbdce0e[_0xa0a9('0x45')][_0xa0a9('0x64')]){_0x3f9648=as[_0xa0a9('0x65')](_0xbdce0e[_0xa0a9('0x45')][_0xa0a9('0x64')]);var _0x40c53d=_0x3f9648['sqlOperator'];for(var _0x5968ce=0x0;_0x5968ce<_0x3f9648[_0xa0a9('0x66')]['length'];_0x5968ce++){var _0x35c897=_0x3f9648[_0xa0a9('0x66')][_0x5968ce];var _0x3c526a='i';var _0x483dd3=_[_0xa0a9('0x67')](_0x3bb0fb,['name',_0x35c897[_0xa0a9('0x50')]]);if(!_0x483dd3){switch(_0x35c897[_0xa0a9('0x50')]){case _0xa0a9('0x68'):if(_0x35c897['value']==0x1){_0x426ddc[_0xa0a9('0x69')]('`'+_0x35c897['field']+_0xa0a9('0x6a'));}else{_0x426ddc['having']('`'+_0x35c897[_0xa0a9('0x50')]+'`\x20>\x200');}break;case _0xa0a9('0x6b'):if(_0x35c897[_0xa0a9('0x6c')]===_0xa0a9('0x6d')){if(_0x35c897[_0xa0a9('0x6e')][_0xa0a9('0x32')]('\x20')[_0xa0a9('0x4b')]>0x1){_0x40d0f5[_0x40c53d]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xa0a9('0x6f')](_0x35c897[_0xa0a9('0x6e')]),null);}else{var _0x2e6d3f='%'+_0x35c897['value']+'%';_0x40d0f5[_0x40c53d](_0xa0a9('0x70'),_0x2e6d3f,_0x2e6d3f,_0x2e6d3f);}}else{_0x483dd3=_[_0xa0a9('0x67')](_0x3bb0fb,[_0xa0a9('0x27'),_0xa0a9('0x71')]);_0x35c897[_0xa0a9('0x50')]='ContactId';_0x2faa44=as[_0xa0a9('0x72')](_0x3c526a,_0x483dd3[_0xa0a9('0x73')],_0x35c897);_0x40d0f5[_0x40c53d](_0x2faa44[_0xa0a9('0x74')],_0x2faa44[_0xa0a9('0x6e')][_0xa0a9('0x75')],_0x2faa44[_0xa0a9('0x6e')][_0xa0a9('0x25')]);}break;case _0xa0a9('0x76'):var _0x3a6b21=_0x35c897[_0xa0a9('0x6e')]['split'](',')[_0xa0a9('0x2e')](function(_0x1bae56){return Number(_0x1bae56);});_0x3a6b21[_0xa0a9('0x33')](function(_0x2d9b5c){_0x5c8ce1['or'](_0xa0a9('0x77'),'%,'+_0x2d9b5c+',%');});_0x331a0a=_[_0xa0a9('0x78')](_0x331a0a,_0x3a6b21);break;case _0xa0a9('0x79'):if(_0x35c897[_0xa0a9('0x6c')]===_0xa0a9('0x6d')){_0x40d0f5[_0x40c53d](_0xa0a9('0x7a'),'%'+_0x35c897[_0xa0a9('0x6e')]+'%',null);}else{_0x483dd3=_[_0xa0a9('0x67')](_0x3bb0fb,[_0xa0a9('0x27'),_0xa0a9('0x3c')]);_0x35c897[_0xa0a9('0x50')]=_0xa0a9('0x3c');_0x2faa44=as['buildExpression'](_0x3c526a,_0x483dd3[_0xa0a9('0x73')],_0x35c897);_0x40d0f5[_0x40c53d](_0x2faa44['text'],_0x2faa44[_0xa0a9('0x6e')]['start'],_0x2faa44[_0xa0a9('0x6e')][_0xa0a9('0x25')]);}break;case _0xa0a9('0x7b'):_0x2faa44=as[_0xa0a9('0x72')]('me',null,_0x35c897);_0x40d0f5[_0x40c53d](_0x2faa44[_0xa0a9('0x74')],_0x2faa44[_0xa0a9('0x6e')][_0xa0a9('0x75')],_0x2faa44['value'][_0xa0a9('0x25')]);break;}}else{var _0x2faa44=as[_0xa0a9('0x72')](_0x3c526a,_0x483dd3[_0xa0a9('0x73')],_0x35c897);_0x40d0f5[_0x40c53d](_0x2faa44[_0xa0a9('0x74')],_0x2faa44[_0xa0a9('0x6e')][_0xa0a9('0x75')],_0x2faa44[_0xa0a9('0x6e')][_0xa0a9('0x25')]);}}}else{var _0x4da18d=_(_0xbdce0e[_0xa0a9('0x45')])[_0xa0a9('0x46')]()[_0xa0a9('0x2e')](function(_0x2a0a40){return _[_0xa0a9('0x7c')](_0x3bb0fb,[_0xa0a9('0x27'),_0x2a0a40])?_0x2a0a40:undefined;})[_0xa0a9('0x7d')]()[_0xa0a9('0x6e')]();if(!_['isEmpty'](_0x4da18d)){_0x4da18d[_0xa0a9('0x33')](function(_0x35c824){if(_0x35c824==='ChatWebsiteId'){_0x426ddc[_0xa0a9('0x7e')](_0xa0a9('0x7f'),[][_0xa0a9('0x80')](_0xbdce0e[_0xa0a9('0x45')][_0x35c824]));}else if(_0x35c824===_0xa0a9('0x81')){var _0x3fa9ec=JSON[_0xa0a9('0x82')](_0xbdce0e[_0xa0a9('0x45')][_0x35c824])[_0xa0a9('0x83')];var _0x106440=JSON[_0xa0a9('0x82')](_0xbdce0e[_0xa0a9('0x45')][_0x35c824])[_0xa0a9('0x84')];_0x426ddc['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3fa9ec,_0x106440);}else{if(_0xbdce0e[_0xa0a9('0x45')][_0x35c824]==='null'){_0x426ddc['where']('i.'+_0x35c824+_0xa0a9('0x85'));}else{_0x426ddc[_0xa0a9('0x7e')]('i.'+_0x35c824+'\x20=\x20?',_0xbdce0e[_0xa0a9('0x45')][_0x35c824]);}}});}if(_0xbdce0e[_0xa0a9('0x45')][_0xa0a9('0x86')]){if(_0xbdce0e[_0xa0a9('0x45')][_0xa0a9('0x86')]==0x1){_0x426ddc[_0xa0a9('0x69')](_0xa0a9('0x87'));}else{_0x426ddc['having'](_0xa0a9('0x88'));}}if(_0xbdce0e['query']['tag']){_0x331a0a=_['isArray'](_0xbdce0e[_0xa0a9('0x45')][_0xa0a9('0x89')])?_0xbdce0e['query'][_0xa0a9('0x89')]:new Array(_0xbdce0e[_0xa0a9('0x45')][_0xa0a9('0x89')]);_0x331a0a[_0xa0a9('0x33')](function(_0x301de2){_0x5c8ce1['or'](_0xa0a9('0x77'),'%,'+_0x301de2+',%');});}if(_0xbdce0e[_0xa0a9('0x45')]['filter']){var _0x1fff5c=_0xbdce0e['query'][_0xa0a9('0x8a')][_0xa0a9('0x8b')]('\x5c','\x5c\x5c')[_0xa0a9('0x8b')](/'/g,'\x27\x27');if(qs[_0xa0a9('0x8c')](_0x1fff5c)){_0x40d0f5['or']('i.id\x20LIKE\x20?',_0x1fff5c+'%');}else{_0x40d0f5['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xa0a9('0x6f')](_0x1fff5c))['or'](_0xa0a9('0x8d'),_0x1fff5c+'%');}}}_0x426ddc[_0xa0a9('0x7e')](_0x40d0f5);_0x426ddc[_0xa0a9('0x8e')](_0xa0a9('0x8f'));var _0xcc00a8={'type':db['Sequelize']['QueryTypes'][_0xa0a9('0x90')],'raw':!![]};var _0x161d87=_0x426ddc[_0xa0a9('0x91')]();_0x161d87[_0xa0a9('0x50')](_0xa0a9('0x8f'));_0x161d87[_0xa0a9('0x50')](_0xa0a9('0x92'),'unreadMessages');if(_0xe82093[_0xa0a9('0x93')]){_0xe82093[_0xa0a9('0x93')]['forEach'](function(_0x25049d){var _0xe83741=_0x25049d[0x0]==='contactName'?_0x25049d[0x0]:'i.'+_0x25049d[0x0];_0x426ddc[_0xa0a9('0x93')](_0xe83741,_0x25049d[0x1]===_0xa0a9('0x94')?![]:!![]);});}if(!_['isEmpty'](_0x331a0a)){_0x426ddc['having'](_0x5c8ce1);_0x161d87['where'](_0xa0a9('0x95'),_0x331a0a);}BPromise['resolve']()[_0xa0a9('0x12')](function(){if(!_0x3f9648){if(_0xbdce0e[_0xa0a9('0x45')][_0xa0a9('0x96')])return;_0x161d87['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x426ddc['where'](_0xa0a9('0x97'));return;}if(_0xbdce0e[_0xa0a9('0x98')]['role']!=='agent')return;return _0xbdce0e['user'][_0xa0a9('0x99')]({'attributes':['id'],'raw':!![]})[_0xa0a9('0x12')](function(_0x295145){if(_[_0xa0a9('0x9a')](_0x295145)){_0x161d87['where'](_0xa0a9('0x9b'));_0x426ddc[_0xa0a9('0x7e')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x161d87[_0xa0a9('0x7e')](_0xa0a9('0x7f'),_[_0xa0a9('0x2e')](_0x295145,'id'));_0x426ddc['where'](_0xa0a9('0x7f'),_[_0xa0a9('0x2e')](_0x295145,'id'));}});})[_0xa0a9('0x12')](function(){if(_0xbdce0e['user'][_0xa0a9('0x9c')]===_0xa0a9('0x2b')&&!_0x3f9648&&!_0xbdce0e['query'][_0xa0a9('0x96')])return[];return db['sequelize']['query'](_0x161d87[_0xa0a9('0x9d')](),_0xcc00a8);})['then'](function(_0x49610e){_0x2fcc76[_0xa0a9('0x20')]=_0x49610e[_0xa0a9('0x4b')];if(_0x2fcc76['count']===0x0)return[];return db[_0xa0a9('0x9e')]['query'](_0x51387d[_0xa0a9('0x9d')](),_0xcc00a8)[_0xa0a9('0x12')](function(_0x5dc92b){_0x1397dd=_[_0xa0a9('0x9f')](_0x5dc92b,'id');_0xcc00a8=_[_0xa0a9('0x2a')](_0xcc00a8,{'model':db[_0xa0a9('0x40')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xbdce0e[_0xa0a9('0x45')][_0xa0a9('0x4a')]){_0xe82093['attributes'][_0xa0a9('0x33')](function(_0x235f87){_0x426ddc[_0xa0a9('0x50')]('i.'+_0x235f87);});}else{_0x426ddc[_0xa0a9('0x50')](_0xa0a9('0x92'),'unreadMessages');_0x426ddc[_0xa0a9('0x50')](_0xa0a9('0xa0'),_0xa0a9('0xa1'));_0x426ddc[_0xa0a9('0x50')]('a.mandatoryDisposition',_0xa0a9('0xa2'));_0x426ddc[_0xa0a9('0x50')](_0xa0a9('0xa3'),_0xa0a9('0xa4'));_0x426ddc[_0xa0a9('0x50')](_0xa0a9('0xa5'));_0x426ddc[_0xa0a9('0x50')]('c.firstName','Contact.firstName');_0x426ddc[_0xa0a9('0x50')](_0xa0a9('0xa6'),_0xa0a9('0xa7'));_0x426ddc[_0xa0a9('0x50')](_0xa0a9('0xa8'),'Contact.email');_0x426ddc['field'](_0xa0a9('0xa9'),_0xa0a9('0xaa'));_0x426ddc[_0xa0a9('0x50')](_0xa0a9('0xab'),_0xa0a9('0xac'));_0x426ddc[_0xa0a9('0x50')](_0xa0a9('0xad'),_0xa0a9('0xae'));_0x426ddc[_0xa0a9('0x50')](_0xa0a9('0xaf'),_0xa0a9('0xb0'));_0x426ddc[_0xa0a9('0x50')](_0xa0a9('0xb1'),_0xa0a9('0xb2'));_0x426ddc[_0xa0a9('0x50')](_0xa0a9('0xb3'),_0xa0a9('0x30'));}if(_0xe82093[_0xa0a9('0x21')])_0x426ddc[_0xa0a9('0x21')](_0xe82093[_0xa0a9('0x21')]);if(_0xe82093[_0xa0a9('0x1e')])_0x426ddc[_0xa0a9('0x1e')](_0xe82093[_0xa0a9('0x1e')]);return db['sequelize']['query'](_0x426ddc['toString'](),_0xcc00a8);})[_0xa0a9('0x12')](function(_0x21e364){if(_0x21e364[_0xa0a9('0x4b')]>0x0)_0x31bc1b[_0xa0a9('0x7e')](_0xa0a9('0xb4'),_[_0xa0a9('0x2e')](_0x21e364,'id'));return db['sequelize'][_0xa0a9('0x45')](_0x31bc1b[_0xa0a9('0x9d')](),_0xcc00a8)[_0xa0a9('0x12')](function(_0x160094){var _0x4a2ef5=_[_0xa0a9('0xb5')](_0x160094,_0xa0a9('0xb6'));var _0x3f3c0d=[];_0x21e364[_0xa0a9('0x33')](function(_0xb1715){_0x3f3c0d[_0xa0a9('0x34')](updateChatInteraction(_0xb1715,_0x1397dd,_0x4a2ef5));});return BPromise[_0xa0a9('0xb7')](_0x3f3c0d);});});})['then'](function(_0x5bcc9f){_0x2fcc76['rows']=_0x5bcc9f;return _0x2fcc76;})[_0xa0a9('0x12')](respondWithFilteredResult(_0x1a7879,_0xe82093))[_0xa0a9('0x35')](handleError(_0x1a7879,null));};exports[_0xa0a9('0xb8')]=function(_0x238192,_0x5e4d6c){var _0x577bd5={'raw':![],'where':{'id':_0x238192['params']['id']}},_0x311019={};_0x311019[_0xa0a9('0x44')]=_['keys'](db[_0xa0a9('0x40')][_0xa0a9('0x41')]);_0x311019['query']=_[_0xa0a9('0x46')](_0x238192[_0xa0a9('0x45')]);_0x311019['filters']=_[_0xa0a9('0x48')](_0x311019[_0xa0a9('0x44')],_0x311019[_0xa0a9('0x45')]);_0x577bd5[_0xa0a9('0x49')]=_[_0xa0a9('0x48')](_0x311019[_0xa0a9('0x44')],qs[_0xa0a9('0x4a')](_0x238192['query']['fields']));_0x577bd5[_0xa0a9('0x49')]=_0x577bd5[_0xa0a9('0x49')]['length']?_0x577bd5[_0xa0a9('0x49')]:_0x311019[_0xa0a9('0x44')];if(_0x238192[_0xa0a9('0x45')][_0xa0a9('0xb9')]){_0x577bd5[_0xa0a9('0xba')]=[{'all':!![]}];}_0x577bd5=_[_0xa0a9('0x2a')]({},_0x577bd5,_0x238192['options']);return db[_0xa0a9('0x40')]['find'](_0x577bd5)[_0xa0a9('0x12')](handleEntityNotFound(_0x5e4d6c,null))[_0xa0a9('0x12')](respondWithResult(_0x5e4d6c,null))['catch'](handleError(_0x5e4d6c,null));};exports[_0xa0a9('0xbb')]=function(_0x1a0bd7,_0x2f9e19){return db[_0xa0a9('0x40')][_0xa0a9('0xbb')](_0x1a0bd7[_0xa0a9('0x7b')],{})['then'](respondWithResult(_0x2f9e19,0xc9))[_0xa0a9('0x35')](handleError(_0x2f9e19,null));};exports[_0xa0a9('0xbc')]=function(_0x3f489a,_0x2d433f){if(_0x3f489a['body']['id']){delete _0x3f489a[_0xa0a9('0x7b')]['id'];}return db['ChatInteraction'][_0xa0a9('0x67')]({'where':{'id':_0x3f489a[_0xa0a9('0xbd')]['id']}})[_0xa0a9('0x12')](handleEntityNotFound(_0x2d433f,null))[_0xa0a9('0x12')](saveUpdates(_0x3f489a['body'],null))[_0xa0a9('0x12')](respondWithResult(_0x2d433f,null))[_0xa0a9('0x35')](handleError(_0x2d433f,null));};exports['destroy']=function(_0xa4809f,_0x3777dd){return db[_0xa0a9('0x40')]['find']({'where':{'id':_0xa4809f[_0xa0a9('0xbd')]['id']}})[_0xa0a9('0x12')](handleEntityNotFound(_0x3777dd,null))[_0xa0a9('0x12')](removeEntity(_0x3777dd,null))[_0xa0a9('0x35')](handleError(_0x3777dd,null));};exports[_0xa0a9('0xbe')]=function(_0x1d0c93,_0x37135f){return db[_0xa0a9('0x40')][_0xa0a9('0xbe')]()['then'](respondWithResult(_0x37135f,null))[_0xa0a9('0x35')](handleError(_0x37135f,null));};exports[_0xa0a9('0xbf')]=function(_0x6608c9,_0x62edc6){var _0x5e8748=_0x6608c9['params']['id'];var _0x1c52c9;var _0x20cb2e;var _0x17e067;return db[_0xa0a9('0x40')]['findOne']({'where':{'id':_0x5e8748}})[_0xa0a9('0x12')](function(_0x11e564){_0x1c52c9=_0x11e564;return db[_0xa0a9('0xc0')]['findOne']({'where':{'id':_0x11e564[_0xa0a9('0x96')]},'attributes':['id',_0xa0a9('0xc1'),_0xa0a9('0xc2'),_0xa0a9('0xc3'),_0xa0a9('0xc4'),_0xa0a9('0xc5')],'raw':!![]});})[_0xa0a9('0x12')](function(_0x33c4a7){if(_0x33c4a7&&_0x33c4a7['vidaooApiKey']&&_0x33c4a7[_0xa0a9('0xc2')]){_0x20cb2e=_0x33c4a7;var _0x350af5={'interaction':{'id':_0x5e8748},'agent':{'id':_0x6608c9['user']['id'],'name':_0x6608c9[_0xa0a9('0x98')][_0xa0a9('0x27')],'fullname':_0x6608c9[_0xa0a9('0x98')][_0xa0a9('0x2f')],'email':_0x6608c9['user'][_0xa0a9('0xc6')]},'contact':_0x6608c9[_0xa0a9('0x7b')][_0xa0a9('0xc7')],'account':_0x6608c9[_0xa0a9('0x7b')][_0xa0a9('0x2d')]};var _0xad0f9a={'rejectUnauthorized':![],'method':_0xa0a9('0xc8'),'url':_0xa0a9('0xc9'),'headers':{'X-APIKEY':_0x33c4a7['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x6608c9[_0xa0a9('0x98')][_0xa0a9('0xc6')]],'buttons':null,'topic':_0x20cb2e[_0xa0a9('0xc3')],'note':_[_0xa0a9('0xca')](_0x20cb2e[_0xa0a9('0xc4')])?null:getMustacheRender(_0x20cb2e[_0xa0a9('0xc4')],_0x350af5),'metadata':null},'redirect':_0xa0a9('0xcb'),'json':!![]};try{if(!_['isNull'](_0x20cb2e[_0xa0a9('0xc5')])){var _0x35b4ef=getMustacheRender(_0x20cb2e[_0xa0a9('0xc5')],_0x350af5);var _0x473915=JSON[_0xa0a9('0x82')](_0x35b4ef);_0xad0f9a[_0xa0a9('0x7b')][_0xa0a9('0xcc')]=_0x473915;}}catch(_0x436650){throw new db[(_0xa0a9('0xcd'))][(_0xa0a9('0xce'))](_0xa0a9('0xcf'));}return rp(_0xad0f9a);}else{throw new db[(_0xa0a9('0xcd'))][(_0xa0a9('0xce'))](_0xa0a9('0xd0'));}})[_0xa0a9('0x12')](function(_0x154862){_0x17e067=_0x154862;if(_0x17e067['id']){var _0x349c38={'body':_0x17e067[_0xa0a9('0xd1')],'ChatWebsiteId':_0x20cb2e['id'],'ChatInteractionId':_0x1c52c9['id'],'direction':'out','UserId':_0x6608c9[_0xa0a9('0x98')]['id']};return db[_0xa0a9('0xd2')]['create'](_0x349c38,{});}else{throw new db[(_0xa0a9('0xcd'))][(_0xa0a9('0xce'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xa0a9('0x12')](function(){return _0x1c52c9['updateAttributes']({'vidaooSessionId':_0x17e067['id']});})['then'](respondWithResult(_0x62edc6,null))[_0xa0a9('0x35')](handleError(_0x62edc6,null));};exports[_0xa0a9('0xd3')]=function(_0x372745,_0x4b951c){if(_0x372745[_0xa0a9('0x7b')]['id']){delete _0x372745['body']['id'];}return db[_0xa0a9('0x40')][_0xa0a9('0x67')]({'where':{'id':_0x372745[_0xa0a9('0xbd')]['id']},'include':[{'model':db[_0xa0a9('0xd4')],'as':_0xa0a9('0x6b')}]})[_0xa0a9('0x12')](handleEntityNotFound(_0x4b951c,null))[_0xa0a9('0x12')](saveUpdates(_0x372745[_0xa0a9('0x7b')],null))['then'](respondWithResult(_0x4b951c,null))[_0xa0a9('0x35')](handleError(_0x4b951c,null));};exports[_0xa0a9('0xd5')]=function(_0x27b2b9,_0x402032){if(_0x27b2b9[_0xa0a9('0x7b')]['id']){delete _0x27b2b9[_0xa0a9('0x7b')]['id'];}return db['ChatInteraction'][_0xa0a9('0x67')]({'where':{'id':_0x27b2b9[_0xa0a9('0xbd')]['id']}})[_0xa0a9('0x12')](function(_0x12c80f){if(!_0x12c80f){logger[_0xa0a9('0x17')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xa0a9('0xd5'),0x194,'entity\x20not\x20found');_0x402032[_0xa0a9('0x1b')](0x194);}else{if(_0x12c80f[_0xa0a9('0x3c')]){throw new db[(_0xa0a9('0xcd'))][(_0xa0a9('0xce'))](_0xa0a9('0xd6'));}}return _0x12c80f;})['then'](function(_0x17fcbb){if(_0x17fcbb){return _0x17fcbb['update']({'closed':_0x27b2b9[_0xa0a9('0x7b')][_0xa0a9('0x3b')],'disposition':_0x27b2b9[_0xa0a9('0x7b')][_0xa0a9('0x3d')]})[_0xa0a9('0x12')](function(_0x52dc56){return _0x52dc56;});}})[_0xa0a9('0x12')](function(){return respondWithRpcPromise('AbandonInteraction',_0xa0a9('0xd5'),_0x27b2b9[_0xa0a9('0x7b')],client9004);})[_0xa0a9('0x12')](respondWithResult(_0x402032,null))['catch'](handleError(_0x402032,null));};exports[_0xa0a9('0xd7')]=function(_0x5baba3,_0x44c430){_0x5baba3['body'][_0xa0a9('0x27')]=_0x5baba3[_0xa0a9('0xd8')][_0xa0a9('0xd9')];_0x5baba3['body']['basename']=_0x5baba3[_0xa0a9('0xd8')][_0xa0a9('0xda')];_0x5baba3['body']['type']=_0x5baba3[_0xa0a9('0xd8')]['mimetype'];return db['Attachment']['create'](_0x5baba3[_0xa0a9('0x7b')])[_0xa0a9('0x12')](respondWithResult(_0x44c430,0xc9))[_0xa0a9('0x35')](handleError(_0x44c430,null));};exports[_0xa0a9('0xdb')]=function(_0x4efd74,_0x9bd5f7){return db['ChatInteraction'][_0xa0a9('0xdc')]({'where':{'id':_0x4efd74[_0xa0a9('0xbd')]['id']},'raw':!![]})[_0xa0a9('0x12')](handleEntityNotFound(_0x9bd5f7,null))[_0xa0a9('0x12')](function(_0x46dbf5){if(_0x46dbf5){if(_0x46dbf5[_0xa0a9('0x3b')]){return _0x9bd5f7[_0xa0a9('0x1c')](0x193)[_0xa0a9('0x1d')]({'status':0x193,'message':_0xa0a9('0xdd')});}return db[_0xa0a9('0xde')][_0xa0a9('0xdc')]({'where':{'id':_0x4efd74[_0xa0a9('0x45')][_0xa0a9('0xdf')]},'raw':!![]})[_0xa0a9('0x12')](handleEntityNotFound(_0x9bd5f7,null));}})[_0xa0a9('0x12')](function(_0x514525){if(_0x514525){var _0xbb9cb1=_0x514525[_0xa0a9('0xe0')]!==null;var _0x27fd56=path[_0xa0a9('0xe1')](config[_0xa0a9('0xe2')],_0xa0a9('0xe3'));if(_0xbb9cb1){_0x27fd56=path[_0xa0a9('0xe1')](_0x27fd56,_0xa0a9('0xe4'));}var _0x5408ae=path[_0xa0a9('0xe1')](_0x27fd56,_0x514525['basename']);return _0x9bd5f7[_0xa0a9('0xe5')](_0x5408ae);}})[_0xa0a9('0x35')](handleError(_0x9bd5f7,null));};exports['close']=function(_0x482ce4,_0x324007){var _0x1bf013=null;var _0x5a5cb0=null;var _0x31948d=null;if(_0x482ce4[_0xa0a9('0x7b')]['id']){delete _0x482ce4[_0xa0a9('0x7b')]['id'];}if(_0x482ce4[_0xa0a9('0x7b')][_0xa0a9('0xe6')]){_0x31948d=path[_0xa0a9('0xe1')](config[_0xa0a9('0xe2')],_0xa0a9('0xe7'),util['format']('transcript-%s.txt',Date[_0xa0a9('0xe8')]()));_0x482ce4[_0xa0a9('0x7b')][_0xa0a9('0xe9')]=_0x31948d;}return db[_0xa0a9('0x40')][_0xa0a9('0x67')]({'where':{'id':_0x482ce4[_0xa0a9('0xbd')]['id']},'include':[{'model':db[_0xa0a9('0xd2')],'as':_0xa0a9('0xea'),'include':[{'model':db[_0xa0a9('0x79')],'as':_0xa0a9('0x79')}]}]})[_0xa0a9('0x12')](handleEntityNotFound(_0x324007,null))['then'](saveUpdates(_0x482ce4[_0xa0a9('0x7b')],null))['then'](function(_0x3479a4){if(_0x3479a4){_0x1bf013=_0x3479a4;return db[_0xa0a9('0xc0')][_0xa0a9('0x67')]({'where':{'id':_0x1bf013['ChatWebsiteId']}});}})[_0xa0a9('0x12')](function(_0x352584){if(_0x352584){_0x5a5cb0=_0x352584;return db[_0xa0a9('0xd4')][_0xa0a9('0x67')]({'where':{'id':_0x1bf013[_0xa0a9('0x71')]}});}})[_0xa0a9('0x12')](function(_0x35b7b3){if(_0x35b7b3){if(_0x31948d){var _0x79cac0=null;for(var _0x23b6be=0x1;_0x23b6be<_0x1bf013[_0xa0a9('0xea')]['length'];++_0x23b6be){_0x79cac0=_0x1bf013[_0xa0a9('0xea')][_0x23b6be];var _0x14a805=_0x79cac0[_0xa0a9('0x3c')]?util['format'](_0xa0a9('0xeb'),_0x5a5cb0[_0xa0a9('0xec')],_0x79cac0[_0xa0a9('0x3c')]):_0xa0a9('0xed');var _0x5093aa=_0x482ce4[_0xa0a9('0x7b')][_0xa0a9('0xee')]||util[_0xa0a9('0xef')](_0xa0a9('0xeb'),'Visitor',_0x79cac0[_0xa0a9('0x71')]);switch(_0x5a5cb0[_0xa0a9('0xf0')]){case _0xa0a9('0xf1'):_0x14a805=_0x79cac0[_0xa0a9('0x3c')]?util[_0xa0a9('0xef')](_0xa0a9('0xeb'),_0x5a5cb0[_0xa0a9('0xec')],_0x79cac0['UserId']):_0xa0a9('0xed');break;case _0xa0a9('0xf2'):_0x14a805=_0x79cac0[_0xa0a9('0x3c')]?_0x79cac0['User']['alias']||_0x79cac0[_0xa0a9('0x79')][_0xa0a9('0x2f')]:_0xa0a9('0xed');break;case _0xa0a9('0xf3'):_0x14a805=_0x79cac0[_0xa0a9('0x3c')]?_0x79cac0['User'][_0xa0a9('0x2f')]:_0xa0a9('0xed');break;default:_0x14a805=_0x79cac0[_0xa0a9('0x3c')]?util['format']('%s%d',_0x5a5cb0[_0xa0a9('0xec')],_0x79cac0['UserId']):_0xa0a9('0xed');}var _0x2389f7=util[_0xa0a9('0xef')]('[%s]\x20%s:\x20%s\x0a',moment(_0x79cac0[_0xa0a9('0x81')])['format'](_0xa0a9('0xf4')),_0x79cac0[_0xa0a9('0xf5')]==='in'?_0x5093aa:_0x14a805,_0x79cac0['body']);if(!_0x79cac0[_0xa0a9('0xf6')]){fs[_0xa0a9('0xf7')](_0x31948d,_0x2389f7);}}return db['MailAccount'][_0xa0a9('0xdc')]({'where':{'service':!![]},'include':[{'model':db[_0xa0a9('0xf8')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xa0a9('0xf9')],'as':_0xa0a9('0xf9'),'raw':!![]}]}]});}}})['then'](function(_0x48416b){if(!_0x48416b||!_0x48416b[_0xa0a9('0xfa')]||!_0x482ce4[_0xa0a9('0x7b')])return _0x1bf013;var _0x3b6362=_0x48416b[_0xa0a9('0xfb')]();return respondWithRpcPromise(_0xa0a9('0xfc'),_0xa0a9('0xfd'),{'account':_0x3b6362,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x48416b[_0xa0a9('0x27')],_0x48416b[_0xa0a9('0xc6')]||_0x48416b[_0xa0a9('0xfa')][_0xa0a9('0x98')]),'to':_0x482ce4[_0xa0a9('0x7b')][_0xa0a9('0xe6')],'subject':_0xa0a9('0xfe'),'text':util[_0xa0a9('0xef')](_0xa0a9('0xff'),_0x482ce4[_0xa0a9('0x7b')][_0xa0a9('0xe6')]),'attachments':[{'path':_0x31948d}]}})[_0xa0a9('0x12')](function(){return _0x1bf013;})[_0xa0a9('0x35')](function(_0x5bd10e){logger[_0xa0a9('0x17')](_0x5bd10e);});})[_0xa0a9('0x12')](respondWithStatusCode(_0x324007,0xc8))[_0xa0a9('0x35')](handleError(_0x324007,null));};exports[_0xa0a9('0x100')]=function(_0x50987c,_0x5a84fe){return db[_0xa0a9('0xd2')][_0xa0a9('0x67')]({'where':{'id':_0x50987c[_0xa0a9('0xbd')]['id']}})[_0xa0a9('0x12')](handleEntityNotFound(_0x5a84fe,null))[_0xa0a9('0x12')](function(_0x6e8b08){if(_0x6e8b08){return _0x6e8b08[_0xa0a9('0x100')](_0x50987c[_0xa0a9('0x7b')]['ids'],_[_0xa0a9('0x101')](_0x50987c['body'],[_0xa0a9('0x102'),'id'])||{});}})[_0xa0a9('0x12')](respondWithResult(_0x5a84fe,null))[_0xa0a9('0x35')](handleError(_0x5a84fe,null));};exports[_0xa0a9('0x103')]=function(_0x4761d5,_0x452abd){var _0x5d5e07={'raw':![],'where':{}};var _0x150702={};var _0x21cb84={'count':0x0,'rows':[]};return db[_0xa0a9('0x40')][_0xa0a9('0xdc')]({'where':{'id':_0x4761d5[_0xa0a9('0xbd')]['id']}})['then'](handleEntityNotFound(_0x452abd,null))[_0xa0a9('0x12')](function(_0x5553ab){if(_0x5553ab){_0x150702['model']=_[_0xa0a9('0x46')](db[_0xa0a9('0xd2')]['rawAttributes']);_0x150702['query']=_[_0xa0a9('0x46')](_0x4761d5[_0xa0a9('0x45')]);_0x150702[_0xa0a9('0x47')]=_['intersection'](_0x150702[_0xa0a9('0x44')],_0x150702[_0xa0a9('0x45')]);_0x5d5e07[_0xa0a9('0x49')]=_['intersection'](_0x150702[_0xa0a9('0x44')],qs['fields'](_0x4761d5[_0xa0a9('0x45')][_0xa0a9('0x4a')]));_0x5d5e07['attributes']=_0x5d5e07['attributes'][_0xa0a9('0x4b')]?_0x5d5e07['attributes']:_0x150702[_0xa0a9('0x44')];if(!_0x4761d5['query'][_0xa0a9('0x4c')](_0xa0a9('0x4d'))){_0x5d5e07[_0xa0a9('0x21')]=qs[_0xa0a9('0x21')](_0x4761d5['query'][_0xa0a9('0x21')]);_0x5d5e07[_0xa0a9('0x1e')]=qs[_0xa0a9('0x1e')](_0x4761d5['query'][_0xa0a9('0x1e')]);}_0x5d5e07[_0xa0a9('0x93')]=qs[_0xa0a9('0x4e')](_0x4761d5[_0xa0a9('0x45')][_0xa0a9('0x4e')]);_0x5d5e07[_0xa0a9('0x7e')]=qs[_0xa0a9('0x47')](_[_0xa0a9('0x4f')](_0x4761d5[_0xa0a9('0x45')],_0x150702[_0xa0a9('0x47')]));_0x5d5e07[_0xa0a9('0x7e')]['ChatInteractionId']=_0x5553ab['id'];if(_0x4761d5['query']['filter']){_0x5d5e07[_0xa0a9('0x7e')]=_[_0xa0a9('0x2a')](_0x5d5e07[_0xa0a9('0x7e')],{'$or':_['map'](_0x5d5e07[_0xa0a9('0x49')],function(_0x2d912d){var _0x4d1058={};_0x4d1058[_0x2d912d]={'$like':'%'+_0x4761d5[_0xa0a9('0x45')]['filter']+'%'};return _0x4d1058;})});}if(_0x4761d5['query'][_0xa0a9('0x83')]){var _0x5c9a49=_0x4761d5['query'][_0xa0a9('0x83')][_0xa0a9('0x32')](',');var _0x5d22fd={};_0x5d22fd[_0x5c9a49[0x0]]={'$gte':moment(_0x5c9a49[0x1])[_0xa0a9('0xef')](_0xa0a9('0x104'))};_0x5d5e07[_0xa0a9('0x7e')]=_[_0xa0a9('0x2a')](_0x5d5e07[_0xa0a9('0x7e')],_0x5d22fd);}_0x5d5e07=_[_0xa0a9('0x2a')]({},_0x5d5e07,_0x4761d5[_0xa0a9('0x105')]);return db['ChatMessage'][_0xa0a9('0x20')]({'where':_0x5d5e07[_0xa0a9('0x7e')]})[_0xa0a9('0x12')](function(_0x55ab15){_0x21cb84[_0xa0a9('0x20')]=_0x55ab15;if(_0x4761d5['query']['includeAll']){_0x5d5e07[_0xa0a9('0xba')]=[{'all':!![]}];}return db[_0xa0a9('0xd2')][_0xa0a9('0x106')](_0x5d5e07);})[_0xa0a9('0x12')](function(_0x5e48d7){_0x21cb84[_0xa0a9('0x107')]=_0x5e48d7;return _0x21cb84;});}})[_0xa0a9('0x12')](respondWithFilteredResult(_0x452abd,_0x5d5e07))['catch'](handleError(_0x452abd,null));};exports[_0xa0a9('0x108')]=function(_0x400095,_0x14a263){var _0xd4de40={'where':{}},_0x164ce4={},_0x1ccc1f={'count':0x0,'rows':[]};return db[_0xa0a9('0x40')]['findOne']({'where':{'id':_0x400095[_0xa0a9('0xbd')]['id']}})[_0xa0a9('0x12')](handleEntityNotFound(_0x14a263,null))[_0xa0a9('0x12')](function(_0x440856){if(_0x440856){_0x164ce4['model']=_['keys'](db['ChatMessage']['rawAttributes']);_0x164ce4['query']=_['keys'](_0x400095[_0xa0a9('0x45')]);_0x164ce4[_0xa0a9('0x47')]=_[_0xa0a9('0x48')](_0x164ce4['model'],_0x164ce4[_0xa0a9('0x45')]);_0xd4de40[_0xa0a9('0x49')]=_[_0xa0a9('0x48')](_0x164ce4['model'],qs[_0xa0a9('0x4a')](_0x400095[_0xa0a9('0x45')][_0xa0a9('0x4a')]));_0xd4de40['attributes']=_0xd4de40[_0xa0a9('0x49')]['length']?_0xd4de40['attributes']:_0x164ce4['model'];if(!_0x400095[_0xa0a9('0x45')][_0xa0a9('0x4c')]('nolimit')){_0xd4de40['limit']=qs[_0xa0a9('0x21')](_0x400095[_0xa0a9('0x45')][_0xa0a9('0x21')]);_0xd4de40[_0xa0a9('0x1e')]=qs['offset'](_0x400095[_0xa0a9('0x45')][_0xa0a9('0x1e')]);}_0xd4de40[_0xa0a9('0x93')]=qs[_0xa0a9('0x4e')](_0x400095[_0xa0a9('0x45')][_0xa0a9('0x4e')]);_0xd4de40[_0xa0a9('0x7e')]=qs[_0xa0a9('0x47')](_[_0xa0a9('0x4f')](_0x400095[_0xa0a9('0x45')],_0x164ce4[_0xa0a9('0x47')]));_0xd4de40[_0xa0a9('0x7e')]['ChatInteractionId']=_0x440856['id'];if(_0x400095[_0xa0a9('0x45')][_0xa0a9('0x8a')]){_0xd4de40[_0xa0a9('0x7e')]=_[_0xa0a9('0x2a')](_0xd4de40[_0xa0a9('0x7e')],{'$or':_[_0xa0a9('0x2e')](_0xd4de40[_0xa0a9('0x49')],function(_0x472cb0){var _0x4bf645={};_0x4bf645[_0x472cb0]={'$like':'%'+_0x400095['query'][_0xa0a9('0x8a')]+'%'};return _0x4bf645;})});}_0xd4de40['where'][_0xa0a9('0xf6')]=![];if(_0x400095[_0xa0a9('0x45')]['id']){_0xd4de40[_0xa0a9('0x7e')]['id']={'$gt':_0x400095[_0xa0a9('0x45')]['id']};}_0xd4de40=_[_0xa0a9('0x2a')]({},_0xd4de40,_0x400095[_0xa0a9('0x105')]);return db[_0xa0a9('0xd2')][_0xa0a9('0x20')]({'where':_0xd4de40[_0xa0a9('0x7e')]})[_0xa0a9('0x12')](function(_0x166de1){_0x1ccc1f[_0xa0a9('0x20')]=_0x166de1;_0xd4de40['include']=[];if(_0x400095[_0xa0a9('0x45')][_0xa0a9('0x109')]){_0xd4de40[_0xa0a9('0xba')][_0xa0a9('0x34')]({'model':db[_0xa0a9('0x79')],'as':_0xa0a9('0x79'),'attributes':['id',_0xa0a9('0x2f'),'alias']});}if(_0x400095['query']['includeAll']){_0xd4de40[_0xa0a9('0xba')]=[{'all':!![]}];}return db[_0xa0a9('0xd2')]['findAll'](_0xd4de40);})[_0xa0a9('0x12')](function(_0x36b55b){_0x1ccc1f[_0xa0a9('0x107')]=_0x36b55b;return _0x1ccc1f;});}})[_0xa0a9('0x12')](respondWithFilteredResult(_0x14a263,_0xd4de40))[_0xa0a9('0x35')](handleError(_0x14a263,null));};exports[_0xa0a9('0x10a')]=function(_0x39995d,_0x2bfd59){return db['ChatInteraction'][_0xa0a9('0x67')]({'where':{'id':_0x39995d['params']['id']}})[_0xa0a9('0x12')](handleEntityNotFound(_0x2bfd59,null))[_0xa0a9('0x12')](function(_0x51377d){if(_0x51377d){return _0x51377d['setTags'](_0x39995d['body'][_0xa0a9('0x102')],_[_0xa0a9('0x101')](_0x39995d[_0xa0a9('0x7b')],[_0xa0a9('0x102'),'id'])||{})['spread'](function(){return db['Tag'][_0xa0a9('0x106')]({'attributes':['id',_0xa0a9('0x27'),_0xa0a9('0x51')],'where':{'id':_0x39995d[_0xa0a9('0x7b')][_0xa0a9('0x102')]}});})[_0xa0a9('0x12')](function(_0x1f34d4){socket[_0xa0a9('0x10b')](_0xa0a9('0x10c'),{'id':Number(_0x39995d[_0xa0a9('0xbd')]['id']),'tags':_0x1f34d4||[]});return{'id':Number(_0x39995d[_0xa0a9('0xbd')]['id']),'tags':_0x1f34d4||[]};});}})[_0xa0a9('0x12')](respondWithResult(_0x2bfd59,null))[_0xa0a9('0x35')](handleError(_0x2bfd59,null));};exports['removeTags']=function(_0x58afbe,_0x45f667){return db[_0xa0a9('0x40')]['find']({'where':{'id':_0x58afbe['params']['id']}})[_0xa0a9('0x12')](handleEntityNotFound(_0x45f667,null))[_0xa0a9('0x12')](function(_0x3c9b49){if(_0x3c9b49){return _0x3c9b49[_0xa0a9('0x10d')](_0x58afbe[_0xa0a9('0x45')][_0xa0a9('0x102')]);}})[_0xa0a9('0x12')](respondWithStatusCode(_0x45f667,null))[_0xa0a9('0x35')](handleError(_0x45f667,null));};exports[_0xa0a9('0xe5')]=function(_0x307abf,_0x45f3eb){var _0x4ce9ab=moment()['unix']()['toString']();var _0x297188=path['join'](config['root'],_0xa0a9('0x10e'),_0xa0a9('0x10f'),_0xa0a9('0x110'));var _0x16ca55=path[_0xa0a9('0xe1')](config[_0xa0a9('0xe2')],_0xa0a9('0x10e'),_0xa0a9('0x10f'),_0xa0a9('0x111'));var _0x1104ce=path['join'](_0x297188,_0x4ce9ab);var _0x364531=util['format'](_0xa0a9('0x112'),_0x307abf[_0xa0a9('0xbd')]['id'],_0x4ce9ab);var _0x302f76=path[_0xa0a9('0xe1')](_0x297188,_0x364531);var _0x4e229b=[];_0x4e229b[_0xa0a9('0x34')]({'model':db[_0xa0a9('0x79')],'as':'User','attributes':['id',_0xa0a9('0x2f')],'raw':!![]});_0x4e229b['push']({'model':db['CmContact'],'as':_0xa0a9('0x6b'),'attributes':['id',_0xa0a9('0x113'),'lastName'],'raw':!![]});if(_0x307abf[_0xa0a9('0x45')][_0xa0a9('0x111')]){_0x4e229b['push']({'model':db[_0xa0a9('0xde')],'as':_0xa0a9('0xde'),'raw':!![]});}var _0x16e611=[{'model':db[_0xa0a9('0xd2')],'as':_0xa0a9('0xea'),'attributes':['id',_0xa0a9('0x7b'),_0xa0a9('0x81'),_0xa0a9('0xf5'),'secret',_0xa0a9('0x86')],'include':_0x4e229b}];_0x16e611[_0xa0a9('0x34')]({'model':db[_0xa0a9('0xc0')],'as':_0xa0a9('0x114'),'attributes':['id',_0xa0a9('0x27')]});_0x16e611[_0xa0a9('0x34')]({'model':db[_0xa0a9('0x79')],'as':_0xa0a9('0x115'),'attributes':['id',_0xa0a9('0x2f')]});return db[_0xa0a9('0x40')][_0xa0a9('0x67')]({'where':{'id':_0x307abf[_0xa0a9('0xbd')]['id']},'include':_0x16e611})['then'](handleEntityNotFound(_0x45f3eb,null))[_0xa0a9('0x12')](function(_0x21b0c2){if(_0x21b0c2){var _0x532a92=_0x21b0c2[_0xa0a9('0x116')]({'plain':!![]});fs[_0xa0a9('0x117')](_0x1104ce);var _0xcfd51d={'channel':'Chat','account':_0x532a92[_0xa0a9('0x114')]['name'],'agent':_0x532a92[_0xa0a9('0x115')]?_0x532a92['Owner'][_0xa0a9('0x2f')]:_0xa0a9('0x118'),'createdAt':moment(_0x532a92[_0xa0a9('0x81')])['format'](_0xa0a9('0x104'))[_0xa0a9('0x9d')](),'closedAt':_0x532a92[_0xa0a9('0x3b')]?moment(_0x532a92[_0xa0a9('0x119')])['format'](_0xa0a9('0x104'))[_0xa0a9('0x9d')]():'','disposition':_0x532a92[_0xa0a9('0x3d')],'chatInfo':{'browser':_0x532a92[_0xa0a9('0x11a')],'os':_0x532a92[_0xa0a9('0x11b')],'referer':_0x532a92[_0xa0a9('0x11c')],'customerIp':_0x532a92['customerIp'],'customerPort':_0x532a92['customerPort']?_0x532a92['customerPort']:_0xa0a9('0x118')},'messages':_(_0x532a92[_0xa0a9('0xea')])[_0xa0a9('0x11d')]()[_0xa0a9('0x8a')]({'secret':![]})[_0xa0a9('0x2e')](function(_0xe69cbf){if(_0xe69cbf['Attachment']){var _0x5c0b22=path[_0xa0a9('0xe1')](_0x16ca55,_0xe69cbf[_0xa0a9('0xde')][_0xa0a9('0x11e')]);if(fs['existsSync'](_0x5c0b22)){fs['createReadStream'](_0x5c0b22)[_0xa0a9('0x11f')](fs['createWriteStream'](path['join'](_0x1104ce,_0xe69cbf[_0xa0a9('0xde')][_0xa0a9('0x11e')])));}}return{'date':moment(_0xe69cbf['createdAt'])[_0xa0a9('0xef')](_0xa0a9('0x104'))[_0xa0a9('0x9d')](),'sender':_0xe69cbf['direction']===_0xa0a9('0x120')?_0xe69cbf[_0xa0a9('0x79')]?_0xe69cbf[_0xa0a9('0x79')][_0xa0a9('0x2f')]:'System':_0xe69cbf[_0xa0a9('0x6b')][_0xa0a9('0x113')]+(_0xe69cbf[_0xa0a9('0x6b')][_0xa0a9('0x121')]?'\x20'+_0xe69cbf[_0xa0a9('0x6b')][_0xa0a9('0x121')]:''),'body':_0xe69cbf[_0xa0a9('0xde')]?_0xe69cbf['Attachment']['basename']:_0xe69cbf['body'],'direction':_0xe69cbf[_0xa0a9('0xf5')]===_0xa0a9('0x120')?'A':'C','secret':_0xe69cbf[_0xa0a9('0xf6')],'read':_0xe69cbf[_0xa0a9('0x86')],'attachment':_0xe69cbf[_0xa0a9('0xde')]};})['value']()};return ejs['renderFile'](path[_0xa0a9('0xe1')](config[_0xa0a9('0xe2')],_0xa0a9('0x10e'),'views',_0xa0a9('0x122')),{'interaction':_0xcfd51d})[_0xa0a9('0x12')](function(_0xd552c9){var _0x3fa016=path[_0xa0a9('0xe1')](_0x1104ce,_0xa0a9('0x123')+_0x532a92['id']+'-'+_0x4ce9ab+_0xa0a9('0x124'));var _0xef07f0={'path':_0x3fa016,'channel':_0xa0a9('0x125'),'interactionId':_0x532a92['id']};return pdf[_0xa0a9('0x126')](_0xd552c9,_0xef07f0);})['then'](function(){return new Promise(function(_0x538668,_0x1092f8){zipdir(_0x1104ce,{'saveTo':_0x302f76},function(_0x2117a6,_0x1128aa){if(_0x2117a6)return _0x1092f8(_0x2117a6);return _0x538668(_0x1128aa);});})[_0xa0a9('0x12')](function(){return new BPromise(function(_0x3414bd,_0x50db7d){rimraf(_0x1104ce,function(_0x5560aa){if(_0x5560aa)_0x50db7d(_0x5560aa);return _0x3414bd();});});})[_0xa0a9('0x12')](function(){return _0x45f3eb[_0xa0a9('0xe5')](_0x302f76,_0x364531,function(_0x30a84c){if(_0x30a84c){logger[_0xa0a9('0x17')]('err',_0x30a84c);}else{fs[_0xa0a9('0x127')](_0x302f76);}});});});}else{return _0x45f3eb[_0xa0a9('0x1b')](0xc8);}})[_0xa0a9('0x35')](handleError(_0x45f3eb,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index ec25160..8f4e574 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 _0xe9af=['exports','events','ChatInteraction','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','unreadMessages','emit','catch','hasOwnProperty','hook'];(function(_0x1bd4a9,_0x5ca3f9){var _0x26b456=function(_0x283c72){while(--_0x283c72){_0x1bd4a9['push'](_0x1bd4a9['shift']());}};_0x26b456(++_0x5ca3f9);}(_0xe9af,0x9a));var _0xfe9a=function(_0x486081,_0x1bc542){_0x486081=_0x486081-0x0;var _0x439b6f=_0xe9af[_0x486081];return _0x439b6f;};'use strict';var EventEmitter=require(_0xfe9a('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0xfe9a('0x1')];var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xfe9a('0x2')](0x0);var events={'afterCreate':_0xfe9a('0x3'),'afterUpdate':_0xfe9a('0x4'),'afterDestroy':_0xfe9a('0x5')};function emitEvent(_0x195c71){return function(_0x2a22de,_0x1f8947,_0x1afdbd){_0x2a22de[_0xfe9a('0x6')]({'attributes':['id'],'raw':!![]})[_0xfe9a('0x7')](function(_0x4e2537){_0x2a22de[_0xfe9a('0x8')](_0xfe9a('0x9'),_0x4e2537[_0xfe9a('0xa')](function(_0x36666e){return{'id':_0x36666e['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x2a22de['id'],'direction':'in','read':![]},'raw':!![]});})[_0xfe9a('0x7')](function(_0x2ade61){_0x2a22de[_0xfe9a('0x8')](_0xfe9a('0xb'),_0x2ade61['length']);ChatInteractionEvents['emit'](_0x195c71+':'+_0x2a22de['id'],_0x2a22de);ChatInteractionEvents[_0xfe9a('0xc')](_0x195c71,_0x2a22de);_0x1afdbd(null);})[_0xfe9a('0xd')](_0x1afdbd(null));};}for(var e in events){if(events[_0xfe9a('0xe')](e)){var event=events[e];ChatInteraction[_0xfe9a('0xf')](e,emitEvent(event));}}module[_0xfe9a('0x10')]=ChatInteractionEvents; \ No newline at end of file +var _0x7233=['getUsers','then','Users','map','setDataValue','unreadMessages','emit','catch','hasOwnProperty','exports','../../mysqldb','setMaxListeners','update'];(function(_0x28b00a,_0x12b1c9){var _0xa7fe9c=function(_0x14674e){while(--_0x14674e){_0x28b00a['push'](_0x28b00a['shift']());}};_0xa7fe9c(++_0x12b1c9);}(_0x7233,0x1d1));var _0x3723=function(_0x3a6ee4,_0x3afe1e){_0x3a6ee4=_0x3a6ee4-0x0;var _0x473242=_0x7233[_0x3a6ee4];return _0x473242;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x3723('0x0'))['db']['ChatInteraction'];var ChatMessage=require(_0x3723('0x0'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x3723('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3723('0x2'),'afterDestroy':'remove'};function emitEvent(_0x375335){return function(_0x441a58,_0x5d7881,_0x571bed){_0x441a58[_0x3723('0x3')]({'attributes':['id'],'raw':!![]})[_0x3723('0x4')](function(_0x158365){_0x441a58['setDataValue'](_0x3723('0x5'),_0x158365[_0x3723('0x6')](function(_0x2b88f3){return{'id':_0x2b88f3['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x441a58['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3723('0x4')](function(_0x2dcf9e){_0x441a58[_0x3723('0x7')](_0x3723('0x8'),_0x2dcf9e['length']);ChatInteractionEvents[_0x3723('0x9')](_0x375335+':'+_0x441a58['id'],_0x441a58);ChatInteractionEvents[_0x3723('0x9')](_0x375335,_0x441a58);_0x571bed(null);})[_0x3723('0xa')](_0x571bed(null));};}for(var e in events){if(events[_0x3723('0xb')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x3723('0xc')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 2d80ebc..4cb7466 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 _0x256b=['closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed'];(function(_0x91ddd4,_0x1cc013){var _0x51c5d1=function(_0x39eac6){while(--_0x39eac6){_0x91ddd4['push'](_0x91ddd4['shift']());}};_0x51c5d1(++_0x1cc013);}(_0x256b,0x1e4));var _0xb256=function(_0x319e1c,_0x3b4634){_0x319e1c=_0x319e1c-0x0;var _0x49c88d=_0x256b[_0x319e1c];return _0x49c88d;};'use strict';var _=require(_0xb256('0x0'));var util=require(_0xb256('0x1'));var logger=require(_0xb256('0x2'))(_0xb256('0x3'));var moment=require(_0xb256('0x4'));var BPromise=require(_0xb256('0x5'));var rp=require(_0xb256('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb256('0x7'));var config=require(_0xb256('0x8'));var attributes=require(_0xb256('0x9'));module[_0xb256('0xa')]=function(_0x230aa1,_0xb6c6e0){return _0x230aa1[_0xb256('0xb')](_0xb256('0xc'),attributes,{'tableName':_0xb256('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x13d042,_0x5f1fb0,_0x1efb76){if(_0x13d042[_0xb256('0xe')](_0xb256('0xf'))){_0x13d042[_0xb256('0x10')]=moment()['format'](_0xb256('0x11'));}_0x1efb76(null,_0x13d042);}},'charset':_0xb256('0x12'),'collate':_0xb256('0x13')});}; \ No newline at end of file +var _0x529e=['api','moment','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0xb3c46e,_0x5c15f0){var _0x43ad16=function(_0x865238){while(--_0x865238){_0xb3c46e['push'](_0xb3c46e['shift']());}};_0x43ad16(++_0x5c15f0);}(_0x529e,0x8d));var _0xe529=function(_0x373bac,_0x486421){_0x373bac=_0x373bac-0x0;var _0x321f0b=_0x529e[_0x373bac];return _0x321f0b;};'use strict';var _=require(_0xe529('0x0'));var util=require(_0xe529('0x1'));var logger=require(_0xe529('0x2'))(_0xe529('0x3'));var moment=require(_0xe529('0x4'));var BPromise=require('bluebird');var rp=require(_0xe529('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe529('0x6'));var config=require(_0xe529('0x7'));var attributes=require(_0xe529('0x8'));module[_0xe529('0x9')]=function(_0x2e6017,_0x5dce3c){return _0x2e6017[_0xe529('0xa')](_0xe529('0xb'),attributes,{'tableName':_0xe529('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xbe13f,_0x3577b0,_0x4732d9){if(_0xbe13f[_0xe529('0xd')](_0xe529('0xe'))){_0xbe13f['closedAt']=moment()['format'](_0xe529('0xf'));}_0x4732d9(null,_0xbe13f);}},'charset':_0xe529('0x10'),'collate':_0xe529('0x11')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 94fecdb..cbf6c4c 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 _0x9a3e=['socket.io-emitter','./chatInteraction.socket','register','then','info','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatInteraction,\x20%s,\x20%s','message','result','catch','ChatInteraction','update','options','raw','limit','UpdateChatInteraction','find','where','body','ids','omit','spread','AddTags','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x9a3e,0x133));var _0xe9a3=function(_0x37ca2d,_0x3075a3){_0x37ca2d=_0x37ca2d-0x0;var _0x598608=_0x9a3e[_0x37ca2d];return _0x598608;};'use strict';var _=require(_0xe9a3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe9a3('0x1'));var rs=require(_0xe9a3('0x2'));var fs=require('fs');var Redis=require(_0xe9a3('0x3'));var db=require(_0xe9a3('0x4'))['db'];var utils=require(_0xe9a3('0x5'));var logger=require('../../config/logger')(_0xe9a3('0x6'));var config=require(_0xe9a3('0x7'));var jayson=require(_0xe9a3('0x8'));var client=jayson[_0xe9a3('0x9')][_0xe9a3('0xa')]({'port':0x232a});config[_0xe9a3('0xb')]=_['defaults'](config[_0xe9a3('0xb')],{'host':_0xe9a3('0xc'),'port':0x18eb});var socket=require(_0xe9a3('0xd'))(new Redis(config[_0xe9a3('0xb')]));require(_0xe9a3('0xe'))[_0xe9a3('0xf')](socket);function respondWithRpcPromise(_0x1611fa,_0x41df4f,_0x44b38e){return new BPromise(function(_0x4ffaf4,_0x4fcf3c){return client['request'](_0x1611fa,_0x44b38e)[_0xe9a3('0x10')](function(_0x380038){logger[_0xe9a3('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x41df4f,'request\x20sent');logger[_0xe9a3('0x12')](_0xe9a3('0x13'),_0x41df4f,_0xe9a3('0x14'),JSON[_0xe9a3('0x15')](_0x380038));if(_0x380038['error']){if(_0x380038[_0xe9a3('0x16')]['code']===0x1f4){logger[_0xe9a3('0x16')](_0xe9a3('0x17'),_0x41df4f,_0x380038[_0xe9a3('0x16')][_0xe9a3('0x18')]);return _0x4fcf3c(_0x380038['error'][_0xe9a3('0x18')]);}logger[_0xe9a3('0x16')](_0xe9a3('0x17'),_0x41df4f,_0x380038['error'][_0xe9a3('0x18')]);return _0x4ffaf4(_0x380038[_0xe9a3('0x16')][_0xe9a3('0x18')]);}else{logger[_0xe9a3('0x11')](_0xe9a3('0x17'),_0x41df4f,_0xe9a3('0x14'));_0x4ffaf4(_0x380038[_0xe9a3('0x19')][_0xe9a3('0x18')]);}})[_0xe9a3('0x1a')](function(_0x5df7e4){logger[_0xe9a3('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x41df4f,_0x5df7e4);_0x4fcf3c(_0x5df7e4);});});}exports['UpdateChatInteraction']=function(_0x25db66){var _0x1049da=this;return new Promise(function(_0x5d4fbd,_0x5c1ec4){return db[_0xe9a3('0x1b')][_0xe9a3('0x1c')](_0x25db66['body'],{'raw':_0x25db66['options']?_0x25db66[_0xe9a3('0x1d')][_0xe9a3('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25db66[_0xe9a3('0x1d')]?_0x25db66[_0xe9a3('0x1d')]['where']||null:null,'attributes':_0x25db66[_0xe9a3('0x1d')]?_0x25db66[_0xe9a3('0x1d')]['attributes']||null:null,'limit':_0x25db66[_0xe9a3('0x1d')]?_0x25db66['options'][_0xe9a3('0x1f')]||null:null})[_0xe9a3('0x10')](function(_0x44ecaf){logger[_0xe9a3('0x11')](_0xe9a3('0x20'),_0x25db66);logger['debug']('UpdateChatInteraction',_0x25db66,JSON[_0xe9a3('0x15')](_0x44ecaf));_0x5d4fbd(_0x44ecaf);})[_0xe9a3('0x1a')](function(_0x451f5a){logger[_0xe9a3('0x16')](_0xe9a3('0x20'),_0x451f5a['message'],_0x25db66);_0x5c1ec4(_0x1049da['error'](0x1f4,_0x451f5a[_0xe9a3('0x18')]));});});};exports['AddTagsToChatInteraction']=function(_0x8d28a8){return new Promise(function(_0x1ce1b5,_0x4d34b9){return db['ChatInteraction'][_0xe9a3('0x21')]({'where':_0x8d28a8['options']?_0x8d28a8['options'][_0xe9a3('0x22')]||null:null})[_0xe9a3('0x10')](function(_0x33f978){if(_0x33f978){return _0x33f978['addTags'](_0x8d28a8[_0xe9a3('0x23')][_0xe9a3('0x24')],_[_0xe9a3('0x25')](_0x8d28a8[_0xe9a3('0x23')],['ids','id'])||{});}})[_0xe9a3('0x26')](function(_0x31d285){logger[_0xe9a3('0x11')](_0xe9a3('0x27'),_0x8d28a8);logger[_0xe9a3('0x12')](_0xe9a3('0x27'),_0x8d28a8,JSON[_0xe9a3('0x15')](_0x31d285));_0x1ce1b5(_0x31d285);})[_0xe9a3('0x1a')](function(_0x2b17e4){logger[_0xe9a3('0x16')](_0xe9a3('0x27'),_0x2b17e4['message'],_0x8d28a8);_0x4d34b9(_this[_0xe9a3('0x16')](0x1f4,_0x2b17e4['message']));});});}; \ No newline at end of file +var _0x96e0=['rpc','../../config/environment','jayson/promise','client','redis','./chatInteraction.socket','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','body','options','attributes','AddTagsToChatInteraction','ids','spread','AddTags','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x223b34,_0xd55c31){var _0x3e3be7=function(_0x5acea8){while(--_0x5acea8){_0x223b34['push'](_0x223b34['shift']());}};_0x3e3be7(++_0xd55c31);}(_0x96e0,0x10a));var _0x096e=function(_0x30d977,_0x44123a){_0x30d977=_0x30d977-0x0;var _0x305955=_0x96e0[_0x30d977];return _0x305955;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x096e('0x0'));var BPromise=require(_0x096e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x096e('0x2'));var db=require(_0x096e('0x3'))['db'];var utils=require(_0x096e('0x4'));var logger=require(_0x096e('0x5'))(_0x096e('0x6'));var config=require(_0x096e('0x7'));var jayson=require(_0x096e('0x8'));var client=jayson[_0x096e('0x9')]['http']({'port':0x232a});config[_0x096e('0xa')]=_['defaults'](config[_0x096e('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x096e('0xb'))['register'](socket);function respondWithRpcPromise(_0x3c6ee9,_0x549af7,_0x3f74a5){return new BPromise(function(_0x53d779,_0x524568){return client[_0x096e('0xc')](_0x3c6ee9,_0x3f74a5)[_0x096e('0xd')](function(_0x27e84c){logger[_0x096e('0xe')](_0x096e('0xf'),_0x549af7,_0x096e('0x10'));logger[_0x096e('0x11')](_0x096e('0x12'),_0x549af7,'request\x20sent',JSON[_0x096e('0x13')](_0x27e84c));if(_0x27e84c['error']){if(_0x27e84c[_0x096e('0x14')][_0x096e('0x15')]===0x1f4){logger[_0x096e('0x14')](_0x096e('0xf'),_0x549af7,_0x27e84c[_0x096e('0x14')][_0x096e('0x16')]);return _0x524568(_0x27e84c[_0x096e('0x14')][_0x096e('0x16')]);}logger[_0x096e('0x14')](_0x096e('0xf'),_0x549af7,_0x27e84c['error'][_0x096e('0x16')]);return _0x53d779(_0x27e84c['error'][_0x096e('0x16')]);}else{logger[_0x096e('0xe')](_0x096e('0xf'),_0x549af7,'request\x20sent');_0x53d779(_0x27e84c[_0x096e('0x17')][_0x096e('0x16')]);}})[_0x096e('0x18')](function(_0x2cbc9b){logger['error'](_0x096e('0xf'),_0x549af7,_0x2cbc9b);_0x524568(_0x2cbc9b);});});}exports[_0x096e('0x19')]=function(_0x1809a1){var _0x5d013b=this;return new Promise(function(_0x49fb79,_0x264f1c){return db[_0x096e('0x1a')]['update'](_0x1809a1[_0x096e('0x1b')],{'raw':_0x1809a1[_0x096e('0x1c')]?_0x1809a1['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1809a1['options']?_0x1809a1['options']['where']||null:null,'attributes':_0x1809a1[_0x096e('0x1c')]?_0x1809a1[_0x096e('0x1c')][_0x096e('0x1d')]||null:null,'limit':_0x1809a1[_0x096e('0x1c')]?_0x1809a1[_0x096e('0x1c')]['limit']||null:null})[_0x096e('0xd')](function(_0x46dfc6){logger[_0x096e('0xe')](_0x096e('0x19'),_0x1809a1);logger['debug'](_0x096e('0x19'),_0x1809a1,JSON['stringify'](_0x46dfc6));_0x49fb79(_0x46dfc6);})['catch'](function(_0x5b532e){logger[_0x096e('0x14')](_0x096e('0x19'),_0x5b532e[_0x096e('0x16')],_0x1809a1);_0x264f1c(_0x5d013b['error'](0x1f4,_0x5b532e[_0x096e('0x16')]));});});};exports[_0x096e('0x1e')]=function(_0x1fb731){return new Promise(function(_0x161f12,_0x5aac5c){return db['ChatInteraction']['find']({'where':_0x1fb731[_0x096e('0x1c')]?_0x1fb731[_0x096e('0x1c')]['where']||null:null})[_0x096e('0xd')](function(_0x42da32){if(_0x42da32){return _0x42da32['addTags'](_0x1fb731[_0x096e('0x1b')][_0x096e('0x1f')],_['omit'](_0x1fb731[_0x096e('0x1b')],['ids','id'])||{});}})[_0x096e('0x20')](function(_0x3b343f){logger[_0x096e('0xe')]('AddTags',_0x1fb731);logger['debug'](_0x096e('0x21'),_0x1fb731,JSON['stringify'](_0x3b343f));_0x161f12(_0x3b343f);})[_0x096e('0x18')](function(_0x48d885){logger['error'](_0x096e('0x21'),_0x48d885[_0x096e('0x16')],_0x1fb731);_0x5aac5c(_this[_0x096e('0x14')](0x1f4,_0x48d885[_0x096e('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 16a52c8..3a0d074 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 _0x9466=['remove','removeListener','register','length','chatInteraction:','save'];(function(_0x26b0d9,_0x19c4ce){var _0x237795=function(_0x384ae4){while(--_0x384ae4){_0x26b0d9['push'](_0x26b0d9['shift']());}};_0x237795(++_0x19c4ce);}(_0x9466,0x161));var _0x6946=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x9466[_0x4792c8];return _0x35edb1;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x6946('0x0'),_0x6946('0x1'),'update'];function createListener(_0x5be013,_0x3f376b){return function(_0x561501){_0x3f376b['emit'](_0x5be013,_0x561501);};}function removeListener(_0x584506,_0x40683e){return function(){ChatInteractionEvents[_0x6946('0x2')](_0x584506,_0x40683e);};}exports[_0x6946('0x3')]=function(_0x540da7){for(var _0x389633=0x0,_0x3db051=events[_0x6946('0x4')];_0x389633<_0x3db051;_0x389633++){var _0xe66426=events[_0x389633];var _0xdd5e79=createListener(_0x6946('0x5')+_0xe66426,_0x540da7);ChatInteractionEvents['on'](_0xe66426,_0xdd5e79);}}; \ No newline at end of file +var _0xc884=['remove','update','removeListener','length','./chatInteraction.events'];(function(_0x2ed02c,_0x5386f9){var _0x113f27=function(_0x354b0a){while(--_0x354b0a){_0x2ed02c['push'](_0x2ed02c['shift']());}};_0x113f27(++_0x5386f9);}(_0xc884,0x130));var _0x4c88=function(_0x596524,_0x495428){_0x596524=_0x596524-0x0;var _0x235d59=_0xc884[_0x596524];return _0x235d59;};'use strict';var ChatInteractionEvents=require(_0x4c88('0x0'));var events=['save',_0x4c88('0x1'),_0x4c88('0x2')];function createListener(_0x3125ab,_0x1098ed){return function(_0x547e17){_0x1098ed['emit'](_0x3125ab,_0x547e17);};}function removeListener(_0x4dba2d,_0x2eb28e){return function(){ChatInteractionEvents[_0x4c88('0x3')](_0x4dba2d,_0x2eb28e);};}exports['register']=function(_0x4a2797){for(var _0x33b783=0x0,_0x559157=events[_0x4c88('0x4')];_0x33b783<_0x559157;_0x33b783++){var _0x29bd5e=events[_0x33b783];var _0x3a0403=createListener('chatInteraction:'+_0x29bd5e,_0x4a2797);ChatInteractionEvents['on'](_0x29bd5e,_0x3a0403);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index c615817..b761104 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 _0x1a1b=['addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','/:id/abandon','abandon','chatinteraction:destroy','destroy','delete','removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','/:id/attachment_upload','file','attachmentUpload'];(function(_0x5d9db1,_0xbca50f){var _0x48a92e=function(_0x226ed1){while(--_0x226ed1){_0x5d9db1['push'](_0x5d9db1['shift']());}};_0x48a92e(++_0xbca50f);}(_0x1a1b,0xe9));var _0xb1a1=function(_0x55ec91,_0x5b5514){_0x55ec91=_0x55ec91-0x0;var _0x65451a=_0x1a1b[_0x55ec91];return _0x65451a;};'use strict';var multer=require(_0xb1a1('0x0'));var util=require('util');var path=require(_0xb1a1('0x1'));var timeout=require(_0xb1a1('0x2'));var express=require(_0xb1a1('0x3'));var router=express[_0xb1a1('0x4')]();var fs_extra=require(_0xb1a1('0x5'));var auth=require(_0xb1a1('0x6'));var interaction=require(_0xb1a1('0x7'));var config=require(_0xb1a1('0x8'));var controller=require(_0xb1a1('0x9'));router[_0xb1a1('0xa')]('/',auth[_0xb1a1('0xb')](),controller[_0xb1a1('0xc')]);router[_0xb1a1('0xa')]('/describe',auth[_0xb1a1('0xb')](),controller[_0xb1a1('0xd')]);router[_0xb1a1('0xa')](_0xb1a1('0xe'),auth[_0xb1a1('0xf')](),controller['show']);router[_0xb1a1('0xa')](_0xb1a1('0x10'),auth[_0xb1a1('0xf')](),controller[_0xb1a1('0x11')]);router['get'](_0xb1a1('0x12'),auth[_0xb1a1('0xb')](),controller[_0xb1a1('0x13')]);router[_0xb1a1('0xa')](_0xb1a1('0x14'),auth[_0xb1a1('0xf')](),controller['getMyMessages']);router['get'](_0xb1a1('0x15'),auth[_0xb1a1('0xb')](),controller['download']);router[_0xb1a1('0x16')]('/',auth[_0xb1a1('0xb')](),controller[_0xb1a1('0x17')]);router[_0xb1a1('0x16')](_0xb1a1('0x18'),auth['isAuthenticated'](),controller[_0xb1a1('0x19')]);var upload=multer({'storage':multer[_0xb1a1('0x1a')]({'destination':function(_0x20cb3b,_0x2c924a,_0x2aa511){_0x2aa511(null,path[_0xb1a1('0x1b')](config[_0xb1a1('0x1c')],_0xb1a1('0x1d')));},'filename':function(_0x236274,_0xb2aea0,_0x1da5a0){_0x1da5a0(null,util[_0xb1a1('0x1e')](_0xb1a1('0x1f'),Date[_0xb1a1('0x20')](),_0xb2aea0[_0xb1a1('0x21')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xb1a1('0x16')](_0xb1a1('0x22'),upload['single'](_0xb1a1('0x23')),controller[_0xb1a1('0x24')]);router[_0xb1a1('0x16')](_0xb1a1('0x12'),auth[_0xb1a1('0xf')](),controller[_0xb1a1('0x25')]);router['post'](_0xb1a1('0x26'),auth[_0xb1a1('0xb')](),interaction[_0xb1a1('0x27')](_0xb1a1('0x28'),_0xb1a1('0x29')),controller[_0xb1a1('0x2a')]);router[_0xb1a1('0x2b')]('/:id',auth[_0xb1a1('0xb')](),interaction['tracked'](_0xb1a1('0x28'),_0xb1a1('0x2c')),controller[_0xb1a1('0x2d')]);router[_0xb1a1('0x2b')](_0xb1a1('0x2e'),controller['customUpdate']);router[_0xb1a1('0x2b')](_0xb1a1('0x2f'),auth[_0xb1a1('0xf')](),controller[_0xb1a1('0x30')]);router[_0xb1a1('0x2b')]('/:id/close',controller['close']);router['delete']('/:id',auth[_0xb1a1('0xb')](),interaction[_0xb1a1('0x27')](_0xb1a1('0x28'),_0xb1a1('0x31')),controller[_0xb1a1('0x32')]);router[_0xb1a1('0x33')]('/:id/tags',auth[_0xb1a1('0xb')](),controller[_0xb1a1('0x34')]);module[_0xb1a1('0x35')]=router; \ No newline at end of file +var _0xf736=['close','delete','chatinteraction:destroy','removeTags','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','index','/describe','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','isAuthenticated','post','create','/:id/vidaoo','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon','abandon'];(function(_0x3d9fb9,_0x120e76){var _0x5ea49a=function(_0x5ee7e3){while(--_0x5ee7e3){_0x3d9fb9['push'](_0x3d9fb9['shift']());}};_0x5ea49a(++_0x120e76);}(_0xf736,0x6a));var _0x6f73=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf736[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x6f73('0x0'));var path=require(_0x6f73('0x1'));var timeout=require('connect-timeout');var express=require(_0x6f73('0x2'));var router=express['Router']();var fs_extra=require(_0x6f73('0x3'));var auth=require(_0x6f73('0x4'));var interaction=require(_0x6f73('0x5'));var config=require(_0x6f73('0x6'));var controller=require(_0x6f73('0x7'));router[_0x6f73('0x8')]('/',auth['isAuthenticated'](),controller[_0x6f73('0x9')]);router['get'](_0x6f73('0xa'),auth['isAuthenticated'](),controller[_0x6f73('0xb')]);router['get'](_0x6f73('0xc'),auth[_0x6f73('0xd')](),controller['show']);router['get'](_0x6f73('0xe'),auth[_0x6f73('0xd')](),controller['attachmentDownload']);router[_0x6f73('0x8')](_0x6f73('0xf'),auth['isAuthenticated'](),controller[_0x6f73('0x10')]);router[_0x6f73('0x8')](_0x6f73('0x11'),auth[_0x6f73('0xd')](),controller[_0x6f73('0x12')]);router['get'](_0x6f73('0x13'),auth[_0x6f73('0x14')](),controller['download']);router[_0x6f73('0x15')]('/',auth['isAuthenticated'](),controller[_0x6f73('0x16')]);router[_0x6f73('0x15')](_0x6f73('0x17'),auth['isAuthenticated'](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x6f73('0x18')]({'destination':function(_0x172edc,_0xc49e0f,_0x2f11ab){_0x2f11ab(null,path[_0x6f73('0x19')](config[_0x6f73('0x1a')],_0x6f73('0x1b')));},'filename':function(_0x53e4be,_0x4b3a10,_0x3ec0e6){_0x3ec0e6(null,util[_0x6f73('0x1c')](_0x6f73('0x1d'),Date[_0x6f73('0x1e')](),_0x4b3a10[_0x6f73('0x1f')][_0x6f73('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x6f73('0x15')](_0x6f73('0x21'),upload['single'](_0x6f73('0x22')),controller[_0x6f73('0x23')]);router[_0x6f73('0x15')](_0x6f73('0xf'),auth['isChatInteractionAuthorized'](),controller[_0x6f73('0x24')]);router[_0x6f73('0x15')](_0x6f73('0x25'),auth[_0x6f73('0x14')](),interaction[_0x6f73('0x26')](_0x6f73('0x27'),_0x6f73('0x28')),controller['addTags']);router[_0x6f73('0x29')](_0x6f73('0xc'),auth['isAuthenticated'](),interaction['tracked'](_0x6f73('0x27'),_0x6f73('0x2a')),controller['update']);router['put'](_0x6f73('0x2b'),controller[_0x6f73('0x2c')]);router['put'](_0x6f73('0x2d'),auth[_0x6f73('0xd')](),controller[_0x6f73('0x2e')]);router['put']('/:id/close',controller[_0x6f73('0x2f')]);router[_0x6f73('0x30')](_0x6f73('0xc'),auth[_0x6f73('0x14')](),interaction[_0x6f73('0x26')]('chat',_0x6f73('0x31')),controller['destroy']);router[_0x6f73('0x30')]('/:id/tags',auth[_0x6f73('0x14')](),controller[_0x6f73('0x32')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index fe299b1..2417eba 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 _0xb83c=['exports','medium','BOOLEAN','INTEGER','sequelize'];(function(_0x5ba46a,_0x582fe0){var _0x5cbf4f=function(_0x22349b){while(--_0x22349b){_0x5ba46a['push'](_0x5ba46a['shift']());}};_0x5cbf4f(++_0x582fe0);}(_0xb83c,0xf4));var _0xcb83=function(_0x1ae109,_0x58f4e2){_0x1ae109=_0x1ae109-0x0;var _0x2c43a8=_0xb83c[_0x1ae109];return _0x2c43a8;};'use strict';var Sequelize=require(_0xcb83('0x0'));module[_0xcb83('0x1')]={'body':{'type':Sequelize['TEXT'](_0xcb83('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xcb83('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xcb83('0x4')]}}; \ No newline at end of file +var _0xcef9=['TEXT','BOOLEAN','INTEGER','exports'];(function(_0xe1e09c,_0x46a516){var _0x3b577e=function(_0x1450ab){while(--_0x1450ab){_0xe1e09c['push'](_0xe1e09c['shift']());}};_0x3b577e(++_0x46a516);}(_0xcef9,0x19b));var _0x9cef=function(_0x52d9d8,_0x5ce859){_0x52d9d8=_0x52d9d8-0x0;var _0x2cabd0=_0xcef9[_0x52d9d8];return _0x2cabd0;};'use strict';var Sequelize=require('sequelize');module[_0x9cef('0x0')]={'body':{'type':Sequelize[_0x9cef('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x9cef('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x9cef('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 903f0eb..dd862c5 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 _0x61b2=['desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','length','merge','options','find','create','body','update','describe','get','messages','createdAt','lastMessage','lastMessageAt','getUsers','User','admin','user','fullname','userpic','internal','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Agents','userProfileId','autoAssociation','UserProfileResource','agent','resourceId','push','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x560d66,_0xf86af7){var _0x1a7191=function(_0x47fdbc){while(--_0x47fdbc){_0x560d66['push'](_0x560d66['shift']());}};_0x1a7191(++_0xf86af7);}(_0x61b2,0x14c));var _0x261b=function(_0x58f1c8,_0x57c90f){_0x58f1c8=_0x58f1c8-0x0;var _0x37af32=_0x61b2[_0x58f1c8];return _0x37af32;};'use strict';var emlformat=require(_0x261b('0x0'));var rimraf=require(_0x261b('0x1'));var zipdir=require(_0x261b('0x2'));var jsonpatch=require(_0x261b('0x3'));var rp=require('request-promise');var moment=require(_0x261b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x261b('0x5'));var path=require(_0x261b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x261b('0x7'));var fs=require('fs');var fs_extra=require(_0x261b('0x8'));var _=require(_0x261b('0x9'));var squel=require(_0x261b('0xa'));var crypto=require(_0x261b('0xb'));var jsforce=require(_0x261b('0xc'));var deskjs=require(_0x261b('0xd'));var toCsv=require(_0x261b('0xe'));var querystring=require(_0x261b('0xf'));var Papa=require(_0x261b('0x10'));var Redis=require(_0x261b('0x11'));var authService=require(_0x261b('0x12'));var qs=require(_0x261b('0x13'));var as=require(_0x261b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x261b('0x15'));var utils=require(_0x261b('0x16'));var config=require(_0x261b('0x17'));var licenseUtil=require(_0x261b('0x18'));var db=require('../../mysqldb')['db'];config[_0x261b('0x19')]=_['defaults'](config[_0x261b('0x19')],{'host':_0x261b('0x1a'),'port':0x18eb});var socket=require(_0x261b('0x1b'))(new Redis(config['redis']));require(_0x261b('0x1c'))['register'](socket);function respondWithStatusCode(_0x5598d6,_0x1d56c4){_0x1d56c4=_0x1d56c4||0xcc;return function(_0x2d5abf){if(_0x2d5abf){return _0x5598d6[_0x261b('0x1d')](_0x1d56c4);}return _0x5598d6[_0x261b('0x1e')](_0x1d56c4)[_0x261b('0x1f')]();};}function respondWithResult(_0x221cad,_0x7e9e1){_0x7e9e1=_0x7e9e1||0xc8;return function(_0x342589){if(_0x342589){return _0x221cad[_0x261b('0x1e')](_0x7e9e1)['json'](_0x342589);}};}function respondWithFilteredResult(_0x55913a,_0x31b245){return function(_0x52bf0d){if(_0x52bf0d){var _0x57dcc5=typeof _0x31b245[_0x261b('0x20')]===_0x261b('0x21')&&typeof _0x31b245[_0x261b('0x22')]==='undefined';var _0x2ec0da=_0x52bf0d[_0x261b('0x23')];var _0x4fa087=_0x57dcc5?0x0:_0x31b245['offset'];var _0x5a10d3=_0x57dcc5?_0x52bf0d[_0x261b('0x23')]:_0x31b245['offset']+_0x31b245[_0x261b('0x22')];var _0x1407e1;if(_0x5a10d3>=_0x2ec0da){_0x5a10d3=_0x2ec0da;_0x1407e1=0xc8;}else{_0x1407e1=0xce;}_0x55913a[_0x261b('0x1e')](_0x1407e1);return _0x55913a[_0x261b('0x24')](_0x261b('0x25'),_0x4fa087+'-'+_0x5a10d3+'/'+_0x2ec0da)[_0x261b('0x26')](_0x52bf0d);}return null;};}function patchUpdates(_0x2dd36a){return function(_0x49d8a7){try{jsonpatch[_0x261b('0x27')](_0x49d8a7,_0x2dd36a,!![]);}catch(_0x4aa316){return BPromise[_0x261b('0x28')](_0x4aa316);}return _0x49d8a7[_0x261b('0x29')]();};}function saveUpdates(_0xeb9993,_0x4471ff){return function(_0x2719c9){if(_0x2719c9){return _0x2719c9['update'](_0xeb9993)[_0x261b('0x2a')](function(_0x3e62e4){return _0x3e62e4;});}return null;};}function removeEntity(_0x1576fa,_0x1b2421){return function(_0x1a1ee5){if(_0x1a1ee5){return _0x1a1ee5[_0x261b('0x2b')]()[_0x261b('0x2a')](function(){_0x1576fa[_0x261b('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x534eae,_0x3d24e2){return function(_0x5c115b){if(!_0x5c115b){_0x534eae['sendStatus'](0x194);}return _0x5c115b;};}function handleError(_0x4425ef,_0x2219c6){_0x2219c6=_0x2219c6||0x1f4;return function(_0x1525a9){logger[_0x261b('0x2c')](_0x1525a9[_0x261b('0x2d')]);if(_0x1525a9['name']){delete _0x1525a9[_0x261b('0x2e')];}_0x4425ef[_0x261b('0x1e')](_0x2219c6)[_0x261b('0x2f')](_0x1525a9);};}exports[_0x261b('0x30')]=function(_0x2cbd11,_0xd11853){var _0x47ed4b={},_0x1547c1={},_0x31aea9={'count':0x0,'rows':[]};var _0x193298=_[_0x261b('0x31')](db[_0x261b('0x32')][_0x261b('0x33')],function(_0x496773){return{'name':_0x496773['fieldName'],'type':_0x496773[_0x261b('0x34')][_0x261b('0x35')]};});_0x1547c1['model']=_[_0x261b('0x31')](_0x193298,'name');_0x1547c1[_0x261b('0x36')]=_[_0x261b('0x37')](_0x2cbd11['query']);_0x1547c1[_0x261b('0x38')]=_[_0x261b('0x39')](_0x1547c1['model'],_0x1547c1[_0x261b('0x36')]);_0x47ed4b['attributes']=_['intersection'](_0x1547c1[_0x261b('0x3a')],qs[_0x261b('0x3b')](_0x2cbd11[_0x261b('0x36')]['fields']));_0x47ed4b[_0x261b('0x3c')]=_0x47ed4b[_0x261b('0x3c')]['length']?_0x47ed4b['attributes']:_0x1547c1[_0x261b('0x3a')];if(!_0x2cbd11[_0x261b('0x36')][_0x261b('0x3d')](_0x261b('0x3e'))){_0x47ed4b['limit']=qs[_0x261b('0x22')](_0x2cbd11[_0x261b('0x36')]['limit']);_0x47ed4b['offset']=qs[_0x261b('0x20')](_0x2cbd11[_0x261b('0x36')][_0x261b('0x20')]);}_0x47ed4b[_0x261b('0x3f')]=qs[_0x261b('0x40')](_0x2cbd11[_0x261b('0x36')][_0x261b('0x40')]);_0x47ed4b[_0x261b('0x41')]=qs[_0x261b('0x38')](_[_0x261b('0x42')](_0x2cbd11[_0x261b('0x36')],_0x1547c1['filters']),_0x193298);if(_0x2cbd11[_0x261b('0x36')]['filter']){_0x47ed4b['where']=_['merge'](_0x47ed4b[_0x261b('0x41')],{'$or':_[_0x261b('0x31')](_0x193298,function(_0x169631){if(_0x169631[_0x261b('0x34')]!==_0x261b('0x43')){var _0xb09f4d={};_0xb09f4d[_0x169631['name']]={'$like':'%'+_0x2cbd11[_0x261b('0x36')][_0x261b('0x44')]+'%'};return _0xb09f4d;}})});}_0x47ed4b=_['merge']({},_0x47ed4b,_0x2cbd11['options']);var _0x9e591b={'where':_0x47ed4b[_0x261b('0x41')]};return db[_0x261b('0x32')][_0x261b('0x23')](_0x9e591b)['then'](function(_0x3e8602){_0x31aea9[_0x261b('0x23')]=_0x3e8602;if(_0x2cbd11['query'][_0x261b('0x45')]){_0x47ed4b[_0x261b('0x46')]=[{'all':!![]}];}return db[_0x261b('0x32')][_0x261b('0x47')](_0x47ed4b);})[_0x261b('0x2a')](function(_0x5c92d3){_0x31aea9[_0x261b('0x48')]=_0x5c92d3;return _0x31aea9;})[_0x261b('0x2a')](respondWithFilteredResult(_0xd11853,_0x47ed4b))[_0x261b('0x49')](handleError(_0xd11853,null));};exports[_0x261b('0x4a')]=function(_0x1be65e,_0x252b5a){var _0x2160c6={'raw':!![],'where':{'id':_0x1be65e[_0x261b('0x4b')]['id']}},_0x42d8b2={};_0x42d8b2[_0x261b('0x3a')]=_[_0x261b('0x37')](db['ChatInternalMessage'][_0x261b('0x33')]);_0x42d8b2[_0x261b('0x36')]=_[_0x261b('0x37')](_0x1be65e['query']);_0x42d8b2[_0x261b('0x38')]=_[_0x261b('0x39')](_0x42d8b2[_0x261b('0x3a')],_0x42d8b2[_0x261b('0x36')]);_0x2160c6[_0x261b('0x3c')]=_['intersection'](_0x42d8b2[_0x261b('0x3a')],qs[_0x261b('0x3b')](_0x1be65e['query']['fields']));_0x2160c6[_0x261b('0x3c')]=_0x2160c6['attributes'][_0x261b('0x4c')]?_0x2160c6['attributes']:_0x42d8b2['model'];if(_0x1be65e[_0x261b('0x36')]['includeAll']){_0x2160c6['include']=[{'all':!![]}];}_0x2160c6=_[_0x261b('0x4d')]({},_0x2160c6,_0x1be65e[_0x261b('0x4e')]);return db['ChatInternalMessage'][_0x261b('0x4f')](_0x2160c6)[_0x261b('0x2a')](handleEntityNotFound(_0x252b5a,null))[_0x261b('0x2a')](respondWithResult(_0x252b5a,null))[_0x261b('0x49')](handleError(_0x252b5a,null));};exports[_0x261b('0x50')]=function(_0x47d53d,_0x2fd6a4){return db[_0x261b('0x32')][_0x261b('0x50')](_0x47d53d[_0x261b('0x51')],{})[_0x261b('0x2a')](respondWithResult(_0x2fd6a4,0xc9))[_0x261b('0x49')](handleError(_0x2fd6a4,null));};exports[_0x261b('0x52')]=function(_0x281814,_0x414026){if(_0x281814['body']['id']){delete _0x281814['body']['id'];}return db[_0x261b('0x32')][_0x261b('0x4f')]({'where':{'id':_0x281814[_0x261b('0x4b')]['id']}})[_0x261b('0x2a')](handleEntityNotFound(_0x414026,null))['then'](saveUpdates(_0x281814[_0x261b('0x51')],null))[_0x261b('0x2a')](respondWithResult(_0x414026,null))['catch'](handleError(_0x414026,null));};exports[_0x261b('0x2b')]=function(_0x7c4843,_0x11a0b5){return db[_0x261b('0x32')]['find']({'where':{'id':_0x7c4843[_0x261b('0x4b')]['id']}})[_0x261b('0x2a')](handleEntityNotFound(_0x11a0b5,null))[_0x261b('0x2a')](removeEntity(_0x11a0b5,null))[_0x261b('0x49')](handleError(_0x11a0b5,null));};exports[_0x261b('0x53')]=function(_0x566bbb,_0x2afb7b){return db[_0x261b('0x32')]['describe']()[_0x261b('0x2a')](respondWithResult(_0x2afb7b,null))[_0x261b('0x49')](handleError(_0x2afb7b,null));};function wrapUser(_0x36c874){return function(_0x2ab891){var _0x4c1466=_0x36c874[_0x261b('0x54')]({'plain':!![]});_0x4c1466[_0x261b('0x55')]=[];if(_0x2ab891){_0x4c1466['lastMessageAt']=_0x2ab891[_0x261b('0x56')];_0x4c1466[_0x261b('0x57')]=_0x2ab891;}else{_0x4c1466[_0x261b('0x58')]=moment(0x0)['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4c1466[_0x261b('0x57')]={};}return _0x4c1466;};}exports[_0x261b('0x59')]=function(_0x59d31f,_0xb12d82,_0x11c44f){var _0x408c55=[];return db[_0x261b('0x5a')][_0x261b('0x47')]({'where':{'role':['agent',_0x261b('0x5b'),_0x261b('0x5c')]},'attributes':['id',_0x261b('0x5d'),'name','role',_0x261b('0x5e'),_0x261b('0x5f'),'online',_0x261b('0x60'),_0x261b('0x61'),_0x261b('0x62')],'order':qs[_0x261b('0x40')](_0x261b('0x63')),'include':[{'model':db['VoiceQueue'],'as':_0x261b('0x64'),'attributes':['id',_0x261b('0x2e'),_0x261b('0x34')],'through':{'attributes':[]}}]})[_0x261b('0x2a')](function(_0x5c6443){if(_0x5c6443){var _0x46902b=_0x59d31f[_0x261b('0x5c')]['get']({'plain':!![]});if(!_0x46902b)throw new Error(_0x261b('0x65'));if(_0x46902b[_0x261b('0x66')]==='user'){return db['UserProfileSection'][_0x261b('0x4f')]({'where':{'name':_0x261b('0x67'),'userProfileId':_0x46902b[_0x261b('0x68')]},'raw':!![]})[_0x261b('0x2a')](function(_0x280ab0){if(_0x280ab0){if(_0x280ab0[_0x261b('0x69')]===0x0){return db[_0x261b('0x6a')][_0x261b('0x47')]({'where':{'sectionId':_0x280ab0['id']},'raw':!![]})['then'](function(_0x5006d7){var _0x3d4330=[];if(_['isEmpty'](_0x5006d7)){_0x3d4330=_[_0x261b('0x44')](_0x5c6443,function(_0x1039ad){if(_0x1039ad['role']!==_0x261b('0x6b')){return _0x1039ad;}});return _0x3d4330;}else{for(var _0x25a072=0x0;_0x25a072<_0x5c6443[_0x261b('0x4c')];_0x25a072++){var _0x5746cb=_0x5c6443[_0x25a072];if(_0x5746cb['role']===_0x261b('0x6b')){var _0x236ea7=_[_0x261b('0x4f')](_0x5006d7,function(_0x3d26e2){return _0x3d26e2[_0x261b('0x6c')]===_0x5746cb['id'];});if(_0x236ea7)_0x3d4330[_0x261b('0x6d')](_0x5746cb);}else{_0x3d4330[_0x261b('0x6d')](_0x5746cb);}}return _0x3d4330;}});}else{return _0x5c6443;}}else{var _0x4dcc81=_['filter'](_0x5c6443,function(_0x468915){if(_0x468915[_0x261b('0x66')]!==_0x261b('0x6b')){return _0x468915;}});return _0x4dcc81;}});}else{return _0x5c6443;}}})['then'](function(_0x40a5fd){var _0x3faa1a=[];if(_0x40a5fd){_0x408c55=_0x40a5fd;for(var _0x5a8780=0x0;_0x5a8780<_0x40a5fd[_0x261b('0x4c')];_0x5a8780+=0x1){_0x408c55[_0x5a8780][_0x261b('0x55')]=[];_0x3faa1a[_0x261b('0x6d')](db['ChatInternalMessage'][_0x261b('0x4f')]({'where':{'FromId':[_0x59d31f[_0x261b('0x5c')]['id'],_0x40a5fd[_0x5a8780]['id']],'ToId':[_0x59d31f[_0x261b('0x5c')]['id'],_0x40a5fd[_0x5a8780]['id']],'ChatGroupId':null},'attributes':['id',_0x261b('0x56'),_0x261b('0x6e'),_0x261b('0x6f'),_0x261b('0x70'),_0x261b('0x51')],'order':qs[_0x261b('0x40')](_0x261b('0x71')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x261b('0x2a')](wrapUser(_0x40a5fd[_0x5a8780])));}return BPromise[_0x261b('0x72')](_0x3faa1a);}return[];})[_0x261b('0x2a')](function(_0x250b8c){return{'rows':_0x250b8c,'count':_0x250b8c[_0x261b('0x4c')]};})[_0x261b('0x2a')](respondWithResult(_0xb12d82,null))[_0x261b('0x49')](handleError(_0xb12d82,null));}; \ No newline at end of file +var _0x144c=['findAll','rows','catch','show','params','keys','include','create','body','describe','get','messages','lastMessageAt','lastMessage','format','getUsers','agent','admin','fullname','role','userpic','internal','online','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','read','-createdAt','all','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','error','stack','name','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll'];(function(_0x5c4375,_0x2766c3){var _0x3369d6=function(_0x16da90){while(--_0x16da90){_0x5c4375['push'](_0x5c4375['shift']());}};_0x3369d6(++_0x2766c3);}(_0x144c,0x1db));var _0xc144=function(_0x4a6979,_0x5f3d1a){_0x4a6979=_0x4a6979-0x0;var _0x226f93=_0x144c[_0x4a6979];return _0x226f93;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc144('0x0'));var zipdir=require(_0xc144('0x1'));var jsonpatch=require(_0xc144('0x2'));var rp=require(_0xc144('0x3'));var moment=require(_0xc144('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc144('0x5'));var path=require('path');var sox=require(_0xc144('0x6'));var csv=require(_0xc144('0x7'));var ejs=require(_0xc144('0x8'));var fs=require('fs');var fs_extra=require(_0xc144('0x9'));var _=require(_0xc144('0xa'));var squel=require(_0xc144('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc144('0xc'));var toCsv=require('to-csv');var querystring=require(_0xc144('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc144('0xe'));var as=require(_0xc144('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc144('0x10'));var utils=require('../../config/utils');var config=require(_0xc144('0x11'));var licenseUtil=require(_0xc144('0x12'));var db=require(_0xc144('0x13'))['db'];config[_0xc144('0x14')]=_['defaults'](config[_0xc144('0x14')],{'host':_0xc144('0x15'),'port':0x18eb});var socket=require(_0xc144('0x16'))(new Redis(config[_0xc144('0x14')]));require(_0xc144('0x17'))[_0xc144('0x18')](socket);function respondWithStatusCode(_0x3fd113,_0x5a7040){_0x5a7040=_0x5a7040||0xcc;return function(_0x575b3d){if(_0x575b3d){return _0x3fd113[_0xc144('0x19')](_0x5a7040);}return _0x3fd113[_0xc144('0x1a')](_0x5a7040)[_0xc144('0x1b')]();};}function respondWithResult(_0x5a8613,_0x4132f5){_0x4132f5=_0x4132f5||0xc8;return function(_0x3f0044){if(_0x3f0044){return _0x5a8613[_0xc144('0x1a')](_0x4132f5)[_0xc144('0x1c')](_0x3f0044);}};}function respondWithFilteredResult(_0x5e0e65,_0x3b213e){return function(_0x34298b){if(_0x34298b){var _0xa1bc55=typeof _0x3b213e[_0xc144('0x1d')]===_0xc144('0x1e')&&typeof _0x3b213e[_0xc144('0x1f')]===_0xc144('0x1e');var _0x2a8c35=_0x34298b[_0xc144('0x20')];var _0x74dd68=_0xa1bc55?0x0:_0x3b213e[_0xc144('0x1d')];var _0x399966=_0xa1bc55?_0x34298b[_0xc144('0x20')]:_0x3b213e[_0xc144('0x1d')]+_0x3b213e[_0xc144('0x1f')];var _0x56351e;if(_0x399966>=_0x2a8c35){_0x399966=_0x2a8c35;_0x56351e=0xc8;}else{_0x56351e=0xce;}_0x5e0e65[_0xc144('0x1a')](_0x56351e);return _0x5e0e65['set'](_0xc144('0x21'),_0x74dd68+'-'+_0x399966+'/'+_0x2a8c35)[_0xc144('0x1c')](_0x34298b);}return null;};}function patchUpdates(_0x24e4cf){return function(_0x13d7b4){try{jsonpatch['apply'](_0x13d7b4,_0x24e4cf,!![]);}catch(_0x519320){return BPromise[_0xc144('0x22')](_0x519320);}return _0x13d7b4['save']();};}function saveUpdates(_0x462e4d,_0x8a1288){return function(_0x5d1fbe){if(_0x5d1fbe){return _0x5d1fbe[_0xc144('0x23')](_0x462e4d)[_0xc144('0x24')](function(_0x1fbc4d){return _0x1fbc4d;});}return null;};}function removeEntity(_0x509085,_0xd59706){return function(_0x59f257){if(_0x59f257){return _0x59f257[_0xc144('0x25')]()[_0xc144('0x24')](function(){_0x509085[_0xc144('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x393ed7,_0x1c8ec7){return function(_0x82c69d){if(!_0x82c69d){_0x393ed7[_0xc144('0x19')](0x194);}return _0x82c69d;};}function handleError(_0x30ce95,_0x150428){_0x150428=_0x150428||0x1f4;return function(_0x223f69){logger[_0xc144('0x26')](_0x223f69[_0xc144('0x27')]);if(_0x223f69[_0xc144('0x28')]){delete _0x223f69[_0xc144('0x28')];}_0x30ce95[_0xc144('0x1a')](_0x150428)['send'](_0x223f69);};}exports[_0xc144('0x29')]=function(_0x1aab71,_0x180c8c){var _0x288278={},_0x9b6e15={},_0x23201a={'count':0x0,'rows':[]};var _0x298589=_[_0xc144('0x2a')](db[_0xc144('0x2b')][_0xc144('0x2c')],function(_0x5cbefb){return{'name':_0x5cbefb[_0xc144('0x2d')],'type':_0x5cbefb[_0xc144('0x2e')][_0xc144('0x2f')]};});_0x9b6e15['model']=_[_0xc144('0x2a')](_0x298589,_0xc144('0x28'));_0x9b6e15[_0xc144('0x30')]=_['keys'](_0x1aab71[_0xc144('0x30')]);_0x9b6e15[_0xc144('0x31')]=_[_0xc144('0x32')](_0x9b6e15['model'],_0x9b6e15['query']);_0x288278[_0xc144('0x33')]=_[_0xc144('0x32')](_0x9b6e15[_0xc144('0x34')],qs[_0xc144('0x35')](_0x1aab71[_0xc144('0x30')][_0xc144('0x35')]));_0x288278['attributes']=_0x288278[_0xc144('0x33')][_0xc144('0x36')]?_0x288278[_0xc144('0x33')]:_0x9b6e15[_0xc144('0x34')];if(!_0x1aab71['query'][_0xc144('0x37')](_0xc144('0x38'))){_0x288278[_0xc144('0x1f')]=qs[_0xc144('0x1f')](_0x1aab71[_0xc144('0x30')]['limit']);_0x288278[_0xc144('0x1d')]=qs[_0xc144('0x1d')](_0x1aab71['query'][_0xc144('0x1d')]);}_0x288278[_0xc144('0x39')]=qs[_0xc144('0x3a')](_0x1aab71['query'][_0xc144('0x3a')]);_0x288278['where']=qs['filters'](_['pick'](_0x1aab71[_0xc144('0x30')],_0x9b6e15['filters']),_0x298589);if(_0x1aab71[_0xc144('0x30')]['filter']){_0x288278[_0xc144('0x3b')]=_[_0xc144('0x3c')](_0x288278['where'],{'$or':_['map'](_0x298589,function(_0x2081e1){if(_0x2081e1[_0xc144('0x2e')]!==_0xc144('0x3d')){var _0x1db020={};_0x1db020[_0x2081e1[_0xc144('0x28')]]={'$like':'%'+_0x1aab71['query'][_0xc144('0x3e')]+'%'};return _0x1db020;}})});}_0x288278=_[_0xc144('0x3c')]({},_0x288278,_0x1aab71[_0xc144('0x3f')]);var _0x227248={'where':_0x288278['where']};return db[_0xc144('0x2b')][_0xc144('0x20')](_0x227248)['then'](function(_0x5eaf3b){_0x23201a[_0xc144('0x20')]=_0x5eaf3b;if(_0x1aab71[_0xc144('0x30')][_0xc144('0x40')]){_0x288278['include']=[{'all':!![]}];}return db['ChatInternalMessage'][_0xc144('0x41')](_0x288278);})[_0xc144('0x24')](function(_0x4287dd){_0x23201a[_0xc144('0x42')]=_0x4287dd;return _0x23201a;})['then'](respondWithFilteredResult(_0x180c8c,_0x288278))[_0xc144('0x43')](handleError(_0x180c8c,null));};exports[_0xc144('0x44')]=function(_0x392e91,_0x6afec0){var _0x1901c8={'raw':!![],'where':{'id':_0x392e91[_0xc144('0x45')]['id']}},_0x1eaee3={};_0x1eaee3[_0xc144('0x34')]=_['keys'](db[_0xc144('0x2b')]['rawAttributes']);_0x1eaee3[_0xc144('0x30')]=_[_0xc144('0x46')](_0x392e91[_0xc144('0x30')]);_0x1eaee3[_0xc144('0x31')]=_['intersection'](_0x1eaee3[_0xc144('0x34')],_0x1eaee3['query']);_0x1901c8[_0xc144('0x33')]=_[_0xc144('0x32')](_0x1eaee3['model'],qs[_0xc144('0x35')](_0x392e91['query'][_0xc144('0x35')]));_0x1901c8['attributes']=_0x1901c8[_0xc144('0x33')][_0xc144('0x36')]?_0x1901c8[_0xc144('0x33')]:_0x1eaee3['model'];if(_0x392e91['query']['includeAll']){_0x1901c8[_0xc144('0x47')]=[{'all':!![]}];}_0x1901c8=_[_0xc144('0x3c')]({},_0x1901c8,_0x392e91[_0xc144('0x3f')]);return db[_0xc144('0x2b')]['find'](_0x1901c8)['then'](handleEntityNotFound(_0x6afec0,null))[_0xc144('0x24')](respondWithResult(_0x6afec0,null))[_0xc144('0x43')](handleError(_0x6afec0,null));};exports[_0xc144('0x48')]=function(_0x2909ac,_0x55aae1){return db[_0xc144('0x2b')]['create'](_0x2909ac[_0xc144('0x49')],{})[_0xc144('0x24')](respondWithResult(_0x55aae1,0xc9))[_0xc144('0x43')](handleError(_0x55aae1,null));};exports['update']=function(_0x320585,_0x2c6668){if(_0x320585['body']['id']){delete _0x320585['body']['id'];}return db[_0xc144('0x2b')]['find']({'where':{'id':_0x320585[_0xc144('0x45')]['id']}})[_0xc144('0x24')](handleEntityNotFound(_0x2c6668,null))[_0xc144('0x24')](saveUpdates(_0x320585['body'],null))[_0xc144('0x24')](respondWithResult(_0x2c6668,null))[_0xc144('0x43')](handleError(_0x2c6668,null));};exports['destroy']=function(_0x573d1e,_0x324a2f){return db['ChatInternalMessage']['find']({'where':{'id':_0x573d1e['params']['id']}})['then'](handleEntityNotFound(_0x324a2f,null))['then'](removeEntity(_0x324a2f,null))['catch'](handleError(_0x324a2f,null));};exports[_0xc144('0x4a')]=function(_0x353659,_0x8da6f7){return db[_0xc144('0x2b')][_0xc144('0x4a')]()['then'](respondWithResult(_0x8da6f7,null))['catch'](handleError(_0x8da6f7,null));};function wrapUser(_0x8fe6ee){return function(_0x13b7a5){var _0x4c0dbe=_0x8fe6ee[_0xc144('0x4b')]({'plain':!![]});_0x4c0dbe[_0xc144('0x4c')]=[];if(_0x13b7a5){_0x4c0dbe[_0xc144('0x4d')]=_0x13b7a5['createdAt'];_0x4c0dbe[_0xc144('0x4e')]=_0x13b7a5;}else{_0x4c0dbe[_0xc144('0x4d')]=moment(0x0)[_0xc144('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');_0x4c0dbe[_0xc144('0x4e')]={};}return _0x4c0dbe;};}exports[_0xc144('0x50')]=function(_0x21bdbe,_0x2b4d3e,_0x4fd30b){var _0x5193df=[];return db['User'][_0xc144('0x41')]({'where':{'role':[_0xc144('0x51'),_0xc144('0x52'),'user']},'attributes':['id',_0xc144('0x53'),_0xc144('0x28'),_0xc144('0x54'),_0xc144('0x55'),_0xc144('0x56'),_0xc144('0x57'),'lastLoginAt',_0xc144('0x58'),_0xc144('0x59')],'order':qs[_0xc144('0x3a')](_0xc144('0x5a')),'include':[{'model':db[_0xc144('0x5b')],'as':_0xc144('0x5c'),'attributes':['id',_0xc144('0x28'),_0xc144('0x2e')],'through':{'attributes':[]}}]})['then'](function(_0x3d5afa){if(_0x3d5afa){var _0x12fa3d=_0x21bdbe[_0xc144('0x5d')][_0xc144('0x4b')]({'plain':!![]});if(!_0x12fa3d)throw new Error(_0xc144('0x5e'));if(_0x12fa3d[_0xc144('0x54')]==='user'){return db['UserProfileSection'][_0xc144('0x5f')]({'where':{'name':_0xc144('0x60'),'userProfileId':_0x12fa3d[_0xc144('0x61')]},'raw':!![]})[_0xc144('0x24')](function(_0x317871){if(_0x317871){if(_0x317871[_0xc144('0x62')]===0x0){return db[_0xc144('0x63')][_0xc144('0x41')]({'where':{'sectionId':_0x317871['id']},'raw':!![]})[_0xc144('0x24')](function(_0x2f8cb4){var _0xb55e23=[];if(_[_0xc144('0x64')](_0x2f8cb4)){_0xb55e23=_[_0xc144('0x3e')](_0x3d5afa,function(_0x287c07){if(_0x287c07[_0xc144('0x54')]!=='agent'){return _0x287c07;}});return _0xb55e23;}else{for(var _0xcc6c65=0x0;_0xcc6c65<_0x3d5afa['length'];_0xcc6c65++){var _0x4897ee=_0x3d5afa[_0xcc6c65];if(_0x4897ee['role']==='agent'){var _0x427366=_['find'](_0x2f8cb4,function(_0x35696c){return _0x35696c[_0xc144('0x65')]===_0x4897ee['id'];});if(_0x427366)_0xb55e23[_0xc144('0x66')](_0x4897ee);}else{_0xb55e23['push'](_0x4897ee);}}return _0xb55e23;}});}else{return _0x3d5afa;}}else{var _0x3e2220=_[_0xc144('0x3e')](_0x3d5afa,function(_0x47f7c8){if(_0x47f7c8[_0xc144('0x54')]!==_0xc144('0x51')){return _0x47f7c8;}});return _0x3e2220;}});}else{return _0x3d5afa;}}})[_0xc144('0x24')](function(_0x531690){var _0x22f8c5=[];if(_0x531690){_0x5193df=_0x531690;for(var _0x559723=0x0;_0x559723<_0x531690[_0xc144('0x36')];_0x559723+=0x1){_0x5193df[_0x559723][_0xc144('0x4c')]=[];_0x22f8c5[_0xc144('0x66')](db['ChatInternalMessage'][_0xc144('0x5f')]({'where':{'FromId':[_0x21bdbe[_0xc144('0x5d')]['id'],_0x531690[_0x559723]['id']],'ToId':[_0x21bdbe[_0xc144('0x5d')]['id'],_0x531690[_0x559723]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xc144('0x67'),_0xc144('0x68'),_0xc144('0x69'),'body'],'order':qs[_0xc144('0x3a')](_0xc144('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x531690[_0x559723])));}return BPromise[_0xc144('0x6b')](_0x22f8c5);}return[];})[_0xc144('0x24')](function(_0x31d157){return{'rows':_0x31d157,'count':_0x31d157[_0xc144('0x36')]};})[_0xc144('0x24')](respondWithResult(_0x2b4d3e,null))[_0xc144('0x43')](handleError(_0x2b4d3e,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index c4292c0..b5a7abb 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 _0x4eaa=['save','remove','emit','hasOwnProperty','exports','events','ChatInternalMessage','setMaxListeners'];(function(_0x356bce,_0x2e190b){var _0x228af3=function(_0xf15a49){while(--_0xf15a49){_0x356bce['push'](_0x356bce['shift']());}};_0x228af3(++_0x2e190b);}(_0x4eaa,0x16d));var _0xa4ea=function(_0x4749b6,_0x5f1b3f){_0x4749b6=_0x4749b6-0x0;var _0x27596b=_0x4eaa[_0x4749b6];return _0x27596b;};'use strict';var EventEmitter=require(_0xa4ea('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0xa4ea('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xa4ea('0x2')](0x0);var events={'afterCreate':_0xa4ea('0x3'),'afterUpdate':'update','afterDestroy':_0xa4ea('0x4')};function emitEvent(_0x124650){return function(_0x8e1f7,_0x5a154d,_0x3f7334){ChatInternalMessageEvents[_0xa4ea('0x5')](_0x124650+':'+_0x8e1f7['id'],_0x8e1f7);ChatInternalMessageEvents[_0xa4ea('0x5')](_0x124650,_0x8e1f7);_0x3f7334(null);};}for(var e in events){if(events[_0xa4ea('0x6')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xa4ea('0x7')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x23a9=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save'];(function(_0x74d570,_0x40079b){var _0x3cca6e=function(_0x708d3e){while(--_0x708d3e){_0x74d570['push'](_0x74d570['shift']());}};_0x3cca6e(++_0x40079b);}(_0x23a9,0x119));var _0x923a=function(_0x2ee95a,_0x294708){_0x2ee95a=_0x2ee95a-0x0;var _0x46324b=_0x23a9[_0x2ee95a];return _0x46324b;};'use strict';var EventEmitter=require(_0x923a('0x0'));var ChatInternalMessage=require(_0x923a('0x1'))['db'][_0x923a('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x923a('0x3')](0x0);var events={'afterCreate':_0x923a('0x4'),'afterUpdate':_0x923a('0x5'),'afterDestroy':_0x923a('0x6')};function emitEvent(_0xb93e2){return function(_0x310757,_0xa4d035,_0x4f0de6){ChatInternalMessageEvents[_0x923a('0x7')](_0xb93e2+':'+_0x310757['id'],_0x310757);ChatInternalMessageEvents[_0x923a('0x7')](_0xb93e2,_0x310757);_0x4f0de6(null);};}for(var e in events){if(events[_0x923a('0x8')](e)){var event=events[e];ChatInternalMessage[_0x923a('0x9')](e,emitEvent(event));}}module[_0x923a('0xa')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index bd60b51..fb6ddbb 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 _0x6325=['rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','lodash','../../config/logger','bluebird','path'];(function(_0x399ad3,_0x249e0f){var _0x290fed=function(_0x2c9415){while(--_0x2c9415){_0x399ad3['push'](_0x399ad3['shift']());}};_0x290fed(++_0x249e0f);}(_0x6325,0x1ac));var _0x5632=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x6325[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x5632('0x0'));var util=require('util');var logger=require(_0x5632('0x1'))('api');var moment=require('moment');var BPromise=require(_0x5632('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5632('0x3'));var rimraf=require(_0x5632('0x4'));var config=require(_0x5632('0x5'));var attributes=require(_0x5632('0x6'));module[_0x5632('0x7')]=function(_0x294938,_0x1bfbc6){return _0x294938[_0x5632('0x8')](_0x5632('0x9'),attributes,{'tableName':_0x5632('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5632('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x89cd=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','define','ChatInternalMessage','chat_internal_messages'];(function(_0x53e931,_0xafd0e1){var _0x1c43a7=function(_0x289d1c){while(--_0x289d1c){_0x53e931['push'](_0x53e931['shift']());}};_0x1c43a7(++_0xafd0e1);}(_0x89cd,0xfe));var _0xd89c=function(_0x272440,_0x2d9c92){_0x272440=_0x272440-0x0;var _0x28dc6b=_0x89cd[_0x272440];return _0x28dc6b;};'use strict';var _=require(_0xd89c('0x0'));var util=require(_0xd89c('0x1'));var logger=require(_0xd89c('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd89c('0x3'));var rp=require(_0xd89c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd89c('0x5'));var config=require(_0xd89c('0x6'));var attributes=require('./chatInternalMessage.attributes');module['exports']=function(_0x598392,_0x5976bf){return _0x598392[_0xd89c('0x7')](_0xd89c('0x8'),attributes,{'tableName':_0xd89c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd89c('0xa'),'collate':_0xd89c('0xb')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 5499537..0e6f8b2 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 _0xae7c=['jayson/promise','http','defaults','redis','localhost','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x446f11,_0x95cf21){var _0x385cb5=function(_0x426715){while(--_0x426715){_0x446f11['push'](_0x446f11['shift']());}};_0x385cb5(++_0x95cf21);}(_0xae7c,0x104));var _0xcae7=function(_0x25e0ac,_0x340b5e){_0x25e0ac=_0x25e0ac-0x0;var _0x56be20=_0xae7c[_0x25e0ac];return _0x56be20;};'use strict';var _=require(_0xcae7('0x0'));var util=require(_0xcae7('0x1'));var moment=require(_0xcae7('0x2'));var BPromise=require(_0xcae7('0x3'));var rs=require(_0xcae7('0x4'));var fs=require('fs');var Redis=require(_0xcae7('0x5'));var db=require(_0xcae7('0x6'))['db'];var utils=require(_0xcae7('0x7'));var logger=require('../../config/logger')(_0xcae7('0x8'));var config=require(_0xcae7('0x9'));var jayson=require(_0xcae7('0xa'));var client=jayson['client'][_0xcae7('0xb')]({'port':0x232a});config['redis']=_[_0xcae7('0xc')](config[_0xcae7('0xd')],{'host':_0xcae7('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xcae7('0xf'))[_0xcae7('0x10')](socket);function respondWithRpcPromise(_0x7cb6ae,_0x4fad8e,_0x607b55){return new BPromise(function(_0xb0fa83,_0x2672f5){return client[_0xcae7('0x11')](_0x7cb6ae,_0x607b55)[_0xcae7('0x12')](function(_0x140899){logger[_0xcae7('0x13')](_0xcae7('0x14'),_0x4fad8e,_0xcae7('0x15'));logger[_0xcae7('0x16')](_0xcae7('0x17'),_0x4fad8e,_0xcae7('0x15'),JSON[_0xcae7('0x18')](_0x140899));if(_0x140899[_0xcae7('0x19')]){if(_0x140899['error'][_0xcae7('0x1a')]===0x1f4){logger[_0xcae7('0x19')](_0xcae7('0x14'),_0x4fad8e,_0x140899[_0xcae7('0x19')][_0xcae7('0x1b')]);return _0x2672f5(_0x140899[_0xcae7('0x19')][_0xcae7('0x1b')]);}logger[_0xcae7('0x19')](_0xcae7('0x14'),_0x4fad8e,_0x140899[_0xcae7('0x19')]['message']);return _0xb0fa83(_0x140899[_0xcae7('0x19')]['message']);}else{logger[_0xcae7('0x13')](_0xcae7('0x14'),_0x4fad8e,_0xcae7('0x15'));_0xb0fa83(_0x140899[_0xcae7('0x1c')][_0xcae7('0x1b')]);}})[_0xcae7('0x1d')](function(_0x15d175){logger[_0xcae7('0x19')](_0xcae7('0x14'),_0x4fad8e,_0x15d175);_0x2672f5(_0x15d175);});});} \ No newline at end of file +var _0xcde0=['then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request'];(function(_0x259d17,_0x220710){var _0x407535=function(_0x49bc38){while(--_0x49bc38){_0x259d17['push'](_0x259d17['shift']());}};_0x407535(++_0x220710);}(_0xcde0,0x14a));var _0x0cde=function(_0x337a42,_0x5a15c6){_0x337a42=_0x337a42-0x0;var _0x1fdd51=_0xcde0[_0x337a42];return _0x1fdd51;};'use strict';var _=require(_0x0cde('0x0'));var util=require(_0x0cde('0x1'));var moment=require(_0x0cde('0x2'));var BPromise=require('bluebird');var rs=require(_0x0cde('0x3'));var fs=require('fs');var Redis=require(_0x0cde('0x4'));var db=require(_0x0cde('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0cde('0x6'))(_0x0cde('0x7'));var config=require(_0x0cde('0x8'));var jayson=require(_0x0cde('0x9'));var client=jayson[_0x0cde('0xa')][_0x0cde('0xb')]({'port':0x232a});config[_0x0cde('0xc')]=_[_0x0cde('0xd')](config[_0x0cde('0xc')],{'host':_0x0cde('0xe'),'port':0x18eb});var socket=require(_0x0cde('0xf'))(new Redis(config[_0x0cde('0xc')]));require('./chatInternalMessage.socket')[_0x0cde('0x10')](socket);function respondWithRpcPromise(_0x56f2d6,_0x19914d,_0x18ae89){return new BPromise(function(_0x1f755e,_0x5aa9d8){return client[_0x0cde('0x11')](_0x56f2d6,_0x18ae89)[_0x0cde('0x12')](function(_0x4970aa){logger[_0x0cde('0x13')](_0x0cde('0x14'),_0x19914d,_0x0cde('0x15'));logger[_0x0cde('0x16')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x19914d,_0x0cde('0x15'),JSON[_0x0cde('0x17')](_0x4970aa));if(_0x4970aa[_0x0cde('0x18')]){if(_0x4970aa[_0x0cde('0x18')][_0x0cde('0x19')]===0x1f4){logger[_0x0cde('0x18')](_0x0cde('0x14'),_0x19914d,_0x4970aa[_0x0cde('0x18')][_0x0cde('0x1a')]);return _0x5aa9d8(_0x4970aa[_0x0cde('0x18')][_0x0cde('0x1a')]);}logger[_0x0cde('0x18')](_0x0cde('0x14'),_0x19914d,_0x4970aa[_0x0cde('0x18')][_0x0cde('0x1a')]);return _0x1f755e(_0x4970aa[_0x0cde('0x18')][_0x0cde('0x1a')]);}else{logger[_0x0cde('0x13')](_0x0cde('0x14'),_0x19914d,_0x0cde('0x15'));_0x1f755e(_0x4970aa[_0x0cde('0x1b')][_0x0cde('0x1a')]);}})[_0x0cde('0x1c')](function(_0x573fad){logger[_0x0cde('0x18')]('ChatInternalMessage,\x20%s,\x20%s',_0x19914d,_0x573fad);_0x5aa9d8(_0x573fad);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index f439aef..42820dc 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 _0xd38d=['length','chatInternalMessage:','./chatInternalMessage.events','save','update','emit','register'];(function(_0x3b5cad,_0x10d086){var _0x3a4e03=function(_0xa88ca9){while(--_0xa88ca9){_0x3b5cad['push'](_0x3b5cad['shift']());}};_0x3a4e03(++_0x10d086);}(_0xd38d,0xf0));var _0xdd38=function(_0x5b734b,_0x486a7f){_0x5b734b=_0x5b734b-0x0;var _0x2a15a3=_0xd38d[_0x5b734b];return _0x2a15a3;};'use strict';var ChatInternalMessageEvents=require(_0xdd38('0x0'));var events=[_0xdd38('0x1'),'remove',_0xdd38('0x2')];function createListener(_0x3c1692,_0x23ef95){return function(_0x2fe752){_0x23ef95[_0xdd38('0x3')](_0x3c1692,_0x2fe752);};}function removeListener(_0x497261,_0x3522e8){return function(){ChatInternalMessageEvents['removeListener'](_0x497261,_0x3522e8);};}exports[_0xdd38('0x4')]=function(_0x310515){for(var _0x4dcbcf=0x0,_0x17d1d6=events[_0xdd38('0x5')];_0x4dcbcf<_0x17d1d6;_0x4dcbcf++){var _0x24de58=events[_0x4dcbcf];var _0x276ba0=createListener(_0xdd38('0x6')+_0x24de58,_0x310515);ChatInternalMessageEvents['on'](_0x24de58,_0x276ba0);}}; \ No newline at end of file +var _0xb7e7=['removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','remove','update','emit'];(function(_0x5f53f9,_0x5dbfc5){var _0x4d10ec=function(_0x5f0d83){while(--_0x5f0d83){_0x5f53f9['push'](_0x5f53f9['shift']());}};_0x4d10ec(++_0x5dbfc5);}(_0xb7e7,0x18c));var _0x7b7e=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0xb7e7[_0x3ea913];return _0x2b4f28;};'use strict';var ChatInternalMessageEvents=require(_0x7b7e('0x0'));var events=['save',_0x7b7e('0x1'),_0x7b7e('0x2')];function createListener(_0x403ef2,_0xc92a8){return function(_0x56ce77){_0xc92a8[_0x7b7e('0x3')](_0x403ef2,_0x56ce77);};}function removeListener(_0x3d4dc1,_0x344758){return function(){ChatInternalMessageEvents[_0x7b7e('0x4')](_0x3d4dc1,_0x344758);};}exports[_0x7b7e('0x5')]=function(_0x3ab68c){for(var _0x33b893=0x0,_0x592b93=events[_0x7b7e('0x6')];_0x33b893<_0x592b93;_0x33b893++){var _0x18330a=events[_0x33b893];var _0x51e272=createListener(_0x7b7e('0x7')+_0x18330a,_0x3ab68c);ChatInternalMessageEvents['on'](_0x18330a,_0x51e272);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 26bb523..63eacac 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 _0x00c5=['index','/describe','describe','getUsers','show','post','put','/:id','update','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated'];(function(_0x378198,_0x3ca234){var _0x2fa75b=function(_0xd178c8){while(--_0xd178c8){_0x378198['push'](_0x378198['shift']());}};_0x2fa75b(++_0x3ca234);}(_0x00c5,0x1d9));var _0x500c=function(_0x143360,_0x50a88d){_0x143360=_0x143360-0x0;var _0x4d714a=_0x00c5[_0x143360];return _0x4d714a;};'use strict';var multer=require(_0x500c('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x500c('0x1'));var router=express[_0x500c('0x2')]();var fs_extra=require(_0x500c('0x3'));var auth=require(_0x500c('0x4'));var interaction=require(_0x500c('0x5'));var config=require(_0x500c('0x6'));var controller=require(_0x500c('0x7'));router[_0x500c('0x8')]('/',auth[_0x500c('0x9')](),controller[_0x500c('0xa')]);router['get'](_0x500c('0xb'),auth[_0x500c('0x9')](),controller[_0x500c('0xc')]);router[_0x500c('0x8')]('/users',auth[_0x500c('0x9')](),controller[_0x500c('0xd')]);router[_0x500c('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x500c('0xe')]);router[_0x500c('0xf')]('/',auth[_0x500c('0x9')](),controller['create']);router[_0x500c('0x10')](_0x500c('0x11'),controller[_0x500c('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x500c('0x13')]);module[_0x500c('0x14')]=router; \ No newline at end of file +var _0x2d94=['describe','/users','show','post','update','delete','/:id','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe'];(function(_0x5762ea,_0x4e9966){var _0x166b24=function(_0x19cb06){while(--_0x19cb06){_0x5762ea['push'](_0x5762ea['shift']());}};_0x166b24(++_0x4e9966);}(_0x2d94,0xf7));var _0x42d9=function(_0x52629a,_0x13fb90){_0x52629a=_0x52629a-0x0;var _0x445cc2=_0x2d94[_0x52629a];return _0x445cc2;};'use strict';var multer=require('multer');var util=require(_0x42d9('0x0'));var path=require(_0x42d9('0x1'));var timeout=require(_0x42d9('0x2'));var express=require(_0x42d9('0x3'));var router=express['Router']();var fs_extra=require(_0x42d9('0x4'));var auth=require(_0x42d9('0x5'));var interaction=require(_0x42d9('0x6'));var config=require(_0x42d9('0x7'));var controller=require(_0x42d9('0x8'));router[_0x42d9('0x9')]('/',auth[_0x42d9('0xa')](),controller[_0x42d9('0xb')]);router['get'](_0x42d9('0xc'),auth[_0x42d9('0xa')](),controller[_0x42d9('0xd')]);router['get'](_0x42d9('0xe'),auth[_0x42d9('0xa')](),controller['getUsers']);router[_0x42d9('0x9')]('/:id',auth[_0x42d9('0xa')](),controller[_0x42d9('0xf')]);router[_0x42d9('0x10')]('/',auth[_0x42d9('0xa')](),controller['create']);router['put']('/:id',controller[_0x42d9('0x11')]);router[_0x42d9('0x12')](_0x42d9('0x13'),auth[_0x42d9('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 45136de..0051ea4 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 _0x6b20=['STRING','TEXT','sequelize','exports','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x13594e,_0x6f0ed0){var _0x1a4f42=function(_0x30b064){while(--_0x30b064){_0x13594e['push'](_0x13594e['shift']());}};_0x1a4f42(++_0x6f0ed0);}(_0x6b20,0xd1));var _0x06b2=function(_0x4584df,_0x560c65){_0x4584df=_0x4584df-0x0;var _0x1701db=_0x6b20[_0x4584df];return _0x1701db;};'use strict';var Sequelize=require(_0x06b2('0x0'));module[_0x06b2('0x1')]={'body':{'type':Sequelize['TEXT'](_0x06b2('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x06b2('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x06b2('0x4')]('in',_0x06b2('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x06b2('0x6')]},'providerName':{'type':Sequelize[_0x06b2('0x7')]},'providerResponse':{'type':Sequelize[_0x06b2('0x8')]}}; \ No newline at end of file +var _0xe511=['medium','BOOLEAN','ENUM','out','DATE','STRING','TEXT','sequelize','exports'];(function(_0x18b695,_0x2f7ea0){var _0x1890a9=function(_0x447d32){while(--_0x447d32){_0x18b695['push'](_0x18b695['shift']());}};_0x1890a9(++_0x2f7ea0);}(_0xe511,0x16f));var _0x1e51=function(_0x27d2bf,_0x27ec74){_0x27d2bf=_0x27d2bf-0x0;var _0x5498a=_0xe511[_0x27d2bf];return _0x5498a;};'use strict';var Sequelize=require(_0x1e51('0x0'));module[_0x1e51('0x1')]={'body':{'type':Sequelize['TEXT'](_0x1e51('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x1e51('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1e51('0x4')]('in','out'),'defaultValue':_0x1e51('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x1e51('0x6')]},'providerName':{'type':Sequelize[_0x1e51('0x7')]},'providerResponse':{'type':Sequelize[_0x1e51('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index fb89475..0b07c5c 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 _0x7af1=['then','stack','index','map','ChatMessage','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','show','params','length','find','create','body','destroy','describe','chat-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','SELECT','User','email','manual','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','ContactId','Sequelize','contact','internal','interface','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','ChatMessage,\x20%s,\x20%s','result','catch','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update'];(function(_0x249973,_0x3c48e6){var _0x177ff2=function(_0x38396c){while(--_0x38396c){_0x249973['push'](_0x249973['shift']());}};_0x177ff2(++_0x3c48e6);}(_0x7af1,0xda));var _0x17af=function(_0x376c7c,_0x2cb0d3){_0x376c7c=_0x376c7c-0x0;var _0x26c2b2=_0x7af1[_0x376c7c];return _0x26c2b2;};'use strict';var emlformat=require(_0x17af('0x0'));var rimraf=require(_0x17af('0x1'));var zipdir=require(_0x17af('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x17af('0x3'));var moment=require(_0x17af('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x17af('0x5'));var sox=require(_0x17af('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x17af('0x7'));var _=require(_0x17af('0x8'));var squel=require(_0x17af('0x9'));var crypto=require(_0x17af('0xa'));var jsforce=require(_0x17af('0xb'));var deskjs=require(_0x17af('0xc'));var toCsv=require('to-csv');var querystring=require(_0x17af('0xd'));var Papa=require(_0x17af('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x17af('0xf'));var hardwareService=require(_0x17af('0x10'));var logger=require(_0x17af('0x11'))(_0x17af('0x12'));var utils=require('../../config/utils');var config=require(_0x17af('0x13'));var licenseUtil=require(_0x17af('0x14'));var db=require('../../mysqldb')['db'];config[_0x17af('0x15')]=_[_0x17af('0x16')](config[_0x17af('0x15')],{'host':_0x17af('0x17'),'port':0x18eb});var socket=require(_0x17af('0x18'))(new Redis(config[_0x17af('0x15')]));require(_0x17af('0x19'))[_0x17af('0x1a')](socket);var jayson=require(_0x17af('0x1b'));var client=jayson[_0x17af('0x1c')][_0x17af('0x1d')]({'port':0x232c});var client9002=jayson[_0x17af('0x1c')][_0x17af('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x48d8d2,_0x22ff44,_0x20590e,_0xe7e771){return new BPromise(function(_0x38d55d,_0x15d344){var _0x4ac2c9=_0xe7e771||client;return _0x4ac2c9[_0x17af('0x1e')](_0x48d8d2,_0x20590e)['then'](function(_0x33df57){logger[_0x17af('0x1f')]('ChatMessage,\x20%s,\x20%s',_0x22ff44,_0x17af('0x20'));logger[_0x17af('0x21')](_0x17af('0x22'),_0x22ff44,_0x17af('0x20'),JSON['stringify'](_0x33df57));if(_0x33df57[_0x17af('0x23')]){if(_0x33df57['error'][_0x17af('0x24')]===0x1f4){logger[_0x17af('0x23')]('ChatMessage,\x20%s,\x20%s',_0x22ff44,_0x33df57[_0x17af('0x23')][_0x17af('0x25')]);return _0x15d344(_0x33df57[_0x17af('0x23')][_0x17af('0x25')]);}logger[_0x17af('0x23')](_0x17af('0x26'),_0x22ff44,_0x33df57[_0x17af('0x23')][_0x17af('0x25')]);return _0x38d55d(_0x33df57[_0x17af('0x23')][_0x17af('0x25')]);}else{logger[_0x17af('0x1f')](_0x17af('0x26'),_0x22ff44,_0x17af('0x20'));_0x38d55d(_0x33df57[_0x17af('0x27')]['message']);}})[_0x17af('0x28')](function(_0x42f7fb){logger[_0x17af('0x23')]('ChatMessage,\x20%s,\x20%s',_0x22ff44,_0x42f7fb);_0x15d344(_0x42f7fb);});});}function respondWithStatusCode(_0x7bbe3c,_0x1a7f31){_0x1a7f31=_0x1a7f31||0xcc;return function(_0x4c8258){if(_0x4c8258){return _0x7bbe3c[_0x17af('0x29')](_0x1a7f31);}return _0x7bbe3c['status'](_0x1a7f31)[_0x17af('0x2a')]();};}function respondWithResult(_0x35ebcb,_0x48f821){_0x48f821=_0x48f821||0xc8;return function(_0x530027){if(_0x530027){return _0x35ebcb[_0x17af('0x2b')](_0x48f821)[_0x17af('0x2c')](_0x530027);}};}function respondWithFilteredResult(_0x44a88f,_0x28b4c8){return function(_0x231408){if(_0x231408){var _0x424451=typeof _0x28b4c8[_0x17af('0x2d')]==='undefined'&&typeof _0x28b4c8['limit']===_0x17af('0x2e');var _0x49b088=_0x231408['count'];var _0x52f86f=_0x424451?0x0:_0x28b4c8[_0x17af('0x2d')];var _0x2082d2=_0x424451?_0x231408['count']:_0x28b4c8['offset']+_0x28b4c8[_0x17af('0x2f')];var _0x54342f;if(_0x2082d2>=_0x49b088){_0x2082d2=_0x49b088;_0x54342f=0xc8;}else{_0x54342f=0xce;}_0x44a88f[_0x17af('0x2b')](_0x54342f);return _0x44a88f[_0x17af('0x30')](_0x17af('0x31'),_0x52f86f+'-'+_0x2082d2+'/'+_0x49b088)[_0x17af('0x2c')](_0x231408);}return null;};}function patchUpdates(_0xeb9085){return function(_0xc7c276){try{jsonpatch[_0x17af('0x32')](_0xc7c276,_0xeb9085,!![]);}catch(_0x1795a2){return BPromise[_0x17af('0x33')](_0x1795a2);}return _0xc7c276[_0x17af('0x34')]();};}function saveUpdates(_0x27d532,_0x1ad904){return function(_0x3ab8bb){if(_0x3ab8bb){return _0x3ab8bb[_0x17af('0x35')](_0x27d532)[_0x17af('0x36')](function(_0x1fb45b){return _0x1fb45b;});}return null;};}function removeEntity(_0x509899,_0x32b14a){return function(_0x3504cb){if(_0x3504cb){return _0x3504cb['destroy']()[_0x17af('0x36')](function(){_0x509899[_0x17af('0x2b')](0xcc)[_0x17af('0x2a')]();});}};}function handleEntityNotFound(_0x2c09ed,_0x2846d9){return function(_0x30295a){if(!_0x30295a){_0x2c09ed['sendStatus'](0x194);}return _0x30295a;};}function handleError(_0x2564c4,_0x2e1d86){_0x2e1d86=_0x2e1d86||0x1f4;return function(_0x42ecaf){logger['error'](_0x42ecaf[_0x17af('0x37')]);if(_0x42ecaf['name']){delete _0x42ecaf['name'];}_0x2564c4[_0x17af('0x2b')](_0x2e1d86)['send'](_0x42ecaf);};}exports[_0x17af('0x38')]=function(_0xdb3b4b,_0x4ac674){var _0x1d19bc={},_0x4082dd={},_0x45b5d6={'count':0x0,'rows':[]};var _0x314bde=_[_0x17af('0x39')](db[_0x17af('0x3a')][_0x17af('0x3b')],function(_0x5a26f4){return{'name':_0x5a26f4[_0x17af('0x3c')],'type':_0x5a26f4[_0x17af('0x3d')][_0x17af('0x3e')]};});_0x4082dd['model']=_[_0x17af('0x39')](_0x314bde,_0x17af('0x3f'));_0x4082dd[_0x17af('0x40')]=_[_0x17af('0x41')](_0xdb3b4b[_0x17af('0x40')]);_0x4082dd[_0x17af('0x42')]=_[_0x17af('0x43')](_0x4082dd[_0x17af('0x44')],_0x4082dd['query']);_0x1d19bc[_0x17af('0x45')]=_[_0x17af('0x43')](_0x4082dd[_0x17af('0x44')],qs[_0x17af('0x46')](_0xdb3b4b[_0x17af('0x40')][_0x17af('0x46')]));_0x1d19bc[_0x17af('0x45')]=_0x1d19bc[_0x17af('0x45')]['length']?_0x1d19bc['attributes']:_0x4082dd[_0x17af('0x44')];if(!_0xdb3b4b[_0x17af('0x40')]['hasOwnProperty'](_0x17af('0x47'))){_0x1d19bc[_0x17af('0x2f')]=qs[_0x17af('0x2f')](_0xdb3b4b[_0x17af('0x40')][_0x17af('0x2f')]);_0x1d19bc['offset']=qs[_0x17af('0x2d')](_0xdb3b4b[_0x17af('0x40')][_0x17af('0x2d')]);}_0x1d19bc[_0x17af('0x48')]=qs[_0x17af('0x49')](_0xdb3b4b[_0x17af('0x40')][_0x17af('0x49')]);_0x1d19bc[_0x17af('0x4a')]=qs['filters'](_[_0x17af('0x4b')](_0xdb3b4b[_0x17af('0x40')],_0x4082dd['filters']),_0x314bde);if(_0xdb3b4b[_0x17af('0x40')][_0x17af('0x4c')]){_0x1d19bc[_0x17af('0x4a')]=_['merge'](_0x1d19bc[_0x17af('0x4a')],{'$or':_[_0x17af('0x39')](_0x314bde,function(_0x427f2a){if(_0x427f2a[_0x17af('0x3d')]!==_0x17af('0x4d')){var _0x460ab4={};_0x460ab4[_0x427f2a[_0x17af('0x3f')]]={'$like':'%'+_0xdb3b4b['query'][_0x17af('0x4c')]+'%'};return _0x460ab4;}})});}_0x1d19bc=_[_0x17af('0x4e')]({},_0x1d19bc,_0xdb3b4b[_0x17af('0x4f')]);var _0x523891={'where':_0x1d19bc[_0x17af('0x4a')]};return db[_0x17af('0x3a')][_0x17af('0x50')](_0x523891)['then'](function(_0x25363f){_0x45b5d6[_0x17af('0x50')]=_0x25363f;if(_0xdb3b4b['query'][_0x17af('0x51')]){_0x1d19bc[_0x17af('0x52')]=[{'all':!![]}];}return db[_0x17af('0x3a')][_0x17af('0x53')](_0x1d19bc);})['then'](function(_0x317a41){_0x45b5d6['rows']=_0x317a41;return _0x45b5d6;})[_0x17af('0x36')](respondWithFilteredResult(_0x4ac674,_0x1d19bc))['catch'](handleError(_0x4ac674,null));};exports[_0x17af('0x54')]=function(_0x399979,_0x2460ce){var _0x125d6e={'raw':!![],'where':{'id':_0x399979[_0x17af('0x55')]['id']}},_0x1f978a={};_0x1f978a[_0x17af('0x44')]=_[_0x17af('0x41')](db['ChatMessage'][_0x17af('0x3b')]);_0x1f978a[_0x17af('0x40')]=_['keys'](_0x399979[_0x17af('0x40')]);_0x1f978a[_0x17af('0x42')]=_[_0x17af('0x43')](_0x1f978a['model'],_0x1f978a[_0x17af('0x40')]);_0x125d6e[_0x17af('0x45')]=_[_0x17af('0x43')](_0x1f978a['model'],qs[_0x17af('0x46')](_0x399979[_0x17af('0x40')][_0x17af('0x46')]));_0x125d6e[_0x17af('0x45')]=_0x125d6e[_0x17af('0x45')][_0x17af('0x56')]?_0x125d6e['attributes']:_0x1f978a[_0x17af('0x44')];if(_0x399979[_0x17af('0x40')][_0x17af('0x51')]){_0x125d6e[_0x17af('0x52')]=[{'all':!![]}];}_0x125d6e=_['merge']({},_0x125d6e,_0x399979[_0x17af('0x4f')]);return db[_0x17af('0x3a')][_0x17af('0x57')](_0x125d6e)['then'](handleEntityNotFound(_0x2460ce,null))[_0x17af('0x36')](respondWithResult(_0x2460ce,null))[_0x17af('0x28')](handleError(_0x2460ce,null));};exports[_0x17af('0x58')]=function(_0x209a7f,_0x2030c3){return db[_0x17af('0x3a')]['create'](_0x209a7f[_0x17af('0x59')],{})[_0x17af('0x36')](respondWithResult(_0x2030c3,0xc9))['catch'](handleError(_0x2030c3,null));};exports[_0x17af('0x35')]=function(_0xe5d4e4,_0x23cedb){if(_0xe5d4e4[_0x17af('0x59')]['id']){delete _0xe5d4e4[_0x17af('0x59')]['id'];}return db[_0x17af('0x3a')]['find']({'where':{'id':_0xe5d4e4[_0x17af('0x55')]['id']}})[_0x17af('0x36')](handleEntityNotFound(_0x23cedb,null))[_0x17af('0x36')](saveUpdates(_0xe5d4e4[_0x17af('0x59')],null))[_0x17af('0x36')](respondWithResult(_0x23cedb,null))[_0x17af('0x28')](handleError(_0x23cedb,null));};exports[_0x17af('0x5a')]=function(_0x3be144,_0x31a4d2){return db[_0x17af('0x3a')]['find']({'where':{'id':_0x3be144[_0x17af('0x55')]['id']}})[_0x17af('0x36')](handleEntityNotFound(_0x31a4d2,null))[_0x17af('0x36')](removeEntity(_0x31a4d2,null))['catch'](handleError(_0x31a4d2,null));};exports[_0x17af('0x5b')]=function(_0x4030e3,_0x5d12){return db[_0x17af('0x3a')]['describe']()[_0x17af('0x36')](respondWithResult(_0x5d12,null))[_0x17af('0x28')](handleError(_0x5d12,null));};var interaction_log=require(_0x17af('0x11'))(_0x17af('0x5c'));exports[_0x17af('0x5d')]=function(_0x74cf6b,_0xc1d7eb,_0xe345f1){var _0xc48282={'agent':{},'channel':'chat'};if(_0x74cf6b['body']['id']){delete _0x74cf6b[_0x17af('0x59')]['id'];}_0x74cf6b['body'][_0x17af('0x5e')]=!![];_0x74cf6b['body'][_0x17af('0x5f')]=moment()[_0x17af('0x60')](_0x17af('0x61'));_0x74cf6b[_0x17af('0x59')][_0x17af('0x62')]=_0x74cf6b[_0x17af('0x59')][_0x17af('0x62')]||_0x74cf6b[_0x17af('0x63')]['id'];_0xc48282[_0x17af('0x64')]['id']=_0x74cf6b['body']['UserId'];return db[_0x17af('0x3a')][_0x17af('0x57')]({'where':{'id':_0x74cf6b['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0xc1d7eb,null))[_0x17af('0x36')](saveUpdates(_0x74cf6b[_0x17af('0x59')],null))[_0x17af('0x36')](function(_0x219e17){if(_0x219e17){_0xc48282['message']=_0x219e17[_0x17af('0x65')]({'plain':!![]});return db[_0x17af('0x66')][_0x17af('0x57')]({'where':{'id':_0x219e17[_0x17af('0x67')]}});}return null;})[_0x17af('0x36')](handleEntityNotFound(_0xc1d7eb,null))[_0x17af('0x36')](function(_0x2a38f3){if(_0x2a38f3){return _0x2a38f3[_0x17af('0x35')]({'UserId':_0x74cf6b[_0x17af('0x59')][_0x17af('0x62')],'read1stAt':_[_0x17af('0x68')](_0x2a38f3[_0x17af('0x69')])?moment()['format'](_0x17af('0x61')):undefined});}return null;})[_0x17af('0x36')](function(_0x45314b){if(_0x45314b){_0xc48282[_0x17af('0x6a')]=_0x45314b[_0x17af('0x65')]({'plain':!![]});interaction_log['info'](_0x17af('0x6b'),_0x74cf6b[_0x17af('0x63')]['id'],_0x74cf6b[_0x17af('0x63')]['name'],_0x74cf6b[_0x17af('0x63')][_0x17af('0x6c')],_0xc48282['interaction']['id'],_0x74cf6b[_0x17af('0x59')]?JSON[_0x17af('0x6d')](_0x74cf6b['body']):'null');return respondWithRpcPromise(_0x17af('0x6e'),_0x17af('0x6f'),_0xc48282);}return null;})[_0x17af('0x36')](function(_0x28bf07){var _0x46494f=_0x17af('0x70')+_0x28bf07[_0x17af('0x25')]['ContactId'];return db['sequelize'][_0x17af('0x40')](_0x46494f,{'type':db['Sequelize'][_0x17af('0x71')][_0x17af('0x72')],'raw':!![]})[_0x17af('0x36')](function(_0x5c4fdc){return _0x5c4fdc;});})[_0x17af('0x36')](function(_0x5b6ff9){if(_0x5b6ff9){_0xc48282['message']['contact']=_0x5b6ff9[0x0];if(!_0x74cf6b[_0x17af('0x59')][_0x17af('0x62')])return;return db[_0x17af('0x73')][_0x17af('0x57')]({'where':{'id':_0x74cf6b[_0x17af('0x59')][_0x17af('0x62')],'role':_0x17af('0x64')},'attributes':['id',_0x17af('0x3f'),'fullname',_0x17af('0x74'),'internal'],'raw':!![]});}return null;})[_0x17af('0x36')](function(_0x13e974){if(!_0x13e974)return null;_0xc48282[_0x17af('0x25')][_0x17af('0x64')]=_0x13e974;return _0xc48282;})[_0x17af('0x36')](function(_0x1093a3){if(_0x1093a3){if(_0x74cf6b[_0x17af('0x59')][_0x17af('0x75')]){_0xc48282['message']['interface']=util[_0x17af('0x60')](_0x17af('0x76'),_0x74cf6b[_0x17af('0x63')][_0x17af('0x3f')]);_0xc48282[_0x17af('0x25')][_0x17af('0x77')]=_0xc48282[_0x17af('0x77')];_0xc48282[_0x17af('0x25')]['motionChannel']=_0xc48282['channel'];_0xc48282['message'][_0x17af('0x78')]=_0x17af('0x5d');return respondWithRpcPromise(_0x17af('0x79'),_0x17af('0x79'),{'event':_0x17af('0x7a'),'message':_[_0x17af('0x4e')](_0xc48282[_0x17af('0x25')],JSON[_0x17af('0x7b')](_0xc48282[_0x17af('0x6a')][_0x17af('0x7c')]))},client9002)[_0x17af('0x36')](function(){return _0xc48282;});}return _0xc48282;}return null;})[_0x17af('0x36')](respondWithResult(_0xc1d7eb,null))[_0x17af('0x28')](handleError(_0xc1d7eb,null));};var interaction_log=require('../../config/logger')(_0x17af('0x5c'));exports['reject']=function(_0x48324b,_0x36b82,_0x46eb38){var _0x4d0d3a={'agent':{},'channel':_0x17af('0x7d')};if(_0x48324b[_0x17af('0x59')]['id']){delete _0x48324b[_0x17af('0x59')]['id'];}_0x48324b['body'][_0x17af('0x62')]=_0x48324b['body'][_0x17af('0x62')]||_0x48324b[_0x17af('0x63')]['id'];_0x4d0d3a[_0x17af('0x64')]['id']=_0x48324b[_0x17af('0x59')][_0x17af('0x62')];return db[_0x17af('0x3a')]['find']({'where':{'id':_0x48324b[_0x17af('0x55')]['id'],'UserId':null}})[_0x17af('0x36')](handleEntityNotFound(_0x36b82,null))[_0x17af('0x36')](function(_0xd3517d){if(_0xd3517d){_0x4d0d3a[_0x17af('0x25')]=_0xd3517d[_0x17af('0x65')]({'plain':!![]});return db[_0x17af('0x66')]['find']({'where':{'id':_0xd3517d['ChatInteractionId']}});}return null;})[_0x17af('0x36')](handleEntityNotFound(_0x36b82,null))[_0x17af('0x36')](function(_0x4feae1){if(_0x4feae1){_0x4d0d3a[_0x17af('0x6a')]=_0x4feae1['get']({'plain':!![]});interaction_log[_0x17af('0x1f')](_0x17af('0x7e'),_0x48324b[_0x17af('0x63')]['id'],_0x48324b['user'][_0x17af('0x3f')],_0x48324b['user'][_0x17af('0x6c')],_0x4d0d3a[_0x17af('0x6a')]['id'],_0x48324b[_0x17af('0x59')]?JSON['stringify'](_0x48324b[_0x17af('0x59')]):_0x17af('0x7f'));return respondWithRpcPromise('RejectMessage',_0x17af('0x80'),_0x4d0d3a);}return null;})[_0x17af('0x36')](function(_0x101c69){var _0x1adbeb=_0x17af('0x70')+_0x101c69['message'][_0x17af('0x81')];return db['sequelize'][_0x17af('0x40')](_0x1adbeb,{'type':db[_0x17af('0x82')]['QueryTypes'][_0x17af('0x72')],'raw':!![]})[_0x17af('0x36')](function(_0x4b2d2a){return _0x4b2d2a;});})[_0x17af('0x36')](function(_0x52a28f){if(_0x52a28f){_0x4d0d3a['message'][_0x17af('0x83')]=_0x52a28f[0x0];if(!_0x48324b[_0x17af('0x59')][_0x17af('0x62')])return;return db[_0x17af('0x73')][_0x17af('0x57')]({'where':{'id':_0x48324b[_0x17af('0x59')][_0x17af('0x62')],'role':_0x17af('0x64')},'attributes':['id',_0x17af('0x3f'),'fullname',_0x17af('0x74'),_0x17af('0x84')],'raw':!![]});}return null;})[_0x17af('0x36')](function(_0x2c22ca){if(!_0x2c22ca)return null;_0x4d0d3a['message']['agent']=_0x2c22ca;return _0x4d0d3a;})[_0x17af('0x36')](function(_0x1b95f0){if(_0x1b95f0){_0x1b95f0[_0x17af('0x25')][_0x17af('0x85')]=util[_0x17af('0x60')](_0x17af('0x76'),_0x48324b['user'][_0x17af('0x3f')]);_0x1b95f0[_0x17af('0x25')][_0x17af('0x77')]=_0x4d0d3a['channel'];_0x1b95f0[_0x17af('0x25')][_0x17af('0x86')]=_0x4d0d3a[_0x17af('0x77')];_0x1b95f0[_0x17af('0x25')]['event']=_0x17af('0x33');respondWithRpcPromise(_0x17af('0x79'),'EventManager',{'event':_0x17af('0x87'),'message':_[_0x17af('0x4e')](_0x4d0d3a[_0x17af('0x25')],JSON['parse'](_0x4d0d3a['interaction'][_0x17af('0x7c')]))},client9002);return _0x4d0d3a;}return null;})[_0x17af('0x36')](respondWithResult(_0x36b82,null))[_0x17af('0x28')](handleError(_0x36b82,null));}; \ No newline at end of file +var _0x726e=['body','find','params','describe','chat-interactions','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','User','fullname','email','internal','manual','SIP/%s','channel','motionChannel','accept','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SELECT','contact','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','destroy','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','ChatMessage','findAll','rows','show','create'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x726e,0xaf));var _0xe726=function(_0x2947f9,_0x3de637){_0x2947f9=_0x2947f9-0x0;var _0x3736b4=_0x726e[_0x2947f9];return _0x3736b4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe726('0x0'));var zipdir=require(_0xe726('0x1'));var jsonpatch=require(_0xe726('0x2'));var rp=require(_0xe726('0x3'));var moment=require(_0xe726('0x4'));var BPromise=require(_0xe726('0x5'));var Mustache=require(_0xe726('0x6'));var util=require(_0xe726('0x7'));var path=require(_0xe726('0x8'));var sox=require(_0xe726('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe726('0xa'));var squel=require(_0xe726('0xb'));var crypto=require('crypto');var jsforce=require(_0xe726('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe726('0xd'));var Redis=require(_0xe726('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe726('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe726('0x10'));var logger=require(_0xe726('0x11'))(_0xe726('0x12'));var utils=require(_0xe726('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe726('0x14'))['db'];config[_0xe726('0x15')]=_[_0xe726('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe726('0x17'))(new Redis(config['redis']));require(_0xe726('0x18'))[_0xe726('0x19')](socket);var jayson=require(_0xe726('0x1a'));var client=jayson[_0xe726('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0xe726('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43cd7d,_0x31afc5,_0x2a918e,_0x16e146){return new BPromise(function(_0x59d229,_0x557f5f){var _0x26da40=_0x16e146||client;return _0x26da40[_0xe726('0x1c')](_0x43cd7d,_0x2a918e)['then'](function(_0xcb8869){logger[_0xe726('0x1d')](_0xe726('0x1e'),_0x31afc5,_0xe726('0x1f'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x31afc5,_0xe726('0x1f'),JSON[_0xe726('0x20')](_0xcb8869));if(_0xcb8869[_0xe726('0x21')]){if(_0xcb8869[_0xe726('0x21')][_0xe726('0x22')]===0x1f4){logger['error'](_0xe726('0x1e'),_0x31afc5,_0xcb8869[_0xe726('0x21')]['message']);return _0x557f5f(_0xcb8869[_0xe726('0x21')]['message']);}logger[_0xe726('0x21')](_0xe726('0x1e'),_0x31afc5,_0xcb8869[_0xe726('0x21')][_0xe726('0x23')]);return _0x59d229(_0xcb8869['error'][_0xe726('0x23')]);}else{logger[_0xe726('0x1d')](_0xe726('0x1e'),_0x31afc5,'request\x20sent');_0x59d229(_0xcb8869[_0xe726('0x24')][_0xe726('0x23')]);}})[_0xe726('0x25')](function(_0x161ac4){logger['error'](_0xe726('0x1e'),_0x31afc5,_0x161ac4);_0x557f5f(_0x161ac4);});});}function respondWithStatusCode(_0x593fc8,_0x4a7813){_0x4a7813=_0x4a7813||0xcc;return function(_0x181df9){if(_0x181df9){return _0x593fc8[_0xe726('0x26')](_0x4a7813);}return _0x593fc8[_0xe726('0x27')](_0x4a7813)[_0xe726('0x28')]();};}function respondWithResult(_0x3a14ed,_0x245f94){_0x245f94=_0x245f94||0xc8;return function(_0x12e563){if(_0x12e563){return _0x3a14ed[_0xe726('0x27')](_0x245f94)[_0xe726('0x29')](_0x12e563);}};}function respondWithFilteredResult(_0x5e96be,_0xfff977){return function(_0x315ee0){if(_0x315ee0){var _0x5aafa3=typeof _0xfff977['offset']===_0xe726('0x2a')&&typeof _0xfff977[_0xe726('0x2b')]===_0xe726('0x2a');var _0x2f822e=_0x315ee0[_0xe726('0x2c')];var _0x5ac9ba=_0x5aafa3?0x0:_0xfff977[_0xe726('0x2d')];var _0x3e4c99=_0x5aafa3?_0x315ee0[_0xe726('0x2c')]:_0xfff977['offset']+_0xfff977[_0xe726('0x2b')];var _0x13b8c3;if(_0x3e4c99>=_0x2f822e){_0x3e4c99=_0x2f822e;_0x13b8c3=0xc8;}else{_0x13b8c3=0xce;}_0x5e96be['status'](_0x13b8c3);return _0x5e96be[_0xe726('0x2e')](_0xe726('0x2f'),_0x5ac9ba+'-'+_0x3e4c99+'/'+_0x2f822e)[_0xe726('0x29')](_0x315ee0);}return null;};}function patchUpdates(_0x2c61eb){return function(_0x1e9c07){try{jsonpatch[_0xe726('0x30')](_0x1e9c07,_0x2c61eb,!![]);}catch(_0x5f568f){return BPromise[_0xe726('0x31')](_0x5f568f);}return _0x1e9c07['save']();};}function saveUpdates(_0x46ae12,_0x1d73d5){return function(_0x59023e){if(_0x59023e){return _0x59023e[_0xe726('0x32')](_0x46ae12)['then'](function(_0x4a7e49){return _0x4a7e49;});}return null;};}function removeEntity(_0x25ff43,_0x459eb7){return function(_0x256a5a){if(_0x256a5a){return _0x256a5a[_0xe726('0x33')]()[_0xe726('0x34')](function(){_0x25ff43[_0xe726('0x27')](0xcc)[_0xe726('0x28')]();});}};}function handleEntityNotFound(_0x2c2483,_0x20647a){return function(_0x161f0e){if(!_0x161f0e){_0x2c2483[_0xe726('0x26')](0x194);}return _0x161f0e;};}function handleError(_0x6f54b9,_0x1bfa03){_0x1bfa03=_0x1bfa03||0x1f4;return function(_0x42a881){logger[_0xe726('0x21')](_0x42a881[_0xe726('0x35')]);if(_0x42a881[_0xe726('0x36')]){delete _0x42a881[_0xe726('0x36')];}_0x6f54b9['status'](_0x1bfa03)[_0xe726('0x37')](_0x42a881);};}exports[_0xe726('0x38')]=function(_0x5de358,_0x424783){var _0x59d9ff={},_0x11224f={},_0x59ccc2={'count':0x0,'rows':[]};var _0x42504f=_[_0xe726('0x39')](db['ChatMessage'][_0xe726('0x3a')],function(_0x1667f1){return{'name':_0x1667f1[_0xe726('0x3b')],'type':_0x1667f1[_0xe726('0x3c')][_0xe726('0x3d')]};});_0x11224f[_0xe726('0x3e')]=_[_0xe726('0x39')](_0x42504f,_0xe726('0x36'));_0x11224f['query']=_[_0xe726('0x3f')](_0x5de358[_0xe726('0x40')]);_0x11224f[_0xe726('0x41')]=_['intersection'](_0x11224f[_0xe726('0x3e')],_0x11224f[_0xe726('0x40')]);_0x59d9ff['attributes']=_[_0xe726('0x42')](_0x11224f['model'],qs[_0xe726('0x43')](_0x5de358[_0xe726('0x40')][_0xe726('0x43')]));_0x59d9ff[_0xe726('0x44')]=_0x59d9ff[_0xe726('0x44')]['length']?_0x59d9ff['attributes']:_0x11224f['model'];if(!_0x5de358[_0xe726('0x40')][_0xe726('0x45')](_0xe726('0x46'))){_0x59d9ff[_0xe726('0x2b')]=qs[_0xe726('0x2b')](_0x5de358[_0xe726('0x40')]['limit']);_0x59d9ff[_0xe726('0x2d')]=qs['offset'](_0x5de358[_0xe726('0x40')][_0xe726('0x2d')]);}_0x59d9ff[_0xe726('0x47')]=qs[_0xe726('0x48')](_0x5de358['query'][_0xe726('0x48')]);_0x59d9ff[_0xe726('0x49')]=qs[_0xe726('0x41')](_[_0xe726('0x4a')](_0x5de358[_0xe726('0x40')],_0x11224f[_0xe726('0x41')]),_0x42504f);if(_0x5de358['query'][_0xe726('0x4b')]){_0x59d9ff[_0xe726('0x49')]=_[_0xe726('0x4c')](_0x59d9ff[_0xe726('0x49')],{'$or':_[_0xe726('0x39')](_0x42504f,function(_0x5f1eba){if(_0x5f1eba[_0xe726('0x3c')]!=='VIRTUAL'){var _0x15fe58={};_0x15fe58[_0x5f1eba['name']]={'$like':'%'+_0x5de358['query']['filter']+'%'};return _0x15fe58;}})});}_0x59d9ff=_['merge']({},_0x59d9ff,_0x5de358[_0xe726('0x4d')]);var _0x2f8ba5={'where':_0x59d9ff['where']};return db['ChatMessage'][_0xe726('0x2c')](_0x2f8ba5)[_0xe726('0x34')](function(_0x54db89){_0x59ccc2['count']=_0x54db89;if(_0x5de358['query'][_0xe726('0x4e')]){_0x59d9ff[_0xe726('0x4f')]=[{'all':!![]}];}return db[_0xe726('0x50')][_0xe726('0x51')](_0x59d9ff);})[_0xe726('0x34')](function(_0x4fa298){_0x59ccc2[_0xe726('0x52')]=_0x4fa298;return _0x59ccc2;})[_0xe726('0x34')](respondWithFilteredResult(_0x424783,_0x59d9ff))[_0xe726('0x25')](handleError(_0x424783,null));};exports[_0xe726('0x53')]=function(_0x124748,_0x1d02b7){var _0x375579={'raw':!![],'where':{'id':_0x124748['params']['id']}},_0x33723f={};_0x33723f[_0xe726('0x3e')]=_[_0xe726('0x3f')](db[_0xe726('0x50')]['rawAttributes']);_0x33723f[_0xe726('0x40')]=_[_0xe726('0x3f')](_0x124748[_0xe726('0x40')]);_0x33723f[_0xe726('0x41')]=_[_0xe726('0x42')](_0x33723f[_0xe726('0x3e')],_0x33723f[_0xe726('0x40')]);_0x375579['attributes']=_[_0xe726('0x42')](_0x33723f[_0xe726('0x3e')],qs[_0xe726('0x43')](_0x124748['query'][_0xe726('0x43')]));_0x375579[_0xe726('0x44')]=_0x375579[_0xe726('0x44')]['length']?_0x375579[_0xe726('0x44')]:_0x33723f[_0xe726('0x3e')];if(_0x124748[_0xe726('0x40')][_0xe726('0x4e')]){_0x375579['include']=[{'all':!![]}];}_0x375579=_['merge']({},_0x375579,_0x124748['options']);return db[_0xe726('0x50')]['find'](_0x375579)[_0xe726('0x34')](handleEntityNotFound(_0x1d02b7,null))[_0xe726('0x34')](respondWithResult(_0x1d02b7,null))[_0xe726('0x25')](handleError(_0x1d02b7,null));};exports[_0xe726('0x54')]=function(_0xa3e4c4,_0xa8052b){return db[_0xe726('0x50')][_0xe726('0x54')](_0xa3e4c4[_0xe726('0x55')],{})[_0xe726('0x34')](respondWithResult(_0xa8052b,0xc9))[_0xe726('0x25')](handleError(_0xa8052b,null));};exports[_0xe726('0x32')]=function(_0xb91408,_0x53a0a0){if(_0xb91408['body']['id']){delete _0xb91408[_0xe726('0x55')]['id'];}return db[_0xe726('0x50')][_0xe726('0x56')]({'where':{'id':_0xb91408[_0xe726('0x57')]['id']}})[_0xe726('0x34')](handleEntityNotFound(_0x53a0a0,null))[_0xe726('0x34')](saveUpdates(_0xb91408['body'],null))['then'](respondWithResult(_0x53a0a0,null))['catch'](handleError(_0x53a0a0,null));};exports[_0xe726('0x33')]=function(_0x245150,_0x1abe25){return db[_0xe726('0x50')][_0xe726('0x56')]({'where':{'id':_0x245150[_0xe726('0x57')]['id']}})[_0xe726('0x34')](handleEntityNotFound(_0x1abe25,null))[_0xe726('0x34')](removeEntity(_0x1abe25,null))[_0xe726('0x25')](handleError(_0x1abe25,null));};exports['describe']=function(_0x19ca89,_0x547cdc){return db['ChatMessage'][_0xe726('0x58')]()[_0xe726('0x34')](respondWithResult(_0x547cdc,null))[_0xe726('0x25')](handleError(_0x547cdc,null));};var interaction_log=require('../../config/logger')(_0xe726('0x59'));exports['accept']=function(_0x562b84,_0x2a1cc7,_0x7982c3){var _0x1e668d={'agent':{},'channel':_0xe726('0x5a')};if(_0x562b84[_0xe726('0x55')]['id']){delete _0x562b84[_0xe726('0x55')]['id'];}_0x562b84[_0xe726('0x55')]['read']=!![];_0x562b84['body'][_0xe726('0x5b')]=moment()[_0xe726('0x5c')](_0xe726('0x5d'));_0x562b84[_0xe726('0x55')][_0xe726('0x5e')]=_0x562b84[_0xe726('0x55')][_0xe726('0x5e')]||_0x562b84['user']['id'];_0x1e668d[_0xe726('0x5f')]['id']=_0x562b84[_0xe726('0x55')][_0xe726('0x5e')];return db[_0xe726('0x50')][_0xe726('0x56')]({'where':{'id':_0x562b84[_0xe726('0x57')]['id'],'UserId':null}})[_0xe726('0x34')](handleEntityNotFound(_0x2a1cc7,null))[_0xe726('0x34')](saveUpdates(_0x562b84[_0xe726('0x55')],null))[_0xe726('0x34')](function(_0xd8e9e7){if(_0xd8e9e7){_0x1e668d[_0xe726('0x23')]=_0xd8e9e7[_0xe726('0x60')]({'plain':!![]});return db[_0xe726('0x61')]['find']({'where':{'id':_0xd8e9e7[_0xe726('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x2a1cc7,null))[_0xe726('0x34')](function(_0x311522){if(_0x311522){return _0x311522[_0xe726('0x32')]({'UserId':_0x562b84[_0xe726('0x55')][_0xe726('0x5e')],'read1stAt':_[_0xe726('0x63')](_0x311522[_0xe726('0x64')])?moment()[_0xe726('0x5c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xe726('0x34')](function(_0x89f18f){if(_0x89f18f){_0x1e668d['interaction']=_0x89f18f[_0xe726('0x60')]({'plain':!![]});interaction_log['info'](_0xe726('0x65'),_0x562b84[_0xe726('0x66')]['id'],_0x562b84['user'][_0xe726('0x36')],_0x562b84[_0xe726('0x66')][_0xe726('0x67')],_0x1e668d[_0xe726('0x68')]['id'],_0x562b84[_0xe726('0x55')]?JSON[_0xe726('0x20')](_0x562b84[_0xe726('0x55')]):'null');return respondWithRpcPromise(_0xe726('0x69'),_0xe726('0x6a'),_0x1e668d);}return null;})['then'](function(_0x56573a){var _0x18707c='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x56573a['message'][_0xe726('0x6b')];return db[_0xe726('0x6c')][_0xe726('0x40')](_0x18707c,{'type':db[_0xe726('0x6d')][_0xe726('0x6e')]['SELECT'],'raw':!![]})[_0xe726('0x34')](function(_0x25ccea){return _0x25ccea;});})['then'](function(_0x258097){if(_0x258097){_0x1e668d[_0xe726('0x23')]['contact']=_0x258097[0x0];if(!_0x562b84[_0xe726('0x55')][_0xe726('0x5e')])return;return db[_0xe726('0x6f')][_0xe726('0x56')]({'where':{'id':_0x562b84[_0xe726('0x55')]['UserId'],'role':_0xe726('0x5f')},'attributes':['id',_0xe726('0x36'),_0xe726('0x70'),_0xe726('0x71'),_0xe726('0x72')],'raw':!![]});}return null;})['then'](function(_0x133235){if(!_0x133235)return null;_0x1e668d['message'][_0xe726('0x5f')]=_0x133235;return _0x1e668d;})[_0xe726('0x34')](function(_0x2cddde){if(_0x2cddde){if(_0x562b84['body'][_0xe726('0x73')]){_0x1e668d[_0xe726('0x23')]['interface']=util[_0xe726('0x5c')](_0xe726('0x74'),_0x562b84['user'][_0xe726('0x36')]);_0x1e668d[_0xe726('0x23')][_0xe726('0x75')]=_0x1e668d['channel'];_0x1e668d['message'][_0xe726('0x76')]=_0x1e668d[_0xe726('0x75')];_0x1e668d[_0xe726('0x23')]['event']=_0xe726('0x77');return respondWithRpcPromise('EventManager',_0xe726('0x78'),{'event':_0xe726('0x79'),'message':_[_0xe726('0x4c')](_0x1e668d[_0xe726('0x23')],JSON[_0xe726('0x7a')](_0x1e668d['interaction'][_0xe726('0x7b')]))},client9002)[_0xe726('0x34')](function(){return _0x1e668d;});}return _0x1e668d;}return null;})[_0xe726('0x34')](respondWithResult(_0x2a1cc7,null))[_0xe726('0x25')](handleError(_0x2a1cc7,null));};var interaction_log=require(_0xe726('0x11'))(_0xe726('0x59'));exports[_0xe726('0x31')]=function(_0x10e854,_0x1eaac6,_0x4a0b2e){var _0x13c143={'agent':{},'channel':_0xe726('0x5a')};if(_0x10e854[_0xe726('0x55')]['id']){delete _0x10e854[_0xe726('0x55')]['id'];}_0x10e854[_0xe726('0x55')][_0xe726('0x5e')]=_0x10e854['body']['UserId']||_0x10e854[_0xe726('0x66')]['id'];_0x13c143['agent']['id']=_0x10e854[_0xe726('0x55')][_0xe726('0x5e')];return db[_0xe726('0x50')][_0xe726('0x56')]({'where':{'id':_0x10e854[_0xe726('0x57')]['id'],'UserId':null}})[_0xe726('0x34')](handleEntityNotFound(_0x1eaac6,null))[_0xe726('0x34')](function(_0x296e8f){if(_0x296e8f){_0x13c143[_0xe726('0x23')]=_0x296e8f[_0xe726('0x60')]({'plain':!![]});return db[_0xe726('0x61')][_0xe726('0x56')]({'where':{'id':_0x296e8f['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x1eaac6,null))[_0xe726('0x34')](function(_0x39cbda){if(_0x39cbda){_0x13c143[_0xe726('0x68')]=_0x39cbda['get']({'plain':!![]});interaction_log[_0xe726('0x1d')](_0xe726('0x7c'),_0x10e854['user']['id'],_0x10e854[_0xe726('0x66')]['name'],_0x10e854[_0xe726('0x66')][_0xe726('0x67')],_0x13c143[_0xe726('0x68')]['id'],_0x10e854[_0xe726('0x55')]?JSON[_0xe726('0x20')](_0x10e854[_0xe726('0x55')]):'null');return respondWithRpcPromise(_0xe726('0x7d'),_0xe726('0x7e'),_0x13c143);}return null;})[_0xe726('0x34')](function(_0x4e2e4b){var _0x3f9d3f=_0xe726('0x7f')+_0x4e2e4b[_0xe726('0x23')][_0xe726('0x6b')];return db[_0xe726('0x6c')]['query'](_0x3f9d3f,{'type':db['Sequelize'][_0xe726('0x6e')][_0xe726('0x80')],'raw':!![]})[_0xe726('0x34')](function(_0x235bae){return _0x235bae;});})[_0xe726('0x34')](function(_0x11543a){if(_0x11543a){_0x13c143[_0xe726('0x23')][_0xe726('0x81')]=_0x11543a[0x0];if(!_0x10e854[_0xe726('0x55')][_0xe726('0x5e')])return;return db[_0xe726('0x6f')]['find']({'where':{'id':_0x10e854[_0xe726('0x55')][_0xe726('0x5e')],'role':'agent'},'attributes':['id','name',_0xe726('0x70'),_0xe726('0x71'),'internal'],'raw':!![]});}return null;})[_0xe726('0x34')](function(_0x28274e){if(!_0x28274e)return null;_0x13c143['message']['agent']=_0x28274e;return _0x13c143;})[_0xe726('0x34')](function(_0x169e94){if(_0x169e94){_0x169e94[_0xe726('0x23')]['interface']=util[_0xe726('0x5c')]('SIP/%s',_0x10e854[_0xe726('0x66')][_0xe726('0x36')]);_0x169e94['message'][_0xe726('0x75')]=_0x13c143['channel'];_0x169e94[_0xe726('0x23')][_0xe726('0x76')]=_0x13c143[_0xe726('0x75')];_0x169e94[_0xe726('0x23')]['event']=_0xe726('0x31');respondWithRpcPromise(_0xe726('0x78'),_0xe726('0x78'),{'event':'rejectmessage','message':_[_0xe726('0x4c')](_0x13c143[_0xe726('0x23')],JSON[_0xe726('0x7a')](_0x13c143[_0xe726('0x68')]['formData']))},client9002);return _0x13c143;}return null;})[_0xe726('0x34')](respondWithResult(_0x1eaac6,null))[_0xe726('0x25')](handleError(_0x1eaac6,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index b3ba3ce..3265f0f 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 _0xce5d=['emit','hook','events','ChatMessage','setMaxListeners','save','update'];(function(_0x2d701e,_0x207209){var _0x24c850=function(_0x49b005){while(--_0x49b005){_0x2d701e['push'](_0x2d701e['shift']());}};_0x24c850(++_0x207209);}(_0xce5d,0xf0));var _0xdce5=function(_0x1419f6,_0x4180de){_0x1419f6=_0x1419f6-0x0;var _0x5b07c7=_0xce5d[_0x1419f6];return _0x5b07c7;};'use strict';var EventEmitter=require(_0xdce5('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0xdce5('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xdce5('0x2')](0x0);var events={'afterCreate':_0xdce5('0x3'),'afterUpdate':_0xdce5('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4f4131){return function(_0x33ffc4,_0x394732,_0xd98740){ChatMessageEvents[_0xdce5('0x5')](_0x4f4131+':'+_0x33ffc4['id'],_0x33ffc4);ChatMessageEvents[_0xdce5('0x5')](_0x4f4131,_0x33ffc4);_0xd98740(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xdce5('0x6')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file +var _0x39b1=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x39b1,0x17a));var _0x139b=function(_0x11f88d,_0x444aa5){_0x11f88d=_0x11f88d-0x0;var _0x17db28=_0x39b1[_0x11f88d];return _0x17db28;};'use strict';var EventEmitter=require(_0x139b('0x0'));var ChatMessage=require(_0x139b('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x139b('0x2')](0x0);var events={'afterCreate':_0x139b('0x3'),'afterUpdate':_0x139b('0x4'),'afterDestroy':_0x139b('0x5')};function emitEvent(_0x154c73){return function(_0x3a4b8d,_0x157e57,_0x3fbcc4){ChatMessageEvents[_0x139b('0x6')](_0x154c73+':'+_0x3a4b8d['id'],_0x3a4b8d);ChatMessageEvents[_0x139b('0x6')](_0x154c73,_0x3a4b8d);_0x3fbcc4(null);};}for(var e in events){if(events[_0x139b('0x7')](e)){var event=events[e];ChatMessage[_0x139b('0x8')](e,emitEvent(event));}}module[_0x139b('0x9')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 494b46d..fbad4db 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 _0x77a3=['ChatInteraction','findOne','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','ChatMessage','chat_messages','FULLTEXT','get','direction','toLowerCase','secret','isNil','UserId'];(function(_0x3bfff4,_0xb878fd){var _0xba1f3d=function(_0x13f64d){while(--_0x13f64d){_0x3bfff4['push'](_0x3bfff4['shift']());}};_0xba1f3d(++_0xb878fd);}(_0x77a3,0xfc));var _0x377a=function(_0x439eb8,_0x1f8882){_0x439eb8=_0x439eb8-0x0;var _0x207441=_0x77a3[_0x439eb8];return _0x207441;};'use strict';var _=require(_0x377a('0x0'));var util=require(_0x377a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x377a('0x2'));var BPromise=require(_0x377a('0x3'));var rp=require(_0x377a('0x4'));var fs=require('fs');var path=require(_0x377a('0x5'));var rimraf=require(_0x377a('0x6'));var config=require(_0x377a('0x7'));var attributes=require('./chatMessage.attributes');module['exports']=function(_0x2ca6b1,_0x2e935c){return _0x2ca6b1[_0x377a('0x8')](_0x377a('0x9'),attributes,{'tableName':_0x377a('0xa'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':_0x377a('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2aae33,_0x296855,_0x3746bd){var _0x2e4292=_0x2ca6b1['models'];var _0x2ce025=_0x2aae33[_0x377a('0xc')]({'plain':!![]});if(_0x2ce025[_0x377a('0xd')][_0x377a('0xe')]()==='in'||_0x2ce025['direction']['toLowerCase']()==='out'&&!_0x2ce025[_0x377a('0xf')]&&!_[_0x377a('0x10')](_0x2ce025[_0x377a('0x11')])){_0x2e4292[_0x377a('0x12')][_0x377a('0x13')]({'where':{'id':_0x2ce025['ChatInteractionId']}})[_0x377a('0x14')](function(_0x41c566){if(_0x41c566){_0x41c566[_0x377a('0x15')]({'lastMsgAt':_0x2ce025[_0x377a('0x16')],'lastMsgDirection':_0x2ce025[_0x377a('0xd')][_0x377a('0xe')]()});}})[_0x377a('0x17')](function(_0x4ff001){console[_0x377a('0x18')](_0x4ff001);});}_0x3746bd();}},'charset':_0x377a('0x19'),'collate':_0x377a('0x1a')});}; \ No newline at end of file +var _0x81c3=['get','toLowerCase','direction','secret','isNil','UserId','ChatInteraction','ChatInteractionId','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models'];(function(_0x42797a,_0x3ca2c2){var _0xed8797=function(_0x33040e){while(--_0x33040e){_0x42797a['push'](_0x42797a['shift']());}};_0xed8797(++_0x3ca2c2);}(_0x81c3,0xd2));var _0x381c=function(_0x1445e6,_0x1612d1){_0x1445e6=_0x1445e6-0x0;var _0x1888a7=_0x81c3[_0x1445e6];return _0x1888a7;};'use strict';var _=require('lodash');var util=require(_0x381c('0x0'));var logger=require(_0x381c('0x1'))('api');var moment=require(_0x381c('0x2'));var BPromise=require(_0x381c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x381c('0x4'));var config=require(_0x381c('0x5'));var attributes=require('./chatMessage.attributes');module[_0x381c('0x6')]=function(_0x4639ea,_0x9c02e5){return _0x4639ea[_0x381c('0x7')](_0x381c('0x8'),attributes,{'tableName':_0x381c('0x9'),'paranoid':![],'indexes':[{'name':_0x381c('0xa'),'fields':[_0x381c('0xb')],'type':_0x381c('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x9f58f6,_0x211cc6,_0x202012){var _0x25b4a7=_0x4639ea[_0x381c('0xd')];var _0x4536f8=_0x9f58f6[_0x381c('0xe')]({'plain':!![]});if(_0x4536f8['direction'][_0x381c('0xf')]()==='in'||_0x4536f8[_0x381c('0x10')][_0x381c('0xf')]()==='out'&&!_0x4536f8[_0x381c('0x11')]&&!_[_0x381c('0x12')](_0x4536f8[_0x381c('0x13')])){_0x25b4a7[_0x381c('0x14')]['findOne']({'where':{'id':_0x4536f8[_0x381c('0x15')]}})[_0x381c('0x16')](function(_0x5d8771){if(_0x5d8771){_0x5d8771[_0x381c('0x17')]({'lastMsgAt':_0x4536f8['createdAt'],'lastMsgDirection':_0x4536f8[_0x381c('0x10')][_0x381c('0xf')]()});}})[_0x381c('0x18')](function(_0x4fe6d4){console[_0x381c('0x19')](_0x4fe6d4);});}_0x202012();}},'charset':_0x381c('0x1a'),'collate':_0x381c('0x1b')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 8a07a1c..ab43dd4 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 _0x9466=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','request','then','info','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','catch','CreateChatMessage','create','body','options','raw','lodash','util','moment'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x9466,0xa2));var _0x6946=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x9466[_0x599f41];return _0x2e4d58;};'use strict';var _=require(_0x6946('0x0'));var util=require(_0x6946('0x1'));var moment=require(_0x6946('0x2'));var BPromise=require(_0x6946('0x3'));var rs=require(_0x6946('0x4'));var fs=require('fs');var Redis=require(_0x6946('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6946('0x6'));var logger=require(_0x6946('0x7'))(_0x6946('0x8'));var config=require(_0x6946('0x9'));var jayson=require(_0x6946('0xa'));var client=jayson[_0x6946('0xb')][_0x6946('0xc')]({'port':0x232a});config[_0x6946('0xd')]=_['defaults'](config['redis'],{'host':_0x6946('0xe'),'port':0x18eb});var socket=require(_0x6946('0xf'))(new Redis(config[_0x6946('0xd')]));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x58eb64,_0x439c94,_0x72ea1a){return new BPromise(function(_0x4e0cdb,_0x52d094){return client[_0x6946('0x10')](_0x58eb64,_0x72ea1a)[_0x6946('0x11')](function(_0x70950b){logger[_0x6946('0x12')]('ChatMessage,\x20%s,\x20%s',_0x439c94,'request\x20sent');logger[_0x6946('0x13')](_0x6946('0x14'),_0x439c94,_0x6946('0x15'),JSON[_0x6946('0x16')](_0x70950b));if(_0x70950b[_0x6946('0x17')]){if(_0x70950b[_0x6946('0x17')][_0x6946('0x18')]===0x1f4){logger[_0x6946('0x17')](_0x6946('0x19'),_0x439c94,_0x70950b[_0x6946('0x17')][_0x6946('0x1a')]);return _0x52d094(_0x70950b[_0x6946('0x17')][_0x6946('0x1a')]);}logger[_0x6946('0x17')](_0x6946('0x19'),_0x439c94,_0x70950b[_0x6946('0x17')][_0x6946('0x1a')]);return _0x4e0cdb(_0x70950b['error'][_0x6946('0x1a')]);}else{logger[_0x6946('0x12')](_0x6946('0x19'),_0x439c94,_0x6946('0x15'));_0x4e0cdb(_0x70950b['result'][_0x6946('0x1a')]);}})[_0x6946('0x1b')](function(_0x4f0aab){logger[_0x6946('0x17')](_0x6946('0x19'),_0x439c94,_0x4f0aab);_0x52d094(_0x4f0aab);});});}exports[_0x6946('0x1c')]=function(_0x29427f){var _0xa6e610=this;return new Promise(function(_0x58d15b,_0x419ae9){return db['ChatMessage'][_0x6946('0x1d')](_0x29427f[_0x6946('0x1e')],{'raw':_0x29427f[_0x6946('0x1f')]?_0x29427f[_0x6946('0x1f')][_0x6946('0x20')]===undefined?!![]:![]:!![]})[_0x6946('0x11')](function(_0x3fdd4d){logger['info'](_0x6946('0x1c'),_0x29427f);logger[_0x6946('0x13')](_0x6946('0x1c'),_0x29427f,JSON[_0x6946('0x16')](_0x3fdd4d));_0x58d15b(_0x3fdd4d);})[_0x6946('0x1b')](function(_0x5850d3){logger[_0x6946('0x17')]('CreateChatMessage',_0x5850d3[_0x6946('0x1a')],_0x29427f);_0x419ae9(_0xa6e610[_0x6946('0x17')](0x1f4,_0x5850d3['message']));});});}; \ No newline at end of file +var _0xaa40=['then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','register','request'];(function(_0x760e69,_0x4a1455){var _0x175636=function(_0x4d3156){while(--_0x4d3156){_0x760e69['push'](_0x760e69['shift']());}};_0x175636(++_0x4a1455);}(_0xaa40,0x107));var _0x0aa4=function(_0x40d59e,_0x28ea77){_0x40d59e=_0x40d59e-0x0;var _0x386bfa=_0xaa40[_0x40d59e];return _0x386bfa;};'use strict';var _=require(_0x0aa4('0x0'));var util=require('util');var moment=require(_0x0aa4('0x1'));var BPromise=require(_0x0aa4('0x2'));var rs=require(_0x0aa4('0x3'));var fs=require('fs');var Redis=require(_0x0aa4('0x4'));var db=require(_0x0aa4('0x5'))['db'];var utils=require(_0x0aa4('0x6'));var logger=require(_0x0aa4('0x7'))(_0x0aa4('0x8'));var config=require(_0x0aa4('0x9'));var jayson=require(_0x0aa4('0xa'));var client=jayson['client'][_0x0aa4('0xb')]({'port':0x232a});config[_0x0aa4('0xc')]=_[_0x0aa4('0xd')](config[_0x0aa4('0xc')],{'host':_0x0aa4('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatMessage.socket')[_0x0aa4('0xf')](socket);function respondWithRpcPromise(_0x2161b6,_0xc47f2c,_0x3bc855){return new BPromise(function(_0x1e1323,_0x150828){return client[_0x0aa4('0x10')](_0x2161b6,_0x3bc855)[_0x0aa4('0x11')](function(_0x56ec7c){logger[_0x0aa4('0x12')](_0x0aa4('0x13'),_0xc47f2c,_0x0aa4('0x14'));logger[_0x0aa4('0x15')](_0x0aa4('0x16'),_0xc47f2c,'request\x20sent',JSON[_0x0aa4('0x17')](_0x56ec7c));if(_0x56ec7c[_0x0aa4('0x18')]){if(_0x56ec7c['error'][_0x0aa4('0x19')]===0x1f4){logger[_0x0aa4('0x18')](_0x0aa4('0x13'),_0xc47f2c,_0x56ec7c[_0x0aa4('0x18')][_0x0aa4('0x1a')]);return _0x150828(_0x56ec7c[_0x0aa4('0x18')][_0x0aa4('0x1a')]);}logger[_0x0aa4('0x18')](_0x0aa4('0x13'),_0xc47f2c,_0x56ec7c[_0x0aa4('0x18')][_0x0aa4('0x1a')]);return _0x1e1323(_0x56ec7c[_0x0aa4('0x18')]['message']);}else{logger[_0x0aa4('0x12')](_0x0aa4('0x13'),_0xc47f2c,_0x0aa4('0x14'));_0x1e1323(_0x56ec7c[_0x0aa4('0x1b')]['message']);}})[_0x0aa4('0x1c')](function(_0xc6f988){logger[_0x0aa4('0x18')]('ChatMessage,\x20%s,\x20%s',_0xc47f2c,_0xc6f988);_0x150828(_0xc6f988);});});}exports[_0x0aa4('0x1d')]=function(_0x4611e3){var _0x190db8=this;return new Promise(function(_0x37db06,_0x3e4d00){return db[_0x0aa4('0x1e')][_0x0aa4('0x1f')](_0x4611e3[_0x0aa4('0x20')],{'raw':_0x4611e3[_0x0aa4('0x21')]?_0x4611e3[_0x0aa4('0x21')][_0x0aa4('0x22')]===undefined?!![]:![]:!![]})[_0x0aa4('0x11')](function(_0x26093f){logger[_0x0aa4('0x12')](_0x0aa4('0x1d'),_0x4611e3);logger['debug']('CreateChatMessage',_0x4611e3,JSON[_0x0aa4('0x17')](_0x26093f));_0x37db06(_0x26093f);})['catch'](function(_0x8e1a12){logger[_0x0aa4('0x18')](_0x0aa4('0x1d'),_0x8e1a12[_0x0aa4('0x1a')],_0x4611e3);_0x3e4d00(_0x190db8[_0x0aa4('0x18')](0x1f4,_0x8e1a12[_0x0aa4('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 084c65e..0fe5616 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 _0xf5a7=['save','update','emit','removeListener','register','chatMessage:','./chatMessage.events'];(function(_0x4ca286,_0x297c3a){var _0x5f3263=function(_0x407a2a){while(--_0x407a2a){_0x4ca286['push'](_0x4ca286['shift']());}};_0x5f3263(++_0x297c3a);}(_0xf5a7,0x133));var _0x7f5a=function(_0x21180b,_0x3fdbef){_0x21180b=_0x21180b-0x0;var _0x23984e=_0xf5a7[_0x21180b];return _0x23984e;};'use strict';var ChatMessageEvents=require(_0x7f5a('0x0'));var events=[_0x7f5a('0x1'),'remove',_0x7f5a('0x2')];function createListener(_0x13cc6f,_0x15a24a){return function(_0x25616d){_0x15a24a[_0x7f5a('0x3')](_0x13cc6f,_0x25616d);};}function removeListener(_0x342fa0,_0x6da3f3){return function(){ChatMessageEvents[_0x7f5a('0x4')](_0x342fa0,_0x6da3f3);};}exports[_0x7f5a('0x5')]=function(_0x520bf9){for(var _0x2808f2=0x0,_0x2be845=events['length'];_0x2808f2<_0x2be845;_0x2808f2++){var _0x19c400=events[_0x2808f2];var _0x46d6d5=createListener(_0x7f5a('0x6')+_0x19c400,_0x520bf9);ChatMessageEvents['on'](_0x19c400,_0x46d6d5);}}; \ No newline at end of file +var _0x423b=['update','removeListener','length','chatMessage:','save'];(function(_0x54ecd6,_0xb3694f){var _0x52c08e=function(_0x50a346){while(--_0x50a346){_0x54ecd6['push'](_0x54ecd6['shift']());}};_0x52c08e(++_0xb3694f);}(_0x423b,0x12b));var _0xb423=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x423b[_0x36c5b0];return _0xf19333;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xb423('0x0'),'remove',_0xb423('0x1')];function createListener(_0x54e396,_0x3dbb0c){return function(_0x4b4acf){_0x3dbb0c['emit'](_0x54e396,_0x4b4acf);};}function removeListener(_0x50f31a,_0x2fa5da){return function(){ChatMessageEvents[_0xb423('0x2')](_0x50f31a,_0x2fa5da);};}exports['register']=function(_0x1be92e){for(var _0x3e6b18=0x0,_0x49eabb=events[_0xb423('0x3')];_0x3e6b18<_0x49eabb;_0x3e6b18++){var _0x573e95=events[_0x3e6b18];var _0x4119d7=createListener(_0xb423('0x4')+_0x573e95,_0x1be92e);ChatMessageEvents['on'](_0x573e95,_0x4119d7);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 30553dd..e967237 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 _0xb0cb=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','tracked','chatmessage:create','create','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','path'];(function(_0x1faf57,_0x1587b5){var _0x1957ae=function(_0x2b7f87){while(--_0x2b7f87){_0x1faf57['push'](_0x1faf57['shift']());}};_0x1957ae(++_0x1587b5);}(_0xb0cb,0x1d2));var _0xbb0c=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0xb0cb[_0x1a72f3];return _0x57ef47;};'use strict';var multer=require(_0xbb0c('0x0'));var util=require('util');var path=require(_0xbb0c('0x1'));var timeout=require(_0xbb0c('0x2'));var express=require(_0xbb0c('0x3'));var router=express[_0xbb0c('0x4')]();var fs_extra=require(_0xbb0c('0x5'));var auth=require(_0xbb0c('0x6'));var interaction=require(_0xbb0c('0x7'));var config=require('../../config/environment');var controller=require(_0xbb0c('0x8'));router['get']('/',auth[_0xbb0c('0x9')](),controller[_0xbb0c('0xa')]);router[_0xbb0c('0xb')](_0xbb0c('0xc'),auth['isAuthenticated'](),controller[_0xbb0c('0xd')]);router[_0xbb0c('0xb')](_0xbb0c('0xe'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xbb0c('0x9')](),interaction[_0xbb0c('0xf')]('chat',_0xbb0c('0x10')),controller[_0xbb0c('0x11')]);router[_0xbb0c('0x12')]('/:id',controller['update']);router['put'](_0xbb0c('0x13'),auth[_0xbb0c('0x9')](),controller[_0xbb0c('0x14')]);router[_0xbb0c('0x12')](_0xbb0c('0x15'),auth[_0xbb0c('0x9')](),controller[_0xbb0c('0x16')]);router[_0xbb0c('0x17')](_0xbb0c('0xe'),auth[_0xbb0c('0x9')](),controller[_0xbb0c('0x18')]);module[_0xbb0c('0x19')]=router; \ No newline at end of file +var _0x2e37=['../../config/environment','isAuthenticated','index','get','/describe','describe','show','tracked','chat','create','put','/:id','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x2e37,0x165));var _0x72e3=function(_0x33bc64,_0x4d1e92){_0x33bc64=_0x33bc64-0x0;var _0x3fdd34=_0x2e37[_0x33bc64];return _0x3fdd34;};'use strict';var multer=require(_0x72e3('0x0'));var util=require(_0x72e3('0x1'));var path=require('path');var timeout=require(_0x72e3('0x2'));var express=require(_0x72e3('0x3'));var router=express[_0x72e3('0x4')]();var fs_extra=require(_0x72e3('0x5'));var auth=require(_0x72e3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x72e3('0x7'));var controller=require('./chatMessage.controller');router['get']('/',auth[_0x72e3('0x8')](),controller[_0x72e3('0x9')]);router[_0x72e3('0xa')](_0x72e3('0xb'),auth['isAuthenticated'](),controller[_0x72e3('0xc')]);router[_0x72e3('0xa')]('/:id',auth[_0x72e3('0x8')](),controller[_0x72e3('0xd')]);router['post']('/',auth[_0x72e3('0x8')](),interaction[_0x72e3('0xe')](_0x72e3('0xf'),'chatmessage:create'),controller[_0x72e3('0x10')]);router[_0x72e3('0x11')](_0x72e3('0x12'),controller['update']);router[_0x72e3('0x11')](_0x72e3('0x13'),auth['isAuthenticated'](),controller[_0x72e3('0x14')]);router['put'](_0x72e3('0x15'),auth[_0x72e3('0x8')](),controller[_0x72e3('0x16')]);router[_0x72e3('0x17')](_0x72e3('0x12'),auth[_0x72e3('0x8')](),controller[_0x72e3('0x18')]);module[_0x72e3('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index e4c981e..a2f3dad 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 _0x0b0e=['medium','sequelize','TEXT'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x0b0e,0x187));var _0xe0b0=function(_0x54a9e3,_0x4a3813){_0x54a9e3=_0x54a9e3-0x0;var _0x247cce=_0x0b0e[_0x54a9e3];return _0x247cce;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}}; \ No newline at end of file +var _0xadb5=['medium','TEXT','exports'];(function(_0x3e042d,_0x14ef1d){var _0x180d1f=function(_0x55fba1){while(--_0x55fba1){_0x3e042d['push'](_0x3e042d['shift']());}};_0x180d1f(++_0x14ef1d);}(_0xadb5,0xad));var _0x5adb=function(_0x1eeca1,_0x31e579){_0x1eeca1=_0x1eeca1-0x0;var _0x1685b0=_0xadb5[_0x1eeca1];return _0x1685b0;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('0x1')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 585a2f2..fb965b9 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(_0x1131c2,_0x5952f3){var _0x2c5120=function(_0x4b420a){while(--_0x4b420a){_0x1131c2['push'](_0x1131c2['shift']());}};_0x2c5120(++_0x5952f3);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x408bf3,_0x19b66c){var _0x4f959e=function(_0x378f0c){while(--_0x378f0c){_0x408bf3['push'](_0x408bf3['shift']());}};_0x4f959e(++_0x19b66c);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index e38e447..8715d81 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa6cd=['update','remove','emit','hook','../../mysqldb','ChatOfflineMessage','setMaxListeners','save'];(function(_0x4b9d08,_0x44f1d9){var _0x4cb5af=function(_0x2d6b94){while(--_0x2d6b94){_0x4b9d08['push'](_0x4b9d08['shift']());}};_0x4cb5af(++_0x44f1d9);}(_0xa6cd,0x64));var _0xda6c=function(_0x22fcf2,_0x442ab8){_0x22fcf2=_0x22fcf2-0x0;var _0x52e711=_0xa6cd[_0x22fcf2];return _0x52e711;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0xda6c('0x0'))['db'][_0xda6c('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xda6c('0x2')](0x0);var events={'afterCreate':_0xda6c('0x3'),'afterUpdate':_0xda6c('0x4'),'afterDestroy':_0xda6c('0x5')};function emitEvent(_0x109844){return function(_0x98b7a2,_0x421f13,_0x1701b8){ChatOfflineMessageEvents[_0xda6c('0x6')](_0x109844+':'+_0x98b7a2['id'],_0x98b7a2);ChatOfflineMessageEvents['emit'](_0x109844,_0x98b7a2);_0x1701b8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0xda6c('0x7')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file +var _0x6029=['ChatOfflineMessage','setMaxListeners','save','remove','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x5277f8,_0x321872){var _0x218d00=function(_0xe1a710){while(--_0xe1a710){_0x5277f8['push'](_0x5277f8['shift']());}};_0x218d00(++_0x321872);}(_0x6029,0x18f));var _0x9602=function(_0x454f65,_0x2596a4){_0x454f65=_0x454f65-0x0;var _0x86d2b3=_0x6029[_0x454f65];return _0x86d2b3;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x9602('0x0'))['db'][_0x9602('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x9602('0x2')](0x0);var events={'afterCreate':_0x9602('0x3'),'afterUpdate':'update','afterDestroy':_0x9602('0x4')};function emitEvent(_0x508f60){return function(_0x7488e4,_0x4a9402,_0x42680f){ChatOfflineMessageEvents['emit'](_0x508f60+':'+_0x7488e4['id'],_0x7488e4);ChatOfflineMessageEvents[_0x9602('0x5')](_0x508f60,_0x7488e4);_0x42680f(null);};}for(var e in events){if(events[_0x9602('0x6')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x9602('0x7')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 6cdf5f8..8e12eac 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 _0xb394=['define','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports'];(function(_0x217b56,_0x2093f8){var _0x5e2aab=function(_0x31a899){while(--_0x31a899){_0x217b56['push'](_0x217b56['shift']());}};_0x5e2aab(++_0x2093f8);}(_0xb394,0x1ae));var _0x4b39=function(_0x3426db,_0x433603){_0x3426db=_0x3426db-0x0;var _0x1ade4c=_0xb394[_0x3426db];return _0x1ade4c;};'use strict';var attributes=require(_0x4b39('0x0'));module[_0x4b39('0x1')]=function(_0x1d03fd){return _0x1d03fd[_0x4b39('0x2')]('ChatOfflineMessage',attributes,{'tableName':_0x4b39('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4b39('0x4'),'collate':_0x4b39('0x5')});}; \ No newline at end of file +var _0x3068=['ChatOfflineMessage','utf8mb4_unicode_ci','exports','define'];(function(_0x3dd5b2,_0x2c75dc){var _0x1ef8c6=function(_0x242e7d){while(--_0x242e7d){_0x3dd5b2['push'](_0x3dd5b2['shift']());}};_0x1ef8c6(++_0x2c75dc);}(_0x3068,0x1aa));var _0x8306=function(_0x3d3435,_0x5801ab){_0x3d3435=_0x3d3435-0x0;var _0x677023=_0x3068[_0x3d3435];return _0x677023;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x8306('0x0')]=function(_0x14be46){return _0x14be46[_0x8306('0x1')](_0x8306('0x2'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x8306('0x3')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index a3fcf6f..8ee4358 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 _0x40fd=['lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','message','ChatOfflineMessage,\x20%s,\x20%s','result','catch'];(function(_0x56d252,_0x55848b){var _0x564a40=function(_0x143ce9){while(--_0x143ce9){_0x56d252['push'](_0x56d252['shift']());}};_0x564a40(++_0x55848b);}(_0x40fd,0x187));var _0xd40f=function(_0x5d6b41,_0x3d1c8f){_0x5d6b41=_0x5d6b41-0x0;var _0x1c2dd6=_0x40fd[_0x5d6b41];return _0x1c2dd6;};'use strict';var _=require(_0xd40f('0x0'));var util=require('util');var moment=require(_0xd40f('0x1'));var BPromise=require('bluebird');var rs=require(_0xd40f('0x2'));var fs=require('fs');var Redis=require(_0xd40f('0x3'));var db=require(_0xd40f('0x4'))['db'];var utils=require(_0xd40f('0x5'));var logger=require(_0xd40f('0x6'))(_0xd40f('0x7'));var config=require('../../config/environment');var jayson=require(_0xd40f('0x8'));var client=jayson[_0xd40f('0x9')][_0xd40f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a0afc,_0x522053,_0x34e4b6){return new BPromise(function(_0x55ef58,_0x2a64d2){return client[_0xd40f('0xb')](_0x4a0afc,_0x34e4b6)[_0xd40f('0xc')](function(_0x4b4f54){logger[_0xd40f('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x522053,_0xd40f('0xe'));logger[_0xd40f('0xf')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x522053,'request\x20sent',JSON[_0xd40f('0x10')](_0x4b4f54));if(_0x4b4f54[_0xd40f('0x11')]){if(_0x4b4f54[_0xd40f('0x11')][_0xd40f('0x12')]===0x1f4){logger[_0xd40f('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x522053,_0x4b4f54[_0xd40f('0x11')][_0xd40f('0x13')]);return _0x2a64d2(_0x4b4f54['error'][_0xd40f('0x13')]);}logger[_0xd40f('0x11')](_0xd40f('0x14'),_0x522053,_0x4b4f54[_0xd40f('0x11')][_0xd40f('0x13')]);return _0x55ef58(_0x4b4f54[_0xd40f('0x11')][_0xd40f('0x13')]);}else{logger['info'](_0xd40f('0x14'),_0x522053,_0xd40f('0xe'));_0x55ef58(_0x4b4f54[_0xd40f('0x15')][_0xd40f('0x13')]);}})[_0xd40f('0x16')](function(_0x5b9be7){logger[_0xd40f('0x11')](_0xd40f('0x14'),_0x522053,_0x5b9be7);_0x2a64d2(_0x5b9be7);});});} \ No newline at end of file +var _0x0032=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x5162ff,_0x47e103){var _0x50478b=function(_0xeecac){while(--_0xeecac){_0x5162ff['push'](_0x5162ff['shift']());}};_0x50478b(++_0x47e103);}(_0x0032,0x127));var _0x2003=function(_0x314b41,_0x59661c){_0x314b41=_0x314b41-0x0;var _0x508fbb=_0x0032[_0x314b41];return _0x508fbb;};'use strict';var _=require('lodash');var util=require(_0x2003('0x0'));var moment=require(_0x2003('0x1'));var BPromise=require(_0x2003('0x2'));var rs=require(_0x2003('0x3'));var fs=require('fs');var Redis=require(_0x2003('0x4'));var db=require(_0x2003('0x5'))['db'];var utils=require(_0x2003('0x6'));var logger=require(_0x2003('0x7'))(_0x2003('0x8'));var config=require(_0x2003('0x9'));var jayson=require(_0x2003('0xa'));var client=jayson[_0x2003('0xb')][_0x2003('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x672530,_0x5531c9,_0x5a93ff){return new BPromise(function(_0x4c6fcb,_0xf04e7d){return client['request'](_0x672530,_0x5a93ff)[_0x2003('0xd')](function(_0x43cbca){logger[_0x2003('0xe')](_0x2003('0xf'),_0x5531c9,'request\x20sent');logger[_0x2003('0x10')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x5531c9,_0x2003('0x11'),JSON[_0x2003('0x12')](_0x43cbca));if(_0x43cbca['error']){if(_0x43cbca[_0x2003('0x13')]['code']===0x1f4){logger['error'](_0x2003('0xf'),_0x5531c9,_0x43cbca[_0x2003('0x13')]['message']);return _0xf04e7d(_0x43cbca['error']['message']);}logger[_0x2003('0x13')](_0x2003('0xf'),_0x5531c9,_0x43cbca[_0x2003('0x13')][_0x2003('0x14')]);return _0x4c6fcb(_0x43cbca['error'][_0x2003('0x14')]);}else{logger['info'](_0x2003('0xf'),_0x5531c9,'request\x20sent');_0x4c6fcb(_0x43cbca[_0x2003('0x15')]['message']);}})[_0x2003('0x16')](function(_0x2254c4){logger[_0x2003('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5531c9,_0x2254c4);_0xf04e7d(_0x2254c4);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 835f049..bc65647 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 _0x47a9=['index','/describe','describe','/:id','create','put','update','delete','destroy','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x47a9,0x75));var _0x947a=function(_0x52e5b7,_0x22040b){_0x52e5b7=_0x52e5b7-0x0;var _0x56527b=_0x47a9[_0x52e5b7];return _0x56527b;};'use strict';var multer=require('multer');var util=require(_0x947a('0x0'));var path=require(_0x947a('0x1'));var timeout=require(_0x947a('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x947a('0x3'));var auth=require(_0x947a('0x4'));var interaction=require(_0x947a('0x5'));var config=require(_0x947a('0x6'));var controller=require(_0x947a('0x7'));router['get']('/',auth[_0x947a('0x8')](),controller[_0x947a('0x9')]);router['get'](_0x947a('0xa'),auth['isAuthenticated'](),controller[_0x947a('0xb')]);router['get'](_0x947a('0xc'),auth[_0x947a('0x8')](),controller['show']);router['post']('/',auth[_0x947a('0x8')](),controller[_0x947a('0xd')]);router[_0x947a('0xe')](_0x947a('0xc'),auth['isAuthenticated'](),controller[_0x947a('0xf')]);router[_0x947a('0x10')](_0x947a('0xc'),auth['isAuthenticated'](),controller[_0x947a('0x11')]);module['exports']=router; \ No newline at end of file +var _0x445c=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete','destroy','exports','util'];(function(_0x1c5950,_0x49e128){var _0x2b720a=function(_0x4454f1){while(--_0x4454f1){_0x1c5950['push'](_0x1c5950['shift']());}};_0x2b720a(++_0x49e128);}(_0x445c,0x107));var _0xc445=function(_0x4c3402,_0x1f7e7c){_0x4c3402=_0x4c3402-0x0;var _0x3e41ba=_0x445c[_0x4c3402];return _0x3e41ba;};'use strict';var multer=require('multer');var util=require(_0xc445('0x0'));var path=require(_0xc445('0x1'));var timeout=require(_0xc445('0x2'));var express=require(_0xc445('0x3'));var router=express[_0xc445('0x4')]();var fs_extra=require(_0xc445('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc445('0x6'));var config=require('../../config/environment');var controller=require(_0xc445('0x7'));router[_0xc445('0x8')]('/',auth[_0xc445('0x9')](),controller[_0xc445('0xa')]);router[_0xc445('0x8')](_0xc445('0xb'),auth[_0xc445('0x9')](),controller[_0xc445('0xc')]);router[_0xc445('0x8')]('/:id',auth[_0xc445('0x9')](),controller[_0xc445('0xd')]);router[_0xc445('0xe')]('/',auth[_0xc445('0x9')](),controller[_0xc445('0xf')]);router[_0xc445('0x10')](_0xc445('0x11'),auth['isAuthenticated'](),controller[_0xc445('0x12')]);router[_0xc445('0x13')]('/:id',auth[_0xc445('0x9')](),controller[_0xc445('0x14')]);module[_0xc445('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index a121b1e..037ed64 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 _0x0dc2=['timeout','INTEGER','STRING','ENUM','mouseOver'];(function(_0x1c9fae,_0x4ee899){var _0x198aeb=function(_0x1f9bca){while(--_0x1f9bca){_0x1c9fae['push'](_0x1c9fae['shift']());}};_0x198aeb(++_0x4ee899);}(_0x0dc2,0x1f1));var _0x20dc=function(_0x4064a7,_0x4e43f5){_0x4064a7=_0x4064a7-0x0;var _0x11fdb9=_0x0dc2[_0x4064a7];return _0x11fdb9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x20dc('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x20dc('0x1')](_0x20dc('0x2'),_0x20dc('0x3')),'defaultValue':_0x20dc('0x2')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x20dc('0x4')]}}; \ No newline at end of file +var _0x18a9=['sequelize','exports','STRING','mouseOver','timeout','INTEGER'];(function(_0x323684,_0x9875f7){var _0x4480f6=function(_0x52b0ab){while(--_0x52b0ab){_0x323684['push'](_0x323684['shift']());}};_0x4480f6(++_0x9875f7);}(_0x18a9,0x1e0));var _0x918a=function(_0x3e6ead,_0x61f91a){_0x3e6ead=_0x3e6ead-0x0;var _0x28f590=_0x18a9[_0x3e6ead];return _0x28f590;};'use strict';var Sequelize=require(_0x918a('0x0'));module[_0x918a('0x1')]={'name':{'type':Sequelize[_0x918a('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x918a('0x3'),_0x918a('0x4')),'defaultValue':_0x918a('0x3')},'selector':{'type':Sequelize[_0x918a('0x2')]},'timeout':{'type':Sequelize[_0x918a('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 030ce0c..45ce8b7 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 _0xec46=['to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','name','send','show','params','model','keys','rawAttributes','query','intersection','fields','attributes','length','includeAll','include','merge','options','ChatProactiveAction','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xec46,0x19c));var _0x6ec4=function(_0x57a872,_0x57a4e7){_0x57a872=_0x57a872-0x0;var _0x5d7b73=_0xec46[_0x57a872];return _0x5d7b73;};'use strict';var emlformat=require(_0x6ec4('0x0'));var rimraf=require(_0x6ec4('0x1'));var zipdir=require(_0x6ec4('0x2'));var jsonpatch=require(_0x6ec4('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6ec4('0x4'));var Mustache=require(_0x6ec4('0x5'));var util=require(_0x6ec4('0x6'));var path=require('path');var sox=require(_0x6ec4('0x7'));var csv=require(_0x6ec4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6ec4('0x9'));var _=require('lodash');var squel=require(_0x6ec4('0xa'));var crypto=require(_0x6ec4('0xb'));var jsforce=require(_0x6ec4('0xc'));var deskjs=require(_0x6ec4('0xd'));var toCsv=require(_0x6ec4('0x8'));var querystring=require(_0x6ec4('0xe'));var Papa=require(_0x6ec4('0xf'));var Redis=require(_0x6ec4('0x10'));var authService=require(_0x6ec4('0x11'));var qs=require(_0x6ec4('0x12'));var as=require(_0x6ec4('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6ec4('0x14'));var utils=require(_0x6ec4('0x15'));var config=require(_0x6ec4('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x6ec4('0x17'))['db'];function respondWithStatusCode(_0x489707,_0x472484){_0x472484=_0x472484||0xcc;return function(_0x5e9b01){if(_0x5e9b01){return _0x489707[_0x6ec4('0x18')](_0x472484);}return _0x489707[_0x6ec4('0x19')](_0x472484)[_0x6ec4('0x1a')]();};}function respondWithResult(_0x15f87f,_0x2813b6){_0x2813b6=_0x2813b6||0xc8;return function(_0x5882d1){if(_0x5882d1){return _0x15f87f[_0x6ec4('0x19')](_0x2813b6)[_0x6ec4('0x1b')](_0x5882d1);}};}function respondWithFilteredResult(_0x43d7f8,_0x272d71){return function(_0x4f5390){if(_0x4f5390){var _0x861a21=typeof _0x272d71[_0x6ec4('0x1c')]===_0x6ec4('0x1d')&&typeof _0x272d71[_0x6ec4('0x1e')]===_0x6ec4('0x1d');var _0x1b7c00=_0x4f5390['count'];var _0x327724=_0x861a21?0x0:_0x272d71['offset'];var _0x516f22=_0x861a21?_0x4f5390[_0x6ec4('0x1f')]:_0x272d71['offset']+_0x272d71[_0x6ec4('0x1e')];var _0x1db2ea;if(_0x516f22>=_0x1b7c00){_0x516f22=_0x1b7c00;_0x1db2ea=0xc8;}else{_0x1db2ea=0xce;}_0x43d7f8[_0x6ec4('0x19')](_0x1db2ea);return _0x43d7f8['set'](_0x6ec4('0x20'),_0x327724+'-'+_0x516f22+'/'+_0x1b7c00)['json'](_0x4f5390);}return null;};}function patchUpdates(_0x574d80){return function(_0x9689ab){try{jsonpatch[_0x6ec4('0x21')](_0x9689ab,_0x574d80,!![]);}catch(_0x5b4966){return BPromise[_0x6ec4('0x22')](_0x5b4966);}return _0x9689ab[_0x6ec4('0x23')]();};}function saveUpdates(_0x34b76e,_0x364cfc){return function(_0x5032a1){if(_0x5032a1){return _0x5032a1[_0x6ec4('0x24')](_0x34b76e)['then'](function(_0x5ef6a5){return _0x5ef6a5;});}return null;};}function removeEntity(_0x2a6f2f,_0x766a30){return function(_0x3dd6e0){if(_0x3dd6e0){return _0x3dd6e0[_0x6ec4('0x25')]()[_0x6ec4('0x26')](function(){_0x2a6f2f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x183257,_0x52b927){return function(_0x1bc94e){if(!_0x1bc94e){_0x183257['sendStatus'](0x194);}return _0x1bc94e;};}function handleError(_0x3bac89,_0x4dc97d){_0x4dc97d=_0x4dc97d||0x1f4;return function(_0x239430){logger['error'](_0x239430['stack']);if(_0x239430[_0x6ec4('0x27')]){delete _0x239430['name'];}_0x3bac89[_0x6ec4('0x19')](_0x4dc97d)[_0x6ec4('0x28')](_0x239430);};}exports[_0x6ec4('0x29')]=function(_0x51606c,_0x33ea66){var _0x486951={'raw':!![],'where':{'id':_0x51606c[_0x6ec4('0x2a')]['id']}},_0x1ada63={};_0x1ada63[_0x6ec4('0x2b')]=_[_0x6ec4('0x2c')](db['ChatProactiveAction'][_0x6ec4('0x2d')]);_0x1ada63[_0x6ec4('0x2e')]=_[_0x6ec4('0x2c')](_0x51606c[_0x6ec4('0x2e')]);_0x1ada63['filters']=_['intersection'](_0x1ada63[_0x6ec4('0x2b')],_0x1ada63[_0x6ec4('0x2e')]);_0x486951['attributes']=_[_0x6ec4('0x2f')](_0x1ada63['model'],qs[_0x6ec4('0x30')](_0x51606c[_0x6ec4('0x2e')][_0x6ec4('0x30')]));_0x486951[_0x6ec4('0x31')]=_0x486951['attributes'][_0x6ec4('0x32')]?_0x486951[_0x6ec4('0x31')]:_0x1ada63[_0x6ec4('0x2b')];if(_0x51606c[_0x6ec4('0x2e')][_0x6ec4('0x33')]){_0x486951[_0x6ec4('0x34')]=[{'all':!![]}];}_0x486951=_[_0x6ec4('0x35')]({},_0x486951,_0x51606c[_0x6ec4('0x36')]);return db[_0x6ec4('0x37')]['find'](_0x486951)[_0x6ec4('0x26')](handleEntityNotFound(_0x33ea66,null))[_0x6ec4('0x26')](respondWithResult(_0x33ea66,null))[_0x6ec4('0x38')](handleError(_0x33ea66,null));};exports['create']=function(_0x72790,_0x52e04f){return db['ChatProactiveAction'][_0x6ec4('0x39')](_0x72790[_0x6ec4('0x3a')],{})['then'](respondWithResult(_0x52e04f,0xc9))['catch'](handleError(_0x52e04f,null));};exports['update']=function(_0x51d98b,_0x529ccf){if(_0x51d98b[_0x6ec4('0x3a')]['id']){delete _0x51d98b['body']['id'];}return db[_0x6ec4('0x37')]['find']({'where':{'id':_0x51d98b[_0x6ec4('0x2a')]['id']}})[_0x6ec4('0x26')](handleEntityNotFound(_0x529ccf,null))['then'](saveUpdates(_0x51d98b[_0x6ec4('0x3a')],null))[_0x6ec4('0x26')](respondWithResult(_0x529ccf,null))['catch'](handleError(_0x529ccf,null));};exports[_0x6ec4('0x25')]=function(_0x494a1f,_0x13daac){return db['ChatProactiveAction'][_0x6ec4('0x3b')]({'where':{'id':_0x494a1f[_0x6ec4('0x2a')]['id']}})[_0x6ec4('0x26')](handleEntityNotFound(_0x13daac,null))[_0x6ec4('0x26')](removeEntity(_0x13daac,null))[_0x6ec4('0x38')](handleError(_0x13daac,null));}; \ No newline at end of file +var _0x8e0f=['reject','update','then','end','sendStatus','stack','name','show','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','fields','attributes','includeAll','merge','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x5effd1,_0x1a1b0b){var _0x12ea38=function(_0x490a6e){while(--_0x490a6e){_0x5effd1['push'](_0x5effd1['shift']());}};_0x12ea38(++_0x1a1b0b);}(_0x8e0f,0x12f));var _0xf8e0=function(_0x3d6d27,_0x5c4dc4){_0x3d6d27=_0x3d6d27-0x0;var _0x3d44f6=_0x8e0f[_0x3d6d27];return _0x3d44f6;};'use strict';var emlformat=require(_0xf8e0('0x0'));var rimraf=require(_0xf8e0('0x1'));var zipdir=require(_0xf8e0('0x2'));var jsonpatch=require(_0xf8e0('0x3'));var rp=require(_0xf8e0('0x4'));var moment=require(_0xf8e0('0x5'));var BPromise=require(_0xf8e0('0x6'));var Mustache=require('mustache');var util=require(_0xf8e0('0x7'));var path=require('path');var sox=require(_0xf8e0('0x8'));var csv=require(_0xf8e0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf8e0('0xa'));var _=require(_0xf8e0('0xb'));var squel=require(_0xf8e0('0xc'));var crypto=require(_0xf8e0('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf8e0('0xe'));var toCsv=require(_0xf8e0('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf8e0('0xf'));var authService=require(_0xf8e0('0x10'));var qs=require(_0xf8e0('0x11'));var as=require(_0xf8e0('0x12'));var hardwareService=require(_0xf8e0('0x13'));var logger=require(_0xf8e0('0x14'))(_0xf8e0('0x15'));var utils=require(_0xf8e0('0x16'));var config=require(_0xf8e0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf8e0('0x18'))['db'];function respondWithStatusCode(_0x113b45,_0x3edb60){_0x3edb60=_0x3edb60||0xcc;return function(_0x415601){if(_0x415601){return _0x113b45['sendStatus'](_0x3edb60);}return _0x113b45[_0xf8e0('0x19')](_0x3edb60)['end']();};}function respondWithResult(_0xea93ae,_0x443445){_0x443445=_0x443445||0xc8;return function(_0x321785){if(_0x321785){return _0xea93ae['status'](_0x443445)[_0xf8e0('0x1a')](_0x321785);}};}function respondWithFilteredResult(_0x534844,_0x151990){return function(_0x4de3de){if(_0x4de3de){var _0x430b06=typeof _0x151990[_0xf8e0('0x1b')]===_0xf8e0('0x1c')&&typeof _0x151990[_0xf8e0('0x1d')]===_0xf8e0('0x1c');var _0x49e649=_0x4de3de[_0xf8e0('0x1e')];var _0x54ee7c=_0x430b06?0x0:_0x151990[_0xf8e0('0x1b')];var _0x13a29b=_0x430b06?_0x4de3de[_0xf8e0('0x1e')]:_0x151990[_0xf8e0('0x1b')]+_0x151990['limit'];var _0x592936;if(_0x13a29b>=_0x49e649){_0x13a29b=_0x49e649;_0x592936=0xc8;}else{_0x592936=0xce;}_0x534844[_0xf8e0('0x19')](_0x592936);return _0x534844[_0xf8e0('0x1f')](_0xf8e0('0x20'),_0x54ee7c+'-'+_0x13a29b+'/'+_0x49e649)[_0xf8e0('0x1a')](_0x4de3de);}return null;};}function patchUpdates(_0x5e5ad6){return function(_0x21831e){try{jsonpatch['apply'](_0x21831e,_0x5e5ad6,!![]);}catch(_0xd533d){return BPromise[_0xf8e0('0x21')](_0xd533d);}return _0x21831e['save']();};}function saveUpdates(_0x2e3826,_0x1b7c3c){return function(_0x2f844a){if(_0x2f844a){return _0x2f844a[_0xf8e0('0x22')](_0x2e3826)['then'](function(_0x47d885){return _0x47d885;});}return null;};}function removeEntity(_0x8d9993,_0x4cb871){return function(_0x4d5255){if(_0x4d5255){return _0x4d5255['destroy']()[_0xf8e0('0x23')](function(){_0x8d9993[_0xf8e0('0x19')](0xcc)[_0xf8e0('0x24')]();});}};}function handleEntityNotFound(_0x420309,_0x212df8){return function(_0x29b52d){if(!_0x29b52d){_0x420309[_0xf8e0('0x25')](0x194);}return _0x29b52d;};}function handleError(_0x512bb7,_0x26494f){_0x26494f=_0x26494f||0x1f4;return function(_0x1bcaf6){logger['error'](_0x1bcaf6[_0xf8e0('0x26')]);if(_0x1bcaf6[_0xf8e0('0x27')]){delete _0x1bcaf6[_0xf8e0('0x27')];}_0x512bb7[_0xf8e0('0x19')](_0x26494f)['send'](_0x1bcaf6);};}exports[_0xf8e0('0x28')]=function(_0x517f2f,_0x4ec8df){var _0xb1baa7={'raw':!![],'where':{'id':_0x517f2f[_0xf8e0('0x29')]['id']}},_0x327e5f={};_0x327e5f[_0xf8e0('0x2a')]=_[_0xf8e0('0x2b')](db[_0xf8e0('0x2c')][_0xf8e0('0x2d')]);_0x327e5f[_0xf8e0('0x2e')]=_[_0xf8e0('0x2b')](_0x517f2f[_0xf8e0('0x2e')]);_0x327e5f['filters']=_[_0xf8e0('0x2f')](_0x327e5f[_0xf8e0('0x2a')],_0x327e5f[_0xf8e0('0x2e')]);_0xb1baa7['attributes']=_[_0xf8e0('0x2f')](_0x327e5f['model'],qs[_0xf8e0('0x30')](_0x517f2f[_0xf8e0('0x2e')]['fields']));_0xb1baa7[_0xf8e0('0x31')]=_0xb1baa7[_0xf8e0('0x31')]['length']?_0xb1baa7[_0xf8e0('0x31')]:_0x327e5f[_0xf8e0('0x2a')];if(_0x517f2f['query'][_0xf8e0('0x32')]){_0xb1baa7['include']=[{'all':!![]}];}_0xb1baa7=_[_0xf8e0('0x33')]({},_0xb1baa7,_0x517f2f['options']);return db['ChatProactiveAction'][_0xf8e0('0x34')](_0xb1baa7)[_0xf8e0('0x23')](handleEntityNotFound(_0x4ec8df,null))[_0xf8e0('0x23')](respondWithResult(_0x4ec8df,null))[_0xf8e0('0x35')](handleError(_0x4ec8df,null));};exports[_0xf8e0('0x36')]=function(_0x40d9f6,_0x306096){return db[_0xf8e0('0x2c')][_0xf8e0('0x36')](_0x40d9f6[_0xf8e0('0x37')],{})[_0xf8e0('0x23')](respondWithResult(_0x306096,0xc9))[_0xf8e0('0x35')](handleError(_0x306096,null));};exports[_0xf8e0('0x22')]=function(_0x5431dc,_0x2266b0){if(_0x5431dc[_0xf8e0('0x37')]['id']){delete _0x5431dc['body']['id'];}return db['ChatProactiveAction'][_0xf8e0('0x34')]({'where':{'id':_0x5431dc['params']['id']}})['then'](handleEntityNotFound(_0x2266b0,null))[_0xf8e0('0x23')](saveUpdates(_0x5431dc[_0xf8e0('0x37')],null))[_0xf8e0('0x23')](respondWithResult(_0x2266b0,null))[_0xf8e0('0x35')](handleError(_0x2266b0,null));};exports['destroy']=function(_0x1423ab,_0x46e476){return db[_0xf8e0('0x2c')][_0xf8e0('0x34')]({'where':{'id':_0x1423ab[_0xf8e0('0x29')]['id']}})['then'](handleEntityNotFound(_0x46e476,null))[_0xf8e0('0x23')](removeEntity(_0x46e476,null))[_0xf8e0('0x35')](handleError(_0x46e476,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 5628b7b..c8a791f 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 _0x8ac1=['path','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x539fac,_0x4def01){var _0x2a1f20=function(_0x48b0e2){while(--_0x48b0e2){_0x539fac['push'](_0x539fac['shift']());}};_0x2a1f20(++_0x4def01);}(_0x8ac1,0x13b));var _0x18ac=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x8ac1[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x18ac('0x0'));var util=require(_0x18ac('0x1'));var logger=require(_0x18ac('0x2'))(_0x18ac('0x3'));var moment=require(_0x18ac('0x4'));var BPromise=require(_0x18ac('0x5'));var rp=require(_0x18ac('0x6'));var fs=require('fs');var path=require(_0x18ac('0x7'));var rimraf=require('rimraf');var config=require(_0x18ac('0x8'));var attributes=require(_0x18ac('0x9'));module[_0x18ac('0xa')]=function(_0x3e471a,_0x15dc95){return _0x3e471a[_0x18ac('0xb')](_0x18ac('0xc'),attributes,{'tableName':_0x18ac('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x005c=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util'];(function(_0x99facc,_0x548cd6){var _0xd39ed0=function(_0x207e47){while(--_0x207e47){_0x99facc['push'](_0x99facc['shift']());}};_0xd39ed0(++_0x548cd6);}(_0x005c,0x1df));var _0xc005=function(_0x1122df,_0x35b3f1){_0x1122df=_0x1122df-0x0;var _0x8264e5=_0x005c[_0x1122df];return _0x8264e5;};'use strict';var _=require(_0xc005('0x0'));var util=require(_0xc005('0x1'));var logger=require(_0xc005('0x2'))(_0xc005('0x3'));var moment=require(_0xc005('0x4'));var BPromise=require(_0xc005('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc005('0x6'));var rimraf=require(_0xc005('0x7'));var config=require(_0xc005('0x8'));var attributes=require('./chatProactiveAction.attributes');module[_0xc005('0x9')]=function(_0x9546d6,_0x5373a5){return _0x9546d6[_0xc005('0xa')](_0xc005('0xb'),attributes,{'tableName':_0xc005('0xc'),'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 edee931..644e431 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 _0x69dc=['error','code','message','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x69dc,0x148));var _0xc69d=function(_0x5addee,_0xc4adbb){_0x5addee=_0x5addee-0x0;var _0x245ac0=_0x69dc[_0x5addee];return _0x245ac0;};'use strict';var _=require(_0xc69d('0x0'));var util=require('util');var moment=require(_0xc69d('0x1'));var BPromise=require('bluebird');var rs=require(_0xc69d('0x2'));var fs=require('fs');var Redis=require(_0xc69d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc69d('0x4'));var logger=require(_0xc69d('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc69d('0x6'));var client=jayson['client'][_0xc69d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x154ad7,_0x3ebc0d,_0x34fd92){return new BPromise(function(_0x46f29c,_0x29f53b){return client[_0xc69d('0x8')](_0x154ad7,_0x34fd92)[_0xc69d('0x9')](function(_0x9bce7d){logger[_0xc69d('0xa')](_0xc69d('0xb'),_0x3ebc0d,_0xc69d('0xc'));logger['debug'](_0xc69d('0xd'),_0x3ebc0d,'request\x20sent',JSON['stringify'](_0x9bce7d));if(_0x9bce7d['error']){if(_0x9bce7d[_0xc69d('0xe')][_0xc69d('0xf')]===0x1f4){logger[_0xc69d('0xe')](_0xc69d('0xb'),_0x3ebc0d,_0x9bce7d['error']['message']);return _0x29f53b(_0x9bce7d[_0xc69d('0xe')][_0xc69d('0x10')]);}logger['error'](_0xc69d('0xb'),_0x3ebc0d,_0x9bce7d[_0xc69d('0xe')][_0xc69d('0x10')]);return _0x46f29c(_0x9bce7d[_0xc69d('0xe')][_0xc69d('0x10')]);}else{logger[_0xc69d('0xa')](_0xc69d('0xb'),_0x3ebc0d,_0xc69d('0xc'));_0x46f29c(_0x9bce7d['result'][_0xc69d('0x10')]);}})[_0xc69d('0x11')](function(_0x16f1dc){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x3ebc0d,_0x16f1dc);_0x29f53b(_0x16f1dc);});});} \ No newline at end of file +var _0x6b21=['util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash'];(function(_0x1562a2,_0x2e4655){var _0x39a636=function(_0x25483a){while(--_0x25483a){_0x1562a2['push'](_0x1562a2['shift']());}};_0x39a636(++_0x2e4655);}(_0x6b21,0x12a));var _0x16b2=function(_0x5bca1c,_0x29f3bf){_0x5bca1c=_0x5bca1c-0x0;var _0x13437b=_0x6b21[_0x5bca1c];return _0x13437b;};'use strict';var _=require(_0x16b2('0x0'));var util=require(_0x16b2('0x1'));var moment=require(_0x16b2('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x16b2('0x3'));var db=require(_0x16b2('0x4'))['db'];var utils=require(_0x16b2('0x5'));var logger=require(_0x16b2('0x6'))(_0x16b2('0x7'));var config=require(_0x16b2('0x8'));var jayson=require(_0x16b2('0x9'));var client=jayson[_0x16b2('0xa')][_0x16b2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5bac69,_0x15990f,_0x2eb72b){return new BPromise(function(_0x58f21d,_0x5a38bc){return client[_0x16b2('0xc')](_0x5bac69,_0x2eb72b)[_0x16b2('0xd')](function(_0x455407){logger[_0x16b2('0xe')](_0x16b2('0xf'),_0x15990f,_0x16b2('0x10'));logger[_0x16b2('0x11')](_0x16b2('0x12'),_0x15990f,_0x16b2('0x10'),JSON[_0x16b2('0x13')](_0x455407));if(_0x455407[_0x16b2('0x14')]){if(_0x455407[_0x16b2('0x14')][_0x16b2('0x15')]===0x1f4){logger[_0x16b2('0x14')](_0x16b2('0xf'),_0x15990f,_0x455407[_0x16b2('0x14')][_0x16b2('0x16')]);return _0x5a38bc(_0x455407[_0x16b2('0x14')][_0x16b2('0x16')]);}logger['error'](_0x16b2('0xf'),_0x15990f,_0x455407[_0x16b2('0x14')][_0x16b2('0x16')]);return _0x58f21d(_0x455407[_0x16b2('0x14')][_0x16b2('0x16')]);}else{logger[_0x16b2('0xe')](_0x16b2('0xf'),_0x15990f,_0x16b2('0x10'));_0x58f21d(_0x455407['result'][_0x16b2('0x16')]);}})['catch'](function(_0x4c639d){logger[_0x16b2('0x14')](_0x16b2('0xf'),_0x15990f,_0x4c639d);_0x5a38bc(_0x4c639d);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index c995008..92769b3 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 _0x5fd1=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','create','put','update','multer','path','connect-timeout','express'];(function(_0xae16e0,_0x5656d6){var _0x542e66=function(_0x40ca14){while(--_0x40ca14){_0xae16e0['push'](_0xae16e0['shift']());}};_0x542e66(++_0x5656d6);}(_0x5fd1,0x155));var _0x15fd=function(_0x244a2c,_0x5eb691){_0x244a2c=_0x244a2c-0x0;var _0x1bb2db=_0x5fd1[_0x244a2c];return _0x1bb2db;};'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('./chatProactiveAction.controller');router[_0x15fd('0x7')](_0x15fd('0x8'),auth[_0x15fd('0x9')](),controller[_0x15fd('0xa')]);router[_0x15fd('0xb')]('/',auth['isAuthenticated'](),controller[_0x15fd('0xc')]);router[_0x15fd('0xd')](_0x15fd('0x8'),auth['isAuthenticated'](),controller[_0x15fd('0xe')]);router['delete'](_0x15fd('0x8'),auth[_0x15fd('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2eb2=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','/:id','isAuthenticated','show','post','create','put','update','delete','util'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x2eb2,0x19f));var _0x22eb=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x2eb2[_0x15bc81];return _0x59440e;};'use strict';var multer=require('multer');var util=require(_0x22eb('0x0'));var path=require(_0x22eb('0x1'));var timeout=require(_0x22eb('0x2'));var express=require(_0x22eb('0x3'));var router=express[_0x22eb('0x4')]();var fs_extra=require(_0x22eb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x22eb('0x6'));var config=require('../../config/environment');var controller=require('./chatProactiveAction.controller');router[_0x22eb('0x7')](_0x22eb('0x8'),auth[_0x22eb('0x9')](),controller[_0x22eb('0xa')]);router[_0x22eb('0xb')]('/',auth[_0x22eb('0x9')](),controller[_0x22eb('0xc')]);router[_0x22eb('0xd')](_0x22eb('0x8'),auth[_0x22eb('0x9')](),controller[_0x22eb('0xe')]);router[_0x22eb('0xf')]('/:id',auth[_0x22eb('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 b658961..e9f9dd7 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 _0x2356=['STRING','INTEGER','beepall','roundrobin','sequelize','exports'];(function(_0x4a27a5,_0x3ff927){var _0x3b05bb=function(_0x1f6cbf){while(--_0x1f6cbf){_0x4a27a5['push'](_0x4a27a5['shift']());}};_0x3b05bb(++_0x3ff927);}(_0x2356,0x106));var _0x6235=function(_0x3e0326,_0x137e73){_0x3e0326=_0x3e0326-0x0;var _0x12b5ac=_0x2356[_0x3e0326];return _0x12b5ac;};'use strict';var Sequelize=require(_0x6235('0x0'));module[_0x6235('0x1')]={'name':{'type':Sequelize[_0x6235('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6235('0x2')]},'timeout':{'type':Sequelize[_0x6235('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x6235('0x4'),_0x6235('0x5'))}}; \ No newline at end of file +var _0xc213=['sequelize','STRING','name','ENUM'];(function(_0x2e014a,_0x42c078){var _0x5e9a75=function(_0x103b34){while(--_0x103b34){_0x2e014a['push'](_0x2e014a['shift']());}};_0x5e9a75(++_0x42c078);}(_0xc213,0x17c));var _0x3c21=function(_0x612bf3,_0x4526f5){_0x612bf3=_0x612bf3-0x0;var _0x14444b=_0xc213[_0x612bf3];return _0x14444b;};'use strict';var Sequelize=require(_0x3c21('0x0'));module['exports']={'name':{'type':Sequelize[_0x3c21('0x1')],'unique':_0x3c21('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3c21('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3c21('0x3')]('rrmemory','beepall','roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 3c047c7..cd6479b 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 _0x2f31=['clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','union','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','ChatQueues','UserProfileResource','sendStatus','stack','name','index','map','ChatQueue','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','rows','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','UserChatQueue','order','ChatQueueId','options','User','findAndCountAll','UserId','agent','chatPause','updatedAt','format','%s/%s','createdAt','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','interface','transaction','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?'];(function(_0x432427,_0x5bbc3e){var _0x2ad98b=function(_0x38de21){while(--_0x38de21){_0x432427['push'](_0x432427['shift']());}};_0x2ad98b(++_0x5bbc3e);}(_0x2f31,0x1e0));var _0x12f3=function(_0x360c8a,_0x3acec4){_0x360c8a=_0x360c8a-0x0;var _0x3e5451=_0x2f31[_0x360c8a];return _0x3e5451;};'use strict';var emlformat=require(_0x12f3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x12f3('0x1'));var jsonpatch=require(_0x12f3('0x2'));var rp=require('request-promise');var moment=require(_0x12f3('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x12f3('0x4'));var util=require('util');var path=require(_0x12f3('0x5'));var sox=require(_0x12f3('0x6'));var csv=require(_0x12f3('0x7'));var ejs=require(_0x12f3('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x12f3('0x9'));var squel=require(_0x12f3('0xa'));var crypto=require(_0x12f3('0xb'));var jsforce=require(_0x12f3('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x12f3('0x7'));var querystring=require(_0x12f3('0xd'));var Papa=require(_0x12f3('0xe'));var Redis=require(_0x12f3('0xf'));var authService=require(_0x12f3('0x10'));var qs=require(_0x12f3('0x11'));var as=require(_0x12f3('0x12'));var hardwareService=require(_0x12f3('0x13'));var logger=require(_0x12f3('0x14'))('api');var utils=require(_0x12f3('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x12f3('0x16'));var db=require(_0x12f3('0x17'))['db'];config[_0x12f3('0x18')]=_[_0x12f3('0x19')](config[_0x12f3('0x18')],{'host':_0x12f3('0x1a'),'port':0x18eb});var socket=require(_0x12f3('0x1b'))(new Redis(config[_0x12f3('0x18')]));require(_0x12f3('0x1c'))[_0x12f3('0x1d')](socket);var jayson=require(_0x12f3('0x1e'));var client=jayson[_0x12f3('0x1f')][_0x12f3('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x2f3f9e,_0x1d1f5e,_0x592f85,_0x111054){return new BPromise(function(_0x37d25f,_0x116d6a){var _0x12349d=_0x111054||client;return _0x12349d[_0x12f3('0x21')](_0x2f3f9e,_0x592f85)[_0x12f3('0x22')](function(_0x19c636){logger[_0x12f3('0x23')](_0x12f3('0x24'),_0x1d1f5e,_0x12f3('0x25'));logger[_0x12f3('0x26')](_0x12f3('0x27'),_0x1d1f5e,_0x12f3('0x25'),JSON['stringify'](_0x19c636));if(_0x19c636[_0x12f3('0x28')]){if(_0x19c636[_0x12f3('0x28')][_0x12f3('0x29')]===0x1f4){logger[_0x12f3('0x28')]('ChatQueue,\x20%s,\x20%s',_0x1d1f5e,_0x19c636[_0x12f3('0x28')][_0x12f3('0x2a')]);return _0x116d6a(_0x19c636[_0x12f3('0x28')]['message']);}logger[_0x12f3('0x28')]('ChatQueue,\x20%s,\x20%s',_0x1d1f5e,_0x19c636[_0x12f3('0x28')][_0x12f3('0x2a')]);return _0x37d25f(_0x19c636[_0x12f3('0x28')]['message']);}else{logger[_0x12f3('0x23')]('ChatQueue,\x20%s,\x20%s',_0x1d1f5e,_0x12f3('0x25'));_0x37d25f(_0x19c636[_0x12f3('0x2b')][_0x12f3('0x2a')]);}})[_0x12f3('0x2c')](function(_0x17cd15){logger[_0x12f3('0x28')]('ChatQueue,\x20%s,\x20%s',_0x1d1f5e,_0x17cd15);_0x116d6a(_0x17cd15);});});}function respondWithStatusCode(_0x99762d,_0x33874f){_0x33874f=_0x33874f||0xcc;return function(_0x2cecf1){if(_0x2cecf1){return _0x99762d['sendStatus'](_0x33874f);}return _0x99762d[_0x12f3('0x2d')](_0x33874f)[_0x12f3('0x2e')]();};}function respondWithResult(_0x567f16,_0x3a086f){_0x3a086f=_0x3a086f||0xc8;return function(_0x27b81f){if(_0x27b81f){return _0x567f16[_0x12f3('0x2d')](_0x3a086f)[_0x12f3('0x2f')](_0x27b81f);}};}function respondWithFilteredResult(_0xb89693,_0x55a7aa){return function(_0x10115d){if(_0x10115d){var _0x640e3d=typeof _0x55a7aa[_0x12f3('0x30')]===_0x12f3('0x31')&&typeof _0x55a7aa[_0x12f3('0x32')]==='undefined';var _0x3a1fec=_0x10115d[_0x12f3('0x33')];var _0x2abb53=_0x640e3d?0x0:_0x55a7aa[_0x12f3('0x30')];var _0xf7e8a8=_0x640e3d?_0x10115d[_0x12f3('0x33')]:_0x55a7aa[_0x12f3('0x30')]+_0x55a7aa[_0x12f3('0x32')];var _0x2b8a0e;if(_0xf7e8a8>=_0x3a1fec){_0xf7e8a8=_0x3a1fec;_0x2b8a0e=0xc8;}else{_0x2b8a0e=0xce;}_0xb89693[_0x12f3('0x2d')](_0x2b8a0e);return _0xb89693[_0x12f3('0x34')](_0x12f3('0x35'),_0x2abb53+'-'+_0xf7e8a8+'/'+_0x3a1fec)[_0x12f3('0x2f')](_0x10115d);}return null;};}function patchUpdates(_0x5bb31f){return function(_0x451d02){try{jsonpatch[_0x12f3('0x36')](_0x451d02,_0x5bb31f,!![]);}catch(_0xef6924){return BPromise['reject'](_0xef6924);}return _0x451d02[_0x12f3('0x37')]();};}function saveUpdates(_0x57dcdc,_0x46875d){return function(_0x5817ab){if(_0x5817ab){return _0x5817ab[_0x12f3('0x38')](_0x57dcdc)[_0x12f3('0x22')](function(_0xcaca09){return _0xcaca09;});}return null;};}function removeEntity(_0x5e0d4f,_0x412904){return function(_0x33e53f){if(_0x33e53f){return _0x33e53f[_0x12f3('0x39')]()['then'](function(){var _0x1623b3=_0x33e53f['get']({'plain':!![]});var _0x2bdad1=_0x12f3('0x3a');return db[_0x12f3('0x3b')][_0x12f3('0x39')]({'where':{'type':_0x2bdad1,'resourceId':_0x1623b3['id']}})[_0x12f3('0x22')](function(){return _0x33e53f;});})[_0x12f3('0x22')](function(){_0x5e0d4f[_0x12f3('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf1a1fb,_0x14dc21){return function(_0x5be8fa){if(!_0x5be8fa){_0xf1a1fb[_0x12f3('0x3c')](0x194);}return _0x5be8fa;};}function handleError(_0x5893ca,_0x2b367f){_0x2b367f=_0x2b367f||0x1f4;return function(_0x30b711){logger['error'](_0x30b711[_0x12f3('0x3d')]);if(_0x30b711[_0x12f3('0x3e')]){delete _0x30b711[_0x12f3('0x3e')];}_0x5893ca['status'](_0x2b367f)['send'](_0x30b711);};}exports[_0x12f3('0x3f')]=function(_0x114996,_0xfbd59c){var _0x53ed78={},_0x23a86e={},_0x54a9d8={'count':0x0,'rows':[]};var _0xc9367d=_[_0x12f3('0x40')](db[_0x12f3('0x41')][_0x12f3('0x42')],function(_0x2fe954){return{'name':_0x2fe954['fieldName'],'type':_0x2fe954[_0x12f3('0x43')][_0x12f3('0x44')]};});_0x23a86e['model']=_['map'](_0xc9367d,_0x12f3('0x3e'));_0x23a86e[_0x12f3('0x45')]=_[_0x12f3('0x46')](_0x114996[_0x12f3('0x45')]);_0x23a86e['filters']=_[_0x12f3('0x47')](_0x23a86e[_0x12f3('0x48')],_0x23a86e[_0x12f3('0x45')]);_0x53ed78[_0x12f3('0x49')]=_[_0x12f3('0x47')](_0x23a86e[_0x12f3('0x48')],qs[_0x12f3('0x4a')](_0x114996[_0x12f3('0x45')][_0x12f3('0x4a')]));_0x53ed78[_0x12f3('0x49')]=_0x53ed78[_0x12f3('0x49')][_0x12f3('0x4b')]?_0x53ed78[_0x12f3('0x49')]:_0x23a86e['model'];if(!_0x114996[_0x12f3('0x45')][_0x12f3('0x4c')](_0x12f3('0x4d'))){_0x53ed78[_0x12f3('0x32')]=qs[_0x12f3('0x32')](_0x114996[_0x12f3('0x45')][_0x12f3('0x32')]);_0x53ed78['offset']=qs[_0x12f3('0x30')](_0x114996[_0x12f3('0x45')][_0x12f3('0x30')]);}_0x53ed78['order']=qs[_0x12f3('0x4e')](_0x114996['query']['sort']);_0x53ed78[_0x12f3('0x4f')]=qs[_0x12f3('0x50')](_[_0x12f3('0x51')](_0x114996[_0x12f3('0x45')],_0x23a86e[_0x12f3('0x50')]),_0xc9367d);if(_0x114996[_0x12f3('0x45')][_0x12f3('0x52')]){_0x53ed78[_0x12f3('0x4f')]=_['merge'](_0x53ed78[_0x12f3('0x4f')],{'$or':_[_0x12f3('0x40')](_0xc9367d,function(_0x1ff09d){if(_0x1ff09d['type']!==_0x12f3('0x53')){var _0x3ada60={};_0x3ada60[_0x1ff09d[_0x12f3('0x3e')]]={'$like':'%'+_0x114996[_0x12f3('0x45')][_0x12f3('0x52')]+'%'};return _0x3ada60;}})});}_0x53ed78=_[_0x12f3('0x54')]({},_0x53ed78,_0x114996['options']);var _0x314a5f={'where':_0x53ed78[_0x12f3('0x4f')]};return db['ChatQueue'][_0x12f3('0x33')](_0x314a5f)[_0x12f3('0x22')](function(_0x3f99e4){_0x54a9d8[_0x12f3('0x33')]=_0x3f99e4;if(_0x114996[_0x12f3('0x45')][_0x12f3('0x55')]){_0x53ed78[_0x12f3('0x56')]=[{'all':!![]}];}return db[_0x12f3('0x41')]['findAll'](_0x53ed78);})[_0x12f3('0x22')](function(_0x23069f){_0x54a9d8[_0x12f3('0x57')]=_0x23069f;return _0x54a9d8;})[_0x12f3('0x22')](respondWithFilteredResult(_0xfbd59c,_0x53ed78))['catch'](handleError(_0xfbd59c,null));};exports['show']=function(_0x27c201,_0x46726d){var _0x9cab10={'raw':!![],'where':{'id':_0x27c201[_0x12f3('0x58')]['id']}},_0x10d8cf={};_0x10d8cf[_0x12f3('0x48')]=_[_0x12f3('0x46')](db[_0x12f3('0x41')][_0x12f3('0x42')]);_0x10d8cf[_0x12f3('0x45')]=_[_0x12f3('0x46')](_0x27c201[_0x12f3('0x45')]);_0x10d8cf[_0x12f3('0x50')]=_[_0x12f3('0x47')](_0x10d8cf[_0x12f3('0x48')],_0x10d8cf[_0x12f3('0x45')]);_0x9cab10[_0x12f3('0x49')]=_[_0x12f3('0x47')](_0x10d8cf[_0x12f3('0x48')],qs[_0x12f3('0x4a')](_0x27c201['query'][_0x12f3('0x4a')]));_0x9cab10[_0x12f3('0x49')]=_0x9cab10[_0x12f3('0x49')]['length']?_0x9cab10[_0x12f3('0x49')]:_0x10d8cf['model'];if(_0x27c201['query'][_0x12f3('0x55')]){_0x9cab10[_0x12f3('0x56')]=[{'all':!![]}];}_0x9cab10=_[_0x12f3('0x54')]({},_0x9cab10,_0x27c201['options']);return db['ChatQueue'][_0x12f3('0x59')](_0x9cab10)[_0x12f3('0x22')](handleEntityNotFound(_0x46726d,null))[_0x12f3('0x22')](respondWithResult(_0x46726d,null))[_0x12f3('0x2c')](handleError(_0x46726d,null));};exports[_0x12f3('0x5a')]=function(_0x41bcbf,_0x4c5e95){return db[_0x12f3('0x41')]['create'](_0x41bcbf[_0x12f3('0x5b')],{})[_0x12f3('0x22')](function(_0x299564){var _0x5b85a4=_0x41bcbf[_0x12f3('0x5c')][_0x12f3('0x5d')]({'plain':!![]});if(!_0x5b85a4)throw new Error(_0x12f3('0x5e'));if(_0x5b85a4[_0x12f3('0x5f')]===_0x12f3('0x5c')){var _0x132325=_0x299564[_0x12f3('0x5d')]({'plain':!![]});var _0x20c6e5='ChatQueues';return db['UserProfileSection'][_0x12f3('0x59')]({'where':{'name':_0x20c6e5,'userProfileId':_0x5b85a4[_0x12f3('0x60')]},'raw':!![]})[_0x12f3('0x22')](function(_0xdb2946){if(_0xdb2946&&_0xdb2946[_0x12f3('0x61')]===0x0){return db[_0x12f3('0x3b')][_0x12f3('0x5a')]({'name':_0x132325[_0x12f3('0x3e')],'resourceId':_0x132325['id'],'type':_0xdb2946[_0x12f3('0x3e')],'sectionId':_0xdb2946['id']},{})[_0x12f3('0x22')](function(){return _0x299564;});}else{return _0x299564;}})[_0x12f3('0x2c')](function(_0x42bd8f){logger['error'](_0x12f3('0x62'),_0x42bd8f);throw _0x42bd8f;});}return _0x299564;})['then'](respondWithResult(_0x4c5e95,0xc9))[_0x12f3('0x2c')](handleError(_0x4c5e95,null));};exports[_0x12f3('0x38')]=function(_0x1e49f4,_0x41ddc0){if(_0x1e49f4[_0x12f3('0x5b')]['id']){delete _0x1e49f4[_0x12f3('0x5b')]['id'];}return db['ChatQueue'][_0x12f3('0x59')]({'where':{'id':_0x1e49f4[_0x12f3('0x58')]['id']}})[_0x12f3('0x22')](handleEntityNotFound(_0x41ddc0,null))['then'](saveUpdates(_0x1e49f4[_0x12f3('0x5b')],null))['then'](respondWithResult(_0x41ddc0,null))[_0x12f3('0x2c')](handleError(_0x41ddc0,null));};exports[_0x12f3('0x39')]=function(_0x87f129,_0x51d993){return db[_0x12f3('0x41')][_0x12f3('0x59')]({'where':{'id':_0x87f129[_0x12f3('0x58')]['id']}})[_0x12f3('0x22')](handleEntityNotFound(_0x51d993,null))['then'](removeEntity(_0x51d993,null))[_0x12f3('0x2c')](handleError(_0x51d993,null));};exports[_0x12f3('0x63')]=function(_0x244a52,_0x4d0550){return db[_0x12f3('0x41')]['describe']()['then'](respondWithResult(_0x4d0550,null))['catch'](handleError(_0x4d0550,null));};exports['getMembers']=function(_0x263248,_0x50936d,_0x5e4496){var _0x56789a={'raw':!![],'where':{}},_0x31e822={},_0x3ae96f;return db[_0x12f3('0x41')]['findOne']({'where':{'id':_0x263248[_0x12f3('0x58')]['id']}})[_0x12f3('0x22')](handleEntityNotFound(_0x50936d,null))['then'](function(_0x23a315){if(_0x23a315){_0x3ae96f=_0x23a315[_0x12f3('0x5d')]({'plain':!![]});_0x31e822[_0x12f3('0x48')]=_[_0x12f3('0x46')](db[_0x12f3('0x64')]['rawAttributes']);_0x31e822[_0x12f3('0x45')]=_[_0x12f3('0x46')](_0x263248['query']);_0x31e822[_0x12f3('0x50')]=_['intersection'](_0x31e822[_0x12f3('0x48')],_0x31e822[_0x12f3('0x45')]);_0x56789a[_0x12f3('0x49')]=_[_0x12f3('0x47')](_0x31e822['model'],qs['fields'](_0x263248[_0x12f3('0x45')][_0x12f3('0x4a')]));_0x56789a[_0x12f3('0x49')]=_0x56789a[_0x12f3('0x49')][_0x12f3('0x4b')]?_0x56789a[_0x12f3('0x49')]:_0x31e822[_0x12f3('0x48')];if(!_0x263248[_0x12f3('0x45')][_0x12f3('0x4c')](_0x12f3('0x4d'))){_0x56789a[_0x12f3('0x32')]=qs[_0x12f3('0x32')](_0x263248[_0x12f3('0x45')]['limit']);_0x56789a[_0x12f3('0x30')]=qs[_0x12f3('0x30')](_0x263248[_0x12f3('0x45')]['offset']);}_0x56789a[_0x12f3('0x65')]=qs[_0x12f3('0x4e')](_0x263248[_0x12f3('0x45')][_0x12f3('0x4e')]);_0x56789a[_0x12f3('0x4f')]=qs[_0x12f3('0x50')](_[_0x12f3('0x51')](_0x263248[_0x12f3('0x45')],_0x31e822['filters']));_0x56789a[_0x12f3('0x4f')][_0x12f3('0x66')]=_0x23a315['id'];if(_0x263248[_0x12f3('0x45')][_0x12f3('0x52')]){_0x56789a[_0x12f3('0x4f')]=_[_0x12f3('0x54')](_0x56789a[_0x12f3('0x4f')],{'$or':_[_0x12f3('0x40')](_0x56789a[_0x12f3('0x49')],function(_0x16c0e9){var _0xa435eb={};_0xa435eb[_0x16c0e9]={'$like':'%'+_0x263248['query'][_0x12f3('0x52')]+'%'};return _0xa435eb;})});}_0x56789a=_[_0x12f3('0x54')]({},_0x56789a,_0x263248[_0x12f3('0x67')]);return db[_0x12f3('0x64')]['findAll'](_0x56789a);}})[_0x12f3('0x22')](function(_0x2c4b8b){if(_0x2c4b8b){return db[_0x12f3('0x68')][_0x12f3('0x69')]({'where':{'id':_['map'](_0x2c4b8b,_0x12f3('0x6a')),'role':_0x12f3('0x6b')},'attributes':['id','name',_0x12f3('0x6c'),_0x12f3('0x6d'),'createdAt']});}})[_0x12f3('0x22')](function(_0x4088f4){if(_0x4088f4){return{'count':_0x4088f4[_0x12f3('0x33')],'rows':_[_0x12f3('0x40')](_0x4088f4[_0x12f3('0x57')],function(_0xa44f18){return{'membername':_0xa44f18[_0x12f3('0x3e')],'UserId':_0xa44f18['id'],'queue_name':_0x3ae96f['name'],'ChatQueueId':_0x3ae96f['id'],'interface':util[_0x12f3('0x6e')](_0x12f3('0x6f'),'SIP',_0xa44f18['name']),'penalty':0x0,'paused':_0xa44f18['chatPause'],'createdAt':_0xa44f18[_0x12f3('0x70')],'updatedAt':_0xa44f18[_0x12f3('0x6d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x12f3('0x22')](respondWithFilteredResult(_0x50936d,_0x56789a))['catch'](handleError(_0x50936d,null));};exports[_0x12f3('0x71')]=function(_0xc4201,_0x5d223c,_0x367bd2){var _0x47c53a={};var _0x59e7c6={};var _0x34b090;var _0x5d0d63;return db[_0x12f3('0x41')][_0x12f3('0x72')]({'where':{'id':_0xc4201[_0x12f3('0x58')]['id']}})[_0x12f3('0x22')](handleEntityNotFound(_0x5d223c,null))[_0x12f3('0x22')](function(_0x53acad){if(_0x53acad){_0x34b090=_0x53acad;_0x59e7c6['model']=_[_0x12f3('0x46')](db[_0x12f3('0x73')][_0x12f3('0x42')]);_0x59e7c6[_0x12f3('0x45')]=_['keys'](_0xc4201[_0x12f3('0x45')]);_0x59e7c6[_0x12f3('0x50')]=_[_0x12f3('0x47')](_0x59e7c6[_0x12f3('0x48')],_0x59e7c6[_0x12f3('0x45')]);_0x47c53a[_0x12f3('0x49')]=_[_0x12f3('0x47')](_0x59e7c6[_0x12f3('0x48')],qs['fields'](_0xc4201[_0x12f3('0x45')][_0x12f3('0x4a')]));_0x47c53a[_0x12f3('0x49')]=_0x47c53a['attributes']['length']?_0x47c53a[_0x12f3('0x49')]:_0x59e7c6[_0x12f3('0x48')];_0x47c53a[_0x12f3('0x65')]=qs[_0x12f3('0x4e')](_0xc4201[_0x12f3('0x45')][_0x12f3('0x4e')]);_0x47c53a[_0x12f3('0x4f')]=qs['filters'](_[_0x12f3('0x51')](_0xc4201[_0x12f3('0x45')],_0x59e7c6['filters']));if(_0xc4201[_0x12f3('0x45')][_0x12f3('0x52')]){_0x47c53a[_0x12f3('0x4f')]=_['merge'](_0x47c53a[_0x12f3('0x4f')],{'$or':_['map'](_0x47c53a[_0x12f3('0x49')],function(_0x464445){var _0x119514={};_0x119514[_0x464445]={'$like':'%'+_0xc4201[_0x12f3('0x45')][_0x12f3('0x52')]+'%'};return _0x119514;})});}_0x47c53a=_[_0x12f3('0x54')]({},_0x47c53a,_0xc4201[_0x12f3('0x67')]);return _0x34b090[_0x12f3('0x71')](_0x47c53a);}})[_0x12f3('0x22')](function(_0x1f9f07){if(_0x1f9f07){_0x5d0d63=_0x1f9f07['length'];if(!_0xc4201[_0x12f3('0x45')][_0x12f3('0x4c')](_0x12f3('0x4d'))){_0x47c53a[_0x12f3('0x32')]=qs[_0x12f3('0x32')](_0xc4201[_0x12f3('0x45')][_0x12f3('0x32')]);_0x47c53a[_0x12f3('0x30')]=qs[_0x12f3('0x30')](_0xc4201[_0x12f3('0x45')][_0x12f3('0x30')]);}return _0x34b090[_0x12f3('0x71')](_0x47c53a);}})['then'](function(_0x6e7b77){if(_0x6e7b77){return _0x6e7b77?{'count':_0x5d0d63,'rows':_0x6e7b77}:null;}})['then'](respondWithResult(_0x5d223c,null))['catch'](handleError(_0x5d223c,null));};exports[_0x12f3('0x74')]=function(_0xf5383a,_0xdac67f,_0x5c970c){var _0x3cc24b=_0xf5383a[_0x12f3('0x5b')][_0x12f3('0x75')];return db[_0x12f3('0x73')]['findAll']({'where':{'id':_0x3cc24b},'attributes':['id'],'include':[{'model':db[_0x12f3('0x68')],'as':_0x12f3('0x76'),'attributes':['id','name',_0x12f3('0x77'),_0x12f3('0x78'),_0x12f3('0x79')],'raw':!![]}]})[_0x12f3('0x22')](function(_0x108e4f){if(_0x108e4f){var _0x511b40=_['flatMap'](_0x108e4f,function(_0x58b125){var _0x2b03fb=_0x58b125[_0x12f3('0x5d')]({'plain':!![]});return _0x2b03fb[_0x12f3('0x76')];});return db[_0x12f3('0x41')]['find']({'where':{'id':_0xf5383a[_0x12f3('0x58')]['id']}})[_0x12f3('0x22')](function(_0x3b7f42){return db['sequelize'][_0x12f3('0x7a')](function(_0x456a86){return _0x3b7f42[_0x12f3('0x74')](_0x3cc24b,{'transaction':_0x456a86})[_0x12f3('0x22')](function(){return BPromise['each'](_0x511b40,function(_0xc9c41f){return db[_0x12f3('0x64')]['findOrCreate']({'where':{'UserId':_0xc9c41f['id'],'ChatQueueId':_0xf5383a[_0x12f3('0x58')]['id']},'transaction':_0x456a86});});})[_0x12f3('0x22')](function(){_0x511b40[_0x12f3('0x7b')](function(_0x58f248){socket[_0x12f3('0x7c')](_0x12f3('0x7d'),{'UserId':_0x58f248['id'],'ChatQueueId':_0x3b7f42['id']});});});});});}})[_0x12f3('0x22')](respondWithStatusCode(_0xdac67f,null))[_0x12f3('0x2c')](handleError(_0xdac67f,null));};exports[_0x12f3('0x7e')]=function(_0x2e9480,_0x55c962,_0xd2e1e0){return db[_0x12f3('0x73')]['findAll']({'where':{'id':_0x2e9480[_0x12f3('0x45')][_0x12f3('0x75')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x12f3('0x76'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x55c962,null))['then'](function(_0x3fcef6){var _0x1f97e6=_[_0x12f3('0x40')](_0x3fcef6,'id');var _0x4ef7b9=[];var _0x35b63d=[];var _0x5e7d39=squel[_0x12f3('0x7f')]();_0x5e7d39[_0x12f3('0x80')](_0x12f3('0x81'))[_0x12f3('0x82')](_0x12f3('0x83'),'tq')[_0x12f3('0x84')](_0x12f3('0x85'),'ut',_0x12f3('0x86'))[_0x12f3('0x4f')](_0x12f3('0x87'),_0x2e9480[_0x12f3('0x58')]['id']);for(var _0x4e0b86=0x0;_0x4e0b86<_0x3fcef6[_0x12f3('0x4b')];_0x4e0b86+=0x1){let _0x441b28=_0x3fcef6[_0x4e0b86];for(var _0x32998c=0x0;_0x32998c<_0x441b28[_0x12f3('0x76')]['length'];_0x32998c+=0x1){let _0x198499=_0x441b28['Agents'][_0x32998c];var _0x131208=_0x5e7d39[_0x12f3('0x88')]();_0x131208[_0x12f3('0x4f')](_0x12f3('0x89'),_0x198499['id']);_0x35b63d[_0x12f3('0x8a')](db[_0x12f3('0x8b')][_0x12f3('0x45')](_0x131208[_0x12f3('0x8c')](),{'type':db[_0x12f3('0x8b')][_0x12f3('0x8d')][_0x12f3('0x8e')]})['then'](function(_0x4cd74b){if(_0x4cd74b['length']===0x1){return _0x198499['id'];}else{var _0x1dee67=_[_0x12f3('0x8f')](_[_0x12f3('0x40')](_0x4cd74b,_0x12f3('0x90')),function(_0xdfd3dc){return _[_0x12f3('0x91')](_0x1f97e6,_0xdfd3dc);});if(_0x1dee67){return _0x198499['id'];}}}));}}return BPromise['all'](_0x35b63d)[_0x12f3('0x22')](function(_0x1e9f48){_0x4ef7b9=_(_0x4ef7b9)[_0x12f3('0x92')](_0x1e9f48)['compact']()['value']();return db[_0x12f3('0x41')][_0x12f3('0x59')]({'where':{'id':_0x2e9480[_0x12f3('0x58')]['id']}})[_0x12f3('0x22')](function(_0x2b0cd8){return db['sequelize'][_0x12f3('0x7a')](function(_0x1457f8){return _0x2b0cd8['removeTeams'](_0x2e9480[_0x12f3('0x45')][_0x12f3('0x75')],{'transaction':_0x1457f8})['then'](function(){if(!_['isEmpty'](_0x4ef7b9)){return _0x2b0cd8[_0x12f3('0x93')](_0x4ef7b9,{'transaction':_0x1457f8});}})['then'](function(){_0x4ef7b9[_0x12f3('0x7b')](function(_0xc96675){socket['emit'](_0x12f3('0x94'),{'UserId':_0xc96675,'ChatQueueId':_0x2b0cd8['id']});});});});});});})[_0x12f3('0x22')](respondWithStatusCode(_0x55c962,null))[_0x12f3('0x2c')](handleError(_0x55c962,null));};exports[_0x12f3('0x95')]=function(_0x43d51f,_0x4a3322,_0x2e2d1b){return db[_0x12f3('0x41')]['find']({'where':{'id':_0x43d51f[_0x12f3('0x58')]['id']}})[_0x12f3('0x22')](handleEntityNotFound(_0x4a3322,null))[_0x12f3('0x22')](function(_0x4f748c){if(_0x4f748c){return _0x4f748c[_0x12f3('0x95')](_0x43d51f['body'][_0x12f3('0x75')],_[_0x12f3('0x96')](_0x43d51f[_0x12f3('0x5b')],[_0x12f3('0x75'),'id'])||{})[_0x12f3('0x97')](function(_0x17b8de){for(var _0x23c2d6=0x0;_0x23c2d6<_0x43d51f[_0x12f3('0x5b')][_0x12f3('0x75')]['length'];_0x23c2d6+=0x1){socket['emit'](_0x12f3('0x7d'),{'UserId':Number(_0x43d51f[_0x12f3('0x5b')]['ids'][_0x23c2d6]),'ChatQueueId':Number(_0x43d51f[_0x12f3('0x58')]['id'])});}return _0x17b8de;});}})[_0x12f3('0x22')](respondWithResult(_0x4a3322,null))[_0x12f3('0x2c')](handleError(_0x4a3322,null));};exports['removeAgents']=function(_0x55998a,_0x3bc56e,_0x2fe57e){return db['ChatQueue'][_0x12f3('0x59')]({'where':{'id':_0x55998a['params']['id']}})[_0x12f3('0x22')](handleEntityNotFound(_0x3bc56e,null))[_0x12f3('0x22')](function(_0x5bed29){if(_0x5bed29){return _0x5bed29[_0x12f3('0x93')](_0x55998a[_0x12f3('0x45')][_0x12f3('0x75')])[_0x12f3('0x22')](function(){if(_[_0x12f3('0x98')](_0x55998a[_0x12f3('0x45')][_0x12f3('0x75')])){for(var _0x5ec565=0x0;_0x5ec565<_0x55998a[_0x12f3('0x45')][_0x12f3('0x75')][_0x12f3('0x4b')];_0x5ec565+=0x1){socket[_0x12f3('0x7c')](_0x12f3('0x94'),{'UserId':Number(_0x55998a['query'][_0x12f3('0x75')][_0x5ec565]),'ChatQueueId':Number(_0x55998a[_0x12f3('0x58')]['id'])});}}else{socket['emit'](_0x12f3('0x94'),{'UserId':Number(_0x55998a[_0x12f3('0x45')][_0x12f3('0x75')]),'ChatQueueId':Number(_0x55998a[_0x12f3('0x58')]['id'])});}});}})[_0x12f3('0x22')](respondWithStatusCode(_0x3bc56e,null))[_0x12f3('0x2c')](handleError(_0x3bc56e,null));};exports[_0x12f3('0x99')]=function(_0x1fa010,_0xecadfa,_0x3a0cae){var _0x3c3de4={};var _0x4e3b1d={};var _0x6798f5;var _0x190a56;return db['ChatQueue'][_0x12f3('0x72')]({'where':{'id':_0x1fa010[_0x12f3('0x58')]['id']}})[_0x12f3('0x22')](handleEntityNotFound(_0xecadfa,null))[_0x12f3('0x22')](function(_0x2730ee){if(_0x2730ee){_0x6798f5=_0x2730ee;_0x4e3b1d['model']=_[_0x12f3('0x46')](db[_0x12f3('0x68')][_0x12f3('0x42')]);_0x4e3b1d['query']=_[_0x12f3('0x46')](_0x1fa010['query']);_0x4e3b1d[_0x12f3('0x50')]=_[_0x12f3('0x47')](_0x4e3b1d[_0x12f3('0x48')],_0x4e3b1d[_0x12f3('0x45')]);_0x3c3de4['attributes']=_[_0x12f3('0x47')](_0x4e3b1d[_0x12f3('0x48')],qs[_0x12f3('0x4a')](_0x1fa010[_0x12f3('0x45')][_0x12f3('0x4a')]));_0x3c3de4[_0x12f3('0x49')]=_0x3c3de4[_0x12f3('0x49')][_0x12f3('0x4b')]?_0x3c3de4[_0x12f3('0x49')]:_0x4e3b1d[_0x12f3('0x48')];_0x3c3de4['order']=qs[_0x12f3('0x4e')](_0x1fa010[_0x12f3('0x45')][_0x12f3('0x4e')]);_0x3c3de4[_0x12f3('0x4f')]=qs['filters'](_[_0x12f3('0x51')](_0x1fa010[_0x12f3('0x45')],_0x4e3b1d['filters']));if(_0x1fa010[_0x12f3('0x45')][_0x12f3('0x52')]){_0x3c3de4['where']=_[_0x12f3('0x54')](_0x3c3de4[_0x12f3('0x4f')],{'$or':_['map'](_0x3c3de4['attributes'],function(_0x10e4c4){var _0x19dca2={};_0x19dca2[_0x10e4c4]={'$like':'%'+_0x1fa010[_0x12f3('0x45')]['filter']+'%'};return _0x19dca2;})});}_0x3c3de4=_[_0x12f3('0x54')]({},_0x3c3de4,_0x1fa010[_0x12f3('0x67')]);return _0x6798f5[_0x12f3('0x99')](_0x3c3de4);}})[_0x12f3('0x22')](function(_0x1b9fc5){if(_0x1b9fc5){_0x190a56=_0x1b9fc5[_0x12f3('0x4b')];if(!_0x1fa010[_0x12f3('0x45')][_0x12f3('0x4c')]('nolimit')){_0x3c3de4[_0x12f3('0x32')]=qs[_0x12f3('0x32')](_0x1fa010[_0x12f3('0x45')][_0x12f3('0x32')]);_0x3c3de4[_0x12f3('0x30')]=qs[_0x12f3('0x30')](_0x1fa010[_0x12f3('0x45')][_0x12f3('0x30')]);}return _0x6798f5[_0x12f3('0x99')](_0x3c3de4);}})[_0x12f3('0x22')](function(_0x455595){if(_0x455595){return _0x455595?{'count':_0x190a56,'rows':_0x455595}:null;}})[_0x12f3('0x22')](respondWithResult(_0xecadfa,null))[_0x12f3('0x2c')](handleError(_0xecadfa,null));}; \ No newline at end of file +var _0xa293=['count','set','reject','update','then','destroy','ChatQueues','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filters','filter','VIRTUAL','merge','includeAll','include','rows','show','length','options','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','sort','ChatQueueId','UserChatQueue','findAll','User','findAndCountAll','agent','chatPause','updatedAt','createdAt','SIP','getTeams','Team','addTeams','ids','online','flatMap','Agents','sequelize','each','forEach','emit','removeTeams','field','tq.TeamId','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','all','union','compact','value','transaction','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','userChatQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','register','jayson/promise','client','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','status','end','json','offset','limit','undefined'];(function(_0x5ace32,_0xe6d11d){var _0x70dd6=function(_0x33e914){while(--_0x33e914){_0x5ace32['push'](_0x5ace32['shift']());}};_0x70dd6(++_0xe6d11d);}(_0xa293,0xfa));var _0x3a29=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa293[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0x3a29('0x0'));var rimraf=require(_0x3a29('0x1'));var zipdir=require(_0x3a29('0x2'));var jsonpatch=require(_0x3a29('0x3'));var rp=require(_0x3a29('0x4'));var moment=require(_0x3a29('0x5'));var BPromise=require(_0x3a29('0x6'));var Mustache=require(_0x3a29('0x7'));var util=require(_0x3a29('0x8'));var path=require(_0x3a29('0x9'));var sox=require(_0x3a29('0xa'));var csv=require(_0x3a29('0xb'));var ejs=require(_0x3a29('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3a29('0xd'));var crypto=require(_0x3a29('0xe'));var jsforce=require(_0x3a29('0xf'));var deskjs=require(_0x3a29('0x10'));var toCsv=require(_0x3a29('0xb'));var querystring=require(_0x3a29('0x11'));var Papa=require(_0x3a29('0x12'));var Redis=require(_0x3a29('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x3a29('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3a29('0x15'));var logger=require('../../config/logger')(_0x3a29('0x16'));var utils=require(_0x3a29('0x17'));var config=require(_0x3a29('0x18'));var licenseUtil=require(_0x3a29('0x19'));var db=require(_0x3a29('0x1a'))['db'];config[_0x3a29('0x1b')]=_[_0x3a29('0x1c')](config[_0x3a29('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3a29('0x1b')]));require('./chatQueue.socket')[_0x3a29('0x1d')](socket);var jayson=require(_0x3a29('0x1e'));var client=jayson[_0x3a29('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x158f3f,_0x4be6cf,_0x62e36a,_0x41e1b3){return new BPromise(function(_0x5983a1,_0x1ecd29){var _0x96df2f=_0x41e1b3||client;return _0x96df2f['request'](_0x158f3f,_0x62e36a)['then'](function(_0x459c62){logger['info'](_0x3a29('0x20'),_0x4be6cf,_0x3a29('0x21'));logger[_0x3a29('0x22')](_0x3a29('0x23'),_0x4be6cf,_0x3a29('0x21'),JSON[_0x3a29('0x24')](_0x459c62));if(_0x459c62[_0x3a29('0x25')]){if(_0x459c62[_0x3a29('0x25')]['code']===0x1f4){logger['error'](_0x3a29('0x20'),_0x4be6cf,_0x459c62[_0x3a29('0x25')][_0x3a29('0x26')]);return _0x1ecd29(_0x459c62[_0x3a29('0x25')][_0x3a29('0x26')]);}logger['error'](_0x3a29('0x20'),_0x4be6cf,_0x459c62[_0x3a29('0x25')][_0x3a29('0x26')]);return _0x5983a1(_0x459c62[_0x3a29('0x25')][_0x3a29('0x26')]);}else{logger[_0x3a29('0x27')](_0x3a29('0x20'),_0x4be6cf,_0x3a29('0x21'));_0x5983a1(_0x459c62[_0x3a29('0x28')][_0x3a29('0x26')]);}})[_0x3a29('0x29')](function(_0x26f364){logger[_0x3a29('0x25')](_0x3a29('0x20'),_0x4be6cf,_0x26f364);_0x1ecd29(_0x26f364);});});}function respondWithStatusCode(_0x10f6e6,_0x3d5752){_0x3d5752=_0x3d5752||0xcc;return function(_0x4d7e44){if(_0x4d7e44){return _0x10f6e6['sendStatus'](_0x3d5752);}return _0x10f6e6[_0x3a29('0x2a')](_0x3d5752)[_0x3a29('0x2b')]();};}function respondWithResult(_0x511698,_0x15bf90){_0x15bf90=_0x15bf90||0xc8;return function(_0x5434e7){if(_0x5434e7){return _0x511698['status'](_0x15bf90)[_0x3a29('0x2c')](_0x5434e7);}};}function respondWithFilteredResult(_0x1cab9b,_0x3525df){return function(_0x5e6771){if(_0x5e6771){var _0xac2838=typeof _0x3525df[_0x3a29('0x2d')]==='undefined'&&typeof _0x3525df[_0x3a29('0x2e')]===_0x3a29('0x2f');var _0x4c04d5=_0x5e6771['count'];var _0x1df25c=_0xac2838?0x0:_0x3525df[_0x3a29('0x2d')];var _0x39f637=_0xac2838?_0x5e6771[_0x3a29('0x30')]:_0x3525df[_0x3a29('0x2d')]+_0x3525df[_0x3a29('0x2e')];var _0x4ba3f8;if(_0x39f637>=_0x4c04d5){_0x39f637=_0x4c04d5;_0x4ba3f8=0xc8;}else{_0x4ba3f8=0xce;}_0x1cab9b[_0x3a29('0x2a')](_0x4ba3f8);return _0x1cab9b[_0x3a29('0x31')]('Content-Range',_0x1df25c+'-'+_0x39f637+'/'+_0x4c04d5)[_0x3a29('0x2c')](_0x5e6771);}return null;};}function patchUpdates(_0x22a305){return function(_0x18a22a){try{jsonpatch['apply'](_0x18a22a,_0x22a305,!![]);}catch(_0x2b8a8e){return BPromise[_0x3a29('0x32')](_0x2b8a8e);}return _0x18a22a['save']();};}function saveUpdates(_0x39b900,_0x2d9ac3){return function(_0x229a20){if(_0x229a20){return _0x229a20[_0x3a29('0x33')](_0x39b900)[_0x3a29('0x34')](function(_0x20767c){return _0x20767c;});}return null;};}function removeEntity(_0x2b03af,_0x107e2f){return function(_0x3f7e89){if(_0x3f7e89){return _0x3f7e89[_0x3a29('0x35')]()[_0x3a29('0x34')](function(){var _0x47f11a=_0x3f7e89['get']({'plain':!![]});var _0x368d4f=_0x3a29('0x36');return db['UserProfileResource'][_0x3a29('0x35')]({'where':{'type':_0x368d4f,'resourceId':_0x47f11a['id']}})[_0x3a29('0x34')](function(){return _0x3f7e89;});})[_0x3a29('0x34')](function(){_0x2b03af['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x53cf18,_0x2e9c67){return function(_0x3af339){if(!_0x3af339){_0x53cf18['sendStatus'](0x194);}return _0x3af339;};}function handleError(_0xf3ecb4,_0x2dfb1b){_0x2dfb1b=_0x2dfb1b||0x1f4;return function(_0x583c68){logger[_0x3a29('0x25')](_0x583c68[_0x3a29('0x37')]);if(_0x583c68[_0x3a29('0x38')]){delete _0x583c68[_0x3a29('0x38')];}_0xf3ecb4[_0x3a29('0x2a')](_0x2dfb1b)[_0x3a29('0x39')](_0x583c68);};}exports[_0x3a29('0x3a')]=function(_0x1a5a6f,_0x5c3a01){var _0x5d588b={},_0x1f9dec={},_0xe2a28={'count':0x0,'rows':[]};var _0x20aec0=_[_0x3a29('0x3b')](db[_0x3a29('0x3c')][_0x3a29('0x3d')],function(_0x540f2b){return{'name':_0x540f2b[_0x3a29('0x3e')],'type':_0x540f2b[_0x3a29('0x3f')]['key']};});_0x1f9dec[_0x3a29('0x40')]=_[_0x3a29('0x3b')](_0x20aec0,_0x3a29('0x38'));_0x1f9dec[_0x3a29('0x41')]=_[_0x3a29('0x42')](_0x1a5a6f['query']);_0x1f9dec['filters']=_[_0x3a29('0x43')](_0x1f9dec[_0x3a29('0x40')],_0x1f9dec[_0x3a29('0x41')]);_0x5d588b[_0x3a29('0x44')]=_[_0x3a29('0x43')](_0x1f9dec[_0x3a29('0x40')],qs[_0x3a29('0x45')](_0x1a5a6f['query'][_0x3a29('0x45')]));_0x5d588b[_0x3a29('0x44')]=_0x5d588b['attributes']['length']?_0x5d588b[_0x3a29('0x44')]:_0x1f9dec['model'];if(!_0x1a5a6f['query'][_0x3a29('0x46')](_0x3a29('0x47'))){_0x5d588b[_0x3a29('0x2e')]=qs[_0x3a29('0x2e')](_0x1a5a6f[_0x3a29('0x41')][_0x3a29('0x2e')]);_0x5d588b[_0x3a29('0x2d')]=qs[_0x3a29('0x2d')](_0x1a5a6f[_0x3a29('0x41')][_0x3a29('0x2d')]);}_0x5d588b[_0x3a29('0x48')]=qs['sort'](_0x1a5a6f['query']['sort']);_0x5d588b[_0x3a29('0x49')]=qs['filters'](_[_0x3a29('0x4a')](_0x1a5a6f['query'],_0x1f9dec[_0x3a29('0x4b')]),_0x20aec0);if(_0x1a5a6f[_0x3a29('0x41')][_0x3a29('0x4c')]){_0x5d588b[_0x3a29('0x49')]=_['merge'](_0x5d588b[_0x3a29('0x49')],{'$or':_[_0x3a29('0x3b')](_0x20aec0,function(_0x56b2c0){if(_0x56b2c0[_0x3a29('0x3f')]!==_0x3a29('0x4d')){var _0x488310={};_0x488310[_0x56b2c0['name']]={'$like':'%'+_0x1a5a6f[_0x3a29('0x41')][_0x3a29('0x4c')]+'%'};return _0x488310;}})});}_0x5d588b=_[_0x3a29('0x4e')]({},_0x5d588b,_0x1a5a6f['options']);var _0x37d1ad={'where':_0x5d588b['where']};return db[_0x3a29('0x3c')]['count'](_0x37d1ad)[_0x3a29('0x34')](function(_0x207231){_0xe2a28[_0x3a29('0x30')]=_0x207231;if(_0x1a5a6f['query'][_0x3a29('0x4f')]){_0x5d588b[_0x3a29('0x50')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x5d588b);})['then'](function(_0x220bd2){_0xe2a28[_0x3a29('0x51')]=_0x220bd2;return _0xe2a28;})[_0x3a29('0x34')](respondWithFilteredResult(_0x5c3a01,_0x5d588b))[_0x3a29('0x29')](handleError(_0x5c3a01,null));};exports[_0x3a29('0x52')]=function(_0xb1eace,_0x3c1da5){var _0x49680c={'raw':!![],'where':{'id':_0xb1eace['params']['id']}},_0x45dc94={};_0x45dc94[_0x3a29('0x40')]=_[_0x3a29('0x42')](db[_0x3a29('0x3c')][_0x3a29('0x3d')]);_0x45dc94[_0x3a29('0x41')]=_[_0x3a29('0x42')](_0xb1eace[_0x3a29('0x41')]);_0x45dc94[_0x3a29('0x4b')]=_[_0x3a29('0x43')](_0x45dc94[_0x3a29('0x40')],_0x45dc94['query']);_0x49680c[_0x3a29('0x44')]=_[_0x3a29('0x43')](_0x45dc94[_0x3a29('0x40')],qs['fields'](_0xb1eace['query'][_0x3a29('0x45')]));_0x49680c['attributes']=_0x49680c['attributes'][_0x3a29('0x53')]?_0x49680c[_0x3a29('0x44')]:_0x45dc94[_0x3a29('0x40')];if(_0xb1eace[_0x3a29('0x41')]['includeAll']){_0x49680c[_0x3a29('0x50')]=[{'all':!![]}];}_0x49680c=_[_0x3a29('0x4e')]({},_0x49680c,_0xb1eace[_0x3a29('0x54')]);return db[_0x3a29('0x3c')][_0x3a29('0x55')](_0x49680c)[_0x3a29('0x34')](handleEntityNotFound(_0x3c1da5,null))[_0x3a29('0x34')](respondWithResult(_0x3c1da5,null))[_0x3a29('0x29')](handleError(_0x3c1da5,null));};exports['create']=function(_0x9215f1,_0x153d4d){return db[_0x3a29('0x3c')][_0x3a29('0x56')](_0x9215f1[_0x3a29('0x57')],{})['then'](function(_0x360578){var _0x4e8340=_0x9215f1['user'][_0x3a29('0x58')]({'plain':!![]});if(!_0x4e8340)throw new Error(_0x3a29('0x59'));if(_0x4e8340[_0x3a29('0x5a')]===_0x3a29('0x5b')){var _0x5eff36=_0x360578['get']({'plain':!![]});var _0x52ba31=_0x3a29('0x36');return db[_0x3a29('0x5c')][_0x3a29('0x55')]({'where':{'name':_0x52ba31,'userProfileId':_0x4e8340[_0x3a29('0x5d')]},'raw':!![]})[_0x3a29('0x34')](function(_0x558b50){if(_0x558b50&&_0x558b50[_0x3a29('0x5e')]===0x0){return db[_0x3a29('0x5f')]['create']({'name':_0x5eff36[_0x3a29('0x38')],'resourceId':_0x5eff36['id'],'type':_0x558b50['name'],'sectionId':_0x558b50['id']},{})[_0x3a29('0x34')](function(){return _0x360578;});}else{return _0x360578;}})[_0x3a29('0x29')](function(_0x1c7427){logger[_0x3a29('0x25')](_0x3a29('0x60'),_0x1c7427);throw _0x1c7427;});}return _0x360578;})[_0x3a29('0x34')](respondWithResult(_0x153d4d,0xc9))['catch'](handleError(_0x153d4d,null));};exports[_0x3a29('0x33')]=function(_0x5b09f3,_0xd7dbf){if(_0x5b09f3[_0x3a29('0x57')]['id']){delete _0x5b09f3[_0x3a29('0x57')]['id'];}return db['ChatQueue'][_0x3a29('0x55')]({'where':{'id':_0x5b09f3[_0x3a29('0x61')]['id']}})[_0x3a29('0x34')](handleEntityNotFound(_0xd7dbf,null))[_0x3a29('0x34')](saveUpdates(_0x5b09f3[_0x3a29('0x57')],null))[_0x3a29('0x34')](respondWithResult(_0xd7dbf,null))[_0x3a29('0x29')](handleError(_0xd7dbf,null));};exports[_0x3a29('0x35')]=function(_0x5571b0,_0x1df99a){return db[_0x3a29('0x3c')][_0x3a29('0x55')]({'where':{'id':_0x5571b0[_0x3a29('0x61')]['id']}})[_0x3a29('0x34')](handleEntityNotFound(_0x1df99a,null))[_0x3a29('0x34')](removeEntity(_0x1df99a,null))[_0x3a29('0x29')](handleError(_0x1df99a,null));};exports[_0x3a29('0x62')]=function(_0x309ed2,_0x1f25dc){return db[_0x3a29('0x3c')][_0x3a29('0x62')]()[_0x3a29('0x34')](respondWithResult(_0x1f25dc,null))[_0x3a29('0x29')](handleError(_0x1f25dc,null));};exports[_0x3a29('0x63')]=function(_0xb273af,_0x4287fa,_0x514347){var _0x14681a={'raw':!![],'where':{}},_0x2ad5ca={},_0x51e60e;return db[_0x3a29('0x3c')][_0x3a29('0x64')]({'where':{'id':_0xb273af[_0x3a29('0x61')]['id']}})[_0x3a29('0x34')](handleEntityNotFound(_0x4287fa,null))[_0x3a29('0x34')](function(_0x1033b5){if(_0x1033b5){_0x51e60e=_0x1033b5[_0x3a29('0x58')]({'plain':!![]});_0x2ad5ca['model']=_[_0x3a29('0x42')](db['UserChatQueue'][_0x3a29('0x3d')]);_0x2ad5ca['query']=_[_0x3a29('0x42')](_0xb273af[_0x3a29('0x41')]);_0x2ad5ca[_0x3a29('0x4b')]=_[_0x3a29('0x43')](_0x2ad5ca['model'],_0x2ad5ca[_0x3a29('0x41')]);_0x14681a[_0x3a29('0x44')]=_[_0x3a29('0x43')](_0x2ad5ca['model'],qs[_0x3a29('0x45')](_0xb273af[_0x3a29('0x41')][_0x3a29('0x45')]));_0x14681a[_0x3a29('0x44')]=_0x14681a[_0x3a29('0x44')][_0x3a29('0x53')]?_0x14681a[_0x3a29('0x44')]:_0x2ad5ca[_0x3a29('0x40')];if(!_0xb273af['query'][_0x3a29('0x46')](_0x3a29('0x47'))){_0x14681a[_0x3a29('0x2e')]=qs[_0x3a29('0x2e')](_0xb273af[_0x3a29('0x41')][_0x3a29('0x2e')]);_0x14681a[_0x3a29('0x2d')]=qs[_0x3a29('0x2d')](_0xb273af[_0x3a29('0x41')][_0x3a29('0x2d')]);}_0x14681a[_0x3a29('0x48')]=qs[_0x3a29('0x65')](_0xb273af['query'][_0x3a29('0x65')]);_0x14681a['where']=qs[_0x3a29('0x4b')](_[_0x3a29('0x4a')](_0xb273af[_0x3a29('0x41')],_0x2ad5ca[_0x3a29('0x4b')]));_0x14681a[_0x3a29('0x49')][_0x3a29('0x66')]=_0x1033b5['id'];if(_0xb273af[_0x3a29('0x41')][_0x3a29('0x4c')]){_0x14681a[_0x3a29('0x49')]=_[_0x3a29('0x4e')](_0x14681a[_0x3a29('0x49')],{'$or':_['map'](_0x14681a['attributes'],function(_0x551f14){var _0xa5e44a={};_0xa5e44a[_0x551f14]={'$like':'%'+_0xb273af[_0x3a29('0x41')]['filter']+'%'};return _0xa5e44a;})});}_0x14681a=_[_0x3a29('0x4e')]({},_0x14681a,_0xb273af['options']);return db[_0x3a29('0x67')][_0x3a29('0x68')](_0x14681a);}})['then'](function(_0x538a1c){if(_0x538a1c){return db[_0x3a29('0x69')][_0x3a29('0x6a')]({'where':{'id':_[_0x3a29('0x3b')](_0x538a1c,'UserId'),'role':_0x3a29('0x6b')},'attributes':['id',_0x3a29('0x38'),_0x3a29('0x6c'),_0x3a29('0x6d'),_0x3a29('0x6e')]});}})[_0x3a29('0x34')](function(_0x5b8380){if(_0x5b8380){return{'count':_0x5b8380[_0x3a29('0x30')],'rows':_['map'](_0x5b8380[_0x3a29('0x51')],function(_0x1b20b7){return{'membername':_0x1b20b7['name'],'UserId':_0x1b20b7['id'],'queue_name':_0x51e60e[_0x3a29('0x38')],'ChatQueueId':_0x51e60e['id'],'interface':util['format']('%s/%s',_0x3a29('0x6f'),_0x1b20b7['name']),'penalty':0x0,'paused':_0x1b20b7[_0x3a29('0x6c')],'createdAt':_0x1b20b7['createdAt'],'updatedAt':_0x1b20b7[_0x3a29('0x6d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3a29('0x34')](respondWithFilteredResult(_0x4287fa,_0x14681a))['catch'](handleError(_0x4287fa,null));};exports[_0x3a29('0x70')]=function(_0x54432f,_0x1269fa,_0xb62e85){var _0x2cc19a={};var _0x4c5b24={};var _0x5bd25c;var _0x448e16;return db[_0x3a29('0x3c')][_0x3a29('0x64')]({'where':{'id':_0x54432f[_0x3a29('0x61')]['id']}})['then'](handleEntityNotFound(_0x1269fa,null))[_0x3a29('0x34')](function(_0x1accbb){if(_0x1accbb){_0x5bd25c=_0x1accbb;_0x4c5b24['model']=_['keys'](db[_0x3a29('0x71')][_0x3a29('0x3d')]);_0x4c5b24[_0x3a29('0x41')]=_[_0x3a29('0x42')](_0x54432f[_0x3a29('0x41')]);_0x4c5b24['filters']=_[_0x3a29('0x43')](_0x4c5b24[_0x3a29('0x40')],_0x4c5b24[_0x3a29('0x41')]);_0x2cc19a[_0x3a29('0x44')]=_[_0x3a29('0x43')](_0x4c5b24[_0x3a29('0x40')],qs['fields'](_0x54432f['query'][_0x3a29('0x45')]));_0x2cc19a[_0x3a29('0x44')]=_0x2cc19a[_0x3a29('0x44')][_0x3a29('0x53')]?_0x2cc19a[_0x3a29('0x44')]:_0x4c5b24[_0x3a29('0x40')];_0x2cc19a[_0x3a29('0x48')]=qs[_0x3a29('0x65')](_0x54432f[_0x3a29('0x41')]['sort']);_0x2cc19a[_0x3a29('0x49')]=qs[_0x3a29('0x4b')](_[_0x3a29('0x4a')](_0x54432f[_0x3a29('0x41')],_0x4c5b24[_0x3a29('0x4b')]));if(_0x54432f['query'][_0x3a29('0x4c')]){_0x2cc19a[_0x3a29('0x49')]=_['merge'](_0x2cc19a['where'],{'$or':_['map'](_0x2cc19a[_0x3a29('0x44')],function(_0xe40179){var _0x567e50={};_0x567e50[_0xe40179]={'$like':'%'+_0x54432f[_0x3a29('0x41')][_0x3a29('0x4c')]+'%'};return _0x567e50;})});}_0x2cc19a=_[_0x3a29('0x4e')]({},_0x2cc19a,_0x54432f[_0x3a29('0x54')]);return _0x5bd25c[_0x3a29('0x70')](_0x2cc19a);}})[_0x3a29('0x34')](function(_0x1f9d41){if(_0x1f9d41){_0x448e16=_0x1f9d41[_0x3a29('0x53')];if(!_0x54432f['query'][_0x3a29('0x46')]('nolimit')){_0x2cc19a['limit']=qs[_0x3a29('0x2e')](_0x54432f[_0x3a29('0x41')][_0x3a29('0x2e')]);_0x2cc19a['offset']=qs[_0x3a29('0x2d')](_0x54432f[_0x3a29('0x41')][_0x3a29('0x2d')]);}return _0x5bd25c[_0x3a29('0x70')](_0x2cc19a);}})[_0x3a29('0x34')](function(_0x32c2de){if(_0x32c2de){return _0x32c2de?{'count':_0x448e16,'rows':_0x32c2de}:null;}})[_0x3a29('0x34')](respondWithResult(_0x1269fa,null))[_0x3a29('0x29')](handleError(_0x1269fa,null));};exports[_0x3a29('0x72')]=function(_0x314eec,_0x2b6062,_0x632df3){var _0x1400e0=_0x314eec[_0x3a29('0x57')][_0x3a29('0x73')];return db['Team']['findAll']({'where':{'id':_0x1400e0},'attributes':['id'],'include':[{'model':db[_0x3a29('0x69')],'as':'Agents','attributes':['id',_0x3a29('0x38'),_0x3a29('0x74'),'voicePause','interface'],'raw':!![]}]})[_0x3a29('0x34')](function(_0x1d9ac2){if(_0x1d9ac2){var _0xe894e0=_[_0x3a29('0x75')](_0x1d9ac2,function(_0x273f49){var _0xdf805f=_0x273f49[_0x3a29('0x58')]({'plain':!![]});return _0xdf805f[_0x3a29('0x76')];});return db[_0x3a29('0x3c')]['find']({'where':{'id':_0x314eec['params']['id']}})['then'](function(_0x52a4b8){return db[_0x3a29('0x77')]['transaction'](function(_0x34c507){return _0x52a4b8[_0x3a29('0x72')](_0x1400e0,{'transaction':_0x34c507})[_0x3a29('0x34')](function(){return BPromise[_0x3a29('0x78')](_0xe894e0,function(_0x1f10c4){return db[_0x3a29('0x67')]['findOrCreate']({'where':{'UserId':_0x1f10c4['id'],'ChatQueueId':_0x314eec[_0x3a29('0x61')]['id']},'transaction':_0x34c507});});})[_0x3a29('0x34')](function(){_0xe894e0[_0x3a29('0x79')](function(_0x11cf2f){socket[_0x3a29('0x7a')]('userChatQueue:save',{'UserId':_0x11cf2f['id'],'ChatQueueId':_0x52a4b8['id']});});});});});}})['then'](respondWithStatusCode(_0x2b6062,null))[_0x3a29('0x29')](handleError(_0x2b6062,null));};exports[_0x3a29('0x7b')]=function(_0x4561df,_0x157d18,_0x1719f2){return db[_0x3a29('0x71')][_0x3a29('0x68')]({'where':{'id':_0x4561df[_0x3a29('0x41')][_0x3a29('0x73')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x3a29('0x34')](handleEntityNotFound(_0x157d18,null))[_0x3a29('0x34')](function(_0xbb68f4){var _0x1677af=_[_0x3a29('0x3b')](_0xbb68f4,'id');var _0x58b014=[];var _0x1094a6=[];var _0x5ac918=squel['select']();_0x5ac918[_0x3a29('0x7c')](_0x3a29('0x7d'))['from'](_0x3a29('0x7e'),'tq')[_0x3a29('0x7f')]('user_has_teams','ut',_0x3a29('0x80'))[_0x3a29('0x49')](_0x3a29('0x81'),_0x4561df['params']['id']);for(var _0x2f6f64=0x0;_0x2f6f64<_0xbb68f4['length'];_0x2f6f64+=0x1){let _0x3e3147=_0xbb68f4[_0x2f6f64];for(var _0x347324=0x0;_0x347324<_0x3e3147['Agents'][_0x3a29('0x53')];_0x347324+=0x1){let _0x1ad478=_0x3e3147[_0x3a29('0x76')][_0x347324];var _0x4f5397=_0x5ac918['clone']();_0x4f5397[_0x3a29('0x49')](_0x3a29('0x82'),_0x1ad478['id']);_0x1094a6[_0x3a29('0x83')](db[_0x3a29('0x77')][_0x3a29('0x41')](_0x4f5397[_0x3a29('0x84')](),{'type':db[_0x3a29('0x77')][_0x3a29('0x85')][_0x3a29('0x86')]})[_0x3a29('0x34')](function(_0x34cdfd){if(_0x34cdfd[_0x3a29('0x53')]===0x1){return _0x1ad478['id'];}else{var _0xc2cd5c=_[_0x3a29('0x87')](_['map'](_0x34cdfd,'TeamId'),function(_0x97078){return _['includes'](_0x1677af,_0x97078);});if(_0xc2cd5c){return _0x1ad478['id'];}}}));}}return BPromise[_0x3a29('0x88')](_0x1094a6)['then'](function(_0x1f63c1){_0x58b014=_(_0x58b014)[_0x3a29('0x89')](_0x1f63c1)[_0x3a29('0x8a')]()[_0x3a29('0x8b')]();return db[_0x3a29('0x3c')]['find']({'where':{'id':_0x4561df[_0x3a29('0x61')]['id']}})[_0x3a29('0x34')](function(_0x5c88ef){return db[_0x3a29('0x77')][_0x3a29('0x8c')](function(_0x5231fa){return _0x5c88ef['removeTeams'](_0x4561df[_0x3a29('0x41')][_0x3a29('0x73')],{'transaction':_0x5231fa})['then'](function(){if(!_[_0x3a29('0x8d')](_0x58b014)){return _0x5c88ef[_0x3a29('0x8e')](_0x58b014,{'transaction':_0x5231fa});}})[_0x3a29('0x34')](function(){_0x58b014['forEach'](function(_0x14dae2){socket['emit'](_0x3a29('0x8f'),{'UserId':_0x14dae2,'ChatQueueId':_0x5c88ef['id']});});});});});});})[_0x3a29('0x34')](respondWithStatusCode(_0x157d18,null))[_0x3a29('0x29')](handleError(_0x157d18,null));};exports[_0x3a29('0x90')]=function(_0x129d11,_0x535a7f,_0x24e122){return db[_0x3a29('0x3c')][_0x3a29('0x55')]({'where':{'id':_0x129d11['params']['id']}})[_0x3a29('0x34')](handleEntityNotFound(_0x535a7f,null))['then'](function(_0x43b55b){if(_0x43b55b){return _0x43b55b[_0x3a29('0x90')](_0x129d11[_0x3a29('0x57')]['ids'],_[_0x3a29('0x91')](_0x129d11[_0x3a29('0x57')],[_0x3a29('0x73'),'id'])||{})['spread'](function(_0x8f226e){for(var _0x219b09=0x0;_0x219b09<_0x129d11[_0x3a29('0x57')][_0x3a29('0x73')][_0x3a29('0x53')];_0x219b09+=0x1){socket[_0x3a29('0x7a')](_0x3a29('0x92'),{'UserId':Number(_0x129d11[_0x3a29('0x57')][_0x3a29('0x73')][_0x219b09]),'ChatQueueId':Number(_0x129d11['params']['id'])});}return _0x8f226e;});}})[_0x3a29('0x34')](respondWithResult(_0x535a7f,null))['catch'](handleError(_0x535a7f,null));};exports[_0x3a29('0x8e')]=function(_0x22f284,_0x26fc6f,_0x1cbd65){return db[_0x3a29('0x3c')][_0x3a29('0x55')]({'where':{'id':_0x22f284[_0x3a29('0x61')]['id']}})[_0x3a29('0x34')](handleEntityNotFound(_0x26fc6f,null))[_0x3a29('0x34')](function(_0x3aff79){if(_0x3aff79){return _0x3aff79[_0x3a29('0x8e')](_0x22f284['query'][_0x3a29('0x73')])['then'](function(){if(_[_0x3a29('0x93')](_0x22f284[_0x3a29('0x41')][_0x3a29('0x73')])){for(var _0x36c3fd=0x0;_0x36c3fd<_0x22f284[_0x3a29('0x41')][_0x3a29('0x73')][_0x3a29('0x53')];_0x36c3fd+=0x1){socket[_0x3a29('0x7a')](_0x3a29('0x8f'),{'UserId':Number(_0x22f284[_0x3a29('0x41')]['ids'][_0x36c3fd]),'ChatQueueId':Number(_0x22f284[_0x3a29('0x61')]['id'])});}}else{socket[_0x3a29('0x7a')](_0x3a29('0x8f'),{'UserId':Number(_0x22f284[_0x3a29('0x41')][_0x3a29('0x73')]),'ChatQueueId':Number(_0x22f284[_0x3a29('0x61')]['id'])});}});}})[_0x3a29('0x34')](respondWithStatusCode(_0x26fc6f,null))['catch'](handleError(_0x26fc6f,null));};exports[_0x3a29('0x94')]=function(_0xf8c82c,_0x3f990e,_0x2254ef){var _0x34a5ba={};var _0x3fb1e9={};var _0x5053f2;var _0x25c85d;return db[_0x3a29('0x3c')][_0x3a29('0x64')]({'where':{'id':_0xf8c82c[_0x3a29('0x61')]['id']}})[_0x3a29('0x34')](handleEntityNotFound(_0x3f990e,null))[_0x3a29('0x34')](function(_0x4cb69f){if(_0x4cb69f){_0x5053f2=_0x4cb69f;_0x3fb1e9[_0x3a29('0x40')]=_[_0x3a29('0x42')](db[_0x3a29('0x69')]['rawAttributes']);_0x3fb1e9[_0x3a29('0x41')]=_[_0x3a29('0x42')](_0xf8c82c['query']);_0x3fb1e9[_0x3a29('0x4b')]=_[_0x3a29('0x43')](_0x3fb1e9[_0x3a29('0x40')],_0x3fb1e9[_0x3a29('0x41')]);_0x34a5ba[_0x3a29('0x44')]=_[_0x3a29('0x43')](_0x3fb1e9[_0x3a29('0x40')],qs[_0x3a29('0x45')](_0xf8c82c[_0x3a29('0x41')][_0x3a29('0x45')]));_0x34a5ba[_0x3a29('0x44')]=_0x34a5ba['attributes']['length']?_0x34a5ba[_0x3a29('0x44')]:_0x3fb1e9[_0x3a29('0x40')];_0x34a5ba[_0x3a29('0x48')]=qs[_0x3a29('0x65')](_0xf8c82c['query'][_0x3a29('0x65')]);_0x34a5ba['where']=qs[_0x3a29('0x4b')](_[_0x3a29('0x4a')](_0xf8c82c[_0x3a29('0x41')],_0x3fb1e9[_0x3a29('0x4b')]));if(_0xf8c82c[_0x3a29('0x41')]['filter']){_0x34a5ba[_0x3a29('0x49')]=_['merge'](_0x34a5ba[_0x3a29('0x49')],{'$or':_[_0x3a29('0x3b')](_0x34a5ba[_0x3a29('0x44')],function(_0x1e728f){var _0x2fed93={};_0x2fed93[_0x1e728f]={'$like':'%'+_0xf8c82c['query'][_0x3a29('0x4c')]+'%'};return _0x2fed93;})});}_0x34a5ba=_[_0x3a29('0x4e')]({},_0x34a5ba,_0xf8c82c['options']);return _0x5053f2[_0x3a29('0x94')](_0x34a5ba);}})['then'](function(_0x720e82){if(_0x720e82){_0x25c85d=_0x720e82[_0x3a29('0x53')];if(!_0xf8c82c[_0x3a29('0x41')][_0x3a29('0x46')]('nolimit')){_0x34a5ba[_0x3a29('0x2e')]=qs[_0x3a29('0x2e')](_0xf8c82c[_0x3a29('0x41')]['limit']);_0x34a5ba[_0x3a29('0x2d')]=qs['offset'](_0xf8c82c[_0x3a29('0x41')][_0x3a29('0x2d')]);}return _0x5053f2[_0x3a29('0x94')](_0x34a5ba);}})[_0x3a29('0x34')](function(_0x3c370f){if(_0x3c370f){return _0x3c370f?{'count':_0x25c85d,'rows':_0x3c370f}:null;}})[_0x3a29('0x34')](respondWithResult(_0x3f990e,null))[_0x3a29('0x29')](handleError(_0x3f990e,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index b3dec44..44a828c 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 _0x7439=['../../mysqldb','setMaxListeners','emit','exports'];(function(_0x5880d9,_0x54f17d){var _0x336cad=function(_0x5bcd7c){while(--_0x5bcd7c){_0x5880d9['push'](_0x5880d9['shift']());}};_0x336cad(++_0x54f17d);}(_0x7439,0x15c));var _0x9743=function(_0xcf6c20,_0x3a90c9){_0xcf6c20=_0xcf6c20-0x0;var _0x2db56c=_0x7439[_0xcf6c20];return _0x2db56c;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x9743('0x0'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x9743('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x219299){return function(_0x3685ba,_0x1b67cd,_0x200a28){ChatQueueEvents[_0x9743('0x2')](_0x219299+':'+_0x3685ba['id'],_0x3685ba);ChatQueueEvents['emit'](_0x219299,_0x3685ba);_0x200a28(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x9743('0x3')]=ChatQueueEvents; \ No newline at end of file +var _0x6464=['ChatQueue','setMaxListeners','save','update','emit','hook','exports','events','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6464,0x16f));var _0x4646=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x6464[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require(_0x4646('0x0'));var ChatQueue=require(_0x4646('0x1'))['db'][_0x4646('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x4646('0x3')](0x0);var events={'afterCreate':_0x4646('0x4'),'afterUpdate':_0x4646('0x5'),'afterDestroy':'remove'};function emitEvent(_0x479589){return function(_0x52c4b5,_0x560b15,_0x26749c){ChatQueueEvents['emit'](_0x479589+':'+_0x52c4b5['id'],_0x52c4b5);ChatQueueEvents[_0x4646('0x6')](_0x479589,_0x52c4b5);_0x26749c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x4646('0x7')](e,emitEvent(event));}}module[_0x4646('0x8')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 88fcd5c..51cc2e0 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 _0x8ab4=['./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x55816d,_0x15c16){var _0x2e91c5=function(_0xa4374c){while(--_0xa4374c){_0x55816d['push'](_0x55816d['shift']());}};_0x2e91c5(++_0x15c16);}(_0x8ab4,0x71));var _0x48ab=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x8ab4[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x48ab('0x0'));var util=require('util');var logger=require(_0x48ab('0x1'))(_0x48ab('0x2'));var moment=require(_0x48ab('0x3'));var BPromise=require(_0x48ab('0x4'));var rp=require(_0x48ab('0x5'));var fs=require('fs');var path=require(_0x48ab('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x48ab('0x7'));module[_0x48ab('0x8')]=function(_0xfebd0d,_0x31aeca){return _0xfebd0d[_0x48ab('0x9')](_0x48ab('0xa'),attributes,{'tableName':_0x48ab('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3d5f=['exports','define','chat_queues','lodash','util','api','request-promise','rimraf','../../config/environment','./chatQueue.attributes'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3d5f,0x111));var _0xf3d5=function(_0x657564,_0x416683){_0x657564=_0x657564-0x0;var _0x14ef68=_0x3d5f[_0x657564];return _0x14ef68;};'use strict';var _=require(_0xf3d5('0x0'));var util=require(_0xf3d5('0x1'));var logger=require('../../config/logger')(_0xf3d5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf3d5('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf3d5('0x4'));var config=require(_0xf3d5('0x5'));var attributes=require(_0xf3d5('0x6'));module[_0xf3d5('0x7')]=function(_0x1f6691,_0x20b265){return _0x1f6691[_0xf3d5('0x8')]('ChatQueue',attributes,{'tableName':_0xf3d5('0x9'),'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 31a9bfe..725dd41 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 _0x89f5=['lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','GetChatQueue','ChatQueue','findAll','options','where','attributes','limit','map','model','include','catch','ShowChatQueue','find','raw'];(function(_0x21a098,_0x204c09){var _0x3233a5=function(_0x192c82){while(--_0x192c82){_0x21a098['push'](_0x21a098['shift']());}};_0x3233a5(++_0x204c09);}(_0x89f5,0x118));var _0x589f=function(_0x3e7693,_0x24945b){_0x3e7693=_0x3e7693-0x0;var _0x147ea8=_0x89f5[_0x3e7693];return _0x147ea8;};'use strict';var _=require(_0x589f('0x0'));var util=require(_0x589f('0x1'));var moment=require(_0x589f('0x2'));var BPromise=require(_0x589f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x589f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x589f('0x5'))(_0x589f('0x6'));var config=require(_0x589f('0x7'));var jayson=require(_0x589f('0x8'));var client=jayson[_0x589f('0x9')][_0x589f('0xa')]({'port':0x232a});config[_0x589f('0xb')]=_[_0x589f('0xc')](config[_0x589f('0xb')],{'host':_0x589f('0xd'),'port':0x18eb});var socket=require(_0x589f('0xe'))(new Redis(config['redis']));require('./chatQueue.socket')[_0x589f('0xf')](socket);function respondWithRpcPromise(_0xdeb2ad,_0x4eedf8,_0x7e155e){return new BPromise(function(_0x300f63,_0x54c593){return client[_0x589f('0x10')](_0xdeb2ad,_0x7e155e)[_0x589f('0x11')](function(_0x272138){logger[_0x589f('0x12')](_0x589f('0x13'),_0x4eedf8,'request\x20sent');logger[_0x589f('0x14')](_0x589f('0x15'),_0x4eedf8,_0x589f('0x16'),JSON[_0x589f('0x17')](_0x272138));if(_0x272138[_0x589f('0x18')]){if(_0x272138[_0x589f('0x18')]['code']===0x1f4){logger['error'](_0x589f('0x13'),_0x4eedf8,_0x272138['error'][_0x589f('0x19')]);return _0x54c593(_0x272138[_0x589f('0x18')][_0x589f('0x19')]);}logger[_0x589f('0x18')](_0x589f('0x13'),_0x4eedf8,_0x272138[_0x589f('0x18')][_0x589f('0x19')]);return _0x300f63(_0x272138['error'][_0x589f('0x19')]);}else{logger[_0x589f('0x12')](_0x589f('0x13'),_0x4eedf8,_0x589f('0x16'));_0x300f63(_0x272138['result']['message']);}})['catch'](function(_0xd00f28){logger[_0x589f('0x18')](_0x589f('0x13'),_0x4eedf8,_0xd00f28);_0x54c593(_0xd00f28);});});}exports[_0x589f('0x1a')]=function(_0x1f3103){var _0x159732=this;return new Promise(function(_0x4117f3,_0x8508f0){return db[_0x589f('0x1b')][_0x589f('0x1c')]({'raw':_0x1f3103[_0x589f('0x1d')]?_0x1f3103[_0x589f('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x1f3103[_0x589f('0x1d')]?_0x1f3103[_0x589f('0x1d')][_0x589f('0x1e')]||null:null,'attributes':_0x1f3103[_0x589f('0x1d')]?_0x1f3103[_0x589f('0x1d')][_0x589f('0x1f')]||null:null,'limit':_0x1f3103[_0x589f('0x1d')]?_0x1f3103[_0x589f('0x1d')][_0x589f('0x20')]||null:null,'include':_0x1f3103[_0x589f('0x1d')]?_0x1f3103[_0x589f('0x1d')]['include']?_[_0x589f('0x21')](_0x1f3103[_0x589f('0x1d')]['include'],function(_0x25e999){return{'model':db[_0x25e999[_0x589f('0x22')]],'as':_0x25e999['as'],'attributes':_0x25e999[_0x589f('0x1f')],'include':_0x25e999[_0x589f('0x23')]?_[_0x589f('0x21')](_0x25e999[_0x589f('0x23')],function(_0x268c1b){return{'model':db[_0x268c1b[_0x589f('0x22')]],'as':_0x268c1b['as'],'attributes':_0x268c1b[_0x589f('0x1f')],'include':_0x268c1b[_0x589f('0x23')]?_['map'](_0x268c1b[_0x589f('0x23')],function(_0x316859){return{'model':db[_0x316859[_0x589f('0x22')]],'as':_0x316859['as'],'attributes':_0x316859[_0x589f('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x589f('0x11')](function(_0xb8fe6a){logger[_0x589f('0x12')](_0x589f('0x1a'),_0x1f3103);logger['debug'](_0x589f('0x1a'),_0x1f3103,JSON['stringify'](_0xb8fe6a));_0x4117f3(_0xb8fe6a);})[_0x589f('0x24')](function(_0x42ae77){logger[_0x589f('0x18')](_0x589f('0x1a'),_0x42ae77[_0x589f('0x19')],_0x1f3103);_0x8508f0(_0x159732['error'](0x1f4,_0x42ae77['message']));});});};exports[_0x589f('0x25')]=function(_0x5e5bf8){var _0x4b2155=this;return new Promise(function(_0x3ec884,_0xe212b){return db[_0x589f('0x1b')][_0x589f('0x26')]({'raw':_0x5e5bf8[_0x589f('0x1d')]?_0x5e5bf8['options'][_0x589f('0x27')]===undefined?!![]:![]:!![],'where':_0x5e5bf8[_0x589f('0x1d')]?_0x5e5bf8[_0x589f('0x1d')]['where']||null:null,'attributes':_0x5e5bf8[_0x589f('0x1d')]?_0x5e5bf8[_0x589f('0x1d')][_0x589f('0x1f')]||null:null,'include':_0x5e5bf8[_0x589f('0x1d')]?_0x5e5bf8[_0x589f('0x1d')][_0x589f('0x23')]?_[_0x589f('0x21')](_0x5e5bf8[_0x589f('0x1d')]['include'],function(_0xebc3c){return{'model':db[_0xebc3c['model']],'as':_0xebc3c['as'],'attributes':_0xebc3c[_0x589f('0x1f')],'include':_0xebc3c[_0x589f('0x23')]?_[_0x589f('0x21')](_0xebc3c['include'],function(_0x28b792){return{'model':db[_0x28b792[_0x589f('0x22')]],'as':_0x28b792['as'],'attributes':_0x28b792[_0x589f('0x1f')],'include':_0x28b792[_0x589f('0x23')]?_['map'](_0x28b792[_0x589f('0x23')],function(_0xe2c4c7){return{'model':db[_0xe2c4c7['model']],'as':_0xe2c4c7['as'],'attributes':_0xe2c4c7['attributes']};}):[]};}):[]};}):[]:[]})[_0x589f('0x11')](function(_0x2741f4){logger['info']('ShowChatQueue',_0x5e5bf8);logger[_0x589f('0x14')](_0x589f('0x25'),_0x5e5bf8,JSON[_0x589f('0x17')](_0x2741f4));_0x3ec884(_0x2741f4);})[_0x589f('0x24')](function(_0xa81305){logger['error'](_0x589f('0x25'),_0xa81305['message'],_0x5e5bf8);_0xe212b(_0x4b2155['error'](0x1f4,_0xa81305['message']));});});}; \ No newline at end of file +var _0x5fbb=['./chatQueue.socket','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetChatQueue','ChatQueue','options','raw','where','include','map','model','attributes','stringify','ShowChatQueue','find','lodash','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x3dd95a,_0x507480){var _0x5135af=function(_0x319855){while(--_0x319855){_0x3dd95a['push'](_0x3dd95a['shift']());}};_0x5135af(++_0x507480);}(_0x5fbb,0x1ba));var _0xb5fb=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5fbb[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xb5fb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb5fb('0x1'));var fs=require('fs');var Redis=require(_0xb5fb('0x2'));var db=require(_0xb5fb('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb5fb('0x4'))(_0xb5fb('0x5'));var config=require(_0xb5fb('0x6'));var jayson=require(_0xb5fb('0x7'));var client=jayson[_0xb5fb('0x8')][_0xb5fb('0x9')]({'port':0x232a});config[_0xb5fb('0xa')]=_[_0xb5fb('0xb')](config[_0xb5fb('0xa')],{'host':_0xb5fb('0xc'),'port':0x18eb});var socket=require(_0xb5fb('0xd'))(new Redis(config[_0xb5fb('0xa')]));require(_0xb5fb('0xe'))['register'](socket);function respondWithRpcPromise(_0x462832,_0x84f5a8,_0x38f18a){return new BPromise(function(_0x58eb20,_0x5e3694){return client['request'](_0x462832,_0x38f18a)[_0xb5fb('0xf')](function(_0xf7cb72){logger['info'](_0xb5fb('0x10'),_0x84f5a8,_0xb5fb('0x11'));logger[_0xb5fb('0x12')](_0xb5fb('0x13'),_0x84f5a8,_0xb5fb('0x11'),JSON['stringify'](_0xf7cb72));if(_0xf7cb72[_0xb5fb('0x14')]){if(_0xf7cb72[_0xb5fb('0x14')][_0xb5fb('0x15')]===0x1f4){logger[_0xb5fb('0x14')](_0xb5fb('0x10'),_0x84f5a8,_0xf7cb72['error'][_0xb5fb('0x16')]);return _0x5e3694(_0xf7cb72[_0xb5fb('0x14')]['message']);}logger[_0xb5fb('0x14')](_0xb5fb('0x10'),_0x84f5a8,_0xf7cb72['error'][_0xb5fb('0x16')]);return _0x58eb20(_0xf7cb72['error'][_0xb5fb('0x16')]);}else{logger[_0xb5fb('0x17')](_0xb5fb('0x10'),_0x84f5a8,_0xb5fb('0x11'));_0x58eb20(_0xf7cb72[_0xb5fb('0x18')][_0xb5fb('0x16')]);}})[_0xb5fb('0x19')](function(_0x15d462){logger[_0xb5fb('0x14')](_0xb5fb('0x10'),_0x84f5a8,_0x15d462);_0x5e3694(_0x15d462);});});}exports[_0xb5fb('0x1a')]=function(_0x3a87fe){var _0x1daacb=this;return new Promise(function(_0x28ad5b,_0x15a8f4){return db[_0xb5fb('0x1b')]['findAll']({'raw':_0x3a87fe['options']?_0x3a87fe[_0xb5fb('0x1c')][_0xb5fb('0x1d')]===undefined?!![]:![]:!![],'where':_0x3a87fe[_0xb5fb('0x1c')]?_0x3a87fe[_0xb5fb('0x1c')][_0xb5fb('0x1e')]||null:null,'attributes':_0x3a87fe[_0xb5fb('0x1c')]?_0x3a87fe[_0xb5fb('0x1c')]['attributes']||null:null,'limit':_0x3a87fe[_0xb5fb('0x1c')]?_0x3a87fe[_0xb5fb('0x1c')]['limit']||null:null,'include':_0x3a87fe[_0xb5fb('0x1c')]?_0x3a87fe[_0xb5fb('0x1c')][_0xb5fb('0x1f')]?_[_0xb5fb('0x20')](_0x3a87fe[_0xb5fb('0x1c')][_0xb5fb('0x1f')],function(_0x17e59f){return{'model':db[_0x17e59f[_0xb5fb('0x21')]],'as':_0x17e59f['as'],'attributes':_0x17e59f[_0xb5fb('0x22')],'include':_0x17e59f[_0xb5fb('0x1f')]?_[_0xb5fb('0x20')](_0x17e59f['include'],function(_0x3820dc){return{'model':db[_0x3820dc[_0xb5fb('0x21')]],'as':_0x3820dc['as'],'attributes':_0x3820dc[_0xb5fb('0x22')],'include':_0x3820dc[_0xb5fb('0x1f')]?_[_0xb5fb('0x20')](_0x3820dc[_0xb5fb('0x1f')],function(_0x4d9cc6){return{'model':db[_0x4d9cc6[_0xb5fb('0x21')]],'as':_0x4d9cc6['as'],'attributes':_0x4d9cc6[_0xb5fb('0x22')]};}):[]};}):[]};}):[]:[]})[_0xb5fb('0xf')](function(_0x2aa7bf){logger[_0xb5fb('0x17')]('GetChatQueue',_0x3a87fe);logger['debug']('GetChatQueue',_0x3a87fe,JSON[_0xb5fb('0x23')](_0x2aa7bf));_0x28ad5b(_0x2aa7bf);})[_0xb5fb('0x19')](function(_0x58c9a8){logger[_0xb5fb('0x14')](_0xb5fb('0x1a'),_0x58c9a8[_0xb5fb('0x16')],_0x3a87fe);_0x15a8f4(_0x1daacb['error'](0x1f4,_0x58c9a8[_0xb5fb('0x16')]));});});};exports[_0xb5fb('0x24')]=function(_0x5a60fb){var _0x54c2aa=this;return new Promise(function(_0x2ca3a6,_0x8d71da){return db[_0xb5fb('0x1b')][_0xb5fb('0x25')]({'raw':_0x5a60fb[_0xb5fb('0x1c')]?_0x5a60fb[_0xb5fb('0x1c')][_0xb5fb('0x1d')]===undefined?!![]:![]:!![],'where':_0x5a60fb[_0xb5fb('0x1c')]?_0x5a60fb[_0xb5fb('0x1c')]['where']||null:null,'attributes':_0x5a60fb[_0xb5fb('0x1c')]?_0x5a60fb[_0xb5fb('0x1c')][_0xb5fb('0x22')]||null:null,'include':_0x5a60fb[_0xb5fb('0x1c')]?_0x5a60fb[_0xb5fb('0x1c')][_0xb5fb('0x1f')]?_[_0xb5fb('0x20')](_0x5a60fb[_0xb5fb('0x1c')][_0xb5fb('0x1f')],function(_0x6b3e2e){return{'model':db[_0x6b3e2e['model']],'as':_0x6b3e2e['as'],'attributes':_0x6b3e2e['attributes'],'include':_0x6b3e2e['include']?_['map'](_0x6b3e2e[_0xb5fb('0x1f')],function(_0x4fe549){return{'model':db[_0x4fe549[_0xb5fb('0x21')]],'as':_0x4fe549['as'],'attributes':_0x4fe549['attributes'],'include':_0x4fe549['include']?_[_0xb5fb('0x20')](_0x4fe549[_0xb5fb('0x1f')],function(_0x2629f9){return{'model':db[_0x2629f9[_0xb5fb('0x21')]],'as':_0x2629f9['as'],'attributes':_0x2629f9[_0xb5fb('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x40f732){logger[_0xb5fb('0x17')](_0xb5fb('0x24'),_0x5a60fb);logger[_0xb5fb('0x12')](_0xb5fb('0x24'),_0x5a60fb,JSON[_0xb5fb('0x23')](_0x40f732));_0x2ca3a6(_0x40f732);})[_0xb5fb('0x19')](function(_0x1a0dfa){logger[_0xb5fb('0x14')](_0xb5fb('0x24'),_0x1a0dfa[_0xb5fb('0x16')],_0x5a60fb);_0x8d71da(_0x54c2aa[_0xb5fb('0x14')](0x1f4,_0x1a0dfa[_0xb5fb('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 725cdf5..4669fb9 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 _0x2dae=['remove','update','removeListener','register','length','chatQueue:','./chatQueue.events'];(function(_0x5712c9,_0xd0a191){var _0x56b4fa=function(_0x7c23d2){while(--_0x7c23d2){_0x5712c9['push'](_0x5712c9['shift']());}};_0x56b4fa(++_0xd0a191);}(_0x2dae,0xc3));var _0xe2da=function(_0x4191af,_0x5783da){_0x4191af=_0x4191af-0x0;var _0x27bebf=_0x2dae[_0x4191af];return _0x27bebf;};'use strict';var ChatQueueEvents=require(_0xe2da('0x0'));var events=['save',_0xe2da('0x1'),_0xe2da('0x2')];function createListener(_0xcd0055,_0x167432){return function(_0x99b46f){_0x167432['emit'](_0xcd0055,_0x99b46f);};}function removeListener(_0x25b9f2,_0x439b5d){return function(){ChatQueueEvents[_0xe2da('0x3')](_0x25b9f2,_0x439b5d);};}exports[_0xe2da('0x4')]=function(_0x523c60){for(var _0x3e3e25=0x0,_0x89c70b=events[_0xe2da('0x5')];_0x3e3e25<_0x89c70b;_0x3e3e25++){var _0x2efbd8=events[_0x3e3e25];var _0x238da3=createListener(_0xe2da('0x6')+_0x2efbd8,_0x523c60);ChatQueueEvents['on'](_0x2efbd8,_0x238da3);}}; \ No newline at end of file +var _0xb458=['length','./chatQueue.events','save','remove','emit','removeListener'];(function(_0x37d7cd,_0x6681b1){var _0x518bad=function(_0x57bcff){while(--_0x57bcff){_0x37d7cd['push'](_0x37d7cd['shift']());}};_0x518bad(++_0x6681b1);}(_0xb458,0x103));var _0x8b45=function(_0x36be0a,_0x44b257){_0x36be0a=_0x36be0a-0x0;var _0xee76a5=_0xb458[_0x36be0a];return _0xee76a5;};'use strict';var ChatQueueEvents=require(_0x8b45('0x0'));var events=[_0x8b45('0x1'),_0x8b45('0x2'),'update'];function createListener(_0x58a508,_0xdf89d4){return function(_0x93d9cd){_0xdf89d4[_0x8b45('0x3')](_0x58a508,_0x93d9cd);};}function removeListener(_0x13a8c6,_0x5d51e4){return function(){ChatQueueEvents[_0x8b45('0x4')](_0x13a8c6,_0x5d51e4);};}exports['register']=function(_0x5cc2d5){for(var _0xe8d774=0x0,_0x12bd05=events[_0x8b45('0x5')];_0xe8d774<_0x12bd05;_0xe8d774++){var _0x3a8ccb=events[_0xe8d774];var _0x32342f=createListener('chatQueue:'+_0x3a8ccb,_0x5cc2d5);ChatQueueEvents['on'](_0x3a8ccb,_0x32342f);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index b751424..a5baf0f 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 _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x16f09a,_0x21c409){var _0x5e0327=function(_0x4ccef5){while(--_0x4ccef5){_0x16f09a['push'](_0x16f09a['shift']());}};_0x5e0327(++_0x21c409);}(_0x008c,0x188));var _0xc008=function(_0x186376,_0x5d988a){_0x186376=_0x186376-0x0;var _0x2dbdd9=_0x008c[_0x186376];return _0x2dbdd9;};'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')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +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(_0x1f94ef,_0xeead8b){var _0x196de7=function(_0x2f1eb1){while(--_0x2f1eb1){_0x1f94ef['push'](_0x1f94ef['shift']());}};_0x196de7(++_0xeead8b);}(_0xe14b,0x93));var _0xbe14=function(_0x401f29,_0xa16d9){_0x401f29=_0x401f29-0x0;var _0x1589c6=_0xe14b[_0x401f29];return _0x1589c6;};'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 diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index b22cb86..72f3a47 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 _0xcd31=['exports','STRING','DATE','moment'];(function(_0x5a2fb1,_0x4a9436){var _0x12637f=function(_0x1f738b){while(--_0x1f738b){_0x5a2fb1['push'](_0x5a2fb1['shift']());}};_0x12637f(++_0x4a9436);}(_0xcd31,0x93));var _0x1cd3=function(_0x57265d,_0x31fa8b){_0x57265d=_0x57265d-0x0;var _0x1c4476=_0xcd31[_0x57265d];return _0x1c4476;};'use strict';var moment=require(_0x1cd3('0x0'));var Sequelize=require('sequelize');module[_0x1cd3('0x1')]={'uniqueid':{'type':Sequelize[_0x1cd3('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x1cd3('0x3')]},'exitAt':{'type':Sequelize[_0x1cd3('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3be6=['sequelize','exports','STRING','DATE','moment'];(function(_0x3d5af1,_0x1ae677){var _0x553682=function(_0xdf86ad){while(--_0xdf86ad){_0x3d5af1['push'](_0x3d5af1['shift']());}};_0x553682(++_0x1ae677);}(_0x3be6,0x6d));var _0x63be=function(_0x478414,_0xcf142d){_0x478414=_0x478414-0x0;var _0x5eb6b9=_0x3be6[_0x478414];return _0x5eb6b9;};'use strict';var moment=require(_0x63be('0x0'));var Sequelize=require(_0x63be('0x1'));module[_0x63be('0x2')]={'uniqueid':{'type':Sequelize[_0x63be('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x63be('0x3')]},'joinAt':{'type':Sequelize[_0x63be('0x4')]},'leaveAt':{'type':Sequelize[_0x63be('0x4')]},'acceptAt':{'type':Sequelize[_0x63be('0x4')]},'exitAt':{'type':Sequelize[_0x63be('0x4')]},'reason':{'type':Sequelize[_0x63be('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 2d03b09..4074529 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 _0x7163=['key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','show','params','includeAll','find','create','body','catch','describe','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','ChatQueueReport','rawAttributes','fieldName','type'];(function(_0x42f0ce,_0x28ecf6){var _0x16e546=function(_0x322da6){while(--_0x322da6){_0x42f0ce['push'](_0x42f0ce['shift']());}};_0x16e546(++_0x28ecf6);}(_0x7163,0x1ef));var _0x3716=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x7163[_0x2070da];return _0x4f9fe1;};'use strict';var emlformat=require(_0x3716('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3716('0x1'));var rp=require(_0x3716('0x2'));var moment=require(_0x3716('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3716('0x4'));var util=require(_0x3716('0x5'));var path=require(_0x3716('0x6'));var sox=require(_0x3716('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3716('0x8'));var _=require(_0x3716('0x9'));var squel=require(_0x3716('0xa'));var crypto=require(_0x3716('0xb'));var jsforce=require(_0x3716('0xc'));var deskjs=require(_0x3716('0xd'));var toCsv=require(_0x3716('0xe'));var querystring=require(_0x3716('0xf'));var Papa=require(_0x3716('0x10'));var Redis=require(_0x3716('0x11'));var authService=require(_0x3716('0x12'));var qs=require(_0x3716('0x13'));var as=require(_0x3716('0x14'));var hardwareService=require(_0x3716('0x15'));var logger=require(_0x3716('0x16'))(_0x3716('0x17'));var utils=require(_0x3716('0x18'));var config=require(_0x3716('0x19'));var licenseUtil=require(_0x3716('0x1a'));var db=require(_0x3716('0x1b'))['db'];function respondWithStatusCode(_0x2c32cf,_0x2bbb95){_0x2bbb95=_0x2bbb95||0xcc;return function(_0x21925a){if(_0x21925a){return _0x2c32cf[_0x3716('0x1c')](_0x2bbb95);}return _0x2c32cf[_0x3716('0x1d')](_0x2bbb95)[_0x3716('0x1e')]();};}function respondWithResult(_0xc095c4,_0x131c5a){_0x131c5a=_0x131c5a||0xc8;return function(_0x4d1791){if(_0x4d1791){return _0xc095c4['status'](_0x131c5a)['json'](_0x4d1791);}};}function respondWithFilteredResult(_0x493b7d,_0x372785){return function(_0x5bbc0a){if(_0x5bbc0a){var _0x166835=typeof _0x372785[_0x3716('0x1f')]===_0x3716('0x20')&&typeof _0x372785['limit']==='undefined';var _0x5f3833=_0x5bbc0a['count'];var _0x27fa57=_0x166835?0x0:_0x372785[_0x3716('0x1f')];var _0x5d16c4=_0x166835?_0x5bbc0a[_0x3716('0x21')]:_0x372785[_0x3716('0x1f')]+_0x372785[_0x3716('0x22')];var _0xf6c764;if(_0x5d16c4>=_0x5f3833){_0x5d16c4=_0x5f3833;_0xf6c764=0xc8;}else{_0xf6c764=0xce;}_0x493b7d[_0x3716('0x1d')](_0xf6c764);return _0x493b7d[_0x3716('0x23')](_0x3716('0x24'),_0x27fa57+'-'+_0x5d16c4+'/'+_0x5f3833)['json'](_0x5bbc0a);}return null;};}function patchUpdates(_0x4cd0a6){return function(_0x524db1){try{jsonpatch[_0x3716('0x25')](_0x524db1,_0x4cd0a6,!![]);}catch(_0x49a885){return BPromise[_0x3716('0x26')](_0x49a885);}return _0x524db1[_0x3716('0x27')]();};}function saveUpdates(_0x2cccca,_0x233517){return function(_0x2b5296){if(_0x2b5296){return _0x2b5296[_0x3716('0x28')](_0x2cccca)[_0x3716('0x29')](function(_0x12bc19){return _0x12bc19;});}return null;};}function removeEntity(_0x1f18b2,_0x483bdd){return function(_0xec15ce){if(_0xec15ce){return _0xec15ce[_0x3716('0x2a')]()[_0x3716('0x29')](function(){_0x1f18b2['status'](0xcc)[_0x3716('0x1e')]();});}};}function handleEntityNotFound(_0x3e7452,_0x4daec7){return function(_0x3fd2bf){if(!_0x3fd2bf){_0x3e7452['sendStatus'](0x194);}return _0x3fd2bf;};}function handleError(_0x224451,_0x2c3df6){_0x2c3df6=_0x2c3df6||0x1f4;return function(_0x203310){logger['error'](_0x203310[_0x3716('0x2b')]);if(_0x203310['name']){delete _0x203310[_0x3716('0x2c')];}_0x224451[_0x3716('0x1d')](_0x2c3df6)['send'](_0x203310);};}exports[_0x3716('0x2d')]=function(_0x3dcf6b,_0x1c29b8){var _0xc5211={},_0x1e413c={},_0x4f76dc={'count':0x0,'rows':[]};var _0x2fdfa1=_[_0x3716('0x2e')](db[_0x3716('0x2f')][_0x3716('0x30')],function(_0x4fee70){return{'name':_0x4fee70[_0x3716('0x31')],'type':_0x4fee70[_0x3716('0x32')][_0x3716('0x33')]};});_0x1e413c[_0x3716('0x34')]=_[_0x3716('0x2e')](_0x2fdfa1,'name');_0x1e413c[_0x3716('0x35')]=_[_0x3716('0x36')](_0x3dcf6b[_0x3716('0x35')]);_0x1e413c['filters']=_['intersection'](_0x1e413c[_0x3716('0x34')],_0x1e413c[_0x3716('0x35')]);_0xc5211[_0x3716('0x37')]=_[_0x3716('0x38')](_0x1e413c['model'],qs[_0x3716('0x39')](_0x3dcf6b[_0x3716('0x35')][_0x3716('0x39')]));_0xc5211[_0x3716('0x37')]=_0xc5211[_0x3716('0x37')][_0x3716('0x3a')]?_0xc5211['attributes']:_0x1e413c[_0x3716('0x34')];if(!_0x3dcf6b[_0x3716('0x35')][_0x3716('0x3b')]('nolimit')){_0xc5211['limit']=qs[_0x3716('0x22')](_0x3dcf6b['query'][_0x3716('0x22')]);_0xc5211[_0x3716('0x1f')]=qs[_0x3716('0x1f')](_0x3dcf6b[_0x3716('0x35')][_0x3716('0x1f')]);}_0xc5211[_0x3716('0x3c')]=qs[_0x3716('0x3d')](_0x3dcf6b[_0x3716('0x35')]['sort']);_0xc5211[_0x3716('0x3e')]=qs[_0x3716('0x3f')](_[_0x3716('0x40')](_0x3dcf6b['query'],_0x1e413c[_0x3716('0x3f')]),_0x2fdfa1);if(_0x3dcf6b['query'][_0x3716('0x41')]){_0xc5211[_0x3716('0x3e')]=_[_0x3716('0x42')](_0xc5211[_0x3716('0x3e')],{'$or':_[_0x3716('0x2e')](_0x2fdfa1,function(_0x207d5e){if(_0x207d5e[_0x3716('0x32')]!==_0x3716('0x43')){var _0x4028b9={};_0x4028b9[_0x207d5e[_0x3716('0x2c')]]={'$like':'%'+_0x3dcf6b[_0x3716('0x35')]['filter']+'%'};return _0x4028b9;}})});}_0xc5211=_[_0x3716('0x42')]({},_0xc5211,_0x3dcf6b[_0x3716('0x44')]);var _0xe69c79={'where':_0xc5211[_0x3716('0x3e')]};return db['ChatQueueReport'][_0x3716('0x21')](_0xe69c79)[_0x3716('0x29')](function(_0x48a539){_0x4f76dc[_0x3716('0x21')]=_0x48a539;if(_0x3dcf6b[_0x3716('0x35')]['includeAll']){_0xc5211[_0x3716('0x45')]=[{'all':!![]}];}return db[_0x3716('0x2f')]['findAll'](_0xc5211);})[_0x3716('0x29')](function(_0xe4b86a){_0x4f76dc['rows']=_0xe4b86a;return _0x4f76dc;})[_0x3716('0x29')](respondWithFilteredResult(_0x1c29b8,_0xc5211))['catch'](handleError(_0x1c29b8,null));};exports[_0x3716('0x46')]=function(_0x215ca6,_0x50dabb){var _0x55147c={'raw':!![],'where':{'id':_0x215ca6[_0x3716('0x47')]['id']}},_0x100807={};_0x100807[_0x3716('0x34')]=_['keys'](db[_0x3716('0x2f')][_0x3716('0x30')]);_0x100807['query']=_[_0x3716('0x36')](_0x215ca6['query']);_0x100807[_0x3716('0x3f')]=_[_0x3716('0x38')](_0x100807[_0x3716('0x34')],_0x100807['query']);_0x55147c['attributes']=_[_0x3716('0x38')](_0x100807[_0x3716('0x34')],qs['fields'](_0x215ca6[_0x3716('0x35')][_0x3716('0x39')]));_0x55147c[_0x3716('0x37')]=_0x55147c[_0x3716('0x37')][_0x3716('0x3a')]?_0x55147c[_0x3716('0x37')]:_0x100807[_0x3716('0x34')];if(_0x215ca6['query'][_0x3716('0x48')]){_0x55147c[_0x3716('0x45')]=[{'all':!![]}];}_0x55147c=_[_0x3716('0x42')]({},_0x55147c,_0x215ca6[_0x3716('0x44')]);return db[_0x3716('0x2f')][_0x3716('0x49')](_0x55147c)[_0x3716('0x29')](handleEntityNotFound(_0x50dabb,null))['then'](respondWithResult(_0x50dabb,null))['catch'](handleError(_0x50dabb,null));};exports['create']=function(_0x5b5df8,_0x1ef5da){return db[_0x3716('0x2f')][_0x3716('0x4a')](_0x5b5df8[_0x3716('0x4b')],{})['then'](respondWithResult(_0x1ef5da,0xc9))[_0x3716('0x4c')](handleError(_0x1ef5da,null));};exports['update']=function(_0xf06450,_0x524088){if(_0xf06450[_0x3716('0x4b')]['id']){delete _0xf06450['body']['id'];}return db[_0x3716('0x2f')][_0x3716('0x49')]({'where':{'id':_0xf06450[_0x3716('0x47')]['id']}})[_0x3716('0x29')](handleEntityNotFound(_0x524088,null))[_0x3716('0x29')](saveUpdates(_0xf06450[_0x3716('0x4b')],null))[_0x3716('0x29')](respondWithResult(_0x524088,null))[_0x3716('0x4c')](handleError(_0x524088,null));};exports[_0x3716('0x2a')]=function(_0xca5eca,_0x3f05de){return db['ChatQueueReport']['find']({'where':{'id':_0xca5eca[_0x3716('0x47')]['id']}})[_0x3716('0x29')](handleEntityNotFound(_0x3f05de,null))['then'](removeEntity(_0x3f05de,null))[_0x3716('0x4c')](handleError(_0x3f05de,null));};exports[_0x3716('0x4d')]=function(_0x2e439e,_0x2ae48b){return db[_0x3716('0x2f')]['describe']()[_0x3716('0x29')](respondWithResult(_0x2ae48b,null))[_0x3716('0x4c')](handleError(_0x2ae48b,null));}; \ No newline at end of file +var _0x975b=['ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','length','find','create','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv'];(function(_0x1c8ff7,_0x2dbc21){var _0x44a301=function(_0x4c59c8){while(--_0x4c59c8){_0x1c8ff7['push'](_0x1c8ff7['shift']());}};_0x44a301(++_0x2dbc21);}(_0x975b,0x1c9));var _0xb975=function(_0x424fe4,_0x5ad6f9){_0x424fe4=_0x424fe4-0x0;var _0x24136d=_0x975b[_0x424fe4];return _0x24136d;};'use strict';var emlformat=require(_0xb975('0x0'));var rimraf=require(_0xb975('0x1'));var zipdir=require(_0xb975('0x2'));var jsonpatch=require(_0xb975('0x3'));var rp=require(_0xb975('0x4'));var moment=require(_0xb975('0x5'));var BPromise=require(_0xb975('0x6'));var Mustache=require('mustache');var util=require(_0xb975('0x7'));var path=require(_0xb975('0x8'));var sox=require(_0xb975('0x9'));var csv=require(_0xb975('0xa'));var ejs=require(_0xb975('0xb'));var fs=require('fs');var fs_extra=require(_0xb975('0xc'));var _=require(_0xb975('0xd'));var squel=require('squel');var crypto=require(_0xb975('0xe'));var jsforce=require(_0xb975('0xf'));var deskjs=require(_0xb975('0x10'));var toCsv=require('to-csv');var querystring=require(_0xb975('0x11'));var Papa=require(_0xb975('0x12'));var Redis=require(_0xb975('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xb975('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb975('0x15'));var logger=require('../../config/logger')(_0xb975('0x16'));var utils=require('../../config/utils');var config=require(_0xb975('0x17'));var licenseUtil=require(_0xb975('0x18'));var db=require(_0xb975('0x19'))['db'];function respondWithStatusCode(_0x1c4b77,_0x13ca28){_0x13ca28=_0x13ca28||0xcc;return function(_0x558727){if(_0x558727){return _0x1c4b77[_0xb975('0x1a')](_0x13ca28);}return _0x1c4b77[_0xb975('0x1b')](_0x13ca28)[_0xb975('0x1c')]();};}function respondWithResult(_0x24919e,_0x5cea50){_0x5cea50=_0x5cea50||0xc8;return function(_0x470ead){if(_0x470ead){return _0x24919e[_0xb975('0x1b')](_0x5cea50)[_0xb975('0x1d')](_0x470ead);}};}function respondWithFilteredResult(_0x4b1ede,_0x24f8ec){return function(_0x3da9e9){if(_0x3da9e9){var _0x36d959=typeof _0x24f8ec['offset']===_0xb975('0x1e')&&typeof _0x24f8ec['limit']===_0xb975('0x1e');var _0x34e062=_0x3da9e9[_0xb975('0x1f')];var _0x347a04=_0x36d959?0x0:_0x24f8ec[_0xb975('0x20')];var _0x327728=_0x36d959?_0x3da9e9[_0xb975('0x1f')]:_0x24f8ec['offset']+_0x24f8ec['limit'];var _0x2abb84;if(_0x327728>=_0x34e062){_0x327728=_0x34e062;_0x2abb84=0xc8;}else{_0x2abb84=0xce;}_0x4b1ede[_0xb975('0x1b')](_0x2abb84);return _0x4b1ede[_0xb975('0x21')](_0xb975('0x22'),_0x347a04+'-'+_0x327728+'/'+_0x34e062)['json'](_0x3da9e9);}return null;};}function patchUpdates(_0x39af85){return function(_0x49adfa){try{jsonpatch[_0xb975('0x23')](_0x49adfa,_0x39af85,!![]);}catch(_0x3f0876){return BPromise[_0xb975('0x24')](_0x3f0876);}return _0x49adfa['save']();};}function saveUpdates(_0xe7a5f0,_0x493c0b){return function(_0x5d1312){if(_0x5d1312){return _0x5d1312[_0xb975('0x25')](_0xe7a5f0)[_0xb975('0x26')](function(_0x226f21){return _0x226f21;});}return null;};}function removeEntity(_0xa4d4c,_0x35dcc6){return function(_0x5620fc){if(_0x5620fc){return _0x5620fc[_0xb975('0x27')]()['then'](function(){_0xa4d4c[_0xb975('0x1b')](0xcc)[_0xb975('0x1c')]();});}};}function handleEntityNotFound(_0xc0d861,_0x263f73){return function(_0x5309c6){if(!_0x5309c6){_0xc0d861[_0xb975('0x1a')](0x194);}return _0x5309c6;};}function handleError(_0x2824bf,_0x41905e){_0x41905e=_0x41905e||0x1f4;return function(_0xed596){logger['error'](_0xed596[_0xb975('0x28')]);if(_0xed596[_0xb975('0x29')]){delete _0xed596[_0xb975('0x29')];}_0x2824bf[_0xb975('0x1b')](_0x41905e)[_0xb975('0x2a')](_0xed596);};}exports[_0xb975('0x2b')]=function(_0x442bc6,_0x135cc9){var _0x2d730d={},_0x514451={},_0x2b1319={'count':0x0,'rows':[]};var _0x2b3ec2=_[_0xb975('0x2c')](db[_0xb975('0x2d')][_0xb975('0x2e')],function(_0x3bd5cb){return{'name':_0x3bd5cb[_0xb975('0x2f')],'type':_0x3bd5cb[_0xb975('0x30')][_0xb975('0x31')]};});_0x514451[_0xb975('0x32')]=_[_0xb975('0x2c')](_0x2b3ec2,'name');_0x514451[_0xb975('0x33')]=_['keys'](_0x442bc6['query']);_0x514451[_0xb975('0x34')]=_['intersection'](_0x514451[_0xb975('0x32')],_0x514451[_0xb975('0x33')]);_0x2d730d['attributes']=_[_0xb975('0x35')](_0x514451['model'],qs[_0xb975('0x36')](_0x442bc6[_0xb975('0x33')][_0xb975('0x36')]));_0x2d730d[_0xb975('0x37')]=_0x2d730d[_0xb975('0x37')]['length']?_0x2d730d[_0xb975('0x37')]:_0x514451['model'];if(!_0x442bc6['query'][_0xb975('0x38')](_0xb975('0x39'))){_0x2d730d[_0xb975('0x3a')]=qs[_0xb975('0x3a')](_0x442bc6[_0xb975('0x33')][_0xb975('0x3a')]);_0x2d730d[_0xb975('0x20')]=qs[_0xb975('0x20')](_0x442bc6['query'][_0xb975('0x20')]);}_0x2d730d[_0xb975('0x3b')]=qs['sort'](_0x442bc6[_0xb975('0x33')][_0xb975('0x3c')]);_0x2d730d[_0xb975('0x3d')]=qs[_0xb975('0x34')](_[_0xb975('0x3e')](_0x442bc6[_0xb975('0x33')],_0x514451[_0xb975('0x34')]),_0x2b3ec2);if(_0x442bc6['query'][_0xb975('0x3f')]){_0x2d730d['where']=_[_0xb975('0x40')](_0x2d730d[_0xb975('0x3d')],{'$or':_['map'](_0x2b3ec2,function(_0x2341e6){if(_0x2341e6['type']!==_0xb975('0x41')){var _0x378e54={};_0x378e54[_0x2341e6[_0xb975('0x29')]]={'$like':'%'+_0x442bc6[_0xb975('0x33')][_0xb975('0x3f')]+'%'};return _0x378e54;}})});}_0x2d730d=_[_0xb975('0x40')]({},_0x2d730d,_0x442bc6[_0xb975('0x42')]);var _0x2781ab={'where':_0x2d730d['where']};return db[_0xb975('0x2d')][_0xb975('0x1f')](_0x2781ab)[_0xb975('0x26')](function(_0x562e0d){_0x2b1319['count']=_0x562e0d;if(_0x442bc6[_0xb975('0x33')][_0xb975('0x43')]){_0x2d730d[_0xb975('0x44')]=[{'all':!![]}];}return db['ChatQueueReport']['findAll'](_0x2d730d);})[_0xb975('0x26')](function(_0x335011){_0x2b1319[_0xb975('0x45')]=_0x335011;return _0x2b1319;})[_0xb975('0x26')](respondWithFilteredResult(_0x135cc9,_0x2d730d))['catch'](handleError(_0x135cc9,null));};exports[_0xb975('0x46')]=function(_0x17d594,_0xe5c7e7){var _0x160e58={'raw':!![],'where':{'id':_0x17d594[_0xb975('0x47')]['id']}},_0x55f550={};_0x55f550[_0xb975('0x32')]=_['keys'](db['ChatQueueReport'][_0xb975('0x2e')]);_0x55f550['query']=_['keys'](_0x17d594[_0xb975('0x33')]);_0x55f550['filters']=_[_0xb975('0x35')](_0x55f550[_0xb975('0x32')],_0x55f550['query']);_0x160e58[_0xb975('0x37')]=_[_0xb975('0x35')](_0x55f550[_0xb975('0x32')],qs[_0xb975('0x36')](_0x17d594[_0xb975('0x33')]['fields']));_0x160e58[_0xb975('0x37')]=_0x160e58[_0xb975('0x37')][_0xb975('0x48')]?_0x160e58['attributes']:_0x55f550[_0xb975('0x32')];if(_0x17d594[_0xb975('0x33')][_0xb975('0x43')]){_0x160e58['include']=[{'all':!![]}];}_0x160e58=_[_0xb975('0x40')]({},_0x160e58,_0x17d594[_0xb975('0x42')]);return db[_0xb975('0x2d')][_0xb975('0x49')](_0x160e58)['then'](handleEntityNotFound(_0xe5c7e7,null))['then'](respondWithResult(_0xe5c7e7,null))['catch'](handleError(_0xe5c7e7,null));};exports[_0xb975('0x4a')]=function(_0x4483ba,_0x15bc77){return db[_0xb975('0x2d')][_0xb975('0x4a')](_0x4483ba[_0xb975('0x4b')],{})[_0xb975('0x26')](respondWithResult(_0x15bc77,0xc9))[_0xb975('0x4c')](handleError(_0x15bc77,null));};exports[_0xb975('0x25')]=function(_0x466251,_0x1a3268){if(_0x466251['body']['id']){delete _0x466251[_0xb975('0x4b')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x466251['params']['id']}})[_0xb975('0x26')](handleEntityNotFound(_0x1a3268,null))[_0xb975('0x26')](saveUpdates(_0x466251['body'],null))[_0xb975('0x26')](respondWithResult(_0x1a3268,null))[_0xb975('0x4c')](handleError(_0x1a3268,null));};exports[_0xb975('0x27')]=function(_0x22743c,_0x1f9544){return db[_0xb975('0x2d')][_0xb975('0x49')]({'where':{'id':_0x22743c[_0xb975('0x47')]['id']}})[_0xb975('0x26')](handleEntityNotFound(_0x1f9544,null))['then'](removeEntity(_0x1f9544,null))['catch'](handleError(_0x1f9544,null));};exports['describe']=function(_0x3cedf9,_0x1a1f97){return db['ChatQueueReport'][_0xb975('0x4d')]()[_0xb975('0x26')](respondWithResult(_0x1a1f97,null))[_0xb975('0x4c')](handleError(_0x1a1f97,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index bc6f522..268d77e 100644 --- a/server/api/chatQueueReport/chatQueueReport.model.js +++ b/server/api/chatQueueReport/chatQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x126a10,_0x7bde76){var _0x15a853=function(_0x2bd2d6){while(--_0x2bd2d6){_0x126a10['push'](_0x126a10['shift']());}};_0x15a853(++_0x7bde76);}(_0xe706,0xa3));var _0x6e70=function(_0xed9c99,_0x2217b1){_0xed9c99=_0xed9c99-0x0;var _0x5443a1=_0xe706[_0xed9c99];return _0x5443a1;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x443547,_0x21d7a8){var _0x1423a8=function(_0x2f8d47){while(--_0x2f8d47){_0x443547['push'](_0x443547['shift']());}};_0x1423a8(++_0x21d7a8);}(_0xe706,0xa3));var _0x6e70=function(_0x4b3e49,_0x9e566c){_0x4b3e49=_0x4b3e49-0x0;var _0x57e339=_0xe706[_0x4b3e49];return _0x57e339;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index c572409..eaabd84 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 _0x8a31=['limit','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','where','attributes'];(function(_0x3c6152,_0x555b70){var _0x54ec67=function(_0x30f3cf){while(--_0x30f3cf){_0x3c6152['push'](_0x3c6152['shift']());}};_0x54ec67(++_0x555b70);}(_0x8a31,0xa1));var _0x18a3=function(_0x2fff83,_0x29d5fe){_0x2fff83=_0x2fff83-0x0;var _0xa2a722=_0x8a31[_0x2fff83];return _0xa2a722;};'use strict';var _=require('lodash');var util=require(_0x18a3('0x0'));var moment=require(_0x18a3('0x1'));var BPromise=require(_0x18a3('0x2'));var rs=require(_0x18a3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x18a3('0x4'))['db'];var utils=require(_0x18a3('0x5'));var logger=require(_0x18a3('0x6'))(_0x18a3('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x18a3('0x8')][_0x18a3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x909b9c,_0x1e1f31,_0x579339){return new BPromise(function(_0x2bec04,_0x14d6cc){return client[_0x18a3('0xa')](_0x909b9c,_0x579339)[_0x18a3('0xb')](function(_0x1c9330){logger[_0x18a3('0xc')](_0x18a3('0xd'),_0x1e1f31,_0x18a3('0xe'));logger[_0x18a3('0xf')](_0x18a3('0x10'),_0x1e1f31,_0x18a3('0xe'),JSON[_0x18a3('0x11')](_0x1c9330));if(_0x1c9330[_0x18a3('0x12')]){if(_0x1c9330[_0x18a3('0x12')][_0x18a3('0x13')]===0x1f4){logger[_0x18a3('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x1e1f31,_0x1c9330[_0x18a3('0x12')][_0x18a3('0x14')]);return _0x14d6cc(_0x1c9330[_0x18a3('0x12')][_0x18a3('0x14')]);}logger[_0x18a3('0x12')](_0x18a3('0xd'),_0x1e1f31,_0x1c9330[_0x18a3('0x12')][_0x18a3('0x14')]);return _0x2bec04(_0x1c9330[_0x18a3('0x12')]['message']);}else{logger[_0x18a3('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x1e1f31,_0x18a3('0xe'));_0x2bec04(_0x1c9330['result'][_0x18a3('0x14')]);}})[_0x18a3('0x15')](function(_0x1ff663){logger[_0x18a3('0x12')](_0x18a3('0xd'),_0x1e1f31,_0x1ff663);_0x14d6cc(_0x1ff663);});});}exports[_0x18a3('0x16')]=function(_0xb0f847){var _0x35e6b6=this;return new Promise(function(_0x44e429,_0x15be03){return db[_0x18a3('0x17')][_0x18a3('0x18')](_0xb0f847[_0x18a3('0x19')],{'raw':_0xb0f847[_0x18a3('0x1a')]?_0xb0f847[_0x18a3('0x1a')][_0x18a3('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x528994){logger[_0x18a3('0xc')](_0x18a3('0x16'),_0xb0f847);logger['debug'](_0x18a3('0x16'),_0xb0f847,JSON[_0x18a3('0x11')](_0x528994));_0x44e429(_0x528994);})[_0x18a3('0x15')](function(_0x2dcb88){logger['error']('CreateChatQueueReport',_0x2dcb88[_0x18a3('0x14')],_0xb0f847);_0x15be03(_0x35e6b6[_0x18a3('0x12')](0x1f4,_0x2dcb88[_0x18a3('0x14')]));});});};exports[_0x18a3('0x1c')]=function(_0x4bbf3b){var _0x2ca4=this;return new Promise(function(_0x2b0bc0,_0x458aee){return db['ChatQueueReport']['update'](_0x4bbf3b[_0x18a3('0x19')],{'raw':_0x4bbf3b['options']?_0x4bbf3b[_0x18a3('0x1a')][_0x18a3('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4bbf3b[_0x18a3('0x1a')]?_0x4bbf3b[_0x18a3('0x1a')][_0x18a3('0x1d')]||null:null,'attributes':_0x4bbf3b['options']?_0x4bbf3b[_0x18a3('0x1a')][_0x18a3('0x1e')]||null:null,'limit':_0x4bbf3b['options']?_0x4bbf3b['options'][_0x18a3('0x1f')]||null:null})[_0x18a3('0xb')](function(_0x47cac8){logger[_0x18a3('0xc')](_0x18a3('0x1c'),_0x4bbf3b);logger[_0x18a3('0xf')](_0x18a3('0x1c'),_0x4bbf3b,JSON[_0x18a3('0x11')](_0x47cac8));_0x2b0bc0(_0x47cac8);})[_0x18a3('0x15')](function(_0x25a455){logger['error'](_0x18a3('0x1c'),_0x25a455[_0x18a3('0x14')],_0x4bbf3b);_0x458aee(_0x2ca4[_0x18a3('0x12')](0x1f4,_0x25a455[_0x18a3('0x14')]));});});}; \ No newline at end of file +var _0x9e09=['raw','catch','UpdateChatQueueReport','update','body','where','attributes','debug','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','CreateChatQueueReport','ChatQueueReport','options'];(function(_0x22845f,_0xa8a62f){var _0x6dce84=function(_0x331636){while(--_0x331636){_0x22845f['push'](_0x22845f['shift']());}};_0x6dce84(++_0xa8a62f);}(_0x9e09,0x152));var _0x99e0=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9e09[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x99e0('0x0'));var util=require(_0x99e0('0x1'));var moment=require('moment');var BPromise=require(_0x99e0('0x2'));var rs=require(_0x99e0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x99e0('0x4'))['db'];var utils=require(_0x99e0('0x5'));var logger=require(_0x99e0('0x6'))(_0x99e0('0x7'));var config=require('../../config/environment');var jayson=require(_0x99e0('0x8'));var client=jayson[_0x99e0('0x9')][_0x99e0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x121eeb,_0x1f8df0,_0x3c4afa){return new BPromise(function(_0x5d4f56,_0x24131f){return client['request'](_0x121eeb,_0x3c4afa)[_0x99e0('0xb')](function(_0xecd6e5){logger[_0x99e0('0xc')](_0x99e0('0xd'),_0x1f8df0,_0x99e0('0xe'));logger['debug']('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x1f8df0,'request\x20sent',JSON[_0x99e0('0xf')](_0xecd6e5));if(_0xecd6e5['error']){if(_0xecd6e5[_0x99e0('0x10')][_0x99e0('0x11')]===0x1f4){logger[_0x99e0('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x1f8df0,_0xecd6e5['error'][_0x99e0('0x12')]);return _0x24131f(_0xecd6e5[_0x99e0('0x10')][_0x99e0('0x12')]);}logger['error'](_0x99e0('0xd'),_0x1f8df0,_0xecd6e5[_0x99e0('0x10')][_0x99e0('0x12')]);return _0x5d4f56(_0xecd6e5[_0x99e0('0x10')][_0x99e0('0x12')]);}else{logger[_0x99e0('0xc')](_0x99e0('0xd'),_0x1f8df0,_0x99e0('0xe'));_0x5d4f56(_0xecd6e5['result'][_0x99e0('0x12')]);}})['catch'](function(_0x158b21){logger[_0x99e0('0x10')](_0x99e0('0xd'),_0x1f8df0,_0x158b21);_0x24131f(_0x158b21);});});}exports[_0x99e0('0x13')]=function(_0x5e8b35){var _0x2895e5=this;return new Promise(function(_0x5e32da,_0x4c64ca){return db[_0x99e0('0x14')]['create'](_0x5e8b35['body'],{'raw':_0x5e8b35[_0x99e0('0x15')]?_0x5e8b35[_0x99e0('0x15')][_0x99e0('0x16')]===undefined?!![]:![]:!![]})[_0x99e0('0xb')](function(_0x2db5a5){logger[_0x99e0('0xc')](_0x99e0('0x13'),_0x5e8b35);logger['debug']('CreateChatQueueReport',_0x5e8b35,JSON[_0x99e0('0xf')](_0x2db5a5));_0x5e32da(_0x2db5a5);})[_0x99e0('0x17')](function(_0x30e1d5){logger[_0x99e0('0x10')]('CreateChatQueueReport',_0x30e1d5[_0x99e0('0x12')],_0x5e8b35);_0x4c64ca(_0x2895e5[_0x99e0('0x10')](0x1f4,_0x30e1d5['message']));});});};exports[_0x99e0('0x18')]=function(_0x29a7dd){var _0x1899ee=this;return new Promise(function(_0x579658,_0x3565dd){return db[_0x99e0('0x14')][_0x99e0('0x19')](_0x29a7dd[_0x99e0('0x1a')],{'raw':_0x29a7dd[_0x99e0('0x15')]?_0x29a7dd[_0x99e0('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29a7dd[_0x99e0('0x15')]?_0x29a7dd[_0x99e0('0x15')][_0x99e0('0x1b')]||null:null,'attributes':_0x29a7dd[_0x99e0('0x15')]?_0x29a7dd['options'][_0x99e0('0x1c')]||null:null,'limit':_0x29a7dd['options']?_0x29a7dd[_0x99e0('0x15')]['limit']||null:null})[_0x99e0('0xb')](function(_0x540cdf){logger[_0x99e0('0xc')](_0x99e0('0x18'),_0x29a7dd);logger[_0x99e0('0x1d')](_0x99e0('0x18'),_0x29a7dd,JSON[_0x99e0('0xf')](_0x540cdf));_0x579658(_0x540cdf);})[_0x99e0('0x17')](function(_0x2261d1){logger[_0x99e0('0x10')](_0x99e0('0x18'),_0x2261d1['message'],_0x29a7dd);_0x3565dd(_0x1899ee[_0x99e0('0x10')](0x1f4,_0x2261d1[_0x99e0('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index fef8ad5..dfc5f33 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 _0xdd4c=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x1e03a6,_0xf0349){var _0x295b64=function(_0x1ad0a5){while(--_0x1ad0a5){_0x1e03a6['push'](_0x1e03a6['shift']());}};_0x295b64(++_0xf0349);}(_0xdd4c,0x13c));var _0xcdd4=function(_0x378c89,_0x1b9a0e){_0x378c89=_0x378c89-0x0;var _0x2abed8=_0xdd4c[_0x378c89];return _0x2abed8;};'use strict';var multer=require(_0xcdd4('0x0'));var util=require(_0xcdd4('0x1'));var path=require('path');var timeout=require(_0xcdd4('0x2'));var express=require(_0xcdd4('0x3'));var router=express[_0xcdd4('0x4')]();var fs_extra=require(_0xcdd4('0x5'));var auth=require(_0xcdd4('0x6'));var interaction=require(_0xcdd4('0x7'));var config=require(_0xcdd4('0x8'));var controller=require(_0xcdd4('0x9'));router['get']('/',auth[_0xcdd4('0xa')](),controller[_0xcdd4('0xb')]);router[_0xcdd4('0xc')](_0xcdd4('0xd'),auth['isAuthenticated'](),controller[_0xcdd4('0xe')]);router[_0xcdd4('0xc')](_0xcdd4('0xf'),auth[_0xcdd4('0xa')](),controller[_0xcdd4('0x10')]);router[_0xcdd4('0x11')]('/',auth[_0xcdd4('0xa')](),controller[_0xcdd4('0x12')]);router[_0xcdd4('0x13')](_0xcdd4('0xf'),auth['isAuthenticated'](),controller[_0xcdd4('0x14')]);router['delete']('/:id',auth[_0xcdd4('0xa')](),controller[_0xcdd4('0x15')]);module[_0xcdd4('0x16')]=router; \ No newline at end of file +var _0x66f5=['show','post','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/:id'];(function(_0x2876a0,_0x5a09e3){var _0x5c4aae=function(_0x499cd2){while(--_0x499cd2){_0x2876a0['push'](_0x2876a0['shift']());}};_0x5c4aae(++_0x5a09e3);}(_0x66f5,0x1a7));var _0x566f=function(_0x5c1df6,_0x1a4cde){_0x5c1df6=_0x5c1df6-0x0;var _0x26b82c=_0x66f5[_0x5c1df6];return _0x26b82c;};'use strict';var multer=require(_0x566f('0x0'));var util=require(_0x566f('0x1'));var path=require(_0x566f('0x2'));var timeout=require(_0x566f('0x3'));var express=require('express');var router=express[_0x566f('0x4')]();var fs_extra=require(_0x566f('0x5'));var auth=require(_0x566f('0x6'));var interaction=require(_0x566f('0x7'));var config=require(_0x566f('0x8'));var controller=require(_0x566f('0x9'));router[_0x566f('0xa')]('/',auth[_0x566f('0xb')](),controller[_0x566f('0xc')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x566f('0xa')](_0x566f('0xd'),auth[_0x566f('0xb')](),controller[_0x566f('0xe')]);router[_0x566f('0xf')]('/',auth[_0x566f('0xb')](),controller['create']);router[_0x566f('0x10')](_0x566f('0xd'),auth['isAuthenticated'](),controller[_0x566f('0x11')]);router['delete'](_0x566f('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x566f('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 7a9c545..e174f3a 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 _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x4ea4ec,_0x390973){var _0xb8d8b1=function(_0x4c63fc){while(--_0x4c63fc){_0x4ea4ec['push'](_0x4ea4ec['shift']());}};_0xb8d8b1(++_0x390973);}(_0x4b84,0x1cc));var _0x44b8=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x4b84[_0x92c450];return _0x2a9599;};'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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x17c4f1,_0x178aa0){var _0x4336eb=function(_0x3c30cb){while(--_0x3c30cb){_0x17c4f1['push'](_0x17c4f1['shift']());}};_0x4336eb(++_0x178aa0);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x249d99,_0x16b584){_0x249d99=_0x249d99-0x0;var _0x5bfb05=_0xf3cd[_0x249d99];return _0x5bfb05;};'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 c6ef2e9..c0f8251 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 _0xe168=['undefined','offset','count','set','Content-Range','apply','reject','then','destroy','end','error','name','send','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','update','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit'];(function(_0x43519c,_0x5629a5){var _0x40af3e=function(_0xbb77e0){while(--_0xbb77e0){_0x43519c['push'](_0x43519c['shift']());}};_0x40af3e(++_0x5629a5);}(_0xe168,0xc2));var _0x8e16=function(_0x4b28cc,_0x2175f5){_0x4b28cc=_0x4b28cc-0x0;var _0x18c28e=_0xe168[_0x4b28cc];return _0x18c28e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8e16('0x0'));var zipdir=require(_0x8e16('0x1'));var jsonpatch=require(_0x8e16('0x2'));var rp=require('request-promise');var moment=require(_0x8e16('0x3'));var BPromise=require(_0x8e16('0x4'));var Mustache=require(_0x8e16('0x5'));var util=require(_0x8e16('0x6'));var path=require(_0x8e16('0x7'));var sox=require(_0x8e16('0x8'));var csv=require(_0x8e16('0x9'));var ejs=require(_0x8e16('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8e16('0xb'));var jsforce=require(_0x8e16('0xc'));var deskjs=require(_0x8e16('0xd'));var toCsv=require(_0x8e16('0x9'));var querystring=require(_0x8e16('0xe'));var Papa=require('papaparse');var Redis=require(_0x8e16('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8e16('0x10'));var as=require(_0x8e16('0x11'));var hardwareService=require(_0x8e16('0x12'));var logger=require(_0x8e16('0x13'))(_0x8e16('0x14'));var utils=require('../../config/utils');var config=require(_0x8e16('0x15'));var licenseUtil=require(_0x8e16('0x16'));var db=require(_0x8e16('0x17'))['db'];function respondWithStatusCode(_0x497b05,_0x15ccdd){_0x15ccdd=_0x15ccdd||0xcc;return function(_0x42cd4e){if(_0x42cd4e){return _0x497b05[_0x8e16('0x18')](_0x15ccdd);}return _0x497b05[_0x8e16('0x19')](_0x15ccdd)['end']();};}function respondWithResult(_0x42ecf6,_0x11f553){_0x11f553=_0x11f553||0xc8;return function(_0x113c46){if(_0x113c46){return _0x42ecf6[_0x8e16('0x19')](_0x11f553)[_0x8e16('0x1a')](_0x113c46);}};}function respondWithFilteredResult(_0x451c85,_0x589998){return function(_0x342f92){if(_0x342f92){var _0x48eeed=typeof _0x589998['offset']==='undefined'&&typeof _0x589998[_0x8e16('0x1b')]===_0x8e16('0x1c');var _0x24a523=_0x342f92['count'];var _0x5abce8=_0x48eeed?0x0:_0x589998[_0x8e16('0x1d')];var _0x5213ec=_0x48eeed?_0x342f92[_0x8e16('0x1e')]:_0x589998[_0x8e16('0x1d')]+_0x589998['limit'];var _0x5e5414;if(_0x5213ec>=_0x24a523){_0x5213ec=_0x24a523;_0x5e5414=0xc8;}else{_0x5e5414=0xce;}_0x451c85['status'](_0x5e5414);return _0x451c85[_0x8e16('0x1f')](_0x8e16('0x20'),_0x5abce8+'-'+_0x5213ec+'/'+_0x24a523)[_0x8e16('0x1a')](_0x342f92);}return null;};}function patchUpdates(_0xa34be7){return function(_0x3dcf05){try{jsonpatch[_0x8e16('0x21')](_0x3dcf05,_0xa34be7,!![]);}catch(_0x5984e1){return BPromise[_0x8e16('0x22')](_0x5984e1);}return _0x3dcf05['save']();};}function saveUpdates(_0x1d49d9,_0x565c89){return function(_0x5287f7){if(_0x5287f7){return _0x5287f7['update'](_0x1d49d9)[_0x8e16('0x23')](function(_0x2f6fa3){return _0x2f6fa3;});}return null;};}function removeEntity(_0x5df17d,_0x3250eb){return function(_0x146a41){if(_0x146a41){return _0x146a41[_0x8e16('0x24')]()['then'](function(){_0x5df17d[_0x8e16('0x19')](0xcc)[_0x8e16('0x25')]();});}};}function handleEntityNotFound(_0x173918,_0x1ec633){return function(_0x1f2295){if(!_0x1f2295){_0x173918[_0x8e16('0x18')](0x194);}return _0x1f2295;};}function handleError(_0x1b912f,_0x8dbd31){_0x8dbd31=_0x8dbd31||0x1f4;return function(_0x5c5ffc){logger[_0x8e16('0x26')](_0x5c5ffc['stack']);if(_0x5c5ffc[_0x8e16('0x27')]){delete _0x5c5ffc[_0x8e16('0x27')];}_0x1b912f[_0x8e16('0x19')](_0x8dbd31)[_0x8e16('0x28')](_0x5c5ffc);};}exports['index']=function(_0x4b0bd3,_0x5257e4){var _0x376f22={},_0x4c1e51={},_0xa26b2f={'count':0x0,'rows':[]};var _0x40f961=_[_0x8e16('0x29')](db[_0x8e16('0x2a')][_0x8e16('0x2b')],function(_0x2716f3){return{'name':_0x2716f3[_0x8e16('0x2c')],'type':_0x2716f3[_0x8e16('0x2d')][_0x8e16('0x2e')]};});_0x4c1e51[_0x8e16('0x2f')]=_[_0x8e16('0x29')](_0x40f961,_0x8e16('0x27'));_0x4c1e51[_0x8e16('0x30')]=_[_0x8e16('0x31')](_0x4b0bd3[_0x8e16('0x30')]);_0x4c1e51[_0x8e16('0x32')]=_[_0x8e16('0x33')](_0x4c1e51[_0x8e16('0x2f')],_0x4c1e51['query']);_0x376f22[_0x8e16('0x34')]=_['intersection'](_0x4c1e51[_0x8e16('0x2f')],qs[_0x8e16('0x35')](_0x4b0bd3[_0x8e16('0x30')][_0x8e16('0x35')]));_0x376f22[_0x8e16('0x34')]=_0x376f22[_0x8e16('0x34')][_0x8e16('0x36')]?_0x376f22[_0x8e16('0x34')]:_0x4c1e51[_0x8e16('0x2f')];if(!_0x4b0bd3[_0x8e16('0x30')]['hasOwnProperty']('nolimit')){_0x376f22[_0x8e16('0x1b')]=qs[_0x8e16('0x1b')](_0x4b0bd3[_0x8e16('0x30')][_0x8e16('0x1b')]);_0x376f22[_0x8e16('0x1d')]=qs[_0x8e16('0x1d')](_0x4b0bd3['query']['offset']);}_0x376f22[_0x8e16('0x37')]=qs[_0x8e16('0x38')](_0x4b0bd3[_0x8e16('0x30')]['sort']);_0x376f22[_0x8e16('0x39')]=qs[_0x8e16('0x32')](_[_0x8e16('0x3a')](_0x4b0bd3[_0x8e16('0x30')],_0x4c1e51['filters']),_0x40f961);if(_0x4b0bd3[_0x8e16('0x30')][_0x8e16('0x3b')]){_0x376f22[_0x8e16('0x39')]=_[_0x8e16('0x3c')](_0x376f22[_0x8e16('0x39')],{'$or':_[_0x8e16('0x29')](_0x40f961,function(_0x451c99){if(_0x451c99[_0x8e16('0x2d')]!==_0x8e16('0x3d')){var _0x1fabc7={};_0x1fabc7[_0x451c99[_0x8e16('0x27')]]={'$like':'%'+_0x4b0bd3[_0x8e16('0x30')][_0x8e16('0x3b')]+'%'};return _0x1fabc7;}})});}_0x376f22=_[_0x8e16('0x3c')]({},_0x376f22,_0x4b0bd3[_0x8e16('0x3e')]);var _0x1326c1={'where':_0x376f22['where']};return db[_0x8e16('0x2a')]['count'](_0x1326c1)[_0x8e16('0x23')](function(_0x364d90){_0xa26b2f[_0x8e16('0x1e')]=_0x364d90;if(_0x4b0bd3['query'][_0x8e16('0x3f')]){_0x376f22[_0x8e16('0x40')]=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x376f22);})[_0x8e16('0x23')](function(_0x4ac420){_0xa26b2f[_0x8e16('0x41')]=_0x4ac420;return _0xa26b2f;})['then'](respondWithFilteredResult(_0x5257e4,_0x376f22))[_0x8e16('0x42')](handleError(_0x5257e4,null));};exports[_0x8e16('0x43')]=function(_0xdcbffb,_0x35ed41){var _0x5e3b89={'raw':!![],'where':{'id':_0xdcbffb[_0x8e16('0x44')]['id']}},_0xc23543={};_0xc23543[_0x8e16('0x2f')]=_[_0x8e16('0x31')](db[_0x8e16('0x2a')][_0x8e16('0x2b')]);_0xc23543[_0x8e16('0x30')]=_['keys'](_0xdcbffb[_0x8e16('0x30')]);_0xc23543['filters']=_[_0x8e16('0x33')](_0xc23543['model'],_0xc23543[_0x8e16('0x30')]);_0x5e3b89[_0x8e16('0x34')]=_[_0x8e16('0x33')](_0xc23543['model'],qs[_0x8e16('0x35')](_0xdcbffb[_0x8e16('0x30')][_0x8e16('0x35')]));_0x5e3b89['attributes']=_0x5e3b89[_0x8e16('0x34')][_0x8e16('0x36')]?_0x5e3b89[_0x8e16('0x34')]:_0xc23543[_0x8e16('0x2f')];if(_0xdcbffb['query'][_0x8e16('0x3f')]){_0x5e3b89[_0x8e16('0x40')]=[{'all':!![]}];}_0x5e3b89=_[_0x8e16('0x3c')]({},_0x5e3b89,_0xdcbffb['options']);return db[_0x8e16('0x2a')][_0x8e16('0x45')](_0x5e3b89)['then'](handleEntityNotFound(_0x35ed41,null))['then'](respondWithResult(_0x35ed41,null))[_0x8e16('0x42')](handleError(_0x35ed41,null));};exports[_0x8e16('0x46')]=function(_0x455d81,_0x3519b5){return db[_0x8e16('0x2a')][_0x8e16('0x46')](_0x455d81[_0x8e16('0x47')],{})[_0x8e16('0x23')](respondWithResult(_0x3519b5,0xc9))[_0x8e16('0x42')](handleError(_0x3519b5,null));};exports[_0x8e16('0x48')]=function(_0x5f4fbc,_0x381d1d){if(_0x5f4fbc[_0x8e16('0x47')]['id']){delete _0x5f4fbc[_0x8e16('0x47')]['id'];}return db[_0x8e16('0x2a')][_0x8e16('0x45')]({'where':{'id':_0x5f4fbc[_0x8e16('0x44')]['id']}})[_0x8e16('0x23')](handleEntityNotFound(_0x381d1d,null))[_0x8e16('0x23')](saveUpdates(_0x5f4fbc['body'],null))[_0x8e16('0x23')](respondWithResult(_0x381d1d,null))[_0x8e16('0x42')](handleError(_0x381d1d,null));};exports['destroy']=function(_0x53e9a0,_0x326542){return db[_0x8e16('0x2a')][_0x8e16('0x45')]({'where':{'id':_0x53e9a0[_0x8e16('0x44')]['id']}})[_0x8e16('0x23')](handleEntityNotFound(_0x326542,null))[_0x8e16('0x23')](removeEntity(_0x326542,null))[_0x8e16('0x42')](handleError(_0x326542,null));};exports[_0x8e16('0x49')]=function(_0x408a74,_0xc95c8a){return db[_0x8e16('0x2a')]['describe']()['then'](respondWithResult(_0xc95c8a,null))[_0x8e16('0x42')](handleError(_0xc95c8a,null));}; \ No newline at end of file +var _0x9a8a=['squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','intersection','query','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','ChatTransferReport','include','findAll','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x1470cf,_0x3f3189){var _0x548430=function(_0x5a7727){while(--_0x5a7727){_0x1470cf['push'](_0x1470cf['shift']());}};_0x548430(++_0x3f3189);}(_0x9a8a,0x1d9));var _0xa9a8=function(_0x1a8c9d,_0x1486b2){_0x1a8c9d=_0x1a8c9d-0x0;var _0x292cee=_0x9a8a[_0x1a8c9d];return _0x292cee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa9a8('0x0'));var zipdir=require(_0xa9a8('0x1'));var jsonpatch=require(_0xa9a8('0x2'));var rp=require('request-promise');var moment=require(_0xa9a8('0x3'));var BPromise=require(_0xa9a8('0x4'));var Mustache=require(_0xa9a8('0x5'));var util=require(_0xa9a8('0x6'));var path=require(_0xa9a8('0x7'));var sox=require(_0xa9a8('0x8'));var csv=require(_0xa9a8('0x9'));var ejs=require(_0xa9a8('0xa'));var fs=require('fs');var fs_extra=require(_0xa9a8('0xb'));var _=require(_0xa9a8('0xc'));var squel=require(_0xa9a8('0xd'));var crypto=require(_0xa9a8('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa9a8('0xf'));var Papa=require(_0xa9a8('0x10'));var Redis=require(_0xa9a8('0x11'));var authService=require(_0xa9a8('0x12'));var qs=require(_0xa9a8('0x13'));var as=require(_0xa9a8('0x14'));var hardwareService=require(_0xa9a8('0x15'));var logger=require(_0xa9a8('0x16'))(_0xa9a8('0x17'));var utils=require(_0xa9a8('0x18'));var config=require(_0xa9a8('0x19'));var licenseUtil=require(_0xa9a8('0x1a'));var db=require(_0xa9a8('0x1b'))['db'];function respondWithStatusCode(_0x427452,_0xdfa7aa){_0xdfa7aa=_0xdfa7aa||0xcc;return function(_0xaff158){if(_0xaff158){return _0x427452[_0xa9a8('0x1c')](_0xdfa7aa);}return _0x427452['status'](_0xdfa7aa)[_0xa9a8('0x1d')]();};}function respondWithResult(_0x25c69f,_0x1af85d){_0x1af85d=_0x1af85d||0xc8;return function(_0x153a5d){if(_0x153a5d){return _0x25c69f[_0xa9a8('0x1e')](_0x1af85d)[_0xa9a8('0x1f')](_0x153a5d);}};}function respondWithFilteredResult(_0x2390c7,_0x233b36){return function(_0x4304f3){if(_0x4304f3){var _0x5dcfdf=typeof _0x233b36[_0xa9a8('0x20')]===_0xa9a8('0x21')&&typeof _0x233b36[_0xa9a8('0x22')]===_0xa9a8('0x21');var _0x8d173e=_0x4304f3['count'];var _0x4ba0bc=_0x5dcfdf?0x0:_0x233b36[_0xa9a8('0x20')];var _0x4dd1a4=_0x5dcfdf?_0x4304f3[_0xa9a8('0x23')]:_0x233b36[_0xa9a8('0x20')]+_0x233b36[_0xa9a8('0x22')];var _0x233a63;if(_0x4dd1a4>=_0x8d173e){_0x4dd1a4=_0x8d173e;_0x233a63=0xc8;}else{_0x233a63=0xce;}_0x2390c7['status'](_0x233a63);return _0x2390c7[_0xa9a8('0x24')](_0xa9a8('0x25'),_0x4ba0bc+'-'+_0x4dd1a4+'/'+_0x8d173e)['json'](_0x4304f3);}return null;};}function patchUpdates(_0x276db4){return function(_0x501f47){try{jsonpatch[_0xa9a8('0x26')](_0x501f47,_0x276db4,!![]);}catch(_0x15770c){return BPromise[_0xa9a8('0x27')](_0x15770c);}return _0x501f47[_0xa9a8('0x28')]();};}function saveUpdates(_0x270aeb,_0x40ffa2){return function(_0x5d53f0){if(_0x5d53f0){return _0x5d53f0[_0xa9a8('0x29')](_0x270aeb)['then'](function(_0x3f5ce1){return _0x3f5ce1;});}return null;};}function removeEntity(_0x1c865d,_0x4441be){return function(_0x90e240){if(_0x90e240){return _0x90e240[_0xa9a8('0x2a')]()[_0xa9a8('0x2b')](function(){_0x1c865d[_0xa9a8('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cd4ce,_0x4e9f77){return function(_0xd4b0ca){if(!_0xd4b0ca){_0x3cd4ce[_0xa9a8('0x1c')](0x194);}return _0xd4b0ca;};}function handleError(_0x53e3fb,_0x5d0a9e){_0x5d0a9e=_0x5d0a9e||0x1f4;return function(_0x2e6a9e){logger['error'](_0x2e6a9e[_0xa9a8('0x2c')]);if(_0x2e6a9e[_0xa9a8('0x2d')]){delete _0x2e6a9e['name'];}_0x53e3fb[_0xa9a8('0x1e')](_0x5d0a9e)[_0xa9a8('0x2e')](_0x2e6a9e);};}exports[_0xa9a8('0x2f')]=function(_0x1c9e0c,_0x215299){var _0x394561={},_0x1293d7={},_0x388396={'count':0x0,'rows':[]};var _0x50b1be=_['map'](db['ChatTransferReport'][_0xa9a8('0x30')],function(_0x32462f){return{'name':_0x32462f[_0xa9a8('0x31')],'type':_0x32462f[_0xa9a8('0x32')][_0xa9a8('0x33')]};});_0x1293d7[_0xa9a8('0x34')]=_[_0xa9a8('0x35')](_0x50b1be,_0xa9a8('0x2d'));_0x1293d7['query']=_[_0xa9a8('0x36')](_0x1c9e0c['query']);_0x1293d7['filters']=_[_0xa9a8('0x37')](_0x1293d7[_0xa9a8('0x34')],_0x1293d7[_0xa9a8('0x38')]);_0x394561['attributes']=_[_0xa9a8('0x37')](_0x1293d7['model'],qs[_0xa9a8('0x39')](_0x1c9e0c[_0xa9a8('0x38')][_0xa9a8('0x39')]));_0x394561['attributes']=_0x394561[_0xa9a8('0x3a')][_0xa9a8('0x3b')]?_0x394561['attributes']:_0x1293d7[_0xa9a8('0x34')];if(!_0x1c9e0c['query']['hasOwnProperty'](_0xa9a8('0x3c'))){_0x394561[_0xa9a8('0x22')]=qs[_0xa9a8('0x22')](_0x1c9e0c[_0xa9a8('0x38')][_0xa9a8('0x22')]);_0x394561[_0xa9a8('0x20')]=qs[_0xa9a8('0x20')](_0x1c9e0c[_0xa9a8('0x38')]['offset']);}_0x394561[_0xa9a8('0x3d')]=qs[_0xa9a8('0x3e')](_0x1c9e0c[_0xa9a8('0x38')]['sort']);_0x394561[_0xa9a8('0x3f')]=qs[_0xa9a8('0x40')](_[_0xa9a8('0x41')](_0x1c9e0c[_0xa9a8('0x38')],_0x1293d7['filters']),_0x50b1be);if(_0x1c9e0c['query'][_0xa9a8('0x42')]){_0x394561[_0xa9a8('0x3f')]=_[_0xa9a8('0x43')](_0x394561[_0xa9a8('0x3f')],{'$or':_[_0xa9a8('0x35')](_0x50b1be,function(_0x416f94){if(_0x416f94[_0xa9a8('0x32')]!==_0xa9a8('0x44')){var _0x2afb99={};_0x2afb99[_0x416f94[_0xa9a8('0x2d')]]={'$like':'%'+_0x1c9e0c[_0xa9a8('0x38')][_0xa9a8('0x42')]+'%'};return _0x2afb99;}})});}_0x394561=_[_0xa9a8('0x43')]({},_0x394561,_0x1c9e0c[_0xa9a8('0x45')]);var _0x530f21={'where':_0x394561[_0xa9a8('0x3f')]};return db[_0xa9a8('0x46')][_0xa9a8('0x23')](_0x530f21)[_0xa9a8('0x2b')](function(_0x4be6b9){_0x388396[_0xa9a8('0x23')]=_0x4be6b9;if(_0x1c9e0c[_0xa9a8('0x38')]['includeAll']){_0x394561[_0xa9a8('0x47')]=[{'all':!![]}];}return db[_0xa9a8('0x46')][_0xa9a8('0x48')](_0x394561);})[_0xa9a8('0x2b')](function(_0x5704d1){_0x388396[_0xa9a8('0x49')]=_0x5704d1;return _0x388396;})[_0xa9a8('0x2b')](respondWithFilteredResult(_0x215299,_0x394561))[_0xa9a8('0x4a')](handleError(_0x215299,null));};exports[_0xa9a8('0x4b')]=function(_0x4a9e41,_0x1e2b45){var _0x17e378={'raw':!![],'where':{'id':_0x4a9e41[_0xa9a8('0x4c')]['id']}},_0x99f09f={};_0x99f09f[_0xa9a8('0x34')]=_[_0xa9a8('0x36')](db[_0xa9a8('0x46')]['rawAttributes']);_0x99f09f[_0xa9a8('0x38')]=_[_0xa9a8('0x36')](_0x4a9e41['query']);_0x99f09f[_0xa9a8('0x40')]=_[_0xa9a8('0x37')](_0x99f09f[_0xa9a8('0x34')],_0x99f09f[_0xa9a8('0x38')]);_0x17e378['attributes']=_[_0xa9a8('0x37')](_0x99f09f['model'],qs[_0xa9a8('0x39')](_0x4a9e41[_0xa9a8('0x38')][_0xa9a8('0x39')]));_0x17e378['attributes']=_0x17e378[_0xa9a8('0x3a')][_0xa9a8('0x3b')]?_0x17e378['attributes']:_0x99f09f[_0xa9a8('0x34')];if(_0x4a9e41[_0xa9a8('0x38')]['includeAll']){_0x17e378[_0xa9a8('0x47')]=[{'all':!![]}];}_0x17e378=_[_0xa9a8('0x43')]({},_0x17e378,_0x4a9e41[_0xa9a8('0x45')]);return db[_0xa9a8('0x46')][_0xa9a8('0x4d')](_0x17e378)['then'](handleEntityNotFound(_0x1e2b45,null))[_0xa9a8('0x2b')](respondWithResult(_0x1e2b45,null))[_0xa9a8('0x4a')](handleError(_0x1e2b45,null));};exports[_0xa9a8('0x4e')]=function(_0x2681c5,_0x1f3329){return db[_0xa9a8('0x46')]['create'](_0x2681c5[_0xa9a8('0x4f')],{})[_0xa9a8('0x2b')](respondWithResult(_0x1f3329,0xc9))[_0xa9a8('0x4a')](handleError(_0x1f3329,null));};exports[_0xa9a8('0x29')]=function(_0x5c1f9b,_0x2b1ed0){if(_0x5c1f9b[_0xa9a8('0x4f')]['id']){delete _0x5c1f9b[_0xa9a8('0x4f')]['id'];}return db[_0xa9a8('0x46')][_0xa9a8('0x4d')]({'where':{'id':_0x5c1f9b[_0xa9a8('0x4c')]['id']}})[_0xa9a8('0x2b')](handleEntityNotFound(_0x2b1ed0,null))['then'](saveUpdates(_0x5c1f9b[_0xa9a8('0x4f')],null))[_0xa9a8('0x2b')](respondWithResult(_0x2b1ed0,null))[_0xa9a8('0x4a')](handleError(_0x2b1ed0,null));};exports[_0xa9a8('0x2a')]=function(_0x20562a,_0x1869ab){return db['ChatTransferReport'][_0xa9a8('0x4d')]({'where':{'id':_0x20562a[_0xa9a8('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1869ab,null))[_0xa9a8('0x2b')](removeEntity(_0x1869ab,null))[_0xa9a8('0x4a')](handleError(_0x1869ab,null));};exports[_0xa9a8('0x50')]=function(_0x5696c5,_0xe26d6){return db[_0xa9a8('0x46')][_0xa9a8('0x50')]()[_0xa9a8('0x2b')](respondWithResult(_0xe26d6,null))['catch'](handleError(_0xe26d6,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index d88a51f..6540fa3 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 _0x6191=['moment','bluebird','path','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','../../config/logger','api'];(function(_0x20a26a,_0x4572ee){var _0x4250d2=function(_0x2e4840){while(--_0x2e4840){_0x20a26a['push'](_0x20a26a['shift']());}};_0x4250d2(++_0x4572ee);}(_0x6191,0x1de));var _0x1619=function(_0x4ef734,_0x5826d){_0x4ef734=_0x4ef734-0x0;var _0x33a7cb=_0x6191[_0x4ef734];return _0x33a7cb;};'use strict';var _=require(_0x1619('0x0'));var util=require('util');var logger=require(_0x1619('0x1'))(_0x1619('0x2'));var moment=require(_0x1619('0x3'));var BPromise=require(_0x1619('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1619('0x5'));var rimraf=require('rimraf');var config=require(_0x1619('0x6'));var attributes=require(_0x1619('0x7'));module[_0x1619('0x8')]=function(_0x54a2a6,_0x519c7c){return _0x54a2a6[_0x1619('0x9')](_0x1619('0xa'),attributes,{'tableName':_0x1619('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x1619('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x95a6=['path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x319f60,_0x4f36b0){var _0x1d4491=function(_0x3b5184){while(--_0x3b5184){_0x319f60['push'](_0x319f60['shift']());}};_0x1d4491(++_0x4f36b0);}(_0x95a6,0x17f));var _0x695a=function(_0x276038,_0x2ee922){_0x276038=_0x276038-0x0;var _0x26bb1b=_0x95a6[_0x276038];return _0x26bb1b;};'use strict';var _=require(_0x695a('0x0'));var util=require(_0x695a('0x1'));var logger=require(_0x695a('0x2'))(_0x695a('0x3'));var moment=require(_0x695a('0x4'));var BPromise=require(_0x695a('0x5'));var rp=require(_0x695a('0x6'));var fs=require('fs');var path=require(_0x695a('0x7'));var rimraf=require(_0x695a('0x8'));var config=require(_0x695a('0x9'));var attributes=require(_0x695a('0xa'));module[_0x695a('0xb')]=function(_0xe3b3c1,_0x2bcd39){return _0xe3b3c1['define'](_0x695a('0xc'),attributes,{'tableName':_0x695a('0xd'),'paranoid':![],'indexes':[{'name':_0x695a('0xe'),'fields':[_0x695a('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 1aef82a..6d40f01 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 _0xd93c=['rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x155dca,_0x5f579e){var _0xbd3ff4=function(_0xed83d6){while(--_0xed83d6){_0x155dca['push'](_0x155dca['shift']());}};_0xbd3ff4(++_0x5f579e);}(_0xd93c,0x1ba));var _0xcd93=function(_0x31473f,_0x1d4b37){_0x31473f=_0x31473f-0x0;var _0x4b457e=_0xd93c[_0x31473f];return _0x4b457e;};'use strict';var _=require('lodash');var util=require(_0xcd93('0x0'));var moment=require(_0xcd93('0x1'));var BPromise=require(_0xcd93('0x2'));var rs=require(_0xcd93('0x3'));var fs=require('fs');var Redis=require(_0xcd93('0x4'));var db=require(_0xcd93('0x5'))['db'];var utils=require(_0xcd93('0x6'));var logger=require(_0xcd93('0x7'))(_0xcd93('0x8'));var config=require(_0xcd93('0x9'));var jayson=require(_0xcd93('0xa'));var client=jayson[_0xcd93('0xb')][_0xcd93('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1aed33,_0x5a63fc,_0x37b3e9){return new BPromise(function(_0x4840ff,_0x5cc4a7){return client[_0xcd93('0xd')](_0x1aed33,_0x37b3e9)[_0xcd93('0xe')](function(_0x26ba83){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x5a63fc,_0xcd93('0xf'));logger[_0xcd93('0x10')](_0xcd93('0x11'),_0x5a63fc,_0xcd93('0xf'),JSON[_0xcd93('0x12')](_0x26ba83));if(_0x26ba83[_0xcd93('0x13')]){if(_0x26ba83[_0xcd93('0x13')][_0xcd93('0x14')]===0x1f4){logger[_0xcd93('0x13')](_0xcd93('0x15'),_0x5a63fc,_0x26ba83[_0xcd93('0x13')][_0xcd93('0x16')]);return _0x5cc4a7(_0x26ba83[_0xcd93('0x13')]['message']);}logger[_0xcd93('0x13')](_0xcd93('0x15'),_0x5a63fc,_0x26ba83[_0xcd93('0x13')][_0xcd93('0x16')]);return _0x4840ff(_0x26ba83['error'][_0xcd93('0x16')]);}else{logger['info'](_0xcd93('0x15'),_0x5a63fc,_0xcd93('0xf'));_0x4840ff(_0x26ba83[_0xcd93('0x17')][_0xcd93('0x16')]);}})[_0xcd93('0x18')](function(_0xf4716c){logger[_0xcd93('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0x5a63fc,_0xf4716c);_0x5cc4a7(_0xf4716c);});});} \ No newline at end of file +var _0xabbd=['request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x35f8b6,_0x2f3d87){var _0x1034e0=function(_0x248847){while(--_0x248847){_0x35f8b6['push'](_0x35f8b6['shift']());}};_0x1034e0(++_0x2f3d87);}(_0xabbd,0x1d8));var _0xdabb=function(_0x51ef69,_0x56f50c){_0x51ef69=_0x51ef69-0x0;var _0x15f331=_0xabbd[_0x51ef69];return _0x15f331;};'use strict';var _=require(_0xdabb('0x0'));var util=require(_0xdabb('0x1'));var moment=require(_0xdabb('0x2'));var BPromise=require(_0xdabb('0x3'));var rs=require(_0xdabb('0x4'));var fs=require('fs');var Redis=require(_0xdabb('0x5'));var db=require(_0xdabb('0x6'))['db'];var utils=require(_0xdabb('0x7'));var logger=require(_0xdabb('0x8'))(_0xdabb('0x9'));var config=require(_0xdabb('0xa'));var jayson=require(_0xdabb('0xb'));var client=jayson[_0xdabb('0xc')][_0xdabb('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xb96620,_0xf0aa4b,_0x5c1915){return new BPromise(function(_0xb0cef2,_0x30cfa0){return client[_0xdabb('0xe')](_0xb96620,_0x5c1915)[_0xdabb('0xf')](function(_0x9311e6){logger[_0xdabb('0x10')](_0xdabb('0x11'),_0xf0aa4b,_0xdabb('0x12'));logger[_0xdabb('0x13')](_0xdabb('0x14'),_0xf0aa4b,'request\x20sent',JSON[_0xdabb('0x15')](_0x9311e6));if(_0x9311e6[_0xdabb('0x16')]){if(_0x9311e6[_0xdabb('0x16')][_0xdabb('0x17')]===0x1f4){logger[_0xdabb('0x16')](_0xdabb('0x11'),_0xf0aa4b,_0x9311e6['error'][_0xdabb('0x18')]);return _0x30cfa0(_0x9311e6[_0xdabb('0x16')]['message']);}logger['error'](_0xdabb('0x11'),_0xf0aa4b,_0x9311e6[_0xdabb('0x16')][_0xdabb('0x18')]);return _0xb0cef2(_0x9311e6[_0xdabb('0x16')]['message']);}else{logger['info'](_0xdabb('0x11'),_0xf0aa4b,_0xdabb('0x12'));_0xb0cef2(_0x9311e6[_0xdabb('0x19')][_0xdabb('0x18')]);}})[_0xdabb('0x1a')](function(_0x57f328){logger['error'](_0xdabb('0x11'),_0xf0aa4b,_0x57f328);_0x30cfa0(_0x57f328);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index d6a2bb3..04c5d37 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 _0x14d5=['destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','put','delete'];(function(_0x502485,_0x1ebecd){var _0x137925=function(_0xe6a1af){while(--_0xe6a1af){_0x502485['push'](_0x502485['shift']());}};_0x137925(++_0x1ebecd);}(_0x14d5,0xf8));var _0x514d=function(_0x2813fa,_0x3211d4){_0x2813fa=_0x2813fa-0x0;var _0x8a2acb=_0x14d5[_0x2813fa];return _0x8a2acb;};'use strict';var multer=require('multer');var util=require(_0x514d('0x0'));var path=require(_0x514d('0x1'));var timeout=require(_0x514d('0x2'));var express=require(_0x514d('0x3'));var router=express[_0x514d('0x4')]();var fs_extra=require(_0x514d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x514d('0x6'));var config=require(_0x514d('0x7'));var controller=require(_0x514d('0x8'));router[_0x514d('0x9')]('/',auth['isAuthenticated'](),controller[_0x514d('0xa')]);router['get'](_0x514d('0xb'),auth[_0x514d('0xc')](),controller[_0x514d('0xd')]);router[_0x514d('0x9')](_0x514d('0xe'),auth['isAuthenticated'](),controller[_0x514d('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x514d('0x10')](_0x514d('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x514d('0x11')](_0x514d('0xe'),auth[_0x514d('0xc')](),controller[_0x514d('0x12')]);module['exports']=router; \ No newline at end of file +var _0x41c1=['fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x1d3471,_0x57a634){var _0x448b30=function(_0x411907){while(--_0x411907){_0x1d3471['push'](_0x1d3471['shift']());}};_0x448b30(++_0x57a634);}(_0x41c1,0x1dd));var _0x141c=function(_0x469393,_0x247969){_0x469393=_0x469393-0x0;var _0x5f720d=_0x41c1[_0x469393];return _0x5f720d;};'use strict';var multer=require(_0x141c('0x0'));var util=require(_0x141c('0x1'));var path=require(_0x141c('0x2'));var timeout=require(_0x141c('0x3'));var express=require(_0x141c('0x4'));var router=express[_0x141c('0x5')]();var fs_extra=require(_0x141c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x141c('0x7'));var config=require(_0x141c('0x8'));var controller=require('./chatTransferReport.controller');router['get']('/',auth[_0x141c('0x9')](),controller[_0x141c('0xa')]);router[_0x141c('0xb')](_0x141c('0xc'),auth[_0x141c('0x9')](),controller['describe']);router[_0x141c('0xb')](_0x141c('0xd'),auth[_0x141c('0x9')](),controller['show']);router[_0x141c('0xe')]('/',auth[_0x141c('0x9')](),controller[_0x141c('0xf')]);router[_0x141c('0x10')](_0x141c('0xd'),auth['isAuthenticated'](),controller[_0x141c('0x11')]);router[_0x141c('0x12')](_0x141c('0xd'),auth[_0x141c('0x9')](),controller[_0x141c('0x13')]);module[_0x141c('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 61b9e77..6e9b0f7 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 _0xbec5=['getDataValue','onlineForm','parse','Comments','offlineForm','setDataValue','generate','New\x20offline\x20message\x20from\x20websiteName','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','ENUM','squared','rounded','Chat','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Skip','star','thumb','stringify','name','text','input'];(function(_0x4cf378,_0x3140ed){var _0x4862e5=function(_0x2ed017){while(--_0x2ed017){_0x4cf378['push'](_0x4cf378['shift']());}};_0x4862e5(++_0x3140ed);}(_0xbec5,0xe5));var _0x5bec=function(_0x50f0a9,_0x2b0c57){_0x50f0a9=_0x50f0a9-0x0;var _0x5a33d9=_0xbec5[_0x50f0a9];return _0x5a33d9;};'use strict';var Sequelize=require(_0x5bec('0x0'));var rs=require(_0x5bec('0x1'));module['exports']={'name':{'type':Sequelize[_0x5bec('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x5bec('0x2')],'allowNull':![],'unique':_0x5bec('0x3')},'description':{'type':Sequelize[_0x5bec('0x2')]},'mapKey':{'type':Sequelize[_0x5bec('0x2')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x5bec('0x2')],'defaultValue':_0x5bec('0x4')},'key':{'type':Sequelize[_0x5bec('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x5bec('0x5')},'customerAlias':{'type':Sequelize[_0x5bec('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x5bec('0x2')],'allowNull':![],'defaultValue':_0x5bec('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x5bec('0x2')],'allowNull':![],'defaultValue':_0x5bec('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x5bec('0x2')],'allowNull':![],'defaultValue':_0x5bec('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5bec('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x5bec('0x2')]},'animation':{'type':Sequelize[_0x5bec('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x5bec('0x9')]('rounded',_0x5bec('0xa')),'defaultValue':_0x5bec('0xb')},'header_online':{'type':Sequelize[_0x5bec('0x2')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x5bec('0x2')],'defaultValue':_0x5bec('0xc')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x5bec('0xd')},'header_offline':{'type':Sequelize[_0x5bec('0x2')],'defaultValue':_0x5bec('0xe')},'download_transcript':{'type':Sequelize[_0x5bec('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x5bec('0xf')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x5bec('0x2')],'defaultValue':_0x5bec('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x5bec('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x5bec('0x11')]},'closingQuestion':{'type':Sequelize[_0x5bec('0x2')],'defaultValue':_0x5bec('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0x5bec('0x2')],'defaultValue':_0x5bec('0x13')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x5bec('0x2')],'defaultValue':_0x5bec('0x14')},'placeholderMessage':{'type':Sequelize[_0x5bec('0x2')],'defaultValue':_0x5bec('0x15')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x5bec('0x2')],'defaultValue':_0x5bec('0xd')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x5bec('0x16')},'conditionAgreement':{'type':Sequelize[_0x5bec('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x5bec('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x5bec('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x5bec('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x5bec('0x9')](_0x5bec('0x17'),_0x5bec('0x18')),'defaultValue':_0x5bec('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x5bec('0xf')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x5bec('0x19')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x5bec('0x1a'),'type':_0x5bec('0x1b'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x5bec('0x1c'),'props':{'title':_0x5bec('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x5bec('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x5bec('0x1d')](_0x5bec('0x1e'))?JSON[_0x5bec('0x1f')](this[_0x5bec('0x1d')](_0x5bec('0x1e'))):{};},'set':function(_0x2dc014){return this['setDataValue']('onlineForm',JSON['stringify'](_0x2dc014));}},'offlineForm':{'type':Sequelize[_0x5bec('0x11')],'defaultValue':function(){return JSON[_0x5bec('0x19')]({'items':[{'type':_0x5bec('0x1c'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x5bec('0x4'),'type':_0x5bec('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':_0x5bec('0x20')},'props':{'title':_0x5bec('0x20'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x5bec('0x21'))?JSON[_0x5bec('0x1f')](this[_0x5bec('0x1d')](_0x5bec('0x21'))):{};},'set':function(_0x12862c){return this[_0x5bec('0x22')]('offlineForm',JSON[_0x5bec('0x19')](_0x12862c));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x5bec('0x23')]();}},'autoclose':{'type':Sequelize[_0x5bec('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x5bec('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x5bec('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x5bec('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x5bec('0x2')]},'waitingTitle':{'type':Sequelize[_0x5bec('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x5bec('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x5bec('0x2')],'defaultValue':_0x5bec('0x24')},'offlineMessageBody':{'type':Sequelize[_0x5bec('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x5bec('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x5bec('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x5bec('0x2')],'defaultValue':_0x5bec('0x16')},'sendUnmanaged':{'type':Sequelize[_0x5bec('0x2')],'defaultValue':_0x5bec('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x5bec('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x5bec('0x11')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x5bec('0x2')]},'notificationTemplate':{'type':Sequelize[_0x5bec('0x11')],'defaultValue':function(){return _0x5bec('0x25');}},'notificationSound':{'type':Sequelize[_0x5bec('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5bec('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x5bec('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x5bec('0x26')},'waitForTheAssignedAgent':{'type':Sequelize[_0x5bec('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x5bec('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x5bec('0xf')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x5bec('0x2')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x5bec('0x2')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x5bec('0x2')]},'customerAvatar':{'type':Sequelize[_0x5bec('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0x5bec('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x5bec('0x2')],'allowNull':![],'defaultValue':_0x5bec('0x27'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x5bec('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5bec('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5bec('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5bec('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x5bec('0x2')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x5bec('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5bec('0xf')],'comment':_0x5bec('0x28')},'mandatoryDisposition':{'type':Sequelize[_0x5bec('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x27863b){if(!_0x27863b)this[_0x5bec('0x22')](_0x5bec('0x29'),null);this['setDataValue']('mandatoryDisposition',_0x27863b);}},'vidaooEscalation':{'type':Sequelize[_0x5bec('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x5bec('0x2')]},'vidaooTopic':{'type':Sequelize[_0x5bec('0x2')],'allowNull':![],'defaultValue':_0x5bec('0x2a')},'vidaooNote':{'type':Sequelize[_0x5bec('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x5bec('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xa75b=['ENUM','rounded','squared','We\x20are\x20here!','Chat','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','Feedback','star','TEXT','stringify','input','text','name','onlineForm','parse','getDataValue','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','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.','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','STRING','address','email','Agent','#011F6A','INTEGER','BOOLEAN'];(function(_0x541260,_0x4c7f2e){var _0x1dd2b5=function(_0x4140de){while(--_0x4140de){_0x541260['push'](_0x541260['shift']());}};_0x1dd2b5(++_0x4c7f2e);}(_0xa75b,0x170));var _0xba75=function(_0x14a083,_0x784bc7){_0x14a083=_0x14a083-0x0;var _0x533d22=_0xa75b[_0x14a083];return _0x533d22;};'use strict';var Sequelize=require(_0xba75('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0xba75('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0xba75('0x1')],'allowNull':![],'unique':_0xba75('0x2')},'description':{'type':Sequelize[_0xba75('0x1')]},'mapKey':{'type':Sequelize[_0xba75('0x1')],'defaultValue':_0xba75('0x3')},'mapKeyOffline':{'type':Sequelize[_0xba75('0x1')],'defaultValue':_0xba75('0x3')},'key':{'type':Sequelize[_0xba75('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xba75('0x1')],'defaultValue':_0xba75('0x4')},'customerAlias':{'type':Sequelize[_0xba75('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xba75('0x1')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xba75('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xba75('0x1')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xba75('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xba75('0x1')]},'animation':{'type':Sequelize[_0xba75('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xba75('0x8')](_0xba75('0x9'),_0xba75('0xa')),'defaultValue':_0xba75('0x9')},'header_online':{'type':Sequelize[_0xba75('0x1')],'defaultValue':_0xba75('0xb')},'start_chat_button':{'type':Sequelize[_0xba75('0x1')],'defaultValue':_0xba75('0xc')},'offline_chat_button':{'type':Sequelize[_0xba75('0x1')],'defaultValue':'Send'},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xba75('0xd')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xba75('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xba75('0x1')],'defaultValue':_0xba75('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0xba75('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xba75('0x1')],'defaultValue':_0xba75('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0xba75('0x1')],'defaultValue':_0xba75('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0xba75('0x1')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xba75('0x1')],'defaultValue':_0xba75('0x11')},'placeholderMessage':{'type':Sequelize[_0xba75('0x1')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xba75('0x1')],'defaultValue':_0xba75('0x12')},'closingMessageButton':{'type':Sequelize[_0xba75('0x1')],'defaultValue':_0xba75('0x13')},'skipMessageButton':{'type':Sequelize[_0xba75('0x1')],'defaultValue':_0xba75('0x14')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xba75('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xba75('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0xba75('0x15')},'ratingType':{'type':Sequelize[_0xba75('0x8')]('star','thumb'),'defaultValue':_0xba75('0x16')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xba75('0x17')],'defaultValue':function(){return JSON[_0xba75('0x18')]({'items':[{'type':_0xba75('0x19'),'variable':null,'config':{'placeholder':'name','type':_0xba75('0x1a'),'required':!![]},'props':{'title':_0xba75('0x1b'),'helpText':''}},{'type':_0xba75('0x19'),'props':{'title':_0xba75('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xba75('0x3'),'type':_0xba75('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xba75('0x1c'))?JSON[_0xba75('0x1d')](this[_0xba75('0x1e')](_0xba75('0x1c'))):{};},'set':function(_0x1caa6){return this[_0xba75('0x1f')](_0xba75('0x1c'),JSON[_0xba75('0x18')](_0x1caa6));}},'offlineForm':{'type':Sequelize[_0xba75('0x17')],'defaultValue':function(){return JSON[_0xba75('0x18')]({'items':[{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xba75('0x3')},'variable':null},{'type':'textarea','config':{'placeholder':_0xba75('0x20')},'props':{'title':'Comments','helpText':_0xba75('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0xba75('0x1e')](_0xba75('0x22'))?JSON['parse'](this[_0xba75('0x1e')](_0xba75('0x22'))):{};},'set':function(_0x8a2e4d){return this[_0xba75('0x1f')]('offlineForm',JSON['stringify'](_0x8a2e4d));}},'token':{'type':Sequelize[_0xba75('0x1')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xba75('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xba75('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xba75('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xba75('0x1')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xba75('0x1')]},'waitingTitle':{'type':Sequelize[_0xba75('0x1')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xba75('0x1')],'defaultValue':_0xba75('0x23')},'offlineMessageSubject':{'type':Sequelize[_0xba75('0x1')],'defaultValue':_0xba75('0x24')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xba75('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0xba75('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xba75('0x26')},'skipUnmanaged':{'type':Sequelize[_0xba75('0x1')],'defaultValue':_0xba75('0x14')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xba75('0x13')},'enableCustomerAttachment':{'type':Sequelize[_0xba75('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xba75('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xba75('0x17')]},'showAgentAvatar':{'type':Sequelize[_0xba75('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xba75('0x1')]},'notificationTemplate':{'type':Sequelize[_0xba75('0x17')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xba75('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xba75('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xba75('0x1')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xba75('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xba75('0x1')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xba75('0x1')],'defaultValue':_0xba75('0x27')},'messagesAlignment':{'type':Sequelize[_0xba75('0x1')],'defaultValue':_0xba75('0x28')},'defaultTitle':{'type':Sequelize[_0xba75('0x1')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xba75('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xba75('0x1')],'allowNull':![],'defaultValue':_0xba75('0x29'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xba75('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xba75('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xba75('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xba75('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xba75('0x2a')},'systemAvatar':{'type':Sequelize[_0xba75('0x17')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xba75('0x2b')},'mandatoryDisposition':{'type':Sequelize[_0xba75('0x7')],'defaultValue':![],'comment':_0xba75('0x2c'),'set':function(_0x45d8cd){if(!_0x45d8cd)this[_0xba75('0x1f')](_0xba75('0x2d'),null);this[_0xba75('0x1f')]('mandatoryDisposition',_0x45d8cd);}},'vidaooEscalation':{'type':Sequelize[_0xba75('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0xba75('0x1')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0xba75('0x1')],'defaultValue':function(){return _0xba75('0x2e');}},'vidaooMetadata':{'type':Sequelize[_0xba75('0x17')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xba75('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xba75('0x17')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index bf70956..f8e138f 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 _0xfa01=['fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','removeAgents','getAgents','bluebird','mustache','util','path','ejs','fs-extra','lodash','querystring','ioredis','../../config/logger','api','../../config/environment','redis','localhost','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','destroy','get','ChatWebsites','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','filter','where','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','update','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','nolimit','rows','removeDispositions','addAnswer','getAnswers','CannedAnswer','removeAnswers','ids','sitepic','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','join','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','setUA','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','difference','updatedAt','createdAt','CompanyId','ListId','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','List','Contacts','DESC','ChatApplication','Applications','account','list','applications','orderBy','asc','defaults','contact','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','%s\x20%s','unknown','format','device','type','threadId','ChatInteraction','externalUrl','interaction','spread','messageId','created','autoclose','unmanaged','*,*,*,*','ChatMessage','AttachmentId','User','UserId','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','files','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','CmList','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','mimetype','server','attachments','offline-chat','openNewInteraction','sequelize','transaction','Attachment','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','originalname','subjectOffline','toPairsIn','mapValues','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','pick','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','License','increment','chatLicenseExceeded','push','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','virtual','replace','labelText','textColor','textButtonColor','backgroundColor','hideWhenOffline','addApplications','Transaction','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','getFields','false','offlineForm','onlineForm','items'];(function(_0x5a2446,_0x1c4c47){var _0x4f4730=function(_0x10604b){while(--_0x10604b){_0x5a2446['push'](_0x5a2446['shift']());}};_0x4f4730(++_0x1c4c47);}(_0xfa01,0x130));var _0x1fa0=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xfa01[_0xa464c9];return _0x3d73c4;};'use strict';var BPromise=require(_0x1fa0('0x0'));var Mustache=require(_0x1fa0('0x1'));var util=require(_0x1fa0('0x2'));var path=require(_0x1fa0('0x3'));var ejs=require(_0x1fa0('0x4'));var fs=require('fs');var fs_extra=require(_0x1fa0('0x5'));var _=require(_0x1fa0('0x6'));var querystring=require(_0x1fa0('0x7'));var Redis=require(_0x1fa0('0x8'));var qs=require('../../components/parsers/qs');var logger=require(_0x1fa0('0x9'))(_0x1fa0('0xa'));var config=require(_0x1fa0('0xb'));var db=require('../../mysqldb')['db'];config[_0x1fa0('0xc')]=_['defaults'](config[_0x1fa0('0xc')],{'host':_0x1fa0('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1fa0('0xc')]));require(_0x1fa0('0xe'))[_0x1fa0('0xf')](socket);var htmlToText=require(_0x1fa0('0x10'));var jayson=require(_0x1fa0('0x11'));var client=jayson[_0x1fa0('0x12')]['http']({'port':0x232c});var client9002=jayson[_0x1fa0('0x12')][_0x1fa0('0x13')]({'port':0x232a});var client9003=jayson['client'][_0x1fa0('0x13')]({'port':0x232b});var client9001=jayson[_0x1fa0('0x12')][_0x1fa0('0x13')]({'port':0x2329});function respondWithRpcPromise(_0x459119,_0x70e1f8,_0x1eede1,_0x363080){return new BPromise(function(_0x9923fb,_0x4ab4b6){var _0x5478fa=_0x363080||client;return _0x5478fa[_0x1fa0('0x14')](_0x459119,_0x1eede1)[_0x1fa0('0x15')](function(_0x37f55d){logger[_0x1fa0('0x16')](_0x1fa0('0x17'),_0x70e1f8,_0x1fa0('0x18'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x70e1f8,_0x1fa0('0x18'),JSON[_0x1fa0('0x19')](_0x37f55d));if(_0x37f55d[_0x1fa0('0x1a')]){if(_0x37f55d['error'][_0x1fa0('0x1b')]===0x1f4){logger[_0x1fa0('0x1a')](_0x1fa0('0x17'),_0x70e1f8,_0x37f55d['error'][_0x1fa0('0x1c')]);return _0x4ab4b6(_0x37f55d[_0x1fa0('0x1a')][_0x1fa0('0x1c')]);}logger[_0x1fa0('0x1a')](_0x1fa0('0x17'),_0x70e1f8,_0x37f55d[_0x1fa0('0x1a')][_0x1fa0('0x1c')]);return _0x9923fb(_0x37f55d['error'][_0x1fa0('0x1c')]);}else{logger[_0x1fa0('0x16')](_0x1fa0('0x17'),_0x70e1f8,_0x1fa0('0x18'));_0x9923fb(_0x37f55d['result'][_0x1fa0('0x1c')]);}})['catch'](function(_0x388411){logger['error'](_0x1fa0('0x17'),_0x70e1f8,_0x388411);_0x4ab4b6(_0x388411);});});}function respondWithStatusCode(_0x14a299,_0x51f457){_0x51f457=_0x51f457||0xcc;return function(_0x1f727a){if(_0x1f727a){return _0x14a299[_0x1fa0('0x1d')](_0x51f457);}return _0x14a299[_0x1fa0('0x1e')](_0x51f457)[_0x1fa0('0x1f')]();};}function respondWithResult(_0x6c0b1d,_0x282a5f){_0x282a5f=_0x282a5f||0xc8;return function(_0x4fddbd){if(_0x4fddbd){return _0x6c0b1d[_0x1fa0('0x1e')](_0x282a5f)[_0x1fa0('0x20')](_0x4fddbd);}};}function respondWithFilteredResult(_0x3e4fa1,_0x15f178){return function(_0x1f6857){if(_0x1f6857){var _0x1ee307=typeof _0x15f178['offset']===_0x1fa0('0x21')&&typeof _0x15f178[_0x1fa0('0x22')]===_0x1fa0('0x21');var _0x1f883e=_0x1f6857[_0x1fa0('0x23')];var _0x46a7d2=_0x1ee307?0x0:_0x15f178['offset'];var _0x5cc0ae=_0x1ee307?_0x1f6857[_0x1fa0('0x23')]:_0x15f178[_0x1fa0('0x24')]+_0x15f178[_0x1fa0('0x22')];var _0x59aae2;if(_0x5cc0ae>=_0x1f883e){_0x5cc0ae=_0x1f883e;_0x59aae2=0xc8;}else{_0x59aae2=0xce;}_0x3e4fa1[_0x1fa0('0x1e')](_0x59aae2);return _0x3e4fa1['set'](_0x1fa0('0x25'),_0x46a7d2+'-'+_0x5cc0ae+'/'+_0x1f883e)['json'](_0x1f6857);}return null;};}function saveUpdates(_0x29d4fa){return function(_0x3dc239){if(_0x3dc239){return _0x3dc239['update'](_0x29d4fa)[_0x1fa0('0x15')](function(_0x17293b){return _0x17293b;});}return null;};}function removeEntity(_0x37e200){return function(_0x1ff8d4){if(_0x1ff8d4){return _0x1ff8d4[_0x1fa0('0x26')]()[_0x1fa0('0x15')](function(){var _0x59dc78=_0x1ff8d4[_0x1fa0('0x27')]({'plain':!![]});var _0x2c1f84=_0x1fa0('0x28');return db['UserProfileResource'][_0x1fa0('0x26')]({'where':{'type':_0x2c1f84,'resourceId':_0x59dc78['id']}})[_0x1fa0('0x15')](function(){return _0x1ff8d4;});})[_0x1fa0('0x15')](function(){_0x37e200['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x527703){return function(_0x4c832f){if(!_0x4c832f){_0x527703['sendStatus'](0x194);}return _0x4c832f;};}function handleError(_0x2bb5f1,_0x48e804){_0x48e804=_0x48e804||0x1f4;return function(_0x374e7d){logger[_0x1fa0('0x1a')](_0x374e7d['stack']);if(_0x374e7d[_0x1fa0('0x29')]){delete _0x374e7d[_0x1fa0('0x29')];}_0x2bb5f1[_0x1fa0('0x1e')](_0x48e804)[_0x1fa0('0x2a')](_0x374e7d);};}exports[_0x1fa0('0x2b')]=function(_0x2976c5,_0x4fffe0){var _0x595885={'include':[{'model':db[_0x1fa0('0x2c')],'as':_0x1fa0('0x2d')}]},_0x1fc509={},_0x57d0ff={'count':0x0,'rows':[]};var _0x213a16=_[_0x1fa0('0x2e')](db[_0x1fa0('0x2f')]['rawAttributes'],function(_0x449f5e){return{'name':_0x449f5e[_0x1fa0('0x30')],'type':_0x449f5e['type'][_0x1fa0('0x31')]};});_0x1fc509[_0x1fa0('0x32')]=_[_0x1fa0('0x2e')](_0x213a16,'name');_0x1fc509['query']=_[_0x1fa0('0x33')](_0x2976c5[_0x1fa0('0x34')]);_0x1fc509[_0x1fa0('0x35')]=_[_0x1fa0('0x36')](_0x1fc509[_0x1fa0('0x32')],_0x1fc509[_0x1fa0('0x34')]);_0x595885['attributes']=_[_0x1fa0('0x36')](_0x1fc509['model'],qs[_0x1fa0('0x37')](_0x2976c5['query'][_0x1fa0('0x37')]));_0x595885[_0x1fa0('0x38')]=_0x595885['attributes'][_0x1fa0('0x39')]?_0x595885[_0x1fa0('0x38')]:_0x1fc509['model'];if(!_0x2976c5[_0x1fa0('0x34')][_0x1fa0('0x3a')]('nolimit')){_0x595885[_0x1fa0('0x22')]=qs[_0x1fa0('0x22')](_0x2976c5[_0x1fa0('0x34')][_0x1fa0('0x22')]);_0x595885[_0x1fa0('0x24')]=qs[_0x1fa0('0x24')](_0x2976c5[_0x1fa0('0x34')][_0x1fa0('0x24')]);}_0x595885[_0x1fa0('0x3b')]=qs[_0x1fa0('0x3c')](_0x2976c5[_0x1fa0('0x34')][_0x1fa0('0x3c')]);_0x595885['where']=qs[_0x1fa0('0x35')](_['pick'](_0x2976c5[_0x1fa0('0x34')],_0x1fc509[_0x1fa0('0x35')]),_0x213a16);if(_0x2976c5[_0x1fa0('0x34')][_0x1fa0('0x3d')]){_0x595885[_0x1fa0('0x3e')]=_['merge'](_0x595885['where'],{'$or':_[_0x1fa0('0x2e')](_0x213a16,function(_0x109189){if(_0x109189['type']!==_0x1fa0('0x3f')){var _0xf55eeb={};_0xf55eeb[_0x109189[_0x1fa0('0x29')]]={'$like':'%'+_0x2976c5[_0x1fa0('0x34')][_0x1fa0('0x3d')]+'%'};return _0xf55eeb;}})});}_0x595885=_['merge']({},_0x595885,_0x2976c5[_0x1fa0('0x40')]);var _0x41d689={'where':_0x595885[_0x1fa0('0x3e')]};return db['ChatWebsite'][_0x1fa0('0x23')](_0x41d689)['then'](function(_0x22d6d8){_0x57d0ff[_0x1fa0('0x23')]=_0x22d6d8;if(_0x2976c5['query'][_0x1fa0('0x41')]){_0x595885[_0x1fa0('0x42')]=[{'all':!![]}];}return db[_0x1fa0('0x2f')][_0x1fa0('0x43')](_0x595885);})[_0x1fa0('0x15')](function(_0x3ab56e){_0x57d0ff['rows']=_0x3ab56e;return _0x57d0ff;})[_0x1fa0('0x15')](respondWithFilteredResult(_0x4fffe0,_0x595885))[_0x1fa0('0x44')](handleError(_0x4fffe0,null));};exports[_0x1fa0('0x45')]=function(_0x35dcd4,_0x342ce3){var _0x121af8={'raw':![],'where':{'id':_0x35dcd4[_0x1fa0('0x46')]['id']},'include':[{'model':db['Pause'],'as':_0x1fa0('0x2d')}]},_0x4b3fc3={};_0x4b3fc3[_0x1fa0('0x32')]=_[_0x1fa0('0x33')](db[_0x1fa0('0x2f')][_0x1fa0('0x47')]);_0x4b3fc3[_0x1fa0('0x34')]=_[_0x1fa0('0x33')](_0x35dcd4['query']);_0x4b3fc3[_0x1fa0('0x35')]=_[_0x1fa0('0x36')](_0x4b3fc3['model'],_0x4b3fc3[_0x1fa0('0x34')]);_0x121af8[_0x1fa0('0x38')]=_['intersection'](_0x4b3fc3[_0x1fa0('0x32')],qs[_0x1fa0('0x37')](_0x35dcd4[_0x1fa0('0x34')][_0x1fa0('0x37')]));_0x121af8[_0x1fa0('0x38')]=_0x121af8[_0x1fa0('0x38')]['length']?_0x121af8[_0x1fa0('0x38')]:_0x4b3fc3[_0x1fa0('0x32')];if(_0x35dcd4[_0x1fa0('0x34')][_0x1fa0('0x41')]){_0x121af8[_0x1fa0('0x42')]=[{'all':!![]}];}_0x121af8=_[_0x1fa0('0x48')]({},_0x121af8,_0x35dcd4[_0x1fa0('0x40')]);return db[_0x1fa0('0x2f')][_0x1fa0('0x49')](_0x121af8)[_0x1fa0('0x15')](handleEntityNotFound(_0x342ce3,null))[_0x1fa0('0x15')](respondWithResult(_0x342ce3,null))[_0x1fa0('0x44')](handleError(_0x342ce3,null));};exports[_0x1fa0('0x4a')]=function(_0x459b5e,_0x18b61c){return db[_0x1fa0('0x2f')]['create'](_0x459b5e[_0x1fa0('0x4b')],{})[_0x1fa0('0x15')](function(_0x5acede){var _0x31508b=_0x459b5e[_0x1fa0('0x4c')][_0x1fa0('0x27')]({'plain':!![]});if(!_0x31508b)throw new Error(_0x1fa0('0x4d'));if(_0x31508b[_0x1fa0('0x4e')]===_0x1fa0('0x4c')){var _0x23a4ed=_0x5acede[_0x1fa0('0x27')]({'plain':!![]});var _0x20134a='ChatWebsites';return db[_0x1fa0('0x4f')][_0x1fa0('0x49')]({'where':{'name':_0x20134a,'userProfileId':_0x31508b[_0x1fa0('0x50')]},'raw':!![]})[_0x1fa0('0x15')](function(_0x5d2952){if(_0x5d2952&&_0x5d2952[_0x1fa0('0x51')]===0x0){return db[_0x1fa0('0x52')]['create']({'name':_0x23a4ed[_0x1fa0('0x29')],'resourceId':_0x23a4ed['id'],'type':_0x5d2952[_0x1fa0('0x29')],'sectionId':_0x5d2952['id']},{})[_0x1fa0('0x15')](function(){return _0x5acede;});}else{return _0x5acede;}})[_0x1fa0('0x44')](function(_0x41b211){logger[_0x1fa0('0x1a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x41b211);throw _0x41b211;});}return _0x5acede;})[_0x1fa0('0x15')](respondWithResult(_0x18b61c,0xc9))[_0x1fa0('0x44')](handleError(_0x18b61c,null));};exports[_0x1fa0('0x53')]=function(_0x399fe4,_0x3cc640){if(_0x399fe4['body']['id']){delete _0x399fe4[_0x1fa0('0x4b')]['id'];}return db['ChatWebsite'][_0x1fa0('0x49')]({'where':{'id':_0x399fe4[_0x1fa0('0x46')]['id']},'include':[{'model':db[_0x1fa0('0x2c')],'as':_0x1fa0('0x2d')}]})['then'](handleEntityNotFound(_0x3cc640,null))[_0x1fa0('0x15')](saveUpdates(_0x399fe4[_0x1fa0('0x4b')],null))['then'](respondWithResult(_0x3cc640,null))[_0x1fa0('0x44')](handleError(_0x3cc640,null));};exports['destroy']=function(_0x4d2aa2,_0x1645ce){return db[_0x1fa0('0x2f')][_0x1fa0('0x49')]({'where':{'id':_0x4d2aa2['params']['id']}})[_0x1fa0('0x15')](handleEntityNotFound(_0x1645ce,null))[_0x1fa0('0x15')](removeEntity(_0x1645ce,null))['catch'](handleError(_0x1645ce,null));};exports[_0x1fa0('0x54')]=function(_0x59c4cc,_0x2f4d42){return db[_0x1fa0('0x2f')]['describe']()[_0x1fa0('0x15')](respondWithResult(_0x2f4d42,null))[_0x1fa0('0x44')](handleError(_0x2f4d42,null));};exports[_0x1fa0('0x55')]=function(_0x2fcbb6,_0x46e4db){if(_0x2fcbb6[_0x1fa0('0x4b')]['id']){delete _0x2fcbb6['body']['id'];}return db[_0x1fa0('0x2f')][_0x1fa0('0x49')]({'where':{'id':_0x2fcbb6[_0x1fa0('0x46')]['id']}})[_0x1fa0('0x15')](handleEntityNotFound(_0x46e4db,null))[_0x1fa0('0x15')](function(_0x4871ba){if(_0x4871ba){_0x2fcbb6[_0x1fa0('0x4b')][_0x1fa0('0x56')]=_0x4871ba['id'];return db[_0x1fa0('0x57')][_0x1fa0('0x4a')](_0x2fcbb6['body']);}})['then'](respondWithResult(_0x46e4db,null))[_0x1fa0('0x44')](handleError(_0x46e4db,null));};exports[_0x1fa0('0x58')]=function(_0x5701bb,_0x4b54fe){var _0x51e4cb={'raw':![],'where':{}};var _0x3327ef={};var _0x23c030={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x1fa0('0x59')]({'where':{'id':_0x5701bb['params']['id']}})[_0x1fa0('0x15')](handleEntityNotFound(_0x4b54fe,null))[_0x1fa0('0x15')](function(_0x3e6a11){if(_0x3e6a11){_0x3327ef[_0x1fa0('0x32')]=_['keys'](db[_0x1fa0('0x57')][_0x1fa0('0x47')]);_0x3327ef[_0x1fa0('0x34')]=_['keys'](_0x5701bb['query']);_0x3327ef[_0x1fa0('0x35')]=_['intersection'](_0x3327ef['model'],_0x3327ef[_0x1fa0('0x34')]);_0x51e4cb[_0x1fa0('0x38')]=_[_0x1fa0('0x36')](_0x3327ef['model'],qs[_0x1fa0('0x37')](_0x5701bb[_0x1fa0('0x34')][_0x1fa0('0x37')]));_0x51e4cb[_0x1fa0('0x38')]=_0x51e4cb['attributes']['length']?_0x51e4cb[_0x1fa0('0x38')]:_0x3327ef[_0x1fa0('0x32')];if(!_0x5701bb['query'][_0x1fa0('0x3a')](_0x1fa0('0x5a'))){_0x51e4cb[_0x1fa0('0x22')]=qs[_0x1fa0('0x22')](_0x5701bb[_0x1fa0('0x34')][_0x1fa0('0x22')]);_0x51e4cb['offset']=qs[_0x1fa0('0x24')](_0x5701bb[_0x1fa0('0x34')][_0x1fa0('0x24')]);}_0x51e4cb['order']=qs[_0x1fa0('0x3c')](_0x5701bb[_0x1fa0('0x34')]['sort']);_0x51e4cb[_0x1fa0('0x3e')]=qs[_0x1fa0('0x35')](_['pick'](_0x5701bb[_0x1fa0('0x34')],_0x3327ef[_0x1fa0('0x35')]));_0x51e4cb[_0x1fa0('0x3e')]['ChatWebsiteId']=_0x3e6a11['id'];if(_0x5701bb[_0x1fa0('0x34')][_0x1fa0('0x3d')]){_0x51e4cb[_0x1fa0('0x3e')]=_[_0x1fa0('0x48')](_0x51e4cb['where'],{'$or':_[_0x1fa0('0x2e')](_0x51e4cb['attributes'],function(_0x1b1cfa){var _0x474577={};_0x474577[_0x1b1cfa]={'$like':'%'+_0x5701bb[_0x1fa0('0x34')][_0x1fa0('0x3d')]+'%'};return _0x474577;})});}_0x51e4cb=_[_0x1fa0('0x48')]({},_0x51e4cb,_0x5701bb[_0x1fa0('0x40')]);return db[_0x1fa0('0x57')]['count']({'where':_0x51e4cb['where']})[_0x1fa0('0x15')](function(_0x48149f){_0x23c030['count']=_0x48149f;if(_0x5701bb[_0x1fa0('0x34')][_0x1fa0('0x41')]){_0x51e4cb[_0x1fa0('0x42')]=[{'all':!![]}];}return db[_0x1fa0('0x57')][_0x1fa0('0x43')](_0x51e4cb);})['then'](function(_0x4910f7){_0x23c030[_0x1fa0('0x5b')]=_0x4910f7;return _0x23c030;});}})['then'](respondWithFilteredResult(_0x4b54fe,_0x51e4cb))['catch'](handleError(_0x4b54fe,null));};exports[_0x1fa0('0x5c')]=function(_0x198b2f,_0x1009fd){return db[_0x1fa0('0x2f')][_0x1fa0('0x49')]({'where':{'id':_0x198b2f[_0x1fa0('0x46')]['id']}})[_0x1fa0('0x15')](handleEntityNotFound(_0x1009fd,null))[_0x1fa0('0x15')](function(_0x3aaff9){if(_0x3aaff9){return _0x3aaff9[_0x1fa0('0x5c')](_0x198b2f[_0x1fa0('0x34')]['ids']);}})[_0x1fa0('0x15')](respondWithStatusCode(_0x1009fd,null))[_0x1fa0('0x44')](handleError(_0x1009fd,null));};exports[_0x1fa0('0x5d')]=function(_0xa18c8a,_0x1dc9ce){if(_0xa18c8a['body']['id']){delete _0xa18c8a[_0x1fa0('0x4b')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0xa18c8a[_0x1fa0('0x46')]['id']}})['then'](handleEntityNotFound(_0x1dc9ce,null))[_0x1fa0('0x15')](function(_0x2aa6e1){if(_0x2aa6e1){_0xa18c8a[_0x1fa0('0x4b')]['ChatWebsiteId']=_0x2aa6e1['id'];return db['CannedAnswer'][_0x1fa0('0x4a')](_0xa18c8a['body']);}})['then'](respondWithResult(_0x1dc9ce,null))['catch'](handleError(_0x1dc9ce,null));};exports[_0x1fa0('0x5e')]=function(_0x9d7915,_0x2a4e8f){var _0x3efaaf={'raw':![],'where':{}};var _0x410ea0={};var _0x39bc48={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x1fa0('0x59')]({'where':{'id':_0x9d7915[_0x1fa0('0x46')]['id']}})[_0x1fa0('0x15')](handleEntityNotFound(_0x2a4e8f,null))[_0x1fa0('0x15')](function(_0x45bbc3){if(_0x45bbc3){_0x410ea0[_0x1fa0('0x32')]=_['keys'](db[_0x1fa0('0x5f')][_0x1fa0('0x47')]);_0x410ea0[_0x1fa0('0x34')]=_['keys'](_0x9d7915['query']);_0x410ea0['filters']=_[_0x1fa0('0x36')](_0x410ea0[_0x1fa0('0x32')],_0x410ea0[_0x1fa0('0x34')]);_0x3efaaf[_0x1fa0('0x38')]=_[_0x1fa0('0x36')](_0x410ea0['model'],qs['fields'](_0x9d7915[_0x1fa0('0x34')][_0x1fa0('0x37')]));_0x3efaaf[_0x1fa0('0x38')]=_0x3efaaf[_0x1fa0('0x38')][_0x1fa0('0x39')]?_0x3efaaf['attributes']:_0x410ea0[_0x1fa0('0x32')];if(!_0x9d7915[_0x1fa0('0x34')][_0x1fa0('0x3a')](_0x1fa0('0x5a'))){_0x3efaaf['limit']=qs['limit'](_0x9d7915[_0x1fa0('0x34')][_0x1fa0('0x22')]);_0x3efaaf[_0x1fa0('0x24')]=qs[_0x1fa0('0x24')](_0x9d7915[_0x1fa0('0x34')][_0x1fa0('0x24')]);}_0x3efaaf[_0x1fa0('0x3b')]=qs[_0x1fa0('0x3c')](_0x9d7915[_0x1fa0('0x34')][_0x1fa0('0x3c')]);_0x3efaaf[_0x1fa0('0x3e')]=qs[_0x1fa0('0x35')](_['pick'](_0x9d7915[_0x1fa0('0x34')],_0x410ea0[_0x1fa0('0x35')]));_0x3efaaf[_0x1fa0('0x3e')][_0x1fa0('0x56')]=_0x45bbc3['id'];if(_0x9d7915[_0x1fa0('0x34')][_0x1fa0('0x3d')]){_0x3efaaf['where']=_[_0x1fa0('0x48')](_0x3efaaf[_0x1fa0('0x3e')],{'$or':_[_0x1fa0('0x2e')](_0x3efaaf[_0x1fa0('0x38')],function(_0xe539){var _0x19a346={};_0x19a346[_0xe539]={'$like':'%'+_0x9d7915['query'][_0x1fa0('0x3d')]+'%'};return _0x19a346;})});}_0x3efaaf=_[_0x1fa0('0x48')]({},_0x3efaaf,_0x9d7915[_0x1fa0('0x40')]);return db[_0x1fa0('0x5f')][_0x1fa0('0x23')]({'where':_0x3efaaf[_0x1fa0('0x3e')]})[_0x1fa0('0x15')](function(_0x5d613b){_0x39bc48[_0x1fa0('0x23')]=_0x5d613b;if(_0x9d7915[_0x1fa0('0x34')][_0x1fa0('0x41')]){_0x3efaaf[_0x1fa0('0x42')]=[{'all':!![]}];}return db[_0x1fa0('0x5f')][_0x1fa0('0x43')](_0x3efaaf);})[_0x1fa0('0x15')](function(_0x2779d8){_0x39bc48['rows']=_0x2779d8;return _0x39bc48;});}})[_0x1fa0('0x15')](respondWithFilteredResult(_0x2a4e8f,_0x3efaaf))[_0x1fa0('0x44')](handleError(_0x2a4e8f,null));};exports[_0x1fa0('0x60')]=function(_0x50043e,_0x4c3c54){return db[_0x1fa0('0x2f')][_0x1fa0('0x49')]({'where':{'id':_0x50043e['params']['id']}})[_0x1fa0('0x15')](handleEntityNotFound(_0x4c3c54,null))[_0x1fa0('0x15')](function(_0x4bb96e){if(_0x4bb96e){return _0x4bb96e[_0x1fa0('0x60')](_0x50043e[_0x1fa0('0x34')][_0x1fa0('0x61')]);}})[_0x1fa0('0x15')](respondWithStatusCode(_0x4c3c54,null))[_0x1fa0('0x44')](handleError(_0x4c3c54,null));};exports['addLogo']=function(_0x1c8b27,_0x47e1bf){_0x1c8b27[_0x1fa0('0x4b')][_0x1fa0('0x62')]=_0x1c8b27[_0x1fa0('0x63')][_0x1fa0('0x64')];return db['ChatWebsite']['find']({'where':{'id':_0x1c8b27[_0x1fa0('0x46')]['id']}})['then'](handleEntityNotFound(_0x47e1bf,null))[_0x1fa0('0x15')](saveUpdates(_0x1c8b27[_0x1fa0('0x4b')],null))[_0x1fa0('0x15')](respondWithResult(_0x47e1bf,null))[_0x1fa0('0x44')](handleError(_0x47e1bf,null));};exports['addAvatar']=function(_0x5d8635,_0xca100){_0x5d8635[_0x1fa0('0x4b')][_0x1fa0('0x65')]=_0x5d8635[_0x1fa0('0x63')]['filename'];return db['ChatWebsite']['find']({'where':{'id':_0x5d8635[_0x1fa0('0x46')]['id']}})[_0x1fa0('0x15')](handleEntityNotFound(_0xca100,null))[_0x1fa0('0x15')](saveUpdates(_0x5d8635[_0x1fa0('0x4b')],null))['then'](respondWithResult(_0xca100,null))[_0x1fa0('0x44')](handleError(_0xca100,null));};exports[_0x1fa0('0x66')]=function(_0x140f2c,_0x3bc070){_0x140f2c[_0x1fa0('0x4b')][_0x1fa0('0x67')]=_0x140f2c[_0x1fa0('0x63')][_0x1fa0('0x64')];return db['ChatWebsite'][_0x1fa0('0x49')]({'where':{'id':_0x140f2c['params']['id']}})[_0x1fa0('0x15')](handleEntityNotFound(_0x3bc070,null))[_0x1fa0('0x15')](saveUpdates(_0x140f2c[_0x1fa0('0x4b')],null))[_0x1fa0('0x15')](respondWithResult(_0x3bc070,null))[_0x1fa0('0x44')](handleError(_0x3bc070,null));};exports[_0x1fa0('0x68')]=function(_0x3454c1,_0x4d8ae0){_0x3454c1['body']['systemAvatar']=_0x3454c1[_0x1fa0('0x63')][_0x1fa0('0x64')];return db[_0x1fa0('0x2f')][_0x1fa0('0x49')]({'where':{'id':_0x3454c1[_0x1fa0('0x46')]['id']}})[_0x1fa0('0x15')](handleEntityNotFound(_0x4d8ae0,null))[_0x1fa0('0x15')](saveUpdates(_0x3454c1[_0x1fa0('0x4b')],null))[_0x1fa0('0x15')](respondWithResult(_0x4d8ae0,null))[_0x1fa0('0x44')](handleError(_0x4d8ae0,null));};exports[_0x1fa0('0x69')]=function(_0x27318a,_0x11a78e){var _0x25491f=path['join'](config['root'],_0x1fa0('0x6a'));var _0x21bfb6={'where':{'id':_0x27318a[_0x1fa0('0x46')]['id']},'attributes':['id',_0x1fa0('0x62')],'raw':!![]};var _0x5bb5f9=![];return require(_0x1fa0('0x6b'))[_0x1fa0('0x6c')]()['then'](function(_0x3a8e35){if(_0x3a8e35){_0x5bb5f9=_0x3a8e35[_0x1fa0('0x6d')];}})[_0x1fa0('0x15')](function(){return db['ChatWebsite'][_0x1fa0('0x49')](_0x21bfb6);})[_0x1fa0('0x15')](handleEntityNotFound(_0x11a78e,null))['then'](function(_0x27c2bf){if(_0x27c2bf){if(!_[_0x1fa0('0x6e')](_0x27c2bf['sitepic'])){if(fs[_0x1fa0('0x6f')](path[_0x1fa0('0x70')](config[_0x1fa0('0x71')],_0x1fa0('0x72'),_0x27c2bf[_0x1fa0('0x62')]))&&_0x5bb5f9){_0x25491f=path['join'](config[_0x1fa0('0x71')],'server/files/images/logos/',_0x27c2bf[_0x1fa0('0x62')]);}}return _0x11a78e[_0x1fa0('0x73')](_0x25491f);}})[_0x1fa0('0x44')](handleError(_0x11a78e,null));};exports[_0x1fa0('0x74')]=function(_0x5eefbd,_0x226a15){var _0x6699ae=path[_0x1fa0('0x70')](config[_0x1fa0('0x71')],'server/files/images/avatars/default_avatar.png');var _0x7b16df={'where':{'id':_0x5eefbd[_0x1fa0('0x46')]['id']},'attributes':['id',_0x1fa0('0x65')],'raw':!![]};return db[_0x1fa0('0x2f')][_0x1fa0('0x49')](_0x7b16df)[_0x1fa0('0x15')](handleEntityNotFound(_0x226a15,null))[_0x1fa0('0x15')](function(_0x3e83b8){if(_0x3e83b8){if(!_[_0x1fa0('0x6e')](_0x3e83b8[_0x1fa0('0x65')])){if(fs[_0x1fa0('0x6f')](path['join'](config[_0x1fa0('0x71')],_0x1fa0('0x75'),_0x3e83b8[_0x1fa0('0x65')]))){_0x6699ae=path[_0x1fa0('0x70')](config[_0x1fa0('0x71')],_0x1fa0('0x75'),_0x3e83b8[_0x1fa0('0x65')]);}}return _0x226a15[_0x1fa0('0x73')](_0x6699ae);}})[_0x1fa0('0x44')](handleError(_0x226a15,null));};exports[_0x1fa0('0x76')]=function(_0x25d204,_0x138c0e){var _0x1ff09d=path[_0x1fa0('0x70')](config[_0x1fa0('0x71')],_0x1fa0('0x77'));var _0x32e1b6={'where':{'id':_0x25d204[_0x1fa0('0x46')]['id']},'attributes':['id',_0x1fa0('0x67'),'showCustomerAvatar'],'raw':!![]};return db['ChatWebsite'][_0x1fa0('0x49')](_0x32e1b6)[_0x1fa0('0x15')](handleEntityNotFound(_0x138c0e,null))[_0x1fa0('0x15')](function(_0x37f25a){if(_0x37f25a){if(!_[_0x1fa0('0x6e')](_0x37f25a[_0x1fa0('0x67')])){if(fs[_0x1fa0('0x6f')](path[_0x1fa0('0x70')](config[_0x1fa0('0x71')],'server/files/images/avatars/',_0x37f25a['customerAvatar']))&&_0x37f25a['showCustomerAvatar']){_0x1ff09d=path[_0x1fa0('0x70')](config[_0x1fa0('0x71')],_0x1fa0('0x75'),_0x37f25a[_0x1fa0('0x67')]);}}return _0x138c0e['download'](_0x1ff09d);}})[_0x1fa0('0x44')](handleError(_0x138c0e,null));};exports[_0x1fa0('0x78')]=function(_0x361deb,_0x5073de){var _0x3ebfac=path[_0x1fa0('0x70')](config['root'],_0x1fa0('0x79'));var _0xd2b5d6={'where':{'id':_0x361deb[_0x1fa0('0x46')]['id']},'attributes':['id',_0x1fa0('0x7a')],'raw':!![]};return db[_0x1fa0('0x2f')][_0x1fa0('0x49')](_0xd2b5d6)['then'](handleEntityNotFound(_0x5073de,null))[_0x1fa0('0x15')](function(_0x1cafc7){if(_0x1cafc7){if(!_[_0x1fa0('0x6e')](_0x1cafc7['systemAvatar'])){if(fs[_0x1fa0('0x6f')](path[_0x1fa0('0x70')](config[_0x1fa0('0x71')],_0x1fa0('0x75'),_0x1cafc7['systemAvatar']))){_0x3ebfac=path['join'](config['root'],'server/files/images/avatars/',_0x1cafc7[_0x1fa0('0x7a')]);}}return _0x5073de[_0x1fa0('0x73')](_0x3ebfac);}})[_0x1fa0('0x44')](handleError(_0x5073de,null));};exports['notify']=function(_0x2979b1,_0x540d17){var _0x327d4e=require('user-agent-parser');var _0xa6a53=new _0x327d4e();var _0x575af2=_0xa6a53[_0x1fa0('0x7b')](_0x2979b1['headers'][_0x1fa0('0x7c')])[_0x1fa0('0x7d')]();var _0x23728a={'body':_0x2979b1[_0x1fa0('0x4b')],'channel':_0x1fa0('0x7e')};var _0x4f0078=[];var _0x4aed18=[];var _0x5b3613={};var _0x2c0100=![];return db[_0x1fa0('0x7f')][_0x1fa0('0x54')]()[_0x1fa0('0x15')](function(_0x5cdc56){if(!_0x5cdc56){throw new db[(_0x1fa0('0x80'))][(_0x1fa0('0x81'))]('no\x20available\x20attributes');}_0x4f0078=_[_0x1fa0('0x82')](_[_0x1fa0('0x33')](_0x5cdc56),['createdAt',_0x1fa0('0x83')]);_0x4aed18=_['difference'](_[_0x1fa0('0x33')](_0x5cdc56),[_0x1fa0('0x84'),'updatedAt',_0x1fa0('0x85'),_0x1fa0('0x86')]);if(_0x2979b1[_0x1fa0('0x4b')]['id']){delete _0x2979b1[_0x1fa0('0x4b')]['id'];}if(_[_0x1fa0('0x6e')](_0x2979b1[_0x1fa0('0x4b')][_0x1fa0('0x87')])){throw new db[(_0x1fa0('0x80'))][(_0x1fa0('0x81'))](_0x1fa0('0x88'));}if(_[_0x1fa0('0x6e')](_0x2979b1[_0x1fa0('0x4b')]['body'])||_0x2979b1['body'][_0x1fa0('0x4b')]===''){throw new db[(_0x1fa0('0x80'))]['ValidationError'](_0x1fa0('0x89'));}if(_[_0x1fa0('0x6e')](_0x2979b1[_0x1fa0('0x4b')][_0x1fa0('0x8a')])){throw new db[(_0x1fa0('0x80'))][(_0x1fa0('0x81'))](_0x1fa0('0x8b')+_0x4aed18);}if(!_[_0x1fa0('0x8c')](_0x4aed18,_0x2979b1[_0x1fa0('0x4b')][_0x1fa0('0x8a')])){throw new db[(_0x1fa0('0x80'))][(_0x1fa0('0x81'))](_0x1fa0('0x8d')+_0x4aed18);}_0x5b3613[_0x2979b1['body']['mapKey']]=_0x2979b1[_0x1fa0('0x4b')][_0x1fa0('0x87')];})['then'](function(){return db[_0x1fa0('0x2f')][_0x1fa0('0x49')]({'where':{'id':_0x2979b1[_0x1fa0('0x46')]['id']},'include':[{'model':db['CmList'],'as':_0x1fa0('0x8e'),'include':[{'model':db[_0x1fa0('0x7f')],'as':_0x1fa0('0x8f'),'where':_0x5b3613,'limit':0x1,'order':[[_0x1fa0('0x83'),_0x1fa0('0x90')]]}]},{'model':db[_0x1fa0('0x91')],'as':_0x1fa0('0x92')}]});})[_0x1fa0('0x15')](handleEntityNotFound(_0x540d17,null))[_0x1fa0('0x15')](function(_0x2091f2){if(_0x2091f2&&_0x2091f2[_0x1fa0('0x8e')]){_0x23728a[_0x1fa0('0x93')]=_0x2091f2;_0x23728a['applications']=_0x2091f2[_0x1fa0('0x92')];_0x23728a[_0x1fa0('0x94')]=_0x2091f2[_0x1fa0('0x8e')];_0x23728a[_0x1fa0('0x95')]=_[_0x1fa0('0x96')](_0x23728a[_0x1fa0('0x95')],['priority'],[_0x1fa0('0x97')]);if(_0x23728a[_0x1fa0('0x93')]['Applications']){delete _0x23728a[_0x1fa0('0x93')][_0x1fa0('0x92')];}if(_0x23728a['account']['List']&&_0x23728a[_0x1fa0('0x93')][_0x1fa0('0x8e')]['Contacts']['length']){return _0x23728a[_0x1fa0('0x93')]['List'][_0x1fa0('0x8f')][0x0];}var _0x421bb5=_[_0x1fa0('0x98')](_0x2979b1[_0x1fa0('0x4b')],{'firstName':_0x2979b1[_0x1fa0('0x4b')][_0x1fa0('0x87')],'ListId':_0x2091f2[_0x1fa0('0x86')]});_0x421bb5[_0x2979b1[_0x1fa0('0x4b')]['mapKey']]=_0x2979b1[_0x1fa0('0x4b')][_0x1fa0('0x87')];return db[_0x1fa0('0x7f')][_0x1fa0('0x4a')](_0x421bb5,{'fields':_0x4f0078,'raw':!![]});}})[_0x1fa0('0x15')](handleEntityNotFound(_0x540d17,null))['then'](function(_0x6a366a){_0x23728a[_0x1fa0('0x99')]=_0x6a366a;var _0x457554=_0x2979b1['body'][_0x1fa0('0x9a')];if(_0x2979b1[_0x1fa0('0x9b')]['cf-connecting-ip']){_0x457554=_0x2979b1['headers'][_0x1fa0('0x9c')];}else if(_0x2979b1[_0x1fa0('0x9b')][_0x1fa0('0x9d')]){_0x457554=_[_0x1fa0('0x9e')](_0x2979b1['headers'][_0x1fa0('0x9d')][_0x1fa0('0x9f')](','));}if(_0x6a366a){var _0x138389={'ContactId':_0x6a366a['id'],'ChatWebsiteId':_0x2979b1[_0x1fa0('0x46')]['id'],'from':(_0x6a366a[_0x1fa0('0xa0')]||'')+'\x20'+(_0x6a366a[_0x1fa0('0xa1')]||''),'customerIp':_0x457554,'customerPort':_0x2979b1[_0x1fa0('0x9b')][_0x1fa0('0xa2')]?_0x2979b1[_0x1fa0('0x9b')][_0x1fa0('0xa2')]:null,'referer':_0x2979b1['body'][_0x1fa0('0xa3')],'browserName':_0x575af2[_0x1fa0('0xa4')][_0x1fa0('0x29')]&&_0x575af2[_0x1fa0('0xa4')][_0x1fa0('0xa5')]?util['format'](_0x1fa0('0xa6'),_0x575af2[_0x1fa0('0xa4')][_0x1fa0('0x29')],_0x575af2[_0x1fa0('0xa4')][_0x1fa0('0xa5')]):_0x1fa0('0xa7'),'browserVersion':_0x575af2[_0x1fa0('0xa4')][_0x1fa0('0xa5')]||_0x1fa0('0xa7'),'osName':util[_0x1fa0('0xa8')](_0x1fa0('0xa6'),_0x575af2['os']['name'],_0x575af2['os'][_0x1fa0('0xa5')]),'osVersion':_0x575af2['os'][_0x1fa0('0xa5')],'deviceModel':_0x575af2[_0x1fa0('0xa9')]['model']&&_0x575af2[_0x1fa0('0xa9')]['vendor']?util['format']('%s\x20%s\x20%s',_0x575af2[_0x1fa0('0xa9')]['model'],_0x575af2[_0x1fa0('0xa9')]['vendor'],_0x575af2[_0x1fa0('0xa9')][_0x1fa0('0xaa')]):null,'deviceVendor':_0x575af2[_0x1fa0('0xa9')]['vendor'],'deviceType':_0x575af2[_0x1fa0('0xa9')][_0x1fa0('0xaa')],'formData':JSON[_0x1fa0('0x19')](_0x2979b1['body'])};var _0x35b9b7={'ChatWebsiteId':_0x2979b1[_0x1fa0('0x46')]['id'],'closed':![]};if(_0x2979b1[_0x1fa0('0x4b')][_0x1fa0('0xab')]){_0x35b9b7[_0x1fa0('0xab')]=_0x2979b1[_0x1fa0('0x4b')][_0x1fa0('0xab')];return db[_0x1fa0('0xac')]['find']({'where':_0x35b9b7})[_0x1fa0('0x15')](function(_0x4c7ea2){if(_0x4c7ea2){return[_0x4c7ea2,![]];}_0x138389[_0x1fa0('0xab')]=_0x2979b1['body'][_0x1fa0('0xab')];_0x138389['externalUrl']=_0x2979b1[_0x1fa0('0x4b')][_0x1fa0('0xad')];return db[_0x1fa0('0xac')][_0x1fa0('0x4a')](_0x138389)[_0x1fa0('0x15')](function(_0x3fac46){return[_0x3fac46,!![]];});});}_0x35b9b7['ContactId']=_0x6a366a['id'];if(_0x2979b1[_0x1fa0('0x4b')][_0x1fa0('0xae')]&&_0x2979b1[_0x1fa0('0x4b')][_0x1fa0('0xae')]['id']){_0x35b9b7['id']=_0x2979b1[_0x1fa0('0x4b')][_0x1fa0('0xae')]['id'];return db[_0x1fa0('0xac')][_0x1fa0('0x49')]({'where':_0x35b9b7})[_0x1fa0('0x15')](function(_0x518a87){if(_0x518a87){return[_0x518a87,![]];}return db[_0x1fa0('0xac')][_0x1fa0('0x4a')](_0x138389)[_0x1fa0('0x15')](function(_0x4dc328){return[_0x4dc328,!![]];});});}return db[_0x1fa0('0xac')][_0x1fa0('0x4a')](_0x138389)[_0x1fa0('0x15')](function(_0x297211){return[_0x297211,!![]];});}})[_0x1fa0('0xaf')](function(_0x56b4b9,_0x1852ea){if(_0x56b4b9){_0x2c0100=_0x1852ea;if(!_0x1852ea){var _0x39d27d={'from':(_0x23728a[_0x1fa0('0x99')]['firstName']||'')+'\x20'+(_0x23728a[_0x1fa0('0x99')]['lastName']||'')};if(_0x2979b1['body'][_0x1fa0('0xab')]&&_0x2979b1[_0x1fa0('0x4b')][_0x1fa0('0xb0')]&&_0x2979b1[_0x1fa0('0x4b')][_0x1fa0('0xab')]!=_0x2979b1[_0x1fa0('0x4b')][_0x1fa0('0xb0')]){_0x39d27d[_0x1fa0('0xab')]=_0x2979b1[_0x1fa0('0x4b')]['messageId'];}return _0x56b4b9[_0x1fa0('0x53')](_0x39d27d);}else{return _0x56b4b9;}}})[_0x1fa0('0x15')](function(_0x506d5c){_0x23728a[_0x1fa0('0xae')]=_0x506d5c[_0x1fa0('0x27')]({'plain':!![]});_0x23728a[_0x1fa0('0xae')][_0x1fa0('0xb1')]=_0x2c0100;if(_0x23728a['interaction'][_0x1fa0('0xb1')]){if(_0x23728a[_0x1fa0('0x93')][_0x1fa0('0xb2')]){_0x23728a[_0x1fa0('0x95')]['push']({'id':0x0,'priority':_0x23728a[_0x1fa0('0x95')]['length']+0x1,'app':'close','appdata':_0x1fa0('0xb3'),'interval':_0x1fa0('0xb4')});}}return db[_0x1fa0('0xb5')][_0x1fa0('0x4a')]({'body':_0x2979b1[_0x1fa0('0x4b')][_0x1fa0('0x4b')],'ChatWebsiteId':_0x2979b1['params']['id'],'ChatInteractionId':_0x506d5c['id'],'direction':'in','ContactId':_0x23728a[_0x1fa0('0x99')]['id'],'AttachmentId':_0x2979b1['body'][_0x1fa0('0xb6')]});})[_0x1fa0('0x15')](function(_0x96ad9b){_0x23728a[_0x1fa0('0x1c')]=_0x96ad9b;if(_0x23728a[_0x1fa0('0xae')]['UserId']){return db[_0x1fa0('0xb7')][_0x1fa0('0x49')]({'attributes':['id',_0x1fa0('0x29')],'where':{'id':_0x23728a['interaction'][_0x1fa0('0xb8')]}})['then'](function(_0x2e5baa){if(_0x2e5baa){_0x23728a['applications'][_0x1fa0('0xb9')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2e5baa[_0x1fa0('0x29')]+','+(_0x23728a[_0x1fa0('0x93')][_0x1fa0('0xba')]||0xa),'interval':_0x1fa0('0xb4')});_0x23728a[_0x1fa0('0xbb')]=!![];}return respondWithRpcPromise(_0x1fa0('0xbc'),_0x1fa0('0xbd'),_0x23728a);});}return respondWithRpcPromise(_0x1fa0('0xbc'),'startRouting',_0x23728a);})[_0x1fa0('0x15')](function(_0x5cdfc6){respondWithRpcPromise(_0x1fa0('0xbe'),'EventManager',{'event':_0x1fa0('0xbf'),'message':_0x5cdfc6},client9002);return _0x5cdfc6;})[_0x1fa0('0x15')](respondWithResult(_0x540d17,null))[_0x1fa0('0x44')](handleError(_0x540d17,null));};exports[_0x1fa0('0xc0')]=function(_0xe13cb1,_0x4636b7){var _0x42dd30,_0x35a92f,_0x25dcb3;var _0x3ee291=[];var _0x514cee={};var _0x396426=_0xe13cb1[_0x1fa0('0xc1')]||[];var _0xaf87ea=[];var _0x5bf49e;return db['CmContact'][_0x1fa0('0x54')]()['then'](function(_0x3c9910){if(!_0x3c9910){throw new db[(_0x1fa0('0x80'))]['ValidationError']('no\x20available\x20attributes');}_0x3ee291=_[_0x1fa0('0x82')](_[_0x1fa0('0x33')](_0x3c9910),[_0x1fa0('0x84'),'updatedAt',_0x1fa0('0x85'),_0x1fa0('0x86')]);if(_0xe13cb1[_0x1fa0('0x4b')]['id']){delete _0xe13cb1[_0x1fa0('0x4b')]['id'];}if(_['isNil'](_0xe13cb1['body'][_0x1fa0('0x87')])){throw _0x4636b7[_0x1fa0('0x1e')](0x1f4)[_0x1fa0('0x2a')](new db[(_0x1fa0('0x80'))][(_0x1fa0('0x81'))](_0x1fa0('0x88')));}if(_[_0x1fa0('0x6e')](_0xe13cb1[_0x1fa0('0x4b')][_0x1fa0('0x4b')])||_0xe13cb1[_0x1fa0('0x4b')]['body']===''){throw _0x4636b7[_0x1fa0('0x1e')](0x1f4)['send'](new db[(_0x1fa0('0x80'))]['ValidationError'](_0x1fa0('0x89')));}if(_[_0x1fa0('0x6e')](_0xe13cb1[_0x1fa0('0x4b')]['mapKeyOffline'])){throw _0x4636b7[_0x1fa0('0x1e')](0x1f4)['send'](new db[(_0x1fa0('0x80'))][(_0x1fa0('0x81'))](_0x1fa0('0xc2')+_0x3ee291));}if(!_[_0x1fa0('0x8c')](_0x3ee291,_0xe13cb1[_0x1fa0('0x4b')]['mapKeyOffline'])){throw _0x4636b7[_0x1fa0('0x1e')](0x1f4)[_0x1fa0('0x2a')](new db[(_0x1fa0('0x80'))][(_0x1fa0('0x81'))](_0x1fa0('0xc3')+_0x3ee291));}_0x514cee[_0xe13cb1['body'][_0x1fa0('0xc4')]]=_0xe13cb1[_0x1fa0('0x4b')][_0x1fa0('0x87')];})[_0x1fa0('0x15')](function(){return db[_0x1fa0('0x2f')][_0x1fa0('0x49')]({'where':{'id':_0xe13cb1[_0x1fa0('0x46')]['id']},'include':[{'model':db[_0x1fa0('0xc5')],'as':_0x1fa0('0x8e')},{'model':db[_0x1fa0('0xc6')],'as':_0x1fa0('0xc6')}]});})[_0x1fa0('0x15')](handleEntityNotFound(_0x4636b7,null))[_0x1fa0('0x15')](function(_0x482955){if(_0x482955&&_0x482955[_0x1fa0('0x8e')]){_0x35a92f=_0x482955;var _0x46e60a=_[_0x1fa0('0x98')](_0xe13cb1[_0x1fa0('0x4b')],{'firstName':_0xe13cb1['body'][_0x1fa0('0x87')],'phone':_0xe13cb1[_0x1fa0('0x4b')][_0x1fa0('0x87')],'ListId':_0x482955[_0x1fa0('0x86')]});_0x46e60a[_0xe13cb1[_0x1fa0('0x4b')][_0x1fa0('0xc4')]]=_0xe13cb1[_0x1fa0('0x4b')][_0x1fa0('0x87')];return db['CmContact'][_0x1fa0('0xc7')]({'where':_0x514cee,'defaults':_0x46e60a});}})[_0x1fa0('0xaf')](function(_0xce16a6){if(_0xce16a6){_0x25dcb3=_0xce16a6;var _0x10b1d6=fs['readFileSync'](path['join'](config[_0x1fa0('0x71')],_0x1fa0('0xc8')),'utf8');var _0x4d9c37=ejs[_0x1fa0('0xc9')](_0x10b1d6,{'body':_[_0x1fa0('0xca')](_0xe13cb1[_0x1fa0('0x4b')][_0x1fa0('0x4b')]),'bodyTitle':_0x35a92f[_0x1fa0('0xcb')]});return db['ChatOfflineMessage'][_0x1fa0('0x4a')]({'body':_0x4d9c37,'plainBody':htmlToText['fromString'](_0x4d9c37),'ContactId':_0xce16a6['id'],'ChatWebsiteId':_0x35a92f['id']});}})[_0x1fa0('0x15')](function(_0x5df785){_0x5bf49e=_0x5df785;if(_0x396426[_0x1fa0('0x39')]){var _0x7af95a=_0x396426[_0x1fa0('0x2e')](function(_0x2cdeaa){return{'name':_0x2cdeaa['originalname'],'basename':_0x2cdeaa[_0x1fa0('0x64')],'type':_0x2cdeaa[_0x1fa0('0xcc')],'ChatOfflineMessageId':_0x5df785['id']};});_0xaf87ea=_0x7af95a[_0x1fa0('0x2e')](_0x5b4885=>{var _0x467a8f={'filename':_0x5b4885[_0x1fa0('0x29')],'path':path[_0x1fa0('0x70')](config[_0x1fa0('0x71')],_0x1fa0('0xcd'),_0x1fa0('0xc1'),_0x1fa0('0xce'),_0x1fa0('0xcf'),_0x5b4885['basename'])};return _0x467a8f;});if(!_0x35a92f[_0x1fa0('0xd0')]){return db[_0x1fa0('0xd1')][_0x1fa0('0xd2')](function(_0x33d656){return db[_0x1fa0('0xd3')]['bulkCreate'](_0x7af95a,{'transaction':_0x33d656});});}}})['then'](function(){if(_0x5bf49e){_0x42dd30=_0x5bf49e;return db[_0x1fa0('0xc6')][_0x1fa0('0x59')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x1fa0('0xd4'),'raw':!![],'include':[{'model':db[_0x1fa0('0xd5')],'as':'CloudProvider','raw':!![]}]}]});}})[_0x1fa0('0x15')](function(_0x1e0ff1){if(_0x1e0ff1&&_0x1e0ff1[_0x1fa0('0xd4')]&&_0x35a92f[_0x1fa0('0xd6')]&&_0x35a92f[_0x1fa0('0xd7')]){var _0x1cf6f6=_0x1e0ff1[_0x1fa0('0xd8')]();return respondWithRpcPromise(_0x1fa0('0xd9'),_0x1fa0('0xda'),{'account':_0x1cf6f6,'message':{'from':util[_0x1fa0('0xa8')](_0x1fa0('0xdb'),_0x1e0ff1['name'],_0x1e0ff1[_0x1fa0('0xdc')]||_0x1e0ff1[_0x1fa0('0xd4')][_0x1fa0('0x4c')]),'to':_0x35a92f['forwardOfflineAddress'],'subject':_0x35a92f[_0x1fa0('0xdd')],'html':_0x42dd30['body'],'attachments':_0xaf87ea}},client9003)[_0x1fa0('0x15')](function(){return _0x42dd30;})[_0x1fa0('0x44')](function(_0x24a953){logger[_0x1fa0('0x1a')](_0x24a953);});}})['then'](function(){if(_0x35a92f&&_0x35a92f['openNewInteraction']&&_0x35a92f[_0x1fa0('0xde')]){var _0x4b0d33=[];if(_0x396426[_0x1fa0('0x39')]){_0x4b0d33=_0x396426[_0x1fa0('0x2e')](function(_0x57b364){return{'name':_0x57b364[_0x1fa0('0xdf')],'basename':_0x57b364[_0x1fa0('0x64')],'type':_0x57b364[_0x1fa0('0xcc')],'ChatOfflineMessageId':_0x5bf49e['id']};});}var _0x5cf106;if(!_[_0x1fa0('0x6e')](_0x35a92f[_0x1fa0('0xe0')])){var _0x162778=_['map'](_0xe13cb1[_0x1fa0('0x4b')],function(_0x17485a){return _0x17485a;});var _0x57a57f=_[_0x1fa0('0xe1')](_0x162778)[0x0];var _0x449c93=_[_0x1fa0('0xe2')](_0x57a57f,function(_0x42b635){return _0x42b635;});_0x5cf106=_0x449c93[0x1][_0x35a92f[_0x1fa0('0xe0')]];}var _0x2e7976={'from':_0x25dcb3[_0x1fa0('0xdc')],'firstName':_0x25dcb3[_0x1fa0('0xa0')],'lastName':_0x25dcb3['lastName'],'mapKey':_0x1fa0('0xdc'),'message':{'from':_0x25dcb3[_0x1fa0('0xdc')],'to':_0x35a92f[_0x1fa0('0xc6')][_0x1fa0('0xdc')],'cc':'','subject':_[_0x1fa0('0x6e')](_0x5cf106)?_0x35a92f[_0x1fa0('0xdd')]:_0x5cf106,'messageId':'','sentAt':new Date(),'attach':_0x4b0d33[_0x1fa0('0x39')],'attachments':_0x4b0d33,'originChannel':'Chat','ChatWebsiteId':_0x35a92f['id'],'ChatOfflineMessageId':_0x42dd30['id'],'originTo':_0x35a92f[_0x1fa0('0xc6')][_0x1fa0('0xdc')]},'body':_0x42dd30['body']};var _0x3ec7c0={'account':{'id':_0x35a92f[_0x1fa0('0xde')]},'body':_0x2e7976,'log':_0x1fa0('0xe3')};return respondWithRpcPromise(_0x1fa0('0xe3'),_0x1fa0('0xe4'),_0x3ec7c0,client9001)[_0x1fa0('0x15')](function(){return _0x42dd30;})[_0x1fa0('0x44')](function(_0x1eacb2){logger[_0x1fa0('0x1a')](_0x1eacb2);});}return;})[_0x1fa0('0x15')](function(){if(_0x42dd30){return _0x42dd30;}})[_0x1fa0('0x15')](respondWithResult(_0x4636b7,null))['catch'](function(_0x104b55){logger[_0x1fa0('0x1a')](_0x1fa0('0x44'),_0x104b55);for(var _0x2c657c of _0x396426){var _0x4cd630=path[_0x1fa0('0x70')](config[_0x1fa0('0x71')],_0x1fa0('0xcd'),_0x1fa0('0xc1'),_0x1fa0('0xce'),_0x1fa0('0xcf'),_0x2c657c[_0x1fa0('0x64')]);fs_extra[_0x1fa0('0xe5')](_0x4cd630)[_0x1fa0('0x44')](function(_0x140e7d){logger[_0x1fa0('0x1a')](_0x1fa0('0xe6'),_0x4cd630,_0x140e7d);});}});};exports[_0x1fa0('0xe7')]=function(_0x167fd4,_0x3095aa){return db[_0x1fa0('0xac')]['find']({'where':{'id':_0x167fd4[_0x1fa0('0x46')]['id']}})[_0x1fa0('0x15')](handleEntityNotFound(_0x3095aa,null))[_0x1fa0('0x15')](function(_0x8ac24f){if(_0x8ac24f){return _0x8ac24f[_0x1fa0('0xe7')](_0x167fd4[_0x1fa0('0x4b')][_0x1fa0('0x61')],_[_0x1fa0('0xe8')](_0x167fd4[_0x1fa0('0x4b')],[_0x1fa0('0x61'),'id'])||{});}})['then'](respondWithResult(_0x3095aa,null))[_0x1fa0('0x44')](handleError(_0x3095aa,null));};exports[_0x1fa0('0xe9')]=function(_0x51c387,_0x442c32){var _0x3dcba3={'raw':![],'where':{}};var _0x43ae14={};var _0x502c7c={'count':0x0,'rows':[]};return db[_0x1fa0('0x2f')]['findOne']({'where':{'id':_0x51c387[_0x1fa0('0x46')]['id']}})[_0x1fa0('0x15')](handleEntityNotFound(_0x442c32,null))['then'](function(_0x517cf2){if(_0x517cf2){_0x43ae14[_0x1fa0('0x32')]=_['keys'](db[_0x1fa0('0xac')][_0x1fa0('0x47')]);_0x43ae14[_0x1fa0('0x34')]=_['keys'](_0x51c387[_0x1fa0('0x34')]);_0x43ae14['filters']=_['intersection'](_0x43ae14['model'],_0x43ae14[_0x1fa0('0x34')]);_0x3dcba3[_0x1fa0('0x38')]=_['intersection'](_0x43ae14['model'],qs['fields'](_0x51c387[_0x1fa0('0x34')][_0x1fa0('0x37')]));_0x3dcba3[_0x1fa0('0x38')]=_0x3dcba3[_0x1fa0('0x38')][_0x1fa0('0x39')]?_0x3dcba3[_0x1fa0('0x38')]:_0x43ae14[_0x1fa0('0x32')];if(!_0x51c387[_0x1fa0('0x34')][_0x1fa0('0x3a')](_0x1fa0('0x5a'))){_0x3dcba3['limit']=qs['limit'](_0x51c387['query']['limit']);_0x3dcba3[_0x1fa0('0x24')]=qs[_0x1fa0('0x24')](_0x51c387[_0x1fa0('0x34')][_0x1fa0('0x24')]);}_0x3dcba3['order']=qs[_0x1fa0('0x3c')](_0x51c387[_0x1fa0('0x34')][_0x1fa0('0x3c')]);_0x3dcba3[_0x1fa0('0x3e')]=qs[_0x1fa0('0x35')](_[_0x1fa0('0xea')](_0x51c387[_0x1fa0('0x34')],_0x43ae14[_0x1fa0('0x35')]));_0x3dcba3[_0x1fa0('0x3e')]['ChatWebsiteId']=_0x517cf2['id'];if(_0x51c387['query'][_0x1fa0('0x3d')]){_0x3dcba3[_0x1fa0('0x3e')]=_[_0x1fa0('0x48')](_0x3dcba3[_0x1fa0('0x3e')],{'$or':_[_0x1fa0('0x2e')](_0x3dcba3[_0x1fa0('0x38')],function(_0x28741d){var _0x1338a={};_0x1338a[_0x28741d]={'$like':'%'+_0x51c387['query'][_0x1fa0('0x3d')]+'%'};return _0x1338a;})});}_0x3dcba3=_[_0x1fa0('0x48')]({},_0x3dcba3,_0x51c387[_0x1fa0('0x40')]);return db['ChatInteraction'][_0x1fa0('0x23')]({'where':_0x3dcba3[_0x1fa0('0x3e')]})[_0x1fa0('0x15')](function(_0x4cc5ae){_0x502c7c['count']=_0x4cc5ae;if(_0x51c387['query'][_0x1fa0('0x41')]){_0x3dcba3['include']=[{'model':db['CmContact'],'as':_0x1fa0('0xeb'),'required':![]},{'model':db[_0x1fa0('0xb7')],'as':_0x1fa0('0xec'),'attributes':[_0x1fa0('0x29'),_0x1fa0('0xed'),_0x1fa0('0xee')],'required':![]},{'model':db[_0x1fa0('0xef')],'as':_0x1fa0('0xf0'),'attributes':['id',_0x1fa0('0x29'),_0x1fa0('0xf1')],'where':_0x51c387[_0x1fa0('0x34')]['tag']?{'id':_0x51c387[_0x1fa0('0x34')][_0x1fa0('0xf2')]}:undefined,'required':_0x51c387[_0x1fa0('0x34')][_0x1fa0('0xf2')]?!![]:![]}];}return db[_0x1fa0('0xac')][_0x1fa0('0x43')](_0x3dcba3);})[_0x1fa0('0x15')](function(_0x4a8650){_0x502c7c[_0x1fa0('0x5b')]=_0x4a8650;return _0x502c7c;});}})[_0x1fa0('0x15')](respondWithFilteredResult(_0x442c32,_0x3dcba3))[_0x1fa0('0x44')](handleError(_0x442c32,null));};function iftimePromise(_0x1ca7e8,_0x4dde71){return respondWithRpcPromise(_0x1fa0('0xf3'),_0x1fa0('0xf4'),{'command':_0x4dde71[_0x1fa0('0xf5')]?util[_0x1fa0('0xa8')](_0x1fa0('0xf6'),_0x1ca7e8['interval'],_0x4dde71[_0x1fa0('0xf5')]):util[_0x1fa0('0xa8')](_0x1fa0('0xf7'),_0x1ca7e8[_0x1fa0('0xf8')])},client9002)[_0x1fa0('0x15')](function(_0x59e0a6){var _0x566e67=_0x59e0a6&&_0x59e0a6[_0x1fa0('0xf9')](_0x1fa0('0xfa'))>=0x0?!![]:![];logger['info'](_0x1fa0('0xfb'),_0x4dde71['id'],_0x1ca7e8['id'],_0x1ca7e8[_0x1fa0('0xf8')],_0x566e67?'ONLINE':_0x1fa0('0xfc'),_0x4dde71[_0x1fa0('0xf5')]?_0x4dde71[_0x1fa0('0xf5')]:_0x1fa0('0xfd'));return _0x566e67;})[_0x1fa0('0x44')](function(_0x3fb1cc){logger[_0x1fa0('0x1a')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x4dde71['id'],_0x1ca7e8['id'],_0x1ca7e8[_0x1fa0('0xf8')],util[_0x1fa0('0xfe')](_0x3fb1cc,{'showHidden':![],'depth':null}),_0x4dde71[_0x1fa0('0xf5')]?_0x4dde71[_0x1fa0('0xf5')]:_0x1fa0('0xfd'));return![];});}exports[_0x1fa0('0xf4')]=function(_0x16a813,_0x1d45dc){var _0x11deb7=0x0;var _0x2d8b3c=0x0;var _0x24d537=![];var _0x5cba07;var _0x278ccd;return db[_0x1fa0('0x2f')]['find']({'where':{'id':_0x16a813[_0x1fa0('0x46')]['id']},'include':[{'model':db[_0x1fa0('0xff')],'as':_0x1fa0('0xff'),'include':[{'model':db[_0x1fa0('0xff')],'as':_0x1fa0('0x100'),'attributes':['id','interval'],'raw':!![]}]}]})[_0x1fa0('0x15')](handleEntityNotFound(_0x1d45dc,null))[_0x1fa0('0x15')](function(_0x2664c7){if(_0x2664c7){_0x5cba07=_0x2664c7;return _0x2664c7[_0x1fa0('0x101')]({'raw':!![]});}})[_0x1fa0('0x15')](function(_0x18a785){if(_0x5cba07){if(_0x18a785){_0x278ccd=_0x18a785;}}return require(_0x1fa0('0x6b'))[_0x1fa0('0x6c')]();})['then'](function(_0x28990f){if(_0x28990f){_0x2d8b3c=_0x28990f['virtual'];_0x24d537=_0x28990f[_0x1fa0('0x6d')];}})[_0x1fa0('0x15')](function(){return db[_0x1fa0('0xac')][_0x1fa0('0x23')]({'where':{'closed':![]}});})[_0x1fa0('0x15')](function(_0x3abd62){_0x11deb7=_0x3abd62;if(_0x2d8b3c&&_0x3abd62>_0x2d8b3c){return db[_0x1fa0('0x102')][_0x1fa0('0x59')]({'where':{'id':0x1}})[_0x1fa0('0x15')](function(_0x4108de){if(_0x4108de){_0x4108de[_0x1fa0('0x103')](_0x1fa0('0x104'));}});}})[_0x1fa0('0x15')](function(){if(_0x5cba07['Interval']&&_0x5cba07[_0x1fa0('0xff')]['Intervals']){var _0x3d6ac2=[];for(var _0x4d9383=0x0;_0x4d9383<_0x5cba07[_0x1fa0('0xff')][_0x1fa0('0x100')][_0x1fa0('0x39')];_0x4d9383++){var _0x204826=_0x5cba07[_0x1fa0('0xff')][_0x1fa0('0x100')][_0x4d9383]['get']({'plain':!![]});_0x3d6ac2[_0x1fa0('0x105')](iftimePromise(_0x204826,_0x5cba07));}return BPromise[_0x1fa0('0x106')](_0x3d6ac2)[_0x1fa0('0x15')](function(_0x2723f6){return _[_0x1fa0('0x107')](_0x2723f6);});}else{return!![];}})[_0x1fa0('0x15')](function(_0x4328d1){var _0x57c2d2=fs['readFileSync'](path['join'](config[_0x1fa0('0x71')],_0x1fa0('0x108')),'utf8');var _0x14c141={'remote':_0x5cba07[_0x1fa0('0x109')],'query':querystring[_0x1fa0('0x19')](_[_0x1fa0('0x48')](_0x5cba07[_0x1fa0('0x27')]({'plain':!![]}),{'customerIp':_0x16a813[_0x1fa0('0x9b')][_0x1fa0('0x9d')]||_0x16a813[_0x1fa0('0x9b')][_0x1fa0('0x10a')]||_0x16a813[_0x1fa0('0x10b')][_0x1fa0('0x10c')]||_0x16a813['ip'],'referer':_0x16a813['headers'][_0x1fa0('0xa3')],'openedInteractions':_0x11deb7,'maxInteractions':_0x2d8b3c,'virtual':_0x24d537[_0x1fa0('0x10d')],'online':_0x4328d1,'custom':_0x24d537}))[_0x1fa0('0x10e')](/'/g,'\x5c\x27')};_0x1d45dc[_0x1fa0('0x2a')](ejs['render'](Mustache[_0x1fa0('0xc9')](_0x57c2d2,_0x14c141),{'proactiveActions':_0x278ccd,'alignment':_0x5cba07['alignment'],'verticalAlignment':_0x5cba07['verticalAlignment'],'div_color':_0x5cba07[_0x1fa0('0xf1')],'labelText':_0x5cba07[_0x1fa0('0x10f')],'text_color':_0x5cba07[_0x1fa0('0x110')],'text_button_color':_0x5cba07[_0x1fa0('0x111')],'button_color':_0x5cba07['color_button'],'background_color':_0x5cba07[_0x1fa0('0x112')],'hideWhenOffline':_0x5cba07[_0x1fa0('0x113')],'interval':_0x5cba07['IntervalId']}));})[_0x1fa0('0x44')](handleError(_0x1d45dc,null));};exports[_0x1fa0('0x114')]=function(_0x5ef0b8,_0x350993){var _0x4797b6=_0x5ef0b8['params']['id'];var _0x4501fd=_0x5ef0b8['body'];var _0xba2617=0xc8;var _0x54422e=null;return db[_0x1fa0('0xd1')]['transaction']({'isolationLevel':db[_0x1fa0('0xd1')][_0x1fa0('0x115')]['ISOLATION_LEVELS'][_0x1fa0('0x116')]},function(_0x3ea7c2){return db[_0x1fa0('0x2f')][_0x1fa0('0x59')]({'where':{'id':_0x4797b6},'transaction':_0x3ea7c2})[_0x1fa0('0x15')](function(_0x264780){if(_0x264780){return db[_0x1fa0('0x91')][_0x1fa0('0x26')]({'where':{'ChatWebsiteId':_0x4797b6},'transaction':_0x3ea7c2})[_0x1fa0('0x15')](function(){var _0x3d37e9=_[_0x1fa0('0x2e')](_0x4501fd,function(_0x53c6d8){_0x53c6d8[_0x1fa0('0x56')]=_0x4797b6;return _0x53c6d8;});return db[_0x1fa0('0x91')][_0x1fa0('0x117')](_0x3d37e9,{'transaction':_0x3ea7c2});});}else{_0xba2617=0x194;_0x54422e=[];}});})['then'](function(){if(_0xba2617!==0x194){return db[_0x1fa0('0x91')][_0x1fa0('0x118')]({'where':{'ChatWebsiteId':_0x4797b6},'order':'priority'})[_0x1fa0('0x15')](function(_0x15f2e8){_0x54422e=_0x15f2e8;});}})[_0x1fa0('0x44')](function(_0x433188){_0xba2617=0x1f4;logger[_0x1fa0('0x1a')](_0x433188['stack']);if(_0x433188[_0x1fa0('0x29')]){delete _0x433188['name'];}_0x54422e=_0x433188;})[_0x1fa0('0x119')](function(){if(_0x54422e===null){_0x350993['sendStatus'](_0xba2617);}else{if(_0xba2617===0x1f4){_0x350993[_0x1fa0('0x1e')](_0xba2617)[_0x1fa0('0x2a')](_0x54422e);}else{_0x350993['status'](_0xba2617)[_0x1fa0('0x20')](_0x54422e);}}});};exports[_0x1fa0('0x11a')]=function(_0x3bbe18,_0x77bb93){var _0x3a0069={};var _0x3c23ee={};var _0x3c8a52;var _0x3107d9;return db[_0x1fa0('0x2f')][_0x1fa0('0x59')]({'where':{'id':_0x3bbe18[_0x1fa0('0x46')]['id']}})['then'](handleEntityNotFound(_0x77bb93,null))[_0x1fa0('0x15')](function(_0x574a1a){if(_0x574a1a){_0x3c8a52=_0x574a1a;_0x3c23ee[_0x1fa0('0x32')]=_[_0x1fa0('0x33')](db[_0x1fa0('0x91')]['rawAttributes']);_0x3c23ee[_0x1fa0('0x34')]=_[_0x1fa0('0x33')](_0x3bbe18[_0x1fa0('0x34')]);_0x3c23ee[_0x1fa0('0x35')]=_[_0x1fa0('0x36')](_0x3c23ee['model'],_0x3c23ee[_0x1fa0('0x34')]);_0x3a0069['attributes']=_[_0x1fa0('0x36')](_0x3c23ee[_0x1fa0('0x32')],qs[_0x1fa0('0x37')](_0x3bbe18[_0x1fa0('0x34')][_0x1fa0('0x37')]));_0x3a0069[_0x1fa0('0x38')]=_0x3a0069[_0x1fa0('0x38')][_0x1fa0('0x39')]?_0x3a0069[_0x1fa0('0x38')]:_0x3c23ee[_0x1fa0('0x32')];_0x3a0069['order']=qs[_0x1fa0('0x3c')](_0x3bbe18[_0x1fa0('0x34')][_0x1fa0('0x3c')]);_0x3a0069[_0x1fa0('0x3e')]=qs['filters'](_[_0x1fa0('0xea')](_0x3bbe18['query'],_0x3c23ee[_0x1fa0('0x35')]));if(_0x3bbe18[_0x1fa0('0x34')][_0x1fa0('0x3d')]){_0x3a0069['where']=_[_0x1fa0('0x48')](_0x3a0069[_0x1fa0('0x3e')],{'$or':_[_0x1fa0('0x2e')](_0x3a0069[_0x1fa0('0x38')],function(_0x51120d){var _0x581744={};_0x581744[_0x51120d]={'$like':'%'+_0x3bbe18[_0x1fa0('0x34')]['filter']+'%'};return _0x581744;})});}_0x3a0069=_[_0x1fa0('0x48')]({},_0x3a0069,_0x3bbe18['options']);return _0x3c8a52[_0x1fa0('0x11a')](_0x3a0069);}})[_0x1fa0('0x15')](function(_0x3e4cd0){if(_0x3e4cd0){_0x3107d9=_0x3e4cd0['length'];if(!_0x3bbe18[_0x1fa0('0x34')][_0x1fa0('0x3a')](_0x1fa0('0x5a'))){_0x3a0069[_0x1fa0('0x22')]=qs[_0x1fa0('0x22')](_0x3bbe18[_0x1fa0('0x34')]['limit']);_0x3a0069[_0x1fa0('0x24')]=qs[_0x1fa0('0x24')](_0x3bbe18['query'][_0x1fa0('0x24')]);}return _0x3c8a52[_0x1fa0('0x11a')](_0x3a0069);}})[_0x1fa0('0x15')](function(_0x6413a3){if(_0x6413a3){return _0x6413a3?{'count':_0x3107d9,'rows':_0x6413a3}:null;}})[_0x1fa0('0x15')](respondWithResult(_0x77bb93,null))['catch'](handleError(_0x77bb93,null));};exports[_0x1fa0('0x11b')]=function(_0x45aad3,_0x35f9ea){return db[_0x1fa0('0x11c')][_0x1fa0('0x49')]({'where':{'id':_0x45aad3['params']['id']}})['then'](handleEntityNotFound(_0x35f9ea,null))[_0x1fa0('0x15')](function(_0x16f8d3){if(_0x16f8d3){return _0x16f8d3[_0x1fa0('0x11b')](_0x45aad3['body']['ids'],_[_0x1fa0('0xe8')](_0x45aad3['body'],['ids','id'])||{});}})[_0x1fa0('0x15')](respondWithResult(_0x35f9ea,null))[_0x1fa0('0x44')](handleError(_0x35f9ea,null));};exports['getProactiveActions']=function(_0x3d0f74,_0x5c440f){var _0x292fcc={};var _0x542e36={};var _0x5ca094;var _0x2a6e97;return db[_0x1fa0('0x2f')]['findOne']({'where':{'id':_0x3d0f74[_0x1fa0('0x46')]['id']}})['then'](handleEntityNotFound(_0x5c440f,null))['then'](function(_0x4dc66d){if(_0x4dc66d){_0x5ca094=_0x4dc66d;_0x542e36[_0x1fa0('0x32')]=_['keys'](db['ChatProactiveAction'][_0x1fa0('0x47')]);_0x542e36[_0x1fa0('0x34')]=_[_0x1fa0('0x33')](_0x3d0f74[_0x1fa0('0x34')]);_0x542e36[_0x1fa0('0x35')]=_[_0x1fa0('0x36')](_0x542e36[_0x1fa0('0x32')],_0x542e36[_0x1fa0('0x34')]);_0x292fcc[_0x1fa0('0x38')]=_[_0x1fa0('0x36')](_0x542e36[_0x1fa0('0x32')],qs[_0x1fa0('0x37')](_0x3d0f74['query'][_0x1fa0('0x37')]));_0x292fcc['attributes']=_0x292fcc['attributes'][_0x1fa0('0x39')]?_0x292fcc[_0x1fa0('0x38')]:_0x542e36['model'];_0x292fcc[_0x1fa0('0x3b')]=qs[_0x1fa0('0x3c')](_0x3d0f74[_0x1fa0('0x34')][_0x1fa0('0x3c')]);_0x292fcc[_0x1fa0('0x3e')]=qs[_0x1fa0('0x35')](_[_0x1fa0('0xea')](_0x3d0f74[_0x1fa0('0x34')],_0x542e36['filters']));if(_0x3d0f74[_0x1fa0('0x34')][_0x1fa0('0x3d')]){_0x292fcc[_0x1fa0('0x3e')]=_['merge'](_0x292fcc[_0x1fa0('0x3e')],{'$or':_[_0x1fa0('0x2e')](_0x292fcc[_0x1fa0('0x38')],function(_0x11d01d){var _0x1d372c={};_0x1d372c[_0x11d01d]={'$like':'%'+_0x3d0f74[_0x1fa0('0x34')]['filter']+'%'};return _0x1d372c;})});}_0x292fcc=_[_0x1fa0('0x48')]({},_0x292fcc,_0x3d0f74['options']);return _0x5ca094[_0x1fa0('0x101')](_0x292fcc);}})['then'](function(_0x5de9c2){if(_0x5de9c2){_0x2a6e97=_0x5de9c2['length'];if(!_0x3d0f74['query']['hasOwnProperty'](_0x1fa0('0x5a'))){_0x292fcc['limit']=qs[_0x1fa0('0x22')](_0x3d0f74[_0x1fa0('0x34')][_0x1fa0('0x22')]);_0x292fcc[_0x1fa0('0x24')]=qs[_0x1fa0('0x24')](_0x3d0f74[_0x1fa0('0x34')][_0x1fa0('0x24')]);}return _0x5ca094[_0x1fa0('0x101')](_0x292fcc);}})[_0x1fa0('0x15')](function(_0x571959){if(_0x571959){return _0x571959?{'count':_0x2a6e97,'rows':_0x571959}:null;}})['then'](respondWithResult(_0x5c440f,null))['catch'](handleError(_0x5c440f,null));};exports[_0x1fa0('0x11d')]=function(_0x5d34ea,_0x3c8134){var _0x54f6ec=_0x5d34ea['query']['online']===_0x1fa0('0x11e')?_0x1fa0('0x11f'):_0x1fa0('0x120');return db['ChatWebsite'][_0x1fa0('0x49')]({'attributes':['id',_0x54f6ec],'where':{'id':_0x5d34ea[_0x1fa0('0x46')]['id']}})['then'](handleEntityNotFound(_0x3c8134,null))['then'](function(_0x4f945a){if(_0x4f945a){var _0x3edaee=_0x4f945a[_0x54f6ec];var _0x28dbac=_0x3edaee&&_0x3edaee[_0x1fa0('0x121')]?_0x3edaee[_0x1fa0('0x121')]:[];_0x3c8134['send']({'fromKey':_['isNil'](_0x3edaee['fromKey'])?undefined:_0x3edaee[_0x1fa0('0x122')],'count':_0x28dbac[_0x1fa0('0x39')],'rows':_0x28dbac});}})[_0x1fa0('0x44')](handleError(_0x3c8134,null));};exports[_0x1fa0('0x123')]=function(_0x4b5666,_0x1481df){var _0x416ad1={'raw':![],'where':{}};var _0x2ea3d3={};var _0x4f6be4={'count':0x0,'rows':[]};return db[_0x1fa0('0x2f')][_0x1fa0('0x59')]({'where':{'id':_0x4b5666[_0x1fa0('0x46')]['id']}})[_0x1fa0('0x15')](handleEntityNotFound(_0x1481df,null))[_0x1fa0('0x15')](function(_0xedb5fd){if(_0xedb5fd){_0x2ea3d3['model']=_['keys'](db['ChatOfflineMessage'][_0x1fa0('0x47')]);_0x2ea3d3['query']=_[_0x1fa0('0x33')](_0x4b5666[_0x1fa0('0x34')]);_0x2ea3d3[_0x1fa0('0x35')]=_[_0x1fa0('0x36')](_0x2ea3d3[_0x1fa0('0x32')],_0x2ea3d3[_0x1fa0('0x34')]);_0x416ad1['attributes']=_[_0x1fa0('0x36')](_0x2ea3d3[_0x1fa0('0x32')],qs[_0x1fa0('0x37')](_0x4b5666[_0x1fa0('0x34')][_0x1fa0('0x37')]));_0x416ad1['attributes']=_0x416ad1[_0x1fa0('0x38')][_0x1fa0('0x39')]?_0x416ad1[_0x1fa0('0x38')]:_0x2ea3d3[_0x1fa0('0x32')];if(!_0x4b5666[_0x1fa0('0x34')]['hasOwnProperty'](_0x1fa0('0x5a'))){_0x416ad1['limit']=qs[_0x1fa0('0x22')](_0x4b5666[_0x1fa0('0x34')][_0x1fa0('0x22')]);_0x416ad1[_0x1fa0('0x24')]=qs[_0x1fa0('0x24')](_0x4b5666[_0x1fa0('0x34')]['offset']);}_0x416ad1[_0x1fa0('0x3b')]=qs[_0x1fa0('0x3c')](_0x4b5666['query'][_0x1fa0('0x3c')]);_0x416ad1['where']=qs[_0x1fa0('0x35')](_[_0x1fa0('0xea')](_0x4b5666[_0x1fa0('0x34')],_0x2ea3d3[_0x1fa0('0x35')]));_0x416ad1[_0x1fa0('0x3e')]['ChatWebsiteId']=_0xedb5fd['id'];if(_0x4b5666[_0x1fa0('0x34')][_0x1fa0('0x3d')]){_0x416ad1[_0x1fa0('0x3e')]=_['merge'](_0x416ad1[_0x1fa0('0x3e')],{'$or':_[_0x1fa0('0x2e')](_0x416ad1[_0x1fa0('0x38')],function(_0x2e3707){var _0x1e1465={};_0x1e1465[_0x2e3707]={'$like':'%'+_0x4b5666[_0x1fa0('0x34')][_0x1fa0('0x3d')]+'%'};return _0x1e1465;})});}_0x416ad1=_[_0x1fa0('0x48')]({},_0x416ad1,_0x4b5666[_0x1fa0('0x40')]);return db[_0x1fa0('0x124')]['count']({'where':_0x416ad1[_0x1fa0('0x3e')]})['then'](function(_0x93a38c){_0x4f6be4[_0x1fa0('0x23')]=_0x93a38c;if(_0x4b5666[_0x1fa0('0x34')]['includeAll']){_0x416ad1[_0x1fa0('0x42')]=[{'all':!![]}];}else{_0x416ad1['include']=[{'model':db[_0x1fa0('0x7f')],'as':_0x1fa0('0xeb'),'required':![]},{'model':db[_0x1fa0('0xd3')],'as':_0x1fa0('0x125'),'required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x416ad1);})[_0x1fa0('0x15')](function(_0x208ff0){_0x4f6be4['rows']=_0x208ff0;return _0x4f6be4;});}})[_0x1fa0('0x15')](respondWithFilteredResult(_0x1481df,_0x416ad1))[_0x1fa0('0x44')](handleError(_0x1481df,null));};exports[_0x1fa0('0x126')]=function(_0x2259a5,_0x542e17){return db['ChatWebsite'][_0x1fa0('0x49')]({'where':{'id':_0x2259a5[_0x1fa0('0x46')]['id']}})['then'](handleEntityNotFound(_0x542e17,null))[_0x1fa0('0x15')](function(_0x30caf1){if(_0x30caf1){return _0x30caf1[_0x1fa0('0x126')](_0x2259a5[_0x1fa0('0x4b')][_0x1fa0('0x61')],_[_0x1fa0('0xe8')](_0x2259a5[_0x1fa0('0x4b')],[_0x1fa0('0x61'),'id'])||{})[_0x1fa0('0xaf')](function(_0x2048be){for(var _0x14c0bc=0x0;_0x14c0bc<_0x2259a5[_0x1fa0('0x4b')]['ids'][_0x1fa0('0x39')];_0x14c0bc+=0x1){socket['emit']('userChatWebsite:save',{'UserId':Number(_0x2259a5[_0x1fa0('0x4b')][_0x1fa0('0x61')][_0x14c0bc]),'ChatWebsiteId':Number(_0x2259a5[_0x1fa0('0x46')]['id'])});}return _0x2048be;});}})[_0x1fa0('0x15')](respondWithResult(_0x542e17,null))[_0x1fa0('0x44')](handleError(_0x542e17,null));};exports[_0x1fa0('0x127')]=function(_0x45fe3e,_0x2601ec){return db[_0x1fa0('0x2f')][_0x1fa0('0x49')]({'where':{'id':_0x45fe3e['params']['id']}})[_0x1fa0('0x15')](handleEntityNotFound(_0x2601ec,null))[_0x1fa0('0x15')](function(_0x658ee9){if(_0x658ee9){return _0x658ee9[_0x1fa0('0x127')](_0x45fe3e[_0x1fa0('0x34')][_0x1fa0('0x61')])[_0x1fa0('0x15')](function(){if(_['isArray'](_0x45fe3e[_0x1fa0('0x34')][_0x1fa0('0x61')])){for(var _0x36d922=0x0;_0x36d922<_0x45fe3e['query']['ids'][_0x1fa0('0x39')];_0x36d922+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x45fe3e[_0x1fa0('0x34')]['ids'][_0x36d922]),'ChatWebsiteId':Number(_0x45fe3e[_0x1fa0('0x46')]['id'])});}}else{socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x45fe3e['query'][_0x1fa0('0x61')]),'ChatWebsiteId':Number(_0x45fe3e['params']['id'])});}});}})[_0x1fa0('0x15')](respondWithStatusCode(_0x2601ec,null))['catch'](handleError(_0x2601ec,null));};exports[_0x1fa0('0x128')]=function(_0x37d109,_0xaedd08){var _0x2c6c79={};var _0x4cec2e={};var _0x470620;var _0x2e847d;return db[_0x1fa0('0x2f')][_0x1fa0('0x59')]({'where':{'id':_0x37d109['params']['id']}})[_0x1fa0('0x15')](handleEntityNotFound(_0xaedd08,null))[_0x1fa0('0x15')](function(_0x8a7ccb){if(_0x8a7ccb){_0x470620=_0x8a7ccb;_0x4cec2e['model']=_[_0x1fa0('0x33')](db[_0x1fa0('0xb7')][_0x1fa0('0x47')]);_0x4cec2e[_0x1fa0('0x34')]=_[_0x1fa0('0x33')](_0x37d109[_0x1fa0('0x34')]);_0x4cec2e[_0x1fa0('0x35')]=_['intersection'](_0x4cec2e[_0x1fa0('0x32')],_0x4cec2e[_0x1fa0('0x34')]);_0x2c6c79[_0x1fa0('0x38')]=_[_0x1fa0('0x36')](_0x4cec2e[_0x1fa0('0x32')],qs['fields'](_0x37d109['query']['fields']));_0x2c6c79[_0x1fa0('0x38')]=_0x2c6c79[_0x1fa0('0x38')][_0x1fa0('0x39')]?_0x2c6c79[_0x1fa0('0x38')]:_0x4cec2e[_0x1fa0('0x32')];_0x2c6c79[_0x1fa0('0x3b')]=qs[_0x1fa0('0x3c')](_0x37d109[_0x1fa0('0x34')][_0x1fa0('0x3c')]);_0x2c6c79[_0x1fa0('0x3e')]=qs[_0x1fa0('0x35')](_['pick'](_0x37d109['query'],_0x4cec2e[_0x1fa0('0x35')]));if(_0x37d109['query'][_0x1fa0('0x3d')]){_0x2c6c79[_0x1fa0('0x3e')]=_['merge'](_0x2c6c79[_0x1fa0('0x3e')],{'$or':_[_0x1fa0('0x2e')](_0x2c6c79[_0x1fa0('0x38')],function(_0x2d56d9){var _0x3884e5={};_0x3884e5[_0x2d56d9]={'$like':'%'+_0x37d109[_0x1fa0('0x34')][_0x1fa0('0x3d')]+'%'};return _0x3884e5;})});}_0x2c6c79=_[_0x1fa0('0x48')]({},_0x2c6c79,_0x37d109['options']);return _0x470620['getAgents'](_0x2c6c79);}})[_0x1fa0('0x15')](function(_0x1cf269){if(_0x1cf269){_0x2e847d=_0x1cf269[_0x1fa0('0x39')];if(!_0x37d109['query'][_0x1fa0('0x3a')](_0x1fa0('0x5a'))){_0x2c6c79[_0x1fa0('0x22')]=qs[_0x1fa0('0x22')](_0x37d109[_0x1fa0('0x34')][_0x1fa0('0x22')]);_0x2c6c79[_0x1fa0('0x24')]=qs[_0x1fa0('0x24')](_0x37d109['query'][_0x1fa0('0x24')]);}return _0x470620[_0x1fa0('0x128')](_0x2c6c79);}})['then'](function(_0x2bb795){if(_0x2bb795){return _0x2bb795?{'count':_0x2e847d,'rows':_0x2bb795}:null;}})[_0x1fa0('0x15')](respondWithResult(_0xaedd08,null))[_0x1fa0('0x44')](handleError(_0xaedd08,null));}; \ No newline at end of file +var _0x5094=['attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','tag','Command','getSnippet','timezone','interval','iftime\x20%s','true','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','all','server/files/chat/iframe.ejs','utf8','remote','x-real-ip','connection','referer','replace','render','alignment','color','labelText','textButtonColor','hideWhenOffline','IntervalId','addApplications','transaction','Transaction','ISOLATION_LEVELS','bulkCreate','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','false','offlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','removeAgents','userChatWebsite:remove','getAgents','mustache','ejs','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','ChatWebsites','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','params','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','ChatWebsiteId','findOne','Disposition','pick','findAll','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','nolimit','removeAnswers','addLogo','sitepic','file','addAvatar','agentAvatar','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','existsSync','server/files/images/logos/','download','getAvatar','isNil','server/files/images/avatars/','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','ValidationError','difference','updatedAt','CompanyId','ListId','Sequelize','from\x20is\x20mandatory','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','CmContact','Contacts','ChatApplication','account','Applications','list','applications','orderBy','priority','asc','defaults','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','describe','no\x20available\x20attributes','createdAt','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','offline-chat','basename','openNewInteraction','sequelize','Attachment','MailServerOut','Smtp','CloudProvider','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','mapValues','subjectOffline','email','NotifyMailAccount','notifyMail'];(function(_0x56ed83,_0x31562f){var _0x1d9041=function(_0x1fc8ad){while(--_0x1fc8ad){_0x56ed83['push'](_0x56ed83['shift']());}};_0x1d9041(++_0x31562f);}(_0x5094,0x16d));var _0x4509=function(_0xaf25ae,_0x2001c1){_0xaf25ae=_0xaf25ae-0x0;var _0x49732d=_0x5094[_0xaf25ae];return _0x49732d;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0x4509('0x0'));var util=require('util');var path=require('path');var ejs=require(_0x4509('0x1'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4509('0x2'));var querystring=require('querystring');var Redis=require(_0x4509('0x3'));var qs=require(_0x4509('0x4'));var logger=require(_0x4509('0x5'))(_0x4509('0x6'));var config=require(_0x4509('0x7'));var db=require(_0x4509('0x8'))['db'];config[_0x4509('0x9')]=_['defaults'](config[_0x4509('0x9')],{'host':_0x4509('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4509('0x9')]));require(_0x4509('0xb'))[_0x4509('0xc')](socket);var htmlToText=require(_0x4509('0xd'));var jayson=require(_0x4509('0xe'));var client=jayson[_0x4509('0xf')]['http']({'port':0x232c});var client9002=jayson[_0x4509('0xf')][_0x4509('0x10')]({'port':0x232a});var client9003=jayson[_0x4509('0xf')]['http']({'port':0x232b});var client9001=jayson[_0x4509('0xf')]['http']({'port':0x2329});function respondWithRpcPromise(_0x4a03ad,_0x5418b4,_0x11b6fe,_0x87a8c3){return new BPromise(function(_0x225ceb,_0x175dcf){var _0x4a6ff6=_0x87a8c3||client;return _0x4a6ff6[_0x4509('0x11')](_0x4a03ad,_0x11b6fe)[_0x4509('0x12')](function(_0x2ea1b9){logger[_0x4509('0x13')](_0x4509('0x14'),_0x5418b4,_0x4509('0x15'));logger[_0x4509('0x16')](_0x4509('0x17'),_0x5418b4,_0x4509('0x15'),JSON[_0x4509('0x18')](_0x2ea1b9));if(_0x2ea1b9['error']){if(_0x2ea1b9[_0x4509('0x19')]['code']===0x1f4){logger[_0x4509('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x5418b4,_0x2ea1b9[_0x4509('0x19')][_0x4509('0x1a')]);return _0x175dcf(_0x2ea1b9[_0x4509('0x19')][_0x4509('0x1a')]);}logger['error'](_0x4509('0x14'),_0x5418b4,_0x2ea1b9['error']['message']);return _0x225ceb(_0x2ea1b9[_0x4509('0x19')][_0x4509('0x1a')]);}else{logger[_0x4509('0x13')](_0x4509('0x14'),_0x5418b4,_0x4509('0x15'));_0x225ceb(_0x2ea1b9[_0x4509('0x1b')][_0x4509('0x1a')]);}})[_0x4509('0x1c')](function(_0x40af8c){logger[_0x4509('0x19')](_0x4509('0x14'),_0x5418b4,_0x40af8c);_0x175dcf(_0x40af8c);});});}function respondWithStatusCode(_0x4a196b,_0x5bd5fb){_0x5bd5fb=_0x5bd5fb||0xcc;return function(_0x1b0fc8){if(_0x1b0fc8){return _0x4a196b[_0x4509('0x1d')](_0x5bd5fb);}return _0x4a196b[_0x4509('0x1e')](_0x5bd5fb)[_0x4509('0x1f')]();};}function respondWithResult(_0x5e681c,_0x3dc47c){_0x3dc47c=_0x3dc47c||0xc8;return function(_0x11e9dd){if(_0x11e9dd){return _0x5e681c[_0x4509('0x1e')](_0x3dc47c)[_0x4509('0x20')](_0x11e9dd);}};}function respondWithFilteredResult(_0x4da472,_0x375105){return function(_0x32f2eb){if(_0x32f2eb){var _0x25a69b=typeof _0x375105[_0x4509('0x21')]===_0x4509('0x22')&&typeof _0x375105[_0x4509('0x23')]===_0x4509('0x22');var _0x41f28e=_0x32f2eb[_0x4509('0x24')];var _0x2a66cb=_0x25a69b?0x0:_0x375105[_0x4509('0x21')];var _0x36e114=_0x25a69b?_0x32f2eb[_0x4509('0x24')]:_0x375105[_0x4509('0x21')]+_0x375105[_0x4509('0x23')];var _0x58bb61;if(_0x36e114>=_0x41f28e){_0x36e114=_0x41f28e;_0x58bb61=0xc8;}else{_0x58bb61=0xce;}_0x4da472[_0x4509('0x1e')](_0x58bb61);return _0x4da472[_0x4509('0x25')](_0x4509('0x26'),_0x2a66cb+'-'+_0x36e114+'/'+_0x41f28e)[_0x4509('0x20')](_0x32f2eb);}return null;};}function saveUpdates(_0x5c8b67){return function(_0x231c85){if(_0x231c85){return _0x231c85['update'](_0x5c8b67)[_0x4509('0x12')](function(_0x232594){return _0x232594;});}return null;};}function removeEntity(_0xe5fdac){return function(_0x30c68e){if(_0x30c68e){return _0x30c68e[_0x4509('0x27')]()[_0x4509('0x12')](function(){var _0x13ee4b=_0x30c68e['get']({'plain':!![]});var _0xb9c1cc=_0x4509('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0xb9c1cc,'resourceId':_0x13ee4b['id']}})[_0x4509('0x12')](function(){return _0x30c68e;});})[_0x4509('0x12')](function(){_0xe5fdac[_0x4509('0x1e')](0xcc)[_0x4509('0x1f')]();});}};}function handleEntityNotFound(_0x483e14){return function(_0x1c8199){if(!_0x1c8199){_0x483e14[_0x4509('0x1d')](0x194);}return _0x1c8199;};}function handleError(_0x4a7e68,_0x297156){_0x297156=_0x297156||0x1f4;return function(_0x226a19){logger[_0x4509('0x19')](_0x226a19[_0x4509('0x29')]);if(_0x226a19[_0x4509('0x2a')]){delete _0x226a19[_0x4509('0x2a')];}_0x4a7e68['status'](_0x297156)[_0x4509('0x2b')](_0x226a19);};}exports[_0x4509('0x2c')]=function(_0x17b4ed,_0x149c20){var _0x22d804={'include':[{'model':db[_0x4509('0x2d')],'as':_0x4509('0x2e')}]},_0x4c9e02={},_0x5cea6d={'count':0x0,'rows':[]};var _0x20710d=_[_0x4509('0x2f')](db[_0x4509('0x30')]['rawAttributes'],function(_0x239c0d){return{'name':_0x239c0d[_0x4509('0x31')],'type':_0x239c0d[_0x4509('0x32')][_0x4509('0x33')]};});_0x4c9e02['model']=_[_0x4509('0x2f')](_0x20710d,'name');_0x4c9e02[_0x4509('0x34')]=_[_0x4509('0x35')](_0x17b4ed[_0x4509('0x34')]);_0x4c9e02[_0x4509('0x36')]=_[_0x4509('0x37')](_0x4c9e02[_0x4509('0x38')],_0x4c9e02[_0x4509('0x34')]);_0x22d804['attributes']=_['intersection'](_0x4c9e02[_0x4509('0x38')],qs['fields'](_0x17b4ed[_0x4509('0x34')][_0x4509('0x39')]));_0x22d804[_0x4509('0x3a')]=_0x22d804[_0x4509('0x3a')][_0x4509('0x3b')]?_0x22d804[_0x4509('0x3a')]:_0x4c9e02['model'];if(!_0x17b4ed[_0x4509('0x34')][_0x4509('0x3c')]('nolimit')){_0x22d804['limit']=qs[_0x4509('0x23')](_0x17b4ed['query'][_0x4509('0x23')]);_0x22d804[_0x4509('0x21')]=qs[_0x4509('0x21')](_0x17b4ed[_0x4509('0x34')][_0x4509('0x21')]);}_0x22d804[_0x4509('0x3d')]=qs[_0x4509('0x3e')](_0x17b4ed['query'][_0x4509('0x3e')]);_0x22d804[_0x4509('0x3f')]=qs[_0x4509('0x36')](_['pick'](_0x17b4ed[_0x4509('0x34')],_0x4c9e02[_0x4509('0x36')]),_0x20710d);if(_0x17b4ed[_0x4509('0x34')][_0x4509('0x40')]){_0x22d804[_0x4509('0x3f')]=_[_0x4509('0x41')](_0x22d804[_0x4509('0x3f')],{'$or':_[_0x4509('0x2f')](_0x20710d,function(_0x1e0d15){if(_0x1e0d15[_0x4509('0x32')]!==_0x4509('0x42')){var _0x2a9e94={};_0x2a9e94[_0x1e0d15[_0x4509('0x2a')]]={'$like':'%'+_0x17b4ed[_0x4509('0x34')][_0x4509('0x40')]+'%'};return _0x2a9e94;}})});}_0x22d804=_[_0x4509('0x41')]({},_0x22d804,_0x17b4ed[_0x4509('0x43')]);var _0x4e2b66={'where':_0x22d804['where']};return db[_0x4509('0x30')][_0x4509('0x24')](_0x4e2b66)[_0x4509('0x12')](function(_0x355a81){_0x5cea6d[_0x4509('0x24')]=_0x355a81;if(_0x17b4ed['query'][_0x4509('0x44')]){_0x22d804[_0x4509('0x45')]=[{'all':!![]}];}return db[_0x4509('0x30')]['findAll'](_0x22d804);})[_0x4509('0x12')](function(_0x323b1f){_0x5cea6d['rows']=_0x323b1f;return _0x5cea6d;})[_0x4509('0x12')](respondWithFilteredResult(_0x149c20,_0x22d804))[_0x4509('0x1c')](handleError(_0x149c20,null));};exports['show']=function(_0x293838,_0x58e09b){var _0x5a3e4c={'raw':![],'where':{'id':_0x293838[_0x4509('0x46')]['id']},'include':[{'model':db[_0x4509('0x2d')],'as':_0x4509('0x2e')}]},_0x5478ae={};_0x5478ae[_0x4509('0x38')]=_[_0x4509('0x35')](db[_0x4509('0x30')][_0x4509('0x47')]);_0x5478ae['query']=_[_0x4509('0x35')](_0x293838[_0x4509('0x34')]);_0x5478ae[_0x4509('0x36')]=_['intersection'](_0x5478ae['model'],_0x5478ae['query']);_0x5a3e4c[_0x4509('0x3a')]=_[_0x4509('0x37')](_0x5478ae[_0x4509('0x38')],qs['fields'](_0x293838['query']['fields']));_0x5a3e4c['attributes']=_0x5a3e4c[_0x4509('0x3a')][_0x4509('0x3b')]?_0x5a3e4c[_0x4509('0x3a')]:_0x5478ae[_0x4509('0x38')];if(_0x293838['query'][_0x4509('0x44')]){_0x5a3e4c[_0x4509('0x45')]=[{'all':!![]}];}_0x5a3e4c=_['merge']({},_0x5a3e4c,_0x293838[_0x4509('0x43')]);return db[_0x4509('0x30')][_0x4509('0x48')](_0x5a3e4c)[_0x4509('0x12')](handleEntityNotFound(_0x58e09b,null))['then'](respondWithResult(_0x58e09b,null))[_0x4509('0x1c')](handleError(_0x58e09b,null));};exports[_0x4509('0x49')]=function(_0x15903b,_0x4df6a5){return db[_0x4509('0x30')][_0x4509('0x49')](_0x15903b[_0x4509('0x4a')],{})[_0x4509('0x12')](function(_0x3e0a4d){var _0x57ebe1=_0x15903b[_0x4509('0x4b')][_0x4509('0x4c')]({'plain':!![]});if(!_0x57ebe1)throw new Error(_0x4509('0x4d'));if(_0x57ebe1['role']==='user'){var _0x3cb171=_0x3e0a4d[_0x4509('0x4c')]({'plain':!![]});var _0x459c87=_0x4509('0x28');return db[_0x4509('0x4e')][_0x4509('0x48')]({'where':{'name':_0x459c87,'userProfileId':_0x57ebe1['userProfileId']},'raw':!![]})['then'](function(_0x3008a5){if(_0x3008a5&&_0x3008a5[_0x4509('0x4f')]===0x0){return db[_0x4509('0x50')][_0x4509('0x49')]({'name':_0x3cb171[_0x4509('0x2a')],'resourceId':_0x3cb171['id'],'type':_0x3008a5[_0x4509('0x2a')],'sectionId':_0x3008a5['id']},{})[_0x4509('0x12')](function(){return _0x3e0a4d;});}else{return _0x3e0a4d;}})['catch'](function(_0x485beb){logger['error'](_0x4509('0x51'),_0x485beb);throw _0x485beb;});}return _0x3e0a4d;})[_0x4509('0x12')](respondWithResult(_0x4df6a5,0xc9))[_0x4509('0x1c')](handleError(_0x4df6a5,null));};exports[_0x4509('0x52')]=function(_0x279185,_0x5f048a){if(_0x279185[_0x4509('0x4a')]['id']){delete _0x279185[_0x4509('0x4a')]['id'];}return db[_0x4509('0x30')]['find']({'where':{'id':_0x279185[_0x4509('0x46')]['id']},'include':[{'model':db[_0x4509('0x2d')],'as':_0x4509('0x2e')}]})[_0x4509('0x12')](handleEntityNotFound(_0x5f048a,null))[_0x4509('0x12')](saveUpdates(_0x279185['body'],null))['then'](respondWithResult(_0x5f048a,null))[_0x4509('0x1c')](handleError(_0x5f048a,null));};exports[_0x4509('0x27')]=function(_0x71c8f4,_0x16a47e){return db['ChatWebsite'][_0x4509('0x48')]({'where':{'id':_0x71c8f4[_0x4509('0x46')]['id']}})[_0x4509('0x12')](handleEntityNotFound(_0x16a47e,null))[_0x4509('0x12')](removeEntity(_0x16a47e,null))[_0x4509('0x1c')](handleError(_0x16a47e,null));};exports['describe']=function(_0x193cde,_0x1ad74a){return db[_0x4509('0x30')]['describe']()[_0x4509('0x12')](respondWithResult(_0x1ad74a,null))[_0x4509('0x1c')](handleError(_0x1ad74a,null));};exports['addDisposition']=function(_0x5245ab,_0x113aa2){if(_0x5245ab['body']['id']){delete _0x5245ab[_0x4509('0x4a')]['id'];}return db[_0x4509('0x30')][_0x4509('0x48')]({'where':{'id':_0x5245ab[_0x4509('0x46')]['id']}})['then'](handleEntityNotFound(_0x113aa2,null))[_0x4509('0x12')](function(_0x3770ed){if(_0x3770ed){_0x5245ab['body'][_0x4509('0x53')]=_0x3770ed['id'];return db['Disposition'][_0x4509('0x49')](_0x5245ab[_0x4509('0x4a')]);}})['then'](respondWithResult(_0x113aa2,null))[_0x4509('0x1c')](handleError(_0x113aa2,null));};exports['getDispositions']=function(_0x324b90,_0x2df8ae){var _0x1049d3={'raw':![],'where':{}};var _0x256225={};var _0x12c5b4={'count':0x0,'rows':[]};return db[_0x4509('0x30')][_0x4509('0x54')]({'where':{'id':_0x324b90[_0x4509('0x46')]['id']}})[_0x4509('0x12')](handleEntityNotFound(_0x2df8ae,null))[_0x4509('0x12')](function(_0x45e334){if(_0x45e334){_0x256225[_0x4509('0x38')]=_['keys'](db[_0x4509('0x55')][_0x4509('0x47')]);_0x256225[_0x4509('0x34')]=_[_0x4509('0x35')](_0x324b90[_0x4509('0x34')]);_0x256225['filters']=_[_0x4509('0x37')](_0x256225[_0x4509('0x38')],_0x256225['query']);_0x1049d3[_0x4509('0x3a')]=_['intersection'](_0x256225['model'],qs[_0x4509('0x39')](_0x324b90['query']['fields']));_0x1049d3['attributes']=_0x1049d3[_0x4509('0x3a')][_0x4509('0x3b')]?_0x1049d3['attributes']:_0x256225[_0x4509('0x38')];if(!_0x324b90['query'][_0x4509('0x3c')]('nolimit')){_0x1049d3[_0x4509('0x23')]=qs['limit'](_0x324b90[_0x4509('0x34')][_0x4509('0x23')]);_0x1049d3[_0x4509('0x21')]=qs['offset'](_0x324b90[_0x4509('0x34')][_0x4509('0x21')]);}_0x1049d3[_0x4509('0x3d')]=qs[_0x4509('0x3e')](_0x324b90[_0x4509('0x34')][_0x4509('0x3e')]);_0x1049d3[_0x4509('0x3f')]=qs[_0x4509('0x36')](_[_0x4509('0x56')](_0x324b90[_0x4509('0x34')],_0x256225[_0x4509('0x36')]));_0x1049d3[_0x4509('0x3f')][_0x4509('0x53')]=_0x45e334['id'];if(_0x324b90[_0x4509('0x34')][_0x4509('0x40')]){_0x1049d3[_0x4509('0x3f')]=_[_0x4509('0x41')](_0x1049d3[_0x4509('0x3f')],{'$or':_[_0x4509('0x2f')](_0x1049d3[_0x4509('0x3a')],function(_0x16eabc){var _0x5156f6={};_0x5156f6[_0x16eabc]={'$like':'%'+_0x324b90['query'][_0x4509('0x40')]+'%'};return _0x5156f6;})});}_0x1049d3=_[_0x4509('0x41')]({},_0x1049d3,_0x324b90['options']);return db[_0x4509('0x55')][_0x4509('0x24')]({'where':_0x1049d3[_0x4509('0x3f')]})[_0x4509('0x12')](function(_0x4cb042){_0x12c5b4[_0x4509('0x24')]=_0x4cb042;if(_0x324b90['query']['includeAll']){_0x1049d3['include']=[{'all':!![]}];}return db[_0x4509('0x55')][_0x4509('0x57')](_0x1049d3);})[_0x4509('0x12')](function(_0x3583e0){_0x12c5b4[_0x4509('0x58')]=_0x3583e0;return _0x12c5b4;});}})[_0x4509('0x12')](respondWithFilteredResult(_0x2df8ae,_0x1049d3))[_0x4509('0x1c')](handleError(_0x2df8ae,null));};exports['removeDispositions']=function(_0x1d2f05,_0x4deeea){return db[_0x4509('0x30')]['find']({'where':{'id':_0x1d2f05[_0x4509('0x46')]['id']}})[_0x4509('0x12')](handleEntityNotFound(_0x4deeea,null))[_0x4509('0x12')](function(_0x26a641){if(_0x26a641){return _0x26a641[_0x4509('0x59')](_0x1d2f05['query'][_0x4509('0x5a')]);}})[_0x4509('0x12')](respondWithStatusCode(_0x4deeea,null))[_0x4509('0x1c')](handleError(_0x4deeea,null));};exports[_0x4509('0x5b')]=function(_0x2335d4,_0x1bacd4){if(_0x2335d4[_0x4509('0x4a')]['id']){delete _0x2335d4[_0x4509('0x4a')]['id'];}return db[_0x4509('0x30')]['find']({'where':{'id':_0x2335d4['params']['id']}})[_0x4509('0x12')](handleEntityNotFound(_0x1bacd4,null))[_0x4509('0x12')](function(_0xd95974){if(_0xd95974){_0x2335d4[_0x4509('0x4a')]['ChatWebsiteId']=_0xd95974['id'];return db[_0x4509('0x5c')]['create'](_0x2335d4['body']);}})['then'](respondWithResult(_0x1bacd4,null))[_0x4509('0x1c')](handleError(_0x1bacd4,null));};exports[_0x4509('0x5d')]=function(_0x894a07,_0x4b4e6f){var _0x4ac334={'raw':![],'where':{}};var _0x22796c={};var _0x4624fa={'count':0x0,'rows':[]};return db[_0x4509('0x30')][_0x4509('0x54')]({'where':{'id':_0x894a07['params']['id']}})['then'](handleEntityNotFound(_0x4b4e6f,null))[_0x4509('0x12')](function(_0x1ce4bd){if(_0x1ce4bd){_0x22796c[_0x4509('0x38')]=_['keys'](db[_0x4509('0x5c')][_0x4509('0x47')]);_0x22796c[_0x4509('0x34')]=_[_0x4509('0x35')](_0x894a07[_0x4509('0x34')]);_0x22796c['filters']=_['intersection'](_0x22796c[_0x4509('0x38')],_0x22796c[_0x4509('0x34')]);_0x4ac334[_0x4509('0x3a')]=_[_0x4509('0x37')](_0x22796c[_0x4509('0x38')],qs[_0x4509('0x39')](_0x894a07['query'][_0x4509('0x39')]));_0x4ac334[_0x4509('0x3a')]=_0x4ac334[_0x4509('0x3a')]['length']?_0x4ac334[_0x4509('0x3a')]:_0x22796c['model'];if(!_0x894a07[_0x4509('0x34')]['hasOwnProperty'](_0x4509('0x5e'))){_0x4ac334[_0x4509('0x23')]=qs[_0x4509('0x23')](_0x894a07[_0x4509('0x34')][_0x4509('0x23')]);_0x4ac334[_0x4509('0x21')]=qs[_0x4509('0x21')](_0x894a07[_0x4509('0x34')]['offset']);}_0x4ac334['order']=qs[_0x4509('0x3e')](_0x894a07[_0x4509('0x34')][_0x4509('0x3e')]);_0x4ac334[_0x4509('0x3f')]=qs['filters'](_[_0x4509('0x56')](_0x894a07[_0x4509('0x34')],_0x22796c[_0x4509('0x36')]));_0x4ac334[_0x4509('0x3f')][_0x4509('0x53')]=_0x1ce4bd['id'];if(_0x894a07[_0x4509('0x34')][_0x4509('0x40')]){_0x4ac334[_0x4509('0x3f')]=_['merge'](_0x4ac334[_0x4509('0x3f')],{'$or':_[_0x4509('0x2f')](_0x4ac334[_0x4509('0x3a')],function(_0x4b3b72){var _0x1e849a={};_0x1e849a[_0x4b3b72]={'$like':'%'+_0x894a07[_0x4509('0x34')][_0x4509('0x40')]+'%'};return _0x1e849a;})});}_0x4ac334=_[_0x4509('0x41')]({},_0x4ac334,_0x894a07[_0x4509('0x43')]);return db['CannedAnswer'][_0x4509('0x24')]({'where':_0x4ac334[_0x4509('0x3f')]})[_0x4509('0x12')](function(_0x5c0df7){_0x4624fa['count']=_0x5c0df7;if(_0x894a07[_0x4509('0x34')][_0x4509('0x44')]){_0x4ac334[_0x4509('0x45')]=[{'all':!![]}];}return db[_0x4509('0x5c')][_0x4509('0x57')](_0x4ac334);})[_0x4509('0x12')](function(_0x3447f7){_0x4624fa[_0x4509('0x58')]=_0x3447f7;return _0x4624fa;});}})[_0x4509('0x12')](respondWithFilteredResult(_0x4b4e6f,_0x4ac334))[_0x4509('0x1c')](handleError(_0x4b4e6f,null));};exports[_0x4509('0x5f')]=function(_0x5c933a,_0x22fa4e){return db['ChatWebsite']['find']({'where':{'id':_0x5c933a['params']['id']}})[_0x4509('0x12')](handleEntityNotFound(_0x22fa4e,null))[_0x4509('0x12')](function(_0xa637ab){if(_0xa637ab){return _0xa637ab['removeAnswers'](_0x5c933a[_0x4509('0x34')][_0x4509('0x5a')]);}})[_0x4509('0x12')](respondWithStatusCode(_0x22fa4e,null))[_0x4509('0x1c')](handleError(_0x22fa4e,null));};exports[_0x4509('0x60')]=function(_0x25468d,_0xc48585){_0x25468d[_0x4509('0x4a')][_0x4509('0x61')]=_0x25468d[_0x4509('0x62')]['filename'];return db[_0x4509('0x30')][_0x4509('0x48')]({'where':{'id':_0x25468d['params']['id']}})[_0x4509('0x12')](handleEntityNotFound(_0xc48585,null))[_0x4509('0x12')](saveUpdates(_0x25468d[_0x4509('0x4a')],null))['then'](respondWithResult(_0xc48585,null))['catch'](handleError(_0xc48585,null));};exports[_0x4509('0x63')]=function(_0xbc3832,_0x22ec55){_0xbc3832['body'][_0x4509('0x64')]=_0xbc3832['file'][_0x4509('0x65')];return db[_0x4509('0x30')][_0x4509('0x48')]({'where':{'id':_0xbc3832[_0x4509('0x46')]['id']}})['then'](handleEntityNotFound(_0x22ec55,null))[_0x4509('0x12')](saveUpdates(_0xbc3832[_0x4509('0x4a')],null))[_0x4509('0x12')](respondWithResult(_0x22ec55,null))['catch'](handleError(_0x22ec55,null));};exports[_0x4509('0x66')]=function(_0x580a74,_0x52113d){_0x580a74['body'][_0x4509('0x67')]=_0x580a74[_0x4509('0x62')][_0x4509('0x65')];return db[_0x4509('0x30')][_0x4509('0x48')]({'where':{'id':_0x580a74[_0x4509('0x46')]['id']}})[_0x4509('0x12')](handleEntityNotFound(_0x52113d,null))[_0x4509('0x12')](saveUpdates(_0x580a74[_0x4509('0x4a')],null))[_0x4509('0x12')](respondWithResult(_0x52113d,null))[_0x4509('0x1c')](handleError(_0x52113d,null));};exports[_0x4509('0x68')]=function(_0x1d3c6a,_0x1ffb8b){_0x1d3c6a[_0x4509('0x4a')][_0x4509('0x69')]=_0x1d3c6a[_0x4509('0x62')]['filename'];return db['ChatWebsite'][_0x4509('0x48')]({'where':{'id':_0x1d3c6a[_0x4509('0x46')]['id']}})[_0x4509('0x12')](handleEntityNotFound(_0x1ffb8b,null))[_0x4509('0x12')](saveUpdates(_0x1d3c6a[_0x4509('0x4a')],null))[_0x4509('0x12')](respondWithResult(_0x1ffb8b,null))['catch'](handleError(_0x1ffb8b,null));};exports[_0x4509('0x6a')]=function(_0x394bb9,_0x3a9639){var _0x4607fb=path[_0x4509('0x6b')](config[_0x4509('0x6c')],_0x4509('0x6d'));var _0xe66c62={'where':{'id':_0x394bb9[_0x4509('0x46')]['id']},'attributes':['id',_0x4509('0x61')],'raw':!![]};var _0x22d1fc=![];return require(_0x4509('0x6e'))[_0x4509('0x6f')]()[_0x4509('0x12')](function(_0x1a67ec){if(_0x1a67ec){_0x22d1fc=_0x1a67ec[_0x4509('0x70')];}})['then'](function(){return db[_0x4509('0x30')][_0x4509('0x48')](_0xe66c62);})['then'](handleEntityNotFound(_0x3a9639,null))['then'](function(_0x34edd6){if(_0x34edd6){if(!_['isNil'](_0x34edd6[_0x4509('0x61')])){if(fs[_0x4509('0x71')](path[_0x4509('0x6b')](config[_0x4509('0x6c')],'server/files/images/logos/',_0x34edd6[_0x4509('0x61')]))&&_0x22d1fc){_0x4607fb=path[_0x4509('0x6b')](config[_0x4509('0x6c')],_0x4509('0x72'),_0x34edd6[_0x4509('0x61')]);}}return _0x3a9639[_0x4509('0x73')](_0x4607fb);}})[_0x4509('0x1c')](handleError(_0x3a9639,null));};exports[_0x4509('0x74')]=function(_0x4ca277,_0x5037cb){var _0x648f7=path[_0x4509('0x6b')](config['root'],'server/files/images/avatars/default_avatar.png');var _0x1fe02c={'where':{'id':_0x4ca277[_0x4509('0x46')]['id']},'attributes':['id',_0x4509('0x64')],'raw':!![]};return db[_0x4509('0x30')]['find'](_0x1fe02c)['then'](handleEntityNotFound(_0x5037cb,null))[_0x4509('0x12')](function(_0x3f0b53){if(_0x3f0b53){if(!_[_0x4509('0x75')](_0x3f0b53['agentAvatar'])){if(fs[_0x4509('0x71')](path[_0x4509('0x6b')](config[_0x4509('0x6c')],_0x4509('0x76'),_0x3f0b53[_0x4509('0x64')]))){_0x648f7=path['join'](config['root'],_0x4509('0x76'),_0x3f0b53[_0x4509('0x64')]);}}return _0x5037cb[_0x4509('0x73')](_0x648f7);}})[_0x4509('0x1c')](handleError(_0x5037cb,null));};exports['getCustomerAvatar']=function(_0x55ee86,_0x194055){var _0x216bd4=path[_0x4509('0x6b')](config[_0x4509('0x6c')],'server/files/images/avatars/customer_avatar.png');var _0x45949c={'where':{'id':_0x55ee86[_0x4509('0x46')]['id']},'attributes':['id','customerAvatar',_0x4509('0x77')],'raw':!![]};return db[_0x4509('0x30')]['find'](_0x45949c)[_0x4509('0x12')](handleEntityNotFound(_0x194055,null))['then'](function(_0x2e49ca){if(_0x2e49ca){if(!_['isNil'](_0x2e49ca[_0x4509('0x67')])){if(fs['existsSync'](path[_0x4509('0x6b')](config[_0x4509('0x6c')],_0x4509('0x76'),_0x2e49ca['customerAvatar']))&&_0x2e49ca[_0x4509('0x77')]){_0x216bd4=path[_0x4509('0x6b')](config[_0x4509('0x6c')],_0x4509('0x76'),_0x2e49ca[_0x4509('0x67')]);}}return _0x194055['download'](_0x216bd4);}})[_0x4509('0x1c')](handleError(_0x194055,null));};exports['getSystemAvatar']=function(_0x2b6e1b,_0x131c0f){var _0x3f47b7=path[_0x4509('0x6b')](config[_0x4509('0x6c')],_0x4509('0x78'));var _0x574534={'where':{'id':_0x2b6e1b['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x4509('0x30')][_0x4509('0x48')](_0x574534)[_0x4509('0x12')](handleEntityNotFound(_0x131c0f,null))[_0x4509('0x12')](function(_0x3ba4e7){if(_0x3ba4e7){if(!_[_0x4509('0x75')](_0x3ba4e7[_0x4509('0x69')])){if(fs[_0x4509('0x71')](path[_0x4509('0x6b')](config[_0x4509('0x6c')],_0x4509('0x76'),_0x3ba4e7['systemAvatar']))){_0x3f47b7=path[_0x4509('0x6b')](config[_0x4509('0x6c')],_0x4509('0x76'),_0x3ba4e7['systemAvatar']);}}return _0x131c0f[_0x4509('0x73')](_0x3f47b7);}})['catch'](handleError(_0x131c0f,null));};exports[_0x4509('0x79')]=function(_0x2ec3aa,_0x3bd40c){var _0x527009=require(_0x4509('0x7a'));var _0x4f7012=new _0x527009();var _0x4498df=_0x4f7012[_0x4509('0x7b')](_0x2ec3aa[_0x4509('0x7c')][_0x4509('0x7d')])[_0x4509('0x7e')]();var _0x17c4d3={'body':_0x2ec3aa['body'],'channel':_0x4509('0x7f')};var _0x65f397=[];var _0x115e9b=[];var _0x12a4bc={};var _0x2cb730=![];return db['CmContact']['describe']()[_0x4509('0x12')](function(_0xcf49ee){if(!_0xcf49ee){throw new db['Sequelize'][(_0x4509('0x80'))]('no\x20available\x20attributes');}_0x65f397=_[_0x4509('0x81')](_[_0x4509('0x35')](_0xcf49ee),['createdAt',_0x4509('0x82')]);_0x115e9b=_[_0x4509('0x81')](_['keys'](_0xcf49ee),['createdAt',_0x4509('0x82'),_0x4509('0x83'),_0x4509('0x84')]);if(_0x2ec3aa['body']['id']){delete _0x2ec3aa[_0x4509('0x4a')]['id'];}if(_[_0x4509('0x75')](_0x2ec3aa[_0x4509('0x4a')]['from'])){throw new db[(_0x4509('0x85'))]['ValidationError'](_0x4509('0x86'));}if(_['isNil'](_0x2ec3aa['body'][_0x4509('0x4a')])||_0x2ec3aa[_0x4509('0x4a')]['body']===''){throw new db[(_0x4509('0x85'))][(_0x4509('0x80'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x4509('0x75')](_0x2ec3aa['body'][_0x4509('0x87')])){throw new db['Sequelize']['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x115e9b);}if(!_[_0x4509('0x88')](_0x115e9b,_0x2ec3aa[_0x4509('0x4a')]['mapKey'])){throw new db['Sequelize'][(_0x4509('0x80'))](_0x4509('0x89')+_0x115e9b);}_0x12a4bc[_0x2ec3aa[_0x4509('0x4a')][_0x4509('0x87')]]=_0x2ec3aa['body'][_0x4509('0x8a')];})[_0x4509('0x12')](function(){return db[_0x4509('0x30')][_0x4509('0x48')]({'where':{'id':_0x2ec3aa[_0x4509('0x46')]['id']},'include':[{'model':db[_0x4509('0x8b')],'as':_0x4509('0x8c'),'include':[{'model':db[_0x4509('0x8d')],'as':_0x4509('0x8e'),'where':_0x12a4bc,'limit':0x1,'order':[[_0x4509('0x82'),'DESC']]}]},{'model':db[_0x4509('0x8f')],'as':'Applications'}]});})[_0x4509('0x12')](handleEntityNotFound(_0x3bd40c,null))[_0x4509('0x12')](function(_0xf562cf){if(_0xf562cf&&_0xf562cf[_0x4509('0x8c')]){_0x17c4d3[_0x4509('0x90')]=_0xf562cf;_0x17c4d3['applications']=_0xf562cf[_0x4509('0x91')];_0x17c4d3[_0x4509('0x92')]=_0xf562cf[_0x4509('0x8c')];_0x17c4d3[_0x4509('0x93')]=_[_0x4509('0x94')](_0x17c4d3[_0x4509('0x93')],[_0x4509('0x95')],[_0x4509('0x96')]);if(_0x17c4d3[_0x4509('0x90')][_0x4509('0x91')]){delete _0x17c4d3[_0x4509('0x90')][_0x4509('0x91')];}if(_0x17c4d3[_0x4509('0x90')][_0x4509('0x8c')]&&_0x17c4d3[_0x4509('0x90')][_0x4509('0x8c')][_0x4509('0x8e')]['length']){return _0x17c4d3[_0x4509('0x90')][_0x4509('0x8c')][_0x4509('0x8e')][0x0];}var _0x276079=_[_0x4509('0x97')](_0x2ec3aa[_0x4509('0x4a')],{'firstName':_0x2ec3aa[_0x4509('0x4a')][_0x4509('0x8a')],'ListId':_0xf562cf[_0x4509('0x84')]});_0x276079[_0x2ec3aa[_0x4509('0x4a')][_0x4509('0x87')]]=_0x2ec3aa['body'][_0x4509('0x8a')];return db[_0x4509('0x8d')][_0x4509('0x49')](_0x276079,{'fields':_0x65f397,'raw':!![]});}})[_0x4509('0x12')](handleEntityNotFound(_0x3bd40c,null))[_0x4509('0x12')](function(_0x3ca4e3){_0x17c4d3[_0x4509('0x98')]=_0x3ca4e3;var _0x197793=_0x2ec3aa[_0x4509('0x4a')][_0x4509('0x99')];if(_0x2ec3aa[_0x4509('0x7c')][_0x4509('0x9a')]){_0x197793=_0x2ec3aa[_0x4509('0x7c')][_0x4509('0x9a')];}else if(_0x2ec3aa['headers'][_0x4509('0x9b')]){_0x197793=_['first'](_0x2ec3aa[_0x4509('0x7c')][_0x4509('0x9b')][_0x4509('0x9c')](','));}if(_0x3ca4e3){var _0x5a5728={'ContactId':_0x3ca4e3['id'],'ChatWebsiteId':_0x2ec3aa['params']['id'],'from':(_0x3ca4e3[_0x4509('0x9d')]||'')+'\x20'+(_0x3ca4e3[_0x4509('0x9e')]||''),'customerIp':_0x197793,'customerPort':_0x2ec3aa[_0x4509('0x7c')]['x-real-port']?_0x2ec3aa[_0x4509('0x7c')][_0x4509('0x9f')]:null,'referer':_0x2ec3aa['body']['referer'],'browserName':_0x4498df[_0x4509('0xa0')][_0x4509('0x2a')]&&_0x4498df['browser'][_0x4509('0xa1')]?util[_0x4509('0xa2')](_0x4509('0xa3'),_0x4498df[_0x4509('0xa0')]['name'],_0x4498df[_0x4509('0xa0')][_0x4509('0xa1')]):_0x4509('0xa4'),'browserVersion':_0x4498df[_0x4509('0xa0')][_0x4509('0xa1')]||_0x4509('0xa4'),'osName':util[_0x4509('0xa2')](_0x4509('0xa3'),_0x4498df['os'][_0x4509('0x2a')],_0x4498df['os'][_0x4509('0xa1')]),'osVersion':_0x4498df['os'][_0x4509('0xa1')],'deviceModel':_0x4498df[_0x4509('0xa5')][_0x4509('0x38')]&&_0x4498df[_0x4509('0xa5')][_0x4509('0xa6')]?util['format'](_0x4509('0xa7'),_0x4498df['device']['model'],_0x4498df[_0x4509('0xa5')][_0x4509('0xa6')],_0x4498df['device'][_0x4509('0x32')]):null,'deviceVendor':_0x4498df[_0x4509('0xa5')][_0x4509('0xa6')],'deviceType':_0x4498df[_0x4509('0xa5')][_0x4509('0x32')],'formData':JSON[_0x4509('0x18')](_0x2ec3aa[_0x4509('0x4a')])};var _0x362305={'ChatWebsiteId':_0x2ec3aa[_0x4509('0x46')]['id'],'closed':![]};if(_0x2ec3aa['body']['threadId']){_0x362305[_0x4509('0xa8')]=_0x2ec3aa[_0x4509('0x4a')][_0x4509('0xa8')];return db[_0x4509('0xa9')][_0x4509('0x48')]({'where':_0x362305})[_0x4509('0x12')](function(_0x5b9cd7){if(_0x5b9cd7){return[_0x5b9cd7,![]];}_0x5a5728[_0x4509('0xa8')]=_0x2ec3aa[_0x4509('0x4a')][_0x4509('0xa8')];_0x5a5728[_0x4509('0xaa')]=_0x2ec3aa[_0x4509('0x4a')][_0x4509('0xaa')];return db['ChatInteraction'][_0x4509('0x49')](_0x5a5728)[_0x4509('0x12')](function(_0x1cd238){return[_0x1cd238,!![]];});});}_0x362305[_0x4509('0xab')]=_0x3ca4e3['id'];if(_0x2ec3aa[_0x4509('0x4a')][_0x4509('0xac')]&&_0x2ec3aa[_0x4509('0x4a')][_0x4509('0xac')]['id']){_0x362305['id']=_0x2ec3aa['body']['interaction']['id'];return db[_0x4509('0xa9')][_0x4509('0x48')]({'where':_0x362305})['then'](function(_0xb1ea97){if(_0xb1ea97){return[_0xb1ea97,![]];}return db[_0x4509('0xa9')][_0x4509('0x49')](_0x5a5728)[_0x4509('0x12')](function(_0x1232f6){return[_0x1232f6,!![]];});});}return db[_0x4509('0xa9')]['create'](_0x5a5728)['then'](function(_0xcdca42){return[_0xcdca42,!![]];});}})['spread'](function(_0x2a22ad,_0x3fc3d7){if(_0x2a22ad){_0x2cb730=_0x3fc3d7;if(!_0x3fc3d7){var _0x310f89={'from':(_0x17c4d3[_0x4509('0x98')][_0x4509('0x9d')]||'')+'\x20'+(_0x17c4d3['contact'][_0x4509('0x9e')]||'')};if(_0x2ec3aa[_0x4509('0x4a')][_0x4509('0xa8')]&&_0x2ec3aa[_0x4509('0x4a')]['messageId']&&_0x2ec3aa[_0x4509('0x4a')]['threadId']!=_0x2ec3aa['body'][_0x4509('0xad')]){_0x310f89[_0x4509('0xa8')]=_0x2ec3aa[_0x4509('0x4a')][_0x4509('0xad')];}return _0x2a22ad[_0x4509('0x52')](_0x310f89);}else{return _0x2a22ad;}}})['then'](function(_0x387eda){_0x17c4d3[_0x4509('0xac')]=_0x387eda[_0x4509('0x4c')]({'plain':!![]});_0x17c4d3[_0x4509('0xac')][_0x4509('0xae')]=_0x2cb730;if(_0x17c4d3[_0x4509('0xac')][_0x4509('0xae')]){if(_0x17c4d3[_0x4509('0x90')]['autoclose']){_0x17c4d3[_0x4509('0x93')][_0x4509('0xaf')]({'id':0x0,'priority':_0x17c4d3[_0x4509('0x93')]['length']+0x1,'app':_0x4509('0xb0'),'appdata':_0x4509('0xb1'),'interval':_0x4509('0xb2')});}}return db[_0x4509('0xb3')][_0x4509('0x49')]({'body':_0x2ec3aa[_0x4509('0x4a')][_0x4509('0x4a')],'ChatWebsiteId':_0x2ec3aa[_0x4509('0x46')]['id'],'ChatInteractionId':_0x387eda['id'],'direction':'in','ContactId':_0x17c4d3['contact']['id'],'AttachmentId':_0x2ec3aa['body'][_0x4509('0xb4')]});})[_0x4509('0x12')](function(_0x50efd7){_0x17c4d3[_0x4509('0x1a')]=_0x50efd7;if(_0x17c4d3[_0x4509('0xac')][_0x4509('0xb5')]){return db['User'][_0x4509('0x48')]({'attributes':['id','name'],'where':{'id':_0x17c4d3['interaction'][_0x4509('0xb5')]}})[_0x4509('0x12')](function(_0x4578fc){if(_0x4578fc){_0x17c4d3['applications'][_0x4509('0xb6')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4578fc[_0x4509('0x2a')]+','+(_0x17c4d3[_0x4509('0x90')][_0x4509('0xb7')]||0xa),'interval':_0x4509('0xb2')});_0x17c4d3[_0x4509('0xb8')]=!![];}return respondWithRpcPromise(_0x4509('0xb9'),_0x4509('0xba'),_0x17c4d3);});}return respondWithRpcPromise(_0x4509('0xb9'),_0x4509('0xba'),_0x17c4d3);})['then'](function(_0x5554e9){respondWithRpcPromise(_0x4509('0xbb'),_0x4509('0xbb'),{'event':'notify','message':_0x5554e9},client9002);return _0x5554e9;})['then'](respondWithResult(_0x3bd40c,null))['catch'](handleError(_0x3bd40c,null));};exports[_0x4509('0xbc')]=function(_0x43b4f6,_0x4ddcf5){var _0x33baa8,_0x2053d6,_0x56c2d4;var _0x8c244e=[];var _0x2244e5={};var _0xdd761e=_0x43b4f6[_0x4509('0xbd')]||[];var _0x3518a5=[];var _0x4ecc4e;return db[_0x4509('0x8d')][_0x4509('0xbe')]()[_0x4509('0x12')](function(_0xb8674c){if(!_0xb8674c){throw new db[(_0x4509('0x85'))]['ValidationError'](_0x4509('0xbf'));}_0x8c244e=_[_0x4509('0x81')](_[_0x4509('0x35')](_0xb8674c),[_0x4509('0xc0'),'updatedAt',_0x4509('0x83'),'ListId']);if(_0x43b4f6[_0x4509('0x4a')]['id']){delete _0x43b4f6['body']['id'];}if(_['isNil'](_0x43b4f6[_0x4509('0x4a')][_0x4509('0x8a')])){throw _0x4ddcf5[_0x4509('0x1e')](0x1f4)['send'](new db[(_0x4509('0x85'))][(_0x4509('0x80'))](_0x4509('0x86')));}if(_['isNil'](_0x43b4f6[_0x4509('0x4a')][_0x4509('0x4a')])||_0x43b4f6[_0x4509('0x4a')][_0x4509('0x4a')]===''){throw _0x4ddcf5[_0x4509('0x1e')](0x1f4)[_0x4509('0x2b')](new db[(_0x4509('0x85'))][(_0x4509('0x80'))](_0x4509('0xc1')));}if(_['isNil'](_0x43b4f6[_0x4509('0x4a')][_0x4509('0xc2')])){throw _0x4ddcf5[_0x4509('0x1e')](0x1f4)[_0x4509('0x2b')](new db['Sequelize']['ValidationError'](_0x4509('0xc3')+_0x8c244e));}if(!_[_0x4509('0x88')](_0x8c244e,_0x43b4f6[_0x4509('0x4a')][_0x4509('0xc2')])){throw _0x4ddcf5[_0x4509('0x1e')](0x1f4)[_0x4509('0x2b')](new db['Sequelize'][(_0x4509('0x80'))](_0x4509('0xc4')+_0x8c244e));}_0x2244e5[_0x43b4f6[_0x4509('0x4a')][_0x4509('0xc2')]]=_0x43b4f6[_0x4509('0x4a')][_0x4509('0x8a')];})[_0x4509('0x12')](function(){return db[_0x4509('0x30')][_0x4509('0x48')]({'where':{'id':_0x43b4f6[_0x4509('0x46')]['id']},'include':[{'model':db['CmList'],'as':_0x4509('0x8c')},{'model':db['MailAccount'],'as':_0x4509('0xc5')}]});})[_0x4509('0x12')](handleEntityNotFound(_0x4ddcf5,null))[_0x4509('0x12')](function(_0x5534a6){if(_0x5534a6&&_0x5534a6[_0x4509('0x8c')]){_0x2053d6=_0x5534a6;var _0x1f04c4=_[_0x4509('0x97')](_0x43b4f6[_0x4509('0x4a')],{'firstName':_0x43b4f6[_0x4509('0x4a')]['from'],'phone':_0x43b4f6[_0x4509('0x4a')][_0x4509('0x8a')],'ListId':_0x5534a6['ListId']});_0x1f04c4[_0x43b4f6[_0x4509('0x4a')][_0x4509('0xc2')]]=_0x43b4f6[_0x4509('0x4a')][_0x4509('0x8a')];return db['CmContact'][_0x4509('0xc6')]({'where':_0x2244e5,'defaults':_0x1f04c4});}})[_0x4509('0xc7')](function(_0xa4c70e){if(_0xa4c70e){_0x56c2d4=_0xa4c70e;var _0x39b71f=fs[_0x4509('0xc8')](path[_0x4509('0x6b')](config[_0x4509('0x6c')],_0x4509('0xc9')),'utf8');var _0xf809a0=ejs['render'](_0x39b71f,{'body':_['toPairs'](_0x43b4f6['body']['body']),'bodyTitle':_0x2053d6[_0x4509('0xca')]});return db[_0x4509('0xcb')][_0x4509('0x49')]({'body':_0xf809a0,'plainBody':htmlToText[_0x4509('0xcc')](_0xf809a0),'ContactId':_0xa4c70e['id'],'ChatWebsiteId':_0x2053d6['id']});}})['then'](function(_0x10ec5){_0x4ecc4e=_0x10ec5;if(_0xdd761e[_0x4509('0x3b')]){var _0x5cd3ec=_0xdd761e['map'](function(_0x5207f3){return{'name':_0x5207f3[_0x4509('0xcd')],'basename':_0x5207f3[_0x4509('0x65')],'type':_0x5207f3[_0x4509('0xce')],'ChatOfflineMessageId':_0x10ec5['id']};});_0x3518a5=_0x5cd3ec[_0x4509('0x2f')](_0x269776=>{var _0xc7d8a7={'filename':_0x269776[_0x4509('0x2a')],'path':path[_0x4509('0x6b')](config[_0x4509('0x6c')],_0x4509('0xcf'),'files','attachments',_0x4509('0xd0'),_0x269776[_0x4509('0xd1')])};return _0xc7d8a7;});if(!_0x2053d6[_0x4509('0xd2')]){return db[_0x4509('0xd3')]['transaction'](function(_0x3782af){return db[_0x4509('0xd4')]['bulkCreate'](_0x5cd3ec,{'transaction':_0x3782af});});}}})[_0x4509('0x12')](function(){if(_0x4ecc4e){_0x33baa8=_0x4ecc4e;return db[_0x4509('0xc5')][_0x4509('0x54')]({'where':{'service':!![]},'include':[{'model':db[_0x4509('0xd5')],'as':_0x4509('0xd6'),'raw':!![],'include':[{'model':db[_0x4509('0xd7')],'as':_0x4509('0xd7'),'raw':!![]}]}]});}})[_0x4509('0x12')](function(_0x26c197){if(_0x26c197&&_0x26c197[_0x4509('0xd6')]&&_0x2053d6['forwardOffline']&&_0x2053d6[_0x4509('0xd8')]){var _0xdaf082=_0x26c197[_0x4509('0xd9')]();return respondWithRpcPromise(_0x4509('0xda'),_0x4509('0xdb'),{'account':_0xdaf082,'message':{'from':util[_0x4509('0xa2')](_0x4509('0xdc'),_0x26c197[_0x4509('0x2a')],_0x26c197['email']||_0x26c197['Smtp'][_0x4509('0x4b')]),'to':_0x2053d6[_0x4509('0xd8')],'subject':_0x2053d6[_0x4509('0xdd')],'html':_0x33baa8[_0x4509('0x4a')],'attachments':_0x3518a5}},client9003)['then'](function(){return _0x33baa8;})['catch'](function(_0x485b99){logger['error'](_0x485b99);});}})[_0x4509('0x12')](function(){if(_0x2053d6&&_0x2053d6[_0x4509('0xd2')]&&_0x2053d6['MailAccountId']){var _0x56c13f=[];if(_0xdd761e[_0x4509('0x3b')]){_0x56c13f=_0xdd761e['map'](function(_0x3f2716){return{'name':_0x3f2716[_0x4509('0xcd')],'basename':_0x3f2716['filename'],'type':_0x3f2716[_0x4509('0xce')],'ChatOfflineMessageId':_0x4ecc4e['id']};});}var _0x1fce96;if(!_[_0x4509('0x75')](_0x2053d6['subjectOffline'])){var _0x3293d6=_[_0x4509('0x2f')](_0x43b4f6['body'],function(_0x6894d7){return _0x6894d7;});var _0xa1cbe9=_['toPairsIn'](_0x3293d6)[0x0];var _0x4dd00f=_[_0x4509('0xde')](_0xa1cbe9,function(_0x2b39d3){return _0x2b39d3;});_0x1fce96=_0x4dd00f[0x1][_0x2053d6[_0x4509('0xdf')]];}var _0x24bffc={'from':_0x56c2d4['email'],'firstName':_0x56c2d4[_0x4509('0x9d')],'lastName':_0x56c2d4[_0x4509('0x9e')],'mapKey':_0x4509('0xe0'),'message':{'from':_0x56c2d4['email'],'to':_0x2053d6[_0x4509('0xc5')][_0x4509('0xe0')],'cc':'','subject':_['isNil'](_0x1fce96)?_0x2053d6['offlineMessageSubject']:_0x1fce96,'messageId':'','sentAt':new Date(),'attach':_0x56c13f[_0x4509('0x3b')],'attachments':_0x56c13f,'originChannel':'Chat','ChatWebsiteId':_0x2053d6['id'],'ChatOfflineMessageId':_0x33baa8['id'],'originTo':_0x2053d6[_0x4509('0xc5')]['email']},'body':_0x33baa8[_0x4509('0x4a')]};var _0x596aa2={'account':{'id':_0x2053d6['MailAccountId']},'body':_0x24bffc,'log':_0x4509('0xe1')};return respondWithRpcPromise('NotifyMailAccount',_0x4509('0xe2'),_0x596aa2,client9001)[_0x4509('0x12')](function(){return _0x33baa8;})['catch'](function(_0x1801b6){logger['error'](_0x1801b6);});}return;})[_0x4509('0x12')](function(){if(_0x33baa8){return _0x33baa8;}})[_0x4509('0x12')](respondWithResult(_0x4ddcf5,null))['catch'](function(_0x463ce3){logger[_0x4509('0x19')](_0x4509('0x1c'),_0x463ce3);for(var _0x3d9d50 of _0xdd761e){var _0x23478a=path[_0x4509('0x6b')](config[_0x4509('0x6c')],_0x4509('0xcf'),_0x4509('0xbd'),_0x4509('0xe3'),_0x4509('0xd0'),_0x3d9d50[_0x4509('0x65')]);fs_extra[_0x4509('0xe4')](_0x23478a)[_0x4509('0x1c')](function(_0x45bc96){logger['error'](_0x4509('0xe5'),_0x23478a,_0x45bc96);});}});};exports[_0x4509('0xe6')]=function(_0x4a9a63,_0x11f187){return db[_0x4509('0xa9')]['find']({'where':{'id':_0x4a9a63[_0x4509('0x46')]['id']}})[_0x4509('0x12')](handleEntityNotFound(_0x11f187,null))[_0x4509('0x12')](function(_0x599f85){if(_0x599f85){return _0x599f85[_0x4509('0xe6')](_0x4a9a63[_0x4509('0x4a')][_0x4509('0x5a')],_[_0x4509('0xe7')](_0x4a9a63[_0x4509('0x4a')],[_0x4509('0x5a'),'id'])||{});}})['then'](respondWithResult(_0x11f187,null))[_0x4509('0x1c')](handleError(_0x11f187,null));};exports[_0x4509('0xe8')]=function(_0x52c9e9,_0x2a22e8){var _0x4cd1f6={'raw':![],'where':{}};var _0x4fd52d={};var _0x55952b={'count':0x0,'rows':[]};return db[_0x4509('0x30')][_0x4509('0x54')]({'where':{'id':_0x52c9e9[_0x4509('0x46')]['id']}})[_0x4509('0x12')](handleEntityNotFound(_0x2a22e8,null))['then'](function(_0x47c8f5){if(_0x47c8f5){_0x4fd52d[_0x4509('0x38')]=_[_0x4509('0x35')](db['ChatInteraction'][_0x4509('0x47')]);_0x4fd52d[_0x4509('0x34')]=_[_0x4509('0x35')](_0x52c9e9[_0x4509('0x34')]);_0x4fd52d[_0x4509('0x36')]=_[_0x4509('0x37')](_0x4fd52d[_0x4509('0x38')],_0x4fd52d[_0x4509('0x34')]);_0x4cd1f6['attributes']=_['intersection'](_0x4fd52d[_0x4509('0x38')],qs[_0x4509('0x39')](_0x52c9e9[_0x4509('0x34')]['fields']));_0x4cd1f6['attributes']=_0x4cd1f6[_0x4509('0x3a')][_0x4509('0x3b')]?_0x4cd1f6[_0x4509('0x3a')]:_0x4fd52d[_0x4509('0x38')];if(!_0x52c9e9[_0x4509('0x34')][_0x4509('0x3c')](_0x4509('0x5e'))){_0x4cd1f6[_0x4509('0x23')]=qs[_0x4509('0x23')](_0x52c9e9[_0x4509('0x34')]['limit']);_0x4cd1f6['offset']=qs['offset'](_0x52c9e9['query'][_0x4509('0x21')]);}_0x4cd1f6[_0x4509('0x3d')]=qs['sort'](_0x52c9e9[_0x4509('0x34')][_0x4509('0x3e')]);_0x4cd1f6[_0x4509('0x3f')]=qs[_0x4509('0x36')](_[_0x4509('0x56')](_0x52c9e9[_0x4509('0x34')],_0x4fd52d[_0x4509('0x36')]));_0x4cd1f6[_0x4509('0x3f')][_0x4509('0x53')]=_0x47c8f5['id'];if(_0x52c9e9[_0x4509('0x34')][_0x4509('0x40')]){_0x4cd1f6[_0x4509('0x3f')]=_[_0x4509('0x41')](_0x4cd1f6['where'],{'$or':_[_0x4509('0x2f')](_0x4cd1f6['attributes'],function(_0xc22c63){var _0x295a87={};_0x295a87[_0xc22c63]={'$like':'%'+_0x52c9e9['query'][_0x4509('0x40')]+'%'};return _0x295a87;})});}_0x4cd1f6=_[_0x4509('0x41')]({},_0x4cd1f6,_0x52c9e9[_0x4509('0x43')]);return db[_0x4509('0xa9')]['count']({'where':_0x4cd1f6[_0x4509('0x3f')]})[_0x4509('0x12')](function(_0xa2a94c){_0x55952b[_0x4509('0x24')]=_0xa2a94c;if(_0x52c9e9['query'][_0x4509('0x44')]){_0x4cd1f6[_0x4509('0x45')]=[{'model':db[_0x4509('0x8d')],'as':_0x4509('0xe9'),'required':![]},{'model':db[_0x4509('0xea')],'as':_0x4509('0xeb'),'attributes':[_0x4509('0x2a'),_0x4509('0xec'),_0x4509('0xed')],'required':![]},{'model':db[_0x4509('0xee')],'as':_0x4509('0xef'),'attributes':['id',_0x4509('0x2a'),'color'],'where':_0x52c9e9['query'][_0x4509('0xf0')]?{'id':_0x52c9e9['query'][_0x4509('0xf0')]}:undefined,'required':_0x52c9e9[_0x4509('0x34')][_0x4509('0xf0')]?!![]:![]}];}return db[_0x4509('0xa9')][_0x4509('0x57')](_0x4cd1f6);})[_0x4509('0x12')](function(_0x2c74bf){_0x55952b[_0x4509('0x58')]=_0x2c74bf;return _0x55952b;});}})[_0x4509('0x12')](respondWithFilteredResult(_0x2a22e8,_0x4cd1f6))['catch'](handleError(_0x2a22e8,null));};function iftimePromise(_0x21662d,_0x227840){return respondWithRpcPromise(_0x4509('0xf1'),_0x4509('0xf2'),{'command':_0x227840[_0x4509('0xf3')]?util[_0x4509('0xa2')]('iftime\x20%s,%s',_0x21662d[_0x4509('0xf4')],_0x227840[_0x4509('0xf3')]):util[_0x4509('0xa2')](_0x4509('0xf5'),_0x21662d[_0x4509('0xf4')])},client9002)[_0x4509('0x12')](function(_0x398518){var _0x1c2d41=_0x398518&&_0x398518['indexOf'](_0x4509('0xf6'))>=0x0?!![]:![];logger['info']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x227840['id'],_0x21662d['id'],_0x21662d[_0x4509('0xf4')],_0x1c2d41?'ONLINE':_0x4509('0xf7'),_0x227840['timezone']?_0x227840[_0x4509('0xf3')]:_0x4509('0xf8'));return _0x1c2d41;})[_0x4509('0x1c')](function(_0x17b1e7){logger['error'](_0x4509('0xf9'),_0x227840['id'],_0x21662d['id'],_0x21662d[_0x4509('0xf4')],util[_0x4509('0xfa')](_0x17b1e7,{'showHidden':![],'depth':null}),_0x227840[_0x4509('0xf3')]?_0x227840[_0x4509('0xf3')]:_0x4509('0xf8'));return![];});}exports[_0x4509('0xf2')]=function(_0x55f501,_0x13918a){var _0xa1ad6e=0x0;var _0x1db593=0x0;var _0x5a240c=![];var _0x3aa23e;var _0x2f0d75;return db[_0x4509('0x30')][_0x4509('0x48')]({'where':{'id':_0x55f501[_0x4509('0x46')]['id']},'include':[{'model':db[_0x4509('0xfb')],'as':_0x4509('0xfb'),'include':[{'model':db[_0x4509('0xfb')],'as':_0x4509('0xfc'),'attributes':['id',_0x4509('0xf4')],'raw':!![]}]}]})[_0x4509('0x12')](handleEntityNotFound(_0x13918a,null))[_0x4509('0x12')](function(_0x386b8e){if(_0x386b8e){_0x3aa23e=_0x386b8e;return _0x386b8e[_0x4509('0xfd')]({'raw':!![]});}})[_0x4509('0x12')](function(_0x341f72){if(_0x3aa23e){if(_0x341f72){_0x2f0d75=_0x341f72;}}return require('../../config/license/util')[_0x4509('0x6f')]();})['then'](function(_0x5dd638){if(_0x5dd638){_0x1db593=_0x5dd638[_0x4509('0xfe')];_0x5a240c=_0x5dd638['custom'];}})[_0x4509('0x12')](function(){return db[_0x4509('0xa9')][_0x4509('0x24')]({'where':{'closed':![]}});})[_0x4509('0x12')](function(_0x2746be){_0xa1ad6e=_0x2746be;if(_0x1db593&&_0x2746be>_0x1db593){return db[_0x4509('0xff')][_0x4509('0x54')]({'where':{'id':0x1}})[_0x4509('0x12')](function(_0x2f9312){if(_0x2f9312){_0x2f9312[_0x4509('0x100')](_0x4509('0x101'));}});}})[_0x4509('0x12')](function(){if(_0x3aa23e[_0x4509('0xfb')]&&_0x3aa23e['Interval']['Intervals']){var _0x36cc29=[];for(var _0x14dfa4=0x0;_0x14dfa4<_0x3aa23e[_0x4509('0xfb')][_0x4509('0xfc')][_0x4509('0x3b')];_0x14dfa4++){var _0x3eae42=_0x3aa23e['Interval'][_0x4509('0xfc')][_0x14dfa4][_0x4509('0x4c')]({'plain':!![]});_0x36cc29[_0x4509('0xaf')](iftimePromise(_0x3eae42,_0x3aa23e));}return BPromise[_0x4509('0x102')](_0x36cc29)['then'](function(_0x5e5644){return _['some'](_0x5e5644);});}else{return!![];}})[_0x4509('0x12')](function(_0x1b8aaf){var _0x9a51=fs['readFileSync'](path['join'](config[_0x4509('0x6c')],_0x4509('0x103')),_0x4509('0x104'));var _0x4088ab={'remote':_0x3aa23e[_0x4509('0x105')],'query':querystring[_0x4509('0x18')](_[_0x4509('0x41')](_0x3aa23e[_0x4509('0x4c')]({'plain':!![]}),{'customerIp':_0x55f501[_0x4509('0x7c')][_0x4509('0x9b')]||_0x55f501[_0x4509('0x7c')][_0x4509('0x106')]||_0x55f501[_0x4509('0x107')]['remoteAddress']||_0x55f501['ip'],'referer':_0x55f501[_0x4509('0x7c')][_0x4509('0x108')],'openedInteractions':_0xa1ad6e,'maxInteractions':_0x1db593,'virtual':_0x5a240c[_0x4509('0xfe')],'online':_0x1b8aaf,'custom':_0x5a240c}))[_0x4509('0x109')](/'/g,'\x5c\x27')};_0x13918a[_0x4509('0x2b')](ejs[_0x4509('0x10a')](Mustache['render'](_0x9a51,_0x4088ab),{'proactiveActions':_0x2f0d75,'alignment':_0x3aa23e[_0x4509('0x10b')],'verticalAlignment':_0x3aa23e['verticalAlignment'],'div_color':_0x3aa23e[_0x4509('0x10c')],'labelText':_0x3aa23e[_0x4509('0x10d')],'text_color':_0x3aa23e['textColor'],'text_button_color':_0x3aa23e[_0x4509('0x10e')],'button_color':_0x3aa23e['color_button'],'background_color':_0x3aa23e['backgroundColor'],'hideWhenOffline':_0x3aa23e[_0x4509('0x10f')],'interval':_0x3aa23e[_0x4509('0x110')]}));})[_0x4509('0x1c')](handleError(_0x13918a,null));};exports[_0x4509('0x111')]=function(_0x1584f6,_0xeecc2c){var _0x39e96c=_0x1584f6['params']['id'];var _0x53fd56=_0x1584f6[_0x4509('0x4a')];var _0x1cde8f=0xc8;var _0x528426=null;return db[_0x4509('0xd3')][_0x4509('0x112')]({'isolationLevel':db[_0x4509('0xd3')][_0x4509('0x113')][_0x4509('0x114')]['READ_COMMITTED']},function(_0x538f95){return db['ChatWebsite']['findOne']({'where':{'id':_0x39e96c},'transaction':_0x538f95})[_0x4509('0x12')](function(_0x19af41){if(_0x19af41){return db['ChatApplication'][_0x4509('0x27')]({'where':{'ChatWebsiteId':_0x39e96c},'transaction':_0x538f95})[_0x4509('0x12')](function(){var _0x5d08d0=_[_0x4509('0x2f')](_0x53fd56,function(_0x39e10e){_0x39e10e[_0x4509('0x53')]=_0x39e96c;return _0x39e10e;});return db[_0x4509('0x8f')][_0x4509('0x115')](_0x5d08d0,{'transaction':_0x538f95});});}else{_0x1cde8f=0x194;_0x528426=[];}});})[_0x4509('0x12')](function(){if(_0x1cde8f!==0x194){return db[_0x4509('0x8f')][_0x4509('0x116')]({'where':{'ChatWebsiteId':_0x39e96c},'order':'priority'})['then'](function(_0x5657c8){_0x528426=_0x5657c8;});}})['catch'](function(_0x5fe592){_0x1cde8f=0x1f4;logger[_0x4509('0x19')](_0x5fe592[_0x4509('0x29')]);if(_0x5fe592[_0x4509('0x2a')]){delete _0x5fe592[_0x4509('0x2a')];}_0x528426=_0x5fe592;})[_0x4509('0x117')](function(){if(_0x528426===null){_0xeecc2c[_0x4509('0x1d')](_0x1cde8f);}else{if(_0x1cde8f===0x1f4){_0xeecc2c[_0x4509('0x1e')](_0x1cde8f)[_0x4509('0x2b')](_0x528426);}else{_0xeecc2c[_0x4509('0x1e')](_0x1cde8f)[_0x4509('0x20')](_0x528426);}}});};exports[_0x4509('0x118')]=function(_0x213b12,_0x2e0797){var _0x73605c={};var _0x34f554={};var _0x3e0490;var _0x2434f8;return db[_0x4509('0x30')][_0x4509('0x54')]({'where':{'id':_0x213b12[_0x4509('0x46')]['id']}})[_0x4509('0x12')](handleEntityNotFound(_0x2e0797,null))[_0x4509('0x12')](function(_0x2ae7cb){if(_0x2ae7cb){_0x3e0490=_0x2ae7cb;_0x34f554['model']=_['keys'](db[_0x4509('0x8f')][_0x4509('0x47')]);_0x34f554['query']=_['keys'](_0x213b12[_0x4509('0x34')]);_0x34f554[_0x4509('0x36')]=_[_0x4509('0x37')](_0x34f554['model'],_0x34f554['query']);_0x73605c[_0x4509('0x3a')]=_['intersection'](_0x34f554[_0x4509('0x38')],qs['fields'](_0x213b12[_0x4509('0x34')][_0x4509('0x39')]));_0x73605c[_0x4509('0x3a')]=_0x73605c['attributes'][_0x4509('0x3b')]?_0x73605c['attributes']:_0x34f554[_0x4509('0x38')];_0x73605c[_0x4509('0x3d')]=qs['sort'](_0x213b12[_0x4509('0x34')]['sort']);_0x73605c[_0x4509('0x3f')]=qs['filters'](_[_0x4509('0x56')](_0x213b12[_0x4509('0x34')],_0x34f554['filters']));if(_0x213b12['query'][_0x4509('0x40')]){_0x73605c[_0x4509('0x3f')]=_[_0x4509('0x41')](_0x73605c[_0x4509('0x3f')],{'$or':_[_0x4509('0x2f')](_0x73605c['attributes'],function(_0x3e32e9){var _0x8a782e={};_0x8a782e[_0x3e32e9]={'$like':'%'+_0x213b12[_0x4509('0x34')]['filter']+'%'};return _0x8a782e;})});}_0x73605c=_[_0x4509('0x41')]({},_0x73605c,_0x213b12['options']);return _0x3e0490[_0x4509('0x118')](_0x73605c);}})['then'](function(_0x375c71){if(_0x375c71){_0x2434f8=_0x375c71['length'];if(!_0x213b12[_0x4509('0x34')][_0x4509('0x3c')](_0x4509('0x5e'))){_0x73605c['limit']=qs[_0x4509('0x23')](_0x213b12[_0x4509('0x34')][_0x4509('0x23')]);_0x73605c[_0x4509('0x21')]=qs[_0x4509('0x21')](_0x213b12[_0x4509('0x34')][_0x4509('0x21')]);}return _0x3e0490['getApplications'](_0x73605c);}})[_0x4509('0x12')](function(_0x39f652){if(_0x39f652){return _0x39f652?{'count':_0x2434f8,'rows':_0x39f652}:null;}})[_0x4509('0x12')](respondWithResult(_0x2e0797,null))[_0x4509('0x1c')](handleError(_0x2e0797,null));};exports[_0x4509('0x119')]=function(_0x268eea,_0x4996ab){return db[_0x4509('0x11a')]['find']({'where':{'id':_0x268eea[_0x4509('0x46')]['id']}})[_0x4509('0x12')](handleEntityNotFound(_0x4996ab,null))[_0x4509('0x12')](function(_0x5ea08f){if(_0x5ea08f){return _0x5ea08f['addProactiveActions'](_0x268eea['body'][_0x4509('0x5a')],_[_0x4509('0xe7')](_0x268eea['body'],[_0x4509('0x5a'),'id'])||{});}})[_0x4509('0x12')](respondWithResult(_0x4996ab,null))['catch'](handleError(_0x4996ab,null));};exports[_0x4509('0xfd')]=function(_0x436504,_0x24819e){var _0x5a5b38={};var _0xbdba00={};var _0x4d5370;var _0x52bba4;return db[_0x4509('0x30')][_0x4509('0x54')]({'where':{'id':_0x436504[_0x4509('0x46')]['id']}})[_0x4509('0x12')](handleEntityNotFound(_0x24819e,null))['then'](function(_0x46ed71){if(_0x46ed71){_0x4d5370=_0x46ed71;_0xbdba00[_0x4509('0x38')]=_['keys'](db[_0x4509('0x11b')][_0x4509('0x47')]);_0xbdba00[_0x4509('0x34')]=_[_0x4509('0x35')](_0x436504['query']);_0xbdba00[_0x4509('0x36')]=_[_0x4509('0x37')](_0xbdba00[_0x4509('0x38')],_0xbdba00[_0x4509('0x34')]);_0x5a5b38[_0x4509('0x3a')]=_[_0x4509('0x37')](_0xbdba00['model'],qs[_0x4509('0x39')](_0x436504['query'][_0x4509('0x39')]));_0x5a5b38[_0x4509('0x3a')]=_0x5a5b38[_0x4509('0x3a')][_0x4509('0x3b')]?_0x5a5b38[_0x4509('0x3a')]:_0xbdba00['model'];_0x5a5b38['order']=qs[_0x4509('0x3e')](_0x436504[_0x4509('0x34')]['sort']);_0x5a5b38[_0x4509('0x3f')]=qs['filters'](_[_0x4509('0x56')](_0x436504['query'],_0xbdba00[_0x4509('0x36')]));if(_0x436504['query'][_0x4509('0x40')]){_0x5a5b38[_0x4509('0x3f')]=_[_0x4509('0x41')](_0x5a5b38['where'],{'$or':_['map'](_0x5a5b38['attributes'],function(_0x31b41f){var _0x279404={};_0x279404[_0x31b41f]={'$like':'%'+_0x436504['query']['filter']+'%'};return _0x279404;})});}_0x5a5b38=_[_0x4509('0x41')]({},_0x5a5b38,_0x436504['options']);return _0x4d5370['getProactiveActions'](_0x5a5b38);}})['then'](function(_0x5c3441){if(_0x5c3441){_0x52bba4=_0x5c3441[_0x4509('0x3b')];if(!_0x436504[_0x4509('0x34')][_0x4509('0x3c')](_0x4509('0x5e'))){_0x5a5b38[_0x4509('0x23')]=qs[_0x4509('0x23')](_0x436504['query'][_0x4509('0x23')]);_0x5a5b38['offset']=qs[_0x4509('0x21')](_0x436504[_0x4509('0x34')][_0x4509('0x21')]);}return _0x4d5370[_0x4509('0xfd')](_0x5a5b38);}})[_0x4509('0x12')](function(_0x5b7a2f){if(_0x5b7a2f){return _0x5b7a2f?{'count':_0x52bba4,'rows':_0x5b7a2f}:null;}})['then'](respondWithResult(_0x24819e,null))[_0x4509('0x1c')](handleError(_0x24819e,null));};exports[_0x4509('0x11c')]=function(_0x2a8f01,_0x178b5b){var _0x11a14f=_0x2a8f01[_0x4509('0x34')]['online']===_0x4509('0x11d')?_0x4509('0x11e'):'onlineForm';return db[_0x4509('0x30')][_0x4509('0x48')]({'attributes':['id',_0x11a14f],'where':{'id':_0x2a8f01[_0x4509('0x46')]['id']}})[_0x4509('0x12')](handleEntityNotFound(_0x178b5b,null))[_0x4509('0x12')](function(_0x30d574){if(_0x30d574){var _0x55aaff=_0x30d574[_0x11a14f];var _0x27f9b1=_0x55aaff&&_0x55aaff[_0x4509('0x11f')]?_0x55aaff['items']:[];_0x178b5b[_0x4509('0x2b')]({'fromKey':_[_0x4509('0x75')](_0x55aaff['fromKey'])?undefined:_0x55aaff[_0x4509('0x120')],'count':_0x27f9b1[_0x4509('0x3b')],'rows':_0x27f9b1});}})['catch'](handleError(_0x178b5b,null));};exports[_0x4509('0x121')]=function(_0x372cb6,_0x1e1500){var _0x57e869={'raw':![],'where':{}};var _0x1cedfe={};var _0x56d5ec={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x4509('0x54')]({'where':{'id':_0x372cb6[_0x4509('0x46')]['id']}})[_0x4509('0x12')](handleEntityNotFound(_0x1e1500,null))[_0x4509('0x12')](function(_0x32b20d){if(_0x32b20d){_0x1cedfe[_0x4509('0x38')]=_[_0x4509('0x35')](db[_0x4509('0xcb')]['rawAttributes']);_0x1cedfe[_0x4509('0x34')]=_[_0x4509('0x35')](_0x372cb6['query']);_0x1cedfe[_0x4509('0x36')]=_[_0x4509('0x37')](_0x1cedfe[_0x4509('0x38')],_0x1cedfe[_0x4509('0x34')]);_0x57e869['attributes']=_[_0x4509('0x37')](_0x1cedfe['model'],qs['fields'](_0x372cb6[_0x4509('0x34')][_0x4509('0x39')]));_0x57e869[_0x4509('0x3a')]=_0x57e869[_0x4509('0x3a')][_0x4509('0x3b')]?_0x57e869[_0x4509('0x3a')]:_0x1cedfe[_0x4509('0x38')];if(!_0x372cb6['query']['hasOwnProperty']('nolimit')){_0x57e869[_0x4509('0x23')]=qs['limit'](_0x372cb6['query'][_0x4509('0x23')]);_0x57e869['offset']=qs['offset'](_0x372cb6[_0x4509('0x34')][_0x4509('0x21')]);}_0x57e869[_0x4509('0x3d')]=qs[_0x4509('0x3e')](_0x372cb6[_0x4509('0x34')][_0x4509('0x3e')]);_0x57e869[_0x4509('0x3f')]=qs[_0x4509('0x36')](_[_0x4509('0x56')](_0x372cb6[_0x4509('0x34')],_0x1cedfe[_0x4509('0x36')]));_0x57e869['where'][_0x4509('0x53')]=_0x32b20d['id'];if(_0x372cb6[_0x4509('0x34')][_0x4509('0x40')]){_0x57e869['where']=_[_0x4509('0x41')](_0x57e869[_0x4509('0x3f')],{'$or':_['map'](_0x57e869['attributes'],function(_0x2fb475){var _0x1b32e4={};_0x1b32e4[_0x2fb475]={'$like':'%'+_0x372cb6[_0x4509('0x34')]['filter']+'%'};return _0x1b32e4;})});}_0x57e869=_[_0x4509('0x41')]({},_0x57e869,_0x372cb6[_0x4509('0x43')]);return db[_0x4509('0xcb')][_0x4509('0x24')]({'where':_0x57e869[_0x4509('0x3f')]})['then'](function(_0x27fade){_0x56d5ec[_0x4509('0x24')]=_0x27fade;if(_0x372cb6[_0x4509('0x34')][_0x4509('0x44')]){_0x57e869[_0x4509('0x45')]=[{'all':!![]}];}else{_0x57e869[_0x4509('0x45')]=[{'model':db['CmContact'],'as':_0x4509('0xe9'),'required':![]},{'model':db[_0x4509('0xd4')],'as':_0x4509('0x122'),'required':![]}];}return db['ChatOfflineMessage'][_0x4509('0x57')](_0x57e869);})[_0x4509('0x12')](function(_0x36252b){_0x56d5ec['rows']=_0x36252b;return _0x56d5ec;});}})['then'](respondWithFilteredResult(_0x1e1500,_0x57e869))[_0x4509('0x1c')](handleError(_0x1e1500,null));};exports[_0x4509('0x123')]=function(_0x1153da,_0x2ebe3c){return db[_0x4509('0x30')][_0x4509('0x48')]({'where':{'id':_0x1153da[_0x4509('0x46')]['id']}})[_0x4509('0x12')](handleEntityNotFound(_0x2ebe3c,null))[_0x4509('0x12')](function(_0x53c53c){if(_0x53c53c){return _0x53c53c['addAgents'](_0x1153da[_0x4509('0x4a')][_0x4509('0x5a')],_[_0x4509('0xe7')](_0x1153da[_0x4509('0x4a')],[_0x4509('0x5a'),'id'])||{})[_0x4509('0xc7')](function(_0x427e0f){for(var _0x363967=0x0;_0x363967<_0x1153da[_0x4509('0x4a')][_0x4509('0x5a')][_0x4509('0x3b')];_0x363967+=0x1){socket[_0x4509('0x124')]('userChatWebsite:save',{'UserId':Number(_0x1153da['body']['ids'][_0x363967]),'ChatWebsiteId':Number(_0x1153da[_0x4509('0x46')]['id'])});}return _0x427e0f;});}})['then'](respondWithResult(_0x2ebe3c,null))[_0x4509('0x1c')](handleError(_0x2ebe3c,null));};exports['removeAgents']=function(_0x17c6c4,_0xba626f){return db[_0x4509('0x30')][_0x4509('0x48')]({'where':{'id':_0x17c6c4[_0x4509('0x46')]['id']}})[_0x4509('0x12')](handleEntityNotFound(_0xba626f,null))[_0x4509('0x12')](function(_0x3677b9){if(_0x3677b9){return _0x3677b9[_0x4509('0x125')](_0x17c6c4[_0x4509('0x34')][_0x4509('0x5a')])[_0x4509('0x12')](function(){if(_['isArray'](_0x17c6c4['query'][_0x4509('0x5a')])){for(var _0x4ece77=0x0;_0x4ece77<_0x17c6c4[_0x4509('0x34')][_0x4509('0x5a')][_0x4509('0x3b')];_0x4ece77+=0x1){socket[_0x4509('0x124')](_0x4509('0x126'),{'UserId':Number(_0x17c6c4[_0x4509('0x34')][_0x4509('0x5a')][_0x4ece77]),'ChatWebsiteId':Number(_0x17c6c4[_0x4509('0x46')]['id'])});}}else{socket['emit'](_0x4509('0x126'),{'UserId':Number(_0x17c6c4[_0x4509('0x34')][_0x4509('0x5a')]),'ChatWebsiteId':Number(_0x17c6c4[_0x4509('0x46')]['id'])});}});}})[_0x4509('0x12')](respondWithStatusCode(_0xba626f,null))['catch'](handleError(_0xba626f,null));};exports['getAgents']=function(_0x3ad541,_0x3b6add){var _0x4fc8ca={};var _0x4bcb9e={};var _0x54a360;var _0x19c232;return db['ChatWebsite'][_0x4509('0x54')]({'where':{'id':_0x3ad541['params']['id']}})[_0x4509('0x12')](handleEntityNotFound(_0x3b6add,null))[_0x4509('0x12')](function(_0x36656c){if(_0x36656c){_0x54a360=_0x36656c;_0x4bcb9e['model']=_[_0x4509('0x35')](db[_0x4509('0xea')][_0x4509('0x47')]);_0x4bcb9e[_0x4509('0x34')]=_[_0x4509('0x35')](_0x3ad541[_0x4509('0x34')]);_0x4bcb9e[_0x4509('0x36')]=_[_0x4509('0x37')](_0x4bcb9e[_0x4509('0x38')],_0x4bcb9e[_0x4509('0x34')]);_0x4fc8ca['attributes']=_[_0x4509('0x37')](_0x4bcb9e[_0x4509('0x38')],qs[_0x4509('0x39')](_0x3ad541[_0x4509('0x34')][_0x4509('0x39')]));_0x4fc8ca[_0x4509('0x3a')]=_0x4fc8ca['attributes'][_0x4509('0x3b')]?_0x4fc8ca[_0x4509('0x3a')]:_0x4bcb9e[_0x4509('0x38')];_0x4fc8ca[_0x4509('0x3d')]=qs[_0x4509('0x3e')](_0x3ad541[_0x4509('0x34')][_0x4509('0x3e')]);_0x4fc8ca[_0x4509('0x3f')]=qs[_0x4509('0x36')](_[_0x4509('0x56')](_0x3ad541['query'],_0x4bcb9e[_0x4509('0x36')]));if(_0x3ad541[_0x4509('0x34')][_0x4509('0x40')]){_0x4fc8ca[_0x4509('0x3f')]=_[_0x4509('0x41')](_0x4fc8ca[_0x4509('0x3f')],{'$or':_[_0x4509('0x2f')](_0x4fc8ca[_0x4509('0x3a')],function(_0x5366fb){var _0xfd45f3={};_0xfd45f3[_0x5366fb]={'$like':'%'+_0x3ad541['query'][_0x4509('0x40')]+'%'};return _0xfd45f3;})});}_0x4fc8ca=_[_0x4509('0x41')]({},_0x4fc8ca,_0x3ad541[_0x4509('0x43')]);return _0x54a360['getAgents'](_0x4fc8ca);}})[_0x4509('0x12')](function(_0x62dc6b){if(_0x62dc6b){_0x19c232=_0x62dc6b[_0x4509('0x3b')];if(!_0x3ad541['query'][_0x4509('0x3c')](_0x4509('0x5e'))){_0x4fc8ca[_0x4509('0x23')]=qs[_0x4509('0x23')](_0x3ad541[_0x4509('0x34')][_0x4509('0x23')]);_0x4fc8ca[_0x4509('0x21')]=qs[_0x4509('0x21')](_0x3ad541['query'][_0x4509('0x21')]);}return _0x54a360[_0x4509('0x127')](_0x4fc8ca);}})['then'](function(_0x29d4f8){if(_0x29d4f8){return _0x29d4f8?{'count':_0x19c232,'rows':_0x29d4f8}:null;}})[_0x4509('0x12')](respondWithResult(_0x3b6add,null))[_0x4509('0x1c')](handleError(_0x3b6add,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 0eab744..70046e2 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 _0x00bb=['remove','hook','exports','events','../../mysqldb','ChatWebsite','save'];(function(_0x574f14,_0x73a025){var _0x581309=function(_0x203769){while(--_0x203769){_0x574f14['push'](_0x574f14['shift']());}};_0x581309(++_0x73a025);}(_0x00bb,0x1d8));var _0xb00b=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x00bb[_0x5c351c];return _0x26f3b3;};'use strict';var EventEmitter=require(_0xb00b('0x0'));var ChatWebsite=require(_0xb00b('0x1'))['db'][_0xb00b('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb00b('0x3'),'afterUpdate':'update','afterDestroy':_0xb00b('0x4')};function emitEvent(_0x464fe7){return function(_0x582ef9,_0x14b5d0,_0x2dbd25){ChatWebsiteEvents['emit'](_0x464fe7+':'+_0x582ef9['id'],_0x582ef9);ChatWebsiteEvents['emit'](_0x464fe7,_0x582ef9);_0x2dbd25(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xb00b('0x5')](e,emitEvent(event));}}module[_0xb00b('0x6')]=ChatWebsiteEvents; \ No newline at end of file +var _0x3613=['ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x5be0a1,_0x49ee54){var _0x1e3f13=function(_0x56558d){while(--_0x56558d){_0x5be0a1['push'](_0x5be0a1['shift']());}};_0x1e3f13(++_0x49ee54);}(_0x3613,0x198));var _0x3361=function(_0x248977,_0x5b226e){_0x248977=_0x248977-0x0;var _0x1d6a88=_0x3613[_0x248977];return _0x1d6a88;};'use strict';var EventEmitter=require(_0x3361('0x0'));var ChatWebsite=require(_0x3361('0x1'))['db'][_0x3361('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x3361('0x3')](0x0);var events={'afterCreate':_0x3361('0x4'),'afterUpdate':_0x3361('0x5'),'afterDestroy':_0x3361('0x6')};function emitEvent(_0x56bafb){return function(_0xe6f993,_0x585bf7,_0x21cd23){ChatWebsiteEvents[_0x3361('0x7')](_0x56bafb+':'+_0xe6f993['id'],_0xe6f993);ChatWebsiteEvents[_0x3361('0x7')](_0x56bafb,_0xe6f993);_0x21cd23(null);};}for(var e in events){if(events[_0x3361('0x8')](e)){var event=events[e];ChatWebsite[_0x3361('0x9')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 38a5bb7..e627d3d 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 _0x253e=['chat_websites','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./chatWebsite.attributes','exports','define','ChatWebsite'];(function(_0x4652e3,_0x5348a7){var _0x1b55c1=function(_0x1ca9b8){while(--_0x1ca9b8){_0x4652e3['push'](_0x4652e3['shift']());}};_0x1b55c1(++_0x5348a7);}(_0x253e,0x76));var _0xe253=function(_0xf074c1,_0x57ac51){_0xf074c1=_0xf074c1-0x0;var _0x37661c=_0x253e[_0xf074c1];return _0x37661c;};'use strict';var _=require(_0xe253('0x0'));var util=require(_0xe253('0x1'));var logger=require('../../config/logger')(_0xe253('0x2'));var moment=require(_0xe253('0x3'));var BPromise=require(_0xe253('0x4'));var rp=require(_0xe253('0x5'));var fs=require('fs');var path=require(_0xe253('0x6'));var rimraf=require(_0xe253('0x7'));var config=require('../../config/environment');var attributes=require(_0xe253('0x8'));module[_0xe253('0x9')]=function(_0x41602d,_0x4673da){return _0x41602d[_0xe253('0xa')](_0xe253('0xb'),attributes,{'tableName':_0xe253('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0a9d=['bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','chat_websites','api','moment'];(function(_0x4f1c5b,_0x51886a){var _0x4d0ef9=function(_0x2a35e5){while(--_0x2a35e5){_0x4f1c5b['push'](_0x4f1c5b['shift']());}};_0x4d0ef9(++_0x51886a);}(_0x0a9d,0x148));var _0xd0a9=function(_0x22899f,_0x50952f){_0x22899f=_0x22899f-0x0;var _0x1634d6=_0x0a9d[_0x22899f];return _0x1634d6;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xd0a9('0x0'));var moment=require(_0xd0a9('0x1'));var BPromise=require(_0xd0a9('0x2'));var rp=require(_0xd0a9('0x3'));var fs=require('fs');var path=require(_0xd0a9('0x4'));var rimraf=require(_0xd0a9('0x5'));var config=require(_0xd0a9('0x6'));var attributes=require(_0xd0a9('0x7'));module[_0xd0a9('0x8')]=function(_0x4c2647,_0x4bb344){return _0x4c2647[_0xd0a9('0x9')]('ChatWebsite',attributes,{'tableName':_0xd0a9('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 326c7f6..a9f0a1f 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 _0x9d0e=['rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatWebsite.socket','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x9d0e,0x12c));var _0xe9d0=function(_0x31451c,_0x39ba32){_0x31451c=_0x31451c-0x0;var _0xa58928=_0x9d0e[_0x31451c];return _0xa58928;};'use strict';var _=require(_0xe9d0('0x0'));var util=require(_0xe9d0('0x1'));var moment=require(_0xe9d0('0x2'));var BPromise=require(_0xe9d0('0x3'));var rs=require(_0xe9d0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe9d0('0x5'))['db'];var utils=require(_0xe9d0('0x6'));var logger=require(_0xe9d0('0x7'))(_0xe9d0('0x8'));var config=require('../../config/environment');var jayson=require(_0xe9d0('0x9'));var client=jayson[_0xe9d0('0xa')][_0xe9d0('0xb')]({'port':0x232a});config[_0xe9d0('0xc')]=_['defaults'](config[_0xe9d0('0xc')],{'host':_0xe9d0('0xd'),'port':0x18eb});var socket=require(_0xe9d0('0xe'))(new Redis(config[_0xe9d0('0xc')]));require(_0xe9d0('0xf'))['register'](socket);function respondWithRpcPromise(_0x29954d,_0x5266df,_0x5a2099){return new BPromise(function(_0x534a82,_0x5b29a3){return client[_0xe9d0('0x10')](_0x29954d,_0x5a2099)[_0xe9d0('0x11')](function(_0x6f78b6){logger['info'](_0xe9d0('0x12'),_0x5266df,_0xe9d0('0x13'));logger[_0xe9d0('0x14')](_0xe9d0('0x15'),_0x5266df,_0xe9d0('0x13'),JSON[_0xe9d0('0x16')](_0x6f78b6));if(_0x6f78b6[_0xe9d0('0x17')]){if(_0x6f78b6['error'][_0xe9d0('0x18')]===0x1f4){logger[_0xe9d0('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x5266df,_0x6f78b6[_0xe9d0('0x17')][_0xe9d0('0x19')]);return _0x5b29a3(_0x6f78b6[_0xe9d0('0x17')]['message']);}logger[_0xe9d0('0x17')](_0xe9d0('0x12'),_0x5266df,_0x6f78b6[_0xe9d0('0x17')][_0xe9d0('0x19')]);return _0x534a82(_0x6f78b6['error'][_0xe9d0('0x19')]);}else{logger['info'](_0xe9d0('0x12'),_0x5266df,'request\x20sent');_0x534a82(_0x6f78b6[_0xe9d0('0x1a')]['message']);}})[_0xe9d0('0x1b')](function(_0x2f8112){logger[_0xe9d0('0x17')](_0xe9d0('0x12'),_0x5266df,_0x2f8112);_0x5b29a3(_0x2f8112);});});} \ No newline at end of file +var _0x24b7=['message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./chatWebsite.socket','register','then','info','request\x20sent','error','code','ChatWebsite,\x20%s,\x20%s'];(function(_0x4e7cc3,_0x47ff4){var _0x42e46d=function(_0x43bd6e){while(--_0x43bd6e){_0x4e7cc3['push'](_0x4e7cc3['shift']());}};_0x42e46d(++_0x47ff4);}(_0x24b7,0x19b));var _0x724b=function(_0x19f286,_0xa79a29){_0x19f286=_0x19f286-0x0;var _0x235aa0=_0x24b7[_0x19f286];return _0x235aa0;};'use strict';var _=require(_0x724b('0x0'));var util=require(_0x724b('0x1'));var moment=require('moment');var BPromise=require(_0x724b('0x2'));var rs=require(_0x724b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x724b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x724b('0x5'))(_0x724b('0x6'));var config=require(_0x724b('0x7'));var jayson=require(_0x724b('0x8'));var client=jayson[_0x724b('0x9')]['http']({'port':0x232a});config[_0x724b('0xa')]=_[_0x724b('0xb')](config[_0x724b('0xa')],{'host':_0x724b('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x724b('0xa')]));require(_0x724b('0xd'))[_0x724b('0xe')](socket);function respondWithRpcPromise(_0x66a67,_0x3824cd,_0x21012b){return new BPromise(function(_0x4793ab,_0x523e14){return client['request'](_0x66a67,_0x21012b)[_0x724b('0xf')](function(_0x100c08){logger[_0x724b('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x3824cd,_0x724b('0x11'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x3824cd,'request\x20sent',JSON['stringify'](_0x100c08));if(_0x100c08[_0x724b('0x12')]){if(_0x100c08[_0x724b('0x12')][_0x724b('0x13')]===0x1f4){logger['error'](_0x724b('0x14'),_0x3824cd,_0x100c08[_0x724b('0x12')][_0x724b('0x15')]);return _0x523e14(_0x100c08[_0x724b('0x12')]['message']);}logger[_0x724b('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x3824cd,_0x100c08['error']['message']);return _0x4793ab(_0x100c08[_0x724b('0x12')][_0x724b('0x15')]);}else{logger[_0x724b('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x3824cd,_0x724b('0x11'));_0x4793ab(_0x100c08[_0x724b('0x16')][_0x724b('0x15')]);}})[_0x724b('0x17')](function(_0x146534){logger[_0x724b('0x12')](_0x724b('0x14'),_0x3824cd,_0x146534);_0x523e14(_0x146534);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 4b6c628..a95b2ce 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 _0xf1ad=['update','register','length','./chatWebsite.events','remove'];(function(_0x2574fb,_0x35c780){var _0x426ea2=function(_0x25615e){while(--_0x25615e){_0x2574fb['push'](_0x2574fb['shift']());}};_0x426ea2(++_0x35c780);}(_0xf1ad,0x1f2));var _0xdf1a=function(_0x3da25b,_0xd3e6c){_0x3da25b=_0x3da25b-0x0;var _0x238c18=_0xf1ad[_0x3da25b];return _0x238c18;};'use strict';var ChatWebsiteEvents=require(_0xdf1a('0x0'));var events=['save',_0xdf1a('0x1'),_0xdf1a('0x2')];function createListener(_0x15470e,_0x26c049){return function(_0x275a53){_0x26c049['emit'](_0x15470e,_0x275a53);};}function removeListener(_0x93dcc5,_0x476deb){return function(){ChatWebsiteEvents['removeListener'](_0x93dcc5,_0x476deb);};}exports[_0xdf1a('0x3')]=function(_0x5e041c){for(var _0x562484=0x0,_0x2ac9ae=events[_0xdf1a('0x4')];_0x562484<_0x2ac9ae;_0x562484++){var _0x1140d8=events[_0x562484];var _0x45befd=createListener('chatWebsite:'+_0x1140d8,_0x5e041c);ChatWebsiteEvents['on'](_0x1140d8,_0x45befd);}}; \ No newline at end of file +var _0x281d=['chatWebsite:','save','remove','update','emit','removeListener','register','length'];(function(_0x49225d,_0x312d6c){var _0x2c228f=function(_0x183ff5){while(--_0x183ff5){_0x49225d['push'](_0x49225d['shift']());}};_0x2c228f(++_0x312d6c);}(_0x281d,0xc1));var _0xd281=function(_0x3fa91b,_0x119e77){_0x3fa91b=_0x3fa91b-0x0;var _0x35b062=_0x281d[_0x3fa91b];return _0x35b062;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xd281('0x0'),_0xd281('0x1'),_0xd281('0x2')];function createListener(_0x2dd05a,_0x372d29){return function(_0x38fd83){_0x372d29[_0xd281('0x3')](_0x2dd05a,_0x38fd83);};}function removeListener(_0x45efb4,_0x100e4b){return function(){ChatWebsiteEvents[_0xd281('0x4')](_0x45efb4,_0x100e4b);};}exports[_0xd281('0x5')]=function(_0x44019e){for(var _0x1e688c=0x0,_0x3331d4=events[_0xd281('0x6')];_0x1e688c<_0x3331d4;_0x1e688c++){var _0x5a71a2=events[_0x1e688c];var _0x36bdbe=createListener(_0xd281('0x7')+_0x5a71a2,_0x44019e);ChatWebsiteEvents['on'](_0x5a71a2,_0x36bdbe);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 5f63d7b..6a67372 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 _0xfe72=['addInteraction','addProactiveActions','/:id/users','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','show','/:id/dispositions','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','join','root','format','%s-%s','originalname','single','file','addLogo','diskStorage','server/files/images/avatars/','now','addAvatar','addSystemAvatar','/:id/notify','notify','server/files','offline-chat','ensureDir','replace','extname','/:id/offline'];(function(_0x192551,_0x160221){var _0x533857=function(_0x5047d3){while(--_0x5047d3){_0x192551['push'](_0x192551['shift']());}};_0x533857(++_0x160221);}(_0xfe72,0x170));var _0x2fe7=function(_0x49b363,_0x27b6b7){_0x49b363=_0x49b363-0x0;var _0x2c0db8=_0xfe72[_0x49b363];return _0x2c0db8;};'use strict';var multer=require('multer');var util=require(_0x2fe7('0x0'));var path=require(_0x2fe7('0x1'));var timeout=require(_0x2fe7('0x2'));var express=require(_0x2fe7('0x3'));var router=express[_0x2fe7('0x4')]();var fs_extra=require(_0x2fe7('0x5'));var auth=require(_0x2fe7('0x6'));var interaction=require(_0x2fe7('0x7'));var config=require('../../config/environment');var controller=require('./chatWebsite.controller');router[_0x2fe7('0x8')]('/',auth['isAuthenticated'](),controller[_0x2fe7('0x9')]);router[_0x2fe7('0x8')](_0x2fe7('0xa'),auth[_0x2fe7('0xb')](),controller[_0x2fe7('0xc')]);router[_0x2fe7('0x8')]('/:id',auth[_0x2fe7('0xb')](),controller[_0x2fe7('0xd')]);router[_0x2fe7('0x8')](_0x2fe7('0xe'),auth[_0x2fe7('0xb')](),controller['getDispositions']);router[_0x2fe7('0x8')]('/:id/canned_answers',auth[_0x2fe7('0xb')](),controller['getAnswers']);router[_0x2fe7('0x8')](_0x2fe7('0xf'),controller[_0x2fe7('0x10')]);router[_0x2fe7('0x8')](_0x2fe7('0x11'),controller['getAvatar']);router[_0x2fe7('0x8')](_0x2fe7('0x12'),controller[_0x2fe7('0x13')]);router[_0x2fe7('0x8')](_0x2fe7('0x14'),controller[_0x2fe7('0x15')]);router['get']('/:id/interactions',auth[_0x2fe7('0xb')](),controller['getInteractions']);router[_0x2fe7('0x8')](_0x2fe7('0x16'),controller[_0x2fe7('0x17')]);router[_0x2fe7('0x8')](_0x2fe7('0x18'),auth[_0x2fe7('0xb')](),controller[_0x2fe7('0x19')]);router[_0x2fe7('0x8')](_0x2fe7('0x1a'),auth['isAuthenticated'](),controller[_0x2fe7('0x1b')]);router[_0x2fe7('0x8')](_0x2fe7('0x1c'),controller[_0x2fe7('0x1d')]);router['get'](_0x2fe7('0x1e'),auth['isAuthenticated'](),controller[_0x2fe7('0x1f')]);router[_0x2fe7('0x8')]('/:id/users',auth[_0x2fe7('0xb')](),controller[_0x2fe7('0x20')]);router[_0x2fe7('0x21')]('/',auth[_0x2fe7('0xb')](),controller['create']);router[_0x2fe7('0x21')](_0x2fe7('0xe'),auth[_0x2fe7('0xb')](),controller[_0x2fe7('0x22')]);router[_0x2fe7('0x21')](_0x2fe7('0x23'),auth[_0x2fe7('0xb')](),controller[_0x2fe7('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xe42bd7,_0x198343,_0x2eb26a){_0x2eb26a(null,path[_0x2fe7('0x25')](config[_0x2fe7('0x26')],'server/files/images/logos/'));},'filename':function(_0x45270b,_0x496d7f,_0x42bd7e){_0x42bd7e(null,util[_0x2fe7('0x27')](_0x2fe7('0x28'),Date['now'](),_0x496d7f[_0x2fe7('0x29')]));}})});router[_0x2fe7('0x21')](_0x2fe7('0xf'),upload[_0x2fe7('0x2a')](_0x2fe7('0x2b')),controller[_0x2fe7('0x2c')]);var upload=multer({'storage':multer[_0x2fe7('0x2d')]({'destination':function(_0x364c14,_0x289725,_0x14ad07){_0x14ad07(null,path['join'](config['root'],_0x2fe7('0x2e')));},'filename':function(_0x189711,_0x272173,_0x5309e1){_0x5309e1(null,util[_0x2fe7('0x27')](_0x2fe7('0x28'),Date[_0x2fe7('0x2f')](),_0x272173['originalname']));}})});router[_0x2fe7('0x21')](_0x2fe7('0x11'),upload[_0x2fe7('0x2a')](_0x2fe7('0x2b')),controller[_0x2fe7('0x30')]);var upload=multer({'storage':multer[_0x2fe7('0x2d')]({'destination':function(_0x14b7ad,_0x471d3f,_0x44c6bf){_0x44c6bf(null,path[_0x2fe7('0x25')](config['root'],_0x2fe7('0x2e')));},'filename':function(_0x167bb2,_0x3e9402,_0x233861){_0x233861(null,util[_0x2fe7('0x27')]('%s-%s',Date[_0x2fe7('0x2f')](),_0x3e9402[_0x2fe7('0x29')]));}})});router[_0x2fe7('0x21')](_0x2fe7('0x12'),upload[_0x2fe7('0x2a')](_0x2fe7('0x2b')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x2fe7('0x2d')]({'destination':function(_0x4e3bc8,_0x430235,_0x1883e8){_0x1883e8(null,path[_0x2fe7('0x25')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x18e8f7,_0x5edcea,_0x53ec84){_0x53ec84(null,util['format'](_0x2fe7('0x28'),Date['now'](),_0x5edcea[_0x2fe7('0x29')]));}})});router[_0x2fe7('0x21')](_0x2fe7('0x14'),upload[_0x2fe7('0x2a')]('file'),controller[_0x2fe7('0x31')]);router['post'](_0x2fe7('0x32'),controller[_0x2fe7('0x33')]);const offlineUploadMulter=multer({'storage':multer[_0x2fe7('0x2d')]({'destination':function(_0x4662e9,_0x5c85fe,_0x2a6264){const _0x31e31b=path['join'](config[_0x2fe7('0x26')],_0x2fe7('0x34'),'attachments',_0x2fe7('0x35'));fs_extra[_0x2fe7('0x36')](_0x31e31b,function(){_0x2a6264(null,_0x31e31b);});},'filename':function(_0x52b91e,_0x154535,_0x343e5f){const _0x4637a1=_0x154535['originalname'][_0x2fe7('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x20ee02=path[_0x2fe7('0x38')](_0x4637a1);const _0x55f3d3=Date[_0x2fe7('0x2f')]()+'-'+_0x4637a1[_0x2fe7('0x37')](_0x20ee02,'')+_0x20ee02;_0x343e5f(null,_0x55f3d3);}})});router[_0x2fe7('0x21')](_0x2fe7('0x39'),offlineUploadMulter['any'](),controller['offline']);router[_0x2fe7('0x21')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x2fe7('0x3a')]);router[_0x2fe7('0x21')](_0x2fe7('0x18'),auth['isAuthenticated'](),controller['addApplications']);router[_0x2fe7('0x21')](_0x2fe7('0x1a'),auth[_0x2fe7('0xb')](),controller[_0x2fe7('0x3b')]);router['post'](_0x2fe7('0x3c'),auth[_0x2fe7('0xb')](),controller[_0x2fe7('0x3d')]);router[_0x2fe7('0x3e')](_0x2fe7('0x3f'),auth[_0x2fe7('0xb')](),controller[_0x2fe7('0x40')]);router['delete'](_0x2fe7('0x3f'),auth[_0x2fe7('0xb')](),controller[_0x2fe7('0x41')]);router[_0x2fe7('0x42')](_0x2fe7('0xe'),auth[_0x2fe7('0xb')](),controller[_0x2fe7('0x43')]);router[_0x2fe7('0x42')](_0x2fe7('0x23'),auth['isAuthenticated'](),controller[_0x2fe7('0x44')]);router[_0x2fe7('0x42')](_0x2fe7('0x3c'),auth[_0x2fe7('0xb')](),controller[_0x2fe7('0x45')]);module[_0x2fe7('0x46')]=router; \ No newline at end of file +var _0x78b8=['/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/avatar','/:id/customer_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','addDisposition','join','root','server/files/images/logos/','format','%s-%s','now','originalname','/:id/logo','single','file','addLogo','diskStorage','server/files/images/avatars/','addAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','replace','extname','/:id/offline','offline','addInteraction','addApplications','addProactiveActions','addAgents','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index'];(function(_0x2e5a23,_0xffab4){var _0x23b8f2=function(_0x46b7dc){while(--_0x46b7dc){_0x2e5a23['push'](_0x2e5a23['shift']());}};_0x23b8f2(++_0xffab4);}(_0x78b8,0x10d));var _0x878b=function(_0x17a508,_0x5853be){_0x17a508=_0x17a508-0x0;var _0x5a7ece=_0x78b8[_0x17a508];return _0x5a7ece;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x878b('0x0'));var timeout=require('connect-timeout');var express=require(_0x878b('0x1'));var router=express[_0x878b('0x2')]();var fs_extra=require(_0x878b('0x3'));var auth=require(_0x878b('0x4'));var interaction=require(_0x878b('0x5'));var config=require(_0x878b('0x6'));var controller=require(_0x878b('0x7'));router[_0x878b('0x8')]('/',auth[_0x878b('0x9')](),controller[_0x878b('0xa')]);router[_0x878b('0x8')](_0x878b('0xb'),auth[_0x878b('0x9')](),controller[_0x878b('0xc')]);router[_0x878b('0x8')](_0x878b('0xd'),auth['isAuthenticated'](),controller[_0x878b('0xe')]);router['get'](_0x878b('0xf'),auth[_0x878b('0x9')](),controller[_0x878b('0x10')]);router[_0x878b('0x8')](_0x878b('0x11'),auth[_0x878b('0x9')](),controller['getAnswers']);router[_0x878b('0x8')]('/:id/logo',controller['getLogo']);router[_0x878b('0x8')](_0x878b('0x12'),controller['getAvatar']);router[_0x878b('0x8')](_0x878b('0x13'),controller['getCustomerAvatar']);router[_0x878b('0x8')]('/:id/system_avatar',controller[_0x878b('0x14')]);router[_0x878b('0x8')](_0x878b('0x15'),auth['isAuthenticated'](),controller[_0x878b('0x16')]);router[_0x878b('0x8')](_0x878b('0x17'),controller[_0x878b('0x18')]);router[_0x878b('0x8')](_0x878b('0x19'),auth['isAuthenticated'](),controller['getApplications']);router[_0x878b('0x8')](_0x878b('0x1a'),auth[_0x878b('0x9')](),controller[_0x878b('0x1b')]);router[_0x878b('0x8')]('/:id/fields',controller[_0x878b('0x1c')]);router[_0x878b('0x8')](_0x878b('0x1d'),auth[_0x878b('0x9')](),controller[_0x878b('0x1e')]);router['get'](_0x878b('0x1f'),auth[_0x878b('0x9')](),controller[_0x878b('0x20')]);router[_0x878b('0x21')]('/',auth[_0x878b('0x9')](),controller['create']);router['post']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x878b('0x22')]);router[_0x878b('0x21')]('/:id/canned_answers',auth['isAuthenticated'](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x537da8,_0x9b4448,_0x2e5f6d){_0x2e5f6d(null,path[_0x878b('0x23')](config[_0x878b('0x24')],_0x878b('0x25')));},'filename':function(_0x6e98c6,_0x4e9fad,_0xfbef2c){_0xfbef2c(null,util[_0x878b('0x26')](_0x878b('0x27'),Date[_0x878b('0x28')](),_0x4e9fad[_0x878b('0x29')]));}})});router[_0x878b('0x21')](_0x878b('0x2a'),upload[_0x878b('0x2b')](_0x878b('0x2c')),controller[_0x878b('0x2d')]);var upload=multer({'storage':multer[_0x878b('0x2e')]({'destination':function(_0xcca76a,_0x52523f,_0x20dcc7){_0x20dcc7(null,path[_0x878b('0x23')](config['root'],_0x878b('0x2f')));},'filename':function(_0x49779f,_0x22e3e8,_0x29f122){_0x29f122(null,util[_0x878b('0x26')](_0x878b('0x27'),Date[_0x878b('0x28')](),_0x22e3e8[_0x878b('0x29')]));}})});router[_0x878b('0x21')]('/:id/avatar',upload[_0x878b('0x2b')](_0x878b('0x2c')),controller[_0x878b('0x30')]);var upload=multer({'storage':multer[_0x878b('0x2e')]({'destination':function(_0x3a6f4d,_0x5d6ace,_0x5bbb43){_0x5bbb43(null,path[_0x878b('0x23')](config[_0x878b('0x24')],_0x878b('0x2f')));},'filename':function(_0x1702c2,_0x11c49b,_0x251d06){_0x251d06(null,util['format']('%s-%s',Date[_0x878b('0x28')](),_0x11c49b[_0x878b('0x29')]));}})});router['post'](_0x878b('0x13'),upload[_0x878b('0x2b')](_0x878b('0x2c')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53ba59,_0x583429,_0x5930b9){_0x5930b9(null,path[_0x878b('0x23')](config[_0x878b('0x24')],'server/files/images/avatars/'));},'filename':function(_0x5c8e8e,_0x4202fa,_0xd1d2d8){_0xd1d2d8(null,util[_0x878b('0x26')](_0x878b('0x27'),Date[_0x878b('0x28')](),_0x4202fa[_0x878b('0x29')]));}})});router['post'](_0x878b('0x31'),upload[_0x878b('0x2b')]('file'),controller[_0x878b('0x32')]);router[_0x878b('0x21')](_0x878b('0x33'),controller[_0x878b('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0x878b('0x2e')]({'destination':function(_0x127c2c,_0x19710e,_0x5bfc58){const _0x125a59=path['join'](config[_0x878b('0x24')],_0x878b('0x35'),_0x878b('0x36'),'offline-chat');fs_extra['ensureDir'](_0x125a59,function(){_0x5bfc58(null,_0x125a59);});},'filename':function(_0x2a5572,_0x5988f0,_0x40aa26){const _0x393afb=_0x5988f0[_0x878b('0x29')][_0x878b('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1de24c=path[_0x878b('0x38')](_0x393afb);const _0x3676e7=Date['now']()+'-'+_0x393afb[_0x878b('0x37')](_0x1de24c,'')+_0x1de24c;_0x40aa26(null,_0x3676e7);}})});router['post'](_0x878b('0x39'),offlineUploadMulter['any'](),controller[_0x878b('0x3a')]);router[_0x878b('0x21')](_0x878b('0x15'),auth[_0x878b('0x9')](),controller[_0x878b('0x3b')]);router[_0x878b('0x21')](_0x878b('0x19'),auth[_0x878b('0x9')](),controller[_0x878b('0x3c')]);router['post'](_0x878b('0x1a'),auth[_0x878b('0x9')](),controller[_0x878b('0x3d')]);router[_0x878b('0x21')](_0x878b('0x1f'),auth[_0x878b('0x9')](),controller[_0x878b('0x3e')]);router['put'](_0x878b('0xd'),auth[_0x878b('0x9')](),controller[_0x878b('0x3f')]);router[_0x878b('0x40')](_0x878b('0xd'),auth['isAuthenticated'](),controller[_0x878b('0x41')]);router[_0x878b('0x40')](_0x878b('0xf'),auth[_0x878b('0x9')](),controller[_0x878b('0x42')]);router[_0x878b('0x40')](_0x878b('0x11'),auth['isAuthenticated'](),controller[_0x878b('0x43')]);router['delete'](_0x878b('0x1f'),auth[_0x878b('0x9')](),controller[_0x878b('0x44')]);module[_0x878b('0x45')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 3e20624..2b5596c 100644 --- a/server/api/client-side-logs.js +++ b/server/api/client-side-logs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6cef=['exports','beaver-logger/server','express','../components/auth/service','../config/environment','Router','env','production','app','get','client-side-logger','expressEndpoint','/client-logs','isAuthenticated'];(function(_0x52d824,_0x59af8b){var _0x559d0e=function(_0x102d53){while(--_0x102d53){_0x52d824['push'](_0x52d824['shift']());}};_0x559d0e(++_0x59af8b);}(_0x6cef,0xa9));var _0xf6ce=function(_0x558cc3,_0x524449){_0x558cc3=_0x558cc3-0x0;var _0x30e107=_0x6cef[_0x558cc3];return _0x30e107;};var beaverLogger=require(_0xf6ce('0x0'));var express=require(_0xf6ce('0x1'));var auth=require(_0xf6ce('0x2'));var config=require(_0xf6ce('0x3'));var router=express[_0xf6ce('0x4')]();var isProduction=config[_0xf6ce('0x5')]===_0xf6ce('0x6')||![];function clientSideLogs(_0x43f6ff,_0xbf441d,_0x4b1f68){var _0x51f49e=_0x43f6ff[_0xf6ce('0x7')][_0xf6ce('0x8')](_0xf6ce('0x9'));if(!_0x51f49e){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0xf6ce('0xa')]({'uri':_0xf6ce('0xb'),'logger':_0x51f49e,'enableCors':!isProduction})(_0x43f6ff,_0xbf441d,_0x4b1f68);}router['use'](auth[_0xf6ce('0xc')](),clientSideLogs);module[_0xf6ce('0xd')]=router; \ No newline at end of file +var _0x17f6=['/client-logs','use','isAuthenticated','exports','express','../config/environment','Router','env','production','app','get','expressEndpoint'];(function(_0x359bbe,_0x5b7fcc){var _0x1b3353=function(_0x34b41c){while(--_0x34b41c){_0x359bbe['push'](_0x359bbe['shift']());}};_0x1b3353(++_0x5b7fcc);}(_0x17f6,0x1b4));var _0x617f=function(_0xc87668,_0x3b7997){_0xc87668=_0xc87668-0x0;var _0x184b40=_0x17f6[_0xc87668];return _0x184b40;};var beaverLogger=require('beaver-logger/server');var express=require(_0x617f('0x0'));var auth=require('../components/auth/service');var config=require(_0x617f('0x1'));var router=express[_0x617f('0x2')]();var isProduction=config[_0x617f('0x3')]===_0x617f('0x4')||![];function clientSideLogs(_0x1e976d,_0x4e6a53,_0x1182e4){var _0x298c0f=_0x1e976d[_0x617f('0x5')][_0x617f('0x6')]('client-side-logger');if(!_0x298c0f){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x617f('0x7')]({'uri':_0x617f('0x8'),'logger':_0x298c0f,'enableCors':!isProduction})(_0x1e976d,_0x4e6a53,_0x1182e4);}router[_0x617f('0x9')](auth[_0x617f('0xa')](),clientSideLogs);module[_0x617f('0xb')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 2d3c686..1ba43f6 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 _0x641d=['sequelize','exports','ENUM','AmazonAWS','MicrosoftAzure','Outlook365','STRING','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'];(function(_0x32c8c2,_0x5e0ab0){var _0x16ed42=function(_0x4646b0){while(--_0x4646b0){_0x32c8c2['push'](_0x32c8c2['shift']());}};_0x16ed42(++_0x5e0ab0);}(_0x641d,0x69));var _0xd641=function(_0x215d67,_0x30e253){_0x215d67=_0x215d67-0x0;var _0x5af104=_0x641d[_0x215d67];return _0x5af104;};'use strict';var Sequelize=require(_0xd641('0x0'));module[_0xd641('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xd641('0x2')](_0xd641('0x3'),'Google',_0xd641('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xd641('0x2')](_0xd641('0x5'),'Dynamics365')},'data1':{'type':Sequelize[_0xd641('0x6')],'comment':_0xd641('0x7')},'data2':{'type':Sequelize['STRING'],'comment':_0xd641('0x8')},'data3':{'type':Sequelize['STRING'],'comment':_0xd641('0x9')},'data4':{'type':Sequelize[_0xd641('0x6')],'comment':_0xd641('0xa')},'data5':{'type':Sequelize[_0xd641('0xb')],'comment':_0xd641('0xc')},'data6':{'type':Sequelize[_0xd641('0xb')],'comment':_0xd641('0xd')},'data7':{'type':Sequelize[_0xd641('0xb')],'comment':_0xd641('0xe')}}; \ No newline at end of file +var _0x1efe=['MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','STRING','ENUM','AmazonAWS','MicrosoftAzure','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT'];(function(_0x12d3e1,_0x420e28){var _0x563eef=function(_0x244712){while(--_0x244712){_0x12d3e1['push'](_0x12d3e1['shift']());}};_0x563eef(++_0x420e28);}(_0x1efe,0x85));var _0xe1ef=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0x1efe[_0x58dc25];return _0x21b0a7;};'use strict';var Sequelize=require(_0xe1ef('0x0'));module['exports']={'name':{'type':Sequelize[_0xe1ef('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xe1ef('0x2')](_0xe1ef('0x3'),'Google',_0xe1ef('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xe1ef('0x2')]('Outlook365','Dynamics365')},'data1':{'type':Sequelize[_0xe1ef('0x1')],'comment':_0xe1ef('0x5')},'data2':{'type':Sequelize[_0xe1ef('0x1')],'comment':_0xe1ef('0x6')},'data3':{'type':Sequelize[_0xe1ef('0x1')],'comment':_0xe1ef('0x7')},'data4':{'type':Sequelize[_0xe1ef('0x1')],'comment':_0xe1ef('0x8')},'data5':{'type':Sequelize[_0xe1ef('0x9')],'comment':_0xe1ef('0xa')},'data6':{'type':Sequelize['TEXT'],'comment':_0xe1ef('0xb')},'data7':{'type':Sequelize[_0xe1ef('0x9')],'comment':_0xe1ef('0xc')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 25e5602..123ff6c 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 _0x6f57=['get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','../../components/encryptor','api','../../mysqldb','redis','defaults','localhost','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','update','then','error','stack','name','send','padEnd','slice','index','map','fieldName','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','options','CloudProvider','includeAll','include','findAll','rows','service','decryptString','data3','catch','params','keys','rawAttributes','find','create','Name\x20parameter\x20not\x20specified','body','Service\x20parameter\x20not\x20specified','includes','MicrosoftAzure','encryptString','destroy','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0x6f57,0xd7));var _0x76f5=function(_0x5e714e,_0x5135e2){_0x5e714e=_0x5e714e-0x0;var _0x364f9b=_0x6f57[_0x5e714e];return _0x364f9b;};'use strict';var _=require(_0x76f5('0x0'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var encryptor=require(_0x76f5('0x1'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0x76f5('0x2'));var db=require(_0x76f5('0x3'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x76f5('0x4')]=_[_0x76f5('0x5')](config['redis'],{'host':_0x76f5('0x6'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x76f5('0x4')]));var redis=new Redis(config[_0x76f5('0x4')]);function respondWithStatusCode(_0x4542fe,_0x480cdf){_0x480cdf=_0x480cdf||0xcc;return function(_0x3d5302){if(_0x3d5302){return _0x4542fe[_0x76f5('0x7')](_0x480cdf);}return _0x4542fe['status'](_0x480cdf)[_0x76f5('0x8')]();};}function respondWithResult(_0x2e104c,_0x37b510){_0x37b510=_0x37b510||0xc8;return function(_0x1846ae){if(_0x1846ae){return _0x2e104c[_0x76f5('0x9')](_0x37b510)['json'](_0x1846ae);}};}function respondWithFilteredResult(_0x49ce99,_0x269840){return function(_0xc9c357){if(_0xc9c357){var _0xe9477c=typeof _0x269840[_0x76f5('0xa')]===_0x76f5('0xb')&&typeof _0x269840['limit']===_0x76f5('0xb');var _0x34a8d6=_0xc9c357[_0x76f5('0xc')];var _0x59a7fa=_0xe9477c?0x0:_0x269840['offset'];var _0x40bd85=_0xe9477c?_0xc9c357[_0x76f5('0xc')]:_0x269840[_0x76f5('0xa')]+_0x269840[_0x76f5('0xd')];var _0x3c2435;if(_0x40bd85>=_0x34a8d6){_0x40bd85=_0x34a8d6;_0x3c2435=0xc8;}else{_0x3c2435=0xce;}_0x49ce99[_0x76f5('0x9')](_0x3c2435);return _0x49ce99[_0x76f5('0xe')](_0x76f5('0xf'),_0x59a7fa+'-'+_0x40bd85+'/'+_0x34a8d6)[_0x76f5('0x10')](_0xc9c357);}return null;};}function saveUpdates(_0x54c186){return function(_0x136cd4){if(_0x136cd4){return _0x136cd4[_0x76f5('0x11')](_0x54c186)[_0x76f5('0x12')](function(_0x5e19e9){return _0x5e19e9;});}return null;};}function removeEntity(_0x11339d){return function(_0x2b963c){if(_0x2b963c){return _0x2b963c['destroy']()[_0x76f5('0x12')](function(){_0x11339d[_0x76f5('0x9')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36d81c){return function(_0x5085c9){if(!_0x5085c9){_0x36d81c['sendStatus'](0x194);}return _0x5085c9;};}function handleError(_0x4d8e2c,_0x304a65){_0x304a65=_0x304a65||0x1f4;return function(_0x3098ca){logger[_0x76f5('0x13')](_0x3098ca[_0x76f5('0x14')]);if(_0x3098ca[_0x76f5('0x15')]){delete _0x3098ca['name'];}_0x4d8e2c[_0x76f5('0x9')](_0x304a65)[_0x76f5('0x16')](_0x3098ca);};}function maskClientSecret(_0x12d96f){return _[_0x76f5('0x17')](_0x12d96f[_0x76f5('0x18')](0x0,0x3),0x14,'*');}exports[_0x76f5('0x19')]=function(_0x5da21f,_0x8542d8){var _0x55e2ef={},_0xb0fb04={},_0x52ca49={'count':0x0,'rows':[]};var _0x3e5ba9=_[_0x76f5('0x1a')](db['CloudProvider']['rawAttributes'],function(_0x169f24){return{'name':_0x169f24[_0x76f5('0x1b')],'type':_0x169f24['type'][_0x76f5('0x1c')]};});_0xb0fb04['model']=_[_0x76f5('0x1a')](_0x3e5ba9,_0x76f5('0x15'));_0xb0fb04[_0x76f5('0x1d')]=_['keys'](_0x5da21f[_0x76f5('0x1d')]);_0xb0fb04[_0x76f5('0x1e')]=_[_0x76f5('0x1f')](_0xb0fb04['model'],_0xb0fb04[_0x76f5('0x1d')]);_0x55e2ef[_0x76f5('0x20')]=_[_0x76f5('0x1f')](_0xb0fb04[_0x76f5('0x21')],qs[_0x76f5('0x22')](_0x5da21f[_0x76f5('0x1d')][_0x76f5('0x22')]));_0x55e2ef[_0x76f5('0x20')]=_0x55e2ef[_0x76f5('0x20')][_0x76f5('0x23')]?_0x55e2ef[_0x76f5('0x20')]:_0xb0fb04[_0x76f5('0x21')];if(!_0x5da21f[_0x76f5('0x1d')][_0x76f5('0x24')]('nolimit')){_0x55e2ef[_0x76f5('0xd')]=qs['limit'](_0x5da21f[_0x76f5('0x1d')][_0x76f5('0xd')]);_0x55e2ef[_0x76f5('0xa')]=qs['offset'](_0x5da21f['query'][_0x76f5('0xa')]);}_0x55e2ef[_0x76f5('0x25')]=qs[_0x76f5('0x26')](_0x5da21f[_0x76f5('0x1d')][_0x76f5('0x26')]);_0x55e2ef[_0x76f5('0x27')]=qs[_0x76f5('0x1e')](_[_0x76f5('0x28')](_0x5da21f['query'],_0xb0fb04[_0x76f5('0x1e')]),_0x3e5ba9);if(_0x5da21f[_0x76f5('0x1d')]['filter']){_0x55e2ef[_0x76f5('0x27')]=_[_0x76f5('0x29')](_0x55e2ef[_0x76f5('0x27')],{'$or':_[_0x76f5('0x1a')](_0x3e5ba9,function(_0x3a1077){if(_0x3a1077['type']!=='VIRTUAL'){var _0x34a474={};_0x34a474[_0x3a1077[_0x76f5('0x15')]]={'$like':'%'+_0x5da21f[_0x76f5('0x1d')][_0x76f5('0x2a')]+'%'};return _0x34a474;}})});}_0x55e2ef=_[_0x76f5('0x29')]({},_0x55e2ef,_0x5da21f[_0x76f5('0x2b')]);var _0x32bd27={'where':_0x55e2ef[_0x76f5('0x27')]};return db[_0x76f5('0x2c')][_0x76f5('0xc')](_0x32bd27)[_0x76f5('0x12')](function(_0x12af44){_0x52ca49[_0x76f5('0xc')]=_0x12af44;if(_0x5da21f[_0x76f5('0x1d')][_0x76f5('0x2d')]){_0x55e2ef[_0x76f5('0x2e')]=[{'all':!![]}];}return db[_0x76f5('0x2c')][_0x76f5('0x2f')](_0x55e2ef);})[_0x76f5('0x12')](function(_0x4feb0b){_0x52ca49[_0x76f5('0x30')]=_[_0x76f5('0x1a')](_0x4feb0b,function(_0x2bdcd9){if(_0x2bdcd9[_0x76f5('0x31')]==='MicrosoftAzure'){var _0x57e694=encryptor[_0x76f5('0x32')](_0x2bdcd9['data3']);_0x2bdcd9[_0x76f5('0x33')]=maskClientSecret(_0x57e694);}return _0x2bdcd9;});return _0x52ca49;})[_0x76f5('0x12')](respondWithFilteredResult(_0x8542d8,_0x55e2ef))[_0x76f5('0x34')](handleError(_0x8542d8,null));};exports['show']=function(_0x30bf30,_0x54fe91){var _0x25732e={'raw':!![],'where':{'id':_0x30bf30[_0x76f5('0x35')]['id']}},_0x5e3c9f={};_0x5e3c9f[_0x76f5('0x21')]=_[_0x76f5('0x36')](db[_0x76f5('0x2c')][_0x76f5('0x37')]);_0x5e3c9f['query']=_['keys'](_0x30bf30['query']);_0x5e3c9f[_0x76f5('0x1e')]=_[_0x76f5('0x1f')](_0x5e3c9f[_0x76f5('0x21')],_0x5e3c9f[_0x76f5('0x1d')]);_0x25732e['attributes']=_['intersection'](_0x5e3c9f['model'],qs[_0x76f5('0x22')](_0x30bf30[_0x76f5('0x1d')][_0x76f5('0x22')]));_0x25732e[_0x76f5('0x20')]=_0x25732e[_0x76f5('0x20')]['length']?_0x25732e[_0x76f5('0x20')]:_0x5e3c9f[_0x76f5('0x21')];if(_0x30bf30[_0x76f5('0x1d')][_0x76f5('0x2d')]){_0x25732e[_0x76f5('0x2e')]=[{'all':!![]}];}_0x25732e=_[_0x76f5('0x29')]({},_0x25732e,_0x30bf30[_0x76f5('0x2b')]);return db[_0x76f5('0x2c')][_0x76f5('0x38')](_0x25732e)[_0x76f5('0x12')](handleEntityNotFound(_0x54fe91,null))[_0x76f5('0x12')](function(_0x1f926e){if(_0x1f926e['service']==='MicrosoftAzure'){var _0x10138a=encryptor['decryptString'](_0x1f926e[_0x76f5('0x33')]);_0x1f926e['data3']=maskClientSecret(_0x10138a);}return _0x1f926e;})[_0x76f5('0x12')](respondWithResult(_0x54fe91,null))[_0x76f5('0x34')](handleError(_0x54fe91,null));};exports[_0x76f5('0x39')]=function(_0x1f3551,_0x35c5a4){if(!_0x1f3551['body']['name'])throw new Error(_0x76f5('0x3a'));if(!_0x1f3551[_0x76f5('0x3b')]['service'])throw new Error(_0x76f5('0x3c'));var _0x3e83b8=db[_0x76f5('0x2c')][_0x76f5('0x37')]['service']['values'];if(!_0x3e83b8[_0x76f5('0x3d')](_0x1f3551[_0x76f5('0x3b')][_0x76f5('0x31')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x3e83b8['join'](',\x20'));if(_0x1f3551[_0x76f5('0x3b')][_0x76f5('0x31')]===_0x76f5('0x3e')&&_0x1f3551[_0x76f5('0x3b')][_0x76f5('0x33')]){_0x1f3551[_0x76f5('0x3b')][_0x76f5('0x33')]=encryptor[_0x76f5('0x3f')](_0x1f3551['body'][_0x76f5('0x33')]);}return db[_0x76f5('0x2c')][_0x76f5('0x39')](_0x1f3551[_0x76f5('0x3b')],{})[_0x76f5('0x12')](respondWithResult(_0x35c5a4,0xc9))[_0x76f5('0x34')](handleError(_0x35c5a4,null));};exports[_0x76f5('0x11')]=function(_0x932953,_0x1ce90f){if(_0x932953[_0x76f5('0x3b')]['id']){delete _0x932953[_0x76f5('0x3b')]['id'];}return db[_0x76f5('0x2c')][_0x76f5('0x38')]({'where':{'id':_0x932953['params']['id']}})[_0x76f5('0x12')](handleEntityNotFound(_0x1ce90f,null))['then'](function(_0x5f1824){if(_0x5f1824[_0x76f5('0x31')]===_0x76f5('0x3e')&&_0x932953[_0x76f5('0x3b')][_0x76f5('0x33')]){_0x932953[_0x76f5('0x3b')][_0x76f5('0x33')]=encryptor[_0x76f5('0x3f')](_0x932953[_0x76f5('0x3b')][_0x76f5('0x33')]);}return _0x5f1824;})[_0x76f5('0x12')](saveUpdates(_0x932953['body'],null))[_0x76f5('0x12')](respondWithResult(_0x1ce90f,null))[_0x76f5('0x34')](handleError(_0x1ce90f,null));};exports[_0x76f5('0x40')]=function(_0x2d6eaf,_0xef7635){return db[_0x76f5('0x2c')][_0x76f5('0x38')]({'where':{'id':_0x2d6eaf[_0x76f5('0x35')]['id']}})[_0x76f5('0x12')](handleEntityNotFound(_0xef7635,null))[_0x76f5('0x12')](removeEntity(_0xef7635,null))[_0x76f5('0x34')](handleError(_0xef7635,null));};exports[_0x76f5('0x41')]=function(_0x55685c,_0x1d10ee){return db[_0x76f5('0x2c')][_0x76f5('0x42')]({'where':{'id':_0x55685c[_0x76f5('0x35')]['id']},'raw':!![]})[_0x76f5('0x12')](function(_0x59d292){if(!_0x59d292)return _0x1d10ee[_0x76f5('0x7')](0x194);return{'url':oauth[_0x76f5('0x43')](_0x59d292,_0x55685c[_0x76f5('0x44')]['id'])};})['then'](respondWithResult(_0x1d10ee,null))[_0x76f5('0x34')](handleError(_0x1d10ee,null));};exports[_0x76f5('0x45')]=function(_0x51e3a1,_0x25f6ac){var _0x11fc43=_0x51e3a1[_0x76f5('0x3b')];var _0x4a246a;var _0x451556;if(_0x11fc43['error'])throw _0x11fc43;redis[_0x76f5('0x46')](_0x11fc43[_0x76f5('0x47')])['then'](function(_0x582e27){if(!_0x582e27)throw new Error(_0x76f5('0x48'));_0x4a246a=JSON[_0x76f5('0x49')](_0x582e27);var _0x5c2c33=Buffer[_0x76f5('0x4a')](_0x11fc43['state'],_0x76f5('0x4b'))[_0x76f5('0x4c')](_0x76f5('0x4d'));_0x451556=JSON[_0x76f5('0x49')](_0x5c2c33);if(!oauth[_0x76f5('0x4e')](_0x11fc43['id_token'],_0x4a246a[_0x76f5('0x4f')]))throw new Error(_0x76f5('0x50'));redis[_0x76f5('0x51')](_0x11fc43[_0x76f5('0x47')]);return oauth[_0x76f5('0x52')](_0x11fc43[_0x76f5('0x53')],_0x4a246a);})[_0x76f5('0x12')](function(_0x29532f){_0x4a246a[_0x76f5('0x54')]=_0x29532f[_0x76f5('0x55')];_0x4a246a[_0x76f5('0x56')]=_0x29532f[_0x76f5('0x57')];return db['CloudProvider'][_0x76f5('0x11')]({'data5':_0x4a246a[_0x76f5('0x54')],'data6':_0x4a246a[_0x76f5('0x56')]},{'where':{'id':_0x4a246a['id']}});})[_0x76f5('0x12')](function(){oauth[_0x76f5('0x58')](_0x4a246a);socket[_0x76f5('0x59')]('microsoftAuthorization:success',{'id':_0x451556['id']});return;})['then'](respondWithStatusCode(_0x25f6ac,null))[_0x76f5('0x34')](function(_0x493f39){if(_0x451556){socket['emit'](_0x76f5('0x5a'),{'id':_0x451556['id']});}if(!_0x4a246a){logger[_0x76f5('0x13')](_0x76f5('0x5b'),_0x493f39);return _0x25f6ac[_0x76f5('0x9')](0x1f4)[_0x76f5('0x16')](_0x493f39[_0x76f5('0x5c')]);}logger['error'](_0x76f5('0x5d'),_0x4a246a['id'],JSON[_0x76f5('0x5e')](_0x493f39));});}; \ No newline at end of file +var _0xd061=['find','encryptString','destroy','oauth2MicrosoftAuthorize','params','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','data5','data6','microsoftAuthorization:success','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','defaults','redis','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','error','stack','name','send','padEnd','slice','index','map','rawAttributes','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','CloudProvider','includeAll','include','rows','service','MicrosoftAzure','decryptString','data3','catch','show','create','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join'];(function(_0x540515,_0x79f60b){var _0x535111=function(_0x3b79cd){while(--_0x3b79cd){_0x540515['push'](_0x540515['shift']());}};_0x535111(++_0x79f60b);}(_0xd061,0x190));var _0x1d06=function(_0x3963bd,_0x375a34){_0x3963bd=_0x3963bd-0x0;var _0x47f794=_0xd061[_0x3963bd];return _0x47f794;};'use strict';var _=require(_0x1d06('0x0'));var Redis=require(_0x1d06('0x1'));var qs=require(_0x1d06('0x2'));var encryptor=require(_0x1d06('0x3'));var config=require(_0x1d06('0x4'));var logger=require(_0x1d06('0x5'))(_0x1d06('0x6'));var db=require(_0x1d06('0x7'))['db'];var oauth=require(_0x1d06('0x8'));config['redis']=_[_0x1d06('0x9')](config[_0x1d06('0xa')],{'host':_0x1d06('0xb'),'port':0x18eb});var socket=require(_0x1d06('0xc'))(new Redis(config['redis']));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x4151f3,_0x3c57e3){_0x3c57e3=_0x3c57e3||0xcc;return function(_0x4eaaaa){if(_0x4eaaaa){return _0x4151f3[_0x1d06('0xd')](_0x3c57e3);}return _0x4151f3[_0x1d06('0xe')](_0x3c57e3)[_0x1d06('0xf')]();};}function respondWithResult(_0x3c13e6,_0x48836d){_0x48836d=_0x48836d||0xc8;return function(_0x41e97b){if(_0x41e97b){return _0x3c13e6[_0x1d06('0xe')](_0x48836d)[_0x1d06('0x10')](_0x41e97b);}};}function respondWithFilteredResult(_0x393e68,_0x4c963e){return function(_0x4f4eab){if(_0x4f4eab){var _0x5e04fd=typeof _0x4c963e[_0x1d06('0x11')]===_0x1d06('0x12')&&typeof _0x4c963e[_0x1d06('0x13')]==='undefined';var _0x47dc44=_0x4f4eab[_0x1d06('0x14')];var _0x2d208a=_0x5e04fd?0x0:_0x4c963e['offset'];var _0x56ba12=_0x5e04fd?_0x4f4eab[_0x1d06('0x14')]:_0x4c963e[_0x1d06('0x11')]+_0x4c963e[_0x1d06('0x13')];var _0x377db6;if(_0x56ba12>=_0x47dc44){_0x56ba12=_0x47dc44;_0x377db6=0xc8;}else{_0x377db6=0xce;}_0x393e68['status'](_0x377db6);return _0x393e68[_0x1d06('0x15')](_0x1d06('0x16'),_0x2d208a+'-'+_0x56ba12+'/'+_0x47dc44)[_0x1d06('0x10')](_0x4f4eab);}return null;};}function saveUpdates(_0x41925c){return function(_0x33b9a5){if(_0x33b9a5){return _0x33b9a5[_0x1d06('0x17')](_0x41925c)[_0x1d06('0x18')](function(_0x183825){return _0x183825;});}return null;};}function removeEntity(_0x3548fc){return function(_0x444fd2){if(_0x444fd2){return _0x444fd2['destroy']()[_0x1d06('0x18')](function(){_0x3548fc[_0x1d06('0xe')](0xcc)[_0x1d06('0xf')]();});}};}function handleEntityNotFound(_0x44c016){return function(_0x15881c){if(!_0x15881c){_0x44c016[_0x1d06('0xd')](0x194);}return _0x15881c;};}function handleError(_0x581e6f,_0x313fd9){_0x313fd9=_0x313fd9||0x1f4;return function(_0x2b1e80){logger[_0x1d06('0x19')](_0x2b1e80[_0x1d06('0x1a')]);if(_0x2b1e80['name']){delete _0x2b1e80[_0x1d06('0x1b')];}_0x581e6f[_0x1d06('0xe')](_0x313fd9)[_0x1d06('0x1c')](_0x2b1e80);};}function maskClientSecret(_0x29752f){return _[_0x1d06('0x1d')](_0x29752f[_0x1d06('0x1e')](0x0,0x3),0x14,'*');}exports[_0x1d06('0x1f')]=function(_0x529a52,_0x498cef){var _0x173404={},_0x506a08={},_0x2075a9={'count':0x0,'rows':[]};var _0x4201b4=_[_0x1d06('0x20')](db['CloudProvider'][_0x1d06('0x21')],function(_0x380b2d){return{'name':_0x380b2d['fieldName'],'type':_0x380b2d[_0x1d06('0x22')][_0x1d06('0x23')]};});_0x506a08[_0x1d06('0x24')]=_[_0x1d06('0x20')](_0x4201b4,_0x1d06('0x1b'));_0x506a08['query']=_[_0x1d06('0x25')](_0x529a52[_0x1d06('0x26')]);_0x506a08['filters']=_[_0x1d06('0x27')](_0x506a08[_0x1d06('0x24')],_0x506a08[_0x1d06('0x26')]);_0x173404['attributes']=_[_0x1d06('0x27')](_0x506a08['model'],qs['fields'](_0x529a52['query'][_0x1d06('0x28')]));_0x173404[_0x1d06('0x29')]=_0x173404[_0x1d06('0x29')][_0x1d06('0x2a')]?_0x173404[_0x1d06('0x29')]:_0x506a08['model'];if(!_0x529a52[_0x1d06('0x26')][_0x1d06('0x2b')](_0x1d06('0x2c'))){_0x173404[_0x1d06('0x13')]=qs['limit'](_0x529a52[_0x1d06('0x26')][_0x1d06('0x13')]);_0x173404[_0x1d06('0x11')]=qs[_0x1d06('0x11')](_0x529a52[_0x1d06('0x26')][_0x1d06('0x11')]);}_0x173404[_0x1d06('0x2d')]=qs[_0x1d06('0x2e')](_0x529a52[_0x1d06('0x26')][_0x1d06('0x2e')]);_0x173404['where']=qs[_0x1d06('0x2f')](_[_0x1d06('0x30')](_0x529a52[_0x1d06('0x26')],_0x506a08[_0x1d06('0x2f')]),_0x4201b4);if(_0x529a52[_0x1d06('0x26')][_0x1d06('0x31')]){_0x173404[_0x1d06('0x32')]=_[_0x1d06('0x33')](_0x173404[_0x1d06('0x32')],{'$or':_[_0x1d06('0x20')](_0x4201b4,function(_0x559c94){if(_0x559c94[_0x1d06('0x22')]!=='VIRTUAL'){var _0x4be424={};_0x4be424[_0x559c94['name']]={'$like':'%'+_0x529a52[_0x1d06('0x26')][_0x1d06('0x31')]+'%'};return _0x4be424;}})});}_0x173404=_[_0x1d06('0x33')]({},_0x173404,_0x529a52[_0x1d06('0x34')]);var _0x8701c7={'where':_0x173404[_0x1d06('0x32')]};return db[_0x1d06('0x35')]['count'](_0x8701c7)[_0x1d06('0x18')](function(_0x439f4e){_0x2075a9[_0x1d06('0x14')]=_0x439f4e;if(_0x529a52[_0x1d06('0x26')][_0x1d06('0x36')]){_0x173404[_0x1d06('0x37')]=[{'all':!![]}];}return db[_0x1d06('0x35')]['findAll'](_0x173404);})[_0x1d06('0x18')](function(_0x5ed547){_0x2075a9[_0x1d06('0x38')]=_[_0x1d06('0x20')](_0x5ed547,function(_0x41dcd4){if(_0x41dcd4[_0x1d06('0x39')]===_0x1d06('0x3a')){var _0x176886=encryptor[_0x1d06('0x3b')](_0x41dcd4[_0x1d06('0x3c')]);_0x41dcd4[_0x1d06('0x3c')]=maskClientSecret(_0x176886);}return _0x41dcd4;});return _0x2075a9;})['then'](respondWithFilteredResult(_0x498cef,_0x173404))[_0x1d06('0x3d')](handleError(_0x498cef,null));};exports[_0x1d06('0x3e')]=function(_0x1ee11f,_0x437450){var _0x1b141f={'raw':!![],'where':{'id':_0x1ee11f['params']['id']}},_0x40ea77={};_0x40ea77[_0x1d06('0x24')]=_[_0x1d06('0x25')](db['CloudProvider'][_0x1d06('0x21')]);_0x40ea77['query']=_['keys'](_0x1ee11f[_0x1d06('0x26')]);_0x40ea77['filters']=_['intersection'](_0x40ea77[_0x1d06('0x24')],_0x40ea77[_0x1d06('0x26')]);_0x1b141f[_0x1d06('0x29')]=_['intersection'](_0x40ea77[_0x1d06('0x24')],qs[_0x1d06('0x28')](_0x1ee11f['query']['fields']));_0x1b141f[_0x1d06('0x29')]=_0x1b141f[_0x1d06('0x29')]['length']?_0x1b141f[_0x1d06('0x29')]:_0x40ea77[_0x1d06('0x24')];if(_0x1ee11f[_0x1d06('0x26')][_0x1d06('0x36')]){_0x1b141f['include']=[{'all':!![]}];}_0x1b141f=_[_0x1d06('0x33')]({},_0x1b141f,_0x1ee11f[_0x1d06('0x34')]);return db[_0x1d06('0x35')]['find'](_0x1b141f)[_0x1d06('0x18')](handleEntityNotFound(_0x437450,null))[_0x1d06('0x18')](function(_0x1abb75){if(_0x1abb75[_0x1d06('0x39')]==='MicrosoftAzure'){var _0x385fee=encryptor[_0x1d06('0x3b')](_0x1abb75[_0x1d06('0x3c')]);_0x1abb75['data3']=maskClientSecret(_0x385fee);}return _0x1abb75;})[_0x1d06('0x18')](respondWithResult(_0x437450,null))[_0x1d06('0x3d')](handleError(_0x437450,null));};exports[_0x1d06('0x3f')]=function(_0x47c7c6,_0x111a3d){if(!_0x47c7c6[_0x1d06('0x40')][_0x1d06('0x1b')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x47c7c6[_0x1d06('0x40')][_0x1d06('0x39')])throw new Error(_0x1d06('0x41'));var _0x3bf0ad=db['CloudProvider'][_0x1d06('0x21')][_0x1d06('0x39')][_0x1d06('0x42')];if(!_0x3bf0ad[_0x1d06('0x43')](_0x47c7c6[_0x1d06('0x40')][_0x1d06('0x39')]))throw new Error(_0x1d06('0x44')+_0x3bf0ad[_0x1d06('0x45')](',\x20'));if(_0x47c7c6[_0x1d06('0x40')][_0x1d06('0x39')]===_0x1d06('0x3a')&&_0x47c7c6['body']['data3']){_0x47c7c6['body'][_0x1d06('0x3c')]=encryptor['encryptString'](_0x47c7c6[_0x1d06('0x40')]['data3']);}return db[_0x1d06('0x35')]['create'](_0x47c7c6[_0x1d06('0x40')],{})[_0x1d06('0x18')](respondWithResult(_0x111a3d,0xc9))[_0x1d06('0x3d')](handleError(_0x111a3d,null));};exports[_0x1d06('0x17')]=function(_0x13c15d,_0x132838){if(_0x13c15d[_0x1d06('0x40')]['id']){delete _0x13c15d[_0x1d06('0x40')]['id'];}return db[_0x1d06('0x35')][_0x1d06('0x46')]({'where':{'id':_0x13c15d['params']['id']}})[_0x1d06('0x18')](handleEntityNotFound(_0x132838,null))['then'](function(_0x13440b){if(_0x13440b[_0x1d06('0x39')]==='MicrosoftAzure'&&_0x13c15d[_0x1d06('0x40')]['data3']){_0x13c15d[_0x1d06('0x40')][_0x1d06('0x3c')]=encryptor[_0x1d06('0x47')](_0x13c15d[_0x1d06('0x40')][_0x1d06('0x3c')]);}return _0x13440b;})[_0x1d06('0x18')](saveUpdates(_0x13c15d[_0x1d06('0x40')],null))['then'](respondWithResult(_0x132838,null))['catch'](handleError(_0x132838,null));};exports[_0x1d06('0x48')]=function(_0xfdef48,_0x28d10e){return db[_0x1d06('0x35')][_0x1d06('0x46')]({'where':{'id':_0xfdef48['params']['id']}})['then'](handleEntityNotFound(_0x28d10e,null))['then'](removeEntity(_0x28d10e,null))['catch'](handleError(_0x28d10e,null));};exports[_0x1d06('0x49')]=function(_0x2fc5ae,_0x40cec6){return db[_0x1d06('0x35')]['findOne']({'where':{'id':_0x2fc5ae[_0x1d06('0x4a')]['id']},'raw':!![]})['then'](function(_0x1457e7){if(!_0x1457e7)return _0x40cec6['sendStatus'](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x1457e7,_0x2fc5ae['user']['id'])};})[_0x1d06('0x18')](respondWithResult(_0x40cec6,null))[_0x1d06('0x3d')](handleError(_0x40cec6,null));};exports[_0x1d06('0x4b')]=function(_0xbb593a,_0x2959c1){var _0x2d2e62=_0xbb593a[_0x1d06('0x40')];var _0x11c399;var _0x3c0ebd;if(_0x2d2e62[_0x1d06('0x19')])throw _0x2d2e62;redis[_0x1d06('0x4c')](_0x2d2e62[_0x1d06('0x4d')])[_0x1d06('0x18')](function(_0xf97ca8){if(!_0xf97ca8)throw new Error(_0x1d06('0x4e'));_0x11c399=JSON[_0x1d06('0x4f')](_0xf97ca8);var _0x1b8f82=Buffer[_0x1d06('0x50')](_0x2d2e62[_0x1d06('0x4d')],_0x1d06('0x51'))[_0x1d06('0x52')](_0x1d06('0x53'));_0x3c0ebd=JSON[_0x1d06('0x4f')](_0x1b8f82);if(!oauth[_0x1d06('0x54')](_0x2d2e62['id_token'],_0x11c399[_0x1d06('0x55')]))throw new Error(_0x1d06('0x56'));redis['del'](_0x2d2e62[_0x1d06('0x4d')]);return oauth[_0x1d06('0x57')](_0x2d2e62['code'],_0x11c399);})[_0x1d06('0x18')](function(_0x17b5bd){_0x11c399[_0x1d06('0x58')]=_0x17b5bd['access_token'];_0x11c399[_0x1d06('0x59')]=_0x17b5bd['refresh_token'];return db[_0x1d06('0x35')][_0x1d06('0x17')]({'data5':_0x11c399[_0x1d06('0x58')],'data6':_0x11c399[_0x1d06('0x59')]},{'where':{'id':_0x11c399['id']}});})[_0x1d06('0x18')](function(){oauth['startRefreshInterval'](_0x11c399);socket['emit'](_0x1d06('0x5a'),{'id':_0x3c0ebd['id']});return;})['then'](respondWithStatusCode(_0x2959c1,null))['catch'](function(_0xed998d){if(_0x3c0ebd){socket['emit']('microsoftAuthorization:error',{'id':_0x3c0ebd['id']});}if(!_0x11c399){logger[_0x1d06('0x19')](_0x1d06('0x5b'),_0xed998d);return _0x2959c1['status'](0x1f4)[_0x1d06('0x1c')](_0xed998d[_0x1d06('0x5c')]);}logger[_0x1d06('0x19')](_0x1d06('0x5d'),_0x11c399['id'],JSON['stringify'](_0xed998d));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 063e711..a791ea8 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 _0x92ea=['bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','define','CloudProvider','cloud_providers','lodash','../../config/logger','moment'];(function(_0x5452c9,_0xc7ea83){var _0x2ca4e1=function(_0x292233){while(--_0x292233){_0x5452c9['push'](_0x5452c9['shift']());}};_0x2ca4e1(++_0xc7ea83);}(_0x92ea,0x75));var _0xa92e=function(_0x21e834,_0x29609a){_0x21e834=_0x21e834-0x0;var _0x238b7b=_0x92ea[_0x21e834];return _0x238b7b;};'use strict';var _=require(_0xa92e('0x0'));var util=require('util');var logger=require(_0xa92e('0x1'))('api');var moment=require(_0xa92e('0x2'));var BPromise=require(_0xa92e('0x3'));var rp=require(_0xa92e('0x4'));var fs=require('fs');var path=require(_0xa92e('0x5'));var rimraf=require(_0xa92e('0x6'));var config=require(_0xa92e('0x7'));var attributes=require(_0xa92e('0x8'));module['exports']=function(_0x468d33,_0x31360d){return _0x468d33[_0xa92e('0x9')](_0xa92e('0xa'),attributes,{'tableName':_0xa92e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3c4e=['rimraf','./cloudProvider.attributes','define','CloudProvider','cloud_providers','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x52ce60,_0x15acc1){var _0x3084db=function(_0x1678b6){while(--_0x1678b6){_0x52ce60['push'](_0x52ce60['shift']());}};_0x3084db(++_0x15acc1);}(_0x3c4e,0x89));var _0xe3c4=function(_0xd9f348,_0x1af746){_0xd9f348=_0xd9f348-0x0;var _0x5466e4=_0x3c4e[_0xd9f348];return _0x5466e4;};'use strict';var _=require('lodash');var util=require(_0xe3c4('0x0'));var logger=require(_0xe3c4('0x1'))('api');var moment=require(_0xe3c4('0x2'));var BPromise=require(_0xe3c4('0x3'));var rp=require(_0xe3c4('0x4'));var fs=require('fs');var path=require(_0xe3c4('0x5'));var rimraf=require(_0xe3c4('0x6'));var config=require('../../config/environment');var attributes=require(_0xe3c4('0x7'));module['exports']=function(_0x231c25,_0x5a5665){return _0x231c25[_0xe3c4('0x8')](_0xe3c4('0x9'),attributes,{'tableName':_0xe3c4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index d918e6f..a1dc990 100644 --- a/server/api/cloudProvider/cloudProvider.oauth.js +++ b/server/api/cloudProvider/cloudProvider.oauth.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb30f=['response_type','redirect_uri','data4','response_mode','form_post','scope','state','nonce','login','oauth2Claims','oauth2/','decode','audience','isAfter','unix','resolve','then','data3','CloudProvider','findOne','refresh_token','decryptString','POST','data2','access_token','data6','data5','catch','error','authorization_code','intervals','bind','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','jsonwebtoken','moment','ioredis','util','../../components/encryptor','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','redis','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','map','type','data7','/.default','join','Outlook365','Dynamics365','replace','{TENANT_ID}','code','id_token','stringify','toString','base64','hex','data1'];(function(_0x4718ec,_0x3b053d){var _0x1e9767=function(_0x1b22d5){while(--_0x1b22d5){_0x4718ec['push'](_0x4718ec['shift']());}};_0x1e9767(++_0x3b053d);}(_0xb30f,0xf5));var _0xfb30=function(_0x103d86,_0x26d081){_0x103d86=_0x103d86-0x0;var _0x2c811b=_0xb30f[_0x103d86];return _0x2c811b;};'use strict';var _=require(_0xfb30('0x0'));var crypto=require('crypto');var jwt=require(_0xfb30('0x1'));var moment=require(_0xfb30('0x2'));var Redis=require(_0xfb30('0x3'));var rp=require('request-promise');var util=require(_0xfb30('0x4'));var encryptor=require(_0xfb30('0x5'));var config=require(_0xfb30('0x6'));var logger=require(_0xfb30('0x7'))('api');var schedule=require(_0xfb30('0x8'));var db=require(_0xfb30('0x9'))['db'];config[_0xfb30('0xa')]=_['defaults'](config[_0xfb30('0xa')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0xfb30('0xa')]);var MICROSOFT_AUTH_URL=_0xfb30('0xb');var AZURE_AUTH_SCOPES={'Outlook365':[_0xfb30('0xc'),_0xfb30('0xd'),_0xfb30('0xe'),_0xfb30('0xf'),_0xfb30('0x10'),'https://outlook.office.com/POP.AccessAsUser.All',_0xfb30('0x11')],'Dynamics365':[_0xfb30('0xc'),_0xfb30('0xf')]};var MICROSOFT_AUTH_ENDPOINT=_0xfb30('0x12');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x1a50ed){var _0x2e8e20=_[_0xfb30('0x13')](AZURE_AUTH_SCOPES[_0x1a50ed['type']]);if(_0x1a50ed[_0xfb30('0x14')]==='Dynamics365')_0x2e8e20['push'](_0x1a50ed[_0xfb30('0x15')]+_0xfb30('0x16'));return _0x2e8e20[_0xfb30('0x17')]('\x20');}function getAccessTokenScope(_0x1b8d3f){if(_0x1b8d3f['type']===_0xfb30('0x18'))return _0xfb30('0x10');if(_0x1b8d3f[_0xfb30('0x14')]===_0xfb30('0x19'))return _0x1b8d3f[_0xfb30('0x15')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x5bfc99,_0x47cb8d){var _0x162f75=MICROSOFT_AUTH_URL[_0xfb30('0x1a')](_0xfb30('0x1b'),_0x5bfc99['data2']);var _0x2f7a93=[_0xfb30('0x1c'),_0xfb30('0x1d')];var _0x1d4b0c=Buffer['from'](JSON[_0xfb30('0x1e')]({'id':_0x47cb8d}))[_0xfb30('0x1f')](_0xfb30('0x20'));var _0x4f0864=crypto['randomBytes'](0x10)[_0xfb30('0x1f')](_0xfb30('0x21'));var _0x43bc33=getAuthorizationScopes(_0x5bfc99);var _0x3f845c=[{'key':'client_id','value':_0x5bfc99[_0xfb30('0x22')]},{'key':_0xfb30('0x23'),'value':encodeURIComponent(_0x2f7a93['join']('\x20'))},{'key':_0xfb30('0x24'),'value':_0x5bfc99[_0xfb30('0x25')]},{'key':_0xfb30('0x26'),'value':_0xfb30('0x27')},{'key':_0xfb30('0x28'),'value':encodeURIComponent(_0x43bc33)},{'key':_0xfb30('0x29'),'value':_0x1d4b0c},{'key':_0xfb30('0x2a'),'value':_0x4f0864},{'key':'prompt','value':_0xfb30('0x2b')}];var _0x284b6a=_0x162f75+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xfb30('0x13')](_0x3f845c,function(_0x50d43f){return _0x50d43f['key']+'='+_0x50d43f['value'];})[_0xfb30('0x17')]('&');_0x5bfc99[_0xfb30('0x2c')]={'issuer':_0x162f75[_0xfb30('0x1a')](_0xfb30('0x2d'),''),'audience':_0x5bfc99['data1'],'state':_0x1d4b0c,'nonce':_0x4f0864};redis['set'](_0x1d4b0c,JSON['stringify'](_0x5bfc99));return _0x284b6a;}function isValidIdToken(_0x1cde45,_0xdaa7ec){try{var _0x120315=jwt[_0xfb30('0x2e')](_0x1cde45,{'complete':!![]});var _0x25d6f3=_0x120315['payload'];if(_0x25d6f3['iss']!==_0xdaa7ec['issuer'])return![];if(_0x25d6f3['aud']!==_0xdaa7ec[_0xfb30('0x2f')])return![];if(_0x25d6f3[_0xfb30('0x2a')]!==_0xdaa7ec[_0xfb30('0x2a')])return![];if(moment()[_0xfb30('0x30')](moment[_0xfb30('0x31')](_0x25d6f3['exp'])))return![];return!![];}catch(_0x3fc823){throw _0x3fc823;}}function refreshOauth2MicrosoftAccessToken(_0x427526){return Promise[_0xfb30('0x32')]()[_0xfb30('0x33')](function(){if(_0x427526[_0xfb30('0x34')])return _0x427526;return db[_0xfb30('0x35')][_0xfb30('0x36')]({'where':{'id':_0x427526['id']},'raw':!![]});})[_0xfb30('0x33')](function(_0x41ff9a){var _0x9fe891={'grant_type':_0xfb30('0x37'),'refresh_token':_0x41ff9a['data6'],'scope':getAccessTokenScope(_0x41ff9a),'redirect_uri':_0x41ff9a[_0xfb30('0x25')],'client_id':_0x41ff9a['data1'],'client_secret':encryptor[_0xfb30('0x38')](_0x41ff9a[_0xfb30('0x34')])};var _0x5e347e={'method':_0xfb30('0x39'),'uri':MICROSOFT_AUTH_URL[_0xfb30('0x1a')](_0xfb30('0x1b'),_0x41ff9a[_0xfb30('0x3a')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x9fe891,'json':!![]};return rp(_0x5e347e);})[_0xfb30('0x33')](function(_0x318300){_0x427526['data5']=_0x318300[_0xfb30('0x3b')];_0x427526[_0xfb30('0x3c')]=_0x318300['refresh_token'];return db[_0xfb30('0x35')]['update']({'data5':_0x427526[_0xfb30('0x3d')],'data6':_0x427526[_0xfb30('0x3c')]},{'where':{'id':_0x427526['id']}});})[_0xfb30('0x33')](function(){return _0x427526;})[_0xfb30('0x3e')](function(_0x5a397c){logger[_0xfb30('0x3f')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x427526['id'],_0x5a397c);});}function getOauth2MicrosoftAccessToken(_0x32a820,_0x4e4cfa){var _0x3383de={'grant_type':_0xfb30('0x40'),'code':_0x32a820,'scope':getAccessTokenScope(_0x4e4cfa),'redirect_uri':_0x4e4cfa[_0xfb30('0x25')],'client_id':_0x4e4cfa[_0xfb30('0x22')],'client_secret':encryptor[_0xfb30('0x38')](_0x4e4cfa[_0xfb30('0x34')])};var _0x269c94={'method':_0xfb30('0x39'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x4e4cfa[_0xfb30('0x3a')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3383de,'json':!![]};return rp(_0x269c94);}function startRefreshInterval(_0xd18cff){var _0x193bec=schedule[_0xfb30('0x41')];if(_0x193bec[_0xd18cff['id']])clearInterval(_0x193bec[_0xd18cff['id']]);_0x193bec[_0xd18cff['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xfb30('0x42')](this,{'id':_0xd18cff['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xfb30('0x41')]=_0x193bec;}function startAllRefreshIntervals(){return db[_0xfb30('0x35')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x1d9cd9){var _0x4c7463=_0x1d9cd9['map'](function(_0x397f3c){return refreshOauth2MicrosoftAccessToken(_0x397f3c)[_0xfb30('0x33')](function(_0x92da55){startRefreshInterval(_0x92da55);});});return Promise[_0xfb30('0x43')](_0x4c7463);})['catch'](function(_0x125060){var _0x10c817=_0x125060?util[_0xfb30('0x44')](_0x125060,{'showHidden':![],'depth':null}):'';logger[_0xfb30('0x3f')](_0xfb30('0x45'),_0x10c817);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0xd044=['state','prompt','login','key','oauth2Claims','oauth2/','data1','set','decode','payload','issuer','aud','audience','nonce','isAfter','unix','resolve','data3','CloudProvider','findOne','refresh_token','data6','POST','then','update','data5','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','decryptString','intervals','bind','findAll','all','catch','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','openid','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','offline_access','/token','map','type','Dynamics365','push','data7','/.default','replace','{TENANT_ID}','data2','code','id_token','stringify','toString','base64','hex','client_id','response_type','join','data4','response_mode','form_post','scope'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xd044,0xc5));var _0x4d04=function(_0x4ceaa8,_0x452176){_0x4ceaa8=_0x4ceaa8-0x0;var _0x94bff6=_0xd044[_0x4ceaa8];return _0x94bff6;};'use strict';var _=require(_0x4d04('0x0'));var crypto=require(_0x4d04('0x1'));var jwt=require(_0x4d04('0x2'));var moment=require(_0x4d04('0x3'));var Redis=require(_0x4d04('0x4'));var rp=require(_0x4d04('0x5'));var util=require(_0x4d04('0x6'));var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require(_0x4d04('0x7'))(_0x4d04('0x8'));var schedule=require(_0x4d04('0x9'));var db=require(_0x4d04('0xa'))['db'];config[_0x4d04('0xb')]=_[_0x4d04('0xc')](config['redis'],{'host':_0x4d04('0xd'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x4d04('0xe'),_0x4d04('0xf'),_0x4d04('0x10'),'offline_access',_0x4d04('0x11'),_0x4d04('0x12'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x4d04('0xe'),_0x4d04('0x13')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x4d04('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x211211){var _0x33a5ab=_[_0x4d04('0x15')](AZURE_AUTH_SCOPES[_0x211211[_0x4d04('0x16')]]);if(_0x211211[_0x4d04('0x16')]===_0x4d04('0x17'))_0x33a5ab[_0x4d04('0x18')](_0x211211[_0x4d04('0x19')]+_0x4d04('0x1a'));return _0x33a5ab['join']('\x20');}function getAccessTokenScope(_0x51b95e){if(_0x51b95e[_0x4d04('0x16')]==='Outlook365')return _0x4d04('0x11');if(_0x51b95e[_0x4d04('0x16')]===_0x4d04('0x17'))return _0x51b95e[_0x4d04('0x19')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x1eafe7,_0x53507f){var _0x114c63=MICROSOFT_AUTH_URL[_0x4d04('0x1b')](_0x4d04('0x1c'),_0x1eafe7[_0x4d04('0x1d')]);var _0x555a18=[_0x4d04('0x1e'),_0x4d04('0x1f')];var _0xd9cd4a=Buffer['from'](JSON[_0x4d04('0x20')]({'id':_0x53507f}))[_0x4d04('0x21')](_0x4d04('0x22'));var _0x428021=crypto['randomBytes'](0x10)[_0x4d04('0x21')](_0x4d04('0x23'));var _0xb6236d=getAuthorizationScopes(_0x1eafe7);var _0x25042c=[{'key':_0x4d04('0x24'),'value':_0x1eafe7['data1']},{'key':_0x4d04('0x25'),'value':encodeURIComponent(_0x555a18[_0x4d04('0x26')]('\x20'))},{'key':'redirect_uri','value':_0x1eafe7[_0x4d04('0x27')]},{'key':_0x4d04('0x28'),'value':_0x4d04('0x29')},{'key':_0x4d04('0x2a'),'value':encodeURIComponent(_0xb6236d)},{'key':_0x4d04('0x2b'),'value':_0xd9cd4a},{'key':'nonce','value':_0x428021},{'key':_0x4d04('0x2c'),'value':_0x4d04('0x2d')}];var _0x42a267=_0x114c63+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x4d04('0x15')](_0x25042c,function(_0x3bb4ec){return _0x3bb4ec[_0x4d04('0x2e')]+'='+_0x3bb4ec['value'];})[_0x4d04('0x26')]('&');_0x1eafe7[_0x4d04('0x2f')]={'issuer':_0x114c63[_0x4d04('0x1b')](_0x4d04('0x30'),''),'audience':_0x1eafe7[_0x4d04('0x31')],'state':_0xd9cd4a,'nonce':_0x428021};redis[_0x4d04('0x32')](_0xd9cd4a,JSON['stringify'](_0x1eafe7));return _0x42a267;}function isValidIdToken(_0xd454ed,_0x4b50ff){try{var _0x5bb51f=jwt[_0x4d04('0x33')](_0xd454ed,{'complete':!![]});var _0x49b329=_0x5bb51f[_0x4d04('0x34')];if(_0x49b329['iss']!==_0x4b50ff[_0x4d04('0x35')])return![];if(_0x49b329[_0x4d04('0x36')]!==_0x4b50ff[_0x4d04('0x37')])return![];if(_0x49b329[_0x4d04('0x38')]!==_0x4b50ff['nonce'])return![];if(moment()[_0x4d04('0x39')](moment[_0x4d04('0x3a')](_0x49b329['exp'])))return![];return!![];}catch(_0x829c67){throw _0x829c67;}}function refreshOauth2MicrosoftAccessToken(_0x8d9ce6){return Promise[_0x4d04('0x3b')]()['then'](function(){if(_0x8d9ce6[_0x4d04('0x3c')])return _0x8d9ce6;return db[_0x4d04('0x3d')][_0x4d04('0x3e')]({'where':{'id':_0x8d9ce6['id']},'raw':!![]});})['then'](function(_0x212254){var _0x59531c={'grant_type':_0x4d04('0x3f'),'refresh_token':_0x212254[_0x4d04('0x40')],'scope':getAccessTokenScope(_0x212254),'redirect_uri':_0x212254[_0x4d04('0x27')],'client_id':_0x212254[_0x4d04('0x31')],'client_secret':encryptor['decryptString'](_0x212254[_0x4d04('0x3c')])};var _0x25b341={'method':_0x4d04('0x41'),'uri':MICROSOFT_AUTH_URL[_0x4d04('0x1b')](_0x4d04('0x1c'),_0x212254[_0x4d04('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x59531c,'json':!![]};return rp(_0x25b341);})[_0x4d04('0x42')](function(_0x316715){_0x8d9ce6['data5']=_0x316715['access_token'];_0x8d9ce6['data6']=_0x316715[_0x4d04('0x3f')];return db['CloudProvider'][_0x4d04('0x43')]({'data5':_0x8d9ce6[_0x4d04('0x44')],'data6':_0x8d9ce6[_0x4d04('0x40')]},{'where':{'id':_0x8d9ce6['id']}});})[_0x4d04('0x42')](function(){return _0x8d9ce6;})['catch'](function(_0x4ccd7e){logger['error'](_0x4d04('0x45'),_0x8d9ce6['id'],_0x4ccd7e);});}function getOauth2MicrosoftAccessToken(_0xeb867e,_0x5f2e9b){var _0x1086a9={'grant_type':_0x4d04('0x46'),'code':_0xeb867e,'scope':getAccessTokenScope(_0x5f2e9b),'redirect_uri':_0x5f2e9b[_0x4d04('0x27')],'client_id':_0x5f2e9b[_0x4d04('0x31')],'client_secret':encryptor[_0x4d04('0x47')](_0x5f2e9b[_0x4d04('0x3c')])};var _0x1cae1b={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x4d04('0x1b')]('{TENANT_ID}',_0x5f2e9b[_0x4d04('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1086a9,'json':!![]};return rp(_0x1cae1b);}function startRefreshInterval(_0x2682cb){var _0x2c1d8f=schedule[_0x4d04('0x48')];if(_0x2c1d8f[_0x2682cb['id']])clearInterval(_0x2c1d8f[_0x2682cb['id']]);_0x2c1d8f[_0x2682cb['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x4d04('0x49')](this,{'id':_0x2682cb['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x2c1d8f;}function startAllRefreshIntervals(){return db[_0x4d04('0x3d')][_0x4d04('0x4a')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x4d04('0x42')](function(_0x137f36){var _0x1efe7c=_0x137f36[_0x4d04('0x15')](function(_0x5d6d9d){return refreshOauth2MicrosoftAccessToken(_0x5d6d9d)['then'](function(_0x4f641d){startRefreshInterval(_0x4f641d);});});return Promise[_0x4d04('0x4b')](_0x1efe7c);})[_0x4d04('0x4c')](function(_0x30d273){var _0x57db8a=_0x30d273?util[_0x4d04('0x4d')](_0x30d273,{'showHidden':![],'depth':null}):'';logger[_0x4d04('0x4e')](_0x4d04('0x4f'),_0x57db8a);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 83f1737..4ffe540 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 _0x5a13=['stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s'];(function(_0x50a566,_0x345adc){var _0x205c5d=function(_0x105a0e){while(--_0x105a0e){_0x50a566['push'](_0x50a566['shift']());}};_0x205c5d(++_0x345adc);}(_0x5a13,0x92));var _0x35a1=function(_0x520911,_0x2c0c36){_0x520911=_0x520911-0x0;var _0x3fee43=_0x5a13[_0x520911];return _0x3fee43;};'use strict';var _=require('lodash');var util=require(_0x35a1('0x0'));var moment=require(_0x35a1('0x1'));var BPromise=require(_0x35a1('0x2'));var rs=require(_0x35a1('0x3'));var fs=require('fs');var Redis=require(_0x35a1('0x4'));var db=require(_0x35a1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x35a1('0x6'))('rpc');var config=require(_0x35a1('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4222a1,_0x3bd7c9,_0xb00a35){return new BPromise(function(_0x3ed235,_0x78d296){return client['request'](_0x4222a1,_0xb00a35)[_0x35a1('0x8')](function(_0x469d94){logger[_0x35a1('0x9')](_0x35a1('0xa'),_0x3bd7c9,_0x35a1('0xb'));logger[_0x35a1('0xc')](_0x35a1('0xd'),_0x3bd7c9,_0x35a1('0xb'),JSON[_0x35a1('0xe')](_0x469d94));if(_0x469d94['error']){if(_0x469d94[_0x35a1('0xf')][_0x35a1('0x10')]===0x1f4){logger[_0x35a1('0xf')](_0x35a1('0xa'),_0x3bd7c9,_0x469d94[_0x35a1('0xf')]['message']);return _0x78d296(_0x469d94[_0x35a1('0xf')]['message']);}logger[_0x35a1('0xf')](_0x35a1('0xa'),_0x3bd7c9,_0x469d94['error'][_0x35a1('0x11')]);return _0x3ed235(_0x469d94[_0x35a1('0xf')][_0x35a1('0x11')]);}else{logger[_0x35a1('0x9')]('CloudProvider,\x20%s,\x20%s',_0x3bd7c9,_0x35a1('0xb'));_0x3ed235(_0x469d94[_0x35a1('0x12')][_0x35a1('0x11')]);}})[_0x35a1('0x13')](function(_0x5d5166){logger[_0x35a1('0xf')](_0x35a1('0xa'),_0x3bd7c9,_0x5d5166);_0x78d296(_0x5d5166);});});} \ No newline at end of file +var _0xa9fc=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','http','request','then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','CloudProvider,\x20%s,\x20%s','message','result','lodash','util','moment'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0xa9fc,0x19f));var _0xca9f=function(_0x1b02bb,_0x3d9fde){_0x1b02bb=_0x1b02bb-0x0;var _0x131245=_0xa9fc[_0x1b02bb];return _0x131245;};'use strict';var _=require(_0xca9f('0x0'));var util=require(_0xca9f('0x1'));var moment=require(_0xca9f('0x2'));var BPromise=require(_0xca9f('0x3'));var rs=require(_0xca9f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xca9f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xca9f('0x6'))(_0xca9f('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xca9f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x48f9ca,_0x39963d,_0x61b1b6){return new BPromise(function(_0x400980,_0xf7ebb1){return client[_0xca9f('0x9')](_0x48f9ca,_0x61b1b6)[_0xca9f('0xa')](function(_0x4713f0){logger[_0xca9f('0xb')]('CloudProvider,\x20%s,\x20%s',_0x39963d,_0xca9f('0xc'));logger[_0xca9f('0xd')](_0xca9f('0xe'),_0x39963d,_0xca9f('0xc'),JSON['stringify'](_0x4713f0));if(_0x4713f0[_0xca9f('0xf')]){if(_0x4713f0[_0xca9f('0xf')]['code']===0x1f4){logger[_0xca9f('0xf')](_0xca9f('0x10'),_0x39963d,_0x4713f0[_0xca9f('0xf')][_0xca9f('0x11')]);return _0xf7ebb1(_0x4713f0[_0xca9f('0xf')][_0xca9f('0x11')]);}logger[_0xca9f('0xf')](_0xca9f('0x10'),_0x39963d,_0x4713f0[_0xca9f('0xf')][_0xca9f('0x11')]);return _0x400980(_0x4713f0['error']['message']);}else{logger[_0xca9f('0xb')]('CloudProvider,\x20%s,\x20%s',_0x39963d,'request\x20sent');_0x400980(_0x4713f0[_0xca9f('0x12')][_0xca9f('0x11')]);}})['catch'](function(_0x4afedf){logger['error'](_0xca9f('0x10'),_0x39963d,_0x4afedf);_0xf7ebb1(_0x4afedf);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 4c2ecdc..5a20e19 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 _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x3c6d28,_0x6de798){var _0x37a004=function(_0x3bb1f7){while(--_0x3bb1f7){_0x3c6d28['push'](_0x3c6d28['shift']());}};_0x37a004(++_0x6de798);}(_0x2ef3,0xba));var _0x32ef=function(_0x3de459,_0x3e3954){_0x3de459=_0x3de459-0x0;var _0x14a361=_0x2ef3[_0x3de459];return _0x14a361;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router; \ No newline at end of file +var _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0x1589bf,_0x350cda){var _0xe42356=function(_0x1e4acb){while(--_0x1e4acb){_0x1589bf['push'](_0x1589bf['shift']());}};_0xe42356(++_0x350cda);}(_0xadb5,0xad));var _0x5adb=function(_0x2f8aeb,_0x25d4f2){_0x2f8aeb=_0x2f8aeb-0x0;var _0x30251b=_0xadb5[_0x2f8aeb];return _0x30251b;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['index']);router[_0x5adb('0x2')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller['show']);router[_0x5adb('0x5')]('/',auth[_0x5adb('0x3')](),controller[_0x5adb('0x6')]);router[_0x5adb('0x7')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0xa')]);router[_0x5adb('0x2')](_0x5adb('0xb'),auth[_0x5adb('0x3')](),controller['oauth2MicrosoftAuthorize']);router['post'](_0x5adb('0xc'),controller[_0x5adb('0xd')]);module[_0x5adb('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 1233528..555f149 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 _0xf5f1=['exports','STRING','name'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0xf5f1,0x1c8));var _0x1f5f=function(_0x34f462,_0x340362){_0x34f462=_0x34f462-0x0;var _0x24e7de=_0xf5f1[_0x34f462];return _0x24e7de;};'use strict';var Sequelize=require('sequelize');module[_0x1f5f('0x0')]={'name':{'type':Sequelize[_0x1f5f('0x1')],'unique':_0x1f5f('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x1f5f('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x1f5f('0x1')]},'phone':{'type':Sequelize[_0x1f5f('0x1')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x1f5f('0x1')]},'postalCode':{'type':Sequelize[_0x1f5f('0x1')]},'city':{'type':Sequelize[_0x1f5f('0x1')]},'country':{'type':Sequelize[_0x1f5f('0x1')]},'email':{'type':Sequelize[_0x1f5f('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x1f5f('0x1')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x1f5f('0x1')]},'sCountry':{'type':Sequelize[_0x1f5f('0x1')]},'description':{'type':Sequelize[_0x1f5f('0x1')]}}; \ No newline at end of file +var _0x8f23=['name','sequelize','exports','STRING'];(function(_0x291f54,_0x547492){var _0x27f9dd=function(_0x446824){while(--_0x446824){_0x291f54['push'](_0x291f54['shift']());}};_0x27f9dd(++_0x547492);}(_0x8f23,0x1e5));var _0x38f2=function(_0x4bab01,_0x1eec12){_0x4bab01=_0x4bab01-0x0;var _0x587a2e=_0x8f23[_0x4bab01];return _0x587a2e;};'use strict';var Sequelize=require(_0x38f2('0x0'));module[_0x38f2('0x1')]={'name':{'type':Sequelize[_0x38f2('0x2')],'unique':_0x38f2('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x38f2('0x2')]},'companyId':{'type':Sequelize[_0x38f2('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x38f2('0x2')]},'type':{'type':Sequelize[_0x38f2('0x2')]},'street':{'type':Sequelize[_0x38f2('0x2')]},'postalCode':{'type':Sequelize[_0x38f2('0x2')]},'city':{'type':Sequelize[_0x38f2('0x2')]},'country':{'type':Sequelize[_0x38f2('0x2')]},'email':{'type':Sequelize[_0x38f2('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x38f2('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x38f2('0x2')]},'sCity':{'type':Sequelize[_0x38f2('0x2')]},'sCountry':{'type':Sequelize[_0x38f2('0x2')]},'description':{'type':Sequelize[_0x38f2('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 20a9155..cc13174 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 _0xe878=['status','end','json','offset','undefined','limit','apply','reject','save','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','index','CmCompany','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','count','include','findAll','rows','catch','show','params','rawAttributes','length','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addContacts','CmContact','ids','omit','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe878,0x19f));var _0x8e87=function(_0x2598f0,_0x3d61ff){_0x2598f0=_0x2598f0-0x0;var _0x4448c8=_0xe878[_0x2598f0];return _0x4448c8;};'use strict';var emlformat=require(_0x8e87('0x0'));var rimraf=require(_0x8e87('0x1'));var zipdir=require(_0x8e87('0x2'));var jsonpatch=require(_0x8e87('0x3'));var rp=require(_0x8e87('0x4'));var moment=require(_0x8e87('0x5'));var BPromise=require(_0x8e87('0x6'));var Mustache=require(_0x8e87('0x7'));var util=require(_0x8e87('0x8'));var path=require(_0x8e87('0x9'));var sox=require(_0x8e87('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8e87('0xb'));var squel=require(_0x8e87('0xc'));var crypto=require('crypto');var jsforce=require(_0x8e87('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8e87('0xe'));var querystring=require(_0x8e87('0xf'));var Papa=require(_0x8e87('0x10'));var Redis=require('ioredis');var authService=require(_0x8e87('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8e87('0x12'));var hardwareService=require(_0x8e87('0x13'));var logger=require('../../config/logger')(_0x8e87('0x14'));var utils=require(_0x8e87('0x15'));var config=require(_0x8e87('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8e87('0x17'))['db'];function respondWithStatusCode(_0x3940bd,_0x5664ff){_0x5664ff=_0x5664ff||0xcc;return function(_0x59ed2b){if(_0x59ed2b){return _0x3940bd[_0x8e87('0x18')](_0x5664ff);}return _0x3940bd[_0x8e87('0x19')](_0x5664ff)[_0x8e87('0x1a')]();};}function respondWithResult(_0x2cb9c4,_0x17ccc6){_0x17ccc6=_0x17ccc6||0xc8;return function(_0x3cf21b){if(_0x3cf21b){return _0x2cb9c4[_0x8e87('0x19')](_0x17ccc6)[_0x8e87('0x1b')](_0x3cf21b);}};}function respondWithFilteredResult(_0xb30752,_0x132959){return function(_0x5545a2){if(_0x5545a2){var _0x52c71f=typeof _0x132959[_0x8e87('0x1c')]===_0x8e87('0x1d')&&typeof _0x132959[_0x8e87('0x1e')]===_0x8e87('0x1d');var _0x98fc=_0x5545a2['count'];var _0x5c3abe=_0x52c71f?0x0:_0x132959[_0x8e87('0x1c')];var _0x5d0fe9=_0x52c71f?_0x5545a2['count']:_0x132959[_0x8e87('0x1c')]+_0x132959[_0x8e87('0x1e')];var _0x504a4d;if(_0x5d0fe9>=_0x98fc){_0x5d0fe9=_0x98fc;_0x504a4d=0xc8;}else{_0x504a4d=0xce;}_0xb30752[_0x8e87('0x19')](_0x504a4d);return _0xb30752['set']('Content-Range',_0x5c3abe+'-'+_0x5d0fe9+'/'+_0x98fc)[_0x8e87('0x1b')](_0x5545a2);}return null;};}function patchUpdates(_0x7e0962){return function(_0x173fab){try{jsonpatch[_0x8e87('0x1f')](_0x173fab,_0x7e0962,!![]);}catch(_0x5d12b5){return BPromise[_0x8e87('0x20')](_0x5d12b5);}return _0x173fab[_0x8e87('0x21')]();};}function saveUpdates(_0x374805,_0x305f94){return function(_0x379410){if(_0x379410){return _0x379410['update'](_0x374805)[_0x8e87('0x22')](function(_0x1795e8){return _0x1795e8;});}return null;};}function removeEntity(_0x4e354b,_0x58f6e7){return function(_0x58b045){if(_0x58b045){return _0x58b045[_0x8e87('0x23')]()[_0x8e87('0x22')](function(){var _0x258f95=_0x58b045[_0x8e87('0x24')]({'plain':!![]});var _0x46f1be=_0x8e87('0x25');return db[_0x8e87('0x26')]['destroy']({'where':{'type':_0x46f1be,'resourceId':_0x258f95['id']}})[_0x8e87('0x22')](function(){return _0x58b045;});})[_0x8e87('0x22')](function(){_0x4e354b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cbaa0,_0x120511){return function(_0x152a0a){if(!_0x152a0a){_0x5cbaa0[_0x8e87('0x18')](0x194);}return _0x152a0a;};}function handleError(_0x183c75,_0x69407e){_0x69407e=_0x69407e||0x1f4;return function(_0xbabeb0){logger[_0x8e87('0x27')](_0xbabeb0[_0x8e87('0x28')]);if(_0xbabeb0[_0x8e87('0x29')]){delete _0xbabeb0[_0x8e87('0x29')];}_0x183c75[_0x8e87('0x19')](_0x69407e)[_0x8e87('0x2a')](_0xbabeb0);};}exports[_0x8e87('0x2b')]=function(_0x168c61,_0x16dfbd){var _0x111401={},_0x4ba2e5={},_0x2936ba={'count':0x0,'rows':[]};return db[_0x8e87('0x2c')]['describe']()[_0x8e87('0x22')](function(_0x22af85){_0x4ba2e5[_0x8e87('0x2d')]=_[_0x8e87('0x2e')](_0x22af85);_0x4ba2e5[_0x8e87('0x2f')]=_[_0x8e87('0x2e')](_0x168c61[_0x8e87('0x2f')]);_0x4ba2e5[_0x8e87('0x30')]=_[_0x8e87('0x31')](_0x4ba2e5[_0x8e87('0x2d')],_0x4ba2e5['query']);_0x111401[_0x8e87('0x32')]=_[_0x8e87('0x31')](_0x4ba2e5[_0x8e87('0x2d')],qs['fields'](_0x168c61[_0x8e87('0x2f')][_0x8e87('0x33')]));_0x111401[_0x8e87('0x32')]=_0x111401[_0x8e87('0x32')]['length']?_0x111401[_0x8e87('0x32')]:_0x4ba2e5[_0x8e87('0x2d')];if(!_0x168c61['query'][_0x8e87('0x34')](_0x8e87('0x35'))){_0x111401[_0x8e87('0x1e')]=qs[_0x8e87('0x1e')](_0x168c61[_0x8e87('0x2f')][_0x8e87('0x1e')]);_0x111401['offset']=qs[_0x8e87('0x1c')](_0x168c61[_0x8e87('0x2f')][_0x8e87('0x1c')]);}_0x111401[_0x8e87('0x36')]=qs[_0x8e87('0x37')](_0x168c61[_0x8e87('0x2f')][_0x8e87('0x37')]);_0x111401[_0x8e87('0x38')]=qs[_0x8e87('0x30')](_[_0x8e87('0x39')](_0x168c61[_0x8e87('0x2f')],_0x4ba2e5[_0x8e87('0x30')]),_0x22af85);if(_0x168c61[_0x8e87('0x2f')][_0x8e87('0x3a')]){_0x111401['where']=_[_0x8e87('0x3b')](_0x111401['where'],{'$or':_[_0x8e87('0x3c')](_0x111401['attributes'],function(_0x2a7266){var _0x57e6db={};_0x57e6db[_0x2a7266]={'$like':'%'+_0x168c61['query'][_0x8e87('0x3a')]+'%'};return _0x57e6db;})});}_0x111401=_[_0x8e87('0x3b')]({},_0x111401,_0x168c61[_0x8e87('0x3d')]);var _0x36a1e6={'where':_0x111401[_0x8e87('0x38')]};return db['CmCompany']['count'](_0x36a1e6)[_0x8e87('0x22')](function(_0x810d53){_0x2936ba[_0x8e87('0x3e')]=_0x810d53;if(_0x168c61['query']['includeAll']){_0x111401[_0x8e87('0x3f')]=[{'all':!![]}];}return db[_0x8e87('0x2c')][_0x8e87('0x40')](_0x111401);})['then'](function(_0x14a4d5){_0x2936ba[_0x8e87('0x41')]=_0x14a4d5;return _0x2936ba;})[_0x8e87('0x22')](respondWithFilteredResult(_0x16dfbd,_0x111401))[_0x8e87('0x42')](handleError(_0x16dfbd,null));})['catch'](handleError(_0x16dfbd,null));};exports[_0x8e87('0x43')]=function(_0x533412,_0x86ae49){var _0x185b57={'raw':![],'where':{'id':_0x533412[_0x8e87('0x44')]['id']}},_0xeb2268={};_0xeb2268[_0x8e87('0x2d')]=_[_0x8e87('0x2e')](db[_0x8e87('0x2c')][_0x8e87('0x45')]);_0xeb2268[_0x8e87('0x2f')]=_[_0x8e87('0x2e')](_0x533412['query']);_0xeb2268[_0x8e87('0x30')]=_[_0x8e87('0x31')](_0xeb2268[_0x8e87('0x2d')],_0xeb2268[_0x8e87('0x2f')]);_0x185b57[_0x8e87('0x32')]=_[_0x8e87('0x31')](_0xeb2268['model'],qs['fields'](_0x533412['query'][_0x8e87('0x33')]));_0x185b57['attributes']=_0x185b57[_0x8e87('0x32')][_0x8e87('0x46')]?_0x185b57[_0x8e87('0x32')]:_0xeb2268[_0x8e87('0x2d')];if(_0x533412[_0x8e87('0x2f')][_0x8e87('0x47')]){_0x185b57[_0x8e87('0x3f')]=[{'all':!![]}];}_0x185b57=_[_0x8e87('0x3b')]({},_0x185b57,_0x533412['options']);return db[_0x8e87('0x2c')][_0x8e87('0x48')](_0x185b57)[_0x8e87('0x22')](handleEntityNotFound(_0x86ae49,null))['then'](respondWithResult(_0x86ae49,null))[_0x8e87('0x42')](handleError(_0x86ae49,null));};exports[_0x8e87('0x49')]=function(_0x515b6,_0x232fd7){return db[_0x8e87('0x2c')][_0x8e87('0x49')](_0x515b6[_0x8e87('0x4a')],{})[_0x8e87('0x22')](function(_0x4a78e3){var _0x198d94=_0x515b6['user'][_0x8e87('0x24')]({'plain':!![]});if(!_0x198d94)throw new Error(_0x8e87('0x4b'));if(_0x198d94[_0x8e87('0x4c')]===_0x8e87('0x4d')){var _0x190820=_0x4a78e3[_0x8e87('0x24')]({'plain':!![]});var _0x31fb2c='Companies';return db[_0x8e87('0x4e')][_0x8e87('0x48')]({'where':{'name':_0x31fb2c,'userProfileId':_0x198d94[_0x8e87('0x4f')]},'raw':!![]})['then'](function(_0x1434c4){if(_0x1434c4&&_0x1434c4['autoAssociation']===0x0){return db[_0x8e87('0x26')][_0x8e87('0x49')]({'name':_0x190820[_0x8e87('0x29')],'resourceId':_0x190820['id'],'type':_0x1434c4[_0x8e87('0x29')],'sectionId':_0x1434c4['id']},{})[_0x8e87('0x22')](function(){return _0x4a78e3;});}else{return _0x4a78e3;}})[_0x8e87('0x42')](function(_0x2ec8f1){logger['error'](_0x8e87('0x50'),_0x2ec8f1);throw _0x2ec8f1;});}return _0x4a78e3;})['then'](respondWithResult(_0x232fd7,0xc9))[_0x8e87('0x42')](handleError(_0x232fd7,null));};exports[_0x8e87('0x51')]=function(_0x57001e,_0x2940b8){if(_0x57001e['body']['id']){delete _0x57001e[_0x8e87('0x4a')]['id'];}return db[_0x8e87('0x2c')][_0x8e87('0x48')]({'where':{'id':_0x57001e[_0x8e87('0x44')]['id']}})[_0x8e87('0x22')](handleEntityNotFound(_0x2940b8,null))[_0x8e87('0x22')](saveUpdates(_0x57001e[_0x8e87('0x4a')],null))[_0x8e87('0x22')](respondWithResult(_0x2940b8,null))[_0x8e87('0x42')](handleError(_0x2940b8,null));};exports[_0x8e87('0x23')]=function(_0x453023,_0x175c29){return db[_0x8e87('0x2c')][_0x8e87('0x48')]({'where':{'id':_0x453023['params']['id']}})[_0x8e87('0x22')](handleEntityNotFound(_0x175c29,null))[_0x8e87('0x22')](removeEntity(_0x175c29,null))[_0x8e87('0x42')](handleError(_0x175c29,null));};exports['describe']=function(_0x352a18,_0x4e3cf0){return db[_0x8e87('0x2c')][_0x8e87('0x52')]()[_0x8e87('0x22')](respondWithResult(_0x4e3cf0,null))[_0x8e87('0x42')](handleError(_0x4e3cf0,null));};exports[_0x8e87('0x53')]=function(_0x4aaab2,_0x4e59f0,_0x2830a2){return db[_0x8e87('0x54')][_0x8e87('0x48')]({'where':{'id':_0x4aaab2[_0x8e87('0x44')]['id']}})[_0x8e87('0x22')](handleEntityNotFound(_0x4e59f0,null))[_0x8e87('0x22')](function(_0x3a5f18){if(_0x3a5f18){return _0x3a5f18[_0x8e87('0x53')](_0x4aaab2[_0x8e87('0x4a')][_0x8e87('0x55')],_[_0x8e87('0x56')](_0x4aaab2[_0x8e87('0x4a')],[_0x8e87('0x55'),'id'])||{});}})[_0x8e87('0x22')](respondWithResult(_0x4e59f0,null))['catch'](handleError(_0x4e59f0,null));};exports[_0x8e87('0x57')]=function(_0x45e412,_0x522839,_0x3dbef4){var _0x7b3291={};var _0x30bb19={};var _0x1bd700;var _0x6e7e94;return db[_0x8e87('0x2c')]['findOne']({'where':{'id':_0x45e412['params']['id']}})[_0x8e87('0x22')](handleEntityNotFound(_0x522839,null))[_0x8e87('0x22')](function(_0x1b3d89){if(_0x1b3d89){_0x1bd700=_0x1b3d89;_0x30bb19[_0x8e87('0x2d')]=_['keys'](db[_0x8e87('0x54')][_0x8e87('0x45')]);_0x30bb19[_0x8e87('0x2f')]=_[_0x8e87('0x2e')](_0x45e412['query']);_0x30bb19['filters']=_['intersection'](_0x30bb19['model'],_0x30bb19[_0x8e87('0x2f')]);_0x7b3291['attributes']=_[_0x8e87('0x31')](_0x30bb19[_0x8e87('0x2d')],qs['fields'](_0x45e412[_0x8e87('0x2f')]['fields']));_0x7b3291[_0x8e87('0x32')]=_0x7b3291[_0x8e87('0x32')]['length']?_0x7b3291[_0x8e87('0x32')]:_0x30bb19['model'];_0x7b3291[_0x8e87('0x36')]=qs[_0x8e87('0x37')](_0x45e412[_0x8e87('0x2f')]['sort']);_0x7b3291[_0x8e87('0x38')]=qs['filters'](_[_0x8e87('0x39')](_0x45e412['query'],_0x30bb19[_0x8e87('0x30')]));if(_0x45e412[_0x8e87('0x2f')][_0x8e87('0x3a')]){_0x7b3291[_0x8e87('0x38')]=_['merge'](_0x7b3291[_0x8e87('0x38')],{'$or':_[_0x8e87('0x3c')](_0x7b3291['attributes'],function(_0x2d29a1){var _0x3a4f09={};_0x3a4f09[_0x2d29a1]={'$like':'%'+_0x45e412[_0x8e87('0x2f')]['filter']+'%'};return _0x3a4f09;})});}_0x7b3291=_['merge']({},_0x7b3291,_0x45e412['options']);return _0x1bd700[_0x8e87('0x57')](_0x7b3291);}})[_0x8e87('0x22')](function(_0x2aab1e){if(_0x2aab1e){_0x6e7e94=_0x2aab1e[_0x8e87('0x46')];if(!_0x45e412[_0x8e87('0x2f')][_0x8e87('0x34')](_0x8e87('0x35'))){_0x7b3291[_0x8e87('0x1e')]=qs[_0x8e87('0x1e')](_0x45e412[_0x8e87('0x2f')]['limit']);_0x7b3291[_0x8e87('0x1c')]=qs[_0x8e87('0x1c')](_0x45e412[_0x8e87('0x2f')][_0x8e87('0x1c')]);}return _0x1bd700[_0x8e87('0x57')](_0x7b3291);}})[_0x8e87('0x22')](function(_0x2b8c05){if(_0x2b8c05){return _0x2b8c05?{'count':_0x6e7e94,'rows':_0x2b8c05}:null;}})[_0x8e87('0x22')](respondWithResult(_0x522839,null))[_0x8e87('0x42')](handleError(_0x522839,null));}; \ No newline at end of file +var _0xea1e=['count','offset','set','Content-Range','save','update','then','destroy','get','Companies','UserProfileResource','sendStatus','stack','name','send','index','describe','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','CmCompany','includeAll','findAll','catch','show','params','rawAttributes','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','omit','ids','getContacts','findOne','CmContact','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined'];(function(_0x24f862,_0x4b645a){var _0x198aa4=function(_0x131195){while(--_0x131195){_0x24f862['push'](_0x24f862['shift']());}};_0x198aa4(++_0x4b645a);}(_0xea1e,0xdc));var _0xeea1=function(_0x3aa0ac,_0x5f5da6){_0x3aa0ac=_0x3aa0ac-0x0;var _0x568a11=_0xea1e[_0x3aa0ac];return _0x568a11;};'use strict';var emlformat=require(_0xeea1('0x0'));var rimraf=require(_0xeea1('0x1'));var zipdir=require(_0xeea1('0x2'));var jsonpatch=require(_0xeea1('0x3'));var rp=require(_0xeea1('0x4'));var moment=require(_0xeea1('0x5'));var BPromise=require(_0xeea1('0x6'));var Mustache=require('mustache');var util=require(_0xeea1('0x7'));var path=require(_0xeea1('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeea1('0x9'));var _=require(_0xeea1('0xa'));var squel=require('squel');var crypto=require(_0xeea1('0xb'));var jsforce=require(_0xeea1('0xc'));var deskjs=require(_0xeea1('0xd'));var toCsv=require(_0xeea1('0xe'));var querystring=require(_0xeea1('0xf'));var Papa=require('papaparse');var Redis=require(_0xeea1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xeea1('0x11'));var as=require(_0xeea1('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeea1('0x13'))('api');var utils=require(_0xeea1('0x14'));var config=require(_0xeea1('0x15'));var licenseUtil=require(_0xeea1('0x16'));var db=require(_0xeea1('0x17'))['db'];function respondWithStatusCode(_0x4dc619,_0x326593){_0x326593=_0x326593||0xcc;return function(_0x481cbc){if(_0x481cbc){return _0x4dc619['sendStatus'](_0x326593);}return _0x4dc619[_0xeea1('0x18')](_0x326593)[_0xeea1('0x19')]();};}function respondWithResult(_0x4df674,_0x2f4cd9){_0x2f4cd9=_0x2f4cd9||0xc8;return function(_0x3fcfd5){if(_0x3fcfd5){return _0x4df674[_0xeea1('0x18')](_0x2f4cd9)[_0xeea1('0x1a')](_0x3fcfd5);}};}function respondWithFilteredResult(_0x429e28,_0x4da5d0){return function(_0x18d95d){if(_0x18d95d){var _0x55b2a5=typeof _0x4da5d0['offset']==='undefined'&&typeof _0x4da5d0[_0xeea1('0x1b')]===_0xeea1('0x1c');var _0x1d983e=_0x18d95d[_0xeea1('0x1d')];var _0xb78d21=_0x55b2a5?0x0:_0x4da5d0[_0xeea1('0x1e')];var _0x171478=_0x55b2a5?_0x18d95d[_0xeea1('0x1d')]:_0x4da5d0[_0xeea1('0x1e')]+_0x4da5d0['limit'];var _0x22345f;if(_0x171478>=_0x1d983e){_0x171478=_0x1d983e;_0x22345f=0xc8;}else{_0x22345f=0xce;}_0x429e28[_0xeea1('0x18')](_0x22345f);return _0x429e28[_0xeea1('0x1f')](_0xeea1('0x20'),_0xb78d21+'-'+_0x171478+'/'+_0x1d983e)['json'](_0x18d95d);}return null;};}function patchUpdates(_0x2c0e38){return function(_0x228a0d){try{jsonpatch['apply'](_0x228a0d,_0x2c0e38,!![]);}catch(_0x2d0158){return BPromise['reject'](_0x2d0158);}return _0x228a0d[_0xeea1('0x21')]();};}function saveUpdates(_0x27322f,_0x4f33e9){return function(_0x11f31f){if(_0x11f31f){return _0x11f31f[_0xeea1('0x22')](_0x27322f)[_0xeea1('0x23')](function(_0x447806){return _0x447806;});}return null;};}function removeEntity(_0xe3a65e,_0x7b7f83){return function(_0x212196){if(_0x212196){return _0x212196[_0xeea1('0x24')]()[_0xeea1('0x23')](function(){var _0x350048=_0x212196[_0xeea1('0x25')]({'plain':!![]});var _0x25f4c2=_0xeea1('0x26');return db[_0xeea1('0x27')][_0xeea1('0x24')]({'where':{'type':_0x25f4c2,'resourceId':_0x350048['id']}})['then'](function(){return _0x212196;});})[_0xeea1('0x23')](function(){_0xe3a65e[_0xeea1('0x18')](0xcc)[_0xeea1('0x19')]();});}};}function handleEntityNotFound(_0x47d6b8,_0x3fe1a9){return function(_0x31e1d2){if(!_0x31e1d2){_0x47d6b8[_0xeea1('0x28')](0x194);}return _0x31e1d2;};}function handleError(_0x46ef55,_0x26fd66){_0x26fd66=_0x26fd66||0x1f4;return function(_0xfc708f){logger['error'](_0xfc708f[_0xeea1('0x29')]);if(_0xfc708f[_0xeea1('0x2a')]){delete _0xfc708f[_0xeea1('0x2a')];}_0x46ef55['status'](_0x26fd66)[_0xeea1('0x2b')](_0xfc708f);};}exports[_0xeea1('0x2c')]=function(_0x5e3a91,_0x2c70f8){var _0x1ef3bf={},_0x47cce3={},_0x3a4097={'count':0x0,'rows':[]};return db['CmCompany'][_0xeea1('0x2d')]()[_0xeea1('0x23')](function(_0x13da07){_0x47cce3[_0xeea1('0x2e')]=_['keys'](_0x13da07);_0x47cce3[_0xeea1('0x2f')]=_[_0xeea1('0x30')](_0x5e3a91[_0xeea1('0x2f')]);_0x47cce3[_0xeea1('0x31')]=_[_0xeea1('0x32')](_0x47cce3[_0xeea1('0x2e')],_0x47cce3[_0xeea1('0x2f')]);_0x1ef3bf[_0xeea1('0x33')]=_[_0xeea1('0x32')](_0x47cce3['model'],qs[_0xeea1('0x34')](_0x5e3a91[_0xeea1('0x2f')]['fields']));_0x1ef3bf[_0xeea1('0x33')]=_0x1ef3bf[_0xeea1('0x33')][_0xeea1('0x35')]?_0x1ef3bf[_0xeea1('0x33')]:_0x47cce3['model'];if(!_0x5e3a91[_0xeea1('0x2f')]['hasOwnProperty'](_0xeea1('0x36'))){_0x1ef3bf['limit']=qs[_0xeea1('0x1b')](_0x5e3a91['query'][_0xeea1('0x1b')]);_0x1ef3bf[_0xeea1('0x1e')]=qs[_0xeea1('0x1e')](_0x5e3a91[_0xeea1('0x2f')][_0xeea1('0x1e')]);}_0x1ef3bf[_0xeea1('0x37')]=qs[_0xeea1('0x38')](_0x5e3a91[_0xeea1('0x2f')][_0xeea1('0x38')]);_0x1ef3bf[_0xeea1('0x39')]=qs['filters'](_[_0xeea1('0x3a')](_0x5e3a91['query'],_0x47cce3[_0xeea1('0x31')]),_0x13da07);if(_0x5e3a91[_0xeea1('0x2f')][_0xeea1('0x3b')]){_0x1ef3bf[_0xeea1('0x39')]=_[_0xeea1('0x3c')](_0x1ef3bf[_0xeea1('0x39')],{'$or':_['map'](_0x1ef3bf[_0xeea1('0x33')],function(_0x51a533){var _0x27d9a6={};_0x27d9a6[_0x51a533]={'$like':'%'+_0x5e3a91[_0xeea1('0x2f')][_0xeea1('0x3b')]+'%'};return _0x27d9a6;})});}_0x1ef3bf=_[_0xeea1('0x3c')]({},_0x1ef3bf,_0x5e3a91[_0xeea1('0x3d')]);var _0x57c2b2={'where':_0x1ef3bf[_0xeea1('0x39')]};return db[_0xeea1('0x3e')][_0xeea1('0x1d')](_0x57c2b2)[_0xeea1('0x23')](function(_0x2e4598){_0x3a4097[_0xeea1('0x1d')]=_0x2e4598;if(_0x5e3a91['query'][_0xeea1('0x3f')]){_0x1ef3bf['include']=[{'all':!![]}];}return db[_0xeea1('0x3e')][_0xeea1('0x40')](_0x1ef3bf);})[_0xeea1('0x23')](function(_0x1833a9){_0x3a4097['rows']=_0x1833a9;return _0x3a4097;})[_0xeea1('0x23')](respondWithFilteredResult(_0x2c70f8,_0x1ef3bf))[_0xeea1('0x41')](handleError(_0x2c70f8,null));})[_0xeea1('0x41')](handleError(_0x2c70f8,null));};exports[_0xeea1('0x42')]=function(_0x423bcf,_0x1a8745){var _0x25bdf6={'raw':![],'where':{'id':_0x423bcf[_0xeea1('0x43')]['id']}},_0x4b281f={};_0x4b281f[_0xeea1('0x2e')]=_['keys'](db['CmCompany'][_0xeea1('0x44')]);_0x4b281f[_0xeea1('0x2f')]=_[_0xeea1('0x30')](_0x423bcf[_0xeea1('0x2f')]);_0x4b281f[_0xeea1('0x31')]=_[_0xeea1('0x32')](_0x4b281f[_0xeea1('0x2e')],_0x4b281f[_0xeea1('0x2f')]);_0x25bdf6['attributes']=_[_0xeea1('0x32')](_0x4b281f[_0xeea1('0x2e')],qs['fields'](_0x423bcf[_0xeea1('0x2f')][_0xeea1('0x34')]));_0x25bdf6['attributes']=_0x25bdf6['attributes'][_0xeea1('0x35')]?_0x25bdf6[_0xeea1('0x33')]:_0x4b281f[_0xeea1('0x2e')];if(_0x423bcf[_0xeea1('0x2f')][_0xeea1('0x3f')]){_0x25bdf6[_0xeea1('0x45')]=[{'all':!![]}];}_0x25bdf6=_[_0xeea1('0x3c')]({},_0x25bdf6,_0x423bcf[_0xeea1('0x3d')]);return db[_0xeea1('0x3e')][_0xeea1('0x46')](_0x25bdf6)[_0xeea1('0x23')](handleEntityNotFound(_0x1a8745,null))['then'](respondWithResult(_0x1a8745,null))['catch'](handleError(_0x1a8745,null));};exports[_0xeea1('0x47')]=function(_0x3ba4a4,_0x3ed447){return db[_0xeea1('0x3e')][_0xeea1('0x47')](_0x3ba4a4['body'],{})[_0xeea1('0x23')](function(_0x92ce8e){var _0x5c7ab2=_0x3ba4a4[_0xeea1('0x48')][_0xeea1('0x25')]({'plain':!![]});if(!_0x5c7ab2)throw new Error(_0xeea1('0x49'));if(_0x5c7ab2[_0xeea1('0x4a')]===_0xeea1('0x48')){var _0x5bada2=_0x92ce8e['get']({'plain':!![]});var _0x5cdee2=_0xeea1('0x26');return db['UserProfileSection']['find']({'where':{'name':_0x5cdee2,'userProfileId':_0x5c7ab2['userProfileId']},'raw':!![]})[_0xeea1('0x23')](function(_0x1c923f){if(_0x1c923f&&_0x1c923f[_0xeea1('0x4b')]===0x0){return db['UserProfileResource'][_0xeea1('0x47')]({'name':_0x5bada2['name'],'resourceId':_0x5bada2['id'],'type':_0x1c923f[_0xeea1('0x2a')],'sectionId':_0x1c923f['id']},{})[_0xeea1('0x23')](function(){return _0x92ce8e;});}else{return _0x92ce8e;}})[_0xeea1('0x41')](function(_0x4cce9b){logger['error'](_0xeea1('0x4c'),_0x4cce9b);throw _0x4cce9b;});}return _0x92ce8e;})[_0xeea1('0x23')](respondWithResult(_0x3ed447,0xc9))[_0xeea1('0x41')](handleError(_0x3ed447,null));};exports[_0xeea1('0x22')]=function(_0x3fc6f8,_0x3136a8){if(_0x3fc6f8[_0xeea1('0x4d')]['id']){delete _0x3fc6f8['body']['id'];}return db['CmCompany']['find']({'where':{'id':_0x3fc6f8[_0xeea1('0x43')]['id']}})[_0xeea1('0x23')](handleEntityNotFound(_0x3136a8,null))[_0xeea1('0x23')](saveUpdates(_0x3fc6f8[_0xeea1('0x4d')],null))['then'](respondWithResult(_0x3136a8,null))[_0xeea1('0x41')](handleError(_0x3136a8,null));};exports[_0xeea1('0x24')]=function(_0x14f8ef,_0x3e9464){return db['CmCompany']['find']({'where':{'id':_0x14f8ef[_0xeea1('0x43')]['id']}})[_0xeea1('0x23')](handleEntityNotFound(_0x3e9464,null))[_0xeea1('0x23')](removeEntity(_0x3e9464,null))[_0xeea1('0x41')](handleError(_0x3e9464,null));};exports['describe']=function(_0x11c2a0,_0x1260d1){return db[_0xeea1('0x3e')][_0xeea1('0x2d')]()[_0xeea1('0x23')](respondWithResult(_0x1260d1,null))[_0xeea1('0x41')](handleError(_0x1260d1,null));};exports['addContacts']=function(_0x26e4fa,_0x10c151,_0x777d9d){return db['CmContact'][_0xeea1('0x46')]({'where':{'id':_0x26e4fa[_0xeea1('0x43')]['id']}})[_0xeea1('0x23')](handleEntityNotFound(_0x10c151,null))[_0xeea1('0x23')](function(_0x4c791b){if(_0x4c791b){return _0x4c791b['addContacts'](_0x26e4fa[_0xeea1('0x4d')]['ids'],_[_0xeea1('0x4e')](_0x26e4fa['body'],[_0xeea1('0x4f'),'id'])||{});}})[_0xeea1('0x23')](respondWithResult(_0x10c151,null))['catch'](handleError(_0x10c151,null));};exports[_0xeea1('0x50')]=function(_0x5bf27b,_0x3baebe,_0x4c82f){var _0x4a9cba={};var _0x2b3077={};var _0x484644;var _0x4f227d;return db[_0xeea1('0x3e')][_0xeea1('0x51')]({'where':{'id':_0x5bf27b['params']['id']}})['then'](handleEntityNotFound(_0x3baebe,null))[_0xeea1('0x23')](function(_0x172512){if(_0x172512){_0x484644=_0x172512;_0x2b3077['model']=_[_0xeea1('0x30')](db[_0xeea1('0x52')][_0xeea1('0x44')]);_0x2b3077[_0xeea1('0x2f')]=_[_0xeea1('0x30')](_0x5bf27b['query']);_0x2b3077[_0xeea1('0x31')]=_['intersection'](_0x2b3077[_0xeea1('0x2e')],_0x2b3077[_0xeea1('0x2f')]);_0x4a9cba[_0xeea1('0x33')]=_[_0xeea1('0x32')](_0x2b3077[_0xeea1('0x2e')],qs[_0xeea1('0x34')](_0x5bf27b['query']['fields']));_0x4a9cba[_0xeea1('0x33')]=_0x4a9cba['attributes'][_0xeea1('0x35')]?_0x4a9cba[_0xeea1('0x33')]:_0x2b3077[_0xeea1('0x2e')];_0x4a9cba[_0xeea1('0x37')]=qs['sort'](_0x5bf27b[_0xeea1('0x2f')][_0xeea1('0x38')]);_0x4a9cba[_0xeea1('0x39')]=qs['filters'](_[_0xeea1('0x3a')](_0x5bf27b[_0xeea1('0x2f')],_0x2b3077['filters']));if(_0x5bf27b[_0xeea1('0x2f')][_0xeea1('0x3b')]){_0x4a9cba[_0xeea1('0x39')]=_[_0xeea1('0x3c')](_0x4a9cba[_0xeea1('0x39')],{'$or':_['map'](_0x4a9cba[_0xeea1('0x33')],function(_0x1b4f5b){var _0x55db70={};_0x55db70[_0x1b4f5b]={'$like':'%'+_0x5bf27b[_0xeea1('0x2f')]['filter']+'%'};return _0x55db70;})});}_0x4a9cba=_[_0xeea1('0x3c')]({},_0x4a9cba,_0x5bf27b[_0xeea1('0x3d')]);return _0x484644[_0xeea1('0x50')](_0x4a9cba);}})[_0xeea1('0x23')](function(_0x405ef1){if(_0x405ef1){_0x4f227d=_0x405ef1['length'];if(!_0x5bf27b[_0xeea1('0x2f')]['hasOwnProperty'](_0xeea1('0x36'))){_0x4a9cba[_0xeea1('0x1b')]=qs[_0xeea1('0x1b')](_0x5bf27b[_0xeea1('0x2f')][_0xeea1('0x1b')]);_0x4a9cba[_0xeea1('0x1e')]=qs[_0xeea1('0x1e')](_0x5bf27b[_0xeea1('0x2f')][_0xeea1('0x1e')]);}return _0x484644[_0xeea1('0x50')](_0x4a9cba);}})[_0xeea1('0x23')](function(_0x39bb63){if(_0x39bb63){return _0x39bb63?{'count':_0x4f227d,'rows':_0x39bb63}:null;}})['then'](respondWithResult(_0x3baebe,null))['catch'](handleError(_0x3baebe,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 2e76fe1..f791440 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 _0xd4b8=['./cmCompany.attributes','exports','define','CmCompany','cm_companies','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x38bdff,_0xc2aca8){var _0x39412e=function(_0x4cd838){while(--_0x4cd838){_0x38bdff['push'](_0x38bdff['shift']());}};_0x39412e(++_0xc2aca8);}(_0xd4b8,0xd5));var _0x8d4b=function(_0x2ee21c,_0x48aced){_0x2ee21c=_0x2ee21c-0x0;var _0xe1251=_0xd4b8[_0x2ee21c];return _0xe1251;};'use strict';var _=require('lodash');var util=require(_0x8d4b('0x0'));var logger=require(_0x8d4b('0x1'))(_0x8d4b('0x2'));var moment=require(_0x8d4b('0x3'));var BPromise=require(_0x8d4b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8d4b('0x5'));var rimraf=require(_0x8d4b('0x6'));var config=require(_0x8d4b('0x7'));var attributes=require(_0x8d4b('0x8'));module[_0x8d4b('0x9')]=function(_0x574ef9,_0x367a0e){return _0x574ef9[_0x8d4b('0xa')](_0x8d4b('0xb'),attributes,{'tableName':_0x8d4b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x51ce=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash','util'];(function(_0x247d77,_0x1537c2){var _0x4597a7=function(_0x345120){while(--_0x345120){_0x247d77['push'](_0x247d77['shift']());}};_0x4597a7(++_0x1537c2);}(_0x51ce,0x177));var _0xe51c=function(_0x421c56,_0x4efd00){_0x421c56=_0x421c56-0x0;var _0x49b244=_0x51ce[_0x421c56];return _0x49b244;};'use strict';var _=require(_0xe51c('0x0'));var util=require(_0xe51c('0x1'));var logger=require(_0xe51c('0x2'))(_0xe51c('0x3'));var moment=require(_0xe51c('0x4'));var BPromise=require(_0xe51c('0x5'));var rp=require(_0xe51c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe51c('0x7'));var config=require(_0xe51c('0x8'));var attributes=require(_0xe51c('0x9'));module['exports']=function(_0x5d6a5b,_0x25d244){return _0x5d6a5b[_0xe51c('0xa')](_0xe51c('0xb'),attributes,{'tableName':_0xe51c('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 5227fe9..314ac88 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 _0x4c6d=['lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','CmCompany,\x20%s,\x20%s','message','result','catch'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x4c6d,0xdc));var _0xd4c6=function(_0x1ce3fa,_0x2a15c2){_0x1ce3fa=_0x1ce3fa-0x0;var _0x27a3b5=_0x4c6d[_0x1ce3fa];return _0x27a3b5;};'use strict';var _=require(_0xd4c6('0x0'));var util=require(_0xd4c6('0x1'));var moment=require('moment');var BPromise=require(_0xd4c6('0x2'));var rs=require(_0xd4c6('0x3'));var fs=require('fs');var Redis=require(_0xd4c6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd4c6('0x5'));var logger=require(_0xd4c6('0x6'))(_0xd4c6('0x7'));var config=require('../../config/environment');var jayson=require(_0xd4c6('0x8'));var client=jayson[_0xd4c6('0x9')][_0xd4c6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x74c52,_0x5b3949,_0x5e0557){return new BPromise(function(_0x353bed,_0x4404d8){return client[_0xd4c6('0xb')](_0x74c52,_0x5e0557)['then'](function(_0x453c91){logger[_0xd4c6('0xc')]('CmCompany,\x20%s,\x20%s',_0x5b3949,_0xd4c6('0xd'));logger[_0xd4c6('0xe')](_0xd4c6('0xf'),_0x5b3949,_0xd4c6('0xd'),JSON[_0xd4c6('0x10')](_0x453c91));if(_0x453c91['error']){if(_0x453c91[_0xd4c6('0x11')]['code']===0x1f4){logger['error'](_0xd4c6('0x12'),_0x5b3949,_0x453c91[_0xd4c6('0x11')][_0xd4c6('0x13')]);return _0x4404d8(_0x453c91[_0xd4c6('0x11')]['message']);}logger['error']('CmCompany,\x20%s,\x20%s',_0x5b3949,_0x453c91['error']['message']);return _0x353bed(_0x453c91[_0xd4c6('0x11')][_0xd4c6('0x13')]);}else{logger[_0xd4c6('0xc')](_0xd4c6('0x12'),_0x5b3949,_0xd4c6('0xd'));_0x353bed(_0x453c91[_0xd4c6('0x14')][_0xd4c6('0x13')]);}})[_0xd4c6('0x15')](function(_0x4984ac){logger[_0xd4c6('0x11')](_0xd4c6('0x12'),_0x5b3949,_0x4984ac);_0x4404d8(_0x4984ac);});});} \ No newline at end of file +var _0x0e02=['error','message','info','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x43eb38,_0x16d032){var _0x356ae7=function(_0x372307){while(--_0x372307){_0x43eb38['push'](_0x43eb38['shift']());}};_0x356ae7(++_0x16d032);}(_0x0e02,0x1bd));var _0x20e0=function(_0x420822,_0x551a30){_0x420822=_0x420822-0x0;var _0x28d4c1=_0x0e02[_0x420822];return _0x28d4c1;};'use strict';var _=require(_0x20e0('0x0'));var util=require(_0x20e0('0x1'));var moment=require('moment');var BPromise=require(_0x20e0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x20e0('0x3'));var db=require(_0x20e0('0x4'))['db'];var utils=require(_0x20e0('0x5'));var logger=require(_0x20e0('0x6'))(_0x20e0('0x7'));var config=require(_0x20e0('0x8'));var jayson=require(_0x20e0('0x9'));var client=jayson['client'][_0x20e0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17e6b8,_0x1761f6,_0x1b717b){return new BPromise(function(_0x53c43c,_0x4592a3){return client[_0x20e0('0xb')](_0x17e6b8,_0x1b717b)[_0x20e0('0xc')](function(_0x3fce7e){logger['info'](_0x20e0('0xd'),_0x1761f6,_0x20e0('0xe'));logger['debug'](_0x20e0('0xf'),_0x1761f6,_0x20e0('0xe'),JSON[_0x20e0('0x10')](_0x3fce7e));if(_0x3fce7e[_0x20e0('0x11')]){if(_0x3fce7e[_0x20e0('0x11')]['code']===0x1f4){logger[_0x20e0('0x11')]('CmCompany,\x20%s,\x20%s',_0x1761f6,_0x3fce7e[_0x20e0('0x11')][_0x20e0('0x12')]);return _0x4592a3(_0x3fce7e['error'][_0x20e0('0x12')]);}logger[_0x20e0('0x11')](_0x20e0('0xd'),_0x1761f6,_0x3fce7e[_0x20e0('0x11')][_0x20e0('0x12')]);return _0x53c43c(_0x3fce7e[_0x20e0('0x11')]['message']);}else{logger[_0x20e0('0x13')](_0x20e0('0xd'),_0x1761f6,_0x20e0('0xe'));_0x53c43c(_0x3fce7e[_0x20e0('0x14')][_0x20e0('0x12')]);}})[_0x20e0('0x15')](function(_0x312bf3){logger[_0x20e0('0x11')](_0x20e0('0xd'),_0x1761f6,_0x312bf3);_0x4592a3(_0x312bf3);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 1bf10ea..198a737 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 _0xcd34=['/:id','show','/:id/contacts','create','post','addContacts','put','update','delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','/describe','describe'];(function(_0x29836a,_0x1c08bb){var _0x551ff4=function(_0x4aea2a){while(--_0x4aea2a){_0x29836a['push'](_0x29836a['shift']());}};_0x551ff4(++_0x1c08bb);}(_0xcd34,0xab));var _0x4cd3=function(_0x63811d,_0x4c55a8){_0x63811d=_0x63811d-0x0;var _0x34169e=_0xcd34[_0x63811d];return _0x34169e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4cd3('0x0'));var timeout=require(_0x4cd3('0x1'));var express=require(_0x4cd3('0x2'));var router=express[_0x4cd3('0x3')]();var fs_extra=require(_0x4cd3('0x4'));var auth=require(_0x4cd3('0x5'));var interaction=require(_0x4cd3('0x6'));var config=require(_0x4cd3('0x7'));var controller=require(_0x4cd3('0x8'));router[_0x4cd3('0x9')]('/',auth[_0x4cd3('0xa')](),controller['index']);router[_0x4cd3('0x9')](_0x4cd3('0xb'),auth[_0x4cd3('0xa')](),controller[_0x4cd3('0xc')]);router[_0x4cd3('0x9')](_0x4cd3('0xd'),auth[_0x4cd3('0xa')](),controller[_0x4cd3('0xe')]);router[_0x4cd3('0x9')](_0x4cd3('0xf'),auth[_0x4cd3('0xa')](),controller['getContacts']);router['post']('/',auth[_0x4cd3('0xa')](),controller[_0x4cd3('0x10')]);router[_0x4cd3('0x11')](_0x4cd3('0xf'),auth['isAuthenticated'](),controller[_0x4cd3('0x12')]);router[_0x4cd3('0x13')]('/:id',auth[_0x4cd3('0xa')](),controller[_0x4cd3('0x14')]);router[_0x4cd3('0x15')](_0x4cd3('0xd'),auth[_0x4cd3('0xa')](),controller[_0x4cd3('0x16')]);module['exports']=router; \ No newline at end of file +var _0x6e85=['put','delete','exports','multer','util','path','express','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/contacts','getContacts','post','create'];(function(_0x782e88,_0x15a7ae){var _0x208243=function(_0x20b077){while(--_0x20b077){_0x782e88['push'](_0x782e88['shift']());}};_0x208243(++_0x15a7ae);}(_0x6e85,0x1ac));var _0x56e8=function(_0x16302c,_0x8688aa){_0x16302c=_0x16302c-0x0;var _0x40dc4c=_0x6e85[_0x16302c];return _0x40dc4c;};'use strict';var multer=require(_0x56e8('0x0'));var util=require(_0x56e8('0x1'));var path=require(_0x56e8('0x2'));var timeout=require('connect-timeout');var express=require(_0x56e8('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(_0x56e8('0x4'));var controller=require('./cmCompany.controller');router[_0x56e8('0x5')]('/',auth[_0x56e8('0x6')](),controller[_0x56e8('0x7')]);router[_0x56e8('0x5')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x56e8('0x8'),auth['isAuthenticated'](),controller[_0x56e8('0x9')]);router['get'](_0x56e8('0xa'),auth[_0x56e8('0x6')](),controller[_0x56e8('0xb')]);router[_0x56e8('0xc')]('/',auth['isAuthenticated'](),controller[_0x56e8('0xd')]);router[_0x56e8('0xc')](_0x56e8('0xa'),auth[_0x56e8('0x6')](),controller['addContacts']);router[_0x56e8('0xe')](_0x56e8('0x8'),auth[_0x56e8('0x6')](),controller['update']);router[_0x56e8('0xf')](_0x56e8('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x56e8('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index c2fb8a6..4424d2f 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 _0x5b39=['STRING','INTEGER','UNSIGNED','DATE','NOW','lodash','exports'];(function(_0x3f1caa,_0x5da79e){var _0x360472=function(_0x492c04){while(--_0x492c04){_0x3f1caa['push'](_0x3f1caa['shift']());}};_0x360472(++_0x5da79e);}(_0x5b39,0x116));var _0x95b3=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x5b39[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require(_0x95b3('0x0'));var Sequelize=require('sequelize');module[_0x95b3('0x1')]={'firstName':{'type':Sequelize[_0x95b3('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x95b3('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x95b3('0x2')]},'city':{'type':Sequelize[_0x95b3('0x2')]},'country':{'type':Sequelize[_0x95b3('0x2')]},'dateOfBirth':{'type':Sequelize[_0x95b3('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x95b3('0x2')]},'mobile':{'type':Sequelize[_0x95b3('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x95b3('0x2')]},'url':{'type':Sequelize[_0x95b3('0x2')]},'facebook':{'type':Sequelize[_0x95b3('0x2')]},'fb_data':{'type':Sequelize[_0x95b3('0x2')]},'twitter':{'type':Sequelize[_0x95b3('0x2')]},'skype':{'type':Sequelize[_0x95b3('0x2')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x95b3('0x2')]},'line':{'type':Sequelize[_0x95b3('0x2')]},'wechat':{'type':Sequelize[_0x95b3('0x2')]},'telegram':{'type':Sequelize[_0x95b3('0x2')]},'UserId':{'type':Sequelize[_0x95b3('0x3')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x95b3('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x95b3('0x5')],'defaultValue':Sequelize[_0x95b3('0x6')]},'dialTimezone':{'type':Sequelize[_0x95b3('0x2')]},'utcOffset':{'type':Sequelize[_0x95b3('0x3')]}}; \ No newline at end of file +var _0xcce1=['UNSIGNED','DATE','NOW','sequelize','exports','STRING','INTEGER'];(function(_0x499210,_0x325b29){var _0x2e153d=function(_0x951263){while(--_0x951263){_0x499210['push'](_0x499210['shift']());}};_0x2e153d(++_0x325b29);}(_0xcce1,0x11b));var _0x1cce=function(_0x3eb713,_0x437874){_0x3eb713=_0x3eb713-0x0;var _0x1d7128=_0xcce1[_0x3eb713];return _0x1d7128;};'use strict';var _=require('lodash');var Sequelize=require(_0x1cce('0x0'));module[_0x1cce('0x1')]={'firstName':{'type':Sequelize[_0x1cce('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x1cce('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x1cce('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x1cce('0x2')]},'dateOfBirth':{'type':Sequelize[_0x1cce('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x1cce('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x1cce('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x1cce('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x1cce('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x1cce('0x2')]},'viber':{'type':Sequelize[_0x1cce('0x2')]},'line':{'type':Sequelize[_0x1cce('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0x1cce('0x2')]},'priority':{'type':Sequelize[_0x1cce('0x3')](0x2)[_0x1cce('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x1cce('0x5')],'defaultValue':Sequelize[_0x1cce('0x6')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 3a4a00e..e2535a6 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 _0x636d=['userThirdDisposition','UserId','fullname','findAndCountAll','startCase','Website','Account','closed','closedAt','disposition','secondDisposition','thirdDisposition','key','Owner','browserName','customerPort','osName','ratingMessage','ratingValue','referer','subject','substatus','externalUrl','threadId','Interaction','flatten','sortBy','slice','moment','bluebird','util','path','lodash','squel','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','register','json','offset','undefined','limit','status','Content-Range','update','destroy','then','end','error','stack','send','describe','keys','startsWith','cf_','push','trimStart','length','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','field','color','from','tools_tags','select','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','Tag','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','and','uc.UserId\x20=\x20?','value','dateOfBirth','fieldType','datetime','castTo','DATE','buildExpression','start','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','filter','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','QueryTypes','clone','DESC','having','t.id\x20IN\x20?','resolve','user','agent','some','User','getLists','c.ListId\x20IS\x20NULL','role','sequelize','toString','count','merge','CmContact','c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','rows','params','catch','tags','columnName','CmCustomField','findAll','displayName','alias','custom','values','body','get','mergeWith','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','info','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','create','ChatMessage','ChatOfflineMessage','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','$or','findOrCreate','contact','all','show','Tags','name','ContactItemType','ItemType','literal','omit','format','cf_%d','$and','pickBy','setFields','id\x20=\x20?','toParam','text','phone','findOne','rawAttributes','getTags','setTags','ids','setAdditionalPhones','OrderBy','item_types','items','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','CmHopperId','ItemType.OrderBy','duplicateAdditionalPhones','fromContactId','CmContactId','rescheduleAdditionalPhones','hopperId','getHoppers','nolimit','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','CmHopperFinal','JscriptySessionReport','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','split','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','meta','import','binding','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','firstName','../../components/import/cm/csvUpdates','getJourney','mail','chat','sms','openchannel','whatsapp','voice','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','uniqueid','callerid','starttime','endtime','duration','note','createdAt','userDisposition','userSecondDisposition'];(function(_0x173c7d,_0x4221cd){var _0x3df530=function(_0x2d800c){while(--_0x2d800c){_0x173c7d['push'](_0x173c7d['shift']());}};_0x3df530(++_0x4221cd);}(_0x636d,0x158));var _0xd636=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0x636d[_0x4e1d03];return _0x362d4b;};'use strict';var moment=require(_0xd636('0x0'));var BPromise=require(_0xd636('0x1'));var util=require(_0xd636('0x2'));var path=require(_0xd636('0x3'));var fs=require('fs');var _=require(_0xd636('0x4'));var squel=require(_0xd636('0x5'));var Papa=require(_0xd636('0x6'));var Redis=require('ioredis');var qs=require(_0xd636('0x7'));var as=require(_0xd636('0x8'));var logger=require(_0xd636('0x9'))(_0xd636('0xa'));var config=require(_0xd636('0xb'));var shared=require(_0xd636('0xc'));var db=require(_0xd636('0xd'))['db'];config[_0xd636('0xe')]=_[_0xd636('0xf')](config['redis'],{'host':_0xd636('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd636('0xe')]));require('./cmContact.socket')[_0xd636('0x11')](socket);function respondWithResult(_0x4e04fd,_0x492def){_0x492def=_0x492def||0xc8;return function(_0x421c74){if(_0x421c74){return _0x4e04fd['status'](_0x492def)[_0xd636('0x12')](_0x421c74);}};}function respondWithFilteredResult(_0x41c0d0,_0x3901d4){return function(_0x258163){if(_0x258163){var _0x251e18=typeof _0x3901d4[_0xd636('0x13')]===_0xd636('0x14')&&typeof _0x3901d4[_0xd636('0x15')]===_0xd636('0x14');var _0x4420e0=_0x258163['count'];var _0x2f429d=_0x251e18?0x0:_0x3901d4['offset'];var _0x55a22=_0x251e18?_0x258163['count']:_0x3901d4[_0xd636('0x13')]+_0x3901d4[_0xd636('0x15')];var _0x29f227;if(_0x55a22>=_0x4420e0){_0x55a22=_0x4420e0;_0x29f227=0xc8;}else{_0x29f227=0xce;}_0x41c0d0[_0xd636('0x16')](_0x29f227);return _0x41c0d0['set'](_0xd636('0x17'),_0x2f429d+'-'+_0x55a22+'/'+_0x4420e0)['json'](_0x258163);}return null;};}function saveUpdates(_0x164852){return function(_0x5907b3){if(_0x5907b3){return _0x5907b3[_0xd636('0x18')](_0x164852)['then'](function(_0x37d9d4){return _0x37d9d4;});}return null;};}function removeEntity(_0xf670f6){return function(_0x76d202){if(_0x76d202){return _0x76d202[_0xd636('0x19')]()[_0xd636('0x1a')](function(){_0xf670f6[_0xd636('0x16')](0xcc)[_0xd636('0x1b')]();});}};}function handleEntityNotFound(_0x43a20a){return function(_0x4e9b75){if(!_0x4e9b75){_0x43a20a['sendStatus'](0x194);}return _0x4e9b75;};}function handleError(_0x2cc321,_0x3308e3){_0x3308e3=_0x3308e3||0x1f4;return function(_0xfa115f){logger[_0xd636('0x1c')](_0xfa115f[_0xd636('0x1d')]);if(_0xfa115f['name']){delete _0xfa115f['name'];}_0x2cc321['status'](_0x3308e3)[_0xd636('0x1e')](_0xfa115f);};}exports['index']=function(_0x5101c3,_0x22ca73){var _0x382fa7={},_0x4c9ea6={},_0x4a6a37={'count':0x0,'rows':[]};return db['CmContact'][_0xd636('0x1f')]()[_0xd636('0x1a')](function(_0x262d26){var _0x38a455=[];for(var _0x266241=0x0;_0x2662410x1){_0x342117['or'](_0xd636('0x5f'),qs[_0xd636('0x60')](_0x4fa791),null);}else{if(qs[_0xd636('0x61')](_0x4fa791)){_0x342117['or'](_0xd636('0x62'),_0x4fa791+'%');_0x342117['or'](_0xd636('0x63'),_0x4fa791+'%');_0x342117['or']('c.mobile\x20LIKE\x20?',_0x4fa791+'%');_0x342117['or'](_0xd636('0x64'),_0x4fa791+'%');}else if(qs[_0xd636('0x65')](_0x4fa791)){_0x342117['or'](_0xd636('0x66'),_0x4fa791+'%');}else{_0x342117['or'](_0xd636('0x67'),'%'+_0x4fa791+'%');_0x342117['or'](_0xd636('0x68'),'%'+_0x4fa791+'%');_0x342117['or'](_0xd636('0x66'),'%'+_0x4fa791+'%');}}}}_0x1506e7[_0xd636('0x30')](_0x342117);_0x1506e7[_0xd636('0x69')](_0xd636('0x6a'));var _0x2a37a5={'type':db['Sequelize'][_0xd636('0x6b')]['SELECT'],'raw':!![]};var _0x1236d2=_0x1506e7[_0xd636('0x6c')]()['field'](_0xd636('0x6a'));if(_0x382fa7[_0xd636('0x2e')]){_0x382fa7['order'][_0xd636('0x46')](function(_0x55d855){_0x1506e7['order']('c.'+_0x55d855[0x0],_0x55d855[0x1]===_0xd636('0x6d')?![]:!![]);});}if(!_[_0xd636('0x55')](_0x4a7808)){_0x1506e7[_0xd636('0x6e')](_0x1f2aeb);_0x1236d2[_0xd636('0x30')](_0xd636('0x6f'),_0x4a7808);}BPromise[_0xd636('0x70')]()[_0xd636('0x1a')](function(){if(!_0x4dcfbf)return;if(_0x5101c3[_0xd636('0x71')]['role']!==_0xd636('0x72'))return;if(!_[_0xd636('0x73')](_0x4dcfbf[_0xd636('0x42')],[_0xd636('0x32'),_0xd636('0x74')])){return _0x5101c3[_0xd636('0x71')][_0xd636('0x75')]({'attributes':['id'],'raw':!![]})[_0xd636('0x1a')](function(_0x2338ee){if(_[_0xd636('0x55')](_0x2338ee)){_0x1236d2['where'](_0xd636('0x76'));_0x1506e7[_0xd636('0x30')](_0xd636('0x76'));}else{_0x1236d2[_0xd636('0x30')](_0xd636('0x57'),_['map'](_0x2338ee,'id'));_0x1506e7[_0xd636('0x30')](_0xd636('0x57'),_['map'](_0x2338ee,'id'));}});}})[_0xd636('0x1a')](function(){if(_0x5101c3[_0xd636('0x71')][_0xd636('0x77')]==='agent'&&!_0x4dcfbf&&!_0x5101c3['query'][_0xd636('0x56')])return[];return db[_0xd636('0x78')]['query'](_0x1236d2[_0xd636('0x79')](),_0x2a37a5);})[_0xd636('0x1a')](function(_0x349d8a){_0x4a6a37['count']=_0x349d8a[_0xd636('0x25')];if(_0x4a6a37[_0xd636('0x7a')]===0x0)return[];return db[_0xd636('0x78')][_0xd636('0x28')](_0x563e2b[_0xd636('0x79')](),_0x2a37a5)[_0xd636('0x1a')](function(_0x5f0306){_0x5c8cc8=_['keyBy'](_0x5f0306,'id');_0x2a37a5=_[_0xd636('0x7b')](_0x2a37a5,{'model':db[_0xd636('0x7c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5101c3[_0xd636('0x28')][_0xd636('0x2b')]){_0x382fa7[_0xd636('0x2c')][_0xd636('0x46')](function(_0x31e649){_0x1506e7[_0xd636('0x32')]('c.'+_0x31e649);});}else{_0x1506e7[_0xd636('0x32')](_0xd636('0x6a'));_0x1506e7[_0xd636('0x32')](_0xd636('0x7d'));_0x1506e7[_0xd636('0x32')](_0xd636('0x7e'));_0x1506e7[_0xd636('0x32')](_0xd636('0x7f'));_0x1506e7[_0xd636('0x32')](_0xd636('0x80'));_0x1506e7[_0xd636('0x32')](_0xd636('0x81'));_0x1506e7['field']('c.email');_0x1506e7['field'](_0xd636('0x82'));_0x1506e7[_0xd636('0x32')](_0xd636('0x83'));_0x1506e7['field'](_0xd636('0x84'));_0x1506e7[_0xd636('0x32')](_0xd636('0x85'));_0x1506e7[_0xd636('0x32')](_0xd636('0x86'),_0xd636('0x87'));}if(_0x382fa7[_0xd636('0x15')])_0x1506e7[_0xd636('0x15')](_0x382fa7[_0xd636('0x15')]);if(_0x382fa7[_0xd636('0x13')])_0x1506e7[_0xd636('0x13')](_0x382fa7[_0xd636('0x13')]);return db[_0xd636('0x78')][_0xd636('0x28')](_0x1506e7[_0xd636('0x79')](),_0x2a37a5);});})[_0xd636('0x1a')](function(_0x143c4a){_0x143c4a['forEach'](function(_0x8b23ff){if(_0x8b23ff[_0xd636('0x87')]){_0x8b23ff['Tags']=[];_0x8b23ff[_0xd636('0x87')]['split'](',')[_0xd636('0x46')](function(_0x1dfdc3){_0x8b23ff['Tags'][_0xd636('0x23')](_0x5c8cc8[_0x1dfdc3]);});}delete _0x8b23ff['TagIds'];});_0x4a6a37[_0xd636('0x88')]=_0x143c4a;return _0x4a6a37;})['then'](respondWithFilteredResult(_0x22ca73,_0x382fa7));})['catch'](handleError(_0x22ca73,null));};exports[_0xd636('0x19')]=function(_0x2f4fef,_0x12bebd){return db[_0xd636('0x7c')][_0xd636('0x43')]({'where':{'id':_0x2f4fef[_0xd636('0x89')]['id']}})['then'](handleEntityNotFound(_0x12bebd,null))[_0xd636('0x1a')](removeEntity(_0x12bebd,null))[_0xd636('0x8a')](handleError(_0x12bebd,null));};exports['describe']=function(_0x3fcb7b,_0x397086){return db[_0xd636('0x7c')][_0xd636('0x1f')]()[_0xd636('0x1a')](function(_0x406889){delete _0x406889[_0xd636('0x8b')];for(var _0x783fe0=0x0;_0x783fe00x0){return new Promise(function(_0x3f7b77,_0x25d8fd){var _0x4f14ee=[];for(var _0x51b223=0x0;_0x51b223<_0x3a3be7['length'];_0x51b223++){_0x4f14ee[_0xd636('0x23')](insertAdditionalPhones(_0x3a3be7[_0x51b223][_0xd636('0xb5')],_0x3a3be7[_0x51b223][_0xd636('0xb0')]));}Promise[_0xd636('0xb6')](_0x4f14ee)[_0xd636('0x1a')](function(){_0x3f7b77(0x1);});})['then'](function(){return{'success':_0x21e9b4,'failure':_0x1001fc,'duplicates':_0x523f7b};});}else{return{'success':_0x21e9b4,'failure':_0x1001fc,'duplicates':_0x523f7b};}}})[_0xd636('0x1a')](respondWithResult(_0x423212,0xc9))['catch'](handleError(_0x423212,null));};exports[_0xd636('0xb7')]=function(_0x55ca9d,_0x1c7960){var _0x36e4cb;return db[_0xd636('0x7c')]['describe']()[_0xd636('0x1a')](function(_0x110e9c){return db[_0xd636('0x7c')][_0xd636('0x43')]({'where':{'id':_0x55ca9d['params']['id']},'include':[{'model':db[_0xd636('0x44')],'as':_0xd636('0xb8'),'attributes':['id',_0xd636('0xb9'),_0xd636('0x33')],'required':_0x55ca9d[_0xd636('0x28')][_0xd636('0x5b')]?!![]:![]},{'model':db[_0xd636('0xa5')],'as':'Phones','where':{'CmContactId':_0x55ca9d[_0xd636('0x89')]['id']},'required':![],'include':[{'model':db[_0xd636('0xba')],'as':_0xd636('0xbb')}]}],'order':[db[_0xd636('0x78')][_0xd636('0xbc')]('Phones.OrderBy')],'attributes':_[_0xd636('0x20')](_0x110e9c)});})['then'](function(_0x47d526){if(!_[_0xd636('0x53')](_0x47d526)){_0x36e4cb=_0x47d526[_0xd636('0x94')]({'plain':!![]});var _0x3ccced={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x47d526&&_0x47d526[_0xd636('0x56')]){if(_0x47d526['ListId']){_0x3ccced['where']['$and'][_0xd636('0x23')]({'ListId':{'$ne':_0x47d526[_0xd636('0x56')]}});}}return db[_0xd636('0x8d')][_0xd636('0x8e')](_0x3ccced);}})[_0xd636('0x1a')](function(_0x5440c7){if(!_[_0xd636('0x53')](_0x5440c7)){return _[_0xd636('0xbd')](_0x36e4cb,_['map'](_0x5440c7,function(_0x317eba){return util[_0xd636('0xbe')](_0xd636('0xbf'),_0x317eba['id']);}));}})[_0xd636('0x1a')](handleEntityNotFound(_0x1c7960,null))['then'](respondWithResult(_0x1c7960,null))['catch'](handleError(_0x1c7960,null));};exports[_0xd636('0x18')]=function(_0x1a8e31,_0x1fef14){var _0x5cf3d3;if(_0x1a8e31[_0xd636('0x93')]['id']){delete _0x1a8e31[_0xd636('0x93')]['id'];}if(!_[_0xd636('0x53')](_0x1a8e31[_0xd636('0x93')]['dialTimezone'])){var _0x562170=_0x1a8e31[_0xd636('0x93')]['dialTimezone'];if(!_['isNil'](shared[_0xd636('0xae')][_0x562170]))_0x1a8e31[_0xd636('0x93')][_0xd636('0xaf')]=shared['timezones'][_0x562170][_0xd636('0xaf')];}return db[_0xd636('0x7c')][_0xd636('0x43')]({'where':{'id':_0x1a8e31[_0xd636('0x89')]['id']}})[_0xd636('0x1a')](handleEntityNotFound(_0x1fef14,null))[_0xd636('0x1a')](saveUpdates(_0x1a8e31[_0xd636('0x93')],null))[_0xd636('0x1a')](function(_0x5e3bab){_0x5cf3d3=_0x5e3bab;var _0x427a19={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x5e3bab&&_0x5e3bab[_0xd636('0x56')]){if(_0x5e3bab['ListId']){_0x427a19[_0xd636('0x30')][_0xd636('0xc0')]['push']({'ListId':{'$ne':_0x5e3bab[_0xd636('0x56')]}});}}return db[_0xd636('0x8d')][_0xd636('0x8e')](_0x427a19);})[_0xd636('0x1a')](function(_0x5a2ce7){if(_0x5a2ce7){return _[_0xd636('0xbd')](_[_0xd636('0xc1')](_0x1a8e31['body'],function(_0x38b0d9,_0x26aa89){return _[_0xd636('0x21')](_0x26aa89,_0xd636('0x22'));}),_[_0xd636('0x45')](_0x5a2ce7,function(_0xf4e8b9){return util['format'](_0xd636('0xbf'),_0xf4e8b9['id']);}));}})[_0xd636('0x1a')](function(_0x37fd45){if(_0x37fd45&&!_[_0xd636('0x55')](_0x37fd45)){var _0x11bd43=squel[_0xd636('0x18')]()['table'](_0xd636('0x37'))[_0xd636('0xc2')](_0x37fd45)['where'](_0xd636('0xc3'),_0x1a8e31[_0xd636('0x89')]['id'])[_0xd636('0xc4')]();return db[_0xd636('0x78')][_0xd636('0x28')](_0x11bd43[_0xd636('0xc5')],{'replacements':_0x11bd43['values']});}})[_0xd636('0x1a')](function(){if(_0x1a8e31[_0xd636('0x93')][_0xd636('0xc6')]&&_0x5cf3d3){return db[_0xd636('0x98')][_0xd636('0x18')]({'phone':_0x1a8e31['body'][_0xd636('0xc6')],'OrderBy':0x0},{'where':{'ContactId':_0x5cf3d3['id']}});}})[_0xd636('0x1a')](function(){return _0x5cf3d3;})[_0xd636('0x1a')](respondWithResult(_0x1fef14,null))[_0xd636('0x8a')](handleError(_0x1fef14,null));};exports['getTags']=function(_0x1c28cb,_0x52934e){var _0x450706={};var _0x474f12={};var _0x357a26;var _0x3eb4f1;return db[_0xd636('0x7c')][_0xd636('0xc7')]({'where':{'id':_0x1c28cb['params']['id']}})[_0xd636('0x1a')](handleEntityNotFound(_0x52934e,null))['then'](function(_0x451bd1){if(_0x451bd1){_0x357a26=_0x451bd1;_0x474f12['model']=_['keys'](db[_0xd636('0x44')][_0xd636('0xc8')]);_0x474f12[_0xd636('0x28')]=_[_0xd636('0x20')](_0x1c28cb[_0xd636('0x28')]);_0x474f12[_0xd636('0x29')]=_[_0xd636('0x2a')](_0x474f12[_0xd636('0x27')],_0x474f12[_0xd636('0x28')]);_0x450706[_0xd636('0x2c')]=_[_0xd636('0x2a')](_0x474f12[_0xd636('0x27')],qs[_0xd636('0x2b')](_0x1c28cb[_0xd636('0x28')][_0xd636('0x2b')]));_0x450706[_0xd636('0x2c')]=_0x450706[_0xd636('0x2c')][_0xd636('0x25')]?_0x450706[_0xd636('0x2c')]:_0x474f12[_0xd636('0x27')];_0x450706[_0xd636('0x2e')]=qs[_0xd636('0x2f')](_0x1c28cb[_0xd636('0x28')]['sort']);_0x450706['where']=qs['filters'](_['pick'](_0x1c28cb[_0xd636('0x28')],_0x474f12['filters']));if(_0x1c28cb[_0xd636('0x28')][_0xd636('0x5d')]){_0x450706[_0xd636('0x30')]=_['merge'](_0x450706['where'],{'$or':_[_0xd636('0x45')](_0x450706[_0xd636('0x2c')],function(_0x34dbba){var _0x6b1a37={};_0x6b1a37[_0x34dbba]={'$like':'%'+_0x1c28cb[_0xd636('0x28')]['filter']+'%'};return _0x6b1a37;})});}_0x450706=_[_0xd636('0x7b')]({},_0x450706,_0x1c28cb['options']);return _0x357a26[_0xd636('0xc9')](_0x450706);}})[_0xd636('0x1a')](function(_0x2df4f9){if(_0x2df4f9){_0x3eb4f1=_0x2df4f9[_0xd636('0x25')];if(!_0x1c28cb[_0xd636('0x28')][_0xd636('0x2d')]('nolimit')){_0x450706['limit']=qs['limit'](_0x1c28cb[_0xd636('0x28')]['limit']);_0x450706[_0xd636('0x13')]=qs['offset'](_0x1c28cb[_0xd636('0x28')][_0xd636('0x13')]);}return _0x357a26[_0xd636('0xc9')](_0x450706);}})[_0xd636('0x1a')](function(_0x25a069){if(_0x25a069){return _0x25a069?{'count':_0x3eb4f1,'rows':_0x25a069}:null;}})[_0xd636('0x1a')](respondWithResult(_0x52934e,null))[_0xd636('0x8a')](handleError(_0x52934e,null));};exports[_0xd636('0xca')]=function(_0x37ba7a,_0x3073e8){if(_0x37ba7a[_0xd636('0x93')]['id']){delete _0x37ba7a[_0xd636('0x93')]['id'];}return db[_0xd636('0x7c')][_0xd636('0xc7')]({'where':{'id':_0x37ba7a[_0xd636('0x89')]['id']}})[_0xd636('0x1a')](handleEntityNotFound(_0x3073e8,null))[_0xd636('0x1a')](function(_0xb6936d){if(_0xb6936d){return _0xb6936d[_0xd636('0xca')](_0x37ba7a['body'][_0xd636('0xcb')]||[]);}return null;})[_0xd636('0x1a')](respondWithResult(_0x3073e8,null))['catch'](handleError(_0x3073e8,null));};exports[_0xd636('0xcc')]=function(_0x1fffd6,_0x47bfff){var _0x1973fc=[];_0x1973fc['push'](addAdditionalPhones(_0x1fffd6[_0xd636('0x93')]));Promise[_0xd636('0xb6')](_0x1973fc)[_0xd636('0x1a')](function(){_0x1973fc=[];_0x1973fc[_0xd636('0x23')](deleteCmHopperPhones(_0x1fffd6['body']['id']));_0x1973fc[_0xd636('0x23')](addCmHopperPhones(_0x1fffd6['body']['id']));Promise[_0xd636('0xb6')](_0x1973fc)[_0xd636('0x1a')](function(){return[0x1];})[_0xd636('0x1a')](respondWithResult(_0x47bfff,null));});};function addAdditionalPhones(_0x38977c){var _0x1f4ea4;return new Promise(function(_0x213b49,_0x11c96c){return db[_0xd636('0xa5')][_0xd636('0x19')]({'where':{'CmContactId':_0x38977c['id']}})[_0xd636('0x1a')](function(){db[_0xd636('0xba')][_0xd636('0x8e')]({'raw':!![],'attributes':['id',_0xd636('0xcd')]})[_0xd636('0x1a')](function(_0x135837){var _0x566e67=[];for(var _0x5f0245=0x0;_0x5f0245<_0x38977c['items'][_0xd636('0x25')];_0x5f0245++){var _0x5b7ced=_0x38977c[_0xd636('0xce')]?_[_0xd636('0x53')](_0x38977c[_0xd636('0xce')][_0x5f0245])?'':_0x38977c[_0xd636('0xce')][_0x5f0245]:_0x38977c[_0xd636('0xcf')][_0x5f0245][_0xd636('0xd0')]?_0x38977c['items'][_0x5f0245]['ItemTypeId']:'';var _0x2d1221=_[_0xd636('0x53')](_0x38977c[_0xd636('0xcf')][_0x5f0245][_0xd636('0xd1')])?'':_0x38977c[_0xd636('0xcf')][_0x5f0245][_0xd636('0xd1')];var _0x1814eb=_0x5b7ced+':'+_0x38977c[_0xd636('0xcf')][_0x5f0245][_0xd636('0xc6')]+'§'+_0x2d1221;if(_[_0xd636('0x53')](_0x1f4ea4))_0x1f4ea4=_0x1814eb;else _0x1f4ea4+=';'+_0x1814eb;var _0x49d3d5=null;if(_0x38977c[_0xd636('0xce')]){if(!_['isNil'](_0x38977c['item_types'][_0x5f0245])){var _0x1724b7=_[_0xd636('0x43')](_0x135837,function(_0x13efda){return _0x13efda['id']===_0x38977c[_0xd636('0xce')][_0x5f0245];});if(!_[_0xd636('0x53')](_0x1724b7)){_0x49d3d5=_0x1724b7[_0xd636('0xcd')];}}}else{if(!_[_0xd636('0x53')](_0x38977c[_0xd636('0xcf')][_0x5f0245])){var _0x1724b7=_['find'](_0x135837,function(_0x4a5bc8){return _0x4a5bc8['id']===_0x38977c[_0xd636('0xcf')][_0x5f0245]['ItemTypeId'];});if(!_[_0xd636('0x53')](_0x1724b7)){_0x49d3d5=_0x5f0245;}}}if(_[_0xd636('0x53')](_0x49d3d5)){_0x49d3d5=0x64;}_0x566e67['push'](addAdditionalPhone(_0x38977c['id'],_0x38977c[_0xd636('0xcf')][_0x5f0245][_0xd636('0xc6')],_0x38977c[_0xd636('0xce')]?_['isNil'](_0x38977c[_0xd636('0xce')][_0x5f0245])?null:_0x38977c[_0xd636('0xce')][_0x5f0245]:_0x38977c[_0xd636('0xcf')][_0x5f0245][_0xd636('0xd0')]?_0x38977c[_0xd636('0xcf')][_0x5f0245]['ItemTypeId']:null,_0x49d3d5,_0x2d1221));}Promise[_0xd636('0xb6')](_0x566e67)['then'](function(){db['CmContact'][_0xd636('0x18')]({'AdditionalPhones':_0x1f4ea4},{'where':{'id':_0x38977c['id']}})[_0xd636('0x1a')](function(){_0x213b49(0x1);});});});});});}function addAdditionalPhone(_0x1c40a2,_0x68166b,_0x2d1e60,_0x2b28ec,_0x3d23a3){return db[_0xd636('0xa5')][_0xd636('0x43')]({'where':{'CmContactId':_0x1c40a2,'item':_0x68166b}})[_0xd636('0x1a')](function(_0x515705){if(_0x515705)logger['info'](_0xd636('0xd2'),_0x515705);else{db[_0xd636('0xa5')]['create']({'CmContactId':_0x1c40a2,'item':_0x68166b,'ItemTypeId':_0x2d1e60,'OrderBy':_0x2b28ec,'ItemClass':_0xd636('0xd3'),'description':_0x3d23a3});}});}function deletePhones(_0x14fd33){return db['CmContactHasItem']['destroy']({'where':{'CmContactId':_0x14fd33}});}function deleteCmHopperPhones(_0xa92de9){return new Promise(function(_0x285ae7,_0x2490c2){return db[_0xd636('0x98')][_0xd636('0x8e')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0xa92de9}})['then'](function(_0x22ab58){db[_0xd636('0xd4')][_0xd636('0x19')]({'where':{'CmHopperId':{'$in':_['map'](_0x22ab58,'id')}}});})[_0xd636('0x1a')](function(){_0x285ae7(0x1);});});}function addCmHopperPhones(_0x488d13){return new Promise(function(_0x1ebd16,_0x4cdad3){return db[_0xd636('0x98')][_0xd636('0x8e')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x488d13}})[_0xd636('0x1a')](function(_0x52cc8a){var _0x469077=[];_[_0xd636('0x45')](_0x52cc8a,function(_0x426ee6){_0x469077[_0xd636('0x23')](createCmHopperPhone(_0x488d13,_0x426ee6['id']));});Promise[_0xd636('0xb6')](_0x469077)[_0xd636('0x1a')](function(){_0x1ebd16(0x1);});});});}function createCmHopperPhone(_0x194c5a,_0x4ed49a){return new Promise(function(_0x563a33,_0x16a59e){db[_0xd636('0xa5')]['findAll']({'raw':!![],'attributes':['item',_0xd636('0xcd')],'where':{'CmContactId':_0x194c5a,'ItemClass':_0xd636('0xd3')},'include':[{'model':db[_0xd636('0xba')],'attributes':[_0xd636('0xcd')],'as':_0xd636('0xbb')}],'order':[_0xd636('0xcd'),db[_0xd636('0x78')]['literal']('`ItemType`.OrderBy')]})[_0xd636('0x1a')](function(_0x3efb6d){var _0x17da7c=0x1;var _0x57d8b9=_['map'](_0x3efb6d,function(_0x4b6591){_0x4b6591[_0xd636('0xd5')]=_0x4ed49a;_0x4b6591[_0xd636('0xc6')]=_0x4b6591['item'];_0x4b6591[_0xd636('0xcd')]=_0x17da7c;delete _0x4b6591[_0xd636('0xd6')];_0x17da7c=_0x17da7c+0x1;return _0x4b6591;});return db[_0xd636('0xd4')]['bulkCreate'](_0x57d8b9,{});})[_0xd636('0x1a')](function(){_0x563a33(0x1);});});}function insertAdditionalPhones(_0x279562,_0x33b806){return new Promise(function(_0x28ade3,_0x39066e){var _0x1f0224=[];for(var _0x5eaab8=0x0;_0x5eaab8<_0x33b806[_0xd636('0x25')];_0x5eaab8++){var _0x4dd9cb=_0x33b806[_0x5eaab8];_0x1f0224[_0xd636('0x23')](parseContactItemType(_0x4dd9cb));}Promise[_0xd636('0xb6')](_0x1f0224)[_0xd636('0x1a')](function(){var _0x3b8e0a={'id':_0x279562['id'],'items':_0x33b806};return addAdditionalPhones(_0x3b8e0a)['then'](function(_0x2c07fe){return addCmHopperPhones(_0x279562['id']);});})['then'](function(){_0x28ade3(_0x279562);});});}function parseContactItemType(_0x526b53){return new Promise(function(_0x24e340,_0xa95d03){if(_0x526b53[_0xd636('0x2d')](_0xd636('0xd0'))){_0x24e340(_0x526b53);}else{return db[_0xd636('0xba')]['find']({'where':{'name':_0x526b53[_0xd636('0xbb')]}})[_0xd636('0x1a')](function(_0x3118cf){if(_[_0xd636('0x53')](_0x3118cf))_0x526b53[_0xd636('0xd0')]=null;else _0x526b53[_0xd636('0xd0')]=_0x3118cf['id'];_0x24e340(_0x526b53);});}});}exports['getAdditionalPhones']=function(_0x4e0bf6,_0x163d67){return db[_0xd636('0xa5')]['findAll']({'raw':!![],'where':{'CmContactId':_0x4e0bf6['params']['id'],'ItemClass':_0xd636('0xd3')},'include':[{'model':db['ContactItemType'],'as':_0xd636('0xbb')}],'order':[['OrderBy'],[db[_0xd636('0x78')]['literal']('`ItemType`.OrderBy')]]})[_0xd636('0x1a')](function(_0x3fde1f){return _0x3fde1f;})[_0xd636('0x1a')](respondWithResult(_0x163d67,null))[_0xd636('0x8a')](handleError(_0x163d67,null));};exports[_0xd636('0xd7')]=function(_0x2ea75e,_0x550012){return db[_0xd636('0xa5')][_0xd636('0x8e')]({'raw':!![],'where':{'CmContactId':_0x2ea75e['body'][_0xd636('0xd8')]}})[_0xd636('0x1a')](function(_0x83a804){var _0x544a9f=_[_0xd636('0x45')](_0x83a804,function(_0x4ddede){_0x4ddede[_0xd636('0xd9')]=_0x2ea75e[_0xd636('0x93')]['toContactId'];return _0x4ddede;});return db[_0xd636('0xa5')][_0xd636('0xb1')](_0x544a9f,{});})['then'](function(_0x5b46c2){return addCmHopperPhones(_0x2ea75e[_0xd636('0x93')]['toContactId']);})[_0xd636('0x1a')](function(_0xd9c5c2){return['ok'];})[_0xd636('0x1a')](respondWithResult(_0x550012,null))[_0xd636('0x8a')](handleError(_0x550012,null));};exports[_0xd636('0xda')]=function(_0x36a224,_0x4678d7){var _0x203d22=[];_0x203d22[_0xd636('0x23')](createCmHopperPhone(_0x36a224[_0xd636('0x93')]['id'],_0x36a224['body'][_0xd636('0xdb')]));Promise[_0xd636('0xb6')](_0x203d22)['then'](function(){return[0x1];})[_0xd636('0x1a')](respondWithResult(_0x4678d7,null));};exports[_0xd636('0xdc')]=function(_0x21e29c,_0x1ebba2){var _0x6509d0={'raw':![],'where':{}};var _0x24c164={};var _0x5795ef={'count':0x0,'rows':[]};return db['CmContact']['findOne']({'where':{'id':_0x21e29c[_0xd636('0x89')]['id']}})['then'](handleEntityNotFound(_0x1ebba2,null))[_0xd636('0x1a')](function(_0xb380da){if(_0xb380da){_0x24c164[_0xd636('0x27')]=_['keys'](db[_0xd636('0x98')][_0xd636('0xc8')]);_0x24c164[_0xd636('0x28')]=_[_0xd636('0x20')](_0x21e29c['query']);_0x24c164['filters']=_[_0xd636('0x2a')](_0x24c164['model'],_0x24c164[_0xd636('0x28')]);_0x6509d0[_0xd636('0x2c')]=_[_0xd636('0x2a')](_0x24c164['model'],qs[_0xd636('0x2b')](_0x21e29c[_0xd636('0x28')]['fields']));_0x6509d0[_0xd636('0x2c')]=_0x6509d0[_0xd636('0x2c')]['length']?_0x6509d0[_0xd636('0x2c')]:_0x24c164[_0xd636('0x27')];if(!_0x21e29c[_0xd636('0x28')][_0xd636('0x2d')](_0xd636('0xdd'))){_0x6509d0[_0xd636('0x15')]=qs['limit'](_0x21e29c['query']['limit']);_0x6509d0[_0xd636('0x13')]=qs[_0xd636('0x13')](_0x21e29c[_0xd636('0x28')][_0xd636('0x13')]);}_0x6509d0[_0xd636('0x2e')]=qs['sort'](_0x21e29c['query'][_0xd636('0x2f')]);_0x6509d0['where']=qs['filters'](_[_0xd636('0x31')](_0x21e29c[_0xd636('0x28')],_0x24c164[_0xd636('0x29')]));_0x6509d0['where'][_0xd636('0xde')]=_0xb380da['id'];if(_0x21e29c['query']['filter']){_0x6509d0['where']=_[_0xd636('0x7b')](_0x6509d0[_0xd636('0x30')],{'$or':_[_0xd636('0x45')](_0x6509d0[_0xd636('0x2c')],function(_0x20fbf8){var _0x538a1a={};_0x538a1a[_0x20fbf8]={'$like':'%'+_0x21e29c[_0xd636('0x28')][_0xd636('0x5d')]+'%'};return _0x538a1a;})});}_0x6509d0=_[_0xd636('0x7b')]({},_0x6509d0,_0x21e29c[_0xd636('0xdf')]);return db[_0xd636('0x98')][_0xd636('0x7a')]({'where':_0x6509d0['where']})[_0xd636('0x1a')](function(_0x284e8a){_0x5795ef[_0xd636('0x7a')]=_0x284e8a;if(_0x21e29c['query'][_0xd636('0xe0')]){_0x6509d0[_0xd636('0xe1')]=[{'all':!![]}];}return db['CmHopper'][_0xd636('0x8e')](_0x6509d0);})[_0xd636('0x1a')](function(_0x539680){_0x5795ef[_0xd636('0x88')]=_0x539680;return _0x5795ef;});}})['then'](respondWithFilteredResult(_0x1ebba2,_0x6509d0))[_0xd636('0x8a')](handleError(_0x1ebba2,null));};exports[_0xd636('0xe2')]=function(_0x2cfed4,_0x2a821d){var _0x3def1b={'raw':!![],'where':{}};var _0x267c71={};var _0x261016={'count':0x0,'rows':[]};return db[_0xd636('0x7c')][_0xd636('0xc7')]({'where':{'id':_0x2cfed4[_0xd636('0x89')]['id']}})[_0xd636('0x1a')](handleEntityNotFound(_0x2a821d,null))[_0xd636('0x1a')](function(_0x39ae78){if(_0x39ae78){_0x267c71[_0xd636('0x27')]=_[_0xd636('0x20')](db['CmHopperHistory']['rawAttributes']);_0x267c71[_0xd636('0x28')]=_['keys'](_0x2cfed4[_0xd636('0x28')]);_0x267c71[_0xd636('0x29')]=_['intersection'](_0x267c71[_0xd636('0x27')],_0x267c71[_0xd636('0x28')]);_0x3def1b['attributes']=_[_0xd636('0x2a')](_0x267c71['model'],qs[_0xd636('0x2b')](_0x2cfed4[_0xd636('0x28')][_0xd636('0x2b')]));_0x3def1b['attributes']=_0x3def1b[_0xd636('0x2c')]['length']?_0x3def1b['attributes']:_0x267c71[_0xd636('0x27')];if(!_0x2cfed4[_0xd636('0x28')][_0xd636('0x2d')](_0xd636('0xdd'))){_0x3def1b[_0xd636('0x15')]=qs[_0xd636('0x15')](_0x2cfed4[_0xd636('0x28')][_0xd636('0x15')]);_0x3def1b[_0xd636('0x13')]=qs[_0xd636('0x13')](_0x2cfed4[_0xd636('0x28')][_0xd636('0x13')]);}_0x3def1b[_0xd636('0x2e')]=qs['sort'](_0x2cfed4[_0xd636('0x28')][_0xd636('0x2f')]);_0x3def1b[_0xd636('0x30')]=qs[_0xd636('0x29')](_['pick'](_0x2cfed4[_0xd636('0x28')],_0x267c71[_0xd636('0x29')]));_0x3def1b['where'][_0xd636('0xde')]=_0x39ae78['id'];if(_0x2cfed4[_0xd636('0x28')]['filter']){_0x3def1b[_0xd636('0x30')]=_[_0xd636('0x7b')](_0x3def1b[_0xd636('0x30')],{'$or':_[_0xd636('0x45')](_0x3def1b[_0xd636('0x2c')],function(_0x4c10c2){var _0x3e1d9f={};_0x3e1d9f[_0x4c10c2]={'$like':'%'+_0x2cfed4['query'][_0xd636('0x5d')]+'%'};return _0x3e1d9f;})});}_0x3def1b=_['merge']({},_0x3def1b,_0x2cfed4[_0xd636('0xdf')]);return db[_0xd636('0xe3')][_0xd636('0x7a')]({'where':_0x3def1b[_0xd636('0x30')]})[_0xd636('0x1a')](function(_0x23459e){_0x261016[_0xd636('0x7a')]=_0x23459e;if(_0x2cfed4[_0xd636('0x28')][_0xd636('0xe0')]){_0x3def1b[_0xd636('0xe1')]=[{'all':!![]}];}return db[_0xd636('0xe3')][_0xd636('0x8e')](_0x3def1b);})[_0xd636('0x1a')](function(_0x383b58){_0x261016[_0xd636('0x88')]=_0x383b58;return _0x261016;});}})[_0xd636('0x1a')](respondWithFilteredResult(_0x2a821d,_0x3def1b))[_0xd636('0x8a')](handleError(_0x2a821d,null));};exports['getHopperFinals']=function(_0x276855,_0x3dbd28){var _0x3e42bd={'raw':!![],'where':{}};var _0x257dfe={};var _0x28c8dd={'count':0x0,'rows':[]};return db[_0xd636('0x7c')][_0xd636('0xc7')]({'where':{'id':_0x276855[_0xd636('0x89')]['id']}})[_0xd636('0x1a')](handleEntityNotFound(_0x3dbd28,null))[_0xd636('0x1a')](function(_0x24e5b6){if(_0x24e5b6){_0x257dfe['model']=_[_0xd636('0x20')](db['CmHopperFinal']['rawAttributes']);_0x257dfe[_0xd636('0x28')]=_['keys'](_0x276855[_0xd636('0x28')]);_0x257dfe[_0xd636('0x29')]=_['intersection'](_0x257dfe[_0xd636('0x27')],_0x257dfe[_0xd636('0x28')]);_0x3e42bd[_0xd636('0x2c')]=_['intersection'](_0x257dfe[_0xd636('0x27')],qs[_0xd636('0x2b')](_0x276855[_0xd636('0x28')]['fields']));_0x3e42bd[_0xd636('0x2c')]=_0x3e42bd[_0xd636('0x2c')][_0xd636('0x25')]?_0x3e42bd[_0xd636('0x2c')]:_0x257dfe['model'];if(!_0x276855[_0xd636('0x28')][_0xd636('0x2d')]('nolimit')){_0x3e42bd['limit']=qs[_0xd636('0x15')](_0x276855['query'][_0xd636('0x15')]);_0x3e42bd['offset']=qs[_0xd636('0x13')](_0x276855[_0xd636('0x28')]['offset']);}_0x3e42bd[_0xd636('0x2e')]=qs[_0xd636('0x2f')](_0x276855[_0xd636('0x28')]['sort']);_0x3e42bd[_0xd636('0x30')]=qs[_0xd636('0x29')](_[_0xd636('0x31')](_0x276855[_0xd636('0x28')],_0x257dfe['filters']));_0x3e42bd[_0xd636('0x30')]['ContactId']=_0x24e5b6['id'];if(_0x276855[_0xd636('0x28')][_0xd636('0x5d')]){_0x3e42bd[_0xd636('0x30')]=_['merge'](_0x3e42bd[_0xd636('0x30')],{'$or':_[_0xd636('0x45')](_0x3e42bd[_0xd636('0x2c')],function(_0x2c7a3f){var _0x181370={};_0x181370[_0x2c7a3f]={'$like':'%'+_0x276855['query']['filter']+'%'};return _0x181370;})});}_0x3e42bd=_[_0xd636('0x7b')]({},_0x3e42bd,_0x276855[_0xd636('0xdf')]);return db['CmHopperFinal'][_0xd636('0x7a')]({'where':_0x3e42bd['where']})[_0xd636('0x1a')](function(_0x23abf8){_0x28c8dd['count']=_0x23abf8;if(_0x276855[_0xd636('0x28')][_0xd636('0xe0')]){_0x3e42bd[_0xd636('0xe1')]=[{'all':!![]}];}return db[_0xd636('0xe4')][_0xd636('0x8e')](_0x3e42bd);})[_0xd636('0x1a')](function(_0x4f674f){_0x28c8dd['rows']=_0x4f674f;return _0x28c8dd;});}})[_0xd636('0x1a')](respondWithFilteredResult(_0x3dbd28,_0x3e42bd))['catch'](handleError(_0x3dbd28,null));};exports['getJscriptySessions']=function(_0x342b4d,_0x3e5b62){var _0x3cf4bb={'raw':!![],'where':{}};var _0x4aa65d={};var _0x4e5ca3={'count':0x0,'rows':[]};return db['CmContact']['findOne']({'where':{'id':_0x342b4d['params']['id']}})[_0xd636('0x1a')](handleEntityNotFound(_0x3e5b62,null))[_0xd636('0x1a')](function(_0xf08bcb){if(_0xf08bcb){_0x4aa65d[_0xd636('0x27')]=_[_0xd636('0x20')](db[_0xd636('0xe5')]['rawAttributes']);_0x4aa65d[_0xd636('0x28')]=_[_0xd636('0x20')](_0x342b4d[_0xd636('0x28')]);_0x4aa65d[_0xd636('0x29')]=_['intersection'](_0x4aa65d[_0xd636('0x27')],_0x4aa65d['query']);_0x3cf4bb[_0xd636('0x2c')]=_['intersection'](_0x4aa65d[_0xd636('0x27')],qs[_0xd636('0x2b')](_0x342b4d[_0xd636('0x28')]['fields']));_0x3cf4bb[_0xd636('0x2c')]=_0x3cf4bb['attributes'][_0xd636('0x25')]?_0x3cf4bb[_0xd636('0x2c')]:_0x4aa65d['model'];if(!_0x342b4d[_0xd636('0x28')]['hasOwnProperty'](_0xd636('0xdd'))){_0x3cf4bb[_0xd636('0x15')]=qs['limit'](_0x342b4d['query']['limit']);_0x3cf4bb[_0xd636('0x13')]=qs[_0xd636('0x13')](_0x342b4d[_0xd636('0x28')][_0xd636('0x13')]);}_0x3cf4bb[_0xd636('0x2e')]=qs['sort'](_0x342b4d['query']['sort']);_0x3cf4bb[_0xd636('0x30')]=qs['filters'](_[_0xd636('0x31')](_0x342b4d[_0xd636('0x28')],_0x4aa65d[_0xd636('0x29')]));_0x3cf4bb[_0xd636('0x30')][_0xd636('0xde')]=_0xf08bcb['id'];if(_0x342b4d[_0xd636('0x28')][_0xd636('0x5d')]){_0x3cf4bb[_0xd636('0x30')]=_[_0xd636('0x7b')](_0x3cf4bb[_0xd636('0x30')],{'$or':_[_0xd636('0x45')](_0x3cf4bb[_0xd636('0x2c')],function(_0x565238){var _0x3645ee={};_0x3645ee[_0x565238]={'$like':'%'+_0x342b4d['query'][_0xd636('0x5d')]+'%'};return _0x3645ee;})});}_0x3cf4bb=_[_0xd636('0x7b')]({},_0x3cf4bb,_0x342b4d[_0xd636('0xdf')]);return db['JscriptySessionReport'][_0xd636('0x7a')]({'where':_0x3cf4bb[_0xd636('0x30')]})[_0xd636('0x1a')](function(_0x30dca4){_0x4e5ca3['count']=_0x30dca4;if(_0x342b4d[_0xd636('0x28')]['includeAll']){_0x3cf4bb['include']=[{'all':!![]}];}return db[_0xd636('0xe5')]['findAll'](_0x3cf4bb);})[_0xd636('0x1a')](function(_0x50bb5e){_0x4e5ca3[_0xd636('0x88')]=_0x50bb5e;return _0x4e5ca3;});}})['then'](respondWithFilteredResult(_0x3e5b62,_0x3cf4bb))[_0xd636('0x8a')](handleError(_0x3e5b62,null));};exports['uploadCsv']=function(_0x1d6d7d,_0x47ddb2){try{if(!_0x1d6d7d[_0xd636('0x93')][_0xd636('0x56')]){throw new Error(_0xd636('0xe6'));}if(!_0x1d6d7d[_0xd636('0x93')][_0xd636('0xe7')]){throw new Error(_0xd636('0xe8'));}if(!_0x1d6d7d[_0xd636('0x93')][_0xd636('0xe9')]){throw new Error(_0xd636('0xea'));}if(!_0x1d6d7d[_0xd636('0x93')][_0xd636('0xeb')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0xf1aa06=_0x1d6d7d[_0xd636('0x93')][_0xd636('0xe7')][_0xd636('0xec')](',');var _0x48ffef=_0x1d6d7d[_0xd636('0x93')]['binding_values'][_0xd636('0xec')](',');if(!_0xf1aa06['length']||!_0x48ffef['length']||_0xf1aa06[_0xd636('0x25')]!==_0x48ffef['length']){throw new Error(_0xd636('0xed'));}_0x1d6d7d[_0xd636('0x93')][_0xd636('0x2b')]=_['zipObject'](_0xf1aa06,_0x48ffef);if(!_0x1d6d7d[_0xd636('0x93')][_0xd636('0x2b')][_0xd636('0xc6')]){throw new Error(_0xd636('0xee'));}if(!_0x1d6d7d[_0xd636('0x93')]['fields']['firstName']){throw new Error(_0xd636('0xef'));}var _0x32e5d5=path[_0xd636('0x96')](config[_0xd636('0xf0')],_0xd636('0xf1'),_0x1d6d7d[_0xd636('0xf2')]['filename']);fs[_0xd636('0xf3')](_0x32e5d5,parseInt(_0xd636('0xf4'),0x8));var _0x1507b5=require(_0xd636('0xf5'))[_0xd636('0xf6')](path[_0xd636('0x96')](__dirname,_0xd636('0xf7')),[_0x32e5d5,_0x1d6d7d[_0xd636('0x93')][_0xd636('0xe7')],_0x1d6d7d[_0xd636('0x93')][_0xd636('0xe9')],_0x1d6d7d[_0xd636('0x93')]['ListId'],_0x1d6d7d[_0xd636('0x93')]['CompanyId'],_0x1d6d7d[_0xd636('0x93')]['duplicates'],_0x1d6d7d['body'][_0xd636('0xeb')]]);return _0x47ddb2[_0xd636('0x16')](0xc8)['json']({'message':_0xd636('0xf8'),'pid':_0x1507b5[_0xd636('0xf9')]});}catch(_0x401c0a){return _0x47ddb2[_0xd636('0x16')](0x1f4)['send'](_0x401c0a);}};exports[_0xd636('0xfa')]=function(_0x1afac2,_0x2b0349){var _0x48c921=fs[_0xd636('0xfb')](_0x1afac2[_0xd636('0xf2')][_0xd636('0x3')]);Papa[_0xd636('0xfc')](_0x48c921,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x2b3cee){return _0x2b0349[_0xd636('0x16')](0xc8)[_0xd636('0x12')]({'file':_0x1afac2[_0xd636('0xf2')],'fields':_0x2b3cee[_0xd636('0xfd')][_0xd636('0x2b')]});}});};exports[_0xd636('0xfe')]=function(_0x4ad9ca,_0x14608e){return db['User']['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0xd636('0x72')}})['then'](function(_0x5a4cee){var _0x30f6c9=![];if(!_0x4ad9ca[_0xd636('0x93')][_0xd636('0x56')]){throw new Error('No\x20ListId\x20specified');}if(!_0x4ad9ca['body'][_0xd636('0xff')]['phone']){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x4ad9ca[_0xd636('0x93')][_0xd636('0xff')]['firstName']){throw new Error(_0xd636('0xef'));}if(!_0x4ad9ca[_0xd636('0x93')][_0xd636('0xeb')]){throw new Error(_0xd636('0x100'));}var _0x30ceab=require(_0xd636('0xf5'))[_0xd636('0xf6')](path[_0xd636('0x96')](__dirname,'../../components/import/cm/csv2'),[_0x4ad9ca['params']['id'],JSON[_0xd636('0x101')](_0x4ad9ca['body']),JSON[_0xd636('0x101')](_0x5a4cee)]);_0x30ceab['on'](_0xd636('0x102'),function(){_0x30f6c9=!![];return _0x14608e[_0xd636('0x16')](0xc8)[_0xd636('0x12')]({'message':_0xd636('0x103'),'pid':_0x30ceab[_0xd636('0xf9')]});});_0x30ceab['on']('exit',function(_0x41e26d){if(_0x41e26d&&!_0x30f6c9){return _0x14608e['status'](0x1f4)[_0xd636('0x12')]({'message':_0xd636('0x104'),'pid':_0x30ceab[_0xd636('0xf9')]});}});})[_0xd636('0x8a')](handleError(_0x14608e,null));};exports[_0xd636('0x105')]=function(_0x53b938,_0x2ff3c,_0x56964c){return db[_0xd636('0x74')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0xd636('0x72')}})['then'](function(_0x3093fc){var _0x55f1c3=![];if(!_0x53b938[_0xd636('0x93')][_0xd636('0x56')]){throw new Error(_0xd636('0xe6'));}if(!_0x53b938[_0xd636('0x93')][_0xd636('0xff')][_0xd636('0xc6')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x53b938[_0xd636('0x93')][_0xd636('0xff')][_0xd636('0x106')]){throw new Error(_0xd636('0xef'));}if(!_0x53b938[_0xd636('0x93')]['socket_timestamp']){throw new Error(_0xd636('0x100'));}var _0x1fae71=require(_0xd636('0xf5'))[_0xd636('0xf6')](path[_0xd636('0x96')](__dirname,_0xd636('0x107')),[_0x53b938[_0xd636('0x89')]['id'],JSON[_0xd636('0x101')](_0x53b938[_0xd636('0x93')]),JSON[_0xd636('0x101')](_0x3093fc)]);_0x1fae71['on'](_0xd636('0x102'),function(_0x3c5a34){_0x55f1c3=!![];return _0x2ff3c[_0xd636('0x16')](0xc8)[_0xd636('0x12')]({'message':'start\x20child\x20process\x20correctly!','pid':_0x1fae71[_0xd636('0xf9')]});});_0x1fae71['on']('exit',function(_0x25e801){if(_0x25e801&&!_0x55f1c3){return _0x2ff3c[_0xd636('0x16')](0x1f4)[_0xd636('0x12')]({'message':_0xd636('0x104'),'pid':_0x1fae71[_0xd636('0xf9')]});}});})[_0xd636('0x8a')](handleError(_0x2ff3c,null));};exports[_0xd636('0x108')]=function(_0xd67a7a,_0x58a3dd){var _0x2f875b=[_0xd636('0x109'),_0xd636('0x10a'),_0xd636('0x10b'),_0xd636('0x10c'),'fax',_0xd636('0x10d'),_0xd636('0x10e')];var _0x150bd4={'offset':0x0,'order':qs[_0xd636('0x2f')]('-createdAt')},_0x275740={'count':0x0,'rows':[]};Promise[_0xd636('0x70')]()[_0xd636('0x1a')](function(){if(_0xd67a7a[_0xd636('0x28')][_0xd636('0x10f')]){if(!_[_0xd636('0x110')](_0x2f875b,_0xd67a7a[_0xd636('0x28')][_0xd636('0x10f')][_0xd636('0x111')]())){throw new Error(_0xd636('0x112'));}_0x2f875b=[_0xd67a7a[_0xd636('0x28')]['channel']['toLowerCase']()];}if(_0xd67a7a[_0xd636('0x28')]['range']){try{var _0xacb2ee=JSON['parse'](_0xd67a7a[_0xd636('0x28')][_0xd636('0x113')]);if(!moment(_0xacb2ee[_0xd636('0x34')])[_0xd636('0x114')]()){throw new Error(_0xd636('0x115'));}if(!moment(_0xacb2ee['to'])['isValid']()){throw new Error(_0xd636('0x116'));}}catch(_0x8f3736){throw new Error('Invalid\x20createdAt\x20filter');}}if(!_0xd67a7a[_0xd636('0x28')]['hasOwnProperty'](_0xd636('0xdd'))){_0x150bd4[_0xd636('0x15')]=qs[_0xd636('0x15')](_0xd67a7a['query'][_0xd636('0x15')]||0xa);_0x150bd4[_0xd636('0x13')]=qs[_0xd636('0x13')](_0xd67a7a[_0xd636('0x28')][_0xd636('0x13')]);}var _0x492458=_0x2f875b[_0xd636('0x45')](function(_0x60a78){if(_0x60a78===_0xd636('0x10e')){var _0x333715={'attributes':['id',_0xd636('0x117'),_0xd636('0x26'),'source','destination',_0xd636('0x118'),_0xd636('0x119'),_0xd636('0x11a'),_0xd636('0x11b'),_0xd636('0x11c'),_0xd636('0x11d'),_0xd636('0x11e'),_0xd636('0x11f'),_0xd636('0x120'),_0xd636('0x121')],'where':{'ContactId':_0xd67a7a[_0xd636('0x89')]['id']},'include':[{'model':db[_0xd636('0x74')],'as':_0xd636('0x74'),'attributes':['id',_0xd636('0xb9'),_0xd636('0x122'),_0xd636('0x90')]}],'order':[[_0xd636('0x11d'),_0xd636('0x6d')]]};if(_0xd67a7a[_0xd636('0x28')][_0xd636('0x113')]){_0x333715[_0xd636('0x30')][_0xd636('0x11d')]={'$gte':_0xacb2ee[_0xd636('0x34')],'$lte':_0xacb2ee['to']};}return db[_0xd636('0xa7')][_0xd636('0x123')](_0x333715)[_0xd636('0x1a')](function(_0x45d361){_0x275740[_0xd636('0x7a')]+=_0x45d361['count'];return _[_0xd636('0x45')](_0x45d361[_0xd636('0x88')],function(_0x497eba){var _0x135e41=_0x497eba[_0xd636('0x94')]({'plain':!![]});_0x135e41[_0xd636('0x10f')]=_0x60a78;if(_0x135e41['User']){_0x135e41['User']={'id':_0x135e41[_0xd636('0x74')]['id'],'name':_0x135e41[_0xd636('0x74')][_0xd636('0xb9')],'fullname':_0x135e41['User'][_0xd636('0x122')],'alias':_0x135e41[_0xd636('0x74')][_0xd636('0x90')]};}return _0x135e41;});});}else{var _0x356406=_[_0xd636('0x124')](_0x60a78)+(_0x60a78==='chat'?_0xd636('0x125'):_0xd636('0x126'));var _0x578f4b={'attributes':['id',_0xd636('0x127'),_0xd636('0x128'),_0xd636('0x11d'),'note',_0xd636('0x129'),_0xd636('0x12a'),_0xd636('0x12b'),_0xd636('0x121'),_0x356406+'Id'],'where':{'ContactId':_0xd67a7a[_0xd636('0x89')]['id']},'include':[{'model':db[_0x356406],'as':_0xd636('0x126'),'attributes':['id','name',_0xd636('0x12c')]},{'model':db[_0xd636('0x74')],'as':_0xd636('0x12d'),'attributes':['id',_0xd636('0xb9'),_0xd636('0x122')]},{'model':db[_0xd636('0x44')],'as':_0xd636('0xb8'),'attributes':['id',_0xd636('0xb9'),'color'],'through':{'attributes':[]}}],'order':[['createdAt',_0xd636('0x6d')]]};if(_0xd67a7a['query'][_0xd636('0x113')]){_0x578f4b['where'][_0xd636('0x11d')]={'$gte':_0xacb2ee[_0xd636('0x34')],'$lte':_0xacb2ee['to']};}switch(_0x60a78){case _0xd636('0x10a'):_0x578f4b[_0xd636('0x2c')]['push'](_0xd636('0x12e'),'customerIp',_0xd636('0x12f'),'deviceModel',_0xd636('0x130'),_0xd636('0x131'),'ratingType',_0xd636('0x132'),_0xd636('0x133'));break;case _0xd636('0x109'):_0x578f4b[_0xd636('0x2c')][_0xd636('0x23')](_0xd636('0x134'),_0xd636('0x135'));break;case _0xd636('0x10c'):_0x578f4b['attributes'][_0xd636('0x23')](_0xd636('0x136'),_0xd636('0x137'));break;}return db[_[_0xd636('0x124')](_0x60a78)+_0xd636('0x138')][_0xd636('0x123')](_0x578f4b)['then'](function(_0x230be3){_0x275740['count']+=_0x230be3[_0xd636('0x7a')];return _[_0xd636('0x45')](_0x230be3[_0xd636('0x88')],function(_0x2b6d0f){var _0xb78d14=_0x2b6d0f['get']({'plain':!![]});_0xb78d14[_0xd636('0x10f')]=_0x60a78;if(_0xb78d14[_0xd636('0x12d')]){_0xb78d14['Owner']={'id':_0xb78d14[_0xd636('0x12d')]['id'],'name':_0xb78d14[_0xd636('0x12d')][_0xd636('0xb9')],'fullname':_0xb78d14[_0xd636('0x12d')][_0xd636('0x122')]};}return _0xb78d14;});});}});return Promise['all'](_0x492458);})[_0xd636('0x1a')](function(_0xa6774c){return _(_0xa6774c)[_0xd636('0x139')]()[_0xd636('0x13a')](_0xd636('0x11d'))['reverse']()[_0xd636('0x4b')]();})[_0xd636('0x1a')](function(_0x432ce1){_0x275740[_0xd636('0x88')]=_0x150bd4[_0xd636('0x15')]?_0x432ce1[_0xd636('0x13b')](_0x150bd4[_0xd636('0x13')],_0x150bd4[_0xd636('0x13')]+_0x150bd4[_0xd636('0x15')]):_0x432ce1;return _0x275740;})[_0xd636('0x1a')](respondWithFilteredResult(_0x58a3dd,_0x150bd4))['catch'](handleError(_0x58a3dd,null));}; \ No newline at end of file +var _0x90b1=['count','set','Content-Range','json','update','then','destroy','end','sendStatus','error','stack','name','send','index','keys','length','cf_','push','CmCustomField','findOne','trimStart','fieldType','type','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','sort','where','pick','select','field','from','tools_tags','cm_contacts','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','left_join','ct.CmContactId\x20=\x20c.id','expr','search','sqlOperator','conditions','find','Tag','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','value','dateOfBirth','castTo','DATE','buildExpression','text','filter','isNil','Contact','isEmpty','c.ListId\x20IN\x20?','concat','\x20=\x20?','isArray','tag','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.phone\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','Sequelize','QueryTypes','SELECT','clone','c.id','order','having','resolve','user','agent','some','c.ListId\x20IS\x20NULL','role','ListId','sequelize','toString','keyBy','merge','CmContact','fields','c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.email','c.createdAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','split','rows','catch','params','describe','startsWith','columnName','displayName','analytics','findAll','alias','custom','values','body','get','mergeWith','tags','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','info','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatOfflineMessage','MailMessage','MailInteraction','FaxInteraction','OpenchannelInteraction','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappQueueReport','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','$or','findOrCreate','spread','contact','all','show','Phones','ContactItemType','ItemType','literal','format','cf_%d','$and','omit','pickBy','table','setFields','toParam','phone','getTags','rawAttributes','options','setTags','ids','OrderBy','item_types','items','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','`ItemType`.OrderBy','ItemType.OrderBy','getAdditionalPhones','duplicateAdditionalPhones','CmContactId','toContactId','hopperId','getHoppers','ContactId','includeAll','include','getHopperHistories','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Incorrect\x20binding\x20parameters\x20passed!','zipObject','firstName','root','server/files/tmp','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','File\x20uploaded\x20correctly!','pid','upload','parse','meta','import','No\x20phone\x20column\x20specified','binding','No\x20firstName\x20column\x20specified','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','getJourney','mail','chat','sms','fax','whatsapp','voice','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','source','callerid','starttime','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','fullname','DESC','VoiceCallReport','startCase','Account','closed','closedAt','disposition','UserId','key','Owner','Tags','browserName','customerIp','customerPort','deviceModel','osName','ratingType','ratingValue','referer','subject','externalUrl','Interaction','findAndCountAll','flatten','moment','util','path','squel','papaparse','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','offset','limit','undefined'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x90b1,0x11d));var _0x190b=function(_0x281678,_0x1dd450){_0x281678=_0x281678-0x0;var _0x5c9ac8=_0x90b1[_0x281678];return _0x5c9ac8;};'use strict';var moment=require(_0x190b('0x0'));var BPromise=require('bluebird');var util=require(_0x190b('0x1'));var path=require(_0x190b('0x2'));var fs=require('fs');var _=require('lodash');var squel=require(_0x190b('0x3'));var Papa=require(_0x190b('0x4'));var Redis=require('ioredis');var qs=require(_0x190b('0x5'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0x190b('0x6'))(_0x190b('0x7'));var config=require('../../config/environment');var shared=require('../../config/environment/shared');var db=require(_0x190b('0x8'))['db'];config[_0x190b('0x9')]=_[_0x190b('0xa')](config[_0x190b('0x9')],{'host':_0x190b('0xb'),'port':0x18eb});var socket=require(_0x190b('0xc'))(new Redis(config[_0x190b('0x9')]));require('./cmContact.socket')[_0x190b('0xd')](socket);function respondWithResult(_0x389ed0,_0x5a94d6){_0x5a94d6=_0x5a94d6||0xc8;return function(_0xff3c7b){if(_0xff3c7b){return _0x389ed0[_0x190b('0xe')](_0x5a94d6)['json'](_0xff3c7b);}};}function respondWithFilteredResult(_0x3da789,_0x10384a){return function(_0x5e5a3c){if(_0x5e5a3c){var _0x589340=typeof _0x10384a[_0x190b('0xf')]==='undefined'&&typeof _0x10384a[_0x190b('0x10')]===_0x190b('0x11');var _0x915065=_0x5e5a3c[_0x190b('0x12')];var _0x108e5a=_0x589340?0x0:_0x10384a[_0x190b('0xf')];var _0x5a546b=_0x589340?_0x5e5a3c[_0x190b('0x12')]:_0x10384a[_0x190b('0xf')]+_0x10384a[_0x190b('0x10')];var _0x21f786;if(_0x5a546b>=_0x915065){_0x5a546b=_0x915065;_0x21f786=0xc8;}else{_0x21f786=0xce;}_0x3da789[_0x190b('0xe')](_0x21f786);return _0x3da789[_0x190b('0x13')](_0x190b('0x14'),_0x108e5a+'-'+_0x5a546b+'/'+_0x915065)[_0x190b('0x15')](_0x5e5a3c);}return null;};}function saveUpdates(_0xc027a9){return function(_0x14bc6d){if(_0x14bc6d){return _0x14bc6d[_0x190b('0x16')](_0xc027a9)[_0x190b('0x17')](function(_0x313f69){return _0x313f69;});}return null;};}function removeEntity(_0x8351c2){return function(_0x3a285c){if(_0x3a285c){return _0x3a285c[_0x190b('0x18')]()[_0x190b('0x17')](function(){_0x8351c2[_0x190b('0xe')](0xcc)[_0x190b('0x19')]();});}};}function handleEntityNotFound(_0x2f9be2){return function(_0x5e46a3){if(!_0x5e46a3){_0x2f9be2[_0x190b('0x1a')](0x194);}return _0x5e46a3;};}function handleError(_0x518812,_0x1140b4){_0x1140b4=_0x1140b4||0x1f4;return function(_0x3efaff){logger[_0x190b('0x1b')](_0x3efaff[_0x190b('0x1c')]);if(_0x3efaff[_0x190b('0x1d')]){delete _0x3efaff[_0x190b('0x1d')];}_0x518812[_0x190b('0xe')](_0x1140b4)[_0x190b('0x1e')](_0x3efaff);};}exports[_0x190b('0x1f')]=function(_0x564a87,_0x438085){var _0x2294e7={},_0x18f01b={},_0x36e0e5={'count':0x0,'rows':[]};return db['CmContact']['describe']()[_0x190b('0x17')](function(_0x269f8f){var _0x32ead1=[];for(var _0x3d799f=0x0;_0x3d799f0x1){_0x3fb864['or'](_0x190b('0x59'),qs[_0x190b('0x5a')](_0x1937b3),null);}else{if(qs['isNumeric'](_0x1937b3)){_0x3fb864['or']('c.id\x20LIKE\x20?',_0x1937b3+'%');_0x3fb864['or'](_0x190b('0x5b'),_0x1937b3+'%');_0x3fb864['or']('c.mobile\x20LIKE\x20?',_0x1937b3+'%');_0x3fb864['or']('c.fax\x20LIKE\x20?',_0x1937b3+'%');}else if(qs['isEmail'](_0x1937b3)){_0x3fb864['or'](_0x190b('0x5c'),_0x1937b3+'%');}else{_0x3fb864['or'](_0x190b('0x5d'),'%'+_0x1937b3+'%');_0x3fb864['or'](_0x190b('0x5e'),'%'+_0x1937b3+'%');_0x3fb864['or'](_0x190b('0x5c'),'%'+_0x1937b3+'%');}}}}_0x1a5c2f[_0x190b('0x31')](_0x3fb864);_0x1a5c2f['group']('c.id');var _0x5891de={'type':db[_0x190b('0x5f')][_0x190b('0x60')][_0x190b('0x61')],'raw':!![]};var _0xf357a4=_0x1a5c2f[_0x190b('0x62')]()['field'](_0x190b('0x63'));if(_0x2294e7[_0x190b('0x64')]){_0x2294e7['order'][_0x190b('0x43')](function(_0x5c69e8){_0x1a5c2f[_0x190b('0x64')]('c.'+_0x5c69e8[0x0],_0x5c69e8[0x1]==='DESC'?![]:!![]);});}if(!_[_0x190b('0x52')](_0x48fee8)){_0x1a5c2f[_0x190b('0x65')](_0x44e772);_0xf357a4[_0x190b('0x31')]('t.id\x20IN\x20?',_0x48fee8);}BPromise[_0x190b('0x66')]()[_0x190b('0x17')](function(){if(!_0x29bbb4)return;if(_0x564a87[_0x190b('0x67')]['role']!==_0x190b('0x68'))return;if(!_[_0x190b('0x69')](_0x29bbb4[_0x190b('0x3f')],[_0x190b('0x34'),_0x190b('0x46')])){return _0x564a87[_0x190b('0x67')]['getLists']({'attributes':['id'],'raw':!![]})[_0x190b('0x17')](function(_0x384b90){if(_['isEmpty'](_0x384b90)){_0xf357a4[_0x190b('0x31')](_0x190b('0x6a'));_0x1a5c2f[_0x190b('0x31')](_0x190b('0x6a'));}else{_0xf357a4['where'](_0x190b('0x53'),_[_0x190b('0x42')](_0x384b90,'id'));_0x1a5c2f['where'](_0x190b('0x53'),_['map'](_0x384b90,'id'));}});}})[_0x190b('0x17')](function(){if(_0x564a87[_0x190b('0x67')][_0x190b('0x6b')]==='agent'&&!_0x29bbb4&&!_0x564a87[_0x190b('0x2a')][_0x190b('0x6c')])return[];return db[_0x190b('0x6d')][_0x190b('0x2a')](_0xf357a4[_0x190b('0x6e')](),_0x5891de);})[_0x190b('0x17')](function(_0x173af0){_0x36e0e5['count']=_0x173af0[_0x190b('0x21')];if(_0x36e0e5[_0x190b('0x12')]===0x0)return[];return db[_0x190b('0x6d')][_0x190b('0x2a')](_0x52ef38[_0x190b('0x6e')](),_0x5891de)[_0x190b('0x17')](function(_0x20554b){_0x227c09=_[_0x190b('0x6f')](_0x20554b,'id');_0x5891de=_[_0x190b('0x70')](_0x5891de,{'model':db[_0x190b('0x71')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x564a87[_0x190b('0x2a')][_0x190b('0x72')]){_0x2294e7[_0x190b('0x2d')][_0x190b('0x43')](function(_0xe92638){_0x1a5c2f[_0x190b('0x34')]('c.'+_0xe92638);});}else{_0x1a5c2f[_0x190b('0x34')](_0x190b('0x63'));_0x1a5c2f['field'](_0x190b('0x73'));_0x1a5c2f[_0x190b('0x34')](_0x190b('0x74'));_0x1a5c2f[_0x190b('0x34')](_0x190b('0x75'));_0x1a5c2f[_0x190b('0x34')](_0x190b('0x76'));_0x1a5c2f['field'](_0x190b('0x77'));_0x1a5c2f[_0x190b('0x34')](_0x190b('0x78'));_0x1a5c2f['field']('c.ListId');_0x1a5c2f[_0x190b('0x34')](_0x190b('0x79'));_0x1a5c2f[_0x190b('0x34')]('c.deletedAt');_0x1a5c2f[_0x190b('0x34')](_0x190b('0x7a'));_0x1a5c2f[_0x190b('0x34')](_0x190b('0x7b'),'TagIds');}if(_0x2294e7['limit'])_0x1a5c2f['limit'](_0x2294e7[_0x190b('0x10')]);if(_0x2294e7['offset'])_0x1a5c2f[_0x190b('0xf')](_0x2294e7[_0x190b('0xf')]);return db[_0x190b('0x6d')][_0x190b('0x2a')](_0x1a5c2f[_0x190b('0x6e')](),_0x5891de);});})['then'](function(_0x572dba){_0x572dba['forEach'](function(_0x5de422){if(_0x5de422[_0x190b('0x7c')]){_0x5de422['Tags']=[];_0x5de422[_0x190b('0x7c')][_0x190b('0x7d')](',')[_0x190b('0x43')](function(_0x40be07){_0x5de422['Tags'][_0x190b('0x23')](_0x227c09[_0x40be07]);});}delete _0x5de422['TagIds'];});_0x36e0e5[_0x190b('0x7e')]=_0x572dba;return _0x36e0e5;})[_0x190b('0x17')](respondWithFilteredResult(_0x438085,_0x2294e7));})[_0x190b('0x7f')](handleError(_0x438085,null));};exports[_0x190b('0x18')]=function(_0x366b3b,_0x711929){return db[_0x190b('0x71')]['find']({'where':{'id':_0x366b3b[_0x190b('0x80')]['id']}})[_0x190b('0x17')](handleEntityNotFound(_0x711929,null))[_0x190b('0x17')](removeEntity(_0x711929,null))[_0x190b('0x7f')](handleError(_0x711929,null));};exports[_0x190b('0x81')]=function(_0x425aad,_0x3f6f48){return db[_0x190b('0x71')][_0x190b('0x81')]()['then'](function(_0x49ed6d){delete _0x49ed6d['tags'];for(var _0x2bcee7=0x0;_0x2bcee70x0){return new Promise(function(_0x12059d,_0x19f377){var _0x3bc77d=[];for(var _0x2c9efa=0x0;_0x2c9efa<_0x1bdd1c['length'];_0x2c9efa++){_0x3bc77d[_0x190b('0x23')](insertAdditionalPhones(_0x1bdd1c[_0x2c9efa][_0x190b('0xaf')],_0x1bdd1c[_0x2c9efa][_0x190b('0xa8')]));}Promise[_0x190b('0xb0')](_0x3bc77d)[_0x190b('0x17')](function(){_0x12059d(0x1);});})[_0x190b('0x17')](function(){return{'success':_0x46adc6,'failure':_0x38d19d,'duplicates':_0x1c54d0};});}else{return{'success':_0x46adc6,'failure':_0x38d19d,'duplicates':_0x1c54d0};}}})[_0x190b('0x17')](respondWithResult(_0x429c20,0xc9))[_0x190b('0x7f')](handleError(_0x429c20,null));};exports[_0x190b('0xb1')]=function(_0x37dcfd,_0x41ea2c){var _0x4b8e98;return db[_0x190b('0x71')][_0x190b('0x81')]()['then'](function(_0x55c9aa){return db[_0x190b('0x71')][_0x190b('0x40')]({'where':{'id':_0x37dcfd['params']['id']},'include':[{'model':db['Tag'],'as':'Tags','attributes':['id',_0x190b('0x1d'),'color'],'required':_0x37dcfd[_0x190b('0x2a')][_0x190b('0x57')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x190b('0xb2'),'where':{'CmContactId':_0x37dcfd[_0x190b('0x80')]['id']},'required':![],'include':[{'model':db[_0x190b('0xb3')],'as':_0x190b('0xb4')}]}],'order':[db[_0x190b('0x6d')][_0x190b('0xb5')]('Phones.OrderBy')],'attributes':_[_0x190b('0x20')](_0x55c9aa)});})[_0x190b('0x17')](function(_0x3bfde6){if(!_[_0x190b('0x50')](_0x3bfde6)){_0x4b8e98=_0x3bfde6[_0x190b('0x8b')]({'plain':!![]});var _0x5e46ca={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x3bfde6&&_0x3bfde6[_0x190b('0x6c')]){if(_0x3bfde6[_0x190b('0x6c')]){_0x5e46ca[_0x190b('0x31')]['$and'][_0x190b('0x23')]({'ListId':{'$ne':_0x3bfde6['ListId']}});}}return db[_0x190b('0x24')]['findAll'](_0x5e46ca);}})[_0x190b('0x17')](function(_0x2a9fae){if(!_[_0x190b('0x50')](_0x2a9fae)){return _['omit'](_0x4b8e98,_[_0x190b('0x42')](_0x2a9fae,function(_0x206611){return util[_0x190b('0xb6')](_0x190b('0xb7'),_0x206611['id']);}));}})[_0x190b('0x17')](handleEntityNotFound(_0x41ea2c,null))[_0x190b('0x17')](respondWithResult(_0x41ea2c,null))['catch'](handleError(_0x41ea2c,null));};exports[_0x190b('0x16')]=function(_0x5a5e38,_0x38ea79){var _0x3238a2;if(_0x5a5e38[_0x190b('0x8a')]['id']){delete _0x5a5e38['body']['id'];}if(!_[_0x190b('0x50')](_0x5a5e38[_0x190b('0x8a')]['dialTimezone'])){var _0x1c10ff=_0x5a5e38[_0x190b('0x8a')]['dialTimezone'];if(!_[_0x190b('0x50')](shared['timezones'][_0x1c10ff]))_0x5a5e38[_0x190b('0x8a')][_0x190b('0xa7')]=shared[_0x190b('0xa6')][_0x1c10ff][_0x190b('0xa7')];}return db[_0x190b('0x71')]['find']({'where':{'id':_0x5a5e38[_0x190b('0x80')]['id']}})[_0x190b('0x17')](handleEntityNotFound(_0x38ea79,null))[_0x190b('0x17')](saveUpdates(_0x5a5e38[_0x190b('0x8a')],null))[_0x190b('0x17')](function(_0x35231e){_0x3238a2=_0x35231e;var _0x5b5666={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x35231e&&_0x35231e['ListId']){if(_0x35231e[_0x190b('0x6c')]){_0x5b5666['where'][_0x190b('0xb8')][_0x190b('0x23')]({'ListId':{'$ne':_0x35231e[_0x190b('0x6c')]}});}}return db[_0x190b('0x24')][_0x190b('0x86')](_0x5b5666);})[_0x190b('0x17')](function(_0x9c989a){if(_0x9c989a){return _[_0x190b('0xb9')](_[_0x190b('0xba')](_0x5a5e38[_0x190b('0x8a')],function(_0x2f26bf,_0x32481d){return _[_0x190b('0x82')](_0x32481d,_0x190b('0x22'));}),_[_0x190b('0x42')](_0x9c989a,function(_0x28530d){return util[_0x190b('0xb6')](_0x190b('0xb7'),_0x28530d['id']);}));}})[_0x190b('0x17')](function(_0x1fcdb0){if(_0x1fcdb0&&!_[_0x190b('0x52')](_0x1fcdb0)){var _0x3842b8=squel[_0x190b('0x16')]()[_0x190b('0xbb')]('cm_contacts')[_0x190b('0xbc')](_0x1fcdb0)[_0x190b('0x31')]('id\x20=\x20?',_0x5a5e38[_0x190b('0x80')]['id'])[_0x190b('0xbd')]();return db[_0x190b('0x6d')]['query'](_0x3842b8[_0x190b('0x4e')],{'replacements':_0x3842b8[_0x190b('0x89')]});}})['then'](function(){if(_0x5a5e38['body'][_0x190b('0xbe')]&&_0x3238a2){return db['CmHopper']['update']({'phone':_0x5a5e38['body'][_0x190b('0xbe')],'OrderBy':0x0},{'where':{'ContactId':_0x3238a2['id']}});}})['then'](function(){return _0x3238a2;})[_0x190b('0x17')](respondWithResult(_0x38ea79,null))['catch'](handleError(_0x38ea79,null));};exports[_0x190b('0xbf')]=function(_0x4d39ba,_0x2fc98d){var _0x316f0a={};var _0x24b7fc={};var _0x280445;var _0x39a820;return db[_0x190b('0x71')]['findOne']({'where':{'id':_0x4d39ba[_0x190b('0x80')]['id']}})[_0x190b('0x17')](handleEntityNotFound(_0x2fc98d,null))[_0x190b('0x17')](function(_0xa708f8){if(_0xa708f8){_0x280445=_0xa708f8;_0x24b7fc[_0x190b('0x29')]=_[_0x190b('0x20')](db['Tag'][_0x190b('0xc0')]);_0x24b7fc[_0x190b('0x2a')]=_[_0x190b('0x20')](_0x4d39ba[_0x190b('0x2a')]);_0x24b7fc['filters']=_[_0x190b('0x2c')](_0x24b7fc[_0x190b('0x29')],_0x24b7fc[_0x190b('0x2a')]);_0x316f0a[_0x190b('0x2d')]=_[_0x190b('0x2c')](_0x24b7fc[_0x190b('0x29')],qs[_0x190b('0x72')](_0x4d39ba[_0x190b('0x2a')][_0x190b('0x72')]));_0x316f0a[_0x190b('0x2d')]=_0x316f0a[_0x190b('0x2d')]['length']?_0x316f0a[_0x190b('0x2d')]:_0x24b7fc['model'];_0x316f0a[_0x190b('0x64')]=qs['sort'](_0x4d39ba[_0x190b('0x2a')][_0x190b('0x30')]);_0x316f0a[_0x190b('0x31')]=qs[_0x190b('0x2b')](_[_0x190b('0x32')](_0x4d39ba['query'],_0x24b7fc[_0x190b('0x2b')]));if(_0x4d39ba[_0x190b('0x2a')][_0x190b('0x4f')]){_0x316f0a['where']=_[_0x190b('0x70')](_0x316f0a[_0x190b('0x31')],{'$or':_['map'](_0x316f0a[_0x190b('0x2d')],function(_0x4a0405){var _0x1b154f={};_0x1b154f[_0x4a0405]={'$like':'%'+_0x4d39ba[_0x190b('0x2a')][_0x190b('0x4f')]+'%'};return _0x1b154f;})});}_0x316f0a=_[_0x190b('0x70')]({},_0x316f0a,_0x4d39ba[_0x190b('0xc1')]);return _0x280445[_0x190b('0xbf')](_0x316f0a);}})[_0x190b('0x17')](function(_0x5dd4bb){if(_0x5dd4bb){_0x39a820=_0x5dd4bb['length'];if(!_0x4d39ba[_0x190b('0x2a')][_0x190b('0x2e')](_0x190b('0x2f'))){_0x316f0a[_0x190b('0x10')]=qs[_0x190b('0x10')](_0x4d39ba[_0x190b('0x2a')][_0x190b('0x10')]);_0x316f0a[_0x190b('0xf')]=qs['offset'](_0x4d39ba[_0x190b('0x2a')][_0x190b('0xf')]);}return _0x280445[_0x190b('0xbf')](_0x316f0a);}})['then'](function(_0x2e165d){if(_0x2e165d){return _0x2e165d?{'count':_0x39a820,'rows':_0x2e165d}:null;}})[_0x190b('0x17')](respondWithResult(_0x2fc98d,null))[_0x190b('0x7f')](handleError(_0x2fc98d,null));};exports[_0x190b('0xc2')]=function(_0x5e768a,_0x56c7d5){if(_0x5e768a['body']['id']){delete _0x5e768a[_0x190b('0x8a')]['id'];}return db[_0x190b('0x71')][_0x190b('0x25')]({'where':{'id':_0x5e768a[_0x190b('0x80')]['id']}})[_0x190b('0x17')](handleEntityNotFound(_0x56c7d5,null))['then'](function(_0x6bc093){if(_0x6bc093){return _0x6bc093[_0x190b('0xc2')](_0x5e768a['body'][_0x190b('0xc3')]||[]);}return null;})[_0x190b('0x17')](respondWithResult(_0x56c7d5,null))[_0x190b('0x7f')](handleError(_0x56c7d5,null));};exports['setAdditionalPhones']=function(_0x199fbf,_0x3fba89){var _0x3b89ca=[];_0x3b89ca[_0x190b('0x23')](addAdditionalPhones(_0x199fbf[_0x190b('0x8a')]));Promise[_0x190b('0xb0')](_0x3b89ca)[_0x190b('0x17')](function(){_0x3b89ca=[];_0x3b89ca[_0x190b('0x23')](deleteCmHopperPhones(_0x199fbf[_0x190b('0x8a')]['id']));_0x3b89ca['push'](addCmHopperPhones(_0x199fbf['body']['id']));Promise[_0x190b('0xb0')](_0x3b89ca)['then'](function(){return[0x1];})[_0x190b('0x17')](respondWithResult(_0x3fba89,null));});};function addAdditionalPhones(_0x87c04d){var _0x3be56f;return new Promise(function(_0x3555bb,_0xd6bcbd){return db['CmContactHasItem'][_0x190b('0x18')]({'where':{'CmContactId':_0x87c04d['id']}})[_0x190b('0x17')](function(){db['ContactItemType'][_0x190b('0x86')]({'raw':!![],'attributes':['id',_0x190b('0xc4')]})['then'](function(_0x1d126c){var _0x498246=[];for(var _0x1f67b5=0x0;_0x1f67b5<_0x87c04d['items'][_0x190b('0x21')];_0x1f67b5++){var _0x12b500=_0x87c04d[_0x190b('0xc5')]?_['isNil'](_0x87c04d['item_types'][_0x1f67b5])?'':_0x87c04d[_0x190b('0xc5')][_0x1f67b5]:_0x87c04d[_0x190b('0xc6')][_0x1f67b5]['ItemTypeId']?_0x87c04d['items'][_0x1f67b5][_0x190b('0xc7')]:'';var _0x418e7b=_[_0x190b('0x50')](_0x87c04d['items'][_0x1f67b5][_0x190b('0xc8')])?'':_0x87c04d[_0x190b('0xc6')][_0x1f67b5]['description'];var _0x28705a=_0x12b500+':'+_0x87c04d[_0x190b('0xc6')][_0x1f67b5][_0x190b('0xbe')]+'§'+_0x418e7b;if(_[_0x190b('0x50')](_0x3be56f))_0x3be56f=_0x28705a;else _0x3be56f+=';'+_0x28705a;var _0x117ba6=null;if(_0x87c04d['item_types']){if(!_[_0x190b('0x50')](_0x87c04d[_0x190b('0xc5')][_0x1f67b5])){var _0x640943=_[_0x190b('0x40')](_0x1d126c,function(_0x230fd2){return _0x230fd2['id']===_0x87c04d[_0x190b('0xc5')][_0x1f67b5];});if(!_[_0x190b('0x50')](_0x640943)){_0x117ba6=_0x640943[_0x190b('0xc4')];}}}else{if(!_[_0x190b('0x50')](_0x87c04d[_0x190b('0xc6')][_0x1f67b5])){var _0x640943=_['find'](_0x1d126c,function(_0x280e16){return _0x280e16['id']===_0x87c04d[_0x190b('0xc6')][_0x1f67b5][_0x190b('0xc7')];});if(!_[_0x190b('0x50')](_0x640943)){_0x117ba6=_0x1f67b5;}}}if(_[_0x190b('0x50')](_0x117ba6)){_0x117ba6=0x64;}_0x498246['push'](addAdditionalPhone(_0x87c04d['id'],_0x87c04d[_0x190b('0xc6')][_0x1f67b5][_0x190b('0xbe')],_0x87c04d['item_types']?_[_0x190b('0x50')](_0x87c04d['item_types'][_0x1f67b5])?null:_0x87c04d[_0x190b('0xc5')][_0x1f67b5]:_0x87c04d[_0x190b('0xc6')][_0x1f67b5][_0x190b('0xc7')]?_0x87c04d[_0x190b('0xc6')][_0x1f67b5][_0x190b('0xc7')]:null,_0x117ba6,_0x418e7b));}Promise[_0x190b('0xb0')](_0x498246)[_0x190b('0x17')](function(){db['CmContact']['update']({'AdditionalPhones':_0x3be56f},{'where':{'id':_0x87c04d['id']}})['then'](function(){_0x3555bb(0x1);});});});});});}function addAdditionalPhone(_0x1932be,_0x261e75,_0x43a517,_0x5ce850,_0x37f119){return db[_0x190b('0x9b')][_0x190b('0x40')]({'where':{'CmContactId':_0x1932be,'item':_0x261e75}})[_0x190b('0x17')](function(_0x1122a3){if(_0x1122a3)logger['info'](_0x190b('0xc9'),_0x1122a3);else{db[_0x190b('0x9b')][_0x190b('0x94')]({'CmContactId':_0x1932be,'item':_0x261e75,'ItemTypeId':_0x43a517,'OrderBy':_0x5ce850,'ItemClass':_0x190b('0xca'),'description':_0x37f119});}});}function deletePhones(_0x1ab440){return db['CmContactHasItem'][_0x190b('0x18')]({'where':{'CmContactId':_0x1ab440}});}function deleteCmHopperPhones(_0x2beb16){return new Promise(function(_0xcf4a43,_0x1fc4a0){return db[_0x190b('0x90')][_0x190b('0x86')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x2beb16}})['then'](function(_0x5b721b){db[_0x190b('0xcb')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x190b('0x42')](_0x5b721b,'id')}}});})[_0x190b('0x17')](function(){_0xcf4a43(0x1);});});}function addCmHopperPhones(_0x1efae0){return new Promise(function(_0x4fa37d,_0x3fb69d){return db[_0x190b('0x90')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1efae0}})['then'](function(_0x1e52d0){var _0x139b9c=[];_[_0x190b('0x42')](_0x1e52d0,function(_0x3629e4){_0x139b9c[_0x190b('0x23')](createCmHopperPhone(_0x1efae0,_0x3629e4['id']));});Promise[_0x190b('0xb0')](_0x139b9c)[_0x190b('0x17')](function(){_0x4fa37d(0x1);});});});}function createCmHopperPhone(_0xf43e72,_0x96fdc5){return new Promise(function(_0x396a50,_0x591b12){db['CmContactHasItem']['findAll']({'raw':!![],'attributes':[_0x190b('0xcc'),_0x190b('0xc4')],'where':{'CmContactId':_0xf43e72,'ItemClass':_0x190b('0xca')},'include':[{'model':db[_0x190b('0xb3')],'attributes':[_0x190b('0xc4')],'as':_0x190b('0xb4')}],'order':[_0x190b('0xc4'),db['sequelize'][_0x190b('0xb5')](_0x190b('0xcd'))]})['then'](function(_0x5e1ae4){var _0x4fe180=0x1;var _0xfa8a4b=_[_0x190b('0x42')](_0x5e1ae4,function(_0x12a0eb){_0x12a0eb['CmHopperId']=_0x96fdc5;_0x12a0eb[_0x190b('0xbe')]=_0x12a0eb[_0x190b('0xcc')];_0x12a0eb[_0x190b('0xc4')]=_0x4fe180;delete _0x12a0eb[_0x190b('0xce')];_0x4fe180=_0x4fe180+0x1;return _0x12a0eb;});return db[_0x190b('0xcb')][_0x190b('0xa9')](_0xfa8a4b,{});})[_0x190b('0x17')](function(){_0x396a50(0x1);});});}function insertAdditionalPhones(_0x289171,_0x4d39fe){return new Promise(function(_0x4fbfbc,_0x2781ea){var _0xf153a=[];for(var _0x192b29=0x0;_0x192b29<_0x4d39fe[_0x190b('0x21')];_0x192b29++){var _0x4a6ddc=_0x4d39fe[_0x192b29];_0xf153a[_0x190b('0x23')](parseContactItemType(_0x4a6ddc));}Promise[_0x190b('0xb0')](_0xf153a)[_0x190b('0x17')](function(){var _0x4ccbf4={'id':_0x289171['id'],'items':_0x4d39fe};return addAdditionalPhones(_0x4ccbf4)[_0x190b('0x17')](function(_0x3a4ea1){return addCmHopperPhones(_0x289171['id']);});})[_0x190b('0x17')](function(){_0x4fbfbc(_0x289171);});});}function parseContactItemType(_0x3ec0a1){return new Promise(function(_0x1599dc,_0x44e3b2){if(_0x3ec0a1[_0x190b('0x2e')](_0x190b('0xc7'))){_0x1599dc(_0x3ec0a1);}else{return db[_0x190b('0xb3')][_0x190b('0x40')]({'where':{'name':_0x3ec0a1[_0x190b('0xb4')]}})[_0x190b('0x17')](function(_0x328c37){if(_[_0x190b('0x50')](_0x328c37))_0x3ec0a1[_0x190b('0xc7')]=null;else _0x3ec0a1[_0x190b('0xc7')]=_0x328c37['id'];_0x1599dc(_0x3ec0a1);});}});}exports[_0x190b('0xcf')]=function(_0x24820c,_0x2f03f3){return db[_0x190b('0x9b')][_0x190b('0x86')]({'raw':!![],'where':{'CmContactId':_0x24820c[_0x190b('0x80')]['id'],'ItemClass':_0x190b('0xca')},'include':[{'model':db[_0x190b('0xb3')],'as':'ItemType'}],'order':[[_0x190b('0xc4')],[db[_0x190b('0x6d')]['literal'](_0x190b('0xcd'))]]})[_0x190b('0x17')](function(_0x5d0880){return _0x5d0880;})[_0x190b('0x17')](respondWithResult(_0x2f03f3,null))[_0x190b('0x7f')](handleError(_0x2f03f3,null));};exports[_0x190b('0xd0')]=function(_0x5df6ec,_0x189434){return db[_0x190b('0x9b')][_0x190b('0x86')]({'raw':!![],'where':{'CmContactId':_0x5df6ec['body']['fromContactId']}})['then'](function(_0x2122d0){var _0x48bf97=_[_0x190b('0x42')](_0x2122d0,function(_0x3a268a){_0x3a268a[_0x190b('0xd1')]=_0x5df6ec['body']['toContactId'];return _0x3a268a;});return db['CmContactHasItem'][_0x190b('0xa9')](_0x48bf97,{});})[_0x190b('0x17')](function(_0x4b8f38){return addCmHopperPhones(_0x5df6ec['body'][_0x190b('0xd2')]);})[_0x190b('0x17')](function(_0x30c457){return['ok'];})[_0x190b('0x17')](respondWithResult(_0x189434,null))[_0x190b('0x7f')](handleError(_0x189434,null));};exports['rescheduleAdditionalPhones']=function(_0x23803a,_0x3038e6){var _0x71bb02=[];_0x71bb02[_0x190b('0x23')](createCmHopperPhone(_0x23803a[_0x190b('0x8a')]['id'],_0x23803a[_0x190b('0x8a')][_0x190b('0xd3')]));Promise[_0x190b('0xb0')](_0x71bb02)[_0x190b('0x17')](function(){return[0x1];})['then'](respondWithResult(_0x3038e6,null));};exports[_0x190b('0xd4')]=function(_0x26ee7d,_0x126929){var _0x5777ae={'raw':![],'where':{}};var _0x4ef145={};var _0x3eb66e={'count':0x0,'rows':[]};return db[_0x190b('0x71')][_0x190b('0x25')]({'where':{'id':_0x26ee7d[_0x190b('0x80')]['id']}})['then'](handleEntityNotFound(_0x126929,null))[_0x190b('0x17')](function(_0x2cf508){if(_0x2cf508){_0x4ef145['model']=_[_0x190b('0x20')](db['CmHopper'][_0x190b('0xc0')]);_0x4ef145[_0x190b('0x2a')]=_[_0x190b('0x20')](_0x26ee7d[_0x190b('0x2a')]);_0x4ef145[_0x190b('0x2b')]=_['intersection'](_0x4ef145[_0x190b('0x29')],_0x4ef145[_0x190b('0x2a')]);_0x5777ae['attributes']=_['intersection'](_0x4ef145['model'],qs[_0x190b('0x72')](_0x26ee7d[_0x190b('0x2a')][_0x190b('0x72')]));_0x5777ae['attributes']=_0x5777ae['attributes'][_0x190b('0x21')]?_0x5777ae[_0x190b('0x2d')]:_0x4ef145['model'];if(!_0x26ee7d[_0x190b('0x2a')]['hasOwnProperty'](_0x190b('0x2f'))){_0x5777ae[_0x190b('0x10')]=qs['limit'](_0x26ee7d['query'][_0x190b('0x10')]);_0x5777ae[_0x190b('0xf')]=qs['offset'](_0x26ee7d['query']['offset']);}_0x5777ae['order']=qs[_0x190b('0x30')](_0x26ee7d[_0x190b('0x2a')]['sort']);_0x5777ae[_0x190b('0x31')]=qs['filters'](_[_0x190b('0x32')](_0x26ee7d[_0x190b('0x2a')],_0x4ef145['filters']));_0x5777ae[_0x190b('0x31')][_0x190b('0xd5')]=_0x2cf508['id'];if(_0x26ee7d['query']['filter']){_0x5777ae[_0x190b('0x31')]=_[_0x190b('0x70')](_0x5777ae[_0x190b('0x31')],{'$or':_['map'](_0x5777ae[_0x190b('0x2d')],function(_0x9ffbe){var _0x50cccd={};_0x50cccd[_0x9ffbe]={'$like':'%'+_0x26ee7d[_0x190b('0x2a')][_0x190b('0x4f')]+'%'};return _0x50cccd;})});}_0x5777ae=_[_0x190b('0x70')]({},_0x5777ae,_0x26ee7d['options']);return db['CmHopper'][_0x190b('0x12')]({'where':_0x5777ae['where']})[_0x190b('0x17')](function(_0xdeafda){_0x3eb66e[_0x190b('0x12')]=_0xdeafda;if(_0x26ee7d[_0x190b('0x2a')][_0x190b('0xd6')]){_0x5777ae[_0x190b('0xd7')]=[{'all':!![]}];}return db[_0x190b('0x90')][_0x190b('0x86')](_0x5777ae);})[_0x190b('0x17')](function(_0x593fc2){_0x3eb66e[_0x190b('0x7e')]=_0x593fc2;return _0x3eb66e;});}})[_0x190b('0x17')](respondWithFilteredResult(_0x126929,_0x5777ae))[_0x190b('0x7f')](handleError(_0x126929,null));};exports[_0x190b('0xd8')]=function(_0x3475e9,_0x2d6fe3){var _0x5d4ec0={'raw':!![],'where':{}};var _0x54136c={};var _0x4b5680={'count':0x0,'rows':[]};return db[_0x190b('0x71')][_0x190b('0x25')]({'where':{'id':_0x3475e9[_0x190b('0x80')]['id']}})['then'](handleEntityNotFound(_0x2d6fe3,null))[_0x190b('0x17')](function(_0x3b19c7){if(_0x3b19c7){_0x54136c[_0x190b('0x29')]=_['keys'](db['CmHopperHistory'][_0x190b('0xc0')]);_0x54136c[_0x190b('0x2a')]=_['keys'](_0x3475e9[_0x190b('0x2a')]);_0x54136c['filters']=_[_0x190b('0x2c')](_0x54136c['model'],_0x54136c[_0x190b('0x2a')]);_0x5d4ec0[_0x190b('0x2d')]=_['intersection'](_0x54136c['model'],qs[_0x190b('0x72')](_0x3475e9['query']['fields']));_0x5d4ec0[_0x190b('0x2d')]=_0x5d4ec0[_0x190b('0x2d')][_0x190b('0x21')]?_0x5d4ec0[_0x190b('0x2d')]:_0x54136c[_0x190b('0x29')];if(!_0x3475e9[_0x190b('0x2a')][_0x190b('0x2e')]('nolimit')){_0x5d4ec0[_0x190b('0x10')]=qs[_0x190b('0x10')](_0x3475e9[_0x190b('0x2a')][_0x190b('0x10')]);_0x5d4ec0[_0x190b('0xf')]=qs['offset'](_0x3475e9[_0x190b('0x2a')][_0x190b('0xf')]);}_0x5d4ec0[_0x190b('0x64')]=qs['sort'](_0x3475e9['query']['sort']);_0x5d4ec0['where']=qs[_0x190b('0x2b')](_[_0x190b('0x32')](_0x3475e9[_0x190b('0x2a')],_0x54136c['filters']));_0x5d4ec0[_0x190b('0x31')][_0x190b('0xd5')]=_0x3b19c7['id'];if(_0x3475e9['query'][_0x190b('0x4f')]){_0x5d4ec0[_0x190b('0x31')]=_[_0x190b('0x70')](_0x5d4ec0[_0x190b('0x31')],{'$or':_[_0x190b('0x42')](_0x5d4ec0[_0x190b('0x2d')],function(_0x32eba5){var _0x2af40f={};_0x2af40f[_0x32eba5]={'$like':'%'+_0x3475e9[_0x190b('0x2a')][_0x190b('0x4f')]+'%'};return _0x2af40f;})});}_0x5d4ec0=_[_0x190b('0x70')]({},_0x5d4ec0,_0x3475e9[_0x190b('0xc1')]);return db['CmHopperHistory'][_0x190b('0x12')]({'where':_0x5d4ec0[_0x190b('0x31')]})[_0x190b('0x17')](function(_0x20a43b){_0x4b5680['count']=_0x20a43b;if(_0x3475e9[_0x190b('0x2a')][_0x190b('0xd6')]){_0x5d4ec0[_0x190b('0xd7')]=[{'all':!![]}];}return db[_0x190b('0x9d')][_0x190b('0x86')](_0x5d4ec0);})[_0x190b('0x17')](function(_0x2a4943){_0x4b5680[_0x190b('0x7e')]=_0x2a4943;return _0x4b5680;});}})['then'](respondWithFilteredResult(_0x2d6fe3,_0x5d4ec0))[_0x190b('0x7f')](handleError(_0x2d6fe3,null));};exports[_0x190b('0xd9')]=function(_0x4cbbcd,_0x3dbd36){var _0x11be1c={'raw':!![],'where':{}};var _0x1717f0={};var _0x365950={'count':0x0,'rows':[]};return db['CmContact'][_0x190b('0x25')]({'where':{'id':_0x4cbbcd[_0x190b('0x80')]['id']}})[_0x190b('0x17')](handleEntityNotFound(_0x3dbd36,null))[_0x190b('0x17')](function(_0x53378a){if(_0x53378a){_0x1717f0[_0x190b('0x29')]=_[_0x190b('0x20')](db[_0x190b('0x9c')][_0x190b('0xc0')]);_0x1717f0[_0x190b('0x2a')]=_[_0x190b('0x20')](_0x4cbbcd['query']);_0x1717f0['filters']=_[_0x190b('0x2c')](_0x1717f0[_0x190b('0x29')],_0x1717f0[_0x190b('0x2a')]);_0x11be1c[_0x190b('0x2d')]=_[_0x190b('0x2c')](_0x1717f0[_0x190b('0x29')],qs[_0x190b('0x72')](_0x4cbbcd['query']['fields']));_0x11be1c[_0x190b('0x2d')]=_0x11be1c[_0x190b('0x2d')]['length']?_0x11be1c['attributes']:_0x1717f0[_0x190b('0x29')];if(!_0x4cbbcd[_0x190b('0x2a')][_0x190b('0x2e')](_0x190b('0x2f'))){_0x11be1c[_0x190b('0x10')]=qs[_0x190b('0x10')](_0x4cbbcd['query']['limit']);_0x11be1c[_0x190b('0xf')]=qs['offset'](_0x4cbbcd[_0x190b('0x2a')]['offset']);}_0x11be1c[_0x190b('0x64')]=qs['sort'](_0x4cbbcd[_0x190b('0x2a')][_0x190b('0x30')]);_0x11be1c[_0x190b('0x31')]=qs[_0x190b('0x2b')](_[_0x190b('0x32')](_0x4cbbcd['query'],_0x1717f0[_0x190b('0x2b')]));_0x11be1c['where']['ContactId']=_0x53378a['id'];if(_0x4cbbcd[_0x190b('0x2a')][_0x190b('0x4f')]){_0x11be1c[_0x190b('0x31')]=_[_0x190b('0x70')](_0x11be1c[_0x190b('0x31')],{'$or':_[_0x190b('0x42')](_0x11be1c[_0x190b('0x2d')],function(_0x521e64){var _0xb493e5={};_0xb493e5[_0x521e64]={'$like':'%'+_0x4cbbcd[_0x190b('0x2a')][_0x190b('0x4f')]+'%'};return _0xb493e5;})});}_0x11be1c=_[_0x190b('0x70')]({},_0x11be1c,_0x4cbbcd['options']);return db[_0x190b('0x9c')][_0x190b('0x12')]({'where':_0x11be1c[_0x190b('0x31')]})['then'](function(_0x15e9fb){_0x365950[_0x190b('0x12')]=_0x15e9fb;if(_0x4cbbcd['query'][_0x190b('0xd6')]){_0x11be1c[_0x190b('0xd7')]=[{'all':!![]}];}return db[_0x190b('0x9c')]['findAll'](_0x11be1c);})['then'](function(_0x1452b8){_0x365950[_0x190b('0x7e')]=_0x1452b8;return _0x365950;});}})[_0x190b('0x17')](respondWithFilteredResult(_0x3dbd36,_0x11be1c))[_0x190b('0x7f')](handleError(_0x3dbd36,null));};exports[_0x190b('0xda')]=function(_0x2b0642,_0x26415a){var _0x3466a8={'raw':!![],'where':{}};var _0x1dfb7c={};var _0x52668d={'count':0x0,'rows':[]};return db[_0x190b('0x71')][_0x190b('0x25')]({'where':{'id':_0x2b0642['params']['id']}})['then'](handleEntityNotFound(_0x26415a,null))[_0x190b('0x17')](function(_0x392cd0){if(_0x392cd0){_0x1dfb7c['model']=_[_0x190b('0x20')](db['JscriptySessionReport'][_0x190b('0xc0')]);_0x1dfb7c['query']=_[_0x190b('0x20')](_0x2b0642['query']);_0x1dfb7c['filters']=_[_0x190b('0x2c')](_0x1dfb7c[_0x190b('0x29')],_0x1dfb7c[_0x190b('0x2a')]);_0x3466a8['attributes']=_[_0x190b('0x2c')](_0x1dfb7c[_0x190b('0x29')],qs[_0x190b('0x72')](_0x2b0642[_0x190b('0x2a')]['fields']));_0x3466a8[_0x190b('0x2d')]=_0x3466a8[_0x190b('0x2d')][_0x190b('0x21')]?_0x3466a8[_0x190b('0x2d')]:_0x1dfb7c[_0x190b('0x29')];if(!_0x2b0642[_0x190b('0x2a')]['hasOwnProperty']('nolimit')){_0x3466a8[_0x190b('0x10')]=qs[_0x190b('0x10')](_0x2b0642[_0x190b('0x2a')][_0x190b('0x10')]);_0x3466a8[_0x190b('0xf')]=qs[_0x190b('0xf')](_0x2b0642[_0x190b('0x2a')][_0x190b('0xf')]);}_0x3466a8[_0x190b('0x64')]=qs[_0x190b('0x30')](_0x2b0642[_0x190b('0x2a')][_0x190b('0x30')]);_0x3466a8[_0x190b('0x31')]=qs[_0x190b('0x2b')](_[_0x190b('0x32')](_0x2b0642['query'],_0x1dfb7c[_0x190b('0x2b')]));_0x3466a8[_0x190b('0x31')][_0x190b('0xd5')]=_0x392cd0['id'];if(_0x2b0642['query'][_0x190b('0x4f')]){_0x3466a8['where']=_[_0x190b('0x70')](_0x3466a8['where'],{'$or':_[_0x190b('0x42')](_0x3466a8[_0x190b('0x2d')],function(_0x504585){var _0x216167={};_0x216167[_0x504585]={'$like':'%'+_0x2b0642[_0x190b('0x2a')]['filter']+'%'};return _0x216167;})});}_0x3466a8=_[_0x190b('0x70')]({},_0x3466a8,_0x2b0642['options']);return db[_0x190b('0xa3')][_0x190b('0x12')]({'where':_0x3466a8['where']})[_0x190b('0x17')](function(_0x241bb1){_0x52668d[_0x190b('0x12')]=_0x241bb1;if(_0x2b0642[_0x190b('0x2a')][_0x190b('0xd6')]){_0x3466a8['include']=[{'all':!![]}];}return db[_0x190b('0xa3')][_0x190b('0x86')](_0x3466a8);})[_0x190b('0x17')](function(_0x184a58){_0x52668d[_0x190b('0x7e')]=_0x184a58;return _0x52668d;});}})[_0x190b('0x17')](respondWithFilteredResult(_0x26415a,_0x3466a8))[_0x190b('0x7f')](handleError(_0x26415a,null));};exports[_0x190b('0xdb')]=function(_0x655834,_0x4d4d8b){try{if(!_0x655834['body']['ListId']){throw new Error(_0x190b('0xdc'));}if(!_0x655834['body'][_0x190b('0xdd')]){throw new Error(_0x190b('0xde'));}if(!_0x655834[_0x190b('0x8a')][_0x190b('0xdf')]){throw new Error(_0x190b('0xe0'));}if(!_0x655834[_0x190b('0x8a')][_0x190b('0xe1')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x58ef64=_0x655834['body'][_0x190b('0xdd')][_0x190b('0x7d')](',');var _0x473d79=_0x655834[_0x190b('0x8a')][_0x190b('0xdf')][_0x190b('0x7d')](',');if(!_0x58ef64[_0x190b('0x21')]||!_0x473d79[_0x190b('0x21')]||_0x58ef64[_0x190b('0x21')]!==_0x473d79[_0x190b('0x21')]){throw new Error(_0x190b('0xe2'));}_0x655834[_0x190b('0x8a')]['fields']=_[_0x190b('0xe3')](_0x58ef64,_0x473d79);if(!_0x655834[_0x190b('0x8a')][_0x190b('0x72')][_0x190b('0xbe')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x655834['body'][_0x190b('0x72')][_0x190b('0xe4')]){throw new Error('No\x20firstName\x20column\x20specified');}var _0xe54130=path[_0x190b('0x8e')](config[_0x190b('0xe5')],_0x190b('0xe6'),_0x655834[_0x190b('0xe7')]['filename']);fs[_0x190b('0xe8')](_0xe54130,parseInt(_0x190b('0xe9'),0x8));var _0xac63ed=require(_0x190b('0xea'))[_0x190b('0xeb')](path[_0x190b('0x8e')](__dirname,_0x190b('0xec')),[_0xe54130,_0x655834[_0x190b('0x8a')][_0x190b('0xdd')],_0x655834[_0x190b('0x8a')][_0x190b('0xdf')],_0x655834[_0x190b('0x8a')]['ListId'],_0x655834[_0x190b('0x8a')]['CompanyId'],_0x655834[_0x190b('0x8a')]['duplicates'],_0x655834['body'][_0x190b('0xe1')]]);return _0x4d4d8b[_0x190b('0xe')](0xc8)[_0x190b('0x15')]({'message':_0x190b('0xed'),'pid':_0xac63ed[_0x190b('0xee')]});}catch(_0x445eef){return _0x4d4d8b[_0x190b('0xe')](0x1f4)[_0x190b('0x1e')](_0x445eef);}};exports[_0x190b('0xef')]=function(_0x3db0eb,_0x2ec77d){var _0x600f27=fs['createReadStream'](_0x3db0eb[_0x190b('0xe7')][_0x190b('0x2')]);Papa[_0x190b('0xf0')](_0x600f27,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x353c5){return _0x2ec77d[_0x190b('0xe')](0xc8)[_0x190b('0x15')]({'file':_0x3db0eb['file'],'fields':_0x353c5[_0x190b('0xf1')][_0x190b('0x72')]});}});};exports[_0x190b('0xf2')]=function(_0x3a6470,_0x15a98e){return db[_0x190b('0x46')][_0x190b('0x86')]({'raw':!![],'attributes':['id'],'where':{'role':_0x190b('0x68')}})[_0x190b('0x17')](function(_0x2b0640){var _0x15376f=![];if(!_0x3a6470[_0x190b('0x8a')][_0x190b('0x6c')]){throw new Error('No\x20ListId\x20specified');}if(!_0x3a6470[_0x190b('0x8a')]['binding'][_0x190b('0xbe')]){throw new Error(_0x190b('0xf3'));}if(!_0x3a6470[_0x190b('0x8a')][_0x190b('0xf4')][_0x190b('0xe4')]){throw new Error(_0x190b('0xf5'));}if(!_0x3a6470[_0x190b('0x8a')][_0x190b('0xe1')]){throw new Error(_0x190b('0xf6'));}var _0x427dee=require(_0x190b('0xea'))[_0x190b('0xeb')](path[_0x190b('0x8e')](__dirname,'../../components/import/cm/csv2'),[_0x3a6470['params']['id'],JSON[_0x190b('0xf7')](_0x3a6470[_0x190b('0x8a')]),JSON['stringify'](_0x2b0640)]);_0x427dee['on'](_0x190b('0xf8'),function(){_0x15376f=!![];return _0x15a98e[_0x190b('0xe')](0xc8)[_0x190b('0x15')]({'message':_0x190b('0xf9'),'pid':_0x427dee[_0x190b('0xee')]});});_0x427dee['on'](_0x190b('0xfa'),function(_0x4f9673){if(_0x4f9673&&!_0x15376f){return _0x15a98e[_0x190b('0xe')](0x1f4)[_0x190b('0x15')]({'message':_0x190b('0xfb'),'pid':_0x427dee['pid']});}});})[_0x190b('0x7f')](handleError(_0x15a98e,null));};exports['importUpdates']=function(_0x4e62d5,_0x4ee3bf,_0x2f02ab){return db[_0x190b('0x46')][_0x190b('0x86')]({'raw':!![],'attributes':['id'],'where':{'role':_0x190b('0x68')}})[_0x190b('0x17')](function(_0x490de6){var _0x4a1ba7=![];if(!_0x4e62d5['body']['ListId']){throw new Error(_0x190b('0xdc'));}if(!_0x4e62d5[_0x190b('0x8a')]['binding'][_0x190b('0xbe')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x4e62d5['body']['binding']['firstName']){throw new Error(_0x190b('0xf5'));}if(!_0x4e62d5['body']['socket_timestamp']){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x115eeb=require('child_process')['fork'](path[_0x190b('0x8e')](__dirname,'../../components/import/cm/csvUpdates'),[_0x4e62d5['params']['id'],JSON[_0x190b('0xf7')](_0x4e62d5[_0x190b('0x8a')]),JSON[_0x190b('0xf7')](_0x490de6)]);_0x115eeb['on'](_0x190b('0xf8'),function(_0xa1a3af){_0x4a1ba7=!![];return _0x4ee3bf[_0x190b('0xe')](0xc8)[_0x190b('0x15')]({'message':_0x190b('0xf9'),'pid':_0x115eeb[_0x190b('0xee')]});});_0x115eeb['on'](_0x190b('0xfa'),function(_0x5a025b){if(_0x5a025b&&!_0x4a1ba7){return _0x4ee3bf[_0x190b('0xe')](0x1f4)[_0x190b('0x15')]({'message':'error\x20child\x20process','pid':_0x115eeb['pid']});}});})[_0x190b('0x7f')](handleError(_0x4ee3bf,null));};exports[_0x190b('0xfc')]=function(_0x99b506,_0x16c634){var _0x988c4e=[_0x190b('0xfd'),_0x190b('0xfe'),_0x190b('0xff'),'openchannel',_0x190b('0x100'),_0x190b('0x101'),_0x190b('0x102')];var _0x18b85b={'offset':0x0,'order':qs[_0x190b('0x30')]('-createdAt')},_0x26cbea={'count':0x0,'rows':[]};Promise[_0x190b('0x66')]()['then'](function(){if(_0x99b506['query'][_0x190b('0x103')]){if(!_[_0x190b('0x104')](_0x988c4e,_0x99b506['query'][_0x190b('0x103')][_0x190b('0x105')]())){throw new Error(_0x190b('0x106'));}_0x988c4e=[_0x99b506[_0x190b('0x2a')][_0x190b('0x103')][_0x190b('0x105')]()];}if(_0x99b506[_0x190b('0x2a')][_0x190b('0x107')]){try{var _0x1655f7=JSON[_0x190b('0xf0')](_0x99b506[_0x190b('0x2a')]['range']);if(!moment(_0x1655f7[_0x190b('0x35')])[_0x190b('0x108')]()){throw new Error(_0x190b('0x109'));}if(!moment(_0x1655f7['to'])[_0x190b('0x108')]()){throw new Error(_0x190b('0x10a'));}}catch(_0x1d68a2){throw new Error(_0x190b('0x10b'));}}if(!_0x99b506[_0x190b('0x2a')][_0x190b('0x2e')]('nolimit')){_0x18b85b[_0x190b('0x10')]=qs[_0x190b('0x10')](_0x99b506[_0x190b('0x2a')][_0x190b('0x10')]||0xa);_0x18b85b[_0x190b('0xf')]=qs[_0x190b('0xf')](_0x99b506['query'][_0x190b('0xf')]);}var _0xb15f00=_0x988c4e[_0x190b('0x42')](function(_0x5ac0a7){if(_0x5ac0a7===_0x190b('0x102')){var _0x56fb2f={'attributes':['id','uniqueid','type',_0x190b('0x10c'),'destination',_0x190b('0x10d'),_0x190b('0x10e'),_0x190b('0x10f'),_0x190b('0x110'),_0x190b('0x111'),_0x190b('0x112'),_0x190b('0x113'),_0x190b('0x114'),_0x190b('0x115'),'UserId'],'where':{'ContactId':_0x99b506[_0x190b('0x80')]['id']},'include':[{'model':db['User'],'as':'User','attributes':['id','name',_0x190b('0x116'),_0x190b('0x87')]}],'order':[['createdAt',_0x190b('0x117')]]};if(_0x99b506['query'][_0x190b('0x107')]){_0x56fb2f[_0x190b('0x31')][_0x190b('0x112')]={'$gte':_0x1655f7[_0x190b('0x35')],'$lte':_0x1655f7['to']};}return db[_0x190b('0x118')]['findAndCountAll'](_0x56fb2f)[_0x190b('0x17')](function(_0x4499a8){_0x26cbea[_0x190b('0x12')]+=_0x4499a8[_0x190b('0x12')];return _[_0x190b('0x42')](_0x4499a8[_0x190b('0x7e')],function(_0x40b156){var _0x56d11b=_0x40b156['get']({'plain':!![]});_0x56d11b['channel']=_0x5ac0a7;if(_0x56d11b[_0x190b('0x46')]){_0x56d11b[_0x190b('0x46')]={'id':_0x56d11b[_0x190b('0x46')]['id'],'name':_0x56d11b[_0x190b('0x46')][_0x190b('0x1d')],'fullname':_0x56d11b[_0x190b('0x46')]['fullname'],'alias':_0x56d11b[_0x190b('0x46')][_0x190b('0x87')]};}return _0x56d11b;});});}else{var _0x87d2f4=_[_0x190b('0x119')](_0x5ac0a7)+(_0x5ac0a7===_0x190b('0xfe')?'Website':_0x190b('0x11a'));var _0x3a3033={'attributes':['id',_0x190b('0x11b'),_0x190b('0x11c'),_0x190b('0x112'),_0x190b('0x111'),_0x190b('0x11d'),'secondDisposition','thirdDisposition',_0x190b('0x11e'),_0x87d2f4+'Id'],'where':{'ContactId':_0x99b506['params']['id']},'include':[{'model':db[_0x87d2f4],'as':'Account','attributes':['id','name',_0x190b('0x11f')]},{'model':db[_0x190b('0x46')],'as':_0x190b('0x120'),'attributes':['id',_0x190b('0x1d'),_0x190b('0x116')]},{'model':db[_0x190b('0x41')],'as':_0x190b('0x121'),'attributes':['id',_0x190b('0x1d'),'color'],'through':{'attributes':[]}}],'order':[[_0x190b('0x112'),_0x190b('0x117')]]};if(_0x99b506[_0x190b('0x2a')]['range']){_0x3a3033[_0x190b('0x31')][_0x190b('0x112')]={'$gte':_0x1655f7['from'],'$lte':_0x1655f7['to']};}switch(_0x5ac0a7){case _0x190b('0xfe'):_0x3a3033[_0x190b('0x2d')][_0x190b('0x23')](_0x190b('0x122'),_0x190b('0x123'),_0x190b('0x124'),_0x190b('0x125'),_0x190b('0x126'),'ratingMessage',_0x190b('0x127'),_0x190b('0x128'),_0x190b('0x129'));break;case _0x190b('0xfd'):_0x3a3033['attributes'][_0x190b('0x23')](_0x190b('0x12a'),'substatus');break;case'openchannel':_0x3a3033[_0x190b('0x2d')][_0x190b('0x23')](_0x190b('0x12b'),'threadId');break;}return db[_[_0x190b('0x119')](_0x5ac0a7)+_0x190b('0x12c')][_0x190b('0x12d')](_0x3a3033)[_0x190b('0x17')](function(_0x2308cb){_0x26cbea['count']+=_0x2308cb['count'];return _['map'](_0x2308cb[_0x190b('0x7e')],function(_0x407f72){var _0x3bf570=_0x407f72[_0x190b('0x8b')]({'plain':!![]});_0x3bf570[_0x190b('0x103')]=_0x5ac0a7;if(_0x3bf570[_0x190b('0x120')]){_0x3bf570[_0x190b('0x120')]={'id':_0x3bf570['Owner']['id'],'name':_0x3bf570[_0x190b('0x120')][_0x190b('0x1d')],'fullname':_0x3bf570['Owner']['fullname']};}return _0x3bf570;});});}});return Promise[_0x190b('0xb0')](_0xb15f00);})['then'](function(_0x9be7e5){return _(_0x9be7e5)[_0x190b('0x12e')]()['sortBy'](_0x190b('0x112'))['reverse']()[_0x190b('0x49')]();})['then'](function(_0x235c02){_0x26cbea[_0x190b('0x7e')]=_0x18b85b['limit']?_0x235c02['slice'](_0x18b85b[_0x190b('0xf')],_0x18b85b[_0x190b('0xf')]+_0x18b85b['limit']):_0x235c02;return _0x26cbea;})[_0x190b('0x17')](respondWithFilteredResult(_0x16c634,_0x18b85b))[_0x190b('0x7f')](handleError(_0x16c634,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 6d5d346..4605238 100644 --- a/server/api/cmContact/cmContact.events.js +++ b/server/api/cmContact/cmContact.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1435=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','CmContact','setMaxListeners','save','update'];(function(_0x1ced8e,_0x133367){var _0x47f872=function(_0x41c664){while(--_0x41c664){_0x1ced8e['push'](_0x1ced8e['shift']());}};_0x47f872(++_0x133367);}(_0x1435,0x1da));var _0x5143=function(_0x2edeff,_0x37ca57){_0x2edeff=_0x2edeff-0x0;var _0x415216=_0x1435[_0x2edeff];return _0x415216;};'use strict';var EventEmitter=require(_0x5143('0x0'));var CmContact=require(_0x5143('0x1'))['db'][_0x5143('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x5143('0x3')](0x0);var events={'afterCreate':_0x5143('0x4'),'afterUpdate':_0x5143('0x5'),'afterDestroy':_0x5143('0x6')};function emitEvent(_0x5f5a73){return function(_0x57f2a5,_0x16426e,_0x149d7b){CmContactEvents['emit'](_0x5f5a73+':'+_0x57f2a5['id'],_0x57f2a5);CmContactEvents[_0x5143('0x7')](_0x5f5a73,_0x57f2a5);_0x149d7b(null);};}for(var e in events){if(events[_0x5143('0x8')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0x5143('0x9')]=CmContactEvents; \ No newline at end of file +var _0x1fb8=['save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','CmContact','setMaxListeners'];(function(_0x3c4f1f,_0x20d3ec){var _0x19cb69=function(_0x2e04bc){while(--_0x2e04bc){_0x3c4f1f['push'](_0x3c4f1f['shift']());}};_0x19cb69(++_0x20d3ec);}(_0x1fb8,0x1ac));var _0x81fb=function(_0x1cffe2,_0x5383e8){_0x1cffe2=_0x1cffe2-0x0;var _0x57030e=_0x1fb8[_0x1cffe2];return _0x57030e;};'use strict';var EventEmitter=require(_0x81fb('0x0'));var CmContact=require(_0x81fb('0x1'))['db'][_0x81fb('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x81fb('0x3')](0x0);var events={'afterCreate':_0x81fb('0x4'),'afterUpdate':'update','afterDestroy':_0x81fb('0x5')};function emitEvent(_0x61a5d5){return function(_0x45da9e,_0xb007f3,_0x345e94){CmContactEvents[_0x81fb('0x6')](_0x61a5d5+':'+_0x45da9e['id'],_0x45da9e);CmContactEvents[_0x81fb('0x6')](_0x61a5d5,_0x45da9e);_0x345e94(null);};}for(var e in events){if(events[_0x81fb('0x7')](e)){var event=events[e];CmContact[_0x81fb('0x8')](e,emitEvent(event));}}module['exports']=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 3b731f2..2e9d0ba 100644 --- a/server/api/cmContact/cmContact.model.js +++ b/server/api/cmContact/cmContact.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf5d0=['CmHopperFinal','cmContact,\x20afterCreate,\x20','create','priority','Campaign','timezones','minutes','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','dialCheckDuplicateType','CmList','Lists','length','always','onlyIfOpen','get','CmHopperBlack','cmContact,\x20%s,\x20%s','BlackLists','message','List\x20not\x20found','isEmpty','destroy','ContactId','VoiceQueueId','push','all','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','mobile','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','error','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','then','utcOffset','add','ret','CmHopper','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','ListId','callbackUniqueid','catch','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'];(function(_0x45e49a,_0x1626ee){var _0xe90476=function(_0xd20890){while(--_0xd20890){_0x45e49a['push'](_0x45e49a['shift']());}};_0xe90476(++_0x1626ee);}(_0xf5d0,0x154));var _0x0f5d=function(_0x490bb8,_0x578c73){_0x490bb8=_0x490bb8-0x0;var _0x51b34b=_0xf5d0[_0x490bb8];return _0x51b34b;};'use strict';var _=require(_0x0f5d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0f5d('0x1'));var moment=require(_0x0f5d('0x2'));var BPromise=require(_0x0f5d('0x3'));var rp=require(_0x0f5d('0x4'));var fs=require('fs');var path=require(_0x0f5d('0x5'));var rimraf=require(_0x0f5d('0x6'));var config=require(_0x0f5d('0x7'));var shared=require(_0x0f5d('0x8'));var attributes=require(_0x0f5d('0x9'));module[_0x0f5d('0xa')]=function(_0x4f3ca5,_0x1f591c){return _0x4f3ca5[_0x0f5d('0xb')](_0x0f5d('0xc'),attributes,{'tableName':_0x0f5d('0xd'),'paranoid':!![],'indexes':[{'name':_0x0f5d('0xe'),'fields':['phone']},{'name':_0x0f5d('0xf'),'fields':[_0x0f5d('0x10'),'lastName',_0x0f5d('0xe'),_0x0f5d('0x11'),'fax',_0x0f5d('0x12')],'type':_0x0f5d('0x13')}],'timestamps':!![],'charset':_0x0f5d('0x14'),'collate':_0x0f5d('0x15'),'hooks':{'afterCreate':function(_0x45c939,_0x10ed78,_0x4a49b6){var _0x475be4=_0x4f3ca5[_0x0f5d('0x16')];var _0x1e8c95=_0x45c939['get']({'plain':!![]});function _0x20827d(){return function(_0x20adea){logger[_0x0f5d('0x17')](_0x0f5d('0x18'),_0x0f5d('0x19'),util[_0x0f5d('0x1a')](_0x20adea,{'showHidden':![],'depth':null}));};}function _0x3b5971(_0x52f75c,_0x531659){var _0x2c6ca2=_0x531659[_0x0f5d('0x1b')]?_0x531659['scheduledat']:moment()[_0x0f5d('0x1c')](_0x0f5d('0x1d'));return new BPromise(function(_0xb39627,_0x4f6a4b){if(_[_0x0f5d('0x1e')](_0x531659[_0x0f5d('0x1f')])){_0xb39627({'ret':_0x2c6ca2});}else{_0x475be4[_0x0f5d('0x20')][_0x0f5d('0x21')]({'where':{'id':_0x52f75c['id']}})[_0x0f5d('0x22')](function(_0x41ccc1){if(!_['isNil'](_0x41ccc1)){var _0x3fbfa8=_0x41ccc1[_0x0f5d('0x1f')];if(!_[_0x0f5d('0x1e')](_0x3fbfa8)){var _0x394356=shared['timezones'];var _0x4134d6=_0x394356[_0x3fbfa8];var _0x1a598d=_0x394356[_0x531659[_0x0f5d('0x1f')]];if(!_[_0x0f5d('0x1e')](_0x4134d6)&&!_[_0x0f5d('0x1e')](_0x1a598d)){var _0x38ed11=_0x4134d6['utcOffset']-_0x1a598d[_0x0f5d('0x23')];_0x2c6ca2=_0x531659['scheduledat']?_0x531659[_0x0f5d('0x1b')]:moment();var _0x386692=moment(_0x2c6ca2)[_0x0f5d('0x24')](_0x38ed11,'minutes');_0xb39627({'ret':_0x386692['format'](_0x0f5d('0x1d'))});}else _0xb39627({'ret':_0x2c6ca2});}else _0xb39627({'ret':_0x2c6ca2});}else{_0xb39627({'ret':_0x2c6ca2});}});}});return 0xa;}var _0x5ea70c=function(_0x9e6a40){return new BPromise(function(_0x1b5503,_0x51df0f){_0x3b5971(_0x9e6a40,_0x1e8c95)[_0x0f5d('0x22')](function(_0x37d3e0){_0x1e8c95[_0x0f5d('0x1b')]=_0x37d3e0[_0x0f5d('0x25')];_0x475be4[_0x0f5d('0x26')][_0x0f5d('0x21')]({'where':{'phone':_0x1e8c95['phone'],'VoiceQueueId':_0x9e6a40['id']}})['then'](function(_0x391c53){if(!_[_0x0f5d('0x1e')](_0x391c53)){throw new Error('cmContact,\x20afterCreate\x20'+_0x1e8c95['phone']+_0x0f5d('0x27')+_0x9e6a40['id']);}return _0x475be4['CmHopper']['create']({'phone':_0x1e8c95[_0x0f5d('0xe')],'ContactId':_0x1e8c95['id'],'ListId':_0x1e8c95[_0x0f5d('0x28')],'priority':_0x1e8c95['priority']?_0x1e8c95['priority']:0x2,'scheduledat':_0x1e8c95[_0x0f5d('0x1b')]?_0x1e8c95[_0x0f5d('0x1b')]:moment()['format'](_0x0f5d('0x1d')),'callback':_0x1e8c95['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x1e8c95[_0x0f5d('0x29')]?_0x1e8c95[_0x0f5d('0x29')]:undefined,'callbackat':_0x1e8c95[_0x0f5d('0x29')]?moment()[_0x0f5d('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x9e6a40['id']});})[_0x0f5d('0x2a')](function(_0x235dc0){_0x51df0f(_0x235dc0);});});});};var _0x2d80fd=function(_0x4ad2fd){return new BPromise(function(_0xd15628,_0x234103){_0x3b5971(_0x4ad2fd,_0x1e8c95)['then'](function(_0x1e45d7){_0x1e8c95[_0x0f5d('0x1b')]=_0x1e45d7[_0x0f5d('0x25')];_0x475be4[_0x0f5d('0x26')][_0x0f5d('0x21')]({'where':{'phone':_0x1e8c95[_0x0f5d('0xe')],'VoiceQueueId':_0x4ad2fd['id']}})['then'](function(_0x5ef331){if(!_[_0x0f5d('0x1e')](_0x5ef331)){throw new Error(_0x0f5d('0x2b')+_0x1e8c95[_0x0f5d('0xe')]+_0x0f5d('0x2c')+_0x4ad2fd['id']);}return _0x475be4[_0x0f5d('0x2d')][_0x0f5d('0x21')]({'where':{'calleridnum':_0x1e8c95[_0x0f5d('0xe')],'VoiceQueueId':_0x4ad2fd['id']}});})[_0x0f5d('0x22')](function(_0xe7d868){if(!_[_0x0f5d('0x1e')](_0xe7d868)){throw new Error(_0x0f5d('0x2e')+_0x1e8c95['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x4ad2fd['id']);}return _0x475be4['CmHopper'][_0x0f5d('0x2f')]({'phone':_0x1e8c95[_0x0f5d('0xe')],'ContactId':_0x1e8c95['id'],'ListId':_0x1e8c95['ListId'],'priority':_0x1e8c95[_0x0f5d('0x30')]?_0x1e8c95['priority']:0x2,'scheduledat':_0x1e8c95[_0x0f5d('0x1b')]?_0x1e8c95['scheduledat']:moment()[_0x0f5d('0x1c')](_0x0f5d('0x1d')),'callback':_0x1e8c95[_0x0f5d('0x29')]?!![]:![],'callbackuniqueid':_0x1e8c95[_0x0f5d('0x29')]?_0x1e8c95['callbackUniqueid']:undefined,'callbackat':_0x1e8c95[_0x0f5d('0x29')]?moment()[_0x0f5d('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x4ad2fd['id']});})[_0x0f5d('0x2a')](function(_0x460dcc){_0x234103(_0x460dcc);});});});};function _0xa344da(){return function(_0x2f6b93){logger[_0x0f5d('0x17')](_0x0f5d('0x18'),'afterCreate',util[_0x0f5d('0x1a')](_0x2f6b93,{'showHidden':![],'depth':null}));};}function _0x391554(_0x332580,_0x3126f5){var _0x49dab2=_0x3126f5[_0x0f5d('0x1b')]?_0x3126f5[_0x0f5d('0x1b')]:moment()[_0x0f5d('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x578add,_0x754dd){if(_[_0x0f5d('0x1e')](_0x3126f5[_0x0f5d('0x1f')])){_0x578add({'ret':_0x49dab2});}else{_0x475be4[_0x0f5d('0x31')][_0x0f5d('0x21')]({'where':{'id':_0x332580['id']}})[_0x0f5d('0x22')](function(_0x41c075){if(!_[_0x0f5d('0x1e')](_0x41c075)){var _0x4e26cf=_0x41c075[_0x0f5d('0x1f')];if(!_[_0x0f5d('0x1e')](_0x4e26cf)){var _0x13c79e=shared[_0x0f5d('0x32')];var _0x33ed60=_0x13c79e[_0x4e26cf];var _0x4c1262=_0x13c79e[_0x3126f5[_0x0f5d('0x1f')]];if(!_[_0x0f5d('0x1e')](_0x33ed60)&&!_[_0x0f5d('0x1e')](_0x4c1262)){var _0x5d7090=_0x33ed60[_0x0f5d('0x23')]-_0x4c1262[_0x0f5d('0x23')];_0x49dab2=_0x3126f5[_0x0f5d('0x1b')]?_0x3126f5['scheduledat']:moment();var _0x1d51b4=moment(_0x49dab2)[_0x0f5d('0x24')](_0x5d7090,_0x0f5d('0x33'));_0x578add({'ret':_0x1d51b4['format'](_0x0f5d('0x1d'))});}else _0x578add({'ret':_0x49dab2});}else _0x578add({'ret':_0x49dab2});}else{_0x578add({'ret':_0x49dab2});}});}});return 0xa;}var _0x213b85=function(_0x4173da){return new BPromise(function(_0x4102ff,_0x50646a){_0x391554(_0x4173da,_0x1e8c95)[_0x0f5d('0x22')](function(_0x3fd9a0){_0x1e8c95[_0x0f5d('0x1b')]=_0x3fd9a0['ret'];_0x475be4[_0x0f5d('0x26')][_0x0f5d('0x21')]({'where':{'phone':_0x1e8c95[_0x0f5d('0xe')],'CampaignId':_0x4173da['id']}})[_0x0f5d('0x22')](function(_0x528ac0){if(!_[_0x0f5d('0x1e')](_0x528ac0)){throw new Error(_0x0f5d('0x2b')+_0x1e8c95['phone']+_0x0f5d('0x34')+_0x4173da['id']);}return _0x475be4[_0x0f5d('0x26')][_0x0f5d('0x2f')]({'phone':_0x1e8c95['phone'],'ContactId':_0x1e8c95['id'],'ListId':_0x1e8c95[_0x0f5d('0x28')],'priority':_0x1e8c95[_0x0f5d('0x30')]?_0x1e8c95[_0x0f5d('0x30')]:0x2,'scheduledat':_0x1e8c95[_0x0f5d('0x1b')]?_0x1e8c95[_0x0f5d('0x1b')]:moment()[_0x0f5d('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x1e8c95[_0x0f5d('0x29')]?!![]:![],'callbackuniqueid':_0x1e8c95[_0x0f5d('0x29')]?_0x1e8c95[_0x0f5d('0x29')]:undefined,'callbackat':_0x1e8c95[_0x0f5d('0x29')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x4173da['id']});})['catch'](function(_0xe368f1){_0x50646a(_0xe368f1);});});});};var _0x84d430=function(_0x438e97){return new BPromise(function(_0x47983b,_0x39d0e5){_0x391554(_0x438e97,_0x1e8c95)[_0x0f5d('0x22')](function(_0x478707){_0x1e8c95['scheduledat']=_0x478707[_0x0f5d('0x25')];_0x475be4[_0x0f5d('0x26')][_0x0f5d('0x21')]({'where':{'phone':_0x1e8c95[_0x0f5d('0xe')],'CampaignId':_0x438e97['id']}})[_0x0f5d('0x22')](function(_0xa9db49){if(!_[_0x0f5d('0x1e')](_0xa9db49)){throw new Error(_0x0f5d('0x2b')+_0x1e8c95[_0x0f5d('0xe')]+_0x0f5d('0x35')+_0x438e97['id']);}return _0x475be4[_0x0f5d('0x2d')][_0x0f5d('0x21')]({'where':{'calleridnum':_0x1e8c95['phone'],'CampaignId':_0x438e97['id']}});})[_0x0f5d('0x22')](function(_0x639389){if(!_[_0x0f5d('0x1e')](_0x639389)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x1e8c95[_0x0f5d('0xe')]+_0x0f5d('0x36')+_0x438e97['id']);}return _0x475be4[_0x0f5d('0x26')][_0x0f5d('0x2f')]({'phone':_0x1e8c95[_0x0f5d('0xe')],'ContactId':_0x1e8c95['id'],'ListId':_0x1e8c95[_0x0f5d('0x28')],'priority':_0x1e8c95[_0x0f5d('0x30')]?_0x1e8c95[_0x0f5d('0x30')]:0x2,'scheduledat':_0x1e8c95['scheduledat']?_0x1e8c95['scheduledat']:moment()[_0x0f5d('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x1e8c95[_0x0f5d('0x29')]?!![]:![],'callbackuniqueid':_0x1e8c95[_0x0f5d('0x29')]?_0x1e8c95[_0x0f5d('0x29')]:undefined,'callbackat':_0x1e8c95['callbackUniqueid']?moment()[_0x0f5d('0x1c')](_0x0f5d('0x1d')):undefined,'CampaignId':_0x438e97['id']});})[_0x0f5d('0x2a')](function(_0x2bf247){_0x39d0e5(_0x2bf247);});});});};if(_0x1e8c95[_0x0f5d('0x28')]){_0x475be4[_0x0f5d('0x20')][_0x0f5d('0x37')]({'where':{'type':_0x0f5d('0x38')},'attributes':['id',_0x0f5d('0x39'),_0x0f5d('0x1f')],'include':[{'model':_0x475be4[_0x0f5d('0x3a')],'as':_0x0f5d('0x3b'),'where':{'id':_0x1e8c95[_0x0f5d('0x28')]}}]})['then'](function(_0x662db3){if(_0x662db3){var _0x1ef260=[];for(var _0x168386=0x0,_0x409f87;_0x168386<_0x662db3[_0x0f5d('0x3c')];_0x168386+=0x1){_0x409f87=_0x662db3[_0x168386]['get']({'plain':!![]});switch(_0x409f87[_0x0f5d('0x39')]){case _0x0f5d('0x3d'):_0x2d80fd(_0x409f87)[_0x0f5d('0x2a')](_0x20827d());break;case _0x0f5d('0x3e'):_0x5ea70c(_0x409f87)[_0x0f5d('0x2a')](_0x20827d());break;default:_0x391554(_0x409f87,_0x1e8c95)[_0x0f5d('0x22')](function(_0x13fe8a){_0x1e8c95[_0x0f5d('0x1b')]=_0x13fe8a[_0x0f5d('0x25')];_0x475be4[_0x0f5d('0x26')][_0x0f5d('0x2f')]({'phone':_0x1e8c95[_0x0f5d('0xe')],'ContactId':_0x1e8c95['id'],'ListId':_0x1e8c95['ListId'],'scheduledat':_0x1e8c95[_0x0f5d('0x1b')]?_0x1e8c95['scheduledat']:moment()[_0x0f5d('0x1c')](_0x0f5d('0x1d')),'priority':_0x1e8c95[_0x0f5d('0x30')]?_0x1e8c95[_0x0f5d('0x30')]:0x2,'callback':_0x1e8c95[_0x0f5d('0x29')]?!![]:![],'callbackuniqueid':_0x1e8c95[_0x0f5d('0x29')]?_0x1e8c95[_0x0f5d('0x29')]:undefined,'callbackat':_0x1e8c95[_0x0f5d('0x29')]?moment()[_0x0f5d('0x1c')](_0x0f5d('0x1d')):undefined,'VoiceQueueId':_0x409f87['id']})['catch'](_0x20827d());});}}}})[_0x0f5d('0x22')](function(){return _0x475be4[_0x0f5d('0x20')][_0x0f5d('0x37')]({'where':{'type':_0x0f5d('0x38')},'attributes':['id'],'include':[{'model':_0x475be4['CmList'],'as':'BlackLists','where':{'id':_0x1e8c95[_0x0f5d('0x28')]}}]})[_0x0f5d('0x22')](function(_0x3fa53b){if(_0x3fa53b){var _0x456ea4=[];for(var _0xefe41d=0x0,_0x5d40fa;_0xefe41d<_0x3fa53b['length'];_0xefe41d+=0x1){_0x5d40fa=_0x3fa53b[_0xefe41d][_0x0f5d('0x3f')]({'plain':!![]});_0x475be4[_0x0f5d('0x40')]['create']({'phone':_0x1e8c95[_0x0f5d('0xe')],'ContactId':_0x1e8c95['id'],'ListId':_0x1e8c95['ListId'],'VoiceQueueId':_0x5d40fa['id']})[_0x0f5d('0x2a')](function(_0x18f15d){logger['error'](_0x0f5d('0x41'),_0x0f5d('0x19'),_0x18f15d['message']);});}}});})[_0x0f5d('0x22')](function(){return _0x475be4[_0x0f5d('0x31')][_0x0f5d('0x37')]({'attributes':['id','dialCheckDuplicateType',_0x0f5d('0x1f')],'include':[{'model':_0x475be4[_0x0f5d('0x3a')],'as':_0x0f5d('0x3b'),'where':{'id':_0x1e8c95['ListId']}}]})['then'](function(_0x287b18){if(_0x287b18){var _0x335d6b=[];for(var _0x189b46=0x0,_0x4c6084;_0x189b46<_0x287b18['length'];_0x189b46+=0x1){_0x4c6084=_0x287b18[_0x189b46]['get']({'plain':!![]});switch(_0x4c6084[_0x0f5d('0x39')]){case'always':_0x84d430(_0x4c6084)['catch'](_0xa344da());break;case _0x0f5d('0x3e'):_0x213b85(_0x4c6084)[_0x0f5d('0x2a')](_0xa344da());break;default:_0x475be4[_0x0f5d('0x26')][_0x0f5d('0x2f')]({'phone':_0x1e8c95[_0x0f5d('0xe')],'ContactId':_0x1e8c95['id'],'ListId':_0x1e8c95[_0x0f5d('0x28')],'scheduledat':_0x1e8c95['scheduledat']?_0x1e8c95[_0x0f5d('0x1b')]:moment()['format'](_0x0f5d('0x1d')),'priority':_0x1e8c95[_0x0f5d('0x30')]?_0x1e8c95['priority']:0x2,'callback':_0x1e8c95[_0x0f5d('0x29')]?!![]:![],'callbackuniqueid':_0x1e8c95[_0x0f5d('0x29')]?_0x1e8c95[_0x0f5d('0x29')]:undefined,'callbackat':_0x1e8c95[_0x0f5d('0x29')]?moment()[_0x0f5d('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x4c6084['id']})[_0x0f5d('0x2a')](_0xa344da());}}}});})['then'](function(){return _0x475be4['Campaign'][_0x0f5d('0x37')]({'attributes':['id'],'include':[{'model':_0x475be4['CmList'],'as':_0x0f5d('0x42'),'where':{'id':_0x1e8c95[_0x0f5d('0x28')]}}]})[_0x0f5d('0x22')](function(_0x353440){if(_0x353440){var _0x222d9a=[];for(var _0x406d85=0x0,_0x59386a;_0x406d85<_0x353440[_0x0f5d('0x3c')];_0x406d85+=0x1){_0x59386a=_0x353440[_0x406d85][_0x0f5d('0x3f')]({'plain':!![]});_0x475be4[_0x0f5d('0x40')][_0x0f5d('0x2f')]({'phone':_0x1e8c95[_0x0f5d('0xe')],'ContactId':_0x1e8c95['id'],'ListId':_0x1e8c95[_0x0f5d('0x28')],'CampaignId':_0x59386a['id']})['catch'](function(_0x4cffeb){logger[_0x0f5d('0x17')](_0x0f5d('0x41'),'afterCreate',_0x4cffeb[_0x0f5d('0x43')]);});}}});})[_0x0f5d('0x22')](function(){_0x4a49b6();})['catch'](function(_0xea8bfc){logger['error'](_0x0f5d('0x41'),_0x0f5d('0x19'),_0xea8bfc[_0x0f5d('0x43')]);_0x4a49b6(_0xea8bfc);});}else{_0x4a49b6(new Error(_0x0f5d('0x44')));}},'afterDestroy':function(_0x4679b2,_0x26d5de,_0x420dc7){var _0x4b68d0=_0x4f3ca5[_0x0f5d('0x16')];var _0x14e9b7=_0x4679b2[_0x0f5d('0x3f')]({'plain':!![]});return _0x4b68d0[_0x0f5d('0x26')]['findAll']({'raw':!![],'where':{'ListId':_0x14e9b7[_0x0f5d('0x28')],'ContactId':_0x14e9b7['id']}})[_0x0f5d('0x22')](function(_0x8414f8){if(!_[_0x0f5d('0x45')](_0x8414f8)){var _0x151e33=[];for(var _0x30b020=0x0;_0x30b020<_0x8414f8['length'];_0x30b020+=0x1){var _0x30be88=_0x4b68d0[_0x0f5d('0x26')][_0x0f5d('0x46')]({'where':{'ListId':_0x8414f8[_0x30b020][_0x0f5d('0x28')],'ContactId':_0x8414f8[_0x30b020][_0x0f5d('0x47')],'VoiceQueueId':_0x8414f8[_0x30b020][_0x0f5d('0x48')],'CampaignId':_0x8414f8[_0x30b020]['CampaignId']}});_0x151e33[_0x0f5d('0x49')](_0x30be88);}return BPromise[_0x0f5d('0x4a')](_0x151e33);}})[_0x0f5d('0x22')](function(_0x5e40c1){logger['info'](_0x0f5d('0x4b'),util[_0x0f5d('0x1a')](_0x5e40c1,{'showHidden':![],'depth':null}));_0x420dc7();})[_0x0f5d('0x2a')](function(_0x3eab62){logger['error'](_0x0f5d('0x4c'),util[_0x0f5d('0x1a')](_0x3eab62,{'showHidden':![],'depth':null}));_0x420dc7(_0x3eab62);});}}});}; \ No newline at end of file +var _0x67d0=['VoiceQueue','findOne','then','timezones','utcOffset','add','minutes','ret','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','callbackUniqueid','catch','cmContact,\x20afterCreate,\x20','priority','Campaign','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','outbound','dialCheckDuplicateType','CmList','Lists','length','get','onlyIfOpen','findAll','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','message','always','List\x20not\x20found','destroy','ContactId','VoiceQueueId','push','all','info','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cmContact.attributes','exports','define','cm_contacts','phone','firstName','mobile','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','error','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x67d0,0x188));var _0x067d=function(_0x4042c2,_0x487ab7){_0x4042c2=_0x4042c2-0x0;var _0x5e165e=_0x67d0[_0x4042c2];return _0x5e165e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x067d('0x0'))('api');var moment=require(_0x067d('0x1'));var BPromise=require(_0x067d('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x067d('0x3'));var rimraf=require(_0x067d('0x4'));var config=require(_0x067d('0x5'));var shared=require('../../config/environment/shared');var attributes=require(_0x067d('0x6'));module[_0x067d('0x7')]=function(_0x183e46,_0x4336b1){return _0x183e46[_0x067d('0x8')]('CmContact',attributes,{'tableName':_0x067d('0x9'),'paranoid':!![],'indexes':[{'name':_0x067d('0xa'),'fields':[_0x067d('0xa')]},{'name':'fti_cm_contacts','fields':[_0x067d('0xb'),'lastName',_0x067d('0xa'),_0x067d('0xc'),_0x067d('0xd'),_0x067d('0xe')],'type':_0x067d('0xf')}],'timestamps':!![],'charset':_0x067d('0x10'),'collate':_0x067d('0x11'),'hooks':{'afterCreate':function(_0x63b507,_0x312e12,_0x598017){var _0xedea65=_0x183e46[_0x067d('0x12')];var _0x39e756=_0x63b507['get']({'plain':!![]});function _0x23dc4c(){return function(_0x5ca0f9){logger[_0x067d('0x13')](_0x067d('0x14'),_0x067d('0x15'),util[_0x067d('0x16')](_0x5ca0f9,{'showHidden':![],'depth':null}));};}function _0x54fba8(_0x3ec5b1,_0x339ee8){var _0x3e7634=_0x339ee8[_0x067d('0x17')]?_0x339ee8[_0x067d('0x17')]:moment()[_0x067d('0x18')](_0x067d('0x19'));return new BPromise(function(_0x226417,_0x48d449){if(_[_0x067d('0x1a')](_0x339ee8[_0x067d('0x1b')])){_0x226417({'ret':_0x3e7634});}else{_0xedea65[_0x067d('0x1c')][_0x067d('0x1d')]({'where':{'id':_0x3ec5b1['id']}})[_0x067d('0x1e')](function(_0x86a18a){if(!_[_0x067d('0x1a')](_0x86a18a)){var _0xa974aa=_0x86a18a['dialTimezone'];if(!_[_0x067d('0x1a')](_0xa974aa)){var _0x50f34c=shared[_0x067d('0x1f')];var _0x3b2cb5=_0x50f34c[_0xa974aa];var _0x4ad1c7=_0x50f34c[_0x339ee8[_0x067d('0x1b')]];if(!_['isNil'](_0x3b2cb5)&&!_[_0x067d('0x1a')](_0x4ad1c7)){var _0x584290=_0x3b2cb5['utcOffset']-_0x4ad1c7[_0x067d('0x20')];_0x3e7634=_0x339ee8[_0x067d('0x17')]?_0x339ee8[_0x067d('0x17')]:moment();var _0x5ad0e6=moment(_0x3e7634)[_0x067d('0x21')](_0x584290,_0x067d('0x22'));_0x226417({'ret':_0x5ad0e6[_0x067d('0x18')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x226417({'ret':_0x3e7634});}else _0x226417({'ret':_0x3e7634});}else{_0x226417({'ret':_0x3e7634});}});}});return 0xa;}var _0xf2b13d=function(_0x1f2bb8){return new BPromise(function(_0x5e1c39,_0x30a23d){_0x54fba8(_0x1f2bb8,_0x39e756)[_0x067d('0x1e')](function(_0x55d212){_0x39e756['scheduledat']=_0x55d212[_0x067d('0x23')];_0xedea65[_0x067d('0x24')][_0x067d('0x1d')]({'where':{'phone':_0x39e756[_0x067d('0xa')],'VoiceQueueId':_0x1f2bb8['id']}})['then'](function(_0xb648c4){if(!_[_0x067d('0x1a')](_0xb648c4)){throw new Error(_0x067d('0x25')+_0x39e756['phone']+_0x067d('0x26')+_0x1f2bb8['id']);}return _0xedea65['CmHopper'][_0x067d('0x27')]({'phone':_0x39e756[_0x067d('0xa')],'ContactId':_0x39e756['id'],'ListId':_0x39e756[_0x067d('0x28')],'priority':_0x39e756['priority']?_0x39e756['priority']:0x2,'scheduledat':_0x39e756['scheduledat']?_0x39e756['scheduledat']:moment()['format'](_0x067d('0x19')),'callback':_0x39e756[_0x067d('0x29')]?!![]:![],'callbackuniqueid':_0x39e756['callbackUniqueid']?_0x39e756[_0x067d('0x29')]:undefined,'callbackat':_0x39e756[_0x067d('0x29')]?moment()['format'](_0x067d('0x19')):undefined,'VoiceQueueId':_0x1f2bb8['id']});})[_0x067d('0x2a')](function(_0x365098){_0x30a23d(_0x365098);});});});};var _0x4ca05f=function(_0x31ec9d){return new BPromise(function(_0x4515f8,_0x376586){_0x54fba8(_0x31ec9d,_0x39e756)[_0x067d('0x1e')](function(_0x4969e7){_0x39e756[_0x067d('0x17')]=_0x4969e7[_0x067d('0x23')];_0xedea65[_0x067d('0x24')]['findOne']({'where':{'phone':_0x39e756['phone'],'VoiceQueueId':_0x31ec9d['id']}})[_0x067d('0x1e')](function(_0x3cd501){if(!_[_0x067d('0x1a')](_0x3cd501)){throw new Error('cmContact,\x20afterCreate\x20'+_0x39e756['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x31ec9d['id']);}return _0xedea65['CmHopperFinal'][_0x067d('0x1d')]({'where':{'calleridnum':_0x39e756[_0x067d('0xa')],'VoiceQueueId':_0x31ec9d['id']}});})[_0x067d('0x1e')](function(_0x25d689){if(!_[_0x067d('0x1a')](_0x25d689)){throw new Error(_0x067d('0x2b')+_0x39e756[_0x067d('0xa')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x31ec9d['id']);}return _0xedea65[_0x067d('0x24')][_0x067d('0x27')]({'phone':_0x39e756['phone'],'ContactId':_0x39e756['id'],'ListId':_0x39e756['ListId'],'priority':_0x39e756[_0x067d('0x2c')]?_0x39e756[_0x067d('0x2c')]:0x2,'scheduledat':_0x39e756[_0x067d('0x17')]?_0x39e756['scheduledat']:moment()[_0x067d('0x18')](_0x067d('0x19')),'callback':_0x39e756[_0x067d('0x29')]?!![]:![],'callbackuniqueid':_0x39e756['callbackUniqueid']?_0x39e756[_0x067d('0x29')]:undefined,'callbackat':_0x39e756[_0x067d('0x29')]?moment()['format'](_0x067d('0x19')):undefined,'VoiceQueueId':_0x31ec9d['id']});})[_0x067d('0x2a')](function(_0x205b73){_0x376586(_0x205b73);});});});};function _0xf2a0d4(){return function(_0x55fb5c){logger[_0x067d('0x13')](_0x067d('0x14'),_0x067d('0x15'),util[_0x067d('0x16')](_0x55fb5c,{'showHidden':![],'depth':null}));};}function _0x194fc2(_0x35d93a,_0x34374e){var _0x5d4af7=_0x34374e[_0x067d('0x17')]?_0x34374e[_0x067d('0x17')]:moment()['format'](_0x067d('0x19'));return new BPromise(function(_0x2eeaa7,_0x2dd68e){if(_[_0x067d('0x1a')](_0x34374e[_0x067d('0x1b')])){_0x2eeaa7({'ret':_0x5d4af7});}else{_0xedea65[_0x067d('0x2d')][_0x067d('0x1d')]({'where':{'id':_0x35d93a['id']}})['then'](function(_0x5772ff){if(!_[_0x067d('0x1a')](_0x5772ff)){var _0x4c9bdf=_0x5772ff[_0x067d('0x1b')];if(!_[_0x067d('0x1a')](_0x4c9bdf)){var _0x3b67bb=shared[_0x067d('0x1f')];var _0x192001=_0x3b67bb[_0x4c9bdf];var _0x2593d3=_0x3b67bb[_0x34374e['dialTimezone']];if(!_['isNil'](_0x192001)&&!_[_0x067d('0x1a')](_0x2593d3)){var _0x4331cf=_0x192001[_0x067d('0x20')]-_0x2593d3['utcOffset'];_0x5d4af7=_0x34374e[_0x067d('0x17')]?_0x34374e[_0x067d('0x17')]:moment();var _0x5dad50=moment(_0x5d4af7)[_0x067d('0x21')](_0x4331cf,'minutes');_0x2eeaa7({'ret':_0x5dad50['format'](_0x067d('0x19'))});}else _0x2eeaa7({'ret':_0x5d4af7});}else _0x2eeaa7({'ret':_0x5d4af7});}else{_0x2eeaa7({'ret':_0x5d4af7});}});}});return 0xa;}var _0x171242=function(_0x280f8a){return new BPromise(function(_0x5c729c,_0x4a9c74){_0x194fc2(_0x280f8a,_0x39e756)[_0x067d('0x1e')](function(_0x1e71e8){_0x39e756[_0x067d('0x17')]=_0x1e71e8[_0x067d('0x23')];_0xedea65[_0x067d('0x24')][_0x067d('0x1d')]({'where':{'phone':_0x39e756[_0x067d('0xa')],'CampaignId':_0x280f8a['id']}})[_0x067d('0x1e')](function(_0x3352ff){if(!_[_0x067d('0x1a')](_0x3352ff)){throw new Error(_0x067d('0x25')+_0x39e756['phone']+_0x067d('0x2e')+_0x280f8a['id']);}return _0xedea65[_0x067d('0x24')][_0x067d('0x27')]({'phone':_0x39e756[_0x067d('0xa')],'ContactId':_0x39e756['id'],'ListId':_0x39e756['ListId'],'priority':_0x39e756[_0x067d('0x2c')]?_0x39e756['priority']:0x2,'scheduledat':_0x39e756[_0x067d('0x17')]?_0x39e756[_0x067d('0x17')]:moment()[_0x067d('0x18')](_0x067d('0x19')),'callback':_0x39e756[_0x067d('0x29')]?!![]:![],'callbackuniqueid':_0x39e756[_0x067d('0x29')]?_0x39e756[_0x067d('0x29')]:undefined,'callbackat':_0x39e756[_0x067d('0x29')]?moment()['format'](_0x067d('0x19')):undefined,'CampaignId':_0x280f8a['id']});})[_0x067d('0x2a')](function(_0x9d166b){_0x4a9c74(_0x9d166b);});});});};var _0x2d8e47=function(_0x15c8fe){return new BPromise(function(_0x44aaac,_0xfbba5f){_0x194fc2(_0x15c8fe,_0x39e756)[_0x067d('0x1e')](function(_0x240e31){_0x39e756[_0x067d('0x17')]=_0x240e31[_0x067d('0x23')];_0xedea65['CmHopper'][_0x067d('0x1d')]({'where':{'phone':_0x39e756[_0x067d('0xa')],'CampaignId':_0x15c8fe['id']}})[_0x067d('0x1e')](function(_0x3d71de){if(!_[_0x067d('0x1a')](_0x3d71de)){throw new Error(_0x067d('0x25')+_0x39e756[_0x067d('0xa')]+_0x067d('0x2f')+_0x15c8fe['id']);}return _0xedea65[_0x067d('0x30')][_0x067d('0x1d')]({'where':{'calleridnum':_0x39e756['phone'],'CampaignId':_0x15c8fe['id']}});})[_0x067d('0x1e')](function(_0x42d7f3){if(!_[_0x067d('0x1a')](_0x42d7f3)){throw new Error(_0x067d('0x2b')+_0x39e756[_0x067d('0xa')]+_0x067d('0x31')+_0x15c8fe['id']);}return _0xedea65[_0x067d('0x24')][_0x067d('0x27')]({'phone':_0x39e756[_0x067d('0xa')],'ContactId':_0x39e756['id'],'ListId':_0x39e756[_0x067d('0x28')],'priority':_0x39e756['priority']?_0x39e756[_0x067d('0x2c')]:0x2,'scheduledat':_0x39e756[_0x067d('0x17')]?_0x39e756[_0x067d('0x17')]:moment()[_0x067d('0x18')](_0x067d('0x19')),'callback':_0x39e756['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x39e756[_0x067d('0x29')]?_0x39e756['callbackUniqueid']:undefined,'callbackat':_0x39e756[_0x067d('0x29')]?moment()[_0x067d('0x18')](_0x067d('0x19')):undefined,'CampaignId':_0x15c8fe['id']});})[_0x067d('0x2a')](function(_0x540b83){_0xfbba5f(_0x540b83);});});});};if(_0x39e756[_0x067d('0x28')]){_0xedea65[_0x067d('0x1c')]['findAll']({'where':{'type':_0x067d('0x32')},'attributes':['id',_0x067d('0x33'),'dialTimezone'],'include':[{'model':_0xedea65[_0x067d('0x34')],'as':_0x067d('0x35'),'where':{'id':_0x39e756['ListId']}}]})[_0x067d('0x1e')](function(_0xa7fb23){if(_0xa7fb23){var _0x3cb147=[];for(var _0x35b182=0x0,_0x4baaf0;_0x35b182<_0xa7fb23[_0x067d('0x36')];_0x35b182+=0x1){_0x4baaf0=_0xa7fb23[_0x35b182][_0x067d('0x37')]({'plain':!![]});switch(_0x4baaf0[_0x067d('0x33')]){case'always':_0x4ca05f(_0x4baaf0)[_0x067d('0x2a')](_0x23dc4c());break;case _0x067d('0x38'):_0xf2b13d(_0x4baaf0)[_0x067d('0x2a')](_0x23dc4c());break;default:_0x194fc2(_0x4baaf0,_0x39e756)[_0x067d('0x1e')](function(_0x1164f7){_0x39e756[_0x067d('0x17')]=_0x1164f7[_0x067d('0x23')];_0xedea65[_0x067d('0x24')][_0x067d('0x27')]({'phone':_0x39e756['phone'],'ContactId':_0x39e756['id'],'ListId':_0x39e756[_0x067d('0x28')],'scheduledat':_0x39e756[_0x067d('0x17')]?_0x39e756[_0x067d('0x17')]:moment()[_0x067d('0x18')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x39e756[_0x067d('0x2c')]?_0x39e756[_0x067d('0x2c')]:0x2,'callback':_0x39e756[_0x067d('0x29')]?!![]:![],'callbackuniqueid':_0x39e756[_0x067d('0x29')]?_0x39e756[_0x067d('0x29')]:undefined,'callbackat':_0x39e756[_0x067d('0x29')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x4baaf0['id']})[_0x067d('0x2a')](_0x23dc4c());});}}}})[_0x067d('0x1e')](function(){return _0xedea65['VoiceQueue'][_0x067d('0x39')]({'where':{'type':_0x067d('0x32')},'attributes':['id'],'include':[{'model':_0xedea65[_0x067d('0x34')],'as':_0x067d('0x3a'),'where':{'id':_0x39e756[_0x067d('0x28')]}}]})[_0x067d('0x1e')](function(_0x2a1e58){if(_0x2a1e58){var _0x5198f5=[];for(var _0x160528=0x0,_0x3ee47d;_0x160528<_0x2a1e58[_0x067d('0x36')];_0x160528+=0x1){_0x3ee47d=_0x2a1e58[_0x160528]['get']({'plain':!![]});_0xedea65[_0x067d('0x3b')][_0x067d('0x27')]({'phone':_0x39e756['phone'],'ContactId':_0x39e756['id'],'ListId':_0x39e756[_0x067d('0x28')],'VoiceQueueId':_0x3ee47d['id']})['catch'](function(_0x274ccf){logger[_0x067d('0x13')](_0x067d('0x3c'),'afterCreate',_0x274ccf[_0x067d('0x3d')]);});}}});})['then'](function(){return _0xedea65[_0x067d('0x2d')][_0x067d('0x39')]({'attributes':['id',_0x067d('0x33'),_0x067d('0x1b')],'include':[{'model':_0xedea65[_0x067d('0x34')],'as':_0x067d('0x35'),'where':{'id':_0x39e756['ListId']}}]})[_0x067d('0x1e')](function(_0x419661){if(_0x419661){var _0xb16cb5=[];for(var _0x1cf695=0x0,_0x2fcd29;_0x1cf695<_0x419661[_0x067d('0x36')];_0x1cf695+=0x1){_0x2fcd29=_0x419661[_0x1cf695]['get']({'plain':!![]});switch(_0x2fcd29[_0x067d('0x33')]){case _0x067d('0x3e'):_0x2d8e47(_0x2fcd29)['catch'](_0xf2a0d4());break;case _0x067d('0x38'):_0x171242(_0x2fcd29)[_0x067d('0x2a')](_0xf2a0d4());break;default:_0xedea65['CmHopper']['create']({'phone':_0x39e756[_0x067d('0xa')],'ContactId':_0x39e756['id'],'ListId':_0x39e756['ListId'],'scheduledat':_0x39e756[_0x067d('0x17')]?_0x39e756[_0x067d('0x17')]:moment()[_0x067d('0x18')](_0x067d('0x19')),'priority':_0x39e756[_0x067d('0x2c')]?_0x39e756['priority']:0x2,'callback':_0x39e756[_0x067d('0x29')]?!![]:![],'callbackuniqueid':_0x39e756['callbackUniqueid']?_0x39e756[_0x067d('0x29')]:undefined,'callbackat':_0x39e756[_0x067d('0x29')]?moment()[_0x067d('0x18')](_0x067d('0x19')):undefined,'CampaignId':_0x2fcd29['id']})['catch'](_0xf2a0d4());}}}});})[_0x067d('0x1e')](function(){return _0xedea65[_0x067d('0x2d')][_0x067d('0x39')]({'attributes':['id'],'include':[{'model':_0xedea65[_0x067d('0x34')],'as':'BlackLists','where':{'id':_0x39e756[_0x067d('0x28')]}}]})[_0x067d('0x1e')](function(_0x44caf8){if(_0x44caf8){var _0x5f1e21=[];for(var _0x15e210=0x0,_0x3bed61;_0x15e210<_0x44caf8[_0x067d('0x36')];_0x15e210+=0x1){_0x3bed61=_0x44caf8[_0x15e210][_0x067d('0x37')]({'plain':!![]});_0xedea65[_0x067d('0x3b')][_0x067d('0x27')]({'phone':_0x39e756[_0x067d('0xa')],'ContactId':_0x39e756['id'],'ListId':_0x39e756[_0x067d('0x28')],'CampaignId':_0x3bed61['id']})['catch'](function(_0x33bca2){logger[_0x067d('0x13')]('cmContact,\x20%s,\x20%s',_0x067d('0x15'),_0x33bca2[_0x067d('0x3d')]);});}}});})[_0x067d('0x1e')](function(){_0x598017();})[_0x067d('0x2a')](function(_0x5966b2){logger['error'](_0x067d('0x3c'),_0x067d('0x15'),_0x5966b2[_0x067d('0x3d')]);_0x598017(_0x5966b2);});}else{_0x598017(new Error(_0x067d('0x3f')));}},'afterDestroy':function(_0x4970d6,_0xca251d,_0x1fbfe2){var _0x135b25=_0x183e46[_0x067d('0x12')];var _0x41ec54=_0x4970d6['get']({'plain':!![]});return _0x135b25[_0x067d('0x24')][_0x067d('0x39')]({'raw':!![],'where':{'ListId':_0x41ec54[_0x067d('0x28')],'ContactId':_0x41ec54['id']}})[_0x067d('0x1e')](function(_0x2a5050){if(!_['isEmpty'](_0x2a5050)){var _0x21dbc3=[];for(var _0x157138=0x0;_0x157138<_0x2a5050['length'];_0x157138+=0x1){var _0x52be9f=_0x135b25[_0x067d('0x24')][_0x067d('0x40')]({'where':{'ListId':_0x2a5050[_0x157138][_0x067d('0x28')],'ContactId':_0x2a5050[_0x157138][_0x067d('0x41')],'VoiceQueueId':_0x2a5050[_0x157138][_0x067d('0x42')],'CampaignId':_0x2a5050[_0x157138]['CampaignId']}});_0x21dbc3[_0x067d('0x43')](_0x52be9f);}return BPromise[_0x067d('0x44')](_0x21dbc3);}})['then'](function(_0x4ca378){logger[_0x067d('0x45')]('[CmContact][afterDestroy][Succesfull]',util[_0x067d('0x16')](_0x4ca378,{'showHidden':![],'depth':null}));_0x1fbfe2();})['catch'](function(_0x161758){logger[_0x067d('0x13')]('[CmContact][afterDestroy][Error]',util[_0x067d('0x16')](_0x161758,{'showHidden':![],'depth':null}));_0x1fbfe2(_0x161758);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index f325eed..dc901ed 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var squel=require('squel');var db=require(_0x0a9e('0x4'))['db'];var utils=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var config=require(_0x0a9e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a9e('0x9')][_0x0a9e('0xa')]({'port':0x232a});config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithRpcPromise(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){return client['request'](_0x307b3e,_0xfeb75b)['then'](function(_0x4cfe67){logger[_0x0a9e('0xf')](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));logger[_0x0a9e('0x12')](_0x0a9e('0x13'),_0x3ab53f,_0x0a9e('0x11'),JSON['stringify'](_0x4cfe67));if(_0x4cfe67[_0x0a9e('0x14')]){if(_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x15')]===0x1f4){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')]['message']);return _0x4a4c56(_0x4cfe67[_0x0a9e('0x14')]['message']);}logger[_0x0a9e('0x14')]('CmContact,\x20%s,\x20%s',_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x16')]);return _0xbd1168(_0x4cfe67['error'][_0x0a9e('0x16')]);}else{logger['info'](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));_0xbd1168(_0x4cfe67[_0x0a9e('0x17')][_0x0a9e('0x16')]);}})[_0x0a9e('0x18')](function(_0x2eb11f){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x2eb11f);_0x4a4c56(_0x2eb11f);});});}exports[_0x0a9e('0x19')]=function(_0x112016){var _0x1c696a=this;return new Promise(function(_0x105080,_0x4bb1e3){return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':_0x112016['options']?_0x112016[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x112016['options']?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')]||null:null,'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')]['attributes']||null:null,'limit':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1e')]||null:null,'include':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x112016['options']['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x21')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x22')],'include':_0x197ec0[_0x0a9e('0x1f')]?_['map'](_0x197ec0[_0x0a9e('0x1f')],function(_0x479bc4){return{'model':db[_0x479bc4[_0x0a9e('0x21')]],'as':_0x479bc4['as'],'attributes':_0x479bc4['attributes'],'include':_0x479bc4[_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x479bc4[_0x0a9e('0x1f')],function(_0x14433c){return{'model':db[_0x14433c[_0x0a9e('0x21')]],'as':_0x14433c['as'],'attributes':_0x14433c[_0x0a9e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x14de77){logger['info'](_0x0a9e('0x19'),_0x112016);logger[_0x0a9e('0x12')](_0x0a9e('0x19'),_0x112016,JSON[_0x0a9e('0x24')](_0x14de77));if(_0x14de77['length']==0x0){return db[_0x0a9e('0x25')][_0x0a9e('0x26')]({'raw':!![],'where':{'item':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x27')]},'include':[{'model':db[_0x0a9e('0x1a')],'where':{'ListId':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')][_0x0a9e('0x28')],'deletedAt':{'$eq':null}},'as':_0x0a9e('0x29')}]})['then'](function(_0x426950){if(_['isNil'](_0x426950)){_0x105080(_0x14de77);}else{var _0x2407f9=_0x426950[_0x0a9e('0x2a')];return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':!![],'where':{'id':_0x2407f9},'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016['options'][_0x0a9e('0x22')]||null:null})[_0x0a9e('0x23')](function(_0x40cb85){_0x105080(_0x40cb85);});}});}else{_0x105080(_0x14de77);}})[_0x0a9e('0x18')](function(_0x2b45ea){logger[_0x0a9e('0x14')](_0x0a9e('0x19'),_0x2b45ea[_0x0a9e('0x16')],_0x112016);_0x4bb1e3(_0x1c696a['error'](0x1f4,_0x2b45ea[_0x0a9e('0x16')]));});});};exports['CreateCmContact']=function(_0x2cc7a0){var _0x14b13f=this;return new Promise(function(_0x2b7e7f,_0x3f3d41){return db['CmContact'][_0x0a9e('0x2b')](_0x2cc7a0[_0x0a9e('0x2c')],{'raw':_0x2cc7a0[_0x0a9e('0x1c')]?_0x2cc7a0[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e8694){var _0x5640eb;for(var _0x24936a=0x0;_0x24936a{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x2413e5,_0x4d6769){var _0x8fb321=function(_0xf16315){while(--_0xf16315){_0x2413e5['push'](_0x2413e5['shift']());}};_0x8fb321(++_0x4d6769);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/phones',auth['isAuthenticated'](),controller['getAdditionalPhones']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getHopperHistories']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x18')]('/merge',auth[_0x0a9e('0xd')](),controller['merge']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/phones',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x1e'),auth['isAuthenticated'](),controller['duplicateAdditionalPhones']);router[_0x0a9e('0x18')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfb6e48,_0x2fb0e4,_0x3b45bc){_0x3b45bc(null,path[_0x0a9e('0x21')](config[_0x0a9e('0x22')],_0x0a9e('0x23')));},'filename':function(_0x16b1ca,_0x5ea472,_0x59181e){_0x5ea472[_0x0a9e('0x24')]=_0x5ea472[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.attributes.js b/server/api/cmContactHasItem/cmContactHasItem.attributes.js index 1eaca62..c7bcefc 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.attributes.js +++ b/server/api/cmContactHasItem/cmContactHasItem.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaf80=['exports','INTEGER','STRING','sequelize'];(function(_0x4adb31,_0x26d680){var _0x5a1626=function(_0xfcd7ed){while(--_0xfcd7ed){_0x4adb31['push'](_0x4adb31['shift']());}};_0x5a1626(++_0x26d680);}(_0xaf80,0x1ef));var _0x0af8=function(_0xb79436,_0x324b86){_0xb79436=_0xb79436-0x0;var _0x4a4bb0=_0xaf80[_0xb79436];return _0x4a4bb0;};'use strict';var Sequelize=require(_0x0af8('0x0'));module[_0x0af8('0x1')]={'CmContactId':{'type':Sequelize[_0x0af8('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0x0af8('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize[_0x0af8('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0x0af8('0x3')],'defaultValue':null}}; \ No newline at end of file +var _0x028d=['INTEGER','STRING','PHONE','exports'];(function(_0x44469e,_0xfc0660){var _0x578c0a=function(_0x27c825){while(--_0x27c825){_0x44469e['push'](_0x44469e['shift']());}};_0x578c0a(++_0xfc0660);}(_0x028d,0xff));var _0xd028=function(_0x47b5e0,_0x273723){_0x47b5e0=_0x47b5e0-0x0;var _0x128d60=_0x028d[_0x47b5e0];return _0x128d60;};'use strict';var Sequelize=require('sequelize');module[_0xd028('0x0')]={'CmContactId':{'type':Sequelize[_0xd028('0x1')],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xd028('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xd028('0x2')],'defaultValue':_0xd028('0x3')},'OrderBy':{'type':Sequelize[_0xd028('0x1')],'defaultValue':null},'description':{'type':Sequelize[_0xd028('0x2')],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index 467766c..d476f00 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.controller.js +++ b/server/api/cmContactHasItem/cmContactHasItem.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x25d7=['CmContactHasItems','destroy','error','stack','name','send','index','map','CmContactHasItem','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','rows','catch','show','params','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','Content-Range','reject','save','update','then','get'];(function(_0xef5f0f,_0x35b798){var _0xd3b8d=function(_0x18abe4){while(--_0x18abe4){_0xef5f0f['push'](_0xef5f0f['shift']());}};_0xd3b8d(++_0x35b798);}(_0x25d7,0x134));var _0x725d=function(_0x4bb581,_0x6f7037){_0x4bb581=_0x4bb581-0x0;var _0x316bf5=_0x25d7[_0x4bb581];return _0x316bf5;};'use strict';var emlformat=require(_0x725d('0x0'));var rimraf=require(_0x725d('0x1'));var zipdir=require(_0x725d('0x2'));var jsonpatch=require(_0x725d('0x3'));var rp=require(_0x725d('0x4'));var moment=require(_0x725d('0x5'));var BPromise=require(_0x725d('0x6'));var Mustache=require(_0x725d('0x7'));var util=require(_0x725d('0x8'));var path=require(_0x725d('0x9'));var sox=require(_0x725d('0xa'));var csv=require(_0x725d('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x725d('0xc'));var _=require('lodash');var squel=require(_0x725d('0xd'));var crypto=require(_0x725d('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x725d('0xb'));var querystring=require(_0x725d('0xf'));var Papa=require(_0x725d('0x10'));var Redis=require(_0x725d('0x11'));var authService=require(_0x725d('0x12'));var qs=require(_0x725d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x725d('0x14'));var logger=require(_0x725d('0x15'))(_0x725d('0x16'));var utils=require(_0x725d('0x17'));var config=require(_0x725d('0x18'));var licenseUtil=require(_0x725d('0x19'));var db=require(_0x725d('0x1a'))['db'];function respondWithStatusCode(_0x1c01ba,_0x56d8c9){_0x56d8c9=_0x56d8c9||0xcc;return function(_0xdbc34e){if(_0xdbc34e){return _0x1c01ba[_0x725d('0x1b')](_0x56d8c9);}return _0x1c01ba['status'](_0x56d8c9)[_0x725d('0x1c')]();};}function respondWithResult(_0x63edf5,_0x426057){_0x426057=_0x426057||0xc8;return function(_0x2c633e){if(_0x2c633e){return _0x63edf5[_0x725d('0x1d')](_0x426057)[_0x725d('0x1e')](_0x2c633e);}};}function respondWithFilteredResult(_0x42176f,_0x3e4c39){return function(_0x33effc){if(_0x33effc){var _0x2e61df=typeof _0x3e4c39[_0x725d('0x1f')]===_0x725d('0x20')&&typeof _0x3e4c39[_0x725d('0x21')]===_0x725d('0x20');var _0x16c022=_0x33effc['count'];var _0x5c79e4=_0x2e61df?0x0:_0x3e4c39[_0x725d('0x1f')];var _0x28021b=_0x2e61df?_0x33effc['count']:_0x3e4c39[_0x725d('0x1f')]+_0x3e4c39['limit'];var _0x1072af;if(_0x28021b>=_0x16c022){_0x28021b=_0x16c022;_0x1072af=0xc8;}else{_0x1072af=0xce;}_0x42176f['status'](_0x1072af);return _0x42176f['set'](_0x725d('0x22'),_0x5c79e4+'-'+_0x28021b+'/'+_0x16c022)['json'](_0x33effc);}return null;};}function patchUpdates(_0x636e6){return function(_0x3bb0eb){try{jsonpatch['apply'](_0x3bb0eb,_0x636e6,!![]);}catch(_0x495b30){return BPromise[_0x725d('0x23')](_0x495b30);}return _0x3bb0eb[_0x725d('0x24')]();};}function saveUpdates(_0x530003,_0x5984fb){return function(_0x4cdff2){if(_0x4cdff2){return _0x4cdff2[_0x725d('0x25')](_0x530003)[_0x725d('0x26')](function(_0x5e72a4){return _0x5e72a4;});}return null;};}function removeEntity(_0x1b9e6e,_0xc23208){return function(_0x26c984){if(_0x26c984){return _0x26c984['destroy']()[_0x725d('0x26')](function(){var _0x4ade39=_0x26c984[_0x725d('0x27')]({'plain':!![]});var _0x576199=_0x725d('0x28');return db['UserProfileResource'][_0x725d('0x29')]({'where':{'type':_0x576199,'resourceId':_0x4ade39['id']}})['then'](function(){return _0x26c984;});})[_0x725d('0x26')](function(){_0x1b9e6e['status'](0xcc)[_0x725d('0x1c')]();});}};}function handleEntityNotFound(_0x13b964,_0x14b329){return function(_0x2eacba){if(!_0x2eacba){_0x13b964[_0x725d('0x1b')](0x194);}return _0x2eacba;};}function handleError(_0x7a52a3,_0x2dd1a1){_0x2dd1a1=_0x2dd1a1||0x1f4;return function(_0x423c79){logger[_0x725d('0x2a')](_0x423c79[_0x725d('0x2b')]);if(_0x423c79[_0x725d('0x2c')]){delete _0x423c79['name'];}_0x7a52a3[_0x725d('0x1d')](_0x2dd1a1)[_0x725d('0x2d')](_0x423c79);};}exports[_0x725d('0x2e')]=function(_0x2f708f,_0x36fb86){var _0x3c6253={},_0x52a150={},_0x5df9cd={'count':0x0,'rows':[]};var _0x263ec5=_[_0x725d('0x2f')](db[_0x725d('0x30')][_0x725d('0x31')],function(_0x2b021d){return{'name':_0x2b021d[_0x725d('0x32')],'type':_0x2b021d[_0x725d('0x33')]['key']};});_0x52a150[_0x725d('0x34')]=_[_0x725d('0x2f')](_0x263ec5,_0x725d('0x2c'));_0x52a150[_0x725d('0x35')]=_[_0x725d('0x36')](_0x2f708f[_0x725d('0x35')]);_0x52a150[_0x725d('0x37')]=_[_0x725d('0x38')](_0x52a150[_0x725d('0x34')],_0x52a150[_0x725d('0x35')]);_0x3c6253['attributes']=_[_0x725d('0x38')](_0x52a150[_0x725d('0x34')],qs['fields'](_0x2f708f[_0x725d('0x35')][_0x725d('0x39')]));_0x3c6253[_0x725d('0x3a')]=_0x3c6253[_0x725d('0x3a')][_0x725d('0x3b')]?_0x3c6253[_0x725d('0x3a')]:_0x52a150[_0x725d('0x34')];if(!_0x2f708f['query'][_0x725d('0x3c')](_0x725d('0x3d'))){_0x3c6253['limit']=qs['limit'](_0x2f708f[_0x725d('0x35')][_0x725d('0x21')]);_0x3c6253[_0x725d('0x1f')]=qs['offset'](_0x2f708f[_0x725d('0x35')][_0x725d('0x1f')]);}_0x3c6253[_0x725d('0x3e')]=qs[_0x725d('0x3f')](_0x2f708f['query'][_0x725d('0x3f')]);_0x3c6253[_0x725d('0x40')]=qs[_0x725d('0x37')](_[_0x725d('0x41')](_0x2f708f[_0x725d('0x35')],_0x52a150['filters']),_0x263ec5);if(_0x2f708f[_0x725d('0x35')][_0x725d('0x42')]){_0x3c6253[_0x725d('0x40')]=_[_0x725d('0x43')](_0x3c6253[_0x725d('0x40')],{'$or':_[_0x725d('0x2f')](_0x263ec5,function(_0x1a957c){if(_0x1a957c['type']!==_0x725d('0x44')){var _0x2c8bdb={};_0x2c8bdb[_0x1a957c[_0x725d('0x2c')]]={'$like':'%'+_0x2f708f[_0x725d('0x35')][_0x725d('0x42')]+'%'};return _0x2c8bdb;}})});}_0x3c6253=_[_0x725d('0x43')]({},_0x3c6253,_0x2f708f[_0x725d('0x45')]);var _0x1dd331={'where':_0x3c6253[_0x725d('0x40')]};return db[_0x725d('0x30')][_0x725d('0x46')](_0x1dd331)[_0x725d('0x26')](function(_0x4528b6){_0x5df9cd[_0x725d('0x46')]=_0x4528b6;if(_0x2f708f['query'][_0x725d('0x47')]){_0x3c6253['include']=[{'all':!![]}];}return db['CmContactHasItem']['findAll'](_0x3c6253);})[_0x725d('0x26')](function(_0x18297e){_0x5df9cd[_0x725d('0x48')]=_0x18297e;return _0x5df9cd;})[_0x725d('0x26')](respondWithFilteredResult(_0x36fb86,_0x3c6253))[_0x725d('0x49')](handleError(_0x36fb86,null));};exports[_0x725d('0x4a')]=function(_0x5b31bb,_0x39c88a){var _0x57baf6={'raw':!![],'where':{'id':_0x5b31bb[_0x725d('0x4b')]['id']}},_0x529275={};_0x529275[_0x725d('0x34')]=_[_0x725d('0x36')](db[_0x725d('0x30')][_0x725d('0x31')]);_0x529275['query']=_['keys'](_0x5b31bb[_0x725d('0x35')]);_0x529275[_0x725d('0x37')]=_[_0x725d('0x38')](_0x529275[_0x725d('0x34')],_0x529275[_0x725d('0x35')]);_0x57baf6['attributes']=_[_0x725d('0x38')](_0x529275['model'],qs[_0x725d('0x39')](_0x5b31bb['query'][_0x725d('0x39')]));_0x57baf6[_0x725d('0x3a')]=_0x57baf6['attributes'][_0x725d('0x3b')]?_0x57baf6[_0x725d('0x3a')]:_0x529275['model'];if(_0x5b31bb[_0x725d('0x35')][_0x725d('0x47')]){_0x57baf6[_0x725d('0x4c')]=[{'all':!![]}];}_0x57baf6=_[_0x725d('0x43')]({},_0x57baf6,_0x5b31bb[_0x725d('0x45')]);return db[_0x725d('0x30')]['find'](_0x57baf6)[_0x725d('0x26')](handleEntityNotFound(_0x39c88a,null))[_0x725d('0x26')](respondWithResult(_0x39c88a,null))[_0x725d('0x49')](handleError(_0x39c88a,null));};exports[_0x725d('0x4d')]=function(_0x1945c5,_0x5c7c6c){return db[_0x725d('0x30')]['create'](_0x1945c5[_0x725d('0x4e')],{})['then'](function(_0x1066a2){var _0x39b79a=_0x1945c5[_0x725d('0x4f')][_0x725d('0x27')]({'plain':!![]});if(!_0x39b79a)throw new Error(_0x725d('0x50'));if(_0x39b79a['role']===_0x725d('0x4f')){var _0x1831a6=_0x1066a2[_0x725d('0x27')]({'plain':!![]});var _0x720608='CmContactHasItems';return db[_0x725d('0x51')][_0x725d('0x52')]({'where':{'name':_0x720608,'userProfileId':_0x39b79a[_0x725d('0x53')]},'raw':!![]})[_0x725d('0x26')](function(_0x3e0e01){if(_0x3e0e01&&_0x3e0e01[_0x725d('0x54')]===0x0){return db[_0x725d('0x55')][_0x725d('0x4d')]({'name':_0x1831a6[_0x725d('0x2c')],'resourceId':_0x1831a6['id'],'type':_0x3e0e01[_0x725d('0x2c')],'sectionId':_0x3e0e01['id']},{})[_0x725d('0x26')](function(){return _0x1066a2;});}else{return _0x1066a2;}})[_0x725d('0x49')](function(_0x3043f2){logger[_0x725d('0x2a')](_0x725d('0x56'),_0x3043f2);throw _0x3043f2;});}return _0x1066a2;})[_0x725d('0x26')](respondWithResult(_0x5c7c6c,0xc9))[_0x725d('0x49')](handleError(_0x5c7c6c,null));};exports[_0x725d('0x25')]=function(_0x50a3bb,_0x43ab6b){if(_0x50a3bb['body']['id']){delete _0x50a3bb['body']['id'];}return db[_0x725d('0x30')][_0x725d('0x52')]({'where':{'id':_0x50a3bb[_0x725d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x43ab6b,null))[_0x725d('0x26')](saveUpdates(_0x50a3bb['body'],null))[_0x725d('0x26')](respondWithResult(_0x43ab6b,null))[_0x725d('0x49')](handleError(_0x43ab6b,null));};exports['destroy']=function(_0x50ecb1,_0xbc183a){return db[_0x725d('0x30')][_0x725d('0x52')]({'where':{'id':_0x50ecb1[_0x725d('0x4b')]['id']}})[_0x725d('0x26')](handleEntityNotFound(_0xbc183a,null))[_0x725d('0x26')](removeEntity(_0xbc183a,null))['catch'](handleError(_0xbc183a,null));}; \ No newline at end of file +var _0xba69=['where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','CmContactHasItems','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../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','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','stack','name','send','index','map','CmContactHasItem','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort'];(function(_0x3892af,_0x2622d1){var _0x46fbba=function(_0x864792){while(--_0x864792){_0x3892af['push'](_0x3892af['shift']());}};_0x46fbba(++_0x2622d1);}(_0xba69,0xca));var _0x9ba6=function(_0x136113,_0x1477fc){_0x136113=_0x136113-0x0;var _0x38b20b=_0xba69[_0x136113];return _0x38b20b;};'use strict';var emlformat=require(_0x9ba6('0x0'));var rimraf=require(_0x9ba6('0x1'));var zipdir=require(_0x9ba6('0x2'));var jsonpatch=require(_0x9ba6('0x3'));var rp=require(_0x9ba6('0x4'));var moment=require(_0x9ba6('0x5'));var BPromise=require(_0x9ba6('0x6'));var Mustache=require(_0x9ba6('0x7'));var util=require(_0x9ba6('0x8'));var path=require(_0x9ba6('0x9'));var sox=require('sox');var csv=require(_0x9ba6('0xa'));var ejs=require(_0x9ba6('0xb'));var fs=require('fs');var fs_extra=require(_0x9ba6('0xc'));var _=require(_0x9ba6('0xd'));var squel=require(_0x9ba6('0xe'));var crypto=require(_0x9ba6('0xf'));var jsforce=require(_0x9ba6('0x10'));var deskjs=require(_0x9ba6('0x11'));var toCsv=require(_0x9ba6('0xa'));var querystring=require(_0x9ba6('0x12'));var Papa=require(_0x9ba6('0x13'));var Redis=require(_0x9ba6('0x14'));var authService=require(_0x9ba6('0x15'));var qs=require(_0x9ba6('0x16'));var as=require(_0x9ba6('0x17'));var hardwareService=require(_0x9ba6('0x18'));var logger=require(_0x9ba6('0x19'))(_0x9ba6('0x1a'));var utils=require(_0x9ba6('0x1b'));var config=require(_0x9ba6('0x1c'));var licenseUtil=require(_0x9ba6('0x1d'));var db=require(_0x9ba6('0x1e'))['db'];function respondWithStatusCode(_0x478b0b,_0x3ee6dd){_0x3ee6dd=_0x3ee6dd||0xcc;return function(_0x2cf87c){if(_0x2cf87c){return _0x478b0b[_0x9ba6('0x1f')](_0x3ee6dd);}return _0x478b0b[_0x9ba6('0x20')](_0x3ee6dd)[_0x9ba6('0x21')]();};}function respondWithResult(_0x508dd3,_0x2d288e){_0x2d288e=_0x2d288e||0xc8;return function(_0x3b0523){if(_0x3b0523){return _0x508dd3['status'](_0x2d288e)[_0x9ba6('0x22')](_0x3b0523);}};}function respondWithFilteredResult(_0x59b327,_0x4f7a59){return function(_0x4f671d){if(_0x4f671d){var _0x10f2d9=typeof _0x4f7a59[_0x9ba6('0x23')]==='undefined'&&typeof _0x4f7a59[_0x9ba6('0x24')]===_0x9ba6('0x25');var _0x3a8ea6=_0x4f671d[_0x9ba6('0x26')];var _0x58562f=_0x10f2d9?0x0:_0x4f7a59[_0x9ba6('0x23')];var _0x3f653a=_0x10f2d9?_0x4f671d['count']:_0x4f7a59['offset']+_0x4f7a59[_0x9ba6('0x24')];var _0x5be6e5;if(_0x3f653a>=_0x3a8ea6){_0x3f653a=_0x3a8ea6;_0x5be6e5=0xc8;}else{_0x5be6e5=0xce;}_0x59b327['status'](_0x5be6e5);return _0x59b327['set'](_0x9ba6('0x27'),_0x58562f+'-'+_0x3f653a+'/'+_0x3a8ea6)[_0x9ba6('0x22')](_0x4f671d);}return null;};}function patchUpdates(_0x4051e3){return function(_0x12aaec){try{jsonpatch[_0x9ba6('0x28')](_0x12aaec,_0x4051e3,!![]);}catch(_0x39e4e3){return BPromise[_0x9ba6('0x29')](_0x39e4e3);}return _0x12aaec[_0x9ba6('0x2a')]();};}function saveUpdates(_0x25799c,_0x15b302){return function(_0x12abe9){if(_0x12abe9){return _0x12abe9['update'](_0x25799c)[_0x9ba6('0x2b')](function(_0x5954aa){return _0x5954aa;});}return null;};}function removeEntity(_0x57b816,_0x53752f){return function(_0x4663cd){if(_0x4663cd){return _0x4663cd[_0x9ba6('0x2c')]()['then'](function(){var _0x5ee964=_0x4663cd[_0x9ba6('0x2d')]({'plain':!![]});var _0x349713='CmContactHasItems';return db[_0x9ba6('0x2e')][_0x9ba6('0x2c')]({'where':{'type':_0x349713,'resourceId':_0x5ee964['id']}})[_0x9ba6('0x2b')](function(){return _0x4663cd;});})[_0x9ba6('0x2b')](function(){_0x57b816[_0x9ba6('0x20')](0xcc)[_0x9ba6('0x21')]();});}};}function handleEntityNotFound(_0x59a69d,_0x21c75f){return function(_0x3fea4a){if(!_0x3fea4a){_0x59a69d[_0x9ba6('0x1f')](0x194);}return _0x3fea4a;};}function handleError(_0x4f2076,_0x44929f){_0x44929f=_0x44929f||0x1f4;return function(_0x46c341){logger['error'](_0x46c341[_0x9ba6('0x2f')]);if(_0x46c341['name']){delete _0x46c341[_0x9ba6('0x30')];}_0x4f2076[_0x9ba6('0x20')](_0x44929f)[_0x9ba6('0x31')](_0x46c341);};}exports[_0x9ba6('0x32')]=function(_0x308832,_0x50c1e8){var _0x5906ee={},_0x22a870={},_0x3787a9={'count':0x0,'rows':[]};var _0x189859=_[_0x9ba6('0x33')](db[_0x9ba6('0x34')][_0x9ba6('0x35')],function(_0x7ef045){return{'name':_0x7ef045[_0x9ba6('0x36')],'type':_0x7ef045[_0x9ba6('0x37')][_0x9ba6('0x38')]};});_0x22a870[_0x9ba6('0x39')]=_[_0x9ba6('0x33')](_0x189859,_0x9ba6('0x30'));_0x22a870[_0x9ba6('0x3a')]=_[_0x9ba6('0x3b')](_0x308832[_0x9ba6('0x3a')]);_0x22a870[_0x9ba6('0x3c')]=_[_0x9ba6('0x3d')](_0x22a870[_0x9ba6('0x39')],_0x22a870[_0x9ba6('0x3a')]);_0x5906ee[_0x9ba6('0x3e')]=_[_0x9ba6('0x3d')](_0x22a870[_0x9ba6('0x39')],qs[_0x9ba6('0x3f')](_0x308832['query'][_0x9ba6('0x3f')]));_0x5906ee['attributes']=_0x5906ee['attributes'][_0x9ba6('0x40')]?_0x5906ee[_0x9ba6('0x3e')]:_0x22a870['model'];if(!_0x308832[_0x9ba6('0x3a')][_0x9ba6('0x41')]('nolimit')){_0x5906ee[_0x9ba6('0x24')]=qs[_0x9ba6('0x24')](_0x308832['query']['limit']);_0x5906ee[_0x9ba6('0x23')]=qs[_0x9ba6('0x23')](_0x308832['query'][_0x9ba6('0x23')]);}_0x5906ee[_0x9ba6('0x42')]=qs['sort'](_0x308832[_0x9ba6('0x3a')][_0x9ba6('0x43')]);_0x5906ee[_0x9ba6('0x44')]=qs[_0x9ba6('0x3c')](_[_0x9ba6('0x45')](_0x308832[_0x9ba6('0x3a')],_0x22a870['filters']),_0x189859);if(_0x308832[_0x9ba6('0x3a')][_0x9ba6('0x46')]){_0x5906ee[_0x9ba6('0x44')]=_[_0x9ba6('0x47')](_0x5906ee[_0x9ba6('0x44')],{'$or':_[_0x9ba6('0x33')](_0x189859,function(_0x3df4f5){if(_0x3df4f5[_0x9ba6('0x37')]!==_0x9ba6('0x48')){var _0x70d412={};_0x70d412[_0x3df4f5[_0x9ba6('0x30')]]={'$like':'%'+_0x308832[_0x9ba6('0x3a')][_0x9ba6('0x46')]+'%'};return _0x70d412;}})});}_0x5906ee=_[_0x9ba6('0x47')]({},_0x5906ee,_0x308832[_0x9ba6('0x49')]);var _0x19f68b={'where':_0x5906ee[_0x9ba6('0x44')]};return db[_0x9ba6('0x34')][_0x9ba6('0x26')](_0x19f68b)[_0x9ba6('0x2b')](function(_0x2b4f15){_0x3787a9[_0x9ba6('0x26')]=_0x2b4f15;if(_0x308832[_0x9ba6('0x3a')][_0x9ba6('0x4a')]){_0x5906ee['include']=[{'all':!![]}];}return db[_0x9ba6('0x34')][_0x9ba6('0x4b')](_0x5906ee);})[_0x9ba6('0x2b')](function(_0x16ca61){_0x3787a9[_0x9ba6('0x4c')]=_0x16ca61;return _0x3787a9;})[_0x9ba6('0x2b')](respondWithFilteredResult(_0x50c1e8,_0x5906ee))[_0x9ba6('0x4d')](handleError(_0x50c1e8,null));};exports[_0x9ba6('0x4e')]=function(_0x28859f,_0x16ff18){var _0x22cd4d={'raw':!![],'where':{'id':_0x28859f[_0x9ba6('0x4f')]['id']}},_0x544484={};_0x544484[_0x9ba6('0x39')]=_['keys'](db[_0x9ba6('0x34')]['rawAttributes']);_0x544484['query']=_['keys'](_0x28859f[_0x9ba6('0x3a')]);_0x544484[_0x9ba6('0x3c')]=_[_0x9ba6('0x3d')](_0x544484['model'],_0x544484[_0x9ba6('0x3a')]);_0x22cd4d[_0x9ba6('0x3e')]=_['intersection'](_0x544484[_0x9ba6('0x39')],qs[_0x9ba6('0x3f')](_0x28859f[_0x9ba6('0x3a')][_0x9ba6('0x3f')]));_0x22cd4d[_0x9ba6('0x3e')]=_0x22cd4d[_0x9ba6('0x3e')][_0x9ba6('0x40')]?_0x22cd4d[_0x9ba6('0x3e')]:_0x544484[_0x9ba6('0x39')];if(_0x28859f[_0x9ba6('0x3a')][_0x9ba6('0x4a')]){_0x22cd4d['include']=[{'all':!![]}];}_0x22cd4d=_[_0x9ba6('0x47')]({},_0x22cd4d,_0x28859f[_0x9ba6('0x49')]);return db[_0x9ba6('0x34')][_0x9ba6('0x50')](_0x22cd4d)[_0x9ba6('0x2b')](handleEntityNotFound(_0x16ff18,null))[_0x9ba6('0x2b')](respondWithResult(_0x16ff18,null))[_0x9ba6('0x4d')](handleError(_0x16ff18,null));};exports['create']=function(_0x4dd698,_0x490687){return db[_0x9ba6('0x34')]['create'](_0x4dd698[_0x9ba6('0x51')],{})[_0x9ba6('0x2b')](function(_0x18f659){var _0x1c1c1a=_0x4dd698['user']['get']({'plain':!![]});if(!_0x1c1c1a)throw new Error(_0x9ba6('0x52'));if(_0x1c1c1a['role']===_0x9ba6('0x53')){var _0x2a4f74=_0x18f659[_0x9ba6('0x2d')]({'plain':!![]});var _0x1b9351=_0x9ba6('0x54');return db[_0x9ba6('0x55')][_0x9ba6('0x50')]({'where':{'name':_0x1b9351,'userProfileId':_0x1c1c1a[_0x9ba6('0x56')]},'raw':!![]})[_0x9ba6('0x2b')](function(_0x24370c){if(_0x24370c&&_0x24370c[_0x9ba6('0x57')]===0x0){return db[_0x9ba6('0x2e')]['create']({'name':_0x2a4f74[_0x9ba6('0x30')],'resourceId':_0x2a4f74['id'],'type':_0x24370c['name'],'sectionId':_0x24370c['id']},{})['then'](function(){return _0x18f659;});}else{return _0x18f659;}})[_0x9ba6('0x4d')](function(_0x31b076){logger[_0x9ba6('0x58')](_0x9ba6('0x59'),_0x31b076);throw _0x31b076;});}return _0x18f659;})[_0x9ba6('0x2b')](respondWithResult(_0x490687,0xc9))['catch'](handleError(_0x490687,null));};exports['update']=function(_0x1594fc,_0x5bc266){if(_0x1594fc[_0x9ba6('0x51')]['id']){delete _0x1594fc['body']['id'];}return db['CmContactHasItem']['find']({'where':{'id':_0x1594fc[_0x9ba6('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5bc266,null))['then'](saveUpdates(_0x1594fc[_0x9ba6('0x51')],null))[_0x9ba6('0x2b')](respondWithResult(_0x5bc266,null))[_0x9ba6('0x4d')](handleError(_0x5bc266,null));};exports[_0x9ba6('0x2c')]=function(_0x29e70a,_0xa4e103){return db[_0x9ba6('0x34')][_0x9ba6('0x50')]({'where':{'id':_0x29e70a[_0x9ba6('0x4f')]['id']}})[_0x9ba6('0x2b')](handleEntityNotFound(_0xa4e103,null))['then'](removeEntity(_0xa4e103,null))[_0x9ba6('0x4d')](handleError(_0xa4e103,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 3911342..c09fd70 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.model.js +++ b/server/api/cmContactHasItem/cmContactHasItem.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f75=['api','moment','request-promise','rimraf','../../config/environment','./cmContactHasItem.attributes','exports','define','cm_contact_has_items','lodash','../../config/logger'];(function(_0x19f048,_0x4fe3fa){var _0xda5df8=function(_0x2529dd){while(--_0x2529dd){_0x19f048['push'](_0x19f048['shift']());}};_0xda5df8(++_0x4fe3fa);}(_0x9f75,0x18a));var _0x59f7=function(_0x5e5cda,_0x3cc17b){_0x5e5cda=_0x5e5cda-0x0;var _0x4d314e=_0x9f75[_0x5e5cda];return _0x4d314e;};'use strict';var _=require(_0x59f7('0x0'));var util=require('util');var logger=require(_0x59f7('0x1'))(_0x59f7('0x2'));var moment=require(_0x59f7('0x3'));var BPromise=require('bluebird');var rp=require(_0x59f7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x59f7('0x5'));var config=require(_0x59f7('0x6'));var attributes=require(_0x59f7('0x7'));module[_0x59f7('0x8')]=function(_0x2ef3a0,_0x4f3b69){return _0x2ef3a0[_0x59f7('0x9')]('CmContactHasItem',attributes,{'tableName':_0x59f7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x609f=['define','CmContactHasItem','cm_contact_has_items','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x2ba4ed,_0x3fd1ed){var _0x5b27fc=function(_0xa2b1c){while(--_0xa2b1c){_0x2ba4ed['push'](_0x2ba4ed['shift']());}};_0x5b27fc(++_0x3fd1ed);}(_0x609f,0xe7));var _0xf609=function(_0x1d02f1,_0x43ad6d){_0x1d02f1=_0x1d02f1-0x0;var _0x26d7a0=_0x609f[_0x1d02f1];return _0x26d7a0;};'use strict';var _=require('lodash');var util=require(_0xf609('0x0'));var logger=require(_0xf609('0x1'))(_0xf609('0x2'));var moment=require(_0xf609('0x3'));var BPromise=require(_0xf609('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf609('0x5'));var rimraf=require(_0xf609('0x6'));var config=require(_0xf609('0x7'));var attributes=require('./cmContactHasItem.attributes');module[_0xf609('0x8')]=function(_0x11c72c,_0x5c8f14){return _0x11c72c[_0xf609('0x9')](_0xf609('0xa'),attributes,{'tableName':_0xf609('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index 22e47e4..63ff64e 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.rpc.js +++ b/server/api/cmContactHasItem/cmContactHasItem.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc096=['message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4ba604,_0x311d2d){var _0x35f9b1=function(_0xf3eac6){while(--_0xf3eac6){_0x4ba604['push'](_0x4ba604['shift']());}};_0x35f9b1(++_0x311d2d);}(_0xc096,0x10a));var _0x6c09=function(_0x428dbd,_0x30eeb5){_0x428dbd=_0x428dbd-0x0;var _0xc411d8=_0xc096[_0x428dbd];return _0xc411d8;};'use strict';var _=require(_0x6c09('0x0'));var util=require(_0x6c09('0x1'));var moment=require(_0x6c09('0x2'));var BPromise=require(_0x6c09('0x3'));var rs=require(_0x6c09('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6c09('0x5'))['db'];var utils=require(_0x6c09('0x6'));var logger=require(_0x6c09('0x7'))(_0x6c09('0x8'));var config=require('../../config/environment');var jayson=require(_0x6c09('0x9'));var client=jayson[_0x6c09('0xa')][_0x6c09('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x378251,_0x31e9a3,_0x2842b2){return new BPromise(function(_0x41dfdd,_0x2fe48a){return client['request'](_0x378251,_0x2842b2)[_0x6c09('0xc')](function(_0x17ece7){logger[_0x6c09('0xd')](_0x6c09('0xe'),_0x31e9a3,_0x6c09('0xf'));logger['debug'](_0x6c09('0x10'),_0x31e9a3,_0x6c09('0xf'),JSON[_0x6c09('0x11')](_0x17ece7));if(_0x17ece7[_0x6c09('0x12')]){if(_0x17ece7[_0x6c09('0x12')][_0x6c09('0x13')]===0x1f4){logger[_0x6c09('0x12')](_0x6c09('0xe'),_0x31e9a3,_0x17ece7[_0x6c09('0x12')][_0x6c09('0x14')]);return _0x2fe48a(_0x17ece7[_0x6c09('0x12')][_0x6c09('0x14')]);}logger['error'](_0x6c09('0xe'),_0x31e9a3,_0x17ece7[_0x6c09('0x12')][_0x6c09('0x14')]);return _0x41dfdd(_0x17ece7[_0x6c09('0x12')]['message']);}else{logger['info'](_0x6c09('0xe'),_0x31e9a3,_0x6c09('0xf'));_0x41dfdd(_0x17ece7[_0x6c09('0x15')]['message']);}})['catch'](function(_0xa6befb){logger[_0x6c09('0x12')](_0x6c09('0xe'),_0x31e9a3,_0xa6befb);_0x2fe48a(_0xa6befb);});});} \ No newline at end of file +var _0xea10=['CmContactHasItem,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x90853a,_0x53748c){var _0x14a49c=function(_0x313126){while(--_0x313126){_0x90853a['push'](_0x90853a['shift']());}};_0x14a49c(++_0x53748c);}(_0xea10,0xc2));var _0x0ea1=function(_0x24d475,_0x2385e8){_0x24d475=_0x24d475-0x0;var _0x117759=_0xea10[_0x24d475];return _0x117759;};'use strict';var _=require(_0x0ea1('0x0'));var util=require(_0x0ea1('0x1'));var moment=require(_0x0ea1('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0ea1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0ea1('0x4'));var logger=require(_0x0ea1('0x5'))(_0x0ea1('0x6'));var config=require(_0x0ea1('0x7'));var jayson=require(_0x0ea1('0x8'));var client=jayson[_0x0ea1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a9100,_0x4e3773,_0xef63c4){return new BPromise(function(_0x13e40b,_0x163ef1){return client[_0x0ea1('0xa')](_0x4a9100,_0xef63c4)[_0x0ea1('0xb')](function(_0xd8f611){logger[_0x0ea1('0xc')](_0x0ea1('0xd'),_0x4e3773,_0x0ea1('0xe'));logger[_0x0ea1('0xf')](_0x0ea1('0x10'),_0x4e3773,_0x0ea1('0xe'),JSON['stringify'](_0xd8f611));if(_0xd8f611['error']){if(_0xd8f611[_0x0ea1('0x11')][_0x0ea1('0x12')]===0x1f4){logger[_0x0ea1('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0x4e3773,_0xd8f611['error'][_0x0ea1('0x13')]);return _0x163ef1(_0xd8f611['error'][_0x0ea1('0x13')]);}logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x4e3773,_0xd8f611[_0x0ea1('0x11')][_0x0ea1('0x13')]);return _0x13e40b(_0xd8f611[_0x0ea1('0x11')][_0x0ea1('0x13')]);}else{logger[_0x0ea1('0xc')](_0x0ea1('0xd'),_0x4e3773,_0x0ea1('0xe'));_0x13e40b(_0xd8f611['result'][_0x0ea1('0x13')]);}})[_0x0ea1('0x14')](function(_0x2202ba){logger['error'](_0x0ea1('0xd'),_0x4e3773,_0x2202ba);_0x163ef1(_0x2202ba);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index e27e62c..ef455ad 100644 --- a/server/api/cmContactHasItem/index.js +++ b/server/api/cmContactHasItem/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb183=['show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated'];(function(_0x4f8c28,_0x4cab61){var _0x1a6806=function(_0x58aca2){while(--_0x58aca2){_0x4f8c28['push'](_0x4f8c28['shift']());}};_0x1a6806(++_0x4cab61);}(_0xb183,0xee));var _0x3b18=function(_0x3b30f7,_0xd9e199){_0x3b30f7=_0x3b30f7-0x0;var _0xdb71d2=_0xb183[_0x3b30f7];return _0xdb71d2;};'use strict';var multer=require(_0x3b18('0x0'));var util=require(_0x3b18('0x1'));var path=require(_0x3b18('0x2'));var timeout=require(_0x3b18('0x3'));var express=require(_0x3b18('0x4'));var router=express[_0x3b18('0x5')]();var fs_extra=require(_0x3b18('0x6'));var auth=require(_0x3b18('0x7'));var interaction=require(_0x3b18('0x8'));var config=require(_0x3b18('0x9'));var controller=require('./cmContactHasItem.controller');router[_0x3b18('0xa')]('/',auth['isAuthenticated'](),controller[_0x3b18('0xb')]);router[_0x3b18('0xa')](_0x3b18('0xc'),auth[_0x3b18('0xd')](),controller[_0x3b18('0xe')]);router[_0x3b18('0xf')]('/',auth['isAuthenticated'](),controller[_0x3b18('0x10')]);router[_0x3b18('0x11')]('/:id',auth[_0x3b18('0xd')](),controller[_0x3b18('0x12')]);router[_0x3b18('0x13')](_0x3b18('0xc'),auth['isAuthenticated'](),controller[_0x3b18('0x14')]);module['exports']=router; \ No newline at end of file +var _0x4208=['index','/:id','post','create','update','delete','destroy','exports','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','isAuthenticated'];(function(_0x5a5395,_0x5361f6){var _0x4da43d=function(_0x149941){while(--_0x149941){_0x5a5395['push'](_0x5a5395['shift']());}};_0x4da43d(++_0x5361f6);}(_0x4208,0x148));var _0x8420=function(_0x239f2e,_0x4c5c60){_0x239f2e=_0x239f2e-0x0;var _0x17dcf6=_0x4208[_0x239f2e];return _0x17dcf6;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8420('0x0'));var router=express[_0x8420('0x1')]();var fs_extra=require(_0x8420('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x8420('0x3'));var config=require(_0x8420('0x4'));var controller=require(_0x8420('0x5'));router[_0x8420('0x6')]('/',auth[_0x8420('0x7')](),controller[_0x8420('0x8')]);router[_0x8420('0x6')](_0x8420('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x8420('0xa')]('/',auth['isAuthenticated'](),controller[_0x8420('0xb')]);router['put'](_0x8420('0x9'),auth[_0x8420('0x7')](),controller[_0x8420('0xc')]);router[_0x8420('0xd')](_0x8420('0x9'),auth[_0x8420('0x7')](),controller[_0x8420('0xe')]);module[_0x8420('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index d0f406b..1864970 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 _0xcd66=['isArray','stringify','BOOLEAN','ENUM','lodash','exports','VIRTUAL','getDataValue','alias','STRING','setDataValue','name','TEXT','long','type','select','parse','values'];(function(_0x4a121b,_0x3a8bae){var _0x21969d=function(_0x31c2d8){while(--_0x31c2d8){_0x4a121b['push'](_0x4a121b['shift']());}};_0x21969d(++_0x3a8bae);}(_0xcd66,0x136));var _0x6cd6=function(_0x5c8f01,_0x2be120){_0x5c8f01=_0x5c8f01-0x0;var _0x3b3948=_0xcd66[_0x5c8f01];return _0x3b3948;};'use strict';var Sequelize=require('sequelize');var _=require(_0x6cd6('0x0'));module[_0x6cd6('0x1')]={'name':{'type':Sequelize[_0x6cd6('0x2')],'get':function(_0x4c66a9){return this[_0x6cd6('0x3')](_0x6cd6('0x4'));}},'alias':{'type':Sequelize[_0x6cd6('0x5')],'allowNull':![],'set':function(_0x518b07){this[_0x6cd6('0x6')](_0x6cd6('0x4'),_0x518b07?_0x518b07:this[_0x6cd6('0x3')](_0x6cd6('0x7')));}},'type':{'type':Sequelize[_0x6cd6('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0x6cd6('0x8')](_0x6cd6('0x9')),'get':function(){if(this['getDataValue'](_0x6cd6('0xa'))===_0x6cd6('0xb')){return JSON[_0x6cd6('0xc')](this[_0x6cd6('0x3')]('values'));}else{return this['getDataValue'](_0x6cd6('0xd'));}},'set':function(_0x16665d){if(Array[_0x6cd6('0xe')](_0x16665d)){this[_0x6cd6('0x6')](_0x6cd6('0xd'),JSON[_0x6cd6('0xf')](_0x16665d));}else{this[_0x6cd6('0x6')]('values',_0x16665d);}}},'required':{'type':Sequelize[_0x6cd6('0x10')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x6cd6('0x10')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x6cd6('0x11')]('voice')}}; \ No newline at end of file +var _0x53ad=['TEXT','select','parse','values','isArray','stringify','BOOLEAN','ENUM','voice','exports','getDataValue','alias','setDataValue','name'];(function(_0x1ed034,_0x5d495d){var _0x4a82b7=function(_0x348231){while(--_0x348231){_0x1ed034['push'](_0x1ed034['shift']());}};_0x4a82b7(++_0x5d495d);}(_0x53ad,0x1d7));var _0xd53a=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x53ad[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module[_0xd53a('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x581055){return this[_0xd53a('0x1')](_0xd53a('0x2'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x537c07){this[_0xd53a('0x3')](_0xd53a('0x2'),_0x537c07?_0x537c07:this[_0xd53a('0x1')](_0xd53a('0x4')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0xd53a('0x5')]('long'),'get':function(){if(this[_0xd53a('0x1')]('type')===_0xd53a('0x6')){return JSON[_0xd53a('0x7')](this[_0xd53a('0x1')](_0xd53a('0x8')));}else{return this[_0xd53a('0x1')](_0xd53a('0x8'));}},'set':function(_0x13bc99){if(Array[_0xd53a('0x9')](_0x13bc99)){this[_0xd53a('0x3')](_0xd53a('0x8'),JSON[_0xd53a('0xa')](_0x13bc99));}else{this[_0xd53a('0x3')]('values',_0x13bc99);}}},'required':{'type':Sequelize[_0xd53a('0xb')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xd53a('0xb')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xd53a('0xc')](_0xd53a('0xd'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 9530e96..a7cb215 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 _0xf604=['moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','reject','save','update','then','destroy','end','error','stack','name','send','map','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','query','filters','intersection','attributes','fields','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','length','find','catch','body','create','sequelize','Sequelize','text','number','INTEGER','switch','defaultValue','queryInterface','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf604,0x1a4));var _0x4f60=function(_0x170bba,_0x2be92f){_0x170bba=_0x170bba-0x0;var _0xa7c249=_0xf604[_0x170bba];return _0xa7c249;};'use strict';var emlformat=require(_0x4f60('0x0'));var rimraf=require(_0x4f60('0x1'));var zipdir=require(_0x4f60('0x2'));var jsonpatch=require(_0x4f60('0x3'));var rp=require(_0x4f60('0x4'));var moment=require(_0x4f60('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4f60('0x6'));var path=require(_0x4f60('0x7'));var sox=require(_0x4f60('0x8'));var csv=require(_0x4f60('0x9'));var ejs=require(_0x4f60('0xa'));var fs=require('fs');var fs_extra=require(_0x4f60('0xb'));var _=require(_0x4f60('0xc'));var squel=require('squel');var crypto=require(_0x4f60('0xd'));var jsforce=require(_0x4f60('0xe'));var deskjs=require(_0x4f60('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4f60('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4f60('0x11'));var as=require(_0x4f60('0x12'));var hardwareService=require(_0x4f60('0x13'));var logger=require(_0x4f60('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4f60('0x15'));var db=require(_0x4f60('0x16'))['db'];function respondWithStatusCode(_0x29712d,_0x2c9281){_0x2c9281=_0x2c9281||0xcc;return function(_0x4b919a){if(_0x4b919a){return _0x29712d[_0x4f60('0x17')](_0x2c9281);}return _0x29712d[_0x4f60('0x18')](_0x2c9281)['end']();};}function respondWithResult(_0x35d193,_0x239e47){_0x239e47=_0x239e47||0xc8;return function(_0x1f86cd){if(_0x1f86cd){return _0x35d193['status'](_0x239e47)[_0x4f60('0x19')](_0x1f86cd);}};}function respondWithFilteredResult(_0x243124,_0x5c35c6){return function(_0x241569){if(_0x241569){var _0xb34938=typeof _0x5c35c6[_0x4f60('0x1a')]===_0x4f60('0x1b')&&typeof _0x5c35c6['limit']===_0x4f60('0x1b');var _0x47d38d=_0x241569[_0x4f60('0x1c')];var _0x11fddd=_0xb34938?0x0:_0x5c35c6['offset'];var _0x2dd77b=_0xb34938?_0x241569[_0x4f60('0x1c')]:_0x5c35c6[_0x4f60('0x1a')]+_0x5c35c6['limit'];var _0x54bc19;if(_0x2dd77b>=_0x47d38d){_0x2dd77b=_0x47d38d;_0x54bc19=0xc8;}else{_0x54bc19=0xce;}_0x243124[_0x4f60('0x18')](_0x54bc19);return _0x243124['set']('Content-Range',_0x11fddd+'-'+_0x2dd77b+'/'+_0x47d38d)[_0x4f60('0x19')](_0x241569);}return null;};}function patchUpdates(_0xc2ba0f){return function(_0x4b8e54){try{jsonpatch['apply'](_0x4b8e54,_0xc2ba0f,!![]);}catch(_0x547407){return BPromise[_0x4f60('0x1d')](_0x547407);}return _0x4b8e54[_0x4f60('0x1e')]();};}function saveUpdates(_0xecb3f7,_0x54a7cd){return function(_0x430c73){if(_0x430c73){return _0x430c73[_0x4f60('0x1f')](_0xecb3f7)[_0x4f60('0x20')](function(_0x3c8a53){return _0x3c8a53;});}return null;};}function removeEntity(_0x2d3579,_0x3c8d78){return function(_0x15f7a9){if(_0x15f7a9){return _0x15f7a9[_0x4f60('0x21')]()[_0x4f60('0x20')](function(){_0x2d3579['status'](0xcc)[_0x4f60('0x22')]();});}};}function handleEntityNotFound(_0x5116e1,_0x1d8e6b){return function(_0x3b0e50){if(!_0x3b0e50){_0x5116e1['sendStatus'](0x194);}return _0x3b0e50;};}function handleError(_0xc7da86,_0x373585){_0x373585=_0x373585||0x1f4;return function(_0x3b5652){logger[_0x4f60('0x23')](_0x3b5652[_0x4f60('0x24')]);if(_0x3b5652[_0x4f60('0x25')]){delete _0x3b5652[_0x4f60('0x25')];}_0xc7da86[_0x4f60('0x18')](_0x373585)[_0x4f60('0x26')](_0x3b5652);};}exports['index']=function(_0x2c01ec,_0x123d51){var _0x1502c1={},_0x3c2d09={},_0x30cbd6={'count':0x0,'rows':[]};var _0x1d62d2=_[_0x4f60('0x27')](db[_0x4f60('0x28')][_0x4f60('0x29')],function(_0x2e1816){return{'name':_0x2e1816[_0x4f60('0x2a')],'type':_0x2e1816[_0x4f60('0x2b')][_0x4f60('0x2c')]};});_0x3c2d09[_0x4f60('0x2d')]=_[_0x4f60('0x2e')](_['map'](_0x1d62d2,'name'),['name']);_0x3c2d09[_0x4f60('0x2f')]=_['keys'](_0x2c01ec[_0x4f60('0x2f')]);_0x3c2d09[_0x4f60('0x30')]=_[_0x4f60('0x31')](_0x3c2d09[_0x4f60('0x2d')],_0x3c2d09[_0x4f60('0x2f')]);_0x1502c1[_0x4f60('0x32')]=_[_0x4f60('0x31')](_0x3c2d09[_0x4f60('0x2d')],qs['fields'](_0x2c01ec['query'][_0x4f60('0x33')]));_0x1502c1[_0x4f60('0x32')]=_0x1502c1[_0x4f60('0x32')]['length']?_0x1502c1[_0x4f60('0x32')]:_0x3c2d09[_0x4f60('0x2d')];if(!_0x2c01ec[_0x4f60('0x2f')]['hasOwnProperty'](_0x4f60('0x34'))){_0x1502c1[_0x4f60('0x35')]=qs[_0x4f60('0x35')](_0x2c01ec[_0x4f60('0x2f')][_0x4f60('0x35')]);_0x1502c1[_0x4f60('0x1a')]=qs['offset'](_0x2c01ec[_0x4f60('0x2f')][_0x4f60('0x1a')]);}_0x1502c1[_0x4f60('0x36')]=qs[_0x4f60('0x37')](_0x2c01ec['query']['sort']);_0x1502c1[_0x4f60('0x38')]=qs[_0x4f60('0x30')](_[_0x4f60('0x39')](_0x2c01ec[_0x4f60('0x2f')],_0x3c2d09[_0x4f60('0x30')]),_0x1d62d2);if(_0x2c01ec[_0x4f60('0x2f')][_0x4f60('0x3a')]){_0x1502c1[_0x4f60('0x38')]=_[_0x4f60('0x3b')](_0x1502c1[_0x4f60('0x38')],{'$or':_['map'](_0x1d62d2,function(_0x453ca4){if(_0x453ca4['type']!==_0x4f60('0x3c')){var _0x5add09={};_0x5add09[_0x453ca4[_0x4f60('0x25')]]={'$like':'%'+_0x2c01ec[_0x4f60('0x2f')][_0x4f60('0x3a')]+'%'};return _0x5add09;}})});}_0x1502c1=_[_0x4f60('0x3b')]({},_0x1502c1,_0x2c01ec[_0x4f60('0x3d')]);var _0x71af2e={'where':_0x1502c1[_0x4f60('0x38')]};return db['CmCustomField'][_0x4f60('0x1c')](_0x71af2e)[_0x4f60('0x20')](function(_0x5a7f86){_0x30cbd6[_0x4f60('0x1c')]=_0x5a7f86;if(_0x2c01ec[_0x4f60('0x2f')][_0x4f60('0x3e')]){_0x1502c1[_0x4f60('0x3f')]=[{'all':!![]}];}return db[_0x4f60('0x28')][_0x4f60('0x40')](_0x1502c1);})[_0x4f60('0x20')](function(_0x40c54e){_0x30cbd6[_0x4f60('0x41')]=_0x40c54e;return _0x30cbd6;})['then'](respondWithFilteredResult(_0x123d51,_0x1502c1))['catch'](handleError(_0x123d51,null));};exports[_0x4f60('0x42')]=function(_0x1e12a6,_0x345ea7){var _0x312fb4={'raw':!![],'where':{'id':_0x1e12a6[_0x4f60('0x43')]['id']}},_0x1c0bb6={};_0x1c0bb6['model']=_[_0x4f60('0x44')](db[_0x4f60('0x28')][_0x4f60('0x29')]);_0x1c0bb6['query']=_[_0x4f60('0x44')](_0x1e12a6['query']);_0x1c0bb6[_0x4f60('0x30')]=_['intersection'](_0x1c0bb6[_0x4f60('0x2d')],_0x1c0bb6[_0x4f60('0x2f')]);_0x312fb4[_0x4f60('0x32')]=_[_0x4f60('0x31')](_0x1c0bb6['model'],qs[_0x4f60('0x33')](_0x1e12a6[_0x4f60('0x2f')][_0x4f60('0x33')]));_0x312fb4[_0x4f60('0x32')]=_0x312fb4[_0x4f60('0x32')][_0x4f60('0x45')]?_0x312fb4[_0x4f60('0x32')]:_0x1c0bb6[_0x4f60('0x2d')];if(_0x1e12a6['query'][_0x4f60('0x3e')]){_0x312fb4[_0x4f60('0x3f')]=[{'all':!![]}];}_0x312fb4=_['merge']({},_0x312fb4,_0x1e12a6['options']);return db[_0x4f60('0x28')][_0x4f60('0x46')](_0x312fb4)[_0x4f60('0x20')](handleEntityNotFound(_0x345ea7,null))[_0x4f60('0x20')](respondWithResult(_0x345ea7,null))[_0x4f60('0x47')](handleError(_0x345ea7,null));};exports[_0x4f60('0x1f')]=function(_0x1b7805,_0x15449f){if(_0x1b7805[_0x4f60('0x48')]['id']){delete _0x1b7805[_0x4f60('0x48')]['id'];}return db[_0x4f60('0x28')][_0x4f60('0x46')]({'where':{'id':_0x1b7805[_0x4f60('0x43')]['id']}})[_0x4f60('0x20')](handleEntityNotFound(_0x15449f,null))[_0x4f60('0x20')](saveUpdates(_0x1b7805['body'],null))['then'](respondWithResult(_0x15449f,null))[_0x4f60('0x47')](handleError(_0x15449f,null));};exports[_0x4f60('0x21')]=function(_0x4c3aab,_0x486731){return db['CmCustomField'][_0x4f60('0x46')]({'where':{'id':_0x4c3aab['params']['id']}})['then'](handleEntityNotFound(_0x486731,null))[_0x4f60('0x20')](removeEntity(_0x486731,null))['catch'](handleError(_0x486731,null));};exports[_0x4f60('0x49')]=function(_0x3f9dc9,_0x105802){var _0x37763f;return db[_0x4f60('0x4a')]['transaction'](function(_0x5aaa1){return db[_0x4f60('0x28')][_0x4f60('0x49')](_0x3f9dc9[_0x4f60('0x48')],{'transaction':_0x5aaa1})[_0x4f60('0x20')](function(_0xfc85f0){_0x37763f=_0xfc85f0;var _0x7942a6={'type':db[_0x4f60('0x4b')]['TEXT'],'transaction':_0x5aaa1};switch(_0x3f9dc9[_0x4f60('0x48')][_0x4f60('0x2b')]){case _0x4f60('0x4c'):_0x7942a6['type']=db[_0x4f60('0x4b')]['TEXT'];break;case _0x4f60('0x4d'):_0x7942a6[_0x4f60('0x2b')]=db[_0x4f60('0x4b')][_0x4f60('0x4e')];break;case _0x4f60('0x4f'):_0x7942a6[_0x4f60('0x2b')]=db[_0x4f60('0x4b')]['BOOLEAN'];_0x7942a6[_0x4f60('0x50')]=![];break;default:}return db['sequelize'][_0x4f60('0x51')]['addColumn'](_0x4f60('0x52'),util[_0x4f60('0x53')](_0x4f60('0x54'),_0x37763f['id']),_0x7942a6);})['then'](function(){return _0x37763f;});})['then'](respondWithResult(_0x105802,0xc9))[_0x4f60('0x47')](handleError(_0x105802,null));}; \ No newline at end of file +var _0x82de=['apply','reject','save','destroy','error','stack','send','index','map','CmCustomField','rawAttributes','fieldName','type','model','differenceBy','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','include','findAll','rows','then','catch','show','keys','includeAll','find','update','body','params','create','sequelize','Sequelize','TEXT','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x26ee38,_0x49c88a){var _0xb431f5=function(_0x47cece){while(--_0x47cece){_0x26ee38['push'](_0x26ee38['shift']());}};_0xb431f5(++_0x49c88a);}(_0x82de,0x188));var _0xe82d=function(_0x44d34f,_0x4f98f9){_0x44d34f=_0x44d34f-0x0;var _0x2eb329=_0x82de[_0x44d34f];return _0x2eb329;};'use strict';var emlformat=require(_0xe82d('0x0'));var rimraf=require(_0xe82d('0x1'));var zipdir=require(_0xe82d('0x2'));var jsonpatch=require(_0xe82d('0x3'));var rp=require(_0xe82d('0x4'));var moment=require('moment');var BPromise=require(_0xe82d('0x5'));var Mustache=require(_0xe82d('0x6'));var util=require(_0xe82d('0x7'));var path=require(_0xe82d('0x8'));var sox=require('sox');var csv=require(_0xe82d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe82d('0xa'));var _=require('lodash');var squel=require(_0xe82d('0xb'));var crypto=require(_0xe82d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe82d('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe82d('0xe'));var Papa=require(_0xe82d('0xf'));var Redis=require(_0xe82d('0x10'));var authService=require(_0xe82d('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe82d('0x12'))(_0xe82d('0x13'));var utils=require('../../config/utils');var config=require(_0xe82d('0x14'));var licenseUtil=require(_0xe82d('0x15'));var db=require(_0xe82d('0x16'))['db'];function respondWithStatusCode(_0xe1c17b,_0x43cfde){_0x43cfde=_0x43cfde||0xcc;return function(_0x134aa2){if(_0x134aa2){return _0xe1c17b[_0xe82d('0x17')](_0x43cfde);}return _0xe1c17b[_0xe82d('0x18')](_0x43cfde)[_0xe82d('0x19')]();};}function respondWithResult(_0x4a5d9b,_0x455ba5){_0x455ba5=_0x455ba5||0xc8;return function(_0x5c84fd){if(_0x5c84fd){return _0x4a5d9b['status'](_0x455ba5)[_0xe82d('0x1a')](_0x5c84fd);}};}function respondWithFilteredResult(_0x47640e,_0x4c9d07){return function(_0x3ec040){if(_0x3ec040){var _0x256d19=typeof _0x4c9d07[_0xe82d('0x1b')]===_0xe82d('0x1c')&&typeof _0x4c9d07[_0xe82d('0x1d')]===_0xe82d('0x1c');var _0x51a851=_0x3ec040[_0xe82d('0x1e')];var _0x39dc70=_0x256d19?0x0:_0x4c9d07[_0xe82d('0x1b')];var _0x59e765=_0x256d19?_0x3ec040[_0xe82d('0x1e')]:_0x4c9d07[_0xe82d('0x1b')]+_0x4c9d07[_0xe82d('0x1d')];var _0x3c1161;if(_0x59e765>=_0x51a851){_0x59e765=_0x51a851;_0x3c1161=0xc8;}else{_0x3c1161=0xce;}_0x47640e[_0xe82d('0x18')](_0x3c1161);return _0x47640e[_0xe82d('0x1f')](_0xe82d('0x20'),_0x39dc70+'-'+_0x59e765+'/'+_0x51a851)['json'](_0x3ec040);}return null;};}function patchUpdates(_0x1777ed){return function(_0x16daa6){try{jsonpatch[_0xe82d('0x21')](_0x16daa6,_0x1777ed,!![]);}catch(_0x57e129){return BPromise[_0xe82d('0x22')](_0x57e129);}return _0x16daa6[_0xe82d('0x23')]();};}function saveUpdates(_0x286f13,_0x246c38){return function(_0x3ff12a){if(_0x3ff12a){return _0x3ff12a['update'](_0x286f13)['then'](function(_0x443aec){return _0x443aec;});}return null;};}function removeEntity(_0x3905a8,_0x1ebbb7){return function(_0x427edc){if(_0x427edc){return _0x427edc[_0xe82d('0x24')]()['then'](function(){_0x3905a8[_0xe82d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e857c,_0x48ebbb){return function(_0x41d5e0){if(!_0x41d5e0){_0x2e857c['sendStatus'](0x194);}return _0x41d5e0;};}function handleError(_0x3838cc,_0x927e01){_0x927e01=_0x927e01||0x1f4;return function(_0x2198e5){logger[_0xe82d('0x25')](_0x2198e5[_0xe82d('0x26')]);if(_0x2198e5['name']){delete _0x2198e5['name'];}_0x3838cc[_0xe82d('0x18')](_0x927e01)[_0xe82d('0x27')](_0x2198e5);};}exports[_0xe82d('0x28')]=function(_0x4c8d73,_0x50f2ad){var _0x187d9c={},_0x345f64={},_0x13fe9d={'count':0x0,'rows':[]};var _0x14d349=_[_0xe82d('0x29')](db[_0xe82d('0x2a')][_0xe82d('0x2b')],function(_0x208de3){return{'name':_0x208de3[_0xe82d('0x2c')],'type':_0x208de3[_0xe82d('0x2d')]['key']};});_0x345f64[_0xe82d('0x2e')]=_[_0xe82d('0x2f')](_[_0xe82d('0x29')](_0x14d349,_0xe82d('0x30')),['name']);_0x345f64[_0xe82d('0x31')]=_['keys'](_0x4c8d73[_0xe82d('0x31')]);_0x345f64[_0xe82d('0x32')]=_[_0xe82d('0x33')](_0x345f64[_0xe82d('0x2e')],_0x345f64[_0xe82d('0x31')]);_0x187d9c[_0xe82d('0x34')]=_[_0xe82d('0x33')](_0x345f64['model'],qs['fields'](_0x4c8d73[_0xe82d('0x31')][_0xe82d('0x35')]));_0x187d9c[_0xe82d('0x34')]=_0x187d9c[_0xe82d('0x34')][_0xe82d('0x36')]?_0x187d9c[_0xe82d('0x34')]:_0x345f64[_0xe82d('0x2e')];if(!_0x4c8d73[_0xe82d('0x31')][_0xe82d('0x37')](_0xe82d('0x38'))){_0x187d9c[_0xe82d('0x1d')]=qs[_0xe82d('0x1d')](_0x4c8d73[_0xe82d('0x31')][_0xe82d('0x1d')]);_0x187d9c[_0xe82d('0x1b')]=qs[_0xe82d('0x1b')](_0x4c8d73[_0xe82d('0x31')][_0xe82d('0x1b')]);}_0x187d9c['order']=qs[_0xe82d('0x39')](_0x4c8d73[_0xe82d('0x31')][_0xe82d('0x39')]);_0x187d9c[_0xe82d('0x3a')]=qs['filters'](_[_0xe82d('0x3b')](_0x4c8d73['query'],_0x345f64['filters']),_0x14d349);if(_0x4c8d73[_0xe82d('0x31')]['filter']){_0x187d9c[_0xe82d('0x3a')]=_[_0xe82d('0x3c')](_0x187d9c[_0xe82d('0x3a')],{'$or':_['map'](_0x14d349,function(_0x5a07eb){if(_0x5a07eb[_0xe82d('0x2d')]!=='VIRTUAL'){var _0x4f1f7a={};_0x4f1f7a[_0x5a07eb[_0xe82d('0x30')]]={'$like':'%'+_0x4c8d73['query']['filter']+'%'};return _0x4f1f7a;}})});}_0x187d9c=_[_0xe82d('0x3c')]({},_0x187d9c,_0x4c8d73['options']);var _0x485c2f={'where':_0x187d9c[_0xe82d('0x3a')]};return db['CmCustomField']['count'](_0x485c2f)['then'](function(_0x4b7cbb){_0x13fe9d['count']=_0x4b7cbb;if(_0x4c8d73[_0xe82d('0x31')]['includeAll']){_0x187d9c[_0xe82d('0x3d')]=[{'all':!![]}];}return db[_0xe82d('0x2a')][_0xe82d('0x3e')](_0x187d9c);})['then'](function(_0xea25eb){_0x13fe9d[_0xe82d('0x3f')]=_0xea25eb;return _0x13fe9d;})[_0xe82d('0x40')](respondWithFilteredResult(_0x50f2ad,_0x187d9c))[_0xe82d('0x41')](handleError(_0x50f2ad,null));};exports[_0xe82d('0x42')]=function(_0x7c01d7,_0x423b36){var _0x429da4={'raw':!![],'where':{'id':_0x7c01d7['params']['id']}},_0x4cfe07={};_0x4cfe07[_0xe82d('0x2e')]=_['keys'](db[_0xe82d('0x2a')][_0xe82d('0x2b')]);_0x4cfe07[_0xe82d('0x31')]=_[_0xe82d('0x43')](_0x7c01d7[_0xe82d('0x31')]);_0x4cfe07[_0xe82d('0x32')]=_['intersection'](_0x4cfe07[_0xe82d('0x2e')],_0x4cfe07[_0xe82d('0x31')]);_0x429da4[_0xe82d('0x34')]=_['intersection'](_0x4cfe07[_0xe82d('0x2e')],qs[_0xe82d('0x35')](_0x7c01d7[_0xe82d('0x31')][_0xe82d('0x35')]));_0x429da4[_0xe82d('0x34')]=_0x429da4['attributes']['length']?_0x429da4[_0xe82d('0x34')]:_0x4cfe07['model'];if(_0x7c01d7[_0xe82d('0x31')][_0xe82d('0x44')]){_0x429da4[_0xe82d('0x3d')]=[{'all':!![]}];}_0x429da4=_[_0xe82d('0x3c')]({},_0x429da4,_0x7c01d7['options']);return db[_0xe82d('0x2a')][_0xe82d('0x45')](_0x429da4)[_0xe82d('0x40')](handleEntityNotFound(_0x423b36,null))[_0xe82d('0x40')](respondWithResult(_0x423b36,null))[_0xe82d('0x41')](handleError(_0x423b36,null));};exports[_0xe82d('0x46')]=function(_0x3afdb8,_0x56dc89){if(_0x3afdb8[_0xe82d('0x47')]['id']){delete _0x3afdb8['body']['id'];}return db[_0xe82d('0x2a')][_0xe82d('0x45')]({'where':{'id':_0x3afdb8[_0xe82d('0x48')]['id']}})[_0xe82d('0x40')](handleEntityNotFound(_0x56dc89,null))['then'](saveUpdates(_0x3afdb8['body'],null))[_0xe82d('0x40')](respondWithResult(_0x56dc89,null))[_0xe82d('0x41')](handleError(_0x56dc89,null));};exports[_0xe82d('0x24')]=function(_0x30c136,_0x46860b){return db['CmCustomField'][_0xe82d('0x45')]({'where':{'id':_0x30c136[_0xe82d('0x48')]['id']}})['then'](handleEntityNotFound(_0x46860b,null))['then'](removeEntity(_0x46860b,null))[_0xe82d('0x41')](handleError(_0x46860b,null));};exports[_0xe82d('0x49')]=function(_0x15cb3b,_0x552b37){var _0x47e403;return db[_0xe82d('0x4a')]['transaction'](function(_0x141848){return db[_0xe82d('0x2a')][_0xe82d('0x49')](_0x15cb3b[_0xe82d('0x47')],{'transaction':_0x141848})['then'](function(_0x38844b){_0x47e403=_0x38844b;var _0x2c8e34={'type':db[_0xe82d('0x4b')][_0xe82d('0x4c')],'transaction':_0x141848};switch(_0x15cb3b[_0xe82d('0x47')][_0xe82d('0x2d')]){case'text':_0x2c8e34[_0xe82d('0x2d')]=db[_0xe82d('0x4b')][_0xe82d('0x4c')];break;case _0xe82d('0x4d'):_0x2c8e34[_0xe82d('0x2d')]=db[_0xe82d('0x4b')][_0xe82d('0x4e')];break;case'switch':_0x2c8e34['type']=db[_0xe82d('0x4b')][_0xe82d('0x4f')];_0x2c8e34[_0xe82d('0x50')]=![];break;default:}return db[_0xe82d('0x4a')][_0xe82d('0x51')][_0xe82d('0x52')](_0xe82d('0x53'),util[_0xe82d('0x54')]('cf_%d',_0x47e403['id']),_0x2c8e34);})[_0xe82d('0x40')](function(){return _0x47e403;});})[_0xe82d('0x40')](respondWithResult(_0x552b37,0xc9))[_0xe82d('0x41')](handleError(_0x552b37,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index b014951..5dba9e8 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 _0x9ddf=['api','moment','request-promise','path','../../config/environment','exports','define','CmCustomField','cm_custom_fields','lodash','util'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0x9ddf,0x174));var _0xf9dd=function(_0x1d537f,_0x1c479c){_0x1d537f=_0x1d537f-0x0;var _0x4cfd45=_0x9ddf[_0x1d537f];return _0x4cfd45;};'use strict';var _=require(_0xf9dd('0x0'));var util=require(_0xf9dd('0x1'));var logger=require('../../config/logger')(_0xf9dd('0x2'));var moment=require(_0xf9dd('0x3'));var BPromise=require('bluebird');var rp=require(_0xf9dd('0x4'));var fs=require('fs');var path=require(_0xf9dd('0x5'));var rimraf=require('rimraf');var config=require(_0xf9dd('0x6'));var attributes=require('./cmCustomField.attributes');module[_0xf9dd('0x7')]=function(_0x44f2a6,_0x9d19b2){return _0x44f2a6[_0xf9dd('0x8')](_0xf9dd('0x9'),attributes,{'tableName':_0xf9dd('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x956c=['api','moment','bluebird','rimraf','util','../../config/logger'];(function(_0x2315ef,_0x4c6c5f){var _0x267c21=function(_0x578af1){while(--_0x578af1){_0x2315ef['push'](_0x2315ef['shift']());}};_0x267c21(++_0x4c6c5f);}(_0x956c,0x118));var _0xc956=function(_0x1f79e2,_0x274923){_0x1f79e2=_0x1f79e2-0x0;var _0x134175=_0x956c[_0x1f79e2];return _0x134175;};'use strict';var _=require('lodash');var util=require(_0xc956('0x0'));var logger=require(_0xc956('0x1'))(_0xc956('0x2'));var moment=require(_0xc956('0x3'));var BPromise=require(_0xc956('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc956('0x5'));var config=require('../../config/environment');var attributes=require('./cmCustomField.attributes');module['exports']=function(_0x39e870,_0x57a726){return _0x39e870['define']('CmCustomField',attributes,{'tableName':'cm_custom_fields','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 502e4da..59df747 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 _0x1598=['http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x1598,0x137));var _0x8159=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1598[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x8159('0x0'));var util=require(_0x8159('0x1'));var moment=require('moment');var BPromise=require(_0x8159('0x2'));var rs=require(_0x8159('0x3'));var fs=require('fs');var Redis=require(_0x8159('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8159('0x5'));var logger=require(_0x8159('0x6'))('rpc');var config=require(_0x8159('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8159('0x8')][_0x8159('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27d96e,_0x3d54a1,_0x2444cd){return new BPromise(function(_0x48bc2f,_0x528f91){return client[_0x8159('0xa')](_0x27d96e,_0x2444cd)[_0x8159('0xb')](function(_0xe9e48c){logger[_0x8159('0xc')](_0x8159('0xd'),_0x3d54a1,_0x8159('0xe'));logger['debug'](_0x8159('0xf'),_0x3d54a1,_0x8159('0xe'),JSON['stringify'](_0xe9e48c));if(_0xe9e48c[_0x8159('0x10')]){if(_0xe9e48c[_0x8159('0x10')][_0x8159('0x11')]===0x1f4){logger[_0x8159('0x10')](_0x8159('0xd'),_0x3d54a1,_0xe9e48c[_0x8159('0x10')][_0x8159('0x12')]);return _0x528f91(_0xe9e48c[_0x8159('0x10')][_0x8159('0x12')]);}logger['error'](_0x8159('0xd'),_0x3d54a1,_0xe9e48c['error']['message']);return _0x48bc2f(_0xe9e48c['error'][_0x8159('0x12')]);}else{logger[_0x8159('0xc')](_0x8159('0xd'),_0x3d54a1,_0x8159('0xe'));_0x48bc2f(_0xe9e48c['result'][_0x8159('0x12')]);}})[_0x8159('0x13')](function(_0x19bd2b){logger[_0x8159('0x10')](_0x8159('0xd'),_0x3d54a1,_0x19bd2b);_0x528f91(_0x19bd2b);});});} \ No newline at end of file +var _0xa5dd=['code','error','message','info','request\x20sent','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','CmCustomField,\x20%s,\x20%s','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xa5dd,0x177));var _0xda5d=function(_0x138173,_0x3e81bd){_0x138173=_0x138173-0x0;var _0x1e6b05=_0xa5dd[_0x138173];return _0x1e6b05;};'use strict';var _=require(_0xda5d('0x0'));var util=require(_0xda5d('0x1'));var moment=require('moment');var BPromise=require(_0xda5d('0x2'));var rs=require(_0xda5d('0x3'));var fs=require('fs');var Redis=require(_0xda5d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xda5d('0x5'));var logger=require(_0xda5d('0x6'))(_0xda5d('0x7'));var config=require(_0xda5d('0x8'));var jayson=require(_0xda5d('0x9'));var client=jayson['client'][_0xda5d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5651b2,_0x3724bb,_0x1d9c0f){return new BPromise(function(_0x53ca5f,_0x547373){return client['request'](_0x5651b2,_0x1d9c0f)[_0xda5d('0xb')](function(_0x58346b){logger['info'](_0xda5d('0xc'),_0x3724bb,'request\x20sent');logger[_0xda5d('0xd')](_0xda5d('0xe'),_0x3724bb,'request\x20sent',JSON[_0xda5d('0xf')](_0x58346b));if(_0x58346b['error']){if(_0x58346b['error'][_0xda5d('0x10')]===0x1f4){logger['error'](_0xda5d('0xc'),_0x3724bb,_0x58346b[_0xda5d('0x11')][_0xda5d('0x12')]);return _0x547373(_0x58346b[_0xda5d('0x11')][_0xda5d('0x12')]);}logger[_0xda5d('0x11')](_0xda5d('0xc'),_0x3724bb,_0x58346b[_0xda5d('0x11')]['message']);return _0x53ca5f(_0x58346b['error'][_0xda5d('0x12')]);}else{logger[_0xda5d('0x13')](_0xda5d('0xc'),_0x3724bb,_0xda5d('0x14'));_0x53ca5f(_0x58346b[_0xda5d('0x15')][_0xda5d('0x12')]);}})[_0xda5d('0x16')](function(_0x4adcde){logger[_0xda5d('0x11')](_0xda5d('0xc'),_0x3724bb,_0x4adcde);_0x547373(_0x4adcde);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 07c58f7..14d8088 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 _0x0650=['../../config/environment','./cmCustomField.controller','index','post','create','put','isAuthenticated','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service'];(function(_0x24e23d,_0x26684a){var _0x14db43=function(_0x23ff5a){while(--_0x23ff5a){_0x24e23d['push'](_0x24e23d['shift']());}};_0x14db43(++_0x26684a);}(_0x0650,0x1aa));var _0x0065=function(_0x12916b,_0x3ba82d){_0x12916b=_0x12916b-0x0;var _0x58d533=_0x0650[_0x12916b];return _0x58d533;};'use strict';var multer=require(_0x0065('0x0'));var util=require(_0x0065('0x1'));var path=require(_0x0065('0x2'));var timeout=require(_0x0065('0x3'));var express=require('express');var router=express[_0x0065('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0065('0x5'));var config=require(_0x0065('0x6'));var controller=require(_0x0065('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x0065('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x0065('0x9')]('/',auth['isAuthenticated'](),controller[_0x0065('0xa')]);router[_0x0065('0xb')]('/:id',auth[_0x0065('0xc')](),controller[_0x0065('0xd')]);router['delete']('/:id',auth[_0x0065('0xc')](),controller[_0x0065('0xe')]);module[_0x0065('0xf')]=router; \ No newline at end of file +var _0x3981=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','/:id','post','create','put','delete','destroy'];(function(_0x4ae21f,_0x39e5b2){var _0x443e10=function(_0x368c40){while(--_0x368c40){_0x4ae21f['push'](_0x4ae21f['shift']());}};_0x443e10(++_0x39e5b2);}(_0x3981,0x144));var _0x1398=function(_0x3ac4c4,_0x591377){_0x3ac4c4=_0x3ac4c4-0x0;var _0x15b1bb=_0x3981[_0x3ac4c4];return _0x15b1bb;};'use strict';var multer=require(_0x1398('0x0'));var util=require('util');var path=require(_0x1398('0x1'));var timeout=require(_0x1398('0x2'));var express=require(_0x1398('0x3'));var router=express[_0x1398('0x4')]();var fs_extra=require(_0x1398('0x5'));var auth=require(_0x1398('0x6'));var interaction=require(_0x1398('0x7'));var config=require(_0x1398('0x8'));var controller=require(_0x1398('0x9'));router[_0x1398('0xa')]('/',auth[_0x1398('0xb')](),controller['index']);router[_0x1398('0xa')](_0x1398('0xc'),auth[_0x1398('0xb')](),controller['show']);router[_0x1398('0xd')]('/',auth[_0x1398('0xb')](),controller[_0x1398('0xe')]);router[_0x1398('0xf')](_0x1398('0xc'),auth[_0x1398('0xb')](),controller['update']);router[_0x1398('0x10')](_0x1398('0xc'),auth[_0x1398('0xb')](),controller[_0x1398('0x11')]);module[_0x1398('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 39613ac..bbd6cb6 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 _0x2b69=['format','INTEGER','contactListQueue','moment','exports','STRING','BOOLEAN','DATE'];(function(_0xd1c5f5,_0x2a260a){var _0x457f2a=function(_0x5f792f){while(--_0x5f792f){_0xd1c5f5['push'](_0xd1c5f5['shift']());}};_0x457f2a(++_0x2a260a);}(_0x2b69,0x163));var _0x92b6=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x2b69[_0x279d37];return _0x530173;};'use strict';var moment=require(_0x92b6('0x0'));var Sequelize=require('sequelize');module[_0x92b6('0x1')]={'phone':{'type':Sequelize[_0x92b6('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x92b6('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x92b6('0x4')],'defaultValue':moment()[_0x92b6('0x5')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x92b6('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x92b6('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x92b6('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0x92b6('0x6')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x92b6('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x92b6('0x6')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x92b6('0x6')],'unique':_0x92b6('0x7')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0x92b6('0x6')],'unique':_0x92b6('0x7')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x92b6('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x92b6('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x92b6('0x6')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x92b6('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x92b6('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0x92b6('0x4')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0xd77c=['DATE','UNSIGNED','contactListQueue','moment','exports','STRING','BOOLEAN','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER'];(function(_0xe7cb59,_0x2fefb7){var _0x431b30=function(_0x4752aa){while(--_0x4752aa){_0xe7cb59['push'](_0xe7cb59['shift']());}};_0x431b30(++_0x2fefb7);}(_0xd77c,0x67));var _0xcd77=function(_0x463c10,_0x1b46f0){_0x463c10=_0x463c10-0x0;var _0x2bb343=_0xd77c[_0x463c10];return _0x2bb343;};'use strict';var moment=require(_0xcd77('0x0'));var Sequelize=require('sequelize');module[_0xcd77('0x1')]={'phone':{'type':Sequelize[_0xcd77('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0xcd77('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0xcd77('0x4')](_0xcd77('0x5'))},'countbusyretry':{'type':Sequelize[_0xcd77('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xcd77('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xcd77('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xcd77('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xcd77('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xcd77('0x7')]},'priority':{'type':Sequelize[_0xcd77('0x6')](0x2)[_0xcd77('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xcd77('0x9')},'ListId':{'type':Sequelize[_0xcd77('0x6')],'unique':_0xcd77('0x9')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0xcd77('0x6')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0xcd77('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0xcd77('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xcd77('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xcd77('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xcd77('0x6')],'defaultValue':0x0},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xcd77('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0xcd77('0x7')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 506a15d..2ce216d 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 _0xa630=['CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','campaign','membername','user','deleted','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','ivr','CmContact','lastName','isNil','firstName','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','getPreview','getVoiceQueues','outbound','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','LOCK','Contact','Company','CmList','Queue','dialActive','getPreviewRecall','UPDATE','CmCompany','List','getOpenContacts','preview','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','push','utcOffset','getTimezone','timezones','moment','lodash','api','../../mysqldb','status','json','offset','undefined','limit','count','set','then','sendStatus','error','name','send','index','map','CmHopper','fieldName','key','query','keys','filters','model','concat','$and','$or','$gt','$eq','$notBetween','$in','$notIn','$like','$iLike','$notILike','$contains','$contained','$any','attributes','intersection','fields','length','hasOwnProperty','sort','where','filter','type','VIRTUAL','merge','includeAll','include','findAll','catch','show','params','rawAttributes','options','find','create','body','update','describe','VoiceQueueId'];(function(_0x2553f2,_0x4bdaea){var _0x15d61d=function(_0x5d23ea){while(--_0x5d23ea){_0x2553f2['push'](_0x2553f2['shift']());}};_0x15d61d(++_0x4bdaea);}(_0xa630,0xbe));var _0x0a63=function(_0x5478ca,_0x3ae2b2){_0x5478ca=_0x5478ca-0x0;var _0x50c4e5=_0xa630[_0x5478ca];return _0x50c4e5;};'use strict';var moment=require(_0x0a63('0x0'));var _=require(_0x0a63('0x1'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x0a63('0x2'));var shared=require('../../config/environment');var db=require(_0x0a63('0x3'))['db'];function respondWithResult(_0x506b55,_0x91a747){_0x91a747=_0x91a747||0xc8;return function(_0x3bcb90){if(_0x3bcb90){return _0x506b55[_0x0a63('0x4')](_0x91a747)[_0x0a63('0x5')](_0x3bcb90);}};}function respondWithFilteredResult(_0x37b4c9,_0x4b7474){return function(_0x2760b0){if(_0x2760b0){var _0x3d5f0b=typeof _0x4b7474[_0x0a63('0x6')]===_0x0a63('0x7')&&typeof _0x4b7474[_0x0a63('0x8')]===_0x0a63('0x7');var _0x501a82=_0x2760b0[_0x0a63('0x9')];var _0xb714c7=_0x3d5f0b?0x0:_0x4b7474[_0x0a63('0x6')];var _0x218142=_0x3d5f0b?_0x2760b0[_0x0a63('0x9')]:_0x4b7474[_0x0a63('0x6')]+_0x4b7474[_0x0a63('0x8')];var _0x22f340;if(_0x218142>=_0x501a82){_0x218142=_0x501a82;_0x22f340=0xc8;}else{_0x22f340=0xce;}_0x37b4c9[_0x0a63('0x4')](_0x22f340);return _0x37b4c9[_0x0a63('0xa')]('Content-Range',_0xb714c7+'-'+_0x218142+'/'+_0x501a82)[_0x0a63('0x5')](_0x2760b0);}return null;};}function saveUpdates(_0x420043,_0x2fce86){return function(_0x3d6323){if(_0x3d6323){return _0x3d6323['update'](_0x420043)[_0x0a63('0xb')](function(_0x4d68c0){return _0x4d68c0;});}return null;};}function handleEntityNotFound(_0x331e99,_0x19e922){return function(_0x26b2bc){if(!_0x26b2bc){_0x331e99[_0x0a63('0xc')](0x194);}return _0x26b2bc;};}function handleError(_0x3ea3bb,_0x23b49d){_0x23b49d=_0x23b49d||0x1f4;return function(_0x552b1f){logger[_0x0a63('0xd')](_0x552b1f['stack']);if(_0x552b1f[_0x0a63('0xe')]){delete _0x552b1f['name'];}_0x3ea3bb[_0x0a63('0x4')](_0x23b49d)[_0x0a63('0xf')](_0x552b1f);};}exports[_0x0a63('0x10')]=function(_0x221f07,_0x1f7481){var _0x181507={},_0x30f292={},_0x374c52={'count':0x0,'rows':[]};var _0x2fd06c=_[_0x0a63('0x11')](db[_0x0a63('0x12')]['rawAttributes'],function(_0x550568){return{'name':_0x550568[_0x0a63('0x13')],'type':_0x550568['type'][_0x0a63('0x14')]};});_0x30f292['model']=_[_0x0a63('0x11')](_0x2fd06c,_0x0a63('0xe'));_0x30f292[_0x0a63('0x15')]=_[_0x0a63('0x16')](_0x221f07['query']);_0x30f292[_0x0a63('0x17')]=_['intersection'](_0x30f292[_0x0a63('0x18')],_0x30f292[_0x0a63('0x15')]);_0x30f292[_0x0a63('0x17')]=_[_0x0a63('0x19')](_0x30f292[_0x0a63('0x17')],[_0x0a63('0x1a'),_0x0a63('0x1b'),_0x0a63('0x1c'),'$gte','$lt','$lte','$ne',_0x0a63('0x1d'),'$not','$between',_0x0a63('0x1e'),_0x0a63('0x1f'),_0x0a63('0x20'),_0x0a63('0x21'),'$notLike',_0x0a63('0x22'),_0x0a63('0x23'),_0x0a63('0x21'),'$overlap',_0x0a63('0x24'),_0x0a63('0x25'),_0x0a63('0x26')]);_0x181507[_0x0a63('0x27')]=_[_0x0a63('0x28')](_0x30f292[_0x0a63('0x18')],qs[_0x0a63('0x29')](_0x221f07[_0x0a63('0x15')]['fields']));_0x181507[_0x0a63('0x27')]=_0x181507['attributes'][_0x0a63('0x2a')]?_0x181507[_0x0a63('0x27')]:_0x30f292[_0x0a63('0x18')];if(!_0x221f07[_0x0a63('0x15')][_0x0a63('0x2b')]('nolimit')){_0x181507[_0x0a63('0x8')]=qs[_0x0a63('0x8')](_0x221f07[_0x0a63('0x15')][_0x0a63('0x8')]);_0x181507['offset']=qs[_0x0a63('0x6')](_0x221f07[_0x0a63('0x15')]['offset']);}_0x181507['order']=qs[_0x0a63('0x2c')](_0x221f07['query']['sort']);_0x181507[_0x0a63('0x2d')]=qs[_0x0a63('0x17')](_['pick'](_0x221f07[_0x0a63('0x15')],_0x30f292[_0x0a63('0x17')]),_0x2fd06c);if(_0x221f07[_0x0a63('0x15')][_0x0a63('0x2e')]){_0x181507[_0x0a63('0x2d')]=_['merge'](_0x181507['where'],{'$or':_[_0x0a63('0x11')](_0x2fd06c,function(_0x15429e){if(_0x15429e[_0x0a63('0x2f')]!==_0x0a63('0x30')){var _0x1c43fc={};_0x1c43fc[_0x15429e[_0x0a63('0xe')]]={'$like':'%'+_0x221f07['query'][_0x0a63('0x2e')]+'%'};return _0x1c43fc;}})});}_0x181507=_[_0x0a63('0x31')]({},_0x181507,_0x221f07['options']);var _0xf9c6ea={'where':_0x181507['where']};return db['CmHopper'][_0x0a63('0x9')](_0xf9c6ea)[_0x0a63('0xb')](function(_0xdc602c){_0x374c52['count']=_0xdc602c;if(_0x221f07[_0x0a63('0x15')][_0x0a63('0x32')]){_0x181507[_0x0a63('0x33')]=[{'all':!![]}];}return db[_0x0a63('0x12')][_0x0a63('0x34')](_0x181507);})[_0x0a63('0xb')](function(_0x604a45){_0x374c52['rows']=_0x604a45;return _0x374c52;})[_0x0a63('0xb')](respondWithFilteredResult(_0x1f7481,_0x181507))[_0x0a63('0x35')](handleError(_0x1f7481,null));};exports[_0x0a63('0x36')]=function(_0x53d034,_0x5d9952){var _0x28f904={'raw':!![],'where':{'id':_0x53d034[_0x0a63('0x37')]['id']}},_0x4e877c={};_0x4e877c[_0x0a63('0x18')]=_[_0x0a63('0x16')](db['CmHopper'][_0x0a63('0x38')]);_0x4e877c[_0x0a63('0x15')]=_[_0x0a63('0x16')](_0x53d034[_0x0a63('0x15')]);_0x4e877c['filters']=_[_0x0a63('0x28')](_0x4e877c[_0x0a63('0x18')],_0x4e877c[_0x0a63('0x15')]);_0x28f904[_0x0a63('0x27')]=_[_0x0a63('0x28')](_0x4e877c[_0x0a63('0x18')],qs['fields'](_0x53d034[_0x0a63('0x15')][_0x0a63('0x29')]));_0x28f904[_0x0a63('0x27')]=_0x28f904[_0x0a63('0x27')][_0x0a63('0x2a')]?_0x28f904[_0x0a63('0x27')]:_0x4e877c[_0x0a63('0x18')];if(_0x53d034[_0x0a63('0x15')][_0x0a63('0x32')]){_0x28f904[_0x0a63('0x33')]=[{'all':!![]}];}_0x28f904=_[_0x0a63('0x31')]({},_0x28f904,_0x53d034[_0x0a63('0x39')]);return db[_0x0a63('0x12')][_0x0a63('0x3a')](_0x28f904)[_0x0a63('0xb')](handleEntityNotFound(_0x5d9952,null))[_0x0a63('0xb')](respondWithResult(_0x5d9952,null))[_0x0a63('0x35')](handleError(_0x5d9952,null));};exports[_0x0a63('0x3b')]=function(_0x4847ae,_0x39295c){return db['CmHopper']['create'](_0x4847ae[_0x0a63('0x3c')],{})[_0x0a63('0xb')](respondWithResult(_0x39295c,0xc9))[_0x0a63('0x35')](handleError(_0x39295c,null));};exports[_0x0a63('0x3d')]=function(_0xd9149d,_0x9c89ed){if(_0xd9149d[_0x0a63('0x3c')]['id']){delete _0xd9149d[_0x0a63('0x3c')]['id'];}return db[_0x0a63('0x12')][_0x0a63('0x3a')]({'where':{'id':_0xd9149d[_0x0a63('0x37')]['id']}})[_0x0a63('0xb')](handleEntityNotFound(_0x9c89ed,null))[_0x0a63('0xb')](saveUpdates(_0xd9149d[_0x0a63('0x3c')],null))[_0x0a63('0xb')](respondWithResult(_0x9c89ed,null))[_0x0a63('0x35')](handleError(_0x9c89ed,null));};exports[_0x0a63('0x3e')]=function(_0x20b864,_0x366887){return db[_0x0a63('0x12')]['describe']()[_0x0a63('0xb')](respondWithResult(_0x366887,null))[_0x0a63('0x35')](handleError(_0x366887,null));};exports['destroy']=function(_0x511b0f,_0x58e686){var _0x485f20;var _0x36d066=_0x511b0f[_0x0a63('0x37')]['id'];return db['CmHopper'][_0x0a63('0x3a')]({'where':{'id':_0x511b0f['params']['id']}})[_0x0a63('0xb')](handleEntityNotFound(_0x58e686,null))[_0x0a63('0xb')](function(_0x4c6440){if(_0x4c6440){return _0x4c6440['destroy']()['then'](function(_0x28bfd8){return _0x28bfd8;});}})[_0x0a63('0xb')](function(_0x246d03){_0x485f20=_0x246d03;if(_0x246d03){if(_0x246d03[_0x0a63('0x3f')]||_0x246d03[_0x0a63('0x40')]){return db[_0x246d03['VoiceQueueId']?_0x0a63('0x41'):_0x0a63('0x42')][_0x0a63('0x3a')]({'where':{'id':_0x246d03[_0x0a63('0x3f')]?_0x246d03[_0x0a63('0x3f')]:_0x246d03['CampaignId']},'attributes':['id',_0x0a63('0xe')],'raw':!![]});}}})[_0x0a63('0xb')](function(_0x393996){var _0x1fbd2b={};if(_0x393996){_['merge'](_0x1fbd2b,_[_0x0a63('0x43')](_0x485f20[_0x0a63('0x44')],[_0x0a63('0x45'),_0x0a63('0x46'),'id']));_0x1fbd2b[_0x0a63('0x47')]=0x15;_0x1fbd2b[_0x0a63('0x48')]='deleted';_0x1fbd2b[_0x0a63('0x49')]=_0x393996[_0x0a63('0xe')];_0x1fbd2b[_0x0a63('0x4a')]=_0x511b0f[_0x0a63('0x4b')]['name'];_0x1fbd2b['UserId']=_0x511b0f[_0x0a63('0x4b')]['id'];_0x1fbd2b[_0x0a63('0x4c')]=!![];_0x1fbd2b[_0x0a63('0x4d')]=moment()[_0x0a63('0x4e')](_0x0a63('0x4f'));_0x1fbd2b['calleridnum']=_0x485f20['phone'];_0x1fbd2b['campaigntype']=_0x485f20[_0x0a63('0x3f')]?'queue':_0x0a63('0x50');return db[_0x0a63('0x51')][_0x0a63('0x3a')]({'where':{'id':_0x1fbd2b['ContactId']},'attributes':['firstName',_0x0a63('0x52')]})[_0x0a63('0xb')](function(_0x1cb960){if(!_[_0x0a63('0x53')](_0x58e686)&&!_[_0x0a63('0x53')](_0x1cb960[_0x0a63('0x54')])){_0x1fbd2b[_0x0a63('0x55')]=_0x1cb960[_0x0a63('0x54')];if(!_[_0x0a63('0x53')](_0x1cb960[_0x0a63('0x52')])){_0x1fbd2b[_0x0a63('0x55')]+='\x20'+_0x1cb960[_0x0a63('0x52')];}}})[_0x0a63('0x56')](function(){return db[_0x0a63('0x57')]['create'](_0x1fbd2b);});}})['then'](function(_0x1adea6){return db[_0x0a63('0x58')]['destroy']({'where':{'CmHopperId':_0x36d066}});})[_0x0a63('0xb')](function(){return _0x58e686[_0x0a63('0x4')](0xcc)['end']();})[_0x0a63('0x35')](handleError(_0x58e686,null));};exports[_0x0a63('0x59')]=function(_0x5e5495,_0x4d86ed){var _0x3b395a=[];return db[_0x0a63('0x51')][_0x0a63('0x3e')]()['then'](function(_0x116e05){_0x3b395a=_[_0x0a63('0x16')](_0x116e05);return _0x5e5495[_0x0a63('0x4b')][_0x0a63('0x5a')]({'where':{'type':_0x0a63('0x5b'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x0a63('0x5c'),_0x0a63('0x5d')],'raw':!![]});})[_0x0a63('0xb')](function(_0x1fa9cd){if(_0x1fa9cd&&_0x1fa9cd[_0x0a63('0x2a')]){return db[_0x0a63('0x5e')][_0x0a63('0x5f')](function(_0x57313b){var _0x4571e7={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x0a63('0x4e')](_0x0a63('0x4f'))},'VoiceQueueId':{'$in':_[_0x0a63('0x11')](_0x1fa9cd,'id')},'$or':[{'UserId':null},{'UserId':_0x5e5495[_0x0a63('0x4b')]['id']}]};var _0xf814c7={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x1fa9cd)[_0x0a63('0x2e')]([_0x0a63('0x5d'),0x0])['map']('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x5e5495[_0x0a63('0x4b')]['id']}]};var _0x30e5f0={'$or':[_0x4571e7,_0xf814c7]};var _0x4137bc=[];if(_0x5e5495[_0x0a63('0x3c')][_0x0a63('0x60')]&&_0x5e5495['body'][_0x0a63('0x60')]===_0x0a63('0x61')){if(!_[_0x0a63('0x62')](_0x5e5495[_0x0a63('0x3c')][_0x0a63('0x63')])){_0x30e5f0['id']={'$in':_0x5e5495[_0x0a63('0x3c')][_0x0a63('0x63')]};}_0x4137bc=[[_0x0a63('0x64'),_0x0a63('0x65')],[_0x0a63('0x66'),_0x1fa9cd[0x0][_0x0a63('0x5c')]==='ASC'?_0x0a63('0x67'):'ASC'],db[_0x0a63('0x5e')][_0x0a63('0x68')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id','DESC']];}else{if(!_['isEmpty'](_0x5e5495[_0x0a63('0x3c')][_0x0a63('0x63')])){_0x30e5f0['id']={'$notIn':_0x5e5495[_0x0a63('0x3c')][_0x0a63('0x63')]};}_0x4137bc=[[_0x0a63('0x64'),_0x0a63('0x67')],['scheduledAt',_0x1fa9cd[0x0]['dialOrderByScheduledAt']],db['sequelize'][_0x0a63('0x68')](_0x0a63('0x69')),['id',_0x0a63('0x65')]];}return db[_0x0a63('0x12')]['findOne']({'attributes':['id',_0x0a63('0x6a'),'phone','recallme'],'where':_0x30e5f0,'order':_0x4137bc,'transaction':_0x57313b,'lock':_0x57313b[_0x0a63('0x6b')]['UPDATE'],'include':[{'model':db[_0x0a63('0x51')],'as':_0x0a63('0x6c'),'attributes':_0x3b395a,'include':[{'model':db['CmCompany'],'as':_0x0a63('0x6d'),'attributes':['id','name']}]},{'model':db[_0x0a63('0x6e')],'as':'List','attributes':['id',_0x0a63('0xe')]},{'model':db[_0x0a63('0x41')],'as':_0x0a63('0x6f'),'attributes':['id','name',_0x0a63('0x70')]}]})[_0x0a63('0xb')](function(_0x1f15bb){if(_0x1f15bb){return _0x1f15bb[_0x0a63('0x3d')]({'UserId':_0x5e5495[_0x0a63('0x4b')]['id']},{'transaction':_0x57313b});}});});}})['then'](handleEntityNotFound(_0x4d86ed,null))['then'](respondWithResult(_0x4d86ed,null))['catch'](handleError(_0x4d86ed,null));};exports[_0x0a63('0x71')]=function(_0x5ea8b7,_0x57cdc8,_0xa27da4){var _0x42e6d0=[];var _0x253fb1=_0x5ea8b7['params']['id'];var _0x1ff938=_0x5ea8b7[_0x0a63('0x4b')]['id'];return db['CmContact'][_0x0a63('0x3e')]()[_0x0a63('0xb')](function(_0x35f225){_0x42e6d0=_[_0x0a63('0x16')](_0x35f225);return db[_0x0a63('0x5e')]['transaction'](function(_0x206221){const _0x11012f={'id':_0x253fb1};return db[_0x0a63('0x12')]['findOne']({'attributes':['id','scheduledat','recallme'],'where':_0x11012f,'transaction':_0x206221,'lock':_0x206221[_0x0a63('0x6b')][_0x0a63('0x72')],'include':[{'model':db[_0x0a63('0x51')],'as':_0x0a63('0x6c'),'attributes':_0x42e6d0,'include':[{'model':db[_0x0a63('0x73')],'as':_0x0a63('0x6d'),'attributes':['id',_0x0a63('0xe')]}]},{'model':db[_0x0a63('0x6e')],'as':_0x0a63('0x74'),'attributes':['id',_0x0a63('0xe')]},{'model':db['VoiceQueue'],'as':_0x0a63('0x6f'),'attributes':['id',_0x0a63('0xe'),_0x0a63('0x70')]}]})[_0x0a63('0xb')](function(_0x3d62ca){if(_0x3d62ca){return _0x3d62ca[_0x0a63('0x3d')]({'UserId':_0x1ff938},{'transaction':_0x206221});}});});})['then'](handleEntityNotFound(_0x57cdc8,null))['then'](respondWithResult(_0x57cdc8,null))[_0x0a63('0x35')](handleError(_0x57cdc8,null));};exports[_0x0a63('0x75')]=function(_0x425c8c,_0x3caea6){return _0x425c8c['user'][_0x0a63('0x5a')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x0a63('0x76')},'attributes':['id'],'raw':!![]})[_0x0a63('0xb')](function(_0x1e256e){if(_0x1e256e&&_0x1e256e[_0x0a63('0x2a')]){return db['CmHopper'][_0x0a63('0x9')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x0a63('0x4e')](_0x0a63('0x4f'))},'VoiceQueueId':{'$in':_[_0x0a63('0x11')](_0x1e256e,'id')},'$or':[{'UserId':null},{'UserId':_0x425c8c['user']['id']}]}});}return 0x0;})['then'](function(_0x15079f){if(!_['isNil'](_0x15079f)&&_[_0x0a63('0x77')](_0x15079f)){return _0x3caea6[_0x0a63('0x4')](0xc8)[_0x0a63('0x5')]({'contacts':_0x15079f});}else{logger[_0x0a63('0xd')](_0x0a63('0x78'),'getOpenContacts',0x194,_0x0a63('0x79'));_0x3caea6[_0x0a63('0xc')](0x194);}})[_0x0a63('0x35')](handleError(_0x3caea6,null));};exports[_0x0a63('0x7a')]=function(_0x4762a0,_0x38d393){var _0x34513d=shared['timezones'];var _0x194fb2=[];_[_0x0a63('0x11')](_0x34513d,function(_0x40b5f6){_0x194fb2[_0x0a63('0x7b')]({'id':_0x40b5f6['name'],'name':_0x40b5f6[_0x0a63('0xe')],'utcOffset':_0x40b5f6[_0x0a63('0x7c')]});});return _0x38d393[_0x0a63('0x4')](0xc8)['json']({'tz':_0x194fb2});};exports[_0x0a63('0x7d')]=function(_0x344a16,_0x34f5d8){var _0x590ab1=shared[_0x0a63('0x7e')];var _0xd02d58={};if(!_[_0x0a63('0x53')](_0x590ab1[_0x344a16[_0x0a63('0x3c')]['id']]))_0xd02d58=_0x590ab1[_0x344a16[_0x0a63('0x3c')]['id']];return _0x34f5d8[_0x0a63('0x4')](0xc8)[_0x0a63('0x5')](_0xd02d58);}; \ No newline at end of file +var _0x90b5=['VoiceQueue','CampaignId','dataValues','createdAt','updatedAt','deleted','campaign','membername','format','calleridnum','campaigntype','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','status','user','getVoiceQueues','outbound','dialPreviewAutoRecallMe','transaction','YYYY-MM-DD\x20HH:mm:ss','direction','prev','hopperIds','priority','scheduledAt','dialOrderByScheduledAt','ASC','DESC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','phone','recallme','UPDATE','Contact','Company','CmList','Queue','dialActive','getPreviewRecall','findOne','scheduledat','LOCK','List','preview','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','getTimezones','timezones','getTimezone','moment','../../components/parsers/qs','../../config/logger','api','../../config/environment','json','offset','undefined','limit','count','set','Content-Range','update','then','sendStatus','error','stack','name','send','CmHopper','rawAttributes','type','key','model','map','query','filters','$and','$gte','$lte','$not','$between','$in','$notIn','$like','$notLike','$iLike','$overlap','$contains','$contained','$any','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','include','catch','show','params','keys','intersection','length','includeAll','find','create','body','describe','destroy','VoiceQueueId'];(function(_0x44a3b0,_0x352810){var _0x39e6f6=function(_0x248002){while(--_0x248002){_0x44a3b0['push'](_0x44a3b0['shift']());}};_0x39e6f6(++_0x352810);}(_0x90b5,0x139));var _0x590b=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x90b5[_0x2ec461];return _0x28603d;};'use strict';var moment=require(_0x590b('0x0'));var _=require('lodash');var qs=require(_0x590b('0x1'));var logger=require(_0x590b('0x2'))(_0x590b('0x3'));var shared=require(_0x590b('0x4'));var db=require('../../mysqldb')['db'];function respondWithResult(_0x4cf794,_0x2318b8){_0x2318b8=_0x2318b8||0xc8;return function(_0x27e96f){if(_0x27e96f){return _0x4cf794['status'](_0x2318b8)[_0x590b('0x5')](_0x27e96f);}};}function respondWithFilteredResult(_0x2059e4,_0x88a5f9){return function(_0x5e54fe){if(_0x5e54fe){var _0x30bc6e=typeof _0x88a5f9[_0x590b('0x6')]===_0x590b('0x7')&&typeof _0x88a5f9[_0x590b('0x8')]===_0x590b('0x7');var _0x268b0a=_0x5e54fe[_0x590b('0x9')];var _0xe0b13d=_0x30bc6e?0x0:_0x88a5f9[_0x590b('0x6')];var _0x50a7b8=_0x30bc6e?_0x5e54fe[_0x590b('0x9')]:_0x88a5f9[_0x590b('0x6')]+_0x88a5f9['limit'];var _0x2962b0;if(_0x50a7b8>=_0x268b0a){_0x50a7b8=_0x268b0a;_0x2962b0=0xc8;}else{_0x2962b0=0xce;}_0x2059e4['status'](_0x2962b0);return _0x2059e4[_0x590b('0xa')](_0x590b('0xb'),_0xe0b13d+'-'+_0x50a7b8+'/'+_0x268b0a)[_0x590b('0x5')](_0x5e54fe);}return null;};}function saveUpdates(_0x477069,_0x527487){return function(_0xb0ca22){if(_0xb0ca22){return _0xb0ca22[_0x590b('0xc')](_0x477069)[_0x590b('0xd')](function(_0x1c8607){return _0x1c8607;});}return null;};}function handleEntityNotFound(_0x2e85b1,_0x6ad7e7){return function(_0x45ac04){if(!_0x45ac04){_0x2e85b1[_0x590b('0xe')](0x194);}return _0x45ac04;};}function handleError(_0x168bde,_0x1fbc84){_0x1fbc84=_0x1fbc84||0x1f4;return function(_0x3fc5ca){logger[_0x590b('0xf')](_0x3fc5ca[_0x590b('0x10')]);if(_0x3fc5ca[_0x590b('0x11')]){delete _0x3fc5ca[_0x590b('0x11')];}_0x168bde['status'](_0x1fbc84)[_0x590b('0x12')](_0x3fc5ca);};}exports['index']=function(_0x5c788,_0x115309){var _0xf05b00={},_0x53337c={},_0x4b2c3c={'count':0x0,'rows':[]};var _0x466dcc=_['map'](db[_0x590b('0x13')][_0x590b('0x14')],function(_0x3fbeb2){return{'name':_0x3fbeb2['fieldName'],'type':_0x3fbeb2[_0x590b('0x15')][_0x590b('0x16')]};});_0x53337c[_0x590b('0x17')]=_[_0x590b('0x18')](_0x466dcc,'name');_0x53337c[_0x590b('0x19')]=_['keys'](_0x5c788[_0x590b('0x19')]);_0x53337c[_0x590b('0x1a')]=_['intersection'](_0x53337c['model'],_0x53337c[_0x590b('0x19')]);_0x53337c[_0x590b('0x1a')]=_['concat'](_0x53337c[_0x590b('0x1a')],[_0x590b('0x1b'),'$or','$gt',_0x590b('0x1c'),'$lt',_0x590b('0x1d'),'$ne','$eq',_0x590b('0x1e'),_0x590b('0x1f'),'$notBetween',_0x590b('0x20'),_0x590b('0x21'),_0x590b('0x22'),_0x590b('0x23'),_0x590b('0x24'),'$notILike',_0x590b('0x22'),_0x590b('0x25'),_0x590b('0x26'),_0x590b('0x27'),_0x590b('0x28')]);_0xf05b00[_0x590b('0x29')]=_['intersection'](_0x53337c[_0x590b('0x17')],qs['fields'](_0x5c788[_0x590b('0x19')][_0x590b('0x2a')]));_0xf05b00[_0x590b('0x29')]=_0xf05b00[_0x590b('0x29')]['length']?_0xf05b00[_0x590b('0x29')]:_0x53337c['model'];if(!_0x5c788[_0x590b('0x19')][_0x590b('0x2b')](_0x590b('0x2c'))){_0xf05b00[_0x590b('0x8')]=qs[_0x590b('0x8')](_0x5c788['query'][_0x590b('0x8')]);_0xf05b00[_0x590b('0x6')]=qs[_0x590b('0x6')](_0x5c788[_0x590b('0x19')]['offset']);}_0xf05b00['order']=qs[_0x590b('0x2d')](_0x5c788[_0x590b('0x19')][_0x590b('0x2d')]);_0xf05b00[_0x590b('0x2e')]=qs['filters'](_['pick'](_0x5c788[_0x590b('0x19')],_0x53337c['filters']),_0x466dcc);if(_0x5c788[_0x590b('0x19')][_0x590b('0x2f')]){_0xf05b00[_0x590b('0x2e')]=_[_0x590b('0x30')](_0xf05b00[_0x590b('0x2e')],{'$or':_[_0x590b('0x18')](_0x466dcc,function(_0x251cab){if(_0x251cab[_0x590b('0x15')]!==_0x590b('0x31')){var _0x3e5c5e={};_0x3e5c5e[_0x251cab['name']]={'$like':'%'+_0x5c788['query'][_0x590b('0x2f')]+'%'};return _0x3e5c5e;}})});}_0xf05b00=_[_0x590b('0x30')]({},_0xf05b00,_0x5c788[_0x590b('0x32')]);var _0x3a03ff={'where':_0xf05b00[_0x590b('0x2e')]};return db['CmHopper'][_0x590b('0x9')](_0x3a03ff)[_0x590b('0xd')](function(_0x3e5ca5){_0x4b2c3c[_0x590b('0x9')]=_0x3e5ca5;if(_0x5c788[_0x590b('0x19')]['includeAll']){_0xf05b00[_0x590b('0x33')]=[{'all':!![]}];}return db[_0x590b('0x13')]['findAll'](_0xf05b00);})['then'](function(_0x46dbf3){_0x4b2c3c['rows']=_0x46dbf3;return _0x4b2c3c;})[_0x590b('0xd')](respondWithFilteredResult(_0x115309,_0xf05b00))[_0x590b('0x34')](handleError(_0x115309,null));};exports[_0x590b('0x35')]=function(_0x2a67fc,_0x210af8){var _0x419e6a={'raw':!![],'where':{'id':_0x2a67fc[_0x590b('0x36')]['id']}},_0x2fc05c={};_0x2fc05c[_0x590b('0x17')]=_[_0x590b('0x37')](db['CmHopper'][_0x590b('0x14')]);_0x2fc05c[_0x590b('0x19')]=_[_0x590b('0x37')](_0x2a67fc['query']);_0x2fc05c[_0x590b('0x1a')]=_[_0x590b('0x38')](_0x2fc05c[_0x590b('0x17')],_0x2fc05c[_0x590b('0x19')]);_0x419e6a[_0x590b('0x29')]=_[_0x590b('0x38')](_0x2fc05c[_0x590b('0x17')],qs[_0x590b('0x2a')](_0x2a67fc['query'][_0x590b('0x2a')]));_0x419e6a['attributes']=_0x419e6a[_0x590b('0x29')][_0x590b('0x39')]?_0x419e6a[_0x590b('0x29')]:_0x2fc05c['model'];if(_0x2a67fc[_0x590b('0x19')][_0x590b('0x3a')]){_0x419e6a[_0x590b('0x33')]=[{'all':!![]}];}_0x419e6a=_[_0x590b('0x30')]({},_0x419e6a,_0x2a67fc['options']);return db[_0x590b('0x13')][_0x590b('0x3b')](_0x419e6a)['then'](handleEntityNotFound(_0x210af8,null))['then'](respondWithResult(_0x210af8,null))['catch'](handleError(_0x210af8,null));};exports[_0x590b('0x3c')]=function(_0x44defc,_0x3bd990){return db['CmHopper']['create'](_0x44defc[_0x590b('0x3d')],{})[_0x590b('0xd')](respondWithResult(_0x3bd990,0xc9))['catch'](handleError(_0x3bd990,null));};exports[_0x590b('0xc')]=function(_0x1a9678,_0x44d1d8){if(_0x1a9678[_0x590b('0x3d')]['id']){delete _0x1a9678[_0x590b('0x3d')]['id'];}return db[_0x590b('0x13')][_0x590b('0x3b')]({'where':{'id':_0x1a9678[_0x590b('0x36')]['id']}})[_0x590b('0xd')](handleEntityNotFound(_0x44d1d8,null))[_0x590b('0xd')](saveUpdates(_0x1a9678[_0x590b('0x3d')],null))[_0x590b('0xd')](respondWithResult(_0x44d1d8,null))[_0x590b('0x34')](handleError(_0x44d1d8,null));};exports['describe']=function(_0x5e79c5,_0x1a92fb){return db[_0x590b('0x13')][_0x590b('0x3e')]()[_0x590b('0xd')](respondWithResult(_0x1a92fb,null))['catch'](handleError(_0x1a92fb,null));};exports[_0x590b('0x3f')]=function(_0x11bb48,_0x2f492a){var _0x5cc53f;var _0x1964c5=_0x11bb48[_0x590b('0x36')]['id'];return db['CmHopper']['find']({'where':{'id':_0x11bb48[_0x590b('0x36')]['id']}})[_0x590b('0xd')](handleEntityNotFound(_0x2f492a,null))['then'](function(_0x218c86){if(_0x218c86){return _0x218c86[_0x590b('0x3f')]()['then'](function(_0x67ee4f){return _0x67ee4f;});}})[_0x590b('0xd')](function(_0x446910){_0x5cc53f=_0x446910;if(_0x446910){if(_0x446910['VoiceQueueId']||_0x446910['CampaignId']){return db[_0x446910[_0x590b('0x40')]?_0x590b('0x41'):'Campaign'][_0x590b('0x3b')]({'where':{'id':_0x446910[_0x590b('0x40')]?_0x446910[_0x590b('0x40')]:_0x446910[_0x590b('0x42')]},'attributes':['id',_0x590b('0x11')],'raw':!![]});}}})[_0x590b('0xd')](function(_0x2a74b8){var _0x4b51ac={};if(_0x2a74b8){_[_0x590b('0x30')](_0x4b51ac,_['omit'](_0x5cc53f[_0x590b('0x43')],[_0x590b('0x44'),_0x590b('0x45'),'id']));_0x4b51ac['state']=0x15;_0x4b51ac['statedesc']=_0x590b('0x46');_0x4b51ac[_0x590b('0x47')]=_0x2a74b8[_0x590b('0x11')];_0x4b51ac[_0x590b('0x48')]=_0x11bb48['user'][_0x590b('0x11')];_0x4b51ac['UserId']=_0x11bb48['user']['id'];_0x4b51ac[_0x590b('0x46')]=!![];_0x4b51ac['deletedat']=moment()[_0x590b('0x49')]('YYYY-MM-DD\x20HH:mm:ss');_0x4b51ac[_0x590b('0x4a')]=_0x5cc53f['phone'];_0x4b51ac[_0x590b('0x4b')]=_0x5cc53f[_0x590b('0x40')]?_0x590b('0x4c'):_0x590b('0x4d');return db[_0x590b('0x4e')][_0x590b('0x3b')]({'where':{'id':_0x4b51ac[_0x590b('0x4f')]},'attributes':[_0x590b('0x50'),_0x590b('0x51')]})['then'](function(_0x3ec016){if(!_[_0x590b('0x52')](_0x2f492a)&&!_['isNil'](_0x3ec016[_0x590b('0x50')])){_0x4b51ac[_0x590b('0x53')]=_0x3ec016[_0x590b('0x50')];if(!_[_0x590b('0x52')](_0x3ec016['lastName'])){_0x4b51ac[_0x590b('0x53')]+='\x20'+_0x3ec016[_0x590b('0x51')];}}})[_0x590b('0x54')](function(){return db[_0x590b('0x55')]['create'](_0x4b51ac);});}})[_0x590b('0xd')](function(_0x58dfdc){return db[_0x590b('0x56')][_0x590b('0x3f')]({'where':{'CmHopperId':_0x1964c5}});})[_0x590b('0xd')](function(){return _0x2f492a[_0x590b('0x57')](0xcc)['end']();})[_0x590b('0x34')](handleError(_0x2f492a,null));};exports['getPreview']=function(_0xc22794,_0x426470){var _0x3ef6d3=[];return db['CmContact'][_0x590b('0x3e')]()['then'](function(_0x1b0cbb){_0x3ef6d3=_['keys'](_0x1b0cbb);return _0xc22794[_0x590b('0x58')][_0x590b('0x59')]({'where':{'type':_0x590b('0x5a'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id','dialOrderByScheduledAt',_0x590b('0x5b')],'raw':!![]});})[_0x590b('0xd')](function(_0x3e32d2){if(_0x3e32d2&&_0x3e32d2[_0x590b('0x39')]){return db['sequelize'][_0x590b('0x5c')](function(_0x5eb081){var _0x236aa8={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x590b('0x49')](_0x590b('0x5d'))},'VoiceQueueId':{'$in':_[_0x590b('0x18')](_0x3e32d2,'id')},'$or':[{'UserId':null},{'UserId':_0xc22794[_0x590b('0x58')]['id']}]};var _0x5836c9={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x3e32d2)['filter']([_0x590b('0x5b'),0x0])['map']('id')['value']()},'$or':[{'UserId':null},{'UserId':_0xc22794[_0x590b('0x58')]['id']}]};var _0x1c14bf={'$or':[_0x236aa8,_0x5836c9]};var _0x4d16a1=[];if(_0xc22794[_0x590b('0x3d')][_0x590b('0x5e')]&&_0xc22794['body'][_0x590b('0x5e')]===_0x590b('0x5f')){if(!_['isEmpty'](_0xc22794[_0x590b('0x3d')]['hopperIds'])){_0x1c14bf['id']={'$in':_0xc22794[_0x590b('0x3d')][_0x590b('0x60')]};}_0x4d16a1=[[_0x590b('0x61'),'ASC'],[_0x590b('0x62'),_0x3e32d2[0x0][_0x590b('0x63')]===_0x590b('0x64')?_0x590b('0x65'):'ASC'],db[_0x590b('0x66')][_0x590b('0x67')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x590b('0x65')]];}else{if(!_['isEmpty'](_0xc22794[_0x590b('0x3d')][_0x590b('0x60')])){_0x1c14bf['id']={'$notIn':_0xc22794[_0x590b('0x3d')][_0x590b('0x60')]};}_0x4d16a1=[[_0x590b('0x61'),_0x590b('0x65')],[_0x590b('0x62'),_0x3e32d2[0x0][_0x590b('0x63')]],db['sequelize'][_0x590b('0x67')](_0x590b('0x68')),['id',_0x590b('0x64')]];}return db[_0x590b('0x13')]['findOne']({'attributes':['id','scheduledat',_0x590b('0x69'),_0x590b('0x6a')],'where':_0x1c14bf,'order':_0x4d16a1,'transaction':_0x5eb081,'lock':_0x5eb081['LOCK'][_0x590b('0x6b')],'include':[{'model':db[_0x590b('0x4e')],'as':_0x590b('0x6c'),'attributes':_0x3ef6d3,'include':[{'model':db['CmCompany'],'as':_0x590b('0x6d'),'attributes':['id','name']}]},{'model':db[_0x590b('0x6e')],'as':'List','attributes':['id','name']},{'model':db[_0x590b('0x41')],'as':_0x590b('0x6f'),'attributes':['id','name',_0x590b('0x70')]}]})[_0x590b('0xd')](function(_0x397a00){if(_0x397a00){return _0x397a00[_0x590b('0xc')]({'UserId':_0xc22794['user']['id']},{'transaction':_0x5eb081});}});});}})[_0x590b('0xd')](handleEntityNotFound(_0x426470,null))[_0x590b('0xd')](respondWithResult(_0x426470,null))[_0x590b('0x34')](handleError(_0x426470,null));};exports[_0x590b('0x71')]=function(_0x1be3fc,_0x319b9c,_0x251272){var _0xfa8e7d=[];var _0x421547=_0x1be3fc['params']['id'];var _0x4b81f=_0x1be3fc['user']['id'];return db[_0x590b('0x4e')][_0x590b('0x3e')]()[_0x590b('0xd')](function(_0x3859f6){_0xfa8e7d=_['keys'](_0x3859f6);return db[_0x590b('0x66')][_0x590b('0x5c')](function(_0x1e0778){const _0x5411ac={'id':_0x421547};return db[_0x590b('0x13')][_0x590b('0x72')]({'attributes':['id',_0x590b('0x73'),_0x590b('0x6a')],'where':_0x5411ac,'transaction':_0x1e0778,'lock':_0x1e0778[_0x590b('0x74')]['UPDATE'],'include':[{'model':db[_0x590b('0x4e')],'as':_0x590b('0x6c'),'attributes':_0xfa8e7d,'include':[{'model':db['CmCompany'],'as':'Company','attributes':['id','name']}]},{'model':db[_0x590b('0x6e')],'as':_0x590b('0x75'),'attributes':['id','name']},{'model':db['VoiceQueue'],'as':_0x590b('0x6f'),'attributes':['id','name',_0x590b('0x70')]}]})[_0x590b('0xd')](function(_0x21be96){if(_0x21be96){return _0x21be96['update']({'UserId':_0x4b81f},{'transaction':_0x1e0778});}});});})[_0x590b('0xd')](handleEntityNotFound(_0x319b9c,null))[_0x590b('0xd')](respondWithResult(_0x319b9c,null))[_0x590b('0x34')](handleError(_0x319b9c,null));};exports['getOpenContacts']=function(_0x18b10f,_0x3d1617){return _0x18b10f[_0x590b('0x58')]['getVoiceQueues']({'where':{'type':_0x590b('0x5a'),'dialActive':!![],'dialMethod':_0x590b('0x76')},'attributes':['id'],'raw':!![]})[_0x590b('0xd')](function(_0x31c37b){if(_0x31c37b&&_0x31c37b['length']){return db[_0x590b('0x13')][_0x590b('0x9')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x590b('0x49')](_0x590b('0x5d'))},'VoiceQueueId':{'$in':_[_0x590b('0x18')](_0x31c37b,'id')},'$or':[{'UserId':null},{'UserId':_0x18b10f[_0x590b('0x58')]['id']}]}});}return 0x0;})['then'](function(_0x20baa9){if(!_[_0x590b('0x52')](_0x20baa9)&&_[_0x590b('0x77')](_0x20baa9)){return _0x3d1617[_0x590b('0x57')](0xc8)[_0x590b('0x5')]({'contacts':_0x20baa9});}else{logger['error'](_0x590b('0x78'),_0x590b('0x79'),0x194,_0x590b('0x7a'));_0x3d1617['sendStatus'](0x194);}})['catch'](handleError(_0x3d1617,null));};exports[_0x590b('0x7b')]=function(_0x1c3797,_0x3c6dd5){var _0x4b0c5d=shared[_0x590b('0x7c')];var _0x4b5870=[];_[_0x590b('0x18')](_0x4b0c5d,function(_0x616cdf){_0x4b5870['push']({'id':_0x616cdf[_0x590b('0x11')],'name':_0x616cdf[_0x590b('0x11')],'utcOffset':_0x616cdf['utcOffset']});});return _0x3c6dd5[_0x590b('0x57')](0xc8)[_0x590b('0x5')]({'tz':_0x4b5870});};exports[_0x590b('0x7d')]=function(_0x1f17f2,_0x16dea7){var _0x6281dc=shared['timezones'];var _0x1d8bdf={};if(!_[_0x590b('0x52')](_0x6281dc[_0x1f17f2['body']['id']]))_0x1d8bdf=_0x6281dc[_0x1f17f2[_0x590b('0x3d')]['id']];return _0x16dea7[_0x590b('0x57')](0xc8)[_0x590b('0x5')](_0x1d8bdf);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 85557cf..c2af5f1 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 _0xf494=['define','scheduledat','phone','priority','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0xffebf5,_0x208592){var _0x1bfa09=function(_0x3b665a){while(--_0x3b665a){_0xffebf5['push'](_0xffebf5['shift']());}};_0x1bfa09(++_0x208592);}(_0xf494,0x1c6));var _0x4f49=function(_0x1e27b6,_0x4864bf){_0x1e27b6=_0x1e27b6-0x0;var _0x1e8cbd=_0xf494[_0x1e27b6];return _0x1e8cbd;};'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')]('CmHopper',attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x4f49('0xc'),'fields':[_0x4f49('0xc')]},{'name':_0x4f49('0xd'),'fields':[_0x4f49('0xd')]},{'name':_0x4f49('0xe'),'fields':[_0x4f49('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x71ab=['rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','util','api','bluebird','request-promise','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x71ab,0x64));var _0xb71a=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x71ab[_0x126558];return _0x1f6d14;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var logger=require('../../config/logger')(_0xb71a('0x1'));var moment=require('moment');var BPromise=require(_0xb71a('0x2'));var rp=require(_0xb71a('0x3'));var fs=require('fs');var path=require(_0xb71a('0x4'));var rimraf=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var attributes=require(_0xb71a('0x7'));module[_0xb71a('0x8')]=function(_0x38d931,_0x22c072){return _0x38d931[_0xb71a('0x9')](_0xb71a('0xa'),attributes,{'tableName':_0xb71a('0xb'),'paranoid':![],'indexes':[{'name':_0xb71a('0xc'),'fields':[_0xb71a('0xc')]},{'name':_0xb71a('0xd'),'fields':[_0xb71a('0xd')]},{'name':_0xb71a('0xe'),'fields':[_0xb71a('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index be8d4ec..c2c853c 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 _0xa908=['\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','GetCmHopperPreview','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','interval','availableAgentsIds','literal','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','name','List','NOW()','lodash','moment','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopper,\x20%s,\x20%s','message','catch','CmHopper','findAll','options','where','attributes','include','model','map','GetCmHopper','debug','ShowCmHopper','find','raw','CreateCmHopper','create','body','UpdateCmHopper','update','limit','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','UPDATE','keys','User','Agent','push','includes','all','length','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','destroy','CountReScheduled','COUNT','`scheduledat`\x20>=\x20','format'];(function(_0x367f2c,_0x42a488){var _0x3fc1c1=function(_0x533896){while(--_0x533896){_0x367f2c['push'](_0x367f2c['shift']());}};_0x3fc1c1(++_0x42a488);}(_0xa908,0x1c3));var _0x8a90=function(_0x36c87d,_0x2ab247){_0x36c87d=_0x36c87d-0x0;var _0x54dc55=_0xa908[_0x36c87d];return _0x54dc55;};'use strict';var _=require(_0x8a90('0x0'));var util=require('util');var moment=require(_0x8a90('0x1'));var BPromise=require('bluebird');var db=require(_0x8a90('0x2'))['db'];var logger=require(_0x8a90('0x3'))(_0x8a90('0x4'));var jayson=require(_0x8a90('0x5'));var client=jayson[_0x8a90('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0xdc3d7d,_0x5dc585,_0x5e41b9){return new BPromise(function(_0x1c516f,_0x1dc8f9){return client[_0x8a90('0x7')](_0xdc3d7d,_0x5e41b9)[_0x8a90('0x8')](function(_0x20f8bf){logger[_0x8a90('0x9')]('CmHopper,\x20%s,\x20%s',_0x5dc585,_0x8a90('0xa'));logger['debug'](_0x8a90('0xb'),_0x5dc585,'request\x20sent',JSON[_0x8a90('0xc')](_0x20f8bf));if(_0x20f8bf[_0x8a90('0xd')]){if(_0x20f8bf[_0x8a90('0xd')][_0x8a90('0xe')]===0x1f4){logger[_0x8a90('0xd')](_0x8a90('0xf'),_0x5dc585,_0x20f8bf[_0x8a90('0xd')]['message']);return _0x1dc8f9(_0x20f8bf['error'][_0x8a90('0x10')]);}logger[_0x8a90('0xd')](_0x8a90('0xf'),_0x5dc585,_0x20f8bf['error'][_0x8a90('0x10')]);return _0x1c516f(_0x20f8bf[_0x8a90('0xd')][_0x8a90('0x10')]);}else{logger['info'](_0x8a90('0xf'),_0x5dc585,_0x8a90('0xa'));_0x1c516f(_0x20f8bf['result'][_0x8a90('0x10')]);}})[_0x8a90('0x11')](function(_0x1f667a){logger[_0x8a90('0xd')]('CmHopper,\x20%s,\x20%s',_0x5dc585,_0x1f667a);_0x1dc8f9(_0x1f667a);});});}exports['GetCmHopper']=function(_0x14db82){var _0x16a7d1=this;return new Promise(function(_0x40e491,_0x12dcfc){return db[_0x8a90('0x12')][_0x8a90('0x13')]({'raw':_0x14db82[_0x8a90('0x14')]?_0x14db82[_0x8a90('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x14db82[_0x8a90('0x14')]?_0x14db82['options'][_0x8a90('0x15')]||null:null,'attributes':_0x14db82[_0x8a90('0x14')]?_0x14db82[_0x8a90('0x14')][_0x8a90('0x16')]||null:null,'limit':_0x14db82[_0x8a90('0x14')]?_0x14db82[_0x8a90('0x14')]['limit']||null:null,'include':_0x14db82[_0x8a90('0x14')]?_0x14db82[_0x8a90('0x14')][_0x8a90('0x17')]?_['map'](_0x14db82[_0x8a90('0x14')][_0x8a90('0x17')],function(_0x4ac197){return{'model':db[_0x4ac197[_0x8a90('0x18')]],'as':_0x4ac197['as'],'attributes':_0x4ac197[_0x8a90('0x16')],'include':_0x4ac197['include']?_[_0x8a90('0x19')](_0x4ac197[_0x8a90('0x17')],function(_0x4acc5e){return{'model':db[_0x4acc5e[_0x8a90('0x18')]],'as':_0x4acc5e['as'],'attributes':_0x4acc5e['attributes'],'include':_0x4acc5e['include']?_[_0x8a90('0x19')](_0x4acc5e[_0x8a90('0x17')],function(_0x29b50b){return{'model':db[_0x29b50b[_0x8a90('0x18')]],'as':_0x29b50b['as'],'attributes':_0x29b50b[_0x8a90('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x16a228){logger[_0x8a90('0x9')](_0x8a90('0x1a'),_0x14db82);logger[_0x8a90('0x1b')]('GetCmHopper',_0x14db82,JSON[_0x8a90('0xc')](_0x16a228));_0x40e491(_0x16a228);})['catch'](function(_0x3ed3aa){logger[_0x8a90('0xd')](_0x8a90('0x1a'),_0x3ed3aa['message'],_0x14db82);_0x12dcfc(_0x16a7d1[_0x8a90('0xd')](0x1f4,_0x3ed3aa[_0x8a90('0x10')]));});});};exports[_0x8a90('0x1c')]=function(_0x57596d){var _0x182217=this;return new Promise(function(_0x2cee63,_0x3443ba){return db[_0x8a90('0x12')][_0x8a90('0x1d')]({'raw':_0x57596d[_0x8a90('0x14')]?_0x57596d['options'][_0x8a90('0x1e')]===undefined?!![]:![]:!![],'where':_0x57596d[_0x8a90('0x14')]?_0x57596d['options']['where']||null:null,'attributes':_0x57596d['options']?_0x57596d[_0x8a90('0x14')][_0x8a90('0x16')]||null:null,'include':_0x57596d[_0x8a90('0x14')]?_0x57596d[_0x8a90('0x14')][_0x8a90('0x17')]?_['map'](_0x57596d[_0x8a90('0x14')][_0x8a90('0x17')],function(_0xd04297){return{'model':db[_0xd04297[_0x8a90('0x18')]],'as':_0xd04297['as'],'attributes':_0xd04297['attributes'],'include':_0xd04297['include']?_[_0x8a90('0x19')](_0xd04297['include'],function(_0x1d92fc){return{'model':db[_0x1d92fc[_0x8a90('0x18')]],'as':_0x1d92fc['as'],'attributes':_0x1d92fc['attributes'],'include':_0x1d92fc[_0x8a90('0x17')]?_['map'](_0x1d92fc[_0x8a90('0x17')],function(_0x4e97ca){return{'model':db[_0x4e97ca[_0x8a90('0x18')]],'as':_0x4e97ca['as'],'attributes':_0x4e97ca[_0x8a90('0x16')]};}):[]};}):[]};}):[]:[]})[_0x8a90('0x8')](function(_0xaa2980){logger[_0x8a90('0x9')](_0x8a90('0x1c'),_0x57596d);logger[_0x8a90('0x1b')](_0x8a90('0x1c'),_0x57596d,JSON[_0x8a90('0xc')](_0xaa2980));_0x2cee63(_0xaa2980);})[_0x8a90('0x11')](function(_0xb9e28){logger['error'](_0x8a90('0x1c'),_0xb9e28[_0x8a90('0x10')],_0x57596d);_0x3443ba(_0x182217[_0x8a90('0xd')](0x1f4,_0xb9e28[_0x8a90('0x10')]));});});};exports[_0x8a90('0x1f')]=function(_0x56a3e4){var _0x316ed8=this;return new Promise(function(_0x1392bd,_0xe5e1d4){return db['CmHopper'][_0x8a90('0x20')](_0x56a3e4[_0x8a90('0x21')],{'raw':_0x56a3e4[_0x8a90('0x14')]?_0x56a3e4[_0x8a90('0x14')][_0x8a90('0x1e')]===undefined?!![]:![]:!![]})[_0x8a90('0x8')](function(_0x294289){logger['info'](_0x8a90('0x1f'),_0x56a3e4);logger[_0x8a90('0x1b')]('CreateCmHopper',_0x56a3e4,JSON[_0x8a90('0xc')](_0x294289));_0x1392bd(_0x294289);})[_0x8a90('0x11')](function(_0x59a870){logger[_0x8a90('0xd')](_0x8a90('0x1f'),_0x59a870[_0x8a90('0x10')],_0x56a3e4);_0xe5e1d4(_0x316ed8[_0x8a90('0xd')](0x1f4,_0x59a870['message']));});});};exports[_0x8a90('0x22')]=function(_0x141b39){var _0x1c0622=this;return new Promise(function(_0x28827e,_0x22432f){return db[_0x8a90('0x12')][_0x8a90('0x23')](_0x141b39[_0x8a90('0x21')],{'raw':_0x141b39[_0x8a90('0x14')]?_0x141b39[_0x8a90('0x14')][_0x8a90('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x141b39[_0x8a90('0x14')]?_0x141b39[_0x8a90('0x14')][_0x8a90('0x15')]||null:null,'attributes':_0x141b39[_0x8a90('0x14')]?_0x141b39['options'][_0x8a90('0x16')]||null:null,'limit':_0x141b39['options']?_0x141b39[_0x8a90('0x14')][_0x8a90('0x24')]||null:null})['then'](function(_0x18170d){logger[_0x8a90('0x9')](_0x8a90('0x22'),_0x141b39);logger[_0x8a90('0x9')](_0x8a90('0x25'),JSON['stringify'](_0x141b39[_0x8a90('0x14')][_0x8a90('0x15')]),_0x141b39[_0x8a90('0x21')][_0x8a90('0x26')]);logger[_0x8a90('0x1b')](_0x8a90('0x22'),_0x141b39,JSON[_0x8a90('0xc')](_0x18170d));_0x28827e(_0x18170d);})[_0x8a90('0x11')](function(_0x212b87){logger[_0x8a90('0xd')](_0x8a90('0x22'),_0x212b87[_0x8a90('0x10')],_0x141b39);_0x22432f(_0x1c0622[_0x8a90('0xd')](0x1f4,_0x212b87['message']));});});};exports[_0x8a90('0x27')]=function(_0x6d45b6){var _0x3f01d7=this;return new Promise(function(_0x25b340,_0x5123ab){return db['CmHopper']['destroy']({'where':_0x6d45b6[_0x8a90('0x14')]?_0x6d45b6[_0x8a90('0x14')][_0x8a90('0x15')]||null:null})[_0x8a90('0x8')](function(_0x2dd26d){logger[_0x8a90('0x9')]('DestroyCmHopper',_0x6d45b6);logger['debug'](_0x8a90('0x27'),_0x6d45b6,JSON[_0x8a90('0xc')](_0x2dd26d));_0x25b340(_0x2dd26d);})[_0x8a90('0x11')](function(_0x2ca1b7){logger['error'](_0x8a90('0x27'),_0x2ca1b7[_0x8a90('0x10')],_0x6d45b6);_0x5123ab(_0x3f01d7[_0x8a90('0xd')](0x1f4,_0x2ca1b7[_0x8a90('0x10')]));});});};exports[_0x8a90('0x28')]=function(_0x453e7e){var _0x2d9b5a=this;return new Promise(function(_0x2f63a2,_0x13a4fb){return db[_0x8a90('0x29')][_0x8a90('0x2a')]()[_0x8a90('0x8')](function(_0x39a735){return db[_0x8a90('0x2b')][_0x8a90('0x2c')](function(_0x38376f){return db[_0x8a90('0x12')][_0x8a90('0x13')]({'where':_0x453e7e[_0x8a90('0x14')]?_0x453e7e[_0x8a90('0x14')]['where']||null:null,'attributes':_0x453e7e[_0x8a90('0x14')]?_0x453e7e['options'][_0x8a90('0x16')]||null:null,'limit':_0x453e7e[_0x8a90('0x14')]?_0x453e7e['options'][_0x8a90('0x24')]||null:null,'order':_0x453e7e['options']?_0x453e7e['options'][_0x8a90('0x2d')]||null:null,'transaction':_0x38376f,'lock':_0x38376f[_0x8a90('0x2e')][_0x8a90('0x2f')],'include':[{'model':db[_0x8a90('0x29')],'as':'Contact','attributes':_[_0x8a90('0x30')](_0x39a735)},{'model':db[_0x8a90('0x31')],'as':_0x8a90('0x32'),'attributes':['id','name','voicePause']}]})[_0x8a90('0x8')](function(_0x4e226b){var _0x17a9cd=[];var _0x17ace1=[];for(var _0x2b712c=0x0;_0x2b712c<_0x4e226b['length'];_0x2b712c+=0x1){var _0x10db6d=_0x4e226b[_0x2b712c]['UserId'];if(_0x10db6d===null){_0x17a9cd[_0x8a90('0x33')](_0x4e226b[_0x2b712c]['update'](_0x453e7e[_0x8a90('0x21')],{'transaction':_0x38376f}));}else if(!_0x17ace1[_0x8a90('0x34')](_0x10db6d)){_0x17ace1[_0x8a90('0x33')](_0x10db6d);_0x17a9cd[_0x8a90('0x33')](_0x4e226b[_0x2b712c][_0x8a90('0x23')](_0x453e7e[_0x8a90('0x21')],{'transaction':_0x38376f}));}}return BPromise[_0x8a90('0x35')](_0x17a9cd);});})[_0x8a90('0x8')](function(_0x95b804){logger[_0x8a90('0x9')](_0x8a90('0x28'),_0x453e7e);if(_0x95b804[_0x8a90('0x36')]>0x0){logger['info'](_0x8a90('0x37'),_0x95b804[0x0][_0x8a90('0x38')]['id'],_0x95b804[0x0][_0x8a90('0x38')][_0x8a90('0x39')],_0x95b804[0x0]['dataValues'][_0x8a90('0x26')]);}logger[_0x8a90('0x1b')]('GetContactDialer',_0x453e7e,JSON['stringify'](_0x95b804));_0x2f63a2(_0x95b804);})[_0x8a90('0x11')](function(_0x3ff756){logger[_0x8a90('0xd')](_0x8a90('0x28'),_0x3ff756[_0x8a90('0x10')],_0x453e7e);_0x13a4fb(_0x2d9b5a[_0x8a90('0xd')](0x1f4,_0x3ff756['message']));});});});};exports[_0x8a90('0x3a')]=function(_0x48e098){var _0x280114=this;return new Promise(function(_0x266144,_0x374391){return db[_0x8a90('0x2b')][_0x8a90('0x2c')](function(_0x2b7c0c){return db['CmHopperFinal'][_0x8a90('0x20')](_0x48e098[_0x8a90('0x21')],{'raw':_0x48e098['options']?_0x48e098[_0x8a90('0x14')][_0x8a90('0x1e')]===undefined?!![]:![]:!![],'transaction':_0x2b7c0c})['then'](function(){logger[_0x8a90('0x9')](_0x8a90('0x3b'),JSON[_0x8a90('0xc')](_0x48e098['options'][_0x8a90('0x15')]),_0x48e098[_0x8a90('0x14')][_0x8a90('0x15')][_0x8a90('0x26')]);return db[_0x8a90('0x12')][_0x8a90('0x3c')]({'where':_0x48e098['options']?_0x48e098[_0x8a90('0x14')][_0x8a90('0x15')]||null:null,'transaction':_0x2b7c0c});});})[_0x8a90('0x8')](function(_0x5591ee){logger[_0x8a90('0x9')](_0x8a90('0x3a'),_0x48e098);logger['debug'](_0x8a90('0x3a'),_0x48e098,JSON['stringify'](_0x5591ee));_0x266144(_0x5591ee);})[_0x8a90('0x11')](function(_0x3f2cfa){logger[_0x8a90('0xd')](_0x8a90('0x3a'),_0x3f2cfa[_0x8a90('0x10')],_0x48e098);_0x374391(_0x280114[_0x8a90('0xd')](0x1f4,_0x3f2cfa[_0x8a90('0x10')]));});});};exports[_0x8a90('0x3d')]=function(_0xf2a226){var _0x20e671=this;return new Promise(function(_0x5a5a2a,_0xef25a8){return db['CmHopper'][_0x8a90('0x13')]({'raw':_0xf2a226[_0x8a90('0x14')]?_0xf2a226[_0x8a90('0x14')][_0x8a90('0x1e')]===undefined?!![]:![]:!![],'where':_0xf2a226[_0x8a90('0x14')]?_0xf2a226[_0x8a90('0x14')][_0x8a90('0x15')]||null:null,'attributes':[[db[_0x8a90('0x2b')]['fn'](_0x8a90('0x3e'),db['sequelize']['fn']('IF',db[_0x8a90('0x2b')]['literal'](_0x8a90('0x3f')+util[_0x8a90('0x40')](_0x8a90('0x41'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'))+_0x8a90('0x42')))),_0x8a90('0x43')]]})[_0x8a90('0x8')](function(_0xb248a9){logger[_0x8a90('0x9')]('CountReScheduled',_0xf2a226);logger[_0x8a90('0x1b')]('CountReScheduled',_0xf2a226,JSON[_0x8a90('0xc')](_0xb248a9));_0x5a5a2a(_0xb248a9);})['catch'](function(_0x599580){logger[_0x8a90('0xd')]('CountReScheduled',_0x599580[_0x8a90('0x10')],_0xf2a226);_0xef25a8(_0x20e671[_0x8a90('0xd')](0x1f4,_0x599580[_0x8a90('0x10')]));});});};exports[_0x8a90('0x44')]=function(_0x3a8ed0){var _0x546c69=this;return new Promise(function(_0x4ae34e,_0x50c42d){return db[_0x8a90('0x29')][_0x8a90('0x2a')]()['then'](function(_0xd75bcb){return db[_0x8a90('0x2b')][_0x8a90('0x2c')](function(_0xa51778){return db['CmHopper'][_0x8a90('0x13')]({'where':_0x3a8ed0[_0x8a90('0x14')]?_0x3a8ed0[_0x8a90('0x14')]['where']||null:null,'attributes':_0x3a8ed0[_0x8a90('0x14')]?_0x3a8ed0[_0x8a90('0x14')]['attributes']||null:null,'limit':0x1,'order':_0x3a8ed0[_0x8a90('0x14')]?_0x3a8ed0[_0x8a90('0x14')]['order']||null:null,'group':db[_0x8a90('0x12')]['UserId'],'transaction':_0xa51778,'lock':_0xa51778['LOCK']['UPDATE'],'include':_0x3a8ed0[_0x8a90('0x14')]?_0x3a8ed0[_0x8a90('0x14')][_0x8a90('0x17')]?_['map'](_0x3a8ed0[_0x8a90('0x14')][_0x8a90('0x17')],function(_0x4aea5a){return{'model':db[_0x4aea5a[_0x8a90('0x18')]],'as':_0x4aea5a['as'],'attributes':_0x4aea5a[_0x8a90('0x16')],'include':_0x4aea5a[_0x8a90('0x17')]?_[_0x8a90('0x19')](_0x4aea5a['include'],function(_0xb6dc5e){return{'model':db[_0xb6dc5e[_0x8a90('0x18')]],'as':_0xb6dc5e['as'],'attributes':_0xb6dc5e[_0x8a90('0x16')],'include':_0xb6dc5e[_0x8a90('0x17')]?_[_0x8a90('0x19')](_0xb6dc5e['include'],function(_0x120ba1){return{'model':db[_0x120ba1[_0x8a90('0x18')]],'as':_0x120ba1['as'],'attributes':_0x120ba1[_0x8a90('0x16')]};}):[]};}):[]};}):[]:[]})[_0x8a90('0x8')](function(_0xd0e49e){var _0x45d2ba=[];for(var _0x2f46b1=0x0;_0x2f46b1<_0xd0e49e['length'];_0x2f46b1+=0x1){_0x45d2ba[_0x8a90('0x33')](_0xd0e49e[_0x2f46b1]['update'](_0x3a8ed0[_0x8a90('0x21')],{'transaction':_0xa51778}));}return BPromise[_0x8a90('0x35')](_0x45d2ba);});})[_0x8a90('0x8')](function(_0x193007){logger['info'](_0x8a90('0x44'),_0x3a8ed0);logger[_0x8a90('0x1b')]('GetContactRecallMe',_0x3a8ed0,JSON[_0x8a90('0xc')](_0x193007));_0x4ae34e(_0x193007);})[_0x8a90('0x11')](function(_0x4234ab){logger[_0x8a90('0xd')](_0x8a90('0x44'),_0x4234ab[_0x8a90('0x10')],_0x3a8ed0);_0x50c42d(_0x546c69[_0x8a90('0xd')](0x1f4,_0x4234ab['message']));});});});};exports[_0x8a90('0x45')]=function(_0x5c3757){var _0x1d4e55=this;return new Promise(function(_0x5b8285,_0x41e414){db[_0x8a90('0x29')][_0x8a90('0x2a')]()[_0x8a90('0x8')](function(_0x21da44){return db[_0x8a90('0x12')][_0x8a90('0x13')]({'raw':_0x5c3757[_0x8a90('0x14')]?_0x5c3757[_0x8a90('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x5c3757[_0x8a90('0x14')]?_0x5c3757['options']['where']||null:null,'attributes':_0x5c3757[_0x8a90('0x14')]?_0x5c3757[_0x8a90('0x14')]['attributes']||null:null,'limit':_0x5c3757['options']?_0x5c3757[_0x8a90('0x14')][_0x8a90('0x24')]||null:null,'include':_0x5c3757[_0x8a90('0x14')]?_0x5c3757['options']['include']?_['map'](_0x5c3757[_0x8a90('0x14')][_0x8a90('0x17')],function(_0x3e2744){return{'model':db[_0x3e2744[_0x8a90('0x18')]],'as':_0x3e2744['as'],'attributes':_0x3e2744['as']==='Contact'?_[_0x8a90('0x30')](_0x21da44):_0x3e2744[_0x8a90('0x16')],'include':_0x3e2744[_0x8a90('0x17')]?_[_0x8a90('0x19')](_0x3e2744['include'],function(_0x17f1d5){return{'model':db[_0x17f1d5['model']],'as':_0x17f1d5['as'],'attributes':_0x17f1d5[_0x8a90('0x16')],'include':_0x17f1d5[_0x8a90('0x17')]?_[_0x8a90('0x19')](_0x17f1d5[_0x8a90('0x17')],function(_0x1e5785){return{'model':db[_0x1e5785[_0x8a90('0x18')]],'as':_0x1e5785['as'],'attributes':_0x1e5785['attributes']};}):[]};}):[]};}):[]:[]})[_0x8a90('0x8')](function(_0x4449fb){logger[_0x8a90('0x9')](_0x8a90('0x1a'),_0x5c3757);logger[_0x8a90('0x1b')](_0x8a90('0x1a'),_0x5c3757,JSON[_0x8a90('0xc')](_0x4449fb));_0x5b8285(_0x4449fb);})[_0x8a90('0x11')](function(_0x463d95){logger[_0x8a90('0xd')]('GetCmHopper',_0x463d95[_0x8a90('0x10')],_0x5c3757);_0x41e414(_0x1d4e55[_0x8a90('0xd')](0x1f4,_0x463d95['message']));});});});};exports[_0x8a90('0x46')]=function(_0x133630){var _0x3defbc=this;return new Promise(function(_0x5883f2,_0x59108a){return db[_0x8a90('0x29')][_0x8a90('0x47')]({'raw':!![],'where':{'phone':_0x133630['options']['where'][_0x8a90('0x48')]},'attributes':['id',_0x8a90('0x49')],'order':[['id',_0x8a90('0x4a')]]})[_0x8a90('0x8')](function(_0x8c55ac){logger[_0x8a90('0x9')](_0x8a90('0x4b'),_0x133630);logger[_0x8a90('0x1b')](_0x8a90('0x4b'),_0x133630,JSON[_0x8a90('0xc')](_0x8c55ac));_0x5883f2(_0x8c55ac);})[_0x8a90('0x11')](function(_0x47c821){logger[_0x8a90('0xd')]('getContactByPhone',_0x47c821[_0x8a90('0x10')],_0x133630);_0x59108a(_0x3defbc['error'](0x1f4,_0x47c821[_0x8a90('0x10')]));});});};exports[_0x8a90('0x4c')]=function(_0x35566b){var _0x1d01de=this;return new Promise(function(_0x460f5f,_0xa10aea){return db[_0x8a90('0x2b')][_0x8a90('0x2c')](function(_0x690812){return db[_0x8a90('0x12')][_0x8a90('0x23')]({'active':![]},{'where':{},'transaction':_0x690812})[_0x8a90('0x8')](function(_0x583ba1){logger['info'](_0x8a90('0x4c'),_0x35566b);logger[_0x8a90('0x1b')](_0x8a90('0x4c'),_0x35566b,JSON[_0x8a90('0xc')](_0x583ba1));_0x460f5f(_0x583ba1);})[_0x8a90('0x11')](function(_0x397660){logger['error'](_0x8a90('0x4c'),_0x397660['message'],_0x35566b);_0xa10aea(_0x1d01de[_0x8a90('0xd')](0x1f4,_0x397660[_0x8a90('0x10')]));});});});};exports[_0x8a90('0x4d')]=function(_0x31b42b){var _0x2ace8f=this;var _0x2edda5=_0x31b42b[_0x8a90('0x21')][_0x8a90('0x15')]['voiceQueueIds'];var _0x898e4d=_0x31b42b[_0x8a90('0x21')][_0x8a90('0x15')][_0x8a90('0x4e')];var _0x1ef1a7=_0x31b42b[_0x8a90('0x21')]['where'][_0x8a90('0x4f')];return new Promise(function(_0x41de71,_0x4c48df){return db['CmHopper'][_0x8a90('0x13')]({'where':{'voiceQueueId':{'$in':_0x2edda5},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x8a90('0x2b')][_0x8a90('0x50')](_0x8a90('0x51')+_0x898e4d+_0x8a90('0x52')),'$gt':db[_0x8a90('0x2b')][_0x8a90('0x50')]('NOW()')}},'UserId':{'$in':_0x1ef1a7}},'include':[{'model':db['CmContact'],'as':'Contact'},{'model':db[_0x8a90('0x31')],'as':'Agent','attributes':['id',_0x8a90('0x53'),'voicePause']},{'model':db['CmList'],'as':_0x8a90('0x54')}]})['then'](function(_0x69ff03){if(_0x69ff03['length']>0x0){return db[_0x8a90('0x2b')]['transaction'](function(_0x4eea23){return db[_0x8a90('0x12')][_0x8a90('0x23')]({'recallmeNotifiedDate':db[_0x8a90('0x2b')]['literal'](_0x8a90('0x55'))},{'where':{'id':{'$in':_['map'](_0x69ff03,'id')}},'transaction':_0x4eea23})['then'](function(){_0x41de71(_0x69ff03);})[_0x8a90('0x11')](function(_0x10cd85){logger[_0x8a90('0xd')](_0x8a90('0x4d'),_0x10cd85[_0x8a90('0x10')],_0x31b42b);_0x4c48df(_0x2ace8f['error'](0x1f4,_0x10cd85[_0x8a90('0x10')]));});})[_0x8a90('0x11')](function(_0x21a7e9){logger['error'](_0x8a90('0x4d'),_0x21a7e9[_0x8a90('0x10')],_0x31b42b);_0x4c48df(_0x2ace8f[_0x8a90('0xd')](0x1f4,_0x21a7e9['message']));});}else{_0x41de71(_0x69ff03);}});});}; \ No newline at end of file +var _0xda20=['Contact','keys','name','voicePause','length','UserId','push','update','includes','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','transaction','CmHopperFinal','CountReScheduled','COUNT','literal','\x22%s\x22','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','order','all','GetCmHopperPreview','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','User','Agent','CmList','lodash','moment','../../config/logger','jayson/promise','client','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','GetCmHopper','CmHopper','options','attributes','include','map','model','catch','ShowCmHopper','find','where','CreateCmHopper','create','body','raw','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','findAll','limit','LOCK','UPDATE'];(function(_0x541c62,_0x218078){var _0x14a461=function(_0x555f6f){while(--_0x555f6f){_0x541c62['push'](_0x541c62['shift']());}};_0x14a461(++_0x218078);}(_0xda20,0x1d9));var _0x0da2=function(_0x307fda,_0x5d0274){_0x307fda=_0x307fda-0x0;var _0x4d0d0f=_0xda20[_0x307fda];return _0x4d0d0f;};'use strict';var _=require(_0x0da2('0x0'));var util=require('util');var moment=require(_0x0da2('0x1'));var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var logger=require(_0x0da2('0x2'))('rpc');var jayson=require(_0x0da2('0x3'));var client=jayson[_0x0da2('0x4')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e9887,_0x1ed66d,_0x5c1bcb){return new BPromise(function(_0x4674a3,_0x292ede){return client[_0x0da2('0x5')](_0x2e9887,_0x5c1bcb)[_0x0da2('0x6')](function(_0x1e5150){logger[_0x0da2('0x7')](_0x0da2('0x8'),_0x1ed66d,_0x0da2('0x9'));logger[_0x0da2('0xa')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x1ed66d,_0x0da2('0x9'),JSON[_0x0da2('0xb')](_0x1e5150));if(_0x1e5150[_0x0da2('0xc')]){if(_0x1e5150[_0x0da2('0xc')]['code']===0x1f4){logger['error'](_0x0da2('0x8'),_0x1ed66d,_0x1e5150[_0x0da2('0xc')][_0x0da2('0xd')]);return _0x292ede(_0x1e5150[_0x0da2('0xc')][_0x0da2('0xd')]);}logger[_0x0da2('0xc')](_0x0da2('0x8'),_0x1ed66d,_0x1e5150['error'][_0x0da2('0xd')]);return _0x4674a3(_0x1e5150['error']['message']);}else{logger['info'](_0x0da2('0x8'),_0x1ed66d,'request\x20sent');_0x4674a3(_0x1e5150[_0x0da2('0xe')][_0x0da2('0xd')]);}})['catch'](function(_0xa0613c){logger[_0x0da2('0xc')]('CmHopper,\x20%s,\x20%s',_0x1ed66d,_0xa0613c);_0x292ede(_0xa0613c);});});}exports[_0x0da2('0xf')]=function(_0x192772){var _0x2150ed=this;return new Promise(function(_0x5bd0a7,_0x209b8e){return db[_0x0da2('0x10')]['findAll']({'raw':_0x192772['options']?_0x192772[_0x0da2('0x11')]['raw']===undefined?!![]:![]:!![],'where':_0x192772[_0x0da2('0x11')]?_0x192772['options']['where']||null:null,'attributes':_0x192772['options']?_0x192772['options'][_0x0da2('0x12')]||null:null,'limit':_0x192772[_0x0da2('0x11')]?_0x192772[_0x0da2('0x11')]['limit']||null:null,'include':_0x192772['options']?_0x192772['options'][_0x0da2('0x13')]?_[_0x0da2('0x14')](_0x192772[_0x0da2('0x11')][_0x0da2('0x13')],function(_0x262630){return{'model':db[_0x262630['model']],'as':_0x262630['as'],'attributes':_0x262630[_0x0da2('0x12')],'include':_0x262630[_0x0da2('0x13')]?_[_0x0da2('0x14')](_0x262630[_0x0da2('0x13')],function(_0x336c76){return{'model':db[_0x336c76[_0x0da2('0x15')]],'as':_0x336c76['as'],'attributes':_0x336c76[_0x0da2('0x12')],'include':_0x336c76[_0x0da2('0x13')]?_[_0x0da2('0x14')](_0x336c76['include'],function(_0x43966a){return{'model':db[_0x43966a['model']],'as':_0x43966a['as'],'attributes':_0x43966a[_0x0da2('0x12')]};}):[]};}):[]};}):[]:[]})[_0x0da2('0x6')](function(_0x2aa651){logger[_0x0da2('0x7')]('GetCmHopper',_0x192772);logger[_0x0da2('0xa')](_0x0da2('0xf'),_0x192772,JSON[_0x0da2('0xb')](_0x2aa651));_0x5bd0a7(_0x2aa651);})[_0x0da2('0x16')](function(_0x22c6bf){logger['error'](_0x0da2('0xf'),_0x22c6bf['message'],_0x192772);_0x209b8e(_0x2150ed[_0x0da2('0xc')](0x1f4,_0x22c6bf[_0x0da2('0xd')]));});});};exports[_0x0da2('0x17')]=function(_0x3a2625){var _0x1d17ad=this;return new Promise(function(_0x103857,_0x44c3bb){return db[_0x0da2('0x10')][_0x0da2('0x18')]({'raw':_0x3a2625[_0x0da2('0x11')]?_0x3a2625[_0x0da2('0x11')]['raw']===undefined?!![]:![]:!![],'where':_0x3a2625['options']?_0x3a2625['options'][_0x0da2('0x19')]||null:null,'attributes':_0x3a2625[_0x0da2('0x11')]?_0x3a2625['options']['attributes']||null:null,'include':_0x3a2625[_0x0da2('0x11')]?_0x3a2625[_0x0da2('0x11')][_0x0da2('0x13')]?_[_0x0da2('0x14')](_0x3a2625['options'][_0x0da2('0x13')],function(_0x533ded){return{'model':db[_0x533ded[_0x0da2('0x15')]],'as':_0x533ded['as'],'attributes':_0x533ded[_0x0da2('0x12')],'include':_0x533ded[_0x0da2('0x13')]?_[_0x0da2('0x14')](_0x533ded[_0x0da2('0x13')],function(_0x411fa2){return{'model':db[_0x411fa2[_0x0da2('0x15')]],'as':_0x411fa2['as'],'attributes':_0x411fa2['attributes'],'include':_0x411fa2[_0x0da2('0x13')]?_[_0x0da2('0x14')](_0x411fa2[_0x0da2('0x13')],function(_0xbef5da){return{'model':db[_0xbef5da[_0x0da2('0x15')]],'as':_0xbef5da['as'],'attributes':_0xbef5da[_0x0da2('0x12')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x408b21){logger[_0x0da2('0x7')](_0x0da2('0x17'),_0x3a2625);logger[_0x0da2('0xa')]('ShowCmHopper',_0x3a2625,JSON['stringify'](_0x408b21));_0x103857(_0x408b21);})[_0x0da2('0x16')](function(_0x317e09){logger[_0x0da2('0xc')](_0x0da2('0x17'),_0x317e09[_0x0da2('0xd')],_0x3a2625);_0x44c3bb(_0x1d17ad[_0x0da2('0xc')](0x1f4,_0x317e09[_0x0da2('0xd')]));});});};exports[_0x0da2('0x1a')]=function(_0x267333){var _0x52c64b=this;return new Promise(function(_0x3e1e0f,_0x443314){return db[_0x0da2('0x10')][_0x0da2('0x1b')](_0x267333[_0x0da2('0x1c')],{'raw':_0x267333[_0x0da2('0x11')]?_0x267333[_0x0da2('0x11')][_0x0da2('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x2a5266){logger['info']('CreateCmHopper',_0x267333);logger[_0x0da2('0xa')]('CreateCmHopper',_0x267333,JSON[_0x0da2('0xb')](_0x2a5266));_0x3e1e0f(_0x2a5266);})[_0x0da2('0x16')](function(_0x365075){logger[_0x0da2('0xc')]('CreateCmHopper',_0x365075[_0x0da2('0xd')],_0x267333);_0x443314(_0x52c64b[_0x0da2('0xc')](0x1f4,_0x365075[_0x0da2('0xd')]));});});};exports[_0x0da2('0x1e')]=function(_0x40bbae){var _0x2d8139=this;return new Promise(function(_0x14e286,_0x1cb0f3){return db['CmHopper']['update'](_0x40bbae[_0x0da2('0x1c')],{'raw':_0x40bbae['options']?_0x40bbae[_0x0da2('0x11')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40bbae[_0x0da2('0x11')]?_0x40bbae['options']['where']||null:null,'attributes':_0x40bbae['options']?_0x40bbae[_0x0da2('0x11')][_0x0da2('0x12')]||null:null,'limit':_0x40bbae[_0x0da2('0x11')]?_0x40bbae[_0x0da2('0x11')]['limit']||null:null})[_0x0da2('0x6')](function(_0x4dfd09){logger[_0x0da2('0x7')](_0x0da2('0x1e'),_0x40bbae);logger['info'](_0x0da2('0x1f'),JSON[_0x0da2('0xb')](_0x40bbae[_0x0da2('0x11')][_0x0da2('0x19')]),_0x40bbae['body'][_0x0da2('0x20')]);logger[_0x0da2('0xa')]('UpdateCmHopper',_0x40bbae,JSON[_0x0da2('0xb')](_0x4dfd09));_0x14e286(_0x4dfd09);})[_0x0da2('0x16')](function(_0x221270){logger[_0x0da2('0xc')]('UpdateCmHopper',_0x221270[_0x0da2('0xd')],_0x40bbae);_0x1cb0f3(_0x2d8139['error'](0x1f4,_0x221270[_0x0da2('0xd')]));});});};exports[_0x0da2('0x21')]=function(_0x1cb401){var _0x19fc01=this;return new Promise(function(_0x2e36c6,_0x520804){return db[_0x0da2('0x10')][_0x0da2('0x22')]({'where':_0x1cb401[_0x0da2('0x11')]?_0x1cb401[_0x0da2('0x11')]['where']||null:null})[_0x0da2('0x6')](function(_0x2b50b7){logger[_0x0da2('0x7')](_0x0da2('0x21'),_0x1cb401);logger[_0x0da2('0xa')]('DestroyCmHopper',_0x1cb401,JSON[_0x0da2('0xb')](_0x2b50b7));_0x2e36c6(_0x2b50b7);})[_0x0da2('0x16')](function(_0x2937b8){logger[_0x0da2('0xc')](_0x0da2('0x21'),_0x2937b8[_0x0da2('0xd')],_0x1cb401);_0x520804(_0x19fc01[_0x0da2('0xc')](0x1f4,_0x2937b8['message']));});});};exports[_0x0da2('0x23')]=function(_0x5ef4ba){var _0x515612=this;return new Promise(function(_0x578fa1,_0x285acd){return db[_0x0da2('0x24')][_0x0da2('0x25')]()[_0x0da2('0x6')](function(_0x5537e4){return db[_0x0da2('0x26')]['transaction'](function(_0x4c33b2){return db['CmHopper'][_0x0da2('0x27')]({'where':_0x5ef4ba[_0x0da2('0x11')]?_0x5ef4ba[_0x0da2('0x11')][_0x0da2('0x19')]||null:null,'attributes':_0x5ef4ba['options']?_0x5ef4ba[_0x0da2('0x11')][_0x0da2('0x12')]||null:null,'limit':_0x5ef4ba[_0x0da2('0x11')]?_0x5ef4ba[_0x0da2('0x11')][_0x0da2('0x28')]||null:null,'order':_0x5ef4ba[_0x0da2('0x11')]?_0x5ef4ba[_0x0da2('0x11')]['order']||null:null,'transaction':_0x4c33b2,'lock':_0x4c33b2[_0x0da2('0x29')][_0x0da2('0x2a')],'include':[{'model':db[_0x0da2('0x24')],'as':_0x0da2('0x2b'),'attributes':_[_0x0da2('0x2c')](_0x5537e4)},{'model':db['User'],'as':'Agent','attributes':['id',_0x0da2('0x2d'),_0x0da2('0x2e')]}]})['then'](function(_0x4cffd1){var _0xd7a99c=[];var _0x2e6353=[];for(var _0x349c0a=0x0;_0x349c0a<_0x4cffd1[_0x0da2('0x2f')];_0x349c0a+=0x1){var _0x8c48d6=_0x4cffd1[_0x349c0a][_0x0da2('0x30')];if(_0x8c48d6===null){_0xd7a99c[_0x0da2('0x31')](_0x4cffd1[_0x349c0a][_0x0da2('0x32')](_0x5ef4ba[_0x0da2('0x1c')],{'transaction':_0x4c33b2}));}else if(!_0x2e6353[_0x0da2('0x33')](_0x8c48d6)){_0x2e6353[_0x0da2('0x31')](_0x8c48d6);_0xd7a99c[_0x0da2('0x31')](_0x4cffd1[_0x349c0a][_0x0da2('0x32')](_0x5ef4ba[_0x0da2('0x1c')],{'transaction':_0x4c33b2}));}}return BPromise['all'](_0xd7a99c);});})[_0x0da2('0x6')](function(_0x56ee74){logger['info'](_0x0da2('0x23'),_0x5ef4ba);if(_0x56ee74[_0x0da2('0x2f')]>0x0){logger[_0x0da2('0x7')](_0x0da2('0x34'),_0x56ee74[0x0][_0x0da2('0x35')]['id'],_0x56ee74[0x0][_0x0da2('0x35')][_0x0da2('0x36')],_0x56ee74[0x0]['dataValues']['active']);}logger[_0x0da2('0xa')]('GetContactDialer',_0x5ef4ba,JSON['stringify'](_0x56ee74));_0x578fa1(_0x56ee74);})[_0x0da2('0x16')](function(_0x3527cd){logger[_0x0da2('0xc')](_0x0da2('0x23'),_0x3527cd[_0x0da2('0xd')],_0x5ef4ba);_0x285acd(_0x515612[_0x0da2('0xc')](0x1f4,_0x3527cd['message']));});});});};exports[_0x0da2('0x37')]=function(_0xd2d895){var _0x1cfc42=this;return new Promise(function(_0x2a035c,_0x4d2cf9){return db[_0x0da2('0x26')][_0x0da2('0x38')](function(_0x49ef1d){return db[_0x0da2('0x39')]['create'](_0xd2d895[_0x0da2('0x1c')],{'raw':_0xd2d895[_0x0da2('0x11')]?_0xd2d895[_0x0da2('0x11')][_0x0da2('0x1d')]===undefined?!![]:![]:!![],'transaction':_0x49ef1d})[_0x0da2('0x6')](function(){logger[_0x0da2('0x7')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON['stringify'](_0xd2d895['options'][_0x0da2('0x19')]),_0xd2d895[_0x0da2('0x11')][_0x0da2('0x19')]['active']);return db['CmHopper'][_0x0da2('0x22')]({'where':_0xd2d895['options']?_0xd2d895[_0x0da2('0x11')][_0x0da2('0x19')]||null:null,'transaction':_0x49ef1d});});})[_0x0da2('0x6')](function(_0x1117c0){logger[_0x0da2('0x7')](_0x0da2('0x37'),_0xd2d895);logger[_0x0da2('0xa')](_0x0da2('0x37'),_0xd2d895,JSON[_0x0da2('0xb')](_0x1117c0));_0x2a035c(_0x1117c0);})['catch'](function(_0x4dbf48){logger[_0x0da2('0xc')](_0x0da2('0x37'),_0x4dbf48[_0x0da2('0xd')],_0xd2d895);_0x4d2cf9(_0x1cfc42[_0x0da2('0xc')](0x1f4,_0x4dbf48[_0x0da2('0xd')]));});});};exports[_0x0da2('0x3a')]=function(_0x220d4d){var _0x5c54d9=this;return new Promise(function(_0x925629,_0x1d21d7){return db[_0x0da2('0x10')][_0x0da2('0x27')]({'raw':_0x220d4d[_0x0da2('0x11')]?_0x220d4d[_0x0da2('0x11')][_0x0da2('0x1d')]===undefined?!![]:![]:!![],'where':_0x220d4d['options']?_0x220d4d[_0x0da2('0x11')][_0x0da2('0x19')]||null:null,'attributes':[[db['sequelize']['fn'](_0x0da2('0x3b'),db[_0x0da2('0x26')]['fn']('IF',db[_0x0da2('0x26')][_0x0da2('0x3c')]('`scheduledat`\x20>=\x20'+util['format'](_0x0da2('0x3d'),moment()[_0x0da2('0x3e')](_0x0da2('0x3f')))+_0x0da2('0x40')))),_0x0da2('0x41')]]})[_0x0da2('0x6')](function(_0x282a52){logger['info'](_0x0da2('0x3a'),_0x220d4d);logger[_0x0da2('0xa')](_0x0da2('0x3a'),_0x220d4d,JSON[_0x0da2('0xb')](_0x282a52));_0x925629(_0x282a52);})[_0x0da2('0x16')](function(_0x588e05){logger[_0x0da2('0xc')](_0x0da2('0x3a'),_0x588e05['message'],_0x220d4d);_0x1d21d7(_0x5c54d9[_0x0da2('0xc')](0x1f4,_0x588e05[_0x0da2('0xd')]));});});};exports[_0x0da2('0x42')]=function(_0x24ae1a){var _0x3ccef1=this;return new Promise(function(_0x3a6fa8,_0x2786bf){return db[_0x0da2('0x24')][_0x0da2('0x25')]()[_0x0da2('0x6')](function(_0x169f2b){return db[_0x0da2('0x26')]['transaction'](function(_0x50e3ce){return db[_0x0da2('0x10')][_0x0da2('0x27')]({'where':_0x24ae1a['options']?_0x24ae1a[_0x0da2('0x11')][_0x0da2('0x19')]||null:null,'attributes':_0x24ae1a[_0x0da2('0x11')]?_0x24ae1a[_0x0da2('0x11')][_0x0da2('0x12')]||null:null,'limit':0x1,'order':_0x24ae1a[_0x0da2('0x11')]?_0x24ae1a[_0x0da2('0x11')][_0x0da2('0x43')]||null:null,'group':db['CmHopper'][_0x0da2('0x30')],'transaction':_0x50e3ce,'lock':_0x50e3ce[_0x0da2('0x29')][_0x0da2('0x2a')],'include':_0x24ae1a[_0x0da2('0x11')]?_0x24ae1a[_0x0da2('0x11')][_0x0da2('0x13')]?_[_0x0da2('0x14')](_0x24ae1a[_0x0da2('0x11')][_0x0da2('0x13')],function(_0x5cb3a8){return{'model':db[_0x5cb3a8['model']],'as':_0x5cb3a8['as'],'attributes':_0x5cb3a8[_0x0da2('0x12')],'include':_0x5cb3a8['include']?_['map'](_0x5cb3a8[_0x0da2('0x13')],function(_0x10acc0){return{'model':db[_0x10acc0[_0x0da2('0x15')]],'as':_0x10acc0['as'],'attributes':_0x10acc0[_0x0da2('0x12')],'include':_0x10acc0[_0x0da2('0x13')]?_[_0x0da2('0x14')](_0x10acc0[_0x0da2('0x13')],function(_0x1bd6fc){return{'model':db[_0x1bd6fc[_0x0da2('0x15')]],'as':_0x1bd6fc['as'],'attributes':_0x1bd6fc['attributes']};}):[]};}):[]};}):[]:[]})[_0x0da2('0x6')](function(_0x466258){var _0x3a9925=[];for(var _0x47fedb=0x0;_0x47fedb<_0x466258[_0x0da2('0x2f')];_0x47fedb+=0x1){_0x3a9925[_0x0da2('0x31')](_0x466258[_0x47fedb][_0x0da2('0x32')](_0x24ae1a[_0x0da2('0x1c')],{'transaction':_0x50e3ce}));}return BPromise[_0x0da2('0x44')](_0x3a9925);});})[_0x0da2('0x6')](function(_0x3c0ec7){logger[_0x0da2('0x7')](_0x0da2('0x42'),_0x24ae1a);logger[_0x0da2('0xa')](_0x0da2('0x42'),_0x24ae1a,JSON['stringify'](_0x3c0ec7));_0x3a6fa8(_0x3c0ec7);})[_0x0da2('0x16')](function(_0x295aac){logger['error'](_0x0da2('0x42'),_0x295aac['message'],_0x24ae1a);_0x2786bf(_0x3ccef1[_0x0da2('0xc')](0x1f4,_0x295aac[_0x0da2('0xd')]));});});});};exports[_0x0da2('0x45')]=function(_0x3aa315){var _0x42d7f5=this;return new Promise(function(_0x4786ba,_0x111428){db['CmContact'][_0x0da2('0x25')]()[_0x0da2('0x6')](function(_0x572193){return db[_0x0da2('0x10')][_0x0da2('0x27')]({'raw':_0x3aa315[_0x0da2('0x11')]?_0x3aa315['options'][_0x0da2('0x1d')]===undefined?!![]:![]:!![],'where':_0x3aa315[_0x0da2('0x11')]?_0x3aa315[_0x0da2('0x11')]['where']||null:null,'attributes':_0x3aa315[_0x0da2('0x11')]?_0x3aa315[_0x0da2('0x11')][_0x0da2('0x12')]||null:null,'limit':_0x3aa315[_0x0da2('0x11')]?_0x3aa315[_0x0da2('0x11')][_0x0da2('0x28')]||null:null,'include':_0x3aa315[_0x0da2('0x11')]?_0x3aa315[_0x0da2('0x11')][_0x0da2('0x13')]?_[_0x0da2('0x14')](_0x3aa315[_0x0da2('0x11')][_0x0da2('0x13')],function(_0x1d27db){return{'model':db[_0x1d27db[_0x0da2('0x15')]],'as':_0x1d27db['as'],'attributes':_0x1d27db['as']===_0x0da2('0x2b')?_[_0x0da2('0x2c')](_0x572193):_0x1d27db['attributes'],'include':_0x1d27db[_0x0da2('0x13')]?_[_0x0da2('0x14')](_0x1d27db[_0x0da2('0x13')],function(_0x1f7da8){return{'model':db[_0x1f7da8[_0x0da2('0x15')]],'as':_0x1f7da8['as'],'attributes':_0x1f7da8[_0x0da2('0x12')],'include':_0x1f7da8[_0x0da2('0x13')]?_[_0x0da2('0x14')](_0x1f7da8[_0x0da2('0x13')],function(_0x5b4095){return{'model':db[_0x5b4095[_0x0da2('0x15')]],'as':_0x5b4095['as'],'attributes':_0x5b4095[_0x0da2('0x12')]};}):[]};}):[]};}):[]:[]})[_0x0da2('0x6')](function(_0x274896){logger['info']('GetCmHopper',_0x3aa315);logger[_0x0da2('0xa')](_0x0da2('0xf'),_0x3aa315,JSON[_0x0da2('0xb')](_0x274896));_0x4786ba(_0x274896);})[_0x0da2('0x16')](function(_0x5359ba){logger[_0x0da2('0xc')](_0x0da2('0xf'),_0x5359ba[_0x0da2('0xd')],_0x3aa315);_0x111428(_0x42d7f5[_0x0da2('0xc')](0x1f4,_0x5359ba[_0x0da2('0xd')]));});});});};exports['GetContactByPhone']=function(_0x3b368b){var _0x5b6838=this;return new Promise(function(_0x2bb4f1,_0x2e60bf){return db['CmContact'][_0x0da2('0x46')]({'raw':!![],'where':{'phone':_0x3b368b['options']['where'][_0x0da2('0x47')]},'attributes':['id',_0x0da2('0x48')],'order':[['id',_0x0da2('0x49')]]})['then'](function(_0x3ace5f){logger[_0x0da2('0x7')]('getContactByPhone',_0x3b368b);logger[_0x0da2('0xa')](_0x0da2('0x4a'),_0x3b368b,JSON[_0x0da2('0xb')](_0x3ace5f));_0x2bb4f1(_0x3ace5f);})[_0x0da2('0x16')](function(_0x45bafd){logger[_0x0da2('0xc')]('getContactByPhone',_0x45bafd[_0x0da2('0xd')],_0x3b368b);_0x2e60bf(_0x5b6838[_0x0da2('0xc')](0x1f4,_0x45bafd[_0x0da2('0xd')]));});});};exports[_0x0da2('0x4b')]=function(_0x4f8825){var _0x44ede6=this;return new Promise(function(_0x5764b0,_0x478c80){return db['sequelize'][_0x0da2('0x38')](function(_0x39fead){return db[_0x0da2('0x10')][_0x0da2('0x32')]({'active':![]},{'where':{},'transaction':_0x39fead})[_0x0da2('0x6')](function(_0x5996ba){logger[_0x0da2('0x7')](_0x0da2('0x4b'),_0x4f8825);logger['debug'](_0x0da2('0x4b'),_0x4f8825,JSON[_0x0da2('0xb')](_0x5996ba));_0x5764b0(_0x5996ba);})[_0x0da2('0x16')](function(_0x423132){logger[_0x0da2('0xc')]('ResetActiveCalls',_0x423132[_0x0da2('0xd')],_0x4f8825);_0x478c80(_0x44ede6['error'](0x1f4,_0x423132[_0x0da2('0xd')]));});});});};exports[_0x0da2('0x4c')]=function(_0x337aad){var _0x4c03b7=this;var _0x4af6dc=_0x337aad[_0x0da2('0x1c')]['where'][_0x0da2('0x4d')];var _0x11b9a5=_0x337aad['body']['where'][_0x0da2('0x4e')];var _0x3a39fa=_0x337aad[_0x0da2('0x1c')][_0x0da2('0x19')][_0x0da2('0x4f')];return new Promise(function(_0x42e597,_0x57f882){return db[_0x0da2('0x10')][_0x0da2('0x27')]({'where':{'voiceQueueId':{'$in':_0x4af6dc},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x0da2('0x26')][_0x0da2('0x3c')](_0x0da2('0x50')+_0x11b9a5+_0x0da2('0x51')),'$gt':db[_0x0da2('0x26')][_0x0da2('0x3c')](_0x0da2('0x52'))}},'UserId':{'$in':_0x3a39fa}},'include':[{'model':db['CmContact'],'as':_0x0da2('0x2b')},{'model':db[_0x0da2('0x53')],'as':_0x0da2('0x54'),'attributes':['id',_0x0da2('0x2d'),'voicePause']},{'model':db[_0x0da2('0x55')],'as':'List'}]})[_0x0da2('0x6')](function(_0x4c2c7b){if(_0x4c2c7b[_0x0da2('0x2f')]>0x0){return db[_0x0da2('0x26')][_0x0da2('0x38')](function(_0x425057){return db[_0x0da2('0x10')][_0x0da2('0x32')]({'recallmeNotifiedDate':db[_0x0da2('0x26')][_0x0da2('0x3c')](_0x0da2('0x52'))},{'where':{'id':{'$in':_[_0x0da2('0x14')](_0x4c2c7b,'id')}},'transaction':_0x425057})[_0x0da2('0x6')](function(){_0x42e597(_0x4c2c7b);})[_0x0da2('0x16')](function(_0x3381ea){logger[_0x0da2('0xc')]('CmHopperHandlePreviewRecallNotifications',_0x3381ea['message'],_0x337aad);_0x57f882(_0x4c03b7[_0x0da2('0xc')](0x1f4,_0x3381ea[_0x0da2('0xd')]));});})[_0x0da2('0x16')](function(_0x2cdc5f){logger[_0x0da2('0xc')](_0x0da2('0x4c'),_0x2cdc5f['message'],_0x337aad);_0x57f882(_0x4c03b7[_0x0da2('0xc')](0x1f4,_0x2cdc5f[_0x0da2('0xd')]));});}else{_0x42e597(_0x4c2c7b);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 71b318e..bf9754b 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 _0x61aa=['getPreviewRecall','create','post','/preview','getPreview','/timezone','getTimezone','put','update','destroy','exports','Router','../../components/auth/service','./cmHopper.controller','isAuthenticated','index','get','/describe','/opencontacts','getOpenContacts','getTimezones','/:id','/:id/previewrecall'];(function(_0x2d2597,_0x438e7c){var _0x4a50a1=function(_0x5e0eba){while(--_0x5e0eba){_0x2d2597['push'](_0x2d2597['shift']());}};_0x4a50a1(++_0x438e7c);}(_0x61aa,0x1c0));var _0xa61a=function(_0x50645c,_0x5e981b){_0x50645c=_0x50645c-0x0;var _0x50e2bf=_0x61aa[_0x50645c];return _0x50e2bf;};'use strict';var express=require('express');var router=express[_0xa61a('0x0')]();var auth=require(_0xa61a('0x1'));var controller=require(_0xa61a('0x2'));router['get']('/',auth[_0xa61a('0x3')](),controller[_0xa61a('0x4')]);router[_0xa61a('0x5')](_0xa61a('0x6'),auth['isAuthenticated'](),controller['describe']);router[_0xa61a('0x5')](_0xa61a('0x7'),auth[_0xa61a('0x3')](),controller[_0xa61a('0x8')]);router['get']('/timezones',auth[_0xa61a('0x3')](),controller[_0xa61a('0x9')]);router[_0xa61a('0x5')](_0xa61a('0xa'),auth[_0xa61a('0x3')](),controller['show']);router[_0xa61a('0x5')](_0xa61a('0xb'),auth[_0xa61a('0x3')](),controller[_0xa61a('0xc')]);router['post']('/',auth[_0xa61a('0x3')](),controller[_0xa61a('0xd')]);router[_0xa61a('0xe')](_0xa61a('0xf'),auth['isAuthenticated'](),controller[_0xa61a('0x10')]);router[_0xa61a('0xe')](_0xa61a('0x11'),auth[_0xa61a('0x3')](),controller[_0xa61a('0x12')]);router[_0xa61a('0x13')](_0xa61a('0xa'),auth[_0xa61a('0x3')](),controller[_0xa61a('0x14')]);router['delete']('/:id',auth[_0xa61a('0x3')](),controller[_0xa61a('0x15')]);module[_0xa61a('0x16')]=router; \ No newline at end of file +var _0xd072=['Router','../../components/auth/service','./cmHopper.controller','get','isAuthenticated','index','describe','/opencontacts','getOpenContacts','getTimezones','/:id','show','/:id/previewrecall','getPreviewRecall','post','/preview','getPreview','/timezone','put','update','delete','destroy'];(function(_0x5e1b91,_0x236f17){var _0x59b52f=function(_0x5c05ed){while(--_0x5c05ed){_0x5e1b91['push'](_0x5e1b91['shift']());}};_0x59b52f(++_0x236f17);}(_0xd072,0xdc));var _0x2d07=function(_0x16ca14,_0x36189b){_0x16ca14=_0x16ca14-0x0;var _0x3c8515=_0xd072[_0x16ca14];return _0x3c8515;};'use strict';var express=require('express');var router=express[_0x2d07('0x0')]();var auth=require(_0x2d07('0x1'));var controller=require(_0x2d07('0x2'));router[_0x2d07('0x3')]('/',auth[_0x2d07('0x4')](),controller[_0x2d07('0x5')]);router[_0x2d07('0x3')]('/describe',auth[_0x2d07('0x4')](),controller[_0x2d07('0x6')]);router[_0x2d07('0x3')](_0x2d07('0x7'),auth[_0x2d07('0x4')](),controller[_0x2d07('0x8')]);router['get']('/timezones',auth[_0x2d07('0x4')](),controller[_0x2d07('0x9')]);router[_0x2d07('0x3')](_0x2d07('0xa'),auth[_0x2d07('0x4')](),controller[_0x2d07('0xb')]);router[_0x2d07('0x3')](_0x2d07('0xc'),auth[_0x2d07('0x4')](),controller[_0x2d07('0xd')]);router[_0x2d07('0xe')]('/',auth[_0x2d07('0x4')](),controller['create']);router[_0x2d07('0xe')](_0x2d07('0xf'),auth[_0x2d07('0x4')](),controller[_0x2d07('0x10')]);router[_0x2d07('0xe')](_0x2d07('0x11'),auth[_0x2d07('0x4')](),controller['getTimezone']);router[_0x2d07('0x12')]('/:id',auth[_0x2d07('0x4')](),controller[_0x2d07('0x13')]);router[_0x2d07('0x14')]('/:id',auth[_0x2d07('0x4')](),controller[_0x2d07('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 0e5ed3d..0912541 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe1a2=['DATE','YYYY-MM-DD\x20HH:mm:ss','sequelize','INTEGER','STRING'];(function(_0x52f012,_0x4ac35c){var _0x1a8102=function(_0x568f3a){while(--_0x568f3a){_0x52f012['push'](_0x52f012['shift']());}};_0x1a8102(++_0x4ac35c);}(_0xe1a2,0xf7));var _0x2e1a=function(_0x40822a,_0x582b60){_0x40822a=_0x40822a-0x0;var _0x357420=_0xe1a2[_0x40822a];return _0x357420;};'use strict';var moment=require('moment');var Sequelize=require(_0x2e1a('0x0'));module['exports']={'CmHopperId':{'type':Sequelize[_0x2e1a('0x1')]},'phone':{'type':Sequelize[_0x2e1a('0x2')],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x2e1a('0x3')],'defaultValue':moment()['format'](_0x2e1a('0x4'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2e1a('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2e1a('0x1')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x2e1a('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x2e1a('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x2e1a('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x2e1a('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2e1a('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3d25=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','moment','sequelize','exports','STRING'];(function(_0x331c97,_0x77f3c3){var _0x21f9d3=function(_0x331fa3){while(--_0x331fa3){_0x331c97['push'](_0x331c97['shift']());}};_0x21f9d3(++_0x77f3c3);}(_0x3d25,0xec));var _0x53d2=function(_0x2356e3,_0x3c1521){_0x2356e3=_0x2356e3-0x0;var _0x12e9f7=_0x3d25[_0x2356e3];return _0x12e9f7;};'use strict';var moment=require(_0x53d2('0x0'));var Sequelize=require(_0x53d2('0x1'));module[_0x53d2('0x2')]={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0x53d2('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x53d2('0x4')],'defaultValue':moment()[_0x53d2('0x5')](_0x53d2('0x6'))},'countbusyretry':{'type':Sequelize[_0x53d2('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x53d2('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x53d2('0x7')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x53d2('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x53d2('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x53d2('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x53d2('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x53d2('0x7')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index 3a5ecc0..60eb1b8 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb3e=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','update','then','destroy','get','UserProfileResource','error','stack','name','send','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','params','find','create','body','user','role','CmHopperAdditionalPhones','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash'];(function(_0x1a80d3,_0x332848){var _0x1f7fea=function(_0x42acae){while(--_0x42acae){_0x1a80d3['push'](_0x1a80d3['shift']());}};_0x1f7fea(++_0x332848);}(_0xdb3e,0xd8));var _0xedb3=function(_0x261aff,_0x68235){_0x261aff=_0x261aff-0x0;var _0x13db19=_0xdb3e[_0x261aff];return _0x13db19;};'use strict';var emlformat=require(_0xedb3('0x0'));var rimraf=require(_0xedb3('0x1'));var zipdir=require(_0xedb3('0x2'));var jsonpatch=require(_0xedb3('0x3'));var rp=require(_0xedb3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xedb3('0x5'));var util=require(_0xedb3('0x6'));var path=require(_0xedb3('0x7'));var sox=require(_0xedb3('0x8'));var csv=require(_0xedb3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xedb3('0xa'));var _=require(_0xedb3('0xb'));var squel=require('squel');var crypto=require(_0xedb3('0xc'));var jsforce=require(_0xedb3('0xd'));var deskjs=require(_0xedb3('0xe'));var toCsv=require(_0xedb3('0x9'));var querystring=require(_0xedb3('0xf'));var Papa=require(_0xedb3('0x10'));var Redis=require(_0xedb3('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xedb3('0x12'));var logger=require('../../config/logger')(_0xedb3('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xedb3('0x14'));var db=require(_0xedb3('0x15'))['db'];function respondWithStatusCode(_0x38d359,_0x3386b1){_0x3386b1=_0x3386b1||0xcc;return function(_0x47e842){if(_0x47e842){return _0x38d359[_0xedb3('0x16')](_0x3386b1);}return _0x38d359[_0xedb3('0x17')](_0x3386b1)[_0xedb3('0x18')]();};}function respondWithResult(_0x260b59,_0x3b0556){_0x3b0556=_0x3b0556||0xc8;return function(_0x5de9bc){if(_0x5de9bc){return _0x260b59[_0xedb3('0x17')](_0x3b0556)[_0xedb3('0x19')](_0x5de9bc);}};}function respondWithFilteredResult(_0x424445,_0x17f6eb){return function(_0x1e56c6){if(_0x1e56c6){var _0x40fda2=typeof _0x17f6eb[_0xedb3('0x1a')]===_0xedb3('0x1b')&&typeof _0x17f6eb[_0xedb3('0x1c')]===_0xedb3('0x1b');var _0x55f5f7=_0x1e56c6[_0xedb3('0x1d')];var _0x341532=_0x40fda2?0x0:_0x17f6eb[_0xedb3('0x1a')];var _0x278d78=_0x40fda2?_0x1e56c6[_0xedb3('0x1d')]:_0x17f6eb[_0xedb3('0x1a')]+_0x17f6eb[_0xedb3('0x1c')];var _0x3c705c;if(_0x278d78>=_0x55f5f7){_0x278d78=_0x55f5f7;_0x3c705c=0xc8;}else{_0x3c705c=0xce;}_0x424445[_0xedb3('0x17')](_0x3c705c);return _0x424445[_0xedb3('0x1e')]('Content-Range',_0x341532+'-'+_0x278d78+'/'+_0x55f5f7)[_0xedb3('0x19')](_0x1e56c6);}return null;};}function patchUpdates(_0x477ab7){return function(_0x4bbc36){try{jsonpatch[_0xedb3('0x1f')](_0x4bbc36,_0x477ab7,!![]);}catch(_0x3ba468){return BPromise['reject'](_0x3ba468);}return _0x4bbc36['save']();};}function saveUpdates(_0x129bec,_0x265929){return function(_0x3cd36e){if(_0x3cd36e){return _0x3cd36e[_0xedb3('0x20')](_0x129bec)[_0xedb3('0x21')](function(_0x593f00){return _0x593f00;});}return null;};}function removeEntity(_0x42f0dd,_0x558fd8){return function(_0x5aa9b1){if(_0x5aa9b1){return _0x5aa9b1[_0xedb3('0x22')]()[_0xedb3('0x21')](function(){var _0x1744b5=_0x5aa9b1[_0xedb3('0x23')]({'plain':!![]});var _0xd043f='CmHopperAdditionalPhones';return db[_0xedb3('0x24')][_0xedb3('0x22')]({'where':{'type':_0xd043f,'resourceId':_0x1744b5['id']}})[_0xedb3('0x21')](function(){return _0x5aa9b1;});})[_0xedb3('0x21')](function(){_0x42f0dd[_0xedb3('0x17')](0xcc)[_0xedb3('0x18')]();});}};}function handleEntityNotFound(_0x26a432,_0x1f2237){return function(_0x1737e1){if(!_0x1737e1){_0x26a432[_0xedb3('0x16')](0x194);}return _0x1737e1;};}function handleError(_0x34618b,_0x962c4){_0x962c4=_0x962c4||0x1f4;return function(_0xbca688){logger[_0xedb3('0x25')](_0xbca688[_0xedb3('0x26')]);if(_0xbca688[_0xedb3('0x27')]){delete _0xbca688['name'];}_0x34618b[_0xedb3('0x17')](_0x962c4)[_0xedb3('0x28')](_0xbca688);};}exports['index']=function(_0x1a9307,_0x3f14c8){var _0x43f1e2={},_0x557d76={},_0x2410a6={'count':0x0,'rows':[]};var _0x4e842b=_[_0xedb3('0x29')](db[_0xedb3('0x2a')][_0xedb3('0x2b')],function(_0x23046a){return{'name':_0x23046a[_0xedb3('0x2c')],'type':_0x23046a[_0xedb3('0x2d')]['key']};});_0x557d76['model']=_[_0xedb3('0x29')](_0x4e842b,_0xedb3('0x27'));_0x557d76[_0xedb3('0x2e')]=_[_0xedb3('0x2f')](_0x1a9307['query']);_0x557d76['filters']=_[_0xedb3('0x30')](_0x557d76['model'],_0x557d76['query']);_0x43f1e2['attributes']=_[_0xedb3('0x30')](_0x557d76[_0xedb3('0x31')],qs[_0xedb3('0x32')](_0x1a9307[_0xedb3('0x2e')][_0xedb3('0x32')]));_0x43f1e2[_0xedb3('0x33')]=_0x43f1e2[_0xedb3('0x33')]['length']?_0x43f1e2['attributes']:_0x557d76[_0xedb3('0x31')];if(!_0x1a9307[_0xedb3('0x2e')][_0xedb3('0x34')](_0xedb3('0x35'))){_0x43f1e2['limit']=qs['limit'](_0x1a9307[_0xedb3('0x2e')]['limit']);_0x43f1e2[_0xedb3('0x1a')]=qs[_0xedb3('0x1a')](_0x1a9307[_0xedb3('0x2e')][_0xedb3('0x1a')]);}_0x43f1e2['order']=qs[_0xedb3('0x36')](_0x1a9307[_0xedb3('0x2e')][_0xedb3('0x36')]);_0x43f1e2[_0xedb3('0x37')]=qs[_0xedb3('0x38')](_[_0xedb3('0x39')](_0x1a9307[_0xedb3('0x2e')],_0x557d76['filters']),_0x4e842b);if(_0x1a9307[_0xedb3('0x2e')][_0xedb3('0x3a')]){_0x43f1e2[_0xedb3('0x37')]=_[_0xedb3('0x3b')](_0x43f1e2[_0xedb3('0x37')],{'$or':_[_0xedb3('0x29')](_0x4e842b,function(_0x15a8d4){if(_0x15a8d4[_0xedb3('0x2d')]!==_0xedb3('0x3c')){var _0x41c5ef={};_0x41c5ef[_0x15a8d4['name']]={'$like':'%'+_0x1a9307[_0xedb3('0x2e')][_0xedb3('0x3a')]+'%'};return _0x41c5ef;}})});}_0x43f1e2=_[_0xedb3('0x3b')]({},_0x43f1e2,_0x1a9307[_0xedb3('0x3d')]);var _0xb29015={'where':_0x43f1e2['where']};return db[_0xedb3('0x2a')][_0xedb3('0x1d')](_0xb29015)[_0xedb3('0x21')](function(_0x60533f){_0x2410a6[_0xedb3('0x1d')]=_0x60533f;if(_0x1a9307[_0xedb3('0x2e')][_0xedb3('0x3e')]){_0x43f1e2[_0xedb3('0x3f')]=[{'all':!![]}];}return db[_0xedb3('0x2a')]['findAll'](_0x43f1e2);})[_0xedb3('0x21')](function(_0x495236){_0x2410a6[_0xedb3('0x40')]=_0x495236;return _0x2410a6;})[_0xedb3('0x21')](respondWithFilteredResult(_0x3f14c8,_0x43f1e2))['catch'](handleError(_0x3f14c8,null));};exports['show']=function(_0x2cf52d,_0xdf84b4){var _0x48f0f5={'raw':!![],'where':{'id':_0x2cf52d[_0xedb3('0x41')]['id']}},_0x3ec986={};_0x3ec986[_0xedb3('0x31')]=_[_0xedb3('0x2f')](db['CmHopperAdditionalPhone'][_0xedb3('0x2b')]);_0x3ec986[_0xedb3('0x2e')]=_[_0xedb3('0x2f')](_0x2cf52d['query']);_0x3ec986[_0xedb3('0x38')]=_['intersection'](_0x3ec986['model'],_0x3ec986['query']);_0x48f0f5['attributes']=_[_0xedb3('0x30')](_0x3ec986[_0xedb3('0x31')],qs[_0xedb3('0x32')](_0x2cf52d['query'][_0xedb3('0x32')]));_0x48f0f5['attributes']=_0x48f0f5['attributes']['length']?_0x48f0f5[_0xedb3('0x33')]:_0x3ec986[_0xedb3('0x31')];if(_0x2cf52d['query'][_0xedb3('0x3e')]){_0x48f0f5['include']=[{'all':!![]}];}_0x48f0f5=_['merge']({},_0x48f0f5,_0x2cf52d[_0xedb3('0x3d')]);return db['CmHopperAdditionalPhone'][_0xedb3('0x42')](_0x48f0f5)[_0xedb3('0x21')](handleEntityNotFound(_0xdf84b4,null))[_0xedb3('0x21')](respondWithResult(_0xdf84b4,null))['catch'](handleError(_0xdf84b4,null));};exports['create']=function(_0x23373a,_0x29f82f){return db[_0xedb3('0x2a')][_0xedb3('0x43')](_0x23373a[_0xedb3('0x44')],{})[_0xedb3('0x21')](function(_0x2bef53){var _0x11c75c=_0x23373a[_0xedb3('0x45')][_0xedb3('0x23')]({'plain':!![]});if(!_0x11c75c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x11c75c[_0xedb3('0x46')]===_0xedb3('0x45')){var _0x582b3e=_0x2bef53['get']({'plain':!![]});var _0x1806e1=_0xedb3('0x47');return db['UserProfileSection'][_0xedb3('0x42')]({'where':{'name':_0x1806e1,'userProfileId':_0x11c75c[_0xedb3('0x48')]},'raw':!![]})['then'](function(_0x336cc3){if(_0x336cc3&&_0x336cc3[_0xedb3('0x49')]===0x0){return db[_0xedb3('0x24')][_0xedb3('0x43')]({'name':_0x582b3e[_0xedb3('0x27')],'resourceId':_0x582b3e['id'],'type':_0x336cc3[_0xedb3('0x27')],'sectionId':_0x336cc3['id']},{})['then'](function(){return _0x2bef53;});}else{return _0x2bef53;}})[_0xedb3('0x4a')](function(_0x55c516){logger[_0xedb3('0x25')](_0xedb3('0x4b'),_0x55c516);throw _0x55c516;});}return _0x2bef53;})[_0xedb3('0x21')](respondWithResult(_0x29f82f,0xc9))[_0xedb3('0x4a')](handleError(_0x29f82f,null));};exports[_0xedb3('0x20')]=function(_0x3a82fd,_0x2f3f60){if(_0x3a82fd[_0xedb3('0x44')]['id']){delete _0x3a82fd['body']['id'];}return db['CmHopperAdditionalPhone'][_0xedb3('0x42')]({'where':{'id':_0x3a82fd[_0xedb3('0x41')]['id']}})[_0xedb3('0x21')](handleEntityNotFound(_0x2f3f60,null))['then'](saveUpdates(_0x3a82fd['body'],null))[_0xedb3('0x21')](respondWithResult(_0x2f3f60,null))[_0xedb3('0x4a')](handleError(_0x2f3f60,null));};exports[_0xedb3('0x22')]=function(_0x3cc96a,_0x48bfda){return db[_0xedb3('0x2a')]['find']({'where':{'id':_0x3cc96a[_0xedb3('0x41')]['id']}})[_0xedb3('0x21')](handleEntityNotFound(_0x48bfda,null))[_0xedb3('0x21')](removeEntity(_0x48bfda,null))[_0xedb3('0x4a')](handleError(_0x48bfda,null));}; \ No newline at end of file +var _0x02c3=['destroy','get','CmHopperAdditionalPhones','UserProfileResource','error','stack','name','send','index','CmHopperAdditionalPhone','rawAttributes','type','key','model','map','query','keys','intersection','fields','attributes','hasOwnProperty','limit','sort','where','pick','filters','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','count','Content-Range','reject','save','update','then'];(function(_0x578f4e,_0x4290c2){var _0x990109=function(_0x36b762){while(--_0x36b762){_0x578f4e['push'](_0x578f4e['shift']());}};_0x990109(++_0x4290c2);}(_0x02c3,0x1c2));var _0x302c=function(_0x474802,_0x3bfa88){_0x474802=_0x474802-0x0;var _0x16f2bb=_0x02c3[_0x474802];return _0x16f2bb;};'use strict';var emlformat=require(_0x302c('0x0'));var rimraf=require(_0x302c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x302c('0x2'));var rp=require(_0x302c('0x3'));var moment=require(_0x302c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x302c('0x5'));var util=require('util');var path=require(_0x302c('0x6'));var sox=require(_0x302c('0x7'));var csv=require(_0x302c('0x8'));var ejs=require(_0x302c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x302c('0xa'));var squel=require(_0x302c('0xb'));var crypto=require(_0x302c('0xc'));var jsforce=require(_0x302c('0xd'));var deskjs=require(_0x302c('0xe'));var toCsv=require(_0x302c('0x8'));var querystring=require(_0x302c('0xf'));var Papa=require(_0x302c('0x10'));var Redis=require(_0x302c('0x11'));var authService=require(_0x302c('0x12'));var qs=require(_0x302c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x302c('0x14'));var logger=require('../../config/logger')(_0x302c('0x15'));var utils=require(_0x302c('0x16'));var config=require(_0x302c('0x17'));var licenseUtil=require(_0x302c('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54e676,_0xe6ea01){_0xe6ea01=_0xe6ea01||0xcc;return function(_0x232af7){if(_0x232af7){return _0x54e676[_0x302c('0x19')](_0xe6ea01);}return _0x54e676[_0x302c('0x1a')](_0xe6ea01)[_0x302c('0x1b')]();};}function respondWithResult(_0x42df44,_0x147627){_0x147627=_0x147627||0xc8;return function(_0x5f3e88){if(_0x5f3e88){return _0x42df44[_0x302c('0x1a')](_0x147627)[_0x302c('0x1c')](_0x5f3e88);}};}function respondWithFilteredResult(_0x286054,_0x1ee6c7){return function(_0x1afbbe){if(_0x1afbbe){var _0x58693d=typeof _0x1ee6c7[_0x302c('0x1d')]==='undefined'&&typeof _0x1ee6c7['limit']==='undefined';var _0x376059=_0x1afbbe[_0x302c('0x1e')];var _0x1b010c=_0x58693d?0x0:_0x1ee6c7[_0x302c('0x1d')];var _0x5439e2=_0x58693d?_0x1afbbe[_0x302c('0x1e')]:_0x1ee6c7[_0x302c('0x1d')]+_0x1ee6c7['limit'];var _0x5700ff;if(_0x5439e2>=_0x376059){_0x5439e2=_0x376059;_0x5700ff=0xc8;}else{_0x5700ff=0xce;}_0x286054['status'](_0x5700ff);return _0x286054['set'](_0x302c('0x1f'),_0x1b010c+'-'+_0x5439e2+'/'+_0x376059)[_0x302c('0x1c')](_0x1afbbe);}return null;};}function patchUpdates(_0x4bb425){return function(_0x3b50ab){try{jsonpatch['apply'](_0x3b50ab,_0x4bb425,!![]);}catch(_0x195eaf){return BPromise[_0x302c('0x20')](_0x195eaf);}return _0x3b50ab[_0x302c('0x21')]();};}function saveUpdates(_0x34da0d,_0x55c466){return function(_0x2be7b8){if(_0x2be7b8){return _0x2be7b8[_0x302c('0x22')](_0x34da0d)[_0x302c('0x23')](function(_0x48d205){return _0x48d205;});}return null;};}function removeEntity(_0x529afc,_0x4a282b){return function(_0x148bd0){if(_0x148bd0){return _0x148bd0[_0x302c('0x24')]()[_0x302c('0x23')](function(){var _0xa93cd8=_0x148bd0[_0x302c('0x25')]({'plain':!![]});var _0x1ea84f=_0x302c('0x26');return db[_0x302c('0x27')]['destroy']({'where':{'type':_0x1ea84f,'resourceId':_0xa93cd8['id']}})[_0x302c('0x23')](function(){return _0x148bd0;});})['then'](function(){_0x529afc[_0x302c('0x1a')](0xcc)[_0x302c('0x1b')]();});}};}function handleEntityNotFound(_0x350050,_0x377d3a){return function(_0x2c3ce1){if(!_0x2c3ce1){_0x350050[_0x302c('0x19')](0x194);}return _0x2c3ce1;};}function handleError(_0x3d0aaf,_0x387583){_0x387583=_0x387583||0x1f4;return function(_0x42a651){logger[_0x302c('0x28')](_0x42a651[_0x302c('0x29')]);if(_0x42a651[_0x302c('0x2a')]){delete _0x42a651[_0x302c('0x2a')];}_0x3d0aaf[_0x302c('0x1a')](_0x387583)[_0x302c('0x2b')](_0x42a651);};}exports[_0x302c('0x2c')]=function(_0x2a66ee,_0x23625b){var _0x199042={},_0x206d39={},_0xe25039={'count':0x0,'rows':[]};var _0x358cc5=_['map'](db[_0x302c('0x2d')][_0x302c('0x2e')],function(_0x4964bf){return{'name':_0x4964bf['fieldName'],'type':_0x4964bf[_0x302c('0x2f')][_0x302c('0x30')]};});_0x206d39[_0x302c('0x31')]=_[_0x302c('0x32')](_0x358cc5,_0x302c('0x2a'));_0x206d39[_0x302c('0x33')]=_[_0x302c('0x34')](_0x2a66ee['query']);_0x206d39['filters']=_[_0x302c('0x35')](_0x206d39[_0x302c('0x31')],_0x206d39[_0x302c('0x33')]);_0x199042['attributes']=_['intersection'](_0x206d39[_0x302c('0x31')],qs[_0x302c('0x36')](_0x2a66ee[_0x302c('0x33')]['fields']));_0x199042[_0x302c('0x37')]=_0x199042['attributes']['length']?_0x199042[_0x302c('0x37')]:_0x206d39[_0x302c('0x31')];if(!_0x2a66ee['query'][_0x302c('0x38')]('nolimit')){_0x199042['limit']=qs[_0x302c('0x39')](_0x2a66ee['query'][_0x302c('0x39')]);_0x199042[_0x302c('0x1d')]=qs[_0x302c('0x1d')](_0x2a66ee[_0x302c('0x33')]['offset']);}_0x199042['order']=qs[_0x302c('0x3a')](_0x2a66ee['query'][_0x302c('0x3a')]);_0x199042[_0x302c('0x3b')]=qs['filters'](_[_0x302c('0x3c')](_0x2a66ee[_0x302c('0x33')],_0x206d39[_0x302c('0x3d')]),_0x358cc5);if(_0x2a66ee[_0x302c('0x33')]['filter']){_0x199042[_0x302c('0x3b')]=_['merge'](_0x199042[_0x302c('0x3b')],{'$or':_[_0x302c('0x32')](_0x358cc5,function(_0x34b964){if(_0x34b964['type']!==_0x302c('0x3e')){var _0x29664b={};_0x29664b[_0x34b964[_0x302c('0x2a')]]={'$like':'%'+_0x2a66ee[_0x302c('0x33')]['filter']+'%'};return _0x29664b;}})});}_0x199042=_['merge']({},_0x199042,_0x2a66ee[_0x302c('0x3f')]);var _0x13bdae={'where':_0x199042[_0x302c('0x3b')]};return db[_0x302c('0x2d')][_0x302c('0x1e')](_0x13bdae)[_0x302c('0x23')](function(_0x3e1ef7){_0xe25039[_0x302c('0x1e')]=_0x3e1ef7;if(_0x2a66ee[_0x302c('0x33')][_0x302c('0x40')]){_0x199042['include']=[{'all':!![]}];}return db[_0x302c('0x2d')][_0x302c('0x41')](_0x199042);})['then'](function(_0x1af54f){_0xe25039[_0x302c('0x42')]=_0x1af54f;return _0xe25039;})['then'](respondWithFilteredResult(_0x23625b,_0x199042))[_0x302c('0x43')](handleError(_0x23625b,null));};exports[_0x302c('0x44')]=function(_0x55550f,_0x2a7741){var _0x24e189={'raw':!![],'where':{'id':_0x55550f[_0x302c('0x45')]['id']}},_0x4dfb37={};_0x4dfb37[_0x302c('0x31')]=_[_0x302c('0x34')](db['CmHopperAdditionalPhone'][_0x302c('0x2e')]);_0x4dfb37[_0x302c('0x33')]=_[_0x302c('0x34')](_0x55550f['query']);_0x4dfb37['filters']=_[_0x302c('0x35')](_0x4dfb37[_0x302c('0x31')],_0x4dfb37['query']);_0x24e189['attributes']=_[_0x302c('0x35')](_0x4dfb37[_0x302c('0x31')],qs['fields'](_0x55550f[_0x302c('0x33')][_0x302c('0x36')]));_0x24e189[_0x302c('0x37')]=_0x24e189[_0x302c('0x37')][_0x302c('0x46')]?_0x24e189['attributes']:_0x4dfb37[_0x302c('0x31')];if(_0x55550f[_0x302c('0x33')][_0x302c('0x40')]){_0x24e189[_0x302c('0x47')]=[{'all':!![]}];}_0x24e189=_['merge']({},_0x24e189,_0x55550f[_0x302c('0x3f')]);return db['CmHopperAdditionalPhone']['find'](_0x24e189)['then'](handleEntityNotFound(_0x2a7741,null))[_0x302c('0x23')](respondWithResult(_0x2a7741,null))[_0x302c('0x43')](handleError(_0x2a7741,null));};exports['create']=function(_0x2abfe4,_0x3f7385){return db[_0x302c('0x2d')][_0x302c('0x48')](_0x2abfe4[_0x302c('0x49')],{})[_0x302c('0x23')](function(_0x549123){var _0x34f3a9=_0x2abfe4[_0x302c('0x4a')]['get']({'plain':!![]});if(!_0x34f3a9)throw new Error(_0x302c('0x4b'));if(_0x34f3a9[_0x302c('0x4c')]===_0x302c('0x4a')){var _0x2354b2=_0x549123[_0x302c('0x25')]({'plain':!![]});var _0x2e0569=_0x302c('0x26');return db[_0x302c('0x4d')][_0x302c('0x4e')]({'where':{'name':_0x2e0569,'userProfileId':_0x34f3a9[_0x302c('0x4f')]},'raw':!![]})[_0x302c('0x23')](function(_0x3c02c4){if(_0x3c02c4&&_0x3c02c4[_0x302c('0x50')]===0x0){return db[_0x302c('0x27')][_0x302c('0x48')]({'name':_0x2354b2[_0x302c('0x2a')],'resourceId':_0x2354b2['id'],'type':_0x3c02c4['name'],'sectionId':_0x3c02c4['id']},{})[_0x302c('0x23')](function(){return _0x549123;});}else{return _0x549123;}})[_0x302c('0x43')](function(_0x3f3b35){logger[_0x302c('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3f3b35);throw _0x3f3b35;});}return _0x549123;})[_0x302c('0x23')](respondWithResult(_0x3f7385,0xc9))[_0x302c('0x43')](handleError(_0x3f7385,null));};exports[_0x302c('0x22')]=function(_0x3d0b68,_0x1732d8){if(_0x3d0b68[_0x302c('0x49')]['id']){delete _0x3d0b68['body']['id'];}return db['CmHopperAdditionalPhone'][_0x302c('0x4e')]({'where':{'id':_0x3d0b68[_0x302c('0x45')]['id']}})[_0x302c('0x23')](handleEntityNotFound(_0x1732d8,null))[_0x302c('0x23')](saveUpdates(_0x3d0b68['body'],null))[_0x302c('0x23')](respondWithResult(_0x1732d8,null))['catch'](handleError(_0x1732d8,null));};exports['destroy']=function(_0x249c6e,_0x37c069){return db[_0x302c('0x2d')][_0x302c('0x4e')]({'where':{'id':_0x249c6e[_0x302c('0x45')]['id']}})[_0x302c('0x23')](handleEntityNotFound(_0x37c069,null))[_0x302c('0x23')](removeEntity(_0x37c069,null))[_0x302c('0x43')](handleError(_0x37c069,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 43b47ca..08694bd 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1403=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','util'];(function(_0x498533,_0x54c434){var _0x1ebb11=function(_0x4654e1){while(--_0x4654e1){_0x498533['push'](_0x498533['shift']());}};_0x1ebb11(++_0x54c434);}(_0x1403,0x9b));var _0x3140=function(_0x73677e,_0x49e873){_0x73677e=_0x73677e-0x0;var _0x2103ee=_0x1403[_0x73677e];return _0x2103ee;};'use strict';var _=require('lodash');var util=require(_0x3140('0x0'));var logger=require(_0x3140('0x1'))(_0x3140('0x2'));var moment=require(_0x3140('0x3'));var BPromise=require(_0x3140('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3140('0x5'));var rimraf=require(_0x3140('0x6'));var config=require(_0x3140('0x7'));var attributes=require(_0x3140('0x8'));module['exports']=function(_0x5cb034,_0x5cfeb0){return _0x5cb034[_0x3140('0x9')](_0x3140('0xa'),attributes,{'tableName':_0x3140('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x655b=['api','moment','request-promise','path','rimraf','./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','../../config/logger'];(function(_0x4ba940,_0x7730f1){var _0x289f17=function(_0x14ac4c){while(--_0x14ac4c){_0x4ba940['push'](_0x4ba940['shift']());}};_0x289f17(++_0x7730f1);}(_0x655b,0x10e));var _0xb655=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x655b[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xb655('0x0'));var util=require(_0xb655('0x1'));var logger=require(_0xb655('0x2'))(_0xb655('0x3'));var moment=require(_0xb655('0x4'));var BPromise=require('bluebird');var rp=require(_0xb655('0x5'));var fs=require('fs');var path=require(_0xb655('0x6'));var rimraf=require(_0xb655('0x7'));var config=require('../../config/environment');var attributes=require(_0xb655('0x8'));module[_0xb655('0x9')]=function(_0x5ad07d,_0x301331){return _0x5ad07d[_0xb655('0xa')](_0xb655('0xb'),attributes,{'tableName':_0xb655('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js index 65ce0ad..8d2181a 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x867d=['CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','body','ContactId','ListId','VoiceQueueId','CampaignId','findOne','OrderBy','ASC','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','CmHopperAdditionalPhone','countnosuchnumberretry','countmachineretry','entity','SwapAdditionalPhones','CmHopper','duration','waitTime','isNil','scheduledat','add','minutes','phone','updatedAt','sequelize','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','field','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x25a821,_0x499e17){var _0x29617d=function(_0x154ada){while(--_0x154ada){_0x25a821['push'](_0x25a821['shift']());}};_0x29617d(++_0x499e17);}(_0x867d,0x18e));var _0xd867=function(_0x10533f,_0x496f5d){_0x10533f=_0x10533f-0x0;var _0x3db1db=_0x867d[_0x10533f];return _0x3db1db;};'use strict';var _=require(_0xd867('0x0'));var util=require(_0xd867('0x1'));var moment=require(_0xd867('0x2'));var BPromise=require(_0xd867('0x3'));var rs=require(_0xd867('0x4'));var fs=require('fs');var Redis=require(_0xd867('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd867('0x6'));var logger=require(_0xd867('0x7'))(_0xd867('0x8'));var config=require('../../config/environment');var jayson=require(_0xd867('0x9'));var client=jayson[_0xd867('0xa')][_0xd867('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x22f504,_0x18cedb,_0x3b693c){return new BPromise(function(_0x1d6f1c,_0x522c7a){return client[_0xd867('0xc')](_0x22f504,_0x3b693c)[_0xd867('0xd')](function(_0x33534a){logger[_0xd867('0xe')](_0xd867('0xf'),_0x18cedb,_0xd867('0x10'));logger[_0xd867('0x11')](_0xd867('0x12'),_0x18cedb,_0xd867('0x10'),JSON[_0xd867('0x13')](_0x33534a));if(_0x33534a[_0xd867('0x14')]){if(_0x33534a['error']['code']===0x1f4){logger['error']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x18cedb,_0x33534a[_0xd867('0x14')]['message']);return _0x522c7a(_0x33534a[_0xd867('0x14')][_0xd867('0x15')]);}logger[_0xd867('0x14')](_0xd867('0xf'),_0x18cedb,_0x33534a['error'][_0xd867('0x15')]);return _0x1d6f1c(_0x33534a[_0xd867('0x14')][_0xd867('0x15')]);}else{logger['info']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x18cedb,_0xd867('0x10'));_0x1d6f1c(_0x33534a[_0xd867('0x16')][_0xd867('0x15')]);}})[_0xd867('0x17')](function(_0x179f4d){logger[_0xd867('0x14')](_0xd867('0xf'),_0x18cedb,_0x179f4d);_0x522c7a(_0x179f4d);});});}exports['VerifyAdditionalPhones']=function(_0xd0d8a){var _0x981f78=this;return new Promise(function(_0x11fb9a,_0x5b4234){return db['CmHopper']['findOne']({'raw':!![],'where':{'ContactId':_0xd0d8a[_0xd867('0x18')][_0xd867('0x19')],'ListId':_0xd0d8a[_0xd867('0x18')][_0xd867('0x1a')],'VoiceQueueId':_0xd0d8a[_0xd867('0x18')]['VoiceQueueId']===undefined?null:_0xd0d8a[_0xd867('0x18')][_0xd867('0x1b')],'CampaignId':_0xd0d8a[_0xd867('0x18')][_0xd867('0x1c')]===undefined?null:_0xd0d8a[_0xd867('0x18')][_0xd867('0x1c')]}})['then'](function(_0x5d78fe){if(_0x5d78fe!=null){return db['CmHopperAdditionalPhone'][_0xd867('0x1d')]({'raw':!![],'where':{'CmHopperId':_0x5d78fe['id'],'OrderBy':{'$gt':_0x5d78fe[_0xd867('0x1e')]}},'order':[[_0xd867('0x1e'),_0xd867('0x1f')]]})['then'](function(_0x203e5c){var _0x5963bf=0x0;if(_0x203e5c){if(_0x203e5c[_0xd867('0x20')]+_0x203e5c[_0xd867('0x21')]+_0x203e5c[_0xd867('0x22')]+_0x203e5c['countnosuchnumberretry']+_0x203e5c[_0xd867('0x23')]+_0x203e5c[_0xd867('0x24')]+_0x203e5c['countmachineretry']+_0x203e5c[_0xd867('0x25')]<_0xd0d8a['entity'][_0xd867('0x26')])_0x5963bf=0x1;_0x11fb9a({'additional':_0x5963bf});}else{return db[_0xd867('0x27')][_0xd867('0x1d')]({'raw':!![],'where':{'CmHopperId':_0x5d78fe['id']},'order':[['OrderBy',_0xd867('0x1f')]]})[_0xd867('0xd')](function(_0x3e2239){var _0x5b4eed=0x0;if(_0x3e2239){if(_0x3e2239['countbusyretry']+_0x3e2239[_0xd867('0x21')]+_0x3e2239[_0xd867('0x22')]+_0x3e2239[_0xd867('0x28')]+_0x3e2239[_0xd867('0x23')]+_0x3e2239['countabandonedretry']+_0x3e2239[_0xd867('0x29')]+_0x3e2239[_0xd867('0x25')]<_0xd0d8a[_0xd867('0x2a')][_0xd867('0x26')])_0x5b4eed=0x1;_0x11fb9a({'additional':_0x5b4eed});}else{_0x11fb9a({'additional':0x0});}})[_0xd867('0x17')](function(_0x2f57b0){logger[_0xd867('0x14')]('VerifyAdditionalPhones',_0x2f57b0[_0xd867('0x15')]);_0x5b4234(_0x981f78[_0xd867('0x14')](0x1f4,_0x2f57b0['message']));});}})[_0xd867('0x17')](function(_0x4b0079){logger[_0xd867('0x14')]('VerifyAdditionalPhones',_0x4b0079['message']);_0x5b4234(_0x981f78[_0xd867('0x14')](0x1f4,_0x4b0079['message']));});}else _0x11fb9a({'additional':0x0});});});};exports[_0xd867('0x2b')]=function(_0xb859b5){var _0x298154=this;return new Promise(function(_0x9e431c,_0xb2f124){return db[_0xd867('0x2c')]['findOne']({'raw':!![],'where':{'ContactId':_0xb859b5['body']['ContactId'],'ListId':_0xb859b5['body'][_0xd867('0x1a')],'VoiceQueueId':_0xb859b5[_0xd867('0x18')][_0xd867('0x1b')]===undefined?null:_0xb859b5[_0xd867('0x18')][_0xd867('0x1b')],'CampaignId':_0xb859b5['body'][_0xd867('0x1c')]===undefined?null:_0xb859b5[_0xd867('0x18')][_0xd867('0x1c')]}})[_0xd867('0xd')](function(_0x2e5e32){if(_0x2e5e32!=null){return db[_0xd867('0x27')][_0xd867('0x1d')]({'raw':!![],'where':{'CmHopperId':_0x2e5e32['id'],'OrderBy':{'$gte':_0x2e5e32[_0xd867('0x1e')]}},'order':[['OrderBy',_0xd867('0x1f')]]})[_0xd867('0xd')](function(_0x3bf586){if(_0x3bf586)return activateAdditionalPhone(_0x2e5e32,_0xb859b5['body'],_0x3bf586,_0xb859b5[_0xd867('0x2d')],_0xb859b5['waitTime'])[_0xd867('0xd')](function(_0x464503){_0x9e431c(_0x464503);});else{return db[_0xd867('0x27')][_0xd867('0x1d')]({'raw':!![],'where':{'CmHopperId':_0x2e5e32['id']},'order':[[_0xd867('0x1e'),_0xd867('0x1f')]]})[_0xd867('0xd')](function(_0x47fda0){if(_0x47fda0)return activateAdditionalPhone(_0x2e5e32,_0xb859b5[_0xd867('0x18')],_0x47fda0,_0xb859b5[_0xd867('0x2d')],_0xb859b5[_0xd867('0x2e')])[_0xd867('0xd')](function(_0x364f9c){_0x9e431c(_0x364f9c);});else{_0x9e431c({'id':_0x2e5e32['id'],'phone':''});}})[_0xd867('0x17')](function(_0x2578d2){logger['error']('VerifyAdditionalPhones',_0x2578d2[_0xd867('0x15')]);_0xb2f124(_0x298154[_0xd867('0x14')](0x1f4,_0x2578d2['message']));});}})[_0xd867('0x17')](function(_0x5d3a22){logger['error']('VerifyAdditionalPhones',_0x5d3a22[_0xd867('0x15')]);_0xb2f124(_0x298154[_0xd867('0x14')](0x1f4,_0x5d3a22['message']));});}else _0x9e431c(0x1);});});};function activateAdditionalPhone(_0x2f7aad,_0x3e5aac,_0x3807ac,_0x443b69,_0x177a73){return new Promise(function(_0x4c1ed6,_0x567a33){var _0x1ade4d;if(_[_0xd867('0x2f')](_0x3807ac[_0xd867('0x30')])){_0x3807ac[_0xd867('0x30')]=moment();}if(moment()>moment(_0x3807ac[_0xd867('0x30')])){_0x1ade4d=moment()[_0xd867('0x31')](_0x177a73||0x3,_0xd867('0x32'));}else{if(_0x3807ac[_0xd867('0x1e')]==0x0){_0x1ade4d=moment(_0x3807ac[_0xd867('0x30')]);}else{_0x1ade4d=moment()[_0xd867('0x31')](_0x177a73||0x3,_0xd867('0x32'));}}if(_[_0xd867('0x2f')](_0x1ade4d)){_0x1ade4d=moment()[_0xd867('0x31')](_0x177a73||0x3,_0xd867('0x32'));}var _0x24c980={'phone':_0x2f7aad[_0xd867('0x33')],'active':0x0,'OrderBy':_[_0xd867('0x2f')](_0x2f7aad[_0xd867('0x1e')])?0x0:_0x2f7aad['OrderBy'],'scheduledat':moment()[_0xd867('0x31')](_0x443b69||0x1,_0xd867('0x32')),'countbusyretry':_0x3e5aac[_0xd867('0x20')],'countcongestionretry':_0x3e5aac['countcongestionretry'],'countnoanswerretry':_0x3e5aac['countnoanswerretry'],'countnosuchnumberretry':_0x3e5aac['countnosuchnumberretry'],'countdropretry':_0x3e5aac[_0xd867('0x23')],'countabandonedretry':_0x3e5aac[_0xd867('0x24')],'countmachineretry':_0x3e5aac[_0xd867('0x29')],'countagentrejectretry':_0x3e5aac[_0xd867('0x25')],'createdAt':_0x3e5aac['createdAt'],'updatedAt':_0x3e5aac[_0xd867('0x34')]};var _0x8e5fa8={'CmHopperId':_0x2f7aad['id'],'phone':_0x3807ac[_0xd867('0x33')],'active':0x0,'OrderBy':_[_0xd867('0x2f')](_0x3807ac[_0xd867('0x1e')])?0x0:_0x3807ac['OrderBy'],'scheduledat':_0x1ade4d,'countbusyretry':_0x3807ac['countbusyretry'],'countcongestionretry':_0x3807ac[_0xd867('0x21')],'countnoanswerretry':_0x3807ac['countnoanswerretry'],'countnosuchnumberretry':_0x3807ac['countnosuchnumberretry'],'countdropretry':_0x3807ac['countdropretry'],'countabandonedretry':_0x3807ac[_0xd867('0x24')],'countmachineretry':_0x3807ac[_0xd867('0x29')],'countagentrejectretry':_0x3807ac[_0xd867('0x25')],'createdAt':_0x3807ac['createdAt'],'updatedAt':_0x3807ac[_0xd867('0x34')]};return db[_0xd867('0x35')][_0xd867('0x36')](function(_0x56a205){return db['CmHopperAdditionalPhone'][_0xd867('0x37')](_0x24c980,{'where':{'id':_0x3807ac['id']}},{'transaction':_0x56a205})[_0xd867('0xd')](function(){return db[_0xd867('0x2c')][_0xd867('0x37')](_0x8e5fa8,{'where':{'id':_0x2f7aad['id']}},{'transaction':_0x56a205});});})[_0xd867('0xd')](function(_0x33fc57){_0x4c1ed6({'id':_0x2f7aad['id'],'phone':_0x3807ac[_0xd867('0x33')]});})['catch'](function(_0x2bc20b){logger[_0xd867('0x14')](_0xd867('0x38'),_0x2bc20b[_0xd867('0x15')]);_0x567a33({'error':_0x2bc20b['message']});});});}exports[_0xd867('0x39')]=function(_0x2cc7e3){var _0x48a9f4=this;return new Promise(function(_0x303b2a,_0x5a3d38){return db[_0xd867('0x2c')][_0xd867('0x37')](_0x2cc7e3[_0xd867('0x18')][_0xd867('0x3a')],{'where':{'id':_0x2cc7e3['body']['id']}})[_0xd867('0xd')](function(_0x4df8d9){_0x303b2a(_0x4df8d9);})[_0xd867('0x17')](function(_0x101a3c){logger[_0xd867('0x14')]('IncrementPreviewCounters',_0x101a3c[_0xd867('0x15')]);_0x5a3d38(_0x48a9f4[_0xd867('0x14')](0x1f4,_0x101a3c[_0xd867('0x15')]));});});}; \ No newline at end of file +var _0x8e8d=['jayson/promise','client','http','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','VerifyAdditionalPhones','CmHopper','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','ASC','SwapAdditionalPhones','duration','waitTime','isNil','scheduledat','add','minutes','phone','createdAt','updatedAt','sequelize','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','field','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x1fe8a4,_0xd9c7a7){var _0x5703e4=function(_0x5c0901){while(--_0x5c0901){_0x1fe8a4['push'](_0x1fe8a4['shift']());}};_0x5703e4(++_0xd9c7a7);}(_0x8e8d,0x1d7));var _0xd8e8=function(_0x5edc00,_0x3173fe){_0x5edc00=_0x5edc00-0x0;var _0x58a3b4=_0x8e8d[_0x5edc00];return _0x58a3b4;};'use strict';var _=require('lodash');var util=require(_0xd8e8('0x0'));var moment=require(_0xd8e8('0x1'));var BPromise=require(_0xd8e8('0x2'));var rs=require(_0xd8e8('0x3'));var fs=require('fs');var Redis=require(_0xd8e8('0x4'));var db=require(_0xd8e8('0x5'))['db'];var utils=require(_0xd8e8('0x6'));var logger=require('../../config/logger')(_0xd8e8('0x7'));var config=require(_0xd8e8('0x8'));var jayson=require(_0xd8e8('0x9'));var client=jayson[_0xd8e8('0xa')][_0xd8e8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x245211,_0x5370ef,_0x577133){return new BPromise(function(_0x25af71,_0x527f87){return client['request'](_0x245211,_0x577133)[_0xd8e8('0xc')](function(_0x1a233b){logger[_0xd8e8('0xd')](_0xd8e8('0xe'),_0x5370ef,_0xd8e8('0xf'));logger[_0xd8e8('0x10')](_0xd8e8('0x11'),_0x5370ef,_0xd8e8('0xf'),JSON[_0xd8e8('0x12')](_0x1a233b));if(_0x1a233b[_0xd8e8('0x13')]){if(_0x1a233b[_0xd8e8('0x13')][_0xd8e8('0x14')]===0x1f4){logger['error'](_0xd8e8('0xe'),_0x5370ef,_0x1a233b[_0xd8e8('0x13')]['message']);return _0x527f87(_0x1a233b[_0xd8e8('0x13')][_0xd8e8('0x15')]);}logger[_0xd8e8('0x13')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x5370ef,_0x1a233b[_0xd8e8('0x13')][_0xd8e8('0x15')]);return _0x25af71(_0x1a233b[_0xd8e8('0x13')][_0xd8e8('0x15')]);}else{logger[_0xd8e8('0xd')](_0xd8e8('0xe'),_0x5370ef,_0xd8e8('0xf'));_0x25af71(_0x1a233b['result'][_0xd8e8('0x15')]);}})[_0xd8e8('0x16')](function(_0x25c7f0){logger[_0xd8e8('0x13')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x5370ef,_0x25c7f0);_0x527f87(_0x25c7f0);});});}exports[_0xd8e8('0x17')]=function(_0x4c8c31){var _0x2d80c9=this;return new Promise(function(_0x3c39aa,_0x61542a){return db[_0xd8e8('0x18')][_0xd8e8('0x19')]({'raw':!![],'where':{'ContactId':_0x4c8c31[_0xd8e8('0x1a')][_0xd8e8('0x1b')],'ListId':_0x4c8c31[_0xd8e8('0x1a')][_0xd8e8('0x1c')],'VoiceQueueId':_0x4c8c31['body'][_0xd8e8('0x1d')]===undefined?null:_0x4c8c31[_0xd8e8('0x1a')][_0xd8e8('0x1d')],'CampaignId':_0x4c8c31[_0xd8e8('0x1a')]['CampaignId']===undefined?null:_0x4c8c31[_0xd8e8('0x1a')][_0xd8e8('0x1e')]}})['then'](function(_0x40247c){if(_0x40247c!=null){return db[_0xd8e8('0x1f')][_0xd8e8('0x19')]({'raw':!![],'where':{'CmHopperId':_0x40247c['id'],'OrderBy':{'$gt':_0x40247c[_0xd8e8('0x20')]}},'order':[[_0xd8e8('0x20'),'ASC']]})[_0xd8e8('0xc')](function(_0x3fcb82){var _0x52a847=0x0;if(_0x3fcb82){if(_0x3fcb82[_0xd8e8('0x21')]+_0x3fcb82[_0xd8e8('0x22')]+_0x3fcb82[_0xd8e8('0x23')]+_0x3fcb82[_0xd8e8('0x24')]+_0x3fcb82[_0xd8e8('0x25')]+_0x3fcb82[_0xd8e8('0x26')]+_0x3fcb82[_0xd8e8('0x27')]+_0x3fcb82[_0xd8e8('0x28')]<_0x4c8c31[_0xd8e8('0x29')][_0xd8e8('0x2a')])_0x52a847=0x1;_0x3c39aa({'additional':_0x52a847});}else{return db[_0xd8e8('0x1f')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x40247c['id']},'order':[['OrderBy',_0xd8e8('0x2b')]]})[_0xd8e8('0xc')](function(_0x4a4d86){var _0x56191d=0x0;if(_0x4a4d86){if(_0x4a4d86['countbusyretry']+_0x4a4d86['countcongestionretry']+_0x4a4d86[_0xd8e8('0x23')]+_0x4a4d86[_0xd8e8('0x24')]+_0x4a4d86[_0xd8e8('0x25')]+_0x4a4d86[_0xd8e8('0x26')]+_0x4a4d86[_0xd8e8('0x27')]+_0x4a4d86[_0xd8e8('0x28')]<_0x4c8c31['entity'][_0xd8e8('0x2a')])_0x56191d=0x1;_0x3c39aa({'additional':_0x56191d});}else{_0x3c39aa({'additional':0x0});}})[_0xd8e8('0x16')](function(_0x1e5681){logger['error']('VerifyAdditionalPhones',_0x1e5681[_0xd8e8('0x15')]);_0x61542a(_0x2d80c9[_0xd8e8('0x13')](0x1f4,_0x1e5681[_0xd8e8('0x15')]));});}})[_0xd8e8('0x16')](function(_0x32b7fe){logger[_0xd8e8('0x13')](_0xd8e8('0x17'),_0x32b7fe['message']);_0x61542a(_0x2d80c9[_0xd8e8('0x13')](0x1f4,_0x32b7fe['message']));});}else _0x3c39aa({'additional':0x0});});});};exports[_0xd8e8('0x2c')]=function(_0x14da9a){var _0x405c23=this;return new Promise(function(_0x7d187b,_0x3ef943){return db[_0xd8e8('0x18')]['findOne']({'raw':!![],'where':{'ContactId':_0x14da9a[_0xd8e8('0x1a')][_0xd8e8('0x1b')],'ListId':_0x14da9a[_0xd8e8('0x1a')]['ListId'],'VoiceQueueId':_0x14da9a[_0xd8e8('0x1a')][_0xd8e8('0x1d')]===undefined?null:_0x14da9a[_0xd8e8('0x1a')][_0xd8e8('0x1d')],'CampaignId':_0x14da9a[_0xd8e8('0x1a')][_0xd8e8('0x1e')]===undefined?null:_0x14da9a[_0xd8e8('0x1a')][_0xd8e8('0x1e')]}})[_0xd8e8('0xc')](function(_0x3779a5){if(_0x3779a5!=null){return db['CmHopperAdditionalPhone'][_0xd8e8('0x19')]({'raw':!![],'where':{'CmHopperId':_0x3779a5['id'],'OrderBy':{'$gte':_0x3779a5['OrderBy']}},'order':[[_0xd8e8('0x20'),_0xd8e8('0x2b')]]})['then'](function(_0x3a61ea){if(_0x3a61ea)return activateAdditionalPhone(_0x3779a5,_0x14da9a[_0xd8e8('0x1a')],_0x3a61ea,_0x14da9a[_0xd8e8('0x2d')],_0x14da9a['waitTime'])[_0xd8e8('0xc')](function(_0x44e889){_0x7d187b(_0x44e889);});else{return db[_0xd8e8('0x1f')][_0xd8e8('0x19')]({'raw':!![],'where':{'CmHopperId':_0x3779a5['id']},'order':[[_0xd8e8('0x20'),_0xd8e8('0x2b')]]})[_0xd8e8('0xc')](function(_0x586123){if(_0x586123)return activateAdditionalPhone(_0x3779a5,_0x14da9a[_0xd8e8('0x1a')],_0x586123,_0x14da9a[_0xd8e8('0x2d')],_0x14da9a[_0xd8e8('0x2e')])[_0xd8e8('0xc')](function(_0x1a3aa7){_0x7d187b(_0x1a3aa7);});else{_0x7d187b({'id':_0x3779a5['id'],'phone':''});}})[_0xd8e8('0x16')](function(_0x41c9b3){logger[_0xd8e8('0x13')](_0xd8e8('0x17'),_0x41c9b3[_0xd8e8('0x15')]);_0x3ef943(_0x405c23[_0xd8e8('0x13')](0x1f4,_0x41c9b3[_0xd8e8('0x15')]));});}})[_0xd8e8('0x16')](function(_0x11a3c3){logger[_0xd8e8('0x13')](_0xd8e8('0x17'),_0x11a3c3[_0xd8e8('0x15')]);_0x3ef943(_0x405c23[_0xd8e8('0x13')](0x1f4,_0x11a3c3[_0xd8e8('0x15')]));});}else _0x7d187b(0x1);});});};function activateAdditionalPhone(_0x3f6954,_0x19a6af,_0x5a5bf7,_0x1d33b,_0xb50480){return new Promise(function(_0x124980,_0x5ccb7b){var _0x716518;if(_[_0xd8e8('0x2f')](_0x5a5bf7[_0xd8e8('0x30')])){_0x5a5bf7[_0xd8e8('0x30')]=moment();}if(moment()>moment(_0x5a5bf7[_0xd8e8('0x30')])){_0x716518=moment()[_0xd8e8('0x31')](_0xb50480||0x3,_0xd8e8('0x32'));}else{if(_0x5a5bf7['OrderBy']==0x0){_0x716518=moment(_0x5a5bf7[_0xd8e8('0x30')]);}else{_0x716518=moment()['add'](_0xb50480||0x3,_0xd8e8('0x32'));}}if(_['isNil'](_0x716518)){_0x716518=moment()['add'](_0xb50480||0x3,_0xd8e8('0x32'));}var _0x4024bb={'phone':_0x3f6954[_0xd8e8('0x33')],'active':0x0,'OrderBy':_[_0xd8e8('0x2f')](_0x3f6954[_0xd8e8('0x20')])?0x0:_0x3f6954[_0xd8e8('0x20')],'scheduledat':moment()['add'](_0x1d33b||0x1,_0xd8e8('0x32')),'countbusyretry':_0x19a6af[_0xd8e8('0x21')],'countcongestionretry':_0x19a6af[_0xd8e8('0x22')],'countnoanswerretry':_0x19a6af[_0xd8e8('0x23')],'countnosuchnumberretry':_0x19a6af[_0xd8e8('0x24')],'countdropretry':_0x19a6af[_0xd8e8('0x25')],'countabandonedretry':_0x19a6af['countabandonedretry'],'countmachineretry':_0x19a6af[_0xd8e8('0x27')],'countagentrejectretry':_0x19a6af[_0xd8e8('0x28')],'createdAt':_0x19a6af[_0xd8e8('0x34')],'updatedAt':_0x19a6af[_0xd8e8('0x35')]};var _0x24d177={'CmHopperId':_0x3f6954['id'],'phone':_0x5a5bf7['phone'],'active':0x0,'OrderBy':_['isNil'](_0x5a5bf7[_0xd8e8('0x20')])?0x0:_0x5a5bf7[_0xd8e8('0x20')],'scheduledat':_0x716518,'countbusyretry':_0x5a5bf7['countbusyretry'],'countcongestionretry':_0x5a5bf7[_0xd8e8('0x22')],'countnoanswerretry':_0x5a5bf7[_0xd8e8('0x23')],'countnosuchnumberretry':_0x5a5bf7[_0xd8e8('0x24')],'countdropretry':_0x5a5bf7[_0xd8e8('0x25')],'countabandonedretry':_0x5a5bf7['countabandonedretry'],'countmachineretry':_0x5a5bf7[_0xd8e8('0x27')],'countagentrejectretry':_0x5a5bf7[_0xd8e8('0x28')],'createdAt':_0x5a5bf7[_0xd8e8('0x34')],'updatedAt':_0x5a5bf7[_0xd8e8('0x35')]};return db[_0xd8e8('0x36')][_0xd8e8('0x37')](function(_0x216252){return db[_0xd8e8('0x1f')][_0xd8e8('0x38')](_0x4024bb,{'where':{'id':_0x5a5bf7['id']}},{'transaction':_0x216252})[_0xd8e8('0xc')](function(){return db['CmHopper'][_0xd8e8('0x38')](_0x24d177,{'where':{'id':_0x3f6954['id']}},{'transaction':_0x216252});});})[_0xd8e8('0xc')](function(_0x21047a){_0x124980({'id':_0x3f6954['id'],'phone':_0x5a5bf7[_0xd8e8('0x33')]});})[_0xd8e8('0x16')](function(_0x4fde41){logger[_0xd8e8('0x13')](_0xd8e8('0x39'),_0x4fde41[_0xd8e8('0x15')]);_0x5ccb7b({'error':_0x4fde41[_0xd8e8('0x15')]});});});}exports[_0xd8e8('0x3a')]=function(_0x2b3383){var _0x18129c=this;return new Promise(function(_0x4f0e84,_0x20cf4d){return db[_0xd8e8('0x18')][_0xd8e8('0x38')](_0x2b3383['body'][_0xd8e8('0x3b')],{'where':{'id':_0x2b3383[_0xd8e8('0x1a')]['id']}})['then'](function(_0x2202b0){_0x4f0e84(_0x2202b0);})[_0xd8e8('0x16')](function(_0x2ae6f5){logger[_0xd8e8('0x13')]('IncrementPreviewCounters',_0x2ae6f5[_0xd8e8('0x15')]);_0x20cf4d(_0x18129c[_0xd8e8('0x13')](0x1f4,_0x2ae6f5[_0xd8e8('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index bfe5828..9d422ea 100644 --- a/server/api/cmHopperAdditionalPhone/index.js +++ b/server/api/cmHopperAdditionalPhone/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x99ab=['create','put','isAuthenticated','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','index','/:id','post'];(function(_0x225526,_0x2261a3){var _0xff9551=function(_0x12c125){while(--_0x12c125){_0x225526['push'](_0x225526['shift']());}};_0xff9551(++_0x2261a3);}(_0x99ab,0x146));var _0xb99a=function(_0x109b40,_0x1e01a2){_0x109b40=_0x109b40-0x0;var _0x4ba0e2=_0x99ab[_0x109b40];return _0x4ba0e2;};'use strict';var multer=require(_0xb99a('0x0'));var util=require(_0xb99a('0x1'));var path=require(_0xb99a('0x2'));var timeout=require(_0xb99a('0x3'));var express=require(_0xb99a('0x4'));var router=express[_0xb99a('0x5')]();var fs_extra=require(_0xb99a('0x6'));var auth=require(_0xb99a('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb99a('0x8'));var controller=require(_0xb99a('0x9'));router[_0xb99a('0xa')]('/',auth['isAuthenticated'](),controller[_0xb99a('0xb')]);router[_0xb99a('0xa')](_0xb99a('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xb99a('0xd')]('/',auth['isAuthenticated'](),controller[_0xb99a('0xe')]);router[_0xb99a('0xf')]('/:id',auth[_0xb99a('0x10')](),controller['update']);router[_0xb99a('0x11')](_0xb99a('0xc'),auth[_0xb99a('0x10')](),controller[_0xb99a('0x12')]);module[_0xb99a('0x13')]=router; \ No newline at end of file +var _0xbecf=['post','create','put','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','index','/:id','isAuthenticated','show'];(function(_0x1597e2,_0x388d3e){var _0x4c8c0a=function(_0x3d4795){while(--_0x3d4795){_0x1597e2['push'](_0x1597e2['shift']());}};_0x4c8c0a(++_0x388d3e);}(_0xbecf,0x15c));var _0xfbec=function(_0x2f968a,_0x37205f){_0x2f968a=_0x2f968a-0x0;var _0x10ff21=_0xbecf[_0x2f968a];return _0x10ff21;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfbec('0x0'));var timeout=require(_0xfbec('0x1'));var express=require(_0xfbec('0x2'));var router=express[_0xfbec('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xfbec('0x4'));var interaction=require(_0xfbec('0x5'));var config=require(_0xfbec('0x6'));var controller=require(_0xfbec('0x7'));router[_0xfbec('0x8')]('/',auth['isAuthenticated'](),controller[_0xfbec('0x9')]);router[_0xfbec('0x8')](_0xfbec('0xa'),auth[_0xfbec('0xb')](),controller[_0xfbec('0xc')]);router[_0xfbec('0xd')]('/',auth[_0xfbec('0xb')](),controller[_0xfbec('0xe')]);router[_0xfbec('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xfbec('0x10')](_0xfbec('0xa'),auth[_0xfbec('0xb')](),controller[_0xfbec('0x11')]);module[_0xfbec('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 0e2c969..feb756a 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 _0x52e3=['moment','exports','STRING','contactListQueue','INTEGER'];(function(_0x2cdc34,_0x15e0c1){var _0x2be714=function(_0x167959){while(--_0x167959){_0x2cdc34['push'](_0x2cdc34['shift']());}};_0x2be714(++_0x15e0c1);}(_0x52e3,0x159));var _0x352e=function(_0x545da0,_0x1637ac){_0x545da0=_0x545da0-0x0;var _0x2b8bde=_0x52e3[_0x545da0];return _0x2b8bde;};'use strict';var moment=require(_0x352e('0x0'));var Sequelize=require('sequelize');module[_0x352e('0x1')]={'phone':{'type':Sequelize[_0x352e('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x352e('0x3')},'ListId':{'type':Sequelize[_0x352e('0x4')],'unique':_0x352e('0x3')},'VoiceQueueId':{'type':Sequelize[_0x352e('0x4')],'unique':_0x352e('0x3')}}; \ No newline at end of file +var _0xea7e=['exports','INTEGER','contactListQueue','sequelize'];(function(_0x3ffbab,_0x2ee1b4){var _0x42b220=function(_0x11fece){while(--_0x11fece){_0x3ffbab['push'](_0x3ffbab['shift']());}};_0x42b220(++_0x2ee1b4);}(_0xea7e,0x143));var _0xeea7=function(_0x172268,_0x11e28c){_0x172268=_0x172268-0x0;var _0x27b551=_0xea7e[_0x172268];return _0x27b551;};'use strict';var moment=require('moment');var Sequelize=require(_0xeea7('0x0'));module[_0xeea7('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0xeea7('0x2')],'unique':_0xeea7('0x3')},'ListId':{'type':Sequelize[_0xeea7('0x2')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0xeea7('0x2')],'unique':_0xeea7('0x3')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 86e449c..68850ad 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 _0x530e=['includeAll','findAll','rows','show','params','include','catch','find','body','describe','zip-dir','moment','bluebird','util','path','sox','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','CmHopperBlack','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options'];(function(_0x11bd0d,_0xac2384){var _0x5e63b0=function(_0x3559dc){while(--_0x3559dc){_0x11bd0d['push'](_0x11bd0d['shift']());}};_0x5e63b0(++_0xac2384);}(_0x530e,0xe2));var _0xe530=function(_0x2dfc93,_0x1b2376){_0x2dfc93=_0x2dfc93-0x0;var _0x454eff=_0x530e[_0x2dfc93];return _0x454eff;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe530('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe530('0x1'));var BPromise=require(_0xe530('0x2'));var Mustache=require('mustache');var util=require(_0xe530('0x3'));var path=require(_0xe530('0x4'));var sox=require(_0xe530('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe530('0x6'));var _=require(_0xe530('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe530('0x8'));var deskjs=require(_0xe530('0x9'));var toCsv=require(_0xe530('0xa'));var querystring=require(_0xe530('0xb'));var Papa=require('papaparse');var Redis=require(_0xe530('0xc'));var authService=require(_0xe530('0xd'));var qs=require(_0xe530('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe530('0xf'));var logger=require(_0xe530('0x10'))(_0xe530('0x11'));var utils=require(_0xe530('0x12'));var config=require(_0xe530('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xe530('0x14'))['db'];function respondWithStatusCode(_0x434c50,_0x4708cb){_0x4708cb=_0x4708cb||0xcc;return function(_0x511983){if(_0x511983){return _0x434c50[_0xe530('0x15')](_0x4708cb);}return _0x434c50[_0xe530('0x16')](_0x4708cb)[_0xe530('0x17')]();};}function respondWithResult(_0xed904e,_0x2537dc){_0x2537dc=_0x2537dc||0xc8;return function(_0x24a93b){if(_0x24a93b){return _0xed904e[_0xe530('0x16')](_0x2537dc)[_0xe530('0x18')](_0x24a93b);}};}function respondWithFilteredResult(_0x271157,_0x14a7f4){return function(_0x53cd4e){if(_0x53cd4e){var _0x2d8506=typeof _0x14a7f4['offset']===_0xe530('0x19')&&typeof _0x14a7f4['limit']===_0xe530('0x19');var _0x34005c=_0x53cd4e[_0xe530('0x1a')];var _0x426cd9=_0x2d8506?0x0:_0x14a7f4['offset'];var _0x3cd116=_0x2d8506?_0x53cd4e[_0xe530('0x1a')]:_0x14a7f4[_0xe530('0x1b')]+_0x14a7f4[_0xe530('0x1c')];var _0x464183;if(_0x3cd116>=_0x34005c){_0x3cd116=_0x34005c;_0x464183=0xc8;}else{_0x464183=0xce;}_0x271157[_0xe530('0x16')](_0x464183);return _0x271157[_0xe530('0x1d')](_0xe530('0x1e'),_0x426cd9+'-'+_0x3cd116+'/'+_0x34005c)['json'](_0x53cd4e);}return null;};}function patchUpdates(_0x4a8a36){return function(_0x2a07f8){try{jsonpatch[_0xe530('0x1f')](_0x2a07f8,_0x4a8a36,!![]);}catch(_0x133ca8){return BPromise[_0xe530('0x20')](_0x133ca8);}return _0x2a07f8[_0xe530('0x21')]();};}function saveUpdates(_0xb10735,_0xbc227c){return function(_0x4e4e64){if(_0x4e4e64){return _0x4e4e64[_0xe530('0x22')](_0xb10735)[_0xe530('0x23')](function(_0x2558eb){return _0x2558eb;});}return null;};}function removeEntity(_0x3f8ee7,_0x5080e4){return function(_0x256da5){if(_0x256da5){return _0x256da5[_0xe530('0x24')]()['then'](function(){_0x3f8ee7[_0xe530('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x424158,_0x8e406){return function(_0xb3b1d7){if(!_0xb3b1d7){_0x424158[_0xe530('0x15')](0x194);}return _0xb3b1d7;};}function handleError(_0x405278,_0x4d5de6){_0x4d5de6=_0x4d5de6||0x1f4;return function(_0x3208ee){logger['error'](_0x3208ee[_0xe530('0x25')]);if(_0x3208ee[_0xe530('0x26')]){delete _0x3208ee['name'];}_0x405278[_0xe530('0x16')](_0x4d5de6)[_0xe530('0x27')](_0x3208ee);};}exports['index']=function(_0x498236,_0x259979){var _0x387b68={},_0x3d7eed={},_0x373b59={'count':0x0,'rows':[]};var _0x56a3c1=_['map'](db[_0xe530('0x28')][_0xe530('0x29')],function(_0x180459){return{'name':_0x180459[_0xe530('0x2a')],'type':_0x180459[_0xe530('0x2b')][_0xe530('0x2c')]};});_0x3d7eed[_0xe530('0x2d')]=_['map'](_0x56a3c1,_0xe530('0x26'));_0x3d7eed['query']=_[_0xe530('0x2e')](_0x498236[_0xe530('0x2f')]);_0x3d7eed[_0xe530('0x30')]=_[_0xe530('0x31')](_0x3d7eed[_0xe530('0x2d')],_0x3d7eed[_0xe530('0x2f')]);_0x387b68['attributes']=_[_0xe530('0x31')](_0x3d7eed[_0xe530('0x2d')],qs[_0xe530('0x32')](_0x498236[_0xe530('0x2f')][_0xe530('0x32')]));_0x387b68[_0xe530('0x33')]=_0x387b68['attributes'][_0xe530('0x34')]?_0x387b68['attributes']:_0x3d7eed[_0xe530('0x2d')];if(!_0x498236[_0xe530('0x2f')][_0xe530('0x35')](_0xe530('0x36'))){_0x387b68['limit']=qs[_0xe530('0x1c')](_0x498236[_0xe530('0x2f')]['limit']);_0x387b68[_0xe530('0x1b')]=qs['offset'](_0x498236[_0xe530('0x2f')][_0xe530('0x1b')]);}_0x387b68[_0xe530('0x37')]=qs[_0xe530('0x38')](_0x498236['query'][_0xe530('0x38')]);_0x387b68[_0xe530('0x39')]=qs['filters'](_[_0xe530('0x3a')](_0x498236[_0xe530('0x2f')],_0x3d7eed[_0xe530('0x30')]),_0x56a3c1);if(_0x498236[_0xe530('0x2f')][_0xe530('0x3b')]){_0x387b68[_0xe530('0x39')]=_[_0xe530('0x3c')](_0x387b68['where'],{'$or':_['map'](_0x56a3c1,function(_0x36912f){if(_0x36912f[_0xe530('0x2b')]!=='VIRTUAL'){var _0x428db5={};_0x428db5[_0x36912f['name']]={'$like':'%'+_0x498236[_0xe530('0x2f')][_0xe530('0x3b')]+'%'};return _0x428db5;}})});}_0x387b68=_['merge']({},_0x387b68,_0x498236[_0xe530('0x3d')]);var _0x187e06={'where':_0x387b68[_0xe530('0x39')]};return db[_0xe530('0x28')][_0xe530('0x1a')](_0x187e06)[_0xe530('0x23')](function(_0x491101){_0x373b59[_0xe530('0x1a')]=_0x491101;if(_0x498236[_0xe530('0x2f')][_0xe530('0x3e')]){_0x387b68['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0xe530('0x3f')](_0x387b68);})[_0xe530('0x23')](function(_0x1e4d5a){_0x373b59[_0xe530('0x40')]=_0x1e4d5a;return _0x373b59;})[_0xe530('0x23')](respondWithFilteredResult(_0x259979,_0x387b68))['catch'](handleError(_0x259979,null));};exports[_0xe530('0x41')]=function(_0x4a615c,_0x3f2258){var _0x807880={'raw':!![],'where':{'id':_0x4a615c[_0xe530('0x42')]['id']}},_0x22ecd8={};_0x22ecd8[_0xe530('0x2d')]=_[_0xe530('0x2e')](db[_0xe530('0x28')][_0xe530('0x29')]);_0x22ecd8[_0xe530('0x2f')]=_[_0xe530('0x2e')](_0x4a615c[_0xe530('0x2f')]);_0x22ecd8[_0xe530('0x30')]=_[_0xe530('0x31')](_0x22ecd8['model'],_0x22ecd8[_0xe530('0x2f')]);_0x807880[_0xe530('0x33')]=_[_0xe530('0x31')](_0x22ecd8[_0xe530('0x2d')],qs['fields'](_0x4a615c[_0xe530('0x2f')][_0xe530('0x32')]));_0x807880[_0xe530('0x33')]=_0x807880['attributes'][_0xe530('0x34')]?_0x807880[_0xe530('0x33')]:_0x22ecd8['model'];if(_0x4a615c[_0xe530('0x2f')][_0xe530('0x3e')]){_0x807880[_0xe530('0x43')]=[{'all':!![]}];}_0x807880=_[_0xe530('0x3c')]({},_0x807880,_0x4a615c[_0xe530('0x3d')]);return db[_0xe530('0x28')]['find'](_0x807880)[_0xe530('0x23')](handleEntityNotFound(_0x3f2258,null))[_0xe530('0x23')](respondWithResult(_0x3f2258,null))[_0xe530('0x44')](handleError(_0x3f2258,null));};exports[_0xe530('0x22')]=function(_0x559fbf,_0x112994){if(_0x559fbf['body']['id']){delete _0x559fbf['body']['id'];}return db[_0xe530('0x28')][_0xe530('0x45')]({'where':{'id':_0x559fbf[_0xe530('0x42')]['id']}})[_0xe530('0x23')](handleEntityNotFound(_0x112994,null))[_0xe530('0x23')](saveUpdates(_0x559fbf[_0xe530('0x46')],null))['then'](respondWithResult(_0x112994,null))['catch'](handleError(_0x112994,null));};exports[_0xe530('0x24')]=function(_0x1c573d,_0x2449c6){return db[_0xe530('0x28')][_0xe530('0x45')]({'where':{'id':_0x1c573d['params']['id']}})['then'](handleEntityNotFound(_0x2449c6,null))['then'](removeEntity(_0x2449c6,null))[_0xe530('0x44')](handleError(_0x2449c6,null));};exports[_0xe530('0x47')]=function(_0x13f353,_0x175efe){return db[_0xe530('0x28')]['describe']()[_0xe530('0x23')](respondWithResult(_0x175efe,null))[_0xe530('0x44')](handleError(_0x175efe,null));}; \ No newline at end of file +var _0x8558=['length','include','catch','update','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','then','destroy','sendStatus','error','name','map','CmHopperBlack','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','includeAll','findAll','rows','params'];(function(_0x15a17b,_0x3a97e4){var _0x4e36a5=function(_0x43facb){while(--_0x43facb){_0x15a17b['push'](_0x15a17b['shift']());}};_0x4e36a5(++_0x3a97e4);}(_0x8558,0x1b1));var _0x8855=function(_0x587816,_0x4d822d){_0x587816=_0x587816-0x0;var _0x31b5b2=_0x8558[_0x587816];return _0x31b5b2;};'use strict';var emlformat=require(_0x8855('0x0'));var rimraf=require(_0x8855('0x1'));var zipdir=require(_0x8855('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8855('0x3'));var moment=require(_0x8855('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8855('0x5'));var path=require(_0x8855('0x6'));var sox=require(_0x8855('0x7'));var csv=require(_0x8855('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8855('0x9'));var jsforce=require(_0x8855('0xa'));var deskjs=require(_0x8855('0xb'));var toCsv=require('to-csv');var querystring=require(_0x8855('0xc'));var Papa=require(_0x8855('0xd'));var Redis=require('ioredis');var authService=require(_0x8855('0xe'));var qs=require(_0x8855('0xf'));var as=require(_0x8855('0x10'));var hardwareService=require(_0x8855('0x11'));var logger=require(_0x8855('0x12'))(_0x8855('0x13'));var utils=require(_0x8855('0x14'));var config=require(_0x8855('0x15'));var licenseUtil=require(_0x8855('0x16'));var db=require(_0x8855('0x17'))['db'];function respondWithStatusCode(_0x36939a,_0xd70156){_0xd70156=_0xd70156||0xcc;return function(_0x4a4fee){if(_0x4a4fee){return _0x36939a['sendStatus'](_0xd70156);}return _0x36939a[_0x8855('0x18')](_0xd70156)[_0x8855('0x19')]();};}function respondWithResult(_0x18244a,_0x26c6d4){_0x26c6d4=_0x26c6d4||0xc8;return function(_0x273cda){if(_0x273cda){return _0x18244a[_0x8855('0x18')](_0x26c6d4)[_0x8855('0x1a')](_0x273cda);}};}function respondWithFilteredResult(_0x57e1bc,_0x1ea2b3){return function(_0x24f72d){if(_0x24f72d){var _0x3a117c=typeof _0x1ea2b3[_0x8855('0x1b')]===_0x8855('0x1c')&&typeof _0x1ea2b3['limit']===_0x8855('0x1c');var _0x3ca762=_0x24f72d[_0x8855('0x1d')];var _0x4893fe=_0x3a117c?0x0:_0x1ea2b3[_0x8855('0x1b')];var _0xaf35e0=_0x3a117c?_0x24f72d['count']:_0x1ea2b3['offset']+_0x1ea2b3[_0x8855('0x1e')];var _0x2dd7ba;if(_0xaf35e0>=_0x3ca762){_0xaf35e0=_0x3ca762;_0x2dd7ba=0xc8;}else{_0x2dd7ba=0xce;}_0x57e1bc[_0x8855('0x18')](_0x2dd7ba);return _0x57e1bc[_0x8855('0x1f')](_0x8855('0x20'),_0x4893fe+'-'+_0xaf35e0+'/'+_0x3ca762)[_0x8855('0x1a')](_0x24f72d);}return null;};}function patchUpdates(_0x3c4d78){return function(_0x5221d3){try{jsonpatch['apply'](_0x5221d3,_0x3c4d78,!![]);}catch(_0x31cbfb){return BPromise[_0x8855('0x21')](_0x31cbfb);}return _0x5221d3[_0x8855('0x22')]();};}function saveUpdates(_0x4574b0,_0x57b04d){return function(_0x54b412){if(_0x54b412){return _0x54b412['update'](_0x4574b0)[_0x8855('0x23')](function(_0x5339d0){return _0x5339d0;});}return null;};}function removeEntity(_0x31b4f9,_0x3f4aeb){return function(_0x134836){if(_0x134836){return _0x134836[_0x8855('0x24')]()[_0x8855('0x23')](function(){_0x31b4f9[_0x8855('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x152aaa,_0x468998){return function(_0x590f89){if(!_0x590f89){_0x152aaa[_0x8855('0x25')](0x194);}return _0x590f89;};}function handleError(_0x1046ab,_0x367be6){_0x367be6=_0x367be6||0x1f4;return function(_0x4bd368){logger[_0x8855('0x26')](_0x4bd368['stack']);if(_0x4bd368[_0x8855('0x27')]){delete _0x4bd368[_0x8855('0x27')];}_0x1046ab[_0x8855('0x18')](_0x367be6)['send'](_0x4bd368);};}exports['index']=function(_0x25e671,_0x360a4e){var _0x118852={},_0x48963d={},_0x3cde4c={'count':0x0,'rows':[]};var _0x5d3e52=_[_0x8855('0x28')](db[_0x8855('0x29')][_0x8855('0x2a')],function(_0x2c9898){return{'name':_0x2c9898['fieldName'],'type':_0x2c9898[_0x8855('0x2b')][_0x8855('0x2c')]};});_0x48963d[_0x8855('0x2d')]=_[_0x8855('0x28')](_0x5d3e52,_0x8855('0x27'));_0x48963d['query']=_[_0x8855('0x2e')](_0x25e671[_0x8855('0x2f')]);_0x48963d[_0x8855('0x30')]=_[_0x8855('0x31')](_0x48963d[_0x8855('0x2d')],_0x48963d[_0x8855('0x2f')]);_0x118852[_0x8855('0x32')]=_['intersection'](_0x48963d['model'],qs['fields'](_0x25e671[_0x8855('0x2f')][_0x8855('0x33')]));_0x118852[_0x8855('0x32')]=_0x118852[_0x8855('0x32')]['length']?_0x118852[_0x8855('0x32')]:_0x48963d[_0x8855('0x2d')];if(!_0x25e671[_0x8855('0x2f')][_0x8855('0x34')](_0x8855('0x35'))){_0x118852[_0x8855('0x1e')]=qs['limit'](_0x25e671[_0x8855('0x2f')]['limit']);_0x118852[_0x8855('0x1b')]=qs['offset'](_0x25e671[_0x8855('0x2f')]['offset']);}_0x118852[_0x8855('0x36')]=qs[_0x8855('0x37')](_0x25e671[_0x8855('0x2f')][_0x8855('0x37')]);_0x118852['where']=qs[_0x8855('0x30')](_['pick'](_0x25e671[_0x8855('0x2f')],_0x48963d[_0x8855('0x30')]),_0x5d3e52);if(_0x25e671['query'][_0x8855('0x38')]){_0x118852[_0x8855('0x39')]=_[_0x8855('0x3a')](_0x118852['where'],{'$or':_[_0x8855('0x28')](_0x5d3e52,function(_0x4e9810){if(_0x4e9810[_0x8855('0x2b')]!==_0x8855('0x3b')){var _0x4914bb={};_0x4914bb[_0x4e9810[_0x8855('0x27')]]={'$like':'%'+_0x25e671[_0x8855('0x2f')][_0x8855('0x38')]+'%'};return _0x4914bb;}})});}_0x118852=_[_0x8855('0x3a')]({},_0x118852,_0x25e671['options']);var _0x3200d5={'where':_0x118852[_0x8855('0x39')]};return db[_0x8855('0x29')]['count'](_0x3200d5)[_0x8855('0x23')](function(_0x2e91b7){_0x3cde4c['count']=_0x2e91b7;if(_0x25e671['query'][_0x8855('0x3c')]){_0x118852['include']=[{'all':!![]}];}return db[_0x8855('0x29')][_0x8855('0x3d')](_0x118852);})[_0x8855('0x23')](function(_0x78d9a8){_0x3cde4c[_0x8855('0x3e')]=_0x78d9a8;return _0x3cde4c;})[_0x8855('0x23')](respondWithFilteredResult(_0x360a4e,_0x118852))['catch'](handleError(_0x360a4e,null));};exports['show']=function(_0x49b87f,_0x58e124){var _0x9dd518={'raw':!![],'where':{'id':_0x49b87f[_0x8855('0x3f')]['id']}},_0x5af077={};_0x5af077[_0x8855('0x2d')]=_[_0x8855('0x2e')](db['CmHopperBlack']['rawAttributes']);_0x5af077['query']=_['keys'](_0x49b87f[_0x8855('0x2f')]);_0x5af077[_0x8855('0x30')]=_['intersection'](_0x5af077[_0x8855('0x2d')],_0x5af077[_0x8855('0x2f')]);_0x9dd518[_0x8855('0x32')]=_['intersection'](_0x5af077[_0x8855('0x2d')],qs['fields'](_0x49b87f[_0x8855('0x2f')][_0x8855('0x33')]));_0x9dd518[_0x8855('0x32')]=_0x9dd518['attributes'][_0x8855('0x40')]?_0x9dd518[_0x8855('0x32')]:_0x5af077[_0x8855('0x2d')];if(_0x49b87f[_0x8855('0x2f')][_0x8855('0x3c')]){_0x9dd518[_0x8855('0x41')]=[{'all':!![]}];}_0x9dd518=_[_0x8855('0x3a')]({},_0x9dd518,_0x49b87f['options']);return db[_0x8855('0x29')]['find'](_0x9dd518)[_0x8855('0x23')](handleEntityNotFound(_0x58e124,null))['then'](respondWithResult(_0x58e124,null))[_0x8855('0x42')](handleError(_0x58e124,null));};exports[_0x8855('0x43')]=function(_0x1beb83,_0x44dea0){if(_0x1beb83[_0x8855('0x44')]['id']){delete _0x1beb83[_0x8855('0x44')]['id'];}return db['CmHopperBlack'][_0x8855('0x45')]({'where':{'id':_0x1beb83[_0x8855('0x3f')]['id']}})[_0x8855('0x23')](handleEntityNotFound(_0x44dea0,null))[_0x8855('0x23')](saveUpdates(_0x1beb83['body'],null))[_0x8855('0x23')](respondWithResult(_0x44dea0,null))[_0x8855('0x42')](handleError(_0x44dea0,null));};exports[_0x8855('0x24')]=function(_0x13f4c9,_0x2adb93){return db[_0x8855('0x29')][_0x8855('0x45')]({'where':{'id':_0x13f4c9['params']['id']}})[_0x8855('0x23')](handleEntityNotFound(_0x2adb93,null))[_0x8855('0x23')](removeEntity(_0x2adb93,null))[_0x8855('0x42')](handleError(_0x2adb93,null));};exports[_0x8855('0x46')]=function(_0x2e3c37,_0x56007d){return db[_0x8855('0x29')][_0x8855('0x46')]()['then'](respondWithResult(_0x56007d,null))['catch'](handleError(_0x56007d,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 48052db..d9dc958 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 _0x9542=['cm_hopper_black','util','moment','request-promise','path','../../config/environment','./cmHopperBlack.attributes','CmHopperBlack'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9542,0x1c1));var _0x2954=function(_0xae5c9e,_0x57eeb1){_0xae5c9e=_0xae5c9e-0x0;var _0x5ddcc7=_0x9542[_0xae5c9e];return _0x5ddcc7;};'use strict';var _=require('lodash');var util=require(_0x2954('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x2954('0x1'));var BPromise=require('bluebird');var rp=require(_0x2954('0x2'));var fs=require('fs');var path=require(_0x2954('0x3'));var rimraf=require('rimraf');var config=require(_0x2954('0x4'));var attributes=require(_0x2954('0x5'));module['exports']=function(_0xcfa728,_0x237115){return _0xcfa728['define'](_0x2954('0x6'),attributes,{'tableName':_0x2954('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9e53=['exports','define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','bluebird','rimraf','./cmHopperBlack.attributes'];(function(_0x5b8685,_0x1a1c28){var _0xa3ef57=function(_0xa91aad){while(--_0xa91aad){_0x5b8685['push'](_0x5b8685['shift']());}};_0xa3ef57(++_0x1a1c28);}(_0x9e53,0x88));var _0x39e5=function(_0x37a3f3,_0x663b49){_0x37a3f3=_0x37a3f3-0x0;var _0x4da923=_0x9e53[_0x37a3f3];return _0x4da923;};'use strict';var _=require(_0x39e5('0x0'));var util=require(_0x39e5('0x1'));var logger=require(_0x39e5('0x2'))(_0x39e5('0x3'));var moment=require('moment');var BPromise=require(_0x39e5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x39e5('0x5'));var config=require('../../config/environment');var attributes=require(_0x39e5('0x6'));module[_0x39e5('0x7')]=function(_0x484314,_0x1e9922){return _0x484314[_0x39e5('0x8')](_0x39e5('0x9'),attributes,{'tableName':_0x39e5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 690acbc..b084346 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 _0x8263=['debug','UpdateCmHopperBlack','body','where','destroy','DestroyCmHopperBlack','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','attributes','limit','map','include','model'];(function(_0x25f6bb,_0x1f2f93){var _0x44feaa=function(_0x254fc7){while(--_0x254fc7){_0x25f6bb['push'](_0x25f6bb['shift']());}};_0x44feaa(++_0x1f2f93);}(_0x8263,0x19d));var _0x3826=function(_0x458d0a,_0x6ca969){_0x458d0a=_0x458d0a-0x0;var _0x9d4e30=_0x8263[_0x458d0a];return _0x9d4e30;};'use strict';var _=require(_0x3826('0x0'));var util=require('util');var moment=require(_0x3826('0x1'));var BPromise=require(_0x3826('0x2'));var rs=require(_0x3826('0x3'));var fs=require('fs');var Redis=require(_0x3826('0x4'));var db=require(_0x3826('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3826('0x6'));var config=require(_0x3826('0x7'));var jayson=require(_0x3826('0x8'));var client=jayson[_0x3826('0x9')][_0x3826('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x46584e,_0x1cba09,_0x4ec2b0){return new BPromise(function(_0x3e886d,_0x3c7699){return client[_0x3826('0xb')](_0x46584e,_0x4ec2b0)[_0x3826('0xc')](function(_0x305960){logger['info'](_0x3826('0xd'),_0x1cba09,_0x3826('0xe'));logger['debug']('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x1cba09,_0x3826('0xe'),JSON[_0x3826('0xf')](_0x305960));if(_0x305960[_0x3826('0x10')]){if(_0x305960[_0x3826('0x10')][_0x3826('0x11')]===0x1f4){logger['error'](_0x3826('0xd'),_0x1cba09,_0x305960[_0x3826('0x10')][_0x3826('0x12')]);return _0x3c7699(_0x305960['error'][_0x3826('0x12')]);}logger[_0x3826('0x10')](_0x3826('0xd'),_0x1cba09,_0x305960[_0x3826('0x10')][_0x3826('0x12')]);return _0x3e886d(_0x305960['error'][_0x3826('0x12')]);}else{logger[_0x3826('0x13')](_0x3826('0xd'),_0x1cba09,_0x3826('0xe'));_0x3e886d(_0x305960['result']['message']);}})[_0x3826('0x14')](function(_0x29da96){logger[_0x3826('0x10')](_0x3826('0xd'),_0x1cba09,_0x29da96);_0x3c7699(_0x29da96);});});}exports[_0x3826('0x15')]=function(_0xcd75a){var _0x950549=this;return new Promise(function(_0x5ba283,_0x1d7e1b){return db[_0x3826('0x16')][_0x3826('0x17')]({'raw':_0xcd75a[_0x3826('0x18')]?_0xcd75a[_0x3826('0x18')][_0x3826('0x19')]===undefined?!![]:![]:!![],'where':_0xcd75a['options']?_0xcd75a['options']['where']||null:null,'attributes':_0xcd75a[_0x3826('0x18')]?_0xcd75a[_0x3826('0x18')][_0x3826('0x1a')]||null:null,'limit':_0xcd75a[_0x3826('0x18')]?_0xcd75a[_0x3826('0x18')][_0x3826('0x1b')]||null:null,'include':_0xcd75a[_0x3826('0x18')]?_0xcd75a[_0x3826('0x18')]['include']?_[_0x3826('0x1c')](_0xcd75a[_0x3826('0x18')][_0x3826('0x1d')],function(_0x1540f2){return{'model':db[_0x1540f2[_0x3826('0x1e')]],'as':_0x1540f2['as'],'attributes':_0x1540f2['attributes'],'include':_0x1540f2[_0x3826('0x1d')]?_[_0x3826('0x1c')](_0x1540f2[_0x3826('0x1d')],function(_0x1f7c96){return{'model':db[_0x1f7c96[_0x3826('0x1e')]],'as':_0x1f7c96['as'],'attributes':_0x1f7c96[_0x3826('0x1a')],'include':_0x1f7c96['include']?_[_0x3826('0x1c')](_0x1f7c96[_0x3826('0x1d')],function(_0x4dd749){return{'model':db[_0x4dd749[_0x3826('0x1e')]],'as':_0x4dd749['as'],'attributes':_0x4dd749[_0x3826('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x3826('0xc')](function(_0x335121){logger[_0x3826('0x13')](_0x3826('0x15'),_0xcd75a);logger[_0x3826('0x1f')](_0x3826('0x15'),_0xcd75a,JSON[_0x3826('0xf')](_0x335121));_0x5ba283(_0x335121);})[_0x3826('0x14')](function(_0x52c461){logger[_0x3826('0x10')]('GetCmHopperBlack',_0x52c461[_0x3826('0x12')],_0xcd75a);_0x1d7e1b(_0x950549[_0x3826('0x10')](0x1f4,_0x52c461[_0x3826('0x12')]));});});};exports[_0x3826('0x20')]=function(_0x3e7ed8){var _0x5be3ee=this;return new Promise(function(_0x44e7df,_0x4c8301){return db[_0x3826('0x16')]['update'](_0x3e7ed8[_0x3826('0x21')],{'raw':_0x3e7ed8[_0x3826('0x18')]?_0x3e7ed8['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e7ed8[_0x3826('0x18')]?_0x3e7ed8[_0x3826('0x18')][_0x3826('0x22')]||null:null,'attributes':_0x3e7ed8[_0x3826('0x18')]?_0x3e7ed8[_0x3826('0x18')][_0x3826('0x1a')]||null:null,'limit':_0x3e7ed8[_0x3826('0x18')]?_0x3e7ed8[_0x3826('0x18')][_0x3826('0x1b')]||null:null})[_0x3826('0xc')](function(_0x1cdc73){logger[_0x3826('0x13')](_0x3826('0x20'),_0x3e7ed8);logger[_0x3826('0x1f')](_0x3826('0x20'),_0x3e7ed8,JSON[_0x3826('0xf')](_0x1cdc73));_0x44e7df(_0x1cdc73);})[_0x3826('0x14')](function(_0x401fc2){logger[_0x3826('0x10')](_0x3826('0x20'),_0x401fc2[_0x3826('0x12')],_0x3e7ed8);_0x4c8301(_0x5be3ee[_0x3826('0x10')](0x1f4,_0x401fc2['message']));});});};exports['DestroyCmHopperBlack']=function(_0x4a5712){var _0x3ad70c=this;return new Promise(function(_0x197343,_0x54e55d){return db[_0x3826('0x16')][_0x3826('0x23')]({'where':_0x4a5712[_0x3826('0x18')]?_0x4a5712['options'][_0x3826('0x22')]||null:null})['then'](function(_0xe3730f){logger[_0x3826('0x13')](_0x3826('0x24'),_0x4a5712);logger[_0x3826('0x1f')](_0x3826('0x24'),_0x4a5712,JSON[_0x3826('0xf')](_0xe3730f));_0x197343(_0xe3730f);})['catch'](function(_0x52d763){logger[_0x3826('0x10')](_0x3826('0x24'),_0x52d763[_0x3826('0x12')],_0x4a5712);_0x54e55d(_0x3ad70c[_0x3826('0x10')](0x1f4,_0x52d763[_0x3826('0x12')]));});});}; \ No newline at end of file +var _0xb0ed=['UpdateCmHopperBlack','destroy','DestroyCmHopperBlack','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','catch','GetCmHopperBlack','CmHopperBlack','options','raw','where','attributes','include','map','model','debug','update','body','limit'];(function(_0x53777b,_0x19b2a0){var _0x1855af=function(_0x5e547b){while(--_0x5e547b){_0x53777b['push'](_0x53777b['shift']());}};_0x1855af(++_0x19b2a0);}(_0xb0ed,0x10d));var _0xdb0e=function(_0x48591e,_0x30cabb){_0x48591e=_0x48591e-0x0;var _0x266a8d=_0xb0ed[_0x48591e];return _0x266a8d;};'use strict';var _=require(_0xdb0e('0x0'));var util=require(_0xdb0e('0x1'));var moment=require(_0xdb0e('0x2'));var BPromise=require(_0xdb0e('0x3'));var rs=require(_0xdb0e('0x4'));var fs=require('fs');var Redis=require(_0xdb0e('0x5'));var db=require(_0xdb0e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xdb0e('0x7'))(_0xdb0e('0x8'));var config=require(_0xdb0e('0x9'));var jayson=require(_0xdb0e('0xa'));var client=jayson[_0xdb0e('0xb')][_0xdb0e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x32b470,_0x315cb5,_0x4e8d69){return new BPromise(function(_0x574f93,_0x24b5f1){return client[_0xdb0e('0xd')](_0x32b470,_0x4e8d69)[_0xdb0e('0xe')](function(_0x1d4d0a){logger['info'](_0xdb0e('0xf'),_0x315cb5,_0xdb0e('0x10'));logger['debug']('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x315cb5,_0xdb0e('0x10'),JSON[_0xdb0e('0x11')](_0x1d4d0a));if(_0x1d4d0a[_0xdb0e('0x12')]){if(_0x1d4d0a[_0xdb0e('0x12')]['code']===0x1f4){logger['error'](_0xdb0e('0xf'),_0x315cb5,_0x1d4d0a[_0xdb0e('0x12')][_0xdb0e('0x13')]);return _0x24b5f1(_0x1d4d0a[_0xdb0e('0x12')]['message']);}logger[_0xdb0e('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x315cb5,_0x1d4d0a['error'][_0xdb0e('0x13')]);return _0x574f93(_0x1d4d0a[_0xdb0e('0x12')][_0xdb0e('0x13')]);}else{logger[_0xdb0e('0x14')](_0xdb0e('0xf'),_0x315cb5,'request\x20sent');_0x574f93(_0x1d4d0a['result'][_0xdb0e('0x13')]);}})[_0xdb0e('0x15')](function(_0x91cc92){logger[_0xdb0e('0x12')](_0xdb0e('0xf'),_0x315cb5,_0x91cc92);_0x24b5f1(_0x91cc92);});});}exports[_0xdb0e('0x16')]=function(_0x3bb29d){var _0x20e81e=this;return new Promise(function(_0x4bc243,_0x5be7d8){return db[_0xdb0e('0x17')]['findAll']({'raw':_0x3bb29d[_0xdb0e('0x18')]?_0x3bb29d[_0xdb0e('0x18')][_0xdb0e('0x19')]===undefined?!![]:![]:!![],'where':_0x3bb29d[_0xdb0e('0x18')]?_0x3bb29d['options'][_0xdb0e('0x1a')]||null:null,'attributes':_0x3bb29d['options']?_0x3bb29d[_0xdb0e('0x18')][_0xdb0e('0x1b')]||null:null,'limit':_0x3bb29d[_0xdb0e('0x18')]?_0x3bb29d[_0xdb0e('0x18')]['limit']||null:null,'include':_0x3bb29d[_0xdb0e('0x18')]?_0x3bb29d[_0xdb0e('0x18')][_0xdb0e('0x1c')]?_[_0xdb0e('0x1d')](_0x3bb29d['options'][_0xdb0e('0x1c')],function(_0x2fb6da){return{'model':db[_0x2fb6da[_0xdb0e('0x1e')]],'as':_0x2fb6da['as'],'attributes':_0x2fb6da['attributes'],'include':_0x2fb6da[_0xdb0e('0x1c')]?_[_0xdb0e('0x1d')](_0x2fb6da[_0xdb0e('0x1c')],function(_0x90903e){return{'model':db[_0x90903e[_0xdb0e('0x1e')]],'as':_0x90903e['as'],'attributes':_0x90903e['attributes'],'include':_0x90903e[_0xdb0e('0x1c')]?_[_0xdb0e('0x1d')](_0x90903e['include'],function(_0x553e2c){return{'model':db[_0x553e2c[_0xdb0e('0x1e')]],'as':_0x553e2c['as'],'attributes':_0x553e2c[_0xdb0e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xdb0e('0xe')](function(_0x1bf956){logger[_0xdb0e('0x14')](_0xdb0e('0x16'),_0x3bb29d);logger[_0xdb0e('0x1f')](_0xdb0e('0x16'),_0x3bb29d,JSON['stringify'](_0x1bf956));_0x4bc243(_0x1bf956);})['catch'](function(_0x37422f){logger['error']('GetCmHopperBlack',_0x37422f[_0xdb0e('0x13')],_0x3bb29d);_0x5be7d8(_0x20e81e[_0xdb0e('0x12')](0x1f4,_0x37422f['message']));});});};exports['UpdateCmHopperBlack']=function(_0x2dd825){var _0xa313d9=this;return new Promise(function(_0x405c6c,_0x3c5472){return db[_0xdb0e('0x17')][_0xdb0e('0x20')](_0x2dd825[_0xdb0e('0x21')],{'raw':_0x2dd825['options']?_0x2dd825[_0xdb0e('0x18')][_0xdb0e('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2dd825['options']?_0x2dd825[_0xdb0e('0x18')]['where']||null:null,'attributes':_0x2dd825['options']?_0x2dd825[_0xdb0e('0x18')][_0xdb0e('0x1b')]||null:null,'limit':_0x2dd825[_0xdb0e('0x18')]?_0x2dd825[_0xdb0e('0x18')][_0xdb0e('0x22')]||null:null})[_0xdb0e('0xe')](function(_0x475f5e){logger['info'](_0xdb0e('0x23'),_0x2dd825);logger[_0xdb0e('0x1f')](_0xdb0e('0x23'),_0x2dd825,JSON[_0xdb0e('0x11')](_0x475f5e));_0x405c6c(_0x475f5e);})[_0xdb0e('0x15')](function(_0x26dac1){logger[_0xdb0e('0x12')](_0xdb0e('0x23'),_0x26dac1[_0xdb0e('0x13')],_0x2dd825);_0x3c5472(_0xa313d9['error'](0x1f4,_0x26dac1[_0xdb0e('0x13')]));});});};exports['DestroyCmHopperBlack']=function(_0x40e9d3){var _0x16781e=this;return new Promise(function(_0x41912e,_0x3015d1){return db[_0xdb0e('0x17')][_0xdb0e('0x24')]({'where':_0x40e9d3[_0xdb0e('0x18')]?_0x40e9d3['options'][_0xdb0e('0x1a')]||null:null})['then'](function(_0x3b9e22){logger[_0xdb0e('0x14')](_0xdb0e('0x25'),_0x40e9d3);logger[_0xdb0e('0x1f')]('DestroyCmHopperBlack',_0x40e9d3,JSON[_0xdb0e('0x11')](_0x3b9e22));_0x41912e(_0x3b9e22);})[_0xdb0e('0x15')](function(_0x2483d8){logger[_0xdb0e('0x12')](_0xdb0e('0x25'),_0x2483d8[_0xdb0e('0x13')],_0x40e9d3);_0x3015d1(_0x16781e[_0xdb0e('0x12')](0x1f4,_0x2483d8[_0xdb0e('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index a814b21..3ca7a20 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 _0x3f8a=['describe','/:id','show','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe'];(function(_0xa93a2f,_0x5476f9){var _0x213dcd=function(_0x546804){while(--_0x546804){_0xa93a2f['push'](_0xa93a2f['shift']());}};_0x213dcd(++_0x5476f9);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x22ac8a,_0x200a2f){_0x22ac8a=_0x22ac8a-0x0;var _0x510d11=_0x3f8a[_0x22ac8a];return _0x510d11;};'use strict';var multer=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var path=require(_0xa3f8('0x2'));var timeout=require(_0xa3f8('0x3'));var express=require('express');var router=express[_0xa3f8('0x4')]();var fs_extra=require(_0xa3f8('0x5'));var auth=require(_0xa3f8('0x6'));var interaction=require(_0xa3f8('0x7'));var config=require(_0xa3f8('0x8'));var controller=require(_0xa3f8('0x9'));router[_0xa3f8('0xa')]('/',auth[_0xa3f8('0xb')](),controller[_0xa3f8('0xc')]);router[_0xa3f8('0xa')](_0xa3f8('0xd'),auth[_0xa3f8('0xb')](),controller[_0xa3f8('0xe')]);router[_0xa3f8('0xa')](_0xa3f8('0xf'),auth[_0xa3f8('0xb')](),controller[_0xa3f8('0x10')]);router['put'](_0xa3f8('0xf'),auth[_0xa3f8('0xb')](),controller[_0xa3f8('0x11')]);router[_0xa3f8('0x12')]('/:id',auth[_0xa3f8('0xb')](),controller[_0xa3f8('0x13')]);module[_0xa3f8('0x14')]=router; \ No newline at end of file +var _0x9a5a=['put','/:id','update','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','index','/describe','isAuthenticated','describe','show'];(function(_0x3b6b9f,_0x52565a){var _0xa0b5d=function(_0x5542c4){while(--_0x5542c4){_0x3b6b9f['push'](_0x3b6b9f['shift']());}};_0xa0b5d(++_0x52565a);}(_0x9a5a,0x194));var _0xa9a5=function(_0x313d69,_0x17ab68){_0x313d69=_0x313d69-0x0;var _0x45f293=_0x9a5a[_0x313d69];return _0x45f293;};'use strict';var multer=require(_0xa9a5('0x0'));var util=require(_0xa9a5('0x1'));var path=require(_0xa9a5('0x2'));var timeout=require(_0xa9a5('0x3'));var express=require(_0xa9a5('0x4'));var router=express['Router']();var fs_extra=require(_0xa9a5('0x5'));var auth=require(_0xa9a5('0x6'));var interaction=require(_0xa9a5('0x7'));var config=require(_0xa9a5('0x8'));var controller=require(_0xa9a5('0x9'));router[_0xa9a5('0xa')]('/',auth['isAuthenticated'](),controller[_0xa9a5('0xb')]);router[_0xa9a5('0xa')](_0xa9a5('0xc'),auth[_0xa9a5('0xd')](),controller[_0xa9a5('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xa9a5('0xf')]);router[_0xa9a5('0x10')](_0xa9a5('0x11'),auth[_0xa9a5('0xd')](),controller[_0xa9a5('0x12')]);router[_0xa9a5('0x13')](_0xa9a5('0x11'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 8d6ec36..8d8b19e 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 _0x40a4=['getDataValue','setDataValue','followuptime','diff','BOOLEAN','exports','INTEGER','STRING','DATE'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x40a4,0x125));var _0x440a=function(_0x1ffe0a,_0xe42a21){_0x1ffe0a=_0x1ffe0a-0x0;var _0x122b16=_0x40a4[_0x1ffe0a];return _0x122b16;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x440a('0x0')]={'state':{'type':Sequelize[_0x440a('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x440a('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x440a('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x440a('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x440a('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x440a('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x440a('0x2')]},'originatecalleridname':{'type':Sequelize[_0x440a('0x2')]},'calleridnum':{'type':Sequelize[_0x440a('0x2')]},'calleridname':{'type':Sequelize[_0x440a('0x2')]},'starttime':{'type':Sequelize[_0x440a('0x3')]},'responsetime':{'type':Sequelize[_0x440a('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x440a('0x3')]},'endtime':{'type':Sequelize[_0x440a('0x3')]},'ringtime':{'type':Sequelize[_0x440a('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x440a('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x440a('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x440a('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x440a('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x440a('0x2')]},'membername':{'type':Sequelize[_0x440a('0x2')]},'reason':{'type':Sequelize[_0x440a('0x2')]},'disposition':{'type':Sequelize[_0x440a('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x440a('0x2')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x3f25dd){var _0x15b42c=this[_0x440a('0x4')]('endtime');if(_0x15b42c&&_0x3f25dd){this[_0x440a('0x5')](_0x440a('0x6'),moment(_0x3f25dd)[_0x440a('0x7')](moment(_0x15b42c),'seconds'));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x440a('0x8')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x440a('0x8')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x440a('0x3')]},'callback':{'type':Sequelize[_0x440a('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x440a('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x440a('0x3')]},'deleted':{'type':Sequelize[_0x440a('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x440a('0x3')]},'recallme':{'type':Sequelize[_0x440a('0x8')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x440a('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0x440a('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x440a('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x440a('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x440a('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x440a('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6671=['exports','STRING','DATE','INTEGER','getDataValue','endtime','setDataValue','diff','seconds','BOOLEAN','moment'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x6671,0xba));var _0x1667=function(_0x2dd2b5,_0x10a9ad){_0x2dd2b5=_0x2dd2b5-0x0;var _0x3d25c7=_0x6671[_0x2dd2b5];return _0x3d25c7;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x1667('0x0'));module[_0x1667('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x1667('0x2')]},'scheduledat':{'type':Sequelize[_0x1667('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x1667('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x1667('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x1667('0x2')]},'originatecalleridname':{'type':Sequelize[_0x1667('0x2')]},'calleridnum':{'type':Sequelize[_0x1667('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x1667('0x3')]},'responsetime':{'type':Sequelize[_0x1667('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x1667('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x1667('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x1667('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x1667('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x1667('0x2')]},'campaigntype':{'type':Sequelize[_0x1667('0x2')]},'membername':{'type':Sequelize[_0x1667('0x2')]},'reason':{'type':Sequelize[_0x1667('0x2')]},'disposition':{'type':Sequelize[_0x1667('0x2')]},'secondDisposition':{'type':Sequelize[_0x1667('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x1667('0x3')],'set':function(_0x19309d){var _0x1ffa51=this[_0x1667('0x5')](_0x1667('0x6'));if(_0x1ffa51&&_0x19309d){this[_0x1667('0x7')]('followuptime',moment(_0x19309d)[_0x1667('0x8')](moment(_0x1ffa51),_0x1667('0x9')));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x1667('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x1667('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x1667('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x1667('0x3')]},'callback':{'type':Sequelize[_0x1667('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x1667('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x1667('0x3')]},'deleted':{'type':Sequelize[_0x1667('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x1667('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x1667('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x1667('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x1667('0x4')],'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 427d90f..1785573 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 _0x5496=['set','Content-Range','apply','reject','save','update','then','error','stack','name','index','CmHopperFinal','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','rows','catch','show','params','keys','fields','include','options','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','findAll','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','COUNT','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','dropContacts','abandonedContacts','reCallContacts','answeringMachine','into','cm_hopper','fromQuery','ListId','VoiceQueueId','createdAt','field','phone','NOW()','scheduledAt','ANY_VALUE(ContactId)','ContactId','ANY_VALUE(ListId)','updatedAt','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','from','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','CampaignId','ANY_VALUE(calleridnum)','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','lodash','crypto','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','end','status','json','undefined','limit','count'];(function(_0x1879d1,_0x1b7139){var _0x527ce4=function(_0x20ad36){while(--_0x20ad36){_0x1879d1['push'](_0x1879d1['shift']());}};_0x527ce4(++_0x1b7139);}(_0x5496,0x175));var _0x6549=function(_0xa5db37,_0x1de4a6){_0xa5db37=_0xa5db37-0x0;var _0xa6a11e=_0x5496[_0xa5db37];return _0xa6a11e;};'use strict';var emlformat=require(_0x6549('0x0'));var rimraf=require(_0x6549('0x1'));var zipdir=require(_0x6549('0x2'));var jsonpatch=require(_0x6549('0x3'));var rp=require(_0x6549('0x4'));var moment=require('moment');var BPromise=require(_0x6549('0x5'));var Mustache=require('mustache');var util=require(_0x6549('0x6'));var path=require(_0x6549('0x7'));var sox=require(_0x6549('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6549('0x9'));var _=require(_0x6549('0xa'));var squel=require('squel');var crypto=require(_0x6549('0xb'));var jsforce=require(_0x6549('0xc'));var deskjs=require(_0x6549('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6549('0xe'));var Papa=require(_0x6549('0xf'));var Redis=require(_0x6549('0x10'));var authService=require(_0x6549('0x11'));var qs=require(_0x6549('0x12'));var as=require(_0x6549('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6549('0x14'));var utils=require(_0x6549('0x15'));var config=require(_0x6549('0x16'));var licenseUtil=require(_0x6549('0x17'));var db=require(_0x6549('0x18'))['db'];function respondWithStatusCode(_0x5bc018,_0x4dfb06){_0x4dfb06=_0x4dfb06||0xcc;return function(_0x3f844f){if(_0x3f844f){return _0x5bc018[_0x6549('0x19')](_0x4dfb06);}return _0x5bc018['status'](_0x4dfb06)[_0x6549('0x1a')]();};}function respondWithResult(_0x150fc8,_0x195d25){_0x195d25=_0x195d25||0xc8;return function(_0x12b068){if(_0x12b068){return _0x150fc8[_0x6549('0x1b')](_0x195d25)[_0x6549('0x1c')](_0x12b068);}};}function respondWithFilteredResult(_0x55c112,_0x5db86d){return function(_0x384f75){if(_0x384f75){var _0x25da29=typeof _0x5db86d['offset']===_0x6549('0x1d')&&typeof _0x5db86d[_0x6549('0x1e')]===_0x6549('0x1d');var _0x387e60=_0x384f75[_0x6549('0x1f')];var _0x53b12b=_0x25da29?0x0:_0x5db86d['offset'];var _0x26a212=_0x25da29?_0x384f75['count']:_0x5db86d['offset']+_0x5db86d[_0x6549('0x1e')];var _0x1e5079;if(_0x26a212>=_0x387e60){_0x26a212=_0x387e60;_0x1e5079=0xc8;}else{_0x1e5079=0xce;}_0x55c112[_0x6549('0x1b')](_0x1e5079);return _0x55c112[_0x6549('0x20')](_0x6549('0x21'),_0x53b12b+'-'+_0x26a212+'/'+_0x387e60)['json'](_0x384f75);}return null;};}function patchUpdates(_0x228117){return function(_0x4b40c1){try{jsonpatch[_0x6549('0x22')](_0x4b40c1,_0x228117,!![]);}catch(_0x72322b){return BPromise[_0x6549('0x23')](_0x72322b);}return _0x4b40c1[_0x6549('0x24')]();};}function saveUpdates(_0x22bcf8,_0x12d547){return function(_0x427b47){if(_0x427b47){return _0x427b47[_0x6549('0x25')](_0x22bcf8)[_0x6549('0x26')](function(_0x6ae00c){return _0x6ae00c;});}return null;};}function removeEntity(_0x40d3f9,_0x1fbfa4){return function(_0x23c0ba){if(_0x23c0ba){return _0x23c0ba['destroy']()[_0x6549('0x26')](function(){_0x40d3f9[_0x6549('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x126967,_0x29f89e){return function(_0x3768cb){if(!_0x3768cb){_0x126967['sendStatus'](0x194);}return _0x3768cb;};}function handleError(_0x31a95,_0xfb51a1){_0xfb51a1=_0xfb51a1||0x1f4;return function(_0x14de1f){logger[_0x6549('0x27')](_0x14de1f[_0x6549('0x28')]);if(_0x14de1f[_0x6549('0x29')]){delete _0x14de1f[_0x6549('0x29')];}_0x31a95[_0x6549('0x1b')](_0xfb51a1)['send'](_0x14de1f);};}exports[_0x6549('0x2a')]=function(_0x136518,_0x17fdfb){var _0x4c605c={},_0x3f1502={},_0x4acaf5={'count':0x0,'rows':[]};var _0x4f0ad1=_['map'](db[_0x6549('0x2b')][_0x6549('0x2c')],function(_0x4f3069){return{'name':_0x4f3069[_0x6549('0x2d')],'type':_0x4f3069[_0x6549('0x2e')][_0x6549('0x2f')]};});_0x3f1502[_0x6549('0x30')]=_[_0x6549('0x31')](_0x4f0ad1,_0x6549('0x29'));_0x3f1502[_0x6549('0x32')]=_['keys'](_0x136518[_0x6549('0x32')]);_0x3f1502[_0x6549('0x33')]=_[_0x6549('0x34')](_0x3f1502[_0x6549('0x30')],_0x3f1502[_0x6549('0x32')]);_0x4c605c[_0x6549('0x35')]=_['intersection'](_0x3f1502[_0x6549('0x30')],qs['fields'](_0x136518[_0x6549('0x32')]['fields']));_0x4c605c[_0x6549('0x35')]=_0x4c605c[_0x6549('0x35')][_0x6549('0x36')]?_0x4c605c['attributes']:_0x3f1502[_0x6549('0x30')];if(!_0x136518[_0x6549('0x32')][_0x6549('0x37')](_0x6549('0x38'))){_0x4c605c['limit']=qs['limit'](_0x136518['query'][_0x6549('0x1e')]);_0x4c605c[_0x6549('0x39')]=qs['offset'](_0x136518[_0x6549('0x32')][_0x6549('0x39')]);}_0x4c605c[_0x6549('0x3a')]=qs[_0x6549('0x3b')](_0x136518[_0x6549('0x32')]['sort']);_0x4c605c['where']=qs[_0x6549('0x33')](_[_0x6549('0x3c')](_0x136518[_0x6549('0x32')],_0x3f1502[_0x6549('0x33')]),_0x4f0ad1);if(_0x136518[_0x6549('0x32')][_0x6549('0x3d')]){_0x4c605c[_0x6549('0x3e')]=_[_0x6549('0x3f')](_0x4c605c[_0x6549('0x3e')],{'$or':_[_0x6549('0x31')](_0x4f0ad1,function(_0x525f82){if(_0x525f82[_0x6549('0x2e')]!==_0x6549('0x40')){var _0x2ea977={};_0x2ea977[_0x525f82[_0x6549('0x29')]]={'$like':'%'+_0x136518[_0x6549('0x32')]['filter']+'%'};return _0x2ea977;}})});}_0x4c605c=_['merge']({},_0x4c605c,_0x136518['options']);var _0x22b919={'where':_0x4c605c[_0x6549('0x3e')]};return db[_0x6549('0x2b')][_0x6549('0x1f')](_0x22b919)['then'](function(_0x56ce9f){_0x4acaf5[_0x6549('0x1f')]=_0x56ce9f;if(_0x136518[_0x6549('0x32')][_0x6549('0x41')]){_0x4c605c['include']=[{'all':!![]}];}return db[_0x6549('0x2b')]['findAll'](_0x4c605c);})[_0x6549('0x26')](function(_0x2ec614){_0x4acaf5[_0x6549('0x42')]=_0x2ec614;return _0x4acaf5;})[_0x6549('0x26')](respondWithFilteredResult(_0x17fdfb,_0x4c605c))[_0x6549('0x43')](handleError(_0x17fdfb,null));};exports[_0x6549('0x44')]=function(_0xbbfdc9,_0x4deaab){var _0x132625={'raw':!![],'where':{'id':_0xbbfdc9[_0x6549('0x45')]['id']}},_0x309f45={};_0x309f45[_0x6549('0x30')]=_[_0x6549('0x46')](db[_0x6549('0x2b')][_0x6549('0x2c')]);_0x309f45[_0x6549('0x32')]=_[_0x6549('0x46')](_0xbbfdc9[_0x6549('0x32')]);_0x309f45[_0x6549('0x33')]=_[_0x6549('0x34')](_0x309f45[_0x6549('0x30')],_0x309f45[_0x6549('0x32')]);_0x132625[_0x6549('0x35')]=_[_0x6549('0x34')](_0x309f45['model'],qs[_0x6549('0x47')](_0xbbfdc9[_0x6549('0x32')][_0x6549('0x47')]));_0x132625[_0x6549('0x35')]=_0x132625['attributes'][_0x6549('0x36')]?_0x132625['attributes']:_0x309f45[_0x6549('0x30')];if(_0xbbfdc9[_0x6549('0x32')]['includeAll']){_0x132625[_0x6549('0x48')]=[{'all':!![]}];}_0x132625=_[_0x6549('0x3f')]({},_0x132625,_0xbbfdc9[_0x6549('0x49')]);return db[_0x6549('0x2b')][_0x6549('0x4a')](_0x132625)['then'](handleEntityNotFound(_0x4deaab,null))['then'](respondWithResult(_0x4deaab,null))[_0x6549('0x43')](handleError(_0x4deaab,null));};exports[_0x6549('0x4b')]=function(_0x41d675,_0x1712f3){return db[_0x6549('0x2b')]['describe']()[_0x6549('0x26')](respondWithResult(_0x1712f3,null))[_0x6549('0x43')](handleError(_0x1712f3,null));};exports[_0x6549('0x25')]=function(_0x6121af,_0xa4c650){if(_0x6121af[_0x6549('0x4c')][_0x6549('0x4d')]){delete _0x6121af[_0x6549('0x4c')]['uniqueid'];}return db[_0x6549('0x2b')]['find']({'where':{'uniqueid':_0x6121af[_0x6549('0x45')]['id']}})[_0x6549('0x26')](handleEntityNotFound(_0xa4c650,null))[_0x6549('0x26')](saveUpdates(_0x6121af['body'],null))[_0x6549('0x26')](respondWithResult(_0xa4c650,null))[_0x6549('0x43')](handleError(_0xa4c650,null));};exports[_0x6549('0x4e')]=function(_0x5300c8,_0x19ac50,_0x17d7ce){return db[_0x6549('0x2b')][_0x6549('0x4f')]({'raw':![],'where':{'VoiceQueueId':_0x5300c8[_0x6549('0x45')]['id']},'attributes':[[db[_0x6549('0x50')]['fn']('COUNT',db[_0x6549('0x50')]['fn']('IF',db['sequelize'][_0x6549('0x51')](_0x6549('0x52')))),_0x6549('0x53')],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db[_0x6549('0x50')]['fn']('IF',db[_0x6549('0x50')][_0x6549('0x51')](_0x6549('0x55')))),_0x6549('0x56')],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db['sequelize']['fn']('IF',db[_0x6549('0x50')][_0x6549('0x51')](_0x6549('0x57')))),_0x6549('0x58')],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db[_0x6549('0x50')]['fn']('IF',db[_0x6549('0x50')]['literal'](_0x6549('0x59')))),_0x6549('0x5a')],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db[_0x6549('0x50')]['fn']('IF',db[_0x6549('0x50')][_0x6549('0x51')](_0x6549('0x5b')))),'dropContacts'],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db[_0x6549('0x50')]['fn']('IF',db[_0x6549('0x50')][_0x6549('0x51')](_0x6549('0x5c')))),'abandonedContacts'],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db['sequelize']['fn']('IF',db[_0x6549('0x50')][_0x6549('0x51')](_0x6549('0x5d')))),'reCallContacts'],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db['sequelize']['fn']('IF',db[_0x6549('0x50')]['literal'](_0x6549('0x5e')))),'answeringMachine']]})[_0x6549('0x26')](handleEntityNotFound(_0x19ac50,null))[_0x6549('0x26')](respondWithResult(_0x19ac50,null))[_0x6549('0x43')](handleError(_0x19ac50,null));};exports[_0x6549('0x5f')]=function(_0x2da535,_0x45eb28,_0x3b01d9){return db[_0x6549('0x2b')][_0x6549('0x4f')]({'raw':![],'where':{'CampaignId':_0x2da535[_0x6549('0x45')]['id']},'attributes':[[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db[_0x6549('0x50')]['fn']('IF',db[_0x6549('0x50')]['literal'](_0x6549('0x52')))),_0x6549('0x53')],[db['sequelize']['fn'](_0x6549('0x54'),db[_0x6549('0x50')]['fn']('IF',db[_0x6549('0x50')][_0x6549('0x51')]('`state`\x20=\x203,\x201,\x20null'))),_0x6549('0x56')],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db[_0x6549('0x50')]['fn']('IF',db['sequelize'][_0x6549('0x51')]('`state`\x20=\x205,\x201,\x20null'))),_0x6549('0x58')],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db[_0x6549('0x50')]['fn']('IF',db[_0x6549('0x50')][_0x6549('0x51')](_0x6549('0x59')))),_0x6549('0x5a')],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db['sequelize']['fn']('IF',db[_0x6549('0x50')][_0x6549('0x51')](_0x6549('0x5b')))),_0x6549('0x60')],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db['sequelize']['fn']('IF',db['sequelize'][_0x6549('0x51')](_0x6549('0x5c')))),_0x6549('0x61')],[db['sequelize']['fn'](_0x6549('0x54'),db[_0x6549('0x50')]['fn']('IF',db['sequelize'][_0x6549('0x51')](_0x6549('0x5d')))),_0x6549('0x62')],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db[_0x6549('0x50')]['fn']('IF',db[_0x6549('0x50')][_0x6549('0x51')]('`state`\x20=\x2019,\x201,\x20null'))),_0x6549('0x63')]]})['then'](handleEntityNotFound(_0x45eb28,null))[_0x6549('0x26')](respondWithResult(_0x45eb28,null))[_0x6549('0x43')](handleError(_0x45eb28,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x372b67,_0x2c00a1,_0x2e6b4b){return db['VoiceQueue'][_0x6549('0x4a')]({'where':{'id':_0x372b67[_0x6549('0x45')]['id']}})[_0x6549('0x26')](handleEntityNotFound(_0x2c00a1,null))[_0x6549('0x26')](function(_0x15b906){var _0x34c5f9;if(_0x15b906){_0x34c5f9=squel['insert']()[_0x6549('0x64')](_0x6549('0x65'))[_0x6549('0x66')](['phone','scheduledAt','ContactId',_0x6549('0x67'),_0x6549('0x68'),_0x6549('0x69'),'updatedAt'],squel['select']()[_0x6549('0x6a')]('ANY_VALUE(calleridnum)',_0x6549('0x6b'))[_0x6549('0x6a')](_0x6549('0x6c'),_0x6549('0x6d'))[_0x6549('0x6a')](_0x6549('0x6e'),_0x6549('0x6f'))['field'](_0x6549('0x70'),_0x6549('0x67'))[_0x6549('0x6a')]('ANY_VALUE(VoiceQueueId)',_0x6549('0x68'))[_0x6549('0x6a')](_0x6549('0x6c'),_0x6549('0x69'))[_0x6549('0x6a')](_0x6549('0x6c'),_0x6549('0x71'))['from'](_0x6549('0x72'))['where'](_0x6549('0x73'),_0x372b67[_0x6549('0x45')]['id'][_0x6549('0x74')]())[_0x6549('0x3e')](_0x6549('0x75'),_0x372b67[_0x6549('0x4c')][_0x6549('0x76')][_0x6549('0x74')]())['where'](_0x6549('0x77'))[_0x6549('0x3e')](_0x6549('0x78'),squel[_0x6549('0x79')]()[_0x6549('0x6a')](_0x6549('0x6b'))[_0x6549('0x7a')](_0x6549('0x65'))[_0x6549('0x3e')](_0x6549('0x73'),_0x372b67['params']['id'][_0x6549('0x74')]()))[_0x6549('0x3e')](_0x6549('0x78'),squel[_0x6549('0x79')]()[_0x6549('0x6a')](_0x6549('0x7b'))[_0x6549('0x7a')](_0x6549('0x72'))[_0x6549('0x3e')](_0x6549('0x73'),_0x372b67[_0x6549('0x45')]['id'][_0x6549('0x74')]())[_0x6549('0x3e')](_0x6549('0x7c')))[_0x6549('0x7d')](_0x6549('0x6f')))[_0x6549('0x74')]();return db[_0x6549('0x50')]['query'](_0x34c5f9);}return[];})[_0x6549('0x26')](respondWithResult(_0x2c00a1,null))[_0x6549('0x43')](handleError(_0x2c00a1,null));};exports[_0x6549('0x7e')]=function(_0x35bad6,_0x371d8a,_0xfde69e){return db[_0x6549('0x7f')][_0x6549('0x4a')]({'where':{'id':_0x35bad6[_0x6549('0x45')]['id']}})[_0x6549('0x26')](handleEntityNotFound(_0x371d8a,null))[_0x6549('0x26')](function(_0x1da2d7){var _0x348d55;if(_0x1da2d7){_0x348d55=squel[_0x6549('0x80')]()[_0x6549('0x64')](_0x6549('0x65'))[_0x6549('0x66')](['phone',_0x6549('0x6d'),_0x6549('0x6f'),_0x6549('0x67'),_0x6549('0x81'),_0x6549('0x69'),_0x6549('0x71')],squel[_0x6549('0x79')]()['field'](_0x6549('0x82'),'phone')['field'](_0x6549('0x6c'),'scheduledAt')[_0x6549('0x6a')](_0x6549('0x6e'),_0x6549('0x6f'))[_0x6549('0x6a')](_0x6549('0x70'),'ListId')[_0x6549('0x6a')]('ANY_VALUE(CampaignId)',_0x6549('0x81'))[_0x6549('0x6a')](_0x6549('0x6c'),'createdAt')[_0x6549('0x6a')](_0x6549('0x6c'),'updatedAt')['from'](_0x6549('0x72'))[_0x6549('0x3e')](_0x6549('0x83'),_0x35bad6[_0x6549('0x45')]['id'][_0x6549('0x74')]())[_0x6549('0x3e')](_0x6549('0x75'),_0x35bad6[_0x6549('0x4c')][_0x6549('0x76')][_0x6549('0x74')]())[_0x6549('0x3e')](_0x6549('0x77'))[_0x6549('0x3e')](_0x6549('0x78'),squel[_0x6549('0x79')]()[_0x6549('0x6a')](_0x6549('0x6b'))[_0x6549('0x7a')](_0x6549('0x65'))['where']('CampaignId\x20=\x20?',_0x35bad6[_0x6549('0x45')]['id'][_0x6549('0x74')]()))[_0x6549('0x3e')](_0x6549('0x78'),squel[_0x6549('0x79')]()[_0x6549('0x6a')](_0x6549('0x7b'))[_0x6549('0x7a')](_0x6549('0x72'))[_0x6549('0x3e')]('CampaignId\x20=\x20?',_0x35bad6['params']['id']['toString']())[_0x6549('0x3e')](_0x6549('0x7c')))[_0x6549('0x7d')](_0x6549('0x6f')))[_0x6549('0x74')]();return db['sequelize'][_0x6549('0x32')](_0x348d55);}return[];})[_0x6549('0x26')](respondWithResult(_0x371d8a,null))[_0x6549('0x43')](handleError(_0x371d8a,null));};exports[_0x6549('0x84')]=function(_0x230874,_0x3be369,_0xaf1a80){return db[_0x6549('0x85')][_0x6549('0x86')]({'where':{'VoiceQueueId':_0x230874[_0x6549('0x4c')][_0x6549('0x68')],'CampaignId':_0x230874['body'][_0x6549('0x81')],'ContactId':_0x230874[_0x6549('0x4c')][_0x6549('0x6f')]}})[_0x6549('0x26')](handleEntityNotFound(_0x3be369,null))['then'](function(_0x158c92){if(_0x158c92){return _0x158c92;}return null;})[_0x6549('0x26')](respondWithResult(_0x3be369,null))[_0x6549('0x43')](handleError(_0x3be369,null));}; \ No newline at end of file +var _0xc4aa=['ContactId','ListId','ANY_VALUE(VoiceQueueId)','NOW()','createdAt','from','cm_hopper_final','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','cm_hopper','VoiceQueueId\x20=\x20?','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','phone','CampaignId','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','CmHopperFinal','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','describe','uniqueid','find','body','countContactsQueueCampaignHopperFinal','findAll','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','fromQuery','scheduledAt','VoiceQueueId','updatedAt','field','ANY_VALUE(calleridnum)'];(function(_0x51821c,_0x2e39c5){var _0x20bde8=function(_0x2d307a){while(--_0x2d307a){_0x51821c['push'](_0x51821c['shift']());}};_0x20bde8(++_0x2e39c5);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0xc4aa[_0x2e4aa2];return _0x5e6092;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];function respondWithStatusCode(_0x24291d,_0x5e16aa){_0x5e16aa=_0x5e16aa||0xcc;return function(_0x21a79){if(_0x21a79){return _0x24291d[_0xac4a('0x17')](_0x5e16aa);}return _0x24291d[_0xac4a('0x18')](_0x5e16aa)[_0xac4a('0x19')]();};}function respondWithResult(_0x1b4313,_0x3b71c0){_0x3b71c0=_0x3b71c0||0xc8;return function(_0x34bc01){if(_0x34bc01){return _0x1b4313[_0xac4a('0x18')](_0x3b71c0)[_0xac4a('0x1a')](_0x34bc01);}};}function respondWithFilteredResult(_0x42c7fc,_0x11e101){return function(_0x26dbb8){if(_0x26dbb8){var _0x4a2119=typeof _0x11e101[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x11e101[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x3e88e3=_0x26dbb8[_0xac4a('0x1e')];var _0x28e304=_0x4a2119?0x0:_0x11e101[_0xac4a('0x1b')];var _0x546c5d=_0x4a2119?_0x26dbb8['count']:_0x11e101[_0xac4a('0x1b')]+_0x11e101[_0xac4a('0x1d')];var _0x39b691;if(_0x546c5d>=_0x3e88e3){_0x546c5d=_0x3e88e3;_0x39b691=0xc8;}else{_0x39b691=0xce;}_0x42c7fc['status'](_0x39b691);return _0x42c7fc[_0xac4a('0x1f')](_0xac4a('0x20'),_0x28e304+'-'+_0x546c5d+'/'+_0x3e88e3)[_0xac4a('0x1a')](_0x26dbb8);}return null;};}function patchUpdates(_0x3a3cdb){return function(_0x123694){try{jsonpatch[_0xac4a('0x21')](_0x123694,_0x3a3cdb,!![]);}catch(_0xe38996){return BPromise[_0xac4a('0x22')](_0xe38996);}return _0x123694['save']();};}function saveUpdates(_0x3d8f0a,_0x3204ad){return function(_0x599787){if(_0x599787){return _0x599787[_0xac4a('0x23')](_0x3d8f0a)[_0xac4a('0x24')](function(_0x3eacd3){return _0x3eacd3;});}return null;};}function removeEntity(_0x947d8e,_0x4d2d6c){return function(_0x1b7998){if(_0x1b7998){return _0x1b7998[_0xac4a('0x25')]()[_0xac4a('0x24')](function(){_0x947d8e[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x2b0dc2,_0x222507){return function(_0x36054a){if(!_0x36054a){_0x2b0dc2[_0xac4a('0x17')](0x194);}return _0x36054a;};}function handleError(_0x3bc318,_0x1d0539){_0x1d0539=_0x1d0539||0x1f4;return function(_0x215a31){logger[_0xac4a('0x26')](_0x215a31[_0xac4a('0x27')]);if(_0x215a31[_0xac4a('0x28')]){delete _0x215a31[_0xac4a('0x28')];}_0x3bc318['status'](_0x1d0539)[_0xac4a('0x29')](_0x215a31);};}exports[_0xac4a('0x2a')]=function(_0x42a33c,_0x2772fe){var _0x116700={},_0x4a5a9e={},_0x47f49c={'count':0x0,'rows':[]};var _0xdb7e=_[_0xac4a('0x2b')](db[_0xac4a('0x2c')]['rawAttributes'],function(_0x4bda1f){return{'name':_0x4bda1f[_0xac4a('0x2d')],'type':_0x4bda1f[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x4a5a9e[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0xdb7e,'name');_0x4a5a9e[_0xac4a('0x31')]=_['keys'](_0x42a33c[_0xac4a('0x31')]);_0x4a5a9e['filters']=_[_0xac4a('0x32')](_0x4a5a9e[_0xac4a('0x30')],_0x4a5a9e[_0xac4a('0x31')]);_0x116700[_0xac4a('0x33')]=_[_0xac4a('0x32')](_0x4a5a9e[_0xac4a('0x30')],qs[_0xac4a('0x34')](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x34')]));_0x116700[_0xac4a('0x33')]=_0x116700[_0xac4a('0x33')][_0xac4a('0x35')]?_0x116700[_0xac4a('0x33')]:_0x4a5a9e[_0xac4a('0x30')];if(!_0x42a33c['query'][_0xac4a('0x36')](_0xac4a('0x37'))){_0x116700['limit']=qs[_0xac4a('0x1d')](_0x42a33c[_0xac4a('0x31')]['limit']);_0x116700['offset']=qs[_0xac4a('0x1b')](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x1b')]);}_0x116700[_0xac4a('0x38')]=qs['sort'](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x39')]);_0x116700['where']=qs[_0xac4a('0x3a')](_[_0xac4a('0x3b')](_0x42a33c[_0xac4a('0x31')],_0x4a5a9e['filters']),_0xdb7e);if(_0x42a33c[_0xac4a('0x31')][_0xac4a('0x3c')]){_0x116700[_0xac4a('0x3d')]=_['merge'](_0x116700[_0xac4a('0x3d')],{'$or':_[_0xac4a('0x2b')](_0xdb7e,function(_0x4b9faf){if(_0x4b9faf['type']!==_0xac4a('0x3e')){var _0x5e0926={};_0x5e0926[_0x4b9faf['name']]={'$like':'%'+_0x42a33c['query']['filter']+'%'};return _0x5e0926;}})});}_0x116700=_[_0xac4a('0x3f')]({},_0x116700,_0x42a33c[_0xac4a('0x40')]);var _0x37834b={'where':_0x116700[_0xac4a('0x3d')]};return db[_0xac4a('0x2c')][_0xac4a('0x1e')](_0x37834b)[_0xac4a('0x24')](function(_0x2b16f0){_0x47f49c[_0xac4a('0x1e')]=_0x2b16f0;if(_0x42a33c[_0xac4a('0x31')][_0xac4a('0x41')]){_0x116700[_0xac4a('0x42')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x116700);})['then'](function(_0x1e1cc5){_0x47f49c[_0xac4a('0x43')]=_0x1e1cc5;return _0x47f49c;})[_0xac4a('0x24')](respondWithFilteredResult(_0x2772fe,_0x116700))[_0xac4a('0x44')](handleError(_0x2772fe,null));};exports[_0xac4a('0x45')]=function(_0x411543,_0x8febf0){var _0x3441f2={'raw':!![],'where':{'id':_0x411543[_0xac4a('0x46')]['id']}},_0x3e9973={};_0x3e9973['model']=_[_0xac4a('0x47')](db[_0xac4a('0x2c')][_0xac4a('0x48')]);_0x3e9973[_0xac4a('0x31')]=_[_0xac4a('0x47')](_0x411543['query']);_0x3e9973[_0xac4a('0x3a')]=_[_0xac4a('0x32')](_0x3e9973['model'],_0x3e9973[_0xac4a('0x31')]);_0x3441f2['attributes']=_[_0xac4a('0x32')](_0x3e9973[_0xac4a('0x30')],qs[_0xac4a('0x34')](_0x411543[_0xac4a('0x31')][_0xac4a('0x34')]));_0x3441f2[_0xac4a('0x33')]=_0x3441f2[_0xac4a('0x33')][_0xac4a('0x35')]?_0x3441f2[_0xac4a('0x33')]:_0x3e9973[_0xac4a('0x30')];if(_0x411543[_0xac4a('0x31')][_0xac4a('0x41')]){_0x3441f2['include']=[{'all':!![]}];}_0x3441f2=_[_0xac4a('0x3f')]({},_0x3441f2,_0x411543[_0xac4a('0x40')]);return db[_0xac4a('0x2c')]['find'](_0x3441f2)[_0xac4a('0x24')](handleEntityNotFound(_0x8febf0,null))[_0xac4a('0x24')](respondWithResult(_0x8febf0,null))['catch'](handleError(_0x8febf0,null));};exports[_0xac4a('0x49')]=function(_0x5a7f6e,_0x244950){return db[_0xac4a('0x2c')][_0xac4a('0x49')]()['then'](respondWithResult(_0x244950,null))['catch'](handleError(_0x244950,null));};exports[_0xac4a('0x23')]=function(_0x4aaeff,_0x18ae96){if(_0x4aaeff['body'][_0xac4a('0x4a')]){delete _0x4aaeff['body'][_0xac4a('0x4a')];}return db[_0xac4a('0x2c')][_0xac4a('0x4b')]({'where':{'uniqueid':_0x4aaeff[_0xac4a('0x46')]['id']}})['then'](handleEntityNotFound(_0x18ae96,null))[_0xac4a('0x24')](saveUpdates(_0x4aaeff[_0xac4a('0x4c')],null))[_0xac4a('0x24')](respondWithResult(_0x18ae96,null))[_0xac4a('0x44')](handleError(_0x18ae96,null));};exports[_0xac4a('0x4d')]=function(_0x138876,_0x187306,_0x4e6e19){return db[_0xac4a('0x2c')][_0xac4a('0x4e')]({'raw':![],'where':{'VoiceQueueId':_0x138876['params']['id']},'attributes':[[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')]['literal'](_0xac4a('0x51')))),_0xac4a('0x52')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db['sequelize'][_0xac4a('0x53')]('`state`\x20=\x203,\x201,\x20null'))),_0xac4a('0x54')],[db[_0xac4a('0x4f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')]('`state`\x20=\x205,\x201,\x20null'))),_0xac4a('0x55')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db['sequelize'][_0xac4a('0x53')](_0xac4a('0x56')))),_0xac4a('0x57')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')]['literal'](_0xac4a('0x58')))),_0xac4a('0x59')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x5a')))),_0xac4a('0x5b')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x5c')))),_0xac4a('0x5d')],[db['sequelize']['fn'](_0xac4a('0x50'),db['sequelize']['fn']('IF',db[_0xac4a('0x4f')]['literal'](_0xac4a('0x5e')))),'answeringMachine']]})[_0xac4a('0x24')](handleEntityNotFound(_0x187306,null))['then'](respondWithResult(_0x187306,null))['catch'](handleError(_0x187306,null));};exports[_0xac4a('0x5f')]=function(_0x568ffb,_0x3bcae2,_0x3c2f84){return db[_0xac4a('0x2c')][_0xac4a('0x4e')]({'raw':![],'where':{'CampaignId':_0x568ffb['params']['id']},'attributes':[[db[_0xac4a('0x4f')]['fn']('COUNT',db[_0xac4a('0x4f')]['fn']('IF',db['sequelize'][_0xac4a('0x53')](_0xac4a('0x51')))),_0xac4a('0x52')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x60')))),_0xac4a('0x54')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x61')))),_0xac4a('0x55')],[db['sequelize']['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db['sequelize'][_0xac4a('0x53')](_0xac4a('0x56')))),_0xac4a('0x57')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db['sequelize']['fn']('IF',db['sequelize'][_0xac4a('0x53')](_0xac4a('0x58')))),_0xac4a('0x59')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x5a')))),_0xac4a('0x5b')],[db[_0xac4a('0x4f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x5c')))),_0xac4a('0x5d')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x5e')))),_0xac4a('0x62')]]})[_0xac4a('0x24')](handleEntityNotFound(_0x3bcae2,null))['then'](respondWithResult(_0x3bcae2,null))[_0xac4a('0x44')](handleError(_0x3bcae2,null));};exports[_0xac4a('0x63')]=function(_0x26bd31,_0x231932,_0x513976){return db[_0xac4a('0x64')]['find']({'where':{'id':_0x26bd31[_0xac4a('0x46')]['id']}})[_0xac4a('0x24')](handleEntityNotFound(_0x231932,null))['then'](function(_0x5bd95b){var _0x17eac2;if(_0x5bd95b){_0x17eac2=squel[_0xac4a('0x65')]()[_0xac4a('0x66')]('cm_hopper')[_0xac4a('0x67')](['phone',_0xac4a('0x68'),'ContactId','ListId',_0xac4a('0x69'),'createdAt',_0xac4a('0x6a')],squel['select']()[_0xac4a('0x6b')](_0xac4a('0x6c'),'phone')[_0xac4a('0x6b')]('NOW()',_0xac4a('0x68'))[_0xac4a('0x6b')]('ANY_VALUE(ContactId)',_0xac4a('0x6d'))['field']('ANY_VALUE(ListId)',_0xac4a('0x6e'))['field'](_0xac4a('0x6f'),'VoiceQueueId')['field'](_0xac4a('0x70'),_0xac4a('0x71'))[_0xac4a('0x6b')]('NOW()','updatedAt')[_0xac4a('0x72')](_0xac4a('0x73'))['where']('VoiceQueueId\x20=\x20?',_0x26bd31[_0xac4a('0x46')]['id'][_0xac4a('0x74')]())[_0xac4a('0x3d')](_0xac4a('0x75'),_0x26bd31[_0xac4a('0x4c')][_0xac4a('0x76')][_0xac4a('0x74')]())[_0xac4a('0x3d')](_0xac4a('0x77'))['where'](_0xac4a('0x78'),squel[_0xac4a('0x79')]()[_0xac4a('0x6b')]('phone')[_0xac4a('0x72')](_0xac4a('0x7a'))[_0xac4a('0x3d')](_0xac4a('0x7b'),_0x26bd31[_0xac4a('0x46')]['id']['toString']()))[_0xac4a('0x3d')](_0xac4a('0x78'),squel[_0xac4a('0x79')]()[_0xac4a('0x6b')](_0xac4a('0x7c'))[_0xac4a('0x72')](_0xac4a('0x73'))['where'](_0xac4a('0x7b'),_0x26bd31[_0xac4a('0x46')]['id'][_0xac4a('0x74')]())[_0xac4a('0x3d')](_0xac4a('0x7d')))[_0xac4a('0x7e')]('ContactId'))[_0xac4a('0x74')]();return db[_0xac4a('0x4f')][_0xac4a('0x31')](_0x17eac2);}return[];})[_0xac4a('0x24')](respondWithResult(_0x231932,null))['catch'](handleError(_0x231932,null));};exports[_0xac4a('0x7f')]=function(_0x56a934,_0x4447b5,_0x22b718){return db['Campaign']['find']({'where':{'id':_0x56a934[_0xac4a('0x46')]['id']}})[_0xac4a('0x24')](handleEntityNotFound(_0x4447b5,null))[_0xac4a('0x24')](function(_0x4bb03d){var _0x1f3f1c;if(_0x4bb03d){_0x1f3f1c=squel['insert']()[_0xac4a('0x66')](_0xac4a('0x7a'))[_0xac4a('0x67')]([_0xac4a('0x80'),_0xac4a('0x68'),'ContactId','ListId',_0xac4a('0x81'),_0xac4a('0x71'),_0xac4a('0x6a')],squel[_0xac4a('0x79')]()[_0xac4a('0x6b')](_0xac4a('0x6c'),_0xac4a('0x80'))[_0xac4a('0x6b')]('NOW()','scheduledAt')[_0xac4a('0x6b')](_0xac4a('0x82'),_0xac4a('0x6d'))[_0xac4a('0x6b')](_0xac4a('0x83'),_0xac4a('0x6e'))[_0xac4a('0x6b')](_0xac4a('0x84'),'CampaignId')['field'](_0xac4a('0x70'),_0xac4a('0x71'))[_0xac4a('0x6b')](_0xac4a('0x70'),_0xac4a('0x6a'))[_0xac4a('0x72')](_0xac4a('0x73'))['where'](_0xac4a('0x85'),_0x56a934[_0xac4a('0x46')]['id'][_0xac4a('0x74')]())['where'](_0xac4a('0x75'),_0x56a934[_0xac4a('0x4c')][_0xac4a('0x76')][_0xac4a('0x74')]())[_0xac4a('0x3d')](_0xac4a('0x77'))[_0xac4a('0x3d')](_0xac4a('0x78'),squel[_0xac4a('0x79')]()['field'](_0xac4a('0x80'))['from'](_0xac4a('0x7a'))[_0xac4a('0x3d')](_0xac4a('0x85'),_0x56a934[_0xac4a('0x46')]['id'][_0xac4a('0x74')]()))[_0xac4a('0x3d')](_0xac4a('0x78'),squel['select']()[_0xac4a('0x6b')](_0xac4a('0x7c'))[_0xac4a('0x72')](_0xac4a('0x73'))[_0xac4a('0x3d')]('CampaignId\x20=\x20?',_0x56a934[_0xac4a('0x46')]['id'][_0xac4a('0x74')]())['where']('state\x20=\x204'))[_0xac4a('0x7e')](_0xac4a('0x6d')))['toString']();return db[_0xac4a('0x4f')][_0xac4a('0x31')](_0x1f3f1c);}return[];})[_0xac4a('0x24')](respondWithResult(_0x4447b5,null))[_0xac4a('0x44')](handleError(_0x4447b5,null));};exports[_0xac4a('0x86')]=function(_0x34787c,_0x599775,_0xbdff4b){return db[_0xac4a('0x87')][_0xac4a('0x88')]({'where':{'VoiceQueueId':_0x34787c['body'][_0xac4a('0x69')],'CampaignId':_0x34787c[_0xac4a('0x4c')][_0xac4a('0x81')],'ContactId':_0x34787c[_0xac4a('0x4c')][_0xac4a('0x6d')]}})[_0xac4a('0x24')](handleEntityNotFound(_0x599775,null))['then'](function(_0xe84bf7){if(_0xe84bf7){return _0xe84bf7;}return null;})[_0xac4a('0x24')](respondWithResult(_0x599775,null))['catch'](handleError(_0x599775,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 1a9d213..b9161c9 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 _0x5b05=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./cmHopperFinal.attributes','exports','CmHopperFinal','cm_hopper_final','calleridnum','lodash','util'];(function(_0x4991cf,_0x474191){var _0xc8cffd=function(_0x37aba0){while(--_0x37aba0){_0x4991cf['push'](_0x4991cf['shift']());}};_0xc8cffd(++_0x474191);}(_0x5b05,0x132));var _0x55b0=function(_0x140c1f,_0x47b134){_0x140c1f=_0x140c1f-0x0;var _0x2b417c=_0x5b05[_0x140c1f];return _0x2b417c;};'use strict';var _=require(_0x55b0('0x0'));var util=require(_0x55b0('0x1'));var logger=require(_0x55b0('0x2'))(_0x55b0('0x3'));var moment=require(_0x55b0('0x4'));var BPromise=require(_0x55b0('0x5'));var rp=require(_0x55b0('0x6'));var fs=require('fs');var path=require(_0x55b0('0x7'));var rimraf=require('rimraf');var config=require(_0x55b0('0x8'));var attributes=require(_0x55b0('0x9'));module[_0x55b0('0xa')]=function(_0x21e72e,_0x6e5b42){return _0x21e72e['define'](_0x55b0('0xb'),attributes,{'tableName':_0x55b0('0xc'),'paranoid':![],'indexes':[{'name':_0x55b0('0xd'),'fields':[_0x55b0('0xd')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe296=['exports','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes'];(function(_0x4382bc,_0x231a2d){var _0x13c82a=function(_0x3723b0){while(--_0x3723b0){_0x4382bc['push'](_0x4382bc['shift']());}};_0x13c82a(++_0x231a2d);}(_0xe296,0x101));var _0x6e29=function(_0x1982d6,_0x58e299){_0x1982d6=_0x1982d6-0x0;var _0x351e7=_0xe296[_0x1982d6];return _0x351e7;};'use strict';var _=require(_0x6e29('0x0'));var util=require('util');var logger=require(_0x6e29('0x1'))(_0x6e29('0x2'));var moment=require(_0x6e29('0x3'));var BPromise=require('bluebird');var rp=require(_0x6e29('0x4'));var fs=require('fs');var path=require(_0x6e29('0x5'));var rimraf=require(_0x6e29('0x6'));var config=require(_0x6e29('0x7'));var attributes=require(_0x6e29('0x8'));module[_0x6e29('0x9')]=function(_0x393a24,_0x561325){return _0x393a24['define'](_0x6e29('0xa'),attributes,{'tableName':_0x6e29('0xb'),'paranoid':![],'indexes':[{'name':_0x6e29('0xc'),'fields':[_0x6e29('0xc')]},{'name':'uniqueid','fields':[_0x6e29('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index aba85b7..309dee4 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 _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x442288,_0x4c8b1b){var _0x64dc80=function(_0x336e37){while(--_0x336e37){_0x442288['push'](_0x442288['shift']());}};_0x64dc80(++_0x4c8b1b);}(_0xb10b,0x12a));var _0xbb10=function(_0x33eb5c,_0x4a7d98){_0x33eb5c=_0x33eb5c-0x0;var _0x253328=_0xb10b[_0x33eb5c];return _0x253328;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x195463,_0x4f89df){var _0x15bf73=function(_0x61f1bf){while(--_0x61f1bf){_0x195463['push'](_0x195463['shift']());}};_0x15bf73(++_0x4f89df);}(_0x7a54,0x106));var _0x47a5=function(_0x3fb189,_0x14783e){_0x3fb189=_0x3fb189-0x0;var _0x1edff9=_0x7a54[_0x3fb189];return _0x1edff9;};'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 d9c2e3c..ce13253 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 _0xbdff=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','index','/describe','isAuthenticated','get','/:id','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','/checkContactHopper','put','update','exports'];(function(_0x56cf80,_0x39c550){var _0x40922f=function(_0x510786){while(--_0x510786){_0x56cf80['push'](_0x56cf80['shift']());}};_0x40922f(++_0x39c550);}(_0xbdff,0x114));var _0xfbdf=function(_0x3f1895,_0x44997a){_0x3f1895=_0x3f1895-0x0;var _0xddf058=_0xbdff[_0x3f1895];return _0xddf058;};'use strict';var multer=require(_0xfbdf('0x0'));var util=require(_0xfbdf('0x1'));var path=require(_0xfbdf('0x2'));var timeout=require(_0xfbdf('0x3'));var express=require(_0xfbdf('0x4'));var router=express[_0xfbdf('0x5')]();var fs_extra=require(_0xfbdf('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xfbdf('0x7'));var config=require(_0xfbdf('0x8'));var controller=require('./cmHopperFinal.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xfbdf('0x9')]);router['get'](_0xfbdf('0xa'),auth[_0xfbdf('0xb')](),controller['describe']);router[_0xfbdf('0xc')](_0xfbdf('0xd'),auth[_0xfbdf('0xb')](),controller['show']);router[_0xfbdf('0xc')]('/voice/queue/countAttributes/:id',auth[_0xfbdf('0xb')](),controller[_0xfbdf('0xe')]);router[_0xfbdf('0xc')]('/campaign/countAttributes/:id',auth[_0xfbdf('0xb')](),controller[_0xfbdf('0xf')]);router['post']('/voice/queue/moveContacts/:id',auth[_0xfbdf('0xb')](),controller[_0xfbdf('0x10')]);router[_0xfbdf('0x11')](_0xfbdf('0x12'),auth['isAuthenticated'](),controller['moveContactsIvrCampaignHopperFinal']);router[_0xfbdf('0x11')](_0xfbdf('0x13'),auth[_0xfbdf('0xb')](),controller['checkContactHopper']);router[_0xfbdf('0x14')](_0xfbdf('0xd'),auth['isAuthenticated'](),controller[_0xfbdf('0x15')]);module[_0xfbdf('0x16')]=router; \ No newline at end of file +var _0x3c32=['/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','update','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','./cmHopperFinal.controller','get','isAuthenticated','index'];(function(_0x1fd91b,_0x2ad2a3){var _0x458787=function(_0x4925fe){while(--_0x4925fe){_0x1fd91b['push'](_0x1fd91b['shift']());}};_0x458787(++_0x2ad2a3);}(_0x3c32,0x161));var _0x23c3=function(_0x26cd06,_0x1cbe21){_0x26cd06=_0x26cd06-0x0;var _0xee9233=_0x3c32[_0x26cd06];return _0xee9233;};'use strict';var multer=require(_0x23c3('0x0'));var util=require(_0x23c3('0x1'));var path=require(_0x23c3('0x2'));var timeout=require('connect-timeout');var express=require(_0x23c3('0x3'));var router=express[_0x23c3('0x4')]();var fs_extra=require(_0x23c3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x23c3('0x6'));var config=require('../../config/environment');var controller=require(_0x23c3('0x7'));router[_0x23c3('0x8')]('/',auth[_0x23c3('0x9')](),controller[_0x23c3('0xa')]);router[_0x23c3('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x23c3('0x8')](_0x23c3('0xb'),auth[_0x23c3('0x9')](),controller[_0x23c3('0xc')]);router[_0x23c3('0x8')](_0x23c3('0xd'),auth[_0x23c3('0x9')](),controller[_0x23c3('0xe')]);router[_0x23c3('0x8')](_0x23c3('0xf'),auth[_0x23c3('0x9')](),controller[_0x23c3('0x10')]);router[_0x23c3('0x11')](_0x23c3('0x12'),auth[_0x23c3('0x9')](),controller[_0x23c3('0x13')]);router[_0x23c3('0x11')](_0x23c3('0x14'),auth[_0x23c3('0x9')](),controller[_0x23c3('0x15')]);router['post']('/checkContactHopper',auth[_0x23c3('0x9')](),controller[_0x23c3('0x16')]);router[_0x23c3('0x17')](_0x23c3('0xb'),auth[_0x23c3('0x9')](),controller[_0x23c3('0x18')]);module[_0x23c3('0x19')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index ffcde4b..5359a10 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 _0x9e0d=['DATE','BOOLEAN','sequelize','exports','INTEGER','STRING'];(function(_0x3acabd,_0x21dd4c){var _0x27a7e6=function(_0x199363){while(--_0x199363){_0x3acabd['push'](_0x3acabd['shift']());}};_0x27a7e6(++_0x21dd4c);}(_0x9e0d,0xf8));var _0xd9e0=function(_0x5d860f,_0x467498){_0x5d860f=_0x5d860f-0x0;var _0x236490=_0x9e0d[_0x5d860f];return _0x236490;};'use strict';var Sequelize=require(_0xd9e0('0x0'));module[_0xd9e0('0x1')]={'state':{'type':Sequelize[_0xd9e0('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xd9e0('0x3')]},'scheduledat':{'type':Sequelize[_0xd9e0('0x4')]},'countbusyretry':{'type':Sequelize[_0xd9e0('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xd9e0('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xd9e0('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xd9e0('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xd9e0('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xd9e0('0x3')]},'calleridname':{'type':Sequelize[_0xd9e0('0x3')]},'starttime':{'type':Sequelize[_0xd9e0('0x4')]},'responsetime':{'type':Sequelize[_0xd9e0('0x4')]},'answertime':{'type':Sequelize[_0xd9e0('0x4')]},'droptime':{'type':Sequelize[_0xd9e0('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xd9e0('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xd9e0('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xd9e0('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xd9e0('0x3')]},'campaign':{'type':Sequelize[_0xd9e0('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xd9e0('0x3')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0xd9e0('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xd9e0('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xd9e0('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0xd9e0('0x4')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xd9e0('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xd9e0('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xd9e0('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xd9e0('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1103=['BOOLEAN','exports','INTEGER','STRING','DATE'];(function(_0x1ad4c6,_0x1c6e4b){var _0x2a81c0=function(_0x2582b7){while(--_0x2582b7){_0x1ad4c6['push'](_0x1ad4c6['shift']());}};_0x2a81c0(++_0x1c6e4b);}(_0x1103,0x97));var _0x3110=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1103[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x3110('0x0')]={'state':{'type':Sequelize[_0x3110('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x3110('0x2')]},'scheduledat':{'type':Sequelize[_0x3110('0x3')]},'countbusyretry':{'type':Sequelize[_0x3110('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x3110('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x3110('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x3110('0x2')]},'calleridnum':{'type':Sequelize[_0x3110('0x2')]},'calleridname':{'type':Sequelize[_0x3110('0x2')]},'starttime':{'type':Sequelize[_0x3110('0x3')]},'responsetime':{'type':Sequelize[_0x3110('0x3')]},'answertime':{'type':Sequelize[_0x3110('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x3110('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x3110('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x3110('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x3110('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x3110('0x2')]},'membername':{'type':Sequelize[_0x3110('0x2')]},'reason':{'type':Sequelize[_0x3110('0x2')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x3110('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0x3110('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x3110('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x3110('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x3110('0x3')]},'edited':{'type':Sequelize[_0x3110('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x3110('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x3110('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x3110('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 92020e4..9d79257 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 _0x40f7=['set','Content-Range','apply','reject','update','destroy','then','stack','name','index','CmHopperHistory','rawAttributes','key','model','map','keys','query','filters','attributes','fields','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','describe','uniqueid','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset'];(function(_0x2cd745,_0x53f44a){var _0x2129c0=function(_0x2313bd){while(--_0x2313bd){_0x2cd745['push'](_0x2cd745['shift']());}};_0x2129c0(++_0x53f44a);}(_0x40f7,0x78));var _0x740f=function(_0x184eeb,_0x100d42){_0x184eeb=_0x184eeb-0x0;var _0x33fe78=_0x40f7[_0x184eeb];return _0x33fe78;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x740f('0x0'));var jsonpatch=require(_0x740f('0x1'));var rp=require(_0x740f('0x2'));var moment=require(_0x740f('0x3'));var BPromise=require(_0x740f('0x4'));var Mustache=require(_0x740f('0x5'));var util=require(_0x740f('0x6'));var path=require(_0x740f('0x7'));var sox=require(_0x740f('0x8'));var csv=require('to-csv');var ejs=require(_0x740f('0x9'));var fs=require('fs');var fs_extra=require(_0x740f('0xa'));var _=require(_0x740f('0xb'));var squel=require(_0x740f('0xc'));var crypto=require(_0x740f('0xd'));var jsforce=require(_0x740f('0xe'));var deskjs=require(_0x740f('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x740f('0x10'));var Redis=require('ioredis');var authService=require(_0x740f('0x11'));var qs=require(_0x740f('0x12'));var as=require(_0x740f('0x13'));var hardwareService=require(_0x740f('0x14'));var logger=require(_0x740f('0x15'))(_0x740f('0x16'));var utils=require('../../config/utils');var config=require(_0x740f('0x17'));var licenseUtil=require(_0x740f('0x18'));var db=require(_0x740f('0x19'))['db'];function respondWithStatusCode(_0x3313eb,_0x287a41){_0x287a41=_0x287a41||0xcc;return function(_0x5d19d9){if(_0x5d19d9){return _0x3313eb[_0x740f('0x1a')](_0x287a41);}return _0x3313eb[_0x740f('0x1b')](_0x287a41)[_0x740f('0x1c')]();};}function respondWithResult(_0x120004,_0x4ea715){_0x4ea715=_0x4ea715||0xc8;return function(_0x22e108){if(_0x22e108){return _0x120004['status'](_0x4ea715)[_0x740f('0x1d')](_0x22e108);}};}function respondWithFilteredResult(_0x41f52e,_0x38131a){return function(_0x3d933c){if(_0x3d933c){var _0x2693d8=typeof _0x38131a['offset']===_0x740f('0x1e')&&typeof _0x38131a[_0x740f('0x1f')]===_0x740f('0x1e');var _0x51ccfb=_0x3d933c[_0x740f('0x20')];var _0xdcb5b4=_0x2693d8?0x0:_0x38131a[_0x740f('0x21')];var _0x5e7dfe=_0x2693d8?_0x3d933c[_0x740f('0x20')]:_0x38131a['offset']+_0x38131a[_0x740f('0x1f')];var _0x481d49;if(_0x5e7dfe>=_0x51ccfb){_0x5e7dfe=_0x51ccfb;_0x481d49=0xc8;}else{_0x481d49=0xce;}_0x41f52e['status'](_0x481d49);return _0x41f52e[_0x740f('0x22')](_0x740f('0x23'),_0xdcb5b4+'-'+_0x5e7dfe+'/'+_0x51ccfb)['json'](_0x3d933c);}return null;};}function patchUpdates(_0x30443f){return function(_0x300baa){try{jsonpatch[_0x740f('0x24')](_0x300baa,_0x30443f,!![]);}catch(_0xe5b7ac){return BPromise[_0x740f('0x25')](_0xe5b7ac);}return _0x300baa['save']();};}function saveUpdates(_0x1a0e0c,_0x2d30a3){return function(_0x4b8cb0){if(_0x4b8cb0){return _0x4b8cb0[_0x740f('0x26')](_0x1a0e0c)['then'](function(_0x3df774){return _0x3df774;});}return null;};}function removeEntity(_0x59ea77,_0x5bdf94){return function(_0x481aea){if(_0x481aea){return _0x481aea[_0x740f('0x27')]()[_0x740f('0x28')](function(){_0x59ea77[_0x740f('0x1b')](0xcc)[_0x740f('0x1c')]();});}};}function handleEntityNotFound(_0x4056a1,_0x4b8899){return function(_0x1051aa){if(!_0x1051aa){_0x4056a1[_0x740f('0x1a')](0x194);}return _0x1051aa;};}function handleError(_0x129097,_0x436a06){_0x436a06=_0x436a06||0x1f4;return function(_0x15018f){logger['error'](_0x15018f[_0x740f('0x29')]);if(_0x15018f[_0x740f('0x2a')]){delete _0x15018f[_0x740f('0x2a')];}_0x129097['status'](_0x436a06)['send'](_0x15018f);};}exports[_0x740f('0x2b')]=function(_0x4147e3,_0xa566ad){var _0x1ec245={},_0x3a0cd0={},_0x41c307={'count':0x0,'rows':[]};var _0x1e9e1b=_['map'](db[_0x740f('0x2c')][_0x740f('0x2d')],function(_0x3247a4){return{'name':_0x3247a4['fieldName'],'type':_0x3247a4['type'][_0x740f('0x2e')]};});_0x3a0cd0[_0x740f('0x2f')]=_[_0x740f('0x30')](_0x1e9e1b,_0x740f('0x2a'));_0x3a0cd0['query']=_[_0x740f('0x31')](_0x4147e3[_0x740f('0x32')]);_0x3a0cd0[_0x740f('0x33')]=_['intersection'](_0x3a0cd0[_0x740f('0x2f')],_0x3a0cd0['query']);_0x1ec245[_0x740f('0x34')]=_['intersection'](_0x3a0cd0[_0x740f('0x2f')],qs[_0x740f('0x35')](_0x4147e3[_0x740f('0x32')]['fields']));_0x1ec245['attributes']=_0x1ec245[_0x740f('0x34')][_0x740f('0x36')]?_0x1ec245[_0x740f('0x34')]:_0x3a0cd0[_0x740f('0x2f')];if(!_0x4147e3[_0x740f('0x32')]['hasOwnProperty'](_0x740f('0x37'))){_0x1ec245[_0x740f('0x1f')]=qs[_0x740f('0x1f')](_0x4147e3['query'][_0x740f('0x1f')]);_0x1ec245[_0x740f('0x21')]=qs['offset'](_0x4147e3[_0x740f('0x32')][_0x740f('0x21')]);}_0x1ec245[_0x740f('0x38')]=qs[_0x740f('0x39')](_0x4147e3[_0x740f('0x32')][_0x740f('0x39')]);_0x1ec245[_0x740f('0x3a')]=qs[_0x740f('0x33')](_['pick'](_0x4147e3[_0x740f('0x32')],_0x3a0cd0[_0x740f('0x33')]),_0x1e9e1b);if(_0x4147e3['query'][_0x740f('0x3b')]){_0x1ec245['where']=_[_0x740f('0x3c')](_0x1ec245[_0x740f('0x3a')],{'$or':_[_0x740f('0x30')](_0x1e9e1b,function(_0x511ff1){if(_0x511ff1[_0x740f('0x3d')]!==_0x740f('0x3e')){var _0xe37d5f={};_0xe37d5f[_0x511ff1[_0x740f('0x2a')]]={'$like':'%'+_0x4147e3[_0x740f('0x32')][_0x740f('0x3b')]+'%'};return _0xe37d5f;}})});}_0x1ec245=_[_0x740f('0x3c')]({},_0x1ec245,_0x4147e3[_0x740f('0x3f')]);var _0x3da9ca={'where':_0x1ec245[_0x740f('0x3a')]};return db[_0x740f('0x2c')]['count'](_0x3da9ca)['then'](function(_0x1ae05e){_0x41c307[_0x740f('0x20')]=_0x1ae05e;if(_0x4147e3['query'][_0x740f('0x40')]){_0x1ec245[_0x740f('0x41')]=[{'all':!![]}];}return db[_0x740f('0x2c')][_0x740f('0x42')](_0x1ec245);})[_0x740f('0x28')](function(_0x395095){_0x41c307[_0x740f('0x43')]=_0x395095;return _0x41c307;})[_0x740f('0x28')](respondWithFilteredResult(_0xa566ad,_0x1ec245))[_0x740f('0x44')](handleError(_0xa566ad,null));};exports[_0x740f('0x45')]=function(_0x2c5e04,_0x341800){var _0x170ce6={'raw':!![],'where':{'id':_0x2c5e04[_0x740f('0x46')]['id']}},_0x368aba={};_0x368aba[_0x740f('0x2f')]=_[_0x740f('0x31')](db['CmHopperHistory']['rawAttributes']);_0x368aba[_0x740f('0x32')]=_['keys'](_0x2c5e04[_0x740f('0x32')]);_0x368aba[_0x740f('0x33')]=_[_0x740f('0x47')](_0x368aba[_0x740f('0x2f')],_0x368aba[_0x740f('0x32')]);_0x170ce6[_0x740f('0x34')]=_[_0x740f('0x47')](_0x368aba['model'],qs[_0x740f('0x35')](_0x2c5e04['query'][_0x740f('0x35')]));_0x170ce6[_0x740f('0x34')]=_0x170ce6[_0x740f('0x34')][_0x740f('0x36')]?_0x170ce6[_0x740f('0x34')]:_0x368aba[_0x740f('0x2f')];if(_0x2c5e04['query'][_0x740f('0x40')]){_0x170ce6[_0x740f('0x41')]=[{'all':!![]}];}_0x170ce6=_[_0x740f('0x3c')]({},_0x170ce6,_0x2c5e04[_0x740f('0x3f')]);return db[_0x740f('0x2c')][_0x740f('0x48')](_0x170ce6)['then'](handleEntityNotFound(_0x341800,null))[_0x740f('0x28')](respondWithResult(_0x341800,null))['catch'](handleError(_0x341800,null));};exports[_0x740f('0x49')]=function(_0x12f0fd,_0x2308d5){return db['CmHopperHistory']['create'](_0x12f0fd[_0x740f('0x4a')],{})[_0x740f('0x28')](respondWithResult(_0x2308d5,0xc9))[_0x740f('0x44')](handleError(_0x2308d5,null));};exports[_0x740f('0x4b')]=function(_0x4e6dbf,_0x1cf53c){return db[_0x740f('0x2c')][_0x740f('0x4b')]()[_0x740f('0x28')](respondWithResult(_0x1cf53c,null))[_0x740f('0x44')](handleError(_0x1cf53c,null));};exports[_0x740f('0x26')]=function(_0x151cac,_0x1b8fbf){if(_0x151cac[_0x740f('0x4a')][_0x740f('0x4c')]){delete _0x151cac[_0x740f('0x4a')][_0x740f('0x4c')];}return db[_0x740f('0x2c')][_0x740f('0x48')]({'where':{'uniqueid':_0x151cac[_0x740f('0x46')]['id']}})[_0x740f('0x28')](handleEntityNotFound(_0x1b8fbf,null))['then'](saveUpdates(_0x151cac[_0x740f('0x4a')],null))[_0x740f('0x28')](respondWithResult(_0x1b8fbf,null))[_0x740f('0x44')](handleError(_0x1b8fbf,null));}; \ No newline at end of file +var _0xd469=['send','map','CmHopperHistory','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','options','count','include','findAll','show','rawAttributes','includeAll','merge','create','catch','describe','body','uniqueid','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','offset','undefined','limit','set','json','apply','reject','save','update','then','destroy','error','stack','name'];(function(_0x43d79c,_0x531a55){var _0x4866b0=function(_0x847a){while(--_0x847a){_0x43d79c['push'](_0x43d79c['shift']());}};_0x4866b0(++_0x531a55);}(_0xd469,0x67));var _0x9d46=function(_0x4ade07,_0x24a58d){_0x4ade07=_0x4ade07-0x0;var _0x5c41a4=_0xd469[_0x4ade07];return _0x5c41a4;};'use strict';var emlformat=require(_0x9d46('0x0'));var rimraf=require(_0x9d46('0x1'));var zipdir=require(_0x9d46('0x2'));var jsonpatch=require(_0x9d46('0x3'));var rp=require(_0x9d46('0x4'));var moment=require(_0x9d46('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9d46('0x6'));var path=require(_0x9d46('0x7'));var sox=require('sox');var csv=require(_0x9d46('0x8'));var ejs=require(_0x9d46('0x9'));var fs=require('fs');var fs_extra=require(_0x9d46('0xa'));var _=require('lodash');var squel=require(_0x9d46('0xb'));var crypto=require('crypto');var jsforce=require(_0x9d46('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9d46('0x8'));var querystring=require(_0x9d46('0xd'));var Papa=require('papaparse');var Redis=require(_0x9d46('0xe'));var authService=require(_0x9d46('0xf'));var qs=require(_0x9d46('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9d46('0x11'));var logger=require('../../config/logger')(_0x9d46('0x12'));var utils=require(_0x9d46('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x9d46('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4daadd,_0x47ea63){_0x47ea63=_0x47ea63||0xcc;return function(_0x519fb0){if(_0x519fb0){return _0x4daadd[_0x9d46('0x15')](_0x47ea63);}return _0x4daadd[_0x9d46('0x16')](_0x47ea63)['end']();};}function respondWithResult(_0x470fbe,_0x1331a3){_0x1331a3=_0x1331a3||0xc8;return function(_0x4376af){if(_0x4376af){return _0x470fbe[_0x9d46('0x16')](_0x1331a3)['json'](_0x4376af);}};}function respondWithFilteredResult(_0x297373,_0x36207c){return function(_0x4b0de4){if(_0x4b0de4){var _0x55c733=typeof _0x36207c[_0x9d46('0x17')]===_0x9d46('0x18')&&typeof _0x36207c[_0x9d46('0x19')]==='undefined';var _0xb38299=_0x4b0de4['count'];var _0x26fa89=_0x55c733?0x0:_0x36207c['offset'];var _0x2b2ae3=_0x55c733?_0x4b0de4['count']:_0x36207c[_0x9d46('0x17')]+_0x36207c[_0x9d46('0x19')];var _0x5ef1b5;if(_0x2b2ae3>=_0xb38299){_0x2b2ae3=_0xb38299;_0x5ef1b5=0xc8;}else{_0x5ef1b5=0xce;}_0x297373[_0x9d46('0x16')](_0x5ef1b5);return _0x297373[_0x9d46('0x1a')]('Content-Range',_0x26fa89+'-'+_0x2b2ae3+'/'+_0xb38299)[_0x9d46('0x1b')](_0x4b0de4);}return null;};}function patchUpdates(_0x181493){return function(_0x5bc507){try{jsonpatch[_0x9d46('0x1c')](_0x5bc507,_0x181493,!![]);}catch(_0x5c7a21){return BPromise[_0x9d46('0x1d')](_0x5c7a21);}return _0x5bc507[_0x9d46('0x1e')]();};}function saveUpdates(_0x58973b,_0x44357d){return function(_0x429000){if(_0x429000){return _0x429000[_0x9d46('0x1f')](_0x58973b)[_0x9d46('0x20')](function(_0x51a4fa){return _0x51a4fa;});}return null;};}function removeEntity(_0x545b8d,_0x38834d){return function(_0x5806c8){if(_0x5806c8){return _0x5806c8[_0x9d46('0x21')]()[_0x9d46('0x20')](function(){_0x545b8d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x463bc7,_0x47df78){return function(_0x54a160){if(!_0x54a160){_0x463bc7[_0x9d46('0x15')](0x194);}return _0x54a160;};}function handleError(_0x57e88e,_0x13a3cf){_0x13a3cf=_0x13a3cf||0x1f4;return function(_0x2db550){logger[_0x9d46('0x22')](_0x2db550[_0x9d46('0x23')]);if(_0x2db550[_0x9d46('0x24')]){delete _0x2db550[_0x9d46('0x24')];}_0x57e88e[_0x9d46('0x16')](_0x13a3cf)[_0x9d46('0x25')](_0x2db550);};}exports['index']=function(_0x39285d,_0x4c48ed){var _0x14a045={},_0x19104d={},_0x464a07={'count':0x0,'rows':[]};var _0x3882f5=_[_0x9d46('0x26')](db[_0x9d46('0x27')]['rawAttributes'],function(_0xbdbedb){return{'name':_0xbdbedb['fieldName'],'type':_0xbdbedb[_0x9d46('0x28')][_0x9d46('0x29')]};});_0x19104d[_0x9d46('0x2a')]=_[_0x9d46('0x26')](_0x3882f5,_0x9d46('0x24'));_0x19104d[_0x9d46('0x2b')]=_[_0x9d46('0x2c')](_0x39285d[_0x9d46('0x2b')]);_0x19104d['filters']=_[_0x9d46('0x2d')](_0x19104d['model'],_0x19104d[_0x9d46('0x2b')]);_0x14a045['attributes']=_[_0x9d46('0x2d')](_0x19104d[_0x9d46('0x2a')],qs[_0x9d46('0x2e')](_0x39285d['query'][_0x9d46('0x2e')]));_0x14a045['attributes']=_0x14a045[_0x9d46('0x2f')][_0x9d46('0x30')]?_0x14a045[_0x9d46('0x2f')]:_0x19104d['model'];if(!_0x39285d[_0x9d46('0x2b')][_0x9d46('0x31')]('nolimit')){_0x14a045['limit']=qs[_0x9d46('0x19')](_0x39285d['query']['limit']);_0x14a045[_0x9d46('0x17')]=qs[_0x9d46('0x17')](_0x39285d[_0x9d46('0x2b')][_0x9d46('0x17')]);}_0x14a045[_0x9d46('0x32')]=qs[_0x9d46('0x33')](_0x39285d[_0x9d46('0x2b')][_0x9d46('0x33')]);_0x14a045[_0x9d46('0x34')]=qs['filters'](_['pick'](_0x39285d[_0x9d46('0x2b')],_0x19104d['filters']),_0x3882f5);if(_0x39285d[_0x9d46('0x2b')][_0x9d46('0x35')]){_0x14a045[_0x9d46('0x34')]=_['merge'](_0x14a045[_0x9d46('0x34')],{'$or':_[_0x9d46('0x26')](_0x3882f5,function(_0x4293f7){if(_0x4293f7[_0x9d46('0x28')]!==_0x9d46('0x36')){var _0x46461b={};_0x46461b[_0x4293f7['name']]={'$like':'%'+_0x39285d[_0x9d46('0x2b')]['filter']+'%'};return _0x46461b;}})});}_0x14a045=_['merge']({},_0x14a045,_0x39285d[_0x9d46('0x37')]);var _0x5a29a3={'where':_0x14a045[_0x9d46('0x34')]};return db['CmHopperHistory'][_0x9d46('0x38')](_0x5a29a3)[_0x9d46('0x20')](function(_0x29ab1a){_0x464a07[_0x9d46('0x38')]=_0x29ab1a;if(_0x39285d['query']['includeAll']){_0x14a045[_0x9d46('0x39')]=[{'all':!![]}];}return db[_0x9d46('0x27')][_0x9d46('0x3a')](_0x14a045);})[_0x9d46('0x20')](function(_0x108cbd){_0x464a07['rows']=_0x108cbd;return _0x464a07;})['then'](respondWithFilteredResult(_0x4c48ed,_0x14a045))['catch'](handleError(_0x4c48ed,null));};exports[_0x9d46('0x3b')]=function(_0xa9829a,_0x42f276){var _0x27ba96={'raw':!![],'where':{'id':_0xa9829a['params']['id']}},_0x3f0c6a={};_0x3f0c6a['model']=_[_0x9d46('0x2c')](db[_0x9d46('0x27')][_0x9d46('0x3c')]);_0x3f0c6a[_0x9d46('0x2b')]=_[_0x9d46('0x2c')](_0xa9829a['query']);_0x3f0c6a['filters']=_[_0x9d46('0x2d')](_0x3f0c6a[_0x9d46('0x2a')],_0x3f0c6a[_0x9d46('0x2b')]);_0x27ba96['attributes']=_[_0x9d46('0x2d')](_0x3f0c6a[_0x9d46('0x2a')],qs[_0x9d46('0x2e')](_0xa9829a['query'][_0x9d46('0x2e')]));_0x27ba96[_0x9d46('0x2f')]=_0x27ba96[_0x9d46('0x2f')][_0x9d46('0x30')]?_0x27ba96[_0x9d46('0x2f')]:_0x3f0c6a[_0x9d46('0x2a')];if(_0xa9829a[_0x9d46('0x2b')][_0x9d46('0x3d')]){_0x27ba96['include']=[{'all':!![]}];}_0x27ba96=_[_0x9d46('0x3e')]({},_0x27ba96,_0xa9829a['options']);return db['CmHopperHistory']['find'](_0x27ba96)[_0x9d46('0x20')](handleEntityNotFound(_0x42f276,null))['then'](respondWithResult(_0x42f276,null))['catch'](handleError(_0x42f276,null));};exports[_0x9d46('0x3f')]=function(_0x2c5c59,_0x257eb3){return db[_0x9d46('0x27')]['create'](_0x2c5c59['body'],{})[_0x9d46('0x20')](respondWithResult(_0x257eb3,0xc9))[_0x9d46('0x40')](handleError(_0x257eb3,null));};exports['describe']=function(_0x5686fc,_0x416a7b){return db[_0x9d46('0x27')][_0x9d46('0x41')]()[_0x9d46('0x20')](respondWithResult(_0x416a7b,null))[_0x9d46('0x40')](handleError(_0x416a7b,null));};exports[_0x9d46('0x1f')]=function(_0x3862c6,_0x451f77){if(_0x3862c6[_0x9d46('0x42')][_0x9d46('0x43')]){delete _0x3862c6[_0x9d46('0x42')][_0x9d46('0x43')];}return db[_0x9d46('0x27')][_0x9d46('0x44')]({'where':{'uniqueid':_0x3862c6[_0x9d46('0x45')]['id']}})[_0x9d46('0x20')](handleEntityNotFound(_0x451f77,null))[_0x9d46('0x20')](saveUpdates(_0x3862c6[_0x9d46('0x42')],null))[_0x9d46('0x20')](respondWithResult(_0x451f77,null))['catch'](handleError(_0x451f77,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 3ce8673..608ead8 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 _0xa76e=['exports','CmHopperHistory','cm_hopper_history','uniqueid','util','../../config/logger','bluebird','path','rimraf','../../config/environment'];(function(_0x112cb1,_0x13a91a){var _0x134d19=function(_0x38dd89){while(--_0x38dd89){_0x112cb1['push'](_0x112cb1['shift']());}};_0x134d19(++_0x13a91a);}(_0xa76e,0xfe));var _0xea76=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xa76e[_0x5f09c5];return _0x426ad9;};'use strict';var _=require('lodash');var util=require(_0xea76('0x0'));var logger=require(_0xea76('0x1'))('api');var moment=require('moment');var BPromise=require(_0xea76('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xea76('0x3'));var rimraf=require(_0xea76('0x4'));var config=require(_0xea76('0x5'));var attributes=require('./cmHopperHistory.attributes');module[_0xea76('0x6')]=function(_0x48ff4f,_0x337097){return _0x48ff4f['define'](_0xea76('0x7'),attributes,{'tableName':_0xea76('0x8'),'paranoid':![],'indexes':[{'name':'endtime','fields':['endtime']},{'name':_0xea76('0x9'),'fields':[_0xea76('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5c3c=['path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','endtime','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x204716,_0x4e5ef8){var _0x18aae0=function(_0x449aa2){while(--_0x449aa2){_0x204716['push'](_0x204716['shift']());}};_0x18aae0(++_0x4e5ef8);}(_0x5c3c,0x132));var _0xc5c3=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0x5c3c[_0x1b828b];return _0x98da1a;};'use strict';var _=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var logger=require(_0xc5c3('0x2'))(_0xc5c3('0x3'));var moment=require('moment');var BPromise=require(_0xc5c3('0x4'));var rp=require(_0xc5c3('0x5'));var fs=require('fs');var path=require(_0xc5c3('0x6'));var rimraf=require(_0xc5c3('0x7'));var config=require(_0xc5c3('0x8'));var attributes=require(_0xc5c3('0x9'));module[_0xc5c3('0xa')]=function(_0x23a6b5,_0x28bdd9){return _0x23a6b5['define']('CmHopperHistory',attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0xc5c3('0xb'),'fields':[_0xc5c3('0xb')]},{'name':'uniqueid','fields':[_0xc5c3('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 6bd5209..26105ec 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 _0x7985=['AvgHandleTime','sequelize','COUNT','predictiveIntervalTotalCalls','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','literal','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','debug','catch','GetVoiceQueueHopperHistory','findAll','where','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','col','ivrAnswerCallsDay','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateCmHopperHistory','CmHopperHistory','body','options','raw'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x7985,0x1de));var _0x5798=function(_0x3ca012,_0x4cff79){_0x3ca012=_0x3ca012-0x0;var _0x1a8b78=_0x7985[_0x3ca012];return _0x1a8b78;};'use strict';var _=require(_0x5798('0x0'));var util=require('util');var moment=require(_0x5798('0x1'));var BPromise=require(_0x5798('0x2'));var rs=require(_0x5798('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5798('0x4'));var logger=require(_0x5798('0x5'))(_0x5798('0x6'));var config=require('../../config/environment');var jayson=require(_0x5798('0x7'));var client=jayson[_0x5798('0x8')][_0x5798('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b18ae,_0xc5e33e,_0x5f2e1f){return new BPromise(function(_0x440294,_0x1b69d9){return client[_0x5798('0xa')](_0x5b18ae,_0x5f2e1f)[_0x5798('0xb')](function(_0x200c58){logger[_0x5798('0xc')](_0x5798('0xd'),_0xc5e33e,_0x5798('0xe'));logger['debug'](_0x5798('0xf'),_0xc5e33e,_0x5798('0xe'),JSON[_0x5798('0x10')](_0x200c58));if(_0x200c58[_0x5798('0x11')]){if(_0x200c58[_0x5798('0x11')][_0x5798('0x12')]===0x1f4){logger[_0x5798('0x11')](_0x5798('0xd'),_0xc5e33e,_0x200c58[_0x5798('0x11')]['message']);return _0x1b69d9(_0x200c58[_0x5798('0x11')]['message']);}logger['error']('CmHopperHistory,\x20%s,\x20%s',_0xc5e33e,_0x200c58[_0x5798('0x11')][_0x5798('0x13')]);return _0x440294(_0x200c58[_0x5798('0x11')][_0x5798('0x13')]);}else{logger[_0x5798('0xc')]('CmHopperHistory,\x20%s,\x20%s',_0xc5e33e,'request\x20sent');_0x440294(_0x200c58[_0x5798('0x14')]['message']);}})['catch'](function(_0x48c290){logger['error'](_0x5798('0xd'),_0xc5e33e,_0x48c290);_0x1b69d9(_0x48c290);});});}exports[_0x5798('0x15')]=function(_0xb9c076){var _0x272005=this;return new Promise(function(_0x26871f,_0x399bf6){return db[_0x5798('0x16')]['create'](_0xb9c076[_0x5798('0x17')],{'raw':_0xb9c076[_0x5798('0x18')]?_0xb9c076[_0x5798('0x18')][_0x5798('0x19')]===undefined?!![]:![]:!![]})[_0x5798('0xb')](function(_0x4dd1e2){logger[_0x5798('0xc')]('CreateCmHopperHistory',_0xb9c076);logger['debug'](_0x5798('0x15'),_0xb9c076,JSON[_0x5798('0x10')](_0x4dd1e2));_0x26871f(_0x4dd1e2);})['catch'](function(_0x4bd972){logger[_0x5798('0x11')](_0x5798('0x15'),_0x4bd972['message'],_0xb9c076);_0x399bf6(_0x272005['error'](0x1f4,_0x4bd972[_0x5798('0x13')]));});});};exports[_0x5798('0x1a')]=function(_0x5c296f){var _0x13dce5=this;return new Promise(function(_0x1096a0,_0x1867d6){return db[_0x5798('0x16')]['findAll']({'raw':_0x5c296f[_0x5798('0x18')]?_0x5c296f[_0x5798('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5c296f['options']?_0x5c296f[_0x5798('0x18')]['where']||null:null,'attributes':[[db[_0x5798('0x1b')]['fn'](_0x5798('0x1c'),db[_0x5798('0x1b')]['col']('id')),_0x5798('0x1d')],[db[_0x5798('0x1b')]['fn']('COUNT',db[_0x5798('0x1b')]['fn']('IF',db['sequelize']['literal'](_0x5798('0x1e')))),_0x5798('0x1f')],[db['sequelize']['fn'](_0x5798('0x1c'),db[_0x5798('0x1b')]['fn']('IF',db[_0x5798('0x1b')][_0x5798('0x20')]('`state`\x20=\x2010,\x201,\x20null'))),_0x5798('0x21')],[db['sequelize']['fn'](_0x5798('0x1c'),db[_0x5798('0x1b')]['fn']('IF',db[_0x5798('0x1b')][_0x5798('0x20')](_0x5798('0x22')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x5798('0x1b')]['fn']('AVG',db[_0x5798('0x1b')]['fn']('IF',db[_0x5798('0x1b')]['literal'](_0x5798('0x23')))),_0x5798('0x24')],[db['sequelize']['fn'](_0x5798('0x25'),db['sequelize']['fn']('IF',db['sequelize'][_0x5798('0x20')](_0x5798('0x26')))),_0x5798('0x27')]]})['then'](function(_0x5b4379){logger[_0x5798('0xc')]('AvgHandleTime',_0x5c296f);logger[_0x5798('0x28')]('AvgHandleTime',_0x5c296f,JSON['stringify'](_0x5b4379));_0x1096a0(_0x5b4379);})[_0x5798('0x29')](function(_0x5eee64){logger[_0x5798('0x11')]('AvgHandleTime',_0x5eee64[_0x5798('0x13')],_0x5c296f);_0x1867d6(_0x13dce5[_0x5798('0x11')](0x1f4,_0x5eee64[_0x5798('0x13')]));});});};exports[_0x5798('0x2a')]=function(_0x4f5895){var _0x3518fe=this;return new Promise(function(_0x48eae3,_0x534333){return db['CmHopperHistory'][_0x5798('0x2b')]({'raw':_0x4f5895['options']?_0x4f5895[_0x5798('0x18')][_0x5798('0x19')]===undefined?!![]:![]:!![],'where':_0x4f5895[_0x5798('0x18')]?_0x4f5895[_0x5798('0x18')][_0x5798('0x2c')]||null:null,'attributes':[[_0x5798('0x2d'),_0x5798('0x2e')],[db[_0x5798('0x1b')]['fn'](_0x5798('0x1c'),db['sequelize']['fn']('IF',db[_0x5798('0x1b')]['literal'](_0x5798('0x2f')))),'outboundNoSuchCallsDay'],[db[_0x5798('0x1b')]['fn'](_0x5798('0x1c'),db[_0x5798('0x1b')]['fn']('IF',db[_0x5798('0x1b')][_0x5798('0x20')]('`state`\x20=\x203,\x201,\x20null'))),_0x5798('0x30')],[db['sequelize']['fn'](_0x5798('0x1c'),db[_0x5798('0x1b')]['fn']('IF',db[_0x5798('0x1b')]['literal'](_0x5798('0x1e')))),_0x5798('0x31')],[db[_0x5798('0x1b')]['fn'](_0x5798('0x1c'),db[_0x5798('0x1b')]['fn']('IF',db[_0x5798('0x1b')]['literal'](_0x5798('0x32')))),_0x5798('0x33')],[db[_0x5798('0x1b')]['fn'](_0x5798('0x1c'),db[_0x5798('0x1b')]['fn']('IF',db[_0x5798('0x1b')]['literal'](_0x5798('0x34')))),'outboundCongestionCallsDay'],[db[_0x5798('0x1b')]['fn'](_0x5798('0x1c'),db[_0x5798('0x1b')]['fn']('IF',db['sequelize'][_0x5798('0x20')](_0x5798('0x35')))),_0x5798('0x36')],[db['sequelize']['fn']('COUNT',db[_0x5798('0x1b')]['fn']('IF',db[_0x5798('0x1b')][_0x5798('0x20')](_0x5798('0x37')))),'outboundDropCallsDayCallersExit'],[db['sequelize']['fn'](_0x5798('0x1c'),db[_0x5798('0x1b')]['fn']('IF',db['sequelize'][_0x5798('0x20')](_0x5798('0x38')))),_0x5798('0x39')],[db[_0x5798('0x1b')]['fn'](_0x5798('0x1c'),db[_0x5798('0x1b')]['fn']('IF',db[_0x5798('0x1b')][_0x5798('0x20')](_0x5798('0x3a')))),_0x5798('0x3b')],[db[_0x5798('0x1b')]['fn'](_0x5798('0x1c'),db[_0x5798('0x1b')]['fn']('IF',db[_0x5798('0x1b')]['literal'](_0x5798('0x3c')))),_0x5798('0x3d')],[db[_0x5798('0x1b')]['fn']('COUNT',db[_0x5798('0x1b')]['fn']('IF',db[_0x5798('0x1b')]['literal'](_0x5798('0x3e')))),'outboundRejectCallsDay'],[db[_0x5798('0x1b')]['fn'](_0x5798('0x1c'),db[_0x5798('0x1b')]['fn']('IF',db[_0x5798('0x1b')][_0x5798('0x20')](_0x5798('0x3f')))),_0x5798('0x40')],[db['sequelize']['fn'](_0x5798('0x1c'),db[_0x5798('0x1b')]['fn']('IF',db[_0x5798('0x1b')][_0x5798('0x20')](_0x5798('0x41')))),_0x5798('0x42')],[db[_0x5798('0x1b')]['fn'](_0x5798('0x1c'),db[_0x5798('0x1b')]['fn']('IF',db[_0x5798('0x1b')][_0x5798('0x20')](_0x5798('0x43')))),_0x5798('0x44')]],'group':['campaign']})[_0x5798('0xb')](function(_0x9dd130){logger[_0x5798('0xc')]('GetVoiceQueueHopperHistory',_0x4f5895);logger[_0x5798('0x28')]('GetVoiceQueueHopperHistory',_0x4f5895,JSON['stringify'](_0x9dd130));_0x48eae3(_0x9dd130);})[_0x5798('0x29')](function(_0x406468){logger[_0x5798('0x11')](_0x5798('0x2a'),_0x406468[_0x5798('0x13')],_0x4f5895);_0x534333(_0x3518fe[_0x5798('0x11')](0x1f4,_0x406468[_0x5798('0x13')]));});});};exports[_0x5798('0x45')]=function(_0x660076){var _0x1da114=this;return new Promise(function(_0x276713,_0x10bdcc){return db[_0x5798('0x16')][_0x5798('0x2b')]({'raw':_0x660076['options']?_0x660076[_0x5798('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x660076[_0x5798('0x18')]?_0x660076['options'][_0x5798('0x2c')]||null:null,'attributes':[[_0x5798('0x2d'),'name'],[db[_0x5798('0x1b')]['fn'](_0x5798('0x1c'),db[_0x5798('0x1b')][_0x5798('0x46')]('id')),'ivrTotalCallsDays'],[db[_0x5798('0x1b')]['fn'](_0x5798('0x1c'),db[_0x5798('0x1b')]['fn']('IF',db[_0x5798('0x1b')][_0x5798('0x20')]('`state`\x20=\x204,\x201,\x20null'))),_0x5798('0x47')]],'group':[_0x5798('0x2d')]})[_0x5798('0xb')](function(_0x49b469){logger[_0x5798('0xc')](_0x5798('0x45'),_0x660076);logger[_0x5798('0x28')]('GetCampaignHopperHistory',_0x660076,JSON[_0x5798('0x10')](_0x49b469));_0x276713(_0x49b469);})[_0x5798('0x29')](function(_0x28ec83){logger['error']('GetCampaignHopperHistory',_0x28ec83[_0x5798('0x13')],_0x660076);_0x10bdcc(_0x1da114[_0x5798('0x11')](0x1f4,_0x28ec83['message']));});});}; \ No newline at end of file +var _0x042a=['`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','col','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','request\x20sent','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','CmHopperHistory,\x20%s,\x20%s','message','result','catch','CreateCmHopperHistory','body','options','raw','debug','AvgHandleTime','where','sequelize','COUNT','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','CmHopperHistory','findAll','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay'];(function(_0x55821d,_0x27a22e){var _0x58ea8a=function(_0x5bdd3d){while(--_0x5bdd3d){_0x55821d['push'](_0x55821d['shift']());}};_0x58ea8a(++_0x27a22e);}(_0x042a,0x1ce));var _0xa042=function(_0x262566,_0x4aee40){_0x262566=_0x262566-0x0;var _0x55ef7d=_0x042a[_0x262566];return _0x55ef7d;};'use strict';var _=require(_0xa042('0x0'));var util=require(_0xa042('0x1'));var moment=require(_0xa042('0x2'));var BPromise=require(_0xa042('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa042('0x4'));var db=require(_0xa042('0x5'))['db'];var utils=require(_0xa042('0x6'));var logger=require(_0xa042('0x7'))('rpc');var config=require(_0xa042('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa042('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50bbf3,_0x501ad7,_0x113464){return new BPromise(function(_0x464a6,_0x557ffa){return client[_0xa042('0xa')](_0x50bbf3,_0x113464)[_0xa042('0xb')](function(_0x354572){logger[_0xa042('0xc')]('CmHopperHistory,\x20%s,\x20%s',_0x501ad7,_0xa042('0xd'));logger['debug'](_0xa042('0xe'),_0x501ad7,_0xa042('0xd'),JSON[_0xa042('0xf')](_0x354572));if(_0x354572[_0xa042('0x10')]){if(_0x354572[_0xa042('0x10')]['code']===0x1f4){logger['error'](_0xa042('0x11'),_0x501ad7,_0x354572[_0xa042('0x10')]['message']);return _0x557ffa(_0x354572[_0xa042('0x10')][_0xa042('0x12')]);}logger[_0xa042('0x10')](_0xa042('0x11'),_0x501ad7,_0x354572[_0xa042('0x10')][_0xa042('0x12')]);return _0x464a6(_0x354572['error']['message']);}else{logger[_0xa042('0xc')](_0xa042('0x11'),_0x501ad7,_0xa042('0xd'));_0x464a6(_0x354572[_0xa042('0x13')]['message']);}})[_0xa042('0x14')](function(_0x5c4ad3){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x501ad7,_0x5c4ad3);_0x557ffa(_0x5c4ad3);});});}exports[_0xa042('0x15')]=function(_0x4e8c54){var _0x38ad74=this;return new Promise(function(_0x439ecf,_0x240337){return db['CmHopperHistory']['create'](_0x4e8c54[_0xa042('0x16')],{'raw':_0x4e8c54[_0xa042('0x17')]?_0x4e8c54[_0xa042('0x17')][_0xa042('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x5884ab){logger[_0xa042('0xc')](_0xa042('0x15'),_0x4e8c54);logger[_0xa042('0x19')](_0xa042('0x15'),_0x4e8c54,JSON[_0xa042('0xf')](_0x5884ab));_0x439ecf(_0x5884ab);})[_0xa042('0x14')](function(_0x2e168a){logger['error'](_0xa042('0x15'),_0x2e168a[_0xa042('0x12')],_0x4e8c54);_0x240337(_0x38ad74[_0xa042('0x10')](0x1f4,_0x2e168a[_0xa042('0x12')]));});});};exports[_0xa042('0x1a')]=function(_0x26bde4){var _0xd53ec9=this;return new Promise(function(_0x19f992,_0x4da1f9){return db['CmHopperHistory']['findAll']({'raw':_0x26bde4[_0xa042('0x17')]?_0x26bde4[_0xa042('0x17')][_0xa042('0x18')]===undefined?!![]:![]:!![],'where':_0x26bde4[_0xa042('0x17')]?_0x26bde4[_0xa042('0x17')][_0xa042('0x1b')]||null:null,'attributes':[[db[_0xa042('0x1c')]['fn'](_0xa042('0x1d'),db[_0xa042('0x1c')]['col']('id')),_0xa042('0x1e')],[db['sequelize']['fn'](_0xa042('0x1d'),db[_0xa042('0x1c')]['fn']('IF',db[_0xa042('0x1c')][_0xa042('0x1f')](_0xa042('0x20')))),_0xa042('0x21')],[db[_0xa042('0x1c')]['fn'](_0xa042('0x1d'),db['sequelize']['fn']('IF',db[_0xa042('0x1c')][_0xa042('0x1f')](_0xa042('0x22')))),_0xa042('0x23')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xa042('0x1c')][_0xa042('0x1f')]('`state`\x20=\x2011,\x201,\x20null'))),_0xa042('0x24')],[db[_0xa042('0x1c')]['fn'](_0xa042('0x25'),db[_0xa042('0x1c')]['fn']('IF',db[_0xa042('0x1c')][_0xa042('0x1f')](_0xa042('0x26')))),_0xa042('0x27')],[db[_0xa042('0x1c')]['fn'](_0xa042('0x25'),db['sequelize']['fn']('IF',db[_0xa042('0x1c')]['literal'](_0xa042('0x28')))),_0xa042('0x29')]]})[_0xa042('0xb')](function(_0x1c84e8){logger[_0xa042('0xc')](_0xa042('0x1a'),_0x26bde4);logger[_0xa042('0x19')](_0xa042('0x1a'),_0x26bde4,JSON[_0xa042('0xf')](_0x1c84e8));_0x19f992(_0x1c84e8);})[_0xa042('0x14')](function(_0x2fe01b){logger['error'](_0xa042('0x1a'),_0x2fe01b['message'],_0x26bde4);_0x4da1f9(_0xd53ec9[_0xa042('0x10')](0x1f4,_0x2fe01b[_0xa042('0x12')]));});});};exports[_0xa042('0x2a')]=function(_0x4090af){var _0x4ffda9=this;return new Promise(function(_0x2d9ed4,_0x167f97){return db[_0xa042('0x2b')][_0xa042('0x2c')]({'raw':_0x4090af[_0xa042('0x17')]?_0x4090af[_0xa042('0x17')][_0xa042('0x18')]===undefined?!![]:![]:!![],'where':_0x4090af['options']?_0x4090af[_0xa042('0x17')][_0xa042('0x1b')]||null:null,'attributes':[[_0xa042('0x2d'),_0xa042('0x2e')],[db[_0xa042('0x1c')]['fn'](_0xa042('0x1d'),db['sequelize']['fn']('IF',db[_0xa042('0x1c')]['literal'](_0xa042('0x2f')))),_0xa042('0x30')],[db[_0xa042('0x1c')]['fn'](_0xa042('0x1d'),db[_0xa042('0x1c')]['fn']('IF',db[_0xa042('0x1c')]['literal'](_0xa042('0x31')))),_0xa042('0x32')],[db[_0xa042('0x1c')]['fn'](_0xa042('0x1d'),db[_0xa042('0x1c')]['fn']('IF',db[_0xa042('0x1c')][_0xa042('0x1f')]('`state`\x20=\x204,\x201,\x20null'))),_0xa042('0x33')],[db[_0xa042('0x1c')]['fn']('COUNT',db[_0xa042('0x1c')]['fn']('IF',db['sequelize'][_0xa042('0x1f')](_0xa042('0x34')))),_0xa042('0x35')],[db[_0xa042('0x1c')]['fn'](_0xa042('0x1d'),db[_0xa042('0x1c')]['fn']('IF',db['sequelize'][_0xa042('0x1f')](_0xa042('0x36')))),_0xa042('0x37')],[db[_0xa042('0x1c')]['fn']('COUNT',db[_0xa042('0x1c')]['fn']('IF',db[_0xa042('0x1c')][_0xa042('0x1f')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xa042('0x38')],[db[_0xa042('0x1c')]['fn'](_0xa042('0x1d'),db[_0xa042('0x1c')]['fn']('IF',db[_0xa042('0x1c')]['literal'](_0xa042('0x39')))),_0xa042('0x3a')],[db[_0xa042('0x1c')]['fn'](_0xa042('0x1d'),db[_0xa042('0x1c')]['fn']('IF',db[_0xa042('0x1c')][_0xa042('0x1f')](_0xa042('0x3b')))),_0xa042('0x3c')],[db['sequelize']['fn'](_0xa042('0x1d'),db[_0xa042('0x1c')]['fn']('IF',db[_0xa042('0x1c')][_0xa042('0x1f')]('`state`\x20=\x2013,\x201,\x20null'))),_0xa042('0x3d')],[db['sequelize']['fn']('COUNT',db[_0xa042('0x1c')]['fn']('IF',db['sequelize'][_0xa042('0x1f')]('`state`\x20=\x2014,\x201,\x20null'))),_0xa042('0x3e')],[db[_0xa042('0x1c')]['fn']('COUNT',db[_0xa042('0x1c')]['fn']('IF',db['sequelize'][_0xa042('0x1f')](_0xa042('0x3f')))),_0xa042('0x40')],[db[_0xa042('0x1c')]['fn'](_0xa042('0x1d'),db[_0xa042('0x1c')]['fn']('IF',db[_0xa042('0x1c')][_0xa042('0x1f')]('`state`\x20=\x2016,\x201,\x20null'))),_0xa042('0x41')],[db[_0xa042('0x1c')]['fn'](_0xa042('0x1d'),db[_0xa042('0x1c')]['fn']('IF',db[_0xa042('0x1c')]['literal'](_0xa042('0x42')))),_0xa042('0x40')],[db[_0xa042('0x1c')]['fn'](_0xa042('0x1d'),db[_0xa042('0x1c')]['fn']('IF',db['sequelize']['literal'](_0xa042('0x43')))),_0xa042('0x44')]],'group':[_0xa042('0x2d')]})['then'](function(_0x488e64){logger['info'](_0xa042('0x2a'),_0x4090af);logger[_0xa042('0x19')](_0xa042('0x2a'),_0x4090af,JSON[_0xa042('0xf')](_0x488e64));_0x2d9ed4(_0x488e64);})['catch'](function(_0x12aff9){logger[_0xa042('0x10')]('GetVoiceQueueHopperHistory',_0x12aff9[_0xa042('0x12')],_0x4090af);_0x167f97(_0x4ffda9[_0xa042('0x10')](0x1f4,_0x12aff9['message']));});});};exports['GetCampaignHopperHistory']=function(_0x5d73fb){var _0x226ae4=this;return new Promise(function(_0x48ce13,_0x18c994){return db[_0xa042('0x2b')][_0xa042('0x2c')]({'raw':_0x5d73fb[_0xa042('0x17')]?_0x5d73fb[_0xa042('0x17')][_0xa042('0x18')]===undefined?!![]:![]:!![],'where':_0x5d73fb[_0xa042('0x17')]?_0x5d73fb[_0xa042('0x17')][_0xa042('0x1b')]||null:null,'attributes':[[_0xa042('0x2d'),'name'],[db[_0xa042('0x1c')]['fn'](_0xa042('0x1d'),db[_0xa042('0x1c')][_0xa042('0x45')]('id')),_0xa042('0x46')],[db[_0xa042('0x1c')]['fn'](_0xa042('0x1d'),db[_0xa042('0x1c')]['fn']('IF',db[_0xa042('0x1c')][_0xa042('0x1f')](_0xa042('0x20')))),_0xa042('0x47')]],'group':[_0xa042('0x2d')]})[_0xa042('0xb')](function(_0x1616cf){logger[_0xa042('0xc')](_0xa042('0x48'),_0x5d73fb);logger[_0xa042('0x19')](_0xa042('0x48'),_0x5d73fb,JSON[_0xa042('0xf')](_0x1616cf));_0x48ce13(_0x1616cf);})[_0xa042('0x14')](function(_0x503d6c){logger[_0xa042('0x10')]('GetCampaignHopperHistory',_0x503d6c[_0xa042('0x12')],_0x5d73fb);_0x18c994(_0x226ae4[_0xa042('0x10')](0x1f4,_0x503d6c['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index a46dfbb..34fbd72 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 _0xf8cb=['describe','/:id','show','create','put','update','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','/describe'];(function(_0x5805d7,_0x3d584a){var _0x170fe4=function(_0x3b9b73){while(--_0x3b9b73){_0x5805d7['push'](_0x5805d7['shift']());}};_0x170fe4(++_0x3d584a);}(_0xf8cb,0xd8));var _0xbf8c=function(_0x1b297a,_0x2d2b12){_0x1b297a=_0x1b297a-0x0;var _0x25952a=_0xf8cb[_0x1b297a];return _0x25952a;};'use strict';var multer=require(_0xbf8c('0x0'));var util=require(_0xbf8c('0x1'));var path=require('path');var timeout=require(_0xbf8c('0x2'));var express=require(_0xbf8c('0x3'));var router=express[_0xbf8c('0x4')]();var fs_extra=require(_0xbf8c('0x5'));var auth=require(_0xbf8c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbf8c('0x7'));var controller=require(_0xbf8c('0x8'));router[_0xbf8c('0x9')]('/',auth[_0xbf8c('0xa')](),controller['index']);router[_0xbf8c('0x9')](_0xbf8c('0xb'),auth[_0xbf8c('0xa')](),controller[_0xbf8c('0xc')]);router['get'](_0xbf8c('0xd'),auth[_0xbf8c('0xa')](),controller[_0xbf8c('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbf8c('0xf')]);router[_0xbf8c('0x10')](_0xbf8c('0xd'),auth[_0xbf8c('0xa')](),controller[_0xbf8c('0x11')]);module[_0xbf8c('0x12')]=router; \ No newline at end of file +var _0x79e2=['show','post','create','update','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x17c5a7,_0x4931a2){var _0x498226=function(_0x343276){while(--_0x343276){_0x17c5a7['push'](_0x17c5a7['shift']());}};_0x498226(++_0x4931a2);}(_0x79e2,0x15b));var _0x279e=function(_0x19fa42,_0x5a0db0){_0x19fa42=_0x19fa42-0x0;var _0x4a1248=_0x79e2[_0x19fa42];return _0x4a1248;};'use strict';var multer=require(_0x279e('0x0'));var util=require(_0x279e('0x1'));var path=require(_0x279e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x279e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x279e('0x4'));var interaction=require(_0x279e('0x5'));var config=require(_0x279e('0x6'));var controller=require(_0x279e('0x7'));router[_0x279e('0x8')]('/',auth[_0x279e('0x9')](),controller['index']);router['get'](_0x279e('0xa'),auth[_0x279e('0x9')](),controller[_0x279e('0xb')]);router[_0x279e('0x8')](_0x279e('0xc'),auth[_0x279e('0x9')](),controller[_0x279e('0xd')]);router[_0x279e('0xe')]('/',auth[_0x279e('0x9')](),controller[_0x279e('0xf')]);router['put'](_0x279e('0xc'),auth[_0x279e('0x9')](),controller[_0x279e('0x10')]);module[_0x279e('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 80a85ed..a81953a 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 _0x3756=['STRING','name','sequelize','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3756,0x116));var _0x6375=function(_0x511dd7,_0x7c2757){_0x511dd7=_0x511dd7-0x0;var _0x17d81f=_0x3756[_0x511dd7];return _0x17d81f;};'use strict';var Sequelize=require(_0x6375('0x0'));module[_0x6375('0x1')]={'name':{'type':Sequelize[_0x6375('0x2')],'unique':_0x6375('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x6375('0x2')]},'dialPrefix':{'type':Sequelize[_0x6375('0x2')]}}; \ No newline at end of file +var _0x3fc6=['sequelize','exports','STRING'];(function(_0x4d729f,_0x52bf8b){var _0x5ce12a=function(_0x3ae6a6){while(--_0x3ae6a6){_0x4d729f['push'](_0x4d729f['shift']());}};_0x5ce12a(++_0x52bf8b);}(_0x3fc6,0x159));var _0x63fc=function(_0x3657e0,_0x5f45c3){_0x3657e0=_0x3657e0-0x0;var _0x4847a6=_0x3fc6[_0x3657e0];return _0x4847a6;};'use strict';var Sequelize=require(_0x63fc('0x0'));module[_0x63fc('0x1')]={'name':{'type':Sequelize[_0x63fc('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x63fc('0x2')]},'dialPrefix':{'type':Sequelize[_0x63fc('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index dbb59cd..f170f20 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 _0xf21b=['findAndCountAll','getGlobalCustomFields','addAgents','emit','userCmList:save','removeAgents','userCmList:remove','User','getAgents','info','spread','zip-dir','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','findAll','rows','catch','CmList','keys','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Lists','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','ListId','Disposition','findOne','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','omit','success','dataValues','message','Malformed\x20request\x20syntax','CmCustomField','CustomFields','format','raw','ContactItemType','OrderBy','alias','select','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','c.cf_','customField_','item','from','cm_contact_has_items','CmContactId\x20=\x20c.id','additionalPhone_','description','ItemTypeId\x20=\x20?','description_additionalPhone_','toString','each','now','/tmp/list_%d_%s.csv','Content-disposition','list_%d_%s.csv','setHeader','sendStatus','addCustomField','sequelize','transaction','Sequelize','TEXT','number','INTEGER','BOOLEAN','defaultValue','addColumn','cm_contacts','cf_%s'];(function(_0x5ef38c,_0x3fc37a){var _0x21aa45=function(_0x19abc3){while(--_0x19abc3){_0x5ef38c['push'](_0x5ef38c['shift']());}};_0x21aa45(++_0x3fc37a);}(_0xf21b,0x14b));var _0xbf21=function(_0x4d2865,_0x386377){_0x4d2865=_0x4d2865-0x0;var _0x5a03b5=_0xf21b[_0x4d2865];return _0x5a03b5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbf21('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbf21('0x1'));var path=require(_0xbf21('0x2'));var sox=require(_0xbf21('0x3'));var csv=require('to-csv');var ejs=require(_0xbf21('0x4'));var fs=require('fs');var fs_extra=require(_0xbf21('0x5'));var _=require(_0xbf21('0x6'));var squel=require(_0xbf21('0x7'));var crypto=require(_0xbf21('0x8'));var jsforce=require(_0xbf21('0x9'));var deskjs=require(_0xbf21('0xa'));var toCsv=require('to-csv');var querystring=require(_0xbf21('0xb'));var Papa=require(_0xbf21('0xc'));var Redis=require(_0xbf21('0xd'));var authService=require(_0xbf21('0xe'));var qs=require(_0xbf21('0xf'));var as=require(_0xbf21('0x10'));var hardwareService=require(_0xbf21('0x11'));var logger=require(_0xbf21('0x12'))(_0xbf21('0x13'));var utils=require('../../config/utils');var config=require(_0xbf21('0x14'));var licenseUtil=require(_0xbf21('0x15'));var db=require(_0xbf21('0x16'))['db'];var csv_results;config[_0xbf21('0x17')]=_[_0xbf21('0x18')](config[_0xbf21('0x17')],{'host':_0xbf21('0x19'),'port':0x18eb});var socket=require(_0xbf21('0x1a'))(new Redis(config[_0xbf21('0x17')]));require(_0xbf21('0x1b'))[_0xbf21('0x1c')](socket);function respondWithStatusCode(_0x4da04a,_0x5a80e5){_0x5a80e5=_0x5a80e5||0xcc;return function(_0x127eb6){if(_0x127eb6){return _0x4da04a['sendStatus'](_0x5a80e5);}return _0x4da04a[_0xbf21('0x1d')](_0x5a80e5)[_0xbf21('0x1e')]();};}function respondWithResult(_0x3e7f04,_0x5eb4cb){_0x5eb4cb=_0x5eb4cb||0xc8;return function(_0x3adb04){if(_0x3adb04){return _0x3e7f04[_0xbf21('0x1d')](_0x5eb4cb)[_0xbf21('0x1f')](_0x3adb04);}};}function respondWithFilteredResult(_0x119b9f,_0x452f97){return function(_0x11349b){if(_0x11349b){var _0x2179cf=typeof _0x452f97[_0xbf21('0x20')]===_0xbf21('0x21')&&typeof _0x452f97[_0xbf21('0x22')]==='undefined';var _0x427741=_0x11349b[_0xbf21('0x23')];var _0x3ab2df=_0x2179cf?0x0:_0x452f97[_0xbf21('0x20')];var _0x40d602=_0x2179cf?_0x11349b['count']:_0x452f97[_0xbf21('0x20')]+_0x452f97[_0xbf21('0x22')];var _0x32ae13;if(_0x40d602>=_0x427741){_0x40d602=_0x427741;_0x32ae13=0xc8;}else{_0x32ae13=0xce;}_0x119b9f[_0xbf21('0x1d')](_0x32ae13);return _0x119b9f[_0xbf21('0x24')](_0xbf21('0x25'),_0x3ab2df+'-'+_0x40d602+'/'+_0x427741)[_0xbf21('0x1f')](_0x11349b);}return null;};}function patchUpdates(_0x2a950b){return function(_0x56c741){try{jsonpatch[_0xbf21('0x26')](_0x56c741,_0x2a950b,!![]);}catch(_0x1a3928){return BPromise[_0xbf21('0x27')](_0x1a3928);}return _0x56c741[_0xbf21('0x28')]();};}function saveUpdates(_0x2428e5,_0x2937b6){return function(_0x5ecff1){if(_0x5ecff1){return _0x5ecff1[_0xbf21('0x29')](_0x2428e5)[_0xbf21('0x2a')](function(_0x4dcd09){return _0x4dcd09;});}return null;};}function removeEntity(_0x4bc8a0,_0x468c61){return function(_0x2e67f1){if(_0x2e67f1){return _0x2e67f1[_0xbf21('0x2b')]()[_0xbf21('0x2a')](function(){var _0x32cb39=_0x2e67f1[_0xbf21('0x2c')]({'plain':!![]});var _0x35e796='Lists';return db['UserProfileResource'][_0xbf21('0x2b')]({'where':{'type':_0x35e796,'resourceId':_0x32cb39['id']}})[_0xbf21('0x2a')](function(){return _0x2e67f1;});})[_0xbf21('0x2a')](function(){_0x4bc8a0[_0xbf21('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9267ca,_0x315d6c){return function(_0x2d957b){if(!_0x2d957b){_0x9267ca['sendStatus'](0x194);}return _0x2d957b;};}function handleError(_0x1abf2d,_0xd799c7){_0xd799c7=_0xd799c7||0x1f4;return function(_0x2aaf65){logger[_0xbf21('0x2d')](_0x2aaf65[_0xbf21('0x2e')]);if(_0x2aaf65[_0xbf21('0x2f')]){delete _0x2aaf65[_0xbf21('0x2f')];}_0x1abf2d[_0xbf21('0x1d')](_0xd799c7)[_0xbf21('0x30')](_0x2aaf65);};}exports[_0xbf21('0x31')]=function(_0x456159,_0x2df7af){var _0x581e8c={},_0x336854={},_0x2b038c={'count':0x0,'rows':[]};var _0x57bbe4=_[_0xbf21('0x32')](db['CmList'][_0xbf21('0x33')],function(_0xd001a4){return{'name':_0xd001a4[_0xbf21('0x34')],'type':_0xd001a4[_0xbf21('0x35')][_0xbf21('0x36')]};});_0x336854[_0xbf21('0x37')]=_[_0xbf21('0x32')](_0x57bbe4,_0xbf21('0x2f'));_0x336854[_0xbf21('0x38')]=_['keys'](_0x456159[_0xbf21('0x38')]);_0x336854[_0xbf21('0x39')]=_['intersection'](_0x336854[_0xbf21('0x37')],_0x336854['query']);_0x581e8c[_0xbf21('0x3a')]=_[_0xbf21('0x3b')](_0x336854[_0xbf21('0x37')],qs[_0xbf21('0x3c')](_0x456159['query'][_0xbf21('0x3c')]));_0x581e8c[_0xbf21('0x3a')]=_0x581e8c['attributes'][_0xbf21('0x3d')]?_0x581e8c[_0xbf21('0x3a')]:_0x336854['model'];if(!_0x456159[_0xbf21('0x38')][_0xbf21('0x3e')](_0xbf21('0x3f'))){_0x581e8c[_0xbf21('0x22')]=qs['limit'](_0x456159[_0xbf21('0x38')][_0xbf21('0x22')]);_0x581e8c[_0xbf21('0x20')]=qs[_0xbf21('0x20')](_0x456159[_0xbf21('0x38')][_0xbf21('0x20')]);}_0x581e8c[_0xbf21('0x40')]=qs['sort'](_0x456159['query'][_0xbf21('0x41')]);_0x581e8c['where']=qs[_0xbf21('0x39')](_[_0xbf21('0x42')](_0x456159[_0xbf21('0x38')],_0x336854[_0xbf21('0x39')]),_0x57bbe4);if(_0x456159['query'][_0xbf21('0x43')]){_0x581e8c[_0xbf21('0x44')]=_[_0xbf21('0x45')](_0x581e8c[_0xbf21('0x44')],{'$or':_[_0xbf21('0x32')](_0x57bbe4,function(_0x1a5382){if(_0x1a5382['type']!=='VIRTUAL'){var _0x460ad8={};_0x460ad8[_0x1a5382[_0xbf21('0x2f')]]={'$like':'%'+_0x456159[_0xbf21('0x38')][_0xbf21('0x43')]+'%'};return _0x460ad8;}})});}_0x581e8c=_['merge']({},_0x581e8c,_0x456159[_0xbf21('0x46')]);var _0x3065e8={'where':_0x581e8c[_0xbf21('0x44')]};return db['CmList'][_0xbf21('0x23')](_0x3065e8)['then'](function(_0x7f2cf9){_0x2b038c[_0xbf21('0x23')]=_0x7f2cf9;if(_0x456159[_0xbf21('0x38')]['includeAll']){_0x581e8c['include']=[{'all':!![]}];}return db['CmList'][_0xbf21('0x47')](_0x581e8c);})[_0xbf21('0x2a')](function(_0x1a5d30){_0x2b038c[_0xbf21('0x48')]=_0x1a5d30;return _0x2b038c;})['then'](respondWithFilteredResult(_0x2df7af,_0x581e8c))[_0xbf21('0x49')](handleError(_0x2df7af,null));};exports['show']=function(_0x2a985c,_0x9d9ee4){var _0x63cd0={'raw':![],'where':{'id':_0x2a985c['params']['id']}},_0x343fb2={};_0x343fb2[_0xbf21('0x37')]=_['keys'](db[_0xbf21('0x4a')][_0xbf21('0x33')]);_0x343fb2['query']=_[_0xbf21('0x4b')](_0x2a985c['query']);_0x343fb2['filters']=_['intersection'](_0x343fb2[_0xbf21('0x37')],_0x343fb2[_0xbf21('0x38')]);_0x63cd0[_0xbf21('0x3a')]=_[_0xbf21('0x3b')](_0x343fb2[_0xbf21('0x37')],qs[_0xbf21('0x3c')](_0x2a985c['query'][_0xbf21('0x3c')]));_0x63cd0['attributes']=_0x63cd0[_0xbf21('0x3a')][_0xbf21('0x3d')]?_0x63cd0[_0xbf21('0x3a')]:_0x343fb2[_0xbf21('0x37')];if(_0x2a985c[_0xbf21('0x38')][_0xbf21('0x4c')]){_0x63cd0[_0xbf21('0x4d')]=[{'all':!![]}];}_0x63cd0=_[_0xbf21('0x45')]({},_0x63cd0,_0x2a985c[_0xbf21('0x46')]);return db['CmList'][_0xbf21('0x4e')](_0x63cd0)[_0xbf21('0x2a')](handleEntityNotFound(_0x9d9ee4,null))[_0xbf21('0x2a')](respondWithResult(_0x9d9ee4,null))['catch'](handleError(_0x9d9ee4,null));};exports[_0xbf21('0x4f')]=function(_0x5cf3aa,_0x35f78e){return db[_0xbf21('0x4a')][_0xbf21('0x4f')](_0x5cf3aa[_0xbf21('0x50')],{})[_0xbf21('0x2a')](function(_0x1b8dad){var _0x3c88eb=_0x5cf3aa[_0xbf21('0x51')][_0xbf21('0x2c')]({'plain':!![]});if(!_0x3c88eb)throw new Error(_0xbf21('0x52'));if(_0x3c88eb['role']===_0xbf21('0x51')){var _0x55990e=_0x1b8dad[_0xbf21('0x2c')]({'plain':!![]});var _0x5a6270=_0xbf21('0x53');return db[_0xbf21('0x54')][_0xbf21('0x4e')]({'where':{'name':_0x5a6270,'userProfileId':_0x3c88eb[_0xbf21('0x55')]},'raw':!![]})[_0xbf21('0x2a')](function(_0x284141){if(_0x284141&&_0x284141[_0xbf21('0x56')]===0x0){return db[_0xbf21('0x57')][_0xbf21('0x4f')]({'name':_0x55990e[_0xbf21('0x2f')],'resourceId':_0x55990e['id'],'type':_0x284141[_0xbf21('0x2f')],'sectionId':_0x284141['id']},{})[_0xbf21('0x2a')](function(){return _0x1b8dad;});}else{return _0x1b8dad;}})[_0xbf21('0x49')](function(_0x4122b1){logger['error'](_0xbf21('0x58'),_0x4122b1);throw _0x4122b1;});}return _0x1b8dad;})[_0xbf21('0x2a')](respondWithResult(_0x35f78e,0xc9))[_0xbf21('0x49')](handleError(_0x35f78e,null));};exports[_0xbf21('0x29')]=function(_0x37177a,_0x747da0){if(_0x37177a[_0xbf21('0x50')]['id']){delete _0x37177a[_0xbf21('0x50')]['id'];}return db['CmList']['find']({'where':{'id':_0x37177a[_0xbf21('0x59')]['id']}})[_0xbf21('0x2a')](handleEntityNotFound(_0x747da0,null))[_0xbf21('0x2a')](saveUpdates(_0x37177a[_0xbf21('0x50')],null))['then'](respondWithResult(_0x747da0,null))[_0xbf21('0x49')](handleError(_0x747da0,null));};exports[_0xbf21('0x2b')]=function(_0x304f57,_0xd7086a){return db[_0xbf21('0x4a')][_0xbf21('0x4e')]({'where':{'id':_0x304f57[_0xbf21('0x59')]['id']}})[_0xbf21('0x2a')](handleEntityNotFound(_0xd7086a,null))[_0xbf21('0x2a')](removeEntity(_0xd7086a,null))[_0xbf21('0x49')](handleError(_0xd7086a,null));};exports[_0xbf21('0x5a')]=function(_0xe249d2,_0x2e6bec){return db[_0xbf21('0x4a')][_0xbf21('0x5a')]()['then'](respondWithResult(_0x2e6bec,null))[_0xbf21('0x49')](handleError(_0x2e6bec,null));};exports['addDisposition']=function(_0x296be5,_0x310fd3,_0xb6fc47){if(_0x296be5[_0xbf21('0x50')]['id']){delete _0x296be5[_0xbf21('0x50')]['id'];}return db['CmList'][_0xbf21('0x4e')]({'where':{'id':_0x296be5[_0xbf21('0x59')]['id']}})[_0xbf21('0x2a')](handleEntityNotFound(_0x310fd3,null))[_0xbf21('0x2a')](function(_0x44ddb9){if(_0x44ddb9){_0x296be5[_0xbf21('0x50')][_0xbf21('0x5b')]=_0x44ddb9['id'];return db[_0xbf21('0x5c')][_0xbf21('0x4f')](_0x296be5[_0xbf21('0x50')]);}})[_0xbf21('0x2a')](respondWithResult(_0x310fd3,null))['catch'](handleError(_0x310fd3,null));};exports['getDispositions']=function(_0xb6952c,_0x560bac,_0x4db3d6){var _0xc5f0c7={'raw':![],'where':{}};var _0x44ef93={};var _0x3f3008={'count':0x0,'rows':[]};return db[_0xbf21('0x4a')][_0xbf21('0x5d')]({'where':{'id':_0xb6952c[_0xbf21('0x59')]['id']}})[_0xbf21('0x2a')](handleEntityNotFound(_0x560bac,null))[_0xbf21('0x2a')](function(_0x5c165d){if(_0x5c165d){_0x44ef93[_0xbf21('0x37')]=_[_0xbf21('0x4b')](db['Disposition']['rawAttributes']);_0x44ef93['query']=_[_0xbf21('0x4b')](_0xb6952c[_0xbf21('0x38')]);_0x44ef93[_0xbf21('0x39')]=_[_0xbf21('0x3b')](_0x44ef93[_0xbf21('0x37')],_0x44ef93[_0xbf21('0x38')]);_0xc5f0c7[_0xbf21('0x3a')]=_[_0xbf21('0x3b')](_0x44ef93[_0xbf21('0x37')],qs[_0xbf21('0x3c')](_0xb6952c[_0xbf21('0x38')][_0xbf21('0x3c')]));_0xc5f0c7[_0xbf21('0x3a')]=_0xc5f0c7[_0xbf21('0x3a')][_0xbf21('0x3d')]?_0xc5f0c7[_0xbf21('0x3a')]:_0x44ef93['model'];if(!_0xb6952c[_0xbf21('0x38')]['hasOwnProperty']('nolimit')){_0xc5f0c7[_0xbf21('0x22')]=qs[_0xbf21('0x22')](_0xb6952c[_0xbf21('0x38')][_0xbf21('0x22')]);_0xc5f0c7[_0xbf21('0x20')]=qs[_0xbf21('0x20')](_0xb6952c[_0xbf21('0x38')][_0xbf21('0x20')]);}_0xc5f0c7['order']=qs[_0xbf21('0x41')](_0xb6952c[_0xbf21('0x38')][_0xbf21('0x41')]);_0xc5f0c7[_0xbf21('0x44')]=qs[_0xbf21('0x39')](_['pick'](_0xb6952c['query'],_0x44ef93[_0xbf21('0x39')]));_0xc5f0c7[_0xbf21('0x44')][_0xbf21('0x5b')]=_0x5c165d['id'];if(_0xb6952c[_0xbf21('0x38')][_0xbf21('0x43')]){_0xc5f0c7[_0xbf21('0x44')]=_[_0xbf21('0x45')](_0xc5f0c7[_0xbf21('0x44')],{'$or':_[_0xbf21('0x32')](_0xc5f0c7[_0xbf21('0x3a')],function(_0x54942e){var _0x2a3409={};_0x2a3409[_0x54942e]={'$like':'%'+_0xb6952c[_0xbf21('0x38')]['filter']+'%'};return _0x2a3409;})});}_0xc5f0c7=_['merge']({},_0xc5f0c7,_0xb6952c['options']);return db[_0xbf21('0x5c')]['count']({'where':_0xc5f0c7[_0xbf21('0x44')]})[_0xbf21('0x2a')](function(_0x8dc7ce){_0x3f3008[_0xbf21('0x23')]=_0x8dc7ce;if(_0xb6952c[_0xbf21('0x38')]['includeAll']){_0xc5f0c7[_0xbf21('0x4d')]=[{'all':!![]}];}return db[_0xbf21('0x5c')][_0xbf21('0x47')](_0xc5f0c7);})['then'](function(_0x1c2cc6){_0x3f3008[_0xbf21('0x48')]=_0x1c2cc6;return _0x3f3008;});}})[_0xbf21('0x2a')](respondWithFilteredResult(_0x560bac,_0xc5f0c7))[_0xbf21('0x49')](handleError(_0x560bac,null));};exports[_0xbf21('0x5e')]=function(_0x51b729,_0x222383,_0x3be9ee){return db[_0xbf21('0x4a')]['find']({'where':{'id':_0x51b729['params']['id']}})[_0xbf21('0x2a')](handleEntityNotFound(_0x222383,null))['then'](function(_0x540bef){if(_0x540bef){return _0x540bef[_0xbf21('0x5e')](_0x51b729[_0xbf21('0x38')][_0xbf21('0x5f')]);}})[_0xbf21('0x2a')](respondWithStatusCode(_0x222383,null))[_0xbf21('0x49')](handleError(_0x222383,null));};exports[_0xbf21('0x60')]=function(_0x592465,_0x1facb8,_0x2f37eb){return db[_0xbf21('0x4a')][_0xbf21('0x4e')]({'where':{'id':_0x592465['params']['id']}})[_0xbf21('0x2a')](handleEntityNotFound(_0x1facb8,null))[_0xbf21('0x2a')](function(_0x279637){if(_0x279637){var _0x124cfe=[];var _0x2058cc={'success':[],'errors':[]};return db[_0xbf21('0x61')]['describe']()[_0xbf21('0x2a')](function(_0x117c8e){if(_0x592465[_0xbf21('0x50')][_0xbf21('0x62')]&&_[_0xbf21('0x63')](_0x592465[_0xbf21('0x50')][_0xbf21('0x62')])){if(_0x592465['body'][_0xbf21('0x62')][_0xbf21('0x3d')]){_0x592465[_0xbf21('0x50')][_0xbf21('0x62')]=_0x592465[_0xbf21('0x50')][_0xbf21('0x62')][_0xbf21('0x64')](';')+';';}else{_0x592465[_0xbf21('0x50')]['tags']=null;}}else{_0x592465[_0xbf21('0x50')][_0xbf21('0x62')]=null;}if(_0x592465[_0xbf21('0x50')]&&_[_0xbf21('0x63')](_0x592465[_0xbf21('0x50')])){for(var _0x361ea1=0x0;_0x361ea1<_0x592465[_0xbf21('0x50')][_0xbf21('0x3d')];_0x361ea1+=0x1){_0x592465[_0xbf21('0x50')][_0x361ea1]['ListId']=_0x592465[_0xbf21('0x59')]['id'];_0x124cfe[_0xbf21('0x65')](_0x592465['body'][_0x361ea1]);}return BPromise['each'](_0x124cfe,function(_0x199f64){return db[_0xbf21('0x61')][_0xbf21('0x4f')](_[_0xbf21('0x66')](_0x199f64,[_0xbf21('0x5f'),'id'])||{},{'fields':_[_0xbf21('0x4b')](_0x117c8e),'raw':!![]})[_0xbf21('0x2a')](function(_0x2890fb){_0x2058cc[_0xbf21('0x67')][_0xbf21('0x65')](_0x2890fb[_0xbf21('0x68')]);})[_0xbf21('0x49')](function(_0x4a1fbf){_0x2058cc['errors'][_0xbf21('0x65')]({'data':_0x199f64,'error':_0x4a1fbf[_0xbf21('0x69')]});});})[_0xbf21('0x2a')](function(_0xf63364){return _0x2058cc;})['catch'](function(_0x4f0111){return _0x4f0111;});}else{_0x1facb8[_0xbf21('0x1d')](0x190)['json']({'message':_0xbf21('0x6a')});}});}})[_0xbf21('0x2a')](respondWithResult(_0x1facb8,null))[_0xbf21('0x49')](handleError(_0x1facb8,null));};exports['getContacts']=function(_0xd79f82,_0x1465f5,_0x4b1adb){var _0x56c650;return db[_0xbf21('0x4a')][_0xbf21('0x4e')]({'where':{'id':_0xd79f82[_0xbf21('0x59')]['id']},'include':[{'model':db[_0xbf21('0x6b')],'as':_0xbf21('0x6c')}]})[_0xbf21('0x2a')](handleEntityNotFound(_0x1465f5,null))[_0xbf21('0x2a')](function(_0x552942){if(_0x552942){_0x56c650=_0x552942;return db[_0xbf21('0x61')][_0xbf21('0x33')];}})[_0xbf21('0x2a')](function(_0x58abe6){if(_0x58abe6){var _0x1f930e={};var _0x168149={};_0x168149['model']=_['concat'](_[_0xbf21('0x4b')](_0x58abe6),_['map'](_0x56c650[_0xbf21('0x6c')],function(_0x2762f8){return util[_0xbf21('0x6d')]('cf_%d',_0x2762f8['id']);}));_0x168149[_0xbf21('0x38')]=_['keys'](_0xd79f82[_0xbf21('0x38')]);_0x168149[_0xbf21('0x39')]=_['intersection'](_0x168149[_0xbf21('0x37')],_0x168149[_0xbf21('0x38')]);_0x1f930e[_0xbf21('0x3a')]=_['intersection'](_0x168149[_0xbf21('0x37')],qs[_0xbf21('0x3c')](_0xd79f82[_0xbf21('0x38')]['fields']));_0x1f930e['attributes']=_0x1f930e[_0xbf21('0x3a')][_0xbf21('0x3d')]?_0x1f930e['attributes']:_0x168149[_0xbf21('0x37')];if(!_0xd79f82[_0xbf21('0x38')][_0xbf21('0x3e')]('nolimit')){_0x1f930e[_0xbf21('0x22')]=qs[_0xbf21('0x22')](_0xd79f82[_0xbf21('0x38')]['limit']);_0x1f930e['offset']=qs[_0xbf21('0x20')](_0xd79f82[_0xbf21('0x38')][_0xbf21('0x20')]);}_0x1f930e[_0xbf21('0x40')]=qs[_0xbf21('0x41')](_0xd79f82[_0xbf21('0x38')][_0xbf21('0x41')]);_0x1f930e[_0xbf21('0x44')]=qs['filters'](_['pick'](_0xd79f82['query'],_0x168149[_0xbf21('0x39')]));_0x1f930e[_0xbf21('0x6e')]=!![];if(_0xd79f82[_0xbf21('0x38')]['filter']){_0x1f930e['where']=_['merge'](_0x1f930e['where'],{'$or':_['map'](_0x1f930e[_0xbf21('0x3a')],function(_0x59feca){var _0x2c1e74={};_0x2c1e74[_0x59feca]={'$like':'%'+_0xd79f82[_0xbf21('0x38')][_0xbf21('0x43')]+'%'};return _0x2c1e74;})});}_0x1f930e=_[_0xbf21('0x45')]({},_0x1f930e,_0xd79f82[_0xbf21('0x46')]);return _0x56c650['getContacts'](_0x1f930e);}})[_0xbf21('0x2a')](respondWithResult(_0x1465f5,null))[_0xbf21('0x49')](handleError(_0x1465f5,null));};exports['getContactsCsv']=function(_0x5f66f6,_0x1d694e,_0x19ecf3){var _0x438e76;var _0x242167;var _0x456dc7;var _0x1a6cda=_0x5f66f6['params']['id'];csv_results=[];return db[_0xbf21('0x6f')][_0xbf21('0x47')]({'attributes':['id','name'],'raw':!![],'order':[_0xbf21('0x70')]})[_0xbf21('0x2a')](function(_0x138f9e){_0x438e76=_0x138f9e;var _0x1eee31=_[_0xbf21('0x4b')](db[_0xbf21('0x61')][_0xbf21('0x33')]);return db[_0xbf21('0x6b')][_0xbf21('0x47')]({'raw':!![],'attributes':['id',_0xbf21('0x71')]})[_0xbf21('0x2a')](function(_0x3faec3){_0x242167=_0x3faec3;var _0x51ba94=squel[_0xbf21('0x72')]()[_0xbf21('0x3c')](_0x1eee31)['from']('cm_contacts','c')[_0xbf21('0x44')](_0xbf21('0x73'),_0x1a6cda)[_0xbf21('0x44')](_0xbf21('0x74'))[_0xbf21('0x75')]();for(var _0x151097=0x0;_0x151097<_0x242167[_0xbf21('0x3d')];_0x151097++){_0x51ba94[_0xbf21('0x76')](_0xbf21('0x77')+_0x242167[_0x151097]['id'],_0xbf21('0x78')+_0x242167[_0x151097]['alias']);}for(var _0x151097=0x0;_0x151097<_0x438e76[_0xbf21('0x3d')];_0x151097++){_0x51ba94[_0xbf21('0x76')](squel['select']()['field'](_0xbf21('0x79'))[_0xbf21('0x7a')](_0xbf21('0x7b'))['where']('ItemTypeId\x20=\x20?',_0x438e76[_0x151097]['id'])[_0xbf21('0x44')](_0xbf21('0x7c')),_0xbf21('0x7d')+_0x438e76[_0x151097]['name']);_0x51ba94[_0xbf21('0x76')](squel[_0xbf21('0x72')]()[_0xbf21('0x76')](_0xbf21('0x7e'))[_0xbf21('0x7a')](_0xbf21('0x7b'))[_0xbf21('0x44')](_0xbf21('0x7f'),_0x438e76[_0x151097]['id'])[_0xbf21('0x44')](_0xbf21('0x7c')),_0xbf21('0x80')+_0x438e76[_0x151097]['name']);}var _0x3b9e2e=[];_0x3b9e2e[_0xbf21('0x65')](_0x51ba94[_0xbf21('0x81')]());BPromise[_0xbf21('0x82')](_0x3b9e2e,handleQuery)['then'](function(_0x1dfaf9){handleQuery(_0x51ba94['toString']());var _0x742bbc=csv_results[0x0];if(!_['isEmpty'](_0x742bbc)){var _0x2cc4e0=toCsv(_0x742bbc);var _0xa45061=Date[_0xbf21('0x83')]();fs['writeFileSync'](util[_0xbf21('0x6d')](_0xbf21('0x84'),_0x1a6cda,_0xa45061),_0x2cc4e0);_0x1d694e['setHeader'](_0xbf21('0x85'),'attachment;\x20filename='+util[_0xbf21('0x6d')](_0xbf21('0x86'),_0x1a6cda,_0xa45061));_0x1d694e[_0xbf21('0x87')]('Content-type','text/csv');return _0x1d694e['download'](util[_0xbf21('0x6d')](_0xbf21('0x84'),_0x1a6cda,_0xa45061));}else{return _0x1d694e[_0xbf21('0x88')](0xcc);}});});});};exports[_0xbf21('0x89')]=function(_0x20a4cc,_0x4ad497,_0x110136){var _0x1d9395;delete _0x20a4cc[_0xbf21('0x50')]['id'];return db[_0xbf21('0x4a')][_0xbf21('0x5d')]({'where':{'id':_0x20a4cc[_0xbf21('0x59')]['id']}})[_0xbf21('0x2a')](handleEntityNotFound(_0x4ad497,null))['then'](function(_0x505d9d){if(_0x505d9d){return db[_0xbf21('0x8a')][_0xbf21('0x8b')](function(_0x13a5d4){return db[_0xbf21('0x6b')][_0xbf21('0x4f')](_0x20a4cc[_0xbf21('0x50')],{'transaction':_0x13a5d4})['then'](function(_0x383c71){_0x1d9395=_0x383c71;return _0x505d9d['addCustomFields'](_0x383c71,{'transaction':_0x13a5d4});})[_0xbf21('0x2a')](function(){var _0x1e4aa3={'type':db[_0xbf21('0x8c')][_0xbf21('0x8d')],'transaction':_0x13a5d4};switch(_0x20a4cc[_0xbf21('0x50')][_0xbf21('0x35')]){case'text':_0x1e4aa3[_0xbf21('0x35')]=db[_0xbf21('0x8c')]['TEXT'];break;case _0xbf21('0x8e'):_0x1e4aa3[_0xbf21('0x35')]=db[_0xbf21('0x8c')][_0xbf21('0x8f')];break;case'switch':_0x1e4aa3[_0xbf21('0x35')]=db[_0xbf21('0x8c')][_0xbf21('0x90')];_0x1e4aa3[_0xbf21('0x91')]=![];break;default:}return db['sequelize']['queryInterface'][_0xbf21('0x92')](_0xbf21('0x93'),util['format'](_0xbf21('0x94'),_0x1d9395['id']),_0x1e4aa3);})[_0xbf21('0x2a')](function(){return _0x1d9395;});});}})['then'](respondWithResult(_0x4ad497,null))[_0xbf21('0x49')](handleError(_0x4ad497,null));};exports['getCustomFields']=function(_0x37c8f5,_0x53dbc7,_0x5afe7e){var _0x3ab708={};var _0xe4f4e0={};var _0x471bed;var _0x29c889;return db[_0xbf21('0x4a')][_0xbf21('0x5d')]({'where':{'id':_0x37c8f5['params']['id']}})[_0xbf21('0x2a')](handleEntityNotFound(_0x53dbc7,null))[_0xbf21('0x2a')](function(_0x5def00){if(_0x5def00){_0x471bed=_0x5def00;_0xe4f4e0['model']=_[_0xbf21('0x4b')](db['CmCustomField'][_0xbf21('0x33')]);_0xe4f4e0[_0xbf21('0x38')]=_[_0xbf21('0x4b')](_0x37c8f5['query']);_0xe4f4e0[_0xbf21('0x39')]=_['intersection'](_0xe4f4e0['model'],_0xe4f4e0[_0xbf21('0x38')]);_0x3ab708['attributes']=_[_0xbf21('0x3b')](_0xe4f4e0[_0xbf21('0x37')],qs[_0xbf21('0x3c')](_0x37c8f5[_0xbf21('0x38')][_0xbf21('0x3c')]));_0x3ab708[_0xbf21('0x3a')]=_0x3ab708[_0xbf21('0x3a')][_0xbf21('0x3d')]?_0x3ab708[_0xbf21('0x3a')]:_0xe4f4e0[_0xbf21('0x37')];_0x3ab708[_0xbf21('0x40')]=qs[_0xbf21('0x41')](_0x37c8f5[_0xbf21('0x38')][_0xbf21('0x41')]);_0x3ab708[_0xbf21('0x44')]=qs[_0xbf21('0x39')](_[_0xbf21('0x42')](_0x37c8f5[_0xbf21('0x38')],_0xe4f4e0[_0xbf21('0x39')]));_0x3ab708[_0xbf21('0x44')]=_[_0xbf21('0x45')](_0x3ab708['where'],{'$or':[{'ListId':_0x5def00['id']},{'ListId':null}]});if(_0x37c8f5[_0xbf21('0x38')]['filter']){_0x3ab708[_0xbf21('0x44')]=_['merge'](_0x3ab708[_0xbf21('0x44')],{'$or':_[_0xbf21('0x32')](_0x3ab708['attributes'],function(_0x14ade3){var _0x321d06={};_0x321d06[_0x14ade3]={'$like':'%'+_0x37c8f5['query'][_0xbf21('0x43')]+'%'};return _0x321d06;})});}_0x3ab708=_[_0xbf21('0x45')]({},_0x3ab708,_0x37c8f5[_0xbf21('0x46')]);return db[_0xbf21('0x6b')][_0xbf21('0x95')](_0x3ab708);}})['then'](respondWithResult(_0x53dbc7,null))['catch'](handleError(_0x53dbc7,null));};exports[_0xbf21('0x96')]=function(_0x2b1984,_0x154eae){return db[_0xbf21('0x6b')][_0xbf21('0x95')]({'where':{'ListId':null}})['then'](handleEntityNotFound(_0x154eae,null))[_0xbf21('0x2a')](function(_0x1cd3d6){return _0x1cd3d6;})[_0xbf21('0x2a')](respondWithResult(_0x154eae,null))[_0xbf21('0x49')](handleError(_0x154eae,null));};exports[_0xbf21('0x97')]=function(_0x572be0,_0xb973e,_0x19d273){return db['CmList'][_0xbf21('0x4e')]({'where':{'id':_0x572be0['params']['id']}})[_0xbf21('0x2a')](handleEntityNotFound(_0xb973e,null))[_0xbf21('0x2a')](function(_0x365b58){if(_0x365b58){return _0x365b58[_0xbf21('0x97')](_0x572be0['body'][_0xbf21('0x5f')],_[_0xbf21('0x66')](_0x572be0[_0xbf21('0x50')],[_0xbf21('0x5f'),'id'])||{})['spread'](function(_0x17fd31){for(var _0x1dd649=0x0;_0x1dd649<_0x572be0[_0xbf21('0x50')][_0xbf21('0x5f')][_0xbf21('0x3d')];_0x1dd649+=0x1){socket[_0xbf21('0x98')](_0xbf21('0x99'),{'UserId':Number(_0x572be0['body'][_0xbf21('0x5f')][_0x1dd649]),'CmListId':Number(_0x572be0[_0xbf21('0x59')]['id'])});}return _0x17fd31;});}})[_0xbf21('0x2a')](respondWithResult(_0xb973e,null))['catch'](handleError(_0xb973e,null));};exports['removeAgents']=function(_0xa7f4fe,_0x23c122,_0x397005){return db[_0xbf21('0x4a')][_0xbf21('0x4e')]({'where':{'id':_0xa7f4fe['params']['id']}})[_0xbf21('0x2a')](handleEntityNotFound(_0x23c122,null))[_0xbf21('0x2a')](function(_0x1327a9){if(_0x1327a9){return _0x1327a9[_0xbf21('0x9a')](_0xa7f4fe[_0xbf21('0x38')]['ids'])[_0xbf21('0x2a')](function(){if(_[_0xbf21('0x63')](_0xa7f4fe[_0xbf21('0x38')]['ids'])){for(var _0x4d7aef=0x0;_0x4d7aef<_0xa7f4fe[_0xbf21('0x38')][_0xbf21('0x5f')][_0xbf21('0x3d')];_0x4d7aef+=0x1){socket[_0xbf21('0x98')](_0xbf21('0x9b'),{'UserId':Number(_0xa7f4fe[_0xbf21('0x38')]['ids'][_0x4d7aef]),'CmListId':Number(_0xa7f4fe['params']['id'])});}}else{socket['emit'](_0xbf21('0x9b'),{'UserId':Number(_0xa7f4fe[_0xbf21('0x38')][_0xbf21('0x5f')]),'CmListId':Number(_0xa7f4fe[_0xbf21('0x59')]['id'])});}});}})[_0xbf21('0x2a')](respondWithStatusCode(_0x23c122,null))[_0xbf21('0x49')](handleError(_0x23c122,null));};exports['getAgents']=function(_0x4743e6,_0x11a209,_0xa0464a){var _0x3eee55={};var _0xc0c6ce={};var _0x45de63;var _0x5da170;return db[_0xbf21('0x4a')]['findOne']({'where':{'id':_0x4743e6[_0xbf21('0x59')]['id']}})[_0xbf21('0x2a')](handleEntityNotFound(_0x11a209,null))[_0xbf21('0x2a')](function(_0x284c37){if(_0x284c37){_0x45de63=_0x284c37;_0xc0c6ce[_0xbf21('0x37')]=_['keys'](db[_0xbf21('0x9c')][_0xbf21('0x33')]);_0xc0c6ce[_0xbf21('0x38')]=_[_0xbf21('0x4b')](_0x4743e6[_0xbf21('0x38')]);_0xc0c6ce['filters']=_[_0xbf21('0x3b')](_0xc0c6ce[_0xbf21('0x37')],_0xc0c6ce[_0xbf21('0x38')]);_0x3eee55[_0xbf21('0x3a')]=_[_0xbf21('0x3b')](_0xc0c6ce[_0xbf21('0x37')],qs[_0xbf21('0x3c')](_0x4743e6[_0xbf21('0x38')][_0xbf21('0x3c')]));_0x3eee55[_0xbf21('0x3a')]=_0x3eee55[_0xbf21('0x3a')][_0xbf21('0x3d')]?_0x3eee55[_0xbf21('0x3a')]:_0xc0c6ce['model'];_0x3eee55[_0xbf21('0x40')]=qs[_0xbf21('0x41')](_0x4743e6[_0xbf21('0x38')][_0xbf21('0x41')]);_0x3eee55[_0xbf21('0x44')]=qs[_0xbf21('0x39')](_[_0xbf21('0x42')](_0x4743e6[_0xbf21('0x38')],_0xc0c6ce[_0xbf21('0x39')]));if(_0x4743e6['query'][_0xbf21('0x43')]){_0x3eee55[_0xbf21('0x44')]=_[_0xbf21('0x45')](_0x3eee55['where'],{'$or':_[_0xbf21('0x32')](_0x3eee55[_0xbf21('0x3a')],function(_0x4b421d){var _0x3e5a74={};_0x3e5a74[_0x4b421d]={'$like':'%'+_0x4743e6[_0xbf21('0x38')][_0xbf21('0x43')]+'%'};return _0x3e5a74;})});}_0x3eee55=_[_0xbf21('0x45')]({},_0x3eee55,_0x4743e6[_0xbf21('0x46')]);return _0x45de63[_0xbf21('0x9d')](_0x3eee55);}})['then'](function(_0x1f2d5d){if(_0x1f2d5d){_0x5da170=_0x1f2d5d['length'];if(!_0x4743e6['query']['hasOwnProperty'](_0xbf21('0x3f'))){_0x3eee55[_0xbf21('0x22')]=qs[_0xbf21('0x22')](_0x4743e6[_0xbf21('0x38')][_0xbf21('0x22')]);_0x3eee55[_0xbf21('0x20')]=qs[_0xbf21('0x20')](_0x4743e6['query'][_0xbf21('0x20')]);}return _0x45de63[_0xbf21('0x9d')](_0x3eee55);}})[_0xbf21('0x2a')](function(_0x1c1c8f){if(_0x1c1c8f){return _0x1c1c8f?{'count':_0x5da170,'rows':_0x1c1c8f}:null;}})['then'](respondWithResult(_0x11a209,null))[_0xbf21('0x49')](handleError(_0x11a209,null));};function handleQuery(_0x4a8903){logger[_0xbf21('0x9e')](_0x4a8903);return db[_0xbf21('0x8a')]['query'](_0x4a8903)[_0xbf21('0x9f')](function(_0x33d0bd){csv_results[_0xbf21('0x65')](_0x33d0bd);})[_0xbf21('0x49')](function(_0x370478){logger[_0xbf21('0x2d')](_0x370478['message']);});} \ No newline at end of file +var _0x934f=['additionalPhone_','description','CmContactId\x20=\x20c.id','description_additionalPhone_','toString','format','/tmp/list_%d_%s.csv','setHeader','Content-disposition','text/csv','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','number','INTEGER','defaultValue','addColumn','cm_contacts','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','spread','emit','removeAgents','userCmList:remove','getAgents','info','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','ejs','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','../../config/license/util','redis','defaults','./cmList.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','get','end','error','stack','name','index','map','CmList','fieldName','type','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','findAll','rows','show','params','keys','rawAttributes','fields','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Lists','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','destroy','describe','ListId','Disposition','findOne','include','ids','addContacts','tags','join','isArray','push','each','CmContact','omit','success','dataValues','message','Malformed\x20request\x20syntax','CmCustomField','CustomFields','cf_%d','raw','getContactsCsv','OrderBy','alias','select','from','field','c.cf_','customField_','item','cm_contact_has_items','ItemTypeId\x20=\x20?'];(function(_0x48261b,_0xea7b92){var _0xbe8b07=function(_0x1e8486){while(--_0x1e8486){_0x48261b['push'](_0x48261b['shift']());}};_0xbe8b07(++_0xea7b92);}(_0x934f,0x152));var _0xf934=function(_0x2577f7,_0x4e4781){_0x2577f7=_0x2577f7-0x0;var _0x55d372=_0x934f[_0x2577f7];return _0x55d372;};'use strict';var emlformat=require(_0xf934('0x0'));var rimraf=require(_0xf934('0x1'));var zipdir=require(_0xf934('0x2'));var jsonpatch=require(_0xf934('0x3'));var rp=require(_0xf934('0x4'));var moment=require(_0xf934('0x5'));var BPromise=require(_0xf934('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf934('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf934('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf934('0x9'));var crypto=require('crypto');var jsforce=require(_0xf934('0xa'));var deskjs=require(_0xf934('0xb'));var toCsv=require(_0xf934('0xc'));var querystring=require(_0xf934('0xd'));var Papa=require(_0xf934('0xe'));var Redis=require(_0xf934('0xf'));var authService=require(_0xf934('0x10'));var qs=require(_0xf934('0x11'));var as=require(_0xf934('0x12'));var hardwareService=require(_0xf934('0x13'));var logger=require(_0xf934('0x14'))('api');var utils=require(_0xf934('0x15'));var config=require(_0xf934('0x16'));var licenseUtil=require(_0xf934('0x17'));var db=require('../../mysqldb')['db'];var csv_results;config[_0xf934('0x18')]=_[_0xf934('0x19')](config[_0xf934('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf934('0x18')]));require(_0xf934('0x1a'))[_0xf934('0x1b')](socket);function respondWithStatusCode(_0x450733,_0x576cdd){_0x576cdd=_0x576cdd||0xcc;return function(_0x952b2b){if(_0x952b2b){return _0x450733[_0xf934('0x1c')](_0x576cdd);}return _0x450733[_0xf934('0x1d')](_0x576cdd)['end']();};}function respondWithResult(_0x3e4ad4,_0x3beff4){_0x3beff4=_0x3beff4||0xc8;return function(_0x104dd0){if(_0x104dd0){return _0x3e4ad4['status'](_0x3beff4)[_0xf934('0x1e')](_0x104dd0);}};}function respondWithFilteredResult(_0x44d855,_0xa0d3cf){return function(_0x54f0a7){if(_0x54f0a7){var _0x5aa5f2=typeof _0xa0d3cf[_0xf934('0x1f')]===_0xf934('0x20')&&typeof _0xa0d3cf[_0xf934('0x21')]===_0xf934('0x20');var _0x1c9276=_0x54f0a7[_0xf934('0x22')];var _0x262877=_0x5aa5f2?0x0:_0xa0d3cf[_0xf934('0x1f')];var _0x48d487=_0x5aa5f2?_0x54f0a7[_0xf934('0x22')]:_0xa0d3cf[_0xf934('0x1f')]+_0xa0d3cf[_0xf934('0x21')];var _0x5f0739;if(_0x48d487>=_0x1c9276){_0x48d487=_0x1c9276;_0x5f0739=0xc8;}else{_0x5f0739=0xce;}_0x44d855[_0xf934('0x1d')](_0x5f0739);return _0x44d855[_0xf934('0x23')](_0xf934('0x24'),_0x262877+'-'+_0x48d487+'/'+_0x1c9276)[_0xf934('0x1e')](_0x54f0a7);}return null;};}function patchUpdates(_0x3fac02){return function(_0x43cfd1){try{jsonpatch[_0xf934('0x25')](_0x43cfd1,_0x3fac02,!![]);}catch(_0x296e1f){return BPromise[_0xf934('0x26')](_0x296e1f);}return _0x43cfd1['save']();};}function saveUpdates(_0x4daf79,_0x4c3600){return function(_0x12af6d){if(_0x12af6d){return _0x12af6d[_0xf934('0x27')](_0x4daf79)[_0xf934('0x28')](function(_0x3a1487){return _0x3a1487;});}return null;};}function removeEntity(_0x484f8d,_0x3f4165){return function(_0x1ad572){if(_0x1ad572){return _0x1ad572['destroy']()[_0xf934('0x28')](function(){var _0x5682dd=_0x1ad572[_0xf934('0x29')]({'plain':!![]});var _0x9f57f0='Lists';return db['UserProfileResource']['destroy']({'where':{'type':_0x9f57f0,'resourceId':_0x5682dd['id']}})[_0xf934('0x28')](function(){return _0x1ad572;});})['then'](function(){_0x484f8d[_0xf934('0x1d')](0xcc)[_0xf934('0x2a')]();});}};}function handleEntityNotFound(_0x58d230,_0xe3b2d8){return function(_0xd2fe25){if(!_0xd2fe25){_0x58d230[_0xf934('0x1c')](0x194);}return _0xd2fe25;};}function handleError(_0x123eb1,_0x3eeed6){_0x3eeed6=_0x3eeed6||0x1f4;return function(_0x4f2acd){logger[_0xf934('0x2b')](_0x4f2acd[_0xf934('0x2c')]);if(_0x4f2acd[_0xf934('0x2d')]){delete _0x4f2acd[_0xf934('0x2d')];}_0x123eb1[_0xf934('0x1d')](_0x3eeed6)['send'](_0x4f2acd);};}exports[_0xf934('0x2e')]=function(_0x26dd7f,_0x40033c){var _0x15dcb0={},_0x2c6f30={},_0x2bd9b9={'count':0x0,'rows':[]};var _0x3a2d5c=_[_0xf934('0x2f')](db[_0xf934('0x30')]['rawAttributes'],function(_0x19197d){return{'name':_0x19197d[_0xf934('0x31')],'type':_0x19197d[_0xf934('0x32')]['key']};});_0x2c6f30[_0xf934('0x33')]=_[_0xf934('0x2f')](_0x3a2d5c,_0xf934('0x2d'));_0x2c6f30['query']=_['keys'](_0x26dd7f[_0xf934('0x34')]);_0x2c6f30[_0xf934('0x35')]=_[_0xf934('0x36')](_0x2c6f30[_0xf934('0x33')],_0x2c6f30['query']);_0x15dcb0['attributes']=_[_0xf934('0x36')](_0x2c6f30[_0xf934('0x33')],qs['fields'](_0x26dd7f[_0xf934('0x34')]['fields']));_0x15dcb0[_0xf934('0x37')]=_0x15dcb0[_0xf934('0x37')][_0xf934('0x38')]?_0x15dcb0['attributes']:_0x2c6f30[_0xf934('0x33')];if(!_0x26dd7f[_0xf934('0x34')][_0xf934('0x39')](_0xf934('0x3a'))){_0x15dcb0['limit']=qs[_0xf934('0x21')](_0x26dd7f[_0xf934('0x34')][_0xf934('0x21')]);_0x15dcb0['offset']=qs[_0xf934('0x1f')](_0x26dd7f[_0xf934('0x34')][_0xf934('0x1f')]);}_0x15dcb0[_0xf934('0x3b')]=qs[_0xf934('0x3c')](_0x26dd7f[_0xf934('0x34')][_0xf934('0x3c')]);_0x15dcb0[_0xf934('0x3d')]=qs[_0xf934('0x35')](_[_0xf934('0x3e')](_0x26dd7f[_0xf934('0x34')],_0x2c6f30[_0xf934('0x35')]),_0x3a2d5c);if(_0x26dd7f[_0xf934('0x34')][_0xf934('0x3f')]){_0x15dcb0[_0xf934('0x3d')]=_['merge'](_0x15dcb0[_0xf934('0x3d')],{'$or':_[_0xf934('0x2f')](_0x3a2d5c,function(_0x4c8580){if(_0x4c8580[_0xf934('0x32')]!==_0xf934('0x40')){var _0x5201d2={};_0x5201d2[_0x4c8580[_0xf934('0x2d')]]={'$like':'%'+_0x26dd7f[_0xf934('0x34')][_0xf934('0x3f')]+'%'};return _0x5201d2;}})});}_0x15dcb0=_[_0xf934('0x41')]({},_0x15dcb0,_0x26dd7f['options']);var _0x32e2f1={'where':_0x15dcb0[_0xf934('0x3d')]};return db[_0xf934('0x30')][_0xf934('0x22')](_0x32e2f1)[_0xf934('0x28')](function(_0x2e6fb3){_0x2bd9b9[_0xf934('0x22')]=_0x2e6fb3;if(_0x26dd7f['query'][_0xf934('0x42')]){_0x15dcb0['include']=[{'all':!![]}];}return db[_0xf934('0x30')][_0xf934('0x43')](_0x15dcb0);})[_0xf934('0x28')](function(_0x38918f){_0x2bd9b9[_0xf934('0x44')]=_0x38918f;return _0x2bd9b9;})[_0xf934('0x28')](respondWithFilteredResult(_0x40033c,_0x15dcb0))['catch'](handleError(_0x40033c,null));};exports[_0xf934('0x45')]=function(_0x285bd3,_0x447531){var _0x51bfdc={'raw':![],'where':{'id':_0x285bd3[_0xf934('0x46')]['id']}},_0x38da63={};_0x38da63[_0xf934('0x33')]=_[_0xf934('0x47')](db[_0xf934('0x30')][_0xf934('0x48')]);_0x38da63[_0xf934('0x34')]=_['keys'](_0x285bd3[_0xf934('0x34')]);_0x38da63[_0xf934('0x35')]=_[_0xf934('0x36')](_0x38da63[_0xf934('0x33')],_0x38da63[_0xf934('0x34')]);_0x51bfdc[_0xf934('0x37')]=_['intersection'](_0x38da63['model'],qs['fields'](_0x285bd3['query'][_0xf934('0x49')]));_0x51bfdc[_0xf934('0x37')]=_0x51bfdc[_0xf934('0x37')]['length']?_0x51bfdc[_0xf934('0x37')]:_0x38da63[_0xf934('0x33')];if(_0x285bd3['query'][_0xf934('0x42')]){_0x51bfdc['include']=[{'all':!![]}];}_0x51bfdc=_[_0xf934('0x41')]({},_0x51bfdc,_0x285bd3[_0xf934('0x4a')]);return db['CmList'][_0xf934('0x4b')](_0x51bfdc)['then'](handleEntityNotFound(_0x447531,null))[_0xf934('0x28')](respondWithResult(_0x447531,null))[_0xf934('0x4c')](handleError(_0x447531,null));};exports[_0xf934('0x4d')]=function(_0x3a188f,_0x4ef24d){return db[_0xf934('0x30')][_0xf934('0x4d')](_0x3a188f[_0xf934('0x4e')],{})[_0xf934('0x28')](function(_0x347951){var _0x182c70=_0x3a188f[_0xf934('0x4f')][_0xf934('0x29')]({'plain':!![]});if(!_0x182c70)throw new Error(_0xf934('0x50'));if(_0x182c70[_0xf934('0x51')]===_0xf934('0x4f')){var _0x1d2d17=_0x347951[_0xf934('0x29')]({'plain':!![]});var _0x3e6f45=_0xf934('0x52');return db[_0xf934('0x53')][_0xf934('0x4b')]({'where':{'name':_0x3e6f45,'userProfileId':_0x182c70[_0xf934('0x54')]},'raw':!![]})['then'](function(_0xb909e9){if(_0xb909e9&&_0xb909e9[_0xf934('0x55')]===0x0){return db[_0xf934('0x56')][_0xf934('0x4d')]({'name':_0x1d2d17[_0xf934('0x2d')],'resourceId':_0x1d2d17['id'],'type':_0xb909e9['name'],'sectionId':_0xb909e9['id']},{})['then'](function(){return _0x347951;});}else{return _0x347951;}})['catch'](function(_0x766777){logger[_0xf934('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x766777);throw _0x766777;});}return _0x347951;})[_0xf934('0x28')](respondWithResult(_0x4ef24d,0xc9))[_0xf934('0x4c')](handleError(_0x4ef24d,null));};exports[_0xf934('0x27')]=function(_0x50e058,_0x4a70dd){if(_0x50e058[_0xf934('0x4e')]['id']){delete _0x50e058[_0xf934('0x4e')]['id'];}return db[_0xf934('0x30')][_0xf934('0x4b')]({'where':{'id':_0x50e058[_0xf934('0x46')]['id']}})['then'](handleEntityNotFound(_0x4a70dd,null))[_0xf934('0x28')](saveUpdates(_0x50e058[_0xf934('0x4e')],null))[_0xf934('0x28')](respondWithResult(_0x4a70dd,null))[_0xf934('0x4c')](handleError(_0x4a70dd,null));};exports[_0xf934('0x57')]=function(_0x55e8e2,_0x91b6c5){return db[_0xf934('0x30')][_0xf934('0x4b')]({'where':{'id':_0x55e8e2[_0xf934('0x46')]['id']}})[_0xf934('0x28')](handleEntityNotFound(_0x91b6c5,null))[_0xf934('0x28')](removeEntity(_0x91b6c5,null))['catch'](handleError(_0x91b6c5,null));};exports['describe']=function(_0x401c0e,_0x529318){return db[_0xf934('0x30')][_0xf934('0x58')]()[_0xf934('0x28')](respondWithResult(_0x529318,null))[_0xf934('0x4c')](handleError(_0x529318,null));};exports['addDisposition']=function(_0x19800c,_0x55aa8a,_0x2832ec){if(_0x19800c[_0xf934('0x4e')]['id']){delete _0x19800c[_0xf934('0x4e')]['id'];}return db[_0xf934('0x30')][_0xf934('0x4b')]({'where':{'id':_0x19800c[_0xf934('0x46')]['id']}})[_0xf934('0x28')](handleEntityNotFound(_0x55aa8a,null))[_0xf934('0x28')](function(_0x19c9e0){if(_0x19c9e0){_0x19800c[_0xf934('0x4e')][_0xf934('0x59')]=_0x19c9e0['id'];return db[_0xf934('0x5a')][_0xf934('0x4d')](_0x19800c[_0xf934('0x4e')]);}})[_0xf934('0x28')](respondWithResult(_0x55aa8a,null))['catch'](handleError(_0x55aa8a,null));};exports['getDispositions']=function(_0xf93013,_0x108222,_0x3582ba){var _0x3e672c={'raw':![],'where':{}};var _0x399256={};var _0xb1731f={'count':0x0,'rows':[]};return db[_0xf934('0x30')][_0xf934('0x5b')]({'where':{'id':_0xf93013[_0xf934('0x46')]['id']}})[_0xf934('0x28')](handleEntityNotFound(_0x108222,null))[_0xf934('0x28')](function(_0x401404){if(_0x401404){_0x399256['model']=_['keys'](db[_0xf934('0x5a')][_0xf934('0x48')]);_0x399256[_0xf934('0x34')]=_[_0xf934('0x47')](_0xf93013[_0xf934('0x34')]);_0x399256[_0xf934('0x35')]=_['intersection'](_0x399256[_0xf934('0x33')],_0x399256['query']);_0x3e672c[_0xf934('0x37')]=_[_0xf934('0x36')](_0x399256['model'],qs[_0xf934('0x49')](_0xf93013[_0xf934('0x34')][_0xf934('0x49')]));_0x3e672c['attributes']=_0x3e672c[_0xf934('0x37')][_0xf934('0x38')]?_0x3e672c[_0xf934('0x37')]:_0x399256[_0xf934('0x33')];if(!_0xf93013['query']['hasOwnProperty'](_0xf934('0x3a'))){_0x3e672c[_0xf934('0x21')]=qs[_0xf934('0x21')](_0xf93013[_0xf934('0x34')][_0xf934('0x21')]);_0x3e672c[_0xf934('0x1f')]=qs[_0xf934('0x1f')](_0xf93013[_0xf934('0x34')][_0xf934('0x1f')]);}_0x3e672c[_0xf934('0x3b')]=qs[_0xf934('0x3c')](_0xf93013[_0xf934('0x34')][_0xf934('0x3c')]);_0x3e672c[_0xf934('0x3d')]=qs['filters'](_['pick'](_0xf93013[_0xf934('0x34')],_0x399256[_0xf934('0x35')]));_0x3e672c[_0xf934('0x3d')]['ListId']=_0x401404['id'];if(_0xf93013[_0xf934('0x34')][_0xf934('0x3f')]){_0x3e672c[_0xf934('0x3d')]=_[_0xf934('0x41')](_0x3e672c[_0xf934('0x3d')],{'$or':_['map'](_0x3e672c[_0xf934('0x37')],function(_0x28f1d2){var _0xadd47b={};_0xadd47b[_0x28f1d2]={'$like':'%'+_0xf93013[_0xf934('0x34')][_0xf934('0x3f')]+'%'};return _0xadd47b;})});}_0x3e672c=_[_0xf934('0x41')]({},_0x3e672c,_0xf93013[_0xf934('0x4a')]);return db[_0xf934('0x5a')][_0xf934('0x22')]({'where':_0x3e672c[_0xf934('0x3d')]})['then'](function(_0x12c05c){_0xb1731f['count']=_0x12c05c;if(_0xf93013[_0xf934('0x34')]['includeAll']){_0x3e672c[_0xf934('0x5c')]=[{'all':!![]}];}return db['Disposition'][_0xf934('0x43')](_0x3e672c);})[_0xf934('0x28')](function(_0x4badc3){_0xb1731f[_0xf934('0x44')]=_0x4badc3;return _0xb1731f;});}})[_0xf934('0x28')](respondWithFilteredResult(_0x108222,_0x3e672c))[_0xf934('0x4c')](handleError(_0x108222,null));};exports['removeDispositions']=function(_0x4af400,_0x183456,_0x31b431){return db['CmList'][_0xf934('0x4b')]({'where':{'id':_0x4af400[_0xf934('0x46')]['id']}})[_0xf934('0x28')](handleEntityNotFound(_0x183456,null))[_0xf934('0x28')](function(_0x5c0db5){if(_0x5c0db5){return _0x5c0db5['removeDispositions'](_0x4af400[_0xf934('0x34')][_0xf934('0x5d')]);}})['then'](respondWithStatusCode(_0x183456,null))[_0xf934('0x4c')](handleError(_0x183456,null));};exports[_0xf934('0x5e')]=function(_0x5b4998,_0x3b2dcb,_0x57cd92){return db[_0xf934('0x30')][_0xf934('0x4b')]({'where':{'id':_0x5b4998['params']['id']}})['then'](handleEntityNotFound(_0x3b2dcb,null))[_0xf934('0x28')](function(_0x44a4ad){if(_0x44a4ad){var _0x26390b=[];var _0x2a0972={'success':[],'errors':[]};return db['CmContact'][_0xf934('0x58')]()[_0xf934('0x28')](function(_0x12085d){if(_0x5b4998['body'][_0xf934('0x5f')]&&_['isArray'](_0x5b4998['body']['tags'])){if(_0x5b4998[_0xf934('0x4e')]['tags']['length']){_0x5b4998[_0xf934('0x4e')]['tags']=_0x5b4998['body'][_0xf934('0x5f')][_0xf934('0x60')](';')+';';}else{_0x5b4998[_0xf934('0x4e')][_0xf934('0x5f')]=null;}}else{_0x5b4998[_0xf934('0x4e')][_0xf934('0x5f')]=null;}if(_0x5b4998[_0xf934('0x4e')]&&_[_0xf934('0x61')](_0x5b4998[_0xf934('0x4e')])){for(var _0x28e4cf=0x0;_0x28e4cf<_0x5b4998[_0xf934('0x4e')][_0xf934('0x38')];_0x28e4cf+=0x1){_0x5b4998[_0xf934('0x4e')][_0x28e4cf][_0xf934('0x59')]=_0x5b4998[_0xf934('0x46')]['id'];_0x26390b[_0xf934('0x62')](_0x5b4998['body'][_0x28e4cf]);}return BPromise[_0xf934('0x63')](_0x26390b,function(_0x2e0015){return db[_0xf934('0x64')]['create'](_[_0xf934('0x65')](_0x2e0015,[_0xf934('0x5d'),'id'])||{},{'fields':_[_0xf934('0x47')](_0x12085d),'raw':!![]})[_0xf934('0x28')](function(_0x900489){_0x2a0972[_0xf934('0x66')][_0xf934('0x62')](_0x900489[_0xf934('0x67')]);})[_0xf934('0x4c')](function(_0x2e1e23){_0x2a0972['errors'][_0xf934('0x62')]({'data':_0x2e0015,'error':_0x2e1e23[_0xf934('0x68')]});});})['then'](function(_0x12a6d7){return _0x2a0972;})['catch'](function(_0x3f7b74){return _0x3f7b74;});}else{_0x3b2dcb[_0xf934('0x1d')](0x190)['json']({'message':_0xf934('0x69')});}});}})[_0xf934('0x28')](respondWithResult(_0x3b2dcb,null))[_0xf934('0x4c')](handleError(_0x3b2dcb,null));};exports['getContacts']=function(_0x43b744,_0x4b61ae,_0x592515){var _0x1f981c;return db[_0xf934('0x30')][_0xf934('0x4b')]({'where':{'id':_0x43b744[_0xf934('0x46')]['id']},'include':[{'model':db[_0xf934('0x6a')],'as':'CustomFields'}]})[_0xf934('0x28')](handleEntityNotFound(_0x4b61ae,null))[_0xf934('0x28')](function(_0x2fe24f){if(_0x2fe24f){_0x1f981c=_0x2fe24f;return db[_0xf934('0x64')]['rawAttributes'];}})[_0xf934('0x28')](function(_0x5244ac){if(_0x5244ac){var _0x3b404f={};var _0x25ca27={};_0x25ca27['model']=_['concat'](_['keys'](_0x5244ac),_['map'](_0x1f981c[_0xf934('0x6b')],function(_0x26e9a8){return util['format'](_0xf934('0x6c'),_0x26e9a8['id']);}));_0x25ca27[_0xf934('0x34')]=_[_0xf934('0x47')](_0x43b744['query']);_0x25ca27[_0xf934('0x35')]=_[_0xf934('0x36')](_0x25ca27[_0xf934('0x33')],_0x25ca27[_0xf934('0x34')]);_0x3b404f[_0xf934('0x37')]=_[_0xf934('0x36')](_0x25ca27[_0xf934('0x33')],qs[_0xf934('0x49')](_0x43b744[_0xf934('0x34')]['fields']));_0x3b404f[_0xf934('0x37')]=_0x3b404f[_0xf934('0x37')][_0xf934('0x38')]?_0x3b404f[_0xf934('0x37')]:_0x25ca27[_0xf934('0x33')];if(!_0x43b744[_0xf934('0x34')][_0xf934('0x39')](_0xf934('0x3a'))){_0x3b404f[_0xf934('0x21')]=qs[_0xf934('0x21')](_0x43b744[_0xf934('0x34')][_0xf934('0x21')]);_0x3b404f[_0xf934('0x1f')]=qs[_0xf934('0x1f')](_0x43b744[_0xf934('0x34')][_0xf934('0x1f')]);}_0x3b404f[_0xf934('0x3b')]=qs[_0xf934('0x3c')](_0x43b744['query'][_0xf934('0x3c')]);_0x3b404f[_0xf934('0x3d')]=qs[_0xf934('0x35')](_[_0xf934('0x3e')](_0x43b744['query'],_0x25ca27[_0xf934('0x35')]));_0x3b404f[_0xf934('0x6d')]=!![];if(_0x43b744[_0xf934('0x34')]['filter']){_0x3b404f[_0xf934('0x3d')]=_[_0xf934('0x41')](_0x3b404f[_0xf934('0x3d')],{'$or':_[_0xf934('0x2f')](_0x3b404f[_0xf934('0x37')],function(_0xc0a905){var _0xfd986e={};_0xfd986e[_0xc0a905]={'$like':'%'+_0x43b744['query'][_0xf934('0x3f')]+'%'};return _0xfd986e;})});}_0x3b404f=_[_0xf934('0x41')]({},_0x3b404f,_0x43b744[_0xf934('0x4a')]);return _0x1f981c['getContacts'](_0x3b404f);}})[_0xf934('0x28')](respondWithResult(_0x4b61ae,null))['catch'](handleError(_0x4b61ae,null));};exports[_0xf934('0x6e')]=function(_0x2a041c,_0x4b9f16,_0x36a99b){var _0x1789e3;var _0x58d910;var _0x303eb8;var _0x281d2e=_0x2a041c[_0xf934('0x46')]['id'];csv_results=[];return db['ContactItemType'][_0xf934('0x43')]({'attributes':['id','name'],'raw':!![],'order':[_0xf934('0x6f')]})['then'](function(_0x597c63){_0x1789e3=_0x597c63;var _0x3c3e8d=_[_0xf934('0x47')](db[_0xf934('0x64')][_0xf934('0x48')]);return db[_0xf934('0x6a')][_0xf934('0x43')]({'raw':!![],'attributes':['id',_0xf934('0x70')]})[_0xf934('0x28')](function(_0x16b4d2){_0x58d910=_0x16b4d2;var _0x2542f2=squel[_0xf934('0x71')]()[_0xf934('0x49')](_0x3c3e8d)[_0xf934('0x72')]('cm_contacts','c')[_0xf934('0x3d')]('c.ListId\x20=\x20?',_0x281d2e)[_0xf934('0x3d')]('c.deletedAt\x20is\x20null')['distinct']();for(var _0x217b73=0x0;_0x217b73<_0x58d910['length'];_0x217b73++){_0x2542f2[_0xf934('0x73')](_0xf934('0x74')+_0x58d910[_0x217b73]['id'],_0xf934('0x75')+_0x58d910[_0x217b73][_0xf934('0x70')]);}for(var _0x217b73=0x0;_0x217b73<_0x1789e3[_0xf934('0x38')];_0x217b73++){_0x2542f2[_0xf934('0x73')](squel[_0xf934('0x71')]()[_0xf934('0x73')](_0xf934('0x76'))['from'](_0xf934('0x77'))['where'](_0xf934('0x78'),_0x1789e3[_0x217b73]['id'])[_0xf934('0x3d')]('CmContactId\x20=\x20c.id'),_0xf934('0x79')+_0x1789e3[_0x217b73][_0xf934('0x2d')]);_0x2542f2[_0xf934('0x73')](squel[_0xf934('0x71')]()[_0xf934('0x73')](_0xf934('0x7a'))['from'](_0xf934('0x77'))[_0xf934('0x3d')]('ItemTypeId\x20=\x20?',_0x1789e3[_0x217b73]['id'])['where'](_0xf934('0x7b')),_0xf934('0x7c')+_0x1789e3[_0x217b73][_0xf934('0x2d')]);}var _0x38d3d1=[];_0x38d3d1['push'](_0x2542f2[_0xf934('0x7d')]());BPromise[_0xf934('0x63')](_0x38d3d1,handleQuery)[_0xf934('0x28')](function(_0x472a42){handleQuery(_0x2542f2[_0xf934('0x7d')]());var _0x267fe9=csv_results[0x0];if(!_['isEmpty'](_0x267fe9)){var _0x318750=toCsv(_0x267fe9);var _0x32fd9a=Date['now']();fs['writeFileSync'](util[_0xf934('0x7e')](_0xf934('0x7f'),_0x281d2e,_0x32fd9a),_0x318750);_0x4b9f16[_0xf934('0x80')](_0xf934('0x81'),'attachment;\x20filename='+util[_0xf934('0x7e')]('list_%d_%s.csv',_0x281d2e,_0x32fd9a));_0x4b9f16['setHeader']('Content-type',_0xf934('0x82'));return _0x4b9f16['download'](util[_0xf934('0x7e')]('/tmp/list_%d_%s.csv',_0x281d2e,_0x32fd9a));}else{return _0x4b9f16[_0xf934('0x1c')](0xcc);}});});});};exports[_0xf934('0x83')]=function(_0x268456,_0x1fe55c,_0x44db18){var _0x2a750d;delete _0x268456[_0xf934('0x4e')]['id'];return db[_0xf934('0x30')][_0xf934('0x5b')]({'where':{'id':_0x268456[_0xf934('0x46')]['id']}})[_0xf934('0x28')](handleEntityNotFound(_0x1fe55c,null))[_0xf934('0x28')](function(_0x424747){if(_0x424747){return db[_0xf934('0x84')][_0xf934('0x85')](function(_0x95eaf0){return db[_0xf934('0x6a')][_0xf934('0x4d')](_0x268456['body'],{'transaction':_0x95eaf0})[_0xf934('0x28')](function(_0x62ec27){_0x2a750d=_0x62ec27;return _0x424747[_0xf934('0x86')](_0x62ec27,{'transaction':_0x95eaf0});})[_0xf934('0x28')](function(){var _0x5574f7={'type':db[_0xf934('0x87')][_0xf934('0x88')],'transaction':_0x95eaf0};switch(_0x268456[_0xf934('0x4e')][_0xf934('0x32')]){case _0xf934('0x89'):_0x5574f7[_0xf934('0x32')]=db[_0xf934('0x87')][_0xf934('0x88')];break;case _0xf934('0x8a'):_0x5574f7[_0xf934('0x32')]=db[_0xf934('0x87')][_0xf934('0x8b')];break;case'switch':_0x5574f7[_0xf934('0x32')]=db[_0xf934('0x87')]['BOOLEAN'];_0x5574f7[_0xf934('0x8c')]=![];break;default:}return db[_0xf934('0x84')]['queryInterface'][_0xf934('0x8d')](_0xf934('0x8e'),util[_0xf934('0x7e')]('cf_%s',_0x2a750d['id']),_0x5574f7);})['then'](function(){return _0x2a750d;});});}})['then'](respondWithResult(_0x1fe55c,null))[_0xf934('0x4c')](handleError(_0x1fe55c,null));};exports[_0xf934('0x8f')]=function(_0x1f3ca0,_0x176f67,_0x18f70e){var _0x16c1c8={};var _0x54a093={};var _0x2d8040;var _0x38c1ba;return db[_0xf934('0x30')][_0xf934('0x5b')]({'where':{'id':_0x1f3ca0[_0xf934('0x46')]['id']}})[_0xf934('0x28')](handleEntityNotFound(_0x176f67,null))[_0xf934('0x28')](function(_0x392d5a){if(_0x392d5a){_0x2d8040=_0x392d5a;_0x54a093[_0xf934('0x33')]=_[_0xf934('0x47')](db[_0xf934('0x6a')][_0xf934('0x48')]);_0x54a093[_0xf934('0x34')]=_[_0xf934('0x47')](_0x1f3ca0['query']);_0x54a093[_0xf934('0x35')]=_[_0xf934('0x36')](_0x54a093[_0xf934('0x33')],_0x54a093['query']);_0x16c1c8[_0xf934('0x37')]=_['intersection'](_0x54a093[_0xf934('0x33')],qs[_0xf934('0x49')](_0x1f3ca0[_0xf934('0x34')][_0xf934('0x49')]));_0x16c1c8[_0xf934('0x37')]=_0x16c1c8[_0xf934('0x37')]['length']?_0x16c1c8[_0xf934('0x37')]:_0x54a093[_0xf934('0x33')];_0x16c1c8[_0xf934('0x3b')]=qs[_0xf934('0x3c')](_0x1f3ca0[_0xf934('0x34')][_0xf934('0x3c')]);_0x16c1c8[_0xf934('0x3d')]=qs[_0xf934('0x35')](_['pick'](_0x1f3ca0[_0xf934('0x34')],_0x54a093['filters']));_0x16c1c8[_0xf934('0x3d')]=_[_0xf934('0x41')](_0x16c1c8['where'],{'$or':[{'ListId':_0x392d5a['id']},{'ListId':null}]});if(_0x1f3ca0[_0xf934('0x34')][_0xf934('0x3f')]){_0x16c1c8[_0xf934('0x3d')]=_[_0xf934('0x41')](_0x16c1c8[_0xf934('0x3d')],{'$or':_[_0xf934('0x2f')](_0x16c1c8['attributes'],function(_0x45ff19){var _0x2fcede={};_0x2fcede[_0x45ff19]={'$like':'%'+_0x1f3ca0[_0xf934('0x34')][_0xf934('0x3f')]+'%'};return _0x2fcede;})});}_0x16c1c8=_[_0xf934('0x41')]({},_0x16c1c8,_0x1f3ca0[_0xf934('0x4a')]);return db[_0xf934('0x6a')][_0xf934('0x90')](_0x16c1c8);}})[_0xf934('0x28')](respondWithResult(_0x176f67,null))[_0xf934('0x4c')](handleError(_0x176f67,null));};exports[_0xf934('0x91')]=function(_0x46cb0d,_0x4ceabc){return db[_0xf934('0x6a')][_0xf934('0x90')]({'where':{'ListId':null}})[_0xf934('0x28')](handleEntityNotFound(_0x4ceabc,null))[_0xf934('0x28')](function(_0x4e849f){return _0x4e849f;})[_0xf934('0x28')](respondWithResult(_0x4ceabc,null))['catch'](handleError(_0x4ceabc,null));};exports['addAgents']=function(_0x6b71c7,_0x39d378,_0x3a1757){return db['CmList']['find']({'where':{'id':_0x6b71c7['params']['id']}})[_0xf934('0x28')](handleEntityNotFound(_0x39d378,null))[_0xf934('0x28')](function(_0x37b1bf){if(_0x37b1bf){return _0x37b1bf[_0xf934('0x92')](_0x6b71c7[_0xf934('0x4e')][_0xf934('0x5d')],_['omit'](_0x6b71c7['body'],[_0xf934('0x5d'),'id'])||{})[_0xf934('0x93')](function(_0x43460c){for(var _0xab1912=0x0;_0xab1912<_0x6b71c7[_0xf934('0x4e')][_0xf934('0x5d')]['length'];_0xab1912+=0x1){socket[_0xf934('0x94')]('userCmList:save',{'UserId':Number(_0x6b71c7[_0xf934('0x4e')][_0xf934('0x5d')][_0xab1912]),'CmListId':Number(_0x6b71c7['params']['id'])});}return _0x43460c;});}})[_0xf934('0x28')](respondWithResult(_0x39d378,null))[_0xf934('0x4c')](handleError(_0x39d378,null));};exports[_0xf934('0x95')]=function(_0x1f7f4f,_0x590d60,_0x59fdb7){return db[_0xf934('0x30')]['find']({'where':{'id':_0x1f7f4f[_0xf934('0x46')]['id']}})[_0xf934('0x28')](handleEntityNotFound(_0x590d60,null))['then'](function(_0x2ed836){if(_0x2ed836){return _0x2ed836[_0xf934('0x95')](_0x1f7f4f['query'][_0xf934('0x5d')])[_0xf934('0x28')](function(){if(_[_0xf934('0x61')](_0x1f7f4f[_0xf934('0x34')][_0xf934('0x5d')])){for(var _0x511278=0x0;_0x511278<_0x1f7f4f[_0xf934('0x34')]['ids'][_0xf934('0x38')];_0x511278+=0x1){socket['emit'](_0xf934('0x96'),{'UserId':Number(_0x1f7f4f[_0xf934('0x34')][_0xf934('0x5d')][_0x511278]),'CmListId':Number(_0x1f7f4f['params']['id'])});}}else{socket[_0xf934('0x94')](_0xf934('0x96'),{'UserId':Number(_0x1f7f4f['query'][_0xf934('0x5d')]),'CmListId':Number(_0x1f7f4f[_0xf934('0x46')]['id'])});}});}})[_0xf934('0x28')](respondWithStatusCode(_0x590d60,null))[_0xf934('0x4c')](handleError(_0x590d60,null));};exports[_0xf934('0x97')]=function(_0x4a8031,_0xf393fa,_0x1475bb){var _0x3c62cc={};var _0x3e0065={};var _0x2cdcd5;var _0x28485f;return db['CmList'][_0xf934('0x5b')]({'where':{'id':_0x4a8031[_0xf934('0x46')]['id']}})[_0xf934('0x28')](handleEntityNotFound(_0xf393fa,null))[_0xf934('0x28')](function(_0x437559){if(_0x437559){_0x2cdcd5=_0x437559;_0x3e0065[_0xf934('0x33')]=_['keys'](db['User'][_0xf934('0x48')]);_0x3e0065['query']=_['keys'](_0x4a8031['query']);_0x3e0065['filters']=_[_0xf934('0x36')](_0x3e0065[_0xf934('0x33')],_0x3e0065[_0xf934('0x34')]);_0x3c62cc[_0xf934('0x37')]=_[_0xf934('0x36')](_0x3e0065[_0xf934('0x33')],qs['fields'](_0x4a8031[_0xf934('0x34')][_0xf934('0x49')]));_0x3c62cc['attributes']=_0x3c62cc['attributes'][_0xf934('0x38')]?_0x3c62cc[_0xf934('0x37')]:_0x3e0065[_0xf934('0x33')];_0x3c62cc[_0xf934('0x3b')]=qs['sort'](_0x4a8031[_0xf934('0x34')][_0xf934('0x3c')]);_0x3c62cc[_0xf934('0x3d')]=qs['filters'](_[_0xf934('0x3e')](_0x4a8031[_0xf934('0x34')],_0x3e0065[_0xf934('0x35')]));if(_0x4a8031[_0xf934('0x34')]['filter']){_0x3c62cc[_0xf934('0x3d')]=_['merge'](_0x3c62cc[_0xf934('0x3d')],{'$or':_[_0xf934('0x2f')](_0x3c62cc[_0xf934('0x37')],function(_0x5abdea){var _0x459345={};_0x459345[_0x5abdea]={'$like':'%'+_0x4a8031[_0xf934('0x34')][_0xf934('0x3f')]+'%'};return _0x459345;})});}_0x3c62cc=_[_0xf934('0x41')]({},_0x3c62cc,_0x4a8031['options']);return _0x2cdcd5[_0xf934('0x97')](_0x3c62cc);}})['then'](function(_0x27827c){if(_0x27827c){_0x28485f=_0x27827c[_0xf934('0x38')];if(!_0x4a8031[_0xf934('0x34')][_0xf934('0x39')](_0xf934('0x3a'))){_0x3c62cc[_0xf934('0x21')]=qs['limit'](_0x4a8031[_0xf934('0x34')][_0xf934('0x21')]);_0x3c62cc[_0xf934('0x1f')]=qs[_0xf934('0x1f')](_0x4a8031[_0xf934('0x34')][_0xf934('0x1f')]);}return _0x2cdcd5[_0xf934('0x97')](_0x3c62cc);}})['then'](function(_0x48314e){if(_0x48314e){return _0x48314e?{'count':_0x28485f,'rows':_0x48314e}:null;}})[_0xf934('0x28')](respondWithResult(_0xf393fa,null))[_0xf934('0x4c')](handleError(_0xf393fa,null));};function handleQuery(_0x22d75e){logger[_0xf934('0x98')](_0x22d75e);return db['sequelize']['query'](_0x22d75e)[_0xf934('0x93')](function(_0x5c02d9){csv_results[_0xf934('0x62')](_0x5c02d9);})[_0xf934('0x4c')](function(_0x385c02){logger['error'](_0x385c02[_0xf934('0x68')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 4506f8d..7a81c08 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 _0xe14b=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','emit'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xe14b,0x93));var _0xbe14=function(_0x3f29c3,_0x149cd4){_0x3f29c3=_0x3f29c3-0x0;var _0x3043d1=_0xe14b[_0x3f29c3];return _0x3043d1;};'use strict';var EventEmitter=require(_0xbe14('0x0'));var CmList=require(_0xbe14('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbe14('0x2'),'afterUpdate':_0xbe14('0x3'),'afterDestroy':'remove'};function emitEvent(_0x7d3665){return function(_0x5ce8fb,_0x496c04,_0x1833e3){CmListEvents[_0xbe14('0x4')](_0x7d3665+':'+_0x5ce8fb['id'],_0x5ce8fb);CmListEvents[_0xbe14('0x4')](_0x7d3665,_0x5ce8fb);_0x1833e3(null);};}for(var e in events){if(events[_0xbe14('0x5')](e)){var event=events[e];CmList[_0xbe14('0x6')](e,emitEvent(event));}}module[_0xbe14('0x7')]=CmListEvents; \ No newline at end of file +var _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x277cbd,_0x2cd973){var _0x2231ec=function(_0x2a19a8){while(--_0x2a19a8){_0x277cbd['push'](_0x277cbd['shift']());}};_0x2231ec(++_0x2cd973);}(_0x814b,0x1a2));var _0xb814=function(_0x3a081b,_0x516437){_0x3a081b=_0x3a081b-0x0;var _0xb166c4=_0x814b[_0x3a081b];return _0xb166c4;};'use strict';var EventEmitter=require(_0xb814('0x0'));var CmList=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xb814('0x3')](0x0);var events={'afterCreate':_0xb814('0x4'),'afterUpdate':_0xb814('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38c21a){return function(_0x3e1e9,_0x258866,_0x4237bc){CmListEvents[_0xb814('0x6')](_0x38c21a+':'+_0x3e1e9['id'],_0x3e1e9);CmListEvents[_0xb814('0x6')](_0x38c21a,_0x3e1e9);_0x4237bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xb814('0x7')](e,emitEvent(event));}}module[_0xb814('0x8')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 373b094..705b99e 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 _0x5ff3=['cm_lists','util','api','bluebird','request-promise','path','rimraf','./cmList.attributes','exports','define'];(function(_0x3114ed,_0x3f916e){var _0x36776b=function(_0x64e016){while(--_0x64e016){_0x3114ed['push'](_0x3114ed['shift']());}};_0x36776b(++_0x3f916e);}(_0x5ff3,0x17d));var _0x35ff=function(_0x3a6d5d,_0x212926){_0x3a6d5d=_0x3a6d5d-0x0;var _0x34d18e=_0x5ff3[_0x3a6d5d];return _0x34d18e;};'use strict';var _=require('lodash');var util=require(_0x35ff('0x0'));var logger=require('../../config/logger')(_0x35ff('0x1'));var moment=require('moment');var BPromise=require(_0x35ff('0x2'));var rp=require(_0x35ff('0x3'));var fs=require('fs');var path=require(_0x35ff('0x4'));var rimraf=require(_0x35ff('0x5'));var config=require('../../config/environment');var attributes=require(_0x35ff('0x6'));module[_0x35ff('0x7')]=function(_0x2e9873,_0x11e738){return _0x2e9873[_0x35ff('0x8')]('CmList',attributes,{'tableName':_0x35ff('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x22fb=['define','CmList','../../config/logger','moment','bluebird','request-promise','path','rimraf','./cmList.attributes','exports'];(function(_0x7a098e,_0x2a0469){var _0x3b3cc3=function(_0x78d12a){while(--_0x78d12a){_0x7a098e['push'](_0x7a098e['shift']());}};_0x3b3cc3(++_0x2a0469);}(_0x22fb,0x192));var _0xb22f=function(_0x147db9,_0x310b5d){_0x147db9=_0x147db9-0x0;var _0x3fefaf=_0x22fb[_0x147db9];return _0x3fefaf;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb22f('0x0'))('api');var moment=require(_0xb22f('0x1'));var BPromise=require(_0xb22f('0x2'));var rp=require(_0xb22f('0x3'));var fs=require('fs');var path=require(_0xb22f('0x4'));var rimraf=require(_0xb22f('0x5'));var config=require('../../config/environment');var attributes=require(_0xb22f('0x6'));module[_0xb22f('0x7')]=function(_0x2d1fb3,_0xc3ffcc){return _0x2d1fb3[_0xb22f('0x8')](_0xb22f('0x9'),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 194be77..286a905 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 _0x34ac=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','redis','localhost','socket.io-emitter','./cmList.socket','register','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x14ddf7,_0x434c46){var _0x3be0d3=function(_0x39631e){while(--_0x39631e){_0x14ddf7['push'](_0x14ddf7['shift']());}};_0x3be0d3(++_0x434c46);}(_0x34ac,0xb8));var _0xc34a=function(_0xaf1fb2,_0x46c137){_0xaf1fb2=_0xaf1fb2-0x0;var _0x4024cc=_0x34ac[_0xaf1fb2];return _0x4024cc;};'use strict';var _=require(_0xc34a('0x0'));var util=require(_0xc34a('0x1'));var moment=require('moment');var BPromise=require(_0xc34a('0x2'));var rs=require(_0xc34a('0x3'));var fs=require('fs');var Redis=require(_0xc34a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc34a('0x5'));var logger=require(_0xc34a('0x6'))('rpc');var config=require(_0xc34a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc34a('0x8')][_0xc34a('0x9')]({'port':0x232a});config[_0xc34a('0xa')]=_['defaults'](config[_0xc34a('0xa')],{'host':_0xc34a('0xb'),'port':0x18eb});var socket=require(_0xc34a('0xc'))(new Redis(config[_0xc34a('0xa')]));require(_0xc34a('0xd'))[_0xc34a('0xe')](socket);function respondWithRpcPromise(_0x46f718,_0x4097ff,_0x35e703){return new BPromise(function(_0x560b18,_0x558852){return client['request'](_0x46f718,_0x35e703)[_0xc34a('0xf')](function(_0x4eac3f){logger[_0xc34a('0x10')](_0xc34a('0x11'),_0x4097ff,_0xc34a('0x12'));logger[_0xc34a('0x13')]('CmList,\x20%s,\x20%s,\x20%s',_0x4097ff,'request\x20sent',JSON[_0xc34a('0x14')](_0x4eac3f));if(_0x4eac3f['error']){if(_0x4eac3f[_0xc34a('0x15')][_0xc34a('0x16')]===0x1f4){logger[_0xc34a('0x15')](_0xc34a('0x11'),_0x4097ff,_0x4eac3f[_0xc34a('0x15')]['message']);return _0x558852(_0x4eac3f['error']['message']);}logger[_0xc34a('0x15')](_0xc34a('0x11'),_0x4097ff,_0x4eac3f[_0xc34a('0x15')]['message']);return _0x560b18(_0x4eac3f[_0xc34a('0x15')][_0xc34a('0x17')]);}else{logger[_0xc34a('0x10')]('CmList,\x20%s,\x20%s',_0x4097ff,'request\x20sent');_0x560b18(_0x4eac3f[_0xc34a('0x18')][_0xc34a('0x17')]);}})[_0xc34a('0x19')](function(_0x171e2f){logger[_0xc34a('0x15')](_0xc34a('0x11'),_0x4097ff,_0x171e2f);_0x558852(_0x171e2f);});});} \ No newline at end of file +var _0x2212=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./cmList.socket','register','request','then','info','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','CmList,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x13576d,_0x41d643){var _0x50e65e=function(_0xe40db3){while(--_0xe40db3){_0x13576d['push'](_0x13576d['shift']());}};_0x50e65e(++_0x41d643);}(_0x2212,0x10c));var _0x2221=function(_0x3c9760,_0x1b2a9a){_0x3c9760=_0x3c9760-0x0;var _0x248079=_0x2212[_0x3c9760];return _0x248079;};'use strict';var _=require(_0x2221('0x0'));var util=require(_0x2221('0x1'));var moment=require(_0x2221('0x2'));var BPromise=require(_0x2221('0x3'));var rs=require(_0x2221('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2221('0x5'))['db'];var utils=require(_0x2221('0x6'));var logger=require(_0x2221('0x7'))(_0x2221('0x8'));var config=require(_0x2221('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2221('0xa')][_0x2221('0xb')]({'port':0x232a});config[_0x2221('0xc')]=_[_0x2221('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2221('0xe'))(new Redis(config[_0x2221('0xc')]));require(_0x2221('0xf'))[_0x2221('0x10')](socket);function respondWithRpcPromise(_0x411b60,_0xf5cad7,_0x43ac9c){return new BPromise(function(_0x5c5097,_0x17aa90){return client[_0x2221('0x11')](_0x411b60,_0x43ac9c)[_0x2221('0x12')](function(_0x189d66){logger[_0x2221('0x13')]('CmList,\x20%s,\x20%s',_0xf5cad7,_0x2221('0x14'));logger[_0x2221('0x15')](_0x2221('0x16'),_0xf5cad7,_0x2221('0x14'),JSON[_0x2221('0x17')](_0x189d66));if(_0x189d66[_0x2221('0x18')]){if(_0x189d66['error'][_0x2221('0x19')]===0x1f4){logger[_0x2221('0x18')](_0x2221('0x1a'),_0xf5cad7,_0x189d66[_0x2221('0x18')][_0x2221('0x1b')]);return _0x17aa90(_0x189d66[_0x2221('0x18')][_0x2221('0x1b')]);}logger[_0x2221('0x18')](_0x2221('0x1a'),_0xf5cad7,_0x189d66[_0x2221('0x18')]['message']);return _0x5c5097(_0x189d66[_0x2221('0x18')][_0x2221('0x1b')]);}else{logger[_0x2221('0x13')](_0x2221('0x1a'),_0xf5cad7,'request\x20sent');_0x5c5097(_0x189d66[_0x2221('0x1c')][_0x2221('0x1b')]);}})[_0x2221('0x1d')](function(_0x388b55){logger['error'](_0x2221('0x1a'),_0xf5cad7,_0x388b55);_0x17aa90(_0x388b55);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 453b6e4..197f96b 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 _0xd02c=['remove','update','emit','removeListener','./cmList.events','save'];(function(_0x22061a,_0x359198){var _0x18eb16=function(_0x40ceae){while(--_0x40ceae){_0x22061a['push'](_0x22061a['shift']());}};_0x18eb16(++_0x359198);}(_0xd02c,0x1ba));var _0xcd02=function(_0x38efaa,_0x49c440){_0x38efaa=_0x38efaa-0x0;var _0x2af532=_0xd02c[_0x38efaa];return _0x2af532;};'use strict';var CmListEvents=require(_0xcd02('0x0'));var events=[_0xcd02('0x1'),_0xcd02('0x2'),_0xcd02('0x3')];function createListener(_0x4d9543,_0x4c3341){return function(_0x5ab881){_0x4c3341[_0xcd02('0x4')](_0x4d9543,_0x5ab881);};}function removeListener(_0x1f8854,_0x17e1d8){return function(){CmListEvents[_0xcd02('0x5')](_0x1f8854,_0x17e1d8);};}exports['register']=function(_0x4b245c){for(var _0x27512c=0x0,_0x24275f=events['length'];_0x27512c<_0x24275f;_0x27512c++){var _0x364a38=events[_0x27512c];var _0x56bc94=createListener('cmList:'+_0x364a38,_0x4b245c);CmListEvents['on'](_0x364a38,_0x56bc94);}}; \ No newline at end of file +var _0x9484=['removeListener','register','length','cmList:','save','remove','update','emit'];(function(_0x34571d,_0x178018){var _0x3578d2=function(_0x1c3733){while(--_0x1c3733){_0x34571d['push'](_0x34571d['shift']());}};_0x3578d2(++_0x178018);}(_0x9484,0x104));var _0x4948=function(_0x3e961c,_0x5747e7){_0x3e961c=_0x3e961c-0x0;var _0x474f9c=_0x9484[_0x3e961c];return _0x474f9c;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x4948('0x0'),_0x4948('0x1'),_0x4948('0x2')];function createListener(_0x43a221,_0x30b26d){return function(_0x1af170){_0x30b26d[_0x4948('0x3')](_0x43a221,_0x1af170);};}function removeListener(_0x34a092,_0xd57b0e){return function(){CmListEvents[_0x4948('0x4')](_0x34a092,_0xd57b0e);};}exports[_0x4948('0x5')]=function(_0x3f98bc){for(var _0x49b23b=0x0,_0x1c0ce3=events[_0x4948('0x6')];_0x49b23b<_0x1c0ce3;_0x49b23b++){var _0x467324=events[_0x49b23b];var _0x489b51=createListener(_0x4948('0x7')+_0x467324,_0x3f98bc);CmListEvents['on'](_0x467324,_0x489b51);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 00f8c0c..8852d56 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 _0x4c8b=['/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','getCustomFields','/:id/users','getAgents','post','create','addDisposition','/:id/fields','addCustomField','addAgents','put','update','delete','/:id','destroy','removeDispositions','removeAgents','exports','multer','util','express','Router','../../components/auth/service','../../config/environment','./cmList.controller','index','get','/describe','describe','/global_fields','isAuthenticated','getGlobalCustomFields','/:id/dispositions'];(function(_0x18bd7b,_0x4d2f9a){var _0x48569=function(_0x2c5a44){while(--_0x2c5a44){_0x18bd7b['push'](_0x18bd7b['shift']());}};_0x48569(++_0x4d2f9a);}(_0x4c8b,0x17d));var _0xb4c8=function(_0x460af9,_0x15ee52){_0x460af9=_0x460af9-0x0;var _0x9681f1=_0x4c8b[_0x460af9];return _0x9681f1;};'use strict';var multer=require(_0xb4c8('0x0'));var util=require(_0xb4c8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb4c8('0x2'));var router=express[_0xb4c8('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb4c8('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb4c8('0x5'));var controller=require(_0xb4c8('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xb4c8('0x7')]);router[_0xb4c8('0x8')](_0xb4c8('0x9'),auth['isAuthenticated'](),controller[_0xb4c8('0xa')]);router[_0xb4c8('0x8')](_0xb4c8('0xb'),auth[_0xb4c8('0xc')](),controller[_0xb4c8('0xd')]);router[_0xb4c8('0x8')]('/:id',auth[_0xb4c8('0xc')](),controller['show']);router[_0xb4c8('0x8')](_0xb4c8('0xe'),auth[_0xb4c8('0xc')](),controller['getDispositions']);router[_0xb4c8('0x8')](_0xb4c8('0xf'),auth[_0xb4c8('0xc')](),controller[_0xb4c8('0x10')]);router[_0xb4c8('0x8')](_0xb4c8('0x11'),auth['isAuthenticated'](),controller[_0xb4c8('0x12')]);router[_0xb4c8('0x8')]('/:id/fields',auth[_0xb4c8('0xc')](),controller[_0xb4c8('0x13')]);router[_0xb4c8('0x8')](_0xb4c8('0x14'),auth[_0xb4c8('0xc')](),controller[_0xb4c8('0x15')]);router[_0xb4c8('0x16')]('/',auth[_0xb4c8('0xc')](),controller[_0xb4c8('0x17')]);router[_0xb4c8('0x16')](_0xb4c8('0xe'),auth[_0xb4c8('0xc')](),controller[_0xb4c8('0x18')]);router['post'](_0xb4c8('0xf'),auth['isAuthenticated'](),controller['addContacts']);router['post'](_0xb4c8('0x19'),auth[_0xb4c8('0xc')](),controller[_0xb4c8('0x1a')]);router[_0xb4c8('0x16')](_0xb4c8('0x14'),auth['isAuthenticated'](),controller[_0xb4c8('0x1b')]);router[_0xb4c8('0x1c')]('/:id',auth[_0xb4c8('0xc')](),controller[_0xb4c8('0x1d')]);router[_0xb4c8('0x1e')](_0xb4c8('0x1f'),auth[_0xb4c8('0xc')](),controller[_0xb4c8('0x20')]);router[_0xb4c8('0x1e')]('/:id/dispositions',auth[_0xb4c8('0xc')](),controller[_0xb4c8('0x21')]);router['delete'](_0xb4c8('0x14'),auth[_0xb4c8('0xc')](),controller[_0xb4c8('0x22')]);module[_0xb4c8('0x23')]=router; \ No newline at end of file +var _0xfd01=['/:id','show','/:id/dispositions','getDispositions','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','create','addDisposition','post','addContacts','addCustomField','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./cmList.controller','get','index','/describe','isAuthenticated','describe','/global_fields','getGlobalCustomFields'];(function(_0x3235ae,_0xc87048){var _0x5d152a=function(_0x5446e0){while(--_0x5446e0){_0x3235ae['push'](_0x3235ae['shift']());}};_0x5d152a(++_0xc87048);}(_0xfd01,0x86));var _0x1fd0=function(_0x569753,_0x5c39bf){_0x569753=_0x569753-0x0;var _0x5c7f98=_0xfd01[_0x569753];return _0x5c7f98;};'use strict';var multer=require(_0x1fd0('0x0'));var util=require('util');var path=require(_0x1fd0('0x1'));var timeout=require(_0x1fd0('0x2'));var express=require(_0x1fd0('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1fd0('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1fd0('0x5'));var controller=require(_0x1fd0('0x6'));router[_0x1fd0('0x7')]('/',auth['isAuthenticated'](),controller[_0x1fd0('0x8')]);router[_0x1fd0('0x7')](_0x1fd0('0x9'),auth[_0x1fd0('0xa')](),controller[_0x1fd0('0xb')]);router[_0x1fd0('0x7')](_0x1fd0('0xc'),auth[_0x1fd0('0xa')](),controller[_0x1fd0('0xd')]);router['get'](_0x1fd0('0xe'),auth['isAuthenticated'](),controller[_0x1fd0('0xf')]);router['get'](_0x1fd0('0x10'),auth[_0x1fd0('0xa')](),controller[_0x1fd0('0x11')]);router['get']('/:id/contacts',auth[_0x1fd0('0xa')](),controller['getContacts']);router['get'](_0x1fd0('0x12'),auth[_0x1fd0('0xa')](),controller[_0x1fd0('0x13')]);router[_0x1fd0('0x7')](_0x1fd0('0x14'),auth[_0x1fd0('0xa')](),controller[_0x1fd0('0x15')]);router[_0x1fd0('0x7')](_0x1fd0('0x16'),auth['isAuthenticated'](),controller[_0x1fd0('0x17')]);router['post']('/',auth[_0x1fd0('0xa')](),controller[_0x1fd0('0x18')]);router['post'](_0x1fd0('0x10'),auth[_0x1fd0('0xa')](),controller[_0x1fd0('0x19')]);router[_0x1fd0('0x1a')]('/:id/contacts',auth[_0x1fd0('0xa')](),controller[_0x1fd0('0x1b')]);router[_0x1fd0('0x1a')]('/:id/fields',auth[_0x1fd0('0xa')](),controller[_0x1fd0('0x1c')]);router[_0x1fd0('0x1a')](_0x1fd0('0x16'),auth[_0x1fd0('0xa')](),controller[_0x1fd0('0x1d')]);router[_0x1fd0('0x1e')](_0x1fd0('0xe'),auth[_0x1fd0('0xa')](),controller[_0x1fd0('0x1f')]);router[_0x1fd0('0x20')](_0x1fd0('0xe'),auth[_0x1fd0('0xa')](),controller[_0x1fd0('0x21')]);router[_0x1fd0('0x20')]('/:id/dispositions',auth[_0x1fd0('0xa')](),controller[_0x1fd0('0x22')]);router[_0x1fd0('0x20')]('/:id/users',auth[_0x1fd0('0xa')](),controller[_0x1fd0('0x23')]);module[_0x1fd0('0x24')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 97c0379..5e15490 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 _0x6c4f=['STRING','sequelize','exports','VIRTUAL','field'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6c4f,0x169));var _0xf6c4=function(_0x3eb6e5,_0x2d12fb){_0x3eb6e5=_0x3eb6e5-0x0;var _0x2f1bee=_0x6c4f[_0x3eb6e5];return _0x2f1bee;};'use strict';var Sequelize=require(_0xf6c4('0x0'));module[_0xf6c4('0x1')]={'name':{'type':Sequelize[_0xf6c4('0x2')],'get':function(_0x294fda){return this['getDataValue'](_0xf6c4('0x3'));}},'field':{'type':Sequelize[_0xf6c4('0x4')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xf6c4('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0xe09e=['field','STRING','sequelize','exports','VIRTUAL'];(function(_0x12a98e,_0x3194a1){var _0x4424c4=function(_0x33e196){while(--_0x33e196){_0x12a98e['push'](_0x12a98e['shift']());}};_0x4424c4(++_0x3194a1);}(_0xe09e,0x16a));var _0xee09=function(_0x472eb3,_0x21997b){_0x472eb3=_0x472eb3-0x0;var _0x2816cb=_0xe09e[_0x472eb3];return _0x2816cb;};'use strict';var Sequelize=require(_0xee09('0x0'));module[_0xee09('0x1')]={'name':{'type':Sequelize[_0xee09('0x2')],'get':function(_0x2c19bd){return this['getDataValue'](_0xee09('0x3'));}},'field':{'type':Sequelize[_0xee09('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0xee09('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0xee09('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 7c6bdef..4f27b82 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 _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x268079,_0xbb7a6){var _0x5e6add=function(_0x1d822e){while(--_0x1d822e){_0x268079['push'](_0x268079['shift']());}};_0x5e6add(++_0xbb7a6);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x1b5358,_0x30c4a1){var _0x45e663=function(_0x3ef778){while(--_0x3ef778){_0x1b5358['push'](_0x1b5358['shift']());}};_0x45e663(++_0x30c4a1);}(_0x7a54,0x106));var _0x47a5=function(_0x3058a6,_0x41b140){_0x3058a6=_0x3058a6-0x0;var _0x1067e8=_0x7a54[_0x3058a6];return _0x1067e8;};'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 201e6fa..9ff6355 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 _0x2c69=['define','Condition','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x2b8192,_0x2c0222){var _0x1ac7ce=function(_0x36f191){while(--_0x36f191){_0x2b8192['push'](_0x2b8192['shift']());}};_0x1ac7ce(++_0x2c0222);}(_0x2c69,0xea));var _0x92c6=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x2c69[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x92c6('0x0'))('api');var moment=require(_0x92c6('0x1'));var BPromise=require('bluebird');var rp=require(_0x92c6('0x2'));var fs=require('fs');var path=require(_0x92c6('0x3'));var rimraf=require(_0x92c6('0x4'));var config=require(_0x92c6('0x5'));var attributes=require('./condition.attributes');module['exports']=function(_0x2564a1,_0x3158c8){return _0x2564a1[_0x92c6('0x6')](_0x92c6('0x7'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7749=['lodash','util','api','bluebird','request-promise','path','rimraf','exports','define','tools_conditions'];(function(_0x2967c1,_0x202a72){var _0x103397=function(_0x14b5cc){while(--_0x14b5cc){_0x2967c1['push'](_0x2967c1['shift']());}};_0x103397(++_0x202a72);}(_0x7749,0x172));var _0x9774=function(_0x457c43,_0x2f0f1d){_0x457c43=_0x457c43-0x0;var _0x1e8d9d=_0x7749[_0x457c43];return _0x1e8d9d;};'use strict';var _=require(_0x9774('0x0'));var util=require(_0x9774('0x1'));var logger=require('../../config/logger')(_0x9774('0x2'));var moment=require('moment');var BPromise=require(_0x9774('0x3'));var rp=require(_0x9774('0x4'));var fs=require('fs');var path=require(_0x9774('0x5'));var rimraf=require(_0x9774('0x6'));var config=require('../../config/environment');var attributes=require('./condition.attributes');module[_0x9774('0x7')]=function(_0x207535,_0x1f1f13){return _0x207535[_0x9774('0x8')]('Condition',attributes,{'tableName':_0x9774('0x9'),'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 caaf79e..a4a8fe5 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 _0xc84a=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','error','code','Condition,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x2561d3,_0x3cd0ad){var _0x491a67=function(_0x19dc9d){while(--_0x19dc9d){_0x2561d3['push'](_0x2561d3['shift']());}};_0x491a67(++_0x3cd0ad);}(_0xc84a,0x19f));var _0xac84=function(_0x59667d,_0x5906f4){_0x59667d=_0x59667d-0x0;var _0x52bf52=_0xc84a[_0x59667d];return _0x52bf52;};'use strict';var _=require(_0xac84('0x0'));var util=require(_0xac84('0x1'));var moment=require(_0xac84('0x2'));var BPromise=require(_0xac84('0x3'));var rs=require(_0xac84('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xac84('0x5'))['db'];var utils=require(_0xac84('0x6'));var logger=require(_0xac84('0x7'))('rpc');var config=require(_0xac84('0x8'));var jayson=require(_0xac84('0x9'));var client=jayson[_0xac84('0xa')][_0xac84('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x506814,_0xd64308,_0x599ad7){return new BPromise(function(_0x53733b,_0x231683){return client[_0xac84('0xc')](_0x506814,_0x599ad7)[_0xac84('0xd')](function(_0x414770){logger[_0xac84('0xe')]('Condition,\x20%s,\x20%s',_0xd64308,_0xac84('0xf'));logger['debug']('Condition,\x20%s,\x20%s,\x20%s',_0xd64308,_0xac84('0xf'),JSON['stringify'](_0x414770));if(_0x414770[_0xac84('0x10')]){if(_0x414770[_0xac84('0x10')][_0xac84('0x11')]===0x1f4){logger['error'](_0xac84('0x12'),_0xd64308,_0x414770[_0xac84('0x10')][_0xac84('0x13')]);return _0x231683(_0x414770['error'][_0xac84('0x13')]);}logger[_0xac84('0x10')]('Condition,\x20%s,\x20%s',_0xd64308,_0x414770[_0xac84('0x10')][_0xac84('0x13')]);return _0x53733b(_0x414770[_0xac84('0x10')][_0xac84('0x13')]);}else{logger[_0xac84('0xe')](_0xac84('0x12'),_0xd64308,_0xac84('0xf'));_0x53733b(_0x414770['result'][_0xac84('0x13')]);}})[_0xac84('0x14')](function(_0x21257c){logger[_0xac84('0x10')](_0xac84('0x12'),_0xd64308,_0x21257c);_0x231683(_0x21257c);});});} \ No newline at end of file +var _0x9975=['error','code','message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s'];(function(_0x46d61b,_0x513f6a){var _0x11b61f=function(_0x4b0678){while(--_0x4b0678){_0x46d61b['push'](_0x46d61b['shift']());}};_0x11b61f(++_0x513f6a);}(_0x9975,0x76));var _0x5997=function(_0x42e63f,_0x4f2214){_0x42e63f=_0x42e63f-0x0;var _0x4f90e0=_0x9975[_0x42e63f];return _0x4f90e0;};'use strict';var _=require('lodash');var util=require(_0x5997('0x0'));var moment=require(_0x5997('0x1'));var BPromise=require('bluebird');var rs=require(_0x5997('0x2'));var fs=require('fs');var Redis=require(_0x5997('0x3'));var db=require(_0x5997('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5997('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5997('0x6'));var client=jayson['client'][_0x5997('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xaafdf0,_0x3c38ce,_0x28a17f){return new BPromise(function(_0x54902f,_0x34eba8){return client[_0x5997('0x8')](_0xaafdf0,_0x28a17f)[_0x5997('0x9')](function(_0x486c9d){logger[_0x5997('0xa')](_0x5997('0xb'),_0x3c38ce,_0x5997('0xc'));logger[_0x5997('0xd')](_0x5997('0xe'),_0x3c38ce,_0x5997('0xc'),JSON['stringify'](_0x486c9d));if(_0x486c9d[_0x5997('0xf')]){if(_0x486c9d[_0x5997('0xf')][_0x5997('0x10')]===0x1f4){logger[_0x5997('0xf')](_0x5997('0xb'),_0x3c38ce,_0x486c9d['error']['message']);return _0x34eba8(_0x486c9d[_0x5997('0xf')][_0x5997('0x11')]);}logger[_0x5997('0xf')](_0x5997('0xb'),_0x3c38ce,_0x486c9d[_0x5997('0xf')]['message']);return _0x54902f(_0x486c9d[_0x5997('0xf')]['message']);}else{logger[_0x5997('0xa')]('Condition,\x20%s,\x20%s',_0x3c38ce,_0x5997('0xc'));_0x54902f(_0x486c9d[_0x5997('0x12')]['message']);}})['catch'](function(_0xe44d79){logger['error'](_0x5997('0xb'),_0x3c38ce,_0xe44d79);_0x34eba8(_0xe44d79);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index e61ffa1..a6a4f0c 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 _0xa34b=['./condition.controller','put','isAuthenticated','update','/:id','destroy','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5d3693,_0x4a394c){var _0x381c1b=function(_0x3c0f71){while(--_0x3c0f71){_0x5d3693['push'](_0x5d3693['shift']());}};_0x381c1b(++_0x4a394c);}(_0xa34b,0x162));var _0xba34=function(_0x3e93a3,_0x1d38cf){_0x3e93a3=_0x3e93a3-0x0;var _0x5edc60=_0xa34b[_0x3e93a3];return _0x5edc60;};'use strict';var multer=require(_0xba34('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xba34('0x1'));var express=require('express');var router=express[_0xba34('0x2')]();var fs_extra=require(_0xba34('0x3'));var auth=require(_0xba34('0x4'));var interaction=require(_0xba34('0x5'));var config=require('../../config/environment');var controller=require(_0xba34('0x6'));router[_0xba34('0x7')]('/:id',auth[_0xba34('0x8')](),controller[_0xba34('0x9')]);router['delete'](_0xba34('0xa'),auth['isAuthenticated'](),controller[_0xba34('0xb')]);module['exports']=router; \ No newline at end of file +var _0x7e01=['Router','fs-extra','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','update','delete','isAuthenticated','destroy','util','path','connect-timeout','express'];(function(_0x3207aa,_0xe86a72){var _0x51758f=function(_0x9ff790){while(--_0x9ff790){_0x3207aa['push'](_0x3207aa['shift']());}};_0x51758f(++_0xe86a72);}(_0x7e01,0x137));var _0x17e0=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x7e01[_0x3b380d];return _0x54502b;};'use strict';var multer=require('multer');var util=require(_0x17e0('0x0'));var path=require(_0x17e0('0x1'));var timeout=require(_0x17e0('0x2'));var express=require(_0x17e0('0x3'));var router=express[_0x17e0('0x4')]();var fs_extra=require(_0x17e0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x17e0('0x6'));var config=require(_0x17e0('0x7'));var controller=require(_0x17e0('0x8'));router[_0x17e0('0x9')](_0x17e0('0xa'),auth['isAuthenticated'](),controller[_0x17e0('0xb')]);router[_0x17e0('0xc')](_0x17e0('0xa'),auth[_0x17e0('0xd')](),controller[_0x17e0('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index f1d477d..ed76829 100644 --- a/server/api/contactItemType/contactItemType.attributes.js +++ b/server/api/contactItemType/contactItemType.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x73a5=['STRING','exports'];(function(_0x2c43df,_0x1022b5){var _0x11608e=function(_0x4209cc){while(--_0x4209cc){_0x2c43df['push'](_0x2c43df['shift']());}};_0x11608e(++_0x1022b5);}(_0x73a5,0x15f));var _0x573a=function(_0x194573,_0x1ad533){_0x194573=_0x194573-0x0;var _0x219a7b=_0x73a5[_0x194573];return _0x219a7b;};'use strict';var Sequelize=require('sequelize');module[_0x573a('0x0')]={'name':{'type':Sequelize[_0x573a('0x1')],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x573a('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0xfcd8=['INTEGER','sequelize','STRING','name'];(function(_0x545809,_0x1e9efc){var _0x363e7f=function(_0x37d67e){while(--_0x37d67e){_0x545809['push'](_0x545809['shift']());}};_0x363e7f(++_0x1e9efc);}(_0xfcd8,0x121));var _0x8fcd=function(_0x5995b7,_0x4953f1){_0x5995b7=_0x5995b7-0x0;var _0x501531=_0xfcd8[_0x5995b7];return _0x501531;};'use strict';var Sequelize=require(_0x8fcd('0x0'));module['exports']={'name':{'type':Sequelize[_0x8fcd('0x1')],'allowNull':![],'unique':_0x8fcd('0x2')},'OrderBy':{'type':Sequelize[_0x8fcd('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x8fcd('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index b9b89df..2d045bc 100644 --- a/server/api/contactItemType/contactItemType.controller.js +++ b/server/api/contactItemType/contactItemType.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x056b=['find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','CmContactHasItem','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','save','update','then','destroy','ContactItemTypes','error','stack','name','index','map','ContactItemType','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','includeAll'];(function(_0x5147c4,_0x27eb1){var _0x51a653=function(_0xd3c072){while(--_0xd3c072){_0x5147c4['push'](_0x5147c4['shift']());}};_0x51a653(++_0x27eb1);}(_0x056b,0xb6));var _0xb056=function(_0x5e53ae,_0x24af4f){_0x5e53ae=_0x5e53ae-0x0;var _0x27a8a2=_0x056b[_0x5e53ae];return _0x27a8a2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb056('0x0'));var zipdir=require(_0xb056('0x1'));var jsonpatch=require(_0xb056('0x2'));var rp=require(_0xb056('0x3'));var moment=require(_0xb056('0x4'));var BPromise=require(_0xb056('0x5'));var Mustache=require(_0xb056('0x6'));var util=require(_0xb056('0x7'));var path=require(_0xb056('0x8'));var sox=require(_0xb056('0x9'));var csv=require(_0xb056('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb056('0xb'));var _=require(_0xb056('0xc'));var squel=require(_0xb056('0xd'));var crypto=require(_0xb056('0xe'));var jsforce=require(_0xb056('0xf'));var deskjs=require(_0xb056('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb056('0x11'));var Redis=require(_0xb056('0x12'));var authService=require(_0xb056('0x13'));var qs=require(_0xb056('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb056('0x15'));var logger=require('../../config/logger')(_0xb056('0x16'));var utils=require(_0xb056('0x17'));var config=require(_0xb056('0x18'));var licenseUtil=require(_0xb056('0x19'));var db=require(_0xb056('0x1a'))['db'];function respondWithStatusCode(_0x5d8306,_0x49c5ec){_0x49c5ec=_0x49c5ec||0xcc;return function(_0xf3e80f){if(_0xf3e80f){return _0x5d8306[_0xb056('0x1b')](_0x49c5ec);}return _0x5d8306['status'](_0x49c5ec)[_0xb056('0x1c')]();};}function respondWithResult(_0x34611b,_0xf1c2e9){_0xf1c2e9=_0xf1c2e9||0xc8;return function(_0x1197e5){if(_0x1197e5){return _0x34611b[_0xb056('0x1d')](_0xf1c2e9)[_0xb056('0x1e')](_0x1197e5);}};}function respondWithFilteredResult(_0x179e49,_0x4b838e){return function(_0x162146){if(_0x162146){var _0x43565e=typeof _0x4b838e[_0xb056('0x1f')]===_0xb056('0x20')&&typeof _0x4b838e['limit']===_0xb056('0x20');var _0x4e501a=_0x162146[_0xb056('0x21')];var _0x311eb9=_0x43565e?0x0:_0x4b838e['offset'];var _0x29c77e=_0x43565e?_0x162146['count']:_0x4b838e[_0xb056('0x1f')]+_0x4b838e[_0xb056('0x22')];var _0x5e4bd9;if(_0x29c77e>=_0x4e501a){_0x29c77e=_0x4e501a;_0x5e4bd9=0xc8;}else{_0x5e4bd9=0xce;}_0x179e49[_0xb056('0x1d')](_0x5e4bd9);return _0x179e49['set'](_0xb056('0x23'),_0x311eb9+'-'+_0x29c77e+'/'+_0x4e501a)[_0xb056('0x1e')](_0x162146);}return null;};}function patchUpdates(_0x457b54){return function(_0x33dd35){try{jsonpatch['apply'](_0x33dd35,_0x457b54,!![]);}catch(_0x1db585){return BPromise['reject'](_0x1db585);}return _0x33dd35[_0xb056('0x24')]();};}function saveUpdates(_0x5dea90,_0x324ce6){return function(_0x40ac2d){if(_0x40ac2d){return _0x40ac2d[_0xb056('0x25')](_0x5dea90)[_0xb056('0x26')](function(_0x36e539){return _0x36e539;});}return null;};}function removeEntity(_0x4bb6c0,_0x4e66c3){return function(_0x1016da){if(_0x1016da){return _0x1016da[_0xb056('0x27')]()[_0xb056('0x26')](function(){var _0x1bd6ac=_0x1016da['get']({'plain':!![]});var _0x44a14f=_0xb056('0x28');return db['UserProfileResource'][_0xb056('0x27')]({'where':{'type':_0x44a14f,'resourceId':_0x1bd6ac['id']}})[_0xb056('0x26')](function(){return _0x1016da;});})[_0xb056('0x26')](function(){_0x4bb6c0[_0xb056('0x1d')](0xcc)[_0xb056('0x1c')]();});}};}function handleEntityNotFound(_0x4024d7,_0x211898){return function(_0x2042f1){if(!_0x2042f1){_0x4024d7['sendStatus'](0x194);}return _0x2042f1;};}function handleError(_0x29fbc1,_0x51b06b){_0x51b06b=_0x51b06b||0x1f4;return function(_0x3d83d3){logger[_0xb056('0x29')](_0x3d83d3[_0xb056('0x2a')]);if(_0x3d83d3['name']){delete _0x3d83d3[_0xb056('0x2b')];}_0x29fbc1[_0xb056('0x1d')](_0x51b06b)['send'](_0x3d83d3);};}exports[_0xb056('0x2c')]=function(_0x43aa63,_0x329eaa){var _0x1fad05={},_0x3ce984={},_0x4ebca5={'count':0x0,'rows':[]};var _0x87f31e=_[_0xb056('0x2d')](db[_0xb056('0x2e')][_0xb056('0x2f')],function(_0x103482){return{'name':_0x103482['fieldName'],'type':_0x103482[_0xb056('0x30')][_0xb056('0x31')]};});_0x3ce984[_0xb056('0x32')]=_[_0xb056('0x2d')](_0x87f31e,_0xb056('0x2b'));_0x3ce984[_0xb056('0x33')]=_[_0xb056('0x34')](_0x43aa63[_0xb056('0x33')]);_0x3ce984['filters']=_[_0xb056('0x35')](_0x3ce984['model'],_0x3ce984[_0xb056('0x33')]);_0x1fad05['attributes']=_['intersection'](_0x3ce984[_0xb056('0x32')],qs[_0xb056('0x36')](_0x43aa63[_0xb056('0x33')][_0xb056('0x36')]));_0x1fad05[_0xb056('0x37')]=_0x1fad05[_0xb056('0x37')][_0xb056('0x38')]?_0x1fad05['attributes']:_0x3ce984[_0xb056('0x32')];if(!_0x43aa63[_0xb056('0x33')]['hasOwnProperty']('nolimit')){_0x1fad05[_0xb056('0x22')]=qs[_0xb056('0x22')](_0x43aa63[_0xb056('0x33')]['limit']);_0x1fad05[_0xb056('0x1f')]=qs[_0xb056('0x1f')](_0x43aa63[_0xb056('0x33')][_0xb056('0x1f')]);}_0x1fad05[_0xb056('0x39')]=qs[_0xb056('0x3a')](_0x43aa63[_0xb056('0x33')][_0xb056('0x3a')]);_0x1fad05[_0xb056('0x3b')]=qs[_0xb056('0x3c')](_[_0xb056('0x3d')](_0x43aa63[_0xb056('0x33')],_0x3ce984['filters']),_0x87f31e);if(_0x43aa63[_0xb056('0x33')]['filter']){_0x1fad05[_0xb056('0x3b')]=_[_0xb056('0x3e')](_0x1fad05[_0xb056('0x3b')],{'$or':_[_0xb056('0x2d')](_0x87f31e,function(_0x460f28){if(_0x460f28[_0xb056('0x30')]!==_0xb056('0x3f')){var _0x42b54f={};_0x42b54f[_0x460f28['name']]={'$like':'%'+_0x43aa63[_0xb056('0x33')][_0xb056('0x40')]+'%'};return _0x42b54f;}})});}_0x1fad05=_[_0xb056('0x3e')]({},_0x1fad05,_0x43aa63[_0xb056('0x41')]);var _0x134db7={'where':_0x1fad05['where']};return db[_0xb056('0x2e')][_0xb056('0x21')](_0x134db7)[_0xb056('0x26')](function(_0x216f72){_0x4ebca5[_0xb056('0x21')]=_0x216f72;if(_0x43aa63[_0xb056('0x33')]['includeAll']){_0x1fad05[_0xb056('0x42')]=[{'all':!![]}];}return db['ContactItemType'][_0xb056('0x43')](_0x1fad05);})[_0xb056('0x26')](function(_0x21d98e){_0x4ebca5[_0xb056('0x44')]=_0x21d98e;return _0x4ebca5;})[_0xb056('0x26')](respondWithFilteredResult(_0x329eaa,_0x1fad05))[_0xb056('0x45')](handleError(_0x329eaa,null));};exports[_0xb056('0x46')]=function(_0x248819,_0x2c8b61){var _0x149341={'raw':!![],'where':{'id':_0x248819[_0xb056('0x47')]['id']}},_0x4fa3c5={};_0x4fa3c5[_0xb056('0x32')]=_[_0xb056('0x34')](db['ContactItemType'][_0xb056('0x2f')]);_0x4fa3c5[_0xb056('0x33')]=_['keys'](_0x248819['query']);_0x4fa3c5[_0xb056('0x3c')]=_[_0xb056('0x35')](_0x4fa3c5[_0xb056('0x32')],_0x4fa3c5[_0xb056('0x33')]);_0x149341['attributes']=_['intersection'](_0x4fa3c5['model'],qs['fields'](_0x248819['query']['fields']));_0x149341[_0xb056('0x37')]=_0x149341['attributes'][_0xb056('0x38')]?_0x149341[_0xb056('0x37')]:_0x4fa3c5[_0xb056('0x32')];if(_0x248819[_0xb056('0x33')][_0xb056('0x48')]){_0x149341[_0xb056('0x42')]=[{'all':!![]}];}_0x149341=_[_0xb056('0x3e')]({},_0x149341,_0x248819[_0xb056('0x41')]);return db['ContactItemType'][_0xb056('0x49')](_0x149341)[_0xb056('0x26')](handleEntityNotFound(_0x2c8b61,null))['then'](respondWithResult(_0x2c8b61,null))[_0xb056('0x45')](handleError(_0x2c8b61,null));};exports[_0xb056('0x4a')]=function(_0xe40439,_0x2f2d22){return db[_0xb056('0x2e')][_0xb056('0x4a')](_0xe40439['body'],{})[_0xb056('0x26')](function(_0x5e2224){var _0x132268=_0xe40439[_0xb056('0x4b')][_0xb056('0x4c')]({'plain':!![]});if(!_0x132268)throw new Error(_0xb056('0x4d'));if(_0x132268[_0xb056('0x4e')]===_0xb056('0x4b')){var _0x2b6733=_0x5e2224[_0xb056('0x4c')]({'plain':!![]});var _0x5a3bbf=_0xb056('0x28');return db[_0xb056('0x4f')][_0xb056('0x49')]({'where':{'name':_0x5a3bbf,'userProfileId':_0x132268[_0xb056('0x50')]},'raw':!![]})[_0xb056('0x26')](function(_0x35acab){if(_0x35acab&&_0x35acab[_0xb056('0x51')]===0x0){return db[_0xb056('0x52')]['create']({'name':_0x2b6733[_0xb056('0x2b')],'resourceId':_0x2b6733['id'],'type':_0x35acab[_0xb056('0x2b')],'sectionId':_0x35acab['id']},{})[_0xb056('0x26')](function(){return _0x5e2224;});}else{return _0x5e2224;}})[_0xb056('0x45')](function(_0x1a5170){logger[_0xb056('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a5170);throw _0x1a5170;});}return _0x5e2224;})[_0xb056('0x26')](respondWithResult(_0x2f2d22,0xc9))[_0xb056('0x45')](handleError(_0x2f2d22,null));};exports[_0xb056('0x25')]=function(_0x536d85,_0x37c64c){if(_0x536d85['body']['id']){delete _0x536d85[_0xb056('0x53')]['id'];}return db[_0xb056('0x2e')][_0xb056('0x49')]({'where':{'id':_0x536d85[_0xb056('0x47')]['id']}})['then'](handleEntityNotFound(_0x37c64c,null))[_0xb056('0x26')](saveUpdates(_0x536d85[_0xb056('0x53')],null))['then'](respondWithResult(_0x37c64c,null))[_0xb056('0x45')](handleError(_0x37c64c,null));};exports[_0xb056('0x27')]=function(_0x1d3cdd,_0x1546e5){return db[_0xb056('0x2e')]['find']({'where':{'id':_0x1d3cdd[_0xb056('0x47')]['id']}})[_0xb056('0x26')](handleEntityNotFound(_0x1546e5,null))[_0xb056('0x26')](db[_0xb056('0x54')][_0xb056('0x25')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x1d3cdd[_0xb056('0x47')]['id']}}))[_0xb056('0x26')](removeEntity(_0x1546e5,null))[_0xb056('0x45')](handleError(_0x1546e5,null));}; \ No newline at end of file +var _0xb10b=['count','set','Content-Range','reject','update','then','destroy','get','end','error','stack','name','send','map','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','type','merge','options','ContactItemType','include','findAll','rows','includeAll','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ContactItemTypes','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','CmContactHasItem','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0xb10b,0x12a));var _0xbb10=function(_0x53bf11,_0x3acb5e){_0x53bf11=_0x53bf11-0x0;var _0x3a4f47=_0xb10b[_0x53bf11];return _0x3a4f47;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x13'));var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require('../../config/utils');var config=require(_0xbb10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb10('0x17'))['db'];function respondWithStatusCode(_0x916a32,_0x285009){_0x285009=_0x285009||0xcc;return function(_0x193a27){if(_0x193a27){return _0x916a32[_0xbb10('0x18')](_0x285009);}return _0x916a32[_0xbb10('0x19')](_0x285009)['end']();};}function respondWithResult(_0x26e021,_0x42d7e4){_0x42d7e4=_0x42d7e4||0xc8;return function(_0x45b9d6){if(_0x45b9d6){return _0x26e021[_0xbb10('0x19')](_0x42d7e4)[_0xbb10('0x1a')](_0x45b9d6);}};}function respondWithFilteredResult(_0x2f2ebf,_0x24a57b){return function(_0x36b5e8){if(_0x36b5e8){var _0x3e26f4=typeof _0x24a57b[_0xbb10('0x1b')]==='undefined'&&typeof _0x24a57b[_0xbb10('0x1c')]===_0xbb10('0x1d');var _0x133ac2=_0x36b5e8[_0xbb10('0x1e')];var _0x378da8=_0x3e26f4?0x0:_0x24a57b[_0xbb10('0x1b')];var _0x575cca=_0x3e26f4?_0x36b5e8[_0xbb10('0x1e')]:_0x24a57b[_0xbb10('0x1b')]+_0x24a57b[_0xbb10('0x1c')];var _0x48b6e9;if(_0x575cca>=_0x133ac2){_0x575cca=_0x133ac2;_0x48b6e9=0xc8;}else{_0x48b6e9=0xce;}_0x2f2ebf[_0xbb10('0x19')](_0x48b6e9);return _0x2f2ebf[_0xbb10('0x1f')](_0xbb10('0x20'),_0x378da8+'-'+_0x575cca+'/'+_0x133ac2)[_0xbb10('0x1a')](_0x36b5e8);}return null;};}function patchUpdates(_0xdf237d){return function(_0x44e563){try{jsonpatch['apply'](_0x44e563,_0xdf237d,!![]);}catch(_0x12f888){return BPromise[_0xbb10('0x21')](_0x12f888);}return _0x44e563['save']();};}function saveUpdates(_0x4c4b0d,_0x8e2b97){return function(_0x311abe){if(_0x311abe){return _0x311abe[_0xbb10('0x22')](_0x4c4b0d)[_0xbb10('0x23')](function(_0x445761){return _0x445761;});}return null;};}function removeEntity(_0x1824b7,_0x407cb4){return function(_0x436104){if(_0x436104){return _0x436104[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){var _0x3ba6cd=_0x436104[_0xbb10('0x25')]({'plain':!![]});var _0x537898='ContactItemTypes';return db['UserProfileResource'][_0xbb10('0x24')]({'where':{'type':_0x537898,'resourceId':_0x3ba6cd['id']}})[_0xbb10('0x23')](function(){return _0x436104;});})[_0xbb10('0x23')](function(){_0x1824b7['status'](0xcc)[_0xbb10('0x26')]();});}};}function handleEntityNotFound(_0x24d586,_0x6ed43b){return function(_0x1d5e95){if(!_0x1d5e95){_0x24d586[_0xbb10('0x18')](0x194);}return _0x1d5e95;};}function handleError(_0x20d946,_0x2a0e8b){_0x2a0e8b=_0x2a0e8b||0x1f4;return function(_0x4aabb9){logger[_0xbb10('0x27')](_0x4aabb9[_0xbb10('0x28')]);if(_0x4aabb9[_0xbb10('0x29')]){delete _0x4aabb9[_0xbb10('0x29')];}_0x20d946[_0xbb10('0x19')](_0x2a0e8b)[_0xbb10('0x2a')](_0x4aabb9);};}exports['index']=function(_0x221624,_0x4ee02e){var _0x448d5c={},_0x56f2da={},_0x16ad2a={'count':0x0,'rows':[]};var _0x1dcc9c=_[_0xbb10('0x2b')](db['ContactItemType']['rawAttributes'],function(_0x4c3744){return{'name':_0x4c3744[_0xbb10('0x2c')],'type':_0x4c3744['type'][_0xbb10('0x2d')]};});_0x56f2da[_0xbb10('0x2e')]=_[_0xbb10('0x2b')](_0x1dcc9c,_0xbb10('0x29'));_0x56f2da[_0xbb10('0x2f')]=_[_0xbb10('0x30')](_0x221624[_0xbb10('0x2f')]);_0x56f2da['filters']=_[_0xbb10('0x31')](_0x56f2da[_0xbb10('0x2e')],_0x56f2da[_0xbb10('0x2f')]);_0x448d5c[_0xbb10('0x32')]=_[_0xbb10('0x31')](_0x56f2da[_0xbb10('0x2e')],qs[_0xbb10('0x33')](_0x221624[_0xbb10('0x2f')][_0xbb10('0x33')]));_0x448d5c['attributes']=_0x448d5c[_0xbb10('0x32')][_0xbb10('0x34')]?_0x448d5c[_0xbb10('0x32')]:_0x56f2da[_0xbb10('0x2e')];if(!_0x221624['query'][_0xbb10('0x35')]('nolimit')){_0x448d5c['limit']=qs[_0xbb10('0x1c')](_0x221624[_0xbb10('0x2f')][_0xbb10('0x1c')]);_0x448d5c[_0xbb10('0x1b')]=qs[_0xbb10('0x1b')](_0x221624[_0xbb10('0x2f')]['offset']);}_0x448d5c[_0xbb10('0x36')]=qs[_0xbb10('0x37')](_0x221624['query']['sort']);_0x448d5c['where']=qs[_0xbb10('0x38')](_[_0xbb10('0x39')](_0x221624[_0xbb10('0x2f')],_0x56f2da['filters']),_0x1dcc9c);if(_0x221624[_0xbb10('0x2f')][_0xbb10('0x3a')]){_0x448d5c[_0xbb10('0x3b')]=_['merge'](_0x448d5c[_0xbb10('0x3b')],{'$or':_[_0xbb10('0x2b')](_0x1dcc9c,function(_0x1dcd38){if(_0x1dcd38[_0xbb10('0x3c')]!=='VIRTUAL'){var _0xd238e9={};_0xd238e9[_0x1dcd38[_0xbb10('0x29')]]={'$like':'%'+_0x221624['query'][_0xbb10('0x3a')]+'%'};return _0xd238e9;}})});}_0x448d5c=_[_0xbb10('0x3d')]({},_0x448d5c,_0x221624[_0xbb10('0x3e')]);var _0x3a9934={'where':_0x448d5c[_0xbb10('0x3b')]};return db[_0xbb10('0x3f')]['count'](_0x3a9934)[_0xbb10('0x23')](function(_0x1c7fae){_0x16ad2a[_0xbb10('0x1e')]=_0x1c7fae;if(_0x221624[_0xbb10('0x2f')]['includeAll']){_0x448d5c[_0xbb10('0x40')]=[{'all':!![]}];}return db[_0xbb10('0x3f')][_0xbb10('0x41')](_0x448d5c);})[_0xbb10('0x23')](function(_0x5e2cfa){_0x16ad2a[_0xbb10('0x42')]=_0x5e2cfa;return _0x16ad2a;})[_0xbb10('0x23')](respondWithFilteredResult(_0x4ee02e,_0x448d5c))['catch'](handleError(_0x4ee02e,null));};exports['show']=function(_0x38d78f,_0x4a3ddf){var _0x318984={'raw':!![],'where':{'id':_0x38d78f['params']['id']}},_0x180933={};_0x180933[_0xbb10('0x2e')]=_[_0xbb10('0x30')](db[_0xbb10('0x3f')]['rawAttributes']);_0x180933[_0xbb10('0x2f')]=_[_0xbb10('0x30')](_0x38d78f[_0xbb10('0x2f')]);_0x180933[_0xbb10('0x38')]=_[_0xbb10('0x31')](_0x180933[_0xbb10('0x2e')],_0x180933[_0xbb10('0x2f')]);_0x318984[_0xbb10('0x32')]=_[_0xbb10('0x31')](_0x180933[_0xbb10('0x2e')],qs[_0xbb10('0x33')](_0x38d78f[_0xbb10('0x2f')]['fields']));_0x318984[_0xbb10('0x32')]=_0x318984[_0xbb10('0x32')]['length']?_0x318984[_0xbb10('0x32')]:_0x180933[_0xbb10('0x2e')];if(_0x38d78f[_0xbb10('0x2f')][_0xbb10('0x43')]){_0x318984[_0xbb10('0x40')]=[{'all':!![]}];}_0x318984=_[_0xbb10('0x3d')]({},_0x318984,_0x38d78f[_0xbb10('0x3e')]);return db['ContactItemType']['find'](_0x318984)[_0xbb10('0x23')](handleEntityNotFound(_0x4a3ddf,null))[_0xbb10('0x23')](respondWithResult(_0x4a3ddf,null))[_0xbb10('0x44')](handleError(_0x4a3ddf,null));};exports['create']=function(_0x5f0c12,_0x3cd6f3){return db[_0xbb10('0x3f')][_0xbb10('0x45')](_0x5f0c12[_0xbb10('0x46')],{})[_0xbb10('0x23')](function(_0x22b315){var _0x2f2552=_0x5f0c12[_0xbb10('0x47')][_0xbb10('0x25')]({'plain':!![]});if(!_0x2f2552)throw new Error(_0xbb10('0x48'));if(_0x2f2552['role']==='user'){var _0x412e13=_0x22b315[_0xbb10('0x25')]({'plain':!![]});var _0x36ab7d=_0xbb10('0x49');return db[_0xbb10('0x4a')][_0xbb10('0x4b')]({'where':{'name':_0x36ab7d,'userProfileId':_0x2f2552[_0xbb10('0x4c')]},'raw':!![]})[_0xbb10('0x23')](function(_0x1c0d8f){if(_0x1c0d8f&&_0x1c0d8f[_0xbb10('0x4d')]===0x0){return db[_0xbb10('0x4e')][_0xbb10('0x45')]({'name':_0x412e13[_0xbb10('0x29')],'resourceId':_0x412e13['id'],'type':_0x1c0d8f[_0xbb10('0x29')],'sectionId':_0x1c0d8f['id']},{})[_0xbb10('0x23')](function(){return _0x22b315;});}else{return _0x22b315;}})['catch'](function(_0x124052){logger['error'](_0xbb10('0x4f'),_0x124052);throw _0x124052;});}return _0x22b315;})[_0xbb10('0x23')](respondWithResult(_0x3cd6f3,0xc9))[_0xbb10('0x44')](handleError(_0x3cd6f3,null));};exports[_0xbb10('0x22')]=function(_0x26e66e,_0x32d8e9){if(_0x26e66e[_0xbb10('0x46')]['id']){delete _0x26e66e[_0xbb10('0x46')]['id'];}return db[_0xbb10('0x3f')][_0xbb10('0x4b')]({'where':{'id':_0x26e66e[_0xbb10('0x50')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x32d8e9,null))[_0xbb10('0x23')](saveUpdates(_0x26e66e[_0xbb10('0x46')],null))[_0xbb10('0x23')](respondWithResult(_0x32d8e9,null))['catch'](handleError(_0x32d8e9,null));};exports[_0xbb10('0x24')]=function(_0x466eb7,_0x1b83a9){return db[_0xbb10('0x3f')][_0xbb10('0x4b')]({'where':{'id':_0x466eb7[_0xbb10('0x50')]['id']}})['then'](handleEntityNotFound(_0x1b83a9,null))[_0xbb10('0x23')](db[_0xbb10('0x51')][_0xbb10('0x22')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x466eb7[_0xbb10('0x50')]['id']}}))[_0xbb10('0x23')](removeEntity(_0x1b83a9,null))[_0xbb10('0x44')](handleError(_0x1b83a9,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 8751a37..55656b3 100644 --- a/server/api/contactItemType/contactItemType.model.js +++ b/server/api/contactItemType/contactItemType.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x572e=['path','rimraf','../../config/environment','./contactItemType.attributes','define','ContactItemType','tools_contact_item_types','util','../../config/logger','api','moment'];(function(_0x454c0a,_0x21d2f5){var _0x1f5371=function(_0x2d22da){while(--_0x2d22da){_0x454c0a['push'](_0x454c0a['shift']());}};_0x1f5371(++_0x21d2f5);}(_0x572e,0xcd));var _0xe572=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x572e[_0x13e741];return _0x3f8bb3;};'use strict';var _=require('lodash');var util=require(_0xe572('0x0'));var logger=require(_0xe572('0x1'))(_0xe572('0x2'));var moment=require(_0xe572('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe572('0x4'));var rimraf=require(_0xe572('0x5'));var config=require(_0xe572('0x6'));var attributes=require(_0xe572('0x7'));module['exports']=function(_0x4b1583,_0x5273d3){return _0x4b1583[_0xe572('0x8')](_0xe572('0x9'),attributes,{'tableName':_0xe572('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1d47=['../../config/environment','./contactItemType.attributes','exports','define','tools_contact_item_types','lodash','util','moment','bluebird','request-promise','path'];(function(_0x391a29,_0x576446){var _0x5e2214=function(_0x690fbe){while(--_0x690fbe){_0x391a29['push'](_0x391a29['shift']());}};_0x5e2214(++_0x576446);}(_0x1d47,0x123));var _0x71d4=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x1d47[_0x432682];return _0x463d05;};'use strict';var _=require(_0x71d4('0x0'));var util=require(_0x71d4('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x71d4('0x2'));var BPromise=require(_0x71d4('0x3'));var rp=require(_0x71d4('0x4'));var fs=require('fs');var path=require(_0x71d4('0x5'));var rimraf=require('rimraf');var config=require(_0x71d4('0x6'));var attributes=require(_0x71d4('0x7'));module[_0x71d4('0x8')]=function(_0x4f7c54,_0x194129){return _0x4f7c54[_0x71d4('0x9')]('ContactItemType',attributes,{'tableName':_0x71d4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js index b1995ee..2756241 100644 --- a/server/api/contactItemType/contactItemType.rpc.js +++ b/server/api/contactItemType/contactItemType.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6a55=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','ContactItemType,\x20%s,\x20%s','ContactItemType,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb'];(function(_0x19ac6e,_0x435862){var _0x1cdcf3=function(_0x23151c){while(--_0x23151c){_0x19ac6e['push'](_0x19ac6e['shift']());}};_0x1cdcf3(++_0x435862);}(_0x6a55,0x154));var _0x56a5=function(_0x56ca61,_0x187321){_0x56ca61=_0x56ca61-0x0;var _0x1e7bee=_0x6a55[_0x56ca61];return _0x1e7bee;};'use strict';var _=require(_0x56a5('0x0'));var util=require('util');var moment=require(_0x56a5('0x1'));var BPromise=require(_0x56a5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x56a5('0x3'));var db=require(_0x56a5('0x4'))['db'];var utils=require(_0x56a5('0x5'));var logger=require(_0x56a5('0x6'))(_0x56a5('0x7'));var config=require(_0x56a5('0x8'));var jayson=require(_0x56a5('0x9'));var client=jayson[_0x56a5('0xa')][_0x56a5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x454c49,_0x32025d,_0x460908){return new BPromise(function(_0x163899,_0x27d701){return client['request'](_0x454c49,_0x460908)[_0x56a5('0xc')](function(_0x4600a2){logger['info'](_0x56a5('0xd'),_0x32025d,'request\x20sent');logger['debug'](_0x56a5('0xe'),_0x32025d,_0x56a5('0xf'),JSON[_0x56a5('0x10')](_0x4600a2));if(_0x4600a2[_0x56a5('0x11')]){if(_0x4600a2[_0x56a5('0x11')][_0x56a5('0x12')]===0x1f4){logger[_0x56a5('0x11')](_0x56a5('0xd'),_0x32025d,_0x4600a2[_0x56a5('0x11')]['message']);return _0x27d701(_0x4600a2[_0x56a5('0x11')][_0x56a5('0x13')]);}logger['error'](_0x56a5('0xd'),_0x32025d,_0x4600a2[_0x56a5('0x11')][_0x56a5('0x13')]);return _0x163899(_0x4600a2[_0x56a5('0x11')]['message']);}else{logger[_0x56a5('0x14')](_0x56a5('0xd'),_0x32025d,_0x56a5('0xf'));_0x163899(_0x4600a2[_0x56a5('0x15')][_0x56a5('0x13')]);}})[_0x56a5('0x16')](function(_0x1d6a04){logger[_0x56a5('0x11')](_0x56a5('0xd'),_0x32025d,_0x1d6a04);_0x27d701(_0x1d6a04);});});} \ No newline at end of file +var _0xbfef=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1ed301,_0x358099){var _0x58785e=function(_0xc20da8){while(--_0xc20da8){_0x1ed301['push'](_0x1ed301['shift']());}};_0x58785e(++_0x358099);}(_0xbfef,0x1df));var _0xfbfe=function(_0x174332,_0xf6abf9){_0x174332=_0x174332-0x0;var _0x2af39a=_0xbfef[_0x174332];return _0x2af39a;};'use strict';var _=require(_0xfbfe('0x0'));var util=require(_0xfbfe('0x1'));var moment=require(_0xfbfe('0x2'));var BPromise=require(_0xfbfe('0x3'));var rs=require(_0xfbfe('0x4'));var fs=require('fs');var Redis=require(_0xfbfe('0x5'));var db=require(_0xfbfe('0x6'))['db'];var utils=require(_0xfbfe('0x7'));var logger=require(_0xfbfe('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfbfe('0x9'));var client=jayson[_0xfbfe('0xa')][_0xfbfe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d747e,_0x489d5f,_0x2f9db4){return new BPromise(function(_0x23a647,_0x23033){return client[_0xfbfe('0xc')](_0x1d747e,_0x2f9db4)[_0xfbfe('0xd')](function(_0x11b642){logger[_0xfbfe('0xe')](_0xfbfe('0xf'),_0x489d5f,_0xfbfe('0x10'));logger[_0xfbfe('0x11')](_0xfbfe('0x12'),_0x489d5f,_0xfbfe('0x10'),JSON[_0xfbfe('0x13')](_0x11b642));if(_0x11b642[_0xfbfe('0x14')]){if(_0x11b642[_0xfbfe('0x14')][_0xfbfe('0x15')]===0x1f4){logger[_0xfbfe('0x14')](_0xfbfe('0xf'),_0x489d5f,_0x11b642[_0xfbfe('0x14')][_0xfbfe('0x16')]);return _0x23033(_0x11b642['error']['message']);}logger[_0xfbfe('0x14')]('ContactItemType,\x20%s,\x20%s',_0x489d5f,_0x11b642['error'][_0xfbfe('0x16')]);return _0x23a647(_0x11b642[_0xfbfe('0x14')][_0xfbfe('0x16')]);}else{logger[_0xfbfe('0xe')](_0xfbfe('0xf'),_0x489d5f,'request\x20sent');_0x23a647(_0x11b642[_0xfbfe('0x17')][_0xfbfe('0x16')]);}})[_0xfbfe('0x18')](function(_0x5a630e){logger[_0xfbfe('0x14')](_0xfbfe('0xf'),_0x489d5f,_0x5a630e);_0x23033(_0x5a630e);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 47e6ffa..c218046 100644 --- a/server/api/contactItemType/index.js +++ b/server/api/contactItemType/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7715=['delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./contactItemType.controller','isAuthenticated','index','get','/:id','show','put'];(function(_0x4fbf43,_0x4fec82){var _0x3d6edc=function(_0x4d0275){while(--_0x4d0275){_0x4fbf43['push'](_0x4fbf43['shift']());}};_0x3d6edc(++_0x4fec82);}(_0x7715,0x101));var _0x5771=function(_0x1409d3,_0x2a0779){_0x1409d3=_0x1409d3-0x0;var _0x463892=_0x7715[_0x1409d3];return _0x463892;};'use strict';var multer=require(_0x5771('0x0'));var util=require(_0x5771('0x1'));var path=require(_0x5771('0x2'));var timeout=require(_0x5771('0x3'));var express=require(_0x5771('0x4'));var router=express[_0x5771('0x5')]();var fs_extra=require(_0x5771('0x6'));var auth=require(_0x5771('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5771('0x8'));router['get']('/',auth[_0x5771('0x9')](),controller[_0x5771('0xa')]);router[_0x5771('0xb')](_0x5771('0xc'),auth[_0x5771('0x9')](),controller[_0x5771('0xd')]);router['post']('/',auth[_0x5771('0x9')](),controller['create']);router[_0x5771('0xe')]('/:id',auth[_0x5771('0x9')](),controller['update']);router[_0x5771('0xf')](_0x5771('0xc'),auth[_0x5771('0x9')](),controller['destroy']);module[_0x5771('0x10')]=router; \ No newline at end of file +var _0x479b=['../../components/interaction/service','./contactItemType.controller','get','index','isAuthenticated','show','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x11b2c8,_0xc9503c){var _0x5404d7=function(_0x31e862){while(--_0x31e862){_0x11b2c8['push'](_0x11b2c8['shift']());}};_0x5404d7(++_0xc9503c);}(_0x479b,0xea));var _0xb479=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0x479b[_0x101e7b];return _0x4995c0;};'use strict';var multer=require(_0xb479('0x0'));var util=require(_0xb479('0x1'));var path=require(_0xb479('0x2'));var timeout=require(_0xb479('0x3'));var express=require(_0xb479('0x4'));var router=express[_0xb479('0x5')]();var fs_extra=require(_0xb479('0x6'));var auth=require(_0xb479('0x7'));var interaction=require(_0xb479('0x8'));var config=require('../../config/environment');var controller=require(_0xb479('0x9'));router[_0xb479('0xa')]('/',auth['isAuthenticated'](),controller[_0xb479('0xb')]);router[_0xb479('0xa')]('/:id',auth[_0xb479('0xc')](),controller[_0xb479('0xd')]);router[_0xb479('0xe')]('/',auth[_0xb479('0xc')](),controller[_0xb479('0xf')]);router[_0xb479('0x10')]('/:id',auth[_0xb479('0xc')](),controller[_0xb479('0x11')]);router[_0xb479('0x12')](_0xb479('0x13'),auth[_0xb479('0xc')](),controller[_0xb479('0x14')]);module[_0xb479('0x15')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index c6dba20..17c5271 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 _0x757a=['exports','STRING'];(function(_0x30e364,_0x4fe3e3){var _0x36f649=function(_0x3ea2d9){while(--_0x3ea2d9){_0x30e364['push'](_0x30e364['shift']());}};_0x36f649(++_0x4fe3e3);}(_0x757a,0xde));var _0xa757=function(_0x1b383a,_0x342efc){_0x1b383a=_0x1b383a-0x0;var _0x17b6e0=_0x757a[_0x1b383a];return _0x17b6e0;};'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 _0x2032=['name','exports','STRING'];(function(_0x13a099,_0xd9cba8){var _0x379428=function(_0x42809b){while(--_0x42809b){_0x13a099['push'](_0x13a099['shift']());}};_0x379428(++_0xd9cba8);}(_0x2032,0xd9));var _0x2203=function(_0x4a71af,_0x337da3){_0x4a71af=_0x4a71af-0x0;var _0x7fe396=_0x2032[_0x4a71af];return _0x7fe396;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index e9298c5..7b07771 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 _0x09a1=['get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','body','autoAssociation','iframe','attrUrl','attrs','value','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','voice','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','getItems','findOne','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./dashboard.socket','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','CustomDashboards','destroy','sendStatus','error','stack','name','send','map','Dashboard','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','rawAttributes','options','find','catch','create','user'];(function(_0x592525,_0x5bf76a){var _0x300b13=function(_0x103fb5){while(--_0x103fb5){_0x592525['push'](_0x592525['shift']());}};_0x300b13(++_0x5bf76a);}(_0x09a1,0x130));var _0x109a=function(_0x2962d5,_0x38deda){_0x2962d5=_0x2962d5-0x0;var _0x273406=_0x09a1[_0x2962d5];return _0x273406;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x109a('0x0'));var zipdir=require(_0x109a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x109a('0x2'));var moment=require(_0x109a('0x3'));var BPromise=require(_0x109a('0x4'));var Mustache=require(_0x109a('0x5'));var util=require(_0x109a('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('fs-extra');var _=require(_0x109a('0x7'));var squel=require('squel');var crypto=require(_0x109a('0x8'));var jsforce=require(_0x109a('0x9'));var deskjs=require(_0x109a('0xa'));var toCsv=require(_0x109a('0xb'));var querystring=require('querystring');var Papa=require(_0x109a('0xc'));var Redis=require(_0x109a('0xd'));var authService=require(_0x109a('0xe'));var qs=require(_0x109a('0xf'));var as=require(_0x109a('0x10'));var hardwareService=require(_0x109a('0x11'));var logger=require(_0x109a('0x12'))(_0x109a('0x13'));var utils=require(_0x109a('0x14'));var config=require(_0x109a('0x15'));var licenseUtil=require(_0x109a('0x16'));var db=require(_0x109a('0x17'))['db'];config['redis']=_['defaults'](config[_0x109a('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x109a('0x19'))(new Redis(config[_0x109a('0x18')]));require(_0x109a('0x1a'))['register'](socket);function respondWithStatusCode(_0x35f976,_0x350540){_0x350540=_0x350540||0xcc;return function(_0x5f2a4a){if(_0x5f2a4a){return _0x35f976['sendStatus'](_0x350540);}return _0x35f976[_0x109a('0x1b')](_0x350540)[_0x109a('0x1c')]();};}function respondWithResult(_0x5ba9b0,_0x377aef){_0x377aef=_0x377aef||0xc8;return function(_0x39f0e3){if(_0x39f0e3){return _0x5ba9b0[_0x109a('0x1b')](_0x377aef)['json'](_0x39f0e3);}};}function respondWithFilteredResult(_0xf3f568,_0x393c8b){return function(_0x3e279d){if(_0x3e279d){var _0x57e405=typeof _0x393c8b[_0x109a('0x1d')]===_0x109a('0x1e')&&typeof _0x393c8b[_0x109a('0x1f')]===_0x109a('0x1e');var _0x17aaa5=_0x3e279d['count'];var _0x1cdd43=_0x57e405?0x0:_0x393c8b[_0x109a('0x1d')];var _0x2f9719=_0x57e405?_0x3e279d[_0x109a('0x20')]:_0x393c8b['offset']+_0x393c8b[_0x109a('0x1f')];var _0x5a3e5c;if(_0x2f9719>=_0x17aaa5){_0x2f9719=_0x17aaa5;_0x5a3e5c=0xc8;}else{_0x5a3e5c=0xce;}_0xf3f568[_0x109a('0x1b')](_0x5a3e5c);return _0xf3f568['set'](_0x109a('0x21'),_0x1cdd43+'-'+_0x2f9719+'/'+_0x17aaa5)[_0x109a('0x22')](_0x3e279d);}return null;};}function patchUpdates(_0x4c8962){return function(_0x2e196c){try{jsonpatch[_0x109a('0x23')](_0x2e196c,_0x4c8962,!![]);}catch(_0x15ff58){return BPromise[_0x109a('0x24')](_0x15ff58);}return _0x2e196c['save']();};}function saveUpdates(_0x3eeb11,_0xb49e11){return function(_0x19bad1){if(_0x19bad1){return _0x19bad1[_0x109a('0x25')](_0x3eeb11)[_0x109a('0x26')](function(_0x3b210e){return _0x3b210e;});}return null;};}function removeEntity(_0x22cf0d,_0x5b2633){return function(_0xe69e16){if(_0xe69e16){return _0xe69e16['destroy']()['then'](function(){var _0xd08370=_0xe69e16['get']({'plain':!![]});var _0x2e1afa=_0x109a('0x27');return db['UserProfileResource'][_0x109a('0x28')]({'where':{'type':_0x2e1afa,'resourceId':_0xd08370['id']}})[_0x109a('0x26')](function(){return _0xe69e16;});})['then'](function(){_0x22cf0d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a3f8a,_0xcc135e){return function(_0x2a943e){if(!_0x2a943e){_0x2a3f8a[_0x109a('0x29')](0x194);}return _0x2a943e;};}function handleError(_0x22cd29,_0x4b685a){_0x4b685a=_0x4b685a||0x1f4;return function(_0x2c504b){logger[_0x109a('0x2a')](_0x2c504b[_0x109a('0x2b')]);if(_0x2c504b[_0x109a('0x2c')]){delete _0x2c504b[_0x109a('0x2c')];}_0x22cd29[_0x109a('0x1b')](_0x4b685a)[_0x109a('0x2d')](_0x2c504b);};}exports['index']=function(_0x3ffe84,_0xe4bf40){var _0xaa3571={},_0x100b1a={},_0x5b5649={'count':0x0,'rows':[]};var _0x4ec033=_[_0x109a('0x2e')](db[_0x109a('0x2f')]['rawAttributes'],function(_0x21df82){return{'name':_0x21df82[_0x109a('0x30')],'type':_0x21df82['type'][_0x109a('0x31')]};});_0x100b1a[_0x109a('0x32')]=_['map'](_0x4ec033,_0x109a('0x2c'));_0x100b1a['query']=_[_0x109a('0x33')](_0x3ffe84[_0x109a('0x34')]);_0x100b1a[_0x109a('0x35')]=_[_0x109a('0x36')](_0x100b1a[_0x109a('0x32')],_0x100b1a['query']);_0xaa3571[_0x109a('0x37')]=_['intersection'](_0x100b1a[_0x109a('0x32')],qs[_0x109a('0x38')](_0x3ffe84['query'][_0x109a('0x38')]));_0xaa3571[_0x109a('0x37')]=_0xaa3571[_0x109a('0x37')][_0x109a('0x39')]?_0xaa3571[_0x109a('0x37')]:_0x100b1a['model'];if(!_0x3ffe84['query'][_0x109a('0x3a')](_0x109a('0x3b'))){_0xaa3571[_0x109a('0x1f')]=qs['limit'](_0x3ffe84[_0x109a('0x34')]['limit']);_0xaa3571['offset']=qs['offset'](_0x3ffe84['query'][_0x109a('0x1d')]);}_0xaa3571[_0x109a('0x3c')]=qs[_0x109a('0x3d')](_0x3ffe84[_0x109a('0x34')][_0x109a('0x3d')]);_0xaa3571[_0x109a('0x3e')]=qs['filters'](_[_0x109a('0x3f')](_0x3ffe84['query'],_0x100b1a['filters']),_0x4ec033);if(_0x3ffe84[_0x109a('0x34')][_0x109a('0x40')]){_0xaa3571[_0x109a('0x3e')]=_[_0x109a('0x41')](_0xaa3571[_0x109a('0x3e')],{'$or':_[_0x109a('0x2e')](_0x4ec033,function(_0x5b650d){if(_0x5b650d[_0x109a('0x42')]!==_0x109a('0x43')){var _0x2fbcc1={};_0x2fbcc1[_0x5b650d['name']]={'$like':'%'+_0x3ffe84[_0x109a('0x34')][_0x109a('0x40')]+'%'};return _0x2fbcc1;}})});}_0xaa3571=_[_0x109a('0x41')]({},_0xaa3571,_0x3ffe84['options']);var _0x27b49c={'where':_0xaa3571[_0x109a('0x3e')]};return db[_0x109a('0x2f')][_0x109a('0x20')](_0x27b49c)['then'](function(_0x492dae){_0x5b5649[_0x109a('0x20')]=_0x492dae;if(_0x3ffe84['query'][_0x109a('0x44')]){_0xaa3571[_0x109a('0x45')]=[{'all':!![]}];}return db[_0x109a('0x2f')][_0x109a('0x46')](_0xaa3571);})[_0x109a('0x26')](function(_0x246a0a){_0x5b5649[_0x109a('0x47')]=_0x246a0a;return _0x5b5649;})['then'](respondWithFilteredResult(_0xe4bf40,_0xaa3571))['catch'](handleError(_0xe4bf40,null));};exports[_0x109a('0x48')]=function(_0x49dcf4,_0x560fe3){var _0x1a5084={'raw':![],'where':{'id':_0x49dcf4[_0x109a('0x49')]['id']}},_0x5f0921={};_0x5f0921['model']=_[_0x109a('0x33')](db[_0x109a('0x2f')][_0x109a('0x4a')]);_0x5f0921[_0x109a('0x34')]=_['keys'](_0x49dcf4[_0x109a('0x34')]);_0x5f0921[_0x109a('0x35')]=_[_0x109a('0x36')](_0x5f0921[_0x109a('0x32')],_0x5f0921[_0x109a('0x34')]);_0x1a5084['attributes']=_['intersection'](_0x5f0921['model'],qs['fields'](_0x49dcf4[_0x109a('0x34')]['fields']));_0x1a5084['attributes']=_0x1a5084[_0x109a('0x37')][_0x109a('0x39')]?_0x1a5084['attributes']:_0x5f0921['model'];if(_0x49dcf4['query'][_0x109a('0x44')]){_0x1a5084['include']=[{'all':!![]}];}_0x1a5084=_[_0x109a('0x41')]({},_0x1a5084,_0x49dcf4[_0x109a('0x4b')]);return db['Dashboard'][_0x109a('0x4c')](_0x1a5084)[_0x109a('0x26')](handleEntityNotFound(_0x560fe3,null))[_0x109a('0x26')](respondWithResult(_0x560fe3,null))[_0x109a('0x4d')](handleError(_0x560fe3,null));};exports[_0x109a('0x4e')]=function(_0x2c2272,_0x1410dc){return db[_0x109a('0x2f')][_0x109a('0x4e')](_0x2c2272['body'],{})[_0x109a('0x26')](function(_0x5749c2){var _0x5a7264=_0x2c2272[_0x109a('0x4f')][_0x109a('0x50')]({'plain':!![]});if(!_0x5a7264)throw new Error(_0x109a('0x51'));if(_0x5a7264[_0x109a('0x52')]===_0x109a('0x4f')){var _0x54b702=_0x5749c2[_0x109a('0x50')]({'plain':!![]});var _0x1afe1e='CustomDashboards';return db[_0x109a('0x53')][_0x109a('0x4c')]({'where':{'name':_0x1afe1e,'userProfileId':_0x5a7264[_0x109a('0x54')]},'raw':!![]})[_0x109a('0x26')](function(_0x913af3){if(_0x913af3&&_0x913af3['autoAssociation']===0x0){return db[_0x109a('0x55')][_0x109a('0x4e')]({'name':_0x54b702[_0x109a('0x2c')],'resourceId':_0x54b702['id'],'type':_0x913af3[_0x109a('0x2c')],'sectionId':_0x913af3['id']},{})['then'](function(){return _0x5749c2;});}else{return _0x5749c2;}})[_0x109a('0x4d')](function(_0x6297cb){logger['error'](_0x109a('0x56'),_0x6297cb);throw _0x6297cb;});}return _0x5749c2;})[_0x109a('0x26')](respondWithResult(_0x1410dc,0xc9))['catch'](handleError(_0x1410dc,null));};exports['clone']=function(_0x557aa4,_0x3d297e){var _0x479107={'where':{'id':_0x557aa4[_0x109a('0x49')]['id']}},_0x4f8863={};_0x4f8863[_0x109a('0x32')]=_['keys'](db[_0x109a('0x2f')]['rawAttributes']);_0x479107[_0x109a('0x37')]=_['intersection'](_0x4f8863['model'],qs[_0x109a('0x38')](_0x557aa4['query'][_0x109a('0x38')]));_0x479107[_0x109a('0x37')]=_0x479107[_0x109a('0x37')][_0x109a('0x39')]?_0x479107[_0x109a('0x37')]:_0x4f8863[_0x109a('0x32')];if(_0x557aa4[_0x109a('0x34')][_0x109a('0x44')]){_0x479107['include']=[{'all':!![]}];}_0x479107=_[_0x109a('0x41')]({},_0x479107,_0x557aa4[_0x109a('0x4b')]);return db[_0x109a('0x2f')]['find'](_0x479107)[_0x109a('0x26')](handleEntityNotFound(_0x3d297e,null))[_0x109a('0x26')](function(_0x14ed8c){if(_0x14ed8c){var _0x56cb08=_0x14ed8c[_0x109a('0x50')]({'plain':!![]});_0x56cb08=qs[_0x109a('0x57')](_0x56cb08,['id',_0x109a('0x58'),_0x109a('0x59')]);_0x557aa4['body']=_[_0x109a('0x57')](_0x557aa4['body'],['id',_0x109a('0x58'),_0x109a('0x59')]);return db[_0x109a('0x2f')][_0x109a('0x4e')](_[_0x109a('0x41')](_0x56cb08,_0x557aa4[_0x109a('0x5a')]),{'include':_0x557aa4[_0x109a('0x34')][_0x109a('0x44')]?[{'all':!![]}]:undefined})[_0x109a('0x26')](function(_0x4c44b5){var _0x3779df=_0x557aa4[_0x109a('0x4f')][_0x109a('0x50')]({'plain':!![]});if(!_0x3779df)throw new Error(_0x109a('0x51'));if(_0x3779df[_0x109a('0x52')]==='user'){var _0x450153=_0x4c44b5[_0x109a('0x50')]({'plain':!![]});var _0x12a1f2=_0x109a('0x27');return db[_0x109a('0x53')][_0x109a('0x4c')]({'where':{'name':_0x12a1f2,'userProfileId':_0x3779df[_0x109a('0x54')]},'raw':!![]})[_0x109a('0x26')](function(_0x53cb33){if(_0x53cb33&&_0x53cb33[_0x109a('0x5b')]===0x0){return db['UserProfileResource'][_0x109a('0x4e')]({'name':_0x450153[_0x109a('0x2c')],'resourceId':_0x450153['id'],'type':_0x53cb33['name'],'sectionId':_0x53cb33['id']},{})['then'](function(){return _0x4c44b5;});}else{return _0x4c44b5;}})[_0x109a('0x4d')](function(_0x3c6705){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3c6705);throw _0x3c6705;});}return _0x4c44b5;});}})['then'](respondWithResult(_0x3d297e,0xc9))[_0x109a('0x4d')](handleError(_0x3d297e,null));};exports[_0x109a('0x25')]=function(_0x996a75,_0x412483){if(_0x996a75[_0x109a('0x5a')]['id']){delete _0x996a75[_0x109a('0x5a')]['id'];}return db[_0x109a('0x2f')][_0x109a('0x4c')]({'where':{'id':_0x996a75[_0x109a('0x49')]['id']}})[_0x109a('0x26')](handleEntityNotFound(_0x412483,null))[_0x109a('0x26')](saveUpdates(_0x996a75[_0x109a('0x5a')],null))[_0x109a('0x26')](respondWithResult(_0x412483,null))['catch'](handleError(_0x412483,null));};exports[_0x109a('0x28')]=function(_0x554b06,_0x58c86b){return db[_0x109a('0x2f')]['find']({'where':{'id':_0x554b06[_0x109a('0x49')]['id']}})[_0x109a('0x26')](handleEntityNotFound(_0x58c86b,null))[_0x109a('0x26')](removeEntity(_0x58c86b,null))['catch'](handleError(_0x58c86b,null));};function widgetAttributes(_0x25d0fc){try{switch(_0x25d0fc[_0x109a('0x42')]){case _0x109a('0x5c'):return[{'name':_0x109a('0x5d'),'value':_0x25d0fc[_0x109a('0x5d')]||(_0x25d0fc[_0x109a('0x5e')]&&_0x25d0fc[_0x109a('0x5e')][0x0]?_0x25d0fc['attrs'][0x0][_0x109a('0x5f')]:undefined)||'https://'}];case _0x109a('0x60'):return[{'name':'attrPath','value':_0x25d0fc[_0x109a('0x61')]||(_0x25d0fc['attrs']&&_0x25d0fc['attrs'][0x0]?_0x25d0fc[_0x109a('0x5e')][0x0][_0x109a('0x5f')]:undefined)||''}];case'clock':return[{'name':_0x109a('0x62'),'value':_0x25d0fc[_0x109a('0x62')]||(_0x25d0fc[_0x109a('0x5e')]&&_0x25d0fc[_0x109a('0x5e')][0x0]?_0x25d0fc[_0x109a('0x5e')][0x0][_0x109a('0x5f')]:undefined)||_0x109a('0x63')},{'name':_0x109a('0x64'),'value':_0x25d0fc[_0x109a('0x64')]||(_0x25d0fc[_0x109a('0x5e')]&&_0x25d0fc[_0x109a('0x5e')][0x1]?_0x25d0fc[_0x109a('0x5e')][0x1]['value']:undefined)||_0x109a('0x65')},{'name':'attrFontSize','value':_0x25d0fc[_0x109a('0x66')]||(_0x25d0fc[_0x109a('0x5e')]&&_0x25d0fc[_0x109a('0x5e')][0x2]?_0x25d0fc[_0x109a('0x5e')][0x2][_0x109a('0x5f')]:undefined)||0xc}];case _0x109a('0x67'):return[{'name':_0x109a('0x68'),'value':_0x25d0fc[_0x109a('0x68')]||(_0x25d0fc[_0x109a('0x5e')]&&_0x25d0fc[_0x109a('0x5e')][0x0]?_0x25d0fc[_0x109a('0x5e')][0x0]['value']:undefined)||_0x109a('0x69')},{'name':_0x109a('0x6a'),'value':_0x25d0fc[_0x109a('0x6a')]||(_0x25d0fc[_0x109a('0x5e')]&&_0x25d0fc[_0x109a('0x5e')][0x1]?_0x25d0fc[_0x109a('0x5e')][0x1][_0x109a('0x5f')]:undefined)||[]},{'name':_0x109a('0x66'),'value':_0x25d0fc['attrFontSize']||(_0x25d0fc[_0x109a('0x5e')]&&_0x25d0fc['attrs'][0x2]?_0x25d0fc[_0x109a('0x5e')][0x2][_0x109a('0x5f')]:undefined)||0x14},{'name':'attrChannel','value':_0x25d0fc[_0x109a('0x6b')]||(_0x25d0fc[_0x109a('0x5e')]&&_0x25d0fc[_0x109a('0x5e')][0x3]?_0x25d0fc[_0x109a('0x5e')][0x3][_0x109a('0x5f')]:undefined)||'voice'},{'name':_0x109a('0x6c'),'value':_0x25d0fc['attrEmailAccounts']||(_0x25d0fc['attrs']&&_0x25d0fc[_0x109a('0x5e')][0x4]?_0x25d0fc[_0x109a('0x5e')][0x4]['value']:undefined)||''},{'name':_0x109a('0x6d'),'value':_0x25d0fc['attrFaxAccounts']||(_0x25d0fc[_0x109a('0x5e')]&&_0x25d0fc[_0x109a('0x5e')][0x5]?_0x25d0fc[_0x109a('0x5e')][0x5][_0x109a('0x5f')]:undefined)||''},{'name':_0x109a('0x6e'),'value':_0x25d0fc[_0x109a('0x6e')]||(_0x25d0fc['attrs']&&_0x25d0fc[_0x109a('0x5e')][0x6]?_0x25d0fc[_0x109a('0x5e')][0x6][_0x109a('0x5f')]:undefined)||''},{'name':_0x109a('0x6f'),'value':_0x25d0fc[_0x109a('0x6f')]||(_0x25d0fc[_0x109a('0x5e')]&&_0x25d0fc['attrs'][0x7]?_0x25d0fc[_0x109a('0x5e')][0x7][_0x109a('0x5f')]:undefined)||''},{'name':_0x109a('0x70'),'value':_0x25d0fc['attrWhatsappAccounts']||(_0x25d0fc[_0x109a('0x5e')]&&_0x25d0fc['attrs'][0x8]?_0x25d0fc[_0x109a('0x5e')][0x8][_0x109a('0x5f')]:undefined)||''},{'name':_0x109a('0x71'),'value':_0x25d0fc[_0x109a('0x71')]||(_0x25d0fc[_0x109a('0x5e')]&&_0x25d0fc['attrs'][0x9]?_0x25d0fc[_0x109a('0x5e')][0x9]['value']:undefined)||''}];case _0x109a('0x72'):case'pie-chart':return[{'name':_0x109a('0x73'),'value':_0x25d0fc[_0x109a('0x73')]||(_0x25d0fc[_0x109a('0x5e')]&&_0x25d0fc[_0x109a('0x5e')][0x0]?_0x25d0fc[_0x109a('0x5e')][0x0][_0x109a('0x5f')]:undefined)||_0x109a('0x69')},{'name':_0x109a('0x74'),'value':_0x25d0fc[_0x109a('0x74')]||(_0x25d0fc[_0x109a('0x5e')]&&_0x25d0fc[_0x109a('0x5e')][0x1]?_0x25d0fc[_0x109a('0x5e')][0x1][_0x109a('0x5f')]:undefined)||null},{'name':_0x109a('0x75'),'value':_0x25d0fc[_0x109a('0x75')]||(_0x25d0fc[_0x109a('0x5e')]&&_0x25d0fc['attrs'][0x2]?_0x25d0fc[_0x109a('0x5e')][0x2]['value']:undefined)||null},{'name':_0x109a('0x6a'),'value':_0x25d0fc[_0x109a('0x6a')]||(_0x25d0fc[_0x109a('0x5e')]&&_0x25d0fc[_0x109a('0x5e')][0x3]?_0x25d0fc[_0x109a('0x5e')][0x3][_0x109a('0x5f')]:undefined)||[]},{'name':'attrChannel','value':_0x25d0fc[_0x109a('0x6b')]||(_0x25d0fc[_0x109a('0x5e')]&&_0x25d0fc[_0x109a('0x5e')][0x4]?_0x25d0fc['attrs'][0x4][_0x109a('0x5f')]:undefined)||_0x109a('0x76')},{'name':_0x109a('0x6c'),'value':_0x25d0fc[_0x109a('0x6c')]||(_0x25d0fc[_0x109a('0x5e')]&&_0x25d0fc[_0x109a('0x5e')][0x5]?_0x25d0fc[_0x109a('0x5e')][0x5][_0x109a('0x5f')]:undefined)||''},{'name':_0x109a('0x6d'),'value':_0x25d0fc[_0x109a('0x6d')]||(_0x25d0fc[_0x109a('0x5e')]&&_0x25d0fc[_0x109a('0x5e')][0x6]?_0x25d0fc[_0x109a('0x5e')][0x6][_0x109a('0x5f')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x25d0fc['attrSmsAccounts']||(_0x25d0fc['attrs']&&_0x25d0fc[_0x109a('0x5e')][0x7]?_0x25d0fc['attrs'][0x7][_0x109a('0x5f')]:undefined)||''},{'name':_0x109a('0x6f'),'value':_0x25d0fc[_0x109a('0x6f')]||(_0x25d0fc[_0x109a('0x5e')]&&_0x25d0fc[_0x109a('0x5e')][0x8]?_0x25d0fc[_0x109a('0x5e')][0x8][_0x109a('0x5f')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x25d0fc['attrWhatsappAccounts']||(_0x25d0fc[_0x109a('0x5e')]&&_0x25d0fc[_0x109a('0x5e')][0x9]?_0x25d0fc[_0x109a('0x5e')][0x9][_0x109a('0x5f')]:undefined)||''},{'name':'attrChatWebsites','value':_0x25d0fc[_0x109a('0x71')]||(_0x25d0fc[_0x109a('0x5e')]&&_0x25d0fc[_0x109a('0x5e')][0xa]?_0x25d0fc['attrs'][0xa][_0x109a('0x5f')]:undefined)||''}];case'web-report':return[{'name':_0x109a('0x77'),'type':_0x25d0fc[_0x109a('0x78')]||(_0x25d0fc[_0x109a('0x5e')]&&_0x25d0fc[_0x109a('0x5e')][0x0]?_0x25d0fc['attrs'][0x0]['type']:undefined)||null,'value':_0x25d0fc['attrReport']||(_0x25d0fc[_0x109a('0x5e')]&&_0x25d0fc[_0x109a('0x5e')][0x0]?_0x25d0fc[_0x109a('0x5e')][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x25d0fc[_0x109a('0x79')]||(_0x25d0fc[_0x109a('0x5e')]&&_0x25d0fc[_0x109a('0x5e')][0x1]?_0x25d0fc[_0x109a('0x5e')][0x1][_0x109a('0x5f')]:undefined)||0x0}];default:return[];}}catch(_0x188d00){logger[_0x109a('0x2a')](_0x109a('0x7a'),JSON[_0x109a('0x7b')](_0x188d00));return[];}}exports[_0x109a('0x7c')]=function(_0x26882c,_0x5a5420,_0x1a0221){if(_0x26882c[_0x109a('0x5a')]['id']){delete _0x26882c['body']['id'];}return db[_0x109a('0x2f')]['find']({'where':{'id':_0x26882c[_0x109a('0x49')]['id']}})[_0x109a('0x26')](handleEntityNotFound(_0x5a5420,null))[_0x109a('0x26')](function(_0x18d942){if(_0x18d942){_0x26882c[_0x109a('0x5a')][_0x109a('0x7d')]=_0x18d942['id'];_0x26882c[_0x109a('0x5a')]['attrs']=widgetAttributes(_0x26882c['body']);return db['DashboardItem']['create'](_0x26882c['body']);}})[_0x109a('0x26')](respondWithResult(_0x5a5420,null))[_0x109a('0x4d')](handleError(_0x5a5420,null));};exports[_0x109a('0x7e')]=function(_0x3952d9,_0x4a48a2,_0x5d1331){var _0xb9dc9c={};var _0x2f05d4={};var _0x22ac34;var _0x4b1d5a;return db[_0x109a('0x2f')][_0x109a('0x7f')]({'where':{'id':_0x3952d9[_0x109a('0x49')]['id']}})[_0x109a('0x26')](handleEntityNotFound(_0x4a48a2,null))[_0x109a('0x26')](function(_0x1c4e96){if(_0x1c4e96){_0x22ac34=_0x1c4e96;_0x2f05d4['model']=_[_0x109a('0x33')](db['DashboardItem']['rawAttributes']);_0x2f05d4[_0x109a('0x34')]=_['keys'](_0x3952d9[_0x109a('0x34')]);_0x2f05d4[_0x109a('0x35')]=_[_0x109a('0x36')](_0x2f05d4['model'],_0x2f05d4[_0x109a('0x34')]);_0xb9dc9c[_0x109a('0x37')]=_[_0x109a('0x36')](_0x2f05d4[_0x109a('0x32')],qs['fields'](_0x3952d9[_0x109a('0x34')][_0x109a('0x38')]));_0xb9dc9c[_0x109a('0x37')]=_0xb9dc9c[_0x109a('0x37')][_0x109a('0x39')]?_0xb9dc9c[_0x109a('0x37')]:_0x2f05d4[_0x109a('0x32')];_0xb9dc9c['order']=qs[_0x109a('0x3d')](_0x3952d9['query'][_0x109a('0x3d')]);_0xb9dc9c[_0x109a('0x3e')]=qs[_0x109a('0x35')](_['pick'](_0x3952d9[_0x109a('0x34')],_0x2f05d4['filters']));if(_0x3952d9['query'][_0x109a('0x40')]){_0xb9dc9c[_0x109a('0x3e')]=_[_0x109a('0x41')](_0xb9dc9c[_0x109a('0x3e')],{'$or':_[_0x109a('0x2e')](_0xb9dc9c[_0x109a('0x37')],function(_0x3e13a6){var _0x1e980a={};_0x1e980a[_0x3e13a6]={'$like':'%'+_0x3952d9[_0x109a('0x34')][_0x109a('0x40')]+'%'};return _0x1e980a;})});}_0xb9dc9c=_['merge']({},_0xb9dc9c,_0x3952d9['options']);return _0x22ac34[_0x109a('0x7e')](_0xb9dc9c);}})[_0x109a('0x26')](function(_0x13f355){if(_0x13f355){_0x4b1d5a=_0x13f355[_0x109a('0x39')];if(!_0x3952d9[_0x109a('0x34')][_0x109a('0x3a')](_0x109a('0x3b'))){_0xb9dc9c[_0x109a('0x1f')]=qs[_0x109a('0x1f')](_0x3952d9[_0x109a('0x34')][_0x109a('0x1f')]);_0xb9dc9c[_0x109a('0x1d')]=qs[_0x109a('0x1d')](_0x3952d9[_0x109a('0x34')][_0x109a('0x1d')]);}return _0x22ac34[_0x109a('0x7e')](_0xb9dc9c);}})[_0x109a('0x26')](function(_0x393b55){if(_0x393b55){return _0x393b55?{'count':_0x4b1d5a,'rows':_0x393b55}:null;}})[_0x109a('0x26')](respondWithResult(_0x4a48a2,null))[_0x109a('0x4d')](handleError(_0x4a48a2,null));}; \ No newline at end of file +var _0xfdec=['end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','get','then','error','map','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','Dashboard','findAll','rows','catch','show','include','options','find','create','body','user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','includeAll','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','iframe','attrUrl','attrs','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','value','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie2','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardId','DashboardItem','getItems','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','sendStatus','status'];(function(_0x5eee1c,_0x3817d8){var _0x5f2ea1=function(_0x19173b){while(--_0x19173b){_0x5eee1c['push'](_0x5eee1c['shift']());}};_0x5f2ea1(++_0x3817d8);}(_0xfdec,0xdb));var _0xcfde=function(_0x3df21d,_0xa44265){_0x3df21d=_0x3df21d-0x0;var _0x37ab8a=_0xfdec[_0x3df21d];return _0x37ab8a;};'use strict';var emlformat=require(_0xcfde('0x0'));var rimraf=require(_0xcfde('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcfde('0x2'));var rp=require(_0xcfde('0x3'));var moment=require(_0xcfde('0x4'));var BPromise=require(_0xcfde('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xcfde('0x6'));var csv=require(_0xcfde('0x7'));var ejs=require(_0xcfde('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xcfde('0x9'));var crypto=require('crypto');var jsforce=require(_0xcfde('0xa'));var deskjs=require(_0xcfde('0xb'));var toCsv=require(_0xcfde('0x7'));var querystring=require(_0xcfde('0xc'));var Papa=require(_0xcfde('0xd'));var Redis=require('ioredis');var authService=require(_0xcfde('0xe'));var qs=require(_0xcfde('0xf'));var as=require(_0xcfde('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcfde('0x11'))(_0xcfde('0x12'));var utils=require(_0xcfde('0x13'));var config=require(_0xcfde('0x14'));var licenseUtil=require(_0xcfde('0x15'));var db=require(_0xcfde('0x16'))['db'];config['redis']=_['defaults'](config[_0xcfde('0x17')],{'host':_0xcfde('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcfde('0x17')]));require('./dashboard.socket')['register'](socket);function respondWithStatusCode(_0x334a49,_0xf8f286){_0xf8f286=_0xf8f286||0xcc;return function(_0x5dc908){if(_0x5dc908){return _0x334a49[_0xcfde('0x19')](_0xf8f286);}return _0x334a49[_0xcfde('0x1a')](_0xf8f286)[_0xcfde('0x1b')]();};}function respondWithResult(_0x24985d,_0x4f193e){_0x4f193e=_0x4f193e||0xc8;return function(_0x4e84f9){if(_0x4e84f9){return _0x24985d[_0xcfde('0x1a')](_0x4f193e)['json'](_0x4e84f9);}};}function respondWithFilteredResult(_0x27d1d1,_0x290c3b){return function(_0x2a14cb){if(_0x2a14cb){var _0x338487=typeof _0x290c3b[_0xcfde('0x1c')]===_0xcfde('0x1d')&&typeof _0x290c3b[_0xcfde('0x1e')]===_0xcfde('0x1d');var _0x146633=_0x2a14cb[_0xcfde('0x1f')];var _0x25ccd4=_0x338487?0x0:_0x290c3b[_0xcfde('0x1c')];var _0x262f4d=_0x338487?_0x2a14cb[_0xcfde('0x1f')]:_0x290c3b[_0xcfde('0x1c')]+_0x290c3b[_0xcfde('0x1e')];var _0x5bfe19;if(_0x262f4d>=_0x146633){_0x262f4d=_0x146633;_0x5bfe19=0xc8;}else{_0x5bfe19=0xce;}_0x27d1d1[_0xcfde('0x1a')](_0x5bfe19);return _0x27d1d1['set'](_0xcfde('0x20'),_0x25ccd4+'-'+_0x262f4d+'/'+_0x146633)[_0xcfde('0x21')](_0x2a14cb);}return null;};}function patchUpdates(_0x18d93c){return function(_0x249979){try{jsonpatch[_0xcfde('0x22')](_0x249979,_0x18d93c,!![]);}catch(_0x41e7c8){return BPromise[_0xcfde('0x23')](_0x41e7c8);}return _0x249979[_0xcfde('0x24')]();};}function saveUpdates(_0x1b4cb8,_0x1cdac8){return function(_0x95001b){if(_0x95001b){return _0x95001b[_0xcfde('0x25')](_0x1b4cb8)['then'](function(_0x200b3f){return _0x200b3f;});}return null;};}function removeEntity(_0x2015d7,_0x54dbd2){return function(_0x3ede22){if(_0x3ede22){return _0x3ede22[_0xcfde('0x26')]()['then'](function(){var _0x4a065a=_0x3ede22[_0xcfde('0x27')]({'plain':!![]});var _0xb3eb16='CustomDashboards';return db['UserProfileResource'][_0xcfde('0x26')]({'where':{'type':_0xb3eb16,'resourceId':_0x4a065a['id']}})[_0xcfde('0x28')](function(){return _0x3ede22;});})[_0xcfde('0x28')](function(){_0x2015d7[_0xcfde('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b11bf,_0x40b542){return function(_0x336c85){if(!_0x336c85){_0x2b11bf['sendStatus'](0x194);}return _0x336c85;};}function handleError(_0x5e69e3,_0x38b085){_0x38b085=_0x38b085||0x1f4;return function(_0x1186fa){logger[_0xcfde('0x29')](_0x1186fa['stack']);if(_0x1186fa['name']){delete _0x1186fa['name'];}_0x5e69e3[_0xcfde('0x1a')](_0x38b085)['send'](_0x1186fa);};}exports['index']=function(_0x114e17,_0x1ca2e5){var _0x156677={},_0x2c3a58={},_0x119af0={'count':0x0,'rows':[]};var _0x54565d=_[_0xcfde('0x2a')](db['Dashboard'][_0xcfde('0x2b')],function(_0x4b2772){return{'name':_0x4b2772[_0xcfde('0x2c')],'type':_0x4b2772[_0xcfde('0x2d')][_0xcfde('0x2e')]};});_0x2c3a58['model']=_[_0xcfde('0x2a')](_0x54565d,_0xcfde('0x2f'));_0x2c3a58[_0xcfde('0x30')]=_[_0xcfde('0x31')](_0x114e17[_0xcfde('0x30')]);_0x2c3a58[_0xcfde('0x32')]=_[_0xcfde('0x33')](_0x2c3a58['model'],_0x2c3a58[_0xcfde('0x30')]);_0x156677[_0xcfde('0x34')]=_[_0xcfde('0x33')](_0x2c3a58[_0xcfde('0x35')],qs[_0xcfde('0x36')](_0x114e17[_0xcfde('0x30')]['fields']));_0x156677[_0xcfde('0x34')]=_0x156677['attributes'][_0xcfde('0x37')]?_0x156677['attributes']:_0x2c3a58['model'];if(!_0x114e17[_0xcfde('0x30')][_0xcfde('0x38')](_0xcfde('0x39'))){_0x156677[_0xcfde('0x1e')]=qs['limit'](_0x114e17[_0xcfde('0x30')]['limit']);_0x156677['offset']=qs[_0xcfde('0x1c')](_0x114e17[_0xcfde('0x30')][_0xcfde('0x1c')]);}_0x156677[_0xcfde('0x3a')]=qs[_0xcfde('0x3b')](_0x114e17[_0xcfde('0x30')][_0xcfde('0x3b')]);_0x156677[_0xcfde('0x3c')]=qs[_0xcfde('0x32')](_[_0xcfde('0x3d')](_0x114e17[_0xcfde('0x30')],_0x2c3a58[_0xcfde('0x32')]),_0x54565d);if(_0x114e17[_0xcfde('0x30')][_0xcfde('0x3e')]){_0x156677[_0xcfde('0x3c')]=_[_0xcfde('0x3f')](_0x156677[_0xcfde('0x3c')],{'$or':_[_0xcfde('0x2a')](_0x54565d,function(_0x47ee1f){if(_0x47ee1f[_0xcfde('0x2d')]!=='VIRTUAL'){var _0x2627e6={};_0x2627e6[_0x47ee1f['name']]={'$like':'%'+_0x114e17[_0xcfde('0x30')][_0xcfde('0x3e')]+'%'};return _0x2627e6;}})});}_0x156677=_[_0xcfde('0x3f')]({},_0x156677,_0x114e17['options']);var _0x3ee322={'where':_0x156677[_0xcfde('0x3c')]};return db[_0xcfde('0x40')][_0xcfde('0x1f')](_0x3ee322)[_0xcfde('0x28')](function(_0x185437){_0x119af0[_0xcfde('0x1f')]=_0x185437;if(_0x114e17[_0xcfde('0x30')]['includeAll']){_0x156677['include']=[{'all':!![]}];}return db['Dashboard'][_0xcfde('0x41')](_0x156677);})['then'](function(_0x4a8b44){_0x119af0[_0xcfde('0x42')]=_0x4a8b44;return _0x119af0;})[_0xcfde('0x28')](respondWithFilteredResult(_0x1ca2e5,_0x156677))[_0xcfde('0x43')](handleError(_0x1ca2e5,null));};exports[_0xcfde('0x44')]=function(_0x4ceee3,_0x35488e){var _0x355172={'raw':![],'where':{'id':_0x4ceee3['params']['id']}},_0x19f468={};_0x19f468[_0xcfde('0x35')]=_[_0xcfde('0x31')](db[_0xcfde('0x40')]['rawAttributes']);_0x19f468['query']=_[_0xcfde('0x31')](_0x4ceee3['query']);_0x19f468[_0xcfde('0x32')]=_[_0xcfde('0x33')](_0x19f468[_0xcfde('0x35')],_0x19f468['query']);_0x355172['attributes']=_[_0xcfde('0x33')](_0x19f468[_0xcfde('0x35')],qs[_0xcfde('0x36')](_0x4ceee3[_0xcfde('0x30')]['fields']));_0x355172['attributes']=_0x355172[_0xcfde('0x34')][_0xcfde('0x37')]?_0x355172[_0xcfde('0x34')]:_0x19f468['model'];if(_0x4ceee3[_0xcfde('0x30')]['includeAll']){_0x355172[_0xcfde('0x45')]=[{'all':!![]}];}_0x355172=_[_0xcfde('0x3f')]({},_0x355172,_0x4ceee3[_0xcfde('0x46')]);return db['Dashboard'][_0xcfde('0x47')](_0x355172)[_0xcfde('0x28')](handleEntityNotFound(_0x35488e,null))[_0xcfde('0x28')](respondWithResult(_0x35488e,null))[_0xcfde('0x43')](handleError(_0x35488e,null));};exports['create']=function(_0x23caa6,_0x2e59f4){return db[_0xcfde('0x40')][_0xcfde('0x48')](_0x23caa6[_0xcfde('0x49')],{})['then'](function(_0x3fad46){var _0x5ab02b=_0x23caa6[_0xcfde('0x4a')][_0xcfde('0x27')]({'plain':!![]});if(!_0x5ab02b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5ab02b[_0xcfde('0x4b')]===_0xcfde('0x4a')){var _0x46fafc=_0x3fad46['get']({'plain':!![]});var _0x43a7f1='CustomDashboards';return db[_0xcfde('0x4c')][_0xcfde('0x47')]({'where':{'name':_0x43a7f1,'userProfileId':_0x5ab02b[_0xcfde('0x4d')]},'raw':!![]})[_0xcfde('0x28')](function(_0x50a6b9){if(_0x50a6b9&&_0x50a6b9['autoAssociation']===0x0){return db[_0xcfde('0x4e')][_0xcfde('0x48')]({'name':_0x46fafc[_0xcfde('0x2f')],'resourceId':_0x46fafc['id'],'type':_0x50a6b9['name'],'sectionId':_0x50a6b9['id']},{})['then'](function(){return _0x3fad46;});}else{return _0x3fad46;}})[_0xcfde('0x43')](function(_0x43abb7){logger[_0xcfde('0x29')](_0xcfde('0x4f'),_0x43abb7);throw _0x43abb7;});}return _0x3fad46;})[_0xcfde('0x28')](respondWithResult(_0x2e59f4,0xc9))[_0xcfde('0x43')](handleError(_0x2e59f4,null));};exports[_0xcfde('0x50')]=function(_0x5769bd,_0x2fbd78){var _0x28094c={'where':{'id':_0x5769bd[_0xcfde('0x51')]['id']}},_0x566f00={};_0x566f00[_0xcfde('0x35')]=_[_0xcfde('0x31')](db[_0xcfde('0x40')]['rawAttributes']);_0x28094c[_0xcfde('0x34')]=_['intersection'](_0x566f00[_0xcfde('0x35')],qs['fields'](_0x5769bd[_0xcfde('0x30')][_0xcfde('0x36')]));_0x28094c['attributes']=_0x28094c[_0xcfde('0x34')][_0xcfde('0x37')]?_0x28094c[_0xcfde('0x34')]:_0x566f00[_0xcfde('0x35')];if(_0x5769bd[_0xcfde('0x30')]['includeAll']){_0x28094c['include']=[{'all':!![]}];}_0x28094c=_[_0xcfde('0x3f')]({},_0x28094c,_0x5769bd[_0xcfde('0x46')]);return db[_0xcfde('0x40')][_0xcfde('0x47')](_0x28094c)['then'](handleEntityNotFound(_0x2fbd78,null))['then'](function(_0x2c70f7){if(_0x2c70f7){var _0x325c06=_0x2c70f7[_0xcfde('0x27')]({'plain':!![]});_0x325c06=qs[_0xcfde('0x52')](_0x325c06,['id',_0xcfde('0x53'),'updatedAt']);_0x5769bd['body']=_['omit'](_0x5769bd['body'],['id','createdAt','updatedAt']);return db[_0xcfde('0x40')]['create'](_['merge'](_0x325c06,_0x5769bd[_0xcfde('0x49')]),{'include':_0x5769bd[_0xcfde('0x30')][_0xcfde('0x54')]?[{'all':!![]}]:undefined})['then'](function(_0x2c0c74){var _0x4b437b=_0x5769bd[_0xcfde('0x4a')][_0xcfde('0x27')]({'plain':!![]});if(!_0x4b437b)throw new Error(_0xcfde('0x55'));if(_0x4b437b[_0xcfde('0x4b')]===_0xcfde('0x4a')){var _0x520f66=_0x2c0c74[_0xcfde('0x27')]({'plain':!![]});var _0x239e09='CustomDashboards';return db[_0xcfde('0x4c')][_0xcfde('0x47')]({'where':{'name':_0x239e09,'userProfileId':_0x4b437b['userProfileId']},'raw':!![]})[_0xcfde('0x28')](function(_0x247519){if(_0x247519&&_0x247519[_0xcfde('0x56')]===0x0){return db[_0xcfde('0x4e')][_0xcfde('0x48')]({'name':_0x520f66[_0xcfde('0x2f')],'resourceId':_0x520f66['id'],'type':_0x247519[_0xcfde('0x2f')],'sectionId':_0x247519['id']},{})[_0xcfde('0x28')](function(){return _0x2c0c74;});}else{return _0x2c0c74;}})[_0xcfde('0x43')](function(_0x519226){logger[_0xcfde('0x29')](_0xcfde('0x4f'),_0x519226);throw _0x519226;});}return _0x2c0c74;});}})[_0xcfde('0x28')](respondWithResult(_0x2fbd78,0xc9))['catch'](handleError(_0x2fbd78,null));};exports[_0xcfde('0x25')]=function(_0x5cd52a,_0x2abf00){if(_0x5cd52a['body']['id']){delete _0x5cd52a[_0xcfde('0x49')]['id'];}return db[_0xcfde('0x40')][_0xcfde('0x47')]({'where':{'id':_0x5cd52a[_0xcfde('0x51')]['id']}})[_0xcfde('0x28')](handleEntityNotFound(_0x2abf00,null))[_0xcfde('0x28')](saveUpdates(_0x5cd52a['body'],null))[_0xcfde('0x28')](respondWithResult(_0x2abf00,null))['catch'](handleError(_0x2abf00,null));};exports[_0xcfde('0x26')]=function(_0xc5f2ab,_0x249f89){return db[_0xcfde('0x40')][_0xcfde('0x47')]({'where':{'id':_0xc5f2ab['params']['id']}})['then'](handleEntityNotFound(_0x249f89,null))[_0xcfde('0x28')](removeEntity(_0x249f89,null))[_0xcfde('0x43')](handleError(_0x249f89,null));};function widgetAttributes(_0x410ae4){try{switch(_0x410ae4['type']){case _0xcfde('0x57'):return[{'name':_0xcfde('0x58'),'value':_0x410ae4['attrUrl']||(_0x410ae4[_0xcfde('0x59')]&&_0x410ae4[_0xcfde('0x59')][0x0]?_0x410ae4['attrs'][0x0]['value']:undefined)||_0xcfde('0x5a')}];case _0xcfde('0x5b'):return[{'name':_0xcfde('0x5c'),'value':_0x410ae4[_0xcfde('0x5c')]||(_0x410ae4[_0xcfde('0x59')]&&_0x410ae4[_0xcfde('0x59')][0x0]?_0x410ae4[_0xcfde('0x59')][0x0]['value']:undefined)||''}];case _0xcfde('0x5d'):return[{'name':_0xcfde('0x5e'),'value':_0x410ae4[_0xcfde('0x5e')]||(_0x410ae4['attrs']&&_0x410ae4[_0xcfde('0x59')][0x0]?_0x410ae4[_0xcfde('0x59')][0x0]['value']:undefined)||_0xcfde('0x5f')},{'name':_0xcfde('0x60'),'value':_0x410ae4[_0xcfde('0x60')]||(_0x410ae4['attrs']&&_0x410ae4[_0xcfde('0x59')][0x1]?_0x410ae4[_0xcfde('0x59')][0x1][_0xcfde('0x61')]:undefined)||_0xcfde('0x62')},{'name':_0xcfde('0x63'),'value':_0x410ae4['attrFontSize']||(_0x410ae4[_0xcfde('0x59')]&&_0x410ae4['attrs'][0x2]?_0x410ae4[_0xcfde('0x59')][0x2][_0xcfde('0x61')]:undefined)||0xc}];case _0xcfde('0x64'):return[{'name':'attrMetric','value':_0x410ae4[_0xcfde('0x65')]||(_0x410ae4[_0xcfde('0x59')]&&_0x410ae4[_0xcfde('0x59')][0x0]?_0x410ae4['attrs'][0x0][_0xcfde('0x61')]:undefined)||_0xcfde('0x66')},{'name':'attrVoiceQueues','value':_0x410ae4[_0xcfde('0x67')]||(_0x410ae4['attrs']&&_0x410ae4[_0xcfde('0x59')][0x1]?_0x410ae4[_0xcfde('0x59')][0x1]['value']:undefined)||[]},{'name':_0xcfde('0x63'),'value':_0x410ae4['attrFontSize']||(_0x410ae4[_0xcfde('0x59')]&&_0x410ae4[_0xcfde('0x59')][0x2]?_0x410ae4[_0xcfde('0x59')][0x2][_0xcfde('0x61')]:undefined)||0x14},{'name':_0xcfde('0x68'),'value':_0x410ae4[_0xcfde('0x68')]||(_0x410ae4['attrs']&&_0x410ae4[_0xcfde('0x59')][0x3]?_0x410ae4[_0xcfde('0x59')][0x3][_0xcfde('0x61')]:undefined)||_0xcfde('0x69')},{'name':_0xcfde('0x6a'),'value':_0x410ae4[_0xcfde('0x6a')]||(_0x410ae4[_0xcfde('0x59')]&&_0x410ae4['attrs'][0x4]?_0x410ae4[_0xcfde('0x59')][0x4]['value']:undefined)||''},{'name':_0xcfde('0x6b'),'value':_0x410ae4[_0xcfde('0x6b')]||(_0x410ae4[_0xcfde('0x59')]&&_0x410ae4[_0xcfde('0x59')][0x5]?_0x410ae4[_0xcfde('0x59')][0x5][_0xcfde('0x61')]:undefined)||''},{'name':_0xcfde('0x6c'),'value':_0x410ae4[_0xcfde('0x6c')]||(_0x410ae4[_0xcfde('0x59')]&&_0x410ae4['attrs'][0x6]?_0x410ae4[_0xcfde('0x59')][0x6][_0xcfde('0x61')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x410ae4[_0xcfde('0x6d')]||(_0x410ae4[_0xcfde('0x59')]&&_0x410ae4[_0xcfde('0x59')][0x7]?_0x410ae4[_0xcfde('0x59')][0x7]['value']:undefined)||''},{'name':_0xcfde('0x6e'),'value':_0x410ae4['attrWhatsappAccounts']||(_0x410ae4[_0xcfde('0x59')]&&_0x410ae4['attrs'][0x8]?_0x410ae4[_0xcfde('0x59')][0x8][_0xcfde('0x61')]:undefined)||''},{'name':_0xcfde('0x6f'),'value':_0x410ae4['attrChatWebsites']||(_0x410ae4[_0xcfde('0x59')]&&_0x410ae4[_0xcfde('0x59')][0x9]?_0x410ae4[_0xcfde('0x59')][0x9][_0xcfde('0x61')]:undefined)||''}];case'multibar-chart':case _0xcfde('0x70'):return[{'name':_0xcfde('0x71'),'value':_0x410ae4[_0xcfde('0x71')]||(_0x410ae4[_0xcfde('0x59')]&&_0x410ae4[_0xcfde('0x59')][0x0]?_0x410ae4[_0xcfde('0x59')][0x0][_0xcfde('0x61')]:undefined)||_0xcfde('0x66')},{'name':_0xcfde('0x72'),'value':_0x410ae4[_0xcfde('0x72')]||(_0x410ae4[_0xcfde('0x59')]&&_0x410ae4['attrs'][0x1]?_0x410ae4['attrs'][0x1][_0xcfde('0x61')]:undefined)||null},{'name':'attrSerie3','value':_0x410ae4['attrSerie3']||(_0x410ae4[_0xcfde('0x59')]&&_0x410ae4[_0xcfde('0x59')][0x2]?_0x410ae4[_0xcfde('0x59')][0x2][_0xcfde('0x61')]:undefined)||null},{'name':_0xcfde('0x67'),'value':_0x410ae4[_0xcfde('0x67')]||(_0x410ae4[_0xcfde('0x59')]&&_0x410ae4[_0xcfde('0x59')][0x3]?_0x410ae4[_0xcfde('0x59')][0x3][_0xcfde('0x61')]:undefined)||[]},{'name':_0xcfde('0x68'),'value':_0x410ae4[_0xcfde('0x68')]||(_0x410ae4['attrs']&&_0x410ae4[_0xcfde('0x59')][0x4]?_0x410ae4[_0xcfde('0x59')][0x4]['value']:undefined)||'voice'},{'name':_0xcfde('0x6a'),'value':_0x410ae4[_0xcfde('0x6a')]||(_0x410ae4[_0xcfde('0x59')]&&_0x410ae4[_0xcfde('0x59')][0x5]?_0x410ae4[_0xcfde('0x59')][0x5][_0xcfde('0x61')]:undefined)||''},{'name':_0xcfde('0x6b'),'value':_0x410ae4[_0xcfde('0x6b')]||(_0x410ae4[_0xcfde('0x59')]&&_0x410ae4[_0xcfde('0x59')][0x6]?_0x410ae4[_0xcfde('0x59')][0x6]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x410ae4[_0xcfde('0x6c')]||(_0x410ae4['attrs']&&_0x410ae4[_0xcfde('0x59')][0x7]?_0x410ae4[_0xcfde('0x59')][0x7][_0xcfde('0x61')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x410ae4[_0xcfde('0x6d')]||(_0x410ae4[_0xcfde('0x59')]&&_0x410ae4['attrs'][0x8]?_0x410ae4['attrs'][0x8][_0xcfde('0x61')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x410ae4['attrWhatsappAccounts']||(_0x410ae4[_0xcfde('0x59')]&&_0x410ae4[_0xcfde('0x59')][0x9]?_0x410ae4['attrs'][0x9][_0xcfde('0x61')]:undefined)||''},{'name':_0xcfde('0x6f'),'value':_0x410ae4[_0xcfde('0x6f')]||(_0x410ae4[_0xcfde('0x59')]&&_0x410ae4[_0xcfde('0x59')][0xa]?_0x410ae4[_0xcfde('0x59')][0xa][_0xcfde('0x61')]:undefined)||''}];case'web-report':return[{'name':'attrReport','type':_0x410ae4[_0xcfde('0x73')]||(_0x410ae4[_0xcfde('0x59')]&&_0x410ae4[_0xcfde('0x59')][0x0]?_0x410ae4[_0xcfde('0x59')][0x0][_0xcfde('0x2d')]:undefined)||null,'value':_0x410ae4[_0xcfde('0x74')]||(_0x410ae4[_0xcfde('0x59')]&&_0x410ae4[_0xcfde('0x59')][0x0]?_0x410ae4[_0xcfde('0x59')][0x0]['value']:undefined)||null},{'name':_0xcfde('0x75'),'value':_0x410ae4['attrRefresh']||(_0x410ae4[_0xcfde('0x59')]&&_0x410ae4[_0xcfde('0x59')][0x1]?_0x410ae4[_0xcfde('0x59')][0x1][_0xcfde('0x61')]:undefined)||0x0}];default:return[];}}catch(_0x52df00){logger[_0xcfde('0x29')](_0xcfde('0x76'),JSON[_0xcfde('0x77')](_0x52df00));return[];}}exports['addItem']=function(_0x388737,_0x300cc6,_0x3e398c){if(_0x388737['body']['id']){delete _0x388737[_0xcfde('0x49')]['id'];}return db[_0xcfde('0x40')]['find']({'where':{'id':_0x388737[_0xcfde('0x51')]['id']}})['then'](handleEntityNotFound(_0x300cc6,null))[_0xcfde('0x28')](function(_0x46ae08){if(_0x46ae08){_0x388737['body'][_0xcfde('0x78')]=_0x46ae08['id'];_0x388737[_0xcfde('0x49')][_0xcfde('0x59')]=widgetAttributes(_0x388737['body']);return db[_0xcfde('0x79')]['create'](_0x388737['body']);}})[_0xcfde('0x28')](respondWithResult(_0x300cc6,null))[_0xcfde('0x43')](handleError(_0x300cc6,null));};exports[_0xcfde('0x7a')]=function(_0x2b740b,_0x399ed9,_0x4a9670){var _0x333906={};var _0x144d7b={};var _0x1cee5e;var _0x187760;return db[_0xcfde('0x40')]['findOne']({'where':{'id':_0x2b740b['params']['id']}})[_0xcfde('0x28')](handleEntityNotFound(_0x399ed9,null))[_0xcfde('0x28')](function(_0x303372){if(_0x303372){_0x1cee5e=_0x303372;_0x144d7b[_0xcfde('0x35')]=_[_0xcfde('0x31')](db[_0xcfde('0x79')][_0xcfde('0x2b')]);_0x144d7b[_0xcfde('0x30')]=_[_0xcfde('0x31')](_0x2b740b['query']);_0x144d7b[_0xcfde('0x32')]=_[_0xcfde('0x33')](_0x144d7b[_0xcfde('0x35')],_0x144d7b[_0xcfde('0x30')]);_0x333906[_0xcfde('0x34')]=_['intersection'](_0x144d7b[_0xcfde('0x35')],qs[_0xcfde('0x36')](_0x2b740b[_0xcfde('0x30')][_0xcfde('0x36')]));_0x333906[_0xcfde('0x34')]=_0x333906[_0xcfde('0x34')][_0xcfde('0x37')]?_0x333906[_0xcfde('0x34')]:_0x144d7b[_0xcfde('0x35')];_0x333906[_0xcfde('0x3a')]=qs['sort'](_0x2b740b['query'][_0xcfde('0x3b')]);_0x333906[_0xcfde('0x3c')]=qs['filters'](_['pick'](_0x2b740b[_0xcfde('0x30')],_0x144d7b['filters']));if(_0x2b740b[_0xcfde('0x30')][_0xcfde('0x3e')]){_0x333906[_0xcfde('0x3c')]=_[_0xcfde('0x3f')](_0x333906[_0xcfde('0x3c')],{'$or':_[_0xcfde('0x2a')](_0x333906[_0xcfde('0x34')],function(_0x1c6cde){var _0x3939bd={};_0x3939bd[_0x1c6cde]={'$like':'%'+_0x2b740b[_0xcfde('0x30')][_0xcfde('0x3e')]+'%'};return _0x3939bd;})});}_0x333906=_[_0xcfde('0x3f')]({},_0x333906,_0x2b740b['options']);return _0x1cee5e[_0xcfde('0x7a')](_0x333906);}})['then'](function(_0x51bb80){if(_0x51bb80){_0x187760=_0x51bb80[_0xcfde('0x37')];if(!_0x2b740b['query']['hasOwnProperty'](_0xcfde('0x39'))){_0x333906[_0xcfde('0x1e')]=qs[_0xcfde('0x1e')](_0x2b740b[_0xcfde('0x30')][_0xcfde('0x1e')]);_0x333906[_0xcfde('0x1c')]=qs[_0xcfde('0x1c')](_0x2b740b['query'][_0xcfde('0x1c')]);}return _0x1cee5e['getItems'](_0x333906);}})[_0xcfde('0x28')](function(_0x31bea8){if(_0x31bea8){return _0x31bea8?{'count':_0x187760,'rows':_0x31bea8}:null;}})[_0xcfde('0x28')](respondWithResult(_0x399ed9,null))[_0xcfde('0x43')](handleError(_0x399ed9,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 864dcfe..a552119 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 _0xbbc7=['Dashboard','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x1dfa63,_0x362bd4){var _0x26f2a9=function(_0x31cc52){while(--_0x31cc52){_0x1dfa63['push'](_0x1dfa63['shift']());}};_0x26f2a9(++_0x362bd4);}(_0xbbc7,0x166));var _0x7bbc=function(_0x771eee,_0x13c4e7){_0x771eee=_0x771eee-0x0;var _0xf366b4=_0xbbc7[_0x771eee];return _0xf366b4;};'use strict';var EventEmitter=require(_0x7bbc('0x0'));var Dashboard=require(_0x7bbc('0x1'))['db'][_0x7bbc('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x7bbc('0x3')](0x0);var events={'afterCreate':_0x7bbc('0x4'),'afterUpdate':'update','afterDestroy':_0x7bbc('0x5')};function emitEvent(_0x72170b){return function(_0x1d79e0,_0x4b2725,_0x175b7b){DashboardEvents[_0x7bbc('0x6')](_0x72170b+':'+_0x1d79e0['id'],_0x1d79e0);DashboardEvents[_0x7bbc('0x6')](_0x72170b,_0x1d79e0);_0x175b7b(null);};}for(var e in events){if(events[_0x7bbc('0x7')](e)){var event=events[e];Dashboard[_0x7bbc('0x8')](e,emitEvent(event));}}module[_0x7bbc('0x9')]=DashboardEvents; \ No newline at end of file +var _0x9664=['update','remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners','save'];(function(_0x370465,_0x598a05){var _0x4f7f18=function(_0x5c95d2){while(--_0x5c95d2){_0x370465['push'](_0x370465['shift']());}};_0x4f7f18(++_0x598a05);}(_0x9664,0x126));var _0x4966=function(_0x1c0366,_0x27e275){_0x1c0366=_0x1c0366-0x0;var _0x12efd4=_0x9664[_0x1c0366];return _0x12efd4;};'use strict';var EventEmitter=require(_0x4966('0x0'));var Dashboard=require('../../mysqldb')['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x4966('0x1')](0x0);var events={'afterCreate':_0x4966('0x2'),'afterUpdate':_0x4966('0x3'),'afterDestroy':_0x4966('0x4')};function emitEvent(_0x225d22){return function(_0x41cc95,_0x4a7a22,_0x6ac714){DashboardEvents['emit'](_0x225d22+':'+_0x41cc95['id'],_0x41cc95);DashboardEvents[_0x4966('0x5')](_0x225d22,_0x41cc95);_0x6ac714(null);};}for(var e in events){if(events[_0x4966('0x6')](e)){var event=events[e];Dashboard[_0x4966('0x7')](e,emitEvent(event));}}module[_0x4966('0x8')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 4128199..93f6817 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 _0xe499=['../../config/logger','api','request-promise','path','rimraf','exports','define','Dashboard','dashboards','lodash','util'];(function(_0x588639,_0x266b61){var _0x692bea=function(_0x46db86){while(--_0x46db86){_0x588639['push'](_0x588639['shift']());}};_0x692bea(++_0x266b61);}(_0xe499,0xfb));var _0x9e49=function(_0x30fae7,_0x562858){_0x30fae7=_0x30fae7-0x0;var _0x1dbd52=_0xe499[_0x30fae7];return _0x1dbd52;};'use strict';var _=require(_0x9e49('0x0'));var util=require(_0x9e49('0x1'));var logger=require(_0x9e49('0x2'))(_0x9e49('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9e49('0x4'));var fs=require('fs');var path=require(_0x9e49('0x5'));var rimraf=require(_0x9e49('0x6'));var config=require('../../config/environment');var attributes=require('./dashboard.attributes');module[_0x9e49('0x7')]=function(_0x312b96,_0x57603a){return _0x312b96[_0x9e49('0x8')](_0x9e49('0x9'),attributes,{'tableName':_0x9e49('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x98a1=['bluebird','path','rimraf','../../config/environment','exports','dashboards','lodash','../../config/logger'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x98a1,0x10e));var _0x198a=function(_0x2882cc,_0x217afd){_0x2882cc=_0x2882cc-0x0;var _0x2b4a1a=_0x98a1[_0x2882cc];return _0x2b4a1a;};'use strict';var _=require(_0x198a('0x0'));var util=require('util');var logger=require(_0x198a('0x1'))('api');var moment=require('moment');var BPromise=require(_0x198a('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x198a('0x3'));var rimraf=require(_0x198a('0x4'));var config=require(_0x198a('0x5'));var attributes=require('./dashboard.attributes');module[_0x198a('0x6')]=function(_0xb369ee,_0x3c487a){return _0xb369ee['define']('Dashboard',attributes,{'tableName':_0x198a('0x7'),'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 9d992f1..5369083 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 _0xc83d=['message','request\x20sent','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./dashboard.socket','request','then','info','Dashboard,\x20%s,\x20%s','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x40e0e2,_0x9069a2){var _0x32bd09=function(_0x2972d9){while(--_0x2972d9){_0x40e0e2['push'](_0x40e0e2['shift']());}};_0x32bd09(++_0x9069a2);}(_0xc83d,0x163));var _0xdc83=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xc83d[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xdc83('0x0'));var util=require('util');var moment=require(_0xdc83('0x1'));var BPromise=require('bluebird');var rs=require(_0xdc83('0x2'));var fs=require('fs');var Redis=require(_0xdc83('0x3'));var db=require(_0xdc83('0x4'))['db'];var utils=require(_0xdc83('0x5'));var logger=require(_0xdc83('0x6'))(_0xdc83('0x7'));var config=require(_0xdc83('0x8'));var jayson=require(_0xdc83('0x9'));var client=jayson[_0xdc83('0xa')]['http']({'port':0x232a});config[_0xdc83('0xb')]=_[_0xdc83('0xc')](config[_0xdc83('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xdc83('0xd'))(new Redis(config[_0xdc83('0xb')]));require(_0xdc83('0xe'))['register'](socket);function respondWithRpcPromise(_0xba156e,_0x4804e4,_0xab7f90){return new BPromise(function(_0x98d488,_0x3f8e4e){return client[_0xdc83('0xf')](_0xba156e,_0xab7f90)[_0xdc83('0x10')](function(_0x5f090f){logger[_0xdc83('0x11')](_0xdc83('0x12'),_0x4804e4,'request\x20sent');logger['debug'](_0xdc83('0x13'),_0x4804e4,'request\x20sent',JSON[_0xdc83('0x14')](_0x5f090f));if(_0x5f090f[_0xdc83('0x15')]){if(_0x5f090f[_0xdc83('0x15')][_0xdc83('0x16')]===0x1f4){logger[_0xdc83('0x15')](_0xdc83('0x12'),_0x4804e4,_0x5f090f[_0xdc83('0x15')][_0xdc83('0x17')]);return _0x3f8e4e(_0x5f090f[_0xdc83('0x15')][_0xdc83('0x17')]);}logger[_0xdc83('0x15')](_0xdc83('0x12'),_0x4804e4,_0x5f090f[_0xdc83('0x15')]['message']);return _0x98d488(_0x5f090f[_0xdc83('0x15')][_0xdc83('0x17')]);}else{logger[_0xdc83('0x11')]('Dashboard,\x20%s,\x20%s',_0x4804e4,_0xdc83('0x18'));_0x98d488(_0x5f090f[_0xdc83('0x19')][_0xdc83('0x17')]);}})[_0xdc83('0x1a')](function(_0x54be66){logger[_0xdc83('0x15')](_0xdc83('0x12'),_0x4804e4,_0x54be66);_0x3f8e4e(_0x54be66);});});} \ No newline at end of file +var _0x7c26=['stringify','error','code','Dashboard,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','socket.io-emitter','register','request','info','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s'];(function(_0x80e1e8,_0x220149){var _0x9c466f=function(_0x259058){while(--_0x259058){_0x80e1e8['push'](_0x80e1e8['shift']());}};_0x9c466f(++_0x220149);}(_0x7c26,0x83));var _0x67c2=function(_0x3bd792,_0x300fb1){_0x3bd792=_0x3bd792-0x0;var _0x5127fb=_0x7c26[_0x3bd792];return _0x5127fb;};'use strict';var _=require(_0x67c2('0x0'));var util=require(_0x67c2('0x1'));var moment=require(_0x67c2('0x2'));var BPromise=require(_0x67c2('0x3'));var rs=require(_0x67c2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x67c2('0x5'))['db'];var utils=require(_0x67c2('0x6'));var logger=require(_0x67c2('0x7'))(_0x67c2('0x8'));var config=require(_0x67c2('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x67c2('0xa')]({'port':0x232a});config[_0x67c2('0xb')]=_[_0x67c2('0xc')](config[_0x67c2('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x67c2('0xd'))(new Redis(config[_0x67c2('0xb')]));require('./dashboard.socket')[_0x67c2('0xe')](socket);function respondWithRpcPromise(_0x47041d,_0x4df8b3,_0x4d84e8){return new BPromise(function(_0x3ab936,_0x1b56f9){return client[_0x67c2('0xf')](_0x47041d,_0x4d84e8)['then'](function(_0x3538db){logger[_0x67c2('0x10')]('Dashboard,\x20%s,\x20%s',_0x4df8b3,_0x67c2('0x11'));logger['debug'](_0x67c2('0x12'),_0x4df8b3,_0x67c2('0x11'),JSON[_0x67c2('0x13')](_0x3538db));if(_0x3538db[_0x67c2('0x14')]){if(_0x3538db[_0x67c2('0x14')][_0x67c2('0x15')]===0x1f4){logger[_0x67c2('0x14')](_0x67c2('0x16'),_0x4df8b3,_0x3538db['error'][_0x67c2('0x17')]);return _0x1b56f9(_0x3538db[_0x67c2('0x14')][_0x67c2('0x17')]);}logger[_0x67c2('0x14')](_0x67c2('0x16'),_0x4df8b3,_0x3538db['error']['message']);return _0x3ab936(_0x3538db[_0x67c2('0x14')][_0x67c2('0x17')]);}else{logger[_0x67c2('0x10')]('Dashboard,\x20%s,\x20%s',_0x4df8b3,'request\x20sent');_0x3ab936(_0x3538db['result'][_0x67c2('0x17')]);}})[_0x67c2('0x18')](function(_0x1fe162){logger[_0x67c2('0x14')](_0x67c2('0x16'),_0x4df8b3,_0x1fe162);_0x1b56f9(_0x1fe162);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 74ef34f..669f1ef 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 _0x2f1e=['length','dashboard:','save','remove','update','emit','removeListener','register'];(function(_0x21d320,_0x30a345){var _0x2fadaf=function(_0x433b7e){while(--_0x433b7e){_0x21d320['push'](_0x21d320['shift']());}};_0x2fadaf(++_0x30a345);}(_0x2f1e,0x72));var _0xe2f1=function(_0xfaf19d,_0x57304b){_0xfaf19d=_0xfaf19d-0x0;var _0x14a9d9=_0x2f1e[_0xfaf19d];return _0x14a9d9;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0xe2f1('0x0'),_0xe2f1('0x1'),_0xe2f1('0x2')];function createListener(_0x20aa82,_0x89fe9b){return function(_0x338c9d){_0x89fe9b[_0xe2f1('0x3')](_0x20aa82,_0x338c9d);};}function removeListener(_0x5d99b5,_0x585736){return function(){DashboardEvents[_0xe2f1('0x4')](_0x5d99b5,_0x585736);};}exports[_0xe2f1('0x5')]=function(_0xab2c56){for(var _0x35344e=0x0,_0x344fa5=events[_0xe2f1('0x6')];_0x35344e<_0x344fa5;_0x35344e++){var _0x26cf00=events[_0x35344e];var _0x573633=createListener(_0xe2f1('0x7')+_0x26cf00,_0xab2c56);DashboardEvents['on'](_0x26cf00,_0x573633);}}; \ No newline at end of file +var _0xa38e=['length','dashboard:','./dashboard.events','save','remove','update','emit','register'];(function(_0x29e35f,_0x4859ef){var _0x266b74=function(_0xc09e1){while(--_0xc09e1){_0x29e35f['push'](_0x29e35f['shift']());}};_0x266b74(++_0x4859ef);}(_0xa38e,0xe2));var _0xea38=function(_0x2c534a,_0x18a19e){_0x2c534a=_0x2c534a-0x0;var _0x3f5c99=_0xa38e[_0x2c534a];return _0x3f5c99;};'use strict';var DashboardEvents=require(_0xea38('0x0'));var events=[_0xea38('0x1'),_0xea38('0x2'),_0xea38('0x3')];function createListener(_0x3f2dcb,_0x2e7b2e){return function(_0xd9f41){_0x2e7b2e[_0xea38('0x4')](_0x3f2dcb,_0xd9f41);};}function removeListener(_0x518140,_0x22d436){return function(){DashboardEvents['removeListener'](_0x518140,_0x22d436);};}exports[_0xea38('0x5')]=function(_0x372b5c){for(var _0x3da630=0x0,_0x19a204=events[_0xea38('0x6')];_0x3da630<_0x19a204;_0x3da630++){var _0x419fc9=events[_0x3da630];var _0x42ef67=createListener(_0xea38('0x7')+_0x419fc9,_0x372b5c);DashboardEvents['on'](_0x419fc9,_0x42ef67);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 4c9c1da..e44f354 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 _0xfd0c=['post','create','/:id/clone','clone','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./dashboard.controller','index','get','/:id','isAuthenticated','getItems'];(function(_0x22f82a,_0x36ea1d){var _0x3abd49=function(_0x37d935){while(--_0x37d935){_0x22f82a['push'](_0x22f82a['shift']());}};_0x3abd49(++_0x36ea1d);}(_0xfd0c,0xe4));var _0xcfd0=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xfd0c[_0x2763f2];return _0x3ef471;};'use strict';var multer=require(_0xcfd0('0x0'));var util=require(_0xcfd0('0x1'));var path=require('path');var timeout=require(_0xcfd0('0x2'));var express=require(_0xcfd0('0x3'));var router=express[_0xcfd0('0x4')]();var fs_extra=require(_0xcfd0('0x5'));var auth=require(_0xcfd0('0x6'));var interaction=require(_0xcfd0('0x7'));var config=require('../../config/environment');var controller=require(_0xcfd0('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xcfd0('0x9')]);router[_0xcfd0('0xa')](_0xcfd0('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xcfd0('0xa')]('/:id/items',auth[_0xcfd0('0xc')](),controller[_0xcfd0('0xd')]);router[_0xcfd0('0xe')]('/',auth[_0xcfd0('0xc')](),controller[_0xcfd0('0xf')]);router[_0xcfd0('0xe')](_0xcfd0('0x10'),auth['isAuthenticated'](),controller[_0xcfd0('0x11')]);router[_0xcfd0('0xe')]('/:id/items',auth[_0xcfd0('0xc')](),controller['addItem']);router[_0xcfd0('0x12')](_0xcfd0('0xb'),auth[_0xcfd0('0xc')](),controller[_0xcfd0('0x13')]);router['delete'](_0xcfd0('0xb'),auth[_0xcfd0('0xc')](),controller[_0xcfd0('0x14')]);module[_0xcfd0('0x15')]=router; \ No newline at end of file +var _0x02ae=['put','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','./dashboard.controller','get','index','/:id','isAuthenticated','show','/:id/items','getItems','post','/:id/clone','clone','addItem'];(function(_0x70b1a5,_0x1803bd){var _0x13f2b2=function(_0x36271a){while(--_0x36271a){_0x70b1a5['push'](_0x70b1a5['shift']());}};_0x13f2b2(++_0x1803bd);}(_0x02ae,0xa5));var _0xe02a=function(_0x313c75,_0x2123bc){_0x313c75=_0x313c75-0x0;var _0x4038a7=_0x02ae[_0x313c75];return _0x4038a7;};'use strict';var multer=require(_0xe02a('0x0'));var util=require(_0xe02a('0x1'));var path=require(_0xe02a('0x2'));var timeout=require('connect-timeout');var express=require(_0xe02a('0x3'));var router=express[_0xe02a('0x4')]();var fs_extra=require(_0xe02a('0x5'));var auth=require(_0xe02a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe02a('0x7'));router[_0xe02a('0x8')]('/',auth['isAuthenticated'](),controller[_0xe02a('0x9')]);router['get'](_0xe02a('0xa'),auth[_0xe02a('0xb')](),controller[_0xe02a('0xc')]);router['get'](_0xe02a('0xd'),auth[_0xe02a('0xb')](),controller[_0xe02a('0xe')]);router['post']('/',auth[_0xe02a('0xb')](),controller['create']);router[_0xe02a('0xf')](_0xe02a('0x10'),auth['isAuthenticated'](),controller[_0xe02a('0x11')]);router[_0xe02a('0xf')](_0xe02a('0xd'),auth['isAuthenticated'](),controller[_0xe02a('0x12')]);router[_0xe02a('0x13')]('/:id',auth[_0xe02a('0xb')](),controller[_0xe02a('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xe02a('0x15')]);module[_0xe02a('0x16')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 37899a5..0bb1d79 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 _0x1883=['stringify','INTEGER','#ffffff','sequelize','squel','lodash','exports','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue'];(function(_0x211632,_0x378e2e){var _0x5a1da1=function(_0x44aff2){while(--_0x44aff2){_0x211632['push'](_0x211632['shift']());}};_0x5a1da1(++_0x378e2e);}(_0x1883,0xab));var _0x3188=function(_0x1c44f5,_0x1de2bd){_0x1c44f5=_0x1c44f5-0x0;var _0x527ce0=_0x1883[_0x1c44f5];return _0x527ce0;};'use strict';var Sequelize=require(_0x3188('0x0'));var squel=require(_0x3188('0x1'));var _=require(_0x3188('0x2'));module[_0x3188('0x3')]={'title':{'type':Sequelize[_0x3188('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0x3188('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x3188('0x5')](_0x3188('0x6')),'get':function(){try{return JSON[_0x3188('0x7')](this[_0x3188('0x8')](_0x3188('0x9')));}catch(_0x345612){return[];}},'set':function(_0x408ae0){try{this[_0x3188('0xa')](_0x3188('0x9'),JSON[_0x3188('0xb')](_0x408ae0));}catch(_0x3e3afb){this['setDataValue'](_0x3188('0x9'),JSON[_0x3188('0xb')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x3188('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x3188('0xc')]},'background':{'type':Sequelize[_0x3188('0x4')],'allowNull':![],'defaultValue':_0x3188('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x3188('0x4')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x3188('0x4')]},'titleFontSize':{'type':Sequelize[_0x3188('0xc')],'defaultValue':0xc}}; \ No newline at end of file +var _0x90b1=['#2196f3','sequelize','squel','lodash','STRING','TEXT','long','parse','setDataValue','attrs','stringify','INTEGER','#ffffff'];(function(_0x5bc28b,_0x5bf1a0){var _0x27a1d9=function(_0x383423){while(--_0x383423){_0x5bc28b['push'](_0x5bc28b['shift']());}};_0x27a1d9(++_0x5bf1a0);}(_0x90b1,0x1bb));var _0x190b=function(_0x53166a,_0x43b2d3){_0x53166a=_0x53166a-0x0;var _0x2676c5=_0x90b1[_0x53166a];return _0x2676c5;};'use strict';var Sequelize=require(_0x190b('0x0'));var squel=require(_0x190b('0x1'));var _=require(_0x190b('0x2'));module['exports']={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x190b('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x190b('0x4')](_0x190b('0x5')),'get':function(){try{return JSON[_0x190b('0x6')](this['getDataValue']('attrs'));}catch(_0x5cbebb){return[];}},'set':function(_0x5da9c1){try{this[_0x190b('0x7')](_0x190b('0x8'),JSON[_0x190b('0x9')](_0x5da9c1));}catch(_0x626aa1){this[_0x190b('0x7')](_0x190b('0x8'),JSON[_0x190b('0x9')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x190b('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x190b('0xa')]},'col':{'type':Sequelize[_0x190b('0xa')]},'background':{'type':Sequelize[_0x190b('0x3')],'allowNull':![],'defaultValue':_0x190b('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x190b('0x3')],'allowNull':![],'defaultValue':_0x190b('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x190b('0x3')]},'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 c8d133c..2776d90 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 _0xa7ee=['reject','then','destroy','end','sendStatus','error','name','send','show','params','model','DashboardItem','query','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','type','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','total','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie3','attrVoiceQueues','voice','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','create','body','update','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','offset','undefined','count','limit','set','Content-Range','json'];(function(_0x589eb4,_0xaa2019){var _0xf50816=function(_0x572fc5){while(--_0x572fc5){_0x589eb4['push'](_0x589eb4['shift']());}};_0xf50816(++_0xaa2019);}(_0xa7ee,0x159));var _0xea7e=function(_0x318410,_0x451962){_0x318410=_0x318410-0x0;var _0x2898a3=_0xa7ee[_0x318410];return _0x2898a3;};'use strict';var emlformat=require(_0xea7e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xea7e('0x1'));var jsonpatch=require(_0xea7e('0x2'));var rp=require(_0xea7e('0x3'));var moment=require(_0xea7e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xea7e('0x5'));var path=require('path');var sox=require(_0xea7e('0x6'));var csv=require(_0xea7e('0x7'));var ejs=require(_0xea7e('0x8'));var fs=require('fs');var fs_extra=require(_0xea7e('0x9'));var _=require('lodash');var squel=require(_0xea7e('0xa'));var crypto=require(_0xea7e('0xb'));var jsforce=require(_0xea7e('0xc'));var deskjs=require(_0xea7e('0xd'));var toCsv=require(_0xea7e('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xea7e('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xea7e('0xf'));var as=require(_0xea7e('0x10'));var hardwareService=require(_0xea7e('0x11'));var logger=require(_0xea7e('0x12'))('api');var utils=require(_0xea7e('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xea7e('0x14'));var db=require(_0xea7e('0x15'))['db'];config[_0xea7e('0x16')]=_[_0xea7e('0x17')](config[_0xea7e('0x16')],{'host':_0xea7e('0x18'),'port':0x18eb});var socket=require(_0xea7e('0x19'))(new Redis(config[_0xea7e('0x16')]));require('./dashboardItem.socket')[_0xea7e('0x1a')](socket);function respondWithStatusCode(_0x3ef916,_0x1a617e){_0x1a617e=_0x1a617e||0xcc;return function(_0x777c57){if(_0x777c57){return _0x3ef916['sendStatus'](_0x1a617e);}return _0x3ef916[_0xea7e('0x1b')](_0x1a617e)['end']();};}function respondWithResult(_0x5c7466,_0x3cd795){_0x3cd795=_0x3cd795||0xc8;return function(_0x2d5794){if(_0x2d5794){return _0x5c7466[_0xea7e('0x1b')](_0x3cd795)['json'](_0x2d5794);}};}function respondWithFilteredResult(_0x5c3b15,_0x13281d){return function(_0x5becf4){if(_0x5becf4){var _0x195d5a=typeof _0x13281d[_0xea7e('0x1c')]==='undefined'&&typeof _0x13281d['limit']===_0xea7e('0x1d');var _0x59e8d8=_0x5becf4['count'];var _0x406aff=_0x195d5a?0x0:_0x13281d['offset'];var _0x373c2c=_0x195d5a?_0x5becf4[_0xea7e('0x1e')]:_0x13281d['offset']+_0x13281d[_0xea7e('0x1f')];var _0x52dfb0;if(_0x373c2c>=_0x59e8d8){_0x373c2c=_0x59e8d8;_0x52dfb0=0xc8;}else{_0x52dfb0=0xce;}_0x5c3b15[_0xea7e('0x1b')](_0x52dfb0);return _0x5c3b15[_0xea7e('0x20')](_0xea7e('0x21'),_0x406aff+'-'+_0x373c2c+'/'+_0x59e8d8)[_0xea7e('0x22')](_0x5becf4);}return null;};}function patchUpdates(_0x372b9d){return function(_0x268511){try{jsonpatch['apply'](_0x268511,_0x372b9d,!![]);}catch(_0xd41599){return BPromise[_0xea7e('0x23')](_0xd41599);}return _0x268511['save']();};}function saveUpdates(_0xb8149f,_0x344ec6){return function(_0xa07c9a){if(_0xa07c9a){return _0xa07c9a['update'](_0xb8149f)[_0xea7e('0x24')](function(_0x400125){return _0x400125;});}return null;};}function removeEntity(_0x41b995,_0x49ce51){return function(_0x456222){if(_0x456222){return _0x456222[_0xea7e('0x25')]()[_0xea7e('0x24')](function(){_0x41b995[_0xea7e('0x1b')](0xcc)[_0xea7e('0x26')]();});}};}function handleEntityNotFound(_0x789f9e,_0x31871e){return function(_0x25b5a4){if(!_0x25b5a4){_0x789f9e[_0xea7e('0x27')](0x194);}return _0x25b5a4;};}function handleError(_0x10bbc1,_0x4a23a9){_0x4a23a9=_0x4a23a9||0x1f4;return function(_0x1744f3){logger[_0xea7e('0x28')](_0x1744f3['stack']);if(_0x1744f3[_0xea7e('0x29')]){delete _0x1744f3[_0xea7e('0x29')];}_0x10bbc1[_0xea7e('0x1b')](_0x4a23a9)[_0xea7e('0x2a')](_0x1744f3);};}exports[_0xea7e('0x2b')]=function(_0x56ea98,_0x38d8a7){var _0xd89897={'raw':![],'where':{'id':_0x56ea98[_0xea7e('0x2c')]['id']}},_0x596514={};_0x596514[_0xea7e('0x2d')]=_['keys'](db[_0xea7e('0x2e')]['rawAttributes']);_0x596514[_0xea7e('0x2f')]=_[_0xea7e('0x30')](_0x56ea98[_0xea7e('0x2f')]);_0x596514[_0xea7e('0x31')]=_[_0xea7e('0x32')](_0x596514[_0xea7e('0x2d')],_0x596514['query']);_0xd89897[_0xea7e('0x33')]=_[_0xea7e('0x32')](_0x596514[_0xea7e('0x2d')],qs[_0xea7e('0x34')](_0x56ea98[_0xea7e('0x2f')][_0xea7e('0x34')]));_0xd89897['attributes']=_0xd89897['attributes'][_0xea7e('0x35')]?_0xd89897[_0xea7e('0x33')]:_0x596514[_0xea7e('0x2d')];if(_0x56ea98['query'][_0xea7e('0x36')]){_0xd89897[_0xea7e('0x37')]=[{'all':!![]}];}_0xd89897=_[_0xea7e('0x38')]({},_0xd89897,_0x56ea98[_0xea7e('0x39')]);return db[_0xea7e('0x2e')][_0xea7e('0x3a')](_0xd89897)[_0xea7e('0x24')](handleEntityNotFound(_0x38d8a7,null))[_0xea7e('0x24')](respondWithResult(_0x38d8a7,null))[_0xea7e('0x3b')](handleError(_0x38d8a7,null));};exports[_0xea7e('0x25')]=function(_0x334324,_0x187a55){return db[_0xea7e('0x2e')][_0xea7e('0x3a')]({'where':{'id':_0x334324[_0xea7e('0x2c')]['id']}})['then'](handleEntityNotFound(_0x187a55,null))[_0xea7e('0x24')](removeEntity(_0x187a55,null))[_0xea7e('0x3b')](handleError(_0x187a55,null));};function widgetAttributes(_0x3f3b2f){try{switch(_0x3f3b2f[_0xea7e('0x3c')]){case'iframe':return[{'name':_0xea7e('0x3d'),'value':_0x3f3b2f['attrUrl']||(_0x3f3b2f[_0xea7e('0x3e')]&&_0x3f3b2f['attrs'][0x0]?_0x3f3b2f[_0xea7e('0x3e')][0x0][_0xea7e('0x3f')]:undefined)||_0xea7e('0x40')}];case _0xea7e('0x41'):return[{'name':_0xea7e('0x42'),'value':_0x3f3b2f[_0xea7e('0x42')]||(_0x3f3b2f['attrs']&&_0x3f3b2f[_0xea7e('0x3e')][0x0]?_0x3f3b2f[_0xea7e('0x3e')][0x0]['value']:undefined)||''}];case _0xea7e('0x43'):return[{'name':'attrHourFormat','value':_0x3f3b2f[_0xea7e('0x44')]||(_0x3f3b2f[_0xea7e('0x3e')]&&_0x3f3b2f['attrs'][0x0]?_0x3f3b2f[_0xea7e('0x3e')][0x0][_0xea7e('0x3f')]:undefined)||_0xea7e('0x45')},{'name':_0xea7e('0x46'),'value':_0x3f3b2f[_0xea7e('0x46')]||(_0x3f3b2f[_0xea7e('0x3e')]&&_0x3f3b2f[_0xea7e('0x3e')][0x1]?_0x3f3b2f[_0xea7e('0x3e')][0x1][_0xea7e('0x3f')]:undefined)||_0xea7e('0x47')},{'name':_0xea7e('0x48'),'value':_0x3f3b2f[_0xea7e('0x48')]||(_0x3f3b2f[_0xea7e('0x3e')]&&_0x3f3b2f[_0xea7e('0x3e')][0x2]?_0x3f3b2f['attrs'][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x3f3b2f['attrMetric']||(_0x3f3b2f['attrs']&&_0x3f3b2f[_0xea7e('0x3e')][0x0]?_0x3f3b2f['attrs'][0x0][_0xea7e('0x3f')]:undefined)||_0xea7e('0x49')},{'name':'attrVoiceQueues','value':_0x3f3b2f['attrVoiceQueues']||(_0x3f3b2f[_0xea7e('0x3e')]&&_0x3f3b2f[_0xea7e('0x3e')][0x1]?_0x3f3b2f[_0xea7e('0x3e')][0x1][_0xea7e('0x3f')]:undefined)||[]},{'name':'attrFontSize','value':_0x3f3b2f['attrFontSize']||(_0x3f3b2f[_0xea7e('0x3e')]&&_0x3f3b2f['attrs'][0x2]?_0x3f3b2f[_0xea7e('0x3e')][0x2][_0xea7e('0x3f')]:undefined)||0x14},{'name':'attrChannel','value':_0x3f3b2f[_0xea7e('0x4a')]||(_0x3f3b2f[_0xea7e('0x3e')]&&_0x3f3b2f['attrs'][0x3]?_0x3f3b2f[_0xea7e('0x3e')][0x3][_0xea7e('0x3f')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x3f3b2f[_0xea7e('0x4b')]||(_0x3f3b2f[_0xea7e('0x3e')]&&_0x3f3b2f['attrs'][0x4]?_0x3f3b2f[_0xea7e('0x3e')][0x4][_0xea7e('0x3f')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x3f3b2f[_0xea7e('0x4c')]||(_0x3f3b2f[_0xea7e('0x3e')]&&_0x3f3b2f[_0xea7e('0x3e')][0x5]?_0x3f3b2f[_0xea7e('0x3e')][0x5][_0xea7e('0x3f')]:undefined)||''},{'name':_0xea7e('0x4d'),'value':_0x3f3b2f[_0xea7e('0x4d')]||(_0x3f3b2f['attrs']&&_0x3f3b2f[_0xea7e('0x3e')][0x6]?_0x3f3b2f[_0xea7e('0x3e')][0x6][_0xea7e('0x3f')]:undefined)||''},{'name':_0xea7e('0x4e'),'value':_0x3f3b2f[_0xea7e('0x4e')]||(_0x3f3b2f[_0xea7e('0x3e')]&&_0x3f3b2f['attrs'][0x7]?_0x3f3b2f[_0xea7e('0x3e')][0x7][_0xea7e('0x3f')]:undefined)||''},{'name':_0xea7e('0x4f'),'value':_0x3f3b2f[_0xea7e('0x4f')]||(_0x3f3b2f[_0xea7e('0x3e')]&&_0x3f3b2f[_0xea7e('0x3e')][0x8]?_0x3f3b2f['attrs'][0x8][_0xea7e('0x3f')]:undefined)||''},{'name':_0xea7e('0x50'),'value':_0x3f3b2f[_0xea7e('0x50')]||(_0x3f3b2f['attrs']&&_0x3f3b2f[_0xea7e('0x3e')][0x9]?_0x3f3b2f[_0xea7e('0x3e')][0x9]['value']:undefined)||''}];case _0xea7e('0x51'):case _0xea7e('0x52'):return[{'name':_0xea7e('0x53'),'value':_0x3f3b2f[_0xea7e('0x53')]||(_0x3f3b2f[_0xea7e('0x3e')]&&_0x3f3b2f[_0xea7e('0x3e')][0x0]?_0x3f3b2f[_0xea7e('0x3e')][0x0][_0xea7e('0x3f')]:undefined)||_0xea7e('0x49')},{'name':'attrSerie2','value':_0x3f3b2f['attrSerie2']||(_0x3f3b2f[_0xea7e('0x3e')]&&_0x3f3b2f[_0xea7e('0x3e')][0x1]?_0x3f3b2f['attrs'][0x1][_0xea7e('0x3f')]:undefined)||null},{'name':'attrSerie3','value':_0x3f3b2f[_0xea7e('0x54')]||(_0x3f3b2f[_0xea7e('0x3e')]&&_0x3f3b2f[_0xea7e('0x3e')][0x2]?_0x3f3b2f['attrs'][0x2][_0xea7e('0x3f')]:undefined)||null},{'name':_0xea7e('0x55'),'value':_0x3f3b2f[_0xea7e('0x55')]||(_0x3f3b2f[_0xea7e('0x3e')]&&_0x3f3b2f[_0xea7e('0x3e')][0x3]?_0x3f3b2f['attrs'][0x3]['value']:undefined)||[]},{'name':_0xea7e('0x4a'),'value':_0x3f3b2f[_0xea7e('0x4a')]||(_0x3f3b2f[_0xea7e('0x3e')]&&_0x3f3b2f[_0xea7e('0x3e')][0x4]?_0x3f3b2f['attrs'][0x4][_0xea7e('0x3f')]:undefined)||_0xea7e('0x56')},{'name':_0xea7e('0x4b'),'value':_0x3f3b2f[_0xea7e('0x4b')]||(_0x3f3b2f[_0xea7e('0x3e')]&&_0x3f3b2f['attrs'][0x5]?_0x3f3b2f['attrs'][0x5][_0xea7e('0x3f')]:undefined)||''},{'name':_0xea7e('0x4c'),'value':_0x3f3b2f['attrFaxAccounts']||(_0x3f3b2f[_0xea7e('0x3e')]&&_0x3f3b2f[_0xea7e('0x3e')][0x6]?_0x3f3b2f[_0xea7e('0x3e')][0x6][_0xea7e('0x3f')]:undefined)||''},{'name':_0xea7e('0x4d'),'value':_0x3f3b2f['attrSmsAccounts']||(_0x3f3b2f['attrs']&&_0x3f3b2f[_0xea7e('0x3e')][0x7]?_0x3f3b2f[_0xea7e('0x3e')][0x7][_0xea7e('0x3f')]:undefined)||''},{'name':_0xea7e('0x4e'),'value':_0x3f3b2f[_0xea7e('0x4e')]||(_0x3f3b2f[_0xea7e('0x3e')]&&_0x3f3b2f[_0xea7e('0x3e')][0x8]?_0x3f3b2f['attrs'][0x8]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x3f3b2f[_0xea7e('0x4f')]||(_0x3f3b2f[_0xea7e('0x3e')]&&_0x3f3b2f['attrs'][0x9]?_0x3f3b2f[_0xea7e('0x3e')][0x9][_0xea7e('0x3f')]:undefined)||''},{'name':'attrChatWebsites','value':_0x3f3b2f[_0xea7e('0x50')]||(_0x3f3b2f[_0xea7e('0x3e')]&&_0x3f3b2f['attrs'][0xa]?_0x3f3b2f[_0xea7e('0x3e')][0xa][_0xea7e('0x3f')]:undefined)||''}];case _0xea7e('0x57'):return[{'name':_0xea7e('0x58'),'type':_0x3f3b2f[_0xea7e('0x59')]||(_0x3f3b2f['attrs']&&_0x3f3b2f['attrs'][0x0]?_0x3f3b2f[_0xea7e('0x3e')][0x0][_0xea7e('0x3c')]:undefined)||null,'value':_0x3f3b2f[_0xea7e('0x58')]||(_0x3f3b2f['attrs']&&_0x3f3b2f[_0xea7e('0x3e')][0x0]?_0x3f3b2f[_0xea7e('0x3e')][0x0][_0xea7e('0x3f')]:undefined)||null},{'name':_0xea7e('0x5a'),'value':_0x3f3b2f[_0xea7e('0x5a')]||(_0x3f3b2f['attrs']&&_0x3f3b2f['attrs'][0x1]?_0x3f3b2f[_0xea7e('0x3e')][0x1][_0xea7e('0x3f')]:undefined)||0x0}];default:return[];}}catch(_0x4cd8c1){logger[_0xea7e('0x28')](_0xea7e('0x5b'),JSON['stringify'](_0x4cd8c1));return[];}}exports[_0xea7e('0x5c')]=function(_0x3e90b2,_0x28e16d){if(_0x3e90b2[_0xea7e('0x5d')]){_0x3e90b2[_0xea7e('0x5d')][_0xea7e('0x3e')]=widgetAttributes(_0x3e90b2['body']);}return db[_0xea7e('0x2e')]['create'](_0x3e90b2[_0xea7e('0x5d')],{})[_0xea7e('0x24')](respondWithResult(_0x28e16d,0xc9))[_0xea7e('0x3b')](handleError(_0x28e16d,null));};exports[_0xea7e('0x5e')]=function(_0x4a5607,_0x3d5022){if(_0x4a5607['body']['id']){delete _0x4a5607[_0xea7e('0x5d')]['id'];}_0x4a5607[_0xea7e('0x5d')]['attrs']=widgetAttributes(_0x4a5607[_0xea7e('0x5d')]);return db[_0xea7e('0x2e')][_0xea7e('0x3a')]({'where':{'id':_0x4a5607['params']['id']}})[_0xea7e('0x24')](handleEntityNotFound(_0x3d5022,null))['then'](saveUpdates(_0x4a5607['body'],null))['then'](respondWithResult(_0x3d5022,null))[_0xea7e('0x3b')](handleError(_0x3d5022,null));}; \ No newline at end of file +var _0x5549=['attrSmsAccounts','attrOpenchannelAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','attrWhatsappAccounts','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','body','create','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./dashboardItem.socket','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','error','stack','name','send','show','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','fields','includeAll','merge','catch','type','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts'];(function(_0x440322,_0x5bab3e){var _0x2857ae=function(_0xe1a084){while(--_0xe1a084){_0x440322['push'](_0x440322['shift']());}};_0x2857ae(++_0x5bab3e);}(_0x5549,0x1f4));var _0x9554=function(_0x21899f,_0x1821bd){_0x21899f=_0x21899f-0x0;var _0x2046f2=_0x5549[_0x21899f];return _0x2046f2;};'use strict';var emlformat=require(_0x9554('0x0'));var rimraf=require(_0x9554('0x1'));var zipdir=require(_0x9554('0x2'));var jsonpatch=require(_0x9554('0x3'));var rp=require(_0x9554('0x4'));var moment=require('moment');var BPromise=require(_0x9554('0x5'));var Mustache=require(_0x9554('0x6'));var util=require(_0x9554('0x7'));var path=require(_0x9554('0x8'));var sox=require(_0x9554('0x9'));var csv=require('to-csv');var ejs=require(_0x9554('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9554('0xb'));var squel=require(_0x9554('0xc'));var crypto=require(_0x9554('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9554('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9554('0xf'));var Redis=require('ioredis');var authService=require(_0x9554('0x10'));var qs=require(_0x9554('0x11'));var as=require(_0x9554('0x12'));var hardwareService=require(_0x9554('0x13'));var logger=require(_0x9554('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x9554('0x15'));var licenseUtil=require(_0x9554('0x16'));var db=require(_0x9554('0x17'))['db'];config['redis']=_[_0x9554('0x18')](config[_0x9554('0x19')],{'host':_0x9554('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9554('0x19')]));require(_0x9554('0x1b'))['register'](socket);function respondWithStatusCode(_0x2b9f7c,_0x268338){_0x268338=_0x268338||0xcc;return function(_0x377c4b){if(_0x377c4b){return _0x2b9f7c[_0x9554('0x1c')](_0x268338);}return _0x2b9f7c['status'](_0x268338)[_0x9554('0x1d')]();};}function respondWithResult(_0x37003a,_0x29ea31){_0x29ea31=_0x29ea31||0xc8;return function(_0x4df68a){if(_0x4df68a){return _0x37003a[_0x9554('0x1e')](_0x29ea31)['json'](_0x4df68a);}};}function respondWithFilteredResult(_0x18811c,_0x262038){return function(_0x5de328){if(_0x5de328){var _0x29bbb0=typeof _0x262038[_0x9554('0x1f')]===_0x9554('0x20')&&typeof _0x262038[_0x9554('0x21')]===_0x9554('0x20');var _0x43e013=_0x5de328[_0x9554('0x22')];var _0x540285=_0x29bbb0?0x0:_0x262038[_0x9554('0x1f')];var _0x4221e8=_0x29bbb0?_0x5de328[_0x9554('0x22')]:_0x262038[_0x9554('0x1f')]+_0x262038[_0x9554('0x21')];var _0x1efa6c;if(_0x4221e8>=_0x43e013){_0x4221e8=_0x43e013;_0x1efa6c=0xc8;}else{_0x1efa6c=0xce;}_0x18811c[_0x9554('0x1e')](_0x1efa6c);return _0x18811c[_0x9554('0x23')](_0x9554('0x24'),_0x540285+'-'+_0x4221e8+'/'+_0x43e013)['json'](_0x5de328);}return null;};}function patchUpdates(_0x7abc7e){return function(_0x49d5cc){try{jsonpatch[_0x9554('0x25')](_0x49d5cc,_0x7abc7e,!![]);}catch(_0x1755d3){return BPromise['reject'](_0x1755d3);}return _0x49d5cc['save']();};}function saveUpdates(_0x3fb762,_0x416f89){return function(_0x2cf4a6){if(_0x2cf4a6){return _0x2cf4a6[_0x9554('0x26')](_0x3fb762)[_0x9554('0x27')](function(_0x4356b9){return _0x4356b9;});}return null;};}function removeEntity(_0xdfb500,_0x16d54e){return function(_0x28821a){if(_0x28821a){return _0x28821a[_0x9554('0x28')]()['then'](function(){_0xdfb500[_0x9554('0x1e')](0xcc)[_0x9554('0x1d')]();});}};}function handleEntityNotFound(_0x17afca,_0x54e73c){return function(_0x5abb7c){if(!_0x5abb7c){_0x17afca['sendStatus'](0x194);}return _0x5abb7c;};}function handleError(_0x4be9fd,_0x14ba0b){_0x14ba0b=_0x14ba0b||0x1f4;return function(_0x497c13){logger[_0x9554('0x29')](_0x497c13[_0x9554('0x2a')]);if(_0x497c13[_0x9554('0x2b')]){delete _0x497c13[_0x9554('0x2b')];}_0x4be9fd['status'](_0x14ba0b)[_0x9554('0x2c')](_0x497c13);};}exports[_0x9554('0x2d')]=function(_0x37af8d,_0x14eb74){var _0x3237ef={'raw':![],'where':{'id':_0x37af8d['params']['id']}},_0x2d82f4={};_0x2d82f4['model']=_[_0x9554('0x2e')](db[_0x9554('0x2f')][_0x9554('0x30')]);_0x2d82f4[_0x9554('0x31')]=_[_0x9554('0x2e')](_0x37af8d[_0x9554('0x31')]);_0x2d82f4[_0x9554('0x32')]=_[_0x9554('0x33')](_0x2d82f4['model'],_0x2d82f4[_0x9554('0x31')]);_0x3237ef[_0x9554('0x34')]=_[_0x9554('0x33')](_0x2d82f4['model'],qs[_0x9554('0x35')](_0x37af8d[_0x9554('0x31')]['fields']));_0x3237ef[_0x9554('0x34')]=_0x3237ef[_0x9554('0x34')]['length']?_0x3237ef[_0x9554('0x34')]:_0x2d82f4['model'];if(_0x37af8d[_0x9554('0x31')][_0x9554('0x36')]){_0x3237ef['include']=[{'all':!![]}];}_0x3237ef=_[_0x9554('0x37')]({},_0x3237ef,_0x37af8d['options']);return db['DashboardItem']['find'](_0x3237ef)['then'](handleEntityNotFound(_0x14eb74,null))[_0x9554('0x27')](respondWithResult(_0x14eb74,null))['catch'](handleError(_0x14eb74,null));};exports[_0x9554('0x28')]=function(_0x22d54a,_0x424a45){return db[_0x9554('0x2f')]['find']({'where':{'id':_0x22d54a['params']['id']}})['then'](handleEntityNotFound(_0x424a45,null))['then'](removeEntity(_0x424a45,null))[_0x9554('0x38')](handleError(_0x424a45,null));};function widgetAttributes(_0x31b5e0){try{switch(_0x31b5e0[_0x9554('0x39')]){case _0x9554('0x3a'):return[{'name':'attrUrl','value':_0x31b5e0[_0x9554('0x3b')]||(_0x31b5e0[_0x9554('0x3c')]&&_0x31b5e0[_0x9554('0x3c')][0x0]?_0x31b5e0[_0x9554('0x3c')][0x0][_0x9554('0x3d')]:undefined)||_0x9554('0x3e')}];case'custom':return[{'name':'attrPath','value':_0x31b5e0[_0x9554('0x3f')]||(_0x31b5e0[_0x9554('0x3c')]&&_0x31b5e0[_0x9554('0x3c')][0x0]?_0x31b5e0['attrs'][0x0][_0x9554('0x3d')]:undefined)||''}];case _0x9554('0x40'):return[{'name':_0x9554('0x41'),'value':_0x31b5e0[_0x9554('0x41')]||(_0x31b5e0[_0x9554('0x3c')]&&_0x31b5e0[_0x9554('0x3c')][0x0]?_0x31b5e0[_0x9554('0x3c')][0x0]['value']:undefined)||_0x9554('0x42')},{'name':_0x9554('0x43'),'value':_0x31b5e0['attrTimezone']||(_0x31b5e0[_0x9554('0x3c')]&&_0x31b5e0[_0x9554('0x3c')][0x1]?_0x31b5e0[_0x9554('0x3c')][0x1][_0x9554('0x3d')]:undefined)||'0.00'},{'name':_0x9554('0x44'),'value':_0x31b5e0[_0x9554('0x44')]||(_0x31b5e0[_0x9554('0x3c')]&&_0x31b5e0[_0x9554('0x3c')][0x2]?_0x31b5e0[_0x9554('0x3c')][0x2][_0x9554('0x3d')]:undefined)||0xc}];case _0x9554('0x45'):return[{'name':_0x9554('0x46'),'value':_0x31b5e0[_0x9554('0x46')]||(_0x31b5e0[_0x9554('0x3c')]&&_0x31b5e0[_0x9554('0x3c')][0x0]?_0x31b5e0['attrs'][0x0]['value']:undefined)||'total'},{'name':_0x9554('0x47'),'value':_0x31b5e0['attrVoiceQueues']||(_0x31b5e0[_0x9554('0x3c')]&&_0x31b5e0[_0x9554('0x3c')][0x1]?_0x31b5e0['attrs'][0x1][_0x9554('0x3d')]:undefined)||[]},{'name':_0x9554('0x44'),'value':_0x31b5e0[_0x9554('0x44')]||(_0x31b5e0['attrs']&&_0x31b5e0[_0x9554('0x3c')][0x2]?_0x31b5e0[_0x9554('0x3c')][0x2][_0x9554('0x3d')]:undefined)||0x14},{'name':_0x9554('0x48'),'value':_0x31b5e0[_0x9554('0x48')]||(_0x31b5e0[_0x9554('0x3c')]&&_0x31b5e0[_0x9554('0x3c')][0x3]?_0x31b5e0[_0x9554('0x3c')][0x3][_0x9554('0x3d')]:undefined)||_0x9554('0x49')},{'name':'attrEmailAccounts','value':_0x31b5e0[_0x9554('0x4a')]||(_0x31b5e0[_0x9554('0x3c')]&&_0x31b5e0['attrs'][0x4]?_0x31b5e0[_0x9554('0x3c')][0x4][_0x9554('0x3d')]:undefined)||''},{'name':_0x9554('0x4b'),'value':_0x31b5e0[_0x9554('0x4b')]||(_0x31b5e0[_0x9554('0x3c')]&&_0x31b5e0[_0x9554('0x3c')][0x5]?_0x31b5e0[_0x9554('0x3c')][0x5][_0x9554('0x3d')]:undefined)||''},{'name':_0x9554('0x4c'),'value':_0x31b5e0[_0x9554('0x4c')]||(_0x31b5e0[_0x9554('0x3c')]&&_0x31b5e0['attrs'][0x6]?_0x31b5e0['attrs'][0x6][_0x9554('0x3d')]:undefined)||''},{'name':_0x9554('0x4d'),'value':_0x31b5e0['attrOpenchannelAccounts']||(_0x31b5e0[_0x9554('0x3c')]&&_0x31b5e0['attrs'][0x7]?_0x31b5e0[_0x9554('0x3c')][0x7][_0x9554('0x3d')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x31b5e0['attrWhatsappAccounts']||(_0x31b5e0['attrs']&&_0x31b5e0[_0x9554('0x3c')][0x8]?_0x31b5e0[_0x9554('0x3c')][0x8][_0x9554('0x3d')]:undefined)||''},{'name':'attrChatWebsites','value':_0x31b5e0[_0x9554('0x4e')]||(_0x31b5e0[_0x9554('0x3c')]&&_0x31b5e0[_0x9554('0x3c')][0x9]?_0x31b5e0['attrs'][0x9][_0x9554('0x3d')]:undefined)||''}];case _0x9554('0x4f'):case _0x9554('0x50'):return[{'name':_0x9554('0x51'),'value':_0x31b5e0[_0x9554('0x51')]||(_0x31b5e0['attrs']&&_0x31b5e0[_0x9554('0x3c')][0x0]?_0x31b5e0[_0x9554('0x3c')][0x0][_0x9554('0x3d')]:undefined)||_0x9554('0x52')},{'name':_0x9554('0x53'),'value':_0x31b5e0[_0x9554('0x53')]||(_0x31b5e0[_0x9554('0x3c')]&&_0x31b5e0[_0x9554('0x3c')][0x1]?_0x31b5e0[_0x9554('0x3c')][0x1][_0x9554('0x3d')]:undefined)||null},{'name':_0x9554('0x54'),'value':_0x31b5e0[_0x9554('0x54')]||(_0x31b5e0[_0x9554('0x3c')]&&_0x31b5e0[_0x9554('0x3c')][0x2]?_0x31b5e0[_0x9554('0x3c')][0x2][_0x9554('0x3d')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x31b5e0[_0x9554('0x47')]||(_0x31b5e0[_0x9554('0x3c')]&&_0x31b5e0[_0x9554('0x3c')][0x3]?_0x31b5e0[_0x9554('0x3c')][0x3][_0x9554('0x3d')]:undefined)||[]},{'name':_0x9554('0x48'),'value':_0x31b5e0[_0x9554('0x48')]||(_0x31b5e0[_0x9554('0x3c')]&&_0x31b5e0[_0x9554('0x3c')][0x4]?_0x31b5e0[_0x9554('0x3c')][0x4][_0x9554('0x3d')]:undefined)||_0x9554('0x49')},{'name':_0x9554('0x4a'),'value':_0x31b5e0[_0x9554('0x4a')]||(_0x31b5e0[_0x9554('0x3c')]&&_0x31b5e0[_0x9554('0x3c')][0x5]?_0x31b5e0[_0x9554('0x3c')][0x5][_0x9554('0x3d')]:undefined)||''},{'name':_0x9554('0x4b'),'value':_0x31b5e0[_0x9554('0x4b')]||(_0x31b5e0[_0x9554('0x3c')]&&_0x31b5e0[_0x9554('0x3c')][0x6]?_0x31b5e0[_0x9554('0x3c')][0x6][_0x9554('0x3d')]:undefined)||''},{'name':_0x9554('0x4c'),'value':_0x31b5e0[_0x9554('0x4c')]||(_0x31b5e0[_0x9554('0x3c')]&&_0x31b5e0[_0x9554('0x3c')][0x7]?_0x31b5e0['attrs'][0x7][_0x9554('0x3d')]:undefined)||''},{'name':_0x9554('0x4d'),'value':_0x31b5e0[_0x9554('0x4d')]||(_0x31b5e0[_0x9554('0x3c')]&&_0x31b5e0[_0x9554('0x3c')][0x8]?_0x31b5e0[_0x9554('0x3c')][0x8][_0x9554('0x3d')]:undefined)||''},{'name':_0x9554('0x55'),'value':_0x31b5e0[_0x9554('0x55')]||(_0x31b5e0['attrs']&&_0x31b5e0[_0x9554('0x3c')][0x9]?_0x31b5e0['attrs'][0x9]['value']:undefined)||''},{'name':_0x9554('0x4e'),'value':_0x31b5e0[_0x9554('0x4e')]||(_0x31b5e0[_0x9554('0x3c')]&&_0x31b5e0[_0x9554('0x3c')][0xa]?_0x31b5e0[_0x9554('0x3c')][0xa]['value']:undefined)||''}];case _0x9554('0x56'):return[{'name':_0x9554('0x57'),'type':_0x31b5e0[_0x9554('0x58')]||(_0x31b5e0[_0x9554('0x3c')]&&_0x31b5e0[_0x9554('0x3c')][0x0]?_0x31b5e0['attrs'][0x0][_0x9554('0x39')]:undefined)||null,'value':_0x31b5e0[_0x9554('0x57')]||(_0x31b5e0[_0x9554('0x3c')]&&_0x31b5e0['attrs'][0x0]?_0x31b5e0[_0x9554('0x3c')][0x0][_0x9554('0x3d')]:undefined)||null},{'name':'attrRefresh','value':_0x31b5e0[_0x9554('0x59')]||(_0x31b5e0[_0x9554('0x3c')]&&_0x31b5e0[_0x9554('0x3c')][0x1]?_0x31b5e0[_0x9554('0x3c')][0x1][_0x9554('0x3d')]:undefined)||0x0}];default:return[];}}catch(_0x4003ad){logger[_0x9554('0x29')](_0x9554('0x5a'),JSON[_0x9554('0x5b')](_0x4003ad));return[];}}exports['create']=function(_0x186a41,_0xff64f5){if(_0x186a41[_0x9554('0x5c')]){_0x186a41['body']['attrs']=widgetAttributes(_0x186a41[_0x9554('0x5c')]);}return db[_0x9554('0x2f')][_0x9554('0x5d')](_0x186a41[_0x9554('0x5c')],{})[_0x9554('0x27')](respondWithResult(_0xff64f5,0xc9))[_0x9554('0x38')](handleError(_0xff64f5,null));};exports[_0x9554('0x26')]=function(_0x1fdf00,_0x2d6f8b){if(_0x1fdf00[_0x9554('0x5c')]['id']){delete _0x1fdf00[_0x9554('0x5c')]['id'];}_0x1fdf00[_0x9554('0x5c')]['attrs']=widgetAttributes(_0x1fdf00['body']);return db[_0x9554('0x2f')][_0x9554('0x5e')]({'where':{'id':_0x1fdf00[_0x9554('0x5f')]['id']}})['then'](handleEntityNotFound(_0x2d6f8b,null))['then'](saveUpdates(_0x1fdf00[_0x9554('0x5c')],null))[_0x9554('0x27')](respondWithResult(_0x2d6f8b,null))[_0x9554('0x38')](handleError(_0x2d6f8b,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 4541a7b..343d141 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 _0x8de5=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','DashboardItem','setMaxListeners','save'];(function(_0x4ccf81,_0x23fb4a){var _0x2fa977=function(_0x42700c){while(--_0x42700c){_0x4ccf81['push'](_0x4ccf81['shift']());}};_0x2fa977(++_0x23fb4a);}(_0x8de5,0xd7));var _0x58de=function(_0xd69c13,_0x3799b8){_0xd69c13=_0xd69c13-0x0;var _0x308f14=_0x8de5[_0xd69c13];return _0x308f14;};'use strict';var EventEmitter=require(_0x58de('0x0'));var DashboardItem=require(_0x58de('0x1'))['db'][_0x58de('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x58de('0x3')](0x0);var events={'afterCreate':_0x58de('0x4'),'afterUpdate':_0x58de('0x5'),'afterDestroy':'remove'};function emitEvent(_0xfa97de){return function(_0x462ce0,_0xf1b9d9,_0x5cf370){DashboardItemEvents[_0x58de('0x6')](_0xfa97de+':'+_0x462ce0['id'],_0x462ce0);DashboardItemEvents[_0x58de('0x6')](_0xfa97de,_0x462ce0);_0x5cf370(null);};}for(var e in events){if(events[_0x58de('0x7')](e)){var event=events[e];DashboardItem[_0x58de('0x8')](e,emitEvent(event));}}module[_0x58de('0x9')]=DashboardItemEvents; \ No newline at end of file +var _0x8ab3=['save','update','emit','hook','events','../../mysqldb','setMaxListeners'];(function(_0x2ae769,_0x282cf1){var _0x2eade7=function(_0x48745b){while(--_0x48745b){_0x2ae769['push'](_0x2ae769['shift']());}};_0x2eade7(++_0x282cf1);}(_0x8ab3,0x1a8));var _0x38ab=function(_0x89d79e,_0x3b5ddf){_0x89d79e=_0x89d79e-0x0;var _0x1a01c7=_0x8ab3[_0x89d79e];return _0x1a01c7;};'use strict';var EventEmitter=require(_0x38ab('0x0'));var DashboardItem=require(_0x38ab('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x38ab('0x2')](0x0);var events={'afterCreate':_0x38ab('0x3'),'afterUpdate':_0x38ab('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2ae019){return function(_0x3f2155,_0x36e163,_0x38c184){DashboardItemEvents[_0x38ab('0x5')](_0x2ae019+':'+_0x3f2155['id'],_0x3f2155);DashboardItemEvents[_0x38ab('0x5')](_0x2ae019,_0x3f2155);_0x38c184(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x38ab('0x6')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 9e1c1ca..da62835 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 _0x6475=['./dashboardItem.attributes','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x70397e,_0x4362f6){var _0x5617bb=function(_0x5724aa){while(--_0x5724aa){_0x70397e['push'](_0x70397e['shift']());}};_0x5617bb(++_0x4362f6);}(_0x6475,0x133));var _0x5647=function(_0x51b2f7,_0x303ad2){_0x51b2f7=_0x51b2f7-0x0;var _0x556d95=_0x6475[_0x51b2f7];return _0x556d95;};'use strict';var _=require(_0x5647('0x0'));var util=require(_0x5647('0x1'));var logger=require(_0x5647('0x2'))('api');var moment=require(_0x5647('0x3'));var BPromise=require(_0x5647('0x4'));var rp=require(_0x5647('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5647('0x6'));var config=require(_0x5647('0x7'));var attributes=require(_0x5647('0x8'));module['exports']=function(_0x3ee5db,_0x6cb9ef){return _0x3ee5db['define']('DashboardItem',attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9f2b=['dashboard_items','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem'];(function(_0x4ef5aa,_0x244ad4){var _0x1f9c38=function(_0x19707b){while(--_0x19707b){_0x4ef5aa['push'](_0x4ef5aa['shift']());}};_0x1f9c38(++_0x244ad4);}(_0x9f2b,0xb7));var _0xb9f2=function(_0x21b000,_0x2b6808){_0x21b000=_0x21b000-0x0;var _0x37697d=_0x9f2b[_0x21b000];return _0x37697d;};'use strict';var _=require(_0xb9f2('0x0'));var util=require(_0xb9f2('0x1'));var logger=require(_0xb9f2('0x2'))(_0xb9f2('0x3'));var moment=require(_0xb9f2('0x4'));var BPromise=require(_0xb9f2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb9f2('0x6'));var rimraf=require(_0xb9f2('0x7'));var config=require(_0xb9f2('0x8'));var attributes=require(_0xb9f2('0x9'));module[_0xb9f2('0xa')]=function(_0x51c17f,_0x486eca){return _0x51c17f[_0xb9f2('0xb')](_0xb9f2('0xc'),attributes,{'tableName':_0xb9f2('0xd'),'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 154106c..2facda4 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 _0x13a9=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','register','then','info','DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util'];(function(_0x450689,_0x3b857c){var _0x46ffb0=function(_0x5d3679){while(--_0x5d3679){_0x450689['push'](_0x450689['shift']());}};_0x46ffb0(++_0x3b857c);}(_0x13a9,0xae));var _0x913a=function(_0x5862dc,_0x3a7490){_0x5862dc=_0x5862dc-0x0;var _0x43f2bc=_0x13a9[_0x5862dc];return _0x43f2bc;};'use strict';var _=require('lodash');var util=require(_0x913a('0x0'));var moment=require(_0x913a('0x1'));var BPromise=require(_0x913a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x913a('0x3'));var db=require(_0x913a('0x4'))['db'];var utils=require(_0x913a('0x5'));var logger=require(_0x913a('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x913a('0x7'));var client=jayson['client'][_0x913a('0x8')]({'port':0x232a});config['redis']=_[_0x913a('0x9')](config[_0x913a('0xa')],{'host':_0x913a('0xb'),'port':0x18eb});var socket=require(_0x913a('0xc'))(new Redis(config[_0x913a('0xa')]));require('./dashboardItem.socket')[_0x913a('0xd')](socket);function respondWithRpcPromise(_0x38a80f,_0x307f6b,_0x6f09e5){return new BPromise(function(_0x4a0510,_0x34ce4b){return client['request'](_0x38a80f,_0x6f09e5)[_0x913a('0xe')](function(_0x1e1734){logger[_0x913a('0xf')](_0x913a('0x10'),_0x307f6b,'request\x20sent');logger[_0x913a('0x11')](_0x913a('0x12'),_0x307f6b,'request\x20sent',JSON[_0x913a('0x13')](_0x1e1734));if(_0x1e1734[_0x913a('0x14')]){if(_0x1e1734[_0x913a('0x14')][_0x913a('0x15')]===0x1f4){logger['error'](_0x913a('0x10'),_0x307f6b,_0x1e1734[_0x913a('0x14')][_0x913a('0x16')]);return _0x34ce4b(_0x1e1734['error'][_0x913a('0x16')]);}logger[_0x913a('0x14')](_0x913a('0x10'),_0x307f6b,_0x1e1734[_0x913a('0x14')][_0x913a('0x16')]);return _0x4a0510(_0x1e1734[_0x913a('0x14')][_0x913a('0x16')]);}else{logger[_0x913a('0xf')](_0x913a('0x10'),_0x307f6b,'request\x20sent');_0x4a0510(_0x1e1734[_0x913a('0x17')]['message']);}})[_0x913a('0x18')](function(_0x4e92b5){logger[_0x913a('0x14')](_0x913a('0x10'),_0x307f6b,_0x4e92b5);_0x34ce4b(_0x4e92b5);});});} \ No newline at end of file +var _0x4226=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./dashboardItem.socket','register','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x596ea7,_0x15715e){var _0x5452df=function(_0x4378fe){while(--_0x4378fe){_0x596ea7['push'](_0x596ea7['shift']());}};_0x5452df(++_0x15715e);}(_0x4226,0x194));var _0x6422=function(_0x49ac47,_0x2816d0){_0x49ac47=_0x49ac47-0x0;var _0x17ce1d=_0x4226[_0x49ac47];return _0x17ce1d;};'use strict';var _=require(_0x6422('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6422('0x1'));var rs=require(_0x6422('0x2'));var fs=require('fs');var Redis=require(_0x6422('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6422('0x4'));var logger=require(_0x6422('0x5'))(_0x6422('0x6'));var config=require(_0x6422('0x7'));var jayson=require(_0x6422('0x8'));var client=jayson['client'][_0x6422('0x9')]({'port':0x232a});config[_0x6422('0xa')]=_[_0x6422('0xb')](config[_0x6422('0xa')],{'host':_0x6422('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6422('0xa')]));require(_0x6422('0xd'))[_0x6422('0xe')](socket);function respondWithRpcPromise(_0x5182c1,_0x1e1b47,_0x475f66){return new BPromise(function(_0x14aa6e,_0x4ea9b7){return client['request'](_0x5182c1,_0x475f66)[_0x6422('0xf')](function(_0x8be45b){logger[_0x6422('0x10')](_0x6422('0x11'),_0x1e1b47,_0x6422('0x12'));logger[_0x6422('0x13')](_0x6422('0x14'),_0x1e1b47,'request\x20sent',JSON[_0x6422('0x15')](_0x8be45b));if(_0x8be45b['error']){if(_0x8be45b[_0x6422('0x16')][_0x6422('0x17')]===0x1f4){logger[_0x6422('0x16')](_0x6422('0x11'),_0x1e1b47,_0x8be45b[_0x6422('0x16')][_0x6422('0x18')]);return _0x4ea9b7(_0x8be45b[_0x6422('0x16')][_0x6422('0x18')]);}logger['error'](_0x6422('0x11'),_0x1e1b47,_0x8be45b[_0x6422('0x16')][_0x6422('0x18')]);return _0x14aa6e(_0x8be45b['error'][_0x6422('0x18')]);}else{logger[_0x6422('0x10')](_0x6422('0x11'),_0x1e1b47,'request\x20sent');_0x14aa6e(_0x8be45b[_0x6422('0x19')][_0x6422('0x18')]);}})[_0x6422('0x1a')](function(_0x4348d3){logger[_0x6422('0x16')](_0x6422('0x11'),_0x1e1b47,_0x4348d3);_0x4ea9b7(_0x4348d3);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 5621d89..44db3c2 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 _0x9d35=['length','dashboardItem:','remove','emit','register'];(function(_0x325bd2,_0x4d1356){var _0xbb3a25=function(_0x46ad48){while(--_0x46ad48){_0x325bd2['push'](_0x325bd2['shift']());}};_0xbb3a25(++_0x4d1356);}(_0x9d35,0x1bf));var _0x59d3=function(_0x44cd28,_0x1502d9){_0x44cd28=_0x44cd28-0x0;var _0x39356e=_0x9d35[_0x44cd28];return _0x39356e;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=['save',_0x59d3('0x0'),'update'];function createListener(_0x13050f,_0x335511){return function(_0x41dc86){_0x335511[_0x59d3('0x1')](_0x13050f,_0x41dc86);};}function removeListener(_0x41914c,_0x1d4713){return function(){DashboardItemEvents['removeListener'](_0x41914c,_0x1d4713);};}exports[_0x59d3('0x2')]=function(_0x406deb){for(var _0xae0237=0x0,_0xb22627=events[_0x59d3('0x3')];_0xae0237<_0xb22627;_0xae0237++){var _0x312a3a=events[_0xae0237];var _0x47ad6e=createListener(_0x59d3('0x4')+_0x312a3a,_0x406deb);DashboardItemEvents['on'](_0x312a3a,_0x47ad6e);}}; \ No newline at end of file +var _0x2cf3=['removeListener','length','dashboardItem:','./dashboardItem.events','save','remove','update'];(function(_0x444254,_0x1d9fb1){var _0x2d2156=function(_0x4a4038){while(--_0x4a4038){_0x444254['push'](_0x444254['shift']());}};_0x2d2156(++_0x1d9fb1);}(_0x2cf3,0x8f));var _0x32cf=function(_0x1ceb7f,_0x5a5b34){_0x1ceb7f=_0x1ceb7f-0x0;var _0x4541c0=_0x2cf3[_0x1ceb7f];return _0x4541c0;};'use strict';var DashboardItemEvents=require(_0x32cf('0x0'));var events=[_0x32cf('0x1'),_0x32cf('0x2'),_0x32cf('0x3')];function createListener(_0x2b44fa,_0xe0bf31){return function(_0x2b9e16){_0xe0bf31['emit'](_0x2b44fa,_0x2b9e16);};}function removeListener(_0xe53082,_0x6d88e4){return function(){DashboardItemEvents[_0x32cf('0x4')](_0xe53082,_0x6d88e4);};}exports['register']=function(_0x29da06){for(var _0xff683=0x0,_0x49038f=events[_0x32cf('0x5')];_0xff683<_0x49038f;_0xff683++){var _0x53bc17=events[_0xff683];var _0x186bd7=createListener(_0x32cf('0x6')+_0x53bc17,_0x29da06);DashboardItemEvents['on'](_0x53bc17,_0x186bd7);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 1261ee3..5a6a9c9 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 _0x4e3d=['create','update','/:id','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','show','isAuthenticated'];(function(_0x1da5f4,_0x44bca7){var _0x58e944=function(_0x3393ae){while(--_0x3393ae){_0x1da5f4['push'](_0x1da5f4['shift']());}};_0x58e944(++_0x44bca7);}(_0x4e3d,0x9a));var _0xd4e3=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x4e3d[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require('multer');var util=require(_0xd4e3('0x0'));var path=require(_0xd4e3('0x1'));var timeout=require('connect-timeout');var express=require(_0xd4e3('0x2'));var router=express[_0xd4e3('0x3')]();var fs_extra=require(_0xd4e3('0x4'));var auth=require(_0xd4e3('0x5'));var interaction=require(_0xd4e3('0x6'));var config=require(_0xd4e3('0x7'));var controller=require(_0xd4e3('0x8'));router['get']('/:id',auth['isAuthenticated'](),controller[_0xd4e3('0x9')]);router['post']('/',auth[_0xd4e3('0xa')](),controller[_0xd4e3('0xb')]);router['put']('/:id',auth[_0xd4e3('0xa')](),controller[_0xd4e3('0xc')]);router['delete'](_0xd4e3('0xd'),auth['isAuthenticated'](),controller[_0xd4e3('0xe')]);module['exports']=router; \ No newline at end of file +var _0x2c9f=['fs-extra','../../components/auth/service','../../components/interaction/service','./dashboardItem.controller','get','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x35344a,_0x1790b6){var _0x285085=function(_0x30a6ca){while(--_0x30a6ca){_0x35344a['push'](_0x35344a['shift']());}};_0x285085(++_0x1790b6);}(_0x2c9f,0x1d6));var _0xf2c9=function(_0x47216a,_0x2a8fac){_0x47216a=_0x47216a-0x0;var _0x53d0af=_0x2c9f[_0x47216a];return _0x53d0af;};'use strict';var multer=require(_0xf2c9('0x0'));var util=require(_0xf2c9('0x1'));var path=require(_0xf2c9('0x2'));var timeout=require(_0xf2c9('0x3'));var express=require(_0xf2c9('0x4'));var router=express['Router']();var fs_extra=require(_0xf2c9('0x5'));var auth=require(_0xf2c9('0x6'));var interaction=require(_0xf2c9('0x7'));var config=require('../../config/environment');var controller=require(_0xf2c9('0x8'));router[_0xf2c9('0x9')](_0xf2c9('0xa'),auth[_0xf2c9('0xb')](),controller[_0xf2c9('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf2c9('0xd')]);router[_0xf2c9('0xe')](_0xf2c9('0xa'),auth[_0xf2c9('0xb')](),controller[_0xf2c9('0xf')]);router[_0xf2c9('0x10')](_0xf2c9('0xa'),auth['isAuthenticated'](),controller[_0xf2c9('0x11')]);module[_0xf2c9('0x12')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index f63030f..c0a406e 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 _0x8f1d=['exports','ENUM','first','STRING'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x8f1d,0x1a0));var _0xd8f1=function(_0x38af48,_0x400460){_0x38af48=_0x38af48-0x0;var _0x445384=_0x8f1d[_0x38af48];return _0x445384;};'use strict';var Sequelize=require('sequelize');module[_0xd8f1('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0xd8f1('0x1')](_0xd8f1('0x2'),'second','third'),'allowNull':![],'defaultValue':_0xd8f1('0x2')},'description':{'type':Sequelize[_0xd8f1('0x3')]}}; \ No newline at end of file +var _0x5f2e=['third','STRING','sequelize','ENUM','second'];(function(_0x1da108,_0xaa4e05){var _0x3eff99=function(_0x1d908e){while(--_0x1d908e){_0x1da108['push'](_0x1da108['shift']());}};_0x3eff99(++_0xaa4e05);}(_0x5f2e,0x106));var _0xe5f2=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5f2e[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xe5f2('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0xe5f2('0x1')]('first',_0xe5f2('0x2'),_0xe5f2('0x3')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0xe5f2('0x4')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 21bb8f1..074cd14 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 _0xbcc7=['find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Dispositions','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','eml-format','rimraf','fast-json-patch','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','then','destroy','get','error','stack','name','send','index','map','Disposition','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','include','findAll','rows','show','params','rawAttributes','includeAll'];(function(_0x1633a0,_0x3cdfc1){var _0x523846=function(_0x564b28){while(--_0x564b28){_0x1633a0['push'](_0x1633a0['shift']());}};_0x523846(++_0x3cdfc1);}(_0xbcc7,0x19a));var _0x7bcc=function(_0x58ae8a,_0x3c619e){_0x58ae8a=_0x58ae8a-0x0;var _0x2f0b6b=_0xbcc7[_0x58ae8a];return _0x2f0b6b;};'use strict';var emlformat=require(_0x7bcc('0x0'));var rimraf=require(_0x7bcc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7bcc('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7bcc('0x3'));var Mustache=require('mustache');var util=require(_0x7bcc('0x4'));var path=require(_0x7bcc('0x5'));var sox=require('sox');var csv=require(_0x7bcc('0x6'));var ejs=require(_0x7bcc('0x7'));var fs=require('fs');var fs_extra=require(_0x7bcc('0x8'));var _=require(_0x7bcc('0x9'));var squel=require(_0x7bcc('0xa'));var crypto=require(_0x7bcc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7bcc('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7bcc('0xd'));var Papa=require(_0x7bcc('0xe'));var Redis=require('ioredis');var authService=require(_0x7bcc('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7bcc('0x10'))(_0x7bcc('0x11'));var utils=require(_0x7bcc('0x12'));var config=require(_0x7bcc('0x13'));var licenseUtil=require(_0x7bcc('0x14'));var db=require(_0x7bcc('0x15'))['db'];function respondWithStatusCode(_0xae46e8,_0x51b0e8){_0x51b0e8=_0x51b0e8||0xcc;return function(_0x3e3580){if(_0x3e3580){return _0xae46e8[_0x7bcc('0x16')](_0x51b0e8);}return _0xae46e8[_0x7bcc('0x17')](_0x51b0e8)[_0x7bcc('0x18')]();};}function respondWithResult(_0x39f912,_0x217896){_0x217896=_0x217896||0xc8;return function(_0x4a2539){if(_0x4a2539){return _0x39f912[_0x7bcc('0x17')](_0x217896)[_0x7bcc('0x19')](_0x4a2539);}};}function respondWithFilteredResult(_0x148618,_0x461ff7){return function(_0x30caa2){if(_0x30caa2){var _0x134d55=typeof _0x461ff7[_0x7bcc('0x1a')]==='undefined'&&typeof _0x461ff7[_0x7bcc('0x1b')]==='undefined';var _0x3156f3=_0x30caa2[_0x7bcc('0x1c')];var _0x340bd6=_0x134d55?0x0:_0x461ff7[_0x7bcc('0x1a')];var _0x49168c=_0x134d55?_0x30caa2['count']:_0x461ff7[_0x7bcc('0x1a')]+_0x461ff7[_0x7bcc('0x1b')];var _0x1a1b7f;if(_0x49168c>=_0x3156f3){_0x49168c=_0x3156f3;_0x1a1b7f=0xc8;}else{_0x1a1b7f=0xce;}_0x148618[_0x7bcc('0x17')](_0x1a1b7f);return _0x148618[_0x7bcc('0x1d')](_0x7bcc('0x1e'),_0x340bd6+'-'+_0x49168c+'/'+_0x3156f3)[_0x7bcc('0x19')](_0x30caa2);}return null;};}function patchUpdates(_0x3d0719){return function(_0x15b2c3){try{jsonpatch['apply'](_0x15b2c3,_0x3d0719,!![]);}catch(_0x553865){return BPromise[_0x7bcc('0x1f')](_0x553865);}return _0x15b2c3[_0x7bcc('0x20')]();};}function saveUpdates(_0x34ee2a,_0x3050cf){return function(_0x201f40){if(_0x201f40){return _0x201f40[_0x7bcc('0x21')](_0x34ee2a)[_0x7bcc('0x22')](function(_0x345671){return _0x345671;});}return null;};}function removeEntity(_0x32b3ea,_0x54c611){return function(_0x2d25b8){if(_0x2d25b8){return _0x2d25b8[_0x7bcc('0x23')]()[_0x7bcc('0x22')](function(){var _0x3875df=_0x2d25b8[_0x7bcc('0x24')]({'plain':!![]});var _0x1d085c='Dispositions';return db['UserProfileResource'][_0x7bcc('0x23')]({'where':{'type':_0x1d085c,'resourceId':_0x3875df['id']}})['then'](function(){return _0x2d25b8;});})['then'](function(){_0x32b3ea[_0x7bcc('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f79a0,_0xe594c6){return function(_0x1725e5){if(!_0x1725e5){_0x3f79a0['sendStatus'](0x194);}return _0x1725e5;};}function handleError(_0x17c3ce,_0x1dea55){_0x1dea55=_0x1dea55||0x1f4;return function(_0x2e92e1){logger[_0x7bcc('0x25')](_0x2e92e1[_0x7bcc('0x26')]);if(_0x2e92e1[_0x7bcc('0x27')]){delete _0x2e92e1[_0x7bcc('0x27')];}_0x17c3ce['status'](_0x1dea55)[_0x7bcc('0x28')](_0x2e92e1);};}exports[_0x7bcc('0x29')]=function(_0x51105b,_0x5d4131){var _0x472b73={},_0x5010ab={},_0x19bda9={'count':0x0,'rows':[]};var _0x284476=_[_0x7bcc('0x2a')](db[_0x7bcc('0x2b')]['rawAttributes'],function(_0x351c12){return{'name':_0x351c12[_0x7bcc('0x2c')],'type':_0x351c12[_0x7bcc('0x2d')]['key']};});_0x5010ab[_0x7bcc('0x2e')]=_[_0x7bcc('0x2a')](_0x284476,_0x7bcc('0x27'));_0x5010ab[_0x7bcc('0x2f')]=_[_0x7bcc('0x30')](_0x51105b[_0x7bcc('0x2f')]);_0x5010ab[_0x7bcc('0x31')]=_[_0x7bcc('0x32')](_0x5010ab[_0x7bcc('0x2e')],_0x5010ab[_0x7bcc('0x2f')]);_0x472b73[_0x7bcc('0x33')]=_['intersection'](_0x5010ab[_0x7bcc('0x2e')],qs[_0x7bcc('0x34')](_0x51105b[_0x7bcc('0x2f')]['fields']));_0x472b73['attributes']=_0x472b73[_0x7bcc('0x33')][_0x7bcc('0x35')]?_0x472b73[_0x7bcc('0x33')]:_0x5010ab[_0x7bcc('0x2e')];if(!_0x51105b[_0x7bcc('0x2f')][_0x7bcc('0x36')](_0x7bcc('0x37'))){_0x472b73['limit']=qs['limit'](_0x51105b['query']['limit']);_0x472b73[_0x7bcc('0x1a')]=qs[_0x7bcc('0x1a')](_0x51105b[_0x7bcc('0x2f')]['offset']);}_0x472b73[_0x7bcc('0x38')]=qs[_0x7bcc('0x39')](_0x51105b[_0x7bcc('0x2f')]['sort']);_0x472b73['where']=qs[_0x7bcc('0x31')](_[_0x7bcc('0x3a')](_0x51105b[_0x7bcc('0x2f')],_0x5010ab['filters']),_0x284476);if(_0x51105b['query'][_0x7bcc('0x3b')]){_0x472b73[_0x7bcc('0x3c')]=_[_0x7bcc('0x3d')](_0x472b73['where'],{'$or':_[_0x7bcc('0x2a')](_0x284476,function(_0x3f3357){if(_0x3f3357[_0x7bcc('0x2d')]!==_0x7bcc('0x3e')){var _0x10bd59={};_0x10bd59[_0x3f3357[_0x7bcc('0x27')]]={'$like':'%'+_0x51105b['query'][_0x7bcc('0x3b')]+'%'};return _0x10bd59;}})});}_0x472b73=_[_0x7bcc('0x3d')]({},_0x472b73,_0x51105b['options']);var _0x10618e={'where':_0x472b73[_0x7bcc('0x3c')]};return db[_0x7bcc('0x2b')][_0x7bcc('0x1c')](_0x10618e)[_0x7bcc('0x22')](function(_0x1b4d75){_0x19bda9[_0x7bcc('0x1c')]=_0x1b4d75;if(_0x51105b[_0x7bcc('0x2f')]['includeAll']){_0x472b73[_0x7bcc('0x3f')]=[{'all':!![]}];}return db[_0x7bcc('0x2b')][_0x7bcc('0x40')](_0x472b73);})[_0x7bcc('0x22')](function(_0x4074d7){_0x19bda9[_0x7bcc('0x41')]=_0x4074d7;return _0x19bda9;})['then'](respondWithFilteredResult(_0x5d4131,_0x472b73))['catch'](handleError(_0x5d4131,null));};exports[_0x7bcc('0x42')]=function(_0x2f502a,_0x59aa4e){var _0x2adb79={'raw':!![],'where':{'id':_0x2f502a[_0x7bcc('0x43')]['id']}},_0x2d3938={};_0x2d3938[_0x7bcc('0x2e')]=_[_0x7bcc('0x30')](db[_0x7bcc('0x2b')][_0x7bcc('0x44')]);_0x2d3938['query']=_[_0x7bcc('0x30')](_0x2f502a[_0x7bcc('0x2f')]);_0x2d3938[_0x7bcc('0x31')]=_[_0x7bcc('0x32')](_0x2d3938[_0x7bcc('0x2e')],_0x2d3938['query']);_0x2adb79[_0x7bcc('0x33')]=_[_0x7bcc('0x32')](_0x2d3938['model'],qs[_0x7bcc('0x34')](_0x2f502a[_0x7bcc('0x2f')][_0x7bcc('0x34')]));_0x2adb79['attributes']=_0x2adb79[_0x7bcc('0x33')][_0x7bcc('0x35')]?_0x2adb79['attributes']:_0x2d3938[_0x7bcc('0x2e')];if(_0x2f502a[_0x7bcc('0x2f')][_0x7bcc('0x45')]){_0x2adb79[_0x7bcc('0x3f')]=[{'all':!![]}];}_0x2adb79=_[_0x7bcc('0x3d')]({},_0x2adb79,_0x2f502a['options']);return db[_0x7bcc('0x2b')][_0x7bcc('0x46')](_0x2adb79)['then'](handleEntityNotFound(_0x59aa4e,null))[_0x7bcc('0x22')](respondWithResult(_0x59aa4e,null))['catch'](handleError(_0x59aa4e,null));};exports[_0x7bcc('0x47')]=function(_0x5d4654,_0x29cb88){return db['Disposition']['create'](_0x5d4654[_0x7bcc('0x48')],{})[_0x7bcc('0x22')](function(_0x487361){var _0x16e40d=_0x5d4654[_0x7bcc('0x49')][_0x7bcc('0x24')]({'plain':!![]});if(!_0x16e40d)throw new Error(_0x7bcc('0x4a'));if(_0x16e40d[_0x7bcc('0x4b')]===_0x7bcc('0x49')){var _0x2304f0=_0x487361[_0x7bcc('0x24')]({'plain':!![]});var _0x40fde8=_0x7bcc('0x4c');return db[_0x7bcc('0x4d')][_0x7bcc('0x46')]({'where':{'name':_0x40fde8,'userProfileId':_0x16e40d['userProfileId']},'raw':!![]})[_0x7bcc('0x22')](function(_0x370465){if(_0x370465&&_0x370465['autoAssociation']===0x0){return db['UserProfileResource'][_0x7bcc('0x47')]({'name':_0x2304f0[_0x7bcc('0x27')],'resourceId':_0x2304f0['id'],'type':_0x370465['name'],'sectionId':_0x370465['id']},{})['then'](function(){return _0x487361;});}else{return _0x487361;}})['catch'](function(_0x52b09d){logger['error'](_0x7bcc('0x4e'),_0x52b09d);throw _0x52b09d;});}return _0x487361;})[_0x7bcc('0x22')](respondWithResult(_0x29cb88,0xc9))['catch'](handleError(_0x29cb88,null));};exports['update']=function(_0x432d84,_0x392b88){if(_0x432d84[_0x7bcc('0x48')]['id']){delete _0x432d84[_0x7bcc('0x48')]['id'];}return db[_0x7bcc('0x2b')][_0x7bcc('0x46')]({'where':{'id':_0x432d84['params']['id']}})['then'](handleEntityNotFound(_0x392b88,null))[_0x7bcc('0x22')](saveUpdates(_0x432d84[_0x7bcc('0x48')],null))[_0x7bcc('0x22')](respondWithResult(_0x392b88,null))[_0x7bcc('0x4f')](handleError(_0x392b88,null));};exports['destroy']=function(_0x495396,_0x5a0e09){return db[_0x7bcc('0x2b')]['find']({'where':{'id':_0x495396[_0x7bcc('0x43')]['id']}})[_0x7bcc('0x22')](handleEntityNotFound(_0x5a0e09,null))[_0x7bcc('0x22')](removeEntity(_0x5a0e09,null))['catch'](handleError(_0x5a0e09,null));}; \ No newline at end of file +var _0xda7a=['filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','show','params','includeAll','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','apply','update','destroy','then','get','Dispositions','UserProfileResource','sendStatus','error','stack','name','index','map','Disposition','rawAttributes','fieldName','type','key','query','keys'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda7a,0x15a));var _0xada7=function(_0x868c5b,_0xd62d10){_0x868c5b=_0x868c5b-0x0;var _0x166662=_0xda7a[_0x868c5b];return _0x166662;};'use strict';var emlformat=require(_0xada7('0x0'));var rimraf=require(_0xada7('0x1'));var zipdir=require(_0xada7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xada7('0x3'));var moment=require(_0xada7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xada7('0x5'));var util=require(_0xada7('0x6'));var path=require('path');var sox=require(_0xada7('0x7'));var csv=require(_0xada7('0x8'));var ejs=require(_0xada7('0x9'));var fs=require('fs');var fs_extra=require(_0xada7('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xada7('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xada7('0xc'));var toCsv=require(_0xada7('0x8'));var querystring=require(_0xada7('0xd'));var Papa=require(_0xada7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xada7('0xf'));var as=require(_0xada7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xada7('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xada7('0x12'));var licenseUtil=require(_0xada7('0x13'));var db=require(_0xada7('0x14'))['db'];function respondWithStatusCode(_0x2464fe,_0x1fb24c){_0x1fb24c=_0x1fb24c||0xcc;return function(_0xee824f){if(_0xee824f){return _0x2464fe['sendStatus'](_0x1fb24c);}return _0x2464fe[_0xada7('0x15')](_0x1fb24c)[_0xada7('0x16')]();};}function respondWithResult(_0x44880f,_0x150905){_0x150905=_0x150905||0xc8;return function(_0xedb550){if(_0xedb550){return _0x44880f[_0xada7('0x15')](_0x150905)[_0xada7('0x17')](_0xedb550);}};}function respondWithFilteredResult(_0x3274da,_0x3a551b){return function(_0x508afa){if(_0x508afa){var _0x29780e=typeof _0x3a551b[_0xada7('0x18')]===_0xada7('0x19')&&typeof _0x3a551b['limit']===_0xada7('0x19');var _0x341578=_0x508afa['count'];var _0x41fb96=_0x29780e?0x0:_0x3a551b[_0xada7('0x18')];var _0x18a363=_0x29780e?_0x508afa[_0xada7('0x1a')]:_0x3a551b[_0xada7('0x18')]+_0x3a551b[_0xada7('0x1b')];var _0x2edc81;if(_0x18a363>=_0x341578){_0x18a363=_0x341578;_0x2edc81=0xc8;}else{_0x2edc81=0xce;}_0x3274da['status'](_0x2edc81);return _0x3274da['set'](_0xada7('0x1c'),_0x41fb96+'-'+_0x18a363+'/'+_0x341578)[_0xada7('0x17')](_0x508afa);}return null;};}function patchUpdates(_0x491416){return function(_0x207624){try{jsonpatch[_0xada7('0x1d')](_0x207624,_0x491416,!![]);}catch(_0x3d2771){return BPromise['reject'](_0x3d2771);}return _0x207624['save']();};}function saveUpdates(_0x47bef3,_0x5d06e7){return function(_0x5e1c74){if(_0x5e1c74){return _0x5e1c74[_0xada7('0x1e')](_0x47bef3)['then'](function(_0x39f237){return _0x39f237;});}return null;};}function removeEntity(_0xce523f,_0x17ca2d){return function(_0x554d6a){if(_0x554d6a){return _0x554d6a[_0xada7('0x1f')]()[_0xada7('0x20')](function(){var _0x16971a=_0x554d6a[_0xada7('0x21')]({'plain':!![]});var _0x34fd0e=_0xada7('0x22');return db[_0xada7('0x23')][_0xada7('0x1f')]({'where':{'type':_0x34fd0e,'resourceId':_0x16971a['id']}})[_0xada7('0x20')](function(){return _0x554d6a;});})['then'](function(){_0xce523f[_0xada7('0x15')](0xcc)[_0xada7('0x16')]();});}};}function handleEntityNotFound(_0x299648,_0x471891){return function(_0x515181){if(!_0x515181){_0x299648[_0xada7('0x24')](0x194);}return _0x515181;};}function handleError(_0x482423,_0x4a1b2f){_0x4a1b2f=_0x4a1b2f||0x1f4;return function(_0x386d90){logger[_0xada7('0x25')](_0x386d90[_0xada7('0x26')]);if(_0x386d90[_0xada7('0x27')]){delete _0x386d90['name'];}_0x482423[_0xada7('0x15')](_0x4a1b2f)['send'](_0x386d90);};}exports[_0xada7('0x28')]=function(_0x93a8a2,_0x10cf96){var _0x529f4d={},_0x22a2d3={},_0x425013={'count':0x0,'rows':[]};var _0x55a1aa=_[_0xada7('0x29')](db[_0xada7('0x2a')][_0xada7('0x2b')],function(_0x2f05d9){return{'name':_0x2f05d9[_0xada7('0x2c')],'type':_0x2f05d9[_0xada7('0x2d')][_0xada7('0x2e')]};});_0x22a2d3['model']=_[_0xada7('0x29')](_0x55a1aa,_0xada7('0x27'));_0x22a2d3[_0xada7('0x2f')]=_[_0xada7('0x30')](_0x93a8a2['query']);_0x22a2d3[_0xada7('0x31')]=_[_0xada7('0x32')](_0x22a2d3[_0xada7('0x33')],_0x22a2d3[_0xada7('0x2f')]);_0x529f4d[_0xada7('0x34')]=_[_0xada7('0x32')](_0x22a2d3[_0xada7('0x33')],qs[_0xada7('0x35')](_0x93a8a2[_0xada7('0x2f')][_0xada7('0x35')]));_0x529f4d[_0xada7('0x34')]=_0x529f4d[_0xada7('0x34')][_0xada7('0x36')]?_0x529f4d[_0xada7('0x34')]:_0x22a2d3['model'];if(!_0x93a8a2['query'][_0xada7('0x37')](_0xada7('0x38'))){_0x529f4d[_0xada7('0x1b')]=qs[_0xada7('0x1b')](_0x93a8a2[_0xada7('0x2f')][_0xada7('0x1b')]);_0x529f4d[_0xada7('0x18')]=qs['offset'](_0x93a8a2['query'][_0xada7('0x18')]);}_0x529f4d[_0xada7('0x39')]=qs[_0xada7('0x3a')](_0x93a8a2['query'][_0xada7('0x3a')]);_0x529f4d[_0xada7('0x3b')]=qs[_0xada7('0x31')](_[_0xada7('0x3c')](_0x93a8a2[_0xada7('0x2f')],_0x22a2d3[_0xada7('0x31')]),_0x55a1aa);if(_0x93a8a2[_0xada7('0x2f')]['filter']){_0x529f4d[_0xada7('0x3b')]=_[_0xada7('0x3d')](_0x529f4d[_0xada7('0x3b')],{'$or':_['map'](_0x55a1aa,function(_0x38a412){if(_0x38a412[_0xada7('0x2d')]!==_0xada7('0x3e')){var _0x39721a={};_0x39721a[_0x38a412[_0xada7('0x27')]]={'$like':'%'+_0x93a8a2[_0xada7('0x2f')][_0xada7('0x3f')]+'%'};return _0x39721a;}})});}_0x529f4d=_[_0xada7('0x3d')]({},_0x529f4d,_0x93a8a2[_0xada7('0x40')]);var _0xb514b2={'where':_0x529f4d[_0xada7('0x3b')]};return db[_0xada7('0x2a')]['count'](_0xb514b2)[_0xada7('0x20')](function(_0x530a87){_0x425013[_0xada7('0x1a')]=_0x530a87;if(_0x93a8a2[_0xada7('0x2f')]['includeAll']){_0x529f4d[_0xada7('0x41')]=[{'all':!![]}];}return db[_0xada7('0x2a')]['findAll'](_0x529f4d);})[_0xada7('0x20')](function(_0x364e87){_0x425013['rows']=_0x364e87;return _0x425013;})[_0xada7('0x20')](respondWithFilteredResult(_0x10cf96,_0x529f4d))['catch'](handleError(_0x10cf96,null));};exports[_0xada7('0x42')]=function(_0x39eef7,_0x31e681){var _0x316cc7={'raw':!![],'where':{'id':_0x39eef7[_0xada7('0x43')]['id']}},_0xe3c086={};_0xe3c086[_0xada7('0x33')]=_[_0xada7('0x30')](db['Disposition'][_0xada7('0x2b')]);_0xe3c086[_0xada7('0x2f')]=_[_0xada7('0x30')](_0x39eef7[_0xada7('0x2f')]);_0xe3c086[_0xada7('0x31')]=_[_0xada7('0x32')](_0xe3c086[_0xada7('0x33')],_0xe3c086[_0xada7('0x2f')]);_0x316cc7[_0xada7('0x34')]=_[_0xada7('0x32')](_0xe3c086[_0xada7('0x33')],qs[_0xada7('0x35')](_0x39eef7['query'][_0xada7('0x35')]));_0x316cc7[_0xada7('0x34')]=_0x316cc7[_0xada7('0x34')][_0xada7('0x36')]?_0x316cc7[_0xada7('0x34')]:_0xe3c086[_0xada7('0x33')];if(_0x39eef7['query'][_0xada7('0x44')]){_0x316cc7[_0xada7('0x41')]=[{'all':!![]}];}_0x316cc7=_[_0xada7('0x3d')]({},_0x316cc7,_0x39eef7[_0xada7('0x40')]);return db[_0xada7('0x2a')]['find'](_0x316cc7)[_0xada7('0x20')](handleEntityNotFound(_0x31e681,null))[_0xada7('0x20')](respondWithResult(_0x31e681,null))[_0xada7('0x45')](handleError(_0x31e681,null));};exports[_0xada7('0x46')]=function(_0x21f1c8,_0x5778f1){return db[_0xada7('0x2a')]['create'](_0x21f1c8[_0xada7('0x47')],{})[_0xada7('0x20')](function(_0x59e86d){var _0x3501b2=_0x21f1c8['user']['get']({'plain':!![]});if(!_0x3501b2)throw new Error(_0xada7('0x48'));if(_0x3501b2[_0xada7('0x49')]==='user'){var _0x15360=_0x59e86d[_0xada7('0x21')]({'plain':!![]});var _0xbc532f=_0xada7('0x22');return db[_0xada7('0x4a')][_0xada7('0x4b')]({'where':{'name':_0xbc532f,'userProfileId':_0x3501b2[_0xada7('0x4c')]},'raw':!![]})[_0xada7('0x20')](function(_0x3c37d0){if(_0x3c37d0&&_0x3c37d0[_0xada7('0x4d')]===0x0){return db[_0xada7('0x23')][_0xada7('0x46')]({'name':_0x15360['name'],'resourceId':_0x15360['id'],'type':_0x3c37d0['name'],'sectionId':_0x3c37d0['id']},{})[_0xada7('0x20')](function(){return _0x59e86d;});}else{return _0x59e86d;}})[_0xada7('0x45')](function(_0x276a52){logger['error'](_0xada7('0x4e'),_0x276a52);throw _0x276a52;});}return _0x59e86d;})['then'](respondWithResult(_0x5778f1,0xc9))[_0xada7('0x45')](handleError(_0x5778f1,null));};exports[_0xada7('0x1e')]=function(_0x54087c,_0x2673fa){if(_0x54087c[_0xada7('0x47')]['id']){delete _0x54087c['body']['id'];}return db['Disposition'][_0xada7('0x4b')]({'where':{'id':_0x54087c['params']['id']}})[_0xada7('0x20')](handleEntityNotFound(_0x2673fa,null))[_0xada7('0x20')](saveUpdates(_0x54087c[_0xada7('0x47')],null))[_0xada7('0x20')](respondWithResult(_0x2673fa,null))['catch'](handleError(_0x2673fa,null));};exports['destroy']=function(_0x58322a,_0x467efc){return db[_0xada7('0x2a')]['find']({'where':{'id':_0x58322a[_0xada7('0x43')]['id']}})[_0xada7('0x20')](handleEntityNotFound(_0x467efc,null))[_0xada7('0x20')](removeEntity(_0x467efc,null))[_0xada7('0x45')](handleError(_0x467efc,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 106ffc4..77e918f 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 _0x95a4=['name','ChatWebsiteId','name_mail','MailAccountId','name_sms','name_fax','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','ListId','name_chat'];(function(_0x2acfaf,_0x5f505d){var _0x405e56=function(_0x4dc4e7){while(--_0x4dc4e7){_0x2acfaf['push'](_0x2acfaf['shift']());}};_0x405e56(++_0x5f505d);}(_0x95a4,0x6e));var _0x495a=function(_0x2a74b1,_0x4880eb){_0x2a74b1=_0x2a74b1-0x0;var _0x2f9736=_0x95a4[_0x2a74b1];return _0x2f9736;};'use strict';var _=require(_0x495a('0x0'));var util=require(_0x495a('0x1'));var logger=require(_0x495a('0x2'))('api');var moment=require(_0x495a('0x3'));var BPromise=require(_0x495a('0x4'));var rp=require(_0x495a('0x5'));var fs=require('fs');var path=require(_0x495a('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x495a('0x7'));module[_0x495a('0x8')]=function(_0x1a2e26,_0x571ba6){return _0x1a2e26[_0x495a('0x9')](_0x495a('0xa'),attributes,{'tableName':_0x495a('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x495a('0xc'),'fields':['name',_0x495a('0xd')]},{'unique':!![],'name':_0x495a('0xe'),'fields':[_0x495a('0xf'),_0x495a('0x10')]},{'unique':!![],'name':_0x495a('0x11'),'fields':[_0x495a('0xf'),_0x495a('0x12')]},{'unique':!![],'name':_0x495a('0x13'),'fields':[_0x495a('0xf'),'SmsAccountId']},{'unique':!![],'name':_0x495a('0x14'),'fields':[_0x495a('0xf'),'FaxAccountId']},{'unique':!![],'name':_0x495a('0x15'),'fields':[_0x495a('0xf'),_0x495a('0x16')]},{'unique':!![],'name':_0x495a('0x17'),'fields':[_0x495a('0xf'),_0x495a('0x18')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe6db=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','exports','define','Disposition','tools_dispositions','name_voice','name','name_chat','MailAccountId','name_sms','SmsAccountId','name_fax','name_openchannel','OpenchannelAccountId','name_whatsapp'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0xe6db,0xf2));var _0xbe6d=function(_0x426566,_0x188bc7){_0x426566=_0x426566-0x0;var _0x288ef1=_0xe6db[_0x426566];return _0x288ef1;};'use strict';var _=require(_0xbe6d('0x0'));var util=require(_0xbe6d('0x1'));var logger=require('../../config/logger')(_0xbe6d('0x2'));var moment=require(_0xbe6d('0x3'));var BPromise=require(_0xbe6d('0x4'));var rp=require(_0xbe6d('0x5'));var fs=require('fs');var path=require(_0xbe6d('0x6'));var rimraf=require(_0xbe6d('0x7'));var config=require('../../config/environment');var attributes=require('./disposition.attributes');module[_0xbe6d('0x8')]=function(_0x13ca71,_0x1c0b18){return _0x13ca71[_0xbe6d('0x9')](_0xbe6d('0xa'),attributes,{'tableName':_0xbe6d('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xbe6d('0xc'),'fields':[_0xbe6d('0xd'),'ListId']},{'unique':!![],'name':_0xbe6d('0xe'),'fields':['name','ChatWebsiteId']},{'unique':!![],'name':'name_mail','fields':[_0xbe6d('0xd'),_0xbe6d('0xf')]},{'unique':!![],'name':_0xbe6d('0x10'),'fields':[_0xbe6d('0xd'),_0xbe6d('0x11')]},{'unique':!![],'name':_0xbe6d('0x12'),'fields':[_0xbe6d('0xd'),'FaxAccountId']},{'unique':!![],'name':_0xbe6d('0x13'),'fields':[_0xbe6d('0xd'),_0xbe6d('0x14')]},{'unique':!![],'name':_0xbe6d('0x15'),'fields':['name','WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 18fa4f8..128ffc8 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(_0x2ed5c0,_0x3b3a85){var _0x41c5c5=function(_0x1e2b77){while(--_0x1e2b77){_0x2ed5c0['push'](_0x2ed5c0['shift']());}};_0x41c5c5(++_0x3b3a85);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x5c10b5,_0x2dbbd2){var _0x140883=function(_0x1ab195){while(--_0x1ab195){_0x5c10b5['push'](_0x5c10b5['shift']());}};_0x140883(++_0x2dbbd2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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 88c0a05..da4a415 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 _0x04f1=['delete','destroy','exports','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','/:id','show','put','update'];(function(_0x2e4176,_0x4905e0){var _0x7f7d28=function(_0x2c6ece){while(--_0x2c6ece){_0x2e4176['push'](_0x2e4176['shift']());}};_0x7f7d28(++_0x4905e0);}(_0x04f1,0x15c));var _0x104f=function(_0x3bbef0,_0x44b26e){_0x3bbef0=_0x3bbef0-0x0;var _0x250671=_0x04f1[_0x3bbef0];return _0x250671;};'use strict';var multer=require('multer');var util=require(_0x104f('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x104f('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x104f('0x2'));var interaction=require(_0x104f('0x3'));var config=require(_0x104f('0x4'));var controller=require(_0x104f('0x5'));router[_0x104f('0x6')]('/',auth[_0x104f('0x7')](),controller['index']);router['get'](_0x104f('0x8'),auth['isAuthenticated'](),controller[_0x104f('0x9')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x104f('0xa')](_0x104f('0x8'),auth[_0x104f('0x7')](),controller[_0x104f('0xb')]);router[_0x104f('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x104f('0xd')]);module[_0x104f('0xe')]=router; \ No newline at end of file +var _0xdb1d=['../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','isAuthenticated','index','get','/:id','post','create','put','delete','destroy','multer','util','express','fs-extra'];(function(_0x2dc369,_0x3dcf1e){var _0x39f2a4=function(_0x5e43ff){while(--_0x5e43ff){_0x2dc369['push'](_0x2dc369['shift']());}};_0x39f2a4(++_0x3dcf1e);}(_0xdb1d,0x183));var _0xddb1=function(_0x1dc9fe,_0x244b6a){_0x1dc9fe=_0x1dc9fe-0x0;var _0x5bf8fd=_0xdb1d[_0x1dc9fe];return _0x5bf8fd;};'use strict';var multer=require(_0xddb1('0x0'));var util=require(_0xddb1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xddb1('0x2'));var router=express['Router']();var fs_extra=require(_0xddb1('0x3'));var auth=require(_0xddb1('0x4'));var interaction=require(_0xddb1('0x5'));var config=require(_0xddb1('0x6'));var controller=require(_0xddb1('0x7'));router['get']('/',auth[_0xddb1('0x8')](),controller[_0xddb1('0x9')]);router[_0xddb1('0xa')](_0xddb1('0xb'),auth[_0xddb1('0x8')](),controller['show']);router[_0xddb1('0xc')]('/',auth[_0xddb1('0x8')](),controller[_0xddb1('0xd')]);router[_0xddb1('0xe')](_0xddb1('0xb'),auth[_0xddb1('0x8')](),controller['update']);router[_0xddb1('0xf')](_0xddb1('0xb'),auth['isAuthenticated'](),controller[_0xddb1('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 31a00f9..fcefc71 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 _0xea52=['KHOMP','SIP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','exports','STRING','xCALLY\x20Motion\x20Fax','localstationid','ENUM','4800','7200','9600','12000','14400','2400','v17,v27,v29','INTEGER','DADHI'];(function(_0x23f7b8,_0x35cc4c){var _0x28f7d3=function(_0x353d5e){while(--_0x353d5e){_0x23f7b8['push'](_0x23f7b8['shift']());}};_0x28f7d3(++_0x35cc4c);}(_0xea52,0x162));var _0x2ea5=function(_0x1cb950,_0xc06e73){_0x1cb950=_0x1cb950-0x0;var _0x1bef44=_0xea52[_0x1cb950];return _0x1bef44;};'use strict';var Sequelize=require('sequelize');module[_0x2ea5('0x0')]={'name':{'type':Sequelize[_0x2ea5('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x2ea5('0x1')],'defaultValue':_0x2ea5('0x2')},'localstationid':{'type':Sequelize[_0x2ea5('0x1')],'unique':_0x2ea5('0x3')},'minrate':{'type':Sequelize[_0x2ea5('0x4')]('2400',_0x2ea5('0x5'),_0x2ea5('0x6'),_0x2ea5('0x7'),_0x2ea5('0x8'),_0x2ea5('0x9')),'defaultValue':_0x2ea5('0x5')},'maxrate':{'type':Sequelize['ENUM'](_0x2ea5('0xa'),_0x2ea5('0x5'),_0x2ea5('0x6'),_0x2ea5('0x7'),_0x2ea5('0x8'),_0x2ea5('0x9')),'defaultValue':_0x2ea5('0x9')},'modem':{'type':Sequelize[_0x2ea5('0x1')],'defaultValue':_0x2ea5('0xb')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x2ea5('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x2ea5('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x2ea5('0x4')]('SIP','IAX',_0x2ea5('0xd'),_0x2ea5('0xe')),'defaultValue':_0x2ea5('0xf')},'key':{'type':Sequelize[_0x2ea5('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x2ea5('0x10')],'defaultValue':function(){return _0x2ea5('0x11');}},'notificationSound':{'type':Sequelize[_0x2ea5('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2ea5('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x2ea5('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2ea5('0xc')],'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[_0x2ea5('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x2ea5('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x2ea5('0x12')],'defaultValue':![],'comment':_0x2ea5('0x14'),'set':function(_0x219ed5){if(!_0x219ed5)this[_0x2ea5('0x15')]('mandatoryDispositionPauseId',null);this[_0x2ea5('0x15')](_0x2ea5('0x16'),_0x219ed5);}}}; \ No newline at end of file +var _0xc05a=['14400','12000','v17,v27,v29','INTEGER','IAX','DADHI','KHOMP','SIP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','9600'];(function(_0x530151,_0x27ab6d){var _0x129774=function(_0x57f945){while(--_0x57f945){_0x530151['push'](_0x530151['shift']());}};_0x129774(++_0x27ab6d);}(_0xc05a,0xc5));var _0xac05=function(_0x569f58,_0x56995f){_0x569f58=_0x569f58-0x0;var _0x53a616=_0xc05a[_0x569f58];return _0x53a616;};'use strict';var Sequelize=require(_0xac05('0x0'));module[_0xac05('0x1')]={'name':{'type':Sequelize[_0xac05('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xac05('0x2')]},'ecm':{'type':Sequelize[_0xac05('0x3')](_0xac05('0x4'),'no'),'defaultValue':_0xac05('0x4')},'headerinfo':{'type':Sequelize[_0xac05('0x2')],'defaultValue':_0xac05('0x5')},'localstationid':{'type':Sequelize['STRING'],'unique':_0xac05('0x6')},'minrate':{'type':Sequelize[_0xac05('0x3')](_0xac05('0x7'),_0xac05('0x8'),_0xac05('0x9'),_0xac05('0xa'),'12000',_0xac05('0xb')),'defaultValue':_0xac05('0x8')},'maxrate':{'type':Sequelize[_0xac05('0x3')]('2400',_0xac05('0x8'),_0xac05('0x9'),_0xac05('0xa'),_0xac05('0xc'),'14400'),'defaultValue':'14400'},'modem':{'type':Sequelize[_0xac05('0x2')],'defaultValue':_0xac05('0xd')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xac05('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xac05('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xac05('0x3')]('SIP',_0xac05('0xf'),_0xac05('0x10'),_0xac05('0x11')),'defaultValue':_0xac05('0x12')},'key':{'type':Sequelize[_0xac05('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xac05('0x13')],'defaultValue':function(){return _0xac05('0x14');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xac05('0x15')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xac05('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xac05('0x15')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xac05('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xac05('0x15')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xac05('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xac05('0xe')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xac05('0x15')],'defaultValue':![],'comment':_0xac05('0x16'),'set':function(_0x230717){if(!_0x230717)this[_0xac05('0x17')](_0xac05('0x18'),null);this['setDataValue'](_0xac05('0x19'),_0x230717);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 25da1fd..742602a 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 _0x6c89=['model','attributes','query','fields','length','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','Pause','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addDisposition','Disposition','getDispositions','findOne','hasOwnProperty','removeDispositions','ids','addAnswer','FaxAccountId','CannedAnswer','getAnswers','addInteraction','FaxInteraction','omit','getInteractions','Contact','User','Owner','internal','Tag','Tags','color','tag','transaction','sequelize','FaxApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','context','from-voip-provider','exten','localstationid','app','system','description','push','Answer','CDR(type)=inbound-fax','Set','gateway','faxdetect','headerinfo','maxrate','minrate','t38timeout','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','tech','key','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','CmList','List','Contacts','DESC','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','CmContact','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','spread','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','socket.io-emitter','register','jayson/promise','client','http','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','FaxAccounts','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','FaxAccount','rawAttributes','fieldName','map','keys','filters','intersection'];(function(_0x235563,_0x260ece){var _0x219be0=function(_0xef2469){while(--_0xef2469){_0x235563['push'](_0x235563['shift']());}};_0x219be0(++_0x260ece);}(_0x6c89,0x7c));var _0x96c8=function(_0x17ee38,_0x4b06f3){_0x17ee38=_0x17ee38-0x0;var _0x21e302=_0x6c89[_0x17ee38];return _0x21e302;};'use strict';var emlformat=require(_0x96c8('0x0'));var rimraf=require(_0x96c8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x96c8('0x2'));var rp=require(_0x96c8('0x3'));var moment=require(_0x96c8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x96c8('0x5'));var util=require(_0x96c8('0x6'));var path=require(_0x96c8('0x7'));var sox=require(_0x96c8('0x8'));var csv=require('to-csv');var ejs=require(_0x96c8('0x9'));var fs=require('fs');var fs_extra=require(_0x96c8('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x96c8('0xb'));var jsforce=require(_0x96c8('0xc'));var deskjs=require(_0x96c8('0xd'));var toCsv=require(_0x96c8('0xe'));var querystring=require(_0x96c8('0xf'));var Papa=require(_0x96c8('0x10'));var Redis=require(_0x96c8('0x11'));var authService=require(_0x96c8('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x96c8('0x13'));var logger=require(_0x96c8('0x14'))(_0x96c8('0x15'));var utils=require(_0x96c8('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x96c8('0x17'))['db'];config['redis']=_[_0x96c8('0x18')](config[_0x96c8('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x96c8('0x1a'))(new Redis(config[_0x96c8('0x19')]));require('./faxAccount.socket')[_0x96c8('0x1b')](socket);var jayson=require(_0x96c8('0x1c'));var client=jayson[_0x96c8('0x1d')][_0x96c8('0x1e')]({'port':0x232c});var client9002=jayson[_0x96c8('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x208150,_0x95b3a8,_0x217073,_0x220abf){return new BPromise(function(_0x5efff2,_0x367c2a){var _0x20471b=_0x220abf||client;return _0x20471b['request'](_0x208150,_0x217073)['then'](function(_0x49d46b){logger[_0x96c8('0x1f')](_0x96c8('0x20'),_0x95b3a8,'request\x20sent');logger[_0x96c8('0x21')](_0x96c8('0x22'),_0x95b3a8,'request\x20sent',JSON['stringify'](_0x49d46b));if(_0x49d46b['error']){if(_0x49d46b[_0x96c8('0x23')][_0x96c8('0x24')]===0x1f4){logger[_0x96c8('0x23')]('FaxAccount,\x20%s,\x20%s',_0x95b3a8,_0x49d46b[_0x96c8('0x23')][_0x96c8('0x25')]);return _0x367c2a(_0x49d46b['error'][_0x96c8('0x25')]);}logger[_0x96c8('0x23')](_0x96c8('0x20'),_0x95b3a8,_0x49d46b[_0x96c8('0x23')]['message']);return _0x5efff2(_0x49d46b[_0x96c8('0x23')][_0x96c8('0x25')]);}else{logger[_0x96c8('0x1f')](_0x96c8('0x20'),_0x95b3a8,'request\x20sent');_0x5efff2(_0x49d46b[_0x96c8('0x26')]['message']);}})[_0x96c8('0x27')](function(_0x5c36e9){logger[_0x96c8('0x23')](_0x96c8('0x20'),_0x95b3a8,_0x5c36e9);_0x367c2a(_0x5c36e9);});});}function respondWithStatusCode(_0x760e75,_0x153944){_0x153944=_0x153944||0xcc;return function(_0x45b51e){if(_0x45b51e){return _0x760e75[_0x96c8('0x28')](_0x153944);}return _0x760e75[_0x96c8('0x29')](_0x153944)[_0x96c8('0x2a')]();};}function respondWithResult(_0x5ebcca,_0x2bcdb8){_0x2bcdb8=_0x2bcdb8||0xc8;return function(_0x417611){if(_0x417611){return _0x5ebcca[_0x96c8('0x29')](_0x2bcdb8)[_0x96c8('0x2b')](_0x417611);}};}function respondWithFilteredResult(_0x4b9e93,_0x4bbf43){return function(_0x436175){if(_0x436175){var _0x4460b3=typeof _0x4bbf43[_0x96c8('0x2c')]===_0x96c8('0x2d')&&typeof _0x4bbf43[_0x96c8('0x2e')]===_0x96c8('0x2d');var _0x48c247=_0x436175[_0x96c8('0x2f')];var _0x399c99=_0x4460b3?0x0:_0x4bbf43['offset'];var _0x3009fc=_0x4460b3?_0x436175[_0x96c8('0x2f')]:_0x4bbf43[_0x96c8('0x2c')]+_0x4bbf43[_0x96c8('0x2e')];var _0x1800ef;if(_0x3009fc>=_0x48c247){_0x3009fc=_0x48c247;_0x1800ef=0xc8;}else{_0x1800ef=0xce;}_0x4b9e93[_0x96c8('0x29')](_0x1800ef);return _0x4b9e93[_0x96c8('0x30')](_0x96c8('0x31'),_0x399c99+'-'+_0x3009fc+'/'+_0x48c247)[_0x96c8('0x2b')](_0x436175);}return null;};}function patchUpdates(_0x6a0ef8){return function(_0x40360a){try{jsonpatch[_0x96c8('0x32')](_0x40360a,_0x6a0ef8,!![]);}catch(_0x52891e){return BPromise[_0x96c8('0x33')](_0x52891e);}return _0x40360a[_0x96c8('0x34')]();};}function saveUpdates(_0x4b1968,_0xb43497){return function(_0x5c9862){if(_0x5c9862){return _0x5c9862[_0x96c8('0x35')](_0x4b1968)[_0x96c8('0x36')](function(_0xd81b0f){return _0xd81b0f;});}return null;};}function removeEntity(_0x5b9797,_0x2dda07){return function(_0xc395bd){if(_0xc395bd){return _0xc395bd[_0x96c8('0x37')]()[_0x96c8('0x36')](function(){var _0x40316f=_0xc395bd[_0x96c8('0x38')]({'plain':!![]});var _0x195912=_0x96c8('0x39');return db[_0x96c8('0x3a')][_0x96c8('0x37')]({'where':{'type':_0x195912,'resourceId':_0x40316f['id']}})['then'](function(){return _0xc395bd;});})[_0x96c8('0x36')](function(){_0x5b9797[_0x96c8('0x29')](0xcc)[_0x96c8('0x2a')]();});}};}function handleEntityNotFound(_0x39983b,_0x10a7b1){return function(_0x2ded13){if(!_0x2ded13){_0x39983b[_0x96c8('0x28')](0x194);}return _0x2ded13;};}function handleError(_0x35b651,_0x5de149){_0x5de149=_0x5de149||0x1f4;return function(_0x1c6e1e){logger[_0x96c8('0x23')](_0x1c6e1e[_0x96c8('0x3b')]);if(_0x1c6e1e[_0x96c8('0x3c')]){delete _0x1c6e1e[_0x96c8('0x3c')];}_0x35b651[_0x96c8('0x29')](_0x5de149)[_0x96c8('0x3d')](_0x1c6e1e);};}exports[_0x96c8('0x3e')]=function(_0x4e55b8,_0x1d2efa){var _0x2538ac={'include':[{'model':db['Pause'],'as':_0x96c8('0x3f')}]},_0x1019c3={},_0x3ce7d2={'count':0x0,'rows':[]};var _0x1ddbbb=_['map'](db[_0x96c8('0x40')][_0x96c8('0x41')],function(_0xf2df4a){return{'name':_0xf2df4a[_0x96c8('0x42')],'type':_0xf2df4a['type']['key']};});_0x1019c3['model']=_[_0x96c8('0x43')](_0x1ddbbb,_0x96c8('0x3c'));_0x1019c3['query']=_[_0x96c8('0x44')](_0x4e55b8['query']);_0x1019c3[_0x96c8('0x45')]=_[_0x96c8('0x46')](_0x1019c3[_0x96c8('0x47')],_0x1019c3['query']);_0x2538ac[_0x96c8('0x48')]=_['intersection'](_0x1019c3[_0x96c8('0x47')],qs['fields'](_0x4e55b8[_0x96c8('0x49')][_0x96c8('0x4a')]));_0x2538ac['attributes']=_0x2538ac[_0x96c8('0x48')][_0x96c8('0x4b')]?_0x2538ac[_0x96c8('0x48')]:_0x1019c3[_0x96c8('0x47')];if(!_0x4e55b8[_0x96c8('0x49')]['hasOwnProperty'](_0x96c8('0x4c'))){_0x2538ac['limit']=qs['limit'](_0x4e55b8[_0x96c8('0x49')][_0x96c8('0x2e')]);_0x2538ac[_0x96c8('0x2c')]=qs[_0x96c8('0x2c')](_0x4e55b8[_0x96c8('0x49')][_0x96c8('0x2c')]);}_0x2538ac[_0x96c8('0x4d')]=qs[_0x96c8('0x4e')](_0x4e55b8[_0x96c8('0x49')][_0x96c8('0x4e')]);_0x2538ac['where']=qs[_0x96c8('0x45')](_[_0x96c8('0x4f')](_0x4e55b8[_0x96c8('0x49')],_0x1019c3[_0x96c8('0x45')]),_0x1ddbbb);if(_0x4e55b8['query'][_0x96c8('0x50')]){_0x2538ac[_0x96c8('0x51')]=_[_0x96c8('0x52')](_0x2538ac[_0x96c8('0x51')],{'$or':_[_0x96c8('0x43')](_0x1ddbbb,function(_0x9b3f7c){if(_0x9b3f7c[_0x96c8('0x53')]!==_0x96c8('0x54')){var _0x56f4d7={};_0x56f4d7[_0x9b3f7c[_0x96c8('0x3c')]]={'$like':'%'+_0x4e55b8[_0x96c8('0x49')][_0x96c8('0x50')]+'%'};return _0x56f4d7;}})});}_0x2538ac=_['merge']({},_0x2538ac,_0x4e55b8[_0x96c8('0x55')]);var _0x53f842={'where':_0x2538ac[_0x96c8('0x51')]};return db[_0x96c8('0x40')][_0x96c8('0x2f')](_0x53f842)[_0x96c8('0x36')](function(_0x8e41b4){_0x3ce7d2[_0x96c8('0x2f')]=_0x8e41b4;if(_0x4e55b8['query'][_0x96c8('0x56')]){_0x2538ac[_0x96c8('0x57')]=[{'all':!![]}];}return db[_0x96c8('0x40')][_0x96c8('0x58')](_0x2538ac);})[_0x96c8('0x36')](function(_0x591fd5){_0x3ce7d2[_0x96c8('0x59')]=_0x591fd5;return _0x3ce7d2;})[_0x96c8('0x36')](respondWithFilteredResult(_0x1d2efa,_0x2538ac))[_0x96c8('0x27')](handleError(_0x1d2efa,null));};exports[_0x96c8('0x5a')]=function(_0xac65e7,_0x13cbd8){var _0x29f7f3={'raw':![],'where':{'id':_0xac65e7['params']['id']},'include':[{'model':db[_0x96c8('0x5b')],'as':_0x96c8('0x3f')}]},_0x42a1d8={};_0x42a1d8[_0x96c8('0x47')]=_[_0x96c8('0x44')](db[_0x96c8('0x40')][_0x96c8('0x41')]);_0x42a1d8[_0x96c8('0x49')]=_[_0x96c8('0x44')](_0xac65e7[_0x96c8('0x49')]);_0x42a1d8[_0x96c8('0x45')]=_[_0x96c8('0x46')](_0x42a1d8['model'],_0x42a1d8[_0x96c8('0x49')]);_0x29f7f3[_0x96c8('0x48')]=_['intersection'](_0x42a1d8[_0x96c8('0x47')],qs['fields'](_0xac65e7[_0x96c8('0x49')][_0x96c8('0x4a')]));_0x29f7f3[_0x96c8('0x48')]=_0x29f7f3[_0x96c8('0x48')]['length']?_0x29f7f3[_0x96c8('0x48')]:_0x42a1d8[_0x96c8('0x47')];if(_0xac65e7[_0x96c8('0x49')][_0x96c8('0x56')]){_0x29f7f3[_0x96c8('0x57')]=[{'all':!![]}];}_0x29f7f3=_[_0x96c8('0x52')]({},_0x29f7f3,_0xac65e7[_0x96c8('0x55')]);return db[_0x96c8('0x40')][_0x96c8('0x5c')](_0x29f7f3)[_0x96c8('0x36')](handleEntityNotFound(_0x13cbd8,null))['then'](respondWithResult(_0x13cbd8,null))[_0x96c8('0x27')](handleError(_0x13cbd8,null));};exports['create']=function(_0x2d42cf,_0x543ee7){return db['FaxAccount'][_0x96c8('0x5d')](_0x2d42cf[_0x96c8('0x5e')],{})[_0x96c8('0x36')](function(_0x39b379){var _0x10ca11=_0x2d42cf[_0x96c8('0x5f')]['get']({'plain':!![]});if(!_0x10ca11)throw new Error(_0x96c8('0x60'));if(_0x10ca11[_0x96c8('0x61')]===_0x96c8('0x5f')){var _0x399f59=_0x39b379[_0x96c8('0x38')]({'plain':!![]});var _0x1f8663=_0x96c8('0x39');return db[_0x96c8('0x62')][_0x96c8('0x5c')]({'where':{'name':_0x1f8663,'userProfileId':_0x10ca11[_0x96c8('0x63')]},'raw':!![]})['then'](function(_0x431f9d){if(_0x431f9d&&_0x431f9d['autoAssociation']===0x0){return db[_0x96c8('0x3a')][_0x96c8('0x5d')]({'name':_0x399f59[_0x96c8('0x3c')],'resourceId':_0x399f59['id'],'type':_0x431f9d[_0x96c8('0x3c')],'sectionId':_0x431f9d['id']},{})['then'](function(){return _0x39b379;});}else{return _0x39b379;}})[_0x96c8('0x27')](function(_0x1c5097){logger[_0x96c8('0x23')](_0x96c8('0x64'),_0x1c5097);throw _0x1c5097;});}return _0x39b379;})[_0x96c8('0x36')](respondWithResult(_0x543ee7,0xc9))[_0x96c8('0x27')](handleError(_0x543ee7,null));};exports['update']=function(_0x4f326e,_0x3a1a14){if(_0x4f326e[_0x96c8('0x5e')]['id']){delete _0x4f326e['body']['id'];}return db[_0x96c8('0x40')][_0x96c8('0x5c')]({'where':{'id':_0x4f326e[_0x96c8('0x65')]['id']},'include':[{'model':db['Pause'],'as':_0x96c8('0x3f')}]})[_0x96c8('0x36')](handleEntityNotFound(_0x3a1a14,null))['then'](saveUpdates(_0x4f326e[_0x96c8('0x5e')],null))[_0x96c8('0x36')](respondWithResult(_0x3a1a14,null))['catch'](handleError(_0x3a1a14,null));};exports[_0x96c8('0x37')]=function(_0x45d73b,_0x90819){return db[_0x96c8('0x40')][_0x96c8('0x5c')]({'where':{'id':_0x45d73b['params']['id']}})[_0x96c8('0x36')](handleEntityNotFound(_0x90819,null))[_0x96c8('0x36')](removeEntity(_0x90819,null))['catch'](handleError(_0x90819,null));};exports['describe']=function(_0x25e2c3,_0x195b69){return db[_0x96c8('0x40')]['describe']()[_0x96c8('0x36')](respondWithResult(_0x195b69,null))[_0x96c8('0x27')](handleError(_0x195b69,null));};exports[_0x96c8('0x66')]=function(_0x2f7142,_0x909fa,_0x4640fd){if(_0x2f7142['body']['id']){delete _0x2f7142['body']['id'];}return db[_0x96c8('0x40')][_0x96c8('0x5c')]({'where':{'id':_0x2f7142[_0x96c8('0x65')]['id']}})['then'](handleEntityNotFound(_0x909fa,null))[_0x96c8('0x36')](function(_0x577c2b){if(_0x577c2b){_0x2f7142[_0x96c8('0x5e')]['FaxAccountId']=_0x577c2b['id'];return db[_0x96c8('0x67')][_0x96c8('0x5d')](_0x2f7142[_0x96c8('0x5e')]);}})[_0x96c8('0x36')](respondWithResult(_0x909fa,null))[_0x96c8('0x27')](handleError(_0x909fa,null));};exports[_0x96c8('0x68')]=function(_0x912a1e,_0x4a08e0,_0x459f19){var _0x483d48={'raw':![],'where':{}};var _0x297c44={};var _0x14706c={'count':0x0,'rows':[]};return db[_0x96c8('0x40')][_0x96c8('0x69')]({'where':{'id':_0x912a1e[_0x96c8('0x65')]['id']}})[_0x96c8('0x36')](handleEntityNotFound(_0x4a08e0,null))['then'](function(_0x5ee2f0){if(_0x5ee2f0){_0x297c44[_0x96c8('0x47')]=_['keys'](db[_0x96c8('0x67')][_0x96c8('0x41')]);_0x297c44[_0x96c8('0x49')]=_[_0x96c8('0x44')](_0x912a1e['query']);_0x297c44[_0x96c8('0x45')]=_[_0x96c8('0x46')](_0x297c44[_0x96c8('0x47')],_0x297c44[_0x96c8('0x49')]);_0x483d48['attributes']=_[_0x96c8('0x46')](_0x297c44['model'],qs[_0x96c8('0x4a')](_0x912a1e[_0x96c8('0x49')][_0x96c8('0x4a')]));_0x483d48[_0x96c8('0x48')]=_0x483d48['attributes'][_0x96c8('0x4b')]?_0x483d48[_0x96c8('0x48')]:_0x297c44[_0x96c8('0x47')];if(!_0x912a1e[_0x96c8('0x49')][_0x96c8('0x6a')]('nolimit')){_0x483d48['limit']=qs[_0x96c8('0x2e')](_0x912a1e[_0x96c8('0x49')][_0x96c8('0x2e')]);_0x483d48['offset']=qs[_0x96c8('0x2c')](_0x912a1e[_0x96c8('0x49')][_0x96c8('0x2c')]);}_0x483d48['order']=qs['sort'](_0x912a1e['query'][_0x96c8('0x4e')]);_0x483d48['where']=qs[_0x96c8('0x45')](_[_0x96c8('0x4f')](_0x912a1e[_0x96c8('0x49')],_0x297c44[_0x96c8('0x45')]));_0x483d48[_0x96c8('0x51')]['FaxAccountId']=_0x5ee2f0['id'];if(_0x912a1e['query']['filter']){_0x483d48[_0x96c8('0x51')]=_[_0x96c8('0x52')](_0x483d48[_0x96c8('0x51')],{'$or':_[_0x96c8('0x43')](_0x483d48['attributes'],function(_0x15127f){var _0x574dfe={};_0x574dfe[_0x15127f]={'$like':'%'+_0x912a1e[_0x96c8('0x49')]['filter']+'%'};return _0x574dfe;})});}_0x483d48=_[_0x96c8('0x52')]({},_0x483d48,_0x912a1e[_0x96c8('0x55')]);return db[_0x96c8('0x67')]['count']({'where':_0x483d48[_0x96c8('0x51')]})[_0x96c8('0x36')](function(_0x4be50c){_0x14706c[_0x96c8('0x2f')]=_0x4be50c;if(_0x912a1e[_0x96c8('0x49')][_0x96c8('0x56')]){_0x483d48['include']=[{'all':!![]}];}return db[_0x96c8('0x67')][_0x96c8('0x58')](_0x483d48);})[_0x96c8('0x36')](function(_0x2d9981){_0x14706c[_0x96c8('0x59')]=_0x2d9981;return _0x14706c;});}})['then'](respondWithFilteredResult(_0x4a08e0,_0x483d48))[_0x96c8('0x27')](handleError(_0x4a08e0,null));};exports[_0x96c8('0x6b')]=function(_0x20d9d2,_0x5ced5d,_0x263525){return db[_0x96c8('0x40')][_0x96c8('0x5c')]({'where':{'id':_0x20d9d2['params']['id']}})['then'](handleEntityNotFound(_0x5ced5d,null))[_0x96c8('0x36')](function(_0x3424ed){if(_0x3424ed){return _0x3424ed[_0x96c8('0x6b')](_0x20d9d2[_0x96c8('0x49')][_0x96c8('0x6c')]);}})[_0x96c8('0x36')](respondWithStatusCode(_0x5ced5d,null))[_0x96c8('0x27')](handleError(_0x5ced5d,null));};exports[_0x96c8('0x6d')]=function(_0x400c10,_0x457021,_0x38d3a3){if(_0x400c10[_0x96c8('0x5e')]['id']){delete _0x400c10[_0x96c8('0x5e')]['id'];}return db[_0x96c8('0x40')][_0x96c8('0x5c')]({'where':{'id':_0x400c10[_0x96c8('0x65')]['id']}})['then'](handleEntityNotFound(_0x457021,null))[_0x96c8('0x36')](function(_0x43e92b){if(_0x43e92b){_0x400c10[_0x96c8('0x5e')][_0x96c8('0x6e')]=_0x43e92b['id'];return db[_0x96c8('0x6f')]['create'](_0x400c10[_0x96c8('0x5e')]);}})['then'](respondWithResult(_0x457021,null))[_0x96c8('0x27')](handleError(_0x457021,null));};exports[_0x96c8('0x70')]=function(_0x129f26,_0x15ec98,_0x48da42){var _0x1b904f={'raw':![],'where':{}};var _0x22e078={};var _0x33b5e7={'count':0x0,'rows':[]};return db[_0x96c8('0x40')][_0x96c8('0x69')]({'where':{'id':_0x129f26['params']['id']}})[_0x96c8('0x36')](handleEntityNotFound(_0x15ec98,null))[_0x96c8('0x36')](function(_0x126111){if(_0x126111){_0x22e078['model']=_[_0x96c8('0x44')](db[_0x96c8('0x6f')]['rawAttributes']);_0x22e078[_0x96c8('0x49')]=_['keys'](_0x129f26[_0x96c8('0x49')]);_0x22e078['filters']=_['intersection'](_0x22e078['model'],_0x22e078[_0x96c8('0x49')]);_0x1b904f[_0x96c8('0x48')]=_['intersection'](_0x22e078['model'],qs['fields'](_0x129f26[_0x96c8('0x49')][_0x96c8('0x4a')]));_0x1b904f[_0x96c8('0x48')]=_0x1b904f[_0x96c8('0x48')][_0x96c8('0x4b')]?_0x1b904f[_0x96c8('0x48')]:_0x22e078[_0x96c8('0x47')];if(!_0x129f26['query']['hasOwnProperty'](_0x96c8('0x4c'))){_0x1b904f['limit']=qs[_0x96c8('0x2e')](_0x129f26[_0x96c8('0x49')][_0x96c8('0x2e')]);_0x1b904f[_0x96c8('0x2c')]=qs[_0x96c8('0x2c')](_0x129f26['query']['offset']);}_0x1b904f['order']=qs['sort'](_0x129f26[_0x96c8('0x49')][_0x96c8('0x4e')]);_0x1b904f['where']=qs[_0x96c8('0x45')](_[_0x96c8('0x4f')](_0x129f26[_0x96c8('0x49')],_0x22e078['filters']));_0x1b904f[_0x96c8('0x51')][_0x96c8('0x6e')]=_0x126111['id'];if(_0x129f26[_0x96c8('0x49')]['filter']){_0x1b904f['where']=_['merge'](_0x1b904f[_0x96c8('0x51')],{'$or':_[_0x96c8('0x43')](_0x1b904f[_0x96c8('0x48')],function(_0x43371a){var _0x3ff992={};_0x3ff992[_0x43371a]={'$like':'%'+_0x129f26[_0x96c8('0x49')][_0x96c8('0x50')]+'%'};return _0x3ff992;})});}_0x1b904f=_['merge']({},_0x1b904f,_0x129f26[_0x96c8('0x55')]);return db[_0x96c8('0x6f')]['count']({'where':_0x1b904f[_0x96c8('0x51')]})[_0x96c8('0x36')](function(_0x3e6b35){_0x33b5e7[_0x96c8('0x2f')]=_0x3e6b35;if(_0x129f26['query'][_0x96c8('0x56')]){_0x1b904f[_0x96c8('0x57')]=[{'all':!![]}];}return db[_0x96c8('0x6f')][_0x96c8('0x58')](_0x1b904f);})[_0x96c8('0x36')](function(_0x7c876a){_0x33b5e7['rows']=_0x7c876a;return _0x33b5e7;});}})[_0x96c8('0x36')](respondWithFilteredResult(_0x15ec98,_0x1b904f))['catch'](handleError(_0x15ec98,null));};exports['removeAnswers']=function(_0x474c54,_0x1c57b2,_0x11db32){return db[_0x96c8('0x40')][_0x96c8('0x5c')]({'where':{'id':_0x474c54['params']['id']}})['then'](handleEntityNotFound(_0x1c57b2,null))[_0x96c8('0x36')](function(_0x5b1263){if(_0x5b1263){return _0x5b1263['removeAnswers'](_0x474c54[_0x96c8('0x49')][_0x96c8('0x6c')]);}})[_0x96c8('0x36')](respondWithStatusCode(_0x1c57b2,null))[_0x96c8('0x27')](handleError(_0x1c57b2,null));};exports[_0x96c8('0x71')]=function(_0x3d66d4,_0x4a7f9e,_0x183ee5){return db[_0x96c8('0x72')][_0x96c8('0x5c')]({'where':{'id':_0x3d66d4[_0x96c8('0x65')]['id']}})[_0x96c8('0x36')](handleEntityNotFound(_0x4a7f9e,null))[_0x96c8('0x36')](function(_0x2bdc62){if(_0x2bdc62){return _0x2bdc62[_0x96c8('0x71')](_0x3d66d4['body']['ids'],_[_0x96c8('0x73')](_0x3d66d4['body'],[_0x96c8('0x6c'),'id'])||{});}})['then'](respondWithResult(_0x4a7f9e,null))[_0x96c8('0x27')](handleError(_0x4a7f9e,null));};exports[_0x96c8('0x74')]=function(_0x2c745c,_0x335430,_0x5e8efc){var _0x48a0ec={'raw':![],'where':{}};var _0x217a43={};var _0x38211b={'count':0x0,'rows':[]};return db[_0x96c8('0x40')]['findOne']({'where':{'id':_0x2c745c[_0x96c8('0x65')]['id']}})[_0x96c8('0x36')](handleEntityNotFound(_0x335430,null))[_0x96c8('0x36')](function(_0x336e6b){if(_0x336e6b){_0x217a43[_0x96c8('0x47')]=_[_0x96c8('0x44')](db['FaxInteraction'][_0x96c8('0x41')]);_0x217a43[_0x96c8('0x49')]=_[_0x96c8('0x44')](_0x2c745c[_0x96c8('0x49')]);_0x217a43['filters']=_[_0x96c8('0x46')](_0x217a43['model'],_0x217a43[_0x96c8('0x49')]);_0x48a0ec['attributes']=_[_0x96c8('0x46')](_0x217a43[_0x96c8('0x47')],qs[_0x96c8('0x4a')](_0x2c745c[_0x96c8('0x49')]['fields']));_0x48a0ec[_0x96c8('0x48')]=_0x48a0ec[_0x96c8('0x48')]['length']?_0x48a0ec[_0x96c8('0x48')]:_0x217a43[_0x96c8('0x47')];if(!_0x2c745c[_0x96c8('0x49')][_0x96c8('0x6a')](_0x96c8('0x4c'))){_0x48a0ec[_0x96c8('0x2e')]=qs['limit'](_0x2c745c[_0x96c8('0x49')][_0x96c8('0x2e')]);_0x48a0ec['offset']=qs[_0x96c8('0x2c')](_0x2c745c[_0x96c8('0x49')][_0x96c8('0x2c')]);}_0x48a0ec[_0x96c8('0x4d')]=qs[_0x96c8('0x4e')](_0x2c745c[_0x96c8('0x49')][_0x96c8('0x4e')]);_0x48a0ec[_0x96c8('0x51')]=qs[_0x96c8('0x45')](_[_0x96c8('0x4f')](_0x2c745c[_0x96c8('0x49')],_0x217a43[_0x96c8('0x45')]));_0x48a0ec['where']['FaxAccountId']=_0x336e6b['id'];if(_0x2c745c[_0x96c8('0x49')]['filter']){_0x48a0ec['where']=_[_0x96c8('0x52')](_0x48a0ec[_0x96c8('0x51')],{'$or':_['map'](_0x48a0ec['attributes'],function(_0x30691a){var _0x879910={};_0x879910[_0x30691a]={'$like':'%'+_0x2c745c[_0x96c8('0x49')][_0x96c8('0x50')]+'%'};return _0x879910;})});}_0x48a0ec=_[_0x96c8('0x52')]({},_0x48a0ec,_0x2c745c['options']);return db[_0x96c8('0x72')][_0x96c8('0x2f')]({'where':_0x48a0ec['where']})['then'](function(_0x12224c){_0x38211b[_0x96c8('0x2f')]=_0x12224c;if(_0x2c745c[_0x96c8('0x49')][_0x96c8('0x56')]){_0x48a0ec['include']=[{'model':db['CmContact'],'as':_0x96c8('0x75'),'required':![]},{'model':db[_0x96c8('0x76')],'as':_0x96c8('0x77'),'attributes':['name','fullname',_0x96c8('0x78')],'required':![]},{'model':db[_0x96c8('0x79')],'as':_0x96c8('0x7a'),'attributes':['id',_0x96c8('0x3c'),_0x96c8('0x7b')],'where':_0x2c745c[_0x96c8('0x49')][_0x96c8('0x7c')]?{'id':_0x2c745c[_0x96c8('0x49')][_0x96c8('0x7c')]}:undefined,'required':_0x2c745c[_0x96c8('0x49')][_0x96c8('0x7c')]?!![]:![]}];}return db[_0x96c8('0x72')]['findAll'](_0x48a0ec);})[_0x96c8('0x36')](function(_0x271d17){_0x38211b[_0x96c8('0x59')]=_0x271d17;return _0x38211b;});}})['then'](respondWithFilteredResult(_0x335430,_0x48a0ec))[_0x96c8('0x27')](handleError(_0x335430,null));};exports['addApplications']=function(_0x5ac16d,_0x572dcb){var _0x5b68d9=_0x5ac16d[_0x96c8('0x65')]['id'];var _0x18c875=_0x5ac16d[_0x96c8('0x5e')];var _0xd42fe9=0xc8;var _0x52d3f6=null;return db['sequelize'][_0x96c8('0x7d')]({'isolationLevel':db[_0x96c8('0x7e')]['Transaction']['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0xa136ba){return db[_0x96c8('0x40')][_0x96c8('0x69')]({'where':{'id':_0x5b68d9},'transaction':_0xa136ba})[_0x96c8('0x36')](function(_0x3faa7e){if(_0x3faa7e){return db[_0x96c8('0x7f')][_0x96c8('0x37')]({'where':{'FaxAccountId':_0x5b68d9},'transaction':_0xa136ba})[_0x96c8('0x36')](function(){var _0x44510e=_['map'](_0x18c875,function(_0x176a8c){_0x176a8c['FaxAccountId']=_0x5b68d9;return _0x176a8c;});return db['FaxApplication'][_0x96c8('0x80')](_0x44510e,{'transaction':_0xa136ba});});}else{_0xd42fe9=0x194;_0x52d3f6=[];}});})[_0x96c8('0x36')](function(){if(_0xd42fe9!==0x194){return db['FaxApplication'][_0x96c8('0x81')]({'where':{'FaxAccountId':_0x5b68d9},'order':_0x96c8('0x82')})['then'](function(_0x5aa45c){_0x52d3f6=_0x5aa45c;});}})[_0x96c8('0x27')](function(_0x436882){_0xd42fe9=0x1f4;logger['error'](_0x436882[_0x96c8('0x3b')]);if(_0x436882[_0x96c8('0x3c')]){delete _0x436882[_0x96c8('0x3c')];}_0x52d3f6=_0x436882;})[_0x96c8('0x83')](function(){if(_0x52d3f6===null){_0x572dcb[_0x96c8('0x28')](_0xd42fe9);}else{if(_0xd42fe9===0x1f4){_0x572dcb[_0x96c8('0x29')](_0xd42fe9)['send'](_0x52d3f6);}else{_0x572dcb[_0x96c8('0x29')](_0xd42fe9)[_0x96c8('0x2b')](_0x52d3f6);}}});};exports[_0x96c8('0x84')]=function(_0x439a81,_0x4a7425,_0x2ff93b){var _0xe42f4d={};var _0x3fd27c={};var _0x3734c8;var _0x547bed;return db[_0x96c8('0x40')][_0x96c8('0x69')]({'where':{'id':_0x439a81[_0x96c8('0x65')]['id']}})['then'](handleEntityNotFound(_0x4a7425,null))[_0x96c8('0x36')](function(_0x3e4b2e){if(_0x3e4b2e){_0x3734c8=_0x3e4b2e;_0x3fd27c['model']=_['keys'](db['FaxApplication'][_0x96c8('0x41')]);_0x3fd27c[_0x96c8('0x49')]=_[_0x96c8('0x44')](_0x439a81[_0x96c8('0x49')]);_0x3fd27c['filters']=_['intersection'](_0x3fd27c['model'],_0x3fd27c[_0x96c8('0x49')]);_0xe42f4d['attributes']=_[_0x96c8('0x46')](_0x3fd27c[_0x96c8('0x47')],qs['fields'](_0x439a81['query'][_0x96c8('0x4a')]));_0xe42f4d[_0x96c8('0x48')]=_0xe42f4d[_0x96c8('0x48')]['length']?_0xe42f4d[_0x96c8('0x48')]:_0x3fd27c[_0x96c8('0x47')];_0xe42f4d['order']=qs[_0x96c8('0x4e')](_0x439a81[_0x96c8('0x49')][_0x96c8('0x4e')]);_0xe42f4d[_0x96c8('0x51')]=qs['filters'](_[_0x96c8('0x4f')](_0x439a81['query'],_0x3fd27c[_0x96c8('0x45')]));if(_0x439a81[_0x96c8('0x49')][_0x96c8('0x50')]){_0xe42f4d[_0x96c8('0x51')]=_[_0x96c8('0x52')](_0xe42f4d[_0x96c8('0x51')],{'$or':_[_0x96c8('0x43')](_0xe42f4d['attributes'],function(_0x9f4a4b){var _0x5800ed={};_0x5800ed[_0x9f4a4b]={'$like':'%'+_0x439a81[_0x96c8('0x49')]['filter']+'%'};return _0x5800ed;})});}_0xe42f4d=_[_0x96c8('0x52')]({},_0xe42f4d,_0x439a81[_0x96c8('0x55')]);return _0x3734c8['getApplications'](_0xe42f4d);}})[_0x96c8('0x36')](function(_0x587b9d){if(_0x587b9d){_0x547bed=_0x587b9d[_0x96c8('0x4b')];if(!_0x439a81[_0x96c8('0x49')][_0x96c8('0x6a')](_0x96c8('0x4c'))){_0xe42f4d['limit']=qs['limit'](_0x439a81[_0x96c8('0x49')]['limit']);_0xe42f4d[_0x96c8('0x2c')]=qs[_0x96c8('0x2c')](_0x439a81[_0x96c8('0x49')]['offset']);}return _0x3734c8[_0x96c8('0x84')](_0xe42f4d);}})[_0x96c8('0x36')](function(_0x4a9716){if(_0x4a9716){return _0x4a9716?{'count':_0x547bed,'rows':_0x4a9716}:null;}})['then'](respondWithResult(_0x4a7425,null))[_0x96c8('0x27')](handleError(_0x4a7425,null));};function Extension(_0x23dffd,_0x153fe0,_0x1b0d06,_0x211286){this[_0x96c8('0x85')]=_0x96c8('0x86');this[_0x96c8('0x87')]=_0x23dffd[_0x96c8('0x88')];this[_0x96c8('0x89')]=_0x211286;this[_0x96c8('0x53')]=_0x96c8('0x8a');this[_0x96c8('0x8b')]='Fax\x20Extension';this[_0x96c8('0x6e')]=_0x23dffd['id'];this[_0x96c8('0x82')]=_0x153fe0;this['appdata']=_0x1b0d06;}function createExtensionsReciveFax(_0x46f7dd){var _0x28a41c=0x1;var _0x3c0fc1=[];_0x3c0fc1[_0x96c8('0x8c')](new Extension(_0x46f7dd,_0x28a41c,'',_0x96c8('0x8d')));_0x28a41c+=0x1;_0x3c0fc1['push'](new Extension(_0x46f7dd,_0x28a41c,_0x96c8('0x8e'),_0x96c8('0x8f')));_0x28a41c+=0x1;for(var _0x1afdbb in _0x46f7dd){if(_0x46f7dd[_0x96c8('0x6a')](_0x1afdbb)&&(_0x1afdbb==='ecm'||_0x1afdbb===_0x96c8('0x88')||_0x1afdbb===_0x96c8('0x90')||_0x1afdbb===_0x96c8('0x91')||_0x1afdbb===_0x96c8('0x92')||_0x1afdbb===_0x96c8('0x93')||_0x1afdbb===_0x96c8('0x94')||_0x1afdbb==='modem'||_0x1afdbb===_0x96c8('0x95'))){_0x3c0fc1[_0x96c8('0x8c')](new Extension(_0x46f7dd,_0x28a41c,'FAXOPT('+_0x1afdbb+')='+_0x46f7dd[_0x1afdbb],_0x96c8('0x8f')));_0x28a41c+=0x1;}}_0x3c0fc1[_0x96c8('0x8c')](new Extension(_0x46f7dd,_0x28a41c,'6',_0x96c8('0x96')));_0x28a41c+=0x1;_0x3c0fc1[_0x96c8('0x8c')](new Extension(_0x46f7dd,_0x28a41c,_0x96c8('0x97'),_0x96c8('0x98')));_0x28a41c=0x0;return _0x3c0fc1;}exports[_0x96c8('0x99')]=function(_0x21080c,_0x2a938d,_0x3c6ef5){var _0x5995a2;return db[_0x96c8('0x7e')][_0x96c8('0x7d')](function(_0x2f1fb4){return db['FaxAccount'][_0x96c8('0x5d')](_0x21080c['body'],{'transaction':_0x2f1fb4})['then'](function(_0x510e49){_0x5995a2=_0x510e49[_0x96c8('0x38')]({'plain':!![]});return db[_0x96c8('0x9a')][_0x96c8('0x80')](createExtensionsReciveFax(_0x5995a2),{'transaction':_0x2f1fb4});});})[_0x96c8('0x36')](function(){return _0x5995a2;})[_0x96c8('0x36')](respondWithResult(_0x2a938d,null))[_0x96c8('0x27')](handleError(_0x2a938d,null));};exports[_0x96c8('0x9b')]=function(_0x4f8999,_0x2259fd,_0x54f18a){var _0x25115b;return db[_0x96c8('0x7e')][_0x96c8('0x7d')](function(_0x550df2){return db[_0x96c8('0x40')][_0x96c8('0x35')](_0x4f8999[_0x96c8('0x5e')],{'where':{'id':_0x4f8999['body']['id']},'transaction':_0x550df2})['then'](function(_0x1703fd){return db[_0x96c8('0x9a')][_0x96c8('0x37')]({'where':{'FaxAccountId':_0x4f8999[_0x96c8('0x5e')]['id']},'transaction':_0x550df2})[_0x96c8('0x36')](function(_0x4eae33){return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_[_0x96c8('0x73')](_0x4f8999['body'],[_0x96c8('0x9c'),_0x96c8('0x9d'),'createdAt','updatedAt',_0x96c8('0x9e'),_0x96c8('0x9f')])),{'transaction':_0x550df2});});});})['then'](function(){return db['FaxAccount'][_0x96c8('0xa0')](_0x4f8999[_0x96c8('0x5e')]['id']);})[_0x96c8('0x36')](respondWithResult(_0x2259fd,null))[_0x96c8('0x27')](handleError(_0x2259fd,null));};exports[_0x96c8('0xa1')]=function(_0x32f167,_0x409975,_0x53990e){var _0x14d07e={'raw':!![],'where':{}};var _0x36be68={};var _0xdaf82c={'count':0x0,'rows':[]};return db[_0x96c8('0x40')]['findOne']({'where':{'id':_0x32f167[_0x96c8('0x65')]['id']}})['then'](handleEntityNotFound(_0x409975,null))[_0x96c8('0x36')](function(_0x41f551){if(_0x41f551){_0x36be68[_0x96c8('0x47')]=_[_0x96c8('0x44')](db[_0x96c8('0xa2')][_0x96c8('0x41')]);_0x36be68['query']=_['keys'](_0x32f167[_0x96c8('0x49')]);_0x36be68[_0x96c8('0x45')]=_[_0x96c8('0x46')](_0x36be68[_0x96c8('0x47')],_0x36be68['query']);_0x14d07e[_0x96c8('0x48')]=_[_0x96c8('0x46')](_0x36be68[_0x96c8('0x47')],qs[_0x96c8('0x4a')](_0x32f167['query'][_0x96c8('0x4a')]));_0x14d07e[_0x96c8('0x48')]=_0x14d07e[_0x96c8('0x48')][_0x96c8('0x4b')]?_0x14d07e[_0x96c8('0x48')]:_0x36be68[_0x96c8('0x47')];if(!_0x32f167[_0x96c8('0x49')][_0x96c8('0x6a')](_0x96c8('0x4c'))){_0x14d07e['limit']=qs[_0x96c8('0x2e')](_0x32f167[_0x96c8('0x49')][_0x96c8('0x2e')]);_0x14d07e[_0x96c8('0x2c')]=qs[_0x96c8('0x2c')](_0x32f167[_0x96c8('0x49')][_0x96c8('0x2c')]);}_0x14d07e[_0x96c8('0x4d')]=qs[_0x96c8('0x4e')](_0x32f167[_0x96c8('0x49')][_0x96c8('0x4e')]);_0x14d07e['where']=qs[_0x96c8('0x45')](_[_0x96c8('0x4f')](_0x32f167[_0x96c8('0x49')],_0x36be68[_0x96c8('0x45')]));_0x14d07e[_0x96c8('0x51')][_0x96c8('0x6e')]=_0x41f551['id'];if(_0x32f167['query'][_0x96c8('0x50')]){_0x14d07e[_0x96c8('0x51')]=_['merge'](_0x14d07e[_0x96c8('0x51')],{'$or':_[_0x96c8('0x43')](_0x14d07e[_0x96c8('0x48')],function(_0x1ee9a3){var _0x5dc476={};_0x5dc476[_0x1ee9a3]={'$like':'%'+_0x32f167[_0x96c8('0x49')]['filter']+'%'};return _0x5dc476;})});}if(_0x32f167[_0x96c8('0x49')][_0x96c8('0xa3')]){var _0x1fd920=_0x32f167[_0x96c8('0x49')]['$gte'][_0x96c8('0xa4')](',');var _0x400559={};_0x400559[_0x1fd920[0x0]]={'$gte':moment(_0x1fd920[0x1])[_0x96c8('0xa5')]('YYYY-MM-DD\x20HH:mm:ss')};_0x14d07e[_0x96c8('0x51')]=_[_0x96c8('0x52')](_0x14d07e[_0x96c8('0x51')],_0x400559);}_0x14d07e=_[_0x96c8('0x52')]({},_0x14d07e,_0x32f167[_0x96c8('0x55')]);return db[_0x96c8('0xa2')][_0x96c8('0x2f')]({'where':_0x14d07e[_0x96c8('0x51')]})[_0x96c8('0x36')](function(_0x220c75){_0xdaf82c[_0x96c8('0x2f')]=_0x220c75;if(_0x32f167[_0x96c8('0x49')][_0x96c8('0x56')]){_0x14d07e[_0x96c8('0x57')]=[{'all':!![]}];}return db[_0x96c8('0xa2')][_0x96c8('0x58')](_0x14d07e);})[_0x96c8('0x36')](function(_0x31b629){_0xdaf82c[_0x96c8('0x59')]=_0x31b629;return _0xdaf82c;});}})['then'](respondWithFilteredResult(_0x409975,_0x14d07e))[_0x96c8('0x27')](handleError(_0x409975,null));};exports[_0x96c8('0x3d')]=function(_0x4d9816,_0x5bc190,_0x1a3dff){var _0x44a28b,_0x594503={},_0x5789b2;if(_0x4d9816['body']['to']){_0x5789b2=_0x4d9816['body']['to'][0x0];}return db[_0x96c8('0x40')]['find']({'where':{'id':_0x4d9816['params']['id']},'include':[{'model':db[_0x96c8('0xa6')],'as':_0x96c8('0xa7'),'include':[{'model':db['CmContact'],'as':_0x96c8('0xa8'),'where':{'fax':_0x5789b2},'limit':0x1,'order':[['updatedAt',_0x96c8('0xa9')]]}]}]})[_0x96c8('0x36')](handleEntityNotFound(_0x5bc190,null))[_0x96c8('0x36')](function(_0x283c3b){_0x44a28b=_0x283c3b;if(_0x4d9816[_0x96c8('0x5e')]['attachments']&&_0x4d9816[_0x96c8('0x5e')][_0x96c8('0xaa')]['length']){for(var _0x119451=0x0;_0x119451<_0x4d9816[_0x96c8('0x5e')][_0x96c8('0xaa')][_0x96c8('0x4b')];_0x119451+=0x1){_0x4d9816[_0x96c8('0x5e')][_0x96c8('0xaa')][_0x119451]={'filename':_0x4d9816['body'][_0x96c8('0xaa')][_0x119451]['name'],'id':_0x4d9816[_0x96c8('0x5e')]['attachments'][_0x119451]['id'],'path':path[_0x96c8('0xab')](config['root'],_0x96c8('0xac'),_0x4d9816[_0x96c8('0x5e')][_0x96c8('0xaa')][_0x119451][_0x96c8('0xad')])};}}return respondWithRpcPromise(_0x96c8('0xae'),_0x96c8('0xae'),{'FaxAccountId':_[_0x96c8('0xaf')](_0x4d9816[_0x96c8('0x65')]['id'])?undefined:_0x4d9816[_0x96c8('0x65')]['id'],'path':_[_0x96c8('0xaf')](_0x4d9816[_0x96c8('0x5e')][_0x96c8('0xaa')][0x0][_0x96c8('0x7')])?undefined:_0x4d9816['body'][_0x96c8('0xaa')][0x0]['path'],'fax':_[_0x96c8('0xaf')](_0x4d9816[_0x96c8('0x5e')]['to'][0x0])?undefined:_0x4d9816['body']['to'][0x0]},client9002);})[_0x96c8('0x36')](function(){if(_0x44a28b){if(_[_0x96c8('0xaf')](_0x4d9816['body'][_0x96c8('0xb0')])){_0x4d9816[_0x96c8('0x5e')]['from']=util[_0x96c8('0xa5')](_0x96c8('0xb1'),_0x44a28b[_0x96c8('0x3c')],_0x44a28b['fax']);}if(_0x44a28b['List']){if(_0x44a28b[_0x96c8('0xa7')][_0x96c8('0xa8')][_0x96c8('0x4b')]){return _0x44a28b[_0x96c8('0xa7')][_0x96c8('0xa8')][0x0];}else{return db[_0x96c8('0xb2')][_0x96c8('0x5d')](_[_0x96c8('0x18')](_0x4d9816['body'],{'firstName':_0x4d9816[_0x96c8('0x5e')]['to'][0x0],'phone':_0x4d9816[_0x96c8('0x5e')]['to'][0x0],'fax':_0x4d9816['body']['to'][0x0],'ListId':_0x44a28b[_0x96c8('0x9f')]}));}}else{throw new Error(_0x96c8('0xb3'));}}else{throw new Error(_0x96c8('0xb4'));}})[_0x96c8('0x36')](function(_0x3ab0fa){if(_0x3ab0fa){return db[_0x96c8('0x72')][_0x96c8('0x5c')]({'where':{'ContactId':_0x3ab0fa['id'],'closed':![],'FaxAccountId':_0x44a28b['id']}})['then'](function(_0x2be0f4){if(_0x2be0f4){return[_0x2be0f4,![]];}return db[_0x96c8('0x72')]['create']({'UserId':_0x4d9816['user']['id'],'ContactId':_0x3ab0fa['id'],'FaxAccountId':_0x44a28b['id'],'fax':_0x4d9816[_0x96c8('0x5e')]['to'][0x0],'firstMsgDirection':_0x96c8('0xb5'),'Messages':[_[_0x96c8('0x52')](_0x4d9816[_0x96c8('0x5e')],{'read':![],'body':_0x4d9816[_0x96c8('0x5e')]['attachments'][0x0][_0x96c8('0xb6')],'FaxAccountId':_0x44a28b['id'],'UserId':_0x4d9816[_0x96c8('0x5f')]['id'],'ContactId':_0x3ab0fa['id'],'AttachmentId':_0x4d9816[_0x96c8('0x5e')][_0x96c8('0xaa')][0x0]['id']})]},{'include':[{'model':db[_0x96c8('0xa2')],'as':_0x96c8('0xb7')}]})['then'](function(_0xafabd2){return[_0xafabd2,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x96c8('0xb8')](function(_0xeab91e,_0x5a3270){if(_0x5a3270){return _0xeab91e;}return db['FaxMessage']['create']({'direction':_0x96c8('0xb5'),'read':![],'body':_0x4d9816[_0x96c8('0x5e')][_0x96c8('0xaa')][0x0][_0x96c8('0xb6')],'FaxAccountId':_0x44a28b['id'],'FaxInteractionId':_0xeab91e['id'],'UserId':_0x4d9816['user']['id'],'ContactId':_0xeab91e['ContactId'],'AttachmentId':_0x4d9816[_0x96c8('0x5e')][_0x96c8('0xaa')][0x0]['id']})[_0x96c8('0x36')](function(_0x2bb65e){_0xeab91e['dataValues'][_0x96c8('0xb7')]=[];_0xeab91e[_0x96c8('0xb9')][_0x96c8('0xb7')]['push'](_0x2bb65e['dataValues']);return _0xeab91e;});})[_0x96c8('0x36')](function(_0x25c5e3){respondWithRpcPromise(_0x96c8('0xba'),_0x96c8('0xba'),{'FaxAccountId':_[_0x96c8('0xaf')](_0x4d9816[_0x96c8('0x65')]['id'])?undefined:_0x4d9816[_0x96c8('0x65')]['id'],'path':_[_0x96c8('0xaf')](_0x4d9816['body']['attachments'][0x0]['path'])?undefined:_0x4d9816['body'][_0x96c8('0xaa')][0x0][_0x96c8('0x7')],'fax':_[_0x96c8('0xaf')](_0x4d9816[_0x96c8('0x5e')]['to'][0x0])?undefined:_0x4d9816[_0x96c8('0x5e')]['to'][0x0],'AttachmentId':_0x4d9816[_0x96c8('0x5e')]['attachments'][0x0]['id']},client9002)['then'](function(_0x16d8c6){logger[_0x96c8('0x1f')]('SendFaxRpc,\x20%s',_0x16d8c6);})[_0x96c8('0x27')](function(_0x47e18b){logger[_0x96c8('0x1f')](_0x96c8('0xbb'),_0x47e18b);});return _0x25c5e3;})[_0x96c8('0x36')](respondWithResult(_0x5bc190,null))[_0x96c8('0x27')](handleError(_0x5bc190,null));};exports['addAgents']=function(_0x40abba,_0x2bd1a2,_0x2d1ac3){return db[_0x96c8('0x40')]['find']({'where':{'id':_0x40abba[_0x96c8('0x65')]['id']}})[_0x96c8('0x36')](handleEntityNotFound(_0x2bd1a2,null))[_0x96c8('0x36')](function(_0x5a60f9){if(_0x5a60f9){return _0x5a60f9[_0x96c8('0xbc')](_0x40abba['body']['ids'],_[_0x96c8('0x73')](_0x40abba['body'],[_0x96c8('0x6c'),'id'])||{})['spread'](function(_0x157f5d){for(var _0x45e9c2=0x0;_0x45e9c2<_0x40abba[_0x96c8('0x5e')][_0x96c8('0x6c')][_0x96c8('0x4b')];_0x45e9c2+=0x1){socket['emit'](_0x96c8('0xbd'),{'UserId':Number(_0x40abba[_0x96c8('0x5e')]['ids'][_0x45e9c2]),'FaxAccountId':Number(_0x40abba['params']['id'])});}return _0x157f5d;});}})[_0x96c8('0x36')](respondWithResult(_0x2bd1a2,null))[_0x96c8('0x27')](handleError(_0x2bd1a2,null));};exports[_0x96c8('0xbe')]=function(_0x3a4c33,_0x38e20a,_0x147288){return db[_0x96c8('0x40')][_0x96c8('0x5c')]({'where':{'id':_0x3a4c33[_0x96c8('0x65')]['id']}})[_0x96c8('0x36')](handleEntityNotFound(_0x38e20a,null))[_0x96c8('0x36')](function(_0x5d52a9){if(_0x5d52a9){return _0x5d52a9[_0x96c8('0xbe')](_0x3a4c33[_0x96c8('0x49')][_0x96c8('0x6c')])[_0x96c8('0x36')](function(){if(_[_0x96c8('0xbf')](_0x3a4c33['query']['ids'])){for(var _0x5e93dc=0x0;_0x5e93dc<_0x3a4c33[_0x96c8('0x49')][_0x96c8('0x6c')][_0x96c8('0x4b')];_0x5e93dc+=0x1){socket[_0x96c8('0xc0')](_0x96c8('0xc1'),{'UserId':Number(_0x3a4c33[_0x96c8('0x49')][_0x96c8('0x6c')][_0x5e93dc]),'FaxAccountId':Number(_0x3a4c33[_0x96c8('0x65')]['id'])});}}else{socket[_0x96c8('0xc0')](_0x96c8('0xc1'),{'UserId':Number(_0x3a4c33['query'][_0x96c8('0x6c')]),'FaxAccountId':Number(_0x3a4c33[_0x96c8('0x65')]['id'])});}});}})[_0x96c8('0x36')](respondWithStatusCode(_0x38e20a,null))[_0x96c8('0x27')](handleError(_0x38e20a,null));};exports[_0x96c8('0xc2')]=function(_0x38b351,_0xc8ca08,_0x15e1fe){var _0x5359ac={};var _0x32bdda={};var _0x4da063;var _0x40d6c6;return db[_0x96c8('0x40')]['findOne']({'where':{'id':_0x38b351[_0x96c8('0x65')]['id']}})['then'](handleEntityNotFound(_0xc8ca08,null))['then'](function(_0x1c4b15){if(_0x1c4b15){_0x4da063=_0x1c4b15;_0x32bdda[_0x96c8('0x47')]=_[_0x96c8('0x44')](db['User'][_0x96c8('0x41')]);_0x32bdda[_0x96c8('0x49')]=_[_0x96c8('0x44')](_0x38b351[_0x96c8('0x49')]);_0x32bdda[_0x96c8('0x45')]=_[_0x96c8('0x46')](_0x32bdda[_0x96c8('0x47')],_0x32bdda[_0x96c8('0x49')]);_0x5359ac['attributes']=_['intersection'](_0x32bdda['model'],qs[_0x96c8('0x4a')](_0x38b351[_0x96c8('0x49')][_0x96c8('0x4a')]));_0x5359ac[_0x96c8('0x48')]=_0x5359ac[_0x96c8('0x48')][_0x96c8('0x4b')]?_0x5359ac[_0x96c8('0x48')]:_0x32bdda[_0x96c8('0x47')];_0x5359ac[_0x96c8('0x4d')]=qs[_0x96c8('0x4e')](_0x38b351['query'][_0x96c8('0x4e')]);_0x5359ac[_0x96c8('0x51')]=qs[_0x96c8('0x45')](_[_0x96c8('0x4f')](_0x38b351['query'],_0x32bdda[_0x96c8('0x45')]));if(_0x38b351['query'][_0x96c8('0x50')]){_0x5359ac[_0x96c8('0x51')]=_['merge'](_0x5359ac[_0x96c8('0x51')],{'$or':_[_0x96c8('0x43')](_0x5359ac[_0x96c8('0x48')],function(_0x2ecb35){var _0x2b2f1f={};_0x2b2f1f[_0x2ecb35]={'$like':'%'+_0x38b351[_0x96c8('0x49')][_0x96c8('0x50')]+'%'};return _0x2b2f1f;})});}_0x5359ac=_[_0x96c8('0x52')]({},_0x5359ac,_0x38b351[_0x96c8('0x55')]);return _0x4da063[_0x96c8('0xc2')](_0x5359ac);}})[_0x96c8('0x36')](function(_0x430b16){if(_0x430b16){_0x40d6c6=_0x430b16[_0x96c8('0x4b')];if(!_0x38b351[_0x96c8('0x49')][_0x96c8('0x6a')](_0x96c8('0x4c'))){_0x5359ac[_0x96c8('0x2e')]=qs[_0x96c8('0x2e')](_0x38b351[_0x96c8('0x49')][_0x96c8('0x2e')]);_0x5359ac[_0x96c8('0x2c')]=qs[_0x96c8('0x2c')](_0x38b351[_0x96c8('0x49')][_0x96c8('0x2c')]);}return _0x4da063['getAgents'](_0x5359ac);}})[_0x96c8('0x36')](function(_0x5497ae){if(_0x5497ae){return _0x5497ae?{'count':_0x40d6c6,'rows':_0x5497ae}:null;}})[_0x96c8('0x36')](respondWithResult(_0xc8ca08,null))[_0x96c8('0x27')](handleError(_0xc8ca08,null));}; \ No newline at end of file +var _0x4b47=['ecm','faxdetect','headerinfo','maxrate','minrate','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','addAccountApplications','updateAccountApplications','VoiceExtension','bulkCreate','tech','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','List','Contacts','attachments','join','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Contact\x20not\x20found','ContactId','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','spread','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','User','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxAccount.socket','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','get','FaxAccounts','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','includeAll','include','findAll','rows','show','params','options','find','create','body','role','user','UserProfileSection','autoAssociation','update','describe','FaxAccountId','Disposition','getDispositions','findOne','filter','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','FaxInteraction','addInteraction','omit','CmContact','Contact','Owner','fullname','internal','Tag','color','tag','transaction','sequelize','Transaction','READ_COMMITTED','FaxApplication','findAndCountAll','priority','stack','finally','getApplications','context','from-voip-provider','localstationid','app','system','description','appdata','push','CDR(type)=inbound-fax','Set'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4b47,0x1bc));var _0x74b4=function(_0x5a0c65,_0x11cba1){_0x5a0c65=_0x5a0c65-0x0;var _0x4f1ccd=_0x4b47[_0x5a0c65];return _0x4f1ccd;};'use strict';var emlformat=require(_0x74b4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x74b4('0x1'));var rp=require(_0x74b4('0x2'));var moment=require(_0x74b4('0x3'));var BPromise=require(_0x74b4('0x4'));var Mustache=require(_0x74b4('0x5'));var util=require('util');var path=require(_0x74b4('0x6'));var sox=require(_0x74b4('0x7'));var csv=require(_0x74b4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x74b4('0x9'));var _=require(_0x74b4('0xa'));var squel=require(_0x74b4('0xb'));var crypto=require(_0x74b4('0xc'));var jsforce=require(_0x74b4('0xd'));var deskjs=require(_0x74b4('0xe'));var toCsv=require('to-csv');var querystring=require(_0x74b4('0xf'));var Papa=require(_0x74b4('0x10'));var Redis=require(_0x74b4('0x11'));var authService=require(_0x74b4('0x12'));var qs=require(_0x74b4('0x13'));var as=require(_0x74b4('0x14'));var hardwareService=require(_0x74b4('0x15'));var logger=require(_0x74b4('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x74b4('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x74b4('0x18'))['db'];config[_0x74b4('0x19')]=_[_0x74b4('0x1a')](config[_0x74b4('0x19')],{'host':_0x74b4('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x74b4('0x1c'))['register'](socket);var jayson=require(_0x74b4('0x1d'));var client=jayson[_0x74b4('0x1e')][_0x74b4('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0x74b4('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x43595c,_0x68b3c0,_0x1ac6c5,_0x472791){return new BPromise(function(_0x468ad5,_0x209f59){var _0x564148=_0x472791||client;return _0x564148[_0x74b4('0x20')](_0x43595c,_0x1ac6c5)[_0x74b4('0x21')](function(_0x120c13){logger[_0x74b4('0x22')](_0x74b4('0x23'),_0x68b3c0,_0x74b4('0x24'));logger[_0x74b4('0x25')](_0x74b4('0x26'),_0x68b3c0,_0x74b4('0x24'),JSON[_0x74b4('0x27')](_0x120c13));if(_0x120c13['error']){if(_0x120c13[_0x74b4('0x28')][_0x74b4('0x29')]===0x1f4){logger[_0x74b4('0x28')]('FaxAccount,\x20%s,\x20%s',_0x68b3c0,_0x120c13[_0x74b4('0x28')][_0x74b4('0x2a')]);return _0x209f59(_0x120c13[_0x74b4('0x28')][_0x74b4('0x2a')]);}logger[_0x74b4('0x28')](_0x74b4('0x23'),_0x68b3c0,_0x120c13['error']['message']);return _0x468ad5(_0x120c13['error']['message']);}else{logger[_0x74b4('0x22')](_0x74b4('0x23'),_0x68b3c0,_0x74b4('0x24'));_0x468ad5(_0x120c13[_0x74b4('0x2b')][_0x74b4('0x2a')]);}})[_0x74b4('0x2c')](function(_0x17064c){logger['error'](_0x74b4('0x23'),_0x68b3c0,_0x17064c);_0x209f59(_0x17064c);});});}function respondWithStatusCode(_0xbc43f1,_0x372fd8){_0x372fd8=_0x372fd8||0xcc;return function(_0x508a45){if(_0x508a45){return _0xbc43f1[_0x74b4('0x2d')](_0x372fd8);}return _0xbc43f1[_0x74b4('0x2e')](_0x372fd8)[_0x74b4('0x2f')]();};}function respondWithResult(_0x430464,_0x11692a){_0x11692a=_0x11692a||0xc8;return function(_0x368828){if(_0x368828){return _0x430464[_0x74b4('0x2e')](_0x11692a)[_0x74b4('0x30')](_0x368828);}};}function respondWithFilteredResult(_0x71f216,_0x2ac754){return function(_0x3f2b18){if(_0x3f2b18){var _0x5f2457=typeof _0x2ac754[_0x74b4('0x31')]===_0x74b4('0x32')&&typeof _0x2ac754[_0x74b4('0x33')]==='undefined';var _0x3a7c8f=_0x3f2b18[_0x74b4('0x34')];var _0x1e2d1e=_0x5f2457?0x0:_0x2ac754[_0x74b4('0x31')];var _0x512b70=_0x5f2457?_0x3f2b18[_0x74b4('0x34')]:_0x2ac754[_0x74b4('0x31')]+_0x2ac754[_0x74b4('0x33')];var _0x1fbcd9;if(_0x512b70>=_0x3a7c8f){_0x512b70=_0x3a7c8f;_0x1fbcd9=0xc8;}else{_0x1fbcd9=0xce;}_0x71f216[_0x74b4('0x2e')](_0x1fbcd9);return _0x71f216[_0x74b4('0x35')](_0x74b4('0x36'),_0x1e2d1e+'-'+_0x512b70+'/'+_0x3a7c8f)[_0x74b4('0x30')](_0x3f2b18);}return null;};}function patchUpdates(_0x82e5ed){return function(_0x7237c4){try{jsonpatch['apply'](_0x7237c4,_0x82e5ed,!![]);}catch(_0x272ff4){return BPromise[_0x74b4('0x37')](_0x272ff4);}return _0x7237c4[_0x74b4('0x38')]();};}function saveUpdates(_0x36bc02,_0x145b44){return function(_0x467b83){if(_0x467b83){return _0x467b83['update'](_0x36bc02)['then'](function(_0x531e36){return _0x531e36;});}return null;};}function removeEntity(_0x425da7,_0x23581b){return function(_0x216c0a){if(_0x216c0a){return _0x216c0a[_0x74b4('0x39')]()[_0x74b4('0x21')](function(){var _0x5e9fa6=_0x216c0a[_0x74b4('0x3a')]({'plain':!![]});var _0x224414=_0x74b4('0x3b');return db[_0x74b4('0x3c')][_0x74b4('0x39')]({'where':{'type':_0x224414,'resourceId':_0x5e9fa6['id']}})['then'](function(){return _0x216c0a;});})['then'](function(){_0x425da7[_0x74b4('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x204444,_0x61524c){return function(_0x23b0e8){if(!_0x23b0e8){_0x204444[_0x74b4('0x2d')](0x194);}return _0x23b0e8;};}function handleError(_0x327e33,_0xaa24f7){_0xaa24f7=_0xaa24f7||0x1f4;return function(_0x493eaf){logger['error'](_0x493eaf['stack']);if(_0x493eaf[_0x74b4('0x3d')]){delete _0x493eaf[_0x74b4('0x3d')];}_0x327e33[_0x74b4('0x2e')](_0xaa24f7)[_0x74b4('0x3e')](_0x493eaf);};}exports[_0x74b4('0x3f')]=function(_0x18241d,_0x3197bc){var _0x371424={'include':[{'model':db[_0x74b4('0x40')],'as':_0x74b4('0x41')}]},_0x5e7015={},_0x135a07={'count':0x0,'rows':[]};var _0x64940b=_[_0x74b4('0x42')](db[_0x74b4('0x43')][_0x74b4('0x44')],function(_0xa04746){return{'name':_0xa04746['fieldName'],'type':_0xa04746['type'][_0x74b4('0x45')]};});_0x5e7015['model']=_[_0x74b4('0x42')](_0x64940b,_0x74b4('0x3d'));_0x5e7015['query']=_[_0x74b4('0x46')](_0x18241d[_0x74b4('0x47')]);_0x5e7015[_0x74b4('0x48')]=_[_0x74b4('0x49')](_0x5e7015[_0x74b4('0x4a')],_0x5e7015['query']);_0x371424[_0x74b4('0x4b')]=_[_0x74b4('0x49')](_0x5e7015[_0x74b4('0x4a')],qs[_0x74b4('0x4c')](_0x18241d['query'][_0x74b4('0x4c')]));_0x371424['attributes']=_0x371424['attributes'][_0x74b4('0x4d')]?_0x371424[_0x74b4('0x4b')]:_0x5e7015['model'];if(!_0x18241d[_0x74b4('0x47')][_0x74b4('0x4e')](_0x74b4('0x4f'))){_0x371424[_0x74b4('0x33')]=qs[_0x74b4('0x33')](_0x18241d[_0x74b4('0x47')]['limit']);_0x371424['offset']=qs[_0x74b4('0x31')](_0x18241d['query']['offset']);}_0x371424[_0x74b4('0x50')]=qs[_0x74b4('0x51')](_0x18241d[_0x74b4('0x47')][_0x74b4('0x51')]);_0x371424[_0x74b4('0x52')]=qs[_0x74b4('0x48')](_[_0x74b4('0x53')](_0x18241d[_0x74b4('0x47')],_0x5e7015[_0x74b4('0x48')]),_0x64940b);if(_0x18241d[_0x74b4('0x47')]['filter']){_0x371424[_0x74b4('0x52')]=_[_0x74b4('0x54')](_0x371424[_0x74b4('0x52')],{'$or':_[_0x74b4('0x42')](_0x64940b,function(_0x58e764){if(_0x58e764[_0x74b4('0x55')]!=='VIRTUAL'){var _0x2eecf4={};_0x2eecf4[_0x58e764[_0x74b4('0x3d')]]={'$like':'%'+_0x18241d[_0x74b4('0x47')]['filter']+'%'};return _0x2eecf4;}})});}_0x371424=_[_0x74b4('0x54')]({},_0x371424,_0x18241d['options']);var _0x509950={'where':_0x371424[_0x74b4('0x52')]};return db[_0x74b4('0x43')][_0x74b4('0x34')](_0x509950)[_0x74b4('0x21')](function(_0x4fc296){_0x135a07[_0x74b4('0x34')]=_0x4fc296;if(_0x18241d[_0x74b4('0x47')][_0x74b4('0x56')]){_0x371424[_0x74b4('0x57')]=[{'all':!![]}];}return db[_0x74b4('0x43')][_0x74b4('0x58')](_0x371424);})[_0x74b4('0x21')](function(_0x4e8349){_0x135a07[_0x74b4('0x59')]=_0x4e8349;return _0x135a07;})[_0x74b4('0x21')](respondWithFilteredResult(_0x3197bc,_0x371424))[_0x74b4('0x2c')](handleError(_0x3197bc,null));};exports[_0x74b4('0x5a')]=function(_0x405000,_0x89328e){var _0x5178ad={'raw':![],'where':{'id':_0x405000[_0x74b4('0x5b')]['id']},'include':[{'model':db[_0x74b4('0x40')],'as':_0x74b4('0x41')}]},_0x4cc55c={};_0x4cc55c['model']=_[_0x74b4('0x46')](db[_0x74b4('0x43')][_0x74b4('0x44')]);_0x4cc55c[_0x74b4('0x47')]=_[_0x74b4('0x46')](_0x405000[_0x74b4('0x47')]);_0x4cc55c[_0x74b4('0x48')]=_[_0x74b4('0x49')](_0x4cc55c['model'],_0x4cc55c[_0x74b4('0x47')]);_0x5178ad['attributes']=_[_0x74b4('0x49')](_0x4cc55c[_0x74b4('0x4a')],qs['fields'](_0x405000[_0x74b4('0x47')][_0x74b4('0x4c')]));_0x5178ad[_0x74b4('0x4b')]=_0x5178ad['attributes'][_0x74b4('0x4d')]?_0x5178ad[_0x74b4('0x4b')]:_0x4cc55c[_0x74b4('0x4a')];if(_0x405000[_0x74b4('0x47')][_0x74b4('0x56')]){_0x5178ad['include']=[{'all':!![]}];}_0x5178ad=_[_0x74b4('0x54')]({},_0x5178ad,_0x405000[_0x74b4('0x5c')]);return db[_0x74b4('0x43')][_0x74b4('0x5d')](_0x5178ad)[_0x74b4('0x21')](handleEntityNotFound(_0x89328e,null))['then'](respondWithResult(_0x89328e,null))[_0x74b4('0x2c')](handleError(_0x89328e,null));};exports[_0x74b4('0x5e')]=function(_0x498bd8,_0x45c440){return db[_0x74b4('0x43')]['create'](_0x498bd8[_0x74b4('0x5f')],{})['then'](function(_0x4e97f4){var _0x2f7683=_0x498bd8['user'][_0x74b4('0x3a')]({'plain':!![]});if(!_0x2f7683)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f7683[_0x74b4('0x60')]===_0x74b4('0x61')){var _0x5a4761=_0x4e97f4['get']({'plain':!![]});var _0x45592b=_0x74b4('0x3b');return db[_0x74b4('0x62')][_0x74b4('0x5d')]({'where':{'name':_0x45592b,'userProfileId':_0x2f7683['userProfileId']},'raw':!![]})['then'](function(_0x1e5fa2){if(_0x1e5fa2&&_0x1e5fa2[_0x74b4('0x63')]===0x0){return db[_0x74b4('0x3c')]['create']({'name':_0x5a4761['name'],'resourceId':_0x5a4761['id'],'type':_0x1e5fa2[_0x74b4('0x3d')],'sectionId':_0x1e5fa2['id']},{})[_0x74b4('0x21')](function(){return _0x4e97f4;});}else{return _0x4e97f4;}})[_0x74b4('0x2c')](function(_0x45d635){logger[_0x74b4('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x45d635);throw _0x45d635;});}return _0x4e97f4;})[_0x74b4('0x21')](respondWithResult(_0x45c440,0xc9))['catch'](handleError(_0x45c440,null));};exports[_0x74b4('0x64')]=function(_0x5ad7b0,_0x436c03){if(_0x5ad7b0[_0x74b4('0x5f')]['id']){delete _0x5ad7b0[_0x74b4('0x5f')]['id'];}return db[_0x74b4('0x43')][_0x74b4('0x5d')]({'where':{'id':_0x5ad7b0[_0x74b4('0x5b')]['id']},'include':[{'model':db[_0x74b4('0x40')],'as':_0x74b4('0x41')}]})[_0x74b4('0x21')](handleEntityNotFound(_0x436c03,null))['then'](saveUpdates(_0x5ad7b0[_0x74b4('0x5f')],null))[_0x74b4('0x21')](respondWithResult(_0x436c03,null))[_0x74b4('0x2c')](handleError(_0x436c03,null));};exports[_0x74b4('0x39')]=function(_0x53b040,_0x511ad1){return db[_0x74b4('0x43')][_0x74b4('0x5d')]({'where':{'id':_0x53b040[_0x74b4('0x5b')]['id']}})[_0x74b4('0x21')](handleEntityNotFound(_0x511ad1,null))[_0x74b4('0x21')](removeEntity(_0x511ad1,null))[_0x74b4('0x2c')](handleError(_0x511ad1,null));};exports[_0x74b4('0x65')]=function(_0x5cfeac,_0x52ca72){return db[_0x74b4('0x43')]['describe']()[_0x74b4('0x21')](respondWithResult(_0x52ca72,null))['catch'](handleError(_0x52ca72,null));};exports['addDisposition']=function(_0x5d57ff,_0x390ba5,_0x2a31d6){if(_0x5d57ff['body']['id']){delete _0x5d57ff['body']['id'];}return db['FaxAccount'][_0x74b4('0x5d')]({'where':{'id':_0x5d57ff[_0x74b4('0x5b')]['id']}})[_0x74b4('0x21')](handleEntityNotFound(_0x390ba5,null))[_0x74b4('0x21')](function(_0x43b1cf){if(_0x43b1cf){_0x5d57ff[_0x74b4('0x5f')][_0x74b4('0x66')]=_0x43b1cf['id'];return db[_0x74b4('0x67')][_0x74b4('0x5e')](_0x5d57ff['body']);}})['then'](respondWithResult(_0x390ba5,null))[_0x74b4('0x2c')](handleError(_0x390ba5,null));};exports[_0x74b4('0x68')]=function(_0x34558d,_0x46704a,_0xea8306){var _0x399c02={'raw':![],'where':{}};var _0x1aae10={};var _0x4e7809={'count':0x0,'rows':[]};return db['FaxAccount'][_0x74b4('0x69')]({'where':{'id':_0x34558d['params']['id']}})['then'](handleEntityNotFound(_0x46704a,null))[_0x74b4('0x21')](function(_0x2e49ad){if(_0x2e49ad){_0x1aae10[_0x74b4('0x4a')]=_[_0x74b4('0x46')](db[_0x74b4('0x67')]['rawAttributes']);_0x1aae10[_0x74b4('0x47')]=_['keys'](_0x34558d[_0x74b4('0x47')]);_0x1aae10['filters']=_[_0x74b4('0x49')](_0x1aae10[_0x74b4('0x4a')],_0x1aae10[_0x74b4('0x47')]);_0x399c02[_0x74b4('0x4b')]=_[_0x74b4('0x49')](_0x1aae10['model'],qs[_0x74b4('0x4c')](_0x34558d[_0x74b4('0x47')]['fields']));_0x399c02[_0x74b4('0x4b')]=_0x399c02['attributes'][_0x74b4('0x4d')]?_0x399c02[_0x74b4('0x4b')]:_0x1aae10[_0x74b4('0x4a')];if(!_0x34558d['query'][_0x74b4('0x4e')](_0x74b4('0x4f'))){_0x399c02[_0x74b4('0x33')]=qs[_0x74b4('0x33')](_0x34558d['query'][_0x74b4('0x33')]);_0x399c02['offset']=qs[_0x74b4('0x31')](_0x34558d[_0x74b4('0x47')][_0x74b4('0x31')]);}_0x399c02['order']=qs[_0x74b4('0x51')](_0x34558d[_0x74b4('0x47')]['sort']);_0x399c02['where']=qs[_0x74b4('0x48')](_[_0x74b4('0x53')](_0x34558d[_0x74b4('0x47')],_0x1aae10['filters']));_0x399c02['where'][_0x74b4('0x66')]=_0x2e49ad['id'];if(_0x34558d[_0x74b4('0x47')]['filter']){_0x399c02[_0x74b4('0x52')]=_['merge'](_0x399c02[_0x74b4('0x52')],{'$or':_[_0x74b4('0x42')](_0x399c02[_0x74b4('0x4b')],function(_0x53c6f8){var _0x4fadf0={};_0x4fadf0[_0x53c6f8]={'$like':'%'+_0x34558d[_0x74b4('0x47')][_0x74b4('0x6a')]+'%'};return _0x4fadf0;})});}_0x399c02=_[_0x74b4('0x54')]({},_0x399c02,_0x34558d['options']);return db[_0x74b4('0x67')][_0x74b4('0x34')]({'where':_0x399c02[_0x74b4('0x52')]})['then'](function(_0x556052){_0x4e7809[_0x74b4('0x34')]=_0x556052;if(_0x34558d[_0x74b4('0x47')][_0x74b4('0x56')]){_0x399c02[_0x74b4('0x57')]=[{'all':!![]}];}return db[_0x74b4('0x67')][_0x74b4('0x58')](_0x399c02);})[_0x74b4('0x21')](function(_0x1b7b0f){_0x4e7809[_0x74b4('0x59')]=_0x1b7b0f;return _0x4e7809;});}})[_0x74b4('0x21')](respondWithFilteredResult(_0x46704a,_0x399c02))[_0x74b4('0x2c')](handleError(_0x46704a,null));};exports[_0x74b4('0x6b')]=function(_0x2f8f84,_0xf6bcf7,_0x33f3bb){return db['FaxAccount'][_0x74b4('0x5d')]({'where':{'id':_0x2f8f84['params']['id']}})['then'](handleEntityNotFound(_0xf6bcf7,null))['then'](function(_0x1e07c0){if(_0x1e07c0){return _0x1e07c0['removeDispositions'](_0x2f8f84[_0x74b4('0x47')][_0x74b4('0x6c')]);}})[_0x74b4('0x21')](respondWithStatusCode(_0xf6bcf7,null))['catch'](handleError(_0xf6bcf7,null));};exports[_0x74b4('0x6d')]=function(_0x35f8fb,_0x305ba4,_0x483846){if(_0x35f8fb[_0x74b4('0x5f')]['id']){delete _0x35f8fb[_0x74b4('0x5f')]['id'];}return db[_0x74b4('0x43')][_0x74b4('0x5d')]({'where':{'id':_0x35f8fb['params']['id']}})[_0x74b4('0x21')](handleEntityNotFound(_0x305ba4,null))['then'](function(_0x35fc2e){if(_0x35fc2e){_0x35f8fb['body'][_0x74b4('0x66')]=_0x35fc2e['id'];return db[_0x74b4('0x6e')][_0x74b4('0x5e')](_0x35f8fb[_0x74b4('0x5f')]);}})['then'](respondWithResult(_0x305ba4,null))['catch'](handleError(_0x305ba4,null));};exports[_0x74b4('0x6f')]=function(_0x402d62,_0x2df431,_0x445649){var _0x5aa0b2={'raw':![],'where':{}};var _0x68a207={};var _0x5bf708={'count':0x0,'rows':[]};return db['FaxAccount'][_0x74b4('0x69')]({'where':{'id':_0x402d62[_0x74b4('0x5b')]['id']}})[_0x74b4('0x21')](handleEntityNotFound(_0x2df431,null))[_0x74b4('0x21')](function(_0x476de8){if(_0x476de8){_0x68a207[_0x74b4('0x4a')]=_[_0x74b4('0x46')](db[_0x74b4('0x6e')]['rawAttributes']);_0x68a207[_0x74b4('0x47')]=_['keys'](_0x402d62[_0x74b4('0x47')]);_0x68a207[_0x74b4('0x48')]=_[_0x74b4('0x49')](_0x68a207[_0x74b4('0x4a')],_0x68a207[_0x74b4('0x47')]);_0x5aa0b2['attributes']=_[_0x74b4('0x49')](_0x68a207[_0x74b4('0x4a')],qs[_0x74b4('0x4c')](_0x402d62[_0x74b4('0x47')][_0x74b4('0x4c')]));_0x5aa0b2[_0x74b4('0x4b')]=_0x5aa0b2[_0x74b4('0x4b')][_0x74b4('0x4d')]?_0x5aa0b2[_0x74b4('0x4b')]:_0x68a207[_0x74b4('0x4a')];if(!_0x402d62[_0x74b4('0x47')][_0x74b4('0x4e')]('nolimit')){_0x5aa0b2['limit']=qs[_0x74b4('0x33')](_0x402d62[_0x74b4('0x47')][_0x74b4('0x33')]);_0x5aa0b2[_0x74b4('0x31')]=qs['offset'](_0x402d62[_0x74b4('0x47')][_0x74b4('0x31')]);}_0x5aa0b2['order']=qs['sort'](_0x402d62[_0x74b4('0x47')][_0x74b4('0x51')]);_0x5aa0b2[_0x74b4('0x52')]=qs[_0x74b4('0x48')](_[_0x74b4('0x53')](_0x402d62['query'],_0x68a207[_0x74b4('0x48')]));_0x5aa0b2['where']['FaxAccountId']=_0x476de8['id'];if(_0x402d62['query'][_0x74b4('0x6a')]){_0x5aa0b2[_0x74b4('0x52')]=_[_0x74b4('0x54')](_0x5aa0b2[_0x74b4('0x52')],{'$or':_[_0x74b4('0x42')](_0x5aa0b2[_0x74b4('0x4b')],function(_0x32b2a8){var _0x401a96={};_0x401a96[_0x32b2a8]={'$like':'%'+_0x402d62[_0x74b4('0x47')][_0x74b4('0x6a')]+'%'};return _0x401a96;})});}_0x5aa0b2=_['merge']({},_0x5aa0b2,_0x402d62[_0x74b4('0x5c')]);return db[_0x74b4('0x6e')][_0x74b4('0x34')]({'where':_0x5aa0b2[_0x74b4('0x52')]})['then'](function(_0x31ad79){_0x5bf708['count']=_0x31ad79;if(_0x402d62[_0x74b4('0x47')][_0x74b4('0x56')]){_0x5aa0b2[_0x74b4('0x57')]=[{'all':!![]}];}return db[_0x74b4('0x6e')][_0x74b4('0x58')](_0x5aa0b2);})[_0x74b4('0x21')](function(_0xaced16){_0x5bf708[_0x74b4('0x59')]=_0xaced16;return _0x5bf708;});}})[_0x74b4('0x21')](respondWithFilteredResult(_0x2df431,_0x5aa0b2))[_0x74b4('0x2c')](handleError(_0x2df431,null));};exports[_0x74b4('0x70')]=function(_0x1c30ce,_0x394750,_0xa3e070){return db[_0x74b4('0x43')][_0x74b4('0x5d')]({'where':{'id':_0x1c30ce[_0x74b4('0x5b')]['id']}})[_0x74b4('0x21')](handleEntityNotFound(_0x394750,null))[_0x74b4('0x21')](function(_0x4634d0){if(_0x4634d0){return _0x4634d0[_0x74b4('0x70')](_0x1c30ce[_0x74b4('0x47')][_0x74b4('0x6c')]);}})[_0x74b4('0x21')](respondWithStatusCode(_0x394750,null))[_0x74b4('0x2c')](handleError(_0x394750,null));};exports['addInteraction']=function(_0x3f0622,_0x3bf15a,_0x6595b){return db[_0x74b4('0x71')]['find']({'where':{'id':_0x3f0622['params']['id']}})[_0x74b4('0x21')](handleEntityNotFound(_0x3bf15a,null))[_0x74b4('0x21')](function(_0x1bed1d){if(_0x1bed1d){return _0x1bed1d[_0x74b4('0x72')](_0x3f0622[_0x74b4('0x5f')][_0x74b4('0x6c')],_[_0x74b4('0x73')](_0x3f0622[_0x74b4('0x5f')],[_0x74b4('0x6c'),'id'])||{});}})[_0x74b4('0x21')](respondWithResult(_0x3bf15a,null))[_0x74b4('0x2c')](handleError(_0x3bf15a,null));};exports['getInteractions']=function(_0x3c73ef,_0x3216e7,_0x195341){var _0x5248ae={'raw':![],'where':{}};var _0x49f665={};var _0x40cf46={'count':0x0,'rows':[]};return db[_0x74b4('0x43')][_0x74b4('0x69')]({'where':{'id':_0x3c73ef[_0x74b4('0x5b')]['id']}})[_0x74b4('0x21')](handleEntityNotFound(_0x3216e7,null))['then'](function(_0x22120f){if(_0x22120f){_0x49f665['model']=_[_0x74b4('0x46')](db['FaxInteraction']['rawAttributes']);_0x49f665[_0x74b4('0x47')]=_['keys'](_0x3c73ef[_0x74b4('0x47')]);_0x49f665[_0x74b4('0x48')]=_[_0x74b4('0x49')](_0x49f665[_0x74b4('0x4a')],_0x49f665[_0x74b4('0x47')]);_0x5248ae[_0x74b4('0x4b')]=_[_0x74b4('0x49')](_0x49f665[_0x74b4('0x4a')],qs[_0x74b4('0x4c')](_0x3c73ef[_0x74b4('0x47')][_0x74b4('0x4c')]));_0x5248ae[_0x74b4('0x4b')]=_0x5248ae[_0x74b4('0x4b')]['length']?_0x5248ae['attributes']:_0x49f665['model'];if(!_0x3c73ef[_0x74b4('0x47')][_0x74b4('0x4e')]('nolimit')){_0x5248ae[_0x74b4('0x33')]=qs[_0x74b4('0x33')](_0x3c73ef[_0x74b4('0x47')][_0x74b4('0x33')]);_0x5248ae[_0x74b4('0x31')]=qs[_0x74b4('0x31')](_0x3c73ef['query'][_0x74b4('0x31')]);}_0x5248ae[_0x74b4('0x50')]=qs[_0x74b4('0x51')](_0x3c73ef['query'][_0x74b4('0x51')]);_0x5248ae[_0x74b4('0x52')]=qs[_0x74b4('0x48')](_['pick'](_0x3c73ef[_0x74b4('0x47')],_0x49f665[_0x74b4('0x48')]));_0x5248ae[_0x74b4('0x52')][_0x74b4('0x66')]=_0x22120f['id'];if(_0x3c73ef[_0x74b4('0x47')][_0x74b4('0x6a')]){_0x5248ae[_0x74b4('0x52')]=_[_0x74b4('0x54')](_0x5248ae['where'],{'$or':_[_0x74b4('0x42')](_0x5248ae[_0x74b4('0x4b')],function(_0x52289f){var _0x5f5df1={};_0x5f5df1[_0x52289f]={'$like':'%'+_0x3c73ef['query']['filter']+'%'};return _0x5f5df1;})});}_0x5248ae=_['merge']({},_0x5248ae,_0x3c73ef['options']);return db[_0x74b4('0x71')]['count']({'where':_0x5248ae[_0x74b4('0x52')]})['then'](function(_0x36612a){_0x40cf46[_0x74b4('0x34')]=_0x36612a;if(_0x3c73ef[_0x74b4('0x47')][_0x74b4('0x56')]){_0x5248ae['include']=[{'model':db[_0x74b4('0x74')],'as':_0x74b4('0x75'),'required':![]},{'model':db['User'],'as':_0x74b4('0x76'),'attributes':['name',_0x74b4('0x77'),_0x74b4('0x78')],'required':![]},{'model':db[_0x74b4('0x79')],'as':'Tags','attributes':['id','name',_0x74b4('0x7a')],'where':_0x3c73ef[_0x74b4('0x47')][_0x74b4('0x7b')]?{'id':_0x3c73ef[_0x74b4('0x47')]['tag']}:undefined,'required':_0x3c73ef['query'][_0x74b4('0x7b')]?!![]:![]}];}return db[_0x74b4('0x71')][_0x74b4('0x58')](_0x5248ae);})[_0x74b4('0x21')](function(_0x4b04e5){_0x40cf46['rows']=_0x4b04e5;return _0x40cf46;});}})['then'](respondWithFilteredResult(_0x3216e7,_0x5248ae))[_0x74b4('0x2c')](handleError(_0x3216e7,null));};exports['addApplications']=function(_0x2a2d41,_0x332dba){var _0x581d0d=_0x2a2d41[_0x74b4('0x5b')]['id'];var _0x483d70=_0x2a2d41[_0x74b4('0x5f')];var _0x1aa1f6=0xc8;var _0x426f0b=null;return db['sequelize'][_0x74b4('0x7c')]({'isolationLevel':db[_0x74b4('0x7d')][_0x74b4('0x7e')]['ISOLATION_LEVELS'][_0x74b4('0x7f')]},function(_0x210037){return db[_0x74b4('0x43')][_0x74b4('0x69')]({'where':{'id':_0x581d0d},'transaction':_0x210037})['then'](function(_0x12ea5b){if(_0x12ea5b){return db[_0x74b4('0x80')][_0x74b4('0x39')]({'where':{'FaxAccountId':_0x581d0d},'transaction':_0x210037})['then'](function(){var _0x2af1ec=_[_0x74b4('0x42')](_0x483d70,function(_0x5307cb){_0x5307cb[_0x74b4('0x66')]=_0x581d0d;return _0x5307cb;});return db[_0x74b4('0x80')]['bulkCreate'](_0x2af1ec,{'transaction':_0x210037});});}else{_0x1aa1f6=0x194;_0x426f0b=[];}});})[_0x74b4('0x21')](function(){if(_0x1aa1f6!==0x194){return db[_0x74b4('0x80')][_0x74b4('0x81')]({'where':{'FaxAccountId':_0x581d0d},'order':_0x74b4('0x82')})[_0x74b4('0x21')](function(_0x1ba0d1){_0x426f0b=_0x1ba0d1;});}})[_0x74b4('0x2c')](function(_0x41be06){_0x1aa1f6=0x1f4;logger['error'](_0x41be06[_0x74b4('0x83')]);if(_0x41be06[_0x74b4('0x3d')]){delete _0x41be06['name'];}_0x426f0b=_0x41be06;})[_0x74b4('0x84')](function(){if(_0x426f0b===null){_0x332dba[_0x74b4('0x2d')](_0x1aa1f6);}else{if(_0x1aa1f6===0x1f4){_0x332dba['status'](_0x1aa1f6)[_0x74b4('0x3e')](_0x426f0b);}else{_0x332dba[_0x74b4('0x2e')](_0x1aa1f6)[_0x74b4('0x30')](_0x426f0b);}}});};exports['getApplications']=function(_0x53f7f2,_0x5e83c2,_0x4be4a4){var _0x5b442b={};var _0x11b80b={};var _0x41d9e1;var _0x3be3ca;return db[_0x74b4('0x43')][_0x74b4('0x69')]({'where':{'id':_0x53f7f2[_0x74b4('0x5b')]['id']}})[_0x74b4('0x21')](handleEntityNotFound(_0x5e83c2,null))[_0x74b4('0x21')](function(_0x2d54be){if(_0x2d54be){_0x41d9e1=_0x2d54be;_0x11b80b[_0x74b4('0x4a')]=_['keys'](db[_0x74b4('0x80')][_0x74b4('0x44')]);_0x11b80b[_0x74b4('0x47')]=_[_0x74b4('0x46')](_0x53f7f2[_0x74b4('0x47')]);_0x11b80b['filters']=_['intersection'](_0x11b80b['model'],_0x11b80b[_0x74b4('0x47')]);_0x5b442b[_0x74b4('0x4b')]=_['intersection'](_0x11b80b[_0x74b4('0x4a')],qs[_0x74b4('0x4c')](_0x53f7f2[_0x74b4('0x47')][_0x74b4('0x4c')]));_0x5b442b['attributes']=_0x5b442b['attributes']['length']?_0x5b442b[_0x74b4('0x4b')]:_0x11b80b[_0x74b4('0x4a')];_0x5b442b[_0x74b4('0x50')]=qs[_0x74b4('0x51')](_0x53f7f2[_0x74b4('0x47')][_0x74b4('0x51')]);_0x5b442b['where']=qs[_0x74b4('0x48')](_[_0x74b4('0x53')](_0x53f7f2['query'],_0x11b80b[_0x74b4('0x48')]));if(_0x53f7f2[_0x74b4('0x47')][_0x74b4('0x6a')]){_0x5b442b[_0x74b4('0x52')]=_['merge'](_0x5b442b[_0x74b4('0x52')],{'$or':_[_0x74b4('0x42')](_0x5b442b[_0x74b4('0x4b')],function(_0x1213b8){var _0x48f2da={};_0x48f2da[_0x1213b8]={'$like':'%'+_0x53f7f2[_0x74b4('0x47')][_0x74b4('0x6a')]+'%'};return _0x48f2da;})});}_0x5b442b=_[_0x74b4('0x54')]({},_0x5b442b,_0x53f7f2[_0x74b4('0x5c')]);return _0x41d9e1[_0x74b4('0x85')](_0x5b442b);}})['then'](function(_0x1c75f5){if(_0x1c75f5){_0x3be3ca=_0x1c75f5[_0x74b4('0x4d')];if(!_0x53f7f2['query'][_0x74b4('0x4e')](_0x74b4('0x4f'))){_0x5b442b['limit']=qs[_0x74b4('0x33')](_0x53f7f2['query'][_0x74b4('0x33')]);_0x5b442b['offset']=qs[_0x74b4('0x31')](_0x53f7f2[_0x74b4('0x47')][_0x74b4('0x31')]);}return _0x41d9e1['getApplications'](_0x5b442b);}})[_0x74b4('0x21')](function(_0x2f42f2){if(_0x2f42f2){return _0x2f42f2?{'count':_0x3be3ca,'rows':_0x2f42f2}:null;}})[_0x74b4('0x21')](respondWithResult(_0x5e83c2,null))[_0x74b4('0x2c')](handleError(_0x5e83c2,null));};function Extension(_0x32d13a,_0x2735ab,_0x18a2a1,_0x47bd4c){this[_0x74b4('0x86')]=_0x74b4('0x87');this['exten']=_0x32d13a[_0x74b4('0x88')];this[_0x74b4('0x89')]=_0x47bd4c;this[_0x74b4('0x55')]=_0x74b4('0x8a');this[_0x74b4('0x8b')]='Fax\x20Extension';this['FaxAccountId']=_0x32d13a['id'];this[_0x74b4('0x82')]=_0x2735ab;this[_0x74b4('0x8c')]=_0x18a2a1;}function createExtensionsReciveFax(_0x117933){var _0x259c9f=0x1;var _0x11352=[];_0x11352[_0x74b4('0x8d')](new Extension(_0x117933,_0x259c9f,'','Answer'));_0x259c9f+=0x1;_0x11352[_0x74b4('0x8d')](new Extension(_0x117933,_0x259c9f,_0x74b4('0x8e'),_0x74b4('0x8f')));_0x259c9f+=0x1;for(var _0x2729f5 in _0x117933){if(_0x117933[_0x74b4('0x4e')](_0x2729f5)&&(_0x2729f5===_0x74b4('0x90')||_0x2729f5==='localstationid'||_0x2729f5==='gateway'||_0x2729f5===_0x74b4('0x91')||_0x2729f5===_0x74b4('0x92')||_0x2729f5===_0x74b4('0x93')||_0x2729f5===_0x74b4('0x94')||_0x2729f5==='modem'||_0x2729f5==='t38timeout')){_0x11352[_0x74b4('0x8d')](new Extension(_0x117933,_0x259c9f,_0x74b4('0x95')+_0x2729f5+')='+_0x117933[_0x2729f5],_0x74b4('0x8f')));_0x259c9f+=0x1;}}_0x11352[_0x74b4('0x8d')](new Extension(_0x117933,_0x259c9f,'6',_0x74b4('0x96')));_0x259c9f+=0x1;_0x11352[_0x74b4('0x8d')](new Extension(_0x117933,_0x259c9f,_0x74b4('0x97'),'ReceiveFax'));_0x259c9f=0x0;return _0x11352;}exports[_0x74b4('0x98')]=function(_0x3bed1b,_0x367bbf,_0xce593){var _0x47763c;return db[_0x74b4('0x7d')][_0x74b4('0x7c')](function(_0x45978e){return db[_0x74b4('0x43')]['create'](_0x3bed1b[_0x74b4('0x5f')],{'transaction':_0x45978e})[_0x74b4('0x21')](function(_0x3c6edc){_0x47763c=_0x3c6edc[_0x74b4('0x3a')]({'plain':!![]});return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_0x47763c),{'transaction':_0x45978e});});})['then'](function(){return _0x47763c;})[_0x74b4('0x21')](respondWithResult(_0x367bbf,null))['catch'](handleError(_0x367bbf,null));};exports[_0x74b4('0x99')]=function(_0x1d1a85,_0x456b19,_0x2ee0d5){var _0x1ba116;return db['sequelize'][_0x74b4('0x7c')](function(_0x289b86){return db[_0x74b4('0x43')][_0x74b4('0x64')](_0x1d1a85[_0x74b4('0x5f')],{'where':{'id':_0x1d1a85[_0x74b4('0x5f')]['id']},'transaction':_0x289b86})['then'](function(_0x6d0e78){return db[_0x74b4('0x9a')][_0x74b4('0x39')]({'where':{'FaxAccountId':_0x1d1a85[_0x74b4('0x5f')]['id']},'transaction':_0x289b86})[_0x74b4('0x21')](function(_0x548d15){return db['VoiceExtension'][_0x74b4('0x9b')](createExtensionsReciveFax(_[_0x74b4('0x73')](_0x1d1a85['body'],[_0x74b4('0x9c'),'key',_0x74b4('0x9d'),_0x74b4('0x9e'),_0x74b4('0x9f'),_0x74b4('0xa0')])),{'transaction':_0x289b86});});});})['then'](function(){return db[_0x74b4('0x43')][_0x74b4('0xa1')](_0x1d1a85[_0x74b4('0x5f')]['id']);})[_0x74b4('0x21')](respondWithResult(_0x456b19,null))[_0x74b4('0x2c')](handleError(_0x456b19,null));};exports[_0x74b4('0xa2')]=function(_0x476a2c,_0x4adec8,_0x2ad35e){var _0x56ac77={'raw':!![],'where':{}};var _0x1a50fb={};var _0x4454fc={'count':0x0,'rows':[]};return db[_0x74b4('0x43')][_0x74b4('0x69')]({'where':{'id':_0x476a2c[_0x74b4('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4adec8,null))[_0x74b4('0x21')](function(_0x28687b){if(_0x28687b){_0x1a50fb[_0x74b4('0x4a')]=_['keys'](db[_0x74b4('0xa3')][_0x74b4('0x44')]);_0x1a50fb[_0x74b4('0x47')]=_[_0x74b4('0x46')](_0x476a2c[_0x74b4('0x47')]);_0x1a50fb[_0x74b4('0x48')]=_[_0x74b4('0x49')](_0x1a50fb[_0x74b4('0x4a')],_0x1a50fb[_0x74b4('0x47')]);_0x56ac77[_0x74b4('0x4b')]=_['intersection'](_0x1a50fb['model'],qs[_0x74b4('0x4c')](_0x476a2c[_0x74b4('0x47')][_0x74b4('0x4c')]));_0x56ac77[_0x74b4('0x4b')]=_0x56ac77[_0x74b4('0x4b')][_0x74b4('0x4d')]?_0x56ac77['attributes']:_0x1a50fb['model'];if(!_0x476a2c[_0x74b4('0x47')]['hasOwnProperty'](_0x74b4('0x4f'))){_0x56ac77[_0x74b4('0x33')]=qs[_0x74b4('0x33')](_0x476a2c['query'][_0x74b4('0x33')]);_0x56ac77[_0x74b4('0x31')]=qs['offset'](_0x476a2c[_0x74b4('0x47')][_0x74b4('0x31')]);}_0x56ac77[_0x74b4('0x50')]=qs[_0x74b4('0x51')](_0x476a2c[_0x74b4('0x47')][_0x74b4('0x51')]);_0x56ac77['where']=qs[_0x74b4('0x48')](_[_0x74b4('0x53')](_0x476a2c[_0x74b4('0x47')],_0x1a50fb[_0x74b4('0x48')]));_0x56ac77[_0x74b4('0x52')]['FaxAccountId']=_0x28687b['id'];if(_0x476a2c[_0x74b4('0x47')]['filter']){_0x56ac77[_0x74b4('0x52')]=_[_0x74b4('0x54')](_0x56ac77[_0x74b4('0x52')],{'$or':_[_0x74b4('0x42')](_0x56ac77[_0x74b4('0x4b')],function(_0xf51591){var _0x5d160b={};_0x5d160b[_0xf51591]={'$like':'%'+_0x476a2c['query'][_0x74b4('0x6a')]+'%'};return _0x5d160b;})});}if(_0x476a2c[_0x74b4('0x47')][_0x74b4('0xa4')]){var _0x481bfd=_0x476a2c[_0x74b4('0x47')][_0x74b4('0xa4')][_0x74b4('0xa5')](',');var _0x26c589={};_0x26c589[_0x481bfd[0x0]]={'$gte':moment(_0x481bfd[0x1])[_0x74b4('0xa6')](_0x74b4('0xa7'))};_0x56ac77[_0x74b4('0x52')]=_['merge'](_0x56ac77[_0x74b4('0x52')],_0x26c589);}_0x56ac77=_[_0x74b4('0x54')]({},_0x56ac77,_0x476a2c[_0x74b4('0x5c')]);return db[_0x74b4('0xa3')][_0x74b4('0x34')]({'where':_0x56ac77[_0x74b4('0x52')]})['then'](function(_0x387a0c){_0x4454fc[_0x74b4('0x34')]=_0x387a0c;if(_0x476a2c[_0x74b4('0x47')]['includeAll']){_0x56ac77['include']=[{'all':!![]}];}return db[_0x74b4('0xa3')][_0x74b4('0x58')](_0x56ac77);})['then'](function(_0x5b1db9){_0x4454fc[_0x74b4('0x59')]=_0x5b1db9;return _0x4454fc;});}})[_0x74b4('0x21')](respondWithFilteredResult(_0x4adec8,_0x56ac77))[_0x74b4('0x2c')](handleError(_0x4adec8,null));};exports[_0x74b4('0x3e')]=function(_0x5ccceb,_0x26e97c,_0x3e0e3d){var _0x13fed3,_0x4e9f16={},_0x1c3a03;if(_0x5ccceb[_0x74b4('0x5f')]['to']){_0x1c3a03=_0x5ccceb[_0x74b4('0x5f')]['to'][0x0];}return db[_0x74b4('0x43')][_0x74b4('0x5d')]({'where':{'id':_0x5ccceb['params']['id']},'include':[{'model':db['CmList'],'as':_0x74b4('0xa8'),'include':[{'model':db[_0x74b4('0x74')],'as':_0x74b4('0xa9'),'where':{'fax':_0x1c3a03},'limit':0x1,'order':[[_0x74b4('0x9e'),'DESC']]}]}]})[_0x74b4('0x21')](handleEntityNotFound(_0x26e97c,null))[_0x74b4('0x21')](function(_0x3b070b){_0x13fed3=_0x3b070b;if(_0x5ccceb[_0x74b4('0x5f')]['attachments']&&_0x5ccceb[_0x74b4('0x5f')][_0x74b4('0xaa')][_0x74b4('0x4d')]){for(var _0x50fd4e=0x0;_0x50fd4e<_0x5ccceb['body'][_0x74b4('0xaa')][_0x74b4('0x4d')];_0x50fd4e+=0x1){_0x5ccceb[_0x74b4('0x5f')][_0x74b4('0xaa')][_0x50fd4e]={'filename':_0x5ccceb[_0x74b4('0x5f')][_0x74b4('0xaa')][_0x50fd4e][_0x74b4('0x3d')],'id':_0x5ccceb['body'][_0x74b4('0xaa')][_0x50fd4e]['id'],'path':path[_0x74b4('0xab')](config['root'],'server/files/attachments',_0x5ccceb[_0x74b4('0x5f')][_0x74b4('0xaa')][_0x50fd4e][_0x74b4('0xac')])};}}return respondWithRpcPromise(_0x74b4('0xad'),'CheckAfterSend',{'FaxAccountId':_['isNil'](_0x5ccceb[_0x74b4('0x5b')]['id'])?undefined:_0x5ccceb[_0x74b4('0x5b')]['id'],'path':_[_0x74b4('0xae')](_0x5ccceb['body']['attachments'][0x0][_0x74b4('0x6')])?undefined:_0x5ccceb[_0x74b4('0x5f')][_0x74b4('0xaa')][0x0][_0x74b4('0x6')],'fax':_[_0x74b4('0xae')](_0x5ccceb[_0x74b4('0x5f')]['to'][0x0])?undefined:_0x5ccceb[_0x74b4('0x5f')]['to'][0x0]},client9002);})[_0x74b4('0x21')](function(){if(_0x13fed3){if(_[_0x74b4('0xae')](_0x5ccceb[_0x74b4('0x5f')][_0x74b4('0xaf')])){_0x5ccceb['body'][_0x74b4('0xaf')]=util[_0x74b4('0xa6')](_0x74b4('0xb0'),_0x13fed3[_0x74b4('0x3d')],_0x13fed3[_0x74b4('0xb1')]);}if(_0x13fed3['List']){if(_0x13fed3[_0x74b4('0xa8')][_0x74b4('0xa9')][_0x74b4('0x4d')]){return _0x13fed3[_0x74b4('0xa8')][_0x74b4('0xa9')][0x0];}else{return db[_0x74b4('0x74')][_0x74b4('0x5e')](_[_0x74b4('0x1a')](_0x5ccceb[_0x74b4('0x5f')],{'firstName':_0x5ccceb[_0x74b4('0x5f')]['to'][0x0],'phone':_0x5ccceb[_0x74b4('0x5f')]['to'][0x0],'fax':_0x5ccceb['body']['to'][0x0],'ListId':_0x13fed3[_0x74b4('0xa0')]}));}}else{throw new Error(_0x74b4('0xb2'));}}else{throw new Error(_0x74b4('0xb3'));}})[_0x74b4('0x21')](function(_0x4f1f9e){if(_0x4f1f9e){return db[_0x74b4('0x71')][_0x74b4('0x5d')]({'where':{'ContactId':_0x4f1f9e['id'],'closed':![],'FaxAccountId':_0x13fed3['id']}})[_0x74b4('0x21')](function(_0x32d29e){if(_0x32d29e){return[_0x32d29e,![]];}return db['FaxInteraction'][_0x74b4('0x5e')]({'UserId':_0x5ccceb['user']['id'],'ContactId':_0x4f1f9e['id'],'FaxAccountId':_0x13fed3['id'],'fax':_0x5ccceb[_0x74b4('0x5f')]['to'][0x0],'firstMsgDirection':_0x74b4('0xb4'),'Messages':[_[_0x74b4('0x54')](_0x5ccceb[_0x74b4('0x5f')],{'read':![],'body':_0x5ccceb[_0x74b4('0x5f')]['attachments'][0x0][_0x74b4('0xb5')],'FaxAccountId':_0x13fed3['id'],'UserId':_0x5ccceb[_0x74b4('0x61')]['id'],'ContactId':_0x4f1f9e['id'],'AttachmentId':_0x5ccceb[_0x74b4('0x5f')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x74b4('0xa3')],'as':'Messages'}]})[_0x74b4('0x21')](function(_0x3fe120){return[_0x3fe120,!![]];});});}else{throw new Error(_0x74b4('0xb6'));}})['spread'](function(_0x5b4ead,_0x2570b6){if(_0x2570b6){return _0x5b4ead;}return db[_0x74b4('0xa3')][_0x74b4('0x5e')]({'direction':_0x74b4('0xb4'),'read':![],'body':_0x5ccceb[_0x74b4('0x5f')][_0x74b4('0xaa')][0x0][_0x74b4('0xb5')],'FaxAccountId':_0x13fed3['id'],'FaxInteractionId':_0x5b4ead['id'],'UserId':_0x5ccceb[_0x74b4('0x61')]['id'],'ContactId':_0x5b4ead[_0x74b4('0xb7')],'AttachmentId':_0x5ccceb[_0x74b4('0x5f')][_0x74b4('0xaa')][0x0]['id']})[_0x74b4('0x21')](function(_0x1e0aed){_0x5b4ead[_0x74b4('0xb8')][_0x74b4('0xb9')]=[];_0x5b4ead[_0x74b4('0xb8')][_0x74b4('0xb9')][_0x74b4('0x8d')](_0x1e0aed['dataValues']);return _0x5b4ead;});})['then'](function(_0x1ce5ac){respondWithRpcPromise(_0x74b4('0xba'),_0x74b4('0xba'),{'FaxAccountId':_['isNil'](_0x5ccceb[_0x74b4('0x5b')]['id'])?undefined:_0x5ccceb['params']['id'],'path':_[_0x74b4('0xae')](_0x5ccceb[_0x74b4('0x5f')]['attachments'][0x0]['path'])?undefined:_0x5ccceb[_0x74b4('0x5f')]['attachments'][0x0]['path'],'fax':_['isNil'](_0x5ccceb['body']['to'][0x0])?undefined:_0x5ccceb['body']['to'][0x0],'AttachmentId':_0x5ccceb[_0x74b4('0x5f')]['attachments'][0x0]['id']},client9002)[_0x74b4('0x21')](function(_0x1b636d){logger[_0x74b4('0x22')]('SendFaxRpc,\x20%s',_0x1b636d);})[_0x74b4('0x2c')](function(_0x16e358){logger[_0x74b4('0x22')](_0x74b4('0xbb'),_0x16e358);});return _0x1ce5ac;})[_0x74b4('0x21')](respondWithResult(_0x26e97c,null))[_0x74b4('0x2c')](handleError(_0x26e97c,null));};exports['addAgents']=function(_0x2afd48,_0x2a6c20,_0x35d8dd){return db[_0x74b4('0x43')][_0x74b4('0x5d')]({'where':{'id':_0x2afd48[_0x74b4('0x5b')]['id']}})['then'](handleEntityNotFound(_0x2a6c20,null))[_0x74b4('0x21')](function(_0x38a26d){if(_0x38a26d){return _0x38a26d[_0x74b4('0xbc')](_0x2afd48['body'][_0x74b4('0x6c')],_[_0x74b4('0x73')](_0x2afd48['body'],['ids','id'])||{})[_0x74b4('0xbd')](function(_0x5457bb){for(var _0x2be3c4=0x0;_0x2be3c4<_0x2afd48[_0x74b4('0x5f')]['ids']['length'];_0x2be3c4+=0x1){socket['emit']('userFaxAccount:save',{'UserId':Number(_0x2afd48[_0x74b4('0x5f')][_0x74b4('0x6c')][_0x2be3c4]),'FaxAccountId':Number(_0x2afd48[_0x74b4('0x5b')]['id'])});}return _0x5457bb;});}})[_0x74b4('0x21')](respondWithResult(_0x2a6c20,null))[_0x74b4('0x2c')](handleError(_0x2a6c20,null));};exports[_0x74b4('0xbe')]=function(_0x3898c7,_0x2e1f20,_0x2e5068){return db[_0x74b4('0x43')]['find']({'where':{'id':_0x3898c7[_0x74b4('0x5b')]['id']}})[_0x74b4('0x21')](handleEntityNotFound(_0x2e1f20,null))[_0x74b4('0x21')](function(_0x2f3f9e){if(_0x2f3f9e){return _0x2f3f9e[_0x74b4('0xbe')](_0x3898c7[_0x74b4('0x47')][_0x74b4('0x6c')])[_0x74b4('0x21')](function(){if(_[_0x74b4('0xbf')](_0x3898c7['query'][_0x74b4('0x6c')])){for(var _0x2bba43=0x0;_0x2bba43<_0x3898c7[_0x74b4('0x47')][_0x74b4('0x6c')]['length'];_0x2bba43+=0x1){socket[_0x74b4('0xc0')](_0x74b4('0xc1'),{'UserId':Number(_0x3898c7['query'][_0x74b4('0x6c')][_0x2bba43]),'FaxAccountId':Number(_0x3898c7[_0x74b4('0x5b')]['id'])});}}else{socket[_0x74b4('0xc0')](_0x74b4('0xc1'),{'UserId':Number(_0x3898c7[_0x74b4('0x47')][_0x74b4('0x6c')]),'FaxAccountId':Number(_0x3898c7[_0x74b4('0x5b')]['id'])});}});}})[_0x74b4('0x21')](respondWithStatusCode(_0x2e1f20,null))[_0x74b4('0x2c')](handleError(_0x2e1f20,null));};exports[_0x74b4('0xc2')]=function(_0x1c153c,_0x36b13e,_0x30f243){var _0x1b752f={};var _0x3bacbe={};var _0x3721ce;var _0x2934c8;return db[_0x74b4('0x43')][_0x74b4('0x69')]({'where':{'id':_0x1c153c[_0x74b4('0x5b')]['id']}})[_0x74b4('0x21')](handleEntityNotFound(_0x36b13e,null))['then'](function(_0x33a871){if(_0x33a871){_0x3721ce=_0x33a871;_0x3bacbe['model']=_['keys'](db[_0x74b4('0xc3')]['rawAttributes']);_0x3bacbe[_0x74b4('0x47')]=_[_0x74b4('0x46')](_0x1c153c[_0x74b4('0x47')]);_0x3bacbe[_0x74b4('0x48')]=_[_0x74b4('0x49')](_0x3bacbe[_0x74b4('0x4a')],_0x3bacbe[_0x74b4('0x47')]);_0x1b752f[_0x74b4('0x4b')]=_[_0x74b4('0x49')](_0x3bacbe[_0x74b4('0x4a')],qs['fields'](_0x1c153c[_0x74b4('0x47')][_0x74b4('0x4c')]));_0x1b752f[_0x74b4('0x4b')]=_0x1b752f['attributes'][_0x74b4('0x4d')]?_0x1b752f[_0x74b4('0x4b')]:_0x3bacbe[_0x74b4('0x4a')];_0x1b752f[_0x74b4('0x50')]=qs['sort'](_0x1c153c[_0x74b4('0x47')][_0x74b4('0x51')]);_0x1b752f[_0x74b4('0x52')]=qs[_0x74b4('0x48')](_['pick'](_0x1c153c[_0x74b4('0x47')],_0x3bacbe['filters']));if(_0x1c153c[_0x74b4('0x47')][_0x74b4('0x6a')]){_0x1b752f[_0x74b4('0x52')]=_[_0x74b4('0x54')](_0x1b752f[_0x74b4('0x52')],{'$or':_['map'](_0x1b752f[_0x74b4('0x4b')],function(_0x39f882){var _0x4c94dc={};_0x4c94dc[_0x39f882]={'$like':'%'+_0x1c153c[_0x74b4('0x47')][_0x74b4('0x6a')]+'%'};return _0x4c94dc;})});}_0x1b752f=_[_0x74b4('0x54')]({},_0x1b752f,_0x1c153c[_0x74b4('0x5c')]);return _0x3721ce[_0x74b4('0xc2')](_0x1b752f);}})[_0x74b4('0x21')](function(_0x386dc9){if(_0x386dc9){_0x2934c8=_0x386dc9['length'];if(!_0x1c153c[_0x74b4('0x47')]['hasOwnProperty'](_0x74b4('0x4f'))){_0x1b752f['limit']=qs[_0x74b4('0x33')](_0x1c153c[_0x74b4('0x47')][_0x74b4('0x33')]);_0x1b752f[_0x74b4('0x31')]=qs[_0x74b4('0x31')](_0x1c153c[_0x74b4('0x47')][_0x74b4('0x31')]);}return _0x3721ce[_0x74b4('0xc2')](_0x1b752f);}})[_0x74b4('0x21')](function(_0x35910f){if(_0x35910f){return _0x35910f?{'count':_0x2934c8,'rows':_0x35910f}:null;}})[_0x74b4('0x21')](respondWithResult(_0x36b13e,null))[_0x74b4('0x2c')](handleError(_0x36b13e,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 61d539a..bf7d0f8 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 _0xc804=['update','remove','emit','hook','events','../../mysqldb','FaxAccount','setMaxListeners','save'];(function(_0x10df18,_0x13338c){var _0x1f9a1d=function(_0x3157f4){while(--_0x3157f4){_0x10df18['push'](_0x10df18['shift']());}};_0x1f9a1d(++_0x13338c);}(_0xc804,0x1bd));var _0x4c80=function(_0x1d61cf,_0x61d59){_0x1d61cf=_0x1d61cf-0x0;var _0x2025d2=_0xc804[_0x1d61cf];return _0x2025d2;};'use strict';var EventEmitter=require(_0x4c80('0x0'));var FaxAccount=require(_0x4c80('0x1'))['db'][_0x4c80('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x4c80('0x3')](0x0);var events={'afterCreate':_0x4c80('0x4'),'afterUpdate':_0x4c80('0x5'),'afterDestroy':_0x4c80('0x6')};function emitEvent(_0x4015da){return function(_0x9031ee,_0x180a58,_0x1a3994){FaxAccountEvents[_0x4c80('0x7')](_0x4015da+':'+_0x9031ee['id'],_0x9031ee);FaxAccountEvents[_0x4c80('0x7')](_0x4015da,_0x9031ee);_0x1a3994(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x4c80('0x8')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file +var _0x02df=['FaxAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x02df,0x137));var _0xf02d=function(_0x28eed8,_0x3dafe8){_0x28eed8=_0x28eed8-0x0;var _0x439d5c=_0x02df[_0x28eed8];return _0x439d5c;};'use strict';var EventEmitter=require(_0xf02d('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0xf02d('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xf02d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf02d('0x3'),'afterDestroy':_0xf02d('0x4')};function emitEvent(_0x223bd1){return function(_0x7581dd,_0x34c6d6,_0x4913fd){FaxAccountEvents[_0xf02d('0x5')](_0x223bd1+':'+_0x7581dd['id'],_0x7581dd);FaxAccountEvents[_0xf02d('0x5')](_0x223bd1,_0x7581dd);_0x4913fd(null);};}for(var e in events){if(events[_0xf02d('0x6')](e)){var event=events[e];FaxAccount[_0xf02d('0x7')](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 44be106..302ab79 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 _0x3c09=['../../config/logger','api','moment','bluebird','request-promise','path','./faxAccount.attributes','exports','define','fax_accounts','lodash','util'];(function(_0x24b5ee,_0x5185a5){var _0x51e0b4=function(_0x55c97d){while(--_0x55c97d){_0x24b5ee['push'](_0x24b5ee['shift']());}};_0x51e0b4(++_0x5185a5);}(_0x3c09,0x1ea));var _0x93c0=function(_0x1570f8,_0x578077){_0x1570f8=_0x1570f8-0x0;var _0x496249=_0x3c09[_0x1570f8];return _0x496249;};'use strict';var _=require(_0x93c0('0x0'));var util=require(_0x93c0('0x1'));var logger=require(_0x93c0('0x2'))(_0x93c0('0x3'));var moment=require(_0x93c0('0x4'));var BPromise=require(_0x93c0('0x5'));var rp=require(_0x93c0('0x6'));var fs=require('fs');var path=require(_0x93c0('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x93c0('0x8'));module[_0x93c0('0x9')]=function(_0x430a22,_0x27067e){return _0x430a22[_0x93c0('0xa')]('FaxAccount',attributes,{'tableName':_0x93c0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa5f6=['util','api','request-promise','../../config/environment','./faxAccount.attributes','define','FaxAccount','fax_accounts','lodash'];(function(_0x46111d,_0x5d286b){var _0xe82586=function(_0x39551b){while(--_0x39551b){_0x46111d['push'](_0x46111d['shift']());}};_0xe82586(++_0x5d286b);}(_0xa5f6,0x179));var _0x6a5f=function(_0x4699c0,_0x2529cb){_0x4699c0=_0x4699c0-0x0;var _0x56b818=_0xa5f6[_0x4699c0];return _0x56b818;};'use strict';var _=require(_0x6a5f('0x0'));var util=require(_0x6a5f('0x1'));var logger=require('../../config/logger')(_0x6a5f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6a5f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6a5f('0x4'));var attributes=require(_0x6a5f('0x5'));module['exports']=function(_0x3bd64a,_0x51c216){return _0x3bd64a[_0x6a5f('0x6')](_0x6a5f('0x7'),attributes,{'tableName':_0x6a5f('0x8'),'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 57f7a4c..66eac6a 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 _0x9d53=['Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','body','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','account','List','CmContact','FaxApplication','Applications','get','applications','list','asc','Contacts','length','create','FaxInteraction','find','Contact\x20not\x20found','spread','close','unmanaged','*,*,*,*','created','FaxMessage','ContactId','UserId','User','name','interaction','unshift','agent','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','register','request','then','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','GetFaxAccount','FaxAccount','raw','options','where','attributes','limit','include','map','model','catch','NotifyFaxAccount','fax','describe'];(function(_0x185d2a,_0x308609){var _0x4dea27=function(_0x513443){while(--_0x513443){_0x185d2a['push'](_0x185d2a['shift']());}};_0x4dea27(++_0x308609);}(_0x9d53,0x1ed));var _0x39d5=function(_0x1055cd,_0x120aeb){_0x1055cd=_0x1055cd-0x0;var _0x2aff63=_0x9d53[_0x1055cd];return _0x2aff63;};'use strict';var _=require(_0x39d5('0x0'));var util=require('util');var moment=require(_0x39d5('0x1'));var BPromise=require(_0x39d5('0x2'));var rs=require(_0x39d5('0x3'));var fs=require('fs');var Redis=require(_0x39d5('0x4'));var db=require(_0x39d5('0x5'))['db'];var utils=require(_0x39d5('0x6'));var logger=require(_0x39d5('0x7'))('rpc');var config=require(_0x39d5('0x8'));var jayson=require(_0x39d5('0x9'));var client=jayson[_0x39d5('0xa')]['http']({'port':0x232c});config[_0x39d5('0xb')]=_[_0x39d5('0xc')](config[_0x39d5('0xb')],{'host':_0x39d5('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x39d5('0xb')]));require('./faxAccount.socket')[_0x39d5('0xe')](socket);function respondWithRpcPromise(_0x44123a,_0x1fa218,_0x385d8d){return new BPromise(function(_0x4b2319,_0x32695b){return client[_0x39d5('0xf')](_0x44123a,_0x385d8d)[_0x39d5('0x10')](function(_0xe4a46b){logger['info'](_0x39d5('0x11'),_0x1fa218,'request\x20sent');logger[_0x39d5('0x12')](_0x39d5('0x13'),_0x1fa218,_0x39d5('0x14'),JSON[_0x39d5('0x15')](_0xe4a46b));if(_0xe4a46b['error']){if(_0xe4a46b[_0x39d5('0x16')][_0x39d5('0x17')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x1fa218,_0xe4a46b[_0x39d5('0x16')]['message']);return _0x32695b(_0xe4a46b['error'][_0x39d5('0x18')]);}logger[_0x39d5('0x16')](_0x39d5('0x11'),_0x1fa218,_0xe4a46b[_0x39d5('0x16')][_0x39d5('0x18')]);return _0x4b2319(_0xe4a46b[_0x39d5('0x16')][_0x39d5('0x18')]);}else{logger[_0x39d5('0x19')]('FaxAccount,\x20%s,\x20%s',_0x1fa218,_0x39d5('0x14'));_0x4b2319(_0xe4a46b[_0x39d5('0x1a')][_0x39d5('0x18')]);}})['catch'](function(_0x5e6150){logger[_0x39d5('0x16')]('FaxAccount,\x20%s,\x20%s',_0x1fa218,_0x5e6150);_0x32695b(_0x5e6150);});});}exports[_0x39d5('0x1b')]=function(_0x1597c3){var _0x46d8fa=this;return new Promise(function(_0x129239,_0x11a1a3){return db[_0x39d5('0x1c')]['findAll']({'raw':_0x1597c3['options']?_0x1597c3['options'][_0x39d5('0x1d')]===undefined?!![]:![]:!![],'where':_0x1597c3[_0x39d5('0x1e')]?_0x1597c3[_0x39d5('0x1e')][_0x39d5('0x1f')]||null:null,'attributes':_0x1597c3[_0x39d5('0x1e')]?_0x1597c3[_0x39d5('0x1e')][_0x39d5('0x20')]||null:null,'limit':_0x1597c3[_0x39d5('0x1e')]?_0x1597c3[_0x39d5('0x1e')][_0x39d5('0x21')]||null:null,'include':_0x1597c3[_0x39d5('0x1e')]?_0x1597c3[_0x39d5('0x1e')][_0x39d5('0x22')]?_[_0x39d5('0x23')](_0x1597c3[_0x39d5('0x1e')][_0x39d5('0x22')],function(_0x15aa93){return{'model':db[_0x15aa93[_0x39d5('0x24')]],'as':_0x15aa93['as'],'attributes':_0x15aa93['attributes'],'include':_0x15aa93[_0x39d5('0x22')]?_[_0x39d5('0x23')](_0x15aa93[_0x39d5('0x22')],function(_0x44d95e){return{'model':db[_0x44d95e[_0x39d5('0x24')]],'as':_0x44d95e['as'],'attributes':_0x44d95e[_0x39d5('0x20')],'include':_0x44d95e[_0x39d5('0x22')]?_[_0x39d5('0x23')](_0x44d95e['include'],function(_0x174290){return{'model':db[_0x174290[_0x39d5('0x24')]],'as':_0x174290['as'],'attributes':_0x174290['attributes']};}):[]};}):[]};}):[]:[]})[_0x39d5('0x10')](function(_0x5cb52d){logger[_0x39d5('0x19')](_0x39d5('0x1b'),_0x1597c3);logger['debug'](_0x39d5('0x1b'),_0x1597c3,JSON[_0x39d5('0x15')](_0x5cb52d));_0x129239(_0x5cb52d);})[_0x39d5('0x25')](function(_0x43d1eb){logger[_0x39d5('0x16')](_0x39d5('0x1b'),_0x43d1eb['message'],_0x1597c3);_0x11a1a3(_0x46d8fa[_0x39d5('0x16')](0x1f4,_0x43d1eb[_0x39d5('0x18')]));});});};exports[_0x39d5('0x26')]=function(_0x4cbf51,_0x35d663,_0xf59d30){var _0x2f7ccd=this;return new Promise(function(_0x598949,_0x103059){var _0x2d4a72={'body':_0x4cbf51['body'],'channel':_0x39d5('0x27')};var _0x1cf42f=[];var _0x230f04=[];var _0x5a0182={};return db['CmContact'][_0x39d5('0x28')]()['then'](function(_0x2d62e4){if(!_0x2d62e4){throw new db[(_0x39d5('0x29'))][(_0x39d5('0x2a'))](_0x39d5('0x2b'));}_0x1cf42f=_[_0x39d5('0x2c')](_[_0x39d5('0x2d')](_0x2d62e4),[_0x39d5('0x2e'),_0x39d5('0x2f')]);_0x230f04=_[_0x39d5('0x2c')](_[_0x39d5('0x2d')](_0x2d62e4),['createdAt',_0x39d5('0x2f'),_0x39d5('0x30'),_0x39d5('0x31')]);if(_0x4cbf51[_0x39d5('0x32')]['id']){delete _0x4cbf51['body']['id'];}if(_[_0x39d5('0x33')](_0x4cbf51[_0x39d5('0x32')]['from'])){throw new db[(_0x39d5('0x29'))][(_0x39d5('0x2a'))](_0x39d5('0x34'));}if(_[_0x39d5('0x33')](_0x4cbf51['body'][_0x39d5('0x32')])||_0x4cbf51[_0x39d5('0x32')][_0x39d5('0x32')]===''){throw new db[(_0x39d5('0x29'))][(_0x39d5('0x2a'))](_0x39d5('0x35'));}if(_[_0x39d5('0x33')](_0x4cbf51[_0x39d5('0x32')]['mapKey'])){throw new db[(_0x39d5('0x29'))][(_0x39d5('0x2a'))](_0x39d5('0x36')+_0x230f04);}if(!_[_0x39d5('0x37')](_0x230f04,_0x4cbf51[_0x39d5('0x32')][_0x39d5('0x38')])){throw new db[(_0x39d5('0x29'))][(_0x39d5('0x2a'))](_0x39d5('0x39')+_0x230f04);}_0x5a0182[_0x4cbf51[_0x39d5('0x32')]['mapKey']]=_0x4cbf51[_0x39d5('0x32')][_0x39d5('0x3a')];})[_0x39d5('0x10')](function(){return db['FaxAccount']['find']({'where':{'id':_0x4cbf51[_0x39d5('0x3b')]['id']},'include':[{'model':db['CmList'],'as':_0x39d5('0x3c'),'include':[{'model':db[_0x39d5('0x3d')],'as':'Contacts','where':_0x5a0182,'limit':0x1,'order':[[_0x39d5('0x2f'),'DESC']]}]},{'model':db[_0x39d5('0x3e')],'as':_0x39d5('0x3f')}]});})[_0x39d5('0x10')](function(_0x4a5177){if(_0x4a5177&&_0x4a5177[_0x39d5('0x3c')]){var _0x27bfdd=_0x4a5177[_0x39d5('0x40')]({'plain':!![]});_0x2d4a72[_0x39d5('0x3b')]=_0x27bfdd;_0x2d4a72[_0x39d5('0x41')]=_0x27bfdd[_0x39d5('0x3f')];_0x2d4a72[_0x39d5('0x42')]=_0x27bfdd[_0x39d5('0x3c')];_0x2d4a72[_0x39d5('0x41')]=_['orderBy'](_0x2d4a72[_0x39d5('0x41')],['priority'],[_0x39d5('0x43')]);if(_0x2d4a72[_0x39d5('0x3b')][_0x39d5('0x3f')]){delete _0x2d4a72[_0x39d5('0x3b')][_0x39d5('0x3f')];}if(_0x2d4a72[_0x39d5('0x3b')][_0x39d5('0x3c')]&&_0x2d4a72['account']['List'][_0x39d5('0x44')][_0x39d5('0x45')]){return _0x2d4a72[_0x39d5('0x3b')][_0x39d5('0x3c')]['Contacts'][0x0];}var _0x495273=_[_0x39d5('0xc')](_0x4cbf51[_0x39d5('0x32')],{'firstName':_0x4cbf51[_0x39d5('0x32')][_0x39d5('0x3a')],'ListId':_0x27bfdd[_0x39d5('0x31')]});_0x495273[_0x4cbf51[_0x39d5('0x32')][_0x39d5('0x38')]]=_0x4cbf51['body'][_0x39d5('0x3a')];return db[_0x39d5('0x3d')][_0x39d5('0x46')](_0x495273,{'fields':_0x1cf42f,'raw':!![]});}})['then'](function(_0x35df8e){_0x2d4a72['contact']=_0x35df8e;if(_0x35df8e){var _0x43e23c={'ContactId':_0x35df8e['id'],'FaxAccountId':_0x4cbf51[_0x39d5('0x3b')]['id'],'fax':_0x35df8e[_0x39d5('0x27')]};return db[_0x39d5('0x47')][_0x39d5('0x48')]({'where':{'ContactId':_0x35df8e['id'],'closed':![],'FaxAccountId':_0x4cbf51[_0x39d5('0x3b')]['id']}})[_0x39d5('0x10')](function(_0x2914fc){if(_0x2914fc){return[_0x2914fc,![]];}return db['FaxInteraction']['create'](_0x43e23c)[_0x39d5('0x10')](function(_0x35f091){return[_0x35f091,!![]];});});}else{throw new Error(_0x39d5('0x49'));}})[_0x39d5('0x4a')](function(_0x1a30e3,_0x52cac0){var _0x1d06e8=_0x1a30e3[_0x39d5('0x40')]({'plain':!![]});if(_0x52cac0){if(_0x2d4a72['account']['autoclose']){_0x2d4a72['applications']['push']({'id':0x0,'priority':_0x2d4a72[_0x39d5('0x41')][_0x39d5('0x45')]+0x1,'app':_0x39d5('0x4b'),'appdata':_0x39d5('0x4c'),'interval':_0x39d5('0x4d')});}_0x1d06e8[_0x39d5('0x4e')]=!![];}else{_0x1d06e8[_0x39d5('0x4e')]=![];}_0x2d4a72['interaction']=_0x1d06e8;return db[_0x39d5('0x4f')][_0x39d5('0x46')]({'body':_0x4cbf51[_0x39d5('0x32')]['body'],'FaxAccountId':_0x4cbf51['account']['id'],'FaxInteractionId':_0x1a30e3['id'],'direction':'in','ContactId':_0x1a30e3[_0x39d5('0x50')],'AttachmentId':_0x4cbf51[_0x39d5('0x32')]['AttachmentId']});})[_0x39d5('0x10')](function(_0x265960){_0x2d4a72[_0x39d5('0x18')]=_0x265960;if(_0x2d4a72['interaction'][_0x39d5('0x51')]){return db[_0x39d5('0x52')][_0x39d5('0x48')]({'attributes':['id',_0x39d5('0x53')],'where':{'id':_0x2d4a72[_0x39d5('0x54')][_0x39d5('0x51')]}})['then'](function(_0x14968c){if(_0x14968c){_0x2d4a72[_0x39d5('0x41')][_0x39d5('0x55')]({'id':0x0,'priority':0x0,'app':_0x39d5('0x56'),'appdata':_0x14968c[_0x39d5('0x53')]+','+(_0x2d4a72[_0x39d5('0x3b')]['waitForTheAssignedAgent']||0xa),'interval':_0x39d5('0x4d')});}return respondWithRpcPromise(_0x39d5('0x57'),_0x39d5('0x58'),_0x2d4a72);});}return respondWithRpcPromise(_0x39d5('0x57'),_0x39d5('0x58'),_0x2d4a72);})[_0x39d5('0x10')](function(_0x4b1184){_0x598949(_0x4b1184);})[_0x39d5('0x25')](function(_0xa472f7){_0x103059(_0x2f7ccd[_0x39d5('0x16')](0x1f4,_0xa472f7['message']));});});}; \ No newline at end of file +var _0x266a=['redis','defaults','socket.io-emitter','./faxAccount.socket','register','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxAccount','FaxAccount','options','raw','where','attributes','limit','map','include','model','then','NotifyFaxAccount','body','fax','describe','Sequelize','no\x20available\x20attributes','keys','createdAt','difference','updatedAt','ListId','isNil','from','ValidationError','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','FaxApplication','Applications','get','applications','list','orderBy','priority','account','CmContact','create','contact','find','FaxInteraction','Contact\x20not\x20found','spread','close','unmanaged','*,*,*,*','created','FaxMessage','AttachmentId','User','interaction','UserId','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http'];(function(_0x3c81b5,_0x3f5ed7){var _0x5888c4=function(_0x4e65b0){while(--_0x4e65b0){_0x3c81b5['push'](_0x3c81b5['shift']());}};_0x5888c4(++_0x3f5ed7);}(_0x266a,0xa5));var _0xa266=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x266a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa266('0x0'));var util=require(_0xa266('0x1'));var moment=require(_0xa266('0x2'));var BPromise=require(_0xa266('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa266('0x4'));var db=require(_0xa266('0x5'))['db'];var utils=require(_0xa266('0x6'));var logger=require('../../config/logger')(_0xa266('0x7'));var config=require(_0xa266('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa266('0x9')][_0xa266('0xa')]({'port':0x232c});config[_0xa266('0xb')]=_[_0xa266('0xc')](config[_0xa266('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xa266('0xd'))(new Redis(config['redis']));require(_0xa266('0xe'))[_0xa266('0xf')](socket);function respondWithRpcPromise(_0x117869,_0x250020,_0x34c019){return new BPromise(function(_0x2027be,_0x386e14){return client['request'](_0x117869,_0x34c019)['then'](function(_0x19d5a8){logger[_0xa266('0x10')](_0xa266('0x11'),_0x250020,_0xa266('0x12'));logger[_0xa266('0x13')](_0xa266('0x14'),_0x250020,'request\x20sent',JSON[_0xa266('0x15')](_0x19d5a8));if(_0x19d5a8[_0xa266('0x16')]){if(_0x19d5a8['error'][_0xa266('0x17')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x250020,_0x19d5a8[_0xa266('0x16')][_0xa266('0x18')]);return _0x386e14(_0x19d5a8[_0xa266('0x16')]['message']);}logger[_0xa266('0x16')]('FaxAccount,\x20%s,\x20%s',_0x250020,_0x19d5a8[_0xa266('0x16')]['message']);return _0x2027be(_0x19d5a8[_0xa266('0x16')][_0xa266('0x18')]);}else{logger['info'](_0xa266('0x11'),_0x250020,_0xa266('0x12'));_0x2027be(_0x19d5a8[_0xa266('0x19')][_0xa266('0x18')]);}})[_0xa266('0x1a')](function(_0x532b0f){logger[_0xa266('0x16')]('FaxAccount,\x20%s,\x20%s',_0x250020,_0x532b0f);_0x386e14(_0x532b0f);});});}exports[_0xa266('0x1b')]=function(_0x1c240a){var _0xf6a14c=this;return new Promise(function(_0x375548,_0x3cf90a){return db[_0xa266('0x1c')]['findAll']({'raw':_0x1c240a['options']?_0x1c240a[_0xa266('0x1d')][_0xa266('0x1e')]===undefined?!![]:![]:!![],'where':_0x1c240a['options']?_0x1c240a[_0xa266('0x1d')][_0xa266('0x1f')]||null:null,'attributes':_0x1c240a[_0xa266('0x1d')]?_0x1c240a[_0xa266('0x1d')][_0xa266('0x20')]||null:null,'limit':_0x1c240a[_0xa266('0x1d')]?_0x1c240a[_0xa266('0x1d')][_0xa266('0x21')]||null:null,'include':_0x1c240a[_0xa266('0x1d')]?_0x1c240a[_0xa266('0x1d')]['include']?_[_0xa266('0x22')](_0x1c240a[_0xa266('0x1d')][_0xa266('0x23')],function(_0x6a2fd6){return{'model':db[_0x6a2fd6['model']],'as':_0x6a2fd6['as'],'attributes':_0x6a2fd6['attributes'],'include':_0x6a2fd6[_0xa266('0x23')]?_['map'](_0x6a2fd6['include'],function(_0xc306aa){return{'model':db[_0xc306aa[_0xa266('0x24')]],'as':_0xc306aa['as'],'attributes':_0xc306aa[_0xa266('0x20')],'include':_0xc306aa['include']?_[_0xa266('0x22')](_0xc306aa[_0xa266('0x23')],function(_0x26f31e){return{'model':db[_0x26f31e[_0xa266('0x24')]],'as':_0x26f31e['as'],'attributes':_0x26f31e[_0xa266('0x20')]};}):[]};}):[]};}):[]:[]})[_0xa266('0x25')](function(_0x5c504d){logger[_0xa266('0x10')](_0xa266('0x1b'),_0x1c240a);logger[_0xa266('0x13')](_0xa266('0x1b'),_0x1c240a,JSON[_0xa266('0x15')](_0x5c504d));_0x375548(_0x5c504d);})['catch'](function(_0x29b11d){logger[_0xa266('0x16')](_0xa266('0x1b'),_0x29b11d[_0xa266('0x18')],_0x1c240a);_0x3cf90a(_0xf6a14c[_0xa266('0x16')](0x1f4,_0x29b11d[_0xa266('0x18')]));});});};exports[_0xa266('0x26')]=function(_0x5dd12b,_0x1a5aaa,_0x44d7ab){var _0x505b22=this;return new Promise(function(_0x1a292a,_0x83e569){var _0x3ff94e={'body':_0x5dd12b[_0xa266('0x27')],'channel':_0xa266('0x28')};var _0x3be81e=[];var _0x1f70a7=[];var _0x17e6f8={};return db['CmContact'][_0xa266('0x29')]()[_0xa266('0x25')](function(_0x2f7af7){if(!_0x2f7af7){throw new db[(_0xa266('0x2a'))]['ValidationError'](_0xa266('0x2b'));}_0x3be81e=_['difference'](_[_0xa266('0x2c')](_0x2f7af7),[_0xa266('0x2d'),'updatedAt']);_0x1f70a7=_[_0xa266('0x2e')](_['keys'](_0x2f7af7),[_0xa266('0x2d'),_0xa266('0x2f'),'CompanyId',_0xa266('0x30')]);if(_0x5dd12b[_0xa266('0x27')]['id']){delete _0x5dd12b[_0xa266('0x27')]['id'];}if(_[_0xa266('0x31')](_0x5dd12b[_0xa266('0x27')][_0xa266('0x32')])){throw new db[(_0xa266('0x2a'))][(_0xa266('0x33'))](_0xa266('0x34'));}if(_[_0xa266('0x31')](_0x5dd12b[_0xa266('0x27')][_0xa266('0x27')])||_0x5dd12b[_0xa266('0x27')][_0xa266('0x27')]===''){throw new db[(_0xa266('0x2a'))][(_0xa266('0x33'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xa266('0x31')](_0x5dd12b[_0xa266('0x27')][_0xa266('0x35')])){throw new db[(_0xa266('0x2a'))][(_0xa266('0x33'))](_0xa266('0x36')+_0x1f70a7);}if(!_['includes'](_0x1f70a7,_0x5dd12b['body'][_0xa266('0x35')])){throw new db['Sequelize'][(_0xa266('0x33'))](_0xa266('0x37')+_0x1f70a7);}_0x17e6f8[_0x5dd12b['body']['mapKey']]=_0x5dd12b[_0xa266('0x27')][_0xa266('0x32')];})['then'](function(){return db[_0xa266('0x1c')]['find']({'where':{'id':_0x5dd12b['account']['id']},'include':[{'model':db['CmList'],'as':_0xa266('0x38'),'include':[{'model':db['CmContact'],'as':_0xa266('0x39'),'where':_0x17e6f8,'limit':0x1,'order':[['updatedAt',_0xa266('0x3a')]]}]},{'model':db[_0xa266('0x3b')],'as':_0xa266('0x3c')}]});})[_0xa266('0x25')](function(_0x2605c4){if(_0x2605c4&&_0x2605c4[_0xa266('0x38')]){var _0x2d4813=_0x2605c4[_0xa266('0x3d')]({'plain':!![]});_0x3ff94e['account']=_0x2d4813;_0x3ff94e[_0xa266('0x3e')]=_0x2d4813['Applications'];_0x3ff94e[_0xa266('0x3f')]=_0x2d4813[_0xa266('0x38')];_0x3ff94e['applications']=_[_0xa266('0x40')](_0x3ff94e[_0xa266('0x3e')],[_0xa266('0x41')],['asc']);if(_0x3ff94e[_0xa266('0x42')][_0xa266('0x3c')]){delete _0x3ff94e['account'][_0xa266('0x3c')];}if(_0x3ff94e['account']['List']&&_0x3ff94e['account'][_0xa266('0x38')][_0xa266('0x39')]['length']){return _0x3ff94e[_0xa266('0x42')][_0xa266('0x38')][_0xa266('0x39')][0x0];}var _0x1919ff=_[_0xa266('0xc')](_0x5dd12b[_0xa266('0x27')],{'firstName':_0x5dd12b[_0xa266('0x27')]['from'],'ListId':_0x2d4813[_0xa266('0x30')]});_0x1919ff[_0x5dd12b[_0xa266('0x27')][_0xa266('0x35')]]=_0x5dd12b['body'][_0xa266('0x32')];return db[_0xa266('0x43')][_0xa266('0x44')](_0x1919ff,{'fields':_0x3be81e,'raw':!![]});}})[_0xa266('0x25')](function(_0x407ca2){_0x3ff94e[_0xa266('0x45')]=_0x407ca2;if(_0x407ca2){var _0x4a7278={'ContactId':_0x407ca2['id'],'FaxAccountId':_0x5dd12b[_0xa266('0x42')]['id'],'fax':_0x407ca2['fax']};return db['FaxInteraction'][_0xa266('0x46')]({'where':{'ContactId':_0x407ca2['id'],'closed':![],'FaxAccountId':_0x5dd12b[_0xa266('0x42')]['id']}})[_0xa266('0x25')](function(_0x45d66b){if(_0x45d66b){return[_0x45d66b,![]];}return db[_0xa266('0x47')][_0xa266('0x44')](_0x4a7278)[_0xa266('0x25')](function(_0x3da5d1){return[_0x3da5d1,!![]];});});}else{throw new Error(_0xa266('0x48'));}})[_0xa266('0x49')](function(_0xcece72,_0xc4890a){var _0x4948d6=_0xcece72['get']({'plain':!![]});if(_0xc4890a){if(_0x3ff94e[_0xa266('0x42')]['autoclose']){_0x3ff94e[_0xa266('0x3e')]['push']({'id':0x0,'priority':_0x3ff94e[_0xa266('0x3e')]['length']+0x1,'app':_0xa266('0x4a'),'appdata':_0xa266('0x4b'),'interval':_0xa266('0x4c')});}_0x4948d6[_0xa266('0x4d')]=!![];}else{_0x4948d6[_0xa266('0x4d')]=![];}_0x3ff94e['interaction']=_0x4948d6;return db[_0xa266('0x4e')][_0xa266('0x44')]({'body':_0x5dd12b[_0xa266('0x27')][_0xa266('0x27')],'FaxAccountId':_0x5dd12b[_0xa266('0x42')]['id'],'FaxInteractionId':_0xcece72['id'],'direction':'in','ContactId':_0xcece72['ContactId'],'AttachmentId':_0x5dd12b[_0xa266('0x27')][_0xa266('0x4f')]});})[_0xa266('0x25')](function(_0x570a24){_0x3ff94e['message']=_0x570a24;if(_0x3ff94e['interaction']['UserId']){return db[_0xa266('0x50')][_0xa266('0x46')]({'attributes':['id','name'],'where':{'id':_0x3ff94e[_0xa266('0x51')][_0xa266('0x52')]}})['then'](function(_0x4c2dbc){if(_0x4c2dbc){_0x3ff94e[_0xa266('0x3e')]['unshift']({'id':0x0,'priority':0x0,'app':_0xa266('0x53'),'appdata':_0x4c2dbc[_0xa266('0x54')]+','+(_0x3ff94e[_0xa266('0x42')][_0xa266('0x55')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xa266('0x56'),_0xa266('0x57'),_0x3ff94e);});}return respondWithRpcPromise(_0xa266('0x56'),_0xa266('0x57'),_0x3ff94e);})[_0xa266('0x25')](function(_0x3d17c2){_0x1a292a(_0x3d17c2);})[_0xa266('0x1a')](function(_0x463565){_0x83e569(_0x505b22[_0xa266('0x16')](0x1f4,_0x463565[_0xa266('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 3b45559..2f30567 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 _0xc068=['length','faxAccount:','./faxAccount.events','save','removeListener'];(function(_0x3ea022,_0x2d5328){var _0x3b97a2=function(_0x351179){while(--_0x351179){_0x3ea022['push'](_0x3ea022['shift']());}};_0x3b97a2(++_0x2d5328);}(_0xc068,0x19c));var _0x8c06=function(_0x46b24e,_0x5d9ad7){_0x46b24e=_0x46b24e-0x0;var _0x194fed=_0xc068[_0x46b24e];return _0x194fed;};'use strict';var FaxAccountEvents=require(_0x8c06('0x0'));var events=[_0x8c06('0x1'),'remove','update'];function createListener(_0x5630d6,_0x1cb94b){return function(_0xceb8f8){_0x1cb94b['emit'](_0x5630d6,_0xceb8f8);};}function removeListener(_0x428c8a,_0xd74bf4){return function(){FaxAccountEvents[_0x8c06('0x2')](_0x428c8a,_0xd74bf4);};}exports['register']=function(_0x5104d6){for(var _0x884cdc=0x0,_0xdfdb39=events[_0x8c06('0x3')];_0x884cdc<_0xdfdb39;_0x884cdc++){var _0x168a67=events[_0x884cdc];var _0x47d140=createListener(_0x8c06('0x4')+_0x168a67,_0x5104d6);FaxAccountEvents['on'](_0x168a67,_0x47d140);}}; \ No newline at end of file +var _0x9d20=['save','emit','register','faxAccount:','./faxAccount.events'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x9d20,0x199));var _0x09d2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9d20[_0x3dd15e];return _0x231fd0;};'use strict';var FaxAccountEvents=require(_0x09d2('0x0'));var events=[_0x09d2('0x1'),'remove','update'];function createListener(_0x1cc9cd,_0x319294){return function(_0x30cee6){_0x319294[_0x09d2('0x2')](_0x1cc9cd,_0x30cee6);};}function removeListener(_0x53e295,_0x3836c0){return function(){FaxAccountEvents['removeListener'](_0x53e295,_0x3836c0);};}exports[_0x09d2('0x3')]=function(_0x3e5c56){for(var _0x556f9b=0x0,_0xc30592=events['length'];_0x556f9b<_0xc30592;_0x556f9b++){var _0xb6bf70=events[_0x556f9b];var _0xd61d3c=createListener(_0x09d2('0x4')+_0xb6bf70,_0x3e5c56);FaxAccountEvents['on'](_0xb6bf70,_0xd61d3c);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 9724942..482c1aa 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(_0x3d8597,_0x1a4f3a){var _0x2cfbcc=function(_0x16a2b7){while(--_0x16a2b7){_0x3d8597['push'](_0x3d8597['shift']());}};_0x2cfbcc(++_0x1a4f3a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/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(_0x4a914f,_0x247258){var _0x4a88fc=function(_0x3fa243){while(--_0x3fa243){_0x4a914f['push'](_0x4a914f['shift']());}};_0x4a88fc(++_0x247258);}(_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'));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 e94ea4c..44ac225 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 _0x24c5=['noop','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0xc5a279,_0x155360){var _0xc755d3=function(_0x15051c){while(--_0x15051c){_0xc5a279['push'](_0xc5a279['shift']());}};_0xc755d3(++_0x155360);}(_0x24c5,0x13a));var _0x524c=function(_0x452844,_0x3b6161){_0x452844=_0x452844-0x0;var _0x3de65e=_0x24c5[_0x452844];return _0x3de65e;};'use strict';var Sequelize=require(_0x524c('0x0'));module[_0x524c('0x1')]={'priority':{'type':Sequelize[_0x524c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x524c('0x3')],'allowNull':![],'defaultValue':_0x524c('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x524c('0x3')]},'interval':{'type':Sequelize[_0x524c('0x3')],'defaultValue':_0x524c('0x5')}}; \ No newline at end of file +var _0xb0cc=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x4a9d5c,_0x271aff){var _0x3d2c16=function(_0x3c3629){while(--_0x3c3629){_0x4a9d5c['push'](_0x4a9d5c['shift']());}};_0x3d2c16(++_0x271aff);}(_0xb0cc,0x10c));var _0xcb0c=function(_0x2c4cc1,_0x579054){_0x2c4cc1=_0x2c4cc1-0x0;var _0x13139d=_0xb0cc[_0x2c4cc1];return _0x13139d;};'use strict';var Sequelize=require(_0xcb0c('0x0'));module[_0xcb0c('0x1')]={'priority':{'type':Sequelize[_0xcb0c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xcb0c('0x3')],'allowNull':![],'defaultValue':_0xcb0c('0x4')},'appdata':{'type':Sequelize[_0xcb0c('0x5')]()},'description':{'type':Sequelize[_0xcb0c('0x3')]},'interval':{'type':Sequelize[_0xcb0c('0x3')],'defaultValue':_0xcb0c('0x6')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 4ac76b3..bc4ff2f 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 _0xacad=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','end','error','name','send','index','map','FaxApplication','type','key','query','filters','intersection','model','fields','attributes','length','order','sort','pick','filter','where','VIRTUAL','merge','include','findAll','rows','catch','keys','includeAll','options','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs'];(function(_0x3c9aa2,_0xe9b4a1){var _0x1af5b2=function(_0x3829ef){while(--_0x3829ef){_0x3c9aa2['push'](_0x3c9aa2['shift']());}};_0x1af5b2(++_0xe9b4a1);}(_0xacad,0x1a0));var _0xdaca=function(_0x36b0b5,_0x249d7a){_0x36b0b5=_0x36b0b5-0x0;var _0x4a95c3=_0xacad[_0x36b0b5];return _0x4a95c3;};'use strict';var emlformat=require(_0xdaca('0x0'));var rimraf=require(_0xdaca('0x1'));var zipdir=require(_0xdaca('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdaca('0x3'));var moment=require(_0xdaca('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdaca('0x5'));var util=require(_0xdaca('0x6'));var path=require(_0xdaca('0x7'));var sox=require('sox');var csv=require(_0xdaca('0x8'));var ejs=require(_0xdaca('0x9'));var fs=require('fs');var fs_extra=require(_0xdaca('0xa'));var _=require(_0xdaca('0xb'));var squel=require(_0xdaca('0xc'));var crypto=require(_0xdaca('0xd'));var jsforce=require(_0xdaca('0xe'));var deskjs=require(_0xdaca('0xf'));var toCsv=require(_0xdaca('0x8'));var querystring=require(_0xdaca('0x10'));var Papa=require('papaparse');var Redis=require(_0xdaca('0x11'));var authService=require(_0xdaca('0x12'));var qs=require(_0xdaca('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xdaca('0x14'));var config=require(_0xdaca('0x15'));var licenseUtil=require(_0xdaca('0x16'));var db=require(_0xdaca('0x17'))['db'];function respondWithStatusCode(_0x4addb6,_0x798a4d){_0x798a4d=_0x798a4d||0xcc;return function(_0x1daab8){if(_0x1daab8){return _0x4addb6[_0xdaca('0x18')](_0x798a4d);}return _0x4addb6[_0xdaca('0x19')](_0x798a4d)['end']();};}function respondWithResult(_0x1663c9,_0x56478a){_0x56478a=_0x56478a||0xc8;return function(_0x1273fb){if(_0x1273fb){return _0x1663c9['status'](_0x56478a)['json'](_0x1273fb);}};}function respondWithFilteredResult(_0x2835ae,_0x2ed6c4){return function(_0x561508){if(_0x561508){var _0x217f96=typeof _0x2ed6c4[_0xdaca('0x1a')]===_0xdaca('0x1b')&&typeof _0x2ed6c4[_0xdaca('0x1c')]===_0xdaca('0x1b');var _0x8dc6b9=_0x561508[_0xdaca('0x1d')];var _0x2204b1=_0x217f96?0x0:_0x2ed6c4[_0xdaca('0x1a')];var _0x5c08f3=_0x217f96?_0x561508['count']:_0x2ed6c4[_0xdaca('0x1a')]+_0x2ed6c4[_0xdaca('0x1c')];var _0x365e26;if(_0x5c08f3>=_0x8dc6b9){_0x5c08f3=_0x8dc6b9;_0x365e26=0xc8;}else{_0x365e26=0xce;}_0x2835ae[_0xdaca('0x19')](_0x365e26);return _0x2835ae['set'](_0xdaca('0x1e'),_0x2204b1+'-'+_0x5c08f3+'/'+_0x8dc6b9)[_0xdaca('0x1f')](_0x561508);}return null;};}function patchUpdates(_0x4b7b69){return function(_0xa14dbd){try{jsonpatch[_0xdaca('0x20')](_0xa14dbd,_0x4b7b69,!![]);}catch(_0x338556){return BPromise[_0xdaca('0x21')](_0x338556);}return _0xa14dbd[_0xdaca('0x22')]();};}function saveUpdates(_0x5901f6,_0x3619de){return function(_0x1700aa){if(_0x1700aa){return _0x1700aa[_0xdaca('0x23')](_0x5901f6)[_0xdaca('0x24')](function(_0x1dcdb6){return _0x1dcdb6;});}return null;};}function removeEntity(_0x3cf572,_0x1e8927){return function(_0x38b319){if(_0x38b319){return _0x38b319['destroy']()['then'](function(){_0x3cf572[_0xdaca('0x19')](0xcc)[_0xdaca('0x25')]();});}};}function handleEntityNotFound(_0x4ac867,_0x11cba0){return function(_0xd368a){if(!_0xd368a){_0x4ac867[_0xdaca('0x18')](0x194);}return _0xd368a;};}function handleError(_0x25bea8,_0x14ee3a){_0x14ee3a=_0x14ee3a||0x1f4;return function(_0x3278b4){logger[_0xdaca('0x26')](_0x3278b4['stack']);if(_0x3278b4['name']){delete _0x3278b4[_0xdaca('0x27')];}_0x25bea8[_0xdaca('0x19')](_0x14ee3a)[_0xdaca('0x28')](_0x3278b4);};}exports[_0xdaca('0x29')]=function(_0x556beb,_0x3b3556){var _0x4384f5={},_0x119e0b={},_0x503c90={'count':0x0,'rows':[]};var _0x1e5295=_[_0xdaca('0x2a')](db[_0xdaca('0x2b')]['rawAttributes'],function(_0x119acb){return{'name':_0x119acb['fieldName'],'type':_0x119acb[_0xdaca('0x2c')][_0xdaca('0x2d')]};});_0x119e0b['model']=_[_0xdaca('0x2a')](_0x1e5295,_0xdaca('0x27'));_0x119e0b[_0xdaca('0x2e')]=_['keys'](_0x556beb[_0xdaca('0x2e')]);_0x119e0b[_0xdaca('0x2f')]=_[_0xdaca('0x30')](_0x119e0b[_0xdaca('0x31')],_0x119e0b[_0xdaca('0x2e')]);_0x4384f5['attributes']=_['intersection'](_0x119e0b[_0xdaca('0x31')],qs[_0xdaca('0x32')](_0x556beb[_0xdaca('0x2e')]['fields']));_0x4384f5[_0xdaca('0x33')]=_0x4384f5[_0xdaca('0x33')][_0xdaca('0x34')]?_0x4384f5[_0xdaca('0x33')]:_0x119e0b[_0xdaca('0x31')];if(!_0x556beb[_0xdaca('0x2e')]['hasOwnProperty']('nolimit')){_0x4384f5[_0xdaca('0x1c')]=qs[_0xdaca('0x1c')](_0x556beb[_0xdaca('0x2e')][_0xdaca('0x1c')]);_0x4384f5[_0xdaca('0x1a')]=qs['offset'](_0x556beb[_0xdaca('0x2e')][_0xdaca('0x1a')]);}_0x4384f5[_0xdaca('0x35')]=qs[_0xdaca('0x36')](_0x556beb[_0xdaca('0x2e')][_0xdaca('0x36')]);_0x4384f5['where']=qs['filters'](_[_0xdaca('0x37')](_0x556beb[_0xdaca('0x2e')],_0x119e0b[_0xdaca('0x2f')]),_0x1e5295);if(_0x556beb['query'][_0xdaca('0x38')]){_0x4384f5[_0xdaca('0x39')]=_['merge'](_0x4384f5[_0xdaca('0x39')],{'$or':_[_0xdaca('0x2a')](_0x1e5295,function(_0x36ddbe){if(_0x36ddbe[_0xdaca('0x2c')]!==_0xdaca('0x3a')){var _0x169b92={};_0x169b92[_0x36ddbe[_0xdaca('0x27')]]={'$like':'%'+_0x556beb[_0xdaca('0x2e')][_0xdaca('0x38')]+'%'};return _0x169b92;}})});}_0x4384f5=_[_0xdaca('0x3b')]({},_0x4384f5,_0x556beb['options']);var _0x5ad0a4={'where':_0x4384f5[_0xdaca('0x39')]};return db[_0xdaca('0x2b')][_0xdaca('0x1d')](_0x5ad0a4)['then'](function(_0x304684){_0x503c90['count']=_0x304684;if(_0x556beb[_0xdaca('0x2e')]['includeAll']){_0x4384f5[_0xdaca('0x3c')]=[{'all':!![]}];}return db[_0xdaca('0x2b')][_0xdaca('0x3d')](_0x4384f5);})[_0xdaca('0x24')](function(_0x366687){_0x503c90[_0xdaca('0x3e')]=_0x366687;return _0x503c90;})[_0xdaca('0x24')](respondWithFilteredResult(_0x3b3556,_0x4384f5))[_0xdaca('0x3f')](handleError(_0x3b3556,null));};exports['show']=function(_0x212508,_0x443e8f){var _0x12bc35={'raw':!![],'where':{'id':_0x212508['params']['id']}},_0x3e7852={};_0x3e7852['model']=_[_0xdaca('0x40')](db['FaxApplication']['rawAttributes']);_0x3e7852['query']=_[_0xdaca('0x40')](_0x212508[_0xdaca('0x2e')]);_0x3e7852['filters']=_['intersection'](_0x3e7852[_0xdaca('0x31')],_0x3e7852[_0xdaca('0x2e')]);_0x12bc35['attributes']=_[_0xdaca('0x30')](_0x3e7852[_0xdaca('0x31')],qs['fields'](_0x212508['query'][_0xdaca('0x32')]));_0x12bc35[_0xdaca('0x33')]=_0x12bc35[_0xdaca('0x33')]['length']?_0x12bc35[_0xdaca('0x33')]:_0x3e7852[_0xdaca('0x31')];if(_0x212508[_0xdaca('0x2e')][_0xdaca('0x41')]){_0x12bc35[_0xdaca('0x3c')]=[{'all':!![]}];}_0x12bc35=_[_0xdaca('0x3b')]({},_0x12bc35,_0x212508[_0xdaca('0x42')]);return db[_0xdaca('0x2b')][_0xdaca('0x43')](_0x12bc35)[_0xdaca('0x24')](handleEntityNotFound(_0x443e8f,null))[_0xdaca('0x24')](respondWithResult(_0x443e8f,null))['catch'](handleError(_0x443e8f,null));};exports[_0xdaca('0x44')]=function(_0x5c3a28,_0x157d44){return db['FaxApplication'][_0xdaca('0x44')](_0x5c3a28[_0xdaca('0x45')],{})[_0xdaca('0x24')](respondWithResult(_0x157d44,0xc9))[_0xdaca('0x3f')](handleError(_0x157d44,null));};exports[_0xdaca('0x23')]=function(_0x4c3e2b,_0x230d1c){if(_0x4c3e2b['body']['id']){delete _0x4c3e2b[_0xdaca('0x45')]['id'];}return db[_0xdaca('0x2b')]['find']({'where':{'id':_0x4c3e2b['params']['id']}})[_0xdaca('0x24')](handleEntityNotFound(_0x230d1c,null))[_0xdaca('0x24')](saveUpdates(_0x4c3e2b[_0xdaca('0x45')],null))[_0xdaca('0x24')](respondWithResult(_0x230d1c,null))[_0xdaca('0x3f')](handleError(_0x230d1c,null));};exports[_0xdaca('0x46')]=function(_0x39f6a8,_0x3f8305){return db[_0xdaca('0x2b')][_0xdaca('0x43')]({'where':{'id':_0x39f6a8['params']['id']}})[_0xdaca('0x24')](handleEntityNotFound(_0x3f8305,null))[_0xdaca('0x24')](removeEntity(_0x3f8305,null))['catch'](handleError(_0x3f8305,null));}; \ No newline at end of file +var _0x3b3d=['bluebird','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','update','then','destroy','error','stack','name','send','index','map','FaxApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','where','filter','merge','options','include','findAll','rows','catch','includeAll','find','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x1bd7b7,_0x18e7c4){var _0x46a408=function(_0x447563){while(--_0x447563){_0x1bd7b7['push'](_0x1bd7b7['shift']());}};_0x46a408(++_0x18e7c4);}(_0x3b3d,0x85));var _0xd3b3=function(_0x28e342,_0x2652d3){_0x28e342=_0x28e342-0x0;var _0x3fd6e9=_0x3b3d[_0x28e342];return _0x3fd6e9;};'use strict';var emlformat=require(_0xd3b3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd3b3('0x1'));var jsonpatch=require(_0xd3b3('0x2'));var rp=require(_0xd3b3('0x3'));var moment=require(_0xd3b3('0x4'));var BPromise=require(_0xd3b3('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xd3b3('0x6'));var csv=require(_0xd3b3('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd3b3('0x8'));var _=require('lodash');var squel=require(_0xd3b3('0x9'));var crypto=require(_0xd3b3('0xa'));var jsforce=require(_0xd3b3('0xb'));var deskjs=require(_0xd3b3('0xc'));var toCsv=require(_0xd3b3('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd3b3('0xd'));var as=require(_0xd3b3('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd3b3('0xf'))(_0xd3b3('0x10'));var utils=require(_0xd3b3('0x11'));var config=require(_0xd3b3('0x12'));var licenseUtil=require(_0xd3b3('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26cba6,_0x130f93){_0x130f93=_0x130f93||0xcc;return function(_0x2d7db6){if(_0x2d7db6){return _0x26cba6[_0xd3b3('0x14')](_0x130f93);}return _0x26cba6[_0xd3b3('0x15')](_0x130f93)[_0xd3b3('0x16')]();};}function respondWithResult(_0x45310e,_0x415989){_0x415989=_0x415989||0xc8;return function(_0xeb0da4){if(_0xeb0da4){return _0x45310e[_0xd3b3('0x15')](_0x415989)[_0xd3b3('0x17')](_0xeb0da4);}};}function respondWithFilteredResult(_0x433c19,_0xec5982){return function(_0x2cc735){if(_0x2cc735){var _0x101546=typeof _0xec5982[_0xd3b3('0x18')]===_0xd3b3('0x19')&&typeof _0xec5982[_0xd3b3('0x1a')]===_0xd3b3('0x19');var _0x35f725=_0x2cc735[_0xd3b3('0x1b')];var _0x486937=_0x101546?0x0:_0xec5982[_0xd3b3('0x18')];var _0x4f9b0e=_0x101546?_0x2cc735[_0xd3b3('0x1b')]:_0xec5982['offset']+_0xec5982[_0xd3b3('0x1a')];var _0x1dcf65;if(_0x4f9b0e>=_0x35f725){_0x4f9b0e=_0x35f725;_0x1dcf65=0xc8;}else{_0x1dcf65=0xce;}_0x433c19['status'](_0x1dcf65);return _0x433c19[_0xd3b3('0x1c')]('Content-Range',_0x486937+'-'+_0x4f9b0e+'/'+_0x35f725)[_0xd3b3('0x17')](_0x2cc735);}return null;};}function patchUpdates(_0x5d7050){return function(_0x54609f){try{jsonpatch['apply'](_0x54609f,_0x5d7050,!![]);}catch(_0x366987){return BPromise[_0xd3b3('0x1d')](_0x366987);}return _0x54609f['save']();};}function saveUpdates(_0x1d0966,_0x3fbe43){return function(_0x4d1ff3){if(_0x4d1ff3){return _0x4d1ff3[_0xd3b3('0x1e')](_0x1d0966)[_0xd3b3('0x1f')](function(_0x5cdd30){return _0x5cdd30;});}return null;};}function removeEntity(_0x4907ab,_0x1dc858){return function(_0x4dac61){if(_0x4dac61){return _0x4dac61[_0xd3b3('0x20')]()[_0xd3b3('0x1f')](function(){_0x4907ab[_0xd3b3('0x15')](0xcc)[_0xd3b3('0x16')]();});}};}function handleEntityNotFound(_0x26d336,_0x4d20b2){return function(_0x177a32){if(!_0x177a32){_0x26d336[_0xd3b3('0x14')](0x194);}return _0x177a32;};}function handleError(_0x6d0373,_0x5663c0){_0x5663c0=_0x5663c0||0x1f4;return function(_0x50ea2b){logger[_0xd3b3('0x21')](_0x50ea2b[_0xd3b3('0x22')]);if(_0x50ea2b[_0xd3b3('0x23')]){delete _0x50ea2b[_0xd3b3('0x23')];}_0x6d0373[_0xd3b3('0x15')](_0x5663c0)[_0xd3b3('0x24')](_0x50ea2b);};}exports[_0xd3b3('0x25')]=function(_0x45b15d,_0xc57c17){var _0x38e2e6={},_0x22f2b6={},_0x3f02dc={'count':0x0,'rows':[]};var _0x4f1909=_[_0xd3b3('0x26')](db[_0xd3b3('0x27')][_0xd3b3('0x28')],function(_0x232ded){return{'name':_0x232ded[_0xd3b3('0x29')],'type':_0x232ded[_0xd3b3('0x2a')][_0xd3b3('0x2b')]};});_0x22f2b6[_0xd3b3('0x2c')]=_[_0xd3b3('0x26')](_0x4f1909,'name');_0x22f2b6[_0xd3b3('0x2d')]=_[_0xd3b3('0x2e')](_0x45b15d['query']);_0x22f2b6[_0xd3b3('0x2f')]=_[_0xd3b3('0x30')](_0x22f2b6[_0xd3b3('0x2c')],_0x22f2b6[_0xd3b3('0x2d')]);_0x38e2e6['attributes']=_[_0xd3b3('0x30')](_0x22f2b6[_0xd3b3('0x2c')],qs['fields'](_0x45b15d[_0xd3b3('0x2d')][_0xd3b3('0x31')]));_0x38e2e6[_0xd3b3('0x32')]=_0x38e2e6[_0xd3b3('0x32')][_0xd3b3('0x33')]?_0x38e2e6[_0xd3b3('0x32')]:_0x22f2b6[_0xd3b3('0x2c')];if(!_0x45b15d[_0xd3b3('0x2d')][_0xd3b3('0x34')]('nolimit')){_0x38e2e6[_0xd3b3('0x1a')]=qs[_0xd3b3('0x1a')](_0x45b15d['query']['limit']);_0x38e2e6['offset']=qs[_0xd3b3('0x18')](_0x45b15d[_0xd3b3('0x2d')][_0xd3b3('0x18')]);}_0x38e2e6[_0xd3b3('0x35')]=qs[_0xd3b3('0x36')](_0x45b15d[_0xd3b3('0x2d')]['sort']);_0x38e2e6['where']=qs[_0xd3b3('0x2f')](_[_0xd3b3('0x37')](_0x45b15d['query'],_0x22f2b6[_0xd3b3('0x2f')]),_0x4f1909);if(_0x45b15d[_0xd3b3('0x2d')]['filter']){_0x38e2e6[_0xd3b3('0x38')]=_['merge'](_0x38e2e6[_0xd3b3('0x38')],{'$or':_[_0xd3b3('0x26')](_0x4f1909,function(_0x15110b){if(_0x15110b[_0xd3b3('0x2a')]!=='VIRTUAL'){var _0x4d0301={};_0x4d0301[_0x15110b[_0xd3b3('0x23')]]={'$like':'%'+_0x45b15d['query'][_0xd3b3('0x39')]+'%'};return _0x4d0301;}})});}_0x38e2e6=_[_0xd3b3('0x3a')]({},_0x38e2e6,_0x45b15d[_0xd3b3('0x3b')]);var _0x3d3c28={'where':_0x38e2e6[_0xd3b3('0x38')]};return db[_0xd3b3('0x27')][_0xd3b3('0x1b')](_0x3d3c28)[_0xd3b3('0x1f')](function(_0x3eeb97){_0x3f02dc[_0xd3b3('0x1b')]=_0x3eeb97;if(_0x45b15d[_0xd3b3('0x2d')]['includeAll']){_0x38e2e6[_0xd3b3('0x3c')]=[{'all':!![]}];}return db[_0xd3b3('0x27')][_0xd3b3('0x3d')](_0x38e2e6);})['then'](function(_0x3da28e){_0x3f02dc[_0xd3b3('0x3e')]=_0x3da28e;return _0x3f02dc;})['then'](respondWithFilteredResult(_0xc57c17,_0x38e2e6))[_0xd3b3('0x3f')](handleError(_0xc57c17,null));};exports['show']=function(_0x485f5c,_0x4d1fdf){var _0x422b41={'raw':!![],'where':{'id':_0x485f5c['params']['id']}},_0x4e4ca6={};_0x4e4ca6[_0xd3b3('0x2c')]=_[_0xd3b3('0x2e')](db[_0xd3b3('0x27')][_0xd3b3('0x28')]);_0x4e4ca6['query']=_[_0xd3b3('0x2e')](_0x485f5c['query']);_0x4e4ca6[_0xd3b3('0x2f')]=_[_0xd3b3('0x30')](_0x4e4ca6[_0xd3b3('0x2c')],_0x4e4ca6['query']);_0x422b41[_0xd3b3('0x32')]=_[_0xd3b3('0x30')](_0x4e4ca6[_0xd3b3('0x2c')],qs[_0xd3b3('0x31')](_0x485f5c[_0xd3b3('0x2d')][_0xd3b3('0x31')]));_0x422b41[_0xd3b3('0x32')]=_0x422b41[_0xd3b3('0x32')]['length']?_0x422b41[_0xd3b3('0x32')]:_0x4e4ca6[_0xd3b3('0x2c')];if(_0x485f5c[_0xd3b3('0x2d')][_0xd3b3('0x40')]){_0x422b41['include']=[{'all':!![]}];}_0x422b41=_[_0xd3b3('0x3a')]({},_0x422b41,_0x485f5c[_0xd3b3('0x3b')]);return db[_0xd3b3('0x27')][_0xd3b3('0x41')](_0x422b41)['then'](handleEntityNotFound(_0x4d1fdf,null))[_0xd3b3('0x1f')](respondWithResult(_0x4d1fdf,null))['catch'](handleError(_0x4d1fdf,null));};exports[_0xd3b3('0x42')]=function(_0x1dda9c,_0x51755b){return db[_0xd3b3('0x27')][_0xd3b3('0x42')](_0x1dda9c[_0xd3b3('0x43')],{})[_0xd3b3('0x1f')](respondWithResult(_0x51755b,0xc9))[_0xd3b3('0x3f')](handleError(_0x51755b,null));};exports[_0xd3b3('0x1e')]=function(_0x31db5c,_0x3bb35c){if(_0x31db5c[_0xd3b3('0x43')]['id']){delete _0x31db5c[_0xd3b3('0x43')]['id'];}return db[_0xd3b3('0x27')][_0xd3b3('0x41')]({'where':{'id':_0x31db5c[_0xd3b3('0x44')]['id']}})[_0xd3b3('0x1f')](handleEntityNotFound(_0x3bb35c,null))['then'](saveUpdates(_0x31db5c[_0xd3b3('0x43')],null))[_0xd3b3('0x1f')](respondWithResult(_0x3bb35c,null))[_0xd3b3('0x3f')](handleError(_0x3bb35c,null));};exports[_0xd3b3('0x20')]=function(_0x24a304,_0x5342e0){return db[_0xd3b3('0x27')][_0xd3b3('0x41')]({'where':{'id':_0x24a304[_0xd3b3('0x44')]['id']}})[_0xd3b3('0x1f')](handleEntityNotFound(_0x5342e0,null))['then'](removeEntity(_0x5342e0,null))['catch'](handleError(_0x5342e0,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 4c0c004..9d39583 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 _0x5ab5=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x4448e4,_0x3a71e9){var _0x5d5d2c=function(_0xe9eb10){while(--_0xe9eb10){_0x4448e4['push'](_0x4448e4['shift']());}};_0x5d5d2c(++_0x3a71e9);}(_0x5ab5,0x10d));var _0x55ab=function(_0x14c772,_0x1ade3b){_0x14c772=_0x14c772-0x0;var _0x4574f7=_0x5ab5[_0x14c772];return _0x4574f7;};'use strict';var _=require(_0x55ab('0x0'));var util=require(_0x55ab('0x1'));var logger=require(_0x55ab('0x2'))(_0x55ab('0x3'));var moment=require(_0x55ab('0x4'));var BPromise=require(_0x55ab('0x5'));var rp=require(_0x55ab('0x6'));var fs=require('fs');var path=require(_0x55ab('0x7'));var rimraf=require(_0x55ab('0x8'));var config=require(_0x55ab('0x9'));var attributes=require(_0x55ab('0xa'));module[_0x55ab('0xb')]=function(_0x3916f9,_0x47bfd5){return _0x3916f9[_0x55ab('0xc')](_0x55ab('0xd'),attributes,{'tableName':_0x55ab('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x55ab('0xf'),'collate':_0x55ab('0x10')});}; \ No newline at end of file +var _0x5b45=['bluebird','request-promise','rimraf','../../config/environment','./faxApplication.attributes','exports','define','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment'];(function(_0x52704,_0x86eb21){var _0x11402f=function(_0x40dd7d){while(--_0x40dd7d){_0x52704['push'](_0x52704['shift']());}};_0x11402f(++_0x86eb21);}(_0x5b45,0xdc));var _0x55b4=function(_0x438685,_0x4ec0c0){_0x438685=_0x438685-0x0;var _0x41cca2=_0x5b45[_0x438685];return _0x41cca2;};'use strict';var _=require(_0x55b4('0x0'));var util=require(_0x55b4('0x1'));var logger=require('../../config/logger')(_0x55b4('0x2'));var moment=require(_0x55b4('0x3'));var BPromise=require(_0x55b4('0x4'));var rp=require(_0x55b4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x55b4('0x6'));var config=require(_0x55b4('0x7'));var attributes=require(_0x55b4('0x8'));module[_0x55b4('0x9')]=function(_0x393ea8,_0x414961){return _0x393ea8[_0x55b4('0xa')]('FaxApplication',attributes,{'tableName':_0x55b4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x55b4('0xc'),'collate':_0x55b4('0xd')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index cd2b571..6264c37 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 _0x7f47=['UpdateFaxApplication','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','error','message','catch','FaxApplication','update','body','options','raw','where','attributes','limit','then'];(function(_0x250695,_0x3ec226){var _0x3b5eb9=function(_0xd3bc60){while(--_0xd3bc60){_0x250695['push'](_0x250695['shift']());}};_0x3b5eb9(++_0x3ec226);}(_0x7f47,0xfa));var _0x77f4=function(_0x5e848d,_0x1dbd20){_0x5e848d=_0x5e848d-0x0;var _0x3785e5=_0x7f47[_0x5e848d];return _0x3785e5;};'use strict';var _=require('lodash');var util=require(_0x77f4('0x0'));var moment=require(_0x77f4('0x1'));var BPromise=require(_0x77f4('0x2'));var rs=require(_0x77f4('0x3'));var fs=require('fs');var Redis=require(_0x77f4('0x4'));var db=require(_0x77f4('0x5'))['db'];var utils=require(_0x77f4('0x6'));var logger=require('../../config/logger')(_0x77f4('0x7'));var config=require(_0x77f4('0x8'));var jayson=require(_0x77f4('0x9'));var client=jayson[_0x77f4('0xa')][_0x77f4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x302ab2,_0x43369a,_0x5dbb9e){return new BPromise(function(_0x48c995,_0x5b5807){return client['request'](_0x302ab2,_0x5dbb9e)['then'](function(_0x44d057){logger[_0x77f4('0xc')](_0x77f4('0xd'),_0x43369a,_0x77f4('0xe'));logger[_0x77f4('0xf')](_0x77f4('0x10'),_0x43369a,_0x77f4('0xe'),JSON['stringify'](_0x44d057));if(_0x44d057[_0x77f4('0x11')]){if(_0x44d057['error']['code']===0x1f4){logger[_0x77f4('0x11')]('FaxApplication,\x20%s,\x20%s',_0x43369a,_0x44d057[_0x77f4('0x11')][_0x77f4('0x12')]);return _0x5b5807(_0x44d057[_0x77f4('0x11')][_0x77f4('0x12')]);}logger[_0x77f4('0x11')](_0x77f4('0xd'),_0x43369a,_0x44d057[_0x77f4('0x11')][_0x77f4('0x12')]);return _0x48c995(_0x44d057[_0x77f4('0x11')][_0x77f4('0x12')]);}else{logger[_0x77f4('0xc')](_0x77f4('0xd'),_0x43369a,_0x77f4('0xe'));_0x48c995(_0x44d057['result']['message']);}})[_0x77f4('0x13')](function(_0x5e8c65){logger[_0x77f4('0x11')](_0x77f4('0xd'),_0x43369a,_0x5e8c65);_0x5b5807(_0x5e8c65);});});}exports['UpdateFaxApplication']=function(_0x31fff4){var _0x513d66=this;return new Promise(function(_0x44d489,_0x47b78a){return db[_0x77f4('0x14')][_0x77f4('0x15')](_0x31fff4[_0x77f4('0x16')],{'raw':_0x31fff4[_0x77f4('0x17')]?_0x31fff4[_0x77f4('0x17')][_0x77f4('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31fff4[_0x77f4('0x17')]?_0x31fff4[_0x77f4('0x17')][_0x77f4('0x19')]||null:null,'attributes':_0x31fff4[_0x77f4('0x17')]?_0x31fff4[_0x77f4('0x17')][_0x77f4('0x1a')]||null:null,'limit':_0x31fff4['options']?_0x31fff4[_0x77f4('0x17')][_0x77f4('0x1b')]||null:null})[_0x77f4('0x1c')](function(_0x2fde82){logger[_0x77f4('0xc')](_0x77f4('0x1d'),_0x31fff4);logger[_0x77f4('0xf')](_0x77f4('0x1d'),_0x31fff4,JSON[_0x77f4('0x1e')](_0x2fde82));_0x44d489(_0x2fde82);})['catch'](function(_0x16a7ce){logger[_0x77f4('0x11')](_0x77f4('0x1d'),_0x16a7ce[_0x77f4('0x12')],_0x31fff4);_0x47b78a(_0x513d66[_0x77f4('0x11')](0x1f4,_0x16a7ce[_0x77f4('0x12')]));});});}; \ No newline at end of file +var _0xe2c9=['catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','attributes','limit','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxApplication,\x20%s,\x20%s','message','result'];(function(_0x3dc524,_0x1c7ad9){var _0x4fde32=function(_0x4235b6){while(--_0x4235b6){_0x3dc524['push'](_0x3dc524['shift']());}};_0x4fde32(++_0x1c7ad9);}(_0xe2c9,0x6a));var _0x9e2c=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xe2c9[_0x387777];return _0x3f84c0;};'use strict';var _=require(_0x9e2c('0x0'));var util=require(_0x9e2c('0x1'));var moment=require(_0x9e2c('0x2'));var BPromise=require(_0x9e2c('0x3'));var rs=require(_0x9e2c('0x4'));var fs=require('fs');var Redis=require(_0x9e2c('0x5'));var db=require(_0x9e2c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9e2c('0x7'))(_0x9e2c('0x8'));var config=require('../../config/environment');var jayson=require(_0x9e2c('0x9'));var client=jayson[_0x9e2c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57f8de,_0x189fcc,_0x31055e){return new BPromise(function(_0x1ea8bd,_0x2dbd87){return client[_0x9e2c('0xb')](_0x57f8de,_0x31055e)[_0x9e2c('0xc')](function(_0x31ebe7){logger[_0x9e2c('0xd')]('FaxApplication,\x20%s,\x20%s',_0x189fcc,_0x9e2c('0xe'));logger['debug'](_0x9e2c('0xf'),_0x189fcc,_0x9e2c('0xe'),JSON[_0x9e2c('0x10')](_0x31ebe7));if(_0x31ebe7[_0x9e2c('0x11')]){if(_0x31ebe7['error'][_0x9e2c('0x12')]===0x1f4){logger[_0x9e2c('0x11')](_0x9e2c('0x13'),_0x189fcc,_0x31ebe7[_0x9e2c('0x11')][_0x9e2c('0x14')]);return _0x2dbd87(_0x31ebe7[_0x9e2c('0x11')]['message']);}logger['error'](_0x9e2c('0x13'),_0x189fcc,_0x31ebe7[_0x9e2c('0x11')][_0x9e2c('0x14')]);return _0x1ea8bd(_0x31ebe7[_0x9e2c('0x11')][_0x9e2c('0x14')]);}else{logger['info'](_0x9e2c('0x13'),_0x189fcc,_0x9e2c('0xe'));_0x1ea8bd(_0x31ebe7[_0x9e2c('0x15')]['message']);}})[_0x9e2c('0x16')](function(_0x6d5366){logger['error']('FaxApplication,\x20%s,\x20%s',_0x189fcc,_0x6d5366);_0x2dbd87(_0x6d5366);});});}exports[_0x9e2c('0x17')]=function(_0x5a53d7){var _0xd95005=this;return new Promise(function(_0x3e3cfe,_0x54ad98){return db[_0x9e2c('0x18')][_0x9e2c('0x19')](_0x5a53d7[_0x9e2c('0x1a')],{'raw':_0x5a53d7[_0x9e2c('0x1b')]?_0x5a53d7[_0x9e2c('0x1b')][_0x9e2c('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a53d7['options']?_0x5a53d7[_0x9e2c('0x1b')]['where']||null:null,'attributes':_0x5a53d7[_0x9e2c('0x1b')]?_0x5a53d7[_0x9e2c('0x1b')][_0x9e2c('0x1d')]||null:null,'limit':_0x5a53d7[_0x9e2c('0x1b')]?_0x5a53d7[_0x9e2c('0x1b')][_0x9e2c('0x1e')]||null:null})[_0x9e2c('0xc')](function(_0x11e03c){logger['info'](_0x9e2c('0x17'),_0x5a53d7);logger[_0x9e2c('0x1f')](_0x9e2c('0x17'),_0x5a53d7,JSON[_0x9e2c('0x10')](_0x11e03c));_0x3e3cfe(_0x11e03c);})[_0x9e2c('0x16')](function(_0x357248){logger[_0x9e2c('0x11')](_0x9e2c('0x17'),_0x357248[_0x9e2c('0x14')],_0x5a53d7);_0x54ad98(_0xd95005[_0x9e2c('0x11')](0x1f4,_0x357248[_0x9e2c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 41081a3..04da91d 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 _0x80ed=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer'];(function(_0x571a17,_0x63fb3d){var _0x3ef337=function(_0x12096b){while(--_0x12096b){_0x571a17['push'](_0x571a17['shift']());}};_0x3ef337(++_0x63fb3d);}(_0x80ed,0x11c));var _0xd80e=function(_0x5f4a50,_0x41197d){_0x5f4a50=_0x5f4a50-0x0;var _0x2d1b9e=_0x80ed[_0x5f4a50];return _0x2d1b9e;};'use strict';var multer=require(_0xd80e('0x0'));var util=require('util');var path=require(_0xd80e('0x1'));var timeout=require(_0xd80e('0x2'));var express=require(_0xd80e('0x3'));var router=express['Router']();var fs_extra=require(_0xd80e('0x4'));var auth=require(_0xd80e('0x5'));var interaction=require(_0xd80e('0x6'));var config=require(_0xd80e('0x7'));var controller=require('./faxApplication.controller');router[_0xd80e('0x8')]('/',auth[_0xd80e('0x9')](),controller[_0xd80e('0xa')]);router['get'](_0xd80e('0xb'),auth[_0xd80e('0x9')](),controller[_0xd80e('0xc')]);router[_0xd80e('0xd')]('/',auth[_0xd80e('0x9')](),controller[_0xd80e('0xe')]);router[_0xd80e('0xf')](_0xd80e('0xb'),auth[_0xd80e('0x9')](),controller[_0xd80e('0x10')]);router['delete'](_0xd80e('0xb'),auth[_0xd80e('0x9')](),controller[_0xd80e('0x11')]);module[_0xd80e('0x12')]=router; \ No newline at end of file +var _0x2032=['exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete'];(function(_0x5b6576,_0x99240d){var _0x5dbcaf=function(_0x19eb3a){while(--_0x19eb3a){_0x5b6576['push'](_0x5b6576['shift']());}};_0x5dbcaf(++_0x99240d);}(_0x2032,0xd9));var _0x2203=function(_0x58e98a,_0x3eccf1){_0x58e98a=_0x58e98a-0x0;var _0x1c1cd8=_0x2032[_0x58e98a];return _0x1c1cd8;};'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/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index a9a5cda..e6a65ba 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 _0x550e=['out','DATE','STRING','ENUM'];(function(_0x199ae2,_0x345c6b){var _0x8dce97=function(_0x551f57){while(--_0x551f57){_0x199ae2['push'](_0x199ae2['shift']());}};_0x8dce97(++_0x345c6b);}(_0x550e,0x149));var _0xe550=function(_0x55c9e7,_0x4939e7){_0x55c9e7=_0x55c9e7-0x0;var _0x56c1a4=_0x550e[_0x55c9e7];return _0x56c1a4;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xe550('0x0')]},'disposition':{'type':Sequelize[_0xe550('0x1')]},'secondDisposition':{'type':Sequelize[_0xe550('0x1')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xe550('0x1')]},'read1stAt':{'type':Sequelize[_0xe550('0x0')]},'fax':{'type':Sequelize[_0xe550('0x1')]},'firstMsgDirection':{'type':Sequelize[_0xe550('0x2')]('in',_0xe550('0x3')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x5ad9=['STRING','ENUM','out','sequelize','BOOLEAN','DATE'];(function(_0xfd14ff,_0x46eb8c){var _0x4a2860=function(_0x1728da){while(--_0x1728da){_0xfd14ff['push'](_0xfd14ff['shift']());}};_0x4a2860(++_0x46eb8c);}(_0x5ad9,0xb1));var _0x95ad=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5ad9[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x95ad('0x0'));module['exports']={'closed':{'type':Sequelize[_0x95ad('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x95ad('0x2')]},'disposition':{'type':Sequelize[_0x95ad('0x3')]},'secondDisposition':{'type':Sequelize[_0x95ad('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x95ad('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0x95ad('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x95ad('0x4')]('in',_0x95ad('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x95ad('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x95ad('0x4')]('in',_0x95ad('0x5')),'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 8140423..3dea851 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 _0xaf82=['select','field','color','from','u.id','ui.FaxInteractionId','user_has_fax_interactions','users','u.id\x20=\x20ui.UserId','fax_interactions','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','value','`\x20=\x200','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','text','start','Tag','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','compact','FaxAccountId','where','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\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?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','unreadMessages','isEmpty','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','contactName','i.*','c.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','c.mobile','Contact.mobile','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','show','include','options','create','body','params','destroy','describe','addMessage','ids','getMessages','findOne','$gte','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','findAll','addTags','setTags','omit','spread','emit','faxInteractionTags:save','removeTags','download','join','root','server','files','tmp','attachments','format','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','basename','existsSync','createReadStream','pipe','log','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','end','sendStatus','name','map','fullname','TagIds','Tags','split','forEach','push','catch','waiting','talking','answered','unmanaged','total','closed','UserId','index','FaxInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','pick'];(function(_0x2adc1f,_0x23aec6){var _0x193b40=function(_0x406c8d){while(--_0x406c8d){_0x2adc1f['push'](_0x2adc1f['shift']());}};_0x193b40(++_0x23aec6);}(_0xaf82,0x91));var _0x2af8=function(_0x5daeb5,_0x43861a){_0x5daeb5=_0x5daeb5-0x0;var _0x549018=_0xaf82[_0x5daeb5];return _0x549018;};'use strict';var emlformat=require(_0x2af8('0x0'));var rimraf=require(_0x2af8('0x1'));var zipdir=require(_0x2af8('0x2'));var jsonpatch=require(_0x2af8('0x3'));var rp=require(_0x2af8('0x4'));var moment=require(_0x2af8('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2af8('0x6'));var util=require(_0x2af8('0x7'));var path=require('path');var sox=require(_0x2af8('0x8'));var csv=require(_0x2af8('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2af8('0xa'));var squel=require(_0x2af8('0xb'));var crypto=require(_0x2af8('0xc'));var jsforce=require(_0x2af8('0xd'));var deskjs=require(_0x2af8('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2af8('0xf'));var Redis=require('ioredis');var authService=require(_0x2af8('0x10'));var qs=require(_0x2af8('0x11'));var as=require(_0x2af8('0x12'));var hardwareService=require(_0x2af8('0x13'));var logger=require(_0x2af8('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x2af8('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x2af8('0x16')]=_[_0x2af8('0x17')](config['redis'],{'host':_0x2af8('0x18'),'port':0x18eb});var socket=require(_0x2af8('0x19'))(new Redis(config[_0x2af8('0x16')]));require(_0x2af8('0x1a'))['register'](socket);function respondWithStatusCode(_0x344d14,_0xfefbf0){_0xfefbf0=_0xfefbf0||0xcc;return function(_0x3a60cc){if(_0x3a60cc){return _0x344d14['sendStatus'](_0xfefbf0);}return _0x344d14[_0x2af8('0x1b')](_0xfefbf0)['end']();};}function respondWithResult(_0x321cc,_0xef83b1){_0xef83b1=_0xef83b1||0xc8;return function(_0x4678e3){if(_0x4678e3){return _0x321cc[_0x2af8('0x1b')](_0xef83b1)['json'](_0x4678e3);}};}function respondWithFilteredResult(_0x5e9183,_0x5d979f){return function(_0x56ae4b){if(_0x56ae4b){var _0x8f507a=typeof _0x5d979f[_0x2af8('0x1c')]===_0x2af8('0x1d')&&typeof _0x5d979f[_0x2af8('0x1e')]===_0x2af8('0x1d');var _0x439179=_0x56ae4b[_0x2af8('0x1f')];var _0x2b4494=_0x8f507a?0x0:_0x5d979f[_0x2af8('0x1c')];var _0x395d2e=_0x8f507a?_0x56ae4b[_0x2af8('0x1f')]:_0x5d979f[_0x2af8('0x1c')]+_0x5d979f['limit'];var _0x366e50;if(_0x395d2e>=_0x439179){_0x395d2e=_0x439179;_0x366e50=0xc8;}else{_0x366e50=0xce;}_0x5e9183[_0x2af8('0x1b')](_0x366e50);return _0x5e9183['set'](_0x2af8('0x20'),_0x2b4494+'-'+_0x395d2e+'/'+_0x439179)[_0x2af8('0x21')](_0x56ae4b);}return null;};}function patchUpdates(_0x9311f0){return function(_0x357890){try{jsonpatch[_0x2af8('0x22')](_0x357890,_0x9311f0,!![]);}catch(_0xbb80ef){return BPromise[_0x2af8('0x23')](_0xbb80ef);}return _0x357890[_0x2af8('0x24')]();};}function saveUpdates(_0x56298f,_0x4fddba){return function(_0x3fcbfd){if(_0x3fcbfd){return _0x3fcbfd[_0x2af8('0x25')](_0x56298f)[_0x2af8('0x26')](function(_0x40fec1){return _0x40fec1;});}return null;};}function removeEntity(_0x49701d,_0x72cb91){return function(_0x19797a){if(_0x19797a){return _0x19797a['destroy']()[_0x2af8('0x26')](function(){_0x49701d[_0x2af8('0x1b')](0xcc)[_0x2af8('0x27')]();});}};}function handleEntityNotFound(_0x560634,_0x1ff7af){return function(_0x4ebfc9){if(!_0x4ebfc9){_0x560634[_0x2af8('0x28')](0x194);}return _0x4ebfc9;};}function handleError(_0x1d94ce,_0x246da7){_0x246da7=_0x246da7||0x1f4;return function(_0x565122){logger['error'](_0x565122['stack']);if(_0x565122[_0x2af8('0x29')]){delete _0x565122[_0x2af8('0x29')];}_0x1d94ce['status'](_0x246da7)['send'](_0x565122);};}function getInteractionUsers(_0xa22cd3,_0x3ee760){return new BPromise(function(_0x2c3089,_0x1c1d31){try{if(_0x3ee760[_0xa22cd3['id']]){_0xa22cd3['Users']=_[_0x2af8('0x2a')](_0x3ee760[_0xa22cd3['id']],function(_0x22cab4){return{'id':_0x22cab4['id'],'fullname':_0x22cab4[_0x2af8('0x2b')]};});}}catch(_0x12dedc){_0x1c1d31(_0x12dedc);}_0x2c3089(_0xa22cd3);});}function getInteractionTags(_0x420c60,_0x126ecd){return new BPromise(function(_0x523b2d,_0x1f3ec9){try{if(_0x420c60[_0x2af8('0x2c')]){_0x420c60[_0x2af8('0x2d')]=[];_0x420c60[_0x2af8('0x2c')][_0x2af8('0x2e')](',')[_0x2af8('0x2f')](function(_0x5087cb){_0x420c60[_0x2af8('0x2d')][_0x2af8('0x30')](_0x126ecd[_0x5087cb]);});}delete _0x420c60[_0x2af8('0x2c')];}catch(_0x4e5ecd){_0x1f3ec9(_0x4e5ecd);}_0x523b2d(_0x420c60);});}function updateFaxInteraction(_0x1425a0,_0x5248a5,_0x58119c){return new BPromise(function(_0x1b85a7,_0x473684){return getInteractionUsers(_0x1425a0,_0x58119c)[_0x2af8('0x26')](function(_0xfbf8c5){return getInteractionTags(_0xfbf8c5,_0x5248a5);})[_0x2af8('0x26')](function(_0x57a8ed){return getStateInteraction(_0x57a8ed);})[_0x2af8('0x26')](function(_0xdd87a4){_0x1b85a7(_0xdd87a4);})[_0x2af8('0x31')](function(_0x553fab){_0x473684(_0x553fab);});});}function getStateInteraction(_0x1620aa){return new BPromise(function(_0x25748e){_0x1620aa[_0x2af8('0x32')]=0x0;_0x1620aa[_0x2af8('0x33')]=0x0;_0x1620aa[_0x2af8('0x34')]=0x0;_0x1620aa[_0x2af8('0x35')]=0x0;_0x1620aa[_0x2af8('0x36')]=0x0;if(!_0x1620aa[_0x2af8('0x37')]&&!_0x1620aa[_0x2af8('0x38')]){_0x1620aa[_0x2af8('0x32')]+=0x1;}if(!_0x1620aa['closed']&&_0x1620aa[_0x2af8('0x38')]){_0x1620aa[_0x2af8('0x33')]+=0x1;if(_0x1620aa['waiting']){_0x1620aa[_0x2af8('0x32')]-=0x1;}}if(_0x1620aa[_0x2af8('0x37')]&&_0x1620aa[_0x2af8('0x38')]){_0x1620aa[_0x2af8('0x34')]+=0x1;if(_0x1620aa[_0x2af8('0x33')]){_0x1620aa[_0x2af8('0x33')]-=0x1;}}if(_0x1620aa[_0x2af8('0x37')]&&!_0x1620aa['UserId']){_0x1620aa[_0x2af8('0x35')]+=0x1;if(_0x1620aa[_0x2af8('0x32')]){_0x1620aa[_0x2af8('0x32')]-=0x1;}}_0x1620aa[_0x2af8('0x36')]+=0x1;_0x25748e(_0x1620aa);});}exports[_0x2af8('0x39')]=function(_0x1e3fce,_0x589b3f){var _0x2f912b={},_0x4ee87c={},_0x34fd2e={'count':0x0,'rows':[]};var _0x321851=_[_0x2af8('0x2a')](db[_0x2af8('0x3a')][_0x2af8('0x3b')],function(_0x368c28){return{'name':_0x368c28[_0x2af8('0x3c')],'type':_0x368c28[_0x2af8('0x3d')][_0x2af8('0x3e')]};});_0x4ee87c[_0x2af8('0x3f')]=_[_0x2af8('0x2a')](_0x321851,_0x2af8('0x29'));_0x4ee87c[_0x2af8('0x40')]=_[_0x2af8('0x41')](_0x1e3fce['query']);_0x4ee87c[_0x2af8('0x42')]=_['intersection'](_0x4ee87c[_0x2af8('0x3f')],_0x4ee87c[_0x2af8('0x40')]);_0x2f912b[_0x2af8('0x43')]=_[_0x2af8('0x44')](_0x4ee87c[_0x2af8('0x3f')],qs[_0x2af8('0x45')](_0x1e3fce['query'][_0x2af8('0x45')]));_0x2f912b['attributes']=_0x2f912b[_0x2af8('0x43')][_0x2af8('0x46')]?_0x2f912b[_0x2af8('0x43')]:_0x4ee87c[_0x2af8('0x3f')];if(!_0x1e3fce[_0x2af8('0x40')]['hasOwnProperty'](_0x2af8('0x47'))){_0x2f912b[_0x2af8('0x1e')]=qs['limit'](_0x1e3fce[_0x2af8('0x40')][_0x2af8('0x1e')]);_0x2f912b[_0x2af8('0x1c')]=qs[_0x2af8('0x1c')](_0x1e3fce[_0x2af8('0x40')]['offset']);}_0x2f912b[_0x2af8('0x48')]=qs[_0x2af8('0x49')](_0x1e3fce['query'][_0x2af8('0x49')]);_0x2f912b['where']=qs['filters'](_[_0x2af8('0x4a')](_0x1e3fce['query'],_0x4ee87c[_0x2af8('0x42')]),_0x321851);var _0xb8094b=[];var _0x5badd3=squel[_0x2af8('0x4b')]()[_0x2af8('0x4c')]('id')[_0x2af8('0x4c')](_0x2af8('0x29'))[_0x2af8('0x4c')](_0x2af8('0x4d'))[_0x2af8('0x4e')]('tools_tags');var _0x589482=squel[_0x2af8('0x4b')]()['field'](_0x2af8('0x4f'))[_0x2af8('0x4c')]('u.fullname')[_0x2af8('0x4c')](_0x2af8('0x50'))['from'](_0x2af8('0x51'),'ui')['left_join'](_0x2af8('0x52'),'u',_0x2af8('0x53'));var _0x3dccf4=squel['select']()[_0x2af8('0x4e')](_0x2af8('0x54'),'i')[_0x2af8('0x55')]('cm_contacts','c',_0x2af8('0x56'))[_0x2af8('0x55')]('users','o',_0x2af8('0x57'))['left_join'](_0x2af8('0x58'),'a',_0x2af8('0x59'))['left_join'](_0x2af8('0x5a'),'me',_0x2af8('0x5b'))[_0x2af8('0x55')](_0x2af8('0x5c'),'it','it.FaxInteractionId\x20=\x20i.id')[_0x2af8('0x55')](_0x2af8('0x5d'),'t',_0x2af8('0x5e'));var _0xd12c46=squel['expr']();var _0x887045=[];var _0x1f4e9c=squel[_0x2af8('0x5f')]();var _0x1459b3;if(_0x1e3fce[_0x2af8('0x40')][_0x2af8('0x60')]){_0x1459b3=as[_0x2af8('0x61')](_0x1e3fce[_0x2af8('0x40')][_0x2af8('0x60')]);var _0x5dc94f=_0x1459b3[_0x2af8('0x62')];for(var _0x15e7bf=0x0;_0x15e7bf<_0x1459b3[_0x2af8('0x63')][_0x2af8('0x46')];_0x15e7bf++){var _0x375d78=_0x1459b3['conditions'][_0x15e7bf];var _0x252de6='i';var _0x2c85f2=_[_0x2af8('0x64')](_0x321851,[_0x2af8('0x29'),_0x375d78[_0x2af8('0x4c')]]);if(!_0x2c85f2){switch(_0x375d78[_0x2af8('0x4c')]){case'unreadMessages':if(_0x375d78[_0x2af8('0x65')]==0x1){_0x3dccf4['having']('`'+_0x375d78[_0x2af8('0x4c')]+_0x2af8('0x66'));}else{_0x3dccf4[_0x2af8('0x67')]('`'+_0x375d78[_0x2af8('0x4c')]+_0x2af8('0x68'));}break;case _0x2af8('0x69'):if(_0x375d78[_0x2af8('0x6a')]===_0x2af8('0x6b')){if(_0x375d78[_0x2af8('0x65')][_0x2af8('0x2e')]('\x20')['length']>0x1){_0xd12c46[_0x5dc94f](_0x2af8('0x6c'),qs[_0x2af8('0x6d')](_0x375d78[_0x2af8('0x65')]),null);}else{var _0x3fea70='%'+_0x375d78[_0x2af8('0x65')]+'%';_0xd12c46[_0x5dc94f](_0x2af8('0x6e'),_0x3fea70,_0x3fea70,_0x3fea70);}}else{_0x2c85f2=_['find'](_0x321851,['name',_0x2af8('0x6f')]);_0x375d78[_0x2af8('0x4c')]=_0x2af8('0x6f');_0x1b038f=as[_0x2af8('0x70')](_0x252de6,_0x2c85f2['type'],_0x375d78);_0xd12c46[_0x5dc94f](_0x1b038f[_0x2af8('0x71')],_0x1b038f[_0x2af8('0x65')][_0x2af8('0x72')],_0x1b038f[_0x2af8('0x65')][_0x2af8('0x27')]);}break;case _0x2af8('0x73'):var _0xd78153=_0x375d78[_0x2af8('0x65')][_0x2af8('0x2e')](',')[_0x2af8('0x2a')](function(_0x4d006e){return Number(_0x4d006e);});_0xd78153[_0x2af8('0x2f')](function(_0x3eda0a){_0x1f4e9c['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3eda0a+',%');});_0x887045=_['union'](_0x887045,_0xd78153);break;case'User':if(_0x375d78[_0x2af8('0x6a')]==='$substring'){_0xd12c46[_0x5dc94f](_0x2af8('0x74'),'%'+_0x375d78[_0x2af8('0x65')]+'%',null);}else{_0x2c85f2=_[_0x2af8('0x64')](_0x321851,[_0x2af8('0x29'),'UserId']);_0x375d78[_0x2af8('0x4c')]='UserId';_0x1b038f=as[_0x2af8('0x70')](_0x252de6,_0x2c85f2[_0x2af8('0x3d')],_0x375d78);_0xd12c46[_0x5dc94f](_0x1b038f['text'],_0x1b038f[_0x2af8('0x65')][_0x2af8('0x72')],_0x1b038f[_0x2af8('0x65')][_0x2af8('0x27')]);}break;case'body':_0x1b038f=as['buildExpression']('me',null,_0x375d78);_0xd12c46[_0x5dc94f](_0x1b038f[_0x2af8('0x71')],_0x1b038f[_0x2af8('0x65')]['start'],_0x1b038f[_0x2af8('0x65')][_0x2af8('0x27')]);break;}}else{var _0x1b038f=as[_0x2af8('0x70')](_0x252de6,_0x2c85f2[_0x2af8('0x3d')],_0x375d78);_0xd12c46[_0x5dc94f](_0x1b038f[_0x2af8('0x71')],_0x1b038f['value'][_0x2af8('0x72')],_0x1b038f[_0x2af8('0x65')][_0x2af8('0x27')]);}}}else{var _0x235567=_(_0x1e3fce[_0x2af8('0x40')])[_0x2af8('0x41')]()['map'](function(_0xdd126c){return _['some'](_0x321851,['name',_0xdd126c])?_0xdd126c:undefined;})[_0x2af8('0x75')]()['value']();if(!_['isEmpty'](_0x235567)){_0x235567[_0x2af8('0x2f')](function(_0x258e01){if(_0x258e01===_0x2af8('0x76')){_0x3dccf4[_0x2af8('0x77')](_0x2af8('0x78'),[][_0x2af8('0x79')](_0x1e3fce[_0x2af8('0x40')][_0x258e01]));}else if(_0x258e01===_0x2af8('0x7a')){var _0xa7895b=JSON['parse'](_0x1e3fce['query'][_0x258e01])['$gte'];var _0x36e6fb=JSON[_0x2af8('0x7b')](_0x1e3fce['query'][_0x258e01])[_0x2af8('0x7c')];_0x3dccf4[_0x2af8('0x77')](_0x2af8('0x7d'),_0xa7895b,_0x36e6fb);}else{if(_0x1e3fce['query'][_0x258e01]===_0x2af8('0x7e')){_0x3dccf4[_0x2af8('0x77')]('i.'+_0x258e01+'\x20IS\x20NULL');}else{_0x3dccf4['where']('i.'+_0x258e01+_0x2af8('0x7f'),_0x1e3fce[_0x2af8('0x40')][_0x258e01]);}}});}if(_0x1e3fce[_0x2af8('0x40')][_0x2af8('0x80')]){if(_0x1e3fce[_0x2af8('0x40')][_0x2af8('0x80')]==0x1){_0x3dccf4['having'](_0x2af8('0x81'));}else{_0x3dccf4[_0x2af8('0x67')](_0x2af8('0x82'));}}if(_0x1e3fce[_0x2af8('0x40')][_0x2af8('0x83')]){_0x887045=_[_0x2af8('0x84')](_0x1e3fce['query'][_0x2af8('0x83')])?_0x1e3fce[_0x2af8('0x40')]['tag']:new Array(_0x1e3fce[_0x2af8('0x40')][_0x2af8('0x83')]);_0x887045[_0x2af8('0x2f')](function(_0x3126be){_0x1f4e9c['or'](_0x2af8('0x85'),'%,'+_0x3126be+',%');});}if(_0x1e3fce[_0x2af8('0x40')][_0x2af8('0x86')]){var _0x3f3f5b=_0x1e3fce[_0x2af8('0x40')][_0x2af8('0x86')][_0x2af8('0x87')]('\x5c','\x5c\x5c')[_0x2af8('0x87')](/'/g,'\x27\x27');if(qs[_0x2af8('0x88')](_0x3f3f5b)){_0xd12c46['or'](_0x2af8('0x89'),_0x3f3f5b+'%')['or']('i.fax\x20LIKE\x20?',_0x3f3f5b+'%');}_0xd12c46['or'](_0x2af8('0x8a'),_0x3f3f5b+'%');}}_0x3dccf4[_0x2af8('0x77')](_0xd12c46);_0x3dccf4[_0x2af8('0x8b')](_0x2af8('0x8c'));var _0x46f6bc={'type':db[_0x2af8('0x8d')]['QueryTypes'][_0x2af8('0x8e')],'raw':!![]};var _0x2f2108=_0x3dccf4[_0x2af8('0x8f')]();_0x2f2108[_0x2af8('0x4c')](_0x2af8('0x8c'));_0x2f2108['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x2af8('0x90'));if(_0x2f912b[_0x2af8('0x48')]){_0x2f912b[_0x2af8('0x48')][_0x2af8('0x2f')](function(_0x458455){var _0x127801=_0x458455[0x0]==='contactName'?_0x458455[0x0]:'i.'+_0x458455[0x0];_0x3dccf4[_0x2af8('0x48')](_0x127801,_0x458455[0x1]==='DESC'?![]:!![]);});}if(!_[_0x2af8('0x91')](_0x887045)){_0x3dccf4[_0x2af8('0x67')](_0x1f4e9c);_0x2f2108[_0x2af8('0x77')](_0x2af8('0x92'),_0x887045);}BPromise[_0x2af8('0x93')]()[_0x2af8('0x26')](function(){if(!_0x1459b3){if(_0x1e3fce[_0x2af8('0x40')]['FaxAccountId'])return;_0x2f2108[_0x2af8('0x77')](_0x2af8('0x94'));_0x3dccf4[_0x2af8('0x77')](_0x2af8('0x94'));return;}if(_0x1e3fce[_0x2af8('0x95')][_0x2af8('0x96')]!==_0x2af8('0x97'))return;return _0x1e3fce[_0x2af8('0x95')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0x2af8('0x26')](function(_0x3e2b37){if(_[_0x2af8('0x91')](_0x3e2b37)){_0x2f2108[_0x2af8('0x77')]('i.FaxAccountId\x20IS\x20NULL');_0x3dccf4[_0x2af8('0x77')]('i.FaxAccountId\x20IS\x20NULL');}else{_0x2f2108[_0x2af8('0x77')](_0x2af8('0x78'),_[_0x2af8('0x2a')](_0x3e2b37,'id'));_0x3dccf4[_0x2af8('0x77')](_0x2af8('0x78'),_[_0x2af8('0x2a')](_0x3e2b37,'id'));}});})[_0x2af8('0x26')](function(){if(_0x1e3fce[_0x2af8('0x95')]['role']===_0x2af8('0x97')&&!_0x1459b3&&!_0x1e3fce['query'][_0x2af8('0x76')])return[];return db[_0x2af8('0x98')][_0x2af8('0x40')](_0x2f2108[_0x2af8('0x99')](),_0x46f6bc);})[_0x2af8('0x26')](function(_0xbff688){_0x34fd2e[_0x2af8('0x1f')]=_0xbff688['length'];if(_0x34fd2e[_0x2af8('0x1f')]===0x0)return[];return db[_0x2af8('0x98')]['query'](_0x5badd3['toString'](),_0x46f6bc)[_0x2af8('0x26')](function(_0x1f1550){_0xb8094b=_['keyBy'](_0x1f1550,'id');_0x46f6bc=_[_0x2af8('0x9a')](_0x46f6bc,{'model':db[_0x2af8('0x3a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1e3fce[_0x2af8('0x40')][_0x2af8('0x45')]){_0x2f912b[_0x2af8('0x43')][_0x2af8('0x2f')](function(_0x180217){_0x3dccf4[_0x2af8('0x4c')]('i.'+_0x180217);});}else{_0x3dccf4[_0x2af8('0x4c')](_0x2af8('0x9b'),_0x2af8('0x90'));_0x3dccf4['field'](_0x2af8('0x9c'),_0x2af8('0x9d'));_0x3dccf4[_0x2af8('0x4c')](_0x2af8('0x9e'),'Account.mandatoryDisposition');_0x3dccf4[_0x2af8('0x4c')]('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',_0x2af8('0x9f'));_0x3dccf4[_0x2af8('0x4c')](_0x2af8('0xa0'));_0x3dccf4[_0x2af8('0x4c')](_0x2af8('0xa1'),'Contact.firstName');_0x3dccf4[_0x2af8('0x4c')](_0x2af8('0xa2'),_0x2af8('0xa3'));_0x3dccf4['field']('c.email',_0x2af8('0xa4'));_0x3dccf4['field'](_0x2af8('0xa5'),'Contact.phone');_0x3dccf4[_0x2af8('0x4c')](_0x2af8('0xa6'),_0x2af8('0xa7'));_0x3dccf4['field']('c.fax','Contact.fax');_0x3dccf4[_0x2af8('0x4c')](_0x2af8('0xa8'),_0x2af8('0xa9'));_0x3dccf4[_0x2af8('0x4c')](_0x2af8('0xaa'),_0x2af8('0xab'));_0x3dccf4[_0x2af8('0x4c')](_0x2af8('0xac'),_0x2af8('0x2c'));}if(_0x2f912b[_0x2af8('0x1e')])_0x3dccf4[_0x2af8('0x1e')](_0x2f912b['limit']);if(_0x2f912b[_0x2af8('0x1c')])_0x3dccf4[_0x2af8('0x1c')](_0x2f912b[_0x2af8('0x1c')]);return db[_0x2af8('0x98')][_0x2af8('0x40')](_0x3dccf4[_0x2af8('0x99')](),_0x46f6bc);})[_0x2af8('0x26')](function(_0x52cf61){if(_0x52cf61[_0x2af8('0x46')]>0x0)_0x589482['where'](_0x2af8('0xad'),_[_0x2af8('0x2a')](_0x52cf61,'id'));return db[_0x2af8('0x98')][_0x2af8('0x40')](_0x589482['toString'](),_0x46f6bc)['then'](function(_0x15de5b){var _0x435a2d=_[_0x2af8('0xae')](_0x15de5b,_0x2af8('0xaf'));var _0x3d98fa=[];_0x52cf61[_0x2af8('0x2f')](function(_0x46ac07){_0x3d98fa['push'](updateFaxInteraction(_0x46ac07,_0xb8094b,_0x435a2d));});return BPromise[_0x2af8('0xb0')](_0x3d98fa);});});})[_0x2af8('0x26')](function(_0x4da88b){_0x34fd2e[_0x2af8('0xb1')]=_0x4da88b;return _0x34fd2e;})[_0x2af8('0x26')](respondWithFilteredResult(_0x589b3f,_0x2f912b))[_0x2af8('0x31')](handleError(_0x589b3f,null));};exports[_0x2af8('0xb2')]=function(_0x1f9d52,_0x4049ca){var _0x56fc19={'raw':![],'where':{'id':_0x1f9d52['params']['id']}},_0x33e9e5={};_0x33e9e5[_0x2af8('0x3f')]=_[_0x2af8('0x41')](db[_0x2af8('0x3a')]['rawAttributes']);_0x33e9e5[_0x2af8('0x40')]=_[_0x2af8('0x41')](_0x1f9d52[_0x2af8('0x40')]);_0x33e9e5['filters']=_[_0x2af8('0x44')](_0x33e9e5['model'],_0x33e9e5[_0x2af8('0x40')]);_0x56fc19['attributes']=_[_0x2af8('0x44')](_0x33e9e5['model'],qs[_0x2af8('0x45')](_0x1f9d52[_0x2af8('0x40')]['fields']));_0x56fc19[_0x2af8('0x43')]=_0x56fc19[_0x2af8('0x43')][_0x2af8('0x46')]?_0x56fc19['attributes']:_0x33e9e5[_0x2af8('0x3f')];if(_0x1f9d52[_0x2af8('0x40')]['includeAll']){_0x56fc19[_0x2af8('0xb3')]=[{'all':!![]}];}_0x56fc19=_[_0x2af8('0x9a')]({},_0x56fc19,_0x1f9d52[_0x2af8('0xb4')]);return db[_0x2af8('0x3a')][_0x2af8('0x64')](_0x56fc19)[_0x2af8('0x26')](handleEntityNotFound(_0x4049ca,null))[_0x2af8('0x26')](respondWithResult(_0x4049ca,null))[_0x2af8('0x31')](handleError(_0x4049ca,null));};exports[_0x2af8('0xb5')]=function(_0x38062a,_0x1bcd3b){return db[_0x2af8('0x3a')][_0x2af8('0xb5')](_0x38062a['body'],{})['then'](respondWithResult(_0x1bcd3b,0xc9))[_0x2af8('0x31')](handleError(_0x1bcd3b,null));};exports[_0x2af8('0x25')]=function(_0x358fa6,_0x47c99c){if(_0x358fa6['body']['id']){delete _0x358fa6[_0x2af8('0xb6')]['id'];}return db[_0x2af8('0x3a')][_0x2af8('0x64')]({'where':{'id':_0x358fa6[_0x2af8('0xb7')]['id']}})[_0x2af8('0x26')](handleEntityNotFound(_0x47c99c,null))[_0x2af8('0x26')](saveUpdates(_0x358fa6[_0x2af8('0xb6')],null))[_0x2af8('0x26')](respondWithResult(_0x47c99c,null))[_0x2af8('0x31')](handleError(_0x47c99c,null));};exports[_0x2af8('0xb8')]=function(_0xc4a20f,_0xda5d01){return db[_0x2af8('0x3a')][_0x2af8('0x64')]({'where':{'id':_0xc4a20f[_0x2af8('0xb7')]['id']}})[_0x2af8('0x26')](handleEntityNotFound(_0xda5d01,null))[_0x2af8('0x26')](removeEntity(_0xda5d01,null))[_0x2af8('0x31')](handleError(_0xda5d01,null));};exports[_0x2af8('0xb9')]=function(_0x4944d0,_0x454145){return db[_0x2af8('0x3a')]['describe']()[_0x2af8('0x26')](respondWithResult(_0x454145,null))['catch'](handleError(_0x454145,null));};exports[_0x2af8('0xba')]=function(_0x4df60c,_0x58e9fa,_0x273f49){return db['FaxMessage'][_0x2af8('0x64')]({'where':{'id':_0x4df60c[_0x2af8('0xb7')]['id']}})[_0x2af8('0x26')](handleEntityNotFound(_0x58e9fa,null))[_0x2af8('0x26')](function(_0x4b99e4){if(_0x4b99e4){return _0x4b99e4[_0x2af8('0xba')](_0x4df60c[_0x2af8('0xb6')][_0x2af8('0xbb')],_['omit'](_0x4df60c['body'],[_0x2af8('0xbb'),'id'])||{});}})['then'](respondWithResult(_0x58e9fa,null))[_0x2af8('0x31')](handleError(_0x58e9fa,null));};exports[_0x2af8('0xbc')]=function(_0x24a2e2,_0x2de82b,_0x4f1ccc){var _0x2438af={'raw':![],'where':{}};var _0x149307={};var _0x49e471={'count':0x0,'rows':[]};return db['FaxInteraction'][_0x2af8('0xbd')]({'where':{'id':_0x24a2e2['params']['id']}})[_0x2af8('0x26')](handleEntityNotFound(_0x2de82b,null))[_0x2af8('0x26')](function(_0x5982ed){if(_0x5982ed){_0x149307['model']=_[_0x2af8('0x41')](db['FaxMessage'][_0x2af8('0x3b')]);_0x149307[_0x2af8('0x40')]=_[_0x2af8('0x41')](_0x24a2e2[_0x2af8('0x40')]);_0x149307[_0x2af8('0x42')]=_[_0x2af8('0x44')](_0x149307[_0x2af8('0x3f')],_0x149307[_0x2af8('0x40')]);_0x2438af[_0x2af8('0x43')]=_[_0x2af8('0x44')](_0x149307[_0x2af8('0x3f')],qs['fields'](_0x24a2e2[_0x2af8('0x40')]['fields']));_0x2438af['attributes']=_0x2438af[_0x2af8('0x43')][_0x2af8('0x46')]?_0x2438af[_0x2af8('0x43')]:_0x149307[_0x2af8('0x3f')];if(!_0x24a2e2[_0x2af8('0x40')]['hasOwnProperty']('nolimit')){_0x2438af['limit']=qs[_0x2af8('0x1e')](_0x24a2e2['query'][_0x2af8('0x1e')]);_0x2438af['offset']=qs[_0x2af8('0x1c')](_0x24a2e2[_0x2af8('0x40')][_0x2af8('0x1c')]);}_0x2438af[_0x2af8('0x48')]=qs[_0x2af8('0x49')](_0x24a2e2['query'][_0x2af8('0x49')]);_0x2438af[_0x2af8('0x77')]=qs[_0x2af8('0x42')](_[_0x2af8('0x4a')](_0x24a2e2[_0x2af8('0x40')],_0x149307[_0x2af8('0x42')]));_0x2438af[_0x2af8('0x77')][_0x2af8('0xaf')]=_0x5982ed['id'];if(_0x24a2e2[_0x2af8('0x40')]['filter']){_0x2438af[_0x2af8('0x77')]=_[_0x2af8('0x9a')](_0x2438af[_0x2af8('0x77')],{'$or':_[_0x2af8('0x2a')](_0x2438af['attributes'],function(_0x36dc02){var _0x524497={};_0x524497[_0x36dc02]={'$like':'%'+_0x24a2e2[_0x2af8('0x40')][_0x2af8('0x86')]+'%'};return _0x524497;})});}if(_0x24a2e2['query'][_0x2af8('0xbe')]){var _0x4e1f0e=_0x24a2e2['query']['$gte'][_0x2af8('0x2e')](',');var _0x49c076={};_0x49c076[_0x4e1f0e[0x0]]={'$gte':moment(_0x4e1f0e[0x1])['format'](_0x2af8('0xbf'))};_0x2438af[_0x2af8('0x77')]=_['merge'](_0x2438af['where'],_0x49c076);}_0x2438af=_['merge']({},_0x2438af,_0x24a2e2[_0x2af8('0xb4')]);return db[_0x2af8('0xc0')][_0x2af8('0x1f')]({'where':_0x2438af['where']})['then'](function(_0x5f1b5a){_0x49e471['count']=_0x5f1b5a;if(_0x24a2e2[_0x2af8('0x40')]['includeAll']){_0x2438af['include']=[{'all':!![]}];}return db[_0x2af8('0xc0')][_0x2af8('0xc1')](_0x2438af);})[_0x2af8('0x26')](function(_0xe3980f){_0x49e471[_0x2af8('0xb1')]=_0xe3980f;return _0x49e471;});}})['then'](respondWithFilteredResult(_0x2de82b,_0x2438af))['catch'](handleError(_0x2de82b,null));};exports[_0x2af8('0xc2')]=function(_0x1b2dbf,_0x1f4f4e,_0x3c782b){return db[_0x2af8('0x3a')][_0x2af8('0x64')]({'where':{'id':_0x1b2dbf[_0x2af8('0xb7')]['id']}})[_0x2af8('0x26')](handleEntityNotFound(_0x1f4f4e,null))['then'](function(_0x1735e2){if(_0x1735e2){return _0x1735e2[_0x2af8('0xc3')](_0x1b2dbf[_0x2af8('0xb6')]['ids'],_[_0x2af8('0xc4')](_0x1b2dbf[_0x2af8('0xb6')],['ids','id'])||{})[_0x2af8('0xc5')](function(){return db[_0x2af8('0x73')][_0x2af8('0xc1')]({'attributes':['id',_0x2af8('0x29'),_0x2af8('0x4d')],'where':{'id':_0x1b2dbf[_0x2af8('0xb6')][_0x2af8('0xbb')]}});})[_0x2af8('0x26')](function(_0x29687f){socket[_0x2af8('0xc6')](_0x2af8('0xc7'),{'id':Number(_0x1b2dbf[_0x2af8('0xb7')]['id']),'tags':_0x29687f||[]});return{'id':Number(_0x1b2dbf[_0x2af8('0xb7')]['id']),'tags':_0x29687f||[]};});}})[_0x2af8('0x26')](respondWithResult(_0x1f4f4e,null))[_0x2af8('0x31')](handleError(_0x1f4f4e,null));};exports[_0x2af8('0xc8')]=function(_0x4a3a12,_0x881367,_0x1152e6){return db['FaxInteraction'][_0x2af8('0x64')]({'where':{'id':_0x4a3a12[_0x2af8('0xb7')]['id']}})[_0x2af8('0x26')](handleEntityNotFound(_0x881367,null))['then'](function(_0x364e5d){if(_0x364e5d){return _0x364e5d[_0x2af8('0xc8')](_0x4a3a12[_0x2af8('0x40')][_0x2af8('0xbb')]);}})[_0x2af8('0x26')](respondWithStatusCode(_0x881367,null))['catch'](handleError(_0x881367,null));};exports[_0x2af8('0xc9')]=function(_0x488c58,_0xaf5d17){var _0x58026c=moment()['unix']()['toString']();var _0x5557ed=path[_0x2af8('0xca')](config[_0x2af8('0xcb')],_0x2af8('0xcc'),_0x2af8('0xcd'),_0x2af8('0xce'));var _0x3350d8=path['join'](config[_0x2af8('0xcb')],'server','files',_0x2af8('0xcf'));var _0x3f2d75=path[_0x2af8('0xca')](_0x5557ed,_0x58026c);var _0x1122c1=util[_0x2af8('0xd0')](_0x2af8('0xd1'),_0x488c58[_0x2af8('0xb7')]['id'],_0x58026c);var _0xd0040b=path[_0x2af8('0xca')](_0x5557ed,_0x1122c1);var _0x422199=[];_0x422199[_0x2af8('0x30')]({'model':db['Attachment'],'as':_0x2af8('0xd2'),'raw':!![]});var _0x577140=[{'model':db['FaxMessage'],'as':'Messages','attributes':['id',_0x2af8('0xb6'),'createdAt'],'include':_0x422199}];return db[_0x2af8('0x3a')][_0x2af8('0x64')]({'where':{'id':_0x488c58[_0x2af8('0xb7')]['id']},'include':_0x577140})[_0x2af8('0x26')](handleEntityNotFound(_0xaf5d17,null))[_0x2af8('0x26')](function(_0x36938e){if(_0x36938e&&_0x36938e[_0x2af8('0xd3')]){var _0x294a9d=_0x36938e[_0x2af8('0xd4')]({'plain':!![]});fs[_0x2af8('0xd5')](_0x3f2d75);for(var _0x1d345b=0x0;_0x1d345b<_0x294a9d[_0x2af8('0xd3')][_0x2af8('0x46')];_0x1d345b++){var _0xacff1e=_0x294a9d['Messages'][_0x1d345b][_0x2af8('0xd2')];if(_0xacff1e){var _0x581a6f=path[_0x2af8('0xca')](_0x3350d8,_0xacff1e[_0x2af8('0xd6')]);if(fs[_0x2af8('0xd7')](_0x581a6f)){fs[_0x2af8('0xd8')](_0x581a6f)[_0x2af8('0xd9')](fs['createWriteStream'](path[_0x2af8('0xca')](_0x3f2d75,_0xacff1e['basename'])));}}}return BPromise[_0x2af8('0x93')]()['then'](function(){return new BPromise(function(_0x2f3fdc,_0x204c1a){zipdir(_0x3f2d75,{'saveTo':_0xd0040b},function(_0x5c6437,_0x52f73e){if(_0x5c6437)return _0x204c1a(_0x5c6437);return _0x2f3fdc(_0x52f73e);});})[_0x2af8('0x26')](function(){return new BPromise(function(_0x13aa69,_0x8847fb){rimraf(_0x3f2d75,function(_0x52aaf1){if(_0x52aaf1)_0x8847fb(_0x52aaf1);return _0x13aa69();});});})['then'](function(){return _0xaf5d17[_0x2af8('0xc9')](_0xd0040b,_0x1122c1,function(_0x2cda7c){if(_0x2cda7c){console[_0x2af8('0xda')](_0x2af8('0xdb'),_0x2cda7c);}else{fs['unlinkSync'](_0xd0040b);}});});});}else{return _0xaf5d17[_0x2af8('0x28')](0xc8);}})[_0x2af8('0x31')](handleError(_0xaf5d17,null));}; \ No newline at end of file +var _0xcb67=['field','tools_tags','u.id','u.fullname','from','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','length','find','unreadMessages','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','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','buildExpression','body','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','getFaxAccounts','agent','toString','sequelize','keyBy','merge','FaxInteraction','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','ui.FaxInteractionId\x20IN\x20?','push','all','rows','show','params','includeAll','include','create','describe','FaxMessage','ids','omit','getMessages','findOne','FaxInteractionId','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','color','emit','faxInteractionTags:save','removeTags','download','unix','join','root','server','files','Attachment','Messages','mkdirSync','basename','existsSync','createWriteStream','log','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','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','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','Users','map','fullname','forEach','Tags','catch','waiting','talking','answered','total','closed','UserId','unmanaged','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','select'];(function(_0x4f2033,_0x2159fc){var _0x10b445=function(_0x303f2f){while(--_0x303f2f){_0x4f2033['push'](_0x4f2033['shift']());}};_0x10b445(++_0x2159fc);}(_0xcb67,0x91));var _0x7cb6=function(_0x211fef,_0x4ab716){_0x211fef=_0x211fef-0x0;var _0x5447bf=_0xcb67[_0x211fef];return _0x5447bf;};'use strict';var emlformat=require(_0x7cb6('0x0'));var rimraf=require(_0x7cb6('0x1'));var zipdir=require(_0x7cb6('0x2'));var jsonpatch=require(_0x7cb6('0x3'));var rp=require(_0x7cb6('0x4'));var moment=require(_0x7cb6('0x5'));var BPromise=require(_0x7cb6('0x6'));var Mustache=require(_0x7cb6('0x7'));var util=require(_0x7cb6('0x8'));var path=require(_0x7cb6('0x9'));var sox=require(_0x7cb6('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7cb6('0xb'));var _=require(_0x7cb6('0xc'));var squel=require(_0x7cb6('0xd'));var crypto=require(_0x7cb6('0xe'));var jsforce=require(_0x7cb6('0xf'));var deskjs=require(_0x7cb6('0x10'));var toCsv=require(_0x7cb6('0x11'));var querystring=require(_0x7cb6('0x12'));var Papa=require('papaparse');var Redis=require(_0x7cb6('0x13'));var authService=require(_0x7cb6('0x14'));var qs=require(_0x7cb6('0x15'));var as=require(_0x7cb6('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7cb6('0x17'))(_0x7cb6('0x18'));var utils=require(_0x7cb6('0x19'));var config=require(_0x7cb6('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x7cb6('0x1b'))['db'];config[_0x7cb6('0x1c')]=_[_0x7cb6('0x1d')](config[_0x7cb6('0x1c')],{'host':_0x7cb6('0x1e'),'port':0x18eb});var socket=require(_0x7cb6('0x1f'))(new Redis(config['redis']));require('./faxInteraction.socket')[_0x7cb6('0x20')](socket);function respondWithStatusCode(_0x3e2879,_0x34ec78){_0x34ec78=_0x34ec78||0xcc;return function(_0x796f52){if(_0x796f52){return _0x3e2879[_0x7cb6('0x21')](_0x34ec78);}return _0x3e2879[_0x7cb6('0x22')](_0x34ec78)[_0x7cb6('0x23')]();};}function respondWithResult(_0x322844,_0x4d7f82){_0x4d7f82=_0x4d7f82||0xc8;return function(_0x44f758){if(_0x44f758){return _0x322844[_0x7cb6('0x22')](_0x4d7f82)[_0x7cb6('0x24')](_0x44f758);}};}function respondWithFilteredResult(_0x40415b,_0x43fe9d){return function(_0x157d71){if(_0x157d71){var _0x263913=typeof _0x43fe9d[_0x7cb6('0x25')]==='undefined'&&typeof _0x43fe9d[_0x7cb6('0x26')]===_0x7cb6('0x27');var _0x5c412d=_0x157d71[_0x7cb6('0x28')];var _0xf62ec8=_0x263913?0x0:_0x43fe9d[_0x7cb6('0x25')];var _0x11405d=_0x263913?_0x157d71['count']:_0x43fe9d['offset']+_0x43fe9d[_0x7cb6('0x26')];var _0x56f562;if(_0x11405d>=_0x5c412d){_0x11405d=_0x5c412d;_0x56f562=0xc8;}else{_0x56f562=0xce;}_0x40415b[_0x7cb6('0x22')](_0x56f562);return _0x40415b[_0x7cb6('0x29')](_0x7cb6('0x2a'),_0xf62ec8+'-'+_0x11405d+'/'+_0x5c412d)['json'](_0x157d71);}return null;};}function patchUpdates(_0x397988){return function(_0x54a783){try{jsonpatch['apply'](_0x54a783,_0x397988,!![]);}catch(_0xfc62a9){return BPromise[_0x7cb6('0x2b')](_0xfc62a9);}return _0x54a783[_0x7cb6('0x2c')]();};}function saveUpdates(_0x1702ef,_0x4cc288){return function(_0xac2405){if(_0xac2405){return _0xac2405[_0x7cb6('0x2d')](_0x1702ef)['then'](function(_0x222837){return _0x222837;});}return null;};}function removeEntity(_0x545863,_0x1918ba){return function(_0x3a09fb){if(_0x3a09fb){return _0x3a09fb[_0x7cb6('0x2e')]()[_0x7cb6('0x2f')](function(){_0x545863['status'](0xcc)[_0x7cb6('0x23')]();});}};}function handleEntityNotFound(_0x58123e,_0x209acb){return function(_0x582253){if(!_0x582253){_0x58123e[_0x7cb6('0x21')](0x194);}return _0x582253;};}function handleError(_0x4e5f8e,_0x174e4c){_0x174e4c=_0x174e4c||0x1f4;return function(_0x4fa3d7){logger[_0x7cb6('0x30')](_0x4fa3d7[_0x7cb6('0x31')]);if(_0x4fa3d7[_0x7cb6('0x32')]){delete _0x4fa3d7[_0x7cb6('0x32')];}_0x4e5f8e[_0x7cb6('0x22')](_0x174e4c)['send'](_0x4fa3d7);};}function getInteractionUsers(_0x6c0e3f,_0x49f697){return new BPromise(function(_0x1210cf,_0x1eb16d){try{if(_0x49f697[_0x6c0e3f['id']]){_0x6c0e3f[_0x7cb6('0x33')]=_[_0x7cb6('0x34')](_0x49f697[_0x6c0e3f['id']],function(_0x4cfe9c){return{'id':_0x4cfe9c['id'],'fullname':_0x4cfe9c[_0x7cb6('0x35')]};});}}catch(_0x46f6b0){_0x1eb16d(_0x46f6b0);}_0x1210cf(_0x6c0e3f);});}function getInteractionTags(_0x278eb1,_0x23ace9){return new BPromise(function(_0x4b8c7c,_0x59fae0){try{if(_0x278eb1['TagIds']){_0x278eb1['Tags']=[];_0x278eb1['TagIds']['split'](',')[_0x7cb6('0x36')](function(_0x1b4916){_0x278eb1[_0x7cb6('0x37')]['push'](_0x23ace9[_0x1b4916]);});}delete _0x278eb1['TagIds'];}catch(_0x5c8551){_0x59fae0(_0x5c8551);}_0x4b8c7c(_0x278eb1);});}function updateFaxInteraction(_0x496f31,_0xbddc2f,_0x26cd59){return new BPromise(function(_0x12724c,_0x4c3b6e){return getInteractionUsers(_0x496f31,_0x26cd59)[_0x7cb6('0x2f')](function(_0x503b78){return getInteractionTags(_0x503b78,_0xbddc2f);})[_0x7cb6('0x2f')](function(_0x3fe1b6){return getStateInteraction(_0x3fe1b6);})['then'](function(_0x1b368c){_0x12724c(_0x1b368c);})[_0x7cb6('0x38')](function(_0xcddab6){_0x4c3b6e(_0xcddab6);});});}function getStateInteraction(_0x1e9749){return new BPromise(function(_0x2751cf){_0x1e9749[_0x7cb6('0x39')]=0x0;_0x1e9749[_0x7cb6('0x3a')]=0x0;_0x1e9749[_0x7cb6('0x3b')]=0x0;_0x1e9749['unmanaged']=0x0;_0x1e9749[_0x7cb6('0x3c')]=0x0;if(!_0x1e9749[_0x7cb6('0x3d')]&&!_0x1e9749[_0x7cb6('0x3e')]){_0x1e9749[_0x7cb6('0x39')]+=0x1;}if(!_0x1e9749[_0x7cb6('0x3d')]&&_0x1e9749[_0x7cb6('0x3e')]){_0x1e9749[_0x7cb6('0x3a')]+=0x1;if(_0x1e9749['waiting']){_0x1e9749[_0x7cb6('0x39')]-=0x1;}}if(_0x1e9749['closed']&&_0x1e9749[_0x7cb6('0x3e')]){_0x1e9749['answered']+=0x1;if(_0x1e9749[_0x7cb6('0x3a')]){_0x1e9749[_0x7cb6('0x3a')]-=0x1;}}if(_0x1e9749[_0x7cb6('0x3d')]&&!_0x1e9749[_0x7cb6('0x3e')]){_0x1e9749[_0x7cb6('0x3f')]+=0x1;if(_0x1e9749[_0x7cb6('0x39')]){_0x1e9749[_0x7cb6('0x39')]-=0x1;}}_0x1e9749[_0x7cb6('0x3c')]+=0x1;_0x2751cf(_0x1e9749);});}exports['index']=function(_0x464344,_0x2c6059){var _0x34cdad={},_0x447b24={},_0x53acdc={'count':0x0,'rows':[]};var _0x4b95be=_[_0x7cb6('0x34')](db['FaxInteraction'][_0x7cb6('0x40')],function(_0x529bd1){return{'name':_0x529bd1['fieldName'],'type':_0x529bd1[_0x7cb6('0x41')][_0x7cb6('0x42')]};});_0x447b24[_0x7cb6('0x43')]=_[_0x7cb6('0x34')](_0x4b95be,_0x7cb6('0x32'));_0x447b24[_0x7cb6('0x44')]=_[_0x7cb6('0x45')](_0x464344[_0x7cb6('0x44')]);_0x447b24[_0x7cb6('0x46')]=_[_0x7cb6('0x47')](_0x447b24[_0x7cb6('0x43')],_0x447b24[_0x7cb6('0x44')]);_0x34cdad[_0x7cb6('0x48')]=_[_0x7cb6('0x47')](_0x447b24['model'],qs['fields'](_0x464344[_0x7cb6('0x44')][_0x7cb6('0x49')]));_0x34cdad[_0x7cb6('0x48')]=_0x34cdad[_0x7cb6('0x48')]['length']?_0x34cdad['attributes']:_0x447b24[_0x7cb6('0x43')];if(!_0x464344[_0x7cb6('0x44')][_0x7cb6('0x4a')](_0x7cb6('0x4b'))){_0x34cdad['limit']=qs[_0x7cb6('0x26')](_0x464344[_0x7cb6('0x44')][_0x7cb6('0x26')]);_0x34cdad[_0x7cb6('0x25')]=qs[_0x7cb6('0x25')](_0x464344[_0x7cb6('0x44')]['offset']);}_0x34cdad[_0x7cb6('0x4c')]=qs[_0x7cb6('0x4d')](_0x464344[_0x7cb6('0x44')]['sort']);_0x34cdad[_0x7cb6('0x4e')]=qs[_0x7cb6('0x46')](_[_0x7cb6('0x4f')](_0x464344[_0x7cb6('0x44')],_0x447b24[_0x7cb6('0x46')]),_0x4b95be);var _0x49164d=[];var _0x139714=squel[_0x7cb6('0x50')]()[_0x7cb6('0x51')]('id')[_0x7cb6('0x51')](_0x7cb6('0x32'))[_0x7cb6('0x51')]('color')['from'](_0x7cb6('0x52'));var _0x5f07d8=squel[_0x7cb6('0x50')]()[_0x7cb6('0x51')](_0x7cb6('0x53'))[_0x7cb6('0x51')](_0x7cb6('0x54'))[_0x7cb6('0x51')]('ui.FaxInteractionId')[_0x7cb6('0x55')](_0x7cb6('0x56'),'ui')[_0x7cb6('0x57')](_0x7cb6('0x58'),'u',_0x7cb6('0x59'));var _0x54c713=squel[_0x7cb6('0x50')]()[_0x7cb6('0x55')](_0x7cb6('0x5a'),'i')[_0x7cb6('0x57')](_0x7cb6('0x5b'),'c',_0x7cb6('0x5c'))[_0x7cb6('0x57')]('users','o','o.id\x20=\x20i.UserId')[_0x7cb6('0x57')]('fax_accounts','a',_0x7cb6('0x5d'))[_0x7cb6('0x57')](_0x7cb6('0x5e'),'me',_0x7cb6('0x5f'))[_0x7cb6('0x57')](_0x7cb6('0x60'),'it',_0x7cb6('0x61'))[_0x7cb6('0x57')]('tools_tags','t',_0x7cb6('0x62'));var _0x4bb34f=squel[_0x7cb6('0x63')]();var _0x157602=[];var _0x11cb6e=squel[_0x7cb6('0x63')]();var _0x28c47d;if(_0x464344[_0x7cb6('0x44')]['search']){_0x28c47d=as[_0x7cb6('0x64')](_0x464344['query'][_0x7cb6('0x65')]);var _0x54eb12=_0x28c47d[_0x7cb6('0x66')];for(var _0x3d6d49=0x0;_0x3d6d49<_0x28c47d[_0x7cb6('0x67')][_0x7cb6('0x68')];_0x3d6d49++){var _0x20694b=_0x28c47d[_0x7cb6('0x67')][_0x3d6d49];var _0x111772='i';var _0x23ebd0=_[_0x7cb6('0x69')](_0x4b95be,[_0x7cb6('0x32'),_0x20694b[_0x7cb6('0x51')]]);if(!_0x23ebd0){switch(_0x20694b[_0x7cb6('0x51')]){case _0x7cb6('0x6a'):if(_0x20694b[_0x7cb6('0x6b')]==0x1){_0x54c713[_0x7cb6('0x6c')]('`'+_0x20694b['field']+_0x7cb6('0x6d'));}else{_0x54c713['having']('`'+_0x20694b[_0x7cb6('0x51')]+'`\x20>\x200');}break;case _0x7cb6('0x6e'):if(_0x20694b[_0x7cb6('0x6f')]==='$substring'){if(_0x20694b[_0x7cb6('0x6b')][_0x7cb6('0x70')]('\x20')['length']>0x1){_0x4bb34f[_0x54eb12](_0x7cb6('0x71'),qs['getFullTextValue'](_0x20694b[_0x7cb6('0x6b')]),null);}else{var _0x52d8a1='%'+_0x20694b[_0x7cb6('0x6b')]+'%';_0x4bb34f[_0x54eb12](_0x7cb6('0x72'),_0x52d8a1,_0x52d8a1,_0x52d8a1);}}else{_0x23ebd0=_[_0x7cb6('0x69')](_0x4b95be,['name',_0x7cb6('0x73')]);_0x20694b[_0x7cb6('0x51')]=_0x7cb6('0x73');_0xb208e4=as['buildExpression'](_0x111772,_0x23ebd0[_0x7cb6('0x41')],_0x20694b);_0x4bb34f[_0x54eb12](_0xb208e4[_0x7cb6('0x74')],_0xb208e4['value'][_0x7cb6('0x75')],_0xb208e4[_0x7cb6('0x6b')][_0x7cb6('0x23')]);}break;case _0x7cb6('0x76'):var _0x462db7=_0x20694b[_0x7cb6('0x6b')][_0x7cb6('0x70')](',')[_0x7cb6('0x34')](function(_0x5bb396){return Number(_0x5bb396);});_0x462db7[_0x7cb6('0x36')](function(_0x42b3e2){_0x11cb6e['or'](_0x7cb6('0x77'),'%,'+_0x42b3e2+',%');});_0x157602=_[_0x7cb6('0x78')](_0x157602,_0x462db7);break;case _0x7cb6('0x79'):if(_0x20694b[_0x7cb6('0x6f')]===_0x7cb6('0x7a')){_0x4bb34f[_0x54eb12]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x20694b[_0x7cb6('0x6b')]+'%',null);}else{_0x23ebd0=_[_0x7cb6('0x69')](_0x4b95be,['name',_0x7cb6('0x3e')]);_0x20694b[_0x7cb6('0x51')]=_0x7cb6('0x3e');_0xb208e4=as[_0x7cb6('0x7b')](_0x111772,_0x23ebd0[_0x7cb6('0x41')],_0x20694b);_0x4bb34f[_0x54eb12](_0xb208e4[_0x7cb6('0x74')],_0xb208e4[_0x7cb6('0x6b')]['start'],_0xb208e4[_0x7cb6('0x6b')]['end']);}break;case _0x7cb6('0x7c'):_0xb208e4=as[_0x7cb6('0x7b')]('me',null,_0x20694b);_0x4bb34f[_0x54eb12](_0xb208e4[_0x7cb6('0x74')],_0xb208e4[_0x7cb6('0x6b')][_0x7cb6('0x75')],_0xb208e4['value'][_0x7cb6('0x23')]);break;}}else{var _0xb208e4=as[_0x7cb6('0x7b')](_0x111772,_0x23ebd0[_0x7cb6('0x41')],_0x20694b);_0x4bb34f[_0x54eb12](_0xb208e4[_0x7cb6('0x74')],_0xb208e4[_0x7cb6('0x6b')][_0x7cb6('0x75')],_0xb208e4[_0x7cb6('0x6b')][_0x7cb6('0x23')]);}}}else{var _0x4c1c9d=_(_0x464344[_0x7cb6('0x44')])['keys']()['map'](function(_0x450d11){return _[_0x7cb6('0x7d')](_0x4b95be,[_0x7cb6('0x32'),_0x450d11])?_0x450d11:undefined;})[_0x7cb6('0x7e')]()[_0x7cb6('0x6b')]();if(!_[_0x7cb6('0x7f')](_0x4c1c9d)){_0x4c1c9d['forEach'](function(_0x19ef02){if(_0x19ef02===_0x7cb6('0x80')){_0x54c713[_0x7cb6('0x4e')](_0x7cb6('0x81'),[][_0x7cb6('0x82')](_0x464344[_0x7cb6('0x44')][_0x19ef02]));}else if(_0x19ef02===_0x7cb6('0x83')){var _0x365d9c=JSON['parse'](_0x464344[_0x7cb6('0x44')][_0x19ef02])[_0x7cb6('0x84')];var _0x4b1f5d=JSON[_0x7cb6('0x85')](_0x464344['query'][_0x19ef02])[_0x7cb6('0x86')];_0x54c713[_0x7cb6('0x4e')](_0x7cb6('0x87'),_0x365d9c,_0x4b1f5d);}else{if(_0x464344[_0x7cb6('0x44')][_0x19ef02]==='null'){_0x54c713['where']('i.'+_0x19ef02+_0x7cb6('0x88'));}else{_0x54c713[_0x7cb6('0x4e')]('i.'+_0x19ef02+_0x7cb6('0x89'),_0x464344['query'][_0x19ef02]);}}});}if(_0x464344[_0x7cb6('0x44')]['read']){if(_0x464344[_0x7cb6('0x44')][_0x7cb6('0x8a')]==0x1){_0x54c713[_0x7cb6('0x6c')]('`unreadMessages`\x20=\x200');}else{_0x54c713[_0x7cb6('0x6c')](_0x7cb6('0x8b'));}}if(_0x464344['query'][_0x7cb6('0x8c')]){_0x157602=_[_0x7cb6('0x8d')](_0x464344[_0x7cb6('0x44')][_0x7cb6('0x8c')])?_0x464344[_0x7cb6('0x44')][_0x7cb6('0x8c')]:new Array(_0x464344['query'][_0x7cb6('0x8c')]);_0x157602[_0x7cb6('0x36')](function(_0x43bb0b){_0x11cb6e['or'](_0x7cb6('0x77'),'%,'+_0x43bb0b+',%');});}if(_0x464344[_0x7cb6('0x44')]['filter']){var _0x313b8c=_0x464344[_0x7cb6('0x44')][_0x7cb6('0x8e')]['replace']('\x5c','\x5c\x5c')[_0x7cb6('0x8f')](/'/g,'\x27\x27');if(qs[_0x7cb6('0x90')](_0x313b8c)){_0x4bb34f['or'](_0x7cb6('0x91'),_0x313b8c+'%')['or'](_0x7cb6('0x92'),_0x313b8c+'%');}_0x4bb34f['or'](_0x7cb6('0x93'),_0x313b8c+'%');}}_0x54c713['where'](_0x4bb34f);_0x54c713[_0x7cb6('0x94')](_0x7cb6('0x95'));var _0x26acbf={'type':db[_0x7cb6('0x96')]['QueryTypes'][_0x7cb6('0x97')],'raw':!![]};var _0x547ee2=_0x54c713[_0x7cb6('0x98')]();_0x547ee2[_0x7cb6('0x51')]('i.id');_0x547ee2[_0x7cb6('0x51')](_0x7cb6('0x99'),_0x7cb6('0x6a'));if(_0x34cdad[_0x7cb6('0x4c')]){_0x34cdad['order'][_0x7cb6('0x36')](function(_0x4bc929){var _0x21618a=_0x4bc929[0x0]===_0x7cb6('0x9a')?_0x4bc929[0x0]:'i.'+_0x4bc929[0x0];_0x54c713[_0x7cb6('0x4c')](_0x21618a,_0x4bc929[0x1]===_0x7cb6('0x9b')?![]:!![]);});}if(!_[_0x7cb6('0x7f')](_0x157602)){_0x54c713[_0x7cb6('0x6c')](_0x11cb6e);_0x547ee2[_0x7cb6('0x4e')](_0x7cb6('0x9c'),_0x157602);}BPromise[_0x7cb6('0x9d')]()[_0x7cb6('0x2f')](function(){if(!_0x28c47d){if(_0x464344[_0x7cb6('0x44')][_0x7cb6('0x80')])return;_0x547ee2[_0x7cb6('0x4e')](_0x7cb6('0x9e'));_0x54c713['where'](_0x7cb6('0x9e'));return;}if(_0x464344[_0x7cb6('0x9f')][_0x7cb6('0xa0')]!=='agent')return;return _0x464344[_0x7cb6('0x9f')][_0x7cb6('0xa1')]({'attributes':['id'],'raw':!![]})[_0x7cb6('0x2f')](function(_0x53b6b6){if(_['isEmpty'](_0x53b6b6)){_0x547ee2[_0x7cb6('0x4e')]('i.FaxAccountId\x20IS\x20NULL');_0x54c713['where']('i.FaxAccountId\x20IS\x20NULL');}else{_0x547ee2['where'](_0x7cb6('0x81'),_[_0x7cb6('0x34')](_0x53b6b6,'id'));_0x54c713[_0x7cb6('0x4e')]('i.FaxAccountId\x20IN\x20?',_[_0x7cb6('0x34')](_0x53b6b6,'id'));}});})['then'](function(){if(_0x464344[_0x7cb6('0x9f')]['role']===_0x7cb6('0xa2')&&!_0x28c47d&&!_0x464344[_0x7cb6('0x44')][_0x7cb6('0x80')])return[];return db['sequelize'][_0x7cb6('0x44')](_0x547ee2[_0x7cb6('0xa3')](),_0x26acbf);})[_0x7cb6('0x2f')](function(_0x316493){_0x53acdc[_0x7cb6('0x28')]=_0x316493[_0x7cb6('0x68')];if(_0x53acdc[_0x7cb6('0x28')]===0x0)return[];return db[_0x7cb6('0xa4')]['query'](_0x139714[_0x7cb6('0xa3')](),_0x26acbf)[_0x7cb6('0x2f')](function(_0x2666c4){_0x49164d=_[_0x7cb6('0xa5')](_0x2666c4,'id');_0x26acbf=_[_0x7cb6('0xa6')](_0x26acbf,{'model':db[_0x7cb6('0xa7')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x464344[_0x7cb6('0x44')]['fields']){_0x34cdad[_0x7cb6('0x48')][_0x7cb6('0x36')](function(_0x35caa6){_0x54c713['field']('i.'+_0x35caa6);});}else{_0x54c713[_0x7cb6('0x51')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x7cb6('0x6a'));_0x54c713[_0x7cb6('0x51')](_0x7cb6('0xa8'),_0x7cb6('0xa9'));_0x54c713[_0x7cb6('0x51')](_0x7cb6('0xaa'),_0x7cb6('0xab'));_0x54c713[_0x7cb6('0x51')]('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',_0x7cb6('0x9a'));_0x54c713[_0x7cb6('0x51')](_0x7cb6('0xac'));_0x54c713[_0x7cb6('0x51')](_0x7cb6('0xad'),_0x7cb6('0xae'));_0x54c713[_0x7cb6('0x51')](_0x7cb6('0xaf'),_0x7cb6('0xb0'));_0x54c713[_0x7cb6('0x51')](_0x7cb6('0xb1'),'Contact.email');_0x54c713['field'](_0x7cb6('0xb2'),_0x7cb6('0xb3'));_0x54c713[_0x7cb6('0x51')](_0x7cb6('0xb4'),'Contact.mobile');_0x54c713[_0x7cb6('0x51')](_0x7cb6('0xb5'),_0x7cb6('0xb6'));_0x54c713[_0x7cb6('0x51')](_0x7cb6('0xb7'),_0x7cb6('0xb8'));_0x54c713[_0x7cb6('0x51')]('o.internal',_0x7cb6('0xb9'));_0x54c713['field'](_0x7cb6('0xba'),_0x7cb6('0xbb'));}if(_0x34cdad[_0x7cb6('0x26')])_0x54c713['limit'](_0x34cdad[_0x7cb6('0x26')]);if(_0x34cdad['offset'])_0x54c713[_0x7cb6('0x25')](_0x34cdad[_0x7cb6('0x25')]);return db[_0x7cb6('0xa4')][_0x7cb6('0x44')](_0x54c713[_0x7cb6('0xa3')](),_0x26acbf);})[_0x7cb6('0x2f')](function(_0x379bf5){if(_0x379bf5[_0x7cb6('0x68')]>0x0)_0x5f07d8['where'](_0x7cb6('0xbc'),_[_0x7cb6('0x34')](_0x379bf5,'id'));return db['sequelize']['query'](_0x5f07d8[_0x7cb6('0xa3')](),_0x26acbf)[_0x7cb6('0x2f')](function(_0xedeab1){var _0x423997=_['groupBy'](_0xedeab1,'FaxInteractionId');var _0x3cb221=[];_0x379bf5['forEach'](function(_0x5e9674){_0x3cb221[_0x7cb6('0xbd')](updateFaxInteraction(_0x5e9674,_0x49164d,_0x423997));});return BPromise[_0x7cb6('0xbe')](_0x3cb221);});});})['then'](function(_0x302443){_0x53acdc[_0x7cb6('0xbf')]=_0x302443;return _0x53acdc;})[_0x7cb6('0x2f')](respondWithFilteredResult(_0x2c6059,_0x34cdad))[_0x7cb6('0x38')](handleError(_0x2c6059,null));};exports[_0x7cb6('0xc0')]=function(_0x3211a3,_0x40537c){var _0x5dc7f0={'raw':![],'where':{'id':_0x3211a3[_0x7cb6('0xc1')]['id']}},_0x52a065={};_0x52a065[_0x7cb6('0x43')]=_[_0x7cb6('0x45')](db[_0x7cb6('0xa7')][_0x7cb6('0x40')]);_0x52a065[_0x7cb6('0x44')]=_['keys'](_0x3211a3[_0x7cb6('0x44')]);_0x52a065[_0x7cb6('0x46')]=_[_0x7cb6('0x47')](_0x52a065['model'],_0x52a065[_0x7cb6('0x44')]);_0x5dc7f0[_0x7cb6('0x48')]=_['intersection'](_0x52a065['model'],qs[_0x7cb6('0x49')](_0x3211a3[_0x7cb6('0x44')]['fields']));_0x5dc7f0[_0x7cb6('0x48')]=_0x5dc7f0['attributes']['length']?_0x5dc7f0[_0x7cb6('0x48')]:_0x52a065[_0x7cb6('0x43')];if(_0x3211a3[_0x7cb6('0x44')][_0x7cb6('0xc2')]){_0x5dc7f0[_0x7cb6('0xc3')]=[{'all':!![]}];}_0x5dc7f0=_[_0x7cb6('0xa6')]({},_0x5dc7f0,_0x3211a3['options']);return db['FaxInteraction'][_0x7cb6('0x69')](_0x5dc7f0)['then'](handleEntityNotFound(_0x40537c,null))[_0x7cb6('0x2f')](respondWithResult(_0x40537c,null))[_0x7cb6('0x38')](handleError(_0x40537c,null));};exports[_0x7cb6('0xc4')]=function(_0x50f040,_0x2f314e){return db[_0x7cb6('0xa7')][_0x7cb6('0xc4')](_0x50f040['body'],{})[_0x7cb6('0x2f')](respondWithResult(_0x2f314e,0xc9))['catch'](handleError(_0x2f314e,null));};exports[_0x7cb6('0x2d')]=function(_0x5f18b7,_0x4b38d8){if(_0x5f18b7[_0x7cb6('0x7c')]['id']){delete _0x5f18b7[_0x7cb6('0x7c')]['id'];}return db['FaxInteraction']['find']({'where':{'id':_0x5f18b7[_0x7cb6('0xc1')]['id']}})[_0x7cb6('0x2f')](handleEntityNotFound(_0x4b38d8,null))['then'](saveUpdates(_0x5f18b7['body'],null))['then'](respondWithResult(_0x4b38d8,null))[_0x7cb6('0x38')](handleError(_0x4b38d8,null));};exports['destroy']=function(_0x5107a8,_0x477c59){return db[_0x7cb6('0xa7')][_0x7cb6('0x69')]({'where':{'id':_0x5107a8[_0x7cb6('0xc1')]['id']}})[_0x7cb6('0x2f')](handleEntityNotFound(_0x477c59,null))['then'](removeEntity(_0x477c59,null))[_0x7cb6('0x38')](handleError(_0x477c59,null));};exports[_0x7cb6('0xc5')]=function(_0x130600,_0x2bb3f9){return db[_0x7cb6('0xa7')][_0x7cb6('0xc5')]()['then'](respondWithResult(_0x2bb3f9,null))['catch'](handleError(_0x2bb3f9,null));};exports['addMessage']=function(_0x581ab5,_0x4a3759,_0x3fda07){return db[_0x7cb6('0xc6')][_0x7cb6('0x69')]({'where':{'id':_0x581ab5[_0x7cb6('0xc1')]['id']}})[_0x7cb6('0x2f')](handleEntityNotFound(_0x4a3759,null))[_0x7cb6('0x2f')](function(_0x2edc31){if(_0x2edc31){return _0x2edc31['addMessage'](_0x581ab5['body'][_0x7cb6('0xc7')],_[_0x7cb6('0xc8')](_0x581ab5[_0x7cb6('0x7c')],[_0x7cb6('0xc7'),'id'])||{});}})['then'](respondWithResult(_0x4a3759,null))[_0x7cb6('0x38')](handleError(_0x4a3759,null));};exports[_0x7cb6('0xc9')]=function(_0xd797c1,_0x15b8ff,_0x174e1b){var _0x3e9df3={'raw':![],'where':{}};var _0x225feb={};var _0x4549f8={'count':0x0,'rows':[]};return db[_0x7cb6('0xa7')][_0x7cb6('0xca')]({'where':{'id':_0xd797c1[_0x7cb6('0xc1')]['id']}})['then'](handleEntityNotFound(_0x15b8ff,null))['then'](function(_0xf18dd8){if(_0xf18dd8){_0x225feb[_0x7cb6('0x43')]=_[_0x7cb6('0x45')](db['FaxMessage'][_0x7cb6('0x40')]);_0x225feb[_0x7cb6('0x44')]=_[_0x7cb6('0x45')](_0xd797c1['query']);_0x225feb[_0x7cb6('0x46')]=_[_0x7cb6('0x47')](_0x225feb[_0x7cb6('0x43')],_0x225feb[_0x7cb6('0x44')]);_0x3e9df3[_0x7cb6('0x48')]=_[_0x7cb6('0x47')](_0x225feb[_0x7cb6('0x43')],qs[_0x7cb6('0x49')](_0xd797c1['query'][_0x7cb6('0x49')]));_0x3e9df3[_0x7cb6('0x48')]=_0x3e9df3[_0x7cb6('0x48')][_0x7cb6('0x68')]?_0x3e9df3[_0x7cb6('0x48')]:_0x225feb['model'];if(!_0xd797c1['query'][_0x7cb6('0x4a')](_0x7cb6('0x4b'))){_0x3e9df3[_0x7cb6('0x26')]=qs[_0x7cb6('0x26')](_0xd797c1[_0x7cb6('0x44')][_0x7cb6('0x26')]);_0x3e9df3[_0x7cb6('0x25')]=qs[_0x7cb6('0x25')](_0xd797c1['query'][_0x7cb6('0x25')]);}_0x3e9df3['order']=qs[_0x7cb6('0x4d')](_0xd797c1['query']['sort']);_0x3e9df3['where']=qs['filters'](_[_0x7cb6('0x4f')](_0xd797c1[_0x7cb6('0x44')],_0x225feb[_0x7cb6('0x46')]));_0x3e9df3[_0x7cb6('0x4e')][_0x7cb6('0xcb')]=_0xf18dd8['id'];if(_0xd797c1[_0x7cb6('0x44')]['filter']){_0x3e9df3[_0x7cb6('0x4e')]=_[_0x7cb6('0xa6')](_0x3e9df3['where'],{'$or':_[_0x7cb6('0x34')](_0x3e9df3[_0x7cb6('0x48')],function(_0x41eec6){var _0x1301d9={};_0x1301d9[_0x41eec6]={'$like':'%'+_0xd797c1[_0x7cb6('0x44')][_0x7cb6('0x8e')]+'%'};return _0x1301d9;})});}if(_0xd797c1['query'][_0x7cb6('0x84')]){var _0x17a1a6=_0xd797c1[_0x7cb6('0x44')][_0x7cb6('0x84')][_0x7cb6('0x70')](',');var _0x2af92c={};_0x2af92c[_0x17a1a6[0x0]]={'$gte':moment(_0x17a1a6[0x1])['format'](_0x7cb6('0xcc'))};_0x3e9df3[_0x7cb6('0x4e')]=_[_0x7cb6('0xa6')](_0x3e9df3[_0x7cb6('0x4e')],_0x2af92c);}_0x3e9df3=_[_0x7cb6('0xa6')]({},_0x3e9df3,_0xd797c1['options']);return db[_0x7cb6('0xc6')]['count']({'where':_0x3e9df3[_0x7cb6('0x4e')]})[_0x7cb6('0x2f')](function(_0x584a6c){_0x4549f8[_0x7cb6('0x28')]=_0x584a6c;if(_0xd797c1[_0x7cb6('0x44')][_0x7cb6('0xc2')]){_0x3e9df3[_0x7cb6('0xc3')]=[{'all':!![]}];}return db[_0x7cb6('0xc6')][_0x7cb6('0xcd')](_0x3e9df3);})[_0x7cb6('0x2f')](function(_0x10ca34){_0x4549f8['rows']=_0x10ca34;return _0x4549f8;});}})[_0x7cb6('0x2f')](respondWithFilteredResult(_0x15b8ff,_0x3e9df3))[_0x7cb6('0x38')](handleError(_0x15b8ff,null));};exports[_0x7cb6('0xce')]=function(_0x219e37,_0x35afa9,_0x449954){return db[_0x7cb6('0xa7')][_0x7cb6('0x69')]({'where':{'id':_0x219e37[_0x7cb6('0xc1')]['id']}})['then'](handleEntityNotFound(_0x35afa9,null))[_0x7cb6('0x2f')](function(_0x59d4d6){if(_0x59d4d6){return _0x59d4d6[_0x7cb6('0xcf')](_0x219e37['body'][_0x7cb6('0xc7')],_[_0x7cb6('0xc8')](_0x219e37[_0x7cb6('0x7c')],[_0x7cb6('0xc7'),'id'])||{})['spread'](function(){return db['Tag'][_0x7cb6('0xcd')]({'attributes':['id',_0x7cb6('0x32'),_0x7cb6('0xd0')],'where':{'id':_0x219e37[_0x7cb6('0x7c')][_0x7cb6('0xc7')]}});})[_0x7cb6('0x2f')](function(_0x1811dd){socket[_0x7cb6('0xd1')](_0x7cb6('0xd2'),{'id':Number(_0x219e37[_0x7cb6('0xc1')]['id']),'tags':_0x1811dd||[]});return{'id':Number(_0x219e37['params']['id']),'tags':_0x1811dd||[]};});}})['then'](respondWithResult(_0x35afa9,null))['catch'](handleError(_0x35afa9,null));};exports['removeTags']=function(_0x1e5a1a,_0x18c310,_0x159f1b){return db['FaxInteraction'][_0x7cb6('0x69')]({'where':{'id':_0x1e5a1a[_0x7cb6('0xc1')]['id']}})['then'](handleEntityNotFound(_0x18c310,null))[_0x7cb6('0x2f')](function(_0x434b2b){if(_0x434b2b){return _0x434b2b[_0x7cb6('0xd3')](_0x1e5a1a[_0x7cb6('0x44')][_0x7cb6('0xc7')]);}})[_0x7cb6('0x2f')](respondWithStatusCode(_0x18c310,null))[_0x7cb6('0x38')](handleError(_0x18c310,null));};exports[_0x7cb6('0xd4')]=function(_0x158a6a,_0x2b90bd){var _0x324ae0=moment()[_0x7cb6('0xd5')]()['toString']();var _0x414c62=path[_0x7cb6('0xd6')](config[_0x7cb6('0xd7')],_0x7cb6('0xd8'),'files','tmp');var _0x5416fc=path[_0x7cb6('0xd6')](config[_0x7cb6('0xd7')],'server',_0x7cb6('0xd9'),'attachments');var _0x56c656=path['join'](_0x414c62,_0x324ae0);var _0x6b88e4=util['format']('transcript-%d-%s.zip',_0x158a6a['params']['id'],_0x324ae0);var _0x218767=path[_0x7cb6('0xd6')](_0x414c62,_0x6b88e4);var _0x25cdeb=[];_0x25cdeb['push']({'model':db[_0x7cb6('0xda')],'as':_0x7cb6('0xda'),'raw':!![]});var _0x27c6b1=[{'model':db['FaxMessage'],'as':_0x7cb6('0xdb'),'attributes':['id',_0x7cb6('0x7c'),_0x7cb6('0x83')],'include':_0x25cdeb}];return db[_0x7cb6('0xa7')][_0x7cb6('0x69')]({'where':{'id':_0x158a6a['params']['id']},'include':_0x27c6b1})[_0x7cb6('0x2f')](handleEntityNotFound(_0x2b90bd,null))[_0x7cb6('0x2f')](function(_0x19ed19){if(_0x19ed19&&_0x19ed19[_0x7cb6('0xdb')]){var _0x23da61=_0x19ed19['get']({'plain':!![]});fs[_0x7cb6('0xdc')](_0x56c656);for(var _0x481c18=0x0;_0x481c18<_0x23da61[_0x7cb6('0xdb')][_0x7cb6('0x68')];_0x481c18++){var _0x1d527d=_0x23da61['Messages'][_0x481c18]['Attachment'];if(_0x1d527d){var _0x41a134=path[_0x7cb6('0xd6')](_0x5416fc,_0x1d527d[_0x7cb6('0xdd')]);if(fs[_0x7cb6('0xde')](_0x41a134)){fs['createReadStream'](_0x41a134)['pipe'](fs[_0x7cb6('0xdf')](path[_0x7cb6('0xd6')](_0x56c656,_0x1d527d[_0x7cb6('0xdd')])));}}}return BPromise['resolve']()[_0x7cb6('0x2f')](function(){return new BPromise(function(_0x56944b,_0x29b953){zipdir(_0x56c656,{'saveTo':_0x218767},function(_0x7247ec,_0x56bba7){if(_0x7247ec)return _0x29b953(_0x7247ec);return _0x56944b(_0x56bba7);});})['then'](function(){return new BPromise(function(_0x1b7b34,_0x16366a){rimraf(_0x56c656,function(_0x46326d){if(_0x46326d)_0x16366a(_0x46326d);return _0x1b7b34();});});})[_0x7cb6('0x2f')](function(){return _0x2b90bd[_0x7cb6('0xd4')](_0x218767,_0x6b88e4,function(_0x47c5b3){if(_0x47c5b3){console[_0x7cb6('0xe0')](_0x7cb6('0xe1'),_0x47c5b3);}else{fs['unlinkSync'](_0x218767);}});});});}else{return _0x2b90bd['sendStatus'](0xc8);}})['catch'](handleError(_0x2b90bd,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index f2253ec..1228648 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 _0xc1fc=['save','update','getUsers','then','setDataValue','Users','map','unreadMessages','length','catch','events','../../mysqldb','FaxMessage','setMaxListeners'];(function(_0x43e511,_0x3fb744){var _0x584864=function(_0x58f34f){while(--_0x58f34f){_0x43e511['push'](_0x43e511['shift']());}};_0x584864(++_0x3fb744);}(_0xc1fc,0x192));var _0xcc1f=function(_0x28b8b,_0x22c065){_0x28b8b=_0x28b8b-0x0;var _0x19b324=_0xc1fc[_0x28b8b];return _0x19b324;};'use strict';var EventEmitter=require(_0xcc1f('0x0'));var FaxInteraction=require(_0xcc1f('0x1'))['db']['FaxInteraction'];var FaxMessage=require(_0xcc1f('0x1'))['db'][_0xcc1f('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xcc1f('0x3')](0x0);var events={'afterCreate':_0xcc1f('0x4'),'afterUpdate':_0xcc1f('0x5'),'afterDestroy':'remove'};function emitEvent(_0x531008){return function(_0x1b89d1,_0x53adaa,_0x292990){_0x1b89d1[_0xcc1f('0x6')]({'attributes':['id'],'raw':!![]})[_0xcc1f('0x7')](function(_0x55f104){_0x1b89d1[_0xcc1f('0x8')](_0xcc1f('0x9'),_0x55f104[_0xcc1f('0xa')](function(_0xa082fc){return{'id':_0xa082fc['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x1b89d1['id'],'direction':'in','read':![]},'raw':!![]});})[_0xcc1f('0x7')](function(_0x745d9a){_0x1b89d1[_0xcc1f('0x8')](_0xcc1f('0xb'),_0x745d9a[_0xcc1f('0xc')]);FaxInteractionEvents['emit'](_0x531008+':'+_0x1b89d1['id'],_0x1b89d1);FaxInteractionEvents['emit'](_0x531008,_0x1b89d1);_0x292990(null);})[_0xcc1f('0xd')](_0x292990(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file +var _0xdc70=['setMaxListeners','save','update','setDataValue','map','unreadMessages','emit','catch','hook','events','../../mysqldb','FaxMessage'];(function(_0x401e55,_0x40b763){var _0x35cf2b=function(_0x53cfb3){while(--_0x53cfb3){_0x401e55['push'](_0x401e55['shift']());}};_0x35cf2b(++_0x40b763);}(_0xdc70,0x141));var _0x0dc7=function(_0x34f79f,_0x55fa90){_0x34f79f=_0x34f79f-0x0;var _0xa386c0=_0xdc70[_0x34f79f];return _0xa386c0;};'use strict';var EventEmitter=require(_0x0dc7('0x0'));var FaxInteraction=require(_0x0dc7('0x1'))['db']['FaxInteraction'];var FaxMessage=require(_0x0dc7('0x1'))['db'][_0x0dc7('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x0dc7('0x3')](0x0);var events={'afterCreate':_0x0dc7('0x4'),'afterUpdate':_0x0dc7('0x5'),'afterDestroy':'remove'};function emitEvent(_0x309ac7){return function(_0x563007,_0x433eb7,_0x5b466f){_0x563007['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x7d6e7c){_0x563007[_0x0dc7('0x6')]('Users',_0x7d6e7c[_0x0dc7('0x7')](function(_0x35ab39){return{'id':_0x35ab39['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x563007['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x124c2f){_0x563007['setDataValue'](_0x0dc7('0x8'),_0x124c2f['length']);FaxInteractionEvents['emit'](_0x309ac7+':'+_0x563007['id'],_0x563007);FaxInteractionEvents[_0x0dc7('0x9')](_0x309ac7,_0x563007);_0x5b466f(null);})[_0x0dc7('0xa')](_0x5b466f(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0x0dc7('0xb')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index c6f85b4..0da2ce3 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 _0x45c2=['FaxInteraction','fax_interactions','changed','closed','closedAt','format','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./faxInteraction.attributes','exports','define'];(function(_0x4ed17b,_0x2b1745){var _0x24b248=function(_0x136ab1){while(--_0x136ab1){_0x4ed17b['push'](_0x4ed17b['shift']());}};_0x24b248(++_0x2b1745);}(_0x45c2,0x1af));var _0x245c=function(_0x4defd6,_0x37bbd3){_0x4defd6=_0x4defd6-0x0;var _0x4c9276=_0x45c2[_0x4defd6];return _0x4c9276;};'use strict';var _=require(_0x245c('0x0'));var util=require(_0x245c('0x1'));var logger=require(_0x245c('0x2'))(_0x245c('0x3'));var moment=require(_0x245c('0x4'));var BPromise=require('bluebird');var rp=require(_0x245c('0x5'));var fs=require('fs');var path=require(_0x245c('0x6'));var rimraf=require(_0x245c('0x7'));var config=require('../../config/environment');var attributes=require(_0x245c('0x8'));module[_0x245c('0x9')]=function(_0x6d6a5e,_0x58d5b3){return _0x6d6a5e[_0x245c('0xa')](_0x245c('0xb'),attributes,{'tableName':_0x245c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x27c30a,_0x1ca0d6,_0x1d1bb1){if(_0x27c30a[_0x245c('0xd')](_0x245c('0xe'))){_0x27c30a[_0x245c('0xf')]=moment()[_0x245c('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1d1bb1(null,_0x27c30a);}}});}; \ No newline at end of file +var _0xa5ab=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa5ab,0xca));var _0xba5a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa5ab[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xba5a('0x0'));var util=require(_0xba5a('0x1'));var logger=require(_0xba5a('0x2'))('api');var moment=require(_0xba5a('0x3'));var BPromise=require('bluebird');var rp=require(_0xba5a('0x4'));var fs=require('fs');var path=require(_0xba5a('0x5'));var rimraf=require(_0xba5a('0x6'));var config=require(_0xba5a('0x7'));var attributes=require(_0xba5a('0x8'));module[_0xba5a('0x9')]=function(_0x4ffeea,_0x22c2b7){return _0x4ffeea[_0xba5a('0xa')](_0xba5a('0xb'),attributes,{'tableName':_0xba5a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x18102f,_0x10e5e2,_0x360bff){if(_0x18102f[_0xba5a('0xd')](_0xba5a('0xe'))){_0x18102f[_0xba5a('0xf')]=moment()[_0xba5a('0x10')](_0xba5a('0x11'));}_0x360bff(null,_0x18102f);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index a7ced3d..25457a6 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 _0x1e1f=['client','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','then','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','UpdateFaxInteraction','FaxInteraction','update','body','options','where','attributes','limit','info','catch','AddTagsToFaxInteraction','addTags','omit','ids','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise'];(function(_0x476463,_0x10d3c6){var _0x47abf3=function(_0x4fb53c){while(--_0x4fb53c){_0x476463['push'](_0x476463['shift']());}};_0x47abf3(++_0x10d3c6);}(_0x1e1f,0xf9));var _0xf1e1=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x1e1f[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xf1e1('0x0'));var util=require(_0xf1e1('0x1'));var moment=require(_0xf1e1('0x2'));var BPromise=require(_0xf1e1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf1e1('0x4'));var db=require(_0xf1e1('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf1e1('0x6'));var config=require(_0xf1e1('0x7'));var jayson=require(_0xf1e1('0x8'));var client=jayson[_0xf1e1('0x9')][_0xf1e1('0xa')]({'port':0x232a});config[_0xf1e1('0xb')]=_[_0xf1e1('0xc')](config[_0xf1e1('0xb')],{'host':_0xf1e1('0xd'),'port':0x18eb});var socket=require(_0xf1e1('0xe'))(new Redis(config[_0xf1e1('0xb')]));require(_0xf1e1('0xf'))[_0xf1e1('0x10')](socket);function respondWithRpcPromise(_0x5ab920,_0x5b0ff9,_0x25ec6e){return new BPromise(function(_0x5cff25,_0x242197){return client['request'](_0x5ab920,_0x25ec6e)[_0xf1e1('0x11')](function(_0x1cde97){logger['info'](_0xf1e1('0x12'),_0x5b0ff9,'request\x20sent');logger[_0xf1e1('0x13')](_0xf1e1('0x14'),_0x5b0ff9,_0xf1e1('0x15'),JSON[_0xf1e1('0x16')](_0x1cde97));if(_0x1cde97[_0xf1e1('0x17')]){if(_0x1cde97[_0xf1e1('0x17')][_0xf1e1('0x18')]===0x1f4){logger['error'](_0xf1e1('0x12'),_0x5b0ff9,_0x1cde97[_0xf1e1('0x17')][_0xf1e1('0x19')]);return _0x242197(_0x1cde97[_0xf1e1('0x17')]['message']);}logger[_0xf1e1('0x17')](_0xf1e1('0x12'),_0x5b0ff9,_0x1cde97[_0xf1e1('0x17')][_0xf1e1('0x19')]);return _0x5cff25(_0x1cde97[_0xf1e1('0x17')][_0xf1e1('0x19')]);}else{logger['info']('FaxInteraction,\x20%s,\x20%s',_0x5b0ff9,_0xf1e1('0x15'));_0x5cff25(_0x1cde97[_0xf1e1('0x1a')][_0xf1e1('0x19')]);}})['catch'](function(_0x3ea299){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x5b0ff9,_0x3ea299);_0x242197(_0x3ea299);});});}exports[_0xf1e1('0x1b')]=function(_0x4dc6c9){var _0x3d8aa0=this;return new Promise(function(_0x463f2d,_0x3fadb7){return db[_0xf1e1('0x1c')][_0xf1e1('0x1d')](_0x4dc6c9[_0xf1e1('0x1e')],{'raw':_0x4dc6c9[_0xf1e1('0x1f')]?_0x4dc6c9[_0xf1e1('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4dc6c9[_0xf1e1('0x1f')]?_0x4dc6c9[_0xf1e1('0x1f')][_0xf1e1('0x20')]||null:null,'attributes':_0x4dc6c9[_0xf1e1('0x1f')]?_0x4dc6c9[_0xf1e1('0x1f')][_0xf1e1('0x21')]||null:null,'limit':_0x4dc6c9[_0xf1e1('0x1f')]?_0x4dc6c9[_0xf1e1('0x1f')][_0xf1e1('0x22')]||null:null})[_0xf1e1('0x11')](function(_0x29c1c5){logger[_0xf1e1('0x23')](_0xf1e1('0x1b'),_0x4dc6c9);logger[_0xf1e1('0x13')](_0xf1e1('0x1b'),_0x4dc6c9,JSON[_0xf1e1('0x16')](_0x29c1c5));_0x463f2d(_0x29c1c5);})[_0xf1e1('0x24')](function(_0x18bb42){logger['error']('UpdateFaxInteraction',_0x18bb42['message'],_0x4dc6c9);_0x3fadb7(_0x3d8aa0[_0xf1e1('0x17')](0x1f4,_0x18bb42[_0xf1e1('0x19')]));});});};exports[_0xf1e1('0x25')]=function(_0x16839e){return new Promise(function(_0x7e5ab2,_0x5b18d4){return db[_0xf1e1('0x1c')]['find']({'where':_0x16839e[_0xf1e1('0x1f')]?_0x16839e[_0xf1e1('0x1f')]['where']||null:null})['then'](function(_0x149199){if(_0x149199){return _0x149199[_0xf1e1('0x26')](_0x16839e[_0xf1e1('0x1e')]['ids'],_[_0xf1e1('0x27')](_0x16839e[_0xf1e1('0x1e')],[_0xf1e1('0x28'),'id'])||{});}})[_0xf1e1('0x29')](function(_0x404c10){logger[_0xf1e1('0x23')](_0xf1e1('0x2a'),_0x16839e);logger[_0xf1e1('0x13')]('AddTags',_0x16839e,JSON[_0xf1e1('0x16')](_0x404c10));_0x7e5ab2(_0x404c10);})[_0xf1e1('0x24')](function(_0xb3a051){logger['error'](_0xf1e1('0x2a'),_0xb3a051[_0xf1e1('0x19')],_0x16839e);_0x5b18d4(_this['error'](0x1f4,_0xb3a051['message']));});});}; \ No newline at end of file +var _0xf7e6=['AddTagsToFaxInteraction','find','body','ids','omit','AddTags','debug','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','FaxInteraction,\x20%s,\x20%s','message','request\x20sent','result','catch','UpdateFaxInteraction','FaxInteraction','options','raw','where','attributes','limit','stringify'];(function(_0xfcd66c,_0x26d34d){var _0x434b11=function(_0x5016d3){while(--_0x5016d3){_0xfcd66c['push'](_0xfcd66c['shift']());}};_0x434b11(++_0x26d34d);}(_0xf7e6,0x181));var _0x6f7e=function(_0x6a8e16,_0x322fcb){_0x6a8e16=_0x6a8e16-0x0;var _0x12e0b6=_0xf7e6[_0x6a8e16];return _0x12e0b6;};'use strict';var _=require(_0x6f7e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6f7e('0x1'));var rs=require(_0x6f7e('0x2'));var fs=require('fs');var Redis=require(_0x6f7e('0x3'));var db=require(_0x6f7e('0x4'))['db'];var utils=require(_0x6f7e('0x5'));var logger=require('../../config/logger')(_0x6f7e('0x6'));var config=require('../../config/environment');var jayson=require(_0x6f7e('0x7'));var client=jayson[_0x6f7e('0x8')][_0x6f7e('0x9')]({'port':0x232a});config[_0x6f7e('0xa')]=_[_0x6f7e('0xb')](config[_0x6f7e('0xa')],{'host':_0x6f7e('0xc'),'port':0x18eb});var socket=require(_0x6f7e('0xd'))(new Redis(config[_0x6f7e('0xa')]));require(_0x6f7e('0xe'))[_0x6f7e('0xf')](socket);function respondWithRpcPromise(_0x6a9ba3,_0x574991,_0x502cc3){return new BPromise(function(_0x3c7e17,_0x3254e9){return client[_0x6f7e('0x10')](_0x6a9ba3,_0x502cc3)[_0x6f7e('0x11')](function(_0x4093bc){logger[_0x6f7e('0x12')]('FaxInteraction,\x20%s,\x20%s',_0x574991,'request\x20sent');logger['debug'](_0x6f7e('0x13'),_0x574991,'request\x20sent',JSON['stringify'](_0x4093bc));if(_0x4093bc[_0x6f7e('0x14')]){if(_0x4093bc['error'][_0x6f7e('0x15')]===0x1f4){logger[_0x6f7e('0x14')](_0x6f7e('0x16'),_0x574991,_0x4093bc[_0x6f7e('0x14')][_0x6f7e('0x17')]);return _0x3254e9(_0x4093bc[_0x6f7e('0x14')][_0x6f7e('0x17')]);}logger[_0x6f7e('0x14')](_0x6f7e('0x16'),_0x574991,_0x4093bc[_0x6f7e('0x14')][_0x6f7e('0x17')]);return _0x3c7e17(_0x4093bc[_0x6f7e('0x14')][_0x6f7e('0x17')]);}else{logger[_0x6f7e('0x12')](_0x6f7e('0x16'),_0x574991,_0x6f7e('0x18'));_0x3c7e17(_0x4093bc[_0x6f7e('0x19')]['message']);}})[_0x6f7e('0x1a')](function(_0x19cf25){logger[_0x6f7e('0x14')](_0x6f7e('0x16'),_0x574991,_0x19cf25);_0x3254e9(_0x19cf25);});});}exports[_0x6f7e('0x1b')]=function(_0x1dc6ce){var _0x59ca71=this;return new Promise(function(_0x79e7e,_0x8a9cc0){return db[_0x6f7e('0x1c')]['update'](_0x1dc6ce['body'],{'raw':_0x1dc6ce[_0x6f7e('0x1d')]?_0x1dc6ce[_0x6f7e('0x1d')][_0x6f7e('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1dc6ce['options']?_0x1dc6ce[_0x6f7e('0x1d')][_0x6f7e('0x1f')]||null:null,'attributes':_0x1dc6ce[_0x6f7e('0x1d')]?_0x1dc6ce['options'][_0x6f7e('0x20')]||null:null,'limit':_0x1dc6ce[_0x6f7e('0x1d')]?_0x1dc6ce[_0x6f7e('0x1d')][_0x6f7e('0x21')]||null:null})[_0x6f7e('0x11')](function(_0x343810){logger[_0x6f7e('0x12')]('UpdateFaxInteraction',_0x1dc6ce);logger['debug']('UpdateFaxInteraction',_0x1dc6ce,JSON[_0x6f7e('0x22')](_0x343810));_0x79e7e(_0x343810);})['catch'](function(_0x50be1a){logger[_0x6f7e('0x14')](_0x6f7e('0x1b'),_0x50be1a[_0x6f7e('0x17')],_0x1dc6ce);_0x8a9cc0(_0x59ca71[_0x6f7e('0x14')](0x1f4,_0x50be1a[_0x6f7e('0x17')]));});});};exports[_0x6f7e('0x23')]=function(_0x351f1c){return new Promise(function(_0x350150,_0x31cb7d){return db[_0x6f7e('0x1c')][_0x6f7e('0x24')]({'where':_0x351f1c[_0x6f7e('0x1d')]?_0x351f1c['options'][_0x6f7e('0x1f')]||null:null})[_0x6f7e('0x11')](function(_0x3bc71e){if(_0x3bc71e){return _0x3bc71e['addTags'](_0x351f1c[_0x6f7e('0x25')][_0x6f7e('0x26')],_[_0x6f7e('0x27')](_0x351f1c['body'],[_0x6f7e('0x26'),'id'])||{});}})['spread'](function(_0x7737ea){logger[_0x6f7e('0x12')](_0x6f7e('0x28'),_0x351f1c);logger[_0x6f7e('0x29')](_0x6f7e('0x28'),_0x351f1c,JSON[_0x6f7e('0x22')](_0x7737ea));_0x350150(_0x7737ea);})['catch'](function(_0x315c5e){logger['error']('AddTags',_0x315c5e[_0x6f7e('0x17')],_0x351f1c);_0x31cb7d(_this['error'](0x1f4,_0x315c5e['message']));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 3c001b7..3fe88d2 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 _0x19fc=['faxInteraction:','save','remove','update','emit','removeListener','register','length'];(function(_0xde524,_0x79b09f){var _0x3ffc46=function(_0x532701){while(--_0x532701){_0xde524['push'](_0xde524['shift']());}};_0x3ffc46(++_0x79b09f);}(_0x19fc,0x81));var _0xc19f=function(_0x46b0ba,_0x5a767c){_0x46b0ba=_0x46b0ba-0x0;var _0x2e53e0=_0x19fc[_0x46b0ba];return _0x2e53e0;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0xc19f('0x0'),_0xc19f('0x1'),_0xc19f('0x2')];function createListener(_0x1a255d,_0x394239){return function(_0x120bdf){_0x394239[_0xc19f('0x3')](_0x1a255d,_0x120bdf);};}function removeListener(_0x3b9cec,_0x267af4){return function(){FaxInteractionEvents[_0xc19f('0x4')](_0x3b9cec,_0x267af4);};}exports[_0xc19f('0x5')]=function(_0x1f960a){for(var _0x3d69cc=0x0,_0x25ff59=events[_0xc19f('0x6')];_0x3d69cc<_0x25ff59;_0x3d69cc++){var _0x3df456=events[_0x3d69cc];var _0x2a8f13=createListener(_0xc19f('0x7')+_0x3df456,_0x1f960a);FaxInteractionEvents['on'](_0x3df456,_0x2a8f13);}}; \ No newline at end of file +var _0x9307=['emit','removeListener','register','length','faxInteraction:','save'];(function(_0x14027c,_0x4db2d0){var _0x202e44=function(_0x3cba6b){while(--_0x3cba6b){_0x14027c['push'](_0x14027c['shift']());}};_0x202e44(++_0x4db2d0);}(_0x9307,0x1c1));var _0x7930=function(_0x5ba0d7,_0x5c79ce){_0x5ba0d7=_0x5ba0d7-0x0;var _0x2cd45b=_0x9307[_0x5ba0d7];return _0x2cd45b;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x7930('0x0'),'remove','update'];function createListener(_0x1fbae0,_0x4d8cab){return function(_0x194a4d){_0x4d8cab[_0x7930('0x1')](_0x1fbae0,_0x194a4d);};}function removeListener(_0x726c83,_0x7687f3){return function(){FaxInteractionEvents[_0x7930('0x2')](_0x726c83,_0x7687f3);};}exports[_0x7930('0x3')]=function(_0x429b11){for(var _0x16ac67=0x0,_0x459e70=events[_0x7930('0x4')];_0x16ac67<_0x459e70;_0x16ac67++){var _0x39ba3b=events[_0x16ac67];var _0x3d9e10=createListener(_0x7930('0x5')+_0x39ba3b,_0x429b11);FaxInteractionEvents['on'](_0x39ba3b,_0x3d9e10);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 2a86003..63b9b57 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 _0xdc8c=['/:id/tags','tracked','faxinteraction:addtags','addTags','put','fax','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags','exports','multer','util','express','fs-extra','../../components/interaction/service','../../config/environment','./faxInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','show','getMessages','/:id/download','download','post','create','/:id/messages','addMessage'];(function(_0x280d90,_0x5969cb){var _0x29cf7b=function(_0xd8ba1a){while(--_0xd8ba1a){_0x280d90['push'](_0x280d90['shift']());}};_0x29cf7b(++_0x5969cb);}(_0xdc8c,0xd9));var _0xcdc8=function(_0xcb5f76,_0x598348){_0xcb5f76=_0xcb5f76-0x0;var _0x316e00=_0xdc8c[_0xcb5f76];return _0x316e00;};'use strict';var multer=require(_0xcdc8('0x0'));var util=require(_0xcdc8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcdc8('0x2'));var router=express['Router']();var fs_extra=require(_0xcdc8('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xcdc8('0x4'));var config=require(_0xcdc8('0x5'));var controller=require(_0xcdc8('0x6'));router['get']('/',auth[_0xcdc8('0x7')](),controller[_0xcdc8('0x8')]);router[_0xcdc8('0x9')](_0xcdc8('0xa'),auth[_0xcdc8('0x7')](),controller[_0xcdc8('0xb')]);router[_0xcdc8('0x9')](_0xcdc8('0xc'),auth[_0xcdc8('0x7')](),controller[_0xcdc8('0xd')]);router[_0xcdc8('0x9')]('/:id/messages',auth[_0xcdc8('0x7')](),controller[_0xcdc8('0xe')]);router['get'](_0xcdc8('0xf'),auth[_0xcdc8('0x7')](),controller[_0xcdc8('0x10')]);router[_0xcdc8('0x11')]('/',auth[_0xcdc8('0x7')](),controller[_0xcdc8('0x12')]);router[_0xcdc8('0x11')](_0xcdc8('0x13'),auth[_0xcdc8('0x7')](),controller[_0xcdc8('0x14')]);router[_0xcdc8('0x11')](_0xcdc8('0x15'),auth[_0xcdc8('0x7')](),interaction[_0xcdc8('0x16')]('fax',_0xcdc8('0x17')),controller[_0xcdc8('0x18')]);router[_0xcdc8('0x19')](_0xcdc8('0xc'),auth[_0xcdc8('0x7')](),interaction[_0xcdc8('0x16')](_0xcdc8('0x1a'),_0xcdc8('0x1b')),controller[_0xcdc8('0x1c')]);router[_0xcdc8('0x1d')]('/:id',auth[_0xcdc8('0x7')](),interaction[_0xcdc8('0x16')](_0xcdc8('0x1a'),_0xcdc8('0x1e')),controller[_0xcdc8('0x1f')]);router[_0xcdc8('0x1d')](_0xcdc8('0x15'),auth[_0xcdc8('0x7')](),controller[_0xcdc8('0x20')]);module[_0xcdc8('0x21')]=router; \ No newline at end of file +var _0x0784=['faxinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','fax','faxinteraction:addtags','addTags','put','tracked','faxinteraction:update','update'];(function(_0x1147ab,_0x10e72b){var _0x55cb5a=function(_0x364bd6){while(--_0x364bd6){_0x1147ab['push'](_0x1147ab['shift']());}};_0x55cb5a(++_0x10e72b);}(_0x0784,0x1d2));var _0x4078=function(_0x312f26,_0x18dc2e){_0x312f26=_0x312f26-0x0;var _0x5c8791=_0x0784[_0x312f26];return _0x5c8791;};'use strict';var multer=require(_0x4078('0x0'));var util=require(_0x4078('0x1'));var path=require(_0x4078('0x2'));var timeout=require(_0x4078('0x3'));var express=require('express');var router=express[_0x4078('0x4')]();var fs_extra=require(_0x4078('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4078('0x6'));var config=require('../../config/environment');var controller=require(_0x4078('0x7'));router[_0x4078('0x8')]('/',auth[_0x4078('0x9')](),controller[_0x4078('0xa')]);router['get'](_0x4078('0xb'),auth['isAuthenticated'](),controller[_0x4078('0xc')]);router[_0x4078('0x8')](_0x4078('0xd'),auth[_0x4078('0x9')](),controller[_0x4078('0xe')]);router[_0x4078('0x8')]('/:id/messages',auth[_0x4078('0x9')](),controller['getMessages']);router[_0x4078('0x8')](_0x4078('0xf'),auth['isAuthenticated'](),controller[_0x4078('0x10')]);router[_0x4078('0x11')]('/',auth[_0x4078('0x9')](),controller[_0x4078('0x12')]);router['post'](_0x4078('0x13'),auth[_0x4078('0x9')](),controller[_0x4078('0x14')]);router['post'](_0x4078('0x15'),auth[_0x4078('0x9')](),interaction['tracked'](_0x4078('0x16'),_0x4078('0x17')),controller[_0x4078('0x18')]);router[_0x4078('0x19')](_0x4078('0xd'),auth[_0x4078('0x9')](),interaction[_0x4078('0x1a')](_0x4078('0x16'),_0x4078('0x1b')),controller[_0x4078('0x1c')]);router['delete'](_0x4078('0xd'),auth[_0x4078('0x9')](),interaction[_0x4078('0x1a')](_0x4078('0x16'),_0x4078('0x1d')),controller[_0x4078('0x1e')]);router['delete']('/:id/tags',auth[_0x4078('0x9')](),controller[_0x4078('0x1f')]);module[_0x4078('0x20')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 4f66512..7c98869 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 _0x3c7b=['medium','BOOLEAN','DATE','sequelize','exports','TEXT'];(function(_0x4d5cfd,_0x5b5c6c){var _0x442f17=function(_0x32a375){while(--_0x32a375){_0x4d5cfd['push'](_0x4d5cfd['shift']());}};_0x442f17(++_0x5b5c6c);}(_0x3c7b,0x11d));var _0xb3c7=function(_0x1ce9a7,_0x3aef0a){_0x1ce9a7=_0x1ce9a7-0x0;var _0x18590b=_0x3c7b[_0x1ce9a7];return _0x18590b;};'use strict';var Sequelize=require(_0xb3c7('0x0'));module[_0xb3c7('0x1')]={'body':{'type':Sequelize[_0xb3c7('0x2')](_0xb3c7('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xb3c7('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0xb3c7('0x5')]}}; \ No newline at end of file +var _0x4944=['out','sequelize','TEXT','medium','BOOLEAN','ENUM'];(function(_0x33ea46,_0x27da46){var _0x261a12=function(_0x23e9f6){while(--_0x23e9f6){_0x33ea46['push'](_0x33ea46['shift']());}};_0x261a12(++_0x27da46);}(_0x4944,0x6d));var _0x4494=function(_0x12718a,_0x3a339a){_0x12718a=_0x12718a-0x0;var _0x49d55a=_0x4944[_0x12718a];return _0x49d55a;};'use strict';var Sequelize=require(_0x4494('0x0'));module['exports']={'body':{'type':Sequelize[_0x4494('0x1')](_0x4494('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x4494('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4494('0x4')]('in',_0x4494('0x5')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x4494('0x1')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 2229fae..9138f52 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 _0x34f2=['interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','Sequelize','SELECT','contact','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','attachments','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','lodash','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','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','result','catch','end','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','destroy','sendStatus','stack','name','send','FaxMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','limit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','findAll','rows','show','params','include','find','update','body','describe','fax-interactions','accept','fax','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','isNil','read1stAt'];(function(_0x1b713d,_0x3cdbb6){var _0x4a2b2f=function(_0x1b844f){while(--_0x1b844f){_0x1b713d['push'](_0x1b713d['shift']());}};_0x4a2b2f(++_0x3cdbb6);}(_0x34f2,0x146));var _0x234f=function(_0x695b89,_0x24291f){_0x695b89=_0x695b89-0x0;var _0x232640=_0x34f2[_0x695b89];return _0x232640;};'use strict';var emlformat=require(_0x234f('0x0'));var rimraf=require(_0x234f('0x1'));var zipdir=require(_0x234f('0x2'));var jsonpatch=require(_0x234f('0x3'));var rp=require(_0x234f('0x4'));var moment=require(_0x234f('0x5'));var BPromise=require(_0x234f('0x6'));var Mustache=require(_0x234f('0x7'));var util=require('util');var path=require(_0x234f('0x8'));var sox=require(_0x234f('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x234f('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x234f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x234f('0xc'));var querystring=require('querystring');var Papa=require(_0x234f('0xd'));var Redis=require(_0x234f('0xe'));var authService=require(_0x234f('0xf'));var qs=require(_0x234f('0x10'));var as=require(_0x234f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x234f('0x12'))(_0x234f('0x13'));var utils=require(_0x234f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x234f('0x15'));var db=require(_0x234f('0x16'))['db'];config[_0x234f('0x17')]=_['defaults'](config[_0x234f('0x17')],{'host':_0x234f('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x234f('0x17')]));require('./faxMessage.socket')[_0x234f('0x19')](socket);var jayson=require(_0x234f('0x1a'));var client=jayson[_0x234f('0x1b')][_0x234f('0x1c')]({'port':0x232c});var client9002=jayson[_0x234f('0x1b')][_0x234f('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x4b2d46,_0x28b9e0,_0x1412a5,_0x519b29){return new BPromise(function(_0x1e3160,_0x148e52){var _0x5a5b31=_0x519b29||client;return _0x5a5b31[_0x234f('0x1d')](_0x4b2d46,_0x1412a5)[_0x234f('0x1e')](function(_0x2e9354){logger[_0x234f('0x1f')](_0x234f('0x20'),_0x28b9e0,_0x234f('0x21'));logger['debug'](_0x234f('0x22'),_0x28b9e0,_0x234f('0x21'),JSON[_0x234f('0x23')](_0x2e9354));if(_0x2e9354[_0x234f('0x24')]){if(_0x2e9354[_0x234f('0x24')][_0x234f('0x25')]===0x1f4){logger[_0x234f('0x24')]('FaxMessage,\x20%s,\x20%s',_0x28b9e0,_0x2e9354[_0x234f('0x24')][_0x234f('0x26')]);return _0x148e52(_0x2e9354[_0x234f('0x24')][_0x234f('0x26')]);}logger[_0x234f('0x24')]('FaxMessage,\x20%s,\x20%s',_0x28b9e0,_0x2e9354[_0x234f('0x24')][_0x234f('0x26')]);return _0x1e3160(_0x2e9354['error']['message']);}else{logger[_0x234f('0x1f')](_0x234f('0x20'),_0x28b9e0,_0x234f('0x21'));_0x1e3160(_0x2e9354[_0x234f('0x27')][_0x234f('0x26')]);}})[_0x234f('0x28')](function(_0x5be9e2){logger['error'](_0x234f('0x20'),_0x28b9e0,_0x5be9e2);_0x148e52(_0x5be9e2);});});}function respondWithStatusCode(_0x2437a4,_0x16ad25){_0x16ad25=_0x16ad25||0xcc;return function(_0x12e355){if(_0x12e355){return _0x2437a4['sendStatus'](_0x16ad25);}return _0x2437a4['status'](_0x16ad25)[_0x234f('0x29')]();};}function respondWithResult(_0x230772,_0x2da391){_0x2da391=_0x2da391||0xc8;return function(_0xd43874){if(_0xd43874){return _0x230772[_0x234f('0x2a')](_0x2da391)[_0x234f('0x2b')](_0xd43874);}};}function respondWithFilteredResult(_0x363119,_0x17b095){return function(_0x3eff61){if(_0x3eff61){var _0x535071=typeof _0x17b095[_0x234f('0x2c')]==='undefined'&&typeof _0x17b095['limit']===_0x234f('0x2d');var _0x569ce8=_0x3eff61[_0x234f('0x2e')];var _0x1ed98c=_0x535071?0x0:_0x17b095[_0x234f('0x2c')];var _0x5dd0b9=_0x535071?_0x3eff61[_0x234f('0x2e')]:_0x17b095[_0x234f('0x2c')]+_0x17b095['limit'];var _0x263282;if(_0x5dd0b9>=_0x569ce8){_0x5dd0b9=_0x569ce8;_0x263282=0xc8;}else{_0x263282=0xce;}_0x363119[_0x234f('0x2a')](_0x263282);return _0x363119[_0x234f('0x2f')](_0x234f('0x30'),_0x1ed98c+'-'+_0x5dd0b9+'/'+_0x569ce8)[_0x234f('0x2b')](_0x3eff61);}return null;};}function patchUpdates(_0x5473b0){return function(_0x153a1e){try{jsonpatch[_0x234f('0x31')](_0x153a1e,_0x5473b0,!![]);}catch(_0x9814b4){return BPromise[_0x234f('0x32')](_0x9814b4);}return _0x153a1e[_0x234f('0x33')]();};}function saveUpdates(_0x24ecb2,_0x1b0227){return function(_0x19fa42){if(_0x19fa42){return _0x19fa42['update'](_0x24ecb2)['then'](function(_0x2f1569){return _0x2f1569;});}return null;};}function removeEntity(_0x4a133c,_0x2ff225){return function(_0x5a1568){if(_0x5a1568){return _0x5a1568[_0x234f('0x34')]()[_0x234f('0x1e')](function(){_0x4a133c[_0x234f('0x2a')](0xcc)[_0x234f('0x29')]();});}};}function handleEntityNotFound(_0x58bec3,_0x3383e0){return function(_0x5ddb34){if(!_0x5ddb34){_0x58bec3[_0x234f('0x35')](0x194);}return _0x5ddb34;};}function handleError(_0x5642d6,_0x3d8ec3){_0x3d8ec3=_0x3d8ec3||0x1f4;return function(_0x1b5a94){logger[_0x234f('0x24')](_0x1b5a94[_0x234f('0x36')]);if(_0x1b5a94[_0x234f('0x37')]){delete _0x1b5a94[_0x234f('0x37')];}_0x5642d6['status'](_0x3d8ec3)[_0x234f('0x38')](_0x1b5a94);};}exports['index']=function(_0x462175,_0x46b36a){var _0x5f3f89={},_0x484a19={},_0x37bf2c={'count':0x0,'rows':[]};var _0x5edf22=_['map'](db[_0x234f('0x39')][_0x234f('0x3a')],function(_0x53d704){return{'name':_0x53d704[_0x234f('0x3b')],'type':_0x53d704[_0x234f('0x3c')][_0x234f('0x3d')]};});_0x484a19[_0x234f('0x3e')]=_['map'](_0x5edf22,_0x234f('0x37'));_0x484a19['query']=_[_0x234f('0x3f')](_0x462175[_0x234f('0x40')]);_0x484a19[_0x234f('0x41')]=_[_0x234f('0x42')](_0x484a19[_0x234f('0x3e')],_0x484a19['query']);_0x5f3f89['attributes']=_[_0x234f('0x42')](_0x484a19['model'],qs[_0x234f('0x43')](_0x462175[_0x234f('0x40')]['fields']));_0x5f3f89[_0x234f('0x44')]=_0x5f3f89[_0x234f('0x44')]['length']?_0x5f3f89['attributes']:_0x484a19[_0x234f('0x3e')];if(!_0x462175[_0x234f('0x40')][_0x234f('0x45')]('nolimit')){_0x5f3f89['limit']=qs[_0x234f('0x46')](_0x462175[_0x234f('0x40')][_0x234f('0x46')]);_0x5f3f89[_0x234f('0x2c')]=qs[_0x234f('0x2c')](_0x462175[_0x234f('0x40')][_0x234f('0x2c')]);}_0x5f3f89[_0x234f('0x47')]=qs[_0x234f('0x48')](_0x462175[_0x234f('0x40')][_0x234f('0x48')]);_0x5f3f89[_0x234f('0x49')]=qs['filters'](_[_0x234f('0x4a')](_0x462175[_0x234f('0x40')],_0x484a19[_0x234f('0x41')]),_0x5edf22);if(_0x462175[_0x234f('0x40')][_0x234f('0x4b')]){_0x5f3f89[_0x234f('0x49')]=_[_0x234f('0x4c')](_0x5f3f89[_0x234f('0x49')],{'$or':_[_0x234f('0x4d')](_0x5edf22,function(_0x226eec){if(_0x226eec['type']!==_0x234f('0x4e')){var _0x33ef0d={};_0x33ef0d[_0x226eec[_0x234f('0x37')]]={'$like':'%'+_0x462175[_0x234f('0x40')]['filter']+'%'};return _0x33ef0d;}})});}_0x5f3f89=_['merge']({},_0x5f3f89,_0x462175[_0x234f('0x4f')]);var _0x66df26={'where':_0x5f3f89[_0x234f('0x49')]};return db[_0x234f('0x39')][_0x234f('0x2e')](_0x66df26)[_0x234f('0x1e')](function(_0x101cad){_0x37bf2c['count']=_0x101cad;if(_0x462175['query']['includeAll']){_0x5f3f89['include']=[{'all':!![]}];}return db[_0x234f('0x39')][_0x234f('0x50')](_0x5f3f89);})[_0x234f('0x1e')](function(_0x48410e){_0x37bf2c[_0x234f('0x51')]=_0x48410e;return _0x37bf2c;})[_0x234f('0x1e')](respondWithFilteredResult(_0x46b36a,_0x5f3f89))[_0x234f('0x28')](handleError(_0x46b36a,null));};exports[_0x234f('0x52')]=function(_0xbeea57,_0x44877a){var _0x45fd5f={'raw':!![],'where':{'id':_0xbeea57[_0x234f('0x53')]['id']}},_0x378aaa={};_0x378aaa[_0x234f('0x3e')]=_[_0x234f('0x3f')](db[_0x234f('0x39')][_0x234f('0x3a')]);_0x378aaa[_0x234f('0x40')]=_[_0x234f('0x3f')](_0xbeea57[_0x234f('0x40')]);_0x378aaa[_0x234f('0x41')]=_[_0x234f('0x42')](_0x378aaa[_0x234f('0x3e')],_0x378aaa[_0x234f('0x40')]);_0x45fd5f['attributes']=_[_0x234f('0x42')](_0x378aaa[_0x234f('0x3e')],qs[_0x234f('0x43')](_0xbeea57[_0x234f('0x40')][_0x234f('0x43')]));_0x45fd5f[_0x234f('0x44')]=_0x45fd5f[_0x234f('0x44')]['length']?_0x45fd5f[_0x234f('0x44')]:_0x378aaa[_0x234f('0x3e')];if(_0xbeea57[_0x234f('0x40')]['includeAll']){_0x45fd5f[_0x234f('0x54')]=[{'all':!![]}];}_0x45fd5f=_[_0x234f('0x4c')]({},_0x45fd5f,_0xbeea57[_0x234f('0x4f')]);return db[_0x234f('0x39')][_0x234f('0x55')](_0x45fd5f)[_0x234f('0x1e')](handleEntityNotFound(_0x44877a,null))[_0x234f('0x1e')](respondWithResult(_0x44877a,null))[_0x234f('0x28')](handleError(_0x44877a,null));};exports[_0x234f('0x56')]=function(_0x285211,_0x49938b){if(_0x285211[_0x234f('0x57')]['id']){delete _0x285211['body']['id'];}return db[_0x234f('0x39')][_0x234f('0x55')]({'where':{'id':_0x285211['params']['id']}})[_0x234f('0x1e')](handleEntityNotFound(_0x49938b,null))[_0x234f('0x1e')](saveUpdates(_0x285211[_0x234f('0x57')],null))[_0x234f('0x1e')](respondWithResult(_0x49938b,null))[_0x234f('0x28')](handleError(_0x49938b,null));};exports[_0x234f('0x34')]=function(_0x51b1fa,_0x3aaf8b){return db[_0x234f('0x39')]['find']({'where':{'id':_0x51b1fa[_0x234f('0x53')]['id']}})[_0x234f('0x1e')](handleEntityNotFound(_0x3aaf8b,null))[_0x234f('0x1e')](removeEntity(_0x3aaf8b,null))[_0x234f('0x28')](handleError(_0x3aaf8b,null));};exports['describe']=function(_0x1c1cd0,_0xc0af8){return db[_0x234f('0x39')][_0x234f('0x58')]()['then'](respondWithResult(_0xc0af8,null))[_0x234f('0x28')](handleError(_0xc0af8,null));};var interaction_log=require(_0x234f('0x12'))(_0x234f('0x59'));exports[_0x234f('0x5a')]=function(_0x31f2a1,_0x19d40b,_0xb93db9){var _0x1c9a02={'agent':{},'channel':_0x234f('0x5b')};if(_0x31f2a1['body']['id']){delete _0x31f2a1[_0x234f('0x57')]['id'];}_0x31f2a1[_0x234f('0x57')]['read']=!![];_0x31f2a1[_0x234f('0x57')][_0x234f('0x5c')]=moment()[_0x234f('0x5d')](_0x234f('0x5e'));_0x31f2a1[_0x234f('0x57')][_0x234f('0x5f')]=_0x31f2a1['body']['UserId']||_0x31f2a1['user']['id'];_0x1c9a02[_0x234f('0x60')]['id']=_0x31f2a1[_0x234f('0x57')]['UserId'];return db['FaxMessage'][_0x234f('0x55')]({'where':{'id':_0x31f2a1[_0x234f('0x53')]['id'],'UserId':null}})[_0x234f('0x1e')](handleEntityNotFound(_0x19d40b,null))[_0x234f('0x1e')](saveUpdates(_0x31f2a1['body'],null))[_0x234f('0x1e')](function(_0x1dc43b){if(_0x1dc43b){_0x1c9a02[_0x234f('0x26')]=_0x1dc43b[_0x234f('0x61')]({'plain':!![]});return db['FaxInteraction'][_0x234f('0x55')]({'where':{'id':_0x1dc43b['FaxInteractionId']}});}return null;})[_0x234f('0x1e')](handleEntityNotFound(_0x19d40b,null))['then'](function(_0x12c2a9){if(_0x12c2a9){return _0x12c2a9['update']({'UserId':_0x31f2a1[_0x234f('0x57')][_0x234f('0x5f')],'read1stAt':_[_0x234f('0x62')](_0x12c2a9[_0x234f('0x63')])?moment()['format'](_0x234f('0x5e')):undefined});}return null;})[_0x234f('0x1e')](function(_0x444d34){if(_0x444d34){_0x1c9a02[_0x234f('0x64')]=_0x444d34[_0x234f('0x61')]({'plain':!![]});interaction_log[_0x234f('0x1f')](_0x234f('0x65'),_0x31f2a1[_0x234f('0x66')]['id'],_0x31f2a1['user'][_0x234f('0x37')],_0x31f2a1[_0x234f('0x66')]['role'],_0x1c9a02[_0x234f('0x64')]['id'],_0x31f2a1[_0x234f('0x57')]?JSON[_0x234f('0x23')](_0x31f2a1['body']):_0x234f('0x67'));return respondWithRpcPromise('AcceptMessage',_0x234f('0x68'),_0x1c9a02);}return null;})['then'](function(_0x4232f9){var _0x372340=_0x234f('0x69')+_0x4232f9[_0x234f('0x26')][_0x234f('0x6a')];return db[_0x234f('0x6b')][_0x234f('0x40')](_0x372340,{'type':db['Sequelize'][_0x234f('0x6c')]['SELECT'],'raw':!![]})[_0x234f('0x1e')](function(_0xc60c75){return _0xc60c75;});})[_0x234f('0x1e')](function(_0x186c32){if(_0x186c32){_0x1c9a02[_0x234f('0x26')]['contact']=_0x186c32[0x0];if(!_0x31f2a1[_0x234f('0x57')][_0x234f('0x5f')])return;return db[_0x234f('0x6d')][_0x234f('0x55')]({'where':{'id':_0x31f2a1[_0x234f('0x57')]['UserId'],'role':'agent'},'attributes':['id',_0x234f('0x37'),_0x234f('0x6e'),_0x234f('0x6f'),'internal'],'raw':!![]});}return null;})[_0x234f('0x1e')](function(_0xf603a0){if(!_0xf603a0)return null;_0x1c9a02[_0x234f('0x26')]['agent']=_0xf603a0;return _0x1c9a02;})[_0x234f('0x1e')](function(_0x3dad61){if(_0x3dad61){if(_0x31f2a1[_0x234f('0x57')][_0x234f('0x70')]){_0x1c9a02['message'][_0x234f('0x71')]=util['format'](_0x234f('0x72'),_0x31f2a1['user'][_0x234f('0x37')]);_0x1c9a02['message']['channel']=_0x1c9a02[_0x234f('0x73')];_0x1c9a02[_0x234f('0x26')][_0x234f('0x74')]=_0x1c9a02[_0x234f('0x73')];_0x1c9a02[_0x234f('0x26')][_0x234f('0x75')]=_0x234f('0x5a');return respondWithRpcPromise(_0x234f('0x76'),'EventManager',{'event':_0x234f('0x77'),'message':_0x1c9a02['message']},client9002)[_0x234f('0x1e')](function(){return _0x1c9a02;});}return _0x1c9a02;}return null;})[_0x234f('0x1e')](respondWithResult(_0x19d40b,null))[_0x234f('0x28')](handleError(_0x19d40b,null));};var interaction_log=require(_0x234f('0x12'))('fax-interactions');exports[_0x234f('0x32')]=function(_0x9a7508,_0x3f1417,_0x210a09){var _0x1d53e5={'agent':{},'channel':_0x234f('0x5b')};if(_0x9a7508['body']['id']){delete _0x9a7508[_0x234f('0x57')]['id'];}_0x9a7508[_0x234f('0x57')]['UserId']=_0x9a7508[_0x234f('0x57')][_0x234f('0x5f')]||_0x9a7508[_0x234f('0x66')]['id'];_0x1d53e5[_0x234f('0x60')]['id']=_0x9a7508['body'][_0x234f('0x5f')];return db['FaxMessage'][_0x234f('0x55')]({'where':{'id':_0x9a7508[_0x234f('0x53')]['id'],'UserId':null}})[_0x234f('0x1e')](handleEntityNotFound(_0x3f1417,null))[_0x234f('0x1e')](function(_0x421144){if(_0x421144){_0x1d53e5['message']=_0x421144[_0x234f('0x61')]({'plain':!![]});return db['FaxInteraction'][_0x234f('0x55')]({'where':{'id':_0x421144[_0x234f('0x78')]}});}return null;})[_0x234f('0x1e')](handleEntityNotFound(_0x3f1417,null))['then'](function(_0xcac7ec){if(_0xcac7ec){_0x1d53e5[_0x234f('0x64')]=_0xcac7ec['get']({'plain':!![]});interaction_log[_0x234f('0x1f')](_0x234f('0x79'),_0x9a7508[_0x234f('0x66')]['id'],_0x9a7508[_0x234f('0x66')]['name'],_0x9a7508[_0x234f('0x66')][_0x234f('0x7a')],_0x1d53e5[_0x234f('0x64')]['id'],_0x9a7508['body']?JSON[_0x234f('0x23')](_0x9a7508[_0x234f('0x57')]):_0x234f('0x67'));return respondWithRpcPromise(_0x234f('0x7b'),_0x234f('0x7c'),_0x1d53e5);}return null;})['then'](function(_0xb452f5){var _0x87d4d6=_0x234f('0x69')+_0xb452f5[_0x234f('0x26')][_0x234f('0x6a')];return db[_0x234f('0x6b')]['query'](_0x87d4d6,{'type':db[_0x234f('0x7d')][_0x234f('0x6c')][_0x234f('0x7e')],'raw':!![]})['then'](function(_0x218d1c){return _0x218d1c;});})['then'](function(_0x50b076){if(_0x50b076){_0x1d53e5['message'][_0x234f('0x7f')]=_0x50b076[0x0];if(!_0x9a7508[_0x234f('0x57')][_0x234f('0x5f')])return;return db[_0x234f('0x6d')][_0x234f('0x55')]({'where':{'id':_0x9a7508[_0x234f('0x57')]['UserId'],'role':'agent'},'attributes':['id',_0x234f('0x37'),_0x234f('0x6e'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x4729f2){if(!_0x4729f2)return null;_0x1d53e5['message']['agent']=_0x4729f2;return _0x1d53e5;})['then'](function(_0x4adbf4){if(_0x4adbf4){_0x4adbf4[_0x234f('0x26')][_0x234f('0x71')]=util[_0x234f('0x5d')](_0x234f('0x72'),_0x9a7508[_0x234f('0x66')][_0x234f('0x37')]);_0x4adbf4[_0x234f('0x26')][_0x234f('0x73')]=_0x1d53e5[_0x234f('0x73')];_0x4adbf4[_0x234f('0x26')]['motionChannel']=_0x1d53e5[_0x234f('0x73')];_0x4adbf4[_0x234f('0x26')][_0x234f('0x75')]=_0x234f('0x32');respondWithRpcPromise('EventManager',_0x234f('0x76'),{'event':_0x234f('0x80'),'message':_0x4adbf4['message']},client9002);return _0x1d53e5;}return null;})[_0x234f('0x1e')](respondWithResult(_0x3f1417,null))['catch'](handleError(_0x3f1417,null));};exports[_0x234f('0x81')]=function(_0x566bcd,_0x5ed556){var _0xb979fd;return db[_0x234f('0x39')][_0x234f('0x81')](_0x566bcd[_0x234f('0x57')],{})[_0x234f('0x1e')](function(_0x330a59){_0xb979fd=_0x330a59;return db[_0x234f('0x82')][_0x234f('0x83')]({'where':{'id':_0xb979fd['ContactId']}});})[_0x234f('0x1e')](function(_0x2f9bb2){if(_[_0x234f('0x62')](_0x2f9bb2)){return;}else{_0xb979fd['fax']=_0x2f9bb2['fax'];return db[_0x234f('0x84')][_0x234f('0x83')]({'where':{'id':_0xb979fd[_0x234f('0x85')]}});}})[_0x234f('0x1e')](function(_0x3d8c32){return respondWithRpcPromise('SendFax',_0x234f('0x86'),{'FaxAccountId':_[_0x234f('0x62')](_0x566bcd[_0x234f('0x57')])?undefined:_0x566bcd[_0x234f('0x57')][_0x234f('0x87')],'path':_[_0x234f('0x62')](_0x3d8c32)?undefined:util[_0x234f('0x5d')](_0x234f('0x88'),_0x3d8c32[_0x234f('0x89')]),'fax':_[_0x234f('0x62')](_0xb979fd[_0x234f('0x5b')])?undefined:_0xb979fd['fax'],'AttachmentId':_0xb979fd[_0x234f('0x85')]},client9002);})[_0x234f('0x1e')](respondWithResult(_0x5ed556,0xc9))[_0x234f('0x28')](handleError(_0x5ed556,null));};exports[_0x234f('0x8a')]=function(_0x469e27,_0x53a29e){var _0xe24cf6=path[_0x234f('0x8b')](config[_0x234f('0x8c')],'server','files',_0x234f('0x8d'));return db['FaxMessage']['find']({'where':{'id':_0x469e27[_0x234f('0x53')]['id']},'include':[{'model':db[_0x234f('0x84')],'as':'Attachment'}]})['then'](handleEntityNotFound(_0x53a29e,null))[_0x234f('0x1e')](function(_0x3f415c){if(_0x3f415c){return _0x53a29e[_0x234f('0x8a')](path[_0x234f('0x8b')](_0xe24cf6,_0x3f415c[_0x234f('0x84')][_0x234f('0x89')]));}})['catch'](handleError(_0x53a29e,null));}; \ No newline at end of file +var _0xa34b=['interaction','null','ContactId','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','contact','rejectmessage','create','findOne','fax','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','attachments','Attachment','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','end','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','FaxMessage','find','update','body','params','destroy','describe','fax-interactions','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil'];(function(_0x4e3340,_0x502d0b){var _0x33a3bb=function(_0x4e7585){while(--_0x4e7585){_0x4e3340['push'](_0x4e3340['shift']());}};_0x33a3bb(++_0x502d0b);}(_0xa34b,0xb4));var _0xba34=function(_0x3e6fdd,_0x1e1a31){_0x3e6fdd=_0x3e6fdd-0x0;var _0x2de773=_0xa34b[_0x3e6fdd];return _0x2de773;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xba34('0x0'));var jsonpatch=require(_0xba34('0x1'));var rp=require(_0xba34('0x2'));var moment=require(_0xba34('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xba34('0x4'));var util=require(_0xba34('0x5'));var path=require(_0xba34('0x6'));var sox=require(_0xba34('0x7'));var csv=require(_0xba34('0x8'));var ejs=require(_0xba34('0x9'));var fs=require('fs');var fs_extra=require(_0xba34('0xa'));var _=require(_0xba34('0xb'));var squel=require(_0xba34('0xc'));var crypto=require(_0xba34('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xba34('0xe'));var Papa=require(_0xba34('0xf'));var Redis=require(_0xba34('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xba34('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xba34('0x12'));var logger=require(_0xba34('0x13'))(_0xba34('0x14'));var utils=require(_0xba34('0x15'));var config=require(_0xba34('0x16'));var licenseUtil=require(_0xba34('0x17'));var db=require('../../mysqldb')['db'];config[_0xba34('0x18')]=_[_0xba34('0x19')](config[_0xba34('0x18')],{'host':_0xba34('0x1a'),'port':0x18eb});var socket=require(_0xba34('0x1b'))(new Redis(config['redis']));require(_0xba34('0x1c'))['register'](socket);var jayson=require(_0xba34('0x1d'));var client=jayson[_0xba34('0x1e')][_0xba34('0x1f')]({'port':0x232c});var client9002=jayson[_0xba34('0x1e')][_0xba34('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x5e1bd6,_0x46b57c,_0xf0980f,_0xb21423){return new BPromise(function(_0x270060,_0x30b971){var _0x57d2e7=_0xb21423||client;return _0x57d2e7[_0xba34('0x20')](_0x5e1bd6,_0xf0980f)[_0xba34('0x21')](function(_0x370edd){logger[_0xba34('0x22')](_0xba34('0x23'),_0x46b57c,_0xba34('0x24'));logger[_0xba34('0x25')](_0xba34('0x26'),_0x46b57c,'request\x20sent',JSON[_0xba34('0x27')](_0x370edd));if(_0x370edd['error']){if(_0x370edd[_0xba34('0x28')]['code']===0x1f4){logger[_0xba34('0x28')](_0xba34('0x23'),_0x46b57c,_0x370edd[_0xba34('0x28')]['message']);return _0x30b971(_0x370edd[_0xba34('0x28')][_0xba34('0x29')]);}logger[_0xba34('0x28')](_0xba34('0x23'),_0x46b57c,_0x370edd[_0xba34('0x28')]['message']);return _0x270060(_0x370edd[_0xba34('0x28')][_0xba34('0x29')]);}else{logger['info'](_0xba34('0x23'),_0x46b57c,_0xba34('0x24'));_0x270060(_0x370edd[_0xba34('0x2a')]['message']);}})[_0xba34('0x2b')](function(_0xc98ef9){logger['error'](_0xba34('0x23'),_0x46b57c,_0xc98ef9);_0x30b971(_0xc98ef9);});});}function respondWithStatusCode(_0x52f447,_0x2d3218){_0x2d3218=_0x2d3218||0xcc;return function(_0x3c2265){if(_0x3c2265){return _0x52f447[_0xba34('0x2c')](_0x2d3218);}return _0x52f447[_0xba34('0x2d')](_0x2d3218)['end']();};}function respondWithResult(_0x3d900b,_0x409b7d){_0x409b7d=_0x409b7d||0xc8;return function(_0x18b4a4){if(_0x18b4a4){return _0x3d900b[_0xba34('0x2d')](_0x409b7d)[_0xba34('0x2e')](_0x18b4a4);}};}function respondWithFilteredResult(_0x14c252,_0x23074f){return function(_0x320526){if(_0x320526){var _0x5eadbb=typeof _0x23074f[_0xba34('0x2f')]===_0xba34('0x30')&&typeof _0x23074f[_0xba34('0x31')]==='undefined';var _0x2730dd=_0x320526[_0xba34('0x32')];var _0x413ac9=_0x5eadbb?0x0:_0x23074f[_0xba34('0x2f')];var _0xe6b432=_0x5eadbb?_0x320526[_0xba34('0x32')]:_0x23074f[_0xba34('0x2f')]+_0x23074f[_0xba34('0x31')];var _0x5a093f;if(_0xe6b432>=_0x2730dd){_0xe6b432=_0x2730dd;_0x5a093f=0xc8;}else{_0x5a093f=0xce;}_0x14c252[_0xba34('0x2d')](_0x5a093f);return _0x14c252[_0xba34('0x33')]('Content-Range',_0x413ac9+'-'+_0xe6b432+'/'+_0x2730dd)[_0xba34('0x2e')](_0x320526);}return null;};}function patchUpdates(_0x4687da){return function(_0x2e8485){try{jsonpatch[_0xba34('0x34')](_0x2e8485,_0x4687da,!![]);}catch(_0x407f28){return BPromise[_0xba34('0x35')](_0x407f28);}return _0x2e8485[_0xba34('0x36')]();};}function saveUpdates(_0x575a3d,_0x3fb235){return function(_0x5b0e28){if(_0x5b0e28){return _0x5b0e28['update'](_0x575a3d)[_0xba34('0x21')](function(_0x43647e){return _0x43647e;});}return null;};}function removeEntity(_0x482a34,_0x473d51){return function(_0x5a1387){if(_0x5a1387){return _0x5a1387['destroy']()[_0xba34('0x21')](function(){_0x482a34[_0xba34('0x2d')](0xcc)[_0xba34('0x37')]();});}};}function handleEntityNotFound(_0x19b19f,_0x5df1cb){return function(_0x582a1c){if(!_0x582a1c){_0x19b19f[_0xba34('0x2c')](0x194);}return _0x582a1c;};}function handleError(_0x41577e,_0x5a88a3){_0x5a88a3=_0x5a88a3||0x1f4;return function(_0x3e77c2){logger[_0xba34('0x28')](_0x3e77c2['stack']);if(_0x3e77c2['name']){delete _0x3e77c2[_0xba34('0x38')];}_0x41577e[_0xba34('0x2d')](_0x5a88a3)[_0xba34('0x39')](_0x3e77c2);};}exports[_0xba34('0x3a')]=function(_0x46400e,_0xfb57c3){var _0xd873c1={},_0x40983a={},_0x2f0e01={'count':0x0,'rows':[]};var _0x137265=_[_0xba34('0x3b')](db['FaxMessage'][_0xba34('0x3c')],function(_0x5cb286){return{'name':_0x5cb286[_0xba34('0x3d')],'type':_0x5cb286['type'][_0xba34('0x3e')]};});_0x40983a[_0xba34('0x3f')]=_['map'](_0x137265,_0xba34('0x38'));_0x40983a[_0xba34('0x40')]=_[_0xba34('0x41')](_0x46400e[_0xba34('0x40')]);_0x40983a[_0xba34('0x42')]=_['intersection'](_0x40983a[_0xba34('0x3f')],_0x40983a[_0xba34('0x40')]);_0xd873c1[_0xba34('0x43')]=_[_0xba34('0x44')](_0x40983a['model'],qs[_0xba34('0x45')](_0x46400e[_0xba34('0x40')][_0xba34('0x45')]));_0xd873c1['attributes']=_0xd873c1[_0xba34('0x43')][_0xba34('0x46')]?_0xd873c1[_0xba34('0x43')]:_0x40983a[_0xba34('0x3f')];if(!_0x46400e[_0xba34('0x40')]['hasOwnProperty'](_0xba34('0x47'))){_0xd873c1[_0xba34('0x31')]=qs[_0xba34('0x31')](_0x46400e['query'][_0xba34('0x31')]);_0xd873c1['offset']=qs[_0xba34('0x2f')](_0x46400e['query'][_0xba34('0x2f')]);}_0xd873c1[_0xba34('0x48')]=qs[_0xba34('0x49')](_0x46400e[_0xba34('0x40')]['sort']);_0xd873c1[_0xba34('0x4a')]=qs['filters'](_['pick'](_0x46400e['query'],_0x40983a[_0xba34('0x42')]),_0x137265);if(_0x46400e[_0xba34('0x40')][_0xba34('0x4b')]){_0xd873c1[_0xba34('0x4a')]=_[_0xba34('0x4c')](_0xd873c1['where'],{'$or':_['map'](_0x137265,function(_0x28f982){if(_0x28f982[_0xba34('0x4d')]!==_0xba34('0x4e')){var _0x45d40c={};_0x45d40c[_0x28f982[_0xba34('0x38')]]={'$like':'%'+_0x46400e[_0xba34('0x40')][_0xba34('0x4b')]+'%'};return _0x45d40c;}})});}_0xd873c1=_[_0xba34('0x4c')]({},_0xd873c1,_0x46400e[_0xba34('0x4f')]);var _0x5b8f9b={'where':_0xd873c1[_0xba34('0x4a')]};return db['FaxMessage']['count'](_0x5b8f9b)[_0xba34('0x21')](function(_0x4915c0){_0x2f0e01[_0xba34('0x32')]=_0x4915c0;if(_0x46400e['query'][_0xba34('0x50')]){_0xd873c1[_0xba34('0x51')]=[{'all':!![]}];}return db['FaxMessage'][_0xba34('0x52')](_0xd873c1);})['then'](function(_0x227449){_0x2f0e01[_0xba34('0x53')]=_0x227449;return _0x2f0e01;})[_0xba34('0x21')](respondWithFilteredResult(_0xfb57c3,_0xd873c1))[_0xba34('0x2b')](handleError(_0xfb57c3,null));};exports[_0xba34('0x54')]=function(_0x554038,_0x105dbc){var _0x45b31c={'raw':!![],'where':{'id':_0x554038['params']['id']}},_0x29f5ec={};_0x29f5ec[_0xba34('0x3f')]=_[_0xba34('0x41')](db[_0xba34('0x55')][_0xba34('0x3c')]);_0x29f5ec['query']=_[_0xba34('0x41')](_0x554038[_0xba34('0x40')]);_0x29f5ec[_0xba34('0x42')]=_['intersection'](_0x29f5ec[_0xba34('0x3f')],_0x29f5ec[_0xba34('0x40')]);_0x45b31c[_0xba34('0x43')]=_[_0xba34('0x44')](_0x29f5ec['model'],qs[_0xba34('0x45')](_0x554038['query']['fields']));_0x45b31c[_0xba34('0x43')]=_0x45b31c[_0xba34('0x43')][_0xba34('0x46')]?_0x45b31c[_0xba34('0x43')]:_0x29f5ec[_0xba34('0x3f')];if(_0x554038[_0xba34('0x40')]['includeAll']){_0x45b31c[_0xba34('0x51')]=[{'all':!![]}];}_0x45b31c=_['merge']({},_0x45b31c,_0x554038[_0xba34('0x4f')]);return db[_0xba34('0x55')][_0xba34('0x56')](_0x45b31c)[_0xba34('0x21')](handleEntityNotFound(_0x105dbc,null))[_0xba34('0x21')](respondWithResult(_0x105dbc,null))[_0xba34('0x2b')](handleError(_0x105dbc,null));};exports[_0xba34('0x57')]=function(_0x46300a,_0x21b112){if(_0x46300a[_0xba34('0x58')]['id']){delete _0x46300a[_0xba34('0x58')]['id'];}return db[_0xba34('0x55')][_0xba34('0x56')]({'where':{'id':_0x46300a[_0xba34('0x59')]['id']}})[_0xba34('0x21')](handleEntityNotFound(_0x21b112,null))['then'](saveUpdates(_0x46300a['body'],null))[_0xba34('0x21')](respondWithResult(_0x21b112,null))[_0xba34('0x2b')](handleError(_0x21b112,null));};exports[_0xba34('0x5a')]=function(_0x448e28,_0x41a3e2){return db[_0xba34('0x55')][_0xba34('0x56')]({'where':{'id':_0x448e28['params']['id']}})[_0xba34('0x21')](handleEntityNotFound(_0x41a3e2,null))['then'](removeEntity(_0x41a3e2,null))[_0xba34('0x2b')](handleError(_0x41a3e2,null));};exports[_0xba34('0x5b')]=function(_0x5f22a1,_0x253c36){return db['FaxMessage'][_0xba34('0x5b')]()[_0xba34('0x21')](respondWithResult(_0x253c36,null))[_0xba34('0x2b')](handleError(_0x253c36,null));};var interaction_log=require(_0xba34('0x13'))(_0xba34('0x5c'));exports[_0xba34('0x5d')]=function(_0x5d7bf0,_0x222052,_0x153876){var _0x1174be={'agent':{},'channel':'fax'};if(_0x5d7bf0[_0xba34('0x58')]['id']){delete _0x5d7bf0[_0xba34('0x58')]['id'];}_0x5d7bf0[_0xba34('0x58')][_0xba34('0x5e')]=!![];_0x5d7bf0[_0xba34('0x58')]['readAt']=moment()[_0xba34('0x5f')](_0xba34('0x60'));_0x5d7bf0[_0xba34('0x58')][_0xba34('0x61')]=_0x5d7bf0[_0xba34('0x58')][_0xba34('0x61')]||_0x5d7bf0[_0xba34('0x62')]['id'];_0x1174be[_0xba34('0x63')]['id']=_0x5d7bf0[_0xba34('0x58')][_0xba34('0x61')];return db[_0xba34('0x55')]['find']({'where':{'id':_0x5d7bf0[_0xba34('0x59')]['id'],'UserId':null}})[_0xba34('0x21')](handleEntityNotFound(_0x222052,null))[_0xba34('0x21')](saveUpdates(_0x5d7bf0[_0xba34('0x58')],null))[_0xba34('0x21')](function(_0x2c694b){if(_0x2c694b){_0x1174be[_0xba34('0x29')]=_0x2c694b[_0xba34('0x64')]({'plain':!![]});return db[_0xba34('0x65')]['find']({'where':{'id':_0x2c694b[_0xba34('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x222052,null))[_0xba34('0x21')](function(_0x34257f){if(_0x34257f){return _0x34257f['update']({'UserId':_0x5d7bf0[_0xba34('0x58')]['UserId'],'read1stAt':_[_0xba34('0x67')](_0x34257f['read1stAt'])?moment()[_0xba34('0x5f')](_0xba34('0x60')):undefined});}return null;})[_0xba34('0x21')](function(_0x2b55c5){if(_0x2b55c5){_0x1174be[_0xba34('0x68')]=_0x2b55c5[_0xba34('0x64')]({'plain':!![]});interaction_log[_0xba34('0x22')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5d7bf0[_0xba34('0x62')]['id'],_0x5d7bf0[_0xba34('0x62')][_0xba34('0x38')],_0x5d7bf0[_0xba34('0x62')]['role'],_0x1174be[_0xba34('0x68')]['id'],_0x5d7bf0[_0xba34('0x58')]?JSON[_0xba34('0x27')](_0x5d7bf0[_0xba34('0x58')]):_0xba34('0x69'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x1174be);}return null;})[_0xba34('0x21')](function(_0x178276){var _0x5624b1='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x178276[_0xba34('0x29')][_0xba34('0x6a')];return db['sequelize'][_0xba34('0x40')](_0x5624b1,{'type':db[_0xba34('0x6b')][_0xba34('0x6c')][_0xba34('0x6d')],'raw':!![]})[_0xba34('0x21')](function(_0x3698e7){return _0x3698e7;});})[_0xba34('0x21')](function(_0x21000){if(_0x21000){_0x1174be[_0xba34('0x29')]['contact']=_0x21000[0x0];if(!_0x5d7bf0[_0xba34('0x58')][_0xba34('0x61')])return;return db[_0xba34('0x6e')][_0xba34('0x56')]({'where':{'id':_0x5d7bf0['body'][_0xba34('0x61')],'role':_0xba34('0x63')},'attributes':['id','name',_0xba34('0x6f'),_0xba34('0x70'),_0xba34('0x71')],'raw':!![]});}return null;})[_0xba34('0x21')](function(_0x385d6c){if(!_0x385d6c)return null;_0x1174be['message']['agent']=_0x385d6c;return _0x1174be;})[_0xba34('0x21')](function(_0x4ac043){if(_0x4ac043){if(_0x5d7bf0[_0xba34('0x58')][_0xba34('0x72')]){_0x1174be['message'][_0xba34('0x73')]=util[_0xba34('0x5f')](_0xba34('0x74'),_0x5d7bf0[_0xba34('0x62')][_0xba34('0x38')]);_0x1174be['message']['channel']=_0x1174be[_0xba34('0x75')];_0x1174be[_0xba34('0x29')][_0xba34('0x76')]=_0x1174be[_0xba34('0x75')];_0x1174be[_0xba34('0x29')][_0xba34('0x77')]='accept';return respondWithRpcPromise(_0xba34('0x78'),_0xba34('0x78'),{'event':_0xba34('0x79'),'message':_0x1174be[_0xba34('0x29')]},client9002)[_0xba34('0x21')](function(){return _0x1174be;});}return _0x1174be;}return null;})[_0xba34('0x21')](respondWithResult(_0x222052,null))['catch'](handleError(_0x222052,null));};var interaction_log=require(_0xba34('0x13'))(_0xba34('0x5c'));exports[_0xba34('0x35')]=function(_0x461f0d,_0x1dd342,_0x52b7ad){var _0x51f4dd={'agent':{},'channel':'fax'};if(_0x461f0d['body']['id']){delete _0x461f0d[_0xba34('0x58')]['id'];}_0x461f0d['body'][_0xba34('0x61')]=_0x461f0d[_0xba34('0x58')][_0xba34('0x61')]||_0x461f0d[_0xba34('0x62')]['id'];_0x51f4dd[_0xba34('0x63')]['id']=_0x461f0d[_0xba34('0x58')][_0xba34('0x61')];return db[_0xba34('0x55')][_0xba34('0x56')]({'where':{'id':_0x461f0d[_0xba34('0x59')]['id'],'UserId':null}})[_0xba34('0x21')](handleEntityNotFound(_0x1dd342,null))[_0xba34('0x21')](function(_0x2042a6){if(_0x2042a6){_0x51f4dd[_0xba34('0x29')]=_0x2042a6[_0xba34('0x64')]({'plain':!![]});return db[_0xba34('0x65')][_0xba34('0x56')]({'where':{'id':_0x2042a6[_0xba34('0x66')]}});}return null;})[_0xba34('0x21')](handleEntityNotFound(_0x1dd342,null))[_0xba34('0x21')](function(_0x2d77e5){if(_0x2d77e5){_0x51f4dd[_0xba34('0x68')]=_0x2d77e5[_0xba34('0x64')]({'plain':!![]});interaction_log[_0xba34('0x22')](_0xba34('0x7a'),_0x461f0d[_0xba34('0x62')]['id'],_0x461f0d[_0xba34('0x62')][_0xba34('0x38')],_0x461f0d[_0xba34('0x62')][_0xba34('0x7b')],_0x51f4dd[_0xba34('0x68')]['id'],_0x461f0d[_0xba34('0x58')]?JSON[_0xba34('0x27')](_0x461f0d['body']):'null');return respondWithRpcPromise('RejectMessage',_0xba34('0x7c'),_0x51f4dd);}return null;})['then'](function(_0x1a57db){var _0x4aae85='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1a57db[_0xba34('0x29')][_0xba34('0x6a')];return db['sequelize'][_0xba34('0x40')](_0x4aae85,{'type':db[_0xba34('0x6b')]['QueryTypes']['SELECT'],'raw':!![]})[_0xba34('0x21')](function(_0x13bd6e){return _0x13bd6e;});})[_0xba34('0x21')](function(_0xb46ee3){if(_0xb46ee3){_0x51f4dd[_0xba34('0x29')][_0xba34('0x7d')]=_0xb46ee3[0x0];if(!_0x461f0d[_0xba34('0x58')][_0xba34('0x61')])return;return db[_0xba34('0x6e')][_0xba34('0x56')]({'where':{'id':_0x461f0d[_0xba34('0x58')][_0xba34('0x61')],'role':'agent'},'attributes':['id',_0xba34('0x38'),_0xba34('0x6f'),_0xba34('0x70'),'internal'],'raw':!![]});}return null;})['then'](function(_0x52d6c5){if(!_0x52d6c5)return null;_0x51f4dd[_0xba34('0x29')][_0xba34('0x63')]=_0x52d6c5;return _0x51f4dd;})[_0xba34('0x21')](function(_0x1c2187){if(_0x1c2187){_0x1c2187[_0xba34('0x29')]['interface']=util[_0xba34('0x5f')](_0xba34('0x74'),_0x461f0d[_0xba34('0x62')]['name']);_0x1c2187[_0xba34('0x29')][_0xba34('0x75')]=_0x51f4dd[_0xba34('0x75')];_0x1c2187['message']['motionChannel']=_0x51f4dd[_0xba34('0x75')];_0x1c2187[_0xba34('0x29')][_0xba34('0x77')]=_0xba34('0x35');respondWithRpcPromise('EventManager',_0xba34('0x78'),{'event':_0xba34('0x7e'),'message':_0x1c2187[_0xba34('0x29')]},client9002);return _0x51f4dd;}return null;})[_0xba34('0x21')](respondWithResult(_0x1dd342,null))['catch'](handleError(_0x1dd342,null));};exports['create']=function(_0x11eba4,_0x360979){var _0x954778;return db[_0xba34('0x55')][_0xba34('0x7f')](_0x11eba4['body'],{})[_0xba34('0x21')](function(_0xc23789){_0x954778=_0xc23789;return db['CmContact'][_0xba34('0x80')]({'where':{'id':_0x954778[_0xba34('0x6a')]}});})[_0xba34('0x21')](function(_0x454310){if(_[_0xba34('0x67')](_0x454310)){return;}else{_0x954778[_0xba34('0x81')]=_0x454310[_0xba34('0x81')];return db['Attachment'][_0xba34('0x80')]({'where':{'id':_0x954778[_0xba34('0x82')]}});}})['then'](function(_0x3f378f){return respondWithRpcPromise('SendFax',_0xba34('0x83'),{'FaxAccountId':_[_0xba34('0x67')](_0x11eba4[_0xba34('0x58')])?undefined:_0x11eba4[_0xba34('0x58')][_0xba34('0x84')],'path':_[_0xba34('0x67')](_0x3f378f)?undefined:util[_0xba34('0x5f')](_0xba34('0x85'),_0x3f378f[_0xba34('0x86')]),'fax':_[_0xba34('0x67')](_0x954778[_0xba34('0x81')])?undefined:_0x954778[_0xba34('0x81')],'AttachmentId':_0x954778[_0xba34('0x82')]},client9002);})['then'](respondWithResult(_0x360979,0xc9))[_0xba34('0x2b')](handleError(_0x360979,null));};exports[_0xba34('0x87')]=function(_0x2985b0,_0x4476d5){var _0x16bb41=path[_0xba34('0x88')](config[_0xba34('0x89')],_0xba34('0x8a'),_0xba34('0x8b'),_0xba34('0x8c'));return db[_0xba34('0x55')][_0xba34('0x56')]({'where':{'id':_0x2985b0[_0xba34('0x59')]['id']},'include':[{'model':db[_0xba34('0x8d')],'as':'Attachment'}]})[_0xba34('0x21')](handleEntityNotFound(_0x4476d5,null))[_0xba34('0x21')](function(_0x58e681){if(_0x58e681){return _0x4476d5[_0xba34('0x87')](path[_0xba34('0x88')](_0x16bb41,_0x58e681['Attachment'][_0xba34('0x86')]));}})[_0xba34('0x2b')](handleError(_0x4476d5,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index ab48f60..9cf6c51 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 _0x0c23=['FaxMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x40cd61,_0x36162c){var _0x120ce8=function(_0x59c7cc){while(--_0x59c7cc){_0x40cd61['push'](_0x40cd61['shift']());}};_0x120ce8(++_0x36162c);}(_0x0c23,0x13e));var _0x30c2=function(_0xb8f889,_0x28bc44){_0xb8f889=_0xb8f889-0x0;var _0x3e70b3=_0x0c23[_0xb8f889];return _0x3e70b3;};'use strict';var EventEmitter=require(_0x30c2('0x0'));var FaxMessage=require(_0x30c2('0x1'))['db'][_0x30c2('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x30c2('0x3')](0x0);var events={'afterCreate':_0x30c2('0x4'),'afterUpdate':_0x30c2('0x5'),'afterDestroy':_0x30c2('0x6')};function emitEvent(_0x529e1d){return function(_0x2972f4,_0x2aa353,_0x343fc5){FaxMessageEvents[_0x30c2('0x7')](_0x529e1d+':'+_0x2972f4['id'],_0x2972f4);FaxMessageEvents[_0x30c2('0x7')](_0x529e1d,_0x2972f4);_0x343fc5(null);};}for(var e in events){if(events[_0x30c2('0x8')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x30c2('0x9')]=FaxMessageEvents; \ No newline at end of file +var _0x6c45=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0xdbff26,_0xfc8995){var _0x4adb23=function(_0x291780){while(--_0x291780){_0xdbff26['push'](_0xdbff26['shift']());}};_0x4adb23(++_0xfc8995);}(_0x6c45,0xb1));var _0x56c4=function(_0x10e960,_0x378a49){_0x10e960=_0x10e960-0x0;var _0x5be321=_0x6c45[_0x10e960];return _0x5be321;};'use strict';var EventEmitter=require(_0x56c4('0x0'));var FaxMessage=require(_0x56c4('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x56c4('0x2')](0x0);var events={'afterCreate':_0x56c4('0x3'),'afterUpdate':_0x56c4('0x4'),'afterDestroy':_0x56c4('0x5')};function emitEvent(_0x2eaf3b){return function(_0x18d229,_0x1096ce,_0x24d839){FaxMessageEvents[_0x56c4('0x6')](_0x2eaf3b+':'+_0x18d229['id'],_0x18d229);FaxMessageEvents[_0x56c4('0x6')](_0x2eaf3b,_0x18d229);_0x24d839(null);};}for(var e in events){if(events[_0x56c4('0x7')](e)){var event=events[e];FaxMessage[_0x56c4('0x8')](e,emitEvent(event));}}module[_0x56c4('0x9')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index e1b5a3f..7af109b 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 _0x1b4b=['api','moment','bluebird','../../config/environment','./faxMessage.attributes','exports','define','fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','update','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x586246,_0x5c5f2e){var _0x5b1419=function(_0xbed65c){while(--_0xbed65c){_0x586246['push'](_0x586246['shift']());}};_0x5b1419(++_0x5c5f2e);}(_0x1b4b,0x14e));var _0xb1b4=function(_0x5bbfc8,_0x5c7939){_0x5bbfc8=_0x5bbfc8-0x0;var _0x58076f=_0x1b4b[_0x5bbfc8];return _0x58076f;};'use strict';var _=require('lodash');var util=require(_0xb1b4('0x0'));var logger=require(_0xb1b4('0x1'))(_0xb1b4('0x2'));var moment=require(_0xb1b4('0x3'));var BPromise=require(_0xb1b4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb1b4('0x5'));var attributes=require(_0xb1b4('0x6'));module[_0xb1b4('0x7')]=function(_0x174a26,_0x58aec8){return _0x174a26[_0xb1b4('0x8')]('FaxMessage',attributes,{'tableName':_0xb1b4('0x9'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0xb1b4('0xa')],'type':_0xb1b4('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4c76fa,_0x875df1,_0x59d639){var _0x2bf4bd=_0x174a26[_0xb1b4('0xc')];var _0x489f6b=_0x4c76fa[_0xb1b4('0xd')]({'plain':!![]});if(_0x489f6b[_0xb1b4('0xe')][_0xb1b4('0xf')]()==='in'||_0x489f6b['direction'][_0xb1b4('0xf')]()===_0xb1b4('0x10')&&!_0x489f6b[_0xb1b4('0x11')]&&!_[_0xb1b4('0x12')](_0x489f6b['UserId'])){_0x2bf4bd['FaxInteraction']['findOne']({'where':{'id':_0x489f6b['FaxInteractionId']}})['then'](function(_0x317b0e){if(_0x317b0e){_0x317b0e[_0xb1b4('0x13')]({'lastMsgAt':_0x489f6b['createdAt'],'lastMsgDirection':_0x489f6b[_0xb1b4('0xe')][_0xb1b4('0xf')]()});}})[_0xb1b4('0x14')](function(_0x13409b){console[_0xb1b4('0x15')](_0x13409b);});}_0x59d639();}},'charset':_0xb1b4('0x16'),'collate':_0xb1b4('0x17')});}; \ No newline at end of file +var _0x79d7=['FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId'];(function(_0xc5f563,_0x59f5ec){var _0x27c76a=function(_0x14bd3f){while(--_0x14bd3f){_0xc5f563['push'](_0xc5f563['shift']());}};_0x27c76a(++_0x59f5ec);}(_0x79d7,0x182));var _0x779d=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x79d7[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x779d('0x0'));var util=require(_0x779d('0x1'));var logger=require(_0x779d('0x2'))(_0x779d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x779d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x779d('0x5'));var attributes=require(_0x779d('0x6'));module[_0x779d('0x7')]=function(_0x1b538d,_0x236913){return _0x1b538d[_0x779d('0x8')](_0x779d('0x9'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x779d('0xa')],'type':_0x779d('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xee4a7f,_0x4c0f30,_0x477238){var _0x2b4731=_0x1b538d[_0x779d('0xc')];var _0xcd8fc0=_0xee4a7f[_0x779d('0xd')]({'plain':!![]});if(_0xcd8fc0[_0x779d('0xe')][_0x779d('0xf')]()==='in'||_0xcd8fc0[_0x779d('0xe')]['toLowerCase']()===_0x779d('0x10')&&!_0xcd8fc0[_0x779d('0x11')]&&!_[_0x779d('0x12')](_0xcd8fc0[_0x779d('0x13')])){_0x2b4731[_0x779d('0x14')][_0x779d('0x15')]({'where':{'id':_0xcd8fc0[_0x779d('0x16')]}})[_0x779d('0x17')](function(_0x2be859){if(_0x2be859){_0x2be859[_0x779d('0x18')]({'lastMsgAt':_0xcd8fc0[_0x779d('0x19')],'lastMsgDirection':_0xcd8fc0[_0x779d('0xe')][_0x779d('0xf')]()});}})[_0x779d('0x1a')](function(_0x451c34){console[_0x779d('0x1b')](_0x451c34);});}_0x477238();}},'charset':'utf8mb4','collate':_0x779d('0x1c')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index c488833..e32e726 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 _0xdace=['FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','FaxMessage','create','body','options','raw','CreateFaxMessage','UpdateFaxMessage','update','attributes','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','./faxMessage.socket','register','then','FaxMessage,\x20%s,\x20%s','debug'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xdace,0xc5));var _0xedac=function(_0x3e7e96,_0x5683ca){_0x3e7e96=_0x3e7e96-0x0;var _0x13f6f0=_0xdace[_0x3e7e96];return _0x13f6f0;};'use strict';var _=require(_0xedac('0x0'));var util=require('util');var moment=require(_0xedac('0x1'));var BPromise=require(_0xedac('0x2'));var rs=require(_0xedac('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xedac('0x4'))['db'];var utils=require(_0xedac('0x5'));var logger=require(_0xedac('0x6'))(_0xedac('0x7'));var config=require('../../config/environment');var jayson=require(_0xedac('0x8'));var client=jayson[_0xedac('0x9')][_0xedac('0xa')]({'port':0x232a});config['redis']=_[_0xedac('0xb')](config[_0xedac('0xc')],{'host':_0xedac('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xedac('0xc')]));require(_0xedac('0xe'))[_0xedac('0xf')](socket);function respondWithRpcPromise(_0x4af030,_0x5e188c,_0x144368){return new BPromise(function(_0x2ea11d,_0x57e1bf){return client['request'](_0x4af030,_0x144368)[_0xedac('0x10')](function(_0x25395d){logger['info'](_0xedac('0x11'),_0x5e188c,'request\x20sent');logger[_0xedac('0x12')](_0xedac('0x13'),_0x5e188c,_0xedac('0x14'),JSON[_0xedac('0x15')](_0x25395d));if(_0x25395d[_0xedac('0x16')]){if(_0x25395d[_0xedac('0x16')][_0xedac('0x17')]===0x1f4){logger[_0xedac('0x16')]('FaxMessage,\x20%s,\x20%s',_0x5e188c,_0x25395d[_0xedac('0x16')][_0xedac('0x18')]);return _0x57e1bf(_0x25395d[_0xedac('0x16')][_0xedac('0x18')]);}logger[_0xedac('0x16')]('FaxMessage,\x20%s,\x20%s',_0x5e188c,_0x25395d[_0xedac('0x16')]['message']);return _0x2ea11d(_0x25395d[_0xedac('0x16')][_0xedac('0x18')]);}else{logger[_0xedac('0x19')](_0xedac('0x11'),_0x5e188c,'request\x20sent');_0x2ea11d(_0x25395d['result'][_0xedac('0x18')]);}})[_0xedac('0x1a')](function(_0x25fe64){logger[_0xedac('0x16')]('FaxMessage,\x20%s,\x20%s',_0x5e188c,_0x25fe64);_0x57e1bf(_0x25fe64);});});}exports['CreateFaxMessage']=function(_0x2b2ae9){var _0x17766c=this;return new Promise(function(_0x23c609,_0xcc1605){return db[_0xedac('0x1b')][_0xedac('0x1c')](_0x2b2ae9[_0xedac('0x1d')],{'raw':_0x2b2ae9[_0xedac('0x1e')]?_0x2b2ae9['options'][_0xedac('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x29cd40){logger[_0xedac('0x19')]('CreateFaxMessage',_0x2b2ae9);logger[_0xedac('0x12')](_0xedac('0x20'),_0x2b2ae9,JSON[_0xedac('0x15')](_0x29cd40));_0x23c609(_0x29cd40);})[_0xedac('0x1a')](function(_0x6b13ca){logger[_0xedac('0x16')]('CreateFaxMessage',_0x6b13ca[_0xedac('0x18')],_0x2b2ae9);_0xcc1605(_0x17766c[_0xedac('0x16')](0x1f4,_0x6b13ca[_0xedac('0x18')]));});});};exports[_0xedac('0x21')]=function(_0x1ff33e){var _0x453a3c=this;return new Promise(function(_0x40ba53,_0x26c6f7){return db[_0xedac('0x1b')][_0xedac('0x22')](_0x1ff33e['body'],{'raw':_0x1ff33e[_0xedac('0x1e')]?_0x1ff33e[_0xedac('0x1e')][_0xedac('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ff33e['options']?_0x1ff33e[_0xedac('0x1e')]['where']||null:null,'attributes':_0x1ff33e['options']?_0x1ff33e[_0xedac('0x1e')][_0xedac('0x23')]||null:null,'limit':_0x1ff33e[_0xedac('0x1e')]?_0x1ff33e[_0xedac('0x1e')]['limit']||null:null})['then'](function(_0xe813e6){logger[_0xedac('0x19')](_0xedac('0x21'),_0x1ff33e);logger[_0xedac('0x12')](_0xedac('0x21'),_0x1ff33e,JSON[_0xedac('0x15')](_0xe813e6));_0x40ba53(_0xe813e6);})[_0xedac('0x1a')](function(_0x483233){logger[_0xedac('0x16')](_0xedac('0x21'),_0x483233[_0xedac('0x18')],_0x1ff33e);_0x26c6f7(_0x453a3c['error'](0x1f4,_0x483233[_0xedac('0x18')]));});});}; \ No newline at end of file +var _0xa8a8=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','FaxMessage','create','body','options','raw','CreateFaxMessage','UpdateFaxMessage','where','attributes','limit','lodash','util','moment','bluebird'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xa8a8,0xec));var _0x8a8a=function(_0x2ddce6,_0x187d2e){_0x2ddce6=_0x2ddce6-0x0;var _0xe6c68c=_0xa8a8[_0x2ddce6];return _0xe6c68c;};'use strict';var _=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var moment=require(_0x8a8a('0x2'));var BPromise=require(_0x8a8a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a8a('0x4'));var db=require(_0x8a8a('0x5'))['db'];var utils=require(_0x8a8a('0x6'));var logger=require(_0x8a8a('0x7'))(_0x8a8a('0x8'));var config=require(_0x8a8a('0x9'));var jayson=require(_0x8a8a('0xa'));var client=jayson[_0x8a8a('0xb')][_0x8a8a('0xc')]({'port':0x232a});config[_0x8a8a('0xd')]=_[_0x8a8a('0xe')](config[_0x8a8a('0xd')],{'host':_0x8a8a('0xf'),'port':0x18eb});var socket=require(_0x8a8a('0x10'))(new Redis(config[_0x8a8a('0xd')]));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0x3c01cd,_0x497b8a,_0x11788d){return new BPromise(function(_0x3d3a00,_0x532621){return client[_0x8a8a('0x11')](_0x3c01cd,_0x11788d)[_0x8a8a('0x12')](function(_0xb13fca){logger['info'](_0x8a8a('0x13'),_0x497b8a,_0x8a8a('0x14'));logger[_0x8a8a('0x15')](_0x8a8a('0x16'),_0x497b8a,'request\x20sent',JSON[_0x8a8a('0x17')](_0xb13fca));if(_0xb13fca['error']){if(_0xb13fca[_0x8a8a('0x18')][_0x8a8a('0x19')]===0x1f4){logger[_0x8a8a('0x18')](_0x8a8a('0x13'),_0x497b8a,_0xb13fca[_0x8a8a('0x18')][_0x8a8a('0x1a')]);return _0x532621(_0xb13fca[_0x8a8a('0x18')]['message']);}logger[_0x8a8a('0x18')]('FaxMessage,\x20%s,\x20%s',_0x497b8a,_0xb13fca[_0x8a8a('0x18')][_0x8a8a('0x1a')]);return _0x3d3a00(_0xb13fca[_0x8a8a('0x18')][_0x8a8a('0x1a')]);}else{logger[_0x8a8a('0x1b')]('FaxMessage,\x20%s,\x20%s',_0x497b8a,_0x8a8a('0x14'));_0x3d3a00(_0xb13fca[_0x8a8a('0x1c')][_0x8a8a('0x1a')]);}})[_0x8a8a('0x1d')](function(_0x299827){logger[_0x8a8a('0x18')]('FaxMessage,\x20%s,\x20%s',_0x497b8a,_0x299827);_0x532621(_0x299827);});});}exports['CreateFaxMessage']=function(_0x5181b2){var _0x4e3d0a=this;return new Promise(function(_0x4a6601,_0x3a9b2f){return db[_0x8a8a('0x1e')][_0x8a8a('0x1f')](_0x5181b2[_0x8a8a('0x20')],{'raw':_0x5181b2[_0x8a8a('0x21')]?_0x5181b2[_0x8a8a('0x21')][_0x8a8a('0x22')]===undefined?!![]:![]:!![]})[_0x8a8a('0x12')](function(_0x25d5d4){logger[_0x8a8a('0x1b')](_0x8a8a('0x23'),_0x5181b2);logger[_0x8a8a('0x15')](_0x8a8a('0x23'),_0x5181b2,JSON[_0x8a8a('0x17')](_0x25d5d4));_0x4a6601(_0x25d5d4);})[_0x8a8a('0x1d')](function(_0x545a38){logger[_0x8a8a('0x18')](_0x8a8a('0x23'),_0x545a38[_0x8a8a('0x1a')],_0x5181b2);_0x3a9b2f(_0x4e3d0a[_0x8a8a('0x18')](0x1f4,_0x545a38[_0x8a8a('0x1a')]));});});};exports[_0x8a8a('0x24')]=function(_0x3aa46d){var _0x5f4dcc=this;return new Promise(function(_0x31d21a,_0x38c1e0){return db[_0x8a8a('0x1e')]['update'](_0x3aa46d['body'],{'raw':_0x3aa46d[_0x8a8a('0x21')]?_0x3aa46d[_0x8a8a('0x21')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3aa46d['options']?_0x3aa46d['options'][_0x8a8a('0x25')]||null:null,'attributes':_0x3aa46d['options']?_0x3aa46d[_0x8a8a('0x21')][_0x8a8a('0x26')]||null:null,'limit':_0x3aa46d['options']?_0x3aa46d[_0x8a8a('0x21')][_0x8a8a('0x27')]||null:null})[_0x8a8a('0x12')](function(_0x8df0cb){logger[_0x8a8a('0x1b')](_0x8a8a('0x24'),_0x3aa46d);logger[_0x8a8a('0x15')](_0x8a8a('0x24'),_0x3aa46d,JSON['stringify'](_0x8df0cb));_0x31d21a(_0x8df0cb);})['catch'](function(_0x56e79e){logger[_0x8a8a('0x18')](_0x8a8a('0x24'),_0x56e79e['message'],_0x3aa46d);_0x38c1e0(_0x5f4dcc[_0x8a8a('0x18')](0x1f4,_0x56e79e[_0x8a8a('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index d3595ec..89e7791 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 _0x1942=['emit','removeListener','faxMessage:','./faxMessage.events','remove','update'];(function(_0x355ad5,_0x55e5a7){var _0x26c569=function(_0x276d4d){while(--_0x276d4d){_0x355ad5['push'](_0x355ad5['shift']());}};_0x26c569(++_0x55e5a7);}(_0x1942,0x189));var _0x2194=function(_0x381409,_0xbc14e){_0x381409=_0x381409-0x0;var _0x5dbbb8=_0x1942[_0x381409];return _0x5dbbb8;};'use strict';var FaxMessageEvents=require(_0x2194('0x0'));var events=['save',_0x2194('0x1'),_0x2194('0x2')];function createListener(_0x49450d,_0x362f2e){return function(_0x58721e){_0x362f2e[_0x2194('0x3')](_0x49450d,_0x58721e);};}function removeListener(_0x1f18ed,_0x319784){return function(){FaxMessageEvents[_0x2194('0x4')](_0x1f18ed,_0x319784);};}exports['register']=function(_0x2388a3){for(var _0x5d29a2=0x0,_0x469d62=events['length'];_0x5d29a2<_0x469d62;_0x5d29a2++){var _0xf521f2=events[_0x5d29a2];var _0x406a85=createListener(_0x2194('0x5')+_0xf521f2,_0x2388a3);FaxMessageEvents['on'](_0xf521f2,_0x406a85);}}; \ No newline at end of file +var _0x58f4=['faxMessage:','./faxMessage.events','save','remove','update','removeListener','register'];(function(_0x4cccb4,_0x9768b4){var _0x158708=function(_0x84ecc0){while(--_0x84ecc0){_0x4cccb4['push'](_0x4cccb4['shift']());}};_0x158708(++_0x9768b4);}(_0x58f4,0xef));var _0x458f=function(_0xcd76c6,_0x1633bc){_0xcd76c6=_0xcd76c6-0x0;var _0x141a0b=_0x58f4[_0xcd76c6];return _0x141a0b;};'use strict';var FaxMessageEvents=require(_0x458f('0x0'));var events=[_0x458f('0x1'),_0x458f('0x2'),_0x458f('0x3')];function createListener(_0x35b8d2,_0x4d251d){return function(_0x5a30a9){_0x4d251d['emit'](_0x35b8d2,_0x5a30a9);};}function removeListener(_0x4c4d1a,_0x2569df){return function(){FaxMessageEvents[_0x458f('0x4')](_0x4c4d1a,_0x2569df);};}exports[_0x458f('0x5')]=function(_0x2006df){for(var _0x505db5=0x0,_0x3e0adb=events['length'];_0x505db5<_0x3e0adb;_0x505db5++){var _0x59b589=events[_0x505db5];var _0x1e9776=createListener(_0x458f('0x6')+_0x59b589,_0x2006df);FaxMessageEvents['on'](_0x59b589,_0x1e9776);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 3af332d..95ddf16 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 _0x3140=['download','post','tracked','fax','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x5e48f5,_0x534889){var _0x100afa=function(_0x2d634d){while(--_0x2d634d){_0x5e48f5['push'](_0x5e48f5['shift']());}};_0x100afa(++_0x534889);}(_0x3140,0xaf));var _0x0314=function(_0x2540db,_0x9b7318){_0x2540db=_0x2540db-0x0;var _0xbf6e9f=_0x3140[_0x2540db];return _0xbf6e9f;};'use strict';var multer=require(_0x0314('0x0'));var util=require(_0x0314('0x1'));var path=require(_0x0314('0x2'));var timeout=require(_0x0314('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0314('0x4'));var auth=require(_0x0314('0x5'));var interaction=require(_0x0314('0x6'));var config=require(_0x0314('0x7'));var controller=require(_0x0314('0x8'));router[_0x0314('0x9')]('/',auth[_0x0314('0xa')](),controller[_0x0314('0xb')]);router[_0x0314('0x9')](_0x0314('0xc'),auth[_0x0314('0xa')](),controller['describe']);router[_0x0314('0x9')](_0x0314('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x0314('0x9')]('/:id/download',auth[_0x0314('0xa')](),controller[_0x0314('0xe')]);router[_0x0314('0xf')]('/',auth[_0x0314('0xa')](),interaction[_0x0314('0x10')](_0x0314('0x11'),'faxmessage:create'),controller[_0x0314('0x12')]);router[_0x0314('0x13')](_0x0314('0xd'),auth[_0x0314('0xa')](),controller[_0x0314('0x14')]);router[_0x0314('0x13')](_0x0314('0x15'),auth['isAuthenticated'](),controller[_0x0314('0x16')]);router[_0x0314('0x13')](_0x0314('0x17'),auth[_0x0314('0xa')](),controller[_0x0314('0x18')]);router[_0x0314('0x19')](_0x0314('0xd'),auth[_0x0314('0xa')](),controller['destroy']);module[_0x0314('0x1a')]=router; \ No newline at end of file +var _0x44a3=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/:id','show','download','fax','create','put','update','/:id/accept','accept','reject','delete','exports'];(function(_0x5e0d8e,_0x175a7d){var _0x3d6883=function(_0x562d9c){while(--_0x562d9c){_0x5e0d8e['push'](_0x5e0d8e['shift']());}};_0x3d6883(++_0x175a7d);}(_0x44a3,0x1a9));var _0x344a=function(_0x27650e,_0x278f7a){_0x27650e=_0x27650e-0x0;var _0x28fe08=_0x44a3[_0x27650e];return _0x28fe08;};'use strict';var multer=require(_0x344a('0x0'));var util=require(_0x344a('0x1'));var path=require(_0x344a('0x2'));var timeout=require(_0x344a('0x3'));var express=require(_0x344a('0x4'));var router=express[_0x344a('0x5')]();var fs_extra=require(_0x344a('0x6'));var auth=require(_0x344a('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x344a('0x8'));var controller=require(_0x344a('0x9'));router[_0x344a('0xa')]('/',auth[_0x344a('0xb')](),controller[_0x344a('0xc')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x344a('0xa')](_0x344a('0xd'),auth[_0x344a('0xb')](),controller[_0x344a('0xe')]);router[_0x344a('0xa')]('/:id/download',auth[_0x344a('0xb')](),controller[_0x344a('0xf')]);router['post']('/',auth[_0x344a('0xb')](),interaction['tracked'](_0x344a('0x10'),'faxmessage:create'),controller[_0x344a('0x11')]);router[_0x344a('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x344a('0x13')]);router[_0x344a('0x12')](_0x344a('0x14'),auth[_0x344a('0xb')](),controller[_0x344a('0x15')]);router[_0x344a('0x12')]('/:id/reject',auth[_0x344a('0xb')](),controller[_0x344a('0x16')]);router[_0x344a('0x17')](_0x344a('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x344a('0x18')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index b7e3c7b..fc301a6 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 _0x5c28=['sequelize','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x5c28,0x1b8));var _0x85c2=function(_0xd0485c,_0x2b626c){_0xd0485c=_0xd0485c-0x0;var _0x19d289=_0x5c28[_0xd0485c];return _0x19d289;};'use strict';var Sequelize=require(_0x85c2('0x0'));module['exports']={'name':{'type':Sequelize[_0x85c2('0x1')],'unique':_0x85c2('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x85c2('0x1')]},'timeout':{'type':Sequelize[_0x85c2('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x85c2('0x4')](_0x85c2('0x5'),_0x85c2('0x6'),_0x85c2('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x85c2('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7181=['rrmemory','roundrobin','exports','name','STRING','INTEGER','ENUM'];(function(_0x12a2a6,_0x374ff1){var _0x1754ae=function(_0x49d787){while(--_0x49d787){_0x12a2a6['push'](_0x12a2a6['shift']());}};_0x1754ae(++_0x374ff1);}(_0x7181,0xb1));var _0x1718=function(_0x8c6164,_0x1dc7db){_0x8c6164=_0x8c6164-0x0;var _0x1ca172=_0x7181[_0x8c6164];return _0x1ca172;};'use strict';var Sequelize=require('sequelize');module[_0x1718('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x1718('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1718('0x2')]},'timeout':{'type':Sequelize[_0x1718('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1718('0x4')](_0x1718('0x5'),'beepall',_0x1718('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x1718('0x3')],'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 0be2d5f..3e936a8 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 _0x8a79=['../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','localhost','redis','./faxQueue.socket','register','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','get','FaxQueues','destroy','then','sendStatus','error','name','index','map','FaxQueue','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','create','body','role','user','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','pick','FaxQueueId','User','findAndCountAll','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','order','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','select','tq.TeamId','from','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','jsforce','querystring','ioredis'];(function(_0x30e004,_0x46f8c2){var _0x5ca247=function(_0x20d80f){while(--_0x20d80f){_0x30e004['push'](_0x30e004['shift']());}};_0x5ca247(++_0x46f8c2);}(_0x8a79,0x189));var _0x98a7=function(_0x216ab3,_0x44274a){_0x216ab3=_0x216ab3-0x0;var _0x2ee4cf=_0x8a79[_0x216ab3];return _0x2ee4cf;};'use strict';var emlformat=require(_0x98a7('0x0'));var rimraf=require(_0x98a7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x98a7('0x2'));var rp=require(_0x98a7('0x3'));var moment=require(_0x98a7('0x4'));var BPromise=require(_0x98a7('0x5'));var Mustache=require(_0x98a7('0x6'));var util=require(_0x98a7('0x7'));var path=require(_0x98a7('0x8'));var sox=require(_0x98a7('0x9'));var csv=require(_0x98a7('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x98a7('0xb'));var crypto=require('crypto');var jsforce=require(_0x98a7('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x98a7('0xa'));var querystring=require(_0x98a7('0xd'));var Papa=require('papaparse');var Redis=require(_0x98a7('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x98a7('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x98a7('0x10'));var utils=require('../../config/utils');var config=require(_0x98a7('0x11'));var licenseUtil=require(_0x98a7('0x12'));var db=require(_0x98a7('0x13'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x98a7('0x14'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x98a7('0x15')]));require(_0x98a7('0x16'))[_0x98a7('0x17')](socket);function respondWithStatusCode(_0x5d6599,_0x3734ad){_0x3734ad=_0x3734ad||0xcc;return function(_0x37c95e){if(_0x37c95e){return _0x5d6599['sendStatus'](_0x3734ad);}return _0x5d6599[_0x98a7('0x18')](_0x3734ad)[_0x98a7('0x19')]();};}function respondWithResult(_0x548021,_0x120ff8){_0x120ff8=_0x120ff8||0xc8;return function(_0x282c06){if(_0x282c06){return _0x548021[_0x98a7('0x18')](_0x120ff8)[_0x98a7('0x1a')](_0x282c06);}};}function respondWithFilteredResult(_0x15d227,_0x18089e){return function(_0x558020){if(_0x558020){var _0x1c59dc=typeof _0x18089e[_0x98a7('0x1b')]==='undefined'&&typeof _0x18089e[_0x98a7('0x1c')]===_0x98a7('0x1d');var _0x2ba068=_0x558020[_0x98a7('0x1e')];var _0x202873=_0x1c59dc?0x0:_0x18089e['offset'];var _0x44606a=_0x1c59dc?_0x558020[_0x98a7('0x1e')]:_0x18089e[_0x98a7('0x1b')]+_0x18089e['limit'];var _0x3b4bda;if(_0x44606a>=_0x2ba068){_0x44606a=_0x2ba068;_0x3b4bda=0xc8;}else{_0x3b4bda=0xce;}_0x15d227[_0x98a7('0x18')](_0x3b4bda);return _0x15d227[_0x98a7('0x1f')](_0x98a7('0x20'),_0x202873+'-'+_0x44606a+'/'+_0x2ba068)[_0x98a7('0x1a')](_0x558020);}return null;};}function patchUpdates(_0x470781){return function(_0x3430e4){try{jsonpatch[_0x98a7('0x21')](_0x3430e4,_0x470781,!![]);}catch(_0x2ec291){return BPromise['reject'](_0x2ec291);}return _0x3430e4[_0x98a7('0x22')]();};}function saveUpdates(_0x1eaf2a,_0x29d8a6){return function(_0x31b587){if(_0x31b587){return _0x31b587[_0x98a7('0x23')](_0x1eaf2a)['then'](function(_0x12a670){return _0x12a670;});}return null;};}function removeEntity(_0x5c04ca,_0x514c09){return function(_0x3a3fbe){if(_0x3a3fbe){return _0x3a3fbe['destroy']()['then'](function(){var _0x55fb69=_0x3a3fbe[_0x98a7('0x24')]({'plain':!![]});var _0x195a90=_0x98a7('0x25');return db['UserProfileResource'][_0x98a7('0x26')]({'where':{'type':_0x195a90,'resourceId':_0x55fb69['id']}})[_0x98a7('0x27')](function(){return _0x3a3fbe;});})[_0x98a7('0x27')](function(){_0x5c04ca[_0x98a7('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e88c8,_0x56f7de){return function(_0x5d62c7){if(!_0x5d62c7){_0x1e88c8[_0x98a7('0x28')](0x194);}return _0x5d62c7;};}function handleError(_0x384097,_0x1851ae){_0x1851ae=_0x1851ae||0x1f4;return function(_0x491136){logger[_0x98a7('0x29')](_0x491136['stack']);if(_0x491136[_0x98a7('0x2a')]){delete _0x491136[_0x98a7('0x2a')];}_0x384097[_0x98a7('0x18')](_0x1851ae)['send'](_0x491136);};}exports[_0x98a7('0x2b')]=function(_0x33e959,_0x41a9db){var _0x3a86d8={},_0x5029bf={},_0x28d275={'count':0x0,'rows':[]};var _0x3e8124=_[_0x98a7('0x2c')](db[_0x98a7('0x2d')]['rawAttributes'],function(_0x56008b){return{'name':_0x56008b[_0x98a7('0x2e')],'type':_0x56008b[_0x98a7('0x2f')][_0x98a7('0x30')]};});_0x5029bf['model']=_[_0x98a7('0x2c')](_0x3e8124,_0x98a7('0x2a'));_0x5029bf[_0x98a7('0x31')]=_['keys'](_0x33e959[_0x98a7('0x31')]);_0x5029bf[_0x98a7('0x32')]=_[_0x98a7('0x33')](_0x5029bf[_0x98a7('0x34')],_0x5029bf[_0x98a7('0x31')]);_0x3a86d8[_0x98a7('0x35')]=_[_0x98a7('0x33')](_0x5029bf[_0x98a7('0x34')],qs[_0x98a7('0x36')](_0x33e959[_0x98a7('0x31')][_0x98a7('0x36')]));_0x3a86d8[_0x98a7('0x35')]=_0x3a86d8[_0x98a7('0x35')][_0x98a7('0x37')]?_0x3a86d8[_0x98a7('0x35')]:_0x5029bf[_0x98a7('0x34')];if(!_0x33e959[_0x98a7('0x31')][_0x98a7('0x38')](_0x98a7('0x39'))){_0x3a86d8[_0x98a7('0x1c')]=qs[_0x98a7('0x1c')](_0x33e959[_0x98a7('0x31')][_0x98a7('0x1c')]);_0x3a86d8[_0x98a7('0x1b')]=qs['offset'](_0x33e959[_0x98a7('0x31')][_0x98a7('0x1b')]);}_0x3a86d8['order']=qs[_0x98a7('0x3a')](_0x33e959[_0x98a7('0x31')]['sort']);_0x3a86d8[_0x98a7('0x3b')]=qs[_0x98a7('0x32')](_['pick'](_0x33e959[_0x98a7('0x31')],_0x5029bf[_0x98a7('0x32')]),_0x3e8124);if(_0x33e959[_0x98a7('0x31')][_0x98a7('0x3c')]){_0x3a86d8[_0x98a7('0x3b')]=_[_0x98a7('0x3d')](_0x3a86d8[_0x98a7('0x3b')],{'$or':_[_0x98a7('0x2c')](_0x3e8124,function(_0x3bfcd9){if(_0x3bfcd9['type']!=='VIRTUAL'){var _0x49352f={};_0x49352f[_0x3bfcd9[_0x98a7('0x2a')]]={'$like':'%'+_0x33e959[_0x98a7('0x31')][_0x98a7('0x3c')]+'%'};return _0x49352f;}})});}_0x3a86d8=_[_0x98a7('0x3d')]({},_0x3a86d8,_0x33e959[_0x98a7('0x3e')]);var _0x59d9e6={'where':_0x3a86d8['where']};return db[_0x98a7('0x2d')][_0x98a7('0x1e')](_0x59d9e6)[_0x98a7('0x27')](function(_0x14850b){_0x28d275['count']=_0x14850b;if(_0x33e959[_0x98a7('0x31')][_0x98a7('0x3f')]){_0x3a86d8[_0x98a7('0x40')]=[{'all':!![]}];}return db['FaxQueue'][_0x98a7('0x41')](_0x3a86d8);})['then'](function(_0x532935){_0x28d275[_0x98a7('0x42')]=_0x532935;return _0x28d275;})[_0x98a7('0x27')](respondWithFilteredResult(_0x41a9db,_0x3a86d8))[_0x98a7('0x43')](handleError(_0x41a9db,null));};exports[_0x98a7('0x44')]=function(_0x46e620,_0x5c08bd){var _0x4adf72={'raw':!![],'where':{'id':_0x46e620[_0x98a7('0x45')]['id']}},_0x2b4789={};_0x2b4789[_0x98a7('0x34')]=_[_0x98a7('0x46')](db[_0x98a7('0x2d')][_0x98a7('0x47')]);_0x2b4789[_0x98a7('0x31')]=_['keys'](_0x46e620[_0x98a7('0x31')]);_0x2b4789['filters']=_[_0x98a7('0x33')](_0x2b4789['model'],_0x2b4789[_0x98a7('0x31')]);_0x4adf72[_0x98a7('0x35')]=_[_0x98a7('0x33')](_0x2b4789[_0x98a7('0x34')],qs['fields'](_0x46e620['query'][_0x98a7('0x36')]));_0x4adf72[_0x98a7('0x35')]=_0x4adf72['attributes'][_0x98a7('0x37')]?_0x4adf72['attributes']:_0x2b4789[_0x98a7('0x34')];if(_0x46e620['query'][_0x98a7('0x3f')]){_0x4adf72[_0x98a7('0x40')]=[{'all':!![]}];}_0x4adf72=_[_0x98a7('0x3d')]({},_0x4adf72,_0x46e620[_0x98a7('0x3e')]);return db[_0x98a7('0x2d')]['find'](_0x4adf72)[_0x98a7('0x27')](handleEntityNotFound(_0x5c08bd,null))[_0x98a7('0x27')](respondWithResult(_0x5c08bd,null))[_0x98a7('0x43')](handleError(_0x5c08bd,null));};exports[_0x98a7('0x48')]=function(_0x4fcdf4,_0x46cdb9){return db[_0x98a7('0x2d')][_0x98a7('0x48')](_0x4fcdf4[_0x98a7('0x49')],{})[_0x98a7('0x27')](function(_0x4f343e){var _0x82ba1=_0x4fcdf4['user'][_0x98a7('0x24')]({'plain':!![]});if(!_0x82ba1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x82ba1[_0x98a7('0x4a')]===_0x98a7('0x4b')){var _0x33fe7a=_0x4f343e[_0x98a7('0x24')]({'plain':!![]});var _0xbbf0e3='FaxQueues';return db['UserProfileSection'][_0x98a7('0x4c')]({'where':{'name':_0xbbf0e3,'userProfileId':_0x82ba1[_0x98a7('0x4d')]},'raw':!![]})[_0x98a7('0x27')](function(_0x1489c8){if(_0x1489c8&&_0x1489c8[_0x98a7('0x4e')]===0x0){return db['UserProfileResource'][_0x98a7('0x48')]({'name':_0x33fe7a['name'],'resourceId':_0x33fe7a['id'],'type':_0x1489c8[_0x98a7('0x2a')],'sectionId':_0x1489c8['id']},{})[_0x98a7('0x27')](function(){return _0x4f343e;});}else{return _0x4f343e;}})[_0x98a7('0x43')](function(_0x5a1624){logger[_0x98a7('0x29')](_0x98a7('0x4f'),_0x5a1624);throw _0x5a1624;});}return _0x4f343e;})[_0x98a7('0x27')](respondWithResult(_0x46cdb9,0xc9))['catch'](handleError(_0x46cdb9,null));};exports[_0x98a7('0x23')]=function(_0x2b242e,_0x370b58){if(_0x2b242e[_0x98a7('0x49')]['id']){delete _0x2b242e[_0x98a7('0x49')]['id'];}return db['FaxQueue']['find']({'where':{'id':_0x2b242e[_0x98a7('0x45')]['id']}})[_0x98a7('0x27')](handleEntityNotFound(_0x370b58,null))[_0x98a7('0x27')](saveUpdates(_0x2b242e[_0x98a7('0x49')],null))[_0x98a7('0x27')](respondWithResult(_0x370b58,null))['catch'](handleError(_0x370b58,null));};exports[_0x98a7('0x26')]=function(_0x595922,_0x2c9386){return db[_0x98a7('0x2d')]['find']({'where':{'id':_0x595922['params']['id']}})[_0x98a7('0x27')](handleEntityNotFound(_0x2c9386,null))[_0x98a7('0x27')](removeEntity(_0x2c9386,null))[_0x98a7('0x43')](handleError(_0x2c9386,null));};exports['describe']=function(_0x480ca9,_0x1e79ab){return db[_0x98a7('0x2d')][_0x98a7('0x50')]()[_0x98a7('0x27')](respondWithResult(_0x1e79ab,null))['catch'](handleError(_0x1e79ab,null));};exports[_0x98a7('0x51')]=function(_0x4f9019,_0x463f29,_0x363cac){var _0x31b9d0={'raw':!![],'where':{}},_0x21a58d={},_0x5abf08;return db['FaxQueue'][_0x98a7('0x52')]({'where':{'id':_0x4f9019[_0x98a7('0x45')]['id']}})[_0x98a7('0x27')](handleEntityNotFound(_0x463f29,null))[_0x98a7('0x27')](function(_0x4345c6){if(_0x4345c6){_0x5abf08=_0x4345c6[_0x98a7('0x24')]({'plain':!![]});_0x21a58d[_0x98a7('0x34')]=_[_0x98a7('0x46')](db[_0x98a7('0x53')][_0x98a7('0x47')]);_0x21a58d['query']=_[_0x98a7('0x46')](_0x4f9019['query']);_0x21a58d[_0x98a7('0x32')]=_[_0x98a7('0x33')](_0x21a58d[_0x98a7('0x34')],_0x21a58d['query']);_0x31b9d0['attributes']=_[_0x98a7('0x33')](_0x21a58d[_0x98a7('0x34')],qs[_0x98a7('0x36')](_0x4f9019[_0x98a7('0x31')]['fields']));_0x31b9d0[_0x98a7('0x35')]=_0x31b9d0[_0x98a7('0x35')][_0x98a7('0x37')]?_0x31b9d0[_0x98a7('0x35')]:_0x21a58d[_0x98a7('0x34')];if(!_0x4f9019[_0x98a7('0x31')][_0x98a7('0x38')](_0x98a7('0x39'))){_0x31b9d0['limit']=qs[_0x98a7('0x1c')](_0x4f9019[_0x98a7('0x31')][_0x98a7('0x1c')]);_0x31b9d0[_0x98a7('0x1b')]=qs[_0x98a7('0x1b')](_0x4f9019[_0x98a7('0x31')][_0x98a7('0x1b')]);}_0x31b9d0['order']=qs[_0x98a7('0x3a')](_0x4f9019['query'][_0x98a7('0x3a')]);_0x31b9d0['where']=qs[_0x98a7('0x32')](_[_0x98a7('0x54')](_0x4f9019['query'],_0x21a58d['filters']));_0x31b9d0[_0x98a7('0x3b')][_0x98a7('0x55')]=_0x4345c6['id'];if(_0x4f9019[_0x98a7('0x31')][_0x98a7('0x3c')]){_0x31b9d0['where']=_[_0x98a7('0x3d')](_0x31b9d0[_0x98a7('0x3b')],{'$or':_[_0x98a7('0x2c')](_0x31b9d0[_0x98a7('0x35')],function(_0x58f92b){var _0x4709c4={};_0x4709c4[_0x58f92b]={'$like':'%'+_0x4f9019[_0x98a7('0x31')]['filter']+'%'};return _0x4709c4;})});}_0x31b9d0=_[_0x98a7('0x3d')]({},_0x31b9d0,_0x4f9019[_0x98a7('0x3e')]);return db['UserFaxQueue'][_0x98a7('0x41')](_0x31b9d0);}})['then'](function(_0xd7843a){if(_0xd7843a){return db[_0x98a7('0x56')][_0x98a7('0x57')]({'where':{'id':_[_0x98a7('0x2c')](_0xd7843a,'UserId'),'role':_0x98a7('0x58')},'attributes':['id',_0x98a7('0x2a'),_0x98a7('0x59'),_0x98a7('0x5a'),_0x98a7('0x5b')]});}})[_0x98a7('0x27')](function(_0x8488a2){if(_0x8488a2){return{'count':_0x8488a2[_0x98a7('0x1e')],'rows':_[_0x98a7('0x2c')](_0x8488a2[_0x98a7('0x42')],function(_0x36e8df){return{'membername':_0x36e8df[_0x98a7('0x2a')],'UserId':_0x36e8df['id'],'queue_name':_0x5abf08[_0x98a7('0x2a')],'FaxQueueId':_0x5abf08['id'],'interface':util[_0x98a7('0x5c')](_0x98a7('0x5d'),_0x98a7('0x5e'),_0x36e8df['name']),'penalty':0x0,'paused':_0x36e8df[_0x98a7('0x59')],'createdAt':_0x36e8df['createdAt'],'updatedAt':_0x36e8df[_0x98a7('0x5a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x98a7('0x27')](respondWithFilteredResult(_0x463f29,_0x31b9d0))['catch'](handleError(_0x463f29,null));};exports[_0x98a7('0x5f')]=function(_0x4cf974,_0x28338b,_0x903a8c){var _0x5c3148={};var _0x5d86d4={};var _0x2cf69b;var _0x378214;return db[_0x98a7('0x2d')][_0x98a7('0x52')]({'where':{'id':_0x4cf974[_0x98a7('0x45')]['id']}})['then'](handleEntityNotFound(_0x28338b,null))[_0x98a7('0x27')](function(_0x331a2f){if(_0x331a2f){_0x2cf69b=_0x331a2f;_0x5d86d4[_0x98a7('0x34')]=_[_0x98a7('0x46')](db[_0x98a7('0x60')][_0x98a7('0x47')]);_0x5d86d4[_0x98a7('0x31')]=_[_0x98a7('0x46')](_0x4cf974[_0x98a7('0x31')]);_0x5d86d4[_0x98a7('0x32')]=_[_0x98a7('0x33')](_0x5d86d4[_0x98a7('0x34')],_0x5d86d4[_0x98a7('0x31')]);_0x5c3148[_0x98a7('0x35')]=_['intersection'](_0x5d86d4[_0x98a7('0x34')],qs['fields'](_0x4cf974[_0x98a7('0x31')][_0x98a7('0x36')]));_0x5c3148['attributes']=_0x5c3148[_0x98a7('0x35')]['length']?_0x5c3148[_0x98a7('0x35')]:_0x5d86d4['model'];_0x5c3148[_0x98a7('0x61')]=qs['sort'](_0x4cf974[_0x98a7('0x31')][_0x98a7('0x3a')]);_0x5c3148[_0x98a7('0x3b')]=qs[_0x98a7('0x32')](_[_0x98a7('0x54')](_0x4cf974[_0x98a7('0x31')],_0x5d86d4[_0x98a7('0x32')]));if(_0x4cf974['query'][_0x98a7('0x3c')]){_0x5c3148[_0x98a7('0x3b')]=_[_0x98a7('0x3d')](_0x5c3148[_0x98a7('0x3b')],{'$or':_['map'](_0x5c3148['attributes'],function(_0xc78e3){var _0x5bae59={};_0x5bae59[_0xc78e3]={'$like':'%'+_0x4cf974[_0x98a7('0x31')][_0x98a7('0x3c')]+'%'};return _0x5bae59;})});}_0x5c3148=_['merge']({},_0x5c3148,_0x4cf974[_0x98a7('0x3e')]);return _0x2cf69b[_0x98a7('0x5f')](_0x5c3148);}})[_0x98a7('0x27')](function(_0x5e3f60){if(_0x5e3f60){_0x378214=_0x5e3f60[_0x98a7('0x37')];if(!_0x4cf974['query'][_0x98a7('0x38')](_0x98a7('0x39'))){_0x5c3148['limit']=qs['limit'](_0x4cf974['query'][_0x98a7('0x1c')]);_0x5c3148[_0x98a7('0x1b')]=qs[_0x98a7('0x1b')](_0x4cf974[_0x98a7('0x31')][_0x98a7('0x1b')]);}return _0x2cf69b['getTeams'](_0x5c3148);}})[_0x98a7('0x27')](function(_0x2336e0){if(_0x2336e0){return _0x2336e0?{'count':_0x378214,'rows':_0x2336e0}:null;}})[_0x98a7('0x27')](respondWithResult(_0x28338b,null))['catch'](handleError(_0x28338b,null));};exports[_0x98a7('0x62')]=function(_0x477d33,_0x33ecf7,_0x57b6ca){var _0x2223fe=_0x477d33[_0x98a7('0x49')][_0x98a7('0x63')];return db[_0x98a7('0x60')][_0x98a7('0x41')]({'where':{'id':_0x2223fe},'attributes':['id'],'include':[{'model':db[_0x98a7('0x56')],'as':_0x98a7('0x64'),'attributes':['id',_0x98a7('0x2a'),_0x98a7('0x65'),_0x98a7('0x66'),_0x98a7('0x67')],'raw':!![]}]})['then'](function(_0xdecee0){if(_0xdecee0){var _0x3f3eda=_['flatMap'](_0xdecee0,function(_0x507e82){var _0x5e8735=_0x507e82[_0x98a7('0x24')]({'plain':!![]});return _0x5e8735[_0x98a7('0x64')];});return db['FaxQueue'][_0x98a7('0x4c')]({'where':{'id':_0x477d33['params']['id']}})[_0x98a7('0x27')](function(_0x485999){return db[_0x98a7('0x68')][_0x98a7('0x69')](function(_0x2c911a){return _0x485999['addTeams'](_0x2223fe,{'transaction':_0x2c911a})[_0x98a7('0x27')](function(){return BPromise[_0x98a7('0x6a')](_0x3f3eda,function(_0x1598ae){return db[_0x98a7('0x53')][_0x98a7('0x6b')]({'where':{'UserId':_0x1598ae['id'],'FaxQueueId':_0x477d33[_0x98a7('0x45')]['id']},'transaction':_0x2c911a});});})[_0x98a7('0x27')](function(){_0x3f3eda[_0x98a7('0x6c')](function(_0x3495ff){socket[_0x98a7('0x6d')](_0x98a7('0x6e'),{'UserId':_0x3495ff['id'],'FaxQueueId':_0x485999['id']});});});});});}})[_0x98a7('0x27')](respondWithStatusCode(_0x33ecf7,null))[_0x98a7('0x43')](handleError(_0x33ecf7,null));};exports[_0x98a7('0x6f')]=function(_0x4fd7df,_0x3e371d,_0x148585){return db[_0x98a7('0x60')][_0x98a7('0x41')]({'where':{'id':_0x4fd7df[_0x98a7('0x31')]['ids']},'attributes':['id'],'include':[{'model':db[_0x98a7('0x56')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3e371d,null))['then'](function(_0x5b99d4){var _0xf123bc=_[_0x98a7('0x2c')](_0x5b99d4,'id');var _0x50338b=[];var _0x722b0b=[];var _0x51157b=squel[_0x98a7('0x70')]();_0x51157b['field'](_0x98a7('0x71'))[_0x98a7('0x72')](_0x98a7('0x73'),'tq')['join'](_0x98a7('0x74'),'ut',_0x98a7('0x75'))[_0x98a7('0x3b')](_0x98a7('0x76'),_0x4fd7df[_0x98a7('0x45')]['id']);for(var _0x1477a6=0x0;_0x1477a6<_0x5b99d4[_0x98a7('0x37')];_0x1477a6+=0x1){let _0x3cf892=_0x5b99d4[_0x1477a6];for(var _0x511425=0x0;_0x511425<_0x3cf892[_0x98a7('0x64')][_0x98a7('0x37')];_0x511425+=0x1){let _0x1c41a8=_0x3cf892[_0x98a7('0x64')][_0x511425];var _0x38713e=_0x51157b['clone']();_0x38713e['where']('ut.UserId\x20=\x20?',_0x1c41a8['id']);_0x722b0b['push'](db[_0x98a7('0x68')][_0x98a7('0x31')](_0x38713e[_0x98a7('0x77')](),{'type':db[_0x98a7('0x68')][_0x98a7('0x78')][_0x98a7('0x79')]})['then'](function(_0x161b62){if(_0x161b62[_0x98a7('0x37')]===0x1){return _0x1c41a8['id'];}else{var _0x469a22=_[_0x98a7('0x7a')](_[_0x98a7('0x2c')](_0x161b62,_0x98a7('0x7b')),function(_0x2bbf2e){return _[_0x98a7('0x7c')](_0xf123bc,_0x2bbf2e);});if(_0x469a22){return _0x1c41a8['id'];}}}));}}return BPromise[_0x98a7('0x7d')](_0x722b0b)[_0x98a7('0x27')](function(_0x37a7d1){_0x50338b=_(_0x50338b)[_0x98a7('0x7e')](_0x37a7d1)[_0x98a7('0x7f')]()['value']();return db[_0x98a7('0x2d')][_0x98a7('0x4c')]({'where':{'id':_0x4fd7df[_0x98a7('0x45')]['id']}})[_0x98a7('0x27')](function(_0x25aab8){return db[_0x98a7('0x68')][_0x98a7('0x69')](function(_0x3c7bbd){return _0x25aab8['removeTeams'](_0x4fd7df['query'][_0x98a7('0x63')],{'transaction':_0x3c7bbd})[_0x98a7('0x27')](function(){if(!_[_0x98a7('0x80')](_0x50338b)){return _0x25aab8[_0x98a7('0x81')](_0x50338b,{'transaction':_0x3c7bbd});}})['then'](function(){_0x50338b[_0x98a7('0x6c')](function(_0x40b8df){socket[_0x98a7('0x6d')](_0x98a7('0x82'),{'UserId':_0x40b8df,'FaxQueueId':_0x25aab8['id']});});});});});});})['then'](respondWithStatusCode(_0x3e371d,null))[_0x98a7('0x43')](handleError(_0x3e371d,null));};exports[_0x98a7('0x83')]=function(_0x1b4d4e,_0x4082a5,_0x8bd277){return db[_0x98a7('0x2d')][_0x98a7('0x4c')]({'where':{'id':_0x1b4d4e[_0x98a7('0x45')]['id']}})[_0x98a7('0x27')](handleEntityNotFound(_0x4082a5,null))['then'](function(_0xce02a6){if(_0xce02a6){return _0xce02a6['addAgents'](_0x1b4d4e['body'][_0x98a7('0x63')],_[_0x98a7('0x84')](_0x1b4d4e[_0x98a7('0x49')],[_0x98a7('0x63'),'id'])||{})[_0x98a7('0x85')](function(_0x18561d){for(var _0x3fbf35=0x0;_0x3fbf35<_0x1b4d4e[_0x98a7('0x49')][_0x98a7('0x63')]['length'];_0x3fbf35+=0x1){socket[_0x98a7('0x6d')](_0x98a7('0x6e'),{'UserId':Number(_0x1b4d4e[_0x98a7('0x49')][_0x98a7('0x63')][_0x3fbf35]),'FaxQueueId':Number(_0x1b4d4e[_0x98a7('0x45')]['id'])});}return _0x18561d;});}})[_0x98a7('0x27')](respondWithResult(_0x4082a5,null))[_0x98a7('0x43')](handleError(_0x4082a5,null));};exports[_0x98a7('0x81')]=function(_0xd709e8,_0x4f9593,_0x4d0f80){return db[_0x98a7('0x2d')][_0x98a7('0x4c')]({'where':{'id':_0xd709e8['params']['id']}})[_0x98a7('0x27')](handleEntityNotFound(_0x4f9593,null))[_0x98a7('0x27')](function(_0x35f352){if(_0x35f352){return _0x35f352['removeAgents'](_0xd709e8[_0x98a7('0x31')][_0x98a7('0x63')])['then'](function(){if(_[_0x98a7('0x86')](_0xd709e8['query']['ids'])){for(var _0x1c1336=0x0;_0x1c1336<_0xd709e8[_0x98a7('0x31')]['ids'][_0x98a7('0x37')];_0x1c1336+=0x1){socket[_0x98a7('0x6d')](_0x98a7('0x82'),{'UserId':Number(_0xd709e8[_0x98a7('0x31')][_0x98a7('0x63')][_0x1c1336]),'FaxQueueId':Number(_0xd709e8[_0x98a7('0x45')]['id'])});}}else{socket[_0x98a7('0x6d')]('userFaxQueue:remove',{'UserId':Number(_0xd709e8['query'][_0x98a7('0x63')]),'FaxQueueId':Number(_0xd709e8[_0x98a7('0x45')]['id'])});}});}})['then'](respondWithStatusCode(_0x4f9593,null))[_0x98a7('0x43')](handleError(_0x4f9593,null));};exports[_0x98a7('0x87')]=function(_0x27e6ef,_0x3fa887,_0x45bb35){var _0x27e823={};var _0x249fe9={};var _0xe30fb6;var _0x4b7812;return db[_0x98a7('0x2d')][_0x98a7('0x52')]({'where':{'id':_0x27e6ef[_0x98a7('0x45')]['id']}})[_0x98a7('0x27')](handleEntityNotFound(_0x3fa887,null))[_0x98a7('0x27')](function(_0x28f1d1){if(_0x28f1d1){_0xe30fb6=_0x28f1d1;_0x249fe9[_0x98a7('0x34')]=_[_0x98a7('0x46')](db[_0x98a7('0x56')]['rawAttributes']);_0x249fe9[_0x98a7('0x31')]=_[_0x98a7('0x46')](_0x27e6ef[_0x98a7('0x31')]);_0x249fe9[_0x98a7('0x32')]=_[_0x98a7('0x33')](_0x249fe9[_0x98a7('0x34')],_0x249fe9[_0x98a7('0x31')]);_0x27e823[_0x98a7('0x35')]=_['intersection'](_0x249fe9['model'],qs[_0x98a7('0x36')](_0x27e6ef[_0x98a7('0x31')]['fields']));_0x27e823[_0x98a7('0x35')]=_0x27e823['attributes']['length']?_0x27e823[_0x98a7('0x35')]:_0x249fe9[_0x98a7('0x34')];_0x27e823[_0x98a7('0x61')]=qs['sort'](_0x27e6ef[_0x98a7('0x31')][_0x98a7('0x3a')]);_0x27e823[_0x98a7('0x3b')]=qs['filters'](_[_0x98a7('0x54')](_0x27e6ef[_0x98a7('0x31')],_0x249fe9[_0x98a7('0x32')]));if(_0x27e6ef[_0x98a7('0x31')][_0x98a7('0x3c')]){_0x27e823['where']=_[_0x98a7('0x3d')](_0x27e823[_0x98a7('0x3b')],{'$or':_['map'](_0x27e823[_0x98a7('0x35')],function(_0x4c0938){var _0x2751bd={};_0x2751bd[_0x4c0938]={'$like':'%'+_0x27e6ef[_0x98a7('0x31')]['filter']+'%'};return _0x2751bd;})});}_0x27e823=_['merge']({},_0x27e823,_0x27e6ef[_0x98a7('0x3e')]);return _0xe30fb6[_0x98a7('0x87')](_0x27e823);}})[_0x98a7('0x27')](function(_0x2e5446){if(_0x2e5446){_0x4b7812=_0x2e5446[_0x98a7('0x37')];if(!_0x27e6ef[_0x98a7('0x31')][_0x98a7('0x38')](_0x98a7('0x39'))){_0x27e823[_0x98a7('0x1c')]=qs[_0x98a7('0x1c')](_0x27e6ef[_0x98a7('0x31')][_0x98a7('0x1c')]);_0x27e823['offset']=qs[_0x98a7('0x1b')](_0x27e6ef[_0x98a7('0x31')][_0x98a7('0x1b')]);}return _0xe30fb6[_0x98a7('0x87')](_0x27e823);}})[_0x98a7('0x27')](function(_0xafe8c0){if(_0xafe8c0){return _0xafe8c0?{'count':_0x4b7812,'rows':_0xafe8c0}:null;}})['then'](respondWithResult(_0x3fa887,null))['catch'](handleError(_0x3fa887,null));}; \ No newline at end of file +var _0x0b10=['moment','bluebird','mustache','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','FaxQueues','UserProfileResource','error','name','send','index','map','FaxQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','describe','getMembers','findOne','get','UserFaxQueue','FaxQueueId','findAll','User','UserId','faxPause','createdAt','rows','format','%s/%s','SIP','getTeams','addTeams','ids','Team','Agents','flatMap','each','findOrCreate','forEach','emit','field','tq.TeamId','from','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','sequelize','SELECT','TeamId','includes','all','union','value','transaction','removeAgents','userFaxQueue:remove','addAgents','omit','spread','userFaxQueue:save','isArray','getAgents','rimraf','fast-json-patch'];(function(_0x58b005,_0x305f62){var _0x3cc98d=function(_0x292914){while(--_0x292914){_0x58b005['push'](_0x58b005['shift']());}};_0x3cc98d(++_0x305f62);}(_0x0b10,0x196));var _0x00b1=function(_0x4a1d40,_0x4df729){_0x4a1d40=_0x4a1d40-0x0;var _0x3ad60b=_0x0b10[_0x4a1d40];return _0x3ad60b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x00b1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x00b1('0x1'));var rp=require('request-promise');var moment=require(_0x00b1('0x2'));var BPromise=require(_0x00b1('0x3'));var Mustache=require(_0x00b1('0x4'));var util=require('util');var path=require(_0x00b1('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x00b1('0x6'));var fs=require('fs');var fs_extra=require(_0x00b1('0x7'));var _=require('lodash');var squel=require(_0x00b1('0x8'));var crypto=require(_0x00b1('0x9'));var jsforce=require(_0x00b1('0xa'));var deskjs=require(_0x00b1('0xb'));var toCsv=require(_0x00b1('0xc'));var querystring=require(_0x00b1('0xd'));var Papa=require('papaparse');var Redis=require(_0x00b1('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x00b1('0xf'));var as=require(_0x00b1('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x00b1('0x11'))(_0x00b1('0x12'));var utils=require('../../config/utils');var config=require(_0x00b1('0x13'));var licenseUtil=require(_0x00b1('0x14'));var db=require('../../mysqldb')['db'];config[_0x00b1('0x15')]=_[_0x00b1('0x16')](config[_0x00b1('0x15')],{'host':_0x00b1('0x17'),'port':0x18eb});var socket=require(_0x00b1('0x18'))(new Redis(config[_0x00b1('0x15')]));require(_0x00b1('0x19'))[_0x00b1('0x1a')](socket);function respondWithStatusCode(_0x4cd9bc,_0x21d3f1){_0x21d3f1=_0x21d3f1||0xcc;return function(_0x8ae7b3){if(_0x8ae7b3){return _0x4cd9bc[_0x00b1('0x1b')](_0x21d3f1);}return _0x4cd9bc[_0x00b1('0x1c')](_0x21d3f1)[_0x00b1('0x1d')]();};}function respondWithResult(_0xcc0176,_0x5f1a1f){_0x5f1a1f=_0x5f1a1f||0xc8;return function(_0xb525c){if(_0xb525c){return _0xcc0176['status'](_0x5f1a1f)[_0x00b1('0x1e')](_0xb525c);}};}function respondWithFilteredResult(_0x3bc44f,_0x1312a5){return function(_0x175db0){if(_0x175db0){var _0x490ad6=typeof _0x1312a5[_0x00b1('0x1f')]===_0x00b1('0x20')&&typeof _0x1312a5['limit']===_0x00b1('0x20');var _0x384d5e=_0x175db0[_0x00b1('0x21')];var _0x4fa4f0=_0x490ad6?0x0:_0x1312a5[_0x00b1('0x1f')];var _0x50693d=_0x490ad6?_0x175db0[_0x00b1('0x21')]:_0x1312a5[_0x00b1('0x1f')]+_0x1312a5[_0x00b1('0x22')];var _0x1fbc12;if(_0x50693d>=_0x384d5e){_0x50693d=_0x384d5e;_0x1fbc12=0xc8;}else{_0x1fbc12=0xce;}_0x3bc44f[_0x00b1('0x1c')](_0x1fbc12);return _0x3bc44f['set'](_0x00b1('0x23'),_0x4fa4f0+'-'+_0x50693d+'/'+_0x384d5e)[_0x00b1('0x1e')](_0x175db0);}return null;};}function patchUpdates(_0x4b0003){return function(_0x3fad08){try{jsonpatch[_0x00b1('0x24')](_0x3fad08,_0x4b0003,!![]);}catch(_0x24c4a3){return BPromise[_0x00b1('0x25')](_0x24c4a3);}return _0x3fad08[_0x00b1('0x26')]();};}function saveUpdates(_0x38e328,_0x29dc0){return function(_0x39adeb){if(_0x39adeb){return _0x39adeb[_0x00b1('0x27')](_0x38e328)[_0x00b1('0x28')](function(_0x2e035a){return _0x2e035a;});}return null;};}function removeEntity(_0x3b1975,_0x5f4407){return function(_0x33c92e){if(_0x33c92e){return _0x33c92e[_0x00b1('0x29')]()[_0x00b1('0x28')](function(){var _0x3577ce=_0x33c92e['get']({'plain':!![]});var _0x495902=_0x00b1('0x2a');return db[_0x00b1('0x2b')][_0x00b1('0x29')]({'where':{'type':_0x495902,'resourceId':_0x3577ce['id']}})[_0x00b1('0x28')](function(){return _0x33c92e;});})[_0x00b1('0x28')](function(){_0x3b1975[_0x00b1('0x1c')](0xcc)[_0x00b1('0x1d')]();});}};}function handleEntityNotFound(_0x1bb58b,_0x16d21b){return function(_0x2a6178){if(!_0x2a6178){_0x1bb58b[_0x00b1('0x1b')](0x194);}return _0x2a6178;};}function handleError(_0xd83b64,_0x2b2abc){_0x2b2abc=_0x2b2abc||0x1f4;return function(_0x51bdad){logger[_0x00b1('0x2c')](_0x51bdad['stack']);if(_0x51bdad[_0x00b1('0x2d')]){delete _0x51bdad['name'];}_0xd83b64[_0x00b1('0x1c')](_0x2b2abc)[_0x00b1('0x2e')](_0x51bdad);};}exports[_0x00b1('0x2f')]=function(_0x54fc7d,_0x383c41){var _0x2f8648={},_0x3757b9={},_0x140b48={'count':0x0,'rows':[]};var _0x4f8918=_[_0x00b1('0x30')](db[_0x00b1('0x31')][_0x00b1('0x32')],function(_0x2a4587){return{'name':_0x2a4587[_0x00b1('0x33')],'type':_0x2a4587[_0x00b1('0x34')][_0x00b1('0x35')]};});_0x3757b9[_0x00b1('0x36')]=_['map'](_0x4f8918,_0x00b1('0x2d'));_0x3757b9[_0x00b1('0x37')]=_[_0x00b1('0x38')](_0x54fc7d['query']);_0x3757b9[_0x00b1('0x39')]=_[_0x00b1('0x3a')](_0x3757b9[_0x00b1('0x36')],_0x3757b9[_0x00b1('0x37')]);_0x2f8648['attributes']=_[_0x00b1('0x3a')](_0x3757b9[_0x00b1('0x36')],qs[_0x00b1('0x3b')](_0x54fc7d[_0x00b1('0x37')][_0x00b1('0x3b')]));_0x2f8648[_0x00b1('0x3c')]=_0x2f8648[_0x00b1('0x3c')]['length']?_0x2f8648[_0x00b1('0x3c')]:_0x3757b9[_0x00b1('0x36')];if(!_0x54fc7d[_0x00b1('0x37')][_0x00b1('0x3d')](_0x00b1('0x3e'))){_0x2f8648[_0x00b1('0x22')]=qs[_0x00b1('0x22')](_0x54fc7d[_0x00b1('0x37')]['limit']);_0x2f8648[_0x00b1('0x1f')]=qs[_0x00b1('0x1f')](_0x54fc7d[_0x00b1('0x37')][_0x00b1('0x1f')]);}_0x2f8648[_0x00b1('0x3f')]=qs[_0x00b1('0x40')](_0x54fc7d[_0x00b1('0x37')][_0x00b1('0x40')]);_0x2f8648[_0x00b1('0x41')]=qs[_0x00b1('0x39')](_[_0x00b1('0x42')](_0x54fc7d[_0x00b1('0x37')],_0x3757b9[_0x00b1('0x39')]),_0x4f8918);if(_0x54fc7d[_0x00b1('0x37')][_0x00b1('0x43')]){_0x2f8648[_0x00b1('0x41')]=_[_0x00b1('0x44')](_0x2f8648['where'],{'$or':_['map'](_0x4f8918,function(_0x19b6a3){if(_0x19b6a3[_0x00b1('0x34')]!=='VIRTUAL'){var _0xc6793a={};_0xc6793a[_0x19b6a3[_0x00b1('0x2d')]]={'$like':'%'+_0x54fc7d[_0x00b1('0x37')][_0x00b1('0x43')]+'%'};return _0xc6793a;}})});}_0x2f8648=_['merge']({},_0x2f8648,_0x54fc7d[_0x00b1('0x45')]);var _0x16ac08={'where':_0x2f8648[_0x00b1('0x41')]};return db[_0x00b1('0x31')][_0x00b1('0x21')](_0x16ac08)[_0x00b1('0x28')](function(_0x589778){_0x140b48[_0x00b1('0x21')]=_0x589778;if(_0x54fc7d[_0x00b1('0x37')][_0x00b1('0x46')]){_0x2f8648[_0x00b1('0x47')]=[{'all':!![]}];}return db['FaxQueue']['findAll'](_0x2f8648);})[_0x00b1('0x28')](function(_0x3b6572){_0x140b48['rows']=_0x3b6572;return _0x140b48;})['then'](respondWithFilteredResult(_0x383c41,_0x2f8648))[_0x00b1('0x48')](handleError(_0x383c41,null));};exports[_0x00b1('0x49')]=function(_0x2c56d7,_0x26a801){var _0x2bc569={'raw':!![],'where':{'id':_0x2c56d7[_0x00b1('0x4a')]['id']}},_0x303424={};_0x303424[_0x00b1('0x36')]=_[_0x00b1('0x38')](db[_0x00b1('0x31')][_0x00b1('0x32')]);_0x303424[_0x00b1('0x37')]=_['keys'](_0x2c56d7[_0x00b1('0x37')]);_0x303424[_0x00b1('0x39')]=_[_0x00b1('0x3a')](_0x303424['model'],_0x303424['query']);_0x2bc569['attributes']=_[_0x00b1('0x3a')](_0x303424[_0x00b1('0x36')],qs[_0x00b1('0x3b')](_0x2c56d7[_0x00b1('0x37')][_0x00b1('0x3b')]));_0x2bc569[_0x00b1('0x3c')]=_0x2bc569[_0x00b1('0x3c')][_0x00b1('0x4b')]?_0x2bc569['attributes']:_0x303424[_0x00b1('0x36')];if(_0x2c56d7['query'][_0x00b1('0x46')]){_0x2bc569[_0x00b1('0x47')]=[{'all':!![]}];}_0x2bc569=_[_0x00b1('0x44')]({},_0x2bc569,_0x2c56d7[_0x00b1('0x45')]);return db[_0x00b1('0x31')][_0x00b1('0x4c')](_0x2bc569)['then'](handleEntityNotFound(_0x26a801,null))[_0x00b1('0x28')](respondWithResult(_0x26a801,null))['catch'](handleError(_0x26a801,null));};exports[_0x00b1('0x4d')]=function(_0x4219f8,_0x281a7a){return db[_0x00b1('0x31')][_0x00b1('0x4d')](_0x4219f8[_0x00b1('0x4e')],{})['then'](function(_0x2f6dc5){var _0x33a3be=_0x4219f8[_0x00b1('0x4f')]['get']({'plain':!![]});if(!_0x33a3be)throw new Error(_0x00b1('0x50'));if(_0x33a3be[_0x00b1('0x51')]===_0x00b1('0x4f')){var _0x13b6de=_0x2f6dc5['get']({'plain':!![]});var _0x50207a=_0x00b1('0x2a');return db[_0x00b1('0x52')][_0x00b1('0x4c')]({'where':{'name':_0x50207a,'userProfileId':_0x33a3be[_0x00b1('0x53')]},'raw':!![]})['then'](function(_0x5269e4){if(_0x5269e4&&_0x5269e4['autoAssociation']===0x0){return db[_0x00b1('0x2b')]['create']({'name':_0x13b6de['name'],'resourceId':_0x13b6de['id'],'type':_0x5269e4[_0x00b1('0x2d')],'sectionId':_0x5269e4['id']},{})[_0x00b1('0x28')](function(){return _0x2f6dc5;});}else{return _0x2f6dc5;}})[_0x00b1('0x48')](function(_0x5307df){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5307df);throw _0x5307df;});}return _0x2f6dc5;})['then'](respondWithResult(_0x281a7a,0xc9))[_0x00b1('0x48')](handleError(_0x281a7a,null));};exports['update']=function(_0x23621e,_0x5ad97c){if(_0x23621e[_0x00b1('0x4e')]['id']){delete _0x23621e[_0x00b1('0x4e')]['id'];}return db[_0x00b1('0x31')][_0x00b1('0x4c')]({'where':{'id':_0x23621e['params']['id']}})[_0x00b1('0x28')](handleEntityNotFound(_0x5ad97c,null))['then'](saveUpdates(_0x23621e[_0x00b1('0x4e')],null))[_0x00b1('0x28')](respondWithResult(_0x5ad97c,null))[_0x00b1('0x48')](handleError(_0x5ad97c,null));};exports[_0x00b1('0x29')]=function(_0x25a66c,_0x368d3e){return db[_0x00b1('0x31')]['find']({'where':{'id':_0x25a66c[_0x00b1('0x4a')]['id']}})['then'](handleEntityNotFound(_0x368d3e,null))['then'](removeEntity(_0x368d3e,null))[_0x00b1('0x48')](handleError(_0x368d3e,null));};exports[_0x00b1('0x54')]=function(_0x83d4ff,_0x1e39cf){return db['FaxQueue'][_0x00b1('0x54')]()[_0x00b1('0x28')](respondWithResult(_0x1e39cf,null))[_0x00b1('0x48')](handleError(_0x1e39cf,null));};exports[_0x00b1('0x55')]=function(_0x15add6,_0x1aab21,_0x57ac05){var _0x492d1d={'raw':!![],'where':{}},_0x3072b4={},_0x34a3bb;return db[_0x00b1('0x31')][_0x00b1('0x56')]({'where':{'id':_0x15add6[_0x00b1('0x4a')]['id']}})[_0x00b1('0x28')](handleEntityNotFound(_0x1aab21,null))[_0x00b1('0x28')](function(_0x3d202e){if(_0x3d202e){_0x34a3bb=_0x3d202e[_0x00b1('0x57')]({'plain':!![]});_0x3072b4[_0x00b1('0x36')]=_[_0x00b1('0x38')](db[_0x00b1('0x58')]['rawAttributes']);_0x3072b4[_0x00b1('0x37')]=_[_0x00b1('0x38')](_0x15add6[_0x00b1('0x37')]);_0x3072b4[_0x00b1('0x39')]=_[_0x00b1('0x3a')](_0x3072b4[_0x00b1('0x36')],_0x3072b4[_0x00b1('0x37')]);_0x492d1d[_0x00b1('0x3c')]=_['intersection'](_0x3072b4[_0x00b1('0x36')],qs['fields'](_0x15add6['query'][_0x00b1('0x3b')]));_0x492d1d[_0x00b1('0x3c')]=_0x492d1d[_0x00b1('0x3c')][_0x00b1('0x4b')]?_0x492d1d[_0x00b1('0x3c')]:_0x3072b4[_0x00b1('0x36')];if(!_0x15add6['query'][_0x00b1('0x3d')]('nolimit')){_0x492d1d['limit']=qs[_0x00b1('0x22')](_0x15add6[_0x00b1('0x37')][_0x00b1('0x22')]);_0x492d1d[_0x00b1('0x1f')]=qs[_0x00b1('0x1f')](_0x15add6[_0x00b1('0x37')]['offset']);}_0x492d1d[_0x00b1('0x3f')]=qs[_0x00b1('0x40')](_0x15add6[_0x00b1('0x37')][_0x00b1('0x40')]);_0x492d1d['where']=qs['filters'](_['pick'](_0x15add6[_0x00b1('0x37')],_0x3072b4['filters']));_0x492d1d[_0x00b1('0x41')][_0x00b1('0x59')]=_0x3d202e['id'];if(_0x15add6[_0x00b1('0x37')][_0x00b1('0x43')]){_0x492d1d[_0x00b1('0x41')]=_[_0x00b1('0x44')](_0x492d1d[_0x00b1('0x41')],{'$or':_['map'](_0x492d1d['attributes'],function(_0x6dcf31){var _0x356e1b={};_0x356e1b[_0x6dcf31]={'$like':'%'+_0x15add6[_0x00b1('0x37')]['filter']+'%'};return _0x356e1b;})});}_0x492d1d=_[_0x00b1('0x44')]({},_0x492d1d,_0x15add6['options']);return db[_0x00b1('0x58')][_0x00b1('0x5a')](_0x492d1d);}})[_0x00b1('0x28')](function(_0x581e69){if(_0x581e69){return db[_0x00b1('0x5b')]['findAndCountAll']({'where':{'id':_['map'](_0x581e69,_0x00b1('0x5c')),'role':'agent'},'attributes':['id','name',_0x00b1('0x5d'),'updatedAt',_0x00b1('0x5e')]});}})[_0x00b1('0x28')](function(_0x910567){if(_0x910567){return{'count':_0x910567['count'],'rows':_[_0x00b1('0x30')](_0x910567[_0x00b1('0x5f')],function(_0x4e7565){return{'membername':_0x4e7565[_0x00b1('0x2d')],'UserId':_0x4e7565['id'],'queue_name':_0x34a3bb['name'],'FaxQueueId':_0x34a3bb['id'],'interface':util[_0x00b1('0x60')](_0x00b1('0x61'),_0x00b1('0x62'),_0x4e7565[_0x00b1('0x2d')]),'penalty':0x0,'paused':_0x4e7565['faxPause'],'createdAt':_0x4e7565['createdAt'],'updatedAt':_0x4e7565['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1aab21,_0x492d1d))[_0x00b1('0x48')](handleError(_0x1aab21,null));};exports[_0x00b1('0x63')]=function(_0x19a706,_0x38ba93,_0x169c02){var _0x4ae1d5={};var _0x4a860d={};var _0x40edbd;var _0x2aa01b;return db['FaxQueue'][_0x00b1('0x56')]({'where':{'id':_0x19a706[_0x00b1('0x4a')]['id']}})[_0x00b1('0x28')](handleEntityNotFound(_0x38ba93,null))['then'](function(_0x39ae71){if(_0x39ae71){_0x40edbd=_0x39ae71;_0x4a860d[_0x00b1('0x36')]=_['keys'](db['Team']['rawAttributes']);_0x4a860d[_0x00b1('0x37')]=_[_0x00b1('0x38')](_0x19a706['query']);_0x4a860d['filters']=_[_0x00b1('0x3a')](_0x4a860d[_0x00b1('0x36')],_0x4a860d[_0x00b1('0x37')]);_0x4ae1d5[_0x00b1('0x3c')]=_[_0x00b1('0x3a')](_0x4a860d[_0x00b1('0x36')],qs[_0x00b1('0x3b')](_0x19a706[_0x00b1('0x37')][_0x00b1('0x3b')]));_0x4ae1d5[_0x00b1('0x3c')]=_0x4ae1d5['attributes'][_0x00b1('0x4b')]?_0x4ae1d5[_0x00b1('0x3c')]:_0x4a860d[_0x00b1('0x36')];_0x4ae1d5[_0x00b1('0x3f')]=qs['sort'](_0x19a706[_0x00b1('0x37')][_0x00b1('0x40')]);_0x4ae1d5[_0x00b1('0x41')]=qs['filters'](_['pick'](_0x19a706[_0x00b1('0x37')],_0x4a860d[_0x00b1('0x39')]));if(_0x19a706['query'][_0x00b1('0x43')]){_0x4ae1d5[_0x00b1('0x41')]=_[_0x00b1('0x44')](_0x4ae1d5[_0x00b1('0x41')],{'$or':_[_0x00b1('0x30')](_0x4ae1d5[_0x00b1('0x3c')],function(_0x11dcba){var _0x5dcb7e={};_0x5dcb7e[_0x11dcba]={'$like':'%'+_0x19a706[_0x00b1('0x37')][_0x00b1('0x43')]+'%'};return _0x5dcb7e;})});}_0x4ae1d5=_[_0x00b1('0x44')]({},_0x4ae1d5,_0x19a706[_0x00b1('0x45')]);return _0x40edbd[_0x00b1('0x63')](_0x4ae1d5);}})[_0x00b1('0x28')](function(_0x4595d1){if(_0x4595d1){_0x2aa01b=_0x4595d1['length'];if(!_0x19a706['query'][_0x00b1('0x3d')](_0x00b1('0x3e'))){_0x4ae1d5[_0x00b1('0x22')]=qs[_0x00b1('0x22')](_0x19a706[_0x00b1('0x37')][_0x00b1('0x22')]);_0x4ae1d5[_0x00b1('0x1f')]=qs[_0x00b1('0x1f')](_0x19a706[_0x00b1('0x37')]['offset']);}return _0x40edbd[_0x00b1('0x63')](_0x4ae1d5);}})[_0x00b1('0x28')](function(_0x312f6e){if(_0x312f6e){return _0x312f6e?{'count':_0x2aa01b,'rows':_0x312f6e}:null;}})[_0x00b1('0x28')](respondWithResult(_0x38ba93,null))[_0x00b1('0x48')](handleError(_0x38ba93,null));};exports[_0x00b1('0x64')]=function(_0x43a1ba,_0x3eb3d8,_0x528dea){var _0x4c333c=_0x43a1ba[_0x00b1('0x4e')][_0x00b1('0x65')];return db[_0x00b1('0x66')]['findAll']({'where':{'id':_0x4c333c},'attributes':['id'],'include':[{'model':db[_0x00b1('0x5b')],'as':_0x00b1('0x67'),'attributes':['id','name','online','voicePause','interface'],'raw':!![]}]})[_0x00b1('0x28')](function(_0x141216){if(_0x141216){var _0x297126=_[_0x00b1('0x68')](_0x141216,function(_0x26219b){var _0x214abf=_0x26219b['get']({'plain':!![]});return _0x214abf[_0x00b1('0x67')];});return db[_0x00b1('0x31')][_0x00b1('0x4c')]({'where':{'id':_0x43a1ba['params']['id']}})[_0x00b1('0x28')](function(_0x61c6e){return db['sequelize']['transaction'](function(_0x399db9){return _0x61c6e[_0x00b1('0x64')](_0x4c333c,{'transaction':_0x399db9})[_0x00b1('0x28')](function(){return BPromise[_0x00b1('0x69')](_0x297126,function(_0x251888){return db['UserFaxQueue'][_0x00b1('0x6a')]({'where':{'UserId':_0x251888['id'],'FaxQueueId':_0x43a1ba['params']['id']},'transaction':_0x399db9});});})[_0x00b1('0x28')](function(){_0x297126[_0x00b1('0x6b')](function(_0x457ae9){socket[_0x00b1('0x6c')]('userFaxQueue:save',{'UserId':_0x457ae9['id'],'FaxQueueId':_0x61c6e['id']});});});});});}})[_0x00b1('0x28')](respondWithStatusCode(_0x3eb3d8,null))[_0x00b1('0x48')](handleError(_0x3eb3d8,null));};exports['removeTeams']=function(_0x43bba8,_0x4f0aec,_0xea752){return db[_0x00b1('0x66')][_0x00b1('0x5a')]({'where':{'id':_0x43bba8['query'][_0x00b1('0x65')]},'attributes':['id'],'include':[{'model':db[_0x00b1('0x5b')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4f0aec,null))[_0x00b1('0x28')](function(_0x294d2e){var _0x4f0671=_['map'](_0x294d2e,'id');var _0x24298a=[];var _0xad4fcf=[];var _0x314fc5=squel['select']();_0x314fc5[_0x00b1('0x6d')](_0x00b1('0x6e'))[_0x00b1('0x6f')](_0x00b1('0x70'),'tq')['join'](_0x00b1('0x71'),'ut',_0x00b1('0x72'))['where'](_0x00b1('0x73'),_0x43bba8[_0x00b1('0x4a')]['id']);for(var _0x4e5284=0x0;_0x4e5284<_0x294d2e[_0x00b1('0x4b')];_0x4e5284+=0x1){let _0x4d038f=_0x294d2e[_0x4e5284];for(var _0x237289=0x0;_0x237289<_0x4d038f['Agents'][_0x00b1('0x4b')];_0x237289+=0x1){let _0xab9cff=_0x4d038f[_0x00b1('0x67')][_0x237289];var _0x53932e=_0x314fc5[_0x00b1('0x74')]();_0x53932e['where'](_0x00b1('0x75'),_0xab9cff['id']);_0xad4fcf[_0x00b1('0x76')](db['sequelize'][_0x00b1('0x37')](_0x53932e[_0x00b1('0x77')](),{'type':db[_0x00b1('0x78')]['QueryTypes'][_0x00b1('0x79')]})[_0x00b1('0x28')](function(_0x34dab){if(_0x34dab[_0x00b1('0x4b')]===0x1){return _0xab9cff['id'];}else{var _0x2cac41=_['every'](_[_0x00b1('0x30')](_0x34dab,_0x00b1('0x7a')),function(_0x141bbf){return _[_0x00b1('0x7b')](_0x4f0671,_0x141bbf);});if(_0x2cac41){return _0xab9cff['id'];}}}));}}return BPromise[_0x00b1('0x7c')](_0xad4fcf)[_0x00b1('0x28')](function(_0xdec2f1){_0x24298a=_(_0x24298a)[_0x00b1('0x7d')](_0xdec2f1)['compact']()[_0x00b1('0x7e')]();return db[_0x00b1('0x31')]['find']({'where':{'id':_0x43bba8[_0x00b1('0x4a')]['id']}})[_0x00b1('0x28')](function(_0x2a820b){return db[_0x00b1('0x78')][_0x00b1('0x7f')](function(_0x52c0a6){return _0x2a820b['removeTeams'](_0x43bba8[_0x00b1('0x37')][_0x00b1('0x65')],{'transaction':_0x52c0a6})['then'](function(){if(!_['isEmpty'](_0x24298a)){return _0x2a820b[_0x00b1('0x80')](_0x24298a,{'transaction':_0x52c0a6});}})[_0x00b1('0x28')](function(){_0x24298a[_0x00b1('0x6b')](function(_0x5dcb51){socket['emit'](_0x00b1('0x81'),{'UserId':_0x5dcb51,'FaxQueueId':_0x2a820b['id']});});});});});});})[_0x00b1('0x28')](respondWithStatusCode(_0x4f0aec,null))['catch'](handleError(_0x4f0aec,null));};exports[_0x00b1('0x82')]=function(_0xaf3157,_0xb114bb,_0x248e90){return db[_0x00b1('0x31')]['find']({'where':{'id':_0xaf3157['params']['id']}})[_0x00b1('0x28')](handleEntityNotFound(_0xb114bb,null))[_0x00b1('0x28')](function(_0x1ac75c){if(_0x1ac75c){return _0x1ac75c['addAgents'](_0xaf3157[_0x00b1('0x4e')]['ids'],_[_0x00b1('0x83')](_0xaf3157[_0x00b1('0x4e')],[_0x00b1('0x65'),'id'])||{})[_0x00b1('0x84')](function(_0x2ad74c){for(var _0x3c09c4=0x0;_0x3c09c4<_0xaf3157[_0x00b1('0x4e')][_0x00b1('0x65')][_0x00b1('0x4b')];_0x3c09c4+=0x1){socket[_0x00b1('0x6c')](_0x00b1('0x85'),{'UserId':Number(_0xaf3157[_0x00b1('0x4e')]['ids'][_0x3c09c4]),'FaxQueueId':Number(_0xaf3157['params']['id'])});}return _0x2ad74c;});}})['then'](respondWithResult(_0xb114bb,null))[_0x00b1('0x48')](handleError(_0xb114bb,null));};exports[_0x00b1('0x80')]=function(_0xe98474,_0xe798d5,_0x278c8f){return db[_0x00b1('0x31')][_0x00b1('0x4c')]({'where':{'id':_0xe98474[_0x00b1('0x4a')]['id']}})[_0x00b1('0x28')](handleEntityNotFound(_0xe798d5,null))[_0x00b1('0x28')](function(_0x543cd0){if(_0x543cd0){return _0x543cd0[_0x00b1('0x80')](_0xe98474[_0x00b1('0x37')][_0x00b1('0x65')])[_0x00b1('0x28')](function(){if(_[_0x00b1('0x86')](_0xe98474['query'][_0x00b1('0x65')])){for(var _0x1dba5d=0x0;_0x1dba5d<_0xe98474[_0x00b1('0x37')][_0x00b1('0x65')]['length'];_0x1dba5d+=0x1){socket[_0x00b1('0x6c')](_0x00b1('0x81'),{'UserId':Number(_0xe98474[_0x00b1('0x37')]['ids'][_0x1dba5d]),'FaxQueueId':Number(_0xe98474['params']['id'])});}}else{socket['emit'](_0x00b1('0x81'),{'UserId':Number(_0xe98474[_0x00b1('0x37')][_0x00b1('0x65')]),'FaxQueueId':Number(_0xe98474[_0x00b1('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0xe798d5,null))[_0x00b1('0x48')](handleError(_0xe798d5,null));};exports[_0x00b1('0x87')]=function(_0x219dc0,_0x13c333,_0x3d4846){var _0x3abc71={};var _0x409276={};var _0x3d9cd4;var _0x4e8133;return db['FaxQueue']['findOne']({'where':{'id':_0x219dc0[_0x00b1('0x4a')]['id']}})[_0x00b1('0x28')](handleEntityNotFound(_0x13c333,null))[_0x00b1('0x28')](function(_0x24edf9){if(_0x24edf9){_0x3d9cd4=_0x24edf9;_0x409276[_0x00b1('0x36')]=_[_0x00b1('0x38')](db[_0x00b1('0x5b')][_0x00b1('0x32')]);_0x409276[_0x00b1('0x37')]=_['keys'](_0x219dc0[_0x00b1('0x37')]);_0x409276[_0x00b1('0x39')]=_['intersection'](_0x409276['model'],_0x409276[_0x00b1('0x37')]);_0x3abc71[_0x00b1('0x3c')]=_[_0x00b1('0x3a')](_0x409276[_0x00b1('0x36')],qs[_0x00b1('0x3b')](_0x219dc0['query']['fields']));_0x3abc71[_0x00b1('0x3c')]=_0x3abc71[_0x00b1('0x3c')]['length']?_0x3abc71[_0x00b1('0x3c')]:_0x409276[_0x00b1('0x36')];_0x3abc71[_0x00b1('0x3f')]=qs['sort'](_0x219dc0[_0x00b1('0x37')]['sort']);_0x3abc71[_0x00b1('0x41')]=qs[_0x00b1('0x39')](_[_0x00b1('0x42')](_0x219dc0[_0x00b1('0x37')],_0x409276[_0x00b1('0x39')]));if(_0x219dc0[_0x00b1('0x37')][_0x00b1('0x43')]){_0x3abc71[_0x00b1('0x41')]=_[_0x00b1('0x44')](_0x3abc71[_0x00b1('0x41')],{'$or':_['map'](_0x3abc71[_0x00b1('0x3c')],function(_0x3ae4a2){var _0x155db8={};_0x155db8[_0x3ae4a2]={'$like':'%'+_0x219dc0['query'][_0x00b1('0x43')]+'%'};return _0x155db8;})});}_0x3abc71=_[_0x00b1('0x44')]({},_0x3abc71,_0x219dc0['options']);return _0x3d9cd4[_0x00b1('0x87')](_0x3abc71);}})[_0x00b1('0x28')](function(_0x31d081){if(_0x31d081){_0x4e8133=_0x31d081['length'];if(!_0x219dc0[_0x00b1('0x37')][_0x00b1('0x3d')](_0x00b1('0x3e'))){_0x3abc71[_0x00b1('0x22')]=qs[_0x00b1('0x22')](_0x219dc0[_0x00b1('0x37')]['limit']);_0x3abc71[_0x00b1('0x1f')]=qs[_0x00b1('0x1f')](_0x219dc0[_0x00b1('0x37')][_0x00b1('0x1f')]);}return _0x3d9cd4[_0x00b1('0x87')](_0x3abc71);}})[_0x00b1('0x28')](function(_0x2bf923){if(_0x2bf923){return _0x2bf923?{'count':_0x4e8133,'rows':_0x2bf923}:null;}})[_0x00b1('0x28')](respondWithResult(_0x13c333,null))[_0x00b1('0x48')](handleError(_0x13c333,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 71fb2e6..e6d195e 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 _0x86bd=['../../mysqldb','FaxQueue','setMaxListeners','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x250196,_0x39be6a){var _0x49e53b=function(_0x56e73d){while(--_0x56e73d){_0x250196['push'](_0x250196['shift']());}};_0x49e53b(++_0x39be6a);}(_0x86bd,0x182));var _0xd86b=function(_0x10aaed,_0x16103a){_0x10aaed=_0x10aaed-0x0;var _0x4470b4=_0x86bd[_0x10aaed];return _0x4470b4;};'use strict';var EventEmitter=require(_0xd86b('0x0'));var FaxQueue=require(_0xd86b('0x1'))['db'][_0xd86b('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xd86b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd86b('0x4'),'afterDestroy':_0xd86b('0x5')};function emitEvent(_0x58363e){return function(_0x466a16,_0xbe3dae,_0x295802){FaxQueueEvents['emit'](_0x58363e+':'+_0x466a16['id'],_0x466a16);FaxQueueEvents[_0xd86b('0x6')](_0x58363e,_0x466a16);_0x295802(null);};}for(var e in events){if(events[_0xd86b('0x7')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0xd86b('0x8')]=FaxQueueEvents; \ No newline at end of file +var _0x04d7=['exports','events','FaxQueue','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x36d37c,_0xfa35a5){var _0x56eac5=function(_0x26e4b8){while(--_0x26e4b8){_0x36d37c['push'](_0x36d37c['shift']());}};_0x56eac5(++_0xfa35a5);}(_0x04d7,0x159));var _0x704d=function(_0x1ff7f3,_0x4b9856){_0x1ff7f3=_0x1ff7f3-0x0;var _0x36c12b=_0x04d7[_0x1ff7f3];return _0x36c12b;};'use strict';var EventEmitter=require(_0x704d('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0x704d('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x704d('0x2')](0x0);var events={'afterCreate':_0x704d('0x3'),'afterUpdate':'update','afterDestroy':_0x704d('0x4')};function emitEvent(_0x1fda60){return function(_0x102902,_0x5ca8e4,_0x30b2c9){FaxQueueEvents[_0x704d('0x5')](_0x1fda60+':'+_0x102902['id'],_0x102902);FaxQueueEvents[_0x704d('0x5')](_0x1fda60,_0x102902);_0x30b2c9(null);};}for(var e in events){if(events[_0x704d('0x6')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x704d('0x7')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 2969453..a2a325f 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 _0x295a=['./faxQueue.attributes','exports','define','FaxQueue','fax_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1d2ebd,_0x1666be){var _0x20b96f=function(_0x2bde72){while(--_0x2bde72){_0x1d2ebd['push'](_0x1d2ebd['shift']());}};_0x20b96f(++_0x1666be);}(_0x295a,0x9f));var _0xa295=function(_0x5390e0,_0x57a89a){_0x5390e0=_0x5390e0-0x0;var _0x5324ff=_0x295a[_0x5390e0];return _0x5324ff;};'use strict';var _=require(_0xa295('0x0'));var util=require(_0xa295('0x1'));var logger=require('../../config/logger')(_0xa295('0x2'));var moment=require(_0xa295('0x3'));var BPromise=require(_0xa295('0x4'));var rp=require(_0xa295('0x5'));var fs=require('fs');var path=require(_0xa295('0x6'));var rimraf=require(_0xa295('0x7'));var config=require(_0xa295('0x8'));var attributes=require(_0xa295('0x9'));module[_0xa295('0xa')]=function(_0x1f53de,_0x11b059){return _0x1f53de[_0xa295('0xb')](_0xa295('0xc'),attributes,{'tableName':_0xa295('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7b47=['moment','request-promise','rimraf','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','util','api'];(function(_0x53ff85,_0x1a3590){var _0x39c81a=function(_0x4443d7){while(--_0x4443d7){_0x53ff85['push'](_0x53ff85['shift']());}};_0x39c81a(++_0x1a3590);}(_0x7b47,0x15c));var _0x77b4=function(_0x49a9d1,_0x11152f){_0x49a9d1=_0x49a9d1-0x0;var _0x680eb2=_0x7b47[_0x49a9d1];return _0x680eb2;};'use strict';var _=require('lodash');var util=require(_0x77b4('0x0'));var logger=require('../../config/logger')(_0x77b4('0x1'));var moment=require(_0x77b4('0x2'));var BPromise=require('bluebird');var rp=require(_0x77b4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x77b4('0x4'));var config=require(_0x77b4('0x5'));var attributes=require(_0x77b4('0x6'));module[_0x77b4('0x7')]=function(_0x31f997,_0x43d3d2){return _0x31f997[_0x77b4('0x8')](_0x77b4('0x9'),attributes,{'tableName':'fax_queues','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 3257061..5f57885 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 _0x3f7d=['http','redis','defaults','localhost','./faxQueue.socket','register','request','then','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueue,\x20%s,\x20%s','message','info','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','attributes','limit','include','map','model','ShowFaxQueue','find','where','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x565719,_0x4d27a6){var _0x37bc1b=function(_0x2725c0){while(--_0x2725c0){_0x565719['push'](_0x565719['shift']());}};_0x37bc1b(++_0x4d27a6);}(_0x3f7d,0xf2));var _0xd3f7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3f7d[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xd3f7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd3f7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd3f7('0x2'));var db=require(_0xd3f7('0x3'))['db'];var utils=require(_0xd3f7('0x4'));var logger=require(_0xd3f7('0x5'))(_0xd3f7('0x6'));var config=require(_0xd3f7('0x7'));var jayson=require(_0xd3f7('0x8'));var client=jayson[_0xd3f7('0x9')][_0xd3f7('0xa')]({'port':0x232a});config[_0xd3f7('0xb')]=_[_0xd3f7('0xc')](config['redis'],{'host':_0xd3f7('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd3f7('0xe'))[_0xd3f7('0xf')](socket);function respondWithRpcPromise(_0xf5eb8f,_0x3baacd,_0x51b4b6){return new BPromise(function(_0x139f64,_0x264b90){return client[_0xd3f7('0x10')](_0xf5eb8f,_0x51b4b6)[_0xd3f7('0x11')](function(_0xa4cfba){logger['info']('FaxQueue,\x20%s,\x20%s',_0x3baacd,_0xd3f7('0x12'));logger[_0xd3f7('0x13')](_0xd3f7('0x14'),_0x3baacd,'request\x20sent',JSON[_0xd3f7('0x15')](_0xa4cfba));if(_0xa4cfba[_0xd3f7('0x16')]){if(_0xa4cfba[_0xd3f7('0x16')][_0xd3f7('0x17')]===0x1f4){logger['error'](_0xd3f7('0x18'),_0x3baacd,_0xa4cfba[_0xd3f7('0x16')][_0xd3f7('0x19')]);return _0x264b90(_0xa4cfba[_0xd3f7('0x16')][_0xd3f7('0x19')]);}logger[_0xd3f7('0x16')](_0xd3f7('0x18'),_0x3baacd,_0xa4cfba[_0xd3f7('0x16')][_0xd3f7('0x19')]);return _0x139f64(_0xa4cfba[_0xd3f7('0x16')][_0xd3f7('0x19')]);}else{logger[_0xd3f7('0x1a')](_0xd3f7('0x18'),_0x3baacd,_0xd3f7('0x12'));_0x139f64(_0xa4cfba[_0xd3f7('0x1b')]['message']);}})[_0xd3f7('0x1c')](function(_0x4d03ce){logger['error'](_0xd3f7('0x18'),_0x3baacd,_0x4d03ce);_0x264b90(_0x4d03ce);});});}exports[_0xd3f7('0x1d')]=function(_0x1ef259){var _0x379bcb=this;return new Promise(function(_0x7d8932,_0x3c14f7){return db[_0xd3f7('0x1e')][_0xd3f7('0x1f')]({'raw':_0x1ef259[_0xd3f7('0x20')]?_0x1ef259[_0xd3f7('0x20')][_0xd3f7('0x21')]===undefined?!![]:![]:!![],'where':_0x1ef259[_0xd3f7('0x20')]?_0x1ef259['options']['where']||null:null,'attributes':_0x1ef259[_0xd3f7('0x20')]?_0x1ef259[_0xd3f7('0x20')][_0xd3f7('0x22')]||null:null,'limit':_0x1ef259[_0xd3f7('0x20')]?_0x1ef259[_0xd3f7('0x20')][_0xd3f7('0x23')]||null:null,'include':_0x1ef259[_0xd3f7('0x20')]?_0x1ef259['options'][_0xd3f7('0x24')]?_[_0xd3f7('0x25')](_0x1ef259[_0xd3f7('0x20')][_0xd3f7('0x24')],function(_0x145dfa){return{'model':db[_0x145dfa[_0xd3f7('0x26')]],'as':_0x145dfa['as'],'attributes':_0x145dfa[_0xd3f7('0x22')],'include':_0x145dfa[_0xd3f7('0x24')]?_['map'](_0x145dfa[_0xd3f7('0x24')],function(_0x4e70b6){return{'model':db[_0x4e70b6[_0xd3f7('0x26')]],'as':_0x4e70b6['as'],'attributes':_0x4e70b6[_0xd3f7('0x22')],'include':_0x4e70b6[_0xd3f7('0x24')]?_[_0xd3f7('0x25')](_0x4e70b6['include'],function(_0x3e9196){return{'model':db[_0x3e9196[_0xd3f7('0x26')]],'as':_0x3e9196['as'],'attributes':_0x3e9196[_0xd3f7('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x14cefb){logger['info'](_0xd3f7('0x1d'),_0x1ef259);logger[_0xd3f7('0x13')]('GetFaxQueue',_0x1ef259,JSON[_0xd3f7('0x15')](_0x14cefb));_0x7d8932(_0x14cefb);})[_0xd3f7('0x1c')](function(_0xb3ade2){logger[_0xd3f7('0x16')]('GetFaxQueue',_0xb3ade2[_0xd3f7('0x19')],_0x1ef259);_0x3c14f7(_0x379bcb[_0xd3f7('0x16')](0x1f4,_0xb3ade2['message']));});});};exports[_0xd3f7('0x27')]=function(_0x4b3803){var _0x5e0118=this;return new Promise(function(_0xed61d4,_0x137b3c){return db['FaxQueue'][_0xd3f7('0x28')]({'raw':_0x4b3803['options']?_0x4b3803[_0xd3f7('0x20')][_0xd3f7('0x21')]===undefined?!![]:![]:!![],'where':_0x4b3803[_0xd3f7('0x20')]?_0x4b3803[_0xd3f7('0x20')][_0xd3f7('0x29')]||null:null,'attributes':_0x4b3803[_0xd3f7('0x20')]?_0x4b3803[_0xd3f7('0x20')][_0xd3f7('0x22')]||null:null,'include':_0x4b3803[_0xd3f7('0x20')]?_0x4b3803['options']['include']?_[_0xd3f7('0x25')](_0x4b3803[_0xd3f7('0x20')][_0xd3f7('0x24')],function(_0x1a0c76){return{'model':db[_0x1a0c76['model']],'as':_0x1a0c76['as'],'attributes':_0x1a0c76[_0xd3f7('0x22')],'include':_0x1a0c76[_0xd3f7('0x24')]?_['map'](_0x1a0c76[_0xd3f7('0x24')],function(_0x38c295){return{'model':db[_0x38c295[_0xd3f7('0x26')]],'as':_0x38c295['as'],'attributes':_0x38c295[_0xd3f7('0x22')],'include':_0x38c295['include']?_['map'](_0x38c295[_0xd3f7('0x24')],function(_0x396252){return{'model':db[_0x396252['model']],'as':_0x396252['as'],'attributes':_0x396252[_0xd3f7('0x22')]};}):[]};}):[]};}):[]:[]})[_0xd3f7('0x11')](function(_0x48ce52){logger[_0xd3f7('0x1a')](_0xd3f7('0x27'),_0x4b3803);logger['debug'](_0xd3f7('0x27'),_0x4b3803,JSON[_0xd3f7('0x15')](_0x48ce52));_0xed61d4(_0x48ce52);})[_0xd3f7('0x1c')](function(_0x18d543){logger['error'](_0xd3f7('0x27'),_0x18d543[_0xd3f7('0x19')],_0x4b3803);_0x137b3c(_0x5e0118[_0xd3f7('0x16')](0x1f4,_0x18d543[_0xd3f7('0x19')]));});});}; \ No newline at end of file +var _0x86c5=['result','GetFaxQueue','findAll','options','raw','attributes','limit','include','map','model','stringify','catch','ShowFaxQueue','FaxQueue','where','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','register','request','then','info','FaxQueue,\x20%s,\x20%s','debug','request\x20sent','error','code','message'];(function(_0x2f45c2,_0x51a27d){var _0x458f8d=function(_0x3f4260){while(--_0x3f4260){_0x2f45c2['push'](_0x2f45c2['shift']());}};_0x458f8d(++_0x51a27d);}(_0x86c5,0xa7));var _0x586c=function(_0x1af06c,_0x1a2fa6){_0x1af06c=_0x1af06c-0x0;var _0x44171d=_0x86c5[_0x1af06c];return _0x44171d;};'use strict';var _=require(_0x586c('0x0'));var util=require(_0x586c('0x1'));var moment=require('moment');var BPromise=require(_0x586c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x586c('0x3'))['db'];var utils=require(_0x586c('0x4'));var logger=require(_0x586c('0x5'))(_0x586c('0x6'));var config=require(_0x586c('0x7'));var jayson=require(_0x586c('0x8'));var client=jayson[_0x586c('0x9')]['http']({'port':0x232a});config[_0x586c('0xa')]=_['defaults'](config[_0x586c('0xa')],{'host':_0x586c('0xb'),'port':0x18eb});var socket=require(_0x586c('0xc'))(new Redis(config['redis']));require('./faxQueue.socket')[_0x586c('0xd')](socket);function respondWithRpcPromise(_0x464ce4,_0x54f3b8,_0x19c4aa){return new BPromise(function(_0x232b08,_0xb9a1fd){return client[_0x586c('0xe')](_0x464ce4,_0x19c4aa)[_0x586c('0xf')](function(_0x3aa139){logger[_0x586c('0x10')](_0x586c('0x11'),_0x54f3b8,'request\x20sent');logger[_0x586c('0x12')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x54f3b8,_0x586c('0x13'),JSON['stringify'](_0x3aa139));if(_0x3aa139[_0x586c('0x14')]){if(_0x3aa139[_0x586c('0x14')][_0x586c('0x15')]===0x1f4){logger['error'](_0x586c('0x11'),_0x54f3b8,_0x3aa139['error'][_0x586c('0x16')]);return _0xb9a1fd(_0x3aa139[_0x586c('0x14')][_0x586c('0x16')]);}logger[_0x586c('0x14')](_0x586c('0x11'),_0x54f3b8,_0x3aa139[_0x586c('0x14')][_0x586c('0x16')]);return _0x232b08(_0x3aa139['error'][_0x586c('0x16')]);}else{logger[_0x586c('0x10')](_0x586c('0x11'),_0x54f3b8,_0x586c('0x13'));_0x232b08(_0x3aa139[_0x586c('0x17')][_0x586c('0x16')]);}})['catch'](function(_0x5ef709){logger['error'](_0x586c('0x11'),_0x54f3b8,_0x5ef709);_0xb9a1fd(_0x5ef709);});});}exports[_0x586c('0x18')]=function(_0x158111){var _0x513586=this;return new Promise(function(_0x4eee9e,_0x41f19e){return db['FaxQueue'][_0x586c('0x19')]({'raw':_0x158111[_0x586c('0x1a')]?_0x158111[_0x586c('0x1a')][_0x586c('0x1b')]===undefined?!![]:![]:!![],'where':_0x158111['options']?_0x158111['options']['where']||null:null,'attributes':_0x158111[_0x586c('0x1a')]?_0x158111['options'][_0x586c('0x1c')]||null:null,'limit':_0x158111[_0x586c('0x1a')]?_0x158111[_0x586c('0x1a')][_0x586c('0x1d')]||null:null,'include':_0x158111['options']?_0x158111[_0x586c('0x1a')][_0x586c('0x1e')]?_[_0x586c('0x1f')](_0x158111[_0x586c('0x1a')][_0x586c('0x1e')],function(_0x3da5be){return{'model':db[_0x3da5be[_0x586c('0x20')]],'as':_0x3da5be['as'],'attributes':_0x3da5be[_0x586c('0x1c')],'include':_0x3da5be['include']?_[_0x586c('0x1f')](_0x3da5be[_0x586c('0x1e')],function(_0x5cce75){return{'model':db[_0x5cce75[_0x586c('0x20')]],'as':_0x5cce75['as'],'attributes':_0x5cce75[_0x586c('0x1c')],'include':_0x5cce75[_0x586c('0x1e')]?_[_0x586c('0x1f')](_0x5cce75['include'],function(_0x4a6f96){return{'model':db[_0x4a6f96[_0x586c('0x20')]],'as':_0x4a6f96['as'],'attributes':_0x4a6f96['attributes']};}):[]};}):[]};}):[]:[]})[_0x586c('0xf')](function(_0x16955a){logger[_0x586c('0x10')](_0x586c('0x18'),_0x158111);logger[_0x586c('0x12')]('GetFaxQueue',_0x158111,JSON[_0x586c('0x21')](_0x16955a));_0x4eee9e(_0x16955a);})[_0x586c('0x22')](function(_0x46c584){logger[_0x586c('0x14')]('GetFaxQueue',_0x46c584[_0x586c('0x16')],_0x158111);_0x41f19e(_0x513586[_0x586c('0x14')](0x1f4,_0x46c584[_0x586c('0x16')]));});});};exports[_0x586c('0x23')]=function(_0x457fe0){var _0x219d0b=this;return new Promise(function(_0x296d71,_0x372c94){return db[_0x586c('0x24')]['find']({'raw':_0x457fe0['options']?_0x457fe0[_0x586c('0x1a')][_0x586c('0x1b')]===undefined?!![]:![]:!![],'where':_0x457fe0['options']?_0x457fe0['options'][_0x586c('0x25')]||null:null,'attributes':_0x457fe0[_0x586c('0x1a')]?_0x457fe0['options'][_0x586c('0x1c')]||null:null,'include':_0x457fe0[_0x586c('0x1a')]?_0x457fe0[_0x586c('0x1a')][_0x586c('0x1e')]?_[_0x586c('0x1f')](_0x457fe0[_0x586c('0x1a')]['include'],function(_0x54f4c9){return{'model':db[_0x54f4c9[_0x586c('0x20')]],'as':_0x54f4c9['as'],'attributes':_0x54f4c9[_0x586c('0x1c')],'include':_0x54f4c9[_0x586c('0x1e')]?_[_0x586c('0x1f')](_0x54f4c9['include'],function(_0x1a93f6){return{'model':db[_0x1a93f6['model']],'as':_0x1a93f6['as'],'attributes':_0x1a93f6[_0x586c('0x1c')],'include':_0x1a93f6['include']?_[_0x586c('0x1f')](_0x1a93f6[_0x586c('0x1e')],function(_0x22b441){return{'model':db[_0x22b441[_0x586c('0x20')]],'as':_0x22b441['as'],'attributes':_0x22b441[_0x586c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x586c('0xf')](function(_0x34d5a0){logger[_0x586c('0x10')](_0x586c('0x23'),_0x457fe0);logger[_0x586c('0x12')]('ShowFaxQueue',_0x457fe0,JSON[_0x586c('0x21')](_0x34d5a0));_0x296d71(_0x34d5a0);})[_0x586c('0x22')](function(_0x2de356){logger[_0x586c('0x14')]('ShowFaxQueue',_0x2de356[_0x586c('0x16')],_0x457fe0);_0x372c94(_0x219d0b['error'](0x1f4,_0x2de356[_0x586c('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index a3a1a26..5f880d7 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 _0x0275=['register','length','faxQueue:','save','remove','emit','removeListener'];(function(_0x246bcf,_0x103b2f){var _0x2ee5a0=function(_0x35a5e8){while(--_0x35a5e8){_0x246bcf['push'](_0x246bcf['shift']());}};_0x2ee5a0(++_0x103b2f);}(_0x0275,0xc0));var _0x5027=function(_0x564c20,_0x29843a){_0x564c20=_0x564c20-0x0;var _0x3b8cdf=_0x0275[_0x564c20];return _0x3b8cdf;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0x5027('0x0'),_0x5027('0x1'),'update'];function createListener(_0x14a597,_0xee3d7f){return function(_0x2fb690){_0xee3d7f[_0x5027('0x2')](_0x14a597,_0x2fb690);};}function removeListener(_0x3fc04a,_0x400849){return function(){FaxQueueEvents[_0x5027('0x3')](_0x3fc04a,_0x400849);};}exports[_0x5027('0x4')]=function(_0x375c16){for(var _0x3a8b12=0x0,_0x4bd2ec=events[_0x5027('0x5')];_0x3a8b12<_0x4bd2ec;_0x3a8b12++){var _0x515a13=events[_0x3a8b12];var _0x335fb3=createListener(_0x5027('0x6')+_0x515a13,_0x375c16);FaxQueueEvents['on'](_0x515a13,_0x335fb3);}}; \ No newline at end of file +var _0x6e6f=['emit','removeListener','length','faxQueue:','save','remove'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0x6e6f,0x76));var _0xf6e6=function(_0x5bc4ca,_0x21f738){_0x5bc4ca=_0x5bc4ca-0x0;var _0x12bf3b=_0x6e6f[_0x5bc4ca];return _0x12bf3b;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0xf6e6('0x0'),_0xf6e6('0x1'),'update'];function createListener(_0x4497c3,_0x1f7b00){return function(_0x32f236){_0x1f7b00[_0xf6e6('0x2')](_0x4497c3,_0x32f236);};}function removeListener(_0x445201,_0x3deccf){return function(){FaxQueueEvents[_0xf6e6('0x3')](_0x445201,_0x3deccf);};}exports['register']=function(_0x3c9820){for(var _0x3ca8a7=0x0,_0x3af742=events[_0xf6e6('0x4')];_0x3ca8a7<_0x3af742;_0x3ca8a7++){var _0x1a3561=events[_0x3ca8a7];var _0x172fd4=createListener(_0xf6e6('0x5')+_0x1a3561,_0x3c9820);FaxQueueEvents['on'](_0x1a3561,_0x172fd4);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 4eb47a2..5299d9f 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 _0x9f37=['exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueue.controller','get','/describe','isAuthenticated','describe','/:id','/:id/members','getMembers','getTeams','getAgents','post','/:id/teams','addTeams','/:id/users','put','update','delete','removeTeams','removeAgents'];(function(_0x3471d3,_0x4b432e){var _0x2f6940=function(_0x24ab4f){while(--_0x24ab4f){_0x3471d3['push'](_0x3471d3['shift']());}};_0x2f6940(++_0x4b432e);}(_0x9f37,0xd1));var _0x79f3=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x9f37[_0x243b59];return _0x3e1676;};'use strict';var multer=require(_0x79f3('0x0'));var util=require(_0x79f3('0x1'));var path=require('path');var timeout=require(_0x79f3('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x79f3('0x3'));var auth=require(_0x79f3('0x4'));var interaction=require(_0x79f3('0x5'));var config=require('../../config/environment');var controller=require(_0x79f3('0x6'));router[_0x79f3('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x79f3('0x7')](_0x79f3('0x8'),auth[_0x79f3('0x9')](),controller[_0x79f3('0xa')]);router['get'](_0x79f3('0xb'),auth[_0x79f3('0x9')](),controller['show']);router[_0x79f3('0x7')](_0x79f3('0xc'),auth[_0x79f3('0x9')](),controller[_0x79f3('0xd')]);router[_0x79f3('0x7')]('/:id/teams',auth[_0x79f3('0x9')](),controller[_0x79f3('0xe')]);router['get']('/:id/users',auth[_0x79f3('0x9')](),controller[_0x79f3('0xf')]);router[_0x79f3('0x10')]('/',auth[_0x79f3('0x9')](),controller['create']);router[_0x79f3('0x10')](_0x79f3('0x11'),auth[_0x79f3('0x9')](),controller[_0x79f3('0x12')]);router[_0x79f3('0x10')](_0x79f3('0x13'),auth['isAuthenticated'](),controller['addAgents']);router[_0x79f3('0x14')](_0x79f3('0xb'),auth['isAuthenticated'](),controller[_0x79f3('0x15')]);router[_0x79f3('0x16')](_0x79f3('0xb'),auth[_0x79f3('0x9')](),controller['destroy']);router[_0x79f3('0x16')](_0x79f3('0x11'),auth[_0x79f3('0x9')](),controller[_0x79f3('0x17')]);router[_0x79f3('0x16')](_0x79f3('0x13'),auth[_0x79f3('0x9')](),controller[_0x79f3('0x18')]);module[_0x79f3('0x19')]=router; \ No newline at end of file +var _0x1115=['addAgents','put','/:id','destroy','delete','removeAgents','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','get','show','getTeams','/:id/users','getAgents','post','create','/:id/teams','addTeams'];(function(_0x18b4e8,_0x30e9e1){var _0x4b6265=function(_0x46bc8b){while(--_0x46bc8b){_0x18b4e8['push'](_0x18b4e8['shift']());}};_0x4b6265(++_0x30e9e1);}(_0x1115,0x1b6));var _0x5111=function(_0x42354d,_0x8137a8){_0x42354d=_0x42354d-0x0;var _0x36c74c=_0x1115[_0x42354d];return _0x36c74c;};'use strict';var multer=require('multer');var util=require(_0x5111('0x0'));var path=require(_0x5111('0x1'));var timeout=require(_0x5111('0x2'));var express=require(_0x5111('0x3'));var router=express[_0x5111('0x4')]();var fs_extra=require(_0x5111('0x5'));var auth=require(_0x5111('0x6'));var interaction=require(_0x5111('0x7'));var config=require(_0x5111('0x8'));var controller=require('./faxQueue.controller');router['get']('/',auth[_0x5111('0x9')](),controller[_0x5111('0xa')]);router['get'](_0x5111('0xb'),auth[_0x5111('0x9')](),controller['describe']);router[_0x5111('0xc')]('/:id',auth[_0x5111('0x9')](),controller[_0x5111('0xd')]);router['get']('/:id/members',auth[_0x5111('0x9')](),controller['getMembers']);router[_0x5111('0xc')]('/:id/teams',auth[_0x5111('0x9')](),controller[_0x5111('0xe')]);router[_0x5111('0xc')](_0x5111('0xf'),auth[_0x5111('0x9')](),controller[_0x5111('0x10')]);router[_0x5111('0x11')]('/',auth[_0x5111('0x9')](),controller[_0x5111('0x12')]);router[_0x5111('0x11')](_0x5111('0x13'),auth[_0x5111('0x9')](),controller[_0x5111('0x14')]);router[_0x5111('0x11')](_0x5111('0xf'),auth[_0x5111('0x9')](),controller[_0x5111('0x15')]);router[_0x5111('0x16')]('/:id',auth[_0x5111('0x9')](),controller['update']);router['delete'](_0x5111('0x17'),auth[_0x5111('0x9')](),controller[_0x5111('0x18')]);router['delete'](_0x5111('0x13'),auth[_0x5111('0x9')](),controller['removeTeams']);router[_0x5111('0x19')](_0x5111('0xf'),auth[_0x5111('0x9')](),controller[_0x5111('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index d69f218..f44f167 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 _0x91f8=['sequelize','exports','STRING','DATE','moment'];(function(_0x99f2b5,_0xfe1b39){var _0x564380=function(_0x4994c9){while(--_0x4994c9){_0x99f2b5['push'](_0x99f2b5['shift']());}};_0x564380(++_0xfe1b39);}(_0x91f8,0x13f));var _0x891f=function(_0x208d39,_0x5de94f){_0x208d39=_0x208d39-0x0;var _0x3f96cb=_0x91f8[_0x208d39];return _0x3f96cb;};'use strict';var moment=require(_0x891f('0x0'));var Sequelize=require(_0x891f('0x1'));module[_0x891f('0x2')]={'uniqueid':{'type':Sequelize[_0x891f('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x891f('0x3')]},'joinAt':{'type':Sequelize[_0x891f('0x4')]},'leaveAt':{'type':Sequelize[_0x891f('0x4')]},'acceptAt':{'type':Sequelize[_0x891f('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x891f('0x3')]}}; \ No newline at end of file +var _0x9dbe=['STRING','DATE','moment','sequelize','exports'];(function(_0xdbc32f,_0xd89c16){var _0x5256f0=function(_0x4e6f8a){while(--_0x4e6f8a){_0xdbc32f['push'](_0xdbc32f['shift']());}};_0x5256f0(++_0xd89c16);}(_0x9dbe,0x174));var _0xe9db=function(_0x20a7be,_0x348657){_0x20a7be=_0x20a7be-0x0;var _0x1ff2cb=_0x9dbe[_0x20a7be];return _0x1ff2cb;};'use strict';var moment=require(_0xe9db('0x0'));var Sequelize=require(_0xe9db('0x1'));module[_0xe9db('0x2')]={'uniqueid':{'type':Sequelize[_0xe9db('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xe9db('0x3')]},'joinAt':{'type':Sequelize[_0xe9db('0x4')]},'leaveAt':{'type':Sequelize[_0xe9db('0x4')]},'acceptAt':{'type':Sequelize[_0xe9db('0x4')]},'exitAt':{'type':Sequelize[_0xe9db('0x4')]},'reason':{'type':Sequelize[_0xe9db('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index c156cd2..ec0031f 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 _0x6732=['fields','hasOwnProperty','order','sort','where','pick','filter','map','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','length','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','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/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','error','name','send','index','FaxQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes'];(function(_0x62f443,_0x5ea99f){var _0xb635cd=function(_0x22f4d6){while(--_0x22f4d6){_0x62f443['push'](_0x62f443['shift']());}};_0xb635cd(++_0x5ea99f);}(_0x6732,0x66));var _0x2673=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6732[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x2673('0x0'));var rimraf=require(_0x2673('0x1'));var zipdir=require(_0x2673('0x2'));var jsonpatch=require(_0x2673('0x3'));var rp=require('request-promise');var moment=require(_0x2673('0x4'));var BPromise=require(_0x2673('0x5'));var Mustache=require('mustache');var util=require(_0x2673('0x6'));var path=require(_0x2673('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2673('0x8'));var fs=require('fs');var fs_extra=require(_0x2673('0x9'));var _=require(_0x2673('0xa'));var squel=require(_0x2673('0xb'));var crypto=require(_0x2673('0xc'));var jsforce=require(_0x2673('0xd'));var deskjs=require(_0x2673('0xe'));var toCsv=require(_0x2673('0xf'));var querystring=require(_0x2673('0x10'));var Papa=require(_0x2673('0x11'));var Redis=require(_0x2673('0x12'));var authService=require(_0x2673('0x13'));var qs=require(_0x2673('0x14'));var as=require(_0x2673('0x15'));var hardwareService=require(_0x2673('0x16'));var logger=require(_0x2673('0x17'))(_0x2673('0x18'));var utils=require(_0x2673('0x19'));var config=require(_0x2673('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x2673('0x1b'))['db'];function respondWithStatusCode(_0x4b28ec,_0x991e0d){_0x991e0d=_0x991e0d||0xcc;return function(_0x41956b){if(_0x41956b){return _0x4b28ec[_0x2673('0x1c')](_0x991e0d);}return _0x4b28ec[_0x2673('0x1d')](_0x991e0d)[_0x2673('0x1e')]();};}function respondWithResult(_0x4c8085,_0x4d63b1){_0x4d63b1=_0x4d63b1||0xc8;return function(_0x4688bd){if(_0x4688bd){return _0x4c8085[_0x2673('0x1d')](_0x4d63b1)[_0x2673('0x1f')](_0x4688bd);}};}function respondWithFilteredResult(_0x1a7326,_0x38fc5f){return function(_0x47e313){if(_0x47e313){var _0x404134=typeof _0x38fc5f[_0x2673('0x20')]===_0x2673('0x21')&&typeof _0x38fc5f[_0x2673('0x22')]==='undefined';var _0x367d38=_0x47e313[_0x2673('0x23')];var _0x18b395=_0x404134?0x0:_0x38fc5f[_0x2673('0x20')];var _0x26d85c=_0x404134?_0x47e313['count']:_0x38fc5f['offset']+_0x38fc5f[_0x2673('0x22')];var _0xf2b5ee;if(_0x26d85c>=_0x367d38){_0x26d85c=_0x367d38;_0xf2b5ee=0xc8;}else{_0xf2b5ee=0xce;}_0x1a7326[_0x2673('0x1d')](_0xf2b5ee);return _0x1a7326[_0x2673('0x24')](_0x2673('0x25'),_0x18b395+'-'+_0x26d85c+'/'+_0x367d38)[_0x2673('0x1f')](_0x47e313);}return null;};}function patchUpdates(_0x69f311){return function(_0x362d15){try{jsonpatch['apply'](_0x362d15,_0x69f311,!![]);}catch(_0x34f928){return BPromise['reject'](_0x34f928);}return _0x362d15[_0x2673('0x26')]();};}function saveUpdates(_0x2f3e90,_0x3b7f09){return function(_0x3af6bb){if(_0x3af6bb){return _0x3af6bb[_0x2673('0x27')](_0x2f3e90)[_0x2673('0x28')](function(_0x156d78){return _0x156d78;});}return null;};}function removeEntity(_0x48b3fb,_0x17812a){return function(_0x282045){if(_0x282045){return _0x282045[_0x2673('0x29')]()[_0x2673('0x28')](function(){_0x48b3fb['status'](0xcc)[_0x2673('0x1e')]();});}};}function handleEntityNotFound(_0x28ef35,_0x528bd1){return function(_0x597216){if(!_0x597216){_0x28ef35['sendStatus'](0x194);}return _0x597216;};}function handleError(_0x2d424d,_0x5695e2){_0x5695e2=_0x5695e2||0x1f4;return function(_0xcd7375){logger[_0x2673('0x2a')](_0xcd7375['stack']);if(_0xcd7375['name']){delete _0xcd7375[_0x2673('0x2b')];}_0x2d424d[_0x2673('0x1d')](_0x5695e2)[_0x2673('0x2c')](_0xcd7375);};}exports[_0x2673('0x2d')]=function(_0x59611d,_0x44dc6f){var _0x5d64b7={},_0x40723f={},_0x16d431={'count':0x0,'rows':[]};var _0x11ca8b=_['map'](db[_0x2673('0x2e')][_0x2673('0x2f')],function(_0x2e8712){return{'name':_0x2e8712[_0x2673('0x30')],'type':_0x2e8712[_0x2673('0x31')]['key']};});_0x40723f[_0x2673('0x32')]=_['map'](_0x11ca8b,_0x2673('0x2b'));_0x40723f[_0x2673('0x33')]=_[_0x2673('0x34')](_0x59611d[_0x2673('0x33')]);_0x40723f[_0x2673('0x35')]=_[_0x2673('0x36')](_0x40723f[_0x2673('0x32')],_0x40723f[_0x2673('0x33')]);_0x5d64b7[_0x2673('0x37')]=_['intersection'](_0x40723f[_0x2673('0x32')],qs[_0x2673('0x38')](_0x59611d[_0x2673('0x33')][_0x2673('0x38')]));_0x5d64b7[_0x2673('0x37')]=_0x5d64b7['attributes']['length']?_0x5d64b7['attributes']:_0x40723f[_0x2673('0x32')];if(!_0x59611d[_0x2673('0x33')][_0x2673('0x39')]('nolimit')){_0x5d64b7[_0x2673('0x22')]=qs[_0x2673('0x22')](_0x59611d[_0x2673('0x33')]['limit']);_0x5d64b7[_0x2673('0x20')]=qs[_0x2673('0x20')](_0x59611d[_0x2673('0x33')][_0x2673('0x20')]);}_0x5d64b7[_0x2673('0x3a')]=qs[_0x2673('0x3b')](_0x59611d['query']['sort']);_0x5d64b7[_0x2673('0x3c')]=qs[_0x2673('0x35')](_[_0x2673('0x3d')](_0x59611d[_0x2673('0x33')],_0x40723f[_0x2673('0x35')]),_0x11ca8b);if(_0x59611d[_0x2673('0x33')][_0x2673('0x3e')]){_0x5d64b7[_0x2673('0x3c')]=_['merge'](_0x5d64b7[_0x2673('0x3c')],{'$or':_[_0x2673('0x3f')](_0x11ca8b,function(_0x5e93b8){if(_0x5e93b8['type']!==_0x2673('0x40')){var _0x3a24c4={};_0x3a24c4[_0x5e93b8[_0x2673('0x2b')]]={'$like':'%'+_0x59611d['query'][_0x2673('0x3e')]+'%'};return _0x3a24c4;}})});}_0x5d64b7=_[_0x2673('0x41')]({},_0x5d64b7,_0x59611d[_0x2673('0x42')]);var _0x38060e={'where':_0x5d64b7[_0x2673('0x3c')]};return db[_0x2673('0x2e')][_0x2673('0x23')](_0x38060e)[_0x2673('0x28')](function(_0x1713c6){_0x16d431[_0x2673('0x23')]=_0x1713c6;if(_0x59611d[_0x2673('0x33')][_0x2673('0x43')]){_0x5d64b7[_0x2673('0x44')]=[{'all':!![]}];}return db[_0x2673('0x2e')][_0x2673('0x45')](_0x5d64b7);})['then'](function(_0x4cb38f){_0x16d431[_0x2673('0x46')]=_0x4cb38f;return _0x16d431;})[_0x2673('0x28')](respondWithFilteredResult(_0x44dc6f,_0x5d64b7))[_0x2673('0x47')](handleError(_0x44dc6f,null));};exports[_0x2673('0x48')]=function(_0x2dee22,_0x493966){var _0x28237f={'raw':!![],'where':{'id':_0x2dee22['params']['id']}},_0x9b42aa={};_0x9b42aa['model']=_[_0x2673('0x34')](db['FaxQueueReport']['rawAttributes']);_0x9b42aa['query']=_[_0x2673('0x34')](_0x2dee22[_0x2673('0x33')]);_0x9b42aa[_0x2673('0x35')]=_[_0x2673('0x36')](_0x9b42aa[_0x2673('0x32')],_0x9b42aa[_0x2673('0x33')]);_0x28237f[_0x2673('0x37')]=_[_0x2673('0x36')](_0x9b42aa[_0x2673('0x32')],qs['fields'](_0x2dee22[_0x2673('0x33')][_0x2673('0x38')]));_0x28237f['attributes']=_0x28237f['attributes'][_0x2673('0x49')]?_0x28237f['attributes']:_0x9b42aa[_0x2673('0x32')];if(_0x2dee22[_0x2673('0x33')][_0x2673('0x43')]){_0x28237f[_0x2673('0x44')]=[{'all':!![]}];}_0x28237f=_[_0x2673('0x41')]({},_0x28237f,_0x2dee22[_0x2673('0x42')]);return db[_0x2673('0x2e')]['find'](_0x28237f)[_0x2673('0x28')](handleEntityNotFound(_0x493966,null))[_0x2673('0x28')](respondWithResult(_0x493966,null))['catch'](handleError(_0x493966,null));};exports['create']=function(_0x50737a,_0x2d5a60){return db[_0x2673('0x2e')][_0x2673('0x4a')](_0x50737a[_0x2673('0x4b')],{})['then'](respondWithResult(_0x2d5a60,0xc9))[_0x2673('0x47')](handleError(_0x2d5a60,null));};exports[_0x2673('0x27')]=function(_0x55605b,_0x46c183){if(_0x55605b[_0x2673('0x4b')]['id']){delete _0x55605b[_0x2673('0x4b')]['id'];}return db[_0x2673('0x2e')][_0x2673('0x4c')]({'where':{'id':_0x55605b[_0x2673('0x4d')]['id']}})[_0x2673('0x28')](handleEntityNotFound(_0x46c183,null))[_0x2673('0x28')](saveUpdates(_0x55605b[_0x2673('0x4b')],null))[_0x2673('0x28')](respondWithResult(_0x46c183,null))[_0x2673('0x47')](handleError(_0x46c183,null));};exports[_0x2673('0x29')]=function(_0x2fb68e,_0x3b90b1){return db[_0x2673('0x2e')][_0x2673('0x4c')]({'where':{'id':_0x2fb68e[_0x2673('0x4d')]['id']}})[_0x2673('0x28')](handleEntityNotFound(_0x3b90b1,null))[_0x2673('0x28')](removeEntity(_0x3b90b1,null))[_0x2673('0x47')](handleError(_0x3b90b1,null));};exports[_0x2673('0x4e')]=function(_0x17393a,_0x46a355){return db[_0x2673('0x2e')][_0x2673('0x4e')]()[_0x2673('0x28')](respondWithResult(_0x46a355,null))[_0x2673('0x47')](handleError(_0x46a355,null));}; \ No newline at end of file +var _0xf9bc=['../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','stack','name','send','FaxQueueReport','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x39944f,_0x4ec9c6){var _0x5a58bc=function(_0x5eb152){while(--_0x5eb152){_0x39944f['push'](_0x39944f['shift']());}};_0x5a58bc(++_0x4ec9c6);}(_0xf9bc,0x7e));var _0xcf9b=function(_0x24689f,_0x4fff42){_0x24689f=_0x24689f-0x0;var _0x2c1c51=_0xf9bc[_0x24689f];return _0x2c1c51;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcf9b('0x0'));var zipdir=require(_0xcf9b('0x1'));var jsonpatch=require(_0xcf9b('0x2'));var rp=require(_0xcf9b('0x3'));var moment=require(_0xcf9b('0x4'));var BPromise=require(_0xcf9b('0x5'));var Mustache=require(_0xcf9b('0x6'));var util=require(_0xcf9b('0x7'));var path=require(_0xcf9b('0x8'));var sox=require(_0xcf9b('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcf9b('0xa'));var _=require(_0xcf9b('0xb'));var squel=require(_0xcf9b('0xc'));var crypto=require(_0xcf9b('0xd'));var jsforce=require(_0xcf9b('0xe'));var deskjs=require(_0xcf9b('0xf'));var toCsv=require(_0xcf9b('0x10'));var querystring=require(_0xcf9b('0x11'));var Papa=require(_0xcf9b('0x12'));var Redis=require('ioredis');var authService=require(_0xcf9b('0x13'));var qs=require(_0xcf9b('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcf9b('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xcf9b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcf9b('0x17'))['db'];function respondWithStatusCode(_0xb74875,_0x4b199a){_0x4b199a=_0x4b199a||0xcc;return function(_0x1033e6){if(_0x1033e6){return _0xb74875[_0xcf9b('0x18')](_0x4b199a);}return _0xb74875[_0xcf9b('0x19')](_0x4b199a)[_0xcf9b('0x1a')]();};}function respondWithResult(_0x2363cb,_0x573748){_0x573748=_0x573748||0xc8;return function(_0x37d3a1){if(_0x37d3a1){return _0x2363cb[_0xcf9b('0x19')](_0x573748)[_0xcf9b('0x1b')](_0x37d3a1);}};}function respondWithFilteredResult(_0x1ee95f,_0x49d7f8){return function(_0x5a61f8){if(_0x5a61f8){var _0x1cb45f=typeof _0x49d7f8[_0xcf9b('0x1c')]===_0xcf9b('0x1d')&&typeof _0x49d7f8[_0xcf9b('0x1e')]===_0xcf9b('0x1d');var _0x1a6531=_0x5a61f8['count'];var _0x1e4017=_0x1cb45f?0x0:_0x49d7f8[_0xcf9b('0x1c')];var _0x4a6a42=_0x1cb45f?_0x5a61f8[_0xcf9b('0x1f')]:_0x49d7f8['offset']+_0x49d7f8[_0xcf9b('0x1e')];var _0x2671d6;if(_0x4a6a42>=_0x1a6531){_0x4a6a42=_0x1a6531;_0x2671d6=0xc8;}else{_0x2671d6=0xce;}_0x1ee95f['status'](_0x2671d6);return _0x1ee95f[_0xcf9b('0x20')]('Content-Range',_0x1e4017+'-'+_0x4a6a42+'/'+_0x1a6531)[_0xcf9b('0x1b')](_0x5a61f8);}return null;};}function patchUpdates(_0x249b02){return function(_0x1adb55){try{jsonpatch[_0xcf9b('0x21')](_0x1adb55,_0x249b02,!![]);}catch(_0x12ebbe){return BPromise[_0xcf9b('0x22')](_0x12ebbe);}return _0x1adb55[_0xcf9b('0x23')]();};}function saveUpdates(_0x44802a,_0x2a20c5){return function(_0x285c99){if(_0x285c99){return _0x285c99[_0xcf9b('0x24')](_0x44802a)[_0xcf9b('0x25')](function(_0x455b5a){return _0x455b5a;});}return null;};}function removeEntity(_0x55c840,_0x14b23c){return function(_0x9ed593){if(_0x9ed593){return _0x9ed593[_0xcf9b('0x26')]()[_0xcf9b('0x25')](function(){_0x55c840[_0xcf9b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x926630,_0x20387b){return function(_0x13ff2a){if(!_0x13ff2a){_0x926630['sendStatus'](0x194);}return _0x13ff2a;};}function handleError(_0x1c22df,_0x45b3c1){_0x45b3c1=_0x45b3c1||0x1f4;return function(_0x166b9d){logger['error'](_0x166b9d[_0xcf9b('0x27')]);if(_0x166b9d[_0xcf9b('0x28')]){delete _0x166b9d[_0xcf9b('0x28')];}_0x1c22df['status'](_0x45b3c1)[_0xcf9b('0x29')](_0x166b9d);};}exports['index']=function(_0xab8e7f,_0x26fea2){var _0x2ff53d={},_0x341f8c={},_0x30c6dc={'count':0x0,'rows':[]};var _0x18b408=_['map'](db[_0xcf9b('0x2a')][_0xcf9b('0x2b')],function(_0xb2bd13){return{'name':_0xb2bd13[_0xcf9b('0x2c')],'type':_0xb2bd13[_0xcf9b('0x2d')][_0xcf9b('0x2e')]};});_0x341f8c[_0xcf9b('0x2f')]=_[_0xcf9b('0x30')](_0x18b408,_0xcf9b('0x28'));_0x341f8c['query']=_[_0xcf9b('0x31')](_0xab8e7f['query']);_0x341f8c[_0xcf9b('0x32')]=_[_0xcf9b('0x33')](_0x341f8c['model'],_0x341f8c[_0xcf9b('0x34')]);_0x2ff53d[_0xcf9b('0x35')]=_[_0xcf9b('0x33')](_0x341f8c[_0xcf9b('0x2f')],qs[_0xcf9b('0x36')](_0xab8e7f[_0xcf9b('0x34')][_0xcf9b('0x36')]));_0x2ff53d['attributes']=_0x2ff53d[_0xcf9b('0x35')][_0xcf9b('0x37')]?_0x2ff53d[_0xcf9b('0x35')]:_0x341f8c[_0xcf9b('0x2f')];if(!_0xab8e7f['query'][_0xcf9b('0x38')]('nolimit')){_0x2ff53d[_0xcf9b('0x1e')]=qs[_0xcf9b('0x1e')](_0xab8e7f[_0xcf9b('0x34')]['limit']);_0x2ff53d[_0xcf9b('0x1c')]=qs['offset'](_0xab8e7f[_0xcf9b('0x34')]['offset']);}_0x2ff53d[_0xcf9b('0x39')]=qs[_0xcf9b('0x3a')](_0xab8e7f[_0xcf9b('0x34')][_0xcf9b('0x3a')]);_0x2ff53d[_0xcf9b('0x3b')]=qs[_0xcf9b('0x32')](_[_0xcf9b('0x3c')](_0xab8e7f[_0xcf9b('0x34')],_0x341f8c[_0xcf9b('0x32')]),_0x18b408);if(_0xab8e7f[_0xcf9b('0x34')][_0xcf9b('0x3d')]){_0x2ff53d[_0xcf9b('0x3b')]=_['merge'](_0x2ff53d[_0xcf9b('0x3b')],{'$or':_[_0xcf9b('0x30')](_0x18b408,function(_0x30b060){if(_0x30b060[_0xcf9b('0x2d')]!=='VIRTUAL'){var _0x11ef2c={};_0x11ef2c[_0x30b060[_0xcf9b('0x28')]]={'$like':'%'+_0xab8e7f[_0xcf9b('0x34')][_0xcf9b('0x3d')]+'%'};return _0x11ef2c;}})});}_0x2ff53d=_[_0xcf9b('0x3e')]({},_0x2ff53d,_0xab8e7f['options']);var _0x2e493f={'where':_0x2ff53d[_0xcf9b('0x3b')]};return db[_0xcf9b('0x2a')]['count'](_0x2e493f)[_0xcf9b('0x25')](function(_0x3feba2){_0x30c6dc['count']=_0x3feba2;if(_0xab8e7f['query']['includeAll']){_0x2ff53d[_0xcf9b('0x3f')]=[{'all':!![]}];}return db[_0xcf9b('0x2a')][_0xcf9b('0x40')](_0x2ff53d);})['then'](function(_0x3d7f36){_0x30c6dc[_0xcf9b('0x41')]=_0x3d7f36;return _0x30c6dc;})[_0xcf9b('0x25')](respondWithFilteredResult(_0x26fea2,_0x2ff53d))[_0xcf9b('0x42')](handleError(_0x26fea2,null));};exports[_0xcf9b('0x43')]=function(_0x32048f,_0xb85d17){var _0x4290f6={'raw':!![],'where':{'id':_0x32048f[_0xcf9b('0x44')]['id']}},_0x20dc03={};_0x20dc03[_0xcf9b('0x2f')]=_[_0xcf9b('0x31')](db[_0xcf9b('0x2a')][_0xcf9b('0x2b')]);_0x20dc03[_0xcf9b('0x34')]=_[_0xcf9b('0x31')](_0x32048f[_0xcf9b('0x34')]);_0x20dc03[_0xcf9b('0x32')]=_[_0xcf9b('0x33')](_0x20dc03[_0xcf9b('0x2f')],_0x20dc03['query']);_0x4290f6['attributes']=_[_0xcf9b('0x33')](_0x20dc03[_0xcf9b('0x2f')],qs[_0xcf9b('0x36')](_0x32048f[_0xcf9b('0x34')][_0xcf9b('0x36')]));_0x4290f6['attributes']=_0x4290f6[_0xcf9b('0x35')][_0xcf9b('0x37')]?_0x4290f6['attributes']:_0x20dc03[_0xcf9b('0x2f')];if(_0x32048f[_0xcf9b('0x34')][_0xcf9b('0x45')]){_0x4290f6[_0xcf9b('0x3f')]=[{'all':!![]}];}_0x4290f6=_[_0xcf9b('0x3e')]({},_0x4290f6,_0x32048f['options']);return db[_0xcf9b('0x2a')][_0xcf9b('0x46')](_0x4290f6)[_0xcf9b('0x25')](handleEntityNotFound(_0xb85d17,null))[_0xcf9b('0x25')](respondWithResult(_0xb85d17,null))['catch'](handleError(_0xb85d17,null));};exports[_0xcf9b('0x47')]=function(_0x4f8dcf,_0x3442a9){return db[_0xcf9b('0x2a')][_0xcf9b('0x47')](_0x4f8dcf[_0xcf9b('0x48')],{})[_0xcf9b('0x25')](respondWithResult(_0x3442a9,0xc9))[_0xcf9b('0x42')](handleError(_0x3442a9,null));};exports[_0xcf9b('0x24')]=function(_0x658ed4,_0x12ddde){if(_0x658ed4[_0xcf9b('0x48')]['id']){delete _0x658ed4[_0xcf9b('0x48')]['id'];}return db['FaxQueueReport']['find']({'where':{'id':_0x658ed4['params']['id']}})['then'](handleEntityNotFound(_0x12ddde,null))[_0xcf9b('0x25')](saveUpdates(_0x658ed4[_0xcf9b('0x48')],null))[_0xcf9b('0x25')](respondWithResult(_0x12ddde,null))[_0xcf9b('0x42')](handleError(_0x12ddde,null));};exports[_0xcf9b('0x26')]=function(_0x554230,_0x5875b8){return db[_0xcf9b('0x2a')][_0xcf9b('0x46')]({'where':{'id':_0x554230[_0xcf9b('0x44')]['id']}})[_0xcf9b('0x25')](handleEntityNotFound(_0x5875b8,null))[_0xcf9b('0x25')](removeEntity(_0x5875b8,null))['catch'](handleError(_0x5875b8,null));};exports[_0xcf9b('0x49')]=function(_0x1895a3,_0x1e7adb){return db['FaxQueueReport']['describe']()[_0xcf9b('0x25')](respondWithResult(_0x1e7adb,null))[_0xcf9b('0x42')](handleError(_0x1e7adb,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 846bebd..8e23462 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 _0x7217=['api','moment','bluebird','request-promise','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','uniqueid','lodash','../../config/logger'];(function(_0x14e589,_0x5d5c97){var _0x4ceb8c=function(_0x55f065){while(--_0x55f065){_0x14e589['push'](_0x14e589['shift']());}};_0x4ceb8c(++_0x5d5c97);}(_0x7217,0x19e));var _0x7721=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0x7217[_0x5037ab];return _0x512adb;};'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':[{'name':_0x7721('0xc'),'fields':[_0x7721('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['report_fax_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport'];(function(_0x3fe56c,_0x497f5e){var _0x424622=function(_0x585d62){while(--_0x585d62){_0x3fe56c['push'](_0x3fe56c['shift']());}};_0x424622(++_0x497f5e);}(_0x7a54,0x106));var _0x47a5=function(_0x44066a,_0x5f57d2){_0x44066a=_0x44066a-0x0;var _0xc2c03e=_0x7a54[_0x44066a];return _0xc2c03e;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index c6440b2..bf082e5 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 _0x0442=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','FaxQueueReport,\x20%s,\x20%s','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','stringify','catch','UpdateFaxQueueReport','update','where','attributes'];(function(_0x4653ae,_0x1c9583){var _0x4a8183=function(_0x3a6836){while(--_0x3a6836){_0x4653ae['push'](_0x4653ae['shift']());}};_0x4a8183(++_0x1c9583);}(_0x0442,0x1c7));var _0x2044=function(_0x29d623,_0x1a5c9c){_0x29d623=_0x29d623-0x0;var _0x242e59=_0x0442[_0x29d623];return _0x242e59;};'use strict';var _=require('lodash');var util=require(_0x2044('0x0'));var moment=require(_0x2044('0x1'));var BPromise=require(_0x2044('0x2'));var rs=require(_0x2044('0x3'));var fs=require('fs');var Redis=require(_0x2044('0x4'));var db=require(_0x2044('0x5'))['db'];var utils=require(_0x2044('0x6'));var logger=require(_0x2044('0x7'))(_0x2044('0x8'));var config=require(_0x2044('0x9'));var jayson=require(_0x2044('0xa'));var client=jayson[_0x2044('0xb')][_0x2044('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xc7d101,_0x2d9fde,_0x1a343b){return new BPromise(function(_0x529f88,_0x99e2d7){return client[_0x2044('0xd')](_0xc7d101,_0x1a343b)[_0x2044('0xe')](function(_0x317bf4){logger[_0x2044('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x2d9fde,_0x2044('0x10'));logger[_0x2044('0x11')](_0x2044('0x12'),_0x2d9fde,_0x2044('0x10'),JSON['stringify'](_0x317bf4));if(_0x317bf4[_0x2044('0x13')]){if(_0x317bf4['error'][_0x2044('0x14')]===0x1f4){logger[_0x2044('0x13')]('FaxQueueReport,\x20%s,\x20%s',_0x2d9fde,_0x317bf4['error'][_0x2044('0x15')]);return _0x99e2d7(_0x317bf4[_0x2044('0x13')]['message']);}logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x2d9fde,_0x317bf4[_0x2044('0x13')][_0x2044('0x15')]);return _0x529f88(_0x317bf4['error'][_0x2044('0x15')]);}else{logger[_0x2044('0xf')](_0x2044('0x16'),_0x2d9fde,'request\x20sent');_0x529f88(_0x317bf4['result'][_0x2044('0x15')]);}})['catch'](function(_0x1d5b2e){logger[_0x2044('0x13')]('FaxQueueReport,\x20%s,\x20%s',_0x2d9fde,_0x1d5b2e);_0x99e2d7(_0x1d5b2e);});});}exports[_0x2044('0x17')]=function(_0x5d32fb){var _0x3ac6a0=this;return new Promise(function(_0x26099f,_0x325d5c){return db[_0x2044('0x18')][_0x2044('0x19')](_0x5d32fb[_0x2044('0x1a')],{'raw':_0x5d32fb[_0x2044('0x1b')]?_0x5d32fb[_0x2044('0x1b')][_0x2044('0x1c')]===undefined?!![]:![]:!![]})[_0x2044('0xe')](function(_0x3dad7d){logger['info']('CreateFaxQueueReport',_0x5d32fb);logger[_0x2044('0x11')]('CreateFaxQueueReport',_0x5d32fb,JSON[_0x2044('0x1d')](_0x3dad7d));_0x26099f(_0x3dad7d);})[_0x2044('0x1e')](function(_0x5b2d68){logger[_0x2044('0x13')](_0x2044('0x17'),_0x5b2d68[_0x2044('0x15')],_0x5d32fb);_0x325d5c(_0x3ac6a0['error'](0x1f4,_0x5b2d68[_0x2044('0x15')]));});});};exports[_0x2044('0x1f')]=function(_0xf304b1){var _0x38300b=this;return new Promise(function(_0x33941e,_0x3a74a1){return db[_0x2044('0x18')][_0x2044('0x20')](_0xf304b1[_0x2044('0x1a')],{'raw':_0xf304b1['options']?_0xf304b1[_0x2044('0x1b')][_0x2044('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf304b1[_0x2044('0x1b')]?_0xf304b1[_0x2044('0x1b')][_0x2044('0x21')]||null:null,'attributes':_0xf304b1[_0x2044('0x1b')]?_0xf304b1[_0x2044('0x1b')][_0x2044('0x22')]||null:null,'limit':_0xf304b1[_0x2044('0x1b')]?_0xf304b1['options']['limit']||null:null})[_0x2044('0xe')](function(_0x205418){logger['info']('UpdateFaxQueueReport',_0xf304b1);logger[_0x2044('0x11')](_0x2044('0x1f'),_0xf304b1,JSON[_0x2044('0x1d')](_0x205418));_0x33941e(_0x205418);})[_0x2044('0x1e')](function(_0x4f12f4){logger[_0x2044('0x13')]('UpdateFaxQueueReport',_0x4f12f4['message'],_0xf304b1);_0x3a74a1(_0x38300b[_0x2044('0x13')](0x1f4,_0x4f12f4['message']));});});}; \ No newline at end of file +var _0xf8c3=['error','code','result','message','catch','FaxQueueReport','create','body','options','raw','CreateFaxQueueReport','update','where','attributes','limit','UpdateFaxQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x293f0d,_0x436557){var _0x55a28b=function(_0x2a5abc){while(--_0x2a5abc){_0x293f0d['push'](_0x293f0d['shift']());}};_0x55a28b(++_0x436557);}(_0xf8c3,0x1a8));var _0x3f8c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf8c3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x3f8c('0x0'));var moment=require(_0x3f8c('0x1'));var BPromise=require(_0x3f8c('0x2'));var rs=require(_0x3f8c('0x3'));var fs=require('fs');var Redis=require(_0x3f8c('0x4'));var db=require(_0x3f8c('0x5'))['db'];var utils=require(_0x3f8c('0x6'));var logger=require(_0x3f8c('0x7'))(_0x3f8c('0x8'));var config=require('../../config/environment');var jayson=require(_0x3f8c('0x9'));var client=jayson[_0x3f8c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31da96,_0x5e18c7,_0x5f0411){return new BPromise(function(_0x233ed5,_0x196d52){return client['request'](_0x31da96,_0x5f0411)[_0x3f8c('0xb')](function(_0x172ec4){logger[_0x3f8c('0xc')](_0x3f8c('0xd'),_0x5e18c7,'request\x20sent');logger[_0x3f8c('0xe')](_0x3f8c('0xf'),_0x5e18c7,_0x3f8c('0x10'),JSON[_0x3f8c('0x11')](_0x172ec4));if(_0x172ec4[_0x3f8c('0x12')]){if(_0x172ec4[_0x3f8c('0x12')][_0x3f8c('0x13')]===0x1f4){logger[_0x3f8c('0x12')](_0x3f8c('0xd'),_0x5e18c7,_0x172ec4[_0x3f8c('0x12')]['message']);return _0x196d52(_0x172ec4['error']['message']);}logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x5e18c7,_0x172ec4[_0x3f8c('0x12')]['message']);return _0x233ed5(_0x172ec4[_0x3f8c('0x12')]['message']);}else{logger[_0x3f8c('0xc')]('FaxQueueReport,\x20%s,\x20%s',_0x5e18c7,_0x3f8c('0x10'));_0x233ed5(_0x172ec4[_0x3f8c('0x14')][_0x3f8c('0x15')]);}})[_0x3f8c('0x16')](function(_0x20f005){logger[_0x3f8c('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0x5e18c7,_0x20f005);_0x196d52(_0x20f005);});});}exports['CreateFaxQueueReport']=function(_0x412fb8){var _0x5a4594=this;return new Promise(function(_0x2af8d1,_0x1859c6){return db[_0x3f8c('0x17')][_0x3f8c('0x18')](_0x412fb8[_0x3f8c('0x19')],{'raw':_0x412fb8[_0x3f8c('0x1a')]?_0x412fb8[_0x3f8c('0x1a')][_0x3f8c('0x1b')]===undefined?!![]:![]:!![]})[_0x3f8c('0xb')](function(_0x28a0e6){logger['info']('CreateFaxQueueReport',_0x412fb8);logger[_0x3f8c('0xe')](_0x3f8c('0x1c'),_0x412fb8,JSON['stringify'](_0x28a0e6));_0x2af8d1(_0x28a0e6);})[_0x3f8c('0x16')](function(_0x2b3be9){logger['error'](_0x3f8c('0x1c'),_0x2b3be9[_0x3f8c('0x15')],_0x412fb8);_0x1859c6(_0x5a4594[_0x3f8c('0x12')](0x1f4,_0x2b3be9[_0x3f8c('0x15')]));});});};exports['UpdateFaxQueueReport']=function(_0x3f608b){var _0x538186=this;return new Promise(function(_0x14b77e,_0xf8feb5){return db[_0x3f8c('0x17')][_0x3f8c('0x1d')](_0x3f608b[_0x3f8c('0x19')],{'raw':_0x3f608b[_0x3f8c('0x1a')]?_0x3f608b[_0x3f8c('0x1a')][_0x3f8c('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f608b[_0x3f8c('0x1a')]?_0x3f608b[_0x3f8c('0x1a')][_0x3f8c('0x1e')]||null:null,'attributes':_0x3f608b[_0x3f8c('0x1a')]?_0x3f608b[_0x3f8c('0x1a')][_0x3f8c('0x1f')]||null:null,'limit':_0x3f608b[_0x3f8c('0x1a')]?_0x3f608b[_0x3f8c('0x1a')][_0x3f8c('0x20')]||null:null})[_0x3f8c('0xb')](function(_0x2996b4){logger[_0x3f8c('0xc')](_0x3f8c('0x21'),_0x3f608b);logger[_0x3f8c('0xe')]('UpdateFaxQueueReport',_0x3f608b,JSON[_0x3f8c('0x11')](_0x2996b4));_0x14b77e(_0x2996b4);})[_0x3f8c('0x16')](function(_0x3ce3d9){logger['error'](_0x3f8c('0x21'),_0x3ce3d9['message'],_0x3f608b);_0xf8feb5(_0x538186[_0x3f8c('0x12')](0x1f4,_0x3ce3d9[_0x3f8c('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index ef4ef7b..d4d815c 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 _0xb606=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','index','get','isAuthenticated','describe','/:id','show','delete','destroy','exports'];(function(_0x16d793,_0x22f0f7){var _0x444f4f=function(_0x425556){while(--_0x425556){_0x16d793['push'](_0x16d793['shift']());}};_0x444f4f(++_0x22f0f7);}(_0xb606,0x144));var _0x6b60=function(_0x349148,_0x31eabb){_0x349148=_0x349148-0x0;var _0x2f2b0f=_0xb606[_0x349148];return _0x2f2b0f;};'use strict';var multer=require(_0x6b60('0x0'));var util=require(_0x6b60('0x1'));var path=require('path');var timeout=require(_0x6b60('0x2'));var express=require(_0x6b60('0x3'));var router=express[_0x6b60('0x4')]();var fs_extra=require(_0x6b60('0x5'));var auth=require(_0x6b60('0x6'));var interaction=require(_0x6b60('0x7'));var config=require('../../config/environment');var controller=require(_0x6b60('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x6b60('0x9')]);router[_0x6b60('0xa')]('/describe',auth[_0x6b60('0xb')](),controller[_0x6b60('0xc')]);router[_0x6b60('0xa')](_0x6b60('0xd'),auth[_0x6b60('0xb')](),controller[_0x6b60('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x6b60('0xd'),auth[_0x6b60('0xb')](),controller['update']);router[_0x6b60('0xf')](_0x6b60('0xd'),auth['isAuthenticated'](),controller[_0x6b60('0x10')]);module[_0x6b60('0x11')]=router; \ No newline at end of file +var _0xd7e6=['get','/describe','describe','/:id','show','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','isAuthenticated','index'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0xd7e6,0xba));var _0x6d7e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd7e6[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x6d7e('0x0'));var util=require(_0x6d7e('0x1'));var path=require(_0x6d7e('0x2'));var timeout=require(_0x6d7e('0x3'));var express=require(_0x6d7e('0x4'));var router=express[_0x6d7e('0x5')]();var fs_extra=require(_0x6d7e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x6d7e('0x7'));var config=require(_0x6d7e('0x8'));var controller=require(_0x6d7e('0x9'));router['get']('/',auth[_0x6d7e('0xa')](),controller[_0x6d7e('0xb')]);router[_0x6d7e('0xc')](_0x6d7e('0xd'),auth[_0x6d7e('0xa')](),controller[_0x6d7e('0xe')]);router[_0x6d7e('0xc')](_0x6d7e('0xf'),auth['isAuthenticated'](),controller[_0x6d7e('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6d7e('0x11')]);router[_0x6d7e('0x12')](_0x6d7e('0xf'),auth['isAuthenticated'](),controller[_0x6d7e('0x13')]);router[_0x6d7e('0x14')](_0x6d7e('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x6d7e('0x15')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index e3448de..1af73dd 100644 --- a/server/api/faxTransferReport/faxTransferReport.attributes.js +++ b/server/api/faxTransferReport/faxTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x24175b,_0x51cfcd){var _0x1257fc=function(_0x358b4a){while(--_0x358b4a){_0x24175b['push'](_0x24175b['shift']());}};_0x1257fc(++_0x51cfcd);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x144b30,_0x77072d){_0x144b30=_0x144b30-0x0;var _0x1bb7bc=_0xcb91[_0x144b30];return _0x1bb7bc;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file +var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x471d82,_0x42fb95){var _0x383318=function(_0x55fa7b){while(--_0x55fa7b){_0x471d82['push'](_0x471d82['shift']());}};_0x383318(++_0x42fb95);}(_0x00bb,0x1d8));var _0xb00b=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x00bb[_0x1e7b16];return _0x37fadc;};'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/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 64e7db4..6d07f83 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 _0x5c21=['offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','filters','filter','where','merge','VIRTUAL','includeAll','include','catch','show','find','create','body','update','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','status','end','json'];(function(_0x1d4836,_0x3c3f93){var _0x40e115=function(_0x4ef413){while(--_0x4ef413){_0x1d4836['push'](_0x1d4836['shift']());}};_0x40e115(++_0x3c3f93);}(_0x5c21,0x1d7));var _0x15c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5c21[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x15c2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x15c2('0x1'));var jsonpatch=require(_0x15c2('0x2'));var rp=require(_0x15c2('0x3'));var moment=require(_0x15c2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x15c2('0x5'));var util=require(_0x15c2('0x6'));var path=require(_0x15c2('0x7'));var sox=require('sox');var csv=require(_0x15c2('0x8'));var ejs=require(_0x15c2('0x9'));var fs=require('fs');var fs_extra=require(_0x15c2('0xa'));var _=require('lodash');var squel=require(_0x15c2('0xb'));var crypto=require(_0x15c2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x15c2('0xd'));var toCsv=require(_0x15c2('0x8'));var querystring=require('querystring');var Papa=require(_0x15c2('0xe'));var Redis=require(_0x15c2('0xf'));var authService=require(_0x15c2('0x10'));var qs=require(_0x15c2('0x11'));var as=require(_0x15c2('0x12'));var hardwareService=require(_0x15c2('0x13'));var logger=require(_0x15c2('0x14'))(_0x15c2('0x15'));var utils=require('../../config/utils');var config=require(_0x15c2('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1508de,_0x582bcd){_0x582bcd=_0x582bcd||0xcc;return function(_0x7e0d3b){if(_0x7e0d3b){return _0x1508de['sendStatus'](_0x582bcd);}return _0x1508de[_0x15c2('0x17')](_0x582bcd)[_0x15c2('0x18')]();};}function respondWithResult(_0x2eb0c6,_0x41ca46){_0x41ca46=_0x41ca46||0xc8;return function(_0x12d1e4){if(_0x12d1e4){return _0x2eb0c6[_0x15c2('0x17')](_0x41ca46)[_0x15c2('0x19')](_0x12d1e4);}};}function respondWithFilteredResult(_0x3d708c,_0x59d6e6){return function(_0x18a39b){if(_0x18a39b){var _0x363718=typeof _0x59d6e6[_0x15c2('0x1a')]===_0x15c2('0x1b')&&typeof _0x59d6e6[_0x15c2('0x1c')]===_0x15c2('0x1b');var _0x3bac73=_0x18a39b[_0x15c2('0x1d')];var _0x935252=_0x363718?0x0:_0x59d6e6[_0x15c2('0x1a')];var _0x142b2c=_0x363718?_0x18a39b[_0x15c2('0x1d')]:_0x59d6e6[_0x15c2('0x1a')]+_0x59d6e6[_0x15c2('0x1c')];var _0x44a35a;if(_0x142b2c>=_0x3bac73){_0x142b2c=_0x3bac73;_0x44a35a=0xc8;}else{_0x44a35a=0xce;}_0x3d708c['status'](_0x44a35a);return _0x3d708c['set'](_0x15c2('0x1e'),_0x935252+'-'+_0x142b2c+'/'+_0x3bac73)[_0x15c2('0x19')](_0x18a39b);}return null;};}function patchUpdates(_0x6f46ee){return function(_0x227a98){try{jsonpatch[_0x15c2('0x1f')](_0x227a98,_0x6f46ee,!![]);}catch(_0x2906ec){return BPromise[_0x15c2('0x20')](_0x2906ec);}return _0x227a98[_0x15c2('0x21')]();};}function saveUpdates(_0x5c49d9,_0x27693f){return function(_0x4f0e3d){if(_0x4f0e3d){return _0x4f0e3d['update'](_0x5c49d9)[_0x15c2('0x22')](function(_0xe5e139){return _0xe5e139;});}return null;};}function removeEntity(_0x474bb4,_0x41ea7d){return function(_0x4e7d53){if(_0x4e7d53){return _0x4e7d53[_0x15c2('0x23')]()[_0x15c2('0x22')](function(){_0x474bb4[_0x15c2('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1271b3,_0x1bf97b){return function(_0x4935ac){if(!_0x4935ac){_0x1271b3[_0x15c2('0x24')](0x194);}return _0x4935ac;};}function handleError(_0x4e93e6,_0x55ff41){_0x55ff41=_0x55ff41||0x1f4;return function(_0x89ca37){logger[_0x15c2('0x25')](_0x89ca37['stack']);if(_0x89ca37['name']){delete _0x89ca37[_0x15c2('0x26')];}_0x4e93e6[_0x15c2('0x17')](_0x55ff41)[_0x15c2('0x27')](_0x89ca37);};}exports[_0x15c2('0x28')]=function(_0x570762,_0x20fbea){var _0x526e6b={},_0x38b8e2={},_0x5f3663={'count':0x0,'rows':[]};var _0x41ff25=_[_0x15c2('0x29')](db[_0x15c2('0x2a')][_0x15c2('0x2b')],function(_0x49f906){return{'name':_0x49f906[_0x15c2('0x2c')],'type':_0x49f906[_0x15c2('0x2d')]['key']};});_0x38b8e2[_0x15c2('0x2e')]=_['map'](_0x41ff25,'name');_0x38b8e2[_0x15c2('0x2f')]=_[_0x15c2('0x30')](_0x570762[_0x15c2('0x2f')]);_0x38b8e2['filters']=_['intersection'](_0x38b8e2[_0x15c2('0x2e')],_0x38b8e2[_0x15c2('0x2f')]);_0x526e6b[_0x15c2('0x31')]=_[_0x15c2('0x32')](_0x38b8e2[_0x15c2('0x2e')],qs[_0x15c2('0x33')](_0x570762[_0x15c2('0x2f')][_0x15c2('0x33')]));_0x526e6b[_0x15c2('0x31')]=_0x526e6b[_0x15c2('0x31')][_0x15c2('0x34')]?_0x526e6b[_0x15c2('0x31')]:_0x38b8e2[_0x15c2('0x2e')];if(!_0x570762['query'][_0x15c2('0x35')](_0x15c2('0x36'))){_0x526e6b[_0x15c2('0x1c')]=qs['limit'](_0x570762[_0x15c2('0x2f')][_0x15c2('0x1c')]);_0x526e6b['offset']=qs[_0x15c2('0x1a')](_0x570762['query'][_0x15c2('0x1a')]);}_0x526e6b[_0x15c2('0x37')]=qs['sort'](_0x570762['query']['sort']);_0x526e6b['where']=qs[_0x15c2('0x38')](_['pick'](_0x570762['query'],_0x38b8e2['filters']),_0x41ff25);if(_0x570762[_0x15c2('0x2f')][_0x15c2('0x39')]){_0x526e6b[_0x15c2('0x3a')]=_[_0x15c2('0x3b')](_0x526e6b['where'],{'$or':_['map'](_0x41ff25,function(_0x53c0fa){if(_0x53c0fa['type']!==_0x15c2('0x3c')){var _0x5c0cab={};_0x5c0cab[_0x53c0fa[_0x15c2('0x26')]]={'$like':'%'+_0x570762[_0x15c2('0x2f')][_0x15c2('0x39')]+'%'};return _0x5c0cab;}})});}_0x526e6b=_[_0x15c2('0x3b')]({},_0x526e6b,_0x570762['options']);var _0x372bca={'where':_0x526e6b[_0x15c2('0x3a')]};return db[_0x15c2('0x2a')][_0x15c2('0x1d')](_0x372bca)[_0x15c2('0x22')](function(_0x10d505){_0x5f3663[_0x15c2('0x1d')]=_0x10d505;if(_0x570762[_0x15c2('0x2f')][_0x15c2('0x3d')]){_0x526e6b[_0x15c2('0x3e')]=[{'all':!![]}];}return db[_0x15c2('0x2a')]['findAll'](_0x526e6b);})[_0x15c2('0x22')](function(_0x394178){_0x5f3663['rows']=_0x394178;return _0x5f3663;})[_0x15c2('0x22')](respondWithFilteredResult(_0x20fbea,_0x526e6b))[_0x15c2('0x3f')](handleError(_0x20fbea,null));};exports[_0x15c2('0x40')]=function(_0xa1f67d,_0x345498){var _0x2c287a={'raw':!![],'where':{'id':_0xa1f67d['params']['id']}},_0x547ae0={};_0x547ae0[_0x15c2('0x2e')]=_[_0x15c2('0x30')](db[_0x15c2('0x2a')][_0x15c2('0x2b')]);_0x547ae0[_0x15c2('0x2f')]=_[_0x15c2('0x30')](_0xa1f67d[_0x15c2('0x2f')]);_0x547ae0[_0x15c2('0x38')]=_[_0x15c2('0x32')](_0x547ae0[_0x15c2('0x2e')],_0x547ae0[_0x15c2('0x2f')]);_0x2c287a[_0x15c2('0x31')]=_[_0x15c2('0x32')](_0x547ae0[_0x15c2('0x2e')],qs['fields'](_0xa1f67d[_0x15c2('0x2f')][_0x15c2('0x33')]));_0x2c287a[_0x15c2('0x31')]=_0x2c287a[_0x15c2('0x31')][_0x15c2('0x34')]?_0x2c287a[_0x15c2('0x31')]:_0x547ae0[_0x15c2('0x2e')];if(_0xa1f67d['query'][_0x15c2('0x3d')]){_0x2c287a[_0x15c2('0x3e')]=[{'all':!![]}];}_0x2c287a=_[_0x15c2('0x3b')]({},_0x2c287a,_0xa1f67d['options']);return db[_0x15c2('0x2a')][_0x15c2('0x41')](_0x2c287a)['then'](handleEntityNotFound(_0x345498,null))[_0x15c2('0x22')](respondWithResult(_0x345498,null))['catch'](handleError(_0x345498,null));};exports[_0x15c2('0x42')]=function(_0x49ea94,_0x2dcb44){return db['FaxTransferReport'][_0x15c2('0x42')](_0x49ea94[_0x15c2('0x43')],{})['then'](respondWithResult(_0x2dcb44,0xc9))['catch'](handleError(_0x2dcb44,null));};exports[_0x15c2('0x44')]=function(_0x39c5fa,_0x52786e){if(_0x39c5fa['body']['id']){delete _0x39c5fa['body']['id'];}return db['FaxTransferReport'][_0x15c2('0x41')]({'where':{'id':_0x39c5fa['params']['id']}})[_0x15c2('0x22')](handleEntityNotFound(_0x52786e,null))[_0x15c2('0x22')](saveUpdates(_0x39c5fa[_0x15c2('0x43')],null))['then'](respondWithResult(_0x52786e,null))['catch'](handleError(_0x52786e,null));};exports[_0x15c2('0x23')]=function(_0x2ff447,_0x592bfb){return db[_0x15c2('0x2a')][_0x15c2('0x41')]({'where':{'id':_0x2ff447[_0x15c2('0x45')]['id']}})[_0x15c2('0x22')](handleEntityNotFound(_0x592bfb,null))[_0x15c2('0x22')](removeEntity(_0x592bfb,null))[_0x15c2('0x3f')](handleError(_0x592bfb,null));};exports[_0x15c2('0x46')]=function(_0x188e7f,_0x4b0a75){return db['FaxTransferReport'][_0x15c2('0x46')]()[_0x15c2('0x22')](respondWithResult(_0x4b0a75,null))['catch'](handleError(_0x4b0a75,null));}; \ No newline at end of file +var _0x6ff4=['map','FaxTransferReport','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','merge','VIRTUAL','filter','options','include','findAll','catch','show','keys','includeAll','create','body','update','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','set','Content-Range','json','apply','reject','save','then','error','stack','name','send','index'];(function(_0x47d6dc,_0xc036cc){var _0x1a1c93=function(_0x18ec96){while(--_0x18ec96){_0x47d6dc['push'](_0x47d6dc['shift']());}};_0x1a1c93(++_0xc036cc);}(_0x6ff4,0x15d));var _0x46ff=function(_0x559200,_0x43f57b){_0x559200=_0x559200-0x0;var _0x3cb366=_0x6ff4[_0x559200];return _0x3cb366;};'use strict';var emlformat=require(_0x46ff('0x0'));var rimraf=require(_0x46ff('0x1'));var zipdir=require(_0x46ff('0x2'));var jsonpatch=require(_0x46ff('0x3'));var rp=require('request-promise');var moment=require(_0x46ff('0x4'));var BPromise=require(_0x46ff('0x5'));var Mustache=require(_0x46ff('0x6'));var util=require(_0x46ff('0x7'));var path=require(_0x46ff('0x8'));var sox=require(_0x46ff('0x9'));var csv=require(_0x46ff('0xa'));var ejs=require(_0x46ff('0xb'));var fs=require('fs');var fs_extra=require(_0x46ff('0xc'));var _=require('lodash');var squel=require(_0x46ff('0xd'));var crypto=require(_0x46ff('0xe'));var jsforce=require(_0x46ff('0xf'));var deskjs=require(_0x46ff('0x10'));var toCsv=require(_0x46ff('0xa'));var querystring=require(_0x46ff('0x11'));var Papa=require(_0x46ff('0x12'));var Redis=require('ioredis');var authService=require(_0x46ff('0x13'));var qs=require(_0x46ff('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x46ff('0x15'));var logger=require(_0x46ff('0x16'))(_0x46ff('0x17'));var utils=require(_0x46ff('0x18'));var config=require(_0x46ff('0x19'));var licenseUtil=require(_0x46ff('0x1a'));var db=require(_0x46ff('0x1b'))['db'];function respondWithStatusCode(_0x5a8910,_0x3c814c){_0x3c814c=_0x3c814c||0xcc;return function(_0x39f29b){if(_0x39f29b){return _0x5a8910[_0x46ff('0x1c')](_0x3c814c);}return _0x5a8910[_0x46ff('0x1d')](_0x3c814c)[_0x46ff('0x1e')]();};}function respondWithResult(_0x33aa21,_0x219ffd){_0x219ffd=_0x219ffd||0xc8;return function(_0x3a8330){if(_0x3a8330){return _0x33aa21[_0x46ff('0x1d')](_0x219ffd)['json'](_0x3a8330);}};}function respondWithFilteredResult(_0x2f6702,_0x542fae){return function(_0x4b7c7a){if(_0x4b7c7a){var _0x3cc824=typeof _0x542fae['offset']===_0x46ff('0x1f')&&typeof _0x542fae['limit']===_0x46ff('0x1f');var _0x336762=_0x4b7c7a[_0x46ff('0x20')];var _0x8cc3eb=_0x3cc824?0x0:_0x542fae[_0x46ff('0x21')];var _0x14b673=_0x3cc824?_0x4b7c7a[_0x46ff('0x20')]:_0x542fae['offset']+_0x542fae['limit'];var _0x3ada48;if(_0x14b673>=_0x336762){_0x14b673=_0x336762;_0x3ada48=0xc8;}else{_0x3ada48=0xce;}_0x2f6702[_0x46ff('0x1d')](_0x3ada48);return _0x2f6702[_0x46ff('0x22')](_0x46ff('0x23'),_0x8cc3eb+'-'+_0x14b673+'/'+_0x336762)[_0x46ff('0x24')](_0x4b7c7a);}return null;};}function patchUpdates(_0x514ee7){return function(_0x1e08e1){try{jsonpatch[_0x46ff('0x25')](_0x1e08e1,_0x514ee7,!![]);}catch(_0x285955){return BPromise[_0x46ff('0x26')](_0x285955);}return _0x1e08e1[_0x46ff('0x27')]();};}function saveUpdates(_0x45bfb2,_0xfe006e){return function(_0x298e32){if(_0x298e32){return _0x298e32['update'](_0x45bfb2)[_0x46ff('0x28')](function(_0x2e9fa2){return _0x2e9fa2;});}return null;};}function removeEntity(_0x4b249c,_0x3336ee){return function(_0x38c050){if(_0x38c050){return _0x38c050['destroy']()[_0x46ff('0x28')](function(){_0x4b249c[_0x46ff('0x1d')](0xcc)[_0x46ff('0x1e')]();});}};}function handleEntityNotFound(_0x25dfa7,_0xfafd70){return function(_0x6855c){if(!_0x6855c){_0x25dfa7[_0x46ff('0x1c')](0x194);}return _0x6855c;};}function handleError(_0x3d1f35,_0x4ec063){_0x4ec063=_0x4ec063||0x1f4;return function(_0x306046){logger[_0x46ff('0x29')](_0x306046[_0x46ff('0x2a')]);if(_0x306046[_0x46ff('0x2b')]){delete _0x306046['name'];}_0x3d1f35[_0x46ff('0x1d')](_0x4ec063)[_0x46ff('0x2c')](_0x306046);};}exports[_0x46ff('0x2d')]=function(_0x44262d,_0x4d01f0){var _0x1a51cc={},_0x1deed4={},_0x53624a={'count':0x0,'rows':[]};var _0x5f25c1=_[_0x46ff('0x2e')](db[_0x46ff('0x2f')][_0x46ff('0x30')],function(_0x3ae2d9){return{'name':_0x3ae2d9['fieldName'],'type':_0x3ae2d9[_0x46ff('0x31')][_0x46ff('0x32')]};});_0x1deed4[_0x46ff('0x33')]=_[_0x46ff('0x2e')](_0x5f25c1,_0x46ff('0x2b'));_0x1deed4[_0x46ff('0x34')]=_['keys'](_0x44262d[_0x46ff('0x34')]);_0x1deed4[_0x46ff('0x35')]=_[_0x46ff('0x36')](_0x1deed4[_0x46ff('0x33')],_0x1deed4[_0x46ff('0x34')]);_0x1a51cc['attributes']=_[_0x46ff('0x36')](_0x1deed4[_0x46ff('0x33')],qs[_0x46ff('0x37')](_0x44262d[_0x46ff('0x34')][_0x46ff('0x37')]));_0x1a51cc[_0x46ff('0x38')]=_0x1a51cc[_0x46ff('0x38')][_0x46ff('0x39')]?_0x1a51cc['attributes']:_0x1deed4[_0x46ff('0x33')];if(!_0x44262d[_0x46ff('0x34')][_0x46ff('0x3a')]('nolimit')){_0x1a51cc['limit']=qs[_0x46ff('0x3b')](_0x44262d['query'][_0x46ff('0x3b')]);_0x1a51cc[_0x46ff('0x21')]=qs[_0x46ff('0x21')](_0x44262d[_0x46ff('0x34')][_0x46ff('0x21')]);}_0x1a51cc[_0x46ff('0x3c')]=qs[_0x46ff('0x3d')](_0x44262d['query']['sort']);_0x1a51cc['where']=qs[_0x46ff('0x35')](_['pick'](_0x44262d[_0x46ff('0x34')],_0x1deed4[_0x46ff('0x35')]),_0x5f25c1);if(_0x44262d[_0x46ff('0x34')]['filter']){_0x1a51cc[_0x46ff('0x3e')]=_[_0x46ff('0x3f')](_0x1a51cc[_0x46ff('0x3e')],{'$or':_[_0x46ff('0x2e')](_0x5f25c1,function(_0x1d0b81){if(_0x1d0b81[_0x46ff('0x31')]!==_0x46ff('0x40')){var _0x46e658={};_0x46e658[_0x1d0b81[_0x46ff('0x2b')]]={'$like':'%'+_0x44262d[_0x46ff('0x34')][_0x46ff('0x41')]+'%'};return _0x46e658;}})});}_0x1a51cc=_['merge']({},_0x1a51cc,_0x44262d[_0x46ff('0x42')]);var _0x2b75d4={'where':_0x1a51cc[_0x46ff('0x3e')]};return db[_0x46ff('0x2f')][_0x46ff('0x20')](_0x2b75d4)['then'](function(_0x1c3a9c){_0x53624a[_0x46ff('0x20')]=_0x1c3a9c;if(_0x44262d[_0x46ff('0x34')]['includeAll']){_0x1a51cc[_0x46ff('0x43')]=[{'all':!![]}];}return db[_0x46ff('0x2f')][_0x46ff('0x44')](_0x1a51cc);})[_0x46ff('0x28')](function(_0xcabcc5){_0x53624a['rows']=_0xcabcc5;return _0x53624a;})[_0x46ff('0x28')](respondWithFilteredResult(_0x4d01f0,_0x1a51cc))[_0x46ff('0x45')](handleError(_0x4d01f0,null));};exports[_0x46ff('0x46')]=function(_0x1c989e,_0x143c4){var _0x8cd512={'raw':!![],'where':{'id':_0x1c989e['params']['id']}},_0x52fac6={};_0x52fac6[_0x46ff('0x33')]=_[_0x46ff('0x47')](db[_0x46ff('0x2f')]['rawAttributes']);_0x52fac6[_0x46ff('0x34')]=_['keys'](_0x1c989e[_0x46ff('0x34')]);_0x52fac6['filters']=_['intersection'](_0x52fac6[_0x46ff('0x33')],_0x52fac6['query']);_0x8cd512[_0x46ff('0x38')]=_[_0x46ff('0x36')](_0x52fac6[_0x46ff('0x33')],qs[_0x46ff('0x37')](_0x1c989e[_0x46ff('0x34')]['fields']));_0x8cd512[_0x46ff('0x38')]=_0x8cd512[_0x46ff('0x38')][_0x46ff('0x39')]?_0x8cd512[_0x46ff('0x38')]:_0x52fac6[_0x46ff('0x33')];if(_0x1c989e[_0x46ff('0x34')][_0x46ff('0x48')]){_0x8cd512[_0x46ff('0x43')]=[{'all':!![]}];}_0x8cd512=_[_0x46ff('0x3f')]({},_0x8cd512,_0x1c989e[_0x46ff('0x42')]);return db['FaxTransferReport']['find'](_0x8cd512)[_0x46ff('0x28')](handleEntityNotFound(_0x143c4,null))[_0x46ff('0x28')](respondWithResult(_0x143c4,null))['catch'](handleError(_0x143c4,null));};exports[_0x46ff('0x49')]=function(_0x2466a7,_0x48209b){return db[_0x46ff('0x2f')]['create'](_0x2466a7[_0x46ff('0x4a')],{})[_0x46ff('0x28')](respondWithResult(_0x48209b,0xc9))['catch'](handleError(_0x48209b,null));};exports[_0x46ff('0x4b')]=function(_0x3d7caf,_0x535b82){if(_0x3d7caf[_0x46ff('0x4a')]['id']){delete _0x3d7caf[_0x46ff('0x4a')]['id'];}return db[_0x46ff('0x2f')][_0x46ff('0x4c')]({'where':{'id':_0x3d7caf[_0x46ff('0x4d')]['id']}})[_0x46ff('0x28')](handleEntityNotFound(_0x535b82,null))[_0x46ff('0x28')](saveUpdates(_0x3d7caf[_0x46ff('0x4a')],null))[_0x46ff('0x28')](respondWithResult(_0x535b82,null))['catch'](handleError(_0x535b82,null));};exports['destroy']=function(_0xdb7e98,_0x144c17){return db[_0x46ff('0x2f')][_0x46ff('0x4c')]({'where':{'id':_0xdb7e98[_0x46ff('0x4d')]['id']}})[_0x46ff('0x28')](handleEntityNotFound(_0x144c17,null))[_0x46ff('0x28')](removeEntity(_0x144c17,null))[_0x46ff('0x45')](handleError(_0x144c17,null));};exports[_0x46ff('0x4e')]=function(_0x578366,_0x5900e9){return db[_0x46ff('0x2f')][_0x46ff('0x4e')]()['then'](respondWithResult(_0x5900e9,null))[_0x46ff('0x45')](handleError(_0x5900e9,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 7a7af1a..9e089da 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 _0x832c=['uniqueid','lodash','util','../../config/logger','api','bluebird','../../config/environment','exports','define','FaxTransferReport','report_fax_transfer'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x832c,0x1e5));var _0xc832=function(_0x321081,_0x202198){_0x321081=_0x321081-0x0;var _0x3ea5c9=_0x832c[_0x321081];return _0x3ea5c9;};'use strict';var _=require(_0xc832('0x0'));var util=require(_0xc832('0x1'));var logger=require(_0xc832('0x2'))(_0xc832('0x3'));var moment=require('moment');var BPromise=require(_0xc832('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc832('0x5'));var attributes=require('./faxTransferReport.attributes');module[_0xc832('0x6')]=function(_0x367089,_0x152a12){return _0x367089[_0xc832('0x7')](_0xc832('0x8'),attributes,{'tableName':_0xc832('0x9'),'paranoid':![],'indexes':[{'name':_0xc832('0xa'),'fields':[_0xc832('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcc87=['../../config/environment','./faxTransferReport.attributes','exports','define','report_fax_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x1a77a2,_0x53c9d3){var _0x37fb2a=function(_0x55f2fd){while(--_0x55f2fd){_0x1a77a2['push'](_0x1a77a2['shift']());}};_0x37fb2a(++_0x53c9d3);}(_0xcc87,0x158));var _0x7cc8=function(_0x51ebcc,_0x13ad19){_0x51ebcc=_0x51ebcc-0x0;var _0x18682b=_0xcc87[_0x51ebcc];return _0x18682b;};'use strict';var _=require(_0x7cc8('0x0'));var util=require('util');var logger=require(_0x7cc8('0x1'))(_0x7cc8('0x2'));var moment=require(_0x7cc8('0x3'));var BPromise=require(_0x7cc8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7cc8('0x5'));var rimraf=require(_0x7cc8('0x6'));var config=require(_0x7cc8('0x7'));var attributes=require(_0x7cc8('0x8'));module[_0x7cc8('0x9')]=function(_0x313018,_0x20452c){return _0x313018[_0x7cc8('0xa')]('FaxTransferReport',attributes,{'tableName':_0x7cc8('0xb'),'paranoid':![],'indexes':[{'name':_0x7cc8('0xc'),'fields':[_0x7cc8('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 0719f2e..7b1dbd4 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 _0xa0f3=['../../config/utils','rpc','../../config/environment','jayson/promise','client','request','FaxTransferReport,\x20%s,\x20%s','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','message','info','request\x20sent','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x284a61,_0x231686){var _0x220e3c=function(_0x104496){while(--_0x104496){_0x284a61['push'](_0x284a61['shift']());}};_0x220e3c(++_0x231686);}(_0xa0f3,0xb6));var _0x3a0f=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa0f3[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0x3a0f('0x0'));var util=require(_0x3a0f('0x1'));var moment=require(_0x3a0f('0x2'));var BPromise=require(_0x3a0f('0x3'));var rs=require(_0x3a0f('0x4'));var fs=require('fs');var Redis=require(_0x3a0f('0x5'));var db=require(_0x3a0f('0x6'))['db'];var utils=require(_0x3a0f('0x7'));var logger=require('../../config/logger')(_0x3a0f('0x8'));var config=require(_0x3a0f('0x9'));var jayson=require(_0x3a0f('0xa'));var client=jayson[_0x3a0f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2aa126,_0x2849ee,_0x24861f){return new BPromise(function(_0x382eec,_0xe43ba9){return client[_0x3a0f('0xc')](_0x2aa126,_0x24861f)['then'](function(_0x1276d2){logger['info'](_0x3a0f('0xd'),_0x2849ee,'request\x20sent');logger[_0x3a0f('0xe')](_0x3a0f('0xf'),_0x2849ee,'request\x20sent',JSON['stringify'](_0x1276d2));if(_0x1276d2[_0x3a0f('0x10')]){if(_0x1276d2[_0x3a0f('0x10')]['code']===0x1f4){logger['error'](_0x3a0f('0xd'),_0x2849ee,_0x1276d2[_0x3a0f('0x10')][_0x3a0f('0x11')]);return _0xe43ba9(_0x1276d2[_0x3a0f('0x10')][_0x3a0f('0x11')]);}logger[_0x3a0f('0x10')](_0x3a0f('0xd'),_0x2849ee,_0x1276d2[_0x3a0f('0x10')]['message']);return _0x382eec(_0x1276d2[_0x3a0f('0x10')][_0x3a0f('0x11')]);}else{logger[_0x3a0f('0x12')](_0x3a0f('0xd'),_0x2849ee,_0x3a0f('0x13'));_0x382eec(_0x1276d2[_0x3a0f('0x14')][_0x3a0f('0x11')]);}})['catch'](function(_0x13d087){logger[_0x3a0f('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x2849ee,_0x13d087);_0xe43ba9(_0x13d087);});});} \ No newline at end of file +var _0x4739=['result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info'];(function(_0x538f52,_0x5a20b5){var _0x2be924=function(_0x45db13){while(--_0x45db13){_0x538f52['push'](_0x538f52['shift']());}};_0x2be924(++_0x5a20b5);}(_0x4739,0xde));var _0x9473=function(_0x14f43b,_0x482b01){_0x14f43b=_0x14f43b-0x0;var _0x36700c=_0x4739[_0x14f43b];return _0x36700c;};'use strict';var _=require(_0x9473('0x0'));var util=require('util');var moment=require(_0x9473('0x1'));var BPromise=require('bluebird');var rs=require(_0x9473('0x2'));var fs=require('fs');var Redis=require(_0x9473('0x3'));var db=require(_0x9473('0x4'))['db'];var utils=require(_0x9473('0x5'));var logger=require(_0x9473('0x6'))('rpc');var config=require(_0x9473('0x7'));var jayson=require(_0x9473('0x8'));var client=jayson[_0x9473('0x9')][_0x9473('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a8f16,_0x18e7a7,_0x43160c){return new BPromise(function(_0x370d55,_0x32b5c5){return client['request'](_0x3a8f16,_0x43160c)['then'](function(_0x374e23){logger['info'](_0x9473('0xb'),_0x18e7a7,_0x9473('0xc'));logger[_0x9473('0xd')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x18e7a7,_0x9473('0xc'),JSON['stringify'](_0x374e23));if(_0x374e23[_0x9473('0xe')]){if(_0x374e23[_0x9473('0xe')][_0x9473('0xf')]===0x1f4){logger[_0x9473('0xe')](_0x9473('0xb'),_0x18e7a7,_0x374e23[_0x9473('0xe')]['message']);return _0x32b5c5(_0x374e23[_0x9473('0xe')][_0x9473('0x10')]);}logger[_0x9473('0xe')](_0x9473('0xb'),_0x18e7a7,_0x374e23[_0x9473('0xe')]['message']);return _0x370d55(_0x374e23['error'][_0x9473('0x10')]);}else{logger[_0x9473('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x18e7a7,_0x9473('0xc'));_0x370d55(_0x374e23[_0x9473('0x12')][_0x9473('0x10')]);}})[_0x9473('0x13')](function(_0x1fb387){logger[_0x9473('0xe')]('FaxTransferReport,\x20%s,\x20%s',_0x18e7a7,_0x1fb387);_0x32b5c5(_0x1fb387);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index c15786f..6dfe1d9 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 _0xabdc=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxTransferReport.controller','isAuthenticated','index','get','/describe','describe','show','post','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3b52b7,_0x284b8e){var _0x2aa6ec=function(_0x253d92){while(--_0x253d92){_0x3b52b7['push'](_0x3b52b7['shift']());}};_0x2aa6ec(++_0x284b8e);}(_0xabdc,0x172));var _0xcabd=function(_0x97996e,_0x5a4477){_0x97996e=_0x97996e-0x0;var _0xc5aec=_0xabdc[_0x97996e];return _0xc5aec;};'use strict';var multer=require(_0xcabd('0x0'));var util=require(_0xcabd('0x1'));var path=require(_0xcabd('0x2'));var timeout=require(_0xcabd('0x3'));var express=require(_0xcabd('0x4'));var router=express[_0xcabd('0x5')]();var fs_extra=require(_0xcabd('0x6'));var auth=require(_0xcabd('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xcabd('0x8'));var controller=require(_0xcabd('0x9'));router['get']('/',auth[_0xcabd('0xa')](),controller[_0xcabd('0xb')]);router[_0xcabd('0xc')](_0xcabd('0xd'),auth[_0xcabd('0xa')](),controller[_0xcabd('0xe')]);router['get']('/:id',auth[_0xcabd('0xa')](),controller[_0xcabd('0xf')]);router[_0xcabd('0x10')]('/',auth[_0xcabd('0xa')](),controller['create']);router['put'](_0xcabd('0x11'),auth[_0xcabd('0xa')](),controller[_0xcabd('0x12')]);router[_0xcabd('0x13')](_0xcabd('0x11'),auth[_0xcabd('0xa')](),controller[_0xcabd('0x14')]);module[_0xcabd('0x15')]=router; \ No newline at end of file +var _0x6e07=['/describe','describe','/:id','show','create','put','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0x6e07,0xd1));var _0x76e0=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x6e07[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x76e0('0x0'));var timeout=require(_0x76e0('0x1'));var express=require(_0x76e0('0x2'));var router=express[_0x76e0('0x3')]();var fs_extra=require(_0x76e0('0x4'));var auth=require(_0x76e0('0x5'));var interaction=require(_0x76e0('0x6'));var config=require(_0x76e0('0x7'));var controller=require('./faxTransferReport.controller');router[_0x76e0('0x8')]('/',auth[_0x76e0('0x9')](),controller[_0x76e0('0xa')]);router[_0x76e0('0x8')](_0x76e0('0xb'),auth['isAuthenticated'](),controller[_0x76e0('0xc')]);router[_0x76e0('0x8')](_0x76e0('0xd'),auth[_0x76e0('0x9')](),controller[_0x76e0('0xe')]);router['post']('/',auth[_0x76e0('0x9')](),controller[_0x76e0('0xf')]);router[_0x76e0('0x10')](_0x76e0('0xd'),auth[_0x76e0('0x9')](),controller['update']);router[_0x76e0('0x11')]('/:id',auth[_0x76e0('0x9')](),controller[_0x76e0('0x12')]);module[_0x76e0('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 01d8815..6eee84f 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 _0xaa50=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','getFields','post','create','/:id/configurations','put','delete','destroy','exports','util','connect-timeout'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xaa50,0x82));var _0x0aa5=function(_0x18d9fc,_0x1f5eb3){_0x18d9fc=_0x18d9fc-0x0;var _0x191f05=_0xaa50[_0x18d9fc];return _0x191f05;};'use strict';var multer=require('multer');var util=require(_0x0aa5('0x0'));var path=require('path');var timeout=require(_0x0aa5('0x1'));var express=require(_0x0aa5('0x2'));var router=express['Router']();var fs_extra=require(_0x0aa5('0x3'));var auth=require(_0x0aa5('0x4'));var interaction=require(_0x0aa5('0x5'));var config=require(_0x0aa5('0x6'));var controller=require(_0x0aa5('0x7'));router[_0x0aa5('0x8')]('/',auth[_0x0aa5('0x9')](),controller[_0x0aa5('0xa')]);router[_0x0aa5('0x8')](_0x0aa5('0xb'),auth[_0x0aa5('0x9')](),controller[_0x0aa5('0xc')]);router[_0x0aa5('0x8')]('/:id/configurations',auth[_0x0aa5('0x9')](),controller[_0x0aa5('0xd')]);router[_0x0aa5('0x8')]('/:id/fields',auth[_0x0aa5('0x9')](),controller[_0x0aa5('0xe')]);router[_0x0aa5('0xf')]('/',auth[_0x0aa5('0x9')](),controller[_0x0aa5('0x10')]);router[_0x0aa5('0xf')](_0x0aa5('0x11'),auth[_0x0aa5('0x9')](),controller['addConfiguration']);router[_0x0aa5('0x12')](_0x0aa5('0xb'),auth[_0x0aa5('0x9')](),controller['update']);router[_0x0aa5('0x13')](_0x0aa5('0xb'),auth[_0x0aa5('0x9')](),controller[_0x0aa5('0x14')]);module[_0x0aa5('0x15')]=router; \ No newline at end of file +var _0x905a=['getFields','post','create','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x5c4e16,_0x113035){var _0x36044a=function(_0xde2f25){while(--_0xde2f25){_0x5c4e16['push'](_0x5c4e16['shift']());}};_0x36044a(++_0x113035);}(_0x905a,0x190));var _0xa905=function(_0x2f5557,_0x58e9a0){_0x2f5557=_0x2f5557-0x0;var _0x30a005=_0x905a[_0x2f5557];return _0x30a005;};'use strict';var multer=require(_0xa905('0x0'));var util=require(_0xa905('0x1'));var path=require(_0xa905('0x2'));var timeout=require('connect-timeout');var express=require(_0xa905('0x3'));var router=express[_0xa905('0x4')]();var fs_extra=require(_0xa905('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa905('0x6'));var config=require(_0xa905('0x7'));var controller=require(_0xa905('0x8'));router[_0xa905('0x9')]('/',auth[_0xa905('0xa')](),controller[_0xa905('0xb')]);router[_0xa905('0x9')]('/:id',auth[_0xa905('0xa')](),controller[_0xa905('0xc')]);router[_0xa905('0x9')](_0xa905('0xd'),auth['isAuthenticated'](),controller[_0xa905('0xe')]);router['get'](_0xa905('0xf'),auth[_0xa905('0xa')](),controller[_0xa905('0x10')]);router[_0xa905('0x11')]('/',auth['isAuthenticated'](),controller[_0xa905('0x12')]);router[_0xa905('0x11')](_0xa905('0xd'),auth[_0xa905('0xa')](),controller[_0xa905('0x13')]);router[_0xa905('0x14')](_0xa905('0x15'),auth[_0xa905('0xa')](),controller[_0xa905('0x16')]);router[_0xa905('0x17')]('/:id',auth['isAuthenticated'](),controller[_0xa905('0x18')]);module[_0xa905('0x19')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index edb462d..74b6895 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 _0xf9ae=['sequelize','STRING','ENUM','basic','integrationTab'];(function(_0x55e5f7,_0x4f3fe9){var _0x1c95eb=function(_0x2728e6){while(--_0x2728e6){_0x55e5f7['push'](_0x55e5f7['shift']());}};_0x1c95eb(++_0x4f3fe9);}(_0xf9ae,0x6e));var _0xef9a=function(_0x5ded8a,_0x10a776){_0x5ded8a=_0x5ded8a-0x0;var _0x1543ee=_0xf9ae[_0x5ded8a];return _0x1543ee;};'use strict';var Sequelize=require(_0xef9a('0x0'));module['exports']={'name':{'type':Sequelize[_0xef9a('0x1')]},'description':{'type':Sequelize[_0xef9a('0x1')]},'username':{'type':Sequelize[_0xef9a('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0xef9a('0x2')](_0xef9a('0x3')),'defaultValue':'basic'},'password':{'type':Sequelize[_0xef9a('0x1')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0xef9a('0x1')]},'serverUrl':{'type':Sequelize[_0xef9a('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab','newTab'),'defaultValue':_0xef9a('0x4')}}; \ No newline at end of file +var _0xa495=['newTab','sequelize','STRING','ENUM','basic','integrationTab'];(function(_0x5f0d51,_0x1301c0){var _0xd63662=function(_0x427b20){while(--_0x427b20){_0x5f0d51['push'](_0x5f0d51['shift']());}};_0xd63662(++_0x1301c0);}(_0xa495,0x16f));var _0x5a49=function(_0x511723,_0x4db8e2){_0x511723=_0x511723-0x0;var _0x25add0=_0xa495[_0x511723];return _0x25add0;};'use strict';var Sequelize=require(_0x5a49('0x0'));module['exports']={'name':{'type':Sequelize[_0x5a49('0x1')]},'description':{'type':Sequelize[_0x5a49('0x1')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0x5a49('0x2')](_0x5a49('0x3')),'defaultValue':_0x5a49('0x3')},'password':{'type':Sequelize[_0x5a49('0x1')]},'consumerKey':{'type':Sequelize[_0x5a49('0x1')]},'consumerSecret':{'type':Sequelize[_0x5a49('0x1')]},'token':{'type':Sequelize[_0x5a49('0x1')]},'tokenSecret':{'type':Sequelize[_0x5a49('0x1')]},'serverUrl':{'type':Sequelize[_0x5a49('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x5a49('0x2')](_0x5a49('0x4'),_0x5a49('0x5')),'defaultValue':_0x5a49('0x4')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 1437823..fee8854 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 _0xbfc5=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','length','find','create','body','params','destroy','findOne','getConfigurations','nolimit','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','channel','DeskConfiguration','DeskField','priority','remoteUri','username','password','consumerKey','consumerSecret','tokenSecret','lastIndexOf','GET','format','%s/custom_fields','application/json','authType','basic','headers','Basic\x20%s','%s:%s','base64','concat','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','rimraf','fast-json-patch','moment','bluebird','mustache','path'];(function(_0x112fa3,_0x5074fa){var _0x442403=function(_0x1490ac){while(--_0x1490ac){_0x112fa3['push'](_0x112fa3['shift']());}};_0x442403(++_0x5074fa);}(_0xbfc5,0x14a));var _0x5bfc=function(_0x3357ca,_0x2da1c8){_0x3357ca=_0x3357ca-0x0;var _0x3b8a14=_0xbfc5[_0x3357ca];return _0x3b8a14;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5bfc('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5bfc('0x1'));var rp=require('request-promise');var moment=require(_0x5bfc('0x2'));var BPromise=require(_0x5bfc('0x3'));var Mustache=require(_0x5bfc('0x4'));var util=require('util');var path=require(_0x5bfc('0x5'));var sox=require(_0x5bfc('0x6'));var csv=require(_0x5bfc('0x7'));var ejs=require(_0x5bfc('0x8'));var fs=require('fs');var fs_extra=require(_0x5bfc('0x9'));var _=require(_0x5bfc('0xa'));var squel=require(_0x5bfc('0xb'));var crypto=require(_0x5bfc('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5bfc('0x7'));var querystring=require(_0x5bfc('0xd'));var Papa=require('papaparse');var Redis=require(_0x5bfc('0xe'));var authService=require(_0x5bfc('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x5bfc('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5bfc('0x11'))(_0x5bfc('0x12'));var utils=require('../../config/utils');var config=require(_0x5bfc('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5bfc('0x14'))['db'];var integrations=require(_0x5bfc('0x15'));function respondWithStatusCode(_0x2bf2c9,_0x21fa09){_0x21fa09=_0x21fa09||0xcc;return function(_0x3145fd){if(_0x3145fd){return _0x2bf2c9[_0x5bfc('0x16')](_0x21fa09);}return _0x2bf2c9[_0x5bfc('0x17')](_0x21fa09)[_0x5bfc('0x18')]();};}function respondWithResult(_0xb5657e,_0xce3875){_0xce3875=_0xce3875||0xc8;return function(_0x2be637){if(_0x2be637){return _0xb5657e[_0x5bfc('0x17')](_0xce3875)[_0x5bfc('0x19')](_0x2be637);}};}function respondWithFilteredResult(_0x25a30c,_0x3ff0b5){return function(_0x4bce36){if(_0x4bce36){var _0x1c3f59=typeof _0x3ff0b5[_0x5bfc('0x1a')]===_0x5bfc('0x1b')&&typeof _0x3ff0b5['limit']==='undefined';var _0x1b9ef2=_0x4bce36[_0x5bfc('0x1c')];var _0x3159b6=_0x1c3f59?0x0:_0x3ff0b5[_0x5bfc('0x1a')];var _0x44079e=_0x1c3f59?_0x4bce36[_0x5bfc('0x1c')]:_0x3ff0b5[_0x5bfc('0x1a')]+_0x3ff0b5[_0x5bfc('0x1d')];var _0x571a38;if(_0x44079e>=_0x1b9ef2){_0x44079e=_0x1b9ef2;_0x571a38=0xc8;}else{_0x571a38=0xce;}_0x25a30c[_0x5bfc('0x17')](_0x571a38);return _0x25a30c[_0x5bfc('0x1e')](_0x5bfc('0x1f'),_0x3159b6+'-'+_0x44079e+'/'+_0x1b9ef2)[_0x5bfc('0x19')](_0x4bce36);}return null;};}function patchUpdates(_0x10aaa9){return function(_0x2f3b40){try{jsonpatch[_0x5bfc('0x20')](_0x2f3b40,_0x10aaa9,!![]);}catch(_0xf211dd){return BPromise[_0x5bfc('0x21')](_0xf211dd);}return _0x2f3b40[_0x5bfc('0x22')]();};}function saveUpdates(_0x2873b5,_0x28d922){return function(_0x1a2f59){if(_0x1a2f59){return _0x1a2f59[_0x5bfc('0x23')](_0x2873b5)['then'](function(_0x1d352a){return _0x1d352a;});}return null;};}function removeEntity(_0x164749,_0x5b6ca8){return function(_0x23127f){if(_0x23127f){return _0x23127f['destroy']()[_0x5bfc('0x24')](function(){_0x164749[_0x5bfc('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50dfd3,_0x2fda11){return function(_0x24e78d){if(!_0x24e78d){_0x50dfd3[_0x5bfc('0x16')](0x194);}return _0x24e78d;};}function handleError(_0x5f19f7,_0x3a68f8){_0x3a68f8=_0x3a68f8||0x1f4;return function(_0x305a37){logger[_0x5bfc('0x25')](_0x305a37[_0x5bfc('0x26')]);if(_0x305a37[_0x5bfc('0x27')]){delete _0x305a37['name'];}_0x5f19f7[_0x5bfc('0x17')](_0x3a68f8)[_0x5bfc('0x28')](_0x305a37);};}exports[_0x5bfc('0x29')]=function(_0x4bc21d,_0x52830b){var _0x2230f2={},_0x4e92b4={},_0x209a25={'count':0x0,'rows':[]};var _0x51fa8e=_[_0x5bfc('0x2a')](db[_0x5bfc('0x2b')][_0x5bfc('0x2c')],function(_0x4b8802){return{'name':_0x4b8802[_0x5bfc('0x2d')],'type':_0x4b8802[_0x5bfc('0x2e')][_0x5bfc('0x2f')]};});_0x4e92b4['model']=_[_0x5bfc('0x2a')](_0x51fa8e,_0x5bfc('0x27'));_0x4e92b4[_0x5bfc('0x30')]=_[_0x5bfc('0x31')](_0x4bc21d[_0x5bfc('0x30')]);_0x4e92b4['filters']=_[_0x5bfc('0x32')](_0x4e92b4[_0x5bfc('0x33')],_0x4e92b4[_0x5bfc('0x30')]);_0x2230f2[_0x5bfc('0x34')]=_[_0x5bfc('0x32')](_0x4e92b4['model'],qs['fields'](_0x4bc21d[_0x5bfc('0x30')][_0x5bfc('0x35')]));_0x2230f2[_0x5bfc('0x34')]=_0x2230f2[_0x5bfc('0x34')]['length']?_0x2230f2['attributes']:_0x4e92b4[_0x5bfc('0x33')];if(!_0x4bc21d[_0x5bfc('0x30')][_0x5bfc('0x36')]('nolimit')){_0x2230f2['limit']=qs[_0x5bfc('0x1d')](_0x4bc21d[_0x5bfc('0x30')][_0x5bfc('0x1d')]);_0x2230f2['offset']=qs['offset'](_0x4bc21d[_0x5bfc('0x30')][_0x5bfc('0x1a')]);}_0x2230f2['order']=qs[_0x5bfc('0x37')](_0x4bc21d[_0x5bfc('0x30')]['sort']);_0x2230f2[_0x5bfc('0x38')]=qs[_0x5bfc('0x39')](_[_0x5bfc('0x3a')](_0x4bc21d[_0x5bfc('0x30')],_0x4e92b4[_0x5bfc('0x39')]),_0x51fa8e);if(_0x4bc21d['query'][_0x5bfc('0x3b')]){_0x2230f2[_0x5bfc('0x38')]=_['merge'](_0x2230f2[_0x5bfc('0x38')],{'$or':_[_0x5bfc('0x2a')](_0x51fa8e,function(_0x338ead){if(_0x338ead[_0x5bfc('0x2e')]!==_0x5bfc('0x3c')){var _0x45d90a={};_0x45d90a[_0x338ead[_0x5bfc('0x27')]]={'$like':'%'+_0x4bc21d[_0x5bfc('0x30')][_0x5bfc('0x3b')]+'%'};return _0x45d90a;}})});}_0x2230f2=_[_0x5bfc('0x3d')]({},_0x2230f2,_0x4bc21d[_0x5bfc('0x3e')]);var _0x27e2ed={'where':_0x2230f2['where']};return db['DeskAccount'][_0x5bfc('0x1c')](_0x27e2ed)[_0x5bfc('0x24')](function(_0x28fab2){_0x209a25[_0x5bfc('0x1c')]=_0x28fab2;if(_0x4bc21d[_0x5bfc('0x30')][_0x5bfc('0x3f')]){_0x2230f2[_0x5bfc('0x40')]=[{'all':!![]}];}return db[_0x5bfc('0x2b')][_0x5bfc('0x41')](_0x2230f2);})[_0x5bfc('0x24')](function(_0x4aeff3){_0x209a25['rows']=_0x4aeff3;return _0x209a25;})[_0x5bfc('0x24')](respondWithFilteredResult(_0x52830b,_0x2230f2))[_0x5bfc('0x42')](handleError(_0x52830b,null));};exports[_0x5bfc('0x43')]=function(_0x14c68b,_0x172a3f){var _0xd5f775={'raw':![],'where':{'id':_0x14c68b['params']['id']}},_0x1e5033={};_0x1e5033[_0x5bfc('0x33')]=_[_0x5bfc('0x31')](db[_0x5bfc('0x2b')]['rawAttributes']);_0x1e5033[_0x5bfc('0x30')]=_[_0x5bfc('0x31')](_0x14c68b[_0x5bfc('0x30')]);_0x1e5033[_0x5bfc('0x39')]=_['intersection'](_0x1e5033['model'],_0x1e5033[_0x5bfc('0x30')]);_0xd5f775[_0x5bfc('0x34')]=_[_0x5bfc('0x32')](_0x1e5033[_0x5bfc('0x33')],qs[_0x5bfc('0x35')](_0x14c68b[_0x5bfc('0x30')][_0x5bfc('0x35')]));_0xd5f775[_0x5bfc('0x34')]=_0xd5f775[_0x5bfc('0x34')][_0x5bfc('0x44')]?_0xd5f775[_0x5bfc('0x34')]:_0x1e5033[_0x5bfc('0x33')];if(_0x14c68b[_0x5bfc('0x30')][_0x5bfc('0x3f')]){_0xd5f775['include']=[{'all':!![]}];}_0xd5f775=_[_0x5bfc('0x3d')]({},_0xd5f775,_0x14c68b[_0x5bfc('0x3e')]);return db[_0x5bfc('0x2b')][_0x5bfc('0x45')](_0xd5f775)[_0x5bfc('0x24')](handleEntityNotFound(_0x172a3f,null))['then'](respondWithResult(_0x172a3f,null))[_0x5bfc('0x42')](handleError(_0x172a3f,null));};exports[_0x5bfc('0x46')]=function(_0x1165ea,_0x54dd2b){return db[_0x5bfc('0x2b')][_0x5bfc('0x46')](_0x1165ea['body'],{})[_0x5bfc('0x24')](respondWithResult(_0x54dd2b,0xc9))[_0x5bfc('0x42')](handleError(_0x54dd2b,null));};exports['update']=function(_0x184ea9,_0x1d6d42){if(_0x184ea9[_0x5bfc('0x47')]['id']){delete _0x184ea9[_0x5bfc('0x47')]['id'];}return db[_0x5bfc('0x2b')]['find']({'where':{'id':_0x184ea9[_0x5bfc('0x48')]['id']}})[_0x5bfc('0x24')](handleEntityNotFound(_0x1d6d42,null))[_0x5bfc('0x24')](saveUpdates(_0x184ea9[_0x5bfc('0x47')],null))['then'](respondWithResult(_0x1d6d42,null))[_0x5bfc('0x42')](handleError(_0x1d6d42,null));};exports[_0x5bfc('0x49')]=function(_0x2fbf57,_0x510e37){return db[_0x5bfc('0x2b')]['find']({'where':{'id':_0x2fbf57[_0x5bfc('0x48')]['id']}})['then'](handleEntityNotFound(_0x510e37,null))[_0x5bfc('0x24')](removeEntity(_0x510e37,null))[_0x5bfc('0x42')](handleError(_0x510e37,null));};exports['getConfigurations']=function(_0x4bedcf,_0x3a9e5b,_0x1a87ed){var _0x3df03a={};var _0x53c04e={};var _0x3fd63a;var _0x51a68c;return db[_0x5bfc('0x2b')][_0x5bfc('0x4a')]({'where':{'id':_0x4bedcf[_0x5bfc('0x48')]['id']}})['then'](handleEntityNotFound(_0x3a9e5b,null))[_0x5bfc('0x24')](function(_0x52b37a){if(_0x52b37a){_0x3fd63a=_0x52b37a;_0x53c04e['model']=_[_0x5bfc('0x31')](db['DeskConfiguration'][_0x5bfc('0x2c')]);_0x53c04e[_0x5bfc('0x30')]=_[_0x5bfc('0x31')](_0x4bedcf[_0x5bfc('0x30')]);_0x53c04e['filters']=_[_0x5bfc('0x32')](_0x53c04e['model'],_0x53c04e[_0x5bfc('0x30')]);_0x3df03a[_0x5bfc('0x34')]=_[_0x5bfc('0x32')](_0x53c04e[_0x5bfc('0x33')],qs[_0x5bfc('0x35')](_0x4bedcf[_0x5bfc('0x30')]['fields']));_0x3df03a['attributes']=_0x3df03a[_0x5bfc('0x34')][_0x5bfc('0x44')]?_0x3df03a[_0x5bfc('0x34')]:_0x53c04e[_0x5bfc('0x33')];_0x3df03a['order']=qs['sort'](_0x4bedcf[_0x5bfc('0x30')]['sort']);_0x3df03a['where']=qs[_0x5bfc('0x39')](_['pick'](_0x4bedcf[_0x5bfc('0x30')],_0x53c04e[_0x5bfc('0x39')]));if(_0x4bedcf[_0x5bfc('0x30')][_0x5bfc('0x3b')]){_0x3df03a['where']=_['merge'](_0x3df03a[_0x5bfc('0x38')],{'$or':_[_0x5bfc('0x2a')](_0x3df03a[_0x5bfc('0x34')],function(_0x188919){var _0x357a5d={};_0x357a5d[_0x188919]={'$like':'%'+_0x4bedcf[_0x5bfc('0x30')][_0x5bfc('0x3b')]+'%'};return _0x357a5d;})});}_0x3df03a=_['merge']({},_0x3df03a,_0x4bedcf[_0x5bfc('0x3e')]);return _0x3fd63a[_0x5bfc('0x4b')](_0x3df03a);}})[_0x5bfc('0x24')](function(_0x118d19){if(_0x118d19){_0x51a68c=_0x118d19[_0x5bfc('0x44')];if(!_0x4bedcf[_0x5bfc('0x30')][_0x5bfc('0x36')](_0x5bfc('0x4c'))){_0x3df03a[_0x5bfc('0x1d')]=qs[_0x5bfc('0x1d')](_0x4bedcf['query']['limit']);_0x3df03a['offset']=qs['offset'](_0x4bedcf[_0x5bfc('0x30')]['offset']);}return _0x3fd63a[_0x5bfc('0x4b')](_0x3df03a);}})[_0x5bfc('0x24')](function(_0x314933){if(_0x314933){return _0x314933?{'count':_0x51a68c,'rows':_0x314933}:null;}})[_0x5bfc('0x24')](respondWithResult(_0x3a9e5b,null))[_0x5bfc('0x42')](handleError(_0x3a9e5b,null));};exports[_0x5bfc('0x4d')]=function(_0x24a536,_0x800195,_0x28539f){if(_0x24a536[_0x5bfc('0x47')]['id']){delete _0x24a536[_0x5bfc('0x47')]['id'];}return db[_0x5bfc('0x2b')][_0x5bfc('0x4a')]({'where':{'id':_0x24a536[_0x5bfc('0x48')]['id']}})['then'](handleEntityNotFound(_0x800195,null))['then'](function(_0x857ddb){if(_0x857ddb){_0x24a536[_0x5bfc('0x47')][_0x5bfc('0x4e')]=_0x857ddb['id'];_0x24a536[_0x5bfc('0x47')][_0x5bfc('0x4f')]=integrations[_0x5bfc('0x50')](_0x24a536['body']['channel'],_0x24a536[_0x5bfc('0x47')][_0x5bfc('0x2e')]);_0x24a536[_0x5bfc('0x47')][_0x5bfc('0x51')]=integrations['getDescriptions'](_0x24a536['body'][_0x5bfc('0x52')],_0x24a536[_0x5bfc('0x47')][_0x5bfc('0x2e')]);return db[_0x5bfc('0x53')]['create'](_0x24a536['body'],{'include':[{'model':db['DeskField'],'as':'Subjects'},{'model':db[_0x5bfc('0x54')],'as':_0x5bfc('0x51')}]});}return null;})[_0x5bfc('0x24')](respondWithResult(_0x800195,null))[_0x5bfc('0x42')](handleError(_0x800195,null));};exports['getFields']=function(_0x326132,_0x4b0e63,_0x5cec23){var _0x3c022f=[{'name':_0x5bfc('0x55'),'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 _0x35ffa5='';return db[_0x5bfc('0x2b')]['findOne']({'where':{'id':_0x326132[_0x5bfc('0x48')]['id']},'attributes':['id',_0x5bfc('0x56'),'authType',_0x5bfc('0x57'),_0x5bfc('0x58'),_0x5bfc('0x59'),_0x5bfc('0x5a'),'token',_0x5bfc('0x5b')]})[_0x5bfc('0x24')](handleEntityNotFound(_0x4b0e63,null))[_0x5bfc('0x24')](function(_0x4c9910){if(_0x4c9910){_0x35ffa5=_0x4c9910[_0x5bfc('0x56')];var _0x33b5d0=_0x35ffa5['slice'](-0x1);if(_0x33b5d0==='/'){_0x35ffa5=_0x35ffa5['substring'](0x0,_0x35ffa5[_0x5bfc('0x5c')](_0x33b5d0));}var _0xc5d848={'method':_0x5bfc('0x5d'),'uri':util[_0x5bfc('0x5e')](_0x5bfc('0x5f'),_0x35ffa5),'headers':{'Content-Type':_0x5bfc('0x60'),'Accept':_0x5bfc('0x60')},'json':!![]};if(_0x4c9910[_0x5bfc('0x61')]===_0x5bfc('0x62')){_0xc5d848[_0x5bfc('0x63')]['Authorization']=util[_0x5bfc('0x5e')](_0x5bfc('0x64'),new Buffer(util[_0x5bfc('0x5e')](_0x5bfc('0x65'),_0x4c9910[_0x5bfc('0x57')],_0x4c9910[_0x5bfc('0x58')]))['toString'](_0x5bfc('0x66')));}return rp(_0xc5d848)[_0x5bfc('0x24')](function(_0x13b8ee){return _0x3c022f[_0x5bfc('0x67')](_[_0x5bfc('0x2a')](_0x13b8ee['_embedded']['entries'],function(_0x10ff45){return{'id':_0x10ff45[_0x5bfc('0x27')],'name':_0x10ff45[_0x5bfc('0x27')],'type':_0x10ff45[_0x5bfc('0x2e')],'active':_0x10ff45[_0x5bfc('0x68')],'label':_0x10ff45[_0x5bfc('0x69')],'custom':!![]};}));});}})[_0x5bfc('0x24')](function(_0x1ce03b){return{'count':_0x1ce03b[_0x5bfc('0x44')],'rows':_0x1ce03b};})['then'](respondWithResult(_0x4b0e63,null))[_0x5bfc('0x42')](function(_0x26f03e){var _0x3a8474=_0x326132[_0x5bfc('0x30')][_0x5bfc('0x6a')]?0x1f4:_0x26f03e[_0x5bfc('0x6b')]||0x1f4;logger[_0x5bfc('0x25')](_0x5bfc('0x6c'),_0x5bfc('0x6d'),_0x3a8474,JSON[_0x5bfc('0x6e')](_0x26f03e));delete _0x26f03e[_0x5bfc('0x27')];if(_0x3a8474===0x191){_0x3a8474=0x190;}_0x4b0e63[_0x5bfc('0x17')](_0x3a8474)[_0x5bfc('0x28')](_0x326132['query'][_0x5bfc('0x6a')]?{'message':_0x5bfc('0x6f'),'statusCode':_0x26f03e[_0x5bfc('0x6b')]}:_0x26f03e);});}; \ No newline at end of file +var _0x1a06=['find','create','body','catch','destroy','findOne','DeskConfiguration','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','channel','DeskField','getFields','priority','password','tokenSecret','substring','GET','application/json','authType','basic','headers','Authorization','format','Basic\x20%s','%s:%s','username','toString','base64','concat','entries','active','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','end','error','send','index','DeskAccount','rawAttributes','type','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','params'];(function(_0x28939f,_0x5c9abe){var _0x366f16=function(_0x207ebd){while(--_0x207ebd){_0x28939f['push'](_0x28939f['shift']());}};_0x366f16(++_0x5c9abe);}(_0x1a06,0x94));var _0x61a0=function(_0x169c01,_0x59f28d){_0x169c01=_0x169c01-0x0;var _0x2c3be4=_0x1a06[_0x169c01];return _0x2c3be4;};'use strict';var emlformat=require(_0x61a0('0x0'));var rimraf=require(_0x61a0('0x1'));var zipdir=require(_0x61a0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x61a0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x61a0('0x4'));var util=require(_0x61a0('0x5'));var path=require('path');var sox=require(_0x61a0('0x6'));var csv=require(_0x61a0('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x61a0('0x8'));var squel=require('squel');var crypto=require(_0x61a0('0x9'));var jsforce=require(_0x61a0('0xa'));var deskjs=require(_0x61a0('0xb'));var toCsv=require('to-csv');var querystring=require(_0x61a0('0xc'));var Papa=require(_0x61a0('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x61a0('0xe'));var as=require(_0x61a0('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x61a0('0x10'))(_0x61a0('0x11'));var utils=require(_0x61a0('0x12'));var config=require(_0x61a0('0x13'));var licenseUtil=require(_0x61a0('0x14'));var db=require(_0x61a0('0x15'))['db'];var integrations=require(_0x61a0('0x16'));function respondWithStatusCode(_0x46bb17,_0x2743c){_0x2743c=_0x2743c||0xcc;return function(_0x4e14c7){if(_0x4e14c7){return _0x46bb17[_0x61a0('0x17')](_0x2743c);}return _0x46bb17[_0x61a0('0x18')](_0x2743c)['end']();};}function respondWithResult(_0x19afe5,_0x185237){_0x185237=_0x185237||0xc8;return function(_0x48e12d){if(_0x48e12d){return _0x19afe5[_0x61a0('0x18')](_0x185237)[_0x61a0('0x19')](_0x48e12d);}};}function respondWithFilteredResult(_0x4f7d99,_0x8d4fd6){return function(_0x211a45){if(_0x211a45){var _0xc7a751=typeof _0x8d4fd6[_0x61a0('0x1a')]===_0x61a0('0x1b')&&typeof _0x8d4fd6[_0x61a0('0x1c')]==='undefined';var _0x1115fd=_0x211a45['count'];var _0x1cb811=_0xc7a751?0x0:_0x8d4fd6[_0x61a0('0x1a')];var _0xddad5=_0xc7a751?_0x211a45[_0x61a0('0x1d')]:_0x8d4fd6[_0x61a0('0x1a')]+_0x8d4fd6[_0x61a0('0x1c')];var _0x233354;if(_0xddad5>=_0x1115fd){_0xddad5=_0x1115fd;_0x233354=0xc8;}else{_0x233354=0xce;}_0x4f7d99[_0x61a0('0x18')](_0x233354);return _0x4f7d99[_0x61a0('0x1e')]('Content-Range',_0x1cb811+'-'+_0xddad5+'/'+_0x1115fd)[_0x61a0('0x19')](_0x211a45);}return null;};}function patchUpdates(_0x63c5d2){return function(_0x3b0e95){try{jsonpatch[_0x61a0('0x1f')](_0x3b0e95,_0x63c5d2,!![]);}catch(_0x3521c1){return BPromise[_0x61a0('0x20')](_0x3521c1);}return _0x3b0e95[_0x61a0('0x21')]();};}function saveUpdates(_0x1ca7ab,_0x11926f){return function(_0x15a072){if(_0x15a072){return _0x15a072[_0x61a0('0x22')](_0x1ca7ab)[_0x61a0('0x23')](function(_0x216fda){return _0x216fda;});}return null;};}function removeEntity(_0x3d3a58,_0x22a0cb){return function(_0x5d9cab){if(_0x5d9cab){return _0x5d9cab['destroy']()[_0x61a0('0x23')](function(){_0x3d3a58[_0x61a0('0x18')](0xcc)[_0x61a0('0x24')]();});}};}function handleEntityNotFound(_0x382168,_0x443ee8){return function(_0x436567){if(!_0x436567){_0x382168[_0x61a0('0x17')](0x194);}return _0x436567;};}function handleError(_0x2dc673,_0x29e095){_0x29e095=_0x29e095||0x1f4;return function(_0x1dfa92){logger[_0x61a0('0x25')](_0x1dfa92['stack']);if(_0x1dfa92['name']){delete _0x1dfa92['name'];}_0x2dc673[_0x61a0('0x18')](_0x29e095)[_0x61a0('0x26')](_0x1dfa92);};}exports[_0x61a0('0x27')]=function(_0x228618,_0x2fd1d1){var _0x5466d9={},_0x20d347={},_0xb3ace={'count':0x0,'rows':[]};var _0x3dc02e=_['map'](db[_0x61a0('0x28')][_0x61a0('0x29')],function(_0x340b40){return{'name':_0x340b40['fieldName'],'type':_0x340b40[_0x61a0('0x2a')][_0x61a0('0x2b')]};});_0x20d347[_0x61a0('0x2c')]=_[_0x61a0('0x2d')](_0x3dc02e,_0x61a0('0x2e'));_0x20d347[_0x61a0('0x2f')]=_[_0x61a0('0x30')](_0x228618[_0x61a0('0x2f')]);_0x20d347[_0x61a0('0x31')]=_[_0x61a0('0x32')](_0x20d347['model'],_0x20d347['query']);_0x5466d9[_0x61a0('0x33')]=_[_0x61a0('0x32')](_0x20d347[_0x61a0('0x2c')],qs[_0x61a0('0x34')](_0x228618[_0x61a0('0x2f')][_0x61a0('0x34')]));_0x5466d9['attributes']=_0x5466d9[_0x61a0('0x33')][_0x61a0('0x35')]?_0x5466d9['attributes']:_0x20d347[_0x61a0('0x2c')];if(!_0x228618[_0x61a0('0x2f')]['hasOwnProperty']('nolimit')){_0x5466d9[_0x61a0('0x1c')]=qs[_0x61a0('0x1c')](_0x228618[_0x61a0('0x2f')][_0x61a0('0x1c')]);_0x5466d9[_0x61a0('0x1a')]=qs['offset'](_0x228618[_0x61a0('0x2f')][_0x61a0('0x1a')]);}_0x5466d9[_0x61a0('0x36')]=qs[_0x61a0('0x37')](_0x228618[_0x61a0('0x2f')][_0x61a0('0x37')]);_0x5466d9['where']=qs[_0x61a0('0x31')](_[_0x61a0('0x38')](_0x228618[_0x61a0('0x2f')],_0x20d347[_0x61a0('0x31')]),_0x3dc02e);if(_0x228618[_0x61a0('0x2f')][_0x61a0('0x39')]){_0x5466d9[_0x61a0('0x3a')]=_[_0x61a0('0x3b')](_0x5466d9[_0x61a0('0x3a')],{'$or':_[_0x61a0('0x2d')](_0x3dc02e,function(_0x1750bd){if(_0x1750bd['type']!=='VIRTUAL'){var _0x146b5d={};_0x146b5d[_0x1750bd[_0x61a0('0x2e')]]={'$like':'%'+_0x228618[_0x61a0('0x2f')][_0x61a0('0x39')]+'%'};return _0x146b5d;}})});}_0x5466d9=_[_0x61a0('0x3b')]({},_0x5466d9,_0x228618[_0x61a0('0x3c')]);var _0x20aa10={'where':_0x5466d9['where']};return db['DeskAccount'][_0x61a0('0x1d')](_0x20aa10)[_0x61a0('0x23')](function(_0xa488ec){_0xb3ace['count']=_0xa488ec;if(_0x228618[_0x61a0('0x2f')][_0x61a0('0x3d')]){_0x5466d9[_0x61a0('0x3e')]=[{'all':!![]}];}return db[_0x61a0('0x28')][_0x61a0('0x3f')](_0x5466d9);})[_0x61a0('0x23')](function(_0x569419){_0xb3ace[_0x61a0('0x40')]=_0x569419;return _0xb3ace;})['then'](respondWithFilteredResult(_0x2fd1d1,_0x5466d9))['catch'](handleError(_0x2fd1d1,null));};exports['show']=function(_0x422971,_0x44be71){var _0x1fe795={'raw':![],'where':{'id':_0x422971[_0x61a0('0x41')]['id']}},_0x1b5b86={};_0x1b5b86[_0x61a0('0x2c')]=_['keys'](db['DeskAccount'][_0x61a0('0x29')]);_0x1b5b86[_0x61a0('0x2f')]=_[_0x61a0('0x30')](_0x422971[_0x61a0('0x2f')]);_0x1b5b86[_0x61a0('0x31')]=_[_0x61a0('0x32')](_0x1b5b86['model'],_0x1b5b86[_0x61a0('0x2f')]);_0x1fe795['attributes']=_[_0x61a0('0x32')](_0x1b5b86[_0x61a0('0x2c')],qs[_0x61a0('0x34')](_0x422971['query'][_0x61a0('0x34')]));_0x1fe795[_0x61a0('0x33')]=_0x1fe795[_0x61a0('0x33')][_0x61a0('0x35')]?_0x1fe795[_0x61a0('0x33')]:_0x1b5b86[_0x61a0('0x2c')];if(_0x422971['query'][_0x61a0('0x3d')]){_0x1fe795[_0x61a0('0x3e')]=[{'all':!![]}];}_0x1fe795=_['merge']({},_0x1fe795,_0x422971['options']);return db[_0x61a0('0x28')][_0x61a0('0x42')](_0x1fe795)[_0x61a0('0x23')](handleEntityNotFound(_0x44be71,null))[_0x61a0('0x23')](respondWithResult(_0x44be71,null))['catch'](handleError(_0x44be71,null));};exports[_0x61a0('0x43')]=function(_0x49ab13,_0x1cc372){return db[_0x61a0('0x28')][_0x61a0('0x43')](_0x49ab13[_0x61a0('0x44')],{})[_0x61a0('0x23')](respondWithResult(_0x1cc372,0xc9))['catch'](handleError(_0x1cc372,null));};exports[_0x61a0('0x22')]=function(_0x52335c,_0x4a5f9c){if(_0x52335c[_0x61a0('0x44')]['id']){delete _0x52335c['body']['id'];}return db['DeskAccount'][_0x61a0('0x42')]({'where':{'id':_0x52335c[_0x61a0('0x41')]['id']}})[_0x61a0('0x23')](handleEntityNotFound(_0x4a5f9c,null))['then'](saveUpdates(_0x52335c[_0x61a0('0x44')],null))[_0x61a0('0x23')](respondWithResult(_0x4a5f9c,null))[_0x61a0('0x45')](handleError(_0x4a5f9c,null));};exports[_0x61a0('0x46')]=function(_0x369b6c,_0x43bdc1){return db[_0x61a0('0x28')][_0x61a0('0x42')]({'where':{'id':_0x369b6c[_0x61a0('0x41')]['id']}})['then'](handleEntityNotFound(_0x43bdc1,null))[_0x61a0('0x23')](removeEntity(_0x43bdc1,null))[_0x61a0('0x45')](handleError(_0x43bdc1,null));};exports['getConfigurations']=function(_0x1634ff,_0x41ad5d,_0x281b0f){var _0x262bf2={};var _0x4a35f1={};var _0x413292;var _0x196943;return db[_0x61a0('0x28')][_0x61a0('0x47')]({'where':{'id':_0x1634ff[_0x61a0('0x41')]['id']}})[_0x61a0('0x23')](handleEntityNotFound(_0x41ad5d,null))[_0x61a0('0x23')](function(_0x5f1942){if(_0x5f1942){_0x413292=_0x5f1942;_0x4a35f1[_0x61a0('0x2c')]=_[_0x61a0('0x30')](db[_0x61a0('0x48')]['rawAttributes']);_0x4a35f1[_0x61a0('0x2f')]=_[_0x61a0('0x30')](_0x1634ff[_0x61a0('0x2f')]);_0x4a35f1['filters']=_['intersection'](_0x4a35f1[_0x61a0('0x2c')],_0x4a35f1[_0x61a0('0x2f')]);_0x262bf2[_0x61a0('0x33')]=_['intersection'](_0x4a35f1[_0x61a0('0x2c')],qs[_0x61a0('0x34')](_0x1634ff[_0x61a0('0x2f')][_0x61a0('0x34')]));_0x262bf2[_0x61a0('0x33')]=_0x262bf2['attributes'][_0x61a0('0x35')]?_0x262bf2[_0x61a0('0x33')]:_0x4a35f1[_0x61a0('0x2c')];_0x262bf2[_0x61a0('0x36')]=qs[_0x61a0('0x37')](_0x1634ff[_0x61a0('0x2f')]['sort']);_0x262bf2[_0x61a0('0x3a')]=qs[_0x61a0('0x31')](_[_0x61a0('0x38')](_0x1634ff[_0x61a0('0x2f')],_0x4a35f1[_0x61a0('0x31')]));if(_0x1634ff[_0x61a0('0x2f')]['filter']){_0x262bf2[_0x61a0('0x3a')]=_[_0x61a0('0x3b')](_0x262bf2[_0x61a0('0x3a')],{'$or':_[_0x61a0('0x2d')](_0x262bf2['attributes'],function(_0x3a7157){var _0x1a6062={};_0x1a6062[_0x3a7157]={'$like':'%'+_0x1634ff[_0x61a0('0x2f')][_0x61a0('0x39')]+'%'};return _0x1a6062;})});}_0x262bf2=_[_0x61a0('0x3b')]({},_0x262bf2,_0x1634ff['options']);return _0x413292['getConfigurations'](_0x262bf2);}})[_0x61a0('0x23')](function(_0x33f128){if(_0x33f128){_0x196943=_0x33f128[_0x61a0('0x35')];if(!_0x1634ff['query'][_0x61a0('0x49')](_0x61a0('0x4a'))){_0x262bf2[_0x61a0('0x1c')]=qs['limit'](_0x1634ff[_0x61a0('0x2f')][_0x61a0('0x1c')]);_0x262bf2[_0x61a0('0x1a')]=qs[_0x61a0('0x1a')](_0x1634ff[_0x61a0('0x2f')][_0x61a0('0x1a')]);}return _0x413292['getConfigurations'](_0x262bf2);}})['then'](function(_0x3983f8){if(_0x3983f8){return _0x3983f8?{'count':_0x196943,'rows':_0x3983f8}:null;}})[_0x61a0('0x23')](respondWithResult(_0x41ad5d,null))['catch'](handleError(_0x41ad5d,null));};exports[_0x61a0('0x4b')]=function(_0x4e0cb5,_0x2c6220,_0x5a4181){if(_0x4e0cb5[_0x61a0('0x44')]['id']){delete _0x4e0cb5[_0x61a0('0x44')]['id'];}return db[_0x61a0('0x28')]['findOne']({'where':{'id':_0x4e0cb5[_0x61a0('0x41')]['id']}})['then'](handleEntityNotFound(_0x2c6220,null))[_0x61a0('0x23')](function(_0x5b56ad){if(_0x5b56ad){_0x4e0cb5[_0x61a0('0x44')][_0x61a0('0x4c')]=_0x5b56ad['id'];_0x4e0cb5[_0x61a0('0x44')][_0x61a0('0x4d')]=integrations[_0x61a0('0x4e')](_0x4e0cb5[_0x61a0('0x44')]['channel'],_0x4e0cb5[_0x61a0('0x44')][_0x61a0('0x2a')]);_0x4e0cb5['body'][_0x61a0('0x4f')]=integrations['getDescriptions'](_0x4e0cb5[_0x61a0('0x44')][_0x61a0('0x50')],_0x4e0cb5[_0x61a0('0x44')]['type']);return db[_0x61a0('0x48')][_0x61a0('0x43')](_0x4e0cb5[_0x61a0('0x44')],{'include':[{'model':db['DeskField'],'as':_0x61a0('0x4d')},{'model':db[_0x61a0('0x51')],'as':_0x61a0('0x4f')}]});}return null;})[_0x61a0('0x23')](respondWithResult(_0x2c6220,null))[_0x61a0('0x45')](handleError(_0x2c6220,null));};exports[_0x61a0('0x52')]=function(_0x330a46,_0x51c49e,_0xc955fc){var _0x38c194=[{'name':_0x61a0('0x53'),'label':_0x61a0('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 _0x1657e1='';return db[_0x61a0('0x28')][_0x61a0('0x47')]({'where':{'id':_0x330a46['params']['id']},'attributes':['id','remoteUri','authType','username',_0x61a0('0x54'),'consumerKey','consumerSecret','token',_0x61a0('0x55')]})[_0x61a0('0x23')](handleEntityNotFound(_0x51c49e,null))[_0x61a0('0x23')](function(_0x99a756){if(_0x99a756){_0x1657e1=_0x99a756['remoteUri'];var _0xe329cc=_0x1657e1['slice'](-0x1);if(_0xe329cc==='/'){_0x1657e1=_0x1657e1[_0x61a0('0x56')](0x0,_0x1657e1['lastIndexOf'](_0xe329cc));}var _0x2cc49e={'method':_0x61a0('0x57'),'uri':util['format']('%s/custom_fields',_0x1657e1),'headers':{'Content-Type':_0x61a0('0x58'),'Accept':_0x61a0('0x58')},'json':!![]};if(_0x99a756[_0x61a0('0x59')]===_0x61a0('0x5a')){_0x2cc49e[_0x61a0('0x5b')][_0x61a0('0x5c')]=util[_0x61a0('0x5d')](_0x61a0('0x5e'),new Buffer(util['format'](_0x61a0('0x5f'),_0x99a756[_0x61a0('0x60')],_0x99a756[_0x61a0('0x54')]))[_0x61a0('0x61')](_0x61a0('0x62')));}return rp(_0x2cc49e)[_0x61a0('0x23')](function(_0x25553c){return _0x38c194[_0x61a0('0x63')](_[_0x61a0('0x2d')](_0x25553c['_embedded'][_0x61a0('0x64')],function(_0x5b37d7){return{'id':_0x5b37d7[_0x61a0('0x2e')],'name':_0x5b37d7[_0x61a0('0x2e')],'type':_0x5b37d7['type'],'active':_0x5b37d7[_0x61a0('0x65')],'label':_0x5b37d7['label'],'custom':!![]};}));});}})[_0x61a0('0x23')](function(_0x49841d){return{'count':_0x49841d[_0x61a0('0x35')],'rows':_0x49841d};})[_0x61a0('0x23')](respondWithResult(_0x51c49e,null))[_0x61a0('0x45')](function(_0x1d4125){var _0x249667=_0x330a46['query'][_0x61a0('0x66')]?0x1f4:_0x1d4125[_0x61a0('0x67')]||0x1f4;logger[_0x61a0('0x25')](_0x61a0('0x68'),_0x61a0('0x52'),_0x249667,JSON[_0x61a0('0x69')](_0x1d4125));delete _0x1d4125['name'];if(_0x249667===0x191){_0x249667=0x190;}_0x51c49e[_0x61a0('0x18')](_0x249667)[_0x61a0('0x26')](_0x330a46['query']['test']?{'message':_0x61a0('0x6a'),'statusCode':_0x1d4125[_0x61a0('0x67')]}:_0x1d4125);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 88ec861..56d953a 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 _0x16e3=['define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intDeskAccount.attributes'];(function(_0x1389fc,_0x11fd70){var _0x2c9f03=function(_0x28818b){while(--_0x28818b){_0x1389fc['push'](_0x1389fc['shift']());}};_0x2c9f03(++_0x11fd70);}(_0x16e3,0x18f));var _0x316e=function(_0x102d5f,_0x457a7d){_0x102d5f=_0x102d5f-0x0;var _0x1e6570=_0x16e3[_0x102d5f];return _0x1e6570;};'use strict';var _=require(_0x316e('0x0'));var util=require(_0x316e('0x1'));var logger=require(_0x316e('0x2'))(_0x316e('0x3'));var moment=require(_0x316e('0x4'));var BPromise=require(_0x316e('0x5'));var rp=require(_0x316e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x316e('0x7'));var attributes=require(_0x316e('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x11b7de,_0x12d9ef){return _0x11b7de[_0x316e('0x9')](_0x316e('0xa'),attributes,{'tableName':_0x316e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4d73=['../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','define','DeskAccount','int_desk_accounts','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x2dca7b,_0x5a587f){var _0x4f1003=function(_0x47aa63){while(--_0x47aa63){_0x2dca7b['push'](_0x2dca7b['shift']());}};_0x4f1003(++_0x5a587f);}(_0x4d73,0x1b6));var _0x34d7=function(_0x2499e5,_0x41bdf0){_0x2499e5=_0x2499e5-0x0;var _0x496e0c=_0x4d73[_0x2499e5];return _0x496e0c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x34d7('0x0'))(_0x34d7('0x1'));var moment=require(_0x34d7('0x2'));var BPromise=require('bluebird');var rp=require(_0x34d7('0x3'));var fs=require('fs');var path=require(_0x34d7('0x4'));var rimraf=require(_0x34d7('0x5'));var config=require(_0x34d7('0x6'));var attributes=require(_0x34d7('0x7'));var integrations=require(_0x34d7('0x8'));module['exports']=function(_0x342e4d,_0x4bad3f){return _0x342e4d[_0x34d7('0x9')](_0x34d7('0xa'),attributes,{'tableName':_0x34d7('0xb'),'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 e7f6f80..a00817b 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 _0x1660=['http','then','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','GetDeskAccount','DeskAccount','options','raw','limit','include','model','attributes','map','info','catch','ShowDeskAccount','find','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client'];(function(_0x4792cf,_0x2a9dfa){var _0x19978a=function(_0x2a7cbe){while(--_0x2a7cbe){_0x4792cf['push'](_0x4792cf['shift']());}};_0x19978a(++_0x2a9dfa);}(_0x1660,0x1b6));var _0x0166=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x1660[_0x25e7cb];return _0x375d92;};'use strict';var _=require(_0x0166('0x0'));var util=require(_0x0166('0x1'));var moment=require(_0x0166('0x2'));var BPromise=require(_0x0166('0x3'));var rs=require(_0x0166('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0166('0x5'))['db'];var utils=require(_0x0166('0x6'));var logger=require('../../config/logger')(_0x0166('0x7'));var config=require(_0x0166('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0166('0x9')][_0x0166('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x129a59,_0x5c9849,_0x2329cd){return new BPromise(function(_0x568314,_0x1d4b85){return client['request'](_0x129a59,_0x2329cd)[_0x0166('0xb')](function(_0x44e44c){logger['info'](_0x0166('0xc'),_0x5c9849,_0x0166('0xd'));logger[_0x0166('0xe')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x5c9849,_0x0166('0xd'),JSON[_0x0166('0xf')](_0x44e44c));if(_0x44e44c['error']){if(_0x44e44c[_0x0166('0x10')]['code']===0x1f4){logger[_0x0166('0x10')](_0x0166('0xc'),_0x5c9849,_0x44e44c[_0x0166('0x10')][_0x0166('0x11')]);return _0x1d4b85(_0x44e44c[_0x0166('0x10')][_0x0166('0x11')]);}logger['error'](_0x0166('0xc'),_0x5c9849,_0x44e44c[_0x0166('0x10')]['message']);return _0x568314(_0x44e44c[_0x0166('0x10')][_0x0166('0x11')]);}else{logger['info'](_0x0166('0xc'),_0x5c9849,_0x0166('0xd'));_0x568314(_0x44e44c['result'][_0x0166('0x11')]);}})['catch'](function(_0x33e951){logger[_0x0166('0x10')](_0x0166('0xc'),_0x5c9849,_0x33e951);_0x1d4b85(_0x33e951);});});}exports[_0x0166('0x12')]=function(_0x5c4ccc){var _0x3436ff=this;return new Promise(function(_0x23dca0,_0x17d354){return db[_0x0166('0x13')]['findAll']({'raw':_0x5c4ccc[_0x0166('0x14')]?_0x5c4ccc[_0x0166('0x14')][_0x0166('0x15')]===undefined?!![]:![]:!![],'where':_0x5c4ccc[_0x0166('0x14')]?_0x5c4ccc[_0x0166('0x14')]['where']||null:null,'attributes':_0x5c4ccc[_0x0166('0x14')]?_0x5c4ccc[_0x0166('0x14')]['attributes']||null:null,'limit':_0x5c4ccc[_0x0166('0x14')]?_0x5c4ccc[_0x0166('0x14')][_0x0166('0x16')]||null:null,'include':_0x5c4ccc[_0x0166('0x14')]?_0x5c4ccc[_0x0166('0x14')][_0x0166('0x17')]?_['map'](_0x5c4ccc[_0x0166('0x14')][_0x0166('0x17')],function(_0x141d81){return{'model':db[_0x141d81[_0x0166('0x18')]],'as':_0x141d81['as'],'attributes':_0x141d81[_0x0166('0x19')],'include':_0x141d81[_0x0166('0x17')]?_[_0x0166('0x1a')](_0x141d81['include'],function(_0x187165){return{'model':db[_0x187165[_0x0166('0x18')]],'as':_0x187165['as'],'attributes':_0x187165[_0x0166('0x19')],'include':_0x187165[_0x0166('0x17')]?_['map'](_0x187165[_0x0166('0x17')],function(_0xebb379){return{'model':db[_0xebb379[_0x0166('0x18')]],'as':_0xebb379['as'],'attributes':_0xebb379[_0x0166('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0166('0xb')](function(_0x25a328){logger[_0x0166('0x1b')](_0x0166('0x12'),_0x5c4ccc);logger[_0x0166('0xe')]('GetDeskAccount',_0x5c4ccc,JSON[_0x0166('0xf')](_0x25a328));_0x23dca0(_0x25a328);})[_0x0166('0x1c')](function(_0x599d79){logger[_0x0166('0x10')](_0x0166('0x12'),_0x599d79['message'],_0x5c4ccc);_0x17d354(_0x3436ff['error'](0x1f4,_0x599d79[_0x0166('0x11')]));});});};exports[_0x0166('0x1d')]=function(_0x580910){var _0x1c5fca=this;return new Promise(function(_0x2d66c9,_0x39201f){return db['DeskAccount'][_0x0166('0x1e')]({'raw':_0x580910[_0x0166('0x14')]?_0x580910['options'][_0x0166('0x15')]===undefined?!![]:![]:!![],'where':_0x580910['options']?_0x580910[_0x0166('0x14')][_0x0166('0x1f')]||null:null,'attributes':_0x580910[_0x0166('0x14')]?_0x580910[_0x0166('0x14')][_0x0166('0x19')]||null:null,'include':_0x580910[_0x0166('0x14')]?_0x580910[_0x0166('0x14')][_0x0166('0x17')]?_[_0x0166('0x1a')](_0x580910['options'][_0x0166('0x17')],function(_0x34120c){return{'model':db[_0x34120c['model']],'as':_0x34120c['as'],'attributes':_0x34120c['attributes'],'include':_0x34120c[_0x0166('0x17')]?_['map'](_0x34120c[_0x0166('0x17')],function(_0x4690a7){return{'model':db[_0x4690a7[_0x0166('0x18')]],'as':_0x4690a7['as'],'attributes':_0x4690a7[_0x0166('0x19')],'include':_0x4690a7['include']?_['map'](_0x4690a7[_0x0166('0x17')],function(_0xc9e17c){return{'model':db[_0xc9e17c[_0x0166('0x18')]],'as':_0xc9e17c['as'],'attributes':_0xc9e17c[_0x0166('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0166('0xb')](function(_0x5ebe4b){logger[_0x0166('0x1b')](_0x0166('0x1d'),_0x580910);logger[_0x0166('0xe')](_0x0166('0x1d'),_0x580910,JSON[_0x0166('0xf')](_0x5ebe4b));_0x2d66c9(_0x5ebe4b);})[_0x0166('0x1c')](function(_0x44838b){logger['error'](_0x0166('0x1d'),_0x44838b[_0x0166('0x11')],_0x580910);_0x39201f(_0x1c5fca['error'](0x1f4,_0x44838b[_0x0166('0x11')]));});});}; \ No newline at end of file +var _0x6467=['request\x20sent','stringify','error','code','DeskAccount,\x20%s,\x20%s','message','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','attributes','limit','include','model','map','ShowDeskAccount','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','debug'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x6467,0x1c0));var _0x7646=function(_0x5ad04e,_0x233e4e){_0x5ad04e=_0x5ad04e-0x0;var _0x19d0e0=_0x6467[_0x5ad04e];return _0x19d0e0;};'use strict';var _=require(_0x7646('0x0'));var util=require('util');var moment=require(_0x7646('0x1'));var BPromise=require('bluebird');var rs=require(_0x7646('0x2'));var fs=require('fs');var Redis=require(_0x7646('0x3'));var db=require(_0x7646('0x4'))['db'];var utils=require(_0x7646('0x5'));var logger=require('../../config/logger')(_0x7646('0x6'));var config=require(_0x7646('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7646('0x8')][_0x7646('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ff1e5,_0x5b6297,_0x351029){return new BPromise(function(_0x5d3b56,_0x1a6d45){return client[_0x7646('0xa')](_0x3ff1e5,_0x351029)[_0x7646('0xb')](function(_0x576cb3){logger[_0x7646('0xc')]('DeskAccount,\x20%s,\x20%s',_0x5b6297,'request\x20sent');logger[_0x7646('0xd')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x5b6297,_0x7646('0xe'),JSON[_0x7646('0xf')](_0x576cb3));if(_0x576cb3[_0x7646('0x10')]){if(_0x576cb3['error'][_0x7646('0x11')]===0x1f4){logger[_0x7646('0x10')](_0x7646('0x12'),_0x5b6297,_0x576cb3[_0x7646('0x10')][_0x7646('0x13')]);return _0x1a6d45(_0x576cb3[_0x7646('0x10')][_0x7646('0x13')]);}logger[_0x7646('0x10')]('DeskAccount,\x20%s,\x20%s',_0x5b6297,_0x576cb3[_0x7646('0x10')][_0x7646('0x13')]);return _0x5d3b56(_0x576cb3['error']['message']);}else{logger['info'](_0x7646('0x12'),_0x5b6297,_0x7646('0xe'));_0x5d3b56(_0x576cb3[_0x7646('0x14')][_0x7646('0x13')]);}})[_0x7646('0x15')](function(_0x45cde9){logger['error']('DeskAccount,\x20%s,\x20%s',_0x5b6297,_0x45cde9);_0x1a6d45(_0x45cde9);});});}exports[_0x7646('0x16')]=function(_0x2ceaf6){var _0xeb2038=this;return new Promise(function(_0x177d40,_0xb6b519){return db[_0x7646('0x17')][_0x7646('0x18')]({'raw':_0x2ceaf6[_0x7646('0x19')]?_0x2ceaf6[_0x7646('0x19')][_0x7646('0x1a')]===undefined?!![]:![]:!![],'where':_0x2ceaf6[_0x7646('0x19')]?_0x2ceaf6['options']['where']||null:null,'attributes':_0x2ceaf6[_0x7646('0x19')]?_0x2ceaf6[_0x7646('0x19')][_0x7646('0x1b')]||null:null,'limit':_0x2ceaf6['options']?_0x2ceaf6[_0x7646('0x19')][_0x7646('0x1c')]||null:null,'include':_0x2ceaf6[_0x7646('0x19')]?_0x2ceaf6['options']['include']?_['map'](_0x2ceaf6[_0x7646('0x19')][_0x7646('0x1d')],function(_0x89d947){return{'model':db[_0x89d947[_0x7646('0x1e')]],'as':_0x89d947['as'],'attributes':_0x89d947[_0x7646('0x1b')],'include':_0x89d947[_0x7646('0x1d')]?_[_0x7646('0x1f')](_0x89d947[_0x7646('0x1d')],function(_0x12026a){return{'model':db[_0x12026a[_0x7646('0x1e')]],'as':_0x12026a['as'],'attributes':_0x12026a[_0x7646('0x1b')],'include':_0x12026a[_0x7646('0x1d')]?_[_0x7646('0x1f')](_0x12026a[_0x7646('0x1d')],function(_0x4d7ffe){return{'model':db[_0x4d7ffe[_0x7646('0x1e')]],'as':_0x4d7ffe['as'],'attributes':_0x4d7ffe[_0x7646('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7646('0xb')](function(_0x67a3f4){logger[_0x7646('0xc')](_0x7646('0x16'),_0x2ceaf6);logger[_0x7646('0xd')](_0x7646('0x16'),_0x2ceaf6,JSON[_0x7646('0xf')](_0x67a3f4));_0x177d40(_0x67a3f4);})[_0x7646('0x15')](function(_0x40de2c){logger[_0x7646('0x10')]('GetDeskAccount',_0x40de2c[_0x7646('0x13')],_0x2ceaf6);_0xb6b519(_0xeb2038['error'](0x1f4,_0x40de2c['message']));});});};exports[_0x7646('0x20')]=function(_0x56814a){var _0x1aa625=this;return new Promise(function(_0x400114,_0x5d6c24){return db[_0x7646('0x17')]['find']({'raw':_0x56814a[_0x7646('0x19')]?_0x56814a[_0x7646('0x19')][_0x7646('0x1a')]===undefined?!![]:![]:!![],'where':_0x56814a[_0x7646('0x19')]?_0x56814a[_0x7646('0x19')]['where']||null:null,'attributes':_0x56814a[_0x7646('0x19')]?_0x56814a[_0x7646('0x19')][_0x7646('0x1b')]||null:null,'include':_0x56814a[_0x7646('0x19')]?_0x56814a[_0x7646('0x19')][_0x7646('0x1d')]?_[_0x7646('0x1f')](_0x56814a['options'][_0x7646('0x1d')],function(_0xa73eae){return{'model':db[_0xa73eae[_0x7646('0x1e')]],'as':_0xa73eae['as'],'attributes':_0xa73eae[_0x7646('0x1b')],'include':_0xa73eae[_0x7646('0x1d')]?_['map'](_0xa73eae[_0x7646('0x1d')],function(_0x2420a7){return{'model':db[_0x2420a7[_0x7646('0x1e')]],'as':_0x2420a7['as'],'attributes':_0x2420a7[_0x7646('0x1b')],'include':_0x2420a7[_0x7646('0x1d')]?_[_0x7646('0x1f')](_0x2420a7[_0x7646('0x1d')],function(_0x352c7d){return{'model':db[_0x352c7d[_0x7646('0x1e')]],'as':_0x352c7d['as'],'attributes':_0x352c7d[_0x7646('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7646('0xb')](function(_0x5b80bf){logger[_0x7646('0xc')](_0x7646('0x20'),_0x56814a);logger[_0x7646('0xd')](_0x7646('0x20'),_0x56814a,JSON[_0x7646('0xf')](_0x5b80bf));_0x400114(_0x5b80bf);})[_0x7646('0x15')](function(_0x2b4d1b){logger[_0x7646('0x10')]('ShowDeskAccount',_0x2b4d1b['message'],_0x56814a);_0x5d6c24(_0x1aa625[_0x7646('0x10')](0x1f4,_0x2b4d1b[_0x7646('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index b5e50bc..b545bee 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['../../config/environment','./intDeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x7c66c0,_0x45b6fd){var _0x14c858=function(_0x3db8f7){while(--_0x3db8f7){_0x7c66c0['push'](_0x7c66c0['shift']());}};_0x14c858(++_0x45b6fd);}(_0x34e8,0x12c));var _0x834e=function(_0x27d830,_0x24f93d){_0x27d830=_0x27d830-0x0;var _0x3223dd=_0x34e8[_0x27d830];return _0x3223dd;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xa')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0xa')](_0x834e('0x11'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0xa')](_0x834e('0x13'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);router[_0x834e('0xa')](_0x834e('0x15'),auth['isAuthenticated'](),controller[_0x834e('0x16')]);router[_0x834e('0x17')]('/',auth['isAuthenticated'](),controller[_0x834e('0x18')]);router[_0x834e('0x17')](_0x834e('0x15'),auth[_0x834e('0xd')](),controller['setTags']);router[_0x834e('0x19')](_0x834e('0xc'),auth['isAuthenticated'](),controller[_0x834e('0x1a')]);router['delete'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller['destroy']);module[_0x834e('0x1b')]=router; \ No newline at end of file +var _0x3e74=['show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','getTags','post','/:id/tags','setTags','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x2f302b,_0x14e7a4){var _0x1e3012=function(_0x3eda69){while(--_0x3eda69){_0x2f302b['push'](_0x2f302b['shift']());}};_0x1e3012(++_0x14e7a4);}(_0x3e74,0x175));var _0x43e7=function(_0x8ded3b,_0x3a1dc5){_0x8ded3b=_0x8ded3b-0x0;var _0x179b06=_0x3e74[_0x8ded3b];return _0x179b06;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/subjects',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/tags',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0x13'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router['put']('/:id',auth[_0x43e7('0x8')](),controller[_0x43e7('0x15')]);router[_0x43e7('0x16')](_0x43e7('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x43e7('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index f7f2823..806b8e2 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 _0xea48=['sequelize','exports','STRING'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xea48,0x1ec));var _0x8ea4=function(_0x4d7f06,_0x5285cf){_0x4d7f06=_0x4d7f06-0x0;var _0x31b3c1=_0xea48[_0x4d7f06];return _0x31b3c1;};'use strict';var Sequelize=require(_0x8ea4('0x0'));module[_0x8ea4('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8ea4('0x2')]}}; \ No newline at end of file +var _0x8e03=['sequelize','exports','STRING'];(function(_0x26778d,_0x4045d2){var _0x1f61d8=function(_0x12c86d){while(--_0x12c86d){_0x26778d['push'](_0x26778d['shift']());}};_0x1f61d8(++_0x4045d2);}(_0x8e03,0x162));var _0x38e0=function(_0x1fb14f,_0x2be722){_0x1fb14f=_0x1fb14f-0x0;var _0x4b29d6=_0x8e03[_0x1fb14f];return _0x4b29d6;};'use strict';var Sequelize=require(_0x38e0('0x0'));module[_0x38e0('0x1')]={'name':{'type':Sequelize[_0x38e0('0x2')]},'description':{'type':Sequelize[_0x38e0('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 63a2b5c..99ecbf3 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 _0xdc59=['reject','save','update','then','error','index','map','DeskConfiguration','fieldName','type','key','name','query','attributes','intersection','model','fields','order','sort','where','filters','filter','merge','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','destroy','getFields','DeskField','rawAttributes','options','hasOwnProperty','nolimit','findOne','pick','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply'];(function(_0x3e81d0,_0x6e0c2b){var _0x3e77ed=function(_0x224e93){while(--_0x224e93){_0x3e81d0['push'](_0x3e81d0['shift']());}};_0x3e77ed(++_0x6e0c2b);}(_0xdc59,0x18a));var _0x9dc5=function(_0x57add2,_0x4f2b7d){_0x57add2=_0x57add2-0x0;var _0x4e3670=_0xdc59[_0x57add2];return _0x4e3670;};'use strict';var emlformat=require(_0x9dc5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9dc5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9dc5('0x2'));var moment=require(_0x9dc5('0x3'));var BPromise=require(_0x9dc5('0x4'));var Mustache=require('mustache');var util=require(_0x9dc5('0x5'));var path=require(_0x9dc5('0x6'));var sox=require(_0x9dc5('0x7'));var csv=require('to-csv');var ejs=require(_0x9dc5('0x8'));var fs=require('fs');var fs_extra=require(_0x9dc5('0x9'));var _=require(_0x9dc5('0xa'));var squel=require(_0x9dc5('0xb'));var crypto=require(_0x9dc5('0xc'));var jsforce=require(_0x9dc5('0xd'));var deskjs=require(_0x9dc5('0xe'));var toCsv=require(_0x9dc5('0xf'));var querystring=require('querystring');var Papa=require(_0x9dc5('0x10'));var Redis=require('ioredis');var authService=require(_0x9dc5('0x11'));var qs=require(_0x9dc5('0x12'));var as=require(_0x9dc5('0x13'));var hardwareService=require(_0x9dc5('0x14'));var logger=require(_0x9dc5('0x15'))(_0x9dc5('0x16'));var utils=require(_0x9dc5('0x17'));var config=require(_0x9dc5('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x9dc5('0x19'))['db'];function respondWithStatusCode(_0x5a422d,_0xba23e4){_0xba23e4=_0xba23e4||0xcc;return function(_0xccf31b){if(_0xccf31b){return _0x5a422d[_0x9dc5('0x1a')](_0xba23e4);}return _0x5a422d[_0x9dc5('0x1b')](_0xba23e4)[_0x9dc5('0x1c')]();};}function respondWithResult(_0x1d764c,_0x4ec0e2){_0x4ec0e2=_0x4ec0e2||0xc8;return function(_0x51caaa){if(_0x51caaa){return _0x1d764c[_0x9dc5('0x1b')](_0x4ec0e2)[_0x9dc5('0x1d')](_0x51caaa);}};}function respondWithFilteredResult(_0x9caed3,_0x3272b4){return function(_0x27d4d1){if(_0x27d4d1){var _0x30663a=typeof _0x3272b4[_0x9dc5('0x1e')]===_0x9dc5('0x1f')&&typeof _0x3272b4[_0x9dc5('0x20')]===_0x9dc5('0x1f');var _0x496e61=_0x27d4d1['count'];var _0x3cfd7d=_0x30663a?0x0:_0x3272b4[_0x9dc5('0x1e')];var _0x38b54b=_0x30663a?_0x27d4d1[_0x9dc5('0x21')]:_0x3272b4[_0x9dc5('0x1e')]+_0x3272b4['limit'];var _0x18cb01;if(_0x38b54b>=_0x496e61){_0x38b54b=_0x496e61;_0x18cb01=0xc8;}else{_0x18cb01=0xce;}_0x9caed3[_0x9dc5('0x1b')](_0x18cb01);return _0x9caed3[_0x9dc5('0x22')]('Content-Range',_0x3cfd7d+'-'+_0x38b54b+'/'+_0x496e61)['json'](_0x27d4d1);}return null;};}function patchUpdates(_0x116ee9){return function(_0x5cbada){try{jsonpatch[_0x9dc5('0x23')](_0x5cbada,_0x116ee9,!![]);}catch(_0x215488){return BPromise[_0x9dc5('0x24')](_0x215488);}return _0x5cbada[_0x9dc5('0x25')]();};}function saveUpdates(_0x18574f,_0x3bc275){return function(_0x255a93){if(_0x255a93){return _0x255a93[_0x9dc5('0x26')](_0x18574f)['then'](function(_0x14a6c2){return _0x14a6c2;});}return null;};}function removeEntity(_0x4d12ec,_0x3fd2f8){return function(_0x39833f){if(_0x39833f){return _0x39833f['destroy']()[_0x9dc5('0x27')](function(){_0x4d12ec[_0x9dc5('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52d62a,_0x57b8e3){return function(_0x28277c){if(!_0x28277c){_0x52d62a[_0x9dc5('0x1a')](0x194);}return _0x28277c;};}function handleError(_0x565321,_0x14b22a){_0x14b22a=_0x14b22a||0x1f4;return function(_0x278448){logger[_0x9dc5('0x28')](_0x278448['stack']);if(_0x278448['name']){delete _0x278448['name'];}_0x565321[_0x9dc5('0x1b')](_0x14b22a)['send'](_0x278448);};}exports[_0x9dc5('0x29')]=function(_0x4ab950,_0x522077){var _0x1dff97={},_0x1b545f={},_0x155f15={'count':0x0,'rows':[]};var _0x22e1fb=_[_0x9dc5('0x2a')](db[_0x9dc5('0x2b')]['rawAttributes'],function(_0x12bf86){return{'name':_0x12bf86[_0x9dc5('0x2c')],'type':_0x12bf86[_0x9dc5('0x2d')][_0x9dc5('0x2e')]};});_0x1b545f['model']=_[_0x9dc5('0x2a')](_0x22e1fb,_0x9dc5('0x2f'));_0x1b545f[_0x9dc5('0x30')]=_['keys'](_0x4ab950[_0x9dc5('0x30')]);_0x1b545f['filters']=_['intersection'](_0x1b545f['model'],_0x1b545f[_0x9dc5('0x30')]);_0x1dff97[_0x9dc5('0x31')]=_[_0x9dc5('0x32')](_0x1b545f[_0x9dc5('0x33')],qs[_0x9dc5('0x34')](_0x4ab950[_0x9dc5('0x30')][_0x9dc5('0x34')]));_0x1dff97['attributes']=_0x1dff97[_0x9dc5('0x31')]['length']?_0x1dff97[_0x9dc5('0x31')]:_0x1b545f[_0x9dc5('0x33')];if(!_0x4ab950[_0x9dc5('0x30')]['hasOwnProperty']('nolimit')){_0x1dff97[_0x9dc5('0x20')]=qs['limit'](_0x4ab950['query']['limit']);_0x1dff97[_0x9dc5('0x1e')]=qs['offset'](_0x4ab950['query'][_0x9dc5('0x1e')]);}_0x1dff97[_0x9dc5('0x35')]=qs[_0x9dc5('0x36')](_0x4ab950[_0x9dc5('0x30')]['sort']);_0x1dff97[_0x9dc5('0x37')]=qs[_0x9dc5('0x38')](_['pick'](_0x4ab950[_0x9dc5('0x30')],_0x1b545f['filters']),_0x22e1fb);if(_0x4ab950['query']['filter']){_0x1dff97[_0x9dc5('0x37')]=_['merge'](_0x1dff97[_0x9dc5('0x37')],{'$or':_[_0x9dc5('0x2a')](_0x22e1fb,function(_0x34658c){if(_0x34658c['type']!=='VIRTUAL'){var _0x58abe7={};_0x58abe7[_0x34658c[_0x9dc5('0x2f')]]={'$like':'%'+_0x4ab950[_0x9dc5('0x30')][_0x9dc5('0x39')]+'%'};return _0x58abe7;}})});}_0x1dff97=_[_0x9dc5('0x3a')]({},_0x1dff97,_0x4ab950['options']);var _0x195cfa={'where':_0x1dff97[_0x9dc5('0x37')]};return db['DeskConfiguration'][_0x9dc5('0x21')](_0x195cfa)[_0x9dc5('0x27')](function(_0x38ae73){_0x155f15[_0x9dc5('0x21')]=_0x38ae73;if(_0x4ab950['query'][_0x9dc5('0x3b')]){_0x1dff97[_0x9dc5('0x3c')]=[{'all':!![]}];}return db[_0x9dc5('0x2b')][_0x9dc5('0x3d')](_0x1dff97);})['then'](function(_0x7884e9){_0x155f15[_0x9dc5('0x3e')]=_0x7884e9;return _0x155f15;})[_0x9dc5('0x27')](respondWithFilteredResult(_0x522077,_0x1dff97))[_0x9dc5('0x3f')](handleError(_0x522077,null));};exports[_0x9dc5('0x40')]=function(_0xaa03d1,_0x144849){var _0x6b1d1c={'raw':![],'where':{'id':_0xaa03d1[_0x9dc5('0x41')]['id']}},_0x11b901={};_0x11b901['model']=_['keys'](db[_0x9dc5('0x2b')]['rawAttributes']);_0x11b901[_0x9dc5('0x30')]=_[_0x9dc5('0x42')](_0xaa03d1[_0x9dc5('0x30')]);_0x11b901[_0x9dc5('0x38')]=_['intersection'](_0x11b901['model'],_0x11b901[_0x9dc5('0x30')]);_0x6b1d1c['attributes']=_['intersection'](_0x11b901[_0x9dc5('0x33')],qs[_0x9dc5('0x34')](_0xaa03d1[_0x9dc5('0x30')][_0x9dc5('0x34')]));_0x6b1d1c[_0x9dc5('0x31')]=_0x6b1d1c[_0x9dc5('0x31')][_0x9dc5('0x43')]?_0x6b1d1c[_0x9dc5('0x31')]:_0x11b901[_0x9dc5('0x33')];if(_0xaa03d1[_0x9dc5('0x30')][_0x9dc5('0x3b')]){_0x6b1d1c[_0x9dc5('0x3c')]=[{'all':!![]}];}_0x6b1d1c=_[_0x9dc5('0x3a')]({},_0x6b1d1c,_0xaa03d1['options']);return db['DeskConfiguration'][_0x9dc5('0x44')](_0x6b1d1c)[_0x9dc5('0x27')](handleEntityNotFound(_0x144849,null))[_0x9dc5('0x27')](respondWithResult(_0x144849,null))[_0x9dc5('0x3f')](handleError(_0x144849,null));};exports['create']=function(_0x1bf157,_0xe77850){return db[_0x9dc5('0x2b')][_0x9dc5('0x45')](_0x1bf157['body'],{})['then'](respondWithResult(_0xe77850,0xc9))[_0x9dc5('0x3f')](handleError(_0xe77850,null));};exports[_0x9dc5('0x26')]=function(_0x1be264,_0x1ac6e0){if(_0x1be264[_0x9dc5('0x46')]['id']){delete _0x1be264[_0x9dc5('0x46')]['id'];}return db[_0x9dc5('0x2b')][_0x9dc5('0x44')]({'where':{'id':_0x1be264['params']['id']}})[_0x9dc5('0x27')](handleEntityNotFound(_0x1ac6e0,null))['then'](saveUpdates(_0x1be264[_0x9dc5('0x46')],null))[_0x9dc5('0x27')](respondWithResult(_0x1ac6e0,null))['catch'](handleError(_0x1ac6e0,null));};exports[_0x9dc5('0x47')]=function(_0x2a992f,_0x453501){return db[_0x9dc5('0x2b')][_0x9dc5('0x44')]({'where':{'id':_0x2a992f[_0x9dc5('0x41')]['id']}})[_0x9dc5('0x27')](handleEntityNotFound(_0x453501,null))[_0x9dc5('0x27')](removeEntity(_0x453501,null))[_0x9dc5('0x3f')](handleError(_0x453501,null));};exports[_0x9dc5('0x48')]=function(_0x472f2,_0x217624,_0x23cc98){var _0x4eebab={};var _0x20d0ad={};var _0x2083c1;var _0x5319b4;return db[_0x9dc5('0x2b')]['findOne']({'where':{'id':_0x472f2['params']['id']}})[_0x9dc5('0x27')](handleEntityNotFound(_0x217624,null))[_0x9dc5('0x27')](function(_0x531638){if(_0x531638){_0x2083c1=_0x531638;_0x20d0ad[_0x9dc5('0x33')]=_[_0x9dc5('0x42')](db[_0x9dc5('0x49')][_0x9dc5('0x4a')]);_0x20d0ad['query']=_[_0x9dc5('0x42')](_0x472f2[_0x9dc5('0x30')]);_0x20d0ad[_0x9dc5('0x38')]=_[_0x9dc5('0x32')](_0x20d0ad[_0x9dc5('0x33')],_0x20d0ad[_0x9dc5('0x30')]);_0x4eebab[_0x9dc5('0x31')]=_[_0x9dc5('0x32')](_0x20d0ad[_0x9dc5('0x33')],qs['fields'](_0x472f2[_0x9dc5('0x30')][_0x9dc5('0x34')]));_0x4eebab[_0x9dc5('0x31')]=_0x4eebab[_0x9dc5('0x31')][_0x9dc5('0x43')]?_0x4eebab[_0x9dc5('0x31')]:_0x20d0ad[_0x9dc5('0x33')];_0x4eebab[_0x9dc5('0x35')]=qs[_0x9dc5('0x36')](_0x472f2[_0x9dc5('0x30')]['sort']);_0x4eebab['where']=qs['filters'](_['pick'](_0x472f2['query'],_0x20d0ad[_0x9dc5('0x38')]));if(_0x472f2[_0x9dc5('0x30')][_0x9dc5('0x39')]){_0x4eebab[_0x9dc5('0x37')]=_[_0x9dc5('0x3a')](_0x4eebab[_0x9dc5('0x37')],{'$or':_[_0x9dc5('0x2a')](_0x4eebab[_0x9dc5('0x31')],function(_0xca5c8d){var _0x781e31={};_0x781e31[_0xca5c8d]={'$like':'%'+_0x472f2[_0x9dc5('0x30')][_0x9dc5('0x39')]+'%'};return _0x781e31;})});}_0x4eebab=_[_0x9dc5('0x3a')]({},_0x4eebab,_0x472f2[_0x9dc5('0x4b')]);return _0x2083c1[_0x9dc5('0x48')](_0x4eebab);}})[_0x9dc5('0x27')](function(_0x24602d){if(_0x24602d){_0x5319b4=_0x24602d[_0x9dc5('0x43')];if(!_0x472f2[_0x9dc5('0x30')][_0x9dc5('0x4c')](_0x9dc5('0x4d'))){_0x4eebab['limit']=qs['limit'](_0x472f2[_0x9dc5('0x30')][_0x9dc5('0x20')]);_0x4eebab[_0x9dc5('0x1e')]=qs[_0x9dc5('0x1e')](_0x472f2[_0x9dc5('0x30')]['offset']);}return _0x2083c1[_0x9dc5('0x48')](_0x4eebab);}})[_0x9dc5('0x27')](function(_0x553c7a){if(_0x553c7a){return _0x553c7a?{'count':_0x5319b4,'rows':_0x553c7a}:null;}})[_0x9dc5('0x27')](respondWithResult(_0x217624,null))[_0x9dc5('0x3f')](handleError(_0x217624,null));};exports['getSubjects']=function(_0x48dad8,_0x52a450,_0x1f2fd1){var _0x124000={};var _0x32bc02={};var _0xe15b1;var _0x2af69b;return db[_0x9dc5('0x2b')][_0x9dc5('0x4e')]({'where':{'id':_0x48dad8[_0x9dc5('0x41')]['id']}})[_0x9dc5('0x27')](handleEntityNotFound(_0x52a450,null))[_0x9dc5('0x27')](function(_0x27be9d){if(_0x27be9d){_0xe15b1=_0x27be9d;_0x32bc02[_0x9dc5('0x33')]=_[_0x9dc5('0x42')](db['DeskField'][_0x9dc5('0x4a')]);_0x32bc02['query']=_['keys'](_0x48dad8['query']);_0x32bc02[_0x9dc5('0x38')]=_[_0x9dc5('0x32')](_0x32bc02[_0x9dc5('0x33')],_0x32bc02[_0x9dc5('0x30')]);_0x124000[_0x9dc5('0x31')]=_['intersection'](_0x32bc02[_0x9dc5('0x33')],qs[_0x9dc5('0x34')](_0x48dad8[_0x9dc5('0x30')][_0x9dc5('0x34')]));_0x124000[_0x9dc5('0x31')]=_0x124000[_0x9dc5('0x31')][_0x9dc5('0x43')]?_0x124000['attributes']:_0x32bc02['model'];_0x124000['order']=qs['sort'](_0x48dad8[_0x9dc5('0x30')][_0x9dc5('0x36')]);_0x124000[_0x9dc5('0x37')]=qs['filters'](_[_0x9dc5('0x4f')](_0x48dad8[_0x9dc5('0x30')],_0x32bc02['filters']));if(_0x48dad8[_0x9dc5('0x30')][_0x9dc5('0x39')]){_0x124000[_0x9dc5('0x37')]=_[_0x9dc5('0x3a')](_0x124000['where'],{'$or':_[_0x9dc5('0x2a')](_0x124000[_0x9dc5('0x31')],function(_0x5267af){var _0x4fa68e={};_0x4fa68e[_0x5267af]={'$like':'%'+_0x48dad8['query']['filter']+'%'};return _0x4fa68e;})});}_0x124000=_[_0x9dc5('0x3a')]({},_0x124000,_0x48dad8[_0x9dc5('0x4b')]);return _0xe15b1[_0x9dc5('0x50')](_0x124000);}})[_0x9dc5('0x27')](function(_0x6295bc){if(_0x6295bc){_0x2af69b=_0x6295bc['length'];if(!_0x48dad8[_0x9dc5('0x30')][_0x9dc5('0x4c')](_0x9dc5('0x4d'))){_0x124000[_0x9dc5('0x20')]=qs[_0x9dc5('0x20')](_0x48dad8[_0x9dc5('0x30')][_0x9dc5('0x20')]);_0x124000[_0x9dc5('0x1e')]=qs['offset'](_0x48dad8[_0x9dc5('0x30')][_0x9dc5('0x1e')]);}return _0xe15b1[_0x9dc5('0x50')](_0x124000);}})[_0x9dc5('0x27')](function(_0x4b92dc){if(_0x4b92dc){return _0x4b92dc?{'count':_0x2af69b,'rows':_0x4b92dc}:null;}})[_0x9dc5('0x27')](respondWithResult(_0x52a450,null))[_0x9dc5('0x3f')](handleError(_0x52a450,null));};exports[_0x9dc5('0x51')]=function(_0x3e22ab,_0x2fe21f,_0x2dd6c2){var _0x4d14da={};var _0x3367d0={};var _0x178e0d;var _0x1d7ffd;return db['DeskConfiguration'][_0x9dc5('0x4e')]({'where':{'id':_0x3e22ab['params']['id']}})['then'](handleEntityNotFound(_0x2fe21f,null))['then'](function(_0x39a2b0){if(_0x39a2b0){_0x178e0d=_0x39a2b0;_0x3367d0['model']=_[_0x9dc5('0x42')](db[_0x9dc5('0x49')][_0x9dc5('0x4a')]);_0x3367d0[_0x9dc5('0x30')]=_[_0x9dc5('0x42')](_0x3e22ab[_0x9dc5('0x30')]);_0x3367d0[_0x9dc5('0x38')]=_['intersection'](_0x3367d0[_0x9dc5('0x33')],_0x3367d0['query']);_0x4d14da['attributes']=_[_0x9dc5('0x32')](_0x3367d0[_0x9dc5('0x33')],qs[_0x9dc5('0x34')](_0x3e22ab[_0x9dc5('0x30')][_0x9dc5('0x34')]));_0x4d14da[_0x9dc5('0x31')]=_0x4d14da[_0x9dc5('0x31')]['length']?_0x4d14da[_0x9dc5('0x31')]:_0x3367d0[_0x9dc5('0x33')];_0x4d14da['order']=qs[_0x9dc5('0x36')](_0x3e22ab[_0x9dc5('0x30')][_0x9dc5('0x36')]);_0x4d14da[_0x9dc5('0x37')]=qs[_0x9dc5('0x38')](_[_0x9dc5('0x4f')](_0x3e22ab[_0x9dc5('0x30')],_0x3367d0[_0x9dc5('0x38')]));if(_0x3e22ab[_0x9dc5('0x30')]['filter']){_0x4d14da[_0x9dc5('0x37')]=_[_0x9dc5('0x3a')](_0x4d14da[_0x9dc5('0x37')],{'$or':_[_0x9dc5('0x2a')](_0x4d14da[_0x9dc5('0x31')],function(_0x20df52){var _0xa65489={};_0xa65489[_0x20df52]={'$like':'%'+_0x3e22ab['query']['filter']+'%'};return _0xa65489;})});}_0x4d14da=_[_0x9dc5('0x3a')]({},_0x4d14da,_0x3e22ab['options']);return _0x178e0d['getDescriptions'](_0x4d14da);}})['then'](function(_0x3a804f){if(_0x3a804f){_0x1d7ffd=_0x3a804f[_0x9dc5('0x43')];if(!_0x3e22ab['query'][_0x9dc5('0x4c')]('nolimit')){_0x4d14da[_0x9dc5('0x20')]=qs[_0x9dc5('0x20')](_0x3e22ab[_0x9dc5('0x30')]['limit']);_0x4d14da[_0x9dc5('0x1e')]=qs[_0x9dc5('0x1e')](_0x3e22ab[_0x9dc5('0x30')][_0x9dc5('0x1e')]);}return _0x178e0d[_0x9dc5('0x51')](_0x4d14da);}})[_0x9dc5('0x27')](function(_0x331b1b){if(_0x331b1b){return _0x331b1b?{'count':_0x1d7ffd,'rows':_0x331b1b}:null;}})[_0x9dc5('0x27')](respondWithResult(_0x2fe21f,null))[_0x9dc5('0x3f')](handleError(_0x2fe21f,null));};exports[_0x9dc5('0x52')]=function(_0x3d8493,_0x2f0166,_0x202142){var _0x20f35d={};var _0x33d157={};var _0x2f84a6;var _0x189fdf;return db[_0x9dc5('0x2b')][_0x9dc5('0x4e')]({'where':{'id':_0x3d8493['params']['id']}})[_0x9dc5('0x27')](handleEntityNotFound(_0x2f0166,null))[_0x9dc5('0x27')](function(_0x316638){if(_0x316638){_0x2f84a6=_0x316638;_0x33d157[_0x9dc5('0x33')]=_[_0x9dc5('0x42')](db[_0x9dc5('0x53')][_0x9dc5('0x4a')]);_0x33d157['query']=_[_0x9dc5('0x42')](_0x3d8493[_0x9dc5('0x30')]);_0x33d157[_0x9dc5('0x38')]=_['intersection'](_0x33d157[_0x9dc5('0x33')],_0x33d157[_0x9dc5('0x30')]);_0x20f35d[_0x9dc5('0x31')]=_[_0x9dc5('0x32')](_0x33d157[_0x9dc5('0x33')],qs[_0x9dc5('0x34')](_0x3d8493[_0x9dc5('0x30')][_0x9dc5('0x34')]));_0x20f35d[_0x9dc5('0x31')]=_0x20f35d[_0x9dc5('0x31')][_0x9dc5('0x43')]?_0x20f35d['attributes']:_0x33d157[_0x9dc5('0x33')];_0x20f35d[_0x9dc5('0x35')]=qs[_0x9dc5('0x36')](_0x3d8493['query']['sort']);_0x20f35d[_0x9dc5('0x37')]=qs['filters'](_['pick'](_0x3d8493['query'],_0x33d157['filters']));if(_0x3d8493['query'][_0x9dc5('0x39')]){_0x20f35d['where']=_['merge'](_0x20f35d['where'],{'$or':_[_0x9dc5('0x2a')](_0x20f35d[_0x9dc5('0x31')],function(_0x2599ac){var _0x4377fe={};_0x4377fe[_0x2599ac]={'$like':'%'+_0x3d8493[_0x9dc5('0x30')][_0x9dc5('0x39')]+'%'};return _0x4377fe;})});}_0x20f35d=_[_0x9dc5('0x3a')]({},_0x20f35d,_0x3d8493[_0x9dc5('0x4b')]);return _0x2f84a6[_0x9dc5('0x52')](_0x20f35d);}})[_0x9dc5('0x27')](function(_0x2ee44d){if(_0x2ee44d){_0x189fdf=_0x2ee44d['length'];if(!_0x3d8493[_0x9dc5('0x30')][_0x9dc5('0x4c')](_0x9dc5('0x4d'))){_0x20f35d['limit']=qs['limit'](_0x3d8493['query'][_0x9dc5('0x20')]);_0x20f35d['offset']=qs['offset'](_0x3d8493[_0x9dc5('0x30')][_0x9dc5('0x1e')]);}return _0x2f84a6[_0x9dc5('0x52')](_0x20f35d);}})['then'](function(_0x1a7bf5){if(_0x1a7bf5){return _0x1a7bf5?{'count':_0x189fdf,'rows':_0x1a7bf5}:null;}})['then'](respondWithResult(_0x2f0166,null))[_0x9dc5('0x3f')](handleError(_0x2f0166,null));};exports[_0x9dc5('0x54')]=function(_0x2ba11a,_0x42dc30,_0xcb0075){if(_0x2ba11a[_0x9dc5('0x46')]['id']){delete _0x2ba11a[_0x9dc5('0x46')]['id'];}return db[_0x9dc5('0x2b')][_0x9dc5('0x4e')]({'where':{'id':_0x2ba11a[_0x9dc5('0x41')]['id']}})[_0x9dc5('0x27')](handleEntityNotFound(_0x42dc30,null))['then'](function(_0x470221){if(_0x470221){return _0x470221[_0x9dc5('0x54')](_0x2ba11a[_0x9dc5('0x46')][_0x9dc5('0x55')]||[]);}return null;})['then'](respondWithResult(_0x42dc30,null))['catch'](handleError(_0x42dc30,null));}; \ No newline at end of file +var _0x2548=['to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','index','map','DeskConfiguration','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','options','includeAll','findAll','rows','show','params','rawAttributes','find','catch','create','body','findOne','DeskField','length','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js'];(function(_0x265773,_0x5d1b6e){var _0x4ed75d=function(_0x3b7ce7){while(--_0x3b7ce7){_0x265773['push'](_0x265773['shift']());}};_0x4ed75d(++_0x5d1b6e);}(_0x2548,0x9a));var _0x8254=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2548[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x8254('0x0'));var rimraf=require(_0x8254('0x1'));var zipdir=require(_0x8254('0x2'));var jsonpatch=require(_0x8254('0x3'));var rp=require(_0x8254('0x4'));var moment=require(_0x8254('0x5'));var BPromise=require(_0x8254('0x6'));var Mustache=require(_0x8254('0x7'));var util=require(_0x8254('0x8'));var path=require(_0x8254('0x9'));var sox=require(_0x8254('0xa'));var csv=require('to-csv');var ejs=require(_0x8254('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8254('0xc'));var squel=require(_0x8254('0xd'));var crypto=require(_0x8254('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x8254('0xf'));var toCsv=require(_0x8254('0x10'));var querystring=require('querystring');var Papa=require(_0x8254('0x11'));var Redis=require('ioredis');var authService=require(_0x8254('0x12'));var qs=require(_0x8254('0x13'));var as=require(_0x8254('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8254('0x15'))(_0x8254('0x16'));var utils=require(_0x8254('0x17'));var config=require(_0x8254('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x8254('0x19'))['db'];function respondWithStatusCode(_0x21999a,_0x45799e){_0x45799e=_0x45799e||0xcc;return function(_0x443c1f){if(_0x443c1f){return _0x21999a[_0x8254('0x1a')](_0x45799e);}return _0x21999a[_0x8254('0x1b')](_0x45799e)['end']();};}function respondWithResult(_0x5c0f78,_0xea7551){_0xea7551=_0xea7551||0xc8;return function(_0x53a6a4){if(_0x53a6a4){return _0x5c0f78[_0x8254('0x1b')](_0xea7551)[_0x8254('0x1c')](_0x53a6a4);}};}function respondWithFilteredResult(_0x45dca6,_0x4178cc){return function(_0x38cf30){if(_0x38cf30){var _0x4f2bf5=typeof _0x4178cc[_0x8254('0x1d')]==='undefined'&&typeof _0x4178cc[_0x8254('0x1e')]==='undefined';var _0x87d011=_0x38cf30['count'];var _0x58b493=_0x4f2bf5?0x0:_0x4178cc[_0x8254('0x1d')];var _0x4ab251=_0x4f2bf5?_0x38cf30[_0x8254('0x1f')]:_0x4178cc['offset']+_0x4178cc[_0x8254('0x1e')];var _0x3b10c3;if(_0x4ab251>=_0x87d011){_0x4ab251=_0x87d011;_0x3b10c3=0xc8;}else{_0x3b10c3=0xce;}_0x45dca6['status'](_0x3b10c3);return _0x45dca6[_0x8254('0x20')](_0x8254('0x21'),_0x58b493+'-'+_0x4ab251+'/'+_0x87d011)[_0x8254('0x1c')](_0x38cf30);}return null;};}function patchUpdates(_0x2a2a7f){return function(_0x4b5480){try{jsonpatch[_0x8254('0x22')](_0x4b5480,_0x2a2a7f,!![]);}catch(_0xf93d3f){return BPromise['reject'](_0xf93d3f);}return _0x4b5480[_0x8254('0x23')]();};}function saveUpdates(_0xedf203,_0x4953f1){return function(_0x2946cd){if(_0x2946cd){return _0x2946cd[_0x8254('0x24')](_0xedf203)[_0x8254('0x25')](function(_0x3a092c){return _0x3a092c;});}return null;};}function removeEntity(_0x2785e8,_0x563210){return function(_0x423fe0){if(_0x423fe0){return _0x423fe0[_0x8254('0x26')]()[_0x8254('0x25')](function(){_0x2785e8[_0x8254('0x1b')](0xcc)[_0x8254('0x27')]();});}};}function handleEntityNotFound(_0x1aa9f7,_0x5e42c9){return function(_0xaf5469){if(!_0xaf5469){_0x1aa9f7['sendStatus'](0x194);}return _0xaf5469;};}function handleError(_0x2ad0d6,_0x2dd98a){_0x2dd98a=_0x2dd98a||0x1f4;return function(_0x15af61){logger[_0x8254('0x28')](_0x15af61[_0x8254('0x29')]);if(_0x15af61[_0x8254('0x2a')]){delete _0x15af61[_0x8254('0x2a')];}_0x2ad0d6[_0x8254('0x1b')](_0x2dd98a)[_0x8254('0x2b')](_0x15af61);};}exports[_0x8254('0x2c')]=function(_0x2cf681,_0x95b917){var _0x118d12={},_0x51fa80={},_0x188ec4={'count':0x0,'rows':[]};var _0xea7013=_[_0x8254('0x2d')](db[_0x8254('0x2e')]['rawAttributes'],function(_0x5c6874){return{'name':_0x5c6874[_0x8254('0x2f')],'type':_0x5c6874['type'][_0x8254('0x30')]};});_0x51fa80[_0x8254('0x31')]=_[_0x8254('0x2d')](_0xea7013,_0x8254('0x2a'));_0x51fa80[_0x8254('0x32')]=_[_0x8254('0x33')](_0x2cf681[_0x8254('0x32')]);_0x51fa80['filters']=_[_0x8254('0x34')](_0x51fa80[_0x8254('0x31')],_0x51fa80[_0x8254('0x32')]);_0x118d12[_0x8254('0x35')]=_[_0x8254('0x34')](_0x51fa80[_0x8254('0x31')],qs[_0x8254('0x36')](_0x2cf681[_0x8254('0x32')][_0x8254('0x36')]));_0x118d12['attributes']=_0x118d12[_0x8254('0x35')]['length']?_0x118d12['attributes']:_0x51fa80[_0x8254('0x31')];if(!_0x2cf681[_0x8254('0x32')][_0x8254('0x37')](_0x8254('0x38'))){_0x118d12[_0x8254('0x1e')]=qs[_0x8254('0x1e')](_0x2cf681['query']['limit']);_0x118d12['offset']=qs[_0x8254('0x1d')](_0x2cf681['query'][_0x8254('0x1d')]);}_0x118d12[_0x8254('0x39')]=qs['sort'](_0x2cf681[_0x8254('0x32')][_0x8254('0x3a')]);_0x118d12['where']=qs[_0x8254('0x3b')](_[_0x8254('0x3c')](_0x2cf681[_0x8254('0x32')],_0x51fa80[_0x8254('0x3b')]),_0xea7013);if(_0x2cf681[_0x8254('0x32')][_0x8254('0x3d')]){_0x118d12[_0x8254('0x3e')]=_[_0x8254('0x3f')](_0x118d12[_0x8254('0x3e')],{'$or':_[_0x8254('0x2d')](_0xea7013,function(_0x4b8c4a){if(_0x4b8c4a[_0x8254('0x40')]!=='VIRTUAL'){var _0x5d5024={};_0x5d5024[_0x4b8c4a[_0x8254('0x2a')]]={'$like':'%'+_0x2cf681[_0x8254('0x32')][_0x8254('0x3d')]+'%'};return _0x5d5024;}})});}_0x118d12=_[_0x8254('0x3f')]({},_0x118d12,_0x2cf681[_0x8254('0x41')]);var _0x45744a={'where':_0x118d12[_0x8254('0x3e')]};return db[_0x8254('0x2e')][_0x8254('0x1f')](_0x45744a)[_0x8254('0x25')](function(_0x3ab3f3){_0x188ec4[_0x8254('0x1f')]=_0x3ab3f3;if(_0x2cf681['query'][_0x8254('0x42')]){_0x118d12['include']=[{'all':!![]}];}return db['DeskConfiguration'][_0x8254('0x43')](_0x118d12);})['then'](function(_0x2d6c1d){_0x188ec4[_0x8254('0x44')]=_0x2d6c1d;return _0x188ec4;})['then'](respondWithFilteredResult(_0x95b917,_0x118d12))['catch'](handleError(_0x95b917,null));};exports[_0x8254('0x45')]=function(_0x1f497b,_0x54fde6){var _0x79a50a={'raw':![],'where':{'id':_0x1f497b[_0x8254('0x46')]['id']}},_0x4585ee={};_0x4585ee[_0x8254('0x31')]=_['keys'](db[_0x8254('0x2e')][_0x8254('0x47')]);_0x4585ee[_0x8254('0x32')]=_[_0x8254('0x33')](_0x1f497b[_0x8254('0x32')]);_0x4585ee[_0x8254('0x3b')]=_[_0x8254('0x34')](_0x4585ee['model'],_0x4585ee[_0x8254('0x32')]);_0x79a50a[_0x8254('0x35')]=_[_0x8254('0x34')](_0x4585ee[_0x8254('0x31')],qs['fields'](_0x1f497b[_0x8254('0x32')]['fields']));_0x79a50a['attributes']=_0x79a50a[_0x8254('0x35')]['length']?_0x79a50a[_0x8254('0x35')]:_0x4585ee[_0x8254('0x31')];if(_0x1f497b[_0x8254('0x32')][_0x8254('0x42')]){_0x79a50a['include']=[{'all':!![]}];}_0x79a50a=_[_0x8254('0x3f')]({},_0x79a50a,_0x1f497b[_0x8254('0x41')]);return db['DeskConfiguration'][_0x8254('0x48')](_0x79a50a)['then'](handleEntityNotFound(_0x54fde6,null))[_0x8254('0x25')](respondWithResult(_0x54fde6,null))[_0x8254('0x49')](handleError(_0x54fde6,null));};exports[_0x8254('0x4a')]=function(_0x15eadc,_0xfd80b0){return db[_0x8254('0x2e')][_0x8254('0x4a')](_0x15eadc[_0x8254('0x4b')],{})[_0x8254('0x25')](respondWithResult(_0xfd80b0,0xc9))[_0x8254('0x49')](handleError(_0xfd80b0,null));};exports[_0x8254('0x24')]=function(_0x57991a,_0x237828){if(_0x57991a[_0x8254('0x4b')]['id']){delete _0x57991a[_0x8254('0x4b')]['id'];}return db[_0x8254('0x2e')]['find']({'where':{'id':_0x57991a[_0x8254('0x46')]['id']}})['then'](handleEntityNotFound(_0x237828,null))[_0x8254('0x25')](saveUpdates(_0x57991a[_0x8254('0x4b')],null))[_0x8254('0x25')](respondWithResult(_0x237828,null))['catch'](handleError(_0x237828,null));};exports[_0x8254('0x26')]=function(_0x400c49,_0x184ce8){return db[_0x8254('0x2e')][_0x8254('0x48')]({'where':{'id':_0x400c49[_0x8254('0x46')]['id']}})[_0x8254('0x25')](handleEntityNotFound(_0x184ce8,null))[_0x8254('0x25')](removeEntity(_0x184ce8,null))[_0x8254('0x49')](handleError(_0x184ce8,null));};exports['getFields']=function(_0x10698c,_0x517621,_0x4c7c38){var _0x46c137={};var _0x57f1de={};var _0xa05bc0;var _0xa6b8c4;return db[_0x8254('0x2e')][_0x8254('0x4c')]({'where':{'id':_0x10698c[_0x8254('0x46')]['id']}})[_0x8254('0x25')](handleEntityNotFound(_0x517621,null))[_0x8254('0x25')](function(_0x268a17){if(_0x268a17){_0xa05bc0=_0x268a17;_0x57f1de[_0x8254('0x31')]=_[_0x8254('0x33')](db[_0x8254('0x4d')][_0x8254('0x47')]);_0x57f1de[_0x8254('0x32')]=_[_0x8254('0x33')](_0x10698c[_0x8254('0x32')]);_0x57f1de['filters']=_[_0x8254('0x34')](_0x57f1de[_0x8254('0x31')],_0x57f1de[_0x8254('0x32')]);_0x46c137[_0x8254('0x35')]=_[_0x8254('0x34')](_0x57f1de['model'],qs['fields'](_0x10698c[_0x8254('0x32')][_0x8254('0x36')]));_0x46c137['attributes']=_0x46c137[_0x8254('0x35')][_0x8254('0x4e')]?_0x46c137[_0x8254('0x35')]:_0x57f1de[_0x8254('0x31')];_0x46c137[_0x8254('0x39')]=qs['sort'](_0x10698c[_0x8254('0x32')]['sort']);_0x46c137['where']=qs['filters'](_[_0x8254('0x3c')](_0x10698c[_0x8254('0x32')],_0x57f1de[_0x8254('0x3b')]));if(_0x10698c['query'][_0x8254('0x3d')]){_0x46c137[_0x8254('0x3e')]=_[_0x8254('0x3f')](_0x46c137[_0x8254('0x3e')],{'$or':_[_0x8254('0x2d')](_0x46c137[_0x8254('0x35')],function(_0x245c51){var _0xd6313c={};_0xd6313c[_0x245c51]={'$like':'%'+_0x10698c[_0x8254('0x32')][_0x8254('0x3d')]+'%'};return _0xd6313c;})});}_0x46c137=_[_0x8254('0x3f')]({},_0x46c137,_0x10698c['options']);return _0xa05bc0[_0x8254('0x4f')](_0x46c137);}})[_0x8254('0x25')](function(_0x28e195){if(_0x28e195){_0xa6b8c4=_0x28e195['length'];if(!_0x10698c[_0x8254('0x32')][_0x8254('0x37')]('nolimit')){_0x46c137['limit']=qs[_0x8254('0x1e')](_0x10698c[_0x8254('0x32')][_0x8254('0x1e')]);_0x46c137[_0x8254('0x1d')]=qs[_0x8254('0x1d')](_0x10698c['query'][_0x8254('0x1d')]);}return _0xa05bc0[_0x8254('0x4f')](_0x46c137);}})[_0x8254('0x25')](function(_0x17713e){if(_0x17713e){return _0x17713e?{'count':_0xa6b8c4,'rows':_0x17713e}:null;}})[_0x8254('0x25')](respondWithResult(_0x517621,null))[_0x8254('0x49')](handleError(_0x517621,null));};exports['getSubjects']=function(_0x3c6bc5,_0x50c1,_0x2da37f){var _0x3878f6={};var _0x5b22b2={};var _0x414640;var _0x47475f;return db[_0x8254('0x2e')][_0x8254('0x4c')]({'where':{'id':_0x3c6bc5[_0x8254('0x46')]['id']}})[_0x8254('0x25')](handleEntityNotFound(_0x50c1,null))[_0x8254('0x25')](function(_0x1cb8fc){if(_0x1cb8fc){_0x414640=_0x1cb8fc;_0x5b22b2[_0x8254('0x31')]=_['keys'](db['DeskField'][_0x8254('0x47')]);_0x5b22b2[_0x8254('0x32')]=_[_0x8254('0x33')](_0x3c6bc5[_0x8254('0x32')]);_0x5b22b2['filters']=_['intersection'](_0x5b22b2[_0x8254('0x31')],_0x5b22b2[_0x8254('0x32')]);_0x3878f6['attributes']=_['intersection'](_0x5b22b2[_0x8254('0x31')],qs[_0x8254('0x36')](_0x3c6bc5[_0x8254('0x32')]['fields']));_0x3878f6[_0x8254('0x35')]=_0x3878f6[_0x8254('0x35')]['length']?_0x3878f6['attributes']:_0x5b22b2[_0x8254('0x31')];_0x3878f6[_0x8254('0x39')]=qs[_0x8254('0x3a')](_0x3c6bc5['query'][_0x8254('0x3a')]);_0x3878f6[_0x8254('0x3e')]=qs[_0x8254('0x3b')](_[_0x8254('0x3c')](_0x3c6bc5[_0x8254('0x32')],_0x5b22b2[_0x8254('0x3b')]));if(_0x3c6bc5[_0x8254('0x32')][_0x8254('0x3d')]){_0x3878f6[_0x8254('0x3e')]=_['merge'](_0x3878f6[_0x8254('0x3e')],{'$or':_[_0x8254('0x2d')](_0x3878f6[_0x8254('0x35')],function(_0x3b1077){var _0x2582a0={};_0x2582a0[_0x3b1077]={'$like':'%'+_0x3c6bc5[_0x8254('0x32')][_0x8254('0x3d')]+'%'};return _0x2582a0;})});}_0x3878f6=_[_0x8254('0x3f')]({},_0x3878f6,_0x3c6bc5[_0x8254('0x41')]);return _0x414640[_0x8254('0x50')](_0x3878f6);}})[_0x8254('0x25')](function(_0x472714){if(_0x472714){_0x47475f=_0x472714[_0x8254('0x4e')];if(!_0x3c6bc5[_0x8254('0x32')]['hasOwnProperty']('nolimit')){_0x3878f6[_0x8254('0x1e')]=qs[_0x8254('0x1e')](_0x3c6bc5[_0x8254('0x32')][_0x8254('0x1e')]);_0x3878f6[_0x8254('0x1d')]=qs[_0x8254('0x1d')](_0x3c6bc5[_0x8254('0x32')][_0x8254('0x1d')]);}return _0x414640[_0x8254('0x50')](_0x3878f6);}})['then'](function(_0x5d4717){if(_0x5d4717){return _0x5d4717?{'count':_0x47475f,'rows':_0x5d4717}:null;}})[_0x8254('0x25')](respondWithResult(_0x50c1,null))[_0x8254('0x49')](handleError(_0x50c1,null));};exports[_0x8254('0x51')]=function(_0x14aaa7,_0x422859,_0x451687){var _0x2e4514={};var _0x29a925={};var _0xfaf49;var _0x153ae5;return db['DeskConfiguration'][_0x8254('0x4c')]({'where':{'id':_0x14aaa7['params']['id']}})['then'](handleEntityNotFound(_0x422859,null))[_0x8254('0x25')](function(_0x4bcfc9){if(_0x4bcfc9){_0xfaf49=_0x4bcfc9;_0x29a925[_0x8254('0x31')]=_['keys'](db['DeskField'][_0x8254('0x47')]);_0x29a925[_0x8254('0x32')]=_[_0x8254('0x33')](_0x14aaa7[_0x8254('0x32')]);_0x29a925[_0x8254('0x3b')]=_[_0x8254('0x34')](_0x29a925[_0x8254('0x31')],_0x29a925[_0x8254('0x32')]);_0x2e4514['attributes']=_['intersection'](_0x29a925['model'],qs[_0x8254('0x36')](_0x14aaa7[_0x8254('0x32')][_0x8254('0x36')]));_0x2e4514[_0x8254('0x35')]=_0x2e4514[_0x8254('0x35')][_0x8254('0x4e')]?_0x2e4514['attributes']:_0x29a925[_0x8254('0x31')];_0x2e4514[_0x8254('0x39')]=qs[_0x8254('0x3a')](_0x14aaa7[_0x8254('0x32')]['sort']);_0x2e4514[_0x8254('0x3e')]=qs[_0x8254('0x3b')](_[_0x8254('0x3c')](_0x14aaa7[_0x8254('0x32')],_0x29a925[_0x8254('0x3b')]));if(_0x14aaa7[_0x8254('0x32')][_0x8254('0x3d')]){_0x2e4514[_0x8254('0x3e')]=_[_0x8254('0x3f')](_0x2e4514[_0x8254('0x3e')],{'$or':_[_0x8254('0x2d')](_0x2e4514['attributes'],function(_0x530fd2){var _0x5998d6={};_0x5998d6[_0x530fd2]={'$like':'%'+_0x14aaa7[_0x8254('0x32')][_0x8254('0x3d')]+'%'};return _0x5998d6;})});}_0x2e4514=_[_0x8254('0x3f')]({},_0x2e4514,_0x14aaa7[_0x8254('0x41')]);return _0xfaf49[_0x8254('0x51')](_0x2e4514);}})[_0x8254('0x25')](function(_0x3e6d04){if(_0x3e6d04){_0x153ae5=_0x3e6d04[_0x8254('0x4e')];if(!_0x14aaa7[_0x8254('0x32')][_0x8254('0x37')](_0x8254('0x38'))){_0x2e4514[_0x8254('0x1e')]=qs[_0x8254('0x1e')](_0x14aaa7[_0x8254('0x32')]['limit']);_0x2e4514[_0x8254('0x1d')]=qs['offset'](_0x14aaa7['query'][_0x8254('0x1d')]);}return _0xfaf49[_0x8254('0x51')](_0x2e4514);}})['then'](function(_0x5e5840){if(_0x5e5840){return _0x5e5840?{'count':_0x153ae5,'rows':_0x5e5840}:null;}})[_0x8254('0x25')](respondWithResult(_0x422859,null))['catch'](handleError(_0x422859,null));};exports[_0x8254('0x52')]=function(_0x1036a6,_0x28332c,_0x14c069){var _0x1d1794={};var _0x4661d2={};var _0x441f3d;var _0x39b17e;return db[_0x8254('0x2e')][_0x8254('0x4c')]({'where':{'id':_0x1036a6['params']['id']}})['then'](handleEntityNotFound(_0x28332c,null))[_0x8254('0x25')](function(_0xe906db){if(_0xe906db){_0x441f3d=_0xe906db;_0x4661d2[_0x8254('0x31')]=_[_0x8254('0x33')](db[_0x8254('0x53')][_0x8254('0x47')]);_0x4661d2['query']=_['keys'](_0x1036a6[_0x8254('0x32')]);_0x4661d2['filters']=_[_0x8254('0x34')](_0x4661d2[_0x8254('0x31')],_0x4661d2[_0x8254('0x32')]);_0x1d1794[_0x8254('0x35')]=_[_0x8254('0x34')](_0x4661d2['model'],qs[_0x8254('0x36')](_0x1036a6['query'][_0x8254('0x36')]));_0x1d1794[_0x8254('0x35')]=_0x1d1794['attributes'][_0x8254('0x4e')]?_0x1d1794[_0x8254('0x35')]:_0x4661d2['model'];_0x1d1794[_0x8254('0x39')]=qs['sort'](_0x1036a6['query'][_0x8254('0x3a')]);_0x1d1794[_0x8254('0x3e')]=qs[_0x8254('0x3b')](_[_0x8254('0x3c')](_0x1036a6['query'],_0x4661d2['filters']));if(_0x1036a6['query'][_0x8254('0x3d')]){_0x1d1794[_0x8254('0x3e')]=_[_0x8254('0x3f')](_0x1d1794[_0x8254('0x3e')],{'$or':_[_0x8254('0x2d')](_0x1d1794[_0x8254('0x35')],function(_0x5a368e){var _0x45e971={};_0x45e971[_0x5a368e]={'$like':'%'+_0x1036a6[_0x8254('0x32')][_0x8254('0x3d')]+'%'};return _0x45e971;})});}_0x1d1794=_[_0x8254('0x3f')]({},_0x1d1794,_0x1036a6[_0x8254('0x41')]);return _0x441f3d[_0x8254('0x52')](_0x1d1794);}})[_0x8254('0x25')](function(_0x4e0172){if(_0x4e0172){_0x39b17e=_0x4e0172[_0x8254('0x4e')];if(!_0x1036a6[_0x8254('0x32')][_0x8254('0x37')](_0x8254('0x38'))){_0x1d1794[_0x8254('0x1e')]=qs[_0x8254('0x1e')](_0x1036a6[_0x8254('0x32')][_0x8254('0x1e')]);_0x1d1794[_0x8254('0x1d')]=qs['offset'](_0x1036a6[_0x8254('0x32')][_0x8254('0x1d')]);}return _0x441f3d[_0x8254('0x52')](_0x1d1794);}})['then'](function(_0x25a5cb){if(_0x25a5cb){return _0x25a5cb?{'count':_0x39b17e,'rows':_0x25a5cb}:null;}})['then'](respondWithResult(_0x28332c,null))[_0x8254('0x49')](handleError(_0x28332c,null));};exports[_0x8254('0x54')]=function(_0x587c9e,_0x2c5856,_0x5a570d){if(_0x587c9e[_0x8254('0x4b')]['id']){delete _0x587c9e[_0x8254('0x4b')]['id'];}return db[_0x8254('0x2e')][_0x8254('0x4c')]({'where':{'id':_0x587c9e[_0x8254('0x46')]['id']}})['then'](handleEntityNotFound(_0x2c5856,null))[_0x8254('0x25')](function(_0x1f25f7){if(_0x1f25f7){return _0x1f25f7['setTags'](_0x587c9e[_0x8254('0x4b')]['ids']||[]);}return null;})[_0x8254('0x25')](respondWithResult(_0x2c5856,null))[_0x8254('0x49')](handleError(_0x2c5856,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 704926b..a1e87b3 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 _0xb064=['./intDeskConfiguration.attributes','int_desk_configurations','lodash','util','api','moment','bluebird','path','rimraf'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb064,0x18e));var _0x4b06=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0xb064[_0x15bc81];return _0x59440e;};'use strict';var _=require(_0x4b06('0x0'));var util=require(_0x4b06('0x1'));var logger=require('../../config/logger')(_0x4b06('0x2'));var moment=require(_0x4b06('0x3'));var BPromise=require(_0x4b06('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4b06('0x5'));var rimraf=require(_0x4b06('0x6'));var config=require('../../config/environment');var attributes=require(_0x4b06('0x7'));module['exports']=function(_0x4a435e,_0x30058e){return _0x4a435e['define']('DeskConfiguration',attributes,{'tableName':_0x4b06('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb92f=['exports','DeskConfiguration','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','./intDeskConfiguration.attributes'];(function(_0x1196ce,_0x1c2306){var _0x2c505b=function(_0x237963){while(--_0x237963){_0x1196ce['push'](_0x1196ce['shift']());}};_0x2c505b(++_0x1c2306);}(_0xb92f,0x192));var _0xfb92=function(_0x4090bc,_0x3cac1b){_0x4090bc=_0x4090bc-0x0;var _0x132d1f=_0xb92f[_0x4090bc];return _0x132d1f;};'use strict';var _=require(_0xfb92('0x0'));var util=require(_0xfb92('0x1'));var logger=require(_0xfb92('0x2'))(_0xfb92('0x3'));var moment=require(_0xfb92('0x4'));var BPromise=require(_0xfb92('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xfb92('0x6'));var attributes=require(_0xfb92('0x7'));module[_0xfb92('0x8')]=function(_0x44b02e,_0x6b0e83){return _0x44b02e['define'](_0xfb92('0x9'),attributes,{'tableName':'int_desk_configurations','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 d0126d0..6ed3c64 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 _0xee7f=['request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0xea6036,_0x524b9c){var _0xcf8f1=function(_0x235363){while(--_0x235363){_0xea6036['push'](_0xea6036['shift']());}};_0xcf8f1(++_0x524b9c);}(_0xee7f,0x18a));var _0xfee7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xee7f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xfee7('0x0'));var util=require(_0xfee7('0x1'));var moment=require(_0xfee7('0x2'));var BPromise=require(_0xfee7('0x3'));var rs=require(_0xfee7('0x4'));var fs=require('fs');var Redis=require(_0xfee7('0x5'));var db=require(_0xfee7('0x6'))['db'];var utils=require(_0xfee7('0x7'));var logger=require(_0xfee7('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfee7('0x9'));var client=jayson['client'][_0xfee7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x23b1e9,_0x7b164a,_0x4615c6){return new BPromise(function(_0x2da3e0,_0xf68beb){return client[_0xfee7('0xb')](_0x23b1e9,_0x4615c6)[_0xfee7('0xc')](function(_0x18ddbe){logger[_0xfee7('0xd')](_0xfee7('0xe'),_0x7b164a,'request\x20sent');logger['debug'](_0xfee7('0xf'),_0x7b164a,'request\x20sent',JSON[_0xfee7('0x10')](_0x18ddbe));if(_0x18ddbe[_0xfee7('0x11')]){if(_0x18ddbe['error'][_0xfee7('0x12')]===0x1f4){logger['error'](_0xfee7('0xe'),_0x7b164a,_0x18ddbe[_0xfee7('0x11')]['message']);return _0xf68beb(_0x18ddbe[_0xfee7('0x11')]['message']);}logger['error'](_0xfee7('0xe'),_0x7b164a,_0x18ddbe['error'][_0xfee7('0x13')]);return _0x2da3e0(_0x18ddbe[_0xfee7('0x11')][_0xfee7('0x13')]);}else{logger['info'](_0xfee7('0xe'),_0x7b164a,_0xfee7('0x14'));_0x2da3e0(_0x18ddbe[_0xfee7('0x15')]['message']);}})[_0xfee7('0x16')](function(_0x118509){logger[_0xfee7('0x11')](_0xfee7('0xe'),_0x7b164a,_0x118509);_0xf68beb(_0x118509);});});} \ No newline at end of file +var _0x0901=['../../config/environment','jayson/promise','client','http','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4be835,_0x55a2d8){var _0x3687ed=function(_0x3cb1a0){while(--_0x3cb1a0){_0x4be835['push'](_0x4be835['shift']());}};_0x3687ed(++_0x55a2d8);}(_0x0901,0xb6));var _0x1090=function(_0x1d1533,_0x553178){_0x1d1533=_0x1d1533-0x0;var _0x168fdf=_0x0901[_0x1d1533];return _0x168fdf;};'use strict';var _=require(_0x1090('0x0'));var util=require('util');var moment=require(_0x1090('0x1'));var BPromise=require(_0x1090('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1090('0x3'))['db'];var utils=require(_0x1090('0x4'));var logger=require(_0x1090('0x5'))(_0x1090('0x6'));var config=require(_0x1090('0x7'));var jayson=require(_0x1090('0x8'));var client=jayson[_0x1090('0x9')][_0x1090('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f5276,_0x133377,_0x45ee35){return new BPromise(function(_0x4a3eb5,_0x24d024){return client[_0x1090('0xb')](_0x4f5276,_0x45ee35)['then'](function(_0x49da6b){logger[_0x1090('0xc')](_0x1090('0xd'),_0x133377,_0x1090('0xe'));logger['debug'](_0x1090('0xf'),_0x133377,_0x1090('0xe'),JSON[_0x1090('0x10')](_0x49da6b));if(_0x49da6b[_0x1090('0x11')]){if(_0x49da6b[_0x1090('0x11')][_0x1090('0x12')]===0x1f4){logger[_0x1090('0x11')](_0x1090('0xd'),_0x133377,_0x49da6b[_0x1090('0x11')][_0x1090('0x13')]);return _0x24d024(_0x49da6b[_0x1090('0x11')][_0x1090('0x13')]);}logger['error'](_0x1090('0xd'),_0x133377,_0x49da6b[_0x1090('0x11')][_0x1090('0x13')]);return _0x4a3eb5(_0x49da6b['error']['message']);}else{logger['info'](_0x1090('0xd'),_0x133377,_0x1090('0xe'));_0x4a3eb5(_0x49da6b['result']['message']);}})[_0x1090('0x14')](function(_0x2744fb){logger[_0x1090('0x11')](_0x1090('0xd'),_0x133377,_0x2744fb);_0x24d024(_0x2744fb);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 105f515..c57eb1f 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 _0x70b7=['delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDeskField.controller','get','index','isAuthenticated','post','create','put','/:id','update'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x70b7,0x1e9));var _0x770b=function(_0x38c652,_0x1ea1b7){_0x38c652=_0x38c652-0x0;var _0x218a37=_0x70b7[_0x38c652];return _0x218a37;};'use strict';var multer=require('multer');var util=require(_0x770b('0x0'));var path=require('path');var timeout=require(_0x770b('0x1'));var express=require(_0x770b('0x2'));var router=express[_0x770b('0x3')]();var fs_extra=require(_0x770b('0x4'));var auth=require(_0x770b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x770b('0x6'));router[_0x770b('0x7')]('/',auth['isAuthenticated'](),controller[_0x770b('0x8')]);router['get']('/:id',auth[_0x770b('0x9')](),controller['show']);router[_0x770b('0xa')]('/',auth[_0x770b('0x9')](),controller[_0x770b('0xb')]);router[_0x770b('0xc')](_0x770b('0xd'),auth[_0x770b('0x9')](),controller[_0x770b('0xe')]);router[_0x770b('0xf')](_0x770b('0xd'),auth[_0x770b('0x9')](),controller[_0x770b('0x10')]);module[_0x770b('0x11')]=router; \ No newline at end of file +var _0x8fa1=['get','post','create','update','delete','/:id','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index'];(function(_0x550013,_0x3a7993){var _0x2882fd=function(_0x3b4b94){while(--_0x3b4b94){_0x550013['push'](_0x550013['shift']());}};_0x2882fd(++_0x3a7993);}(_0x8fa1,0x15e));var _0x18fa=function(_0x273999,_0x2e1040){_0x273999=_0x273999-0x0;var _0x25e657=_0x8fa1[_0x273999];return _0x25e657;};'use strict';var multer=require(_0x18fa('0x0'));var util=require('util');var path=require(_0x18fa('0x1'));var timeout=require(_0x18fa('0x2'));var express=require(_0x18fa('0x3'));var router=express[_0x18fa('0x4')]();var fs_extra=require(_0x18fa('0x5'));var auth=require(_0x18fa('0x6'));var interaction=require(_0x18fa('0x7'));var config=require(_0x18fa('0x8'));var controller=require('./intDeskField.controller');router['get']('/',auth[_0x18fa('0x9')](),controller[_0x18fa('0xa')]);router[_0x18fa('0xb')]('/:id',auth[_0x18fa('0x9')](),controller['show']);router[_0x18fa('0xc')]('/',auth[_0x18fa('0x9')](),controller[_0x18fa('0xd')]);router['put']('/:id',auth[_0x18fa('0x9')](),controller[_0x18fa('0xe')]);router[_0x18fa('0xf')](_0x18fa('0x10'),auth[_0x18fa('0x9')](),controller[_0x18fa('0x11')]);module[_0x18fa('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index c95ed49..69fa9cb 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 _0xe471=['STRING','ENUM','BOOLEAN','exports','string','variable','customVariable','keyValue','picklist'];(function(_0x2b12b0,_0x4480ce){var _0x221d21=function(_0xbdc428){while(--_0xbdc428){_0x2b12b0['push'](_0x2b12b0['shift']());}};_0x221d21(++_0x4480ce);}(_0xe471,0x1e0));var _0x1e47=function(_0x477302,_0x5c42b9){_0x477302=_0x477302-0x0;var _0x233dd4=_0xe471[_0x477302];return _0x233dd4;};'use strict';var Sequelize=require('sequelize');module[_0x1e47('0x0')]={'type':{'type':Sequelize['ENUM'](_0x1e47('0x1'),_0x1e47('0x2'),_0x1e47('0x3'),_0x1e47('0x4'),_0x1e47('0x5')),'defaultValue':_0x1e47('0x1')},'content':{'type':Sequelize[_0x1e47('0x6')]},'key':{'type':Sequelize[_0x1e47('0x6')]},'keyType':{'type':Sequelize[_0x1e47('0x7')](_0x1e47('0x1'),_0x1e47('0x2'),_0x1e47('0x3'))},'keyContent':{'type':Sequelize[_0x1e47('0x6')]},'idField':{'type':Sequelize[_0x1e47('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x1e47('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x414f=['picklist','string','STRING','customVariable','sequelize','exports','ENUM','variable','keyValue'];(function(_0x130d82,_0x25f49b){var _0x112070=function(_0x5795ee){while(--_0x5795ee){_0x130d82['push'](_0x130d82['shift']());}};_0x112070(++_0x25f49b);}(_0x414f,0xc1));var _0xf414=function(_0x29cb61,_0x494484){_0x29cb61=_0x29cb61-0x0;var _0x21d3e0=_0x414f[_0x29cb61];return _0x21d3e0;};'use strict';var Sequelize=require(_0xf414('0x0'));module[_0xf414('0x1')]={'type':{'type':Sequelize[_0xf414('0x2')]('string',_0xf414('0x3'),'customVariable',_0xf414('0x4'),_0xf414('0x5')),'defaultValue':_0xf414('0x6')},'content':{'type':Sequelize[_0xf414('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xf414('0x2')](_0xf414('0x6'),_0xf414('0x3'),_0xf414('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xf414('0x7')]},'nameField':{'type':Sequelize[_0xf414('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf414('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 965cf32..319c81c 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 _0x5228=['destroy','then','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','DeskField','include','findAll','rows','catch','show','params','length','includeAll','create','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update'];(function(_0x437984,_0x418580){var _0x1798e6=function(_0x536560){while(--_0x536560){_0x437984['push'](_0x437984['shift']());}};_0x1798e6(++_0x418580);}(_0x5228,0x10e));var _0x8522=function(_0x3de42c,_0x1be1cb){_0x3de42c=_0x3de42c-0x0;var _0xf991c1=_0x5228[_0x3de42c];return _0xf991c1;};'use strict';var emlformat=require(_0x8522('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8522('0x1'));var jsonpatch=require(_0x8522('0x2'));var rp=require(_0x8522('0x3'));var moment=require(_0x8522('0x4'));var BPromise=require(_0x8522('0x5'));var Mustache=require(_0x8522('0x6'));var util=require(_0x8522('0x7'));var path=require(_0x8522('0x8'));var sox=require('sox');var csv=require(_0x8522('0x9'));var ejs=require(_0x8522('0xa'));var fs=require('fs');var fs_extra=require(_0x8522('0xb'));var _=require(_0x8522('0xc'));var squel=require(_0x8522('0xd'));var crypto=require(_0x8522('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x8522('0xf'));var toCsv=require(_0x8522('0x9'));var querystring=require(_0x8522('0x10'));var Papa=require('papaparse');var Redis=require(_0x8522('0x11'));var authService=require(_0x8522('0x12'));var qs=require(_0x8522('0x13'));var as=require(_0x8522('0x14'));var hardwareService=require(_0x8522('0x15'));var logger=require(_0x8522('0x16'))(_0x8522('0x17'));var utils=require('../../config/utils');var config=require(_0x8522('0x18'));var licenseUtil=require(_0x8522('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x453808,_0x3081b1){_0x3081b1=_0x3081b1||0xcc;return function(_0x32c74a){if(_0x32c74a){return _0x453808[_0x8522('0x1a')](_0x3081b1);}return _0x453808[_0x8522('0x1b')](_0x3081b1)[_0x8522('0x1c')]();};}function respondWithResult(_0x51d354,_0x5b9a30){_0x5b9a30=_0x5b9a30||0xc8;return function(_0x4c6a85){if(_0x4c6a85){return _0x51d354[_0x8522('0x1b')](_0x5b9a30)['json'](_0x4c6a85);}};}function respondWithFilteredResult(_0x368e7e,_0x317e52){return function(_0x4dfd8a){if(_0x4dfd8a){var _0xdadf62=typeof _0x317e52[_0x8522('0x1d')]===_0x8522('0x1e')&&typeof _0x317e52[_0x8522('0x1f')]===_0x8522('0x1e');var _0x5cab38=_0x4dfd8a['count'];var _0x426f74=_0xdadf62?0x0:_0x317e52[_0x8522('0x1d')];var _0x5da81f=_0xdadf62?_0x4dfd8a[_0x8522('0x20')]:_0x317e52[_0x8522('0x1d')]+_0x317e52[_0x8522('0x1f')];var _0x1ea53e;if(_0x5da81f>=_0x5cab38){_0x5da81f=_0x5cab38;_0x1ea53e=0xc8;}else{_0x1ea53e=0xce;}_0x368e7e[_0x8522('0x1b')](_0x1ea53e);return _0x368e7e['set'](_0x8522('0x21'),_0x426f74+'-'+_0x5da81f+'/'+_0x5cab38)[_0x8522('0x22')](_0x4dfd8a);}return null;};}function patchUpdates(_0x4a8dae){return function(_0x982ef6){try{jsonpatch[_0x8522('0x23')](_0x982ef6,_0x4a8dae,!![]);}catch(_0xfa45d1){return BPromise[_0x8522('0x24')](_0xfa45d1);}return _0x982ef6['save']();};}function saveUpdates(_0x350c8c,_0x86290d){return function(_0xa45dd0){if(_0xa45dd0){return _0xa45dd0[_0x8522('0x25')](_0x350c8c)['then'](function(_0x25b57d){return _0x25b57d;});}return null;};}function removeEntity(_0x3775bf,_0x5f3598){return function(_0x285295){if(_0x285295){return _0x285295[_0x8522('0x26')]()[_0x8522('0x27')](function(){_0x3775bf[_0x8522('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x466e73,_0x3630af){return function(_0x5b426e){if(!_0x5b426e){_0x466e73[_0x8522('0x1a')](0x194);}return _0x5b426e;};}function handleError(_0x2398ae,_0x569ec8){_0x569ec8=_0x569ec8||0x1f4;return function(_0x1df1d3){logger[_0x8522('0x28')](_0x1df1d3[_0x8522('0x29')]);if(_0x1df1d3['name']){delete _0x1df1d3[_0x8522('0x2a')];}_0x2398ae[_0x8522('0x1b')](_0x569ec8)[_0x8522('0x2b')](_0x1df1d3);};}exports['index']=function(_0x6c28c8,_0x4e4cee){var _0x2e4cd9={},_0x306728={},_0x54a574={'count':0x0,'rows':[]};var _0x1fd209=_['map'](db['DeskField'][_0x8522('0x2c')],function(_0x55ea22){return{'name':_0x55ea22[_0x8522('0x2d')],'type':_0x55ea22[_0x8522('0x2e')][_0x8522('0x2f')]};});_0x306728[_0x8522('0x30')]=_[_0x8522('0x31')](_0x1fd209,_0x8522('0x2a'));_0x306728[_0x8522('0x32')]=_[_0x8522('0x33')](_0x6c28c8[_0x8522('0x32')]);_0x306728[_0x8522('0x34')]=_['intersection'](_0x306728['model'],_0x306728[_0x8522('0x32')]);_0x2e4cd9['attributes']=_[_0x8522('0x35')](_0x306728[_0x8522('0x30')],qs['fields'](_0x6c28c8[_0x8522('0x32')][_0x8522('0x36')]));_0x2e4cd9[_0x8522('0x37')]=_0x2e4cd9[_0x8522('0x37')]['length']?_0x2e4cd9[_0x8522('0x37')]:_0x306728['model'];if(!_0x6c28c8[_0x8522('0x32')][_0x8522('0x38')](_0x8522('0x39'))){_0x2e4cd9['limit']=qs['limit'](_0x6c28c8[_0x8522('0x32')][_0x8522('0x1f')]);_0x2e4cd9[_0x8522('0x1d')]=qs[_0x8522('0x1d')](_0x6c28c8[_0x8522('0x32')][_0x8522('0x1d')]);}_0x2e4cd9[_0x8522('0x3a')]=qs[_0x8522('0x3b')](_0x6c28c8[_0x8522('0x32')]['sort']);_0x2e4cd9['where']=qs[_0x8522('0x34')](_['pick'](_0x6c28c8[_0x8522('0x32')],_0x306728[_0x8522('0x34')]),_0x1fd209);if(_0x6c28c8[_0x8522('0x32')]['filter']){_0x2e4cd9[_0x8522('0x3c')]=_[_0x8522('0x3d')](_0x2e4cd9[_0x8522('0x3c')],{'$or':_[_0x8522('0x31')](_0x1fd209,function(_0x384b42){if(_0x384b42['type']!==_0x8522('0x3e')){var _0x27e2cc={};_0x27e2cc[_0x384b42[_0x8522('0x2a')]]={'$like':'%'+_0x6c28c8[_0x8522('0x32')][_0x8522('0x3f')]+'%'};return _0x27e2cc;}})});}_0x2e4cd9=_[_0x8522('0x3d')]({},_0x2e4cd9,_0x6c28c8[_0x8522('0x40')]);var _0x32310c={'where':_0x2e4cd9[_0x8522('0x3c')]};return db[_0x8522('0x41')][_0x8522('0x20')](_0x32310c)['then'](function(_0x75f321){_0x54a574['count']=_0x75f321;if(_0x6c28c8[_0x8522('0x32')]['includeAll']){_0x2e4cd9[_0x8522('0x42')]=[{'all':!![]}];}return db['DeskField'][_0x8522('0x43')](_0x2e4cd9);})[_0x8522('0x27')](function(_0x8c3f4c){_0x54a574[_0x8522('0x44')]=_0x8c3f4c;return _0x54a574;})[_0x8522('0x27')](respondWithFilteredResult(_0x4e4cee,_0x2e4cd9))[_0x8522('0x45')](handleError(_0x4e4cee,null));};exports[_0x8522('0x46')]=function(_0x3553e7,_0x441e2e){var _0x4cb5dc={'raw':!![],'where':{'id':_0x3553e7[_0x8522('0x47')]['id']}},_0x6d323c={};_0x6d323c['model']=_[_0x8522('0x33')](db[_0x8522('0x41')][_0x8522('0x2c')]);_0x6d323c[_0x8522('0x32')]=_['keys'](_0x3553e7[_0x8522('0x32')]);_0x6d323c[_0x8522('0x34')]=_[_0x8522('0x35')](_0x6d323c['model'],_0x6d323c[_0x8522('0x32')]);_0x4cb5dc[_0x8522('0x37')]=_['intersection'](_0x6d323c['model'],qs[_0x8522('0x36')](_0x3553e7[_0x8522('0x32')][_0x8522('0x36')]));_0x4cb5dc[_0x8522('0x37')]=_0x4cb5dc[_0x8522('0x37')][_0x8522('0x48')]?_0x4cb5dc[_0x8522('0x37')]:_0x6d323c['model'];if(_0x3553e7['query'][_0x8522('0x49')]){_0x4cb5dc['include']=[{'all':!![]}];}_0x4cb5dc=_[_0x8522('0x3d')]({},_0x4cb5dc,_0x3553e7[_0x8522('0x40')]);return db[_0x8522('0x41')]['find'](_0x4cb5dc)[_0x8522('0x27')](handleEntityNotFound(_0x441e2e,null))[_0x8522('0x27')](respondWithResult(_0x441e2e,null))[_0x8522('0x45')](handleError(_0x441e2e,null));};exports[_0x8522('0x4a')]=function(_0x5f0ac0,_0x23c39f){return db['DeskField'][_0x8522('0x4a')](_0x5f0ac0[_0x8522('0x4b')],{})[_0x8522('0x27')](respondWithResult(_0x23c39f,0xc9))[_0x8522('0x45')](handleError(_0x23c39f,null));};exports['update']=function(_0x49bb1f,_0x11facb){if(_0x49bb1f[_0x8522('0x4b')]['id']){delete _0x49bb1f[_0x8522('0x4b')]['id'];}return db[_0x8522('0x41')][_0x8522('0x4c')]({'where':{'id':_0x49bb1f[_0x8522('0x47')]['id']}})[_0x8522('0x27')](handleEntityNotFound(_0x11facb,null))[_0x8522('0x27')](saveUpdates(_0x49bb1f[_0x8522('0x4b')],null))['then'](respondWithResult(_0x11facb,null))['catch'](handleError(_0x11facb,null));};exports[_0x8522('0x26')]=function(_0x3f7102,_0x271484){return db[_0x8522('0x41')][_0x8522('0x4c')]({'where':{'id':_0x3f7102[_0x8522('0x47')]['id']}})[_0x8522('0x27')](handleEntityNotFound(_0x271484,null))[_0x8522('0x27')](removeEntity(_0x271484,null))[_0x8522('0x45')](handleError(_0x271484,null));}; \ No newline at end of file +var _0x2384=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','error','stack','name','index','map','DeskField','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','body','update','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x2384,0x1aa));var _0x4238=function(_0x3bd96b,_0x327c1f){_0x3bd96b=_0x3bd96b-0x0;var _0xa5b353=_0x2384[_0x3bd96b];return _0xa5b353;};'use strict';var emlformat=require(_0x4238('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4238('0x1'));var jsonpatch=require(_0x4238('0x2'));var rp=require(_0x4238('0x3'));var moment=require(_0x4238('0x4'));var BPromise=require(_0x4238('0x5'));var Mustache=require('mustache');var util=require(_0x4238('0x6'));var path=require('path');var sox=require(_0x4238('0x7'));var csv=require(_0x4238('0x8'));var ejs=require(_0x4238('0x9'));var fs=require('fs');var fs_extra=require(_0x4238('0xa'));var _=require(_0x4238('0xb'));var squel=require(_0x4238('0xc'));var crypto=require(_0x4238('0xd'));var jsforce=require(_0x4238('0xe'));var deskjs=require(_0x4238('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4238('0x10'));var Papa=require(_0x4238('0x11'));var Redis=require('ioredis');var authService=require(_0x4238('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4238('0x13'));var logger=require(_0x4238('0x14'))(_0x4238('0x15'));var utils=require(_0x4238('0x16'));var config=require(_0x4238('0x17'));var licenseUtil=require(_0x4238('0x18'));var db=require(_0x4238('0x19'))['db'];function respondWithStatusCode(_0x22d54a,_0x121264){_0x121264=_0x121264||0xcc;return function(_0x43841f){if(_0x43841f){return _0x22d54a[_0x4238('0x1a')](_0x121264);}return _0x22d54a[_0x4238('0x1b')](_0x121264)[_0x4238('0x1c')]();};}function respondWithResult(_0xd0ec7,_0x360b56){_0x360b56=_0x360b56||0xc8;return function(_0x2cc41c){if(_0x2cc41c){return _0xd0ec7['status'](_0x360b56)[_0x4238('0x1d')](_0x2cc41c);}};}function respondWithFilteredResult(_0x3afc0a,_0x55540f){return function(_0x468875){if(_0x468875){var _0x40c89f=typeof _0x55540f[_0x4238('0x1e')]==='undefined'&&typeof _0x55540f[_0x4238('0x1f')]===_0x4238('0x20');var _0x384361=_0x468875['count'];var _0x49e9ce=_0x40c89f?0x0:_0x55540f[_0x4238('0x1e')];var _0x4c24b6=_0x40c89f?_0x468875[_0x4238('0x21')]:_0x55540f[_0x4238('0x1e')]+_0x55540f[_0x4238('0x1f')];var _0x210f86;if(_0x4c24b6>=_0x384361){_0x4c24b6=_0x384361;_0x210f86=0xc8;}else{_0x210f86=0xce;}_0x3afc0a[_0x4238('0x1b')](_0x210f86);return _0x3afc0a[_0x4238('0x22')](_0x4238('0x23'),_0x49e9ce+'-'+_0x4c24b6+'/'+_0x384361)['json'](_0x468875);}return null;};}function patchUpdates(_0x44afc0){return function(_0x125072){try{jsonpatch[_0x4238('0x24')](_0x125072,_0x44afc0,!![]);}catch(_0x383392){return BPromise['reject'](_0x383392);}return _0x125072[_0x4238('0x25')]();};}function saveUpdates(_0x125107,_0x3816ce){return function(_0x39e021){if(_0x39e021){return _0x39e021['update'](_0x125107)[_0x4238('0x26')](function(_0x381e1f){return _0x381e1f;});}return null;};}function removeEntity(_0x4371c2,_0xc2f2fb){return function(_0x3b8352){if(_0x3b8352){return _0x3b8352['destroy']()[_0x4238('0x26')](function(){_0x4371c2[_0x4238('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc765e6,_0x39a4fc){return function(_0xf3319f){if(!_0xf3319f){_0xc765e6['sendStatus'](0x194);}return _0xf3319f;};}function handleError(_0xc9e7ad,_0x4bd7f5){_0x4bd7f5=_0x4bd7f5||0x1f4;return function(_0x4116d5){logger[_0x4238('0x27')](_0x4116d5[_0x4238('0x28')]);if(_0x4116d5[_0x4238('0x29')]){delete _0x4116d5[_0x4238('0x29')];}_0xc9e7ad[_0x4238('0x1b')](_0x4bd7f5)['send'](_0x4116d5);};}exports[_0x4238('0x2a')]=function(_0x2d68a9,_0x20647d){var _0x17f1f2={},_0x305184={},_0x49379e={'count':0x0,'rows':[]};var _0x499634=_[_0x4238('0x2b')](db[_0x4238('0x2c')][_0x4238('0x2d')],function(_0x5482d4){return{'name':_0x5482d4[_0x4238('0x2e')],'type':_0x5482d4['type'][_0x4238('0x2f')]};});_0x305184[_0x4238('0x30')]=_['map'](_0x499634,_0x4238('0x29'));_0x305184[_0x4238('0x31')]=_['keys'](_0x2d68a9[_0x4238('0x31')]);_0x305184['filters']=_[_0x4238('0x32')](_0x305184[_0x4238('0x30')],_0x305184['query']);_0x17f1f2['attributes']=_['intersection'](_0x305184[_0x4238('0x30')],qs[_0x4238('0x33')](_0x2d68a9['query'][_0x4238('0x33')]));_0x17f1f2['attributes']=_0x17f1f2[_0x4238('0x34')][_0x4238('0x35')]?_0x17f1f2['attributes']:_0x305184[_0x4238('0x30')];if(!_0x2d68a9[_0x4238('0x31')][_0x4238('0x36')](_0x4238('0x37'))){_0x17f1f2[_0x4238('0x1f')]=qs[_0x4238('0x1f')](_0x2d68a9[_0x4238('0x31')][_0x4238('0x1f')]);_0x17f1f2['offset']=qs[_0x4238('0x1e')](_0x2d68a9[_0x4238('0x31')][_0x4238('0x1e')]);}_0x17f1f2[_0x4238('0x38')]=qs[_0x4238('0x39')](_0x2d68a9[_0x4238('0x31')][_0x4238('0x39')]);_0x17f1f2[_0x4238('0x3a')]=qs['filters'](_[_0x4238('0x3b')](_0x2d68a9[_0x4238('0x31')],_0x305184[_0x4238('0x3c')]),_0x499634);if(_0x2d68a9[_0x4238('0x31')]['filter']){_0x17f1f2[_0x4238('0x3a')]=_[_0x4238('0x3d')](_0x17f1f2[_0x4238('0x3a')],{'$or':_[_0x4238('0x2b')](_0x499634,function(_0x30fd16){if(_0x30fd16['type']!==_0x4238('0x3e')){var _0xcf7935={};_0xcf7935[_0x30fd16[_0x4238('0x29')]]={'$like':'%'+_0x2d68a9[_0x4238('0x31')]['filter']+'%'};return _0xcf7935;}})});}_0x17f1f2=_[_0x4238('0x3d')]({},_0x17f1f2,_0x2d68a9[_0x4238('0x3f')]);var _0x4bc18e={'where':_0x17f1f2[_0x4238('0x3a')]};return db['DeskField']['count'](_0x4bc18e)['then'](function(_0x78a417){_0x49379e[_0x4238('0x21')]=_0x78a417;if(_0x2d68a9[_0x4238('0x31')][_0x4238('0x40')]){_0x17f1f2[_0x4238('0x41')]=[{'all':!![]}];}return db['DeskField'][_0x4238('0x42')](_0x17f1f2);})[_0x4238('0x26')](function(_0x184b9d){_0x49379e[_0x4238('0x43')]=_0x184b9d;return _0x49379e;})[_0x4238('0x26')](respondWithFilteredResult(_0x20647d,_0x17f1f2))[_0x4238('0x44')](handleError(_0x20647d,null));};exports[_0x4238('0x45')]=function(_0x4e2a4c,_0x121b84){var _0x151b41={'raw':!![],'where':{'id':_0x4e2a4c[_0x4238('0x46')]['id']}},_0x324f31={};_0x324f31['model']=_[_0x4238('0x47')](db[_0x4238('0x2c')][_0x4238('0x2d')]);_0x324f31['query']=_[_0x4238('0x47')](_0x4e2a4c[_0x4238('0x31')]);_0x324f31[_0x4238('0x3c')]=_[_0x4238('0x32')](_0x324f31[_0x4238('0x30')],_0x324f31[_0x4238('0x31')]);_0x151b41[_0x4238('0x34')]=_['intersection'](_0x324f31['model'],qs['fields'](_0x4e2a4c[_0x4238('0x31')][_0x4238('0x33')]));_0x151b41[_0x4238('0x34')]=_0x151b41['attributes'][_0x4238('0x35')]?_0x151b41['attributes']:_0x324f31['model'];if(_0x4e2a4c['query']['includeAll']){_0x151b41[_0x4238('0x41')]=[{'all':!![]}];}_0x151b41=_[_0x4238('0x3d')]({},_0x151b41,_0x4e2a4c[_0x4238('0x3f')]);return db[_0x4238('0x2c')][_0x4238('0x48')](_0x151b41)[_0x4238('0x26')](handleEntityNotFound(_0x121b84,null))[_0x4238('0x26')](respondWithResult(_0x121b84,null))[_0x4238('0x44')](handleError(_0x121b84,null));};exports['create']=function(_0x1feb9a,_0x12d395){return db[_0x4238('0x2c')]['create'](_0x1feb9a[_0x4238('0x49')],{})[_0x4238('0x26')](respondWithResult(_0x12d395,0xc9))[_0x4238('0x44')](handleError(_0x12d395,null));};exports[_0x4238('0x4a')]=function(_0x2c1c2d,_0x20f5fd){if(_0x2c1c2d['body']['id']){delete _0x2c1c2d[_0x4238('0x49')]['id'];}return db['DeskField'][_0x4238('0x48')]({'where':{'id':_0x2c1c2d[_0x4238('0x46')]['id']}})[_0x4238('0x26')](handleEntityNotFound(_0x20f5fd,null))[_0x4238('0x26')](saveUpdates(_0x2c1c2d[_0x4238('0x49')],null))[_0x4238('0x26')](respondWithResult(_0x20f5fd,null))[_0x4238('0x44')](handleError(_0x20f5fd,null));};exports['destroy']=function(_0x550c70,_0x1427c0){return db[_0x4238('0x2c')][_0x4238('0x48')]({'where':{'id':_0x550c70[_0x4238('0x46')]['id']}})['then'](handleEntityNotFound(_0x1427c0,null))['then'](removeEntity(_0x1427c0,null))['catch'](handleError(_0x1427c0,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index f7e70eb..ea6b145 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 _0x6a07=['DeskField','idField','FieldId','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0x6a07,0x123));var _0x76a0=function(_0x5d2a31,_0x4920fb){_0x5d2a31=_0x5d2a31-0x0;var _0x577a7e=_0x6a07[_0x5d2a31];return _0x577a7e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x76a0('0x0'))(_0x76a0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x76a0('0x2'));var fs=require('fs');var path=require(_0x76a0('0x3'));var rimraf=require(_0x76a0('0x4'));var config=require(_0x76a0('0x5'));var attributes=require(_0x76a0('0x6'));module[_0x76a0('0x7')]=function(_0x142a6c,_0x2e69c1){return _0x142a6c[_0x76a0('0x8')](_0x76a0('0x9'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0x76a0('0xa'),_0x76a0('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xda68=['exports','define','int_desk_fields','desk_unique_index','idField','lodash','util','../../config/logger','api','bluebird','request-promise','path','./intDeskField.attributes'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0xda68,0xd5));var _0x8da6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xda68[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8da6('0x0'));var util=require(_0x8da6('0x1'));var logger=require(_0x8da6('0x2'))(_0x8da6('0x3'));var moment=require('moment');var BPromise=require(_0x8da6('0x4'));var rp=require(_0x8da6('0x5'));var fs=require('fs');var path=require(_0x8da6('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8da6('0x7'));module[_0x8da6('0x8')]=function(_0x465ace,_0x32a05c){return _0x465ace[_0x8da6('0x9')]('DeskField',attributes,{'tableName':_0x8da6('0xa'),'paranoid':![],'indexes':[{'name':_0x8da6('0xb'),'fields':[_0x8da6('0xc'),'FieldId'],'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 110fea2..506cfa1 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 _0x2ab4=['info','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','DeskField,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request'];(function(_0x33000b,_0x51e2c6){var _0x1b9759=function(_0x73cf28){while(--_0x73cf28){_0x33000b['push'](_0x33000b['shift']());}};_0x1b9759(++_0x51e2c6);}(_0x2ab4,0xa4));var _0x42ab=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x2ab4[_0x1cc8fe];return _0x230054;};'use strict';var _=require('lodash');var util=require(_0x42ab('0x0'));var moment=require(_0x42ab('0x1'));var BPromise=require(_0x42ab('0x2'));var rs=require(_0x42ab('0x3'));var fs=require('fs');var Redis=require(_0x42ab('0x4'));var db=require(_0x42ab('0x5'))['db'];var utils=require(_0x42ab('0x6'));var logger=require(_0x42ab('0x7'))(_0x42ab('0x8'));var config=require('../../config/environment');var jayson=require(_0x42ab('0x9'));var client=jayson['client'][_0x42ab('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x43e384,_0x4799cc,_0x5e96ae){return new BPromise(function(_0x4a6b68,_0x58c27d){return client[_0x42ab('0xb')](_0x43e384,_0x5e96ae)['then'](function(_0x599719){logger[_0x42ab('0xc')]('DeskField,\x20%s,\x20%s',_0x4799cc,_0x42ab('0xd'));logger[_0x42ab('0xe')](_0x42ab('0xf'),_0x4799cc,_0x42ab('0xd'),JSON[_0x42ab('0x10')](_0x599719));if(_0x599719['error']){if(_0x599719[_0x42ab('0x11')]['code']===0x1f4){logger[_0x42ab('0x11')](_0x42ab('0x12'),_0x4799cc,_0x599719[_0x42ab('0x11')]['message']);return _0x58c27d(_0x599719[_0x42ab('0x11')][_0x42ab('0x13')]);}logger['error']('DeskField,\x20%s,\x20%s',_0x4799cc,_0x599719[_0x42ab('0x11')][_0x42ab('0x13')]);return _0x4a6b68(_0x599719[_0x42ab('0x11')][_0x42ab('0x13')]);}else{logger[_0x42ab('0xc')]('DeskField,\x20%s,\x20%s',_0x4799cc,_0x42ab('0xd'));_0x4a6b68(_0x599719[_0x42ab('0x14')][_0x42ab('0x13')]);}})[_0x42ab('0x15')](function(_0xd044a5){logger['error'](_0x42ab('0x12'),_0x4799cc,_0xd044a5);_0x58c27d(_0xd044a5);});});} \ No newline at end of file +var _0xcb5a=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','http','request','then','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0xcb5a,0xe5));var _0xacb5=function(_0x515d39,_0x263b44){_0x515d39=_0x515d39-0x0;var _0x1bc318=_0xcb5a[_0x515d39];return _0x1bc318;};'use strict';var _=require(_0xacb5('0x0'));var util=require('util');var moment=require(_0xacb5('0x1'));var BPromise=require(_0xacb5('0x2'));var rs=require(_0xacb5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xacb5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xacb5('0x5'))(_0xacb5('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xacb5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b67f,_0x259226,_0x558958){return new BPromise(function(_0x13a2c1,_0x500e3f){return client[_0xacb5('0x8')](_0x15b67f,_0x558958)[_0xacb5('0x9')](function(_0x535c44){logger['info'](_0xacb5('0xa'),_0x259226,_0xacb5('0xb'));logger[_0xacb5('0xc')](_0xacb5('0xd'),_0x259226,'request\x20sent',JSON[_0xacb5('0xe')](_0x535c44));if(_0x535c44[_0xacb5('0xf')]){if(_0x535c44['error'][_0xacb5('0x10')]===0x1f4){logger['error'](_0xacb5('0xa'),_0x259226,_0x535c44[_0xacb5('0xf')][_0xacb5('0x11')]);return _0x500e3f(_0x535c44[_0xacb5('0xf')]['message']);}logger[_0xacb5('0xf')]('DeskField,\x20%s,\x20%s',_0x259226,_0x535c44[_0xacb5('0xf')][_0xacb5('0x11')]);return _0x13a2c1(_0x535c44[_0xacb5('0xf')][_0xacb5('0x11')]);}else{logger[_0xacb5('0x12')]('DeskField,\x20%s,\x20%s',_0x259226,_0xacb5('0xb'));_0x13a2c1(_0x535c44[_0xacb5('0x13')][_0xacb5('0x11')]);}})[_0xacb5('0x14')](function(_0x158b50){logger[_0xacb5('0xf')](_0xacb5('0xa'),_0x259226,_0x158b50);_0x500e3f(_0x158b50);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 630e5da..4ad6466 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 _0x981c=['create','addConfiguration','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','/:id/configurations','/:id/fields','post'];(function(_0x80d733,_0x266211){var _0x435868=function(_0x2ae0f0){while(--_0x2ae0f0){_0x80d733['push'](_0x80d733['shift']());}};_0x435868(++_0x266211);}(_0x981c,0x1ea));var _0xc981=function(_0x4ea2e6,_0x4d5672){_0x4ea2e6=_0x4ea2e6-0x0;var _0x3dbd3b=_0x981c[_0x4ea2e6];return _0x3dbd3b;};'use strict';var multer=require(_0xc981('0x0'));var util=require(_0xc981('0x1'));var path=require(_0xc981('0x2'));var timeout=require(_0xc981('0x3'));var express=require(_0xc981('0x4'));var router=express[_0xc981('0x5')]();var fs_extra=require(_0xc981('0x6'));var auth=require(_0xc981('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xc981('0x8'));var controller=require('./intDynamics365Account.controller');router[_0xc981('0x9')]('/',auth[_0xc981('0xa')](),controller[_0xc981('0xb')]);router[_0xc981('0x9')]('/:id',auth[_0xc981('0xa')](),controller[_0xc981('0xc')]);router[_0xc981('0x9')](_0xc981('0xd'),auth[_0xc981('0xa')](),controller['getConfigurations']);router['get'](_0xc981('0xe'),auth[_0xc981('0xa')](),controller['getFields']);router[_0xc981('0xf')]('/',auth[_0xc981('0xa')](),controller[_0xc981('0x10')]);router[_0xc981('0xf')](_0xc981('0xd'),auth[_0xc981('0xa')](),controller[_0xc981('0x11')]);router['put'](_0xc981('0x12'),auth[_0xc981('0xa')](),controller[_0xc981('0x13')]);router[_0xc981('0x14')](_0xc981('0x12'),auth[_0xc981('0xa')](),controller['destroy']);module[_0xc981('0x15')]=router; \ No newline at end of file +var _0x935b=['path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','/:id','update','delete','exports','multer','util'];(function(_0x348682,_0x45c647){var _0x46ecb4=function(_0x225e6d){while(--_0x225e6d){_0x348682['push'](_0x348682['shift']());}};_0x46ecb4(++_0x45c647);}(_0x935b,0x185));var _0xb935=function(_0x20dccd,_0x62e4b8){_0x20dccd=_0x20dccd-0x0;var _0x3a5669=_0x935b[_0x20dccd];return _0x3a5669;};'use strict';var multer=require(_0xb935('0x0'));var util=require(_0xb935('0x1'));var path=require(_0xb935('0x2'));var timeout=require('connect-timeout');var express=require(_0xb935('0x3'));var router=express[_0xb935('0x4')]();var fs_extra=require(_0xb935('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb935('0x6'));var config=require(_0xb935('0x7'));var controller=require('./intDynamics365Account.controller');router[_0xb935('0x8')]('/',auth[_0xb935('0x9')](),controller[_0xb935('0xa')]);router['get']('/:id',auth[_0xb935('0x9')](),controller[_0xb935('0xb')]);router[_0xb935('0x8')](_0xb935('0xc'),auth['isAuthenticated'](),controller[_0xb935('0xd')]);router[_0xb935('0x8')](_0xb935('0xe'),auth['isAuthenticated'](),controller[_0xb935('0xf')]);router[_0xb935('0x10')]('/',auth['isAuthenticated'](),controller[_0xb935('0x11')]);router['post'](_0xb935('0xc'),auth[_0xb935('0x9')](),controller[_0xb935('0x12')]);router['put'](_0xb935('0x13'),auth[_0xb935('0x9')](),controller[_0xb935('0x14')]);router[_0xb935('0x15')](_0xb935('0x13'),auth[_0xb935('0x9')](),controller['destroy']);module[_0xb935('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 9c0a760..628ffa4 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 _0x8c46=['sequelize','STRING','BOOLEAN'];(function(_0x3fe19b,_0x44e472){var _0x1ca6ec=function(_0x465168){while(--_0x465168){_0x3fe19b['push'](_0x3fe19b['shift']());}};_0x1ca6ec(++_0x44e472);}(_0x8c46,0x171));var _0x68c4=function(_0x95d5c8,_0x23ac73){_0x95d5c8=_0x95d5c8-0x0;var _0x4d35c9=_0x8c46[_0x95d5c8];return _0x4d35c9;};'use strict';var Sequelize=require(_0x68c4('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x68c4('0x1')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x68c4('0x1')]},'clientId':{'type':Sequelize[_0x68c4('0x1')]},'clientSecret':{'type':Sequelize[_0x68c4('0x1')]},'serverUrl':{'type':Sequelize[_0x68c4('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x68c4('0x1')]},'modernAuthentication':{'type':Sequelize[_0x68c4('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x3edc=['STRING','BOOLEAN','sequelize','exports'];(function(_0x4e944b,_0x3e910f){var _0x4eec32=function(_0x1c8286){while(--_0x1c8286){_0x4e944b['push'](_0x4e944b['shift']());}};_0x4eec32(++_0x3e910f);}(_0x3edc,0x1ae));var _0xc3ed=function(_0x22ee1e,_0x3eff80){_0x22ee1e=_0x22ee1e-0x0;var _0x49a5c9=_0x3edc[_0x22ee1e];return _0x49a5c9;};'use strict';var Sequelize=require(_0xc3ed('0x0'));module[_0xc3ed('0x1')]={'name':{'type':Sequelize[_0xc3ed('0x2')]},'username':{'type':Sequelize[_0xc3ed('0x2')]},'password':{'type':Sequelize[_0xc3ed('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0xc3ed('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xc3ed('0x2')]},'serverUrl':{'type':Sequelize[_0xc3ed('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xc3ed('0x2')]},'modernAuthentication':{'type':Sequelize[_0xc3ed('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 390eded..8ac6035 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 _0x7707=['DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','UserLocalizedLabel','Value',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','true','OptionSet','FalseOption','false','DisplayName',')/Microsoft.Dynamics.CRM.','util','lodash','../../components/parsers/qs','../../config/logger','api','../../components/integrations/configuration','status','json','offset','undefined','count','limit','set','Content-Range','update','destroy','sendStatus','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','then','includeAll','findAll','show','include','find','catch','create','body','params','getConfigurations','findOne','length','AccountId','Subjects','channel','getDescriptions','Dynamics365Field','Descriptions','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','PhoneCall','title','description','customerid','ownerid','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','firstresponsebykpiidname','followupby','importsequencenumber','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','numberofchildincidents','owneridname','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','productidname','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidname','sentimentvalue','slaname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','versionnumber','concat','username','password','remoteUri','tenantId','clientId','CloudProvider','data5','modernAuthentication','access_token','data7','https://login.microsoftonline.com/','/oauth2/token','clientSecret','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','4.0','value','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','includes','LogicalName','@odata.type','PicklistAttributeMetadata','push','MetadataId','isNil','BooleanAttributeMetadata','all','forEach','StringAttributeMetadata'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x7707,0x199));var _0x7770=function(_0x8ed1a,_0x5b57b4){_0x8ed1a=_0x8ed1a-0x0;var _0x4b0a65=_0x7707[_0x8ed1a];return _0x4b0a65;};'use strict';var rp=require('request-promise');var util=require(_0x7770('0x0'));var _=require(_0x7770('0x1'));var qs=require(_0x7770('0x2'));var logger=require(_0x7770('0x3'))(_0x7770('0x4'));var db=require('../../mysqldb')['db'];var integrations=require(_0x7770('0x5'));function respondWithResult(_0x5080eb,_0x4e7d0d){_0x4e7d0d=_0x4e7d0d||0xc8;return function(_0x1ee579){if(_0x1ee579){return _0x5080eb[_0x7770('0x6')](_0x4e7d0d)[_0x7770('0x7')](_0x1ee579);}};}function respondWithFilteredResult(_0x357212,_0x471e0b){return function(_0x52bb3f){if(_0x52bb3f){var _0x385f99=typeof _0x471e0b[_0x7770('0x8')]===_0x7770('0x9')&&typeof _0x471e0b['limit']===_0x7770('0x9');var _0xa52eeb=_0x52bb3f[_0x7770('0xa')];var _0x450b40=_0x385f99?0x0:_0x471e0b[_0x7770('0x8')];var _0x3392a6=_0x385f99?_0x52bb3f[_0x7770('0xa')]:_0x471e0b[_0x7770('0x8')]+_0x471e0b[_0x7770('0xb')];var _0x578bde;if(_0x3392a6>=_0xa52eeb){_0x3392a6=_0xa52eeb;_0x578bde=0xc8;}else{_0x578bde=0xce;}_0x357212['status'](_0x578bde);return _0x357212[_0x7770('0xc')](_0x7770('0xd'),_0x450b40+'-'+_0x3392a6+'/'+_0xa52eeb)[_0x7770('0x7')](_0x52bb3f);}return null;};}function saveUpdates(_0x18c893){return function(_0x2dd19e){if(_0x2dd19e){return _0x2dd19e[_0x7770('0xe')](_0x18c893)['then'](function(_0x2b00a0){return _0x2b00a0;});}return null;};}function removeEntity(_0x67dad2){return function(_0x22e1e5){if(_0x22e1e5){return _0x22e1e5[_0x7770('0xf')]()['then'](function(){_0x67dad2[_0x7770('0x6')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56e266){return function(_0xfed16d){if(!_0xfed16d){_0x56e266[_0x7770('0x10')](0x194);}return _0xfed16d;};}function handleError(_0x558816,_0x3b8100){_0x3b8100=_0x3b8100||0x1f4;return function(_0x1d9cec){logger[_0x7770('0x11')](_0x1d9cec[_0x7770('0x12')]);if(_0x1d9cec[_0x7770('0x13')]){delete _0x1d9cec[_0x7770('0x13')];}_0x558816['status'](_0x3b8100)[_0x7770('0x14')](_0x1d9cec);};}exports[_0x7770('0x15')]=function(_0x570fd9,_0x3ae608){var _0x32cad0={},_0x3916de={},_0x587907={'count':0x0,'rows':[]};var _0xa001dc=_[_0x7770('0x16')](db[_0x7770('0x17')][_0x7770('0x18')],function(_0x4872c7){return{'name':_0x4872c7[_0x7770('0x19')],'type':_0x4872c7['type'][_0x7770('0x1a')]};});_0x3916de[_0x7770('0x1b')]=_[_0x7770('0x16')](_0xa001dc,_0x7770('0x13'));_0x3916de['query']=_[_0x7770('0x1c')](_0x570fd9[_0x7770('0x1d')]);_0x3916de[_0x7770('0x1e')]=_['intersection'](_0x3916de['model'],_0x3916de[_0x7770('0x1d')]);_0x32cad0['attributes']=_[_0x7770('0x1f')](_0x3916de[_0x7770('0x1b')],qs['fields'](_0x570fd9['query'][_0x7770('0x20')]));_0x32cad0['attributes']=_0x32cad0['attributes']['length']?_0x32cad0[_0x7770('0x21')]:_0x3916de[_0x7770('0x1b')];if(!_0x570fd9[_0x7770('0x1d')][_0x7770('0x22')]('nolimit')){_0x32cad0[_0x7770('0xb')]=qs[_0x7770('0xb')](_0x570fd9[_0x7770('0x1d')][_0x7770('0xb')]);_0x32cad0[_0x7770('0x8')]=qs['offset'](_0x570fd9[_0x7770('0x1d')][_0x7770('0x8')]);}_0x32cad0[_0x7770('0x23')]=qs[_0x7770('0x24')](_0x570fd9['query'][_0x7770('0x24')]);_0x32cad0[_0x7770('0x25')]=qs[_0x7770('0x1e')](_[_0x7770('0x26')](_0x570fd9[_0x7770('0x1d')],_0x3916de['filters']),_0xa001dc);if(_0x570fd9[_0x7770('0x1d')][_0x7770('0x27')]){_0x32cad0[_0x7770('0x25')]=_[_0x7770('0x28')](_0x32cad0[_0x7770('0x25')],{'$or':_[_0x7770('0x16')](_0xa001dc,function(_0x35405d){if(_0x35405d[_0x7770('0x29')]!==_0x7770('0x2a')){var _0x520ff7={};_0x520ff7[_0x35405d['name']]={'$like':'%'+_0x570fd9['query'][_0x7770('0x27')]+'%'};return _0x520ff7;}})});}_0x32cad0=_['merge']({},_0x32cad0,_0x570fd9[_0x7770('0x2b')]);var _0x5d15b9={'where':_0x32cad0[_0x7770('0x25')]};return db[_0x7770('0x17')][_0x7770('0xa')](_0x5d15b9)[_0x7770('0x2c')](function(_0x2769d5){_0x587907[_0x7770('0xa')]=_0x2769d5;if(_0x570fd9[_0x7770('0x1d')][_0x7770('0x2d')]){_0x32cad0['include']=[{'all':!![]}];}return db[_0x7770('0x17')][_0x7770('0x2e')](_0x32cad0);})[_0x7770('0x2c')](function(_0x5bf7ed){_0x587907['rows']=_0x5bf7ed;return _0x587907;})[_0x7770('0x2c')](respondWithFilteredResult(_0x3ae608,_0x32cad0))['catch'](handleError(_0x3ae608,null));};exports[_0x7770('0x2f')]=function(_0x1c231f,_0x458202){var _0x2c62e4={'raw':![],'where':{'id':_0x1c231f['params']['id']}},_0x44e3f1={};_0x44e3f1[_0x7770('0x1b')]=_[_0x7770('0x1c')](db[_0x7770('0x17')][_0x7770('0x18')]);_0x44e3f1[_0x7770('0x1d')]=_[_0x7770('0x1c')](_0x1c231f[_0x7770('0x1d')]);_0x44e3f1[_0x7770('0x1e')]=_['intersection'](_0x44e3f1[_0x7770('0x1b')],_0x44e3f1[_0x7770('0x1d')]);_0x2c62e4['attributes']=_[_0x7770('0x1f')](_0x44e3f1[_0x7770('0x1b')],qs[_0x7770('0x20')](_0x1c231f[_0x7770('0x1d')][_0x7770('0x20')]));_0x2c62e4[_0x7770('0x21')]=_0x2c62e4[_0x7770('0x21')]['length']?_0x2c62e4[_0x7770('0x21')]:_0x44e3f1['model'];if(_0x1c231f[_0x7770('0x1d')]['includeAll']){_0x2c62e4[_0x7770('0x30')]=[{'all':!![]}];}_0x2c62e4=_['merge']({},_0x2c62e4,_0x1c231f[_0x7770('0x2b')]);return db[_0x7770('0x17')][_0x7770('0x31')](_0x2c62e4)['then'](handleEntityNotFound(_0x458202,null))['then'](respondWithResult(_0x458202,null))[_0x7770('0x32')](handleError(_0x458202,null));};exports[_0x7770('0x33')]=function(_0x561246,_0x2bb1be){return db['Dynamics365Account'][_0x7770('0x33')](_0x561246[_0x7770('0x34')],{})['then'](respondWithResult(_0x2bb1be,0xc9))[_0x7770('0x32')](handleError(_0x2bb1be,null));};exports[_0x7770('0xe')]=function(_0x21a866,_0x7c4ab6){if(_0x21a866[_0x7770('0x34')]['id']){delete _0x21a866['body']['id'];}return db['Dynamics365Account']['find']({'where':{'id':_0x21a866[_0x7770('0x35')]['id']}})[_0x7770('0x2c')](handleEntityNotFound(_0x7c4ab6,null))[_0x7770('0x2c')](saveUpdates(_0x21a866['body'],null))[_0x7770('0x2c')](respondWithResult(_0x7c4ab6,null))[_0x7770('0x32')](handleError(_0x7c4ab6,null));};exports[_0x7770('0xf')]=function(_0x28bbfd,_0x11a0d5){return db[_0x7770('0x17')][_0x7770('0x31')]({'where':{'id':_0x28bbfd[_0x7770('0x35')]['id']}})[_0x7770('0x2c')](handleEntityNotFound(_0x11a0d5,null))['then'](removeEntity(_0x11a0d5,null))[_0x7770('0x32')](handleError(_0x11a0d5,null));};exports[_0x7770('0x36')]=function(_0x2e04bd,_0x5556a7){var _0x5e8303={};var _0x5b7417={};var _0x4fe32a;var _0x3787d9;return db['Dynamics365Account'][_0x7770('0x37')]({'where':{'id':_0x2e04bd[_0x7770('0x35')]['id']}})[_0x7770('0x2c')](handleEntityNotFound(_0x5556a7,null))['then'](function(_0x38baf5){if(_0x38baf5){_0x4fe32a=_0x38baf5;_0x5b7417[_0x7770('0x1b')]=_[_0x7770('0x1c')](db['Dynamics365Configuration'][_0x7770('0x18')]);_0x5b7417['query']=_[_0x7770('0x1c')](_0x2e04bd[_0x7770('0x1d')]);_0x5b7417[_0x7770('0x1e')]=_[_0x7770('0x1f')](_0x5b7417[_0x7770('0x1b')],_0x5b7417['query']);_0x5e8303[_0x7770('0x21')]=_[_0x7770('0x1f')](_0x5b7417[_0x7770('0x1b')],qs['fields'](_0x2e04bd[_0x7770('0x1d')]['fields']));_0x5e8303['attributes']=_0x5e8303[_0x7770('0x21')]['length']?_0x5e8303[_0x7770('0x21')]:_0x5b7417['model'];_0x5e8303[_0x7770('0x23')]=qs[_0x7770('0x24')](_0x2e04bd[_0x7770('0x1d')][_0x7770('0x24')]);_0x5e8303[_0x7770('0x25')]=qs[_0x7770('0x1e')](_[_0x7770('0x26')](_0x2e04bd['query'],_0x5b7417[_0x7770('0x1e')]));if(_0x2e04bd[_0x7770('0x1d')][_0x7770('0x27')]){_0x5e8303[_0x7770('0x25')]=_[_0x7770('0x28')](_0x5e8303[_0x7770('0x25')],{'$or':_[_0x7770('0x16')](_0x5e8303[_0x7770('0x21')],function(_0x872c82){var _0x2a9420={};_0x2a9420[_0x872c82]={'$like':'%'+_0x2e04bd[_0x7770('0x1d')][_0x7770('0x27')]+'%'};return _0x2a9420;})});}_0x5e8303=_[_0x7770('0x28')]({},_0x5e8303,_0x2e04bd[_0x7770('0x2b')]);return _0x4fe32a[_0x7770('0x36')](_0x5e8303);}})[_0x7770('0x2c')](function(_0x5d74c0){if(_0x5d74c0){_0x3787d9=_0x5d74c0[_0x7770('0x38')];if(!_0x2e04bd[_0x7770('0x1d')]['hasOwnProperty']('nolimit')){_0x5e8303[_0x7770('0xb')]=qs['limit'](_0x2e04bd[_0x7770('0x1d')][_0x7770('0xb')]);_0x5e8303['offset']=qs[_0x7770('0x8')](_0x2e04bd['query']['offset']);}return _0x4fe32a[_0x7770('0x36')](_0x5e8303);}})[_0x7770('0x2c')](function(_0x12c993){if(_0x12c993){return _0x12c993?{'count':_0x3787d9,'rows':_0x12c993}:null;}})[_0x7770('0x2c')](respondWithResult(_0x5556a7,null))['catch'](handleError(_0x5556a7,null));};exports['addConfiguration']=function(_0x4e999e,_0x271c18){if(_0x4e999e[_0x7770('0x34')]['id']){delete _0x4e999e[_0x7770('0x34')]['id'];}return db['Dynamics365Account']['findOne']({'where':{'id':_0x4e999e[_0x7770('0x35')]['id']}})[_0x7770('0x2c')](handleEntityNotFound(_0x271c18,null))[_0x7770('0x2c')](function(_0x368bd0){if(_0x368bd0){_0x4e999e[_0x7770('0x34')][_0x7770('0x39')]=_0x368bd0['id'];_0x4e999e[_0x7770('0x34')][_0x7770('0x3a')]=integrations['getSubjects'](_0x4e999e[_0x7770('0x34')][_0x7770('0x3b')],_0x4e999e['body'][_0x7770('0x29')]);_0x4e999e[_0x7770('0x34')]['Descriptions']=integrations[_0x7770('0x3c')](_0x4e999e[_0x7770('0x34')][_0x7770('0x3b')],_0x4e999e['body'][_0x7770('0x29')]);return db['Dynamics365Configuration'][_0x7770('0x33')](_0x4e999e[_0x7770('0x34')],{'include':[{'model':db[_0x7770('0x3d')],'as':_0x7770('0x3a')},{'model':db['Dynamics365Field'],'as':_0x7770('0x3e')}]});}return null;})[_0x7770('0x2c')](respondWithResult(_0x271c18,null))['catch'](handleError(_0x271c18,null));};function sanitizeRemoteUri(_0x9eb0eb){var _0x3dde7f=_0x9eb0eb['slice'](-0x1);if(_0x3dde7f==='/')return _0x9eb0eb[_0x7770('0x3f')](0x0,_0x9eb0eb[_0x7770('0x40')](_0x3dde7f));return _0x9eb0eb;}function getWebApiUrl(_0x5679b2){return util[_0x7770('0x41')](_0x7770('0x42'),_0x5679b2);}exports[_0x7770('0x43')]=function(_0x56f091,_0xe1188e){var _0x2f7854=_0x56f091[_0x7770('0x1d')][_0x7770('0x44')];var _0x2fc95a=_0x2f7854===_0x7770('0x45')?_0x7770('0x46'):_0x7770('0x47');var _0x5c74e5='';var _0x5ca52f='';var _0x134a33='';var _0x5c0568='';var _0xb08a53='';var _0x36759f='';var _0x3d2b42='';var _0x3c7860='';var _0x1d690d=[_0x7770('0x48'),_0x7770('0x49'),_0x7770('0x4a'),_0x7770('0x4b'),'caseorigincode','subject',_0x7770('0x4c'),_0x7770('0x4d'),_0x7770('0x4e'),_0x7770('0x4f')];var _0x4782f8=[_0x7770('0x50'),_0x7770('0x51'),_0x7770('0x52'),_0x7770('0x53'),_0x7770('0x54'),_0x7770('0x55'),_0x7770('0x56'),_0x7770('0x57'),_0x7770('0x58'),'createdbyexternalpartyyominame',_0x7770('0x59'),_0x7770('0x5a'),_0x7770('0x5b'),_0x7770('0x5c'),_0x7770('0x5d'),'customeridname',_0x7770('0x5e'),_0x7770('0x5f'),_0x7770('0x60'),_0x7770('0x61'),_0x7770('0x62'),_0x7770('0x63'),_0x7770('0x64'),'exchangerate',_0x7770('0x65'),_0x7770('0x66'),_0x7770('0x67'),'influencescore',_0x7770('0x68'),_0x7770('0x69'),_0x7770('0x6a'),_0x7770('0x6b'),_0x7770('0x6c'),_0x7770('0x6d'),_0x7770('0x6e'),_0x7770('0x6f'),_0x7770('0x70'),_0x7770('0x71'),_0x7770('0x72'),'msdyn_iotalertname',_0x7770('0x73'),'onholdtime','overriddencreatedon',_0x7770('0x74'),'owneridtype',_0x7770('0x75'),_0x7770('0x76'),_0x7770('0x77'),_0x7770('0x78'),'prioritycodename',_0x7770('0x79'),_0x7770('0x7a'),'resolveby',_0x7770('0x7b'),_0x7770('0x7c'),_0x7770('0x7d'),'responsiblecontactidyominame',_0x7770('0x7e'),'slainvokedidname',_0x7770('0x7f'),'socialprofileidname',_0x7770('0x80'),_0x7770('0x81'),_0x7770('0x82'),_0x7770('0x83'),_0x7770('0x84'),_0x7770('0x85'),'traversedpath','utcconversiontimezonecode',_0x7770('0x86')];var _0x40a9c9=_0x1d690d[_0x7770('0x87')](_0x4782f8);return db['Dynamics365Account'][_0x7770('0x37')]({'where':{'id':_0x56f091[_0x7770('0x35')]['id']},'attributes':['id',_0x7770('0x88'),_0x7770('0x89'),_0x7770('0x8a'),_0x7770('0x8b'),_0x7770('0x8c'),'clientSecret','modernAuthentication'],'include':[{'model':db[_0x7770('0x8d')],'as':_0x7770('0x8d'),'attributes':['id',_0x7770('0x8e'),'data7']}]})[_0x7770('0x2c')](handleEntityNotFound(_0xe1188e,null))[_0x7770('0x2c')](function(_0xdb61e6){if(_0xdb61e6){if(_0xdb61e6[_0x7770('0x8f')]){_0xdb61e6[_0x7770('0x90')]=_0xdb61e6[_0x7770('0x8d')][_0x7770('0x8e')];_0x3c7860=sanitizeRemoteUri(_0xdb61e6['CloudProvider'][_0x7770('0x91')]);_0x3d2b42=getWebApiUrl(_0x3c7860);return _0xdb61e6;}_0x3c7860=sanitizeRemoteUri(_0xdb61e6[_0x7770('0x8a')]);_0x3d2b42=getWebApiUrl(_0x3c7860);var _0x54be43={'method':'POST','uri':_0x7770('0x92')+_0xdb61e6['tenantId']+_0x7770('0x93'),'form':{'client_id':_0xdb61e6[_0x7770('0x8c')],'resource':_0x3c7860,'username':_0xdb61e6[_0x7770('0x88')],'password':_0xdb61e6[_0x7770('0x89')],'grant_type':_0x7770('0x89'),'client_secret':_0xdb61e6[_0x7770('0x94')]},'json':!![]};return rp(_0x54be43);}})[_0x7770('0x2c')](function(_0x39d2a7){_0x36759f=_0x39d2a7[_0x7770('0x90')];var _0x1ee95f={'method':_0x7770('0x95'),'uri':encodeURI(_0x3d2b42+_0x7770('0x96')+_0x2fc95a+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x36759f,'If-None-Match':null,'OData-Version':_0x7770('0x97')},'json':!![]};return rp(_0x1ee95f);})[_0x7770('0x2c')](function(_0x44cdea){var _0x2a0edc=_0x44cdea[_0x7770('0x98')][0x0];var _0x50b4a9=_0x2a0edc['MetadataId'];var _0xcd0328={'method':_0x7770('0x95'),'uri':_0x3d2b42+_0x7770('0x99')+_0x50b4a9+_0x7770('0x9a'),'headers':{'Authorization':_0x7770('0x9b')+_0x36759f,'If-None-Match':null,'OData-Version':_0x7770('0x97')},'json':!![]};return rp(_0xcd0328);})['then'](function(_0x51fc5a){_0x5c74e5=_0x51fc5a;_0x5ca52f=_0x5c74e5['Attributes'];_0x5ca52f=_['remove'](_0x5ca52f,function(_0x347575){return!_0x40a9c9[_0x7770('0x9c')](_0x347575[_0x7770('0x9d')]);});var _0xf854a6=[];var _0x492ecc=[];_0x5ca52f['forEach'](function(_0x3022fa){if(_0x3022fa[_0x7770('0x9e')]){var _0xd39613=_0x3022fa[_0x7770('0x9e')][_0x7770('0x3f')](_0x3022fa['@odata.type']['lastIndexOf']('.')+0x1);if(_0xd39613===_0x7770('0x9f')){_0xf854a6[_0x7770('0xa0')](getSelectList(_0x3d2b42,_0x2f7854,_0x492ecc,_0x5c74e5[_0x7770('0xa1')],_0x3022fa[_0x7770('0xa1')],_0x36759f));}}});return Promise['all'](_0xf854a6);})[_0x7770('0x2c')](function(_0x508f1a){_0x134a33=_0x508f1a[0x0];var _0x238a74=[];var _0x2b44a3=[];_0x5ca52f['forEach'](function(_0x546215){if(!_[_0x7770('0xa2')](_0x546215['@odata.type'])){var _0x3c399b=_0x546215[_0x7770('0x9e')]['substring'](_0x546215['@odata.type'][_0x7770('0x40')]('.')+0x1);if(_0x3c399b===_0x7770('0xa3')){_0x238a74[_0x7770('0xa0')](getBooleanList(_0x3d2b42,_0x2f7854,_0x2b44a3,_0x5c74e5[_0x7770('0xa1')],_0x546215[_0x7770('0xa1')],_0x36759f));}}});return Promise[_0x7770('0xa4')](_0x238a74);})[_0x7770('0x2c')](function(_0x1f1003){_0x5c0568=_0x1f1003[0x0];var _0x32a944=[];var _0x3c069e=[];_0x5ca52f[_0x7770('0xa5')](function(_0x3defa1){if(_0x3defa1[_0x7770('0x9e')]){var _0x438128=_0x3defa1['@odata.type']['substring'](_0x3defa1[_0x7770('0x9e')][_0x7770('0x40')]('.')+0x1);if(_0x438128===_0x7770('0xa6')||_0x438128===_0x7770('0xa7')||_0x438128==='BigIntAttributeMetadata'||_0x438128===_0x7770('0xa8')||_0x438128===_0x7770('0xa9')||_0x438128===_0x7770('0xaa')||_0x438128===_0x7770('0xab')||_0x438128===_0x7770('0xac')||_0x438128===_0x7770('0xad')||_0x438128===_0x7770('0xae')){_0x32a944['push'](getInputList(_0x3d2b42,_0x2f7854,_0x438128,_0x3c069e,_0x5c74e5[_0x7770('0xa1')],_0x3defa1[_0x7770('0xa1')],_0x36759f));}}});return Promise[_0x7770('0xa4')](_0x32a944);})[_0x7770('0x2c')](function(_0x55ecb1){_0xb08a53=_0x55ecb1[0x0];var _0x55e298=_0x134a33[_0x7770('0x87')](_0x5c0568)[_0x7770('0x87')](_0xb08a53);var _0x1db158={'count':_0x55e298[_0x7770('0x38')],'rows':_0x55e298};return _0x1db158;})[_0x7770('0x2c')](respondWithResult(_0xe1188e,null))[_0x7770('0x32')](function(_0x1b8dc2){var _0x529d83=_0x56f091['query'][_0x7770('0xaf')]?0x1f4:_0x1b8dc2[_0x7770('0xb0')]||0x1f4;logger[_0x7770('0x11')](_0x1b8dc2[_0x7770('0x12')]);delete _0x1b8dc2[_0x7770('0x13')];if(_0x529d83===0x191){_0x529d83=0x190;}_0xe1188e[_0x7770('0x6')](_0x529d83)['send'](_0x56f091[_0x7770('0x1d')][_0x7770('0xaf')]?{'message':_0x7770('0xb1'),'statusCode':_0x1b8dc2['statusCode']}:_0x1b8dc2);});};function getSelectList(_0x1a9555,_0x2b577f,_0x5ea1dd,_0x120323,_0x28acc1,_0x283842){var _0x3a7056={'method':_0x7770('0x95'),'uri':_0x1a9555+_0x7770('0x99')+_0x120323+_0x7770('0xb2')+_0x28acc1+_0x7770('0xb3')+_0x7770('0xb4'),'headers':{'Authorization':_0x7770('0x9b')+_0x283842,'If-None-Match':null,'OData-Version':_0x7770('0x97')},'json':!![]};return rp(_0x3a7056)['then'](function(_0x31010f){var _0x31fa8b=[];var _0x2dac6a=_0x31010f['OptionSet'][_0x7770('0xb5')];_0x2dac6a[_0x7770('0xa5')](function(_0x59d17c){_0x31fa8b[_0x7770('0xa0')]({'name':_0x59d17c[_0x7770('0xb6')][_0x7770('0xb7')][_0x7770('0xb6')],'value':String(_0x59d17c[_0x7770('0xb8')])});});var _0x1860ca={'id':_0x2b577f+'_'+_0x31010f[_0x7770('0x9d')],'name':_0x31010f['DisplayName']['UserLocalizedLabel'][_0x7770('0xb6')],'custom':![],'options':_0x31fa8b};_0x5ea1dd['push'](_0x1860ca);return _0x5ea1dd;});}function getBooleanList(_0x191e90,_0x34a6f5,_0x59a674,_0x2cfcb9,_0x422855,_0x25ec4d){var _0x19826a={'method':_0x7770('0x95'),'uri':_0x191e90+_0x7770('0x99')+_0x2cfcb9+_0x7770('0xb2')+_0x422855+_0x7770('0xb9'),'headers':{'Authorization':'Bearer\x20'+_0x25ec4d,'If-None-Match':null,'OData-Version':_0x7770('0x97')},'json':!![]};return rp(_0x19826a)[_0x7770('0x2c')](function(_0x73a597){var _0x2626c2=[];_0x2626c2['push']({'name':_0x73a597['OptionSet']['TrueOption'][_0x7770('0xb6')][_0x7770('0xb7')][_0x7770('0xb6')],'value':_0x7770('0xba')},{'name':_0x73a597[_0x7770('0xbb')][_0x7770('0xbc')][_0x7770('0xb6')][_0x7770('0xb7')][_0x7770('0xb6')],'value':_0x7770('0xbd')});var _0x4ce357={'id':_0x34a6f5+'_'+_0x73a597[_0x7770('0x9d')],'name':_0x73a597[_0x7770('0xbe')][_0x7770('0xb7')][_0x7770('0xb6')],'custom':![],'options':_0x2626c2};_0x59a674[_0x7770('0xa0')](_0x4ce357);return _0x59a674;});}function getInputList(_0x20736f,_0x262b48,_0x506682,_0x13235e,_0x534e53,_0xceb806,_0x393650){var _0x23a721={'method':'GET','uri':_0x20736f+'EntityDefinitions('+_0x534e53+')/Attributes('+_0xceb806+_0x7770('0xbf')+_0x506682+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x7770('0x9b')+_0x393650,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x23a721)[_0x7770('0x2c')](function(_0x3f3b85){var _0x28d14d={'id':_0x262b48+'_'+_0x3f3b85[_0x7770('0x9d')],'name':_0x3f3b85[_0x7770('0xbe')]['UserLocalizedLabel']?_0x3f3b85[_0x7770('0xbe')]['UserLocalizedLabel'][_0x7770('0xb6')]:_0x3f3b85[_0x7770('0x9d')],'custom':![],'options':[]};_0x13235e[_0x7770('0xa0')](_0x28d14d);return _0x13235e;});} \ No newline at end of file +var _0x7588=['filter','merge','VIRTUAL','options','includeAll','findAll','catch','rawAttributes','length','create','body','find','params','getConfigurations','findOne','Dynamics365Configuration','order','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','channel','Dynamics365Field','Subjects','substring','format','%s/api/data/v9.0/','ticketType','incident','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','directioncode','accountidname','actualserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entityimage_timestamp','entityimage_url','exchangerate','firstresponsebykpiidname','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slaname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','concat','username','password','remoteUri','clientSecret','modernAuthentication','CloudProvider','data5','data7','access_token','POST','https://login.microsoftonline.com/','/oauth2/token','clientId','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','4.0','MetadataId','GET','EntityDefinitions(','Bearer\x20','Attributes','includes','@odata.type','lastIndexOf','push','all','isNil','forEach','StringAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Options','Label','UserLocalizedLabel','Value','LogicalName','DisplayName','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','index','map','Dynamics365Account','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x1c9124,_0x27dacb){var _0x5ca4b1=function(_0x477578){while(--_0x477578){_0x1c9124['push'](_0x1c9124['shift']());}};_0x5ca4b1(++_0x27dacb);}(_0x7588,0x158));var _0x8758=function(_0x16959f,_0x561a1f){_0x16959f=_0x16959f-0x0;var _0x250f1f=_0x7588[_0x16959f];return _0x250f1f;};'use strict';var rp=require(_0x8758('0x0'));var util=require(_0x8758('0x1'));var _=require(_0x8758('0x2'));var qs=require(_0x8758('0x3'));var logger=require(_0x8758('0x4'))(_0x8758('0x5'));var db=require(_0x8758('0x6'))['db'];var integrations=require(_0x8758('0x7'));function respondWithResult(_0x9150cb,_0x434bc6){_0x434bc6=_0x434bc6||0xc8;return function(_0x35759d){if(_0x35759d){return _0x9150cb[_0x8758('0x8')](_0x434bc6)[_0x8758('0x9')](_0x35759d);}};}function respondWithFilteredResult(_0x396941,_0x2dc495){return function(_0x24722c){if(_0x24722c){var _0x3f7ce6=typeof _0x2dc495[_0x8758('0xa')]===_0x8758('0xb')&&typeof _0x2dc495[_0x8758('0xc')]==='undefined';var _0x2b8460=_0x24722c['count'];var _0x4cba89=_0x3f7ce6?0x0:_0x2dc495[_0x8758('0xa')];var _0x2f464d=_0x3f7ce6?_0x24722c[_0x8758('0xd')]:_0x2dc495[_0x8758('0xa')]+_0x2dc495[_0x8758('0xc')];var _0x5bd867;if(_0x2f464d>=_0x2b8460){_0x2f464d=_0x2b8460;_0x5bd867=0xc8;}else{_0x5bd867=0xce;}_0x396941[_0x8758('0x8')](_0x5bd867);return _0x396941[_0x8758('0xe')](_0x8758('0xf'),_0x4cba89+'-'+_0x2f464d+'/'+_0x2b8460)[_0x8758('0x9')](_0x24722c);}return null;};}function saveUpdates(_0x50496a){return function(_0x35be98){if(_0x35be98){return _0x35be98[_0x8758('0x10')](_0x50496a)[_0x8758('0x11')](function(_0x2e805a){return _0x2e805a;});}return null;};}function removeEntity(_0x4083ac){return function(_0x53a36a){if(_0x53a36a){return _0x53a36a[_0x8758('0x12')]()[_0x8758('0x11')](function(){_0x4083ac[_0x8758('0x8')](0xcc)[_0x8758('0x13')]();});}};}function handleEntityNotFound(_0x100b9a){return function(_0x18c0a2){if(!_0x18c0a2){_0x100b9a[_0x8758('0x14')](0x194);}return _0x18c0a2;};}function handleError(_0x12fe0b,_0x21de14){_0x21de14=_0x21de14||0x1f4;return function(_0x4c2829){logger[_0x8758('0x15')](_0x4c2829[_0x8758('0x16')]);if(_0x4c2829[_0x8758('0x17')]){delete _0x4c2829[_0x8758('0x17')];}_0x12fe0b[_0x8758('0x8')](_0x21de14)['send'](_0x4c2829);};}exports[_0x8758('0x18')]=function(_0x476878,_0x1c122){var _0x191c89={},_0xe9a1c2={},_0x823aa5={'count':0x0,'rows':[]};var _0x631dd0=_[_0x8758('0x19')](db[_0x8758('0x1a')]['rawAttributes'],function(_0x3f3d40){return{'name':_0x3f3d40[_0x8758('0x1b')],'type':_0x3f3d40[_0x8758('0x1c')][_0x8758('0x1d')]};});_0xe9a1c2['model']=_[_0x8758('0x19')](_0x631dd0,_0x8758('0x17'));_0xe9a1c2[_0x8758('0x1e')]=_[_0x8758('0x1f')](_0x476878[_0x8758('0x1e')]);_0xe9a1c2[_0x8758('0x20')]=_[_0x8758('0x21')](_0xe9a1c2[_0x8758('0x22')],_0xe9a1c2[_0x8758('0x1e')]);_0x191c89[_0x8758('0x23')]=_[_0x8758('0x21')](_0xe9a1c2[_0x8758('0x22')],qs[_0x8758('0x24')](_0x476878[_0x8758('0x1e')]['fields']));_0x191c89['attributes']=_0x191c89[_0x8758('0x23')]['length']?_0x191c89[_0x8758('0x23')]:_0xe9a1c2[_0x8758('0x22')];if(!_0x476878[_0x8758('0x1e')][_0x8758('0x25')](_0x8758('0x26'))){_0x191c89[_0x8758('0xc')]=qs[_0x8758('0xc')](_0x476878[_0x8758('0x1e')][_0x8758('0xc')]);_0x191c89[_0x8758('0xa')]=qs[_0x8758('0xa')](_0x476878['query'][_0x8758('0xa')]);}_0x191c89['order']=qs[_0x8758('0x27')](_0x476878['query'][_0x8758('0x27')]);_0x191c89[_0x8758('0x28')]=qs['filters'](_[_0x8758('0x29')](_0x476878[_0x8758('0x1e')],_0xe9a1c2[_0x8758('0x20')]),_0x631dd0);if(_0x476878[_0x8758('0x1e')][_0x8758('0x2a')]){_0x191c89[_0x8758('0x28')]=_[_0x8758('0x2b')](_0x191c89[_0x8758('0x28')],{'$or':_[_0x8758('0x19')](_0x631dd0,function(_0x58dcc8){if(_0x58dcc8[_0x8758('0x1c')]!==_0x8758('0x2c')){var _0xe42b1f={};_0xe42b1f[_0x58dcc8[_0x8758('0x17')]]={'$like':'%'+_0x476878[_0x8758('0x1e')][_0x8758('0x2a')]+'%'};return _0xe42b1f;}})});}_0x191c89=_[_0x8758('0x2b')]({},_0x191c89,_0x476878[_0x8758('0x2d')]);var _0x4382d0={'where':_0x191c89['where']};return db[_0x8758('0x1a')]['count'](_0x4382d0)[_0x8758('0x11')](function(_0x42d092){_0x823aa5['count']=_0x42d092;if(_0x476878[_0x8758('0x1e')][_0x8758('0x2e')]){_0x191c89['include']=[{'all':!![]}];}return db[_0x8758('0x1a')][_0x8758('0x2f')](_0x191c89);})[_0x8758('0x11')](function(_0x2dcd55){_0x823aa5['rows']=_0x2dcd55;return _0x823aa5;})['then'](respondWithFilteredResult(_0x1c122,_0x191c89))[_0x8758('0x30')](handleError(_0x1c122,null));};exports['show']=function(_0x2415d8,_0x4ce9fa){var _0x5afa50={'raw':![],'where':{'id':_0x2415d8['params']['id']}},_0x2520bb={};_0x2520bb[_0x8758('0x22')]=_[_0x8758('0x1f')](db[_0x8758('0x1a')][_0x8758('0x31')]);_0x2520bb['query']=_[_0x8758('0x1f')](_0x2415d8[_0x8758('0x1e')]);_0x2520bb[_0x8758('0x20')]=_[_0x8758('0x21')](_0x2520bb[_0x8758('0x22')],_0x2520bb[_0x8758('0x1e')]);_0x5afa50[_0x8758('0x23')]=_[_0x8758('0x21')](_0x2520bb[_0x8758('0x22')],qs[_0x8758('0x24')](_0x2415d8['query'][_0x8758('0x24')]));_0x5afa50['attributes']=_0x5afa50[_0x8758('0x23')][_0x8758('0x32')]?_0x5afa50[_0x8758('0x23')]:_0x2520bb[_0x8758('0x22')];if(_0x2415d8[_0x8758('0x1e')][_0x8758('0x2e')]){_0x5afa50['include']=[{'all':!![]}];}_0x5afa50=_[_0x8758('0x2b')]({},_0x5afa50,_0x2415d8[_0x8758('0x2d')]);return db['Dynamics365Account']['find'](_0x5afa50)[_0x8758('0x11')](handleEntityNotFound(_0x4ce9fa,null))[_0x8758('0x11')](respondWithResult(_0x4ce9fa,null))[_0x8758('0x30')](handleError(_0x4ce9fa,null));};exports[_0x8758('0x33')]=function(_0x49cd6a,_0x369c44){return db[_0x8758('0x1a')][_0x8758('0x33')](_0x49cd6a['body'],{})[_0x8758('0x11')](respondWithResult(_0x369c44,0xc9))['catch'](handleError(_0x369c44,null));};exports[_0x8758('0x10')]=function(_0x5e9e3c,_0x55879e){if(_0x5e9e3c['body']['id']){delete _0x5e9e3c[_0x8758('0x34')]['id'];}return db[_0x8758('0x1a')][_0x8758('0x35')]({'where':{'id':_0x5e9e3c[_0x8758('0x36')]['id']}})[_0x8758('0x11')](handleEntityNotFound(_0x55879e,null))[_0x8758('0x11')](saveUpdates(_0x5e9e3c[_0x8758('0x34')],null))[_0x8758('0x11')](respondWithResult(_0x55879e,null))[_0x8758('0x30')](handleError(_0x55879e,null));};exports[_0x8758('0x12')]=function(_0x2905a3,_0x4d4ff2){return db['Dynamics365Account'][_0x8758('0x35')]({'where':{'id':_0x2905a3[_0x8758('0x36')]['id']}})[_0x8758('0x11')](handleEntityNotFound(_0x4d4ff2,null))[_0x8758('0x11')](removeEntity(_0x4d4ff2,null))[_0x8758('0x30')](handleError(_0x4d4ff2,null));};exports[_0x8758('0x37')]=function(_0x5b5435,_0x59b39f){var _0x2c1218={};var _0x7d0cbe={};var _0x119b84;var _0x2082b8;return db['Dynamics365Account'][_0x8758('0x38')]({'where':{'id':_0x5b5435[_0x8758('0x36')]['id']}})[_0x8758('0x11')](handleEntityNotFound(_0x59b39f,null))[_0x8758('0x11')](function(_0x2a3cd2){if(_0x2a3cd2){_0x119b84=_0x2a3cd2;_0x7d0cbe[_0x8758('0x22')]=_[_0x8758('0x1f')](db[_0x8758('0x39')][_0x8758('0x31')]);_0x7d0cbe[_0x8758('0x1e')]=_[_0x8758('0x1f')](_0x5b5435[_0x8758('0x1e')]);_0x7d0cbe[_0x8758('0x20')]=_[_0x8758('0x21')](_0x7d0cbe[_0x8758('0x22')],_0x7d0cbe['query']);_0x2c1218[_0x8758('0x23')]=_[_0x8758('0x21')](_0x7d0cbe[_0x8758('0x22')],qs[_0x8758('0x24')](_0x5b5435['query']['fields']));_0x2c1218['attributes']=_0x2c1218[_0x8758('0x23')][_0x8758('0x32')]?_0x2c1218[_0x8758('0x23')]:_0x7d0cbe[_0x8758('0x22')];_0x2c1218[_0x8758('0x3a')]=qs[_0x8758('0x27')](_0x5b5435['query'][_0x8758('0x27')]);_0x2c1218[_0x8758('0x28')]=qs[_0x8758('0x20')](_[_0x8758('0x29')](_0x5b5435['query'],_0x7d0cbe[_0x8758('0x20')]));if(_0x5b5435[_0x8758('0x1e')][_0x8758('0x2a')]){_0x2c1218['where']=_['merge'](_0x2c1218[_0x8758('0x28')],{'$or':_[_0x8758('0x19')](_0x2c1218['attributes'],function(_0x545f55){var _0x5a0db8={};_0x5a0db8[_0x545f55]={'$like':'%'+_0x5b5435[_0x8758('0x1e')]['filter']+'%'};return _0x5a0db8;})});}_0x2c1218=_['merge']({},_0x2c1218,_0x5b5435[_0x8758('0x2d')]);return _0x119b84['getConfigurations'](_0x2c1218);}})[_0x8758('0x11')](function(_0x4c75b7){if(_0x4c75b7){_0x2082b8=_0x4c75b7[_0x8758('0x32')];if(!_0x5b5435[_0x8758('0x1e')]['hasOwnProperty'](_0x8758('0x26'))){_0x2c1218[_0x8758('0xc')]=qs[_0x8758('0xc')](_0x5b5435[_0x8758('0x1e')]['limit']);_0x2c1218[_0x8758('0xa')]=qs[_0x8758('0xa')](_0x5b5435[_0x8758('0x1e')][_0x8758('0xa')]);}return _0x119b84[_0x8758('0x37')](_0x2c1218);}})[_0x8758('0x11')](function(_0x46c700){if(_0x46c700){return _0x46c700?{'count':_0x2082b8,'rows':_0x46c700}:null;}})[_0x8758('0x11')](respondWithResult(_0x59b39f,null))[_0x8758('0x30')](handleError(_0x59b39f,null));};exports[_0x8758('0x3b')]=function(_0x3b6f8a,_0x32c95c){if(_0x3b6f8a[_0x8758('0x34')]['id']){delete _0x3b6f8a['body']['id'];}return db[_0x8758('0x1a')][_0x8758('0x38')]({'where':{'id':_0x3b6f8a[_0x8758('0x36')]['id']}})[_0x8758('0x11')](handleEntityNotFound(_0x32c95c,null))[_0x8758('0x11')](function(_0x40effe){if(_0x40effe){_0x3b6f8a['body'][_0x8758('0x3c')]=_0x40effe['id'];_0x3b6f8a[_0x8758('0x34')]['Subjects']=integrations[_0x8758('0x3d')](_0x3b6f8a[_0x8758('0x34')]['channel'],_0x3b6f8a['body'][_0x8758('0x1c')]);_0x3b6f8a[_0x8758('0x34')][_0x8758('0x3e')]=integrations[_0x8758('0x3f')](_0x3b6f8a['body'][_0x8758('0x40')],_0x3b6f8a[_0x8758('0x34')][_0x8758('0x1c')]);return db[_0x8758('0x39')]['create'](_0x3b6f8a[_0x8758('0x34')],{'include':[{'model':db[_0x8758('0x41')],'as':_0x8758('0x42')},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x32c95c,null))[_0x8758('0x30')](handleError(_0x32c95c,null));};function sanitizeRemoteUri(_0x4362f1){var _0x46fda0=_0x4362f1['slice'](-0x1);if(_0x46fda0==='/')return _0x4362f1[_0x8758('0x43')](0x0,_0x4362f1['lastIndexOf'](_0x46fda0));return _0x4362f1;}function getWebApiUrl(_0x54a39c){return util[_0x8758('0x44')](_0x8758('0x45'),_0x54a39c);}exports['getFields']=function(_0x40a7f7,_0x5896a7){var _0x5d5f28=_0x40a7f7[_0x8758('0x1e')][_0x8758('0x46')];var _0x2958e6=_0x5d5f28===_0x8758('0x47')?_0x8758('0x48'):_0x8758('0x49');var _0x2aef70='';var _0x1ba73a='';var _0x48e629='';var _0xad40f5='';var _0x40a13b='';var _0x3ede82='';var _0x4b40fe='';var _0x4d5e0a='';var _0x5d9a51=[_0x8758('0x4a'),_0x8758('0x4b'),_0x8758('0x4c'),_0x8758('0x4d'),_0x8758('0x4e'),_0x8758('0x4f'),_0x8758('0x50'),'regardingobjectid',_0x8758('0x51'),'phonecall_activity_parties'];var _0xc4dedb=[_0x8758('0x52'),'accountidyominame',_0x8758('0x53'),'billedserviceunits',_0x8758('0x54'),_0x8758('0x55'),_0x8758('0x56'),_0x8758('0x57'),_0x8758('0x58'),_0x8758('0x59'),_0x8758('0x5a'),_0x8758('0x5b'),_0x8758('0x5c'),_0x8758('0x5d'),_0x8758('0x5e'),_0x8758('0x5f'),_0x8758('0x60'),_0x8758('0x61'),_0x8758('0x62'),'entitlementidname',_0x8758('0x63'),_0x8758('0x64'),'escalatedon',_0x8758('0x65'),_0x8758('0x66'),'followupby',_0x8758('0x67'),_0x8758('0x68'),_0x8758('0x69'),_0x8758('0x6a'),_0x8758('0x6b'),_0x8758('0x6c'),'modifiedbyexternalpartyyominame',_0x8758('0x6d'),_0x8758('0x6e'),'modifiedon',_0x8758('0x6f'),_0x8758('0x70'),_0x8758('0x71'),_0x8758('0x72'),_0x8758('0x73'),_0x8758('0x74'),_0x8758('0x75'),_0x8758('0x76'),_0x8758('0x77'),_0x8758('0x78'),'parentcaseidname',_0x8758('0x79'),_0x8758('0x7a'),_0x8758('0x7b'),_0x8758('0x7c'),_0x8758('0x7d'),_0x8758('0x7e'),_0x8758('0x7f'),_0x8758('0x80'),_0x8758('0x81'),_0x8758('0x82'),_0x8758('0x83'),'slainvokedidname',_0x8758('0x84'),'socialprofileidname',_0x8758('0x85'),_0x8758('0x86'),_0x8758('0x87'),_0x8758('0x88'),_0x8758('0x89'),'transactioncurrencyidname',_0x8758('0x8a'),_0x8758('0x8b'),'versionnumber'];var _0x28b46f=_0x5d9a51[_0x8758('0x8c')](_0xc4dedb);return db[_0x8758('0x1a')][_0x8758('0x38')]({'where':{'id':_0x40a7f7[_0x8758('0x36')]['id']},'attributes':['id',_0x8758('0x8d'),_0x8758('0x8e'),_0x8758('0x8f'),'tenantId','clientId',_0x8758('0x90'),_0x8758('0x91')],'include':[{'model':db[_0x8758('0x92')],'as':_0x8758('0x92'),'attributes':['id',_0x8758('0x93'),_0x8758('0x94')]}]})[_0x8758('0x11')](handleEntityNotFound(_0x5896a7,null))[_0x8758('0x11')](function(_0x23f102){if(_0x23f102){if(_0x23f102['modernAuthentication']){_0x23f102[_0x8758('0x95')]=_0x23f102[_0x8758('0x92')][_0x8758('0x93')];_0x4d5e0a=sanitizeRemoteUri(_0x23f102['CloudProvider'][_0x8758('0x94')]);_0x4b40fe=getWebApiUrl(_0x4d5e0a);return _0x23f102;}_0x4d5e0a=sanitizeRemoteUri(_0x23f102['remoteUri']);_0x4b40fe=getWebApiUrl(_0x4d5e0a);var _0x5736dc={'method':_0x8758('0x96'),'uri':_0x8758('0x97')+_0x23f102['tenantId']+_0x8758('0x98'),'form':{'client_id':_0x23f102[_0x8758('0x99')],'resource':_0x4d5e0a,'username':_0x23f102[_0x8758('0x8d')],'password':_0x23f102[_0x8758('0x8e')],'grant_type':_0x8758('0x8e'),'client_secret':_0x23f102['clientSecret']},'json':!![]};return rp(_0x5736dc);}})[_0x8758('0x11')](function(_0x12cdfd){_0x3ede82=_0x12cdfd[_0x8758('0x95')];var _0x5cfbe8={'method':'GET','uri':encodeURI(_0x4b40fe+_0x8758('0x9a')+_0x2958e6+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x3ede82,'If-None-Match':null,'OData-Version':_0x8758('0x9b')},'json':!![]};return rp(_0x5cfbe8);})[_0x8758('0x11')](function(_0x168b9c){var _0x20a008=_0x168b9c['value'][0x0];var _0xd4c814=_0x20a008[_0x8758('0x9c')];var _0x2c5647={'method':_0x8758('0x9d'),'uri':_0x4b40fe+_0x8758('0x9e')+_0xd4c814+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x8758('0x9f')+_0x3ede82,'If-None-Match':null,'OData-Version':_0x8758('0x9b')},'json':!![]};return rp(_0x2c5647);})['then'](function(_0x7c40c9){_0x2aef70=_0x7c40c9;_0x1ba73a=_0x2aef70[_0x8758('0xa0')];_0x1ba73a=_['remove'](_0x1ba73a,function(_0x2ecda0){return!_0x28b46f[_0x8758('0xa1')](_0x2ecda0['LogicalName']);});var _0x57a958=[];var _0xde89ea=[];_0x1ba73a['forEach'](function(_0x4ed57f){if(_0x4ed57f[_0x8758('0xa2')]){var _0x102b65=_0x4ed57f[_0x8758('0xa2')][_0x8758('0x43')](_0x4ed57f['@odata.type'][_0x8758('0xa3')]('.')+0x1);if(_0x102b65==='PicklistAttributeMetadata'){_0x57a958[_0x8758('0xa4')](getSelectList(_0x4b40fe,_0x5d5f28,_0xde89ea,_0x2aef70[_0x8758('0x9c')],_0x4ed57f[_0x8758('0x9c')],_0x3ede82));}}});return Promise[_0x8758('0xa5')](_0x57a958);})[_0x8758('0x11')](function(_0x1f8d2f){_0x48e629=_0x1f8d2f[0x0];var _0x489792=[];var _0x3bfb32=[];_0x1ba73a['forEach'](function(_0xa048fe){if(!_[_0x8758('0xa6')](_0xa048fe[_0x8758('0xa2')])){var _0x3fe793=_0xa048fe[_0x8758('0xa2')][_0x8758('0x43')](_0xa048fe['@odata.type']['lastIndexOf']('.')+0x1);if(_0x3fe793==='BooleanAttributeMetadata'){_0x489792[_0x8758('0xa4')](getBooleanList(_0x4b40fe,_0x5d5f28,_0x3bfb32,_0x2aef70['MetadataId'],_0xa048fe['MetadataId'],_0x3ede82));}}});return Promise['all'](_0x489792);})['then'](function(_0x2ba5fd){_0xad40f5=_0x2ba5fd[0x0];var _0x355c6c=[];var _0xf845a2=[];_0x1ba73a[_0x8758('0xa7')](function(_0x52b2f7){if(_0x52b2f7['@odata.type']){var _0x2f4131=_0x52b2f7[_0x8758('0xa2')][_0x8758('0x43')](_0x52b2f7[_0x8758('0xa2')]['lastIndexOf']('.')+0x1);if(_0x2f4131===_0x8758('0xa8')||_0x2f4131==='DoubleAttributeMetadata'||_0x2f4131===_0x8758('0xa9')||_0x2f4131===_0x8758('0xaa')||_0x2f4131===_0x8758('0xab')||_0x2f4131===_0x8758('0xac')||_0x2f4131===_0x8758('0xad')||_0x2f4131===_0x8758('0xae')||_0x2f4131===_0x8758('0xaf')||_0x2f4131===_0x8758('0xb0')){_0x355c6c[_0x8758('0xa4')](getInputList(_0x4b40fe,_0x5d5f28,_0x2f4131,_0xf845a2,_0x2aef70[_0x8758('0x9c')],_0x52b2f7[_0x8758('0x9c')],_0x3ede82));}}});return Promise[_0x8758('0xa5')](_0x355c6c);})[_0x8758('0x11')](function(_0x481faf){_0x40a13b=_0x481faf[0x0];var _0x42ef74=_0x48e629[_0x8758('0x8c')](_0xad40f5)[_0x8758('0x8c')](_0x40a13b);var _0x286699={'count':_0x42ef74[_0x8758('0x32')],'rows':_0x42ef74};return _0x286699;})[_0x8758('0x11')](respondWithResult(_0x5896a7,null))[_0x8758('0x30')](function(_0x212192){var _0x4958ee=_0x40a7f7[_0x8758('0x1e')][_0x8758('0xb1')]?0x1f4:_0x212192[_0x8758('0xb2')]||0x1f4;logger[_0x8758('0x15')](_0x212192[_0x8758('0x16')]);delete _0x212192['name'];if(_0x4958ee===0x191){_0x4958ee=0x190;}_0x5896a7['status'](_0x4958ee)['send'](_0x40a7f7[_0x8758('0x1e')][_0x8758('0xb1')]?{'message':'Wrong\x20credentials','statusCode':_0x212192['statusCode']}:_0x212192);});};function getSelectList(_0x59a9a6,_0x3fba49,_0x11f05a,_0x137580,_0x493bd3,_0x3cfa50){var _0x2d9d35={'method':_0x8758('0x9d'),'uri':_0x59a9a6+_0x8758('0x9e')+_0x137580+_0x8758('0xb3')+_0x493bd3+_0x8758('0xb4')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x8758('0x9f')+_0x3cfa50,'If-None-Match':null,'OData-Version':_0x8758('0x9b')},'json':!![]};return rp(_0x2d9d35)[_0x8758('0x11')](function(_0x2894b5){var _0x4c26ff=[];var _0x5964fe=_0x2894b5[_0x8758('0xb5')][_0x8758('0xb6')];_0x5964fe[_0x8758('0xa7')](function(_0xe3c9a2){_0x4c26ff['push']({'name':_0xe3c9a2[_0x8758('0xb7')][_0x8758('0xb8')][_0x8758('0xb7')],'value':String(_0xe3c9a2[_0x8758('0xb9')])});});var _0x47e8a4={'id':_0x3fba49+'_'+_0x2894b5[_0x8758('0xba')],'name':_0x2894b5[_0x8758('0xbb')][_0x8758('0xb8')][_0x8758('0xb7')],'custom':![],'options':_0x4c26ff};_0x11f05a[_0x8758('0xa4')](_0x47e8a4);return _0x11f05a;});}function getBooleanList(_0x250be2,_0x42172e,_0x2cde34,_0x302b55,_0x302fe7,_0x32e9b1){var _0x160bcc={'method':_0x8758('0x9d'),'uri':_0x250be2+'EntityDefinitions('+_0x302b55+_0x8758('0xb3')+_0x302fe7+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0x8758('0x9f')+_0x32e9b1,'If-None-Match':null,'OData-Version':_0x8758('0x9b')},'json':!![]};return rp(_0x160bcc)[_0x8758('0x11')](function(_0x4d6812){var _0x278126=[];_0x278126[_0x8758('0xa4')]({'name':_0x4d6812[_0x8758('0xb5')][_0x8758('0xbc')][_0x8758('0xb7')][_0x8758('0xb8')]['Label'],'value':_0x8758('0xbd')},{'name':_0x4d6812[_0x8758('0xb5')][_0x8758('0xbe')][_0x8758('0xb7')][_0x8758('0xb8')]['Label'],'value':_0x8758('0xbf')});var _0x521b11={'id':_0x42172e+'_'+_0x4d6812[_0x8758('0xba')],'name':_0x4d6812[_0x8758('0xbb')][_0x8758('0xb8')][_0x8758('0xb7')],'custom':![],'options':_0x278126};_0x2cde34['push'](_0x521b11);return _0x2cde34;});}function getInputList(_0x381e33,_0x2b5579,_0x5c56f4,_0x204444,_0x31e598,_0x3e8ca6,_0x1e6bf5){var _0x48201c={'method':_0x8758('0x9d'),'uri':_0x381e33+_0x8758('0x9e')+_0x31e598+_0x8758('0xb3')+_0x3e8ca6+_0x8758('0xc0')+_0x5c56f4+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x8758('0x9f')+_0x1e6bf5,'If-None-Match':null,'OData-Version':_0x8758('0x9b')},'json':!![]};return rp(_0x48201c)['then'](function(_0x21012b){var _0x1e842e={'id':_0x2b5579+'_'+_0x21012b['LogicalName'],'name':_0x21012b[_0x8758('0xbb')][_0x8758('0xb8')]?_0x21012b['DisplayName'][_0x8758('0xb8')]['Label']:_0x21012b[_0x8758('0xba')],'custom':![],'options':[]};_0x204444['push'](_0x1e842e);return _0x204444;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index e808d10..ffc5e63 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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util'];(function(_0x128a24,_0x30a202){var _0x58ef55=function(_0x4949c9){while(--_0x4949c9){_0x128a24['push'](_0x128a24['shift']());}};_0x58ef55(++_0x30a202);}(_0xe706,0xa3));var _0x6e70=function(_0xbd1f60,_0x470e77){_0xbd1f60=_0xbd1f60-0x0;var _0x25802f=_0xe706[_0xbd1f60];return _0x25802f;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));var integrations=require(_0x6e70('0xa'));module[_0x6e70('0xb')]=function(_0x4381d1,_0x36357b){return _0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'),attributes,{'tableName':_0x6e70('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util'];(function(_0x38cee7,_0x50ba49){var _0x4504a8=function(_0x198b48){while(--_0x198b48){_0x38cee7['push'](_0x38cee7['shift']());}};_0x4504a8(++_0x50ba49);}(_0xe706,0xa3));var _0x6e70=function(_0x3b0912,_0x39d739){_0x3b0912=_0x3b0912-0x0;var _0xa8f339=_0xe706[_0x3b0912];return _0xa8f339;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));var integrations=require(_0x6e70('0xa'));module[_0x6e70('0xb')]=function(_0x4381d1,_0x36357b){return _0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'),attributes,{'tableName':_0x6e70('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 076724c..4d37e44 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 _0x7f49=['bluebird','randomstring','ioredis','../../config/logger','jayson/promise','http','request','then','info','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','message','Dynamics365Account,\x20%s,\x20%s','request\x20sent','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','attributes','limit','include','map','model','ShowDynamics365Account','find','where','lodash','moment'];(function(_0x5b843c,_0x595bd8){var _0x422dbb=function(_0x37a833){while(--_0x37a833){_0x5b843c['push'](_0x5b843c['shift']());}};_0x422dbb(++_0x595bd8);}(_0x7f49,0xe5));var _0x97f4=function(_0x5d06e3,_0x5d0a1b){_0x5d06e3=_0x5d06e3-0x0;var _0x20086d=_0x7f49[_0x5d06e3];return _0x20086d;};'use strict';var _=require(_0x97f4('0x0'));var util=require('util');var moment=require(_0x97f4('0x1'));var BPromise=require(_0x97f4('0x2'));var rs=require(_0x97f4('0x3'));var fs=require('fs');var Redis=require(_0x97f4('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x97f4('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x97f4('0x6'));var client=jayson['client'][_0x97f4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x555171,_0x499505,_0x2d588a){return new BPromise(function(_0x2f3703,_0x57f47d){return client[_0x97f4('0x8')](_0x555171,_0x2d588a)[_0x97f4('0x9')](function(_0x10d880){logger[_0x97f4('0xa')]('Dynamics365Account,\x20%s,\x20%s',_0x499505,'request\x20sent');logger[_0x97f4('0xb')](_0x97f4('0xc'),_0x499505,'request\x20sent',JSON[_0x97f4('0xd')](_0x10d880));if(_0x10d880['error']){if(_0x10d880[_0x97f4('0xe')]['code']===0x1f4){logger[_0x97f4('0xe')]('Dynamics365Account,\x20%s,\x20%s',_0x499505,_0x10d880['error'][_0x97f4('0xf')]);return _0x57f47d(_0x10d880[_0x97f4('0xe')][_0x97f4('0xf')]);}logger[_0x97f4('0xe')](_0x97f4('0x10'),_0x499505,_0x10d880['error'][_0x97f4('0xf')]);return _0x2f3703(_0x10d880[_0x97f4('0xe')][_0x97f4('0xf')]);}else{logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x499505,_0x97f4('0x11'));_0x2f3703(_0x10d880[_0x97f4('0x12')][_0x97f4('0xf')]);}})[_0x97f4('0x13')](function(_0x531ce1){logger[_0x97f4('0xe')](_0x97f4('0x10'),_0x499505,_0x531ce1);_0x57f47d(_0x531ce1);});});}exports[_0x97f4('0x14')]=function(_0x180def){var _0x4dffc4=this;return new Promise(function(_0x39b856,_0x53abe3){return db[_0x97f4('0x15')][_0x97f4('0x16')]({'raw':_0x180def[_0x97f4('0x17')]?_0x180def[_0x97f4('0x17')][_0x97f4('0x18')]===undefined?!![]:![]:!![],'where':_0x180def[_0x97f4('0x17')]?_0x180def[_0x97f4('0x17')]['where']||null:null,'attributes':_0x180def[_0x97f4('0x17')]?_0x180def['options'][_0x97f4('0x19')]||null:null,'limit':_0x180def[_0x97f4('0x17')]?_0x180def[_0x97f4('0x17')][_0x97f4('0x1a')]||null:null,'include':_0x180def[_0x97f4('0x17')]?_0x180def['options'][_0x97f4('0x1b')]?_[_0x97f4('0x1c')](_0x180def['options'][_0x97f4('0x1b')],function(_0x23750d){return{'model':db[_0x23750d[_0x97f4('0x1d')]],'as':_0x23750d['as'],'attributes':_0x23750d[_0x97f4('0x19')],'include':_0x23750d[_0x97f4('0x1b')]?_[_0x97f4('0x1c')](_0x23750d[_0x97f4('0x1b')],function(_0x56a073){return{'model':db[_0x56a073[_0x97f4('0x1d')]],'as':_0x56a073['as'],'attributes':_0x56a073['attributes'],'include':_0x56a073[_0x97f4('0x1b')]?_[_0x97f4('0x1c')](_0x56a073[_0x97f4('0x1b')],function(_0x8edaea){return{'model':db[_0x8edaea[_0x97f4('0x1d')]],'as':_0x8edaea['as'],'attributes':_0x8edaea[_0x97f4('0x19')]};}):[]};}):[]};}):[]:[]})[_0x97f4('0x9')](function(_0x1ef99c){logger['info']('GetDynamics365Account',_0x180def);logger['debug'](_0x97f4('0x14'),_0x180def,JSON[_0x97f4('0xd')](_0x1ef99c));_0x39b856(_0x1ef99c);})[_0x97f4('0x13')](function(_0xb9d548){logger[_0x97f4('0xe')](_0x97f4('0x14'),_0xb9d548[_0x97f4('0xf')],_0x180def);_0x53abe3(_0x4dffc4['error'](0x1f4,_0xb9d548['message']));});});};exports[_0x97f4('0x1e')]=function(_0x13d48a){var _0xc4da7c=this;return new Promise(function(_0x1dca65,_0x64038e){return db['Dynamics365Account'][_0x97f4('0x1f')]({'raw':_0x13d48a[_0x97f4('0x17')]?_0x13d48a[_0x97f4('0x17')][_0x97f4('0x18')]===undefined?!![]:![]:!![],'where':_0x13d48a[_0x97f4('0x17')]?_0x13d48a[_0x97f4('0x17')][_0x97f4('0x20')]||null:null,'attributes':_0x13d48a[_0x97f4('0x17')]?_0x13d48a[_0x97f4('0x17')][_0x97f4('0x19')]||null:null,'include':_0x13d48a[_0x97f4('0x17')]?_0x13d48a['options'][_0x97f4('0x1b')]?_[_0x97f4('0x1c')](_0x13d48a['options'][_0x97f4('0x1b')],function(_0x3231f0){return{'model':db[_0x3231f0['model']],'as':_0x3231f0['as'],'attributes':_0x3231f0[_0x97f4('0x19')],'include':_0x3231f0['include']?_['map'](_0x3231f0[_0x97f4('0x1b')],function(_0x39e044){return{'model':db[_0x39e044[_0x97f4('0x1d')]],'as':_0x39e044['as'],'attributes':_0x39e044[_0x97f4('0x19')],'include':_0x39e044['include']?_[_0x97f4('0x1c')](_0x39e044[_0x97f4('0x1b')],function(_0x3bf74c){return{'model':db[_0x3bf74c[_0x97f4('0x1d')]],'as':_0x3bf74c['as'],'attributes':_0x3bf74c[_0x97f4('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2304a9){logger['info'](_0x97f4('0x1e'),_0x13d48a);logger['debug'](_0x97f4('0x1e'),_0x13d48a,JSON[_0x97f4('0xd')](_0x2304a9));_0x1dca65(_0x2304a9);})[_0x97f4('0x13')](function(_0x3ee01f){logger[_0x97f4('0xe')]('ShowDynamics365Account',_0x3ee01f['message'],_0x13d48a);_0x64038e(_0xc4da7c['error'](0x1f4,_0x3ee01f[_0x97f4('0xf')]));});});}; \ No newline at end of file +var _0x9501=['Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','Dynamics365Account','findAll','options','attributes','include','map','model','GetDynamics365Account','ShowDynamics365Account','find','raw','where','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9501,0xe0));var _0x1950=function(_0xca9c5a,_0xe95e2f){_0xca9c5a=_0xca9c5a-0x0;var _0xc8859b=_0x9501[_0xca9c5a];return _0xc8859b;};'use strict';var _=require(_0x1950('0x0'));var util=require(_0x1950('0x1'));var moment=require('moment');var BPromise=require(_0x1950('0x2'));var rs=require(_0x1950('0x3'));var fs=require('fs');var Redis=require(_0x1950('0x4'));var db=require(_0x1950('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1950('0x6'))(_0x1950('0x7'));var config=require(_0x1950('0x8'));var jayson=require(_0x1950('0x9'));var client=jayson['client'][_0x1950('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28070c,_0x3e3c75,_0x1db981){return new BPromise(function(_0x3ea22f,_0x479148){return client[_0x1950('0xb')](_0x28070c,_0x1db981)[_0x1950('0xc')](function(_0x6a38c5){logger[_0x1950('0xd')](_0x1950('0xe'),_0x3e3c75,_0x1950('0xf'));logger[_0x1950('0x10')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x3e3c75,_0x1950('0xf'),JSON['stringify'](_0x6a38c5));if(_0x6a38c5[_0x1950('0x11')]){if(_0x6a38c5['error'][_0x1950('0x12')]===0x1f4){logger[_0x1950('0x11')](_0x1950('0xe'),_0x3e3c75,_0x6a38c5['error'][_0x1950('0x13')]);return _0x479148(_0x6a38c5[_0x1950('0x11')]['message']);}logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x3e3c75,_0x6a38c5['error']['message']);return _0x3ea22f(_0x6a38c5[_0x1950('0x11')][_0x1950('0x13')]);}else{logger[_0x1950('0xd')]('Dynamics365Account,\x20%s,\x20%s',_0x3e3c75,'request\x20sent');_0x3ea22f(_0x6a38c5['result'][_0x1950('0x13')]);}})[_0x1950('0x14')](function(_0x55dfa2){logger['error'](_0x1950('0xe'),_0x3e3c75,_0x55dfa2);_0x479148(_0x55dfa2);});});}exports['GetDynamics365Account']=function(_0x3bd8a4){var _0x61abbe=this;return new Promise(function(_0x531db5,_0x5e25c8){return db[_0x1950('0x15')][_0x1950('0x16')]({'raw':_0x3bd8a4[_0x1950('0x17')]?_0x3bd8a4[_0x1950('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3bd8a4[_0x1950('0x17')]?_0x3bd8a4['options']['where']||null:null,'attributes':_0x3bd8a4['options']?_0x3bd8a4[_0x1950('0x17')][_0x1950('0x18')]||null:null,'limit':_0x3bd8a4['options']?_0x3bd8a4[_0x1950('0x17')]['limit']||null:null,'include':_0x3bd8a4['options']?_0x3bd8a4[_0x1950('0x17')][_0x1950('0x19')]?_[_0x1950('0x1a')](_0x3bd8a4[_0x1950('0x17')][_0x1950('0x19')],function(_0x10b06a){return{'model':db[_0x10b06a[_0x1950('0x1b')]],'as':_0x10b06a['as'],'attributes':_0x10b06a[_0x1950('0x18')],'include':_0x10b06a['include']?_[_0x1950('0x1a')](_0x10b06a[_0x1950('0x19')],function(_0xb4f200){return{'model':db[_0xb4f200[_0x1950('0x1b')]],'as':_0xb4f200['as'],'attributes':_0xb4f200[_0x1950('0x18')],'include':_0xb4f200[_0x1950('0x19')]?_[_0x1950('0x1a')](_0xb4f200[_0x1950('0x19')],function(_0x421eac){return{'model':db[_0x421eac[_0x1950('0x1b')]],'as':_0x421eac['as'],'attributes':_0x421eac[_0x1950('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x501f4e){logger['info'](_0x1950('0x1c'),_0x3bd8a4);logger[_0x1950('0x10')](_0x1950('0x1c'),_0x3bd8a4,JSON['stringify'](_0x501f4e));_0x531db5(_0x501f4e);})[_0x1950('0x14')](function(_0x383227){logger[_0x1950('0x11')]('GetDynamics365Account',_0x383227[_0x1950('0x13')],_0x3bd8a4);_0x5e25c8(_0x61abbe[_0x1950('0x11')](0x1f4,_0x383227['message']));});});};exports[_0x1950('0x1d')]=function(_0x7972be){var _0x7559b1=this;return new Promise(function(_0x1e83e0,_0x1ea4ee){return db[_0x1950('0x15')][_0x1950('0x1e')]({'raw':_0x7972be[_0x1950('0x17')]?_0x7972be[_0x1950('0x17')][_0x1950('0x1f')]===undefined?!![]:![]:!![],'where':_0x7972be[_0x1950('0x17')]?_0x7972be[_0x1950('0x17')][_0x1950('0x20')]||null:null,'attributes':_0x7972be['options']?_0x7972be[_0x1950('0x17')][_0x1950('0x18')]||null:null,'include':_0x7972be['options']?_0x7972be[_0x1950('0x17')][_0x1950('0x19')]?_['map'](_0x7972be[_0x1950('0x17')][_0x1950('0x19')],function(_0x4cc514){return{'model':db[_0x4cc514['model']],'as':_0x4cc514['as'],'attributes':_0x4cc514['attributes'],'include':_0x4cc514[_0x1950('0x19')]?_[_0x1950('0x1a')](_0x4cc514[_0x1950('0x19')],function(_0x5e0c81){return{'model':db[_0x5e0c81[_0x1950('0x1b')]],'as':_0x5e0c81['as'],'attributes':_0x5e0c81[_0x1950('0x18')],'include':_0x5e0c81['include']?_[_0x1950('0x1a')](_0x5e0c81['include'],function(_0x4f49d6){return{'model':db[_0x4f49d6[_0x1950('0x1b')]],'as':_0x4f49d6['as'],'attributes':_0x4f49d6[_0x1950('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x145347){logger[_0x1950('0xd')](_0x1950('0x1d'),_0x7972be);logger['debug'](_0x1950('0x1d'),_0x7972be,JSON[_0x1950('0x21')](_0x145347));_0x1e83e0(_0x145347);})['catch'](function(_0x1bb703){logger[_0x1950('0x11')]('ShowDynamics365Account',_0x1bb703[_0x1950('0x13')],_0x7972be);_0x1ea4ee(_0x7559b1['error'](0x1f4,_0x1bb703[_0x1950('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 591493f..e7a392b 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 _0x6e87=['post','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x2018cc,_0x3cfa3b){var _0x5213f4=function(_0x43ac4d){while(--_0x43ac4d){_0x2018cc['push'](_0x2018cc['shift']());}};_0x5213f4(++_0x3cfa3b);}(_0x6e87,0x7e));var _0x76e8=function(_0x29352f,_0x458a13){_0x29352f=_0x29352f-0x0;var _0x217e89=_0x6e87[_0x29352f];return _0x217e89;};'use strict';var multer=require('multer');var util=require(_0x76e8('0x0'));var path=require(_0x76e8('0x1'));var timeout=require(_0x76e8('0x2'));var express=require(_0x76e8('0x3'));var router=express[_0x76e8('0x4')]();var fs_extra=require(_0x76e8('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x76e8('0x6'));var controller=require(_0x76e8('0x7'));router[_0x76e8('0x8')]('/',auth[_0x76e8('0x9')](),controller[_0x76e8('0xa')]);router[_0x76e8('0x8')](_0x76e8('0xb'),auth[_0x76e8('0x9')](),controller['show']);router['get'](_0x76e8('0xc'),auth['isAuthenticated'](),controller[_0x76e8('0xd')]);router[_0x76e8('0x8')](_0x76e8('0xe'),auth[_0x76e8('0x9')](),controller[_0x76e8('0xf')]);router[_0x76e8('0x8')](_0x76e8('0x10'),auth[_0x76e8('0x9')](),controller[_0x76e8('0x11')]);router[_0x76e8('0x12')]('/',auth[_0x76e8('0x9')](),controller[_0x76e8('0x13')]);router[_0x76e8('0x14')]('/:id',auth[_0x76e8('0x9')](),controller['update']);router[_0x76e8('0x15')](_0x76e8('0xb'),auth[_0x76e8('0x9')](),controller[_0x76e8('0x16')]);module[_0x76e8('0x17')]=router; \ No newline at end of file +var _0xbdbe=['./intDynamics365Configuration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','put','update','destroy','exports','multer','path','express','fs-extra','../../components/interaction/service'];(function(_0x55729e,_0x11f952){var _0xdd67b8=function(_0x12fa35){while(--_0x12fa35){_0x55729e['push'](_0x55729e['shift']());}};_0xdd67b8(++_0x11f952);}(_0xbdbe,0x1f3));var _0xebdb=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xbdbe[_0x46698a];return _0x356db0;};'use strict';var multer=require(_0xebdb('0x0'));var util=require('util');var path=require(_0xebdb('0x1'));var timeout=require('connect-timeout');var express=require(_0xebdb('0x2'));var router=express['Router']();var fs_extra=require(_0xebdb('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xebdb('0x4'));var config=require('../../config/environment');var controller=require(_0xebdb('0x5'));router['get']('/',auth[_0xebdb('0x6')](),controller[_0xebdb('0x7')]);router[_0xebdb('0x8')](_0xebdb('0x9'),auth[_0xebdb('0x6')](),controller[_0xebdb('0xa')]);router[_0xebdb('0x8')](_0xebdb('0xb'),auth[_0xebdb('0x6')](),controller[_0xebdb('0xc')]);router[_0xebdb('0x8')]('/:id/subjects',auth[_0xebdb('0x6')](),controller[_0xebdb('0xd')]);router['get'](_0xebdb('0xe'),auth[_0xebdb('0x6')](),controller[_0xebdb('0xf')]);router[_0xebdb('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xebdb('0x11')](_0xebdb('0x9'),auth[_0xebdb('0x6')](),controller[_0xebdb('0x12')]);router['delete'](_0xebdb('0x9'),auth[_0xebdb('0x6')](),controller[_0xebdb('0x13')]);module[_0xebdb('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 eab7b58..989efdc 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 _0xfc42=['phonecall','incident','ENUM','contact','nothing','sequelize','STRING'];(function(_0x2ce1f2,_0x1337df){var _0x5319a9=function(_0x5b8b97){while(--_0x5b8b97){_0x2ce1f2['push'](_0x2ce1f2['shift']());}};_0x5319a9(++_0x1337df);}(_0xfc42,0xa6));var _0x2fc4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xfc42[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x2fc4('0x0'));module['exports']={'name':{'type':Sequelize[_0x2fc4('0x1')]},'description':{'type':Sequelize[_0x2fc4('0x1')]},'ticketType':{'type':Sequelize['ENUM']('incident',_0x2fc4('0x2')),'defaultValue':_0x2fc4('0x3')},'moduleCreate':{'type':Sequelize[_0x2fc4('0x4')](_0x2fc4('0x5'),_0x2fc4('0x6')),'defaultValue':_0x2fc4('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0xd699=['nothing','contact','sequelize','STRING','incident','phonecall','ENUM'];(function(_0x5d9675,_0xdceabd){var _0x1fd2f6=function(_0x51606c){while(--_0x51606c){_0x5d9675['push'](_0x5d9675['shift']());}};_0x1fd2f6(++_0xdceabd);}(_0xd699,0x160));var _0x9d69=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xd699[_0x25e7cb];return _0x375d92;};'use strict';var Sequelize=require(_0x9d69('0x0'));module['exports']={'name':{'type':Sequelize[_0x9d69('0x1')]},'description':{'type':Sequelize[_0x9d69('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0x9d69('0x2'),_0x9d69('0x3')),'defaultValue':_0x9d69('0x2')},'moduleCreate':{'type':Sequelize[_0x9d69('0x4')]('contact',_0x9d69('0x5')),'defaultValue':_0x9d69('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 8a3eaa9..e28183a 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 _0xcaf0=['fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','options','find','body','destroy','getFields','findOne','getSubjects','Dynamics365Field','getDescriptions','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','error','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','query','intersection','model','attributes'];(function(_0x84304a,_0x2147d1){var _0x49fd03=function(_0x11f518){while(--_0x11f518){_0x84304a['push'](_0x84304a['shift']());}};_0x49fd03(++_0x2147d1);}(_0xcaf0,0x151));var _0x0caf=function(_0x868bf8,_0x290a75){_0x868bf8=_0x868bf8-0x0;var _0x57b04b=_0xcaf0[_0x868bf8];return _0x57b04b;};'use strict';var emlformat=require(_0x0caf('0x0'));var rimraf=require(_0x0caf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0caf('0x2'));var moment=require(_0x0caf('0x3'));var BPromise=require(_0x0caf('0x4'));var Mustache=require(_0x0caf('0x5'));var util=require('util');var path=require(_0x0caf('0x6'));var sox=require('sox');var csv=require(_0x0caf('0x7'));var ejs=require(_0x0caf('0x8'));var fs=require('fs');var fs_extra=require(_0x0caf('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0caf('0xa'));var jsforce=require(_0x0caf('0xb'));var deskjs=require(_0x0caf('0xc'));var toCsv=require(_0x0caf('0x7'));var querystring=require('querystring');var Papa=require(_0x0caf('0xd'));var Redis=require(_0x0caf('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0caf('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0caf('0x10'));var utils=require('../../config/utils');var config=require(_0x0caf('0x11'));var licenseUtil=require(_0x0caf('0x12'));var db=require(_0x0caf('0x13'))['db'];function respondWithStatusCode(_0x515c3c,_0xcac10f){_0xcac10f=_0xcac10f||0xcc;return function(_0x4aa6cd){if(_0x4aa6cd){return _0x515c3c[_0x0caf('0x14')](_0xcac10f);}return _0x515c3c[_0x0caf('0x15')](_0xcac10f)[_0x0caf('0x16')]();};}function respondWithResult(_0x302dd0,_0x388469){_0x388469=_0x388469||0xc8;return function(_0x58bdca){if(_0x58bdca){return _0x302dd0[_0x0caf('0x15')](_0x388469)[_0x0caf('0x17')](_0x58bdca);}};}function respondWithFilteredResult(_0x59ddaf,_0x59e198){return function(_0x261563){if(_0x261563){var _0x3dddb8=typeof _0x59e198['offset']===_0x0caf('0x18')&&typeof _0x59e198[_0x0caf('0x19')]===_0x0caf('0x18');var _0x541859=_0x261563['count'];var _0x58e94d=_0x3dddb8?0x0:_0x59e198[_0x0caf('0x1a')];var _0x5c06b6=_0x3dddb8?_0x261563[_0x0caf('0x1b')]:_0x59e198[_0x0caf('0x1a')]+_0x59e198['limit'];var _0x51c9c7;if(_0x5c06b6>=_0x541859){_0x5c06b6=_0x541859;_0x51c9c7=0xc8;}else{_0x51c9c7=0xce;}_0x59ddaf[_0x0caf('0x15')](_0x51c9c7);return _0x59ddaf[_0x0caf('0x1c')](_0x0caf('0x1d'),_0x58e94d+'-'+_0x5c06b6+'/'+_0x541859)['json'](_0x261563);}return null;};}function patchUpdates(_0x2ef2b6){return function(_0x3d2a24){try{jsonpatch[_0x0caf('0x1e')](_0x3d2a24,_0x2ef2b6,!![]);}catch(_0x555b3a){return BPromise['reject'](_0x555b3a);}return _0x3d2a24[_0x0caf('0x1f')]();};}function saveUpdates(_0xb0f4f9,_0x84b106){return function(_0x954ce8){if(_0x954ce8){return _0x954ce8[_0x0caf('0x20')](_0xb0f4f9)[_0x0caf('0x21')](function(_0x389136){return _0x389136;});}return null;};}function removeEntity(_0x111f1b,_0x573ada){return function(_0x397760){if(_0x397760){return _0x397760['destroy']()['then'](function(){_0x111f1b['status'](0xcc)[_0x0caf('0x16')]();});}};}function handleEntityNotFound(_0x20d345,_0x542bf1){return function(_0x50673c){if(!_0x50673c){_0x20d345['sendStatus'](0x194);}return _0x50673c;};}function handleError(_0xce4ffc,_0x3b2391){_0x3b2391=_0x3b2391||0x1f4;return function(_0x1fda9b){logger[_0x0caf('0x22')](_0x1fda9b['stack']);if(_0x1fda9b[_0x0caf('0x23')]){delete _0x1fda9b[_0x0caf('0x23')];}_0xce4ffc[_0x0caf('0x15')](_0x3b2391)[_0x0caf('0x24')](_0x1fda9b);};}exports[_0x0caf('0x25')]=function(_0x6e5981,_0x261840){var _0x1f5330={},_0x304bb3={},_0x55b045={'count':0x0,'rows':[]};var _0x59b624=_[_0x0caf('0x26')](db[_0x0caf('0x27')][_0x0caf('0x28')],function(_0x4f1882){return{'name':_0x4f1882[_0x0caf('0x29')],'type':_0x4f1882[_0x0caf('0x2a')][_0x0caf('0x2b')]};});_0x304bb3['model']=_[_0x0caf('0x26')](_0x59b624,'name');_0x304bb3[_0x0caf('0x2c')]=_['keys'](_0x6e5981[_0x0caf('0x2c')]);_0x304bb3['filters']=_[_0x0caf('0x2d')](_0x304bb3[_0x0caf('0x2e')],_0x304bb3[_0x0caf('0x2c')]);_0x1f5330[_0x0caf('0x2f')]=_[_0x0caf('0x2d')](_0x304bb3['model'],qs['fields'](_0x6e5981[_0x0caf('0x2c')][_0x0caf('0x30')]));_0x1f5330[_0x0caf('0x2f')]=_0x1f5330['attributes'][_0x0caf('0x31')]?_0x1f5330['attributes']:_0x304bb3[_0x0caf('0x2e')];if(!_0x6e5981[_0x0caf('0x2c')][_0x0caf('0x32')](_0x0caf('0x33'))){_0x1f5330[_0x0caf('0x19')]=qs[_0x0caf('0x19')](_0x6e5981[_0x0caf('0x2c')][_0x0caf('0x19')]);_0x1f5330[_0x0caf('0x1a')]=qs['offset'](_0x6e5981['query']['offset']);}_0x1f5330[_0x0caf('0x34')]=qs[_0x0caf('0x35')](_0x6e5981[_0x0caf('0x2c')][_0x0caf('0x35')]);_0x1f5330[_0x0caf('0x36')]=qs[_0x0caf('0x37')](_[_0x0caf('0x38')](_0x6e5981[_0x0caf('0x2c')],_0x304bb3[_0x0caf('0x37')]),_0x59b624);if(_0x6e5981[_0x0caf('0x2c')][_0x0caf('0x39')]){_0x1f5330[_0x0caf('0x36')]=_[_0x0caf('0x3a')](_0x1f5330[_0x0caf('0x36')],{'$or':_[_0x0caf('0x26')](_0x59b624,function(_0x1b71d5){if(_0x1b71d5[_0x0caf('0x2a')]!==_0x0caf('0x3b')){var _0x225a22={};_0x225a22[_0x1b71d5['name']]={'$like':'%'+_0x6e5981[_0x0caf('0x2c')][_0x0caf('0x39')]+'%'};return _0x225a22;}})});}_0x1f5330=_[_0x0caf('0x3a')]({},_0x1f5330,_0x6e5981['options']);var _0x29f3c4={'where':_0x1f5330['where']};return db['Dynamics365Configuration'][_0x0caf('0x1b')](_0x29f3c4)['then'](function(_0x2124e3){_0x55b045[_0x0caf('0x1b')]=_0x2124e3;if(_0x6e5981[_0x0caf('0x2c')][_0x0caf('0x3c')]){_0x1f5330[_0x0caf('0x3d')]=[{'all':!![]}];}return db[_0x0caf('0x27')][_0x0caf('0x3e')](_0x1f5330);})[_0x0caf('0x21')](function(_0x4f6dd5){_0x55b045[_0x0caf('0x3f')]=_0x4f6dd5;return _0x55b045;})[_0x0caf('0x21')](respondWithFilteredResult(_0x261840,_0x1f5330))[_0x0caf('0x40')](handleError(_0x261840,null));};exports[_0x0caf('0x41')]=function(_0x592ea5,_0xb4390){var _0x39d82f={'raw':![],'where':{'id':_0x592ea5[_0x0caf('0x42')]['id']}},_0x3cf3e3={};_0x3cf3e3[_0x0caf('0x2e')]=_[_0x0caf('0x43')](db[_0x0caf('0x27')][_0x0caf('0x28')]);_0x3cf3e3[_0x0caf('0x2c')]=_[_0x0caf('0x43')](_0x592ea5[_0x0caf('0x2c')]);_0x3cf3e3[_0x0caf('0x37')]=_[_0x0caf('0x2d')](_0x3cf3e3[_0x0caf('0x2e')],_0x3cf3e3[_0x0caf('0x2c')]);_0x39d82f['attributes']=_[_0x0caf('0x2d')](_0x3cf3e3[_0x0caf('0x2e')],qs[_0x0caf('0x30')](_0x592ea5[_0x0caf('0x2c')][_0x0caf('0x30')]));_0x39d82f[_0x0caf('0x2f')]=_0x39d82f[_0x0caf('0x2f')]['length']?_0x39d82f[_0x0caf('0x2f')]:_0x3cf3e3[_0x0caf('0x2e')];if(_0x592ea5[_0x0caf('0x2c')][_0x0caf('0x3c')]){_0x39d82f[_0x0caf('0x3d')]=[{'all':!![]}];}_0x39d82f=_[_0x0caf('0x3a')]({},_0x39d82f,_0x592ea5[_0x0caf('0x44')]);return db['Dynamics365Configuration'][_0x0caf('0x45')](_0x39d82f)['then'](handleEntityNotFound(_0xb4390,null))[_0x0caf('0x21')](respondWithResult(_0xb4390,null))[_0x0caf('0x40')](handleError(_0xb4390,null));};exports['create']=function(_0x33cc5d,_0x5ec4a9){return db[_0x0caf('0x27')]['create'](_0x33cc5d[_0x0caf('0x46')],{})['then'](respondWithResult(_0x5ec4a9,0xc9))[_0x0caf('0x40')](handleError(_0x5ec4a9,null));};exports[_0x0caf('0x20')]=function(_0x5166f0,_0x4831a6){if(_0x5166f0[_0x0caf('0x46')]['id']){delete _0x5166f0['body']['id'];}return db[_0x0caf('0x27')][_0x0caf('0x45')]({'where':{'id':_0x5166f0[_0x0caf('0x42')]['id']}})[_0x0caf('0x21')](handleEntityNotFound(_0x4831a6,null))['then'](saveUpdates(_0x5166f0[_0x0caf('0x46')],null))[_0x0caf('0x21')](respondWithResult(_0x4831a6,null))['catch'](handleError(_0x4831a6,null));};exports[_0x0caf('0x47')]=function(_0x48a4b3,_0x19804a){return db[_0x0caf('0x27')][_0x0caf('0x45')]({'where':{'id':_0x48a4b3[_0x0caf('0x42')]['id']}})[_0x0caf('0x21')](handleEntityNotFound(_0x19804a,null))['then'](removeEntity(_0x19804a,null))['catch'](handleError(_0x19804a,null));};exports[_0x0caf('0x48')]=function(_0x4df050,_0x131827,_0x28ccd5){var _0x3f8054={};var _0x5b9675={};var _0x59d0f8;var _0x1804e6;return db[_0x0caf('0x27')][_0x0caf('0x49')]({'where':{'id':_0x4df050[_0x0caf('0x42')]['id']}})['then'](handleEntityNotFound(_0x131827,null))['then'](function(_0x34db85){if(_0x34db85){_0x59d0f8=_0x34db85;_0x5b9675[_0x0caf('0x2e')]=_[_0x0caf('0x43')](db['Dynamics365Field'][_0x0caf('0x28')]);_0x5b9675[_0x0caf('0x2c')]=_[_0x0caf('0x43')](_0x4df050[_0x0caf('0x2c')]);_0x5b9675[_0x0caf('0x37')]=_['intersection'](_0x5b9675[_0x0caf('0x2e')],_0x5b9675['query']);_0x3f8054[_0x0caf('0x2f')]=_['intersection'](_0x5b9675['model'],qs[_0x0caf('0x30')](_0x4df050[_0x0caf('0x2c')][_0x0caf('0x30')]));_0x3f8054[_0x0caf('0x2f')]=_0x3f8054[_0x0caf('0x2f')][_0x0caf('0x31')]?_0x3f8054[_0x0caf('0x2f')]:_0x5b9675[_0x0caf('0x2e')];_0x3f8054[_0x0caf('0x34')]=qs[_0x0caf('0x35')](_0x4df050[_0x0caf('0x2c')][_0x0caf('0x35')]);_0x3f8054[_0x0caf('0x36')]=qs[_0x0caf('0x37')](_[_0x0caf('0x38')](_0x4df050[_0x0caf('0x2c')],_0x5b9675['filters']));if(_0x4df050[_0x0caf('0x2c')][_0x0caf('0x39')]){_0x3f8054[_0x0caf('0x36')]=_['merge'](_0x3f8054[_0x0caf('0x36')],{'$or':_[_0x0caf('0x26')](_0x3f8054[_0x0caf('0x2f')],function(_0x3ae6fb){var _0x36a4b2={};_0x36a4b2[_0x3ae6fb]={'$like':'%'+_0x4df050[_0x0caf('0x2c')][_0x0caf('0x39')]+'%'};return _0x36a4b2;})});}_0x3f8054=_['merge']({},_0x3f8054,_0x4df050[_0x0caf('0x44')]);return _0x59d0f8[_0x0caf('0x48')](_0x3f8054);}})[_0x0caf('0x21')](function(_0x50c5ed){if(_0x50c5ed){_0x1804e6=_0x50c5ed[_0x0caf('0x31')];if(!_0x4df050[_0x0caf('0x2c')][_0x0caf('0x32')](_0x0caf('0x33'))){_0x3f8054['limit']=qs[_0x0caf('0x19')](_0x4df050[_0x0caf('0x2c')][_0x0caf('0x19')]);_0x3f8054[_0x0caf('0x1a')]=qs[_0x0caf('0x1a')](_0x4df050[_0x0caf('0x2c')][_0x0caf('0x1a')]);}return _0x59d0f8[_0x0caf('0x48')](_0x3f8054);}})['then'](function(_0x2c80f4){if(_0x2c80f4){return _0x2c80f4?{'count':_0x1804e6,'rows':_0x2c80f4}:null;}})[_0x0caf('0x21')](respondWithResult(_0x131827,null))['catch'](handleError(_0x131827,null));};exports[_0x0caf('0x4a')]=function(_0x318b47,_0x288924,_0x3d0c8a){var _0x5336af={};var _0x580234={};var _0x1766dc;var _0x1a3199;return db[_0x0caf('0x27')][_0x0caf('0x49')]({'where':{'id':_0x318b47['params']['id']}})[_0x0caf('0x21')](handleEntityNotFound(_0x288924,null))[_0x0caf('0x21')](function(_0x5d1502){if(_0x5d1502){_0x1766dc=_0x5d1502;_0x580234['model']=_['keys'](db[_0x0caf('0x4b')]['rawAttributes']);_0x580234[_0x0caf('0x2c')]=_[_0x0caf('0x43')](_0x318b47[_0x0caf('0x2c')]);_0x580234[_0x0caf('0x37')]=_[_0x0caf('0x2d')](_0x580234[_0x0caf('0x2e')],_0x580234[_0x0caf('0x2c')]);_0x5336af['attributes']=_[_0x0caf('0x2d')](_0x580234[_0x0caf('0x2e')],qs[_0x0caf('0x30')](_0x318b47[_0x0caf('0x2c')][_0x0caf('0x30')]));_0x5336af[_0x0caf('0x2f')]=_0x5336af[_0x0caf('0x2f')][_0x0caf('0x31')]?_0x5336af[_0x0caf('0x2f')]:_0x580234[_0x0caf('0x2e')];_0x5336af['order']=qs[_0x0caf('0x35')](_0x318b47[_0x0caf('0x2c')][_0x0caf('0x35')]);_0x5336af[_0x0caf('0x36')]=qs[_0x0caf('0x37')](_[_0x0caf('0x38')](_0x318b47['query'],_0x580234[_0x0caf('0x37')]));if(_0x318b47[_0x0caf('0x2c')][_0x0caf('0x39')]){_0x5336af['where']=_[_0x0caf('0x3a')](_0x5336af['where'],{'$or':_[_0x0caf('0x26')](_0x5336af['attributes'],function(_0x54d51f){var _0x582b2f={};_0x582b2f[_0x54d51f]={'$like':'%'+_0x318b47[_0x0caf('0x2c')][_0x0caf('0x39')]+'%'};return _0x582b2f;})});}_0x5336af=_[_0x0caf('0x3a')]({},_0x5336af,_0x318b47[_0x0caf('0x44')]);return _0x1766dc[_0x0caf('0x4a')](_0x5336af);}})[_0x0caf('0x21')](function(_0x50a330){if(_0x50a330){_0x1a3199=_0x50a330[_0x0caf('0x31')];if(!_0x318b47['query'][_0x0caf('0x32')]('nolimit')){_0x5336af[_0x0caf('0x19')]=qs['limit'](_0x318b47['query'][_0x0caf('0x19')]);_0x5336af[_0x0caf('0x1a')]=qs[_0x0caf('0x1a')](_0x318b47[_0x0caf('0x2c')][_0x0caf('0x1a')]);}return _0x1766dc[_0x0caf('0x4a')](_0x5336af);}})['then'](function(_0x47461e){if(_0x47461e){return _0x47461e?{'count':_0x1a3199,'rows':_0x47461e}:null;}})[_0x0caf('0x21')](respondWithResult(_0x288924,null))[_0x0caf('0x40')](handleError(_0x288924,null));};exports[_0x0caf('0x4c')]=function(_0x40021a,_0x125947,_0x36d4db){var _0x35749a={};var _0x147876={};var _0x1df745;var _0x1aa976;return db[_0x0caf('0x27')][_0x0caf('0x49')]({'where':{'id':_0x40021a[_0x0caf('0x42')]['id']}})[_0x0caf('0x21')](handleEntityNotFound(_0x125947,null))[_0x0caf('0x21')](function(_0x4af7b0){if(_0x4af7b0){_0x1df745=_0x4af7b0;_0x147876[_0x0caf('0x2e')]=_[_0x0caf('0x43')](db[_0x0caf('0x4b')]['rawAttributes']);_0x147876['query']=_[_0x0caf('0x43')](_0x40021a[_0x0caf('0x2c')]);_0x147876[_0x0caf('0x37')]=_[_0x0caf('0x2d')](_0x147876[_0x0caf('0x2e')],_0x147876[_0x0caf('0x2c')]);_0x35749a[_0x0caf('0x2f')]=_[_0x0caf('0x2d')](_0x147876['model'],qs[_0x0caf('0x30')](_0x40021a[_0x0caf('0x2c')]['fields']));_0x35749a[_0x0caf('0x2f')]=_0x35749a[_0x0caf('0x2f')]['length']?_0x35749a[_0x0caf('0x2f')]:_0x147876[_0x0caf('0x2e')];_0x35749a[_0x0caf('0x34')]=qs[_0x0caf('0x35')](_0x40021a[_0x0caf('0x2c')][_0x0caf('0x35')]);_0x35749a[_0x0caf('0x36')]=qs['filters'](_[_0x0caf('0x38')](_0x40021a[_0x0caf('0x2c')],_0x147876[_0x0caf('0x37')]));if(_0x40021a[_0x0caf('0x2c')]['filter']){_0x35749a[_0x0caf('0x36')]=_[_0x0caf('0x3a')](_0x35749a['where'],{'$or':_['map'](_0x35749a['attributes'],function(_0xb1d7dc){var _0x2b783e={};_0x2b783e[_0xb1d7dc]={'$like':'%'+_0x40021a['query'][_0x0caf('0x39')]+'%'};return _0x2b783e;})});}_0x35749a=_['merge']({},_0x35749a,_0x40021a[_0x0caf('0x44')]);return _0x1df745['getDescriptions'](_0x35749a);}})[_0x0caf('0x21')](function(_0x270d7c){if(_0x270d7c){_0x1aa976=_0x270d7c[_0x0caf('0x31')];if(!_0x40021a[_0x0caf('0x2c')][_0x0caf('0x32')](_0x0caf('0x33'))){_0x35749a['limit']=qs[_0x0caf('0x19')](_0x40021a[_0x0caf('0x2c')]['limit']);_0x35749a['offset']=qs[_0x0caf('0x1a')](_0x40021a['query'][_0x0caf('0x1a')]);}return _0x1df745['getDescriptions'](_0x35749a);}})[_0x0caf('0x21')](function(_0x113194){if(_0x113194){return _0x113194?{'count':_0x1aa976,'rows':_0x113194}:null;}})[_0x0caf('0x21')](respondWithResult(_0x125947,null))[_0x0caf('0x40')](handleError(_0x125947,null));}; \ No newline at end of file +var _0x5840=['rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','status','send','index','Dynamics365Configuration','rawAttributes','type','key','map','name','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','query','sort','where','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','find','create','body','params','findOne','pick','getFields','getSubjects','Dynamics365Field','nolimit','getDescriptions','order','eml-format'];(function(_0x13a2d9,_0x562975){var _0x189d24=function(_0x21dedc){while(--_0x21dedc){_0x13a2d9['push'](_0x13a2d9['shift']());}};_0x189d24(++_0x562975);}(_0x5840,0xec));var _0x0584=function(_0x1c57ea,_0x332559){_0x1c57ea=_0x1c57ea-0x0;var _0x3a976e=_0x5840[_0x1c57ea];return _0x3a976e;};'use strict';var emlformat=require(_0x0584('0x0'));var rimraf=require(_0x0584('0x1'));var zipdir=require(_0x0584('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0584('0x3'));var moment=require(_0x0584('0x4'));var BPromise=require(_0x0584('0x5'));var Mustache=require('mustache');var util=require(_0x0584('0x6'));var path=require(_0x0584('0x7'));var sox=require('sox');var csv=require(_0x0584('0x8'));var ejs=require(_0x0584('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0584('0xa'));var squel=require(_0x0584('0xb'));var crypto=require('crypto');var jsforce=require(_0x0584('0xc'));var deskjs=require(_0x0584('0xd'));var toCsv=require(_0x0584('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0584('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x0584('0xf'));var hardwareService=require(_0x0584('0x10'));var logger=require(_0x0584('0x11'))('api');var utils=require(_0x0584('0x12'));var config=require(_0x0584('0x13'));var licenseUtil=require(_0x0584('0x14'));var db=require(_0x0584('0x15'))['db'];function respondWithStatusCode(_0x30fec1,_0x50a0fe){_0x50a0fe=_0x50a0fe||0xcc;return function(_0x8d957d){if(_0x8d957d){return _0x30fec1['sendStatus'](_0x50a0fe);}return _0x30fec1['status'](_0x50a0fe)[_0x0584('0x16')]();};}function respondWithResult(_0x53f0c0,_0x11bb05){_0x11bb05=_0x11bb05||0xc8;return function(_0x55d131){if(_0x55d131){return _0x53f0c0['status'](_0x11bb05)[_0x0584('0x17')](_0x55d131);}};}function respondWithFilteredResult(_0x51e000,_0x232f06){return function(_0x1d470d){if(_0x1d470d){var _0x3c1c8b=typeof _0x232f06[_0x0584('0x18')]===_0x0584('0x19')&&typeof _0x232f06[_0x0584('0x1a')]===_0x0584('0x19');var _0x122776=_0x1d470d[_0x0584('0x1b')];var _0x4cd5e8=_0x3c1c8b?0x0:_0x232f06[_0x0584('0x18')];var _0x285aed=_0x3c1c8b?_0x1d470d['count']:_0x232f06[_0x0584('0x18')]+_0x232f06[_0x0584('0x1a')];var _0x52e2fa;if(_0x285aed>=_0x122776){_0x285aed=_0x122776;_0x52e2fa=0xc8;}else{_0x52e2fa=0xce;}_0x51e000['status'](_0x52e2fa);return _0x51e000['set'](_0x0584('0x1c'),_0x4cd5e8+'-'+_0x285aed+'/'+_0x122776)['json'](_0x1d470d);}return null;};}function patchUpdates(_0x4c2db2){return function(_0x235a2e){try{jsonpatch[_0x0584('0x1d')](_0x235a2e,_0x4c2db2,!![]);}catch(_0x50fba1){return BPromise[_0x0584('0x1e')](_0x50fba1);}return _0x235a2e[_0x0584('0x1f')]();};}function saveUpdates(_0x480793,_0x9c53c0){return function(_0x415657){if(_0x415657){return _0x415657[_0x0584('0x20')](_0x480793)[_0x0584('0x21')](function(_0x4ae180){return _0x4ae180;});}return null;};}function removeEntity(_0x4ffadd,_0x50db66){return function(_0x2a7967){if(_0x2a7967){return _0x2a7967[_0x0584('0x22')]()[_0x0584('0x21')](function(){_0x4ffadd['status'](0xcc)[_0x0584('0x16')]();});}};}function handleEntityNotFound(_0x4fc911,_0xef27c0){return function(_0x2132b2){if(!_0x2132b2){_0x4fc911[_0x0584('0x23')](0x194);}return _0x2132b2;};}function handleError(_0x589f3a,_0x5d3ecb){_0x5d3ecb=_0x5d3ecb||0x1f4;return function(_0xa2f9c9){logger[_0x0584('0x24')](_0xa2f9c9[_0x0584('0x25')]);if(_0xa2f9c9['name']){delete _0xa2f9c9['name'];}_0x589f3a[_0x0584('0x26')](_0x5d3ecb)[_0x0584('0x27')](_0xa2f9c9);};}exports[_0x0584('0x28')]=function(_0x51b19f,_0x4ff912){var _0x461e9c={},_0x534599={},_0x455480={'count':0x0,'rows':[]};var _0x3c18b2=_['map'](db[_0x0584('0x29')][_0x0584('0x2a')],function(_0x2867ee){return{'name':_0x2867ee['fieldName'],'type':_0x2867ee[_0x0584('0x2b')][_0x0584('0x2c')]};});_0x534599['model']=_[_0x0584('0x2d')](_0x3c18b2,_0x0584('0x2e'));_0x534599['query']=_[_0x0584('0x2f')](_0x51b19f['query']);_0x534599[_0x0584('0x30')]=_[_0x0584('0x31')](_0x534599[_0x0584('0x32')],_0x534599['query']);_0x461e9c['attributes']=_[_0x0584('0x31')](_0x534599[_0x0584('0x32')],qs[_0x0584('0x33')](_0x51b19f['query'][_0x0584('0x33')]));_0x461e9c[_0x0584('0x34')]=_0x461e9c[_0x0584('0x34')][_0x0584('0x35')]?_0x461e9c[_0x0584('0x34')]:_0x534599[_0x0584('0x32')];if(!_0x51b19f['query'][_0x0584('0x36')]('nolimit')){_0x461e9c[_0x0584('0x1a')]=qs[_0x0584('0x1a')](_0x51b19f['query'][_0x0584('0x1a')]);_0x461e9c[_0x0584('0x18')]=qs['offset'](_0x51b19f[_0x0584('0x37')][_0x0584('0x18')]);}_0x461e9c['order']=qs['sort'](_0x51b19f['query'][_0x0584('0x38')]);_0x461e9c[_0x0584('0x39')]=qs['filters'](_['pick'](_0x51b19f['query'],_0x534599['filters']),_0x3c18b2);if(_0x51b19f[_0x0584('0x37')][_0x0584('0x3a')]){_0x461e9c[_0x0584('0x39')]=_['merge'](_0x461e9c[_0x0584('0x39')],{'$or':_['map'](_0x3c18b2,function(_0x11ac5c){if(_0x11ac5c[_0x0584('0x2b')]!==_0x0584('0x3b')){var _0x3e4a82={};_0x3e4a82[_0x11ac5c[_0x0584('0x2e')]]={'$like':'%'+_0x51b19f['query'][_0x0584('0x3a')]+'%'};return _0x3e4a82;}})});}_0x461e9c=_[_0x0584('0x3c')]({},_0x461e9c,_0x51b19f[_0x0584('0x3d')]);var _0x208cb6={'where':_0x461e9c[_0x0584('0x39')]};return db[_0x0584('0x29')][_0x0584('0x1b')](_0x208cb6)['then'](function(_0x59af05){_0x455480[_0x0584('0x1b')]=_0x59af05;if(_0x51b19f[_0x0584('0x37')][_0x0584('0x3e')]){_0x461e9c[_0x0584('0x3f')]=[{'all':!![]}];}return db[_0x0584('0x29')]['findAll'](_0x461e9c);})[_0x0584('0x21')](function(_0x3d381d){_0x455480[_0x0584('0x40')]=_0x3d381d;return _0x455480;})[_0x0584('0x21')](respondWithFilteredResult(_0x4ff912,_0x461e9c))[_0x0584('0x41')](handleError(_0x4ff912,null));};exports[_0x0584('0x42')]=function(_0x586f73,_0x48d534){var _0x5cb9fb={'raw':![],'where':{'id':_0x586f73['params']['id']}},_0x33a62a={};_0x33a62a['model']=_[_0x0584('0x2f')](db['Dynamics365Configuration'][_0x0584('0x2a')]);_0x33a62a['query']=_[_0x0584('0x2f')](_0x586f73['query']);_0x33a62a[_0x0584('0x30')]=_['intersection'](_0x33a62a[_0x0584('0x32')],_0x33a62a[_0x0584('0x37')]);_0x5cb9fb[_0x0584('0x34')]=_[_0x0584('0x31')](_0x33a62a[_0x0584('0x32')],qs['fields'](_0x586f73[_0x0584('0x37')][_0x0584('0x33')]));_0x5cb9fb[_0x0584('0x34')]=_0x5cb9fb[_0x0584('0x34')][_0x0584('0x35')]?_0x5cb9fb[_0x0584('0x34')]:_0x33a62a[_0x0584('0x32')];if(_0x586f73[_0x0584('0x37')][_0x0584('0x3e')]){_0x5cb9fb['include']=[{'all':!![]}];}_0x5cb9fb=_[_0x0584('0x3c')]({},_0x5cb9fb,_0x586f73['options']);return db[_0x0584('0x29')][_0x0584('0x43')](_0x5cb9fb)['then'](handleEntityNotFound(_0x48d534,null))[_0x0584('0x21')](respondWithResult(_0x48d534,null))[_0x0584('0x41')](handleError(_0x48d534,null));};exports[_0x0584('0x44')]=function(_0x4cfb72,_0x5d86e7){return db[_0x0584('0x29')][_0x0584('0x44')](_0x4cfb72[_0x0584('0x45')],{})[_0x0584('0x21')](respondWithResult(_0x5d86e7,0xc9))[_0x0584('0x41')](handleError(_0x5d86e7,null));};exports[_0x0584('0x20')]=function(_0x192992,_0x47fca8){if(_0x192992[_0x0584('0x45')]['id']){delete _0x192992[_0x0584('0x45')]['id'];}return db[_0x0584('0x29')]['find']({'where':{'id':_0x192992[_0x0584('0x46')]['id']}})['then'](handleEntityNotFound(_0x47fca8,null))[_0x0584('0x21')](saveUpdates(_0x192992['body'],null))[_0x0584('0x21')](respondWithResult(_0x47fca8,null))[_0x0584('0x41')](handleError(_0x47fca8,null));};exports[_0x0584('0x22')]=function(_0x254ac5,_0x983bad){return db[_0x0584('0x29')]['find']({'where':{'id':_0x254ac5[_0x0584('0x46')]['id']}})[_0x0584('0x21')](handleEntityNotFound(_0x983bad,null))[_0x0584('0x21')](removeEntity(_0x983bad,null))['catch'](handleError(_0x983bad,null));};exports['getFields']=function(_0x35cfd2,_0xdc0ec2,_0xd5d8c0){var _0x2c0a05={};var _0x17112a={};var _0xe789dc;var _0x2edf86;return db[_0x0584('0x29')][_0x0584('0x47')]({'where':{'id':_0x35cfd2['params']['id']}})['then'](handleEntityNotFound(_0xdc0ec2,null))['then'](function(_0x5d30b8){if(_0x5d30b8){_0xe789dc=_0x5d30b8;_0x17112a['model']=_[_0x0584('0x2f')](db['Dynamics365Field']['rawAttributes']);_0x17112a[_0x0584('0x37')]=_[_0x0584('0x2f')](_0x35cfd2[_0x0584('0x37')]);_0x17112a[_0x0584('0x30')]=_['intersection'](_0x17112a['model'],_0x17112a[_0x0584('0x37')]);_0x2c0a05[_0x0584('0x34')]=_[_0x0584('0x31')](_0x17112a[_0x0584('0x32')],qs[_0x0584('0x33')](_0x35cfd2[_0x0584('0x37')][_0x0584('0x33')]));_0x2c0a05[_0x0584('0x34')]=_0x2c0a05['attributes'][_0x0584('0x35')]?_0x2c0a05['attributes']:_0x17112a[_0x0584('0x32')];_0x2c0a05['order']=qs[_0x0584('0x38')](_0x35cfd2[_0x0584('0x37')][_0x0584('0x38')]);_0x2c0a05[_0x0584('0x39')]=qs['filters'](_[_0x0584('0x48')](_0x35cfd2[_0x0584('0x37')],_0x17112a[_0x0584('0x30')]));if(_0x35cfd2[_0x0584('0x37')][_0x0584('0x3a')]){_0x2c0a05[_0x0584('0x39')]=_[_0x0584('0x3c')](_0x2c0a05[_0x0584('0x39')],{'$or':_['map'](_0x2c0a05['attributes'],function(_0x2646c7){var _0xb5aebc={};_0xb5aebc[_0x2646c7]={'$like':'%'+_0x35cfd2[_0x0584('0x37')][_0x0584('0x3a')]+'%'};return _0xb5aebc;})});}_0x2c0a05=_['merge']({},_0x2c0a05,_0x35cfd2['options']);return _0xe789dc[_0x0584('0x49')](_0x2c0a05);}})[_0x0584('0x21')](function(_0x29c738){if(_0x29c738){_0x2edf86=_0x29c738[_0x0584('0x35')];if(!_0x35cfd2['query'][_0x0584('0x36')]('nolimit')){_0x2c0a05['limit']=qs[_0x0584('0x1a')](_0x35cfd2['query'][_0x0584('0x1a')]);_0x2c0a05[_0x0584('0x18')]=qs[_0x0584('0x18')](_0x35cfd2[_0x0584('0x37')][_0x0584('0x18')]);}return _0xe789dc[_0x0584('0x49')](_0x2c0a05);}})[_0x0584('0x21')](function(_0x693e34){if(_0x693e34){return _0x693e34?{'count':_0x2edf86,'rows':_0x693e34}:null;}})['then'](respondWithResult(_0xdc0ec2,null))['catch'](handleError(_0xdc0ec2,null));};exports[_0x0584('0x4a')]=function(_0x44b0a8,_0x514dfb,_0x481cb9){var _0x320b1b={};var _0x4f7d16={};var _0x58e0d7;var _0x1145b4;return db[_0x0584('0x29')][_0x0584('0x47')]({'where':{'id':_0x44b0a8['params']['id']}})[_0x0584('0x21')](handleEntityNotFound(_0x514dfb,null))[_0x0584('0x21')](function(_0x33d879){if(_0x33d879){_0x58e0d7=_0x33d879;_0x4f7d16['model']=_['keys'](db[_0x0584('0x4b')]['rawAttributes']);_0x4f7d16['query']=_[_0x0584('0x2f')](_0x44b0a8[_0x0584('0x37')]);_0x4f7d16['filters']=_[_0x0584('0x31')](_0x4f7d16[_0x0584('0x32')],_0x4f7d16[_0x0584('0x37')]);_0x320b1b[_0x0584('0x34')]=_[_0x0584('0x31')](_0x4f7d16['model'],qs[_0x0584('0x33')](_0x44b0a8[_0x0584('0x37')][_0x0584('0x33')]));_0x320b1b[_0x0584('0x34')]=_0x320b1b[_0x0584('0x34')][_0x0584('0x35')]?_0x320b1b[_0x0584('0x34')]:_0x4f7d16['model'];_0x320b1b['order']=qs[_0x0584('0x38')](_0x44b0a8[_0x0584('0x37')][_0x0584('0x38')]);_0x320b1b[_0x0584('0x39')]=qs[_0x0584('0x30')](_[_0x0584('0x48')](_0x44b0a8[_0x0584('0x37')],_0x4f7d16[_0x0584('0x30')]));if(_0x44b0a8[_0x0584('0x37')]['filter']){_0x320b1b[_0x0584('0x39')]=_[_0x0584('0x3c')](_0x320b1b[_0x0584('0x39')],{'$or':_[_0x0584('0x2d')](_0x320b1b[_0x0584('0x34')],function(_0x8a5b89){var _0x35b162={};_0x35b162[_0x8a5b89]={'$like':'%'+_0x44b0a8[_0x0584('0x37')][_0x0584('0x3a')]+'%'};return _0x35b162;})});}_0x320b1b=_[_0x0584('0x3c')]({},_0x320b1b,_0x44b0a8[_0x0584('0x3d')]);return _0x58e0d7[_0x0584('0x4a')](_0x320b1b);}})[_0x0584('0x21')](function(_0x58b16a){if(_0x58b16a){_0x1145b4=_0x58b16a[_0x0584('0x35')];if(!_0x44b0a8[_0x0584('0x37')][_0x0584('0x36')](_0x0584('0x4c'))){_0x320b1b[_0x0584('0x1a')]=qs[_0x0584('0x1a')](_0x44b0a8[_0x0584('0x37')][_0x0584('0x1a')]);_0x320b1b['offset']=qs[_0x0584('0x18')](_0x44b0a8[_0x0584('0x37')][_0x0584('0x18')]);}return _0x58e0d7[_0x0584('0x4a')](_0x320b1b);}})[_0x0584('0x21')](function(_0x368463){if(_0x368463){return _0x368463?{'count':_0x1145b4,'rows':_0x368463}:null;}})[_0x0584('0x21')](respondWithResult(_0x514dfb,null))[_0x0584('0x41')](handleError(_0x514dfb,null));};exports[_0x0584('0x4d')]=function(_0x5e0cdd,_0x3b0ae6,_0x202a4a){var _0x58e25e={};var _0x2aa3e5={};var _0x4158f3;var _0x4fcf57;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x5e0cdd[_0x0584('0x46')]['id']}})[_0x0584('0x21')](handleEntityNotFound(_0x3b0ae6,null))[_0x0584('0x21')](function(_0x531b13){if(_0x531b13){_0x4158f3=_0x531b13;_0x2aa3e5[_0x0584('0x32')]=_[_0x0584('0x2f')](db[_0x0584('0x4b')]['rawAttributes']);_0x2aa3e5[_0x0584('0x37')]=_[_0x0584('0x2f')](_0x5e0cdd[_0x0584('0x37')]);_0x2aa3e5[_0x0584('0x30')]=_[_0x0584('0x31')](_0x2aa3e5[_0x0584('0x32')],_0x2aa3e5[_0x0584('0x37')]);_0x58e25e[_0x0584('0x34')]=_[_0x0584('0x31')](_0x2aa3e5[_0x0584('0x32')],qs[_0x0584('0x33')](_0x5e0cdd[_0x0584('0x37')][_0x0584('0x33')]));_0x58e25e[_0x0584('0x34')]=_0x58e25e[_0x0584('0x34')]['length']?_0x58e25e[_0x0584('0x34')]:_0x2aa3e5[_0x0584('0x32')];_0x58e25e[_0x0584('0x4e')]=qs[_0x0584('0x38')](_0x5e0cdd[_0x0584('0x37')][_0x0584('0x38')]);_0x58e25e['where']=qs[_0x0584('0x30')](_[_0x0584('0x48')](_0x5e0cdd['query'],_0x2aa3e5[_0x0584('0x30')]));if(_0x5e0cdd[_0x0584('0x37')][_0x0584('0x3a')]){_0x58e25e[_0x0584('0x39')]=_[_0x0584('0x3c')](_0x58e25e[_0x0584('0x39')],{'$or':_['map'](_0x58e25e[_0x0584('0x34')],function(_0x186147){var _0x174f24={};_0x174f24[_0x186147]={'$like':'%'+_0x5e0cdd['query'][_0x0584('0x3a')]+'%'};return _0x174f24;})});}_0x58e25e=_[_0x0584('0x3c')]({},_0x58e25e,_0x5e0cdd[_0x0584('0x3d')]);return _0x4158f3[_0x0584('0x4d')](_0x58e25e);}})[_0x0584('0x21')](function(_0x5224ce){if(_0x5224ce){_0x4fcf57=_0x5224ce[_0x0584('0x35')];if(!_0x5e0cdd['query']['hasOwnProperty'](_0x0584('0x4c'))){_0x58e25e[_0x0584('0x1a')]=qs[_0x0584('0x1a')](_0x5e0cdd[_0x0584('0x37')][_0x0584('0x1a')]);_0x58e25e[_0x0584('0x18')]=qs[_0x0584('0x18')](_0x5e0cdd[_0x0584('0x37')]['offset']);}return _0x4158f3[_0x0584('0x4d')](_0x58e25e);}})[_0x0584('0x21')](function(_0x2ba99b){if(_0x2ba99b){return _0x2ba99b?{'count':_0x4fcf57,'rows':_0x2ba99b}:null;}})[_0x0584('0x21')](respondWithResult(_0x3b0ae6,null))[_0x0584('0x41')](handleError(_0x3b0ae6,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 0931854..126baf4 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 _0x9a19=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0x9a19,0x114));var _0x99a1=function(_0x419e17,_0x7fe78c){_0x419e17=_0x419e17-0x0;var _0x1f2044=_0x9a19[_0x419e17];return _0x1f2044;};'use strict';var _=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var logger=require(_0x99a1('0x2'))('api');var moment=require(_0x99a1('0x3'));var BPromise=require(_0x99a1('0x4'));var rp=require(_0x99a1('0x5'));var fs=require('fs');var path=require(_0x99a1('0x6'));var rimraf=require(_0x99a1('0x7'));var config=require(_0x99a1('0x8'));var attributes=require(_0x99a1('0x9'));module[_0x99a1('0xa')]=function(_0x3eff4a,_0xff0240){return _0x3eff4a[_0x99a1('0xb')]('Dynamics365Configuration',attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34e8=['int_dynamics365_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration'];(function(_0xc00d11,_0x51fb84){var _0x473410=function(_0x13c11d){while(--_0x13c11d){_0xc00d11['push'](_0xc00d11['shift']());}};_0x473410(++_0x51fb84);}(_0x34e8,0x12c));var _0x834e=function(_0x2a8f4f,_0x4b1686){_0x2a8f4f=_0x2a8f4f-0x0;var _0x1b9f79=_0x34e8[_0x2a8f4f];return _0x1b9f79;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 94d0181..95cd70c 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 _0xbe33=['Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3d0366,_0x50211a){var _0x5ce75e=function(_0xc70777){while(--_0xc70777){_0x3d0366['push'](_0x3d0366['shift']());}};_0x5ce75e(++_0x50211a);}(_0xbe33,0xaf));var _0x3be3=function(_0x3df1ca,_0x49fb2a){_0x3df1ca=_0x3df1ca-0x0;var _0x5e7db8=_0xbe33[_0x3df1ca];return _0x5e7db8;};'use strict';var _=require('lodash');var util=require(_0x3be3('0x0'));var moment=require(_0x3be3('0x1'));var BPromise=require(_0x3be3('0x2'));var rs=require(_0x3be3('0x3'));var fs=require('fs');var Redis=require(_0x3be3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3be3('0x5'));var logger=require(_0x3be3('0x6'))('rpc');var config=require(_0x3be3('0x7'));var jayson=require(_0x3be3('0x8'));var client=jayson[_0x3be3('0x9')][_0x3be3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x74ba33,_0x55cd13,_0x5ac3a0){return new BPromise(function(_0x19c62d,_0x4e6d33){return client['request'](_0x74ba33,_0x5ac3a0)['then'](function(_0x1f3aab){logger['info'](_0x3be3('0xb'),_0x55cd13,_0x3be3('0xc'));logger[_0x3be3('0xd')](_0x3be3('0xe'),_0x55cd13,'request\x20sent',JSON['stringify'](_0x1f3aab));if(_0x1f3aab[_0x3be3('0xf')]){if(_0x1f3aab[_0x3be3('0xf')][_0x3be3('0x10')]===0x1f4){logger[_0x3be3('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x55cd13,_0x1f3aab[_0x3be3('0xf')][_0x3be3('0x11')]);return _0x4e6d33(_0x1f3aab[_0x3be3('0xf')][_0x3be3('0x11')]);}logger[_0x3be3('0xf')](_0x3be3('0xb'),_0x55cd13,_0x1f3aab[_0x3be3('0xf')][_0x3be3('0x11')]);return _0x19c62d(_0x1f3aab[_0x3be3('0xf')][_0x3be3('0x11')]);}else{logger[_0x3be3('0x12')](_0x3be3('0xb'),_0x55cd13,_0x3be3('0xc'));_0x19c62d(_0x1f3aab[_0x3be3('0x13')][_0x3be3('0x11')]);}})[_0x3be3('0x14')](function(_0x150af0){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x55cd13,_0x150af0);_0x4e6d33(_0x150af0);});});} \ No newline at end of file +var _0x97e2=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','error','code','message','info','lodash','util','moment','bluebird','randomstring'];(function(_0x40e48a,_0x5b7b5f){var _0x4bc0b3=function(_0x3ecb42){while(--_0x3ecb42){_0x40e48a['push'](_0x40e48a['shift']());}};_0x4bc0b3(++_0x5b7b5f);}(_0x97e2,0xf7));var _0x297e=function(_0x260347,_0x51b81d){_0x260347=_0x260347-0x0;var _0x299556=_0x97e2[_0x260347];return _0x299556;};'use strict';var _=require(_0x297e('0x0'));var util=require(_0x297e('0x1'));var moment=require(_0x297e('0x2'));var BPromise=require(_0x297e('0x3'));var rs=require(_0x297e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x297e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x297e('0x6'))('rpc');var config=require(_0x297e('0x7'));var jayson=require(_0x297e('0x8'));var client=jayson[_0x297e('0x9')][_0x297e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x407c9e,_0xb6fe08,_0x1ac4a2){return new BPromise(function(_0x168324,_0x1a3a88){return client['request'](_0x407c9e,_0x1ac4a2)[_0x297e('0xb')](function(_0x954a5f){logger['info'](_0x297e('0xc'),_0xb6fe08,_0x297e('0xd'));logger['debug']('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0xb6fe08,_0x297e('0xd'),JSON['stringify'](_0x954a5f));if(_0x954a5f[_0x297e('0xe')]){if(_0x954a5f[_0x297e('0xe')][_0x297e('0xf')]===0x1f4){logger[_0x297e('0xe')](_0x297e('0xc'),_0xb6fe08,_0x954a5f['error'][_0x297e('0x10')]);return _0x1a3a88(_0x954a5f[_0x297e('0xe')][_0x297e('0x10')]);}logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0xb6fe08,_0x954a5f[_0x297e('0xe')][_0x297e('0x10')]);return _0x168324(_0x954a5f[_0x297e('0xe')][_0x297e('0x10')]);}else{logger[_0x297e('0x11')](_0x297e('0xc'),_0xb6fe08,'request\x20sent');_0x168324(_0x954a5f['result'][_0x297e('0x10')]);}})['catch'](function(_0x1ba5ce){logger[_0x297e('0xe')]('Dynamics365Configuration,\x20%s,\x20%s',_0xb6fe08,_0x1ba5ce);_0x1a3a88(_0x1ba5ce);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 2a731eb..917342b 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 _0xef97=['./intDynamics365Field.controller','get','index','isAuthenticated','post','create','update','/:id','destroy','util','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x310e2c,_0x16abbc){var _0x509baf=function(_0x4a4008){while(--_0x4a4008){_0x310e2c['push'](_0x310e2c['shift']());}};_0x509baf(++_0x16abbc);}(_0xef97,0x81));var _0x7ef9=function(_0x290fa6,_0x16d017){_0x290fa6=_0x290fa6-0x0;var _0x47f1f3=_0xef97[_0x290fa6];return _0x47f1f3;};'use strict';var multer=require('multer');var util=require(_0x7ef9('0x0'));var path=require(_0x7ef9('0x1'));var timeout=require(_0x7ef9('0x2'));var express=require(_0x7ef9('0x3'));var router=express['Router']();var fs_extra=require(_0x7ef9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7ef9('0x5'));var config=require('../../config/environment');var controller=require(_0x7ef9('0x6'));router[_0x7ef9('0x7')]('/',auth['isAuthenticated'](),controller[_0x7ef9('0x8')]);router['get']('/:id',auth[_0x7ef9('0x9')](),controller['show']);router[_0x7ef9('0xa')]('/',auth[_0x7ef9('0x9')](),controller[_0x7ef9('0xb')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x7ef9('0xc')]);router['delete'](_0x7ef9('0xd'),auth[_0x7ef9('0x9')](),controller[_0x7ef9('0xe')]);module['exports']=router; \ No newline at end of file +var _0x4c19=['./intDynamics365Field.controller','isAuthenticated','index','get','/:id','show','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x3bf93f,_0x4694ad){var _0x203da7=function(_0x538839){while(--_0x538839){_0x3bf93f['push'](_0x3bf93f['shift']());}};_0x203da7(++_0x4694ad);}(_0x4c19,0x1e6));var _0x94c1=function(_0x562e4a,_0x105b81){_0x562e4a=_0x562e4a-0x0;var _0x338108=_0x4c19[_0x562e4a];return _0x338108;};'use strict';var multer=require(_0x94c1('0x0'));var util=require(_0x94c1('0x1'));var path=require(_0x94c1('0x2'));var timeout=require(_0x94c1('0x3'));var express=require('express');var router=express[_0x94c1('0x4')]();var fs_extra=require(_0x94c1('0x5'));var auth=require(_0x94c1('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x94c1('0x7'));var controller=require(_0x94c1('0x8'));router['get']('/',auth[_0x94c1('0x9')](),controller[_0x94c1('0xa')]);router[_0x94c1('0xb')](_0x94c1('0xc'),auth['isAuthenticated'](),controller[_0x94c1('0xd')]);router['post']('/',auth[_0x94c1('0x9')](),controller[_0x94c1('0xe')]);router[_0x94c1('0xf')](_0x94c1('0xc'),auth[_0x94c1('0x9')](),controller['update']);router[_0x94c1('0x10')](_0x94c1('0xc'),auth['isAuthenticated'](),controller[_0x94c1('0x11')]);module[_0x94c1('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 3e16e94..6fb5947 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 _0x827e=['STRING','customVariable','sequelize','exports','ENUM','variable','keyValue','string'];(function(_0x3edb26,_0x9613b4){var _0x4ad9f5=function(_0x5cb828){while(--_0x5cb828){_0x3edb26['push'](_0x3edb26['shift']());}};_0x4ad9f5(++_0x9613b4);}(_0x827e,0xda));var _0xe827=function(_0x1a4f07,_0x255c3e){_0x1a4f07=_0x1a4f07-0x0;var _0x32bb03=_0x827e[_0x1a4f07];return _0x32bb03;};'use strict';var Sequelize=require(_0xe827('0x0'));module[_0xe827('0x1')]={'type':{'type':Sequelize[_0xe827('0x2')]('string',_0xe827('0x3'),'customVariable',_0xe827('0x4'),'picklist'),'defaultValue':_0xe827('0x5')},'content':{'type':Sequelize[_0xe827('0x6')]},'key':{'type':Sequelize[_0xe827('0x6')]},'keyType':{'type':Sequelize[_0xe827('0x2')](_0xe827('0x5'),_0xe827('0x3'),_0xe827('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xe827('0x6')]},'nameField':{'type':Sequelize[_0xe827('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe8b6=['keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x1fbf45,_0x50a804){var _0x3bde9d=function(_0xd72eef){while(--_0xd72eef){_0x1fbf45['push'](_0x1fbf45['shift']());}};_0x3bde9d(++_0x50a804);}(_0xe8b6,0x109));var _0x6e8b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe8b6[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x6e8b('0x0'));module[_0x6e8b('0x1')]={'type':{'type':Sequelize[_0x6e8b('0x2')](_0x6e8b('0x3'),_0x6e8b('0x4'),'customVariable',_0x6e8b('0x5'),_0x6e8b('0x6')),'defaultValue':_0x6e8b('0x3')},'content':{'type':Sequelize[_0x6e8b('0x7')]},'key':{'type':Sequelize[_0x6e8b('0x7')]},'keyType':{'type':Sequelize[_0x6e8b('0x2')]('string','variable',_0x6e8b('0x8'))},'keyContent':{'type':Sequelize[_0x6e8b('0x7')]},'idField':{'type':Sequelize[_0x6e8b('0x7')]},'nameField':{'type':Sequelize[_0x6e8b('0x7')]},'customField':{'type':Sequelize[_0x6e8b('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6e8b('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index d3bd165..a671c80 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 _0x3106=['fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','json','reject','save','update','then','stack','name','map','Dynamics365Field','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','filter','merge','VIRTUAL','findAll','rows','catch','show','params','includeAll','options','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs'];(function(_0x5a3d9a,_0x3c1d3c){var _0x84a851=function(_0x558cc3){while(--_0x558cc3){_0x5a3d9a['push'](_0x5a3d9a['shift']());}};_0x84a851(++_0x3c1d3c);}(_0x3106,0x108));var _0x6310=function(_0x23ccad,_0x38ac0f){_0x23ccad=_0x23ccad-0x0;var _0x3bbfbc=_0x3106[_0x23ccad];return _0x3bbfbc;};'use strict';var emlformat=require(_0x6310('0x0'));var rimraf=require(_0x6310('0x1'));var zipdir=require(_0x6310('0x2'));var jsonpatch=require(_0x6310('0x3'));var rp=require(_0x6310('0x4'));var moment=require(_0x6310('0x5'));var BPromise=require(_0x6310('0x6'));var Mustache=require(_0x6310('0x7'));var util=require('util');var path=require(_0x6310('0x8'));var sox=require(_0x6310('0x9'));var csv=require(_0x6310('0xa'));var ejs=require(_0x6310('0xb'));var fs=require('fs');var fs_extra=require(_0x6310('0xc'));var _=require('lodash');var squel=require(_0x6310('0xd'));var crypto=require(_0x6310('0xe'));var jsforce=require(_0x6310('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6310('0x10'));var Papa=require(_0x6310('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6310('0x12'));var as=require(_0x6310('0x13'));var hardwareService=require(_0x6310('0x14'));var logger=require(_0x6310('0x15'))(_0x6310('0x16'));var utils=require('../../config/utils');var config=require(_0x6310('0x17'));var licenseUtil=require(_0x6310('0x18'));var db=require(_0x6310('0x19'))['db'];function respondWithStatusCode(_0x1f2aff,_0xf3e9da){_0xf3e9da=_0xf3e9da||0xcc;return function(_0x23722a){if(_0x23722a){return _0x1f2aff[_0x6310('0x1a')](_0xf3e9da);}return _0x1f2aff[_0x6310('0x1b')](_0xf3e9da)[_0x6310('0x1c')]();};}function respondWithResult(_0x2a9007,_0x15d215){_0x15d215=_0x15d215||0xc8;return function(_0x3ae3dd){if(_0x3ae3dd){return _0x2a9007[_0x6310('0x1b')](_0x15d215)['json'](_0x3ae3dd);}};}function respondWithFilteredResult(_0xf9c9f5,_0x348a8f){return function(_0x2ebfb4){if(_0x2ebfb4){var _0x249d0e=typeof _0x348a8f['offset']===_0x6310('0x1d')&&typeof _0x348a8f[_0x6310('0x1e')]===_0x6310('0x1d');var _0x33bf33=_0x2ebfb4[_0x6310('0x1f')];var _0x5c4186=_0x249d0e?0x0:_0x348a8f[_0x6310('0x20')];var _0x33548a=_0x249d0e?_0x2ebfb4[_0x6310('0x1f')]:_0x348a8f[_0x6310('0x20')]+_0x348a8f[_0x6310('0x1e')];var _0x349d69;if(_0x33548a>=_0x33bf33){_0x33548a=_0x33bf33;_0x349d69=0xc8;}else{_0x349d69=0xce;}_0xf9c9f5['status'](_0x349d69);return _0xf9c9f5['set']('Content-Range',_0x5c4186+'-'+_0x33548a+'/'+_0x33bf33)[_0x6310('0x21')](_0x2ebfb4);}return null;};}function patchUpdates(_0x3b6334){return function(_0x124f55){try{jsonpatch['apply'](_0x124f55,_0x3b6334,!![]);}catch(_0x1bd410){return BPromise[_0x6310('0x22')](_0x1bd410);}return _0x124f55[_0x6310('0x23')]();};}function saveUpdates(_0x20aa6a,_0xfe9425){return function(_0x562c38){if(_0x562c38){return _0x562c38[_0x6310('0x24')](_0x20aa6a)[_0x6310('0x25')](function(_0x1b3f11){return _0x1b3f11;});}return null;};}function removeEntity(_0x135ae9,_0x394594){return function(_0x573976){if(_0x573976){return _0x573976['destroy']()['then'](function(){_0x135ae9[_0x6310('0x1b')](0xcc)[_0x6310('0x1c')]();});}};}function handleEntityNotFound(_0x5ad9b1,_0xadb43c){return function(_0xe969a3){if(!_0xe969a3){_0x5ad9b1[_0x6310('0x1a')](0x194);}return _0xe969a3;};}function handleError(_0x5aa6ee,_0x3a1616){_0x3a1616=_0x3a1616||0x1f4;return function(_0x2f2f72){logger['error'](_0x2f2f72[_0x6310('0x26')]);if(_0x2f2f72['name']){delete _0x2f2f72[_0x6310('0x27')];}_0x5aa6ee['status'](_0x3a1616)['send'](_0x2f2f72);};}exports['index']=function(_0x23f1d3,_0x5662da){var _0x100bdc={},_0x2ba6e={},_0x596ea4={'count':0x0,'rows':[]};var _0x299baa=_[_0x6310('0x28')](db[_0x6310('0x29')][_0x6310('0x2a')],function(_0x309a2e){return{'name':_0x309a2e[_0x6310('0x2b')],'type':_0x309a2e[_0x6310('0x2c')]['key']};});_0x2ba6e[_0x6310('0x2d')]=_[_0x6310('0x28')](_0x299baa,_0x6310('0x27'));_0x2ba6e[_0x6310('0x2e')]=_[_0x6310('0x2f')](_0x23f1d3[_0x6310('0x2e')]);_0x2ba6e[_0x6310('0x30')]=_[_0x6310('0x31')](_0x2ba6e[_0x6310('0x2d')],_0x2ba6e['query']);_0x100bdc[_0x6310('0x32')]=_['intersection'](_0x2ba6e[_0x6310('0x2d')],qs[_0x6310('0x33')](_0x23f1d3['query']['fields']));_0x100bdc[_0x6310('0x32')]=_0x100bdc[_0x6310('0x32')][_0x6310('0x34')]?_0x100bdc[_0x6310('0x32')]:_0x2ba6e[_0x6310('0x2d')];if(!_0x23f1d3[_0x6310('0x2e')]['hasOwnProperty']('nolimit')){_0x100bdc[_0x6310('0x1e')]=qs[_0x6310('0x1e')](_0x23f1d3[_0x6310('0x2e')][_0x6310('0x1e')]);_0x100bdc[_0x6310('0x20')]=qs[_0x6310('0x20')](_0x23f1d3[_0x6310('0x2e')][_0x6310('0x20')]);}_0x100bdc[_0x6310('0x35')]=qs['sort'](_0x23f1d3[_0x6310('0x2e')][_0x6310('0x36')]);_0x100bdc[_0x6310('0x37')]=qs[_0x6310('0x30')](_['pick'](_0x23f1d3[_0x6310('0x2e')],_0x2ba6e['filters']),_0x299baa);if(_0x23f1d3['query'][_0x6310('0x38')]){_0x100bdc[_0x6310('0x37')]=_[_0x6310('0x39')](_0x100bdc['where'],{'$or':_[_0x6310('0x28')](_0x299baa,function(_0x7926c6){if(_0x7926c6[_0x6310('0x2c')]!==_0x6310('0x3a')){var _0x391031={};_0x391031[_0x7926c6['name']]={'$like':'%'+_0x23f1d3['query'][_0x6310('0x38')]+'%'};return _0x391031;}})});}_0x100bdc=_[_0x6310('0x39')]({},_0x100bdc,_0x23f1d3['options']);var _0xcb28b5={'where':_0x100bdc[_0x6310('0x37')]};return db[_0x6310('0x29')]['count'](_0xcb28b5)[_0x6310('0x25')](function(_0x14a4ff){_0x596ea4['count']=_0x14a4ff;if(_0x23f1d3[_0x6310('0x2e')]['includeAll']){_0x100bdc['include']=[{'all':!![]}];}return db['Dynamics365Field'][_0x6310('0x3b')](_0x100bdc);})[_0x6310('0x25')](function(_0x3a7916){_0x596ea4[_0x6310('0x3c')]=_0x3a7916;return _0x596ea4;})[_0x6310('0x25')](respondWithFilteredResult(_0x5662da,_0x100bdc))[_0x6310('0x3d')](handleError(_0x5662da,null));};exports[_0x6310('0x3e')]=function(_0x44f82e,_0x4c71ce){var _0x34ea35={'raw':!![],'where':{'id':_0x44f82e[_0x6310('0x3f')]['id']}},_0x307fd9={};_0x307fd9[_0x6310('0x2d')]=_[_0x6310('0x2f')](db['Dynamics365Field'][_0x6310('0x2a')]);_0x307fd9[_0x6310('0x2e')]=_['keys'](_0x44f82e['query']);_0x307fd9[_0x6310('0x30')]=_[_0x6310('0x31')](_0x307fd9[_0x6310('0x2d')],_0x307fd9[_0x6310('0x2e')]);_0x34ea35[_0x6310('0x32')]=_[_0x6310('0x31')](_0x307fd9[_0x6310('0x2d')],qs[_0x6310('0x33')](_0x44f82e[_0x6310('0x2e')][_0x6310('0x33')]));_0x34ea35['attributes']=_0x34ea35[_0x6310('0x32')][_0x6310('0x34')]?_0x34ea35[_0x6310('0x32')]:_0x307fd9[_0x6310('0x2d')];if(_0x44f82e['query'][_0x6310('0x40')]){_0x34ea35['include']=[{'all':!![]}];}_0x34ea35=_[_0x6310('0x39')]({},_0x34ea35,_0x44f82e[_0x6310('0x41')]);return db[_0x6310('0x29')]['find'](_0x34ea35)['then'](handleEntityNotFound(_0x4c71ce,null))['then'](respondWithResult(_0x4c71ce,null))[_0x6310('0x3d')](handleError(_0x4c71ce,null));};exports['create']=function(_0x292337,_0x258dc1){return db[_0x6310('0x29')][_0x6310('0x42')](_0x292337[_0x6310('0x43')],{})[_0x6310('0x25')](respondWithResult(_0x258dc1,0xc9))[_0x6310('0x3d')](handleError(_0x258dc1,null));};exports[_0x6310('0x24')]=function(_0x2ca0fb,_0x5bc8f9){if(_0x2ca0fb[_0x6310('0x43')]['id']){delete _0x2ca0fb['body']['id'];}return db[_0x6310('0x29')][_0x6310('0x44')]({'where':{'id':_0x2ca0fb[_0x6310('0x3f')]['id']}})[_0x6310('0x25')](handleEntityNotFound(_0x5bc8f9,null))[_0x6310('0x25')](saveUpdates(_0x2ca0fb['body'],null))[_0x6310('0x25')](respondWithResult(_0x5bc8f9,null))[_0x6310('0x3d')](handleError(_0x5bc8f9,null));};exports['destroy']=function(_0x49cfa7,_0x176af8){return db['Dynamics365Field'][_0x6310('0x44')]({'where':{'id':_0x49cfa7[_0x6310('0x3f')]['id']}})['then'](handleEntityNotFound(_0x176af8,null))[_0x6310('0x25')](removeEntity(_0x176af8,null))[_0x6310('0x3d')](handleError(_0x176af8,null));}; \ No newline at end of file +var _0xf9b9=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','sendStatus','error','stack','name','map','Dynamics365Field','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','offset','pick','merge','where','type','VIRTUAL','filter','includeAll','include','rows','catch','show','length','options','find','create','body','params','destroy'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0xf9b9,0x1bc));var _0x9f9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf9b9[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x9f9b('0x0'));var rimraf=require(_0x9f9b('0x1'));var zipdir=require(_0x9f9b('0x2'));var jsonpatch=require(_0x9f9b('0x3'));var rp=require(_0x9f9b('0x4'));var moment=require(_0x9f9b('0x5'));var BPromise=require(_0x9f9b('0x6'));var Mustache=require(_0x9f9b('0x7'));var util=require(_0x9f9b('0x8'));var path=require(_0x9f9b('0x9'));var sox=require(_0x9f9b('0xa'));var csv=require(_0x9f9b('0xb'));var ejs=require(_0x9f9b('0xc'));var fs=require('fs');var fs_extra=require(_0x9f9b('0xd'));var _=require(_0x9f9b('0xe'));var squel=require(_0x9f9b('0xf'));var crypto=require(_0x9f9b('0x10'));var jsforce=require(_0x9f9b('0x11'));var deskjs=require(_0x9f9b('0x12'));var toCsv=require(_0x9f9b('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9f9b('0x13'));var authService=require(_0x9f9b('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x9f9b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9f9b('0x16'))(_0x9f9b('0x17'));var utils=require(_0x9f9b('0x18'));var config=require(_0x9f9b('0x19'));var licenseUtil=require(_0x9f9b('0x1a'));var db=require(_0x9f9b('0x1b'))['db'];function respondWithStatusCode(_0x4e96f5,_0x5f49cb){_0x5f49cb=_0x5f49cb||0xcc;return function(_0x815071){if(_0x815071){return _0x4e96f5['sendStatus'](_0x5f49cb);}return _0x4e96f5[_0x9f9b('0x1c')](_0x5f49cb)['end']();};}function respondWithResult(_0x3bb63f,_0x3a56c9){_0x3a56c9=_0x3a56c9||0xc8;return function(_0x25352c){if(_0x25352c){return _0x3bb63f['status'](_0x3a56c9)['json'](_0x25352c);}};}function respondWithFilteredResult(_0x329135,_0x4d9e2d){return function(_0x4cc755){if(_0x4cc755){var _0x1028ab=typeof _0x4d9e2d['offset']===_0x9f9b('0x1d')&&typeof _0x4d9e2d[_0x9f9b('0x1e')]===_0x9f9b('0x1d');var _0x383658=_0x4cc755['count'];var _0x5ae1f5=_0x1028ab?0x0:_0x4d9e2d['offset'];var _0x599f71=_0x1028ab?_0x4cc755[_0x9f9b('0x1f')]:_0x4d9e2d['offset']+_0x4d9e2d[_0x9f9b('0x1e')];var _0x39ef9c;if(_0x599f71>=_0x383658){_0x599f71=_0x383658;_0x39ef9c=0xc8;}else{_0x39ef9c=0xce;}_0x329135[_0x9f9b('0x1c')](_0x39ef9c);return _0x329135[_0x9f9b('0x20')](_0x9f9b('0x21'),_0x5ae1f5+'-'+_0x599f71+'/'+_0x383658)['json'](_0x4cc755);}return null;};}function patchUpdates(_0x1624e1){return function(_0x499a01){try{jsonpatch[_0x9f9b('0x22')](_0x499a01,_0x1624e1,!![]);}catch(_0x56b6ca){return BPromise[_0x9f9b('0x23')](_0x56b6ca);}return _0x499a01[_0x9f9b('0x24')]();};}function saveUpdates(_0x3d7e72,_0x183cca){return function(_0x520456){if(_0x520456){return _0x520456[_0x9f9b('0x25')](_0x3d7e72)[_0x9f9b('0x26')](function(_0xd7e154){return _0xd7e154;});}return null;};}function removeEntity(_0x1c6076,_0x446e37){return function(_0x43d226){if(_0x43d226){return _0x43d226['destroy']()['then'](function(){_0x1c6076['status'](0xcc)[_0x9f9b('0x27')]();});}};}function handleEntityNotFound(_0xe44fcc,_0x3fdf20){return function(_0x17681b){if(!_0x17681b){_0xe44fcc[_0x9f9b('0x28')](0x194);}return _0x17681b;};}function handleError(_0x539dd8,_0x72c1ee){_0x72c1ee=_0x72c1ee||0x1f4;return function(_0xab45bd){logger[_0x9f9b('0x29')](_0xab45bd[_0x9f9b('0x2a')]);if(_0xab45bd[_0x9f9b('0x2b')]){delete _0xab45bd[_0x9f9b('0x2b')];}_0x539dd8[_0x9f9b('0x1c')](_0x72c1ee)['send'](_0xab45bd);};}exports['index']=function(_0x372532,_0x154ce3){var _0x680190={},_0x5c39d0={},_0x432f59={'count':0x0,'rows':[]};var _0x5e5167=_[_0x9f9b('0x2c')](db[_0x9f9b('0x2d')][_0x9f9b('0x2e')],function(_0xbf56ff){return{'name':_0xbf56ff['fieldName'],'type':_0xbf56ff['type'][_0x9f9b('0x2f')]};});_0x5c39d0[_0x9f9b('0x30')]=_[_0x9f9b('0x2c')](_0x5e5167,'name');_0x5c39d0[_0x9f9b('0x31')]=_[_0x9f9b('0x32')](_0x372532[_0x9f9b('0x31')]);_0x5c39d0[_0x9f9b('0x33')]=_[_0x9f9b('0x34')](_0x5c39d0[_0x9f9b('0x30')],_0x5c39d0[_0x9f9b('0x31')]);_0x680190['attributes']=_[_0x9f9b('0x34')](_0x5c39d0['model'],qs[_0x9f9b('0x35')](_0x372532['query']['fields']));_0x680190[_0x9f9b('0x36')]=_0x680190[_0x9f9b('0x36')]['length']?_0x680190['attributes']:_0x5c39d0[_0x9f9b('0x30')];if(!_0x372532[_0x9f9b('0x31')]['hasOwnProperty']('nolimit')){_0x680190[_0x9f9b('0x1e')]=qs[_0x9f9b('0x1e')](_0x372532[_0x9f9b('0x31')][_0x9f9b('0x1e')]);_0x680190[_0x9f9b('0x37')]=qs[_0x9f9b('0x37')](_0x372532['query'][_0x9f9b('0x37')]);}_0x680190['order']=qs['sort'](_0x372532[_0x9f9b('0x31')]['sort']);_0x680190['where']=qs['filters'](_[_0x9f9b('0x38')](_0x372532['query'],_0x5c39d0['filters']),_0x5e5167);if(_0x372532[_0x9f9b('0x31')]['filter']){_0x680190['where']=_[_0x9f9b('0x39')](_0x680190[_0x9f9b('0x3a')],{'$or':_[_0x9f9b('0x2c')](_0x5e5167,function(_0x166745){if(_0x166745[_0x9f9b('0x3b')]!==_0x9f9b('0x3c')){var _0x56e283={};_0x56e283[_0x166745[_0x9f9b('0x2b')]]={'$like':'%'+_0x372532[_0x9f9b('0x31')][_0x9f9b('0x3d')]+'%'};return _0x56e283;}})});}_0x680190=_[_0x9f9b('0x39')]({},_0x680190,_0x372532['options']);var _0x3e628f={'where':_0x680190['where']};return db[_0x9f9b('0x2d')][_0x9f9b('0x1f')](_0x3e628f)[_0x9f9b('0x26')](function(_0x49c142){_0x432f59[_0x9f9b('0x1f')]=_0x49c142;if(_0x372532[_0x9f9b('0x31')][_0x9f9b('0x3e')]){_0x680190[_0x9f9b('0x3f')]=[{'all':!![]}];}return db[_0x9f9b('0x2d')]['findAll'](_0x680190);})[_0x9f9b('0x26')](function(_0xc5843d){_0x432f59[_0x9f9b('0x40')]=_0xc5843d;return _0x432f59;})[_0x9f9b('0x26')](respondWithFilteredResult(_0x154ce3,_0x680190))[_0x9f9b('0x41')](handleError(_0x154ce3,null));};exports[_0x9f9b('0x42')]=function(_0x3ac3e1,_0x150811){var _0x2cf5cb={'raw':!![],'where':{'id':_0x3ac3e1['params']['id']}},_0x5352d1={};_0x5352d1[_0x9f9b('0x30')]=_['keys'](db[_0x9f9b('0x2d')][_0x9f9b('0x2e')]);_0x5352d1['query']=_['keys'](_0x3ac3e1['query']);_0x5352d1['filters']=_['intersection'](_0x5352d1[_0x9f9b('0x30')],_0x5352d1['query']);_0x2cf5cb[_0x9f9b('0x36')]=_[_0x9f9b('0x34')](_0x5352d1[_0x9f9b('0x30')],qs['fields'](_0x3ac3e1[_0x9f9b('0x31')]['fields']));_0x2cf5cb['attributes']=_0x2cf5cb[_0x9f9b('0x36')][_0x9f9b('0x43')]?_0x2cf5cb[_0x9f9b('0x36')]:_0x5352d1[_0x9f9b('0x30')];if(_0x3ac3e1[_0x9f9b('0x31')][_0x9f9b('0x3e')]){_0x2cf5cb[_0x9f9b('0x3f')]=[{'all':!![]}];}_0x2cf5cb=_[_0x9f9b('0x39')]({},_0x2cf5cb,_0x3ac3e1[_0x9f9b('0x44')]);return db[_0x9f9b('0x2d')][_0x9f9b('0x45')](_0x2cf5cb)[_0x9f9b('0x26')](handleEntityNotFound(_0x150811,null))['then'](respondWithResult(_0x150811,null))['catch'](handleError(_0x150811,null));};exports[_0x9f9b('0x46')]=function(_0x1951fe,_0x3983f4){return db[_0x9f9b('0x2d')][_0x9f9b('0x46')](_0x1951fe[_0x9f9b('0x47')],{})['then'](respondWithResult(_0x3983f4,0xc9))[_0x9f9b('0x41')](handleError(_0x3983f4,null));};exports['update']=function(_0x1ec472,_0xfe79af){if(_0x1ec472[_0x9f9b('0x47')]['id']){delete _0x1ec472[_0x9f9b('0x47')]['id'];}return db['Dynamics365Field'][_0x9f9b('0x45')]({'where':{'id':_0x1ec472[_0x9f9b('0x48')]['id']}})[_0x9f9b('0x26')](handleEntityNotFound(_0xfe79af,null))[_0x9f9b('0x26')](saveUpdates(_0x1ec472['body'],null))[_0x9f9b('0x26')](respondWithResult(_0xfe79af,null))['catch'](handleError(_0xfe79af,null));};exports[_0x9f9b('0x49')]=function(_0x3b3552,_0x48a996){return db['Dynamics365Field'][_0x9f9b('0x45')]({'where':{'id':_0x3b3552[_0x9f9b('0x48')]['id']}})[_0x9f9b('0x26')](handleEntityNotFound(_0x48a996,null))[_0x9f9b('0x26')](removeEntity(_0x48a996,null))['catch'](handleError(_0x48a996,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 1dc6737..aacb67d 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 _0x354d=['exports','Dynamics365Field','int_dynamics365_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3416d9,_0x6a56f9){var _0x589ad9=function(_0x451180){while(--_0x451180){_0x3416d9['push'](_0x3416d9['shift']());}};_0x589ad9(++_0x6a56f9);}(_0x354d,0xc3));var _0xd354=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x354d[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xd354('0x0'));var util=require(_0xd354('0x1'));var logger=require(_0xd354('0x2'))(_0xd354('0x3'));var moment=require(_0xd354('0x4'));var BPromise=require(_0xd354('0x5'));var rp=require(_0xd354('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd354('0x7'));var config=require(_0xd354('0x8'));var attributes=require('./intDynamics365Field.attributes');module[_0xd354('0x9')]=function(_0x16691f,_0x48b11d){return _0x16691f['define'](_0xd354('0xa'),attributes,{'tableName':_0xd354('0xb'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4b84=['api','moment','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash'];(function(_0x514b14,_0x22a2b2){var _0x464fbb=function(_0x58b180){while(--_0x58b180){_0x514b14['push'](_0x514b14['shift']());}};_0x464fbb(++_0x22a2b2);}(_0x4b84,0x144));var _0x44b8=function(_0xf48cce,_0x3531e4){_0xf48cce=_0xf48cce-0x0;var _0x2a5c38=_0x4b84[_0xf48cce];return _0x2a5c38;};'use strict';var _=require(_0x44b8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x44b8('0x1'));var moment=require(_0x44b8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x44b8('0x3'));var config=require(_0x44b8('0x4'));var attributes=require(_0x44b8('0x5'));module[_0x44b8('0x6')]=function(_0x599d28,_0x40cdbf){return _0x599d28[_0x44b8('0x7')](_0x44b8('0x8'),attributes,{'tableName':_0x44b8('0x9'),'paranoid':![],'indexes':[{'name':_0x44b8('0xa'),'fields':[_0x44b8('0xb'),_0x44b8('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index da61bce..e9e9de5 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 _0xd760=['util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','Dynamics365Field,\x20%s,\x20%s','result','catch'];(function(_0x978dac,_0x112988){var _0x352f91=function(_0x3325fa){while(--_0x3325fa){_0x978dac['push'](_0x978dac['shift']());}};_0x352f91(++_0x112988);}(_0xd760,0x1b8));var _0x0d76=function(_0x3890b5,_0x57ae7b){_0x3890b5=_0x3890b5-0x0;var _0x326afc=_0xd760[_0x3890b5];return _0x326afc;};'use strict';var _=require('lodash');var util=require(_0x0d76('0x0'));var moment=require(_0x0d76('0x1'));var BPromise=require(_0x0d76('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0d76('0x3'))['db'];var utils=require(_0x0d76('0x4'));var logger=require(_0x0d76('0x5'))(_0x0d76('0x6'));var config=require(_0x0d76('0x7'));var jayson=require(_0x0d76('0x8'));var client=jayson[_0x0d76('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x51d534,_0x4ee886,_0x1e4e56){return new BPromise(function(_0x521c8c,_0x4ad49a){return client['request'](_0x51d534,_0x1e4e56)[_0x0d76('0xa')](function(_0x1ef199){logger[_0x0d76('0xb')]('Dynamics365Field,\x20%s,\x20%s',_0x4ee886,'request\x20sent');logger[_0x0d76('0xc')](_0x0d76('0xd'),_0x4ee886,_0x0d76('0xe'),JSON['stringify'](_0x1ef199));if(_0x1ef199[_0x0d76('0xf')]){if(_0x1ef199[_0x0d76('0xf')]['code']===0x1f4){logger[_0x0d76('0xf')]('Dynamics365Field,\x20%s,\x20%s',_0x4ee886,_0x1ef199[_0x0d76('0xf')]['message']);return _0x4ad49a(_0x1ef199[_0x0d76('0xf')]['message']);}logger[_0x0d76('0xf')]('Dynamics365Field,\x20%s,\x20%s',_0x4ee886,_0x1ef199[_0x0d76('0xf')][_0x0d76('0x10')]);return _0x521c8c(_0x1ef199['error']['message']);}else{logger['info'](_0x0d76('0x11'),_0x4ee886,_0x0d76('0xe'));_0x521c8c(_0x1ef199[_0x0d76('0x12')][_0x0d76('0x10')]);}})[_0x0d76('0x13')](function(_0x3b4964){logger[_0x0d76('0xf')](_0x0d76('0x11'),_0x4ee886,_0x3b4964);_0x4ad49a(_0x3b4964);});});} \ No newline at end of file +var _0x56da=['util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x56da,0x103));var _0xa56d=function(_0x53d172,_0x46611b){_0x53d172=_0x53d172-0x0;var _0x1bd0a2=_0x56da[_0x53d172];return _0x1bd0a2;};'use strict';var _=require(_0xa56d('0x0'));var util=require(_0xa56d('0x1'));var moment=require(_0xa56d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa56d('0x3'));var db=require(_0xa56d('0x4'))['db'];var utils=require(_0xa56d('0x5'));var logger=require(_0xa56d('0x6'))(_0xa56d('0x7'));var config=require(_0xa56d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa56d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e9431,_0x45fed0,_0x5624a8){return new BPromise(function(_0x1fd93a,_0x6b6675){return client[_0xa56d('0xa')](_0x4e9431,_0x5624a8)[_0xa56d('0xb')](function(_0x57d2de){logger[_0xa56d('0xc')](_0xa56d('0xd'),_0x45fed0,'request\x20sent');logger['debug']('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x45fed0,_0xa56d('0xe'),JSON[_0xa56d('0xf')](_0x57d2de));if(_0x57d2de[_0xa56d('0x10')]){if(_0x57d2de['error'][_0xa56d('0x11')]===0x1f4){logger['error'](_0xa56d('0xd'),_0x45fed0,_0x57d2de[_0xa56d('0x10')][_0xa56d('0x12')]);return _0x6b6675(_0x57d2de[_0xa56d('0x10')][_0xa56d('0x12')]);}logger[_0xa56d('0x10')](_0xa56d('0xd'),_0x45fed0,_0x57d2de[_0xa56d('0x10')]['message']);return _0x1fd93a(_0x57d2de[_0xa56d('0x10')][_0xa56d('0x12')]);}else{logger['info'](_0xa56d('0xd'),_0x45fed0,'request\x20sent');_0x1fd93a(_0x57d2de['result'][_0xa56d('0x12')]);}})[_0xa56d('0x13')](function(_0x29de76){logger[_0xa56d('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0x45fed0,_0x29de76);_0x6b6675(_0x29de76);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index dea5ad6..700d265 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 _0xfc50=['getConfigurations','/:id/fields','post','create','/:id/configurations','addConfiguration','put','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','/:id'];(function(_0x530caf,_0x1924d6){var _0x1bccd8=function(_0x27a10f){while(--_0x27a10f){_0x530caf['push'](_0x530caf['shift']());}};_0x1bccd8(++_0x1924d6);}(_0xfc50,0x180));var _0x0fc5=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xfc50[_0x4e9628];return _0x27bc8c;};'use strict';var multer=require(_0x0fc5('0x0'));var util=require('util');var path=require(_0x0fc5('0x1'));var timeout=require(_0x0fc5('0x2'));var express=require(_0x0fc5('0x3'));var router=express['Router']();var fs_extra=require(_0x0fc5('0x4'));var auth=require(_0x0fc5('0x5'));var interaction=require(_0x0fc5('0x6'));var config=require(_0x0fc5('0x7'));var controller=require(_0x0fc5('0x8'));router[_0x0fc5('0x9')]('/',auth[_0x0fc5('0xa')](),controller['index']);router[_0x0fc5('0x9')](_0x0fc5('0xb'),auth[_0x0fc5('0xa')](),controller['show']);router[_0x0fc5('0x9')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0fc5('0xc')]);router[_0x0fc5('0x9')](_0x0fc5('0xd'),auth[_0x0fc5('0xa')](),controller['getFields']);router[_0x0fc5('0xe')]('/',auth['isAuthenticated'](),controller[_0x0fc5('0xf')]);router[_0x0fc5('0xe')](_0x0fc5('0x10'),auth[_0x0fc5('0xa')](),controller[_0x0fc5('0x11')]);router[_0x0fc5('0x12')](_0x0fc5('0xb'),auth[_0x0fc5('0xa')](),controller[_0x0fc5('0x13')]);router[_0x0fc5('0x14')](_0x0fc5('0xb'),auth[_0x0fc5('0xa')](),controller['destroy']);module[_0x0fc5('0x15')]=router; \ No newline at end of file +var _0x260c=['connect-timeout','express','Router','fs-extra','get','isAuthenticated','show','/:id/configurations','post','create','addConfiguration','put','/:id','update','delete','destroy','multer','util','path'];(function(_0x3dda0f,_0x5b9902){var _0x1b0488=function(_0x267031){while(--_0x267031){_0x3dda0f['push'](_0x3dda0f['shift']());}};_0x1b0488(++_0x5b9902);}(_0x260c,0xf4));var _0xc260=function(_0x3e858f,_0x4bf7e0){_0x3e858f=_0x3e858f-0x0;var _0x22244c=_0x260c[_0x3e858f];return _0x22244c;};'use strict';var multer=require(_0xc260('0x0'));var util=require(_0xc260('0x1'));var path=require(_0xc260('0x2'));var timeout=require(_0xc260('0x3'));var express=require(_0xc260('0x4'));var router=express[_0xc260('0x5')]();var fs_extra=require(_0xc260('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intFreshdeskAccount.controller');router[_0xc260('0x7')]('/',auth[_0xc260('0x8')](),controller['index']);router[_0xc260('0x7')]('/:id',auth[_0xc260('0x8')](),controller[_0xc260('0x9')]);router[_0xc260('0x7')](_0xc260('0xa'),auth[_0xc260('0x8')](),controller['getConfigurations']);router[_0xc260('0x7')]('/:id/fields',auth[_0xc260('0x8')](),controller['getFields']);router[_0xc260('0xb')]('/',auth['isAuthenticated'](),controller[_0xc260('0xc')]);router[_0xc260('0xb')]('/:id/configurations',auth[_0xc260('0x8')](),controller[_0xc260('0xd')]);router[_0xc260('0xe')](_0xc260('0xf'),auth[_0xc260('0x8')](),controller[_0xc260('0x10')]);router[_0xc260('0x11')](_0xc260('0xf'),auth[_0xc260('0x8')](),controller[_0xc260('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 64b2959..14a9bfb 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 _0xf4f4=['exports','STRING','username','sequelize'];(function(_0x30d4c3,_0x35136d){var _0x7c7dad=function(_0x326fb0){while(--_0x326fb0){_0x30d4c3['push'](_0x30d4c3['shift']());}};_0x7c7dad(++_0x35136d);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x12beaf,_0xf1274a){_0x12beaf=_0x12beaf-0x0;var _0x583a2d=_0xf4f4[_0x12beaf];return _0x583a2d;};'use strict';var Sequelize=require(_0x4f4f('0x0'));module[_0x4f4f('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4f4f('0x2')]},'username':{'type':Sequelize[_0x4f4f('0x2')],'unique':_0x4f4f('0x3')},'apiKey':{'type':Sequelize[_0x4f4f('0x2')]},'remoteUri':{'type':Sequelize[_0x4f4f('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x4f4f('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x02ce=['sequelize','exports','STRING','remoteUri'];(function(_0x16cbdf,_0x45b941){var _0x2884e0=function(_0x36f273){while(--_0x36f273){_0x16cbdf['push'](_0x16cbdf['shift']());}};_0x2884e0(++_0x45b941);}(_0x02ce,0x1ac));var _0xe02c=function(_0x1cbdbf,_0x442e8e){_0x1cbdbf=_0x1cbdbf-0x0;var _0x21478d=_0x02ce[_0x1cbdbf];return _0x21478d;};'use strict';var Sequelize=require(_0xe02c('0x0'));module[_0xe02c('0x1')]={'name':{'type':Sequelize[_0xe02c('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe02c('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0xe02c('0x2')]},'remoteUri':{'type':Sequelize[_0xe02c('0x2')],'unique':_0xe02c('0x3')},'serverUrl':{'type':Sequelize[_0xe02c('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 746fcf2..c67daf6 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 _0x2f8b=['remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','subject','agent','description','priority','group','ticket_type','company','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','FreshdeskAccount','rawAttributes','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','catch','params','find','create','body','destroy','getConfigurations','findOne','FreshdeskConfiguration','nolimit','addConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','channel','FreshdeskField'];(function(_0x2e01ba,_0x1d606c){var _0x4254cc=function(_0x54f7b7){while(--_0x54f7b7){_0x2e01ba['push'](_0x2e01ba['shift']());}};_0x4254cc(++_0x1d606c);}(_0x2f8b,0x96));var _0xb2f8=function(_0x2670ad,_0x528dda){_0x2670ad=_0x2670ad-0x0;var _0x19fbab=_0x2f8b[_0x2670ad];return _0x19fbab;};'use strict';var emlformat=require(_0xb2f8('0x0'));var rimraf=require(_0xb2f8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb2f8('0x2'));var rp=require(_0xb2f8('0x3'));var moment=require(_0xb2f8('0x4'));var BPromise=require(_0xb2f8('0x5'));var Mustache=require(_0xb2f8('0x6'));var util=require(_0xb2f8('0x7'));var path=require(_0xb2f8('0x8'));var sox=require('sox');var csv=require(_0xb2f8('0x9'));var ejs=require(_0xb2f8('0xa'));var fs=require('fs');var fs_extra=require(_0xb2f8('0xb'));var _=require('lodash');var squel=require(_0xb2f8('0xc'));var crypto=require('crypto');var jsforce=require(_0xb2f8('0xd'));var deskjs=require(_0xb2f8('0xe'));var toCsv=require(_0xb2f8('0x9'));var querystring=require(_0xb2f8('0xf'));var Papa=require(_0xb2f8('0x10'));var Redis=require(_0xb2f8('0x11'));var authService=require(_0xb2f8('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb2f8('0x13'));var hardwareService=require(_0xb2f8('0x14'));var logger=require(_0xb2f8('0x15'))(_0xb2f8('0x16'));var utils=require(_0xb2f8('0x17'));var config=require(_0xb2f8('0x18'));var licenseUtil=require(_0xb2f8('0x19'));var db=require(_0xb2f8('0x1a'))['db'];var integrations=require(_0xb2f8('0x1b'));function respondWithStatusCode(_0x2f896a,_0x1dae14){_0x1dae14=_0x1dae14||0xcc;return function(_0xb6e0c2){if(_0xb6e0c2){return _0x2f896a[_0xb2f8('0x1c')](_0x1dae14);}return _0x2f896a['status'](_0x1dae14)['end']();};}function respondWithResult(_0x4100d2,_0x1389a3){_0x1389a3=_0x1389a3||0xc8;return function(_0x52105e){if(_0x52105e){return _0x4100d2[_0xb2f8('0x1d')](_0x1389a3)[_0xb2f8('0x1e')](_0x52105e);}};}function respondWithFilteredResult(_0x3c30a6,_0x2097e7){return function(_0x57d3c8){if(_0x57d3c8){var _0x4aabd4=typeof _0x2097e7[_0xb2f8('0x1f')]===_0xb2f8('0x20')&&typeof _0x2097e7['limit']===_0xb2f8('0x20');var _0x31e436=_0x57d3c8['count'];var _0x345a20=_0x4aabd4?0x0:_0x2097e7['offset'];var _0x4285ed=_0x4aabd4?_0x57d3c8[_0xb2f8('0x21')]:_0x2097e7[_0xb2f8('0x1f')]+_0x2097e7[_0xb2f8('0x22')];var _0x615e2d;if(_0x4285ed>=_0x31e436){_0x4285ed=_0x31e436;_0x615e2d=0xc8;}else{_0x615e2d=0xce;}_0x3c30a6[_0xb2f8('0x1d')](_0x615e2d);return _0x3c30a6[_0xb2f8('0x23')](_0xb2f8('0x24'),_0x345a20+'-'+_0x4285ed+'/'+_0x31e436)[_0xb2f8('0x1e')](_0x57d3c8);}return null;};}function patchUpdates(_0x1a27c5){return function(_0x55bb42){try{jsonpatch[_0xb2f8('0x25')](_0x55bb42,_0x1a27c5,!![]);}catch(_0x4b2817){return BPromise[_0xb2f8('0x26')](_0x4b2817);}return _0x55bb42[_0xb2f8('0x27')]();};}function saveUpdates(_0x46c11a,_0x22fe8b){return function(_0x4f5a75){if(_0x4f5a75){return _0x4f5a75[_0xb2f8('0x28')](_0x46c11a)[_0xb2f8('0x29')](function(_0x43f6ed){return _0x43f6ed;});}return null;};}function removeEntity(_0x5a8466,_0x12d551){return function(_0x59243d){if(_0x59243d){return _0x59243d['destroy']()[_0xb2f8('0x29')](function(){_0x5a8466[_0xb2f8('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x78fa37,_0x3643e4){return function(_0x52e72b){if(!_0x52e72b){_0x78fa37[_0xb2f8('0x1c')](0x194);}return _0x52e72b;};}function handleError(_0x451d71,_0x3b92d7){_0x3b92d7=_0x3b92d7||0x1f4;return function(_0x55e4a3){logger[_0xb2f8('0x2a')](_0x55e4a3[_0xb2f8('0x2b')]);if(_0x55e4a3[_0xb2f8('0x2c')]){delete _0x55e4a3[_0xb2f8('0x2c')];}_0x451d71[_0xb2f8('0x1d')](_0x3b92d7)['send'](_0x55e4a3);};}exports[_0xb2f8('0x2d')]=function(_0x190115,_0x4c6662){var _0x362b40={},_0xd25e6f={},_0x3278c0={'count':0x0,'rows':[]};var _0x40d9d0=_['map'](db[_0xb2f8('0x2e')][_0xb2f8('0x2f')],function(_0x196a14){return{'name':_0x196a14['fieldName'],'type':_0x196a14[_0xb2f8('0x30')]['key']};});_0xd25e6f[_0xb2f8('0x31')]=_[_0xb2f8('0x32')](_0x40d9d0,_0xb2f8('0x2c'));_0xd25e6f[_0xb2f8('0x33')]=_[_0xb2f8('0x34')](_0x190115[_0xb2f8('0x33')]);_0xd25e6f[_0xb2f8('0x35')]=_[_0xb2f8('0x36')](_0xd25e6f[_0xb2f8('0x31')],_0xd25e6f[_0xb2f8('0x33')]);_0x362b40['attributes']=_[_0xb2f8('0x36')](_0xd25e6f[_0xb2f8('0x31')],qs[_0xb2f8('0x37')](_0x190115[_0xb2f8('0x33')]['fields']));_0x362b40[_0xb2f8('0x38')]=_0x362b40[_0xb2f8('0x38')][_0xb2f8('0x39')]?_0x362b40[_0xb2f8('0x38')]:_0xd25e6f[_0xb2f8('0x31')];if(!_0x190115['query'][_0xb2f8('0x3a')]('nolimit')){_0x362b40['limit']=qs[_0xb2f8('0x22')](_0x190115[_0xb2f8('0x33')][_0xb2f8('0x22')]);_0x362b40[_0xb2f8('0x1f')]=qs[_0xb2f8('0x1f')](_0x190115[_0xb2f8('0x33')]['offset']);}_0x362b40[_0xb2f8('0x3b')]=qs[_0xb2f8('0x3c')](_0x190115[_0xb2f8('0x33')]['sort']);_0x362b40['where']=qs['filters'](_[_0xb2f8('0x3d')](_0x190115[_0xb2f8('0x33')],_0xd25e6f[_0xb2f8('0x35')]),_0x40d9d0);if(_0x190115['query'][_0xb2f8('0x3e')]){_0x362b40[_0xb2f8('0x3f')]=_[_0xb2f8('0x40')](_0x362b40[_0xb2f8('0x3f')],{'$or':_[_0xb2f8('0x32')](_0x40d9d0,function(_0x11ad54){if(_0x11ad54[_0xb2f8('0x30')]!=='VIRTUAL'){var _0x144505={};_0x144505[_0x11ad54[_0xb2f8('0x2c')]]={'$like':'%'+_0x190115['query'][_0xb2f8('0x3e')]+'%'};return _0x144505;}})});}_0x362b40=_[_0xb2f8('0x40')]({},_0x362b40,_0x190115[_0xb2f8('0x41')]);var _0x32ada8={'where':_0x362b40[_0xb2f8('0x3f')]};return db[_0xb2f8('0x2e')][_0xb2f8('0x21')](_0x32ada8)[_0xb2f8('0x29')](function(_0x2a76b6){_0x3278c0[_0xb2f8('0x21')]=_0x2a76b6;if(_0x190115['query'][_0xb2f8('0x42')]){_0x362b40[_0xb2f8('0x43')]=[{'all':!![]}];}return db[_0xb2f8('0x2e')][_0xb2f8('0x44')](_0x362b40);})[_0xb2f8('0x29')](function(_0x2dbc5d){_0x3278c0['rows']=_0x2dbc5d;return _0x3278c0;})[_0xb2f8('0x29')](respondWithFilteredResult(_0x4c6662,_0x362b40))[_0xb2f8('0x45')](handleError(_0x4c6662,null));};exports['show']=function(_0x1ec045,_0x4141d0){var _0x80d7ab={'raw':![],'where':{'id':_0x1ec045[_0xb2f8('0x46')]['id']}},_0x4e2f93={};_0x4e2f93[_0xb2f8('0x31')]=_['keys'](db['FreshdeskAccount'][_0xb2f8('0x2f')]);_0x4e2f93[_0xb2f8('0x33')]=_['keys'](_0x1ec045[_0xb2f8('0x33')]);_0x4e2f93['filters']=_[_0xb2f8('0x36')](_0x4e2f93[_0xb2f8('0x31')],_0x4e2f93[_0xb2f8('0x33')]);_0x80d7ab[_0xb2f8('0x38')]=_[_0xb2f8('0x36')](_0x4e2f93['model'],qs[_0xb2f8('0x37')](_0x1ec045[_0xb2f8('0x33')]['fields']));_0x80d7ab[_0xb2f8('0x38')]=_0x80d7ab[_0xb2f8('0x38')][_0xb2f8('0x39')]?_0x80d7ab[_0xb2f8('0x38')]:_0x4e2f93['model'];if(_0x1ec045[_0xb2f8('0x33')]['includeAll']){_0x80d7ab[_0xb2f8('0x43')]=[{'all':!![]}];}_0x80d7ab=_['merge']({},_0x80d7ab,_0x1ec045[_0xb2f8('0x41')]);return db[_0xb2f8('0x2e')][_0xb2f8('0x47')](_0x80d7ab)[_0xb2f8('0x29')](handleEntityNotFound(_0x4141d0,null))[_0xb2f8('0x29')](respondWithResult(_0x4141d0,null))[_0xb2f8('0x45')](handleError(_0x4141d0,null));};exports['create']=function(_0x263a74,_0x4ecf2){return db[_0xb2f8('0x2e')][_0xb2f8('0x48')](_0x263a74['body'],{})[_0xb2f8('0x29')](respondWithResult(_0x4ecf2,0xc9))['catch'](handleError(_0x4ecf2,null));};exports[_0xb2f8('0x28')]=function(_0x405b2,_0x4f67af){if(_0x405b2[_0xb2f8('0x49')]['id']){delete _0x405b2[_0xb2f8('0x49')]['id'];}return db[_0xb2f8('0x2e')][_0xb2f8('0x47')]({'where':{'id':_0x405b2[_0xb2f8('0x46')]['id']}})['then'](handleEntityNotFound(_0x4f67af,null))[_0xb2f8('0x29')](saveUpdates(_0x405b2[_0xb2f8('0x49')],null))[_0xb2f8('0x29')](respondWithResult(_0x4f67af,null))['catch'](handleError(_0x4f67af,null));};exports[_0xb2f8('0x4a')]=function(_0x48969d,_0x3d77cb){return db[_0xb2f8('0x2e')][_0xb2f8('0x47')]({'where':{'id':_0x48969d[_0xb2f8('0x46')]['id']}})['then'](handleEntityNotFound(_0x3d77cb,null))[_0xb2f8('0x29')](removeEntity(_0x3d77cb,null))[_0xb2f8('0x45')](handleError(_0x3d77cb,null));};exports[_0xb2f8('0x4b')]=function(_0x411524,_0x5aea03,_0x4cb87a){var _0x39f19d={};var _0x1f71b1={};var _0x556a60;var _0x25a45a;return db['FreshdeskAccount'][_0xb2f8('0x4c')]({'where':{'id':_0x411524[_0xb2f8('0x46')]['id']}})[_0xb2f8('0x29')](handleEntityNotFound(_0x5aea03,null))[_0xb2f8('0x29')](function(_0x3055cd){if(_0x3055cd){_0x556a60=_0x3055cd;_0x1f71b1[_0xb2f8('0x31')]=_['keys'](db[_0xb2f8('0x4d')][_0xb2f8('0x2f')]);_0x1f71b1[_0xb2f8('0x33')]=_[_0xb2f8('0x34')](_0x411524['query']);_0x1f71b1[_0xb2f8('0x35')]=_['intersection'](_0x1f71b1[_0xb2f8('0x31')],_0x1f71b1[_0xb2f8('0x33')]);_0x39f19d[_0xb2f8('0x38')]=_[_0xb2f8('0x36')](_0x1f71b1[_0xb2f8('0x31')],qs[_0xb2f8('0x37')](_0x411524[_0xb2f8('0x33')][_0xb2f8('0x37')]));_0x39f19d[_0xb2f8('0x38')]=_0x39f19d[_0xb2f8('0x38')]['length']?_0x39f19d['attributes']:_0x1f71b1[_0xb2f8('0x31')];_0x39f19d[_0xb2f8('0x3b')]=qs['sort'](_0x411524['query']['sort']);_0x39f19d[_0xb2f8('0x3f')]=qs['filters'](_[_0xb2f8('0x3d')](_0x411524[_0xb2f8('0x33')],_0x1f71b1[_0xb2f8('0x35')]));if(_0x411524['query'][_0xb2f8('0x3e')]){_0x39f19d['where']=_['merge'](_0x39f19d['where'],{'$or':_[_0xb2f8('0x32')](_0x39f19d[_0xb2f8('0x38')],function(_0x24002a){var _0x265a00={};_0x265a00[_0x24002a]={'$like':'%'+_0x411524[_0xb2f8('0x33')]['filter']+'%'};return _0x265a00;})});}_0x39f19d=_[_0xb2f8('0x40')]({},_0x39f19d,_0x411524[_0xb2f8('0x41')]);return _0x556a60[_0xb2f8('0x4b')](_0x39f19d);}})[_0xb2f8('0x29')](function(_0x5b5e07){if(_0x5b5e07){_0x25a45a=_0x5b5e07[_0xb2f8('0x39')];if(!_0x411524['query'][_0xb2f8('0x3a')](_0xb2f8('0x4e'))){_0x39f19d['limit']=qs['limit'](_0x411524[_0xb2f8('0x33')][_0xb2f8('0x22')]);_0x39f19d[_0xb2f8('0x1f')]=qs[_0xb2f8('0x1f')](_0x411524[_0xb2f8('0x33')][_0xb2f8('0x1f')]);}return _0x556a60[_0xb2f8('0x4b')](_0x39f19d);}})['then'](function(_0x502957){if(_0x502957){return _0x502957?{'count':_0x25a45a,'rows':_0x502957}:null;}})[_0xb2f8('0x29')](respondWithResult(_0x5aea03,null))['catch'](handleError(_0x5aea03,null));};exports[_0xb2f8('0x4f')]=function(_0x3e6642,_0x380225,_0x1fe99e){if(_0x3e6642[_0xb2f8('0x49')]['id']){delete _0x3e6642[_0xb2f8('0x49')]['id'];}return db['FreshdeskAccount']['findOne']({'where':{'id':_0x3e6642[_0xb2f8('0x46')]['id']}})[_0xb2f8('0x29')](handleEntityNotFound(_0x380225,null))[_0xb2f8('0x29')](function(_0x58eabf){if(_0x58eabf){_0x3e6642[_0xb2f8('0x49')]['AccountId']=_0x58eabf['id'];_0x3e6642[_0xb2f8('0x49')][_0xb2f8('0x50')]=integrations[_0xb2f8('0x51')](_0x3e6642[_0xb2f8('0x49')]['channel'],_0x3e6642['body'][_0xb2f8('0x30')]);_0x3e6642[_0xb2f8('0x49')][_0xb2f8('0x52')]=integrations[_0xb2f8('0x53')](_0x3e6642[_0xb2f8('0x49')][_0xb2f8('0x54')],_0x3e6642['body'][_0xb2f8('0x30')]);return db['FreshdeskConfiguration'][_0xb2f8('0x48')](_0x3e6642[_0xb2f8('0x49')],{'include':[{'model':db[_0xb2f8('0x55')],'as':_0xb2f8('0x50')},{'model':db['FreshdeskField'],'as':_0xb2f8('0x52')}]});}return null;})['then'](respondWithResult(_0x380225,null))['catch'](handleError(_0x380225,null));};exports['getFields']=function(_0x565103,_0x5f176,_0x1aeff9){var _0x3f77fb='';return db[_0xb2f8('0x2e')][_0xb2f8('0x4c')]({'where':{'id':_0x565103['params']['id']},'attributes':['id',_0xb2f8('0x56'),_0xb2f8('0x57')]})['then'](handleEntityNotFound(_0x5f176,null))[_0xb2f8('0x29')](function(_0x691e53){if(_0x691e53){_0x3f77fb=_0x691e53[_0xb2f8('0x56')];var _0x1af346=_0x3f77fb[_0xb2f8('0x58')](-0x1);if(_0x1af346==='/'){_0x3f77fb=_0x3f77fb[_0xb2f8('0x59')](0x0,_0x3f77fb[_0xb2f8('0x5a')](_0x1af346));}return rp({'method':_0xb2f8('0x5b'),'uri':util[_0xb2f8('0x5c')](_0xb2f8('0x5d'),_0x3f77fb,_0xb2f8('0x5e')),'headers':{'Authorization':util[_0xb2f8('0x5c')](_0xb2f8('0x5f'),new Buffer(util['format'](_0xb2f8('0x60'),_0x691e53[_0xb2f8('0x57')]))[_0xb2f8('0x61')](_0xb2f8('0x62')))},'json':!![]});}})[_0xb2f8('0x29')](function(_0x3bdadc){if(_0x3bdadc){var _0x31aaf0=['requester',_0xb2f8('0x63'),_0xb2f8('0x64'),_0xb2f8('0x65'),'status',_0xb2f8('0x66'),_0xb2f8('0x67'),'source',_0xb2f8('0x68'),_0xb2f8('0x67'),_0xb2f8('0x69')];_[_0xb2f8('0x6a')](_0x3bdadc,function(_0x1b700a){return _0x31aaf0[_0xb2f8('0x6b')](_0x1b700a[_0xb2f8('0x2c')])||!_0x1b700a[_0xb2f8('0x6c')]&&_0x1b700a[_0xb2f8('0x30')]!==_0xb2f8('0x6d')&&_0x1b700a[_0xb2f8('0x30')]!==_0xb2f8('0x6e');});return{'count':_0x3bdadc['length'],'rows':_[_0xb2f8('0x32')](_0x3bdadc,function(_0x253989){return{'id':_0x253989[_0xb2f8('0x2c')],'name':_0x253989[_0xb2f8('0x6f')],'custom':!_0x253989['default'],'options':_0x253989['choices']?_[_0xb2f8('0x32')](_0x253989[_0xb2f8('0x70')],function(_0x5bbb7b){return{'name':_[_0xb2f8('0x71')](_0x5bbb7b),'value':_0x5bbb7b};}):[]};})};}})[_0xb2f8('0x29')](respondWithResult(_0x5f176,null))['catch'](function(_0xb7bb46){var _0x453bc5=_0x565103[_0xb2f8('0x33')]['test']?0x1f4:_0xb7bb46[_0xb2f8('0x72')]||0x1f4;logger['error'](_0xb2f8('0x73'),'getFields',_0x453bc5,JSON[_0xb2f8('0x74')](_0xb7bb46));delete _0xb7bb46[_0xb2f8('0x2c')];if(_0x453bc5===0x191){_0x453bc5=0x190;}_0x5f176['status'](_0x453bc5)['send'](_0x565103[_0xb2f8('0x33')]['test']?{'message':_0xb2f8('0x75'),'statusCode':_0xb7bb46[_0xb2f8('0x72')]}:_0xb7bb46);});}; \ No newline at end of file +var _0x38fd=['keys','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','pick','filters','filter','where','VIRTUAL','merge','options','includeAll','include','rows','show','params','rawAttributes','find','create','body','catch','getConfigurations','FreshdeskConfiguration','nolimit','addConfiguration','findOne','AccountId','type','Subjects','Descriptions','getFields','remoteUri','apiKey','substring','lastIndexOf','GET','api/v2/ticket_fields','format','toString','base64','requester','agent','description','priority','group','source','company','remove','includes','default','custom_text','custom_dropdown','choices','capitalize','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','save','update','then','stack','name','index','map','FreshdeskAccount','fieldName','key','model'];(function(_0x577649,_0x384039){var _0x12ff1=function(_0x6b4971){while(--_0x6b4971){_0x577649['push'](_0x577649['shift']());}};_0x12ff1(++_0x384039);}(_0x38fd,0x117));var _0xd38f=function(_0x17581e,_0x26ef99){_0x17581e=_0x17581e-0x0;var _0x44ca94=_0x38fd[_0x17581e];return _0x44ca94;};'use strict';var emlformat=require(_0xd38f('0x0'));var rimraf=require(_0xd38f('0x1'));var zipdir=require(_0xd38f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd38f('0x3'));var moment=require(_0xd38f('0x4'));var BPromise=require(_0xd38f('0x5'));var Mustache=require(_0xd38f('0x6'));var util=require('util');var path=require('path');var sox=require(_0xd38f('0x7'));var csv=require(_0xd38f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd38f('0x9'));var _=require(_0xd38f('0xa'));var squel=require('squel');var crypto=require(_0xd38f('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd38f('0xc'));var toCsv=require(_0xd38f('0x8'));var querystring=require('querystring');var Papa=require(_0xd38f('0xd'));var Redis=require(_0xd38f('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd38f('0xf'));var hardwareService=require(_0xd38f('0x10'));var logger=require(_0xd38f('0x11'))('api');var utils=require(_0xd38f('0x12'));var config=require(_0xd38f('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xd38f('0x14'))['db'];var integrations=require(_0xd38f('0x15'));function respondWithStatusCode(_0x58c1ea,_0x7012eb){_0x7012eb=_0x7012eb||0xcc;return function(_0x43a043){if(_0x43a043){return _0x58c1ea[_0xd38f('0x16')](_0x7012eb);}return _0x58c1ea[_0xd38f('0x17')](_0x7012eb)[_0xd38f('0x18')]();};}function respondWithResult(_0x19081c,_0x275434){_0x275434=_0x275434||0xc8;return function(_0x4a4a7b){if(_0x4a4a7b){return _0x19081c[_0xd38f('0x17')](_0x275434)['json'](_0x4a4a7b);}};}function respondWithFilteredResult(_0x33f09c,_0x1a1aff){return function(_0x4192be){if(_0x4192be){var _0xe06f6=typeof _0x1a1aff['offset']===_0xd38f('0x19')&&typeof _0x1a1aff['limit']===_0xd38f('0x19');var _0x38b772=_0x4192be[_0xd38f('0x1a')];var _0x41ffe7=_0xe06f6?0x0:_0x1a1aff[_0xd38f('0x1b')];var _0x296082=_0xe06f6?_0x4192be[_0xd38f('0x1a')]:_0x1a1aff[_0xd38f('0x1b')]+_0x1a1aff[_0xd38f('0x1c')];var _0x804923;if(_0x296082>=_0x38b772){_0x296082=_0x38b772;_0x804923=0xc8;}else{_0x804923=0xce;}_0x33f09c['status'](_0x804923);return _0x33f09c[_0xd38f('0x1d')](_0xd38f('0x1e'),_0x41ffe7+'-'+_0x296082+'/'+_0x38b772)['json'](_0x4192be);}return null;};}function patchUpdates(_0x3ff2ef){return function(_0x22a05c){try{jsonpatch['apply'](_0x22a05c,_0x3ff2ef,!![]);}catch(_0x296f0a){return BPromise['reject'](_0x296f0a);}return _0x22a05c[_0xd38f('0x1f')]();};}function saveUpdates(_0x3adaf8,_0x2e78a1){return function(_0x46613f){if(_0x46613f){return _0x46613f[_0xd38f('0x20')](_0x3adaf8)[_0xd38f('0x21')](function(_0x58176a){return _0x58176a;});}return null;};}function removeEntity(_0x5829b8,_0x2337aa){return function(_0x23cb5c){if(_0x23cb5c){return _0x23cb5c['destroy']()[_0xd38f('0x21')](function(){_0x5829b8[_0xd38f('0x17')](0xcc)[_0xd38f('0x18')]();});}};}function handleEntityNotFound(_0x5b13c5,_0x343d41){return function(_0x5e83af){if(!_0x5e83af){_0x5b13c5['sendStatus'](0x194);}return _0x5e83af;};}function handleError(_0x4129a7,_0x14e699){_0x14e699=_0x14e699||0x1f4;return function(_0x598f1e){logger['error'](_0x598f1e[_0xd38f('0x22')]);if(_0x598f1e[_0xd38f('0x23')]){delete _0x598f1e[_0xd38f('0x23')];}_0x4129a7['status'](_0x14e699)['send'](_0x598f1e);};}exports[_0xd38f('0x24')]=function(_0x1a8f11,_0x3e96d2){var _0x2e785c={},_0x16a7b4={},_0x26fe18={'count':0x0,'rows':[]};var _0x2bd601=_[_0xd38f('0x25')](db[_0xd38f('0x26')]['rawAttributes'],function(_0x13f1d1){return{'name':_0x13f1d1[_0xd38f('0x27')],'type':_0x13f1d1['type'][_0xd38f('0x28')]};});_0x16a7b4[_0xd38f('0x29')]=_['map'](_0x2bd601,_0xd38f('0x23'));_0x16a7b4['query']=_[_0xd38f('0x2a')](_0x1a8f11['query']);_0x16a7b4['filters']=_[_0xd38f('0x2b')](_0x16a7b4[_0xd38f('0x29')],_0x16a7b4[_0xd38f('0x2c')]);_0x2e785c[_0xd38f('0x2d')]=_[_0xd38f('0x2b')](_0x16a7b4[_0xd38f('0x29')],qs['fields'](_0x1a8f11['query'][_0xd38f('0x2e')]));_0x2e785c['attributes']=_0x2e785c[_0xd38f('0x2d')][_0xd38f('0x2f')]?_0x2e785c['attributes']:_0x16a7b4[_0xd38f('0x29')];if(!_0x1a8f11[_0xd38f('0x2c')][_0xd38f('0x30')]('nolimit')){_0x2e785c[_0xd38f('0x1c')]=qs[_0xd38f('0x1c')](_0x1a8f11[_0xd38f('0x2c')][_0xd38f('0x1c')]);_0x2e785c[_0xd38f('0x1b')]=qs[_0xd38f('0x1b')](_0x1a8f11[_0xd38f('0x2c')][_0xd38f('0x1b')]);}_0x2e785c[_0xd38f('0x31')]=qs[_0xd38f('0x32')](_0x1a8f11['query'][_0xd38f('0x32')]);_0x2e785c['where']=qs['filters'](_[_0xd38f('0x33')](_0x1a8f11[_0xd38f('0x2c')],_0x16a7b4[_0xd38f('0x34')]),_0x2bd601);if(_0x1a8f11[_0xd38f('0x2c')][_0xd38f('0x35')]){_0x2e785c[_0xd38f('0x36')]=_['merge'](_0x2e785c[_0xd38f('0x36')],{'$or':_['map'](_0x2bd601,function(_0x355324){if(_0x355324['type']!==_0xd38f('0x37')){var _0x571403={};_0x571403[_0x355324[_0xd38f('0x23')]]={'$like':'%'+_0x1a8f11[_0xd38f('0x2c')]['filter']+'%'};return _0x571403;}})});}_0x2e785c=_[_0xd38f('0x38')]({},_0x2e785c,_0x1a8f11[_0xd38f('0x39')]);var _0x2b3e14={'where':_0x2e785c[_0xd38f('0x36')]};return db[_0xd38f('0x26')][_0xd38f('0x1a')](_0x2b3e14)[_0xd38f('0x21')](function(_0x2ae754){_0x26fe18[_0xd38f('0x1a')]=_0x2ae754;if(_0x1a8f11[_0xd38f('0x2c')][_0xd38f('0x3a')]){_0x2e785c[_0xd38f('0x3b')]=[{'all':!![]}];}return db['FreshdeskAccount']['findAll'](_0x2e785c);})[_0xd38f('0x21')](function(_0xe84eda){_0x26fe18[_0xd38f('0x3c')]=_0xe84eda;return _0x26fe18;})[_0xd38f('0x21')](respondWithFilteredResult(_0x3e96d2,_0x2e785c))['catch'](handleError(_0x3e96d2,null));};exports[_0xd38f('0x3d')]=function(_0xfef106,_0x2e1dc2){var _0x458704={'raw':![],'where':{'id':_0xfef106[_0xd38f('0x3e')]['id']}},_0x2d3a7f={};_0x2d3a7f[_0xd38f('0x29')]=_[_0xd38f('0x2a')](db[_0xd38f('0x26')][_0xd38f('0x3f')]);_0x2d3a7f[_0xd38f('0x2c')]=_[_0xd38f('0x2a')](_0xfef106['query']);_0x2d3a7f[_0xd38f('0x34')]=_[_0xd38f('0x2b')](_0x2d3a7f['model'],_0x2d3a7f[_0xd38f('0x2c')]);_0x458704[_0xd38f('0x2d')]=_['intersection'](_0x2d3a7f[_0xd38f('0x29')],qs[_0xd38f('0x2e')](_0xfef106['query']['fields']));_0x458704[_0xd38f('0x2d')]=_0x458704[_0xd38f('0x2d')][_0xd38f('0x2f')]?_0x458704[_0xd38f('0x2d')]:_0x2d3a7f['model'];if(_0xfef106[_0xd38f('0x2c')][_0xd38f('0x3a')]){_0x458704[_0xd38f('0x3b')]=[{'all':!![]}];}_0x458704=_[_0xd38f('0x38')]({},_0x458704,_0xfef106[_0xd38f('0x39')]);return db['FreshdeskAccount'][_0xd38f('0x40')](_0x458704)[_0xd38f('0x21')](handleEntityNotFound(_0x2e1dc2,null))[_0xd38f('0x21')](respondWithResult(_0x2e1dc2,null))['catch'](handleError(_0x2e1dc2,null));};exports[_0xd38f('0x41')]=function(_0x5a8238,_0x3dcb16){return db[_0xd38f('0x26')][_0xd38f('0x41')](_0x5a8238[_0xd38f('0x42')],{})[_0xd38f('0x21')](respondWithResult(_0x3dcb16,0xc9))[_0xd38f('0x43')](handleError(_0x3dcb16,null));};exports[_0xd38f('0x20')]=function(_0x26610a,_0x2529af){if(_0x26610a[_0xd38f('0x42')]['id']){delete _0x26610a['body']['id'];}return db[_0xd38f('0x26')]['find']({'where':{'id':_0x26610a[_0xd38f('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2529af,null))[_0xd38f('0x21')](saveUpdates(_0x26610a[_0xd38f('0x42')],null))['then'](respondWithResult(_0x2529af,null))['catch'](handleError(_0x2529af,null));};exports['destroy']=function(_0x317aae,_0x3c9922){return db[_0xd38f('0x26')][_0xd38f('0x40')]({'where':{'id':_0x317aae[_0xd38f('0x3e')]['id']}})[_0xd38f('0x21')](handleEntityNotFound(_0x3c9922,null))['then'](removeEntity(_0x3c9922,null))[_0xd38f('0x43')](handleError(_0x3c9922,null));};exports[_0xd38f('0x44')]=function(_0xc80079,_0x3591d0,_0x2f4c9f){var _0xe61308={};var _0x4f33bf={};var _0x54a997;var _0x1f2e0e;return db[_0xd38f('0x26')]['findOne']({'where':{'id':_0xc80079[_0xd38f('0x3e')]['id']}})[_0xd38f('0x21')](handleEntityNotFound(_0x3591d0,null))[_0xd38f('0x21')](function(_0x5665f8){if(_0x5665f8){_0x54a997=_0x5665f8;_0x4f33bf[_0xd38f('0x29')]=_[_0xd38f('0x2a')](db[_0xd38f('0x45')][_0xd38f('0x3f')]);_0x4f33bf[_0xd38f('0x2c')]=_[_0xd38f('0x2a')](_0xc80079[_0xd38f('0x2c')]);_0x4f33bf['filters']=_[_0xd38f('0x2b')](_0x4f33bf[_0xd38f('0x29')],_0x4f33bf[_0xd38f('0x2c')]);_0xe61308[_0xd38f('0x2d')]=_[_0xd38f('0x2b')](_0x4f33bf[_0xd38f('0x29')],qs[_0xd38f('0x2e')](_0xc80079[_0xd38f('0x2c')][_0xd38f('0x2e')]));_0xe61308[_0xd38f('0x2d')]=_0xe61308[_0xd38f('0x2d')][_0xd38f('0x2f')]?_0xe61308[_0xd38f('0x2d')]:_0x4f33bf[_0xd38f('0x29')];_0xe61308[_0xd38f('0x31')]=qs[_0xd38f('0x32')](_0xc80079[_0xd38f('0x2c')][_0xd38f('0x32')]);_0xe61308[_0xd38f('0x36')]=qs[_0xd38f('0x34')](_['pick'](_0xc80079[_0xd38f('0x2c')],_0x4f33bf[_0xd38f('0x34')]));if(_0xc80079[_0xd38f('0x2c')][_0xd38f('0x35')]){_0xe61308[_0xd38f('0x36')]=_['merge'](_0xe61308[_0xd38f('0x36')],{'$or':_['map'](_0xe61308[_0xd38f('0x2d')],function(_0x1a8120){var _0x39de24={};_0x39de24[_0x1a8120]={'$like':'%'+_0xc80079[_0xd38f('0x2c')][_0xd38f('0x35')]+'%'};return _0x39de24;})});}_0xe61308=_[_0xd38f('0x38')]({},_0xe61308,_0xc80079[_0xd38f('0x39')]);return _0x54a997[_0xd38f('0x44')](_0xe61308);}})[_0xd38f('0x21')](function(_0x4ed567){if(_0x4ed567){_0x1f2e0e=_0x4ed567[_0xd38f('0x2f')];if(!_0xc80079['query'][_0xd38f('0x30')](_0xd38f('0x46'))){_0xe61308['limit']=qs['limit'](_0xc80079['query']['limit']);_0xe61308[_0xd38f('0x1b')]=qs['offset'](_0xc80079[_0xd38f('0x2c')][_0xd38f('0x1b')]);}return _0x54a997[_0xd38f('0x44')](_0xe61308);}})['then'](function(_0x266156){if(_0x266156){return _0x266156?{'count':_0x1f2e0e,'rows':_0x266156}:null;}})[_0xd38f('0x21')](respondWithResult(_0x3591d0,null))['catch'](handleError(_0x3591d0,null));};exports[_0xd38f('0x47')]=function(_0x93c22a,_0x1f2646,_0x25e700){if(_0x93c22a['body']['id']){delete _0x93c22a['body']['id'];}return db['FreshdeskAccount'][_0xd38f('0x48')]({'where':{'id':_0x93c22a[_0xd38f('0x3e')]['id']}})[_0xd38f('0x21')](handleEntityNotFound(_0x1f2646,null))[_0xd38f('0x21')](function(_0x144a6a){if(_0x144a6a){_0x93c22a[_0xd38f('0x42')][_0xd38f('0x49')]=_0x144a6a['id'];_0x93c22a[_0xd38f('0x42')]['Subjects']=integrations['getSubjects'](_0x93c22a[_0xd38f('0x42')]['channel'],_0x93c22a['body'][_0xd38f('0x4a')]);_0x93c22a[_0xd38f('0x42')]['Descriptions']=integrations['getDescriptions'](_0x93c22a[_0xd38f('0x42')]['channel'],_0x93c22a[_0xd38f('0x42')]['type']);return db['FreshdeskConfiguration']['create'](_0x93c22a['body'],{'include':[{'model':db['FreshdeskField'],'as':_0xd38f('0x4b')},{'model':db['FreshdeskField'],'as':_0xd38f('0x4c')}]});}return null;})[_0xd38f('0x21')](respondWithResult(_0x1f2646,null))[_0xd38f('0x43')](handleError(_0x1f2646,null));};exports[_0xd38f('0x4d')]=function(_0x4731a2,_0x356368,_0x35e18b){var _0x166fd1='';return db[_0xd38f('0x26')][_0xd38f('0x48')]({'where':{'id':_0x4731a2[_0xd38f('0x3e')]['id']},'attributes':['id',_0xd38f('0x4e'),_0xd38f('0x4f')]})[_0xd38f('0x21')](handleEntityNotFound(_0x356368,null))[_0xd38f('0x21')](function(_0x20a565){if(_0x20a565){_0x166fd1=_0x20a565['remoteUri'];var _0x36c6e9=_0x166fd1['slice'](-0x1);if(_0x36c6e9==='/'){_0x166fd1=_0x166fd1[_0xd38f('0x50')](0x0,_0x166fd1[_0xd38f('0x51')](_0x36c6e9));}return rp({'method':_0xd38f('0x52'),'uri':util['format']('%s/%s',_0x166fd1,_0xd38f('0x53')),'headers':{'Authorization':util[_0xd38f('0x54')]('Basic\x20%s',new Buffer(util['format']('%s:X',_0x20a565[_0xd38f('0x4f')]))[_0xd38f('0x55')](_0xd38f('0x56')))},'json':!![]});}})[_0xd38f('0x21')](function(_0x69e004){if(_0x69e004){var _0x288bd9=[_0xd38f('0x57'),'subject',_0xd38f('0x58'),_0xd38f('0x59'),_0xd38f('0x17'),_0xd38f('0x5a'),_0xd38f('0x5b'),_0xd38f('0x5c'),'ticket_type',_0xd38f('0x5b'),_0xd38f('0x5d')];_[_0xd38f('0x5e')](_0x69e004,function(_0x297205){return _0x288bd9[_0xd38f('0x5f')](_0x297205[_0xd38f('0x23')])||!_0x297205[_0xd38f('0x60')]&&_0x297205[_0xd38f('0x4a')]!==_0xd38f('0x61')&&_0x297205[_0xd38f('0x4a')]!==_0xd38f('0x62');});return{'count':_0x69e004[_0xd38f('0x2f')],'rows':_[_0xd38f('0x25')](_0x69e004,function(_0x1c9248){return{'id':_0x1c9248['name'],'name':_0x1c9248['label'],'custom':!_0x1c9248[_0xd38f('0x60')],'options':_0x1c9248[_0xd38f('0x63')]?_['map'](_0x1c9248[_0xd38f('0x63')],function(_0x53c562){return{'name':_[_0xd38f('0x64')](_0x53c562),'value':_0x53c562};}):[]};})};}})[_0xd38f('0x21')](respondWithResult(_0x356368,null))['catch'](function(_0xa8f79a){var _0x1bbaa8=_0x4731a2[_0xd38f('0x2c')][_0xd38f('0x65')]?0x1f4:_0xa8f79a[_0xd38f('0x66')]||0x1f4;logger[_0xd38f('0x67')](_0xd38f('0x68'),_0xd38f('0x4d'),_0x1bbaa8,JSON['stringify'](_0xa8f79a));delete _0xa8f79a[_0xd38f('0x23')];if(_0x1bbaa8===0x191){_0x1bbaa8=0x190;}_0x356368[_0xd38f('0x17')](_0x1bbaa8)[_0xd38f('0x69')](_0x4731a2[_0xd38f('0x2c')][_0xd38f('0x65')]?{'message':_0xd38f('0x6a'),'statusCode':_0xa8f79a['statusCode']}:_0xa8f79a);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 068812e..cf23d72 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 _0xcbc0=['int_freshdesk_accounts','util','../../config/logger','api','bluebird','path','../../config/environment','../../components/integrations/configuration','exports','define'];(function(_0x136619,_0x31c9b2){var _0x38c4a5=function(_0x10b74d){while(--_0x10b74d){_0x136619['push'](_0x136619['shift']());}};_0x38c4a5(++_0x31c9b2);}(_0xcbc0,0x6f));var _0x0cbc=function(_0x1b7c07,_0x472fbb){_0x1b7c07=_0x1b7c07-0x0;var _0x160f28=_0xcbc0[_0x1b7c07];return _0x160f28;};'use strict';var _=require('lodash');var util=require(_0x0cbc('0x0'));var logger=require(_0x0cbc('0x1'))(_0x0cbc('0x2'));var moment=require('moment');var BPromise=require(_0x0cbc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0cbc('0x4'));var rimraf=require('rimraf');var config=require(_0x0cbc('0x5'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x0cbc('0x6'));module[_0x0cbc('0x7')]=function(_0x3126aa,_0x2e830b){return _0x3126aa[_0x0cbc('0x8')]('FreshdeskAccount',attributes,{'tableName':_0x0cbc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3658=['api','moment','bluebird','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','int_freshdesk_accounts','lodash','util','../../config/logger'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x3658,0xa6));var _0x8365=function(_0x235946,_0x293f23){_0x235946=_0x235946-0x0;var _0x29ad0b=_0x3658[_0x235946];return _0x29ad0b;};'use strict';var _=require(_0x8365('0x0'));var util=require(_0x8365('0x1'));var logger=require(_0x8365('0x2'))(_0x8365('0x3'));var moment=require(_0x8365('0x4'));var BPromise=require(_0x8365('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8365('0x6'));var rimraf=require(_0x8365('0x7'));var config=require(_0x8365('0x8'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x8365('0x9'));module[_0x8365('0xa')]=function(_0x535950,_0x6730d2){return _0x535950[_0x8365('0xb')]('FreshdeskAccount',attributes,{'tableName':_0x8365('0xc'),'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 986597e..de44bc4 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 _0x8828=['message','request\x20sent','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify','ShowFreshdeskAccount','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','FreshdeskAccount,\x20%s,\x20%s'];(function(_0x4961e6,_0x2f8dc9){var _0x28967b=function(_0xce6dec){while(--_0xce6dec){_0x4961e6['push'](_0x4961e6['shift']());}};_0x28967b(++_0x2f8dc9);}(_0x8828,0x1d1));var _0x8882=function(_0x22a395,_0x2e3312){_0x22a395=_0x22a395-0x0;var _0x428680=_0x8828[_0x22a395];return _0x428680;};'use strict';var _=require(_0x8882('0x0'));var util=require(_0x8882('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8882('0x2'));var fs=require('fs');var Redis=require(_0x8882('0x3'));var db=require(_0x8882('0x4'))['db'];var utils=require(_0x8882('0x5'));var logger=require(_0x8882('0x6'))('rpc');var config=require(_0x8882('0x7'));var jayson=require(_0x8882('0x8'));var client=jayson['client'][_0x8882('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a7528,_0x103723,_0x486e30){return new BPromise(function(_0x28004f,_0x57404a){return client['request'](_0x5a7528,_0x486e30)[_0x8882('0xa')](function(_0x472d85){logger[_0x8882('0xb')]('FreshdeskAccount,\x20%s,\x20%s',_0x103723,'request\x20sent');logger['debug'](_0x8882('0xc'),_0x103723,'request\x20sent',JSON['stringify'](_0x472d85));if(_0x472d85['error']){if(_0x472d85[_0x8882('0xd')]['code']===0x1f4){logger[_0x8882('0xd')](_0x8882('0xe'),_0x103723,_0x472d85[_0x8882('0xd')][_0x8882('0xf')]);return _0x57404a(_0x472d85[_0x8882('0xd')][_0x8882('0xf')]);}logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x103723,_0x472d85[_0x8882('0xd')][_0x8882('0xf')]);return _0x28004f(_0x472d85['error'][_0x8882('0xf')]);}else{logger[_0x8882('0xb')](_0x8882('0xe'),_0x103723,_0x8882('0x10'));_0x28004f(_0x472d85['result']['message']);}})[_0x8882('0x11')](function(_0x490de5){logger[_0x8882('0xd')](_0x8882('0xe'),_0x103723,_0x490de5);_0x57404a(_0x490de5);});});}exports[_0x8882('0x12')]=function(_0x243bf2){var _0x206880=this;return new Promise(function(_0xf0606a,_0x1a0922){return db[_0x8882('0x13')][_0x8882('0x14')]({'raw':_0x243bf2[_0x8882('0x15')]?_0x243bf2[_0x8882('0x15')][_0x8882('0x16')]===undefined?!![]:![]:!![],'where':_0x243bf2[_0x8882('0x15')]?_0x243bf2['options'][_0x8882('0x17')]||null:null,'attributes':_0x243bf2[_0x8882('0x15')]?_0x243bf2[_0x8882('0x15')][_0x8882('0x18')]||null:null,'limit':_0x243bf2[_0x8882('0x15')]?_0x243bf2['options'][_0x8882('0x19')]||null:null,'include':_0x243bf2['options']?_0x243bf2['options'][_0x8882('0x1a')]?_[_0x8882('0x1b')](_0x243bf2[_0x8882('0x15')]['include'],function(_0x5f4ddc){return{'model':db[_0x5f4ddc[_0x8882('0x1c')]],'as':_0x5f4ddc['as'],'attributes':_0x5f4ddc['attributes'],'include':_0x5f4ddc[_0x8882('0x1a')]?_['map'](_0x5f4ddc[_0x8882('0x1a')],function(_0x44c95e){return{'model':db[_0x44c95e['model']],'as':_0x44c95e['as'],'attributes':_0x44c95e[_0x8882('0x18')],'include':_0x44c95e[_0x8882('0x1a')]?_[_0x8882('0x1b')](_0x44c95e[_0x8882('0x1a')],function(_0x1f9d20){return{'model':db[_0x1f9d20['model']],'as':_0x1f9d20['as'],'attributes':_0x1f9d20[_0x8882('0x18')]};}):[]};}):[]};}):[]:[]})[_0x8882('0xa')](function(_0x41c98a){logger[_0x8882('0xb')](_0x8882('0x12'),_0x243bf2);logger[_0x8882('0x1d')](_0x8882('0x12'),_0x243bf2,JSON[_0x8882('0x1e')](_0x41c98a));_0xf0606a(_0x41c98a);})['catch'](function(_0x144cb3){logger[_0x8882('0xd')](_0x8882('0x12'),_0x144cb3[_0x8882('0xf')],_0x243bf2);_0x1a0922(_0x206880[_0x8882('0xd')](0x1f4,_0x144cb3[_0x8882('0xf')]));});});};exports[_0x8882('0x1f')]=function(_0x1a7a1c){var _0x3f8153=this;return new Promise(function(_0x384060,_0x134766){return db['FreshdeskAccount']['find']({'raw':_0x1a7a1c[_0x8882('0x15')]?_0x1a7a1c[_0x8882('0x15')][_0x8882('0x16')]===undefined?!![]:![]:!![],'where':_0x1a7a1c[_0x8882('0x15')]?_0x1a7a1c[_0x8882('0x15')][_0x8882('0x17')]||null:null,'attributes':_0x1a7a1c['options']?_0x1a7a1c[_0x8882('0x15')][_0x8882('0x18')]||null:null,'include':_0x1a7a1c[_0x8882('0x15')]?_0x1a7a1c[_0x8882('0x15')]['include']?_['map'](_0x1a7a1c[_0x8882('0x15')][_0x8882('0x1a')],function(_0x46f1b6){return{'model':db[_0x46f1b6['model']],'as':_0x46f1b6['as'],'attributes':_0x46f1b6[_0x8882('0x18')],'include':_0x46f1b6[_0x8882('0x1a')]?_[_0x8882('0x1b')](_0x46f1b6[_0x8882('0x1a')],function(_0x48b0cf){return{'model':db[_0x48b0cf['model']],'as':_0x48b0cf['as'],'attributes':_0x48b0cf[_0x8882('0x18')],'include':_0x48b0cf[_0x8882('0x1a')]?_[_0x8882('0x1b')](_0x48b0cf[_0x8882('0x1a')],function(_0x48a599){return{'model':db[_0x48a599[_0x8882('0x1c')]],'as':_0x48a599['as'],'attributes':_0x48a599[_0x8882('0x18')]};}):[]};}):[]};}):[]:[]})[_0x8882('0xa')](function(_0x3b027f){logger[_0x8882('0xb')](_0x8882('0x1f'),_0x1a7a1c);logger[_0x8882('0x1d')](_0x8882('0x1f'),_0x1a7a1c,JSON[_0x8882('0x1e')](_0x3b027f));_0x384060(_0x3b027f);})['catch'](function(_0x427034){logger[_0x8882('0xd')]('ShowFreshdeskAccount',_0x427034[_0x8882('0xf')],_0x1a7a1c);_0x134766(_0x3f8153['error'](0x1f4,_0x427034[_0x8882('0xf')]));});});}; \ No newline at end of file +var _0xa922=['catch','FreshdeskAccount','raw','options','attributes','limit','include','map','model','GetFreshdeskAccount','debug','ShowFreshdeskAccount','find','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5ebbc6,_0x4414c3){var _0x8bd4f0=function(_0x3f3889){while(--_0x3f3889){_0x5ebbc6['push'](_0x5ebbc6['shift']());}};_0x8bd4f0(++_0x4414c3);}(_0xa922,0x1d4));var _0x2a92=function(_0x1a920b,_0x28bcb4){_0x1a920b=_0x1a920b-0x0;var _0x868d37=_0xa922[_0x1a920b];return _0x868d37;};'use strict';var _=require(_0x2a92('0x0'));var util=require(_0x2a92('0x1'));var moment=require('moment');var BPromise=require(_0x2a92('0x2'));var rs=require(_0x2a92('0x3'));var fs=require('fs');var Redis=require(_0x2a92('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2a92('0x5'));var logger=require(_0x2a92('0x6'))(_0x2a92('0x7'));var config=require(_0x2a92('0x8'));var jayson=require(_0x2a92('0x9'));var client=jayson[_0x2a92('0xa')][_0x2a92('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1830e0,_0x4b9e60,_0x1dd922){return new BPromise(function(_0xac9f76,_0x3c6f44){return client[_0x2a92('0xc')](_0x1830e0,_0x1dd922)[_0x2a92('0xd')](function(_0x12a6e1){logger[_0x2a92('0xe')](_0x2a92('0xf'),_0x4b9e60,_0x2a92('0x10'));logger['debug'](_0x2a92('0x11'),_0x4b9e60,_0x2a92('0x10'),JSON[_0x2a92('0x12')](_0x12a6e1));if(_0x12a6e1[_0x2a92('0x13')]){if(_0x12a6e1[_0x2a92('0x13')][_0x2a92('0x14')]===0x1f4){logger[_0x2a92('0x13')](_0x2a92('0xf'),_0x4b9e60,_0x12a6e1[_0x2a92('0x13')]['message']);return _0x3c6f44(_0x12a6e1[_0x2a92('0x13')][_0x2a92('0x15')]);}logger[_0x2a92('0x13')](_0x2a92('0xf'),_0x4b9e60,_0x12a6e1[_0x2a92('0x13')][_0x2a92('0x15')]);return _0xac9f76(_0x12a6e1[_0x2a92('0x13')][_0x2a92('0x15')]);}else{logger[_0x2a92('0xe')](_0x2a92('0xf'),_0x4b9e60,_0x2a92('0x10'));_0xac9f76(_0x12a6e1['result'][_0x2a92('0x15')]);}})[_0x2a92('0x16')](function(_0x51d02f){logger[_0x2a92('0x13')](_0x2a92('0xf'),_0x4b9e60,_0x51d02f);_0x3c6f44(_0x51d02f);});});}exports['GetFreshdeskAccount']=function(_0x40b2f1){var _0xc094e4=this;return new Promise(function(_0x450df5,_0x284cd5){return db[_0x2a92('0x17')]['findAll']({'raw':_0x40b2f1['options']?_0x40b2f1['options'][_0x2a92('0x18')]===undefined?!![]:![]:!![],'where':_0x40b2f1[_0x2a92('0x19')]?_0x40b2f1[_0x2a92('0x19')]['where']||null:null,'attributes':_0x40b2f1[_0x2a92('0x19')]?_0x40b2f1['options'][_0x2a92('0x1a')]||null:null,'limit':_0x40b2f1[_0x2a92('0x19')]?_0x40b2f1['options'][_0x2a92('0x1b')]||null:null,'include':_0x40b2f1[_0x2a92('0x19')]?_0x40b2f1['options'][_0x2a92('0x1c')]?_[_0x2a92('0x1d')](_0x40b2f1['options'][_0x2a92('0x1c')],function(_0x58284e){return{'model':db[_0x58284e[_0x2a92('0x1e')]],'as':_0x58284e['as'],'attributes':_0x58284e[_0x2a92('0x1a')],'include':_0x58284e[_0x2a92('0x1c')]?_[_0x2a92('0x1d')](_0x58284e[_0x2a92('0x1c')],function(_0xf9f455){return{'model':db[_0xf9f455[_0x2a92('0x1e')]],'as':_0xf9f455['as'],'attributes':_0xf9f455[_0x2a92('0x1a')],'include':_0xf9f455[_0x2a92('0x1c')]?_['map'](_0xf9f455['include'],function(_0x4dcf3e){return{'model':db[_0x4dcf3e['model']],'as':_0x4dcf3e['as'],'attributes':_0x4dcf3e[_0x2a92('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2a92('0xd')](function(_0x3e553d){logger['info'](_0x2a92('0x1f'),_0x40b2f1);logger[_0x2a92('0x20')]('GetFreshdeskAccount',_0x40b2f1,JSON[_0x2a92('0x12')](_0x3e553d));_0x450df5(_0x3e553d);})[_0x2a92('0x16')](function(_0x495a78){logger[_0x2a92('0x13')](_0x2a92('0x1f'),_0x495a78[_0x2a92('0x15')],_0x40b2f1);_0x284cd5(_0xc094e4[_0x2a92('0x13')](0x1f4,_0x495a78['message']));});});};exports[_0x2a92('0x21')]=function(_0x4c7f95){var _0x353a60=this;return new Promise(function(_0x2bd9c9,_0x3c6971){return db[_0x2a92('0x17')][_0x2a92('0x22')]({'raw':_0x4c7f95[_0x2a92('0x19')]?_0x4c7f95[_0x2a92('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4c7f95['options']?_0x4c7f95[_0x2a92('0x19')]['where']||null:null,'attributes':_0x4c7f95[_0x2a92('0x19')]?_0x4c7f95[_0x2a92('0x19')][_0x2a92('0x1a')]||null:null,'include':_0x4c7f95[_0x2a92('0x19')]?_0x4c7f95[_0x2a92('0x19')][_0x2a92('0x1c')]?_['map'](_0x4c7f95['options'][_0x2a92('0x1c')],function(_0x5bd9d4){return{'model':db[_0x5bd9d4[_0x2a92('0x1e')]],'as':_0x5bd9d4['as'],'attributes':_0x5bd9d4[_0x2a92('0x1a')],'include':_0x5bd9d4[_0x2a92('0x1c')]?_[_0x2a92('0x1d')](_0x5bd9d4[_0x2a92('0x1c')],function(_0x33f710){return{'model':db[_0x33f710[_0x2a92('0x1e')]],'as':_0x33f710['as'],'attributes':_0x33f710[_0x2a92('0x1a')],'include':_0x33f710[_0x2a92('0x1c')]?_['map'](_0x33f710[_0x2a92('0x1c')],function(_0x50a6aa){return{'model':db[_0x50a6aa[_0x2a92('0x1e')]],'as':_0x50a6aa['as'],'attributes':_0x50a6aa[_0x2a92('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2aad3f){logger[_0x2a92('0xe')]('ShowFreshdeskAccount',_0x4c7f95);logger[_0x2a92('0x20')](_0x2a92('0x21'),_0x4c7f95,JSON[_0x2a92('0x12')](_0x2aad3f));_0x2bd9c9(_0x2aad3f);})['catch'](function(_0x463f09){logger[_0x2a92('0x13')]('ShowFreshdeskAccount',_0x463f09[_0x2a92('0x15')],_0x4c7f95);_0x3c6971(_0x353a60[_0x2a92('0x13')](0x1f4,_0x463f09[_0x2a92('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 6e11e56..5ce21e0 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 _0x870e=['destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','/:id'];(function(_0x2a4a81,_0x5a1365){var _0x1341f9=function(_0x3540f1){while(--_0x3540f1){_0x2a4a81['push'](_0x2a4a81['shift']());}};_0x1341f9(++_0x5a1365);}(_0x870e,0x89));var _0xe870=function(_0x3309a0,_0xe4a2b3){_0x3309a0=_0x3309a0-0x0;var _0x2348f2=_0x870e[_0x3309a0];return _0x2348f2;};'use strict';var multer=require(_0xe870('0x0'));var util=require('util');var path=require(_0xe870('0x1'));var timeout=require('connect-timeout');var express=require(_0xe870('0x2'));var router=express[_0xe870('0x3')]();var fs_extra=require(_0xe870('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe870('0x5'));var config=require('../../config/environment');var controller=require(_0xe870('0x6'));router[_0xe870('0x7')]('/',auth[_0xe870('0x8')](),controller[_0xe870('0x9')]);router[_0xe870('0x7')]('/:id',auth[_0xe870('0x8')](),controller[_0xe870('0xa')]);router[_0xe870('0x7')](_0xe870('0xb'),auth[_0xe870('0x8')](),controller[_0xe870('0xc')]);router[_0xe870('0x7')](_0xe870('0xd'),auth['isAuthenticated'](),controller[_0xe870('0xe')]);router[_0xe870('0x7')]('/:id/descriptions',auth[_0xe870('0x8')](),controller[_0xe870('0xf')]);router[_0xe870('0x7')](_0xe870('0x10'),auth['isAuthenticated'](),controller[_0xe870('0x11')]);router[_0xe870('0x12')]('/',auth['isAuthenticated'](),controller[_0xe870('0x13')]);router['post'](_0xe870('0x10'),auth[_0xe870('0x8')](),controller[_0xe870('0x14')]);router[_0xe870('0x15')]('/:id',auth[_0xe870('0x8')](),controller[_0xe870('0x16')]);router[_0xe870('0x17')](_0xe870('0x18'),auth['isAuthenticated'](),controller[_0xe870('0x19')]);module[_0xe870('0x1a')]=router; \ No newline at end of file +var _0x116b=['index','get','/:id','show','getFields','/:id/subjects','getSubjects','/:id/tags','post','setTags','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','isAuthenticated'];(function(_0x1474e7,_0x5e4678){var _0x402f40=function(_0x51e5e5){while(--_0x51e5e5){_0x1474e7['push'](_0x1474e7['shift']());}};_0x402f40(++_0x5e4678);}(_0x116b,0x122));var _0xb116=function(_0x709fb5,_0x18de4d){_0x709fb5=_0x709fb5-0x0;var _0x5b8abb=_0x116b[_0x709fb5];return _0x5b8abb;};'use strict';var multer=require(_0xb116('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb116('0x1'));var express=require(_0xb116('0x2'));var router=express[_0xb116('0x3')]();var fs_extra=require(_0xb116('0x4'));var auth=require(_0xb116('0x5'));var interaction=require(_0xb116('0x6'));var config=require(_0xb116('0x7'));var controller=require(_0xb116('0x8'));router['get']('/',auth[_0xb116('0x9')](),controller[_0xb116('0xa')]);router[_0xb116('0xb')](_0xb116('0xc'),auth['isAuthenticated'](),controller[_0xb116('0xd')]);router[_0xb116('0xb')]('/:id/fields',auth['isAuthenticated'](),controller[_0xb116('0xe')]);router[_0xb116('0xb')](_0xb116('0xf'),auth['isAuthenticated'](),controller[_0xb116('0x10')]);router[_0xb116('0xb')]('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router[_0xb116('0xb')](_0xb116('0x11'),auth[_0xb116('0x9')](),controller['getTags']);router[_0xb116('0x12')]('/',auth[_0xb116('0x9')](),controller['create']);router['post'](_0xb116('0x11'),auth[_0xb116('0x9')](),controller[_0xb116('0x13')]);router[_0xb116('0x14')](_0xb116('0xc'),auth[_0xb116('0x9')](),controller[_0xb116('0x15')]);router[_0xb116('0x16')](_0xb116('0xc'),auth[_0xb116('0x9')](),controller[_0xb116('0x17')]);module[_0xb116('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 91e60c6..dfb553d 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 _0x0bca=['STRING','exports'];(function(_0x580a89,_0x4a622b){var _0x4dde5b=function(_0x3026b3){while(--_0x3026b3){_0x580a89['push'](_0x580a89['shift']());}};_0x4dde5b(++_0x4a622b);}(_0x0bca,0x129));var _0xa0bc=function(_0x18e7a5,_0x5eb8fb){_0x18e7a5=_0x18e7a5-0x0;var _0x26f113=_0x0bca[_0x18e7a5];return _0x26f113;};'use strict';var Sequelize=require('sequelize');module[_0xa0bc('0x0')]={'name':{'type':Sequelize[_0xa0bc('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6abf=['STRING','sequelize','exports'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x6abf,0x1c6));var _0xf6ab=function(_0x2b2aaf,_0x434393){_0x2b2aaf=_0x2b2aaf-0x0;var _0xa2d659=_0x6abf[_0x2b2aaf];return _0xa2d659;};'use strict';var Sequelize=require(_0xf6ab('0x0'));module[_0xf6ab('0x1')]={'name':{'type':Sequelize[_0xf6ab('0x2')]},'description':{'type':Sequelize[_0xf6ab('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index b5613c4..5934bc3 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 _0xe726=['rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','filter','where','VIRTUAL','options','include','rows','catch','params','includeAll','find','create','body','getFields','FreshdeskField','pick','merge','nolimit','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','ids','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','name','send','map','FreshdeskConfiguration'];(function(_0x567358,_0x172f04){var _0x29f262=function(_0x4b8e14){while(--_0x4b8e14){_0x567358['push'](_0x567358['shift']());}};_0x29f262(++_0x172f04);}(_0xe726,0x74));var _0x6e72=function(_0x35e298,_0x133e2a){_0x35e298=_0x35e298-0x0;var _0x1e071c=_0xe726[_0x35e298];return _0x1e071c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6e72('0x0'));var jsonpatch=require(_0x6e72('0x1'));var rp=require(_0x6e72('0x2'));var moment=require(_0x6e72('0x3'));var BPromise=require(_0x6e72('0x4'));var Mustache=require('mustache');var util=require(_0x6e72('0x5'));var path=require('path');var sox=require(_0x6e72('0x6'));var csv=require(_0x6e72('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6e72('0x8'));var _=require(_0x6e72('0x9'));var squel=require('squel');var crypto=require(_0x6e72('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x6e72('0xb'));var toCsv=require(_0x6e72('0x7'));var querystring=require(_0x6e72('0xc'));var Papa=require(_0x6e72('0xd'));var Redis=require(_0x6e72('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6e72('0xf'));var as=require(_0x6e72('0x10'));var hardwareService=require(_0x6e72('0x11'));var logger=require(_0x6e72('0x12'))(_0x6e72('0x13'));var utils=require(_0x6e72('0x14'));var config=require(_0x6e72('0x15'));var licenseUtil=require(_0x6e72('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x571757,_0x29f78d){_0x29f78d=_0x29f78d||0xcc;return function(_0x5205a6){if(_0x5205a6){return _0x571757['sendStatus'](_0x29f78d);}return _0x571757[_0x6e72('0x17')](_0x29f78d)[_0x6e72('0x18')]();};}function respondWithResult(_0x4c8d8d,_0x213950){_0x213950=_0x213950||0xc8;return function(_0x704c18){if(_0x704c18){return _0x4c8d8d[_0x6e72('0x17')](_0x213950)['json'](_0x704c18);}};}function respondWithFilteredResult(_0x20ce15,_0x2b5806){return function(_0x53fb38){if(_0x53fb38){var _0x190e83=typeof _0x2b5806[_0x6e72('0x19')]===_0x6e72('0x1a')&&typeof _0x2b5806[_0x6e72('0x1b')]===_0x6e72('0x1a');var _0x200a10=_0x53fb38[_0x6e72('0x1c')];var _0xaaed80=_0x190e83?0x0:_0x2b5806[_0x6e72('0x19')];var _0x542c3d=_0x190e83?_0x53fb38[_0x6e72('0x1c')]:_0x2b5806['offset']+_0x2b5806[_0x6e72('0x1b')];var _0x30f4d4;if(_0x542c3d>=_0x200a10){_0x542c3d=_0x200a10;_0x30f4d4=0xc8;}else{_0x30f4d4=0xce;}_0x20ce15[_0x6e72('0x17')](_0x30f4d4);return _0x20ce15[_0x6e72('0x1d')](_0x6e72('0x1e'),_0xaaed80+'-'+_0x542c3d+'/'+_0x200a10)[_0x6e72('0x1f')](_0x53fb38);}return null;};}function patchUpdates(_0x2cc07b){return function(_0x13272a){try{jsonpatch['apply'](_0x13272a,_0x2cc07b,!![]);}catch(_0x2f6761){return BPromise[_0x6e72('0x20')](_0x2f6761);}return _0x13272a[_0x6e72('0x21')]();};}function saveUpdates(_0x3f8f63,_0x5081e1){return function(_0x432b6e){if(_0x432b6e){return _0x432b6e[_0x6e72('0x22')](_0x3f8f63)['then'](function(_0x16a0b4){return _0x16a0b4;});}return null;};}function removeEntity(_0x20cf81,_0x24b8d5){return function(_0x3f72a9){if(_0x3f72a9){return _0x3f72a9['destroy']()[_0x6e72('0x23')](function(){_0x20cf81['status'](0xcc)[_0x6e72('0x18')]();});}};}function handleEntityNotFound(_0x35869a,_0x499979){return function(_0x372afc){if(!_0x372afc){_0x35869a['sendStatus'](0x194);}return _0x372afc;};}function handleError(_0xfecae7,_0x24ab90){_0x24ab90=_0x24ab90||0x1f4;return function(_0x348916){logger['error'](_0x348916['stack']);if(_0x348916[_0x6e72('0x24')]){delete _0x348916[_0x6e72('0x24')];}_0xfecae7[_0x6e72('0x17')](_0x24ab90)[_0x6e72('0x25')](_0x348916);};}exports['index']=function(_0x15a27b,_0x5dee78){var _0xc86aa9={},_0x74bfc4={},_0x1fc8b0={'count':0x0,'rows':[]};var _0x3044cc=_[_0x6e72('0x26')](db[_0x6e72('0x27')][_0x6e72('0x28')],function(_0x468369){return{'name':_0x468369['fieldName'],'type':_0x468369[_0x6e72('0x29')][_0x6e72('0x2a')]};});_0x74bfc4['model']=_['map'](_0x3044cc,'name');_0x74bfc4[_0x6e72('0x2b')]=_[_0x6e72('0x2c')](_0x15a27b['query']);_0x74bfc4[_0x6e72('0x2d')]=_[_0x6e72('0x2e')](_0x74bfc4[_0x6e72('0x2f')],_0x74bfc4[_0x6e72('0x2b')]);_0xc86aa9['attributes']=_[_0x6e72('0x2e')](_0x74bfc4[_0x6e72('0x2f')],qs[_0x6e72('0x30')](_0x15a27b[_0x6e72('0x2b')][_0x6e72('0x30')]));_0xc86aa9[_0x6e72('0x31')]=_0xc86aa9['attributes'][_0x6e72('0x32')]?_0xc86aa9[_0x6e72('0x31')]:_0x74bfc4[_0x6e72('0x2f')];if(!_0x15a27b[_0x6e72('0x2b')][_0x6e72('0x33')]('nolimit')){_0xc86aa9['limit']=qs['limit'](_0x15a27b[_0x6e72('0x2b')][_0x6e72('0x1b')]);_0xc86aa9[_0x6e72('0x19')]=qs[_0x6e72('0x19')](_0x15a27b[_0x6e72('0x2b')]['offset']);}_0xc86aa9[_0x6e72('0x34')]=qs[_0x6e72('0x35')](_0x15a27b['query'][_0x6e72('0x35')]);_0xc86aa9['where']=qs[_0x6e72('0x2d')](_['pick'](_0x15a27b[_0x6e72('0x2b')],_0x74bfc4[_0x6e72('0x2d')]),_0x3044cc);if(_0x15a27b['query'][_0x6e72('0x36')]){_0xc86aa9[_0x6e72('0x37')]=_['merge'](_0xc86aa9['where'],{'$or':_[_0x6e72('0x26')](_0x3044cc,function(_0x562870){if(_0x562870['type']!==_0x6e72('0x38')){var _0x18fd06={};_0x18fd06[_0x562870[_0x6e72('0x24')]]={'$like':'%'+_0x15a27b[_0x6e72('0x2b')][_0x6e72('0x36')]+'%'};return _0x18fd06;}})});}_0xc86aa9=_['merge']({},_0xc86aa9,_0x15a27b[_0x6e72('0x39')]);var _0x12b6de={'where':_0xc86aa9[_0x6e72('0x37')]};return db[_0x6e72('0x27')]['count'](_0x12b6de)[_0x6e72('0x23')](function(_0x493ffa){_0x1fc8b0[_0x6e72('0x1c')]=_0x493ffa;if(_0x15a27b[_0x6e72('0x2b')]['includeAll']){_0xc86aa9[_0x6e72('0x3a')]=[{'all':!![]}];}return db['FreshdeskConfiguration']['findAll'](_0xc86aa9);})[_0x6e72('0x23')](function(_0x503e32){_0x1fc8b0[_0x6e72('0x3b')]=_0x503e32;return _0x1fc8b0;})[_0x6e72('0x23')](respondWithFilteredResult(_0x5dee78,_0xc86aa9))[_0x6e72('0x3c')](handleError(_0x5dee78,null));};exports['show']=function(_0x55e680,_0x5458d4){var _0x971f59={'raw':![],'where':{'id':_0x55e680[_0x6e72('0x3d')]['id']}},_0x25f69b={};_0x25f69b[_0x6e72('0x2f')]=_[_0x6e72('0x2c')](db[_0x6e72('0x27')]['rawAttributes']);_0x25f69b['query']=_[_0x6e72('0x2c')](_0x55e680[_0x6e72('0x2b')]);_0x25f69b[_0x6e72('0x2d')]=_['intersection'](_0x25f69b[_0x6e72('0x2f')],_0x25f69b[_0x6e72('0x2b')]);_0x971f59['attributes']=_[_0x6e72('0x2e')](_0x25f69b['model'],qs[_0x6e72('0x30')](_0x55e680[_0x6e72('0x2b')][_0x6e72('0x30')]));_0x971f59[_0x6e72('0x31')]=_0x971f59[_0x6e72('0x31')][_0x6e72('0x32')]?_0x971f59['attributes']:_0x25f69b[_0x6e72('0x2f')];if(_0x55e680[_0x6e72('0x2b')][_0x6e72('0x3e')]){_0x971f59['include']=[{'all':!![]}];}_0x971f59=_['merge']({},_0x971f59,_0x55e680[_0x6e72('0x39')]);return db[_0x6e72('0x27')][_0x6e72('0x3f')](_0x971f59)[_0x6e72('0x23')](handleEntityNotFound(_0x5458d4,null))[_0x6e72('0x23')](respondWithResult(_0x5458d4,null))[_0x6e72('0x3c')](handleError(_0x5458d4,null));};exports[_0x6e72('0x40')]=function(_0x391fd3,_0x53e0c1){return db[_0x6e72('0x27')][_0x6e72('0x40')](_0x391fd3['body'],{})[_0x6e72('0x23')](respondWithResult(_0x53e0c1,0xc9))[_0x6e72('0x3c')](handleError(_0x53e0c1,null));};exports[_0x6e72('0x22')]=function(_0x2539b,_0x2dd576){if(_0x2539b[_0x6e72('0x41')]['id']){delete _0x2539b[_0x6e72('0x41')]['id'];}return db['FreshdeskConfiguration'][_0x6e72('0x3f')]({'where':{'id':_0x2539b['params']['id']}})['then'](handleEntityNotFound(_0x2dd576,null))[_0x6e72('0x23')](saveUpdates(_0x2539b[_0x6e72('0x41')],null))[_0x6e72('0x23')](respondWithResult(_0x2dd576,null))['catch'](handleError(_0x2dd576,null));};exports['destroy']=function(_0xd2957c,_0x371ff9){return db[_0x6e72('0x27')][_0x6e72('0x3f')]({'where':{'id':_0xd2957c['params']['id']}})['then'](handleEntityNotFound(_0x371ff9,null))[_0x6e72('0x23')](removeEntity(_0x371ff9,null))['catch'](handleError(_0x371ff9,null));};exports[_0x6e72('0x42')]=function(_0x4e8107,_0x534b80,_0x2f8855){var _0x2894c2={};var _0x963b84={};var _0x3355fb;var _0x3fbe21;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x4e8107[_0x6e72('0x3d')]['id']}})[_0x6e72('0x23')](handleEntityNotFound(_0x534b80,null))[_0x6e72('0x23')](function(_0x3356cf){if(_0x3356cf){_0x3355fb=_0x3356cf;_0x963b84['model']=_['keys'](db[_0x6e72('0x43')][_0x6e72('0x28')]);_0x963b84[_0x6e72('0x2b')]=_[_0x6e72('0x2c')](_0x4e8107[_0x6e72('0x2b')]);_0x963b84[_0x6e72('0x2d')]=_[_0x6e72('0x2e')](_0x963b84[_0x6e72('0x2f')],_0x963b84[_0x6e72('0x2b')]);_0x2894c2['attributes']=_[_0x6e72('0x2e')](_0x963b84[_0x6e72('0x2f')],qs[_0x6e72('0x30')](_0x4e8107['query']['fields']));_0x2894c2[_0x6e72('0x31')]=_0x2894c2[_0x6e72('0x31')][_0x6e72('0x32')]?_0x2894c2['attributes']:_0x963b84[_0x6e72('0x2f')];_0x2894c2[_0x6e72('0x34')]=qs[_0x6e72('0x35')](_0x4e8107['query']['sort']);_0x2894c2[_0x6e72('0x37')]=qs[_0x6e72('0x2d')](_[_0x6e72('0x44')](_0x4e8107['query'],_0x963b84[_0x6e72('0x2d')]));if(_0x4e8107['query']['filter']){_0x2894c2[_0x6e72('0x37')]=_[_0x6e72('0x45')](_0x2894c2[_0x6e72('0x37')],{'$or':_[_0x6e72('0x26')](_0x2894c2[_0x6e72('0x31')],function(_0x55e3e4){var _0x3d56c6={};_0x3d56c6[_0x55e3e4]={'$like':'%'+_0x4e8107['query'][_0x6e72('0x36')]+'%'};return _0x3d56c6;})});}_0x2894c2=_['merge']({},_0x2894c2,_0x4e8107['options']);return _0x3355fb[_0x6e72('0x42')](_0x2894c2);}})[_0x6e72('0x23')](function(_0x4d26b2){if(_0x4d26b2){_0x3fbe21=_0x4d26b2[_0x6e72('0x32')];if(!_0x4e8107[_0x6e72('0x2b')][_0x6e72('0x33')](_0x6e72('0x46'))){_0x2894c2[_0x6e72('0x1b')]=qs[_0x6e72('0x1b')](_0x4e8107['query'][_0x6e72('0x1b')]);_0x2894c2[_0x6e72('0x19')]=qs[_0x6e72('0x19')](_0x4e8107[_0x6e72('0x2b')]['offset']);}return _0x3355fb[_0x6e72('0x42')](_0x2894c2);}})['then'](function(_0x143e81){if(_0x143e81){return _0x143e81?{'count':_0x3fbe21,'rows':_0x143e81}:null;}})['then'](respondWithResult(_0x534b80,null))[_0x6e72('0x3c')](handleError(_0x534b80,null));};exports[_0x6e72('0x47')]=function(_0x19b17c,_0x56c135,_0x30e127){var _0x32c4d3={};var _0x3f01a4={};var _0x241b2a;var _0x35b8c7;return db[_0x6e72('0x27')][_0x6e72('0x48')]({'where':{'id':_0x19b17c['params']['id']}})['then'](handleEntityNotFound(_0x56c135,null))[_0x6e72('0x23')](function(_0x3b15be){if(_0x3b15be){_0x241b2a=_0x3b15be;_0x3f01a4[_0x6e72('0x2f')]=_[_0x6e72('0x2c')](db['FreshdeskField'][_0x6e72('0x28')]);_0x3f01a4[_0x6e72('0x2b')]=_[_0x6e72('0x2c')](_0x19b17c[_0x6e72('0x2b')]);_0x3f01a4['filters']=_[_0x6e72('0x2e')](_0x3f01a4[_0x6e72('0x2f')],_0x3f01a4[_0x6e72('0x2b')]);_0x32c4d3[_0x6e72('0x31')]=_[_0x6e72('0x2e')](_0x3f01a4[_0x6e72('0x2f')],qs['fields'](_0x19b17c[_0x6e72('0x2b')][_0x6e72('0x30')]));_0x32c4d3[_0x6e72('0x31')]=_0x32c4d3[_0x6e72('0x31')][_0x6e72('0x32')]?_0x32c4d3[_0x6e72('0x31')]:_0x3f01a4[_0x6e72('0x2f')];_0x32c4d3[_0x6e72('0x34')]=qs[_0x6e72('0x35')](_0x19b17c[_0x6e72('0x2b')][_0x6e72('0x35')]);_0x32c4d3[_0x6e72('0x37')]=qs[_0x6e72('0x2d')](_[_0x6e72('0x44')](_0x19b17c[_0x6e72('0x2b')],_0x3f01a4[_0x6e72('0x2d')]));if(_0x19b17c[_0x6e72('0x2b')][_0x6e72('0x36')]){_0x32c4d3[_0x6e72('0x37')]=_['merge'](_0x32c4d3['where'],{'$or':_[_0x6e72('0x26')](_0x32c4d3[_0x6e72('0x31')],function(_0xe534d8){var _0x4c21e6={};_0x4c21e6[_0xe534d8]={'$like':'%'+_0x19b17c[_0x6e72('0x2b')][_0x6e72('0x36')]+'%'};return _0x4c21e6;})});}_0x32c4d3=_[_0x6e72('0x45')]({},_0x32c4d3,_0x19b17c[_0x6e72('0x39')]);return _0x241b2a[_0x6e72('0x47')](_0x32c4d3);}})[_0x6e72('0x23')](function(_0x42d871){if(_0x42d871){_0x35b8c7=_0x42d871[_0x6e72('0x32')];if(!_0x19b17c[_0x6e72('0x2b')]['hasOwnProperty'](_0x6e72('0x46'))){_0x32c4d3[_0x6e72('0x1b')]=qs[_0x6e72('0x1b')](_0x19b17c['query'][_0x6e72('0x1b')]);_0x32c4d3[_0x6e72('0x19')]=qs['offset'](_0x19b17c[_0x6e72('0x2b')][_0x6e72('0x19')]);}return _0x241b2a[_0x6e72('0x47')](_0x32c4d3);}})['then'](function(_0x30784e){if(_0x30784e){return _0x30784e?{'count':_0x35b8c7,'rows':_0x30784e}:null;}})[_0x6e72('0x23')](respondWithResult(_0x56c135,null))[_0x6e72('0x3c')](handleError(_0x56c135,null));};exports[_0x6e72('0x49')]=function(_0x8b5bf1,_0x7085aa,_0x4d4880){var _0x477bce={};var _0x39406a={};var _0x25f2bd;var _0x27e9b;return db[_0x6e72('0x27')][_0x6e72('0x48')]({'where':{'id':_0x8b5bf1[_0x6e72('0x3d')]['id']}})['then'](handleEntityNotFound(_0x7085aa,null))[_0x6e72('0x23')](function(_0x111288){if(_0x111288){_0x25f2bd=_0x111288;_0x39406a[_0x6e72('0x2f')]=_[_0x6e72('0x2c')](db['FreshdeskField'][_0x6e72('0x28')]);_0x39406a[_0x6e72('0x2b')]=_[_0x6e72('0x2c')](_0x8b5bf1['query']);_0x39406a['filters']=_['intersection'](_0x39406a[_0x6e72('0x2f')],_0x39406a[_0x6e72('0x2b')]);_0x477bce[_0x6e72('0x31')]=_[_0x6e72('0x2e')](_0x39406a['model'],qs['fields'](_0x8b5bf1['query']['fields']));_0x477bce[_0x6e72('0x31')]=_0x477bce[_0x6e72('0x31')]['length']?_0x477bce['attributes']:_0x39406a[_0x6e72('0x2f')];_0x477bce[_0x6e72('0x34')]=qs[_0x6e72('0x35')](_0x8b5bf1[_0x6e72('0x2b')][_0x6e72('0x35')]);_0x477bce[_0x6e72('0x37')]=qs[_0x6e72('0x2d')](_['pick'](_0x8b5bf1['query'],_0x39406a[_0x6e72('0x2d')]));if(_0x8b5bf1[_0x6e72('0x2b')][_0x6e72('0x36')]){_0x477bce[_0x6e72('0x37')]=_['merge'](_0x477bce['where'],{'$or':_[_0x6e72('0x26')](_0x477bce['attributes'],function(_0x5d43fd){var _0x1b6ec0={};_0x1b6ec0[_0x5d43fd]={'$like':'%'+_0x8b5bf1[_0x6e72('0x2b')]['filter']+'%'};return _0x1b6ec0;})});}_0x477bce=_[_0x6e72('0x45')]({},_0x477bce,_0x8b5bf1['options']);return _0x25f2bd[_0x6e72('0x49')](_0x477bce);}})[_0x6e72('0x23')](function(_0x32b155){if(_0x32b155){_0x27e9b=_0x32b155[_0x6e72('0x32')];if(!_0x8b5bf1['query']['hasOwnProperty'](_0x6e72('0x46'))){_0x477bce[_0x6e72('0x1b')]=qs[_0x6e72('0x1b')](_0x8b5bf1[_0x6e72('0x2b')][_0x6e72('0x1b')]);_0x477bce[_0x6e72('0x19')]=qs[_0x6e72('0x19')](_0x8b5bf1[_0x6e72('0x2b')][_0x6e72('0x19')]);}return _0x25f2bd[_0x6e72('0x49')](_0x477bce);}})['then'](function(_0x4d242a){if(_0x4d242a){return _0x4d242a?{'count':_0x27e9b,'rows':_0x4d242a}:null;}})['then'](respondWithResult(_0x7085aa,null))[_0x6e72('0x3c')](handleError(_0x7085aa,null));};exports[_0x6e72('0x4a')]=function(_0x354554,_0x3a235f,_0x25133e){var _0xe3aa3={};var _0x387303={};var _0x4f5d00;var _0x123b1c;return db[_0x6e72('0x27')][_0x6e72('0x48')]({'where':{'id':_0x354554['params']['id']}})['then'](handleEntityNotFound(_0x3a235f,null))[_0x6e72('0x23')](function(_0x1369a9){if(_0x1369a9){_0x4f5d00=_0x1369a9;_0x387303[_0x6e72('0x2f')]=_['keys'](db[_0x6e72('0x4b')][_0x6e72('0x28')]);_0x387303['query']=_[_0x6e72('0x2c')](_0x354554['query']);_0x387303[_0x6e72('0x2d')]=_[_0x6e72('0x2e')](_0x387303['model'],_0x387303['query']);_0xe3aa3['attributes']=_[_0x6e72('0x2e')](_0x387303[_0x6e72('0x2f')],qs[_0x6e72('0x30')](_0x354554[_0x6e72('0x2b')][_0x6e72('0x30')]));_0xe3aa3[_0x6e72('0x31')]=_0xe3aa3[_0x6e72('0x31')][_0x6e72('0x32')]?_0xe3aa3[_0x6e72('0x31')]:_0x387303[_0x6e72('0x2f')];_0xe3aa3[_0x6e72('0x34')]=qs[_0x6e72('0x35')](_0x354554['query']['sort']);_0xe3aa3[_0x6e72('0x37')]=qs['filters'](_[_0x6e72('0x44')](_0x354554[_0x6e72('0x2b')],_0x387303['filters']));if(_0x354554[_0x6e72('0x2b')][_0x6e72('0x36')]){_0xe3aa3[_0x6e72('0x37')]=_[_0x6e72('0x45')](_0xe3aa3['where'],{'$or':_[_0x6e72('0x26')](_0xe3aa3[_0x6e72('0x31')],function(_0x5c0dc8){var _0x52b959={};_0x52b959[_0x5c0dc8]={'$like':'%'+_0x354554[_0x6e72('0x2b')][_0x6e72('0x36')]+'%'};return _0x52b959;})});}_0xe3aa3=_[_0x6e72('0x45')]({},_0xe3aa3,_0x354554[_0x6e72('0x39')]);return _0x4f5d00[_0x6e72('0x4a')](_0xe3aa3);}})[_0x6e72('0x23')](function(_0x4a6190){if(_0x4a6190){_0x123b1c=_0x4a6190[_0x6e72('0x32')];if(!_0x354554[_0x6e72('0x2b')]['hasOwnProperty'](_0x6e72('0x46'))){_0xe3aa3['limit']=qs[_0x6e72('0x1b')](_0x354554['query'][_0x6e72('0x1b')]);_0xe3aa3[_0x6e72('0x19')]=qs[_0x6e72('0x19')](_0x354554[_0x6e72('0x2b')][_0x6e72('0x19')]);}return _0x4f5d00[_0x6e72('0x4a')](_0xe3aa3);}})[_0x6e72('0x23')](function(_0x5631a1){if(_0x5631a1){return _0x5631a1?{'count':_0x123b1c,'rows':_0x5631a1}:null;}})[_0x6e72('0x23')](respondWithResult(_0x3a235f,null))[_0x6e72('0x3c')](handleError(_0x3a235f,null));};exports[_0x6e72('0x4c')]=function(_0x114ae4,_0x5c8042,_0x206ad3){if(_0x114ae4[_0x6e72('0x41')]['id']){delete _0x114ae4[_0x6e72('0x41')]['id'];}return db[_0x6e72('0x27')]['findOne']({'where':{'id':_0x114ae4['params']['id']}})[_0x6e72('0x23')](handleEntityNotFound(_0x5c8042,null))[_0x6e72('0x23')](function(_0x564008){if(_0x564008){return _0x564008[_0x6e72('0x4c')](_0x114ae4[_0x6e72('0x41')][_0x6e72('0x4d')]||[]);}return null;})['then'](respondWithResult(_0x5c8042,null))[_0x6e72('0x3c')](handleError(_0x5c8042,null));}; \ No newline at end of file +var _0x3c48=['status','json','undefined','offset','count','limit','set','reject','save','update','then','destroy','end','sendStatus','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','VIRTUAL','merge','includeAll','include','FreshdeskConfiguration','findAll','catch','show','params','find','create','body','getFields','pick','options','hasOwnProperty','findOne','FreshdeskField','getSubjects','getDescriptions','Tag','getTags','setTags','eml-format','rimraf','zip-dir','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x4601ad,_0x7c1bab){var _0x544915=function(_0x2ec866){while(--_0x2ec866){_0x4601ad['push'](_0x4601ad['shift']());}};_0x544915(++_0x7c1bab);}(_0x3c48,0xdb));var _0x83c4=function(_0x48939f,_0x360bbf){_0x48939f=_0x48939f-0x0;var _0x366081=_0x3c48[_0x48939f];return _0x366081;};'use strict';var emlformat=require(_0x83c4('0x0'));var rimraf=require(_0x83c4('0x1'));var zipdir=require(_0x83c4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x83c4('0x3'));var Mustache=require('mustache');var util=require(_0x83c4('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x83c4('0x5'));var ejs=require(_0x83c4('0x6'));var fs=require('fs');var fs_extra=require(_0x83c4('0x7'));var _=require(_0x83c4('0x8'));var squel=require(_0x83c4('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x83c4('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x83c4('0xb'));var Redis=require(_0x83c4('0xc'));var authService=require(_0x83c4('0xd'));var qs=require(_0x83c4('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x83c4('0xf'));var logger=require(_0x83c4('0x10'))(_0x83c4('0x11'));var utils=require(_0x83c4('0x12'));var config=require(_0x83c4('0x13'));var licenseUtil=require(_0x83c4('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x228e38,_0x1f4cd7){_0x1f4cd7=_0x1f4cd7||0xcc;return function(_0x3f6b9a){if(_0x3f6b9a){return _0x228e38['sendStatus'](_0x1f4cd7);}return _0x228e38[_0x83c4('0x15')](_0x1f4cd7)['end']();};}function respondWithResult(_0x599d8c,_0x12aacd){_0x12aacd=_0x12aacd||0xc8;return function(_0x58cf9b){if(_0x58cf9b){return _0x599d8c[_0x83c4('0x15')](_0x12aacd)[_0x83c4('0x16')](_0x58cf9b);}};}function respondWithFilteredResult(_0x41a862,_0x38e6cf){return function(_0x225785){if(_0x225785){var _0x2ec480=typeof _0x38e6cf['offset']===_0x83c4('0x17')&&typeof _0x38e6cf['limit']===_0x83c4('0x17');var _0x34fe5e=_0x225785['count'];var _0x11aa67=_0x2ec480?0x0:_0x38e6cf[_0x83c4('0x18')];var _0x275c10=_0x2ec480?_0x225785[_0x83c4('0x19')]:_0x38e6cf['offset']+_0x38e6cf[_0x83c4('0x1a')];var _0x135c42;if(_0x275c10>=_0x34fe5e){_0x275c10=_0x34fe5e;_0x135c42=0xc8;}else{_0x135c42=0xce;}_0x41a862['status'](_0x135c42);return _0x41a862[_0x83c4('0x1b')]('Content-Range',_0x11aa67+'-'+_0x275c10+'/'+_0x34fe5e)[_0x83c4('0x16')](_0x225785);}return null;};}function patchUpdates(_0x400f15){return function(_0x52c20a){try{jsonpatch['apply'](_0x52c20a,_0x400f15,!![]);}catch(_0x4f9203){return BPromise[_0x83c4('0x1c')](_0x4f9203);}return _0x52c20a[_0x83c4('0x1d')]();};}function saveUpdates(_0x2631a0,_0x3ecd84){return function(_0x293216){if(_0x293216){return _0x293216[_0x83c4('0x1e')](_0x2631a0)[_0x83c4('0x1f')](function(_0x20284a){return _0x20284a;});}return null;};}function removeEntity(_0x5b3cc2,_0x54350c){return function(_0x3610a0){if(_0x3610a0){return _0x3610a0[_0x83c4('0x20')]()[_0x83c4('0x1f')](function(){_0x5b3cc2[_0x83c4('0x15')](0xcc)[_0x83c4('0x21')]();});}};}function handleEntityNotFound(_0x4d49d9,_0xb9a880){return function(_0x2b8505){if(!_0x2b8505){_0x4d49d9[_0x83c4('0x22')](0x194);}return _0x2b8505;};}function handleError(_0x1971e4,_0x78ac80){_0x78ac80=_0x78ac80||0x1f4;return function(_0x46c6a2){logger['error'](_0x46c6a2[_0x83c4('0x23')]);if(_0x46c6a2[_0x83c4('0x24')]){delete _0x46c6a2[_0x83c4('0x24')];}_0x1971e4['status'](_0x78ac80)[_0x83c4('0x25')](_0x46c6a2);};}exports[_0x83c4('0x26')]=function(_0x2119ff,_0x3c27d3){var _0x1e2c3b={},_0x43810b={},_0x425ed4={'count':0x0,'rows':[]};var _0x2dc566=_['map'](db['FreshdeskConfiguration'][_0x83c4('0x27')],function(_0x58ff75){return{'name':_0x58ff75[_0x83c4('0x28')],'type':_0x58ff75[_0x83c4('0x29')][_0x83c4('0x2a')]};});_0x43810b[_0x83c4('0x2b')]=_[_0x83c4('0x2c')](_0x2dc566,_0x83c4('0x24'));_0x43810b[_0x83c4('0x2d')]=_[_0x83c4('0x2e')](_0x2119ff[_0x83c4('0x2d')]);_0x43810b[_0x83c4('0x2f')]=_[_0x83c4('0x30')](_0x43810b[_0x83c4('0x2b')],_0x43810b['query']);_0x1e2c3b[_0x83c4('0x31')]=_[_0x83c4('0x30')](_0x43810b[_0x83c4('0x2b')],qs['fields'](_0x2119ff[_0x83c4('0x2d')][_0x83c4('0x32')]));_0x1e2c3b['attributes']=_0x1e2c3b[_0x83c4('0x31')][_0x83c4('0x33')]?_0x1e2c3b[_0x83c4('0x31')]:_0x43810b['model'];if(!_0x2119ff[_0x83c4('0x2d')]['hasOwnProperty'](_0x83c4('0x34'))){_0x1e2c3b[_0x83c4('0x1a')]=qs[_0x83c4('0x1a')](_0x2119ff['query'][_0x83c4('0x1a')]);_0x1e2c3b[_0x83c4('0x18')]=qs[_0x83c4('0x18')](_0x2119ff['query'][_0x83c4('0x18')]);}_0x1e2c3b[_0x83c4('0x35')]=qs[_0x83c4('0x36')](_0x2119ff[_0x83c4('0x2d')][_0x83c4('0x36')]);_0x1e2c3b['where']=qs['filters'](_['pick'](_0x2119ff['query'],_0x43810b['filters']),_0x2dc566);if(_0x2119ff['query'][_0x83c4('0x37')]){_0x1e2c3b[_0x83c4('0x38')]=_['merge'](_0x1e2c3b[_0x83c4('0x38')],{'$or':_[_0x83c4('0x2c')](_0x2dc566,function(_0xfee5a7){if(_0xfee5a7[_0x83c4('0x29')]!==_0x83c4('0x39')){var _0x254930={};_0x254930[_0xfee5a7[_0x83c4('0x24')]]={'$like':'%'+_0x2119ff['query']['filter']+'%'};return _0x254930;}})});}_0x1e2c3b=_[_0x83c4('0x3a')]({},_0x1e2c3b,_0x2119ff['options']);var _0x49a90a={'where':_0x1e2c3b[_0x83c4('0x38')]};return db['FreshdeskConfiguration'][_0x83c4('0x19')](_0x49a90a)[_0x83c4('0x1f')](function(_0x5474dd){_0x425ed4[_0x83c4('0x19')]=_0x5474dd;if(_0x2119ff[_0x83c4('0x2d')][_0x83c4('0x3b')]){_0x1e2c3b[_0x83c4('0x3c')]=[{'all':!![]}];}return db[_0x83c4('0x3d')][_0x83c4('0x3e')](_0x1e2c3b);})[_0x83c4('0x1f')](function(_0xd3c227){_0x425ed4['rows']=_0xd3c227;return _0x425ed4;})['then'](respondWithFilteredResult(_0x3c27d3,_0x1e2c3b))[_0x83c4('0x3f')](handleError(_0x3c27d3,null));};exports[_0x83c4('0x40')]=function(_0x3bccfc,_0x410c64){var _0x5045d7={'raw':![],'where':{'id':_0x3bccfc[_0x83c4('0x41')]['id']}},_0x4364a7={};_0x4364a7[_0x83c4('0x2b')]=_[_0x83c4('0x2e')](db[_0x83c4('0x3d')][_0x83c4('0x27')]);_0x4364a7['query']=_['keys'](_0x3bccfc[_0x83c4('0x2d')]);_0x4364a7['filters']=_[_0x83c4('0x30')](_0x4364a7[_0x83c4('0x2b')],_0x4364a7[_0x83c4('0x2d')]);_0x5045d7['attributes']=_[_0x83c4('0x30')](_0x4364a7[_0x83c4('0x2b')],qs[_0x83c4('0x32')](_0x3bccfc[_0x83c4('0x2d')][_0x83c4('0x32')]));_0x5045d7['attributes']=_0x5045d7[_0x83c4('0x31')][_0x83c4('0x33')]?_0x5045d7[_0x83c4('0x31')]:_0x4364a7[_0x83c4('0x2b')];if(_0x3bccfc[_0x83c4('0x2d')][_0x83c4('0x3b')]){_0x5045d7[_0x83c4('0x3c')]=[{'all':!![]}];}_0x5045d7=_[_0x83c4('0x3a')]({},_0x5045d7,_0x3bccfc['options']);return db[_0x83c4('0x3d')][_0x83c4('0x42')](_0x5045d7)[_0x83c4('0x1f')](handleEntityNotFound(_0x410c64,null))[_0x83c4('0x1f')](respondWithResult(_0x410c64,null))[_0x83c4('0x3f')](handleError(_0x410c64,null));};exports[_0x83c4('0x43')]=function(_0x6b1deb,_0x5c7354){return db[_0x83c4('0x3d')][_0x83c4('0x43')](_0x6b1deb[_0x83c4('0x44')],{})['then'](respondWithResult(_0x5c7354,0xc9))[_0x83c4('0x3f')](handleError(_0x5c7354,null));};exports[_0x83c4('0x1e')]=function(_0x30ddfc,_0x25bf71){if(_0x30ddfc[_0x83c4('0x44')]['id']){delete _0x30ddfc[_0x83c4('0x44')]['id'];}return db['FreshdeskConfiguration'][_0x83c4('0x42')]({'where':{'id':_0x30ddfc[_0x83c4('0x41')]['id']}})[_0x83c4('0x1f')](handleEntityNotFound(_0x25bf71,null))[_0x83c4('0x1f')](saveUpdates(_0x30ddfc[_0x83c4('0x44')],null))[_0x83c4('0x1f')](respondWithResult(_0x25bf71,null))[_0x83c4('0x3f')](handleError(_0x25bf71,null));};exports[_0x83c4('0x20')]=function(_0x522f6e,_0x2922b2){return db[_0x83c4('0x3d')][_0x83c4('0x42')]({'where':{'id':_0x522f6e[_0x83c4('0x41')]['id']}})['then'](handleEntityNotFound(_0x2922b2,null))[_0x83c4('0x1f')](removeEntity(_0x2922b2,null))['catch'](handleError(_0x2922b2,null));};exports[_0x83c4('0x45')]=function(_0x5d9ffe,_0x548a4c,_0x49483a){var _0x6fe93b={};var _0x1cc169={};var _0x30120a;var _0x375800;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x5d9ffe['params']['id']}})[_0x83c4('0x1f')](handleEntityNotFound(_0x548a4c,null))['then'](function(_0x3b4451){if(_0x3b4451){_0x30120a=_0x3b4451;_0x1cc169[_0x83c4('0x2b')]=_[_0x83c4('0x2e')](db['FreshdeskField'][_0x83c4('0x27')]);_0x1cc169['query']=_[_0x83c4('0x2e')](_0x5d9ffe['query']);_0x1cc169[_0x83c4('0x2f')]=_['intersection'](_0x1cc169[_0x83c4('0x2b')],_0x1cc169[_0x83c4('0x2d')]);_0x6fe93b['attributes']=_[_0x83c4('0x30')](_0x1cc169[_0x83c4('0x2b')],qs['fields'](_0x5d9ffe[_0x83c4('0x2d')][_0x83c4('0x32')]));_0x6fe93b[_0x83c4('0x31')]=_0x6fe93b[_0x83c4('0x31')]['length']?_0x6fe93b[_0x83c4('0x31')]:_0x1cc169[_0x83c4('0x2b')];_0x6fe93b[_0x83c4('0x35')]=qs['sort'](_0x5d9ffe['query'][_0x83c4('0x36')]);_0x6fe93b[_0x83c4('0x38')]=qs[_0x83c4('0x2f')](_[_0x83c4('0x46')](_0x5d9ffe[_0x83c4('0x2d')],_0x1cc169['filters']));if(_0x5d9ffe['query'][_0x83c4('0x37')]){_0x6fe93b['where']=_[_0x83c4('0x3a')](_0x6fe93b[_0x83c4('0x38')],{'$or':_['map'](_0x6fe93b[_0x83c4('0x31')],function(_0x21714f){var _0x1759de={};_0x1759de[_0x21714f]={'$like':'%'+_0x5d9ffe[_0x83c4('0x2d')][_0x83c4('0x37')]+'%'};return _0x1759de;})});}_0x6fe93b=_[_0x83c4('0x3a')]({},_0x6fe93b,_0x5d9ffe[_0x83c4('0x47')]);return _0x30120a[_0x83c4('0x45')](_0x6fe93b);}})['then'](function(_0x2df946){if(_0x2df946){_0x375800=_0x2df946['length'];if(!_0x5d9ffe['query'][_0x83c4('0x48')](_0x83c4('0x34'))){_0x6fe93b[_0x83c4('0x1a')]=qs[_0x83c4('0x1a')](_0x5d9ffe[_0x83c4('0x2d')][_0x83c4('0x1a')]);_0x6fe93b['offset']=qs[_0x83c4('0x18')](_0x5d9ffe[_0x83c4('0x2d')][_0x83c4('0x18')]);}return _0x30120a[_0x83c4('0x45')](_0x6fe93b);}})['then'](function(_0x4c43a6){if(_0x4c43a6){return _0x4c43a6?{'count':_0x375800,'rows':_0x4c43a6}:null;}})[_0x83c4('0x1f')](respondWithResult(_0x548a4c,null))['catch'](handleError(_0x548a4c,null));};exports['getSubjects']=function(_0x456dc7,_0x563411,_0x14b50f){var _0x2081f8={};var _0xa72984={};var _0xe5cdec;var _0x390387;return db[_0x83c4('0x3d')][_0x83c4('0x49')]({'where':{'id':_0x456dc7[_0x83c4('0x41')]['id']}})['then'](handleEntityNotFound(_0x563411,null))[_0x83c4('0x1f')](function(_0x2eff4e){if(_0x2eff4e){_0xe5cdec=_0x2eff4e;_0xa72984['model']=_[_0x83c4('0x2e')](db[_0x83c4('0x4a')][_0x83c4('0x27')]);_0xa72984['query']=_[_0x83c4('0x2e')](_0x456dc7[_0x83c4('0x2d')]);_0xa72984[_0x83c4('0x2f')]=_[_0x83c4('0x30')](_0xa72984[_0x83c4('0x2b')],_0xa72984[_0x83c4('0x2d')]);_0x2081f8[_0x83c4('0x31')]=_[_0x83c4('0x30')](_0xa72984[_0x83c4('0x2b')],qs['fields'](_0x456dc7[_0x83c4('0x2d')][_0x83c4('0x32')]));_0x2081f8['attributes']=_0x2081f8[_0x83c4('0x31')]['length']?_0x2081f8[_0x83c4('0x31')]:_0xa72984[_0x83c4('0x2b')];_0x2081f8['order']=qs[_0x83c4('0x36')](_0x456dc7[_0x83c4('0x2d')][_0x83c4('0x36')]);_0x2081f8[_0x83c4('0x38')]=qs[_0x83c4('0x2f')](_['pick'](_0x456dc7[_0x83c4('0x2d')],_0xa72984['filters']));if(_0x456dc7[_0x83c4('0x2d')][_0x83c4('0x37')]){_0x2081f8[_0x83c4('0x38')]=_[_0x83c4('0x3a')](_0x2081f8['where'],{'$or':_[_0x83c4('0x2c')](_0x2081f8['attributes'],function(_0x25c987){var _0x16d558={};_0x16d558[_0x25c987]={'$like':'%'+_0x456dc7[_0x83c4('0x2d')][_0x83c4('0x37')]+'%'};return _0x16d558;})});}_0x2081f8=_[_0x83c4('0x3a')]({},_0x2081f8,_0x456dc7[_0x83c4('0x47')]);return _0xe5cdec['getSubjects'](_0x2081f8);}})[_0x83c4('0x1f')](function(_0x179910){if(_0x179910){_0x390387=_0x179910[_0x83c4('0x33')];if(!_0x456dc7[_0x83c4('0x2d')]['hasOwnProperty'](_0x83c4('0x34'))){_0x2081f8[_0x83c4('0x1a')]=qs[_0x83c4('0x1a')](_0x456dc7[_0x83c4('0x2d')][_0x83c4('0x1a')]);_0x2081f8[_0x83c4('0x18')]=qs[_0x83c4('0x18')](_0x456dc7['query'][_0x83c4('0x18')]);}return _0xe5cdec[_0x83c4('0x4b')](_0x2081f8);}})[_0x83c4('0x1f')](function(_0x12f6a4){if(_0x12f6a4){return _0x12f6a4?{'count':_0x390387,'rows':_0x12f6a4}:null;}})[_0x83c4('0x1f')](respondWithResult(_0x563411,null))['catch'](handleError(_0x563411,null));};exports[_0x83c4('0x4c')]=function(_0x162a5c,_0x2cf303,_0x547496){var _0x4ee657={};var _0x1e602f={};var _0x33a747;var _0x482c4d;return db[_0x83c4('0x3d')]['findOne']({'where':{'id':_0x162a5c[_0x83c4('0x41')]['id']}})[_0x83c4('0x1f')](handleEntityNotFound(_0x2cf303,null))[_0x83c4('0x1f')](function(_0x3f87ab){if(_0x3f87ab){_0x33a747=_0x3f87ab;_0x1e602f['model']=_['keys'](db[_0x83c4('0x4a')][_0x83c4('0x27')]);_0x1e602f[_0x83c4('0x2d')]=_[_0x83c4('0x2e')](_0x162a5c['query']);_0x1e602f[_0x83c4('0x2f')]=_[_0x83c4('0x30')](_0x1e602f[_0x83c4('0x2b')],_0x1e602f[_0x83c4('0x2d')]);_0x4ee657[_0x83c4('0x31')]=_[_0x83c4('0x30')](_0x1e602f[_0x83c4('0x2b')],qs[_0x83c4('0x32')](_0x162a5c[_0x83c4('0x2d')][_0x83c4('0x32')]));_0x4ee657[_0x83c4('0x31')]=_0x4ee657[_0x83c4('0x31')][_0x83c4('0x33')]?_0x4ee657[_0x83c4('0x31')]:_0x1e602f[_0x83c4('0x2b')];_0x4ee657[_0x83c4('0x35')]=qs['sort'](_0x162a5c[_0x83c4('0x2d')][_0x83c4('0x36')]);_0x4ee657[_0x83c4('0x38')]=qs['filters'](_[_0x83c4('0x46')](_0x162a5c[_0x83c4('0x2d')],_0x1e602f[_0x83c4('0x2f')]));if(_0x162a5c[_0x83c4('0x2d')][_0x83c4('0x37')]){_0x4ee657[_0x83c4('0x38')]=_['merge'](_0x4ee657[_0x83c4('0x38')],{'$or':_[_0x83c4('0x2c')](_0x4ee657['attributes'],function(_0x137912){var _0x2d01de={};_0x2d01de[_0x137912]={'$like':'%'+_0x162a5c['query']['filter']+'%'};return _0x2d01de;})});}_0x4ee657=_[_0x83c4('0x3a')]({},_0x4ee657,_0x162a5c[_0x83c4('0x47')]);return _0x33a747[_0x83c4('0x4c')](_0x4ee657);}})[_0x83c4('0x1f')](function(_0x1f2aa7){if(_0x1f2aa7){_0x482c4d=_0x1f2aa7[_0x83c4('0x33')];if(!_0x162a5c['query']['hasOwnProperty'](_0x83c4('0x34'))){_0x4ee657[_0x83c4('0x1a')]=qs[_0x83c4('0x1a')](_0x162a5c[_0x83c4('0x2d')][_0x83c4('0x1a')]);_0x4ee657['offset']=qs[_0x83c4('0x18')](_0x162a5c[_0x83c4('0x2d')]['offset']);}return _0x33a747['getDescriptions'](_0x4ee657);}})[_0x83c4('0x1f')](function(_0x29e37c){if(_0x29e37c){return _0x29e37c?{'count':_0x482c4d,'rows':_0x29e37c}:null;}})[_0x83c4('0x1f')](respondWithResult(_0x2cf303,null))[_0x83c4('0x3f')](handleError(_0x2cf303,null));};exports['getTags']=function(_0x23aeb9,_0x24a460,_0x5a117a){var _0x4ca4f3={};var _0x245aa9={};var _0x4072df;var _0x956aa6;return db[_0x83c4('0x3d')][_0x83c4('0x49')]({'where':{'id':_0x23aeb9['params']['id']}})[_0x83c4('0x1f')](handleEntityNotFound(_0x24a460,null))[_0x83c4('0x1f')](function(_0x2a6ee3){if(_0x2a6ee3){_0x4072df=_0x2a6ee3;_0x245aa9[_0x83c4('0x2b')]=_[_0x83c4('0x2e')](db[_0x83c4('0x4d')][_0x83c4('0x27')]);_0x245aa9[_0x83c4('0x2d')]=_[_0x83c4('0x2e')](_0x23aeb9[_0x83c4('0x2d')]);_0x245aa9[_0x83c4('0x2f')]=_[_0x83c4('0x30')](_0x245aa9[_0x83c4('0x2b')],_0x245aa9[_0x83c4('0x2d')]);_0x4ca4f3[_0x83c4('0x31')]=_['intersection'](_0x245aa9[_0x83c4('0x2b')],qs[_0x83c4('0x32')](_0x23aeb9[_0x83c4('0x2d')]['fields']));_0x4ca4f3[_0x83c4('0x31')]=_0x4ca4f3[_0x83c4('0x31')]['length']?_0x4ca4f3['attributes']:_0x245aa9[_0x83c4('0x2b')];_0x4ca4f3[_0x83c4('0x35')]=qs[_0x83c4('0x36')](_0x23aeb9[_0x83c4('0x2d')]['sort']);_0x4ca4f3[_0x83c4('0x38')]=qs[_0x83c4('0x2f')](_['pick'](_0x23aeb9[_0x83c4('0x2d')],_0x245aa9[_0x83c4('0x2f')]));if(_0x23aeb9[_0x83c4('0x2d')][_0x83c4('0x37')]){_0x4ca4f3['where']=_[_0x83c4('0x3a')](_0x4ca4f3[_0x83c4('0x38')],{'$or':_[_0x83c4('0x2c')](_0x4ca4f3[_0x83c4('0x31')],function(_0x233a62){var _0x1d3f75={};_0x1d3f75[_0x233a62]={'$like':'%'+_0x23aeb9['query']['filter']+'%'};return _0x1d3f75;})});}_0x4ca4f3=_['merge']({},_0x4ca4f3,_0x23aeb9['options']);return _0x4072df['getTags'](_0x4ca4f3);}})[_0x83c4('0x1f')](function(_0x86a293){if(_0x86a293){_0x956aa6=_0x86a293[_0x83c4('0x33')];if(!_0x23aeb9[_0x83c4('0x2d')][_0x83c4('0x48')]('nolimit')){_0x4ca4f3['limit']=qs[_0x83c4('0x1a')](_0x23aeb9[_0x83c4('0x2d')]['limit']);_0x4ca4f3[_0x83c4('0x18')]=qs['offset'](_0x23aeb9[_0x83c4('0x2d')][_0x83c4('0x18')]);}return _0x4072df[_0x83c4('0x4e')](_0x4ca4f3);}})['then'](function(_0x6c568c){if(_0x6c568c){return _0x6c568c?{'count':_0x956aa6,'rows':_0x6c568c}:null;}})[_0x83c4('0x1f')](respondWithResult(_0x24a460,null))[_0x83c4('0x3f')](handleError(_0x24a460,null));};exports['setTags']=function(_0x3764cd,_0x2d8931,_0x29ff94){if(_0x3764cd[_0x83c4('0x44')]['id']){delete _0x3764cd[_0x83c4('0x44')]['id'];}return db[_0x83c4('0x3d')][_0x83c4('0x49')]({'where':{'id':_0x3764cd['params']['id']}})[_0x83c4('0x1f')](handleEntityNotFound(_0x2d8931,null))['then'](function(_0x15d28f){if(_0x15d28f){return _0x15d28f[_0x83c4('0x4f')](_0x3764cd[_0x83c4('0x44')]['ids']||[]);}return null;})[_0x83c4('0x1f')](respondWithResult(_0x2d8931,null))[_0x83c4('0x3f')](handleError(_0x2d8931,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 7e58d63..cf4f94d 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 _0x4104=['rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x4104,0x1e3));var _0x4410=function(_0x4b6507,_0x5518b5){_0x4b6507=_0x4b6507-0x0;var _0x2001ec=_0x4104[_0x4b6507];return _0x2001ec;};'use strict';var _=require(_0x4410('0x0'));var util=require(_0x4410('0x1'));var logger=require(_0x4410('0x2'))(_0x4410('0x3'));var moment=require(_0x4410('0x4'));var BPromise=require(_0x4410('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4410('0x6'));var rimraf=require(_0x4410('0x7'));var config=require(_0x4410('0x8'));var attributes=require(_0x4410('0x9'));module[_0x4410('0xa')]=function(_0x1df870,_0x499489){return _0x1df870[_0x4410('0xb')](_0x4410('0xc'),attributes,{'tableName':_0x4410('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x56f0=['rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','define','FreshdeskConfiguration','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x1d78fd,_0x1f8a7e){var _0x270bff=function(_0x552519){while(--_0x552519){_0x1d78fd['push'](_0x1d78fd['shift']());}};_0x270bff(++_0x1f8a7e);}(_0x56f0,0x1c1));var _0x056f=function(_0xf16b1,_0x33c637){_0xf16b1=_0xf16b1-0x0;var _0x26f94d=_0x56f0[_0xf16b1];return _0x26f94d;};'use strict';var _=require(_0x056f('0x0'));var util=require(_0x056f('0x1'));var logger=require(_0x056f('0x2'))('api');var moment=require(_0x056f('0x3'));var BPromise=require(_0x056f('0x4'));var rp=require(_0x056f('0x5'));var fs=require('fs');var path=require(_0x056f('0x6'));var rimraf=require(_0x056f('0x7'));var config=require(_0x056f('0x8'));var attributes=require(_0x056f('0x9'));module['exports']=function(_0x10d2af,_0x455098){return _0x10d2af[_0x056f('0xa')](_0x056f('0xb'),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 9b0f5f6..5e4a58c 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 _0x5980=['../../config/utils','rpc','client','http','request','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','../../mysqldb'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0x5980,0x1ac));var _0x0598=function(_0x516ffb,_0x5b5b42){_0x516ffb=_0x516ffb-0x0;var _0x319667=_0x5980[_0x516ffb];return _0x319667;};'use strict';var _=require(_0x0598('0x0'));var util=require(_0x0598('0x1'));var moment=require('moment');var BPromise=require(_0x0598('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0598('0x3'))['db'];var utils=require(_0x0598('0x4'));var logger=require('../../config/logger')(_0x0598('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0598('0x6')][_0x0598('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xa2593a,_0x45c49b,_0x5e47f6){return new BPromise(function(_0x569408,_0x10a226){return client[_0x0598('0x8')](_0xa2593a,_0x5e47f6)['then'](function(_0x40258c){logger['info'](_0x0598('0x9'),_0x45c49b,_0x0598('0xa'));logger['debug']('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x45c49b,'request\x20sent',JSON[_0x0598('0xb')](_0x40258c));if(_0x40258c['error']){if(_0x40258c[_0x0598('0xc')][_0x0598('0xd')]===0x1f4){logger[_0x0598('0xc')](_0x0598('0x9'),_0x45c49b,_0x40258c[_0x0598('0xc')][_0x0598('0xe')]);return _0x10a226(_0x40258c[_0x0598('0xc')]['message']);}logger['error'](_0x0598('0x9'),_0x45c49b,_0x40258c[_0x0598('0xc')]['message']);return _0x569408(_0x40258c[_0x0598('0xc')][_0x0598('0xe')]);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x45c49b,_0x0598('0xa'));_0x569408(_0x40258c['result'][_0x0598('0xe')]);}})[_0x0598('0xf')](function(_0x119c52){logger['error'](_0x0598('0x9'),_0x45c49b,_0x119c52);_0x10a226(_0x119c52);});});} \ No newline at end of file +var _0xef1f=['then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xef1f,0x112));var _0xfef1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xef1f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xfef1('0x0'));var util=require(_0xfef1('0x1'));var moment=require(_0xfef1('0x2'));var BPromise=require(_0xfef1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfef1('0x4'));var db=require(_0xfef1('0x5'))['db'];var utils=require(_0xfef1('0x6'));var logger=require(_0xfef1('0x7'))(_0xfef1('0x8'));var config=require(_0xfef1('0x9'));var jayson=require(_0xfef1('0xa'));var client=jayson[_0xfef1('0xb')][_0xfef1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3918d6,_0x5eefce,_0xbb58fd){return new BPromise(function(_0x3e24a0,_0x45609e){return client[_0xfef1('0xd')](_0x3918d6,_0xbb58fd)[_0xfef1('0xe')](function(_0xcc8d2a){logger[_0xfef1('0xf')](_0xfef1('0x10'),_0x5eefce,_0xfef1('0x11'));logger['debug'](_0xfef1('0x12'),_0x5eefce,_0xfef1('0x11'),JSON[_0xfef1('0x13')](_0xcc8d2a));if(_0xcc8d2a[_0xfef1('0x14')]){if(_0xcc8d2a[_0xfef1('0x14')][_0xfef1('0x15')]===0x1f4){logger[_0xfef1('0x14')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5eefce,_0xcc8d2a['error'][_0xfef1('0x16')]);return _0x45609e(_0xcc8d2a[_0xfef1('0x14')][_0xfef1('0x16')]);}logger[_0xfef1('0x14')](_0xfef1('0x10'),_0x5eefce,_0xcc8d2a[_0xfef1('0x14')][_0xfef1('0x16')]);return _0x3e24a0(_0xcc8d2a[_0xfef1('0x14')]['message']);}else{logger['info'](_0xfef1('0x10'),_0x5eefce,_0xfef1('0x11'));_0x3e24a0(_0xcc8d2a[_0xfef1('0x17')][_0xfef1('0x16')]);}})['catch'](function(_0xcc7743){logger[_0xfef1('0x14')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5eefce,_0xcc7743);_0x45609e(_0xcc7743);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index d39bcf7..78dbf4b 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 _0xe423=['../../components/interaction/service','./intFreshdeskField.controller','get','index','/:id','isAuthenticated','show','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0xe423,0x188));var _0x3e42=function(_0x532c09,_0x4a4389){_0x532c09=_0x532c09-0x0;var _0x2be3b2=_0xe423[_0x532c09];return _0x2be3b2;};'use strict';var multer=require(_0x3e42('0x0'));var util=require(_0x3e42('0x1'));var path=require(_0x3e42('0x2'));var timeout=require(_0x3e42('0x3'));var express=require(_0x3e42('0x4'));var router=express[_0x3e42('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3e42('0x6'));var interaction=require(_0x3e42('0x7'));var config=require('../../config/environment');var controller=require(_0x3e42('0x8'));router[_0x3e42('0x9')]('/',auth['isAuthenticated'](),controller[_0x3e42('0xa')]);router[_0x3e42('0x9')](_0x3e42('0xb'),auth[_0x3e42('0xc')](),controller[_0x3e42('0xd')]);router['post']('/',auth[_0x3e42('0xc')](),controller[_0x3e42('0xe')]);router[_0x3e42('0xf')](_0x3e42('0xb'),auth['isAuthenticated'](),controller[_0x3e42('0x10')]);router[_0x3e42('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x3e42('0x12')]=router; \ No newline at end of file +var _0xcc3c=['update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put'];(function(_0x47db6b,_0x52503b){var _0x5a6ab9=function(_0x4ada86){while(--_0x4ada86){_0x47db6b['push'](_0x47db6b['shift']());}};_0x5a6ab9(++_0x52503b);}(_0xcc3c,0x123));var _0xccc3=function(_0x1b4577,_0x32d48c){_0x1b4577=_0x1b4577-0x0;var _0x3fe727=_0xcc3c[_0x1b4577];return _0x3fe727;};'use strict';var multer=require(_0xccc3('0x0'));var util=require(_0xccc3('0x1'));var path=require(_0xccc3('0x2'));var timeout=require(_0xccc3('0x3'));var express=require(_0xccc3('0x4'));var router=express[_0xccc3('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xccc3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xccc3('0x7'));var controller=require('./intFreshdeskField.controller');router[_0xccc3('0x8')]('/',auth[_0xccc3('0x9')](),controller[_0xccc3('0xa')]);router[_0xccc3('0x8')](_0xccc3('0xb'),auth[_0xccc3('0x9')](),controller['show']);router[_0xccc3('0xc')]('/',auth[_0xccc3('0x9')](),controller[_0xccc3('0xd')]);router[_0xccc3('0xe')](_0xccc3('0xb'),auth['isAuthenticated'](),controller[_0xccc3('0xf')]);router[_0xccc3('0x10')]('/:id',auth[_0xccc3('0x9')](),controller['destroy']);module[_0xccc3('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 176710a..b7264ea 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 _0xf809=['ENUM','exports','string','variable','customVariable','keyValue','STRING'];(function(_0x16795f,_0x533662){var _0x328f13=function(_0x5b8e28){while(--_0x5b8e28){_0x16795f['push'](_0x16795f['shift']());}};_0x328f13(++_0x533662);}(_0xf809,0xfd));var _0x9f80=function(_0x406755,_0x34bf0e){_0x406755=_0x406755-0x0;var _0x2074bf=_0xf809[_0x406755];return _0x2074bf;};'use strict';var Sequelize=require('sequelize');module[_0x9f80('0x0')]={'type':{'type':Sequelize['ENUM'](_0x9f80('0x1'),_0x9f80('0x2'),_0x9f80('0x3'),_0x9f80('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x9f80('0x5')]},'key':{'type':Sequelize[_0x9f80('0x5')]},'keyType':{'type':Sequelize[_0x9f80('0x6')](_0x9f80('0x1'),_0x9f80('0x2'),_0x9f80('0x3'))},'keyContent':{'type':Sequelize[_0x9f80('0x5')]},'idField':{'type':Sequelize[_0x9f80('0x5')]},'nameField':{'type':Sequelize[_0x9f80('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6b77=['variable','customVariable','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x51b43c,_0x5670de){var _0x32813f=function(_0x4fddd0){while(--_0x4fddd0){_0x51b43c['push'](_0x51b43c['shift']());}};_0x32813f(++_0x5670de);}(_0x6b77,0x1d0));var _0x76b7=function(_0x463d8f,_0xc8ed09){_0x463d8f=_0x463d8f-0x0;var _0x501565=_0x6b77[_0x463d8f];return _0x501565;};'use strict';var Sequelize=require(_0x76b7('0x0'));module[_0x76b7('0x1')]={'type':{'type':Sequelize[_0x76b7('0x2')](_0x76b7('0x3'),_0x76b7('0x4'),_0x76b7('0x5'),'keyValue',_0x76b7('0x6')),'defaultValue':_0x76b7('0x3')},'content':{'type':Sequelize[_0x76b7('0x7')]},'key':{'type':Sequelize[_0x76b7('0x7')]},'keyType':{'type':Sequelize[_0x76b7('0x2')](_0x76b7('0x3'),_0x76b7('0x4'),_0x76b7('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x76b7('0x7')]},'nameField':{'type':Sequelize[_0x76b7('0x7')]},'customField':{'type':Sequelize[_0x76b7('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x76b7('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 60c0f50..07b6350 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 _0xd404=['set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshdeskField','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','findAll','rows','catch','params','rawAttributes','options','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count'];(function(_0x3c1c25,_0x43ca9b){var _0x17319c=function(_0x1eca45){while(--_0x1eca45){_0x3c1c25['push'](_0x3c1c25['shift']());}};_0x17319c(++_0x43ca9b);}(_0xd404,0x15b));var _0x4d40=function(_0x23ef79,_0x4cf46e){_0x23ef79=_0x23ef79-0x0;var _0x216685=_0xd404[_0x23ef79];return _0x216685;};'use strict';var emlformat=require(_0x4d40('0x0'));var rimraf=require(_0x4d40('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d40('0x2'));var rp=require(_0x4d40('0x3'));var moment=require('moment');var BPromise=require(_0x4d40('0x4'));var Mustache=require(_0x4d40('0x5'));var util=require(_0x4d40('0x6'));var path=require(_0x4d40('0x7'));var sox=require(_0x4d40('0x8'));var csv=require(_0x4d40('0x9'));var ejs=require(_0x4d40('0xa'));var fs=require('fs');var fs_extra=require(_0x4d40('0xb'));var _=require(_0x4d40('0xc'));var squel=require('squel');var crypto=require(_0x4d40('0xd'));var jsforce=require(_0x4d40('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4d40('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4d40('0xf'));var authService=require(_0x4d40('0x10'));var qs=require(_0x4d40('0x11'));var as=require(_0x4d40('0x12'));var hardwareService=require(_0x4d40('0x13'));var logger=require(_0x4d40('0x14'))(_0x4d40('0x15'));var utils=require(_0x4d40('0x16'));var config=require(_0x4d40('0x17'));var licenseUtil=require(_0x4d40('0x18'));var db=require(_0x4d40('0x19'))['db'];function respondWithStatusCode(_0x3c3b7e,_0x28e5bf){_0x28e5bf=_0x28e5bf||0xcc;return function(_0x42a621){if(_0x42a621){return _0x3c3b7e['sendStatus'](_0x28e5bf);}return _0x3c3b7e[_0x4d40('0x1a')](_0x28e5bf)[_0x4d40('0x1b')]();};}function respondWithResult(_0x3b071b,_0x2083bd){_0x2083bd=_0x2083bd||0xc8;return function(_0x477a91){if(_0x477a91){return _0x3b071b['status'](_0x2083bd)[_0x4d40('0x1c')](_0x477a91);}};}function respondWithFilteredResult(_0x4077ce,_0x20bc1b){return function(_0xcee25a){if(_0xcee25a){var _0x453857=typeof _0x20bc1b[_0x4d40('0x1d')]===_0x4d40('0x1e')&&typeof _0x20bc1b[_0x4d40('0x1f')]===_0x4d40('0x1e');var _0x4b5d23=_0xcee25a['count'];var _0x1ae5c7=_0x453857?0x0:_0x20bc1b[_0x4d40('0x1d')];var _0x4e505f=_0x453857?_0xcee25a[_0x4d40('0x20')]:_0x20bc1b[_0x4d40('0x1d')]+_0x20bc1b['limit'];var _0x36d031;if(_0x4e505f>=_0x4b5d23){_0x4e505f=_0x4b5d23;_0x36d031=0xc8;}else{_0x36d031=0xce;}_0x4077ce['status'](_0x36d031);return _0x4077ce[_0x4d40('0x21')](_0x4d40('0x22'),_0x1ae5c7+'-'+_0x4e505f+'/'+_0x4b5d23)['json'](_0xcee25a);}return null;};}function patchUpdates(_0x57c997){return function(_0x375ce0){try{jsonpatch[_0x4d40('0x23')](_0x375ce0,_0x57c997,!![]);}catch(_0x4d52ce){return BPromise[_0x4d40('0x24')](_0x4d52ce);}return _0x375ce0[_0x4d40('0x25')]();};}function saveUpdates(_0x30f058,_0x5d4c24){return function(_0x356fd6){if(_0x356fd6){return _0x356fd6[_0x4d40('0x26')](_0x30f058)[_0x4d40('0x27')](function(_0x5ca0a0){return _0x5ca0a0;});}return null;};}function removeEntity(_0x4eebc3,_0x2df33a){return function(_0x90b652){if(_0x90b652){return _0x90b652[_0x4d40('0x28')]()[_0x4d40('0x27')](function(){_0x4eebc3[_0x4d40('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xbcd540,_0x1f5e5b){return function(_0x560df8){if(!_0x560df8){_0xbcd540['sendStatus'](0x194);}return _0x560df8;};}function handleError(_0x274d44,_0x2a0c82){_0x2a0c82=_0x2a0c82||0x1f4;return function(_0x3fa83e){logger[_0x4d40('0x29')](_0x3fa83e[_0x4d40('0x2a')]);if(_0x3fa83e[_0x4d40('0x2b')]){delete _0x3fa83e[_0x4d40('0x2b')];}_0x274d44[_0x4d40('0x1a')](_0x2a0c82)[_0x4d40('0x2c')](_0x3fa83e);};}exports[_0x4d40('0x2d')]=function(_0x1c0fcf,_0x4ca431){var _0x4e4e61={},_0x52f706={},_0x158a86={'count':0x0,'rows':[]};var _0x350488=_[_0x4d40('0x2e')](db[_0x4d40('0x2f')]['rawAttributes'],function(_0x18e601){return{'name':_0x18e601[_0x4d40('0x30')],'type':_0x18e601[_0x4d40('0x31')]['key']};});_0x52f706[_0x4d40('0x32')]=_[_0x4d40('0x2e')](_0x350488,_0x4d40('0x2b'));_0x52f706[_0x4d40('0x33')]=_[_0x4d40('0x34')](_0x1c0fcf['query']);_0x52f706[_0x4d40('0x35')]=_['intersection'](_0x52f706[_0x4d40('0x32')],_0x52f706[_0x4d40('0x33')]);_0x4e4e61[_0x4d40('0x36')]=_[_0x4d40('0x37')](_0x52f706['model'],qs['fields'](_0x1c0fcf[_0x4d40('0x33')][_0x4d40('0x38')]));_0x4e4e61[_0x4d40('0x36')]=_0x4e4e61[_0x4d40('0x36')]['length']?_0x4e4e61[_0x4d40('0x36')]:_0x52f706['model'];if(!_0x1c0fcf[_0x4d40('0x33')][_0x4d40('0x39')](_0x4d40('0x3a'))){_0x4e4e61[_0x4d40('0x1f')]=qs[_0x4d40('0x1f')](_0x1c0fcf[_0x4d40('0x33')][_0x4d40('0x1f')]);_0x4e4e61[_0x4d40('0x1d')]=qs[_0x4d40('0x1d')](_0x1c0fcf[_0x4d40('0x33')]['offset']);}_0x4e4e61[_0x4d40('0x3b')]=qs[_0x4d40('0x3c')](_0x1c0fcf['query']['sort']);_0x4e4e61['where']=qs[_0x4d40('0x35')](_[_0x4d40('0x3d')](_0x1c0fcf['query'],_0x52f706[_0x4d40('0x35')]),_0x350488);if(_0x1c0fcf[_0x4d40('0x33')][_0x4d40('0x3e')]){_0x4e4e61[_0x4d40('0x3f')]=_[_0x4d40('0x40')](_0x4e4e61['where'],{'$or':_[_0x4d40('0x2e')](_0x350488,function(_0x21a4ec){if(_0x21a4ec['type']!=='VIRTUAL'){var _0x3a4924={};_0x3a4924[_0x21a4ec[_0x4d40('0x2b')]]={'$like':'%'+_0x1c0fcf['query'][_0x4d40('0x3e')]+'%'};return _0x3a4924;}})});}_0x4e4e61=_[_0x4d40('0x40')]({},_0x4e4e61,_0x1c0fcf['options']);var _0x1e8427={'where':_0x4e4e61[_0x4d40('0x3f')]};return db['FreshdeskField'][_0x4d40('0x20')](_0x1e8427)[_0x4d40('0x27')](function(_0x4841ac){_0x158a86[_0x4d40('0x20')]=_0x4841ac;if(_0x1c0fcf['query'][_0x4d40('0x41')]){_0x4e4e61[_0x4d40('0x42')]=[{'all':!![]}];}return db[_0x4d40('0x2f')][_0x4d40('0x43')](_0x4e4e61);})[_0x4d40('0x27')](function(_0x2ef0ca){_0x158a86[_0x4d40('0x44')]=_0x2ef0ca;return _0x158a86;})[_0x4d40('0x27')](respondWithFilteredResult(_0x4ca431,_0x4e4e61))[_0x4d40('0x45')](handleError(_0x4ca431,null));};exports['show']=function(_0x250847,_0x3718a8){var _0x1c2fa8={'raw':!![],'where':{'id':_0x250847[_0x4d40('0x46')]['id']}},_0xcdde22={};_0xcdde22['model']=_[_0x4d40('0x34')](db['FreshdeskField'][_0x4d40('0x47')]);_0xcdde22[_0x4d40('0x33')]=_[_0x4d40('0x34')](_0x250847[_0x4d40('0x33')]);_0xcdde22['filters']=_[_0x4d40('0x37')](_0xcdde22[_0x4d40('0x32')],_0xcdde22['query']);_0x1c2fa8[_0x4d40('0x36')]=_['intersection'](_0xcdde22[_0x4d40('0x32')],qs[_0x4d40('0x38')](_0x250847[_0x4d40('0x33')][_0x4d40('0x38')]));_0x1c2fa8['attributes']=_0x1c2fa8[_0x4d40('0x36')]['length']?_0x1c2fa8[_0x4d40('0x36')]:_0xcdde22[_0x4d40('0x32')];if(_0x250847[_0x4d40('0x33')][_0x4d40('0x41')]){_0x1c2fa8['include']=[{'all':!![]}];}_0x1c2fa8=_[_0x4d40('0x40')]({},_0x1c2fa8,_0x250847[_0x4d40('0x48')]);return db[_0x4d40('0x2f')][_0x4d40('0x49')](_0x1c2fa8)['then'](handleEntityNotFound(_0x3718a8,null))[_0x4d40('0x27')](respondWithResult(_0x3718a8,null))[_0x4d40('0x45')](handleError(_0x3718a8,null));};exports['create']=function(_0x200d29,_0x493d8e){return db[_0x4d40('0x2f')][_0x4d40('0x4a')](_0x200d29[_0x4d40('0x4b')],{})[_0x4d40('0x27')](respondWithResult(_0x493d8e,0xc9))[_0x4d40('0x45')](handleError(_0x493d8e,null));};exports[_0x4d40('0x26')]=function(_0x30be7b,_0x37b6bf){if(_0x30be7b[_0x4d40('0x4b')]['id']){delete _0x30be7b['body']['id'];}return db[_0x4d40('0x2f')][_0x4d40('0x49')]({'where':{'id':_0x30be7b[_0x4d40('0x46')]['id']}})[_0x4d40('0x27')](handleEntityNotFound(_0x37b6bf,null))[_0x4d40('0x27')](saveUpdates(_0x30be7b['body'],null))[_0x4d40('0x27')](respondWithResult(_0x37b6bf,null))[_0x4d40('0x45')](handleError(_0x37b6bf,null));};exports['destroy']=function(_0xdf0235,_0x48ffd7){return db[_0x4d40('0x2f')][_0x4d40('0x49')]({'where':{'id':_0xdf0235[_0x4d40('0x46')]['id']}})['then'](handleEntityNotFound(_0x48ffd7,null))[_0x4d40('0x27')](removeEntity(_0x48ffd7,null))[_0x4d40('0x45')](handleError(_0x48ffd7,null));}; \ No newline at end of file +var _0x6308=['path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','count','offset','limit','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','FreshdeskField','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','eml-format','zip-dir','moment','bluebird','mustache','util'];(function(_0x3a7257,_0x4fc699){var _0x1e9df6=function(_0x1934bc){while(--_0x1934bc){_0x3a7257['push'](_0x3a7257['shift']());}};_0x1e9df6(++_0x4fc699);}(_0x6308,0x1f2));var _0x8630=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0x6308[_0xd09668];return _0x68726;};'use strict';var emlformat=require(_0x8630('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8630('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8630('0x2'));var BPromise=require(_0x8630('0x3'));var Mustache=require(_0x8630('0x4'));var util=require(_0x8630('0x5'));var path=require(_0x8630('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8630('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8630('0x8'));var squel=require(_0x8630('0x9'));var crypto=require(_0x8630('0xa'));var jsforce=require(_0x8630('0xb'));var deskjs=require(_0x8630('0xc'));var toCsv=require(_0x8630('0xd'));var querystring=require('querystring');var Papa=require(_0x8630('0xe'));var Redis=require('ioredis');var authService=require(_0x8630('0xf'));var qs=require(_0x8630('0x10'));var as=require(_0x8630('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8630('0x12'))(_0x8630('0x13'));var utils=require(_0x8630('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8630('0x15'));var db=require(_0x8630('0x16'))['db'];function respondWithStatusCode(_0x5b6d75,_0x54073b){_0x54073b=_0x54073b||0xcc;return function(_0x303e3a){if(_0x303e3a){return _0x5b6d75[_0x8630('0x17')](_0x54073b);}return _0x5b6d75['status'](_0x54073b)[_0x8630('0x18')]();};}function respondWithResult(_0x4db686,_0xf31c17){_0xf31c17=_0xf31c17||0xc8;return function(_0x4cc542){if(_0x4cc542){return _0x4db686[_0x8630('0x19')](_0xf31c17)['json'](_0x4cc542);}};}function respondWithFilteredResult(_0x53f236,_0x29a42d){return function(_0x86c262){if(_0x86c262){var _0x49fce1=typeof _0x29a42d['offset']===_0x8630('0x1a')&&typeof _0x29a42d['limit']===_0x8630('0x1a');var _0x18a874=_0x86c262[_0x8630('0x1b')];var _0x20f462=_0x49fce1?0x0:_0x29a42d[_0x8630('0x1c')];var _0x1e9780=_0x49fce1?_0x86c262[_0x8630('0x1b')]:_0x29a42d[_0x8630('0x1c')]+_0x29a42d[_0x8630('0x1d')];var _0x5dd2e0;if(_0x1e9780>=_0x18a874){_0x1e9780=_0x18a874;_0x5dd2e0=0xc8;}else{_0x5dd2e0=0xce;}_0x53f236['status'](_0x5dd2e0);return _0x53f236[_0x8630('0x1e')](_0x8630('0x1f'),_0x20f462+'-'+_0x1e9780+'/'+_0x18a874)['json'](_0x86c262);}return null;};}function patchUpdates(_0x5cff5c){return function(_0x1325dc){try{jsonpatch[_0x8630('0x20')](_0x1325dc,_0x5cff5c,!![]);}catch(_0x1ac046){return BPromise['reject'](_0x1ac046);}return _0x1325dc['save']();};}function saveUpdates(_0xcc7454,_0x58c0b5){return function(_0x30fb4d){if(_0x30fb4d){return _0x30fb4d[_0x8630('0x21')](_0xcc7454)[_0x8630('0x22')](function(_0x469de3){return _0x469de3;});}return null;};}function removeEntity(_0x4c2851,_0x37c224){return function(_0xf24c11){if(_0xf24c11){return _0xf24c11[_0x8630('0x23')]()[_0x8630('0x22')](function(){_0x4c2851[_0x8630('0x19')](0xcc)[_0x8630('0x18')]();});}};}function handleEntityNotFound(_0x37b7aa,_0x5c0a22){return function(_0x5b2823){if(!_0x5b2823){_0x37b7aa[_0x8630('0x17')](0x194);}return _0x5b2823;};}function handleError(_0x41b79d,_0x439b33){_0x439b33=_0x439b33||0x1f4;return function(_0xf97e31){logger[_0x8630('0x24')](_0xf97e31[_0x8630('0x25')]);if(_0xf97e31[_0x8630('0x26')]){delete _0xf97e31[_0x8630('0x26')];}_0x41b79d[_0x8630('0x19')](_0x439b33)[_0x8630('0x27')](_0xf97e31);};}exports[_0x8630('0x28')]=function(_0x41f74c,_0xc18164){var _0x4285ee={},_0xbb1a58={},_0x190216={'count':0x0,'rows':[]};var _0x2d3f0b=_['map'](db[_0x8630('0x29')][_0x8630('0x2a')],function(_0x24d85d){return{'name':_0x24d85d[_0x8630('0x2b')],'type':_0x24d85d['type'][_0x8630('0x2c')]};});_0xbb1a58[_0x8630('0x2d')]=_[_0x8630('0x2e')](_0x2d3f0b,_0x8630('0x26'));_0xbb1a58[_0x8630('0x2f')]=_[_0x8630('0x30')](_0x41f74c['query']);_0xbb1a58[_0x8630('0x31')]=_[_0x8630('0x32')](_0xbb1a58[_0x8630('0x2d')],_0xbb1a58['query']);_0x4285ee[_0x8630('0x33')]=_[_0x8630('0x32')](_0xbb1a58[_0x8630('0x2d')],qs[_0x8630('0x34')](_0x41f74c[_0x8630('0x2f')][_0x8630('0x34')]));_0x4285ee['attributes']=_0x4285ee[_0x8630('0x33')][_0x8630('0x35')]?_0x4285ee[_0x8630('0x33')]:_0xbb1a58[_0x8630('0x2d')];if(!_0x41f74c[_0x8630('0x2f')][_0x8630('0x36')](_0x8630('0x37'))){_0x4285ee[_0x8630('0x1d')]=qs[_0x8630('0x1d')](_0x41f74c[_0x8630('0x2f')][_0x8630('0x1d')]);_0x4285ee[_0x8630('0x1c')]=qs[_0x8630('0x1c')](_0x41f74c[_0x8630('0x2f')][_0x8630('0x1c')]);}_0x4285ee[_0x8630('0x38')]=qs[_0x8630('0x39')](_0x41f74c['query'][_0x8630('0x39')]);_0x4285ee[_0x8630('0x3a')]=qs['filters'](_['pick'](_0x41f74c[_0x8630('0x2f')],_0xbb1a58[_0x8630('0x31')]),_0x2d3f0b);if(_0x41f74c[_0x8630('0x2f')][_0x8630('0x3b')]){_0x4285ee[_0x8630('0x3a')]=_['merge'](_0x4285ee[_0x8630('0x3a')],{'$or':_[_0x8630('0x2e')](_0x2d3f0b,function(_0x38ee10){if(_0x38ee10[_0x8630('0x3c')]!=='VIRTUAL'){var _0xac2876={};_0xac2876[_0x38ee10[_0x8630('0x26')]]={'$like':'%'+_0x41f74c[_0x8630('0x2f')][_0x8630('0x3b')]+'%'};return _0xac2876;}})});}_0x4285ee=_[_0x8630('0x3d')]({},_0x4285ee,_0x41f74c[_0x8630('0x3e')]);var _0x2fbb8c={'where':_0x4285ee['where']};return db[_0x8630('0x29')][_0x8630('0x1b')](_0x2fbb8c)[_0x8630('0x22')](function(_0xe3f392){_0x190216[_0x8630('0x1b')]=_0xe3f392;if(_0x41f74c[_0x8630('0x2f')][_0x8630('0x3f')]){_0x4285ee[_0x8630('0x40')]=[{'all':!![]}];}return db[_0x8630('0x29')][_0x8630('0x41')](_0x4285ee);})['then'](function(_0x358431){_0x190216['rows']=_0x358431;return _0x190216;})[_0x8630('0x22')](respondWithFilteredResult(_0xc18164,_0x4285ee))[_0x8630('0x42')](handleError(_0xc18164,null));};exports[_0x8630('0x43')]=function(_0x7c3dc5,_0x193bae){var _0x2f1fec={'raw':!![],'where':{'id':_0x7c3dc5[_0x8630('0x44')]['id']}},_0x5bcf39={};_0x5bcf39[_0x8630('0x2d')]=_[_0x8630('0x30')](db['FreshdeskField'][_0x8630('0x2a')]);_0x5bcf39[_0x8630('0x2f')]=_[_0x8630('0x30')](_0x7c3dc5[_0x8630('0x2f')]);_0x5bcf39[_0x8630('0x31')]=_[_0x8630('0x32')](_0x5bcf39['model'],_0x5bcf39[_0x8630('0x2f')]);_0x2f1fec[_0x8630('0x33')]=_[_0x8630('0x32')](_0x5bcf39['model'],qs[_0x8630('0x34')](_0x7c3dc5[_0x8630('0x2f')]['fields']));_0x2f1fec[_0x8630('0x33')]=_0x2f1fec[_0x8630('0x33')][_0x8630('0x35')]?_0x2f1fec['attributes']:_0x5bcf39['model'];if(_0x7c3dc5[_0x8630('0x2f')]['includeAll']){_0x2f1fec['include']=[{'all':!![]}];}_0x2f1fec=_[_0x8630('0x3d')]({},_0x2f1fec,_0x7c3dc5['options']);return db[_0x8630('0x29')][_0x8630('0x45')](_0x2f1fec)['then'](handleEntityNotFound(_0x193bae,null))[_0x8630('0x22')](respondWithResult(_0x193bae,null))[_0x8630('0x42')](handleError(_0x193bae,null));};exports[_0x8630('0x46')]=function(_0x5d8149,_0x121e83){return db['FreshdeskField'][_0x8630('0x46')](_0x5d8149[_0x8630('0x47')],{})['then'](respondWithResult(_0x121e83,0xc9))[_0x8630('0x42')](handleError(_0x121e83,null));};exports[_0x8630('0x21')]=function(_0x3ff20b,_0x47aa03){if(_0x3ff20b[_0x8630('0x47')]['id']){delete _0x3ff20b[_0x8630('0x47')]['id'];}return db[_0x8630('0x29')][_0x8630('0x45')]({'where':{'id':_0x3ff20b[_0x8630('0x44')]['id']}})[_0x8630('0x22')](handleEntityNotFound(_0x47aa03,null))[_0x8630('0x22')](saveUpdates(_0x3ff20b[_0x8630('0x47')],null))[_0x8630('0x22')](respondWithResult(_0x47aa03,null))['catch'](handleError(_0x47aa03,null));};exports['destroy']=function(_0x1b8328,_0x13326d){return db[_0x8630('0x29')][_0x8630('0x45')]({'where':{'id':_0x1b8328[_0x8630('0x44')]['id']}})[_0x8630('0x22')](handleEntityNotFound(_0x13326d,null))[_0x8630('0x22')](removeEntity(_0x13326d,null))['catch'](handleError(_0x13326d,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 8b07828..240bf40 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 _0xb00d=['request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','freshdesk_unique_index','idField','lodash','moment','bluebird'];(function(_0x52b24f,_0xca062d){var _0x46ea6b=function(_0x29f821){while(--_0x29f821){_0x52b24f['push'](_0x52b24f['shift']());}};_0x46ea6b(++_0xca062d);}(_0xb00d,0x97));var _0xdb00=function(_0x764874,_0x3ed544){_0x764874=_0x764874-0x0;var _0x29f9d5=_0xb00d[_0x764874];return _0x29f9d5;};'use strict';var _=require(_0xdb00('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xdb00('0x1'));var BPromise=require(_0xdb00('0x2'));var rp=require(_0xdb00('0x3'));var fs=require('fs');var path=require(_0xdb00('0x4'));var rimraf=require(_0xdb00('0x5'));var config=require(_0xdb00('0x6'));var attributes=require(_0xdb00('0x7'));module[_0xdb00('0x8')]=function(_0x5218fb,_0x1e7a8d){return _0x5218fb['define']('FreshdeskField',attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0xdb00('0x9'),'fields':[_0xdb00('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9dc3=['request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','lodash','util','../../config/logger','bluebird'];(function(_0x37de84,_0x6beb0e){var _0x374bef=function(_0x5d4dd0){while(--_0x5d4dd0){_0x37de84['push'](_0x37de84['shift']());}};_0x374bef(++_0x6beb0e);}(_0x9dc3,0xa5));var _0x39dc=function(_0x2f9a58,_0x2fa88c){_0x2f9a58=_0x2f9a58-0x0;var _0x5ad5ff=_0x9dc3[_0x2f9a58];return _0x5ad5ff;};'use strict';var _=require(_0x39dc('0x0'));var util=require(_0x39dc('0x1'));var logger=require(_0x39dc('0x2'))('api');var moment=require('moment');var BPromise=require(_0x39dc('0x3'));var rp=require(_0x39dc('0x4'));var fs=require('fs');var path=require(_0x39dc('0x5'));var rimraf=require(_0x39dc('0x6'));var config=require(_0x39dc('0x7'));var attributes=require(_0x39dc('0x8'));module['exports']=function(_0xbe0b78,_0x2daa5e){return _0xbe0b78[_0x39dc('0x9')](_0x39dc('0xa'),attributes,{'tableName':_0x39dc('0xb'),'paranoid':![],'indexes':[{'name':_0x39dc('0xc'),'fields':['idField','FieldId'],'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 b6730f7..74533bb 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 _0x18cc=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','FreshdeskField,\x20%s,\x20%s','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x53755d,_0x4f705f){var _0x512b5b=function(_0x2b7ca8){while(--_0x2b7ca8){_0x53755d['push'](_0x53755d['shift']());}};_0x512b5b(++_0x4f705f);}(_0x18cc,0xb9));var _0xc18c=function(_0x45d0e8,_0x432700){_0x45d0e8=_0x45d0e8-0x0;var _0x1ff2c4=_0x18cc[_0x45d0e8];return _0x1ff2c4;};'use strict';var _=require(_0xc18c('0x0'));var util=require(_0xc18c('0x1'));var moment=require(_0xc18c('0x2'));var BPromise=require(_0xc18c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc18c('0x4'));var db=require(_0xc18c('0x5'))['db'];var utils=require(_0xc18c('0x6'));var logger=require(_0xc18c('0x7'))('rpc');var config=require(_0xc18c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc18c('0x9')][_0xc18c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x269dc0,_0x2a9b2d,_0x3e4f22){return new BPromise(function(_0x3ed3d3,_0x554974){return client['request'](_0x269dc0,_0x3e4f22)[_0xc18c('0xb')](function(_0x37dd0c){logger[_0xc18c('0xc')](_0xc18c('0xd'),_0x2a9b2d,'request\x20sent');logger[_0xc18c('0xe')](_0xc18c('0xf'),_0x2a9b2d,_0xc18c('0x10'),JSON[_0xc18c('0x11')](_0x37dd0c));if(_0x37dd0c[_0xc18c('0x12')]){if(_0x37dd0c['error'][_0xc18c('0x13')]===0x1f4){logger[_0xc18c('0x12')](_0xc18c('0xd'),_0x2a9b2d,_0x37dd0c['error'][_0xc18c('0x14')]);return _0x554974(_0x37dd0c[_0xc18c('0x12')][_0xc18c('0x14')]);}logger[_0xc18c('0x12')](_0xc18c('0xd'),_0x2a9b2d,_0x37dd0c[_0xc18c('0x12')][_0xc18c('0x14')]);return _0x3ed3d3(_0x37dd0c['error'][_0xc18c('0x14')]);}else{logger['info'](_0xc18c('0xd'),_0x2a9b2d,_0xc18c('0x10'));_0x3ed3d3(_0x37dd0c[_0xc18c('0x15')][_0xc18c('0x14')]);}})[_0xc18c('0x16')](function(_0x3238ca){logger[_0xc18c('0x12')](_0xc18c('0xd'),_0x2a9b2d,_0x3238ca);_0x554974(_0x3238ca);});});} \ No newline at end of file +var _0xab56=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','FreshdeskField,\x20%s,\x20%s','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','result','catch','lodash','moment','bluebird'];(function(_0x287184,_0x1231a7){var _0x1b59f3=function(_0x28ba9a){while(--_0x28ba9a){_0x287184['push'](_0x287184['shift']());}};_0x1b59f3(++_0x1231a7);}(_0xab56,0xc5));var _0x6ab5=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xab56[_0xf71120];return _0xbe2fd3;};'use strict';var _=require(_0x6ab5('0x0'));var util=require('util');var moment=require(_0x6ab5('0x1'));var BPromise=require(_0x6ab5('0x2'));var rs=require(_0x6ab5('0x3'));var fs=require('fs');var Redis=require(_0x6ab5('0x4'));var db=require(_0x6ab5('0x5'))['db'];var utils=require(_0x6ab5('0x6'));var logger=require('../../config/logger')(_0x6ab5('0x7'));var config=require(_0x6ab5('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x585032,_0x476ed1,_0x547735){return new BPromise(function(_0x6f7976,_0x566e0e){return client[_0x6ab5('0x9')](_0x585032,_0x547735)['then'](function(_0x33ce41){logger[_0x6ab5('0xa')](_0x6ab5('0xb'),_0x476ed1,'request\x20sent');logger[_0x6ab5('0xc')](_0x6ab5('0xd'),_0x476ed1,_0x6ab5('0xe'),JSON['stringify'](_0x33ce41));if(_0x33ce41['error']){if(_0x33ce41['error'][_0x6ab5('0xf')]===0x1f4){logger[_0x6ab5('0x10')](_0x6ab5('0xb'),_0x476ed1,_0x33ce41['error'][_0x6ab5('0x11')]);return _0x566e0e(_0x33ce41[_0x6ab5('0x10')][_0x6ab5('0x11')]);}logger['error'](_0x6ab5('0xb'),_0x476ed1,_0x33ce41[_0x6ab5('0x10')][_0x6ab5('0x11')]);return _0x6f7976(_0x33ce41[_0x6ab5('0x10')]['message']);}else{logger[_0x6ab5('0xa')](_0x6ab5('0xb'),_0x476ed1,_0x6ab5('0xe'));_0x6f7976(_0x33ce41[_0x6ab5('0x12')][_0x6ab5('0x11')]);}})[_0x6ab5('0x13')](function(_0x53a38e){logger['error'](_0x6ab5('0xb'),_0x476ed1,_0x53a38e);_0x566e0e(_0x53a38e);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 7060a59..44831cb 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 _0x5ec6=['exports','multer','util','path','express','fs-extra','../../components/interaction/service','./intFreshsalesAccount.controller','isAuthenticated','index','/:id','get','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','update','delete','destroy'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x5ec6,0x7f));var _0x65ec=function(_0x1f1aff,_0x57c40b){_0x1f1aff=_0x1f1aff-0x0;var _0x5ddb6e=_0x5ec6[_0x1f1aff];return _0x5ddb6e;};'use strict';var multer=require(_0x65ec('0x0'));var util=require(_0x65ec('0x1'));var path=require(_0x65ec('0x2'));var timeout=require('connect-timeout');var express=require(_0x65ec('0x3'));var router=express['Router']();var fs_extra=require(_0x65ec('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x65ec('0x5'));var config=require('../../config/environment');var controller=require(_0x65ec('0x6'));router['get']('/',auth[_0x65ec('0x7')](),controller[_0x65ec('0x8')]);router['get'](_0x65ec('0x9'),auth[_0x65ec('0x7')](),controller['show']);router[_0x65ec('0xa')](_0x65ec('0xb'),auth[_0x65ec('0x7')](),controller['getConfigurations']);router['get'](_0x65ec('0xc'),auth['isAuthenticated'](),controller[_0x65ec('0xd')]);router[_0x65ec('0xe')]('/',auth['isAuthenticated'](),controller[_0x65ec('0xf')]);router[_0x65ec('0xe')]('/:id/configurations',auth[_0x65ec('0x7')](),controller[_0x65ec('0x10')]);router['put'](_0x65ec('0x9'),auth[_0x65ec('0x7')](),controller[_0x65ec('0x11')]);router[_0x65ec('0x12')](_0x65ec('0x9'),auth[_0x65ec('0x7')](),controller[_0x65ec('0x13')]);module[_0x65ec('0x14')]=router; \ No newline at end of file +var _0x39cb=['put','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','index','/:id','isAuthenticated','/:id/configurations','getConfigurations','post','create','addConfiguration'];(function(_0x5d743a,_0x386cc3){var _0x2f0fec=function(_0x48b71e){while(--_0x48b71e){_0x5d743a['push'](_0x5d743a['shift']());}};_0x2f0fec(++_0x386cc3);}(_0x39cb,0x1bd));var _0xb39c=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x39cb[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require('multer');var util=require(_0xb39c('0x0'));var path=require(_0xb39c('0x1'));var timeout=require('connect-timeout');var express=require(_0xb39c('0x2'));var router=express[_0xb39c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb39c('0x4'));var interaction=require(_0xb39c('0x5'));var config=require(_0xb39c('0x6'));var controller=require(_0xb39c('0x7'));router[_0xb39c('0x8')]('/',auth['isAuthenticated'](),controller[_0xb39c('0x9')]);router[_0xb39c('0x8')](_0xb39c('0xa'),auth[_0xb39c('0xb')](),controller['show']);router['get'](_0xb39c('0xc'),auth[_0xb39c('0xb')](),controller[_0xb39c('0xd')]);router[_0xb39c('0x8')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0xb39c('0xe')]('/',auth[_0xb39c('0xb')](),controller[_0xb39c('0xf')]);router[_0xb39c('0xe')](_0xb39c('0xc'),auth[_0xb39c('0xb')](),controller[_0xb39c('0x10')]);router[_0xb39c('0x11')]('/:id',auth[_0xb39c('0xb')](),controller[_0xb39c('0x12')]);router[_0xb39c('0x13')]('/:id',auth[_0xb39c('0xb')](),controller[_0xb39c('0x14')]);module[_0xb39c('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 420171d..3404783 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 _0xb10b=['remoteUri','sequelize','STRING'];(function(_0x55aae4,_0xe2440){var _0x37c238=function(_0x3fcb26){while(--_0x3fcb26){_0x55aae4['push'](_0x55aae4['shift']());}};_0x37c238(++_0xe2440);}(_0xb10b,0x12a));var _0xbb10=function(_0x5ec09b,_0x12d654){_0x5ec09b=_0x5ec09b-0x0;var _0x5a8482=_0xb10b[_0x5ec09b];return _0x5a8482;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')]},'description':{'type':Sequelize[_0xbb10('0x1')]},'username':{'type':Sequelize[_0xbb10('0x1')],'unique':'username'},'apiKey':{'type':Sequelize[_0xbb10('0x1')]},'remoteUri':{'type':Sequelize[_0xbb10('0x1')],'unique':_0xbb10('0x2')},'serverUrl':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xfcbb=['exports','STRING','username','remoteUri','sequelize'];(function(_0x497649,_0x190b12){var _0x1c9f79=function(_0x387ca8){while(--_0x387ca8){_0x497649['push'](_0x497649['shift']());}};_0x1c9f79(++_0x190b12);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x5cbf46,_0x396204){_0x5cbf46=_0x5cbf46-0x0;var _0x4effb8=_0xfcbb[_0x5cbf46];return _0x4effb8;};'use strict';var Sequelize=require(_0xbfcb('0x0'));module[_0xbfcb('0x1')]={'name':{'type':Sequelize[_0xbfcb('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0xbfcb('0x3')},'apiKey':{'type':Sequelize[_0xbfcb('0x2')]},'remoteUri':{'type':Sequelize[_0xbfcb('0x2')],'unique':_0xbfcb('0x4')},'serverUrl':{'type':Sequelize[_0xbfcb('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 29e59f2..dc60753 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 _0xdb8e=['GET','format','%s%s','/api/selector/owners','Token\x20token=','apiKey','users','email','Requested\x20Resource\x20not\x20Found','test','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','statusCode','eml-format','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','reject','save','then','error','stack','name','send','map','FreshsalesAccount','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','findOne','FreshsalesConfiguration','order','nolimit','getConfigurations','AccountId','getSubjects','getDescriptions','channel','FreshsalesField','Descriptions','username','remoteUri','substring','lastIndexOf'];(function(_0x575b72,_0x1a7eb1){var _0x561c57=function(_0x10e401){while(--_0x10e401){_0x575b72['push'](_0x575b72['shift']());}};_0x561c57(++_0x1a7eb1);}(_0xdb8e,0x18f));var _0xedb8=function(_0x47cfb2,_0x550212){_0x47cfb2=_0x47cfb2-0x0;var _0x1d5212=_0xdb8e[_0x47cfb2];return _0x1d5212;};'use strict';var emlformat=require(_0xedb8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xedb8('0x1'));var jsonpatch=require(_0xedb8('0x2'));var rp=require(_0xedb8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xedb8('0x4'));var path=require(_0xedb8('0x5'));var sox=require(_0xedb8('0x6'));var csv=require(_0xedb8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xedb8('0x8'));var _=require('lodash');var squel=require(_0xedb8('0x9'));var crypto=require(_0xedb8('0xa'));var jsforce=require(_0xedb8('0xb'));var deskjs=require(_0xedb8('0xc'));var toCsv=require(_0xedb8('0x7'));var querystring=require(_0xedb8('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xedb8('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xedb8('0xf'));var config=require(_0xedb8('0x10'));var licenseUtil=require(_0xedb8('0x11'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x421662,_0x48b0bf){_0x48b0bf=_0x48b0bf||0xcc;return function(_0x192c8e){if(_0x192c8e){return _0x421662[_0xedb8('0x12')](_0x48b0bf);}return _0x421662['status'](_0x48b0bf)[_0xedb8('0x13')]();};}function respondWithResult(_0x343fcb,_0x36a465){_0x36a465=_0x36a465||0xc8;return function(_0x51c285){if(_0x51c285){return _0x343fcb[_0xedb8('0x14')](_0x36a465)['json'](_0x51c285);}};}function respondWithFilteredResult(_0x32a9b5,_0x4d1e85){return function(_0x3a3508){if(_0x3a3508){var _0x33efd3=typeof _0x4d1e85['offset']===_0xedb8('0x15')&&typeof _0x4d1e85[_0xedb8('0x16')]===_0xedb8('0x15');var _0x5ce463=_0x3a3508[_0xedb8('0x17')];var _0x1c352e=_0x33efd3?0x0:_0x4d1e85[_0xedb8('0x18')];var _0x2e3902=_0x33efd3?_0x3a3508[_0xedb8('0x17')]:_0x4d1e85['offset']+_0x4d1e85[_0xedb8('0x16')];var _0x532d7b;if(_0x2e3902>=_0x5ce463){_0x2e3902=_0x5ce463;_0x532d7b=0xc8;}else{_0x532d7b=0xce;}_0x32a9b5[_0xedb8('0x14')](_0x532d7b);return _0x32a9b5[_0xedb8('0x19')](_0xedb8('0x1a'),_0x1c352e+'-'+_0x2e3902+'/'+_0x5ce463)[_0xedb8('0x1b')](_0x3a3508);}return null;};}function patchUpdates(_0x1a7930){return function(_0x5978cc){try{jsonpatch['apply'](_0x5978cc,_0x1a7930,!![]);}catch(_0x16f0d4){return BPromise[_0xedb8('0x1c')](_0x16f0d4);}return _0x5978cc[_0xedb8('0x1d')]();};}function saveUpdates(_0x3013b2,_0x54f99b){return function(_0x2c1e4b){if(_0x2c1e4b){return _0x2c1e4b['update'](_0x3013b2)[_0xedb8('0x1e')](function(_0xef059){return _0xef059;});}return null;};}function removeEntity(_0x2d49e9,_0x4ff1a3){return function(_0x45772a){if(_0x45772a){return _0x45772a['destroy']()['then'](function(){_0x2d49e9[_0xedb8('0x14')](0xcc)[_0xedb8('0x13')]();});}};}function handleEntityNotFound(_0x1393a7,_0x322917){return function(_0x5071ca){if(!_0x5071ca){_0x1393a7[_0xedb8('0x12')](0x194);}return _0x5071ca;};}function handleError(_0x5d17ea,_0x4c7917){_0x4c7917=_0x4c7917||0x1f4;return function(_0x4ae035){logger[_0xedb8('0x1f')](_0x4ae035[_0xedb8('0x20')]);if(_0x4ae035[_0xedb8('0x21')]){delete _0x4ae035[_0xedb8('0x21')];}_0x5d17ea[_0xedb8('0x14')](_0x4c7917)[_0xedb8('0x22')](_0x4ae035);};}exports['index']=function(_0x1752bb,_0x1f1156){var _0x592bc7={},_0x4f1ff7={},_0x17f16c={'count':0x0,'rows':[]};var _0x201e8f=_[_0xedb8('0x23')](db[_0xedb8('0x24')][_0xedb8('0x25')],function(_0x5be2d8){return{'name':_0x5be2d8['fieldName'],'type':_0x5be2d8[_0xedb8('0x26')][_0xedb8('0x27')]};});_0x4f1ff7['model']=_[_0xedb8('0x23')](_0x201e8f,_0xedb8('0x21'));_0x4f1ff7[_0xedb8('0x28')]=_[_0xedb8('0x29')](_0x1752bb[_0xedb8('0x28')]);_0x4f1ff7[_0xedb8('0x2a')]=_[_0xedb8('0x2b')](_0x4f1ff7[_0xedb8('0x2c')],_0x4f1ff7[_0xedb8('0x28')]);_0x592bc7['attributes']=_[_0xedb8('0x2b')](_0x4f1ff7['model'],qs['fields'](_0x1752bb['query'][_0xedb8('0x2d')]));_0x592bc7['attributes']=_0x592bc7[_0xedb8('0x2e')][_0xedb8('0x2f')]?_0x592bc7[_0xedb8('0x2e')]:_0x4f1ff7['model'];if(!_0x1752bb[_0xedb8('0x28')][_0xedb8('0x30')]('nolimit')){_0x592bc7['limit']=qs[_0xedb8('0x16')](_0x1752bb[_0xedb8('0x28')]['limit']);_0x592bc7['offset']=qs[_0xedb8('0x18')](_0x1752bb[_0xedb8('0x28')][_0xedb8('0x18')]);}_0x592bc7['order']=qs[_0xedb8('0x31')](_0x1752bb[_0xedb8('0x28')][_0xedb8('0x31')]);_0x592bc7[_0xedb8('0x32')]=qs[_0xedb8('0x2a')](_[_0xedb8('0x33')](_0x1752bb[_0xedb8('0x28')],_0x4f1ff7['filters']),_0x201e8f);if(_0x1752bb[_0xedb8('0x28')][_0xedb8('0x34')]){_0x592bc7[_0xedb8('0x32')]=_[_0xedb8('0x35')](_0x592bc7[_0xedb8('0x32')],{'$or':_[_0xedb8('0x23')](_0x201e8f,function(_0x36b6ca){if(_0x36b6ca[_0xedb8('0x26')]!=='VIRTUAL'){var _0x48c740={};_0x48c740[_0x36b6ca[_0xedb8('0x21')]]={'$like':'%'+_0x1752bb[_0xedb8('0x28')]['filter']+'%'};return _0x48c740;}})});}_0x592bc7=_[_0xedb8('0x35')]({},_0x592bc7,_0x1752bb[_0xedb8('0x36')]);var _0x5bb804={'where':_0x592bc7[_0xedb8('0x32')]};return db[_0xedb8('0x24')][_0xedb8('0x17')](_0x5bb804)[_0xedb8('0x1e')](function(_0xd495aa){_0x17f16c[_0xedb8('0x17')]=_0xd495aa;if(_0x1752bb[_0xedb8('0x28')][_0xedb8('0x37')]){_0x592bc7[_0xedb8('0x38')]=[{'all':!![]}];}return db[_0xedb8('0x24')][_0xedb8('0x39')](_0x592bc7);})[_0xedb8('0x1e')](function(_0x81f118){_0x17f16c[_0xedb8('0x3a')]=_0x81f118;return _0x17f16c;})[_0xedb8('0x1e')](respondWithFilteredResult(_0x1f1156,_0x592bc7))[_0xedb8('0x3b')](handleError(_0x1f1156,null));};exports[_0xedb8('0x3c')]=function(_0x533682,_0x161491){var _0x41448e={'raw':![],'where':{'id':_0x533682[_0xedb8('0x3d')]['id']}},_0xa2cb13={};_0xa2cb13[_0xedb8('0x2c')]=_[_0xedb8('0x29')](db[_0xedb8('0x24')]['rawAttributes']);_0xa2cb13[_0xedb8('0x28')]=_[_0xedb8('0x29')](_0x533682['query']);_0xa2cb13[_0xedb8('0x2a')]=_['intersection'](_0xa2cb13[_0xedb8('0x2c')],_0xa2cb13[_0xedb8('0x28')]);_0x41448e[_0xedb8('0x2e')]=_[_0xedb8('0x2b')](_0xa2cb13[_0xedb8('0x2c')],qs[_0xedb8('0x2d')](_0x533682['query'][_0xedb8('0x2d')]));_0x41448e[_0xedb8('0x2e')]=_0x41448e[_0xedb8('0x2e')]['length']?_0x41448e[_0xedb8('0x2e')]:_0xa2cb13[_0xedb8('0x2c')];if(_0x533682[_0xedb8('0x28')]['includeAll']){_0x41448e['include']=[{'all':!![]}];}_0x41448e=_[_0xedb8('0x35')]({},_0x41448e,_0x533682['options']);return db[_0xedb8('0x24')][_0xedb8('0x3e')](_0x41448e)[_0xedb8('0x1e')](handleEntityNotFound(_0x161491,null))['then'](respondWithResult(_0x161491,null))[_0xedb8('0x3b')](handleError(_0x161491,null));};exports[_0xedb8('0x3f')]=function(_0x4d6d58,_0x299a0b){return db[_0xedb8('0x24')][_0xedb8('0x3f')](_0x4d6d58['body'],{})[_0xedb8('0x1e')](respondWithResult(_0x299a0b,0xc9))[_0xedb8('0x3b')](handleError(_0x299a0b,null));};exports['update']=function(_0x2240c0,_0xd83d2){if(_0x2240c0[_0xedb8('0x40')]['id']){delete _0x2240c0[_0xedb8('0x40')]['id'];}return db[_0xedb8('0x24')]['find']({'where':{'id':_0x2240c0[_0xedb8('0x3d')]['id']}})[_0xedb8('0x1e')](handleEntityNotFound(_0xd83d2,null))[_0xedb8('0x1e')](saveUpdates(_0x2240c0[_0xedb8('0x40')],null))['then'](respondWithResult(_0xd83d2,null))['catch'](handleError(_0xd83d2,null));};exports[_0xedb8('0x41')]=function(_0x560799,_0x1ed0e1){return db[_0xedb8('0x24')]['find']({'where':{'id':_0x560799[_0xedb8('0x3d')]['id']}})['then'](handleEntityNotFound(_0x1ed0e1,null))[_0xedb8('0x1e')](removeEntity(_0x1ed0e1,null))[_0xedb8('0x3b')](handleError(_0x1ed0e1,null));};exports['getConfigurations']=function(_0x22f54d,_0x53da81,_0x2698ed){var _0x4464c4={};var _0x48c9ee={};var _0x39f6a1;var _0x3505ca;return db['FreshsalesAccount'][_0xedb8('0x42')]({'where':{'id':_0x22f54d[_0xedb8('0x3d')]['id']}})[_0xedb8('0x1e')](handleEntityNotFound(_0x53da81,null))['then'](function(_0x4be3e3){if(_0x4be3e3){_0x39f6a1=_0x4be3e3;_0x48c9ee[_0xedb8('0x2c')]=_[_0xedb8('0x29')](db[_0xedb8('0x43')]['rawAttributes']);_0x48c9ee['query']=_[_0xedb8('0x29')](_0x22f54d[_0xedb8('0x28')]);_0x48c9ee[_0xedb8('0x2a')]=_[_0xedb8('0x2b')](_0x48c9ee['model'],_0x48c9ee[_0xedb8('0x28')]);_0x4464c4[_0xedb8('0x2e')]=_[_0xedb8('0x2b')](_0x48c9ee[_0xedb8('0x2c')],qs['fields'](_0x22f54d['query']['fields']));_0x4464c4[_0xedb8('0x2e')]=_0x4464c4[_0xedb8('0x2e')][_0xedb8('0x2f')]?_0x4464c4[_0xedb8('0x2e')]:_0x48c9ee[_0xedb8('0x2c')];_0x4464c4[_0xedb8('0x44')]=qs[_0xedb8('0x31')](_0x22f54d[_0xedb8('0x28')]['sort']);_0x4464c4[_0xedb8('0x32')]=qs[_0xedb8('0x2a')](_[_0xedb8('0x33')](_0x22f54d[_0xedb8('0x28')],_0x48c9ee[_0xedb8('0x2a')]));if(_0x22f54d['query'][_0xedb8('0x34')]){_0x4464c4[_0xedb8('0x32')]=_[_0xedb8('0x35')](_0x4464c4['where'],{'$or':_[_0xedb8('0x23')](_0x4464c4[_0xedb8('0x2e')],function(_0x32947b){var _0x5a28bf={};_0x5a28bf[_0x32947b]={'$like':'%'+_0x22f54d[_0xedb8('0x28')]['filter']+'%'};return _0x5a28bf;})});}_0x4464c4=_['merge']({},_0x4464c4,_0x22f54d[_0xedb8('0x36')]);return _0x39f6a1['getConfigurations'](_0x4464c4);}})[_0xedb8('0x1e')](function(_0x20f0ae){if(_0x20f0ae){_0x3505ca=_0x20f0ae[_0xedb8('0x2f')];if(!_0x22f54d['query']['hasOwnProperty'](_0xedb8('0x45'))){_0x4464c4[_0xedb8('0x16')]=qs[_0xedb8('0x16')](_0x22f54d[_0xedb8('0x28')][_0xedb8('0x16')]);_0x4464c4[_0xedb8('0x18')]=qs[_0xedb8('0x18')](_0x22f54d[_0xedb8('0x28')][_0xedb8('0x18')]);}return _0x39f6a1[_0xedb8('0x46')](_0x4464c4);}})[_0xedb8('0x1e')](function(_0x4b76cf){if(_0x4b76cf){return _0x4b76cf?{'count':_0x3505ca,'rows':_0x4b76cf}:null;}})['then'](respondWithResult(_0x53da81,null))[_0xedb8('0x3b')](handleError(_0x53da81,null));};exports['addConfiguration']=function(_0x561764,_0x40acc5,_0x1b9f65){if(_0x561764[_0xedb8('0x40')]['id']){delete _0x561764['body']['id'];}return db['FreshsalesAccount'][_0xedb8('0x42')]({'where':{'id':_0x561764[_0xedb8('0x3d')]['id']}})['then'](handleEntityNotFound(_0x40acc5,null))[_0xedb8('0x1e')](function(_0x27868){if(_0x27868){_0x561764['body'][_0xedb8('0x47')]=_0x27868['id'];_0x561764['body']['Subjects']=integrations[_0xedb8('0x48')](_0x561764[_0xedb8('0x40')]['channel'],_0x561764['body'][_0xedb8('0x26')]);_0x561764[_0xedb8('0x40')]['Descriptions']=integrations[_0xedb8('0x49')](_0x561764[_0xedb8('0x40')][_0xedb8('0x4a')],_0x561764[_0xedb8('0x40')]['type']);return db[_0xedb8('0x43')]['create'](_0x561764['body'],{'include':[{'model':db[_0xedb8('0x4b')],'as':'Subjects'},{'model':db[_0xedb8('0x4b')],'as':_0xedb8('0x4c')}]});}return null;})[_0xedb8('0x1e')](respondWithResult(_0x40acc5,null))[_0xedb8('0x3b')](handleError(_0x40acc5,null));};exports['getFields']=function(_0xd67ff5,_0x294a54,_0xe61436){var _0x331d58='';var _0x25c433='';return db[_0xedb8('0x24')][_0xedb8('0x42')]({'where':{'id':_0xd67ff5['params']['id']},'attributes':['id',_0xedb8('0x4d'),_0xedb8('0x4e'),'apiKey']})['then'](handleEntityNotFound(_0x294a54,null))[_0xedb8('0x1e')](function(_0x55e335){if(_0x55e335){_0x25c433=_0x55e335[_0xedb8('0x4d')];_0x331d58=_0x55e335[_0xedb8('0x4e')];var _0x58783a=_0x55e335[_0xedb8('0x4e')]['slice'](-0x1);if(_0x58783a==='/'){_0x331d58=_0x331d58[_0xedb8('0x4f')](0x0,_0x331d58[_0xedb8('0x50')](_0x58783a));}return rp({'method':_0xedb8('0x51'),'uri':util[_0xedb8('0x52')](_0xedb8('0x53'),_0x331d58,_0xedb8('0x54')),'headers':{'Authorization':_0xedb8('0x55')+_0x55e335[_0xedb8('0x56')]},'json':!![]});}})[_0xedb8('0x1e')](function(_0x539176){if(_0x539176){var _0x7b1df8=_0x539176[_0xedb8('0x57')];var _0x40857e=![];var _0x20954f=null;for(_0x20954f=0x0;_0x20954f<_0x7b1df8[_0xedb8('0x2f')];_0x20954f++){if(_0x7b1df8[_0x20954f][_0xedb8('0x58')]===_0x25c433){_0x40857e=!![];}}if(_0x40857e){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xedb8('0x59')});}}})[_0xedb8('0x1e')](respondWithResult(_0x294a54,null))[_0xedb8('0x3b')](function(_0x39ac72){var _0x868198=_0xd67ff5['query'][_0xedb8('0x5a')]?0x1f4:_0x39ac72['statusCode']||0x1f4;logger[_0xedb8('0x1f')](_0xedb8('0x5b'),_0xedb8('0x5c'),_0x868198,JSON[_0xedb8('0x5d')](_0x39ac72));delete _0x39ac72[_0xedb8('0x21')];if(_0x868198===0x191){_0x868198=0x190;}_0x294a54[_0xedb8('0x14')](_0x868198)[_0xedb8('0x22')](_0xd67ff5[_0xedb8('0x28')][_0xedb8('0x5a')]?{'message':_0xedb8('0x5e'),'statusCode':_0x39ac72[_0xedb8('0x5f')]}:_0x39ac72);});}; \ No newline at end of file +var _0x0f4c=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','undefined','limit','count','offset','Content-Range','json','apply','save','destroy','then','error','stack','name','send','index','map','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','FreshsalesAccount','includeAll','findAll','show','length','include','find','catch','create','body','params','getConfigurations','findOne','FreshsalesConfiguration','rawAttributes','filter','addConfiguration','Descriptions','getDescriptions','FreshsalesField','Subjects','getFields','username','remoteUri','substring','lastIndexOf','format','%s%s','/api/selector/owners','Token\x20token=','apiKey','users','email','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x42d2e5,_0x1b6eb9){var _0x523153=function(_0x30eabb){while(--_0x30eabb){_0x42d2e5['push'](_0x42d2e5['shift']());}};_0x523153(++_0x1b6eb9);}(_0x0f4c,0x17e));var _0xc0f4=function(_0x5c2a2b,_0x22c94e){_0x5c2a2b=_0x5c2a2b-0x0;var _0x19921f=_0x0f4c[_0x5c2a2b];return _0x19921f;};'use strict';var emlformat=require(_0xc0f4('0x0'));var rimraf=require(_0xc0f4('0x1'));var zipdir=require(_0xc0f4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc0f4('0x3'));var Mustache=require(_0xc0f4('0x4'));var util=require('util');var path=require(_0xc0f4('0x5'));var sox=require(_0xc0f4('0x6'));var csv=require(_0xc0f4('0x7'));var ejs=require(_0xc0f4('0x8'));var fs=require('fs');var fs_extra=require(_0xc0f4('0x9'));var _=require('lodash');var squel=require(_0xc0f4('0xa'));var crypto=require(_0xc0f4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xc0f4('0xc'));var toCsv=require(_0xc0f4('0x7'));var querystring=require(_0xc0f4('0xd'));var Papa=require(_0xc0f4('0xe'));var Redis=require(_0xc0f4('0xf'));var authService=require(_0xc0f4('0x10'));var qs=require(_0xc0f4('0x11'));var as=require(_0xc0f4('0x12'));var hardwareService=require(_0xc0f4('0x13'));var logger=require('../../config/logger')(_0xc0f4('0x14'));var utils=require(_0xc0f4('0x15'));var config=require(_0xc0f4('0x16'));var licenseUtil=require(_0xc0f4('0x17'));var db=require(_0xc0f4('0x18'))['db'];var integrations=require(_0xc0f4('0x19'));function respondWithStatusCode(_0x4c2683,_0x118091){_0x118091=_0x118091||0xcc;return function(_0x38c48c){if(_0x38c48c){return _0x4c2683[_0xc0f4('0x1a')](_0x118091);}return _0x4c2683[_0xc0f4('0x1b')](_0x118091)['end']();};}function respondWithResult(_0x145328,_0x2138ff){_0x2138ff=_0x2138ff||0xc8;return function(_0x39c663){if(_0x39c663){return _0x145328[_0xc0f4('0x1b')](_0x2138ff)['json'](_0x39c663);}};}function respondWithFilteredResult(_0xa7b1f0,_0x47c1e4){return function(_0x3b9e85){if(_0x3b9e85){var _0x54ae36=typeof _0x47c1e4['offset']===_0xc0f4('0x1c')&&typeof _0x47c1e4[_0xc0f4('0x1d')]===_0xc0f4('0x1c');var _0x3f1985=_0x3b9e85[_0xc0f4('0x1e')];var _0x1cfa17=_0x54ae36?0x0:_0x47c1e4[_0xc0f4('0x1f')];var _0x1534cc=_0x54ae36?_0x3b9e85[_0xc0f4('0x1e')]:_0x47c1e4[_0xc0f4('0x1f')]+_0x47c1e4[_0xc0f4('0x1d')];var _0x3d32e6;if(_0x1534cc>=_0x3f1985){_0x1534cc=_0x3f1985;_0x3d32e6=0xc8;}else{_0x3d32e6=0xce;}_0xa7b1f0['status'](_0x3d32e6);return _0xa7b1f0['set'](_0xc0f4('0x20'),_0x1cfa17+'-'+_0x1534cc+'/'+_0x3f1985)[_0xc0f4('0x21')](_0x3b9e85);}return null;};}function patchUpdates(_0x315ed3){return function(_0x1350a7){try{jsonpatch[_0xc0f4('0x22')](_0x1350a7,_0x315ed3,!![]);}catch(_0x1dceec){return BPromise['reject'](_0x1dceec);}return _0x1350a7[_0xc0f4('0x23')]();};}function saveUpdates(_0x4678d2,_0x3f01b0){return function(_0x3ae5ee){if(_0x3ae5ee){return _0x3ae5ee['update'](_0x4678d2)['then'](function(_0x4977c3){return _0x4977c3;});}return null;};}function removeEntity(_0x2b375f,_0x2c2ebc){return function(_0x261d46){if(_0x261d46){return _0x261d46[_0xc0f4('0x24')]()[_0xc0f4('0x25')](function(){_0x2b375f[_0xc0f4('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ab11a,_0x2c6ba2){return function(_0x26a287){if(!_0x26a287){_0x2ab11a[_0xc0f4('0x1a')](0x194);}return _0x26a287;};}function handleError(_0xf5f572,_0x4d56ab){_0x4d56ab=_0x4d56ab||0x1f4;return function(_0x55d6a8){logger[_0xc0f4('0x26')](_0x55d6a8[_0xc0f4('0x27')]);if(_0x55d6a8['name']){delete _0x55d6a8[_0xc0f4('0x28')];}_0xf5f572[_0xc0f4('0x1b')](_0x4d56ab)[_0xc0f4('0x29')](_0x55d6a8);};}exports[_0xc0f4('0x2a')]=function(_0x2129cb,_0x2362fa){var _0x14faf5={},_0x572f5={},_0x3ce563={'count':0x0,'rows':[]};var _0x1fe545=_[_0xc0f4('0x2b')](db['FreshsalesAccount']['rawAttributes'],function(_0x1bcea3){return{'name':_0x1bcea3[_0xc0f4('0x2c')],'type':_0x1bcea3[_0xc0f4('0x2d')][_0xc0f4('0x2e')]};});_0x572f5['model']=_[_0xc0f4('0x2b')](_0x1fe545,_0xc0f4('0x28'));_0x572f5['query']=_[_0xc0f4('0x2f')](_0x2129cb[_0xc0f4('0x30')]);_0x572f5[_0xc0f4('0x31')]=_[_0xc0f4('0x32')](_0x572f5[_0xc0f4('0x33')],_0x572f5[_0xc0f4('0x30')]);_0x14faf5['attributes']=_[_0xc0f4('0x32')](_0x572f5[_0xc0f4('0x33')],qs[_0xc0f4('0x34')](_0x2129cb[_0xc0f4('0x30')][_0xc0f4('0x34')]));_0x14faf5[_0xc0f4('0x35')]=_0x14faf5['attributes']['length']?_0x14faf5[_0xc0f4('0x35')]:_0x572f5[_0xc0f4('0x33')];if(!_0x2129cb['query'][_0xc0f4('0x36')](_0xc0f4('0x37'))){_0x14faf5[_0xc0f4('0x1d')]=qs[_0xc0f4('0x1d')](_0x2129cb[_0xc0f4('0x30')][_0xc0f4('0x1d')]);_0x14faf5[_0xc0f4('0x1f')]=qs[_0xc0f4('0x1f')](_0x2129cb['query'][_0xc0f4('0x1f')]);}_0x14faf5[_0xc0f4('0x38')]=qs[_0xc0f4('0x39')](_0x2129cb[_0xc0f4('0x30')][_0xc0f4('0x39')]);_0x14faf5[_0xc0f4('0x3a')]=qs['filters'](_[_0xc0f4('0x3b')](_0x2129cb['query'],_0x572f5[_0xc0f4('0x31')]),_0x1fe545);if(_0x2129cb['query']['filter']){_0x14faf5[_0xc0f4('0x3a')]=_[_0xc0f4('0x3c')](_0x14faf5[_0xc0f4('0x3a')],{'$or':_['map'](_0x1fe545,function(_0x53f203){if(_0x53f203['type']!==_0xc0f4('0x3d')){var _0x420f32={};_0x420f32[_0x53f203[_0xc0f4('0x28')]]={'$like':'%'+_0x2129cb[_0xc0f4('0x30')]['filter']+'%'};return _0x420f32;}})});}_0x14faf5=_['merge']({},_0x14faf5,_0x2129cb[_0xc0f4('0x3e')]);var _0x2d4bcc={'where':_0x14faf5[_0xc0f4('0x3a')]};return db[_0xc0f4('0x3f')][_0xc0f4('0x1e')](_0x2d4bcc)['then'](function(_0x50c10c){_0x3ce563['count']=_0x50c10c;if(_0x2129cb[_0xc0f4('0x30')][_0xc0f4('0x40')]){_0x14faf5['include']=[{'all':!![]}];}return db[_0xc0f4('0x3f')][_0xc0f4('0x41')](_0x14faf5);})[_0xc0f4('0x25')](function(_0x1d054f){_0x3ce563['rows']=_0x1d054f;return _0x3ce563;})['then'](respondWithFilteredResult(_0x2362fa,_0x14faf5))['catch'](handleError(_0x2362fa,null));};exports[_0xc0f4('0x42')]=function(_0x399eca,_0xec0bab){var _0x247dec={'raw':![],'where':{'id':_0x399eca['params']['id']}},_0x31978a={};_0x31978a['model']=_[_0xc0f4('0x2f')](db['FreshsalesAccount']['rawAttributes']);_0x31978a[_0xc0f4('0x30')]=_[_0xc0f4('0x2f')](_0x399eca[_0xc0f4('0x30')]);_0x31978a[_0xc0f4('0x31')]=_['intersection'](_0x31978a[_0xc0f4('0x33')],_0x31978a[_0xc0f4('0x30')]);_0x247dec[_0xc0f4('0x35')]=_['intersection'](_0x31978a[_0xc0f4('0x33')],qs['fields'](_0x399eca['query'][_0xc0f4('0x34')]));_0x247dec[_0xc0f4('0x35')]=_0x247dec['attributes'][_0xc0f4('0x43')]?_0x247dec[_0xc0f4('0x35')]:_0x31978a[_0xc0f4('0x33')];if(_0x399eca['query'][_0xc0f4('0x40')]){_0x247dec[_0xc0f4('0x44')]=[{'all':!![]}];}_0x247dec=_['merge']({},_0x247dec,_0x399eca[_0xc0f4('0x3e')]);return db[_0xc0f4('0x3f')][_0xc0f4('0x45')](_0x247dec)[_0xc0f4('0x25')](handleEntityNotFound(_0xec0bab,null))['then'](respondWithResult(_0xec0bab,null))[_0xc0f4('0x46')](handleError(_0xec0bab,null));};exports[_0xc0f4('0x47')]=function(_0x5dc47a,_0x841149){return db[_0xc0f4('0x3f')][_0xc0f4('0x47')](_0x5dc47a[_0xc0f4('0x48')],{})[_0xc0f4('0x25')](respondWithResult(_0x841149,0xc9))['catch'](handleError(_0x841149,null));};exports['update']=function(_0x3312a0,_0x22dad6){if(_0x3312a0['body']['id']){delete _0x3312a0['body']['id'];}return db['FreshsalesAccount'][_0xc0f4('0x45')]({'where':{'id':_0x3312a0[_0xc0f4('0x49')]['id']}})[_0xc0f4('0x25')](handleEntityNotFound(_0x22dad6,null))['then'](saveUpdates(_0x3312a0['body'],null))[_0xc0f4('0x25')](respondWithResult(_0x22dad6,null))['catch'](handleError(_0x22dad6,null));};exports[_0xc0f4('0x24')]=function(_0x5a9cf4,_0xafbddf){return db[_0xc0f4('0x3f')][_0xc0f4('0x45')]({'where':{'id':_0x5a9cf4[_0xc0f4('0x49')]['id']}})[_0xc0f4('0x25')](handleEntityNotFound(_0xafbddf,null))[_0xc0f4('0x25')](removeEntity(_0xafbddf,null))['catch'](handleError(_0xafbddf,null));};exports[_0xc0f4('0x4a')]=function(_0x438f41,_0x190180,_0x292a24){var _0x2db5f1={};var _0x55856c={};var _0x4ebbbe;var _0x1cd763;return db[_0xc0f4('0x3f')][_0xc0f4('0x4b')]({'where':{'id':_0x438f41['params']['id']}})[_0xc0f4('0x25')](handleEntityNotFound(_0x190180,null))[_0xc0f4('0x25')](function(_0x26d160){if(_0x26d160){_0x4ebbbe=_0x26d160;_0x55856c[_0xc0f4('0x33')]=_['keys'](db[_0xc0f4('0x4c')][_0xc0f4('0x4d')]);_0x55856c[_0xc0f4('0x30')]=_['keys'](_0x438f41[_0xc0f4('0x30')]);_0x55856c[_0xc0f4('0x31')]=_[_0xc0f4('0x32')](_0x55856c[_0xc0f4('0x33')],_0x55856c['query']);_0x2db5f1[_0xc0f4('0x35')]=_[_0xc0f4('0x32')](_0x55856c[_0xc0f4('0x33')],qs[_0xc0f4('0x34')](_0x438f41[_0xc0f4('0x30')][_0xc0f4('0x34')]));_0x2db5f1[_0xc0f4('0x35')]=_0x2db5f1[_0xc0f4('0x35')][_0xc0f4('0x43')]?_0x2db5f1[_0xc0f4('0x35')]:_0x55856c['model'];_0x2db5f1[_0xc0f4('0x38')]=qs[_0xc0f4('0x39')](_0x438f41['query']['sort']);_0x2db5f1[_0xc0f4('0x3a')]=qs[_0xc0f4('0x31')](_['pick'](_0x438f41[_0xc0f4('0x30')],_0x55856c[_0xc0f4('0x31')]));if(_0x438f41['query'][_0xc0f4('0x4e')]){_0x2db5f1[_0xc0f4('0x3a')]=_[_0xc0f4('0x3c')](_0x2db5f1['where'],{'$or':_[_0xc0f4('0x2b')](_0x2db5f1[_0xc0f4('0x35')],function(_0x42ff18){var _0x468952={};_0x468952[_0x42ff18]={'$like':'%'+_0x438f41[_0xc0f4('0x30')]['filter']+'%'};return _0x468952;})});}_0x2db5f1=_['merge']({},_0x2db5f1,_0x438f41['options']);return _0x4ebbbe[_0xc0f4('0x4a')](_0x2db5f1);}})[_0xc0f4('0x25')](function(_0x5ee044){if(_0x5ee044){_0x1cd763=_0x5ee044['length'];if(!_0x438f41['query'][_0xc0f4('0x36')](_0xc0f4('0x37'))){_0x2db5f1['limit']=qs['limit'](_0x438f41[_0xc0f4('0x30')]['limit']);_0x2db5f1[_0xc0f4('0x1f')]=qs['offset'](_0x438f41[_0xc0f4('0x30')][_0xc0f4('0x1f')]);}return _0x4ebbbe[_0xc0f4('0x4a')](_0x2db5f1);}})[_0xc0f4('0x25')](function(_0x446755){if(_0x446755){return _0x446755?{'count':_0x1cd763,'rows':_0x446755}:null;}})[_0xc0f4('0x25')](respondWithResult(_0x190180,null))[_0xc0f4('0x46')](handleError(_0x190180,null));};exports[_0xc0f4('0x4f')]=function(_0x5b250b,_0x5a5d69,_0x3567f2){if(_0x5b250b[_0xc0f4('0x48')]['id']){delete _0x5b250b['body']['id'];}return db['FreshsalesAccount'][_0xc0f4('0x4b')]({'where':{'id':_0x5b250b[_0xc0f4('0x49')]['id']}})['then'](handleEntityNotFound(_0x5a5d69,null))[_0xc0f4('0x25')](function(_0x411393){if(_0x411393){_0x5b250b['body']['AccountId']=_0x411393['id'];_0x5b250b[_0xc0f4('0x48')]['Subjects']=integrations['getSubjects'](_0x5b250b['body']['channel'],_0x5b250b['body'][_0xc0f4('0x2d')]);_0x5b250b[_0xc0f4('0x48')][_0xc0f4('0x50')]=integrations[_0xc0f4('0x51')](_0x5b250b[_0xc0f4('0x48')]['channel'],_0x5b250b[_0xc0f4('0x48')][_0xc0f4('0x2d')]);return db['FreshsalesConfiguration'][_0xc0f4('0x47')](_0x5b250b[_0xc0f4('0x48')],{'include':[{'model':db[_0xc0f4('0x52')],'as':_0xc0f4('0x53')},{'model':db[_0xc0f4('0x52')],'as':_0xc0f4('0x50')}]});}return null;})['then'](respondWithResult(_0x5a5d69,null))[_0xc0f4('0x46')](handleError(_0x5a5d69,null));};exports[_0xc0f4('0x54')]=function(_0x200dcd,_0x254039,_0x5339b1){var _0x49ddc6='';var _0x71cb93='';return db[_0xc0f4('0x3f')][_0xc0f4('0x4b')]({'where':{'id':_0x200dcd['params']['id']},'attributes':['id',_0xc0f4('0x55'),_0xc0f4('0x56'),'apiKey']})['then'](handleEntityNotFound(_0x254039,null))[_0xc0f4('0x25')](function(_0x400f02){if(_0x400f02){_0x71cb93=_0x400f02[_0xc0f4('0x55')];_0x49ddc6=_0x400f02[_0xc0f4('0x56')];var _0x4f850e=_0x400f02[_0xc0f4('0x56')]['slice'](-0x1);if(_0x4f850e==='/'){_0x49ddc6=_0x49ddc6[_0xc0f4('0x57')](0x0,_0x49ddc6[_0xc0f4('0x58')](_0x4f850e));}return rp({'method':'GET','uri':util[_0xc0f4('0x59')](_0xc0f4('0x5a'),_0x49ddc6,_0xc0f4('0x5b')),'headers':{'Authorization':_0xc0f4('0x5c')+_0x400f02[_0xc0f4('0x5d')]},'json':!![]});}})[_0xc0f4('0x25')](function(_0x444af2){if(_0x444af2){var _0x16bdde=_0x444af2[_0xc0f4('0x5e')];var _0x42ddd7=![];var _0x2466ea=null;for(_0x2466ea=0x0;_0x2466ea<_0x16bdde['length'];_0x2466ea++){if(_0x16bdde[_0x2466ea][_0xc0f4('0x5f')]===_0x71cb93){_0x42ddd7=!![];}}if(_0x42ddd7){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0xc0f4('0x25')](respondWithResult(_0x254039,null))[_0xc0f4('0x46')](function(_0x2f1429){var _0x26b30b=_0x200dcd[_0xc0f4('0x30')]['test']?0x1f4:_0x2f1429[_0xc0f4('0x60')]||0x1f4;logger['error'](_0xc0f4('0x61'),_0xc0f4('0x54'),_0x26b30b,JSON['stringify'](_0x2f1429));delete _0x2f1429['name'];if(_0x26b30b===0x191){_0x26b30b=0x190;}_0x254039[_0xc0f4('0x1b')](_0x26b30b)[_0xc0f4('0x29')](_0x200dcd[_0xc0f4('0x30')][_0xc0f4('0x62')]?{'message':_0xc0f4('0x63'),'statusCode':_0x2f1429['statusCode']}:_0x2f1429);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index c4a8bc6..4a843dc 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 _0x187d=['exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intFreshsalesAccount.attributes'];(function(_0x23e207,_0x34850b){var _0x2e25fa=function(_0x41bf81){while(--_0x41bf81){_0x23e207['push'](_0x23e207['shift']());}};_0x2e25fa(++_0x34850b);}(_0x187d,0x93));var _0xd187=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x187d[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var logger=require(_0xd187('0x1'))(_0xd187('0x2'));var moment=require(_0xd187('0x3'));var BPromise=require(_0xd187('0x4'));var rp=require(_0xd187('0x5'));var fs=require('fs');var path=require(_0xd187('0x6'));var rimraf=require('rimraf');var config=require(_0xd187('0x7'));var attributes=require(_0xd187('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xd187('0x9')]=function(_0x58ee7,_0x444a60){return _0x58ee7[_0xd187('0xa')](_0xd187('0xb'),attributes,{'tableName':_0xd187('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x47c5=['rimraf','./intFreshsalesAccount.attributes','../../components/integrations/configuration','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x2d4230,_0x3cb4d6){var _0x5bbfa5=function(_0x5f5719){while(--_0x5f5719){_0x2d4230['push'](_0x2d4230['shift']());}};_0x5bbfa5(++_0x3cb4d6);}(_0x47c5,0x165));var _0x547c=function(_0x3e88f3,_0x4c7928){_0x3e88f3=_0x3e88f3-0x0;var _0x43b42d=_0x47c5[_0x3e88f3];return _0x43b42d;};'use strict';var _=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var logger=require(_0x547c('0x2'))(_0x547c('0x3'));var moment=require(_0x547c('0x4'));var BPromise=require(_0x547c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x547c('0x6'));var rimraf=require(_0x547c('0x7'));var config=require('../../config/environment');var attributes=require(_0x547c('0x8'));var integrations=require(_0x547c('0x9'));module['exports']=function(_0x2e5b57,_0x439f25){return _0x2e5b57[_0x547c('0xa')](_0x547c('0xb'),attributes,{'tableName':_0x547c('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 ca2b787..d71542d 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 _0x6455=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','findAll','raw','options','attributes','limit','include','map','model','GetFreshsalesAccount','debug','catch','FreshsalesAccount','find','where','ShowFreshsalesAccount','lodash'];(function(_0x14e676,_0x1f4d5b){var _0x414e81=function(_0x2dbbb6){while(--_0x2dbbb6){_0x14e676['push'](_0x14e676['shift']());}};_0x414e81(++_0x1f4d5b);}(_0x6455,0x97));var _0x5645=function(_0x2b9a1c,_0x47f3c9){_0x2b9a1c=_0x2b9a1c-0x0;var _0x2da016=_0x6455[_0x2b9a1c];return _0x2da016;};'use strict';var _=require(_0x5645('0x0'));var util=require('util');var moment=require(_0x5645('0x1'));var BPromise=require(_0x5645('0x2'));var rs=require(_0x5645('0x3'));var fs=require('fs');var Redis=require(_0x5645('0x4'));var db=require(_0x5645('0x5'))['db'];var utils=require(_0x5645('0x6'));var logger=require('../../config/logger')(_0x5645('0x7'));var config=require(_0x5645('0x8'));var jayson=require(_0x5645('0x9'));var client=jayson[_0x5645('0xa')][_0x5645('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x37d672,_0xa14a06,_0x278d86){return new BPromise(function(_0x518a28,_0x5f4037){return client[_0x5645('0xc')](_0x37d672,_0x278d86)[_0x5645('0xd')](function(_0x38c07a){logger[_0x5645('0xe')](_0x5645('0xf'),_0xa14a06,_0x5645('0x10'));logger['debug'](_0x5645('0x11'),_0xa14a06,_0x5645('0x10'),JSON[_0x5645('0x12')](_0x38c07a));if(_0x38c07a[_0x5645('0x13')]){if(_0x38c07a['error'][_0x5645('0x14')]===0x1f4){logger['error'](_0x5645('0xf'),_0xa14a06,_0x38c07a[_0x5645('0x13')][_0x5645('0x15')]);return _0x5f4037(_0x38c07a[_0x5645('0x13')][_0x5645('0x15')]);}logger[_0x5645('0x13')](_0x5645('0xf'),_0xa14a06,_0x38c07a[_0x5645('0x13')]['message']);return _0x518a28(_0x38c07a[_0x5645('0x13')][_0x5645('0x15')]);}else{logger[_0x5645('0xe')]('FreshsalesAccount,\x20%s,\x20%s',_0xa14a06,'request\x20sent');_0x518a28(_0x38c07a[_0x5645('0x16')][_0x5645('0x15')]);}})['catch'](function(_0x35e0c7){logger[_0x5645('0x13')](_0x5645('0xf'),_0xa14a06,_0x35e0c7);_0x5f4037(_0x35e0c7);});});}exports['GetFreshsalesAccount']=function(_0x35bc6f){var _0x1d519d=this;return new Promise(function(_0x22a6cf,_0x102c19){return db['FreshsalesAccount'][_0x5645('0x17')]({'raw':_0x35bc6f['options']?_0x35bc6f['options'][_0x5645('0x18')]===undefined?!![]:![]:!![],'where':_0x35bc6f[_0x5645('0x19')]?_0x35bc6f[_0x5645('0x19')]['where']||null:null,'attributes':_0x35bc6f[_0x5645('0x19')]?_0x35bc6f['options'][_0x5645('0x1a')]||null:null,'limit':_0x35bc6f['options']?_0x35bc6f['options'][_0x5645('0x1b')]||null:null,'include':_0x35bc6f['options']?_0x35bc6f[_0x5645('0x19')][_0x5645('0x1c')]?_['map'](_0x35bc6f[_0x5645('0x19')][_0x5645('0x1c')],function(_0xe83ed7){return{'model':db[_0xe83ed7['model']],'as':_0xe83ed7['as'],'attributes':_0xe83ed7[_0x5645('0x1a')],'include':_0xe83ed7[_0x5645('0x1c')]?_[_0x5645('0x1d')](_0xe83ed7[_0x5645('0x1c')],function(_0x568fd6){return{'model':db[_0x568fd6['model']],'as':_0x568fd6['as'],'attributes':_0x568fd6['attributes'],'include':_0x568fd6['include']?_[_0x5645('0x1d')](_0x568fd6['include'],function(_0x47d097){return{'model':db[_0x47d097[_0x5645('0x1e')]],'as':_0x47d097['as'],'attributes':_0x47d097[_0x5645('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5645('0xd')](function(_0x308991){logger[_0x5645('0xe')](_0x5645('0x1f'),_0x35bc6f);logger[_0x5645('0x20')](_0x5645('0x1f'),_0x35bc6f,JSON[_0x5645('0x12')](_0x308991));_0x22a6cf(_0x308991);})[_0x5645('0x21')](function(_0x1c0aa2){logger[_0x5645('0x13')](_0x5645('0x1f'),_0x1c0aa2[_0x5645('0x15')],_0x35bc6f);_0x102c19(_0x1d519d['error'](0x1f4,_0x1c0aa2[_0x5645('0x15')]));});});};exports['ShowFreshsalesAccount']=function(_0x12aea2){var _0x31c31b=this;return new Promise(function(_0x40f716,_0x43d514){return db[_0x5645('0x22')][_0x5645('0x23')]({'raw':_0x12aea2['options']?_0x12aea2['options'][_0x5645('0x18')]===undefined?!![]:![]:!![],'where':_0x12aea2[_0x5645('0x19')]?_0x12aea2[_0x5645('0x19')][_0x5645('0x24')]||null:null,'attributes':_0x12aea2[_0x5645('0x19')]?_0x12aea2[_0x5645('0x19')][_0x5645('0x1a')]||null:null,'include':_0x12aea2[_0x5645('0x19')]?_0x12aea2[_0x5645('0x19')][_0x5645('0x1c')]?_[_0x5645('0x1d')](_0x12aea2['options']['include'],function(_0xe01db0){return{'model':db[_0xe01db0['model']],'as':_0xe01db0['as'],'attributes':_0xe01db0[_0x5645('0x1a')],'include':_0xe01db0['include']?_[_0x5645('0x1d')](_0xe01db0['include'],function(_0x2e3dfb){return{'model':db[_0x2e3dfb[_0x5645('0x1e')]],'as':_0x2e3dfb['as'],'attributes':_0x2e3dfb[_0x5645('0x1a')],'include':_0x2e3dfb[_0x5645('0x1c')]?_[_0x5645('0x1d')](_0x2e3dfb[_0x5645('0x1c')],function(_0x57fe61){return{'model':db[_0x57fe61[_0x5645('0x1e')]],'as':_0x57fe61['as'],'attributes':_0x57fe61[_0x5645('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5645('0xd')](function(_0x1f6c2f){logger[_0x5645('0xe')](_0x5645('0x25'),_0x12aea2);logger[_0x5645('0x20')](_0x5645('0x25'),_0x12aea2,JSON['stringify'](_0x1f6c2f));_0x40f716(_0x1f6c2f);})[_0x5645('0x21')](function(_0x48844f){logger[_0x5645('0x13')](_0x5645('0x25'),_0x48844f[_0x5645('0x15')],_0x12aea2);_0x43d514(_0x31c31b[_0x5645('0x13')](0x1f4,_0x48844f[_0x5645('0x15')]));});});}; \ No newline at end of file +var _0xe5af=['ShowFreshsalesAccount','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','where','attributes','include','model','map','find','raw','debug'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0xe5af,0x9c));var _0xfe5a=function(_0x870bc6,_0x400eef){_0x870bc6=_0x870bc6-0x0;var _0x5367fc=_0xe5af[_0x870bc6];return _0x5367fc;};'use strict';var _=require('lodash');var util=require(_0xfe5a('0x0'));var moment=require(_0xfe5a('0x1'));var BPromise=require('bluebird');var rs=require(_0xfe5a('0x2'));var fs=require('fs');var Redis=require(_0xfe5a('0x3'));var db=require(_0xfe5a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfe5a('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfe5a('0x6'));var client=jayson[_0xfe5a('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5eea2e,_0x356c69,_0x106492){return new BPromise(function(_0xfb4357,_0x3e683c){return client['request'](_0x5eea2e,_0x106492)[_0xfe5a('0x8')](function(_0x5a48ff){logger['info'](_0xfe5a('0x9'),_0x356c69,_0xfe5a('0xa'));logger['debug'](_0xfe5a('0xb'),_0x356c69,_0xfe5a('0xa'),JSON[_0xfe5a('0xc')](_0x5a48ff));if(_0x5a48ff[_0xfe5a('0xd')]){if(_0x5a48ff[_0xfe5a('0xd')]['code']===0x1f4){logger[_0xfe5a('0xd')](_0xfe5a('0x9'),_0x356c69,_0x5a48ff[_0xfe5a('0xd')][_0xfe5a('0xe')]);return _0x3e683c(_0x5a48ff[_0xfe5a('0xd')]['message']);}logger[_0xfe5a('0xd')](_0xfe5a('0x9'),_0x356c69,_0x5a48ff[_0xfe5a('0xd')][_0xfe5a('0xe')]);return _0xfb4357(_0x5a48ff[_0xfe5a('0xd')][_0xfe5a('0xe')]);}else{logger[_0xfe5a('0xf')](_0xfe5a('0x9'),_0x356c69,_0xfe5a('0xa'));_0xfb4357(_0x5a48ff[_0xfe5a('0x10')][_0xfe5a('0xe')]);}})[_0xfe5a('0x11')](function(_0x22afa7){logger[_0xfe5a('0xd')](_0xfe5a('0x9'),_0x356c69,_0x22afa7);_0x3e683c(_0x22afa7);});});}exports[_0xfe5a('0x12')]=function(_0x5bf597){var _0x20620b=this;return new Promise(function(_0x456707,_0x54d5fb){return db[_0xfe5a('0x13')][_0xfe5a('0x14')]({'raw':_0x5bf597[_0xfe5a('0x15')]?_0x5bf597['options']['raw']===undefined?!![]:![]:!![],'where':_0x5bf597[_0xfe5a('0x15')]?_0x5bf597[_0xfe5a('0x15')][_0xfe5a('0x16')]||null:null,'attributes':_0x5bf597[_0xfe5a('0x15')]?_0x5bf597[_0xfe5a('0x15')][_0xfe5a('0x17')]||null:null,'limit':_0x5bf597['options']?_0x5bf597[_0xfe5a('0x15')]['limit']||null:null,'include':_0x5bf597[_0xfe5a('0x15')]?_0x5bf597[_0xfe5a('0x15')][_0xfe5a('0x18')]?_['map'](_0x5bf597['options'][_0xfe5a('0x18')],function(_0x3e55fd){return{'model':db[_0x3e55fd['model']],'as':_0x3e55fd['as'],'attributes':_0x3e55fd[_0xfe5a('0x17')],'include':_0x3e55fd[_0xfe5a('0x18')]?_['map'](_0x3e55fd[_0xfe5a('0x18')],function(_0x3a4f3c){return{'model':db[_0x3a4f3c[_0xfe5a('0x19')]],'as':_0x3a4f3c['as'],'attributes':_0x3a4f3c[_0xfe5a('0x17')],'include':_0x3a4f3c['include']?_[_0xfe5a('0x1a')](_0x3a4f3c[_0xfe5a('0x18')],function(_0x24481f){return{'model':db[_0x24481f[_0xfe5a('0x19')]],'as':_0x24481f['as'],'attributes':_0x24481f[_0xfe5a('0x17')]};}):[]};}):[]};}):[]:[]})[_0xfe5a('0x8')](function(_0xdbf1e0){logger[_0xfe5a('0xf')]('GetFreshsalesAccount',_0x5bf597);logger['debug'](_0xfe5a('0x12'),_0x5bf597,JSON['stringify'](_0xdbf1e0));_0x456707(_0xdbf1e0);})[_0xfe5a('0x11')](function(_0xfcb05b){logger[_0xfe5a('0xd')]('GetFreshsalesAccount',_0xfcb05b['message'],_0x5bf597);_0x54d5fb(_0x20620b['error'](0x1f4,_0xfcb05b[_0xfe5a('0xe')]));});});};exports['ShowFreshsalesAccount']=function(_0x51d1f4){var _0x498b64=this;return new Promise(function(_0x3b6e4d,_0x14c66d){return db[_0xfe5a('0x13')][_0xfe5a('0x1b')]({'raw':_0x51d1f4[_0xfe5a('0x15')]?_0x51d1f4[_0xfe5a('0x15')][_0xfe5a('0x1c')]===undefined?!![]:![]:!![],'where':_0x51d1f4[_0xfe5a('0x15')]?_0x51d1f4[_0xfe5a('0x15')][_0xfe5a('0x16')]||null:null,'attributes':_0x51d1f4[_0xfe5a('0x15')]?_0x51d1f4['options'][_0xfe5a('0x17')]||null:null,'include':_0x51d1f4[_0xfe5a('0x15')]?_0x51d1f4['options'][_0xfe5a('0x18')]?_[_0xfe5a('0x1a')](_0x51d1f4[_0xfe5a('0x15')][_0xfe5a('0x18')],function(_0xe5a992){return{'model':db[_0xe5a992['model']],'as':_0xe5a992['as'],'attributes':_0xe5a992['attributes'],'include':_0xe5a992[_0xfe5a('0x18')]?_['map'](_0xe5a992[_0xfe5a('0x18')],function(_0xb31d0){return{'model':db[_0xb31d0[_0xfe5a('0x19')]],'as':_0xb31d0['as'],'attributes':_0xb31d0[_0xfe5a('0x17')],'include':_0xb31d0['include']?_[_0xfe5a('0x1a')](_0xb31d0[_0xfe5a('0x18')],function(_0x2e3a36){return{'model':db[_0x2e3a36['model']],'as':_0x2e3a36['as'],'attributes':_0x2e3a36[_0xfe5a('0x17')]};}):[]};}):[]};}):[]:[]})[_0xfe5a('0x8')](function(_0x4617f0){logger[_0xfe5a('0xf')]('ShowFreshsalesAccount',_0x51d1f4);logger[_0xfe5a('0x1d')]('ShowFreshsalesAccount',_0x51d1f4,JSON[_0xfe5a('0xc')](_0x4617f0));_0x3b6e4d(_0x4617f0);})[_0xfe5a('0x11')](function(_0x576189){logger[_0xfe5a('0xd')](_0xfe5a('0x1e'),_0x576189[_0xfe5a('0xe')],_0x51d1f4);_0x14c66d(_0x498b64[_0xfe5a('0xd')](0x1f4,_0x576189['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 2be30d6..6303fdf 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 _0x7b77=['/:id','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','show','/:id/subjects','getSubjects','/:id/fields','getFields','post','create','put','update','delete'];(function(_0x2ef22d,_0x13ebc8){var _0x5dc1f7=function(_0x506362){while(--_0x506362){_0x2ef22d['push'](_0x2ef22d['shift']());}};_0x5dc1f7(++_0x13ebc8);}(_0x7b77,0xa4));var _0x77b7=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x7b77[_0x47aa64];return _0x549c7a;};'use strict';var multer=require('multer');var util=require(_0x77b7('0x0'));var path=require(_0x77b7('0x1'));var timeout=require(_0x77b7('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x77b7('0x3'));var auth=require(_0x77b7('0x4'));var interaction=require(_0x77b7('0x5'));var config=require(_0x77b7('0x6'));var controller=require(_0x77b7('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x77b7('0x8')]('/:id',auth[_0x77b7('0x9')](),controller[_0x77b7('0xa')]);router[_0x77b7('0x8')](_0x77b7('0xb'),auth['isAuthenticated'](),controller[_0x77b7('0xc')]);router[_0x77b7('0x8')]('/:id/descriptions',auth[_0x77b7('0x9')](),controller['getDescriptions']);router[_0x77b7('0x8')](_0x77b7('0xd'),auth['isAuthenticated'](),controller[_0x77b7('0xe')]);router[_0x77b7('0xf')]('/',auth['isAuthenticated'](),controller[_0x77b7('0x10')]);router[_0x77b7('0x11')]('/:id',auth[_0x77b7('0x9')](),controller[_0x77b7('0x12')]);router[_0x77b7('0x13')](_0x77b7('0x14'),auth[_0x77b7('0x9')](),controller[_0x77b7('0x15')]);module[_0x77b7('0x16')]=router; \ No newline at end of file +var _0x9334=['show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x32056d,_0x4698a4){var _0x4c6dc1=function(_0x1f4374){while(--_0x1f4374){_0x32056d['push'](_0x32056d['shift']());}};_0x4c6dc1(++_0x4698a4);}(_0x9334,0xd9));var _0x4933=function(_0x31452e,_0x1569f0){_0x31452e=_0x31452e-0x0;var _0x378b35=_0x9334[_0x31452e];return _0x378b35;};'use strict';var multer=require(_0x4933('0x0'));var util=require(_0x4933('0x1'));var path=require(_0x4933('0x2'));var timeout=require(_0x4933('0x3'));var express=require('express');var router=express[_0x4933('0x4')]();var fs_extra=require(_0x4933('0x5'));var auth=require(_0x4933('0x6'));var interaction=require(_0x4933('0x7'));var config=require('../../config/environment');var controller=require(_0x4933('0x8'));router[_0x4933('0x9')]('/',auth[_0x4933('0xa')](),controller[_0x4933('0xb')]);router[_0x4933('0x9')](_0x4933('0xc'),auth[_0x4933('0xa')](),controller[_0x4933('0xd')]);router['get'](_0x4933('0xe'),auth[_0x4933('0xa')](),controller[_0x4933('0xf')]);router[_0x4933('0x9')](_0x4933('0x10'),auth['isAuthenticated'](),controller[_0x4933('0x11')]);router['get']('/:id/fields',auth[_0x4933('0xa')](),controller['getFields']);router['post']('/',auth[_0x4933('0xa')](),controller[_0x4933('0x12')]);router[_0x4933('0x13')]('/:id',auth[_0x4933('0xa')](),controller[_0x4933('0x14')]);router['delete']('/:id',auth[_0x4933('0xa')](),controller[_0x4933('0x15')]);module[_0x4933('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index e3ef10b..7a12ace 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 _0x4d15=['STRING','sequelize','exports'];(function(_0x4e5e9a,_0x5d77b2){var _0x1f218f=function(_0x50bdbf){while(--_0x50bdbf){_0x4e5e9a['push'](_0x4e5e9a['shift']());}};_0x1f218f(++_0x5d77b2);}(_0x4d15,0x1cc));var _0x54d1=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x4d15[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0x54d1('0x0'));module[_0x54d1('0x1')]={'name':{'type':Sequelize[_0x54d1('0x2')]},'description':{'type':Sequelize[_0x54d1('0x2')]}}; \ No newline at end of file +var _0x20a6=['STRING','sequelize'];(function(_0x4aabec,_0xf02f7e){var _0xc4ea3=function(_0x352942){while(--_0x352942){_0x4aabec['push'](_0x4aabec['shift']());}};_0xc4ea3(++_0xf02f7e);}(_0x20a6,0xc7));var _0x620a=function(_0x269de8,_0x29d6c1){_0x269de8=_0x269de8-0x0;var _0x3dfcf8=_0x20a6[_0x269de8];return _0x3dfcf8;};'use strict';var Sequelize=require(_0x620a('0x0'));module['exports']={'name':{'type':Sequelize[_0x620a('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index ca14aa5..e80de80 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 _0x6ddf=['intersection','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','map','type','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','FreshsalesConfiguration','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','getSubjects','findOne','FreshsalesField','rawAttributes'];(function(_0x845505,_0x19e5f3){var _0x2513b9=function(_0x10e7af){while(--_0x10e7af){_0x845505['push'](_0x845505['shift']());}};_0x2513b9(++_0x19e5f3);}(_0x6ddf,0x18e));var _0xf6dd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6ddf[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xf6dd('0x0'));var rimraf=require(_0xf6dd('0x1'));var zipdir=require(_0xf6dd('0x2'));var jsonpatch=require(_0xf6dd('0x3'));var rp=require('request-promise');var moment=require(_0xf6dd('0x4'));var BPromise=require(_0xf6dd('0x5'));var Mustache=require('mustache');var util=require(_0xf6dd('0x6'));var path=require('path');var sox=require(_0xf6dd('0x7'));var csv=require(_0xf6dd('0x8'));var ejs=require(_0xf6dd('0x9'));var fs=require('fs');var fs_extra=require(_0xf6dd('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf6dd('0xb'));var deskjs=require(_0xf6dd('0xc'));var toCsv=require(_0xf6dd('0x8'));var querystring=require(_0xf6dd('0xd'));var Papa=require(_0xf6dd('0xe'));var Redis=require(_0xf6dd('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf6dd('0x10'));var as=require(_0xf6dd('0x11'));var hardwareService=require(_0xf6dd('0x12'));var logger=require(_0xf6dd('0x13'))(_0xf6dd('0x14'));var utils=require(_0xf6dd('0x15'));var config=require(_0xf6dd('0x16'));var licenseUtil=require(_0xf6dd('0x17'));var db=require(_0xf6dd('0x18'))['db'];function respondWithStatusCode(_0x464b3f,_0xcbfa3){_0xcbfa3=_0xcbfa3||0xcc;return function(_0x583846){if(_0x583846){return _0x464b3f[_0xf6dd('0x19')](_0xcbfa3);}return _0x464b3f[_0xf6dd('0x1a')](_0xcbfa3)['end']();};}function respondWithResult(_0x5f18d3,_0x45166f){_0x45166f=_0x45166f||0xc8;return function(_0xe2fa72){if(_0xe2fa72){return _0x5f18d3[_0xf6dd('0x1a')](_0x45166f)[_0xf6dd('0x1b')](_0xe2fa72);}};}function respondWithFilteredResult(_0x4684f8,_0xbfcf17){return function(_0x260874){if(_0x260874){var _0x27539e=typeof _0xbfcf17[_0xf6dd('0x1c')]===_0xf6dd('0x1d')&&typeof _0xbfcf17[_0xf6dd('0x1e')]===_0xf6dd('0x1d');var _0x4dd109=_0x260874[_0xf6dd('0x1f')];var _0x40a51a=_0x27539e?0x0:_0xbfcf17[_0xf6dd('0x1c')];var _0xd9bae6=_0x27539e?_0x260874[_0xf6dd('0x1f')]:_0xbfcf17[_0xf6dd('0x1c')]+_0xbfcf17[_0xf6dd('0x1e')];var _0x4a6992;if(_0xd9bae6>=_0x4dd109){_0xd9bae6=_0x4dd109;_0x4a6992=0xc8;}else{_0x4a6992=0xce;}_0x4684f8['status'](_0x4a6992);return _0x4684f8['set'](_0xf6dd('0x20'),_0x40a51a+'-'+_0xd9bae6+'/'+_0x4dd109)[_0xf6dd('0x1b')](_0x260874);}return null;};}function patchUpdates(_0x50dbf7){return function(_0x49cf60){try{jsonpatch[_0xf6dd('0x21')](_0x49cf60,_0x50dbf7,!![]);}catch(_0x546d4d){return BPromise[_0xf6dd('0x22')](_0x546d4d);}return _0x49cf60['save']();};}function saveUpdates(_0x4c76bb,_0x478a61){return function(_0x5d4528){if(_0x5d4528){return _0x5d4528[_0xf6dd('0x23')](_0x4c76bb)[_0xf6dd('0x24')](function(_0x198091){return _0x198091;});}return null;};}function removeEntity(_0x5f11ee,_0x52d944){return function(_0x49a691){if(_0x49a691){return _0x49a691[_0xf6dd('0x25')]()[_0xf6dd('0x24')](function(){_0x5f11ee[_0xf6dd('0x1a')](0xcc)[_0xf6dd('0x26')]();});}};}function handleEntityNotFound(_0x1dda9e,_0x5f5146){return function(_0x3acbba){if(!_0x3acbba){_0x1dda9e[_0xf6dd('0x19')](0x194);}return _0x3acbba;};}function handleError(_0x43f4df,_0x382c57){_0x382c57=_0x382c57||0x1f4;return function(_0x482425){logger[_0xf6dd('0x27')](_0x482425[_0xf6dd('0x28')]);if(_0x482425['name']){delete _0x482425[_0xf6dd('0x29')];}_0x43f4df[_0xf6dd('0x1a')](_0x382c57)['send'](_0x482425);};}exports['index']=function(_0x23c1bc,_0x36e084){var _0x3b3819={},_0x5a8784={},_0x1b3504={'count':0x0,'rows':[]};var _0x8ebf77=_[_0xf6dd('0x2a')](db['FreshsalesConfiguration']['rawAttributes'],function(_0x398ba7){return{'name':_0x398ba7['fieldName'],'type':_0x398ba7[_0xf6dd('0x2b')]['key']};});_0x5a8784[_0xf6dd('0x2c')]=_['map'](_0x8ebf77,_0xf6dd('0x29'));_0x5a8784['query']=_['keys'](_0x23c1bc[_0xf6dd('0x2d')]);_0x5a8784[_0xf6dd('0x2e')]=_['intersection'](_0x5a8784[_0xf6dd('0x2c')],_0x5a8784[_0xf6dd('0x2d')]);_0x3b3819[_0xf6dd('0x2f')]=_['intersection'](_0x5a8784[_0xf6dd('0x2c')],qs['fields'](_0x23c1bc[_0xf6dd('0x2d')][_0xf6dd('0x30')]));_0x3b3819[_0xf6dd('0x2f')]=_0x3b3819['attributes'][_0xf6dd('0x31')]?_0x3b3819['attributes']:_0x5a8784[_0xf6dd('0x2c')];if(!_0x23c1bc[_0xf6dd('0x2d')][_0xf6dd('0x32')](_0xf6dd('0x33'))){_0x3b3819['limit']=qs[_0xf6dd('0x1e')](_0x23c1bc[_0xf6dd('0x2d')][_0xf6dd('0x1e')]);_0x3b3819[_0xf6dd('0x1c')]=qs[_0xf6dd('0x1c')](_0x23c1bc[_0xf6dd('0x2d')][_0xf6dd('0x1c')]);}_0x3b3819[_0xf6dd('0x34')]=qs[_0xf6dd('0x35')](_0x23c1bc[_0xf6dd('0x2d')][_0xf6dd('0x35')]);_0x3b3819['where']=qs['filters'](_[_0xf6dd('0x36')](_0x23c1bc[_0xf6dd('0x2d')],_0x5a8784[_0xf6dd('0x2e')]),_0x8ebf77);if(_0x23c1bc['query'][_0xf6dd('0x37')]){_0x3b3819[_0xf6dd('0x38')]=_['merge'](_0x3b3819[_0xf6dd('0x38')],{'$or':_[_0xf6dd('0x2a')](_0x8ebf77,function(_0x4d7684){if(_0x4d7684[_0xf6dd('0x2b')]!==_0xf6dd('0x39')){var _0x3262b0={};_0x3262b0[_0x4d7684[_0xf6dd('0x29')]]={'$like':'%'+_0x23c1bc[_0xf6dd('0x2d')]['filter']+'%'};return _0x3262b0;}})});}_0x3b3819=_[_0xf6dd('0x3a')]({},_0x3b3819,_0x23c1bc[_0xf6dd('0x3b')]);var _0x31fe13={'where':_0x3b3819[_0xf6dd('0x38')]};return db[_0xf6dd('0x3c')]['count'](_0x31fe13)[_0xf6dd('0x24')](function(_0x5a5d08){_0x1b3504[_0xf6dd('0x1f')]=_0x5a5d08;if(_0x23c1bc[_0xf6dd('0x2d')][_0xf6dd('0x3d')]){_0x3b3819[_0xf6dd('0x3e')]=[{'all':!![]}];}return db[_0xf6dd('0x3c')][_0xf6dd('0x3f')](_0x3b3819);})[_0xf6dd('0x24')](function(_0x10ff15){_0x1b3504[_0xf6dd('0x40')]=_0x10ff15;return _0x1b3504;})[_0xf6dd('0x24')](respondWithFilteredResult(_0x36e084,_0x3b3819))[_0xf6dd('0x41')](handleError(_0x36e084,null));};exports[_0xf6dd('0x42')]=function(_0x2af9f6,_0x39c84c){var _0x3b1596={'raw':![],'where':{'id':_0x2af9f6[_0xf6dd('0x43')]['id']}},_0x5e136a={};_0x5e136a[_0xf6dd('0x2c')]=_['keys'](db['FreshsalesConfiguration']['rawAttributes']);_0x5e136a[_0xf6dd('0x2d')]=_[_0xf6dd('0x44')](_0x2af9f6[_0xf6dd('0x2d')]);_0x5e136a['filters']=_['intersection'](_0x5e136a[_0xf6dd('0x2c')],_0x5e136a['query']);_0x3b1596['attributes']=_['intersection'](_0x5e136a[_0xf6dd('0x2c')],qs[_0xf6dd('0x30')](_0x2af9f6['query'][_0xf6dd('0x30')]));_0x3b1596[_0xf6dd('0x2f')]=_0x3b1596[_0xf6dd('0x2f')][_0xf6dd('0x31')]?_0x3b1596[_0xf6dd('0x2f')]:_0x5e136a[_0xf6dd('0x2c')];if(_0x2af9f6[_0xf6dd('0x2d')][_0xf6dd('0x3d')]){_0x3b1596[_0xf6dd('0x3e')]=[{'all':!![]}];}_0x3b1596=_[_0xf6dd('0x3a')]({},_0x3b1596,_0x2af9f6[_0xf6dd('0x3b')]);return db['FreshsalesConfiguration']['find'](_0x3b1596)[_0xf6dd('0x24')](handleEntityNotFound(_0x39c84c,null))[_0xf6dd('0x24')](respondWithResult(_0x39c84c,null))[_0xf6dd('0x41')](handleError(_0x39c84c,null));};exports[_0xf6dd('0x45')]=function(_0x2d3adf,_0x461eeb){return db['FreshsalesConfiguration'][_0xf6dd('0x45')](_0x2d3adf[_0xf6dd('0x46')],{})[_0xf6dd('0x24')](respondWithResult(_0x461eeb,0xc9))[_0xf6dd('0x41')](handleError(_0x461eeb,null));};exports['update']=function(_0x539133,_0x8a689f){if(_0x539133[_0xf6dd('0x46')]['id']){delete _0x539133[_0xf6dd('0x46')]['id'];}return db[_0xf6dd('0x3c')][_0xf6dd('0x47')]({'where':{'id':_0x539133[_0xf6dd('0x43')]['id']}})['then'](handleEntityNotFound(_0x8a689f,null))[_0xf6dd('0x24')](saveUpdates(_0x539133[_0xf6dd('0x46')],null))[_0xf6dd('0x24')](respondWithResult(_0x8a689f,null))[_0xf6dd('0x41')](handleError(_0x8a689f,null));};exports[_0xf6dd('0x25')]=function(_0x422fce,_0x166226){return db[_0xf6dd('0x3c')]['find']({'where':{'id':_0x422fce[_0xf6dd('0x43')]['id']}})['then'](handleEntityNotFound(_0x166226,null))[_0xf6dd('0x24')](removeEntity(_0x166226,null))['catch'](handleError(_0x166226,null));};exports[_0xf6dd('0x48')]=function(_0x5b84f6,_0x526fea,_0x3ff7db){var _0x143654={};var _0x5d0d73={};var _0x401088;var _0xa3c295;return db['FreshsalesConfiguration'][_0xf6dd('0x49')]({'where':{'id':_0x5b84f6[_0xf6dd('0x43')]['id']}})[_0xf6dd('0x24')](handleEntityNotFound(_0x526fea,null))[_0xf6dd('0x24')](function(_0x1b6fda){if(_0x1b6fda){_0x401088=_0x1b6fda;_0x5d0d73[_0xf6dd('0x2c')]=_[_0xf6dd('0x44')](db[_0xf6dd('0x4a')][_0xf6dd('0x4b')]);_0x5d0d73[_0xf6dd('0x2d')]=_[_0xf6dd('0x44')](_0x5b84f6[_0xf6dd('0x2d')]);_0x5d0d73[_0xf6dd('0x2e')]=_[_0xf6dd('0x4c')](_0x5d0d73[_0xf6dd('0x2c')],_0x5d0d73[_0xf6dd('0x2d')]);_0x143654[_0xf6dd('0x2f')]=_[_0xf6dd('0x4c')](_0x5d0d73[_0xf6dd('0x2c')],qs[_0xf6dd('0x30')](_0x5b84f6['query'][_0xf6dd('0x30')]));_0x143654[_0xf6dd('0x2f')]=_0x143654['attributes'][_0xf6dd('0x31')]?_0x143654[_0xf6dd('0x2f')]:_0x5d0d73['model'];_0x143654[_0xf6dd('0x34')]=qs[_0xf6dd('0x35')](_0x5b84f6['query'][_0xf6dd('0x35')]);_0x143654['where']=qs[_0xf6dd('0x2e')](_[_0xf6dd('0x36')](_0x5b84f6['query'],_0x5d0d73[_0xf6dd('0x2e')]));if(_0x5b84f6['query'][_0xf6dd('0x37')]){_0x143654[_0xf6dd('0x38')]=_[_0xf6dd('0x3a')](_0x143654['where'],{'$or':_[_0xf6dd('0x2a')](_0x143654[_0xf6dd('0x2f')],function(_0x520d68){var _0x6601d8={};_0x6601d8[_0x520d68]={'$like':'%'+_0x5b84f6['query']['filter']+'%'};return _0x6601d8;})});}_0x143654=_[_0xf6dd('0x3a')]({},_0x143654,_0x5b84f6[_0xf6dd('0x3b')]);return _0x401088['getSubjects'](_0x143654);}})[_0xf6dd('0x24')](function(_0x5580aa){if(_0x5580aa){_0xa3c295=_0x5580aa[_0xf6dd('0x31')];if(!_0x5b84f6[_0xf6dd('0x2d')][_0xf6dd('0x32')](_0xf6dd('0x33'))){_0x143654[_0xf6dd('0x1e')]=qs[_0xf6dd('0x1e')](_0x5b84f6[_0xf6dd('0x2d')][_0xf6dd('0x1e')]);_0x143654[_0xf6dd('0x1c')]=qs[_0xf6dd('0x1c')](_0x5b84f6['query']['offset']);}return _0x401088['getSubjects'](_0x143654);}})[_0xf6dd('0x24')](function(_0xbcd76c){if(_0xbcd76c){return _0xbcd76c?{'count':_0xa3c295,'rows':_0xbcd76c}:null;}})[_0xf6dd('0x24')](respondWithResult(_0x526fea,null))['catch'](handleError(_0x526fea,null));};exports[_0xf6dd('0x4d')]=function(_0x5dfbd7,_0x4c8682,_0x489dae){var _0x2591ef={};var _0x285aa3={};var _0x218a95;var _0x294695;return db[_0xf6dd('0x3c')]['findOne']({'where':{'id':_0x5dfbd7[_0xf6dd('0x43')]['id']}})['then'](handleEntityNotFound(_0x4c8682,null))[_0xf6dd('0x24')](function(_0x49cb78){if(_0x49cb78){_0x218a95=_0x49cb78;_0x285aa3[_0xf6dd('0x2c')]=_[_0xf6dd('0x44')](db[_0xf6dd('0x4a')][_0xf6dd('0x4b')]);_0x285aa3[_0xf6dd('0x2d')]=_[_0xf6dd('0x44')](_0x5dfbd7[_0xf6dd('0x2d')]);_0x285aa3[_0xf6dd('0x2e')]=_['intersection'](_0x285aa3[_0xf6dd('0x2c')],_0x285aa3[_0xf6dd('0x2d')]);_0x2591ef[_0xf6dd('0x2f')]=_[_0xf6dd('0x4c')](_0x285aa3['model'],qs[_0xf6dd('0x30')](_0x5dfbd7[_0xf6dd('0x2d')]['fields']));_0x2591ef[_0xf6dd('0x2f')]=_0x2591ef[_0xf6dd('0x2f')][_0xf6dd('0x31')]?_0x2591ef['attributes']:_0x285aa3[_0xf6dd('0x2c')];_0x2591ef[_0xf6dd('0x34')]=qs[_0xf6dd('0x35')](_0x5dfbd7[_0xf6dd('0x2d')][_0xf6dd('0x35')]);_0x2591ef[_0xf6dd('0x38')]=qs[_0xf6dd('0x2e')](_[_0xf6dd('0x36')](_0x5dfbd7[_0xf6dd('0x2d')],_0x285aa3[_0xf6dd('0x2e')]));if(_0x5dfbd7['query'][_0xf6dd('0x37')]){_0x2591ef['where']=_['merge'](_0x2591ef[_0xf6dd('0x38')],{'$or':_[_0xf6dd('0x2a')](_0x2591ef[_0xf6dd('0x2f')],function(_0x258b42){var _0x3b3ab5={};_0x3b3ab5[_0x258b42]={'$like':'%'+_0x5dfbd7['query'][_0xf6dd('0x37')]+'%'};return _0x3b3ab5;})});}_0x2591ef=_[_0xf6dd('0x3a')]({},_0x2591ef,_0x5dfbd7[_0xf6dd('0x3b')]);return _0x218a95['getDescriptions'](_0x2591ef);}})[_0xf6dd('0x24')](function(_0x3b240c){if(_0x3b240c){_0x294695=_0x3b240c[_0xf6dd('0x31')];if(!_0x5dfbd7[_0xf6dd('0x2d')][_0xf6dd('0x32')](_0xf6dd('0x33'))){_0x2591ef[_0xf6dd('0x1e')]=qs['limit'](_0x5dfbd7[_0xf6dd('0x2d')][_0xf6dd('0x1e')]);_0x2591ef[_0xf6dd('0x1c')]=qs[_0xf6dd('0x1c')](_0x5dfbd7[_0xf6dd('0x2d')][_0xf6dd('0x1c')]);}return _0x218a95['getDescriptions'](_0x2591ef);}})['then'](function(_0x3888dd){if(_0x3888dd){return _0x3888dd?{'count':_0x294695,'rows':_0x3888dd}:null;}})[_0xf6dd('0x24')](respondWithResult(_0x4c8682,null))[_0xf6dd('0x41')](handleError(_0x4c8682,null));};exports[_0xf6dd('0x4e')]=function(_0x48b208,_0x2ce0ba,_0x30cc5d){var _0x30dd89={};var _0x50fe35={};var _0x4518d1;var _0xc5b156;return db[_0xf6dd('0x3c')][_0xf6dd('0x49')]({'where':{'id':_0x48b208['params']['id']}})[_0xf6dd('0x24')](handleEntityNotFound(_0x2ce0ba,null))[_0xf6dd('0x24')](function(_0x516b35){if(_0x516b35){_0x4518d1=_0x516b35;_0x50fe35[_0xf6dd('0x2c')]=_[_0xf6dd('0x44')](db[_0xf6dd('0x4a')]['rawAttributes']);_0x50fe35[_0xf6dd('0x2d')]=_[_0xf6dd('0x44')](_0x48b208['query']);_0x50fe35[_0xf6dd('0x2e')]=_[_0xf6dd('0x4c')](_0x50fe35[_0xf6dd('0x2c')],_0x50fe35[_0xf6dd('0x2d')]);_0x30dd89[_0xf6dd('0x2f')]=_[_0xf6dd('0x4c')](_0x50fe35[_0xf6dd('0x2c')],qs['fields'](_0x48b208[_0xf6dd('0x2d')][_0xf6dd('0x30')]));_0x30dd89[_0xf6dd('0x2f')]=_0x30dd89[_0xf6dd('0x2f')][_0xf6dd('0x31')]?_0x30dd89[_0xf6dd('0x2f')]:_0x50fe35['model'];_0x30dd89[_0xf6dd('0x34')]=qs[_0xf6dd('0x35')](_0x48b208[_0xf6dd('0x2d')]['sort']);_0x30dd89['where']=qs[_0xf6dd('0x2e')](_[_0xf6dd('0x36')](_0x48b208['query'],_0x50fe35[_0xf6dd('0x2e')]));if(_0x48b208['query'][_0xf6dd('0x37')]){_0x30dd89['where']=_[_0xf6dd('0x3a')](_0x30dd89[_0xf6dd('0x38')],{'$or':_[_0xf6dd('0x2a')](_0x30dd89['attributes'],function(_0x11708a){var _0x97ed77={};_0x97ed77[_0x11708a]={'$like':'%'+_0x48b208['query'][_0xf6dd('0x37')]+'%'};return _0x97ed77;})});}_0x30dd89=_[_0xf6dd('0x3a')]({},_0x30dd89,_0x48b208[_0xf6dd('0x3b')]);return _0x4518d1['getFields'](_0x30dd89);}})[_0xf6dd('0x24')](function(_0x5d7a45){if(_0x5d7a45){_0xc5b156=_0x5d7a45[_0xf6dd('0x31')];if(!_0x48b208['query']['hasOwnProperty'](_0xf6dd('0x33'))){_0x30dd89['limit']=qs[_0xf6dd('0x1e')](_0x48b208[_0xf6dd('0x2d')][_0xf6dd('0x1e')]);_0x30dd89[_0xf6dd('0x1c')]=qs[_0xf6dd('0x1c')](_0x48b208[_0xf6dd('0x2d')][_0xf6dd('0x1c')]);}return _0x4518d1[_0xf6dd('0x4e')](_0x30dd89);}})[_0xf6dd('0x24')](function(_0x479613){if(_0x479613){return _0x479613?{'count':_0xc5b156,'rows':_0x479613}:null;}})['then'](respondWithResult(_0x2ce0ba,null))[_0xf6dd('0x41')](handleError(_0x2ce0ba,null));}; \ No newline at end of file +var _0x6621=['length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','findAll','rawAttributes','includeAll','include','find','catch','create','body','params','getSubjects','findOne','FreshsalesField','getDescriptions','getFields','eml-format','rimraf','bluebird','mustache','util','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','limit','offset','count','set','Content-Range','reject','save','update','then','destroy','stack','name','index','FreshsalesConfiguration','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields'];(function(_0x2e6ab0,_0x255758){var _0x46348d=function(_0x505ed7){while(--_0x505ed7){_0x2e6ab0['push'](_0x2e6ab0['shift']());}};_0x46348d(++_0x255758);}(_0x6621,0x1d5));var _0x1662=function(_0x158b54,_0xc7a51b){_0x158b54=_0x158b54-0x0;var _0x5d0e54=_0x6621[_0x158b54];return _0x5d0e54;};'use strict';var emlformat=require(_0x1662('0x0'));var rimraf=require(_0x1662('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1662('0x2'));var Mustache=require(_0x1662('0x3'));var util=require(_0x1662('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x1662('0x5'));var ejs=require(_0x1662('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1662('0x7'));var crypto=require(_0x1662('0x8'));var jsforce=require(_0x1662('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x1662('0x5'));var querystring=require(_0x1662('0xa'));var Papa=require(_0x1662('0xb'));var Redis=require(_0x1662('0xc'));var authService=require(_0x1662('0xd'));var qs=require(_0x1662('0xe'));var as=require(_0x1662('0xf'));var hardwareService=require(_0x1662('0x10'));var logger=require(_0x1662('0x11'))(_0x1662('0x12'));var utils=require(_0x1662('0x13'));var config=require(_0x1662('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ade1b,_0x134d3f){_0x134d3f=_0x134d3f||0xcc;return function(_0x167252){if(_0x167252){return _0x2ade1b[_0x1662('0x15')](_0x134d3f);}return _0x2ade1b['status'](_0x134d3f)[_0x1662('0x16')]();};}function respondWithResult(_0x534b01,_0x103d39){_0x103d39=_0x103d39||0xc8;return function(_0x1cec2b){if(_0x1cec2b){return _0x534b01[_0x1662('0x17')](_0x103d39)[_0x1662('0x18')](_0x1cec2b);}};}function respondWithFilteredResult(_0x100c4e,_0x531535){return function(_0x369f05){if(_0x369f05){var _0x358758=typeof _0x531535['offset']==='undefined'&&typeof _0x531535[_0x1662('0x19')]==='undefined';var _0x4bf0b8=_0x369f05['count'];var _0x4174e0=_0x358758?0x0:_0x531535[_0x1662('0x1a')];var _0x24adc4=_0x358758?_0x369f05[_0x1662('0x1b')]:_0x531535[_0x1662('0x1a')]+_0x531535[_0x1662('0x19')];var _0x144109;if(_0x24adc4>=_0x4bf0b8){_0x24adc4=_0x4bf0b8;_0x144109=0xc8;}else{_0x144109=0xce;}_0x100c4e[_0x1662('0x17')](_0x144109);return _0x100c4e[_0x1662('0x1c')](_0x1662('0x1d'),_0x4174e0+'-'+_0x24adc4+'/'+_0x4bf0b8)[_0x1662('0x18')](_0x369f05);}return null;};}function patchUpdates(_0x51541f){return function(_0xa1c3d7){try{jsonpatch['apply'](_0xa1c3d7,_0x51541f,!![]);}catch(_0x29bfa8){return BPromise[_0x1662('0x1e')](_0x29bfa8);}return _0xa1c3d7[_0x1662('0x1f')]();};}function saveUpdates(_0x596ea2,_0x2088b8){return function(_0x454076){if(_0x454076){return _0x454076[_0x1662('0x20')](_0x596ea2)[_0x1662('0x21')](function(_0x31167c){return _0x31167c;});}return null;};}function removeEntity(_0x491d35,_0x5bc309){return function(_0xd86fcd){if(_0xd86fcd){return _0xd86fcd[_0x1662('0x22')]()[_0x1662('0x21')](function(){_0x491d35[_0x1662('0x17')](0xcc)[_0x1662('0x16')]();});}};}function handleEntityNotFound(_0x9a9901,_0x4227ae){return function(_0x6a4a3f){if(!_0x6a4a3f){_0x9a9901[_0x1662('0x15')](0x194);}return _0x6a4a3f;};}function handleError(_0x2f61da,_0x3c22c7){_0x3c22c7=_0x3c22c7||0x1f4;return function(_0x4b2a09){logger['error'](_0x4b2a09[_0x1662('0x23')]);if(_0x4b2a09[_0x1662('0x24')]){delete _0x4b2a09[_0x1662('0x24')];}_0x2f61da[_0x1662('0x17')](_0x3c22c7)['send'](_0x4b2a09);};}exports[_0x1662('0x25')]=function(_0xf10be3,_0x59b847){var _0x2ebbf6={},_0xb245c6={},_0x28148a={'count':0x0,'rows':[]};var _0x21510c=_['map'](db[_0x1662('0x26')]['rawAttributes'],function(_0x1dbb44){return{'name':_0x1dbb44[_0x1662('0x27')],'type':_0x1dbb44[_0x1662('0x28')]['key']};});_0xb245c6[_0x1662('0x29')]=_[_0x1662('0x2a')](_0x21510c,_0x1662('0x24'));_0xb245c6[_0x1662('0x2b')]=_[_0x1662('0x2c')](_0xf10be3[_0x1662('0x2b')]);_0xb245c6[_0x1662('0x2d')]=_[_0x1662('0x2e')](_0xb245c6['model'],_0xb245c6[_0x1662('0x2b')]);_0x2ebbf6[_0x1662('0x2f')]=_['intersection'](_0xb245c6[_0x1662('0x29')],qs[_0x1662('0x30')](_0xf10be3['query'][_0x1662('0x30')]));_0x2ebbf6[_0x1662('0x2f')]=_0x2ebbf6['attributes'][_0x1662('0x31')]?_0x2ebbf6[_0x1662('0x2f')]:_0xb245c6[_0x1662('0x29')];if(!_0xf10be3['query'][_0x1662('0x32')](_0x1662('0x33'))){_0x2ebbf6[_0x1662('0x19')]=qs['limit'](_0xf10be3[_0x1662('0x2b')][_0x1662('0x19')]);_0x2ebbf6['offset']=qs['offset'](_0xf10be3['query']['offset']);}_0x2ebbf6[_0x1662('0x34')]=qs[_0x1662('0x35')](_0xf10be3[_0x1662('0x2b')][_0x1662('0x35')]);_0x2ebbf6['where']=qs[_0x1662('0x2d')](_[_0x1662('0x36')](_0xf10be3['query'],_0xb245c6['filters']),_0x21510c);if(_0xf10be3[_0x1662('0x2b')][_0x1662('0x37')]){_0x2ebbf6[_0x1662('0x38')]=_[_0x1662('0x39')](_0x2ebbf6['where'],{'$or':_[_0x1662('0x2a')](_0x21510c,function(_0x1c464a){if(_0x1c464a[_0x1662('0x28')]!==_0x1662('0x3a')){var _0x892a5c={};_0x892a5c[_0x1c464a['name']]={'$like':'%'+_0xf10be3[_0x1662('0x2b')]['filter']+'%'};return _0x892a5c;}})});}_0x2ebbf6=_[_0x1662('0x39')]({},_0x2ebbf6,_0xf10be3[_0x1662('0x3b')]);var _0x3fd2a4={'where':_0x2ebbf6[_0x1662('0x38')]};return db[_0x1662('0x26')][_0x1662('0x1b')](_0x3fd2a4)[_0x1662('0x21')](function(_0x592eda){_0x28148a[_0x1662('0x1b')]=_0x592eda;if(_0xf10be3['query']['includeAll']){_0x2ebbf6['include']=[{'all':!![]}];}return db[_0x1662('0x26')][_0x1662('0x3c')](_0x2ebbf6);})[_0x1662('0x21')](function(_0x455fdf){_0x28148a['rows']=_0x455fdf;return _0x28148a;})['then'](respondWithFilteredResult(_0x59b847,_0x2ebbf6))['catch'](handleError(_0x59b847,null));};exports['show']=function(_0x4102d2,_0x4c9b93){var _0x4b5abc={'raw':![],'where':{'id':_0x4102d2['params']['id']}},_0x218c36={};_0x218c36[_0x1662('0x29')]=_['keys'](db[_0x1662('0x26')][_0x1662('0x3d')]);_0x218c36[_0x1662('0x2b')]=_[_0x1662('0x2c')](_0x4102d2['query']);_0x218c36['filters']=_['intersection'](_0x218c36[_0x1662('0x29')],_0x218c36[_0x1662('0x2b')]);_0x4b5abc[_0x1662('0x2f')]=_['intersection'](_0x218c36[_0x1662('0x29')],qs['fields'](_0x4102d2[_0x1662('0x2b')][_0x1662('0x30')]));_0x4b5abc[_0x1662('0x2f')]=_0x4b5abc[_0x1662('0x2f')][_0x1662('0x31')]?_0x4b5abc[_0x1662('0x2f')]:_0x218c36[_0x1662('0x29')];if(_0x4102d2[_0x1662('0x2b')][_0x1662('0x3e')]){_0x4b5abc[_0x1662('0x3f')]=[{'all':!![]}];}_0x4b5abc=_[_0x1662('0x39')]({},_0x4b5abc,_0x4102d2[_0x1662('0x3b')]);return db['FreshsalesConfiguration'][_0x1662('0x40')](_0x4b5abc)['then'](handleEntityNotFound(_0x4c9b93,null))[_0x1662('0x21')](respondWithResult(_0x4c9b93,null))[_0x1662('0x41')](handleError(_0x4c9b93,null));};exports[_0x1662('0x42')]=function(_0x444d1c,_0xd638f1){return db[_0x1662('0x26')][_0x1662('0x42')](_0x444d1c[_0x1662('0x43')],{})[_0x1662('0x21')](respondWithResult(_0xd638f1,0xc9))[_0x1662('0x41')](handleError(_0xd638f1,null));};exports[_0x1662('0x20')]=function(_0x2475b8,_0x2c627c){if(_0x2475b8[_0x1662('0x43')]['id']){delete _0x2475b8[_0x1662('0x43')]['id'];}return db[_0x1662('0x26')]['find']({'where':{'id':_0x2475b8[_0x1662('0x44')]['id']}})[_0x1662('0x21')](handleEntityNotFound(_0x2c627c,null))[_0x1662('0x21')](saveUpdates(_0x2475b8[_0x1662('0x43')],null))[_0x1662('0x21')](respondWithResult(_0x2c627c,null))['catch'](handleError(_0x2c627c,null));};exports[_0x1662('0x22')]=function(_0x2dd0bc,_0x36a39e){return db[_0x1662('0x26')]['find']({'where':{'id':_0x2dd0bc[_0x1662('0x44')]['id']}})['then'](handleEntityNotFound(_0x36a39e,null))[_0x1662('0x21')](removeEntity(_0x36a39e,null))[_0x1662('0x41')](handleError(_0x36a39e,null));};exports[_0x1662('0x45')]=function(_0xa4708,_0x24a3c5,_0x9a72bd){var _0x2b7f78={};var _0x294748={};var _0x1cfeac;var _0x290a6b;return db[_0x1662('0x26')][_0x1662('0x46')]({'where':{'id':_0xa4708[_0x1662('0x44')]['id']}})['then'](handleEntityNotFound(_0x24a3c5,null))[_0x1662('0x21')](function(_0x16d344){if(_0x16d344){_0x1cfeac=_0x16d344;_0x294748['model']=_[_0x1662('0x2c')](db[_0x1662('0x47')]['rawAttributes']);_0x294748[_0x1662('0x2b')]=_[_0x1662('0x2c')](_0xa4708[_0x1662('0x2b')]);_0x294748[_0x1662('0x2d')]=_[_0x1662('0x2e')](_0x294748['model'],_0x294748['query']);_0x2b7f78['attributes']=_[_0x1662('0x2e')](_0x294748[_0x1662('0x29')],qs[_0x1662('0x30')](_0xa4708['query']['fields']));_0x2b7f78[_0x1662('0x2f')]=_0x2b7f78[_0x1662('0x2f')][_0x1662('0x31')]?_0x2b7f78[_0x1662('0x2f')]:_0x294748['model'];_0x2b7f78['order']=qs[_0x1662('0x35')](_0xa4708['query'][_0x1662('0x35')]);_0x2b7f78[_0x1662('0x38')]=qs[_0x1662('0x2d')](_[_0x1662('0x36')](_0xa4708[_0x1662('0x2b')],_0x294748[_0x1662('0x2d')]));if(_0xa4708[_0x1662('0x2b')]['filter']){_0x2b7f78[_0x1662('0x38')]=_[_0x1662('0x39')](_0x2b7f78['where'],{'$or':_[_0x1662('0x2a')](_0x2b7f78[_0x1662('0x2f')],function(_0x4a56be){var _0x30d2aa={};_0x30d2aa[_0x4a56be]={'$like':'%'+_0xa4708[_0x1662('0x2b')][_0x1662('0x37')]+'%'};return _0x30d2aa;})});}_0x2b7f78=_[_0x1662('0x39')]({},_0x2b7f78,_0xa4708[_0x1662('0x3b')]);return _0x1cfeac[_0x1662('0x45')](_0x2b7f78);}})[_0x1662('0x21')](function(_0x1c0500){if(_0x1c0500){_0x290a6b=_0x1c0500[_0x1662('0x31')];if(!_0xa4708[_0x1662('0x2b')][_0x1662('0x32')](_0x1662('0x33'))){_0x2b7f78[_0x1662('0x19')]=qs['limit'](_0xa4708[_0x1662('0x2b')][_0x1662('0x19')]);_0x2b7f78[_0x1662('0x1a')]=qs['offset'](_0xa4708['query']['offset']);}return _0x1cfeac['getSubjects'](_0x2b7f78);}})[_0x1662('0x21')](function(_0x3cb47e){if(_0x3cb47e){return _0x3cb47e?{'count':_0x290a6b,'rows':_0x3cb47e}:null;}})[_0x1662('0x21')](respondWithResult(_0x24a3c5,null))[_0x1662('0x41')](handleError(_0x24a3c5,null));};exports[_0x1662('0x48')]=function(_0x5f2b73,_0x5b29b1,_0x30bac8){var _0x25e284={};var _0x572fce={};var _0x4cf5fa;var _0x4c2776;return db[_0x1662('0x26')][_0x1662('0x46')]({'where':{'id':_0x5f2b73[_0x1662('0x44')]['id']}})[_0x1662('0x21')](handleEntityNotFound(_0x5b29b1,null))[_0x1662('0x21')](function(_0x18301a){if(_0x18301a){_0x4cf5fa=_0x18301a;_0x572fce[_0x1662('0x29')]=_[_0x1662('0x2c')](db[_0x1662('0x47')][_0x1662('0x3d')]);_0x572fce['query']=_['keys'](_0x5f2b73['query']);_0x572fce['filters']=_[_0x1662('0x2e')](_0x572fce[_0x1662('0x29')],_0x572fce[_0x1662('0x2b')]);_0x25e284[_0x1662('0x2f')]=_[_0x1662('0x2e')](_0x572fce[_0x1662('0x29')],qs[_0x1662('0x30')](_0x5f2b73[_0x1662('0x2b')][_0x1662('0x30')]));_0x25e284[_0x1662('0x2f')]=_0x25e284[_0x1662('0x2f')][_0x1662('0x31')]?_0x25e284[_0x1662('0x2f')]:_0x572fce['model'];_0x25e284[_0x1662('0x34')]=qs[_0x1662('0x35')](_0x5f2b73[_0x1662('0x2b')][_0x1662('0x35')]);_0x25e284[_0x1662('0x38')]=qs['filters'](_[_0x1662('0x36')](_0x5f2b73[_0x1662('0x2b')],_0x572fce['filters']));if(_0x5f2b73['query'][_0x1662('0x37')]){_0x25e284[_0x1662('0x38')]=_[_0x1662('0x39')](_0x25e284[_0x1662('0x38')],{'$or':_['map'](_0x25e284[_0x1662('0x2f')],function(_0x5bd63e){var _0x5cb7d1={};_0x5cb7d1[_0x5bd63e]={'$like':'%'+_0x5f2b73[_0x1662('0x2b')][_0x1662('0x37')]+'%'};return _0x5cb7d1;})});}_0x25e284=_[_0x1662('0x39')]({},_0x25e284,_0x5f2b73[_0x1662('0x3b')]);return _0x4cf5fa[_0x1662('0x48')](_0x25e284);}})[_0x1662('0x21')](function(_0x307a1a){if(_0x307a1a){_0x4c2776=_0x307a1a['length'];if(!_0x5f2b73[_0x1662('0x2b')][_0x1662('0x32')](_0x1662('0x33'))){_0x25e284['limit']=qs[_0x1662('0x19')](_0x5f2b73[_0x1662('0x2b')][_0x1662('0x19')]);_0x25e284[_0x1662('0x1a')]=qs['offset'](_0x5f2b73[_0x1662('0x2b')]['offset']);}return _0x4cf5fa['getDescriptions'](_0x25e284);}})[_0x1662('0x21')](function(_0x4f48eb){if(_0x4f48eb){return _0x4f48eb?{'count':_0x4c2776,'rows':_0x4f48eb}:null;}})[_0x1662('0x21')](respondWithResult(_0x5b29b1,null))[_0x1662('0x41')](handleError(_0x5b29b1,null));};exports[_0x1662('0x49')]=function(_0x1525b1,_0x462965,_0xc40e44){var _0x13a6c8={};var _0xb0ea22={};var _0x3263e6;var _0x449cdb;return db[_0x1662('0x26')][_0x1662('0x46')]({'where':{'id':_0x1525b1['params']['id']}})[_0x1662('0x21')](handleEntityNotFound(_0x462965,null))[_0x1662('0x21')](function(_0xdc3f43){if(_0xdc3f43){_0x3263e6=_0xdc3f43;_0xb0ea22['model']=_[_0x1662('0x2c')](db[_0x1662('0x47')][_0x1662('0x3d')]);_0xb0ea22[_0x1662('0x2b')]=_['keys'](_0x1525b1[_0x1662('0x2b')]);_0xb0ea22[_0x1662('0x2d')]=_['intersection'](_0xb0ea22[_0x1662('0x29')],_0xb0ea22[_0x1662('0x2b')]);_0x13a6c8['attributes']=_[_0x1662('0x2e')](_0xb0ea22[_0x1662('0x29')],qs['fields'](_0x1525b1['query']['fields']));_0x13a6c8[_0x1662('0x2f')]=_0x13a6c8[_0x1662('0x2f')][_0x1662('0x31')]?_0x13a6c8[_0x1662('0x2f')]:_0xb0ea22[_0x1662('0x29')];_0x13a6c8[_0x1662('0x34')]=qs[_0x1662('0x35')](_0x1525b1[_0x1662('0x2b')]['sort']);_0x13a6c8[_0x1662('0x38')]=qs[_0x1662('0x2d')](_[_0x1662('0x36')](_0x1525b1[_0x1662('0x2b')],_0xb0ea22[_0x1662('0x2d')]));if(_0x1525b1[_0x1662('0x2b')]['filter']){_0x13a6c8[_0x1662('0x38')]=_[_0x1662('0x39')](_0x13a6c8[_0x1662('0x38')],{'$or':_[_0x1662('0x2a')](_0x13a6c8[_0x1662('0x2f')],function(_0x2df703){var _0x173dba={};_0x173dba[_0x2df703]={'$like':'%'+_0x1525b1[_0x1662('0x2b')][_0x1662('0x37')]+'%'};return _0x173dba;})});}_0x13a6c8=_[_0x1662('0x39')]({},_0x13a6c8,_0x1525b1['options']);return _0x3263e6[_0x1662('0x49')](_0x13a6c8);}})[_0x1662('0x21')](function(_0x17b77a){if(_0x17b77a){_0x449cdb=_0x17b77a['length'];if(!_0x1525b1[_0x1662('0x2b')]['hasOwnProperty'](_0x1662('0x33'))){_0x13a6c8[_0x1662('0x19')]=qs[_0x1662('0x19')](_0x1525b1['query'][_0x1662('0x19')]);_0x13a6c8[_0x1662('0x1a')]=qs[_0x1662('0x1a')](_0x1525b1[_0x1662('0x2b')][_0x1662('0x1a')]);}return _0x3263e6[_0x1662('0x49')](_0x13a6c8);}})[_0x1662('0x21')](function(_0x5473fc){if(_0x5473fc){return _0x5473fc?{'count':_0x449cdb,'rows':_0x5473fc}:null;}})[_0x1662('0x21')](respondWithResult(_0x462965,null))[_0x1662('0x41')](handleError(_0x462965,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 23131e1..a696d4a 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 _0x16d8=['api','moment','request-promise','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger'];(function(_0x38b347,_0x29f7f6){var _0x24134e=function(_0x4d7e76){while(--_0x4d7e76){_0x38b347['push'](_0x38b347['shift']());}};_0x24134e(++_0x29f7f6);}(_0x16d8,0xe3));var _0x816d=function(_0x1e1d62,_0x95056c){_0x1e1d62=_0x1e1d62-0x0;var _0x49ba11=_0x16d8[_0x1e1d62];return _0x49ba11;};'use strict';var _=require(_0x816d('0x0'));var util=require(_0x816d('0x1'));var logger=require(_0x816d('0x2'))(_0x816d('0x3'));var moment=require(_0x816d('0x4'));var BPromise=require('bluebird');var rp=require(_0x816d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intFreshsalesConfiguration.attributes');module[_0x816d('0x6')]=function(_0x447085,_0x1235d6){return _0x447085[_0x816d('0x7')](_0x816d('0x8'),attributes,{'tableName':_0x816d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d74=['define','FreshsalesConfiguration','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x7d74,0xc0));var _0x47d7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7d74[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x47d7('0x0'));var moment=require(_0x47d7('0x1'));var BPromise=require(_0x47d7('0x2'));var rp=require(_0x47d7('0x3'));var fs=require('fs');var path=require(_0x47d7('0x4'));var rimraf=require(_0x47d7('0x5'));var config=require(_0x47d7('0x6'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0x47d7('0x7')]=function(_0x501ad7,_0x2f0e45){return _0x501ad7[_0x47d7('0x8')](_0x47d7('0x9'),attributes,{'tableName':'int_freshsales_configurations','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 0bd7668..7b9ff01 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 _0x6d7a=['info','request\x20sent','debug','stringify','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then'];(function(_0x417b32,_0x5bf559){var _0x562f69=function(_0xbc92c4){while(--_0xbc92c4){_0x417b32['push'](_0x417b32['shift']());}};_0x562f69(++_0x5bf559);}(_0x6d7a,0x1d6));var _0xa6d7=function(_0x1ed8cb,_0x2f0e7b){_0x1ed8cb=_0x1ed8cb-0x0;var _0x2dbcf5=_0x6d7a[_0x1ed8cb];return _0x2dbcf5;};'use strict';var _=require(_0xa6d7('0x0'));var util=require('util');var moment=require(_0xa6d7('0x1'));var BPromise=require(_0xa6d7('0x2'));var rs=require(_0xa6d7('0x3'));var fs=require('fs');var Redis=require(_0xa6d7('0x4'));var db=require(_0xa6d7('0x5'))['db'];var utils=require(_0xa6d7('0x6'));var logger=require(_0xa6d7('0x7'))(_0xa6d7('0x8'));var config=require('../../config/environment');var jayson=require(_0xa6d7('0x9'));var client=jayson['client'][_0xa6d7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x12a1cc,_0x4ed201,_0x363da9){return new BPromise(function(_0x433b65,_0x2042b1){return client[_0xa6d7('0xb')](_0x12a1cc,_0x363da9)[_0xa6d7('0xc')](function(_0x50032e){logger[_0xa6d7('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x4ed201,_0xa6d7('0xe'));logger[_0xa6d7('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x4ed201,'request\x20sent',JSON[_0xa6d7('0x10')](_0x50032e));if(_0x50032e[_0xa6d7('0x11')]){if(_0x50032e[_0xa6d7('0x11')][_0xa6d7('0x12')]===0x1f4){logger['error'](_0xa6d7('0x13'),_0x4ed201,_0x50032e['error'][_0xa6d7('0x14')]);return _0x2042b1(_0x50032e[_0xa6d7('0x11')][_0xa6d7('0x14')]);}logger['error'](_0xa6d7('0x13'),_0x4ed201,_0x50032e[_0xa6d7('0x11')]['message']);return _0x433b65(_0x50032e[_0xa6d7('0x11')][_0xa6d7('0x14')]);}else{logger[_0xa6d7('0xd')](_0xa6d7('0x13'),_0x4ed201,_0xa6d7('0xe'));_0x433b65(_0x50032e[_0xa6d7('0x15')][_0xa6d7('0x14')]);}})[_0xa6d7('0x16')](function(_0x12424b){logger['error'](_0xa6d7('0x13'),_0x4ed201,_0x12424b);_0x2042b1(_0x12424b);});});} \ No newline at end of file +var _0x48cb=['FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s'];(function(_0x5db9de,_0x8e97f6){var _0x15cbf0=function(_0x2e9582){while(--_0x2e9582){_0x5db9de['push'](_0x5db9de['shift']());}};_0x15cbf0(++_0x8e97f6);}(_0x48cb,0xd8));var _0xb48c=function(_0x515619,_0x5a6200){_0x515619=_0x515619-0x0;var _0x1268f9=_0x48cb[_0x515619];return _0x1268f9;};'use strict';var _=require('lodash');var util=require(_0xb48c('0x0'));var moment=require(_0xb48c('0x1'));var BPromise=require(_0xb48c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb48c('0x3'))['db'];var utils=require(_0xb48c('0x4'));var logger=require(_0xb48c('0x5'))(_0xb48c('0x6'));var config=require(_0xb48c('0x7'));var jayson=require(_0xb48c('0x8'));var client=jayson[_0xb48c('0x9')][_0xb48c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41b59a,_0x405015,_0x1a2e87){return new BPromise(function(_0x55c8d7,_0x5aedd6){return client[_0xb48c('0xb')](_0x41b59a,_0x1a2e87)[_0xb48c('0xc')](function(_0x1a6d55){logger[_0xb48c('0xd')](_0xb48c('0xe'),_0x405015,'request\x20sent');logger['debug'](_0xb48c('0xf'),_0x405015,'request\x20sent',JSON['stringify'](_0x1a6d55));if(_0x1a6d55[_0xb48c('0x10')]){if(_0x1a6d55[_0xb48c('0x10')]['code']===0x1f4){logger['error'](_0xb48c('0xe'),_0x405015,_0x1a6d55[_0xb48c('0x10')][_0xb48c('0x11')]);return _0x5aedd6(_0x1a6d55[_0xb48c('0x10')][_0xb48c('0x11')]);}logger[_0xb48c('0x10')](_0xb48c('0xe'),_0x405015,_0x1a6d55[_0xb48c('0x10')]['message']);return _0x55c8d7(_0x1a6d55['error']['message']);}else{logger['info'](_0xb48c('0xe'),_0x405015,_0xb48c('0x12'));_0x55c8d7(_0x1a6d55[_0xb48c('0x13')][_0xb48c('0x11')]);}})[_0xb48c('0x14')](function(_0x472464){logger[_0xb48c('0x10')](_0xb48c('0xe'),_0x405015,_0x472464);_0x5aedd6(_0x472464);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 335f14b..b542339 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 _0xa7b4=['create','put','update','destroy','exports','util','path','express','Router','../../config/environment','./intFreshsalesField.controller','isAuthenticated','index','get','/:id','show','post'];(function(_0x5658b1,_0x22f19b){var _0x467356=function(_0x1a0bc6){while(--_0x1a0bc6){_0x5658b1['push'](_0x5658b1['shift']());}};_0x467356(++_0x22f19b);}(_0xa7b4,0x8d));var _0x4a7b=function(_0x30edd9,_0x3a66f8){_0x30edd9=_0x30edd9-0x0;var _0x35a7ee=_0xa7b4[_0x30edd9];return _0x35a7ee;};'use strict';var multer=require('multer');var util=require(_0x4a7b('0x0'));var path=require(_0x4a7b('0x1'));var timeout=require('connect-timeout');var express=require(_0x4a7b('0x2'));var router=express[_0x4a7b('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4a7b('0x4'));var controller=require(_0x4a7b('0x5'));router['get']('/',auth[_0x4a7b('0x6')](),controller[_0x4a7b('0x7')]);router[_0x4a7b('0x8')](_0x4a7b('0x9'),auth[_0x4a7b('0x6')](),controller[_0x4a7b('0xa')]);router[_0x4a7b('0xb')]('/',auth[_0x4a7b('0x6')](),controller[_0x4a7b('0xc')]);router[_0x4a7b('0xd')](_0x4a7b('0x9'),auth[_0x4a7b('0x6')](),controller[_0x4a7b('0xe')]);router['delete'](_0x4a7b('0x9'),auth['isAuthenticated'](),controller[_0x4a7b('0xf')]);module[_0x4a7b('0x10')]=router; \ No newline at end of file +var _0xd816=['/:id','update','destroy','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','isAuthenticated','get','show','create','put'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd816,0xd5));var _0x6d81=function(_0xbf80a2,_0x304992){_0xbf80a2=_0xbf80a2-0x0;var _0x3cd9be=_0xd816[_0xbf80a2];return _0x3cd9be;};'use strict';var multer=require(_0x6d81('0x0'));var util=require(_0x6d81('0x1'));var path=require('path');var timeout=require(_0x6d81('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6d81('0x3'));var interaction=require(_0x6d81('0x4'));var config=require(_0x6d81('0x5'));var controller=require(_0x6d81('0x6'));router['get']('/',auth[_0x6d81('0x7')](),controller['index']);router[_0x6d81('0x8')]('/:id',auth[_0x6d81('0x7')](),controller[_0x6d81('0x9')]);router['post']('/',auth[_0x6d81('0x7')](),controller[_0x6d81('0xa')]);router[_0x6d81('0xb')](_0x6d81('0xc'),auth['isAuthenticated'](),controller[_0x6d81('0xd')]);router['delete'](_0x6d81('0xc'),auth[_0x6d81('0x7')](),controller[_0x6d81('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 5369a74..6e6f260 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 _0xfff5=['variable','customVariable','picklist','STRING','exports','ENUM','string'];(function(_0x101802,_0x11f913){var _0x5d61ce=function(_0x4acc0){while(--_0x4acc0){_0x101802['push'](_0x101802['shift']());}};_0x5d61ce(++_0x11f913);}(_0xfff5,0xe4));var _0x5fff=function(_0x1aa43d,_0x3f5c9d){_0x1aa43d=_0x1aa43d-0x0;var _0x5770e5=_0xfff5[_0x1aa43d];return _0x5770e5;};'use strict';var Sequelize=require('sequelize');module[_0x5fff('0x0')]={'type':{'type':Sequelize[_0x5fff('0x1')](_0x5fff('0x2'),_0x5fff('0x3'),_0x5fff('0x4'),'keyValue',_0x5fff('0x5')),'defaultValue':_0x5fff('0x2')},'content':{'type':Sequelize[_0x5fff('0x6')]},'key':{'type':Sequelize[_0x5fff('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0x5fff('0x3'),_0x5fff('0x4'))},'keyContent':{'type':Sequelize[_0x5fff('0x6')]},'idField':{'type':Sequelize[_0x5fff('0x6')]},'nameField':{'type':Sequelize[_0x5fff('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x56bd=['BOOLEAN','sequelize','ENUM','customVariable','keyValue','picklist','string','STRING','variable'];(function(_0x599d74,_0x1af378){var _0x23e8f7=function(_0x23c14f){while(--_0x23c14f){_0x599d74['push'](_0x599d74['shift']());}};_0x23e8f7(++_0x1af378);}(_0x56bd,0x76));var _0xd56b=function(_0x44252d,_0x290196){_0x44252d=_0x44252d-0x0;var _0x5a19f5=_0x56bd[_0x44252d];return _0x5a19f5;};'use strict';var Sequelize=require(_0xd56b('0x0'));module['exports']={'type':{'type':Sequelize[_0xd56b('0x1')]('string','variable',_0xd56b('0x2'),_0xd56b('0x3'),_0xd56b('0x4')),'defaultValue':_0xd56b('0x5')},'content':{'type':Sequelize[_0xd56b('0x6')]},'key':{'type':Sequelize[_0xd56b('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0xd56b('0x7'),_0xd56b('0x2'))},'keyContent':{'type':Sequelize[_0xd56b('0x6')]},'idField':{'type':Sequelize[_0xd56b('0x6')]},'nameField':{'type':Sequelize[_0xd56b('0x6')]},'customField':{'type':Sequelize[_0xd56b('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd56b('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 22dc013..6aba369 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 _0x013c=['key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','FreshsalesField','rawAttributes','fieldName','type'];(function(_0x5e5a95,_0x4776fe){var _0x395248=function(_0x2750a6){while(--_0x2750a6){_0x5e5a95['push'](_0x5e5a95['shift']());}};_0x395248(++_0x4776fe);}(_0x013c,0x6c));var _0xc013=function(_0x28e74e,_0x53fdf1){_0x28e74e=_0x28e74e-0x0;var _0xb45ac1=_0x013c[_0x28e74e];return _0xb45ac1;};'use strict';var emlformat=require(_0xc013('0x0'));var rimraf=require(_0xc013('0x1'));var zipdir=require(_0xc013('0x2'));var jsonpatch=require(_0xc013('0x3'));var rp=require(_0xc013('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc013('0x5'));var util=require(_0xc013('0x6'));var path=require(_0xc013('0x7'));var sox=require(_0xc013('0x8'));var csv=require('to-csv');var ejs=require(_0xc013('0x9'));var fs=require('fs');var fs_extra=require(_0xc013('0xa'));var _=require(_0xc013('0xb'));var squel=require(_0xc013('0xc'));var crypto=require(_0xc013('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc013('0xe'));var toCsv=require(_0xc013('0xf'));var querystring=require('querystring');var Papa=require(_0xc013('0x10'));var Redis=require(_0xc013('0x11'));var authService=require(_0xc013('0x12'));var qs=require(_0xc013('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc013('0x14'))('api');var utils=require(_0xc013('0x15'));var config=require(_0xc013('0x16'));var licenseUtil=require(_0xc013('0x17'));var db=require(_0xc013('0x18'))['db'];function respondWithStatusCode(_0x4014f7,_0x32e9aa){_0x32e9aa=_0x32e9aa||0xcc;return function(_0x21d215){if(_0x21d215){return _0x4014f7[_0xc013('0x19')](_0x32e9aa);}return _0x4014f7[_0xc013('0x1a')](_0x32e9aa)[_0xc013('0x1b')]();};}function respondWithResult(_0x4f7ec7,_0x169c33){_0x169c33=_0x169c33||0xc8;return function(_0x5bff16){if(_0x5bff16){return _0x4f7ec7['status'](_0x169c33)[_0xc013('0x1c')](_0x5bff16);}};}function respondWithFilteredResult(_0x259df8,_0x10d515){return function(_0x4a94d8){if(_0x4a94d8){var _0x7ef922=typeof _0x10d515['offset']===_0xc013('0x1d')&&typeof _0x10d515[_0xc013('0x1e')]===_0xc013('0x1d');var _0x43f205=_0x4a94d8[_0xc013('0x1f')];var _0xcc1a0b=_0x7ef922?0x0:_0x10d515[_0xc013('0x20')];var _0x2badda=_0x7ef922?_0x4a94d8[_0xc013('0x1f')]:_0x10d515[_0xc013('0x20')]+_0x10d515[_0xc013('0x1e')];var _0x434476;if(_0x2badda>=_0x43f205){_0x2badda=_0x43f205;_0x434476=0xc8;}else{_0x434476=0xce;}_0x259df8[_0xc013('0x1a')](_0x434476);return _0x259df8[_0xc013('0x21')](_0xc013('0x22'),_0xcc1a0b+'-'+_0x2badda+'/'+_0x43f205)[_0xc013('0x1c')](_0x4a94d8);}return null;};}function patchUpdates(_0x138931){return function(_0xe53a4b){try{jsonpatch[_0xc013('0x23')](_0xe53a4b,_0x138931,!![]);}catch(_0x4d2d16){return BPromise[_0xc013('0x24')](_0x4d2d16);}return _0xe53a4b[_0xc013('0x25')]();};}function saveUpdates(_0x5eada5,_0x49924a){return function(_0x298639){if(_0x298639){return _0x298639[_0xc013('0x26')](_0x5eada5)['then'](function(_0x3a214b){return _0x3a214b;});}return null;};}function removeEntity(_0x21c12d,_0x27c63b){return function(_0x4958eb){if(_0x4958eb){return _0x4958eb[_0xc013('0x27')]()[_0xc013('0x28')](function(){_0x21c12d[_0xc013('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c4a6a,_0x5a3af3){return function(_0x13f5c3){if(!_0x13f5c3){_0x3c4a6a[_0xc013('0x19')](0x194);}return _0x13f5c3;};}function handleError(_0x4f421f,_0x14bc2c){_0x14bc2c=_0x14bc2c||0x1f4;return function(_0x242c49){logger[_0xc013('0x29')](_0x242c49[_0xc013('0x2a')]);if(_0x242c49[_0xc013('0x2b')]){delete _0x242c49[_0xc013('0x2b')];}_0x4f421f[_0xc013('0x1a')](_0x14bc2c)[_0xc013('0x2c')](_0x242c49);};}exports['index']=function(_0x308d37,_0x3497af){var _0x75f83b={},_0xc0300b={},_0xa06df0={'count':0x0,'rows':[]};var _0xa9f752=_[_0xc013('0x2d')](db[_0xc013('0x2e')][_0xc013('0x2f')],function(_0x1cd85e){return{'name':_0x1cd85e[_0xc013('0x30')],'type':_0x1cd85e[_0xc013('0x31')][_0xc013('0x32')]};});_0xc0300b[_0xc013('0x33')]=_['map'](_0xa9f752,_0xc013('0x2b'));_0xc0300b[_0xc013('0x34')]=_['keys'](_0x308d37[_0xc013('0x34')]);_0xc0300b[_0xc013('0x35')]=_[_0xc013('0x36')](_0xc0300b[_0xc013('0x33')],_0xc0300b[_0xc013('0x34')]);_0x75f83b[_0xc013('0x37')]=_['intersection'](_0xc0300b['model'],qs[_0xc013('0x38')](_0x308d37['query']['fields']));_0x75f83b[_0xc013('0x37')]=_0x75f83b[_0xc013('0x37')]['length']?_0x75f83b[_0xc013('0x37')]:_0xc0300b[_0xc013('0x33')];if(!_0x308d37['query'][_0xc013('0x39')](_0xc013('0x3a'))){_0x75f83b['limit']=qs[_0xc013('0x1e')](_0x308d37[_0xc013('0x34')][_0xc013('0x1e')]);_0x75f83b[_0xc013('0x20')]=qs[_0xc013('0x20')](_0x308d37[_0xc013('0x34')][_0xc013('0x20')]);}_0x75f83b[_0xc013('0x3b')]=qs[_0xc013('0x3c')](_0x308d37[_0xc013('0x34')][_0xc013('0x3c')]);_0x75f83b[_0xc013('0x3d')]=qs[_0xc013('0x35')](_[_0xc013('0x3e')](_0x308d37['query'],_0xc0300b[_0xc013('0x35')]),_0xa9f752);if(_0x308d37[_0xc013('0x34')][_0xc013('0x3f')]){_0x75f83b[_0xc013('0x3d')]=_['merge'](_0x75f83b[_0xc013('0x3d')],{'$or':_[_0xc013('0x2d')](_0xa9f752,function(_0x4da9d2){if(_0x4da9d2[_0xc013('0x31')]!==_0xc013('0x40')){var _0x47a831={};_0x47a831[_0x4da9d2[_0xc013('0x2b')]]={'$like':'%'+_0x308d37[_0xc013('0x34')]['filter']+'%'};return _0x47a831;}})});}_0x75f83b=_[_0xc013('0x41')]({},_0x75f83b,_0x308d37[_0xc013('0x42')]);var _0xfa8d3={'where':_0x75f83b['where']};return db[_0xc013('0x2e')][_0xc013('0x1f')](_0xfa8d3)[_0xc013('0x28')](function(_0x2c2509){_0xa06df0[_0xc013('0x1f')]=_0x2c2509;if(_0x308d37[_0xc013('0x34')][_0xc013('0x43')]){_0x75f83b[_0xc013('0x44')]=[{'all':!![]}];}return db[_0xc013('0x2e')][_0xc013('0x45')](_0x75f83b);})[_0xc013('0x28')](function(_0x3e6f5b){_0xa06df0[_0xc013('0x46')]=_0x3e6f5b;return _0xa06df0;})['then'](respondWithFilteredResult(_0x3497af,_0x75f83b))[_0xc013('0x47')](handleError(_0x3497af,null));};exports[_0xc013('0x48')]=function(_0x4955d6,_0x249581){var _0x2b7456={'raw':!![],'where':{'id':_0x4955d6[_0xc013('0x49')]['id']}},_0x2592d0={};_0x2592d0[_0xc013('0x33')]=_['keys'](db[_0xc013('0x2e')][_0xc013('0x2f')]);_0x2592d0[_0xc013('0x34')]=_[_0xc013('0x4a')](_0x4955d6[_0xc013('0x34')]);_0x2592d0[_0xc013('0x35')]=_['intersection'](_0x2592d0['model'],_0x2592d0['query']);_0x2b7456[_0xc013('0x37')]=_[_0xc013('0x36')](_0x2592d0[_0xc013('0x33')],qs[_0xc013('0x38')](_0x4955d6['query'][_0xc013('0x38')]));_0x2b7456[_0xc013('0x37')]=_0x2b7456[_0xc013('0x37')][_0xc013('0x4b')]?_0x2b7456[_0xc013('0x37')]:_0x2592d0[_0xc013('0x33')];if(_0x4955d6[_0xc013('0x34')][_0xc013('0x43')]){_0x2b7456[_0xc013('0x44')]=[{'all':!![]}];}_0x2b7456=_[_0xc013('0x41')]({},_0x2b7456,_0x4955d6['options']);return db['FreshsalesField'][_0xc013('0x4c')](_0x2b7456)[_0xc013('0x28')](handleEntityNotFound(_0x249581,null))[_0xc013('0x28')](respondWithResult(_0x249581,null))[_0xc013('0x47')](handleError(_0x249581,null));};exports[_0xc013('0x4d')]=function(_0x59795f,_0x4cb56b){return db[_0xc013('0x2e')][_0xc013('0x4d')](_0x59795f[_0xc013('0x4e')],{})[_0xc013('0x28')](respondWithResult(_0x4cb56b,0xc9))['catch'](handleError(_0x4cb56b,null));};exports[_0xc013('0x26')]=function(_0x27a526,_0x4329e2){if(_0x27a526[_0xc013('0x4e')]['id']){delete _0x27a526['body']['id'];}return db[_0xc013('0x2e')][_0xc013('0x4c')]({'where':{'id':_0x27a526[_0xc013('0x49')]['id']}})['then'](handleEntityNotFound(_0x4329e2,null))[_0xc013('0x28')](saveUpdates(_0x27a526[_0xc013('0x4e')],null))[_0xc013('0x28')](respondWithResult(_0x4329e2,null))[_0xc013('0x47')](handleError(_0x4329e2,null));};exports[_0xc013('0x27')]=function(_0x6273b3,_0x4762ba){return db['FreshsalesField']['find']({'where':{'id':_0x6273b3['params']['id']}})[_0xc013('0x28')](handleEntityNotFound(_0x4762ba,null))[_0xc013('0x28')](removeEntity(_0x4762ba,null))['catch'](handleError(_0x4762ba,null));}; \ No newline at end of file +var _0xde62=['error','stack','name','send','map','FreshsalesField','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','options','include','findAll','rows','catch','params','includeAll','find','create','body','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','destroy'];(function(_0x200872,_0x282c42){var _0x4cddf0=function(_0x43d077){while(--_0x43d077){_0x200872['push'](_0x200872['shift']());}};_0x4cddf0(++_0x282c42);}(_0xde62,0xfb));var _0x2de6=function(_0x4c9d00,_0x3cde29){_0x4c9d00=_0x4c9d00-0x0;var _0x4b3135=_0xde62[_0x4c9d00];return _0x4b3135;};'use strict';var emlformat=require(_0x2de6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2de6('0x1'));var jsonpatch=require(_0x2de6('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2de6('0x3'));var Mustache=require(_0x2de6('0x4'));var util=require(_0x2de6('0x5'));var path=require(_0x2de6('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2de6('0x7'));var fs=require('fs');var fs_extra=require(_0x2de6('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2de6('0x9'));var jsforce=require(_0x2de6('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x2de6('0xb'));var querystring=require(_0x2de6('0xc'));var Papa=require(_0x2de6('0xd'));var Redis=require(_0x2de6('0xe'));var authService=require(_0x2de6('0xf'));var qs=require(_0x2de6('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2de6('0x11'));var logger=require(_0x2de6('0x12'))(_0x2de6('0x13'));var utils=require(_0x2de6('0x14'));var config=require(_0x2de6('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x2de6('0x16'))['db'];function respondWithStatusCode(_0x54c6c0,_0x5a4e59){_0x5a4e59=_0x5a4e59||0xcc;return function(_0xf63388){if(_0xf63388){return _0x54c6c0[_0x2de6('0x17')](_0x5a4e59);}return _0x54c6c0['status'](_0x5a4e59)[_0x2de6('0x18')]();};}function respondWithResult(_0x5018a9,_0x4cc5b7){_0x4cc5b7=_0x4cc5b7||0xc8;return function(_0x409685){if(_0x409685){return _0x5018a9[_0x2de6('0x19')](_0x4cc5b7)['json'](_0x409685);}};}function respondWithFilteredResult(_0x449074,_0x25d1e7){return function(_0xe200b6){if(_0xe200b6){var _0x13f613=typeof _0x25d1e7[_0x2de6('0x1a')]===_0x2de6('0x1b')&&typeof _0x25d1e7[_0x2de6('0x1c')]==='undefined';var _0x352f0=_0xe200b6['count'];var _0x1d2c5f=_0x13f613?0x0:_0x25d1e7['offset'];var _0x2a6b56=_0x13f613?_0xe200b6[_0x2de6('0x1d')]:_0x25d1e7[_0x2de6('0x1a')]+_0x25d1e7[_0x2de6('0x1c')];var _0x313112;if(_0x2a6b56>=_0x352f0){_0x2a6b56=_0x352f0;_0x313112=0xc8;}else{_0x313112=0xce;}_0x449074[_0x2de6('0x19')](_0x313112);return _0x449074[_0x2de6('0x1e')](_0x2de6('0x1f'),_0x1d2c5f+'-'+_0x2a6b56+'/'+_0x352f0)[_0x2de6('0x20')](_0xe200b6);}return null;};}function patchUpdates(_0x132c05){return function(_0x15d45d){try{jsonpatch['apply'](_0x15d45d,_0x132c05,!![]);}catch(_0x4a3283){return BPromise[_0x2de6('0x21')](_0x4a3283);}return _0x15d45d['save']();};}function saveUpdates(_0x1f6bd4,_0x54f563){return function(_0xaa3c3a){if(_0xaa3c3a){return _0xaa3c3a[_0x2de6('0x22')](_0x1f6bd4)[_0x2de6('0x23')](function(_0x4a5db8){return _0x4a5db8;});}return null;};}function removeEntity(_0x4b2d10,_0x7da39a){return function(_0x3a9511){if(_0x3a9511){return _0x3a9511[_0x2de6('0x24')]()[_0x2de6('0x23')](function(){_0x4b2d10[_0x2de6('0x19')](0xcc)[_0x2de6('0x18')]();});}};}function handleEntityNotFound(_0x18c052,_0xa2b7ec){return function(_0x2c34b1){if(!_0x2c34b1){_0x18c052[_0x2de6('0x17')](0x194);}return _0x2c34b1;};}function handleError(_0x2bde3d,_0x2e4bf1){_0x2e4bf1=_0x2e4bf1||0x1f4;return function(_0x3c0e1d){logger[_0x2de6('0x25')](_0x3c0e1d[_0x2de6('0x26')]);if(_0x3c0e1d['name']){delete _0x3c0e1d[_0x2de6('0x27')];}_0x2bde3d[_0x2de6('0x19')](_0x2e4bf1)[_0x2de6('0x28')](_0x3c0e1d);};}exports['index']=function(_0x3dd9cd,_0x3f8381){var _0x1dac20={},_0x211ad7={},_0x5c4875={'count':0x0,'rows':[]};var _0x57eecd=_[_0x2de6('0x29')](db[_0x2de6('0x2a')][_0x2de6('0x2b')],function(_0x4066f0){return{'name':_0x4066f0[_0x2de6('0x2c')],'type':_0x4066f0[_0x2de6('0x2d')]['key']};});_0x211ad7[_0x2de6('0x2e')]=_[_0x2de6('0x29')](_0x57eecd,_0x2de6('0x27'));_0x211ad7[_0x2de6('0x2f')]=_[_0x2de6('0x30')](_0x3dd9cd[_0x2de6('0x2f')]);_0x211ad7[_0x2de6('0x31')]=_['intersection'](_0x211ad7[_0x2de6('0x2e')],_0x211ad7[_0x2de6('0x2f')]);_0x1dac20[_0x2de6('0x32')]=_[_0x2de6('0x33')](_0x211ad7[_0x2de6('0x2e')],qs[_0x2de6('0x34')](_0x3dd9cd[_0x2de6('0x2f')][_0x2de6('0x34')]));_0x1dac20['attributes']=_0x1dac20[_0x2de6('0x32')][_0x2de6('0x35')]?_0x1dac20['attributes']:_0x211ad7[_0x2de6('0x2e')];if(!_0x3dd9cd[_0x2de6('0x2f')][_0x2de6('0x36')]('nolimit')){_0x1dac20[_0x2de6('0x1c')]=qs[_0x2de6('0x1c')](_0x3dd9cd[_0x2de6('0x2f')]['limit']);_0x1dac20[_0x2de6('0x1a')]=qs[_0x2de6('0x1a')](_0x3dd9cd[_0x2de6('0x2f')][_0x2de6('0x1a')]);}_0x1dac20[_0x2de6('0x37')]=qs[_0x2de6('0x38')](_0x3dd9cd[_0x2de6('0x2f')][_0x2de6('0x38')]);_0x1dac20['where']=qs[_0x2de6('0x31')](_[_0x2de6('0x39')](_0x3dd9cd['query'],_0x211ad7[_0x2de6('0x31')]),_0x57eecd);if(_0x3dd9cd['query'][_0x2de6('0x3a')]){_0x1dac20['where']=_[_0x2de6('0x3b')](_0x1dac20[_0x2de6('0x3c')],{'$or':_['map'](_0x57eecd,function(_0x37cd56){if(_0x37cd56['type']!==_0x2de6('0x3d')){var _0x463573={};_0x463573[_0x37cd56['name']]={'$like':'%'+_0x3dd9cd[_0x2de6('0x2f')][_0x2de6('0x3a')]+'%'};return _0x463573;}})});}_0x1dac20=_[_0x2de6('0x3b')]({},_0x1dac20,_0x3dd9cd[_0x2de6('0x3e')]);var _0x44ad39={'where':_0x1dac20[_0x2de6('0x3c')]};return db[_0x2de6('0x2a')]['count'](_0x44ad39)[_0x2de6('0x23')](function(_0x25900a){_0x5c4875[_0x2de6('0x1d')]=_0x25900a;if(_0x3dd9cd[_0x2de6('0x2f')]['includeAll']){_0x1dac20[_0x2de6('0x3f')]=[{'all':!![]}];}return db[_0x2de6('0x2a')][_0x2de6('0x40')](_0x1dac20);})[_0x2de6('0x23')](function(_0x266145){_0x5c4875[_0x2de6('0x41')]=_0x266145;return _0x5c4875;})['then'](respondWithFilteredResult(_0x3f8381,_0x1dac20))[_0x2de6('0x42')](handleError(_0x3f8381,null));};exports['show']=function(_0x246304,_0x174b70){var _0x3d96e8={'raw':!![],'where':{'id':_0x246304[_0x2de6('0x43')]['id']}},_0x1fa22e={};_0x1fa22e[_0x2de6('0x2e')]=_[_0x2de6('0x30')](db[_0x2de6('0x2a')]['rawAttributes']);_0x1fa22e[_0x2de6('0x2f')]=_['keys'](_0x246304['query']);_0x1fa22e[_0x2de6('0x31')]=_[_0x2de6('0x33')](_0x1fa22e[_0x2de6('0x2e')],_0x1fa22e[_0x2de6('0x2f')]);_0x3d96e8[_0x2de6('0x32')]=_[_0x2de6('0x33')](_0x1fa22e[_0x2de6('0x2e')],qs[_0x2de6('0x34')](_0x246304[_0x2de6('0x2f')][_0x2de6('0x34')]));_0x3d96e8[_0x2de6('0x32')]=_0x3d96e8['attributes'][_0x2de6('0x35')]?_0x3d96e8[_0x2de6('0x32')]:_0x1fa22e['model'];if(_0x246304[_0x2de6('0x2f')][_0x2de6('0x44')]){_0x3d96e8[_0x2de6('0x3f')]=[{'all':!![]}];}_0x3d96e8=_[_0x2de6('0x3b')]({},_0x3d96e8,_0x246304[_0x2de6('0x3e')]);return db[_0x2de6('0x2a')][_0x2de6('0x45')](_0x3d96e8)[_0x2de6('0x23')](handleEntityNotFound(_0x174b70,null))['then'](respondWithResult(_0x174b70,null))[_0x2de6('0x42')](handleError(_0x174b70,null));};exports[_0x2de6('0x46')]=function(_0x3c482e,_0x12bf3d){return db[_0x2de6('0x2a')][_0x2de6('0x46')](_0x3c482e[_0x2de6('0x47')],{})[_0x2de6('0x23')](respondWithResult(_0x12bf3d,0xc9))[_0x2de6('0x42')](handleError(_0x12bf3d,null));};exports[_0x2de6('0x22')]=function(_0x5bc27c,_0x47cd72){if(_0x5bc27c[_0x2de6('0x47')]['id']){delete _0x5bc27c[_0x2de6('0x47')]['id'];}return db[_0x2de6('0x2a')][_0x2de6('0x45')]({'where':{'id':_0x5bc27c[_0x2de6('0x43')]['id']}})[_0x2de6('0x23')](handleEntityNotFound(_0x47cd72,null))[_0x2de6('0x23')](saveUpdates(_0x5bc27c[_0x2de6('0x47')],null))[_0x2de6('0x23')](respondWithResult(_0x47cd72,null))[_0x2de6('0x42')](handleError(_0x47cd72,null));};exports[_0x2de6('0x24')]=function(_0x40962d,_0x5d572d){return db[_0x2de6('0x2a')][_0x2de6('0x45')]({'where':{'id':_0x40962d[_0x2de6('0x43')]['id']}})[_0x2de6('0x23')](handleEntityNotFound(_0x5d572d,null))['then'](removeEntity(_0x5d572d,null))['catch'](handleError(_0x5d572d,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 53c4740..30ccd0e 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 _0xd983=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash'];(function(_0x22ba16,_0x3579ac){var _0x4b7a88=function(_0x1c300b){while(--_0x1c300b){_0x22ba16['push'](_0x22ba16['shift']());}};_0x4b7a88(++_0x3579ac);}(_0xd983,0x1df));var _0x3d98=function(_0x3de85a,_0x57c170){_0x3de85a=_0x3de85a-0x0;var _0x38d20f=_0xd983[_0x3de85a];return _0x38d20f;};'use strict';var _=require(_0x3d98('0x0'));var util=require(_0x3d98('0x1'));var logger=require(_0x3d98('0x2'))(_0x3d98('0x3'));var moment=require(_0x3d98('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3d98('0x5'));var rimraf=require(_0x3d98('0x6'));var config=require(_0x3d98('0x7'));var attributes=require(_0x3d98('0x8'));module[_0x3d98('0x9')]=function(_0x3e32c6,_0x394587){return _0x3e32c6['define'](_0x3d98('0xa'),attributes,{'tableName':_0x3d98('0xb'),'paranoid':![],'indexes':[{'name':_0x3d98('0xc'),'fields':[_0x3d98('0xd'),_0x3d98('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x85f8=['request-promise','path','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5f20cc,_0x2bf276){var _0x582687=function(_0x76f8a1){while(--_0x76f8a1){_0x5f20cc['push'](_0x5f20cc['shift']());}};_0x582687(++_0x2bf276);}(_0x85f8,0xd7));var _0x885f=function(_0x19a41b,_0x966050){_0x19a41b=_0x19a41b-0x0;var _0x310441=_0x85f8[_0x19a41b];return _0x310441;};'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':[{'name':_0x885f('0xe'),'fields':[_0x885f('0xf'),_0x885f('0x10')],'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 88de891..46dfcbd 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 _0x9536=['request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','FreshsalesField,\x20%s,\x20%s'];(function(_0x386abf,_0x536211){var _0x55c1fa=function(_0x344c59){while(--_0x344c59){_0x386abf['push'](_0x386abf['shift']());}};_0x55c1fa(++_0x536211);}(_0x9536,0x179));var _0x6953=function(_0x4bd950,_0x184ed5){_0x4bd950=_0x4bd950-0x0;var _0x5dc59a=_0x9536[_0x4bd950];return _0x5dc59a;};'use strict';var _=require(_0x6953('0x0'));var util=require(_0x6953('0x1'));var moment=require(_0x6953('0x2'));var BPromise=require(_0x6953('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6953('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6953('0x5'));var logger=require(_0x6953('0x6'))(_0x6953('0x7'));var config=require(_0x6953('0x8'));var jayson=require(_0x6953('0x9'));var client=jayson['client'][_0x6953('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bb026,_0x385f2d,_0x3e1aff){return new BPromise(function(_0x1c8225,_0x58ac30){return client[_0x6953('0xb')](_0x2bb026,_0x3e1aff)[_0x6953('0xc')](function(_0x449acb){logger['info'](_0x6953('0xd'),_0x385f2d,_0x6953('0xe'));logger[_0x6953('0xf')](_0x6953('0x10'),_0x385f2d,_0x6953('0xe'),JSON[_0x6953('0x11')](_0x449acb));if(_0x449acb[_0x6953('0x12')]){if(_0x449acb[_0x6953('0x12')][_0x6953('0x13')]===0x1f4){logger['error'](_0x6953('0xd'),_0x385f2d,_0x449acb['error'][_0x6953('0x14')]);return _0x58ac30(_0x449acb[_0x6953('0x12')][_0x6953('0x14')]);}logger[_0x6953('0x12')](_0x6953('0xd'),_0x385f2d,_0x449acb[_0x6953('0x12')][_0x6953('0x14')]);return _0x1c8225(_0x449acb[_0x6953('0x12')][_0x6953('0x14')]);}else{logger[_0x6953('0x15')](_0x6953('0xd'),_0x385f2d,'request\x20sent');_0x1c8225(_0x449acb['result'][_0x6953('0x14')]);}})[_0x6953('0x16')](function(_0x16b79b){logger[_0x6953('0x12')]('FreshsalesField,\x20%s,\x20%s',_0x385f2d,_0x16b79b);_0x58ac30(_0x16b79b);});});} \ No newline at end of file +var _0xfdbd=['info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then'];(function(_0x51175c,_0x572292){var _0x2c25a0=function(_0xda1f48){while(--_0xda1f48){_0x51175c['push'](_0x51175c['shift']());}};_0x2c25a0(++_0x572292);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xfdbd[_0x21aec3];return _0x288bbc;};'use strict';var _=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var moment=require(_0xdfdb('0x2'));var BPromise=require(_0xdfdb('0x3'));var rs=require(_0xdfdb('0x4'));var fs=require('fs');var Redis=require(_0xdfdb('0x5'));var db=require(_0xdfdb('0x6'))['db'];var utils=require(_0xdfdb('0x7'));var logger=require(_0xdfdb('0x8'))('rpc');var config=require(_0xdfdb('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xdfdb('0xa')][_0xdfdb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x489f19,_0x556dc0,_0x590b5d){return new BPromise(function(_0x188508,_0xf72a24){return client['request'](_0x489f19,_0x590b5d)[_0xdfdb('0xc')](function(_0x444c19){logger[_0xdfdb('0xd')](_0xdfdb('0xe'),_0x556dc0,_0xdfdb('0xf'));logger[_0xdfdb('0x10')](_0xdfdb('0x11'),_0x556dc0,'request\x20sent',JSON[_0xdfdb('0x12')](_0x444c19));if(_0x444c19[_0xdfdb('0x13')]){if(_0x444c19['error'][_0xdfdb('0x14')]===0x1f4){logger[_0xdfdb('0x13')](_0xdfdb('0xe'),_0x556dc0,_0x444c19[_0xdfdb('0x13')][_0xdfdb('0x15')]);return _0xf72a24(_0x444c19[_0xdfdb('0x13')][_0xdfdb('0x15')]);}logger[_0xdfdb('0x13')]('FreshsalesField,\x20%s,\x20%s',_0x556dc0,_0x444c19['error'][_0xdfdb('0x15')]);return _0x188508(_0x444c19['error'][_0xdfdb('0x15')]);}else{logger[_0xdfdb('0xd')](_0xdfdb('0xe'),_0x556dc0,_0xdfdb('0xf'));_0x188508(_0x444c19[_0xdfdb('0x16')][_0xdfdb('0x15')]);}})['catch'](function(_0x4fd3d5){logger[_0xdfdb('0x13')](_0xdfdb('0xe'),_0x556dc0,_0x4fd3d5);_0xf72a24(_0x4fd3d5);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 60cd27c..775257b 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(_0x424c10,_0x2d64ec){var _0x5e443e=function(_0x9cd085){while(--_0x9cd085){_0x424c10['push'](_0x424c10['shift']());}};_0x5e443e(++_0x2d64ec);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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(_0x2ee090,_0x23e6f6){var _0x402df4=function(_0x3d8984){while(--_0x3d8984){_0x2ee090['push'](_0x2ee090['shift']());}};_0x402df4(++_0x23e6f6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 eab09b0..14831ca 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 _0x47c5=['username','integrationTab','newTab','sequelize','exports','STRING'];(function(_0xa8fb74,_0x34ffca){var _0x2c68ab=function(_0x3b06d7){while(--_0x3b06d7){_0xa8fb74['push'](_0xa8fb74['shift']());}};_0x2c68ab(++_0x34ffca);}(_0x47c5,0x165));var _0x547c=function(_0x360b7a,_0x386e69){_0x360b7a=_0x360b7a-0x0;var _0x466f7a=_0x47c5[_0x360b7a];return _0x466f7a;};'use strict';var Sequelize=require(_0x547c('0x0'));module[_0x547c('0x1')]={'name':{'type':Sequelize[_0x547c('0x2')]},'description':{'type':Sequelize[_0x547c('0x2')]},'username':{'type':Sequelize[_0x547c('0x2')],'unique':_0x547c('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x547c('0x2')]},'clientId':{'type':Sequelize[_0x547c('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x547c('0x2')]},'serverUrl':{'type':Sequelize[_0x547c('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x547c('0x4'),_0x547c('0x5')),'defaultValue':_0x547c('0x4')}}; \ No newline at end of file +var _0x1d91=['integrationTab','sequelize','exports','STRING','username'];(function(_0x380979,_0x5b0b40){var _0x367d0f=function(_0x22bac1){while(--_0x22bac1){_0x380979['push'](_0x380979['shift']());}};_0x367d0f(++_0x5b0b40);}(_0x1d91,0x150));var _0x11d9=function(_0x5c6492,_0x1c1ae5){_0x5c6492=_0x5c6492-0x0;var _0x38ef45=_0x1d91[_0x5c6492];return _0x38ef45;};'use strict';var Sequelize=require(_0x11d9('0x0'));module[_0x11d9('0x1')]={'name':{'type':Sequelize[_0x11d9('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x11d9('0x2')],'unique':_0x11d9('0x3')},'remoteUri':{'type':Sequelize[_0x11d9('0x2')]},'password':{'type':Sequelize[_0x11d9('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x11d9('0x2')]},'securityToken':{'type':Sequelize[_0x11d9('0x2')]},'serverUrl':{'type':Sequelize[_0x11d9('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab','newTab'),'defaultValue':_0x11d9('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 2a1f37a..37653b7 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 _0x854d=['picklist','boolean','includes','label','picklistValues','value','True','true','False','false','statusCode','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','set','Content-Range','update','then','end','error','name','send','index','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','limit','sort','where','pick','filters','filter','merge','options','SalesforceAccount','includeAll','include','findAll','catch','show','params','find','create','body','getConfigurations','findOne','SalesforceConfiguration','rawAttributes','length','order','nolimit','AccountId','Subjects','getSubjects','getDescriptions','channel','SalesforceField','Descriptions','getFields','Task','remoteUri','clientId','clientSecret','username','password','securityToken','substring','Connection','login','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsRecurrence','Subject','Description'];(function(_0x1da7b,_0x3ce5ec){var _0x4bf8e3=function(_0x21bed2){while(--_0x21bed2){_0x1da7b['push'](_0x1da7b['shift']());}};_0x4bf8e3(++_0x3ce5ec);}(_0x854d,0xf8));var _0xd854=function(_0x4ae86e,_0x1227da){_0x4ae86e=_0x4ae86e-0x0;var _0x2d3d12=_0x854d[_0x4ae86e];return _0x2d3d12;};'use strict';var emlformat=require(_0xd854('0x0'));var rimraf=require(_0xd854('0x1'));var zipdir=require(_0xd854('0x2'));var jsonpatch=require(_0xd854('0x3'));var rp=require(_0xd854('0x4'));var moment=require('moment');var BPromise=require(_0xd854('0x5'));var Mustache=require(_0xd854('0x6'));var util=require(_0xd854('0x7'));var path=require(_0xd854('0x8'));var sox=require('sox');var csv=require(_0xd854('0x9'));var ejs=require(_0xd854('0xa'));var fs=require('fs');var fs_extra=require(_0xd854('0xb'));var _=require(_0xd854('0xc'));var squel=require(_0xd854('0xd'));var crypto=require('crypto');var jsforce=require(_0xd854('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd854('0x9'));var querystring=require(_0xd854('0xf'));var Papa=require(_0xd854('0x10'));var Redis=require(_0xd854('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd854('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd854('0x13'))(_0xd854('0x14'));var utils=require('../../config/utils');var config=require(_0xd854('0x15'));var licenseUtil=require(_0xd854('0x16'));var db=require(_0xd854('0x17'))['db'];var integrations=require(_0xd854('0x18'));function respondWithStatusCode(_0x1404e2,_0xf69505){_0xf69505=_0xf69505||0xcc;return function(_0x48ebda){if(_0x48ebda){return _0x1404e2[_0xd854('0x19')](_0xf69505);}return _0x1404e2[_0xd854('0x1a')](_0xf69505)['end']();};}function respondWithResult(_0x58758a,_0x28829b){_0x28829b=_0x28829b||0xc8;return function(_0x155e98){if(_0x155e98){return _0x58758a[_0xd854('0x1a')](_0x28829b)[_0xd854('0x1b')](_0x155e98);}};}function respondWithFilteredResult(_0x216db0,_0x3a9aaf){return function(_0x3a3396){if(_0x3a3396){var _0x1a24fd=typeof _0x3a9aaf[_0xd854('0x1c')]===_0xd854('0x1d')&&typeof _0x3a9aaf['limit']==='undefined';var _0x56223d=_0x3a3396[_0xd854('0x1e')];var _0x370daa=_0x1a24fd?0x0:_0x3a9aaf[_0xd854('0x1c')];var _0x16d0b8=_0x1a24fd?_0x3a3396[_0xd854('0x1e')]:_0x3a9aaf[_0xd854('0x1c')]+_0x3a9aaf['limit'];var _0x1e897b;if(_0x16d0b8>=_0x56223d){_0x16d0b8=_0x56223d;_0x1e897b=0xc8;}else{_0x1e897b=0xce;}_0x216db0['status'](_0x1e897b);return _0x216db0[_0xd854('0x1f')](_0xd854('0x20'),_0x370daa+'-'+_0x16d0b8+'/'+_0x56223d)[_0xd854('0x1b')](_0x3a3396);}return null;};}function patchUpdates(_0x536a24){return function(_0x395ece){try{jsonpatch['apply'](_0x395ece,_0x536a24,!![]);}catch(_0x842470){return BPromise['reject'](_0x842470);}return _0x395ece['save']();};}function saveUpdates(_0x28d2a8,_0x181ff5){return function(_0x3da189){if(_0x3da189){return _0x3da189[_0xd854('0x21')](_0x28d2a8)[_0xd854('0x22')](function(_0x35d6bc){return _0x35d6bc;});}return null;};}function removeEntity(_0x323873,_0x3e5a20){return function(_0x43838d){if(_0x43838d){return _0x43838d['destroy']()['then'](function(){_0x323873[_0xd854('0x1a')](0xcc)[_0xd854('0x23')]();});}};}function handleEntityNotFound(_0x5a006e,_0x539266){return function(_0x4711f6){if(!_0x4711f6){_0x5a006e[_0xd854('0x19')](0x194);}return _0x4711f6;};}function handleError(_0x1a52ca,_0x2c1042){_0x2c1042=_0x2c1042||0x1f4;return function(_0x4ba594){logger[_0xd854('0x24')](_0x4ba594['stack']);if(_0x4ba594[_0xd854('0x25')]){delete _0x4ba594[_0xd854('0x25')];}_0x1a52ca['status'](_0x2c1042)[_0xd854('0x26')](_0x4ba594);};}exports[_0xd854('0x27')]=function(_0x1faff2,_0x3afaeb){var _0x78416={},_0x5520b6={},_0x4ffee9={'count':0x0,'rows':[]};var _0x92e5fc=_['map'](db['SalesforceAccount']['rawAttributes'],function(_0x4d8d62){return{'name':_0x4d8d62[_0xd854('0x28')],'type':_0x4d8d62[_0xd854('0x29')][_0xd854('0x2a')]};});_0x5520b6[_0xd854('0x2b')]=_[_0xd854('0x2c')](_0x92e5fc,'name');_0x5520b6[_0xd854('0x2d')]=_[_0xd854('0x2e')](_0x1faff2[_0xd854('0x2d')]);_0x5520b6['filters']=_[_0xd854('0x2f')](_0x5520b6[_0xd854('0x2b')],_0x5520b6[_0xd854('0x2d')]);_0x78416[_0xd854('0x30')]=_[_0xd854('0x2f')](_0x5520b6[_0xd854('0x2b')],qs[_0xd854('0x31')](_0x1faff2['query']['fields']));_0x78416[_0xd854('0x30')]=_0x78416[_0xd854('0x30')]['length']?_0x78416[_0xd854('0x30')]:_0x5520b6['model'];if(!_0x1faff2[_0xd854('0x2d')][_0xd854('0x32')]('nolimit')){_0x78416[_0xd854('0x33')]=qs[_0xd854('0x33')](_0x1faff2[_0xd854('0x2d')][_0xd854('0x33')]);_0x78416[_0xd854('0x1c')]=qs[_0xd854('0x1c')](_0x1faff2[_0xd854('0x2d')][_0xd854('0x1c')]);}_0x78416['order']=qs['sort'](_0x1faff2['query'][_0xd854('0x34')]);_0x78416[_0xd854('0x35')]=qs['filters'](_[_0xd854('0x36')](_0x1faff2[_0xd854('0x2d')],_0x5520b6[_0xd854('0x37')]),_0x92e5fc);if(_0x1faff2['query'][_0xd854('0x38')]){_0x78416[_0xd854('0x35')]=_[_0xd854('0x39')](_0x78416[_0xd854('0x35')],{'$or':_['map'](_0x92e5fc,function(_0x11457b){if(_0x11457b['type']!=='VIRTUAL'){var _0x3a348a={};_0x3a348a[_0x11457b[_0xd854('0x25')]]={'$like':'%'+_0x1faff2['query'][_0xd854('0x38')]+'%'};return _0x3a348a;}})});}_0x78416=_[_0xd854('0x39')]({},_0x78416,_0x1faff2[_0xd854('0x3a')]);var _0x4af16b={'where':_0x78416[_0xd854('0x35')]};return db[_0xd854('0x3b')][_0xd854('0x1e')](_0x4af16b)[_0xd854('0x22')](function(_0x37a624){_0x4ffee9[_0xd854('0x1e')]=_0x37a624;if(_0x1faff2['query'][_0xd854('0x3c')]){_0x78416[_0xd854('0x3d')]=[{'all':!![]}];}return db['SalesforceAccount'][_0xd854('0x3e')](_0x78416);})[_0xd854('0x22')](function(_0x91e297){_0x4ffee9['rows']=_0x91e297;return _0x4ffee9;})['then'](respondWithFilteredResult(_0x3afaeb,_0x78416))[_0xd854('0x3f')](handleError(_0x3afaeb,null));};exports[_0xd854('0x40')]=function(_0x2faac1,_0x427e27){var _0x29689a={'raw':![],'where':{'id':_0x2faac1[_0xd854('0x41')]['id']}},_0x15c7ee={};_0x15c7ee[_0xd854('0x2b')]=_[_0xd854('0x2e')](db[_0xd854('0x3b')]['rawAttributes']);_0x15c7ee[_0xd854('0x2d')]=_[_0xd854('0x2e')](_0x2faac1[_0xd854('0x2d')]);_0x15c7ee[_0xd854('0x37')]=_[_0xd854('0x2f')](_0x15c7ee['model'],_0x15c7ee[_0xd854('0x2d')]);_0x29689a[_0xd854('0x30')]=_[_0xd854('0x2f')](_0x15c7ee[_0xd854('0x2b')],qs[_0xd854('0x31')](_0x2faac1[_0xd854('0x2d')][_0xd854('0x31')]));_0x29689a['attributes']=_0x29689a[_0xd854('0x30')]['length']?_0x29689a[_0xd854('0x30')]:_0x15c7ee['model'];if(_0x2faac1[_0xd854('0x2d')][_0xd854('0x3c')]){_0x29689a['include']=[{'all':!![]}];}_0x29689a=_[_0xd854('0x39')]({},_0x29689a,_0x2faac1[_0xd854('0x3a')]);return db[_0xd854('0x3b')][_0xd854('0x42')](_0x29689a)[_0xd854('0x22')](handleEntityNotFound(_0x427e27,null))[_0xd854('0x22')](respondWithResult(_0x427e27,null))[_0xd854('0x3f')](handleError(_0x427e27,null));};exports[_0xd854('0x43')]=function(_0x54c994,_0x1d31b3){return db[_0xd854('0x3b')][_0xd854('0x43')](_0x54c994['body'],{})['then'](respondWithResult(_0x1d31b3,0xc9))['catch'](handleError(_0x1d31b3,null));};exports[_0xd854('0x21')]=function(_0x9b501a,_0x3db82e){if(_0x9b501a[_0xd854('0x44')]['id']){delete _0x9b501a[_0xd854('0x44')]['id'];}return db[_0xd854('0x3b')][_0xd854('0x42')]({'where':{'id':_0x9b501a[_0xd854('0x41')]['id']}})[_0xd854('0x22')](handleEntityNotFound(_0x3db82e,null))[_0xd854('0x22')](saveUpdates(_0x9b501a[_0xd854('0x44')],null))[_0xd854('0x22')](respondWithResult(_0x3db82e,null))[_0xd854('0x3f')](handleError(_0x3db82e,null));};exports['destroy']=function(_0x236d01,_0x52b196){return db[_0xd854('0x3b')][_0xd854('0x42')]({'where':{'id':_0x236d01[_0xd854('0x41')]['id']}})['then'](handleEntityNotFound(_0x52b196,null))[_0xd854('0x22')](removeEntity(_0x52b196,null))[_0xd854('0x3f')](handleError(_0x52b196,null));};exports[_0xd854('0x45')]=function(_0xfba659,_0x402960,_0x561904){var _0x4d1a81={};var _0x11a9de={};var _0x4be529;var _0x4fba6a;return db[_0xd854('0x3b')][_0xd854('0x46')]({'where':{'id':_0xfba659['params']['id']}})[_0xd854('0x22')](handleEntityNotFound(_0x402960,null))[_0xd854('0x22')](function(_0x543315){if(_0x543315){_0x4be529=_0x543315;_0x11a9de['model']=_[_0xd854('0x2e')](db[_0xd854('0x47')][_0xd854('0x48')]);_0x11a9de[_0xd854('0x2d')]=_[_0xd854('0x2e')](_0xfba659[_0xd854('0x2d')]);_0x11a9de[_0xd854('0x37')]=_[_0xd854('0x2f')](_0x11a9de[_0xd854('0x2b')],_0x11a9de[_0xd854('0x2d')]);_0x4d1a81[_0xd854('0x30')]=_[_0xd854('0x2f')](_0x11a9de[_0xd854('0x2b')],qs[_0xd854('0x31')](_0xfba659[_0xd854('0x2d')][_0xd854('0x31')]));_0x4d1a81[_0xd854('0x30')]=_0x4d1a81['attributes'][_0xd854('0x49')]?_0x4d1a81[_0xd854('0x30')]:_0x11a9de[_0xd854('0x2b')];_0x4d1a81[_0xd854('0x4a')]=qs[_0xd854('0x34')](_0xfba659[_0xd854('0x2d')][_0xd854('0x34')]);_0x4d1a81[_0xd854('0x35')]=qs[_0xd854('0x37')](_[_0xd854('0x36')](_0xfba659['query'],_0x11a9de[_0xd854('0x37')]));if(_0xfba659[_0xd854('0x2d')][_0xd854('0x38')]){_0x4d1a81[_0xd854('0x35')]=_[_0xd854('0x39')](_0x4d1a81[_0xd854('0x35')],{'$or':_[_0xd854('0x2c')](_0x4d1a81[_0xd854('0x30')],function(_0x5caf37){var _0x1951ea={};_0x1951ea[_0x5caf37]={'$like':'%'+_0xfba659['query'][_0xd854('0x38')]+'%'};return _0x1951ea;})});}_0x4d1a81=_[_0xd854('0x39')]({},_0x4d1a81,_0xfba659[_0xd854('0x3a')]);return _0x4be529['getConfigurations'](_0x4d1a81);}})['then'](function(_0x2b7122){if(_0x2b7122){_0x4fba6a=_0x2b7122[_0xd854('0x49')];if(!_0xfba659[_0xd854('0x2d')][_0xd854('0x32')](_0xd854('0x4b'))){_0x4d1a81[_0xd854('0x33')]=qs[_0xd854('0x33')](_0xfba659[_0xd854('0x2d')][_0xd854('0x33')]);_0x4d1a81['offset']=qs[_0xd854('0x1c')](_0xfba659['query'][_0xd854('0x1c')]);}return _0x4be529[_0xd854('0x45')](_0x4d1a81);}})[_0xd854('0x22')](function(_0x461bdb){if(_0x461bdb){return _0x461bdb?{'count':_0x4fba6a,'rows':_0x461bdb}:null;}})[_0xd854('0x22')](respondWithResult(_0x402960,null))[_0xd854('0x3f')](handleError(_0x402960,null));};exports['addConfiguration']=function(_0x34f07b,_0x427d5d,_0x11bfda){if(_0x34f07b['body']['id']){delete _0x34f07b[_0xd854('0x44')]['id'];}return db[_0xd854('0x3b')][_0xd854('0x46')]({'where':{'id':_0x34f07b[_0xd854('0x41')]['id']}})['then'](handleEntityNotFound(_0x427d5d,null))[_0xd854('0x22')](function(_0x4ca669){if(_0x4ca669){_0x34f07b[_0xd854('0x44')][_0xd854('0x4c')]=_0x4ca669['id'];_0x34f07b[_0xd854('0x44')][_0xd854('0x4d')]=integrations[_0xd854('0x4e')](_0x34f07b[_0xd854('0x44')]['channel'],_0x34f07b[_0xd854('0x44')][_0xd854('0x29')]);_0x34f07b[_0xd854('0x44')]['Descriptions']=integrations[_0xd854('0x4f')](_0x34f07b['body'][_0xd854('0x50')],_0x34f07b[_0xd854('0x44')]['type']);return db[_0xd854('0x47')][_0xd854('0x43')](_0x34f07b[_0xd854('0x44')],{'include':[{'model':db[_0xd854('0x51')],'as':_0xd854('0x4d')},{'model':db[_0xd854('0x51')],'as':_0xd854('0x52')}]});}return null;})[_0xd854('0x22')](respondWithResult(_0x427d5d,null))[_0xd854('0x3f')](handleError(_0x427d5d,null));};exports[_0xd854('0x53')]=function(_0x29cd15,_0x1e4b91,_0x103a96){var _0x1a3ac1;var _0x583786='';var _0x4c25d9=_0xd854('0x54');return db['SalesforceAccount'][_0xd854('0x46')]({'where':{'id':_0x29cd15[_0xd854('0x41')]['id']},'attributes':['id',_0xd854('0x55'),_0xd854('0x56'),_0xd854('0x57'),_0xd854('0x58'),_0xd854('0x59'),_0xd854('0x5a')]})[_0xd854('0x22')](handleEntityNotFound(_0x1e4b91,null))['then'](function(_0x5b440d){if(_0x5b440d){_0x583786=_0x5b440d['remoteUri'];var _0x19183d=_0x583786['slice'](-0x1);if(_0x19183d==='/'){_0x583786=_0x583786[_0xd854('0x5b')](0x0,_0x583786['lastIndexOf'](_0x19183d));}_0x1a3ac1=new jsforce[(_0xd854('0x5c'))]({'oauth2':{'loginUrl':_0x583786,'clientId':_0x5b440d['clientId'],'clientSecret':_0x5b440d[_0xd854('0x57')]}});return _0x1a3ac1[_0xd854('0x5d')](_0x5b440d[_0xd854('0x58')],_0x5b440d[_0xd854('0x59')]['concat'](_0x5b440d[_0xd854('0x5a')]));}})['then'](function(_0x51031f){if(_0x51031f){if(!_[_0xd854('0x5e')](_0x29cd15[_0xd854('0x2d')]['ticketType'])){_0x4c25d9=_0x29cd15[_0xd854('0x2d')][_0xd854('0x5f')];}return _0x1a3ac1[_0xd854('0x60')](_0x4c25d9)[_0xd854('0x61')]();}})[_0xd854('0x22')](function(_0x34cb5d){var _0x59f8c4=[_0xd854('0x62'),_0xd854('0x63'),'IsReminderSet',_0xd854('0x64'),_0xd854('0x65'),_0xd854('0x66')];var _0x5c4d67=['string','int',_0xd854('0x67'),_0xd854('0x68'),'email','textarea','phone'];if(_0x34cb5d){_['remove'](_0x34cb5d[_0xd854('0x31')],function(_0x3313da){return _0x59f8c4[_0xd854('0x69')](_0x3313da[_0xd854('0x25')])||!_0x5c4d67[_0xd854('0x69')](_0x3313da[_0xd854('0x29')]);});return{'count':_0x34cb5d['fields'][_0xd854('0x49')],'rows':_[_0xd854('0x2c')](_0x34cb5d[_0xd854('0x31')],function(_0x3c831){return{'id':_0x3c831['name'],'name':_0x3c831[_0xd854('0x6a')],'custom':_0x3c831['custom'],'options':_0x3c831['picklistValues'][_0xd854('0x49')]>0x0?_['map'](_0x3c831[_0xd854('0x6b')],function(_0x281f3e){return{'name':_0x281f3e['label'],'value':_0x281f3e[_0xd854('0x6c')]};}):_0x3c831['type']=='boolean'?[{'name':_0xd854('0x6d'),'value':_0xd854('0x6e')},{'name':_0xd854('0x6f'),'value':_0xd854('0x70')}]:[]};})};}})[_0xd854('0x22')](respondWithResult(_0x1e4b91,null))[_0xd854('0x3f')](function(_0xea7185){var _0x19ca6a=_0x29cd15[_0xd854('0x2d')]['test']?0x1f4:_0xea7185[_0xd854('0x71')]||0x1f4;logger[_0xd854('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0xd854('0x53'),_0x19ca6a,JSON[_0xd854('0x72')](_0xea7185));delete _0xea7185[_0xd854('0x25')];if(_0x19ca6a===0x191){_0x19ca6a=0x190;}_0x1e4b91[_0xd854('0x1a')](_0x19ca6a)['send'](_0x29cd15[_0xd854('0x2d')][_0xd854('0x73')]?{'message':_0xd854('0x74'),'statusCode':_0xea7185[_0xd854('0x71')]}:_0xea7185);});}; \ No newline at end of file +var _0xdc8d=['username','password','securityToken','slice','substring','lastIndexOf','login','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','int','picklist','boolean','email','phone','remove','includes','label','picklistValues','value','True','true','False','false','test','statusCode','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','json','reject','save','update','then','destroy','error','stack','name','send','index','map','SalesforceAccount','rawAttributes','type','model','query','filters','attributes','intersection','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','catch','show','keys','fields','length','include','find','create','body','params','getConfigurations','SalesforceConfiguration','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret'];(function(_0x4783a3,_0x2e67cc){var _0x2ed63a=function(_0x5a8db4){while(--_0x5a8db4){_0x4783a3['push'](_0x4783a3['shift']());}};_0x2ed63a(++_0x2e67cc);}(_0xdc8d,0x11c));var _0xddc8=function(_0x27a670,_0x40afef){_0x27a670=_0x27a670-0x0;var _0x27013c=_0xdc8d[_0x27a670];return _0x27013c;};'use strict';var emlformat=require(_0xddc8('0x0'));var rimraf=require(_0xddc8('0x1'));var zipdir=require(_0xddc8('0x2'));var jsonpatch=require(_0xddc8('0x3'));var rp=require(_0xddc8('0x4'));var moment=require(_0xddc8('0x5'));var BPromise=require(_0xddc8('0x6'));var Mustache=require(_0xddc8('0x7'));var util=require(_0xddc8('0x8'));var path=require(_0xddc8('0x9'));var sox=require('sox');var csv=require(_0xddc8('0xa'));var ejs=require(_0xddc8('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xddc8('0xc'));var squel=require('squel');var crypto=require(_0xddc8('0xd'));var jsforce=require(_0xddc8('0xe'));var deskjs=require(_0xddc8('0xf'));var toCsv=require(_0xddc8('0xa'));var querystring=require('querystring');var Papa=require(_0xddc8('0x10'));var Redis=require(_0xddc8('0x11'));var authService=require(_0xddc8('0x12'));var qs=require(_0xddc8('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xddc8('0x14'));var logger=require('../../config/logger')(_0xddc8('0x15'));var utils=require(_0xddc8('0x16'));var config=require(_0xddc8('0x17'));var licenseUtil=require(_0xddc8('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0xddc8('0x19'));function respondWithStatusCode(_0x2b55dc,_0x4ead28){_0x4ead28=_0x4ead28||0xcc;return function(_0x48486c){if(_0x48486c){return _0x2b55dc[_0xddc8('0x1a')](_0x4ead28);}return _0x2b55dc[_0xddc8('0x1b')](_0x4ead28)[_0xddc8('0x1c')]();};}function respondWithResult(_0x8ebcf0,_0x55576e){_0x55576e=_0x55576e||0xc8;return function(_0x13e2d7){if(_0x13e2d7){return _0x8ebcf0[_0xddc8('0x1b')](_0x55576e)['json'](_0x13e2d7);}};}function respondWithFilteredResult(_0x53d853,_0x4f3bea){return function(_0x43b517){if(_0x43b517){var _0x1ea59c=typeof _0x4f3bea[_0xddc8('0x1d')]===_0xddc8('0x1e')&&typeof _0x4f3bea[_0xddc8('0x1f')]===_0xddc8('0x1e');var _0x528e77=_0x43b517[_0xddc8('0x20')];var _0x958ab8=_0x1ea59c?0x0:_0x4f3bea[_0xddc8('0x1d')];var _0x7952c0=_0x1ea59c?_0x43b517[_0xddc8('0x20')]:_0x4f3bea[_0xddc8('0x1d')]+_0x4f3bea['limit'];var _0x2bdbb0;if(_0x7952c0>=_0x528e77){_0x7952c0=_0x528e77;_0x2bdbb0=0xc8;}else{_0x2bdbb0=0xce;}_0x53d853[_0xddc8('0x1b')](_0x2bdbb0);return _0x53d853['set']('Content-Range',_0x958ab8+'-'+_0x7952c0+'/'+_0x528e77)[_0xddc8('0x21')](_0x43b517);}return null;};}function patchUpdates(_0x2f7010){return function(_0x4d9502){try{jsonpatch['apply'](_0x4d9502,_0x2f7010,!![]);}catch(_0x1c33d7){return BPromise[_0xddc8('0x22')](_0x1c33d7);}return _0x4d9502[_0xddc8('0x23')]();};}function saveUpdates(_0x4268aa,_0xaa98a8){return function(_0x510b8f){if(_0x510b8f){return _0x510b8f[_0xddc8('0x24')](_0x4268aa)[_0xddc8('0x25')](function(_0x45b29c){return _0x45b29c;});}return null;};}function removeEntity(_0x85a143,_0x4c1f61){return function(_0x5886e7){if(_0x5886e7){return _0x5886e7[_0xddc8('0x26')]()['then'](function(){_0x85a143[_0xddc8('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1912c4,_0x28ce61){return function(_0x320eaf){if(!_0x320eaf){_0x1912c4[_0xddc8('0x1a')](0x194);}return _0x320eaf;};}function handleError(_0x20789a,_0x40948){_0x40948=_0x40948||0x1f4;return function(_0x46f2e7){logger[_0xddc8('0x27')](_0x46f2e7[_0xddc8('0x28')]);if(_0x46f2e7[_0xddc8('0x29')]){delete _0x46f2e7[_0xddc8('0x29')];}_0x20789a[_0xddc8('0x1b')](_0x40948)[_0xddc8('0x2a')](_0x46f2e7);};}exports[_0xddc8('0x2b')]=function(_0x4a75c5,_0x27998c){var _0x59113c={},_0x562a1f={},_0x213c0f={'count':0x0,'rows':[]};var _0x498137=_[_0xddc8('0x2c')](db[_0xddc8('0x2d')][_0xddc8('0x2e')],function(_0xda0d45){return{'name':_0xda0d45['fieldName'],'type':_0xda0d45[_0xddc8('0x2f')]['key']};});_0x562a1f[_0xddc8('0x30')]=_[_0xddc8('0x2c')](_0x498137,_0xddc8('0x29'));_0x562a1f[_0xddc8('0x31')]=_['keys'](_0x4a75c5[_0xddc8('0x31')]);_0x562a1f[_0xddc8('0x32')]=_['intersection'](_0x562a1f[_0xddc8('0x30')],_0x562a1f['query']);_0x59113c[_0xddc8('0x33')]=_[_0xddc8('0x34')](_0x562a1f[_0xddc8('0x30')],qs['fields'](_0x4a75c5[_0xddc8('0x31')]['fields']));_0x59113c[_0xddc8('0x33')]=_0x59113c[_0xddc8('0x33')]['length']?_0x59113c['attributes']:_0x562a1f[_0xddc8('0x30')];if(!_0x4a75c5[_0xddc8('0x31')][_0xddc8('0x35')](_0xddc8('0x36'))){_0x59113c['limit']=qs['limit'](_0x4a75c5[_0xddc8('0x31')][_0xddc8('0x1f')]);_0x59113c['offset']=qs['offset'](_0x4a75c5['query'][_0xddc8('0x1d')]);}_0x59113c[_0xddc8('0x37')]=qs[_0xddc8('0x38')](_0x4a75c5['query'][_0xddc8('0x38')]);_0x59113c['where']=qs['filters'](_[_0xddc8('0x39')](_0x4a75c5['query'],_0x562a1f['filters']),_0x498137);if(_0x4a75c5[_0xddc8('0x31')][_0xddc8('0x3a')]){_0x59113c[_0xddc8('0x3b')]=_[_0xddc8('0x3c')](_0x59113c[_0xddc8('0x3b')],{'$or':_[_0xddc8('0x2c')](_0x498137,function(_0x1f5a3c){if(_0x1f5a3c[_0xddc8('0x2f')]!==_0xddc8('0x3d')){var _0x4ed8fb={};_0x4ed8fb[_0x1f5a3c[_0xddc8('0x29')]]={'$like':'%'+_0x4a75c5[_0xddc8('0x31')][_0xddc8('0x3a')]+'%'};return _0x4ed8fb;}})});}_0x59113c=_[_0xddc8('0x3c')]({},_0x59113c,_0x4a75c5[_0xddc8('0x3e')]);var _0x448c5f={'where':_0x59113c[_0xddc8('0x3b')]};return db['SalesforceAccount'][_0xddc8('0x20')](_0x448c5f)[_0xddc8('0x25')](function(_0x28a59b){_0x213c0f[_0xddc8('0x20')]=_0x28a59b;if(_0x4a75c5['query'][_0xddc8('0x3f')]){_0x59113c['include']=[{'all':!![]}];}return db[_0xddc8('0x2d')][_0xddc8('0x40')](_0x59113c);})[_0xddc8('0x25')](function(_0x35f073){_0x213c0f['rows']=_0x35f073;return _0x213c0f;})['then'](respondWithFilteredResult(_0x27998c,_0x59113c))[_0xddc8('0x41')](handleError(_0x27998c,null));};exports[_0xddc8('0x42')]=function(_0x3c0296,_0x243715){var _0x314247={'raw':![],'where':{'id':_0x3c0296['params']['id']}},_0x2b1b74={};_0x2b1b74[_0xddc8('0x30')]=_[_0xddc8('0x43')](db[_0xddc8('0x2d')][_0xddc8('0x2e')]);_0x2b1b74['query']=_[_0xddc8('0x43')](_0x3c0296[_0xddc8('0x31')]);_0x2b1b74[_0xddc8('0x32')]=_['intersection'](_0x2b1b74[_0xddc8('0x30')],_0x2b1b74['query']);_0x314247[_0xddc8('0x33')]=_['intersection'](_0x2b1b74['model'],qs[_0xddc8('0x44')](_0x3c0296[_0xddc8('0x31')][_0xddc8('0x44')]));_0x314247['attributes']=_0x314247[_0xddc8('0x33')][_0xddc8('0x45')]?_0x314247['attributes']:_0x2b1b74[_0xddc8('0x30')];if(_0x3c0296[_0xddc8('0x31')][_0xddc8('0x3f')]){_0x314247[_0xddc8('0x46')]=[{'all':!![]}];}_0x314247=_[_0xddc8('0x3c')]({},_0x314247,_0x3c0296[_0xddc8('0x3e')]);return db[_0xddc8('0x2d')][_0xddc8('0x47')](_0x314247)['then'](handleEntityNotFound(_0x243715,null))['then'](respondWithResult(_0x243715,null))['catch'](handleError(_0x243715,null));};exports['create']=function(_0x48bc8e,_0x51aa8a){return db[_0xddc8('0x2d')][_0xddc8('0x48')](_0x48bc8e[_0xddc8('0x49')],{})[_0xddc8('0x25')](respondWithResult(_0x51aa8a,0xc9))['catch'](handleError(_0x51aa8a,null));};exports[_0xddc8('0x24')]=function(_0x54b222,_0x5bc2d8){if(_0x54b222[_0xddc8('0x49')]['id']){delete _0x54b222['body']['id'];}return db[_0xddc8('0x2d')][_0xddc8('0x47')]({'where':{'id':_0x54b222[_0xddc8('0x4a')]['id']}})[_0xddc8('0x25')](handleEntityNotFound(_0x5bc2d8,null))['then'](saveUpdates(_0x54b222[_0xddc8('0x49')],null))[_0xddc8('0x25')](respondWithResult(_0x5bc2d8,null))['catch'](handleError(_0x5bc2d8,null));};exports[_0xddc8('0x26')]=function(_0xac3b85,_0x951889){return db['SalesforceAccount']['find']({'where':{'id':_0xac3b85[_0xddc8('0x4a')]['id']}})[_0xddc8('0x25')](handleEntityNotFound(_0x951889,null))['then'](removeEntity(_0x951889,null))[_0xddc8('0x41')](handleError(_0x951889,null));};exports[_0xddc8('0x4b')]=function(_0x9dfc46,_0x28fa04,_0x52bc19){var _0x5a388b={};var _0x28751f={};var _0x4532d7;var _0x46b47e;return db['SalesforceAccount']['findOne']({'where':{'id':_0x9dfc46[_0xddc8('0x4a')]['id']}})[_0xddc8('0x25')](handleEntityNotFound(_0x28fa04,null))[_0xddc8('0x25')](function(_0x5aef9b){if(_0x5aef9b){_0x4532d7=_0x5aef9b;_0x28751f['model']=_[_0xddc8('0x43')](db[_0xddc8('0x4c')][_0xddc8('0x2e')]);_0x28751f[_0xddc8('0x31')]=_[_0xddc8('0x43')](_0x9dfc46[_0xddc8('0x31')]);_0x28751f[_0xddc8('0x32')]=_['intersection'](_0x28751f['model'],_0x28751f[_0xddc8('0x31')]);_0x5a388b[_0xddc8('0x33')]=_['intersection'](_0x28751f[_0xddc8('0x30')],qs['fields'](_0x9dfc46[_0xddc8('0x31')]['fields']));_0x5a388b[_0xddc8('0x33')]=_0x5a388b[_0xddc8('0x33')][_0xddc8('0x45')]?_0x5a388b[_0xddc8('0x33')]:_0x28751f[_0xddc8('0x30')];_0x5a388b['order']=qs[_0xddc8('0x38')](_0x9dfc46[_0xddc8('0x31')][_0xddc8('0x38')]);_0x5a388b['where']=qs[_0xddc8('0x32')](_[_0xddc8('0x39')](_0x9dfc46['query'],_0x28751f[_0xddc8('0x32')]));if(_0x9dfc46['query'][_0xddc8('0x3a')]){_0x5a388b['where']=_[_0xddc8('0x3c')](_0x5a388b[_0xddc8('0x3b')],{'$or':_[_0xddc8('0x2c')](_0x5a388b[_0xddc8('0x33')],function(_0x448243){var _0x1cd67c={};_0x1cd67c[_0x448243]={'$like':'%'+_0x9dfc46[_0xddc8('0x31')][_0xddc8('0x3a')]+'%'};return _0x1cd67c;})});}_0x5a388b=_[_0xddc8('0x3c')]({},_0x5a388b,_0x9dfc46[_0xddc8('0x3e')]);return _0x4532d7['getConfigurations'](_0x5a388b);}})[_0xddc8('0x25')](function(_0x319b8a){if(_0x319b8a){_0x46b47e=_0x319b8a['length'];if(!_0x9dfc46[_0xddc8('0x31')][_0xddc8('0x35')](_0xddc8('0x36'))){_0x5a388b[_0xddc8('0x1f')]=qs[_0xddc8('0x1f')](_0x9dfc46[_0xddc8('0x31')]['limit']);_0x5a388b['offset']=qs[_0xddc8('0x1d')](_0x9dfc46[_0xddc8('0x31')]['offset']);}return _0x4532d7['getConfigurations'](_0x5a388b);}})['then'](function(_0x178b37){if(_0x178b37){return _0x178b37?{'count':_0x46b47e,'rows':_0x178b37}:null;}})[_0xddc8('0x25')](respondWithResult(_0x28fa04,null))[_0xddc8('0x41')](handleError(_0x28fa04,null));};exports[_0xddc8('0x4d')]=function(_0x47a1b4,_0x277586,_0x1b8eff){if(_0x47a1b4[_0xddc8('0x49')]['id']){delete _0x47a1b4['body']['id'];}return db['SalesforceAccount'][_0xddc8('0x4e')]({'where':{'id':_0x47a1b4[_0xddc8('0x4a')]['id']}})[_0xddc8('0x25')](handleEntityNotFound(_0x277586,null))[_0xddc8('0x25')](function(_0x4c0be1){if(_0x4c0be1){_0x47a1b4[_0xddc8('0x49')][_0xddc8('0x4f')]=_0x4c0be1['id'];_0x47a1b4['body'][_0xddc8('0x50')]=integrations[_0xddc8('0x51')](_0x47a1b4['body'][_0xddc8('0x52')],_0x47a1b4['body'][_0xddc8('0x2f')]);_0x47a1b4['body'][_0xddc8('0x53')]=integrations[_0xddc8('0x54')](_0x47a1b4[_0xddc8('0x49')][_0xddc8('0x52')],_0x47a1b4[_0xddc8('0x49')]['type']);return db['SalesforceConfiguration'][_0xddc8('0x48')](_0x47a1b4[_0xddc8('0x49')],{'include':[{'model':db[_0xddc8('0x55')],'as':_0xddc8('0x50')},{'model':db[_0xddc8('0x55')],'as':_0xddc8('0x53')}]});}return null;})['then'](respondWithResult(_0x277586,null))[_0xddc8('0x41')](handleError(_0x277586,null));};exports[_0xddc8('0x56')]=function(_0x144efd,_0x56b8db,_0x842908){var _0x50f64e;var _0x581f33='';var _0x2b6963=_0xddc8('0x57');return db[_0xddc8('0x2d')][_0xddc8('0x4e')]({'where':{'id':_0x144efd[_0xddc8('0x4a')]['id']},'attributes':['id',_0xddc8('0x58'),_0xddc8('0x59'),_0xddc8('0x5a'),_0xddc8('0x5b'),_0xddc8('0x5c'),_0xddc8('0x5d')]})[_0xddc8('0x25')](handleEntityNotFound(_0x56b8db,null))[_0xddc8('0x25')](function(_0x92ac9){if(_0x92ac9){_0x581f33=_0x92ac9[_0xddc8('0x58')];var _0x5ea73f=_0x581f33[_0xddc8('0x5e')](-0x1);if(_0x5ea73f==='/'){_0x581f33=_0x581f33[_0xddc8('0x5f')](0x0,_0x581f33[_0xddc8('0x60')](_0x5ea73f));}_0x50f64e=new jsforce['Connection']({'oauth2':{'loginUrl':_0x581f33,'clientId':_0x92ac9['clientId'],'clientSecret':_0x92ac9[_0xddc8('0x5a')]}});return _0x50f64e[_0xddc8('0x61')](_0x92ac9[_0xddc8('0x5b')],_0x92ac9[_0xddc8('0x5c')][_0xddc8('0x62')](_0x92ac9[_0xddc8('0x5d')]));}})[_0xddc8('0x25')](function(_0x4b8b3d){if(_0x4b8b3d){if(!_[_0xddc8('0x63')](_0x144efd[_0xddc8('0x31')][_0xddc8('0x64')])){_0x2b6963=_0x144efd[_0xddc8('0x31')][_0xddc8('0x64')];}return _0x50f64e[_0xddc8('0x65')](_0x2b6963)[_0xddc8('0x66')]();}})[_0xddc8('0x25')](function(_0x1fc20d){var _0x501b98=[_0xddc8('0x67'),_0xddc8('0x68'),_0xddc8('0x69'),_0xddc8('0x6a'),_0xddc8('0x6b'),'Description'];var _0x5c9277=['string',_0xddc8('0x6c'),_0xddc8('0x6d'),_0xddc8('0x6e'),_0xddc8('0x6f'),'textarea',_0xddc8('0x70')];if(_0x1fc20d){_[_0xddc8('0x71')](_0x1fc20d[_0xddc8('0x44')],function(_0x4c8dde){return _0x501b98[_0xddc8('0x72')](_0x4c8dde[_0xddc8('0x29')])||!_0x5c9277[_0xddc8('0x72')](_0x4c8dde['type']);});return{'count':_0x1fc20d[_0xddc8('0x44')]['length'],'rows':_['map'](_0x1fc20d[_0xddc8('0x44')],function(_0x5356d0){return{'id':_0x5356d0[_0xddc8('0x29')],'name':_0x5356d0[_0xddc8('0x73')],'custom':_0x5356d0['custom'],'options':_0x5356d0[_0xddc8('0x74')]['length']>0x0?_[_0xddc8('0x2c')](_0x5356d0['picklistValues'],function(_0x31d1b8){return{'name':_0x31d1b8[_0xddc8('0x73')],'value':_0x31d1b8[_0xddc8('0x75')]};}):_0x5356d0[_0xddc8('0x2f')]==_0xddc8('0x6e')?[{'name':_0xddc8('0x76'),'value':_0xddc8('0x77')},{'name':_0xddc8('0x78'),'value':_0xddc8('0x79')}]:[]};})};}})[_0xddc8('0x25')](respondWithResult(_0x56b8db,null))[_0xddc8('0x41')](function(_0xad5222){var _0x922d80=_0x144efd[_0xddc8('0x31')][_0xddc8('0x7a')]?0x1f4:_0xad5222[_0xddc8('0x7b')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xddc8('0x56'),_0x922d80,JSON[_0xddc8('0x7c')](_0xad5222));delete _0xad5222['name'];if(_0x922d80===0x191){_0x922d80=0x190;}_0x56b8db[_0xddc8('0x1b')](_0x922d80)[_0xddc8('0x2a')](_0x144efd[_0xddc8('0x31')][_0xddc8('0x7a')]?{'message':'Wrong\x20credentials','statusCode':_0xad5222[_0xddc8('0x7b')]}:_0xad5222);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 23dda72..54c898d 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 _0x9d5b=['./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','lodash','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0x141059,_0x28b63a){var _0x39b04b=function(_0x335c48){while(--_0x335c48){_0x141059['push'](_0x141059['shift']());}};_0x39b04b(++_0x28b63a);}(_0x9d5b,0x71));var _0xb9d5=function(_0x33f54e,_0x16d011){_0x33f54e=_0x33f54e-0x0;var _0x4bc325=_0x9d5b[_0x33f54e];return _0x4bc325;};'use strict';var _=require(_0xb9d5('0x0'));var util=require('util');var logger=require(_0xb9d5('0x1'))(_0xb9d5('0x2'));var moment=require(_0xb9d5('0x3'));var BPromise=require('bluebird');var rp=require(_0xb9d5('0x4'));var fs=require('fs');var path=require(_0xb9d5('0x5'));var rimraf=require('rimraf');var config=require(_0xb9d5('0x6'));var attributes=require(_0xb9d5('0x7'));var integrations=require(_0xb9d5('0x8'));module[_0xb9d5('0x9')]=function(_0x858576,_0x30cd32){return _0x858576[_0xb9d5('0xa')](_0xb9d5('0xb'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x80cb=['bluebird','request-promise','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x2265da,_0xfbbd2e){var _0x430c2b=function(_0x20d671){while(--_0x20d671){_0x2265da['push'](_0x2265da['shift']());}};_0x430c2b(++_0xfbbd2e);}(_0x80cb,0x193));var _0xb80c=function(_0x42c3ea,_0x2cae04){_0x42c3ea=_0x42c3ea-0x0;var _0x294a04=_0x80cb[_0x42c3ea];return _0x294a04;};'use strict';var _=require(_0xb80c('0x0'));var util=require(_0xb80c('0x1'));var logger=require(_0xb80c('0x2'))(_0xb80c('0x3'));var moment=require(_0xb80c('0x4'));var BPromise=require(_0xb80c('0x5'));var rp=require(_0xb80c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb80c('0x7'));var integrations=require(_0xb80c('0x8'));module[_0xb80c('0x9')]=function(_0x4a7bf4,_0x66e8c1){return _0x4a7bf4['define'](_0xb80c('0xa'),attributes,{'tableName':_0xb80c('0xb'),'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 6588009..a443644 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 _0x52a0=['then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','attributes','limit','map','include','model','debug','find','ShowSalesforceAccount','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x8767ff,_0x3edcb1){var _0x127f02=function(_0x452595){while(--_0x452595){_0x8767ff['push'](_0x8767ff['shift']());}};_0x127f02(++_0x3edcb1);}(_0x52a0,0x149));var _0x052a=function(_0x1d0cba,_0x2731b1){_0x1d0cba=_0x1d0cba-0x0;var _0xdc3278=_0x52a0[_0x1d0cba];return _0xdc3278;};'use strict';var _=require(_0x052a('0x0'));var util=require(_0x052a('0x1'));var moment=require(_0x052a('0x2'));var BPromise=require(_0x052a('0x3'));var rs=require(_0x052a('0x4'));var fs=require('fs');var Redis=require(_0x052a('0x5'));var db=require(_0x052a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x052a('0x7'))(_0x052a('0x8'));var config=require('../../config/environment');var jayson=require(_0x052a('0x9'));var client=jayson[_0x052a('0xa')][_0x052a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3be434,_0x4959ec,_0x218e70){return new BPromise(function(_0x2d3f74,_0x5b9344){return client[_0x052a('0xc')](_0x3be434,_0x218e70)[_0x052a('0xd')](function(_0x35c5f5){logger[_0x052a('0xe')](_0x052a('0xf'),_0x4959ec,_0x052a('0x10'));logger['debug'](_0x052a('0x11'),_0x4959ec,_0x052a('0x10'),JSON[_0x052a('0x12')](_0x35c5f5));if(_0x35c5f5[_0x052a('0x13')]){if(_0x35c5f5['error'][_0x052a('0x14')]===0x1f4){logger['error'](_0x052a('0xf'),_0x4959ec,_0x35c5f5[_0x052a('0x13')]['message']);return _0x5b9344(_0x35c5f5[_0x052a('0x13')]['message']);}logger[_0x052a('0x13')](_0x052a('0xf'),_0x4959ec,_0x35c5f5[_0x052a('0x13')][_0x052a('0x15')]);return _0x2d3f74(_0x35c5f5[_0x052a('0x13')]['message']);}else{logger[_0x052a('0xe')](_0x052a('0xf'),_0x4959ec,_0x052a('0x10'));_0x2d3f74(_0x35c5f5[_0x052a('0x16')][_0x052a('0x15')]);}})['catch'](function(_0x1fa9c2){logger[_0x052a('0x13')](_0x052a('0xf'),_0x4959ec,_0x1fa9c2);_0x5b9344(_0x1fa9c2);});});}exports[_0x052a('0x17')]=function(_0x40cf88){var _0xc0b85=this;return new Promise(function(_0x597eb2,_0x1ac500){return db[_0x052a('0x18')][_0x052a('0x19')]({'raw':_0x40cf88[_0x052a('0x1a')]?_0x40cf88['options'][_0x052a('0x1b')]===undefined?!![]:![]:!![],'where':_0x40cf88['options']?_0x40cf88[_0x052a('0x1a')][_0x052a('0x1c')]||null:null,'attributes':_0x40cf88['options']?_0x40cf88[_0x052a('0x1a')][_0x052a('0x1d')]||null:null,'limit':_0x40cf88[_0x052a('0x1a')]?_0x40cf88[_0x052a('0x1a')][_0x052a('0x1e')]||null:null,'include':_0x40cf88['options']?_0x40cf88[_0x052a('0x1a')]['include']?_[_0x052a('0x1f')](_0x40cf88[_0x052a('0x1a')][_0x052a('0x20')],function(_0x42b319){return{'model':db[_0x42b319[_0x052a('0x21')]],'as':_0x42b319['as'],'attributes':_0x42b319[_0x052a('0x1d')],'include':_0x42b319[_0x052a('0x20')]?_[_0x052a('0x1f')](_0x42b319[_0x052a('0x20')],function(_0x406f2c){return{'model':db[_0x406f2c[_0x052a('0x21')]],'as':_0x406f2c['as'],'attributes':_0x406f2c[_0x052a('0x1d')],'include':_0x406f2c[_0x052a('0x20')]?_[_0x052a('0x1f')](_0x406f2c[_0x052a('0x20')],function(_0x303f87){return{'model':db[_0x303f87[_0x052a('0x21')]],'as':_0x303f87['as'],'attributes':_0x303f87['attributes']};}):[]};}):[]};}):[]:[]})[_0x052a('0xd')](function(_0x4dd989){logger[_0x052a('0xe')](_0x052a('0x17'),_0x40cf88);logger[_0x052a('0x22')](_0x052a('0x17'),_0x40cf88,JSON[_0x052a('0x12')](_0x4dd989));_0x597eb2(_0x4dd989);})['catch'](function(_0x5d9576){logger[_0x052a('0x13')](_0x052a('0x17'),_0x5d9576[_0x052a('0x15')],_0x40cf88);_0x1ac500(_0xc0b85[_0x052a('0x13')](0x1f4,_0x5d9576['message']));});});};exports['ShowSalesforceAccount']=function(_0x460fed){var _0x192296=this;return new Promise(function(_0x206807,_0x133470){return db[_0x052a('0x18')][_0x052a('0x23')]({'raw':_0x460fed[_0x052a('0x1a')]?_0x460fed['options'][_0x052a('0x1b')]===undefined?!![]:![]:!![],'where':_0x460fed[_0x052a('0x1a')]?_0x460fed[_0x052a('0x1a')]['where']||null:null,'attributes':_0x460fed['options']?_0x460fed['options']['attributes']||null:null,'include':_0x460fed[_0x052a('0x1a')]?_0x460fed[_0x052a('0x1a')][_0x052a('0x20')]?_[_0x052a('0x1f')](_0x460fed[_0x052a('0x1a')][_0x052a('0x20')],function(_0x1183b4){return{'model':db[_0x1183b4[_0x052a('0x21')]],'as':_0x1183b4['as'],'attributes':_0x1183b4[_0x052a('0x1d')],'include':_0x1183b4[_0x052a('0x20')]?_['map'](_0x1183b4[_0x052a('0x20')],function(_0x34c161){return{'model':db[_0x34c161[_0x052a('0x21')]],'as':_0x34c161['as'],'attributes':_0x34c161[_0x052a('0x1d')],'include':_0x34c161[_0x052a('0x20')]?_[_0x052a('0x1f')](_0x34c161['include'],function(_0x365f94){return{'model':db[_0x365f94['model']],'as':_0x365f94['as'],'attributes':_0x365f94[_0x052a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x052a('0xd')](function(_0x4cd6c8){logger[_0x052a('0xe')](_0x052a('0x24'),_0x460fed);logger[_0x052a('0x22')](_0x052a('0x24'),_0x460fed,JSON[_0x052a('0x12')](_0x4cd6c8));_0x206807(_0x4cd6c8);})[_0x052a('0x25')](function(_0x3daa81){logger[_0x052a('0x13')](_0x052a('0x24'),_0x3daa81[_0x052a('0x15')],_0x460fed);_0x133470(_0x192296['error'](0x1f4,_0x3daa81[_0x052a('0x15')]));});});}; \ No newline at end of file +var _0xb8d5=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','include','model','attributes','map','stringify','ShowSalesforceAccount','find','lodash','util','moment','bluebird'];(function(_0x210c37,_0x2a57ae){var _0x4e5086=function(_0x4c548f){while(--_0x4c548f){_0x210c37['push'](_0x210c37['shift']());}};_0x4e5086(++_0x2a57ae);}(_0xb8d5,0xd4));var _0x5b8d=function(_0x537ae5,_0x49e49c){_0x537ae5=_0x537ae5-0x0;var _0x2b342b=_0xb8d5[_0x537ae5];return _0x2b342b;};'use strict';var _=require(_0x5b8d('0x0'));var util=require(_0x5b8d('0x1'));var moment=require(_0x5b8d('0x2'));var BPromise=require(_0x5b8d('0x3'));var rs=require(_0x5b8d('0x4'));var fs=require('fs');var Redis=require(_0x5b8d('0x5'));var db=require(_0x5b8d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5b8d('0x7'))(_0x5b8d('0x8'));var config=require(_0x5b8d('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5b8d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40b3f0,_0x5c6afd,_0x1cd5e2){return new BPromise(function(_0x2c8d80,_0x19d3c1){return client[_0x5b8d('0xb')](_0x40b3f0,_0x1cd5e2)[_0x5b8d('0xc')](function(_0x2fc1ff){logger['info'](_0x5b8d('0xd'),_0x5c6afd,'request\x20sent');logger[_0x5b8d('0xe')](_0x5b8d('0xf'),_0x5c6afd,_0x5b8d('0x10'),JSON['stringify'](_0x2fc1ff));if(_0x2fc1ff[_0x5b8d('0x11')]){if(_0x2fc1ff[_0x5b8d('0x11')][_0x5b8d('0x12')]===0x1f4){logger[_0x5b8d('0x11')](_0x5b8d('0xd'),_0x5c6afd,_0x2fc1ff['error'][_0x5b8d('0x13')]);return _0x19d3c1(_0x2fc1ff[_0x5b8d('0x11')][_0x5b8d('0x13')]);}logger['error'](_0x5b8d('0xd'),_0x5c6afd,_0x2fc1ff[_0x5b8d('0x11')][_0x5b8d('0x13')]);return _0x2c8d80(_0x2fc1ff[_0x5b8d('0x11')][_0x5b8d('0x13')]);}else{logger[_0x5b8d('0x14')](_0x5b8d('0xd'),_0x5c6afd,_0x5b8d('0x10'));_0x2c8d80(_0x2fc1ff[_0x5b8d('0x15')][_0x5b8d('0x13')]);}})[_0x5b8d('0x16')](function(_0x3bda36){logger['error'](_0x5b8d('0xd'),_0x5c6afd,_0x3bda36);_0x19d3c1(_0x3bda36);});});}exports[_0x5b8d('0x17')]=function(_0x256f7a){var _0x356e00=this;return new Promise(function(_0x14c5b6,_0x5a416b){return db[_0x5b8d('0x18')][_0x5b8d('0x19')]({'raw':_0x256f7a[_0x5b8d('0x1a')]?_0x256f7a[_0x5b8d('0x1a')][_0x5b8d('0x1b')]===undefined?!![]:![]:!![],'where':_0x256f7a['options']?_0x256f7a[_0x5b8d('0x1a')][_0x5b8d('0x1c')]||null:null,'attributes':_0x256f7a[_0x5b8d('0x1a')]?_0x256f7a[_0x5b8d('0x1a')]['attributes']||null:null,'limit':_0x256f7a[_0x5b8d('0x1a')]?_0x256f7a['options']['limit']||null:null,'include':_0x256f7a[_0x5b8d('0x1a')]?_0x256f7a[_0x5b8d('0x1a')][_0x5b8d('0x1d')]?_['map'](_0x256f7a[_0x5b8d('0x1a')]['include'],function(_0x53158b){return{'model':db[_0x53158b[_0x5b8d('0x1e')]],'as':_0x53158b['as'],'attributes':_0x53158b[_0x5b8d('0x1f')],'include':_0x53158b[_0x5b8d('0x1d')]?_[_0x5b8d('0x20')](_0x53158b[_0x5b8d('0x1d')],function(_0x18c6de){return{'model':db[_0x18c6de['model']],'as':_0x18c6de['as'],'attributes':_0x18c6de[_0x5b8d('0x1f')],'include':_0x18c6de[_0x5b8d('0x1d')]?_[_0x5b8d('0x20')](_0x18c6de[_0x5b8d('0x1d')],function(_0x30877c){return{'model':db[_0x30877c['model']],'as':_0x30877c['as'],'attributes':_0x30877c['attributes']};}):[]};}):[]};}):[]:[]})[_0x5b8d('0xc')](function(_0x2938ac){logger[_0x5b8d('0x14')]('GetSalesforceAccount',_0x256f7a);logger['debug']('GetSalesforceAccount',_0x256f7a,JSON[_0x5b8d('0x21')](_0x2938ac));_0x14c5b6(_0x2938ac);})[_0x5b8d('0x16')](function(_0x18b94c){logger[_0x5b8d('0x11')](_0x5b8d('0x17'),_0x18b94c[_0x5b8d('0x13')],_0x256f7a);_0x5a416b(_0x356e00[_0x5b8d('0x11')](0x1f4,_0x18b94c[_0x5b8d('0x13')]));});});};exports[_0x5b8d('0x22')]=function(_0x5eab01){var _0x4e80e3=this;return new Promise(function(_0x16d1be,_0xbaf1c7){return db[_0x5b8d('0x18')][_0x5b8d('0x23')]({'raw':_0x5eab01[_0x5b8d('0x1a')]?_0x5eab01[_0x5b8d('0x1a')][_0x5b8d('0x1b')]===undefined?!![]:![]:!![],'where':_0x5eab01[_0x5b8d('0x1a')]?_0x5eab01[_0x5b8d('0x1a')][_0x5b8d('0x1c')]||null:null,'attributes':_0x5eab01[_0x5b8d('0x1a')]?_0x5eab01[_0x5b8d('0x1a')][_0x5b8d('0x1f')]||null:null,'include':_0x5eab01[_0x5b8d('0x1a')]?_0x5eab01[_0x5b8d('0x1a')][_0x5b8d('0x1d')]?_[_0x5b8d('0x20')](_0x5eab01[_0x5b8d('0x1a')]['include'],function(_0x47b6db){return{'model':db[_0x47b6db[_0x5b8d('0x1e')]],'as':_0x47b6db['as'],'attributes':_0x47b6db[_0x5b8d('0x1f')],'include':_0x47b6db[_0x5b8d('0x1d')]?_[_0x5b8d('0x20')](_0x47b6db[_0x5b8d('0x1d')],function(_0xbc649f){return{'model':db[_0xbc649f[_0x5b8d('0x1e')]],'as':_0xbc649f['as'],'attributes':_0xbc649f[_0x5b8d('0x1f')],'include':_0xbc649f['include']?_['map'](_0xbc649f[_0x5b8d('0x1d')],function(_0x69d127){return{'model':db[_0x69d127[_0x5b8d('0x1e')]],'as':_0x69d127['as'],'attributes':_0x69d127['attributes']};}):[]};}):[]};}):[]:[]})[_0x5b8d('0xc')](function(_0x5267c8){logger[_0x5b8d('0x14')]('ShowSalesforceAccount',_0x5eab01);logger['debug'](_0x5b8d('0x22'),_0x5eab01,JSON[_0x5b8d('0x21')](_0x5267c8));_0x16d1be(_0x5267c8);})['catch'](function(_0x554284){logger[_0x5b8d('0x11')](_0x5b8d('0x22'),_0x554284[_0x5b8d('0x13')],_0x5eab01);_0xbaf1c7(_0x4e80e3[_0x5b8d('0x11')](0x1f4,_0x554284[_0x5b8d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 9574017..4dd427e 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 _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0xdb28,0x106));var _0x8db2=function(_0x4a0f2d,_0x4d0db2){_0x4a0f2d=_0x4a0f2d-0x0;var _0x1bc076=_0xdb28[_0x4a0f2d];return _0x1bc076;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router; \ No newline at end of file +var _0x5f2f=['Router','fs-extra','../../components/auth/service','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x347a89,_0x404b6b){var _0x95fa17=function(_0x1510db){while(--_0x1510db){_0x347a89['push'](_0x347a89['shift']());}};_0x95fa17(++_0x404b6b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x203d59,_0x37cbc6){_0x203d59=_0x203d59-0x0;var _0x27909c=_0x5f2f[_0x203d59];return _0x27909c;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x9')](_0xf5f2('0x10'),auth['isAuthenticated'](),controller[_0xf5f2('0x11')]);router['get']('/:id/descriptions',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x12')]);router['post']('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x13')]);router[_0xf5f2('0x14')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x15')]);router['delete'](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x16')]);module[_0xf5f2('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 3d88ff9..22388b2 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 _0x3301=['ENUM','nothing','sequelize','STRING','Case','contact_lead','contact','lead','account'];(function(_0x2aff5b,_0x1828b2){var _0x39cd48=function(_0x5099c6){while(--_0x5099c6){_0x2aff5b['push'](_0x2aff5b['shift']());}};_0x39cd48(++_0x1828b2);}(_0x3301,0x1b2));var _0x1330=function(_0x139b63,_0x389ca8){_0x139b63=_0x139b63-0x0;var _0x2493f2=_0x3301[_0x139b63];return _0x2493f2;};'use strict';var Sequelize=require(_0x1330('0x0'));module['exports']={'name':{'type':Sequelize[_0x1330('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize['ENUM']('Task',_0x1330('0x2')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize['ENUM'](_0x1330('0x3'),_0x1330('0x4'),_0x1330('0x5'),'account_contact_lead',_0x1330('0x6')),'defaultValue':_0x1330('0x3')},'moduleCreate':{'type':Sequelize[_0x1330('0x7')](_0x1330('0x8'),'contact','lead',_0x1330('0x6')),'defaultValue':_0x1330('0x5')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0x1330('0x1')]},'additionalSearchContact':{'type':Sequelize[_0x1330('0x1')]},'additionalSearchLead':{'type':Sequelize[_0x1330('0x1')]}}; \ No newline at end of file +var _0x892f=['ENUM','nothing','account','sequelize','exports','STRING','Task','Case','contact_lead','contact','lead'];(function(_0x145b3c,_0x31ea4a){var _0x1b6e36=function(_0xfccee6){while(--_0xfccee6){_0x145b3c['push'](_0x145b3c['shift']());}};_0x1b6e36(++_0x31ea4a);}(_0x892f,0x1f2));var _0xf892=function(_0x270288,_0x19f092){_0x270288=_0x270288-0x0;var _0x4e7f9f=_0x892f[_0x270288];return _0x4e7f9f;};'use strict';var Sequelize=require(_0xf892('0x0'));module[_0xf892('0x1')]={'name':{'type':Sequelize[_0xf892('0x2')]},'description':{'type':Sequelize[_0xf892('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0xf892('0x3'),_0xf892('0x4')),'defaultValue':_0xf892('0x3')},'moduleSearch':{'type':Sequelize['ENUM'](_0xf892('0x5'),_0xf892('0x6'),_0xf892('0x7'),'account_contact_lead','account'),'defaultValue':_0xf892('0x5')},'moduleCreate':{'type':Sequelize[_0xf892('0x8')](_0xf892('0x9'),_0xf892('0x6'),'lead',_0xf892('0xa')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0xf892('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0xf892('0x2')]},'additionalSearchContact':{'type':Sequelize[_0xf892('0x2')]},'additionalSearchLead':{'type':Sequelize[_0xf892('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 617782a..e0c7248 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 _0xcfa1=['name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','options','includeAll','include','rows','catch','show','params','create','body','find','getFields','findOne','SalesforceField','pick','filter','getSubjects','getDescriptions','eml-format','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','jsforce','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack'];(function(_0x4ca15a,_0x497f78){var _0x4260ef=function(_0x44ee7b){while(--_0x44ee7b){_0x4ca15a['push'](_0x4ca15a['shift']());}};_0x4260ef(++_0x497f78);}(_0xcfa1,0xbe));var _0x1cfa=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xcfa1[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x1cfa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1cfa('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1cfa('0x2'));var BPromise=require(_0x1cfa('0x3'));var Mustache=require(_0x1cfa('0x4'));var util=require(_0x1cfa('0x5'));var path=require(_0x1cfa('0x6'));var sox=require('sox');var csv=require(_0x1cfa('0x7'));var ejs=require(_0x1cfa('0x8'));var fs=require('fs');var fs_extra=require(_0x1cfa('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1cfa('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x1cfa('0x7'));var querystring=require(_0x1cfa('0xb'));var Papa=require(_0x1cfa('0xc'));var Redis=require('ioredis');var authService=require(_0x1cfa('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1cfa('0xe'))(_0x1cfa('0xf'));var utils=require(_0x1cfa('0x10'));var config=require(_0x1cfa('0x11'));var licenseUtil=require(_0x1cfa('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4524f0,_0x3a9bae){_0x3a9bae=_0x3a9bae||0xcc;return function(_0x10e950){if(_0x10e950){return _0x4524f0[_0x1cfa('0x13')](_0x3a9bae);}return _0x4524f0[_0x1cfa('0x14')](_0x3a9bae)[_0x1cfa('0x15')]();};}function respondWithResult(_0xf709fa,_0x79c58){_0x79c58=_0x79c58||0xc8;return function(_0x100b6b){if(_0x100b6b){return _0xf709fa['status'](_0x79c58)['json'](_0x100b6b);}};}function respondWithFilteredResult(_0x12cc32,_0x181bb5){return function(_0x5452cb){if(_0x5452cb){var _0x963ee8=typeof _0x181bb5[_0x1cfa('0x16')]===_0x1cfa('0x17')&&typeof _0x181bb5['limit']===_0x1cfa('0x17');var _0xdfe146=_0x5452cb['count'];var _0x299179=_0x963ee8?0x0:_0x181bb5[_0x1cfa('0x16')];var _0x37c263=_0x963ee8?_0x5452cb[_0x1cfa('0x18')]:_0x181bb5['offset']+_0x181bb5[_0x1cfa('0x19')];var _0x11a679;if(_0x37c263>=_0xdfe146){_0x37c263=_0xdfe146;_0x11a679=0xc8;}else{_0x11a679=0xce;}_0x12cc32[_0x1cfa('0x14')](_0x11a679);return _0x12cc32[_0x1cfa('0x1a')](_0x1cfa('0x1b'),_0x299179+'-'+_0x37c263+'/'+_0xdfe146)['json'](_0x5452cb);}return null;};}function patchUpdates(_0x4525e8){return function(_0x3099a){try{jsonpatch['apply'](_0x3099a,_0x4525e8,!![]);}catch(_0x24956b){return BPromise[_0x1cfa('0x1c')](_0x24956b);}return _0x3099a[_0x1cfa('0x1d')]();};}function saveUpdates(_0x7657c5,_0x4fa903){return function(_0x1aa87e){if(_0x1aa87e){return _0x1aa87e[_0x1cfa('0x1e')](_0x7657c5)[_0x1cfa('0x1f')](function(_0x135cff){return _0x135cff;});}return null;};}function removeEntity(_0xe8f3de,_0x45f407){return function(_0x5b9cd6){if(_0x5b9cd6){return _0x5b9cd6[_0x1cfa('0x20')]()[_0x1cfa('0x1f')](function(){_0xe8f3de['status'](0xcc)[_0x1cfa('0x15')]();});}};}function handleEntityNotFound(_0x1b0570,_0x12895c){return function(_0x2d9c6d){if(!_0x2d9c6d){_0x1b0570[_0x1cfa('0x13')](0x194);}return _0x2d9c6d;};}function handleError(_0x201b23,_0x3f566f){_0x3f566f=_0x3f566f||0x1f4;return function(_0x3c064e){logger[_0x1cfa('0x21')](_0x3c064e[_0x1cfa('0x22')]);if(_0x3c064e[_0x1cfa('0x23')]){delete _0x3c064e[_0x1cfa('0x23')];}_0x201b23['status'](_0x3f566f)[_0x1cfa('0x24')](_0x3c064e);};}exports[_0x1cfa('0x25')]=function(_0x4ac5a5,_0x5596d1){var _0x2a4917={},_0x284f24={},_0x4b085b={'count':0x0,'rows':[]};var _0xce569=_[_0x1cfa('0x26')](db[_0x1cfa('0x27')][_0x1cfa('0x28')],function(_0x788cc3){return{'name':_0x788cc3[_0x1cfa('0x29')],'type':_0x788cc3['type'][_0x1cfa('0x2a')]};});_0x284f24[_0x1cfa('0x2b')]=_[_0x1cfa('0x26')](_0xce569,'name');_0x284f24[_0x1cfa('0x2c')]=_[_0x1cfa('0x2d')](_0x4ac5a5['query']);_0x284f24[_0x1cfa('0x2e')]=_[_0x1cfa('0x2f')](_0x284f24[_0x1cfa('0x2b')],_0x284f24[_0x1cfa('0x2c')]);_0x2a4917[_0x1cfa('0x30')]=_[_0x1cfa('0x2f')](_0x284f24['model'],qs[_0x1cfa('0x31')](_0x4ac5a5[_0x1cfa('0x2c')][_0x1cfa('0x31')]));_0x2a4917[_0x1cfa('0x30')]=_0x2a4917['attributes'][_0x1cfa('0x32')]?_0x2a4917['attributes']:_0x284f24['model'];if(!_0x4ac5a5[_0x1cfa('0x2c')][_0x1cfa('0x33')](_0x1cfa('0x34'))){_0x2a4917[_0x1cfa('0x19')]=qs['limit'](_0x4ac5a5[_0x1cfa('0x2c')][_0x1cfa('0x19')]);_0x2a4917[_0x1cfa('0x16')]=qs[_0x1cfa('0x16')](_0x4ac5a5[_0x1cfa('0x2c')][_0x1cfa('0x16')]);}_0x2a4917[_0x1cfa('0x35')]=qs[_0x1cfa('0x36')](_0x4ac5a5[_0x1cfa('0x2c')][_0x1cfa('0x36')]);_0x2a4917['where']=qs[_0x1cfa('0x2e')](_['pick'](_0x4ac5a5[_0x1cfa('0x2c')],_0x284f24[_0x1cfa('0x2e')]),_0xce569);if(_0x4ac5a5['query']['filter']){_0x2a4917[_0x1cfa('0x37')]=_[_0x1cfa('0x38')](_0x2a4917[_0x1cfa('0x37')],{'$or':_[_0x1cfa('0x26')](_0xce569,function(_0x28aa9f){if(_0x28aa9f[_0x1cfa('0x39')]!=='VIRTUAL'){var _0x5750ee={};_0x5750ee[_0x28aa9f['name']]={'$like':'%'+_0x4ac5a5[_0x1cfa('0x2c')]['filter']+'%'};return _0x5750ee;}})});}_0x2a4917=_[_0x1cfa('0x38')]({},_0x2a4917,_0x4ac5a5[_0x1cfa('0x3a')]);var _0x5b0a2e={'where':_0x2a4917['where']};return db['SalesforceConfiguration'][_0x1cfa('0x18')](_0x5b0a2e)[_0x1cfa('0x1f')](function(_0x2e09aa){_0x4b085b[_0x1cfa('0x18')]=_0x2e09aa;if(_0x4ac5a5[_0x1cfa('0x2c')][_0x1cfa('0x3b')]){_0x2a4917[_0x1cfa('0x3c')]=[{'all':!![]}];}return db['SalesforceConfiguration']['findAll'](_0x2a4917);})[_0x1cfa('0x1f')](function(_0x3d604e){_0x4b085b[_0x1cfa('0x3d')]=_0x3d604e;return _0x4b085b;})[_0x1cfa('0x1f')](respondWithFilteredResult(_0x5596d1,_0x2a4917))[_0x1cfa('0x3e')](handleError(_0x5596d1,null));};exports[_0x1cfa('0x3f')]=function(_0x1e1d27,_0x2fd524){var _0xfbcb06={'raw':![],'where':{'id':_0x1e1d27[_0x1cfa('0x40')]['id']}},_0x434330={};_0x434330[_0x1cfa('0x2b')]=_[_0x1cfa('0x2d')](db['SalesforceConfiguration'][_0x1cfa('0x28')]);_0x434330['query']=_[_0x1cfa('0x2d')](_0x1e1d27[_0x1cfa('0x2c')]);_0x434330['filters']=_[_0x1cfa('0x2f')](_0x434330[_0x1cfa('0x2b')],_0x434330[_0x1cfa('0x2c')]);_0xfbcb06['attributes']=_['intersection'](_0x434330[_0x1cfa('0x2b')],qs['fields'](_0x1e1d27[_0x1cfa('0x2c')][_0x1cfa('0x31')]));_0xfbcb06[_0x1cfa('0x30')]=_0xfbcb06[_0x1cfa('0x30')]['length']?_0xfbcb06['attributes']:_0x434330['model'];if(_0x1e1d27['query'][_0x1cfa('0x3b')]){_0xfbcb06[_0x1cfa('0x3c')]=[{'all':!![]}];}_0xfbcb06=_[_0x1cfa('0x38')]({},_0xfbcb06,_0x1e1d27[_0x1cfa('0x3a')]);return db['SalesforceConfiguration']['find'](_0xfbcb06)['then'](handleEntityNotFound(_0x2fd524,null))[_0x1cfa('0x1f')](respondWithResult(_0x2fd524,null))[_0x1cfa('0x3e')](handleError(_0x2fd524,null));};exports[_0x1cfa('0x41')]=function(_0x492c54,_0x5c7510){return db[_0x1cfa('0x27')]['create'](_0x492c54['body'],{})[_0x1cfa('0x1f')](respondWithResult(_0x5c7510,0xc9))[_0x1cfa('0x3e')](handleError(_0x5c7510,null));};exports[_0x1cfa('0x1e')]=function(_0x3f2c94,_0x11b67e){if(_0x3f2c94[_0x1cfa('0x42')]['id']){delete _0x3f2c94[_0x1cfa('0x42')]['id'];}return db[_0x1cfa('0x27')]['find']({'where':{'id':_0x3f2c94[_0x1cfa('0x40')]['id']}})[_0x1cfa('0x1f')](handleEntityNotFound(_0x11b67e,null))[_0x1cfa('0x1f')](saveUpdates(_0x3f2c94[_0x1cfa('0x42')],null))[_0x1cfa('0x1f')](respondWithResult(_0x11b67e,null))[_0x1cfa('0x3e')](handleError(_0x11b67e,null));};exports[_0x1cfa('0x20')]=function(_0x52c5bf,_0x3f4cab){return db['SalesforceConfiguration'][_0x1cfa('0x43')]({'where':{'id':_0x52c5bf[_0x1cfa('0x40')]['id']}})[_0x1cfa('0x1f')](handleEntityNotFound(_0x3f4cab,null))['then'](removeEntity(_0x3f4cab,null))['catch'](handleError(_0x3f4cab,null));};exports[_0x1cfa('0x44')]=function(_0x5d22f4,_0x174d8b,_0x36e167){var _0x44a342={};var _0x12b20b={};var _0x4362d1;var _0xf1a50b;return db[_0x1cfa('0x27')][_0x1cfa('0x45')]({'where':{'id':_0x5d22f4[_0x1cfa('0x40')]['id']}})[_0x1cfa('0x1f')](handleEntityNotFound(_0x174d8b,null))[_0x1cfa('0x1f')](function(_0x384c3b){if(_0x384c3b){_0x4362d1=_0x384c3b;_0x12b20b[_0x1cfa('0x2b')]=_[_0x1cfa('0x2d')](db[_0x1cfa('0x46')][_0x1cfa('0x28')]);_0x12b20b[_0x1cfa('0x2c')]=_[_0x1cfa('0x2d')](_0x5d22f4[_0x1cfa('0x2c')]);_0x12b20b[_0x1cfa('0x2e')]=_['intersection'](_0x12b20b['model'],_0x12b20b['query']);_0x44a342[_0x1cfa('0x30')]=_[_0x1cfa('0x2f')](_0x12b20b[_0x1cfa('0x2b')],qs['fields'](_0x5d22f4[_0x1cfa('0x2c')]['fields']));_0x44a342[_0x1cfa('0x30')]=_0x44a342[_0x1cfa('0x30')]['length']?_0x44a342[_0x1cfa('0x30')]:_0x12b20b[_0x1cfa('0x2b')];_0x44a342[_0x1cfa('0x35')]=qs[_0x1cfa('0x36')](_0x5d22f4[_0x1cfa('0x2c')][_0x1cfa('0x36')]);_0x44a342[_0x1cfa('0x37')]=qs[_0x1cfa('0x2e')](_[_0x1cfa('0x47')](_0x5d22f4[_0x1cfa('0x2c')],_0x12b20b[_0x1cfa('0x2e')]));if(_0x5d22f4[_0x1cfa('0x2c')]['filter']){_0x44a342[_0x1cfa('0x37')]=_[_0x1cfa('0x38')](_0x44a342['where'],{'$or':_['map'](_0x44a342[_0x1cfa('0x30')],function(_0x49ba83){var _0x26a2e2={};_0x26a2e2[_0x49ba83]={'$like':'%'+_0x5d22f4[_0x1cfa('0x2c')][_0x1cfa('0x48')]+'%'};return _0x26a2e2;})});}_0x44a342=_[_0x1cfa('0x38')]({},_0x44a342,_0x5d22f4['options']);return _0x4362d1[_0x1cfa('0x44')](_0x44a342);}})[_0x1cfa('0x1f')](function(_0x13e779){if(_0x13e779){_0xf1a50b=_0x13e779[_0x1cfa('0x32')];if(!_0x5d22f4[_0x1cfa('0x2c')]['hasOwnProperty'](_0x1cfa('0x34'))){_0x44a342[_0x1cfa('0x19')]=qs[_0x1cfa('0x19')](_0x5d22f4[_0x1cfa('0x2c')][_0x1cfa('0x19')]);_0x44a342['offset']=qs[_0x1cfa('0x16')](_0x5d22f4[_0x1cfa('0x2c')][_0x1cfa('0x16')]);}return _0x4362d1[_0x1cfa('0x44')](_0x44a342);}})[_0x1cfa('0x1f')](function(_0x55d4be){if(_0x55d4be){return _0x55d4be?{'count':_0xf1a50b,'rows':_0x55d4be}:null;}})[_0x1cfa('0x1f')](respondWithResult(_0x174d8b,null))['catch'](handleError(_0x174d8b,null));};exports[_0x1cfa('0x49')]=function(_0x110a89,_0x499a87,_0x4db05a){var _0x400fa6={};var _0x1d0743={};var _0x517d77;var _0x347cc5;return db[_0x1cfa('0x27')]['findOne']({'where':{'id':_0x110a89['params']['id']}})[_0x1cfa('0x1f')](handleEntityNotFound(_0x499a87,null))['then'](function(_0x2ddc6a){if(_0x2ddc6a){_0x517d77=_0x2ddc6a;_0x1d0743['model']=_[_0x1cfa('0x2d')](db[_0x1cfa('0x46')][_0x1cfa('0x28')]);_0x1d0743['query']=_[_0x1cfa('0x2d')](_0x110a89[_0x1cfa('0x2c')]);_0x1d0743[_0x1cfa('0x2e')]=_['intersection'](_0x1d0743[_0x1cfa('0x2b')],_0x1d0743[_0x1cfa('0x2c')]);_0x400fa6[_0x1cfa('0x30')]=_[_0x1cfa('0x2f')](_0x1d0743[_0x1cfa('0x2b')],qs[_0x1cfa('0x31')](_0x110a89[_0x1cfa('0x2c')][_0x1cfa('0x31')]));_0x400fa6[_0x1cfa('0x30')]=_0x400fa6['attributes']['length']?_0x400fa6['attributes']:_0x1d0743[_0x1cfa('0x2b')];_0x400fa6[_0x1cfa('0x35')]=qs[_0x1cfa('0x36')](_0x110a89[_0x1cfa('0x2c')][_0x1cfa('0x36')]);_0x400fa6[_0x1cfa('0x37')]=qs[_0x1cfa('0x2e')](_[_0x1cfa('0x47')](_0x110a89[_0x1cfa('0x2c')],_0x1d0743[_0x1cfa('0x2e')]));if(_0x110a89['query'][_0x1cfa('0x48')]){_0x400fa6['where']=_[_0x1cfa('0x38')](_0x400fa6[_0x1cfa('0x37')],{'$or':_[_0x1cfa('0x26')](_0x400fa6[_0x1cfa('0x30')],function(_0x3183ad){var _0x136643={};_0x136643[_0x3183ad]={'$like':'%'+_0x110a89['query'][_0x1cfa('0x48')]+'%'};return _0x136643;})});}_0x400fa6=_[_0x1cfa('0x38')]({},_0x400fa6,_0x110a89['options']);return _0x517d77[_0x1cfa('0x49')](_0x400fa6);}})[_0x1cfa('0x1f')](function(_0x57873f){if(_0x57873f){_0x347cc5=_0x57873f[_0x1cfa('0x32')];if(!_0x110a89[_0x1cfa('0x2c')][_0x1cfa('0x33')](_0x1cfa('0x34'))){_0x400fa6['limit']=qs[_0x1cfa('0x19')](_0x110a89[_0x1cfa('0x2c')]['limit']);_0x400fa6[_0x1cfa('0x16')]=qs[_0x1cfa('0x16')](_0x110a89[_0x1cfa('0x2c')][_0x1cfa('0x16')]);}return _0x517d77['getSubjects'](_0x400fa6);}})['then'](function(_0xf3d4f7){if(_0xf3d4f7){return _0xf3d4f7?{'count':_0x347cc5,'rows':_0xf3d4f7}:null;}})[_0x1cfa('0x1f')](respondWithResult(_0x499a87,null))[_0x1cfa('0x3e')](handleError(_0x499a87,null));};exports[_0x1cfa('0x4a')]=function(_0xa71127,_0x5e5e25,_0x11f565){var _0x8993be={};var _0x42b081={};var _0x55c1a3;var _0x2b4ab1;return db[_0x1cfa('0x27')][_0x1cfa('0x45')]({'where':{'id':_0xa71127[_0x1cfa('0x40')]['id']}})[_0x1cfa('0x1f')](handleEntityNotFound(_0x5e5e25,null))['then'](function(_0x5f17ef){if(_0x5f17ef){_0x55c1a3=_0x5f17ef;_0x42b081[_0x1cfa('0x2b')]=_['keys'](db[_0x1cfa('0x46')]['rawAttributes']);_0x42b081['query']=_['keys'](_0xa71127['query']);_0x42b081[_0x1cfa('0x2e')]=_[_0x1cfa('0x2f')](_0x42b081[_0x1cfa('0x2b')],_0x42b081[_0x1cfa('0x2c')]);_0x8993be[_0x1cfa('0x30')]=_['intersection'](_0x42b081[_0x1cfa('0x2b')],qs['fields'](_0xa71127[_0x1cfa('0x2c')][_0x1cfa('0x31')]));_0x8993be[_0x1cfa('0x30')]=_0x8993be[_0x1cfa('0x30')][_0x1cfa('0x32')]?_0x8993be[_0x1cfa('0x30')]:_0x42b081[_0x1cfa('0x2b')];_0x8993be[_0x1cfa('0x35')]=qs['sort'](_0xa71127[_0x1cfa('0x2c')]['sort']);_0x8993be[_0x1cfa('0x37')]=qs['filters'](_['pick'](_0xa71127['query'],_0x42b081[_0x1cfa('0x2e')]));if(_0xa71127[_0x1cfa('0x2c')][_0x1cfa('0x48')]){_0x8993be[_0x1cfa('0x37')]=_['merge'](_0x8993be[_0x1cfa('0x37')],{'$or':_[_0x1cfa('0x26')](_0x8993be[_0x1cfa('0x30')],function(_0x5af7ba){var _0x331908={};_0x331908[_0x5af7ba]={'$like':'%'+_0xa71127['query'][_0x1cfa('0x48')]+'%'};return _0x331908;})});}_0x8993be=_[_0x1cfa('0x38')]({},_0x8993be,_0xa71127[_0x1cfa('0x3a')]);return _0x55c1a3[_0x1cfa('0x4a')](_0x8993be);}})[_0x1cfa('0x1f')](function(_0x91d293){if(_0x91d293){_0x2b4ab1=_0x91d293['length'];if(!_0xa71127[_0x1cfa('0x2c')][_0x1cfa('0x33')]('nolimit')){_0x8993be['limit']=qs[_0x1cfa('0x19')](_0xa71127[_0x1cfa('0x2c')]['limit']);_0x8993be[_0x1cfa('0x16')]=qs[_0x1cfa('0x16')](_0xa71127[_0x1cfa('0x2c')]['offset']);}return _0x55c1a3[_0x1cfa('0x4a')](_0x8993be);}})[_0x1cfa('0x1f')](function(_0x18d7e3){if(_0x18d7e3){return _0x18d7e3?{'count':_0x2b4ab1,'rows':_0x18d7e3}:null;}})[_0x1cfa('0x1f')](respondWithResult(_0x5e5e25,null))[_0x1cfa('0x3e')](handleError(_0x5e5e25,null));}; \ No newline at end of file +var _0xe4a5=['fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','findOne','order','getFields','nolimit','SalesforceField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xe4a5,0xea));var _0x5e4a=function(_0x254caa,_0x454b80){_0x254caa=_0x254caa-0x0;var _0x1f9aac=_0xe4a5[_0x254caa];return _0x1f9aac;};'use strict';var emlformat=require(_0x5e4a('0x0'));var rimraf=require(_0x5e4a('0x1'));var zipdir=require(_0x5e4a('0x2'));var jsonpatch=require(_0x5e4a('0x3'));var rp=require(_0x5e4a('0x4'));var moment=require(_0x5e4a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5e4a('0x6'));var util=require(_0x5e4a('0x7'));var path=require(_0x5e4a('0x8'));var sox=require(_0x5e4a('0x9'));var csv=require(_0x5e4a('0xa'));var ejs=require(_0x5e4a('0xb'));var fs=require('fs');var fs_extra=require(_0x5e4a('0xc'));var _=require('lodash');var squel=require(_0x5e4a('0xd'));var crypto=require(_0x5e4a('0xe'));var jsforce=require(_0x5e4a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x5e4a('0xa'));var querystring=require(_0x5e4a('0x10'));var Papa=require('papaparse');var Redis=require(_0x5e4a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5e4a('0x12'));var as=require(_0x5e4a('0x13'));var hardwareService=require(_0x5e4a('0x14'));var logger=require(_0x5e4a('0x15'))(_0x5e4a('0x16'));var utils=require(_0x5e4a('0x17'));var config=require(_0x5e4a('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x5e4a('0x19'))['db'];function respondWithStatusCode(_0x168c05,_0x35a8b0){_0x35a8b0=_0x35a8b0||0xcc;return function(_0x33ce58){if(_0x33ce58){return _0x168c05[_0x5e4a('0x1a')](_0x35a8b0);}return _0x168c05[_0x5e4a('0x1b')](_0x35a8b0)[_0x5e4a('0x1c')]();};}function respondWithResult(_0x5575a3,_0x575d65){_0x575d65=_0x575d65||0xc8;return function(_0x37fde1){if(_0x37fde1){return _0x5575a3[_0x5e4a('0x1b')](_0x575d65)[_0x5e4a('0x1d')](_0x37fde1);}};}function respondWithFilteredResult(_0x297dd1,_0x1a0a7f){return function(_0x445ac7){if(_0x445ac7){var _0x146e69=typeof _0x1a0a7f[_0x5e4a('0x1e')]===_0x5e4a('0x1f')&&typeof _0x1a0a7f[_0x5e4a('0x20')]===_0x5e4a('0x1f');var _0x2145f0=_0x445ac7[_0x5e4a('0x21')];var _0x3e8160=_0x146e69?0x0:_0x1a0a7f['offset'];var _0x549371=_0x146e69?_0x445ac7[_0x5e4a('0x21')]:_0x1a0a7f[_0x5e4a('0x1e')]+_0x1a0a7f[_0x5e4a('0x20')];var _0x552178;if(_0x549371>=_0x2145f0){_0x549371=_0x2145f0;_0x552178=0xc8;}else{_0x552178=0xce;}_0x297dd1[_0x5e4a('0x1b')](_0x552178);return _0x297dd1['set'](_0x5e4a('0x22'),_0x3e8160+'-'+_0x549371+'/'+_0x2145f0)[_0x5e4a('0x1d')](_0x445ac7);}return null;};}function patchUpdates(_0x19379b){return function(_0x1fe8a9){try{jsonpatch['apply'](_0x1fe8a9,_0x19379b,!![]);}catch(_0x52e222){return BPromise['reject'](_0x52e222);}return _0x1fe8a9[_0x5e4a('0x23')]();};}function saveUpdates(_0xa1dcde,_0x2118f0){return function(_0x153c4f){if(_0x153c4f){return _0x153c4f[_0x5e4a('0x24')](_0xa1dcde)[_0x5e4a('0x25')](function(_0xca6d5b){return _0xca6d5b;});}return null;};}function removeEntity(_0x1151b5,_0xf3e35a){return function(_0x18b12d){if(_0x18b12d){return _0x18b12d[_0x5e4a('0x26')]()[_0x5e4a('0x25')](function(){_0x1151b5[_0x5e4a('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5da17c,_0x3d5949){return function(_0x108f48){if(!_0x108f48){_0x5da17c[_0x5e4a('0x1a')](0x194);}return _0x108f48;};}function handleError(_0x2eb9c7,_0x572d03){_0x572d03=_0x572d03||0x1f4;return function(_0x31bbaa){logger[_0x5e4a('0x27')](_0x31bbaa[_0x5e4a('0x28')]);if(_0x31bbaa[_0x5e4a('0x29')]){delete _0x31bbaa['name'];}_0x2eb9c7[_0x5e4a('0x1b')](_0x572d03)[_0x5e4a('0x2a')](_0x31bbaa);};}exports[_0x5e4a('0x2b')]=function(_0x49ae2d,_0x6eea6c){var _0x3d6bf6={},_0x1b97fe={},_0x5258d5={'count':0x0,'rows':[]};var _0x295a21=_[_0x5e4a('0x2c')](db[_0x5e4a('0x2d')][_0x5e4a('0x2e')],function(_0x24ef2d){return{'name':_0x24ef2d[_0x5e4a('0x2f')],'type':_0x24ef2d['type'][_0x5e4a('0x30')]};});_0x1b97fe[_0x5e4a('0x31')]=_[_0x5e4a('0x2c')](_0x295a21,_0x5e4a('0x29'));_0x1b97fe[_0x5e4a('0x32')]=_[_0x5e4a('0x33')](_0x49ae2d[_0x5e4a('0x32')]);_0x1b97fe[_0x5e4a('0x34')]=_[_0x5e4a('0x35')](_0x1b97fe[_0x5e4a('0x31')],_0x1b97fe[_0x5e4a('0x32')]);_0x3d6bf6[_0x5e4a('0x36')]=_[_0x5e4a('0x35')](_0x1b97fe[_0x5e4a('0x31')],qs[_0x5e4a('0x37')](_0x49ae2d[_0x5e4a('0x32')]['fields']));_0x3d6bf6[_0x5e4a('0x36')]=_0x3d6bf6[_0x5e4a('0x36')][_0x5e4a('0x38')]?_0x3d6bf6[_0x5e4a('0x36')]:_0x1b97fe[_0x5e4a('0x31')];if(!_0x49ae2d[_0x5e4a('0x32')][_0x5e4a('0x39')]('nolimit')){_0x3d6bf6[_0x5e4a('0x20')]=qs[_0x5e4a('0x20')](_0x49ae2d[_0x5e4a('0x32')][_0x5e4a('0x20')]);_0x3d6bf6[_0x5e4a('0x1e')]=qs['offset'](_0x49ae2d['query'][_0x5e4a('0x1e')]);}_0x3d6bf6['order']=qs[_0x5e4a('0x3a')](_0x49ae2d[_0x5e4a('0x32')]['sort']);_0x3d6bf6['where']=qs[_0x5e4a('0x34')](_[_0x5e4a('0x3b')](_0x49ae2d[_0x5e4a('0x32')],_0x1b97fe[_0x5e4a('0x34')]),_0x295a21);if(_0x49ae2d[_0x5e4a('0x32')][_0x5e4a('0x3c')]){_0x3d6bf6[_0x5e4a('0x3d')]=_['merge'](_0x3d6bf6['where'],{'$or':_[_0x5e4a('0x2c')](_0x295a21,function(_0xc65264){if(_0xc65264[_0x5e4a('0x3e')]!==_0x5e4a('0x3f')){var _0x17ba83={};_0x17ba83[_0xc65264[_0x5e4a('0x29')]]={'$like':'%'+_0x49ae2d[_0x5e4a('0x32')]['filter']+'%'};return _0x17ba83;}})});}_0x3d6bf6=_[_0x5e4a('0x40')]({},_0x3d6bf6,_0x49ae2d[_0x5e4a('0x41')]);var _0x1986a2={'where':_0x3d6bf6[_0x5e4a('0x3d')]};return db[_0x5e4a('0x2d')][_0x5e4a('0x21')](_0x1986a2)[_0x5e4a('0x25')](function(_0x1066d1){_0x5258d5[_0x5e4a('0x21')]=_0x1066d1;if(_0x49ae2d['query'][_0x5e4a('0x42')]){_0x3d6bf6[_0x5e4a('0x43')]=[{'all':!![]}];}return db[_0x5e4a('0x2d')][_0x5e4a('0x44')](_0x3d6bf6);})['then'](function(_0x2c11c4){_0x5258d5['rows']=_0x2c11c4;return _0x5258d5;})[_0x5e4a('0x25')](respondWithFilteredResult(_0x6eea6c,_0x3d6bf6))[_0x5e4a('0x45')](handleError(_0x6eea6c,null));};exports[_0x5e4a('0x46')]=function(_0x265f66,_0x46309a){var _0xb46899={'raw':![],'where':{'id':_0x265f66[_0x5e4a('0x47')]['id']}},_0x19f0a7={};_0x19f0a7['model']=_[_0x5e4a('0x33')](db[_0x5e4a('0x2d')][_0x5e4a('0x2e')]);_0x19f0a7[_0x5e4a('0x32')]=_['keys'](_0x265f66[_0x5e4a('0x32')]);_0x19f0a7[_0x5e4a('0x34')]=_[_0x5e4a('0x35')](_0x19f0a7[_0x5e4a('0x31')],_0x19f0a7['query']);_0xb46899[_0x5e4a('0x36')]=_['intersection'](_0x19f0a7['model'],qs['fields'](_0x265f66[_0x5e4a('0x32')][_0x5e4a('0x37')]));_0xb46899['attributes']=_0xb46899[_0x5e4a('0x36')][_0x5e4a('0x38')]?_0xb46899['attributes']:_0x19f0a7[_0x5e4a('0x31')];if(_0x265f66[_0x5e4a('0x32')][_0x5e4a('0x42')]){_0xb46899['include']=[{'all':!![]}];}_0xb46899=_['merge']({},_0xb46899,_0x265f66[_0x5e4a('0x41')]);return db[_0x5e4a('0x2d')][_0x5e4a('0x48')](_0xb46899)[_0x5e4a('0x25')](handleEntityNotFound(_0x46309a,null))[_0x5e4a('0x25')](respondWithResult(_0x46309a,null))[_0x5e4a('0x45')](handleError(_0x46309a,null));};exports[_0x5e4a('0x49')]=function(_0x2e69f7,_0x3be6ec){return db['SalesforceConfiguration'][_0x5e4a('0x49')](_0x2e69f7[_0x5e4a('0x4a')],{})['then'](respondWithResult(_0x3be6ec,0xc9))[_0x5e4a('0x45')](handleError(_0x3be6ec,null));};exports[_0x5e4a('0x24')]=function(_0x4d267d,_0x158775){if(_0x4d267d['body']['id']){delete _0x4d267d[_0x5e4a('0x4a')]['id'];}return db['SalesforceConfiguration'][_0x5e4a('0x48')]({'where':{'id':_0x4d267d[_0x5e4a('0x47')]['id']}})[_0x5e4a('0x25')](handleEntityNotFound(_0x158775,null))[_0x5e4a('0x25')](saveUpdates(_0x4d267d[_0x5e4a('0x4a')],null))[_0x5e4a('0x25')](respondWithResult(_0x158775,null))[_0x5e4a('0x45')](handleError(_0x158775,null));};exports['destroy']=function(_0x26edcd,_0x2be64b){return db[_0x5e4a('0x2d')][_0x5e4a('0x48')]({'where':{'id':_0x26edcd['params']['id']}})[_0x5e4a('0x25')](handleEntityNotFound(_0x2be64b,null))[_0x5e4a('0x25')](removeEntity(_0x2be64b,null))[_0x5e4a('0x45')](handleError(_0x2be64b,null));};exports['getFields']=function(_0x5a489d,_0x33f9af,_0x5c690a){var _0x557ef5={};var _0x509694={};var _0x2219b2;var _0x104df0;return db['SalesforceConfiguration'][_0x5e4a('0x4b')]({'where':{'id':_0x5a489d[_0x5e4a('0x47')]['id']}})[_0x5e4a('0x25')](handleEntityNotFound(_0x33f9af,null))[_0x5e4a('0x25')](function(_0x2f67aa){if(_0x2f67aa){_0x2219b2=_0x2f67aa;_0x509694[_0x5e4a('0x31')]=_['keys'](db['SalesforceField'][_0x5e4a('0x2e')]);_0x509694['query']=_[_0x5e4a('0x33')](_0x5a489d['query']);_0x509694[_0x5e4a('0x34')]=_['intersection'](_0x509694[_0x5e4a('0x31')],_0x509694['query']);_0x557ef5[_0x5e4a('0x36')]=_[_0x5e4a('0x35')](_0x509694[_0x5e4a('0x31')],qs[_0x5e4a('0x37')](_0x5a489d[_0x5e4a('0x32')]['fields']));_0x557ef5['attributes']=_0x557ef5[_0x5e4a('0x36')][_0x5e4a('0x38')]?_0x557ef5[_0x5e4a('0x36')]:_0x509694['model'];_0x557ef5[_0x5e4a('0x4c')]=qs['sort'](_0x5a489d[_0x5e4a('0x32')][_0x5e4a('0x3a')]);_0x557ef5['where']=qs['filters'](_['pick'](_0x5a489d['query'],_0x509694['filters']));if(_0x5a489d['query'][_0x5e4a('0x3c')]){_0x557ef5['where']=_[_0x5e4a('0x40')](_0x557ef5[_0x5e4a('0x3d')],{'$or':_[_0x5e4a('0x2c')](_0x557ef5[_0x5e4a('0x36')],function(_0x44d799){var _0x2ac1fd={};_0x2ac1fd[_0x44d799]={'$like':'%'+_0x5a489d[_0x5e4a('0x32')][_0x5e4a('0x3c')]+'%'};return _0x2ac1fd;})});}_0x557ef5=_['merge']({},_0x557ef5,_0x5a489d['options']);return _0x2219b2[_0x5e4a('0x4d')](_0x557ef5);}})['then'](function(_0x496a0a){if(_0x496a0a){_0x104df0=_0x496a0a[_0x5e4a('0x38')];if(!_0x5a489d['query'][_0x5e4a('0x39')](_0x5e4a('0x4e'))){_0x557ef5[_0x5e4a('0x20')]=qs[_0x5e4a('0x20')](_0x5a489d[_0x5e4a('0x32')][_0x5e4a('0x20')]);_0x557ef5['offset']=qs[_0x5e4a('0x1e')](_0x5a489d[_0x5e4a('0x32')]['offset']);}return _0x2219b2[_0x5e4a('0x4d')](_0x557ef5);}})[_0x5e4a('0x25')](function(_0x291f57){if(_0x291f57){return _0x291f57?{'count':_0x104df0,'rows':_0x291f57}:null;}})[_0x5e4a('0x25')](respondWithResult(_0x33f9af,null))['catch'](handleError(_0x33f9af,null));};exports['getSubjects']=function(_0x1dcb94,_0x243123,_0xe24fb4){var _0x488591={};var _0x2e9f03={};var _0x53f695;var _0x216831;return db[_0x5e4a('0x2d')][_0x5e4a('0x4b')]({'where':{'id':_0x1dcb94[_0x5e4a('0x47')]['id']}})['then'](handleEntityNotFound(_0x243123,null))['then'](function(_0x16c04e){if(_0x16c04e){_0x53f695=_0x16c04e;_0x2e9f03['model']=_[_0x5e4a('0x33')](db[_0x5e4a('0x4f')][_0x5e4a('0x2e')]);_0x2e9f03[_0x5e4a('0x32')]=_[_0x5e4a('0x33')](_0x1dcb94[_0x5e4a('0x32')]);_0x2e9f03[_0x5e4a('0x34')]=_[_0x5e4a('0x35')](_0x2e9f03[_0x5e4a('0x31')],_0x2e9f03['query']);_0x488591['attributes']=_['intersection'](_0x2e9f03['model'],qs['fields'](_0x1dcb94[_0x5e4a('0x32')]['fields']));_0x488591[_0x5e4a('0x36')]=_0x488591[_0x5e4a('0x36')][_0x5e4a('0x38')]?_0x488591[_0x5e4a('0x36')]:_0x2e9f03['model'];_0x488591[_0x5e4a('0x4c')]=qs[_0x5e4a('0x3a')](_0x1dcb94[_0x5e4a('0x32')][_0x5e4a('0x3a')]);_0x488591[_0x5e4a('0x3d')]=qs[_0x5e4a('0x34')](_[_0x5e4a('0x3b')](_0x1dcb94[_0x5e4a('0x32')],_0x2e9f03['filters']));if(_0x1dcb94['query'][_0x5e4a('0x3c')]){_0x488591[_0x5e4a('0x3d')]=_[_0x5e4a('0x40')](_0x488591[_0x5e4a('0x3d')],{'$or':_[_0x5e4a('0x2c')](_0x488591['attributes'],function(_0x50b576){var _0x4af241={};_0x4af241[_0x50b576]={'$like':'%'+_0x1dcb94['query'][_0x5e4a('0x3c')]+'%'};return _0x4af241;})});}_0x488591=_[_0x5e4a('0x40')]({},_0x488591,_0x1dcb94['options']);return _0x53f695[_0x5e4a('0x50')](_0x488591);}})[_0x5e4a('0x25')](function(_0x490cb5){if(_0x490cb5){_0x216831=_0x490cb5[_0x5e4a('0x38')];if(!_0x1dcb94[_0x5e4a('0x32')][_0x5e4a('0x39')](_0x5e4a('0x4e'))){_0x488591[_0x5e4a('0x20')]=qs[_0x5e4a('0x20')](_0x1dcb94[_0x5e4a('0x32')][_0x5e4a('0x20')]);_0x488591[_0x5e4a('0x1e')]=qs[_0x5e4a('0x1e')](_0x1dcb94[_0x5e4a('0x32')][_0x5e4a('0x1e')]);}return _0x53f695[_0x5e4a('0x50')](_0x488591);}})[_0x5e4a('0x25')](function(_0x156034){if(_0x156034){return _0x156034?{'count':_0x216831,'rows':_0x156034}:null;}})[_0x5e4a('0x25')](respondWithResult(_0x243123,null))[_0x5e4a('0x45')](handleError(_0x243123,null));};exports[_0x5e4a('0x51')]=function(_0x5b16bd,_0x4f4b5d,_0x329442){var _0x5831ec={};var _0x22bddd={};var _0x4f2693;var _0x10a96d;return db[_0x5e4a('0x2d')][_0x5e4a('0x4b')]({'where':{'id':_0x5b16bd['params']['id']}})[_0x5e4a('0x25')](handleEntityNotFound(_0x4f4b5d,null))[_0x5e4a('0x25')](function(_0x45ee7b){if(_0x45ee7b){_0x4f2693=_0x45ee7b;_0x22bddd[_0x5e4a('0x31')]=_[_0x5e4a('0x33')](db[_0x5e4a('0x4f')]['rawAttributes']);_0x22bddd['query']=_[_0x5e4a('0x33')](_0x5b16bd[_0x5e4a('0x32')]);_0x22bddd[_0x5e4a('0x34')]=_[_0x5e4a('0x35')](_0x22bddd[_0x5e4a('0x31')],_0x22bddd[_0x5e4a('0x32')]);_0x5831ec[_0x5e4a('0x36')]=_[_0x5e4a('0x35')](_0x22bddd[_0x5e4a('0x31')],qs['fields'](_0x5b16bd[_0x5e4a('0x32')][_0x5e4a('0x37')]));_0x5831ec[_0x5e4a('0x36')]=_0x5831ec[_0x5e4a('0x36')][_0x5e4a('0x38')]?_0x5831ec[_0x5e4a('0x36')]:_0x22bddd[_0x5e4a('0x31')];_0x5831ec[_0x5e4a('0x4c')]=qs[_0x5e4a('0x3a')](_0x5b16bd['query'][_0x5e4a('0x3a')]);_0x5831ec['where']=qs[_0x5e4a('0x34')](_['pick'](_0x5b16bd[_0x5e4a('0x32')],_0x22bddd[_0x5e4a('0x34')]));if(_0x5b16bd[_0x5e4a('0x32')][_0x5e4a('0x3c')]){_0x5831ec[_0x5e4a('0x3d')]=_[_0x5e4a('0x40')](_0x5831ec[_0x5e4a('0x3d')],{'$or':_['map'](_0x5831ec[_0x5e4a('0x36')],function(_0x2514f6){var _0x12ebdf={};_0x12ebdf[_0x2514f6]={'$like':'%'+_0x5b16bd['query'][_0x5e4a('0x3c')]+'%'};return _0x12ebdf;})});}_0x5831ec=_[_0x5e4a('0x40')]({},_0x5831ec,_0x5b16bd[_0x5e4a('0x41')]);return _0x4f2693[_0x5e4a('0x51')](_0x5831ec);}})[_0x5e4a('0x25')](function(_0x12ab31){if(_0x12ab31){_0x10a96d=_0x12ab31['length'];if(!_0x5b16bd[_0x5e4a('0x32')]['hasOwnProperty']('nolimit')){_0x5831ec['limit']=qs[_0x5e4a('0x20')](_0x5b16bd[_0x5e4a('0x32')]['limit']);_0x5831ec['offset']=qs[_0x5e4a('0x1e')](_0x5b16bd[_0x5e4a('0x32')][_0x5e4a('0x1e')]);}return _0x4f2693[_0x5e4a('0x51')](_0x5831ec);}})[_0x5e4a('0x25')](function(_0x3fdbca){if(_0x3fdbca){return _0x3fdbca?{'count':_0x10a96d,'rows':_0x3fdbca}:null;}})[_0x5e4a('0x25')](respondWithResult(_0x4f4b5d,null))[_0x5e4a('0x45')](handleError(_0x4f4b5d,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index d0eaf35..92ed934 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 _0xc55f=['rimraf','../../config/environment','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x3fb1fe,_0x2eb38d){var _0x402b83=function(_0x9bbfe5){while(--_0x9bbfe5){_0x3fb1fe['push'](_0x3fb1fe['shift']());}};_0x402b83(++_0x2eb38d);}(_0xc55f,0x10d));var _0xfc55=function(_0x3946d6,_0x379356){_0x3946d6=_0x3946d6-0x0;var _0x28bf68=_0xc55f[_0x3946d6];return _0x28bf68;};'use strict';var _=require(_0xfc55('0x0'));var util=require(_0xfc55('0x1'));var logger=require('../../config/logger')(_0xfc55('0x2'));var moment=require(_0xfc55('0x3'));var BPromise=require(_0xfc55('0x4'));var rp=require(_0xfc55('0x5'));var fs=require('fs');var path=require(_0xfc55('0x6'));var rimraf=require(_0xfc55('0x7'));var config=require(_0xfc55('0x8'));var attributes=require('./intSalesforceConfiguration.attributes');module['exports']=function(_0x3cd694,_0x4212d9){return _0x3cd694[_0xfc55('0x9')](_0xfc55('0xa'),attributes,{'tableName':_0xfc55('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x21e9=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util'];(function(_0x54597a,_0x4ea42f){var _0x5a764f=function(_0x5c000b){while(--_0x5c000b){_0x54597a['push'](_0x54597a['shift']());}};_0x5a764f(++_0x4ea42f);}(_0x21e9,0x8e));var _0x921e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x21e9[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x921e('0x0'));var util=require(_0x921e('0x1'));var logger=require(_0x921e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x921e('0x3'));var rp=require(_0x921e('0x4'));var fs=require('fs');var path=require(_0x921e('0x5'));var rimraf=require(_0x921e('0x6'));var config=require(_0x921e('0x7'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0x921e('0x8')]=function(_0x243e26,_0x1100ec){return _0x243e26[_0x921e('0x9')](_0x921e('0xa'),attributes,{'tableName':_0x921e('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 e4f1dce..6d834d7 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 _0xb69e=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash'];(function(_0x26f69f,_0x1bc94a){var _0x2cee15=function(_0x359bfb){while(--_0x359bfb){_0x26f69f['push'](_0x26f69f['shift']());}};_0x2cee15(++_0x1bc94a);}(_0xb69e,0x14f));var _0xeb69=function(_0x42f4be,_0x54318e){_0x42f4be=_0x42f4be-0x0;var _0x588c19=_0xb69e[_0x42f4be];return _0x588c19;};'use strict';var _=require(_0xeb69('0x0'));var util=require('util');var moment=require(_0xeb69('0x1'));var BPromise=require(_0xeb69('0x2'));var rs=require(_0xeb69('0x3'));var fs=require('fs');var Redis=require(_0xeb69('0x4'));var db=require(_0xeb69('0x5'))['db'];var utils=require(_0xeb69('0x6'));var logger=require(_0xeb69('0x7'))(_0xeb69('0x8'));var config=require(_0xeb69('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xeb69('0xa')][_0xeb69('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x49e567,_0x38460d,_0x406950){return new BPromise(function(_0x344c20,_0x524875){return client[_0xeb69('0xc')](_0x49e567,_0x406950)[_0xeb69('0xd')](function(_0x1c2d08){logger[_0xeb69('0xe')](_0xeb69('0xf'),_0x38460d,'request\x20sent');logger[_0xeb69('0x10')](_0xeb69('0x11'),_0x38460d,_0xeb69('0x12'),JSON['stringify'](_0x1c2d08));if(_0x1c2d08[_0xeb69('0x13')]){if(_0x1c2d08[_0xeb69('0x13')][_0xeb69('0x14')]===0x1f4){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x38460d,_0x1c2d08['error'][_0xeb69('0x15')]);return _0x524875(_0x1c2d08[_0xeb69('0x13')][_0xeb69('0x15')]);}logger['error'](_0xeb69('0xf'),_0x38460d,_0x1c2d08['error'][_0xeb69('0x15')]);return _0x344c20(_0x1c2d08[_0xeb69('0x13')]['message']);}else{logger[_0xeb69('0xe')](_0xeb69('0xf'),_0x38460d,'request\x20sent');_0x344c20(_0x1c2d08[_0xeb69('0x16')][_0xeb69('0x15')]);}})[_0xeb69('0x17')](function(_0x4e595c){logger[_0xeb69('0x13')]('SalesforceConfiguration,\x20%s,\x20%s',_0x38460d,_0x4e595c);_0x524875(_0x4e595c);});});} \ No newline at end of file +var _0xee6a=['error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xf86f4,_0x50fcd8){var _0x46dc83=function(_0xd3ebba){while(--_0xd3ebba){_0xf86f4['push'](_0xf86f4['shift']());}};_0x46dc83(++_0x50fcd8);}(_0xee6a,0x65));var _0xaee6=function(_0xb6095e,_0x4cd571){_0xb6095e=_0xb6095e-0x0;var _0x3afc52=_0xee6a[_0xb6095e];return _0x3afc52;};'use strict';var _=require(_0xaee6('0x0'));var util=require(_0xaee6('0x1'));var moment=require(_0xaee6('0x2'));var BPromise=require('bluebird');var rs=require(_0xaee6('0x3'));var fs=require('fs');var Redis=require(_0xaee6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xaee6('0x5'));var logger=require(_0xaee6('0x6'))('rpc');var config=require(_0xaee6('0x7'));var jayson=require(_0xaee6('0x8'));var client=jayson[_0xaee6('0x9')][_0xaee6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x55b06c,_0x322768,_0x5bdcaa){return new BPromise(function(_0x4d5a6d,_0x563f7f){return client[_0xaee6('0xb')](_0x55b06c,_0x5bdcaa)[_0xaee6('0xc')](function(_0x384c08){logger[_0xaee6('0xd')](_0xaee6('0xe'),_0x322768,_0xaee6('0xf'));logger[_0xaee6('0x10')](_0xaee6('0x11'),_0x322768,_0xaee6('0xf'),JSON[_0xaee6('0x12')](_0x384c08));if(_0x384c08[_0xaee6('0x13')]){if(_0x384c08[_0xaee6('0x13')][_0xaee6('0x14')]===0x1f4){logger[_0xaee6('0x13')]('SalesforceConfiguration,\x20%s,\x20%s',_0x322768,_0x384c08[_0xaee6('0x13')][_0xaee6('0x15')]);return _0x563f7f(_0x384c08[_0xaee6('0x13')]['message']);}logger[_0xaee6('0x13')](_0xaee6('0xe'),_0x322768,_0x384c08[_0xaee6('0x13')][_0xaee6('0x15')]);return _0x4d5a6d(_0x384c08[_0xaee6('0x13')][_0xaee6('0x15')]);}else{logger[_0xaee6('0xd')]('SalesforceConfiguration,\x20%s,\x20%s',_0x322768,_0xaee6('0xf'));_0x4d5a6d(_0x384c08[_0xaee6('0x16')][_0xaee6('0x15')]);}})[_0xaee6('0x17')](function(_0x286cb6){logger[_0xaee6('0x13')](_0xaee6('0xe'),_0x322768,_0x286cb6);_0x563f7f(_0x286cb6);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index cff8bb5..526ef23 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 _0xa93f=['isAuthenticated','index','/:id','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get'];(function(_0x9ab00d,_0x5488fd){var _0x128d1a=function(_0x59839b){while(--_0x59839b){_0x9ab00d['push'](_0x9ab00d['shift']());}};_0x128d1a(++_0x5488fd);}(_0xa93f,0xb3));var _0xfa93=function(_0x4e321c,_0x5ba5a5){_0x4e321c=_0x4e321c-0x0;var _0x1647d3=_0xa93f[_0x4e321c];return _0x1647d3;};'use strict';var multer=require(_0xfa93('0x0'));var util=require(_0xfa93('0x1'));var path=require(_0xfa93('0x2'));var timeout=require(_0xfa93('0x3'));var express=require(_0xfa93('0x4'));var router=express['Router']();var fs_extra=require(_0xfa93('0x5'));var auth=require(_0xfa93('0x6'));var interaction=require(_0xfa93('0x7'));var config=require(_0xfa93('0x8'));var controller=require(_0xfa93('0x9'));router[_0xfa93('0xa')]('/',auth[_0xfa93('0xb')](),controller[_0xfa93('0xc')]);router['get'](_0xfa93('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xfa93('0xe')]('/',auth[_0xfa93('0xb')](),controller['create']);router['put'](_0xfa93('0xd'),auth[_0xfa93('0xb')](),controller[_0xfa93('0xf')]);router[_0xfa93('0x10')](_0xfa93('0xd'),auth[_0xfa93('0xb')](),controller[_0xfa93('0x11')]);module[_0xfa93('0x12')]=router; \ No newline at end of file +var _0xe88b=['destroy','exports','multer','util','path','../../components/auth/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','create','/:id','delete'];(function(_0x184bda,_0x3a000e){var _0x449b0b=function(_0x50f095){while(--_0x50f095){_0x184bda['push'](_0x184bda['shift']());}};_0x449b0b(++_0x3a000e);}(_0xe88b,0xfe));var _0xbe88=function(_0x24f862,_0x4b645a){_0x24f862=_0x24f862-0x0;var _0x198aa4=_0xe88b[_0x24f862];return _0x198aa4;};'use strict';var multer=require(_0xbe88('0x0'));var util=require(_0xbe88('0x1'));var path=require(_0xbe88('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbe88('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xbe88('0x4'));var controller=require(_0xbe88('0x5'));router[_0xbe88('0x6')]('/',auth[_0xbe88('0x7')](),controller[_0xbe88('0x8')]);router[_0xbe88('0x6')]('/:id',auth[_0xbe88('0x7')](),controller['show']);router['post']('/',auth[_0xbe88('0x7')](),controller[_0xbe88('0x9')]);router['put'](_0xbe88('0xa'),auth[_0xbe88('0x7')](),controller['update']);router[_0xbe88('0xb')](_0xbe88('0xa'),auth[_0xbe88('0x7')](),controller[_0xbe88('0xc')]);module[_0xbe88('0xd')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index c123476..a6859b0 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 _0xdc31=['string','variable','customVariable','keyValue','picklist','STRING','ENUM'];(function(_0x2068ee,_0x42966a){var _0xa36814=function(_0x35dba2){while(--_0x35dba2){_0x2068ee['push'](_0x2068ee['shift']());}};_0xa36814(++_0x42966a);}(_0xdc31,0xdf));var _0x1dc3=function(_0x4efc11,_0x113aec){_0x4efc11=_0x4efc11-0x0;var _0x414bf6=_0xdc31[_0x4efc11];return _0x414bf6;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x1dc3('0x0')](_0x1dc3('0x1'),_0x1dc3('0x2'),_0x1dc3('0x3'),_0x1dc3('0x4'),_0x1dc3('0x5')),'defaultValue':_0x1dc3('0x1')},'content':{'type':Sequelize[_0x1dc3('0x6')]},'key':{'type':Sequelize[_0x1dc3('0x6')]},'keyType':{'type':Sequelize[_0x1dc3('0x0')](_0x1dc3('0x1'),_0x1dc3('0x2'),_0x1dc3('0x3'))},'keyContent':{'type':Sequelize[_0x1dc3('0x6')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x1dc3('0x6')]}}; \ No newline at end of file +var _0x848a=['exports','string','variable','customVariable','picklist','STRING','ENUM'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x848a,0x10a));var _0xa848=function(_0x18abd2,_0x22d4b3){_0x18abd2=_0x18abd2-0x0;var _0x1dcad6=_0x848a[_0x18abd2];return _0x1dcad6;};'use strict';var Sequelize=require('sequelize');module[_0xa848('0x0')]={'type':{'type':Sequelize['ENUM'](_0xa848('0x1'),_0xa848('0x2'),_0xa848('0x3'),'keyValue',_0xa848('0x4')),'defaultValue':_0xa848('0x1')},'content':{'type':Sequelize[_0xa848('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xa848('0x6')](_0xa848('0x1'),_0xa848('0x2'),_0xa848('0x3'))},'keyContent':{'type':Sequelize[_0xa848('0x5')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index b40542f..3a60a09 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 _0xaec5=['../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','model','keys','query','intersection','attributes','fields','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','SalesforceField','includeAll','include','rows','show','params','length','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x662f5b,_0x1bbf91){var _0xa58422=function(_0x3f46da){while(--_0x3f46da){_0x662f5b['push'](_0x662f5b['shift']());}};_0xa58422(++_0x1bbf91);}(_0xaec5,0x104));var _0x5aec=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaec5[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x5aec('0x0'));var rimraf=require(_0x5aec('0x1'));var zipdir=require(_0x5aec('0x2'));var jsonpatch=require(_0x5aec('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x5aec('0x4'));var sox=require(_0x5aec('0x5'));var csv=require(_0x5aec('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5aec('0x7'));var _=require(_0x5aec('0x8'));var squel=require(_0x5aec('0x9'));var crypto=require('crypto');var jsforce=require(_0x5aec('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5aec('0xb'));var Papa=require('papaparse');var Redis=require(_0x5aec('0xc'));var authService=require(_0x5aec('0xd'));var qs=require(_0x5aec('0xe'));var as=require(_0x5aec('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5aec('0x10'))(_0x5aec('0x11'));var utils=require('../../config/utils');var config=require(_0x5aec('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe31662,_0x13f1f5){_0x13f1f5=_0x13f1f5||0xcc;return function(_0x4a950e){if(_0x4a950e){return _0xe31662[_0x5aec('0x13')](_0x13f1f5);}return _0xe31662[_0x5aec('0x14')](_0x13f1f5)[_0x5aec('0x15')]();};}function respondWithResult(_0x574a01,_0x2aceb6){_0x2aceb6=_0x2aceb6||0xc8;return function(_0x7283e2){if(_0x7283e2){return _0x574a01[_0x5aec('0x14')](_0x2aceb6)[_0x5aec('0x16')](_0x7283e2);}};}function respondWithFilteredResult(_0x4599eb,_0x528ad5){return function(_0x2510bd){if(_0x2510bd){var _0x184902=typeof _0x528ad5[_0x5aec('0x17')]===_0x5aec('0x18')&&typeof _0x528ad5[_0x5aec('0x19')]===_0x5aec('0x18');var _0x62b348=_0x2510bd['count'];var _0x2e5f95=_0x184902?0x0:_0x528ad5[_0x5aec('0x17')];var _0x2dda55=_0x184902?_0x2510bd[_0x5aec('0x1a')]:_0x528ad5['offset']+_0x528ad5[_0x5aec('0x19')];var _0x987d79;if(_0x2dda55>=_0x62b348){_0x2dda55=_0x62b348;_0x987d79=0xc8;}else{_0x987d79=0xce;}_0x4599eb[_0x5aec('0x14')](_0x987d79);return _0x4599eb[_0x5aec('0x1b')]('Content-Range',_0x2e5f95+'-'+_0x2dda55+'/'+_0x62b348)[_0x5aec('0x16')](_0x2510bd);}return null;};}function patchUpdates(_0x4f993b){return function(_0x3d496a){try{jsonpatch[_0x5aec('0x1c')](_0x3d496a,_0x4f993b,!![]);}catch(_0x71760c){return BPromise[_0x5aec('0x1d')](_0x71760c);}return _0x3d496a[_0x5aec('0x1e')]();};}function saveUpdates(_0x198ec9,_0x370c68){return function(_0x3f5cd9){if(_0x3f5cd9){return _0x3f5cd9[_0x5aec('0x1f')](_0x198ec9)[_0x5aec('0x20')](function(_0xe98206){return _0xe98206;});}return null;};}function removeEntity(_0x946cf7,_0x38e984){return function(_0x289439){if(_0x289439){return _0x289439[_0x5aec('0x21')]()[_0x5aec('0x20')](function(){_0x946cf7['status'](0xcc)[_0x5aec('0x15')]();});}};}function handleEntityNotFound(_0x1c3898,_0x2b2391){return function(_0x4873c9){if(!_0x4873c9){_0x1c3898[_0x5aec('0x13')](0x194);}return _0x4873c9;};}function handleError(_0xbbb6c8,_0x39d9ae){_0x39d9ae=_0x39d9ae||0x1f4;return function(_0x3c8604){logger[_0x5aec('0x22')](_0x3c8604[_0x5aec('0x23')]);if(_0x3c8604[_0x5aec('0x24')]){delete _0x3c8604['name'];}_0xbbb6c8[_0x5aec('0x14')](_0x39d9ae)[_0x5aec('0x25')](_0x3c8604);};}exports[_0x5aec('0x26')]=function(_0x162e14,_0x38cdf0){var _0x1a8913={},_0x9b54e6={},_0x314f5b={'count':0x0,'rows':[]};var _0x2d4395=_[_0x5aec('0x27')](db['SalesforceField'][_0x5aec('0x28')],function(_0x498394){return{'name':_0x498394[_0x5aec('0x29')],'type':_0x498394['type']['key']};});_0x9b54e6[_0x5aec('0x2a')]=_[_0x5aec('0x27')](_0x2d4395,'name');_0x9b54e6['query']=_[_0x5aec('0x2b')](_0x162e14[_0x5aec('0x2c')]);_0x9b54e6['filters']=_[_0x5aec('0x2d')](_0x9b54e6['model'],_0x9b54e6[_0x5aec('0x2c')]);_0x1a8913[_0x5aec('0x2e')]=_[_0x5aec('0x2d')](_0x9b54e6['model'],qs[_0x5aec('0x2f')](_0x162e14[_0x5aec('0x2c')][_0x5aec('0x2f')]));_0x1a8913[_0x5aec('0x2e')]=_0x1a8913[_0x5aec('0x2e')]['length']?_0x1a8913[_0x5aec('0x2e')]:_0x9b54e6[_0x5aec('0x2a')];if(!_0x162e14[_0x5aec('0x2c')]['hasOwnProperty'](_0x5aec('0x30'))){_0x1a8913[_0x5aec('0x19')]=qs[_0x5aec('0x19')](_0x162e14[_0x5aec('0x2c')][_0x5aec('0x19')]);_0x1a8913[_0x5aec('0x17')]=qs[_0x5aec('0x17')](_0x162e14[_0x5aec('0x2c')]['offset']);}_0x1a8913[_0x5aec('0x31')]=qs[_0x5aec('0x32')](_0x162e14['query'][_0x5aec('0x32')]);_0x1a8913['where']=qs['filters'](_[_0x5aec('0x33')](_0x162e14['query'],_0x9b54e6[_0x5aec('0x34')]),_0x2d4395);if(_0x162e14['query'][_0x5aec('0x35')]){_0x1a8913[_0x5aec('0x36')]=_[_0x5aec('0x37')](_0x1a8913['where'],{'$or':_[_0x5aec('0x27')](_0x2d4395,function(_0x2b60d6){if(_0x2b60d6['type']!==_0x5aec('0x38')){var _0x1fca03={};_0x1fca03[_0x2b60d6['name']]={'$like':'%'+_0x162e14[_0x5aec('0x2c')][_0x5aec('0x35')]+'%'};return _0x1fca03;}})});}_0x1a8913=_[_0x5aec('0x37')]({},_0x1a8913,_0x162e14[_0x5aec('0x39')]);var _0x2fcb85={'where':_0x1a8913[_0x5aec('0x36')]};return db[_0x5aec('0x3a')]['count'](_0x2fcb85)['then'](function(_0x5c5561){_0x314f5b[_0x5aec('0x1a')]=_0x5c5561;if(_0x162e14[_0x5aec('0x2c')][_0x5aec('0x3b')]){_0x1a8913[_0x5aec('0x3c')]=[{'all':!![]}];}return db[_0x5aec('0x3a')]['findAll'](_0x1a8913);})[_0x5aec('0x20')](function(_0x3d8941){_0x314f5b[_0x5aec('0x3d')]=_0x3d8941;return _0x314f5b;})[_0x5aec('0x20')](respondWithFilteredResult(_0x38cdf0,_0x1a8913))['catch'](handleError(_0x38cdf0,null));};exports[_0x5aec('0x3e')]=function(_0x296798,_0x624ba9){var _0x1416e1={'raw':!![],'where':{'id':_0x296798[_0x5aec('0x3f')]['id']}},_0x52b574={};_0x52b574[_0x5aec('0x2a')]=_[_0x5aec('0x2b')](db[_0x5aec('0x3a')][_0x5aec('0x28')]);_0x52b574[_0x5aec('0x2c')]=_[_0x5aec('0x2b')](_0x296798[_0x5aec('0x2c')]);_0x52b574[_0x5aec('0x34')]=_['intersection'](_0x52b574[_0x5aec('0x2a')],_0x52b574['query']);_0x1416e1[_0x5aec('0x2e')]=_[_0x5aec('0x2d')](_0x52b574[_0x5aec('0x2a')],qs[_0x5aec('0x2f')](_0x296798['query'][_0x5aec('0x2f')]));_0x1416e1[_0x5aec('0x2e')]=_0x1416e1[_0x5aec('0x2e')][_0x5aec('0x40')]?_0x1416e1['attributes']:_0x52b574[_0x5aec('0x2a')];if(_0x296798[_0x5aec('0x2c')][_0x5aec('0x3b')]){_0x1416e1[_0x5aec('0x3c')]=[{'all':!![]}];}_0x1416e1=_[_0x5aec('0x37')]({},_0x1416e1,_0x296798[_0x5aec('0x39')]);return db[_0x5aec('0x3a')][_0x5aec('0x41')](_0x1416e1)[_0x5aec('0x20')](handleEntityNotFound(_0x624ba9,null))[_0x5aec('0x20')](respondWithResult(_0x624ba9,null))[_0x5aec('0x42')](handleError(_0x624ba9,null));};exports['create']=function(_0x525789,_0xfc7b62){return db[_0x5aec('0x3a')][_0x5aec('0x43')](_0x525789['body'],{})['then'](respondWithResult(_0xfc7b62,0xc9))['catch'](handleError(_0xfc7b62,null));};exports[_0x5aec('0x1f')]=function(_0x30edd5,_0x115aa9){if(_0x30edd5[_0x5aec('0x44')]['id']){delete _0x30edd5[_0x5aec('0x44')]['id'];}return db['SalesforceField'][_0x5aec('0x41')]({'where':{'id':_0x30edd5[_0x5aec('0x3f')]['id']}})[_0x5aec('0x20')](handleEntityNotFound(_0x115aa9,null))[_0x5aec('0x20')](saveUpdates(_0x30edd5[_0x5aec('0x44')],null))[_0x5aec('0x20')](respondWithResult(_0x115aa9,null))[_0x5aec('0x42')](handleError(_0x115aa9,null));};exports[_0x5aec('0x21')]=function(_0x58aa7e,_0x739ada){return db[_0x5aec('0x3a')]['find']({'where':{'id':_0x58aa7e[_0x5aec('0x3f')]['id']}})[_0x5aec('0x20')](handleEntityNotFound(_0x739ada,null))[_0x5aec('0x20')](removeEntity(_0x739ada,null))[_0x5aec('0x42')](handleError(_0x739ada,null));}; \ No newline at end of file +var _0x3846=['undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','SalesforceField','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x16631d,_0x1616f7){var _0x2fe458=function(_0x543cd8){while(--_0x543cd8){_0x16631d['push'](_0x16631d['shift']());}};_0x2fe458(++_0x1616f7);}(_0x3846,0xc5));var _0x6384=function(_0x2e914,_0x1c7566){_0x2e914=_0x2e914-0x0;var _0x936e45=_0x3846[_0x2e914];return _0x936e45;};'use strict';var emlformat=require(_0x6384('0x0'));var rimraf=require(_0x6384('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6384('0x2'));var rp=require(_0x6384('0x3'));var moment=require(_0x6384('0x4'));var BPromise=require(_0x6384('0x5'));var Mustache=require(_0x6384('0x6'));var util=require(_0x6384('0x7'));var path=require('path');var sox=require(_0x6384('0x8'));var csv=require(_0x6384('0x9'));var ejs=require(_0x6384('0xa'));var fs=require('fs');var fs_extra=require(_0x6384('0xb'));var _=require(_0x6384('0xc'));var squel=require(_0x6384('0xd'));var crypto=require(_0x6384('0xe'));var jsforce=require(_0x6384('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x6384('0x9'));var querystring=require(_0x6384('0x10'));var Papa=require(_0x6384('0x11'));var Redis=require(_0x6384('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6384('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6384('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6384('0x15'));var db=require(_0x6384('0x16'))['db'];function respondWithStatusCode(_0x1309fb,_0x3f4420){_0x3f4420=_0x3f4420||0xcc;return function(_0x2701bd){if(_0x2701bd){return _0x1309fb[_0x6384('0x17')](_0x3f4420);}return _0x1309fb[_0x6384('0x18')](_0x3f4420)[_0x6384('0x19')]();};}function respondWithResult(_0x33debf,_0x50817f){_0x50817f=_0x50817f||0xc8;return function(_0x112d76){if(_0x112d76){return _0x33debf[_0x6384('0x18')](_0x50817f)[_0x6384('0x1a')](_0x112d76);}};}function respondWithFilteredResult(_0x49197f,_0x3d6325){return function(_0x2a6dc9){if(_0x2a6dc9){var _0x27d76f=typeof _0x3d6325[_0x6384('0x1b')]===_0x6384('0x1c')&&typeof _0x3d6325[_0x6384('0x1d')]===_0x6384('0x1c');var _0x783593=_0x2a6dc9[_0x6384('0x1e')];var _0x501ec0=_0x27d76f?0x0:_0x3d6325['offset'];var _0x4f8428=_0x27d76f?_0x2a6dc9[_0x6384('0x1e')]:_0x3d6325[_0x6384('0x1b')]+_0x3d6325[_0x6384('0x1d')];var _0x1959a2;if(_0x4f8428>=_0x783593){_0x4f8428=_0x783593;_0x1959a2=0xc8;}else{_0x1959a2=0xce;}_0x49197f[_0x6384('0x18')](_0x1959a2);return _0x49197f[_0x6384('0x1f')](_0x6384('0x20'),_0x501ec0+'-'+_0x4f8428+'/'+_0x783593)['json'](_0x2a6dc9);}return null;};}function patchUpdates(_0x18b14f){return function(_0x17eb16){try{jsonpatch['apply'](_0x17eb16,_0x18b14f,!![]);}catch(_0x571eed){return BPromise[_0x6384('0x21')](_0x571eed);}return _0x17eb16[_0x6384('0x22')]();};}function saveUpdates(_0x5c3cac,_0x13662f){return function(_0x2e96b1){if(_0x2e96b1){return _0x2e96b1[_0x6384('0x23')](_0x5c3cac)[_0x6384('0x24')](function(_0x144bdd){return _0x144bdd;});}return null;};}function removeEntity(_0x233214,_0xedc86a){return function(_0x630bda){if(_0x630bda){return _0x630bda[_0x6384('0x25')]()[_0x6384('0x24')](function(){_0x233214[_0x6384('0x18')](0xcc)[_0x6384('0x19')]();});}};}function handleEntityNotFound(_0x38ea48,_0x1c42d8){return function(_0x47c95e){if(!_0x47c95e){_0x38ea48[_0x6384('0x17')](0x194);}return _0x47c95e;};}function handleError(_0x2d6802,_0xc5e0d8){_0xc5e0d8=_0xc5e0d8||0x1f4;return function(_0x569f02){logger[_0x6384('0x26')](_0x569f02[_0x6384('0x27')]);if(_0x569f02['name']){delete _0x569f02[_0x6384('0x28')];}_0x2d6802['status'](_0xc5e0d8)['send'](_0x569f02);};}exports[_0x6384('0x29')]=function(_0x5e2ba2,_0x1066e0){var _0x458c87={},_0x4fde3e={},_0x1c8fdc={'count':0x0,'rows':[]};var _0x4bae82=_['map'](db[_0x6384('0x2a')][_0x6384('0x2b')],function(_0x527929){return{'name':_0x527929[_0x6384('0x2c')],'type':_0x527929[_0x6384('0x2d')][_0x6384('0x2e')]};});_0x4fde3e[_0x6384('0x2f')]=_[_0x6384('0x30')](_0x4bae82,_0x6384('0x28'));_0x4fde3e['query']=_[_0x6384('0x31')](_0x5e2ba2[_0x6384('0x32')]);_0x4fde3e[_0x6384('0x33')]=_[_0x6384('0x34')](_0x4fde3e[_0x6384('0x2f')],_0x4fde3e[_0x6384('0x32')]);_0x458c87[_0x6384('0x35')]=_[_0x6384('0x34')](_0x4fde3e[_0x6384('0x2f')],qs['fields'](_0x5e2ba2[_0x6384('0x32')][_0x6384('0x36')]));_0x458c87['attributes']=_0x458c87[_0x6384('0x35')]['length']?_0x458c87[_0x6384('0x35')]:_0x4fde3e[_0x6384('0x2f')];if(!_0x5e2ba2['query'][_0x6384('0x37')](_0x6384('0x38'))){_0x458c87[_0x6384('0x1d')]=qs[_0x6384('0x1d')](_0x5e2ba2[_0x6384('0x32')][_0x6384('0x1d')]);_0x458c87[_0x6384('0x1b')]=qs['offset'](_0x5e2ba2[_0x6384('0x32')][_0x6384('0x1b')]);}_0x458c87[_0x6384('0x39')]=qs[_0x6384('0x3a')](_0x5e2ba2[_0x6384('0x32')]['sort']);_0x458c87[_0x6384('0x3b')]=qs[_0x6384('0x33')](_['pick'](_0x5e2ba2[_0x6384('0x32')],_0x4fde3e['filters']),_0x4bae82);if(_0x5e2ba2[_0x6384('0x32')][_0x6384('0x3c')]){_0x458c87['where']=_[_0x6384('0x3d')](_0x458c87[_0x6384('0x3b')],{'$or':_[_0x6384('0x30')](_0x4bae82,function(_0x5d5b12){if(_0x5d5b12['type']!==_0x6384('0x3e')){var _0x3a99a1={};_0x3a99a1[_0x5d5b12[_0x6384('0x28')]]={'$like':'%'+_0x5e2ba2[_0x6384('0x32')][_0x6384('0x3c')]+'%'};return _0x3a99a1;}})});}_0x458c87=_['merge']({},_0x458c87,_0x5e2ba2[_0x6384('0x3f')]);var _0x2c3fc8={'where':_0x458c87[_0x6384('0x3b')]};return db[_0x6384('0x2a')][_0x6384('0x1e')](_0x2c3fc8)[_0x6384('0x24')](function(_0x3462a2){_0x1c8fdc[_0x6384('0x1e')]=_0x3462a2;if(_0x5e2ba2['query'][_0x6384('0x40')]){_0x458c87[_0x6384('0x41')]=[{'all':!![]}];}return db['SalesforceField'][_0x6384('0x42')](_0x458c87);})['then'](function(_0x307738){_0x1c8fdc[_0x6384('0x43')]=_0x307738;return _0x1c8fdc;})[_0x6384('0x24')](respondWithFilteredResult(_0x1066e0,_0x458c87))[_0x6384('0x44')](handleError(_0x1066e0,null));};exports[_0x6384('0x45')]=function(_0x7a6d77,_0x4bec0f){var _0x2a9b6d={'raw':!![],'where':{'id':_0x7a6d77[_0x6384('0x46')]['id']}},_0x53018f={};_0x53018f['model']=_[_0x6384('0x31')](db[_0x6384('0x2a')]['rawAttributes']);_0x53018f[_0x6384('0x32')]=_[_0x6384('0x31')](_0x7a6d77[_0x6384('0x32')]);_0x53018f[_0x6384('0x33')]=_[_0x6384('0x34')](_0x53018f[_0x6384('0x2f')],_0x53018f[_0x6384('0x32')]);_0x2a9b6d[_0x6384('0x35')]=_[_0x6384('0x34')](_0x53018f[_0x6384('0x2f')],qs[_0x6384('0x36')](_0x7a6d77[_0x6384('0x32')][_0x6384('0x36')]));_0x2a9b6d[_0x6384('0x35')]=_0x2a9b6d[_0x6384('0x35')][_0x6384('0x47')]?_0x2a9b6d[_0x6384('0x35')]:_0x53018f['model'];if(_0x7a6d77[_0x6384('0x32')]['includeAll']){_0x2a9b6d[_0x6384('0x41')]=[{'all':!![]}];}_0x2a9b6d=_[_0x6384('0x3d')]({},_0x2a9b6d,_0x7a6d77[_0x6384('0x3f')]);return db[_0x6384('0x2a')][_0x6384('0x48')](_0x2a9b6d)['then'](handleEntityNotFound(_0x4bec0f,null))[_0x6384('0x24')](respondWithResult(_0x4bec0f,null))[_0x6384('0x44')](handleError(_0x4bec0f,null));};exports[_0x6384('0x49')]=function(_0x5945e4,_0x459d99){return db[_0x6384('0x2a')][_0x6384('0x49')](_0x5945e4[_0x6384('0x4a')],{})[_0x6384('0x24')](respondWithResult(_0x459d99,0xc9))[_0x6384('0x44')](handleError(_0x459d99,null));};exports['update']=function(_0x59119a,_0x3f6a0e){if(_0x59119a[_0x6384('0x4a')]['id']){delete _0x59119a[_0x6384('0x4a')]['id'];}return db['SalesforceField'][_0x6384('0x48')]({'where':{'id':_0x59119a[_0x6384('0x46')]['id']}})[_0x6384('0x24')](handleEntityNotFound(_0x3f6a0e,null))[_0x6384('0x24')](saveUpdates(_0x59119a[_0x6384('0x4a')],null))['then'](respondWithResult(_0x3f6a0e,null))[_0x6384('0x44')](handleError(_0x3f6a0e,null));};exports[_0x6384('0x25')]=function(_0x5e55e4,_0x3b1b39){return db['SalesforceField'][_0x6384('0x48')]({'where':{'id':_0x5e55e4[_0x6384('0x46')]['id']}})[_0x6384('0x24')](handleEntityNotFound(_0x3b1b39,null))[_0x6384('0x24')](removeEntity(_0x3b1b39,null))[_0x6384('0x44')](handleError(_0x3b1b39,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index e8847d6..4cd5b85 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 _0x87b3=['bluebird','request-promise','path','rimraf','./intSalesforceField.attributes','exports','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','../../config/logger'];(function(_0x378720,_0xa711f1){var _0x47920a=function(_0xc5056){while(--_0xc5056){_0x378720['push'](_0x378720['shift']());}};_0x47920a(++_0xa711f1);}(_0x87b3,0xee));var _0x387b=function(_0x4a30f1,_0x2e75a8){_0x4a30f1=_0x4a30f1-0x0;var _0x1e0a09=_0x87b3[_0x4a30f1];return _0x1e0a09;};'use strict';var _=require(_0x387b('0x0'));var util=require('util');var logger=require(_0x387b('0x1'))('api');var moment=require('moment');var BPromise=require(_0x387b('0x2'));var rp=require(_0x387b('0x3'));var fs=require('fs');var path=require(_0x387b('0x4'));var rimraf=require(_0x387b('0x5'));var config=require('../../config/environment');var attributes=require(_0x387b('0x6'));module[_0x387b('0x7')]=function(_0x11b998,_0x33ac14){return _0x11b998['define']('SalesforceField',attributes,{'tableName':_0x387b('0x8'),'paranoid':![],'indexes':[{'name':_0x387b('0x9'),'fields':[_0x387b('0xa'),_0x387b('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdd73=['FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./intSalesforceField.attributes','exports','define','SalesforceField'];(function(_0x39b187,_0x5f0b31){var _0x5146d9=function(_0x4bda81){while(--_0x4bda81){_0x39b187['push'](_0x39b187['shift']());}};_0x5146d9(++_0x5f0b31);}(_0xdd73,0x11f));var _0x3dd7=function(_0x76d88d,_0x48b0f2){_0x76d88d=_0x76d88d-0x0;var _0x2fa9e0=_0xdd73[_0x76d88d];return _0x2fa9e0;};'use strict';var _=require(_0x3dd7('0x0'));var util=require(_0x3dd7('0x1'));var logger=require(_0x3dd7('0x2'))('api');var moment=require(_0x3dd7('0x3'));var BPromise=require(_0x3dd7('0x4'));var rp=require(_0x3dd7('0x5'));var fs=require('fs');var path=require(_0x3dd7('0x6'));var rimraf=require(_0x3dd7('0x7'));var config=require('../../config/environment');var attributes=require(_0x3dd7('0x8'));module[_0x3dd7('0x9')]=function(_0xe72f34,_0x56fb49){return _0xe72f34[_0x3dd7('0xa')](_0x3dd7('0xb'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':['idField',_0x3dd7('0xc')],'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 052c530..b8dc88e 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 _0x547c=['stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','SalesforceField,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x2f71f6,_0x3a1f4d){var _0x2b23ea=function(_0x285980){while(--_0x285980){_0x2f71f6['push'](_0x2f71f6['shift']());}};_0x2b23ea(++_0x3a1f4d);}(_0x547c,0x101));var _0xc547=function(_0x5b2253,_0x6cf3cb){_0x5b2253=_0x5b2253-0x0;var _0xdf2e9a=_0x547c[_0x5b2253];return _0xdf2e9a;};'use strict';var _=require(_0xc547('0x0'));var util=require(_0xc547('0x1'));var moment=require(_0xc547('0x2'));var BPromise=require(_0xc547('0x3'));var rs=require(_0xc547('0x4'));var fs=require('fs');var Redis=require(_0xc547('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc547('0x6'))(_0xc547('0x7'));var config=require(_0xc547('0x8'));var jayson=require(_0xc547('0x9'));var client=jayson['client'][_0xc547('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x582ee5,_0x4ae252,_0x252ac5){return new BPromise(function(_0x53f5e4,_0x425742){return client['request'](_0x582ee5,_0x252ac5)[_0xc547('0xb')](function(_0x477ee8){logger[_0xc547('0xc')](_0xc547('0xd'),_0x4ae252,'request\x20sent');logger[_0xc547('0xe')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x4ae252,_0xc547('0xf'),JSON[_0xc547('0x10')](_0x477ee8));if(_0x477ee8[_0xc547('0x11')]){if(_0x477ee8[_0xc547('0x11')][_0xc547('0x12')]===0x1f4){logger[_0xc547('0x11')](_0xc547('0xd'),_0x4ae252,_0x477ee8[_0xc547('0x11')][_0xc547('0x13')]);return _0x425742(_0x477ee8[_0xc547('0x11')][_0xc547('0x13')]);}logger[_0xc547('0x11')](_0xc547('0xd'),_0x4ae252,_0x477ee8[_0xc547('0x11')][_0xc547('0x13')]);return _0x53f5e4(_0x477ee8['error']['message']);}else{logger[_0xc547('0xc')](_0xc547('0xd'),_0x4ae252,_0xc547('0xf'));_0x53f5e4(_0x477ee8['result'][_0xc547('0x13')]);}})[_0xc547('0x14')](function(_0x565aa3){logger[_0xc547('0x11')](_0xc547('0xd'),_0x4ae252,_0x565aa3);_0x425742(_0x565aa3);});});} \ No newline at end of file +var _0xf284=['stringify','error','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s'];(function(_0x5664e0,_0x11a140){var _0x4978dc=function(_0x3af5fb){while(--_0x3af5fb){_0x5664e0['push'](_0x5664e0['shift']());}};_0x4978dc(++_0x11a140);}(_0xf284,0xcd));var _0x4f28=function(_0x4b78f1,_0xa07287){_0x4b78f1=_0x4b78f1-0x0;var _0xe80dfa=_0xf284[_0x4b78f1];return _0xe80dfa;};'use strict';var _=require(_0x4f28('0x0'));var util=require(_0x4f28('0x1'));var moment=require(_0x4f28('0x2'));var BPromise=require(_0x4f28('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4f28('0x4'))['db'];var utils=require(_0x4f28('0x5'));var logger=require(_0x4f28('0x6'))('rpc');var config=require(_0x4f28('0x7'));var jayson=require(_0x4f28('0x8'));var client=jayson[_0x4f28('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x870365,_0x23299c,_0x1723e3){return new BPromise(function(_0x49c11a,_0x580264){return client['request'](_0x870365,_0x1723e3)['then'](function(_0x41b309){logger[_0x4f28('0xa')](_0x4f28('0xb'),_0x23299c,_0x4f28('0xc'));logger[_0x4f28('0xd')](_0x4f28('0xe'),_0x23299c,_0x4f28('0xc'),JSON[_0x4f28('0xf')](_0x41b309));if(_0x41b309[_0x4f28('0x10')]){if(_0x41b309[_0x4f28('0x10')]['code']===0x1f4){logger[_0x4f28('0x10')](_0x4f28('0xb'),_0x23299c,_0x41b309[_0x4f28('0x10')][_0x4f28('0x11')]);return _0x580264(_0x41b309['error']['message']);}logger[_0x4f28('0x10')](_0x4f28('0xb'),_0x23299c,_0x41b309[_0x4f28('0x10')]['message']);return _0x49c11a(_0x41b309[_0x4f28('0x10')][_0x4f28('0x11')]);}else{logger[_0x4f28('0xa')](_0x4f28('0xb'),_0x23299c,_0x4f28('0xc'));_0x49c11a(_0x41b309[_0x4f28('0x12')][_0x4f28('0x11')]);}})[_0x4f28('0x13')](function(_0x452976){logger[_0x4f28('0x10')]('SalesforceField,\x20%s,\x20%s',_0x23299c,_0x452976);_0x580264(_0x452976);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 8ea935c..64b65bb 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 _0xbff9=['../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x283378,_0x4a0282){var _0x306ffa=function(_0xe971a0){while(--_0xe971a0){_0x283378['push'](_0x283378['shift']());}};_0x306ffa(++_0x4a0282);}(_0xbff9,0x197));var _0x9bff=function(_0x1843c2,_0x3a6bfc){_0x1843c2=_0x1843c2-0x0;var _0x30cfe7=_0xbff9[_0x1843c2];return _0x30cfe7;};'use strict';var multer=require(_0x9bff('0x0'));var util=require(_0x9bff('0x1'));var path=require(_0x9bff('0x2'));var timeout=require(_0x9bff('0x3'));var express=require(_0x9bff('0x4'));var router=express[_0x9bff('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9bff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9bff('0x7'));var controller=require(_0x9bff('0x8'));router[_0x9bff('0x9')]('/',auth[_0x9bff('0xa')](),controller['index']);router[_0x9bff('0x9')](_0x9bff('0xb'),auth[_0x9bff('0xa')](),controller[_0x9bff('0xc')]);router[_0x9bff('0x9')](_0x9bff('0xd'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x9bff('0x9')](_0x9bff('0xe'),auth['isAuthenticated'](),controller[_0x9bff('0xf')]);router[_0x9bff('0x10')]('/',auth[_0x9bff('0xa')](),controller[_0x9bff('0x11')]);router[_0x9bff('0x10')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x9bff('0x12')]);router['put'](_0x9bff('0xb'),auth[_0x9bff('0xa')](),controller[_0x9bff('0x13')]);router[_0x9bff('0x14')](_0x9bff('0xb'),auth[_0x9bff('0xa')](),controller[_0x9bff('0x15')]);module[_0x9bff('0x16')]=router; \ No newline at end of file +var _0x6824=['/:id','exports','multer','util','express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete'];(function(_0xcdb1c1,_0x4ae65d){var _0x30028f=function(_0x5e4c07){while(--_0x5e4c07){_0xcdb1c1['push'](_0xcdb1c1['shift']());}};_0x30028f(++_0x4ae65d);}(_0x6824,0x80));var _0x4682=function(_0x48fcf6,_0x529757){_0x48fcf6=_0x48fcf6-0x0;var _0x5eaaa5=_0x6824[_0x48fcf6];return _0x5eaaa5;};'use strict';var multer=require(_0x4682('0x0'));var util=require(_0x4682('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4682('0x2'));var router=express['Router']();var fs_extra=require(_0x4682('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x4682('0x4'));var config=require(_0x4682('0x5'));var controller=require('./intServicenowAccount.controller');router['get']('/',auth[_0x4682('0x6')](),controller[_0x4682('0x7')]);router[_0x4682('0x8')]('/:id',auth[_0x4682('0x6')](),controller[_0x4682('0x9')]);router[_0x4682('0x8')](_0x4682('0xa'),auth[_0x4682('0x6')](),controller['getConfigurations']);router[_0x4682('0x8')](_0x4682('0xb'),auth[_0x4682('0x6')](),controller[_0x4682('0xc')]);router[_0x4682('0xd')]('/',auth[_0x4682('0x6')](),controller[_0x4682('0xe')]);router[_0x4682('0xd')](_0x4682('0xa'),auth[_0x4682('0x6')](),controller[_0x4682('0xf')]);router[_0x4682('0x10')]('/:id',auth[_0x4682('0x6')](),controller[_0x4682('0x11')]);router[_0x4682('0x12')](_0x4682('0x13'),auth[_0x4682('0x6')](),controller['destroy']);module[_0x4682('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index db32d28..7a2dee0 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 _0x8efd=['username','remoteUri','sequelize','exports','STRING'];(function(_0x5c3728,_0x2bdeba){var _0x18176c=function(_0x568b3e){while(--_0x568b3e){_0x5c3728['push'](_0x5c3728['shift']());}};_0x18176c(++_0x2bdeba);}(_0x8efd,0x6b));var _0xd8ef=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x8efd[_0x199572];return _0x13cfa3;};'use strict';var Sequelize=require(_0xd8ef('0x0'));module[_0xd8ef('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd8ef('0x2')]},'username':{'type':Sequelize[_0xd8ef('0x2')],'unique':_0xd8ef('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xd8ef('0x2')]},'remoteUri':{'type':Sequelize[_0xd8ef('0x2')],'unique':_0xd8ef('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x4b74=['STRING','username','exports'];(function(_0x3aaf0a,_0x450970){var _0x33e6bc=function(_0x1db54d){while(--_0x1db54d){_0x3aaf0a['push'](_0x3aaf0a['shift']());}};_0x33e6bc(++_0x450970);}(_0x4b74,0xe0));var _0x44b7=function(_0x59f85a,_0x5b5d2e){_0x59f85a=_0x59f85a-0x0;var _0x47282b=_0x4b74[_0x59f85a];return _0x47282b;};'use strict';var Sequelize=require('sequelize');module[_0x44b7('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x44b7('0x1')]},'username':{'type':Sequelize[_0x44b7('0x1')],'unique':_0x44b7('0x2')},'password':{'type':Sequelize[_0x44b7('0x1')]},'email':{'type':Sequelize[_0x44b7('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index f415d7f..0aa63bc 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 _0x907e=['catch','show','params','find','create','body','getConfigurations','findOne','ServicenowConfiguration','pick','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','getFields','made_sla','subcategory','close_code','notify','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','resolved_by','sys_updated_by','opened_by','sys_created_on','state','sys_created_by','closed_at','cmdb_ci','delivery_plan','work_notes_list','priority','sys_domain_path','rfc','time_worked','opened_at','business_duration','group_list','approval_set','work_notes','short_description','delivery_task','work_start','assignment_group','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','sys_id','contact_type','reopened_by','problem_id','company','activity_due','assigned_to','comments','sla_due','approval','due_date','sys_mod_count','reopen_count','sys_tags','escalation','correlation_id','password','email','remoteUri','serverUrl','format','%s/api/now/doc/table/schema/','%s/api/now/table/','username','GET','incident?sysparm_display_value=all','result','log','includes','forEach','internalType','label','push','all','assign','TCL:\x20_object','remove','concat','ServiceNow\x20error:\x20','test','statusCode','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../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','Content-Range','reject','save','update','then','error','stack','name','send','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','ServicenowAccount','includeAll','include','findAll','rows'];(function(_0x1aa049,_0x9ae13c){var _0x357f29=function(_0xfd2f83){while(--_0xfd2f83){_0x1aa049['push'](_0x1aa049['shift']());}};_0x357f29(++_0x9ae13c);}(_0x907e,0x1d3));var _0xe907=function(_0x470bfb,_0x389787){_0x470bfb=_0x470bfb-0x0;var _0x2f5d97=_0x907e[_0x470bfb];return _0x2f5d97;};'use strict';var emlformat=require(_0xe907('0x0'));var rimraf=require(_0xe907('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe907('0x2'));var rp=require(_0xe907('0x3'));var moment=require(_0xe907('0x4'));var BPromise=require(_0xe907('0x5'));var Mustache=require(_0xe907('0x6'));var util=require('util');var path=require(_0xe907('0x7'));var sox=require(_0xe907('0x8'));var csv=require(_0xe907('0x9'));var ejs=require(_0xe907('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe907('0xb'));var squel=require(_0xe907('0xc'));var crypto=require(_0xe907('0xd'));var jsforce=require(_0xe907('0xe'));var deskjs=require(_0xe907('0xf'));var toCsv=require(_0xe907('0x9'));var querystring=require('querystring');var Papa=require(_0xe907('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe907('0x11'));var as=require(_0xe907('0x12'));var hardwareService=require(_0xe907('0x13'));var logger=require(_0xe907('0x14'))('api');var utils=require(_0xe907('0x15'));var config=require(_0xe907('0x16'));var licenseUtil=require(_0xe907('0x17'));var db=require(_0xe907('0x18'))['db'];var integrations=require(_0xe907('0x19'));function respondWithStatusCode(_0x1804f7,_0x283c01){_0x283c01=_0x283c01||0xcc;return function(_0xc05dbc){if(_0xc05dbc){return _0x1804f7[_0xe907('0x1a')](_0x283c01);}return _0x1804f7[_0xe907('0x1b')](_0x283c01)[_0xe907('0x1c')]();};}function respondWithResult(_0x2d1696,_0x3ad5dc){_0x3ad5dc=_0x3ad5dc||0xc8;return function(_0x21a69f){if(_0x21a69f){return _0x2d1696[_0xe907('0x1b')](_0x3ad5dc)[_0xe907('0x1d')](_0x21a69f);}};}function respondWithFilteredResult(_0xc7fa78,_0x269639){return function(_0x2aea0d){if(_0x2aea0d){var _0x4bbe8b=typeof _0x269639[_0xe907('0x1e')]===_0xe907('0x1f')&&typeof _0x269639[_0xe907('0x20')]===_0xe907('0x1f');var _0x2044d5=_0x2aea0d[_0xe907('0x21')];var _0x556afa=_0x4bbe8b?0x0:_0x269639[_0xe907('0x1e')];var _0x1743f7=_0x4bbe8b?_0x2aea0d[_0xe907('0x21')]:_0x269639[_0xe907('0x1e')]+_0x269639[_0xe907('0x20')];var _0x4a8106;if(_0x1743f7>=_0x2044d5){_0x1743f7=_0x2044d5;_0x4a8106=0xc8;}else{_0x4a8106=0xce;}_0xc7fa78[_0xe907('0x1b')](_0x4a8106);return _0xc7fa78[_0xe907('0x22')](_0xe907('0x23'),_0x556afa+'-'+_0x1743f7+'/'+_0x2044d5)[_0xe907('0x1d')](_0x2aea0d);}return null;};}function patchUpdates(_0x3e362a){return function(_0x4ee049){try{jsonpatch['apply'](_0x4ee049,_0x3e362a,!![]);}catch(_0x4e8dac){return BPromise[_0xe907('0x24')](_0x4e8dac);}return _0x4ee049[_0xe907('0x25')]();};}function saveUpdates(_0x272fdd,_0x1d4039){return function(_0x1c1a30){if(_0x1c1a30){return _0x1c1a30[_0xe907('0x26')](_0x272fdd)[_0xe907('0x27')](function(_0x386007){return _0x386007;});}return null;};}function removeEntity(_0xe22783,_0x404ae2){return function(_0x22226e){if(_0x22226e){return _0x22226e['destroy']()[_0xe907('0x27')](function(){_0xe22783[_0xe907('0x1b')](0xcc)[_0xe907('0x1c')]();});}};}function handleEntityNotFound(_0x4ef16c,_0x5e7d21){return function(_0x3d8c81){if(!_0x3d8c81){_0x4ef16c['sendStatus'](0x194);}return _0x3d8c81;};}function handleError(_0x32d8c6,_0x51fd78){_0x51fd78=_0x51fd78||0x1f4;return function(_0x433260){logger[_0xe907('0x28')](_0x433260[_0xe907('0x29')]);if(_0x433260['name']){delete _0x433260[_0xe907('0x2a')];}_0x32d8c6[_0xe907('0x1b')](_0x51fd78)[_0xe907('0x2b')](_0x433260);};}exports['index']=function(_0x3dbedc,_0x41c75f){var _0x273fc1={},_0x23f420={},_0x16545e={'count':0x0,'rows':[]};var _0x4ca42a=_['map'](db['ServicenowAccount'][_0xe907('0x2c')],function(_0x2bac8f){return{'name':_0x2bac8f[_0xe907('0x2d')],'type':_0x2bac8f[_0xe907('0x2e')]['key']};});_0x23f420[_0xe907('0x2f')]=_[_0xe907('0x30')](_0x4ca42a,_0xe907('0x2a'));_0x23f420['query']=_[_0xe907('0x31')](_0x3dbedc[_0xe907('0x32')]);_0x23f420[_0xe907('0x33')]=_[_0xe907('0x34')](_0x23f420[_0xe907('0x2f')],_0x23f420[_0xe907('0x32')]);_0x273fc1[_0xe907('0x35')]=_['intersection'](_0x23f420['model'],qs[_0xe907('0x36')](_0x3dbedc[_0xe907('0x32')][_0xe907('0x36')]));_0x273fc1[_0xe907('0x35')]=_0x273fc1['attributes'][_0xe907('0x37')]?_0x273fc1['attributes']:_0x23f420[_0xe907('0x2f')];if(!_0x3dbedc[_0xe907('0x32')][_0xe907('0x38')](_0xe907('0x39'))){_0x273fc1[_0xe907('0x20')]=qs[_0xe907('0x20')](_0x3dbedc[_0xe907('0x32')]['limit']);_0x273fc1[_0xe907('0x1e')]=qs['offset'](_0x3dbedc['query'][_0xe907('0x1e')]);}_0x273fc1[_0xe907('0x3a')]=qs[_0xe907('0x3b')](_0x3dbedc['query'][_0xe907('0x3b')]);_0x273fc1[_0xe907('0x3c')]=qs[_0xe907('0x33')](_['pick'](_0x3dbedc[_0xe907('0x32')],_0x23f420[_0xe907('0x33')]),_0x4ca42a);if(_0x3dbedc[_0xe907('0x32')][_0xe907('0x3d')]){_0x273fc1[_0xe907('0x3c')]=_[_0xe907('0x3e')](_0x273fc1[_0xe907('0x3c')],{'$or':_[_0xe907('0x30')](_0x4ca42a,function(_0x49ef44){if(_0x49ef44[_0xe907('0x2e')]!==_0xe907('0x3f')){var _0xcb92fe={};_0xcb92fe[_0x49ef44[_0xe907('0x2a')]]={'$like':'%'+_0x3dbedc[_0xe907('0x32')][_0xe907('0x3d')]+'%'};return _0xcb92fe;}})});}_0x273fc1=_[_0xe907('0x3e')]({},_0x273fc1,_0x3dbedc[_0xe907('0x40')]);var _0x42e263={'where':_0x273fc1['where']};return db[_0xe907('0x41')]['count'](_0x42e263)['then'](function(_0x143bfb){_0x16545e['count']=_0x143bfb;if(_0x3dbedc['query'][_0xe907('0x42')]){_0x273fc1[_0xe907('0x43')]=[{'all':!![]}];}return db[_0xe907('0x41')][_0xe907('0x44')](_0x273fc1);})[_0xe907('0x27')](function(_0x2149db){_0x16545e[_0xe907('0x45')]=_0x2149db;return _0x16545e;})['then'](respondWithFilteredResult(_0x41c75f,_0x273fc1))[_0xe907('0x46')](handleError(_0x41c75f,null));};exports[_0xe907('0x47')]=function(_0x4f39fa,_0x1a3810){var _0x40828e={'raw':![],'where':{'id':_0x4f39fa[_0xe907('0x48')]['id']}},_0x493ff5={};_0x493ff5['model']=_[_0xe907('0x31')](db[_0xe907('0x41')]['rawAttributes']);_0x493ff5[_0xe907('0x32')]=_[_0xe907('0x31')](_0x4f39fa[_0xe907('0x32')]);_0x493ff5[_0xe907('0x33')]=_[_0xe907('0x34')](_0x493ff5[_0xe907('0x2f')],_0x493ff5[_0xe907('0x32')]);_0x40828e[_0xe907('0x35')]=_['intersection'](_0x493ff5[_0xe907('0x2f')],qs[_0xe907('0x36')](_0x4f39fa[_0xe907('0x32')]['fields']));_0x40828e[_0xe907('0x35')]=_0x40828e[_0xe907('0x35')][_0xe907('0x37')]?_0x40828e['attributes']:_0x493ff5['model'];if(_0x4f39fa[_0xe907('0x32')]['includeAll']){_0x40828e['include']=[{'all':!![]}];}_0x40828e=_['merge']({},_0x40828e,_0x4f39fa[_0xe907('0x40')]);return db[_0xe907('0x41')][_0xe907('0x49')](_0x40828e)[_0xe907('0x27')](handleEntityNotFound(_0x1a3810,null))[_0xe907('0x27')](respondWithResult(_0x1a3810,null))[_0xe907('0x46')](handleError(_0x1a3810,null));};exports[_0xe907('0x4a')]=function(_0x290cc0,_0x59d583){return db['ServicenowAccount']['create'](_0x290cc0['body'],{})[_0xe907('0x27')](respondWithResult(_0x59d583,0xc9))[_0xe907('0x46')](handleError(_0x59d583,null));};exports[_0xe907('0x26')]=function(_0x4b64a7,_0xeba8d9){if(_0x4b64a7[_0xe907('0x4b')]['id']){delete _0x4b64a7[_0xe907('0x4b')]['id'];}return db[_0xe907('0x41')][_0xe907('0x49')]({'where':{'id':_0x4b64a7[_0xe907('0x48')]['id']}})[_0xe907('0x27')](handleEntityNotFound(_0xeba8d9,null))[_0xe907('0x27')](saveUpdates(_0x4b64a7['body'],null))[_0xe907('0x27')](respondWithResult(_0xeba8d9,null))['catch'](handleError(_0xeba8d9,null));};exports['destroy']=function(_0x253008,_0x9c99a){return db[_0xe907('0x41')][_0xe907('0x49')]({'where':{'id':_0x253008[_0xe907('0x48')]['id']}})[_0xe907('0x27')](handleEntityNotFound(_0x9c99a,null))['then'](removeEntity(_0x9c99a,null))[_0xe907('0x46')](handleError(_0x9c99a,null));};exports[_0xe907('0x4c')]=function(_0x2d8843,_0x20d51b,_0x407b9d){var _0x2bda87={};var _0x5af6f8={};var _0x25a4ef;var _0x448ebc;return db['ServicenowAccount'][_0xe907('0x4d')]({'where':{'id':_0x2d8843[_0xe907('0x48')]['id']}})[_0xe907('0x27')](handleEntityNotFound(_0x20d51b,null))[_0xe907('0x27')](function(_0x5e6790){if(_0x5e6790){_0x25a4ef=_0x5e6790;_0x5af6f8[_0xe907('0x2f')]=_[_0xe907('0x31')](db[_0xe907('0x4e')]['rawAttributes']);_0x5af6f8['query']=_[_0xe907('0x31')](_0x2d8843[_0xe907('0x32')]);_0x5af6f8[_0xe907('0x33')]=_['intersection'](_0x5af6f8[_0xe907('0x2f')],_0x5af6f8[_0xe907('0x32')]);_0x2bda87[_0xe907('0x35')]=_[_0xe907('0x34')](_0x5af6f8[_0xe907('0x2f')],qs[_0xe907('0x36')](_0x2d8843['query'][_0xe907('0x36')]));_0x2bda87['attributes']=_0x2bda87['attributes'][_0xe907('0x37')]?_0x2bda87[_0xe907('0x35')]:_0x5af6f8[_0xe907('0x2f')];_0x2bda87[_0xe907('0x3a')]=qs[_0xe907('0x3b')](_0x2d8843[_0xe907('0x32')][_0xe907('0x3b')]);_0x2bda87[_0xe907('0x3c')]=qs['filters'](_[_0xe907('0x4f')](_0x2d8843['query'],_0x5af6f8[_0xe907('0x33')]));if(_0x2d8843[_0xe907('0x32')][_0xe907('0x3d')]){_0x2bda87[_0xe907('0x3c')]=_[_0xe907('0x3e')](_0x2bda87[_0xe907('0x3c')],{'$or':_[_0xe907('0x30')](_0x2bda87[_0xe907('0x35')],function(_0xe64aae){var _0x4c5398={};_0x4c5398[_0xe64aae]={'$like':'%'+_0x2d8843[_0xe907('0x32')][_0xe907('0x3d')]+'%'};return _0x4c5398;})});}_0x2bda87=_[_0xe907('0x3e')]({},_0x2bda87,_0x2d8843[_0xe907('0x40')]);return _0x25a4ef[_0xe907('0x4c')](_0x2bda87);}})['then'](function(_0x2f6e6a){if(_0x2f6e6a){_0x448ebc=_0x2f6e6a['length'];if(!_0x2d8843[_0xe907('0x32')][_0xe907('0x38')](_0xe907('0x39'))){_0x2bda87[_0xe907('0x20')]=qs['limit'](_0x2d8843['query'][_0xe907('0x20')]);_0x2bda87[_0xe907('0x1e')]=qs[_0xe907('0x1e')](_0x2d8843[_0xe907('0x32')][_0xe907('0x1e')]);}return _0x25a4ef['getConfigurations'](_0x2bda87);}})[_0xe907('0x27')](function(_0x51b05f){if(_0x51b05f){return _0x51b05f?{'count':_0x448ebc,'rows':_0x51b05f}:null;}})['then'](respondWithResult(_0x20d51b,null))[_0xe907('0x46')](handleError(_0x20d51b,null));};exports['addConfiguration']=function(_0x2371ef,_0x527c4f,_0x5ca070){if(_0x2371ef['body']['id']){delete _0x2371ef[_0xe907('0x4b')]['id'];}return db[_0xe907('0x41')][_0xe907('0x4d')]({'where':{'id':_0x2371ef['params']['id']}})['then'](handleEntityNotFound(_0x527c4f,null))[_0xe907('0x27')](function(_0x8a7a8){if(_0x8a7a8){_0x2371ef['body'][_0xe907('0x50')]=_0x8a7a8['id'];_0x2371ef[_0xe907('0x4b')][_0xe907('0x51')]=integrations[_0xe907('0x52')](_0x2371ef[_0xe907('0x4b')][_0xe907('0x53')],_0x2371ef['body'][_0xe907('0x2e')]);_0x2371ef[_0xe907('0x4b')][_0xe907('0x54')]=integrations[_0xe907('0x55')](_0x2371ef[_0xe907('0x4b')][_0xe907('0x53')],_0x2371ef['body'][_0xe907('0x2e')]);return db['ServicenowConfiguration']['create'](_0x2371ef[_0xe907('0x4b')],{'include':[{'model':db['ServicenowField'],'as':_0xe907('0x51')},{'model':db['ServicenowField'],'as':_0xe907('0x54')}]});}return null;})['then'](respondWithResult(_0x527c4f,null))[_0xe907('0x46')](handleError(_0x527c4f,null));};exports[_0xe907('0x56')]=function(_0x1fecd1,_0x1d361b,_0x21c68f){var _0x28cbb0=[_0xe907('0x57'),'hold_reason','knowledge',_0xe907('0x58'),_0xe907('0x59'),_0xe907('0x5a'),_0xe907('0x5b'),_0xe907('0x5c'),_0xe907('0x5d')];var _0x56c51c=[_0xe907('0x5e'),_0xe907('0x57'),_0xe907('0x5f'),_0xe907('0x60'),_0xe907('0x61'),_0xe907('0x62'),_0xe907('0x63'),'hold_reason',_0xe907('0x64'),'number',_0xe907('0x65'),_0xe907('0x66'),_0xe907('0x67'),'user_input',_0xe907('0x68'),'sys_domain',_0xe907('0x69'),_0xe907('0x6a'),'knowledge',_0xe907('0x3a'),'calendar_stc',_0xe907('0x6b'),_0xe907('0x6c'),_0xe907('0x6d'),'impact','active',_0xe907('0x6e'),'business_service',_0xe907('0x6f'),_0xe907('0x70'),_0xe907('0x71'),_0xe907('0x72'),'expected_start',_0xe907('0x73'),_0xe907('0x74'),_0xe907('0x75'),'work_end','reopened_time','resolved_at','caller_id',_0xe907('0x76'),_0xe907('0x58'),_0xe907('0x77'),_0xe907('0x78'),_0xe907('0x59'),'correlation_display',_0xe907('0x79'),_0xe907('0x7a'),_0xe907('0x7b'),'business_stc','additional_assignee_list',_0xe907('0x7c'),_0xe907('0x7d'),_0xe907('0x5a'),_0xe907('0x7e'),_0xe907('0x7f'),_0xe907('0x80'),_0xe907('0x81'),'parent_incident',_0xe907('0x82'),_0xe907('0x83'),_0xe907('0x84'),_0xe907('0x5b'),'urgency',_0xe907('0x85'),_0xe907('0x86'),'reassignment_count',_0xe907('0x87'),_0xe907('0x88'),_0xe907('0x5c'),_0xe907('0x89'),_0xe907('0x8a'),_0xe907('0x8b'),'comments_and_work_notes',_0xe907('0x8c'),_0xe907('0x8d'),_0xe907('0x8e'),_0xe907('0x8f'),_0xe907('0x90'),'upon_approval',_0xe907('0x91'),'location',_0xe907('0x5d')];var _0x21e514='';var _0x880e64='';var _0x584728=[];var _0x48a39c='';var _0x5e281c='';var _0x4008b6=[];var _0x17fc71='';var _0x345b15='';var _0x558cd9={};var _0x5425ed='';return db['ServicenowAccount'][_0xe907('0x4d')]({'where':{'id':_0x1fecd1['params']['id']},'attributes':['id','username',_0xe907('0x92'),_0xe907('0x93'),_0xe907('0x94'),_0xe907('0x95')]})[_0xe907('0x27')](handleEntityNotFound(_0x1d361b,null))[_0xe907('0x27')](function(_0x3d58f0){if(_0x3d58f0){_0x5425ed=_0x3d58f0['remoteUri'];var _0xad1cb3=_0x5425ed['slice'](-0x1);if(_0xad1cb3==='/'){_0x5425ed=_0x5425ed['substring'](0x0,_0x5425ed['lastIndexOf'](_0xad1cb3));}_0x345b15=util[_0xe907('0x96')](_0xe907('0x97'),_0x5425ed);_0x17fc71=util[_0xe907('0x96')](_0xe907('0x98'),_0x5425ed);_0x558cd9={'user':_0x3d58f0[_0xe907('0x99')],'pass':_0x3d58f0[_0xe907('0x92')]};var _0x3eca67={'method':_0xe907('0x9a'),'uri':_0x345b15+_0xe907('0x9b'),'auth':_0x558cd9,'json':!![]};return rp(_0x3eca67);}})[_0xe907('0x27')](function(_0x32c739){if(_0x32c739[_0xe907('0x9c')][_0xe907('0x37')]>0x0){_0x21e514=_0x32c739[_0xe907('0x9c')];}console[_0xe907('0x9d')]('incident\x20table\x20objects',_0x21e514);_0x4008b6=[];_0x880e64=Object['assign']([],_0x21e514);_['remove'](_0x880e64,function(_0x5eb085){return!_0x28cbb0[_0xe907('0x9e')](_0x5eb085[_0xe907('0x2a')]);});_0x880e64[_0xe907('0x9f')](function(_0x33deda){var _0x4171fc=createFieldObject(_0x17fc71,_0x558cd9,_0x33deda[_0xe907('0xa0')],_0x33deda[_0xe907('0x2a')],_0x33deda[_0xe907('0xa1')],![]);_0x4008b6[_0xe907('0xa2')](_0x4171fc);});return Promise[_0xe907('0xa3')](_0x4008b6);})[_0xe907('0x27')](function(_0x401b04){_0x584728=_0x401b04;_0x48a39c=Object[_0xe907('0xa4')]([],_0x21e514);console[_0xe907('0x9d')](_0xe907('0xa5'),_0x21e514);_[_0xe907('0xa6')](_0x48a39c,function(_0x5e1c5d){return _0x56c51c['includes'](_0x5e1c5d[_0xe907('0x2a')]);});console['log']('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x48a39c);_0x4008b6=[];_0x48a39c[_0xe907('0x9f')](function(_0x83bc57){var _0x37a051=createFieldObject(_0x17fc71,_0x558cd9,_0x83bc57[_0xe907('0xa0')],_0x83bc57[_0xe907('0x2a')],_0x83bc57['label'],!![]);_0x4008b6[_0xe907('0xa2')](_0x37a051);});return Promise[_0xe907('0xa3')](_0x4008b6);})['then'](function(_0x3f70bc){_0x5e281c=_0x3f70bc;var _0xaaca0d=_0x584728[_0xe907('0xa7')](_0x5e281c);return{'count':_0xaaca0d[_0xe907('0x37')],'rows':_0xaaca0d};})[_0xe907('0x27')](respondWithResult(_0x1d361b,null))[_0xe907('0x46')](function(_0x344fa9){console[_0xe907('0x9d')](_0xe907('0xa8')+_0x344fa9);var _0x22aa8e=_0x1fecd1['query'][_0xe907('0xa9')]?0x1f4:_0x344fa9[_0xe907('0xaa')]||0x1f4;logger[_0xe907('0x28')](_0x344fa9[_0xe907('0x29')]);delete _0x344fa9[_0xe907('0x2a')];if(_0x22aa8e===0x191){_0x22aa8e=0x190;}_0x1d361b[_0xe907('0x1b')](_0x22aa8e)[_0xe907('0x2b')](_0x1fecd1[_0xe907('0x32')][_0xe907('0xa9')]?{'message':'Wrong\x20credentials','statusCode':_0x344fa9[_0xe907('0xaa')]}:_0x344fa9);});};function createFieldObject(_0x45389f,_0x161b8e,_0x1d7303,_0x5aecdb,_0x218c66,_0x2ddf52){return new Promise(function(_0x1fea53,_0x342df4){var _0x2c3a9b={'id':_0x5aecdb,'name':_0x218c66,'custom':_0x2ddf52};if(_0x1d7303===_0xe907('0xab')){_0x2c3a9b['options']=[{'name':_0xe907('0xac'),'value':_0xe907('0xad')},{'name':_0xe907('0xae'),'value':_0xe907('0xaf')}];_0x1fea53(_0x2c3a9b);}else{var _0x39f906={'method':_0xe907('0x9a'),'uri':_0x45389f+_0xe907('0xb0')+_0x5aecdb,'auth':_0x161b8e,'json':!![]};return rp(_0x39f906)['then'](function(_0x480b97){var _0x494f89=[];if(_0x480b97[_0xe907('0x9c')][_0xe907('0x37')]>0x0){_0x480b97[_0xe907('0x9c')][_0xe907('0x9f')](function(_0x39e392){if(_0x39e392[_0xe907('0xb1')]===_0xe907('0xaf')){var _0x18c3fb={'name':_0x39e392[_0xe907('0xa1')],'value':_0x39e392[_0xe907('0xb2')]};_0x494f89[_0xe907('0xa2')](_0x18c3fb);}});}_0x2c3a9b[_0xe907('0x40')]=_0x494f89;if(_0x2c3a9b['options']['length']>0x0){_0x1fea53(_0x2c3a9b);}else{if(_0x2ddf52==![]){_0x1fea53();}else{_0x1fea53(_0x2c3a9b);}}});}});} \ No newline at end of file +var _0x9c31=['close_notes','closed_by','follow_up','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','correlation_id','category','username','password','serverUrl','slice','substring','lastIndexOf','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','includes','forEach','internalType','label','push','all','assign','TCL:\x20_object','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','statusCode','boolean','False','false','sys_choice?sysparm_query=name=incident^element=','value','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','error','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','find','catch','create','body','destroy','findOne','order','nolimit','getConfigurations','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','Subjects','getFields','made_sla','hold_reason','knowledge','close_code','notify','incident_state','severity','parent','watch_list','upon_reject','sys_updated_on','child_incidents','resolved_by','sys_updated_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','priority','sys_domain_path','expected_start','business_duration','group_list','work_end','resolved_at','caller_id','subcategory','correlation_display','delivery_task','assignment_group','business_stc','description','calendar_duration'];(function(_0x4ea8fa,_0x2305c6){var _0x39e6e0=function(_0x51445c){while(--_0x51445c){_0x4ea8fa['push'](_0x4ea8fa['shift']());}};_0x39e6e0(++_0x2305c6);}(_0x9c31,0xe5));var _0x19c3=function(_0x567511,_0x20326b){_0x567511=_0x567511-0x0;var _0x427c42=_0x9c31[_0x567511];return _0x427c42;};'use strict';var emlformat=require(_0x19c3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x19c3('0x1'));var jsonpatch=require(_0x19c3('0x2'));var rp=require(_0x19c3('0x3'));var moment=require(_0x19c3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x19c3('0x5'));var util=require(_0x19c3('0x6'));var path=require(_0x19c3('0x7'));var sox=require('sox');var csv=require(_0x19c3('0x8'));var ejs=require(_0x19c3('0x9'));var fs=require('fs');var fs_extra=require(_0x19c3('0xa'));var _=require('lodash');var squel=require(_0x19c3('0xb'));var crypto=require('crypto');var jsforce=require(_0x19c3('0xc'));var deskjs=require(_0x19c3('0xd'));var toCsv=require(_0x19c3('0x8'));var querystring=require(_0x19c3('0xe'));var Papa=require(_0x19c3('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x19c3('0x10'));var as=require(_0x19c3('0x11'));var hardwareService=require(_0x19c3('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x19c3('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x19c3('0x14'));var db=require(_0x19c3('0x15'))['db'];var integrations=require(_0x19c3('0x16'));function respondWithStatusCode(_0x2e3be2,_0x5a5d96){_0x5a5d96=_0x5a5d96||0xcc;return function(_0x1e7d5a){if(_0x1e7d5a){return _0x2e3be2[_0x19c3('0x17')](_0x5a5d96);}return _0x2e3be2[_0x19c3('0x18')](_0x5a5d96)[_0x19c3('0x19')]();};}function respondWithResult(_0x2ece36,_0x121f08){_0x121f08=_0x121f08||0xc8;return function(_0x220184){if(_0x220184){return _0x2ece36[_0x19c3('0x18')](_0x121f08)[_0x19c3('0x1a')](_0x220184);}};}function respondWithFilteredResult(_0x5dcc6c,_0x5108d6){return function(_0x3c24ce){if(_0x3c24ce){var _0x1f5f4f=typeof _0x5108d6[_0x19c3('0x1b')]===_0x19c3('0x1c')&&typeof _0x5108d6[_0x19c3('0x1d')]==='undefined';var _0x1facb5=_0x3c24ce['count'];var _0x98a40e=_0x1f5f4f?0x0:_0x5108d6[_0x19c3('0x1b')];var _0x2fee3b=_0x1f5f4f?_0x3c24ce[_0x19c3('0x1e')]:_0x5108d6['offset']+_0x5108d6[_0x19c3('0x1d')];var _0x49f3f1;if(_0x2fee3b>=_0x1facb5){_0x2fee3b=_0x1facb5;_0x49f3f1=0xc8;}else{_0x49f3f1=0xce;}_0x5dcc6c['status'](_0x49f3f1);return _0x5dcc6c['set']('Content-Range',_0x98a40e+'-'+_0x2fee3b+'/'+_0x1facb5)[_0x19c3('0x1a')](_0x3c24ce);}return null;};}function patchUpdates(_0x31a213){return function(_0x5261fe){try{jsonpatch[_0x19c3('0x1f')](_0x5261fe,_0x31a213,!![]);}catch(_0x3ee581){return BPromise[_0x19c3('0x20')](_0x3ee581);}return _0x5261fe[_0x19c3('0x21')]();};}function saveUpdates(_0x4ec874,_0x4a34c3){return function(_0x4e3bab){if(_0x4e3bab){return _0x4e3bab[_0x19c3('0x22')](_0x4ec874)[_0x19c3('0x23')](function(_0x33097f){return _0x33097f;});}return null;};}function removeEntity(_0x1385d2,_0x51ff9b){return function(_0x25e175){if(_0x25e175){return _0x25e175['destroy']()[_0x19c3('0x23')](function(){_0x1385d2[_0x19c3('0x18')](0xcc)[_0x19c3('0x19')]();});}};}function handleEntityNotFound(_0x34aecb,_0x3f465e){return function(_0x4b5aa6){if(!_0x4b5aa6){_0x34aecb[_0x19c3('0x17')](0x194);}return _0x4b5aa6;};}function handleError(_0x43fa2f,_0x18d239){_0x18d239=_0x18d239||0x1f4;return function(_0x19fa21){logger[_0x19c3('0x24')](_0x19fa21[_0x19c3('0x25')]);if(_0x19fa21[_0x19c3('0x26')]){delete _0x19fa21[_0x19c3('0x26')];}_0x43fa2f[_0x19c3('0x18')](_0x18d239)[_0x19c3('0x27')](_0x19fa21);};}exports[_0x19c3('0x28')]=function(_0x3767cf,_0x1fdca4){var _0x14ad3b={},_0x162de1={},_0x5a71c3={'count':0x0,'rows':[]};var _0x5f47b8=_[_0x19c3('0x29')](db[_0x19c3('0x2a')][_0x19c3('0x2b')],function(_0x502799){return{'name':_0x502799[_0x19c3('0x2c')],'type':_0x502799[_0x19c3('0x2d')][_0x19c3('0x2e')]};});_0x162de1[_0x19c3('0x2f')]=_[_0x19c3('0x29')](_0x5f47b8,_0x19c3('0x26'));_0x162de1[_0x19c3('0x30')]=_[_0x19c3('0x31')](_0x3767cf[_0x19c3('0x30')]);_0x162de1[_0x19c3('0x32')]=_[_0x19c3('0x33')](_0x162de1[_0x19c3('0x2f')],_0x162de1[_0x19c3('0x30')]);_0x14ad3b[_0x19c3('0x34')]=_['intersection'](_0x162de1[_0x19c3('0x2f')],qs[_0x19c3('0x35')](_0x3767cf['query'][_0x19c3('0x35')]));_0x14ad3b[_0x19c3('0x34')]=_0x14ad3b['attributes'][_0x19c3('0x36')]?_0x14ad3b[_0x19c3('0x34')]:_0x162de1[_0x19c3('0x2f')];if(!_0x3767cf[_0x19c3('0x30')][_0x19c3('0x37')]('nolimit')){_0x14ad3b[_0x19c3('0x1d')]=qs[_0x19c3('0x1d')](_0x3767cf[_0x19c3('0x30')][_0x19c3('0x1d')]);_0x14ad3b['offset']=qs['offset'](_0x3767cf[_0x19c3('0x30')][_0x19c3('0x1b')]);}_0x14ad3b['order']=qs[_0x19c3('0x38')](_0x3767cf[_0x19c3('0x30')][_0x19c3('0x38')]);_0x14ad3b[_0x19c3('0x39')]=qs[_0x19c3('0x32')](_[_0x19c3('0x3a')](_0x3767cf[_0x19c3('0x30')],_0x162de1[_0x19c3('0x32')]),_0x5f47b8);if(_0x3767cf[_0x19c3('0x30')][_0x19c3('0x3b')]){_0x14ad3b[_0x19c3('0x39')]=_['merge'](_0x14ad3b['where'],{'$or':_[_0x19c3('0x29')](_0x5f47b8,function(_0x4efbff){if(_0x4efbff[_0x19c3('0x2d')]!==_0x19c3('0x3c')){var _0x343c97={};_0x343c97[_0x4efbff[_0x19c3('0x26')]]={'$like':'%'+_0x3767cf[_0x19c3('0x30')][_0x19c3('0x3b')]+'%'};return _0x343c97;}})});}_0x14ad3b=_[_0x19c3('0x3d')]({},_0x14ad3b,_0x3767cf[_0x19c3('0x3e')]);var _0x32be4a={'where':_0x14ad3b[_0x19c3('0x39')]};return db['ServicenowAccount'][_0x19c3('0x1e')](_0x32be4a)[_0x19c3('0x23')](function(_0x4df233){_0x5a71c3[_0x19c3('0x1e')]=_0x4df233;if(_0x3767cf[_0x19c3('0x30')][_0x19c3('0x3f')]){_0x14ad3b[_0x19c3('0x40')]=[{'all':!![]}];}return db[_0x19c3('0x2a')][_0x19c3('0x41')](_0x14ad3b);})[_0x19c3('0x23')](function(_0x3dbd78){_0x5a71c3[_0x19c3('0x42')]=_0x3dbd78;return _0x5a71c3;})['then'](respondWithFilteredResult(_0x1fdca4,_0x14ad3b))['catch'](handleError(_0x1fdca4,null));};exports['show']=function(_0x490f5c,_0x29253f){var _0x3eba06={'raw':![],'where':{'id':_0x490f5c[_0x19c3('0x43')]['id']}},_0x2d7149={};_0x2d7149['model']=_['keys'](db[_0x19c3('0x2a')][_0x19c3('0x2b')]);_0x2d7149[_0x19c3('0x30')]=_['keys'](_0x490f5c[_0x19c3('0x30')]);_0x2d7149[_0x19c3('0x32')]=_[_0x19c3('0x33')](_0x2d7149[_0x19c3('0x2f')],_0x2d7149['query']);_0x3eba06[_0x19c3('0x34')]=_['intersection'](_0x2d7149['model'],qs[_0x19c3('0x35')](_0x490f5c[_0x19c3('0x30')][_0x19c3('0x35')]));_0x3eba06[_0x19c3('0x34')]=_0x3eba06[_0x19c3('0x34')]['length']?_0x3eba06[_0x19c3('0x34')]:_0x2d7149[_0x19c3('0x2f')];if(_0x490f5c['query'][_0x19c3('0x3f')]){_0x3eba06[_0x19c3('0x40')]=[{'all':!![]}];}_0x3eba06=_[_0x19c3('0x3d')]({},_0x3eba06,_0x490f5c[_0x19c3('0x3e')]);return db[_0x19c3('0x2a')][_0x19c3('0x44')](_0x3eba06)[_0x19c3('0x23')](handleEntityNotFound(_0x29253f,null))[_0x19c3('0x23')](respondWithResult(_0x29253f,null))[_0x19c3('0x45')](handleError(_0x29253f,null));};exports[_0x19c3('0x46')]=function(_0xfc8445,_0x273920){return db[_0x19c3('0x2a')][_0x19c3('0x46')](_0xfc8445[_0x19c3('0x47')],{})[_0x19c3('0x23')](respondWithResult(_0x273920,0xc9))[_0x19c3('0x45')](handleError(_0x273920,null));};exports[_0x19c3('0x22')]=function(_0x1e5d51,_0x472ce0){if(_0x1e5d51[_0x19c3('0x47')]['id']){delete _0x1e5d51['body']['id'];}return db['ServicenowAccount'][_0x19c3('0x44')]({'where':{'id':_0x1e5d51[_0x19c3('0x43')]['id']}})[_0x19c3('0x23')](handleEntityNotFound(_0x472ce0,null))[_0x19c3('0x23')](saveUpdates(_0x1e5d51[_0x19c3('0x47')],null))[_0x19c3('0x23')](respondWithResult(_0x472ce0,null))[_0x19c3('0x45')](handleError(_0x472ce0,null));};exports[_0x19c3('0x48')]=function(_0x8259af,_0x11f36d){return db[_0x19c3('0x2a')][_0x19c3('0x44')]({'where':{'id':_0x8259af[_0x19c3('0x43')]['id']}})[_0x19c3('0x23')](handleEntityNotFound(_0x11f36d,null))['then'](removeEntity(_0x11f36d,null))[_0x19c3('0x45')](handleError(_0x11f36d,null));};exports['getConfigurations']=function(_0x4b6377,_0x9fbb69,_0xc666a6){var _0x5cecc1={};var _0x2a4648={};var _0x574f61;var _0x533e67;return db[_0x19c3('0x2a')][_0x19c3('0x49')]({'where':{'id':_0x4b6377[_0x19c3('0x43')]['id']}})[_0x19c3('0x23')](handleEntityNotFound(_0x9fbb69,null))['then'](function(_0x3c35bf){if(_0x3c35bf){_0x574f61=_0x3c35bf;_0x2a4648['model']=_[_0x19c3('0x31')](db['ServicenowConfiguration'][_0x19c3('0x2b')]);_0x2a4648[_0x19c3('0x30')]=_['keys'](_0x4b6377[_0x19c3('0x30')]);_0x2a4648['filters']=_[_0x19c3('0x33')](_0x2a4648['model'],_0x2a4648['query']);_0x5cecc1[_0x19c3('0x34')]=_[_0x19c3('0x33')](_0x2a4648['model'],qs[_0x19c3('0x35')](_0x4b6377[_0x19c3('0x30')]['fields']));_0x5cecc1[_0x19c3('0x34')]=_0x5cecc1[_0x19c3('0x34')][_0x19c3('0x36')]?_0x5cecc1[_0x19c3('0x34')]:_0x2a4648[_0x19c3('0x2f')];_0x5cecc1[_0x19c3('0x4a')]=qs['sort'](_0x4b6377[_0x19c3('0x30')]['sort']);_0x5cecc1[_0x19c3('0x39')]=qs[_0x19c3('0x32')](_['pick'](_0x4b6377[_0x19c3('0x30')],_0x2a4648[_0x19c3('0x32')]));if(_0x4b6377[_0x19c3('0x30')][_0x19c3('0x3b')]){_0x5cecc1[_0x19c3('0x39')]=_['merge'](_0x5cecc1[_0x19c3('0x39')],{'$or':_[_0x19c3('0x29')](_0x5cecc1['attributes'],function(_0x255ab7){var _0x4b3dc1={};_0x4b3dc1[_0x255ab7]={'$like':'%'+_0x4b6377[_0x19c3('0x30')]['filter']+'%'};return _0x4b3dc1;})});}_0x5cecc1=_[_0x19c3('0x3d')]({},_0x5cecc1,_0x4b6377[_0x19c3('0x3e')]);return _0x574f61['getConfigurations'](_0x5cecc1);}})[_0x19c3('0x23')](function(_0x13ed40){if(_0x13ed40){_0x533e67=_0x13ed40[_0x19c3('0x36')];if(!_0x4b6377[_0x19c3('0x30')][_0x19c3('0x37')](_0x19c3('0x4b'))){_0x5cecc1[_0x19c3('0x1d')]=qs[_0x19c3('0x1d')](_0x4b6377[_0x19c3('0x30')][_0x19c3('0x1d')]);_0x5cecc1[_0x19c3('0x1b')]=qs[_0x19c3('0x1b')](_0x4b6377['query'][_0x19c3('0x1b')]);}return _0x574f61[_0x19c3('0x4c')](_0x5cecc1);}})[_0x19c3('0x23')](function(_0x5b273e){if(_0x5b273e){return _0x5b273e?{'count':_0x533e67,'rows':_0x5b273e}:null;}})[_0x19c3('0x23')](respondWithResult(_0x9fbb69,null))[_0x19c3('0x45')](handleError(_0x9fbb69,null));};exports[_0x19c3('0x4d')]=function(_0x5e8f91,_0x2065ce,_0x19dc9f){if(_0x5e8f91[_0x19c3('0x47')]['id']){delete _0x5e8f91['body']['id'];}return db[_0x19c3('0x2a')]['findOne']({'where':{'id':_0x5e8f91[_0x19c3('0x43')]['id']}})[_0x19c3('0x23')](handleEntityNotFound(_0x2065ce,null))[_0x19c3('0x23')](function(_0x11f3b8){if(_0x11f3b8){_0x5e8f91[_0x19c3('0x47')][_0x19c3('0x4e')]=_0x11f3b8['id'];_0x5e8f91[_0x19c3('0x47')]['Subjects']=integrations[_0x19c3('0x4f')](_0x5e8f91[_0x19c3('0x47')][_0x19c3('0x50')],_0x5e8f91[_0x19c3('0x47')]['type']);_0x5e8f91[_0x19c3('0x47')][_0x19c3('0x51')]=integrations[_0x19c3('0x52')](_0x5e8f91[_0x19c3('0x47')][_0x19c3('0x50')],_0x5e8f91[_0x19c3('0x47')][_0x19c3('0x2d')]);return db['ServicenowConfiguration'][_0x19c3('0x46')](_0x5e8f91[_0x19c3('0x47')],{'include':[{'model':db[_0x19c3('0x53')],'as':_0x19c3('0x54')},{'model':db[_0x19c3('0x53')],'as':_0x19c3('0x51')}]});}return null;})['then'](respondWithResult(_0x2065ce,null))[_0x19c3('0x45')](handleError(_0x2065ce,null));};exports[_0x19c3('0x55')]=function(_0x57f24a,_0x889495,_0x99c0e5){var _0x41806d=[_0x19c3('0x56'),_0x19c3('0x57'),_0x19c3('0x58'),'subcategory',_0x19c3('0x59'),_0x19c3('0x5a'),_0x19c3('0x5b'),_0x19c3('0x5c'),'category'];var _0x385bfc=[_0x19c3('0x5d'),_0x19c3('0x56'),'caused_by',_0x19c3('0x5e'),_0x19c3('0x5f'),_0x19c3('0x60'),_0x19c3('0x61'),_0x19c3('0x57'),'approval_history','number',_0x19c3('0x62'),_0x19c3('0x63'),'opened_by',_0x19c3('0x64'),_0x19c3('0x65'),_0x19c3('0x66'),_0x19c3('0x67'),_0x19c3('0x68'),_0x19c3('0x58'),_0x19c3('0x4a'),_0x19c3('0x69'),_0x19c3('0x6a'),_0x19c3('0x6b'),_0x19c3('0x6c'),_0x19c3('0x6d'),_0x19c3('0x6e'),_0x19c3('0x6f'),'business_service',_0x19c3('0x70'),_0x19c3('0x71'),'rfc','time_worked',_0x19c3('0x72'),'opened_at',_0x19c3('0x73'),_0x19c3('0x74'),_0x19c3('0x75'),'reopened_time',_0x19c3('0x76'),_0x19c3('0x77'),'approval_set',_0x19c3('0x78'),'work_notes','short_description',_0x19c3('0x59'),_0x19c3('0x79'),_0x19c3('0x7a'),'work_start',_0x19c3('0x7b'),_0x19c3('0x7c'),'additional_assignee_list',_0x19c3('0x7d'),_0x19c3('0x7e'),'notify','sys_class_name',_0x19c3('0x7f'),_0x19c3('0x80'),_0x19c3('0x81'),'parent_incident',_0x19c3('0x82'),_0x19c3('0x83'),_0x19c3('0x84'),_0x19c3('0x5b'),_0x19c3('0x85'),_0x19c3('0x86'),_0x19c3('0x87'),_0x19c3('0x88'),_0x19c3('0x89'),_0x19c3('0x8a'),_0x19c3('0x5c'),_0x19c3('0x8b'),_0x19c3('0x8c'),_0x19c3('0x8d'),_0x19c3('0x8e'),_0x19c3('0x8f'),_0x19c3('0x90'),'reopen_count','sys_tags','escalation','upon_approval',_0x19c3('0x91'),'location',_0x19c3('0x92')];var _0x3e0612='';var _0x473f6f='';var _0x454441=[];var _0x2ddbbd='';var _0x545361='';var _0x5168e6=[];var _0x1c3e09='';var _0x4a1fa0='';var _0x242690={};var _0x49f356='';return db[_0x19c3('0x2a')][_0x19c3('0x49')]({'where':{'id':_0x57f24a[_0x19c3('0x43')]['id']},'attributes':['id',_0x19c3('0x93'),_0x19c3('0x94'),'email','remoteUri',_0x19c3('0x95')]})[_0x19c3('0x23')](handleEntityNotFound(_0x889495,null))[_0x19c3('0x23')](function(_0x2c44dc){if(_0x2c44dc){_0x49f356=_0x2c44dc['remoteUri'];var _0xe5f449=_0x49f356[_0x19c3('0x96')](-0x1);if(_0xe5f449==='/'){_0x49f356=_0x49f356[_0x19c3('0x97')](0x0,_0x49f356[_0x19c3('0x98')](_0xe5f449));}_0x4a1fa0=util['format'](_0x19c3('0x99'),_0x49f356);_0x1c3e09=util['format'](_0x19c3('0x9a'),_0x49f356);_0x242690={'user':_0x2c44dc[_0x19c3('0x93')],'pass':_0x2c44dc[_0x19c3('0x94')]};var _0x427cd9={'method':_0x19c3('0x9b'),'uri':_0x4a1fa0+_0x19c3('0x9c'),'auth':_0x242690,'json':!![]};return rp(_0x427cd9);}})[_0x19c3('0x23')](function(_0x5645b4){if(_0x5645b4['result']['length']>0x0){_0x3e0612=_0x5645b4[_0x19c3('0x9d')];}console['log'](_0x19c3('0x9e'),_0x3e0612);_0x5168e6=[];_0x473f6f=Object['assign']([],_0x3e0612);_['remove'](_0x473f6f,function(_0x206ef2){return!_0x41806d[_0x19c3('0x9f')](_0x206ef2[_0x19c3('0x26')]);});_0x473f6f[_0x19c3('0xa0')](function(_0x196a28){var _0x2793f0=createFieldObject(_0x1c3e09,_0x242690,_0x196a28[_0x19c3('0xa1')],_0x196a28[_0x19c3('0x26')],_0x196a28[_0x19c3('0xa2')],![]);_0x5168e6[_0x19c3('0xa3')](_0x2793f0);});return Promise[_0x19c3('0xa4')](_0x5168e6);})[_0x19c3('0x23')](function(_0x515e4f){_0x454441=_0x515e4f;_0x2ddbbd=Object[_0x19c3('0xa5')]([],_0x3e0612);console['log'](_0x19c3('0xa6'),_0x3e0612);_[_0x19c3('0xa7')](_0x2ddbbd,function(_0x30252d){return _0x385bfc['includes'](_0x30252d['name']);});console['log'](_0x19c3('0xa8'),_0x2ddbbd);_0x5168e6=[];_0x2ddbbd['forEach'](function(_0x215289){var _0x5934c4=createFieldObject(_0x1c3e09,_0x242690,_0x215289[_0x19c3('0xa1')],_0x215289[_0x19c3('0x26')],_0x215289[_0x19c3('0xa2')],!![]);_0x5168e6['push'](_0x5934c4);});return Promise['all'](_0x5168e6);})[_0x19c3('0x23')](function(_0x119449){_0x545361=_0x119449;var _0x137f02=_0x454441[_0x19c3('0xa9')](_0x545361);return{'count':_0x137f02[_0x19c3('0x36')],'rows':_0x137f02};})[_0x19c3('0x23')](respondWithResult(_0x889495,null))[_0x19c3('0x45')](function(_0x56df31){console['log'](_0x19c3('0xaa')+_0x56df31);var _0x1c9cbd=_0x57f24a[_0x19c3('0x30')][_0x19c3('0xab')]?0x1f4:_0x56df31[_0x19c3('0xac')]||0x1f4;logger[_0x19c3('0x24')](_0x56df31['stack']);delete _0x56df31[_0x19c3('0x26')];if(_0x1c9cbd===0x191){_0x1c9cbd=0x190;}_0x889495[_0x19c3('0x18')](_0x1c9cbd)[_0x19c3('0x27')](_0x57f24a[_0x19c3('0x30')][_0x19c3('0xab')]?{'message':'Wrong\x20credentials','statusCode':_0x56df31[_0x19c3('0xac')]}:_0x56df31);});};function createFieldObject(_0x1eeff3,_0x247ce7,_0x1bb220,_0x26ddef,_0x270077,_0x2e1d07){return new Promise(function(_0x5a3dfc,_0x33e03b){var _0x321ccb={'id':_0x26ddef,'name':_0x270077,'custom':_0x2e1d07};if(_0x1bb220===_0x19c3('0xad')){_0x321ccb[_0x19c3('0x3e')]=[{'name':'True','value':'true'},{'name':_0x19c3('0xae'),'value':_0x19c3('0xaf')}];_0x5a3dfc(_0x321ccb);}else{var _0x2a8bd7={'method':'GET','uri':_0x1eeff3+_0x19c3('0xb0')+_0x26ddef,'auth':_0x247ce7,'json':!![]};return rp(_0x2a8bd7)[_0x19c3('0x23')](function(_0x3334fe){var _0x1cd7b3=[];if(_0x3334fe[_0x19c3('0x9d')]['length']>0x0){_0x3334fe[_0x19c3('0x9d')]['forEach'](function(_0x1935b1){if(_0x1935b1['inactive']==='false'){var _0x51dd53={'name':_0x1935b1['label'],'value':_0x1935b1[_0x19c3('0xb1')]};_0x1cd7b3[_0x19c3('0xa3')](_0x51dd53);}});}_0x321ccb[_0x19c3('0x3e')]=_0x1cd7b3;if(_0x321ccb[_0x19c3('0x3e')][_0x19c3('0x36')]>0x0){_0x5a3dfc(_0x321ccb);}else{if(_0x2e1d07==![]){_0x5a3dfc();}else{_0x5a3dfc(_0x321ccb);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 493c6a5..36867ed 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 _0xe2fe=['define','int_servicenow_accounts','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports'];(function(_0x3ffef1,_0xdcba42){var _0x917877=function(_0x5c3043){while(--_0x5c3043){_0x3ffef1['push'](_0x3ffef1['shift']());}};_0x917877(++_0xdcba42);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xee2f('0x1'));var moment=require('moment');var BPromise=require(_0xee2f('0x2'));var rp=require(_0xee2f('0x3'));var fs=require('fs');var path=require(_0xee2f('0x4'));var rimraf=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0xee2f('0x7'));module[_0xee2f('0x8')]=function(_0x49926b,_0x1533a0){return _0x49926b[_0xee2f('0x9')]('ServicenowAccount',attributes,{'tableName':_0xee2f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc1c6=['rimraf','../../components/integrations/configuration','define','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x250d5d,_0x57cdc4){var _0x82b368=function(_0x3cf7dc){while(--_0x3cf7dc){_0x250d5d['push'](_0x250d5d['shift']());}};_0x82b368(++_0x57cdc4);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x2b7070,_0x1ad1f2){_0x2b7070=_0x2b7070-0x0;var _0x1b9adf=_0xc1c6[_0x2b7070];return _0x1b9adf;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var logger=require(_0x6c1c('0x2'))('api');var moment=require(_0x6c1c('0x3'));var BPromise=require('bluebird');var rp=require(_0x6c1c('0x4'));var fs=require('fs');var path=require(_0x6c1c('0x5'));var rimraf=require(_0x6c1c('0x6'));var config=require('../../config/environment');var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0x6c1c('0x7'));module['exports']=function(_0x50c1bb,_0x582bec){return _0x50c1bb[_0x6c1c('0x8')](_0x6c1c('0x9'),attributes,{'tableName':_0x6c1c('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 a14a2bc..307572d 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 _0x02c2=['findAll','options','where','attributes','limit','include','model','map','ShowServicenowAccount','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetServicenowAccount','ServicenowAccount'];(function(_0x2cca46,_0x475700){var _0x2fab47=function(_0x53191d){while(--_0x53191d){_0x2cca46['push'](_0x2cca46['shift']());}};_0x2fab47(++_0x475700);}(_0x02c2,0xc3));var _0x202c=function(_0x54f98a,_0x5a9f3c){_0x54f98a=_0x54f98a-0x0;var _0x1d98f0=_0x02c2[_0x54f98a];return _0x1d98f0;};'use strict';var _=require(_0x202c('0x0'));var util=require(_0x202c('0x1'));var moment=require(_0x202c('0x2'));var BPromise=require(_0x202c('0x3'));var rs=require(_0x202c('0x4'));var fs=require('fs');var Redis=require(_0x202c('0x5'));var db=require(_0x202c('0x6'))['db'];var utils=require(_0x202c('0x7'));var logger=require(_0x202c('0x8'))(_0x202c('0x9'));var config=require(_0x202c('0xa'));var jayson=require(_0x202c('0xb'));var client=jayson[_0x202c('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13b688,_0xa8fff4,_0x4394f3){return new BPromise(function(_0x311af4,_0x2274bc){return client[_0x202c('0xd')](_0x13b688,_0x4394f3)[_0x202c('0xe')](function(_0x535618){logger[_0x202c('0xf')](_0x202c('0x10'),_0xa8fff4,_0x202c('0x11'));logger[_0x202c('0x12')](_0x202c('0x13'),_0xa8fff4,'request\x20sent',JSON[_0x202c('0x14')](_0x535618));if(_0x535618['error']){if(_0x535618[_0x202c('0x15')][_0x202c('0x16')]===0x1f4){logger['error'](_0x202c('0x10'),_0xa8fff4,_0x535618[_0x202c('0x15')][_0x202c('0x17')]);return _0x2274bc(_0x535618[_0x202c('0x15')][_0x202c('0x17')]);}logger[_0x202c('0x15')](_0x202c('0x10'),_0xa8fff4,_0x535618[_0x202c('0x15')]['message']);return _0x311af4(_0x535618[_0x202c('0x15')][_0x202c('0x17')]);}else{logger[_0x202c('0xf')]('ServicenowAccount,\x20%s,\x20%s',_0xa8fff4,_0x202c('0x11'));_0x311af4(_0x535618['result']['message']);}})[_0x202c('0x18')](function(_0x223757){logger[_0x202c('0x15')](_0x202c('0x10'),_0xa8fff4,_0x223757);_0x2274bc(_0x223757);});});}exports[_0x202c('0x19')]=function(_0x10df73){var _0x1d39c4=this;return new Promise(function(_0x191a1b,_0x645b80){return db[_0x202c('0x1a')][_0x202c('0x1b')]({'raw':_0x10df73[_0x202c('0x1c')]?_0x10df73[_0x202c('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x10df73[_0x202c('0x1c')]?_0x10df73[_0x202c('0x1c')][_0x202c('0x1d')]||null:null,'attributes':_0x10df73[_0x202c('0x1c')]?_0x10df73['options'][_0x202c('0x1e')]||null:null,'limit':_0x10df73['options']?_0x10df73['options'][_0x202c('0x1f')]||null:null,'include':_0x10df73['options']?_0x10df73['options'][_0x202c('0x20')]?_['map'](_0x10df73['options'][_0x202c('0x20')],function(_0x57be6e){return{'model':db[_0x57be6e[_0x202c('0x21')]],'as':_0x57be6e['as'],'attributes':_0x57be6e[_0x202c('0x1e')],'include':_0x57be6e['include']?_['map'](_0x57be6e[_0x202c('0x20')],function(_0x43e10b){return{'model':db[_0x43e10b[_0x202c('0x21')]],'as':_0x43e10b['as'],'attributes':_0x43e10b[_0x202c('0x1e')],'include':_0x43e10b['include']?_[_0x202c('0x22')](_0x43e10b[_0x202c('0x20')],function(_0x56efcb){return{'model':db[_0x56efcb[_0x202c('0x21')]],'as':_0x56efcb['as'],'attributes':_0x56efcb[_0x202c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x202c('0xe')](function(_0x2ce907){logger['info'](_0x202c('0x19'),_0x10df73);logger[_0x202c('0x12')](_0x202c('0x19'),_0x10df73,JSON[_0x202c('0x14')](_0x2ce907));_0x191a1b(_0x2ce907);})['catch'](function(_0x2e2c8e){logger[_0x202c('0x15')](_0x202c('0x19'),_0x2e2c8e[_0x202c('0x17')],_0x10df73);_0x645b80(_0x1d39c4[_0x202c('0x15')](0x1f4,_0x2e2c8e[_0x202c('0x17')]));});});};exports[_0x202c('0x23')]=function(_0x151524){var _0x4f35e5=this;return new Promise(function(_0x34ce93,_0x712287){return db[_0x202c('0x1a')]['find']({'raw':_0x151524['options']?_0x151524['options'][_0x202c('0x24')]===undefined?!![]:![]:!![],'where':_0x151524['options']?_0x151524[_0x202c('0x1c')][_0x202c('0x1d')]||null:null,'attributes':_0x151524[_0x202c('0x1c')]?_0x151524[_0x202c('0x1c')][_0x202c('0x1e')]||null:null,'include':_0x151524[_0x202c('0x1c')]?_0x151524[_0x202c('0x1c')][_0x202c('0x20')]?_['map'](_0x151524[_0x202c('0x1c')]['include'],function(_0x5aea90){return{'model':db[_0x5aea90[_0x202c('0x21')]],'as':_0x5aea90['as'],'attributes':_0x5aea90[_0x202c('0x1e')],'include':_0x5aea90[_0x202c('0x20')]?_['map'](_0x5aea90[_0x202c('0x20')],function(_0x1ccb23){return{'model':db[_0x1ccb23[_0x202c('0x21')]],'as':_0x1ccb23['as'],'attributes':_0x1ccb23[_0x202c('0x1e')],'include':_0x1ccb23[_0x202c('0x20')]?_['map'](_0x1ccb23['include'],function(_0x54e954){return{'model':db[_0x54e954[_0x202c('0x21')]],'as':_0x54e954['as'],'attributes':_0x54e954[_0x202c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x202c('0xe')](function(_0x54da68){logger[_0x202c('0xf')](_0x202c('0x23'),_0x151524);logger['debug'](_0x202c('0x23'),_0x151524,JSON[_0x202c('0x14')](_0x54da68));_0x34ce93(_0x54da68);})[_0x202c('0x18')](function(_0x3730ea){logger[_0x202c('0x15')](_0x202c('0x23'),_0x3730ea[_0x202c('0x17')],_0x151524);_0x712287(_0x4f35e5['error'](0x1f4,_0x3730ea['message']));});});}; \ No newline at end of file +var _0x5719=['ShowServicenowAccount','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','ServicenowAccount,\x20%s,\x20%s','message','result','options','raw','where','limit','include','map','model','attributes','GetServicenowAccount','catch'];(function(_0x666eb9,_0x5a9e90){var _0x3fc80b=function(_0x4ec6ff){while(--_0x4ec6ff){_0x666eb9['push'](_0x666eb9['shift']());}};_0x3fc80b(++_0x5a9e90);}(_0x5719,0x101));var _0x9571=function(_0x50aa41,_0xcdb7da){_0x50aa41=_0x50aa41-0x0;var _0x40f508=_0x5719[_0x50aa41];return _0x40f508;};'use strict';var _=require('lodash');var util=require(_0x9571('0x0'));var moment=require(_0x9571('0x1'));var BPromise=require(_0x9571('0x2'));var rs=require(_0x9571('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9571('0x4'))['db'];var utils=require(_0x9571('0x5'));var logger=require('../../config/logger')(_0x9571('0x6'));var config=require('../../config/environment');var jayson=require(_0x9571('0x7'));var client=jayson[_0x9571('0x8')][_0x9571('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x351558,_0x2f369b,_0x185f62){return new BPromise(function(_0x244612,_0x4d071d){return client[_0x9571('0xa')](_0x351558,_0x185f62)[_0x9571('0xb')](function(_0x1f8a7e){logger[_0x9571('0xc')]('ServicenowAccount,\x20%s,\x20%s',_0x2f369b,_0x9571('0xd'));logger[_0x9571('0xe')](_0x9571('0xf'),_0x2f369b,'request\x20sent',JSON[_0x9571('0x10')](_0x1f8a7e));if(_0x1f8a7e[_0x9571('0x11')]){if(_0x1f8a7e[_0x9571('0x11')]['code']===0x1f4){logger[_0x9571('0x11')](_0x9571('0x12'),_0x2f369b,_0x1f8a7e[_0x9571('0x11')]['message']);return _0x4d071d(_0x1f8a7e[_0x9571('0x11')][_0x9571('0x13')]);}logger[_0x9571('0x11')](_0x9571('0x12'),_0x2f369b,_0x1f8a7e['error']['message']);return _0x244612(_0x1f8a7e['error']['message']);}else{logger['info'](_0x9571('0x12'),_0x2f369b,'request\x20sent');_0x244612(_0x1f8a7e[_0x9571('0x14')][_0x9571('0x13')]);}})['catch'](function(_0x3f3f06){logger[_0x9571('0x11')](_0x9571('0x12'),_0x2f369b,_0x3f3f06);_0x4d071d(_0x3f3f06);});});}exports['GetServicenowAccount']=function(_0x41a738){var _0x4005da=this;return new Promise(function(_0x3df693,_0x30bc9b){return db['ServicenowAccount']['findAll']({'raw':_0x41a738[_0x9571('0x15')]?_0x41a738[_0x9571('0x15')][_0x9571('0x16')]===undefined?!![]:![]:!![],'where':_0x41a738[_0x9571('0x15')]?_0x41a738[_0x9571('0x15')][_0x9571('0x17')]||null:null,'attributes':_0x41a738[_0x9571('0x15')]?_0x41a738[_0x9571('0x15')]['attributes']||null:null,'limit':_0x41a738['options']?_0x41a738[_0x9571('0x15')][_0x9571('0x18')]||null:null,'include':_0x41a738[_0x9571('0x15')]?_0x41a738[_0x9571('0x15')][_0x9571('0x19')]?_[_0x9571('0x1a')](_0x41a738[_0x9571('0x15')][_0x9571('0x19')],function(_0x25a76d){return{'model':db[_0x25a76d[_0x9571('0x1b')]],'as':_0x25a76d['as'],'attributes':_0x25a76d['attributes'],'include':_0x25a76d[_0x9571('0x19')]?_[_0x9571('0x1a')](_0x25a76d[_0x9571('0x19')],function(_0x27d17a){return{'model':db[_0x27d17a[_0x9571('0x1b')]],'as':_0x27d17a['as'],'attributes':_0x27d17a[_0x9571('0x1c')],'include':_0x27d17a[_0x9571('0x19')]?_[_0x9571('0x1a')](_0x27d17a[_0x9571('0x19')],function(_0x4f3d7b){return{'model':db[_0x4f3d7b[_0x9571('0x1b')]],'as':_0x4f3d7b['as'],'attributes':_0x4f3d7b['attributes']};}):[]};}):[]};}):[]:[]})[_0x9571('0xb')](function(_0x25577a){logger[_0x9571('0xc')](_0x9571('0x1d'),_0x41a738);logger[_0x9571('0xe')](_0x9571('0x1d'),_0x41a738,JSON[_0x9571('0x10')](_0x25577a));_0x3df693(_0x25577a);})[_0x9571('0x1e')](function(_0x4cab0c){logger[_0x9571('0x11')]('GetServicenowAccount',_0x4cab0c[_0x9571('0x13')],_0x41a738);_0x30bc9b(_0x4005da[_0x9571('0x11')](0x1f4,_0x4cab0c[_0x9571('0x13')]));});});};exports[_0x9571('0x1f')]=function(_0x3719c4){var _0x4d7c2c=this;return new Promise(function(_0x1aff2b,_0x494c66){return db['ServicenowAccount']['find']({'raw':_0x3719c4[_0x9571('0x15')]?_0x3719c4[_0x9571('0x15')][_0x9571('0x16')]===undefined?!![]:![]:!![],'where':_0x3719c4[_0x9571('0x15')]?_0x3719c4[_0x9571('0x15')]['where']||null:null,'attributes':_0x3719c4[_0x9571('0x15')]?_0x3719c4['options'][_0x9571('0x1c')]||null:null,'include':_0x3719c4['options']?_0x3719c4[_0x9571('0x15')][_0x9571('0x19')]?_['map'](_0x3719c4[_0x9571('0x15')]['include'],function(_0x2ecc88){return{'model':db[_0x2ecc88[_0x9571('0x1b')]],'as':_0x2ecc88['as'],'attributes':_0x2ecc88[_0x9571('0x1c')],'include':_0x2ecc88[_0x9571('0x19')]?_['map'](_0x2ecc88['include'],function(_0x5aff0c){return{'model':db[_0x5aff0c[_0x9571('0x1b')]],'as':_0x5aff0c['as'],'attributes':_0x5aff0c[_0x9571('0x1c')],'include':_0x5aff0c[_0x9571('0x19')]?_['map'](_0x5aff0c[_0x9571('0x19')],function(_0x38a2e9){return{'model':db[_0x38a2e9[_0x9571('0x1b')]],'as':_0x38a2e9['as'],'attributes':_0x38a2e9[_0x9571('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9571('0xb')](function(_0x556ce5){logger['info']('ShowServicenowAccount',_0x3719c4);logger[_0x9571('0xe')](_0x9571('0x1f'),_0x3719c4,JSON[_0x9571('0x10')](_0x556ce5));_0x1aff2b(_0x556ce5);})[_0x9571('0x1e')](function(_0x48be55){logger['error'](_0x9571('0x1f'),_0x48be55[_0x9571('0x13')],_0x3719c4);_0x494c66(_0x4d7c2c[_0x9571('0x11')](0x1f4,_0x48be55[_0x9571('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 92ba592..90d55f2 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 _0xf16f=['index','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x550502,_0x26eb30){var _0x43ead1=function(_0xdf9e9d){while(--_0xdf9e9d){_0x550502['push'](_0x550502['shift']());}};_0x43ead1(++_0x26eb30);}(_0xf16f,0x1ea));var _0xff16=function(_0x500194,_0x552aa5){_0x500194=_0x500194-0x0;var _0x128385=_0xf16f[_0x500194];return _0x128385;};'use strict';var multer=require(_0xff16('0x0'));var util=require('util');var path=require(_0xff16('0x1'));var timeout=require(_0xff16('0x2'));var express=require(_0xff16('0x3'));var router=express[_0xff16('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xff16('0x5'));var interaction=require(_0xff16('0x6'));var config=require(_0xff16('0x7'));var controller=require('./intServicenowConfiguration.controller');router[_0xff16('0x8')]('/',auth[_0xff16('0x9')](),controller[_0xff16('0xa')]);router[_0xff16('0x8')]('/:id',auth[_0xff16('0x9')](),controller[_0xff16('0xb')]);router[_0xff16('0x8')](_0xff16('0xc'),auth[_0xff16('0x9')](),controller[_0xff16('0xd')]);router['get'](_0xff16('0xe'),auth[_0xff16('0x9')](),controller[_0xff16('0xf')]);router[_0xff16('0x8')](_0xff16('0x10'),auth[_0xff16('0x9')](),controller[_0xff16('0x11')]);router['post']('/',auth[_0xff16('0x9')](),controller[_0xff16('0x12')]);router[_0xff16('0x13')](_0xff16('0x14'),auth[_0xff16('0x9')](),controller[_0xff16('0x15')]);router[_0xff16('0x16')]('/:id',auth[_0xff16('0x9')](),controller[_0xff16('0x17')]);module[_0xff16('0x18')]=router; \ No newline at end of file +var _0xa0f3=['../../components/interaction/service','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa0f3,0xe9));var _0x3a0f=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa0f3[_0x5447fd];return _0x15b28a;};'use strict';var multer=require(_0x3a0f('0x0'));var util=require(_0x3a0f('0x1'));var path=require('path');var timeout=require(_0x3a0f('0x2'));var express=require(_0x3a0f('0x3'));var router=express[_0x3a0f('0x4')]();var fs_extra=require(_0x3a0f('0x5'));var auth=require(_0x3a0f('0x6'));var interaction=require(_0x3a0f('0x7'));var config=require('../../config/environment');var controller=require('./intServicenowConfiguration.controller');router[_0x3a0f('0x8')]('/',auth[_0x3a0f('0x9')](),controller[_0x3a0f('0xa')]);router[_0x3a0f('0x8')](_0x3a0f('0xb'),auth['isAuthenticated'](),controller[_0x3a0f('0xc')]);router['get']('/:id/fields',auth[_0x3a0f('0x9')](),controller[_0x3a0f('0xd')]);router[_0x3a0f('0x8')](_0x3a0f('0xe'),auth['isAuthenticated'](),controller[_0x3a0f('0xf')]);router[_0x3a0f('0x8')](_0x3a0f('0x10'),auth[_0x3a0f('0x9')](),controller[_0x3a0f('0x11')]);router['post']('/',auth[_0x3a0f('0x9')](),controller[_0x3a0f('0x12')]);router[_0x3a0f('0x13')](_0x3a0f('0xb'),auth[_0x3a0f('0x9')](),controller[_0x3a0f('0x14')]);router[_0x3a0f('0x15')]('/:id',auth[_0x3a0f('0x9')](),controller[_0x3a0f('0x16')]);module[_0x3a0f('0x17')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index ebb8ffa..8972e7c 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 _0xdef3=['STRING','sequelize','exports'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xdef3,0xd0));var _0x3def=function(_0x1034ca,_0x14ecd6){_0x1034ca=_0x1034ca-0x0;var _0x1a023a=_0xdef3[_0x1034ca];return _0x1a023a;};'use strict';var Sequelize=require(_0x3def('0x0'));module[_0x3def('0x1')]={'name':{'type':Sequelize[_0x3def('0x2')]},'description':{'type':Sequelize[_0x3def('0x2')]}}; \ No newline at end of file +var _0xe6b3=['sequelize','STRING'];(function(_0x1fcf1b,_0x214549){var _0x5d2952=function(_0x3331b7){while(--_0x3331b7){_0x1fcf1b['push'](_0x1fcf1b['shift']());}};_0x5d2952(++_0x214549);}(_0xe6b3,0x1be));var _0x3e6b=function(_0x168d13,_0x58b839){_0x168d13=_0x168d13-0x0;var _0x19d0b3=_0xe6b3[_0x168d13];return _0x19d0b3;};'use strict';var Sequelize=require(_0x3e6b('0x0'));module['exports']={'name':{'type':Sequelize[_0x3e6b('0x1')]},'description':{'type':Sequelize[_0x3e6b('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index a0bfa49..d35820e 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 _0x3e95=['map','VIRTUAL','options','ServicenowConfiguration','includeAll','include','rows','catch','params','keys','create','body','find','getFields','findOne','ServicenowField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','save','then','destroy','sendStatus','error','stack','send','index','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0x476ca4,_0x345bb4){var _0x772715=function(_0x111e56){while(--_0x111e56){_0x476ca4['push'](_0x476ca4['shift']());}};_0x772715(++_0x345bb4);}(_0x3e95,0xb8));var _0x53e9=function(_0xb19b20,_0x4b9019){_0xb19b20=_0xb19b20-0x0;var _0x2c1572=_0x3e95[_0xb19b20];return _0x2c1572;};'use strict';var emlformat=require(_0x53e9('0x0'));var rimraf=require(_0x53e9('0x1'));var zipdir=require(_0x53e9('0x2'));var jsonpatch=require(_0x53e9('0x3'));var rp=require(_0x53e9('0x4'));var moment=require(_0x53e9('0x5'));var BPromise=require(_0x53e9('0x6'));var Mustache=require(_0x53e9('0x7'));var util=require(_0x53e9('0x8'));var path=require(_0x53e9('0x9'));var sox=require('sox');var csv=require(_0x53e9('0xa'));var ejs=require(_0x53e9('0xb'));var fs=require('fs');var fs_extra=require(_0x53e9('0xc'));var _=require(_0x53e9('0xd'));var squel=require('squel');var crypto=require(_0x53e9('0xe'));var jsforce=require(_0x53e9('0xf'));var deskjs=require(_0x53e9('0x10'));var toCsv=require(_0x53e9('0xa'));var querystring=require(_0x53e9('0x11'));var Papa=require(_0x53e9('0x12'));var Redis=require(_0x53e9('0x13'));var authService=require(_0x53e9('0x14'));var qs=require(_0x53e9('0x15'));var as=require(_0x53e9('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x53e9('0x17'))(_0x53e9('0x18'));var utils=require(_0x53e9('0x19'));var config=require(_0x53e9('0x1a'));var licenseUtil=require(_0x53e9('0x1b'));var db=require(_0x53e9('0x1c'))['db'];function respondWithStatusCode(_0x15fef6,_0x4c27f4){_0x4c27f4=_0x4c27f4||0xcc;return function(_0x1ce6d8){if(_0x1ce6d8){return _0x15fef6['sendStatus'](_0x4c27f4);}return _0x15fef6[_0x53e9('0x1d')](_0x4c27f4)[_0x53e9('0x1e')]();};}function respondWithResult(_0x351d6d,_0x117ea2){_0x117ea2=_0x117ea2||0xc8;return function(_0x3f1a2b){if(_0x3f1a2b){return _0x351d6d[_0x53e9('0x1d')](_0x117ea2)[_0x53e9('0x1f')](_0x3f1a2b);}};}function respondWithFilteredResult(_0xdf374e,_0x2a408b){return function(_0x5a4ab2){if(_0x5a4ab2){var _0x63a2be=typeof _0x2a408b[_0x53e9('0x20')]===_0x53e9('0x21')&&typeof _0x2a408b[_0x53e9('0x22')]==='undefined';var _0x587e75=_0x5a4ab2[_0x53e9('0x23')];var _0x8db6d0=_0x63a2be?0x0:_0x2a408b[_0x53e9('0x20')];var _0x4fe550=_0x63a2be?_0x5a4ab2[_0x53e9('0x23')]:_0x2a408b[_0x53e9('0x20')]+_0x2a408b[_0x53e9('0x22')];var _0x2f379b;if(_0x4fe550>=_0x587e75){_0x4fe550=_0x587e75;_0x2f379b=0xc8;}else{_0x2f379b=0xce;}_0xdf374e[_0x53e9('0x1d')](_0x2f379b);return _0xdf374e[_0x53e9('0x24')]('Content-Range',_0x8db6d0+'-'+_0x4fe550+'/'+_0x587e75)[_0x53e9('0x1f')](_0x5a4ab2);}return null;};}function patchUpdates(_0x2bd668){return function(_0x505955){try{jsonpatch['apply'](_0x505955,_0x2bd668,!![]);}catch(_0x21159b){return BPromise['reject'](_0x21159b);}return _0x505955[_0x53e9('0x25')]();};}function saveUpdates(_0x27e15c,_0x3f1376){return function(_0x48a686){if(_0x48a686){return _0x48a686['update'](_0x27e15c)[_0x53e9('0x26')](function(_0x38094b){return _0x38094b;});}return null;};}function removeEntity(_0x2abd1c,_0x2fa24d){return function(_0x2b500a){if(_0x2b500a){return _0x2b500a[_0x53e9('0x27')]()[_0x53e9('0x26')](function(){_0x2abd1c[_0x53e9('0x1d')](0xcc)[_0x53e9('0x1e')]();});}};}function handleEntityNotFound(_0x4e6764,_0x28500c){return function(_0x26310f){if(!_0x26310f){_0x4e6764[_0x53e9('0x28')](0x194);}return _0x26310f;};}function handleError(_0xe1a094,_0x193686){_0x193686=_0x193686||0x1f4;return function(_0x5071b9){logger[_0x53e9('0x29')](_0x5071b9[_0x53e9('0x2a')]);if(_0x5071b9['name']){delete _0x5071b9['name'];}_0xe1a094[_0x53e9('0x1d')](_0x193686)[_0x53e9('0x2b')](_0x5071b9);};}exports[_0x53e9('0x2c')]=function(_0x3b53e0,_0x1dacfb){var _0x2e53ca={},_0x530bbc={},_0x230388={'count':0x0,'rows':[]};var _0x2baa24=_['map'](db['ServicenowConfiguration'][_0x53e9('0x2d')],function(_0x360224){return{'name':_0x360224[_0x53e9('0x2e')],'type':_0x360224[_0x53e9('0x2f')][_0x53e9('0x30')]};});_0x530bbc[_0x53e9('0x31')]=_['map'](_0x2baa24,_0x53e9('0x32'));_0x530bbc[_0x53e9('0x33')]=_['keys'](_0x3b53e0['query']);_0x530bbc[_0x53e9('0x34')]=_[_0x53e9('0x35')](_0x530bbc[_0x53e9('0x31')],_0x530bbc[_0x53e9('0x33')]);_0x2e53ca[_0x53e9('0x36')]=_[_0x53e9('0x35')](_0x530bbc[_0x53e9('0x31')],qs[_0x53e9('0x37')](_0x3b53e0[_0x53e9('0x33')][_0x53e9('0x37')]));_0x2e53ca[_0x53e9('0x36')]=_0x2e53ca[_0x53e9('0x36')][_0x53e9('0x38')]?_0x2e53ca[_0x53e9('0x36')]:_0x530bbc['model'];if(!_0x3b53e0[_0x53e9('0x33')][_0x53e9('0x39')](_0x53e9('0x3a'))){_0x2e53ca[_0x53e9('0x22')]=qs['limit'](_0x3b53e0[_0x53e9('0x33')][_0x53e9('0x22')]);_0x2e53ca[_0x53e9('0x20')]=qs[_0x53e9('0x20')](_0x3b53e0[_0x53e9('0x33')][_0x53e9('0x20')]);}_0x2e53ca[_0x53e9('0x3b')]=qs[_0x53e9('0x3c')](_0x3b53e0['query']['sort']);_0x2e53ca[_0x53e9('0x3d')]=qs[_0x53e9('0x34')](_[_0x53e9('0x3e')](_0x3b53e0[_0x53e9('0x33')],_0x530bbc[_0x53e9('0x34')]),_0x2baa24);if(_0x3b53e0[_0x53e9('0x33')][_0x53e9('0x3f')]){_0x2e53ca[_0x53e9('0x3d')]=_[_0x53e9('0x40')](_0x2e53ca[_0x53e9('0x3d')],{'$or':_[_0x53e9('0x41')](_0x2baa24,function(_0x3e6f26){if(_0x3e6f26[_0x53e9('0x2f')]!==_0x53e9('0x42')){var _0x55eac4={};_0x55eac4[_0x3e6f26['name']]={'$like':'%'+_0x3b53e0[_0x53e9('0x33')][_0x53e9('0x3f')]+'%'};return _0x55eac4;}})});}_0x2e53ca=_[_0x53e9('0x40')]({},_0x2e53ca,_0x3b53e0[_0x53e9('0x43')]);var _0x4e2aea={'where':_0x2e53ca[_0x53e9('0x3d')]};return db[_0x53e9('0x44')]['count'](_0x4e2aea)[_0x53e9('0x26')](function(_0x288cc3){_0x230388[_0x53e9('0x23')]=_0x288cc3;if(_0x3b53e0[_0x53e9('0x33')][_0x53e9('0x45')]){_0x2e53ca[_0x53e9('0x46')]=[{'all':!![]}];}return db[_0x53e9('0x44')]['findAll'](_0x2e53ca);})[_0x53e9('0x26')](function(_0x233639){_0x230388[_0x53e9('0x47')]=_0x233639;return _0x230388;})['then'](respondWithFilteredResult(_0x1dacfb,_0x2e53ca))[_0x53e9('0x48')](handleError(_0x1dacfb,null));};exports['show']=function(_0x5f0a75,_0x23176f){var _0x408bf3={'raw':![],'where':{'id':_0x5f0a75[_0x53e9('0x49')]['id']}},_0x1b6961={};_0x1b6961[_0x53e9('0x31')]=_['keys'](db['ServicenowConfiguration'][_0x53e9('0x2d')]);_0x1b6961[_0x53e9('0x33')]=_[_0x53e9('0x4a')](_0x5f0a75[_0x53e9('0x33')]);_0x1b6961[_0x53e9('0x34')]=_[_0x53e9('0x35')](_0x1b6961[_0x53e9('0x31')],_0x1b6961[_0x53e9('0x33')]);_0x408bf3[_0x53e9('0x36')]=_[_0x53e9('0x35')](_0x1b6961[_0x53e9('0x31')],qs[_0x53e9('0x37')](_0x5f0a75[_0x53e9('0x33')]['fields']));_0x408bf3['attributes']=_0x408bf3[_0x53e9('0x36')][_0x53e9('0x38')]?_0x408bf3[_0x53e9('0x36')]:_0x1b6961[_0x53e9('0x31')];if(_0x5f0a75[_0x53e9('0x33')]['includeAll']){_0x408bf3[_0x53e9('0x46')]=[{'all':!![]}];}_0x408bf3=_[_0x53e9('0x40')]({},_0x408bf3,_0x5f0a75['options']);return db[_0x53e9('0x44')]['find'](_0x408bf3)[_0x53e9('0x26')](handleEntityNotFound(_0x23176f,null))[_0x53e9('0x26')](respondWithResult(_0x23176f,null))['catch'](handleError(_0x23176f,null));};exports[_0x53e9('0x4b')]=function(_0x42554f,_0x15fc6c){return db[_0x53e9('0x44')][_0x53e9('0x4b')](_0x42554f['body'],{})[_0x53e9('0x26')](respondWithResult(_0x15fc6c,0xc9))[_0x53e9('0x48')](handleError(_0x15fc6c,null));};exports['update']=function(_0x541ec7,_0x3d0745){if(_0x541ec7[_0x53e9('0x4c')]['id']){delete _0x541ec7[_0x53e9('0x4c')]['id'];}return db[_0x53e9('0x44')][_0x53e9('0x4d')]({'where':{'id':_0x541ec7[_0x53e9('0x49')]['id']}})['then'](handleEntityNotFound(_0x3d0745,null))[_0x53e9('0x26')](saveUpdates(_0x541ec7[_0x53e9('0x4c')],null))[_0x53e9('0x26')](respondWithResult(_0x3d0745,null))[_0x53e9('0x48')](handleError(_0x3d0745,null));};exports[_0x53e9('0x27')]=function(_0x9fb783,_0x421589){return db['ServicenowConfiguration'][_0x53e9('0x4d')]({'where':{'id':_0x9fb783[_0x53e9('0x49')]['id']}})['then'](handleEntityNotFound(_0x421589,null))[_0x53e9('0x26')](removeEntity(_0x421589,null))[_0x53e9('0x48')](handleError(_0x421589,null));};exports[_0x53e9('0x4e')]=function(_0x5a22ad,_0x4e1063,_0x13edd7){var _0x9edf29={};var _0x1652bd={};var _0x15427e;var _0xdc78c0;return db[_0x53e9('0x44')][_0x53e9('0x4f')]({'where':{'id':_0x5a22ad['params']['id']}})[_0x53e9('0x26')](handleEntityNotFound(_0x4e1063,null))[_0x53e9('0x26')](function(_0x21fa5d){if(_0x21fa5d){_0x15427e=_0x21fa5d;_0x1652bd[_0x53e9('0x31')]=_['keys'](db[_0x53e9('0x50')][_0x53e9('0x2d')]);_0x1652bd[_0x53e9('0x33')]=_['keys'](_0x5a22ad[_0x53e9('0x33')]);_0x1652bd['filters']=_[_0x53e9('0x35')](_0x1652bd[_0x53e9('0x31')],_0x1652bd[_0x53e9('0x33')]);_0x9edf29[_0x53e9('0x36')]=_[_0x53e9('0x35')](_0x1652bd[_0x53e9('0x31')],qs[_0x53e9('0x37')](_0x5a22ad[_0x53e9('0x33')][_0x53e9('0x37')]));_0x9edf29['attributes']=_0x9edf29['attributes'][_0x53e9('0x38')]?_0x9edf29[_0x53e9('0x36')]:_0x1652bd[_0x53e9('0x31')];_0x9edf29[_0x53e9('0x3b')]=qs[_0x53e9('0x3c')](_0x5a22ad[_0x53e9('0x33')][_0x53e9('0x3c')]);_0x9edf29[_0x53e9('0x3d')]=qs[_0x53e9('0x34')](_[_0x53e9('0x3e')](_0x5a22ad[_0x53e9('0x33')],_0x1652bd['filters']));if(_0x5a22ad[_0x53e9('0x33')]['filter']){_0x9edf29['where']=_[_0x53e9('0x40')](_0x9edf29[_0x53e9('0x3d')],{'$or':_[_0x53e9('0x41')](_0x9edf29[_0x53e9('0x36')],function(_0x298814){var _0x1aa92b={};_0x1aa92b[_0x298814]={'$like':'%'+_0x5a22ad[_0x53e9('0x33')][_0x53e9('0x3f')]+'%'};return _0x1aa92b;})});}_0x9edf29=_[_0x53e9('0x40')]({},_0x9edf29,_0x5a22ad[_0x53e9('0x43')]);return _0x15427e['getFields'](_0x9edf29);}})[_0x53e9('0x26')](function(_0xe8a4f4){if(_0xe8a4f4){_0xdc78c0=_0xe8a4f4['length'];if(!_0x5a22ad['query']['hasOwnProperty'](_0x53e9('0x3a'))){_0x9edf29['limit']=qs['limit'](_0x5a22ad[_0x53e9('0x33')][_0x53e9('0x22')]);_0x9edf29[_0x53e9('0x20')]=qs[_0x53e9('0x20')](_0x5a22ad['query'][_0x53e9('0x20')]);}return _0x15427e[_0x53e9('0x4e')](_0x9edf29);}})[_0x53e9('0x26')](function(_0x5955aa){if(_0x5955aa){return _0x5955aa?{'count':_0xdc78c0,'rows':_0x5955aa}:null;}})[_0x53e9('0x26')](respondWithResult(_0x4e1063,null))[_0x53e9('0x48')](handleError(_0x4e1063,null));};exports[_0x53e9('0x51')]=function(_0x808608,_0x3c903d,_0x34d026){var _0x2d02ad={};var _0x1b6d3c={};var _0x119cd0;var _0x4c9564;return db['ServicenowConfiguration'][_0x53e9('0x4f')]({'where':{'id':_0x808608['params']['id']}})[_0x53e9('0x26')](handleEntityNotFound(_0x3c903d,null))[_0x53e9('0x26')](function(_0x2a259e){if(_0x2a259e){_0x119cd0=_0x2a259e;_0x1b6d3c[_0x53e9('0x31')]=_['keys'](db[_0x53e9('0x50')]['rawAttributes']);_0x1b6d3c[_0x53e9('0x33')]=_[_0x53e9('0x4a')](_0x808608[_0x53e9('0x33')]);_0x1b6d3c[_0x53e9('0x34')]=_[_0x53e9('0x35')](_0x1b6d3c[_0x53e9('0x31')],_0x1b6d3c['query']);_0x2d02ad[_0x53e9('0x36')]=_[_0x53e9('0x35')](_0x1b6d3c['model'],qs[_0x53e9('0x37')](_0x808608['query'][_0x53e9('0x37')]));_0x2d02ad[_0x53e9('0x36')]=_0x2d02ad[_0x53e9('0x36')][_0x53e9('0x38')]?_0x2d02ad['attributes']:_0x1b6d3c[_0x53e9('0x31')];_0x2d02ad[_0x53e9('0x3b')]=qs[_0x53e9('0x3c')](_0x808608['query'][_0x53e9('0x3c')]);_0x2d02ad[_0x53e9('0x3d')]=qs[_0x53e9('0x34')](_[_0x53e9('0x3e')](_0x808608['query'],_0x1b6d3c[_0x53e9('0x34')]));if(_0x808608['query'][_0x53e9('0x3f')]){_0x2d02ad['where']=_[_0x53e9('0x40')](_0x2d02ad[_0x53e9('0x3d')],{'$or':_[_0x53e9('0x41')](_0x2d02ad['attributes'],function(_0x389d5e){var _0x7631fd={};_0x7631fd[_0x389d5e]={'$like':'%'+_0x808608[_0x53e9('0x33')]['filter']+'%'};return _0x7631fd;})});}_0x2d02ad=_['merge']({},_0x2d02ad,_0x808608[_0x53e9('0x43')]);return _0x119cd0[_0x53e9('0x51')](_0x2d02ad);}})[_0x53e9('0x26')](function(_0xb3985d){if(_0xb3985d){_0x4c9564=_0xb3985d[_0x53e9('0x38')];if(!_0x808608['query']['hasOwnProperty'](_0x53e9('0x3a'))){_0x2d02ad[_0x53e9('0x22')]=qs[_0x53e9('0x22')](_0x808608[_0x53e9('0x33')][_0x53e9('0x22')]);_0x2d02ad[_0x53e9('0x20')]=qs['offset'](_0x808608[_0x53e9('0x33')]['offset']);}return _0x119cd0[_0x53e9('0x51')](_0x2d02ad);}})[_0x53e9('0x26')](function(_0x37879c){if(_0x37879c){return _0x37879c?{'count':_0x4c9564,'rows':_0x37879c}:null;}})['then'](respondWithResult(_0x3c903d,null))[_0x53e9('0x48')](handleError(_0x3c903d,null));};exports[_0x53e9('0x52')]=function(_0x106a4d,_0x63a756,_0x3d9bbb){var _0x4da9b6={};var _0x3426f8={};var _0x1fa842;var _0x2d7e95;return db[_0x53e9('0x44')][_0x53e9('0x4f')]({'where':{'id':_0x106a4d['params']['id']}})['then'](handleEntityNotFound(_0x63a756,null))[_0x53e9('0x26')](function(_0x54a846){if(_0x54a846){_0x1fa842=_0x54a846;_0x3426f8[_0x53e9('0x31')]=_['keys'](db[_0x53e9('0x50')][_0x53e9('0x2d')]);_0x3426f8[_0x53e9('0x33')]=_[_0x53e9('0x4a')](_0x106a4d[_0x53e9('0x33')]);_0x3426f8['filters']=_[_0x53e9('0x35')](_0x3426f8[_0x53e9('0x31')],_0x3426f8[_0x53e9('0x33')]);_0x4da9b6[_0x53e9('0x36')]=_[_0x53e9('0x35')](_0x3426f8[_0x53e9('0x31')],qs[_0x53e9('0x37')](_0x106a4d[_0x53e9('0x33')]['fields']));_0x4da9b6[_0x53e9('0x36')]=_0x4da9b6[_0x53e9('0x36')][_0x53e9('0x38')]?_0x4da9b6[_0x53e9('0x36')]:_0x3426f8[_0x53e9('0x31')];_0x4da9b6[_0x53e9('0x3b')]=qs[_0x53e9('0x3c')](_0x106a4d[_0x53e9('0x33')][_0x53e9('0x3c')]);_0x4da9b6[_0x53e9('0x3d')]=qs['filters'](_[_0x53e9('0x3e')](_0x106a4d[_0x53e9('0x33')],_0x3426f8[_0x53e9('0x34')]));if(_0x106a4d[_0x53e9('0x33')][_0x53e9('0x3f')]){_0x4da9b6[_0x53e9('0x3d')]=_[_0x53e9('0x40')](_0x4da9b6[_0x53e9('0x3d')],{'$or':_[_0x53e9('0x41')](_0x4da9b6[_0x53e9('0x36')],function(_0x2ccf94){var _0x2287c5={};_0x2287c5[_0x2ccf94]={'$like':'%'+_0x106a4d['query']['filter']+'%'};return _0x2287c5;})});}_0x4da9b6=_['merge']({},_0x4da9b6,_0x106a4d['options']);return _0x1fa842['getDescriptions'](_0x4da9b6);}})['then'](function(_0x387635){if(_0x387635){_0x2d7e95=_0x387635[_0x53e9('0x38')];if(!_0x106a4d[_0x53e9('0x33')]['hasOwnProperty'](_0x53e9('0x3a'))){_0x4da9b6[_0x53e9('0x22')]=qs[_0x53e9('0x22')](_0x106a4d[_0x53e9('0x33')]['limit']);_0x4da9b6[_0x53e9('0x20')]=qs[_0x53e9('0x20')](_0x106a4d[_0x53e9('0x33')]['offset']);}return _0x1fa842[_0x53e9('0x52')](_0x4da9b6);}})['then'](function(_0x1a614f){if(_0x1a614f){return _0x1a614f?{'count':_0x2d7e95,'rows':_0x1a614f}:null;}})[_0x53e9('0x26')](respondWithResult(_0x63a756,null))['catch'](handleError(_0x63a756,null));}; \ No newline at end of file +var _0x8fd1=['where','pick','filter','merge','type','options','ServicenowConfiguration','includeAll','include','rows','show','find','catch','create','body','params','destroy','findOne','getFields','getSubjects','getDescriptions','ServicenowField','order','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','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/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','apply','reject','then','error','stack','name','index','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort'];(function(_0x2db191,_0x8a3598){var _0x5b7441=function(_0x5e31bf){while(--_0x5e31bf){_0x2db191['push'](_0x2db191['shift']());}};_0x5b7441(++_0x8a3598);}(_0x8fd1,0xb5));var _0x18fd=function(_0x39caaa,_0x1f37bc){_0x39caaa=_0x39caaa-0x0;var _0x9b9c7d=_0x8fd1[_0x39caaa];return _0x9b9c7d;};'use strict';var emlformat=require(_0x18fd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x18fd('0x1'));var jsonpatch=require(_0x18fd('0x2'));var rp=require('request-promise');var moment=require(_0x18fd('0x3'));var BPromise=require(_0x18fd('0x4'));var Mustache=require(_0x18fd('0x5'));var util=require(_0x18fd('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x18fd('0x7'));var ejs=require(_0x18fd('0x8'));var fs=require('fs');var fs_extra=require(_0x18fd('0x9'));var _=require(_0x18fd('0xa'));var squel=require(_0x18fd('0xb'));var crypto=require(_0x18fd('0xc'));var jsforce=require(_0x18fd('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x18fd('0x7'));var querystring=require(_0x18fd('0xe'));var Papa=require(_0x18fd('0xf'));var Redis=require(_0x18fd('0x10'));var authService=require(_0x18fd('0x11'));var qs=require(_0x18fd('0x12'));var as=require(_0x18fd('0x13'));var hardwareService=require(_0x18fd('0x14'));var logger=require(_0x18fd('0x15'))(_0x18fd('0x16'));var utils=require('../../config/utils');var config=require(_0x18fd('0x17'));var licenseUtil=require(_0x18fd('0x18'));var db=require(_0x18fd('0x19'))['db'];function respondWithStatusCode(_0x2829df,_0x1eeb5e){_0x1eeb5e=_0x1eeb5e||0xcc;return function(_0x2fa8d8){if(_0x2fa8d8){return _0x2829df[_0x18fd('0x1a')](_0x1eeb5e);}return _0x2829df['status'](_0x1eeb5e)[_0x18fd('0x1b')]();};}function respondWithResult(_0x80631e,_0x516df3){_0x516df3=_0x516df3||0xc8;return function(_0x45df21){if(_0x45df21){return _0x80631e[_0x18fd('0x1c')](_0x516df3)[_0x18fd('0x1d')](_0x45df21);}};}function respondWithFilteredResult(_0x44b7a6,_0x5966dc){return function(_0xa08818){if(_0xa08818){var _0x480cbf=typeof _0x5966dc[_0x18fd('0x1e')]===_0x18fd('0x1f')&&typeof _0x5966dc[_0x18fd('0x20')]===_0x18fd('0x1f');var _0x2946bf=_0xa08818[_0x18fd('0x21')];var _0x40bbf0=_0x480cbf?0x0:_0x5966dc[_0x18fd('0x1e')];var _0x1d4576=_0x480cbf?_0xa08818[_0x18fd('0x21')]:_0x5966dc['offset']+_0x5966dc[_0x18fd('0x20')];var _0x4acab9;if(_0x1d4576>=_0x2946bf){_0x1d4576=_0x2946bf;_0x4acab9=0xc8;}else{_0x4acab9=0xce;}_0x44b7a6[_0x18fd('0x1c')](_0x4acab9);return _0x44b7a6['set']('Content-Range',_0x40bbf0+'-'+_0x1d4576+'/'+_0x2946bf)[_0x18fd('0x1d')](_0xa08818);}return null;};}function patchUpdates(_0x444300){return function(_0x1f1b81){try{jsonpatch[_0x18fd('0x22')](_0x1f1b81,_0x444300,!![]);}catch(_0x4badf1){return BPromise[_0x18fd('0x23')](_0x4badf1);}return _0x1f1b81['save']();};}function saveUpdates(_0xff76b,_0x5121ae){return function(_0x518c4a){if(_0x518c4a){return _0x518c4a['update'](_0xff76b)[_0x18fd('0x24')](function(_0xdfb14f){return _0xdfb14f;});}return null;};}function removeEntity(_0x4f5488,_0x107517){return function(_0x2c207f){if(_0x2c207f){return _0x2c207f['destroy']()['then'](function(){_0x4f5488[_0x18fd('0x1c')](0xcc)[_0x18fd('0x1b')]();});}};}function handleEntityNotFound(_0x38b24e,_0x4af157){return function(_0x160f0a){if(!_0x160f0a){_0x38b24e[_0x18fd('0x1a')](0x194);}return _0x160f0a;};}function handleError(_0xa0fd96,_0x562c8c){_0x562c8c=_0x562c8c||0x1f4;return function(_0x505e54){logger[_0x18fd('0x25')](_0x505e54[_0x18fd('0x26')]);if(_0x505e54[_0x18fd('0x27')]){delete _0x505e54[_0x18fd('0x27')];}_0xa0fd96[_0x18fd('0x1c')](_0x562c8c)['send'](_0x505e54);};}exports[_0x18fd('0x28')]=function(_0x3006f0,_0x368319){var _0x32adf7={},_0xb1c9c={},_0x1f5825={'count':0x0,'rows':[]};var _0x4d1d0=_[_0x18fd('0x29')](db['ServicenowConfiguration'][_0x18fd('0x2a')],function(_0x2253a7){return{'name':_0x2253a7[_0x18fd('0x2b')],'type':_0x2253a7['type'][_0x18fd('0x2c')]};});_0xb1c9c[_0x18fd('0x2d')]=_[_0x18fd('0x29')](_0x4d1d0,_0x18fd('0x27'));_0xb1c9c['query']=_[_0x18fd('0x2e')](_0x3006f0[_0x18fd('0x2f')]);_0xb1c9c[_0x18fd('0x30')]=_[_0x18fd('0x31')](_0xb1c9c[_0x18fd('0x2d')],_0xb1c9c[_0x18fd('0x2f')]);_0x32adf7[_0x18fd('0x32')]=_[_0x18fd('0x31')](_0xb1c9c[_0x18fd('0x2d')],qs[_0x18fd('0x33')](_0x3006f0[_0x18fd('0x2f')][_0x18fd('0x33')]));_0x32adf7[_0x18fd('0x32')]=_0x32adf7[_0x18fd('0x32')][_0x18fd('0x34')]?_0x32adf7[_0x18fd('0x32')]:_0xb1c9c[_0x18fd('0x2d')];if(!_0x3006f0[_0x18fd('0x2f')][_0x18fd('0x35')](_0x18fd('0x36'))){_0x32adf7[_0x18fd('0x20')]=qs[_0x18fd('0x20')](_0x3006f0[_0x18fd('0x2f')][_0x18fd('0x20')]);_0x32adf7[_0x18fd('0x1e')]=qs[_0x18fd('0x1e')](_0x3006f0['query'][_0x18fd('0x1e')]);}_0x32adf7['order']=qs[_0x18fd('0x37')](_0x3006f0[_0x18fd('0x2f')]['sort']);_0x32adf7[_0x18fd('0x38')]=qs[_0x18fd('0x30')](_[_0x18fd('0x39')](_0x3006f0['query'],_0xb1c9c[_0x18fd('0x30')]),_0x4d1d0);if(_0x3006f0['query'][_0x18fd('0x3a')]){_0x32adf7[_0x18fd('0x38')]=_[_0x18fd('0x3b')](_0x32adf7[_0x18fd('0x38')],{'$or':_[_0x18fd('0x29')](_0x4d1d0,function(_0x1f07eb){if(_0x1f07eb[_0x18fd('0x3c')]!=='VIRTUAL'){var _0x1d2e5e={};_0x1d2e5e[_0x1f07eb['name']]={'$like':'%'+_0x3006f0['query'][_0x18fd('0x3a')]+'%'};return _0x1d2e5e;}})});}_0x32adf7=_[_0x18fd('0x3b')]({},_0x32adf7,_0x3006f0[_0x18fd('0x3d')]);var _0x2cb7b6={'where':_0x32adf7[_0x18fd('0x38')]};return db[_0x18fd('0x3e')]['count'](_0x2cb7b6)['then'](function(_0x2b1b4b){_0x1f5825[_0x18fd('0x21')]=_0x2b1b4b;if(_0x3006f0['query'][_0x18fd('0x3f')]){_0x32adf7[_0x18fd('0x40')]=[{'all':!![]}];}return db[_0x18fd('0x3e')]['findAll'](_0x32adf7);})[_0x18fd('0x24')](function(_0x21ea29){_0x1f5825[_0x18fd('0x41')]=_0x21ea29;return _0x1f5825;})[_0x18fd('0x24')](respondWithFilteredResult(_0x368319,_0x32adf7))['catch'](handleError(_0x368319,null));};exports[_0x18fd('0x42')]=function(_0x4a4748,_0x15f8bb){var _0x25225a={'raw':![],'where':{'id':_0x4a4748['params']['id']}},_0x5e0f48={};_0x5e0f48[_0x18fd('0x2d')]=_[_0x18fd('0x2e')](db[_0x18fd('0x3e')]['rawAttributes']);_0x5e0f48['query']=_[_0x18fd('0x2e')](_0x4a4748[_0x18fd('0x2f')]);_0x5e0f48[_0x18fd('0x30')]=_[_0x18fd('0x31')](_0x5e0f48[_0x18fd('0x2d')],_0x5e0f48[_0x18fd('0x2f')]);_0x25225a[_0x18fd('0x32')]=_[_0x18fd('0x31')](_0x5e0f48['model'],qs[_0x18fd('0x33')](_0x4a4748[_0x18fd('0x2f')][_0x18fd('0x33')]));_0x25225a['attributes']=_0x25225a[_0x18fd('0x32')][_0x18fd('0x34')]?_0x25225a[_0x18fd('0x32')]:_0x5e0f48['model'];if(_0x4a4748[_0x18fd('0x2f')]['includeAll']){_0x25225a[_0x18fd('0x40')]=[{'all':!![]}];}_0x25225a=_[_0x18fd('0x3b')]({},_0x25225a,_0x4a4748[_0x18fd('0x3d')]);return db[_0x18fd('0x3e')][_0x18fd('0x43')](_0x25225a)[_0x18fd('0x24')](handleEntityNotFound(_0x15f8bb,null))[_0x18fd('0x24')](respondWithResult(_0x15f8bb,null))[_0x18fd('0x44')](handleError(_0x15f8bb,null));};exports[_0x18fd('0x45')]=function(_0x47fca8,_0x213f02){return db[_0x18fd('0x3e')][_0x18fd('0x45')](_0x47fca8[_0x18fd('0x46')],{})[_0x18fd('0x24')](respondWithResult(_0x213f02,0xc9))[_0x18fd('0x44')](handleError(_0x213f02,null));};exports['update']=function(_0x4d3e82,_0x23b129){if(_0x4d3e82[_0x18fd('0x46')]['id']){delete _0x4d3e82[_0x18fd('0x46')]['id'];}return db[_0x18fd('0x3e')][_0x18fd('0x43')]({'where':{'id':_0x4d3e82[_0x18fd('0x47')]['id']}})[_0x18fd('0x24')](handleEntityNotFound(_0x23b129,null))[_0x18fd('0x24')](saveUpdates(_0x4d3e82[_0x18fd('0x46')],null))['then'](respondWithResult(_0x23b129,null))[_0x18fd('0x44')](handleError(_0x23b129,null));};exports[_0x18fd('0x48')]=function(_0xd024f4,_0x410617){return db[_0x18fd('0x3e')][_0x18fd('0x43')]({'where':{'id':_0xd024f4['params']['id']}})['then'](handleEntityNotFound(_0x410617,null))['then'](removeEntity(_0x410617,null))[_0x18fd('0x44')](handleError(_0x410617,null));};exports['getFields']=function(_0x3c1ece,_0x1072f3,_0x57d2c2){var _0x4d238a={};var _0x447bf2={};var _0x391351;var _0x4168a7;return db[_0x18fd('0x3e')][_0x18fd('0x49')]({'where':{'id':_0x3c1ece[_0x18fd('0x47')]['id']}})[_0x18fd('0x24')](handleEntityNotFound(_0x1072f3,null))['then'](function(_0x11e565){if(_0x11e565){_0x391351=_0x11e565;_0x447bf2[_0x18fd('0x2d')]=_[_0x18fd('0x2e')](db['ServicenowField'][_0x18fd('0x2a')]);_0x447bf2[_0x18fd('0x2f')]=_[_0x18fd('0x2e')](_0x3c1ece[_0x18fd('0x2f')]);_0x447bf2[_0x18fd('0x30')]=_[_0x18fd('0x31')](_0x447bf2['model'],_0x447bf2[_0x18fd('0x2f')]);_0x4d238a['attributes']=_[_0x18fd('0x31')](_0x447bf2[_0x18fd('0x2d')],qs[_0x18fd('0x33')](_0x3c1ece[_0x18fd('0x2f')][_0x18fd('0x33')]));_0x4d238a[_0x18fd('0x32')]=_0x4d238a[_0x18fd('0x32')][_0x18fd('0x34')]?_0x4d238a['attributes']:_0x447bf2['model'];_0x4d238a['order']=qs[_0x18fd('0x37')](_0x3c1ece['query'][_0x18fd('0x37')]);_0x4d238a[_0x18fd('0x38')]=qs[_0x18fd('0x30')](_[_0x18fd('0x39')](_0x3c1ece[_0x18fd('0x2f')],_0x447bf2[_0x18fd('0x30')]));if(_0x3c1ece[_0x18fd('0x2f')]['filter']){_0x4d238a[_0x18fd('0x38')]=_[_0x18fd('0x3b')](_0x4d238a[_0x18fd('0x38')],{'$or':_[_0x18fd('0x29')](_0x4d238a['attributes'],function(_0x3b1491){var _0x40f191={};_0x40f191[_0x3b1491]={'$like':'%'+_0x3c1ece[_0x18fd('0x2f')][_0x18fd('0x3a')]+'%'};return _0x40f191;})});}_0x4d238a=_[_0x18fd('0x3b')]({},_0x4d238a,_0x3c1ece[_0x18fd('0x3d')]);return _0x391351[_0x18fd('0x4a')](_0x4d238a);}})[_0x18fd('0x24')](function(_0x592976){if(_0x592976){_0x4168a7=_0x592976[_0x18fd('0x34')];if(!_0x3c1ece[_0x18fd('0x2f')][_0x18fd('0x35')](_0x18fd('0x36'))){_0x4d238a[_0x18fd('0x20')]=qs[_0x18fd('0x20')](_0x3c1ece[_0x18fd('0x2f')][_0x18fd('0x20')]);_0x4d238a[_0x18fd('0x1e')]=qs[_0x18fd('0x1e')](_0x3c1ece[_0x18fd('0x2f')]['offset']);}return _0x391351[_0x18fd('0x4a')](_0x4d238a);}})[_0x18fd('0x24')](function(_0x1dce7d){if(_0x1dce7d){return _0x1dce7d?{'count':_0x4168a7,'rows':_0x1dce7d}:null;}})['then'](respondWithResult(_0x1072f3,null))[_0x18fd('0x44')](handleError(_0x1072f3,null));};exports[_0x18fd('0x4b')]=function(_0x10e8b8,_0x6e21,_0x335844){var _0x5554b0={};var _0x210052={};var _0x1761de;var _0x199816;return db[_0x18fd('0x3e')][_0x18fd('0x49')]({'where':{'id':_0x10e8b8['params']['id']}})[_0x18fd('0x24')](handleEntityNotFound(_0x6e21,null))['then'](function(_0x2e2bb4){if(_0x2e2bb4){_0x1761de=_0x2e2bb4;_0x210052[_0x18fd('0x2d')]=_['keys'](db['ServicenowField']['rawAttributes']);_0x210052[_0x18fd('0x2f')]=_[_0x18fd('0x2e')](_0x10e8b8[_0x18fd('0x2f')]);_0x210052[_0x18fd('0x30')]=_[_0x18fd('0x31')](_0x210052['model'],_0x210052['query']);_0x5554b0[_0x18fd('0x32')]=_[_0x18fd('0x31')](_0x210052[_0x18fd('0x2d')],qs['fields'](_0x10e8b8['query'][_0x18fd('0x33')]));_0x5554b0[_0x18fd('0x32')]=_0x5554b0[_0x18fd('0x32')][_0x18fd('0x34')]?_0x5554b0['attributes']:_0x210052[_0x18fd('0x2d')];_0x5554b0['order']=qs[_0x18fd('0x37')](_0x10e8b8[_0x18fd('0x2f')][_0x18fd('0x37')]);_0x5554b0['where']=qs[_0x18fd('0x30')](_[_0x18fd('0x39')](_0x10e8b8['query'],_0x210052[_0x18fd('0x30')]));if(_0x10e8b8['query'][_0x18fd('0x3a')]){_0x5554b0['where']=_['merge'](_0x5554b0[_0x18fd('0x38')],{'$or':_[_0x18fd('0x29')](_0x5554b0[_0x18fd('0x32')],function(_0x12114c){var _0xc4b905={};_0xc4b905[_0x12114c]={'$like':'%'+_0x10e8b8['query'][_0x18fd('0x3a')]+'%'};return _0xc4b905;})});}_0x5554b0=_[_0x18fd('0x3b')]({},_0x5554b0,_0x10e8b8[_0x18fd('0x3d')]);return _0x1761de[_0x18fd('0x4b')](_0x5554b0);}})['then'](function(_0x32bf1b){if(_0x32bf1b){_0x199816=_0x32bf1b[_0x18fd('0x34')];if(!_0x10e8b8[_0x18fd('0x2f')][_0x18fd('0x35')]('nolimit')){_0x5554b0[_0x18fd('0x20')]=qs[_0x18fd('0x20')](_0x10e8b8['query'][_0x18fd('0x20')]);_0x5554b0['offset']=qs[_0x18fd('0x1e')](_0x10e8b8['query'][_0x18fd('0x1e')]);}return _0x1761de['getSubjects'](_0x5554b0);}})['then'](function(_0x1ca992){if(_0x1ca992){return _0x1ca992?{'count':_0x199816,'rows':_0x1ca992}:null;}})[_0x18fd('0x24')](respondWithResult(_0x6e21,null))['catch'](handleError(_0x6e21,null));};exports[_0x18fd('0x4c')]=function(_0x2af3e9,_0x36d675,_0x7d9554){var _0x14c1e1={};var _0xf4b3f={};var _0x45ba09;var _0x2a880b;return db[_0x18fd('0x3e')][_0x18fd('0x49')]({'where':{'id':_0x2af3e9[_0x18fd('0x47')]['id']}})[_0x18fd('0x24')](handleEntityNotFound(_0x36d675,null))['then'](function(_0x4a855b){if(_0x4a855b){_0x45ba09=_0x4a855b;_0xf4b3f[_0x18fd('0x2d')]=_[_0x18fd('0x2e')](db[_0x18fd('0x4d')][_0x18fd('0x2a')]);_0xf4b3f['query']=_[_0x18fd('0x2e')](_0x2af3e9[_0x18fd('0x2f')]);_0xf4b3f['filters']=_[_0x18fd('0x31')](_0xf4b3f[_0x18fd('0x2d')],_0xf4b3f[_0x18fd('0x2f')]);_0x14c1e1[_0x18fd('0x32')]=_[_0x18fd('0x31')](_0xf4b3f[_0x18fd('0x2d')],qs['fields'](_0x2af3e9[_0x18fd('0x2f')][_0x18fd('0x33')]));_0x14c1e1[_0x18fd('0x32')]=_0x14c1e1['attributes'][_0x18fd('0x34')]?_0x14c1e1[_0x18fd('0x32')]:_0xf4b3f[_0x18fd('0x2d')];_0x14c1e1[_0x18fd('0x4e')]=qs[_0x18fd('0x37')](_0x2af3e9[_0x18fd('0x2f')]['sort']);_0x14c1e1[_0x18fd('0x38')]=qs[_0x18fd('0x30')](_[_0x18fd('0x39')](_0x2af3e9[_0x18fd('0x2f')],_0xf4b3f[_0x18fd('0x30')]));if(_0x2af3e9[_0x18fd('0x2f')]['filter']){_0x14c1e1['where']=_[_0x18fd('0x3b')](_0x14c1e1['where'],{'$or':_['map'](_0x14c1e1[_0x18fd('0x32')],function(_0xd3e242){var _0x342d70={};_0x342d70[_0xd3e242]={'$like':'%'+_0x2af3e9['query']['filter']+'%'};return _0x342d70;})});}_0x14c1e1=_[_0x18fd('0x3b')]({},_0x14c1e1,_0x2af3e9[_0x18fd('0x3d')]);return _0x45ba09[_0x18fd('0x4c')](_0x14c1e1);}})[_0x18fd('0x24')](function(_0xc9fd1e){if(_0xc9fd1e){_0x2a880b=_0xc9fd1e[_0x18fd('0x34')];if(!_0x2af3e9[_0x18fd('0x2f')][_0x18fd('0x35')](_0x18fd('0x36'))){_0x14c1e1[_0x18fd('0x20')]=qs[_0x18fd('0x20')](_0x2af3e9['query'][_0x18fd('0x20')]);_0x14c1e1[_0x18fd('0x1e')]=qs['offset'](_0x2af3e9[_0x18fd('0x2f')][_0x18fd('0x1e')]);}return _0x45ba09[_0x18fd('0x4c')](_0x14c1e1);}})['then'](function(_0x4ee155){if(_0x4ee155){return _0x4ee155?{'count':_0x2a880b,'rows':_0x4ee155}:null;}})[_0x18fd('0x24')](respondWithResult(_0x36d675,null))['catch'](handleError(_0x36d675,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 4f83413..daaac6c 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 _0xb7e2=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','ServicenowConfiguration','int_servicenow_configurations','lodash'];(function(_0x32cddf,_0x38930e){var _0x5244f1=function(_0x8eb941){while(--_0x8eb941){_0x32cddf['push'](_0x32cddf['shift']());}};_0x5244f1(++_0x38930e);}(_0xb7e2,0x103));var _0x2b7e=function(_0xf2a6d2,_0x2141bf){_0xf2a6d2=_0xf2a6d2-0x0;var _0x5f6c00=_0xb7e2[_0xf2a6d2];return _0x5f6c00;};'use strict';var _=require(_0x2b7e('0x0'));var util=require('util');var logger=require(_0x2b7e('0x1'))('api');var moment=require(_0x2b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x2b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2b7e('0x4'));var config=require(_0x2b7e('0x5'));var attributes=require(_0x2b7e('0x6'));module[_0x2b7e('0x7')]=function(_0x3d06ba,_0x93733a){return _0x3d06ba['define'](_0x2b7e('0x8'),attributes,{'tableName':_0x2b7e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9672=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowConfiguration.attributes','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util'];(function(_0x22ba21,_0x368ef1){var _0x15704b=function(_0x16bd99){while(--_0x16bd99){_0x22ba21['push'](_0x22ba21['shift']());}};_0x15704b(++_0x368ef1);}(_0x9672,0xee));var _0x2967=function(_0x2207a5,_0x13d420){_0x2207a5=_0x2207a5-0x0;var _0x3f5343=_0x9672[_0x2207a5];return _0x3f5343;};'use strict';var _=require(_0x2967('0x0'));var util=require(_0x2967('0x1'));var logger=require('../../config/logger')(_0x2967('0x2'));var moment=require(_0x2967('0x3'));var BPromise=require(_0x2967('0x4'));var rp=require(_0x2967('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2967('0x6'));var config=require(_0x2967('0x7'));var attributes=require(_0x2967('0x8'));module['exports']=function(_0x4baad7,_0x24424d){return _0x4baad7[_0x2967('0x9')](_0x2967('0xa'),attributes,{'tableName':_0x2967('0xb'),'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 5b51389..a1253ac 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 _0x015f=['message','result','catch','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','code','error','ServicenowConfiguration,\x20%s,\x20%s'];(function(_0x19590c,_0x561e56){var _0x377a1a=function(_0x260d7f){while(--_0x260d7f){_0x19590c['push'](_0x19590c['shift']());}};_0x377a1a(++_0x561e56);}(_0x015f,0x14d));var _0xf015=function(_0x2dd390,_0x1bc894){_0x2dd390=_0x2dd390-0x0;var _0x3afe47=_0x015f[_0x2dd390];return _0x3afe47;};'use strict';var _=require('lodash');var util=require(_0xf015('0x0'));var moment=require('moment');var BPromise=require(_0xf015('0x1'));var rs=require(_0xf015('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf015('0x3'));var logger=require(_0xf015('0x4'))(_0xf015('0x5'));var config=require(_0xf015('0x6'));var jayson=require(_0xf015('0x7'));var client=jayson[_0xf015('0x8')][_0xf015('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ae89a,_0x1f3f23,_0x32ffdc){return new BPromise(function(_0x290ff6,_0xffb8eb){return client[_0xf015('0xa')](_0x3ae89a,_0x32ffdc)[_0xf015('0xb')](function(_0x4cd573){logger[_0xf015('0xc')]('ServicenowConfiguration,\x20%s,\x20%s',_0x1f3f23,_0xf015('0xd'));logger[_0xf015('0xe')](_0xf015('0xf'),_0x1f3f23,_0xf015('0xd'),JSON['stringify'](_0x4cd573));if(_0x4cd573['error']){if(_0x4cd573['error'][_0xf015('0x10')]===0x1f4){logger[_0xf015('0x11')](_0xf015('0x12'),_0x1f3f23,_0x4cd573[_0xf015('0x11')][_0xf015('0x13')]);return _0xffb8eb(_0x4cd573[_0xf015('0x11')]['message']);}logger[_0xf015('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x1f3f23,_0x4cd573['error'][_0xf015('0x13')]);return _0x290ff6(_0x4cd573[_0xf015('0x11')]['message']);}else{logger[_0xf015('0xc')](_0xf015('0x12'),_0x1f3f23,_0xf015('0xd'));_0x290ff6(_0x4cd573[_0xf015('0x14')][_0xf015('0x13')]);}})[_0xf015('0x15')](function(_0x582186){logger[_0xf015('0x11')](_0xf015('0x12'),_0x1f3f23,_0x582186);_0xffb8eb(_0x582186);});});} \ No newline at end of file +var _0xd9f4=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x53ebae,_0xedf032){var _0x2ec42a=function(_0x5ea46d){while(--_0x5ea46d){_0x53ebae['push'](_0x53ebae['shift']());}};_0x2ec42a(++_0xedf032);}(_0xd9f4,0x172));var _0x4d9f=function(_0x3da832,_0x2133f1){_0x3da832=_0x3da832-0x0;var _0xe602f2=_0xd9f4[_0x3da832];return _0xe602f2;};'use strict';var _=require(_0x4d9f('0x0'));var util=require(_0x4d9f('0x1'));var moment=require(_0x4d9f('0x2'));var BPromise=require(_0x4d9f('0x3'));var rs=require(_0x4d9f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4d9f('0x5'))['db'];var utils=require(_0x4d9f('0x6'));var logger=require(_0x4d9f('0x7'))(_0x4d9f('0x8'));var config=require(_0x4d9f('0x9'));var jayson=require(_0x4d9f('0xa'));var client=jayson['client'][_0x4d9f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x282769,_0x58bee1,_0x372352){return new BPromise(function(_0x55dfa8,_0x300eef){return client['request'](_0x282769,_0x372352)[_0x4d9f('0xc')](function(_0x3e1549){logger[_0x4d9f('0xd')](_0x4d9f('0xe'),_0x58bee1,_0x4d9f('0xf'));logger[_0x4d9f('0x10')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x58bee1,_0x4d9f('0xf'),JSON[_0x4d9f('0x11')](_0x3e1549));if(_0x3e1549[_0x4d9f('0x12')]){if(_0x3e1549['error']['code']===0x1f4){logger[_0x4d9f('0x12')](_0x4d9f('0xe'),_0x58bee1,_0x3e1549[_0x4d9f('0x12')][_0x4d9f('0x13')]);return _0x300eef(_0x3e1549[_0x4d9f('0x12')]['message']);}logger[_0x4d9f('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x58bee1,_0x3e1549[_0x4d9f('0x12')][_0x4d9f('0x13')]);return _0x55dfa8(_0x3e1549[_0x4d9f('0x12')][_0x4d9f('0x13')]);}else{logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x58bee1,_0x4d9f('0xf'));_0x55dfa8(_0x3e1549[_0x4d9f('0x14')][_0x4d9f('0x13')]);}})[_0x4d9f('0x15')](function(_0x47c26b){logger[_0x4d9f('0x12')](_0x4d9f('0xe'),_0x58bee1,_0x47c26b);_0x300eef(_0x47c26b);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 7fcdefe..b7cbc7a 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 _0x66bc=['../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','post','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x46f942,_0x140f69){var _0x4003c9=function(_0x4229b1){while(--_0x4229b1){_0x46f942['push'](_0x46f942['shift']());}};_0x4003c9(++_0x140f69);}(_0x66bc,0x1ae));var _0xc66b=function(_0x49974b,_0x13d8cb){_0x49974b=_0x49974b-0x0;var _0x287874=_0x66bc[_0x49974b];return _0x287874;};'use strict';var multer=require(_0xc66b('0x0'));var util=require('util');var path=require(_0xc66b('0x1'));var timeout=require(_0xc66b('0x2'));var express=require('express');var router=express[_0xc66b('0x3')]();var fs_extra=require(_0xc66b('0x4'));var auth=require(_0xc66b('0x5'));var interaction=require(_0xc66b('0x6'));var config=require(_0xc66b('0x7'));var controller=require(_0xc66b('0x8'));router[_0xc66b('0x9')]('/',auth[_0xc66b('0xa')](),controller[_0xc66b('0xb')]);router[_0xc66b('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xc66b('0xc')]('/',auth[_0xc66b('0xa')](),controller[_0xc66b('0xd')]);router[_0xc66b('0xe')](_0xc66b('0xf'),auth[_0xc66b('0xa')](),controller[_0xc66b('0x10')]);router['delete'](_0xc66b('0xf'),auth['isAuthenticated'](),controller[_0xc66b('0x11')]);module[_0xc66b('0x12')]=router; \ No newline at end of file +var _0x5c77=['../../config/environment','./intServicenowField.controller','isAuthenticated','get','/:id','post','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x86bad1,_0x2f5e8d){var _0x4cf8f0=function(_0x1033a5){while(--_0x1033a5){_0x86bad1['push'](_0x86bad1['shift']());}};_0x4cf8f0(++_0x2f5e8d);}(_0x5c77,0x13c));var _0x75c7=function(_0xf1402a,_0x187f5c){_0xf1402a=_0xf1402a-0x0;var _0x4f7ead=_0x5c77[_0xf1402a];return _0x4f7ead;};'use strict';var multer=require(_0x75c7('0x0'));var util=require(_0x75c7('0x1'));var path=require(_0x75c7('0x2'));var timeout=require(_0x75c7('0x3'));var express=require('express');var router=express[_0x75c7('0x4')]();var fs_extra=require(_0x75c7('0x5'));var auth=require(_0x75c7('0x6'));var interaction=require(_0x75c7('0x7'));var config=require(_0x75c7('0x8'));var controller=require(_0x75c7('0x9'));router['get']('/',auth[_0x75c7('0xa')](),controller['index']);router[_0x75c7('0xb')](_0x75c7('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x75c7('0xd')]('/',auth[_0x75c7('0xa')](),controller['create']);router['put']('/:id',auth[_0x75c7('0xa')](),controller[_0x75c7('0xe')]);router[_0x75c7('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x75c7('0x10')]);module[_0x75c7('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 798eaec..d8475a2 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 _0x3543=['exports','ENUM','variable','customVariable','picklist','string','STRING','sequelize'];(function(_0x365c0f,_0x29e554){var _0x38a3aa=function(_0xeaa140){while(--_0xeaa140){_0x365c0f['push'](_0x365c0f['shift']());}};_0x38a3aa(++_0x29e554);}(_0x3543,0x16f));var _0x3354=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x3543[_0xae7c2f];return _0x5d7001;};'use strict';var Sequelize=require(_0x3354('0x0'));module[_0x3354('0x1')]={'type':{'type':Sequelize[_0x3354('0x2')]('string',_0x3354('0x3'),_0x3354('0x4'),'keyValue',_0x3354('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x3354('0x2')](_0x3354('0x6'),_0x3354('0x3'),_0x3354('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x3354('0x7')]},'nameField':{'type':Sequelize[_0x3354('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3354('0x7')]}}; \ No newline at end of file +var _0x7e07=['customVariable','keyValue','STRING','BOOLEAN','ENUM','string','variable'];(function(_0x5d96ec,_0x39248f){var _0x350f30=function(_0x8f623f){while(--_0x8f623f){_0x5d96ec['push'](_0x5d96ec['shift']());}};_0x350f30(++_0x39248f);}(_0x7e07,0xc1));var _0x77e0=function(_0x37eb1a,_0x381931){_0x37eb1a=_0x37eb1a-0x0;var _0x5250e9=_0x7e07[_0x37eb1a];return _0x5250e9;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x77e0('0x0')](_0x77e0('0x1'),_0x77e0('0x2'),_0x77e0('0x3'),_0x77e0('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x77e0('0x5')]},'key':{'type':Sequelize[_0x77e0('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x77e0('0x1'),_0x77e0('0x2'),_0x77e0('0x3'))},'keyContent':{'type':Sequelize[_0x77e0('0x5')]},'idField':{'type':Sequelize[_0x77e0('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x77e0('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x77e0('0x5')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 43cb5fb..d5553bc 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 _0xa295=['intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','include','findAll','rows','show','params','keys','rawAttributes','includeAll','create','body','catch','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','save','update','then','destroy','error','stack','index','map','ServicenowField','fieldName','key','query','filters','model'];(function(_0x4d86d7,_0x29884d){var _0x4c80ca=function(_0x21b53b){while(--_0x21b53b){_0x4d86d7['push'](_0x4d86d7['shift']());}};_0x4c80ca(++_0x29884d);}(_0xa295,0x64));var _0x5a29=function(_0x74b5ff,_0x1474e8){_0x74b5ff=_0x74b5ff-0x0;var _0x5a537d=_0xa295[_0x74b5ff];return _0x5a537d;};'use strict';var emlformat=require(_0x5a29('0x0'));var rimraf=require(_0x5a29('0x1'));var zipdir=require(_0x5a29('0x2'));var jsonpatch=require(_0x5a29('0x3'));var rp=require(_0x5a29('0x4'));var moment=require(_0x5a29('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5a29('0x6'));var util=require('util');var path=require(_0x5a29('0x7'));var sox=require('sox');var csv=require(_0x5a29('0x8'));var ejs=require(_0x5a29('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5a29('0xa'));var squel=require(_0x5a29('0xb'));var crypto=require(_0x5a29('0xc'));var jsforce=require(_0x5a29('0xd'));var deskjs=require(_0x5a29('0xe'));var toCsv=require(_0x5a29('0x8'));var querystring=require(_0x5a29('0xf'));var Papa=require(_0x5a29('0x10'));var Redis=require(_0x5a29('0x11'));var authService=require(_0x5a29('0x12'));var qs=require(_0x5a29('0x13'));var as=require(_0x5a29('0x14'));var hardwareService=require(_0x5a29('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x5a29('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5a29('0x17'));var db=require(_0x5a29('0x18'))['db'];function respondWithStatusCode(_0xaa0154,_0x192570){_0x192570=_0x192570||0xcc;return function(_0x5e6149){if(_0x5e6149){return _0xaa0154[_0x5a29('0x19')](_0x192570);}return _0xaa0154[_0x5a29('0x1a')](_0x192570)[_0x5a29('0x1b')]();};}function respondWithResult(_0x122558,_0x5e6f64){_0x5e6f64=_0x5e6f64||0xc8;return function(_0x378e40){if(_0x378e40){return _0x122558[_0x5a29('0x1a')](_0x5e6f64)[_0x5a29('0x1c')](_0x378e40);}};}function respondWithFilteredResult(_0x4222c3,_0x14fe6a){return function(_0x2cacec){if(_0x2cacec){var _0x4965b4=typeof _0x14fe6a[_0x5a29('0x1d')]===_0x5a29('0x1e')&&typeof _0x14fe6a[_0x5a29('0x1f')]===_0x5a29('0x1e');var _0x3771c4=_0x2cacec[_0x5a29('0x20')];var _0x558340=_0x4965b4?0x0:_0x14fe6a['offset'];var _0x43bed0=_0x4965b4?_0x2cacec['count']:_0x14fe6a[_0x5a29('0x1d')]+_0x14fe6a[_0x5a29('0x1f')];var _0x40f187;if(_0x43bed0>=_0x3771c4){_0x43bed0=_0x3771c4;_0x40f187=0xc8;}else{_0x40f187=0xce;}_0x4222c3[_0x5a29('0x1a')](_0x40f187);return _0x4222c3['set']('Content-Range',_0x558340+'-'+_0x43bed0+'/'+_0x3771c4)[_0x5a29('0x1c')](_0x2cacec);}return null;};}function patchUpdates(_0x53ac5c){return function(_0xc60a){try{jsonpatch[_0x5a29('0x21')](_0xc60a,_0x53ac5c,!![]);}catch(_0x4e1418){return BPromise['reject'](_0x4e1418);}return _0xc60a[_0x5a29('0x22')]();};}function saveUpdates(_0x4dd2e5,_0x388b2e){return function(_0x18c6f8){if(_0x18c6f8){return _0x18c6f8[_0x5a29('0x23')](_0x4dd2e5)[_0x5a29('0x24')](function(_0x32609b){return _0x32609b;});}return null;};}function removeEntity(_0x795cc0,_0x1403b7){return function(_0x57fea2){if(_0x57fea2){return _0x57fea2[_0x5a29('0x25')]()['then'](function(){_0x795cc0[_0x5a29('0x1a')](0xcc)[_0x5a29('0x1b')]();});}};}function handleEntityNotFound(_0x3cca42,_0x508ce2){return function(_0xc2820c){if(!_0xc2820c){_0x3cca42[_0x5a29('0x19')](0x194);}return _0xc2820c;};}function handleError(_0x433c64,_0x55c3e8){_0x55c3e8=_0x55c3e8||0x1f4;return function(_0x446683){logger[_0x5a29('0x26')](_0x446683[_0x5a29('0x27')]);if(_0x446683['name']){delete _0x446683['name'];}_0x433c64['status'](_0x55c3e8)['send'](_0x446683);};}exports[_0x5a29('0x28')]=function(_0xc5599c,_0xb2c435){var _0x531401={},_0x2d653a={},_0x7e189b={'count':0x0,'rows':[]};var _0x4a9b67=_[_0x5a29('0x29')](db[_0x5a29('0x2a')]['rawAttributes'],function(_0x455f04){return{'name':_0x455f04[_0x5a29('0x2b')],'type':_0x455f04['type'][_0x5a29('0x2c')]};});_0x2d653a['model']=_[_0x5a29('0x29')](_0x4a9b67,'name');_0x2d653a[_0x5a29('0x2d')]=_['keys'](_0xc5599c['query']);_0x2d653a[_0x5a29('0x2e')]=_['intersection'](_0x2d653a[_0x5a29('0x2f')],_0x2d653a['query']);_0x531401['attributes']=_[_0x5a29('0x30')](_0x2d653a[_0x5a29('0x2f')],qs['fields'](_0xc5599c[_0x5a29('0x2d')][_0x5a29('0x31')]));_0x531401[_0x5a29('0x32')]=_0x531401['attributes'][_0x5a29('0x33')]?_0x531401[_0x5a29('0x32')]:_0x2d653a['model'];if(!_0xc5599c['query'][_0x5a29('0x34')](_0x5a29('0x35'))){_0x531401[_0x5a29('0x1f')]=qs[_0x5a29('0x1f')](_0xc5599c[_0x5a29('0x2d')][_0x5a29('0x1f')]);_0x531401[_0x5a29('0x1d')]=qs[_0x5a29('0x1d')](_0xc5599c['query']['offset']);}_0x531401[_0x5a29('0x36')]=qs[_0x5a29('0x37')](_0xc5599c[_0x5a29('0x2d')][_0x5a29('0x37')]);_0x531401[_0x5a29('0x38')]=qs[_0x5a29('0x2e')](_[_0x5a29('0x39')](_0xc5599c['query'],_0x2d653a['filters']),_0x4a9b67);if(_0xc5599c[_0x5a29('0x2d')][_0x5a29('0x3a')]){_0x531401[_0x5a29('0x38')]=_[_0x5a29('0x3b')](_0x531401[_0x5a29('0x38')],{'$or':_[_0x5a29('0x29')](_0x4a9b67,function(_0x295c21){if(_0x295c21[_0x5a29('0x3c')]!=='VIRTUAL'){var _0x36bd87={};_0x36bd87[_0x295c21['name']]={'$like':'%'+_0xc5599c[_0x5a29('0x2d')][_0x5a29('0x3a')]+'%'};return _0x36bd87;}})});}_0x531401=_['merge']({},_0x531401,_0xc5599c[_0x5a29('0x3d')]);var _0x26d3a4={'where':_0x531401[_0x5a29('0x38')]};return db[_0x5a29('0x2a')][_0x5a29('0x20')](_0x26d3a4)[_0x5a29('0x24')](function(_0x5a2ef4){_0x7e189b['count']=_0x5a2ef4;if(_0xc5599c[_0x5a29('0x2d')]['includeAll']){_0x531401[_0x5a29('0x3e')]=[{'all':!![]}];}return db[_0x5a29('0x2a')][_0x5a29('0x3f')](_0x531401);})[_0x5a29('0x24')](function(_0x38b4f7){_0x7e189b[_0x5a29('0x40')]=_0x38b4f7;return _0x7e189b;})[_0x5a29('0x24')](respondWithFilteredResult(_0xb2c435,_0x531401))['catch'](handleError(_0xb2c435,null));};exports[_0x5a29('0x41')]=function(_0x5f5c3d,_0x169ec6){var _0x4e11b2={'raw':!![],'where':{'id':_0x5f5c3d[_0x5a29('0x42')]['id']}},_0x28fb2c={};_0x28fb2c[_0x5a29('0x2f')]=_[_0x5a29('0x43')](db['ServicenowField'][_0x5a29('0x44')]);_0x28fb2c['query']=_[_0x5a29('0x43')](_0x5f5c3d['query']);_0x28fb2c[_0x5a29('0x2e')]=_[_0x5a29('0x30')](_0x28fb2c[_0x5a29('0x2f')],_0x28fb2c[_0x5a29('0x2d')]);_0x4e11b2[_0x5a29('0x32')]=_[_0x5a29('0x30')](_0x28fb2c[_0x5a29('0x2f')],qs[_0x5a29('0x31')](_0x5f5c3d[_0x5a29('0x2d')][_0x5a29('0x31')]));_0x4e11b2[_0x5a29('0x32')]=_0x4e11b2[_0x5a29('0x32')][_0x5a29('0x33')]?_0x4e11b2[_0x5a29('0x32')]:_0x28fb2c['model'];if(_0x5f5c3d['query'][_0x5a29('0x45')]){_0x4e11b2[_0x5a29('0x3e')]=[{'all':!![]}];}_0x4e11b2=_['merge']({},_0x4e11b2,_0x5f5c3d[_0x5a29('0x3d')]);return db['ServicenowField']['find'](_0x4e11b2)['then'](handleEntityNotFound(_0x169ec6,null))[_0x5a29('0x24')](respondWithResult(_0x169ec6,null))['catch'](handleError(_0x169ec6,null));};exports[_0x5a29('0x46')]=function(_0x5610fd,_0x37b1cc){return db[_0x5a29('0x2a')][_0x5a29('0x46')](_0x5610fd[_0x5a29('0x47')],{})[_0x5a29('0x24')](respondWithResult(_0x37b1cc,0xc9))[_0x5a29('0x48')](handleError(_0x37b1cc,null));};exports[_0x5a29('0x23')]=function(_0x5627aa,_0x4db2cf){if(_0x5627aa['body']['id']){delete _0x5627aa['body']['id'];}return db[_0x5a29('0x2a')][_0x5a29('0x49')]({'where':{'id':_0x5627aa[_0x5a29('0x42')]['id']}})[_0x5a29('0x24')](handleEntityNotFound(_0x4db2cf,null))[_0x5a29('0x24')](saveUpdates(_0x5627aa[_0x5a29('0x47')],null))[_0x5a29('0x24')](respondWithResult(_0x4db2cf,null))[_0x5a29('0x48')](handleError(_0x4db2cf,null));};exports['destroy']=function(_0x33be57,_0x10c98a){return db['ServicenowField'][_0x5a29('0x49')]({'where':{'id':_0x33be57[_0x5a29('0x42')]['id']}})['then'](handleEntityNotFound(_0x10c98a,null))[_0x5a29('0x24')](removeEntity(_0x10c98a,null))[_0x5a29('0x48')](handleError(_0x10c98a,null));}; \ No newline at end of file +var _0x9572=['ejs','fs-extra','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','count','offset','limit','Content-Range','json','apply','reject','then','destroy','end','error','stack','send','index','map','ServicenowField','fieldName','type','key','model','name','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','show','rawAttributes','catch','create','body','update','find','params','rimraf','request-promise','moment','path'];(function(_0x396d1d,_0x17b700){var _0x30df60=function(_0x33beb4){while(--_0x33beb4){_0x396d1d['push'](_0x396d1d['shift']());}};_0x30df60(++_0x17b700);}(_0x9572,0x120));var _0x2957=function(_0x363e9f,_0x974fdc){_0x363e9f=_0x363e9f-0x0;var _0x5d6637=_0x9572[_0x363e9f];return _0x5d6637;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2957('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2957('0x1'));var moment=require(_0x2957('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x2957('0x3'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2957('0x4'));var fs=require('fs');var fs_extra=require(_0x2957('0x5'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2957('0x6'));var jsforce=require('jsforce');var deskjs=require(_0x2957('0x7'));var toCsv=require(_0x2957('0x8'));var querystring=require(_0x2957('0x9'));var Papa=require(_0x2957('0xa'));var Redis=require(_0x2957('0xb'));var authService=require(_0x2957('0xc'));var qs=require(_0x2957('0xd'));var as=require(_0x2957('0xe'));var hardwareService=require(_0x2957('0xf'));var logger=require('../../config/logger')(_0x2957('0x10'));var utils=require(_0x2957('0x11'));var config=require(_0x2957('0x12'));var licenseUtil=require(_0x2957('0x13'));var db=require(_0x2957('0x14'))['db'];function respondWithStatusCode(_0x30164f,_0x4be74d){_0x4be74d=_0x4be74d||0xcc;return function(_0x1e8c7f){if(_0x1e8c7f){return _0x30164f[_0x2957('0x15')](_0x4be74d);}return _0x30164f[_0x2957('0x16')](_0x4be74d)['end']();};}function respondWithResult(_0x83cd12,_0x2565da){_0x2565da=_0x2565da||0xc8;return function(_0x2b3585){if(_0x2b3585){return _0x83cd12[_0x2957('0x16')](_0x2565da)['json'](_0x2b3585);}};}function respondWithFilteredResult(_0x3ad2de,_0x4a0a52){return function(_0x4bd659){if(_0x4bd659){var _0x4994de=typeof _0x4a0a52['offset']===_0x2957('0x17')&&typeof _0x4a0a52['limit']===_0x2957('0x17');var _0x4c545e=_0x4bd659[_0x2957('0x18')];var _0x2a28f8=_0x4994de?0x0:_0x4a0a52[_0x2957('0x19')];var _0x1242f9=_0x4994de?_0x4bd659[_0x2957('0x18')]:_0x4a0a52['offset']+_0x4a0a52[_0x2957('0x1a')];var _0x151b22;if(_0x1242f9>=_0x4c545e){_0x1242f9=_0x4c545e;_0x151b22=0xc8;}else{_0x151b22=0xce;}_0x3ad2de['status'](_0x151b22);return _0x3ad2de['set'](_0x2957('0x1b'),_0x2a28f8+'-'+_0x1242f9+'/'+_0x4c545e)[_0x2957('0x1c')](_0x4bd659);}return null;};}function patchUpdates(_0xf3df52){return function(_0x571f35){try{jsonpatch[_0x2957('0x1d')](_0x571f35,_0xf3df52,!![]);}catch(_0x52f7db){return BPromise[_0x2957('0x1e')](_0x52f7db);}return _0x571f35['save']();};}function saveUpdates(_0x69ff16,_0x342e98){return function(_0x5e163e){if(_0x5e163e){return _0x5e163e['update'](_0x69ff16)[_0x2957('0x1f')](function(_0x26a6b0){return _0x26a6b0;});}return null;};}function removeEntity(_0x5b6751,_0x11b37d){return function(_0x329f4a){if(_0x329f4a){return _0x329f4a[_0x2957('0x20')]()[_0x2957('0x1f')](function(){_0x5b6751['status'](0xcc)[_0x2957('0x21')]();});}};}function handleEntityNotFound(_0x5be68d,_0x26a381){return function(_0x29c7f3){if(!_0x29c7f3){_0x5be68d[_0x2957('0x15')](0x194);}return _0x29c7f3;};}function handleError(_0xf3702b,_0x7f5616){_0x7f5616=_0x7f5616||0x1f4;return function(_0x4d4cac){logger[_0x2957('0x22')](_0x4d4cac[_0x2957('0x23')]);if(_0x4d4cac['name']){delete _0x4d4cac['name'];}_0xf3702b['status'](_0x7f5616)[_0x2957('0x24')](_0x4d4cac);};}exports[_0x2957('0x25')]=function(_0x5bdcf2,_0x4a9a9a){var _0x4af77b={},_0xe41d82={},_0x50f58c={'count':0x0,'rows':[]};var _0x282cd1=_[_0x2957('0x26')](db[_0x2957('0x27')]['rawAttributes'],function(_0x4d63e9){return{'name':_0x4d63e9[_0x2957('0x28')],'type':_0x4d63e9[_0x2957('0x29')][_0x2957('0x2a')]};});_0xe41d82[_0x2957('0x2b')]=_[_0x2957('0x26')](_0x282cd1,_0x2957('0x2c'));_0xe41d82[_0x2957('0x2d')]=_[_0x2957('0x2e')](_0x5bdcf2[_0x2957('0x2d')]);_0xe41d82[_0x2957('0x2f')]=_['intersection'](_0xe41d82[_0x2957('0x2b')],_0xe41d82[_0x2957('0x2d')]);_0x4af77b[_0x2957('0x30')]=_[_0x2957('0x31')](_0xe41d82[_0x2957('0x2b')],qs[_0x2957('0x32')](_0x5bdcf2[_0x2957('0x2d')][_0x2957('0x32')]));_0x4af77b['attributes']=_0x4af77b[_0x2957('0x30')][_0x2957('0x33')]?_0x4af77b[_0x2957('0x30')]:_0xe41d82[_0x2957('0x2b')];if(!_0x5bdcf2['query'][_0x2957('0x34')](_0x2957('0x35'))){_0x4af77b[_0x2957('0x1a')]=qs[_0x2957('0x1a')](_0x5bdcf2[_0x2957('0x2d')][_0x2957('0x1a')]);_0x4af77b['offset']=qs[_0x2957('0x19')](_0x5bdcf2['query'][_0x2957('0x19')]);}_0x4af77b[_0x2957('0x36')]=qs[_0x2957('0x37')](_0x5bdcf2[_0x2957('0x2d')][_0x2957('0x37')]);_0x4af77b['where']=qs['filters'](_[_0x2957('0x38')](_0x5bdcf2[_0x2957('0x2d')],_0xe41d82[_0x2957('0x2f')]),_0x282cd1);if(_0x5bdcf2[_0x2957('0x2d')][_0x2957('0x39')]){_0x4af77b[_0x2957('0x3a')]=_[_0x2957('0x3b')](_0x4af77b[_0x2957('0x3a')],{'$or':_[_0x2957('0x26')](_0x282cd1,function(_0xf12667){if(_0xf12667[_0x2957('0x29')]!==_0x2957('0x3c')){var _0x1eac06={};_0x1eac06[_0xf12667['name']]={'$like':'%'+_0x5bdcf2['query'][_0x2957('0x39')]+'%'};return _0x1eac06;}})});}_0x4af77b=_[_0x2957('0x3b')]({},_0x4af77b,_0x5bdcf2[_0x2957('0x3d')]);var _0x32925f={'where':_0x4af77b[_0x2957('0x3a')]};return db[_0x2957('0x27')]['count'](_0x32925f)[_0x2957('0x1f')](function(_0x2004a2){_0x50f58c[_0x2957('0x18')]=_0x2004a2;if(_0x5bdcf2['query'][_0x2957('0x3e')]){_0x4af77b['include']=[{'all':!![]}];}return db[_0x2957('0x27')][_0x2957('0x3f')](_0x4af77b);})['then'](function(_0x3ceeb3){_0x50f58c[_0x2957('0x40')]=_0x3ceeb3;return _0x50f58c;})[_0x2957('0x1f')](respondWithFilteredResult(_0x4a9a9a,_0x4af77b))['catch'](handleError(_0x4a9a9a,null));};exports[_0x2957('0x41')]=function(_0x33719e,_0x26f573){var _0x235f10={'raw':!![],'where':{'id':_0x33719e['params']['id']}},_0x16476c={};_0x16476c['model']=_[_0x2957('0x2e')](db[_0x2957('0x27')][_0x2957('0x42')]);_0x16476c[_0x2957('0x2d')]=_[_0x2957('0x2e')](_0x33719e[_0x2957('0x2d')]);_0x16476c[_0x2957('0x2f')]=_[_0x2957('0x31')](_0x16476c[_0x2957('0x2b')],_0x16476c['query']);_0x235f10[_0x2957('0x30')]=_[_0x2957('0x31')](_0x16476c[_0x2957('0x2b')],qs[_0x2957('0x32')](_0x33719e[_0x2957('0x2d')]['fields']));_0x235f10[_0x2957('0x30')]=_0x235f10[_0x2957('0x30')]['length']?_0x235f10['attributes']:_0x16476c[_0x2957('0x2b')];if(_0x33719e['query'][_0x2957('0x3e')]){_0x235f10['include']=[{'all':!![]}];}_0x235f10=_[_0x2957('0x3b')]({},_0x235f10,_0x33719e[_0x2957('0x3d')]);return db[_0x2957('0x27')]['find'](_0x235f10)[_0x2957('0x1f')](handleEntityNotFound(_0x26f573,null))[_0x2957('0x1f')](respondWithResult(_0x26f573,null))[_0x2957('0x43')](handleError(_0x26f573,null));};exports[_0x2957('0x44')]=function(_0x5e75b5,_0x1fa728){return db[_0x2957('0x27')][_0x2957('0x44')](_0x5e75b5[_0x2957('0x45')],{})[_0x2957('0x1f')](respondWithResult(_0x1fa728,0xc9))[_0x2957('0x43')](handleError(_0x1fa728,null));};exports[_0x2957('0x46')]=function(_0x4546f0,_0x3154c6){if(_0x4546f0['body']['id']){delete _0x4546f0[_0x2957('0x45')]['id'];}return db[_0x2957('0x27')][_0x2957('0x47')]({'where':{'id':_0x4546f0[_0x2957('0x48')]['id']}})[_0x2957('0x1f')](handleEntityNotFound(_0x3154c6,null))[_0x2957('0x1f')](saveUpdates(_0x4546f0['body'],null))[_0x2957('0x1f')](respondWithResult(_0x3154c6,null))[_0x2957('0x43')](handleError(_0x3154c6,null));};exports['destroy']=function(_0x1767c7,_0x8a3fe0){return db[_0x2957('0x27')][_0x2957('0x47')]({'where':{'id':_0x1767c7[_0x2957('0x48')]['id']}})[_0x2957('0x1f')](handleEntityNotFound(_0x8a3fe0,null))[_0x2957('0x1f')](removeEntity(_0x8a3fe0,null))[_0x2957('0x43')](handleError(_0x8a3fe0,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index d656f39..d7e695a 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 _0xbabd=['../../config/logger','api','moment','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId'];(function(_0x266670,_0x35d63f){var _0x90a057=function(_0x4e6301){while(--_0x4e6301){_0x266670['push'](_0x266670['shift']());}};_0x90a057(++_0x35d63f);}(_0xbabd,0x118));var _0xdbab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbabd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdbab('0x0'))(_0xdbab('0x1'));var moment=require(_0xdbab('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdbab('0x3'));var rimraf=require(_0xdbab('0x4'));var config=require(_0xdbab('0x5'));var attributes=require(_0xdbab('0x6'));module[_0xdbab('0x7')]=function(_0x55fa72,_0x20db25){return _0x55fa72[_0xdbab('0x8')](_0xdbab('0x9'),attributes,{'tableName':_0xdbab('0xa'),'paranoid':![],'indexes':[{'name':_0xdbab('0xb'),'fields':[_0xdbab('0xc'),_0xdbab('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0800=['FieldId','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','define','int_servicenow_fields','idField'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0800,0xa9));var _0x0080=function(_0x45ce1a,_0x4f8ea5){_0x45ce1a=_0x45ce1a-0x0;var _0x4926d8=_0x0800[_0x45ce1a];return _0x4926d8;};'use strict';var _=require(_0x0080('0x0'));var util=require(_0x0080('0x1'));var logger=require(_0x0080('0x2'))(_0x0080('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0080('0x4'));var fs=require('fs');var path=require(_0x0080('0x5'));var rimraf=require(_0x0080('0x6'));var config=require(_0x0080('0x7'));var attributes=require('./intServicenowField.attributes');module['exports']=function(_0x4f7f7c,_0x240e20){return _0x4f7f7c[_0x0080('0x8')]('ServicenowField',attributes,{'tableName':_0x0080('0x9'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x0080('0xa'),_0x0080('0xb')],'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 edf88b5..de45d79 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 _0xbaf0=['client','http','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x549278,_0x450754){var _0x1ea9a1=function(_0x2e559d){while(--_0x2e559d){_0x549278['push'](_0x549278['shift']());}};_0x1ea9a1(++_0x450754);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){return client['request'](_0x1a10b1,_0x1d0a0d)[_0x0baf('0xc')](function(_0x2c7442){logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,_0x0baf('0xf'));logger[_0x0baf('0x10')](_0x0baf('0x11'),_0x2dcaac,_0x0baf('0xf'),JSON[_0x0baf('0x12')](_0x2c7442));if(_0x2c7442[_0x0baf('0x13')]){if(_0x2c7442[_0x0baf('0x13')]['code']===0x1f4){logger['error'](_0x0baf('0xe'),_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x11b947(_0x2c7442[_0x0baf('0x13')]['message']);}logger[_0x0baf('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});} \ No newline at end of file +var _0x70e0=['code','ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x50315e,_0x30616f){var _0x5c3344=function(_0x26d50f){while(--_0x26d50f){_0x50315e['push'](_0x50315e['shift']());}};_0x5c3344(++_0x30616f);}(_0x70e0,0x17b));var _0x070e=function(_0x3f3402,_0x5d54d1){_0x3f3402=_0x3f3402-0x0;var _0x3573d6=_0x70e0[_0x3f3402];return _0x3573d6;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('ServicenowField,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('ServicenowField,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('ServicenowField,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 92993f5..c36ead2 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x5eb6c2,_0x558b48){var _0x8d7e2a=function(_0x4d82a4){while(--_0x4d82a4){_0x5eb6c2['push'](_0x5eb6c2['shift']());}};_0x8d7e2a(++_0x558b48);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x27054c,_0x546334){var _0x504e89=function(_0x529c99){while(--_0x529c99){_0x27054c['push'](_0x27054c['shift']());}};_0x504e89(++_0x546334);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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 1e2b795..bf33e54 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(_0x382571,_0x3a27bf){var _0x4be11c=function(_0x5b44bb){while(--_0x5b44bb){_0x382571['push'](_0x382571['shift']());}};_0x4be11c(++_0x3a27bf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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(_0x3ffe1a,_0x32826f){var _0x267de2=function(_0x40acf8){while(--_0x40acf8){_0x3ffe1a['push'](_0x3ffe1a['shift']());}};_0x267de2(++_0x32826f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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 d7f11d0..b63d87c 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 _0xc8e9=['catch','create','body','params','findOne','SugarcrmConfiguration','getConfigurations','addConfiguration','AccountId','channel','Descriptions','Subjects','SugarcrmField','getFields','assigned_user_id','created_by','duration_hours','parent_id','direction','remoteUri','substring','lastIndexOf','POST','format','/service/v4_1/rest.php','login','JSON','stringify','password','PLAIN','Password\x20Expired','%s%s','Calls','values','module_fields','remove','includes','endsWith','value','test','statusCode','Wrong\x20credentials','eml-format','zip-dir','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','end','status','offset','undefined','limit','count','Content-Range','reject','update','destroy','error','stack','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','type','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','options','include','findAll','then','rows','includeAll','find'];(function(_0x22811b,_0x2f6e1f){var _0x3d99cd=function(_0x1c98cd){while(--_0x1c98cd){_0x22811b['push'](_0x22811b['shift']());}};_0x3d99cd(++_0x2f6e1f);}(_0xc8e9,0x1d6));var _0x9c8e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc8e9[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x9c8e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9c8e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9c8e('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9c8e('0x3'));var sox=require(_0x9c8e('0x4'));var csv=require(_0x9c8e('0x5'));var ejs=require(_0x9c8e('0x6'));var fs=require('fs');var fs_extra=require(_0x9c8e('0x7'));var _=require('lodash');var squel=require(_0x9c8e('0x8'));var crypto=require(_0x9c8e('0x9'));var jsforce=require(_0x9c8e('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x9c8e('0x5'));var querystring=require(_0x9c8e('0xb'));var Papa=require(_0x9c8e('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9c8e('0xd'));var as=require(_0x9c8e('0xe'));var hardwareService=require(_0x9c8e('0xf'));var logger=require(_0x9c8e('0x10'))(_0x9c8e('0x11'));var utils=require(_0x9c8e('0x12'));var config=require(_0x9c8e('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x9c8e('0x14'));function respondWithStatusCode(_0x22ba10,_0x5c35d8){_0x5c35d8=_0x5c35d8||0xcc;return function(_0xd458e9){if(_0xd458e9){return _0x22ba10[_0x9c8e('0x15')](_0x5c35d8);}return _0x22ba10['status'](_0x5c35d8)[_0x9c8e('0x16')]();};}function respondWithResult(_0x5a6740,_0x1aa999){_0x1aa999=_0x1aa999||0xc8;return function(_0x1fced8){if(_0x1fced8){return _0x5a6740[_0x9c8e('0x17')](_0x1aa999)['json'](_0x1fced8);}};}function respondWithFilteredResult(_0x3c164e,_0x57397e){return function(_0x617744){if(_0x617744){var _0x1f4a02=typeof _0x57397e[_0x9c8e('0x18')]===_0x9c8e('0x19')&&typeof _0x57397e[_0x9c8e('0x1a')]===_0x9c8e('0x19');var _0x45d5ab=_0x617744[_0x9c8e('0x1b')];var _0xc04174=_0x1f4a02?0x0:_0x57397e[_0x9c8e('0x18')];var _0xdd72b4=_0x1f4a02?_0x617744[_0x9c8e('0x1b')]:_0x57397e[_0x9c8e('0x18')]+_0x57397e[_0x9c8e('0x1a')];var _0x461ffe;if(_0xdd72b4>=_0x45d5ab){_0xdd72b4=_0x45d5ab;_0x461ffe=0xc8;}else{_0x461ffe=0xce;}_0x3c164e[_0x9c8e('0x17')](_0x461ffe);return _0x3c164e['set'](_0x9c8e('0x1c'),_0xc04174+'-'+_0xdd72b4+'/'+_0x45d5ab)['json'](_0x617744);}return null;};}function patchUpdates(_0x552ffc){return function(_0x2246c3){try{jsonpatch['apply'](_0x2246c3,_0x552ffc,!![]);}catch(_0x24f32d){return BPromise[_0x9c8e('0x1d')](_0x24f32d);}return _0x2246c3['save']();};}function saveUpdates(_0xa0a9a7,_0x15e4cf){return function(_0x3f382a){if(_0x3f382a){return _0x3f382a[_0x9c8e('0x1e')](_0xa0a9a7)['then'](function(_0x1bd38a){return _0x1bd38a;});}return null;};}function removeEntity(_0x3c798e,_0x4a8e19){return function(_0x5bf539){if(_0x5bf539){return _0x5bf539[_0x9c8e('0x1f')]()['then'](function(){_0x3c798e[_0x9c8e('0x17')](0xcc)[_0x9c8e('0x16')]();});}};}function handleEntityNotFound(_0x24de42,_0xc8d5c8){return function(_0x329e88){if(!_0x329e88){_0x24de42[_0x9c8e('0x15')](0x194);}return _0x329e88;};}function handleError(_0x37fce3,_0x17e6b5){_0x17e6b5=_0x17e6b5||0x1f4;return function(_0x37b281){logger[_0x9c8e('0x20')](_0x37b281[_0x9c8e('0x21')]);if(_0x37b281[_0x9c8e('0x22')]){delete _0x37b281[_0x9c8e('0x22')];}_0x37fce3[_0x9c8e('0x17')](_0x17e6b5)[_0x9c8e('0x23')](_0x37b281);};}exports[_0x9c8e('0x24')]=function(_0x6a5901,_0x3ef564){var _0x458efe={},_0x117eec={},_0x36eb6e={'count':0x0,'rows':[]};var _0x5e0674=_[_0x9c8e('0x25')](db[_0x9c8e('0x26')][_0x9c8e('0x27')],function(_0x2a1795){return{'name':_0x2a1795[_0x9c8e('0x28')],'type':_0x2a1795[_0x9c8e('0x29')]['key']};});_0x117eec[_0x9c8e('0x2a')]=_['map'](_0x5e0674,_0x9c8e('0x22'));_0x117eec['query']=_[_0x9c8e('0x2b')](_0x6a5901['query']);_0x117eec[_0x9c8e('0x2c')]=_[_0x9c8e('0x2d')](_0x117eec[_0x9c8e('0x2a')],_0x117eec[_0x9c8e('0x2e')]);_0x458efe['attributes']=_[_0x9c8e('0x2d')](_0x117eec[_0x9c8e('0x2a')],qs[_0x9c8e('0x2f')](_0x6a5901['query'][_0x9c8e('0x2f')]));_0x458efe[_0x9c8e('0x30')]=_0x458efe[_0x9c8e('0x30')][_0x9c8e('0x31')]?_0x458efe['attributes']:_0x117eec[_0x9c8e('0x2a')];if(!_0x6a5901['query'][_0x9c8e('0x32')]('nolimit')){_0x458efe[_0x9c8e('0x1a')]=qs[_0x9c8e('0x1a')](_0x6a5901[_0x9c8e('0x2e')][_0x9c8e('0x1a')]);_0x458efe[_0x9c8e('0x18')]=qs['offset'](_0x6a5901[_0x9c8e('0x2e')][_0x9c8e('0x18')]);}_0x458efe[_0x9c8e('0x33')]=qs[_0x9c8e('0x34')](_0x6a5901[_0x9c8e('0x2e')][_0x9c8e('0x34')]);_0x458efe[_0x9c8e('0x35')]=qs['filters'](_[_0x9c8e('0x36')](_0x6a5901[_0x9c8e('0x2e')],_0x117eec['filters']),_0x5e0674);if(_0x6a5901[_0x9c8e('0x2e')]['filter']){_0x458efe[_0x9c8e('0x35')]=_['merge'](_0x458efe[_0x9c8e('0x35')],{'$or':_[_0x9c8e('0x25')](_0x5e0674,function(_0x1c78d0){if(_0x1c78d0[_0x9c8e('0x29')]!==_0x9c8e('0x37')){var _0x48c15c={};_0x48c15c[_0x1c78d0[_0x9c8e('0x22')]]={'$like':'%'+_0x6a5901['query'][_0x9c8e('0x38')]+'%'};return _0x48c15c;}})});}_0x458efe=_[_0x9c8e('0x39')]({},_0x458efe,_0x6a5901[_0x9c8e('0x3a')]);var _0x18ae82={'where':_0x458efe[_0x9c8e('0x35')]};return db['SugarcrmAccount']['count'](_0x18ae82)['then'](function(_0x599f58){_0x36eb6e[_0x9c8e('0x1b')]=_0x599f58;if(_0x6a5901['query']['includeAll']){_0x458efe[_0x9c8e('0x3b')]=[{'all':!![]}];}return db[_0x9c8e('0x26')][_0x9c8e('0x3c')](_0x458efe);})[_0x9c8e('0x3d')](function(_0xdf883b){_0x36eb6e[_0x9c8e('0x3e')]=_0xdf883b;return _0x36eb6e;})[_0x9c8e('0x3d')](respondWithFilteredResult(_0x3ef564,_0x458efe))['catch'](handleError(_0x3ef564,null));};exports['show']=function(_0x53746c,_0x95809c){var _0x2858e9={'raw':![],'where':{'id':_0x53746c['params']['id']}},_0xa5a63={};_0xa5a63[_0x9c8e('0x2a')]=_[_0x9c8e('0x2b')](db[_0x9c8e('0x26')][_0x9c8e('0x27')]);_0xa5a63['query']=_[_0x9c8e('0x2b')](_0x53746c['query']);_0xa5a63['filters']=_[_0x9c8e('0x2d')](_0xa5a63[_0x9c8e('0x2a')],_0xa5a63[_0x9c8e('0x2e')]);_0x2858e9['attributes']=_['intersection'](_0xa5a63[_0x9c8e('0x2a')],qs[_0x9c8e('0x2f')](_0x53746c['query'][_0x9c8e('0x2f')]));_0x2858e9['attributes']=_0x2858e9[_0x9c8e('0x30')][_0x9c8e('0x31')]?_0x2858e9[_0x9c8e('0x30')]:_0xa5a63[_0x9c8e('0x2a')];if(_0x53746c[_0x9c8e('0x2e')][_0x9c8e('0x3f')]){_0x2858e9['include']=[{'all':!![]}];}_0x2858e9=_[_0x9c8e('0x39')]({},_0x2858e9,_0x53746c[_0x9c8e('0x3a')]);return db[_0x9c8e('0x26')][_0x9c8e('0x40')](_0x2858e9)[_0x9c8e('0x3d')](handleEntityNotFound(_0x95809c,null))[_0x9c8e('0x3d')](respondWithResult(_0x95809c,null))[_0x9c8e('0x41')](handleError(_0x95809c,null));};exports['create']=function(_0x365211,_0x561d25){return db[_0x9c8e('0x26')][_0x9c8e('0x42')](_0x365211[_0x9c8e('0x43')],{})[_0x9c8e('0x3d')](respondWithResult(_0x561d25,0xc9))['catch'](handleError(_0x561d25,null));};exports[_0x9c8e('0x1e')]=function(_0x4a29c3,_0x4685f7){if(_0x4a29c3[_0x9c8e('0x43')]['id']){delete _0x4a29c3[_0x9c8e('0x43')]['id'];}return db[_0x9c8e('0x26')]['find']({'where':{'id':_0x4a29c3[_0x9c8e('0x44')]['id']}})['then'](handleEntityNotFound(_0x4685f7,null))['then'](saveUpdates(_0x4a29c3['body'],null))[_0x9c8e('0x3d')](respondWithResult(_0x4685f7,null))['catch'](handleError(_0x4685f7,null));};exports[_0x9c8e('0x1f')]=function(_0x5194e2,_0x27e81c){return db[_0x9c8e('0x26')]['find']({'where':{'id':_0x5194e2['params']['id']}})[_0x9c8e('0x3d')](handleEntityNotFound(_0x27e81c,null))['then'](removeEntity(_0x27e81c,null))[_0x9c8e('0x41')](handleError(_0x27e81c,null));};exports['getConfigurations']=function(_0x17f7ec,_0x3aca22,_0x270590){var _0x409dd4={};var _0x40c83f={};var _0x3ed4dd;var _0x3e54ac;return db[_0x9c8e('0x26')][_0x9c8e('0x45')]({'where':{'id':_0x17f7ec[_0x9c8e('0x44')]['id']}})[_0x9c8e('0x3d')](handleEntityNotFound(_0x3aca22,null))[_0x9c8e('0x3d')](function(_0x1d353a){if(_0x1d353a){_0x3ed4dd=_0x1d353a;_0x40c83f[_0x9c8e('0x2a')]=_['keys'](db[_0x9c8e('0x46')][_0x9c8e('0x27')]);_0x40c83f[_0x9c8e('0x2e')]=_[_0x9c8e('0x2b')](_0x17f7ec['query']);_0x40c83f[_0x9c8e('0x2c')]=_[_0x9c8e('0x2d')](_0x40c83f[_0x9c8e('0x2a')],_0x40c83f[_0x9c8e('0x2e')]);_0x409dd4[_0x9c8e('0x30')]=_[_0x9c8e('0x2d')](_0x40c83f[_0x9c8e('0x2a')],qs[_0x9c8e('0x2f')](_0x17f7ec[_0x9c8e('0x2e')]['fields']));_0x409dd4[_0x9c8e('0x30')]=_0x409dd4[_0x9c8e('0x30')][_0x9c8e('0x31')]?_0x409dd4['attributes']:_0x40c83f['model'];_0x409dd4[_0x9c8e('0x33')]=qs['sort'](_0x17f7ec[_0x9c8e('0x2e')]['sort']);_0x409dd4['where']=qs['filters'](_[_0x9c8e('0x36')](_0x17f7ec['query'],_0x40c83f['filters']));if(_0x17f7ec['query'][_0x9c8e('0x38')]){_0x409dd4[_0x9c8e('0x35')]=_[_0x9c8e('0x39')](_0x409dd4['where'],{'$or':_['map'](_0x409dd4[_0x9c8e('0x30')],function(_0xe09ae2){var _0x3425b7={};_0x3425b7[_0xe09ae2]={'$like':'%'+_0x17f7ec[_0x9c8e('0x2e')]['filter']+'%'};return _0x3425b7;})});}_0x409dd4=_[_0x9c8e('0x39')]({},_0x409dd4,_0x17f7ec[_0x9c8e('0x3a')]);return _0x3ed4dd[_0x9c8e('0x47')](_0x409dd4);}})[_0x9c8e('0x3d')](function(_0x501276){if(_0x501276){_0x3e54ac=_0x501276[_0x9c8e('0x31')];if(!_0x17f7ec[_0x9c8e('0x2e')]['hasOwnProperty']('nolimit')){_0x409dd4[_0x9c8e('0x1a')]=qs[_0x9c8e('0x1a')](_0x17f7ec[_0x9c8e('0x2e')][_0x9c8e('0x1a')]);_0x409dd4[_0x9c8e('0x18')]=qs[_0x9c8e('0x18')](_0x17f7ec[_0x9c8e('0x2e')][_0x9c8e('0x18')]);}return _0x3ed4dd[_0x9c8e('0x47')](_0x409dd4);}})[_0x9c8e('0x3d')](function(_0x520fc2){if(_0x520fc2){return _0x520fc2?{'count':_0x3e54ac,'rows':_0x520fc2}:null;}})[_0x9c8e('0x3d')](respondWithResult(_0x3aca22,null))[_0x9c8e('0x41')](handleError(_0x3aca22,null));};exports[_0x9c8e('0x48')]=function(_0x101826,_0x4f77d8,_0x456944){if(_0x101826[_0x9c8e('0x43')]['id']){delete _0x101826[_0x9c8e('0x43')]['id'];}return db[_0x9c8e('0x26')][_0x9c8e('0x45')]({'where':{'id':_0x101826['params']['id']}})[_0x9c8e('0x3d')](handleEntityNotFound(_0x4f77d8,null))[_0x9c8e('0x3d')](function(_0x596057){if(_0x596057){_0x101826[_0x9c8e('0x43')][_0x9c8e('0x49')]=_0x596057['id'];_0x101826['body']['Subjects']=integrations['getSubjects'](_0x101826['body'][_0x9c8e('0x4a')],_0x101826[_0x9c8e('0x43')]['type']);_0x101826[_0x9c8e('0x43')][_0x9c8e('0x4b')]=integrations['getDescriptions'](_0x101826[_0x9c8e('0x43')][_0x9c8e('0x4a')],_0x101826[_0x9c8e('0x43')][_0x9c8e('0x29')]);return db[_0x9c8e('0x46')]['create'](_0x101826[_0x9c8e('0x43')],{'include':[{'model':db['SugarcrmField'],'as':_0x9c8e('0x4c')},{'model':db[_0x9c8e('0x4d')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x4f77d8,null))['catch'](handleError(_0x4f77d8,null));};exports[_0x9c8e('0x4e')]=function(_0x16cd7c,_0x56d211,_0xfc72c7){var _0x261527='';var _0x1eafc8=['id',_0x9c8e('0x22'),_0x9c8e('0x4f'),_0x9c8e('0x50'),'description','date_start',_0x9c8e('0x51'),'duration_minutes',_0x9c8e('0x52'),'parent_type','parent_name',_0x9c8e('0x53')];return db['SugarcrmAccount'][_0x9c8e('0x45')]({'where':{'id':_0x16cd7c['params']['id']},'attributes':['id','username','password',_0x9c8e('0x54')]})[_0x9c8e('0x3d')](handleEntityNotFound(_0x56d211,null))['then'](function(_0x280912){if(_0x280912){_0x261527=_0x280912[_0x9c8e('0x54')];var _0x1ec198=_0x261527['slice'](-0x1);if(_0x1ec198==='/'){_0x261527=_0x261527[_0x9c8e('0x55')](0x0,_0x261527[_0x9c8e('0x56')](_0x1ec198));}return rp({'method':_0x9c8e('0x57'),'uri':util[_0x9c8e('0x58')]('%s%s',_0x261527,_0x9c8e('0x59')),'json':!![],'form':{'method':_0x9c8e('0x5a'),'input_type':_0x9c8e('0x5b'),'response_type':_0x9c8e('0x5b'),'rest_data':JSON[_0x9c8e('0x5c')]({'user_auth':{'user_name':_0x280912['username'],'password':_0x280912[_0x9c8e('0x5d')],'encryption':_0x9c8e('0x5e')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0x9c8e('0x3d')](function(_0x94ac98){if(_0x94ac98&&_0x94ac98[_0x9c8e('0x22')]!=='Invalid\x20Login'&&_0x94ac98['name']!==_0x9c8e('0x5f')){return rp({'method':'POST','uri':util['format'](_0x9c8e('0x60'),_0x261527,_0x9c8e('0x59')),'json':!![],'form':{'method':'get_module_fields','input_type':_0x9c8e('0x5b'),'response_type':_0x9c8e('0x5b'),'rest_data':JSON[_0x9c8e('0x5c')]({'session':_0x94ac98['id'],'module_name':_0x9c8e('0x61')})}})[_0x9c8e('0x3d')](function(_0x30ceff){if(_0x30ceff){var _0xb30d38=_[_0x9c8e('0x62')](_0x30ceff[_0x9c8e('0x63')]);_[_0x9c8e('0x64')](_0xb30d38,function(_0x18755b){return _0x1eafc8[_0x9c8e('0x65')](_0x18755b[_0x9c8e('0x22')]);});return{'count':_0xb30d38[_0x9c8e('0x31')],'rows':_[_0x9c8e('0x25')](_0xb30d38,function(_0x46c756){return{'id':_0x46c756[_0x9c8e('0x22')],'name':_0x46c756['label'],'custom':_[_0x9c8e('0x66')](_0x46c756[_0x9c8e('0x22')],'_c')?!![]:![],'options':_0x46c756[_0x9c8e('0x3a')]?_[_0x9c8e('0x25')](_[_0x9c8e('0x62')](_0x46c756['options']),function(_0x3e6739){return{'name':_0x3e6739[_0x9c8e('0x67')],'value':_0x3e6739[_0x9c8e('0x22')]};}):[]};})};}})[_0x9c8e('0x3d')](respondWithResult(_0x56d211,null))[_0x9c8e('0x41')](function(_0x5a856a){var _0x3569f5=_0x16cd7c[_0x9c8e('0x2e')][_0x9c8e('0x68')]?0x1f4:_0x5a856a[_0x9c8e('0x69')]||0x1f4;logger[_0x9c8e('0x20')]('getFields,\x20%s,\x20%s,\x20%s',_0x9c8e('0x4e'),_0x3569f5,JSON[_0x9c8e('0x5c')](_0x5a856a));delete _0x5a856a['name'];if(_0x3569f5===0x191){_0x3569f5=0x190;}_0x56d211[_0x9c8e('0x17')](_0x3569f5)['send'](_0x16cd7c[_0x9c8e('0x2e')][_0x9c8e('0x68')]?{'message':_0x9c8e('0x6a'),'statusCode':_0x5a856a[_0x9c8e('0x69')]}:_0x5a856a);});}else{var _0x1ed137=0x1f4;_0x56d211[_0x9c8e('0x17')](_0x1ed137)['send']({'message':_0x9c8e('0x6a'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x7201=['Password\x20Expired','format','%s%s','get_module_fields','module_fields','includes','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','mustache','util','sox','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','apply','reject','update','error','stack','name','index','map','SugarcrmAccount','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','type','VIRTUAL','filter','options','then','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','destroy','getConfigurations','findOne','SugarcrmConfiguration','hasOwnProperty','nolimit','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','Subjects','getFields','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','password','remoteUri','substring','lastIndexOf','POST','/service/v4_1/rest.php','login','JSON','stringify','username','PLAIN','Invalid\x20Login'];(function(_0x1ca553,_0x199ae2){var _0x39ab40=function(_0x108bbe){while(--_0x108bbe){_0x1ca553['push'](_0x1ca553['shift']());}};_0x39ab40(++_0x199ae2);}(_0x7201,0x85));var _0x1720=function(_0x45f9ef,_0x79262b){_0x45f9ef=_0x45f9ef-0x0;var _0xbb4a63=_0x7201[_0x45f9ef];return _0xbb4a63;};'use strict';var emlformat=require(_0x1720('0x0'));var rimraf=require(_0x1720('0x1'));var zipdir=require(_0x1720('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1720('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1720('0x4'));var util=require(_0x1720('0x5'));var path=require('path');var sox=require(_0x1720('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1720('0x7'));var _=require('lodash');var squel=require(_0x1720('0x8'));var crypto=require('crypto');var jsforce=require(_0x1720('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1720('0xa'));var Papa=require(_0x1720('0xb'));var Redis=require(_0x1720('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1720('0xd'));var hardwareService=require(_0x1720('0xe'));var logger=require(_0x1720('0xf'))(_0x1720('0x10'));var utils=require(_0x1720('0x11'));var config=require(_0x1720('0x12'));var licenseUtil=require(_0x1720('0x13'));var db=require(_0x1720('0x14'))['db'];var integrations=require(_0x1720('0x15'));function respondWithStatusCode(_0xbddaa,_0x50cc89){_0x50cc89=_0x50cc89||0xcc;return function(_0x41fa5a){if(_0x41fa5a){return _0xbddaa[_0x1720('0x16')](_0x50cc89);}return _0xbddaa['status'](_0x50cc89)[_0x1720('0x17')]();};}function respondWithResult(_0xc2abf1,_0x347795){_0x347795=_0x347795||0xc8;return function(_0x292602){if(_0x292602){return _0xc2abf1[_0x1720('0x18')](_0x347795)[_0x1720('0x19')](_0x292602);}};}function respondWithFilteredResult(_0x4896f1,_0x2db19c){return function(_0x53be35){if(_0x53be35){var _0x7985c7=typeof _0x2db19c[_0x1720('0x1a')]==='undefined'&&typeof _0x2db19c[_0x1720('0x1b')]===_0x1720('0x1c');var _0x14909b=_0x53be35['count'];var _0x5efa6d=_0x7985c7?0x0:_0x2db19c[_0x1720('0x1a')];var _0x31537c=_0x7985c7?_0x53be35[_0x1720('0x1d')]:_0x2db19c['offset']+_0x2db19c[_0x1720('0x1b')];var _0x4a285c;if(_0x31537c>=_0x14909b){_0x31537c=_0x14909b;_0x4a285c=0xc8;}else{_0x4a285c=0xce;}_0x4896f1['status'](_0x4a285c);return _0x4896f1['set'](_0x1720('0x1e'),_0x5efa6d+'-'+_0x31537c+'/'+_0x14909b)[_0x1720('0x19')](_0x53be35);}return null;};}function patchUpdates(_0x6f8e64){return function(_0x32df43){try{jsonpatch[_0x1720('0x1f')](_0x32df43,_0x6f8e64,!![]);}catch(_0x5f516d){return BPromise[_0x1720('0x20')](_0x5f516d);}return _0x32df43['save']();};}function saveUpdates(_0x3c2dc7,_0x57e088){return function(_0x15115c){if(_0x15115c){return _0x15115c[_0x1720('0x21')](_0x3c2dc7)['then'](function(_0x31cd45){return _0x31cd45;});}return null;};}function removeEntity(_0x352b74,_0x215d2d){return function(_0x1e6955){if(_0x1e6955){return _0x1e6955['destroy']()['then'](function(){_0x352b74[_0x1720('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39a206,_0x76fb33){return function(_0x5b8325){if(!_0x5b8325){_0x39a206[_0x1720('0x16')](0x194);}return _0x5b8325;};}function handleError(_0x2b04f0,_0x519b09){_0x519b09=_0x519b09||0x1f4;return function(_0x45f299){logger[_0x1720('0x22')](_0x45f299[_0x1720('0x23')]);if(_0x45f299[_0x1720('0x24')]){delete _0x45f299['name'];}_0x2b04f0[_0x1720('0x18')](_0x519b09)['send'](_0x45f299);};}exports[_0x1720('0x25')]=function(_0x956eb5,_0x73cd77){var _0xe7466d={},_0xa79bdc={},_0x222ca1={'count':0x0,'rows':[]};var _0x3118f8=_[_0x1720('0x26')](db[_0x1720('0x27')][_0x1720('0x28')],function(_0x256ff5){return{'name':_0x256ff5[_0x1720('0x29')],'type':_0x256ff5['type'][_0x1720('0x2a')]};});_0xa79bdc[_0x1720('0x2b')]=_[_0x1720('0x26')](_0x3118f8,_0x1720('0x24'));_0xa79bdc[_0x1720('0x2c')]=_['keys'](_0x956eb5[_0x1720('0x2c')]);_0xa79bdc[_0x1720('0x2d')]=_[_0x1720('0x2e')](_0xa79bdc[_0x1720('0x2b')],_0xa79bdc[_0x1720('0x2c')]);_0xe7466d[_0x1720('0x2f')]=_[_0x1720('0x2e')](_0xa79bdc[_0x1720('0x2b')],qs[_0x1720('0x30')](_0x956eb5[_0x1720('0x2c')][_0x1720('0x30')]));_0xe7466d[_0x1720('0x2f')]=_0xe7466d[_0x1720('0x2f')][_0x1720('0x31')]?_0xe7466d['attributes']:_0xa79bdc[_0x1720('0x2b')];if(!_0x956eb5[_0x1720('0x2c')]['hasOwnProperty']('nolimit')){_0xe7466d[_0x1720('0x1b')]=qs[_0x1720('0x1b')](_0x956eb5[_0x1720('0x2c')][_0x1720('0x1b')]);_0xe7466d[_0x1720('0x1a')]=qs[_0x1720('0x1a')](_0x956eb5[_0x1720('0x2c')]['offset']);}_0xe7466d[_0x1720('0x32')]=qs[_0x1720('0x33')](_0x956eb5[_0x1720('0x2c')]['sort']);_0xe7466d[_0x1720('0x34')]=qs[_0x1720('0x2d')](_[_0x1720('0x35')](_0x956eb5[_0x1720('0x2c')],_0xa79bdc[_0x1720('0x2d')]),_0x3118f8);if(_0x956eb5[_0x1720('0x2c')]['filter']){_0xe7466d['where']=_[_0x1720('0x36')](_0xe7466d[_0x1720('0x34')],{'$or':_[_0x1720('0x26')](_0x3118f8,function(_0x297be8){if(_0x297be8[_0x1720('0x37')]!==_0x1720('0x38')){var _0x468cf0={};_0x468cf0[_0x297be8[_0x1720('0x24')]]={'$like':'%'+_0x956eb5['query'][_0x1720('0x39')]+'%'};return _0x468cf0;}})});}_0xe7466d=_[_0x1720('0x36')]({},_0xe7466d,_0x956eb5[_0x1720('0x3a')]);var _0x4ef1c9={'where':_0xe7466d[_0x1720('0x34')]};return db[_0x1720('0x27')][_0x1720('0x1d')](_0x4ef1c9)[_0x1720('0x3b')](function(_0x380451){_0x222ca1[_0x1720('0x1d')]=_0x380451;if(_0x956eb5[_0x1720('0x2c')][_0x1720('0x3c')]){_0xe7466d['include']=[{'all':!![]}];}return db['SugarcrmAccount'][_0x1720('0x3d')](_0xe7466d);})[_0x1720('0x3b')](function(_0x36725b){_0x222ca1[_0x1720('0x3e')]=_0x36725b;return _0x222ca1;})[_0x1720('0x3b')](respondWithFilteredResult(_0x73cd77,_0xe7466d))[_0x1720('0x3f')](handleError(_0x73cd77,null));};exports[_0x1720('0x40')]=function(_0x2e08fb,_0xf383d5){var _0x5c2242={'raw':![],'where':{'id':_0x2e08fb[_0x1720('0x41')]['id']}},_0x5e597f={};_0x5e597f[_0x1720('0x2b')]=_[_0x1720('0x42')](db[_0x1720('0x27')][_0x1720('0x28')]);_0x5e597f[_0x1720('0x2c')]=_[_0x1720('0x42')](_0x2e08fb[_0x1720('0x2c')]);_0x5e597f[_0x1720('0x2d')]=_[_0x1720('0x2e')](_0x5e597f[_0x1720('0x2b')],_0x5e597f[_0x1720('0x2c')]);_0x5c2242[_0x1720('0x2f')]=_['intersection'](_0x5e597f['model'],qs[_0x1720('0x30')](_0x2e08fb[_0x1720('0x2c')][_0x1720('0x30')]));_0x5c2242[_0x1720('0x2f')]=_0x5c2242[_0x1720('0x2f')][_0x1720('0x31')]?_0x5c2242[_0x1720('0x2f')]:_0x5e597f[_0x1720('0x2b')];if(_0x2e08fb['query']['includeAll']){_0x5c2242[_0x1720('0x43')]=[{'all':!![]}];}_0x5c2242=_[_0x1720('0x36')]({},_0x5c2242,_0x2e08fb['options']);return db[_0x1720('0x27')][_0x1720('0x44')](_0x5c2242)[_0x1720('0x3b')](handleEntityNotFound(_0xf383d5,null))[_0x1720('0x3b')](respondWithResult(_0xf383d5,null))[_0x1720('0x3f')](handleError(_0xf383d5,null));};exports[_0x1720('0x45')]=function(_0x5b3320,_0x25b322){return db[_0x1720('0x27')][_0x1720('0x45')](_0x5b3320[_0x1720('0x46')],{})[_0x1720('0x3b')](respondWithResult(_0x25b322,0xc9))[_0x1720('0x3f')](handleError(_0x25b322,null));};exports[_0x1720('0x21')]=function(_0x477377,_0x3befb5){if(_0x477377[_0x1720('0x46')]['id']){delete _0x477377[_0x1720('0x46')]['id'];}return db[_0x1720('0x27')][_0x1720('0x44')]({'where':{'id':_0x477377[_0x1720('0x41')]['id']}})[_0x1720('0x3b')](handleEntityNotFound(_0x3befb5,null))[_0x1720('0x3b')](saveUpdates(_0x477377['body'],null))[_0x1720('0x3b')](respondWithResult(_0x3befb5,null))[_0x1720('0x3f')](handleError(_0x3befb5,null));};exports[_0x1720('0x47')]=function(_0x441bf9,_0x345cc4){return db['SugarcrmAccount']['find']({'where':{'id':_0x441bf9[_0x1720('0x41')]['id']}})[_0x1720('0x3b')](handleEntityNotFound(_0x345cc4,null))[_0x1720('0x3b')](removeEntity(_0x345cc4,null))[_0x1720('0x3f')](handleError(_0x345cc4,null));};exports[_0x1720('0x48')]=function(_0x2f1d38,_0xbd065e,_0x481994){var _0x41a2e9={};var _0x4355b6={};var _0x50763f;var _0x85608f;return db[_0x1720('0x27')][_0x1720('0x49')]({'where':{'id':_0x2f1d38[_0x1720('0x41')]['id']}})[_0x1720('0x3b')](handleEntityNotFound(_0xbd065e,null))[_0x1720('0x3b')](function(_0x237193){if(_0x237193){_0x50763f=_0x237193;_0x4355b6[_0x1720('0x2b')]=_[_0x1720('0x42')](db[_0x1720('0x4a')][_0x1720('0x28')]);_0x4355b6['query']=_[_0x1720('0x42')](_0x2f1d38[_0x1720('0x2c')]);_0x4355b6[_0x1720('0x2d')]=_[_0x1720('0x2e')](_0x4355b6[_0x1720('0x2b')],_0x4355b6[_0x1720('0x2c')]);_0x41a2e9[_0x1720('0x2f')]=_[_0x1720('0x2e')](_0x4355b6[_0x1720('0x2b')],qs[_0x1720('0x30')](_0x2f1d38['query']['fields']));_0x41a2e9[_0x1720('0x2f')]=_0x41a2e9['attributes'][_0x1720('0x31')]?_0x41a2e9[_0x1720('0x2f')]:_0x4355b6[_0x1720('0x2b')];_0x41a2e9['order']=qs[_0x1720('0x33')](_0x2f1d38[_0x1720('0x2c')][_0x1720('0x33')]);_0x41a2e9[_0x1720('0x34')]=qs[_0x1720('0x2d')](_[_0x1720('0x35')](_0x2f1d38['query'],_0x4355b6[_0x1720('0x2d')]));if(_0x2f1d38[_0x1720('0x2c')][_0x1720('0x39')]){_0x41a2e9[_0x1720('0x34')]=_[_0x1720('0x36')](_0x41a2e9[_0x1720('0x34')],{'$or':_[_0x1720('0x26')](_0x41a2e9[_0x1720('0x2f')],function(_0x6a3ee5){var _0x1c42a6={};_0x1c42a6[_0x6a3ee5]={'$like':'%'+_0x2f1d38[_0x1720('0x2c')]['filter']+'%'};return _0x1c42a6;})});}_0x41a2e9=_[_0x1720('0x36')]({},_0x41a2e9,_0x2f1d38['options']);return _0x50763f[_0x1720('0x48')](_0x41a2e9);}})['then'](function(_0x3dbd05){if(_0x3dbd05){_0x85608f=_0x3dbd05[_0x1720('0x31')];if(!_0x2f1d38[_0x1720('0x2c')][_0x1720('0x4b')](_0x1720('0x4c'))){_0x41a2e9[_0x1720('0x1b')]=qs['limit'](_0x2f1d38[_0x1720('0x2c')]['limit']);_0x41a2e9['offset']=qs[_0x1720('0x1a')](_0x2f1d38['query'][_0x1720('0x1a')]);}return _0x50763f['getConfigurations'](_0x41a2e9);}})[_0x1720('0x3b')](function(_0x5b47ab){if(_0x5b47ab){return _0x5b47ab?{'count':_0x85608f,'rows':_0x5b47ab}:null;}})[_0x1720('0x3b')](respondWithResult(_0xbd065e,null))[_0x1720('0x3f')](handleError(_0xbd065e,null));};exports[_0x1720('0x4d')]=function(_0x5b709b,_0x35a972,_0x5f3436){if(_0x5b709b['body']['id']){delete _0x5b709b[_0x1720('0x46')]['id'];}return db[_0x1720('0x27')][_0x1720('0x49')]({'where':{'id':_0x5b709b[_0x1720('0x41')]['id']}})[_0x1720('0x3b')](handleEntityNotFound(_0x35a972,null))[_0x1720('0x3b')](function(_0x33aca2){if(_0x33aca2){_0x5b709b[_0x1720('0x46')][_0x1720('0x4e')]=_0x33aca2['id'];_0x5b709b[_0x1720('0x46')]['Subjects']=integrations[_0x1720('0x4f')](_0x5b709b['body'][_0x1720('0x50')],_0x5b709b[_0x1720('0x46')][_0x1720('0x37')]);_0x5b709b[_0x1720('0x46')][_0x1720('0x51')]=integrations[_0x1720('0x52')](_0x5b709b['body']['channel'],_0x5b709b['body'][_0x1720('0x37')]);return db[_0x1720('0x4a')][_0x1720('0x45')](_0x5b709b['body'],{'include':[{'model':db[_0x1720('0x53')],'as':_0x1720('0x54')},{'model':db[_0x1720('0x53')],'as':'Descriptions'}]});}return null;})[_0x1720('0x3b')](respondWithResult(_0x35a972,null))[_0x1720('0x3f')](handleError(_0x35a972,null));};exports[_0x1720('0x55')]=function(_0x37696f,_0x15344b,_0x51019a){var _0x18b392='';var _0x174920=['id',_0x1720('0x24'),'assigned_user_id','created_by',_0x1720('0x56'),_0x1720('0x57'),_0x1720('0x58'),_0x1720('0x59'),_0x1720('0x5a'),_0x1720('0x5b'),_0x1720('0x5c'),'direction'];return db['SugarcrmAccount']['findOne']({'where':{'id':_0x37696f[_0x1720('0x41')]['id']},'attributes':['id','username',_0x1720('0x5d'),_0x1720('0x5e')]})[_0x1720('0x3b')](handleEntityNotFound(_0x15344b,null))['then'](function(_0x5f02bf){if(_0x5f02bf){_0x18b392=_0x5f02bf[_0x1720('0x5e')];var _0x2fc8ab=_0x18b392['slice'](-0x1);if(_0x2fc8ab==='/'){_0x18b392=_0x18b392[_0x1720('0x5f')](0x0,_0x18b392[_0x1720('0x60')](_0x2fc8ab));}return rp({'method':_0x1720('0x61'),'uri':util['format']('%s%s',_0x18b392,_0x1720('0x62')),'json':!![],'form':{'method':_0x1720('0x63'),'input_type':_0x1720('0x64'),'response_type':_0x1720('0x64'),'rest_data':JSON[_0x1720('0x65')]({'user_auth':{'user_name':_0x5f02bf[_0x1720('0x66')],'password':_0x5f02bf[_0x1720('0x5d')],'encryption':_0x1720('0x67')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0x1720('0x3b')](function(_0x45f1b3){if(_0x45f1b3&&_0x45f1b3[_0x1720('0x24')]!==_0x1720('0x68')&&_0x45f1b3[_0x1720('0x24')]!==_0x1720('0x69')){return rp({'method':_0x1720('0x61'),'uri':util[_0x1720('0x6a')](_0x1720('0x6b'),_0x18b392,_0x1720('0x62')),'json':!![],'form':{'method':_0x1720('0x6c'),'input_type':'JSON','response_type':_0x1720('0x64'),'rest_data':JSON[_0x1720('0x65')]({'session':_0x45f1b3['id'],'module_name':'Calls'})}})['then'](function(_0x48a438){if(_0x48a438){var _0x296a25=_['values'](_0x48a438[_0x1720('0x6d')]);_['remove'](_0x296a25,function(_0x558c44){return _0x174920[_0x1720('0x6e')](_0x558c44[_0x1720('0x24')]);});return{'count':_0x296a25['length'],'rows':_[_0x1720('0x26')](_0x296a25,function(_0x346c49){return{'id':_0x346c49[_0x1720('0x24')],'name':_0x346c49[_0x1720('0x6f')],'custom':_[_0x1720('0x70')](_0x346c49[_0x1720('0x24')],'_c')?!![]:![],'options':_0x346c49[_0x1720('0x3a')]?_[_0x1720('0x26')](_['values'](_0x346c49[_0x1720('0x3a')]),function(_0x3c413d){return{'name':_0x3c413d[_0x1720('0x71')],'value':_0x3c413d['name']};}):[]};})};}})[_0x1720('0x3b')](respondWithResult(_0x15344b,null))['catch'](function(_0x40dc34){var _0x41243b=_0x37696f[_0x1720('0x2c')][_0x1720('0x72')]?0x1f4:_0x40dc34[_0x1720('0x73')]||0x1f4;logger['error'](_0x1720('0x74'),_0x1720('0x55'),_0x41243b,JSON[_0x1720('0x65')](_0x40dc34));delete _0x40dc34[_0x1720('0x24')];if(_0x41243b===0x191){_0x41243b=0x190;}_0x15344b['status'](_0x41243b)[_0x1720('0x75')](_0x37696f[_0x1720('0x2c')][_0x1720('0x72')]?{'message':_0x1720('0x76'),'statusCode':_0x40dc34[_0x1720('0x73')]}:_0x40dc34);});}else{var _0x12f1e9=0x1f4;_0x15344b[_0x1720('0x18')](_0x12f1e9)[_0x1720('0x75')]({'message':_0x1720('0x76'),'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 1aa1a1b..eef8719 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 _0x74ae=['SugarcrmAccount','int_sugarcrm_accounts','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','define'];(function(_0x35c718,_0x33a696){var _0x5c3099=function(_0x2810cd){while(--_0x2810cd){_0x35c718['push'](_0x35c718['shift']());}};_0x5c3099(++_0x33a696);}(_0x74ae,0xc5));var _0xe74a=function(_0x12cd6f,_0x25da4f){_0x12cd6f=_0x12cd6f-0x0;var _0x3e251e=_0x74ae[_0x12cd6f];return _0x3e251e;};'use strict';var _=require(_0xe74a('0x0'));var util=require(_0xe74a('0x1'));var logger=require('../../config/logger')(_0xe74a('0x2'));var moment=require(_0xe74a('0x3'));var BPromise=require('bluebird');var rp=require(_0xe74a('0x4'));var fs=require('fs');var path=require(_0xe74a('0x5'));var rimraf=require(_0xe74a('0x6'));var config=require(_0xe74a('0x7'));var attributes=require(_0xe74a('0x8'));var integrations=require(_0xe74a('0x9'));module['exports']=function(_0x1c09fd,_0xb3749f){return _0x1c09fd[_0xe74a('0xa')](_0xe74a('0xb'),attributes,{'tableName':_0xe74a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xca73=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash'];(function(_0x581a57,_0x177eb7){var _0x437f7c=function(_0x784fd8){while(--_0x784fd8){_0x581a57['push'](_0x581a57['shift']());}};_0x437f7c(++_0x177eb7);}(_0xca73,0x1ee));var _0x3ca7=function(_0x39d5a3,_0x2856ef){_0x39d5a3=_0x39d5a3-0x0;var _0x178055=_0xca73[_0x39d5a3];return _0x178055;};'use strict';var _=require(_0x3ca7('0x0'));var util=require(_0x3ca7('0x1'));var logger=require('../../config/logger')(_0x3ca7('0x2'));var moment=require(_0x3ca7('0x3'));var BPromise=require(_0x3ca7('0x4'));var rp=require(_0x3ca7('0x5'));var fs=require('fs');var path=require(_0x3ca7('0x6'));var rimraf=require(_0x3ca7('0x7'));var config=require(_0x3ca7('0x8'));var attributes=require(_0x3ca7('0x9'));var integrations=require(_0x3ca7('0xa'));module[_0x3ca7('0xb')]=function(_0x5dce65,_0x30c7e9){return _0x5dce65[_0x3ca7('0xc')](_0x3ca7('0xd'),attributes,{'tableName':_0x3ca7('0xe'),'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 07700d8..3affc61 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 _0x47c0=['randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','SugarcrmAccount','findAll','options','raw','where','limit','include','map','model','attributes','then','GetSugarcrmAccount','ShowSugarcrmAccount','lodash','util','moment','bluebird'];(function(_0x54bbf0,_0x218cef){var _0x1e54ac=function(_0x31a233){while(--_0x31a233){_0x54bbf0['push'](_0x54bbf0['shift']());}};_0x1e54ac(++_0x218cef);}(_0x47c0,0x167));var _0x047c=function(_0x131489,_0x236a1d){_0x131489=_0x131489-0x0;var _0xcb1f2c=_0x47c0[_0x131489];return _0xcb1f2c;};'use strict';var _=require(_0x047c('0x0'));var util=require(_0x047c('0x1'));var moment=require(_0x047c('0x2'));var BPromise=require(_0x047c('0x3'));var rs=require(_0x047c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x047c('0x5'))['db'];var utils=require(_0x047c('0x6'));var logger=require('../../config/logger')(_0x047c('0x7'));var config=require(_0x047c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x047c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x306f7b,_0x5392e4,_0x24b0b9){return new BPromise(function(_0xee4e53,_0x23c82f){return client['request'](_0x306f7b,_0x24b0b9)['then'](function(_0x599bf3){logger['info'](_0x047c('0xa'),_0x5392e4,_0x047c('0xb'));logger[_0x047c('0xc')](_0x047c('0xd'),_0x5392e4,'request\x20sent',JSON[_0x047c('0xe')](_0x599bf3));if(_0x599bf3['error']){if(_0x599bf3[_0x047c('0xf')][_0x047c('0x10')]===0x1f4){logger[_0x047c('0xf')](_0x047c('0xa'),_0x5392e4,_0x599bf3['error']['message']);return _0x23c82f(_0x599bf3[_0x047c('0xf')]['message']);}logger['error'](_0x047c('0xa'),_0x5392e4,_0x599bf3[_0x047c('0xf')][_0x047c('0x11')]);return _0xee4e53(_0x599bf3[_0x047c('0xf')][_0x047c('0x11')]);}else{logger[_0x047c('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x5392e4,'request\x20sent');_0xee4e53(_0x599bf3['result'][_0x047c('0x11')]);}})[_0x047c('0x13')](function(_0x50ea1f){logger[_0x047c('0xf')](_0x047c('0xa'),_0x5392e4,_0x50ea1f);_0x23c82f(_0x50ea1f);});});}exports['GetSugarcrmAccount']=function(_0x3a363d){var _0x48e1ff=this;return new Promise(function(_0x163979,_0x136030){return db[_0x047c('0x14')][_0x047c('0x15')]({'raw':_0x3a363d['options']?_0x3a363d[_0x047c('0x16')][_0x047c('0x17')]===undefined?!![]:![]:!![],'where':_0x3a363d['options']?_0x3a363d[_0x047c('0x16')][_0x047c('0x18')]||null:null,'attributes':_0x3a363d[_0x047c('0x16')]?_0x3a363d[_0x047c('0x16')]['attributes']||null:null,'limit':_0x3a363d[_0x047c('0x16')]?_0x3a363d[_0x047c('0x16')][_0x047c('0x19')]||null:null,'include':_0x3a363d['options']?_0x3a363d[_0x047c('0x16')][_0x047c('0x1a')]?_[_0x047c('0x1b')](_0x3a363d[_0x047c('0x16')]['include'],function(_0x167628){return{'model':db[_0x167628[_0x047c('0x1c')]],'as':_0x167628['as'],'attributes':_0x167628[_0x047c('0x1d')],'include':_0x167628[_0x047c('0x1a')]?_[_0x047c('0x1b')](_0x167628['include'],function(_0x3846b0){return{'model':db[_0x3846b0[_0x047c('0x1c')]],'as':_0x3846b0['as'],'attributes':_0x3846b0[_0x047c('0x1d')],'include':_0x3846b0[_0x047c('0x1a')]?_[_0x047c('0x1b')](_0x3846b0[_0x047c('0x1a')],function(_0xe5f532){return{'model':db[_0xe5f532[_0x047c('0x1c')]],'as':_0xe5f532['as'],'attributes':_0xe5f532['attributes']};}):[]};}):[]};}):[]:[]})[_0x047c('0x1e')](function(_0x2e267b){logger[_0x047c('0x12')](_0x047c('0x1f'),_0x3a363d);logger['debug'](_0x047c('0x1f'),_0x3a363d,JSON[_0x047c('0xe')](_0x2e267b));_0x163979(_0x2e267b);})[_0x047c('0x13')](function(_0x341f5a){logger['error'](_0x047c('0x1f'),_0x341f5a[_0x047c('0x11')],_0x3a363d);_0x136030(_0x48e1ff['error'](0x1f4,_0x341f5a[_0x047c('0x11')]));});});};exports['ShowSugarcrmAccount']=function(_0x4c0b30){var _0x44bd9f=this;return new Promise(function(_0x8bd95a,_0x11a175){return db[_0x047c('0x14')]['find']({'raw':_0x4c0b30[_0x047c('0x16')]?_0x4c0b30[_0x047c('0x16')][_0x047c('0x17')]===undefined?!![]:![]:!![],'where':_0x4c0b30[_0x047c('0x16')]?_0x4c0b30['options']['where']||null:null,'attributes':_0x4c0b30['options']?_0x4c0b30[_0x047c('0x16')]['attributes']||null:null,'include':_0x4c0b30['options']?_0x4c0b30[_0x047c('0x16')][_0x047c('0x1a')]?_['map'](_0x4c0b30['options']['include'],function(_0x140522){return{'model':db[_0x140522['model']],'as':_0x140522['as'],'attributes':_0x140522[_0x047c('0x1d')],'include':_0x140522['include']?_[_0x047c('0x1b')](_0x140522[_0x047c('0x1a')],function(_0x239951){return{'model':db[_0x239951['model']],'as':_0x239951['as'],'attributes':_0x239951[_0x047c('0x1d')],'include':_0x239951[_0x047c('0x1a')]?_[_0x047c('0x1b')](_0x239951[_0x047c('0x1a')],function(_0x4a3def){return{'model':db[_0x4a3def[_0x047c('0x1c')]],'as':_0x4a3def['as'],'attributes':_0x4a3def['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5f26cc){logger[_0x047c('0x12')](_0x047c('0x20'),_0x4c0b30);logger[_0x047c('0xc')]('ShowSugarcrmAccount',_0x4c0b30,JSON[_0x047c('0xe')](_0x5f26cc));_0x8bd95a(_0x5f26cc);})[_0x047c('0x13')](function(_0x1fecf6){logger[_0x047c('0xf')]('ShowSugarcrmAccount',_0x1fecf6['message'],_0x4c0b30);_0x11a175(_0x44bd9f[_0x047c('0xf')](0x1f4,_0x1fecf6['message']));});});}; \ No newline at end of file +var _0x99cd=['error','code','message','catch','options','raw','where','attributes','map','model','include','GetSugarcrmAccount','debug','ShowSugarcrmAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x405d2f,_0x27c4f5){var _0x32ea92=function(_0x1ca238){while(--_0x1ca238){_0x405d2f['push'](_0x405d2f['shift']());}};_0x32ea92(++_0x27c4f5);}(_0x99cd,0x158));var _0xd99c=function(_0x5770d1,_0x53fab1){_0x5770d1=_0x5770d1-0x0;var _0x593a4c=_0x99cd[_0x5770d1];return _0x593a4c;};'use strict';var _=require(_0xd99c('0x0'));var util=require(_0xd99c('0x1'));var moment=require(_0xd99c('0x2'));var BPromise=require(_0xd99c('0x3'));var rs=require(_0xd99c('0x4'));var fs=require('fs');var Redis=require(_0xd99c('0x5'));var db=require(_0xd99c('0x6'))['db'];var utils=require(_0xd99c('0x7'));var logger=require('../../config/logger')(_0xd99c('0x8'));var config=require(_0xd99c('0x9'));var jayson=require(_0xd99c('0xa'));var client=jayson[_0xd99c('0xb')][_0xd99c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xfa83a3,_0x5c541e,_0x21113e){return new BPromise(function(_0x51bbee,_0x57ff5d){return client['request'](_0xfa83a3,_0x21113e)[_0xd99c('0xd')](function(_0x1319c2){logger[_0xd99c('0xe')](_0xd99c('0xf'),_0x5c541e,_0xd99c('0x10'));logger['debug'](_0xd99c('0x11'),_0x5c541e,_0xd99c('0x10'),JSON[_0xd99c('0x12')](_0x1319c2));if(_0x1319c2[_0xd99c('0x13')]){if(_0x1319c2[_0xd99c('0x13')][_0xd99c('0x14')]===0x1f4){logger[_0xd99c('0x13')](_0xd99c('0xf'),_0x5c541e,_0x1319c2['error'][_0xd99c('0x15')]);return _0x57ff5d(_0x1319c2['error'][_0xd99c('0x15')]);}logger[_0xd99c('0x13')](_0xd99c('0xf'),_0x5c541e,_0x1319c2['error']['message']);return _0x51bbee(_0x1319c2[_0xd99c('0x13')][_0xd99c('0x15')]);}else{logger[_0xd99c('0xe')](_0xd99c('0xf'),_0x5c541e,_0xd99c('0x10'));_0x51bbee(_0x1319c2['result'][_0xd99c('0x15')]);}})[_0xd99c('0x16')](function(_0x1f77d8){logger[_0xd99c('0x13')]('SugarcrmAccount,\x20%s,\x20%s',_0x5c541e,_0x1f77d8);_0x57ff5d(_0x1f77d8);});});}exports['GetSugarcrmAccount']=function(_0x3706a2){var _0x1299dd=this;return new Promise(function(_0x3517f6,_0x49abf1){return db['SugarcrmAccount']['findAll']({'raw':_0x3706a2[_0xd99c('0x17')]?_0x3706a2[_0xd99c('0x17')][_0xd99c('0x18')]===undefined?!![]:![]:!![],'where':_0x3706a2['options']?_0x3706a2[_0xd99c('0x17')][_0xd99c('0x19')]||null:null,'attributes':_0x3706a2[_0xd99c('0x17')]?_0x3706a2[_0xd99c('0x17')][_0xd99c('0x1a')]||null:null,'limit':_0x3706a2[_0xd99c('0x17')]?_0x3706a2[_0xd99c('0x17')]['limit']||null:null,'include':_0x3706a2[_0xd99c('0x17')]?_0x3706a2['options']['include']?_[_0xd99c('0x1b')](_0x3706a2[_0xd99c('0x17')]['include'],function(_0x1f4a16){return{'model':db[_0x1f4a16[_0xd99c('0x1c')]],'as':_0x1f4a16['as'],'attributes':_0x1f4a16[_0xd99c('0x1a')],'include':_0x1f4a16[_0xd99c('0x1d')]?_['map'](_0x1f4a16[_0xd99c('0x1d')],function(_0x469340){return{'model':db[_0x469340['model']],'as':_0x469340['as'],'attributes':_0x469340[_0xd99c('0x1a')],'include':_0x469340['include']?_[_0xd99c('0x1b')](_0x469340[_0xd99c('0x1d')],function(_0x5cbb54){return{'model':db[_0x5cbb54[_0xd99c('0x1c')]],'as':_0x5cbb54['as'],'attributes':_0x5cbb54['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x331713){logger[_0xd99c('0xe')](_0xd99c('0x1e'),_0x3706a2);logger[_0xd99c('0x1f')](_0xd99c('0x1e'),_0x3706a2,JSON[_0xd99c('0x12')](_0x331713));_0x3517f6(_0x331713);})['catch'](function(_0x4d683e){logger[_0xd99c('0x13')](_0xd99c('0x1e'),_0x4d683e[_0xd99c('0x15')],_0x3706a2);_0x49abf1(_0x1299dd['error'](0x1f4,_0x4d683e['message']));});});};exports[_0xd99c('0x20')]=function(_0x5969dc){var _0x538b6b=this;return new Promise(function(_0x580224,_0x5c62f9){return db['SugarcrmAccount']['find']({'raw':_0x5969dc[_0xd99c('0x17')]?_0x5969dc[_0xd99c('0x17')][_0xd99c('0x18')]===undefined?!![]:![]:!![],'where':_0x5969dc[_0xd99c('0x17')]?_0x5969dc[_0xd99c('0x17')]['where']||null:null,'attributes':_0x5969dc['options']?_0x5969dc[_0xd99c('0x17')][_0xd99c('0x1a')]||null:null,'include':_0x5969dc[_0xd99c('0x17')]?_0x5969dc[_0xd99c('0x17')][_0xd99c('0x1d')]?_['map'](_0x5969dc[_0xd99c('0x17')][_0xd99c('0x1d')],function(_0x3cc9b1){return{'model':db[_0x3cc9b1[_0xd99c('0x1c')]],'as':_0x3cc9b1['as'],'attributes':_0x3cc9b1[_0xd99c('0x1a')],'include':_0x3cc9b1[_0xd99c('0x1d')]?_[_0xd99c('0x1b')](_0x3cc9b1[_0xd99c('0x1d')],function(_0x10929b){return{'model':db[_0x10929b[_0xd99c('0x1c')]],'as':_0x10929b['as'],'attributes':_0x10929b[_0xd99c('0x1a')],'include':_0x10929b[_0xd99c('0x1d')]?_['map'](_0x10929b['include'],function(_0x45bf16){return{'model':db[_0x45bf16[_0xd99c('0x1c')]],'as':_0x45bf16['as'],'attributes':_0x45bf16[_0xd99c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd99c('0xd')](function(_0x53bd13){logger[_0xd99c('0xe')]('ShowSugarcrmAccount',_0x5969dc);logger[_0xd99c('0x1f')](_0xd99c('0x20'),_0x5969dc,JSON[_0xd99c('0x12')](_0x53bd13));_0x580224(_0x53bd13);})['catch'](function(_0x1af1a3){logger['error'](_0xd99c('0x20'),_0x1af1a3[_0xd99c('0x15')],_0x5969dc);_0x5c62f9(_0x538b6b[_0xd99c('0x13')](0x1f4,_0x1af1a3[_0xd99c('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index b07a1f8..db77ed1 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 _0x3fee=['/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','put','update','/:id','destroy','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show'];(function(_0x1d6497,_0x1e6bb5){var _0x345f7f=function(_0x23362b){while(--_0x23362b){_0x1d6497['push'](_0x1d6497['shift']());}};_0x345f7f(++_0x1e6bb5);}(_0x3fee,0xdb));var _0xe3fe=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0x3fee[_0x369151];return _0x4292d5;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xe3fe('0x0'));var express=require(_0xe3fe('0x1'));var router=express['Router']();var fs_extra=require(_0xe3fe('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xe3fe('0x3'));var config=require(_0xe3fe('0x4'));var controller=require('./intSugarcrmConfiguration.controller');router[_0xe3fe('0x5')]('/',auth['isAuthenticated'](),controller[_0xe3fe('0x6')]);router[_0xe3fe('0x5')]('/:id',auth[_0xe3fe('0x7')](),controller[_0xe3fe('0x8')]);router[_0xe3fe('0x5')](_0xe3fe('0x9'),auth['isAuthenticated'](),controller[_0xe3fe('0xa')]);router[_0xe3fe('0x5')](_0xe3fe('0xb'),auth[_0xe3fe('0x7')](),controller[_0xe3fe('0xc')]);router[_0xe3fe('0x5')]('/:id/descriptions',auth[_0xe3fe('0x7')](),controller[_0xe3fe('0xd')]);router[_0xe3fe('0xe')]('/',auth[_0xe3fe('0x7')](),controller['create']);router[_0xe3fe('0xf')]('/:id',auth[_0xe3fe('0x7')](),controller[_0xe3fe('0x10')]);router['delete'](_0xe3fe('0x11'),auth[_0xe3fe('0x7')](),controller[_0xe3fe('0x12')]);module['exports']=router; \ No newline at end of file +var _0x08c6=['isAuthenticated','show','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','update','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller','get','/:id'];(function(_0x35c9db,_0x2e8eb2){var _0x251e58=function(_0x5bd762){while(--_0x5bd762){_0x35c9db['push'](_0x35c9db['shift']());}};_0x251e58(++_0x2e8eb2);}(_0x08c6,0xfe));var _0x608c=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0x08c6[_0x44bcb0];return _0xfaf881;};'use strict';var multer=require('multer');var util=require(_0x608c('0x0'));var path=require(_0x608c('0x1'));var timeout=require(_0x608c('0x2'));var express=require(_0x608c('0x3'));var router=express['Router']();var fs_extra=require(_0x608c('0x4'));var auth=require(_0x608c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x608c('0x6'));var controller=require(_0x608c('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x608c('0x8')](_0x608c('0x9'),auth[_0x608c('0xa')](),controller[_0x608c('0xb')]);router[_0x608c('0x8')]('/:id/fields',auth[_0x608c('0xa')](),controller[_0x608c('0xc')]);router['get'](_0x608c('0xd'),auth[_0x608c('0xa')](),controller[_0x608c('0xe')]);router[_0x608c('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x608c('0xf')]);router[_0x608c('0x10')]('/',auth[_0x608c('0xa')](),controller[_0x608c('0x11')]);router[_0x608c('0x12')]('/:id',auth[_0x608c('0xa')](),controller[_0x608c('0x13')]);router['delete']('/:id',auth[_0x608c('0xa')](),controller[_0x608c('0x14')]);module[_0x608c('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index caac652..8254d8b 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 _0xa939=['sequelize','exports','STRING'];(function(_0x435d47,_0x22af8d){var _0x562bad=function(_0x8bc0a7){while(--_0x8bc0a7){_0x435d47['push'](_0x435d47['shift']());}};_0x562bad(++_0x22af8d);}(_0xa939,0xa2));var _0x9a93=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0xa939[_0x2f1762];return _0x8ab21;};'use strict';var Sequelize=require(_0x9a93('0x0'));module[_0x9a93('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9a93('0x2')]}}; \ No newline at end of file +var _0xa05e=['exports','STRING','sequelize'];(function(_0x137c56,_0x4afa2d){var _0x352a52=function(_0x47436f){while(--_0x47436f){_0x137c56['push'](_0x137c56['shift']());}};_0x352a52(++_0x4afa2d);}(_0xa05e,0x137));var _0xea05=function(_0x582e6b,_0x5bfc41){_0x582e6b=_0x582e6b-0x0;var _0x15c48f=_0xa05e[_0x582e6b];return _0x15c48f;};'use strict';var Sequelize=require(_0xea05('0x0'));module[_0xea05('0x1')]={'name':{'type':Sequelize[_0xea05('0x2')]},'description':{'type':Sequelize[_0xea05('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 9086694..596a328 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 _0x67ae=['lodash','squel','crypto','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','end','name','status','index','SugarcrmConfiguration','rawAttributes','fieldName','type','model','map','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','filter','where','merge','includeAll','findAll','rows','catch','show','params','include','options','create','body','find','getFields','SugarcrmField','hasOwnProperty','findOne','pick','getSubjects','getDescriptions','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra'];(function(_0x385eb1,_0x497a94){var _0x5d40eb=function(_0x159029){while(--_0x159029){_0x385eb1['push'](_0x385eb1['shift']());}};_0x5d40eb(++_0x497a94);}(_0x67ae,0x1b3));var _0xe67a=function(_0x338615,_0x573026){_0x338615=_0x338615-0x0;var _0x1bfdb8=_0x67ae[_0x338615];return _0x1bfdb8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe67a('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe67a('0x1'));var moment=require(_0xe67a('0x2'));var BPromise=require(_0xe67a('0x3'));var Mustache=require('mustache');var util=require(_0xe67a('0x4'));var path=require('path');var sox=require(_0xe67a('0x5'));var csv=require(_0xe67a('0x6'));var ejs=require(_0xe67a('0x7'));var fs=require('fs');var fs_extra=require(_0xe67a('0x8'));var _=require(_0xe67a('0x9'));var squel=require(_0xe67a('0xa'));var crypto=require(_0xe67a('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe67a('0x6'));var querystring=require(_0xe67a('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe67a('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe67a('0xe'));var logger=require(_0xe67a('0xf'))(_0xe67a('0x10'));var utils=require(_0xe67a('0x11'));var config=require(_0xe67a('0x12'));var licenseUtil=require(_0xe67a('0x13'));var db=require(_0xe67a('0x14'))['db'];function respondWithStatusCode(_0x258e0c,_0x5f13be){_0x5f13be=_0x5f13be||0xcc;return function(_0xd1bc7){if(_0xd1bc7){return _0x258e0c[_0xe67a('0x15')](_0x5f13be);}return _0x258e0c['status'](_0x5f13be)['end']();};}function respondWithResult(_0x2b1cfc,_0x24c3bf){_0x24c3bf=_0x24c3bf||0xc8;return function(_0x10e1dd){if(_0x10e1dd){return _0x2b1cfc['status'](_0x24c3bf)[_0xe67a('0x16')](_0x10e1dd);}};}function respondWithFilteredResult(_0x3758ac,_0x31067c){return function(_0x33020f){if(_0x33020f){var _0x42dae7=typeof _0x31067c[_0xe67a('0x17')]===_0xe67a('0x18')&&typeof _0x31067c[_0xe67a('0x19')]===_0xe67a('0x18');var _0xe6d76b=_0x33020f[_0xe67a('0x1a')];var _0x2055e9=_0x42dae7?0x0:_0x31067c[_0xe67a('0x17')];var _0x129e94=_0x42dae7?_0x33020f[_0xe67a('0x1a')]:_0x31067c['offset']+_0x31067c[_0xe67a('0x19')];var _0x15b1b0;if(_0x129e94>=_0xe6d76b){_0x129e94=_0xe6d76b;_0x15b1b0=0xc8;}else{_0x15b1b0=0xce;}_0x3758ac['status'](_0x15b1b0);return _0x3758ac['set'](_0xe67a('0x1b'),_0x2055e9+'-'+_0x129e94+'/'+_0xe6d76b)[_0xe67a('0x16')](_0x33020f);}return null;};}function patchUpdates(_0x2d6a4a){return function(_0x533ea9){try{jsonpatch[_0xe67a('0x1c')](_0x533ea9,_0x2d6a4a,!![]);}catch(_0x29ab3a){return BPromise['reject'](_0x29ab3a);}return _0x533ea9[_0xe67a('0x1d')]();};}function saveUpdates(_0x4b02c8,_0x198128){return function(_0x473957){if(_0x473957){return _0x473957[_0xe67a('0x1e')](_0x4b02c8)[_0xe67a('0x1f')](function(_0x224f19){return _0x224f19;});}return null;};}function removeEntity(_0x40ecb9,_0x594310){return function(_0x13d2f1){if(_0x13d2f1){return _0x13d2f1[_0xe67a('0x20')]()[_0xe67a('0x1f')](function(){_0x40ecb9['status'](0xcc)[_0xe67a('0x21')]();});}};}function handleEntityNotFound(_0x3d81bc,_0x2cab81){return function(_0x582466){if(!_0x582466){_0x3d81bc[_0xe67a('0x15')](0x194);}return _0x582466;};}function handleError(_0x4c02bd,_0x5d6b47){_0x5d6b47=_0x5d6b47||0x1f4;return function(_0x15fc12){logger['error'](_0x15fc12['stack']);if(_0x15fc12[_0xe67a('0x22')]){delete _0x15fc12[_0xe67a('0x22')];}_0x4c02bd[_0xe67a('0x23')](_0x5d6b47)['send'](_0x15fc12);};}exports[_0xe67a('0x24')]=function(_0x205f70,_0x2fc30b){var _0x141c30={},_0x3478f3={},_0x23467f={'count':0x0,'rows':[]};var _0x3d15bf=_['map'](db[_0xe67a('0x25')][_0xe67a('0x26')],function(_0x1c2584){return{'name':_0x1c2584[_0xe67a('0x27')],'type':_0x1c2584[_0xe67a('0x28')]['key']};});_0x3478f3[_0xe67a('0x29')]=_[_0xe67a('0x2a')](_0x3d15bf,'name');_0x3478f3['query']=_[_0xe67a('0x2b')](_0x205f70[_0xe67a('0x2c')]);_0x3478f3[_0xe67a('0x2d')]=_['intersection'](_0x3478f3['model'],_0x3478f3[_0xe67a('0x2c')]);_0x141c30[_0xe67a('0x2e')]=_[_0xe67a('0x2f')](_0x3478f3['model'],qs[_0xe67a('0x30')](_0x205f70['query'][_0xe67a('0x30')]));_0x141c30[_0xe67a('0x2e')]=_0x141c30[_0xe67a('0x2e')][_0xe67a('0x31')]?_0x141c30[_0xe67a('0x2e')]:_0x3478f3[_0xe67a('0x29')];if(!_0x205f70[_0xe67a('0x2c')]['hasOwnProperty'](_0xe67a('0x32'))){_0x141c30[_0xe67a('0x19')]=qs['limit'](_0x205f70[_0xe67a('0x2c')]['limit']);_0x141c30['offset']=qs[_0xe67a('0x17')](_0x205f70[_0xe67a('0x2c')][_0xe67a('0x17')]);}_0x141c30[_0xe67a('0x33')]=qs[_0xe67a('0x34')](_0x205f70[_0xe67a('0x2c')][_0xe67a('0x34')]);_0x141c30['where']=qs[_0xe67a('0x2d')](_['pick'](_0x205f70[_0xe67a('0x2c')],_0x3478f3[_0xe67a('0x2d')]),_0x3d15bf);if(_0x205f70[_0xe67a('0x2c')][_0xe67a('0x35')]){_0x141c30[_0xe67a('0x36')]=_[_0xe67a('0x37')](_0x141c30['where'],{'$or':_[_0xe67a('0x2a')](_0x3d15bf,function(_0x26d5c8){if(_0x26d5c8[_0xe67a('0x28')]!=='VIRTUAL'){var _0x4116e9={};_0x4116e9[_0x26d5c8[_0xe67a('0x22')]]={'$like':'%'+_0x205f70[_0xe67a('0x2c')][_0xe67a('0x35')]+'%'};return _0x4116e9;}})});}_0x141c30=_['merge']({},_0x141c30,_0x205f70['options']);var _0x35e7fb={'where':_0x141c30[_0xe67a('0x36')]};return db[_0xe67a('0x25')][_0xe67a('0x1a')](_0x35e7fb)[_0xe67a('0x1f')](function(_0x2c1427){_0x23467f[_0xe67a('0x1a')]=_0x2c1427;if(_0x205f70['query'][_0xe67a('0x38')]){_0x141c30['include']=[{'all':!![]}];}return db[_0xe67a('0x25')][_0xe67a('0x39')](_0x141c30);})['then'](function(_0x57a007){_0x23467f[_0xe67a('0x3a')]=_0x57a007;return _0x23467f;})[_0xe67a('0x1f')](respondWithFilteredResult(_0x2fc30b,_0x141c30))[_0xe67a('0x3b')](handleError(_0x2fc30b,null));};exports[_0xe67a('0x3c')]=function(_0x2e7b7e,_0x1465ca){var _0x55292f={'raw':![],'where':{'id':_0x2e7b7e[_0xe67a('0x3d')]['id']}},_0x5804bb={};_0x5804bb[_0xe67a('0x29')]=_[_0xe67a('0x2b')](db[_0xe67a('0x25')][_0xe67a('0x26')]);_0x5804bb[_0xe67a('0x2c')]=_[_0xe67a('0x2b')](_0x2e7b7e[_0xe67a('0x2c')]);_0x5804bb[_0xe67a('0x2d')]=_[_0xe67a('0x2f')](_0x5804bb[_0xe67a('0x29')],_0x5804bb[_0xe67a('0x2c')]);_0x55292f[_0xe67a('0x2e')]=_[_0xe67a('0x2f')](_0x5804bb[_0xe67a('0x29')],qs[_0xe67a('0x30')](_0x2e7b7e[_0xe67a('0x2c')][_0xe67a('0x30')]));_0x55292f[_0xe67a('0x2e')]=_0x55292f['attributes']['length']?_0x55292f['attributes']:_0x5804bb[_0xe67a('0x29')];if(_0x2e7b7e[_0xe67a('0x2c')]['includeAll']){_0x55292f[_0xe67a('0x3e')]=[{'all':!![]}];}_0x55292f=_[_0xe67a('0x37')]({},_0x55292f,_0x2e7b7e[_0xe67a('0x3f')]);return db['SugarcrmConfiguration']['find'](_0x55292f)['then'](handleEntityNotFound(_0x1465ca,null))[_0xe67a('0x1f')](respondWithResult(_0x1465ca,null))[_0xe67a('0x3b')](handleError(_0x1465ca,null));};exports[_0xe67a('0x40')]=function(_0x26569a,_0x38000f){return db[_0xe67a('0x25')][_0xe67a('0x40')](_0x26569a['body'],{})[_0xe67a('0x1f')](respondWithResult(_0x38000f,0xc9))[_0xe67a('0x3b')](handleError(_0x38000f,null));};exports[_0xe67a('0x1e')]=function(_0x501960,_0x23592d){if(_0x501960['body']['id']){delete _0x501960[_0xe67a('0x41')]['id'];}return db['SugarcrmConfiguration'][_0xe67a('0x42')]({'where':{'id':_0x501960['params']['id']}})['then'](handleEntityNotFound(_0x23592d,null))[_0xe67a('0x1f')](saveUpdates(_0x501960[_0xe67a('0x41')],null))[_0xe67a('0x1f')](respondWithResult(_0x23592d,null))[_0xe67a('0x3b')](handleError(_0x23592d,null));};exports['destroy']=function(_0x4193af,_0x3bd879){return db['SugarcrmConfiguration'][_0xe67a('0x42')]({'where':{'id':_0x4193af[_0xe67a('0x3d')]['id']}})[_0xe67a('0x1f')](handleEntityNotFound(_0x3bd879,null))[_0xe67a('0x1f')](removeEntity(_0x3bd879,null))[_0xe67a('0x3b')](handleError(_0x3bd879,null));};exports[_0xe67a('0x43')]=function(_0x35bf0f,_0x43125d,_0x2d6224){var _0x425b3e={};var _0x59425c={};var _0x427751;var _0xe8d9e8;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x35bf0f[_0xe67a('0x3d')]['id']}})['then'](handleEntityNotFound(_0x43125d,null))['then'](function(_0x818e8c){if(_0x818e8c){_0x427751=_0x818e8c;_0x59425c[_0xe67a('0x29')]=_[_0xe67a('0x2b')](db[_0xe67a('0x44')][_0xe67a('0x26')]);_0x59425c[_0xe67a('0x2c')]=_[_0xe67a('0x2b')](_0x35bf0f['query']);_0x59425c[_0xe67a('0x2d')]=_[_0xe67a('0x2f')](_0x59425c[_0xe67a('0x29')],_0x59425c[_0xe67a('0x2c')]);_0x425b3e[_0xe67a('0x2e')]=_[_0xe67a('0x2f')](_0x59425c[_0xe67a('0x29')],qs[_0xe67a('0x30')](_0x35bf0f[_0xe67a('0x2c')][_0xe67a('0x30')]));_0x425b3e[_0xe67a('0x2e')]=_0x425b3e[_0xe67a('0x2e')][_0xe67a('0x31')]?_0x425b3e[_0xe67a('0x2e')]:_0x59425c[_0xe67a('0x29')];_0x425b3e[_0xe67a('0x33')]=qs['sort'](_0x35bf0f['query'][_0xe67a('0x34')]);_0x425b3e[_0xe67a('0x36')]=qs[_0xe67a('0x2d')](_['pick'](_0x35bf0f[_0xe67a('0x2c')],_0x59425c[_0xe67a('0x2d')]));if(_0x35bf0f[_0xe67a('0x2c')]['filter']){_0x425b3e[_0xe67a('0x36')]=_[_0xe67a('0x37')](_0x425b3e[_0xe67a('0x36')],{'$or':_['map'](_0x425b3e[_0xe67a('0x2e')],function(_0x47cf5e){var _0x179d38={};_0x179d38[_0x47cf5e]={'$like':'%'+_0x35bf0f[_0xe67a('0x2c')][_0xe67a('0x35')]+'%'};return _0x179d38;})});}_0x425b3e=_[_0xe67a('0x37')]({},_0x425b3e,_0x35bf0f['options']);return _0x427751[_0xe67a('0x43')](_0x425b3e);}})[_0xe67a('0x1f')](function(_0x1d69e1){if(_0x1d69e1){_0xe8d9e8=_0x1d69e1[_0xe67a('0x31')];if(!_0x35bf0f[_0xe67a('0x2c')][_0xe67a('0x45')](_0xe67a('0x32'))){_0x425b3e[_0xe67a('0x19')]=qs[_0xe67a('0x19')](_0x35bf0f[_0xe67a('0x2c')][_0xe67a('0x19')]);_0x425b3e[_0xe67a('0x17')]=qs[_0xe67a('0x17')](_0x35bf0f[_0xe67a('0x2c')][_0xe67a('0x17')]);}return _0x427751[_0xe67a('0x43')](_0x425b3e);}})['then'](function(_0x2c0af0){if(_0x2c0af0){return _0x2c0af0?{'count':_0xe8d9e8,'rows':_0x2c0af0}:null;}})['then'](respondWithResult(_0x43125d,null))['catch'](handleError(_0x43125d,null));};exports['getSubjects']=function(_0x30eeb6,_0x2bdfd4,_0x3cc0af){var _0x122b19={};var _0x1930ff={};var _0x5e070b;var _0x5658af;return db[_0xe67a('0x25')][_0xe67a('0x46')]({'where':{'id':_0x30eeb6[_0xe67a('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2bdfd4,null))[_0xe67a('0x1f')](function(_0x6bdc9e){if(_0x6bdc9e){_0x5e070b=_0x6bdc9e;_0x1930ff['model']=_[_0xe67a('0x2b')](db[_0xe67a('0x44')]['rawAttributes']);_0x1930ff['query']=_[_0xe67a('0x2b')](_0x30eeb6[_0xe67a('0x2c')]);_0x1930ff[_0xe67a('0x2d')]=_['intersection'](_0x1930ff[_0xe67a('0x29')],_0x1930ff[_0xe67a('0x2c')]);_0x122b19[_0xe67a('0x2e')]=_['intersection'](_0x1930ff[_0xe67a('0x29')],qs['fields'](_0x30eeb6[_0xe67a('0x2c')][_0xe67a('0x30')]));_0x122b19[_0xe67a('0x2e')]=_0x122b19[_0xe67a('0x2e')][_0xe67a('0x31')]?_0x122b19[_0xe67a('0x2e')]:_0x1930ff[_0xe67a('0x29')];_0x122b19['order']=qs[_0xe67a('0x34')](_0x30eeb6[_0xe67a('0x2c')]['sort']);_0x122b19[_0xe67a('0x36')]=qs['filters'](_[_0xe67a('0x47')](_0x30eeb6[_0xe67a('0x2c')],_0x1930ff[_0xe67a('0x2d')]));if(_0x30eeb6['query'][_0xe67a('0x35')]){_0x122b19[_0xe67a('0x36')]=_[_0xe67a('0x37')](_0x122b19[_0xe67a('0x36')],{'$or':_['map'](_0x122b19[_0xe67a('0x2e')],function(_0x15b381){var _0x58180e={};_0x58180e[_0x15b381]={'$like':'%'+_0x30eeb6[_0xe67a('0x2c')][_0xe67a('0x35')]+'%'};return _0x58180e;})});}_0x122b19=_['merge']({},_0x122b19,_0x30eeb6['options']);return _0x5e070b[_0xe67a('0x48')](_0x122b19);}})[_0xe67a('0x1f')](function(_0x5cd473){if(_0x5cd473){_0x5658af=_0x5cd473['length'];if(!_0x30eeb6[_0xe67a('0x2c')][_0xe67a('0x45')](_0xe67a('0x32'))){_0x122b19['limit']=qs[_0xe67a('0x19')](_0x30eeb6[_0xe67a('0x2c')][_0xe67a('0x19')]);_0x122b19[_0xe67a('0x17')]=qs['offset'](_0x30eeb6['query'][_0xe67a('0x17')]);}return _0x5e070b[_0xe67a('0x48')](_0x122b19);}})[_0xe67a('0x1f')](function(_0x60785d){if(_0x60785d){return _0x60785d?{'count':_0x5658af,'rows':_0x60785d}:null;}})[_0xe67a('0x1f')](respondWithResult(_0x2bdfd4,null))[_0xe67a('0x3b')](handleError(_0x2bdfd4,null));};exports[_0xe67a('0x49')]=function(_0x435bc4,_0x100e3f,_0x10c8cd){var _0x3a40c7={};var _0x486c0a={};var _0x3595af;var _0x524c8c;return db[_0xe67a('0x25')][_0xe67a('0x46')]({'where':{'id':_0x435bc4[_0xe67a('0x3d')]['id']}})[_0xe67a('0x1f')](handleEntityNotFound(_0x100e3f,null))['then'](function(_0x126e00){if(_0x126e00){_0x3595af=_0x126e00;_0x486c0a['model']=_[_0xe67a('0x2b')](db[_0xe67a('0x44')][_0xe67a('0x26')]);_0x486c0a[_0xe67a('0x2c')]=_[_0xe67a('0x2b')](_0x435bc4[_0xe67a('0x2c')]);_0x486c0a['filters']=_['intersection'](_0x486c0a[_0xe67a('0x29')],_0x486c0a[_0xe67a('0x2c')]);_0x3a40c7[_0xe67a('0x2e')]=_[_0xe67a('0x2f')](_0x486c0a[_0xe67a('0x29')],qs[_0xe67a('0x30')](_0x435bc4[_0xe67a('0x2c')][_0xe67a('0x30')]));_0x3a40c7[_0xe67a('0x2e')]=_0x3a40c7[_0xe67a('0x2e')]['length']?_0x3a40c7[_0xe67a('0x2e')]:_0x486c0a[_0xe67a('0x29')];_0x3a40c7['order']=qs[_0xe67a('0x34')](_0x435bc4[_0xe67a('0x2c')][_0xe67a('0x34')]);_0x3a40c7[_0xe67a('0x36')]=qs[_0xe67a('0x2d')](_[_0xe67a('0x47')](_0x435bc4[_0xe67a('0x2c')],_0x486c0a[_0xe67a('0x2d')]));if(_0x435bc4[_0xe67a('0x2c')][_0xe67a('0x35')]){_0x3a40c7[_0xe67a('0x36')]=_[_0xe67a('0x37')](_0x3a40c7[_0xe67a('0x36')],{'$or':_[_0xe67a('0x2a')](_0x3a40c7[_0xe67a('0x2e')],function(_0x424105){var _0x565283={};_0x565283[_0x424105]={'$like':'%'+_0x435bc4[_0xe67a('0x2c')][_0xe67a('0x35')]+'%'};return _0x565283;})});}_0x3a40c7=_['merge']({},_0x3a40c7,_0x435bc4[_0xe67a('0x3f')]);return _0x3595af[_0xe67a('0x49')](_0x3a40c7);}})[_0xe67a('0x1f')](function(_0x266e5b){if(_0x266e5b){_0x524c8c=_0x266e5b[_0xe67a('0x31')];if(!_0x435bc4[_0xe67a('0x2c')][_0xe67a('0x45')](_0xe67a('0x32'))){_0x3a40c7[_0xe67a('0x19')]=qs['limit'](_0x435bc4[_0xe67a('0x2c')][_0xe67a('0x19')]);_0x3a40c7['offset']=qs[_0xe67a('0x17')](_0x435bc4[_0xe67a('0x2c')][_0xe67a('0x17')]);}return _0x3595af[_0xe67a('0x49')](_0x3a40c7);}})['then'](function(_0x520802){if(_0x520802){return _0x520802?{'count':_0x524c8c,'rows':_0x520802}:null;}})['then'](respondWithResult(_0x100e3f,null))['catch'](handleError(_0x100e3f,null));}; \ No newline at end of file +var _0xec3b=['intersection','fields','length','include','find','create','body','catch','getFields','findOne','SugarcrmField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','reject','update','then','destroy','error','name','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','query','keys','filters','model','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','show','params'];(function(_0x1e0c24,_0x2da089){var _0x5ea0ab=function(_0x274a1d){while(--_0x274a1d){_0x1e0c24['push'](_0x1e0c24['shift']());}};_0x5ea0ab(++_0x2da089);}(_0xec3b,0xb1));var _0xbec3=function(_0x418433,_0x42c4fb){_0x418433=_0x418433-0x0;var _0x33286a=_0xec3b[_0x418433];return _0x33286a;};'use strict';var emlformat=require(_0xbec3('0x0'));var rimraf=require(_0xbec3('0x1'));var zipdir=require(_0xbec3('0x2'));var jsonpatch=require(_0xbec3('0x3'));var rp=require(_0xbec3('0x4'));var moment=require(_0xbec3('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xbec3('0x6'));var util=require(_0xbec3('0x7'));var path=require('path');var sox=require(_0xbec3('0x8'));var csv=require(_0xbec3('0x9'));var ejs=require(_0xbec3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbec3('0xb'));var squel=require(_0xbec3('0xc'));var crypto=require(_0xbec3('0xd'));var jsforce=require(_0xbec3('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbec3('0xf'));var Papa=require(_0xbec3('0x10'));var Redis=require(_0xbec3('0x11'));var authService=require(_0xbec3('0x12'));var qs=require(_0xbec3('0x13'));var as=require(_0xbec3('0x14'));var hardwareService=require(_0xbec3('0x15'));var logger=require(_0xbec3('0x16'))(_0xbec3('0x17'));var utils=require(_0xbec3('0x18'));var config=require(_0xbec3('0x19'));var licenseUtil=require(_0xbec3('0x1a'));var db=require(_0xbec3('0x1b'))['db'];function respondWithStatusCode(_0x244f57,_0x410074){_0x410074=_0x410074||0xcc;return function(_0x5688f2){if(_0x5688f2){return _0x244f57[_0xbec3('0x1c')](_0x410074);}return _0x244f57['status'](_0x410074)[_0xbec3('0x1d')]();};}function respondWithResult(_0x12d95c,_0x5aca27){_0x5aca27=_0x5aca27||0xc8;return function(_0x57e20b){if(_0x57e20b){return _0x12d95c[_0xbec3('0x1e')](_0x5aca27)['json'](_0x57e20b);}};}function respondWithFilteredResult(_0x23a812,_0x28b666){return function(_0x4f5a87){if(_0x4f5a87){var _0x557841=typeof _0x28b666['offset']===_0xbec3('0x1f')&&typeof _0x28b666[_0xbec3('0x20')]==='undefined';var _0xf9b540=_0x4f5a87[_0xbec3('0x21')];var _0x40c0fc=_0x557841?0x0:_0x28b666[_0xbec3('0x22')];var _0x4d33a4=_0x557841?_0x4f5a87[_0xbec3('0x21')]:_0x28b666['offset']+_0x28b666[_0xbec3('0x20')];var _0x1c6e43;if(_0x4d33a4>=_0xf9b540){_0x4d33a4=_0xf9b540;_0x1c6e43=0xc8;}else{_0x1c6e43=0xce;}_0x23a812['status'](_0x1c6e43);return _0x23a812[_0xbec3('0x23')](_0xbec3('0x24'),_0x40c0fc+'-'+_0x4d33a4+'/'+_0xf9b540)[_0xbec3('0x25')](_0x4f5a87);}return null;};}function patchUpdates(_0x1db7a2){return function(_0x542c74){try{jsonpatch['apply'](_0x542c74,_0x1db7a2,!![]);}catch(_0x72f2f8){return BPromise[_0xbec3('0x26')](_0x72f2f8);}return _0x542c74['save']();};}function saveUpdates(_0x1a91b9,_0x57fd62){return function(_0x40f601){if(_0x40f601){return _0x40f601[_0xbec3('0x27')](_0x1a91b9)[_0xbec3('0x28')](function(_0x567d4a){return _0x567d4a;});}return null;};}function removeEntity(_0x7c7208,_0x36b4a3){return function(_0x440b57){if(_0x440b57){return _0x440b57[_0xbec3('0x29')]()[_0xbec3('0x28')](function(){_0x7c7208[_0xbec3('0x1e')](0xcc)[_0xbec3('0x1d')]();});}};}function handleEntityNotFound(_0x40167b,_0x42d767){return function(_0x5992fe){if(!_0x5992fe){_0x40167b['sendStatus'](0x194);}return _0x5992fe;};}function handleError(_0x2dffc8,_0x13cbb3){_0x13cbb3=_0x13cbb3||0x1f4;return function(_0x7bc25d){logger[_0xbec3('0x2a')](_0x7bc25d['stack']);if(_0x7bc25d[_0xbec3('0x2b')]){delete _0x7bc25d[_0xbec3('0x2b')];}_0x2dffc8[_0xbec3('0x1e')](_0x13cbb3)[_0xbec3('0x2c')](_0x7bc25d);};}exports[_0xbec3('0x2d')]=function(_0x30e7cf,_0xa9da33){var _0x35797e={},_0x14e7d3={},_0x1a0d18={'count':0x0,'rows':[]};var _0x2aa050=_[_0xbec3('0x2e')](db[_0xbec3('0x2f')][_0xbec3('0x30')],function(_0x5dc180){return{'name':_0x5dc180[_0xbec3('0x31')],'type':_0x5dc180[_0xbec3('0x32')]['key']};});_0x14e7d3['model']=_[_0xbec3('0x2e')](_0x2aa050,_0xbec3('0x2b'));_0x14e7d3[_0xbec3('0x33')]=_[_0xbec3('0x34')](_0x30e7cf[_0xbec3('0x33')]);_0x14e7d3[_0xbec3('0x35')]=_['intersection'](_0x14e7d3[_0xbec3('0x36')],_0x14e7d3[_0xbec3('0x33')]);_0x35797e[_0xbec3('0x37')]=_['intersection'](_0x14e7d3[_0xbec3('0x36')],qs['fields'](_0x30e7cf[_0xbec3('0x33')]['fields']));_0x35797e['attributes']=_0x35797e['attributes']['length']?_0x35797e[_0xbec3('0x37')]:_0x14e7d3['model'];if(!_0x30e7cf['query'][_0xbec3('0x38')](_0xbec3('0x39'))){_0x35797e[_0xbec3('0x20')]=qs[_0xbec3('0x20')](_0x30e7cf[_0xbec3('0x33')][_0xbec3('0x20')]);_0x35797e[_0xbec3('0x22')]=qs['offset'](_0x30e7cf[_0xbec3('0x33')]['offset']);}_0x35797e[_0xbec3('0x3a')]=qs[_0xbec3('0x3b')](_0x30e7cf[_0xbec3('0x33')][_0xbec3('0x3b')]);_0x35797e[_0xbec3('0x3c')]=qs[_0xbec3('0x35')](_[_0xbec3('0x3d')](_0x30e7cf[_0xbec3('0x33')],_0x14e7d3['filters']),_0x2aa050);if(_0x30e7cf['query'][_0xbec3('0x3e')]){_0x35797e[_0xbec3('0x3c')]=_[_0xbec3('0x3f')](_0x35797e[_0xbec3('0x3c')],{'$or':_['map'](_0x2aa050,function(_0x3a72ff){if(_0x3a72ff[_0xbec3('0x32')]!=='VIRTUAL'){var _0x31648b={};_0x31648b[_0x3a72ff[_0xbec3('0x2b')]]={'$like':'%'+_0x30e7cf[_0xbec3('0x33')][_0xbec3('0x3e')]+'%'};return _0x31648b;}})});}_0x35797e=_[_0xbec3('0x3f')]({},_0x35797e,_0x30e7cf[_0xbec3('0x40')]);var _0x51355e={'where':_0x35797e[_0xbec3('0x3c')]};return db[_0xbec3('0x2f')]['count'](_0x51355e)[_0xbec3('0x28')](function(_0x31377d){_0x1a0d18[_0xbec3('0x21')]=_0x31377d;if(_0x30e7cf[_0xbec3('0x33')][_0xbec3('0x41')]){_0x35797e['include']=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0xbec3('0x42')](_0x35797e);})[_0xbec3('0x28')](function(_0xd7017f){_0x1a0d18['rows']=_0xd7017f;return _0x1a0d18;})[_0xbec3('0x28')](respondWithFilteredResult(_0xa9da33,_0x35797e))['catch'](handleError(_0xa9da33,null));};exports[_0xbec3('0x43')]=function(_0x1f148e,_0xc8dcf5){var _0x320dc2={'raw':![],'where':{'id':_0x1f148e[_0xbec3('0x44')]['id']}},_0x3f5935={};_0x3f5935['model']=_[_0xbec3('0x34')](db[_0xbec3('0x2f')][_0xbec3('0x30')]);_0x3f5935[_0xbec3('0x33')]=_['keys'](_0x1f148e[_0xbec3('0x33')]);_0x3f5935['filters']=_[_0xbec3('0x45')](_0x3f5935[_0xbec3('0x36')],_0x3f5935[_0xbec3('0x33')]);_0x320dc2[_0xbec3('0x37')]=_[_0xbec3('0x45')](_0x3f5935[_0xbec3('0x36')],qs['fields'](_0x1f148e[_0xbec3('0x33')][_0xbec3('0x46')]));_0x320dc2[_0xbec3('0x37')]=_0x320dc2[_0xbec3('0x37')][_0xbec3('0x47')]?_0x320dc2[_0xbec3('0x37')]:_0x3f5935[_0xbec3('0x36')];if(_0x1f148e['query']['includeAll']){_0x320dc2[_0xbec3('0x48')]=[{'all':!![]}];}_0x320dc2=_['merge']({},_0x320dc2,_0x1f148e[_0xbec3('0x40')]);return db['SugarcrmConfiguration'][_0xbec3('0x49')](_0x320dc2)[_0xbec3('0x28')](handleEntityNotFound(_0xc8dcf5,null))['then'](respondWithResult(_0xc8dcf5,null))['catch'](handleError(_0xc8dcf5,null));};exports[_0xbec3('0x4a')]=function(_0x37550f,_0x2b5ebe){return db['SugarcrmConfiguration'][_0xbec3('0x4a')](_0x37550f[_0xbec3('0x4b')],{})[_0xbec3('0x28')](respondWithResult(_0x2b5ebe,0xc9))[_0xbec3('0x4c')](handleError(_0x2b5ebe,null));};exports['update']=function(_0xbdfb96,_0x4e9e7c){if(_0xbdfb96['body']['id']){delete _0xbdfb96[_0xbec3('0x4b')]['id'];}return db['SugarcrmConfiguration'][_0xbec3('0x49')]({'where':{'id':_0xbdfb96['params']['id']}})[_0xbec3('0x28')](handleEntityNotFound(_0x4e9e7c,null))[_0xbec3('0x28')](saveUpdates(_0xbdfb96[_0xbec3('0x4b')],null))['then'](respondWithResult(_0x4e9e7c,null))[_0xbec3('0x4c')](handleError(_0x4e9e7c,null));};exports[_0xbec3('0x29')]=function(_0x4fdfb0,_0x3bd6b5){return db[_0xbec3('0x2f')][_0xbec3('0x49')]({'where':{'id':_0x4fdfb0[_0xbec3('0x44')]['id']}})[_0xbec3('0x28')](handleEntityNotFound(_0x3bd6b5,null))[_0xbec3('0x28')](removeEntity(_0x3bd6b5,null))[_0xbec3('0x4c')](handleError(_0x3bd6b5,null));};exports[_0xbec3('0x4d')]=function(_0x6894e,_0x2c76b8,_0x55b1e5){var _0x5368d5={};var _0x4fee4f={};var _0x102152;var _0x190efa;return db[_0xbec3('0x2f')][_0xbec3('0x4e')]({'where':{'id':_0x6894e['params']['id']}})['then'](handleEntityNotFound(_0x2c76b8,null))[_0xbec3('0x28')](function(_0x5eda44){if(_0x5eda44){_0x102152=_0x5eda44;_0x4fee4f[_0xbec3('0x36')]=_[_0xbec3('0x34')](db['SugarcrmField']['rawAttributes']);_0x4fee4f[_0xbec3('0x33')]=_[_0xbec3('0x34')](_0x6894e[_0xbec3('0x33')]);_0x4fee4f['filters']=_['intersection'](_0x4fee4f[_0xbec3('0x36')],_0x4fee4f[_0xbec3('0x33')]);_0x5368d5[_0xbec3('0x37')]=_[_0xbec3('0x45')](_0x4fee4f[_0xbec3('0x36')],qs[_0xbec3('0x46')](_0x6894e[_0xbec3('0x33')][_0xbec3('0x46')]));_0x5368d5[_0xbec3('0x37')]=_0x5368d5[_0xbec3('0x37')][_0xbec3('0x47')]?_0x5368d5['attributes']:_0x4fee4f[_0xbec3('0x36')];_0x5368d5[_0xbec3('0x3a')]=qs[_0xbec3('0x3b')](_0x6894e[_0xbec3('0x33')][_0xbec3('0x3b')]);_0x5368d5[_0xbec3('0x3c')]=qs[_0xbec3('0x35')](_['pick'](_0x6894e[_0xbec3('0x33')],_0x4fee4f[_0xbec3('0x35')]));if(_0x6894e[_0xbec3('0x33')]['filter']){_0x5368d5[_0xbec3('0x3c')]=_[_0xbec3('0x3f')](_0x5368d5[_0xbec3('0x3c')],{'$or':_[_0xbec3('0x2e')](_0x5368d5[_0xbec3('0x37')],function(_0x207103){var _0x2e234e={};_0x2e234e[_0x207103]={'$like':'%'+_0x6894e[_0xbec3('0x33')][_0xbec3('0x3e')]+'%'};return _0x2e234e;})});}_0x5368d5=_[_0xbec3('0x3f')]({},_0x5368d5,_0x6894e['options']);return _0x102152[_0xbec3('0x4d')](_0x5368d5);}})[_0xbec3('0x28')](function(_0x41b152){if(_0x41b152){_0x190efa=_0x41b152['length'];if(!_0x6894e['query'][_0xbec3('0x38')]('nolimit')){_0x5368d5[_0xbec3('0x20')]=qs[_0xbec3('0x20')](_0x6894e['query'][_0xbec3('0x20')]);_0x5368d5[_0xbec3('0x22')]=qs['offset'](_0x6894e[_0xbec3('0x33')][_0xbec3('0x22')]);}return _0x102152[_0xbec3('0x4d')](_0x5368d5);}})[_0xbec3('0x28')](function(_0x18979b){if(_0x18979b){return _0x18979b?{'count':_0x190efa,'rows':_0x18979b}:null;}})['then'](respondWithResult(_0x2c76b8,null))[_0xbec3('0x4c')](handleError(_0x2c76b8,null));};exports['getSubjects']=function(_0x402cd6,_0x4b74b4,_0xe99d7f){var _0x3f525b={};var _0x2548aa={};var _0xad6851;var _0x8ad2e9;return db[_0xbec3('0x2f')]['findOne']({'where':{'id':_0x402cd6[_0xbec3('0x44')]['id']}})['then'](handleEntityNotFound(_0x4b74b4,null))[_0xbec3('0x28')](function(_0x1a74b5){if(_0x1a74b5){_0xad6851=_0x1a74b5;_0x2548aa[_0xbec3('0x36')]=_[_0xbec3('0x34')](db[_0xbec3('0x4f')][_0xbec3('0x30')]);_0x2548aa[_0xbec3('0x33')]=_['keys'](_0x402cd6['query']);_0x2548aa[_0xbec3('0x35')]=_[_0xbec3('0x45')](_0x2548aa[_0xbec3('0x36')],_0x2548aa[_0xbec3('0x33')]);_0x3f525b['attributes']=_[_0xbec3('0x45')](_0x2548aa[_0xbec3('0x36')],qs[_0xbec3('0x46')](_0x402cd6[_0xbec3('0x33')]['fields']));_0x3f525b['attributes']=_0x3f525b[_0xbec3('0x37')]['length']?_0x3f525b[_0xbec3('0x37')]:_0x2548aa[_0xbec3('0x36')];_0x3f525b[_0xbec3('0x3a')]=qs[_0xbec3('0x3b')](_0x402cd6[_0xbec3('0x33')][_0xbec3('0x3b')]);_0x3f525b[_0xbec3('0x3c')]=qs[_0xbec3('0x35')](_[_0xbec3('0x3d')](_0x402cd6[_0xbec3('0x33')],_0x2548aa['filters']));if(_0x402cd6['query']['filter']){_0x3f525b[_0xbec3('0x3c')]=_[_0xbec3('0x3f')](_0x3f525b[_0xbec3('0x3c')],{'$or':_[_0xbec3('0x2e')](_0x3f525b[_0xbec3('0x37')],function(_0x4bab93){var _0x6fea56={};_0x6fea56[_0x4bab93]={'$like':'%'+_0x402cd6['query'][_0xbec3('0x3e')]+'%'};return _0x6fea56;})});}_0x3f525b=_[_0xbec3('0x3f')]({},_0x3f525b,_0x402cd6[_0xbec3('0x40')]);return _0xad6851[_0xbec3('0x50')](_0x3f525b);}})[_0xbec3('0x28')](function(_0x1e2cff){if(_0x1e2cff){_0x8ad2e9=_0x1e2cff[_0xbec3('0x47')];if(!_0x402cd6[_0xbec3('0x33')]['hasOwnProperty'](_0xbec3('0x39'))){_0x3f525b[_0xbec3('0x20')]=qs[_0xbec3('0x20')](_0x402cd6[_0xbec3('0x33')][_0xbec3('0x20')]);_0x3f525b[_0xbec3('0x22')]=qs[_0xbec3('0x22')](_0x402cd6[_0xbec3('0x33')][_0xbec3('0x22')]);}return _0xad6851[_0xbec3('0x50')](_0x3f525b);}})[_0xbec3('0x28')](function(_0x111a67){if(_0x111a67){return _0x111a67?{'count':_0x8ad2e9,'rows':_0x111a67}:null;}})[_0xbec3('0x28')](respondWithResult(_0x4b74b4,null))[_0xbec3('0x4c')](handleError(_0x4b74b4,null));};exports[_0xbec3('0x51')]=function(_0x1ccb95,_0x4090d8,_0x518fea){var _0x994a8e={};var _0x12f255={};var _0x2b9677;var _0x53ec91;return db[_0xbec3('0x2f')][_0xbec3('0x4e')]({'where':{'id':_0x1ccb95[_0xbec3('0x44')]['id']}})['then'](handleEntityNotFound(_0x4090d8,null))['then'](function(_0x1d8021){if(_0x1d8021){_0x2b9677=_0x1d8021;_0x12f255[_0xbec3('0x36')]=_['keys'](db['SugarcrmField'][_0xbec3('0x30')]);_0x12f255[_0xbec3('0x33')]=_[_0xbec3('0x34')](_0x1ccb95[_0xbec3('0x33')]);_0x12f255[_0xbec3('0x35')]=_[_0xbec3('0x45')](_0x12f255[_0xbec3('0x36')],_0x12f255[_0xbec3('0x33')]);_0x994a8e[_0xbec3('0x37')]=_['intersection'](_0x12f255['model'],qs[_0xbec3('0x46')](_0x1ccb95[_0xbec3('0x33')][_0xbec3('0x46')]));_0x994a8e['attributes']=_0x994a8e[_0xbec3('0x37')]['length']?_0x994a8e['attributes']:_0x12f255['model'];_0x994a8e[_0xbec3('0x3a')]=qs[_0xbec3('0x3b')](_0x1ccb95[_0xbec3('0x33')][_0xbec3('0x3b')]);_0x994a8e[_0xbec3('0x3c')]=qs[_0xbec3('0x35')](_['pick'](_0x1ccb95[_0xbec3('0x33')],_0x12f255['filters']));if(_0x1ccb95['query'][_0xbec3('0x3e')]){_0x994a8e[_0xbec3('0x3c')]=_[_0xbec3('0x3f')](_0x994a8e[_0xbec3('0x3c')],{'$or':_[_0xbec3('0x2e')](_0x994a8e['attributes'],function(_0x44fd8a){var _0x17c03b={};_0x17c03b[_0x44fd8a]={'$like':'%'+_0x1ccb95['query']['filter']+'%'};return _0x17c03b;})});}_0x994a8e=_[_0xbec3('0x3f')]({},_0x994a8e,_0x1ccb95[_0xbec3('0x40')]);return _0x2b9677[_0xbec3('0x51')](_0x994a8e);}})[_0xbec3('0x28')](function(_0x106aba){if(_0x106aba){_0x53ec91=_0x106aba['length'];if(!_0x1ccb95['query'][_0xbec3('0x38')](_0xbec3('0x39'))){_0x994a8e[_0xbec3('0x20')]=qs[_0xbec3('0x20')](_0x1ccb95['query'][_0xbec3('0x20')]);_0x994a8e[_0xbec3('0x22')]=qs[_0xbec3('0x22')](_0x1ccb95['query']['offset']);}return _0x2b9677[_0xbec3('0x51')](_0x994a8e);}})['then'](function(_0xb49a82){if(_0xb49a82){return _0xb49a82?{'count':_0x53ec91,'rows':_0xb49a82}:null;}})['then'](respondWithResult(_0x4090d8,null))[_0xbec3('0x4c')](handleError(_0x4090d8,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 11c8b12..815aada 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 _0xb395=['lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration'];(function(_0x5e6fca,_0x540568){var _0x505941=function(_0x4c1d36){while(--_0x4c1d36){_0x5e6fca['push'](_0x5e6fca['shift']());}};_0x505941(++_0x540568);}(_0xb395,0x1bc));var _0x5b39=function(_0x5c4869,_0x1367bb){_0x5c4869=_0x5c4869-0x0;var _0x1b5085=_0xb395[_0x5c4869];return _0x1b5085;};'use strict';var _=require(_0x5b39('0x0'));var util=require(_0x5b39('0x1'));var logger=require(_0x5b39('0x2'))(_0x5b39('0x3'));var moment=require(_0x5b39('0x4'));var BPromise=require('bluebird');var rp=require(_0x5b39('0x5'));var fs=require('fs');var path=require(_0x5b39('0x6'));var rimraf=require('rimraf');var config=require(_0x5b39('0x7'));var attributes=require(_0x5b39('0x8'));module[_0x5b39('0x9')]=function(_0x56c746,_0x4333f2){return _0x56c746[_0x5b39('0xa')](_0x5b39('0xb'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x71f1=['exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','api','moment','../../config/environment','./intSugarcrmConfiguration.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x71f1,0xea));var _0x171f=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x71f1[_0x4a53d];return _0x27410e;};'use strict';var _=require(_0x171f('0x0'));var util=require(_0x171f('0x1'));var logger=require('../../config/logger')(_0x171f('0x2'));var moment=require(_0x171f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x171f('0x4'));var attributes=require(_0x171f('0x5'));module[_0x171f('0x6')]=function(_0x5983ff,_0x480ef5){return _0x5983ff[_0x171f('0x7')](_0x171f('0x8'),attributes,{'tableName':_0x171f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index c7ebaad..2c2250d 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 _0x6f3b=['lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x1826a0,_0x3ac245){var _0x1d2c4d=function(_0x13ade2){while(--_0x13ade2){_0x1826a0['push'](_0x1826a0['shift']());}};_0x1d2c4d(++_0x3ac245);}(_0x6f3b,0x154));var _0xb6f3=function(_0x34b02a,_0xc897da){_0x34b02a=_0x34b02a-0x0;var _0x393178=_0x6f3b[_0x34b02a];return _0x393178;};'use strict';var _=require(_0xb6f3('0x0'));var util=require(_0xb6f3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb6f3('0x2'));var db=require(_0xb6f3('0x3'))['db'];var utils=require(_0xb6f3('0x4'));var logger=require(_0xb6f3('0x5'))(_0xb6f3('0x6'));var config=require(_0xb6f3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb6f3('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2304fa,_0xef51cb,_0x5345e2){return new BPromise(function(_0x40638b,_0x15a5b5){return client[_0xb6f3('0x9')](_0x2304fa,_0x5345e2)[_0xb6f3('0xa')](function(_0x42a572){logger[_0xb6f3('0xb')](_0xb6f3('0xc'),_0xef51cb,'request\x20sent');logger['debug']('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0xef51cb,_0xb6f3('0xd'),JSON[_0xb6f3('0xe')](_0x42a572));if(_0x42a572[_0xb6f3('0xf')]){if(_0x42a572[_0xb6f3('0xf')][_0xb6f3('0x10')]===0x1f4){logger[_0xb6f3('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xef51cb,_0x42a572[_0xb6f3('0xf')][_0xb6f3('0x11')]);return _0x15a5b5(_0x42a572[_0xb6f3('0xf')][_0xb6f3('0x11')]);}logger[_0xb6f3('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xef51cb,_0x42a572[_0xb6f3('0xf')]['message']);return _0x40638b(_0x42a572['error'][_0xb6f3('0x11')]);}else{logger['info'](_0xb6f3('0xc'),_0xef51cb,_0xb6f3('0xd'));_0x40638b(_0x42a572[_0xb6f3('0x12')][_0xb6f3('0x11')]);}})[_0xb6f3('0x13')](function(_0x1caff8){logger['error'](_0xb6f3('0xc'),_0xef51cb,_0x1caff8);_0x15a5b5(_0x1caff8);});});} \ No newline at end of file +var _0x4da2=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','SugarcrmConfiguration,\x20%s,\x20%s','debug','request\x20sent','error','message','catch','lodash','util','moment'];(function(_0x2603b1,_0x3d9a8b){var _0x31d5d8=function(_0xf6df1c){while(--_0xf6df1c){_0x2603b1['push'](_0x2603b1['shift']());}};_0x31d5d8(++_0x3d9a8b);}(_0x4da2,0x19f));var _0x24da=function(_0x187181,_0x51df60){_0x187181=_0x187181-0x0;var _0x5e9446=_0x4da2[_0x187181];return _0x5e9446;};'use strict';var _=require(_0x24da('0x0'));var util=require(_0x24da('0x1'));var moment=require(_0x24da('0x2'));var BPromise=require(_0x24da('0x3'));var rs=require(_0x24da('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x24da('0x5'))['db'];var utils=require(_0x24da('0x6'));var logger=require('../../config/logger')(_0x24da('0x7'));var config=require(_0x24da('0x8'));var jayson=require(_0x24da('0x9'));var client=jayson['client'][_0x24da('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x335de9,_0x1e1c85,_0x3d2a00){return new BPromise(function(_0x4ddc3e,_0x3aefdb){return client[_0x24da('0xb')](_0x335de9,_0x3d2a00)['then'](function(_0x1fcbd8){logger[_0x24da('0xc')](_0x24da('0xd'),_0x1e1c85,'request\x20sent');logger[_0x24da('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x1e1c85,_0x24da('0xf'),JSON['stringify'](_0x1fcbd8));if(_0x1fcbd8[_0x24da('0x10')]){if(_0x1fcbd8[_0x24da('0x10')]['code']===0x1f4){logger[_0x24da('0x10')](_0x24da('0xd'),_0x1e1c85,_0x1fcbd8[_0x24da('0x10')][_0x24da('0x11')]);return _0x3aefdb(_0x1fcbd8[_0x24da('0x10')]['message']);}logger['error'](_0x24da('0xd'),_0x1e1c85,_0x1fcbd8[_0x24da('0x10')][_0x24da('0x11')]);return _0x4ddc3e(_0x1fcbd8['error'][_0x24da('0x11')]);}else{logger[_0x24da('0xc')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x1e1c85,_0x24da('0xf'));_0x4ddc3e(_0x1fcbd8['result'][_0x24da('0x11')]);}})[_0x24da('0x12')](function(_0x2fd48e){logger[_0x24da('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x1e1c85,_0x2fd48e);_0x3aefdb(_0x2fd48e);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 147f59e..96d2331 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 _0x20fa=['index','post','create','put','update','/:id','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intSugarcrmField.controller','get','isAuthenticated'];(function(_0x5b1f97,_0x1c4dd0){var _0x1eb8d9=function(_0x2d57b3){while(--_0x2d57b3){_0x5b1f97['push'](_0x5b1f97['shift']());}};_0x1eb8d9(++_0x1c4dd0);}(_0x20fa,0x87));var _0xa20f=function(_0xdbe2de,_0x3bdc5a){_0xdbe2de=_0xdbe2de-0x0;var _0x2facd7=_0x20fa[_0xdbe2de];return _0x2facd7;};'use strict';var multer=require(_0xa20f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa20f('0x1'));var express=require(_0xa20f('0x2'));var router=express[_0xa20f('0x3')]();var fs_extra=require(_0xa20f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa20f('0x5'));var config=require('../../config/environment');var controller=require(_0xa20f('0x6'));router[_0xa20f('0x7')]('/',auth[_0xa20f('0x8')](),controller[_0xa20f('0x9')]);router[_0xa20f('0x7')]('/:id',auth[_0xa20f('0x8')](),controller['show']);router[_0xa20f('0xa')]('/',auth[_0xa20f('0x8')](),controller[_0xa20f('0xb')]);router[_0xa20f('0xc')]('/:id',auth[_0xa20f('0x8')](),controller[_0xa20f('0xd')]);router['delete'](_0xa20f('0xe'),auth[_0xa20f('0x8')](),controller['destroy']);module[_0xa20f('0xf')]=router; \ No newline at end of file +var _0x04e3=['../../config/environment','./intSugarcrmField.controller','get','index','/:id','isAuthenticated','show','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x4dc582,_0x5d771e){var _0x2082c8=function(_0x21f870){while(--_0x21f870){_0x4dc582['push'](_0x4dc582['shift']());}};_0x2082c8(++_0x5d771e);}(_0x04e3,0x188));var _0x304e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x04e3[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x304e('0x0'));var util=require('util');var path=require(_0x304e('0x1'));var timeout=require(_0x304e('0x2'));var express=require(_0x304e('0x3'));var router=express[_0x304e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x304e('0x5'));var interaction=require(_0x304e('0x6'));var config=require(_0x304e('0x7'));var controller=require(_0x304e('0x8'));router[_0x304e('0x9')]('/',auth['isAuthenticated'](),controller[_0x304e('0xa')]);router[_0x304e('0x9')](_0x304e('0xb'),auth[_0x304e('0xc')](),controller[_0x304e('0xd')]);router['post']('/',auth[_0x304e('0xc')](),controller[_0x304e('0xe')]);router[_0x304e('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x304e('0x10')]);router[_0x304e('0x11')]('/:id',auth[_0x304e('0xc')](),controller['destroy']);module[_0x304e('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 54b8c34..dfa4571 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 _0x0e63=['sequelize','exports','ENUM','string','keyValue','picklist','STRING','customVariable','BOOLEAN'];(function(_0x4cdea9,_0x5dcefa){var _0x2e9ca3=function(_0x2cc9df){while(--_0x2cc9df){_0x4cdea9['push'](_0x4cdea9['shift']());}};_0x2e9ca3(++_0x5dcefa);}(_0x0e63,0x13b));var _0x30e6=function(_0x4ad3a7,_0x40ae46){_0x4ad3a7=_0x4ad3a7-0x0;var _0x575d5d=_0x0e63[_0x4ad3a7];return _0x575d5d;};'use strict';var Sequelize=require(_0x30e6('0x0'));module[_0x30e6('0x1')]={'type':{'type':Sequelize[_0x30e6('0x2')](_0x30e6('0x3'),'variable','customVariable',_0x30e6('0x4'),_0x30e6('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x30e6('0x6')]},'key':{'type':Sequelize[_0x30e6('0x6')]},'keyType':{'type':Sequelize[_0x30e6('0x2')]('string','variable',_0x30e6('0x7'))},'keyContent':{'type':Sequelize[_0x30e6('0x6')]},'idField':{'type':Sequelize[_0x30e6('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x30e6('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x30e6('0x6')]}}; \ No newline at end of file +var _0xd99b=['exports','ENUM','string','customVariable','keyValue','picklist','STRING','variable','sequelize'];(function(_0x1ea220,_0x5388ba){var _0x2cb238=function(_0x331634){while(--_0x331634){_0x1ea220['push'](_0x1ea220['shift']());}};_0x2cb238(++_0x5388ba);}(_0xd99b,0x1a6));var _0xbd99=function(_0xe775be,_0x4822af){_0xe775be=_0xe775be-0x0;var _0x49e73c=_0xd99b[_0xe775be];return _0x49e73c;};'use strict';var Sequelize=require(_0xbd99('0x0'));module[_0xbd99('0x1')]={'type':{'type':Sequelize[_0xbd99('0x2')](_0xbd99('0x3'),'variable',_0xbd99('0x4'),_0xbd99('0x5'),_0xbd99('0x6')),'defaultValue':_0xbd99('0x3')},'content':{'type':Sequelize[_0xbd99('0x7')]},'key':{'type':Sequelize[_0xbd99('0x7')]},'keyType':{'type':Sequelize['ENUM']('string',_0xbd99('0x8'),_0xbd99('0x4'))},'keyContent':{'type':Sequelize[_0xbd99('0x7')]},'idField':{'type':Sequelize[_0xbd99('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbd99('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 683eba3..d5b4ce2 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 _0x49d0=['sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','create','body','find','params','eml-format','rimraf','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','SugarcrmField','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x3b2e0a,_0x49a3f9){var _0x4a84bd=function(_0x3aa487){while(--_0x3aa487){_0x3b2e0a['push'](_0x3b2e0a['shift']());}};_0x4a84bd(++_0x49a3f9);}(_0x49d0,0x1d3));var _0x049d=function(_0x5b2b80,_0x2da163){_0x5b2b80=_0x5b2b80-0x0;var _0x3211c4=_0x49d0[_0x5b2b80];return _0x3211c4;};'use strict';var emlformat=require(_0x049d('0x0'));var rimraf=require(_0x049d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x049d('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x049d('0x3'));var Mustache=require(_0x049d('0x4'));var util=require('util');var path=require(_0x049d('0x5'));var sox=require(_0x049d('0x6'));var csv=require(_0x049d('0x7'));var ejs=require(_0x049d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x049d('0x9'));var squel=require(_0x049d('0xa'));var crypto=require('crypto');var jsforce=require(_0x049d('0xb'));var deskjs=require(_0x049d('0xc'));var toCsv=require(_0x049d('0x7'));var querystring=require('querystring');var Papa=require(_0x049d('0xd'));var Redis=require(_0x049d('0xe'));var authService=require(_0x049d('0xf'));var qs=require(_0x049d('0x10'));var as=require(_0x049d('0x11'));var hardwareService=require(_0x049d('0x12'));var logger=require(_0x049d('0x13'))(_0x049d('0x14'));var utils=require(_0x049d('0x15'));var config=require(_0x049d('0x16'));var licenseUtil=require(_0x049d('0x17'));var db=require(_0x049d('0x18'))['db'];function respondWithStatusCode(_0x147e53,_0x3adc80){_0x3adc80=_0x3adc80||0xcc;return function(_0xfb5087){if(_0xfb5087){return _0x147e53[_0x049d('0x19')](_0x3adc80);}return _0x147e53[_0x049d('0x1a')](_0x3adc80)[_0x049d('0x1b')]();};}function respondWithResult(_0x4d89cf,_0x2e99d9){_0x2e99d9=_0x2e99d9||0xc8;return function(_0x4e5854){if(_0x4e5854){return _0x4d89cf[_0x049d('0x1a')](_0x2e99d9)[_0x049d('0x1c')](_0x4e5854);}};}function respondWithFilteredResult(_0x17ab2c,_0x289ac2){return function(_0x2a0f76){if(_0x2a0f76){var _0x550e9f=typeof _0x289ac2['offset']==='undefined'&&typeof _0x289ac2['limit']===_0x049d('0x1d');var _0x4d9226=_0x2a0f76['count'];var _0x33a860=_0x550e9f?0x0:_0x289ac2[_0x049d('0x1e')];var _0x3b0589=_0x550e9f?_0x2a0f76[_0x049d('0x1f')]:_0x289ac2['offset']+_0x289ac2[_0x049d('0x20')];var _0x21e42c;if(_0x3b0589>=_0x4d9226){_0x3b0589=_0x4d9226;_0x21e42c=0xc8;}else{_0x21e42c=0xce;}_0x17ab2c['status'](_0x21e42c);return _0x17ab2c['set'](_0x049d('0x21'),_0x33a860+'-'+_0x3b0589+'/'+_0x4d9226)[_0x049d('0x1c')](_0x2a0f76);}return null;};}function patchUpdates(_0x5ab1f6){return function(_0x3b8561){try{jsonpatch[_0x049d('0x22')](_0x3b8561,_0x5ab1f6,!![]);}catch(_0x2e69d0){return BPromise[_0x049d('0x23')](_0x2e69d0);}return _0x3b8561['save']();};}function saveUpdates(_0x9c31f8,_0x1c0b8e){return function(_0x4b013b){if(_0x4b013b){return _0x4b013b[_0x049d('0x24')](_0x9c31f8)[_0x049d('0x25')](function(_0x46155d){return _0x46155d;});}return null;};}function removeEntity(_0x5cbc8b,_0x3abee5){return function(_0x228ea1){if(_0x228ea1){return _0x228ea1[_0x049d('0x26')]()[_0x049d('0x25')](function(){_0x5cbc8b['status'](0xcc)[_0x049d('0x1b')]();});}};}function handleEntityNotFound(_0x4f51d2,_0x139a74){return function(_0x228282){if(!_0x228282){_0x4f51d2['sendStatus'](0x194);}return _0x228282;};}function handleError(_0x195a88,_0x5f364e){_0x5f364e=_0x5f364e||0x1f4;return function(_0x39b2ae){logger[_0x049d('0x27')](_0x39b2ae[_0x049d('0x28')]);if(_0x39b2ae[_0x049d('0x29')]){delete _0x39b2ae['name'];}_0x195a88['status'](_0x5f364e)[_0x049d('0x2a')](_0x39b2ae);};}exports['index']=function(_0x3aaf98,_0x188de6){var _0x4e8da2={},_0x155b26={},_0x298636={'count':0x0,'rows':[]};var _0x16aaa3=_['map'](db[_0x049d('0x2b')]['rawAttributes'],function(_0x4578cd){return{'name':_0x4578cd[_0x049d('0x2c')],'type':_0x4578cd[_0x049d('0x2d')]['key']};});_0x155b26[_0x049d('0x2e')]=_[_0x049d('0x2f')](_0x16aaa3,_0x049d('0x29'));_0x155b26['query']=_[_0x049d('0x30')](_0x3aaf98[_0x049d('0x31')]);_0x155b26[_0x049d('0x32')]=_[_0x049d('0x33')](_0x155b26[_0x049d('0x2e')],_0x155b26[_0x049d('0x31')]);_0x4e8da2[_0x049d('0x34')]=_[_0x049d('0x33')](_0x155b26[_0x049d('0x2e')],qs[_0x049d('0x35')](_0x3aaf98['query'][_0x049d('0x35')]));_0x4e8da2[_0x049d('0x34')]=_0x4e8da2[_0x049d('0x34')][_0x049d('0x36')]?_0x4e8da2[_0x049d('0x34')]:_0x155b26[_0x049d('0x2e')];if(!_0x3aaf98[_0x049d('0x31')][_0x049d('0x37')](_0x049d('0x38'))){_0x4e8da2[_0x049d('0x20')]=qs[_0x049d('0x20')](_0x3aaf98[_0x049d('0x31')]['limit']);_0x4e8da2[_0x049d('0x1e')]=qs[_0x049d('0x1e')](_0x3aaf98[_0x049d('0x31')]['offset']);}_0x4e8da2[_0x049d('0x39')]=qs[_0x049d('0x3a')](_0x3aaf98[_0x049d('0x31')][_0x049d('0x3a')]);_0x4e8da2['where']=qs[_0x049d('0x32')](_['pick'](_0x3aaf98[_0x049d('0x31')],_0x155b26['filters']),_0x16aaa3);if(_0x3aaf98['query'][_0x049d('0x3b')]){_0x4e8da2[_0x049d('0x3c')]=_[_0x049d('0x3d')](_0x4e8da2[_0x049d('0x3c')],{'$or':_[_0x049d('0x2f')](_0x16aaa3,function(_0x2a2a52){if(_0x2a2a52[_0x049d('0x2d')]!==_0x049d('0x3e')){var _0x295ff5={};_0x295ff5[_0x2a2a52[_0x049d('0x29')]]={'$like':'%'+_0x3aaf98[_0x049d('0x31')]['filter']+'%'};return _0x295ff5;}})});}_0x4e8da2=_['merge']({},_0x4e8da2,_0x3aaf98[_0x049d('0x3f')]);var _0x3bd0fb={'where':_0x4e8da2['where']};return db[_0x049d('0x2b')][_0x049d('0x1f')](_0x3bd0fb)[_0x049d('0x25')](function(_0x5878af){_0x298636[_0x049d('0x1f')]=_0x5878af;if(_0x3aaf98['query'][_0x049d('0x40')]){_0x4e8da2[_0x049d('0x41')]=[{'all':!![]}];}return db[_0x049d('0x2b')][_0x049d('0x42')](_0x4e8da2);})[_0x049d('0x25')](function(_0x458a7f){_0x298636[_0x049d('0x43')]=_0x458a7f;return _0x298636;})[_0x049d('0x25')](respondWithFilteredResult(_0x188de6,_0x4e8da2))[_0x049d('0x44')](handleError(_0x188de6,null));};exports[_0x049d('0x45')]=function(_0x445caf,_0x1fd729){var _0x400d8c={'raw':!![],'where':{'id':_0x445caf['params']['id']}},_0x539661={};_0x539661[_0x049d('0x2e')]=_[_0x049d('0x30')](db[_0x049d('0x2b')][_0x049d('0x46')]);_0x539661[_0x049d('0x31')]=_[_0x049d('0x30')](_0x445caf[_0x049d('0x31')]);_0x539661[_0x049d('0x32')]=_[_0x049d('0x33')](_0x539661['model'],_0x539661[_0x049d('0x31')]);_0x400d8c['attributes']=_['intersection'](_0x539661['model'],qs['fields'](_0x445caf[_0x049d('0x31')][_0x049d('0x35')]));_0x400d8c[_0x049d('0x34')]=_0x400d8c['attributes'][_0x049d('0x36')]?_0x400d8c[_0x049d('0x34')]:_0x539661[_0x049d('0x2e')];if(_0x445caf['query']['includeAll']){_0x400d8c[_0x049d('0x41')]=[{'all':!![]}];}_0x400d8c=_['merge']({},_0x400d8c,_0x445caf[_0x049d('0x3f')]);return db[_0x049d('0x2b')]['find'](_0x400d8c)[_0x049d('0x25')](handleEntityNotFound(_0x1fd729,null))[_0x049d('0x25')](respondWithResult(_0x1fd729,null))[_0x049d('0x44')](handleError(_0x1fd729,null));};exports[_0x049d('0x47')]=function(_0x1731c0,_0x25b474){return db[_0x049d('0x2b')][_0x049d('0x47')](_0x1731c0[_0x049d('0x48')],{})[_0x049d('0x25')](respondWithResult(_0x25b474,0xc9))[_0x049d('0x44')](handleError(_0x25b474,null));};exports['update']=function(_0x4c3220,_0x2bca21){if(_0x4c3220[_0x049d('0x48')]['id']){delete _0x4c3220[_0x049d('0x48')]['id'];}return db['SugarcrmField'][_0x049d('0x49')]({'where':{'id':_0x4c3220[_0x049d('0x4a')]['id']}})[_0x049d('0x25')](handleEntityNotFound(_0x2bca21,null))[_0x049d('0x25')](saveUpdates(_0x4c3220['body'],null))[_0x049d('0x25')](respondWithResult(_0x2bca21,null))[_0x049d('0x44')](handleError(_0x2bca21,null));};exports[_0x049d('0x26')]=function(_0x7ff1c5,_0x8eb14e){return db[_0x049d('0x2b')][_0x049d('0x49')]({'where':{'id':_0x7ff1c5[_0x049d('0x4a')]['id']}})[_0x049d('0x25')](handleEntityNotFound(_0x8eb14e,null))['then'](removeEntity(_0x8eb14e,null))[_0x049d('0x44')](handleError(_0x8eb14e,null));}; \ No newline at end of file +var _0x5a3e=['sort','where','merge','filter','includeAll','include','findAll','rows','catch','params','options','find','create','body','zip-dir','request-promise','moment','path','sox','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','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','update','then','destroy','error','name','send','map','SugarcrmField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x4f4d19,_0x574245){var _0x27a258=function(_0x38da3e){while(--_0x38da3e){_0x4f4d19['push'](_0x4f4d19['shift']());}};_0x27a258(++_0x574245);}(_0x5a3e,0x98));var _0xe5a3=function(_0x5127f7,_0x42d377){_0x5127f7=_0x5127f7-0x0;var _0x3c1245=_0x5a3e[_0x5127f7];return _0x3c1245;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe5a3('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe5a3('0x1'));var moment=require(_0xe5a3('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xe5a3('0x3'));var sox=require(_0xe5a3('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe5a3('0x5'));var _=require(_0xe5a3('0x6'));var squel=require(_0xe5a3('0x7'));var crypto=require(_0xe5a3('0x8'));var jsforce=require(_0xe5a3('0x9'));var deskjs=require(_0xe5a3('0xa'));var toCsv=require(_0xe5a3('0xb'));var querystring=require(_0xe5a3('0xc'));var Papa=require(_0xe5a3('0xd'));var Redis=require(_0xe5a3('0xe'));var authService=require(_0xe5a3('0xf'));var qs=require(_0xe5a3('0x10'));var as=require(_0xe5a3('0x11'));var hardwareService=require(_0xe5a3('0x12'));var logger=require('../../config/logger')(_0xe5a3('0x13'));var utils=require(_0xe5a3('0x14'));var config=require(_0xe5a3('0x15'));var licenseUtil=require(_0xe5a3('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42de31,_0x5a7e0f){_0x5a7e0f=_0x5a7e0f||0xcc;return function(_0x3da093){if(_0x3da093){return _0x42de31[_0xe5a3('0x17')](_0x5a7e0f);}return _0x42de31['status'](_0x5a7e0f)[_0xe5a3('0x18')]();};}function respondWithResult(_0x4e47cd,_0xf8abcc){_0xf8abcc=_0xf8abcc||0xc8;return function(_0x10ef83){if(_0x10ef83){return _0x4e47cd[_0xe5a3('0x19')](_0xf8abcc)[_0xe5a3('0x1a')](_0x10ef83);}};}function respondWithFilteredResult(_0xce19b9,_0x43231){return function(_0x24c9e3){if(_0x24c9e3){var _0x1e7f26=typeof _0x43231[_0xe5a3('0x1b')]===_0xe5a3('0x1c')&&typeof _0x43231['limit']===_0xe5a3('0x1c');var _0x23c11f=_0x24c9e3[_0xe5a3('0x1d')];var _0x5b0dc6=_0x1e7f26?0x0:_0x43231[_0xe5a3('0x1b')];var _0x222ac8=_0x1e7f26?_0x24c9e3[_0xe5a3('0x1d')]:_0x43231[_0xe5a3('0x1b')]+_0x43231[_0xe5a3('0x1e')];var _0x20cd22;if(_0x222ac8>=_0x23c11f){_0x222ac8=_0x23c11f;_0x20cd22=0xc8;}else{_0x20cd22=0xce;}_0xce19b9[_0xe5a3('0x19')](_0x20cd22);return _0xce19b9[_0xe5a3('0x1f')]('Content-Range',_0x5b0dc6+'-'+_0x222ac8+'/'+_0x23c11f)[_0xe5a3('0x1a')](_0x24c9e3);}return null;};}function patchUpdates(_0x12a427){return function(_0x43b612){try{jsonpatch[_0xe5a3('0x20')](_0x43b612,_0x12a427,!![]);}catch(_0x4a7b4f){return BPromise['reject'](_0x4a7b4f);}return _0x43b612['save']();};}function saveUpdates(_0x50c5ce,_0x237af6){return function(_0x2e156b){if(_0x2e156b){return _0x2e156b[_0xe5a3('0x21')](_0x50c5ce)[_0xe5a3('0x22')](function(_0x5d7328){return _0x5d7328;});}return null;};}function removeEntity(_0x5f2285,_0x49e9a7){return function(_0x445094){if(_0x445094){return _0x445094[_0xe5a3('0x23')]()['then'](function(){_0x5f2285[_0xe5a3('0x19')](0xcc)[_0xe5a3('0x18')]();});}};}function handleEntityNotFound(_0x3bacff,_0x2c4135){return function(_0x3feab4){if(!_0x3feab4){_0x3bacff[_0xe5a3('0x17')](0x194);}return _0x3feab4;};}function handleError(_0x171b35,_0x27ecad){_0x27ecad=_0x27ecad||0x1f4;return function(_0x56a6ed){logger[_0xe5a3('0x24')](_0x56a6ed['stack']);if(_0x56a6ed[_0xe5a3('0x25')]){delete _0x56a6ed['name'];}_0x171b35[_0xe5a3('0x19')](_0x27ecad)[_0xe5a3('0x26')](_0x56a6ed);};}exports['index']=function(_0x5563db,_0x4098ec){var _0x5ad63f={},_0x4b18ad={},_0x3a2850={'count':0x0,'rows':[]};var _0x64a417=_[_0xe5a3('0x27')](db[_0xe5a3('0x28')][_0xe5a3('0x29')],function(_0x3214bf){return{'name':_0x3214bf[_0xe5a3('0x2a')],'type':_0x3214bf[_0xe5a3('0x2b')][_0xe5a3('0x2c')]};});_0x4b18ad['model']=_[_0xe5a3('0x27')](_0x64a417,'name');_0x4b18ad[_0xe5a3('0x2d')]=_[_0xe5a3('0x2e')](_0x5563db[_0xe5a3('0x2d')]);_0x4b18ad[_0xe5a3('0x2f')]=_[_0xe5a3('0x30')](_0x4b18ad[_0xe5a3('0x31')],_0x4b18ad[_0xe5a3('0x2d')]);_0x5ad63f[_0xe5a3('0x32')]=_[_0xe5a3('0x30')](_0x4b18ad[_0xe5a3('0x31')],qs[_0xe5a3('0x33')](_0x5563db[_0xe5a3('0x2d')]['fields']));_0x5ad63f[_0xe5a3('0x32')]=_0x5ad63f[_0xe5a3('0x32')][_0xe5a3('0x34')]?_0x5ad63f[_0xe5a3('0x32')]:_0x4b18ad[_0xe5a3('0x31')];if(!_0x5563db['query'][_0xe5a3('0x35')](_0xe5a3('0x36'))){_0x5ad63f[_0xe5a3('0x1e')]=qs['limit'](_0x5563db[_0xe5a3('0x2d')][_0xe5a3('0x1e')]);_0x5ad63f[_0xe5a3('0x1b')]=qs[_0xe5a3('0x1b')](_0x5563db[_0xe5a3('0x2d')][_0xe5a3('0x1b')]);}_0x5ad63f['order']=qs[_0xe5a3('0x37')](_0x5563db[_0xe5a3('0x2d')][_0xe5a3('0x37')]);_0x5ad63f[_0xe5a3('0x38')]=qs[_0xe5a3('0x2f')](_['pick'](_0x5563db[_0xe5a3('0x2d')],_0x4b18ad[_0xe5a3('0x2f')]),_0x64a417);if(_0x5563db[_0xe5a3('0x2d')]['filter']){_0x5ad63f['where']=_[_0xe5a3('0x39')](_0x5ad63f[_0xe5a3('0x38')],{'$or':_['map'](_0x64a417,function(_0x11d5ba){if(_0x11d5ba[_0xe5a3('0x2b')]!=='VIRTUAL'){var _0x3318da={};_0x3318da[_0x11d5ba[_0xe5a3('0x25')]]={'$like':'%'+_0x5563db[_0xe5a3('0x2d')][_0xe5a3('0x3a')]+'%'};return _0x3318da;}})});}_0x5ad63f=_[_0xe5a3('0x39')]({},_0x5ad63f,_0x5563db['options']);var _0x514c0a={'where':_0x5ad63f[_0xe5a3('0x38')]};return db[_0xe5a3('0x28')]['count'](_0x514c0a)[_0xe5a3('0x22')](function(_0x2480d8){_0x3a2850[_0xe5a3('0x1d')]=_0x2480d8;if(_0x5563db['query'][_0xe5a3('0x3b')]){_0x5ad63f[_0xe5a3('0x3c')]=[{'all':!![]}];}return db[_0xe5a3('0x28')][_0xe5a3('0x3d')](_0x5ad63f);})[_0xe5a3('0x22')](function(_0x156101){_0x3a2850[_0xe5a3('0x3e')]=_0x156101;return _0x3a2850;})['then'](respondWithFilteredResult(_0x4098ec,_0x5ad63f))[_0xe5a3('0x3f')](handleError(_0x4098ec,null));};exports['show']=function(_0x439312,_0x41386a){var _0x1abef3={'raw':!![],'where':{'id':_0x439312[_0xe5a3('0x40')]['id']}},_0x22028e={};_0x22028e['model']=_[_0xe5a3('0x2e')](db[_0xe5a3('0x28')][_0xe5a3('0x29')]);_0x22028e[_0xe5a3('0x2d')]=_[_0xe5a3('0x2e')](_0x439312['query']);_0x22028e[_0xe5a3('0x2f')]=_[_0xe5a3('0x30')](_0x22028e[_0xe5a3('0x31')],_0x22028e[_0xe5a3('0x2d')]);_0x1abef3[_0xe5a3('0x32')]=_[_0xe5a3('0x30')](_0x22028e['model'],qs[_0xe5a3('0x33')](_0x439312['query'][_0xe5a3('0x33')]));_0x1abef3['attributes']=_0x1abef3[_0xe5a3('0x32')][_0xe5a3('0x34')]?_0x1abef3[_0xe5a3('0x32')]:_0x22028e[_0xe5a3('0x31')];if(_0x439312[_0xe5a3('0x2d')][_0xe5a3('0x3b')]){_0x1abef3['include']=[{'all':!![]}];}_0x1abef3=_[_0xe5a3('0x39')]({},_0x1abef3,_0x439312[_0xe5a3('0x41')]);return db[_0xe5a3('0x28')][_0xe5a3('0x42')](_0x1abef3)[_0xe5a3('0x22')](handleEntityNotFound(_0x41386a,null))[_0xe5a3('0x22')](respondWithResult(_0x41386a,null))[_0xe5a3('0x3f')](handleError(_0x41386a,null));};exports[_0xe5a3('0x43')]=function(_0x510580,_0x5129e7){return db['SugarcrmField'][_0xe5a3('0x43')](_0x510580[_0xe5a3('0x44')],{})['then'](respondWithResult(_0x5129e7,0xc9))['catch'](handleError(_0x5129e7,null));};exports['update']=function(_0x150d67,_0x31e547){if(_0x150d67[_0xe5a3('0x44')]['id']){delete _0x150d67[_0xe5a3('0x44')]['id'];}return db[_0xe5a3('0x28')][_0xe5a3('0x42')]({'where':{'id':_0x150d67[_0xe5a3('0x40')]['id']}})[_0xe5a3('0x22')](handleEntityNotFound(_0x31e547,null))[_0xe5a3('0x22')](saveUpdates(_0x150d67['body'],null))['then'](respondWithResult(_0x31e547,null))[_0xe5a3('0x3f')](handleError(_0x31e547,null));};exports['destroy']=function(_0x182511,_0x1cf821){return db[_0xe5a3('0x28')][_0xe5a3('0x42')]({'where':{'id':_0x182511[_0xe5a3('0x40')]['id']}})['then'](handleEntityNotFound(_0x1cf821,null))[_0xe5a3('0x22')](removeEntity(_0x1cf821,null))['catch'](handleError(_0x1cf821,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 45a8857..3805c0b 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 _0x2ebb=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','int_sugarcrm_fields','idField','FieldId'];(function(_0x448ce0,_0x368759){var _0x276827=function(_0x20c835){while(--_0x20c835){_0x448ce0['push'](_0x448ce0['shift']());}};_0x276827(++_0x368759);}(_0x2ebb,0x8c));var _0xb2eb=function(_0x4a85b3,_0x3ce0ec){_0x4a85b3=_0x4a85b3-0x0;var _0x764620=_0x2ebb[_0x4a85b3];return _0x764620;};'use strict';var _=require(_0xb2eb('0x0'));var util=require(_0xb2eb('0x1'));var logger=require('../../config/logger')(_0xb2eb('0x2'));var moment=require(_0xb2eb('0x3'));var BPromise=require(_0xb2eb('0x4'));var rp=require(_0xb2eb('0x5'));var fs=require('fs');var path=require(_0xb2eb('0x6'));var rimraf=require(_0xb2eb('0x7'));var config=require(_0xb2eb('0x8'));var attributes=require(_0xb2eb('0x9'));module[_0xb2eb('0xa')]=function(_0x383769,_0x6138b7){return _0x383769['define']('SugarcrmField',attributes,{'tableName':_0xb2eb('0xb'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0xb2eb('0xc'),_0xb2eb('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x909e=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','sugarcrm_unique_index','idField','lodash','util','../../config/logger'];(function(_0x1b68ba,_0x23687a){var _0xf49b11=function(_0x5732c6){while(--_0x5732c6){_0x1b68ba['push'](_0x1b68ba['shift']());}};_0xf49b11(++_0x23687a);}(_0x909e,0x192));var _0xe909=function(_0x3a263b,_0x2d7f09){_0x3a263b=_0x3a263b-0x0;var _0x1a88c0=_0x909e[_0x3a263b];return _0x1a88c0;};'use strict';var _=require(_0xe909('0x0'));var util=require(_0xe909('0x1'));var logger=require(_0xe909('0x2'))(_0xe909('0x3'));var moment=require(_0xe909('0x4'));var BPromise=require(_0xe909('0x5'));var rp=require(_0xe909('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe909('0x7'));var config=require(_0xe909('0x8'));var attributes=require(_0xe909('0x9'));module[_0xe909('0xa')]=function(_0x4e59eb,_0xb87420){return _0x4e59eb[_0xe909('0xb')](_0xe909('0xc'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0xe909('0xd'),'fields':[_0xe909('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 a4e0932..a779447 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 _0xfe8e=['SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x23ef98,_0x568a4e){var _0x44e145=function(_0x21345b){while(--_0x21345b){_0x23ef98['push'](_0x23ef98['shift']());}};_0x44e145(++_0x568a4e);}(_0xfe8e,0x90));var _0xefe8=function(_0x1bc013,_0x7771c6){_0x1bc013=_0x1bc013-0x0;var _0x55df36=_0xfe8e[_0x1bc013];return _0x55df36;};'use strict';var _=require(_0xefe8('0x0'));var util=require('util');var moment=require(_0xefe8('0x1'));var BPromise=require('bluebird');var rs=require(_0xefe8('0x2'));var fs=require('fs');var Redis=require(_0xefe8('0x3'));var db=require(_0xefe8('0x4'))['db'];var utils=require(_0xefe8('0x5'));var logger=require(_0xefe8('0x6'))(_0xefe8('0x7'));var config=require(_0xefe8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xefe8('0x9')][_0xefe8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17e400,_0x3d769e,_0x512457){return new BPromise(function(_0x6b70f4,_0xfa39b5){return client[_0xefe8('0xb')](_0x17e400,_0x512457)[_0xefe8('0xc')](function(_0x54e1ac){logger[_0xefe8('0xd')](_0xefe8('0xe'),_0x3d769e,_0xefe8('0xf'));logger[_0xefe8('0x10')](_0xefe8('0x11'),_0x3d769e,'request\x20sent',JSON[_0xefe8('0x12')](_0x54e1ac));if(_0x54e1ac[_0xefe8('0x13')]){if(_0x54e1ac[_0xefe8('0x13')][_0xefe8('0x14')]===0x1f4){logger[_0xefe8('0x13')](_0xefe8('0xe'),_0x3d769e,_0x54e1ac[_0xefe8('0x13')][_0xefe8('0x15')]);return _0xfa39b5(_0x54e1ac[_0xefe8('0x13')]['message']);}logger[_0xefe8('0x13')](_0xefe8('0xe'),_0x3d769e,_0x54e1ac[_0xefe8('0x13')][_0xefe8('0x15')]);return _0x6b70f4(_0x54e1ac[_0xefe8('0x13')][_0xefe8('0x15')]);}else{logger[_0xefe8('0xd')](_0xefe8('0xe'),_0x3d769e,'request\x20sent');_0x6b70f4(_0x54e1ac['result']['message']);}})[_0xefe8('0x16')](function(_0x16445e){logger[_0xefe8('0x13')](_0xefe8('0xe'),_0x3d769e,_0x16445e);_0xfa39b5(_0x16445e);});});} \ No newline at end of file +var _0x7579=['jayson/promise','request','then','SugarcrmField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x445a7d,_0x2feb68){var _0x5808f0=function(_0x440df3){while(--_0x440df3){_0x445a7d['push'](_0x445a7d['shift']());}};_0x5808f0(++_0x2feb68);}(_0x7579,0x185));var _0x9757=function(_0x45c361,_0x18e641){_0x45c361=_0x45c361-0x0;var _0x349347=_0x7579[_0x45c361];return _0x349347;};'use strict';var _=require(_0x9757('0x0'));var util=require(_0x9757('0x1'));var moment=require(_0x9757('0x2'));var BPromise=require(_0x9757('0x3'));var rs=require(_0x9757('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9757('0x5'))['db'];var utils=require(_0x9757('0x6'));var logger=require(_0x9757('0x7'))(_0x9757('0x8'));var config=require(_0x9757('0x9'));var jayson=require(_0x9757('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x557a4b,_0x2b1734,_0x5e9d22){return new BPromise(function(_0x51c4ae,_0x1d6d5f){return client[_0x9757('0xb')](_0x557a4b,_0x5e9d22)[_0x9757('0xc')](function(_0x2039f1){logger['info'](_0x9757('0xd'),_0x2b1734,_0x9757('0xe'));logger['debug']('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x2b1734,_0x9757('0xe'),JSON[_0x9757('0xf')](_0x2039f1));if(_0x2039f1[_0x9757('0x10')]){if(_0x2039f1[_0x9757('0x10')][_0x9757('0x11')]===0x1f4){logger[_0x9757('0x10')]('SugarcrmField,\x20%s,\x20%s',_0x2b1734,_0x2039f1[_0x9757('0x10')][_0x9757('0x12')]);return _0x1d6d5f(_0x2039f1[_0x9757('0x10')][_0x9757('0x12')]);}logger[_0x9757('0x10')](_0x9757('0xd'),_0x2b1734,_0x2039f1['error'][_0x9757('0x12')]);return _0x51c4ae(_0x2039f1['error'][_0x9757('0x12')]);}else{logger[_0x9757('0x13')](_0x9757('0xd'),_0x2b1734,_0x9757('0xe'));_0x51c4ae(_0x2039f1[_0x9757('0x14')][_0x9757('0x12')]);}})['catch'](function(_0x6f9b21){logger['error'](_0x9757('0xd'),_0x2b1734,_0x6f9b21);_0x1d6d5f(_0x6f9b21);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 737c76f..e85e32b 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 _0x1cc7=['create','post','put','delete','destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/:id','show','getConfigurations'];(function(_0x1c510a,_0x1413a9){var _0x23cedd=function(_0x3f3e43){while(--_0x3f3e43){_0x1c510a['push'](_0x1c510a['shift']());}};_0x23cedd(++_0x1413a9);}(_0x1cc7,0x15a));var _0x71cc=function(_0x50780c,_0x3f02a5){_0x50780c=_0x50780c-0x0;var _0x1474c2=_0x1cc7[_0x50780c];return _0x1474c2;};'use strict';var multer=require(_0x71cc('0x0'));var util=require(_0x71cc('0x1'));var path=require(_0x71cc('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x71cc('0x3'));var auth=require(_0x71cc('0x4'));var interaction=require(_0x71cc('0x5'));var config=require('../../config/environment');var controller=require('./intVtigerAccount.controller');router['get']('/',auth[_0x71cc('0x6')](),controller['index']);router[_0x71cc('0x7')](_0x71cc('0x8'),auth[_0x71cc('0x6')](),controller[_0x71cc('0x9')]);router[_0x71cc('0x7')]('/:id/configurations',auth[_0x71cc('0x6')](),controller[_0x71cc('0xa')]);router[_0x71cc('0x7')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0x71cc('0x6')](),controller[_0x71cc('0xb')]);router[_0x71cc('0xc')]('/:id/configurations',auth[_0x71cc('0x6')](),controller['addConfiguration']);router[_0x71cc('0xd')]('/:id',auth[_0x71cc('0x6')](),controller['update']);router[_0x71cc('0xe')](_0x71cc('0x8'),auth[_0x71cc('0x6')](),controller[_0x71cc('0xf')]);module[_0x71cc('0x10')]=router; \ No newline at end of file +var _0xfd7b=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','create','post','addConfiguration','update','destroy','exports','util'];(function(_0x39c7a4,_0x394b77){var _0x2df6cf=function(_0x9a04e0){while(--_0x9a04e0){_0x39c7a4['push'](_0x39c7a4['shift']());}};_0x2df6cf(++_0x394b77);}(_0xfd7b,0x1df));var _0xbfd7=function(_0xe8129c,_0x2fb03c){_0xe8129c=_0xe8129c-0x0;var _0x709fc5=_0xfd7b[_0xe8129c];return _0x709fc5;};'use strict';var multer=require('multer');var util=require(_0xbfd7('0x0'));var path=require(_0xbfd7('0x1'));var timeout=require(_0xbfd7('0x2'));var express=require(_0xbfd7('0x3'));var router=express[_0xbfd7('0x4')]();var fs_extra=require(_0xbfd7('0x5'));var auth=require(_0xbfd7('0x6'));var interaction=require(_0xbfd7('0x7'));var config=require(_0xbfd7('0x8'));var controller=require(_0xbfd7('0x9'));router[_0xbfd7('0xa')]('/',auth[_0xbfd7('0xb')](),controller[_0xbfd7('0xc')]);router['get'](_0xbfd7('0xd'),auth['isAuthenticated'](),controller[_0xbfd7('0xe')]);router['get'](_0xbfd7('0xf'),auth[_0xbfd7('0xb')](),controller[_0xbfd7('0x10')]);router[_0xbfd7('0xa')]('/:id/fields',auth[_0xbfd7('0xb')](),controller[_0xbfd7('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbfd7('0x12')]);router[_0xbfd7('0x13')](_0xbfd7('0xf'),auth[_0xbfd7('0xb')](),controller[_0xbfd7('0x14')]);router['put'](_0xbfd7('0xd'),auth['isAuthenticated'](),controller[_0xbfd7('0x15')]);router['delete']('/:id',auth[_0xbfd7('0xb')](),controller[_0xbfd7('0x16')]);module[_0xbfd7('0x17')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index d018b59..0ccf24d 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 _0x50b2=['exports','STRING','sequelize'];(function(_0x1324c3,_0x1947b7){var _0x36fd4b=function(_0x1de29d){while(--_0x1de29d){_0x1324c3['push'](_0x1324c3['shift']());}};_0x36fd4b(++_0x1947b7);}(_0x50b2,0xb6));var _0x250b=function(_0x348ea7,_0x591405){_0x348ea7=_0x348ea7-0x0;var _0x5eafdf=_0x50b2[_0x348ea7];return _0x5eafdf;};'use strict';var Sequelize=require(_0x250b('0x0'));module[_0x250b('0x1')]={'name':{'type':Sequelize[_0x250b('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x250b('0x2')]},'username':{'type':Sequelize[_0x250b('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x250b('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x250b('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x250b('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x3ad5=['sequelize','exports','STRING','HelpDesk'];(function(_0x13c1b9,_0x402b69){var _0x229f8b=function(_0x396d42){while(--_0x396d42){_0x13c1b9['push'](_0x13c1b9['shift']());}};_0x229f8b(++_0x402b69);}(_0x3ad5,0x8c));var _0x53ad=function(_0x1615fd,_0x17119c){_0x1615fd=_0x1615fd-0x0;var _0x4821d9=_0x3ad5[_0x1615fd];return _0x4821d9;};'use strict';var Sequelize=require(_0x53ad('0x0'));module[_0x53ad('0x1')]={'name':{'type':Sequelize[_0x53ad('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x53ad('0x2')]},'username':{'type':Sequelize[_0x53ad('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x53ad('0x2')],'allowNull':![],'defaultValue':_0x53ad('0x3')},'remoteUri':{'type':Sequelize[_0x53ad('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x53ad('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 7683cae..7b24a8b 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 _0x8463=['Descriptions','md5','getFields','moduleName','remoteUri','serverUrl','accessKey','username','slice','substring','lastIndexOf','%s/webservice.php','GET','getchallenge','success','POST','login','token','describe','sessionName','autogenerated','remove','result','includes','editable','false','startsWith','cf_','picklist','picklistValues','label','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','count','set','Content-Range','save','update','then','error','name','send','index','VtigerAccount','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','create','body','find','findOne','VtigerConfiguration','length','pick','merge','getConfigurations','addConfiguration','Subjects','getSubjects','getDescriptions','channel','VtigerField'];(function(_0x237dfb,_0x1d4d4c){var _0x29cdaa=function(_0x258e73){while(--_0x258e73){_0x237dfb['push'](_0x237dfb['shift']());}};_0x29cdaa(++_0x1d4d4c);}(_0x8463,0x98));var _0x3846=function(_0x3b65bc,_0x28f506){_0x3b65bc=_0x3b65bc-0x0;var _0x352bb5=_0x8463[_0x3b65bc];return _0x352bb5;};'use strict';var emlformat=require(_0x3846('0x0'));var rimraf=require(_0x3846('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3846('0x2'));var rp=require(_0x3846('0x3'));var moment=require(_0x3846('0x4'));var BPromise=require(_0x3846('0x5'));var Mustache=require(_0x3846('0x6'));var util=require('util');var path=require('path');var sox=require(_0x3846('0x7'));var csv=require(_0x3846('0x8'));var ejs=require(_0x3846('0x9'));var fs=require('fs');var fs_extra=require(_0x3846('0xa'));var _=require(_0x3846('0xb'));var squel=require('squel');var crypto=require(_0x3846('0xc'));var jsforce=require(_0x3846('0xd'));var deskjs=require(_0x3846('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3846('0xf'));var Papa=require('papaparse');var Redis=require(_0x3846('0x10'));var authService=require(_0x3846('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3846('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3846('0x13'));var utils=require(_0x3846('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3846('0x15'))['db'];var integrations=require(_0x3846('0x16'));function respondWithStatusCode(_0x45ea53,_0xe81339){_0xe81339=_0xe81339||0xcc;return function(_0x11cf09){if(_0x11cf09){return _0x45ea53[_0x3846('0x17')](_0xe81339);}return _0x45ea53[_0x3846('0x18')](_0xe81339)[_0x3846('0x19')]();};}function respondWithResult(_0x132212,_0x1cb2fd){_0x1cb2fd=_0x1cb2fd||0xc8;return function(_0x597ecc){if(_0x597ecc){return _0x132212[_0x3846('0x18')](_0x1cb2fd)['json'](_0x597ecc);}};}function respondWithFilteredResult(_0x2b7af4,_0x59d834){return function(_0x38c17a){if(_0x38c17a){var _0x4e8152=typeof _0x59d834[_0x3846('0x1a')]===_0x3846('0x1b')&&typeof _0x59d834['limit']===_0x3846('0x1b');var _0x45ac0a=_0x38c17a['count'];var _0x41c9c6=_0x4e8152?0x0:_0x59d834[_0x3846('0x1a')];var _0x249511=_0x4e8152?_0x38c17a[_0x3846('0x1c')]:_0x59d834[_0x3846('0x1a')]+_0x59d834['limit'];var _0x21c02b;if(_0x249511>=_0x45ac0a){_0x249511=_0x45ac0a;_0x21c02b=0xc8;}else{_0x21c02b=0xce;}_0x2b7af4['status'](_0x21c02b);return _0x2b7af4[_0x3846('0x1d')](_0x3846('0x1e'),_0x41c9c6+'-'+_0x249511+'/'+_0x45ac0a)['json'](_0x38c17a);}return null;};}function patchUpdates(_0x56b243){return function(_0xf647dc){try{jsonpatch['apply'](_0xf647dc,_0x56b243,!![]);}catch(_0x32052e){return BPromise['reject'](_0x32052e);}return _0xf647dc[_0x3846('0x1f')]();};}function saveUpdates(_0x1f38dd,_0x2b598b){return function(_0x245f37){if(_0x245f37){return _0x245f37[_0x3846('0x20')](_0x1f38dd)['then'](function(_0xe8b769){return _0xe8b769;});}return null;};}function removeEntity(_0x3d44e0,_0x32c64f){return function(_0x24d2a7){if(_0x24d2a7){return _0x24d2a7['destroy']()[_0x3846('0x21')](function(){_0x3d44e0[_0x3846('0x18')](0xcc)[_0x3846('0x19')]();});}};}function handleEntityNotFound(_0xbaec7,_0x407af8){return function(_0x572903){if(!_0x572903){_0xbaec7[_0x3846('0x17')](0x194);}return _0x572903;};}function handleError(_0x2b35f1,_0x8f82d4){_0x8f82d4=_0x8f82d4||0x1f4;return function(_0x1bd00d){logger[_0x3846('0x22')](_0x1bd00d['stack']);if(_0x1bd00d[_0x3846('0x23')]){delete _0x1bd00d[_0x3846('0x23')];}_0x2b35f1[_0x3846('0x18')](_0x8f82d4)[_0x3846('0x24')](_0x1bd00d);};}exports[_0x3846('0x25')]=function(_0x382fe0,_0x1428b4){var _0x499a12={},_0x31d1e8={},_0x6059bb={'count':0x0,'rows':[]};var _0xbb962c=_['map'](db[_0x3846('0x26')][_0x3846('0x27')],function(_0x4c58c9){return{'name':_0x4c58c9['fieldName'],'type':_0x4c58c9[_0x3846('0x28')][_0x3846('0x29')]};});_0x31d1e8[_0x3846('0x2a')]=_[_0x3846('0x2b')](_0xbb962c,_0x3846('0x23'));_0x31d1e8[_0x3846('0x2c')]=_[_0x3846('0x2d')](_0x382fe0[_0x3846('0x2c')]);_0x31d1e8[_0x3846('0x2e')]=_[_0x3846('0x2f')](_0x31d1e8[_0x3846('0x2a')],_0x31d1e8['query']);_0x499a12[_0x3846('0x30')]=_[_0x3846('0x2f')](_0x31d1e8['model'],qs[_0x3846('0x31')](_0x382fe0[_0x3846('0x2c')][_0x3846('0x31')]));_0x499a12[_0x3846('0x30')]=_0x499a12[_0x3846('0x30')]['length']?_0x499a12['attributes']:_0x31d1e8[_0x3846('0x2a')];if(!_0x382fe0['query'][_0x3846('0x32')]('nolimit')){_0x499a12[_0x3846('0x33')]=qs[_0x3846('0x33')](_0x382fe0[_0x3846('0x2c')][_0x3846('0x33')]);_0x499a12['offset']=qs[_0x3846('0x1a')](_0x382fe0[_0x3846('0x2c')]['offset']);}_0x499a12[_0x3846('0x34')]=qs['sort'](_0x382fe0['query'][_0x3846('0x35')]);_0x499a12[_0x3846('0x36')]=qs[_0x3846('0x2e')](_['pick'](_0x382fe0[_0x3846('0x2c')],_0x31d1e8['filters']),_0xbb962c);if(_0x382fe0[_0x3846('0x2c')]['filter']){_0x499a12[_0x3846('0x36')]=_['merge'](_0x499a12[_0x3846('0x36')],{'$or':_['map'](_0xbb962c,function(_0x34362e){if(_0x34362e[_0x3846('0x28')]!==_0x3846('0x37')){var _0x555622={};_0x555622[_0x34362e[_0x3846('0x23')]]={'$like':'%'+_0x382fe0['query']['filter']+'%'};return _0x555622;}})});}_0x499a12=_['merge']({},_0x499a12,_0x382fe0[_0x3846('0x38')]);var _0x466dd2={'where':_0x499a12[_0x3846('0x36')]};return db[_0x3846('0x26')]['count'](_0x466dd2)[_0x3846('0x21')](function(_0x2212b7){_0x6059bb['count']=_0x2212b7;if(_0x382fe0[_0x3846('0x2c')][_0x3846('0x39')]){_0x499a12[_0x3846('0x3a')]=[{'all':!![]}];}return db[_0x3846('0x26')][_0x3846('0x3b')](_0x499a12);})['then'](function(_0x1fb4a7){_0x6059bb[_0x3846('0x3c')]=_0x1fb4a7;return _0x6059bb;})[_0x3846('0x21')](respondWithFilteredResult(_0x1428b4,_0x499a12))[_0x3846('0x3d')](handleError(_0x1428b4,null));};exports['show']=function(_0x20e07a,_0x3c32bf){var _0x273bfb={'raw':![],'where':{'id':_0x20e07a[_0x3846('0x3e')]['id']}},_0xeccc5a={};_0xeccc5a[_0x3846('0x2a')]=_[_0x3846('0x2d')](db[_0x3846('0x26')]['rawAttributes']);_0xeccc5a[_0x3846('0x2c')]=_['keys'](_0x20e07a[_0x3846('0x2c')]);_0xeccc5a[_0x3846('0x2e')]=_[_0x3846('0x2f')](_0xeccc5a['model'],_0xeccc5a[_0x3846('0x2c')]);_0x273bfb[_0x3846('0x30')]=_['intersection'](_0xeccc5a[_0x3846('0x2a')],qs['fields'](_0x20e07a[_0x3846('0x2c')][_0x3846('0x31')]));_0x273bfb['attributes']=_0x273bfb[_0x3846('0x30')]['length']?_0x273bfb[_0x3846('0x30')]:_0xeccc5a[_0x3846('0x2a')];if(_0x20e07a[_0x3846('0x2c')][_0x3846('0x39')]){_0x273bfb[_0x3846('0x3a')]=[{'all':!![]}];}_0x273bfb=_['merge']({},_0x273bfb,_0x20e07a[_0x3846('0x38')]);return db[_0x3846('0x26')]['find'](_0x273bfb)[_0x3846('0x21')](handleEntityNotFound(_0x3c32bf,null))[_0x3846('0x21')](respondWithResult(_0x3c32bf,null))['catch'](handleError(_0x3c32bf,null));};exports[_0x3846('0x3f')]=function(_0xda8298,_0x52cc51){return db['VtigerAccount']['create'](_0xda8298[_0x3846('0x40')],{})[_0x3846('0x21')](respondWithResult(_0x52cc51,0xc9))['catch'](handleError(_0x52cc51,null));};exports['update']=function(_0x3563a1,_0x9c988){if(_0x3563a1['body']['id']){delete _0x3563a1[_0x3846('0x40')]['id'];}return db[_0x3846('0x26')][_0x3846('0x41')]({'where':{'id':_0x3563a1[_0x3846('0x3e')]['id']}})[_0x3846('0x21')](handleEntityNotFound(_0x9c988,null))[_0x3846('0x21')](saveUpdates(_0x3563a1[_0x3846('0x40')],null))[_0x3846('0x21')](respondWithResult(_0x9c988,null))[_0x3846('0x3d')](handleError(_0x9c988,null));};exports['destroy']=function(_0xd9560b,_0x13d33f){return db[_0x3846('0x26')][_0x3846('0x41')]({'where':{'id':_0xd9560b['params']['id']}})['then'](handleEntityNotFound(_0x13d33f,null))['then'](removeEntity(_0x13d33f,null))['catch'](handleError(_0x13d33f,null));};exports['getConfigurations']=function(_0x2bdb9f,_0x1eff6b,_0x40ac87){var _0x392df5={};var _0x204e07={};var _0x3a5135;var _0xba3b3d;return db[_0x3846('0x26')][_0x3846('0x42')]({'where':{'id':_0x2bdb9f[_0x3846('0x3e')]['id']}})[_0x3846('0x21')](handleEntityNotFound(_0x1eff6b,null))[_0x3846('0x21')](function(_0x4cb544){if(_0x4cb544){_0x3a5135=_0x4cb544;_0x204e07[_0x3846('0x2a')]=_[_0x3846('0x2d')](db[_0x3846('0x43')][_0x3846('0x27')]);_0x204e07['query']=_[_0x3846('0x2d')](_0x2bdb9f[_0x3846('0x2c')]);_0x204e07[_0x3846('0x2e')]=_[_0x3846('0x2f')](_0x204e07[_0x3846('0x2a')],_0x204e07['query']);_0x392df5[_0x3846('0x30')]=_[_0x3846('0x2f')](_0x204e07[_0x3846('0x2a')],qs[_0x3846('0x31')](_0x2bdb9f['query'][_0x3846('0x31')]));_0x392df5[_0x3846('0x30')]=_0x392df5['attributes'][_0x3846('0x44')]?_0x392df5[_0x3846('0x30')]:_0x204e07[_0x3846('0x2a')];_0x392df5[_0x3846('0x34')]=qs['sort'](_0x2bdb9f['query'][_0x3846('0x35')]);_0x392df5[_0x3846('0x36')]=qs[_0x3846('0x2e')](_[_0x3846('0x45')](_0x2bdb9f[_0x3846('0x2c')],_0x204e07[_0x3846('0x2e')]));if(_0x2bdb9f[_0x3846('0x2c')]['filter']){_0x392df5[_0x3846('0x36')]=_[_0x3846('0x46')](_0x392df5[_0x3846('0x36')],{'$or':_[_0x3846('0x2b')](_0x392df5['attributes'],function(_0x370961){var _0x34bae1={};_0x34bae1[_0x370961]={'$like':'%'+_0x2bdb9f['query']['filter']+'%'};return _0x34bae1;})});}_0x392df5=_[_0x3846('0x46')]({},_0x392df5,_0x2bdb9f[_0x3846('0x38')]);return _0x3a5135[_0x3846('0x47')](_0x392df5);}})[_0x3846('0x21')](function(_0x1233da){if(_0x1233da){_0xba3b3d=_0x1233da[_0x3846('0x44')];if(!_0x2bdb9f[_0x3846('0x2c')][_0x3846('0x32')]('nolimit')){_0x392df5[_0x3846('0x33')]=qs[_0x3846('0x33')](_0x2bdb9f['query'][_0x3846('0x33')]);_0x392df5[_0x3846('0x1a')]=qs[_0x3846('0x1a')](_0x2bdb9f[_0x3846('0x2c')][_0x3846('0x1a')]);}return _0x3a5135[_0x3846('0x47')](_0x392df5);}})[_0x3846('0x21')](function(_0x2f9242){if(_0x2f9242){return _0x2f9242?{'count':_0xba3b3d,'rows':_0x2f9242}:null;}})['then'](respondWithResult(_0x1eff6b,null))['catch'](handleError(_0x1eff6b,null));};exports[_0x3846('0x48')]=function(_0x395bef,_0x496bf6,_0x51eb56){if(_0x395bef[_0x3846('0x40')]['id']){delete _0x395bef[_0x3846('0x40')]['id'];}return db[_0x3846('0x26')][_0x3846('0x42')]({'where':{'id':_0x395bef[_0x3846('0x3e')]['id']}})[_0x3846('0x21')](handleEntityNotFound(_0x496bf6,null))[_0x3846('0x21')](function(_0x391c92){if(_0x391c92){_0x395bef[_0x3846('0x40')]['AccountId']=_0x391c92['id'];_0x395bef['body'][_0x3846('0x49')]=integrations[_0x3846('0x4a')](_0x395bef[_0x3846('0x40')]['channel'],_0x395bef['body'][_0x3846('0x28')]);_0x395bef[_0x3846('0x40')]['Descriptions']=integrations[_0x3846('0x4b')](_0x395bef[_0x3846('0x40')][_0x3846('0x4c')],_0x395bef['body'][_0x3846('0x28')]);return db[_0x3846('0x43')][_0x3846('0x3f')](_0x395bef[_0x3846('0x40')],{'include':[{'model':db['VtigerField'],'as':_0x3846('0x49')},{'model':db[_0x3846('0x4d')],'as':_0x3846('0x4e')}]});}return null;})[_0x3846('0x21')](respondWithResult(_0x496bf6,null))['catch'](handleError(_0x496bf6,null));};var md5=require(_0x3846('0x4f'));exports[_0x3846('0x50')]=function(_0x250711,_0xccdbdf,_0x4e6db6){var _0xdbaf65=null;var _0x2d726b=null;var _0x41670d=null;var _0x56c144=null;var _0x428806='';return db[_0x3846('0x26')]['findOne']({'where':{'id':_0x250711[_0x3846('0x3e')]['id']},'attributes':['id',_0x3846('0x23'),'username','description',_0x3846('0x51'),_0x3846('0x52'),_0x3846('0x53'),_0x3846('0x54')]})[_0x3846('0x21')](handleEntityNotFound(_0xccdbdf,null))[_0x3846('0x21')](function(_0x27a9f2){if(_0x27a9f2){_0xdbaf65=_0x27a9f2[_0x3846('0x55')];_0x2d726b=_0x27a9f2[_0x3846('0x54')];_0x41670d=_0x27a9f2['moduleName'];_0x428806=_0x27a9f2['remoteUri'];var _0x172520=_0x428806[_0x3846('0x56')](-0x1);if(_0x172520==='/'){_0x428806=_0x428806[_0x3846('0x57')](0x0,_0x428806[_0x3846('0x58')](_0x172520));}_0x56c144=util['format'](_0x3846('0x59'),_0x428806);var _0x2482c5={'method':_0x3846('0x5a'),'uri':_0x56c144,'qs':{'operation':_0x3846('0x5b'),'username':_0x27a9f2[_0x3846('0x55')]},'json':!![]};return rp(_0x2482c5);}})[_0x3846('0x21')](function(_0x5814d2){if(_0x5814d2[_0x3846('0x5c')]){var _0x138fbb={'method':_0x3846('0x5d'),'uri':_0x56c144,'form':{'operation':_0x3846('0x5e'),'username':_0xdbaf65,'accessKey':md5(_0x5814d2['result'][_0x3846('0x5f')]+_0x2d726b)},'json':!![]};return rp(_0x138fbb);}})['then'](function(_0x5e7542){if(_0x5e7542[_0x3846('0x5c')]){var _0x478795={'method':_0x3846('0x5a'),'uri':_0x56c144,'qs':{'operation':_0x3846('0x60'),'username':_0xdbaf65,'sessionName':_0x5e7542['result'][_0x3846('0x61')],'elementType':_0x41670d},'json':!![]};return rp(_0x478795);}})['then'](function(_0xe9c613){if(_0xe9c613[_0x3846('0x5c')]){var _0x3d17bc=[_0x3846('0x62'),'reference','owner'];_[_0x3846('0x63')](_0xe9c613[_0x3846('0x64')][_0x3846('0x31')],function(_0x28115f){return _0x3d17bc[_0x3846('0x65')](_0x28115f['type'][_0x3846('0x23')]);});_[_0x3846('0x63')](_0xe9c613[_0x3846('0x64')]['fields'],function(_0x2afe49){return _0x2afe49[_0x3846('0x66')]===_0x3846('0x67');});return{'count':_0xe9c613['result'][_0x3846('0x31')][_0x3846('0x44')],'rows':_['map'](_0xe9c613[_0x3846('0x64')]['fields'],function(_0x57f0ea){return{'id':_0x57f0ea[_0x3846('0x23')],'name':_0x57f0ea['label'],'custom':_[_0x3846('0x68')](_0x57f0ea['name'],_0x3846('0x69'))?!![]:![],'options':_0x57f0ea[_0x3846('0x28')]['name']===_0x3846('0x6a')&&_0x57f0ea[_0x3846('0x28')][_0x3846('0x6b')][_0x3846('0x44')]>0x0?_['map'](_0x57f0ea[_0x3846('0x28')][_0x3846('0x6b')],function(_0x36deb2){return{'name':_0x36deb2[_0x3846('0x6c')],'value':_0x36deb2['value']};}):[]};})};}})[_0x3846('0x21')](respondWithResult(_0xccdbdf,null))[_0x3846('0x3d')](function(_0x14459d){console[_0x3846('0x6d')](_0x3846('0x6e')+_0x14459d);var _0x319d02=_0x250711[_0x3846('0x2c')][_0x3846('0x6f')]?0x1f4:_0x14459d[_0x3846('0x70')]||0x1f4;logger[_0x3846('0x22')](_0x3846('0x71'),_0x3846('0x50'),_0x319d02,JSON['stringify'](_0x14459d));delete _0x14459d[_0x3846('0x23')];if(_0x319d02===0x191){_0x319d02=0x190;}_0xccdbdf['status'](_0x319d02)[_0x3846('0x24')](_0x250711['query']['test']?{'message':_0x3846('0x72'),'statusCode':_0x14459d[_0x3846('0x70')]}:_0x14459d);});}; \ No newline at end of file +var _0x768f=['json','offset','limit','undefined','count','apply','reject','save','update','destroy','then','end','error','name','send','index','map','rawAttributes','fieldName','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','include','VtigerAccount','findAll','rows','find','catch','create','body','findOne','params','VtigerConfiguration','getConfigurations','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','Subjects','md5','getFields','username','remoteUri','accessKey','moduleName','slice','substring','format','%s/webservice.php','GET','getchallenge','login','token','success','result','sessionName','reference','owner','remove','includes','false','label','startsWith','picklist','picklistValues','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','rimraf','zip-dir','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x113a6c,_0x10df30){var _0x1ac632=function(_0xbd4fb9){while(--_0xbd4fb9){_0x113a6c['push'](_0x113a6c['shift']());}};_0x1ac632(++_0x10df30);}(_0x768f,0x141));var _0xf768=function(_0x415c5e,_0x4a854c){_0x415c5e=_0x415c5e-0x0;var _0x1e09c7=_0x768f[_0x415c5e];return _0x1e09c7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf768('0x0'));var zipdir=require(_0xf768('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf768('0x2'));var moment=require(_0xf768('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf768('0x4'));var util=require(_0xf768('0x5'));var path=require('path');var sox=require(_0xf768('0x6'));var csv=require('to-csv');var ejs=require(_0xf768('0x7'));var fs=require('fs');var fs_extra=require(_0xf768('0x8'));var _=require(_0xf768('0x9'));var squel=require(_0xf768('0xa'));var crypto=require(_0xf768('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf768('0xc'));var toCsv=require(_0xf768('0xd'));var querystring=require(_0xf768('0xe'));var Papa=require(_0xf768('0xf'));var Redis=require(_0xf768('0x10'));var authService=require(_0xf768('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf768('0x12'));var logger=require(_0xf768('0x13'))(_0xf768('0x14'));var utils=require(_0xf768('0x15'));var config=require(_0xf768('0x16'));var licenseUtil=require(_0xf768('0x17'));var db=require(_0xf768('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x567e58,_0x574b5b){_0x574b5b=_0x574b5b||0xcc;return function(_0x3253d0){if(_0x3253d0){return _0x567e58[_0xf768('0x19')](_0x574b5b);}return _0x567e58['status'](_0x574b5b)['end']();};}function respondWithResult(_0x2ace86,_0x24dd24){_0x24dd24=_0x24dd24||0xc8;return function(_0x4481c7){if(_0x4481c7){return _0x2ace86[_0xf768('0x1a')](_0x24dd24)[_0xf768('0x1b')](_0x4481c7);}};}function respondWithFilteredResult(_0x2fdeab,_0x10fa1c){return function(_0x21591c){if(_0x21591c){var _0x2e2877=typeof _0x10fa1c[_0xf768('0x1c')]==='undefined'&&typeof _0x10fa1c[_0xf768('0x1d')]===_0xf768('0x1e');var _0x12e6e4=_0x21591c[_0xf768('0x1f')];var _0x52cfbe=_0x2e2877?0x0:_0x10fa1c[_0xf768('0x1c')];var _0xf31e90=_0x2e2877?_0x21591c[_0xf768('0x1f')]:_0x10fa1c[_0xf768('0x1c')]+_0x10fa1c[_0xf768('0x1d')];var _0x3da99b;if(_0xf31e90>=_0x12e6e4){_0xf31e90=_0x12e6e4;_0x3da99b=0xc8;}else{_0x3da99b=0xce;}_0x2fdeab[_0xf768('0x1a')](_0x3da99b);return _0x2fdeab['set']('Content-Range',_0x52cfbe+'-'+_0xf31e90+'/'+_0x12e6e4)[_0xf768('0x1b')](_0x21591c);}return null;};}function patchUpdates(_0x369994){return function(_0x34e66c){try{jsonpatch[_0xf768('0x20')](_0x34e66c,_0x369994,!![]);}catch(_0x2c49ca){return BPromise[_0xf768('0x21')](_0x2c49ca);}return _0x34e66c[_0xf768('0x22')]();};}function saveUpdates(_0x5b34c1,_0x285a3a){return function(_0x182e40){if(_0x182e40){return _0x182e40[_0xf768('0x23')](_0x5b34c1)['then'](function(_0x223881){return _0x223881;});}return null;};}function removeEntity(_0x18fbc5,_0x31f95e){return function(_0x12907b){if(_0x12907b){return _0x12907b[_0xf768('0x24')]()[_0xf768('0x25')](function(){_0x18fbc5[_0xf768('0x1a')](0xcc)[_0xf768('0x26')]();});}};}function handleEntityNotFound(_0x2a8544,_0x22f05a){return function(_0x28ae0a){if(!_0x28ae0a){_0x2a8544[_0xf768('0x19')](0x194);}return _0x28ae0a;};}function handleError(_0x3b9f4a,_0x4559c7){_0x4559c7=_0x4559c7||0x1f4;return function(_0x3c07f2){logger[_0xf768('0x27')](_0x3c07f2['stack']);if(_0x3c07f2[_0xf768('0x28')]){delete _0x3c07f2[_0xf768('0x28')];}_0x3b9f4a[_0xf768('0x1a')](_0x4559c7)[_0xf768('0x29')](_0x3c07f2);};}exports[_0xf768('0x2a')]=function(_0x1926f0,_0x120a3a){var _0x256133={},_0x3e250f={},_0x206f2f={'count':0x0,'rows':[]};var _0x119f4c=_[_0xf768('0x2b')](db['VtigerAccount'][_0xf768('0x2c')],function(_0x5f25b8){return{'name':_0x5f25b8[_0xf768('0x2d')],'type':_0x5f25b8['type']['key']};});_0x3e250f[_0xf768('0x2e')]=_[_0xf768('0x2b')](_0x119f4c,_0xf768('0x28'));_0x3e250f['query']=_[_0xf768('0x2f')](_0x1926f0[_0xf768('0x30')]);_0x3e250f['filters']=_[_0xf768('0x31')](_0x3e250f[_0xf768('0x2e')],_0x3e250f[_0xf768('0x30')]);_0x256133[_0xf768('0x32')]=_['intersection'](_0x3e250f[_0xf768('0x2e')],qs[_0xf768('0x33')](_0x1926f0[_0xf768('0x30')][_0xf768('0x33')]));_0x256133[_0xf768('0x32')]=_0x256133[_0xf768('0x32')][_0xf768('0x34')]?_0x256133[_0xf768('0x32')]:_0x3e250f['model'];if(!_0x1926f0[_0xf768('0x30')][_0xf768('0x35')](_0xf768('0x36'))){_0x256133[_0xf768('0x1d')]=qs[_0xf768('0x1d')](_0x1926f0['query'][_0xf768('0x1d')]);_0x256133[_0xf768('0x1c')]=qs[_0xf768('0x1c')](_0x1926f0[_0xf768('0x30')][_0xf768('0x1c')]);}_0x256133[_0xf768('0x37')]=qs[_0xf768('0x38')](_0x1926f0[_0xf768('0x30')]['sort']);_0x256133[_0xf768('0x39')]=qs['filters'](_[_0xf768('0x3a')](_0x1926f0['query'],_0x3e250f[_0xf768('0x3b')]),_0x119f4c);if(_0x1926f0[_0xf768('0x30')][_0xf768('0x3c')]){_0x256133[_0xf768('0x39')]=_[_0xf768('0x3d')](_0x256133[_0xf768('0x39')],{'$or':_[_0xf768('0x2b')](_0x119f4c,function(_0x55bd57){if(_0x55bd57[_0xf768('0x3e')]!==_0xf768('0x3f')){var _0x1774c1={};_0x1774c1[_0x55bd57[_0xf768('0x28')]]={'$like':'%'+_0x1926f0['query'][_0xf768('0x3c')]+'%'};return _0x1774c1;}})});}_0x256133=_[_0xf768('0x3d')]({},_0x256133,_0x1926f0[_0xf768('0x40')]);var _0x3e59a6={'where':_0x256133['where']};return db['VtigerAccount'][_0xf768('0x1f')](_0x3e59a6)['then'](function(_0xeebea8){_0x206f2f[_0xf768('0x1f')]=_0xeebea8;if(_0x1926f0[_0xf768('0x30')][_0xf768('0x41')]){_0x256133[_0xf768('0x42')]=[{'all':!![]}];}return db[_0xf768('0x43')][_0xf768('0x44')](_0x256133);})['then'](function(_0x29f1ef){_0x206f2f[_0xf768('0x45')]=_0x29f1ef;return _0x206f2f;})[_0xf768('0x25')](respondWithFilteredResult(_0x120a3a,_0x256133))['catch'](handleError(_0x120a3a,null));};exports['show']=function(_0x2ccd91,_0xe18684){var _0x216063={'raw':![],'where':{'id':_0x2ccd91['params']['id']}},_0x2742c1={};_0x2742c1[_0xf768('0x2e')]=_[_0xf768('0x2f')](db[_0xf768('0x43')]['rawAttributes']);_0x2742c1['query']=_['keys'](_0x2ccd91['query']);_0x2742c1['filters']=_[_0xf768('0x31')](_0x2742c1['model'],_0x2742c1['query']);_0x216063[_0xf768('0x32')]=_[_0xf768('0x31')](_0x2742c1['model'],qs[_0xf768('0x33')](_0x2ccd91[_0xf768('0x30')][_0xf768('0x33')]));_0x216063[_0xf768('0x32')]=_0x216063[_0xf768('0x32')]['length']?_0x216063[_0xf768('0x32')]:_0x2742c1[_0xf768('0x2e')];if(_0x2ccd91['query'][_0xf768('0x41')]){_0x216063[_0xf768('0x42')]=[{'all':!![]}];}_0x216063=_['merge']({},_0x216063,_0x2ccd91[_0xf768('0x40')]);return db['VtigerAccount'][_0xf768('0x46')](_0x216063)['then'](handleEntityNotFound(_0xe18684,null))[_0xf768('0x25')](respondWithResult(_0xe18684,null))[_0xf768('0x47')](handleError(_0xe18684,null));};exports[_0xf768('0x48')]=function(_0x197883,_0x4c08e4){return db[_0xf768('0x43')][_0xf768('0x48')](_0x197883[_0xf768('0x49')],{})[_0xf768('0x25')](respondWithResult(_0x4c08e4,0xc9))[_0xf768('0x47')](handleError(_0x4c08e4,null));};exports[_0xf768('0x23')]=function(_0x498c52,_0xbe2957){if(_0x498c52[_0xf768('0x49')]['id']){delete _0x498c52[_0xf768('0x49')]['id'];}return db[_0xf768('0x43')][_0xf768('0x46')]({'where':{'id':_0x498c52['params']['id']}})[_0xf768('0x25')](handleEntityNotFound(_0xbe2957,null))[_0xf768('0x25')](saveUpdates(_0x498c52[_0xf768('0x49')],null))['then'](respondWithResult(_0xbe2957,null))['catch'](handleError(_0xbe2957,null));};exports['destroy']=function(_0x389705,_0x4c3fdd){return db[_0xf768('0x43')][_0xf768('0x46')]({'where':{'id':_0x389705['params']['id']}})[_0xf768('0x25')](handleEntityNotFound(_0x4c3fdd,null))[_0xf768('0x25')](removeEntity(_0x4c3fdd,null))[_0xf768('0x47')](handleError(_0x4c3fdd,null));};exports['getConfigurations']=function(_0x21593a,_0x5062dc,_0x5f14e9){var _0x6f5889={};var _0x7b57e1={};var _0x5cae26;var _0x51361d;return db['VtigerAccount'][_0xf768('0x4a')]({'where':{'id':_0x21593a[_0xf768('0x4b')]['id']}})[_0xf768('0x25')](handleEntityNotFound(_0x5062dc,null))[_0xf768('0x25')](function(_0x1ff1a6){if(_0x1ff1a6){_0x5cae26=_0x1ff1a6;_0x7b57e1[_0xf768('0x2e')]=_[_0xf768('0x2f')](db[_0xf768('0x4c')][_0xf768('0x2c')]);_0x7b57e1[_0xf768('0x30')]=_[_0xf768('0x2f')](_0x21593a[_0xf768('0x30')]);_0x7b57e1[_0xf768('0x3b')]=_[_0xf768('0x31')](_0x7b57e1[_0xf768('0x2e')],_0x7b57e1['query']);_0x6f5889[_0xf768('0x32')]=_[_0xf768('0x31')](_0x7b57e1['model'],qs['fields'](_0x21593a[_0xf768('0x30')][_0xf768('0x33')]));_0x6f5889['attributes']=_0x6f5889[_0xf768('0x32')][_0xf768('0x34')]?_0x6f5889[_0xf768('0x32')]:_0x7b57e1['model'];_0x6f5889[_0xf768('0x37')]=qs[_0xf768('0x38')](_0x21593a[_0xf768('0x30')]['sort']);_0x6f5889[_0xf768('0x39')]=qs[_0xf768('0x3b')](_[_0xf768('0x3a')](_0x21593a[_0xf768('0x30')],_0x7b57e1[_0xf768('0x3b')]));if(_0x21593a[_0xf768('0x30')][_0xf768('0x3c')]){_0x6f5889[_0xf768('0x39')]=_[_0xf768('0x3d')](_0x6f5889[_0xf768('0x39')],{'$or':_[_0xf768('0x2b')](_0x6f5889[_0xf768('0x32')],function(_0xe341d2){var _0x560909={};_0x560909[_0xe341d2]={'$like':'%'+_0x21593a[_0xf768('0x30')][_0xf768('0x3c')]+'%'};return _0x560909;})});}_0x6f5889=_[_0xf768('0x3d')]({},_0x6f5889,_0x21593a[_0xf768('0x40')]);return _0x5cae26[_0xf768('0x4d')](_0x6f5889);}})['then'](function(_0x11352c){if(_0x11352c){_0x51361d=_0x11352c[_0xf768('0x34')];if(!_0x21593a['query'][_0xf768('0x35')](_0xf768('0x36'))){_0x6f5889[_0xf768('0x1d')]=qs[_0xf768('0x1d')](_0x21593a[_0xf768('0x30')][_0xf768('0x1d')]);_0x6f5889['offset']=qs[_0xf768('0x1c')](_0x21593a[_0xf768('0x30')]['offset']);}return _0x5cae26['getConfigurations'](_0x6f5889);}})[_0xf768('0x25')](function(_0x11d597){if(_0x11d597){return _0x11d597?{'count':_0x51361d,'rows':_0x11d597}:null;}})[_0xf768('0x25')](respondWithResult(_0x5062dc,null))[_0xf768('0x47')](handleError(_0x5062dc,null));};exports[_0xf768('0x4e')]=function(_0x35847f,_0x474df2,_0x10d3c5){if(_0x35847f[_0xf768('0x49')]['id']){delete _0x35847f['body']['id'];}return db['VtigerAccount'][_0xf768('0x4a')]({'where':{'id':_0x35847f[_0xf768('0x4b')]['id']}})[_0xf768('0x25')](handleEntityNotFound(_0x474df2,null))[_0xf768('0x25')](function(_0x17b508){if(_0x17b508){_0x35847f['body'][_0xf768('0x4f')]=_0x17b508['id'];_0x35847f[_0xf768('0x49')]['Subjects']=integrations[_0xf768('0x50')](_0x35847f[_0xf768('0x49')][_0xf768('0x51')],_0x35847f[_0xf768('0x49')][_0xf768('0x3e')]);_0x35847f[_0xf768('0x49')][_0xf768('0x52')]=integrations[_0xf768('0x53')](_0x35847f[_0xf768('0x49')][_0xf768('0x51')],_0x35847f[_0xf768('0x49')][_0xf768('0x3e')]);return db['VtigerConfiguration']['create'](_0x35847f['body'],{'include':[{'model':db['VtigerField'],'as':_0xf768('0x54')},{'model':db['VtigerField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x474df2,null))[_0xf768('0x47')](handleError(_0x474df2,null));};var md5=require(_0xf768('0x55'));exports[_0xf768('0x56')]=function(_0x203837,_0x231efb,_0x4ba9b7){var _0x4a92ce=null;var _0x1ed7b0=null;var _0x3b1d90=null;var _0x215e55=null;var _0x39b350='';return db[_0xf768('0x43')][_0xf768('0x4a')]({'where':{'id':_0x203837['params']['id']},'attributes':['id','name',_0xf768('0x57'),'description','moduleName',_0xf768('0x58'),'serverUrl',_0xf768('0x59')]})['then'](handleEntityNotFound(_0x231efb,null))[_0xf768('0x25')](function(_0xb1308c){if(_0xb1308c){_0x4a92ce=_0xb1308c['username'];_0x1ed7b0=_0xb1308c['accessKey'];_0x3b1d90=_0xb1308c[_0xf768('0x5a')];_0x39b350=_0xb1308c['remoteUri'];var _0x37f0b6=_0x39b350[_0xf768('0x5b')](-0x1);if(_0x37f0b6==='/'){_0x39b350=_0x39b350[_0xf768('0x5c')](0x0,_0x39b350['lastIndexOf'](_0x37f0b6));}_0x215e55=util[_0xf768('0x5d')](_0xf768('0x5e'),_0x39b350);var _0xd3a3f6={'method':_0xf768('0x5f'),'uri':_0x215e55,'qs':{'operation':_0xf768('0x60'),'username':_0xb1308c[_0xf768('0x57')]},'json':!![]};return rp(_0xd3a3f6);}})['then'](function(_0x384863){if(_0x384863['success']){var _0x15fe19={'method':'POST','uri':_0x215e55,'form':{'operation':_0xf768('0x61'),'username':_0x4a92ce,'accessKey':md5(_0x384863['result'][_0xf768('0x62')]+_0x1ed7b0)},'json':!![]};return rp(_0x15fe19);}})[_0xf768('0x25')](function(_0x7788f3){if(_0x7788f3[_0xf768('0x63')]){var _0x30986a={'method':'GET','uri':_0x215e55,'qs':{'operation':'describe','username':_0x4a92ce,'sessionName':_0x7788f3[_0xf768('0x64')][_0xf768('0x65')],'elementType':_0x3b1d90},'json':!![]};return rp(_0x30986a);}})['then'](function(_0x4088e7){if(_0x4088e7[_0xf768('0x63')]){var _0x5d63dd=['autogenerated',_0xf768('0x66'),_0xf768('0x67')];_[_0xf768('0x68')](_0x4088e7[_0xf768('0x64')][_0xf768('0x33')],function(_0x56b035){return _0x5d63dd[_0xf768('0x69')](_0x56b035[_0xf768('0x3e')][_0xf768('0x28')]);});_[_0xf768('0x68')](_0x4088e7[_0xf768('0x64')][_0xf768('0x33')],function(_0x15df9b){return _0x15df9b['editable']===_0xf768('0x6a');});return{'count':_0x4088e7['result'][_0xf768('0x33')][_0xf768('0x34')],'rows':_[_0xf768('0x2b')](_0x4088e7['result'][_0xf768('0x33')],function(_0x16ef37){return{'id':_0x16ef37[_0xf768('0x28')],'name':_0x16ef37[_0xf768('0x6b')],'custom':_[_0xf768('0x6c')](_0x16ef37[_0xf768('0x28')],'cf_')?!![]:![],'options':_0x16ef37[_0xf768('0x3e')][_0xf768('0x28')]===_0xf768('0x6d')&&_0x16ef37[_0xf768('0x3e')][_0xf768('0x6e')][_0xf768('0x34')]>0x0?_[_0xf768('0x2b')](_0x16ef37[_0xf768('0x3e')][_0xf768('0x6e')],function(_0x34371b){return{'name':_0x34371b[_0xf768('0x6b')],'value':_0x34371b[_0xf768('0x6f')]};}):[]};})};}})[_0xf768('0x25')](respondWithResult(_0x231efb,null))['catch'](function(_0x18f14f){console['log']('vTiger\x20error:\x20'+_0x18f14f);var _0x9c612a=_0x203837['query'][_0xf768('0x70')]?0x1f4:_0x18f14f[_0xf768('0x71')]||0x1f4;logger['error'](_0xf768('0x72'),_0xf768('0x56'),_0x9c612a,JSON[_0xf768('0x73')](_0x18f14f));delete _0x18f14f[_0xf768('0x28')];if(_0x9c612a===0x191){_0x9c612a=0x190;}_0x231efb[_0xf768('0x1a')](_0x9c612a)[_0xf768('0x29')](_0x203837[_0xf768('0x30')][_0xf768('0x70')]?{'message':'Wrong\x20credentials','statusCode':_0x18f14f[_0xf768('0x71')]}:_0x18f14f);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 45b3fb6..179f05a 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 _0x9b57=['../../components/integrations/configuration','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9b57,0xe0));var _0x79b5=function(_0x5161a9,_0x34c537){_0x5161a9=_0x5161a9-0x0;var _0x342b26=_0x9b57[_0x5161a9];return _0x342b26;};'use strict';var _=require(_0x79b5('0x0'));var util=require(_0x79b5('0x1'));var logger=require(_0x79b5('0x2'))('api');var moment=require(_0x79b5('0x3'));var BPromise=require(_0x79b5('0x4'));var rp=require(_0x79b5('0x5'));var fs=require('fs');var path=require(_0x79b5('0x6'));var rimraf=require(_0x79b5('0x7'));var config=require(_0x79b5('0x8'));var attributes=require(_0x79b5('0x9'));var integrations=require(_0x79b5('0xa'));module['exports']=function(_0x5532ec,_0x23d1c6){return _0x5532ec['define'](_0x79b5('0xb'),attributes,{'tableName':_0x79b5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x92b1=['request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','VtigerAccount','int_vtiger_accounts','lodash','../../config/logger','moment','bluebird'];(function(_0x5b3879,_0x371a35){var _0x53f28f=function(_0x45b1ed){while(--_0x45b1ed){_0x5b3879['push'](_0x5b3879['shift']());}};_0x53f28f(++_0x371a35);}(_0x92b1,0xc8));var _0x192b=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x92b1[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x192b('0x0'));var util=require('util');var logger=require(_0x192b('0x1'))('api');var moment=require(_0x192b('0x2'));var BPromise=require(_0x192b('0x3'));var rp=require(_0x192b('0x4'));var fs=require('fs');var path=require(_0x192b('0x5'));var rimraf=require(_0x192b('0x6'));var config=require(_0x192b('0x7'));var attributes=require(_0x192b('0x8'));var integrations=require(_0x192b('0x9'));module['exports']=function(_0x426adf,_0x10b9c0){return _0x426adf['define'](_0x192b('0xa'),attributes,{'tableName':_0x192b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index f4876d9..dd902b3 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 _0xbdb7=['model','map','ShowVtigerAccount','find','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVtigerAccount','VtigerAccount','options','raw','attributes','limit','include'];(function(_0x3a897d,_0x29b8b1){var _0x1140cd=function(_0x301b44){while(--_0x301b44){_0x3a897d['push'](_0x3a897d['shift']());}};_0x1140cd(++_0x29b8b1);}(_0xbdb7,0x12e));var _0x7bdb=function(_0xee7f65,_0x4ff021){_0xee7f65=_0xee7f65-0x0;var _0x5449bc=_0xbdb7[_0xee7f65];return _0x5449bc;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var BPromise=require(_0x7bdb('0x3'));var rs=require(_0x7bdb('0x4'));var fs=require('fs');var Redis=require(_0x7bdb('0x5'));var db=require(_0x7bdb('0x6'))['db'];var utils=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('rpc');var config=require(_0x7bdb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e23a3,_0x493bde,_0x513cba){return new BPromise(function(_0x468041,_0x11a877){return client['request'](_0x1e23a3,_0x513cba)['then'](function(_0xdc2ffc){logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));logger[_0x7bdb('0xe')](_0x7bdb('0xf'),_0x493bde,_0x7bdb('0xd'),JSON[_0x7bdb('0x10')](_0xdc2ffc));if(_0xdc2ffc['error']){if(_0xdc2ffc['error']['code']===0x1f4){logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error'][_0x7bdb('0x12')]);return _0x11a877(_0xdc2ffc['error']['message']);}logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error']['message']);return _0x468041(_0xdc2ffc['error'][_0x7bdb('0x12')]);}else{logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));_0x468041(_0xdc2ffc[_0x7bdb('0x13')][_0x7bdb('0x12')]);}})[_0x7bdb('0x14')](function(_0x1b2d9b){logger['error'](_0x7bdb('0xc'),_0x493bde,_0x1b2d9b);_0x11a877(_0x1b2d9b);});});}exports[_0x7bdb('0x15')]=function(_0x5723f4){var _0x2aff6a=this;return new Promise(function(_0x4ffd4b,_0x41f540){return db[_0x7bdb('0x16')]['findAll']({'raw':_0x5723f4[_0x7bdb('0x17')]?_0x5723f4[_0x7bdb('0x17')][_0x7bdb('0x18')]===undefined?!![]:![]:!![],'where':_0x5723f4[_0x7bdb('0x17')]?_0x5723f4[_0x7bdb('0x17')]['where']||null:null,'attributes':_0x5723f4['options']?_0x5723f4[_0x7bdb('0x17')][_0x7bdb('0x19')]||null:null,'limit':_0x5723f4['options']?_0x5723f4[_0x7bdb('0x17')][_0x7bdb('0x1a')]||null:null,'include':_0x5723f4[_0x7bdb('0x17')]?_0x5723f4[_0x7bdb('0x17')][_0x7bdb('0x1b')]?_['map'](_0x5723f4[_0x7bdb('0x17')][_0x7bdb('0x1b')],function(_0x40c447){return{'model':db[_0x40c447[_0x7bdb('0x1c')]],'as':_0x40c447['as'],'attributes':_0x40c447['attributes'],'include':_0x40c447['include']?_[_0x7bdb('0x1d')](_0x40c447['include'],function(_0x47abaf){return{'model':db[_0x47abaf['model']],'as':_0x47abaf['as'],'attributes':_0x47abaf[_0x7bdb('0x19')],'include':_0x47abaf['include']?_[_0x7bdb('0x1d')](_0x47abaf[_0x7bdb('0x1b')],function(_0x3ec129){return{'model':db[_0x3ec129[_0x7bdb('0x1c')]],'as':_0x3ec129['as'],'attributes':_0x3ec129[_0x7bdb('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x10e818){logger[_0x7bdb('0xb')](_0x7bdb('0x15'),_0x5723f4);logger[_0x7bdb('0xe')](_0x7bdb('0x15'),_0x5723f4,JSON[_0x7bdb('0x10')](_0x10e818));_0x4ffd4b(_0x10e818);})[_0x7bdb('0x14')](function(_0xd2d7be){logger[_0x7bdb('0x11')](_0x7bdb('0x15'),_0xd2d7be[_0x7bdb('0x12')],_0x5723f4);_0x41f540(_0x2aff6a[_0x7bdb('0x11')](0x1f4,_0xd2d7be['message']));});});};exports[_0x7bdb('0x1e')]=function(_0x23fc3a){var _0x8f7672=this;return new Promise(function(_0x9f5c1,_0x29eac5){return db['VtigerAccount'][_0x7bdb('0x1f')]({'raw':_0x23fc3a[_0x7bdb('0x17')]?_0x23fc3a[_0x7bdb('0x17')][_0x7bdb('0x18')]===undefined?!![]:![]:!![],'where':_0x23fc3a['options']?_0x23fc3a['options']['where']||null:null,'attributes':_0x23fc3a[_0x7bdb('0x17')]?_0x23fc3a['options'][_0x7bdb('0x19')]||null:null,'include':_0x23fc3a['options']?_0x23fc3a[_0x7bdb('0x17')][_0x7bdb('0x1b')]?_[_0x7bdb('0x1d')](_0x23fc3a['options'][_0x7bdb('0x1b')],function(_0x514713){return{'model':db[_0x514713['model']],'as':_0x514713['as'],'attributes':_0x514713[_0x7bdb('0x19')],'include':_0x514713['include']?_[_0x7bdb('0x1d')](_0x514713['include'],function(_0x5ee47d){return{'model':db[_0x5ee47d[_0x7bdb('0x1c')]],'as':_0x5ee47d['as'],'attributes':_0x5ee47d[_0x7bdb('0x19')],'include':_0x5ee47d[_0x7bdb('0x1b')]?_[_0x7bdb('0x1d')](_0x5ee47d[_0x7bdb('0x1b')],function(_0x2bb28a){return{'model':db[_0x2bb28a['model']],'as':_0x2bb28a['as'],'attributes':_0x2bb28a[_0x7bdb('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7bdb('0x20')](function(_0x329ecf){logger[_0x7bdb('0xb')](_0x7bdb('0x1e'),_0x23fc3a);logger[_0x7bdb('0xe')](_0x7bdb('0x1e'),_0x23fc3a,JSON[_0x7bdb('0x10')](_0x329ecf));_0x9f5c1(_0x329ecf);})[_0x7bdb('0x14')](function(_0x4e1c97){logger['error'](_0x7bdb('0x1e'),_0x4e1c97[_0x7bdb('0x12')],_0x23fc3a);_0x29eac5(_0x8f7672[_0x7bdb('0x11')](0x1f4,_0x4e1c97[_0x7bdb('0x12')]));});});}; \ No newline at end of file +var _0x9c00=['lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','findAll','options','where','attributes','limit','include','model','map','GetVtigerAccount','ShowVtigerAccount','VtigerAccount','raw'];(function(_0x259455,_0xcf802d){var _0x169841=function(_0xbc8e61){while(--_0xbc8e61){_0x259455['push'](_0x259455['shift']());}};_0x169841(++_0xcf802d);}(_0x9c00,0x1a0));var _0x09c0=function(_0x4bd795,_0x4b5438){_0x4bd795=_0x4bd795-0x0;var _0x5e37f8=_0x9c00[_0x4bd795];return _0x5e37f8;};'use strict';var _=require(_0x09c0('0x0'));var util=require(_0x09c0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x09c0('0x2'));var fs=require('fs');var Redis=require(_0x09c0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x09c0('0x4'));var logger=require(_0x09c0('0x5'))(_0x09c0('0x6'));var config=require(_0x09c0('0x7'));var jayson=require(_0x09c0('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1f3d7e,_0x17d11f,_0x1b633b){return new BPromise(function(_0x3187aa,_0x17cd9d){return client['request'](_0x1f3d7e,_0x1b633b)[_0x09c0('0x9')](function(_0x1c1246){logger[_0x09c0('0xa')](_0x09c0('0xb'),_0x17d11f,_0x09c0('0xc'));logger[_0x09c0('0xd')](_0x09c0('0xe'),_0x17d11f,_0x09c0('0xc'),JSON[_0x09c0('0xf')](_0x1c1246));if(_0x1c1246[_0x09c0('0x10')]){if(_0x1c1246[_0x09c0('0x10')][_0x09c0('0x11')]===0x1f4){logger[_0x09c0('0x10')](_0x09c0('0xb'),_0x17d11f,_0x1c1246[_0x09c0('0x10')][_0x09c0('0x12')]);return _0x17cd9d(_0x1c1246[_0x09c0('0x10')][_0x09c0('0x12')]);}logger[_0x09c0('0x10')](_0x09c0('0xb'),_0x17d11f,_0x1c1246[_0x09c0('0x10')][_0x09c0('0x12')]);return _0x3187aa(_0x1c1246[_0x09c0('0x10')][_0x09c0('0x12')]);}else{logger[_0x09c0('0xa')](_0x09c0('0xb'),_0x17d11f,'request\x20sent');_0x3187aa(_0x1c1246['result']['message']);}})[_0x09c0('0x13')](function(_0x11f4b2){logger[_0x09c0('0x10')](_0x09c0('0xb'),_0x17d11f,_0x11f4b2);_0x17cd9d(_0x11f4b2);});});}exports['GetVtigerAccount']=function(_0x2c4440){var _0x4aa8a5=this;return new Promise(function(_0x4c29a7,_0x2c12da){return db['VtigerAccount'][_0x09c0('0x14')]({'raw':_0x2c4440[_0x09c0('0x15')]?_0x2c4440[_0x09c0('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x2c4440[_0x09c0('0x15')]?_0x2c4440[_0x09c0('0x15')][_0x09c0('0x16')]||null:null,'attributes':_0x2c4440[_0x09c0('0x15')]?_0x2c4440[_0x09c0('0x15')][_0x09c0('0x17')]||null:null,'limit':_0x2c4440[_0x09c0('0x15')]?_0x2c4440['options'][_0x09c0('0x18')]||null:null,'include':_0x2c4440[_0x09c0('0x15')]?_0x2c4440[_0x09c0('0x15')][_0x09c0('0x19')]?_['map'](_0x2c4440['options'][_0x09c0('0x19')],function(_0x25fdb5){return{'model':db[_0x25fdb5[_0x09c0('0x1a')]],'as':_0x25fdb5['as'],'attributes':_0x25fdb5[_0x09c0('0x17')],'include':_0x25fdb5['include']?_[_0x09c0('0x1b')](_0x25fdb5[_0x09c0('0x19')],function(_0x56d883){return{'model':db[_0x56d883[_0x09c0('0x1a')]],'as':_0x56d883['as'],'attributes':_0x56d883[_0x09c0('0x17')],'include':_0x56d883[_0x09c0('0x19')]?_[_0x09c0('0x1b')](_0x56d883[_0x09c0('0x19')],function(_0x1d2d9d){return{'model':db[_0x1d2d9d[_0x09c0('0x1a')]],'as':_0x1d2d9d['as'],'attributes':_0x1d2d9d[_0x09c0('0x17')]};}):[]};}):[]};}):[]:[]})[_0x09c0('0x9')](function(_0x1aa80e){logger[_0x09c0('0xa')]('GetVtigerAccount',_0x2c4440);logger[_0x09c0('0xd')](_0x09c0('0x1c'),_0x2c4440,JSON['stringify'](_0x1aa80e));_0x4c29a7(_0x1aa80e);})[_0x09c0('0x13')](function(_0x5aa0b9){logger[_0x09c0('0x10')]('GetVtigerAccount',_0x5aa0b9[_0x09c0('0x12')],_0x2c4440);_0x2c12da(_0x4aa8a5[_0x09c0('0x10')](0x1f4,_0x5aa0b9[_0x09c0('0x12')]));});});};exports[_0x09c0('0x1d')]=function(_0x4e999a){var _0x5478b7=this;return new Promise(function(_0x17c374,_0x38a315){return db[_0x09c0('0x1e')]['find']({'raw':_0x4e999a[_0x09c0('0x15')]?_0x4e999a['options'][_0x09c0('0x1f')]===undefined?!![]:![]:!![],'where':_0x4e999a[_0x09c0('0x15')]?_0x4e999a[_0x09c0('0x15')]['where']||null:null,'attributes':_0x4e999a[_0x09c0('0x15')]?_0x4e999a[_0x09c0('0x15')][_0x09c0('0x17')]||null:null,'include':_0x4e999a[_0x09c0('0x15')]?_0x4e999a[_0x09c0('0x15')][_0x09c0('0x19')]?_[_0x09c0('0x1b')](_0x4e999a['options'][_0x09c0('0x19')],function(_0x2c19be){return{'model':db[_0x2c19be[_0x09c0('0x1a')]],'as':_0x2c19be['as'],'attributes':_0x2c19be[_0x09c0('0x17')],'include':_0x2c19be[_0x09c0('0x19')]?_['map'](_0x2c19be[_0x09c0('0x19')],function(_0x20349e){return{'model':db[_0x20349e[_0x09c0('0x1a')]],'as':_0x20349e['as'],'attributes':_0x20349e[_0x09c0('0x17')],'include':_0x20349e[_0x09c0('0x19')]?_['map'](_0x20349e[_0x09c0('0x19')],function(_0x476537){return{'model':db[_0x476537[_0x09c0('0x1a')]],'as':_0x476537['as'],'attributes':_0x476537[_0x09c0('0x17')]};}):[]};}):[]};}):[]:[]})[_0x09c0('0x9')](function(_0x3e8b74){logger[_0x09c0('0xa')]('ShowVtigerAccount',_0x4e999a);logger[_0x09c0('0xd')](_0x09c0('0x1d'),_0x4e999a,JSON[_0x09c0('0xf')](_0x3e8b74));_0x17c374(_0x3e8b74);})[_0x09c0('0x13')](function(_0x453c23){logger['error']('ShowVtigerAccount',_0x453c23['message'],_0x4e999a);_0x38a315(_0x5478b7['error'](0x1f4,_0x453c23[_0x09c0('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index ead3ad6..f949418 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 _0x1ba7=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x4d5a9d,_0x33cbb1){var _0x5d6803=function(_0x5728c0){while(--_0x5728c0){_0x4d5a9d['push'](_0x4d5a9d['shift']());}};_0x5d6803(++_0x33cbb1);}(_0x1ba7,0x7d));var _0x71ba=function(_0x45baf7,_0x46ce25){_0x45baf7=_0x45baf7-0x0;var _0x2a4a93=_0x1ba7[_0x45baf7];return _0x2a4a93;};'use strict';var multer=require(_0x71ba('0x0'));var util=require(_0x71ba('0x1'));var path=require(_0x71ba('0x2'));var timeout=require(_0x71ba('0x3'));var express=require(_0x71ba('0x4'));var router=express[_0x71ba('0x5')]();var fs_extra=require(_0x71ba('0x6'));var auth=require(_0x71ba('0x7'));var interaction=require(_0x71ba('0x8'));var config=require(_0x71ba('0x9'));var controller=require('./intVtigerConfiguration.controller');router[_0x71ba('0xa')]('/',auth[_0x71ba('0xb')](),controller['index']);router[_0x71ba('0xa')](_0x71ba('0xc'),auth['isAuthenticated'](),controller[_0x71ba('0xd')]);router[_0x71ba('0xa')](_0x71ba('0xe'),auth[_0x71ba('0xb')](),controller[_0x71ba('0xf')]);router[_0x71ba('0xa')](_0x71ba('0x10'),auth['isAuthenticated'](),controller[_0x71ba('0x11')]);router[_0x71ba('0xa')](_0x71ba('0x12'),auth[_0x71ba('0xb')](),controller['getDescriptions']);router['post']('/',auth[_0x71ba('0xb')](),controller['create']);router[_0x71ba('0x13')](_0x71ba('0xc'),auth[_0x71ba('0xb')](),controller[_0x71ba('0x14')]);router[_0x71ba('0x15')](_0x71ba('0xc'),auth[_0x71ba('0xb')](),controller[_0x71ba('0x16')]);module[_0x71ba('0x17')]=router; \ No newline at end of file +var _0x0311=['get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./intVtigerConfiguration.controller'];(function(_0xd8de19,_0x1ef229){var _0x5c6b0c=function(_0x4861e8){while(--_0x4861e8){_0xd8de19['push'](_0xd8de19['shift']());}};_0x5c6b0c(++_0x1ef229);}(_0x0311,0x1c0));var _0x1031=function(_0x48d0da,_0x38d905){_0x48d0da=_0x48d0da-0x0;var _0x9d1ad=_0x0311[_0x48d0da];return _0x9d1ad;};'use strict';var multer=require(_0x1031('0x0'));var util=require(_0x1031('0x1'));var path=require(_0x1031('0x2'));var timeout=require(_0x1031('0x3'));var express=require(_0x1031('0x4'));var router=express['Router']();var fs_extra=require(_0x1031('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1031('0x6'));var controller=require(_0x1031('0x7'));router[_0x1031('0x8')]('/',auth[_0x1031('0x9')](),controller[_0x1031('0xa')]);router[_0x1031('0x8')](_0x1031('0xb'),auth[_0x1031('0x9')](),controller['show']);router[_0x1031('0x8')](_0x1031('0xc'),auth[_0x1031('0x9')](),controller[_0x1031('0xd')]);router[_0x1031('0x8')](_0x1031('0xe'),auth['isAuthenticated'](),controller['getSubjects']);router['get'](_0x1031('0xf'),auth[_0x1031('0x9')](),controller[_0x1031('0x10')]);router[_0x1031('0x11')]('/',auth[_0x1031('0x9')](),controller[_0x1031('0x12')]);router[_0x1031('0x13')](_0x1031('0xb'),auth[_0x1031('0x9')](),controller[_0x1031('0x14')]);router[_0x1031('0x15')]('/:id',auth[_0x1031('0x9')](),controller[_0x1031('0x16')]);module[_0x1031('0x17')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index c3928f6..462a88f 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 _0xbc34=['STRING'];(function(_0x38c68c,_0x41608e){var _0x4d424f=function(_0x1c7c6b){while(--_0x1c7c6b){_0x38c68c['push'](_0x38c68c['shift']());}};_0x4d424f(++_0x41608e);}(_0xbc34,0x12d));var _0x4bc3=function(_0x379e38,_0x88cc7d){_0x379e38=_0x379e38-0x0;var _0x3bfc48=_0xbc34[_0x379e38];return _0x3bfc48;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4bc3('0x0')]},'description':{'type':Sequelize[_0x4bc3('0x0')]}}; \ No newline at end of file +var _0xe87e=['STRING','sequelize'];(function(_0x4530d7,_0x42cfcb){var _0x16750a=function(_0x5d2e9a){while(--_0x5d2e9a){_0x4530d7['push'](_0x4530d7['shift']());}};_0x16750a(++_0x42cfcb);}(_0xe87e,0xb1));var _0xee87=function(_0x265aa2,_0x220072){_0x265aa2=_0x265aa2-0x0;var _0x447a3a=_0xe87e[_0x265aa2];return _0x447a3a;};'use strict';var Sequelize=require(_0xee87('0x0'));module['exports']={'name':{'type':Sequelize[_0xee87('0x1')]},'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 0e69439..5e27926 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 _0x103f=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','end','stack','name','send','index','map','VtigerConfiguration','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','rawAttributes','merge','find','create','body','update','getFields','findOne','VtigerField','order','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils'];(function(_0x1d669e,_0x4921c9){var _0x1d1ec7=function(_0x332a50){while(--_0x332a50){_0x1d669e['push'](_0x1d669e['shift']());}};_0x1d1ec7(++_0x4921c9);}(_0x103f,0xe2));var _0xf103=function(_0x3334e8,_0x59ec9d){_0x3334e8=_0x3334e8-0x0;var _0x3ee1ea=_0x103f[_0x3334e8];return _0x3ee1ea;};'use strict';var emlformat=require(_0xf103('0x0'));var rimraf=require(_0xf103('0x1'));var zipdir=require(_0xf103('0x2'));var jsonpatch=require(_0xf103('0x3'));var rp=require(_0xf103('0x4'));var moment=require('moment');var BPromise=require(_0xf103('0x5'));var Mustache=require(_0xf103('0x6'));var util=require(_0xf103('0x7'));var path=require(_0xf103('0x8'));var sox=require(_0xf103('0x9'));var csv=require(_0xf103('0xa'));var ejs=require(_0xf103('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf103('0xc'));var squel=require('squel');var crypto=require(_0xf103('0xd'));var jsforce=require(_0xf103('0xe'));var deskjs=require(_0xf103('0xf'));var toCsv=require(_0xf103('0xa'));var querystring=require(_0xf103('0x10'));var Papa=require(_0xf103('0x11'));var Redis=require(_0xf103('0x12'));var authService=require(_0xf103('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xf103('0x14'));var hardwareService=require(_0xf103('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xf103('0x16'));var config=require(_0xf103('0x17'));var licenseUtil=require(_0xf103('0x18'));var db=require(_0xf103('0x19'))['db'];function respondWithStatusCode(_0x489445,_0x4ea500){_0x4ea500=_0x4ea500||0xcc;return function(_0x4e774b){if(_0x4e774b){return _0x489445[_0xf103('0x1a')](_0x4ea500);}return _0x489445[_0xf103('0x1b')](_0x4ea500)['end']();};}function respondWithResult(_0x299a3d,_0x1e6ec7){_0x1e6ec7=_0x1e6ec7||0xc8;return function(_0x17b557){if(_0x17b557){return _0x299a3d['status'](_0x1e6ec7)[_0xf103('0x1c')](_0x17b557);}};}function respondWithFilteredResult(_0xa78a06,_0x15711a){return function(_0x4c3d04){if(_0x4c3d04){var _0x5cdb3d=typeof _0x15711a[_0xf103('0x1d')]===_0xf103('0x1e')&&typeof _0x15711a[_0xf103('0x1f')]===_0xf103('0x1e');var _0x915d92=_0x4c3d04[_0xf103('0x20')];var _0xa93a41=_0x5cdb3d?0x0:_0x15711a[_0xf103('0x1d')];var _0x57caac=_0x5cdb3d?_0x4c3d04[_0xf103('0x20')]:_0x15711a['offset']+_0x15711a[_0xf103('0x1f')];var _0x4a4138;if(_0x57caac>=_0x915d92){_0x57caac=_0x915d92;_0x4a4138=0xc8;}else{_0x4a4138=0xce;}_0xa78a06[_0xf103('0x1b')](_0x4a4138);return _0xa78a06[_0xf103('0x21')](_0xf103('0x22'),_0xa93a41+'-'+_0x57caac+'/'+_0x915d92)['json'](_0x4c3d04);}return null;};}function patchUpdates(_0xff095f){return function(_0x2c6514){try{jsonpatch['apply'](_0x2c6514,_0xff095f,!![]);}catch(_0x1ff6ee){return BPromise[_0xf103('0x23')](_0x1ff6ee);}return _0x2c6514[_0xf103('0x24')]();};}function saveUpdates(_0x23016a,_0x24722c){return function(_0x30a8e9){if(_0x30a8e9){return _0x30a8e9['update'](_0x23016a)[_0xf103('0x25')](function(_0x4a27c1){return _0x4a27c1;});}return null;};}function removeEntity(_0x5bfbc8,_0xd7195a){return function(_0x14658e){if(_0x14658e){return _0x14658e[_0xf103('0x26')]()[_0xf103('0x25')](function(){_0x5bfbc8[_0xf103('0x1b')](0xcc)[_0xf103('0x27')]();});}};}function handleEntityNotFound(_0x3abc7e,_0x10622b){return function(_0x507a43){if(!_0x507a43){_0x3abc7e[_0xf103('0x1a')](0x194);}return _0x507a43;};}function handleError(_0x191be3,_0x3d6500){_0x3d6500=_0x3d6500||0x1f4;return function(_0x4a4559){logger['error'](_0x4a4559[_0xf103('0x28')]);if(_0x4a4559[_0xf103('0x29')]){delete _0x4a4559[_0xf103('0x29')];}_0x191be3['status'](_0x3d6500)[_0xf103('0x2a')](_0x4a4559);};}exports[_0xf103('0x2b')]=function(_0xe2cf53,_0x542106){var _0x5b50b6={},_0x2d2b2b={},_0x331c10={'count':0x0,'rows':[]};var _0x1517c7=_[_0xf103('0x2c')](db[_0xf103('0x2d')]['rawAttributes'],function(_0x38723c){return{'name':_0x38723c[_0xf103('0x2e')],'type':_0x38723c[_0xf103('0x2f')][_0xf103('0x30')]};});_0x2d2b2b['model']=_['map'](_0x1517c7,_0xf103('0x29'));_0x2d2b2b[_0xf103('0x31')]=_['keys'](_0xe2cf53['query']);_0x2d2b2b[_0xf103('0x32')]=_[_0xf103('0x33')](_0x2d2b2b[_0xf103('0x34')],_0x2d2b2b[_0xf103('0x31')]);_0x5b50b6['attributes']=_[_0xf103('0x33')](_0x2d2b2b[_0xf103('0x34')],qs['fields'](_0xe2cf53[_0xf103('0x31')][_0xf103('0x35')]));_0x5b50b6[_0xf103('0x36')]=_0x5b50b6[_0xf103('0x36')][_0xf103('0x37')]?_0x5b50b6[_0xf103('0x36')]:_0x2d2b2b[_0xf103('0x34')];if(!_0xe2cf53[_0xf103('0x31')][_0xf103('0x38')]('nolimit')){_0x5b50b6[_0xf103('0x1f')]=qs[_0xf103('0x1f')](_0xe2cf53[_0xf103('0x31')][_0xf103('0x1f')]);_0x5b50b6['offset']=qs['offset'](_0xe2cf53[_0xf103('0x31')]['offset']);}_0x5b50b6['order']=qs[_0xf103('0x39')](_0xe2cf53[_0xf103('0x31')][_0xf103('0x39')]);_0x5b50b6[_0xf103('0x3a')]=qs[_0xf103('0x32')](_[_0xf103('0x3b')](_0xe2cf53['query'],_0x2d2b2b[_0xf103('0x32')]),_0x1517c7);if(_0xe2cf53[_0xf103('0x31')][_0xf103('0x3c')]){_0x5b50b6[_0xf103('0x3a')]=_['merge'](_0x5b50b6[_0xf103('0x3a')],{'$or':_['map'](_0x1517c7,function(_0x1dd8cc){if(_0x1dd8cc[_0xf103('0x2f')]!==_0xf103('0x3d')){var _0x3ad7ef={};_0x3ad7ef[_0x1dd8cc[_0xf103('0x29')]]={'$like':'%'+_0xe2cf53['query'][_0xf103('0x3c')]+'%'};return _0x3ad7ef;}})});}_0x5b50b6=_['merge']({},_0x5b50b6,_0xe2cf53[_0xf103('0x3e')]);var _0x12ef04={'where':_0x5b50b6[_0xf103('0x3a')]};return db[_0xf103('0x2d')][_0xf103('0x20')](_0x12ef04)[_0xf103('0x25')](function(_0x5deb84){_0x331c10['count']=_0x5deb84;if(_0xe2cf53['query'][_0xf103('0x3f')]){_0x5b50b6[_0xf103('0x40')]=[{'all':!![]}];}return db[_0xf103('0x2d')][_0xf103('0x41')](_0x5b50b6);})[_0xf103('0x25')](function(_0x2c8e20){_0x331c10['rows']=_0x2c8e20;return _0x331c10;})[_0xf103('0x25')](respondWithFilteredResult(_0x542106,_0x5b50b6))[_0xf103('0x42')](handleError(_0x542106,null));};exports[_0xf103('0x43')]=function(_0x2870ac,_0x4b9607){var _0x2cb118={'raw':![],'where':{'id':_0x2870ac[_0xf103('0x44')]['id']}},_0x188262={};_0x188262[_0xf103('0x34')]=_[_0xf103('0x45')](db[_0xf103('0x2d')][_0xf103('0x46')]);_0x188262[_0xf103('0x31')]=_['keys'](_0x2870ac[_0xf103('0x31')]);_0x188262['filters']=_[_0xf103('0x33')](_0x188262[_0xf103('0x34')],_0x188262['query']);_0x2cb118[_0xf103('0x36')]=_[_0xf103('0x33')](_0x188262[_0xf103('0x34')],qs['fields'](_0x2870ac[_0xf103('0x31')][_0xf103('0x35')]));_0x2cb118[_0xf103('0x36')]=_0x2cb118[_0xf103('0x36')][_0xf103('0x37')]?_0x2cb118[_0xf103('0x36')]:_0x188262[_0xf103('0x34')];if(_0x2870ac[_0xf103('0x31')][_0xf103('0x3f')]){_0x2cb118[_0xf103('0x40')]=[{'all':!![]}];}_0x2cb118=_[_0xf103('0x47')]({},_0x2cb118,_0x2870ac[_0xf103('0x3e')]);return db[_0xf103('0x2d')][_0xf103('0x48')](_0x2cb118)['then'](handleEntityNotFound(_0x4b9607,null))[_0xf103('0x25')](respondWithResult(_0x4b9607,null))['catch'](handleError(_0x4b9607,null));};exports[_0xf103('0x49')]=function(_0x10795c,_0x3af04e){return db[_0xf103('0x2d')][_0xf103('0x49')](_0x10795c[_0xf103('0x4a')],{})[_0xf103('0x25')](respondWithResult(_0x3af04e,0xc9))['catch'](handleError(_0x3af04e,null));};exports[_0xf103('0x4b')]=function(_0x4cb886,_0x43fe87){if(_0x4cb886[_0xf103('0x4a')]['id']){delete _0x4cb886[_0xf103('0x4a')]['id'];}return db[_0xf103('0x2d')][_0xf103('0x48')]({'where':{'id':_0x4cb886[_0xf103('0x44')]['id']}})[_0xf103('0x25')](handleEntityNotFound(_0x43fe87,null))[_0xf103('0x25')](saveUpdates(_0x4cb886['body'],null))[_0xf103('0x25')](respondWithResult(_0x43fe87,null))[_0xf103('0x42')](handleError(_0x43fe87,null));};exports[_0xf103('0x26')]=function(_0xb26c68,_0x15b3df){return db[_0xf103('0x2d')]['find']({'where':{'id':_0xb26c68[_0xf103('0x44')]['id']}})[_0xf103('0x25')](handleEntityNotFound(_0x15b3df,null))[_0xf103('0x25')](removeEntity(_0x15b3df,null))[_0xf103('0x42')](handleError(_0x15b3df,null));};exports[_0xf103('0x4c')]=function(_0x874240,_0x267ea3,_0x10d042){var _0x1d83b8={};var _0xbbb155={};var _0x5cd400;var _0x50f10f;return db[_0xf103('0x2d')][_0xf103('0x4d')]({'where':{'id':_0x874240[_0xf103('0x44')]['id']}})[_0xf103('0x25')](handleEntityNotFound(_0x267ea3,null))[_0xf103('0x25')](function(_0x157016){if(_0x157016){_0x5cd400=_0x157016;_0xbbb155[_0xf103('0x34')]=_['keys'](db[_0xf103('0x4e')][_0xf103('0x46')]);_0xbbb155[_0xf103('0x31')]=_[_0xf103('0x45')](_0x874240[_0xf103('0x31')]);_0xbbb155['filters']=_['intersection'](_0xbbb155['model'],_0xbbb155['query']);_0x1d83b8[_0xf103('0x36')]=_[_0xf103('0x33')](_0xbbb155[_0xf103('0x34')],qs[_0xf103('0x35')](_0x874240[_0xf103('0x31')]['fields']));_0x1d83b8[_0xf103('0x36')]=_0x1d83b8[_0xf103('0x36')][_0xf103('0x37')]?_0x1d83b8[_0xf103('0x36')]:_0xbbb155[_0xf103('0x34')];_0x1d83b8[_0xf103('0x4f')]=qs[_0xf103('0x39')](_0x874240['query'][_0xf103('0x39')]);_0x1d83b8[_0xf103('0x3a')]=qs[_0xf103('0x32')](_['pick'](_0x874240[_0xf103('0x31')],_0xbbb155[_0xf103('0x32')]));if(_0x874240[_0xf103('0x31')]['filter']){_0x1d83b8[_0xf103('0x3a')]=_[_0xf103('0x47')](_0x1d83b8[_0xf103('0x3a')],{'$or':_[_0xf103('0x2c')](_0x1d83b8['attributes'],function(_0x41fdc0){var _0x297fbf={};_0x297fbf[_0x41fdc0]={'$like':'%'+_0x874240[_0xf103('0x31')]['filter']+'%'};return _0x297fbf;})});}_0x1d83b8=_['merge']({},_0x1d83b8,_0x874240[_0xf103('0x3e')]);return _0x5cd400[_0xf103('0x4c')](_0x1d83b8);}})[_0xf103('0x25')](function(_0x2cdae1){if(_0x2cdae1){_0x50f10f=_0x2cdae1[_0xf103('0x37')];if(!_0x874240['query'][_0xf103('0x38')](_0xf103('0x50'))){_0x1d83b8[_0xf103('0x1f')]=qs[_0xf103('0x1f')](_0x874240[_0xf103('0x31')][_0xf103('0x1f')]);_0x1d83b8[_0xf103('0x1d')]=qs[_0xf103('0x1d')](_0x874240[_0xf103('0x31')][_0xf103('0x1d')]);}return _0x5cd400['getFields'](_0x1d83b8);}})[_0xf103('0x25')](function(_0x45cffd){if(_0x45cffd){return _0x45cffd?{'count':_0x50f10f,'rows':_0x45cffd}:null;}})['then'](respondWithResult(_0x267ea3,null))[_0xf103('0x42')](handleError(_0x267ea3,null));};exports['getSubjects']=function(_0x46288d,_0x1b799c,_0x3f9e26){var _0x142bc9={};var _0xb389c1={};var _0x1d9300;var _0xf6e6a0;return db[_0xf103('0x2d')][_0xf103('0x4d')]({'where':{'id':_0x46288d[_0xf103('0x44')]['id']}})[_0xf103('0x25')](handleEntityNotFound(_0x1b799c,null))[_0xf103('0x25')](function(_0xed8d26){if(_0xed8d26){_0x1d9300=_0xed8d26;_0xb389c1[_0xf103('0x34')]=_[_0xf103('0x45')](db[_0xf103('0x4e')][_0xf103('0x46')]);_0xb389c1[_0xf103('0x31')]=_[_0xf103('0x45')](_0x46288d[_0xf103('0x31')]);_0xb389c1[_0xf103('0x32')]=_[_0xf103('0x33')](_0xb389c1[_0xf103('0x34')],_0xb389c1[_0xf103('0x31')]);_0x142bc9['attributes']=_['intersection'](_0xb389c1['model'],qs['fields'](_0x46288d[_0xf103('0x31')][_0xf103('0x35')]));_0x142bc9[_0xf103('0x36')]=_0x142bc9[_0xf103('0x36')][_0xf103('0x37')]?_0x142bc9['attributes']:_0xb389c1[_0xf103('0x34')];_0x142bc9[_0xf103('0x4f')]=qs[_0xf103('0x39')](_0x46288d[_0xf103('0x31')][_0xf103('0x39')]);_0x142bc9[_0xf103('0x3a')]=qs[_0xf103('0x32')](_[_0xf103('0x3b')](_0x46288d['query'],_0xb389c1[_0xf103('0x32')]));if(_0x46288d[_0xf103('0x31')][_0xf103('0x3c')]){_0x142bc9[_0xf103('0x3a')]=_['merge'](_0x142bc9[_0xf103('0x3a')],{'$or':_[_0xf103('0x2c')](_0x142bc9[_0xf103('0x36')],function(_0x58d10b){var _0x3d8e34={};_0x3d8e34[_0x58d10b]={'$like':'%'+_0x46288d[_0xf103('0x31')]['filter']+'%'};return _0x3d8e34;})});}_0x142bc9=_[_0xf103('0x47')]({},_0x142bc9,_0x46288d[_0xf103('0x3e')]);return _0x1d9300[_0xf103('0x51')](_0x142bc9);}})[_0xf103('0x25')](function(_0x51a952){if(_0x51a952){_0xf6e6a0=_0x51a952[_0xf103('0x37')];if(!_0x46288d[_0xf103('0x31')]['hasOwnProperty'](_0xf103('0x50'))){_0x142bc9[_0xf103('0x1f')]=qs[_0xf103('0x1f')](_0x46288d['query'][_0xf103('0x1f')]);_0x142bc9['offset']=qs[_0xf103('0x1d')](_0x46288d[_0xf103('0x31')][_0xf103('0x1d')]);}return _0x1d9300[_0xf103('0x51')](_0x142bc9);}})[_0xf103('0x25')](function(_0x312eb3){if(_0x312eb3){return _0x312eb3?{'count':_0xf6e6a0,'rows':_0x312eb3}:null;}})[_0xf103('0x25')](respondWithResult(_0x1b799c,null))[_0xf103('0x42')](handleError(_0x1b799c,null));};exports['getDescriptions']=function(_0x3e0349,_0x43d95d,_0xbd8df2){var _0x23b779={};var _0x48a14b={};var _0x161b6f;var _0x3168ae;return db[_0xf103('0x2d')][_0xf103('0x4d')]({'where':{'id':_0x3e0349['params']['id']}})[_0xf103('0x25')](handleEntityNotFound(_0x43d95d,null))[_0xf103('0x25')](function(_0x5dc90c){if(_0x5dc90c){_0x161b6f=_0x5dc90c;_0x48a14b[_0xf103('0x34')]=_['keys'](db[_0xf103('0x4e')]['rawAttributes']);_0x48a14b[_0xf103('0x31')]=_[_0xf103('0x45')](_0x3e0349[_0xf103('0x31')]);_0x48a14b[_0xf103('0x32')]=_['intersection'](_0x48a14b[_0xf103('0x34')],_0x48a14b['query']);_0x23b779['attributes']=_[_0xf103('0x33')](_0x48a14b[_0xf103('0x34')],qs['fields'](_0x3e0349['query']['fields']));_0x23b779[_0xf103('0x36')]=_0x23b779[_0xf103('0x36')][_0xf103('0x37')]?_0x23b779[_0xf103('0x36')]:_0x48a14b['model'];_0x23b779['order']=qs['sort'](_0x3e0349[_0xf103('0x31')]['sort']);_0x23b779[_0xf103('0x3a')]=qs[_0xf103('0x32')](_['pick'](_0x3e0349['query'],_0x48a14b[_0xf103('0x32')]));if(_0x3e0349[_0xf103('0x31')][_0xf103('0x3c')]){_0x23b779[_0xf103('0x3a')]=_[_0xf103('0x47')](_0x23b779[_0xf103('0x3a')],{'$or':_[_0xf103('0x2c')](_0x23b779[_0xf103('0x36')],function(_0x26fe0a){var _0x700dfd={};_0x700dfd[_0x26fe0a]={'$like':'%'+_0x3e0349[_0xf103('0x31')][_0xf103('0x3c')]+'%'};return _0x700dfd;})});}_0x23b779=_['merge']({},_0x23b779,_0x3e0349[_0xf103('0x3e')]);return _0x161b6f[_0xf103('0x52')](_0x23b779);}})[_0xf103('0x25')](function(_0x44b9c5){if(_0x44b9c5){_0x3168ae=_0x44b9c5['length'];if(!_0x3e0349[_0xf103('0x31')][_0xf103('0x38')](_0xf103('0x50'))){_0x23b779['limit']=qs[_0xf103('0x1f')](_0x3e0349['query'][_0xf103('0x1f')]);_0x23b779[_0xf103('0x1d')]=qs[_0xf103('0x1d')](_0x3e0349['query']['offset']);}return _0x161b6f['getDescriptions'](_0x23b779);}})[_0xf103('0x25')](function(_0x53245d){if(_0x53245d){return _0x53245d?{'count':_0x3168ae,'rows':_0x53245d}:null;}})[_0xf103('0x25')](respondWithResult(_0x43d95d,null))['catch'](handleError(_0x43d95d,null));}; \ No newline at end of file +var _0x0d7d=['findAll','rows','VtigerConfiguration','includeAll','find','create','body','catch','params','getFields','findOne','VtigerField','order','getSubjects','options','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','end','status','json','limit','undefined','count','offset','apply','update','destroy','sendStatus','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','then','include'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x0d7d,0x191));var _0xd0d7=function(_0x813d0a,_0x4fd3d7){_0x813d0a=_0x813d0a-0x0;var _0x241352=_0x0d7d[_0x813d0a];return _0x241352;};'use strict';var emlformat=require(_0xd0d7('0x0'));var rimraf=require(_0xd0d7('0x1'));var zipdir=require(_0xd0d7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd0d7('0x3'));var moment=require(_0xd0d7('0x4'));var BPromise=require(_0xd0d7('0x5'));var Mustache=require(_0xd0d7('0x6'));var util=require(_0xd0d7('0x7'));var path=require('path');var sox=require(_0xd0d7('0x8'));var csv=require('to-csv');var ejs=require(_0xd0d7('0x9'));var fs=require('fs');var fs_extra=require(_0xd0d7('0xa'));var _=require(_0xd0d7('0xb'));var squel=require(_0xd0d7('0xc'));var crypto=require(_0xd0d7('0xd'));var jsforce=require(_0xd0d7('0xe'));var deskjs=require(_0xd0d7('0xf'));var toCsv=require(_0xd0d7('0x10'));var querystring=require(_0xd0d7('0x11'));var Papa=require(_0xd0d7('0x12'));var Redis=require(_0xd0d7('0x13'));var authService=require(_0xd0d7('0x14'));var qs=require(_0xd0d7('0x15'));var as=require(_0xd0d7('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd0d7('0x17'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd0d7('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1cfeb7,_0x34709f){_0x34709f=_0x34709f||0xcc;return function(_0x1cc7ac){if(_0x1cc7ac){return _0x1cfeb7['sendStatus'](_0x34709f);}return _0x1cfeb7['status'](_0x34709f)[_0xd0d7('0x19')]();};}function respondWithResult(_0x45fba7,_0x59e7db){_0x59e7db=_0x59e7db||0xc8;return function(_0x27600a){if(_0x27600a){return _0x45fba7[_0xd0d7('0x1a')](_0x59e7db)[_0xd0d7('0x1b')](_0x27600a);}};}function respondWithFilteredResult(_0x59a143,_0x308439){return function(_0x2c938f){if(_0x2c938f){var _0x56bc49=typeof _0x308439['offset']==='undefined'&&typeof _0x308439[_0xd0d7('0x1c')]===_0xd0d7('0x1d');var _0x317de6=_0x2c938f[_0xd0d7('0x1e')];var _0x493988=_0x56bc49?0x0:_0x308439['offset'];var _0x158f51=_0x56bc49?_0x2c938f['count']:_0x308439[_0xd0d7('0x1f')]+_0x308439[_0xd0d7('0x1c')];var _0x273b8f;if(_0x158f51>=_0x317de6){_0x158f51=_0x317de6;_0x273b8f=0xc8;}else{_0x273b8f=0xce;}_0x59a143[_0xd0d7('0x1a')](_0x273b8f);return _0x59a143['set']('Content-Range',_0x493988+'-'+_0x158f51+'/'+_0x317de6)['json'](_0x2c938f);}return null;};}function patchUpdates(_0x1efb72){return function(_0x15561f){try{jsonpatch[_0xd0d7('0x20')](_0x15561f,_0x1efb72,!![]);}catch(_0x4027d6){return BPromise['reject'](_0x4027d6);}return _0x15561f['save']();};}function saveUpdates(_0x15572a,_0x1d434a){return function(_0x20f2ec){if(_0x20f2ec){return _0x20f2ec[_0xd0d7('0x21')](_0x15572a)['then'](function(_0x5ea061){return _0x5ea061;});}return null;};}function removeEntity(_0x51ff07,_0x1d4fa3){return function(_0x5e3ade){if(_0x5e3ade){return _0x5e3ade[_0xd0d7('0x22')]()['then'](function(){_0x51ff07[_0xd0d7('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fb1dc,_0x2910a5){return function(_0x4820b7){if(!_0x4820b7){_0x1fb1dc[_0xd0d7('0x23')](0x194);}return _0x4820b7;};}function handleError(_0x4cd519,_0x256c93){_0x256c93=_0x256c93||0x1f4;return function(_0x1e2bdf){logger['error'](_0x1e2bdf['stack']);if(_0x1e2bdf['name']){delete _0x1e2bdf[_0xd0d7('0x24')];}_0x4cd519[_0xd0d7('0x1a')](_0x256c93)[_0xd0d7('0x25')](_0x1e2bdf);};}exports[_0xd0d7('0x26')]=function(_0x3d20f5,_0x354628){var _0x1fe5be={},_0x223b63={},_0x2794b0={'count':0x0,'rows':[]};var _0x3142d0=_[_0xd0d7('0x27')](db['VtigerConfiguration'][_0xd0d7('0x28')],function(_0x3f7728){return{'name':_0x3f7728[_0xd0d7('0x29')],'type':_0x3f7728[_0xd0d7('0x2a')]['key']};});_0x223b63[_0xd0d7('0x2b')]=_[_0xd0d7('0x27')](_0x3142d0,_0xd0d7('0x24'));_0x223b63[_0xd0d7('0x2c')]=_[_0xd0d7('0x2d')](_0x3d20f5[_0xd0d7('0x2c')]);_0x223b63['filters']=_[_0xd0d7('0x2e')](_0x223b63[_0xd0d7('0x2b')],_0x223b63[_0xd0d7('0x2c')]);_0x1fe5be[_0xd0d7('0x2f')]=_['intersection'](_0x223b63['model'],qs[_0xd0d7('0x30')](_0x3d20f5[_0xd0d7('0x2c')][_0xd0d7('0x30')]));_0x1fe5be[_0xd0d7('0x2f')]=_0x1fe5be['attributes'][_0xd0d7('0x31')]?_0x1fe5be[_0xd0d7('0x2f')]:_0x223b63[_0xd0d7('0x2b')];if(!_0x3d20f5['query'][_0xd0d7('0x32')](_0xd0d7('0x33'))){_0x1fe5be[_0xd0d7('0x1c')]=qs[_0xd0d7('0x1c')](_0x3d20f5[_0xd0d7('0x2c')][_0xd0d7('0x1c')]);_0x1fe5be['offset']=qs[_0xd0d7('0x1f')](_0x3d20f5[_0xd0d7('0x2c')][_0xd0d7('0x1f')]);}_0x1fe5be['order']=qs[_0xd0d7('0x34')](_0x3d20f5[_0xd0d7('0x2c')][_0xd0d7('0x34')]);_0x1fe5be['where']=qs[_0xd0d7('0x35')](_[_0xd0d7('0x36')](_0x3d20f5['query'],_0x223b63[_0xd0d7('0x35')]),_0x3142d0);if(_0x3d20f5[_0xd0d7('0x2c')][_0xd0d7('0x37')]){_0x1fe5be[_0xd0d7('0x38')]=_[_0xd0d7('0x39')](_0x1fe5be['where'],{'$or':_[_0xd0d7('0x27')](_0x3142d0,function(_0x2beb44){if(_0x2beb44[_0xd0d7('0x2a')]!==_0xd0d7('0x3a')){var _0x33aaf1={};_0x33aaf1[_0x2beb44[_0xd0d7('0x24')]]={'$like':'%'+_0x3d20f5[_0xd0d7('0x2c')]['filter']+'%'};return _0x33aaf1;}})});}_0x1fe5be=_['merge']({},_0x1fe5be,_0x3d20f5['options']);var _0x46f079={'where':_0x1fe5be['where']};return db['VtigerConfiguration'][_0xd0d7('0x1e')](_0x46f079)[_0xd0d7('0x3b')](function(_0x432d7a){_0x2794b0[_0xd0d7('0x1e')]=_0x432d7a;if(_0x3d20f5[_0xd0d7('0x2c')]['includeAll']){_0x1fe5be[_0xd0d7('0x3c')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0xd0d7('0x3d')](_0x1fe5be);})[_0xd0d7('0x3b')](function(_0x58471d){_0x2794b0[_0xd0d7('0x3e')]=_0x58471d;return _0x2794b0;})['then'](respondWithFilteredResult(_0x354628,_0x1fe5be))['catch'](handleError(_0x354628,null));};exports['show']=function(_0x1f23fe,_0x336383){var _0x2cc1b7={'raw':![],'where':{'id':_0x1f23fe['params']['id']}},_0x14905e={};_0x14905e[_0xd0d7('0x2b')]=_[_0xd0d7('0x2d')](db[_0xd0d7('0x3f')][_0xd0d7('0x28')]);_0x14905e[_0xd0d7('0x2c')]=_[_0xd0d7('0x2d')](_0x1f23fe[_0xd0d7('0x2c')]);_0x14905e[_0xd0d7('0x35')]=_[_0xd0d7('0x2e')](_0x14905e['model'],_0x14905e[_0xd0d7('0x2c')]);_0x2cc1b7[_0xd0d7('0x2f')]=_[_0xd0d7('0x2e')](_0x14905e[_0xd0d7('0x2b')],qs[_0xd0d7('0x30')](_0x1f23fe[_0xd0d7('0x2c')][_0xd0d7('0x30')]));_0x2cc1b7[_0xd0d7('0x2f')]=_0x2cc1b7[_0xd0d7('0x2f')][_0xd0d7('0x31')]?_0x2cc1b7[_0xd0d7('0x2f')]:_0x14905e[_0xd0d7('0x2b')];if(_0x1f23fe['query'][_0xd0d7('0x40')]){_0x2cc1b7[_0xd0d7('0x3c')]=[{'all':!![]}];}_0x2cc1b7=_['merge']({},_0x2cc1b7,_0x1f23fe['options']);return db[_0xd0d7('0x3f')][_0xd0d7('0x41')](_0x2cc1b7)[_0xd0d7('0x3b')](handleEntityNotFound(_0x336383,null))[_0xd0d7('0x3b')](respondWithResult(_0x336383,null))['catch'](handleError(_0x336383,null));};exports[_0xd0d7('0x42')]=function(_0x44e669,_0x3c018a){return db[_0xd0d7('0x3f')][_0xd0d7('0x42')](_0x44e669[_0xd0d7('0x43')],{})['then'](respondWithResult(_0x3c018a,0xc9))[_0xd0d7('0x44')](handleError(_0x3c018a,null));};exports[_0xd0d7('0x21')]=function(_0x1ab843,_0x25f2e2){if(_0x1ab843[_0xd0d7('0x43')]['id']){delete _0x1ab843[_0xd0d7('0x43')]['id'];}return db['VtigerConfiguration'][_0xd0d7('0x41')]({'where':{'id':_0x1ab843[_0xd0d7('0x45')]['id']}})['then'](handleEntityNotFound(_0x25f2e2,null))[_0xd0d7('0x3b')](saveUpdates(_0x1ab843['body'],null))[_0xd0d7('0x3b')](respondWithResult(_0x25f2e2,null))['catch'](handleError(_0x25f2e2,null));};exports[_0xd0d7('0x22')]=function(_0x137386,_0x42a8f6){return db[_0xd0d7('0x3f')][_0xd0d7('0x41')]({'where':{'id':_0x137386['params']['id']}})[_0xd0d7('0x3b')](handleEntityNotFound(_0x42a8f6,null))[_0xd0d7('0x3b')](removeEntity(_0x42a8f6,null))[_0xd0d7('0x44')](handleError(_0x42a8f6,null));};exports[_0xd0d7('0x46')]=function(_0x327a41,_0xde1fef,_0x20a109){var _0x5af671={};var _0x1532e2={};var _0x59e058;var _0xdb764d;return db[_0xd0d7('0x3f')][_0xd0d7('0x47')]({'where':{'id':_0x327a41[_0xd0d7('0x45')]['id']}})[_0xd0d7('0x3b')](handleEntityNotFound(_0xde1fef,null))[_0xd0d7('0x3b')](function(_0x29084d){if(_0x29084d){_0x59e058=_0x29084d;_0x1532e2['model']=_[_0xd0d7('0x2d')](db[_0xd0d7('0x48')][_0xd0d7('0x28')]);_0x1532e2[_0xd0d7('0x2c')]=_[_0xd0d7('0x2d')](_0x327a41[_0xd0d7('0x2c')]);_0x1532e2[_0xd0d7('0x35')]=_['intersection'](_0x1532e2[_0xd0d7('0x2b')],_0x1532e2['query']);_0x5af671[_0xd0d7('0x2f')]=_[_0xd0d7('0x2e')](_0x1532e2[_0xd0d7('0x2b')],qs['fields'](_0x327a41[_0xd0d7('0x2c')]['fields']));_0x5af671[_0xd0d7('0x2f')]=_0x5af671[_0xd0d7('0x2f')][_0xd0d7('0x31')]?_0x5af671[_0xd0d7('0x2f')]:_0x1532e2[_0xd0d7('0x2b')];_0x5af671[_0xd0d7('0x49')]=qs[_0xd0d7('0x34')](_0x327a41['query'][_0xd0d7('0x34')]);_0x5af671['where']=qs[_0xd0d7('0x35')](_[_0xd0d7('0x36')](_0x327a41[_0xd0d7('0x2c')],_0x1532e2['filters']));if(_0x327a41[_0xd0d7('0x2c')][_0xd0d7('0x37')]){_0x5af671[_0xd0d7('0x38')]=_[_0xd0d7('0x39')](_0x5af671[_0xd0d7('0x38')],{'$or':_[_0xd0d7('0x27')](_0x5af671[_0xd0d7('0x2f')],function(_0x344c4d){var _0x159df7={};_0x159df7[_0x344c4d]={'$like':'%'+_0x327a41[_0xd0d7('0x2c')][_0xd0d7('0x37')]+'%'};return _0x159df7;})});}_0x5af671=_['merge']({},_0x5af671,_0x327a41['options']);return _0x59e058[_0xd0d7('0x46')](_0x5af671);}})[_0xd0d7('0x3b')](function(_0xa26d28){if(_0xa26d28){_0xdb764d=_0xa26d28['length'];if(!_0x327a41[_0xd0d7('0x2c')]['hasOwnProperty'](_0xd0d7('0x33'))){_0x5af671[_0xd0d7('0x1c')]=qs[_0xd0d7('0x1c')](_0x327a41['query'][_0xd0d7('0x1c')]);_0x5af671[_0xd0d7('0x1f')]=qs[_0xd0d7('0x1f')](_0x327a41['query'][_0xd0d7('0x1f')]);}return _0x59e058[_0xd0d7('0x46')](_0x5af671);}})['then'](function(_0x54519c){if(_0x54519c){return _0x54519c?{'count':_0xdb764d,'rows':_0x54519c}:null;}})[_0xd0d7('0x3b')](respondWithResult(_0xde1fef,null))[_0xd0d7('0x44')](handleError(_0xde1fef,null));};exports[_0xd0d7('0x4a')]=function(_0x242099,_0x53ff03,_0x10eba8){var _0x37280e={};var _0x4952ee={};var _0x544e64;var _0x242068;return db['VtigerConfiguration'][_0xd0d7('0x47')]({'where':{'id':_0x242099[_0xd0d7('0x45')]['id']}})[_0xd0d7('0x3b')](handleEntityNotFound(_0x53ff03,null))[_0xd0d7('0x3b')](function(_0x471432){if(_0x471432){_0x544e64=_0x471432;_0x4952ee[_0xd0d7('0x2b')]=_[_0xd0d7('0x2d')](db[_0xd0d7('0x48')][_0xd0d7('0x28')]);_0x4952ee['query']=_[_0xd0d7('0x2d')](_0x242099[_0xd0d7('0x2c')]);_0x4952ee['filters']=_[_0xd0d7('0x2e')](_0x4952ee[_0xd0d7('0x2b')],_0x4952ee['query']);_0x37280e[_0xd0d7('0x2f')]=_['intersection'](_0x4952ee[_0xd0d7('0x2b')],qs[_0xd0d7('0x30')](_0x242099[_0xd0d7('0x2c')]['fields']));_0x37280e[_0xd0d7('0x2f')]=_0x37280e[_0xd0d7('0x2f')]['length']?_0x37280e[_0xd0d7('0x2f')]:_0x4952ee[_0xd0d7('0x2b')];_0x37280e[_0xd0d7('0x49')]=qs[_0xd0d7('0x34')](_0x242099[_0xd0d7('0x2c')]['sort']);_0x37280e[_0xd0d7('0x38')]=qs[_0xd0d7('0x35')](_['pick'](_0x242099[_0xd0d7('0x2c')],_0x4952ee[_0xd0d7('0x35')]));if(_0x242099[_0xd0d7('0x2c')][_0xd0d7('0x37')]){_0x37280e[_0xd0d7('0x38')]=_['merge'](_0x37280e[_0xd0d7('0x38')],{'$or':_['map'](_0x37280e['attributes'],function(_0x47ff35){var _0x205363={};_0x205363[_0x47ff35]={'$like':'%'+_0x242099[_0xd0d7('0x2c')][_0xd0d7('0x37')]+'%'};return _0x205363;})});}_0x37280e=_['merge']({},_0x37280e,_0x242099[_0xd0d7('0x4b')]);return _0x544e64[_0xd0d7('0x4a')](_0x37280e);}})['then'](function(_0x36e258){if(_0x36e258){_0x242068=_0x36e258[_0xd0d7('0x31')];if(!_0x242099[_0xd0d7('0x2c')][_0xd0d7('0x32')](_0xd0d7('0x33'))){_0x37280e[_0xd0d7('0x1c')]=qs[_0xd0d7('0x1c')](_0x242099[_0xd0d7('0x2c')][_0xd0d7('0x1c')]);_0x37280e['offset']=qs[_0xd0d7('0x1f')](_0x242099[_0xd0d7('0x2c')][_0xd0d7('0x1f')]);}return _0x544e64[_0xd0d7('0x4a')](_0x37280e);}})[_0xd0d7('0x3b')](function(_0x11da46){if(_0x11da46){return _0x11da46?{'count':_0x242068,'rows':_0x11da46}:null;}})[_0xd0d7('0x3b')](respondWithResult(_0x53ff03,null))[_0xd0d7('0x44')](handleError(_0x53ff03,null));};exports[_0xd0d7('0x4c')]=function(_0x24fa0d,_0x31a8ee,_0x476dee){var _0x5ebcf0={};var _0x152352={};var _0x50b736;var _0x5186d2;return db[_0xd0d7('0x3f')][_0xd0d7('0x47')]({'where':{'id':_0x24fa0d[_0xd0d7('0x45')]['id']}})[_0xd0d7('0x3b')](handleEntityNotFound(_0x31a8ee,null))[_0xd0d7('0x3b')](function(_0x5ef236){if(_0x5ef236){_0x50b736=_0x5ef236;_0x152352[_0xd0d7('0x2b')]=_[_0xd0d7('0x2d')](db[_0xd0d7('0x48')]['rawAttributes']);_0x152352[_0xd0d7('0x2c')]=_['keys'](_0x24fa0d[_0xd0d7('0x2c')]);_0x152352[_0xd0d7('0x35')]=_[_0xd0d7('0x2e')](_0x152352[_0xd0d7('0x2b')],_0x152352[_0xd0d7('0x2c')]);_0x5ebcf0[_0xd0d7('0x2f')]=_[_0xd0d7('0x2e')](_0x152352[_0xd0d7('0x2b')],qs[_0xd0d7('0x30')](_0x24fa0d[_0xd0d7('0x2c')][_0xd0d7('0x30')]));_0x5ebcf0[_0xd0d7('0x2f')]=_0x5ebcf0['attributes'][_0xd0d7('0x31')]?_0x5ebcf0[_0xd0d7('0x2f')]:_0x152352[_0xd0d7('0x2b')];_0x5ebcf0[_0xd0d7('0x49')]=qs[_0xd0d7('0x34')](_0x24fa0d[_0xd0d7('0x2c')][_0xd0d7('0x34')]);_0x5ebcf0[_0xd0d7('0x38')]=qs[_0xd0d7('0x35')](_['pick'](_0x24fa0d[_0xd0d7('0x2c')],_0x152352['filters']));if(_0x24fa0d[_0xd0d7('0x2c')][_0xd0d7('0x37')]){_0x5ebcf0[_0xd0d7('0x38')]=_[_0xd0d7('0x39')](_0x5ebcf0[_0xd0d7('0x38')],{'$or':_[_0xd0d7('0x27')](_0x5ebcf0[_0xd0d7('0x2f')],function(_0x3f0527){var _0x2a3c8a={};_0x2a3c8a[_0x3f0527]={'$like':'%'+_0x24fa0d['query'][_0xd0d7('0x37')]+'%'};return _0x2a3c8a;})});}_0x5ebcf0=_[_0xd0d7('0x39')]({},_0x5ebcf0,_0x24fa0d[_0xd0d7('0x4b')]);return _0x50b736[_0xd0d7('0x4c')](_0x5ebcf0);}})[_0xd0d7('0x3b')](function(_0x3a4e20){if(_0x3a4e20){_0x5186d2=_0x3a4e20['length'];if(!_0x24fa0d[_0xd0d7('0x2c')][_0xd0d7('0x32')](_0xd0d7('0x33'))){_0x5ebcf0[_0xd0d7('0x1c')]=qs[_0xd0d7('0x1c')](_0x24fa0d[_0xd0d7('0x2c')][_0xd0d7('0x1c')]);_0x5ebcf0['offset']=qs[_0xd0d7('0x1f')](_0x24fa0d[_0xd0d7('0x2c')]['offset']);}return _0x50b736[_0xd0d7('0x4c')](_0x5ebcf0);}})['then'](function(_0x12e16e){if(_0x12e16e){return _0x12e16e?{'count':_0x5186d2,'rows':_0x12e16e}:null;}})[_0xd0d7('0x3b')](respondWithResult(_0x31a8ee,null))[_0xd0d7('0x44')](handleError(_0x31a8ee,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 3d80377..ee459cf 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 _0xc5bc=['./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x22262d,_0x2391af){var _0x23ce55=function(_0x569872){while(--_0x569872){_0x22262d['push'](_0x22262d['shift']());}};_0x23ce55(++_0x2391af);}(_0xc5bc,0xad));var _0xcc5b=function(_0x3691b8,_0x5d3f5f){_0x3691b8=_0x3691b8-0x0;var _0x3653ad=_0xc5bc[_0x3691b8];return _0x3653ad;};'use strict';var _=require(_0xcc5b('0x0'));var util=require(_0xcc5b('0x1'));var logger=require(_0xcc5b('0x2'))(_0xcc5b('0x3'));var moment=require(_0xcc5b('0x4'));var BPromise=require(_0xcc5b('0x5'));var rp=require(_0xcc5b('0x6'));var fs=require('fs');var path=require(_0xcc5b('0x7'));var rimraf=require(_0xcc5b('0x8'));var config=require('../../config/environment');var attributes=require(_0xcc5b('0x9'));module[_0xcc5b('0xa')]=function(_0x734c0b,_0x153070){return _0x734c0b[_0xcc5b('0xb')](_0xcc5b('0xc'),attributes,{'tableName':_0xcc5b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0879=['../../config/environment','./intVtigerConfiguration.attributes','exports','define','int_vtiger_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4ecace,_0x40fe00){var _0x41a1d6=function(_0x484825){while(--_0x484825){_0x4ecace['push'](_0x4ecace['shift']());}};_0x41a1d6(++_0x40fe00);}(_0x0879,0x13d));var _0x9087=function(_0x2f8e55,_0x4ff987){_0x2f8e55=_0x2f8e55-0x0;var _0x34746e=_0x0879[_0x2f8e55];return _0x34746e;};'use strict';var _=require(_0x9087('0x0'));var util=require('util');var logger=require(_0x9087('0x1'))(_0x9087('0x2'));var moment=require(_0x9087('0x3'));var BPromise=require(_0x9087('0x4'));var rp=require(_0x9087('0x5'));var fs=require('fs');var path=require(_0x9087('0x6'));var rimraf=require(_0x9087('0x7'));var config=require(_0x9087('0x8'));var attributes=require(_0x9087('0x9'));module[_0x9087('0xa')]=function(_0x3f0e15,_0x48afca){return _0x3f0e15[_0x9087('0xb')]('VtigerConfiguration',attributes,{'tableName':_0x9087('0xc'),'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 e1f3a10..cac131b 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 _0x0650=['jayson/promise','client','http','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0650,0x19e));var _0x0065=function(_0x1ff2ec,_0x386e86){_0x1ff2ec=_0x1ff2ec-0x0;var _0x405683=_0x0650[_0x1ff2ec];return _0x405683;};'use strict';var _=require(_0x0065('0x0'));var util=require(_0x0065('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0065('0x2'));var db=require(_0x0065('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x0065('0x4'))(_0x0065('0x5'));var config=require('../../config/environment');var jayson=require(_0x0065('0x6'));var client=jayson[_0x0065('0x7')][_0x0065('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xe1add9,_0x1286e3,_0x532460){return new BPromise(function(_0x441670,_0x1e991f){return client['request'](_0xe1add9,_0x532460)[_0x0065('0x9')](function(_0x51d1e2){logger[_0x0065('0xa')](_0x0065('0xb'),_0x1286e3,_0x0065('0xc'));logger[_0x0065('0xd')](_0x0065('0xe'),_0x1286e3,_0x0065('0xc'),JSON[_0x0065('0xf')](_0x51d1e2));if(_0x51d1e2[_0x0065('0x10')]){if(_0x51d1e2[_0x0065('0x10')][_0x0065('0x11')]===0x1f4){logger[_0x0065('0x10')]('VtigerConfiguration,\x20%s,\x20%s',_0x1286e3,_0x51d1e2['error']['message']);return _0x1e991f(_0x51d1e2[_0x0065('0x10')][_0x0065('0x12')]);}logger[_0x0065('0x10')](_0x0065('0xb'),_0x1286e3,_0x51d1e2[_0x0065('0x10')]['message']);return _0x441670(_0x51d1e2[_0x0065('0x10')]['message']);}else{logger[_0x0065('0xa')](_0x0065('0xb'),_0x1286e3,'request\x20sent');_0x441670(_0x51d1e2[_0x0065('0x13')][_0x0065('0x12')]);}})[_0x0065('0x14')](function(_0x1ca8c6){logger[_0x0065('0x10')](_0x0065('0xb'),_0x1286e3,_0x1ca8c6);_0x1e991f(_0x1ca8c6);});});} \ No newline at end of file +var _0xe525=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','VtigerConfiguration,\x20%s,\x20%s','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x266472,_0x2786de){var _0x8aeee9=function(_0x33b79d){while(--_0x33b79d){_0x266472['push'](_0x266472['shift']());}};_0x8aeee9(++_0x2786de);}(_0xe525,0x69));var _0x5e52=function(_0x1bf701,_0x191e5a){_0x1bf701=_0x1bf701-0x0;var _0x41215c=_0xe525[_0x1bf701];return _0x41215c;};'use strict';var _=require(_0x5e52('0x0'));var util=require(_0x5e52('0x1'));var moment=require(_0x5e52('0x2'));var BPromise=require(_0x5e52('0x3'));var rs=require(_0x5e52('0x4'));var fs=require('fs');var Redis=require(_0x5e52('0x5'));var db=require(_0x5e52('0x6'))['db'];var utils=require(_0x5e52('0x7'));var logger=require(_0x5e52('0x8'))('rpc');var config=require(_0x5e52('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5e52('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x509588,_0x117803,_0x4b3a01){return new BPromise(function(_0xf973af,_0x9a91a9){return client[_0x5e52('0xb')](_0x509588,_0x4b3a01)[_0x5e52('0xc')](function(_0x468842){logger[_0x5e52('0xd')](_0x5e52('0xe'),_0x117803,'request\x20sent');logger['debug'](_0x5e52('0xf'),_0x117803,_0x5e52('0x10'),JSON[_0x5e52('0x11')](_0x468842));if(_0x468842['error']){if(_0x468842[_0x5e52('0x12')][_0x5e52('0x13')]===0x1f4){logger[_0x5e52('0x12')]('VtigerConfiguration,\x20%s,\x20%s',_0x117803,_0x468842[_0x5e52('0x12')][_0x5e52('0x14')]);return _0x9a91a9(_0x468842[_0x5e52('0x12')][_0x5e52('0x14')]);}logger[_0x5e52('0x12')](_0x5e52('0xe'),_0x117803,_0x468842['error'][_0x5e52('0x14')]);return _0xf973af(_0x468842[_0x5e52('0x12')][_0x5e52('0x14')]);}else{logger['info'](_0x5e52('0xe'),_0x117803,_0x5e52('0x10'));_0xf973af(_0x468842['result']['message']);}})[_0x5e52('0x15')](function(_0x3f6ee7){logger[_0x5e52('0x12')]('VtigerConfiguration,\x20%s,\x20%s',_0x117803,_0x3f6ee7);_0x9a91a9(_0x3f6ee7);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 1204c38..ca7a3e3 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 _0xe87e=['isAuthenticated','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerField.controller','index','get','/:id','show','post'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xe87e,0x1d3));var _0xee87=function(_0x5eb22e,_0x27cbac){_0x5eb22e=_0x5eb22e-0x0;var _0x27fed5=_0xe87e[_0x5eb22e];return _0x27fed5;};'use strict';var multer=require('multer');var util=require(_0xee87('0x0'));var path=require(_0xee87('0x1'));var timeout=require(_0xee87('0x2'));var express=require('express');var router=express[_0xee87('0x3')]();var fs_extra=require(_0xee87('0x4'));var auth=require(_0xee87('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xee87('0x6'));var controller=require(_0xee87('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xee87('0x8')]);router[_0xee87('0x9')](_0xee87('0xa'),auth['isAuthenticated'](),controller[_0xee87('0xb')]);router[_0xee87('0xc')]('/',auth[_0xee87('0xd')](),controller[_0xee87('0xe')]);router[_0xee87('0xf')]('/:id',auth[_0xee87('0xd')](),controller[_0xee87('0x10')]);router[_0xee87('0x11')](_0xee87('0xa'),auth[_0xee87('0xd')](),controller[_0xee87('0x12')]);module[_0xee87('0x13')]=router; \ No newline at end of file +var _0x6f09=['index','/:id','show','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated'];(function(_0x175f20,_0x5118bf){var _0x1436b2=function(_0x600a1d){while(--_0x600a1d){_0x175f20['push'](_0x175f20['shift']());}};_0x1436b2(++_0x5118bf);}(_0x6f09,0x125));var _0x96f0=function(_0x236e4c,_0x537187){_0x236e4c=_0x236e4c-0x0;var _0x5af7cf=_0x6f09[_0x236e4c];return _0x5af7cf;};'use strict';var multer=require('multer');var util=require(_0x96f0('0x0'));var path=require(_0x96f0('0x1'));var timeout=require(_0x96f0('0x2'));var express=require(_0x96f0('0x3'));var router=express[_0x96f0('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x96f0('0x5'));var interaction=require(_0x96f0('0x6'));var config=require(_0x96f0('0x7'));var controller=require(_0x96f0('0x8'));router[_0x96f0('0x9')]('/',auth[_0x96f0('0xa')](),controller[_0x96f0('0xb')]);router['get'](_0x96f0('0xc'),auth[_0x96f0('0xa')](),controller[_0x96f0('0xd')]);router['post']('/',auth[_0x96f0('0xa')](),controller[_0x96f0('0xe')]);router[_0x96f0('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x96f0('0x10')]('/:id',auth[_0x96f0('0xa')](),controller[_0x96f0('0x11')]);module[_0x96f0('0x12')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 85932b4..c8af4bb 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 _0xa5c9=['exports','string','customVariable','keyValue','picklist','STRING','ENUM','variable','BOOLEAN','sequelize'];(function(_0x357e3d,_0xc85358){var _0x5d131b=function(_0x1343f7){while(--_0x1343f7){_0x357e3d['push'](_0x357e3d['shift']());}};_0x5d131b(++_0xc85358);}(_0xa5c9,0x149));var _0x9a5c=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xa5c9[_0x50a0c2];return _0x5ebadd;};'use strict';var Sequelize=require(_0x9a5c('0x0'));module[_0x9a5c('0x1')]={'type':{'type':Sequelize['ENUM'](_0x9a5c('0x2'),'variable',_0x9a5c('0x3'),_0x9a5c('0x4'),_0x9a5c('0x5')),'defaultValue':_0x9a5c('0x2')},'content':{'type':Sequelize[_0x9a5c('0x6')]},'key':{'type':Sequelize[_0x9a5c('0x6')]},'keyType':{'type':Sequelize[_0x9a5c('0x7')](_0x9a5c('0x2'),_0x9a5c('0x8'),_0x9a5c('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x9a5c('0x6')]},'nameField':{'type':Sequelize[_0x9a5c('0x6')]},'customField':{'type':Sequelize[_0x9a5c('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9a5c('0x6')]}}; \ No newline at end of file +var _0xb936=['BOOLEAN','sequelize','exports','ENUM','string','variable','keyValue','picklist','customVariable','STRING'];(function(_0x404e60,_0x483dc3){var _0x5ac33d=function(_0x14e2d2){while(--_0x14e2d2){_0x404e60['push'](_0x404e60['shift']());}};_0x5ac33d(++_0x483dc3);}(_0xb936,0xc9));var _0x6b93=function(_0x57dbe8,_0x566fe4){_0x57dbe8=_0x57dbe8-0x0;var _0x435f6b=_0xb936[_0x57dbe8];return _0x435f6b;};'use strict';var Sequelize=require(_0x6b93('0x0'));module[_0x6b93('0x1')]={'type':{'type':Sequelize[_0x6b93('0x2')](_0x6b93('0x3'),_0x6b93('0x4'),'customVariable',_0x6b93('0x5'),_0x6b93('0x6')),'defaultValue':_0x6b93('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x6b93('0x2')](_0x6b93('0x3'),_0x6b93('0x4'),_0x6b93('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x6b93('0x8')]},'customField':{'type':Sequelize[_0x6b93('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6b93('0x8')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 9be6e25..d61b8c5 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 _0x1538=['../../config/license/util','status','end','json','offset','undefined','limit','count','set','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','VIRTUAL','options','where','includeAll','include','VtigerField','findAll','rows','catch','params','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils'];(function(_0x2a3b86,_0x16ba7d){var _0x17bdb5=function(_0x5392e9){while(--_0x5392e9){_0x2a3b86['push'](_0x2a3b86['shift']());}};_0x17bdb5(++_0x16ba7d);}(_0x1538,0x114));var _0x8153=function(_0x413727,_0x17adb1){_0x413727=_0x413727-0x0;var _0x5f46d7=_0x1538[_0x413727];return _0x5f46d7;};'use strict';var emlformat=require(_0x8153('0x0'));var rimraf=require(_0x8153('0x1'));var zipdir=require(_0x8153('0x2'));var jsonpatch=require(_0x8153('0x3'));var rp=require('request-promise');var moment=require(_0x8153('0x4'));var BPromise=require(_0x8153('0x5'));var Mustache=require(_0x8153('0x6'));var util=require(_0x8153('0x7'));var path=require(_0x8153('0x8'));var sox=require(_0x8153('0x9'));var csv=require(_0x8153('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8153('0xb'));var _=require(_0x8153('0xc'));var squel=require(_0x8153('0xd'));var crypto=require(_0x8153('0xe'));var jsforce=require(_0x8153('0xf'));var deskjs=require(_0x8153('0x10'));var toCsv=require(_0x8153('0xa'));var querystring=require(_0x8153('0x11'));var Papa=require(_0x8153('0x12'));var Redis=require('ioredis');var authService=require(_0x8153('0x13'));var qs=require(_0x8153('0x14'));var as=require(_0x8153('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8153('0x16'));var utils=require(_0x8153('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8153('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x46fff6,_0x20adaf){_0x20adaf=_0x20adaf||0xcc;return function(_0xa495d3){if(_0xa495d3){return _0x46fff6['sendStatus'](_0x20adaf);}return _0x46fff6[_0x8153('0x19')](_0x20adaf)[_0x8153('0x1a')]();};}function respondWithResult(_0x510472,_0x50901a){_0x50901a=_0x50901a||0xc8;return function(_0x59859f){if(_0x59859f){return _0x510472[_0x8153('0x19')](_0x50901a)[_0x8153('0x1b')](_0x59859f);}};}function respondWithFilteredResult(_0x35952a,_0x1bae26){return function(_0x340b9c){if(_0x340b9c){var _0x449e5a=typeof _0x1bae26[_0x8153('0x1c')]===_0x8153('0x1d')&&typeof _0x1bae26[_0x8153('0x1e')]===_0x8153('0x1d');var _0x28b51c=_0x340b9c[_0x8153('0x1f')];var _0x2f6aa2=_0x449e5a?0x0:_0x1bae26['offset'];var _0x30d328=_0x449e5a?_0x340b9c[_0x8153('0x1f')]:_0x1bae26['offset']+_0x1bae26[_0x8153('0x1e')];var _0xec9922;if(_0x30d328>=_0x28b51c){_0x30d328=_0x28b51c;_0xec9922=0xc8;}else{_0xec9922=0xce;}_0x35952a[_0x8153('0x19')](_0xec9922);return _0x35952a[_0x8153('0x20')]('Content-Range',_0x2f6aa2+'-'+_0x30d328+'/'+_0x28b51c)[_0x8153('0x1b')](_0x340b9c);}return null;};}function patchUpdates(_0x405332){return function(_0x2289d3){try{jsonpatch[_0x8153('0x21')](_0x2289d3,_0x405332,!![]);}catch(_0x18c40b){return BPromise['reject'](_0x18c40b);}return _0x2289d3[_0x8153('0x22')]();};}function saveUpdates(_0x573f7d,_0xfc1d0d){return function(_0x5bd897){if(_0x5bd897){return _0x5bd897['update'](_0x573f7d)[_0x8153('0x23')](function(_0x47a530){return _0x47a530;});}return null;};}function removeEntity(_0x47c8e5,_0x541a14){return function(_0x4c37bf){if(_0x4c37bf){return _0x4c37bf[_0x8153('0x24')]()['then'](function(){_0x47c8e5['status'](0xcc)[_0x8153('0x1a')]();});}};}function handleEntityNotFound(_0x300e58,_0x35149a){return function(_0x4fda26){if(!_0x4fda26){_0x300e58[_0x8153('0x25')](0x194);}return _0x4fda26;};}function handleError(_0x4d0e3d,_0x2383ce){_0x2383ce=_0x2383ce||0x1f4;return function(_0x4d366b){logger[_0x8153('0x26')](_0x4d366b[_0x8153('0x27')]);if(_0x4d366b[_0x8153('0x28')]){delete _0x4d366b[_0x8153('0x28')];}_0x4d0e3d[_0x8153('0x19')](_0x2383ce)[_0x8153('0x29')](_0x4d366b);};}exports[_0x8153('0x2a')]=function(_0x5831ad,_0x5e7fac){var _0x352772={},_0x313c9b={},_0x54fb7a={'count':0x0,'rows':[]};var _0x4b4e09=_[_0x8153('0x2b')](db['VtigerField'][_0x8153('0x2c')],function(_0x2855db){return{'name':_0x2855db[_0x8153('0x2d')],'type':_0x2855db['type'][_0x8153('0x2e')]};});_0x313c9b[_0x8153('0x2f')]=_[_0x8153('0x2b')](_0x4b4e09,_0x8153('0x28'));_0x313c9b['query']=_[_0x8153('0x30')](_0x5831ad[_0x8153('0x31')]);_0x313c9b[_0x8153('0x32')]=_[_0x8153('0x33')](_0x313c9b[_0x8153('0x2f')],_0x313c9b['query']);_0x352772[_0x8153('0x34')]=_[_0x8153('0x33')](_0x313c9b['model'],qs[_0x8153('0x35')](_0x5831ad[_0x8153('0x31')][_0x8153('0x35')]));_0x352772[_0x8153('0x34')]=_0x352772['attributes'][_0x8153('0x36')]?_0x352772[_0x8153('0x34')]:_0x313c9b[_0x8153('0x2f')];if(!_0x5831ad[_0x8153('0x31')]['hasOwnProperty'](_0x8153('0x37'))){_0x352772[_0x8153('0x1e')]=qs[_0x8153('0x1e')](_0x5831ad[_0x8153('0x31')][_0x8153('0x1e')]);_0x352772[_0x8153('0x1c')]=qs['offset'](_0x5831ad['query'][_0x8153('0x1c')]);}_0x352772[_0x8153('0x38')]=qs[_0x8153('0x39')](_0x5831ad[_0x8153('0x31')][_0x8153('0x39')]);_0x352772['where']=qs[_0x8153('0x32')](_[_0x8153('0x3a')](_0x5831ad[_0x8153('0x31')],_0x313c9b['filters']),_0x4b4e09);if(_0x5831ad[_0x8153('0x31')][_0x8153('0x3b')]){_0x352772['where']=_[_0x8153('0x3c')](_0x352772['where'],{'$or':_[_0x8153('0x2b')](_0x4b4e09,function(_0x34d084){if(_0x34d084['type']!==_0x8153('0x3d')){var _0x2952c5={};_0x2952c5[_0x34d084['name']]={'$like':'%'+_0x5831ad[_0x8153('0x31')][_0x8153('0x3b')]+'%'};return _0x2952c5;}})});}_0x352772=_[_0x8153('0x3c')]({},_0x352772,_0x5831ad[_0x8153('0x3e')]);var _0x339cba={'where':_0x352772[_0x8153('0x3f')]};return db['VtigerField'][_0x8153('0x1f')](_0x339cba)[_0x8153('0x23')](function(_0x250b72){_0x54fb7a['count']=_0x250b72;if(_0x5831ad[_0x8153('0x31')][_0x8153('0x40')]){_0x352772[_0x8153('0x41')]=[{'all':!![]}];}return db[_0x8153('0x42')][_0x8153('0x43')](_0x352772);})[_0x8153('0x23')](function(_0x35f8c5){_0x54fb7a[_0x8153('0x44')]=_0x35f8c5;return _0x54fb7a;})[_0x8153('0x23')](respondWithFilteredResult(_0x5e7fac,_0x352772))[_0x8153('0x45')](handleError(_0x5e7fac,null));};exports['show']=function(_0x57030a,_0x1f54af){var _0x5d2850={'raw':!![],'where':{'id':_0x57030a[_0x8153('0x46')]['id']}},_0x5978cb={};_0x5978cb[_0x8153('0x2f')]=_['keys'](db[_0x8153('0x42')][_0x8153('0x2c')]);_0x5978cb[_0x8153('0x31')]=_[_0x8153('0x30')](_0x57030a[_0x8153('0x31')]);_0x5978cb[_0x8153('0x32')]=_[_0x8153('0x33')](_0x5978cb['model'],_0x5978cb[_0x8153('0x31')]);_0x5d2850[_0x8153('0x34')]=_[_0x8153('0x33')](_0x5978cb['model'],qs[_0x8153('0x35')](_0x57030a[_0x8153('0x31')][_0x8153('0x35')]));_0x5d2850[_0x8153('0x34')]=_0x5d2850[_0x8153('0x34')]['length']?_0x5d2850[_0x8153('0x34')]:_0x5978cb['model'];if(_0x57030a[_0x8153('0x31')]['includeAll']){_0x5d2850['include']=[{'all':!![]}];}_0x5d2850=_[_0x8153('0x3c')]({},_0x5d2850,_0x57030a[_0x8153('0x3e')]);return db['VtigerField'][_0x8153('0x47')](_0x5d2850)[_0x8153('0x23')](handleEntityNotFound(_0x1f54af,null))[_0x8153('0x23')](respondWithResult(_0x1f54af,null))[_0x8153('0x45')](handleError(_0x1f54af,null));};exports[_0x8153('0x48')]=function(_0x1a2ed9,_0x1eab54){return db[_0x8153('0x42')]['create'](_0x1a2ed9[_0x8153('0x49')],{})[_0x8153('0x23')](respondWithResult(_0x1eab54,0xc9))[_0x8153('0x45')](handleError(_0x1eab54,null));};exports[_0x8153('0x4a')]=function(_0x463442,_0x19b3a8){if(_0x463442[_0x8153('0x49')]['id']){delete _0x463442['body']['id'];}return db[_0x8153('0x42')][_0x8153('0x47')]({'where':{'id':_0x463442[_0x8153('0x46')]['id']}})[_0x8153('0x23')](handleEntityNotFound(_0x19b3a8,null))[_0x8153('0x23')](saveUpdates(_0x463442[_0x8153('0x49')],null))[_0x8153('0x23')](respondWithResult(_0x19b3a8,null))[_0x8153('0x45')](handleError(_0x19b3a8,null));};exports[_0x8153('0x24')]=function(_0x592df3,_0x35591f){return db[_0x8153('0x42')][_0x8153('0x47')]({'where':{'id':_0x592df3[_0x8153('0x46')]['id']}})[_0x8153('0x23')](handleEntityNotFound(_0x35591f,null))[_0x8153('0x23')](removeEntity(_0x35591f,null))['catch'](handleError(_0x35591f,null));}; \ No newline at end of file +var _0xcbd9=['map','rawAttributes','fieldName','type','model','name','query','keys','intersection','fields','attributes','length','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','VtigerField','findAll','rows','catch','show','include','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','end','error','stack','send','index'];(function(_0x4b4f24,_0x5654a8){var _0x1c13d4=function(_0x4940bf){while(--_0x4940bf){_0x4b4f24['push'](_0x4b4f24['shift']());}};_0x1c13d4(++_0x5654a8);}(_0xcbd9,0x162));var _0x9cbd=function(_0x3d2d6e,_0x4b38df){_0x3d2d6e=_0x3d2d6e-0x0;var _0x288153=_0xcbd9[_0x3d2d6e];return _0x288153;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9cbd('0x0'));var zipdir=require(_0x9cbd('0x1'));var jsonpatch=require(_0x9cbd('0x2'));var rp=require(_0x9cbd('0x3'));var moment=require(_0x9cbd('0x4'));var BPromise=require(_0x9cbd('0x5'));var Mustache=require(_0x9cbd('0x6'));var util=require(_0x9cbd('0x7'));var path=require('path');var sox=require(_0x9cbd('0x8'));var csv=require(_0x9cbd('0x9'));var ejs=require(_0x9cbd('0xa'));var fs=require('fs');var fs_extra=require(_0x9cbd('0xb'));var _=require(_0x9cbd('0xc'));var squel=require(_0x9cbd('0xd'));var crypto=require(_0x9cbd('0xe'));var jsforce=require(_0x9cbd('0xf'));var deskjs=require(_0x9cbd('0x10'));var toCsv=require(_0x9cbd('0x9'));var querystring=require(_0x9cbd('0x11'));var Papa=require(_0x9cbd('0x12'));var Redis=require(_0x9cbd('0x13'));var authService=require(_0x9cbd('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x9cbd('0x15'));var hardwareService=require(_0x9cbd('0x16'));var logger=require(_0x9cbd('0x17'))(_0x9cbd('0x18'));var utils=require(_0x9cbd('0x19'));var config=require(_0x9cbd('0x1a'));var licenseUtil=require(_0x9cbd('0x1b'));var db=require(_0x9cbd('0x1c'))['db'];function respondWithStatusCode(_0x41ff57,_0x2ecbbd){_0x2ecbbd=_0x2ecbbd||0xcc;return function(_0x5476a4){if(_0x5476a4){return _0x41ff57['sendStatus'](_0x2ecbbd);}return _0x41ff57[_0x9cbd('0x1d')](_0x2ecbbd)['end']();};}function respondWithResult(_0x5da345,_0xd1ae61){_0xd1ae61=_0xd1ae61||0xc8;return function(_0x318d7e){if(_0x318d7e){return _0x5da345[_0x9cbd('0x1d')](_0xd1ae61)['json'](_0x318d7e);}};}function respondWithFilteredResult(_0x5ded43,_0x1cea08){return function(_0x6dfcc2){if(_0x6dfcc2){var _0x459018=typeof _0x1cea08[_0x9cbd('0x1e')]===_0x9cbd('0x1f')&&typeof _0x1cea08['limit']===_0x9cbd('0x1f');var _0x13c202=_0x6dfcc2['count'];var _0x372ace=_0x459018?0x0:_0x1cea08[_0x9cbd('0x1e')];var _0x5b5704=_0x459018?_0x6dfcc2[_0x9cbd('0x20')]:_0x1cea08[_0x9cbd('0x1e')]+_0x1cea08['limit'];var _0x5b9b9a;if(_0x5b5704>=_0x13c202){_0x5b5704=_0x13c202;_0x5b9b9a=0xc8;}else{_0x5b9b9a=0xce;}_0x5ded43[_0x9cbd('0x1d')](_0x5b9b9a);return _0x5ded43[_0x9cbd('0x21')](_0x9cbd('0x22'),_0x372ace+'-'+_0x5b5704+'/'+_0x13c202)[_0x9cbd('0x23')](_0x6dfcc2);}return null;};}function patchUpdates(_0x443218){return function(_0x1f8849){try{jsonpatch[_0x9cbd('0x24')](_0x1f8849,_0x443218,!![]);}catch(_0x43ffe8){return BPromise['reject'](_0x43ffe8);}return _0x1f8849[_0x9cbd('0x25')]();};}function saveUpdates(_0x1ab4ff,_0x4bd003){return function(_0xb96a86){if(_0xb96a86){return _0xb96a86[_0x9cbd('0x26')](_0x1ab4ff)[_0x9cbd('0x27')](function(_0x5cff8d){return _0x5cff8d;});}return null;};}function removeEntity(_0x585df0,_0x1c1cc6){return function(_0x3458b5){if(_0x3458b5){return _0x3458b5[_0x9cbd('0x28')]()['then'](function(){_0x585df0['status'](0xcc)[_0x9cbd('0x29')]();});}};}function handleEntityNotFound(_0x258e5e,_0x3337f1){return function(_0x4f38f0){if(!_0x4f38f0){_0x258e5e['sendStatus'](0x194);}return _0x4f38f0;};}function handleError(_0x1110a2,_0x576fe3){_0x576fe3=_0x576fe3||0x1f4;return function(_0x334969){logger[_0x9cbd('0x2a')](_0x334969[_0x9cbd('0x2b')]);if(_0x334969['name']){delete _0x334969['name'];}_0x1110a2[_0x9cbd('0x1d')](_0x576fe3)[_0x9cbd('0x2c')](_0x334969);};}exports[_0x9cbd('0x2d')]=function(_0x9f1efd,_0x36f702){var _0x5a28fb={},_0x22735e={},_0x50dd0e={'count':0x0,'rows':[]};var _0x19f59=_[_0x9cbd('0x2e')](db['VtigerField'][_0x9cbd('0x2f')],function(_0x306fa8){return{'name':_0x306fa8[_0x9cbd('0x30')],'type':_0x306fa8[_0x9cbd('0x31')]['key']};});_0x22735e[_0x9cbd('0x32')]=_[_0x9cbd('0x2e')](_0x19f59,_0x9cbd('0x33'));_0x22735e[_0x9cbd('0x34')]=_[_0x9cbd('0x35')](_0x9f1efd[_0x9cbd('0x34')]);_0x22735e['filters']=_[_0x9cbd('0x36')](_0x22735e[_0x9cbd('0x32')],_0x22735e[_0x9cbd('0x34')]);_0x5a28fb['attributes']=_[_0x9cbd('0x36')](_0x22735e[_0x9cbd('0x32')],qs['fields'](_0x9f1efd['query'][_0x9cbd('0x37')]));_0x5a28fb['attributes']=_0x5a28fb[_0x9cbd('0x38')][_0x9cbd('0x39')]?_0x5a28fb['attributes']:_0x22735e[_0x9cbd('0x32')];if(!_0x9f1efd[_0x9cbd('0x34')]['hasOwnProperty'](_0x9cbd('0x3a'))){_0x5a28fb['limit']=qs[_0x9cbd('0x3b')](_0x9f1efd[_0x9cbd('0x34')][_0x9cbd('0x3b')]);_0x5a28fb[_0x9cbd('0x1e')]=qs[_0x9cbd('0x1e')](_0x9f1efd[_0x9cbd('0x34')][_0x9cbd('0x1e')]);}_0x5a28fb[_0x9cbd('0x3c')]=qs[_0x9cbd('0x3d')](_0x9f1efd[_0x9cbd('0x34')]['sort']);_0x5a28fb[_0x9cbd('0x3e')]=qs[_0x9cbd('0x3f')](_[_0x9cbd('0x40')](_0x9f1efd[_0x9cbd('0x34')],_0x22735e[_0x9cbd('0x3f')]),_0x19f59);if(_0x9f1efd['query'][_0x9cbd('0x41')]){_0x5a28fb[_0x9cbd('0x3e')]=_[_0x9cbd('0x42')](_0x5a28fb[_0x9cbd('0x3e')],{'$or':_[_0x9cbd('0x2e')](_0x19f59,function(_0x2f9c18){if(_0x2f9c18[_0x9cbd('0x31')]!==_0x9cbd('0x43')){var _0x355f40={};_0x355f40[_0x2f9c18[_0x9cbd('0x33')]]={'$like':'%'+_0x9f1efd[_0x9cbd('0x34')][_0x9cbd('0x41')]+'%'};return _0x355f40;}})});}_0x5a28fb=_[_0x9cbd('0x42')]({},_0x5a28fb,_0x9f1efd[_0x9cbd('0x44')]);var _0x3c1b99={'where':_0x5a28fb[_0x9cbd('0x3e')]};return db['VtigerField']['count'](_0x3c1b99)[_0x9cbd('0x27')](function(_0x2e47ca){_0x50dd0e['count']=_0x2e47ca;if(_0x9f1efd[_0x9cbd('0x34')][_0x9cbd('0x45')]){_0x5a28fb['include']=[{'all':!![]}];}return db[_0x9cbd('0x46')][_0x9cbd('0x47')](_0x5a28fb);})[_0x9cbd('0x27')](function(_0xf3f1e9){_0x50dd0e[_0x9cbd('0x48')]=_0xf3f1e9;return _0x50dd0e;})['then'](respondWithFilteredResult(_0x36f702,_0x5a28fb))[_0x9cbd('0x49')](handleError(_0x36f702,null));};exports[_0x9cbd('0x4a')]=function(_0x5310b2,_0x242e68){var _0x7c5985={'raw':!![],'where':{'id':_0x5310b2['params']['id']}},_0x3df108={};_0x3df108[_0x9cbd('0x32')]=_[_0x9cbd('0x35')](db[_0x9cbd('0x46')][_0x9cbd('0x2f')]);_0x3df108[_0x9cbd('0x34')]=_[_0x9cbd('0x35')](_0x5310b2['query']);_0x3df108[_0x9cbd('0x3f')]=_[_0x9cbd('0x36')](_0x3df108[_0x9cbd('0x32')],_0x3df108[_0x9cbd('0x34')]);_0x7c5985[_0x9cbd('0x38')]=_['intersection'](_0x3df108[_0x9cbd('0x32')],qs['fields'](_0x5310b2['query']['fields']));_0x7c5985[_0x9cbd('0x38')]=_0x7c5985[_0x9cbd('0x38')][_0x9cbd('0x39')]?_0x7c5985[_0x9cbd('0x38')]:_0x3df108[_0x9cbd('0x32')];if(_0x5310b2[_0x9cbd('0x34')][_0x9cbd('0x45')]){_0x7c5985[_0x9cbd('0x4b')]=[{'all':!![]}];}_0x7c5985=_[_0x9cbd('0x42')]({},_0x7c5985,_0x5310b2[_0x9cbd('0x44')]);return db[_0x9cbd('0x46')][_0x9cbd('0x4c')](_0x7c5985)[_0x9cbd('0x27')](handleEntityNotFound(_0x242e68,null))[_0x9cbd('0x27')](respondWithResult(_0x242e68,null))['catch'](handleError(_0x242e68,null));};exports[_0x9cbd('0x4d')]=function(_0x46a3d5,_0x19d616){return db[_0x9cbd('0x46')][_0x9cbd('0x4d')](_0x46a3d5[_0x9cbd('0x4e')],{})['then'](respondWithResult(_0x19d616,0xc9))[_0x9cbd('0x49')](handleError(_0x19d616,null));};exports[_0x9cbd('0x26')]=function(_0x289b0c,_0x377793){if(_0x289b0c[_0x9cbd('0x4e')]['id']){delete _0x289b0c['body']['id'];}return db[_0x9cbd('0x46')][_0x9cbd('0x4c')]({'where':{'id':_0x289b0c['params']['id']}})['then'](handleEntityNotFound(_0x377793,null))[_0x9cbd('0x27')](saveUpdates(_0x289b0c[_0x9cbd('0x4e')],null))[_0x9cbd('0x27')](respondWithResult(_0x377793,null))['catch'](handleError(_0x377793,null));};exports[_0x9cbd('0x28')]=function(_0x5c40e4,_0x1b93e4){return db['VtigerField'][_0x9cbd('0x4c')]({'where':{'id':_0x5c40e4[_0x9cbd('0x4f')]['id']}})[_0x9cbd('0x27')](handleEntityNotFound(_0x1b93e4,null))['then'](removeEntity(_0x1b93e4,null))[_0x9cbd('0x49')](handleError(_0x1b93e4,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 8ad2927..3293f48 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 _0xf179=['int_vtiger_fields','idField','FieldId','util','../../config/logger','api','bluebird','rimraf','../../config/environment','exports','define','VtigerField'];(function(_0x42b949,_0x5ef2cd){var _0x1bd737=function(_0x5d9af2){while(--_0x5d9af2){_0x42b949['push'](_0x42b949['shift']());}};_0x1bd737(++_0x5ef2cd);}(_0xf179,0xcf));var _0x9f17=function(_0x19b484,_0x39301a){_0x19b484=_0x19b484-0x0;var _0x362a00=_0xf179[_0x19b484];return _0x362a00;};'use strict';var _=require('lodash');var util=require(_0x9f17('0x0'));var logger=require(_0x9f17('0x1'))(_0x9f17('0x2'));var moment=require('moment');var BPromise=require(_0x9f17('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9f17('0x4'));var config=require(_0x9f17('0x5'));var attributes=require('./intVtigerField.attributes');module[_0x9f17('0x6')]=function(_0x6500cc,_0x25c142){return _0x6500cc[_0x9f17('0x7')](_0x9f17('0x8'),attributes,{'tableName':_0x9f17('0x9'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x9f17('0xa'),_0x9f17('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xadc3=['request-promise','path','rimraf','./intVtigerField.attributes','exports','VtigerField','FieldId','lodash','util','../../config/logger','bluebird'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xadc3,0x10f));var _0x3adc=function(_0x290fe7,_0x1878cf){_0x290fe7=_0x290fe7-0x0;var _0x16e7a7=_0xadc3[_0x290fe7];return _0x16e7a7;};'use strict';var _=require(_0x3adc('0x0'));var util=require(_0x3adc('0x1'));var logger=require(_0x3adc('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3adc('0x3'));var rp=require(_0x3adc('0x4'));var fs=require('fs');var path=require(_0x3adc('0x5'));var rimraf=require(_0x3adc('0x6'));var config=require('../../config/environment');var attributes=require(_0x3adc('0x7'));module[_0x3adc('0x8')]=function(_0x54eff7,_0xcd96c5){return _0x54eff7['define'](_0x3adc('0x9'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':['idField',_0x3adc('0xa')],'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 c88dd93..9555048 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 _0x820f=['info','VtigerField,\x20%s,\x20%s','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x28c035,_0x4ad011){var _0x318258=function(_0x372b31){while(--_0x372b31){_0x28c035['push'](_0x28c035['shift']());}};_0x318258(++_0x4ad011);}(_0x820f,0x191));var _0xf820=function(_0x46531,_0x4fc16f){_0x46531=_0x46531-0x0;var _0x58617b=_0x820f[_0x46531];return _0x58617b;};'use strict';var _=require(_0xf820('0x0'));var util=require(_0xf820('0x1'));var moment=require(_0xf820('0x2'));var BPromise=require(_0xf820('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf820('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf820('0x5'));var logger=require(_0xf820('0x6'))(_0xf820('0x7'));var config=require(_0xf820('0x8'));var jayson=require(_0xf820('0x9'));var client=jayson[_0xf820('0xa')][_0xf820('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x124c80,_0x23f105,_0x2bb818){return new BPromise(function(_0x840ad4,_0x20ed8e){return client['request'](_0x124c80,_0x2bb818)[_0xf820('0xc')](function(_0x1be1f9){logger[_0xf820('0xd')](_0xf820('0xe'),_0x23f105,'request\x20sent');logger['debug'](_0xf820('0xf'),_0x23f105,_0xf820('0x10'),JSON[_0xf820('0x11')](_0x1be1f9));if(_0x1be1f9[_0xf820('0x12')]){if(_0x1be1f9[_0xf820('0x12')][_0xf820('0x13')]===0x1f4){logger['error'](_0xf820('0xe'),_0x23f105,_0x1be1f9[_0xf820('0x12')][_0xf820('0x14')]);return _0x20ed8e(_0x1be1f9[_0xf820('0x12')][_0xf820('0x14')]);}logger[_0xf820('0x12')](_0xf820('0xe'),_0x23f105,_0x1be1f9[_0xf820('0x12')]['message']);return _0x840ad4(_0x1be1f9[_0xf820('0x12')][_0xf820('0x14')]);}else{logger[_0xf820('0xd')]('VtigerField,\x20%s,\x20%s',_0x23f105,_0xf820('0x10'));_0x840ad4(_0x1be1f9[_0xf820('0x15')]['message']);}})[_0xf820('0x16')](function(_0xc88c46){logger[_0xf820('0x12')](_0xf820('0xe'),_0x23f105,_0xc88c46);_0x20ed8e(_0xc88c46);});});} \ No newline at end of file +var _0x3b3e=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','debug','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','VtigerField,\x20%s,\x20%s'];(function(_0xbb944b,_0x115e4c){var _0x13aea5=function(_0x2a247e){while(--_0x2a247e){_0xbb944b['push'](_0xbb944b['shift']());}};_0x13aea5(++_0x115e4c);}(_0x3b3e,0x118));var _0xe3b3=function(_0x30488e,_0x3b81be){_0x30488e=_0x30488e-0x0;var _0xd1139e=_0x3b3e[_0x30488e];return _0xd1139e;};'use strict';var _=require(_0xe3b3('0x0'));var util=require(_0xe3b3('0x1'));var moment=require(_0xe3b3('0x2'));var BPromise=require('bluebird');var rs=require(_0xe3b3('0x3'));var fs=require('fs');var Redis=require(_0xe3b3('0x4'));var db=require(_0xe3b3('0x5'))['db'];var utils=require(_0xe3b3('0x6'));var logger=require(_0xe3b3('0x7'))(_0xe3b3('0x8'));var config=require(_0xe3b3('0x9'));var jayson=require(_0xe3b3('0xa'));var client=jayson['client'][_0xe3b3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1783bd,_0x1e392c,_0x510558){return new BPromise(function(_0x1fe090,_0x5dacf6){return client[_0xe3b3('0xc')](_0x1783bd,_0x510558)['then'](function(_0x424bb5){logger['info']('VtigerField,\x20%s,\x20%s',_0x1e392c,'request\x20sent');logger[_0xe3b3('0xd')](_0xe3b3('0xe'),_0x1e392c,_0xe3b3('0xf'),JSON['stringify'](_0x424bb5));if(_0x424bb5[_0xe3b3('0x10')]){if(_0x424bb5[_0xe3b3('0x10')][_0xe3b3('0x11')]===0x1f4){logger[_0xe3b3('0x10')]('VtigerField,\x20%s,\x20%s',_0x1e392c,_0x424bb5[_0xe3b3('0x10')][_0xe3b3('0x12')]);return _0x5dacf6(_0x424bb5['error'][_0xe3b3('0x12')]);}logger['error'](_0xe3b3('0x13'),_0x1e392c,_0x424bb5[_0xe3b3('0x10')]['message']);return _0x1fe090(_0x424bb5[_0xe3b3('0x10')][_0xe3b3('0x12')]);}else{logger['info'](_0xe3b3('0x13'),_0x1e392c,_0xe3b3('0xf'));_0x1fe090(_0x424bb5['result'][_0xe3b3('0x12')]);}})['catch'](function(_0x4400d0){logger[_0xe3b3('0x10')](_0xe3b3('0x13'),_0x1e392c,_0x4400d0);_0x5dacf6(_0x4400d0);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 51a8030..3a2484a 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 _0x3c7c=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','update','exports'];(function(_0x49ecea,_0x30133d){var _0x236dbb=function(_0x186fe1){while(--_0x186fe1){_0x49ecea['push'](_0x49ecea['shift']());}};_0x236dbb(++_0x30133d);}(_0x3c7c,0x17c));var _0xc3c7=function(_0x31b9cf,_0x1a809b){_0x31b9cf=_0x31b9cf-0x0;var _0x357b8a=_0x3c7c[_0x31b9cf];return _0x357b8a;};'use strict';var multer=require(_0xc3c7('0x0'));var util=require(_0xc3c7('0x1'));var path=require(_0xc3c7('0x2'));var timeout=require(_0xc3c7('0x3'));var express=require(_0xc3c7('0x4'));var router=express[_0xc3c7('0x5')]();var fs_extra=require(_0xc3c7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xc3c7('0x7'));var config=require(_0xc3c7('0x8'));var controller=require('./intZendeskAccount.controller');router[_0xc3c7('0x9')]('/',auth[_0xc3c7('0xa')](),controller['index']);router[_0xc3c7('0x9')](_0xc3c7('0xb'),auth[_0xc3c7('0xa')](),controller['show']);router['get'](_0xc3c7('0xc'),auth[_0xc3c7('0xa')](),controller[_0xc3c7('0xd')]);router[_0xc3c7('0x9')](_0xc3c7('0xe'),auth[_0xc3c7('0xa')](),controller[_0xc3c7('0xf')]);router[_0xc3c7('0x10')]('/',auth[_0xc3c7('0xa')](),controller[_0xc3c7('0x11')]);router[_0xc3c7('0x10')](_0xc3c7('0xc'),auth[_0xc3c7('0xa')](),controller['addConfiguration']);router['put'](_0xc3c7('0xb'),auth[_0xc3c7('0xa')](),controller[_0xc3c7('0x12')]);router['delete'](_0xc3c7('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xc3c7('0x13')]=router; \ No newline at end of file +var _0x6764=['update','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','/:id'];(function(_0x576862,_0x167a13){var _0x497827=function(_0x3918b5){while(--_0x3918b5){_0x576862['push'](_0x576862['shift']());}};_0x497827(++_0x167a13);}(_0x6764,0xbe));var _0x4676=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x6764[_0x465a0c];return _0x1e202e;};'use strict';var multer=require('multer');var util=require(_0x4676('0x0'));var path=require(_0x4676('0x1'));var timeout=require(_0x4676('0x2'));var express=require(_0x4676('0x3'));var router=express[_0x4676('0x4')]();var fs_extra=require(_0x4676('0x5'));var auth=require(_0x4676('0x6'));var interaction=require(_0x4676('0x7'));var config=require('../../config/environment');var controller=require('./intZendeskAccount.controller');router[_0x4676('0x8')]('/',auth[_0x4676('0x9')](),controller[_0x4676('0xa')]);router[_0x4676('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x4676('0xb')]);router['get']('/:id/configurations',auth[_0x4676('0x9')](),controller['getConfigurations']);router[_0x4676('0x8')](_0x4676('0xc'),auth[_0x4676('0x9')](),controller[_0x4676('0xd')]);router[_0x4676('0xe')]('/',auth[_0x4676('0x9')](),controller[_0x4676('0xf')]);router[_0x4676('0xe')](_0x4676('0x10'),auth[_0x4676('0x9')](),controller[_0x4676('0x11')]);router[_0x4676('0x12')](_0x4676('0x13'),auth[_0x4676('0x9')](),controller[_0x4676('0x14')]);router['delete']('/:id',auth[_0x4676('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 14c2c5c..19bbaa8 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 _0xe5af=['token','ENUM','integrationTab','newTab','exports','STRING','username','password'];(function(_0x23dde1,_0x44d129){var _0x2e16ff=function(_0x1095eb){while(--_0x1095eb){_0x23dde1['push'](_0x23dde1['shift']());}};_0x2e16ff(++_0x44d129);}(_0xe5af,0x9c));var _0xfe5a=function(_0x58d7d2,_0x1cbd13){_0x58d7d2=_0x58d7d2-0x0;var _0x6ad2be=_0xe5af[_0x58d7d2];return _0x6ad2be;};'use strict';var Sequelize=require('sequelize');module[_0xfe5a('0x0')]={'name':{'type':Sequelize[_0xfe5a('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xfe5a('0x1')],'unique':_0xfe5a('0x2')},'password':{'type':Sequelize[_0xfe5a('0x1')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xfe5a('0x1')],'unique':'remoteUri'},'authType':{'type':Sequelize['ENUM'](_0xfe5a('0x3'),_0xfe5a('0x4')),'defaultValue':'password'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xfe5a('0x5')](_0xfe5a('0x6'),_0xfe5a('0x7')),'defaultValue':_0xfe5a('0x6')}}; \ No newline at end of file +var _0xacd6=['remoteUri','ENUM','password','integrationTab','newTab','sequelize','exports','STRING','username'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0xacd6,0xef));var _0x6acd=function(_0x3cbe1c,_0x4bcabd){_0x3cbe1c=_0x3cbe1c-0x0;var _0x5ee08b=_0xacd6[_0x3cbe1c];return _0x5ee08b;};'use strict';var Sequelize=require(_0x6acd('0x0'));module[_0x6acd('0x1')]={'name':{'type':Sequelize[_0x6acd('0x2')]},'description':{'type':Sequelize[_0x6acd('0x2')]},'username':{'type':Sequelize[_0x6acd('0x2')],'unique':_0x6acd('0x3')},'password':{'type':Sequelize[_0x6acd('0x2')]},'token':{'type':Sequelize[_0x6acd('0x2')]},'remoteUri':{'type':Sequelize[_0x6acd('0x2')],'unique':_0x6acd('0x4')},'authType':{'type':Sequelize[_0x6acd('0x5')](_0x6acd('0x6'),'token'),'defaultValue':_0x6acd('0x6')},'serverUrl':{'type':Sequelize[_0x6acd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x6acd('0x5')](_0x6acd('0x7'),_0x6acd('0x8')),'defaultValue':_0x6acd('0x7')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 3cfa1fb..a0f29dc 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 _0xd64b=['undefined','count','Content-Range','apply','update','then','stack','index','map','ZendeskAccount','rawAttributes','fieldName','type','key','model','name','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','rows','catch','show','params','keys','includeAll','include','merge','options','find','create','body','destroy','getConfigurations','findOne','ZendeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','ZendeskField','Descriptions','getFields','username','password','token','remoteUri','substring','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','toString','base64','Sequelize','ValidationError','subject','description','assignee','remove','position','title','system_field_options','custom_field_options','test','statusCode','error','stringify','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit'];(function(_0x1ce3cc,_0x4f0bfa){var _0x1de825=function(_0x28fa0b){while(--_0x28fa0b){_0x1ce3cc['push'](_0x1ce3cc['shift']());}};_0x1de825(++_0x4f0bfa);}(_0xd64b,0xc1));var _0xbd64=function(_0x5cc5dc,_0x1af669){_0x5cc5dc=_0x5cc5dc-0x0;var _0x421a9c=_0xd64b[_0x5cc5dc];return _0x421a9c;};'use strict';var emlformat=require(_0xbd64('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbd64('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbd64('0x2'));var moment=require(_0xbd64('0x3'));var BPromise=require(_0xbd64('0x4'));var Mustache=require(_0xbd64('0x5'));var util=require(_0xbd64('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(_0xbd64('0x7'));var _=require(_0xbd64('0x8'));var squel=require(_0xbd64('0x9'));var crypto=require(_0xbd64('0xa'));var jsforce=require(_0xbd64('0xb'));var deskjs=require(_0xbd64('0xc'));var toCsv=require(_0xbd64('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbd64('0xe'));var authService=require(_0xbd64('0xf'));var qs=require(_0xbd64('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbd64('0x11'));var logger=require(_0xbd64('0x12'))(_0xbd64('0x13'));var utils=require(_0xbd64('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xbd64('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xbd64('0x16'));function respondWithStatusCode(_0x2729d8,_0x3a941c){_0x3a941c=_0x3a941c||0xcc;return function(_0x2183e2){if(_0x2183e2){return _0x2729d8[_0xbd64('0x17')](_0x3a941c);}return _0x2729d8[_0xbd64('0x18')](_0x3a941c)[_0xbd64('0x19')]();};}function respondWithResult(_0x269e2f,_0x2b5808){_0x2b5808=_0x2b5808||0xc8;return function(_0x4ae471){if(_0x4ae471){return _0x269e2f[_0xbd64('0x18')](_0x2b5808)[_0xbd64('0x1a')](_0x4ae471);}};}function respondWithFilteredResult(_0x3ff550,_0x32fd34){return function(_0x29fc16){if(_0x29fc16){var _0x49a914=typeof _0x32fd34[_0xbd64('0x1b')]==='undefined'&&typeof _0x32fd34[_0xbd64('0x1c')]===_0xbd64('0x1d');var _0x3aef70=_0x29fc16[_0xbd64('0x1e')];var _0x17d015=_0x49a914?0x0:_0x32fd34[_0xbd64('0x1b')];var _0xa5491d=_0x49a914?_0x29fc16[_0xbd64('0x1e')]:_0x32fd34['offset']+_0x32fd34[_0xbd64('0x1c')];var _0x1f618b;if(_0xa5491d>=_0x3aef70){_0xa5491d=_0x3aef70;_0x1f618b=0xc8;}else{_0x1f618b=0xce;}_0x3ff550['status'](_0x1f618b);return _0x3ff550['set'](_0xbd64('0x1f'),_0x17d015+'-'+_0xa5491d+'/'+_0x3aef70)[_0xbd64('0x1a')](_0x29fc16);}return null;};}function patchUpdates(_0x196d21){return function(_0x39e2eb){try{jsonpatch[_0xbd64('0x20')](_0x39e2eb,_0x196d21,!![]);}catch(_0x816e00){return BPromise['reject'](_0x816e00);}return _0x39e2eb['save']();};}function saveUpdates(_0x6038f,_0x41f2f){return function(_0x12f67b){if(_0x12f67b){return _0x12f67b[_0xbd64('0x21')](_0x6038f)['then'](function(_0x51d118){return _0x51d118;});}return null;};}function removeEntity(_0x28497c,_0x4afaff){return function(_0x46ab38){if(_0x46ab38){return _0x46ab38['destroy']()[_0xbd64('0x22')](function(){_0x28497c[_0xbd64('0x18')](0xcc)[_0xbd64('0x19')]();});}};}function handleEntityNotFound(_0x2d0993,_0x5ae417){return function(_0x9d0fb8){if(!_0x9d0fb8){_0x2d0993[_0xbd64('0x17')](0x194);}return _0x9d0fb8;};}function handleError(_0x13f527,_0x2a44d0){_0x2a44d0=_0x2a44d0||0x1f4;return function(_0x4d1563){logger['error'](_0x4d1563[_0xbd64('0x23')]);if(_0x4d1563['name']){delete _0x4d1563['name'];}_0x13f527[_0xbd64('0x18')](_0x2a44d0)['send'](_0x4d1563);};}exports[_0xbd64('0x24')]=function(_0x5300e8,_0x28199c){var _0x5d8c35={},_0x1db9f3={},_0x3c0eaf={'count':0x0,'rows':[]};var _0x3be63a=_[_0xbd64('0x25')](db[_0xbd64('0x26')][_0xbd64('0x27')],function(_0x4ed44a){return{'name':_0x4ed44a[_0xbd64('0x28')],'type':_0x4ed44a[_0xbd64('0x29')][_0xbd64('0x2a')]};});_0x1db9f3[_0xbd64('0x2b')]=_[_0xbd64('0x25')](_0x3be63a,_0xbd64('0x2c'));_0x1db9f3['query']=_['keys'](_0x5300e8[_0xbd64('0x2d')]);_0x1db9f3['filters']=_[_0xbd64('0x2e')](_0x1db9f3[_0xbd64('0x2b')],_0x1db9f3['query']);_0x5d8c35['attributes']=_[_0xbd64('0x2e')](_0x1db9f3['model'],qs['fields'](_0x5300e8[_0xbd64('0x2d')][_0xbd64('0x2f')]));_0x5d8c35[_0xbd64('0x30')]=_0x5d8c35['attributes'][_0xbd64('0x31')]?_0x5d8c35['attributes']:_0x1db9f3[_0xbd64('0x2b')];if(!_0x5300e8[_0xbd64('0x2d')][_0xbd64('0x32')](_0xbd64('0x33'))){_0x5d8c35[_0xbd64('0x1c')]=qs[_0xbd64('0x1c')](_0x5300e8['query']['limit']);_0x5d8c35[_0xbd64('0x1b')]=qs[_0xbd64('0x1b')](_0x5300e8[_0xbd64('0x2d')][_0xbd64('0x1b')]);}_0x5d8c35[_0xbd64('0x34')]=qs[_0xbd64('0x35')](_0x5300e8['query']['sort']);_0x5d8c35[_0xbd64('0x36')]=qs[_0xbd64('0x37')](_[_0xbd64('0x38')](_0x5300e8['query'],_0x1db9f3['filters']),_0x3be63a);if(_0x5300e8[_0xbd64('0x2d')]['filter']){_0x5d8c35[_0xbd64('0x36')]=_['merge'](_0x5d8c35[_0xbd64('0x36')],{'$or':_[_0xbd64('0x25')](_0x3be63a,function(_0x550221){if(_0x550221[_0xbd64('0x29')]!=='VIRTUAL'){var _0x534091={};_0x534091[_0x550221[_0xbd64('0x2c')]]={'$like':'%'+_0x5300e8[_0xbd64('0x2d')][_0xbd64('0x39')]+'%'};return _0x534091;}})});}_0x5d8c35=_['merge']({},_0x5d8c35,_0x5300e8['options']);var _0x5d6bcf={'where':_0x5d8c35[_0xbd64('0x36')]};return db[_0xbd64('0x26')]['count'](_0x5d6bcf)[_0xbd64('0x22')](function(_0x34b19a){_0x3c0eaf[_0xbd64('0x1e')]=_0x34b19a;if(_0x5300e8[_0xbd64('0x2d')]['includeAll']){_0x5d8c35['include']=[{'all':!![]}];}return db[_0xbd64('0x26')]['findAll'](_0x5d8c35);})['then'](function(_0x231fa6){_0x3c0eaf[_0xbd64('0x3a')]=_0x231fa6;return _0x3c0eaf;})[_0xbd64('0x22')](respondWithFilteredResult(_0x28199c,_0x5d8c35))[_0xbd64('0x3b')](handleError(_0x28199c,null));};exports[_0xbd64('0x3c')]=function(_0x3155b3,_0x247775){var _0x762380={'raw':![],'where':{'id':_0x3155b3[_0xbd64('0x3d')]['id']}},_0x4870fd={};_0x4870fd[_0xbd64('0x2b')]=_['keys'](db[_0xbd64('0x26')][_0xbd64('0x27')]);_0x4870fd[_0xbd64('0x2d')]=_[_0xbd64('0x3e')](_0x3155b3[_0xbd64('0x2d')]);_0x4870fd[_0xbd64('0x37')]=_[_0xbd64('0x2e')](_0x4870fd['model'],_0x4870fd[_0xbd64('0x2d')]);_0x762380['attributes']=_[_0xbd64('0x2e')](_0x4870fd['model'],qs[_0xbd64('0x2f')](_0x3155b3[_0xbd64('0x2d')][_0xbd64('0x2f')]));_0x762380['attributes']=_0x762380[_0xbd64('0x30')]['length']?_0x762380['attributes']:_0x4870fd['model'];if(_0x3155b3[_0xbd64('0x2d')][_0xbd64('0x3f')]){_0x762380[_0xbd64('0x40')]=[{'all':!![]}];}_0x762380=_[_0xbd64('0x41')]({},_0x762380,_0x3155b3[_0xbd64('0x42')]);return db[_0xbd64('0x26')][_0xbd64('0x43')](_0x762380)['then'](handleEntityNotFound(_0x247775,null))[_0xbd64('0x22')](respondWithResult(_0x247775,null))[_0xbd64('0x3b')](handleError(_0x247775,null));};exports[_0xbd64('0x44')]=function(_0x4e5efe,_0x105bee){return db[_0xbd64('0x26')][_0xbd64('0x44')](_0x4e5efe[_0xbd64('0x45')],{})[_0xbd64('0x22')](respondWithResult(_0x105bee,0xc9))['catch'](handleError(_0x105bee,null));};exports[_0xbd64('0x21')]=function(_0x1a9ec8,_0x2a8011){if(_0x1a9ec8[_0xbd64('0x45')]['id']){delete _0x1a9ec8['body']['id'];}return db['ZendeskAccount'][_0xbd64('0x43')]({'where':{'id':_0x1a9ec8[_0xbd64('0x3d')]['id']}})[_0xbd64('0x22')](handleEntityNotFound(_0x2a8011,null))[_0xbd64('0x22')](saveUpdates(_0x1a9ec8[_0xbd64('0x45')],null))[_0xbd64('0x22')](respondWithResult(_0x2a8011,null))[_0xbd64('0x3b')](handleError(_0x2a8011,null));};exports[_0xbd64('0x46')]=function(_0x460158,_0x2709b2){return db[_0xbd64('0x26')][_0xbd64('0x43')]({'where':{'id':_0x460158[_0xbd64('0x3d')]['id']}})[_0xbd64('0x22')](handleEntityNotFound(_0x2709b2,null))[_0xbd64('0x22')](removeEntity(_0x2709b2,null))['catch'](handleError(_0x2709b2,null));};exports[_0xbd64('0x47')]=function(_0x4952db,_0x5ede67,_0x552c95){var _0x4aa662={};var _0xced0ca={};var _0x2f56df;var _0x5480f5;return db[_0xbd64('0x26')][_0xbd64('0x48')]({'where':{'id':_0x4952db[_0xbd64('0x3d')]['id']}})['then'](handleEntityNotFound(_0x5ede67,null))[_0xbd64('0x22')](function(_0x371bad){if(_0x371bad){_0x2f56df=_0x371bad;_0xced0ca[_0xbd64('0x2b')]=_[_0xbd64('0x3e')](db[_0xbd64('0x49')][_0xbd64('0x27')]);_0xced0ca['query']=_['keys'](_0x4952db['query']);_0xced0ca[_0xbd64('0x37')]=_[_0xbd64('0x2e')](_0xced0ca[_0xbd64('0x2b')],_0xced0ca[_0xbd64('0x2d')]);_0x4aa662['attributes']=_[_0xbd64('0x2e')](_0xced0ca[_0xbd64('0x2b')],qs[_0xbd64('0x2f')](_0x4952db[_0xbd64('0x2d')][_0xbd64('0x2f')]));_0x4aa662[_0xbd64('0x30')]=_0x4aa662['attributes'][_0xbd64('0x31')]?_0x4aa662[_0xbd64('0x30')]:_0xced0ca[_0xbd64('0x2b')];_0x4aa662[_0xbd64('0x34')]=qs[_0xbd64('0x35')](_0x4952db[_0xbd64('0x2d')][_0xbd64('0x35')]);_0x4aa662[_0xbd64('0x36')]=qs[_0xbd64('0x37')](_[_0xbd64('0x38')](_0x4952db[_0xbd64('0x2d')],_0xced0ca[_0xbd64('0x37')]));if(_0x4952db['query']['filter']){_0x4aa662[_0xbd64('0x36')]=_[_0xbd64('0x41')](_0x4aa662['where'],{'$or':_['map'](_0x4aa662[_0xbd64('0x30')],function(_0x12bc56){var _0x49051a={};_0x49051a[_0x12bc56]={'$like':'%'+_0x4952db[_0xbd64('0x2d')][_0xbd64('0x39')]+'%'};return _0x49051a;})});}_0x4aa662=_[_0xbd64('0x41')]({},_0x4aa662,_0x4952db[_0xbd64('0x42')]);return _0x2f56df[_0xbd64('0x47')](_0x4aa662);}})[_0xbd64('0x22')](function(_0x2d788){if(_0x2d788){_0x5480f5=_0x2d788[_0xbd64('0x31')];if(!_0x4952db[_0xbd64('0x2d')]['hasOwnProperty'](_0xbd64('0x33'))){_0x4aa662[_0xbd64('0x1c')]=qs[_0xbd64('0x1c')](_0x4952db['query'][_0xbd64('0x1c')]);_0x4aa662[_0xbd64('0x1b')]=qs['offset'](_0x4952db[_0xbd64('0x2d')][_0xbd64('0x1b')]);}return _0x2f56df[_0xbd64('0x47')](_0x4aa662);}})[_0xbd64('0x22')](function(_0x3615bc){if(_0x3615bc){return _0x3615bc?{'count':_0x5480f5,'rows':_0x3615bc}:null;}})[_0xbd64('0x22')](respondWithResult(_0x5ede67,null))['catch'](handleError(_0x5ede67,null));};exports[_0xbd64('0x4a')]=function(_0x1f3bd0,_0xc57eb1,_0x28d899){if(_0x1f3bd0['body']['id']){delete _0x1f3bd0[_0xbd64('0x45')]['id'];}return db[_0xbd64('0x26')]['findOne']({'where':{'id':_0x1f3bd0[_0xbd64('0x3d')]['id']}})['then'](handleEntityNotFound(_0xc57eb1,null))[_0xbd64('0x22')](function(_0x10e269){if(_0x10e269){_0x1f3bd0[_0xbd64('0x45')][_0xbd64('0x4b')]=_0x10e269['id'];_0x1f3bd0['body'][_0xbd64('0x4c')]=integrations[_0xbd64('0x4d')](_0x1f3bd0[_0xbd64('0x45')][_0xbd64('0x4e')],_0x1f3bd0[_0xbd64('0x45')][_0xbd64('0x29')]);_0x1f3bd0['body']['Descriptions']=integrations['getDescriptions'](_0x1f3bd0[_0xbd64('0x45')][_0xbd64('0x4e')],_0x1f3bd0[_0xbd64('0x45')][_0xbd64('0x29')]);return db[_0xbd64('0x49')][_0xbd64('0x44')](_0x1f3bd0['body'],{'include':[{'model':db[_0xbd64('0x4f')],'as':_0xbd64('0x4c')},{'model':db[_0xbd64('0x4f')],'as':_0xbd64('0x50')}]});}return null;})[_0xbd64('0x22')](respondWithResult(_0xc57eb1,null))[_0xbd64('0x3b')](handleError(_0xc57eb1,null));};exports[_0xbd64('0x51')]=function(_0x3d7e47,_0x301f42,_0x18e724){var _0x32e611='';return db[_0xbd64('0x26')]['findOne']({'where':{'id':_0x3d7e47['params']['id']},'attributes':['id',_0xbd64('0x52'),_0xbd64('0x53'),_0xbd64('0x54'),'authType',_0xbd64('0x55')]})['then'](handleEntityNotFound(_0x301f42,null))[_0xbd64('0x22')](function(_0x36ebb5){if(_0x36ebb5){_0x32e611=_0x36ebb5[_0xbd64('0x55')];var _0x819774=_0x32e611['slice'](-0x1);if(_0x819774==='/'){_0x32e611=_0x32e611[_0xbd64('0x56')](0x0,_0x32e611['lastIndexOf'](_0x819774));}var _0x14f79e={'method':_0xbd64('0x57'),'uri':util[_0xbd64('0x58')](_0xbd64('0x59'),_0x32e611,_0xbd64('0x5a')),'json':!![]};switch(_0x36ebb5['authType']){case _0xbd64('0x53'):_0x14f79e[_0xbd64('0x5b')]={'Authorization':util['format'](_0xbd64('0x5c'),new Buffer(util[_0xbd64('0x58')](_0xbd64('0x5d'),_0x36ebb5[_0xbd64('0x52')],_0x36ebb5['password']))[_0xbd64('0x5e')]('base64'))};break;case _0xbd64('0x54'):_0x14f79e[_0xbd64('0x5b')]={'Authorization':util[_0xbd64('0x58')]('Basic\x20%s',new Buffer(util['format']('%s/token:%s',_0x36ebb5['username'],_0x36ebb5[_0xbd64('0x54')]))[_0xbd64('0x5e')](_0xbd64('0x5f')))};break;default:throw new db[(_0xbd64('0x60'))][(_0xbd64('0x61'))]('Unknown\x20authentication\x20type');}return rp(_0x14f79e);}})[_0xbd64('0x22')](function(_0x23de71){if(_0x23de71){var _0xac13e6=[_0xbd64('0x62'),_0xbd64('0x63'),'group',_0xbd64('0x64')];_[_0xbd64('0x65')](_0x23de71[_0xbd64('0x5a')],function(_0x808467){return _0xac13e6['includes'](_0x808467['type']);});return{'count':_0x23de71[_0xbd64('0x5a')][_0xbd64('0x31')],'rows':_[_0xbd64('0x25')](_0x23de71[_0xbd64('0x5a')],function(_0x18b0f0){return{'id':_0x18b0f0['id'],'name':_0x18b0f0[_0xbd64('0x66')]>0x7?_0x18b0f0[_0xbd64('0x67')]:_0x18b0f0[_0xbd64('0x29')],'custom':_0x18b0f0['position']>0x7?!![]:![],'options':_0x18b0f0[_0xbd64('0x68')]?_0x18b0f0['system_field_options']:_0x18b0f0[_0xbd64('0x69')]?_0x18b0f0[_0xbd64('0x69')]:[]};})};}})[_0xbd64('0x22')](respondWithResult(_0x301f42,null))['catch'](function(_0x15b625){var _0x5c30f9=_0x3d7e47['query'][_0xbd64('0x6a')]?0x1f4:_0x15b625[_0xbd64('0x6b')]||0x1f4;logger[_0xbd64('0x6c')]('getFields,\x20%s,\x20%s,\x20%s',_0xbd64('0x51'),_0x5c30f9,JSON[_0xbd64('0x6d')](_0x15b625));delete _0x15b625[_0xbd64('0x2c')];if(_0x5c30f9===0x191){_0x5c30f9=0x190;}_0x301f42[_0xbd64('0x18')](_0x5c30f9)['send'](_0x3d7e47[_0xbd64('0x2d')][_0xbd64('0x6a')]?{'message':_0xbd64('0x6e'),'statusCode':_0x15b625[_0xbd64('0x6b')]}:_0x15b625);});}; \ No newline at end of file +var _0x7072=['model','query','keys','filters','intersection','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ZendeskAccount','count','includeAll','findAll','catch','show','fields','length','include','find','create','body','params','getConfigurations','findOne','ZendeskConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','password','token','authType','remoteUri','slice','substring','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','username','toString','base64','%s/token:%s','Unknown\x20authentication\x20type','subject','description','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','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(_0x3e6d5d,_0x264c7a){var _0x238923=function(_0x201b19){while(--_0x201b19){_0x3e6d5d['push'](_0x3e6d5d['shift']());}};_0x238923(++_0x264c7a);}(_0x7072,0x138));var _0x2707=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x7072[_0x2dea24];return _0x309d58;};'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['ZendeskAccount'][_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['ZendeskAccount'][_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['ZendeskAccount'][_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['ZendeskAccount']['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['ZendeskAccount']['findOne']({'where':{'id':_0x354322[_0x2707('0x4b')]['id']},'attributes':['id','username',_0x2707('0x59'),_0x2707('0x5a'),_0x2707('0x5b'),_0x2707('0x5c')]})[_0x2707('0x26')](handleEntityNotFound(_0x42da4e,null))[_0x2707('0x26')](function(_0x5bb260){if(_0x5bb260){_0x2af149=_0x5bb260[_0x2707('0x5c')];var _0x4787d7=_0x2af149[_0x2707('0x5d')](-0x1);if(_0x4787d7==='/'){_0x2af149=_0x2af149[_0x2707('0x5e')](0x0,_0x2af149['lastIndexOf'](_0x4787d7));}var _0x155c4f={'method':_0x2707('0x5f'),'uri':util[_0x2707('0x60')](_0x2707('0x61'),_0x2af149,_0x2707('0x62')),'json':!![]};switch(_0x5bb260['authType']){case _0x2707('0x59'):_0x155c4f[_0x2707('0x63')]={'Authorization':util[_0x2707('0x60')](_0x2707('0x64'),new Buffer(util[_0x2707('0x60')](_0x2707('0x65'),_0x5bb260[_0x2707('0x66')],_0x5bb260[_0x2707('0x59')]))[_0x2707('0x67')](_0x2707('0x68')))};break;case _0x2707('0x5a'):_0x155c4f[_0x2707('0x63')]={'Authorization':util[_0x2707('0x60')](_0x2707('0x64'),new Buffer(util[_0x2707('0x60')](_0x2707('0x69'),_0x5bb260[_0x2707('0x66')],_0x5bb260[_0x2707('0x5a')]))['toString'](_0x2707('0x68')))};break;default:throw new db['Sequelize']['ValidationError'](_0x2707('0x6a'));}return rp(_0x155c4f);}})[_0x2707('0x26')](function(_0x35a62c){if(_0x35a62c){var _0x11ac13=[_0x2707('0x6b'),_0x2707('0x6c'),'group',_0x2707('0x6d')];_[_0x2707('0x6e')](_0x35a62c[_0x2707('0x62')],function(_0x54009a){return _0x11ac13[_0x2707('0x6f')](_0x54009a[_0x2707('0x2f')]);});return{'count':_0x35a62c[_0x2707('0x62')][_0x2707('0x46')],'rows':_['map'](_0x35a62c[_0x2707('0x62')],function(_0x5c68d6){return{'id':_0x5c68d6['id'],'name':_0x5c68d6[_0x2707('0x70')]>0x7?_0x5c68d6[_0x2707('0x71')]:_0x5c68d6[_0x2707('0x2f')],'custom':_0x5c68d6[_0x2707('0x70')]>0x7?!![]:![],'options':_0x5c68d6[_0x2707('0x72')]?_0x5c68d6[_0x2707('0x72')]:_0x5c68d6[_0x2707('0x73')]?_0x5c68d6[_0x2707('0x73')]:[]};})};}})[_0x2707('0x26')](respondWithResult(_0x42da4e,null))['catch'](function(_0x4530bc){var _0x5a1a24=_0x354322[_0x2707('0x31')][_0x2707('0x74')]?0x1f4:_0x4530bc[_0x2707('0x75')]||0x1f4;logger[_0x2707('0x28')](_0x2707('0x76'),_0x2707('0x58'),_0x5a1a24,JSON['stringify'](_0x4530bc));delete _0x4530bc['name'];if(_0x5a1a24===0x191){_0x5a1a24=0x190;}_0x42da4e[_0x2707('0x1b')](_0x5a1a24)['send'](_0x354322[_0x2707('0x31')][_0x2707('0x74')]?{'message':_0x2707('0x77'),'statusCode':_0x4530bc[_0x2707('0x75')]}:_0x4530bc);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 399df5f..7995260 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 _0x99c0=['define','ZendeskAccount','lodash','../../config/logger','api','rimraf','../../config/environment','../../components/integrations/configuration'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x99c0,0x1ba));var _0x099c=function(_0x1c7e9f,_0x204da1){_0x1c7e9f=_0x1c7e9f-0x0;var _0x5beb22=_0x99c0[_0x1c7e9f];return _0x5beb22;};'use strict';var _=require(_0x099c('0x0'));var util=require('util');var logger=require(_0x099c('0x1'))(_0x099c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x099c('0x3'));var config=require(_0x099c('0x4'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x099c('0x5'));module['exports']=function(_0x537e76,_0x42ee11){return _0x537e76[_0x099c('0x6')](_0x099c('0x7'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x23ca=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts'];(function(_0x277846,_0x453cd4){var _0xd2590a=function(_0x3f2c46){while(--_0x3f2c46){_0x277846['push'](_0x277846['shift']());}};_0xd2590a(++_0x453cd4);}(_0x23ca,0xee));var _0xa23c=function(_0x4dad7b,_0x4a17b0){_0x4dad7b=_0x4dad7b-0x0;var _0xc04d92=_0x23ca[_0x4dad7b];return _0xc04d92;};'use strict';var _=require(_0xa23c('0x0'));var util=require(_0xa23c('0x1'));var logger=require('../../config/logger')(_0xa23c('0x2'));var moment=require(_0xa23c('0x3'));var BPromise=require(_0xa23c('0x4'));var rp=require(_0xa23c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa23c('0x6'));var config=require(_0xa23c('0x7'));var attributes=require(_0xa23c('0x8'));var integrations=require(_0xa23c('0x9'));module[_0xa23c('0xa')]=function(_0x10dcef,_0x3a2ff4){return _0x10dcef[_0xa23c('0xb')](_0xa23c('0xc'),attributes,{'tableName':_0xa23c('0xd'),'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 6d48782..96fb630 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 _0x6841=['message','ZendeskAccount,\x20%s,\x20%s','result','catch','GetZendeskAccount','ZendeskAccount','options','raw','where','attributes','include','map','model','ShowZendeskAccount','find','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5e991f,_0x19af3d){var _0x5531f=function(_0x3f0832){while(--_0x3f0832){_0x5e991f['push'](_0x5e991f['shift']());}};_0x5531f(++_0x19af3d);}(_0x6841,0x185));var _0x1684=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x6841[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0x1684('0x0'));var util=require('util');var moment=require(_0x1684('0x1'));var BPromise=require(_0x1684('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1684('0x3'));var db=require(_0x1684('0x4'))['db'];var utils=require(_0x1684('0x5'));var logger=require(_0x1684('0x6'))(_0x1684('0x7'));var config=require(_0x1684('0x8'));var jayson=require(_0x1684('0x9'));var client=jayson[_0x1684('0xa')][_0x1684('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x14f7ab,_0x205f3b,_0x2b20db){return new BPromise(function(_0x4cadcd,_0x49ff9f){return client['request'](_0x14f7ab,_0x2b20db)[_0x1684('0xc')](function(_0xf7dd36){logger[_0x1684('0xd')]('ZendeskAccount,\x20%s,\x20%s',_0x205f3b,_0x1684('0xe'));logger[_0x1684('0xf')](_0x1684('0x10'),_0x205f3b,_0x1684('0xe'),JSON[_0x1684('0x11')](_0xf7dd36));if(_0xf7dd36[_0x1684('0x12')]){if(_0xf7dd36[_0x1684('0x12')]['code']===0x1f4){logger[_0x1684('0x12')]('ZendeskAccount,\x20%s,\x20%s',_0x205f3b,_0xf7dd36[_0x1684('0x12')][_0x1684('0x13')]);return _0x49ff9f(_0xf7dd36[_0x1684('0x12')][_0x1684('0x13')]);}logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x205f3b,_0xf7dd36[_0x1684('0x12')]['message']);return _0x4cadcd(_0xf7dd36[_0x1684('0x12')][_0x1684('0x13')]);}else{logger[_0x1684('0xd')](_0x1684('0x14'),_0x205f3b,_0x1684('0xe'));_0x4cadcd(_0xf7dd36[_0x1684('0x15')][_0x1684('0x13')]);}})[_0x1684('0x16')](function(_0x3dc266){logger[_0x1684('0x12')]('ZendeskAccount,\x20%s,\x20%s',_0x205f3b,_0x3dc266);_0x49ff9f(_0x3dc266);});});}exports[_0x1684('0x17')]=function(_0x20eecf){var _0x12efd9=this;return new Promise(function(_0x2b9601,_0x14b561){return db[_0x1684('0x18')]['findAll']({'raw':_0x20eecf[_0x1684('0x19')]?_0x20eecf[_0x1684('0x19')][_0x1684('0x1a')]===undefined?!![]:![]:!![],'where':_0x20eecf[_0x1684('0x19')]?_0x20eecf[_0x1684('0x19')][_0x1684('0x1b')]||null:null,'attributes':_0x20eecf['options']?_0x20eecf['options'][_0x1684('0x1c')]||null:null,'limit':_0x20eecf[_0x1684('0x19')]?_0x20eecf[_0x1684('0x19')]['limit']||null:null,'include':_0x20eecf[_0x1684('0x19')]?_0x20eecf[_0x1684('0x19')][_0x1684('0x1d')]?_[_0x1684('0x1e')](_0x20eecf['options'][_0x1684('0x1d')],function(_0x5caac3){return{'model':db[_0x5caac3['model']],'as':_0x5caac3['as'],'attributes':_0x5caac3['attributes'],'include':_0x5caac3[_0x1684('0x1d')]?_[_0x1684('0x1e')](_0x5caac3[_0x1684('0x1d')],function(_0x451870){return{'model':db[_0x451870[_0x1684('0x1f')]],'as':_0x451870['as'],'attributes':_0x451870[_0x1684('0x1c')],'include':_0x451870[_0x1684('0x1d')]?_[_0x1684('0x1e')](_0x451870[_0x1684('0x1d')],function(_0x72da6c){return{'model':db[_0x72da6c[_0x1684('0x1f')]],'as':_0x72da6c['as'],'attributes':_0x72da6c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5ba242){logger[_0x1684('0xd')](_0x1684('0x17'),_0x20eecf);logger[_0x1684('0xf')]('GetZendeskAccount',_0x20eecf,JSON['stringify'](_0x5ba242));_0x2b9601(_0x5ba242);})[_0x1684('0x16')](function(_0x5f2fc8){logger[_0x1684('0x12')]('GetZendeskAccount',_0x5f2fc8[_0x1684('0x13')],_0x20eecf);_0x14b561(_0x12efd9[_0x1684('0x12')](0x1f4,_0x5f2fc8['message']));});});};exports[_0x1684('0x20')]=function(_0x2f7c11){var _0x1e3a22=this;return new Promise(function(_0x507707,_0x3fcc47){return db[_0x1684('0x18')][_0x1684('0x21')]({'raw':_0x2f7c11[_0x1684('0x19')]?_0x2f7c11[_0x1684('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2f7c11[_0x1684('0x19')]?_0x2f7c11[_0x1684('0x19')][_0x1684('0x1b')]||null:null,'attributes':_0x2f7c11[_0x1684('0x19')]?_0x2f7c11[_0x1684('0x19')][_0x1684('0x1c')]||null:null,'include':_0x2f7c11[_0x1684('0x19')]?_0x2f7c11[_0x1684('0x19')]['include']?_[_0x1684('0x1e')](_0x2f7c11['options'][_0x1684('0x1d')],function(_0x30f68f){return{'model':db[_0x30f68f[_0x1684('0x1f')]],'as':_0x30f68f['as'],'attributes':_0x30f68f[_0x1684('0x1c')],'include':_0x30f68f[_0x1684('0x1d')]?_[_0x1684('0x1e')](_0x30f68f[_0x1684('0x1d')],function(_0x5228c9){return{'model':db[_0x5228c9[_0x1684('0x1f')]],'as':_0x5228c9['as'],'attributes':_0x5228c9[_0x1684('0x1c')],'include':_0x5228c9[_0x1684('0x1d')]?_[_0x1684('0x1e')](_0x5228c9[_0x1684('0x1d')],function(_0x2ab819){return{'model':db[_0x2ab819[_0x1684('0x1f')]],'as':_0x2ab819['as'],'attributes':_0x2ab819[_0x1684('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1684('0xc')](function(_0xed8b3f){logger[_0x1684('0xd')](_0x1684('0x20'),_0x2f7c11);logger['debug'](_0x1684('0x20'),_0x2f7c11,JSON[_0x1684('0x11')](_0xed8b3f));_0x507707(_0xed8b3f);})[_0x1684('0x16')](function(_0x539173){logger[_0x1684('0x12')](_0x1684('0x20'),_0x539173[_0x1684('0x13')],_0x2f7c11);_0x3fcc47(_0x1e3a22[_0x1684('0x12')](0x1f4,_0x539173['message']));});});}; \ No newline at end of file +var _0xf6ab=['then','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','info','result','catch','GetZendeskAccount','findAll','options','where','attributes','limit','include','model','map','ZendeskAccount','raw','ShowZendeskAccount','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request'];(function(_0x50c7e1,_0x401e17){var _0x194891=function(_0x14ff30){while(--_0x14ff30){_0x50c7e1['push'](_0x50c7e1['shift']());}};_0x194891(++_0x401e17);}(_0xf6ab,0xfe));var _0xbf6a=function(_0xf78bd2,_0x3ad374){_0xf78bd2=_0xf78bd2-0x0;var _0x501662=_0xf6ab[_0xf78bd2];return _0x501662;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbf6a('0x0'));var BPromise=require(_0xbf6a('0x1'));var rs=require(_0xbf6a('0x2'));var fs=require('fs');var Redis=require(_0xbf6a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbf6a('0x4'));var logger=require('../../config/logger')(_0xbf6a('0x5'));var config=require(_0xbf6a('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xbf6a('0x7')][_0xbf6a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4e8737,_0x2face8,_0x1d1670){return new BPromise(function(_0xbeeb1f,_0x38fab5){return client[_0xbf6a('0x9')](_0x4e8737,_0x1d1670)[_0xbf6a('0xa')](function(_0x30c603){logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x2face8,'request\x20sent');logger['debug'](_0xbf6a('0xb'),_0x2face8,_0xbf6a('0xc'),JSON[_0xbf6a('0xd')](_0x30c603));if(_0x30c603[_0xbf6a('0xe')]){if(_0x30c603[_0xbf6a('0xe')][_0xbf6a('0xf')]===0x1f4){logger['error'](_0xbf6a('0x10'),_0x2face8,_0x30c603[_0xbf6a('0xe')][_0xbf6a('0x11')]);return _0x38fab5(_0x30c603[_0xbf6a('0xe')][_0xbf6a('0x11')]);}logger[_0xbf6a('0xe')](_0xbf6a('0x10'),_0x2face8,_0x30c603['error'][_0xbf6a('0x11')]);return _0xbeeb1f(_0x30c603['error'][_0xbf6a('0x11')]);}else{logger[_0xbf6a('0x12')](_0xbf6a('0x10'),_0x2face8,_0xbf6a('0xc'));_0xbeeb1f(_0x30c603[_0xbf6a('0x13')][_0xbf6a('0x11')]);}})[_0xbf6a('0x14')](function(_0x44f45b){logger[_0xbf6a('0xe')](_0xbf6a('0x10'),_0x2face8,_0x44f45b);_0x38fab5(_0x44f45b);});});}exports[_0xbf6a('0x15')]=function(_0x41b005){var _0x1b67a2=this;return new Promise(function(_0x46387e,_0x14bf96){return db['ZendeskAccount'][_0xbf6a('0x16')]({'raw':_0x41b005['options']?_0x41b005[_0xbf6a('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x41b005[_0xbf6a('0x17')]?_0x41b005[_0xbf6a('0x17')][_0xbf6a('0x18')]||null:null,'attributes':_0x41b005['options']?_0x41b005[_0xbf6a('0x17')][_0xbf6a('0x19')]||null:null,'limit':_0x41b005[_0xbf6a('0x17')]?_0x41b005[_0xbf6a('0x17')][_0xbf6a('0x1a')]||null:null,'include':_0x41b005[_0xbf6a('0x17')]?_0x41b005[_0xbf6a('0x17')][_0xbf6a('0x1b')]?_['map'](_0x41b005['options'][_0xbf6a('0x1b')],function(_0x62507a){return{'model':db[_0x62507a[_0xbf6a('0x1c')]],'as':_0x62507a['as'],'attributes':_0x62507a[_0xbf6a('0x19')],'include':_0x62507a[_0xbf6a('0x1b')]?_[_0xbf6a('0x1d')](_0x62507a[_0xbf6a('0x1b')],function(_0x411aad){return{'model':db[_0x411aad[_0xbf6a('0x1c')]],'as':_0x411aad['as'],'attributes':_0x411aad['attributes'],'include':_0x411aad[_0xbf6a('0x1b')]?_[_0xbf6a('0x1d')](_0x411aad['include'],function(_0x4aa804){return{'model':db[_0x4aa804[_0xbf6a('0x1c')]],'as':_0x4aa804['as'],'attributes':_0x4aa804[_0xbf6a('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x152627){logger[_0xbf6a('0x12')]('GetZendeskAccount',_0x41b005);logger['debug']('GetZendeskAccount',_0x41b005,JSON[_0xbf6a('0xd')](_0x152627));_0x46387e(_0x152627);})[_0xbf6a('0x14')](function(_0x8fe541){logger[_0xbf6a('0xe')](_0xbf6a('0x15'),_0x8fe541['message'],_0x41b005);_0x14bf96(_0x1b67a2[_0xbf6a('0xe')](0x1f4,_0x8fe541[_0xbf6a('0x11')]));});});};exports['ShowZendeskAccount']=function(_0x4b12d2){var _0x1fefe5=this;return new Promise(function(_0xcbb7ff,_0x5859cc){return db[_0xbf6a('0x1e')]['find']({'raw':_0x4b12d2[_0xbf6a('0x17')]?_0x4b12d2[_0xbf6a('0x17')][_0xbf6a('0x1f')]===undefined?!![]:![]:!![],'where':_0x4b12d2[_0xbf6a('0x17')]?_0x4b12d2['options'][_0xbf6a('0x18')]||null:null,'attributes':_0x4b12d2['options']?_0x4b12d2[_0xbf6a('0x17')][_0xbf6a('0x19')]||null:null,'include':_0x4b12d2[_0xbf6a('0x17')]?_0x4b12d2[_0xbf6a('0x17')][_0xbf6a('0x1b')]?_[_0xbf6a('0x1d')](_0x4b12d2['options']['include'],function(_0x190c01){return{'model':db[_0x190c01[_0xbf6a('0x1c')]],'as':_0x190c01['as'],'attributes':_0x190c01[_0xbf6a('0x19')],'include':_0x190c01[_0xbf6a('0x1b')]?_[_0xbf6a('0x1d')](_0x190c01[_0xbf6a('0x1b')],function(_0x37d7b0){return{'model':db[_0x37d7b0[_0xbf6a('0x1c')]],'as':_0x37d7b0['as'],'attributes':_0x37d7b0[_0xbf6a('0x19')],'include':_0x37d7b0[_0xbf6a('0x1b')]?_['map'](_0x37d7b0[_0xbf6a('0x1b')],function(_0x262838){return{'model':db[_0x262838[_0xbf6a('0x1c')]],'as':_0x262838['as'],'attributes':_0x262838[_0xbf6a('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x319f56){logger['info'](_0xbf6a('0x20'),_0x4b12d2);logger['debug']('ShowZendeskAccount',_0x4b12d2,JSON[_0xbf6a('0xd')](_0x319f56));_0xcbb7ff(_0x319f56);})[_0xbf6a('0x14')](function(_0x6bdd46){logger['error'](_0xbf6a('0x20'),_0x6bdd46[_0xbf6a('0x11')],_0x4b12d2);_0x5859cc(_0x1fefe5[_0xbf6a('0xe')](0x1f4,_0x6bdd46[_0xbf6a('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index baa3616..2f27d3e 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 _0xbdb7=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller','index','get','show','getFields','/:id/subjects','isAuthenticated','getSubjects','/:id/descriptions','getTags','/:id/tags','update','delete','/:id'];(function(_0x51b661,_0x566ef8){var _0x5d1971=function(_0x5cc6b8){while(--_0x5cc6b8){_0x51b661['push'](_0x51b661['shift']());}};_0x5d1971(++_0x566ef8);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x547fcb,_0x8fda67){_0x547fcb=_0x547fcb-0x0;var _0x275d17=_0xbdb7[_0x547fcb];return _0x275d17;};'use strict';var multer=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var path=require(_0x7bdb('0x2'));var timeout=require(_0x7bdb('0x3'));var express=require(_0x7bdb('0x4'));var router=express[_0x7bdb('0x5')]();var fs_extra=require(_0x7bdb('0x6'));var auth=require(_0x7bdb('0x7'));var interaction=require(_0x7bdb('0x8'));var config=require('../../config/environment');var controller=require(_0x7bdb('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x7bdb('0xa')]);router[_0x7bdb('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x7bdb('0xc')]);router[_0x7bdb('0xb')]('/:id/fields',auth['isAuthenticated'](),controller[_0x7bdb('0xd')]);router[_0x7bdb('0xb')](_0x7bdb('0xe'),auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x10')]);router[_0x7bdb('0xb')](_0x7bdb('0x11'),auth[_0x7bdb('0xf')](),controller['getDescriptions']);router['get']('/:id/tags',auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x12')]);router['post']('/',auth[_0x7bdb('0xf')](),controller['create']);router['post'](_0x7bdb('0x13'),auth[_0x7bdb('0xf')](),controller['setTags']);router['put']('/:id',auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x14')]);router[_0x7bdb('0x15')](_0x7bdb('0x16'),auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x17')]);module[_0x7bdb('0x18')]=router; \ No newline at end of file +var _0x153f=['/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intZendeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects'];(function(_0x453385,_0x25d6fe){var _0x3e8dd4=function(_0x5065ba){while(--_0x5065ba){_0x453385['push'](_0x453385['shift']());}};_0x3e8dd4(++_0x25d6fe);}(_0x153f,0x15b));var _0xf153=function(_0x1c78dd,_0x256112){_0x1c78dd=_0x1c78dd-0x0;var _0x1c3b29=_0x153f[_0x1c78dd];return _0x1c3b29;};'use strict';var multer=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var path=require(_0xf153('0x2'));var timeout=require(_0xf153('0x3'));var express=require(_0xf153('0x4'));var router=express[_0xf153('0x5')]();var fs_extra=require(_0xf153('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf153('0x7'));var config=require('../../config/environment');var controller=require(_0xf153('0x8'));router[_0xf153('0x9')]('/',auth[_0xf153('0xa')](),controller[_0xf153('0xb')]);router[_0xf153('0x9')]('/:id',auth[_0xf153('0xa')](),controller[_0xf153('0xc')]);router[_0xf153('0x9')](_0xf153('0xd'),auth[_0xf153('0xa')](),controller[_0xf153('0xe')]);router[_0xf153('0x9')](_0xf153('0xf'),auth[_0xf153('0xa')](),controller[_0xf153('0x10')]);router['get'](_0xf153('0x11'),auth[_0xf153('0xa')](),controller[_0xf153('0x12')]);router['get'](_0xf153('0x13'),auth[_0xf153('0xa')](),controller[_0xf153('0x14')]);router[_0xf153('0x15')]('/',auth[_0xf153('0xa')](),controller[_0xf153('0x16')]);router[_0xf153('0x15')](_0xf153('0x13'),auth[_0xf153('0xa')](),controller['setTags']);router[_0xf153('0x17')](_0xf153('0x18'),auth[_0xf153('0xa')](),controller[_0xf153('0x19')]);router[_0xf153('0x1a')](_0xf153('0x18'),auth[_0xf153('0xa')](),controller[_0xf153('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index cb0a239..b983ec1 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 _0x6927=['sequelize','exports','STRING'];(function(_0x6355b2,_0x309ffe){var _0x5d193e=function(_0x52b810){while(--_0x52b810){_0x6355b2['push'](_0x6355b2['shift']());}};_0x5d193e(++_0x309ffe);}(_0x6927,0x99));var _0x7692=function(_0x37013f,_0x150910){_0x37013f=_0x37013f-0x0;var _0x197766=_0x6927[_0x37013f];return _0x197766;};'use strict';var Sequelize=require(_0x7692('0x0'));module[_0x7692('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7692('0x2')]}}; \ No newline at end of file +var _0xaa40=['STRING','sequelize','exports'];(function(_0x3d64cb,_0x3af4c5){var _0x4b49ee=function(_0x2bb7bb){while(--_0x2bb7bb){_0x3d64cb['push'](_0x3d64cb['shift']());}};_0x4b49ee(++_0x3af4c5);}(_0xaa40,0x172));var _0x0aa4=function(_0xfb14f8,_0x12e75f){_0xfb14f8=_0xfb14f8-0x0;var _0x2b5c2e=_0xaa40[_0xfb14f8];return _0x2b5c2e;};'use strict';var Sequelize=require(_0x0aa4('0x0'));module[_0x0aa4('0x1')]={'name':{'type':Sequelize[_0x0aa4('0x2')]},'description':{'type':Sequelize[_0x0aa4('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 07e259d..0f23173 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 _0x97dd=['order','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','stack','name','send','map','rawAttributes','fieldName','type','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','ZendeskConfiguration','includeAll','include','findAll','rows','catch','params','find','create','body','getFields','findOne','ZendeskField','getSubjects'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x97dd,0x152));var _0xd97d=function(_0x61b096,_0x3902a1){_0x61b096=_0x61b096-0x0;var _0x3f5c5f=_0x97dd[_0x61b096];return _0x3f5c5f;};'use strict';var emlformat=require(_0xd97d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd97d('0x1'));var jsonpatch=require(_0xd97d('0x2'));var rp=require(_0xd97d('0x3'));var moment=require(_0xd97d('0x4'));var BPromise=require(_0xd97d('0x5'));var Mustache=require(_0xd97d('0x6'));var util=require(_0xd97d('0x7'));var path=require(_0xd97d('0x8'));var sox=require('sox');var csv=require(_0xd97d('0x9'));var ejs=require(_0xd97d('0xa'));var fs=require('fs');var fs_extra=require(_0xd97d('0xb'));var _=require(_0xd97d('0xc'));var squel=require(_0xd97d('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd97d('0x9'));var querystring=require('querystring');var Papa=require(_0xd97d('0xe'));var Redis=require(_0xd97d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd97d('0x10'));var as=require(_0xd97d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd97d('0x12'))(_0xd97d('0x13'));var utils=require(_0xd97d('0x14'));var config=require(_0xd97d('0x15'));var licenseUtil=require(_0xd97d('0x16'));var db=require(_0xd97d('0x17'))['db'];function respondWithStatusCode(_0x19c7a1,_0x12c50c){_0x12c50c=_0x12c50c||0xcc;return function(_0x24c407){if(_0x24c407){return _0x19c7a1[_0xd97d('0x18')](_0x12c50c);}return _0x19c7a1[_0xd97d('0x19')](_0x12c50c)[_0xd97d('0x1a')]();};}function respondWithResult(_0x37ab0b,_0xed8bc8){_0xed8bc8=_0xed8bc8||0xc8;return function(_0x33183f){if(_0x33183f){return _0x37ab0b[_0xd97d('0x19')](_0xed8bc8)[_0xd97d('0x1b')](_0x33183f);}};}function respondWithFilteredResult(_0x5193e4,_0x2d65e4){return function(_0xb3506c){if(_0xb3506c){var _0x630313=typeof _0x2d65e4[_0xd97d('0x1c')]===_0xd97d('0x1d')&&typeof _0x2d65e4[_0xd97d('0x1e')]===_0xd97d('0x1d');var _0x2d57a7=_0xb3506c[_0xd97d('0x1f')];var _0x4c42ae=_0x630313?0x0:_0x2d65e4[_0xd97d('0x1c')];var _0x329432=_0x630313?_0xb3506c[_0xd97d('0x1f')]:_0x2d65e4[_0xd97d('0x1c')]+_0x2d65e4[_0xd97d('0x1e')];var _0x4388d3;if(_0x329432>=_0x2d57a7){_0x329432=_0x2d57a7;_0x4388d3=0xc8;}else{_0x4388d3=0xce;}_0x5193e4[_0xd97d('0x19')](_0x4388d3);return _0x5193e4[_0xd97d('0x20')]('Content-Range',_0x4c42ae+'-'+_0x329432+'/'+_0x2d57a7)['json'](_0xb3506c);}return null;};}function patchUpdates(_0xe28ba){return function(_0x59be52){try{jsonpatch[_0xd97d('0x21')](_0x59be52,_0xe28ba,!![]);}catch(_0x457132){return BPromise[_0xd97d('0x22')](_0x457132);}return _0x59be52[_0xd97d('0x23')]();};}function saveUpdates(_0x5c191f,_0x2d762e){return function(_0x3c5ab4){if(_0x3c5ab4){return _0x3c5ab4[_0xd97d('0x24')](_0x5c191f)[_0xd97d('0x25')](function(_0x1c8e87){return _0x1c8e87;});}return null;};}function removeEntity(_0x11ab50,_0x45e647){return function(_0x272ee0){if(_0x272ee0){return _0x272ee0[_0xd97d('0x26')]()['then'](function(){_0x11ab50['status'](0xcc)[_0xd97d('0x1a')]();});}};}function handleEntityNotFound(_0x10ce9c,_0x25d264){return function(_0x79f586){if(!_0x79f586){_0x10ce9c[_0xd97d('0x18')](0x194);}return _0x79f586;};}function handleError(_0x3242b6,_0x168839){_0x168839=_0x168839||0x1f4;return function(_0x31f4cc){logger['error'](_0x31f4cc[_0xd97d('0x27')]);if(_0x31f4cc[_0xd97d('0x28')]){delete _0x31f4cc[_0xd97d('0x28')];}_0x3242b6[_0xd97d('0x19')](_0x168839)[_0xd97d('0x29')](_0x31f4cc);};}exports['index']=function(_0x15d8bd,_0x46f696){var _0x1ba5d1={},_0xd666d7={},_0x2b7474={'count':0x0,'rows':[]};var _0x195f99=_[_0xd97d('0x2a')](db['ZendeskConfiguration'][_0xd97d('0x2b')],function(_0x28bee2){return{'name':_0x28bee2[_0xd97d('0x2c')],'type':_0x28bee2[_0xd97d('0x2d')]['key']};});_0xd666d7[_0xd97d('0x2e')]=_['map'](_0x195f99,_0xd97d('0x28'));_0xd666d7['query']=_[_0xd97d('0x2f')](_0x15d8bd['query']);_0xd666d7[_0xd97d('0x30')]=_[_0xd97d('0x31')](_0xd666d7['model'],_0xd666d7['query']);_0x1ba5d1[_0xd97d('0x32')]=_[_0xd97d('0x31')](_0xd666d7['model'],qs[_0xd97d('0x33')](_0x15d8bd[_0xd97d('0x34')][_0xd97d('0x33')]));_0x1ba5d1[_0xd97d('0x32')]=_0x1ba5d1['attributes'][_0xd97d('0x35')]?_0x1ba5d1['attributes']:_0xd666d7[_0xd97d('0x2e')];if(!_0x15d8bd[_0xd97d('0x34')][_0xd97d('0x36')](_0xd97d('0x37'))){_0x1ba5d1[_0xd97d('0x1e')]=qs[_0xd97d('0x1e')](_0x15d8bd[_0xd97d('0x34')][_0xd97d('0x1e')]);_0x1ba5d1['offset']=qs['offset'](_0x15d8bd[_0xd97d('0x34')][_0xd97d('0x1c')]);}_0x1ba5d1['order']=qs[_0xd97d('0x38')](_0x15d8bd[_0xd97d('0x34')][_0xd97d('0x38')]);_0x1ba5d1[_0xd97d('0x39')]=qs['filters'](_[_0xd97d('0x3a')](_0x15d8bd[_0xd97d('0x34')],_0xd666d7['filters']),_0x195f99);if(_0x15d8bd[_0xd97d('0x34')][_0xd97d('0x3b')]){_0x1ba5d1['where']=_[_0xd97d('0x3c')](_0x1ba5d1[_0xd97d('0x39')],{'$or':_['map'](_0x195f99,function(_0x171c4e){if(_0x171c4e[_0xd97d('0x2d')]!==_0xd97d('0x3d')){var _0xa3e2f4={};_0xa3e2f4[_0x171c4e['name']]={'$like':'%'+_0x15d8bd[_0xd97d('0x34')]['filter']+'%'};return _0xa3e2f4;}})});}_0x1ba5d1=_['merge']({},_0x1ba5d1,_0x15d8bd[_0xd97d('0x3e')]);var _0x5de10d={'where':_0x1ba5d1[_0xd97d('0x39')]};return db[_0xd97d('0x3f')][_0xd97d('0x1f')](_0x5de10d)[_0xd97d('0x25')](function(_0x71f6dc){_0x2b7474[_0xd97d('0x1f')]=_0x71f6dc;if(_0x15d8bd[_0xd97d('0x34')][_0xd97d('0x40')]){_0x1ba5d1[_0xd97d('0x41')]=[{'all':!![]}];}return db[_0xd97d('0x3f')][_0xd97d('0x42')](_0x1ba5d1);})[_0xd97d('0x25')](function(_0x4d9845){_0x2b7474[_0xd97d('0x43')]=_0x4d9845;return _0x2b7474;})[_0xd97d('0x25')](respondWithFilteredResult(_0x46f696,_0x1ba5d1))[_0xd97d('0x44')](handleError(_0x46f696,null));};exports['show']=function(_0x436ca5,_0x3a972c){var _0x192d73={'raw':![],'where':{'id':_0x436ca5[_0xd97d('0x45')]['id']}},_0x101e43={};_0x101e43[_0xd97d('0x2e')]=_[_0xd97d('0x2f')](db[_0xd97d('0x3f')][_0xd97d('0x2b')]);_0x101e43['query']=_[_0xd97d('0x2f')](_0x436ca5[_0xd97d('0x34')]);_0x101e43[_0xd97d('0x30')]=_[_0xd97d('0x31')](_0x101e43[_0xd97d('0x2e')],_0x101e43[_0xd97d('0x34')]);_0x192d73[_0xd97d('0x32')]=_['intersection'](_0x101e43[_0xd97d('0x2e')],qs[_0xd97d('0x33')](_0x436ca5[_0xd97d('0x34')][_0xd97d('0x33')]));_0x192d73[_0xd97d('0x32')]=_0x192d73[_0xd97d('0x32')][_0xd97d('0x35')]?_0x192d73[_0xd97d('0x32')]:_0x101e43[_0xd97d('0x2e')];if(_0x436ca5['query'][_0xd97d('0x40')]){_0x192d73[_0xd97d('0x41')]=[{'all':!![]}];}_0x192d73=_[_0xd97d('0x3c')]({},_0x192d73,_0x436ca5[_0xd97d('0x3e')]);return db['ZendeskConfiguration'][_0xd97d('0x46')](_0x192d73)[_0xd97d('0x25')](handleEntityNotFound(_0x3a972c,null))['then'](respondWithResult(_0x3a972c,null))[_0xd97d('0x44')](handleError(_0x3a972c,null));};exports['create']=function(_0x311394,_0xffbf66){return db[_0xd97d('0x3f')][_0xd97d('0x47')](_0x311394[_0xd97d('0x48')],{})[_0xd97d('0x25')](respondWithResult(_0xffbf66,0xc9))[_0xd97d('0x44')](handleError(_0xffbf66,null));};exports[_0xd97d('0x24')]=function(_0x367475,_0x18f3f5){if(_0x367475['body']['id']){delete _0x367475[_0xd97d('0x48')]['id'];}return db[_0xd97d('0x3f')][_0xd97d('0x46')]({'where':{'id':_0x367475[_0xd97d('0x45')]['id']}})[_0xd97d('0x25')](handleEntityNotFound(_0x18f3f5,null))['then'](saveUpdates(_0x367475[_0xd97d('0x48')],null))[_0xd97d('0x25')](respondWithResult(_0x18f3f5,null))['catch'](handleError(_0x18f3f5,null));};exports['destroy']=function(_0x599fa9,_0xffa918){return db[_0xd97d('0x3f')]['find']({'where':{'id':_0x599fa9[_0xd97d('0x45')]['id']}})['then'](handleEntityNotFound(_0xffa918,null))[_0xd97d('0x25')](removeEntity(_0xffa918,null))[_0xd97d('0x44')](handleError(_0xffa918,null));};exports[_0xd97d('0x49')]=function(_0x183201,_0x394b01,_0x5d758e){var _0x1377ae={};var _0x1a5554={};var _0x15eedd;var _0x58bf89;return db['ZendeskConfiguration'][_0xd97d('0x4a')]({'where':{'id':_0x183201['params']['id']}})[_0xd97d('0x25')](handleEntityNotFound(_0x394b01,null))[_0xd97d('0x25')](function(_0x582e77){if(_0x582e77){_0x15eedd=_0x582e77;_0x1a5554['model']=_[_0xd97d('0x2f')](db[_0xd97d('0x4b')][_0xd97d('0x2b')]);_0x1a5554[_0xd97d('0x34')]=_[_0xd97d('0x2f')](_0x183201[_0xd97d('0x34')]);_0x1a5554[_0xd97d('0x30')]=_[_0xd97d('0x31')](_0x1a5554[_0xd97d('0x2e')],_0x1a5554['query']);_0x1377ae['attributes']=_[_0xd97d('0x31')](_0x1a5554[_0xd97d('0x2e')],qs[_0xd97d('0x33')](_0x183201['query'][_0xd97d('0x33')]));_0x1377ae[_0xd97d('0x32')]=_0x1377ae['attributes']['length']?_0x1377ae[_0xd97d('0x32')]:_0x1a5554[_0xd97d('0x2e')];_0x1377ae['order']=qs[_0xd97d('0x38')](_0x183201[_0xd97d('0x34')]['sort']);_0x1377ae[_0xd97d('0x39')]=qs['filters'](_[_0xd97d('0x3a')](_0x183201['query'],_0x1a5554[_0xd97d('0x30')]));if(_0x183201[_0xd97d('0x34')][_0xd97d('0x3b')]){_0x1377ae['where']=_[_0xd97d('0x3c')](_0x1377ae[_0xd97d('0x39')],{'$or':_['map'](_0x1377ae[_0xd97d('0x32')],function(_0xb0288){var _0x39e028={};_0x39e028[_0xb0288]={'$like':'%'+_0x183201[_0xd97d('0x34')][_0xd97d('0x3b')]+'%'};return _0x39e028;})});}_0x1377ae=_[_0xd97d('0x3c')]({},_0x1377ae,_0x183201[_0xd97d('0x3e')]);return _0x15eedd[_0xd97d('0x49')](_0x1377ae);}})[_0xd97d('0x25')](function(_0x3f5f4b){if(_0x3f5f4b){_0x58bf89=_0x3f5f4b['length'];if(!_0x183201[_0xd97d('0x34')][_0xd97d('0x36')](_0xd97d('0x37'))){_0x1377ae[_0xd97d('0x1e')]=qs[_0xd97d('0x1e')](_0x183201[_0xd97d('0x34')][_0xd97d('0x1e')]);_0x1377ae[_0xd97d('0x1c')]=qs[_0xd97d('0x1c')](_0x183201[_0xd97d('0x34')]['offset']);}return _0x15eedd['getFields'](_0x1377ae);}})['then'](function(_0x299ec4){if(_0x299ec4){return _0x299ec4?{'count':_0x58bf89,'rows':_0x299ec4}:null;}})[_0xd97d('0x25')](respondWithResult(_0x394b01,null))[_0xd97d('0x44')](handleError(_0x394b01,null));};exports[_0xd97d('0x4c')]=function(_0x1360fe,_0x1bcc57,_0x417ba2){var _0x3d2637={};var _0x25696d={};var _0x3ecf78;var _0x4891a;return db[_0xd97d('0x3f')][_0xd97d('0x4a')]({'where':{'id':_0x1360fe[_0xd97d('0x45')]['id']}})[_0xd97d('0x25')](handleEntityNotFound(_0x1bcc57,null))[_0xd97d('0x25')](function(_0x2f1d47){if(_0x2f1d47){_0x3ecf78=_0x2f1d47;_0x25696d[_0xd97d('0x2e')]=_['keys'](db[_0xd97d('0x4b')][_0xd97d('0x2b')]);_0x25696d[_0xd97d('0x34')]=_[_0xd97d('0x2f')](_0x1360fe[_0xd97d('0x34')]);_0x25696d[_0xd97d('0x30')]=_[_0xd97d('0x31')](_0x25696d[_0xd97d('0x2e')],_0x25696d['query']);_0x3d2637[_0xd97d('0x32')]=_[_0xd97d('0x31')](_0x25696d['model'],qs[_0xd97d('0x33')](_0x1360fe[_0xd97d('0x34')][_0xd97d('0x33')]));_0x3d2637[_0xd97d('0x32')]=_0x3d2637[_0xd97d('0x32')][_0xd97d('0x35')]?_0x3d2637[_0xd97d('0x32')]:_0x25696d['model'];_0x3d2637[_0xd97d('0x4d')]=qs[_0xd97d('0x38')](_0x1360fe[_0xd97d('0x34')][_0xd97d('0x38')]);_0x3d2637[_0xd97d('0x39')]=qs[_0xd97d('0x30')](_['pick'](_0x1360fe['query'],_0x25696d[_0xd97d('0x30')]));if(_0x1360fe['query'][_0xd97d('0x3b')]){_0x3d2637[_0xd97d('0x39')]=_[_0xd97d('0x3c')](_0x3d2637[_0xd97d('0x39')],{'$or':_[_0xd97d('0x2a')](_0x3d2637['attributes'],function(_0x4679a1){var _0x17eeaa={};_0x17eeaa[_0x4679a1]={'$like':'%'+_0x1360fe['query'][_0xd97d('0x3b')]+'%'};return _0x17eeaa;})});}_0x3d2637=_[_0xd97d('0x3c')]({},_0x3d2637,_0x1360fe['options']);return _0x3ecf78['getSubjects'](_0x3d2637);}})[_0xd97d('0x25')](function(_0x4f91e6){if(_0x4f91e6){_0x4891a=_0x4f91e6[_0xd97d('0x35')];if(!_0x1360fe['query']['hasOwnProperty'](_0xd97d('0x37'))){_0x3d2637[_0xd97d('0x1e')]=qs[_0xd97d('0x1e')](_0x1360fe[_0xd97d('0x34')][_0xd97d('0x1e')]);_0x3d2637[_0xd97d('0x1c')]=qs[_0xd97d('0x1c')](_0x1360fe['query']['offset']);}return _0x3ecf78[_0xd97d('0x4c')](_0x3d2637);}})[_0xd97d('0x25')](function(_0x5ae48f){if(_0x5ae48f){return _0x5ae48f?{'count':_0x4891a,'rows':_0x5ae48f}:null;}})['then'](respondWithResult(_0x1bcc57,null))[_0xd97d('0x44')](handleError(_0x1bcc57,null));};exports[_0xd97d('0x4e')]=function(_0x85d47d,_0x136e33,_0x4085d3){var _0x5af68a={};var _0x3ad9f6={};var _0x3afcf9;var _0x4cbcee;return db[_0xd97d('0x3f')][_0xd97d('0x4a')]({'where':{'id':_0x85d47d[_0xd97d('0x45')]['id']}})[_0xd97d('0x25')](handleEntityNotFound(_0x136e33,null))['then'](function(_0x1bfb4b){if(_0x1bfb4b){_0x3afcf9=_0x1bfb4b;_0x3ad9f6[_0xd97d('0x2e')]=_[_0xd97d('0x2f')](db[_0xd97d('0x4b')][_0xd97d('0x2b')]);_0x3ad9f6['query']=_[_0xd97d('0x2f')](_0x85d47d['query']);_0x3ad9f6[_0xd97d('0x30')]=_[_0xd97d('0x31')](_0x3ad9f6[_0xd97d('0x2e')],_0x3ad9f6[_0xd97d('0x34')]);_0x5af68a[_0xd97d('0x32')]=_[_0xd97d('0x31')](_0x3ad9f6[_0xd97d('0x2e')],qs[_0xd97d('0x33')](_0x85d47d[_0xd97d('0x34')][_0xd97d('0x33')]));_0x5af68a[_0xd97d('0x32')]=_0x5af68a[_0xd97d('0x32')][_0xd97d('0x35')]?_0x5af68a[_0xd97d('0x32')]:_0x3ad9f6['model'];_0x5af68a[_0xd97d('0x4d')]=qs[_0xd97d('0x38')](_0x85d47d['query']['sort']);_0x5af68a[_0xd97d('0x39')]=qs['filters'](_[_0xd97d('0x3a')](_0x85d47d[_0xd97d('0x34')],_0x3ad9f6[_0xd97d('0x30')]));if(_0x85d47d[_0xd97d('0x34')][_0xd97d('0x3b')]){_0x5af68a[_0xd97d('0x39')]=_[_0xd97d('0x3c')](_0x5af68a['where'],{'$or':_['map'](_0x5af68a[_0xd97d('0x32')],function(_0x56aa2d){var _0x389e79={};_0x389e79[_0x56aa2d]={'$like':'%'+_0x85d47d[_0xd97d('0x34')][_0xd97d('0x3b')]+'%'};return _0x389e79;})});}_0x5af68a=_[_0xd97d('0x3c')]({},_0x5af68a,_0x85d47d[_0xd97d('0x3e')]);return _0x3afcf9[_0xd97d('0x4e')](_0x5af68a);}})[_0xd97d('0x25')](function(_0x53583c){if(_0x53583c){_0x4cbcee=_0x53583c[_0xd97d('0x35')];if(!_0x85d47d[_0xd97d('0x34')][_0xd97d('0x36')]('nolimit')){_0x5af68a[_0xd97d('0x1e')]=qs['limit'](_0x85d47d['query']['limit']);_0x5af68a[_0xd97d('0x1c')]=qs[_0xd97d('0x1c')](_0x85d47d['query'][_0xd97d('0x1c')]);}return _0x3afcf9[_0xd97d('0x4e')](_0x5af68a);}})[_0xd97d('0x25')](function(_0xf66087){if(_0xf66087){return _0xf66087?{'count':_0x4cbcee,'rows':_0xf66087}:null;}})['then'](respondWithResult(_0x136e33,null))[_0xd97d('0x44')](handleError(_0x136e33,null));};exports[_0xd97d('0x4f')]=function(_0x15a484,_0x3173b5,_0x8338cf){var _0x443a1a={};var _0x53611e={};var _0x57d98d;var _0x5e2834;return db[_0xd97d('0x3f')][_0xd97d('0x4a')]({'where':{'id':_0x15a484['params']['id']}})[_0xd97d('0x25')](handleEntityNotFound(_0x3173b5,null))[_0xd97d('0x25')](function(_0x9246b0){if(_0x9246b0){_0x57d98d=_0x9246b0;_0x53611e['model']=_[_0xd97d('0x2f')](db[_0xd97d('0x50')][_0xd97d('0x2b')]);_0x53611e[_0xd97d('0x34')]=_[_0xd97d('0x2f')](_0x15a484[_0xd97d('0x34')]);_0x53611e[_0xd97d('0x30')]=_[_0xd97d('0x31')](_0x53611e[_0xd97d('0x2e')],_0x53611e[_0xd97d('0x34')]);_0x443a1a['attributes']=_['intersection'](_0x53611e[_0xd97d('0x2e')],qs[_0xd97d('0x33')](_0x15a484['query'][_0xd97d('0x33')]));_0x443a1a[_0xd97d('0x32')]=_0x443a1a[_0xd97d('0x32')][_0xd97d('0x35')]?_0x443a1a[_0xd97d('0x32')]:_0x53611e['model'];_0x443a1a['order']=qs['sort'](_0x15a484[_0xd97d('0x34')]['sort']);_0x443a1a[_0xd97d('0x39')]=qs[_0xd97d('0x30')](_[_0xd97d('0x3a')](_0x15a484['query'],_0x53611e[_0xd97d('0x30')]));if(_0x15a484[_0xd97d('0x34')][_0xd97d('0x3b')]){_0x443a1a[_0xd97d('0x39')]=_[_0xd97d('0x3c')](_0x443a1a[_0xd97d('0x39')],{'$or':_['map'](_0x443a1a[_0xd97d('0x32')],function(_0x4269d3){var _0x36f501={};_0x36f501[_0x4269d3]={'$like':'%'+_0x15a484['query'][_0xd97d('0x3b')]+'%'};return _0x36f501;})});}_0x443a1a=_[_0xd97d('0x3c')]({},_0x443a1a,_0x15a484[_0xd97d('0x3e')]);return _0x57d98d[_0xd97d('0x4f')](_0x443a1a);}})[_0xd97d('0x25')](function(_0x34ea76){if(_0x34ea76){_0x5e2834=_0x34ea76[_0xd97d('0x35')];if(!_0x15a484[_0xd97d('0x34')]['hasOwnProperty']('nolimit')){_0x443a1a[_0xd97d('0x1e')]=qs[_0xd97d('0x1e')](_0x15a484[_0xd97d('0x34')]['limit']);_0x443a1a['offset']=qs[_0xd97d('0x1c')](_0x15a484[_0xd97d('0x34')][_0xd97d('0x1c')]);}return _0x57d98d[_0xd97d('0x4f')](_0x443a1a);}})[_0xd97d('0x25')](function(_0x214020){if(_0x214020){return _0x214020?{'count':_0x5e2834,'rows':_0x214020}:null;}})[_0xd97d('0x25')](respondWithResult(_0x3173b5,null))[_0xd97d('0x44')](handleError(_0x3173b5,null));};exports[_0xd97d('0x51')]=function(_0x5e5c6f,_0x239e1e,_0x4108bc){if(_0x5e5c6f['body']['id']){delete _0x5e5c6f[_0xd97d('0x48')]['id'];}return db[_0xd97d('0x3f')]['findOne']({'where':{'id':_0x5e5c6f[_0xd97d('0x45')]['id']}})[_0xd97d('0x25')](handleEntityNotFound(_0x239e1e,null))[_0xd97d('0x25')](function(_0x1b7afe){if(_0x1b7afe){return _0x1b7afe[_0xd97d('0x51')](_0x5e5c6f[_0xd97d('0x48')][_0xd97d('0x52')]||[]);}return null;})[_0xd97d('0x25')](respondWithResult(_0x239e1e,null))[_0xd97d('0x44')](handleError(_0x239e1e,null));}; \ No newline at end of file +var _0x5f8b=['order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','filters','length','find','create','body','destroy','getFields','findOne','ZendeskField','getSubjects','getDescriptions','getTags','Tag','setTags','rimraf','zip-dir','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','error','stack','name','map','ZendeskConfiguration','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit'];(function(_0x5db99b,_0xdee23a){var _0x4b2d0e=function(_0x4deee1){while(--_0x4deee1){_0x5db99b['push'](_0x5db99b['shift']());}};_0x4b2d0e(++_0xdee23a);}(_0x5f8b,0x160));var _0xb5f8=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0x5f8b[_0x1a72f3];return _0x57ef47;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb5f8('0x0'));var zipdir=require(_0xb5f8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb5f8('0x2'));var Mustache=require(_0xb5f8('0x3'));var util=require('util');var path=require(_0xb5f8('0x4'));var sox=require(_0xb5f8('0x5'));var csv=require('to-csv');var ejs=require(_0xb5f8('0x6'));var fs=require('fs');var fs_extra=require(_0xb5f8('0x7'));var _=require(_0xb5f8('0x8'));var squel=require(_0xb5f8('0x9'));var crypto=require('crypto');var jsforce=require(_0xb5f8('0xa'));var deskjs=require(_0xb5f8('0xb'));var toCsv=require(_0xb5f8('0xc'));var querystring=require('querystring');var Papa=require(_0xb5f8('0xd'));var Redis=require(_0xb5f8('0xe'));var authService=require(_0xb5f8('0xf'));var qs=require(_0xb5f8('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb5f8('0x11'));var logger=require(_0xb5f8('0x12'))('api');var utils=require(_0xb5f8('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xb5f8('0x14'));var db=require(_0xb5f8('0x15'))['db'];function respondWithStatusCode(_0x3a178e,_0xfed86c){_0xfed86c=_0xfed86c||0xcc;return function(_0x542a47){if(_0x542a47){return _0x3a178e[_0xb5f8('0x16')](_0xfed86c);}return _0x3a178e['status'](_0xfed86c)[_0xb5f8('0x17')]();};}function respondWithResult(_0xfaa91f,_0x237304){_0x237304=_0x237304||0xc8;return function(_0x80b682){if(_0x80b682){return _0xfaa91f['status'](_0x237304)[_0xb5f8('0x18')](_0x80b682);}};}function respondWithFilteredResult(_0x2770e0,_0x2f9efe){return function(_0x200408){if(_0x200408){var _0x48bfe0=typeof _0x2f9efe[_0xb5f8('0x19')]===_0xb5f8('0x1a')&&typeof _0x2f9efe[_0xb5f8('0x1b')]==='undefined';var _0x4947d0=_0x200408[_0xb5f8('0x1c')];var _0x352a38=_0x48bfe0?0x0:_0x2f9efe[_0xb5f8('0x19')];var _0x17b2df=_0x48bfe0?_0x200408[_0xb5f8('0x1c')]:_0x2f9efe[_0xb5f8('0x19')]+_0x2f9efe[_0xb5f8('0x1b')];var _0x465ec4;if(_0x17b2df>=_0x4947d0){_0x17b2df=_0x4947d0;_0x465ec4=0xc8;}else{_0x465ec4=0xce;}_0x2770e0[_0xb5f8('0x1d')](_0x465ec4);return _0x2770e0[_0xb5f8('0x1e')](_0xb5f8('0x1f'),_0x352a38+'-'+_0x17b2df+'/'+_0x4947d0)['json'](_0x200408);}return null;};}function patchUpdates(_0x133f38){return function(_0x87141b){try{jsonpatch[_0xb5f8('0x20')](_0x87141b,_0x133f38,!![]);}catch(_0x44cc9f){return BPromise[_0xb5f8('0x21')](_0x44cc9f);}return _0x87141b[_0xb5f8('0x22')]();};}function saveUpdates(_0xca4f7f,_0x22beb9){return function(_0x383a60){if(_0x383a60){return _0x383a60[_0xb5f8('0x23')](_0xca4f7f)['then'](function(_0x379277){return _0x379277;});}return null;};}function removeEntity(_0x56fb4c,_0x16cb54){return function(_0x53e913){if(_0x53e913){return _0x53e913['destroy']()[_0xb5f8('0x24')](function(){_0x56fb4c[_0xb5f8('0x1d')](0xcc)[_0xb5f8('0x17')]();});}};}function handleEntityNotFound(_0x4bc5db,_0x117638){return function(_0x7af1fc){if(!_0x7af1fc){_0x4bc5db['sendStatus'](0x194);}return _0x7af1fc;};}function handleError(_0x3aeb57,_0xec7bf5){_0xec7bf5=_0xec7bf5||0x1f4;return function(_0x4de14d){logger[_0xb5f8('0x25')](_0x4de14d[_0xb5f8('0x26')]);if(_0x4de14d['name']){delete _0x4de14d[_0xb5f8('0x27')];}_0x3aeb57[_0xb5f8('0x1d')](_0xec7bf5)['send'](_0x4de14d);};}exports['index']=function(_0x5edfcc,_0x3eaf37){var _0x1ae82d={},_0xf8bf21={},_0x8cccb6={'count':0x0,'rows':[]};var _0x4fa3d1=_[_0xb5f8('0x28')](db[_0xb5f8('0x29')][_0xb5f8('0x2a')],function(_0x27907b){return{'name':_0x27907b[_0xb5f8('0x2b')],'type':_0x27907b[_0xb5f8('0x2c')]['key']};});_0xf8bf21[_0xb5f8('0x2d')]=_['map'](_0x4fa3d1,'name');_0xf8bf21[_0xb5f8('0x2e')]=_[_0xb5f8('0x2f')](_0x5edfcc[_0xb5f8('0x2e')]);_0xf8bf21['filters']=_[_0xb5f8('0x30')](_0xf8bf21[_0xb5f8('0x2d')],_0xf8bf21['query']);_0x1ae82d[_0xb5f8('0x31')]=_[_0xb5f8('0x30')](_0xf8bf21[_0xb5f8('0x2d')],qs[_0xb5f8('0x32')](_0x5edfcc[_0xb5f8('0x2e')][_0xb5f8('0x32')]));_0x1ae82d[_0xb5f8('0x31')]=_0x1ae82d[_0xb5f8('0x31')]['length']?_0x1ae82d[_0xb5f8('0x31')]:_0xf8bf21[_0xb5f8('0x2d')];if(!_0x5edfcc[_0xb5f8('0x2e')][_0xb5f8('0x33')](_0xb5f8('0x34'))){_0x1ae82d[_0xb5f8('0x1b')]=qs[_0xb5f8('0x1b')](_0x5edfcc[_0xb5f8('0x2e')][_0xb5f8('0x1b')]);_0x1ae82d[_0xb5f8('0x19')]=qs[_0xb5f8('0x19')](_0x5edfcc[_0xb5f8('0x2e')][_0xb5f8('0x19')]);}_0x1ae82d[_0xb5f8('0x35')]=qs[_0xb5f8('0x36')](_0x5edfcc['query'][_0xb5f8('0x36')]);_0x1ae82d['where']=qs['filters'](_[_0xb5f8('0x37')](_0x5edfcc[_0xb5f8('0x2e')],_0xf8bf21['filters']),_0x4fa3d1);if(_0x5edfcc[_0xb5f8('0x2e')]['filter']){_0x1ae82d[_0xb5f8('0x38')]=_[_0xb5f8('0x39')](_0x1ae82d['where'],{'$or':_[_0xb5f8('0x28')](_0x4fa3d1,function(_0x372eea){if(_0x372eea[_0xb5f8('0x2c')]!==_0xb5f8('0x3a')){var _0x4fb8a0={};_0x4fb8a0[_0x372eea['name']]={'$like':'%'+_0x5edfcc[_0xb5f8('0x2e')][_0xb5f8('0x3b')]+'%'};return _0x4fb8a0;}})});}_0x1ae82d=_[_0xb5f8('0x39')]({},_0x1ae82d,_0x5edfcc[_0xb5f8('0x3c')]);var _0x284bcb={'where':_0x1ae82d[_0xb5f8('0x38')]};return db[_0xb5f8('0x29')][_0xb5f8('0x1c')](_0x284bcb)['then'](function(_0x226e00){_0x8cccb6[_0xb5f8('0x1c')]=_0x226e00;if(_0x5edfcc[_0xb5f8('0x2e')][_0xb5f8('0x3d')]){_0x1ae82d[_0xb5f8('0x3e')]=[{'all':!![]}];}return db[_0xb5f8('0x29')][_0xb5f8('0x3f')](_0x1ae82d);})[_0xb5f8('0x24')](function(_0x31820e){_0x8cccb6['rows']=_0x31820e;return _0x8cccb6;})[_0xb5f8('0x24')](respondWithFilteredResult(_0x3eaf37,_0x1ae82d))[_0xb5f8('0x40')](handleError(_0x3eaf37,null));};exports[_0xb5f8('0x41')]=function(_0x1dcf44,_0x42e1a9){var _0x524a75={'raw':![],'where':{'id':_0x1dcf44[_0xb5f8('0x42')]['id']}},_0x5e11e3={};_0x5e11e3[_0xb5f8('0x2d')]=_['keys'](db[_0xb5f8('0x29')]['rawAttributes']);_0x5e11e3[_0xb5f8('0x2e')]=_[_0xb5f8('0x2f')](_0x1dcf44[_0xb5f8('0x2e')]);_0x5e11e3[_0xb5f8('0x43')]=_[_0xb5f8('0x30')](_0x5e11e3[_0xb5f8('0x2d')],_0x5e11e3[_0xb5f8('0x2e')]);_0x524a75[_0xb5f8('0x31')]=_[_0xb5f8('0x30')](_0x5e11e3[_0xb5f8('0x2d')],qs[_0xb5f8('0x32')](_0x1dcf44[_0xb5f8('0x2e')][_0xb5f8('0x32')]));_0x524a75[_0xb5f8('0x31')]=_0x524a75['attributes'][_0xb5f8('0x44')]?_0x524a75[_0xb5f8('0x31')]:_0x5e11e3['model'];if(_0x1dcf44[_0xb5f8('0x2e')]['includeAll']){_0x524a75[_0xb5f8('0x3e')]=[{'all':!![]}];}_0x524a75=_['merge']({},_0x524a75,_0x1dcf44[_0xb5f8('0x3c')]);return db[_0xb5f8('0x29')][_0xb5f8('0x45')](_0x524a75)['then'](handleEntityNotFound(_0x42e1a9,null))[_0xb5f8('0x24')](respondWithResult(_0x42e1a9,null))[_0xb5f8('0x40')](handleError(_0x42e1a9,null));};exports['create']=function(_0x18f348,_0x10fb91){return db[_0xb5f8('0x29')][_0xb5f8('0x46')](_0x18f348['body'],{})[_0xb5f8('0x24')](respondWithResult(_0x10fb91,0xc9))[_0xb5f8('0x40')](handleError(_0x10fb91,null));};exports[_0xb5f8('0x23')]=function(_0x4ad86e,_0x5a70cb){if(_0x4ad86e[_0xb5f8('0x47')]['id']){delete _0x4ad86e['body']['id'];}return db[_0xb5f8('0x29')]['find']({'where':{'id':_0x4ad86e[_0xb5f8('0x42')]['id']}})[_0xb5f8('0x24')](handleEntityNotFound(_0x5a70cb,null))[_0xb5f8('0x24')](saveUpdates(_0x4ad86e[_0xb5f8('0x47')],null))['then'](respondWithResult(_0x5a70cb,null))[_0xb5f8('0x40')](handleError(_0x5a70cb,null));};exports[_0xb5f8('0x48')]=function(_0x5cc75f,_0x321d42){return db[_0xb5f8('0x29')][_0xb5f8('0x45')]({'where':{'id':_0x5cc75f[_0xb5f8('0x42')]['id']}})['then'](handleEntityNotFound(_0x321d42,null))[_0xb5f8('0x24')](removeEntity(_0x321d42,null))['catch'](handleError(_0x321d42,null));};exports[_0xb5f8('0x49')]=function(_0x335eaf,_0x228924,_0x3c0318){var _0x2caab6={};var _0x463aad={};var _0x126150;var _0x3dbcec;return db[_0xb5f8('0x29')][_0xb5f8('0x4a')]({'where':{'id':_0x335eaf[_0xb5f8('0x42')]['id']}})['then'](handleEntityNotFound(_0x228924,null))[_0xb5f8('0x24')](function(_0x24d2e0){if(_0x24d2e0){_0x126150=_0x24d2e0;_0x463aad[_0xb5f8('0x2d')]=_['keys'](db[_0xb5f8('0x4b')]['rawAttributes']);_0x463aad[_0xb5f8('0x2e')]=_[_0xb5f8('0x2f')](_0x335eaf[_0xb5f8('0x2e')]);_0x463aad[_0xb5f8('0x43')]=_[_0xb5f8('0x30')](_0x463aad[_0xb5f8('0x2d')],_0x463aad[_0xb5f8('0x2e')]);_0x2caab6[_0xb5f8('0x31')]=_['intersection'](_0x463aad[_0xb5f8('0x2d')],qs[_0xb5f8('0x32')](_0x335eaf[_0xb5f8('0x2e')][_0xb5f8('0x32')]));_0x2caab6[_0xb5f8('0x31')]=_0x2caab6['attributes'][_0xb5f8('0x44')]?_0x2caab6['attributes']:_0x463aad[_0xb5f8('0x2d')];_0x2caab6[_0xb5f8('0x35')]=qs[_0xb5f8('0x36')](_0x335eaf[_0xb5f8('0x2e')][_0xb5f8('0x36')]);_0x2caab6[_0xb5f8('0x38')]=qs[_0xb5f8('0x43')](_[_0xb5f8('0x37')](_0x335eaf[_0xb5f8('0x2e')],_0x463aad[_0xb5f8('0x43')]));if(_0x335eaf[_0xb5f8('0x2e')][_0xb5f8('0x3b')]){_0x2caab6[_0xb5f8('0x38')]=_[_0xb5f8('0x39')](_0x2caab6[_0xb5f8('0x38')],{'$or':_[_0xb5f8('0x28')](_0x2caab6[_0xb5f8('0x31')],function(_0x28e9e7){var _0xbd1faf={};_0xbd1faf[_0x28e9e7]={'$like':'%'+_0x335eaf[_0xb5f8('0x2e')][_0xb5f8('0x3b')]+'%'};return _0xbd1faf;})});}_0x2caab6=_[_0xb5f8('0x39')]({},_0x2caab6,_0x335eaf[_0xb5f8('0x3c')]);return _0x126150[_0xb5f8('0x49')](_0x2caab6);}})['then'](function(_0x40c0f2){if(_0x40c0f2){_0x3dbcec=_0x40c0f2[_0xb5f8('0x44')];if(!_0x335eaf[_0xb5f8('0x2e')][_0xb5f8('0x33')](_0xb5f8('0x34'))){_0x2caab6['limit']=qs[_0xb5f8('0x1b')](_0x335eaf[_0xb5f8('0x2e')][_0xb5f8('0x1b')]);_0x2caab6[_0xb5f8('0x19')]=qs[_0xb5f8('0x19')](_0x335eaf[_0xb5f8('0x2e')]['offset']);}return _0x126150['getFields'](_0x2caab6);}})[_0xb5f8('0x24')](function(_0x1af25a){if(_0x1af25a){return _0x1af25a?{'count':_0x3dbcec,'rows':_0x1af25a}:null;}})['then'](respondWithResult(_0x228924,null))[_0xb5f8('0x40')](handleError(_0x228924,null));};exports['getSubjects']=function(_0x51c1e9,_0xa0b763,_0x42c2b8){var _0x1b91cc={};var _0x5c904d={};var _0x4e7d3c;var _0x5a8e98;return db['ZendeskConfiguration'][_0xb5f8('0x4a')]({'where':{'id':_0x51c1e9[_0xb5f8('0x42')]['id']}})[_0xb5f8('0x24')](handleEntityNotFound(_0xa0b763,null))[_0xb5f8('0x24')](function(_0x1e06b5){if(_0x1e06b5){_0x4e7d3c=_0x1e06b5;_0x5c904d[_0xb5f8('0x2d')]=_['keys'](db[_0xb5f8('0x4b')][_0xb5f8('0x2a')]);_0x5c904d[_0xb5f8('0x2e')]=_[_0xb5f8('0x2f')](_0x51c1e9[_0xb5f8('0x2e')]);_0x5c904d['filters']=_[_0xb5f8('0x30')](_0x5c904d[_0xb5f8('0x2d')],_0x5c904d[_0xb5f8('0x2e')]);_0x1b91cc['attributes']=_[_0xb5f8('0x30')](_0x5c904d['model'],qs[_0xb5f8('0x32')](_0x51c1e9[_0xb5f8('0x2e')][_0xb5f8('0x32')]));_0x1b91cc['attributes']=_0x1b91cc['attributes'][_0xb5f8('0x44')]?_0x1b91cc[_0xb5f8('0x31')]:_0x5c904d[_0xb5f8('0x2d')];_0x1b91cc[_0xb5f8('0x35')]=qs['sort'](_0x51c1e9[_0xb5f8('0x2e')][_0xb5f8('0x36')]);_0x1b91cc[_0xb5f8('0x38')]=qs['filters'](_[_0xb5f8('0x37')](_0x51c1e9[_0xb5f8('0x2e')],_0x5c904d[_0xb5f8('0x43')]));if(_0x51c1e9[_0xb5f8('0x2e')][_0xb5f8('0x3b')]){_0x1b91cc[_0xb5f8('0x38')]=_[_0xb5f8('0x39')](_0x1b91cc[_0xb5f8('0x38')],{'$or':_[_0xb5f8('0x28')](_0x1b91cc[_0xb5f8('0x31')],function(_0x5183e8){var _0x5bc844={};_0x5bc844[_0x5183e8]={'$like':'%'+_0x51c1e9['query'][_0xb5f8('0x3b')]+'%'};return _0x5bc844;})});}_0x1b91cc=_[_0xb5f8('0x39')]({},_0x1b91cc,_0x51c1e9[_0xb5f8('0x3c')]);return _0x4e7d3c[_0xb5f8('0x4c')](_0x1b91cc);}})['then'](function(_0x2fb410){if(_0x2fb410){_0x5a8e98=_0x2fb410[_0xb5f8('0x44')];if(!_0x51c1e9[_0xb5f8('0x2e')][_0xb5f8('0x33')]('nolimit')){_0x1b91cc[_0xb5f8('0x1b')]=qs[_0xb5f8('0x1b')](_0x51c1e9[_0xb5f8('0x2e')][_0xb5f8('0x1b')]);_0x1b91cc[_0xb5f8('0x19')]=qs[_0xb5f8('0x19')](_0x51c1e9['query'][_0xb5f8('0x19')]);}return _0x4e7d3c['getSubjects'](_0x1b91cc);}})[_0xb5f8('0x24')](function(_0x535d36){if(_0x535d36){return _0x535d36?{'count':_0x5a8e98,'rows':_0x535d36}:null;}})['then'](respondWithResult(_0xa0b763,null))[_0xb5f8('0x40')](handleError(_0xa0b763,null));};exports[_0xb5f8('0x4d')]=function(_0x352540,_0x6925f,_0x4312fd){var _0x3b8449={};var _0x92b0d0={};var _0x4ff02b;var _0x357858;return db[_0xb5f8('0x29')][_0xb5f8('0x4a')]({'where':{'id':_0x352540[_0xb5f8('0x42')]['id']}})[_0xb5f8('0x24')](handleEntityNotFound(_0x6925f,null))[_0xb5f8('0x24')](function(_0x15237a){if(_0x15237a){_0x4ff02b=_0x15237a;_0x92b0d0['model']=_['keys'](db[_0xb5f8('0x4b')][_0xb5f8('0x2a')]);_0x92b0d0[_0xb5f8('0x2e')]=_[_0xb5f8('0x2f')](_0x352540[_0xb5f8('0x2e')]);_0x92b0d0[_0xb5f8('0x43')]=_['intersection'](_0x92b0d0['model'],_0x92b0d0['query']);_0x3b8449[_0xb5f8('0x31')]=_[_0xb5f8('0x30')](_0x92b0d0[_0xb5f8('0x2d')],qs[_0xb5f8('0x32')](_0x352540[_0xb5f8('0x2e')][_0xb5f8('0x32')]));_0x3b8449[_0xb5f8('0x31')]=_0x3b8449[_0xb5f8('0x31')][_0xb5f8('0x44')]?_0x3b8449['attributes']:_0x92b0d0[_0xb5f8('0x2d')];_0x3b8449[_0xb5f8('0x35')]=qs['sort'](_0x352540['query']['sort']);_0x3b8449[_0xb5f8('0x38')]=qs[_0xb5f8('0x43')](_[_0xb5f8('0x37')](_0x352540['query'],_0x92b0d0[_0xb5f8('0x43')]));if(_0x352540['query']['filter']){_0x3b8449['where']=_['merge'](_0x3b8449['where'],{'$or':_[_0xb5f8('0x28')](_0x3b8449[_0xb5f8('0x31')],function(_0x469749){var _0x1069c1={};_0x1069c1[_0x469749]={'$like':'%'+_0x352540[_0xb5f8('0x2e')][_0xb5f8('0x3b')]+'%'};return _0x1069c1;})});}_0x3b8449=_['merge']({},_0x3b8449,_0x352540['options']);return _0x4ff02b[_0xb5f8('0x4d')](_0x3b8449);}})[_0xb5f8('0x24')](function(_0xe61766){if(_0xe61766){_0x357858=_0xe61766['length'];if(!_0x352540['query'][_0xb5f8('0x33')](_0xb5f8('0x34'))){_0x3b8449[_0xb5f8('0x1b')]=qs[_0xb5f8('0x1b')](_0x352540[_0xb5f8('0x2e')][_0xb5f8('0x1b')]);_0x3b8449[_0xb5f8('0x19')]=qs[_0xb5f8('0x19')](_0x352540[_0xb5f8('0x2e')]['offset']);}return _0x4ff02b[_0xb5f8('0x4d')](_0x3b8449);}})[_0xb5f8('0x24')](function(_0x5632f4){if(_0x5632f4){return _0x5632f4?{'count':_0x357858,'rows':_0x5632f4}:null;}})[_0xb5f8('0x24')](respondWithResult(_0x6925f,null))[_0xb5f8('0x40')](handleError(_0x6925f,null));};exports[_0xb5f8('0x4e')]=function(_0x1fed81,_0xe567b8,_0x497efa){var _0x115c99={};var _0x33e223={};var _0x533916;var _0x234baf;return db[_0xb5f8('0x29')][_0xb5f8('0x4a')]({'where':{'id':_0x1fed81['params']['id']}})[_0xb5f8('0x24')](handleEntityNotFound(_0xe567b8,null))[_0xb5f8('0x24')](function(_0x18e350){if(_0x18e350){_0x533916=_0x18e350;_0x33e223['model']=_[_0xb5f8('0x2f')](db[_0xb5f8('0x4f')]['rawAttributes']);_0x33e223[_0xb5f8('0x2e')]=_[_0xb5f8('0x2f')](_0x1fed81[_0xb5f8('0x2e')]);_0x33e223[_0xb5f8('0x43')]=_[_0xb5f8('0x30')](_0x33e223[_0xb5f8('0x2d')],_0x33e223['query']);_0x115c99[_0xb5f8('0x31')]=_[_0xb5f8('0x30')](_0x33e223[_0xb5f8('0x2d')],qs[_0xb5f8('0x32')](_0x1fed81[_0xb5f8('0x2e')]['fields']));_0x115c99[_0xb5f8('0x31')]=_0x115c99['attributes'][_0xb5f8('0x44')]?_0x115c99[_0xb5f8('0x31')]:_0x33e223[_0xb5f8('0x2d')];_0x115c99['order']=qs[_0xb5f8('0x36')](_0x1fed81[_0xb5f8('0x2e')][_0xb5f8('0x36')]);_0x115c99[_0xb5f8('0x38')]=qs[_0xb5f8('0x43')](_[_0xb5f8('0x37')](_0x1fed81[_0xb5f8('0x2e')],_0x33e223['filters']));if(_0x1fed81[_0xb5f8('0x2e')]['filter']){_0x115c99[_0xb5f8('0x38')]=_[_0xb5f8('0x39')](_0x115c99[_0xb5f8('0x38')],{'$or':_[_0xb5f8('0x28')](_0x115c99[_0xb5f8('0x31')],function(_0x16b47c){var _0x20eb50={};_0x20eb50[_0x16b47c]={'$like':'%'+_0x1fed81[_0xb5f8('0x2e')][_0xb5f8('0x3b')]+'%'};return _0x20eb50;})});}_0x115c99=_['merge']({},_0x115c99,_0x1fed81['options']);return _0x533916[_0xb5f8('0x4e')](_0x115c99);}})[_0xb5f8('0x24')](function(_0xf231){if(_0xf231){_0x234baf=_0xf231[_0xb5f8('0x44')];if(!_0x1fed81['query'][_0xb5f8('0x33')]('nolimit')){_0x115c99['limit']=qs[_0xb5f8('0x1b')](_0x1fed81[_0xb5f8('0x2e')][_0xb5f8('0x1b')]);_0x115c99[_0xb5f8('0x19')]=qs[_0xb5f8('0x19')](_0x1fed81[_0xb5f8('0x2e')]['offset']);}return _0x533916[_0xb5f8('0x4e')](_0x115c99);}})[_0xb5f8('0x24')](function(_0x2eade7){if(_0x2eade7){return _0x2eade7?{'count':_0x234baf,'rows':_0x2eade7}:null;}})[_0xb5f8('0x24')](respondWithResult(_0xe567b8,null))[_0xb5f8('0x40')](handleError(_0xe567b8,null));};exports[_0xb5f8('0x50')]=function(_0x32c73f,_0x115a22,_0x576355){if(_0x32c73f[_0xb5f8('0x47')]['id']){delete _0x32c73f[_0xb5f8('0x47')]['id'];}return db['ZendeskConfiguration'][_0xb5f8('0x4a')]({'where':{'id':_0x32c73f[_0xb5f8('0x42')]['id']}})[_0xb5f8('0x24')](handleEntityNotFound(_0x115a22,null))[_0xb5f8('0x24')](function(_0x1567b0){if(_0x1567b0){return _0x1567b0[_0xb5f8('0x50')](_0x32c73f[_0xb5f8('0x47')]['ids']||[]);}return null;})[_0xb5f8('0x24')](respondWithResult(_0x115a22,null))[_0xb5f8('0x40')](handleError(_0x115a22,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 5c7b7ff..12a5bdc 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 _0x14a0=['../../config/logger','api','moment','bluebird','request-promise','path','./intZendeskConfiguration.attributes','exports','ZendeskConfiguration','int_zendesk_configurations','util'];(function(_0x4f982e,_0x26932e){var _0x40394c=function(_0x13351d){while(--_0x13351d){_0x4f982e['push'](_0x4f982e['shift']());}};_0x40394c(++_0x26932e);}(_0x14a0,0x8e));var _0x014a=function(_0xd352de,_0x11e9a1){_0xd352de=_0xd352de-0x0;var _0x4672fe=_0x14a0[_0xd352de];return _0x4672fe;};'use strict';var _=require('lodash');var util=require(_0x014a('0x0'));var logger=require(_0x014a('0x1'))(_0x014a('0x2'));var moment=require(_0x014a('0x3'));var BPromise=require(_0x014a('0x4'));var rp=require(_0x014a('0x5'));var fs=require('fs');var path=require(_0x014a('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x014a('0x7'));module[_0x014a('0x8')]=function(_0x38a22c,_0x5ec84d){return _0x38a22c['define'](_0x014a('0x9'),attributes,{'tableName':_0x014a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xefda=['../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','api','moment','request-promise','path','rimraf'];(function(_0x54712d,_0x18e47e){var _0x50db67=function(_0x58f82d){while(--_0x58f82d){_0x54712d['push'](_0x54712d['shift']());}};_0x50db67(++_0x18e47e);}(_0xefda,0x96));var _0xaefd=function(_0x197b3b,_0x571444){_0x197b3b=_0x197b3b-0x0;var _0x4ebc99=_0xefda[_0x197b3b];return _0x4ebc99;};'use strict';var _=require(_0xaefd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xaefd('0x1'));var moment=require(_0xaefd('0x2'));var BPromise=require('bluebird');var rp=require(_0xaefd('0x3'));var fs=require('fs');var path=require(_0xaefd('0x4'));var rimraf=require(_0xaefd('0x5'));var config=require(_0xaefd('0x6'));var attributes=require(_0xaefd('0x7'));module[_0xaefd('0x8')]=function(_0x497258,_0x3677ea){return _0x497258[_0xaefd('0x9')](_0xaefd('0xa'),attributes,{'tableName':_0xaefd('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 06755fd..eadd8b1 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 _0xa033=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','request','then','info','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','lodash'];(function(_0x3783e0,_0x453996){var _0x1a6b7e=function(_0x24b6e9){while(--_0x24b6e9){_0x3783e0['push'](_0x3783e0['shift']());}};_0x1a6b7e(++_0x453996);}(_0xa033,0x1b7));var _0x3a03=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa033[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3a03('0x0'));var util=require(_0x3a03('0x1'));var moment=require(_0x3a03('0x2'));var BPromise=require(_0x3a03('0x3'));var rs=require(_0x3a03('0x4'));var fs=require('fs');var Redis=require(_0x3a03('0x5'));var db=require(_0x3a03('0x6'))['db'];var utils=require(_0x3a03('0x7'));var logger=require(_0x3a03('0x8'))(_0x3a03('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x209e53,_0x19c842,_0x195ab4){return new BPromise(function(_0x191891,_0x6e4898){return client[_0x3a03('0xa')](_0x209e53,_0x195ab4)[_0x3a03('0xb')](function(_0x3ebb95){logger[_0x3a03('0xc')]('ZendeskConfiguration,\x20%s,\x20%s',_0x19c842,_0x3a03('0xd'));logger['debug'](_0x3a03('0xe'),_0x19c842,_0x3a03('0xd'),JSON[_0x3a03('0xf')](_0x3ebb95));if(_0x3ebb95[_0x3a03('0x10')]){if(_0x3ebb95['error'][_0x3a03('0x11')]===0x1f4){logger[_0x3a03('0x10')](_0x3a03('0x12'),_0x19c842,_0x3ebb95[_0x3a03('0x10')]['message']);return _0x6e4898(_0x3ebb95[_0x3a03('0x10')]['message']);}logger['error'](_0x3a03('0x12'),_0x19c842,_0x3ebb95[_0x3a03('0x10')][_0x3a03('0x13')]);return _0x191891(_0x3ebb95[_0x3a03('0x10')][_0x3a03('0x13')]);}else{logger[_0x3a03('0xc')](_0x3a03('0x12'),_0x19c842,'request\x20sent');_0x191891(_0x3ebb95['result'][_0x3a03('0x13')]);}})['catch'](function(_0x506a2a){logger[_0x3a03('0x10')](_0x3a03('0x12'),_0x19c842,_0x506a2a);_0x6e4898(_0x506a2a);});});} \ No newline at end of file +var _0x0fd0=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash'];(function(_0x2f4c34,_0x4bd331){var _0x5421eb=function(_0x308499){while(--_0x308499){_0x2f4c34['push'](_0x2f4c34['shift']());}};_0x5421eb(++_0x4bd331);}(_0x0fd0,0x17b));var _0x00fd=function(_0x48ba8b,_0x34ab24){_0x48ba8b=_0x48ba8b-0x0;var _0x4842c3=_0x0fd0[_0x48ba8b];return _0x4842c3;};'use strict';var _=require(_0x00fd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x00fd('0x1'));var rs=require(_0x00fd('0x2'));var fs=require('fs');var Redis=require(_0x00fd('0x3'));var db=require(_0x00fd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x00fd('0x5'))('rpc');var config=require(_0x00fd('0x6'));var jayson=require(_0x00fd('0x7'));var client=jayson[_0x00fd('0x8')][_0x00fd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e51a1,_0x8f5485,_0x49cf83){return new BPromise(function(_0x274595,_0x49bd39){return client[_0x00fd('0xa')](_0x1e51a1,_0x49cf83)[_0x00fd('0xb')](function(_0x35f209){logger['info'](_0x00fd('0xc'),_0x8f5485,_0x00fd('0xd'));logger['debug'](_0x00fd('0xe'),_0x8f5485,_0x00fd('0xd'),JSON[_0x00fd('0xf')](_0x35f209));if(_0x35f209[_0x00fd('0x10')]){if(_0x35f209['error'][_0x00fd('0x11')]===0x1f4){logger['error'](_0x00fd('0xc'),_0x8f5485,_0x35f209[_0x00fd('0x10')][_0x00fd('0x12')]);return _0x49bd39(_0x35f209['error']['message']);}logger[_0x00fd('0x10')](_0x00fd('0xc'),_0x8f5485,_0x35f209[_0x00fd('0x10')][_0x00fd('0x12')]);return _0x274595(_0x35f209[_0x00fd('0x10')][_0x00fd('0x12')]);}else{logger[_0x00fd('0x13')](_0x00fd('0xc'),_0x8f5485,_0x00fd('0xd'));_0x274595(_0x35f209['result'][_0x00fd('0x12')]);}})['catch'](function(_0x1c4603){logger[_0x00fd('0x10')]('ZendeskConfiguration,\x20%s,\x20%s',_0x8f5485,_0x1c4603);_0x49bd39(_0x1c4603);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index bee49bf..9e13885 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 _0x782c=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','/:id','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x782c,0x1e7));var _0xc782=function(_0x263acd,_0x5a9aec){_0x263acd=_0x263acd-0x0;var _0x14491b=_0x782c[_0x263acd];return _0x14491b;};'use strict';var multer=require(_0xc782('0x0'));var util=require(_0xc782('0x1'));var path=require(_0xc782('0x2'));var timeout=require(_0xc782('0x3'));var express=require(_0xc782('0x4'));var router=express[_0xc782('0x5')]();var fs_extra=require(_0xc782('0x6'));var auth=require(_0xc782('0x7'));var interaction=require(_0xc782('0x8'));var config=require(_0xc782('0x9'));var controller=require(_0xc782('0xa'));router[_0xc782('0xb')]('/',auth[_0xc782('0xc')](),controller['index']);router['get'](_0xc782('0xd'),auth[_0xc782('0xc')](),controller['show']);router[_0xc782('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc782('0xf')](_0xc782('0xd'),auth[_0xc782('0xc')](),controller['update']);router[_0xc782('0x10')](_0xc782('0xd'),auth[_0xc782('0xc')](),controller[_0xc782('0x11')]);module[_0xc782('0x12')]=router; \ No newline at end of file +var _0xd5e1=['isAuthenticated','index','get','/:id','show','post','create','put','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskField.controller'];(function(_0x260f28,_0x4e9b30){var _0x3aefcc=function(_0x223b18){while(--_0x223b18){_0x260f28['push'](_0x260f28['shift']());}};_0x3aefcc(++_0x4e9b30);}(_0xd5e1,0x183));var _0x1d5e=function(_0x49091e,_0x1104e9){_0x49091e=_0x49091e-0x0;var _0x59b28c=_0xd5e1[_0x49091e];return _0x59b28c;};'use strict';var multer=require(_0x1d5e('0x0'));var util=require(_0x1d5e('0x1'));var path=require(_0x1d5e('0x2'));var timeout=require(_0x1d5e('0x3'));var express=require(_0x1d5e('0x4'));var router=express['Router']();var fs_extra=require(_0x1d5e('0x5'));var auth=require(_0x1d5e('0x6'));var interaction=require(_0x1d5e('0x7'));var config=require('../../config/environment');var controller=require(_0x1d5e('0x8'));router['get']('/',auth[_0x1d5e('0x9')](),controller[_0x1d5e('0xa')]);router[_0x1d5e('0xb')](_0x1d5e('0xc'),auth['isAuthenticated'](),controller[_0x1d5e('0xd')]);router[_0x1d5e('0xe')]('/',auth[_0x1d5e('0x9')](),controller[_0x1d5e('0xf')]);router[_0x1d5e('0x10')](_0x1d5e('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x1d5e('0xc'),auth[_0x1d5e('0x9')](),controller['destroy']);module[_0x1d5e('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 6debb29..34da9a3 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 _0x0de9=['variable','keyValue','picklist','STRING','string','BOOLEAN','sequelize','exports','ENUM'];(function(_0x16befc,_0x23264e){var _0x21d967=function(_0x527f0b){while(--_0x527f0b){_0x16befc['push'](_0x16befc['shift']());}};_0x21d967(++_0x23264e);}(_0x0de9,0x10b));var _0x90de=function(_0x5ac927,_0x717a17){_0x5ac927=_0x5ac927-0x0;var _0x17faac=_0x0de9[_0x5ac927];return _0x17faac;};'use strict';var Sequelize=require(_0x90de('0x0'));module[_0x90de('0x1')]={'type':{'type':Sequelize[_0x90de('0x2')]('string',_0x90de('0x3'),'customVariable',_0x90de('0x4'),_0x90de('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x90de('0x6')]},'key':{'type':Sequelize[_0x90de('0x6')]},'keyType':{'type':Sequelize[_0x90de('0x2')](_0x90de('0x7'),_0x90de('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x90de('0x6')]},'idField':{'type':Sequelize[_0x90de('0x6')]},'nameField':{'type':Sequelize[_0x90de('0x6')]},'customField':{'type':Sequelize[_0x90de('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x90de('0x6')]}}; \ No newline at end of file +var _0xe862=['customVariable','keyValue','string','STRING','BOOLEAN','sequelize','ENUM','variable'];(function(_0x543bf6,_0x763bd7){var _0x4187b3=function(_0x2e44c7){while(--_0x2e44c7){_0x543bf6['push'](_0x543bf6['shift']());}};_0x4187b3(++_0x763bd7);}(_0xe862,0x8d));var _0x2e86=function(_0x1c9667,_0x4fa259){_0x1c9667=_0x1c9667-0x0;var _0x31a39e=_0xe862[_0x1c9667];return _0x31a39e;};'use strict';var Sequelize=require(_0x2e86('0x0'));module['exports']={'type':{'type':Sequelize[_0x2e86('0x1')]('string',_0x2e86('0x2'),_0x2e86('0x3'),_0x2e86('0x4'),'picklist'),'defaultValue':_0x2e86('0x5')},'content':{'type':Sequelize[_0x2e86('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x2e86('0x5'),_0x2e86('0x2'),_0x2e86('0x3'))},'keyContent':{'type':Sequelize[_0x2e86('0x6')]},'idField':{'type':Sequelize[_0x2e86('0x6')]},'nameField':{'type':Sequelize[_0x2e86('0x6')]},'customField':{'type':Sequelize[_0x2e86('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 5e21344..e21ba9e 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 _0xdfb5=['crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','set','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','ZendeskField','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','nolimit','limit','order','sort','pick','where','merge','filter','options','count','findAll','rows','catch','show','params','include','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash'];(function(_0x5c4e16,_0x113035){var _0x36044a=function(_0xde2f25){while(--_0xde2f25){_0x5c4e16['push'](_0x5c4e16['shift']());}};_0x36044a(++_0x113035);}(_0xdfb5,0x8a));var _0x5dfb=function(_0x43ea41,_0x13c050){_0x43ea41=_0x43ea41-0x0;var _0x50e265=_0xdfb5[_0x43ea41];return _0x50e265;};'use strict';var emlformat=require(_0x5dfb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5dfb('0x1'));var jsonpatch=require(_0x5dfb('0x2'));var rp=require(_0x5dfb('0x3'));var moment=require('moment');var BPromise=require(_0x5dfb('0x4'));var Mustache=require(_0x5dfb('0x5'));var util=require(_0x5dfb('0x6'));var path=require(_0x5dfb('0x7'));var sox=require('sox');var csv=require(_0x5dfb('0x8'));var ejs=require(_0x5dfb('0x9'));var fs=require('fs');var fs_extra=require(_0x5dfb('0xa'));var _=require(_0x5dfb('0xb'));var squel=require('squel');var crypto=require(_0x5dfb('0xc'));var jsforce=require(_0x5dfb('0xd'));var deskjs=require(_0x5dfb('0xe'));var toCsv=require(_0x5dfb('0x8'));var querystring=require(_0x5dfb('0xf'));var Papa=require(_0x5dfb('0x10'));var Redis=require('ioredis');var authService=require(_0x5dfb('0x11'));var qs=require(_0x5dfb('0x12'));var as=require(_0x5dfb('0x13'));var hardwareService=require(_0x5dfb('0x14'));var logger=require(_0x5dfb('0x15'))('api');var utils=require(_0x5dfb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5dfb('0x17'));var db=require(_0x5dfb('0x18'))['db'];function respondWithStatusCode(_0x380363,_0x981467){_0x981467=_0x981467||0xcc;return function(_0x4f4248){if(_0x4f4248){return _0x380363['sendStatus'](_0x981467);}return _0x380363[_0x5dfb('0x19')](_0x981467)[_0x5dfb('0x1a')]();};}function respondWithResult(_0x1eb5de,_0x5eada9){_0x5eada9=_0x5eada9||0xc8;return function(_0x1eed3d){if(_0x1eed3d){return _0x1eb5de[_0x5dfb('0x19')](_0x5eada9)['json'](_0x1eed3d);}};}function respondWithFilteredResult(_0x4bd912,_0x3e3ca7){return function(_0x16ed38){if(_0x16ed38){var _0xa0e19f=typeof _0x3e3ca7[_0x5dfb('0x1b')]===_0x5dfb('0x1c')&&typeof _0x3e3ca7['limit']===_0x5dfb('0x1c');var _0x2d90fe=_0x16ed38['count'];var _0x14bb81=_0xa0e19f?0x0:_0x3e3ca7[_0x5dfb('0x1b')];var _0x3e566c=_0xa0e19f?_0x16ed38['count']:_0x3e3ca7[_0x5dfb('0x1b')]+_0x3e3ca7['limit'];var _0x2e6f70;if(_0x3e566c>=_0x2d90fe){_0x3e566c=_0x2d90fe;_0x2e6f70=0xc8;}else{_0x2e6f70=0xce;}_0x4bd912['status'](_0x2e6f70);return _0x4bd912[_0x5dfb('0x1d')]('Content-Range',_0x14bb81+'-'+_0x3e566c+'/'+_0x2d90fe)[_0x5dfb('0x1e')](_0x16ed38);}return null;};}function patchUpdates(_0x2faaaf){return function(_0x1e3df4){try{jsonpatch[_0x5dfb('0x1f')](_0x1e3df4,_0x2faaaf,!![]);}catch(_0x5ef1cf){return BPromise[_0x5dfb('0x20')](_0x5ef1cf);}return _0x1e3df4[_0x5dfb('0x21')]();};}function saveUpdates(_0x1c2fe8,_0x747eeb){return function(_0x4a59d0){if(_0x4a59d0){return _0x4a59d0[_0x5dfb('0x22')](_0x1c2fe8)[_0x5dfb('0x23')](function(_0x29073f){return _0x29073f;});}return null;};}function removeEntity(_0x35b97a,_0xc87c56){return function(_0x55d548){if(_0x55d548){return _0x55d548[_0x5dfb('0x24')]()[_0x5dfb('0x23')](function(){_0x35b97a[_0x5dfb('0x19')](0xcc)[_0x5dfb('0x1a')]();});}};}function handleEntityNotFound(_0x30b95a,_0xcd7e77){return function(_0x551dd2){if(!_0x551dd2){_0x30b95a[_0x5dfb('0x25')](0x194);}return _0x551dd2;};}function handleError(_0x52482e,_0x569fa8){_0x569fa8=_0x569fa8||0x1f4;return function(_0x103b78){logger[_0x5dfb('0x26')](_0x103b78[_0x5dfb('0x27')]);if(_0x103b78['name']){delete _0x103b78[_0x5dfb('0x28')];}_0x52482e[_0x5dfb('0x19')](_0x569fa8)[_0x5dfb('0x29')](_0x103b78);};}exports[_0x5dfb('0x2a')]=function(_0x224fb8,_0x12d634){var _0x56d47c={},_0x5188d9={},_0x2cf3f9={'count':0x0,'rows':[]};var _0x22e6f0=_['map'](db[_0x5dfb('0x2b')][_0x5dfb('0x2c')],function(_0x3a9d5b){return{'name':_0x3a9d5b[_0x5dfb('0x2d')],'type':_0x3a9d5b[_0x5dfb('0x2e')][_0x5dfb('0x2f')]};});_0x5188d9['model']=_['map'](_0x22e6f0,_0x5dfb('0x28'));_0x5188d9['query']=_[_0x5dfb('0x30')](_0x224fb8[_0x5dfb('0x31')]);_0x5188d9[_0x5dfb('0x32')]=_[_0x5dfb('0x33')](_0x5188d9[_0x5dfb('0x34')],_0x5188d9[_0x5dfb('0x31')]);_0x56d47c[_0x5dfb('0x35')]=_[_0x5dfb('0x33')](_0x5188d9[_0x5dfb('0x34')],qs[_0x5dfb('0x36')](_0x224fb8[_0x5dfb('0x31')]['fields']));_0x56d47c['attributes']=_0x56d47c[_0x5dfb('0x35')][_0x5dfb('0x37')]?_0x56d47c['attributes']:_0x5188d9['model'];if(!_0x224fb8[_0x5dfb('0x31')]['hasOwnProperty'](_0x5dfb('0x38'))){_0x56d47c[_0x5dfb('0x39')]=qs[_0x5dfb('0x39')](_0x224fb8[_0x5dfb('0x31')][_0x5dfb('0x39')]);_0x56d47c['offset']=qs[_0x5dfb('0x1b')](_0x224fb8[_0x5dfb('0x31')][_0x5dfb('0x1b')]);}_0x56d47c[_0x5dfb('0x3a')]=qs[_0x5dfb('0x3b')](_0x224fb8[_0x5dfb('0x31')][_0x5dfb('0x3b')]);_0x56d47c['where']=qs[_0x5dfb('0x32')](_[_0x5dfb('0x3c')](_0x224fb8[_0x5dfb('0x31')],_0x5188d9[_0x5dfb('0x32')]),_0x22e6f0);if(_0x224fb8[_0x5dfb('0x31')]['filter']){_0x56d47c[_0x5dfb('0x3d')]=_[_0x5dfb('0x3e')](_0x56d47c['where'],{'$or':_['map'](_0x22e6f0,function(_0x3a81fa){if(_0x3a81fa[_0x5dfb('0x2e')]!=='VIRTUAL'){var _0x23c9f5={};_0x23c9f5[_0x3a81fa[_0x5dfb('0x28')]]={'$like':'%'+_0x224fb8[_0x5dfb('0x31')][_0x5dfb('0x3f')]+'%'};return _0x23c9f5;}})});}_0x56d47c=_[_0x5dfb('0x3e')]({},_0x56d47c,_0x224fb8[_0x5dfb('0x40')]);var _0x367961={'where':_0x56d47c[_0x5dfb('0x3d')]};return db[_0x5dfb('0x2b')][_0x5dfb('0x41')](_0x367961)[_0x5dfb('0x23')](function(_0x4e9738){_0x2cf3f9[_0x5dfb('0x41')]=_0x4e9738;if(_0x224fb8[_0x5dfb('0x31')]['includeAll']){_0x56d47c['include']=[{'all':!![]}];}return db[_0x5dfb('0x2b')][_0x5dfb('0x42')](_0x56d47c);})[_0x5dfb('0x23')](function(_0x1ba904){_0x2cf3f9[_0x5dfb('0x43')]=_0x1ba904;return _0x2cf3f9;})['then'](respondWithFilteredResult(_0x12d634,_0x56d47c))[_0x5dfb('0x44')](handleError(_0x12d634,null));};exports[_0x5dfb('0x45')]=function(_0x38b89d,_0x588285){var _0x57b852={'raw':!![],'where':{'id':_0x38b89d[_0x5dfb('0x46')]['id']}},_0x41997f={};_0x41997f[_0x5dfb('0x34')]=_['keys'](db[_0x5dfb('0x2b')]['rawAttributes']);_0x41997f[_0x5dfb('0x31')]=_[_0x5dfb('0x30')](_0x38b89d[_0x5dfb('0x31')]);_0x41997f[_0x5dfb('0x32')]=_['intersection'](_0x41997f[_0x5dfb('0x34')],_0x41997f[_0x5dfb('0x31')]);_0x57b852[_0x5dfb('0x35')]=_[_0x5dfb('0x33')](_0x41997f[_0x5dfb('0x34')],qs[_0x5dfb('0x36')](_0x38b89d[_0x5dfb('0x31')][_0x5dfb('0x36')]));_0x57b852[_0x5dfb('0x35')]=_0x57b852[_0x5dfb('0x35')][_0x5dfb('0x37')]?_0x57b852[_0x5dfb('0x35')]:_0x41997f[_0x5dfb('0x34')];if(_0x38b89d[_0x5dfb('0x31')]['includeAll']){_0x57b852[_0x5dfb('0x47')]=[{'all':!![]}];}_0x57b852=_['merge']({},_0x57b852,_0x38b89d['options']);return db['ZendeskField'][_0x5dfb('0x48')](_0x57b852)[_0x5dfb('0x23')](handleEntityNotFound(_0x588285,null))[_0x5dfb('0x23')](respondWithResult(_0x588285,null))[_0x5dfb('0x44')](handleError(_0x588285,null));};exports[_0x5dfb('0x49')]=function(_0x4c7bc2,_0x8f0d95){return db[_0x5dfb('0x2b')][_0x5dfb('0x49')](_0x4c7bc2[_0x5dfb('0x4a')],{})['then'](respondWithResult(_0x8f0d95,0xc9))['catch'](handleError(_0x8f0d95,null));};exports[_0x5dfb('0x22')]=function(_0x40bbd7,_0x1dc4a3){if(_0x40bbd7[_0x5dfb('0x4a')]['id']){delete _0x40bbd7[_0x5dfb('0x4a')]['id'];}return db[_0x5dfb('0x2b')]['find']({'where':{'id':_0x40bbd7[_0x5dfb('0x46')]['id']}})['then'](handleEntityNotFound(_0x1dc4a3,null))[_0x5dfb('0x23')](saveUpdates(_0x40bbd7[_0x5dfb('0x4a')],null))[_0x5dfb('0x23')](respondWithResult(_0x1dc4a3,null))[_0x5dfb('0x44')](handleError(_0x1dc4a3,null));};exports[_0x5dfb('0x24')]=function(_0x358494,_0x582851){return db[_0x5dfb('0x2b')][_0x5dfb('0x48')]({'where':{'id':_0x358494[_0x5dfb('0x46')]['id']}})[_0x5dfb('0x23')](handleEntityNotFound(_0x582851,null))['then'](removeEntity(_0x582851,null))[_0x5dfb('0x44')](handleError(_0x582851,null));}; \ No newline at end of file +var _0xdb51=['ZendeskField','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error','stack','name','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options'];(function(_0x2df5a4,_0x52bfdc){var _0x17b31d=function(_0x5c0c1e){while(--_0x5c0c1e){_0x2df5a4['push'](_0x2df5a4['shift']());}};_0x17b31d(++_0x52bfdc);}(_0xdb51,0x1cf));var _0x1db5=function(_0xe1b2a8,_0x38f786){_0xe1b2a8=_0xe1b2a8-0x0;var _0x554804=_0xdb51[_0xe1b2a8];return _0x554804;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1db5('0x0'));var zipdir=require(_0x1db5('0x1'));var jsonpatch=require(_0x1db5('0x2'));var rp=require(_0x1db5('0x3'));var moment=require(_0x1db5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1db5('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x1db5('0x6'));var ejs=require(_0x1db5('0x7'));var fs=require('fs');var fs_extra=require(_0x1db5('0x8'));var _=require(_0x1db5('0x9'));var squel=require(_0x1db5('0xa'));var crypto=require('crypto');var jsforce=require(_0x1db5('0xb'));var deskjs=require(_0x1db5('0xc'));var toCsv=require(_0x1db5('0x6'));var querystring=require(_0x1db5('0xd'));var Papa=require('papaparse');var Redis=require(_0x1db5('0xe'));var authService=require(_0x1db5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x1db5('0x10'));var hardwareService=require(_0x1db5('0x11'));var logger=require(_0x1db5('0x12'))(_0x1db5('0x13'));var utils=require(_0x1db5('0x14'));var config=require(_0x1db5('0x15'));var licenseUtil=require(_0x1db5('0x16'));var db=require(_0x1db5('0x17'))['db'];function respondWithStatusCode(_0x360d60,_0x379f78){_0x379f78=_0x379f78||0xcc;return function(_0x5e6e6b){if(_0x5e6e6b){return _0x360d60[_0x1db5('0x18')](_0x379f78);}return _0x360d60[_0x1db5('0x19')](_0x379f78)[_0x1db5('0x1a')]();};}function respondWithResult(_0x55c3e,_0x400f1f){_0x400f1f=_0x400f1f||0xc8;return function(_0x1febb6){if(_0x1febb6){return _0x55c3e[_0x1db5('0x19')](_0x400f1f)[_0x1db5('0x1b')](_0x1febb6);}};}function respondWithFilteredResult(_0x46eeee,_0x122ce1){return function(_0x5118d0){if(_0x5118d0){var _0x543fe6=typeof _0x122ce1[_0x1db5('0x1c')]===_0x1db5('0x1d')&&typeof _0x122ce1[_0x1db5('0x1e')]===_0x1db5('0x1d');var _0x5294e6=_0x5118d0[_0x1db5('0x1f')];var _0x397083=_0x543fe6?0x0:_0x122ce1['offset'];var _0x5a1423=_0x543fe6?_0x5118d0[_0x1db5('0x1f')]:_0x122ce1[_0x1db5('0x1c')]+_0x122ce1['limit'];var _0x227af5;if(_0x5a1423>=_0x5294e6){_0x5a1423=_0x5294e6;_0x227af5=0xc8;}else{_0x227af5=0xce;}_0x46eeee[_0x1db5('0x19')](_0x227af5);return _0x46eeee[_0x1db5('0x20')]('Content-Range',_0x397083+'-'+_0x5a1423+'/'+_0x5294e6)['json'](_0x5118d0);}return null;};}function patchUpdates(_0x43f944){return function(_0x2447b2){try{jsonpatch[_0x1db5('0x21')](_0x2447b2,_0x43f944,!![]);}catch(_0x12ad62){return BPromise[_0x1db5('0x22')](_0x12ad62);}return _0x2447b2[_0x1db5('0x23')]();};}function saveUpdates(_0x30664f,_0x2185eb){return function(_0x866567){if(_0x866567){return _0x866567[_0x1db5('0x24')](_0x30664f)[_0x1db5('0x25')](function(_0x26205e){return _0x26205e;});}return null;};}function removeEntity(_0x38922f,_0x236360){return function(_0x17c5fc){if(_0x17c5fc){return _0x17c5fc['destroy']()['then'](function(){_0x38922f[_0x1db5('0x19')](0xcc)[_0x1db5('0x1a')]();});}};}function handleEntityNotFound(_0x3e4318,_0xc6fb22){return function(_0xe21f04){if(!_0xe21f04){_0x3e4318[_0x1db5('0x18')](0x194);}return _0xe21f04;};}function handleError(_0x5bb0aa,_0x4689c0){_0x4689c0=_0x4689c0||0x1f4;return function(_0x4b8ba8){logger[_0x1db5('0x26')](_0x4b8ba8[_0x1db5('0x27')]);if(_0x4b8ba8[_0x1db5('0x28')]){delete _0x4b8ba8[_0x1db5('0x28')];}_0x5bb0aa['status'](_0x4689c0)['send'](_0x4b8ba8);};}exports[_0x1db5('0x29')]=function(_0xc2a72a,_0x317288){var _0xdc0ff={},_0x4c1c4c={},_0x15e9bf={'count':0x0,'rows':[]};var _0x39e6a4=_[_0x1db5('0x2a')](db['ZendeskField'][_0x1db5('0x2b')],function(_0x35a3d4){return{'name':_0x35a3d4['fieldName'],'type':_0x35a3d4[_0x1db5('0x2c')][_0x1db5('0x2d')]};});_0x4c1c4c[_0x1db5('0x2e')]=_[_0x1db5('0x2a')](_0x39e6a4,_0x1db5('0x28'));_0x4c1c4c[_0x1db5('0x2f')]=_[_0x1db5('0x30')](_0xc2a72a[_0x1db5('0x2f')]);_0x4c1c4c[_0x1db5('0x31')]=_[_0x1db5('0x32')](_0x4c1c4c[_0x1db5('0x2e')],_0x4c1c4c['query']);_0xdc0ff[_0x1db5('0x33')]=_[_0x1db5('0x32')](_0x4c1c4c[_0x1db5('0x2e')],qs[_0x1db5('0x34')](_0xc2a72a['query']['fields']));_0xdc0ff[_0x1db5('0x33')]=_0xdc0ff[_0x1db5('0x33')]['length']?_0xdc0ff[_0x1db5('0x33')]:_0x4c1c4c[_0x1db5('0x2e')];if(!_0xc2a72a[_0x1db5('0x2f')][_0x1db5('0x35')](_0x1db5('0x36'))){_0xdc0ff['limit']=qs[_0x1db5('0x1e')](_0xc2a72a[_0x1db5('0x2f')][_0x1db5('0x1e')]);_0xdc0ff[_0x1db5('0x1c')]=qs[_0x1db5('0x1c')](_0xc2a72a[_0x1db5('0x2f')][_0x1db5('0x1c')]);}_0xdc0ff[_0x1db5('0x37')]=qs[_0x1db5('0x38')](_0xc2a72a[_0x1db5('0x2f')][_0x1db5('0x38')]);_0xdc0ff[_0x1db5('0x39')]=qs[_0x1db5('0x31')](_[_0x1db5('0x3a')](_0xc2a72a[_0x1db5('0x2f')],_0x4c1c4c[_0x1db5('0x31')]),_0x39e6a4);if(_0xc2a72a[_0x1db5('0x2f')]['filter']){_0xdc0ff[_0x1db5('0x39')]=_[_0x1db5('0x3b')](_0xdc0ff[_0x1db5('0x39')],{'$or':_[_0x1db5('0x2a')](_0x39e6a4,function(_0x34d74a){if(_0x34d74a[_0x1db5('0x2c')]!==_0x1db5('0x3c')){var _0x577cdd={};_0x577cdd[_0x34d74a[_0x1db5('0x28')]]={'$like':'%'+_0xc2a72a[_0x1db5('0x2f')]['filter']+'%'};return _0x577cdd;}})});}_0xdc0ff=_['merge']({},_0xdc0ff,_0xc2a72a[_0x1db5('0x3d')]);var _0x51abf9={'where':_0xdc0ff['where']};return db[_0x1db5('0x3e')][_0x1db5('0x1f')](_0x51abf9)[_0x1db5('0x25')](function(_0x2ba2cc){_0x15e9bf[_0x1db5('0x1f')]=_0x2ba2cc;if(_0xc2a72a[_0x1db5('0x2f')][_0x1db5('0x3f')]){_0xdc0ff[_0x1db5('0x40')]=[{'all':!![]}];}return db[_0x1db5('0x3e')][_0x1db5('0x41')](_0xdc0ff);})[_0x1db5('0x25')](function(_0x582720){_0x15e9bf[_0x1db5('0x42')]=_0x582720;return _0x15e9bf;})['then'](respondWithFilteredResult(_0x317288,_0xdc0ff))[_0x1db5('0x43')](handleError(_0x317288,null));};exports[_0x1db5('0x44')]=function(_0x334cb1,_0x4915f4){var _0x2a19b6={'raw':!![],'where':{'id':_0x334cb1[_0x1db5('0x45')]['id']}},_0x3bd7a3={};_0x3bd7a3[_0x1db5('0x2e')]=_[_0x1db5('0x30')](db[_0x1db5('0x3e')][_0x1db5('0x2b')]);_0x3bd7a3['query']=_[_0x1db5('0x30')](_0x334cb1['query']);_0x3bd7a3[_0x1db5('0x31')]=_[_0x1db5('0x32')](_0x3bd7a3['model'],_0x3bd7a3[_0x1db5('0x2f')]);_0x2a19b6[_0x1db5('0x33')]=_[_0x1db5('0x32')](_0x3bd7a3['model'],qs[_0x1db5('0x34')](_0x334cb1[_0x1db5('0x2f')]['fields']));_0x2a19b6[_0x1db5('0x33')]=_0x2a19b6[_0x1db5('0x33')][_0x1db5('0x46')]?_0x2a19b6[_0x1db5('0x33')]:_0x3bd7a3[_0x1db5('0x2e')];if(_0x334cb1['query'][_0x1db5('0x3f')]){_0x2a19b6[_0x1db5('0x40')]=[{'all':!![]}];}_0x2a19b6=_[_0x1db5('0x3b')]({},_0x2a19b6,_0x334cb1[_0x1db5('0x3d')]);return db[_0x1db5('0x3e')][_0x1db5('0x47')](_0x2a19b6)[_0x1db5('0x25')](handleEntityNotFound(_0x4915f4,null))[_0x1db5('0x25')](respondWithResult(_0x4915f4,null))['catch'](handleError(_0x4915f4,null));};exports['create']=function(_0x5f77d0,_0x4e3e53){return db['ZendeskField'][_0x1db5('0x48')](_0x5f77d0[_0x1db5('0x49')],{})[_0x1db5('0x25')](respondWithResult(_0x4e3e53,0xc9))[_0x1db5('0x43')](handleError(_0x4e3e53,null));};exports[_0x1db5('0x24')]=function(_0x2a5721,_0x1bf0b3){if(_0x2a5721[_0x1db5('0x49')]['id']){delete _0x2a5721[_0x1db5('0x49')]['id'];}return db['ZendeskField'][_0x1db5('0x47')]({'where':{'id':_0x2a5721[_0x1db5('0x45')]['id']}})['then'](handleEntityNotFound(_0x1bf0b3,null))[_0x1db5('0x25')](saveUpdates(_0x2a5721[_0x1db5('0x49')],null))['then'](respondWithResult(_0x1bf0b3,null))['catch'](handleError(_0x1bf0b3,null));};exports[_0x1db5('0x4a')]=function(_0x1cd20f,_0x446a5c){return db[_0x1db5('0x3e')][_0x1db5('0x47')]({'where':{'id':_0x1cd20f[_0x1db5('0x45')]['id']}})['then'](handleEntityNotFound(_0x446a5c,null))[_0x1db5('0x25')](removeEntity(_0x446a5c,null))[_0x1db5('0x43')](handleError(_0x446a5c,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 8cdc73e..766cdd2 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 _0xbf0c=['./intZendeskField.attributes','exports','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1dc3b9,_0x225821){var _0x4e7a06=function(_0x22d89f){while(--_0x22d89f){_0x1dc3b9['push'](_0x1dc3b9['shift']());}};_0x4e7a06(++_0x225821);}(_0xbf0c,0x1e6));var _0xcbf0=function(_0x51ac09,_0x383098){_0x51ac09=_0x51ac09-0x0;var _0x3f827d=_0xbf0c[_0x51ac09];return _0x3f827d;};'use strict';var _=require(_0xcbf0('0x0'));var util=require(_0xcbf0('0x1'));var logger=require(_0xcbf0('0x2'))(_0xcbf0('0x3'));var moment=require('moment');var BPromise=require(_0xcbf0('0x4'));var rp=require(_0xcbf0('0x5'));var fs=require('fs');var path=require(_0xcbf0('0x6'));var rimraf=require(_0xcbf0('0x7'));var config=require(_0xcbf0('0x8'));var attributes=require(_0xcbf0('0x9'));module[_0xcbf0('0xa')]=function(_0x5e8b76,_0x22032b){return _0x5e8b76['define']('ZendeskField',attributes,{'tableName':_0xcbf0('0xb'),'paranoid':![],'indexes':[{'name':_0xcbf0('0xc'),'fields':[_0xcbf0('0xd'),_0xcbf0('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7d72=['request-promise','path','rimraf','../../config/environment','exports','define','ZendeskField','int_zendesk_fields','idField','FieldId','lodash','util','api','bluebird'];(function(_0x51a6d6,_0x3c9c49){var _0x5ef1a8=function(_0x8ff84a){while(--_0x8ff84a){_0x51a6d6['push'](_0x51a6d6['shift']());}};_0x5ef1a8(++_0x3c9c49);}(_0x7d72,0x15a));var _0x27d7=function(_0x41f2fc,_0x492cba){_0x41f2fc=_0x41f2fc-0x0;var _0x2102d4=_0x7d72[_0x41f2fc];return _0x2102d4;};'use strict';var _=require(_0x27d7('0x0'));var util=require(_0x27d7('0x1'));var logger=require('../../config/logger')(_0x27d7('0x2'));var moment=require('moment');var BPromise=require(_0x27d7('0x3'));var rp=require(_0x27d7('0x4'));var fs=require('fs');var path=require(_0x27d7('0x5'));var rimraf=require(_0x27d7('0x6'));var config=require(_0x27d7('0x7'));var attributes=require('./intZendeskField.attributes');module[_0x27d7('0x8')]=function(_0x499a38,_0x30a300){return _0x499a38[_0x27d7('0x9')](_0x27d7('0xa'),attributes,{'tableName':_0x27d7('0xb'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0x27d7('0xc'),_0x27d7('0xd')],'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 781fbd1..ea3f992 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 _0x0371=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ZendeskField,\x20%s,\x20%s','stringify','error','message','info','result','catch'];(function(_0x45f839,_0x4861a0){var _0x4c52b4=function(_0x374eec){while(--_0x374eec){_0x45f839['push'](_0x45f839['shift']());}};_0x4c52b4(++_0x4861a0);}(_0x0371,0xa8));var _0x1037=function(_0x5235dd,_0x3f91cf){_0x5235dd=_0x5235dd-0x0;var _0x13059d=_0x0371[_0x5235dd];return _0x13059d;};'use strict';var _=require('lodash');var util=require(_0x1037('0x0'));var moment=require(_0x1037('0x1'));var BPromise=require(_0x1037('0x2'));var rs=require(_0x1037('0x3'));var fs=require('fs');var Redis=require(_0x1037('0x4'));var db=require(_0x1037('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1037('0x6'))(_0x1037('0x7'));var config=require(_0x1037('0x8'));var jayson=require(_0x1037('0x9'));var client=jayson[_0x1037('0xa')][_0x1037('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x456616,_0x28208d,_0x528f74){return new BPromise(function(_0x1d445a,_0x59cc5b){return client[_0x1037('0xc')](_0x456616,_0x528f74)[_0x1037('0xd')](function(_0x2d587f){logger['info'](_0x1037('0xe'),_0x28208d,'request\x20sent');logger['debug']('ZendeskField,\x20%s,\x20%s,\x20%s',_0x28208d,'request\x20sent',JSON[_0x1037('0xf')](_0x2d587f));if(_0x2d587f[_0x1037('0x10')]){if(_0x2d587f['error']['code']===0x1f4){logger[_0x1037('0x10')](_0x1037('0xe'),_0x28208d,_0x2d587f[_0x1037('0x10')][_0x1037('0x11')]);return _0x59cc5b(_0x2d587f['error'][_0x1037('0x11')]);}logger[_0x1037('0x10')](_0x1037('0xe'),_0x28208d,_0x2d587f[_0x1037('0x10')]['message']);return _0x1d445a(_0x2d587f['error']['message']);}else{logger[_0x1037('0x12')](_0x1037('0xe'),_0x28208d,'request\x20sent');_0x1d445a(_0x2d587f[_0x1037('0x13')][_0x1037('0x11')]);}})[_0x1037('0x14')](function(_0x551bef){logger[_0x1037('0x10')]('ZendeskField,\x20%s,\x20%s',_0x28208d,_0x551bef);_0x59cc5b(_0x551bef);});});} \ No newline at end of file +var _0xd3ea=['rpc','jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger'];(function(_0x47b82b,_0x5d7cbc){var _0x51559f=function(_0x4448a9){while(--_0x4448a9){_0x47b82b['push'](_0x47b82b['shift']());}};_0x51559f(++_0x5d7cbc);}(_0xd3ea,0x92));var _0xad3e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xd3ea[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0xad3e('0x0'));var util=require('util');var moment=require(_0xad3e('0x1'));var BPromise=require(_0xad3e('0x2'));var rs=require(_0xad3e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xad3e('0x4'));var logger=require(_0xad3e('0x5'))(_0xad3e('0x6'));var config=require('../../config/environment');var jayson=require(_0xad3e('0x7'));var client=jayson[_0xad3e('0x8')][_0xad3e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x84b609,_0x158f25,_0x3ce011){return new BPromise(function(_0x5afef4,_0x2649a9){return client[_0xad3e('0xa')](_0x84b609,_0x3ce011)[_0xad3e('0xb')](function(_0x5e00e3){logger[_0xad3e('0xc')](_0xad3e('0xd'),_0x158f25,_0xad3e('0xe'));logger['debug']('ZendeskField,\x20%s,\x20%s,\x20%s',_0x158f25,_0xad3e('0xe'),JSON[_0xad3e('0xf')](_0x5e00e3));if(_0x5e00e3[_0xad3e('0x10')]){if(_0x5e00e3[_0xad3e('0x10')]['code']===0x1f4){logger[_0xad3e('0x10')](_0xad3e('0xd'),_0x158f25,_0x5e00e3[_0xad3e('0x10')][_0xad3e('0x11')]);return _0x2649a9(_0x5e00e3['error'][_0xad3e('0x11')]);}logger[_0xad3e('0x10')](_0xad3e('0xd'),_0x158f25,_0x5e00e3[_0xad3e('0x10')][_0xad3e('0x11')]);return _0x5afef4(_0x5e00e3[_0xad3e('0x10')][_0xad3e('0x11')]);}else{logger[_0xad3e('0xc')](_0xad3e('0xd'),_0x158f25,_0xad3e('0xe'));_0x5afef4(_0x5e00e3['result'][_0xad3e('0x11')]);}})[_0xad3e('0x12')](function(_0x1efc0d){logger[_0xad3e('0x10')](_0xad3e('0xd'),_0x158f25,_0x1efc0d);_0x2649a9(_0x1efc0d);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 36c137c..ef5bb88 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 _0x27b7=['create','addConfiguration','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','isAuthenticated','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post'];(function(_0x336264,_0x32e1d9){var _0x53cf91=function(_0x21026c){while(--_0x21026c){_0x336264['push'](_0x336264['shift']());}};_0x53cf91(++_0x32e1d9);}(_0x27b7,0x16f));var _0x727b=function(_0x15e857,_0x1412fc){_0x15e857=_0x15e857-0x0;var _0x4562e3=_0x27b7[_0x15e857];return _0x4562e3;};'use strict';var multer=require(_0x727b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x727b('0x1'));var express=require(_0x727b('0x2'));var router=express[_0x727b('0x3')]();var fs_extra=require(_0x727b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x727b('0x5'));var config=require(_0x727b('0x6'));var controller=require(_0x727b('0x7'));router['get']('/',auth[_0x727b('0x8')](),controller['index']);router[_0x727b('0x9')](_0x727b('0xa'),auth[_0x727b('0x8')](),controller[_0x727b('0xb')]);router[_0x727b('0x9')](_0x727b('0xc'),auth[_0x727b('0x8')](),controller[_0x727b('0xd')]);router['get'](_0x727b('0xe'),auth[_0x727b('0x8')](),controller[_0x727b('0xf')]);router[_0x727b('0x10')]('/',auth['isAuthenticated'](),controller[_0x727b('0x11')]);router[_0x727b('0x10')](_0x727b('0xc'),auth[_0x727b('0x8')](),controller[_0x727b('0x12')]);router[_0x727b('0x13')](_0x727b('0xa'),auth['isAuthenticated'](),controller[_0x727b('0x14')]);router[_0x727b('0x15')](_0x727b('0xa'),auth[_0x727b('0x8')](),controller[_0x727b('0x16')]);module[_0x727b('0x17')]=router; \ No newline at end of file +var _0x77ba=['util','path','connect-timeout','Router','fs-extra','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','exports','multer'];(function(_0x23b88,_0x2f0572){var _0x524f28=function(_0x443d50){while(--_0x443d50){_0x23b88['push'](_0x23b88['shift']());}};_0x524f28(++_0x2f0572);}(_0x77ba,0x141));var _0xa77b=function(_0x1809c5,_0x46cabc){_0x1809c5=_0x1809c5-0x0;var _0x5254a4=_0x77ba[_0x1809c5];return _0x5254a4;};'use strict';var multer=require(_0xa77b('0x0'));var util=require(_0xa77b('0x1'));var path=require(_0xa77b('0x2'));var timeout=require(_0xa77b('0x3'));var express=require('express');var router=express[_0xa77b('0x4')]();var fs_extra=require(_0xa77b('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa77b('0x6'));var controller=require(_0xa77b('0x7'));router[_0xa77b('0x8')]('/',auth[_0xa77b('0x9')](),controller[_0xa77b('0xa')]);router[_0xa77b('0x8')](_0xa77b('0xb'),auth['isAuthenticated'](),controller[_0xa77b('0xc')]);router['get'](_0xa77b('0xd'),auth['isAuthenticated'](),controller[_0xa77b('0xe')]);router['get'](_0xa77b('0xf'),auth[_0xa77b('0x9')](),controller[_0xa77b('0x10')]);router[_0xa77b('0x11')]('/',auth[_0xa77b('0x9')](),controller['create']);router[_0xa77b('0x11')](_0xa77b('0xd'),auth['isAuthenticated'](),controller[_0xa77b('0x12')]);router[_0xa77b('0x13')]('/:id',auth[_0xa77b('0x9')](),controller[_0xa77b('0x14')]);router[_0xa77b('0x15')](_0xa77b('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xa77b('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 9d64d6a..b5c65f2 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 _0xee5b=['sequelize','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xee5b,0x1f4));var _0xbee5=function(_0x2588a4,_0x1eff9b){_0x2588a4=_0x2588a4-0x0;var _0x152d9b=_0xee5b[_0x2588a4];return _0x152d9b;};'use strict';var Sequelize=require(_0xbee5('0x0'));module['exports']={'name':{'type':Sequelize[_0xbee5('0x1')]},'description':{'type':Sequelize[_0xbee5('0x1')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xbee5('0x1')]},'clientId':{'type':Sequelize[_0xbee5('0x1')]},'clientSecret':{'type':Sequelize[_0xbee5('0x1')]},'serverUrl':{'type':Sequelize[_0xbee5('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9a19=['sequelize','exports','STRING'];(function(_0x2e249d,_0x41b7e7){var _0x1faa37=function(_0x1422b4){while(--_0x1422b4){_0x2e249d['push'](_0x2e249d['shift']());}};_0x1faa37(++_0x41b7e7);}(_0x9a19,0x114));var _0x99a1=function(_0xa2c0a3,_0x5bbac0){_0xa2c0a3=_0xa2c0a3-0x0;var _0x52c618=_0x9a19[_0xa2c0a3];return _0x52c618;};'use strict';var Sequelize=require(_0x99a1('0x0'));module[_0x99a1('0x1')]={'name':{'type':Sequelize[_0x99a1('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x99a1('0x2')]},'zone':{'type':Sequelize[_0x99a1('0x2')]},'clientId':{'type':Sequelize[_0x99a1('0x2')]},'clientSecret':{'type':Sequelize[_0x99a1('0x2')]},'serverUrl':{'type':Sequelize[_0x99a1('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x99a1('0x2')]},'refreshToken':{'type':Sequelize[_0x99a1('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 7f0b9ed..ae53649 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 _0xe998=['com','serverUrl','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','error','message','Owner','Description','WhoId','Call_Result','Call_Type','remove','includes','system_mandatory','push','display_label','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','save','update','then','destroy','name','index','map','ZohoAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','ZohoConfiguration','order','getConfigurations','addConfiguration','findOne','AccountId','Subjects','channel','Descriptions','ZohoField','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','access_token','getFields','zone','refreshToken'];(function(_0x599d7f,_0xc586e8){var _0x3346d3=function(_0x56b820){while(--_0x56b820){_0x599d7f['push'](_0x599d7f['shift']());}};_0x3346d3(++_0xc586e8);}(_0xe998,0x11b));var _0x8e99=function(_0x26171f,_0x236cb1){_0x26171f=_0x26171f-0x0;var _0x1dd70f=_0xe998[_0x26171f];return _0x1dd70f;};'use strict';var emlformat=require(_0x8e99('0x0'));var rimraf=require(_0x8e99('0x1'));var zipdir=require(_0x8e99('0x2'));var jsonpatch=require(_0x8e99('0x3'));var rp=require(_0x8e99('0x4'));var moment=require('moment');var BPromise=require(_0x8e99('0x5'));var Mustache=require(_0x8e99('0x6'));var util=require(_0x8e99('0x7'));var path=require(_0x8e99('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8e99('0x9'));var crypto=require('crypto');var jsforce=require(_0x8e99('0xa'));var deskjs=require(_0x8e99('0xb'));var toCsv=require(_0x8e99('0xc'));var querystring=require(_0x8e99('0xd'));var Papa=require(_0x8e99('0xe'));var Redis=require(_0x8e99('0xf'));var authService=require(_0x8e99('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8e99('0x11'));var hardwareService=require(_0x8e99('0x12'));var logger=require(_0x8e99('0x13'))(_0x8e99('0x14'));var utils=require(_0x8e99('0x15'));var config=require(_0x8e99('0x16'));var licenseUtil=require(_0x8e99('0x17'));var db=require(_0x8e99('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x539cce,_0x41e2c3){_0x41e2c3=_0x41e2c3||0xcc;return function(_0x33a6ee){if(_0x33a6ee){return _0x539cce['sendStatus'](_0x41e2c3);}return _0x539cce[_0x8e99('0x19')](_0x41e2c3)[_0x8e99('0x1a')]();};}function respondWithResult(_0x132e6a,_0xe3d045){_0xe3d045=_0xe3d045||0xc8;return function(_0xd5fdaa){if(_0xd5fdaa){return _0x132e6a[_0x8e99('0x19')](_0xe3d045)[_0x8e99('0x1b')](_0xd5fdaa);}};}function respondWithFilteredResult(_0x486880,_0x2e4e41){return function(_0x32e56f){if(_0x32e56f){var _0x17ed8a=typeof _0x2e4e41[_0x8e99('0x1c')]==='undefined'&&typeof _0x2e4e41[_0x8e99('0x1d')]===_0x8e99('0x1e');var _0x5e9e58=_0x32e56f[_0x8e99('0x1f')];var _0x4739ab=_0x17ed8a?0x0:_0x2e4e41[_0x8e99('0x1c')];var _0x278213=_0x17ed8a?_0x32e56f['count']:_0x2e4e41['offset']+_0x2e4e41[_0x8e99('0x1d')];var _0x28277a;if(_0x278213>=_0x5e9e58){_0x278213=_0x5e9e58;_0x28277a=0xc8;}else{_0x28277a=0xce;}_0x486880[_0x8e99('0x19')](_0x28277a);return _0x486880[_0x8e99('0x20')](_0x8e99('0x21'),_0x4739ab+'-'+_0x278213+'/'+_0x5e9e58)[_0x8e99('0x1b')](_0x32e56f);}return null;};}function patchUpdates(_0x226d4f){return function(_0x229de2){try{jsonpatch['apply'](_0x229de2,_0x226d4f,!![]);}catch(_0x55fc78){return BPromise['reject'](_0x55fc78);}return _0x229de2[_0x8e99('0x22')]();};}function saveUpdates(_0x54edd6,_0x370e70){return function(_0xbf8a6f){if(_0xbf8a6f){return _0xbf8a6f[_0x8e99('0x23')](_0x54edd6)[_0x8e99('0x24')](function(_0x31433f){return _0x31433f;});}return null;};}function removeEntity(_0x5bfcb8,_0x406e11){return function(_0x596e3b){if(_0x596e3b){return _0x596e3b[_0x8e99('0x25')]()[_0x8e99('0x24')](function(){_0x5bfcb8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x590e8f,_0x34d155){return function(_0x7c54ca){if(!_0x7c54ca){_0x590e8f['sendStatus'](0x194);}return _0x7c54ca;};}function handleError(_0x44f48b,_0x708c04){_0x708c04=_0x708c04||0x1f4;return function(_0x5aa4cc){logger['error'](_0x5aa4cc['stack']);if(_0x5aa4cc[_0x8e99('0x26')]){delete _0x5aa4cc['name'];}_0x44f48b['status'](_0x708c04)['send'](_0x5aa4cc);};}exports[_0x8e99('0x27')]=function(_0x4dde6e,_0x28c7ad){var _0x13e8d9={},_0x275aed={},_0x1a724d={'count':0x0,'rows':[]};var _0x1e927e=_[_0x8e99('0x28')](db[_0x8e99('0x29')][_0x8e99('0x2a')],function(_0x44cd4c){return{'name':_0x44cd4c[_0x8e99('0x2b')],'type':_0x44cd4c[_0x8e99('0x2c')][_0x8e99('0x2d')]};});_0x275aed[_0x8e99('0x2e')]=_[_0x8e99('0x28')](_0x1e927e,_0x8e99('0x26'));_0x275aed[_0x8e99('0x2f')]=_[_0x8e99('0x30')](_0x4dde6e['query']);_0x275aed[_0x8e99('0x31')]=_[_0x8e99('0x32')](_0x275aed['model'],_0x275aed[_0x8e99('0x2f')]);_0x13e8d9['attributes']=_['intersection'](_0x275aed[_0x8e99('0x2e')],qs[_0x8e99('0x33')](_0x4dde6e[_0x8e99('0x2f')]['fields']));_0x13e8d9[_0x8e99('0x34')]=_0x13e8d9[_0x8e99('0x34')][_0x8e99('0x35')]?_0x13e8d9[_0x8e99('0x34')]:_0x275aed[_0x8e99('0x2e')];if(!_0x4dde6e[_0x8e99('0x2f')][_0x8e99('0x36')](_0x8e99('0x37'))){_0x13e8d9[_0x8e99('0x1d')]=qs['limit'](_0x4dde6e['query'][_0x8e99('0x1d')]);_0x13e8d9['offset']=qs['offset'](_0x4dde6e[_0x8e99('0x2f')][_0x8e99('0x1c')]);}_0x13e8d9['order']=qs[_0x8e99('0x38')](_0x4dde6e[_0x8e99('0x2f')][_0x8e99('0x38')]);_0x13e8d9['where']=qs[_0x8e99('0x31')](_['pick'](_0x4dde6e[_0x8e99('0x2f')],_0x275aed['filters']),_0x1e927e);if(_0x4dde6e['query']['filter']){_0x13e8d9[_0x8e99('0x39')]=_[_0x8e99('0x3a')](_0x13e8d9[_0x8e99('0x39')],{'$or':_['map'](_0x1e927e,function(_0x295ae8){if(_0x295ae8[_0x8e99('0x2c')]!==_0x8e99('0x3b')){var _0x13cd47={};_0x13cd47[_0x295ae8[_0x8e99('0x26')]]={'$like':'%'+_0x4dde6e[_0x8e99('0x2f')][_0x8e99('0x3c')]+'%'};return _0x13cd47;}})});}_0x13e8d9=_['merge']({},_0x13e8d9,_0x4dde6e[_0x8e99('0x3d')]);var _0x5a004b={'where':_0x13e8d9[_0x8e99('0x39')]};return db[_0x8e99('0x29')][_0x8e99('0x1f')](_0x5a004b)[_0x8e99('0x24')](function(_0x185ee6){_0x1a724d['count']=_0x185ee6;if(_0x4dde6e['query'][_0x8e99('0x3e')]){_0x13e8d9[_0x8e99('0x3f')]=[{'all':!![]}];}return db[_0x8e99('0x29')][_0x8e99('0x40')](_0x13e8d9);})['then'](function(_0x4ea61d){_0x1a724d[_0x8e99('0x41')]=_0x4ea61d;return _0x1a724d;})[_0x8e99('0x24')](respondWithFilteredResult(_0x28c7ad,_0x13e8d9))[_0x8e99('0x42')](handleError(_0x28c7ad,null));};exports[_0x8e99('0x43')]=function(_0x4a262e,_0x47469d){var _0x181ff5={'raw':![],'where':{'id':_0x4a262e[_0x8e99('0x44')]['id']}},_0x2fe0b0={};_0x2fe0b0[_0x8e99('0x2e')]=_[_0x8e99('0x30')](db[_0x8e99('0x29')]['rawAttributes']);_0x2fe0b0[_0x8e99('0x2f')]=_[_0x8e99('0x30')](_0x4a262e['query']);_0x2fe0b0[_0x8e99('0x31')]=_[_0x8e99('0x32')](_0x2fe0b0[_0x8e99('0x2e')],_0x2fe0b0['query']);_0x181ff5[_0x8e99('0x34')]=_[_0x8e99('0x32')](_0x2fe0b0[_0x8e99('0x2e')],qs[_0x8e99('0x33')](_0x4a262e[_0x8e99('0x2f')][_0x8e99('0x33')]));_0x181ff5[_0x8e99('0x34')]=_0x181ff5['attributes'][_0x8e99('0x35')]?_0x181ff5[_0x8e99('0x34')]:_0x2fe0b0[_0x8e99('0x2e')];if(_0x4a262e[_0x8e99('0x2f')][_0x8e99('0x3e')]){_0x181ff5[_0x8e99('0x3f')]=[{'all':!![]}];}_0x181ff5=_['merge']({},_0x181ff5,_0x4a262e['options']);return db['ZohoAccount'][_0x8e99('0x45')](_0x181ff5)['then'](handleEntityNotFound(_0x47469d,null))[_0x8e99('0x24')](respondWithResult(_0x47469d,null))[_0x8e99('0x42')](handleError(_0x47469d,null));};exports[_0x8e99('0x46')]=function(_0x30139a,_0x3cd502){return db['ZohoAccount'][_0x8e99('0x46')](_0x30139a[_0x8e99('0x47')],{})[_0x8e99('0x24')](respondWithResult(_0x3cd502,0xc9))[_0x8e99('0x42')](handleError(_0x3cd502,null));};exports[_0x8e99('0x23')]=function(_0x288648,_0x5b47c1){if(_0x288648[_0x8e99('0x47')]['id']){delete _0x288648[_0x8e99('0x47')]['id'];}return db[_0x8e99('0x29')][_0x8e99('0x45')]({'where':{'id':_0x288648['params']['id']}})['then'](handleEntityNotFound(_0x5b47c1,null))[_0x8e99('0x24')](saveUpdates(_0x288648[_0x8e99('0x47')],null))[_0x8e99('0x24')](respondWithResult(_0x5b47c1,null))[_0x8e99('0x42')](handleError(_0x5b47c1,null));};exports['destroy']=function(_0x50d7b4,_0x206651){return db[_0x8e99('0x29')]['find']({'where':{'id':_0x50d7b4[_0x8e99('0x44')]['id']}})[_0x8e99('0x24')](handleEntityNotFound(_0x206651,null))[_0x8e99('0x24')](removeEntity(_0x206651,null))[_0x8e99('0x42')](handleError(_0x206651,null));};exports['getConfigurations']=function(_0x1dfad9,_0x48181f,_0x266063){var _0x2dd449={};var _0x2105bd={};var _0x5a5699;var _0x2ecd00;return db[_0x8e99('0x29')]['findOne']({'where':{'id':_0x1dfad9['params']['id']}})[_0x8e99('0x24')](handleEntityNotFound(_0x48181f,null))[_0x8e99('0x24')](function(_0x5b15bd){if(_0x5b15bd){_0x5a5699=_0x5b15bd;_0x2105bd[_0x8e99('0x2e')]=_[_0x8e99('0x30')](db[_0x8e99('0x48')][_0x8e99('0x2a')]);_0x2105bd[_0x8e99('0x2f')]=_[_0x8e99('0x30')](_0x1dfad9[_0x8e99('0x2f')]);_0x2105bd[_0x8e99('0x31')]=_[_0x8e99('0x32')](_0x2105bd[_0x8e99('0x2e')],_0x2105bd[_0x8e99('0x2f')]);_0x2dd449['attributes']=_['intersection'](_0x2105bd[_0x8e99('0x2e')],qs['fields'](_0x1dfad9[_0x8e99('0x2f')][_0x8e99('0x33')]));_0x2dd449['attributes']=_0x2dd449[_0x8e99('0x34')][_0x8e99('0x35')]?_0x2dd449[_0x8e99('0x34')]:_0x2105bd['model'];_0x2dd449[_0x8e99('0x49')]=qs[_0x8e99('0x38')](_0x1dfad9[_0x8e99('0x2f')][_0x8e99('0x38')]);_0x2dd449[_0x8e99('0x39')]=qs[_0x8e99('0x31')](_['pick'](_0x1dfad9[_0x8e99('0x2f')],_0x2105bd['filters']));if(_0x1dfad9['query'][_0x8e99('0x3c')]){_0x2dd449[_0x8e99('0x39')]=_[_0x8e99('0x3a')](_0x2dd449['where'],{'$or':_[_0x8e99('0x28')](_0x2dd449[_0x8e99('0x34')],function(_0x5ca2f0){var _0x333d51={};_0x333d51[_0x5ca2f0]={'$like':'%'+_0x1dfad9[_0x8e99('0x2f')][_0x8e99('0x3c')]+'%'};return _0x333d51;})});}_0x2dd449=_[_0x8e99('0x3a')]({},_0x2dd449,_0x1dfad9['options']);return _0x5a5699[_0x8e99('0x4a')](_0x2dd449);}})['then'](function(_0x49321d){if(_0x49321d){_0x2ecd00=_0x49321d[_0x8e99('0x35')];if(!_0x1dfad9['query'][_0x8e99('0x36')](_0x8e99('0x37'))){_0x2dd449[_0x8e99('0x1d')]=qs[_0x8e99('0x1d')](_0x1dfad9[_0x8e99('0x2f')][_0x8e99('0x1d')]);_0x2dd449[_0x8e99('0x1c')]=qs['offset'](_0x1dfad9[_0x8e99('0x2f')][_0x8e99('0x1c')]);}return _0x5a5699[_0x8e99('0x4a')](_0x2dd449);}})['then'](function(_0x3b1aec){if(_0x3b1aec){return _0x3b1aec?{'count':_0x2ecd00,'rows':_0x3b1aec}:null;}})[_0x8e99('0x24')](respondWithResult(_0x48181f,null))[_0x8e99('0x42')](handleError(_0x48181f,null));};exports[_0x8e99('0x4b')]=function(_0x350ff8,_0x2b1aae,_0x1691da){if(_0x350ff8[_0x8e99('0x47')]['id']){delete _0x350ff8['body']['id'];}return db[_0x8e99('0x29')][_0x8e99('0x4c')]({'where':{'id':_0x350ff8['params']['id']}})[_0x8e99('0x24')](handleEntityNotFound(_0x2b1aae,null))[_0x8e99('0x24')](function(_0x4d6271){if(_0x4d6271){_0x350ff8[_0x8e99('0x47')][_0x8e99('0x4d')]=_0x4d6271['id'];_0x350ff8[_0x8e99('0x47')][_0x8e99('0x4e')]=integrations['getSubjects'](_0x350ff8[_0x8e99('0x47')][_0x8e99('0x4f')],_0x350ff8[_0x8e99('0x47')][_0x8e99('0x2c')]);_0x350ff8[_0x8e99('0x47')][_0x8e99('0x50')]=integrations['getDescriptions'](_0x350ff8[_0x8e99('0x47')][_0x8e99('0x4f')],_0x350ff8['body'][_0x8e99('0x2c')]);return db['ZohoConfiguration'][_0x8e99('0x46')](_0x350ff8[_0x8e99('0x47')],{'include':[{'model':db['ZohoField'],'as':_0x8e99('0x4e')},{'model':db[_0x8e99('0x51')],'as':'Descriptions'}]});}return null;})[_0x8e99('0x24')](respondWithResult(_0x2b1aae,null))['catch'](handleError(_0x2b1aae,null));};function getAccessToken(_0xdf8e5){return new Promise(function(_0x42e580,_0x44a393){var _0x3d6c61;switch(_0xdf8e5['zone']){case'US':_0x3d6c61=_0x8e99('0x52');break;case'AU':_0x3d6c61=_0x8e99('0x53');break;case'EU':_0x3d6c61='https://accounts.zoho.eu';break;case'IN':_0x3d6c61=_0x8e99('0x54');break;case'CN':_0x3d6c61=_0x8e99('0x55');break;default:_0x3d6c61='https://accounts.zoho.eu';break;}var _0x40fd24={'method':_0x8e99('0x56'),'uri':_0x3d6c61+_0x8e99('0x57'),'qs':{'refresh_token':_0xdf8e5['refreshToken'],'client_id':_0xdf8e5[_0x8e99('0x58')],'client_secret':_0xdf8e5[_0x8e99('0x59')],'grant_type':_0x8e99('0x5a')},'json':!![]};return rp(_0x40fd24)[_0x8e99('0x24')](function(_0x2bbe43){if(_0x2bbe43[_0x8e99('0x5b')]){_0x42e580(_0x2bbe43[_0x8e99('0x5b')]);}else{_0x44a393('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0x8e99('0x42')](function(_0x1d9845){_0x44a393(_0x1d9845);});});}exports[_0x8e99('0x5c')]=function(_0xf859de,_0x335f90,_0xddecce){var _0x29a1d4,_0x3dd49d,_0x1ef81a,_0x3e0cbc,_0x1f59ea;return db['ZohoAccount']['findOne']({'where':{'id':_0xf859de[_0x8e99('0x44')]['id']},'attributes':['id','host',_0x8e99('0x5d'),'clientId',_0x8e99('0x59'),'serverUrl','code',_0x8e99('0x5e')]})[_0x8e99('0x24')](handleEntityNotFound(_0x335f90,null))[_0x8e99('0x24')](function(_0x6224f){_0x1f59ea=_0x6224f;_0x29a1d4=_0x1f59ea['host'];_0x3dd49d=_0x29a1d4==='zoho.eu'?'eu':_0x8e99('0x5f');_0x1ef81a=_0x1f59ea[_0x8e99('0x60')];var _0x3ed1a6=_0x1ef81a['slice'](-0x1);if(_0x3ed1a6==='/'||_0x3ed1a6==='\x5c'||_0x3ed1a6===':'){_0x1ef81a=_0x1ef81a[_0x8e99('0x61')](0x0,_0x1ef81a[_0x8e99('0x62')](_0x3ed1a6));}if(!_0x1f59ea[_0x8e99('0x5e')]){throw new Error(_0x8e99('0x63'));}return getAccessToken(_0x1f59ea);})[_0x8e99('0x24')](function(_0x4e58b3){if(_0x4e58b3){return rp({'method':_0x8e99('0x64'),'uri':util['format'](_0x8e99('0x65'),_0x3dd49d),'qs':{'module':_0x8e99('0x66')},'headers':{'Authorization':_0x8e99('0x67')+_0x4e58b3},'json':!![]});}})[_0x8e99('0x24')](function(_0x586b20){if(_0x586b20){if(_0x586b20[_0x8e99('0x68')]&&_0x586b20[_0x8e99('0x68')][_0x8e99('0x69')]){throw new Error(_0x586b20[_0x8e99('0x68')][_0x8e99('0x69')][_0x8e99('0x6a')]);}var _0x4f8c30=[];var _0x5a9643=[];var _0xce396e=[_0x8e99('0x6b'),'Subject',_0x8e99('0x6c'),_0x8e99('0x6d'),'Call_Duration',_0x8e99('0x6e'),'Call_Start_Time',_0x8e99('0x6f')];_0x5a9643=_[_0x8e99('0x70')](_0x586b20[_0x8e99('0x33')],function(_0x148c2c){return _0xce396e[_0x8e99('0x71')](_0x148c2c['api_name']);});for(var _0x539df4=0x0;_0x539df4<_0x5a9643['length'];_0x539df4++){if(_0x5a9643[_0x539df4][_0x8e99('0x72')]===![]){_0x4f8c30[_0x8e99('0x73')]({'id':_0x5a9643[_0x539df4]['id'],'name':_0x5a9643[_0x539df4][_0x8e99('0x74')],'custom':_0x5a9643[_0x539df4]['custom_field'],'options':_0x5a9643[_0x539df4][_0x8e99('0x75')]===_0x8e99('0x76')&&_0x5a9643[_0x539df4][_0x8e99('0x77')][_0x8e99('0x35')]>-0x1?_['map'](_0x5a9643[_0x539df4]['pick_list_values'],function(_0x3d179f){return{'name':_0x3d179f,'value':_0x3d179f};}):[]});}}return{'count':_0x4f8c30[_0x8e99('0x35')],'rows':_0x4f8c30};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x335f90,null))[_0x8e99('0x42')](function(_0xc0b736){var _0x387047=_0xf859de[_0x8e99('0x2f')][_0x8e99('0x78')]?0x1f4:_0xc0b736[_0x8e99('0x79')]||0x1f4;logger[_0x8e99('0x69')](_0x8e99('0x7a'),_0x8e99('0x5c'),_0x387047,JSON[_0x8e99('0x7b')](_0xc0b736));delete _0xc0b736['name'];if(_0x387047===0x191){_0x387047=0x190;}_0x335f90[_0x8e99('0x19')](_0x387047)[_0x8e99('0x7c')](_0xf859de[_0x8e99('0x2f')][_0x8e99('0x78')]?{'message':_0x8e99('0x7d'),'statusCode':_0xc0b736[_0x8e99('0x79')]}:_0xc0b736);});}; \ No newline at end of file +var _0x7432=['Content-Range','apply','save','then','name','send','index','map','ZohoAccount','key','model','query','keys','attributes','intersection','fields','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','body','destroy','getConfigurations','findOne','ZohoConfiguration','length','hasOwnProperty','nolimit','addConfiguration','Subjects','channel','Descriptions','getDescriptions','create','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','getFields','host','serverUrl','code','zoho.eu','com','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','error','message','Owner','Subject','Description','WhoId','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set'];(function(_0x1590cf,_0x5b85d5){var _0x46c25c=function(_0x16a73d){while(--_0x16a73d){_0x1590cf['push'](_0x1590cf['shift']());}};_0x46c25c(++_0x5b85d5);}(_0x7432,0xe5));var _0x2743=function(_0x140d70,_0x3874f3){_0x140d70=_0x140d70-0x0;var _0x9c325f=_0x7432[_0x140d70];return _0x9c325f;};'use strict';var emlformat=require(_0x2743('0x0'));var rimraf=require(_0x2743('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2743('0x2'));var rp=require(_0x2743('0x3'));var moment=require(_0x2743('0x4'));var BPromise=require(_0x2743('0x5'));var Mustache=require(_0x2743('0x6'));var util=require(_0x2743('0x7'));var path=require('path');var sox=require(_0x2743('0x8'));var csv=require(_0x2743('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2743('0xa'));var squel=require('squel');var crypto=require(_0x2743('0xb'));var jsforce=require(_0x2743('0xc'));var deskjs=require(_0x2743('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2743('0xe'));var authService=require(_0x2743('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2743('0x10'));var hardwareService=require(_0x2743('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x2743('0x12'));var config=require(_0x2743('0x13'));var licenseUtil=require(_0x2743('0x14'));var db=require(_0x2743('0x15'))['db'];var integrations=require(_0x2743('0x16'));function respondWithStatusCode(_0x39e89f,_0x5672cb){_0x5672cb=_0x5672cb||0xcc;return function(_0x570656){if(_0x570656){return _0x39e89f[_0x2743('0x17')](_0x5672cb);}return _0x39e89f[_0x2743('0x18')](_0x5672cb)[_0x2743('0x19')]();};}function respondWithResult(_0x58e981,_0x2f3c80){_0x2f3c80=_0x2f3c80||0xc8;return function(_0x19ac46){if(_0x19ac46){return _0x58e981[_0x2743('0x18')](_0x2f3c80)['json'](_0x19ac46);}};}function respondWithFilteredResult(_0x5105f5,_0x986eec){return function(_0x418797){if(_0x418797){var _0x31152d=typeof _0x986eec[_0x2743('0x1a')]===_0x2743('0x1b')&&typeof _0x986eec[_0x2743('0x1c')]==='undefined';var _0x4befae=_0x418797['count'];var _0x17364c=_0x31152d?0x0:_0x986eec[_0x2743('0x1a')];var _0x52cd64=_0x31152d?_0x418797[_0x2743('0x1d')]:_0x986eec[_0x2743('0x1a')]+_0x986eec['limit'];var _0x8286b9;if(_0x52cd64>=_0x4befae){_0x52cd64=_0x4befae;_0x8286b9=0xc8;}else{_0x8286b9=0xce;}_0x5105f5[_0x2743('0x18')](_0x8286b9);return _0x5105f5[_0x2743('0x1e')](_0x2743('0x1f'),_0x17364c+'-'+_0x52cd64+'/'+_0x4befae)['json'](_0x418797);}return null;};}function patchUpdates(_0x2e7d42){return function(_0xcf548f){try{jsonpatch[_0x2743('0x20')](_0xcf548f,_0x2e7d42,!![]);}catch(_0x4e1266){return BPromise['reject'](_0x4e1266);}return _0xcf548f[_0x2743('0x21')]();};}function saveUpdates(_0x7c4620,_0x668b3b){return function(_0xc32a04){if(_0xc32a04){return _0xc32a04['update'](_0x7c4620)['then'](function(_0x2d3c85){return _0x2d3c85;});}return null;};}function removeEntity(_0x51eebe,_0x3207d6){return function(_0x5c71d5){if(_0x5c71d5){return _0x5c71d5['destroy']()[_0x2743('0x22')](function(){_0x51eebe['status'](0xcc)[_0x2743('0x19')]();});}};}function handleEntityNotFound(_0x203497,_0x59fd93){return function(_0x9aa56e){if(!_0x9aa56e){_0x203497[_0x2743('0x17')](0x194);}return _0x9aa56e;};}function handleError(_0x35fa8d,_0x5b92b8){_0x5b92b8=_0x5b92b8||0x1f4;return function(_0x207c79){logger['error'](_0x207c79['stack']);if(_0x207c79['name']){delete _0x207c79[_0x2743('0x23')];}_0x35fa8d[_0x2743('0x18')](_0x5b92b8)[_0x2743('0x24')](_0x207c79);};}exports[_0x2743('0x25')]=function(_0x2ea757,_0x42bf5e){var _0x52ae9b={},_0x3ff321={},_0xf2ddeb={'count':0x0,'rows':[]};var _0x24cede=_[_0x2743('0x26')](db[_0x2743('0x27')]['rawAttributes'],function(_0x3c0d15){return{'name':_0x3c0d15['fieldName'],'type':_0x3c0d15['type'][_0x2743('0x28')]};});_0x3ff321[_0x2743('0x29')]=_[_0x2743('0x26')](_0x24cede,_0x2743('0x23'));_0x3ff321[_0x2743('0x2a')]=_[_0x2743('0x2b')](_0x2ea757[_0x2743('0x2a')]);_0x3ff321['filters']=_['intersection'](_0x3ff321[_0x2743('0x29')],_0x3ff321['query']);_0x52ae9b[_0x2743('0x2c')]=_[_0x2743('0x2d')](_0x3ff321[_0x2743('0x29')],qs[_0x2743('0x2e')](_0x2ea757[_0x2743('0x2a')][_0x2743('0x2e')]));_0x52ae9b[_0x2743('0x2c')]=_0x52ae9b[_0x2743('0x2c')]['length']?_0x52ae9b[_0x2743('0x2c')]:_0x3ff321['model'];if(!_0x2ea757[_0x2743('0x2a')]['hasOwnProperty']('nolimit')){_0x52ae9b[_0x2743('0x1c')]=qs['limit'](_0x2ea757[_0x2743('0x2a')][_0x2743('0x1c')]);_0x52ae9b[_0x2743('0x1a')]=qs[_0x2743('0x1a')](_0x2ea757['query'][_0x2743('0x1a')]);}_0x52ae9b[_0x2743('0x2f')]=qs[_0x2743('0x30')](_0x2ea757[_0x2743('0x2a')][_0x2743('0x30')]);_0x52ae9b[_0x2743('0x31')]=qs[_0x2743('0x32')](_[_0x2743('0x33')](_0x2ea757[_0x2743('0x2a')],_0x3ff321[_0x2743('0x32')]),_0x24cede);if(_0x2ea757['query']['filter']){_0x52ae9b['where']=_[_0x2743('0x34')](_0x52ae9b[_0x2743('0x31')],{'$or':_['map'](_0x24cede,function(_0x5bf50a){if(_0x5bf50a[_0x2743('0x35')]!==_0x2743('0x36')){var _0x4d2656={};_0x4d2656[_0x5bf50a[_0x2743('0x23')]]={'$like':'%'+_0x2ea757[_0x2743('0x2a')][_0x2743('0x37')]+'%'};return _0x4d2656;}})});}_0x52ae9b=_[_0x2743('0x34')]({},_0x52ae9b,_0x2ea757[_0x2743('0x38')]);var _0x16fcd1={'where':_0x52ae9b['where']};return db[_0x2743('0x27')][_0x2743('0x1d')](_0x16fcd1)[_0x2743('0x22')](function(_0x3f134b){_0xf2ddeb[_0x2743('0x1d')]=_0x3f134b;if(_0x2ea757['query'][_0x2743('0x39')]){_0x52ae9b[_0x2743('0x3a')]=[{'all':!![]}];}return db[_0x2743('0x27')][_0x2743('0x3b')](_0x52ae9b);})[_0x2743('0x22')](function(_0x51e52e){_0xf2ddeb[_0x2743('0x3c')]=_0x51e52e;return _0xf2ddeb;})[_0x2743('0x22')](respondWithFilteredResult(_0x42bf5e,_0x52ae9b))[_0x2743('0x3d')](handleError(_0x42bf5e,null));};exports['show']=function(_0x275b20,_0x31119c){var _0x17c3b7={'raw':![],'where':{'id':_0x275b20[_0x2743('0x3e')]['id']}},_0x1d9c4c={};_0x1d9c4c['model']=_[_0x2743('0x2b')](db['ZohoAccount'][_0x2743('0x3f')]);_0x1d9c4c[_0x2743('0x2a')]=_[_0x2743('0x2b')](_0x275b20['query']);_0x1d9c4c[_0x2743('0x32')]=_['intersection'](_0x1d9c4c[_0x2743('0x29')],_0x1d9c4c[_0x2743('0x2a')]);_0x17c3b7['attributes']=_['intersection'](_0x1d9c4c[_0x2743('0x29')],qs[_0x2743('0x2e')](_0x275b20[_0x2743('0x2a')]['fields']));_0x17c3b7[_0x2743('0x2c')]=_0x17c3b7['attributes']['length']?_0x17c3b7[_0x2743('0x2c')]:_0x1d9c4c['model'];if(_0x275b20[_0x2743('0x2a')][_0x2743('0x39')]){_0x17c3b7[_0x2743('0x3a')]=[{'all':!![]}];}_0x17c3b7=_[_0x2743('0x34')]({},_0x17c3b7,_0x275b20[_0x2743('0x38')]);return db['ZohoAccount'][_0x2743('0x40')](_0x17c3b7)[_0x2743('0x22')](handleEntityNotFound(_0x31119c,null))[_0x2743('0x22')](respondWithResult(_0x31119c,null))[_0x2743('0x3d')](handleError(_0x31119c,null));};exports['create']=function(_0x5155d4,_0xe774ef){return db[_0x2743('0x27')]['create'](_0x5155d4[_0x2743('0x41')],{})[_0x2743('0x22')](respondWithResult(_0xe774ef,0xc9))[_0x2743('0x3d')](handleError(_0xe774ef,null));};exports['update']=function(_0x2b6f8e,_0x12060c){if(_0x2b6f8e[_0x2743('0x41')]['id']){delete _0x2b6f8e['body']['id'];}return db[_0x2743('0x27')]['find']({'where':{'id':_0x2b6f8e[_0x2743('0x3e')]['id']}})[_0x2743('0x22')](handleEntityNotFound(_0x12060c,null))['then'](saveUpdates(_0x2b6f8e[_0x2743('0x41')],null))[_0x2743('0x22')](respondWithResult(_0x12060c,null))[_0x2743('0x3d')](handleError(_0x12060c,null));};exports[_0x2743('0x42')]=function(_0x3d001a,_0x1e3c25){return db[_0x2743('0x27')][_0x2743('0x40')]({'where':{'id':_0x3d001a[_0x2743('0x3e')]['id']}})[_0x2743('0x22')](handleEntityNotFound(_0x1e3c25,null))['then'](removeEntity(_0x1e3c25,null))[_0x2743('0x3d')](handleError(_0x1e3c25,null));};exports[_0x2743('0x43')]=function(_0x2b0f2f,_0x53c2f2,_0x202942){var _0x18d7c4={};var _0x5aecc1={};var _0x1bac7c;var _0x4ae23c;return db[_0x2743('0x27')][_0x2743('0x44')]({'where':{'id':_0x2b0f2f['params']['id']}})[_0x2743('0x22')](handleEntityNotFound(_0x53c2f2,null))[_0x2743('0x22')](function(_0x242546){if(_0x242546){_0x1bac7c=_0x242546;_0x5aecc1[_0x2743('0x29')]=_[_0x2743('0x2b')](db[_0x2743('0x45')][_0x2743('0x3f')]);_0x5aecc1[_0x2743('0x2a')]=_[_0x2743('0x2b')](_0x2b0f2f[_0x2743('0x2a')]);_0x5aecc1[_0x2743('0x32')]=_[_0x2743('0x2d')](_0x5aecc1[_0x2743('0x29')],_0x5aecc1['query']);_0x18d7c4[_0x2743('0x2c')]=_[_0x2743('0x2d')](_0x5aecc1[_0x2743('0x29')],qs['fields'](_0x2b0f2f[_0x2743('0x2a')]['fields']));_0x18d7c4['attributes']=_0x18d7c4[_0x2743('0x2c')][_0x2743('0x46')]?_0x18d7c4[_0x2743('0x2c')]:_0x5aecc1[_0x2743('0x29')];_0x18d7c4[_0x2743('0x2f')]=qs[_0x2743('0x30')](_0x2b0f2f[_0x2743('0x2a')][_0x2743('0x30')]);_0x18d7c4[_0x2743('0x31')]=qs[_0x2743('0x32')](_[_0x2743('0x33')](_0x2b0f2f[_0x2743('0x2a')],_0x5aecc1[_0x2743('0x32')]));if(_0x2b0f2f[_0x2743('0x2a')][_0x2743('0x37')]){_0x18d7c4[_0x2743('0x31')]=_['merge'](_0x18d7c4[_0x2743('0x31')],{'$or':_['map'](_0x18d7c4[_0x2743('0x2c')],function(_0x57a0f9){var _0x14e997={};_0x14e997[_0x57a0f9]={'$like':'%'+_0x2b0f2f[_0x2743('0x2a')][_0x2743('0x37')]+'%'};return _0x14e997;})});}_0x18d7c4=_[_0x2743('0x34')]({},_0x18d7c4,_0x2b0f2f[_0x2743('0x38')]);return _0x1bac7c[_0x2743('0x43')](_0x18d7c4);}})[_0x2743('0x22')](function(_0x4fa8a9){if(_0x4fa8a9){_0x4ae23c=_0x4fa8a9[_0x2743('0x46')];if(!_0x2b0f2f[_0x2743('0x2a')][_0x2743('0x47')](_0x2743('0x48'))){_0x18d7c4['limit']=qs['limit'](_0x2b0f2f['query'][_0x2743('0x1c')]);_0x18d7c4['offset']=qs['offset'](_0x2b0f2f[_0x2743('0x2a')]['offset']);}return _0x1bac7c['getConfigurations'](_0x18d7c4);}})['then'](function(_0x587255){if(_0x587255){return _0x587255?{'count':_0x4ae23c,'rows':_0x587255}:null;}})[_0x2743('0x22')](respondWithResult(_0x53c2f2,null))[_0x2743('0x3d')](handleError(_0x53c2f2,null));};exports[_0x2743('0x49')]=function(_0x45289a,_0x296243,_0x5b5f1b){if(_0x45289a['body']['id']){delete _0x45289a[_0x2743('0x41')]['id'];}return db[_0x2743('0x27')][_0x2743('0x44')]({'where':{'id':_0x45289a[_0x2743('0x3e')]['id']}})[_0x2743('0x22')](handleEntityNotFound(_0x296243,null))[_0x2743('0x22')](function(_0x146fbf){if(_0x146fbf){_0x45289a[_0x2743('0x41')]['AccountId']=_0x146fbf['id'];_0x45289a[_0x2743('0x41')][_0x2743('0x4a')]=integrations['getSubjects'](_0x45289a[_0x2743('0x41')][_0x2743('0x4b')],_0x45289a['body'][_0x2743('0x35')]);_0x45289a['body'][_0x2743('0x4c')]=integrations[_0x2743('0x4d')](_0x45289a[_0x2743('0x41')][_0x2743('0x4b')],_0x45289a[_0x2743('0x41')]['type']);return db[_0x2743('0x45')][_0x2743('0x4e')](_0x45289a[_0x2743('0x41')],{'include':[{'model':db[_0x2743('0x4f')],'as':_0x2743('0x4a')},{'model':db[_0x2743('0x4f')],'as':_0x2743('0x4c')}]});}return null;})[_0x2743('0x22')](respondWithResult(_0x296243,null))['catch'](handleError(_0x296243,null));};function getAccessToken(_0x1791d2){return new Promise(function(_0x489cc6,_0x269a32){var _0x58c149;switch(_0x1791d2[_0x2743('0x50')]){case'US':_0x58c149=_0x2743('0x51');break;case'AU':_0x58c149='https://accounts.zoho.com.au';break;case'EU':_0x58c149=_0x2743('0x52');break;case'IN':_0x58c149=_0x2743('0x53');break;case'CN':_0x58c149=_0x2743('0x54');break;default:_0x58c149=_0x2743('0x52');break;}var _0x331847={'method':_0x2743('0x55'),'uri':_0x58c149+_0x2743('0x56'),'qs':{'refresh_token':_0x1791d2[_0x2743('0x57')],'client_id':_0x1791d2[_0x2743('0x58')],'client_secret':_0x1791d2[_0x2743('0x59')],'grant_type':_0x2743('0x5a')},'json':!![]};return rp(_0x331847)[_0x2743('0x22')](function(_0x283a94){if(_0x283a94[_0x2743('0x5b')]){_0x489cc6(_0x283a94[_0x2743('0x5b')]);}else{_0x269a32('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})['catch'](function(_0x2d9220){_0x269a32(_0x2d9220);});});}exports[_0x2743('0x5c')]=function(_0x13f2ad,_0x301d42,_0x4ebc9b){var _0x54ad35,_0x325d87,_0x370515,_0x1b095c,_0x1c3593;return db[_0x2743('0x27')][_0x2743('0x44')]({'where':{'id':_0x13f2ad[_0x2743('0x3e')]['id']},'attributes':['id',_0x2743('0x5d'),_0x2743('0x50'),_0x2743('0x58'),'clientSecret',_0x2743('0x5e'),_0x2743('0x5f'),_0x2743('0x57')]})[_0x2743('0x22')](handleEntityNotFound(_0x301d42,null))[_0x2743('0x22')](function(_0x4ad5fc){_0x1c3593=_0x4ad5fc;_0x54ad35=_0x1c3593[_0x2743('0x5d')];_0x325d87=_0x54ad35===_0x2743('0x60')?'eu':_0x2743('0x61');_0x370515=_0x1c3593[_0x2743('0x5e')];var _0x3ead2b=_0x370515['slice'](-0x1);if(_0x3ead2b==='/'||_0x3ead2b==='\x5c'||_0x3ead2b===':'){_0x370515=_0x370515[_0x2743('0x62')](0x0,_0x370515[_0x2743('0x63')](_0x3ead2b));}if(!_0x1c3593['refreshToken']){throw new Error(_0x2743('0x64'));}return getAccessToken(_0x1c3593);})[_0x2743('0x22')](function(_0x7b022e){if(_0x7b022e){return rp({'method':_0x2743('0x65'),'uri':util[_0x2743('0x66')](_0x2743('0x67'),_0x325d87),'qs':{'module':_0x2743('0x68')},'headers':{'Authorization':_0x2743('0x69')+_0x7b022e},'json':!![]});}})[_0x2743('0x22')](function(_0x3c07a5){if(_0x3c07a5){if(_0x3c07a5[_0x2743('0x6a')]&&_0x3c07a5[_0x2743('0x6a')][_0x2743('0x6b')]){throw new Error(_0x3c07a5[_0x2743('0x6a')][_0x2743('0x6b')][_0x2743('0x6c')]);}var _0x578d44=[];var _0x46cb18=[];var _0x4742e3=[_0x2743('0x6d'),_0x2743('0x6e'),_0x2743('0x6f'),_0x2743('0x70'),'Call_Duration',_0x2743('0x71'),_0x2743('0x72'),_0x2743('0x73')];_0x46cb18=_[_0x2743('0x74')](_0x3c07a5[_0x2743('0x2e')],function(_0x450af4){return _0x4742e3[_0x2743('0x75')](_0x450af4[_0x2743('0x76')]);});for(var _0x431f40=0x0;_0x431f40<_0x46cb18[_0x2743('0x46')];_0x431f40++){if(_0x46cb18[_0x431f40][_0x2743('0x77')]===![]){_0x578d44['push']({'id':_0x46cb18[_0x431f40]['id'],'name':_0x46cb18[_0x431f40][_0x2743('0x78')],'custom':_0x46cb18[_0x431f40][_0x2743('0x79')],'options':_0x46cb18[_0x431f40][_0x2743('0x7a')]===_0x2743('0x7b')&&_0x46cb18[_0x431f40]['pick_list_values']['length']>-0x1?_[_0x2743('0x26')](_0x46cb18[_0x431f40][_0x2743('0x7c')],function(_0x46b29b){return{'name':_0x46b29b,'value':_0x46b29b};}):[]});}}return{'count':_0x578d44[_0x2743('0x46')],'rows':_0x578d44};}else{return{'count':0x0,'rows':[]};}})[_0x2743('0x22')](respondWithResult(_0x301d42,null))[_0x2743('0x3d')](function(_0x5a3de9){var _0x373d04=_0x13f2ad['query'][_0x2743('0x7d')]?0x1f4:_0x5a3de9[_0x2743('0x7e')]||0x1f4;logger['error'](_0x2743('0x7f'),_0x2743('0x5c'),_0x373d04,JSON[_0x2743('0x80')](_0x5a3de9));delete _0x5a3de9[_0x2743('0x23')];if(_0x373d04===0x191){_0x373d04=0x190;}_0x301d42[_0x2743('0x18')](_0x373d04)[_0x2743('0x24')](_0x13f2ad['query']['test']?{'message':_0x2743('0x81'),'statusCode':_0x5a3de9[_0x2743('0x7e')]}:_0x5a3de9);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 53eae7c..c49eea6 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 _0x580b=['lodash','../../config/logger','moment','bluebird','path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','ZohoAccount','int_zoho_accounts','clientId','changed','clientSecret','code','host','serverUrl','substring','lastIndexOf','zone','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','authorization_code','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','slice','https://accounts.zoho.com','/oauth/v2/token'];(function(_0x3d3c18,_0x19335d){var _0x5acdf3=function(_0x4c6b11){while(--_0x4c6b11){_0x3d3c18['push'](_0x3d3c18['shift']());}};_0x5acdf3(++_0x19335d);}(_0x580b,0xf0));var _0xb580=function(_0x42ce7f,_0x26296e){_0x42ce7f=_0x42ce7f-0x0;var _0x31ae00=_0x580b[_0x42ce7f];return _0x31ae00;};'use strict';var _=require(_0xb580('0x0'));var util=require('util');var logger=require(_0xb580('0x1'))('api');var moment=require(_0xb580('0x2'));var BPromise=require(_0xb580('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb580('0x4'));var rimraf=require('rimraf');var config=require(_0xb580('0x5'));var attributes=require(_0xb580('0x6'));var integrations=require(_0xb580('0x7'));module['exports']=function(_0x7683b8,_0x1cfbda){return _0x7683b8['define'](_0xb580('0x8'),attributes,{'tableName':_0xb580('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x39974e,_0x61d9da,_0xa7b300){if(_0x39974e['changed']('zone')||_0x39974e['changed']('serverUrl')||_0x39974e['changed'](_0xb580('0xa'))||_0x39974e[_0xb580('0xb')](_0xb580('0xc'))||_0x39974e[_0xb580('0xb')](_0xb580('0xd'))||_0x39974e[_0xb580('0xb')](_0xb580('0xe'))){var _0x425afb,_0x5ea521;_0x425afb=_0x39974e[_0xb580('0xf')];var _0x32463d=_0x425afb['slice'](-0x1);if(_0x32463d==='/'||_0x32463d==='\x5c'||_0x32463d===':'){_0x425afb=_0x425afb[_0xb580('0x10')](0x0,_0x425afb[_0xb580('0x11')](_0x32463d));}switch(_0x39974e[_0xb580('0x12')]){case'US':_0x5ea521='https://accounts.zoho.com';break;case'AU':_0x5ea521=_0xb580('0x13');break;case'IN':_0x5ea521='https://accounts.zoho.in';break;case'CN':_0x5ea521=_0xb580('0x14');break;default:_0x5ea521=_0xb580('0x15');break;}var _0x13cabe={'method':_0xb580('0x16'),'uri':_0x5ea521+'/oauth/v2/token','form':{'grant_type':_0xb580('0x17'),'client_id':_0x39974e[_0xb580('0xa')],'client_secret':_0x39974e['clientSecret'],'redirect_uri':_0x39974e['serverUrl'],'code':_0x39974e[_0xb580('0xd')]},'headers':{'Content-Type':_0xb580('0x18')}};return rp(_0x13cabe)[_0xb580('0x19')](function(_0x38fca3){var _0x1c243a=JSON[_0xb580('0x1a')](_0x38fca3);if(_0x1c243a[_0xb580('0x1b')]){_0x39974e[_0xb580('0x1c')]=_0x1c243a['refresh_token'];logger[_0xb580('0x1d')](util[_0xb580('0x1e')](_0xb580('0x1f'),_0x39974e[_0xb580('0x20')],_0x39974e['id']));}else{logger[_0xb580('0x21')](util['format'](_0xb580('0x22'),_0x39974e[_0xb580('0x20')],_0x39974e['id']),util[_0xb580('0x23')](_0x1c243a,{'showHidden':![],'depth':null}));}return _0xa7b300(null,_0x61d9da);})[_0xb580('0x24')](function(_0x2f5bba){logger[_0xb580('0x21')](util[_0xb580('0x1e')](_0xb580('0x22'),_0x39974e['name'],_0x39974e['id']),util[_0xb580('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0xa7b300(_0x2f5bba);});}else{return _0xa7b300(null,_0x61d9da);}},'beforeUpdate':function(_0x5a9068,_0x1512ac,_0x4ba1e3){if(_0x5a9068[_0xb580('0xb')](_0xb580('0x12'))||_0x5a9068[_0xb580('0xb')](_0xb580('0xf'))||_0x5a9068['changed']('clientId')||_0x5a9068[_0xb580('0xb')](_0xb580('0xc'))||_0x5a9068[_0xb580('0xb')](_0xb580('0xd'))||_0x5a9068[_0xb580('0xb')](_0xb580('0xe'))){var _0x42fccf,_0x20c3d0;_0x42fccf=_0x5a9068[_0xb580('0xf')];var _0x1aa70b=_0x42fccf[_0xb580('0x25')](-0x1);if(_0x1aa70b==='/'||_0x1aa70b==='\x5c'||_0x1aa70b===':'){_0x42fccf=_0x42fccf[_0xb580('0x10')](0x0,_0x42fccf['lastIndexOf'](_0x1aa70b));}switch(_0x5a9068[_0xb580('0x12')]){case'US':_0x20c3d0=_0xb580('0x26');break;case'AU':_0x20c3d0=_0xb580('0x13');break;case'IN':_0x20c3d0='https://accounts.zoho.in';break;case'CN':_0x20c3d0=_0xb580('0x14');break;default:_0x20c3d0=_0xb580('0x15');break;}var _0x5e7353={'method':_0xb580('0x16'),'uri':_0x20c3d0+_0xb580('0x27'),'form':{'grant_type':_0xb580('0x17'),'client_id':_0x5a9068[_0xb580('0xa')],'client_secret':_0x5a9068[_0xb580('0xc')],'redirect_uri':_0x5a9068[_0xb580('0xf')],'code':_0x5a9068[_0xb580('0xd')]},'headers':{'Content-Type':_0xb580('0x18')}};return rp(_0x5e7353)[_0xb580('0x19')](function(_0x21ca1d){var _0x1c4d70=JSON[_0xb580('0x1a')](_0x21ca1d);if(_0x1c4d70[_0xb580('0x1b')]){_0x5a9068['refreshToken']=_0x1c4d70[_0xb580('0x1b')];logger[_0xb580('0x1d')](util['format'](_0xb580('0x1f'),_0x5a9068[_0xb580('0x20')],_0x5a9068['id']));}else{logger[_0xb580('0x21')](util[_0xb580('0x1e')](_0xb580('0x22'),_0x5a9068[_0xb580('0x20')],_0x5a9068['id']),util['inspect'](_0x1c4d70,{'showHidden':![],'depth':null}));}return _0x4ba1e3(null,_0x1512ac);})[_0xb580('0x24')](function(_0x15c60c){logger[_0xb580('0x21')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5a9068[_0xb580('0x20')],_0x5a9068['id']),util[_0xb580('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x4ba1e3(_0x15c60c);});}else{return _0x4ba1e3(null,_0x1512ac);}}}});}; \ No newline at end of file +var _0x8149=['changed','serverUrl','clientId','code','host','slice','substring','lastIndexOf','zone','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','authorization_code','clientSecret','application/x-www-form-urlencoded','then','parse','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','https://accounts.zoho.com.au','refreshToken','catch','lodash','util','api','moment','rimraf','../../config/environment','exports','define','ZohoAccount','int_zoho_accounts'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x8149,0x1a3));var _0x9814=function(_0x4c244f,_0x144a27){_0x4c244f=_0x4c244f-0x0;var _0x47d89e=_0x8149[_0x4c244f];return _0x47d89e;};'use strict';var _=require(_0x9814('0x0'));var util=require(_0x9814('0x1'));var logger=require('../../config/logger')(_0x9814('0x2'));var moment=require(_0x9814('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9814('0x4'));var config=require(_0x9814('0x5'));var attributes=require('./intZohoAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x9814('0x6')]=function(_0x4d916b,_0x5d9cb8){return _0x4d916b[_0x9814('0x7')](_0x9814('0x8'),attributes,{'tableName':_0x9814('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x62f7d8,_0x27f532,_0x4a991e){if(_0x62f7d8[_0x9814('0xa')]('zone')||_0x62f7d8['changed'](_0x9814('0xb'))||_0x62f7d8[_0x9814('0xa')](_0x9814('0xc'))||_0x62f7d8['changed']('clientSecret')||_0x62f7d8[_0x9814('0xa')](_0x9814('0xd'))||_0x62f7d8[_0x9814('0xa')](_0x9814('0xe'))){var _0x4b9ef9,_0x20c6e8;_0x4b9ef9=_0x62f7d8[_0x9814('0xb')];var _0x3a734f=_0x4b9ef9[_0x9814('0xf')](-0x1);if(_0x3a734f==='/'||_0x3a734f==='\x5c'||_0x3a734f===':'){_0x4b9ef9=_0x4b9ef9[_0x9814('0x10')](0x0,_0x4b9ef9[_0x9814('0x11')](_0x3a734f));}switch(_0x62f7d8[_0x9814('0x12')]){case'US':_0x20c6e8=_0x9814('0x13');break;case'AU':_0x20c6e8='https://accounts.zoho.com.au';break;case'IN':_0x20c6e8=_0x9814('0x14');break;case'CN':_0x20c6e8=_0x9814('0x15');break;default:_0x20c6e8=_0x9814('0x16');break;}var _0x4e61a1={'method':_0x9814('0x17'),'uri':_0x20c6e8+'/oauth/v2/token','form':{'grant_type':_0x9814('0x18'),'client_id':_0x62f7d8['clientId'],'client_secret':_0x62f7d8[_0x9814('0x19')],'redirect_uri':_0x62f7d8['serverUrl'],'code':_0x62f7d8[_0x9814('0xd')]},'headers':{'Content-Type':_0x9814('0x1a')}};return rp(_0x4e61a1)[_0x9814('0x1b')](function(_0x305f74){var _0x504b16=JSON[_0x9814('0x1c')](_0x305f74);if(_0x504b16[_0x9814('0x1d')]){_0x62f7d8['refreshToken']=_0x504b16[_0x9814('0x1d')];logger[_0x9814('0x1e')](util[_0x9814('0x1f')](_0x9814('0x20'),_0x62f7d8['name'],_0x62f7d8['id']));}else{logger['error'](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x62f7d8[_0x9814('0x21')],_0x62f7d8['id']),util[_0x9814('0x22')](_0x504b16,{'showHidden':![],'depth':null}));}return _0x4a991e(null,_0x27f532);})['catch'](function(_0xe099d8){logger['error'](util[_0x9814('0x1f')](_0x9814('0x23'),_0x62f7d8[_0x9814('0x21')],_0x62f7d8['id']),util[_0x9814('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x4a991e(_0xe099d8);});}else{return _0x4a991e(null,_0x27f532);}},'beforeUpdate':function(_0x4e3e06,_0x4eef7d,_0x950f78){if(_0x4e3e06[_0x9814('0xa')]('zone')||_0x4e3e06[_0x9814('0xa')](_0x9814('0xb'))||_0x4e3e06[_0x9814('0xa')](_0x9814('0xc'))||_0x4e3e06['changed'](_0x9814('0x19'))||_0x4e3e06[_0x9814('0xa')](_0x9814('0xd'))||_0x4e3e06[_0x9814('0xa')](_0x9814('0xe'))){var _0x5e895e,_0xed8d68;_0x5e895e=_0x4e3e06[_0x9814('0xb')];var _0x444d62=_0x5e895e[_0x9814('0xf')](-0x1);if(_0x444d62==='/'||_0x444d62==='\x5c'||_0x444d62===':'){_0x5e895e=_0x5e895e[_0x9814('0x10')](0x0,_0x5e895e['lastIndexOf'](_0x444d62));}switch(_0x4e3e06['zone']){case'US':_0xed8d68=_0x9814('0x13');break;case'AU':_0xed8d68=_0x9814('0x24');break;case'IN':_0xed8d68=_0x9814('0x14');break;case'CN':_0xed8d68='https://accounts.zoho.com.cn';break;default:_0xed8d68=_0x9814('0x16');break;}var _0x59cb33={'method':_0x9814('0x17'),'uri':_0xed8d68+'/oauth/v2/token','form':{'grant_type':_0x9814('0x18'),'client_id':_0x4e3e06[_0x9814('0xc')],'client_secret':_0x4e3e06['clientSecret'],'redirect_uri':_0x4e3e06[_0x9814('0xb')],'code':_0x4e3e06[_0x9814('0xd')]},'headers':{'Content-Type':_0x9814('0x1a')}};return rp(_0x59cb33)['then'](function(_0x36877c){var _0x3b4788=JSON[_0x9814('0x1c')](_0x36877c);if(_0x3b4788['refresh_token']){_0x4e3e06[_0x9814('0x25')]=_0x3b4788[_0x9814('0x1d')];logger[_0x9814('0x1e')](util[_0x9814('0x1f')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4e3e06[_0x9814('0x21')],_0x4e3e06['id']));}else{logger['error'](util['format'](_0x9814('0x23'),_0x4e3e06[_0x9814('0x21')],_0x4e3e06['id']),util[_0x9814('0x22')](_0x3b4788,{'showHidden':![],'depth':null}));}return _0x950f78(null,_0x4eef7d);})[_0x9814('0x26')](function(_0x59ba5b){logger['error'](util[_0x9814('0x1f')](_0x9814('0x23'),_0x4e3e06['name'],_0x4e3e06['id']),util[_0x9814('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x950f78(_0x59ba5b);});}else{return _0x950f78(null,_0x4eef7d);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 0fbb17d..27e6137 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 _0x002d=['findAll','options','raw','where','limit','include','map','model','attributes','info','ShowZohoAccount','find','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoAccount,\x20%s,\x20%s','message','result','catch','GetZohoAccount','ZohoAccount'];(function(_0x3bead8,_0x231439){var _0x5e9f1b=function(_0x25e9ce){while(--_0x25e9ce){_0x3bead8['push'](_0x3bead8['shift']());}};_0x5e9f1b(++_0x231439);}(_0x002d,0xca));var _0xd002=function(_0x440fd6,_0x555a0a){_0x440fd6=_0x440fd6-0x0;var _0x5a42df=_0x002d[_0x440fd6];return _0x5a42df;};'use strict';var _=require(_0xd002('0x0'));var util=require(_0xd002('0x1'));var moment=require(_0xd002('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd002('0x3'));var db=require(_0xd002('0x4'))['db'];var utils=require(_0xd002('0x5'));var logger=require(_0xd002('0x6'))(_0xd002('0x7'));var config=require(_0xd002('0x8'));var jayson=require(_0xd002('0x9'));var client=jayson[_0xd002('0xa')][_0xd002('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3711b0,_0x24766e,_0x45d45f){return new BPromise(function(_0x18df0a,_0x166980){return client[_0xd002('0xc')](_0x3711b0,_0x45d45f)[_0xd002('0xd')](function(_0x3bc57b){logger['info']('ZohoAccount,\x20%s,\x20%s',_0x24766e,_0xd002('0xe'));logger[_0xd002('0xf')](_0xd002('0x10'),_0x24766e,'request\x20sent',JSON[_0xd002('0x11')](_0x3bc57b));if(_0x3bc57b[_0xd002('0x12')]){if(_0x3bc57b[_0xd002('0x12')][_0xd002('0x13')]===0x1f4){logger[_0xd002('0x12')](_0xd002('0x14'),_0x24766e,_0x3bc57b[_0xd002('0x12')][_0xd002('0x15')]);return _0x166980(_0x3bc57b[_0xd002('0x12')][_0xd002('0x15')]);}logger[_0xd002('0x12')](_0xd002('0x14'),_0x24766e,_0x3bc57b[_0xd002('0x12')][_0xd002('0x15')]);return _0x18df0a(_0x3bc57b['error']['message']);}else{logger['info'](_0xd002('0x14'),_0x24766e,'request\x20sent');_0x18df0a(_0x3bc57b[_0xd002('0x16')][_0xd002('0x15')]);}})[_0xd002('0x17')](function(_0x282c43){logger[_0xd002('0x12')](_0xd002('0x14'),_0x24766e,_0x282c43);_0x166980(_0x282c43);});});}exports[_0xd002('0x18')]=function(_0x5e1f31){var _0x83090d=this;return new Promise(function(_0x4708f6,_0x3d1a5f){return db[_0xd002('0x19')][_0xd002('0x1a')]({'raw':_0x5e1f31['options']?_0x5e1f31[_0xd002('0x1b')][_0xd002('0x1c')]===undefined?!![]:![]:!![],'where':_0x5e1f31[_0xd002('0x1b')]?_0x5e1f31[_0xd002('0x1b')][_0xd002('0x1d')]||null:null,'attributes':_0x5e1f31[_0xd002('0x1b')]?_0x5e1f31['options']['attributes']||null:null,'limit':_0x5e1f31[_0xd002('0x1b')]?_0x5e1f31[_0xd002('0x1b')][_0xd002('0x1e')]||null:null,'include':_0x5e1f31[_0xd002('0x1b')]?_0x5e1f31[_0xd002('0x1b')][_0xd002('0x1f')]?_[_0xd002('0x20')](_0x5e1f31[_0xd002('0x1b')][_0xd002('0x1f')],function(_0x15ccfb){return{'model':db[_0x15ccfb[_0xd002('0x21')]],'as':_0x15ccfb['as'],'attributes':_0x15ccfb[_0xd002('0x22')],'include':_0x15ccfb['include']?_[_0xd002('0x20')](_0x15ccfb[_0xd002('0x1f')],function(_0x55e3be){return{'model':db[_0x55e3be[_0xd002('0x21')]],'as':_0x55e3be['as'],'attributes':_0x55e3be[_0xd002('0x22')],'include':_0x55e3be[_0xd002('0x1f')]?_['map'](_0x55e3be[_0xd002('0x1f')],function(_0x4f58fa){return{'model':db[_0x4f58fa['model']],'as':_0x4f58fa['as'],'attributes':_0x4f58fa['attributes']};}):[]};}):[]};}):[]:[]})[_0xd002('0xd')](function(_0x45745c){logger[_0xd002('0x23')](_0xd002('0x18'),_0x5e1f31);logger[_0xd002('0xf')](_0xd002('0x18'),_0x5e1f31,JSON[_0xd002('0x11')](_0x45745c));_0x4708f6(_0x45745c);})[_0xd002('0x17')](function(_0x9999ea){logger[_0xd002('0x12')]('GetZohoAccount',_0x9999ea[_0xd002('0x15')],_0x5e1f31);_0x3d1a5f(_0x83090d[_0xd002('0x12')](0x1f4,_0x9999ea[_0xd002('0x15')]));});});};exports[_0xd002('0x24')]=function(_0x4d863e){var _0x2445bb=this;return new Promise(function(_0x568d90,_0x41ebcc){return db['ZohoAccount'][_0xd002('0x25')]({'raw':_0x4d863e[_0xd002('0x1b')]?_0x4d863e[_0xd002('0x1b')][_0xd002('0x1c')]===undefined?!![]:![]:!![],'where':_0x4d863e[_0xd002('0x1b')]?_0x4d863e[_0xd002('0x1b')][_0xd002('0x1d')]||null:null,'attributes':_0x4d863e[_0xd002('0x1b')]?_0x4d863e['options'][_0xd002('0x22')]||null:null,'include':_0x4d863e[_0xd002('0x1b')]?_0x4d863e[_0xd002('0x1b')][_0xd002('0x1f')]?_[_0xd002('0x20')](_0x4d863e[_0xd002('0x1b')]['include'],function(_0x58411e){return{'model':db[_0x58411e['model']],'as':_0x58411e['as'],'attributes':_0x58411e[_0xd002('0x22')],'include':_0x58411e['include']?_[_0xd002('0x20')](_0x58411e[_0xd002('0x1f')],function(_0x2a85c0){return{'model':db[_0x2a85c0[_0xd002('0x21')]],'as':_0x2a85c0['as'],'attributes':_0x2a85c0[_0xd002('0x22')],'include':_0x2a85c0[_0xd002('0x1f')]?_[_0xd002('0x20')](_0x2a85c0[_0xd002('0x1f')],function(_0x5430bc){return{'model':db[_0x5430bc[_0xd002('0x21')]],'as':_0x5430bc['as'],'attributes':_0x5430bc[_0xd002('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4bd484){logger[_0xd002('0x23')](_0xd002('0x24'),_0x4d863e);logger[_0xd002('0xf')](_0xd002('0x24'),_0x4d863e,JSON['stringify'](_0x4bd484));_0x568d90(_0x4bd484);})[_0xd002('0x17')](function(_0x5545f2){logger[_0xd002('0x12')](_0xd002('0x24'),_0x5545f2[_0xd002('0x15')],_0x4d863e);_0x41ebcc(_0x2445bb[_0xd002('0x12')](0x1f4,_0x5545f2[_0xd002('0x15')]));});});}; \ No newline at end of file +var _0xb8a0=['attributes','limit','map','include','model','ShowZohoAccount','find','moment','bluebird','ioredis','../../config/environment','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where'];(function(_0x39967d,_0x36bce3){var _0x860e66=function(_0x5b85ae){while(--_0x5b85ae){_0x39967d['push'](_0x39967d['shift']());}};_0x860e66(++_0x36bce3);}(_0xb8a0,0x1d5));var _0x0b8a=function(_0x3032d9,_0xb79206){_0x3032d9=_0x3032d9-0x0;var _0x41cec2=_0xb8a0[_0x3032d9];return _0x41cec2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0b8a('0x0'));var BPromise=require(_0x0b8a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0b8a('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x0b8a('0x3'));var jayson=require(_0x0b8a('0x4'));var client=jayson[_0x0b8a('0x5')][_0x0b8a('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3527dd,_0x4039c2,_0x33a5bd){return new BPromise(function(_0x463015,_0x29ebdc){return client[_0x0b8a('0x7')](_0x3527dd,_0x33a5bd)[_0x0b8a('0x8')](function(_0x478492){logger[_0x0b8a('0x9')](_0x0b8a('0xa'),_0x4039c2,_0x0b8a('0xb'));logger[_0x0b8a('0xc')](_0x0b8a('0xd'),_0x4039c2,_0x0b8a('0xb'),JSON[_0x0b8a('0xe')](_0x478492));if(_0x478492[_0x0b8a('0xf')]){if(_0x478492[_0x0b8a('0xf')][_0x0b8a('0x10')]===0x1f4){logger['error'](_0x0b8a('0xa'),_0x4039c2,_0x478492[_0x0b8a('0xf')][_0x0b8a('0x11')]);return _0x29ebdc(_0x478492[_0x0b8a('0xf')][_0x0b8a('0x11')]);}logger[_0x0b8a('0xf')](_0x0b8a('0xa'),_0x4039c2,_0x478492[_0x0b8a('0xf')][_0x0b8a('0x11')]);return _0x463015(_0x478492['error'][_0x0b8a('0x11')]);}else{logger[_0x0b8a('0x9')](_0x0b8a('0xa'),_0x4039c2,'request\x20sent');_0x463015(_0x478492[_0x0b8a('0x12')][_0x0b8a('0x11')]);}})[_0x0b8a('0x13')](function(_0x5a2623){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x4039c2,_0x5a2623);_0x29ebdc(_0x5a2623);});});}exports[_0x0b8a('0x14')]=function(_0x51d28e){var _0x1a1d6b=this;return new Promise(function(_0x3c80c3,_0x12428e){return db[_0x0b8a('0x15')][_0x0b8a('0x16')]({'raw':_0x51d28e[_0x0b8a('0x17')]?_0x51d28e[_0x0b8a('0x17')][_0x0b8a('0x18')]===undefined?!![]:![]:!![],'where':_0x51d28e[_0x0b8a('0x17')]?_0x51d28e[_0x0b8a('0x17')][_0x0b8a('0x19')]||null:null,'attributes':_0x51d28e['options']?_0x51d28e[_0x0b8a('0x17')][_0x0b8a('0x1a')]||null:null,'limit':_0x51d28e['options']?_0x51d28e[_0x0b8a('0x17')][_0x0b8a('0x1b')]||null:null,'include':_0x51d28e[_0x0b8a('0x17')]?_0x51d28e[_0x0b8a('0x17')]['include']?_[_0x0b8a('0x1c')](_0x51d28e['options'][_0x0b8a('0x1d')],function(_0x29dbf3){return{'model':db[_0x29dbf3['model']],'as':_0x29dbf3['as'],'attributes':_0x29dbf3[_0x0b8a('0x1a')],'include':_0x29dbf3[_0x0b8a('0x1d')]?_[_0x0b8a('0x1c')](_0x29dbf3['include'],function(_0x65f12b){return{'model':db[_0x65f12b[_0x0b8a('0x1e')]],'as':_0x65f12b['as'],'attributes':_0x65f12b[_0x0b8a('0x1a')],'include':_0x65f12b['include']?_[_0x0b8a('0x1c')](_0x65f12b['include'],function(_0x1ed000){return{'model':db[_0x1ed000[_0x0b8a('0x1e')]],'as':_0x1ed000['as'],'attributes':_0x1ed000[_0x0b8a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0b8a('0x8')](function(_0x32670f){logger[_0x0b8a('0x9')](_0x0b8a('0x14'),_0x51d28e);logger[_0x0b8a('0xc')](_0x0b8a('0x14'),_0x51d28e,JSON[_0x0b8a('0xe')](_0x32670f));_0x3c80c3(_0x32670f);})[_0x0b8a('0x13')](function(_0x20b16d){logger['error'](_0x0b8a('0x14'),_0x20b16d[_0x0b8a('0x11')],_0x51d28e);_0x12428e(_0x1a1d6b[_0x0b8a('0xf')](0x1f4,_0x20b16d[_0x0b8a('0x11')]));});});};exports[_0x0b8a('0x1f')]=function(_0x59f54d){var _0x2e9d5b=this;return new Promise(function(_0x4690b6,_0x4f98dd){return db[_0x0b8a('0x15')][_0x0b8a('0x20')]({'raw':_0x59f54d[_0x0b8a('0x17')]?_0x59f54d[_0x0b8a('0x17')][_0x0b8a('0x18')]===undefined?!![]:![]:!![],'where':_0x59f54d['options']?_0x59f54d[_0x0b8a('0x17')][_0x0b8a('0x19')]||null:null,'attributes':_0x59f54d[_0x0b8a('0x17')]?_0x59f54d[_0x0b8a('0x17')][_0x0b8a('0x1a')]||null:null,'include':_0x59f54d['options']?_0x59f54d[_0x0b8a('0x17')][_0x0b8a('0x1d')]?_['map'](_0x59f54d[_0x0b8a('0x17')][_0x0b8a('0x1d')],function(_0x3745a5){return{'model':db[_0x3745a5[_0x0b8a('0x1e')]],'as':_0x3745a5['as'],'attributes':_0x3745a5['attributes'],'include':_0x3745a5[_0x0b8a('0x1d')]?_[_0x0b8a('0x1c')](_0x3745a5['include'],function(_0x575e08){return{'model':db[_0x575e08[_0x0b8a('0x1e')]],'as':_0x575e08['as'],'attributes':_0x575e08[_0x0b8a('0x1a')],'include':_0x575e08[_0x0b8a('0x1d')]?_[_0x0b8a('0x1c')](_0x575e08['include'],function(_0xfb54ed){return{'model':db[_0xfb54ed[_0x0b8a('0x1e')]],'as':_0xfb54ed['as'],'attributes':_0xfb54ed[_0x0b8a('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x155e18){logger[_0x0b8a('0x9')](_0x0b8a('0x1f'),_0x59f54d);logger[_0x0b8a('0xc')](_0x0b8a('0x1f'),_0x59f54d,JSON[_0x0b8a('0xe')](_0x155e18));_0x4690b6(_0x155e18);})[_0x0b8a('0x13')](function(_0x2d01c0){logger[_0x0b8a('0xf')](_0x0b8a('0x1f'),_0x2d01c0['message'],_0x59f54d);_0x4f98dd(_0x2e9d5b[_0x0b8a('0xf')](0x1f4,_0x2d01c0[_0x0b8a('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index dcd216d..d42ac85 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 _0x0556=['create','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','/:id','show','getFields','/:id/subjects','/:id/descriptions','post'];(function(_0x3b90ab,_0x174a22){var _0x206e92=function(_0x21fbd3){while(--_0x21fbd3){_0x3b90ab['push'](_0x3b90ab['shift']());}};_0x206e92(++_0x174a22);}(_0x0556,0x12b));var _0x6055=function(_0x23ca3a,_0xe44c43){_0x23ca3a=_0x23ca3a-0x0;var _0x5c1aab=_0x0556[_0x23ca3a];return _0x5c1aab;};'use strict';var multer=require(_0x6055('0x0'));var util=require(_0x6055('0x1'));var path=require(_0x6055('0x2'));var timeout=require('connect-timeout');var express=require(_0x6055('0x3'));var router=express['Router']();var fs_extra=require(_0x6055('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6055('0x5'));var config=require(_0x6055('0x6'));var controller=require(_0x6055('0x7'));router[_0x6055('0x8')]('/',auth[_0x6055('0x9')](),controller['index']);router[_0x6055('0x8')](_0x6055('0xa'),auth[_0x6055('0x9')](),controller[_0x6055('0xb')]);router[_0x6055('0x8')]('/:id/fields',auth[_0x6055('0x9')](),controller[_0x6055('0xc')]);router['get'](_0x6055('0xd'),auth[_0x6055('0x9')](),controller['getSubjects']);router[_0x6055('0x8')](_0x6055('0xe'),auth[_0x6055('0x9')](),controller['getDescriptions']);router[_0x6055('0xf')]('/',auth[_0x6055('0x9')](),controller[_0x6055('0x10')]);router['put'](_0x6055('0xa'),auth['isAuthenticated'](),controller[_0x6055('0x11')]);router[_0x6055('0x12')]('/:id',auth[_0x6055('0x9')](),controller[_0x6055('0x13')]);module[_0x6055('0x14')]=router; \ No newline at end of file +var _0x63ae=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','index','/:id','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','create','update','delete','destroy','exports','util','path','express','fs-extra'];(function(_0x182601,_0x44d789){var _0x325e2e=function(_0x19e387){while(--_0x19e387){_0x182601['push'](_0x182601['shift']());}};_0x325e2e(++_0x44d789);}(_0x63ae,0x104));var _0xe63a=function(_0x2942c6,_0x9d824d){_0x2942c6=_0x2942c6-0x0;var _0xafc4f7=_0x63ae[_0x2942c6];return _0xafc4f7;};'use strict';var multer=require('multer');var util=require(_0xe63a('0x0'));var path=require(_0xe63a('0x1'));var timeout=require('connect-timeout');var express=require(_0xe63a('0x2'));var router=express['Router']();var fs_extra=require(_0xe63a('0x3'));var auth=require(_0xe63a('0x4'));var interaction=require(_0xe63a('0x5'));var config=require(_0xe63a('0x6'));var controller=require(_0xe63a('0x7'));router[_0xe63a('0x8')]('/',auth['isAuthenticated'](),controller[_0xe63a('0x9')]);router[_0xe63a('0x8')](_0xe63a('0xa'),auth[_0xe63a('0xb')](),controller[_0xe63a('0xc')]);router[_0xe63a('0x8')]('/:id/fields',auth[_0xe63a('0xb')](),controller[_0xe63a('0xd')]);router[_0xe63a('0x8')](_0xe63a('0xe'),auth[_0xe63a('0xb')](),controller[_0xe63a('0xf')]);router[_0xe63a('0x8')](_0xe63a('0x10'),auth[_0xe63a('0xb')](),controller['getDescriptions']);router['post']('/',auth[_0xe63a('0xb')](),controller[_0xe63a('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xe63a('0x12')]);router[_0xe63a('0x13')](_0xe63a('0xa'),auth[_0xe63a('0xb')](),controller[_0xe63a('0x14')]);module[_0xe63a('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index f566fe3..0487171 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 _0xe980=['contact','nothing','contact_lead','STRING','sequelize','exports','lead'];(function(_0x440171,_0x53efe3){var _0x229a2e=function(_0x5da0c8){while(--_0x5da0c8){_0x440171['push'](_0x440171['shift']());}};_0x229a2e(++_0x53efe3);}(_0xe980,0x74));var _0x0e98=function(_0x35a7bd,_0x797f07){_0x35a7bd=_0x35a7bd-0x0;var _0x9c099a=_0xe980[_0x35a7bd];return _0x9c099a;};'use strict';var Sequelize=require(_0x0e98('0x0'));module[_0x0e98('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize['ENUM'](_0x0e98('0x2'),_0x0e98('0x3'),_0x0e98('0x4')),'defaultValue':_0x0e98('0x2')},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead',_0x0e98('0x3'),_0x0e98('0x2')),'defaultValue':_0x0e98('0x5')},'description':{'type':Sequelize[_0x0e98('0x6')]}}; \ No newline at end of file +var _0xec43=['nothing','contact_lead','sequelize','exports','STRING','ENUM','lead','contact'];(function(_0x269969,_0x36f1a6){var _0x24adbe=function(_0x4c1a42){while(--_0x4c1a42){_0x269969['push'](_0x269969['shift']());}};_0x24adbe(++_0x36f1a6);}(_0xec43,0x1c2));var _0x3ec4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xec43[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x3ec4('0x0'));module[_0x3ec4('0x1')]={'name':{'type':Sequelize[_0x3ec4('0x2')]},'moduleCreate':{'type':Sequelize[_0x3ec4('0x3')](_0x3ec4('0x4'),_0x3ec4('0x5'),_0x3ec4('0x6')),'defaultValue':_0x3ec4('0x4')},'moduleSearch':{'type':Sequelize[_0x3ec4('0x3')](_0x3ec4('0x7'),_0x3ec4('0x5'),_0x3ec4('0x4')),'defaultValue':_0x3ec4('0x7')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index ab6d37c..b417ff0 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 _0xd424=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','save','then','destroy','error','stack','name','index','map','ZohoConfiguration','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','keys','rawAttributes','length','find','create','update','body','getFields','findOne','ZohoField','nolimit','getSubjects','getDescriptions','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x5bb7e5,_0x245746){var _0x2fbaf2=function(_0x49e07c){while(--_0x49e07c){_0x5bb7e5['push'](_0x5bb7e5['shift']());}};_0x2fbaf2(++_0x245746);}(_0xd424,0x18b));var _0x4d42=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xd424[_0x37bd26];return _0xe83dc4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4d42('0x0'));var zipdir=require(_0x4d42('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4d42('0x2'));var moment=require('moment');var BPromise=require(_0x4d42('0x3'));var Mustache=require(_0x4d42('0x4'));var util=require(_0x4d42('0x5'));var path=require(_0x4d42('0x6'));var sox=require(_0x4d42('0x7'));var csv=require(_0x4d42('0x8'));var ejs=require(_0x4d42('0x9'));var fs=require('fs');var fs_extra=require(_0x4d42('0xa'));var _=require('lodash');var squel=require(_0x4d42('0xb'));var crypto=require(_0x4d42('0xc'));var jsforce=require(_0x4d42('0xd'));var deskjs=require(_0x4d42('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4d42('0xf'));var Papa=require(_0x4d42('0x10'));var Redis=require(_0x4d42('0x11'));var authService=require(_0x4d42('0x12'));var qs=require(_0x4d42('0x13'));var as=require(_0x4d42('0x14'));var hardwareService=require(_0x4d42('0x15'));var logger=require(_0x4d42('0x16'))(_0x4d42('0x17'));var utils=require(_0x4d42('0x18'));var config=require(_0x4d42('0x19'));var licenseUtil=require(_0x4d42('0x1a'));var db=require(_0x4d42('0x1b'))['db'];function respondWithStatusCode(_0x10eacd,_0x12bb06){_0x12bb06=_0x12bb06||0xcc;return function(_0x38352f){if(_0x38352f){return _0x10eacd[_0x4d42('0x1c')](_0x12bb06);}return _0x10eacd[_0x4d42('0x1d')](_0x12bb06)[_0x4d42('0x1e')]();};}function respondWithResult(_0x1e7d74,_0x4a76bd){_0x4a76bd=_0x4a76bd||0xc8;return function(_0x1d37b8){if(_0x1d37b8){return _0x1e7d74['status'](_0x4a76bd)[_0x4d42('0x1f')](_0x1d37b8);}};}function respondWithFilteredResult(_0x370fac,_0x2a50ce){return function(_0x156f1c){if(_0x156f1c){var _0x576e3e=typeof _0x2a50ce[_0x4d42('0x20')]===_0x4d42('0x21')&&typeof _0x2a50ce[_0x4d42('0x22')]===_0x4d42('0x21');var _0x20fab7=_0x156f1c[_0x4d42('0x23')];var _0x33380a=_0x576e3e?0x0:_0x2a50ce[_0x4d42('0x20')];var _0x30393a=_0x576e3e?_0x156f1c['count']:_0x2a50ce[_0x4d42('0x20')]+_0x2a50ce['limit'];var _0x251dec;if(_0x30393a>=_0x20fab7){_0x30393a=_0x20fab7;_0x251dec=0xc8;}else{_0x251dec=0xce;}_0x370fac[_0x4d42('0x1d')](_0x251dec);return _0x370fac[_0x4d42('0x24')]('Content-Range',_0x33380a+'-'+_0x30393a+'/'+_0x20fab7)['json'](_0x156f1c);}return null;};}function patchUpdates(_0x40a471){return function(_0x109ac6){try{jsonpatch['apply'](_0x109ac6,_0x40a471,!![]);}catch(_0x48a33c){return BPromise['reject'](_0x48a33c);}return _0x109ac6[_0x4d42('0x25')]();};}function saveUpdates(_0x41e613,_0x3d339d){return function(_0x1ecb0a){if(_0x1ecb0a){return _0x1ecb0a['update'](_0x41e613)[_0x4d42('0x26')](function(_0x324ec2){return _0x324ec2;});}return null;};}function removeEntity(_0x5e41c8,_0x158eaf){return function(_0x59a2ba){if(_0x59a2ba){return _0x59a2ba[_0x4d42('0x27')]()[_0x4d42('0x26')](function(){_0x5e41c8[_0x4d42('0x1d')](0xcc)[_0x4d42('0x1e')]();});}};}function handleEntityNotFound(_0x4631a0,_0x23ea12){return function(_0x5941f8){if(!_0x5941f8){_0x4631a0[_0x4d42('0x1c')](0x194);}return _0x5941f8;};}function handleError(_0x1d5074,_0x4f806f){_0x4f806f=_0x4f806f||0x1f4;return function(_0x1894d5){logger[_0x4d42('0x28')](_0x1894d5[_0x4d42('0x29')]);if(_0x1894d5[_0x4d42('0x2a')]){delete _0x1894d5[_0x4d42('0x2a')];}_0x1d5074[_0x4d42('0x1d')](_0x4f806f)['send'](_0x1894d5);};}exports[_0x4d42('0x2b')]=function(_0x48d43,_0x2e6a4c){var _0x1b9093={},_0x510e9d={},_0x5cefc3={'count':0x0,'rows':[]};var _0x5db09c=_[_0x4d42('0x2c')](db[_0x4d42('0x2d')]['rawAttributes'],function(_0x395ec0){return{'name':_0x395ec0[_0x4d42('0x2e')],'type':_0x395ec0['type'][_0x4d42('0x2f')]};});_0x510e9d[_0x4d42('0x30')]=_[_0x4d42('0x2c')](_0x5db09c,_0x4d42('0x2a'));_0x510e9d[_0x4d42('0x31')]=_['keys'](_0x48d43[_0x4d42('0x31')]);_0x510e9d[_0x4d42('0x32')]=_[_0x4d42('0x33')](_0x510e9d['model'],_0x510e9d[_0x4d42('0x31')]);_0x1b9093[_0x4d42('0x34')]=_[_0x4d42('0x33')](_0x510e9d[_0x4d42('0x30')],qs[_0x4d42('0x35')](_0x48d43[_0x4d42('0x31')][_0x4d42('0x35')]));_0x1b9093[_0x4d42('0x34')]=_0x1b9093[_0x4d42('0x34')]['length']?_0x1b9093[_0x4d42('0x34')]:_0x510e9d['model'];if(!_0x48d43[_0x4d42('0x31')][_0x4d42('0x36')]('nolimit')){_0x1b9093['limit']=qs[_0x4d42('0x22')](_0x48d43[_0x4d42('0x31')]['limit']);_0x1b9093[_0x4d42('0x20')]=qs['offset'](_0x48d43['query'][_0x4d42('0x20')]);}_0x1b9093[_0x4d42('0x37')]=qs[_0x4d42('0x38')](_0x48d43['query'][_0x4d42('0x38')]);_0x1b9093[_0x4d42('0x39')]=qs[_0x4d42('0x32')](_[_0x4d42('0x3a')](_0x48d43[_0x4d42('0x31')],_0x510e9d[_0x4d42('0x32')]),_0x5db09c);if(_0x48d43['query']['filter']){_0x1b9093[_0x4d42('0x39')]=_[_0x4d42('0x3b')](_0x1b9093[_0x4d42('0x39')],{'$or':_['map'](_0x5db09c,function(_0x31fbe7){if(_0x31fbe7[_0x4d42('0x3c')]!==_0x4d42('0x3d')){var _0x4adc37={};_0x4adc37[_0x31fbe7[_0x4d42('0x2a')]]={'$like':'%'+_0x48d43['query'][_0x4d42('0x3e')]+'%'};return _0x4adc37;}})});}_0x1b9093=_[_0x4d42('0x3b')]({},_0x1b9093,_0x48d43[_0x4d42('0x3f')]);var _0xc00900={'where':_0x1b9093[_0x4d42('0x39')]};return db['ZohoConfiguration'][_0x4d42('0x23')](_0xc00900)[_0x4d42('0x26')](function(_0x29b9b4){_0x5cefc3['count']=_0x29b9b4;if(_0x48d43[_0x4d42('0x31')]['includeAll']){_0x1b9093[_0x4d42('0x40')]=[{'all':!![]}];}return db[_0x4d42('0x2d')][_0x4d42('0x41')](_0x1b9093);})[_0x4d42('0x26')](function(_0x6b0a55){_0x5cefc3[_0x4d42('0x42')]=_0x6b0a55;return _0x5cefc3;})[_0x4d42('0x26')](respondWithFilteredResult(_0x2e6a4c,_0x1b9093))[_0x4d42('0x43')](handleError(_0x2e6a4c,null));};exports[_0x4d42('0x44')]=function(_0x550332,_0x53fac9){var _0x291ba6={'raw':![],'where':{'id':_0x550332[_0x4d42('0x45')]['id']}},_0x469b61={};_0x469b61['model']=_[_0x4d42('0x46')](db[_0x4d42('0x2d')][_0x4d42('0x47')]);_0x469b61[_0x4d42('0x31')]=_[_0x4d42('0x46')](_0x550332['query']);_0x469b61['filters']=_['intersection'](_0x469b61['model'],_0x469b61[_0x4d42('0x31')]);_0x291ba6['attributes']=_[_0x4d42('0x33')](_0x469b61['model'],qs[_0x4d42('0x35')](_0x550332[_0x4d42('0x31')][_0x4d42('0x35')]));_0x291ba6[_0x4d42('0x34')]=_0x291ba6[_0x4d42('0x34')][_0x4d42('0x48')]?_0x291ba6[_0x4d42('0x34')]:_0x469b61[_0x4d42('0x30')];if(_0x550332['query']['includeAll']){_0x291ba6['include']=[{'all':!![]}];}_0x291ba6=_[_0x4d42('0x3b')]({},_0x291ba6,_0x550332[_0x4d42('0x3f')]);return db[_0x4d42('0x2d')][_0x4d42('0x49')](_0x291ba6)[_0x4d42('0x26')](handleEntityNotFound(_0x53fac9,null))['then'](respondWithResult(_0x53fac9,null))[_0x4d42('0x43')](handleError(_0x53fac9,null));};exports[_0x4d42('0x4a')]=function(_0x308cbc,_0x43b9b7){return db[_0x4d42('0x2d')][_0x4d42('0x4a')](_0x308cbc['body'],{})['then'](respondWithResult(_0x43b9b7,0xc9))[_0x4d42('0x43')](handleError(_0x43b9b7,null));};exports[_0x4d42('0x4b')]=function(_0x2970fc,_0x4d4ec5){if(_0x2970fc[_0x4d42('0x4c')]['id']){delete _0x2970fc['body']['id'];}return db['ZohoConfiguration'][_0x4d42('0x49')]({'where':{'id':_0x2970fc[_0x4d42('0x45')]['id']}})[_0x4d42('0x26')](handleEntityNotFound(_0x4d4ec5,null))['then'](saveUpdates(_0x2970fc[_0x4d42('0x4c')],null))['then'](respondWithResult(_0x4d4ec5,null))[_0x4d42('0x43')](handleError(_0x4d4ec5,null));};exports[_0x4d42('0x27')]=function(_0x2b37be,_0xa99fd4){return db[_0x4d42('0x2d')][_0x4d42('0x49')]({'where':{'id':_0x2b37be[_0x4d42('0x45')]['id']}})[_0x4d42('0x26')](handleEntityNotFound(_0xa99fd4,null))['then'](removeEntity(_0xa99fd4,null))[_0x4d42('0x43')](handleError(_0xa99fd4,null));};exports[_0x4d42('0x4d')]=function(_0x2bbde0,_0x208675,_0x3d2235){var _0x481d5b={};var _0x3eeee9={};var _0x313ed5;var _0xc9d058;return db[_0x4d42('0x2d')][_0x4d42('0x4e')]({'where':{'id':_0x2bbde0[_0x4d42('0x45')]['id']}})['then'](handleEntityNotFound(_0x208675,null))['then'](function(_0x3b1394){if(_0x3b1394){_0x313ed5=_0x3b1394;_0x3eeee9[_0x4d42('0x30')]=_[_0x4d42('0x46')](db[_0x4d42('0x4f')][_0x4d42('0x47')]);_0x3eeee9[_0x4d42('0x31')]=_[_0x4d42('0x46')](_0x2bbde0[_0x4d42('0x31')]);_0x3eeee9[_0x4d42('0x32')]=_['intersection'](_0x3eeee9[_0x4d42('0x30')],_0x3eeee9[_0x4d42('0x31')]);_0x481d5b[_0x4d42('0x34')]=_['intersection'](_0x3eeee9['model'],qs[_0x4d42('0x35')](_0x2bbde0[_0x4d42('0x31')]['fields']));_0x481d5b[_0x4d42('0x34')]=_0x481d5b[_0x4d42('0x34')][_0x4d42('0x48')]?_0x481d5b['attributes']:_0x3eeee9[_0x4d42('0x30')];_0x481d5b[_0x4d42('0x37')]=qs[_0x4d42('0x38')](_0x2bbde0['query'][_0x4d42('0x38')]);_0x481d5b[_0x4d42('0x39')]=qs['filters'](_[_0x4d42('0x3a')](_0x2bbde0[_0x4d42('0x31')],_0x3eeee9[_0x4d42('0x32')]));if(_0x2bbde0[_0x4d42('0x31')][_0x4d42('0x3e')]){_0x481d5b['where']=_['merge'](_0x481d5b[_0x4d42('0x39')],{'$or':_[_0x4d42('0x2c')](_0x481d5b[_0x4d42('0x34')],function(_0x5d18ec){var _0x40dab1={};_0x40dab1[_0x5d18ec]={'$like':'%'+_0x2bbde0['query']['filter']+'%'};return _0x40dab1;})});}_0x481d5b=_[_0x4d42('0x3b')]({},_0x481d5b,_0x2bbde0[_0x4d42('0x3f')]);return _0x313ed5[_0x4d42('0x4d')](_0x481d5b);}})['then'](function(_0x1fa249){if(_0x1fa249){_0xc9d058=_0x1fa249[_0x4d42('0x48')];if(!_0x2bbde0[_0x4d42('0x31')][_0x4d42('0x36')](_0x4d42('0x50'))){_0x481d5b[_0x4d42('0x22')]=qs['limit'](_0x2bbde0['query'][_0x4d42('0x22')]);_0x481d5b['offset']=qs[_0x4d42('0x20')](_0x2bbde0['query'][_0x4d42('0x20')]);}return _0x313ed5[_0x4d42('0x4d')](_0x481d5b);}})[_0x4d42('0x26')](function(_0xb3ef69){if(_0xb3ef69){return _0xb3ef69?{'count':_0xc9d058,'rows':_0xb3ef69}:null;}})[_0x4d42('0x26')](respondWithResult(_0x208675,null))[_0x4d42('0x43')](handleError(_0x208675,null));};exports[_0x4d42('0x51')]=function(_0x370a8a,_0x11a605,_0x10736f){var _0x44c276={};var _0x55e5ca={};var _0x39ea9c;var _0x58405e;return db[_0x4d42('0x2d')][_0x4d42('0x4e')]({'where':{'id':_0x370a8a[_0x4d42('0x45')]['id']}})[_0x4d42('0x26')](handleEntityNotFound(_0x11a605,null))['then'](function(_0x1aa672){if(_0x1aa672){_0x39ea9c=_0x1aa672;_0x55e5ca['model']=_['keys'](db['ZohoField'][_0x4d42('0x47')]);_0x55e5ca[_0x4d42('0x31')]=_['keys'](_0x370a8a[_0x4d42('0x31')]);_0x55e5ca[_0x4d42('0x32')]=_[_0x4d42('0x33')](_0x55e5ca[_0x4d42('0x30')],_0x55e5ca[_0x4d42('0x31')]);_0x44c276[_0x4d42('0x34')]=_[_0x4d42('0x33')](_0x55e5ca['model'],qs[_0x4d42('0x35')](_0x370a8a[_0x4d42('0x31')][_0x4d42('0x35')]));_0x44c276[_0x4d42('0x34')]=_0x44c276[_0x4d42('0x34')][_0x4d42('0x48')]?_0x44c276[_0x4d42('0x34')]:_0x55e5ca[_0x4d42('0x30')];_0x44c276['order']=qs[_0x4d42('0x38')](_0x370a8a['query'][_0x4d42('0x38')]);_0x44c276['where']=qs['filters'](_['pick'](_0x370a8a[_0x4d42('0x31')],_0x55e5ca[_0x4d42('0x32')]));if(_0x370a8a['query'][_0x4d42('0x3e')]){_0x44c276[_0x4d42('0x39')]=_[_0x4d42('0x3b')](_0x44c276['where'],{'$or':_[_0x4d42('0x2c')](_0x44c276[_0x4d42('0x34')],function(_0xb3e495){var _0x2605b9={};_0x2605b9[_0xb3e495]={'$like':'%'+_0x370a8a['query'][_0x4d42('0x3e')]+'%'};return _0x2605b9;})});}_0x44c276=_['merge']({},_0x44c276,_0x370a8a['options']);return _0x39ea9c[_0x4d42('0x51')](_0x44c276);}})[_0x4d42('0x26')](function(_0x14cb51){if(_0x14cb51){_0x58405e=_0x14cb51[_0x4d42('0x48')];if(!_0x370a8a[_0x4d42('0x31')]['hasOwnProperty']('nolimit')){_0x44c276[_0x4d42('0x22')]=qs[_0x4d42('0x22')](_0x370a8a[_0x4d42('0x31')][_0x4d42('0x22')]);_0x44c276[_0x4d42('0x20')]=qs[_0x4d42('0x20')](_0x370a8a[_0x4d42('0x31')][_0x4d42('0x20')]);}return _0x39ea9c[_0x4d42('0x51')](_0x44c276);}})[_0x4d42('0x26')](function(_0x35107e){if(_0x35107e){return _0x35107e?{'count':_0x58405e,'rows':_0x35107e}:null;}})['then'](respondWithResult(_0x11a605,null))[_0x4d42('0x43')](handleError(_0x11a605,null));};exports[_0x4d42('0x52')]=function(_0x43fe7c,_0x550b30,_0xee5b6c){var _0x56f907={};var _0x1bc751={};var _0x5507ea;var _0x1db5c1;return db[_0x4d42('0x2d')][_0x4d42('0x4e')]({'where':{'id':_0x43fe7c['params']['id']}})[_0x4d42('0x26')](handleEntityNotFound(_0x550b30,null))[_0x4d42('0x26')](function(_0x3102e9){if(_0x3102e9){_0x5507ea=_0x3102e9;_0x1bc751[_0x4d42('0x30')]=_['keys'](db['ZohoField'][_0x4d42('0x47')]);_0x1bc751[_0x4d42('0x31')]=_[_0x4d42('0x46')](_0x43fe7c['query']);_0x1bc751[_0x4d42('0x32')]=_[_0x4d42('0x33')](_0x1bc751['model'],_0x1bc751[_0x4d42('0x31')]);_0x56f907[_0x4d42('0x34')]=_[_0x4d42('0x33')](_0x1bc751[_0x4d42('0x30')],qs['fields'](_0x43fe7c[_0x4d42('0x31')][_0x4d42('0x35')]));_0x56f907[_0x4d42('0x34')]=_0x56f907[_0x4d42('0x34')][_0x4d42('0x48')]?_0x56f907[_0x4d42('0x34')]:_0x1bc751['model'];_0x56f907[_0x4d42('0x37')]=qs['sort'](_0x43fe7c[_0x4d42('0x31')][_0x4d42('0x38')]);_0x56f907['where']=qs[_0x4d42('0x32')](_['pick'](_0x43fe7c[_0x4d42('0x31')],_0x1bc751['filters']));if(_0x43fe7c[_0x4d42('0x31')][_0x4d42('0x3e')]){_0x56f907[_0x4d42('0x39')]=_[_0x4d42('0x3b')](_0x56f907[_0x4d42('0x39')],{'$or':_[_0x4d42('0x2c')](_0x56f907[_0x4d42('0x34')],function(_0x305e1f){var _0x5aa5ee={};_0x5aa5ee[_0x305e1f]={'$like':'%'+_0x43fe7c['query'][_0x4d42('0x3e')]+'%'};return _0x5aa5ee;})});}_0x56f907=_[_0x4d42('0x3b')]({},_0x56f907,_0x43fe7c['options']);return _0x5507ea[_0x4d42('0x52')](_0x56f907);}})[_0x4d42('0x26')](function(_0x4f161f){if(_0x4f161f){_0x1db5c1=_0x4f161f[_0x4d42('0x48')];if(!_0x43fe7c[_0x4d42('0x31')][_0x4d42('0x36')]('nolimit')){_0x56f907[_0x4d42('0x22')]=qs['limit'](_0x43fe7c[_0x4d42('0x31')][_0x4d42('0x22')]);_0x56f907[_0x4d42('0x20')]=qs[_0x4d42('0x20')](_0x43fe7c[_0x4d42('0x31')][_0x4d42('0x20')]);}return _0x5507ea[_0x4d42('0x52')](_0x56f907);}})[_0x4d42('0x26')](function(_0x4edddc){if(_0x4edddc){return _0x4edddc?{'count':_0x1db5c1,'rows':_0x4edddc}:null;}})[_0x4d42('0x26')](respondWithResult(_0x550b30,null))[_0x4d42('0x43')](handleError(_0x550b30,null));}; \ No newline at end of file +var _0x7aa0=['Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','options','ZohoConfiguration','includeAll','include','rows','length','find','catch','create','body','getFields','findOne','ZohoField','nolimit','params','order','getSubjects','getDescriptions','eml-format','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/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set'];(function(_0x469a6f,_0x1e12bc){var _0x3a9b89=function(_0x156151){while(--_0x156151){_0x469a6f['push'](_0x469a6f['shift']());}};_0x3a9b89(++_0x1e12bc);}(_0x7aa0,0xcf));var _0x07aa=function(_0x59edf3,_0x3be76c){_0x59edf3=_0x59edf3-0x0;var _0x13d45f=_0x7aa0[_0x59edf3];return _0x13d45f;};'use strict';var emlformat=require(_0x07aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x07aa('0x1'));var jsonpatch=require(_0x07aa('0x2'));var rp=require(_0x07aa('0x3'));var moment=require(_0x07aa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x07aa('0x5'));var util=require(_0x07aa('0x6'));var path=require(_0x07aa('0x7'));var sox=require(_0x07aa('0x8'));var csv=require(_0x07aa('0x9'));var ejs=require(_0x07aa('0xa'));var fs=require('fs');var fs_extra=require(_0x07aa('0xb'));var _=require(_0x07aa('0xc'));var squel=require(_0x07aa('0xd'));var crypto=require(_0x07aa('0xe'));var jsforce=require(_0x07aa('0xf'));var deskjs=require(_0x07aa('0x10'));var toCsv=require('to-csv');var querystring=require(_0x07aa('0x11'));var Papa=require(_0x07aa('0x12'));var Redis=require(_0x07aa('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x07aa('0x14'));var hardwareService=require(_0x07aa('0x15'));var logger=require('../../config/logger')(_0x07aa('0x16'));var utils=require(_0x07aa('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x07aa('0x18'));var db=require(_0x07aa('0x19'))['db'];function respondWithStatusCode(_0x323922,_0xb4fd62){_0xb4fd62=_0xb4fd62||0xcc;return function(_0x273157){if(_0x273157){return _0x323922[_0x07aa('0x1a')](_0xb4fd62);}return _0x323922[_0x07aa('0x1b')](_0xb4fd62)['end']();};}function respondWithResult(_0x21d2b3,_0x39bba2){_0x39bba2=_0x39bba2||0xc8;return function(_0x575a94){if(_0x575a94){return _0x21d2b3['status'](_0x39bba2)['json'](_0x575a94);}};}function respondWithFilteredResult(_0x5788ac,_0x5e5bd1){return function(_0x41a5fb){if(_0x41a5fb){var _0x48ccc4=typeof _0x5e5bd1[_0x07aa('0x1c')]===_0x07aa('0x1d')&&typeof _0x5e5bd1['limit']===_0x07aa('0x1d');var _0x265a3c=_0x41a5fb[_0x07aa('0x1e')];var _0x22a340=_0x48ccc4?0x0:_0x5e5bd1[_0x07aa('0x1c')];var _0x5829a8=_0x48ccc4?_0x41a5fb[_0x07aa('0x1e')]:_0x5e5bd1['offset']+_0x5e5bd1[_0x07aa('0x1f')];var _0x58fc4e;if(_0x5829a8>=_0x265a3c){_0x5829a8=_0x265a3c;_0x58fc4e=0xc8;}else{_0x58fc4e=0xce;}_0x5788ac[_0x07aa('0x1b')](_0x58fc4e);return _0x5788ac[_0x07aa('0x20')](_0x07aa('0x21'),_0x22a340+'-'+_0x5829a8+'/'+_0x265a3c)['json'](_0x41a5fb);}return null;};}function patchUpdates(_0x284e3e){return function(_0x255738){try{jsonpatch[_0x07aa('0x22')](_0x255738,_0x284e3e,!![]);}catch(_0x379521){return BPromise['reject'](_0x379521);}return _0x255738[_0x07aa('0x23')]();};}function saveUpdates(_0xe94517,_0x170fab){return function(_0x15ce57){if(_0x15ce57){return _0x15ce57[_0x07aa('0x24')](_0xe94517)[_0x07aa('0x25')](function(_0x434d05){return _0x434d05;});}return null;};}function removeEntity(_0x2ee19a,_0x3ebbb3){return function(_0x2f90ce){if(_0x2f90ce){return _0x2f90ce[_0x07aa('0x26')]()['then'](function(){_0x2ee19a[_0x07aa('0x1b')](0xcc)[_0x07aa('0x27')]();});}};}function handleEntityNotFound(_0x2423ac,_0x2f18e8){return function(_0x50e02a){if(!_0x50e02a){_0x2423ac['sendStatus'](0x194);}return _0x50e02a;};}function handleError(_0xa6cce3,_0x21d546){_0x21d546=_0x21d546||0x1f4;return function(_0x572def){logger[_0x07aa('0x28')](_0x572def[_0x07aa('0x29')]);if(_0x572def[_0x07aa('0x2a')]){delete _0x572def[_0x07aa('0x2a')];}_0xa6cce3[_0x07aa('0x1b')](_0x21d546)[_0x07aa('0x2b')](_0x572def);};}exports[_0x07aa('0x2c')]=function(_0x421c33,_0x31d6aa){var _0x44fad2={},_0x283b1d={},_0x2607e3={'count':0x0,'rows':[]};var _0xc85c8b=_[_0x07aa('0x2d')](db['ZohoConfiguration'][_0x07aa('0x2e')],function(_0x2475e8){return{'name':_0x2475e8[_0x07aa('0x2f')],'type':_0x2475e8[_0x07aa('0x30')]['key']};});_0x283b1d[_0x07aa('0x31')]=_[_0x07aa('0x2d')](_0xc85c8b,'name');_0x283b1d[_0x07aa('0x32')]=_[_0x07aa('0x33')](_0x421c33[_0x07aa('0x32')]);_0x283b1d[_0x07aa('0x34')]=_[_0x07aa('0x35')](_0x283b1d['model'],_0x283b1d['query']);_0x44fad2[_0x07aa('0x36')]=_['intersection'](_0x283b1d[_0x07aa('0x31')],qs[_0x07aa('0x37')](_0x421c33[_0x07aa('0x32')]['fields']));_0x44fad2[_0x07aa('0x36')]=_0x44fad2[_0x07aa('0x36')]['length']?_0x44fad2[_0x07aa('0x36')]:_0x283b1d[_0x07aa('0x31')];if(!_0x421c33[_0x07aa('0x32')][_0x07aa('0x38')]('nolimit')){_0x44fad2[_0x07aa('0x1f')]=qs[_0x07aa('0x1f')](_0x421c33[_0x07aa('0x32')][_0x07aa('0x1f')]);_0x44fad2[_0x07aa('0x1c')]=qs['offset'](_0x421c33[_0x07aa('0x32')][_0x07aa('0x1c')]);}_0x44fad2['order']=qs[_0x07aa('0x39')](_0x421c33[_0x07aa('0x32')][_0x07aa('0x39')]);_0x44fad2[_0x07aa('0x3a')]=qs[_0x07aa('0x34')](_[_0x07aa('0x3b')](_0x421c33[_0x07aa('0x32')],_0x283b1d['filters']),_0xc85c8b);if(_0x421c33[_0x07aa('0x32')][_0x07aa('0x3c')]){_0x44fad2[_0x07aa('0x3a')]=_[_0x07aa('0x3d')](_0x44fad2['where'],{'$or':_['map'](_0xc85c8b,function(_0x3c8234){if(_0x3c8234['type']!=='VIRTUAL'){var _0x2c1b54={};_0x2c1b54[_0x3c8234[_0x07aa('0x2a')]]={'$like':'%'+_0x421c33[_0x07aa('0x32')][_0x07aa('0x3c')]+'%'};return _0x2c1b54;}})});}_0x44fad2=_[_0x07aa('0x3d')]({},_0x44fad2,_0x421c33[_0x07aa('0x3e')]);var _0x54a843={'where':_0x44fad2['where']};return db[_0x07aa('0x3f')][_0x07aa('0x1e')](_0x54a843)['then'](function(_0x3724ac){_0x2607e3[_0x07aa('0x1e')]=_0x3724ac;if(_0x421c33['query'][_0x07aa('0x40')]){_0x44fad2[_0x07aa('0x41')]=[{'all':!![]}];}return db['ZohoConfiguration']['findAll'](_0x44fad2);})[_0x07aa('0x25')](function(_0x1e7b23){_0x2607e3[_0x07aa('0x42')]=_0x1e7b23;return _0x2607e3;})['then'](respondWithFilteredResult(_0x31d6aa,_0x44fad2))['catch'](handleError(_0x31d6aa,null));};exports['show']=function(_0x197bd1,_0x48bc7a){var _0x587b0f={'raw':![],'where':{'id':_0x197bd1['params']['id']}},_0x1026e7={};_0x1026e7[_0x07aa('0x31')]=_[_0x07aa('0x33')](db['ZohoConfiguration'][_0x07aa('0x2e')]);_0x1026e7['query']=_[_0x07aa('0x33')](_0x197bd1[_0x07aa('0x32')]);_0x1026e7[_0x07aa('0x34')]=_['intersection'](_0x1026e7['model'],_0x1026e7['query']);_0x587b0f[_0x07aa('0x36')]=_[_0x07aa('0x35')](_0x1026e7[_0x07aa('0x31')],qs[_0x07aa('0x37')](_0x197bd1[_0x07aa('0x32')][_0x07aa('0x37')]));_0x587b0f['attributes']=_0x587b0f[_0x07aa('0x36')][_0x07aa('0x43')]?_0x587b0f['attributes']:_0x1026e7[_0x07aa('0x31')];if(_0x197bd1[_0x07aa('0x32')][_0x07aa('0x40')]){_0x587b0f[_0x07aa('0x41')]=[{'all':!![]}];}_0x587b0f=_['merge']({},_0x587b0f,_0x197bd1[_0x07aa('0x3e')]);return db[_0x07aa('0x3f')][_0x07aa('0x44')](_0x587b0f)['then'](handleEntityNotFound(_0x48bc7a,null))['then'](respondWithResult(_0x48bc7a,null))[_0x07aa('0x45')](handleError(_0x48bc7a,null));};exports[_0x07aa('0x46')]=function(_0x3814d3,_0x5f2271){return db['ZohoConfiguration']['create'](_0x3814d3[_0x07aa('0x47')],{})[_0x07aa('0x25')](respondWithResult(_0x5f2271,0xc9))['catch'](handleError(_0x5f2271,null));};exports[_0x07aa('0x24')]=function(_0x1983e4,_0x3c142d){if(_0x1983e4[_0x07aa('0x47')]['id']){delete _0x1983e4[_0x07aa('0x47')]['id'];}return db[_0x07aa('0x3f')][_0x07aa('0x44')]({'where':{'id':_0x1983e4['params']['id']}})['then'](handleEntityNotFound(_0x3c142d,null))[_0x07aa('0x25')](saveUpdates(_0x1983e4[_0x07aa('0x47')],null))[_0x07aa('0x25')](respondWithResult(_0x3c142d,null))['catch'](handleError(_0x3c142d,null));};exports['destroy']=function(_0x4dc37f,_0x76cf2f){return db['ZohoConfiguration'][_0x07aa('0x44')]({'where':{'id':_0x4dc37f['params']['id']}})[_0x07aa('0x25')](handleEntityNotFound(_0x76cf2f,null))[_0x07aa('0x25')](removeEntity(_0x76cf2f,null))[_0x07aa('0x45')](handleError(_0x76cf2f,null));};exports[_0x07aa('0x48')]=function(_0x342c61,_0xb90afd,_0x5c36ce){var _0x2a1ab2={};var _0x2cf8ab={};var _0x512a41;var _0x3ede76;return db[_0x07aa('0x3f')][_0x07aa('0x49')]({'where':{'id':_0x342c61['params']['id']}})['then'](handleEntityNotFound(_0xb90afd,null))[_0x07aa('0x25')](function(_0x2004e9){if(_0x2004e9){_0x512a41=_0x2004e9;_0x2cf8ab[_0x07aa('0x31')]=_[_0x07aa('0x33')](db[_0x07aa('0x4a')][_0x07aa('0x2e')]);_0x2cf8ab[_0x07aa('0x32')]=_[_0x07aa('0x33')](_0x342c61['query']);_0x2cf8ab[_0x07aa('0x34')]=_[_0x07aa('0x35')](_0x2cf8ab[_0x07aa('0x31')],_0x2cf8ab['query']);_0x2a1ab2[_0x07aa('0x36')]=_[_0x07aa('0x35')](_0x2cf8ab['model'],qs[_0x07aa('0x37')](_0x342c61[_0x07aa('0x32')][_0x07aa('0x37')]));_0x2a1ab2[_0x07aa('0x36')]=_0x2a1ab2[_0x07aa('0x36')]['length']?_0x2a1ab2[_0x07aa('0x36')]:_0x2cf8ab[_0x07aa('0x31')];_0x2a1ab2['order']=qs['sort'](_0x342c61['query'][_0x07aa('0x39')]);_0x2a1ab2[_0x07aa('0x3a')]=qs[_0x07aa('0x34')](_[_0x07aa('0x3b')](_0x342c61[_0x07aa('0x32')],_0x2cf8ab['filters']));if(_0x342c61[_0x07aa('0x32')][_0x07aa('0x3c')]){_0x2a1ab2[_0x07aa('0x3a')]=_[_0x07aa('0x3d')](_0x2a1ab2[_0x07aa('0x3a')],{'$or':_[_0x07aa('0x2d')](_0x2a1ab2[_0x07aa('0x36')],function(_0x1bc682){var _0x6b657={};_0x6b657[_0x1bc682]={'$like':'%'+_0x342c61[_0x07aa('0x32')][_0x07aa('0x3c')]+'%'};return _0x6b657;})});}_0x2a1ab2=_[_0x07aa('0x3d')]({},_0x2a1ab2,_0x342c61[_0x07aa('0x3e')]);return _0x512a41['getFields'](_0x2a1ab2);}})[_0x07aa('0x25')](function(_0x50b90e){if(_0x50b90e){_0x3ede76=_0x50b90e[_0x07aa('0x43')];if(!_0x342c61[_0x07aa('0x32')][_0x07aa('0x38')](_0x07aa('0x4b'))){_0x2a1ab2[_0x07aa('0x1f')]=qs[_0x07aa('0x1f')](_0x342c61['query'][_0x07aa('0x1f')]);_0x2a1ab2[_0x07aa('0x1c')]=qs[_0x07aa('0x1c')](_0x342c61[_0x07aa('0x32')][_0x07aa('0x1c')]);}return _0x512a41[_0x07aa('0x48')](_0x2a1ab2);}})['then'](function(_0x1c6c37){if(_0x1c6c37){return _0x1c6c37?{'count':_0x3ede76,'rows':_0x1c6c37}:null;}})['then'](respondWithResult(_0xb90afd,null))['catch'](handleError(_0xb90afd,null));};exports['getSubjects']=function(_0x40acc4,_0x4cec2f,_0x2f25e7){var _0x33c0b3={};var _0x3a03fd={};var _0x3a4986;var _0x48e88a;return db[_0x07aa('0x3f')]['findOne']({'where':{'id':_0x40acc4[_0x07aa('0x4c')]['id']}})[_0x07aa('0x25')](handleEntityNotFound(_0x4cec2f,null))[_0x07aa('0x25')](function(_0x4e1ca3){if(_0x4e1ca3){_0x3a4986=_0x4e1ca3;_0x3a03fd[_0x07aa('0x31')]=_['keys'](db['ZohoField'][_0x07aa('0x2e')]);_0x3a03fd[_0x07aa('0x32')]=_[_0x07aa('0x33')](_0x40acc4['query']);_0x3a03fd[_0x07aa('0x34')]=_['intersection'](_0x3a03fd['model'],_0x3a03fd[_0x07aa('0x32')]);_0x33c0b3[_0x07aa('0x36')]=_[_0x07aa('0x35')](_0x3a03fd[_0x07aa('0x31')],qs[_0x07aa('0x37')](_0x40acc4['query']['fields']));_0x33c0b3[_0x07aa('0x36')]=_0x33c0b3['attributes'][_0x07aa('0x43')]?_0x33c0b3['attributes']:_0x3a03fd[_0x07aa('0x31')];_0x33c0b3[_0x07aa('0x4d')]=qs[_0x07aa('0x39')](_0x40acc4[_0x07aa('0x32')][_0x07aa('0x39')]);_0x33c0b3[_0x07aa('0x3a')]=qs['filters'](_['pick'](_0x40acc4[_0x07aa('0x32')],_0x3a03fd[_0x07aa('0x34')]));if(_0x40acc4[_0x07aa('0x32')][_0x07aa('0x3c')]){_0x33c0b3[_0x07aa('0x3a')]=_['merge'](_0x33c0b3[_0x07aa('0x3a')],{'$or':_[_0x07aa('0x2d')](_0x33c0b3[_0x07aa('0x36')],function(_0x55cf72){var _0x2a2c78={};_0x2a2c78[_0x55cf72]={'$like':'%'+_0x40acc4[_0x07aa('0x32')]['filter']+'%'};return _0x2a2c78;})});}_0x33c0b3=_[_0x07aa('0x3d')]({},_0x33c0b3,_0x40acc4[_0x07aa('0x3e')]);return _0x3a4986[_0x07aa('0x4e')](_0x33c0b3);}})[_0x07aa('0x25')](function(_0x128bea){if(_0x128bea){_0x48e88a=_0x128bea[_0x07aa('0x43')];if(!_0x40acc4['query'][_0x07aa('0x38')](_0x07aa('0x4b'))){_0x33c0b3[_0x07aa('0x1f')]=qs[_0x07aa('0x1f')](_0x40acc4[_0x07aa('0x32')][_0x07aa('0x1f')]);_0x33c0b3[_0x07aa('0x1c')]=qs[_0x07aa('0x1c')](_0x40acc4['query'][_0x07aa('0x1c')]);}return _0x3a4986['getSubjects'](_0x33c0b3);}})[_0x07aa('0x25')](function(_0x300d91){if(_0x300d91){return _0x300d91?{'count':_0x48e88a,'rows':_0x300d91}:null;}})[_0x07aa('0x25')](respondWithResult(_0x4cec2f,null))[_0x07aa('0x45')](handleError(_0x4cec2f,null));};exports['getDescriptions']=function(_0x3d8972,_0xcccb38,_0x1132eb){var _0x1a4621={};var _0xa3d358={};var _0xaee8fd;var _0x4d53d7;return db[_0x07aa('0x3f')][_0x07aa('0x49')]({'where':{'id':_0x3d8972[_0x07aa('0x4c')]['id']}})['then'](handleEntityNotFound(_0xcccb38,null))['then'](function(_0x2656bd){if(_0x2656bd){_0xaee8fd=_0x2656bd;_0xa3d358['model']=_['keys'](db[_0x07aa('0x4a')]['rawAttributes']);_0xa3d358[_0x07aa('0x32')]=_[_0x07aa('0x33')](_0x3d8972[_0x07aa('0x32')]);_0xa3d358['filters']=_[_0x07aa('0x35')](_0xa3d358[_0x07aa('0x31')],_0xa3d358[_0x07aa('0x32')]);_0x1a4621[_0x07aa('0x36')]=_[_0x07aa('0x35')](_0xa3d358[_0x07aa('0x31')],qs['fields'](_0x3d8972[_0x07aa('0x32')][_0x07aa('0x37')]));_0x1a4621['attributes']=_0x1a4621[_0x07aa('0x36')]['length']?_0x1a4621[_0x07aa('0x36')]:_0xa3d358['model'];_0x1a4621[_0x07aa('0x4d')]=qs['sort'](_0x3d8972[_0x07aa('0x32')][_0x07aa('0x39')]);_0x1a4621[_0x07aa('0x3a')]=qs[_0x07aa('0x34')](_['pick'](_0x3d8972[_0x07aa('0x32')],_0xa3d358[_0x07aa('0x34')]));if(_0x3d8972[_0x07aa('0x32')]['filter']){_0x1a4621[_0x07aa('0x3a')]=_[_0x07aa('0x3d')](_0x1a4621[_0x07aa('0x3a')],{'$or':_[_0x07aa('0x2d')](_0x1a4621['attributes'],function(_0x28ad64){var _0x1bc900={};_0x1bc900[_0x28ad64]={'$like':'%'+_0x3d8972[_0x07aa('0x32')][_0x07aa('0x3c')]+'%'};return _0x1bc900;})});}_0x1a4621=_[_0x07aa('0x3d')]({},_0x1a4621,_0x3d8972[_0x07aa('0x3e')]);return _0xaee8fd[_0x07aa('0x4f')](_0x1a4621);}})[_0x07aa('0x25')](function(_0x1c39a9){if(_0x1c39a9){_0x4d53d7=_0x1c39a9['length'];if(!_0x3d8972['query'][_0x07aa('0x38')](_0x07aa('0x4b'))){_0x1a4621[_0x07aa('0x1f')]=qs['limit'](_0x3d8972[_0x07aa('0x32')]['limit']);_0x1a4621[_0x07aa('0x1c')]=qs[_0x07aa('0x1c')](_0x3d8972['query'][_0x07aa('0x1c')]);}return _0xaee8fd[_0x07aa('0x4f')](_0x1a4621);}})[_0x07aa('0x25')](function(_0x581d75){if(_0x581d75){return _0x581d75?{'count':_0x4d53d7,'rows':_0x581d75}:null;}})[_0x07aa('0x25')](respondWithResult(_0xcccb38,null))[_0x07aa('0x45')](handleError(_0xcccb38,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index a87365e..c0503c0 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 _0x6f17=['rimraf','../../config/environment','exports','ZohoConfiguration','int_zoho_configurations','util','../../config/logger','moment','request-promise','path'];(function(_0x12a9d5,_0x2278fd){var _0x26bc16=function(_0xcc7cc8){while(--_0xcc7cc8){_0x12a9d5['push'](_0x12a9d5['shift']());}};_0x26bc16(++_0x2278fd);}(_0x6f17,0xb9));var _0x76f1=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x6f17[_0x2235bf];return _0x4c3a64;};'use strict';var _=require('lodash');var util=require(_0x76f1('0x0'));var logger=require(_0x76f1('0x1'))('api');var moment=require(_0x76f1('0x2'));var BPromise=require('bluebird');var rp=require(_0x76f1('0x3'));var fs=require('fs');var path=require(_0x76f1('0x4'));var rimraf=require(_0x76f1('0x5'));var config=require(_0x76f1('0x6'));var attributes=require('./intZohoConfiguration.attributes');module[_0x76f1('0x7')]=function(_0x23d480,_0x2e0a29){return _0x23d480['define'](_0x76f1('0x8'),attributes,{'tableName':_0x76f1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcc7c=['exports','define','ZohoConfiguration','int_zoho_configurations','util','../../config/logger','moment','rimraf','../../config/environment'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xcc7c,0xca));var _0xccc7=function(_0x2a0f38,_0x132641){_0x2a0f38=_0x2a0f38-0x0;var _0x59e475=_0xcc7c[_0x2a0f38];return _0x59e475;};'use strict';var _=require('lodash');var util=require(_0xccc7('0x0'));var logger=require(_0xccc7('0x1'))('api');var moment=require(_0xccc7('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xccc7('0x3'));var config=require(_0xccc7('0x4'));var attributes=require('./intZohoConfiguration.attributes');module[_0xccc7('0x5')]=function(_0x4abbee,_0x2bb5a7){return _0x4abbee[_0xccc7('0x6')](_0xccc7('0x7'),attributes,{'tableName':_0xccc7('0x8'),'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 c8ef3a3..b03401d 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 _0x3ebe=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','ZohoConfiguration,\x20%s,\x20%s','message','info'];(function(_0x352a93,_0x388566){var _0x1987d1=function(_0x1e4c93){while(--_0x1e4c93){_0x352a93['push'](_0x352a93['shift']());}};_0x1987d1(++_0x388566);}(_0x3ebe,0x73));var _0xe3eb=function(_0x33a3d3,_0xf84a04){_0x33a3d3=_0x33a3d3-0x0;var _0x4ae7db=_0x3ebe[_0x33a3d3];return _0x4ae7db;};'use strict';var _=require(_0xe3eb('0x0'));var util=require(_0xe3eb('0x1'));var moment=require(_0xe3eb('0x2'));var BPromise=require(_0xe3eb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe3eb('0x4'));var db=require(_0xe3eb('0x5'))['db'];var utils=require(_0xe3eb('0x6'));var logger=require(_0xe3eb('0x7'))(_0xe3eb('0x8'));var config=require('../../config/environment');var jayson=require(_0xe3eb('0x9'));var client=jayson[_0xe3eb('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x242976,_0x154505,_0x2b7c05){return new BPromise(function(_0x18fbb8,_0x3ffe12){return client['request'](_0x242976,_0x2b7c05)[_0xe3eb('0xb')](function(_0x2331f7){logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x154505,'request\x20sent');logger['debug'](_0xe3eb('0xc'),_0x154505,'request\x20sent',JSON[_0xe3eb('0xd')](_0x2331f7));if(_0x2331f7[_0xe3eb('0xe')]){if(_0x2331f7[_0xe3eb('0xe')]['code']===0x1f4){logger['error'](_0xe3eb('0xf'),_0x154505,_0x2331f7['error'][_0xe3eb('0x10')]);return _0x3ffe12(_0x2331f7[_0xe3eb('0xe')][_0xe3eb('0x10')]);}logger[_0xe3eb('0xe')](_0xe3eb('0xf'),_0x154505,_0x2331f7['error'][_0xe3eb('0x10')]);return _0x18fbb8(_0x2331f7[_0xe3eb('0xe')][_0xe3eb('0x10')]);}else{logger[_0xe3eb('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x154505,'request\x20sent');_0x18fbb8(_0x2331f7['result'][_0xe3eb('0x10')]);}})[_0xe3eb('0x12')](function(_0x4bd66d){logger[_0xe3eb('0xe')](_0xe3eb('0xf'),_0x154505,_0x4bd66d);_0x3ffe12(_0x4bd66d);});});} \ No newline at end of file +var _0xefaf=['ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x1e3671,_0x9ae4fc){var _0x48d5f5=function(_0xfab713){while(--_0xfab713){_0x1e3671['push'](_0x1e3671['shift']());}};_0x48d5f5(++_0x9ae4fc);}(_0xefaf,0x1c2));var _0xfefa=function(_0x100e36,_0x4da225){_0x100e36=_0x100e36-0x0;var _0x1df0c9=_0xefaf[_0x100e36];return _0x1df0c9;};'use strict';var _=require(_0xfefa('0x0'));var util=require(_0xfefa('0x1'));var moment=require(_0xfefa('0x2'));var BPromise=require('bluebird');var rs=require(_0xfefa('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfefa('0x4'));var logger=require('../../config/logger')(_0xfefa('0x5'));var config=require(_0xfefa('0x6'));var jayson=require(_0xfefa('0x7'));var client=jayson[_0xfefa('0x8')][_0xfefa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22a052,_0x640746,_0x295c0a){return new BPromise(function(_0x10f20a,_0x49a6d4){return client['request'](_0x22a052,_0x295c0a)[_0xfefa('0xa')](function(_0x36c583){logger[_0xfefa('0xb')](_0xfefa('0xc'),_0x640746,'request\x20sent');logger[_0xfefa('0xd')](_0xfefa('0xe'),_0x640746,_0xfefa('0xf'),JSON[_0xfefa('0x10')](_0x36c583));if(_0x36c583[_0xfefa('0x11')]){if(_0x36c583[_0xfefa('0x11')][_0xfefa('0x12')]===0x1f4){logger[_0xfefa('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x640746,_0x36c583[_0xfefa('0x11')][_0xfefa('0x13')]);return _0x49a6d4(_0x36c583['error']['message']);}logger[_0xfefa('0x11')](_0xfefa('0xc'),_0x640746,_0x36c583['error']['message']);return _0x10f20a(_0x36c583['error'][_0xfefa('0x13')]);}else{logger[_0xfefa('0xb')]('ZohoConfiguration,\x20%s,\x20%s',_0x640746,_0xfefa('0xf'));_0x10f20a(_0x36c583[_0xfefa('0x14')][_0xfefa('0x13')]);}})[_0xfefa('0x15')](function(_0x27bd3d){logger[_0xfefa('0x11')](_0xfefa('0xc'),_0x640746,_0x27bd3d);_0x49a6d4(_0x27bd3d);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 7ce0f61..79ffaa9 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 _0xd478=['post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/:id'];(function(_0x2d28eb,_0x3e9879){var _0x352a36=function(_0x2304e2){while(--_0x2304e2){_0x2d28eb['push'](_0x2d28eb['shift']());}};_0x352a36(++_0x3e9879);}(_0xd478,0xde));var _0x8d47=function(_0x576710,_0x2766d0){_0x576710=_0x576710-0x0;var _0x792aaa=_0xd478[_0x576710];return _0x792aaa;};'use strict';var multer=require(_0x8d47('0x0'));var util=require(_0x8d47('0x1'));var path=require(_0x8d47('0x2'));var timeout=require(_0x8d47('0x3'));var express=require(_0x8d47('0x4'));var router=express[_0x8d47('0x5')]();var fs_extra=require(_0x8d47('0x6'));var auth=require(_0x8d47('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intZohoField.controller');router[_0x8d47('0x8')]('/',auth[_0x8d47('0x9')](),controller[_0x8d47('0xa')]);router[_0x8d47('0x8')](_0x8d47('0xb'),auth[_0x8d47('0x9')](),controller['show']);router[_0x8d47('0xc')]('/',auth['isAuthenticated'](),controller[_0x8d47('0xd')]);router[_0x8d47('0xe')](_0x8d47('0xb'),auth[_0x8d47('0x9')](),controller[_0x8d47('0xf')]);router[_0x8d47('0x10')](_0x8d47('0xb'),auth['isAuthenticated'](),controller[_0x8d47('0x11')]);module['exports']=router; \ No newline at end of file +var _0xa756=['index','/:id','show','create','put','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoField.controller','get','isAuthenticated'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0xa756,0x117));var _0x6a75=function(_0x3e4ccf,_0x263017){_0x3e4ccf=_0x3e4ccf-0x0;var _0x25d931=_0xa756[_0x3e4ccf];return _0x25d931;};'use strict';var multer=require('multer');var util=require(_0x6a75('0x0'));var path=require(_0x6a75('0x1'));var timeout=require('connect-timeout');var express=require(_0x6a75('0x2'));var router=express[_0x6a75('0x3')]();var fs_extra=require(_0x6a75('0x4'));var auth=require(_0x6a75('0x5'));var interaction=require(_0x6a75('0x6'));var config=require('../../config/environment');var controller=require(_0x6a75('0x7'));router[_0x6a75('0x8')]('/',auth[_0x6a75('0x9')](),controller[_0x6a75('0xa')]);router[_0x6a75('0x8')](_0x6a75('0xb'),auth['isAuthenticated'](),controller[_0x6a75('0xc')]);router['post']('/',auth[_0x6a75('0x9')](),controller[_0x6a75('0xd')]);router[_0x6a75('0xe')]('/:id',auth[_0x6a75('0x9')](),controller['update']);router[_0x6a75('0xf')](_0x6a75('0xb'),auth[_0x6a75('0x9')](),controller[_0x6a75('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index a2e6eb3..67e9648 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 _0xbf7a=['BOOLEAN','sequelize','ENUM','string','variable','keyValue','STRING'];(function(_0x230781,_0x38df65){var _0x2cac1d=function(_0x480863){while(--_0x480863){_0x230781['push'](_0x230781['shift']());}};_0x2cac1d(++_0x38df65);}(_0xbf7a,0x8d));var _0xabf7=function(_0xda0820,_0x4790a3){_0xda0820=_0xda0820-0x0;var _0x21bc93=_0xbf7a[_0xda0820];return _0x21bc93;};'use strict';var Sequelize=require(_0xabf7('0x0'));module['exports']={'type':{'type':Sequelize[_0xabf7('0x1')](_0xabf7('0x2'),_0xabf7('0x3'),'customVariable',_0xabf7('0x4'),'picklist'),'defaultValue':_0xabf7('0x2')},'content':{'type':Sequelize[_0xabf7('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xabf7('0x1')](_0xabf7('0x2'),_0xabf7('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xabf7('0x5')]},'idField':{'type':Sequelize[_0xabf7('0x5')]},'nameField':{'type':Sequelize[_0xabf7('0x5')]},'customField':{'type':Sequelize[_0xabf7('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xabf7('0x5')]}}; \ No newline at end of file +var _0xf3d5=['keyValue','picklist','STRING','ENUM','variable','BOOLEAN','sequelize','string','customVariable'];(function(_0x541f1e,_0x3f7aba){var _0x293f44=function(_0x3b0193){while(--_0x3b0193){_0x541f1e['push'](_0x541f1e['shift']());}};_0x293f44(++_0x3f7aba);}(_0xf3d5,0x11d));var _0x5f3d=function(_0x48c1d2,_0x48b40){_0x48c1d2=_0x48c1d2-0x0;var _0x167819=_0xf3d5[_0x48c1d2];return _0x167819;};'use strict';var Sequelize=require(_0x5f3d('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x5f3d('0x1'),'variable',_0x5f3d('0x2'),_0x5f3d('0x3'),_0x5f3d('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x5f3d('0x5')]},'key':{'type':Sequelize[_0x5f3d('0x5')]},'keyType':{'type':Sequelize[_0x5f3d('0x6')](_0x5f3d('0x1'),_0x5f3d('0x7'),_0x5f3d('0x2'))},'keyContent':{'type':Sequelize[_0x5f3d('0x5')]},'idField':{'type':Sequelize[_0x5f3d('0x5')]},'nameField':{'type':Sequelize[_0x5f3d('0x5')]},'customField':{'type':Sequelize[_0x5f3d('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5f3d('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index aa29d4d..0012444 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 _0xeaf8=['index','map','ZohoField','rawAttributes','fieldName','type','model','filters','intersection','query','attributes','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','includeAll','merge','create','body','find','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','update','then','destroy','error','name','send'];(function(_0x29eb0e,_0xce3a29){var _0x2ffe24=function(_0x27b84c){while(--_0x27b84c){_0x29eb0e['push'](_0x29eb0e['shift']());}};_0x2ffe24(++_0xce3a29);}(_0xeaf8,0x192));var _0x8eaf=function(_0x1cbe5e,_0x234e93){_0x1cbe5e=_0x1cbe5e-0x0;var _0x35630d=_0xeaf8[_0x1cbe5e];return _0x35630d;};'use strict';var emlformat=require(_0x8eaf('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8eaf('0x1'));var rp=require(_0x8eaf('0x2'));var moment=require(_0x8eaf('0x3'));var BPromise=require(_0x8eaf('0x4'));var Mustache=require(_0x8eaf('0x5'));var util=require(_0x8eaf('0x6'));var path=require('path');var sox=require(_0x8eaf('0x7'));var csv=require(_0x8eaf('0x8'));var ejs=require(_0x8eaf('0x9'));var fs=require('fs');var fs_extra=require(_0x8eaf('0xa'));var _=require(_0x8eaf('0xb'));var squel=require(_0x8eaf('0xc'));var crypto=require(_0x8eaf('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8eaf('0x8'));var querystring=require(_0x8eaf('0xe'));var Papa=require(_0x8eaf('0xf'));var Redis=require(_0x8eaf('0x10'));var authService=require(_0x8eaf('0x11'));var qs=require(_0x8eaf('0x12'));var as=require(_0x8eaf('0x13'));var hardwareService=require(_0x8eaf('0x14'));var logger=require(_0x8eaf('0x15'))(_0x8eaf('0x16'));var utils=require(_0x8eaf('0x17'));var config=require(_0x8eaf('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x8eaf('0x19'))['db'];function respondWithStatusCode(_0x1a8198,_0x2997ca){_0x2997ca=_0x2997ca||0xcc;return function(_0x1e6718){if(_0x1e6718){return _0x1a8198[_0x8eaf('0x1a')](_0x2997ca);}return _0x1a8198[_0x8eaf('0x1b')](_0x2997ca)[_0x8eaf('0x1c')]();};}function respondWithResult(_0x17bce9,_0x3d20dd){_0x3d20dd=_0x3d20dd||0xc8;return function(_0x3016de){if(_0x3016de){return _0x17bce9[_0x8eaf('0x1b')](_0x3d20dd)['json'](_0x3016de);}};}function respondWithFilteredResult(_0xcd1a26,_0xe5e865){return function(_0x1901da){if(_0x1901da){var _0x15a5c1=typeof _0xe5e865[_0x8eaf('0x1d')]===_0x8eaf('0x1e')&&typeof _0xe5e865[_0x8eaf('0x1f')]===_0x8eaf('0x1e');var _0x2127c7=_0x1901da[_0x8eaf('0x20')];var _0x2f1678=_0x15a5c1?0x0:_0xe5e865[_0x8eaf('0x1d')];var _0x5c1261=_0x15a5c1?_0x1901da[_0x8eaf('0x20')]:_0xe5e865[_0x8eaf('0x1d')]+_0xe5e865['limit'];var _0x5492f2;if(_0x5c1261>=_0x2127c7){_0x5c1261=_0x2127c7;_0x5492f2=0xc8;}else{_0x5492f2=0xce;}_0xcd1a26[_0x8eaf('0x1b')](_0x5492f2);return _0xcd1a26['set'](_0x8eaf('0x21'),_0x2f1678+'-'+_0x5c1261+'/'+_0x2127c7)[_0x8eaf('0x22')](_0x1901da);}return null;};}function patchUpdates(_0x57d9d0){return function(_0x54dffc){try{jsonpatch[_0x8eaf('0x23')](_0x54dffc,_0x57d9d0,!![]);}catch(_0x4fa48d){return BPromise['reject'](_0x4fa48d);}return _0x54dffc['save']();};}function saveUpdates(_0x15bc03,_0xe90c46){return function(_0x2dedde){if(_0x2dedde){return _0x2dedde[_0x8eaf('0x24')](_0x15bc03)[_0x8eaf('0x25')](function(_0x246a52){return _0x246a52;});}return null;};}function removeEntity(_0x50dcc2,_0x1dbd98){return function(_0x587722){if(_0x587722){return _0x587722[_0x8eaf('0x26')]()[_0x8eaf('0x25')](function(){_0x50dcc2['status'](0xcc)[_0x8eaf('0x1c')]();});}};}function handleEntityNotFound(_0x4b3e01,_0x314cda){return function(_0x170582){if(!_0x170582){_0x4b3e01['sendStatus'](0x194);}return _0x170582;};}function handleError(_0x1872d0,_0x3086d5){_0x3086d5=_0x3086d5||0x1f4;return function(_0x4c83c0){logger[_0x8eaf('0x27')](_0x4c83c0['stack']);if(_0x4c83c0['name']){delete _0x4c83c0[_0x8eaf('0x28')];}_0x1872d0[_0x8eaf('0x1b')](_0x3086d5)[_0x8eaf('0x29')](_0x4c83c0);};}exports[_0x8eaf('0x2a')]=function(_0xcb1e2f,_0x382da0){var _0x277b23={},_0x45cd39={},_0x14b073={'count':0x0,'rows':[]};var _0x428af0=_[_0x8eaf('0x2b')](db[_0x8eaf('0x2c')][_0x8eaf('0x2d')],function(_0x5c95c0){return{'name':_0x5c95c0[_0x8eaf('0x2e')],'type':_0x5c95c0[_0x8eaf('0x2f')]['key']};});_0x45cd39[_0x8eaf('0x30')]=_['map'](_0x428af0,_0x8eaf('0x28'));_0x45cd39['query']=_['keys'](_0xcb1e2f['query']);_0x45cd39[_0x8eaf('0x31')]=_[_0x8eaf('0x32')](_0x45cd39[_0x8eaf('0x30')],_0x45cd39[_0x8eaf('0x33')]);_0x277b23[_0x8eaf('0x34')]=_[_0x8eaf('0x32')](_0x45cd39['model'],qs[_0x8eaf('0x35')](_0xcb1e2f[_0x8eaf('0x33')][_0x8eaf('0x35')]));_0x277b23[_0x8eaf('0x34')]=_0x277b23[_0x8eaf('0x34')][_0x8eaf('0x36')]?_0x277b23[_0x8eaf('0x34')]:_0x45cd39[_0x8eaf('0x30')];if(!_0xcb1e2f[_0x8eaf('0x33')]['hasOwnProperty'](_0x8eaf('0x37'))){_0x277b23['limit']=qs[_0x8eaf('0x1f')](_0xcb1e2f[_0x8eaf('0x33')][_0x8eaf('0x1f')]);_0x277b23[_0x8eaf('0x1d')]=qs[_0x8eaf('0x1d')](_0xcb1e2f['query'][_0x8eaf('0x1d')]);}_0x277b23['order']=qs[_0x8eaf('0x38')](_0xcb1e2f[_0x8eaf('0x33')][_0x8eaf('0x38')]);_0x277b23[_0x8eaf('0x39')]=qs['filters'](_[_0x8eaf('0x3a')](_0xcb1e2f['query'],_0x45cd39[_0x8eaf('0x31')]),_0x428af0);if(_0xcb1e2f[_0x8eaf('0x33')][_0x8eaf('0x3b')]){_0x277b23[_0x8eaf('0x39')]=_['merge'](_0x277b23[_0x8eaf('0x39')],{'$or':_[_0x8eaf('0x2b')](_0x428af0,function(_0x2ee6f2){if(_0x2ee6f2[_0x8eaf('0x2f')]!==_0x8eaf('0x3c')){var _0x235bd8={};_0x235bd8[_0x2ee6f2['name']]={'$like':'%'+_0xcb1e2f[_0x8eaf('0x33')][_0x8eaf('0x3b')]+'%'};return _0x235bd8;}})});}_0x277b23=_['merge']({},_0x277b23,_0xcb1e2f[_0x8eaf('0x3d')]);var _0x3d426c={'where':_0x277b23['where']};return db['ZohoField']['count'](_0x3d426c)[_0x8eaf('0x25')](function(_0x1ddcac){_0x14b073[_0x8eaf('0x20')]=_0x1ddcac;if(_0xcb1e2f[_0x8eaf('0x33')]['includeAll']){_0x277b23[_0x8eaf('0x3e')]=[{'all':!![]}];}return db['ZohoField'][_0x8eaf('0x3f')](_0x277b23);})['then'](function(_0x10283d){_0x14b073[_0x8eaf('0x40')]=_0x10283d;return _0x14b073;})[_0x8eaf('0x25')](respondWithFilteredResult(_0x382da0,_0x277b23))[_0x8eaf('0x41')](handleError(_0x382da0,null));};exports[_0x8eaf('0x42')]=function(_0x2f8d9e,_0x1a5ddb){var _0xd85618={'raw':!![],'where':{'id':_0x2f8d9e[_0x8eaf('0x43')]['id']}},_0x37ce5e={};_0x37ce5e['model']=_[_0x8eaf('0x44')](db[_0x8eaf('0x2c')][_0x8eaf('0x2d')]);_0x37ce5e[_0x8eaf('0x33')]=_['keys'](_0x2f8d9e['query']);_0x37ce5e[_0x8eaf('0x31')]=_['intersection'](_0x37ce5e[_0x8eaf('0x30')],_0x37ce5e['query']);_0xd85618[_0x8eaf('0x34')]=_['intersection'](_0x37ce5e[_0x8eaf('0x30')],qs[_0x8eaf('0x35')](_0x2f8d9e[_0x8eaf('0x33')]['fields']));_0xd85618['attributes']=_0xd85618['attributes'][_0x8eaf('0x36')]?_0xd85618[_0x8eaf('0x34')]:_0x37ce5e['model'];if(_0x2f8d9e[_0x8eaf('0x33')][_0x8eaf('0x45')]){_0xd85618[_0x8eaf('0x3e')]=[{'all':!![]}];}_0xd85618=_[_0x8eaf('0x46')]({},_0xd85618,_0x2f8d9e[_0x8eaf('0x3d')]);return db[_0x8eaf('0x2c')]['find'](_0xd85618)[_0x8eaf('0x25')](handleEntityNotFound(_0x1a5ddb,null))[_0x8eaf('0x25')](respondWithResult(_0x1a5ddb,null))[_0x8eaf('0x41')](handleError(_0x1a5ddb,null));};exports[_0x8eaf('0x47')]=function(_0xd101b7,_0x4ecca0){return db[_0x8eaf('0x2c')]['create'](_0xd101b7['body'],{})[_0x8eaf('0x25')](respondWithResult(_0x4ecca0,0xc9))[_0x8eaf('0x41')](handleError(_0x4ecca0,null));};exports[_0x8eaf('0x24')]=function(_0x43c06d,_0x2bd664){if(_0x43c06d['body']['id']){delete _0x43c06d[_0x8eaf('0x48')]['id'];}return db['ZohoField'][_0x8eaf('0x49')]({'where':{'id':_0x43c06d[_0x8eaf('0x43')]['id']}})[_0x8eaf('0x25')](handleEntityNotFound(_0x2bd664,null))[_0x8eaf('0x25')](saveUpdates(_0x43c06d['body'],null))['then'](respondWithResult(_0x2bd664,null))[_0x8eaf('0x41')](handleError(_0x2bd664,null));};exports[_0x8eaf('0x26')]=function(_0x340a32,_0x21afd9){return db[_0x8eaf('0x2c')][_0x8eaf('0x49')]({'where':{'id':_0x340a32['params']['id']}})[_0x8eaf('0x25')](handleEntityNotFound(_0x21afd9,null))[_0x8eaf('0x25')](removeEntity(_0x21afd9,null))[_0x8eaf('0x41')](handleError(_0x21afd9,null));}; \ No newline at end of file +var _0x2326=['update','then','end','error','stack','send','index','ZohoField','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','VIRTUAL','name','merge','options','includeAll','params','length','include','find','catch','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply'];(function(_0x5bed06,_0x3795e9){var _0xea6b65=function(_0x5acc62){while(--_0x5acc62){_0x5bed06['push'](_0x5bed06['shift']());}};_0xea6b65(++_0x3795e9);}(_0x2326,0xbc));var _0x6232=function(_0x4f7e7c,_0xbf37ca){_0x4f7e7c=_0x4f7e7c-0x0;var _0x4d91d5=_0x2326[_0x4f7e7c];return _0x4d91d5;};'use strict';var emlformat=require(_0x6232('0x0'));var rimraf=require(_0x6232('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6232('0x2'));var rp=require(_0x6232('0x3'));var moment=require(_0x6232('0x4'));var BPromise=require(_0x6232('0x5'));var Mustache=require(_0x6232('0x6'));var util=require(_0x6232('0x7'));var path=require(_0x6232('0x8'));var sox=require(_0x6232('0x9'));var csv=require('to-csv');var ejs=require(_0x6232('0xa'));var fs=require('fs');var fs_extra=require(_0x6232('0xb'));var _=require(_0x6232('0xc'));var squel=require(_0x6232('0xd'));var crypto=require(_0x6232('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6232('0xf'));var querystring=require(_0x6232('0x10'));var Papa=require(_0x6232('0x11'));var Redis=require(_0x6232('0x12'));var authService=require(_0x6232('0x13'));var qs=require(_0x6232('0x14'));var as=require(_0x6232('0x15'));var hardwareService=require(_0x6232('0x16'));var logger=require(_0x6232('0x17'))(_0x6232('0x18'));var utils=require('../../config/utils');var config=require(_0x6232('0x19'));var licenseUtil=require(_0x6232('0x1a'));var db=require(_0x6232('0x1b'))['db'];function respondWithStatusCode(_0x258527,_0x176a8b){_0x176a8b=_0x176a8b||0xcc;return function(_0x35af40){if(_0x35af40){return _0x258527[_0x6232('0x1c')](_0x176a8b);}return _0x258527[_0x6232('0x1d')](_0x176a8b)['end']();};}function respondWithResult(_0x31b0e6,_0x5d0425){_0x5d0425=_0x5d0425||0xc8;return function(_0x162b3b){if(_0x162b3b){return _0x31b0e6['status'](_0x5d0425)[_0x6232('0x1e')](_0x162b3b);}};}function respondWithFilteredResult(_0x390c82,_0x14159a){return function(_0x19560d){if(_0x19560d){var _0x4b297f=typeof _0x14159a[_0x6232('0x1f')]==='undefined'&&typeof _0x14159a[_0x6232('0x20')]===_0x6232('0x21');var _0x2a1e54=_0x19560d[_0x6232('0x22')];var _0x5cd4c4=_0x4b297f?0x0:_0x14159a[_0x6232('0x1f')];var _0x45e872=_0x4b297f?_0x19560d[_0x6232('0x22')]:_0x14159a['offset']+_0x14159a[_0x6232('0x20')];var _0x3e381f;if(_0x45e872>=_0x2a1e54){_0x45e872=_0x2a1e54;_0x3e381f=0xc8;}else{_0x3e381f=0xce;}_0x390c82[_0x6232('0x1d')](_0x3e381f);return _0x390c82['set'](_0x6232('0x23'),_0x5cd4c4+'-'+_0x45e872+'/'+_0x2a1e54)[_0x6232('0x1e')](_0x19560d);}return null;};}function patchUpdates(_0x3a7920){return function(_0x15721c){try{jsonpatch[_0x6232('0x24')](_0x15721c,_0x3a7920,!![]);}catch(_0x13614c){return BPromise['reject'](_0x13614c);}return _0x15721c['save']();};}function saveUpdates(_0x249484,_0x30682f){return function(_0x4941ac){if(_0x4941ac){return _0x4941ac[_0x6232('0x25')](_0x249484)[_0x6232('0x26')](function(_0x25a06c){return _0x25a06c;});}return null;};}function removeEntity(_0x51a233,_0x2bff45){return function(_0x39ca07){if(_0x39ca07){return _0x39ca07['destroy']()['then'](function(){_0x51a233['status'](0xcc)[_0x6232('0x27')]();});}};}function handleEntityNotFound(_0x4f2b3e,_0x337de8){return function(_0x23444b){if(!_0x23444b){_0x4f2b3e[_0x6232('0x1c')](0x194);}return _0x23444b;};}function handleError(_0x3ae2a6,_0x5d5792){_0x5d5792=_0x5d5792||0x1f4;return function(_0x703f8a){logger[_0x6232('0x28')](_0x703f8a[_0x6232('0x29')]);if(_0x703f8a['name']){delete _0x703f8a['name'];}_0x3ae2a6[_0x6232('0x1d')](_0x5d5792)[_0x6232('0x2a')](_0x703f8a);};}exports[_0x6232('0x2b')]=function(_0x2eaec4,_0x3ad11b){var _0x5a7cd6={},_0x51e09c={},_0x4a5abb={'count':0x0,'rows':[]};var _0x473940=_['map'](db[_0x6232('0x2c')][_0x6232('0x2d')],function(_0x27a272){return{'name':_0x27a272[_0x6232('0x2e')],'type':_0x27a272[_0x6232('0x2f')][_0x6232('0x30')]};});_0x51e09c[_0x6232('0x31')]=_[_0x6232('0x32')](_0x473940,'name');_0x51e09c[_0x6232('0x33')]=_[_0x6232('0x34')](_0x2eaec4[_0x6232('0x33')]);_0x51e09c[_0x6232('0x35')]=_[_0x6232('0x36')](_0x51e09c[_0x6232('0x31')],_0x51e09c[_0x6232('0x33')]);_0x5a7cd6['attributes']=_[_0x6232('0x36')](_0x51e09c['model'],qs[_0x6232('0x37')](_0x2eaec4[_0x6232('0x33')][_0x6232('0x37')]));_0x5a7cd6[_0x6232('0x38')]=_0x5a7cd6[_0x6232('0x38')]['length']?_0x5a7cd6[_0x6232('0x38')]:_0x51e09c['model'];if(!_0x2eaec4['query']['hasOwnProperty'](_0x6232('0x39'))){_0x5a7cd6[_0x6232('0x20')]=qs[_0x6232('0x20')](_0x2eaec4[_0x6232('0x33')][_0x6232('0x20')]);_0x5a7cd6[_0x6232('0x1f')]=qs[_0x6232('0x1f')](_0x2eaec4[_0x6232('0x33')][_0x6232('0x1f')]);}_0x5a7cd6[_0x6232('0x3a')]=qs['sort'](_0x2eaec4[_0x6232('0x33')][_0x6232('0x3b')]);_0x5a7cd6[_0x6232('0x3c')]=qs[_0x6232('0x35')](_[_0x6232('0x3d')](_0x2eaec4[_0x6232('0x33')],_0x51e09c['filters']),_0x473940);if(_0x2eaec4['query'][_0x6232('0x3e')]){_0x5a7cd6['where']=_['merge'](_0x5a7cd6[_0x6232('0x3c')],{'$or':_[_0x6232('0x32')](_0x473940,function(_0x1781bd){if(_0x1781bd[_0x6232('0x2f')]!==_0x6232('0x3f')){var _0x26935e={};_0x26935e[_0x1781bd[_0x6232('0x40')]]={'$like':'%'+_0x2eaec4[_0x6232('0x33')][_0x6232('0x3e')]+'%'};return _0x26935e;}})});}_0x5a7cd6=_[_0x6232('0x41')]({},_0x5a7cd6,_0x2eaec4[_0x6232('0x42')]);var _0xb95e44={'where':_0x5a7cd6[_0x6232('0x3c')]};return db[_0x6232('0x2c')]['count'](_0xb95e44)[_0x6232('0x26')](function(_0x1912e1){_0x4a5abb[_0x6232('0x22')]=_0x1912e1;if(_0x2eaec4['query'][_0x6232('0x43')]){_0x5a7cd6['include']=[{'all':!![]}];}return db[_0x6232('0x2c')]['findAll'](_0x5a7cd6);})[_0x6232('0x26')](function(_0x40a30e){_0x4a5abb['rows']=_0x40a30e;return _0x4a5abb;})['then'](respondWithFilteredResult(_0x3ad11b,_0x5a7cd6))['catch'](handleError(_0x3ad11b,null));};exports['show']=function(_0x5c5bcf,_0x2b6ef6){var _0x330494={'raw':!![],'where':{'id':_0x5c5bcf[_0x6232('0x44')]['id']}},_0x4ff7ae={};_0x4ff7ae[_0x6232('0x31')]=_['keys'](db[_0x6232('0x2c')][_0x6232('0x2d')]);_0x4ff7ae['query']=_[_0x6232('0x34')](_0x5c5bcf[_0x6232('0x33')]);_0x4ff7ae[_0x6232('0x35')]=_['intersection'](_0x4ff7ae['model'],_0x4ff7ae['query']);_0x330494[_0x6232('0x38')]=_[_0x6232('0x36')](_0x4ff7ae['model'],qs[_0x6232('0x37')](_0x5c5bcf[_0x6232('0x33')][_0x6232('0x37')]));_0x330494[_0x6232('0x38')]=_0x330494[_0x6232('0x38')][_0x6232('0x45')]?_0x330494[_0x6232('0x38')]:_0x4ff7ae['model'];if(_0x5c5bcf['query'][_0x6232('0x43')]){_0x330494[_0x6232('0x46')]=[{'all':!![]}];}_0x330494=_[_0x6232('0x41')]({},_0x330494,_0x5c5bcf[_0x6232('0x42')]);return db[_0x6232('0x2c')][_0x6232('0x47')](_0x330494)[_0x6232('0x26')](handleEntityNotFound(_0x2b6ef6,null))[_0x6232('0x26')](respondWithResult(_0x2b6ef6,null))[_0x6232('0x48')](handleError(_0x2b6ef6,null));};exports['create']=function(_0x3dbac6,_0xfed140){return db[_0x6232('0x2c')]['create'](_0x3dbac6[_0x6232('0x49')],{})[_0x6232('0x26')](respondWithResult(_0xfed140,0xc9))[_0x6232('0x48')](handleError(_0xfed140,null));};exports[_0x6232('0x25')]=function(_0x54a9ba,_0x13e395){if(_0x54a9ba[_0x6232('0x49')]['id']){delete _0x54a9ba['body']['id'];}return db[_0x6232('0x2c')][_0x6232('0x47')]({'where':{'id':_0x54a9ba['params']['id']}})['then'](handleEntityNotFound(_0x13e395,null))[_0x6232('0x26')](saveUpdates(_0x54a9ba[_0x6232('0x49')],null))['then'](respondWithResult(_0x13e395,null))['catch'](handleError(_0x13e395,null));};exports[_0x6232('0x4a')]=function(_0x64fee8,_0x3e76f9){return db['ZohoField']['find']({'where':{'id':_0x64fee8['params']['id']}})[_0x6232('0x26')](handleEntityNotFound(_0x3e76f9,null))[_0x6232('0x26')](removeEntity(_0x3e76f9,null))['catch'](handleError(_0x3e76f9,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 0a73301..cb8b1f3 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 _0xc2c7=['bluebird','request-promise','path','rimraf','exports','zoho_unique_index','idField','FieldId','util','../../config/logger','api','moment'];(function(_0x6dfbaa,_0x31eede){var _0xfbe02=function(_0x4adcaf){while(--_0x4adcaf){_0x6dfbaa['push'](_0x6dfbaa['shift']());}};_0xfbe02(++_0x31eede);}(_0xc2c7,0x134));var _0x7c2c=function(_0x14cdbc,_0x7c8e6f){_0x14cdbc=_0x14cdbc-0x0;var _0xa19c77=_0xc2c7[_0x14cdbc];return _0xa19c77;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var logger=require(_0x7c2c('0x1'))(_0x7c2c('0x2'));var moment=require(_0x7c2c('0x3'));var BPromise=require(_0x7c2c('0x4'));var rp=require(_0x7c2c('0x5'));var fs=require('fs');var path=require(_0x7c2c('0x6'));var rimraf=require(_0x7c2c('0x7'));var config=require('../../config/environment');var attributes=require('./intZohoField.attributes');module[_0x7c2c('0x8')]=function(_0x42ecc9,_0x23c038){return _0x42ecc9['define']('ZohoField',attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x7c2c('0x9'),'fields':[_0x7c2c('0xa'),_0x7c2c('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6d11=['exports','define','ZohoField','int_zoho_fields','lodash','util','../../config/logger','moment','request-promise','path','./intZohoField.attributes'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x6d11,0xbf));var _0x16d1=function(_0x37a042,_0x2c307a){_0x37a042=_0x37a042-0x0;var _0x19a727=_0x6d11[_0x37a042];return _0x19a727;};'use strict';var _=require(_0x16d1('0x0'));var util=require(_0x16d1('0x1'));var logger=require(_0x16d1('0x2'))('api');var moment=require(_0x16d1('0x3'));var BPromise=require('bluebird');var rp=require(_0x16d1('0x4'));var fs=require('fs');var path=require(_0x16d1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x16d1('0x6'));module[_0x16d1('0x7')]=function(_0x3eb9e2,_0x38626d){return _0x3eb9e2[_0x16d1('0x8')](_0x16d1('0x9'),attributes,{'tableName':_0x16d1('0xa'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':['idField','FieldId'],'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 4d1985e..f15bec8 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 _0x1d9d=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4c5a24,_0x5ef60c){var _0x4b067e=function(_0x33c0da){while(--_0x33c0da){_0x4c5a24['push'](_0x4c5a24['shift']());}};_0x4b067e(++_0x5ef60c);}(_0x1d9d,0x124));var _0xd1d9=function(_0x2b4b67,_0x200a1b){_0x2b4b67=_0x2b4b67-0x0;var _0x4c0baf=_0x1d9d[_0x2b4b67];return _0x4c0baf;};'use strict';var _=require(_0xd1d9('0x0'));var util=require(_0xd1d9('0x1'));var moment=require(_0xd1d9('0x2'));var BPromise=require(_0xd1d9('0x3'));var rs=require(_0xd1d9('0x4'));var fs=require('fs');var Redis=require(_0xd1d9('0x5'));var db=require(_0xd1d9('0x6'))['db'];var utils=require(_0xd1d9('0x7'));var logger=require(_0xd1d9('0x8'))(_0xd1d9('0x9'));var config=require(_0xd1d9('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x540276,_0xc9020d,_0x146113){return new BPromise(function(_0x5179d3,_0xe506da){return client[_0xd1d9('0xb')](_0x540276,_0x146113)[_0xd1d9('0xc')](function(_0x101283){logger[_0xd1d9('0xd')](_0xd1d9('0xe'),_0xc9020d,_0xd1d9('0xf'));logger[_0xd1d9('0x10')](_0xd1d9('0x11'),_0xc9020d,'request\x20sent',JSON[_0xd1d9('0x12')](_0x101283));if(_0x101283[_0xd1d9('0x13')]){if(_0x101283[_0xd1d9('0x13')][_0xd1d9('0x14')]===0x1f4){logger[_0xd1d9('0x13')](_0xd1d9('0xe'),_0xc9020d,_0x101283['error'][_0xd1d9('0x15')]);return _0xe506da(_0x101283[_0xd1d9('0x13')][_0xd1d9('0x15')]);}logger[_0xd1d9('0x13')](_0xd1d9('0xe'),_0xc9020d,_0x101283[_0xd1d9('0x13')][_0xd1d9('0x15')]);return _0x5179d3(_0x101283[_0xd1d9('0x13')][_0xd1d9('0x15')]);}else{logger['info'](_0xd1d9('0xe'),_0xc9020d,'request\x20sent');_0x5179d3(_0x101283[_0xd1d9('0x16')][_0xd1d9('0x15')]);}})[_0xd1d9('0x17')](function(_0x31fd93){logger['error'](_0xd1d9('0xe'),_0xc9020d,_0x31fd93);_0xe506da(_0x31fd93);});});} \ No newline at end of file +var _0x9f21=['ZohoField,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','ZohoField,\x20%s,\x20%s','request\x20sent'];(function(_0x368244,_0x183e0b){var _0x1933c6=function(_0x4cfa0e){while(--_0x4cfa0e){_0x368244['push'](_0x368244['shift']());}};_0x1933c6(++_0x183e0b);}(_0x9f21,0xdc));var _0x19f2=function(_0x1a32fe,_0xdab6ac){_0x1a32fe=_0x1a32fe-0x0;var _0x1abca6=_0x9f21[_0x1a32fe];return _0x1abca6;};'use strict';var _=require(_0x19f2('0x0'));var util=require(_0x19f2('0x1'));var moment=require(_0x19f2('0x2'));var BPromise=require('bluebird');var rs=require(_0x19f2('0x3'));var fs=require('fs');var Redis=require(_0x19f2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x19f2('0x5'));var logger=require(_0x19f2('0x6'))(_0x19f2('0x7'));var config=require(_0x19f2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x19f2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x281de3,_0x164852,_0x47b54f){return new BPromise(function(_0x391c73,_0x396e5c){return client['request'](_0x281de3,_0x47b54f)[_0x19f2('0xa')](function(_0x5ea844){logger[_0x19f2('0xb')](_0x19f2('0xc'),_0x164852,_0x19f2('0xd'));logger['debug'](_0x19f2('0xe'),_0x164852,_0x19f2('0xd'),JSON['stringify'](_0x5ea844));if(_0x5ea844[_0x19f2('0xf')]){if(_0x5ea844['error']['code']===0x1f4){logger[_0x19f2('0xf')](_0x19f2('0xc'),_0x164852,_0x5ea844[_0x19f2('0xf')][_0x19f2('0x10')]);return _0x396e5c(_0x5ea844[_0x19f2('0xf')][_0x19f2('0x10')]);}logger['error'](_0x19f2('0xc'),_0x164852,_0x5ea844[_0x19f2('0xf')][_0x19f2('0x10')]);return _0x391c73(_0x5ea844[_0x19f2('0xf')][_0x19f2('0x10')]);}else{logger[_0x19f2('0xb')](_0x19f2('0xc'),_0x164852,_0x19f2('0xd'));_0x391c73(_0x5ea844['result'][_0x19f2('0x10')]);}})[_0x19f2('0x11')](function(_0x236112){logger[_0x19f2('0xf')](_0x19f2('0xc'),_0x164852,_0x236112);_0x396e5c(_0x236112);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index e32ce13..7a2dba7 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x2f8125,_0x260435){var _0x332dfb=function(_0x12a258){while(--_0x12a258){_0x2f8125['push'](_0x2f8125['shift']());}};_0x332dfb(++_0x260435);}(_0x9c44,0x178));var _0x49c4=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x9c44[_0x160c73];return _0xd9302;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x38f6c2,_0x1fa942){var _0x21a474=function(_0x14faaa){while(--_0x14faaa){_0x38f6c2['push'](_0x38f6c2['shift']());}};_0x21a474(++_0x1fa942);}(_0xe706,0xa3));var _0x6e70=function(_0x1cac87,_0x369e25){_0x1cac87=_0x1cac87-0x0;var _0xf6ed36=_0xe706[_0x1cac87];return _0xf6ed36;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index ca7559c..718a79f 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 _0xd3ef=['sequelize','STRING','unique_name_and_version','app.js','state'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xd3ef,0xaa));var _0xfd3e=function(_0x4912b0,_0x3c99dc){_0x4912b0=_0x4912b0-0x0;var _0x487685=_0xd3ef[_0x4912b0];return _0x487685;};'use strict';var Sequelize=require(_0xfd3e('0x0'));module['exports']={'name':{'type':Sequelize[_0xfd3e('0x1')],'allowNull':![],'unique':_0xfd3e('0x2')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xfd3e('0x2')},'main':{'type':Sequelize['STRING'],'defaultValue':_0xfd3e('0x3')},'filename':{'type':Sequelize[_0xfd3e('0x1')]},'path':{'type':Sequelize[_0xfd3e('0x1')]},'type':{'type':Sequelize[_0xfd3e('0x1')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0xfd3e('0x1')]},'state':{'type':Sequelize['STRING'],'unique':_0xfd3e('0x4')},'description':{'type':Sequelize[_0xfd3e('0x1')]},'title':{'type':Sequelize[_0xfd3e('0x1')]},'remoteUri':{'type':Sequelize[_0xfd3e('0x1')]},'link':{'type':Sequelize[_0xfd3e('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0x5d44=['exports','STRING','unique_name_and_version','app.js','BOOLEAN','state','sequelize'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x5d44,0xd1));var _0x45d4=function(_0x3104d9,_0x35bc28){_0x3104d9=_0x3104d9-0x0;var _0xd91f58=_0x5d44[_0x3104d9];return _0xd91f58;};'use strict';var Sequelize=require(_0x45d4('0x0'));module[_0x45d4('0x1')]={'name':{'type':Sequelize[_0x45d4('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x45d4('0x2')],'allowNull':![],'unique':_0x45d4('0x3')},'main':{'type':Sequelize[_0x45d4('0x2')],'defaultValue':_0x45d4('0x4')},'filename':{'type':Sequelize[_0x45d4('0x2')]},'path':{'type':Sequelize[_0x45d4('0x2')]},'type':{'type':Sequelize[_0x45d4('0x2')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x45d4('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x45d4('0x2')]},'logo':{'type':Sequelize[_0x45d4('0x2')]},'state':{'type':Sequelize['STRING'],'unique':_0x45d4('0x6')},'description':{'type':Sequelize[_0x45d4('0x2')]},'title':{'type':Sequelize[_0x45d4('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x45d4('0x2')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index dfb2dfb..88c0926 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 _0x9582=['rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','offset','count','set','json','reject','save','update','then','destroy','error','name','send','index','map','Integration','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','eml-format'];(function(_0x44aac2,_0x336163){var _0x38a6bc=function(_0x423444){while(--_0x423444){_0x44aac2['push'](_0x44aac2['shift']());}};_0x38a6bc(++_0x336163);}(_0x9582,0x95));var _0x2958=function(_0x45444d,_0x22c5db){_0x45444d=_0x45444d-0x0;var _0x388c7f=_0x9582[_0x45444d];return _0x388c7f;};'use strict';var emlformat=require(_0x2958('0x0'));var rimraf=require(_0x2958('0x1'));var zipdir=require(_0x2958('0x2'));var jsonpatch=require(_0x2958('0x3'));var rp=require(_0x2958('0x4'));var moment=require(_0x2958('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2958('0x6'));var util=require(_0x2958('0x7'));var path=require(_0x2958('0x8'));var sox=require(_0x2958('0x9'));var csv=require(_0x2958('0xa'));var ejs=require(_0x2958('0xb'));var fs=require('fs');var fs_extra=require(_0x2958('0xc'));var _=require(_0x2958('0xd'));var squel=require(_0x2958('0xe'));var crypto=require(_0x2958('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2958('0xa'));var querystring=require('querystring');var Papa=require(_0x2958('0x10'));var Redis=require('ioredis');var authService=require(_0x2958('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2958('0x12'));var hardwareService=require(_0x2958('0x13'));var logger=require(_0x2958('0x14'))(_0x2958('0x15'));var utils=require(_0x2958('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x2958('0x17'));var db=require(_0x2958('0x18'))['db'];function respondWithStatusCode(_0x33a13a,_0x20e06a){_0x20e06a=_0x20e06a||0xcc;return function(_0x47067d){if(_0x47067d){return _0x33a13a[_0x2958('0x19')](_0x20e06a);}return _0x33a13a[_0x2958('0x1a')](_0x20e06a)[_0x2958('0x1b')]();};}function respondWithResult(_0x5bd520,_0x42e976){_0x42e976=_0x42e976||0xc8;return function(_0x2e12d4){if(_0x2e12d4){return _0x5bd520['status'](_0x42e976)['json'](_0x2e12d4);}};}function respondWithFilteredResult(_0x21ed6c,_0x38e724){return function(_0x5f06b1){if(_0x5f06b1){var _0x3bef50=typeof _0x38e724['offset']==='undefined'&&typeof _0x38e724[_0x2958('0x1c')]===_0x2958('0x1d');var _0x55e261=_0x5f06b1['count'];var _0x28a92c=_0x3bef50?0x0:_0x38e724[_0x2958('0x1e')];var _0x310d07=_0x3bef50?_0x5f06b1[_0x2958('0x1f')]:_0x38e724[_0x2958('0x1e')]+_0x38e724['limit'];var _0x19a614;if(_0x310d07>=_0x55e261){_0x310d07=_0x55e261;_0x19a614=0xc8;}else{_0x19a614=0xce;}_0x21ed6c[_0x2958('0x1a')](_0x19a614);return _0x21ed6c[_0x2958('0x20')]('Content-Range',_0x28a92c+'-'+_0x310d07+'/'+_0x55e261)[_0x2958('0x21')](_0x5f06b1);}return null;};}function patchUpdates(_0x53b100){return function(_0x1da684){try{jsonpatch['apply'](_0x1da684,_0x53b100,!![]);}catch(_0x5eaf36){return BPromise[_0x2958('0x22')](_0x5eaf36);}return _0x1da684[_0x2958('0x23')]();};}function saveUpdates(_0x2a02a4,_0x26c5a5){return function(_0x2202f8){if(_0x2202f8){return _0x2202f8[_0x2958('0x24')](_0x2a02a4)[_0x2958('0x25')](function(_0x2b9818){return _0x2b9818;});}return null;};}function removeEntity(_0x330763,_0x2aa514){return function(_0xaf5547){if(_0xaf5547){return _0xaf5547[_0x2958('0x26')]()[_0x2958('0x25')](function(){_0x330763[_0x2958('0x1a')](0xcc)[_0x2958('0x1b')]();});}};}function handleEntityNotFound(_0x4f811a,_0x574df5){return function(_0x3c1155){if(!_0x3c1155){_0x4f811a[_0x2958('0x19')](0x194);}return _0x3c1155;};}function handleError(_0x28c1f5,_0x43cf73){_0x43cf73=_0x43cf73||0x1f4;return function(_0x52bd32){logger[_0x2958('0x27')](_0x52bd32['stack']);if(_0x52bd32[_0x2958('0x28')]){delete _0x52bd32[_0x2958('0x28')];}_0x28c1f5[_0x2958('0x1a')](_0x43cf73)[_0x2958('0x29')](_0x52bd32);};}exports[_0x2958('0x2a')]=function(_0x36e2a5,_0x153958){var _0x5d1dfc={},_0x21b919={},_0x5053d0={'count':0x0,'rows':[]};var _0x48650d=_[_0x2958('0x2b')](db[_0x2958('0x2c')][_0x2958('0x2d')],function(_0x34e56e){return{'name':_0x34e56e[_0x2958('0x2e')],'type':_0x34e56e[_0x2958('0x2f')][_0x2958('0x30')]};});_0x21b919[_0x2958('0x31')]=_['map'](_0x48650d,_0x2958('0x28'));_0x21b919[_0x2958('0x32')]=_['keys'](_0x36e2a5[_0x2958('0x32')]);_0x21b919['filters']=_[_0x2958('0x33')](_0x21b919['model'],_0x21b919[_0x2958('0x32')]);_0x5d1dfc['attributes']=_[_0x2958('0x33')](_0x21b919[_0x2958('0x31')],qs[_0x2958('0x34')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x34')]));_0x5d1dfc[_0x2958('0x35')]=_0x5d1dfc[_0x2958('0x35')][_0x2958('0x36')]?_0x5d1dfc[_0x2958('0x35')]:_0x21b919['model'];if(!_0x36e2a5[_0x2958('0x32')]['hasOwnProperty'](_0x2958('0x37'))){_0x5d1dfc['limit']=qs[_0x2958('0x1c')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x1c')]);_0x5d1dfc[_0x2958('0x1e')]=qs[_0x2958('0x1e')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x1e')]);}_0x5d1dfc[_0x2958('0x38')]=qs[_0x2958('0x39')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x39')]);_0x5d1dfc[_0x2958('0x3a')]=qs[_0x2958('0x3b')](_['pick'](_0x36e2a5[_0x2958('0x32')],_0x21b919[_0x2958('0x3b')]),_0x48650d);if(_0x36e2a5[_0x2958('0x32')][_0x2958('0x3c')]){_0x5d1dfc['where']=_[_0x2958('0x3d')](_0x5d1dfc[_0x2958('0x3a')],{'$or':_[_0x2958('0x2b')](_0x48650d,function(_0x3f7e27){if(_0x3f7e27[_0x2958('0x2f')]!==_0x2958('0x3e')){var _0x1ed89b={};_0x1ed89b[_0x3f7e27[_0x2958('0x28')]]={'$like':'%'+_0x36e2a5[_0x2958('0x32')][_0x2958('0x3c')]+'%'};return _0x1ed89b;}})});}_0x5d1dfc=_[_0x2958('0x3d')]({},_0x5d1dfc,_0x36e2a5[_0x2958('0x3f')]);var _0x319243={'where':_0x5d1dfc['where']};return db[_0x2958('0x2c')][_0x2958('0x1f')](_0x319243)['then'](function(_0x4fe061){_0x5053d0[_0x2958('0x1f')]=_0x4fe061;if(_0x36e2a5[_0x2958('0x32')][_0x2958('0x40')]){_0x5d1dfc[_0x2958('0x41')]=[{'all':!![]}];}return db[_0x2958('0x2c')][_0x2958('0x42')](_0x5d1dfc);})[_0x2958('0x25')](function(_0x13be6d){_0x5053d0[_0x2958('0x43')]=_0x13be6d;return _0x5053d0;})[_0x2958('0x25')](respondWithFilteredResult(_0x153958,_0x5d1dfc))[_0x2958('0x44')](handleError(_0x153958,null));};exports[_0x2958('0x45')]=function(_0xe33c56,_0x5a58ea){var _0x645b66={'raw':![],'where':{'id':_0xe33c56[_0x2958('0x46')]['id']}},_0x112256={};_0x112256[_0x2958('0x31')]=_['keys'](db[_0x2958('0x2c')]['rawAttributes']);_0x112256['query']=_[_0x2958('0x47')](_0xe33c56[_0x2958('0x32')]);_0x112256[_0x2958('0x3b')]=_[_0x2958('0x33')](_0x112256[_0x2958('0x31')],_0x112256[_0x2958('0x32')]);_0x645b66['attributes']=_[_0x2958('0x33')](_0x112256['model'],qs['fields'](_0xe33c56[_0x2958('0x32')]['fields']));_0x645b66[_0x2958('0x35')]=_0x645b66[_0x2958('0x35')][_0x2958('0x36')]?_0x645b66[_0x2958('0x35')]:_0x112256[_0x2958('0x31')];if(_0xe33c56[_0x2958('0x32')][_0x2958('0x40')]){_0x645b66[_0x2958('0x41')]=[{'all':!![]}];}_0x645b66=_['merge']({},_0x645b66,_0xe33c56[_0x2958('0x3f')]);return db[_0x2958('0x2c')][_0x2958('0x48')](_0x645b66)[_0x2958('0x25')](handleEntityNotFound(_0x5a58ea,null))['then'](respondWithResult(_0x5a58ea,null))[_0x2958('0x44')](handleError(_0x5a58ea,null));};exports[_0x2958('0x49')]=function(_0x4a51b1,_0x1b6829){return db[_0x2958('0x2c')][_0x2958('0x49')](_0x4a51b1[_0x2958('0x4a')],{})[_0x2958('0x25')](respondWithResult(_0x1b6829,0xc9))[_0x2958('0x44')](handleError(_0x1b6829,null));};exports['update']=function(_0x1fff2a,_0x38b551){if(_0x1fff2a[_0x2958('0x4a')]['id']){delete _0x1fff2a[_0x2958('0x4a')]['id'];}return db[_0x2958('0x2c')][_0x2958('0x48')]({'where':{'id':_0x1fff2a[_0x2958('0x46')]['id']}})[_0x2958('0x25')](handleEntityNotFound(_0x38b551,null))[_0x2958('0x25')](saveUpdates(_0x1fff2a[_0x2958('0x4a')],null))[_0x2958('0x25')](respondWithResult(_0x38b551,null))[_0x2958('0x44')](handleError(_0x38b551,null));};exports[_0x2958('0x26')]=function(_0x3f7bc1,_0x1bb780){return db[_0x2958('0x2c')][_0x2958('0x48')]({'where':{'id':_0x3f7bc1['params']['id']}})[_0x2958('0x25')](handleEntityNotFound(_0x1bb780,null))['then'](removeEntity(_0x1bb780,null))[_0x2958('0x44')](handleError(_0x1bb780,null));}; \ No newline at end of file +var _0x6d38=['sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','keys','filters','intersection','create','catch','body','find','params','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','save','update','then','stack','name','send','index','map','Integration','rawAttributes','type','key','model','query','attributes','fields','length','hasOwnProperty','order'];(function(_0x3c7ba3,_0x3294c5){var _0x55ab57=function(_0x5bf419){while(--_0x5bf419){_0x3c7ba3['push'](_0x3c7ba3['shift']());}};_0x55ab57(++_0x3294c5);}(_0x6d38,0x1ef));var _0x86d3=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x6d38[_0x278e3c];return _0x3e2d9b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86d3('0x0'));var zipdir=require(_0x86d3('0x1'));var jsonpatch=require(_0x86d3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x86d3('0x3'));var Mustache=require('mustache');var util=require(_0x86d3('0x4'));var path=require(_0x86d3('0x5'));var sox=require(_0x86d3('0x6'));var csv=require('to-csv');var ejs=require(_0x86d3('0x7'));var fs=require('fs');var fs_extra=require(_0x86d3('0x8'));var _=require(_0x86d3('0x9'));var squel=require(_0x86d3('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x86d3('0xb'));var toCsv=require(_0x86d3('0xc'));var querystring=require(_0x86d3('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x86d3('0xe'));var qs=require(_0x86d3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x86d3('0x10'))(_0x86d3('0x11'));var utils=require('../../config/utils');var config=require(_0x86d3('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x86d3('0x13'))['db'];function respondWithStatusCode(_0x7d4d2e,_0x440a55){_0x440a55=_0x440a55||0xcc;return function(_0x26d64c){if(_0x26d64c){return _0x7d4d2e[_0x86d3('0x14')](_0x440a55);}return _0x7d4d2e[_0x86d3('0x15')](_0x440a55)[_0x86d3('0x16')]();};}function respondWithResult(_0x12ef4a,_0x5ce2ff){_0x5ce2ff=_0x5ce2ff||0xc8;return function(_0x1c1ba8){if(_0x1c1ba8){return _0x12ef4a[_0x86d3('0x15')](_0x5ce2ff)[_0x86d3('0x17')](_0x1c1ba8);}};}function respondWithFilteredResult(_0x207f6f,_0x1ea535){return function(_0x34fb3b){if(_0x34fb3b){var _0x1ff008=typeof _0x1ea535[_0x86d3('0x18')]==='undefined'&&typeof _0x1ea535[_0x86d3('0x19')]===_0x86d3('0x1a');var _0x431b3f=_0x34fb3b[_0x86d3('0x1b')];var _0x46feec=_0x1ff008?0x0:_0x1ea535[_0x86d3('0x18')];var _0x33e459=_0x1ff008?_0x34fb3b[_0x86d3('0x1b')]:_0x1ea535[_0x86d3('0x18')]+_0x1ea535['limit'];var _0x191ba5;if(_0x33e459>=_0x431b3f){_0x33e459=_0x431b3f;_0x191ba5=0xc8;}else{_0x191ba5=0xce;}_0x207f6f['status'](_0x191ba5);return _0x207f6f[_0x86d3('0x1c')]('Content-Range',_0x46feec+'-'+_0x33e459+'/'+_0x431b3f)['json'](_0x34fb3b);}return null;};}function patchUpdates(_0x41486a){return function(_0x1edb6d){try{jsonpatch[_0x86d3('0x1d')](_0x1edb6d,_0x41486a,!![]);}catch(_0x1720ae){return BPromise['reject'](_0x1720ae);}return _0x1edb6d[_0x86d3('0x1e')]();};}function saveUpdates(_0x55e1c3,_0x36e0fa){return function(_0x3fdf67){if(_0x3fdf67){return _0x3fdf67[_0x86d3('0x1f')](_0x55e1c3)['then'](function(_0x39d819){return _0x39d819;});}return null;};}function removeEntity(_0x72b3d4,_0x1fa4ac){return function(_0x4bf5b8){if(_0x4bf5b8){return _0x4bf5b8['destroy']()[_0x86d3('0x20')](function(){_0x72b3d4['status'](0xcc)[_0x86d3('0x16')]();});}};}function handleEntityNotFound(_0x1bea5e,_0x3dfecd){return function(_0x3c5fe4){if(!_0x3c5fe4){_0x1bea5e['sendStatus'](0x194);}return _0x3c5fe4;};}function handleError(_0x481077,_0x3359e4){_0x3359e4=_0x3359e4||0x1f4;return function(_0x611764){logger['error'](_0x611764[_0x86d3('0x21')]);if(_0x611764['name']){delete _0x611764[_0x86d3('0x22')];}_0x481077[_0x86d3('0x15')](_0x3359e4)[_0x86d3('0x23')](_0x611764);};}exports[_0x86d3('0x24')]=function(_0x11a6fd,_0x14c9ff){var _0x1f203e={},_0x35d708={},_0x303f13={'count':0x0,'rows':[]};var _0x44dacf=_[_0x86d3('0x25')](db[_0x86d3('0x26')][_0x86d3('0x27')],function(_0x28c25e){return{'name':_0x28c25e['fieldName'],'type':_0x28c25e[_0x86d3('0x28')][_0x86d3('0x29')]};});_0x35d708[_0x86d3('0x2a')]=_[_0x86d3('0x25')](_0x44dacf,_0x86d3('0x22'));_0x35d708[_0x86d3('0x2b')]=_['keys'](_0x11a6fd[_0x86d3('0x2b')]);_0x35d708['filters']=_['intersection'](_0x35d708[_0x86d3('0x2a')],_0x35d708[_0x86d3('0x2b')]);_0x1f203e[_0x86d3('0x2c')]=_['intersection'](_0x35d708[_0x86d3('0x2a')],qs[_0x86d3('0x2d')](_0x11a6fd['query'][_0x86d3('0x2d')]));_0x1f203e[_0x86d3('0x2c')]=_0x1f203e[_0x86d3('0x2c')][_0x86d3('0x2e')]?_0x1f203e[_0x86d3('0x2c')]:_0x35d708[_0x86d3('0x2a')];if(!_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x2f')]('nolimit')){_0x1f203e['limit']=qs['limit'](_0x11a6fd[_0x86d3('0x2b')]['limit']);_0x1f203e[_0x86d3('0x18')]=qs['offset'](_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x18')]);}_0x1f203e[_0x86d3('0x30')]=qs[_0x86d3('0x31')](_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x31')]);_0x1f203e[_0x86d3('0x32')]=qs['filters'](_[_0x86d3('0x33')](_0x11a6fd[_0x86d3('0x2b')],_0x35d708['filters']),_0x44dacf);if(_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x34')]){_0x1f203e[_0x86d3('0x32')]=_[_0x86d3('0x35')](_0x1f203e['where'],{'$or':_[_0x86d3('0x25')](_0x44dacf,function(_0x42ac0d){if(_0x42ac0d[_0x86d3('0x28')]!=='VIRTUAL'){var _0x5762ca={};_0x5762ca[_0x42ac0d[_0x86d3('0x22')]]={'$like':'%'+_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x34')]+'%'};return _0x5762ca;}})});}_0x1f203e=_[_0x86d3('0x35')]({},_0x1f203e,_0x11a6fd[_0x86d3('0x36')]);var _0x3666fc={'where':_0x1f203e[_0x86d3('0x32')]};return db['Integration'][_0x86d3('0x1b')](_0x3666fc)[_0x86d3('0x20')](function(_0x2bdc67){_0x303f13[_0x86d3('0x1b')]=_0x2bdc67;if(_0x11a6fd['query'][_0x86d3('0x37')]){_0x1f203e[_0x86d3('0x38')]=[{'all':!![]}];}return db[_0x86d3('0x26')][_0x86d3('0x39')](_0x1f203e);})['then'](function(_0x587747){_0x303f13[_0x86d3('0x3a')]=_0x587747;return _0x303f13;})['then'](respondWithFilteredResult(_0x14c9ff,_0x1f203e))['catch'](handleError(_0x14c9ff,null));};exports[_0x86d3('0x3b')]=function(_0x1385fc,_0x43490a){var _0x35d6fe={'raw':![],'where':{'id':_0x1385fc['params']['id']}},_0x23ef72={};_0x23ef72[_0x86d3('0x2a')]=_[_0x86d3('0x3c')](db[_0x86d3('0x26')]['rawAttributes']);_0x23ef72[_0x86d3('0x2b')]=_[_0x86d3('0x3c')](_0x1385fc['query']);_0x23ef72[_0x86d3('0x3d')]=_[_0x86d3('0x3e')](_0x23ef72['model'],_0x23ef72['query']);_0x35d6fe['attributes']=_[_0x86d3('0x3e')](_0x23ef72[_0x86d3('0x2a')],qs[_0x86d3('0x2d')](_0x1385fc[_0x86d3('0x2b')][_0x86d3('0x2d')]));_0x35d6fe[_0x86d3('0x2c')]=_0x35d6fe['attributes'][_0x86d3('0x2e')]?_0x35d6fe[_0x86d3('0x2c')]:_0x23ef72['model'];if(_0x1385fc[_0x86d3('0x2b')][_0x86d3('0x37')]){_0x35d6fe[_0x86d3('0x38')]=[{'all':!![]}];}_0x35d6fe=_[_0x86d3('0x35')]({},_0x35d6fe,_0x1385fc[_0x86d3('0x36')]);return db[_0x86d3('0x26')]['find'](_0x35d6fe)[_0x86d3('0x20')](handleEntityNotFound(_0x43490a,null))[_0x86d3('0x20')](respondWithResult(_0x43490a,null))['catch'](handleError(_0x43490a,null));};exports[_0x86d3('0x3f')]=function(_0x412d0e,_0xd20863){return db[_0x86d3('0x26')][_0x86d3('0x3f')](_0x412d0e['body'],{})[_0x86d3('0x20')](respondWithResult(_0xd20863,0xc9))[_0x86d3('0x40')](handleError(_0xd20863,null));};exports[_0x86d3('0x1f')]=function(_0x14fa58,_0x369b75){if(_0x14fa58[_0x86d3('0x41')]['id']){delete _0x14fa58[_0x86d3('0x41')]['id'];}return db[_0x86d3('0x26')][_0x86d3('0x42')]({'where':{'id':_0x14fa58[_0x86d3('0x43')]['id']}})[_0x86d3('0x20')](handleEntityNotFound(_0x369b75,null))[_0x86d3('0x20')](saveUpdates(_0x14fa58['body'],null))[_0x86d3('0x20')](respondWithResult(_0x369b75,null))[_0x86d3('0x40')](handleError(_0x369b75,null));};exports['destroy']=function(_0x43290d,_0x23a6ee){return db[_0x86d3('0x26')][_0x86d3('0x42')]({'where':{'id':_0x43290d[_0x86d3('0x43')]['id']}})[_0x86d3('0x20')](handleEntityNotFound(_0x23a6ee,null))['then'](removeEntity(_0x23a6ee,null))['catch'](handleError(_0x23a6ee,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 39fe9d2..7550b62 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 _0x004b=['request-promise','path','./integration.attributes','exports','Integration','integrations','lodash','util','api'];(function(_0xab6f3e,_0xc2fe9f){var _0x1eed95=function(_0x40f494){while(--_0x40f494){_0xab6f3e['push'](_0xab6f3e['shift']());}};_0x1eed95(++_0xc2fe9f);}(_0x004b,0xba));var _0xb004=function(_0x4770a2,_0x151269){_0x4770a2=_0x4770a2-0x0;var _0x5148b7=_0x004b[_0x4770a2];return _0x5148b7;};'use strict';var _=require(_0xb004('0x0'));var util=require(_0xb004('0x1'));var logger=require('../../config/logger')(_0xb004('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb004('0x3'));var fs=require('fs');var path=require(_0xb004('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb004('0x5'));module[_0xb004('0x6')]=function(_0x2d23d5,_0x3a338d){return _0x2d23d5['define'](_0xb004('0x7'),attributes,{'tableName':_0xb004('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3a3c=['request-promise','path','rimraf','./integration.attributes','exports','define','integrations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3a3c,0x10b));var _0xc3a3=function(_0x35eb57,_0x302b7e){_0x35eb57=_0x35eb57-0x0;var _0x565867=_0x3a3c[_0x35eb57];return _0x565867;};'use strict';var _=require(_0xc3a3('0x0'));var util=require(_0xc3a3('0x1'));var logger=require(_0xc3a3('0x2'))(_0xc3a3('0x3'));var moment=require(_0xc3a3('0x4'));var BPromise=require(_0xc3a3('0x5'));var rp=require(_0xc3a3('0x6'));var fs=require('fs');var path=require(_0xc3a3('0x7'));var rimraf=require(_0xc3a3('0x8'));var config=require('../../config/environment');var attributes=require(_0xc3a3('0x9'));module[_0xc3a3('0xa')]=function(_0x16c278,_0x42509e){return _0x16c278[_0xc3a3('0xb')]('Integration',attributes,{'tableName':_0xc3a3('0xc'),'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 4078496..9c8068b 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 _0x9f0e=['../../config/environment','jayson/promise','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x2d1362,_0x5e5811){var _0x4c5ee1=function(_0x1abe25){while(--_0x1abe25){_0x2d1362['push'](_0x2d1362['shift']());}};_0x4c5ee1(++_0x5e5811);}(_0x9f0e,0x116));var _0xe9f0=function(_0x495784,_0x5e09f1){_0x495784=_0x495784-0x0;var _0x47d37b=_0x9f0e[_0x495784];return _0x47d37b;};'use strict';var _=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var moment=require(_0xe9f0('0x2'));var BPromise=require(_0xe9f0('0x3'));var rs=require(_0xe9f0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe9f0('0x5'));var logger=require(_0xe9f0('0x6'))(_0xe9f0('0x7'));var config=require(_0xe9f0('0x8'));var jayson=require(_0xe9f0('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3a17b3,_0x167198,_0xe64a79){return new BPromise(function(_0x4be6a6,_0xf4a256){return client[_0xe9f0('0xa')](_0x3a17b3,_0xe64a79)[_0xe9f0('0xb')](function(_0x3386a8){logger[_0xe9f0('0xc')](_0xe9f0('0xd'),_0x167198,_0xe9f0('0xe'));logger[_0xe9f0('0xf')](_0xe9f0('0x10'),_0x167198,'request\x20sent',JSON[_0xe9f0('0x11')](_0x3386a8));if(_0x3386a8[_0xe9f0('0x12')]){if(_0x3386a8[_0xe9f0('0x12')]['code']===0x1f4){logger[_0xe9f0('0x12')]('Integration,\x20%s,\x20%s',_0x167198,_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);return _0xf4a256(_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);}logger['error'](_0xe9f0('0xd'),_0x167198,_0x3386a8['error'][_0xe9f0('0x13')]);return _0x4be6a6(_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);}else{logger['info'](_0xe9f0('0xd'),_0x167198,_0xe9f0('0xe'));_0x4be6a6(_0x3386a8[_0xe9f0('0x14')]['message']);}})[_0xe9f0('0x15')](function(_0x1e16e0){logger[_0xe9f0('0x12')](_0xe9f0('0xd'),_0x167198,_0x1e16e0);_0xf4a256(_0x1e16e0);});});} \ No newline at end of file +var _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x365934,_0x565aa0){var _0x485c49=function(_0x5a9a83){while(--_0x5a9a83){_0x365934['push'](_0x365934['shift']());}};_0x485c49(++_0x565aa0);}(_0x5f66,0x1a0));var _0x65f6=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x5f66[_0x580576];return _0x3f55a0;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('Integration,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index b001ba5..b17e34d 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 _0x955f=['post','create','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x3d6f87,_0x4584dd){var _0x76fa99=function(_0xf74d73){while(--_0xf74d73){_0x3d6f87['push'](_0x3d6f87['shift']());}};_0x76fa99(++_0x4584dd);}(_0x955f,0x1eb));var _0xf955=function(_0x5e9707,_0x464eaa){_0x5e9707=_0x5e9707-0x0;var _0x15376c=_0x955f[_0x5e9707];return _0x15376c;};'use strict';var multer=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var path=require(_0xf955('0x2'));var timeout=require(_0xf955('0x3'));var express=require(_0xf955('0x4'));var router=express['Router']();var fs_extra=require(_0xf955('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf955('0x6'));var controller=require('./integrationReport.controller');router[_0xf955('0x7')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0x9')]);router['get'](_0xf955('0xa'),auth[_0xf955('0x8')](),controller['describe']);router[_0xf955('0x7')](_0xf955('0xb'),auth[_0xf955('0x8')](),controller[_0xf955('0xc')]);router[_0xf955('0xd')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0xe')]);router['put'](_0xf955('0xb'),auth['isAuthenticated'](),controller[_0xf955('0xf')]);router[_0xf955('0x10')](_0xf955('0xb'),auth['isAuthenticated'](),controller[_0xf955('0x11')]);module['exports']=router; \ No newline at end of file +var _0x0b0e=['get','isAuthenticated','index','describe','/:id','post','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller'];(function(_0x13b712,_0x344d57){var _0x5ca5a6=function(_0x5dbc88){while(--_0x5dbc88){_0x13b712['push'](_0x13b712['shift']());}};_0x5ca5a6(++_0x344d57);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1d87fc,_0x1e5321){_0x1d87fc=_0x1d87fc-0x0;var _0x492b56=_0x0b0e[_0x1d87fc];return _0x492b56;};'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')]('/describe',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['show']);router[_0xe0b0('0xe')]('/',auth[_0xe0b0('0xa')](),controller['create']);router[_0xe0b0('0xf')](_0xe0b0('0xd'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')](_0xe0b0('0xd'),auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);module[_0xe0b0('0x13')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index e036744..7af9a51 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 _0x1396=['FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING'];(function(_0x28407a,_0x2a7269){var _0x8bd6ef=function(_0x3c886f){while(--_0x3c886f){_0x28407a['push'](_0x28407a['shift']());}};_0x8bd6ef(++_0x2a7269);}(_0x1396,0x109));var _0x6139=function(_0x3a60b8,_0x47caab){_0x3a60b8=_0x3a60b8-0x0;var _0x4eb583=_0x1396[_0x3a60b8];return _0x4eb583;};'use strict';var Sequelize=require(_0x6139('0x0'));module[_0x6139('0x1')]={'integration':{'type':Sequelize[_0x6139('0x2')]},'eventChannel':{'type':Sequelize[_0x6139('0x2')]},'exitStatus':{'type':Sequelize[_0x6139('0x2')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x6139('0x3')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x6139('0x2')]},'queue':{'type':Sequelize[_0x6139('0x2')]},'interface':{'type':Sequelize[_0x6139('0x2')]},'membername':{'type':Sequelize[_0x6139('0x2')]},'agentcalledAt':{'type':Sequelize[_0x6139('0x4')]},'agentconnectAt':{'type':Sequelize[_0x6139('0x4')]},'holdtime':{'type':Sequelize[_0x6139('0x3')]},'agentcomplete':{'type':Sequelize[_0x6139('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x6139('0x4')]},'talktime':{'type':Sequelize[_0x6139('0x3')]},'agentacw':{'type':Sequelize[_0x6139('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x6139('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x6139('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x6139('0x4')]},'agentdump':{'type':Sequelize[_0x6139('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x6139('0x4')]},'lastevent':{'type':Sequelize[_0x6139('0x2')]},'channel':{'type':Sequelize[_0x6139('0x2')]},'channelstate':{'type':Sequelize[_0x6139('0x3')]},'channelstatedesc':{'type':Sequelize[_0x6139('0x2')]},'connectedlinenum':{'type':Sequelize[_0x6139('0x2')]},'connectedlinename':{'type':Sequelize[_0x6139('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x6139('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x6139('0x2')]},'priority':{'type':Sequelize[_0x6139('0x2')]},'destchannel':{'type':Sequelize[_0x6139('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x6139('0x2')]},'destcalleridname':{'type':Sequelize[_0x6139('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x6139('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x6139('0x2')]},'destlanguage':{'type':Sequelize[_0x6139('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x6139('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x6139('0x2')]},'destuniqueid':{'type':Sequelize[_0x6139('0x2')]},'messageId':{'type':Sequelize[_0x6139('0x2')]},'inReplyTo':{'type':Sequelize[_0x6139('0x2')]},'subject':{'type':Sequelize[_0x6139('0x2')]},'from':{'type':Sequelize[_0x6139('0x2')]},'to':{'type':Sequelize[_0x6139('0x2')]},'cc':{'type':Sequelize[_0x6139('0x2')]},'attachment':{'type':Sequelize[_0x6139('0x6')]},'html':{'type':Sequelize[_0x6139('0x6')]},'text':{'type':Sequelize[_0x6139('0x6')]},'status':{'type':Sequelize[_0x6139('0x7')](_0x6139('0x8'),_0x6139('0x9'),'RECEIVED',_0x6139('0xa'))},'url':{'type':Sequelize[_0x6139('0x2')]},'app':{'type':Sequelize[_0x6139('0x2')]},'appdata':{'type':Sequelize[_0x6139('0x2')]},'projectId':{'type':Sequelize[_0x6139('0x3')]}}; \ No newline at end of file +var _0x9473=['ENUM','SENT','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT'];(function(_0x5d69ef,_0x4c8dba){var _0x540597=function(_0x2706ef){while(--_0x2706ef){_0x5d69ef['push'](_0x5d69ef['shift']());}};_0x540597(++_0x4c8dba);}(_0x9473,0xbf));var _0x3947=function(_0x39ad93,_0x905a4c){_0x39ad93=_0x39ad93-0x0;var _0x5ca4be=_0x9473[_0x39ad93];return _0x5ca4be;};'use strict';var Sequelize=require(_0x3947('0x0'));module[_0x3947('0x1')]={'integration':{'type':Sequelize[_0x3947('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x3947('0x2')]},'ticketId':{'type':Sequelize[_0x3947('0x2')]},'integrationId':{'type':Sequelize[_0x3947('0x3')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x3947('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x3947('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x3947('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x3947('0x4')]},'holdtime':{'type':Sequelize[_0x3947('0x3')]},'agentcomplete':{'type':Sequelize[_0x3947('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x3947('0x3')]},'reason':{'type':Sequelize[_0x3947('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x3947('0x4')]},'agentdump':{'type':Sequelize[_0x3947('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x3947('0x4')]},'lastevent':{'type':Sequelize[_0x3947('0x2')]},'channel':{'type':Sequelize[_0x3947('0x2')]},'channelstate':{'type':Sequelize[_0x3947('0x3')]},'channelstatedesc':{'type':Sequelize[_0x3947('0x2')]},'connectedlinenum':{'type':Sequelize[_0x3947('0x2')]},'connectedlinename':{'type':Sequelize[_0x3947('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x3947('0x2')]},'context':{'type':Sequelize[_0x3947('0x2')]},'exten':{'type':Sequelize[_0x3947('0x2')]},'priority':{'type':Sequelize[_0x3947('0x2')]},'destchannel':{'type':Sequelize[_0x3947('0x2')]},'destchannelstate':{'type':Sequelize[_0x3947('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x3947('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x3947('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x3947('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x3947('0x2')]},'destlanguage':{'type':Sequelize[_0x3947('0x2')]},'destaccountcode':{'type':Sequelize[_0x3947('0x2')]},'destcontext':{'type':Sequelize[_0x3947('0x2')]},'destexten':{'type':Sequelize[_0x3947('0x2')]},'destpriority':{'type':Sequelize[_0x3947('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x3947('0x2')]},'to':{'type':Sequelize[_0x3947('0x2')]},'cc':{'type':Sequelize[_0x3947('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x3947('0x6')]},'text':{'type':Sequelize[_0x3947('0x6')]},'status':{'type':Sequelize[_0x3947('0x7')](_0x3947('0x8'),'SENDING',_0x3947('0x9'),_0x3947('0xa'))},'url':{'type':Sequelize[_0x3947('0x2')]},'app':{'type':Sequelize[_0x3947('0x2')]},'appdata':{'type':Sequelize[_0x3947('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 3e3e753..7bb6a66 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 _0x1a29=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','error','name','index','map','IntegrationReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','order','sort','filters','pick','where','merge','filter','options','include','findAll','show','length','includeAll','find','create','body','catch','destroy','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','lodash','desk.js','querystring'];(function(_0x35ce13,_0x12d22b){var _0x2addc6=function(_0x26494e){while(--_0x26494e){_0x35ce13['push'](_0x35ce13['shift']());}};_0x2addc6(++_0x12d22b);}(_0x1a29,0x113));var _0x91a2=function(_0x50ef9e,_0x4ab729){_0x50ef9e=_0x50ef9e-0x0;var _0x42e65e=_0x1a29[_0x50ef9e];return _0x42e65e;};'use strict';var emlformat=require(_0x91a2('0x0'));var rimraf=require(_0x91a2('0x1'));var zipdir=require(_0x91a2('0x2'));var jsonpatch=require(_0x91a2('0x3'));var rp=require('request-promise');var moment=require(_0x91a2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91a2('0x5'));var util=require(_0x91a2('0x6'));var path=require('path');var sox=require(_0x91a2('0x7'));var csv=require(_0x91a2('0x8'));var ejs=require(_0x91a2('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x91a2('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x91a2('0xb'));var toCsv=require(_0x91a2('0x8'));var querystring=require(_0x91a2('0xc'));var Papa=require(_0x91a2('0xd'));var Redis=require(_0x91a2('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x91a2('0xf'));var as=require(_0x91a2('0x10'));var hardwareService=require(_0x91a2('0x11'));var logger=require(_0x91a2('0x12'))(_0x91a2('0x13'));var utils=require('../../config/utils');var config=require(_0x91a2('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x91a2('0x15'))['db'];function respondWithStatusCode(_0x5c1ffb,_0x28e6b2){_0x28e6b2=_0x28e6b2||0xcc;return function(_0x4036ee){if(_0x4036ee){return _0x5c1ffb[_0x91a2('0x16')](_0x28e6b2);}return _0x5c1ffb[_0x91a2('0x17')](_0x28e6b2)[_0x91a2('0x18')]();};}function respondWithResult(_0x47ef9c,_0x4c598c){_0x4c598c=_0x4c598c||0xc8;return function(_0x2b2643){if(_0x2b2643){return _0x47ef9c[_0x91a2('0x17')](_0x4c598c)[_0x91a2('0x19')](_0x2b2643);}};}function respondWithFilteredResult(_0x269b13,_0x12b503){return function(_0x11feda){if(_0x11feda){var _0x22f08e=typeof _0x12b503[_0x91a2('0x1a')]===_0x91a2('0x1b')&&typeof _0x12b503['limit']===_0x91a2('0x1b');var _0x30afaa=_0x11feda[_0x91a2('0x1c')];var _0x4daf3d=_0x22f08e?0x0:_0x12b503[_0x91a2('0x1a')];var _0x19235f=_0x22f08e?_0x11feda[_0x91a2('0x1c')]:_0x12b503['offset']+_0x12b503[_0x91a2('0x1d')];var _0x86647c;if(_0x19235f>=_0x30afaa){_0x19235f=_0x30afaa;_0x86647c=0xc8;}else{_0x86647c=0xce;}_0x269b13['status'](_0x86647c);return _0x269b13['set'](_0x91a2('0x1e'),_0x4daf3d+'-'+_0x19235f+'/'+_0x30afaa)['json'](_0x11feda);}return null;};}function patchUpdates(_0x38881d){return function(_0x3dc7e9){try{jsonpatch[_0x91a2('0x1f')](_0x3dc7e9,_0x38881d,!![]);}catch(_0x305717){return BPromise[_0x91a2('0x20')](_0x305717);}return _0x3dc7e9[_0x91a2('0x21')]();};}function saveUpdates(_0x32b59e,_0x52acb2){return function(_0x546fff){if(_0x546fff){return _0x546fff[_0x91a2('0x22')](_0x32b59e)[_0x91a2('0x23')](function(_0x4757ce){return _0x4757ce;});}return null;};}function removeEntity(_0x19b354,_0x5b9504){return function(_0x3a5017){if(_0x3a5017){return _0x3a5017['destroy']()[_0x91a2('0x23')](function(){_0x19b354['status'](0xcc)[_0x91a2('0x18')]();});}};}function handleEntityNotFound(_0x208d2c,_0x36cc4d){return function(_0x3b306a){if(!_0x3b306a){_0x208d2c['sendStatus'](0x194);}return _0x3b306a;};}function handleError(_0x3586fc,_0x358eb5){_0x358eb5=_0x358eb5||0x1f4;return function(_0x224335){logger[_0x91a2('0x24')](_0x224335['stack']);if(_0x224335[_0x91a2('0x25')]){delete _0x224335[_0x91a2('0x25')];}_0x3586fc[_0x91a2('0x17')](_0x358eb5)['send'](_0x224335);};}exports[_0x91a2('0x26')]=function(_0x2f2fc4,_0x4349c1){var _0x4d230a={},_0x5c030f={},_0x512a6a={'count':0x0,'rows':[]};var _0x4d184e=_[_0x91a2('0x27')](db[_0x91a2('0x28')][_0x91a2('0x29')],function(_0x380bc5){return{'name':_0x380bc5[_0x91a2('0x2a')],'type':_0x380bc5[_0x91a2('0x2b')][_0x91a2('0x2c')]};});_0x5c030f['model']=_[_0x91a2('0x27')](_0x4d184e,'name');_0x5c030f[_0x91a2('0x2d')]=_[_0x91a2('0x2e')](_0x2f2fc4[_0x91a2('0x2d')]);_0x5c030f['filters']=_[_0x91a2('0x2f')](_0x5c030f[_0x91a2('0x30')],_0x5c030f[_0x91a2('0x2d')]);_0x4d230a[_0x91a2('0x31')]=_[_0x91a2('0x2f')](_0x5c030f[_0x91a2('0x30')],qs[_0x91a2('0x32')](_0x2f2fc4[_0x91a2('0x2d')]['fields']));_0x4d230a[_0x91a2('0x31')]=_0x4d230a[_0x91a2('0x31')]['length']?_0x4d230a[_0x91a2('0x31')]:_0x5c030f[_0x91a2('0x30')];if(!_0x2f2fc4[_0x91a2('0x2d')][_0x91a2('0x33')]('nolimit')){_0x4d230a['limit']=qs[_0x91a2('0x1d')](_0x2f2fc4[_0x91a2('0x2d')]['limit']);_0x4d230a[_0x91a2('0x1a')]=qs[_0x91a2('0x1a')](_0x2f2fc4[_0x91a2('0x2d')][_0x91a2('0x1a')]);}_0x4d230a[_0x91a2('0x34')]=qs[_0x91a2('0x35')](_0x2f2fc4[_0x91a2('0x2d')][_0x91a2('0x35')]);_0x4d230a['where']=qs[_0x91a2('0x36')](_[_0x91a2('0x37')](_0x2f2fc4['query'],_0x5c030f[_0x91a2('0x36')]),_0x4d184e);if(_0x2f2fc4['query']['filter']){_0x4d230a[_0x91a2('0x38')]=_[_0x91a2('0x39')](_0x4d230a[_0x91a2('0x38')],{'$or':_[_0x91a2('0x27')](_0x4d184e,function(_0x45e68f){if(_0x45e68f['type']!=='VIRTUAL'){var _0x1860f1={};_0x1860f1[_0x45e68f[_0x91a2('0x25')]]={'$like':'%'+_0x2f2fc4['query'][_0x91a2('0x3a')]+'%'};return _0x1860f1;}})});}_0x4d230a=_[_0x91a2('0x39')]({},_0x4d230a,_0x2f2fc4[_0x91a2('0x3b')]);var _0x292704={'where':_0x4d230a[_0x91a2('0x38')]};return db[_0x91a2('0x28')]['count'](_0x292704)[_0x91a2('0x23')](function(_0x5cd401){_0x512a6a['count']=_0x5cd401;if(_0x2f2fc4['query']['includeAll']){_0x4d230a[_0x91a2('0x3c')]=[{'all':!![]}];}return db[_0x91a2('0x28')][_0x91a2('0x3d')](_0x4d230a);})['then'](function(_0x5e9381){_0x512a6a['rows']=_0x5e9381;return _0x512a6a;})['then'](respondWithFilteredResult(_0x4349c1,_0x4d230a))['catch'](handleError(_0x4349c1,null));};exports[_0x91a2('0x3e')]=function(_0x8863cf,_0x4051ca){var _0x558ce5={'raw':![],'where':{'id':_0x8863cf['params']['id']}},_0x29f7b3={};_0x29f7b3[_0x91a2('0x30')]=_[_0x91a2('0x2e')](db['IntegrationReport'][_0x91a2('0x29')]);_0x29f7b3[_0x91a2('0x2d')]=_['keys'](_0x8863cf['query']);_0x29f7b3[_0x91a2('0x36')]=_[_0x91a2('0x2f')](_0x29f7b3[_0x91a2('0x30')],_0x29f7b3[_0x91a2('0x2d')]);_0x558ce5[_0x91a2('0x31')]=_[_0x91a2('0x2f')](_0x29f7b3[_0x91a2('0x30')],qs['fields'](_0x8863cf[_0x91a2('0x2d')][_0x91a2('0x32')]));_0x558ce5[_0x91a2('0x31')]=_0x558ce5[_0x91a2('0x31')][_0x91a2('0x3f')]?_0x558ce5['attributes']:_0x29f7b3[_0x91a2('0x30')];if(_0x8863cf[_0x91a2('0x2d')][_0x91a2('0x40')]){_0x558ce5[_0x91a2('0x3c')]=[{'all':!![]}];}_0x558ce5=_[_0x91a2('0x39')]({},_0x558ce5,_0x8863cf['options']);return db['IntegrationReport'][_0x91a2('0x41')](_0x558ce5)['then'](handleEntityNotFound(_0x4051ca,null))[_0x91a2('0x23')](respondWithResult(_0x4051ca,null))['catch'](handleError(_0x4051ca,null));};exports[_0x91a2('0x42')]=function(_0x1264b0,_0x4bac7f){return db[_0x91a2('0x28')][_0x91a2('0x42')](_0x1264b0[_0x91a2('0x43')],{})[_0x91a2('0x23')](respondWithResult(_0x4bac7f,0xc9))[_0x91a2('0x44')](handleError(_0x4bac7f,null));};exports[_0x91a2('0x22')]=function(_0x3f19e7,_0x346213){if(_0x3f19e7[_0x91a2('0x43')]['id']){delete _0x3f19e7[_0x91a2('0x43')]['id'];}return db['IntegrationReport'][_0x91a2('0x41')]({'where':{'id':_0x3f19e7['params']['id']}})[_0x91a2('0x23')](handleEntityNotFound(_0x346213,null))['then'](saveUpdates(_0x3f19e7[_0x91a2('0x43')],null))['then'](respondWithResult(_0x346213,null))['catch'](handleError(_0x346213,null));};exports[_0x91a2('0x45')]=function(_0x25dbff,_0x3f0130){return db[_0x91a2('0x28')][_0x91a2('0x41')]({'where':{'id':_0x25dbff[_0x91a2('0x46')]['id']}})[_0x91a2('0x23')](handleEntityNotFound(_0x3f0130,null))[_0x91a2('0x23')](removeEntity(_0x3f0130,null))[_0x91a2('0x44')](handleError(_0x3f0130,null));};exports[_0x91a2('0x47')]=function(_0xe20329,_0x149cac){return db[_0x91a2('0x28')]['describe']()[_0x91a2('0x23')](respondWithResult(_0x149cac,null))[_0x91a2('0x44')](handleError(_0x149cac,null));}; \ No newline at end of file +var _0x5f8e=['pick','filter','where','merge','VIRTUAL','options','then','include','rows','catch','show','keys','includeAll','find','create','body','params','describe','fast-json-patch','moment','mustache','util','path','to-csv','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','sendStatus','error','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','sort','filters'];(function(_0x32585c,_0x51b850){var _0x129ed7=function(_0x599fdf){while(--_0x599fdf){_0x32585c['push'](_0x32585c['shift']());}};_0x129ed7(++_0x51b850);}(_0x5f8e,0x1c2));var _0xe5f8=function(_0x26fc81,_0x57fc19){_0x26fc81=_0x26fc81-0x0;var _0x9feece=_0x5f8e[_0x26fc81];return _0x9feece;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe5f8('0x0'));var rp=require('request-promise');var moment=require(_0xe5f8('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xe5f8('0x2'));var util=require(_0xe5f8('0x3'));var path=require(_0xe5f8('0x4'));var sox=require('sox');var csv=require(_0xe5f8('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe5f8('0x6'));var _=require('lodash');var squel=require(_0xe5f8('0x7'));var crypto=require('crypto');var jsforce=require(_0xe5f8('0x8'));var deskjs=require('desk.js');var toCsv=require(_0xe5f8('0x5'));var querystring=require(_0xe5f8('0x9'));var Papa=require(_0xe5f8('0xa'));var Redis=require(_0xe5f8('0xb'));var authService=require(_0xe5f8('0xc'));var qs=require(_0xe5f8('0xd'));var as=require(_0xe5f8('0xe'));var hardwareService=require(_0xe5f8('0xf'));var logger=require(_0xe5f8('0x10'))('api');var utils=require(_0xe5f8('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xe5f8('0x12'));var db=require(_0xe5f8('0x13'))['db'];function respondWithStatusCode(_0x13d1aa,_0x448935){_0x448935=_0x448935||0xcc;return function(_0x3b940a){if(_0x3b940a){return _0x13d1aa['sendStatus'](_0x448935);}return _0x13d1aa[_0xe5f8('0x14')](_0x448935)[_0xe5f8('0x15')]();};}function respondWithResult(_0x21f3d6,_0x2045bb){_0x2045bb=_0x2045bb||0xc8;return function(_0x250d0b){if(_0x250d0b){return _0x21f3d6['status'](_0x2045bb)[_0xe5f8('0x16')](_0x250d0b);}};}function respondWithFilteredResult(_0x505745,_0x1fe34f){return function(_0x224ef9){if(_0x224ef9){var _0x47d085=typeof _0x1fe34f[_0xe5f8('0x17')]===_0xe5f8('0x18')&&typeof _0x1fe34f[_0xe5f8('0x19')]==='undefined';var _0x16fafc=_0x224ef9[_0xe5f8('0x1a')];var _0x1cda5c=_0x47d085?0x0:_0x1fe34f[_0xe5f8('0x17')];var _0x4918ed=_0x47d085?_0x224ef9[_0xe5f8('0x1a')]:_0x1fe34f['offset']+_0x1fe34f[_0xe5f8('0x19')];var _0x5c912a;if(_0x4918ed>=_0x16fafc){_0x4918ed=_0x16fafc;_0x5c912a=0xc8;}else{_0x5c912a=0xce;}_0x505745[_0xe5f8('0x14')](_0x5c912a);return _0x505745[_0xe5f8('0x1b')](_0xe5f8('0x1c'),_0x1cda5c+'-'+_0x4918ed+'/'+_0x16fafc)[_0xe5f8('0x16')](_0x224ef9);}return null;};}function patchUpdates(_0x58683f){return function(_0x170a28){try{jsonpatch[_0xe5f8('0x1d')](_0x170a28,_0x58683f,!![]);}catch(_0x1a1c4d){return BPromise[_0xe5f8('0x1e')](_0x1a1c4d);}return _0x170a28[_0xe5f8('0x1f')]();};}function saveUpdates(_0x1f457c,_0x68e133){return function(_0x4dd06c){if(_0x4dd06c){return _0x4dd06c[_0xe5f8('0x20')](_0x1f457c)['then'](function(_0x389a6f){return _0x389a6f;});}return null;};}function removeEntity(_0x2f8d9d,_0x4d4f3f){return function(_0x1016b8){if(_0x1016b8){return _0x1016b8['destroy']()['then'](function(){_0x2f8d9d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x553cab,_0x49b824){return function(_0x329faf){if(!_0x329faf){_0x553cab[_0xe5f8('0x21')](0x194);}return _0x329faf;};}function handleError(_0x43e66b,_0x22f21f){_0x22f21f=_0x22f21f||0x1f4;return function(_0x1302cf){logger[_0xe5f8('0x22')](_0x1302cf[_0xe5f8('0x23')]);if(_0x1302cf[_0xe5f8('0x24')]){delete _0x1302cf[_0xe5f8('0x24')];}_0x43e66b['status'](_0x22f21f)[_0xe5f8('0x25')](_0x1302cf);};}exports[_0xe5f8('0x26')]=function(_0xddc5e8,_0x47af7b){var _0x36aa04={},_0x165e9b={},_0xa96ad9={'count':0x0,'rows':[]};var _0x401598=_[_0xe5f8('0x27')](db[_0xe5f8('0x28')][_0xe5f8('0x29')],function(_0x239f9d){return{'name':_0x239f9d[_0xe5f8('0x2a')],'type':_0x239f9d[_0xe5f8('0x2b')][_0xe5f8('0x2c')]};});_0x165e9b[_0xe5f8('0x2d')]=_[_0xe5f8('0x27')](_0x401598,_0xe5f8('0x24'));_0x165e9b['query']=_['keys'](_0xddc5e8['query']);_0x165e9b['filters']=_['intersection'](_0x165e9b[_0xe5f8('0x2d')],_0x165e9b[_0xe5f8('0x2e')]);_0x36aa04[_0xe5f8('0x2f')]=_[_0xe5f8('0x30')](_0x165e9b['model'],qs[_0xe5f8('0x31')](_0xddc5e8[_0xe5f8('0x2e')][_0xe5f8('0x31')]));_0x36aa04[_0xe5f8('0x2f')]=_0x36aa04['attributes'][_0xe5f8('0x32')]?_0x36aa04[_0xe5f8('0x2f')]:_0x165e9b['model'];if(!_0xddc5e8[_0xe5f8('0x2e')][_0xe5f8('0x33')]('nolimit')){_0x36aa04[_0xe5f8('0x19')]=qs['limit'](_0xddc5e8[_0xe5f8('0x2e')][_0xe5f8('0x19')]);_0x36aa04[_0xe5f8('0x17')]=qs['offset'](_0xddc5e8[_0xe5f8('0x2e')][_0xe5f8('0x17')]);}_0x36aa04['order']=qs[_0xe5f8('0x34')](_0xddc5e8[_0xe5f8('0x2e')][_0xe5f8('0x34')]);_0x36aa04['where']=qs[_0xe5f8('0x35')](_[_0xe5f8('0x36')](_0xddc5e8[_0xe5f8('0x2e')],_0x165e9b[_0xe5f8('0x35')]),_0x401598);if(_0xddc5e8[_0xe5f8('0x2e')][_0xe5f8('0x37')]){_0x36aa04[_0xe5f8('0x38')]=_[_0xe5f8('0x39')](_0x36aa04['where'],{'$or':_[_0xe5f8('0x27')](_0x401598,function(_0x3700cd){if(_0x3700cd[_0xe5f8('0x2b')]!==_0xe5f8('0x3a')){var _0x45e7c2={};_0x45e7c2[_0x3700cd[_0xe5f8('0x24')]]={'$like':'%'+_0xddc5e8['query']['filter']+'%'};return _0x45e7c2;}})});}_0x36aa04=_[_0xe5f8('0x39')]({},_0x36aa04,_0xddc5e8[_0xe5f8('0x3b')]);var _0x3e70a3={'where':_0x36aa04[_0xe5f8('0x38')]};return db[_0xe5f8('0x28')][_0xe5f8('0x1a')](_0x3e70a3)[_0xe5f8('0x3c')](function(_0x201c54){_0xa96ad9['count']=_0x201c54;if(_0xddc5e8[_0xe5f8('0x2e')]['includeAll']){_0x36aa04[_0xe5f8('0x3d')]=[{'all':!![]}];}return db[_0xe5f8('0x28')]['findAll'](_0x36aa04);})['then'](function(_0x44c1d4){_0xa96ad9[_0xe5f8('0x3e')]=_0x44c1d4;return _0xa96ad9;})[_0xe5f8('0x3c')](respondWithFilteredResult(_0x47af7b,_0x36aa04))[_0xe5f8('0x3f')](handleError(_0x47af7b,null));};exports[_0xe5f8('0x40')]=function(_0xadb8ac,_0x2dde06){var _0x10ce63={'raw':![],'where':{'id':_0xadb8ac['params']['id']}},_0x1e1c2e={};_0x1e1c2e[_0xe5f8('0x2d')]=_[_0xe5f8('0x41')](db['IntegrationReport']['rawAttributes']);_0x1e1c2e[_0xe5f8('0x2e')]=_[_0xe5f8('0x41')](_0xadb8ac['query']);_0x1e1c2e[_0xe5f8('0x35')]=_[_0xe5f8('0x30')](_0x1e1c2e['model'],_0x1e1c2e['query']);_0x10ce63[_0xe5f8('0x2f')]=_[_0xe5f8('0x30')](_0x1e1c2e[_0xe5f8('0x2d')],qs[_0xe5f8('0x31')](_0xadb8ac[_0xe5f8('0x2e')][_0xe5f8('0x31')]));_0x10ce63[_0xe5f8('0x2f')]=_0x10ce63['attributes'][_0xe5f8('0x32')]?_0x10ce63[_0xe5f8('0x2f')]:_0x1e1c2e[_0xe5f8('0x2d')];if(_0xadb8ac[_0xe5f8('0x2e')][_0xe5f8('0x42')]){_0x10ce63[_0xe5f8('0x3d')]=[{'all':!![]}];}_0x10ce63=_[_0xe5f8('0x39')]({},_0x10ce63,_0xadb8ac['options']);return db[_0xe5f8('0x28')][_0xe5f8('0x43')](_0x10ce63)[_0xe5f8('0x3c')](handleEntityNotFound(_0x2dde06,null))[_0xe5f8('0x3c')](respondWithResult(_0x2dde06,null))[_0xe5f8('0x3f')](handleError(_0x2dde06,null));};exports[_0xe5f8('0x44')]=function(_0x4a9826,_0x510abc){return db[_0xe5f8('0x28')][_0xe5f8('0x44')](_0x4a9826[_0xe5f8('0x45')],{})[_0xe5f8('0x3c')](respondWithResult(_0x510abc,0xc9))[_0xe5f8('0x3f')](handleError(_0x510abc,null));};exports[_0xe5f8('0x20')]=function(_0x56ee60,_0x1c606b){if(_0x56ee60[_0xe5f8('0x45')]['id']){delete _0x56ee60[_0xe5f8('0x45')]['id'];}return db['IntegrationReport']['find']({'where':{'id':_0x56ee60[_0xe5f8('0x46')]['id']}})[_0xe5f8('0x3c')](handleEntityNotFound(_0x1c606b,null))[_0xe5f8('0x3c')](saveUpdates(_0x56ee60[_0xe5f8('0x45')],null))['then'](respondWithResult(_0x1c606b,null))[_0xe5f8('0x3f')](handleError(_0x1c606b,null));};exports['destroy']=function(_0x53dba0,_0x3a362a){return db[_0xe5f8('0x28')][_0xe5f8('0x43')]({'where':{'id':_0x53dba0['params']['id']}})['then'](handleEntityNotFound(_0x3a362a,null))['then'](removeEntity(_0x3a362a,null))['catch'](handleError(_0x3a362a,null));};exports[_0xe5f8('0x47')]=function(_0x5935cd,_0x59dfa3){return db[_0xe5f8('0x28')][_0xe5f8('0x47')]()[_0xe5f8('0x3c')](respondWithResult(_0x59dfa3,null))[_0xe5f8('0x3f')](handleError(_0x59dfa3,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 63f43c3..8a0ce8b 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 _0x5c16=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','IntegrationReport','report_integration','lodash','util'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0x5c16,0x196));var _0x65c1=function(_0x407fa8,_0x47fe74){_0x407fa8=_0x407fa8-0x0;var _0x5d748e=_0x5c16[_0x407fa8];return _0x5d748e;};'use strict';var _=require(_0x65c1('0x0'));var util=require(_0x65c1('0x1'));var logger=require(_0x65c1('0x2'))('api');var moment=require(_0x65c1('0x3'));var BPromise=require(_0x65c1('0x4'));var rp=require(_0x65c1('0x5'));var fs=require('fs');var path=require(_0x65c1('0x6'));var rimraf=require(_0x65c1('0x7'));var config=require(_0x65c1('0x8'));var attributes=require(_0x65c1('0x9'));module['exports']=function(_0x290bf0,_0x11733b){return _0x290bf0['define'](_0x65c1('0xa'),attributes,{'tableName':_0x65c1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf66c=['../../config/environment','define','IntegrationReport','report_integration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x371b93,_0xef6ac8){var _0x259b8d=function(_0x3d0c86){while(--_0x3d0c86){_0x371b93['push'](_0x371b93['shift']());}};_0x259b8d(++_0xef6ac8);}(_0xf66c,0x160));var _0xcf66=function(_0x3d335c,_0x3ebe8b){_0x3d335c=_0x3d335c-0x0;var _0x3753cc=_0xf66c[_0x3d335c];return _0x3753cc;};'use strict';var _=require(_0xcf66('0x0'));var util=require(_0xcf66('0x1'));var logger=require(_0xcf66('0x2'))(_0xcf66('0x3'));var moment=require(_0xcf66('0x4'));var BPromise=require(_0xcf66('0x5'));var rp=require(_0xcf66('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcf66('0x7'));var config=require(_0xcf66('0x8'));var attributes=require('./integrationReport.attributes');module['exports']=function(_0x4468c1,_0x4412fa){return _0x4468c1[_0xcf66('0x9')](_0xcf66('0xa'),attributes,{'tableName':_0xcf66('0xb'),'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 6ed42d1..e337254 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 _0x814b=['info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\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(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x814b,0x1a2));var _0xb814=function(_0x2e030a,_0x8e4c48){_0x2e030a=_0x2e030a-0x0;var _0x597df6=_0x814b[_0x2e030a];return _0x597df6;};'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')]('IntegrationReport,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});} \ No newline at end of file +var _0xda19=['error','message','info','result','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1459de,_0x5826d5){var _0x4f94f9=function(_0x37b016){while(--_0x37b016){_0x1459de['push'](_0x1459de['shift']());}};_0x4f94f9(++_0x5826d5);}(_0xda19,0xd5));var _0x9da1=function(_0x8559d4,_0x4d4346){_0x8559d4=_0x8559d4-0x0;var _0x54c7d5=_0xda19[_0x8559d4];return _0x54c7d5;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var moment=require(_0x9da1('0x1'));var BPromise=require('bluebird');var rs=require(_0x9da1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9da1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9da1('0x4'))(_0x9da1('0x5'));var config=require(_0x9da1('0x6'));var jayson=require(_0x9da1('0x7'));var client=jayson[_0x9da1('0x8')][_0x9da1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23e4f7,_0x2c3cdd,_0x1c24e6){return new BPromise(function(_0x5e2d18,_0x47df89){return client['request'](_0x23e4f7,_0x1c24e6)['then'](function(_0x417312){logger['info'](_0x9da1('0xa'),_0x2c3cdd,_0x9da1('0xb'));logger[_0x9da1('0xc')](_0x9da1('0xd'),_0x2c3cdd,_0x9da1('0xb'),JSON[_0x9da1('0xe')](_0x417312));if(_0x417312[_0x9da1('0xf')]){if(_0x417312['error']['code']===0x1f4){logger[_0x9da1('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x2c3cdd,_0x417312[_0x9da1('0xf')][_0x9da1('0x10')]);return _0x47df89(_0x417312[_0x9da1('0xf')][_0x9da1('0x10')]);}logger['error'](_0x9da1('0xa'),_0x2c3cdd,_0x417312['error']['message']);return _0x5e2d18(_0x417312[_0x9da1('0xf')]['message']);}else{logger[_0x9da1('0x11')](_0x9da1('0xa'),_0x2c3cdd,_0x9da1('0xb'));_0x5e2d18(_0x417312[_0x9da1('0x12')][_0x9da1('0x10')]);}})['catch'](function(_0x16f75a){logger[_0x9da1('0xf')](_0x9da1('0xa'),_0x2c3cdd,_0x16f75a);_0x47df89(_0x16f75a);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 74e8ed1..b7ac0b3 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 _0x2f7e=['./interval.controller','get','isAuthenticated','/:id','show','/:id/sub_intervals','post','addInterval','addIntervals','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2ac5f8,_0x4c3a9f){var _0x3b8229=function(_0x46a3c0){while(--_0x46a3c0){_0x2ac5f8['push'](_0x2ac5f8['shift']());}};_0x3b8229(++_0x4c3a9f);}(_0x2f7e,0x122));var _0xe2f7=function(_0x26be50,_0x624f9){_0x26be50=_0x26be50-0x0;var _0x4eee49=_0x2f7e[_0x26be50];return _0x4eee49;};'use strict';var multer=require(_0xe2f7('0x0'));var util=require(_0xe2f7('0x1'));var path=require('path');var timeout=require(_0xe2f7('0x2'));var express=require(_0xe2f7('0x3'));var router=express[_0xe2f7('0x4')]();var fs_extra=require(_0xe2f7('0x5'));var auth=require(_0xe2f7('0x6'));var interaction=require(_0xe2f7('0x7'));var config=require(_0xe2f7('0x8'));var controller=require(_0xe2f7('0x9'));router[_0xe2f7('0xa')]('/',auth[_0xe2f7('0xb')](),controller['index']);router[_0xe2f7('0xa')](_0xe2f7('0xc'),auth[_0xe2f7('0xb')](),controller[_0xe2f7('0xd')]);router[_0xe2f7('0xa')](_0xe2f7('0xe'),auth['isAuthenticated'](),controller['getIntervals']);router[_0xe2f7('0xf')]('/',auth[_0xe2f7('0xb')](),controller['create']);router[_0xe2f7('0xf')](_0xe2f7('0xe'),auth[_0xe2f7('0xb')](),controller[_0xe2f7('0x10')]);router[_0xe2f7('0xf')]('/:id/sub_intervals/create_many',auth['isAuthenticated'](),controller[_0xe2f7('0x11')]);router[_0xe2f7('0x12')]('/:id',auth[_0xe2f7('0xb')](),controller[_0xe2f7('0x13')]);router[_0xe2f7('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xe2f7('0x15')]);module[_0xe2f7('0x16')]=router; \ No newline at end of file +var _0xb8ba=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','index','/:id','show','/:id/sub_intervals','post','isAuthenticated','create','addInterval','/:id/sub_intervals/create_many','addIntervals','delete','multer'];(function(_0x8fca2e,_0x15a9cb){var _0x5513ab=function(_0xeed7f1){while(--_0xeed7f1){_0x8fca2e['push'](_0x8fca2e['shift']());}};_0x5513ab(++_0x15a9cb);}(_0xb8ba,0x6d));var _0xab8b=function(_0x46a9c8,_0x4b4780){_0x46a9c8=_0x46a9c8-0x0;var _0x9bd93f=_0xb8ba[_0x46a9c8];return _0x9bd93f;};'use strict';var multer=require(_0xab8b('0x0'));var util=require(_0xab8b('0x1'));var path=require(_0xab8b('0x2'));var timeout=require('connect-timeout');var express=require(_0xab8b('0x3'));var router=express[_0xab8b('0x4')]();var fs_extra=require(_0xab8b('0x5'));var auth=require(_0xab8b('0x6'));var interaction=require(_0xab8b('0x7'));var config=require(_0xab8b('0x8'));var controller=require(_0xab8b('0x9'));router[_0xab8b('0xa')]('/',auth['isAuthenticated'](),controller[_0xab8b('0xb')]);router['get'](_0xab8b('0xc'),auth['isAuthenticated'](),controller[_0xab8b('0xd')]);router[_0xab8b('0xa')](_0xab8b('0xe'),auth['isAuthenticated'](),controller['getIntervals']);router[_0xab8b('0xf')]('/',auth[_0xab8b('0x10')](),controller[_0xab8b('0x11')]);router[_0xab8b('0xf')](_0xab8b('0xe'),auth[_0xab8b('0x10')](),controller[_0xab8b('0x12')]);router[_0xab8b('0xf')](_0xab8b('0x13'),auth[_0xab8b('0x10')](),controller[_0xab8b('0x14')]);router['put'](_0xab8b('0xc'),auth[_0xab8b('0x10')](),controller['update']);router[_0xab8b('0x15')](_0xab8b('0xc'),auth[_0xab8b('0x10')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 3bf6b70..2d95f36 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 _0x09f8=['exports','STRING','sequelize'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x09f8,0x113));var _0x809f=function(_0x449afb,_0x2ac4e6){_0x449afb=_0x449afb-0x0;var _0x496760=_0x09f8[_0x449afb];return _0x496760;};'use strict';var Sequelize=require(_0x809f('0x0'));module[_0x809f('0x1')]={'name':{'type':Sequelize[_0x809f('0x2')]},'description':{'type':Sequelize[_0x809f('0x2')]},'interval':{'type':Sequelize[_0x809f('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xe88c=['STRING','sequelize','exports'];(function(_0x3b8a08,_0x5d3d23){var _0x32d8d9=function(_0x5dfb95){while(--_0x5dfb95){_0x3b8a08['push'](_0x3b8a08['shift']());}};_0x32d8d9(++_0x5d3d23);}(_0xe88c,0xac));var _0xce88=function(_0x19f8ee,_0x3e08c2){_0x19f8ee=_0x19f8ee-0x0;var _0x3b68f2=_0xe88c[_0x19f8ee];return _0x3b68f2;};'use strict';var Sequelize=require(_0xce88('0x0'));module[_0xce88('0x1')]={'name':{'type':Sequelize[_0xce88('0x2')]},'description':{'type':Sequelize[_0xce88('0x2')]},'interval':{'type':Sequelize[_0xce88('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index e564ecb..eeee9a9 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 _0x7982=['count','Content-Range','apply','save','update','then','get','UserProfileResource','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','Interval','rows','catch','show','params','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Intervals','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','addInterval','IntervalId','getIntervals','findOne','addIntervals','sequelize','transaction','bulkCreate','zip-dir','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','status','end','json','offset','limit','undefined'];(function(_0x4a7e98,_0x250137){var _0x27d10d=function(_0x378768){while(--_0x378768){_0x4a7e98['push'](_0x4a7e98['shift']());}};_0x27d10d(++_0x250137);}(_0x7982,0x149));var _0x2798=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0x7982[_0x125ff8];return _0x2d9ef;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2798('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2798('0x1'));var moment=require(_0x2798('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x2798('0x3'));var util=require('util');var path=require(_0x2798('0x4'));var sox=require(_0x2798('0x5'));var csv=require(_0x2798('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2798('0x7'));var _=require(_0x2798('0x8'));var squel=require('squel');var crypto=require(_0x2798('0x9'));var jsforce=require(_0x2798('0xa'));var deskjs=require(_0x2798('0xb'));var toCsv=require(_0x2798('0x6'));var querystring=require(_0x2798('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2798('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2798('0xe'))(_0x2798('0xf'));var utils=require(_0x2798('0x10'));var config=require(_0x2798('0x11'));var licenseUtil=require(_0x2798('0x12'));var db=require(_0x2798('0x13'))['db'];var extensions=require(_0x2798('0x14'));function respondWithStatusCode(_0x20ef34,_0x3e4256){_0x3e4256=_0x3e4256||0xcc;return function(_0x4fb839){if(_0x4fb839){return _0x20ef34['sendStatus'](_0x3e4256);}return _0x20ef34[_0x2798('0x15')](_0x3e4256)[_0x2798('0x16')]();};}function respondWithResult(_0x2798fe,_0x32e71b){_0x32e71b=_0x32e71b||0xc8;return function(_0x321a24){if(_0x321a24){return _0x2798fe['status'](_0x32e71b)[_0x2798('0x17')](_0x321a24);}};}function respondWithFilteredResult(_0x58750a,_0x304ed3){return function(_0x24f2a8){if(_0x24f2a8){var _0x149fb1=typeof _0x304ed3[_0x2798('0x18')]==='undefined'&&typeof _0x304ed3[_0x2798('0x19')]===_0x2798('0x1a');var _0x51765a=_0x24f2a8['count'];var _0x14556d=_0x149fb1?0x0:_0x304ed3[_0x2798('0x18')];var _0x2f2453=_0x149fb1?_0x24f2a8[_0x2798('0x1b')]:_0x304ed3[_0x2798('0x18')]+_0x304ed3['limit'];var _0x1c3302;if(_0x2f2453>=_0x51765a){_0x2f2453=_0x51765a;_0x1c3302=0xc8;}else{_0x1c3302=0xce;}_0x58750a[_0x2798('0x15')](_0x1c3302);return _0x58750a['set'](_0x2798('0x1c'),_0x14556d+'-'+_0x2f2453+'/'+_0x51765a)[_0x2798('0x17')](_0x24f2a8);}return null;};}function patchUpdates(_0x5c279e){return function(_0x2e8484){try{jsonpatch[_0x2798('0x1d')](_0x2e8484,_0x5c279e,!![]);}catch(_0x50b6a5){return BPromise['reject'](_0x50b6a5);}return _0x2e8484[_0x2798('0x1e')]();};}function saveUpdates(_0x8f11d0,_0x3bc530){return function(_0xb7f034){if(_0xb7f034){return _0xb7f034[_0x2798('0x1f')](_0x8f11d0)['then'](function(_0x50cc82){return _0x50cc82;});}return null;};}function removeEntity(_0x1c56b9,_0xfffc58){return function(_0x94ae93){if(_0x94ae93){return _0x94ae93['destroy']()[_0x2798('0x20')](function(){var _0x447cf9=_0x94ae93[_0x2798('0x21')]({'plain':!![]});var _0x435e80='Intervals';return db[_0x2798('0x22')]['destroy']({'where':{'type':_0x435e80,'resourceId':_0x447cf9['id']}})[_0x2798('0x20')](function(){return _0x94ae93;});})[_0x2798('0x20')](function(){_0x1c56b9[_0x2798('0x15')](0xcc)[_0x2798('0x16')]();});}};}function handleEntityNotFound(_0x9011a8,_0x2c613f){return function(_0x165aee){if(!_0x165aee){_0x9011a8[_0x2798('0x23')](0x194);}return _0x165aee;};}function handleError(_0x41e288,_0x34815d){_0x34815d=_0x34815d||0x1f4;return function(_0x3f0132){logger[_0x2798('0x24')](_0x3f0132[_0x2798('0x25')]);if(_0x3f0132[_0x2798('0x26')]){delete _0x3f0132['name'];}_0x41e288[_0x2798('0x15')](_0x34815d)[_0x2798('0x27')](_0x3f0132);};}exports[_0x2798('0x28')]=function(_0x3a1bdf,_0x2171de){var _0x511112={},_0x514838={},_0x1fc3dd={'count':0x0,'rows':[]};var _0x2c537d=_['map'](db['Interval'][_0x2798('0x29')],function(_0x591f24){return{'name':_0x591f24[_0x2798('0x2a')],'type':_0x591f24[_0x2798('0x2b')][_0x2798('0x2c')]};});_0x514838[_0x2798('0x2d')]=_[_0x2798('0x2e')](_0x2c537d,'name');_0x514838[_0x2798('0x2f')]=_[_0x2798('0x30')](_0x3a1bdf[_0x2798('0x2f')]);_0x514838[_0x2798('0x31')]=_[_0x2798('0x32')](_0x514838['model'],_0x514838[_0x2798('0x2f')]);_0x511112[_0x2798('0x33')]=_['intersection'](_0x514838['model'],qs[_0x2798('0x34')](_0x3a1bdf[_0x2798('0x2f')][_0x2798('0x34')]));_0x511112[_0x2798('0x33')]=_0x511112[_0x2798('0x33')]['length']?_0x511112[_0x2798('0x33')]:_0x514838['model'];if(!_0x3a1bdf[_0x2798('0x2f')]['hasOwnProperty'](_0x2798('0x35'))){_0x511112[_0x2798('0x19')]=qs['limit'](_0x3a1bdf[_0x2798('0x2f')]['limit']);_0x511112[_0x2798('0x18')]=qs[_0x2798('0x18')](_0x3a1bdf[_0x2798('0x2f')][_0x2798('0x18')]);}_0x511112[_0x2798('0x36')]=qs[_0x2798('0x37')](_0x3a1bdf[_0x2798('0x2f')][_0x2798('0x37')]);_0x511112['where']=qs[_0x2798('0x31')](_[_0x2798('0x38')](_0x3a1bdf[_0x2798('0x2f')],_0x514838[_0x2798('0x31')]),_0x2c537d);if(_0x3a1bdf[_0x2798('0x2f')][_0x2798('0x39')]){_0x511112[_0x2798('0x3a')]=_[_0x2798('0x3b')](_0x511112[_0x2798('0x3a')],{'$or':_[_0x2798('0x2e')](_0x2c537d,function(_0x1010bd){if(_0x1010bd['type']!==_0x2798('0x3c')){var _0x5b9095={};_0x5b9095[_0x1010bd[_0x2798('0x26')]]={'$like':'%'+_0x3a1bdf['query']['filter']+'%'};return _0x5b9095;}})});}_0x511112=_['merge']({},_0x511112,_0x3a1bdf[_0x2798('0x3d')]);var _0x18a294={'where':_0x511112[_0x2798('0x3a')]};return db['Interval'][_0x2798('0x1b')](_0x18a294)[_0x2798('0x20')](function(_0x4adb10){_0x1fc3dd[_0x2798('0x1b')]=_0x4adb10;if(_0x3a1bdf[_0x2798('0x2f')][_0x2798('0x3e')]){_0x511112['include']=[{'all':!![]}];}return db[_0x2798('0x3f')]['findAll'](_0x511112);})['then'](function(_0xa96f25){_0x1fc3dd[_0x2798('0x40')]=_0xa96f25;return _0x1fc3dd;})[_0x2798('0x20')](respondWithFilteredResult(_0x2171de,_0x511112))[_0x2798('0x41')](handleError(_0x2171de,null));};exports[_0x2798('0x42')]=function(_0x57c5de,_0xcbca09){var _0x1097ac={'raw':!![],'where':{'id':_0x57c5de[_0x2798('0x43')]['id']}},_0x4e35be={};_0x4e35be[_0x2798('0x2d')]=_[_0x2798('0x30')](db[_0x2798('0x3f')][_0x2798('0x29')]);_0x4e35be['query']=_['keys'](_0x57c5de['query']);_0x4e35be[_0x2798('0x31')]=_['intersection'](_0x4e35be[_0x2798('0x2d')],_0x4e35be[_0x2798('0x2f')]);_0x1097ac[_0x2798('0x33')]=_[_0x2798('0x32')](_0x4e35be[_0x2798('0x2d')],qs[_0x2798('0x34')](_0x57c5de[_0x2798('0x2f')]['fields']));_0x1097ac[_0x2798('0x33')]=_0x1097ac[_0x2798('0x33')][_0x2798('0x44')]?_0x1097ac['attributes']:_0x4e35be[_0x2798('0x2d')];if(_0x57c5de[_0x2798('0x2f')][_0x2798('0x3e')]){_0x1097ac['include']=[{'all':!![]}];}_0x1097ac=_[_0x2798('0x3b')]({},_0x1097ac,_0x57c5de[_0x2798('0x3d')]);return db[_0x2798('0x3f')][_0x2798('0x45')](_0x1097ac)['then'](handleEntityNotFound(_0xcbca09,null))[_0x2798('0x20')](respondWithResult(_0xcbca09,null))[_0x2798('0x41')](handleError(_0xcbca09,null));};exports[_0x2798('0x46')]=function(_0xdefa31,_0x1b14fb){return db[_0x2798('0x3f')][_0x2798('0x46')](_0xdefa31[_0x2798('0x47')],{})['then'](function(_0x5a0b88){var _0x7c83a0=_0xdefa31['user'][_0x2798('0x21')]({'plain':!![]});if(!_0x7c83a0)throw new Error(_0x2798('0x48'));if(_0x7c83a0[_0x2798('0x49')]===_0x2798('0x4a')){var _0x30cb29=_0x5a0b88['get']({'plain':!![]});var _0x514ebc=_0x2798('0x4b');return db[_0x2798('0x4c')][_0x2798('0x45')]({'where':{'name':_0x514ebc,'userProfileId':_0x7c83a0[_0x2798('0x4d')]},'raw':!![]})[_0x2798('0x20')](function(_0x4700f9){if(_0x4700f9&&_0x4700f9[_0x2798('0x4e')]===0x0){return db['UserProfileResource'][_0x2798('0x46')]({'name':_0x30cb29['name'],'resourceId':_0x30cb29['id'],'type':_0x4700f9[_0x2798('0x26')],'sectionId':_0x4700f9['id']},{})[_0x2798('0x20')](function(){return _0x5a0b88;});}else{return _0x5a0b88;}})[_0x2798('0x41')](function(_0x341de7){logger[_0x2798('0x24')](_0x2798('0x4f'),_0x341de7);throw _0x341de7;});}return _0x5a0b88;})[_0x2798('0x20')](respondWithResult(_0x1b14fb,0xc9))['catch'](handleError(_0x1b14fb,null));};exports[_0x2798('0x1f')]=function(_0x4e337d,_0xa71d81){if(_0x4e337d[_0x2798('0x47')]['id']){delete _0x4e337d[_0x2798('0x47')]['id'];}return db['Interval'][_0x2798('0x45')]({'where':{'id':_0x4e337d['params']['id']}})[_0x2798('0x20')](handleEntityNotFound(_0xa71d81,null))['then'](saveUpdates(_0x4e337d[_0x2798('0x47')],null))[_0x2798('0x20')](respondWithResult(_0xa71d81,null))[_0x2798('0x41')](handleError(_0xa71d81,null));};exports[_0x2798('0x50')]=function(_0xef3e87,_0x3d3fa4){return db[_0x2798('0x3f')][_0x2798('0x45')]({'where':{'id':_0xef3e87['params']['id']}})[_0x2798('0x20')](handleEntityNotFound(_0x3d3fa4,null))[_0x2798('0x20')](removeEntity(_0x3d3fa4,null))[_0x2798('0x41')](handleError(_0x3d3fa4,null));};exports[_0x2798('0x51')]=function(_0x5c72f5,_0x5210b9,_0x1d1671){if(_0x5c72f5['body']['id']){delete _0x5c72f5[_0x2798('0x47')]['id'];}return db[_0x2798('0x3f')][_0x2798('0x45')]({'where':{'id':_0x5c72f5['params']['id']}})[_0x2798('0x20')](handleEntityNotFound(_0x5210b9,null))[_0x2798('0x20')](function(_0x90c432){if(_0x90c432){_0x5c72f5[_0x2798('0x47')][_0x2798('0x52')]=_0x90c432['id'];return db[_0x2798('0x3f')][_0x2798('0x46')](_0x5c72f5[_0x2798('0x47')]);}})[_0x2798('0x20')](respondWithResult(_0x5210b9,null))[_0x2798('0x41')](handleError(_0x5210b9,null));};exports[_0x2798('0x53')]=function(_0x23762e,_0x35d8d5,_0x20f088){var _0x42ae0c={};var _0x2950bc={};var _0x32c587;var _0x4b801f;return db['Interval'][_0x2798('0x54')]({'where':{'id':_0x23762e[_0x2798('0x43')]['id']}})[_0x2798('0x20')](handleEntityNotFound(_0x35d8d5,null))[_0x2798('0x20')](function(_0x17b1f3){if(_0x17b1f3){_0x32c587=_0x17b1f3;_0x2950bc[_0x2798('0x2d')]=_[_0x2798('0x30')](db[_0x2798('0x3f')][_0x2798('0x29')]);_0x2950bc[_0x2798('0x2f')]=_['keys'](_0x23762e[_0x2798('0x2f')]);_0x2950bc['filters']=_[_0x2798('0x32')](_0x2950bc[_0x2798('0x2d')],_0x2950bc[_0x2798('0x2f')]);_0x42ae0c[_0x2798('0x33')]=_[_0x2798('0x32')](_0x2950bc[_0x2798('0x2d')],qs[_0x2798('0x34')](_0x23762e[_0x2798('0x2f')][_0x2798('0x34')]));_0x42ae0c['attributes']=_0x42ae0c[_0x2798('0x33')][_0x2798('0x44')]?_0x42ae0c['attributes']:_0x2950bc[_0x2798('0x2d')];_0x42ae0c[_0x2798('0x36')]=qs['sort'](_0x23762e['query'][_0x2798('0x37')]);_0x42ae0c[_0x2798('0x3a')]=qs[_0x2798('0x31')](_['pick'](_0x23762e[_0x2798('0x2f')],_0x2950bc['filters']));if(_0x23762e[_0x2798('0x2f')][_0x2798('0x39')]){_0x42ae0c[_0x2798('0x3a')]=_[_0x2798('0x3b')](_0x42ae0c[_0x2798('0x3a')],{'$or':_[_0x2798('0x2e')](_0x42ae0c[_0x2798('0x33')],function(_0x5f57b5){var _0x224e14={};_0x224e14[_0x5f57b5]={'$like':'%'+_0x23762e[_0x2798('0x2f')][_0x2798('0x39')]+'%'};return _0x224e14;})});}_0x42ae0c=_['merge']({},_0x42ae0c,_0x23762e['options']);return _0x32c587['getIntervals'](_0x42ae0c);}})[_0x2798('0x20')](function(_0x13636c){if(_0x13636c){_0x4b801f=_0x13636c[_0x2798('0x44')];if(!_0x23762e[_0x2798('0x2f')]['hasOwnProperty']('nolimit')){_0x42ae0c['limit']=qs[_0x2798('0x19')](_0x23762e['query'][_0x2798('0x19')]);_0x42ae0c[_0x2798('0x18')]=qs[_0x2798('0x18')](_0x23762e[_0x2798('0x2f')][_0x2798('0x18')]);}return _0x32c587[_0x2798('0x53')](_0x42ae0c);}})[_0x2798('0x20')](function(_0x1487b0){if(_0x1487b0){return _0x1487b0?{'count':_0x4b801f,'rows':_0x1487b0}:null;}})['then'](respondWithResult(_0x35d8d5,null))['catch'](handleError(_0x35d8d5,null));};exports[_0x2798('0x55')]=function(_0x13d685,_0x6eac61,_0x1776f0){return db[_0x2798('0x3f')][_0x2798('0x54')]({'where':{'id':_0x13d685[_0x2798('0x43')]['id']}})[_0x2798('0x20')](handleEntityNotFound(_0x6eac61,null))[_0x2798('0x20')](function(_0x29d8a4){if(_0x29d8a4){return db[_0x2798('0x56')][_0x2798('0x57')](function(_0x34cfe7){return db['Interval']['destroy']({'where':{'IntervalId':_0x13d685[_0x2798('0x43')]['id']},'transaction':_0x34cfe7})[_0x2798('0x20')](function(_0x409f09){var _0x425ad6=_['map'](_0x13d685[_0x2798('0x47')],function(_0x4dc9bc){delete _0x4dc9bc['id'];_0x4dc9bc[_0x2798('0x52')]=_0x13d685[_0x2798('0x43')]['id'];return _0x4dc9bc;});return db[_0x2798('0x3f')][_0x2798('0x58')](_0x425ad6,{'transaction':_0x34cfe7});});})[_0x2798('0x20')](function(){return db[_0x2798('0x3f')]['findAll']({'where':{'IntervalId':_0x13d685['params']['id']}});});}})[_0x2798('0x20')](respondWithResult(_0x6eac61,null))['catch'](handleError(_0x6eac61,null));}; \ No newline at end of file +var _0x7529=['Interval','rawAttributes','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','catch','show','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addInterval','IntervalId','getIntervals','pick','findOne','sequelize','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','end','json','undefined','count','offset','limit','status','Content-Range','reject','save','update','then','destroy','get','Intervals','error','stack','name','send','index','map'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x7529,0x199));var _0x9752=function(_0x1c7d1f,_0x57b8f5){_0x1c7d1f=_0x1c7d1f-0x0;var _0x589be8=_0x7529[_0x1c7d1f];return _0x589be8;};'use strict';var emlformat=require(_0x9752('0x0'));var rimraf=require(_0x9752('0x1'));var zipdir=require(_0x9752('0x2'));var jsonpatch=require(_0x9752('0x3'));var rp=require(_0x9752('0x4'));var moment=require(_0x9752('0x5'));var BPromise=require(_0x9752('0x6'));var Mustache=require(_0x9752('0x7'));var util=require(_0x9752('0x8'));var path=require(_0x9752('0x9'));var sox=require(_0x9752('0xa'));var csv=require('to-csv');var ejs=require(_0x9752('0xb'));var fs=require('fs');var fs_extra=require(_0x9752('0xc'));var _=require(_0x9752('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9752('0xe'));var deskjs=require(_0x9752('0xf'));var toCsv=require(_0x9752('0x10'));var querystring=require(_0x9752('0x11'));var Papa=require(_0x9752('0x12'));var Redis=require(_0x9752('0x13'));var authService=require(_0x9752('0x14'));var qs=require(_0x9752('0x15'));var as=require(_0x9752('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9752('0x17'))(_0x9752('0x18'));var utils=require(_0x9752('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x9752('0x1a'));var db=require(_0x9752('0x1b'))['db'];var extensions=require(_0x9752('0x1c'));function respondWithStatusCode(_0x4789c9,_0x1c0897){_0x1c0897=_0x1c0897||0xcc;return function(_0x236060){if(_0x236060){return _0x4789c9[_0x9752('0x1d')](_0x1c0897);}return _0x4789c9['status'](_0x1c0897)[_0x9752('0x1e')]();};}function respondWithResult(_0x25b0f4,_0x2d131b){_0x2d131b=_0x2d131b||0xc8;return function(_0x3f1bdf){if(_0x3f1bdf){return _0x25b0f4['status'](_0x2d131b)[_0x9752('0x1f')](_0x3f1bdf);}};}function respondWithFilteredResult(_0x18c7a0,_0x541f16){return function(_0x37ee4f){if(_0x37ee4f){var _0x3cec32=typeof _0x541f16['offset']===_0x9752('0x20')&&typeof _0x541f16['limit']===_0x9752('0x20');var _0x54b252=_0x37ee4f[_0x9752('0x21')];var _0x647828=_0x3cec32?0x0:_0x541f16['offset'];var _0x59998a=_0x3cec32?_0x37ee4f[_0x9752('0x21')]:_0x541f16[_0x9752('0x22')]+_0x541f16[_0x9752('0x23')];var _0x41ee09;if(_0x59998a>=_0x54b252){_0x59998a=_0x54b252;_0x41ee09=0xc8;}else{_0x41ee09=0xce;}_0x18c7a0[_0x9752('0x24')](_0x41ee09);return _0x18c7a0['set'](_0x9752('0x25'),_0x647828+'-'+_0x59998a+'/'+_0x54b252)['json'](_0x37ee4f);}return null;};}function patchUpdates(_0x2f5f0f){return function(_0xb6e2d){try{jsonpatch['apply'](_0xb6e2d,_0x2f5f0f,!![]);}catch(_0x51a875){return BPromise[_0x9752('0x26')](_0x51a875);}return _0xb6e2d[_0x9752('0x27')]();};}function saveUpdates(_0x1537ab,_0x480a6f){return function(_0x3783de){if(_0x3783de){return _0x3783de[_0x9752('0x28')](_0x1537ab)[_0x9752('0x29')](function(_0x2ef33e){return _0x2ef33e;});}return null;};}function removeEntity(_0x1bc20d,_0x5ce2f4){return function(_0xa9cda5){if(_0xa9cda5){return _0xa9cda5[_0x9752('0x2a')]()[_0x9752('0x29')](function(){var _0x4101f0=_0xa9cda5[_0x9752('0x2b')]({'plain':!![]});var _0x21abb8=_0x9752('0x2c');return db['UserProfileResource'][_0x9752('0x2a')]({'where':{'type':_0x21abb8,'resourceId':_0x4101f0['id']}})[_0x9752('0x29')](function(){return _0xa9cda5;});})['then'](function(){_0x1bc20d[_0x9752('0x24')](0xcc)[_0x9752('0x1e')]();});}};}function handleEntityNotFound(_0x39000c,_0x21fcb8){return function(_0x34fff5){if(!_0x34fff5){_0x39000c[_0x9752('0x1d')](0x194);}return _0x34fff5;};}function handleError(_0x23d0e2,_0x32132b){_0x32132b=_0x32132b||0x1f4;return function(_0x554144){logger[_0x9752('0x2d')](_0x554144[_0x9752('0x2e')]);if(_0x554144['name']){delete _0x554144[_0x9752('0x2f')];}_0x23d0e2[_0x9752('0x24')](_0x32132b)[_0x9752('0x30')](_0x554144);};}exports[_0x9752('0x31')]=function(_0x498468,_0x2e2c7d){var _0x225765={},_0x2b8c9c={},_0x2a05ce={'count':0x0,'rows':[]};var _0x270f36=_[_0x9752('0x32')](db[_0x9752('0x33')][_0x9752('0x34')],function(_0x3de60b){return{'name':_0x3de60b['fieldName'],'type':_0x3de60b[_0x9752('0x35')][_0x9752('0x36')]};});_0x2b8c9c['model']=_['map'](_0x270f36,'name');_0x2b8c9c[_0x9752('0x37')]=_[_0x9752('0x38')](_0x498468['query']);_0x2b8c9c[_0x9752('0x39')]=_[_0x9752('0x3a')](_0x2b8c9c['model'],_0x2b8c9c[_0x9752('0x37')]);_0x225765[_0x9752('0x3b')]=_['intersection'](_0x2b8c9c[_0x9752('0x3c')],qs['fields'](_0x498468[_0x9752('0x37')][_0x9752('0x3d')]));_0x225765['attributes']=_0x225765[_0x9752('0x3b')][_0x9752('0x3e')]?_0x225765[_0x9752('0x3b')]:_0x2b8c9c[_0x9752('0x3c')];if(!_0x498468['query'][_0x9752('0x3f')](_0x9752('0x40'))){_0x225765['limit']=qs[_0x9752('0x23')](_0x498468[_0x9752('0x37')][_0x9752('0x23')]);_0x225765[_0x9752('0x22')]=qs[_0x9752('0x22')](_0x498468[_0x9752('0x37')][_0x9752('0x22')]);}_0x225765[_0x9752('0x41')]=qs[_0x9752('0x42')](_0x498468[_0x9752('0x37')][_0x9752('0x42')]);_0x225765[_0x9752('0x43')]=qs['filters'](_['pick'](_0x498468[_0x9752('0x37')],_0x2b8c9c['filters']),_0x270f36);if(_0x498468[_0x9752('0x37')][_0x9752('0x44')]){_0x225765[_0x9752('0x43')]=_[_0x9752('0x45')](_0x225765['where'],{'$or':_[_0x9752('0x32')](_0x270f36,function(_0x54a6b6){if(_0x54a6b6['type']!=='VIRTUAL'){var _0x1ede42={};_0x1ede42[_0x54a6b6[_0x9752('0x2f')]]={'$like':'%'+_0x498468['query'][_0x9752('0x44')]+'%'};return _0x1ede42;}})});}_0x225765=_[_0x9752('0x45')]({},_0x225765,_0x498468[_0x9752('0x46')]);var _0x1e7255={'where':_0x225765[_0x9752('0x43')]};return db[_0x9752('0x33')][_0x9752('0x21')](_0x1e7255)[_0x9752('0x29')](function(_0x521025){_0x2a05ce[_0x9752('0x21')]=_0x521025;if(_0x498468['query'][_0x9752('0x47')]){_0x225765[_0x9752('0x48')]=[{'all':!![]}];}return db[_0x9752('0x33')][_0x9752('0x49')](_0x225765);})['then'](function(_0x21cabd){_0x2a05ce['rows']=_0x21cabd;return _0x2a05ce;})[_0x9752('0x29')](respondWithFilteredResult(_0x2e2c7d,_0x225765))[_0x9752('0x4a')](handleError(_0x2e2c7d,null));};exports[_0x9752('0x4b')]=function(_0x53ed69,_0x29ad56){var _0x1bdfd5={'raw':!![],'where':{'id':_0x53ed69['params']['id']}},_0x4f7801={};_0x4f7801[_0x9752('0x3c')]=_[_0x9752('0x38')](db[_0x9752('0x33')][_0x9752('0x34')]);_0x4f7801[_0x9752('0x37')]=_[_0x9752('0x38')](_0x53ed69[_0x9752('0x37')]);_0x4f7801['filters']=_['intersection'](_0x4f7801[_0x9752('0x3c')],_0x4f7801['query']);_0x1bdfd5[_0x9752('0x3b')]=_['intersection'](_0x4f7801[_0x9752('0x3c')],qs[_0x9752('0x3d')](_0x53ed69[_0x9752('0x37')][_0x9752('0x3d')]));_0x1bdfd5[_0x9752('0x3b')]=_0x1bdfd5[_0x9752('0x3b')]['length']?_0x1bdfd5[_0x9752('0x3b')]:_0x4f7801[_0x9752('0x3c')];if(_0x53ed69[_0x9752('0x37')]['includeAll']){_0x1bdfd5[_0x9752('0x48')]=[{'all':!![]}];}_0x1bdfd5=_[_0x9752('0x45')]({},_0x1bdfd5,_0x53ed69[_0x9752('0x46')]);return db[_0x9752('0x33')][_0x9752('0x4c')](_0x1bdfd5)[_0x9752('0x29')](handleEntityNotFound(_0x29ad56,null))[_0x9752('0x29')](respondWithResult(_0x29ad56,null))[_0x9752('0x4a')](handleError(_0x29ad56,null));};exports[_0x9752('0x4d')]=function(_0x386373,_0x25db0d){return db[_0x9752('0x33')][_0x9752('0x4d')](_0x386373['body'],{})[_0x9752('0x29')](function(_0x2a74b5){var _0x1f70e9=_0x386373[_0x9752('0x4e')][_0x9752('0x2b')]({'plain':!![]});if(!_0x1f70e9)throw new Error(_0x9752('0x4f'));if(_0x1f70e9['role']===_0x9752('0x4e')){var _0x1ebbe9=_0x2a74b5['get']({'plain':!![]});var _0x2155ce='Intervals';return db[_0x9752('0x50')][_0x9752('0x4c')]({'where':{'name':_0x2155ce,'userProfileId':_0x1f70e9[_0x9752('0x51')]},'raw':!![]})[_0x9752('0x29')](function(_0x236ad6){if(_0x236ad6&&_0x236ad6['autoAssociation']===0x0){return db['UserProfileResource'][_0x9752('0x4d')]({'name':_0x1ebbe9[_0x9752('0x2f')],'resourceId':_0x1ebbe9['id'],'type':_0x236ad6[_0x9752('0x2f')],'sectionId':_0x236ad6['id']},{})[_0x9752('0x29')](function(){return _0x2a74b5;});}else{return _0x2a74b5;}})[_0x9752('0x4a')](function(_0x352fc1){logger[_0x9752('0x2d')](_0x9752('0x52'),_0x352fc1);throw _0x352fc1;});}return _0x2a74b5;})[_0x9752('0x29')](respondWithResult(_0x25db0d,0xc9))[_0x9752('0x4a')](handleError(_0x25db0d,null));};exports['update']=function(_0x4f7a16,_0x1c5889){if(_0x4f7a16[_0x9752('0x53')]['id']){delete _0x4f7a16[_0x9752('0x53')]['id'];}return db[_0x9752('0x33')]['find']({'where':{'id':_0x4f7a16[_0x9752('0x54')]['id']}})['then'](handleEntityNotFound(_0x1c5889,null))[_0x9752('0x29')](saveUpdates(_0x4f7a16[_0x9752('0x53')],null))['then'](respondWithResult(_0x1c5889,null))[_0x9752('0x4a')](handleError(_0x1c5889,null));};exports[_0x9752('0x2a')]=function(_0x7b4192,_0x19f6fa){return db[_0x9752('0x33')][_0x9752('0x4c')]({'where':{'id':_0x7b4192[_0x9752('0x54')]['id']}})[_0x9752('0x29')](handleEntityNotFound(_0x19f6fa,null))[_0x9752('0x29')](removeEntity(_0x19f6fa,null))['catch'](handleError(_0x19f6fa,null));};exports[_0x9752('0x55')]=function(_0xff470,_0x14576b,_0x1e61da){if(_0xff470['body']['id']){delete _0xff470[_0x9752('0x53')]['id'];}return db[_0x9752('0x33')][_0x9752('0x4c')]({'where':{'id':_0xff470['params']['id']}})['then'](handleEntityNotFound(_0x14576b,null))[_0x9752('0x29')](function(_0x2b4a8a){if(_0x2b4a8a){_0xff470[_0x9752('0x53')][_0x9752('0x56')]=_0x2b4a8a['id'];return db['Interval']['create'](_0xff470['body']);}})[_0x9752('0x29')](respondWithResult(_0x14576b,null))[_0x9752('0x4a')](handleError(_0x14576b,null));};exports[_0x9752('0x57')]=function(_0x5f027b,_0x3a706e,_0x1ad7af){var _0x13d96e={};var _0x29cb23={};var _0x4c02d4;var _0x263292;return db[_0x9752('0x33')]['findOne']({'where':{'id':_0x5f027b[_0x9752('0x54')]['id']}})[_0x9752('0x29')](handleEntityNotFound(_0x3a706e,null))[_0x9752('0x29')](function(_0x13f6a3){if(_0x13f6a3){_0x4c02d4=_0x13f6a3;_0x29cb23[_0x9752('0x3c')]=_['keys'](db['Interval']['rawAttributes']);_0x29cb23[_0x9752('0x37')]=_[_0x9752('0x38')](_0x5f027b[_0x9752('0x37')]);_0x29cb23[_0x9752('0x39')]=_['intersection'](_0x29cb23['model'],_0x29cb23[_0x9752('0x37')]);_0x13d96e[_0x9752('0x3b')]=_[_0x9752('0x3a')](_0x29cb23['model'],qs[_0x9752('0x3d')](_0x5f027b[_0x9752('0x37')][_0x9752('0x3d')]));_0x13d96e[_0x9752('0x3b')]=_0x13d96e[_0x9752('0x3b')][_0x9752('0x3e')]?_0x13d96e[_0x9752('0x3b')]:_0x29cb23[_0x9752('0x3c')];_0x13d96e[_0x9752('0x41')]=qs[_0x9752('0x42')](_0x5f027b['query'][_0x9752('0x42')]);_0x13d96e['where']=qs[_0x9752('0x39')](_[_0x9752('0x58')](_0x5f027b['query'],_0x29cb23[_0x9752('0x39')]));if(_0x5f027b[_0x9752('0x37')][_0x9752('0x44')]){_0x13d96e[_0x9752('0x43')]=_['merge'](_0x13d96e[_0x9752('0x43')],{'$or':_[_0x9752('0x32')](_0x13d96e['attributes'],function(_0x4d182f){var _0x5e6763={};_0x5e6763[_0x4d182f]={'$like':'%'+_0x5f027b[_0x9752('0x37')][_0x9752('0x44')]+'%'};return _0x5e6763;})});}_0x13d96e=_['merge']({},_0x13d96e,_0x5f027b[_0x9752('0x46')]);return _0x4c02d4[_0x9752('0x57')](_0x13d96e);}})[_0x9752('0x29')](function(_0x232df6){if(_0x232df6){_0x263292=_0x232df6[_0x9752('0x3e')];if(!_0x5f027b[_0x9752('0x37')][_0x9752('0x3f')](_0x9752('0x40'))){_0x13d96e[_0x9752('0x23')]=qs[_0x9752('0x23')](_0x5f027b[_0x9752('0x37')][_0x9752('0x23')]);_0x13d96e[_0x9752('0x22')]=qs[_0x9752('0x22')](_0x5f027b['query'][_0x9752('0x22')]);}return _0x4c02d4['getIntervals'](_0x13d96e);}})[_0x9752('0x29')](function(_0x3b8156){if(_0x3b8156){return _0x3b8156?{'count':_0x263292,'rows':_0x3b8156}:null;}})['then'](respondWithResult(_0x3a706e,null))[_0x9752('0x4a')](handleError(_0x3a706e,null));};exports['addIntervals']=function(_0x347fc1,_0x56cae7,_0x9b1e61){return db[_0x9752('0x33')][_0x9752('0x59')]({'where':{'id':_0x347fc1['params']['id']}})[_0x9752('0x29')](handleEntityNotFound(_0x56cae7,null))[_0x9752('0x29')](function(_0x10ea9e){if(_0x10ea9e){return db[_0x9752('0x5a')]['transaction'](function(_0x495403){return db['Interval'][_0x9752('0x2a')]({'where':{'IntervalId':_0x347fc1[_0x9752('0x54')]['id']},'transaction':_0x495403})[_0x9752('0x29')](function(_0x331729){var _0x38ccec=_[_0x9752('0x32')](_0x347fc1[_0x9752('0x53')],function(_0xcd2c9){delete _0xcd2c9['id'];_0xcd2c9[_0x9752('0x56')]=_0x347fc1[_0x9752('0x54')]['id'];return _0xcd2c9;});return db[_0x9752('0x33')][_0x9752('0x5b')](_0x38ccec,{'transaction':_0x495403});});})[_0x9752('0x29')](function(){return db['Interval']['findAll']({'where':{'IntervalId':_0x347fc1[_0x9752('0x54')]['id']}});});}})[_0x9752('0x29')](respondWithResult(_0x56cae7,null))['catch'](handleError(_0x56cae7,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index db73890..447c3f8 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 _0x07cb=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','define','Interval','tools_intervals','rewrite','lodash'];(function(_0x2fb0a7,_0x4cc844){var _0x5348a9=function(_0x36540d){while(--_0x36540d){_0x2fb0a7['push'](_0x2fb0a7['shift']());}};_0x5348a9(++_0x4cc844);}(_0x07cb,0x149));var _0xb07c=function(_0x4aea3a,_0x3839f9){_0x4aea3a=_0x4aea3a-0x0;var _0x5a349e=_0x07cb[_0x4aea3a];return _0x5a349e;};'use strict';var _=require(_0xb07c('0x0'));var util=require(_0xb07c('0x1'));var logger=require('../../config/logger')(_0xb07c('0x2'));var moment=require(_0xb07c('0x3'));var BPromise=require(_0xb07c('0x4'));var rp=require(_0xb07c('0x5'));var fs=require('fs');var path=require(_0xb07c('0x6'));var rimraf=require(_0xb07c('0x7'));var config=require(_0xb07c('0x8'));var attributes=require(_0xb07c('0x9'));var extensions=require(_0xb07c('0xa'));module['exports']=function(_0x2e273b,_0x4a9c6c){return _0x2e273b[_0xb07c('0xb')](_0xb07c('0xc'),attributes,{'tableName':_0xb07c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4e5e85,_0x428a6c){extensions[_0xb07c('0xe')](_0x2e273b,_0x4e5e85);},'afterBulkCreate':function(_0x4d6bc2,_0x2aa066,_0x2efa32){_0x2efa32();extensions[_0xb07c('0xe')](_0x2e273b,_0x4d6bc2[0x0]);},'afterUpdate':function(_0xf4e86a,_0xd8510e){extensions[_0xb07c('0xe')](_0x2e273b,_0xf4e86a);},'afterDestroy':function(_0x2966f0,_0x194183){extensions['rewrite'](_0x2e273b,_0x2966f0);}}});}; \ No newline at end of file +var _0xad17=['./interval.attributes','../../components/extensions/rewrite','tools_intervals','rewrite','lodash','util','../../config/logger','api','moment','path'];(function(_0x59524a,_0x2bd47b){var _0x11bea3=function(_0x35af21){while(--_0x35af21){_0x59524a['push'](_0x59524a['shift']());}};_0x11bea3(++_0x2bd47b);}(_0xad17,0xb8));var _0x7ad1=function(_0x147c96,_0x309657){_0x147c96=_0x147c96-0x0;var _0x4ec711=_0xad17[_0x147c96];return _0x4ec711;};'use strict';var _=require(_0x7ad1('0x0'));var util=require(_0x7ad1('0x1'));var logger=require(_0x7ad1('0x2'))(_0x7ad1('0x3'));var moment=require(_0x7ad1('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7ad1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7ad1('0x6'));var extensions=require(_0x7ad1('0x7'));module['exports']=function(_0x1d9eb5,_0x52b703){return _0x1d9eb5['define']('Interval',attributes,{'tableName':_0x7ad1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3874b3,_0x29f392){extensions[_0x7ad1('0x9')](_0x1d9eb5,_0x3874b3);},'afterBulkCreate':function(_0x179379,_0x3dda45,_0x15ce79){_0x15ce79();extensions['rewrite'](_0x1d9eb5,_0x179379[0x0]);},'afterUpdate':function(_0x1cd807,_0x15c654){extensions[_0x7ad1('0x9')](_0x1d9eb5,_0x1cd807);},'afterDestroy':function(_0x24e007,_0x168bdd){extensions[_0x7ad1('0x9')](_0x1d9eb5,_0x24e007);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index dfc0afd..c2dd689 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(_0x33a694,_0x9b6640){var _0x41ff01=function(_0x4c38b7){while(--_0x4c38b7){_0x33a694['push'](_0x33a694['shift']());}};_0x41ff01(++_0x9b6640);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x211bc3,_0x5860c8){var _0x34c9a2=function(_0x4bfa37){while(--_0x4bfa37){_0x211bc3['push'](_0x211bc3['shift']());}};_0x34c9a2(++_0x5860c8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}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 8d7adaa..432e3d2 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 _0x2032=['isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0x2a5fcb,_0xccf4f3){var _0x54fd56=function(_0x4898a2){while(--_0x4898a2){_0x2a5fcb['push'](_0x2a5fcb['shift']());}};_0x54fd56(++_0xccf4f3);}(_0x2032,0xd9));var _0x2203=function(_0x133d4f,_0x4de069){_0x133d4f=_0x133d4f-0x0;var _0x1754eb=_0x2032[_0x133d4f];return _0x1754eb;};'use strict';var express=require('express');var router=express[_0x2203('0x0')]();var auth=require(_0x2203('0x1'));var controller=require(_0x2203('0x2'));router['post']('/',auth[_0x2203('0x3')](),controller[_0x2203('0x4')]);module['exports']=router; \ No newline at end of file +var _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x299d31,_0x317fd5){var _0x1c4be4=function(_0x509b2c){while(--_0x509b2c){_0x299d31['push'](_0x299d31['shift']());}};_0x1c4be4(++_0x317fd5);}(_0x5f2f,0x73));var _0xf5f2=function(_0x189b5a,_0x5d4a03){_0x189b5a=_0x189b5a-0x0;var _0x4d6cdb=_0x5f2f[_0x189b5a];return _0x4d6cdb;};'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 diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 52d3b8d..6ea9d99 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 _0x571d=['\x20from\x20','description','stringify','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','POST','application/json','Basic\x20','toString','base64','request','setEncoding','data','end','status','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','body','headers','remoteAddress','socket','connection','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','MOTGUI','summary','Report'];(function(_0x492d08,_0x42ba88){var _0x57436b=function(_0x40bd69){while(--_0x40bd69){_0x492d08['push'](_0x492d08['shift']());}};_0x57436b(++_0x42ba88);}(_0x571d,0x117));var _0xd571=function(_0x16c735,_0x58d58b){_0x16c735=_0x16c735-0x0;var _0x440d13=_0x571d[_0x16c735];return _0x440d13;};'use strict';var BPromise=require(_0xd571('0x0'));var https=require(_0xd571('0x1'));var logger=require(_0xd571('0x2'))(_0xd571('0x3'));var USERNAME=_0xd571('0x4');var PASSWORD=_0xd571('0x5');function openIssue(_0xc324a9,_0x3fba3b){var _0x192e45={'fields':{'project':{'key':_0xc324a9['key']||_0xd571('0x6')},'summary':(_0xc324a9[_0xd571('0x7')]||_0xd571('0x8'))+_0xd571('0x9')+_0xc324a9['ip'],'description':_0xc324a9[_0xd571('0xa')]||JSON[_0xd571('0xb')](_0xc324a9),'issuetype':{'name':_0xc324a9['issuetype']||_0xd571('0xc')}}};_0x192e45[_0xd571('0xd')][_0xd571('0xe')]=_0xc324a9[_0xd571('0xf')];_0x192e45[_0xd571('0xd')][_0xd571('0x10')]=_0xc324a9[_0xd571('0x11')];_0x192e45[_0xd571('0xd')][_0xd571('0x12')]=_0xc324a9[_0xd571('0x13')];_0x192e45['fields'][_0xd571('0x14')]=_0xc324a9[_0xd571('0x15')];_0x192e45[_0xd571('0xd')][_0xd571('0x16')]=_0xc324a9[_0xd571('0x17')];_0x192e45[_0xd571('0xd')][_0xd571('0x18')]=_0xc324a9['ip'];var _0x4b378f={'host':_0xd571('0x19'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0xd571('0x1a'),'timeout':0x4e20,'headers':{'Content-Type':_0xd571('0x1b'),'Authorization':_0xd571('0x1c')+new Buffer(USERNAME+':'+PASSWORD)[_0xd571('0x1d')](_0xd571('0x1e'))}};var _0x29805c=JSON[_0xd571('0xb')](_0x192e45);var _0xa752e=https[_0xd571('0x1f')](_0x4b378f,function(_0x47fa25){_0x47fa25[_0xd571('0x20')]('utf8');var _0xeb1892='';_0x47fa25['on'](_0xd571('0x21'),function(_0x400fd1){_0xeb1892+=_0x400fd1;});_0x47fa25['on'](_0xd571('0x22'),function(){if(_0x3fba3b){return _0x3fba3b[_0xd571('0x23')](_0x47fa25['statusCode'])[_0xd571('0x24')](JSON[_0xd571('0x25')](_0xeb1892));}});});_0xa752e['on'](_0xd571('0x26'),function(_0xb25f7c){if(_0x3fba3b){return _0x3fba3b['status'](0x1f4)[_0xd571('0x24')]({'errors':[{'message':_0xd571('0x27'),'type':_0xd571('0x28')}]});}});_0xa752e[_0xd571('0x29')](_0x29805c);_0xa752e[_0xd571('0x22')]();}exports[_0xd571('0x2a')]=openIssue;exports['send']=function(_0xbdd114,_0x1f102e){_0xbdd114[_0xd571('0x2b')]['ip']=_0xbdd114[_0xd571('0x2c')]['x-forwarded-for']||_0xbdd114['connection'][_0xd571('0x2d')]||_0xbdd114[_0xd571('0x2e')][_0xd571('0x2d')]||_0xbdd114[_0xd571('0x2f')][_0xd571('0x2e')][_0xd571('0x2d')];return openIssue(_0xbdd114[_0xd571('0x2b')],_0x1f102e);}; \ No newline at end of file +var _0x3e7d=['customfield_11500','email','customfield_11501','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','stringify','request','setEncoding','utf8','data','end','status','statusCode','json','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','https','api','support','3eAmWpBVP0','key','MOTGUI','Report','\x20from\x20','description','issuetype','Bug','fields'];(function(_0x285627,_0x198e53){var _0x44d1fc=function(_0x3c3dac){while(--_0x3c3dac){_0x285627['push'](_0x285627['shift']());}};_0x44d1fc(++_0x198e53);}(_0x3e7d,0x136));var _0xd3e7=function(_0x173b59,_0x5a672b){_0x173b59=_0x173b59-0x0;var _0x26e58e=_0x3e7d[_0x173b59];return _0x26e58e;};'use strict';var BPromise=require('bluebird');var https=require(_0xd3e7('0x0'));var logger=require('../../config/logger')(_0xd3e7('0x1'));var USERNAME=_0xd3e7('0x2');var PASSWORD=_0xd3e7('0x3');function openIssue(_0x4d89b7,_0x4e6ebb){var _0x2a6a57={'fields':{'project':{'key':_0x4d89b7[_0xd3e7('0x4')]||_0xd3e7('0x5')},'summary':(_0x4d89b7['summary']||_0xd3e7('0x6'))+_0xd3e7('0x7')+_0x4d89b7['ip'],'description':_0x4d89b7[_0xd3e7('0x8')]||JSON['stringify'](_0x4d89b7),'issuetype':{'name':_0x4d89b7[_0xd3e7('0x9')]||_0xd3e7('0xa')}}};_0x2a6a57[_0xd3e7('0xb')][_0xd3e7('0xc')]=_0x4d89b7[_0xd3e7('0xd')];_0x2a6a57[_0xd3e7('0xb')][_0xd3e7('0xe')]=_0x4d89b7['oldToken'];_0x2a6a57[_0xd3e7('0xb')][_0xd3e7('0xf')]=_0x4d89b7[_0xd3e7('0x10')];_0x2a6a57['fields'][_0xd3e7('0x11')]=_0x4d89b7[_0xd3e7('0x12')];_0x2a6a57[_0xd3e7('0xb')][_0xd3e7('0x13')]=_0x4d89b7[_0xd3e7('0x14')];_0x2a6a57['fields']['customfield_10102']=_0x4d89b7['ip'];var _0x227a73={'host':'track.xcallymotion.com','port':0x1bb,'path':_0xd3e7('0x15'),'method':_0xd3e7('0x16'),'timeout':0x4e20,'headers':{'Content-Type':_0xd3e7('0x17'),'Authorization':_0xd3e7('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0xd3e7('0x19')](_0xd3e7('0x1a'))}};var _0x3665dd=JSON[_0xd3e7('0x1b')](_0x2a6a57);var _0x320cb8=https[_0xd3e7('0x1c')](_0x227a73,function(_0x47d82b){_0x47d82b[_0xd3e7('0x1d')](_0xd3e7('0x1e'));var _0x13e8c9='';_0x47d82b['on'](_0xd3e7('0x1f'),function(_0x5d515e){_0x13e8c9+=_0x5d515e;});_0x47d82b['on'](_0xd3e7('0x20'),function(){if(_0x4e6ebb){return _0x4e6ebb[_0xd3e7('0x21')](_0x47d82b[_0xd3e7('0x22')])[_0xd3e7('0x23')](JSON['parse'](_0x13e8c9));}});});_0x320cb8['on'](_0xd3e7('0x24'),function(_0x81f2e7){if(_0x4e6ebb){return _0x4e6ebb[_0xd3e7('0x21')](0x1f4)[_0xd3e7('0x23')]({'errors':[{'message':_0xd3e7('0x25'),'type':_0xd3e7('0x26')}]});}});_0x320cb8['write'](_0x3665dd);_0x320cb8[_0xd3e7('0x20')]();}exports['openIssue']=openIssue;exports[_0xd3e7('0x27')]=function(_0x3cbe33,_0x1e2990){_0x3cbe33[_0xd3e7('0x28')]['ip']=_0x3cbe33[_0xd3e7('0x29')][_0xd3e7('0x2a')]||_0x3cbe33[_0xd3e7('0x2b')][_0xd3e7('0x2c')]||_0x3cbe33[_0xd3e7('0x2d')][_0xd3e7('0x2c')]||_0x3cbe33['connection'][_0xd3e7('0x2d')][_0xd3e7('0x2c')];return openIssue(_0x3cbe33[_0xd3e7('0x28')],_0x1e2990);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index bde56a5..6ece743 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 _0x1339=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2f2a6f,_0xe63e10){var _0x14441d=function(_0x3ab031){while(--_0x3ab031){_0x2f2a6f['push'](_0x2f2a6f['shift']());}};_0x14441d(++_0xe63e10);}(_0x1339,0x1ed));var _0x9133=function(_0x439c86,_0x4cb771){_0x439c86=_0x439c86-0x0;var _0x5bb781=_0x1339[_0x439c86];return _0x5bb781;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9133('0x0'));var timeout=require(_0x9133('0x1'));var express=require(_0x9133('0x2'));var router=express[_0x9133('0x3')]();var fs_extra=require(_0x9133('0x4'));var auth=require(_0x9133('0x5'));var interaction=require(_0x9133('0x6'));var config=require(_0x9133('0x7'));var controller=require('./jscriptyAnswerReport.controller');router[_0x9133('0x8')]('/',auth[_0x9133('0x9')](),controller[_0x9133('0xa')]);router['get'](_0x9133('0xb'),auth[_0x9133('0x9')](),controller[_0x9133('0xc')]);router[_0x9133('0x8')](_0x9133('0xd'),auth[_0x9133('0x9')](),controller[_0x9133('0xe')]);router[_0x9133('0xf')]('/',auth[_0x9133('0x9')](),controller[_0x9133('0x10')]);router['put'](_0x9133('0xd'),auth[_0x9133('0x9')](),controller[_0x9133('0x11')]);router[_0x9133('0x12')](_0x9133('0xd'),auth[_0x9133('0x9')](),controller['destroy']);module[_0x9133('0x13')]=router; \ No newline at end of file +var _0x99e9=['update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put'];(function(_0x3cce9d,_0x23b727){var _0x3ac559=function(_0x5dd615){while(--_0x5dd615){_0x3cce9d['push'](_0x3cce9d['shift']());}};_0x3ac559(++_0x23b727);}(_0x99e9,0xb4));var _0x999e=function(_0x1b2255,_0x3de34f){_0x1b2255=_0x1b2255-0x0;var _0x33e57d=_0x99e9[_0x1b2255];return _0x33e57d;};'use strict';var multer=require('multer');var util=require(_0x999e('0x0'));var path=require(_0x999e('0x1'));var timeout=require(_0x999e('0x2'));var express=require(_0x999e('0x3'));var router=express['Router']();var fs_extra=require(_0x999e('0x4'));var auth=require(_0x999e('0x5'));var interaction=require(_0x999e('0x6'));var config=require('../../config/environment');var controller=require(_0x999e('0x7'));router['get']('/',auth[_0x999e('0x8')](),controller[_0x999e('0x9')]);router[_0x999e('0xa')](_0x999e('0xb'),auth['isAuthenticated'](),controller[_0x999e('0xc')]);router[_0x999e('0xa')](_0x999e('0xd'),auth[_0x999e('0x8')](),controller[_0x999e('0xe')]);router[_0x999e('0xf')]('/',auth[_0x999e('0x8')](),controller[_0x999e('0x10')]);router[_0x999e('0x11')](_0x999e('0xd'),auth[_0x999e('0x8')](),controller[_0x999e('0x12')]);router[_0x999e('0x13')](_0x999e('0xd'),auth[_0x999e('0x8')](),controller[_0x999e('0x14')]);module[_0x999e('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index ad95a69..8d44b93 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(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x7a54,0x106));var _0x47a5=function(_0x3d9f65,_0x5f2ab7){_0x3d9f65=_0x3d9f65-0x0;var _0x51520b=_0x7a54[_0x3d9f65];return _0x51520b;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x7a54,0x106));var _0x47a5=function(_0x25a3ae,_0xd78ab0){_0x25a3ae=_0x25a3ae-0x0;var _0x5c0498=_0x7a54[_0x25a3ae];return _0x5c0498;};'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 6b4ac8a..4ebcb6a 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 _0x37cc=['querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','rows','show','params','includeAll','include','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js'];(function(_0x3203f2,_0x5715bf){var _0x5431d7=function(_0x294122){while(--_0x294122){_0x3203f2['push'](_0x3203f2['shift']());}};_0x5431d7(++_0x5715bf);}(_0x37cc,0x185));var _0xc37c=function(_0x10e19a,_0x2915c4){_0x10e19a=_0x10e19a-0x0;var _0x50b26d=_0x37cc[_0x10e19a];return _0x50b26d;};'use strict';var emlformat=require(_0xc37c('0x0'));var rimraf=require(_0xc37c('0x1'));var zipdir=require(_0xc37c('0x2'));var jsonpatch=require(_0xc37c('0x3'));var rp=require(_0xc37c('0x4'));var moment=require(_0xc37c('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc37c('0x6'));var path=require(_0xc37c('0x7'));var sox=require(_0xc37c('0x8'));var csv=require(_0xc37c('0x9'));var ejs=require(_0xc37c('0xa'));var fs=require('fs');var fs_extra=require(_0xc37c('0xb'));var _=require(_0xc37c('0xc'));var squel=require(_0xc37c('0xd'));var crypto=require(_0xc37c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc37c('0xf'));var toCsv=require(_0xc37c('0x9'));var querystring=require(_0xc37c('0x10'));var Papa=require(_0xc37c('0x11'));var Redis=require(_0xc37c('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc37c('0x13'));var as=require(_0xc37c('0x14'));var hardwareService=require(_0xc37c('0x15'));var logger=require(_0xc37c('0x16'))(_0xc37c('0x17'));var utils=require(_0xc37c('0x18'));var config=require(_0xc37c('0x19'));var licenseUtil=require(_0xc37c('0x1a'));var db=require(_0xc37c('0x1b'))['db'];function respondWithStatusCode(_0xd90fc8,_0x43392c){_0x43392c=_0x43392c||0xcc;return function(_0x56ce39){if(_0x56ce39){return _0xd90fc8['sendStatus'](_0x43392c);}return _0xd90fc8[_0xc37c('0x1c')](_0x43392c)[_0xc37c('0x1d')]();};}function respondWithResult(_0x2d87c1,_0xac116d){_0xac116d=_0xac116d||0xc8;return function(_0x2dc501){if(_0x2dc501){return _0x2d87c1[_0xc37c('0x1c')](_0xac116d)['json'](_0x2dc501);}};}function respondWithFilteredResult(_0x329793,_0x500a3b){return function(_0x5b05f8){if(_0x5b05f8){var _0x128d81=typeof _0x500a3b[_0xc37c('0x1e')]===_0xc37c('0x1f')&&typeof _0x500a3b[_0xc37c('0x20')]==='undefined';var _0x577165=_0x5b05f8['count'];var _0x2d6129=_0x128d81?0x0:_0x500a3b['offset'];var _0x370c2f=_0x128d81?_0x5b05f8[_0xc37c('0x21')]:_0x500a3b['offset']+_0x500a3b[_0xc37c('0x20')];var _0x438e42;if(_0x370c2f>=_0x577165){_0x370c2f=_0x577165;_0x438e42=0xc8;}else{_0x438e42=0xce;}_0x329793[_0xc37c('0x1c')](_0x438e42);return _0x329793[_0xc37c('0x22')]('Content-Range',_0x2d6129+'-'+_0x370c2f+'/'+_0x577165)[_0xc37c('0x23')](_0x5b05f8);}return null;};}function patchUpdates(_0x4d3aa4){return function(_0x1f941b){try{jsonpatch[_0xc37c('0x24')](_0x1f941b,_0x4d3aa4,!![]);}catch(_0x237cc6){return BPromise[_0xc37c('0x25')](_0x237cc6);}return _0x1f941b[_0xc37c('0x26')]();};}function saveUpdates(_0x5e931a,_0x148334){return function(_0x33aa68){if(_0x33aa68){return _0x33aa68[_0xc37c('0x27')](_0x5e931a)[_0xc37c('0x28')](function(_0x358fc8){return _0x358fc8;});}return null;};}function removeEntity(_0x87a6a6,_0x15a392){return function(_0x70e0b5){if(_0x70e0b5){return _0x70e0b5[_0xc37c('0x29')]()[_0xc37c('0x28')](function(){_0x87a6a6[_0xc37c('0x1c')](0xcc)[_0xc37c('0x1d')]();});}};}function handleEntityNotFound(_0x3076fc,_0x59274a){return function(_0x214d0a){if(!_0x214d0a){_0x3076fc[_0xc37c('0x2a')](0x194);}return _0x214d0a;};}function handleError(_0x1d59fa,_0x484c43){_0x484c43=_0x484c43||0x1f4;return function(_0x53f062){logger[_0xc37c('0x2b')](_0x53f062[_0xc37c('0x2c')]);if(_0x53f062[_0xc37c('0x2d')]){delete _0x53f062[_0xc37c('0x2d')];}_0x1d59fa[_0xc37c('0x1c')](_0x484c43)[_0xc37c('0x2e')](_0x53f062);};}exports[_0xc37c('0x2f')]=function(_0x47266c,_0x5d13b3){var _0x14129d={},_0x466094={},_0x180260={'count':0x0,'rows':[]};var _0x39d78e=_[_0xc37c('0x30')](db[_0xc37c('0x31')][_0xc37c('0x32')],function(_0x1c3e9d){return{'name':_0x1c3e9d[_0xc37c('0x33')],'type':_0x1c3e9d[_0xc37c('0x34')][_0xc37c('0x35')]};});_0x466094[_0xc37c('0x36')]=_[_0xc37c('0x30')](_0x39d78e,'name');_0x466094[_0xc37c('0x37')]=_[_0xc37c('0x38')](_0x47266c['query']);_0x466094['filters']=_[_0xc37c('0x39')](_0x466094[_0xc37c('0x36')],_0x466094[_0xc37c('0x37')]);_0x14129d['attributes']=_[_0xc37c('0x39')](_0x466094['model'],qs[_0xc37c('0x3a')](_0x47266c[_0xc37c('0x37')]['fields']));_0x14129d[_0xc37c('0x3b')]=_0x14129d[_0xc37c('0x3b')][_0xc37c('0x3c')]?_0x14129d[_0xc37c('0x3b')]:_0x466094[_0xc37c('0x36')];if(!_0x47266c[_0xc37c('0x37')][_0xc37c('0x3d')]('nolimit')){_0x14129d['limit']=qs[_0xc37c('0x20')](_0x47266c[_0xc37c('0x37')][_0xc37c('0x20')]);_0x14129d[_0xc37c('0x1e')]=qs['offset'](_0x47266c[_0xc37c('0x37')][_0xc37c('0x1e')]);}_0x14129d[_0xc37c('0x3e')]=qs['sort'](_0x47266c[_0xc37c('0x37')][_0xc37c('0x3f')]);_0x14129d['where']=qs[_0xc37c('0x40')](_[_0xc37c('0x41')](_0x47266c['query'],_0x466094[_0xc37c('0x40')]),_0x39d78e);if(_0x47266c[_0xc37c('0x37')][_0xc37c('0x42')]){_0x14129d[_0xc37c('0x43')]=_[_0xc37c('0x44')](_0x14129d[_0xc37c('0x43')],{'$or':_[_0xc37c('0x30')](_0x39d78e,function(_0xfed425){if(_0xfed425[_0xc37c('0x34')]!==_0xc37c('0x45')){var _0x167b50={};_0x167b50[_0xfed425[_0xc37c('0x2d')]]={'$like':'%'+_0x47266c[_0xc37c('0x37')][_0xc37c('0x42')]+'%'};return _0x167b50;}})});}_0x14129d=_[_0xc37c('0x44')]({},_0x14129d,_0x47266c[_0xc37c('0x46')]);var _0x476231={'where':_0x14129d['where']};return db[_0xc37c('0x31')][_0xc37c('0x21')](_0x476231)[_0xc37c('0x28')](function(_0x4f73e2){_0x180260[_0xc37c('0x21')]=_0x4f73e2;if(_0x47266c['query']['includeAll']){_0x14129d['include']=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x14129d);})[_0xc37c('0x28')](function(_0x423859){_0x180260[_0xc37c('0x47')]=_0x423859;return _0x180260;})[_0xc37c('0x28')](respondWithFilteredResult(_0x5d13b3,_0x14129d))['catch'](handleError(_0x5d13b3,null));};exports[_0xc37c('0x48')]=function(_0x1b0d35,_0x532bb5){var _0x207310={'raw':!![],'where':{'id':_0x1b0d35[_0xc37c('0x49')]['id']}},_0x1ca536={};_0x1ca536[_0xc37c('0x36')]=_[_0xc37c('0x38')](db[_0xc37c('0x31')][_0xc37c('0x32')]);_0x1ca536['query']=_[_0xc37c('0x38')](_0x1b0d35['query']);_0x1ca536['filters']=_['intersection'](_0x1ca536[_0xc37c('0x36')],_0x1ca536['query']);_0x207310[_0xc37c('0x3b')]=_['intersection'](_0x1ca536[_0xc37c('0x36')],qs[_0xc37c('0x3a')](_0x1b0d35[_0xc37c('0x37')][_0xc37c('0x3a')]));_0x207310[_0xc37c('0x3b')]=_0x207310[_0xc37c('0x3b')]['length']?_0x207310['attributes']:_0x1ca536['model'];if(_0x1b0d35[_0xc37c('0x37')][_0xc37c('0x4a')]){_0x207310[_0xc37c('0x4b')]=[{'all':!![]}];}_0x207310=_[_0xc37c('0x44')]({},_0x207310,_0x1b0d35[_0xc37c('0x46')]);return db[_0xc37c('0x31')][_0xc37c('0x4c')](_0x207310)['then'](handleEntityNotFound(_0x532bb5,null))['then'](respondWithResult(_0x532bb5,null))[_0xc37c('0x4d')](handleError(_0x532bb5,null));};exports[_0xc37c('0x4e')]=function(_0x171376,_0x46661c){return db[_0xc37c('0x31')][_0xc37c('0x4e')](_0x171376[_0xc37c('0x4f')],{})[_0xc37c('0x28')](respondWithResult(_0x46661c,0xc9))[_0xc37c('0x4d')](handleError(_0x46661c,null));};exports[_0xc37c('0x27')]=function(_0x5589c7,_0x73c059){if(_0x5589c7[_0xc37c('0x4f')]['id']){delete _0x5589c7[_0xc37c('0x4f')]['id'];}return db[_0xc37c('0x31')][_0xc37c('0x4c')]({'where':{'id':_0x5589c7['params']['id']}})[_0xc37c('0x28')](handleEntityNotFound(_0x73c059,null))['then'](saveUpdates(_0x5589c7[_0xc37c('0x4f')],null))[_0xc37c('0x28')](respondWithResult(_0x73c059,null))[_0xc37c('0x4d')](handleError(_0x73c059,null));};exports[_0xc37c('0x29')]=function(_0x13552f,_0x1960b6){return db[_0xc37c('0x31')][_0xc37c('0x4c')]({'where':{'id':_0x13552f[_0xc37c('0x49')]['id']}})[_0xc37c('0x28')](handleEntityNotFound(_0x1960b6,null))[_0xc37c('0x28')](removeEntity(_0x1960b6,null))[_0xc37c('0x4d')](handleError(_0x1960b6,null));};exports[_0xc37c('0x50')]=function(_0x361d5e,_0x63a8e8){return db[_0xc37c('0x31')][_0xc37c('0x50')]()[_0xc37c('0x28')](respondWithResult(_0x63a8e8,null))[_0xc37c('0x4d')](handleError(_0x63a8e8,null));}; \ No newline at end of file +var _0x7eff=['util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','JscriptyAnswerReport','includeAll','include','findAll','rows','catch','params','find','create','body','update','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x40b2a9,_0x5eb469){var _0x94ff9=function(_0x4fd252){while(--_0x4fd252){_0x40b2a9['push'](_0x40b2a9['shift']());}};_0x94ff9(++_0x5eb469);}(_0x7eff,0x162));var _0xf7ef=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7eff[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf7ef('0x0'));var zipdir=require(_0xf7ef('0x1'));var jsonpatch=require(_0xf7ef('0x2'));var rp=require('request-promise');var moment=require(_0xf7ef('0x3'));var BPromise=require(_0xf7ef('0x4'));var Mustache=require(_0xf7ef('0x5'));var util=require(_0xf7ef('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xf7ef('0x7'));var ejs=require(_0xf7ef('0x8'));var fs=require('fs');var fs_extra=require(_0xf7ef('0x9'));var _=require(_0xf7ef('0xa'));var squel=require(_0xf7ef('0xb'));var crypto=require(_0xf7ef('0xc'));var jsforce=require(_0xf7ef('0xd'));var deskjs=require(_0xf7ef('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf7ef('0xf'));var Papa=require(_0xf7ef('0x10'));var Redis=require('ioredis');var authService=require(_0xf7ef('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf7ef('0x12'));var logger=require('../../config/logger')(_0xf7ef('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf7ef('0x14'))['db'];function respondWithStatusCode(_0x4e45fd,_0x5e6a8e){_0x5e6a8e=_0x5e6a8e||0xcc;return function(_0x56b5d7){if(_0x56b5d7){return _0x4e45fd[_0xf7ef('0x15')](_0x5e6a8e);}return _0x4e45fd[_0xf7ef('0x16')](_0x5e6a8e)[_0xf7ef('0x17')]();};}function respondWithResult(_0xf6e5a0,_0x5d5112){_0x5d5112=_0x5d5112||0xc8;return function(_0x27a4a7){if(_0x27a4a7){return _0xf6e5a0['status'](_0x5d5112)[_0xf7ef('0x18')](_0x27a4a7);}};}function respondWithFilteredResult(_0x35746b,_0x4996b7){return function(_0x39ef6f){if(_0x39ef6f){var _0x4856bd=typeof _0x4996b7[_0xf7ef('0x19')]===_0xf7ef('0x1a')&&typeof _0x4996b7[_0xf7ef('0x1b')]===_0xf7ef('0x1a');var _0x15ad8c=_0x39ef6f[_0xf7ef('0x1c')];var _0x466612=_0x4856bd?0x0:_0x4996b7['offset'];var _0x4fa0c6=_0x4856bd?_0x39ef6f['count']:_0x4996b7[_0xf7ef('0x19')]+_0x4996b7['limit'];var _0x371688;if(_0x4fa0c6>=_0x15ad8c){_0x4fa0c6=_0x15ad8c;_0x371688=0xc8;}else{_0x371688=0xce;}_0x35746b[_0xf7ef('0x16')](_0x371688);return _0x35746b[_0xf7ef('0x1d')](_0xf7ef('0x1e'),_0x466612+'-'+_0x4fa0c6+'/'+_0x15ad8c)[_0xf7ef('0x18')](_0x39ef6f);}return null;};}function patchUpdates(_0x29cbf1){return function(_0x4d1cf0){try{jsonpatch['apply'](_0x4d1cf0,_0x29cbf1,!![]);}catch(_0x578525){return BPromise[_0xf7ef('0x1f')](_0x578525);}return _0x4d1cf0[_0xf7ef('0x20')]();};}function saveUpdates(_0x1a95c6,_0x20c27b){return function(_0x5d70f5){if(_0x5d70f5){return _0x5d70f5['update'](_0x1a95c6)[_0xf7ef('0x21')](function(_0x36c8c8){return _0x36c8c8;});}return null;};}function removeEntity(_0x5e1c75,_0x168da4){return function(_0x39e820){if(_0x39e820){return _0x39e820[_0xf7ef('0x22')]()['then'](function(){_0x5e1c75[_0xf7ef('0x16')](0xcc)[_0xf7ef('0x17')]();});}};}function handleEntityNotFound(_0x47c243,_0x15997a){return function(_0x3ee27d){if(!_0x3ee27d){_0x47c243[_0xf7ef('0x15')](0x194);}return _0x3ee27d;};}function handleError(_0x205aaa,_0x11768b){_0x11768b=_0x11768b||0x1f4;return function(_0xaa0cc4){logger[_0xf7ef('0x23')](_0xaa0cc4[_0xf7ef('0x24')]);if(_0xaa0cc4[_0xf7ef('0x25')]){delete _0xaa0cc4['name'];}_0x205aaa[_0xf7ef('0x16')](_0x11768b)[_0xf7ef('0x26')](_0xaa0cc4);};}exports[_0xf7ef('0x27')]=function(_0x3a9292,_0x49ea57){var _0x392364={},_0x3becba={},_0x486c2a={'count':0x0,'rows':[]};var _0x5e40ac=_[_0xf7ef('0x28')](db['JscriptyAnswerReport'][_0xf7ef('0x29')],function(_0xbd4571){return{'name':_0xbd4571[_0xf7ef('0x2a')],'type':_0xbd4571[_0xf7ef('0x2b')]['key']};});_0x3becba[_0xf7ef('0x2c')]=_[_0xf7ef('0x28')](_0x5e40ac,_0xf7ef('0x25'));_0x3becba['query']=_[_0xf7ef('0x2d')](_0x3a9292[_0xf7ef('0x2e')]);_0x3becba[_0xf7ef('0x2f')]=_[_0xf7ef('0x30')](_0x3becba[_0xf7ef('0x2c')],_0x3becba[_0xf7ef('0x2e')]);_0x392364[_0xf7ef('0x31')]=_[_0xf7ef('0x30')](_0x3becba[_0xf7ef('0x2c')],qs['fields'](_0x3a9292[_0xf7ef('0x2e')][_0xf7ef('0x32')]));_0x392364[_0xf7ef('0x31')]=_0x392364[_0xf7ef('0x31')][_0xf7ef('0x33')]?_0x392364[_0xf7ef('0x31')]:_0x3becba[_0xf7ef('0x2c')];if(!_0x3a9292[_0xf7ef('0x2e')][_0xf7ef('0x34')]('nolimit')){_0x392364['limit']=qs[_0xf7ef('0x1b')](_0x3a9292[_0xf7ef('0x2e')][_0xf7ef('0x1b')]);_0x392364[_0xf7ef('0x19')]=qs[_0xf7ef('0x19')](_0x3a9292[_0xf7ef('0x2e')][_0xf7ef('0x19')]);}_0x392364[_0xf7ef('0x35')]=qs['sort'](_0x3a9292[_0xf7ef('0x2e')][_0xf7ef('0x36')]);_0x392364['where']=qs['filters'](_[_0xf7ef('0x37')](_0x3a9292[_0xf7ef('0x2e')],_0x3becba[_0xf7ef('0x2f')]),_0x5e40ac);if(_0x3a9292[_0xf7ef('0x2e')][_0xf7ef('0x38')]){_0x392364[_0xf7ef('0x39')]=_[_0xf7ef('0x3a')](_0x392364[_0xf7ef('0x39')],{'$or':_['map'](_0x5e40ac,function(_0x55fd01){if(_0x55fd01[_0xf7ef('0x2b')]!=='VIRTUAL'){var _0x300e05={};_0x300e05[_0x55fd01[_0xf7ef('0x25')]]={'$like':'%'+_0x3a9292[_0xf7ef('0x2e')][_0xf7ef('0x38')]+'%'};return _0x300e05;}})});}_0x392364=_[_0xf7ef('0x3a')]({},_0x392364,_0x3a9292[_0xf7ef('0x3b')]);var _0x2052a9={'where':_0x392364[_0xf7ef('0x39')]};return db[_0xf7ef('0x3c')]['count'](_0x2052a9)[_0xf7ef('0x21')](function(_0x2bad42){_0x486c2a['count']=_0x2bad42;if(_0x3a9292[_0xf7ef('0x2e')][_0xf7ef('0x3d')]){_0x392364[_0xf7ef('0x3e')]=[{'all':!![]}];}return db[_0xf7ef('0x3c')][_0xf7ef('0x3f')](_0x392364);})[_0xf7ef('0x21')](function(_0x2323d7){_0x486c2a[_0xf7ef('0x40')]=_0x2323d7;return _0x486c2a;})[_0xf7ef('0x21')](respondWithFilteredResult(_0x49ea57,_0x392364))[_0xf7ef('0x41')](handleError(_0x49ea57,null));};exports['show']=function(_0x5c54af,_0x58783d){var _0x3a27cd={'raw':!![],'where':{'id':_0x5c54af[_0xf7ef('0x42')]['id']}},_0x540783={};_0x540783[_0xf7ef('0x2c')]=_[_0xf7ef('0x2d')](db['JscriptyAnswerReport'][_0xf7ef('0x29')]);_0x540783['query']=_[_0xf7ef('0x2d')](_0x5c54af[_0xf7ef('0x2e')]);_0x540783[_0xf7ef('0x2f')]=_[_0xf7ef('0x30')](_0x540783[_0xf7ef('0x2c')],_0x540783[_0xf7ef('0x2e')]);_0x3a27cd[_0xf7ef('0x31')]=_[_0xf7ef('0x30')](_0x540783[_0xf7ef('0x2c')],qs[_0xf7ef('0x32')](_0x5c54af[_0xf7ef('0x2e')][_0xf7ef('0x32')]));_0x3a27cd[_0xf7ef('0x31')]=_0x3a27cd[_0xf7ef('0x31')][_0xf7ef('0x33')]?_0x3a27cd[_0xf7ef('0x31')]:_0x540783[_0xf7ef('0x2c')];if(_0x5c54af[_0xf7ef('0x2e')][_0xf7ef('0x3d')]){_0x3a27cd[_0xf7ef('0x3e')]=[{'all':!![]}];}_0x3a27cd=_[_0xf7ef('0x3a')]({},_0x3a27cd,_0x5c54af['options']);return db[_0xf7ef('0x3c')][_0xf7ef('0x43')](_0x3a27cd)[_0xf7ef('0x21')](handleEntityNotFound(_0x58783d,null))['then'](respondWithResult(_0x58783d,null))[_0xf7ef('0x41')](handleError(_0x58783d,null));};exports[_0xf7ef('0x44')]=function(_0x238d5a,_0x442191){return db[_0xf7ef('0x3c')][_0xf7ef('0x44')](_0x238d5a[_0xf7ef('0x45')],{})[_0xf7ef('0x21')](respondWithResult(_0x442191,0xc9))[_0xf7ef('0x41')](handleError(_0x442191,null));};exports[_0xf7ef('0x46')]=function(_0x17584a,_0x5670c8){if(_0x17584a['body']['id']){delete _0x17584a['body']['id'];}return db[_0xf7ef('0x3c')]['find']({'where':{'id':_0x17584a[_0xf7ef('0x42')]['id']}})[_0xf7ef('0x21')](handleEntityNotFound(_0x5670c8,null))[_0xf7ef('0x21')](saveUpdates(_0x17584a[_0xf7ef('0x45')],null))[_0xf7ef('0x21')](respondWithResult(_0x5670c8,null))['catch'](handleError(_0x5670c8,null));};exports['destroy']=function(_0x23c6d8,_0x284dbb){return db[_0xf7ef('0x3c')][_0xf7ef('0x43')]({'where':{'id':_0x23c6d8[_0xf7ef('0x42')]['id']}})['then'](handleEntityNotFound(_0x284dbb,null))[_0xf7ef('0x21')](removeEntity(_0x284dbb,null))[_0xf7ef('0x41')](handleError(_0x284dbb,null));};exports['describe']=function(_0x342da3,_0x3af64f){return db[_0xf7ef('0x3c')][_0xf7ef('0x47')]()[_0xf7ef('0x21')](respondWithResult(_0x3af64f,null))['catch'](handleError(_0x3af64f,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 77b637f..bb5c74d 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 _0xf68d=['JscriptyAnswerReport','report_jscripty_answers','../../config/logger','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf68d,0xc8));var _0xdf68=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xf68d[_0x5d2803];return _0xdcad2c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdf68('0x0'))('api');var moment=require('moment');var BPromise=require(_0xdf68('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf68('0x2'));var rimraf=require(_0xdf68('0x3'));var config=require(_0xdf68('0x4'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0xdf68('0x5')]=function(_0xb11923,_0xd53c42){return _0xb11923[_0xdf68('0x6')](_0xdf68('0x7'),attributes,{'tableName':_0xdf68('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x832d=['../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x3aa6f2,_0xb07396){var _0x14a91a=function(_0x24408c){while(--_0x24408c){_0x3aa6f2['push'](_0x3aa6f2['shift']());}};_0x14a91a(++_0xb07396);}(_0x832d,0x10e));var _0xd832=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x832d[_0x6131cd];return _0x47e916;};'use strict';var _=require('lodash');var util=require(_0xd832('0x0'));var logger=require(_0xd832('0x1'))('api');var moment=require(_0xd832('0x2'));var BPromise=require('bluebird');var rp=require(_0xd832('0x3'));var fs=require('fs');var path=require(_0xd832('0x4'));var rimraf=require(_0xd832('0x5'));var config=require(_0xd832('0x6'));var attributes=require(_0xd832('0x7'));module[_0xd832('0x8')]=function(_0x330bea,_0x10a2da){return _0x330bea[_0xd832('0x9')](_0xd832('0xa'),attributes,{'tableName':_0xd832('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 2b1dd40..00d136b 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 _0x96f7=['error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2d3d0d,_0x67ac82){var _0xca35b6=function(_0x483979){while(--_0x483979){_0x2d3d0d['push'](_0x2d3d0d['shift']());}};_0xca35b6(++_0x67ac82);}(_0x96f7,0x1ba));var _0x796f=function(_0x585221,_0xb7e318){_0x585221=_0x585221-0x0;var _0x17111b=_0x96f7[_0x585221];return _0x17111b;};'use strict';var _=require(_0x796f('0x0'));var util=require(_0x796f('0x1'));var moment=require(_0x796f('0x2'));var BPromise=require(_0x796f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x796f('0x4'));var db=require(_0x796f('0x5'))['db'];var utils=require(_0x796f('0x6'));var logger=require(_0x796f('0x7'))(_0x796f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x796f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x51c91a,_0x8ca28f,_0x27e798){return new BPromise(function(_0x2b021b,_0x28b68a){return client[_0x796f('0xa')](_0x51c91a,_0x27e798)[_0x796f('0xb')](function(_0x1b9438){logger[_0x796f('0xc')](_0x796f('0xd'),_0x8ca28f,_0x796f('0xe'));logger[_0x796f('0xf')](_0x796f('0x10'),_0x8ca28f,_0x796f('0xe'),JSON[_0x796f('0x11')](_0x1b9438));if(_0x1b9438['error']){if(_0x1b9438[_0x796f('0x12')][_0x796f('0x13')]===0x1f4){logger[_0x796f('0x12')](_0x796f('0xd'),_0x8ca28f,_0x1b9438[_0x796f('0x12')][_0x796f('0x14')]);return _0x28b68a(_0x1b9438[_0x796f('0x12')][_0x796f('0x14')]);}logger[_0x796f('0x12')](_0x796f('0xd'),_0x8ca28f,_0x1b9438[_0x796f('0x12')][_0x796f('0x14')]);return _0x2b021b(_0x1b9438['error']['message']);}else{logger[_0x796f('0xc')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x8ca28f,_0x796f('0xe'));_0x2b021b(_0x1b9438[_0x796f('0x15')][_0x796f('0x14')]);}})[_0x796f('0x16')](function(_0x3762a4){logger[_0x796f('0x12')](_0x796f('0xd'),_0x8ca28f,_0x3762a4);_0x28b68a(_0x3762a4);});});} \ No newline at end of file +var _0xf60b=['debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent'];(function(_0x32a63c,_0x3fd81e){var _0x34d148=function(_0x17b135){while(--_0x17b135){_0x32a63c['push'](_0x32a63c['shift']());}};_0x34d148(++_0x3fd81e);}(_0xf60b,0xe3));var _0xbf60=function(_0x1460f6,_0x59051a){_0x1460f6=_0x1460f6-0x0;var _0x46ce94=_0xf60b[_0x1460f6];return _0x46ce94;};'use strict';var _=require(_0xbf60('0x0'));var util=require('util');var moment=require(_0xbf60('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf60('0x2'));var db=require(_0xbf60('0x3'))['db'];var utils=require(_0xbf60('0x4'));var logger=require(_0xbf60('0x5'))(_0xbf60('0x6'));var config=require('../../config/environment');var jayson=require(_0xbf60('0x7'));var client=jayson[_0xbf60('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2eadaf,_0x4ce644,_0x61ba3c){return new BPromise(function(_0x1f554c,_0x5709c3){return client[_0xbf60('0x9')](_0x2eadaf,_0x61ba3c)['then'](function(_0x5b8b66){logger[_0xbf60('0xa')](_0xbf60('0xb'),_0x4ce644,_0xbf60('0xc'));logger[_0xbf60('0xd')](_0xbf60('0xe'),_0x4ce644,_0xbf60('0xc'),JSON[_0xbf60('0xf')](_0x5b8b66));if(_0x5b8b66[_0xbf60('0x10')]){if(_0x5b8b66['error'][_0xbf60('0x11')]===0x1f4){logger[_0xbf60('0x10')](_0xbf60('0xb'),_0x4ce644,_0x5b8b66['error'][_0xbf60('0x12')]);return _0x5709c3(_0x5b8b66[_0xbf60('0x10')][_0xbf60('0x12')]);}logger[_0xbf60('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x4ce644,_0x5b8b66['error'][_0xbf60('0x12')]);return _0x1f554c(_0x5b8b66[_0xbf60('0x10')][_0xbf60('0x12')]);}else{logger[_0xbf60('0xa')](_0xbf60('0xb'),_0x4ce644,_0xbf60('0xc'));_0x1f554c(_0x5b8b66['result']['message']);}})[_0xbf60('0x13')](function(_0x411130){logger[_0xbf60('0x10')](_0xbf60('0xb'),_0x4ce644,_0x411130);_0x5709c3(_0x411130);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 3ec44c6..fd11185 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 _0x6789=['30s','post','/:id/clone','clone','put','/:id','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','index','get','isAuthenticated','show','/:id/sessions','/:id/answers','getAnswers','/:id/summary'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x6789,0xf4));var _0x9678=function(_0x887075,_0x39dcf9){_0x887075=_0x887075-0x0;var _0x30f82b=_0x6789[_0x887075];return _0x30f82b;};'use strict';var multer=require(_0x9678('0x0'));var util=require('util');var path=require(_0x9678('0x1'));var timeout=require('connect-timeout');var express=require(_0x9678('0x2'));var router=express[_0x9678('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9678('0x4'));var interaction=require(_0x9678('0x5'));var config=require(_0x9678('0x6'));var controller=require(_0x9678('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x9678('0x8')]);router[_0x9678('0x9')]('/:id',auth[_0x9678('0xa')](),controller[_0x9678('0xb')]);router[_0x9678('0x9')](_0x9678('0xc'),auth['isAuthenticated'](),controller['getSessions']);router['get'](_0x9678('0xd'),auth[_0x9678('0xa')](),controller[_0x9678('0xe')]);router[_0x9678('0x9')](_0x9678('0xf'),auth[_0x9678('0xa')](),timeout(_0x9678('0x10')),controller['getSummary']);router[_0x9678('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9678('0x11')](_0x9678('0x12'),auth['isAuthenticated'](),controller[_0x9678('0x13')]);router[_0x9678('0x14')](_0x9678('0x15'),auth[_0x9678('0xa')](),controller[_0x9678('0x16')]);router[_0x9678('0x17')](_0x9678('0x15'),auth[_0x9678('0xa')](),controller[_0x9678('0x18')]);module[_0x9678('0x19')]=router; \ No newline at end of file +var _0xdc9d=['/:id/clone','clone','put','update','destroy','util','connect-timeout','fs-extra','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','getSummary','post','create'];(function(_0x25678a,_0x3e123b){var _0x2552f7=function(_0x663ac1){while(--_0x663ac1){_0x25678a['push'](_0x25678a['shift']());}};_0x2552f7(++_0x3e123b);}(_0xdc9d,0xf7));var _0xddc9=function(_0x1f865a,_0xf1cdb6){_0x1f865a=_0x1f865a-0x0;var _0x42c455=_0xdc9d[_0x1f865a];return _0x42c455;};'use strict';var multer=require('multer');var util=require(_0xddc9('0x0'));var path=require('path');var timeout=require(_0xddc9('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xddc9('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xddc9('0x3'));var controller=require(_0xddc9('0x4'));router[_0xddc9('0x5')]('/',auth[_0xddc9('0x6')](),controller[_0xddc9('0x7')]);router[_0xddc9('0x5')](_0xddc9('0x8'),auth['isAuthenticated'](),controller['show']);router['get'](_0xddc9('0x9'),auth[_0xddc9('0x6')](),controller[_0xddc9('0xa')]);router[_0xddc9('0x5')](_0xddc9('0xb'),auth['isAuthenticated'](),controller[_0xddc9('0xc')]);router[_0xddc9('0x5')](_0xddc9('0xd'),auth['isAuthenticated'](),timeout('30s'),controller[_0xddc9('0xe')]);router[_0xddc9('0xf')]('/',auth[_0xddc9('0x6')](),controller[_0xddc9('0x10')]);router[_0xddc9('0xf')](_0xddc9('0x11'),auth[_0xddc9('0x6')](),controller[_0xddc9('0x12')]);router[_0xddc9('0x13')](_0xddc9('0x8'),auth['isAuthenticated'](),controller[_0xddc9('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xddc9('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 0d8b2b7..375a658 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 _0x4c83=['exports','STRING','name','TEXT','isObjectLike','setDataValue','formData','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','description','BOOLEAN','lodash','util'];(function(_0x4b6804,_0x301b24){var _0x11b4f1=function(_0x31e66c){while(--_0x31e66c){_0x4b6804['push'](_0x4b6804['shift']());}};_0x11b4f1(++_0x301b24);}(_0x4c83,0x7c));var _0x34c8=function(_0x54ce34,_0x1cf867){_0x54ce34=_0x54ce34-0x0;var _0x6fdbc3=_0x4c83[_0x54ce34];return _0x6fdbc3;};'use strict';var Sequelize=require('sequelize');var _=require(_0x34c8('0x0'));var util=require(_0x34c8('0x1'));module[_0x34c8('0x2')]={'name':{'type':Sequelize[_0x34c8('0x3')],'unique':_0x34c8('0x4')},'description':{'type':Sequelize[_0x34c8('0x3')]},'formData':{'type':Sequelize[_0x34c8('0x5')]('long'),'set':function(_0x53d7f8){if(_[_0x34c8('0x6')](_0x53d7f8)){this[_0x34c8('0x7')](_0x34c8('0x8'),JSON['stringify'](_0x53d7f8));}else if(_[_0x34c8('0x9')](_0x53d7f8)){this['setDataValue'](_0x34c8('0x8'),_0x53d7f8);}else{this[_0x34c8('0x7')](_0x34c8('0x8'),util[_0x34c8('0xa')](_0x34c8('0xb'),this['getDataValue'](_0x34c8('0x4'))||'',this['getDataValue'](_0x34c8('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x34c8('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x34c8('0xd')],'defaultValue':![]}}; \ No newline at end of file +var _0x69a2=['exports','STRING','name','TEXT','long','setDataValue','stringify','isString','formData','format','getDataValue','description','BOOLEAN','util'];(function(_0x482672,_0x49d13c){var _0x32236b=function(_0xe81f5e){while(--_0xe81f5e){_0x482672['push'](_0x482672['shift']());}};_0x32236b(++_0x49d13c);}(_0x69a2,0x133));var _0x269a=function(_0x48cc31,_0x5aa6e9){_0x48cc31=_0x48cc31-0x0;var _0x2f45e8=_0x69a2[_0x48cc31];return _0x2f45e8;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');var util=require(_0x269a('0x0'));module[_0x269a('0x1')]={'name':{'type':Sequelize[_0x269a('0x2')],'unique':_0x269a('0x3')},'description':{'type':Sequelize[_0x269a('0x2')]},'formData':{'type':Sequelize[_0x269a('0x4')](_0x269a('0x5')),'set':function(_0x456654){if(_['isObjectLike'](_0x456654)){this[_0x269a('0x6')]('formData',JSON[_0x269a('0x7')](_0x456654));}else if(_[_0x269a('0x8')](_0x456654)){this[_0x269a('0x6')](_0x269a('0x9'),_0x456654);}else{this[_0x269a('0x6')]('formData',util[_0x269a('0xa')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x269a('0xb')]('name')||'',this[_0x269a('0xb')](_0x269a('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x269a('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index d73d78b..757d8aa 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 _0x1730=['sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','destroy','then','UserProfileResource','error','stack','name','send','JscriptyProject','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','map','type','merge','options','includeAll','include','rows','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Projects','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','UserProfileSection','getSessions','JscriptySessionReport','length','ProjectId','findAll','getAnswers','findOne','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','format','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb'];(function(_0x322fd7,_0x63907b){var _0x2f3874=function(_0x48019e){while(--_0x48019e){_0x322fd7['push'](_0x322fd7['shift']());}};_0x2f3874(++_0x63907b);}(_0x1730,0xda));var _0x0173=function(_0x26211e,_0x32cb97){_0x26211e=_0x26211e-0x0;var _0x507a8b=_0x1730[_0x26211e];return _0x507a8b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0173('0x0'));var zipdir=require(_0x0173('0x1'));var jsonpatch=require(_0x0173('0x2'));var rp=require(_0x0173('0x3'));var moment=require(_0x0173('0x4'));var BPromise=require(_0x0173('0x5'));var Mustache=require(_0x0173('0x6'));var util=require(_0x0173('0x7'));var path=require(_0x0173('0x8'));var sox=require(_0x0173('0x9'));var csv=require(_0x0173('0xa'));var ejs=require(_0x0173('0xb'));var fs=require('fs');var fs_extra=require(_0x0173('0xc'));var _=require(_0x0173('0xd'));var squel=require(_0x0173('0xe'));var crypto=require(_0x0173('0xf'));var jsforce=require(_0x0173('0x10'));var deskjs=require(_0x0173('0x11'));var toCsv=require('to-csv');var querystring=require(_0x0173('0x12'));var Papa=require(_0x0173('0x13'));var Redis=require(_0x0173('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x0173('0x15'));var as=require(_0x0173('0x16'));var hardwareService=require(_0x0173('0x17'));var logger=require(_0x0173('0x18'))(_0x0173('0x19'));var utils=require('../../config/utils');var config=require(_0x0173('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x0173('0x1b'))['db'];function respondWithStatusCode(_0x403369,_0x3c9e19){_0x3c9e19=_0x3c9e19||0xcc;return function(_0x4887c1){if(_0x4887c1){return _0x403369[_0x0173('0x1c')](_0x3c9e19);}return _0x403369[_0x0173('0x1d')](_0x3c9e19)[_0x0173('0x1e')]();};}function respondWithResult(_0x693155,_0x456f1d){_0x456f1d=_0x456f1d||0xc8;return function(_0x2bcde8){if(_0x2bcde8){return _0x693155[_0x0173('0x1d')](_0x456f1d)[_0x0173('0x1f')](_0x2bcde8);}};}function respondWithFilteredResult(_0x75e482,_0x21a92e){return function(_0x2ba465){if(_0x2ba465){var _0x5a924b=typeof _0x21a92e[_0x0173('0x20')]==='undefined'&&typeof _0x21a92e[_0x0173('0x21')]===_0x0173('0x22');var _0x1f5753=_0x2ba465[_0x0173('0x23')];var _0x2abedd=_0x5a924b?0x0:_0x21a92e['offset'];var _0x9a5114=_0x5a924b?_0x2ba465[_0x0173('0x23')]:_0x21a92e[_0x0173('0x20')]+_0x21a92e[_0x0173('0x21')];var _0x39991c;if(_0x9a5114>=_0x1f5753){_0x9a5114=_0x1f5753;_0x39991c=0xc8;}else{_0x39991c=0xce;}_0x75e482[_0x0173('0x1d')](_0x39991c);return _0x75e482['set'](_0x0173('0x24'),_0x2abedd+'-'+_0x9a5114+'/'+_0x1f5753)['json'](_0x2ba465);}return null;};}function patchUpdates(_0x5e6a1b){return function(_0x44c0fa){try{jsonpatch[_0x0173('0x25')](_0x44c0fa,_0x5e6a1b,!![]);}catch(_0x50b83d){return BPromise[_0x0173('0x26')](_0x50b83d);}return _0x44c0fa['save']();};}function saveUpdates(_0xb50a98,_0x454065){return function(_0x3fd8ef){if(_0x3fd8ef){return _0x3fd8ef[_0x0173('0x27')](_0xb50a98)['then'](function(_0x45a025){return _0x45a025;});}return null;};}function removeEntity(_0x4b5785,_0x4c1d42){return function(_0x151503){if(_0x151503){return _0x151503[_0x0173('0x28')]()[_0x0173('0x29')](function(){var _0x957a7c=_0x151503['get']({'plain':!![]});var _0x4a6464='Projects';return db[_0x0173('0x2a')][_0x0173('0x28')]({'where':{'type':_0x4a6464,'resourceId':_0x957a7c['id']}})['then'](function(){return _0x151503;});})[_0x0173('0x29')](function(){_0x4b5785[_0x0173('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5531a5,_0x659a80){return function(_0x40cee9){if(!_0x40cee9){_0x5531a5[_0x0173('0x1c')](0x194);}return _0x40cee9;};}function handleError(_0x19d518,_0x574e45){_0x574e45=_0x574e45||0x1f4;return function(_0x489aa3){logger[_0x0173('0x2b')](_0x489aa3[_0x0173('0x2c')]);if(_0x489aa3[_0x0173('0x2d')]){delete _0x489aa3[_0x0173('0x2d')];}_0x19d518[_0x0173('0x1d')](_0x574e45)[_0x0173('0x2e')](_0x489aa3);};}exports['index']=function(_0x358bec,_0x57815){var _0x2e0cd9={},_0x3013de={},_0x2c6984={'count':0x0,'rows':[]};var _0x37ddc5=_['map'](db[_0x0173('0x2f')][_0x0173('0x30')],function(_0x6138e2){return{'name':_0x6138e2[_0x0173('0x31')],'type':_0x6138e2['type'][_0x0173('0x32')]};});_0x3013de[_0x0173('0x33')]=_['map'](_0x37ddc5,'name');_0x3013de['query']=_[_0x0173('0x34')](_0x358bec[_0x0173('0x35')]);_0x3013de['filters']=_[_0x0173('0x36')](_0x3013de[_0x0173('0x33')],_0x3013de[_0x0173('0x35')]);_0x2e0cd9[_0x0173('0x37')]=_[_0x0173('0x36')](_0x3013de[_0x0173('0x33')],qs[_0x0173('0x38')](_0x358bec[_0x0173('0x35')][_0x0173('0x38')]));_0x2e0cd9[_0x0173('0x37')]=_0x2e0cd9[_0x0173('0x37')]['length']?_0x2e0cd9['attributes']:_0x3013de[_0x0173('0x33')];if(!_0x358bec['query'][_0x0173('0x39')](_0x0173('0x3a'))){_0x2e0cd9[_0x0173('0x21')]=qs['limit'](_0x358bec[_0x0173('0x35')][_0x0173('0x21')]);_0x2e0cd9[_0x0173('0x20')]=qs[_0x0173('0x20')](_0x358bec[_0x0173('0x35')][_0x0173('0x20')]);}_0x2e0cd9[_0x0173('0x3b')]=qs[_0x0173('0x3c')](_0x358bec[_0x0173('0x35')]['sort']);_0x2e0cd9[_0x0173('0x3d')]=qs[_0x0173('0x3e')](_[_0x0173('0x3f')](_0x358bec[_0x0173('0x35')],_0x3013de[_0x0173('0x3e')]),_0x37ddc5);if(_0x358bec[_0x0173('0x35')][_0x0173('0x40')]){_0x2e0cd9['where']=_['merge'](_0x2e0cd9[_0x0173('0x3d')],{'$or':_[_0x0173('0x41')](_0x37ddc5,function(_0x7552e1){if(_0x7552e1[_0x0173('0x42')]!=='VIRTUAL'){var _0x3de9cc={};_0x3de9cc[_0x7552e1[_0x0173('0x2d')]]={'$like':'%'+_0x358bec[_0x0173('0x35')][_0x0173('0x40')]+'%'};return _0x3de9cc;}})});}_0x2e0cd9=_[_0x0173('0x43')]({},_0x2e0cd9,_0x358bec[_0x0173('0x44')]);var _0xd25980={'where':_0x2e0cd9[_0x0173('0x3d')]};return db[_0x0173('0x2f')][_0x0173('0x23')](_0xd25980)['then'](function(_0x5be0e8){_0x2c6984['count']=_0x5be0e8;if(_0x358bec[_0x0173('0x35')][_0x0173('0x45')]){_0x2e0cd9[_0x0173('0x46')]=[{'all':!![]}];}return db[_0x0173('0x2f')]['findAll'](_0x2e0cd9);})[_0x0173('0x29')](function(_0x15b3ee){_0x2c6984[_0x0173('0x47')]=_0x15b3ee;return _0x2c6984;})['then'](respondWithFilteredResult(_0x57815,_0x2e0cd9))[_0x0173('0x48')](handleError(_0x57815,null));};exports[_0x0173('0x49')]=function(_0x4bbe5b,_0x1c5eb5){var _0x269b55={'raw':![],'where':{'id':_0x4bbe5b[_0x0173('0x4a')]['id']}},_0x42f63a={};_0x42f63a['model']=_[_0x0173('0x34')](db[_0x0173('0x2f')][_0x0173('0x30')]);_0x42f63a['query']=_[_0x0173('0x34')](_0x4bbe5b[_0x0173('0x35')]);_0x42f63a[_0x0173('0x3e')]=_[_0x0173('0x36')](_0x42f63a[_0x0173('0x33')],_0x42f63a[_0x0173('0x35')]);_0x269b55['attributes']=_[_0x0173('0x36')](_0x42f63a[_0x0173('0x33')],qs['fields'](_0x4bbe5b[_0x0173('0x35')][_0x0173('0x38')]));_0x269b55[_0x0173('0x37')]=_0x269b55[_0x0173('0x37')]['length']?_0x269b55[_0x0173('0x37')]:_0x42f63a[_0x0173('0x33')];if(_0x4bbe5b[_0x0173('0x35')][_0x0173('0x45')]){_0x269b55[_0x0173('0x46')]=[{'all':!![]}];}_0x269b55=_[_0x0173('0x43')]({},_0x269b55,_0x4bbe5b[_0x0173('0x44')]);return db['JscriptyProject'][_0x0173('0x4b')](_0x269b55)[_0x0173('0x29')](handleEntityNotFound(_0x1c5eb5,null))[_0x0173('0x29')](respondWithResult(_0x1c5eb5,null))[_0x0173('0x48')](handleError(_0x1c5eb5,null));};exports[_0x0173('0x4c')]=function(_0x2e921d,_0x43e71d){return db['JscriptyProject'][_0x0173('0x4c')](_0x2e921d[_0x0173('0x4d')],{})['then'](function(_0x5e3040){var _0x5f0020=_0x2e921d[_0x0173('0x4e')][_0x0173('0x4f')]({'plain':!![]});if(!_0x5f0020)throw new Error(_0x0173('0x50'));if(_0x5f0020[_0x0173('0x51')]===_0x0173('0x4e')){var _0x37822d=_0x5e3040[_0x0173('0x4f')]({'plain':!![]});var _0x233749=_0x0173('0x52');return db['UserProfileSection'][_0x0173('0x4b')]({'where':{'name':_0x233749,'userProfileId':_0x5f0020[_0x0173('0x53')]},'raw':!![]})['then'](function(_0x4d4f81){if(_0x4d4f81&&_0x4d4f81[_0x0173('0x54')]===0x0){return db[_0x0173('0x2a')][_0x0173('0x4c')]({'name':_0x37822d['name'],'resourceId':_0x37822d['id'],'type':_0x4d4f81[_0x0173('0x2d')],'sectionId':_0x4d4f81['id']},{})[_0x0173('0x29')](function(){return _0x5e3040;});}else{return _0x5e3040;}})['catch'](function(_0x1b3d76){logger[_0x0173('0x2b')](_0x0173('0x55'),_0x1b3d76);throw _0x1b3d76;});}return _0x5e3040;})['then'](respondWithResult(_0x43e71d,0xc9))[_0x0173('0x48')](handleError(_0x43e71d,null));};exports['clone']=function(_0x4ed583,_0x1e7ea4){var _0x409387={'where':{'id':_0x4ed583['params']['id']}},_0x773cf5={};_0x773cf5['model']=_[_0x0173('0x34')](db[_0x0173('0x2f')][_0x0173('0x30')]);_0x409387['attributes']=_[_0x0173('0x36')](_0x773cf5[_0x0173('0x33')],qs[_0x0173('0x38')](_0x4ed583['query'][_0x0173('0x38')]));_0x409387[_0x0173('0x37')]=_0x409387['attributes']['length']?_0x409387[_0x0173('0x37')]:_0x773cf5[_0x0173('0x33')];if(_0x4ed583[_0x0173('0x35')][_0x0173('0x45')]){_0x409387['include']=[{'all':!![]}];}_0x409387=_['merge']({},_0x409387,_0x4ed583[_0x0173('0x44')]);return db[_0x0173('0x2f')]['find'](_0x409387)[_0x0173('0x29')](handleEntityNotFound(_0x1e7ea4,null))['then'](function(_0x459859){if(_0x459859){var _0x3fd4e3=_0x459859[_0x0173('0x4f')]({'plain':!![]});_0x3fd4e3=qs['omit'](_0x3fd4e3,['id',_0x0173('0x56'),_0x0173('0x57')]);_0x4ed583[_0x0173('0x4d')]=_['omit'](_0x4ed583[_0x0173('0x4d')],['id','createdAt',_0x0173('0x57')]);return db[_0x0173('0x2f')][_0x0173('0x4c')](_[_0x0173('0x43')](_0x3fd4e3,_0x4ed583[_0x0173('0x4d')]),{'include':_0x4ed583[_0x0173('0x35')][_0x0173('0x45')]?[{'all':!![]}]:undefined})[_0x0173('0x29')](function(_0x5dcfa3){var _0x5ad152=_0x4ed583[_0x0173('0x4e')][_0x0173('0x4f')]({'plain':!![]});if(!_0x5ad152)throw new Error(_0x0173('0x50'));if(_0x5ad152[_0x0173('0x51')]===_0x0173('0x4e')){var _0x2340cd=_0x5dcfa3[_0x0173('0x4f')]({'plain':!![]});var _0x507280=_0x0173('0x52');return db[_0x0173('0x58')][_0x0173('0x4b')]({'where':{'name':_0x507280,'userProfileId':_0x5ad152['userProfileId']},'raw':!![]})['then'](function(_0x507629){if(_0x507629&&_0x507629[_0x0173('0x54')]===0x0){return db[_0x0173('0x2a')][_0x0173('0x4c')]({'name':_0x2340cd['name'],'resourceId':_0x2340cd['id'],'type':_0x507629[_0x0173('0x2d')],'sectionId':_0x507629['id']},{})[_0x0173('0x29')](function(){return _0x5dcfa3;});}else{return _0x5dcfa3;}})[_0x0173('0x48')](function(_0x50c0f4){logger['error'](_0x0173('0x55'),_0x50c0f4);throw _0x50c0f4;});}return _0x5dcfa3;});}})[_0x0173('0x29')](respondWithResult(_0x1e7ea4,0xc9))['catch'](handleError(_0x1e7ea4,null));};exports['update']=function(_0x3eb34c,_0x5ef105){if(_0x3eb34c[_0x0173('0x4d')]['id']){delete _0x3eb34c[_0x0173('0x4d')]['id'];}return db[_0x0173('0x2f')][_0x0173('0x4b')]({'where':{'id':_0x3eb34c['params']['id']}})[_0x0173('0x29')](handleEntityNotFound(_0x5ef105,null))[_0x0173('0x29')](saveUpdates(_0x3eb34c[_0x0173('0x4d')],null))[_0x0173('0x29')](respondWithResult(_0x5ef105,null))[_0x0173('0x48')](handleError(_0x5ef105,null));};exports[_0x0173('0x28')]=function(_0x991534,_0x320e83){return db[_0x0173('0x2f')][_0x0173('0x4b')]({'where':{'id':_0x991534[_0x0173('0x4a')]['id']}})[_0x0173('0x29')](handleEntityNotFound(_0x320e83,null))[_0x0173('0x29')](removeEntity(_0x320e83,null))[_0x0173('0x48')](handleError(_0x320e83,null));};exports[_0x0173('0x59')]=function(_0x45e282,_0x2a4db4,_0x27ba07){var _0xc0117c={'raw':!![],'where':{}};var _0x7245={};var _0x227f98={'count':0x0,'rows':[]};return db[_0x0173('0x2f')]['findOne']({'where':{'id':_0x45e282[_0x0173('0x4a')]['id']}})[_0x0173('0x29')](handleEntityNotFound(_0x2a4db4,null))['then'](function(_0x28cd6a){if(_0x28cd6a){_0x7245[_0x0173('0x33')]=_['keys'](db[_0x0173('0x5a')][_0x0173('0x30')]);_0x7245[_0x0173('0x35')]=_['keys'](_0x45e282[_0x0173('0x35')]);_0x7245[_0x0173('0x3e')]=_[_0x0173('0x36')](_0x7245[_0x0173('0x33')],_0x7245[_0x0173('0x35')]);_0xc0117c[_0x0173('0x37')]=_['intersection'](_0x7245[_0x0173('0x33')],qs[_0x0173('0x38')](_0x45e282[_0x0173('0x35')][_0x0173('0x38')]));_0xc0117c[_0x0173('0x37')]=_0xc0117c['attributes'][_0x0173('0x5b')]?_0xc0117c['attributes']:_0x7245[_0x0173('0x33')];if(!_0x45e282[_0x0173('0x35')][_0x0173('0x39')](_0x0173('0x3a'))){_0xc0117c[_0x0173('0x21')]=qs[_0x0173('0x21')](_0x45e282[_0x0173('0x35')][_0x0173('0x21')]);_0xc0117c[_0x0173('0x20')]=qs['offset'](_0x45e282['query'][_0x0173('0x20')]);}_0xc0117c[_0x0173('0x3b')]=qs[_0x0173('0x3c')](_0x45e282[_0x0173('0x35')][_0x0173('0x3c')]);_0xc0117c['where']=qs[_0x0173('0x3e')](_[_0x0173('0x3f')](_0x45e282[_0x0173('0x35')],_0x7245[_0x0173('0x3e')]));_0xc0117c[_0x0173('0x3d')][_0x0173('0x5c')]=_0x28cd6a['id'];if(_0x45e282['query'][_0x0173('0x40')]){_0xc0117c[_0x0173('0x3d')]=_[_0x0173('0x43')](_0xc0117c['where'],{'$or':_['map'](_0xc0117c[_0x0173('0x37')],function(_0x251b9a){var _0x41848d={};_0x41848d[_0x251b9a]={'$like':'%'+_0x45e282[_0x0173('0x35')][_0x0173('0x40')]+'%'};return _0x41848d;})});}_0xc0117c=_[_0x0173('0x43')]({},_0xc0117c,_0x45e282['options']);return db[_0x0173('0x5a')][_0x0173('0x23')]({'where':_0xc0117c[_0x0173('0x3d')]})[_0x0173('0x29')](function(_0x457ae8){_0x227f98[_0x0173('0x23')]=_0x457ae8;if(_0x45e282[_0x0173('0x35')][_0x0173('0x45')]){_0xc0117c[_0x0173('0x46')]=[{'all':!![]}];}return db[_0x0173('0x5a')][_0x0173('0x5d')](_0xc0117c);})[_0x0173('0x29')](function(_0x576b9b){_0x227f98['rows']=_0x576b9b;return _0x227f98;});}})[_0x0173('0x29')](respondWithFilteredResult(_0x2a4db4,_0xc0117c))[_0x0173('0x48')](handleError(_0x2a4db4,null));};exports[_0x0173('0x5e')]=function(_0x1958e9,_0x22dae1,_0x3c78e8){var _0x41704d={'raw':!![],'where':{}};var _0x13aea3={};var _0x646ab1={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x0173('0x5f')]({'where':{'id':_0x1958e9['params']['id']}})['then'](handleEntityNotFound(_0x22dae1,null))['then'](function(_0x227489){if(_0x227489){_0x13aea3['model']=_['keys'](db['JscriptyAnswerReport']['rawAttributes']);_0x13aea3[_0x0173('0x35')]=_[_0x0173('0x34')](_0x1958e9[_0x0173('0x35')]);_0x13aea3[_0x0173('0x3e')]=_['intersection'](_0x13aea3[_0x0173('0x33')],_0x13aea3[_0x0173('0x35')]);_0x41704d[_0x0173('0x37')]=_[_0x0173('0x36')](_0x13aea3[_0x0173('0x33')],qs[_0x0173('0x38')](_0x1958e9[_0x0173('0x35')][_0x0173('0x38')]));_0x41704d[_0x0173('0x37')]=_0x41704d[_0x0173('0x37')][_0x0173('0x5b')]?_0x41704d['attributes']:_0x13aea3[_0x0173('0x33')];if(!_0x1958e9[_0x0173('0x35')][_0x0173('0x39')](_0x0173('0x3a'))){_0x41704d[_0x0173('0x21')]=qs[_0x0173('0x21')](_0x1958e9[_0x0173('0x35')][_0x0173('0x21')]);_0x41704d[_0x0173('0x20')]=qs[_0x0173('0x20')](_0x1958e9[_0x0173('0x35')][_0x0173('0x20')]);}_0x41704d[_0x0173('0x3b')]=qs[_0x0173('0x3c')](_0x1958e9[_0x0173('0x35')][_0x0173('0x3c')]);_0x41704d[_0x0173('0x3d')]=qs['filters'](_[_0x0173('0x3f')](_0x1958e9[_0x0173('0x35')],_0x13aea3['filters']));_0x41704d[_0x0173('0x3d')][_0x0173('0x5c')]=_0x227489['id'];if(_0x1958e9[_0x0173('0x35')]['filter']){_0x41704d[_0x0173('0x3d')]=_[_0x0173('0x43')](_0x41704d[_0x0173('0x3d')],{'$or':_['map'](_0x41704d[_0x0173('0x37')],function(_0x4c4883){var _0x13bc32={};_0x13bc32[_0x4c4883]={'$like':'%'+_0x1958e9[_0x0173('0x35')][_0x0173('0x40')]+'%'};return _0x13bc32;})});}_0x41704d=_[_0x0173('0x43')]({},_0x41704d,_0x1958e9[_0x0173('0x44')]);return db[_0x0173('0x60')][_0x0173('0x23')]({'where':_0x41704d[_0x0173('0x3d')]})[_0x0173('0x29')](function(_0x599bb2){_0x646ab1[_0x0173('0x23')]=_0x599bb2;if(_0x1958e9[_0x0173('0x35')][_0x0173('0x45')]){_0x41704d[_0x0173('0x46')]=[{'all':!![]}];}return db[_0x0173('0x60')][_0x0173('0x5d')](_0x41704d);})[_0x0173('0x29')](function(_0x4a0d8c){_0x646ab1[_0x0173('0x47')]=_0x4a0d8c;return _0x646ab1;});}})[_0x0173('0x29')](respondWithFilteredResult(_0x22dae1,_0x41704d))[_0x0173('0x48')](handleError(_0x22dae1,null));};function char(_0x3bc5ba){return _0x0173('0x61')===typeof _0x3bc5ba?String[_0x0173('0x62')][_0x0173('0x25')](null,arguments):_0x3bc5ba;}function needsEncapsulation(_0x57738a){return!!_0x57738a&&(_0x57738a[_0x0173('0x63')]()['indexOf'](char(0xd))>=0x0||_0x57738a[_0x0173('0x63')]()[_0x0173('0x64')](char(0xa))>=0x0||_0x57738a['toString']()[_0x0173('0x64')](char(0x2c))>=0x0||_0x57738a[_0x0173('0x63')]()[_0x0173('0x64')](char(0x22))>=0x0);}function encapsulate(_0x34242c){var _0x441311=char(0x22),_0x3e5c19='\x5c'+char(0x22),_0x39e071=_0x34242c['toString']()['replace'](new RegExp(_0x441311,'g'),_0x3e5c19);return _0x441311+_0x39e071+_0x441311;}exports[_0x0173('0x65')]=function(_0x40c749,_0x404255,_0x3058cb){var _0x28522c,_0x2044e7;var _0x1e6ba9={'where':{'ProjectId':_0x40c749[_0x0173('0x4a')]['id']}};if(_0x40c749[_0x0173('0x35')][_0x0173('0x66')]){_0x1e6ba9[_0x0173('0x3d')][_0x0173('0x67')]=JSON[_0x0173('0x68')](_0x40c749[_0x0173('0x35')]['startTime']);}return db['JscriptySessionReport'][_0x0173('0x5d')](_0x1e6ba9)[_0x0173('0x29')](handleEntityNotFound(_0x404255,null))[_0x0173('0x29')](function(_0x1059f8){if(_0x1059f8){_0x28522c=_0x1059f8;return db[_0x0173('0x69')][_0x0173('0x5d')]({'where':{'SessionId':{'$in':_[_0x0173('0x41')](_0x28522c,'id')},'ProjectId':_0x40c749[_0x0173('0x4a')]['id']},'order':_0x0173('0x6a')});}})[_0x0173('0x29')](handleEntityNotFound(_0x404255,null))[_0x0173('0x29')](function(_0x4333ed){if(_0x4333ed){_0x2044e7=_0x4333ed;var _0x4fe095={};for(var _0x5a220d=0x0,_0x216164=_0x2044e7['length'];_0x5a220d<_0x216164;_0x5a220d++){if(!_0x4fe095[_0x0173('0x39')](_0x2044e7[_0x5a220d]['questionId'])){_0x4fe095[_0x2044e7[_0x5a220d][_0x0173('0x6b')]]=needsEncapsulation(_0x2044e7[_0x5a220d][_0x0173('0x6c')])?encapsulate(_0x2044e7[_0x5a220d]['question']):_0x2044e7[_0x5a220d]['question'];}}var _0x25757b=[],_0x143e2f={};for(var _0x26470c=0x0,_0x12261c=_0x28522c[_0x0173('0x5b')];_0x26470c<_0x12261c;_0x26470c++){_0x143e2f={'ProjectId':_0x40c749['params']['id'],'SessionId':_0x28522c[_0x26470c]['id'],'StartTime':moment(_0x28522c[_0x26470c][_0x0173('0x67')])['format'](_0x0173('0x6d'))};for(var _0x1dcdab=0x0,_0x1d2211=_0x2044e7[_0x0173('0x5b')];_0x1dcdab<_0x1d2211;_0x1dcdab++){if(_0x2044e7[_0x1dcdab][_0x0173('0x6e')]==_0x28522c[_0x26470c]['id']&&_0x4fe095['hasOwnProperty'](_0x2044e7[_0x1dcdab][_0x0173('0x6b')])){_0x143e2f[_0x4fe095[_0x2044e7[_0x1dcdab][_0x0173('0x6b')]]]=_0x2044e7[_0x1dcdab][_0x0173('0x6f')];}}for(var _0x165539 in _0x4fe095){if(!_0x143e2f[_0x0173('0x39')](_0x4fe095[_0x165539])){_0x143e2f[_0x4fe095[_0x165539]]=null;}}_0x25757b[_0x0173('0x70')](_0x143e2f);}return _0x25757b;}})['then'](function(_0x67cffb){if(!_[_0x0173('0x71')](_0x67cffb)){var _0x1e9aad=toCsv(_0x67cffb);var _0x1c1de3=Date[_0x0173('0x72')]();fs['writeFileSync'](util[_0x0173('0x73')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x40c749[_0x0173('0x4a')]['id'],_0x1c1de3),_0x1e9aad);_0x404255[_0x0173('0x74')](_0x0173('0x75'),_0x0173('0x76')+util[_0x0173('0x73')]('Jscripty_Project_%d_Summary_%s.csv',_0x40c749[_0x0173('0x4a')]['id'],_0x1c1de3));_0x404255[_0x0173('0x74')](_0x0173('0x77'),_0x0173('0x78'));return _0x404255[_0x0173('0x79')](util[_0x0173('0x73')](_0x0173('0x7a'),_0x40c749[_0x0173('0x4a')]['id'],_0x1c1de3));}else{return _0x404255[_0x0173('0x1c')](0xcc);}})[_0x0173('0x48')](handleError(_0x404255,null));}; \ No newline at end of file +var _0x0bf7=['status','json','offset','undefined','limit','count','set','apply','reject','update','then','get','Projects','end','sendStatus','error','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','create','body','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','find','updatedAt','omit','createdAt','role','userProfileId','destroy','getSessions','findOne','pick','ProjectId','JscriptySessionReport','getAnswers','JscriptyAnswerReport','rows','number','toString','indexOf','replace','getSummary','startTime','starttime','-createdAt','questionId','question','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x5212f7,_0x5c9067){var _0x29985d=function(_0x109c5c){while(--_0x109c5c){_0x5212f7['push'](_0x5212f7['shift']());}};_0x29985d(++_0x5c9067);}(_0x0bf7,0x14a));var _0x70bf=function(_0x435a1b,_0x527206){_0x435a1b=_0x435a1b-0x0;var _0x5331b8=_0x0bf7[_0x435a1b];return _0x5331b8;};'use strict';var emlformat=require(_0x70bf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x70bf('0x1'));var jsonpatch=require(_0x70bf('0x2'));var rp=require(_0x70bf('0x3'));var moment=require(_0x70bf('0x4'));var BPromise=require(_0x70bf('0x5'));var Mustache=require(_0x70bf('0x6'));var util=require('util');var path=require(_0x70bf('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x70bf('0x8'));var _=require(_0x70bf('0x9'));var squel=require(_0x70bf('0xa'));var crypto=require(_0x70bf('0xb'));var jsforce=require(_0x70bf('0xc'));var deskjs=require(_0x70bf('0xd'));var toCsv=require(_0x70bf('0xe'));var querystring=require(_0x70bf('0xf'));var Papa=require(_0x70bf('0x10'));var Redis=require(_0x70bf('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x70bf('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x70bf('0x13'))(_0x70bf('0x14'));var utils=require(_0x70bf('0x15'));var config=require(_0x70bf('0x16'));var licenseUtil=require(_0x70bf('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17622f,_0x3653ef){_0x3653ef=_0x3653ef||0xcc;return function(_0x38c27b){if(_0x38c27b){return _0x17622f['sendStatus'](_0x3653ef);}return _0x17622f[_0x70bf('0x18')](_0x3653ef)['end']();};}function respondWithResult(_0x4dbb42,_0x173ea6){_0x173ea6=_0x173ea6||0xc8;return function(_0x15379f){if(_0x15379f){return _0x4dbb42['status'](_0x173ea6)[_0x70bf('0x19')](_0x15379f);}};}function respondWithFilteredResult(_0x595443,_0x1e0dfc){return function(_0x5e5b4a){if(_0x5e5b4a){var _0x5cc8b1=typeof _0x1e0dfc[_0x70bf('0x1a')]===_0x70bf('0x1b')&&typeof _0x1e0dfc[_0x70bf('0x1c')]===_0x70bf('0x1b');var _0x1ffacf=_0x5e5b4a[_0x70bf('0x1d')];var _0x4ecd00=_0x5cc8b1?0x0:_0x1e0dfc[_0x70bf('0x1a')];var _0x3bf356=_0x5cc8b1?_0x5e5b4a[_0x70bf('0x1d')]:_0x1e0dfc['offset']+_0x1e0dfc[_0x70bf('0x1c')];var _0x5378f3;if(_0x3bf356>=_0x1ffacf){_0x3bf356=_0x1ffacf;_0x5378f3=0xc8;}else{_0x5378f3=0xce;}_0x595443[_0x70bf('0x18')](_0x5378f3);return _0x595443[_0x70bf('0x1e')]('Content-Range',_0x4ecd00+'-'+_0x3bf356+'/'+_0x1ffacf)[_0x70bf('0x19')](_0x5e5b4a);}return null;};}function patchUpdates(_0x44e7f1){return function(_0x4c739c){try{jsonpatch[_0x70bf('0x1f')](_0x4c739c,_0x44e7f1,!![]);}catch(_0x5424a6){return BPromise[_0x70bf('0x20')](_0x5424a6);}return _0x4c739c['save']();};}function saveUpdates(_0x392aba,_0x29d319){return function(_0x25ac2d){if(_0x25ac2d){return _0x25ac2d[_0x70bf('0x21')](_0x392aba)[_0x70bf('0x22')](function(_0x4dfe63){return _0x4dfe63;});}return null;};}function removeEntity(_0x18d2e6,_0xb20a35){return function(_0x412716){if(_0x412716){return _0x412716['destroy']()[_0x70bf('0x22')](function(){var _0x240cd5=_0x412716[_0x70bf('0x23')]({'plain':!![]});var _0x54ffd6=_0x70bf('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x54ffd6,'resourceId':_0x240cd5['id']}})[_0x70bf('0x22')](function(){return _0x412716;});})[_0x70bf('0x22')](function(){_0x18d2e6[_0x70bf('0x18')](0xcc)[_0x70bf('0x25')]();});}};}function handleEntityNotFound(_0x62b2a4,_0xcc3dc1){return function(_0x102a12){if(!_0x102a12){_0x62b2a4[_0x70bf('0x26')](0x194);}return _0x102a12;};}function handleError(_0x57451b,_0x2b3659){_0x2b3659=_0x2b3659||0x1f4;return function(_0x23a345){logger[_0x70bf('0x27')](_0x23a345[_0x70bf('0x28')]);if(_0x23a345[_0x70bf('0x29')]){delete _0x23a345[_0x70bf('0x29')];}_0x57451b[_0x70bf('0x18')](_0x2b3659)[_0x70bf('0x2a')](_0x23a345);};}exports[_0x70bf('0x2b')]=function(_0x103fdb,_0x271795){var _0x17acbf={},_0x2df8d7={},_0x397e76={'count':0x0,'rows':[]};var _0x11eb12=_[_0x70bf('0x2c')](db[_0x70bf('0x2d')][_0x70bf('0x2e')],function(_0x24d1d8){return{'name':_0x24d1d8[_0x70bf('0x2f')],'type':_0x24d1d8[_0x70bf('0x30')]['key']};});_0x2df8d7[_0x70bf('0x31')]=_[_0x70bf('0x2c')](_0x11eb12,_0x70bf('0x29'));_0x2df8d7[_0x70bf('0x32')]=_[_0x70bf('0x33')](_0x103fdb[_0x70bf('0x32')]);_0x2df8d7[_0x70bf('0x34')]=_[_0x70bf('0x35')](_0x2df8d7[_0x70bf('0x31')],_0x2df8d7['query']);_0x17acbf[_0x70bf('0x36')]=_[_0x70bf('0x35')](_0x2df8d7['model'],qs[_0x70bf('0x37')](_0x103fdb[_0x70bf('0x32')]['fields']));_0x17acbf['attributes']=_0x17acbf['attributes'][_0x70bf('0x38')]?_0x17acbf[_0x70bf('0x36')]:_0x2df8d7[_0x70bf('0x31')];if(!_0x103fdb[_0x70bf('0x32')][_0x70bf('0x39')](_0x70bf('0x3a'))){_0x17acbf[_0x70bf('0x1c')]=qs[_0x70bf('0x1c')](_0x103fdb[_0x70bf('0x32')][_0x70bf('0x1c')]);_0x17acbf[_0x70bf('0x1a')]=qs[_0x70bf('0x1a')](_0x103fdb[_0x70bf('0x32')]['offset']);}_0x17acbf[_0x70bf('0x3b')]=qs['sort'](_0x103fdb[_0x70bf('0x32')][_0x70bf('0x3c')]);_0x17acbf[_0x70bf('0x3d')]=qs[_0x70bf('0x34')](_['pick'](_0x103fdb[_0x70bf('0x32')],_0x2df8d7[_0x70bf('0x34')]),_0x11eb12);if(_0x103fdb['query'][_0x70bf('0x3e')]){_0x17acbf[_0x70bf('0x3d')]=_['merge'](_0x17acbf[_0x70bf('0x3d')],{'$or':_['map'](_0x11eb12,function(_0x5033cb){if(_0x5033cb[_0x70bf('0x30')]!==_0x70bf('0x3f')){var _0x37d0bf={};_0x37d0bf[_0x5033cb[_0x70bf('0x29')]]={'$like':'%'+_0x103fdb[_0x70bf('0x32')][_0x70bf('0x3e')]+'%'};return _0x37d0bf;}})});}_0x17acbf=_[_0x70bf('0x40')]({},_0x17acbf,_0x103fdb[_0x70bf('0x41')]);var _0x52bfa8={'where':_0x17acbf['where']};return db[_0x70bf('0x2d')][_0x70bf('0x1d')](_0x52bfa8)['then'](function(_0x3fced4){_0x397e76[_0x70bf('0x1d')]=_0x3fced4;if(_0x103fdb['query'][_0x70bf('0x42')]){_0x17acbf[_0x70bf('0x43')]=[{'all':!![]}];}return db[_0x70bf('0x2d')][_0x70bf('0x44')](_0x17acbf);})[_0x70bf('0x22')](function(_0x2b442e){_0x397e76['rows']=_0x2b442e;return _0x397e76;})[_0x70bf('0x22')](respondWithFilteredResult(_0x271795,_0x17acbf))[_0x70bf('0x45')](handleError(_0x271795,null));};exports[_0x70bf('0x46')]=function(_0x1f6609,_0x504863){var _0x5cda41={'raw':![],'where':{'id':_0x1f6609[_0x70bf('0x47')]['id']}},_0x5dc43a={};_0x5dc43a[_0x70bf('0x31')]=_[_0x70bf('0x33')](db['JscriptyProject'][_0x70bf('0x2e')]);_0x5dc43a[_0x70bf('0x32')]=_[_0x70bf('0x33')](_0x1f6609[_0x70bf('0x32')]);_0x5dc43a[_0x70bf('0x34')]=_['intersection'](_0x5dc43a[_0x70bf('0x31')],_0x5dc43a[_0x70bf('0x32')]);_0x5cda41[_0x70bf('0x36')]=_[_0x70bf('0x35')](_0x5dc43a[_0x70bf('0x31')],qs[_0x70bf('0x37')](_0x1f6609['query']['fields']));_0x5cda41['attributes']=_0x5cda41[_0x70bf('0x36')][_0x70bf('0x38')]?_0x5cda41[_0x70bf('0x36')]:_0x5dc43a[_0x70bf('0x31')];if(_0x1f6609[_0x70bf('0x32')][_0x70bf('0x42')]){_0x5cda41['include']=[{'all':!![]}];}_0x5cda41=_[_0x70bf('0x40')]({},_0x5cda41,_0x1f6609[_0x70bf('0x41')]);return db[_0x70bf('0x2d')]['find'](_0x5cda41)[_0x70bf('0x22')](handleEntityNotFound(_0x504863,null))[_0x70bf('0x22')](respondWithResult(_0x504863,null))[_0x70bf('0x45')](handleError(_0x504863,null));};exports[_0x70bf('0x48')]=function(_0x5cb0e0,_0x2a4a42){return db[_0x70bf('0x2d')][_0x70bf('0x48')](_0x5cb0e0[_0x70bf('0x49')],{})[_0x70bf('0x22')](function(_0x2a4a2a){var _0x538f58=_0x5cb0e0[_0x70bf('0x4a')][_0x70bf('0x23')]({'plain':!![]});if(!_0x538f58)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x538f58['role']===_0x70bf('0x4a')){var _0x266af9=_0x2a4a2a[_0x70bf('0x23')]({'plain':!![]});var _0x22ff6a=_0x70bf('0x24');return db[_0x70bf('0x4b')]['find']({'where':{'name':_0x22ff6a,'userProfileId':_0x538f58['userProfileId']},'raw':!![]})['then'](function(_0x12a060){if(_0x12a060&&_0x12a060[_0x70bf('0x4c')]===0x0){return db[_0x70bf('0x4d')][_0x70bf('0x48')]({'name':_0x266af9[_0x70bf('0x29')],'resourceId':_0x266af9['id'],'type':_0x12a060[_0x70bf('0x29')],'sectionId':_0x12a060['id']},{})['then'](function(){return _0x2a4a2a;});}else{return _0x2a4a2a;}})[_0x70bf('0x45')](function(_0x11b98e){logger[_0x70bf('0x27')](_0x70bf('0x4e'),_0x11b98e);throw _0x11b98e;});}return _0x2a4a2a;})[_0x70bf('0x22')](respondWithResult(_0x2a4a42,0xc9))[_0x70bf('0x45')](handleError(_0x2a4a42,null));};exports[_0x70bf('0x4f')]=function(_0x537f5c,_0x529b4c){var _0x1f6fd4={'where':{'id':_0x537f5c['params']['id']}},_0x4b6a77={};_0x4b6a77[_0x70bf('0x31')]=_[_0x70bf('0x33')](db['JscriptyProject'][_0x70bf('0x2e')]);_0x1f6fd4[_0x70bf('0x36')]=_[_0x70bf('0x35')](_0x4b6a77['model'],qs['fields'](_0x537f5c[_0x70bf('0x32')][_0x70bf('0x37')]));_0x1f6fd4[_0x70bf('0x36')]=_0x1f6fd4[_0x70bf('0x36')]['length']?_0x1f6fd4['attributes']:_0x4b6a77[_0x70bf('0x31')];if(_0x537f5c[_0x70bf('0x32')][_0x70bf('0x42')]){_0x1f6fd4['include']=[{'all':!![]}];}_0x1f6fd4=_[_0x70bf('0x40')]({},_0x1f6fd4,_0x537f5c[_0x70bf('0x41')]);return db[_0x70bf('0x2d')][_0x70bf('0x50')](_0x1f6fd4)[_0x70bf('0x22')](handleEntityNotFound(_0x529b4c,null))[_0x70bf('0x22')](function(_0x476f2b){if(_0x476f2b){var _0x1892f5=_0x476f2b[_0x70bf('0x23')]({'plain':!![]});_0x1892f5=qs['omit'](_0x1892f5,['id','createdAt',_0x70bf('0x51')]);_0x537f5c['body']=_[_0x70bf('0x52')](_0x537f5c[_0x70bf('0x49')],['id',_0x70bf('0x53'),'updatedAt']);return db[_0x70bf('0x2d')][_0x70bf('0x48')](_[_0x70bf('0x40')](_0x1892f5,_0x537f5c['body']),{'include':_0x537f5c[_0x70bf('0x32')][_0x70bf('0x42')]?[{'all':!![]}]:undefined})['then'](function(_0xf1af40){var _0x69af4c=_0x537f5c[_0x70bf('0x4a')]['get']({'plain':!![]});if(!_0x69af4c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x69af4c[_0x70bf('0x54')]===_0x70bf('0x4a')){var _0x5c769d=_0xf1af40[_0x70bf('0x23')]({'plain':!![]});var _0x48a0b9='Projects';return db['UserProfileSection'][_0x70bf('0x50')]({'where':{'name':_0x48a0b9,'userProfileId':_0x69af4c[_0x70bf('0x55')]},'raw':!![]})[_0x70bf('0x22')](function(_0x4540b7){if(_0x4540b7&&_0x4540b7['autoAssociation']===0x0){return db['UserProfileResource'][_0x70bf('0x48')]({'name':_0x5c769d[_0x70bf('0x29')],'resourceId':_0x5c769d['id'],'type':_0x4540b7['name'],'sectionId':_0x4540b7['id']},{})[_0x70bf('0x22')](function(){return _0xf1af40;});}else{return _0xf1af40;}})['catch'](function(_0x144a6f){logger[_0x70bf('0x27')](_0x70bf('0x4e'),_0x144a6f);throw _0x144a6f;});}return _0xf1af40;});}})[_0x70bf('0x22')](respondWithResult(_0x529b4c,0xc9))['catch'](handleError(_0x529b4c,null));};exports[_0x70bf('0x21')]=function(_0x16333b,_0x928d4b){if(_0x16333b[_0x70bf('0x49')]['id']){delete _0x16333b['body']['id'];}return db['JscriptyProject']['find']({'where':{'id':_0x16333b['params']['id']}})[_0x70bf('0x22')](handleEntityNotFound(_0x928d4b,null))[_0x70bf('0x22')](saveUpdates(_0x16333b[_0x70bf('0x49')],null))[_0x70bf('0x22')](respondWithResult(_0x928d4b,null))[_0x70bf('0x45')](handleError(_0x928d4b,null));};exports[_0x70bf('0x56')]=function(_0x463bbd,_0xeba193){return db[_0x70bf('0x2d')][_0x70bf('0x50')]({'where':{'id':_0x463bbd[_0x70bf('0x47')]['id']}})[_0x70bf('0x22')](handleEntityNotFound(_0xeba193,null))[_0x70bf('0x22')](removeEntity(_0xeba193,null))[_0x70bf('0x45')](handleError(_0xeba193,null));};exports[_0x70bf('0x57')]=function(_0x45b158,_0x4ac079,_0x407aaa){var _0x303253={'raw':!![],'where':{}};var _0x2c511c={};var _0x32f48e={'count':0x0,'rows':[]};return db[_0x70bf('0x2d')][_0x70bf('0x58')]({'where':{'id':_0x45b158[_0x70bf('0x47')]['id']}})[_0x70bf('0x22')](handleEntityNotFound(_0x4ac079,null))['then'](function(_0x3d554a){if(_0x3d554a){_0x2c511c['model']=_[_0x70bf('0x33')](db['JscriptySessionReport'][_0x70bf('0x2e')]);_0x2c511c[_0x70bf('0x32')]=_['keys'](_0x45b158[_0x70bf('0x32')]);_0x2c511c[_0x70bf('0x34')]=_['intersection'](_0x2c511c[_0x70bf('0x31')],_0x2c511c['query']);_0x303253[_0x70bf('0x36')]=_[_0x70bf('0x35')](_0x2c511c[_0x70bf('0x31')],qs[_0x70bf('0x37')](_0x45b158['query'][_0x70bf('0x37')]));_0x303253[_0x70bf('0x36')]=_0x303253['attributes']['length']?_0x303253[_0x70bf('0x36')]:_0x2c511c[_0x70bf('0x31')];if(!_0x45b158[_0x70bf('0x32')][_0x70bf('0x39')](_0x70bf('0x3a'))){_0x303253[_0x70bf('0x1c')]=qs[_0x70bf('0x1c')](_0x45b158[_0x70bf('0x32')][_0x70bf('0x1c')]);_0x303253[_0x70bf('0x1a')]=qs[_0x70bf('0x1a')](_0x45b158['query'][_0x70bf('0x1a')]);}_0x303253[_0x70bf('0x3b')]=qs[_0x70bf('0x3c')](_0x45b158[_0x70bf('0x32')]['sort']);_0x303253[_0x70bf('0x3d')]=qs['filters'](_[_0x70bf('0x59')](_0x45b158[_0x70bf('0x32')],_0x2c511c[_0x70bf('0x34')]));_0x303253[_0x70bf('0x3d')][_0x70bf('0x5a')]=_0x3d554a['id'];if(_0x45b158[_0x70bf('0x32')][_0x70bf('0x3e')]){_0x303253[_0x70bf('0x3d')]=_['merge'](_0x303253[_0x70bf('0x3d')],{'$or':_[_0x70bf('0x2c')](_0x303253['attributes'],function(_0x17948b){var _0x226827={};_0x226827[_0x17948b]={'$like':'%'+_0x45b158[_0x70bf('0x32')][_0x70bf('0x3e')]+'%'};return _0x226827;})});}_0x303253=_[_0x70bf('0x40')]({},_0x303253,_0x45b158[_0x70bf('0x41')]);return db[_0x70bf('0x5b')]['count']({'where':_0x303253[_0x70bf('0x3d')]})['then'](function(_0x3c25ae){_0x32f48e[_0x70bf('0x1d')]=_0x3c25ae;if(_0x45b158['query'][_0x70bf('0x42')]){_0x303253['include']=[{'all':!![]}];}return db[_0x70bf('0x5b')][_0x70bf('0x44')](_0x303253);})[_0x70bf('0x22')](function(_0x2ddaad){_0x32f48e['rows']=_0x2ddaad;return _0x32f48e;});}})['then'](respondWithFilteredResult(_0x4ac079,_0x303253))[_0x70bf('0x45')](handleError(_0x4ac079,null));};exports[_0x70bf('0x5c')]=function(_0x51ce6d,_0x42a9c9,_0x380956){var _0x27c9fe={'raw':!![],'where':{}};var _0x46efc3={};var _0x47aff8={'count':0x0,'rows':[]};return db[_0x70bf('0x2d')]['findOne']({'where':{'id':_0x51ce6d[_0x70bf('0x47')]['id']}})[_0x70bf('0x22')](handleEntityNotFound(_0x42a9c9,null))['then'](function(_0x4dcc3d){if(_0x4dcc3d){_0x46efc3['model']=_[_0x70bf('0x33')](db[_0x70bf('0x5d')]['rawAttributes']);_0x46efc3['query']=_[_0x70bf('0x33')](_0x51ce6d[_0x70bf('0x32')]);_0x46efc3[_0x70bf('0x34')]=_[_0x70bf('0x35')](_0x46efc3[_0x70bf('0x31')],_0x46efc3[_0x70bf('0x32')]);_0x27c9fe[_0x70bf('0x36')]=_[_0x70bf('0x35')](_0x46efc3[_0x70bf('0x31')],qs[_0x70bf('0x37')](_0x51ce6d['query'][_0x70bf('0x37')]));_0x27c9fe[_0x70bf('0x36')]=_0x27c9fe[_0x70bf('0x36')][_0x70bf('0x38')]?_0x27c9fe[_0x70bf('0x36')]:_0x46efc3[_0x70bf('0x31')];if(!_0x51ce6d[_0x70bf('0x32')][_0x70bf('0x39')](_0x70bf('0x3a'))){_0x27c9fe[_0x70bf('0x1c')]=qs[_0x70bf('0x1c')](_0x51ce6d[_0x70bf('0x32')][_0x70bf('0x1c')]);_0x27c9fe[_0x70bf('0x1a')]=qs[_0x70bf('0x1a')](_0x51ce6d[_0x70bf('0x32')][_0x70bf('0x1a')]);}_0x27c9fe['order']=qs['sort'](_0x51ce6d[_0x70bf('0x32')]['sort']);_0x27c9fe[_0x70bf('0x3d')]=qs[_0x70bf('0x34')](_[_0x70bf('0x59')](_0x51ce6d[_0x70bf('0x32')],_0x46efc3[_0x70bf('0x34')]));_0x27c9fe['where'][_0x70bf('0x5a')]=_0x4dcc3d['id'];if(_0x51ce6d[_0x70bf('0x32')][_0x70bf('0x3e')]){_0x27c9fe[_0x70bf('0x3d')]=_[_0x70bf('0x40')](_0x27c9fe[_0x70bf('0x3d')],{'$or':_['map'](_0x27c9fe['attributes'],function(_0x1c6f1d){var _0x3d05d8={};_0x3d05d8[_0x1c6f1d]={'$like':'%'+_0x51ce6d[_0x70bf('0x32')][_0x70bf('0x3e')]+'%'};return _0x3d05d8;})});}_0x27c9fe=_[_0x70bf('0x40')]({},_0x27c9fe,_0x51ce6d[_0x70bf('0x41')]);return db['JscriptyAnswerReport'][_0x70bf('0x1d')]({'where':_0x27c9fe['where']})[_0x70bf('0x22')](function(_0x2bfbec){_0x47aff8[_0x70bf('0x1d')]=_0x2bfbec;if(_0x51ce6d[_0x70bf('0x32')][_0x70bf('0x42')]){_0x27c9fe[_0x70bf('0x43')]=[{'all':!![]}];}return db[_0x70bf('0x5d')][_0x70bf('0x44')](_0x27c9fe);})[_0x70bf('0x22')](function(_0x1cc401){_0x47aff8[_0x70bf('0x5e')]=_0x1cc401;return _0x47aff8;});}})[_0x70bf('0x22')](respondWithFilteredResult(_0x42a9c9,_0x27c9fe))['catch'](handleError(_0x42a9c9,null));};function char(_0x18874c){return _0x70bf('0x5f')===typeof _0x18874c?String['fromCharCode'][_0x70bf('0x1f')](null,arguments):_0x18874c;}function needsEncapsulation(_0x1b00b3){return!!_0x1b00b3&&(_0x1b00b3[_0x70bf('0x60')]()[_0x70bf('0x61')](char(0xd))>=0x0||_0x1b00b3[_0x70bf('0x60')]()[_0x70bf('0x61')](char(0xa))>=0x0||_0x1b00b3[_0x70bf('0x60')]()['indexOf'](char(0x2c))>=0x0||_0x1b00b3[_0x70bf('0x60')]()[_0x70bf('0x61')](char(0x22))>=0x0);}function encapsulate(_0x5b3dfd){var _0x2cab5b=char(0x22),_0xa0f994='\x5c'+char(0x22),_0x128d56=_0x5b3dfd[_0x70bf('0x60')]()[_0x70bf('0x62')](new RegExp(_0x2cab5b,'g'),_0xa0f994);return _0x2cab5b+_0x128d56+_0x2cab5b;}exports[_0x70bf('0x63')]=function(_0x3c9ef2,_0x293eb3,_0x14b4b5){var _0x420859,_0x419841;var _0x2365be={'where':{'ProjectId':_0x3c9ef2[_0x70bf('0x47')]['id']}};if(_0x3c9ef2[_0x70bf('0x32')][_0x70bf('0x64')]){_0x2365be[_0x70bf('0x3d')][_0x70bf('0x65')]=JSON['parse'](_0x3c9ef2[_0x70bf('0x32')][_0x70bf('0x64')]);}return db[_0x70bf('0x5b')][_0x70bf('0x44')](_0x2365be)[_0x70bf('0x22')](handleEntityNotFound(_0x293eb3,null))[_0x70bf('0x22')](function(_0x270a27){if(_0x270a27){_0x420859=_0x270a27;return db['JscriptyQuestionReport'][_0x70bf('0x44')]({'where':{'SessionId':{'$in':_[_0x70bf('0x2c')](_0x420859,'id')},'ProjectId':_0x3c9ef2[_0x70bf('0x47')]['id']},'order':_0x70bf('0x66')});}})[_0x70bf('0x22')](handleEntityNotFound(_0x293eb3,null))[_0x70bf('0x22')](function(_0x4f4f08){if(_0x4f4f08){_0x419841=_0x4f4f08;var _0x442798={};for(var _0x29f2e6=0x0,_0x5b956e=_0x419841['length'];_0x29f2e6<_0x5b956e;_0x29f2e6++){if(!_0x442798['hasOwnProperty'](_0x419841[_0x29f2e6][_0x70bf('0x67')])){_0x442798[_0x419841[_0x29f2e6][_0x70bf('0x67')]]=needsEncapsulation(_0x419841[_0x29f2e6]['question'])?encapsulate(_0x419841[_0x29f2e6][_0x70bf('0x68')]):_0x419841[_0x29f2e6]['question'];}}var _0x473070=[],_0x5c1caa={};for(var _0x59af7d=0x0,_0x3d446e=_0x420859[_0x70bf('0x38')];_0x59af7d<_0x3d446e;_0x59af7d++){_0x5c1caa={'ProjectId':_0x3c9ef2[_0x70bf('0x47')]['id'],'SessionId':_0x420859[_0x59af7d]['id'],'StartTime':moment(_0x420859[_0x59af7d][_0x70bf('0x65')])['format'](_0x70bf('0x69'))};for(var _0x465265=0x0,_0x4c7928=_0x419841['length'];_0x465265<_0x4c7928;_0x465265++){if(_0x419841[_0x465265][_0x70bf('0x6a')]==_0x420859[_0x59af7d]['id']&&_0x442798['hasOwnProperty'](_0x419841[_0x465265]['questionId'])){_0x5c1caa[_0x442798[_0x419841[_0x465265][_0x70bf('0x67')]]]=_0x419841[_0x465265][_0x70bf('0x6b')];}}for(var _0x1ecf15 in _0x442798){if(!_0x5c1caa[_0x70bf('0x39')](_0x442798[_0x1ecf15])){_0x5c1caa[_0x442798[_0x1ecf15]]=null;}}_0x473070[_0x70bf('0x6c')](_0x5c1caa);}return _0x473070;}})['then'](function(_0x279e6f){if(!_[_0x70bf('0x6d')](_0x279e6f)){var _0x18b092=toCsv(_0x279e6f);var _0x3f269c=Date[_0x70bf('0x6e')]();fs['writeFileSync'](util['format'](_0x70bf('0x6f'),_0x3c9ef2[_0x70bf('0x47')]['id'],_0x3f269c),_0x18b092);_0x293eb3[_0x70bf('0x70')](_0x70bf('0x71'),_0x70bf('0x72')+util['format'](_0x70bf('0x73'),_0x3c9ef2[_0x70bf('0x47')]['id'],_0x3f269c));_0x293eb3[_0x70bf('0x70')](_0x70bf('0x74'),_0x70bf('0x75'));return _0x293eb3['download'](util['format'](_0x70bf('0x6f'),_0x3c9ef2['params']['id'],_0x3f269c));}else{return _0x293eb3[_0x70bf('0x26')](0xcc);}})['catch'](handleError(_0x293eb3,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index e4499e1..e7f3736 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 _0xe4b8=['./jscriptyProject.attributes','exports','JscriptyProject','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x27b355,_0x15119c){var _0x296162=function(_0x4c3b41){while(--_0x4c3b41){_0x27b355['push'](_0x27b355['shift']());}};_0x296162(++_0x15119c);}(_0xe4b8,0x179));var _0x8e4b=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0xe4b8[_0x1589dd];return _0x1bddd1;};'use strict';var _=require(_0x8e4b('0x0'));var util=require(_0x8e4b('0x1'));var logger=require(_0x8e4b('0x2'))(_0x8e4b('0x3'));var moment=require(_0x8e4b('0x4'));var BPromise=require(_0x8e4b('0x5'));var rp=require(_0x8e4b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8e4b('0x7'));var attributes=require(_0x8e4b('0x8'));module[_0x8e4b('0x9')]=function(_0x47e630,_0x2796f8){return _0x47e630['define'](_0x8e4b('0xa'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ba0=['lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x8ba0,0x1c7));var _0x08ba=function(_0x2bb25a,_0x3eeec7){_0x2bb25a=_0x2bb25a-0x0;var _0x133717=_0x8ba0[_0x2bb25a];return _0x133717;};'use strict';var _=require(_0x08ba('0x0'));var util=require(_0x08ba('0x1'));var logger=require(_0x08ba('0x2'))(_0x08ba('0x3'));var moment=require(_0x08ba('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x08ba('0x5'));var rimraf=require(_0x08ba('0x6'));var config=require(_0x08ba('0x7'));var attributes=require(_0x08ba('0x8'));module[_0x08ba('0x9')]=function(_0x161a9d,_0x5f29fa){return _0x161a9d[_0x08ba('0xa')](_0x08ba('0xb'),attributes,{'tableName':_0x08ba('0xc'),'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 3af99df..09a0801 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 _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','JscriptyProject,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x3677fc,_0xaa932f){var _0x16cea3=function(_0x4983a1){while(--_0x4983a1){_0x3677fc['push'](_0x3677fc['shift']());}};_0x16cea3(++_0xaa932f);}(_0x9c44,0x178));var _0x49c4=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x9c44[_0x68c979];return _0x4f0001;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file +var _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(_0x20a52d,_0x5f3067){var _0x1a3741=function(_0x5e46b3){while(--_0x5e46b3){_0x20a52d['push'](_0x20a52d['shift']());}};_0x1a3741(++_0x5f3067);}(_0xe706,0xa3));var _0x6e70=function(_0x51f357,_0x58d147){_0x51f357=_0x51f357-0x0;var _0x186473=_0xe706[_0x51f357];return _0x186473;};'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 diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index ce61326..1d02400 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 _0x83d1=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','Router'];(function(_0x363713,_0x1bb70f){var _0x220d98=function(_0xac896d){while(--_0xac896d){_0x363713['push'](_0x363713['shift']());}};_0x220d98(++_0x1bb70f);}(_0x83d1,0xbc));var _0x183d=function(_0x5d2ca6,_0x3877c7){_0x5d2ca6=_0x5d2ca6-0x0;var _0x54f1dc=_0x83d1[_0x5d2ca6];return _0x54f1dc;};'use strict';var multer=require(_0x183d('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x183d('0x1')]();var fs_extra=require(_0x183d('0x2'));var auth=require(_0x183d('0x3'));var interaction=require(_0x183d('0x4'));var config=require(_0x183d('0x5'));var controller=require('./jscriptyQuestionReport.controller');router[_0x183d('0x6')]('/',auth[_0x183d('0x7')](),controller[_0x183d('0x8')]);router[_0x183d('0x6')](_0x183d('0x9'),auth[_0x183d('0x7')](),controller[_0x183d('0xa')]);router[_0x183d('0x6')](_0x183d('0xb'),auth[_0x183d('0x7')](),controller[_0x183d('0xc')]);router[_0x183d('0xd')]('/',auth[_0x183d('0x7')](),controller[_0x183d('0xe')]);router[_0x183d('0xf')](_0x183d('0xb'),auth[_0x183d('0x7')](),controller['update']);router[_0x183d('0x10')](_0x183d('0xb'),auth[_0x183d('0x7')](),controller[_0x183d('0x11')]);module[_0x183d('0x12')]=router; \ No newline at end of file +var _0x75e5=['isAuthenticated','get','describe','/:id','show','create','put','update','delete','destroy','multer','util','path','fs-extra','./jscriptyQuestionReport.controller'];(function(_0x5ccb00,_0x2ebf3d){var _0x10592e=function(_0x1d1fa4){while(--_0x1d1fa4){_0x5ccb00['push'](_0x5ccb00['shift']());}};_0x10592e(++_0x2ebf3d);}(_0x75e5,0x136));var _0x575e=function(_0x1af1e1,_0x37bc24){_0x1af1e1=_0x1af1e1-0x0;var _0x5f3450=_0x75e5[_0x1af1e1];return _0x5f3450;};'use strict';var multer=require(_0x575e('0x0'));var util=require(_0x575e('0x1'));var path=require(_0x575e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x575e('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x575e('0x4'));router['get']('/',auth[_0x575e('0x5')](),controller['index']);router[_0x575e('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x575e('0x7')]);router[_0x575e('0x6')](_0x575e('0x8'),auth[_0x575e('0x5')](),controller[_0x575e('0x9')]);router['post']('/',auth[_0x575e('0x5')](),controller[_0x575e('0xa')]);router[_0x575e('0xb')](_0x575e('0x8'),auth[_0x575e('0x5')](),controller[_0x575e('0xc')]);router[_0x575e('0xd')](_0x575e('0x8'),auth[_0x575e('0x5')](),controller[_0x575e('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 6a07cfa..283b1a3 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(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x7a54,0x106));var _0x47a5=function(_0x38d010,_0x59518e){_0x38d010=_0x38d010-0x0;var _0x12b2a0=_0x7a54[_0x38d010];return _0x12b2a0;};'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(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x7a54,0x106));var _0x47a5=function(_0x5b0552,_0x396855){_0x5b0552=_0x5b0552-0x0;var _0x219973=_0x7a54[_0x5b0552];return _0x219973;};'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 9071f96..c643765 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 _0xe6ac=['stack','name','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','catch','show','params','find','create','body','update','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','error'];(function(_0x4bc65f,_0x39ec43){var _0x44f85f=function(_0x175343){while(--_0x175343){_0x4bc65f['push'](_0x4bc65f['shift']());}};_0x44f85f(++_0x39ec43);}(_0xe6ac,0x102));var _0xce6a=function(_0x1a89ca,_0x27394b){_0x1a89ca=_0x1a89ca-0x0;var _0x29cbb2=_0xe6ac[_0x1a89ca];return _0x29cbb2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xce6a('0x0'));var zipdir=require(_0xce6a('0x1'));var jsonpatch=require(_0xce6a('0x2'));var rp=require(_0xce6a('0x3'));var moment=require(_0xce6a('0x4'));var BPromise=require(_0xce6a('0x5'));var Mustache=require(_0xce6a('0x6'));var util=require(_0xce6a('0x7'));var path=require('path');var sox=require(_0xce6a('0x8'));var csv=require('to-csv');var ejs=require(_0xce6a('0x9'));var fs=require('fs');var fs_extra=require(_0xce6a('0xa'));var _=require(_0xce6a('0xb'));var squel=require(_0xce6a('0xc'));var crypto=require('crypto');var jsforce=require(_0xce6a('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xce6a('0xe'));var Papa=require(_0xce6a('0xf'));var Redis=require(_0xce6a('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xce6a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xce6a('0x12'))(_0xce6a('0x13'));var utils=require(_0xce6a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xce6a('0x15'));var db=require(_0xce6a('0x16'))['db'];function respondWithStatusCode(_0x2d2fec,_0x512da5){_0x512da5=_0x512da5||0xcc;return function(_0x31ca3f){if(_0x31ca3f){return _0x2d2fec[_0xce6a('0x17')](_0x512da5);}return _0x2d2fec[_0xce6a('0x18')](_0x512da5)[_0xce6a('0x19')]();};}function respondWithResult(_0x233fd5,_0x4cdb64){_0x4cdb64=_0x4cdb64||0xc8;return function(_0x159320){if(_0x159320){return _0x233fd5[_0xce6a('0x18')](_0x4cdb64)['json'](_0x159320);}};}function respondWithFilteredResult(_0x248696,_0x355cdd){return function(_0x1a57f8){if(_0x1a57f8){var _0x5b1b5f=typeof _0x355cdd[_0xce6a('0x1a')]==='undefined'&&typeof _0x355cdd[_0xce6a('0x1b')]==='undefined';var _0x48e4dd=_0x1a57f8[_0xce6a('0x1c')];var _0x520d54=_0x5b1b5f?0x0:_0x355cdd[_0xce6a('0x1a')];var _0x5e4565=_0x5b1b5f?_0x1a57f8[_0xce6a('0x1c')]:_0x355cdd[_0xce6a('0x1a')]+_0x355cdd['limit'];var _0x32a8a4;if(_0x5e4565>=_0x48e4dd){_0x5e4565=_0x48e4dd;_0x32a8a4=0xc8;}else{_0x32a8a4=0xce;}_0x248696[_0xce6a('0x18')](_0x32a8a4);return _0x248696[_0xce6a('0x1d')](_0xce6a('0x1e'),_0x520d54+'-'+_0x5e4565+'/'+_0x48e4dd)[_0xce6a('0x1f')](_0x1a57f8);}return null;};}function patchUpdates(_0x40e647){return function(_0x1a5295){try{jsonpatch[_0xce6a('0x20')](_0x1a5295,_0x40e647,!![]);}catch(_0x5ad866){return BPromise[_0xce6a('0x21')](_0x5ad866);}return _0x1a5295[_0xce6a('0x22')]();};}function saveUpdates(_0x244632,_0x5e5061){return function(_0x5efa0b){if(_0x5efa0b){return _0x5efa0b['update'](_0x244632)[_0xce6a('0x23')](function(_0x5714ab){return _0x5714ab;});}return null;};}function removeEntity(_0x41f976,_0x5464e4){return function(_0x63e575){if(_0x63e575){return _0x63e575[_0xce6a('0x24')]()[_0xce6a('0x23')](function(){_0x41f976[_0xce6a('0x18')](0xcc)[_0xce6a('0x19')]();});}};}function handleEntityNotFound(_0x23b091,_0x10d30f){return function(_0x5c6c36){if(!_0x5c6c36){_0x23b091[_0xce6a('0x17')](0x194);}return _0x5c6c36;};}function handleError(_0x14b613,_0x1bc721){_0x1bc721=_0x1bc721||0x1f4;return function(_0x5de6bc){logger[_0xce6a('0x25')](_0x5de6bc[_0xce6a('0x26')]);if(_0x5de6bc[_0xce6a('0x27')]){delete _0x5de6bc[_0xce6a('0x27')];}_0x14b613[_0xce6a('0x18')](_0x1bc721)['send'](_0x5de6bc);};}exports[_0xce6a('0x28')]=function(_0x8efe08,_0x3b0e45){var _0x197cb1={},_0x45d2f2={},_0x51c830={'count':0x0,'rows':[]};var _0x34470f=_[_0xce6a('0x29')](db[_0xce6a('0x2a')][_0xce6a('0x2b')],function(_0x436790){return{'name':_0x436790[_0xce6a('0x2c')],'type':_0x436790[_0xce6a('0x2d')]['key']};});_0x45d2f2[_0xce6a('0x2e')]=_[_0xce6a('0x29')](_0x34470f,'name');_0x45d2f2[_0xce6a('0x2f')]=_[_0xce6a('0x30')](_0x8efe08['query']);_0x45d2f2[_0xce6a('0x31')]=_[_0xce6a('0x32')](_0x45d2f2['model'],_0x45d2f2[_0xce6a('0x2f')]);_0x197cb1[_0xce6a('0x33')]=_[_0xce6a('0x32')](_0x45d2f2[_0xce6a('0x2e')],qs[_0xce6a('0x34')](_0x8efe08[_0xce6a('0x2f')][_0xce6a('0x34')]));_0x197cb1[_0xce6a('0x33')]=_0x197cb1['attributes'][_0xce6a('0x35')]?_0x197cb1['attributes']:_0x45d2f2[_0xce6a('0x2e')];if(!_0x8efe08[_0xce6a('0x2f')][_0xce6a('0x36')](_0xce6a('0x37'))){_0x197cb1['limit']=qs[_0xce6a('0x1b')](_0x8efe08['query'][_0xce6a('0x1b')]);_0x197cb1[_0xce6a('0x1a')]=qs[_0xce6a('0x1a')](_0x8efe08[_0xce6a('0x2f')][_0xce6a('0x1a')]);}_0x197cb1[_0xce6a('0x38')]=qs['sort'](_0x8efe08[_0xce6a('0x2f')][_0xce6a('0x39')]);_0x197cb1[_0xce6a('0x3a')]=qs['filters'](_[_0xce6a('0x3b')](_0x8efe08[_0xce6a('0x2f')],_0x45d2f2[_0xce6a('0x31')]),_0x34470f);if(_0x8efe08[_0xce6a('0x2f')]['filter']){_0x197cb1[_0xce6a('0x3a')]=_['merge'](_0x197cb1['where'],{'$or':_[_0xce6a('0x29')](_0x34470f,function(_0x15ee7f){if(_0x15ee7f[_0xce6a('0x2d')]!==_0xce6a('0x3c')){var _0x2dea9d={};_0x2dea9d[_0x15ee7f[_0xce6a('0x27')]]={'$like':'%'+_0x8efe08['query'][_0xce6a('0x3d')]+'%'};return _0x2dea9d;}})});}_0x197cb1=_[_0xce6a('0x3e')]({},_0x197cb1,_0x8efe08[_0xce6a('0x3f')]);var _0x38c04e={'where':_0x197cb1[_0xce6a('0x3a')]};return db[_0xce6a('0x2a')][_0xce6a('0x1c')](_0x38c04e)[_0xce6a('0x23')](function(_0x9743fb){_0x51c830[_0xce6a('0x1c')]=_0x9743fb;if(_0x8efe08['query'][_0xce6a('0x40')]){_0x197cb1[_0xce6a('0x41')]=[{'all':!![]}];}return db[_0xce6a('0x2a')]['findAll'](_0x197cb1);})[_0xce6a('0x23')](function(_0x447982){_0x51c830['rows']=_0x447982;return _0x51c830;})[_0xce6a('0x23')](respondWithFilteredResult(_0x3b0e45,_0x197cb1))[_0xce6a('0x42')](handleError(_0x3b0e45,null));};exports[_0xce6a('0x43')]=function(_0xdeaab7,_0x4920f9){var _0x549b89={'raw':!![],'where':{'id':_0xdeaab7[_0xce6a('0x44')]['id']}},_0x277435={};_0x277435['model']=_[_0xce6a('0x30')](db[_0xce6a('0x2a')]['rawAttributes']);_0x277435['query']=_[_0xce6a('0x30')](_0xdeaab7[_0xce6a('0x2f')]);_0x277435['filters']=_[_0xce6a('0x32')](_0x277435[_0xce6a('0x2e')],_0x277435[_0xce6a('0x2f')]);_0x549b89[_0xce6a('0x33')]=_['intersection'](_0x277435[_0xce6a('0x2e')],qs['fields'](_0xdeaab7[_0xce6a('0x2f')][_0xce6a('0x34')]));_0x549b89[_0xce6a('0x33')]=_0x549b89[_0xce6a('0x33')][_0xce6a('0x35')]?_0x549b89[_0xce6a('0x33')]:_0x277435[_0xce6a('0x2e')];if(_0xdeaab7[_0xce6a('0x2f')][_0xce6a('0x40')]){_0x549b89[_0xce6a('0x41')]=[{'all':!![]}];}_0x549b89=_[_0xce6a('0x3e')]({},_0x549b89,_0xdeaab7['options']);return db['JscriptyQuestionReport'][_0xce6a('0x45')](_0x549b89)[_0xce6a('0x23')](handleEntityNotFound(_0x4920f9,null))[_0xce6a('0x23')](respondWithResult(_0x4920f9,null))[_0xce6a('0x42')](handleError(_0x4920f9,null));};exports['create']=function(_0x4490c0,_0x3d2a12){return db['JscriptyQuestionReport'][_0xce6a('0x46')](_0x4490c0[_0xce6a('0x47')],{})[_0xce6a('0x23')](respondWithResult(_0x3d2a12,0xc9))['catch'](handleError(_0x3d2a12,null));};exports[_0xce6a('0x48')]=function(_0x41d071,_0x5d6304){if(_0x41d071[_0xce6a('0x47')]['id']){delete _0x41d071[_0xce6a('0x47')]['id'];}return db[_0xce6a('0x2a')]['find']({'where':{'id':_0x41d071['params']['id']}})[_0xce6a('0x23')](handleEntityNotFound(_0x5d6304,null))[_0xce6a('0x23')](saveUpdates(_0x41d071[_0xce6a('0x47')],null))[_0xce6a('0x23')](respondWithResult(_0x5d6304,null))[_0xce6a('0x42')](handleError(_0x5d6304,null));};exports[_0xce6a('0x24')]=function(_0x42fd3d,_0x3ca032){return db[_0xce6a('0x2a')]['find']({'where':{'id':_0x42fd3d['params']['id']}})[_0xce6a('0x23')](handleEntityNotFound(_0x3ca032,null))['then'](removeEntity(_0x3ca032,null))['catch'](handleError(_0x3ca032,null));};exports[_0xce6a('0x49')]=function(_0x139614,_0x180fc8){return db[_0xce6a('0x2a')]['describe']()[_0xce6a('0x23')](respondWithResult(_0x180fc8,null))[_0xce6a('0x42')](handleError(_0x180fc8,null));}; \ No newline at end of file +var _0xfbb9=['params','keys','filters','length','find','create','body','destroy','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','name','index','map','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','JscriptyQuestionReport','includeAll','include','findAll','rows','catch','show'];(function(_0x34942a,_0x7ccb7){var _0xb5931=function(_0x428bd7){while(--_0x428bd7){_0x34942a['push'](_0x34942a['shift']());}};_0xb5931(++_0x7ccb7);}(_0xfbb9,0x180));var _0x9fbb=function(_0x59aad2,_0x43e818){_0x59aad2=_0x59aad2-0x0;var _0x2e1ed2=_0xfbb9[_0x59aad2];return _0x2e1ed2;};'use strict';var emlformat=require(_0x9fbb('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9fbb('0x1'));var rp=require(_0x9fbb('0x2'));var moment=require(_0x9fbb('0x3'));var BPromise=require(_0x9fbb('0x4'));var Mustache=require('mustache');var util=require(_0x9fbb('0x5'));var path=require(_0x9fbb('0x6'));var sox=require(_0x9fbb('0x7'));var csv=require(_0x9fbb('0x8'));var ejs=require(_0x9fbb('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9fbb('0xa'));var squel=require(_0x9fbb('0xb'));var crypto=require(_0x9fbb('0xc'));var jsforce=require(_0x9fbb('0xd'));var deskjs=require(_0x9fbb('0xe'));var toCsv=require(_0x9fbb('0x8'));var querystring=require(_0x9fbb('0xf'));var Papa=require(_0x9fbb('0x10'));var Redis=require(_0x9fbb('0x11'));var authService=require(_0x9fbb('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x9fbb('0x13'));var hardwareService=require(_0x9fbb('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x9fbb('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd0123f,_0x194454){_0x194454=_0x194454||0xcc;return function(_0x5a64b3){if(_0x5a64b3){return _0xd0123f[_0x9fbb('0x16')](_0x194454);}return _0xd0123f['status'](_0x194454)[_0x9fbb('0x17')]();};}function respondWithResult(_0x1dfd5d,_0x508ce9){_0x508ce9=_0x508ce9||0xc8;return function(_0x31282b){if(_0x31282b){return _0x1dfd5d[_0x9fbb('0x18')](_0x508ce9)[_0x9fbb('0x19')](_0x31282b);}};}function respondWithFilteredResult(_0x1f6697,_0x2d6263){return function(_0x4962ec){if(_0x4962ec){var _0x53c48c=typeof _0x2d6263[_0x9fbb('0x1a')]===_0x9fbb('0x1b')&&typeof _0x2d6263[_0x9fbb('0x1c')]===_0x9fbb('0x1b');var _0x25fb2c=_0x4962ec[_0x9fbb('0x1d')];var _0x40fd3f=_0x53c48c?0x0:_0x2d6263['offset'];var _0x55eda5=_0x53c48c?_0x4962ec['count']:_0x2d6263[_0x9fbb('0x1a')]+_0x2d6263[_0x9fbb('0x1c')];var _0xf79666;if(_0x55eda5>=_0x25fb2c){_0x55eda5=_0x25fb2c;_0xf79666=0xc8;}else{_0xf79666=0xce;}_0x1f6697['status'](_0xf79666);return _0x1f6697[_0x9fbb('0x1e')](_0x9fbb('0x1f'),_0x40fd3f+'-'+_0x55eda5+'/'+_0x25fb2c)[_0x9fbb('0x19')](_0x4962ec);}return null;};}function patchUpdates(_0x5d819a){return function(_0x5045a6){try{jsonpatch['apply'](_0x5045a6,_0x5d819a,!![]);}catch(_0x138f8d){return BPromise[_0x9fbb('0x20')](_0x138f8d);}return _0x5045a6[_0x9fbb('0x21')]();};}function saveUpdates(_0x17f048,_0x333ab5){return function(_0x551fe1){if(_0x551fe1){return _0x551fe1[_0x9fbb('0x22')](_0x17f048)['then'](function(_0x323290){return _0x323290;});}return null;};}function removeEntity(_0x36aaef,_0x46883f){return function(_0x3a3cfa){if(_0x3a3cfa){return _0x3a3cfa['destroy']()[_0x9fbb('0x23')](function(){_0x36aaef[_0x9fbb('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x134771,_0x168e44){return function(_0x4c6d5b){if(!_0x4c6d5b){_0x134771[_0x9fbb('0x16')](0x194);}return _0x4c6d5b;};}function handleError(_0x3072b5,_0x435983){_0x435983=_0x435983||0x1f4;return function(_0x186862){logger[_0x9fbb('0x24')](_0x186862['stack']);if(_0x186862[_0x9fbb('0x25')]){delete _0x186862[_0x9fbb('0x25')];}_0x3072b5['status'](_0x435983)['send'](_0x186862);};}exports[_0x9fbb('0x26')]=function(_0x3978e8,_0x11c2c7){var _0xd78ee={},_0x5eb34c={},_0x4a7d9b={'count':0x0,'rows':[]};var _0x1eb433=_[_0x9fbb('0x27')](db['JscriptyQuestionReport'][_0x9fbb('0x28')],function(_0x3f3dd1){return{'name':_0x3f3dd1[_0x9fbb('0x29')],'type':_0x3f3dd1[_0x9fbb('0x2a')][_0x9fbb('0x2b')]};});_0x5eb34c[_0x9fbb('0x2c')]=_[_0x9fbb('0x27')](_0x1eb433,_0x9fbb('0x25'));_0x5eb34c[_0x9fbb('0x2d')]=_['keys'](_0x3978e8[_0x9fbb('0x2d')]);_0x5eb34c['filters']=_['intersection'](_0x5eb34c[_0x9fbb('0x2c')],_0x5eb34c['query']);_0xd78ee[_0x9fbb('0x2e')]=_[_0x9fbb('0x2f')](_0x5eb34c['model'],qs[_0x9fbb('0x30')](_0x3978e8[_0x9fbb('0x2d')][_0x9fbb('0x30')]));_0xd78ee[_0x9fbb('0x2e')]=_0xd78ee[_0x9fbb('0x2e')]['length']?_0xd78ee[_0x9fbb('0x2e')]:_0x5eb34c[_0x9fbb('0x2c')];if(!_0x3978e8[_0x9fbb('0x2d')][_0x9fbb('0x31')](_0x9fbb('0x32'))){_0xd78ee[_0x9fbb('0x1c')]=qs[_0x9fbb('0x1c')](_0x3978e8[_0x9fbb('0x2d')][_0x9fbb('0x1c')]);_0xd78ee[_0x9fbb('0x1a')]=qs[_0x9fbb('0x1a')](_0x3978e8['query'][_0x9fbb('0x1a')]);}_0xd78ee[_0x9fbb('0x33')]=qs[_0x9fbb('0x34')](_0x3978e8[_0x9fbb('0x2d')][_0x9fbb('0x34')]);_0xd78ee[_0x9fbb('0x35')]=qs['filters'](_[_0x9fbb('0x36')](_0x3978e8[_0x9fbb('0x2d')],_0x5eb34c['filters']),_0x1eb433);if(_0x3978e8[_0x9fbb('0x2d')][_0x9fbb('0x37')]){_0xd78ee[_0x9fbb('0x35')]=_[_0x9fbb('0x38')](_0xd78ee[_0x9fbb('0x35')],{'$or':_[_0x9fbb('0x27')](_0x1eb433,function(_0xa53f4f){if(_0xa53f4f[_0x9fbb('0x2a')]!==_0x9fbb('0x39')){var _0x494214={};_0x494214[_0xa53f4f['name']]={'$like':'%'+_0x3978e8[_0x9fbb('0x2d')][_0x9fbb('0x37')]+'%'};return _0x494214;}})});}_0xd78ee=_[_0x9fbb('0x38')]({},_0xd78ee,_0x3978e8[_0x9fbb('0x3a')]);var _0x1487fa={'where':_0xd78ee['where']};return db[_0x9fbb('0x3b')][_0x9fbb('0x1d')](_0x1487fa)[_0x9fbb('0x23')](function(_0x443aee){_0x4a7d9b['count']=_0x443aee;if(_0x3978e8[_0x9fbb('0x2d')][_0x9fbb('0x3c')]){_0xd78ee[_0x9fbb('0x3d')]=[{'all':!![]}];}return db[_0x9fbb('0x3b')][_0x9fbb('0x3e')](_0xd78ee);})[_0x9fbb('0x23')](function(_0x570093){_0x4a7d9b[_0x9fbb('0x3f')]=_0x570093;return _0x4a7d9b;})[_0x9fbb('0x23')](respondWithFilteredResult(_0x11c2c7,_0xd78ee))[_0x9fbb('0x40')](handleError(_0x11c2c7,null));};exports[_0x9fbb('0x41')]=function(_0x57af01,_0x41fe70){var _0x1fc40b={'raw':!![],'where':{'id':_0x57af01[_0x9fbb('0x42')]['id']}},_0xbd0a8b={};_0xbd0a8b['model']=_[_0x9fbb('0x43')](db[_0x9fbb('0x3b')]['rawAttributes']);_0xbd0a8b['query']=_['keys'](_0x57af01[_0x9fbb('0x2d')]);_0xbd0a8b[_0x9fbb('0x44')]=_[_0x9fbb('0x2f')](_0xbd0a8b[_0x9fbb('0x2c')],_0xbd0a8b[_0x9fbb('0x2d')]);_0x1fc40b[_0x9fbb('0x2e')]=_[_0x9fbb('0x2f')](_0xbd0a8b[_0x9fbb('0x2c')],qs[_0x9fbb('0x30')](_0x57af01[_0x9fbb('0x2d')]['fields']));_0x1fc40b[_0x9fbb('0x2e')]=_0x1fc40b[_0x9fbb('0x2e')][_0x9fbb('0x45')]?_0x1fc40b[_0x9fbb('0x2e')]:_0xbd0a8b[_0x9fbb('0x2c')];if(_0x57af01['query']['includeAll']){_0x1fc40b[_0x9fbb('0x3d')]=[{'all':!![]}];}_0x1fc40b=_[_0x9fbb('0x38')]({},_0x1fc40b,_0x57af01[_0x9fbb('0x3a')]);return db[_0x9fbb('0x3b')][_0x9fbb('0x46')](_0x1fc40b)[_0x9fbb('0x23')](handleEntityNotFound(_0x41fe70,null))['then'](respondWithResult(_0x41fe70,null))[_0x9fbb('0x40')](handleError(_0x41fe70,null));};exports[_0x9fbb('0x47')]=function(_0x264bf5,_0x4500f3){return db[_0x9fbb('0x3b')][_0x9fbb('0x47')](_0x264bf5[_0x9fbb('0x48')],{})[_0x9fbb('0x23')](respondWithResult(_0x4500f3,0xc9))[_0x9fbb('0x40')](handleError(_0x4500f3,null));};exports[_0x9fbb('0x22')]=function(_0x5c15fb,_0x17328e){if(_0x5c15fb[_0x9fbb('0x48')]['id']){delete _0x5c15fb[_0x9fbb('0x48')]['id'];}return db['JscriptyQuestionReport'][_0x9fbb('0x46')]({'where':{'id':_0x5c15fb[_0x9fbb('0x42')]['id']}})['then'](handleEntityNotFound(_0x17328e,null))[_0x9fbb('0x23')](saveUpdates(_0x5c15fb[_0x9fbb('0x48')],null))['then'](respondWithResult(_0x17328e,null))['catch'](handleError(_0x17328e,null));};exports[_0x9fbb('0x49')]=function(_0x17af0d,_0x1cf085){return db[_0x9fbb('0x3b')]['find']({'where':{'id':_0x17af0d[_0x9fbb('0x42')]['id']}})[_0x9fbb('0x23')](handleEntityNotFound(_0x1cf085,null))[_0x9fbb('0x23')](removeEntity(_0x1cf085,null))[_0x9fbb('0x40')](handleError(_0x1cf085,null));};exports[_0x9fbb('0x4a')]=function(_0x9aaa72,_0x5ec715){return db[_0x9fbb('0x3b')][_0x9fbb('0x4a')]()[_0x9fbb('0x23')](respondWithResult(_0x5ec715,null))[_0x9fbb('0x40')](handleError(_0x5ec715,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 0c464b5..43025fb 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 _0x1d13=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','JscriptyQuestionReport','lodash'];(function(_0x209e5d,_0x5cbda3){var _0x3a757a=function(_0x7c8588){while(--_0x7c8588){_0x209e5d['push'](_0x209e5d['shift']());}};_0x3a757a(++_0x5cbda3);}(_0x1d13,0x144));var _0x31d1=function(_0x2e9270,_0x383c8b){_0x2e9270=_0x2e9270-0x0;var _0x4d4d28=_0x1d13[_0x2e9270];return _0x4d4d28;};'use strict';var _=require(_0x31d1('0x0'));var util=require(_0x31d1('0x1'));var logger=require(_0x31d1('0x2'))(_0x31d1('0x3'));var moment=require(_0x31d1('0x4'));var BPromise=require(_0x31d1('0x5'));var rp=require(_0x31d1('0x6'));var fs=require('fs');var path=require(_0x31d1('0x7'));var rimraf=require(_0x31d1('0x8'));var config=require(_0x31d1('0x9'));var attributes=require(_0x31d1('0xa'));module[_0x31d1('0xb')]=function(_0x1b51d1,_0x1cd5de){return _0x1b51d1['define'](_0x31d1('0xc'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc250=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','JscriptyQuestionReport','report_jscripty_questions','util'];(function(_0x4289b2,_0x43e601){var _0x39100f=function(_0x1c86fb){while(--_0x1c86fb){_0x4289b2['push'](_0x4289b2['shift']());}};_0x39100f(++_0x43e601);}(_0xc250,0x8f));var _0x0c25=function(_0x46d57b,_0x70978e){_0x46d57b=_0x46d57b-0x0;var _0x2cc783=_0xc250[_0x46d57b];return _0x2cc783;};'use strict';var _=require('lodash');var util=require(_0x0c25('0x0'));var logger=require(_0x0c25('0x1'))(_0x0c25('0x2'));var moment=require(_0x0c25('0x3'));var BPromise=require(_0x0c25('0x4'));var rp=require(_0x0c25('0x5'));var fs=require('fs');var path=require(_0x0c25('0x6'));var rimraf=require(_0x0c25('0x7'));var config=require('../../config/environment');var attributes=require('./jscriptyQuestionReport.attributes');module[_0x0c25('0x8')]=function(_0x4dffd1,_0x2caeee){return _0x4dffd1[_0x0c25('0x9')](_0x0c25('0xa'),attributes,{'tableName':_0x0c25('0xb'),'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 38c626b..a65700e 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 _0xfcfb=['message','request\x20sent','result','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x7fa9a6,_0x2b5cf3){var _0x51289c=function(_0x246294){while(--_0x246294){_0x7fa9a6['push'](_0x7fa9a6['shift']());}};_0x51289c(++_0x2b5cf3);}(_0xfcfb,0x1a5));var _0xbfcf=function(_0x51e77b,_0x4d4926){_0x51e77b=_0x51e77b-0x0;var _0x1dfcf9=_0xfcfb[_0x51e77b];return _0x1dfcf9;};'use strict';var _=require('lodash');var util=require(_0xbfcf('0x0'));var moment=require(_0xbfcf('0x1'));var BPromise=require(_0xbfcf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbfcf('0x3'));var db=require(_0xbfcf('0x4'))['db'];var utils=require(_0xbfcf('0x5'));var logger=require(_0xbfcf('0x6'))(_0xbfcf('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbfcf('0x8')][_0xbfcf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42c41c,_0x3955c6,_0x1f9d08){return new BPromise(function(_0x4742ac,_0x17119a){return client[_0xbfcf('0xa')](_0x42c41c,_0x1f9d08)[_0xbfcf('0xb')](function(_0x3d85b8){logger[_0xbfcf('0xc')](_0xbfcf('0xd'),_0x3955c6,'request\x20sent');logger[_0xbfcf('0xe')](_0xbfcf('0xf'),_0x3955c6,'request\x20sent',JSON[_0xbfcf('0x10')](_0x3d85b8));if(_0x3d85b8[_0xbfcf('0x11')]){if(_0x3d85b8[_0xbfcf('0x11')][_0xbfcf('0x12')]===0x1f4){logger[_0xbfcf('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x3955c6,_0x3d85b8[_0xbfcf('0x11')]['message']);return _0x17119a(_0x3d85b8['error'][_0xbfcf('0x13')]);}logger['error'](_0xbfcf('0xd'),_0x3955c6,_0x3d85b8[_0xbfcf('0x11')][_0xbfcf('0x13')]);return _0x4742ac(_0x3d85b8['error'][_0xbfcf('0x13')]);}else{logger[_0xbfcf('0xc')](_0xbfcf('0xd'),_0x3955c6,_0xbfcf('0x14'));_0x4742ac(_0x3d85b8[_0xbfcf('0x15')][_0xbfcf('0x13')]);}})['catch'](function(_0x20b095){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x3955c6,_0x20b095);_0x17119a(_0x20b095);});});} \ No newline at end of file +var _0x3550=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x4b679d,_0x1a9063){var _0xa46021=function(_0x176807){while(--_0x176807){_0x4b679d['push'](_0x4b679d['shift']());}};_0xa46021(++_0x1a9063);}(_0x3550,0xaa));var _0x0355=function(_0x5eeadc,_0x17f42c){_0x5eeadc=_0x5eeadc-0x0;var _0x19781b=_0x3550[_0x5eeadc];return _0x19781b;};'use strict';var _=require(_0x0355('0x0'));var util=require(_0x0355('0x1'));var moment=require(_0x0355('0x2'));var BPromise=require(_0x0355('0x3'));var rs=require(_0x0355('0x4'));var fs=require('fs');var Redis=require(_0x0355('0x5'));var db=require(_0x0355('0x6'))['db'];var utils=require(_0x0355('0x7'));var logger=require(_0x0355('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0355('0x9'));var client=jayson[_0x0355('0xa')][_0x0355('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x10cf17,_0x49493d,_0x557e3a){return new BPromise(function(_0x72e874,_0x5789b3){return client['request'](_0x10cf17,_0x557e3a)['then'](function(_0x1dbe96){logger['info'](_0x0355('0xc'),_0x49493d,'request\x20sent');logger[_0x0355('0xd')](_0x0355('0xe'),_0x49493d,_0x0355('0xf'),JSON[_0x0355('0x10')](_0x1dbe96));if(_0x1dbe96['error']){if(_0x1dbe96[_0x0355('0x11')][_0x0355('0x12')]===0x1f4){logger[_0x0355('0x11')](_0x0355('0xc'),_0x49493d,_0x1dbe96[_0x0355('0x11')][_0x0355('0x13')]);return _0x5789b3(_0x1dbe96[_0x0355('0x11')][_0x0355('0x13')]);}logger[_0x0355('0x11')](_0x0355('0xc'),_0x49493d,_0x1dbe96[_0x0355('0x11')][_0x0355('0x13')]);return _0x72e874(_0x1dbe96[_0x0355('0x11')][_0x0355('0x13')]);}else{logger[_0x0355('0x14')](_0x0355('0xc'),_0x49493d,_0x0355('0xf'));_0x72e874(_0x1dbe96[_0x0355('0x15')][_0x0355('0x13')]);}})['catch'](function(_0x9abbac){logger[_0x0355('0x11')](_0x0355('0xc'),_0x49493d,_0x9abbac);_0x5789b3(_0x9abbac);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index e9b46a1..cef822a 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 _0x6c17=['get','/describe','describe','/:id','show','getQuestions','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','isAuthenticated','index'];(function(_0x3a84ce,_0x224b54){var _0x10d5a9=function(_0x4dcfe3){while(--_0x4dcfe3){_0x3a84ce['push'](_0x3a84ce['shift']());}};_0x10d5a9(++_0x224b54);}(_0x6c17,0xe4));var _0x76c1=function(_0xa175a4,_0x326745){_0xa175a4=_0xa175a4-0x0;var _0x1db3da=_0x6c17[_0xa175a4];return _0x1db3da;};'use strict';var multer=require(_0x76c1('0x0'));var util=require(_0x76c1('0x1'));var path=require(_0x76c1('0x2'));var timeout=require(_0x76c1('0x3'));var express=require(_0x76c1('0x4'));var router=express[_0x76c1('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x76c1('0x6'));var interaction=require(_0x76c1('0x7'));var config=require(_0x76c1('0x8'));var controller=require(_0x76c1('0x9'));router['get']('/',auth[_0x76c1('0xa')](),controller[_0x76c1('0xb')]);router[_0x76c1('0xc')](_0x76c1('0xd'),auth['isAuthenticated'](),controller[_0x76c1('0xe')]);router['get'](_0x76c1('0xf'),auth[_0x76c1('0xa')](),controller[_0x76c1('0x10')]);router[_0x76c1('0xc')]('/:id/questions',auth[_0x76c1('0xa')](),controller[_0x76c1('0x11')]);router[_0x76c1('0x12')]('/',auth[_0x76c1('0xa')](),controller[_0x76c1('0x13')]);router[_0x76c1('0x14')](_0x76c1('0xf'),auth[_0x76c1('0xa')](),controller[_0x76c1('0x15')]);router[_0x76c1('0x16')](_0x76c1('0xf'),auth[_0x76c1('0xa')](),controller['destroy']);module[_0x76c1('0x17')]=router; \ No newline at end of file +var _0x9e5b=['getQuestions','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/questions'];(function(_0x5631c9,_0x367573){var _0x382601=function(_0x2e7f63){while(--_0x2e7f63){_0x5631c9['push'](_0x5631c9['shift']());}};_0x382601(++_0x367573);}(_0x9e5b,0x18e));var _0xb9e5=function(_0x21631f,_0x3a8d53){_0x21631f=_0x21631f-0x0;var _0xea848e=_0x9e5b[_0x21631f];return _0xea848e;};'use strict';var multer=require(_0xb9e5('0x0'));var util=require(_0xb9e5('0x1'));var path=require('path');var timeout=require(_0xb9e5('0x2'));var express=require(_0xb9e5('0x3'));var router=express[_0xb9e5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb9e5('0x5'));var interaction=require(_0xb9e5('0x6'));var config=require('../../config/environment');var controller=require(_0xb9e5('0x7'));router[_0xb9e5('0x8')]('/',auth[_0xb9e5('0x9')](),controller[_0xb9e5('0xa')]);router[_0xb9e5('0x8')](_0xb9e5('0xb'),auth[_0xb9e5('0x9')](),controller[_0xb9e5('0xc')]);router[_0xb9e5('0x8')](_0xb9e5('0xd'),auth[_0xb9e5('0x9')](),controller[_0xb9e5('0xe')]);router[_0xb9e5('0x8')](_0xb9e5('0xf'),auth['isAuthenticated'](),controller[_0xb9e5('0x10')]);router[_0xb9e5('0x11')]('/',auth[_0xb9e5('0x9')](),controller[_0xb9e5('0x12')]);router[_0xb9e5('0x13')](_0xb9e5('0xd'),auth[_0xb9e5('0x9')](),controller[_0xb9e5('0x14')]);router[_0xb9e5('0x15')](_0xb9e5('0xd'),auth[_0xb9e5('0x9')](),controller[_0xb9e5('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index b4efb1a..36c8454 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 _0xebb4=['format','DATE','STRING','BOOLEAN','moment','sequelize','setDataValue','starttime'];(function(_0x2b55b5,_0x78505e){var _0x103d28=function(_0x5095a2){while(--_0x5095a2){_0x2b55b5['push'](_0x2b55b5['shift']());}};_0x103d28(++_0x78505e);}(_0xebb4,0xbc));var _0x4ebb=function(_0x357222,_0x1ab4c7){_0x357222=_0x357222-0x0;var _0x427a39=_0xebb4[_0x357222];return _0x427a39;};'use strict';var moment=require(_0x4ebb('0x0'));var Sequelize=require(_0x4ebb('0x1'));module['exports']={'starttime':{'type':Sequelize['DATE'],'set':function(_0x26291c){this[_0x4ebb('0x2')](_0x4ebb('0x3'),_0x26291c);this[_0x4ebb('0x2')]('endtime',moment()[_0x4ebb('0x4')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x4ebb('0x5')]},'membername':{'type':Sequelize[_0x4ebb('0x6')]},'projectname':{'type':Sequelize[_0x4ebb('0x6')]},'queue':{'type':Sequelize[_0x4ebb('0x6')]},'uniqueid':{'type':Sequelize[_0x4ebb('0x6')]},'calleridname':{'type':Sequelize[_0x4ebb('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x4ebb('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0x08ba=['endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','exports','DATE','setDataValue','starttime'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x08ba,0xd6));var _0xa08b=function(_0xdc5d93,_0x594c9c){_0xdc5d93=_0xdc5d93-0x0;var _0x8455e7=_0x08ba[_0xdc5d93];return _0x8455e7;};'use strict';var moment=require(_0xa08b('0x0'));var Sequelize=require(_0xa08b('0x1'));module[_0xa08b('0x2')]={'starttime':{'type':Sequelize[_0xa08b('0x3')],'set':function(_0x4b6bf5){this[_0xa08b('0x4')](_0xa08b('0x5'),_0x4b6bf5);this[_0xa08b('0x4')](_0xa08b('0x6'),moment()[_0xa08b('0x7')](_0xa08b('0x8')));}},'endtime':{'type':Sequelize[_0xa08b('0x3')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0xa08b('0x9')]},'queue':{'type':Sequelize[_0xa08b('0x9')]},'uniqueid':{'type':Sequelize[_0xa08b('0x9')]},'calleridname':{'type':Sequelize[_0xa08b('0x9')]},'calleridnum':{'type':Sequelize[_0xa08b('0x9')]},'completed':{'type':Sequelize[_0xa08b('0xa')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 837192b..383832b 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 _0x8392=['api','../../config/environment','../../config/license/util','status','end','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','destroy','sendStatus','error','name','send','map','JscriptySessionReport','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','describe','getQuestions','JscriptyQuestionReport','SessionId','filter','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x3fb23b,_0x5c0f4b){var _0x2d6a17=function(_0x84d9f5){while(--_0x84d9f5){_0x3fb23b['push'](_0x3fb23b['shift']());}};_0x2d6a17(++_0x5c0f4b);}(_0x8392,0x179));var _0x2839=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x8392[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x2839('0x0'));var rimraf=require(_0x2839('0x1'));var zipdir=require(_0x2839('0x2'));var jsonpatch=require(_0x2839('0x3'));var rp=require(_0x2839('0x4'));var moment=require(_0x2839('0x5'));var BPromise=require(_0x2839('0x6'));var Mustache=require(_0x2839('0x7'));var util=require(_0x2839('0x8'));var path=require(_0x2839('0x9'));var sox=require(_0x2839('0xa'));var csv=require(_0x2839('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2839('0xc'));var _=require(_0x2839('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2839('0xe'));var deskjs=require(_0x2839('0xf'));var toCsv=require(_0x2839('0xb'));var querystring=require(_0x2839('0x10'));var Papa=require('papaparse');var Redis=require(_0x2839('0x11'));var authService=require(_0x2839('0x12'));var qs=require(_0x2839('0x13'));var as=require(_0x2839('0x14'));var hardwareService=require(_0x2839('0x15'));var logger=require(_0x2839('0x16'))(_0x2839('0x17'));var utils=require('../../config/utils');var config=require(_0x2839('0x18'));var licenseUtil=require(_0x2839('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32ea09,_0x22897e){_0x22897e=_0x22897e||0xcc;return function(_0x5d3148){if(_0x5d3148){return _0x32ea09['sendStatus'](_0x22897e);}return _0x32ea09[_0x2839('0x1a')](_0x22897e)[_0x2839('0x1b')]();};}function respondWithResult(_0x195740,_0x2b5a13){_0x2b5a13=_0x2b5a13||0xc8;return function(_0x5a95b2){if(_0x5a95b2){return _0x195740[_0x2839('0x1a')](_0x2b5a13)[_0x2839('0x1c')](_0x5a95b2);}};}function respondWithFilteredResult(_0x1b3991,_0x31825e){return function(_0x5cf922){if(_0x5cf922){var _0x470e9e=typeof _0x31825e['offset']===_0x2839('0x1d')&&typeof _0x31825e[_0x2839('0x1e')]===_0x2839('0x1d');var _0x3e4a7f=_0x5cf922[_0x2839('0x1f')];var _0x425095=_0x470e9e?0x0:_0x31825e[_0x2839('0x20')];var _0x54d50e=_0x470e9e?_0x5cf922[_0x2839('0x1f')]:_0x31825e[_0x2839('0x20')]+_0x31825e[_0x2839('0x1e')];var _0x4ed0e1;if(_0x54d50e>=_0x3e4a7f){_0x54d50e=_0x3e4a7f;_0x4ed0e1=0xc8;}else{_0x4ed0e1=0xce;}_0x1b3991['status'](_0x4ed0e1);return _0x1b3991['set'](_0x2839('0x21'),_0x425095+'-'+_0x54d50e+'/'+_0x3e4a7f)['json'](_0x5cf922);}return null;};}function patchUpdates(_0x25b9c0){return function(_0x406840){try{jsonpatch['apply'](_0x406840,_0x25b9c0,!![]);}catch(_0x3fc52f){return BPromise[_0x2839('0x22')](_0x3fc52f);}return _0x406840[_0x2839('0x23')]();};}function saveUpdates(_0x51df17,_0x335d4b){return function(_0xfe46a5){if(_0xfe46a5){return _0xfe46a5[_0x2839('0x24')](_0x51df17)[_0x2839('0x25')](function(_0x473ecf){return _0x473ecf;});}return null;};}function removeEntity(_0x4856be,_0x36863d){return function(_0x3d6184){if(_0x3d6184){return _0x3d6184[_0x2839('0x26')]()[_0x2839('0x25')](function(){_0x4856be[_0x2839('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a1f0d,_0x3fc973){return function(_0x3e2e30){if(!_0x3e2e30){_0x1a1f0d[_0x2839('0x27')](0x194);}return _0x3e2e30;};}function handleError(_0x56bf2d,_0x118501){_0x118501=_0x118501||0x1f4;return function(_0x328f3b){logger[_0x2839('0x28')](_0x328f3b['stack']);if(_0x328f3b[_0x2839('0x29')]){delete _0x328f3b[_0x2839('0x29')];}_0x56bf2d[_0x2839('0x1a')](_0x118501)[_0x2839('0x2a')](_0x328f3b);};}exports['index']=function(_0x34233f,_0x49c16d){var _0x329664={},_0xb1c64={},_0x2c57d4={'count':0x0,'rows':[]};var _0x5dfb63=_[_0x2839('0x2b')](db[_0x2839('0x2c')]['rawAttributes'],function(_0x425118){return{'name':_0x425118[_0x2839('0x2d')],'type':_0x425118[_0x2839('0x2e')][_0x2839('0x2f')]};});_0xb1c64['model']=_[_0x2839('0x2b')](_0x5dfb63,_0x2839('0x29'));_0xb1c64[_0x2839('0x30')]=_[_0x2839('0x31')](_0x34233f[_0x2839('0x30')]);_0xb1c64[_0x2839('0x32')]=_[_0x2839('0x33')](_0xb1c64['model'],_0xb1c64['query']);_0x329664[_0x2839('0x34')]=_[_0x2839('0x33')](_0xb1c64[_0x2839('0x35')],qs['fields'](_0x34233f['query'][_0x2839('0x36')]));_0x329664[_0x2839('0x34')]=_0x329664['attributes'][_0x2839('0x37')]?_0x329664[_0x2839('0x34')]:_0xb1c64[_0x2839('0x35')];if(!_0x34233f[_0x2839('0x30')][_0x2839('0x38')](_0x2839('0x39'))){_0x329664[_0x2839('0x1e')]=qs[_0x2839('0x1e')](_0x34233f[_0x2839('0x30')][_0x2839('0x1e')]);_0x329664['offset']=qs[_0x2839('0x20')](_0x34233f['query']['offset']);}_0x329664['order']=qs[_0x2839('0x3a')](_0x34233f[_0x2839('0x30')][_0x2839('0x3a')]);_0x329664[_0x2839('0x3b')]=qs[_0x2839('0x32')](_[_0x2839('0x3c')](_0x34233f[_0x2839('0x30')],_0xb1c64[_0x2839('0x32')]),_0x5dfb63);if(_0x34233f[_0x2839('0x30')]['filter']){_0x329664[_0x2839('0x3b')]=_[_0x2839('0x3d')](_0x329664[_0x2839('0x3b')],{'$or':_[_0x2839('0x2b')](_0x5dfb63,function(_0x36ad28){if(_0x36ad28[_0x2839('0x2e')]!==_0x2839('0x3e')){var _0x63301f={};_0x63301f[_0x36ad28['name']]={'$like':'%'+_0x34233f[_0x2839('0x30')]['filter']+'%'};return _0x63301f;}})});}_0x329664=_[_0x2839('0x3d')]({},_0x329664,_0x34233f[_0x2839('0x3f')]);var _0x1516da={'where':_0x329664['where']};return db[_0x2839('0x2c')][_0x2839('0x1f')](_0x1516da)[_0x2839('0x25')](function(_0x371017){_0x2c57d4['count']=_0x371017;if(_0x34233f[_0x2839('0x30')][_0x2839('0x40')]){_0x329664[_0x2839('0x41')]=[{'all':!![]}];}return db[_0x2839('0x2c')][_0x2839('0x42')](_0x329664);})[_0x2839('0x25')](function(_0x16cd03){_0x2c57d4[_0x2839('0x43')]=_0x16cd03;return _0x2c57d4;})[_0x2839('0x25')](respondWithFilteredResult(_0x49c16d,_0x329664))[_0x2839('0x44')](handleError(_0x49c16d,null));};exports[_0x2839('0x45')]=function(_0xe6d76f,_0x5701a2){var _0x3c9fd1={'raw':!![],'where':{'id':_0xe6d76f[_0x2839('0x46')]['id']}},_0x136808={};_0x136808[_0x2839('0x35')]=_[_0x2839('0x31')](db['JscriptySessionReport'][_0x2839('0x47')]);_0x136808[_0x2839('0x30')]=_[_0x2839('0x31')](_0xe6d76f[_0x2839('0x30')]);_0x136808['filters']=_[_0x2839('0x33')](_0x136808['model'],_0x136808[_0x2839('0x30')]);_0x3c9fd1['attributes']=_[_0x2839('0x33')](_0x136808[_0x2839('0x35')],qs['fields'](_0xe6d76f['query'][_0x2839('0x36')]));_0x3c9fd1[_0x2839('0x34')]=_0x3c9fd1['attributes'][_0x2839('0x37')]?_0x3c9fd1[_0x2839('0x34')]:_0x136808[_0x2839('0x35')];if(_0xe6d76f[_0x2839('0x30')][_0x2839('0x40')]){_0x3c9fd1['include']=[{'all':!![]}];}_0x3c9fd1=_[_0x2839('0x3d')]({},_0x3c9fd1,_0xe6d76f['options']);return db[_0x2839('0x2c')]['find'](_0x3c9fd1)['then'](handleEntityNotFound(_0x5701a2,null))[_0x2839('0x25')](respondWithResult(_0x5701a2,null))[_0x2839('0x44')](handleError(_0x5701a2,null));};exports[_0x2839('0x48')]=function(_0x813fdf,_0x63a846){return db[_0x2839('0x2c')][_0x2839('0x48')](_0x813fdf['body'],{})[_0x2839('0x25')](respondWithResult(_0x63a846,0xc9))[_0x2839('0x44')](handleError(_0x63a846,null));};exports[_0x2839('0x24')]=function(_0x1f50c2,_0x4fe7eb){if(_0x1f50c2[_0x2839('0x49')]['id']){delete _0x1f50c2[_0x2839('0x49')]['id'];}return db['JscriptySessionReport']['find']({'where':{'id':_0x1f50c2['params']['id']}})['then'](handleEntityNotFound(_0x4fe7eb,null))[_0x2839('0x25')](saveUpdates(_0x1f50c2[_0x2839('0x49')],null))[_0x2839('0x25')](respondWithResult(_0x4fe7eb,null))['catch'](handleError(_0x4fe7eb,null));};exports[_0x2839('0x26')]=function(_0x31a19e,_0x4b0bc8){return db[_0x2839('0x2c')][_0x2839('0x4a')]({'where':{'id':_0x31a19e[_0x2839('0x46')]['id']}})[_0x2839('0x25')](handleEntityNotFound(_0x4b0bc8,null))[_0x2839('0x25')](removeEntity(_0x4b0bc8,null))[_0x2839('0x44')](handleError(_0x4b0bc8,null));};exports[_0x2839('0x4b')]=function(_0x535221,_0x3f57c3){return db[_0x2839('0x2c')]['describe']()[_0x2839('0x25')](respondWithResult(_0x3f57c3,null))[_0x2839('0x44')](handleError(_0x3f57c3,null));};exports[_0x2839('0x4c')]=function(_0x1e32ab,_0x14ab6a,_0x405fd1){var _0x48387b={'raw':!![],'where':{}};var _0x559950={};var _0x180f3a={'count':0x0,'rows':[]};return db[_0x2839('0x2c')]['findOne']({'where':{'id':_0x1e32ab['params']['id']}})[_0x2839('0x25')](handleEntityNotFound(_0x14ab6a,null))['then'](function(_0x2e07d3){if(_0x2e07d3){_0x559950[_0x2839('0x35')]=_[_0x2839('0x31')](db[_0x2839('0x4d')]['rawAttributes']);_0x559950['query']=_[_0x2839('0x31')](_0x1e32ab['query']);_0x559950[_0x2839('0x32')]=_[_0x2839('0x33')](_0x559950['model'],_0x559950[_0x2839('0x30')]);_0x48387b[_0x2839('0x34')]=_[_0x2839('0x33')](_0x559950['model'],qs[_0x2839('0x36')](_0x1e32ab[_0x2839('0x30')][_0x2839('0x36')]));_0x48387b['attributes']=_0x48387b[_0x2839('0x34')]['length']?_0x48387b[_0x2839('0x34')]:_0x559950[_0x2839('0x35')];if(!_0x1e32ab['query'][_0x2839('0x38')](_0x2839('0x39'))){_0x48387b['limit']=qs[_0x2839('0x1e')](_0x1e32ab[_0x2839('0x30')][_0x2839('0x1e')]);_0x48387b['offset']=qs[_0x2839('0x20')](_0x1e32ab[_0x2839('0x30')][_0x2839('0x20')]);}_0x48387b['order']=qs[_0x2839('0x3a')](_0x1e32ab[_0x2839('0x30')][_0x2839('0x3a')]);_0x48387b[_0x2839('0x3b')]=qs[_0x2839('0x32')](_[_0x2839('0x3c')](_0x1e32ab['query'],_0x559950[_0x2839('0x32')]));_0x48387b[_0x2839('0x3b')][_0x2839('0x4e')]=_0x2e07d3['id'];if(_0x1e32ab['query']['filter']){_0x48387b['where']=_[_0x2839('0x3d')](_0x48387b[_0x2839('0x3b')],{'$or':_[_0x2839('0x2b')](_0x48387b[_0x2839('0x34')],function(_0x31bf0f){var _0x48111b={};_0x48111b[_0x31bf0f]={'$like':'%'+_0x1e32ab[_0x2839('0x30')][_0x2839('0x4f')]+'%'};return _0x48111b;})});}_0x48387b=_['merge']({},_0x48387b,_0x1e32ab[_0x2839('0x3f')]);return db[_0x2839('0x4d')][_0x2839('0x1f')]({'where':_0x48387b[_0x2839('0x3b')]})[_0x2839('0x25')](function(_0x255a57){_0x180f3a['count']=_0x255a57;if(_0x1e32ab[_0x2839('0x30')][_0x2839('0x40')]){_0x48387b['include']=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x48387b);})[_0x2839('0x25')](function(_0x5a937e){_0x180f3a[_0x2839('0x43')]=_0x5a937e;return _0x180f3a;});}})[_0x2839('0x25')](respondWithFilteredResult(_0x14ab6a,_0x48387b))[_0x2839('0x44')](handleError(_0x14ab6a,null));}; \ No newline at end of file +var _0x9e90=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','name','send','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','find','catch','body','params','describe','getQuestions','findOne','hasOwnProperty','SessionId','JscriptyQuestionReport','eml-format','rimraf','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'];(function(_0x42e013,_0x4e1584){var _0x3e951b=function(_0x5fb964){while(--_0x5fb964){_0x42e013['push'](_0x42e013['shift']());}};_0x3e951b(++_0x4e1584);}(_0x9e90,0x12c));var _0x09e9=function(_0x5aa7cf,_0x39b3bc){_0x5aa7cf=_0x5aa7cf-0x0;var _0xeefa3c=_0x9e90[_0x5aa7cf];return _0xeefa3c;};'use strict';var emlformat=require(_0x09e9('0x0'));var rimraf=require(_0x09e9('0x1'));var zipdir=require(_0x09e9('0x2'));var jsonpatch=require(_0x09e9('0x3'));var rp=require(_0x09e9('0x4'));var moment=require('moment');var BPromise=require(_0x09e9('0x5'));var Mustache=require(_0x09e9('0x6'));var util=require(_0x09e9('0x7'));var path=require('path');var sox=require(_0x09e9('0x8'));var csv=require('to-csv');var ejs=require(_0x09e9('0x9'));var fs=require('fs');var fs_extra=require(_0x09e9('0xa'));var _=require(_0x09e9('0xb'));var squel=require(_0x09e9('0xc'));var crypto=require(_0x09e9('0xd'));var jsforce=require(_0x09e9('0xe'));var deskjs=require(_0x09e9('0xf'));var toCsv=require(_0x09e9('0x10'));var querystring=require(_0x09e9('0x11'));var Papa=require(_0x09e9('0x12'));var Redis=require(_0x09e9('0x13'));var authService=require(_0x09e9('0x14'));var qs=require(_0x09e9('0x15'));var as=require(_0x09e9('0x16'));var hardwareService=require(_0x09e9('0x17'));var logger=require(_0x09e9('0x18'))('api');var utils=require(_0x09e9('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x09e9('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f3551,_0xcf24b0){_0xcf24b0=_0xcf24b0||0xcc;return function(_0x100aac){if(_0x100aac){return _0x1f3551[_0x09e9('0x1b')](_0xcf24b0);}return _0x1f3551[_0x09e9('0x1c')](_0xcf24b0)[_0x09e9('0x1d')]();};}function respondWithResult(_0x13f42b,_0x4bccb4){_0x4bccb4=_0x4bccb4||0xc8;return function(_0x1f786c){if(_0x1f786c){return _0x13f42b['status'](_0x4bccb4)[_0x09e9('0x1e')](_0x1f786c);}};}function respondWithFilteredResult(_0x5e344e,_0xe0626){return function(_0x584700){if(_0x584700){var _0x5dbd5d=typeof _0xe0626[_0x09e9('0x1f')]===_0x09e9('0x20')&&typeof _0xe0626['limit']===_0x09e9('0x20');var _0x546f23=_0x584700[_0x09e9('0x21')];var _0x5397b0=_0x5dbd5d?0x0:_0xe0626[_0x09e9('0x1f')];var _0x1919c3=_0x5dbd5d?_0x584700['count']:_0xe0626[_0x09e9('0x1f')]+_0xe0626[_0x09e9('0x22')];var _0x841332;if(_0x1919c3>=_0x546f23){_0x1919c3=_0x546f23;_0x841332=0xc8;}else{_0x841332=0xce;}_0x5e344e[_0x09e9('0x1c')](_0x841332);return _0x5e344e[_0x09e9('0x23')](_0x09e9('0x24'),_0x5397b0+'-'+_0x1919c3+'/'+_0x546f23)['json'](_0x584700);}return null;};}function patchUpdates(_0x131937){return function(_0x1991a6){try{jsonpatch[_0x09e9('0x25')](_0x1991a6,_0x131937,!![]);}catch(_0x1b97ad){return BPromise['reject'](_0x1b97ad);}return _0x1991a6[_0x09e9('0x26')]();};}function saveUpdates(_0x48fa6d,_0x1b29bc){return function(_0x59706e){if(_0x59706e){return _0x59706e[_0x09e9('0x27')](_0x48fa6d)[_0x09e9('0x28')](function(_0x3cb7bb){return _0x3cb7bb;});}return null;};}function removeEntity(_0x14400c,_0x2fa5dd){return function(_0x5db345){if(_0x5db345){return _0x5db345[_0x09e9('0x29')]()[_0x09e9('0x28')](function(){_0x14400c[_0x09e9('0x1c')](0xcc)[_0x09e9('0x1d')]();});}};}function handleEntityNotFound(_0x2576dc,_0x45396b){return function(_0x56b412){if(!_0x56b412){_0x2576dc[_0x09e9('0x1b')](0x194);}return _0x56b412;};}function handleError(_0x562e43,_0x545327){_0x545327=_0x545327||0x1f4;return function(_0x354e61){logger['error'](_0x354e61['stack']);if(_0x354e61[_0x09e9('0x2a')]){delete _0x354e61[_0x09e9('0x2a')];}_0x562e43[_0x09e9('0x1c')](_0x545327)[_0x09e9('0x2b')](_0x354e61);};}exports['index']=function(_0x226f4a,_0x2062a6){var _0x2ead75={},_0x4bb9b8={},_0x14d26d={'count':0x0,'rows':[]};var _0x21639e=_[_0x09e9('0x2c')](db[_0x09e9('0x2d')][_0x09e9('0x2e')],function(_0x386687){return{'name':_0x386687[_0x09e9('0x2f')],'type':_0x386687[_0x09e9('0x30')][_0x09e9('0x31')]};});_0x4bb9b8[_0x09e9('0x32')]=_['map'](_0x21639e,'name');_0x4bb9b8['query']=_[_0x09e9('0x33')](_0x226f4a[_0x09e9('0x34')]);_0x4bb9b8[_0x09e9('0x35')]=_[_0x09e9('0x36')](_0x4bb9b8['model'],_0x4bb9b8['query']);_0x2ead75[_0x09e9('0x37')]=_[_0x09e9('0x36')](_0x4bb9b8[_0x09e9('0x32')],qs['fields'](_0x226f4a[_0x09e9('0x34')][_0x09e9('0x38')]));_0x2ead75['attributes']=_0x2ead75[_0x09e9('0x37')][_0x09e9('0x39')]?_0x2ead75[_0x09e9('0x37')]:_0x4bb9b8[_0x09e9('0x32')];if(!_0x226f4a[_0x09e9('0x34')]['hasOwnProperty'](_0x09e9('0x3a'))){_0x2ead75[_0x09e9('0x22')]=qs[_0x09e9('0x22')](_0x226f4a['query']['limit']);_0x2ead75['offset']=qs[_0x09e9('0x1f')](_0x226f4a[_0x09e9('0x34')]['offset']);}_0x2ead75[_0x09e9('0x3b')]=qs[_0x09e9('0x3c')](_0x226f4a['query']['sort']);_0x2ead75[_0x09e9('0x3d')]=qs[_0x09e9('0x35')](_[_0x09e9('0x3e')](_0x226f4a[_0x09e9('0x34')],_0x4bb9b8[_0x09e9('0x35')]),_0x21639e);if(_0x226f4a[_0x09e9('0x34')][_0x09e9('0x3f')]){_0x2ead75['where']=_[_0x09e9('0x40')](_0x2ead75[_0x09e9('0x3d')],{'$or':_[_0x09e9('0x2c')](_0x21639e,function(_0xda4459){if(_0xda4459[_0x09e9('0x30')]!==_0x09e9('0x41')){var _0x400481={};_0x400481[_0xda4459[_0x09e9('0x2a')]]={'$like':'%'+_0x226f4a[_0x09e9('0x34')][_0x09e9('0x3f')]+'%'};return _0x400481;}})});}_0x2ead75=_[_0x09e9('0x40')]({},_0x2ead75,_0x226f4a[_0x09e9('0x42')]);var _0x18e0ef={'where':_0x2ead75[_0x09e9('0x3d')]};return db[_0x09e9('0x2d')][_0x09e9('0x21')](_0x18e0ef)[_0x09e9('0x28')](function(_0x41d5d8){_0x14d26d[_0x09e9('0x21')]=_0x41d5d8;if(_0x226f4a[_0x09e9('0x34')][_0x09e9('0x43')]){_0x2ead75['include']=[{'all':!![]}];}return db[_0x09e9('0x2d')][_0x09e9('0x44')](_0x2ead75);})[_0x09e9('0x28')](function(_0x5b339d){_0x14d26d[_0x09e9('0x45')]=_0x5b339d;return _0x14d26d;})['then'](respondWithFilteredResult(_0x2062a6,_0x2ead75))['catch'](handleError(_0x2062a6,null));};exports['show']=function(_0x4cdfd2,_0x5f15b9){var _0x2ccaf6={'raw':!![],'where':{'id':_0x4cdfd2['params']['id']}},_0x4bd38c={};_0x4bd38c[_0x09e9('0x32')]=_[_0x09e9('0x33')](db['JscriptySessionReport'][_0x09e9('0x2e')]);_0x4bd38c[_0x09e9('0x34')]=_[_0x09e9('0x33')](_0x4cdfd2[_0x09e9('0x34')]);_0x4bd38c[_0x09e9('0x35')]=_[_0x09e9('0x36')](_0x4bd38c[_0x09e9('0x32')],_0x4bd38c[_0x09e9('0x34')]);_0x2ccaf6[_0x09e9('0x37')]=_[_0x09e9('0x36')](_0x4bd38c[_0x09e9('0x32')],qs[_0x09e9('0x38')](_0x4cdfd2[_0x09e9('0x34')]['fields']));_0x2ccaf6['attributes']=_0x2ccaf6[_0x09e9('0x37')][_0x09e9('0x39')]?_0x2ccaf6[_0x09e9('0x37')]:_0x4bd38c[_0x09e9('0x32')];if(_0x4cdfd2['query'][_0x09e9('0x43')]){_0x2ccaf6['include']=[{'all':!![]}];}_0x2ccaf6=_[_0x09e9('0x40')]({},_0x2ccaf6,_0x4cdfd2['options']);return db[_0x09e9('0x2d')][_0x09e9('0x46')](_0x2ccaf6)[_0x09e9('0x28')](handleEntityNotFound(_0x5f15b9,null))['then'](respondWithResult(_0x5f15b9,null))[_0x09e9('0x47')](handleError(_0x5f15b9,null));};exports['create']=function(_0x5a7651,_0x5e6951){return db[_0x09e9('0x2d')]['create'](_0x5a7651[_0x09e9('0x48')],{})[_0x09e9('0x28')](respondWithResult(_0x5e6951,0xc9))[_0x09e9('0x47')](handleError(_0x5e6951,null));};exports[_0x09e9('0x27')]=function(_0x147941,_0x24bf1c){if(_0x147941[_0x09e9('0x48')]['id']){delete _0x147941[_0x09e9('0x48')]['id'];}return db[_0x09e9('0x2d')][_0x09e9('0x46')]({'where':{'id':_0x147941[_0x09e9('0x49')]['id']}})['then'](handleEntityNotFound(_0x24bf1c,null))[_0x09e9('0x28')](saveUpdates(_0x147941[_0x09e9('0x48')],null))['then'](respondWithResult(_0x24bf1c,null))[_0x09e9('0x47')](handleError(_0x24bf1c,null));};exports[_0x09e9('0x29')]=function(_0x5dab5f,_0x353220){return db[_0x09e9('0x2d')][_0x09e9('0x46')]({'where':{'id':_0x5dab5f[_0x09e9('0x49')]['id']}})[_0x09e9('0x28')](handleEntityNotFound(_0x353220,null))[_0x09e9('0x28')](removeEntity(_0x353220,null))[_0x09e9('0x47')](handleError(_0x353220,null));};exports[_0x09e9('0x4a')]=function(_0xa159f8,_0x1fe7d3){return db['JscriptySessionReport'][_0x09e9('0x4a')]()[_0x09e9('0x28')](respondWithResult(_0x1fe7d3,null))['catch'](handleError(_0x1fe7d3,null));};exports[_0x09e9('0x4b')]=function(_0x575c1e,_0x3bdd73,_0x245e33){var _0xe654e7={'raw':!![],'where':{}};var _0x2fc57c={};var _0x586f8f={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x09e9('0x4c')]({'where':{'id':_0x575c1e[_0x09e9('0x49')]['id']}})['then'](handleEntityNotFound(_0x3bdd73,null))['then'](function(_0x1b0743){if(_0x1b0743){_0x2fc57c[_0x09e9('0x32')]=_[_0x09e9('0x33')](db['JscriptyQuestionReport'][_0x09e9('0x2e')]);_0x2fc57c[_0x09e9('0x34')]=_[_0x09e9('0x33')](_0x575c1e['query']);_0x2fc57c['filters']=_[_0x09e9('0x36')](_0x2fc57c[_0x09e9('0x32')],_0x2fc57c[_0x09e9('0x34')]);_0xe654e7[_0x09e9('0x37')]=_[_0x09e9('0x36')](_0x2fc57c[_0x09e9('0x32')],qs[_0x09e9('0x38')](_0x575c1e[_0x09e9('0x34')]['fields']));_0xe654e7[_0x09e9('0x37')]=_0xe654e7['attributes'][_0x09e9('0x39')]?_0xe654e7['attributes']:_0x2fc57c[_0x09e9('0x32')];if(!_0x575c1e['query'][_0x09e9('0x4d')](_0x09e9('0x3a'))){_0xe654e7[_0x09e9('0x22')]=qs[_0x09e9('0x22')](_0x575c1e[_0x09e9('0x34')][_0x09e9('0x22')]);_0xe654e7[_0x09e9('0x1f')]=qs[_0x09e9('0x1f')](_0x575c1e[_0x09e9('0x34')]['offset']);}_0xe654e7[_0x09e9('0x3b')]=qs['sort'](_0x575c1e[_0x09e9('0x34')][_0x09e9('0x3c')]);_0xe654e7[_0x09e9('0x3d')]=qs[_0x09e9('0x35')](_[_0x09e9('0x3e')](_0x575c1e['query'],_0x2fc57c[_0x09e9('0x35')]));_0xe654e7[_0x09e9('0x3d')][_0x09e9('0x4e')]=_0x1b0743['id'];if(_0x575c1e[_0x09e9('0x34')][_0x09e9('0x3f')]){_0xe654e7['where']=_[_0x09e9('0x40')](_0xe654e7[_0x09e9('0x3d')],{'$or':_[_0x09e9('0x2c')](_0xe654e7[_0x09e9('0x37')],function(_0x1c2d62){var _0x3f11a5={};_0x3f11a5[_0x1c2d62]={'$like':'%'+_0x575c1e[_0x09e9('0x34')]['filter']+'%'};return _0x3f11a5;})});}_0xe654e7=_[_0x09e9('0x40')]({},_0xe654e7,_0x575c1e['options']);return db[_0x09e9('0x4f')][_0x09e9('0x21')]({'where':_0xe654e7[_0x09e9('0x3d')]})['then'](function(_0x362ae9){_0x586f8f[_0x09e9('0x21')]=_0x362ae9;if(_0x575c1e[_0x09e9('0x34')][_0x09e9('0x43')]){_0xe654e7['include']=[{'all':!![]}];}return db[_0x09e9('0x4f')][_0x09e9('0x44')](_0xe654e7);})[_0x09e9('0x28')](function(_0x26d94f){_0x586f8f[_0x09e9('0x45')]=_0x26d94f;return _0x586f8f;});}})[_0x09e9('0x28')](respondWithFilteredResult(_0x3bdd73,_0xe654e7))[_0x09e9('0x47')](handleError(_0x3bdd73,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 267988c..fb9f155 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 _0xa46e=['api','moment','bluebird','path','../../config/environment','exports','define','report_jscripty_sessions','lodash','util'];(function(_0x35485a,_0x91cdd4){var _0x5148e6=function(_0x27ed1d){while(--_0x27ed1d){_0x35485a['push'](_0x35485a['shift']());}};_0x5148e6(++_0x91cdd4);}(_0xa46e,0x8a));var _0xea46=function(_0xca1f0e,_0x2713d5){_0xca1f0e=_0xca1f0e-0x0;var _0x35e4ef=_0xa46e[_0xca1f0e];return _0x35e4ef;};'use strict';var _=require(_0xea46('0x0'));var util=require(_0xea46('0x1'));var logger=require('../../config/logger')(_0xea46('0x2'));var moment=require(_0xea46('0x3'));var BPromise=require(_0xea46('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xea46('0x5'));var rimraf=require('rimraf');var config=require(_0xea46('0x6'));var attributes=require('./jscriptySessionReport.attributes');module[_0xea46('0x7')]=function(_0x528404,_0x10bee5){return _0x528404[_0xea46('0x8')]('JscriptySessionReport',attributes,{'tableName':_0xea46('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4819=['report_jscripty_sessions','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','JscriptySessionReport'];(function(_0x1d1fe8,_0x17b5a7){var _0x31fd64=function(_0x27e551){while(--_0x27e551){_0x1d1fe8['push'](_0x1d1fe8['shift']());}};_0x31fd64(++_0x17b5a7);}(_0x4819,0xcd));var _0x9481=function(_0x2f5100,_0x565cbe){_0x2f5100=_0x2f5100-0x0;var _0x40c4bc=_0x4819[_0x2f5100];return _0x40c4bc;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var logger=require(_0x9481('0x1'))(_0x9481('0x2'));var moment=require(_0x9481('0x3'));var BPromise=require(_0x9481('0x4'));var rp=require(_0x9481('0x5'));var fs=require('fs');var path=require(_0x9481('0x6'));var rimraf=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var attributes=require(_0x9481('0x9'));module['exports']=function(_0x4d9e3a,_0x5def07){return _0x4d9e3a['define'](_0x9481('0xa'),attributes,{'tableName':_0x9481('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 83f94c2..239e385 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 _0x8aad=['stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','rpc','client','http','request','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s'];(function(_0x5e4c01,_0x372def){var _0x46029e=function(_0x1dbbf7){while(--_0x1dbbf7){_0x5e4c01['push'](_0x5e4c01['shift']());}};_0x46029e(++_0x372def);}(_0x8aad,0x146));var _0xd8aa=function(_0x33cb14,_0x3a21d3){_0x33cb14=_0x33cb14-0x0;var _0x3ef0a4=_0x8aad[_0x33cb14];return _0x3ef0a4;};'use strict';var _=require(_0xd8aa('0x0'));var util=require(_0xd8aa('0x1'));var moment=require('moment');var BPromise=require(_0xd8aa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd8aa('0x3'));var db=require(_0xd8aa('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd8aa('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd8aa('0x6')][_0xd8aa('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x16ea12,_0x4a4b10,_0x2a559d){return new BPromise(function(_0x1da411,_0x2a23b5){return client[_0xd8aa('0x8')](_0x16ea12,_0x2a559d)['then'](function(_0x5de228){logger[_0xd8aa('0x9')](_0xd8aa('0xa'),_0x4a4b10,_0xd8aa('0xb'));logger[_0xd8aa('0xc')](_0xd8aa('0xd'),_0x4a4b10,'request\x20sent',JSON[_0xd8aa('0xe')](_0x5de228));if(_0x5de228[_0xd8aa('0xf')]){if(_0x5de228[_0xd8aa('0xf')][_0xd8aa('0x10')]===0x1f4){logger[_0xd8aa('0xf')](_0xd8aa('0xa'),_0x4a4b10,_0x5de228[_0xd8aa('0xf')][_0xd8aa('0x11')]);return _0x2a23b5(_0x5de228[_0xd8aa('0xf')][_0xd8aa('0x11')]);}logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x4a4b10,_0x5de228[_0xd8aa('0xf')][_0xd8aa('0x11')]);return _0x1da411(_0x5de228[_0xd8aa('0xf')]['message']);}else{logger[_0xd8aa('0x9')](_0xd8aa('0xa'),_0x4a4b10,_0xd8aa('0xb'));_0x1da411(_0x5de228[_0xd8aa('0x12')]['message']);}})[_0xd8aa('0x13')](function(_0xa9ba1b){logger['error'](_0xd8aa('0xa'),_0x4a4b10,_0xa9ba1b);_0x2a23b5(_0xa9ba1b);});});} \ No newline at end of file +var _0x4745=['debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent'];(function(_0x3c834a,_0x29abf7){var _0x141804=function(_0x1e85ef){while(--_0x1e85ef){_0x3c834a['push'](_0x3c834a['shift']());}};_0x141804(++_0x29abf7);}(_0x4745,0x1e7));var _0x5474=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0x4745[_0x2160a9];return _0xa88cf7;};'use strict';var _=require(_0x5474('0x0'));var util=require(_0x5474('0x1'));var moment=require(_0x5474('0x2'));var BPromise=require(_0x5474('0x3'));var rs=require(_0x5474('0x4'));var fs=require('fs');var Redis=require(_0x5474('0x5'));var db=require(_0x5474('0x6'))['db'];var utils=require(_0x5474('0x7'));var logger=require(_0x5474('0x8'))(_0x5474('0x9'));var config=require(_0x5474('0xa'));var jayson=require(_0x5474('0xb'));var client=jayson['client'][_0x5474('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x431f81,_0x57add7,_0x13929f){return new BPromise(function(_0x5d778b,_0x902ba8){return client[_0x5474('0xd')](_0x431f81,_0x13929f)['then'](function(_0xf876f8){logger[_0x5474('0xe')](_0x5474('0xf'),_0x57add7,_0x5474('0x10'));logger[_0x5474('0x11')](_0x5474('0x12'),_0x57add7,_0x5474('0x10'),JSON[_0x5474('0x13')](_0xf876f8));if(_0xf876f8['error']){if(_0xf876f8[_0x5474('0x14')][_0x5474('0x15')]===0x1f4){logger[_0x5474('0x14')](_0x5474('0xf'),_0x57add7,_0xf876f8[_0x5474('0x14')][_0x5474('0x16')]);return _0x902ba8(_0xf876f8[_0x5474('0x14')][_0x5474('0x16')]);}logger[_0x5474('0x14')]('JscriptySessionReport,\x20%s,\x20%s',_0x57add7,_0xf876f8[_0x5474('0x14')][_0x5474('0x16')]);return _0x5d778b(_0xf876f8[_0x5474('0x14')][_0x5474('0x16')]);}else{logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x57add7,'request\x20sent');_0x5d778b(_0xf876f8['result'][_0x5474('0x16')]);}})[_0x5474('0x17')](function(_0x2da774){logger['error'](_0x5474('0xf'),_0x57add7,_0x2da774);_0x902ba8(_0x2da774);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 859165b..3738aee 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 _0x30f8=['connect-timeout','Router','../../components/interaction/service','../../config/environment','./license.controller','get','put','/:id','update','isAuthenticated','multer','util','path'];(function(_0x5a1a51,_0x144c79){var _0x47edd7=function(_0x2259bb){while(--_0x2259bb){_0x5a1a51['push'](_0x5a1a51['shift']());}};_0x47edd7(++_0x144c79);}(_0x30f8,0x1de));var _0x830f=function(_0x234cfb,_0x364db0){_0x234cfb=_0x234cfb-0x0;var _0x2bd7c0=_0x30f8[_0x234cfb];return _0x2bd7c0;};'use strict';var multer=require(_0x830f('0x0'));var util=require(_0x830f('0x1'));var path=require(_0x830f('0x2'));var timeout=require(_0x830f('0x3'));var express=require('express');var router=express[_0x830f('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x830f('0x5'));var config=require(_0x830f('0x6'));var controller=require(_0x830f('0x7'));router[_0x830f('0x8')]('/',controller['index']);router[_0x830f('0x9')](_0x830f('0xa'),auth['isAuthenticated'](),controller[_0x830f('0xb')]);router[_0x830f('0x8')]('/download_log_file',auth[_0x830f('0xc')](),controller['downloadLogFile']);module['exports']=router; \ No newline at end of file +var _0x0b0e=['index','/:id','/download_log_file','downloadLogFile','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./license.controller','get'];(function(_0xdb0bac,_0x47fb4e){var _0x249f04=function(_0x3f4d2e){while(--_0x3f4d2e){_0xdb0bac['push'](_0xdb0bac['shift']());}};_0x249f04(++_0x47fb4e);}(_0x0b0e,0x1ee));var _0xe0b0=function(_0x296144,_0x26bbbf){_0x296144=_0x296144-0x0;var _0x5329b1=_0x0b0e[_0x296144];return _0x5329b1;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require(_0xe0b0('0x1'));var path=require(_0xe0b0('0x2'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x3'));var router=express[_0xe0b0('0x4')]();var fs_extra=require(_0xe0b0('0x5'));var auth=require(_0xe0b0('0x6'));var interaction=require(_0xe0b0('0x7'));var config=require('../../config/environment');var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',controller[_0xe0b0('0xa')]);router['put'](_0xe0b0('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xe0b0('0x9')](_0xe0b0('0xc'),auth['isAuthenticated'](),controller[_0xe0b0('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 9effbfe..f90cbe2 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 _0xfc0a=['INTEGER','sequelize','exports','TEXT','STRING'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xfc0a,0x164));var _0xafc0=function(_0x133838,_0x5f19a7){_0x133838=_0x133838-0x0;var _0x3a5239=_0xfc0a[_0x133838];return _0x3a5239;};'use strict';var Sequelize=require(_0xafc0('0x0'));module[_0xafc0('0x1')]={'license':{'type':Sequelize[_0xafc0('0x2')]},'data1':{'type':Sequelize[_0xafc0('0x3')]},'data2':{'type':Sequelize[_0xafc0('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0xafc0('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc593=['TEXT','STRING','exports'];(function(_0x490cd3,_0x97d5ee){var _0x3320d7=function(_0x2ad809){while(--_0x2ad809){_0x490cd3['push'](_0x490cd3['shift']());}};_0x3320d7(++_0x97d5ee);}(_0xc593,0x9b));var _0x3c59=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xc593[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require('sequelize');module[_0x3c59('0x0')]={'license':{'type':Sequelize[_0x3c59('0x1')]},'data1':{'type':Sequelize[_0x3c59('0x2')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 5557323..f7861b7 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 _0xda72=['crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','model','rawAttributes','keys','query','filters','attributes','intersection','fields','merge','body','License','find','params','get','checkLicense','key','demo','downloadLogFile','/var','xcally','setHeader','attachment;\x20filename=','Content-Type','text/plain','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x1782a7,_0x2b1eb7){var _0xd34638=function(_0x40347f){while(--_0x40347f){_0x1782a7['push'](_0x1782a7['shift']());}};_0xd34638(++_0x2b1eb7);}(_0xda72,0x1db));var _0x2da7=function(_0x402253,_0x58df55){_0x402253=_0x402253-0x0;var _0xfec336=_0xda72[_0x402253];return _0xfec336;};'use strict';var emlformat=require(_0x2da7('0x0'));var rimraf=require(_0x2da7('0x1'));var zipdir=require(_0x2da7('0x2'));var jsonpatch=require(_0x2da7('0x3'));var rp=require(_0x2da7('0x4'));var moment=require(_0x2da7('0x5'));var BPromise=require(_0x2da7('0x6'));var Mustache=require('mustache');var util=require(_0x2da7('0x7'));var path=require(_0x2da7('0x8'));var sox=require(_0x2da7('0x9'));var csv=require(_0x2da7('0xa'));var ejs=require(_0x2da7('0xb'));var fs=require('fs');var fs_extra=require(_0x2da7('0xc'));var _=require(_0x2da7('0xd'));var squel=require(_0x2da7('0xe'));var crypto=require(_0x2da7('0xf'));var jsforce=require(_0x2da7('0x10'));var deskjs=require(_0x2da7('0x11'));var toCsv=require(_0x2da7('0xa'));var querystring=require(_0x2da7('0x12'));var Papa=require('papaparse');var Redis=require(_0x2da7('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x2da7('0x14'));var as=require(_0x2da7('0x15'));var hardwareService=require(_0x2da7('0x16'));var logger=require(_0x2da7('0x17'))(_0x2da7('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2da7('0x19'));var db=require(_0x2da7('0x1a'))['db'];function respondWithStatusCode(_0x29a931,_0x5a8e4f){_0x5a8e4f=_0x5a8e4f||0xcc;return function(_0x4f47e4){if(_0x4f47e4){return _0x29a931['sendStatus'](_0x5a8e4f);}return _0x29a931[_0x2da7('0x1b')](_0x5a8e4f)[_0x2da7('0x1c')]();};}function respondWithResult(_0x5c4a50,_0x3ee2e7){_0x3ee2e7=_0x3ee2e7||0xc8;return function(_0x2b3621){if(_0x2b3621){return _0x5c4a50[_0x2da7('0x1b')](_0x3ee2e7)[_0x2da7('0x1d')](_0x2b3621);}};}function respondWithFilteredResult(_0x163e48,_0xf08f91){return function(_0x5dee8b){if(_0x5dee8b){var _0x10e94b=typeof _0xf08f91[_0x2da7('0x1e')]===_0x2da7('0x1f')&&typeof _0xf08f91[_0x2da7('0x20')]===_0x2da7('0x1f');var _0x4e207a=_0x5dee8b[_0x2da7('0x21')];var _0x344e82=_0x10e94b?0x0:_0xf08f91['offset'];var _0x1a9475=_0x10e94b?_0x5dee8b[_0x2da7('0x21')]:_0xf08f91[_0x2da7('0x1e')]+_0xf08f91[_0x2da7('0x20')];var _0x1a8518;if(_0x1a9475>=_0x4e207a){_0x1a9475=_0x4e207a;_0x1a8518=0xc8;}else{_0x1a8518=0xce;}_0x163e48['status'](_0x1a8518);return _0x163e48['set'](_0x2da7('0x22'),_0x344e82+'-'+_0x1a9475+'/'+_0x4e207a)[_0x2da7('0x1d')](_0x5dee8b);}return null;};}function patchUpdates(_0x59ac2f){return function(_0x579ccc){try{jsonpatch[_0x2da7('0x23')](_0x579ccc,_0x59ac2f,!![]);}catch(_0x335033){return BPromise[_0x2da7('0x24')](_0x335033);}return _0x579ccc[_0x2da7('0x25')]();};}function saveUpdates(_0x3517a2,_0x30d278){return function(_0x4ad08c){if(_0x4ad08c){return _0x4ad08c[_0x2da7('0x26')](_0x3517a2)[_0x2da7('0x27')](function(_0x571d13){return _0x571d13;});}return null;};}function removeEntity(_0x4b118d,_0x2b482f){return function(_0x2ffe19){if(_0x2ffe19){return _0x2ffe19[_0x2da7('0x28')]()[_0x2da7('0x27')](function(){_0x4b118d[_0x2da7('0x1b')](0xcc)[_0x2da7('0x1c')]();});}};}function handleEntityNotFound(_0xc5e95c,_0x3f2ddf){return function(_0x2f0743){if(!_0x2f0743){_0xc5e95c[_0x2da7('0x29')](0x194);}return _0x2f0743;};}function handleError(_0x318ed4,_0x82e62b){_0x82e62b=_0x82e62b||0x1f4;return function(_0x433f6e){logger['error'](_0x433f6e[_0x2da7('0x2a')]);if(_0x433f6e[_0x2da7('0x2b')]){delete _0x433f6e['name'];}_0x318ed4[_0x2da7('0x1b')](_0x82e62b)[_0x2da7('0x2c')](_0x433f6e);};}var utilLicense=require(_0x2da7('0x19'));exports['index']=function(_0x32a68c,_0x4a8d03){var _0x6a98bc={'raw':!![],'where':{'id':0x1}},_0x3c11d8={};_0x3c11d8[_0x2da7('0x2d')]=_['keys'](db['License'][_0x2da7('0x2e')]);_0x3c11d8['query']=_[_0x2da7('0x2f')](_0x32a68c[_0x2da7('0x30')]);_0x3c11d8[_0x2da7('0x31')]=_['intersection'](_0x3c11d8[_0x2da7('0x2d')],_0x3c11d8[_0x2da7('0x30')]);_0x6a98bc[_0x2da7('0x32')]=_[_0x2da7('0x33')](_0x3c11d8[_0x2da7('0x2d')],qs[_0x2da7('0x34')](_0x32a68c[_0x2da7('0x30')][_0x2da7('0x34')]));_0x6a98bc[_0x2da7('0x32')]=_0x6a98bc[_0x2da7('0x32')]['length']?_0x6a98bc[_0x2da7('0x32')]:_0x3c11d8[_0x2da7('0x2d')];_0x6a98bc=_[_0x2da7('0x35')]({},_0x6a98bc,_0x32a68c['options']);return utilLicense['getLicense'](_0x6a98bc)['then'](respondWithResult(_0x4a8d03,null))['catch'](handleError(_0x4a8d03,null));};exports[_0x2da7('0x26')]=function(_0x9522cf,_0xddfbad){if(_0x9522cf[_0x2da7('0x36')]['id']){delete _0x9522cf[_0x2da7('0x36')]['id'];}return db[_0x2da7('0x37')][_0x2da7('0x38')]({'where':{'id':_0x9522cf[_0x2da7('0x39')]['id']}})['then'](handleEntityNotFound(_0xddfbad,null))[_0x2da7('0x27')](function(_0x3e50f6){var _0xbe757e=_0x3e50f6[_0x2da7('0x3a')]({'plain':!![]});return utilLicense[_0x2da7('0x3b')](_0xbe757e,_0x9522cf[_0x2da7('0x36')][_0x2da7('0x3c')]);})[_0x2da7('0x27')](function(_0x47a002){if(!_0x47a002[_0x2da7('0x3d')]){return saveUpdates(_0x9522cf[_0x2da7('0x36')],null);}return _0x47a002;})['then'](respondWithResult(_0xddfbad,null))['catch'](handleError(_0xddfbad,null));};exports[_0x2da7('0x3e')]=function(_0x2d7c09,_0x4a1171){var _0x16ebe2='license-info.log';var _0x39fe48=path['join'](_0x2da7('0x3f'),'log',_0x2da7('0x40'),_0x16ebe2);_0x4a1171[_0x2da7('0x41')]('Content-disposition',_0x2da7('0x42')+_0x16ebe2);_0x4a1171['set'](_0x2da7('0x43'),_0x2da7('0x44'));_0x4a1171[_0x2da7('0x45')](_0x39fe48);}; \ No newline at end of file +var _0x73a2=['stack','name','../../config/license/util','index','model','rawAttributes','query','keys','intersection','attributes','fields','length','merge','options','getLicense','body','License','find','params','checkLicense','catch','downloadLogFile','/var','log','xcally','setHeader','Content-disposition','attachment;\x20filename=','text/plain','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','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','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','save','update','then','error'];(function(_0x3ee76e,_0x3c76da){var _0x389187=function(_0x2bd529){while(--_0x2bd529){_0x3ee76e['push'](_0x3ee76e['shift']());}};_0x389187(++_0x3c76da);}(_0x73a2,0x1f3));var _0x273a=function(_0x2001bd,_0x49a0c9){_0x2001bd=_0x2001bd-0x0;var _0x414933=_0x73a2[_0x2001bd];return _0x414933;};'use strict';var emlformat=require(_0x273a('0x0'));var rimraf=require(_0x273a('0x1'));var zipdir=require(_0x273a('0x2'));var jsonpatch=require(_0x273a('0x3'));var rp=require(_0x273a('0x4'));var moment=require(_0x273a('0x5'));var BPromise=require(_0x273a('0x6'));var Mustache=require('mustache');var util=require(_0x273a('0x7'));var path=require(_0x273a('0x8'));var sox=require(_0x273a('0x9'));var csv=require(_0x273a('0xa'));var ejs=require(_0x273a('0xb'));var fs=require('fs');var fs_extra=require(_0x273a('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x273a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x273a('0xe'));var toCsv=require(_0x273a('0xa'));var querystring=require(_0x273a('0xf'));var Papa=require(_0x273a('0x10'));var Redis=require(_0x273a('0x11'));var authService=require(_0x273a('0x12'));var qs=require(_0x273a('0x13'));var as=require(_0x273a('0x14'));var hardwareService=require(_0x273a('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x273a('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x273a('0x17'))['db'];function respondWithStatusCode(_0xeb7a3a,_0x2df9ba){_0x2df9ba=_0x2df9ba||0xcc;return function(_0x42fe2a){if(_0x42fe2a){return _0xeb7a3a[_0x273a('0x18')](_0x2df9ba);}return _0xeb7a3a['status'](_0x2df9ba)[_0x273a('0x19')]();};}function respondWithResult(_0x1209d5,_0x2f81f2){_0x2f81f2=_0x2f81f2||0xc8;return function(_0x267208){if(_0x267208){return _0x1209d5[_0x273a('0x1a')](_0x2f81f2)[_0x273a('0x1b')](_0x267208);}};}function respondWithFilteredResult(_0x27940d,_0x51a4a8){return function(_0x298c36){if(_0x298c36){var _0x34ca16=typeof _0x51a4a8[_0x273a('0x1c')]===_0x273a('0x1d')&&typeof _0x51a4a8[_0x273a('0x1e')]==='undefined';var _0x186b61=_0x298c36[_0x273a('0x1f')];var _0x4584b8=_0x34ca16?0x0:_0x51a4a8[_0x273a('0x1c')];var _0x2382d0=_0x34ca16?_0x298c36['count']:_0x51a4a8['offset']+_0x51a4a8[_0x273a('0x1e')];var _0x2b0979;if(_0x2382d0>=_0x186b61){_0x2382d0=_0x186b61;_0x2b0979=0xc8;}else{_0x2b0979=0xce;}_0x27940d[_0x273a('0x1a')](_0x2b0979);return _0x27940d[_0x273a('0x20')]('Content-Range',_0x4584b8+'-'+_0x2382d0+'/'+_0x186b61)[_0x273a('0x1b')](_0x298c36);}return null;};}function patchUpdates(_0x53a2be){return function(_0x304a64){try{jsonpatch['apply'](_0x304a64,_0x53a2be,!![]);}catch(_0x22c7d4){return BPromise['reject'](_0x22c7d4);}return _0x304a64[_0x273a('0x21')]();};}function saveUpdates(_0x44e298,_0x4c5e00){return function(_0x45d06f){if(_0x45d06f){return _0x45d06f[_0x273a('0x22')](_0x44e298)['then'](function(_0x4f21b8){return _0x4f21b8;});}return null;};}function removeEntity(_0x222628,_0x3217e9){return function(_0x3ed61f){if(_0x3ed61f){return _0x3ed61f['destroy']()[_0x273a('0x23')](function(){_0x222628[_0x273a('0x1a')](0xcc)[_0x273a('0x19')]();});}};}function handleEntityNotFound(_0x30b039,_0x4e0521){return function(_0x59787f){if(!_0x59787f){_0x30b039['sendStatus'](0x194);}return _0x59787f;};}function handleError(_0x4fb706,_0x50249a){_0x50249a=_0x50249a||0x1f4;return function(_0x2ce6c2){logger[_0x273a('0x24')](_0x2ce6c2[_0x273a('0x25')]);if(_0x2ce6c2[_0x273a('0x26')]){delete _0x2ce6c2['name'];}_0x4fb706[_0x273a('0x1a')](_0x50249a)['send'](_0x2ce6c2);};}var utilLicense=require(_0x273a('0x27'));exports[_0x273a('0x28')]=function(_0x37911f,_0x22acd3){var _0x5113cb={'raw':!![],'where':{'id':0x1}},_0x10defa={};_0x10defa[_0x273a('0x29')]=_['keys'](db['License'][_0x273a('0x2a')]);_0x10defa[_0x273a('0x2b')]=_[_0x273a('0x2c')](_0x37911f[_0x273a('0x2b')]);_0x10defa['filters']=_[_0x273a('0x2d')](_0x10defa['model'],_0x10defa[_0x273a('0x2b')]);_0x5113cb[_0x273a('0x2e')]=_['intersection'](_0x10defa['model'],qs[_0x273a('0x2f')](_0x37911f[_0x273a('0x2b')][_0x273a('0x2f')]));_0x5113cb[_0x273a('0x2e')]=_0x5113cb[_0x273a('0x2e')][_0x273a('0x30')]?_0x5113cb[_0x273a('0x2e')]:_0x10defa[_0x273a('0x29')];_0x5113cb=_[_0x273a('0x31')]({},_0x5113cb,_0x37911f[_0x273a('0x32')]);return utilLicense[_0x273a('0x33')](_0x5113cb)[_0x273a('0x23')](respondWithResult(_0x22acd3,null))['catch'](handleError(_0x22acd3,null));};exports['update']=function(_0x58d90b,_0x70ce03){if(_0x58d90b[_0x273a('0x34')]['id']){delete _0x58d90b['body']['id'];}return db[_0x273a('0x35')][_0x273a('0x36')]({'where':{'id':_0x58d90b[_0x273a('0x37')]['id']}})[_0x273a('0x23')](handleEntityNotFound(_0x70ce03,null))[_0x273a('0x23')](function(_0x1a5c31){var _0x29440f=_0x1a5c31['get']({'plain':!![]});return utilLicense[_0x273a('0x38')](_0x29440f,_0x58d90b[_0x273a('0x34')]['key']);})[_0x273a('0x23')](function(_0x1fce50){if(!_0x1fce50['demo']){return saveUpdates(_0x58d90b[_0x273a('0x34')],null);}return _0x1fce50;})[_0x273a('0x23')](respondWithResult(_0x70ce03,null))[_0x273a('0x39')](handleError(_0x70ce03,null));};exports[_0x273a('0x3a')]=function(_0x29c390,_0x5a0cf5){var _0x5e56ea='license-info.log';var _0x2fea6f=path['join'](_0x273a('0x3b'),_0x273a('0x3c'),_0x273a('0x3d'),_0x5e56ea);_0x5a0cf5[_0x273a('0x3e')](_0x273a('0x3f'),_0x273a('0x40')+_0x5e56ea);_0x5a0cf5[_0x273a('0x20')]('Content-Type',_0x273a('0x41'));_0x5a0cf5[_0x273a('0x42')](_0x2fea6f);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index dcf8b6d..2b9debf 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 _0xcbff=['rimraf','./license.attributes','exports','define','License','license','../../config/logger','bluebird','path'];(function(_0x528d9c,_0x588d05){var _0x30cb89=function(_0x161cb2){while(--_0x161cb2){_0x528d9c['push'](_0x528d9c['shift']());}};_0x30cb89(++_0x588d05);}(_0xcbff,0xde));var _0xfcbf=function(_0x4423da,_0x13bdc1){_0x4423da=_0x4423da-0x0;var _0xe5a20b=_0xcbff[_0x4423da];return _0xe5a20b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfcbf('0x0'))('api');var moment=require('moment');var BPromise=require(_0xfcbf('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfcbf('0x2'));var rimraf=require(_0xfcbf('0x3'));var config=require('../../config/environment');var attributes=require(_0xfcbf('0x4'));module[_0xfcbf('0x5')]=function(_0x5f3650,_0x18a03a){return _0x5f3650[_0xfcbf('0x6')](_0xfcbf('0x7'),attributes,{'tableName':_0xfcbf('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1350=['rimraf','../../config/environment','./license.attributes','define','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x1283b9,_0x3645b8){var _0x4dbe77=function(_0x4654ff){while(--_0x4654ff){_0x1283b9['push'](_0x1283b9['shift']());}};_0x4dbe77(++_0x3645b8);}(_0x1350,0x1dd));var _0x0135=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1350[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0135('0x0'));var util=require(_0x0135('0x1'));var logger=require('../../config/logger')(_0x0135('0x2'));var moment=require(_0x0135('0x3'));var BPromise=require(_0x0135('0x4'));var rp=require(_0x0135('0x5'));var fs=require('fs');var path=require(_0x0135('0x6'));var rimraf=require(_0x0135('0x7'));var config=require(_0x0135('0x8'));var attributes=require(_0x0135('0x9'));module['exports']=function(_0x274723,_0x5644a8){return _0x274723[_0x0135('0xa')]('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 ceb16f5..cef56bc 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 _0x9b0c=['http','request','info','request\x20sent','debug','stringify','code','error','License,\x20%s,\x20%s','message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x299e88,_0x400179){var _0x193a95=function(_0x31942d){while(--_0x31942d){_0x299e88['push'](_0x299e88['shift']());}};_0x193a95(++_0x400179);}(_0x9b0c,0x10f));var _0xc9b0=function(_0x199246,_0x2da87c){_0x199246=_0x199246-0x0;var _0x316031=_0x9b0c[_0x199246];return _0x316031;};'use strict';var _=require('lodash');var util=require(_0xc9b0('0x0'));var moment=require('moment');var BPromise=require(_0xc9b0('0x1'));var rs=require(_0xc9b0('0x2'));var fs=require('fs');var Redis=require(_0xc9b0('0x3'));var db=require(_0xc9b0('0x4'))['db'];var utils=require(_0xc9b0('0x5'));var logger=require(_0xc9b0('0x6'))('rpc');var config=require(_0xc9b0('0x7'));var jayson=require(_0xc9b0('0x8'));var client=jayson['client'][_0xc9b0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50e276,_0x5b0c3d,_0x517f51){return new BPromise(function(_0x5170df,_0x174e0b){return client[_0xc9b0('0xa')](_0x50e276,_0x517f51)['then'](function(_0x29599e){logger[_0xc9b0('0xb')]('License,\x20%s,\x20%s',_0x5b0c3d,_0xc9b0('0xc'));logger[_0xc9b0('0xd')]('License,\x20%s,\x20%s,\x20%s',_0x5b0c3d,_0xc9b0('0xc'),JSON[_0xc9b0('0xe')](_0x29599e));if(_0x29599e['error']){if(_0x29599e['error'][_0xc9b0('0xf')]===0x1f4){logger[_0xc9b0('0x10')](_0xc9b0('0x11'),_0x5b0c3d,_0x29599e[_0xc9b0('0x10')][_0xc9b0('0x12')]);return _0x174e0b(_0x29599e[_0xc9b0('0x10')][_0xc9b0('0x12')]);}logger['error'](_0xc9b0('0x11'),_0x5b0c3d,_0x29599e[_0xc9b0('0x10')][_0xc9b0('0x12')]);return _0x5170df(_0x29599e[_0xc9b0('0x10')][_0xc9b0('0x12')]);}else{logger['info'](_0xc9b0('0x11'),_0x5b0c3d,_0xc9b0('0xc'));_0x5170df(_0x29599e[_0xc9b0('0x13')][_0xc9b0('0x12')]);}})['catch'](function(_0x299bfe){logger['error'](_0xc9b0('0x11'),_0x5b0c3d,_0x299bfe);_0x174e0b(_0x299bfe);});});} \ No newline at end of file +var _0x6ed4=['request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','License,\x20%s,\x20%s','message','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','info'];(function(_0x3598c0,_0x54cafb){var _0x39e9d8=function(_0x1a6661){while(--_0x1a6661){_0x3598c0['push'](_0x3598c0['shift']());}};_0x39e9d8(++_0x54cafb);}(_0x6ed4,0xe0));var _0x46ed=function(_0x2c14ee,_0x4b8d3a){_0x2c14ee=_0x2c14ee-0x0;var _0x5cae97=_0x6ed4[_0x2c14ee];return _0x5cae97;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x46ed('0x0'));var rs=require(_0x46ed('0x1'));var fs=require('fs');var Redis=require(_0x46ed('0x2'));var db=require(_0x46ed('0x3'))['db'];var utils=require(_0x46ed('0x4'));var logger=require(_0x46ed('0x5'))(_0x46ed('0x6'));var config=require('../../config/environment');var jayson=require(_0x46ed('0x7'));var client=jayson['client'][_0x46ed('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x52e353,_0x36a1cd,_0x161c87){return new BPromise(function(_0x42cd47,_0x16ed9c){return client['request'](_0x52e353,_0x161c87)['then'](function(_0x299ddd){logger[_0x46ed('0x9')]('License,\x20%s,\x20%s',_0x36a1cd,_0x46ed('0xa'));logger[_0x46ed('0xb')](_0x46ed('0xc'),_0x36a1cd,_0x46ed('0xa'),JSON[_0x46ed('0xd')](_0x299ddd));if(_0x299ddd[_0x46ed('0xe')]){if(_0x299ddd[_0x46ed('0xe')]['code']===0x1f4){logger[_0x46ed('0xe')](_0x46ed('0xf'),_0x36a1cd,_0x299ddd[_0x46ed('0xe')][_0x46ed('0x10')]);return _0x16ed9c(_0x299ddd[_0x46ed('0xe')][_0x46ed('0x10')]);}logger[_0x46ed('0xe')](_0x46ed('0xf'),_0x36a1cd,_0x299ddd[_0x46ed('0xe')][_0x46ed('0x10')]);return _0x42cd47(_0x299ddd[_0x46ed('0xe')][_0x46ed('0x10')]);}else{logger[_0x46ed('0x9')](_0x46ed('0xf'),_0x36a1cd,_0x46ed('0xa'));_0x42cd47(_0x299ddd['result'][_0x46ed('0x10')]);}})[_0x46ed('0x11')](function(_0x45e44e){logger['error'](_0x46ed('0xf'),_0x36a1cd,_0x45e44e);_0x16ed9c(_0x45e44e);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 3116251..f5f70d9 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 _0xaef0=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./mailAccount.controller','get','index','/describe','describe','isAuthenticated','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','/:id/out_servers','getSmtp','/:id/interactions','/:id/applications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addDisposition','create','addImap','addSmtp','addInteraction','addApplications','/:id/send','addAgents','put','/:id','update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','removeAgents'];(function(_0x564b4f,_0x2c3a3c){var _0x3c5ec8=function(_0x200eb5){while(--_0x200eb5){_0x564b4f['push'](_0x564b4f['shift']());}};_0x3c5ec8(++_0x2c3a3c);}(_0xaef0,0xc5));var _0x0aef=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xaef0[_0x13e741];return _0x3f8bb3;};'use strict';var multer=require(_0x0aef('0x0'));var util=require(_0x0aef('0x1'));var path=require(_0x0aef('0x2'));var timeout=require(_0x0aef('0x3'));var express=require('express');var router=express[_0x0aef('0x4')]();var fs_extra=require(_0x0aef('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0aef('0x6'));var controller=require(_0x0aef('0x7'));router[_0x0aef('0x8')]('/',auth['isAuthenticated'](),controller[_0x0aef('0x9')]);router['get'](_0x0aef('0xa'),auth['isAuthenticated'](),controller[_0x0aef('0xb')]);router[_0x0aef('0x8')]('/:id',auth[_0x0aef('0xc')](),controller[_0x0aef('0xd')]);router[_0x0aef('0x8')](_0x0aef('0xe'),auth['isAuthenticated'](),controller[_0x0aef('0xf')]);router[_0x0aef('0x8')](_0x0aef('0x10'),auth['isAuthenticated'](),controller[_0x0aef('0x11')]);router[_0x0aef('0x8')](_0x0aef('0x12'),auth['isAuthenticated'](),controller['getImap']);router[_0x0aef('0x8')](_0x0aef('0x13'),auth[_0x0aef('0xc')](),controller[_0x0aef('0x14')]);router[_0x0aef('0x8')](_0x0aef('0x15'),auth[_0x0aef('0xc')](),controller['getInteractions']);router[_0x0aef('0x8')](_0x0aef('0x16'),auth[_0x0aef('0xc')](),controller['getApplications']);router['get'](_0x0aef('0x17'),auth[_0x0aef('0xc')](),controller[_0x0aef('0x18')]);router['get'](_0x0aef('0x19'),auth[_0x0aef('0xc')](),controller[_0x0aef('0x1a')]);router[_0x0aef('0x8')](_0x0aef('0x1b'),auth['isAuthenticated'](),controller[_0x0aef('0x1c')]);router[_0x0aef('0x1d')]('/:id/dispositions',auth[_0x0aef('0xc')](),controller[_0x0aef('0x1e')]);router[_0x0aef('0x1d')]('/:id/canned_answers',auth[_0x0aef('0xc')](),controller['addAnswer']);router[_0x0aef('0x1d')]('/',auth['isAuthenticated'](),controller[_0x0aef('0x1f')]);router[_0x0aef('0x1d')](_0x0aef('0x12'),auth[_0x0aef('0xc')](),controller[_0x0aef('0x20')]);router['post'](_0x0aef('0x13'),auth[_0x0aef('0xc')](),controller[_0x0aef('0x21')]);router[_0x0aef('0x1d')](_0x0aef('0x15'),auth[_0x0aef('0xc')](),controller[_0x0aef('0x22')]);router['post'](_0x0aef('0x16'),auth[_0x0aef('0xc')](),controller[_0x0aef('0x23')]);router[_0x0aef('0x1d')](_0x0aef('0x24'),auth[_0x0aef('0xc')](),controller['send']);router[_0x0aef('0x1d')]('/:id/users',auth[_0x0aef('0xc')](),controller[_0x0aef('0x25')]);router[_0x0aef('0x26')](_0x0aef('0x27'),auth[_0x0aef('0xc')](),controller[_0x0aef('0x28')]);router[_0x0aef('0x29')]('/:id/dispositions',auth[_0x0aef('0xc')](),controller[_0x0aef('0x2a')]);router[_0x0aef('0x29')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x0aef('0x2b')]);router[_0x0aef('0x29')]('/:id/in_servers',auth[_0x0aef('0xc')](),controller[_0x0aef('0x2c')]);router[_0x0aef('0x29')](_0x0aef('0x13'),auth['isAuthenticated'](),controller[_0x0aef('0x2d')]);router[_0x0aef('0x29')](_0x0aef('0x27'),auth[_0x0aef('0xc')](),controller[_0x0aef('0x2e')]);router[_0x0aef('0x29')](_0x0aef('0x1b'),auth[_0x0aef('0xc')](),controller[_0x0aef('0x2f')]);module[_0x0aef('0x30')]=router; \ No newline at end of file +var _0x5cfb=['/:id/users','getAgents','post','addAnswer','create','/:id/in_servers','addImap','addSmtp','addInteraction','send','put','/:id','update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','multer','path','express','Router','../../components/auth/service','../../config/environment','./mailAccount.controller','get','index','/describe','isAuthenticated','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','verifySmtp'];(function(_0x5365ad,_0x41ec9b){var _0x365519=function(_0x5f0cd2){while(--_0x5f0cd2){_0x5365ad['push'](_0x5365ad['shift']());}};_0x365519(++_0x41ec9b);}(_0x5cfb,0xa5));var _0xb5cf=function(_0x56dcc3,_0x35d2d6){_0x56dcc3=_0x56dcc3-0x0;var _0x1e4e61=_0x5cfb[_0x56dcc3];return _0x1e4e61;};'use strict';var multer=require(_0xb5cf('0x0'));var util=require('util');var path=require(_0xb5cf('0x1'));var timeout=require('connect-timeout');var express=require(_0xb5cf('0x2'));var router=express[_0xb5cf('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb5cf('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb5cf('0x5'));var controller=require(_0xb5cf('0x6'));router[_0xb5cf('0x7')]('/',auth['isAuthenticated'](),controller[_0xb5cf('0x8')]);router[_0xb5cf('0x7')](_0xb5cf('0x9'),auth[_0xb5cf('0xa')](),controller[_0xb5cf('0xb')]);router['get']('/:id',auth[_0xb5cf('0xa')](),controller[_0xb5cf('0xc')]);router[_0xb5cf('0x7')](_0xb5cf('0xd'),auth[_0xb5cf('0xa')](),controller[_0xb5cf('0xe')]);router[_0xb5cf('0x7')](_0xb5cf('0xf'),auth[_0xb5cf('0xa')](),controller[_0xb5cf('0x10')]);router[_0xb5cf('0x7')]('/:id/in_servers',auth['isAuthenticated'](),controller[_0xb5cf('0x11')]);router[_0xb5cf('0x7')](_0xb5cf('0x12'),auth['isAuthenticated'](),controller[_0xb5cf('0x13')]);router[_0xb5cf('0x7')](_0xb5cf('0x14'),auth['isAuthenticated'](),controller[_0xb5cf('0x15')]);router[_0xb5cf('0x7')](_0xb5cf('0x16'),auth[_0xb5cf('0xa')](),controller[_0xb5cf('0x17')]);router[_0xb5cf('0x7')](_0xb5cf('0x18'),auth[_0xb5cf('0xa')](),controller[_0xb5cf('0x19')]);router[_0xb5cf('0x7')]('/:id/verify',auth[_0xb5cf('0xa')](),controller[_0xb5cf('0x1a')]);router[_0xb5cf('0x7')](_0xb5cf('0x1b'),auth[_0xb5cf('0xa')](),controller[_0xb5cf('0x1c')]);router['post'](_0xb5cf('0xd'),auth[_0xb5cf('0xa')](),controller['addDisposition']);router[_0xb5cf('0x1d')](_0xb5cf('0xf'),auth['isAuthenticated'](),controller[_0xb5cf('0x1e')]);router[_0xb5cf('0x1d')]('/',auth['isAuthenticated'](),controller[_0xb5cf('0x1f')]);router['post'](_0xb5cf('0x20'),auth[_0xb5cf('0xa')](),controller[_0xb5cf('0x21')]);router['post'](_0xb5cf('0x12'),auth[_0xb5cf('0xa')](),controller[_0xb5cf('0x22')]);router['post']('/:id/interactions',auth[_0xb5cf('0xa')](),controller[_0xb5cf('0x23')]);router[_0xb5cf('0x1d')](_0xb5cf('0x16'),auth['isAuthenticated'](),controller['addApplications']);router[_0xb5cf('0x1d')]('/:id/send',auth[_0xb5cf('0xa')](),controller[_0xb5cf('0x24')]);router['post'](_0xb5cf('0x1b'),auth[_0xb5cf('0xa')](),controller['addAgents']);router[_0xb5cf('0x25')](_0xb5cf('0x26'),auth[_0xb5cf('0xa')](),controller[_0xb5cf('0x27')]);router[_0xb5cf('0x28')](_0xb5cf('0xd'),auth['isAuthenticated'](),controller[_0xb5cf('0x29')]);router[_0xb5cf('0x28')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xb5cf('0x2a')]);router[_0xb5cf('0x28')](_0xb5cf('0x20'),auth['isAuthenticated'](),controller[_0xb5cf('0x2b')]);router[_0xb5cf('0x28')](_0xb5cf('0x12'),auth[_0xb5cf('0xa')](),controller[_0xb5cf('0x2c')]);router[_0xb5cf('0x28')]('/:id',auth[_0xb5cf('0xa')](),controller[_0xb5cf('0x2d')]);router[_0xb5cf('0x28')](_0xb5cf('0x1b'),auth[_0xb5cf('0xa')](),controller[_0xb5cf('0x2e')]);module[_0xb5cf('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 e2a8d54..e604e89 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 _0x560a=['ENUM','hotmail','getDataValue','provider','custom','sequelize','exports','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'];(function(_0x43b06b,_0x1929c7){var _0x2c555b=function(_0x30fa8c){while(--_0x30fa8c){_0x43b06b['push'](_0x43b06b['shift']());}};_0x2c555b(++_0x1929c7);}(_0x560a,0x16d));var _0xa560=function(_0x134557,_0x19ea33){_0x134557=_0x134557-0x0;var _0x1ab4eb=_0x560a[_0x134557];return _0x1ab4eb;};'use strict';var Sequelize=require(_0xa560('0x0'));module[_0xa560('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xa560('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xa560('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xa560('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xa560('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0xa560('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0xa560('0x4')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xa560('0x2')],'allowNull':![],'defaultValue':_0xa560('0x5')},'fontSize':{'type':Sequelize[_0xa560('0x6')](0x2)[_0xa560('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xa560('0x8');}},'notificationSound':{'type':Sequelize[_0xa560('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa560('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa560('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa560('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa560('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa560('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xa560('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xa560('0x3')],'defaultValue':![],'comment':_0xa560('0xa'),'set':function(_0x14797d){if(!_0x14797d)this[_0xa560('0xb')]('mandatoryDispositionPauseId',null);this[_0xa560('0xb')](_0xa560('0xc'),_0x14797d);}},'provider':{'type':Sequelize[_0xa560('0xd')]('gmail',_0xa560('0xe'),'yahoo','outlook365'),'defaultValue':null,'get':function(){if(!this[_0xa560('0xf')](_0xa560('0x10')))return _0xa560('0x11');return this[_0xa560('0xf')](_0xa560('0x10'));},'set':function(_0x30e489){if(_0x30e489==='custom')_0x30e489=null;return this['setDataValue'](_0xa560('0x10'),_0x30e489);}}}; \ No newline at end of file +var _0x276b=['TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','ENUM','gmail','hotmail','yahoo','getDataValue','provider','custom','exports','STRING','BOOLEAN','Arial,Helvetica,sans-serif','UNSIGNED'];(function(_0x2df0d2,_0x46410b){var _0x3584ef=function(_0x50e2e3){while(--_0x50e2e3){_0x2df0d2['push'](_0x2df0d2['shift']());}};_0x3584ef(++_0x46410b);}(_0x276b,0x1e9));var _0xb276=function(_0x33eb71,_0x20bb92){_0x33eb71=_0x33eb71-0x0;var _0x16c2a9=_0x276b[_0x33eb71];return _0x16c2a9;};'use strict';var Sequelize=require('sequelize');module[_0xb276('0x0')]={'description':{'type':Sequelize[_0xb276('0x1')]},'name':{'type':Sequelize[_0xb276('0x1')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xb276('0x2')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0xb276('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb276('0x3')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0xb276('0x4')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xb276('0x5')],'defaultValue':function(){return _0xb276('0x6');}},'notificationSound':{'type':Sequelize[_0xb276('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb276('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb276('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb276('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xb276('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xb276('0x2')],'defaultValue':![],'comment':_0xb276('0x9'),'set':function(_0x50ae8a){if(!_0x50ae8a)this[_0xb276('0xa')](_0xb276('0xb'),null);this['setDataValue']('mandatoryDisposition',_0x50ae8a);}},'provider':{'type':Sequelize[_0xb276('0xc')](_0xb276('0xd'),_0xb276('0xe'),_0xb276('0xf'),'outlook365'),'defaultValue':null,'get':function(){if(!this[_0xb276('0x10')](_0xb276('0x11')))return _0xb276('0x12');return this[_0xb276('0x10')](_0xb276('0x11'));},'set':function(_0x3f3616){if(_0x3f3616===_0xb276('0x12'))_0x3f3616=null;return this[_0xb276('0xa')](_0xb276('0x11'),_0x3f3616);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 8fc4fb9..aab067d 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 _0x0915=['yahoo','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','secure','service','authentication','Imap','port','Smtp','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','fieldName','type','key','keys','query','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','includeAll','rows','params','length','find','update','body','custom','Mail\x20Account\x20not\x20found','describe','addDisposition','Disposition','getDispositions','findOne','rawAttributes','pick','MailAccountId','options','findAll','removeDispositions','ids','addAnswer','CannedAnswer','create','getAnswers','removeAnswers','provider','email','ListId','active','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','removeSmtp','setSmtp','MailInteraction','addInteraction','getInteractions','include','CmContact','Contact','User','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','priority','stack','finally','getApplications','getMessages','MailMessage','$gte','split','format','inlineCss','true','CmList','Contacts','DESC','CloudProvider','isNil','from','%s\x20<%s>','attachments','join','root','server/files/attachments','getSmtpOptions','SendMail','List','messageId','subject','attach','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','Messages','VerifySmtp','verifySmtp','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','omit','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','moment','bluebird','path','lodash','juice','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','undefined','limit','count','offset','set','Content-Range','then','destroy','get','MailAccounts','UserProfileResource','name','send','gmail','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com'];(function(_0x28e28c,_0x45d7b9){var _0x42c11c=function(_0x5e96af){while(--_0x5e96af){_0x28e28c['push'](_0x28e28c['shift']());}};_0x42c11c(++_0x45d7b9);}(_0x0915,0x159));var _0x5091=function(_0x5ef161,_0x27d16c){_0x5ef161=_0x5ef161-0x0;var _0x1c6e9e=_0x0915[_0x5ef161];return _0x1c6e9e;};'use strict';var moment=require(_0x5091('0x0'));var BPromise=require(_0x5091('0x1'));var util=require('util');var path=require(_0x5091('0x2'));var _=require(_0x5091('0x3'));var juice=require(_0x5091('0x4'));var Redis=require('ioredis');var qs=require(_0x5091('0x5'));var logger=require(_0x5091('0x6'))(_0x5091('0x7'));var config=require(_0x5091('0x8'));var db=require(_0x5091('0x9'))['db'];config[_0x5091('0xa')]=_[_0x5091('0xb')](config[_0x5091('0xa')],{'host':_0x5091('0xc'),'port':0x18eb});var socket=require(_0x5091('0xd'))(new Redis(config[_0x5091('0xa')]));require(_0x5091('0xe'))[_0x5091('0xf')](socket);var jayson=require(_0x5091('0x10'));var client=jayson[_0x5091('0x11')][_0x5091('0x12')]({'port':0x232b});function respondWithRpcPromise(_0x4059f0,_0x40d562,_0x5296ad,_0x10ac19){return new BPromise(function(_0x194696,_0x5660c8){var _0x508e61=_0x10ac19||client;return _0x508e61[_0x5091('0x13')](_0x4059f0,_0x5296ad)['then'](function(_0x4d7df1){logger[_0x5091('0x14')](_0x5091('0x15'),_0x40d562,_0x5091('0x16'));logger[_0x5091('0x17')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x40d562,_0x5091('0x16'),JSON[_0x5091('0x18')](_0x4d7df1));if(_0x4d7df1['error']){if(_0x4d7df1[_0x5091('0x19')][_0x5091('0x1a')]===0x1f4){logger[_0x5091('0x19')]('MailAccount,\x20%s,\x20%s',_0x40d562,_0x4d7df1[_0x5091('0x19')][_0x5091('0x1b')]);return _0x5660c8(_0x4d7df1[_0x5091('0x19')][_0x5091('0x1b')]);}logger[_0x5091('0x19')](_0x5091('0x15'),_0x40d562,_0x4d7df1[_0x5091('0x19')][_0x5091('0x1b')]);return _0x194696(_0x4d7df1[_0x5091('0x19')][_0x5091('0x1b')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x40d562,_0x5091('0x16'));_0x194696(_0x4d7df1[_0x5091('0x1c')][_0x5091('0x1b')]);}})[_0x5091('0x1d')](function(_0x324782){logger[_0x5091('0x19')](_0x5091('0x15'),_0x40d562,_0x324782);_0x5660c8(_0x324782);});});}function respondWithStatusCode(_0x4b463a,_0x3d26e4){_0x3d26e4=_0x3d26e4||0xcc;return function(_0x418623){if(_0x418623){return _0x4b463a[_0x5091('0x1e')](_0x3d26e4);}return _0x4b463a[_0x5091('0x1f')](_0x3d26e4)['end']();};}function respondWithResult(_0x8eb5b7,_0x27351f){_0x27351f=_0x27351f||0xc8;return function(_0x467c80){if(_0x467c80){return _0x8eb5b7['status'](_0x27351f)['json'](_0x467c80);}};}function respondWithFilteredResult(_0x120e50,_0x3c02c8){return function(_0x298de7){if(_0x298de7){var _0x267c5f=typeof _0x3c02c8['offset']===_0x5091('0x20')&&typeof _0x3c02c8[_0x5091('0x21')]==='undefined';var _0x5457ec=_0x298de7[_0x5091('0x22')];var _0x54169f=_0x267c5f?0x0:_0x3c02c8[_0x5091('0x23')];var _0x397a44=_0x267c5f?_0x298de7[_0x5091('0x22')]:_0x3c02c8['offset']+_0x3c02c8[_0x5091('0x21')];var _0xbea936;if(_0x397a44>=_0x5457ec){_0x397a44=_0x5457ec;_0xbea936=0xc8;}else{_0xbea936=0xce;}_0x120e50['status'](_0xbea936);return _0x120e50[_0x5091('0x24')](_0x5091('0x25'),_0x54169f+'-'+_0x397a44+'/'+_0x5457ec)['json'](_0x298de7);}return null;};}function saveUpdates(_0x3c3015){return function(_0x5317ae){if(_0x5317ae){return _0x5317ae['update'](_0x3c3015)[_0x5091('0x26')](function(_0x2bd448){return _0x2bd448;});}return null;};}function removeEntity(_0x5f29d3){return function(_0x46588e){if(_0x46588e){return _0x46588e[_0x5091('0x27')]()[_0x5091('0x26')](function(){var _0x2b3b0d=_0x46588e[_0x5091('0x28')]({'plain':!![]});var _0x46bd91=_0x5091('0x29');return db[_0x5091('0x2a')][_0x5091('0x27')]({'where':{'type':_0x46bd91,'resourceId':_0x2b3b0d['id']}})[_0x5091('0x26')](function(){return _0x46588e;});})[_0x5091('0x26')](function(){_0x5f29d3[_0x5091('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x203063){return function(_0x3615da){if(!_0x3615da){_0x203063['sendStatus'](0x194);}return _0x3615da;};}function handleError(_0x4efa8f,_0x250197){_0x250197=_0x250197||0x1f4;return function(_0x141d31){logger[_0x5091('0x19')](_0x141d31['stack']);if(_0x141d31[_0x5091('0x2b')]){delete _0x141d31['name'];}_0x4efa8f[_0x5091('0x1f')](_0x250197)[_0x5091('0x2c')](_0x141d31);};}function getImapHost(_0x3edc52){switch(_0x3edc52){case _0x5091('0x2d'):return'imap.gmail.com';case'yahoo':return _0x5091('0x2e');case _0x5091('0x2f'):return _0x5091('0x30');case _0x5091('0x31'):return _0x5091('0x32');}throw new Error(_0x5091('0x33'),_0x3edc52);}function getSmtpHost(_0x2801e0){switch(_0x2801e0){case _0x5091('0x2d'):return _0x5091('0x34');case _0x5091('0x35'):return _0x5091('0x36');case _0x5091('0x2f'):return _0x5091('0x37');case _0x5091('0x31'):return _0x5091('0x38');}throw new Error(_0x5091('0x33'),_0x2801e0);}function getAuthenticationOptions(_0x4cd12f,_0x231d45){var _0x24bea3={};var _0x20ae48={};if(_0x4cd12f){_0x24bea3[_0x5091('0x39')]=_0x20ae48[_0x5091('0x39')]=_0x231d45[_0x5091('0x3a')];_0x24bea3[_0x5091('0x3b')]=_0x20ae48[_0x5091('0x3c')]=_0x231d45[_0x5091('0x3b')];if(_0x231d45[_0x5091('0x3d')]){_0x24bea3[_0x5091('0x3d')]=_0x20ae48[_0x5091('0x3d')]=!![];_0x24bea3[_0x5091('0x3e')]=_0x20ae48['CloudProviderId']=_0x231d45[_0x5091('0x3e')];_0x24bea3[_0x5091('0x3b')]=_0x20ae48[_0x5091('0x3c')]=null;}else{_0x24bea3[_0x5091('0x3e')]=_0x20ae48[_0x5091('0x3e')]=null;}_0x24bea3[_0x5091('0x3f')]=getImapHost(_0x4cd12f);_0x24bea3['port']=0x3e1;_0x20ae48['host']=getSmtpHost(_0x4cd12f);_0x20ae48['port']=0x24b;_0x20ae48[_0x5091('0x40')]=![];_0x24bea3['service']=_0x20ae48[_0x5091('0x41')]=null;}else{if(_0x231d45[_0x5091('0x42')]){_0x24bea3['user']=_0x20ae48[_0x5091('0x39')]=_0x231d45[_0x5091('0x3a')];_0x24bea3[_0x5091('0x3b')]=_0x20ae48[_0x5091('0x3c')]=_0x231d45[_0x5091('0x3b')];}else{_0x24bea3[_0x5091('0x42')]=_0x20ae48[_0x5091('0x42')]=![];_0x24bea3[_0x5091('0x39')]=_0x20ae48[_0x5091('0x39')]=null;_0x24bea3[_0x5091('0x3b')]=_0x20ae48[_0x5091('0x3c')]=null;}_0x24bea3[_0x5091('0x3f')]=_0x231d45['Imap']['host'];_0x24bea3['port']=_0x231d45[_0x5091('0x43')][_0x5091('0x44')];_0x20ae48[_0x5091('0x3f')]=_0x231d45[_0x5091('0x45')][_0x5091('0x3f')];_0x20ae48[_0x5091('0x44')]=_0x231d45[_0x5091('0x45')][_0x5091('0x44')];}return{'Imap':_0x24bea3,'Smtp':_0x20ae48};}exports['index']=function(_0x98e08d,_0x24801d){var _0x4b236f={'include':[{'model':db[_0x5091('0x46')],'as':_0x5091('0x43')},{'model':db[_0x5091('0x47')],'as':_0x5091('0x45')},{'model':db[_0x5091('0x48')],'as':_0x5091('0x49')}]},_0x59692c={},_0x12261c={'count':0x0,'rows':[]};var _0xb2a84c=_[_0x5091('0x4a')](db[_0x5091('0x4b')]['rawAttributes'],function(_0x6de9d5){return{'name':_0x6de9d5[_0x5091('0x4c')],'type':_0x6de9d5[_0x5091('0x4d')][_0x5091('0x4e')]};});_0x59692c['model']=_[_0x5091('0x4a')](_0xb2a84c,_0x5091('0x2b'));_0x59692c['query']=_[_0x5091('0x4f')](_0x98e08d[_0x5091('0x50')]);_0x59692c[_0x5091('0x51')]=_['intersection'](_0x59692c[_0x5091('0x52')],_0x59692c[_0x5091('0x50')]);_0x4b236f['attributes']=_[_0x5091('0x53')](_0x59692c[_0x5091('0x52')],qs['fields'](_0x98e08d[_0x5091('0x50')][_0x5091('0x54')]));_0x4b236f[_0x5091('0x55')]=_0x4b236f[_0x5091('0x55')]['length']?_0x4b236f['attributes']:_0x59692c[_0x5091('0x52')];if(!_0x98e08d[_0x5091('0x50')][_0x5091('0x56')](_0x5091('0x57'))){_0x4b236f['limit']=qs['limit'](_0x98e08d['query'][_0x5091('0x21')]);_0x4b236f['offset']=qs[_0x5091('0x23')](_0x98e08d[_0x5091('0x50')][_0x5091('0x23')]);}_0x4b236f[_0x5091('0x58')]=qs[_0x5091('0x59')](_0x98e08d[_0x5091('0x50')][_0x5091('0x59')]);_0x4b236f[_0x5091('0x5a')]=qs['filters'](_['pick'](_0x98e08d[_0x5091('0x50')],_0x59692c['filters']),_0xb2a84c);if(_0x98e08d['query'][_0x5091('0x5b')]){_0x4b236f['where']=_[_0x5091('0x5c')](_0x4b236f['where'],{'$or':_[_0x5091('0x4a')](_0xb2a84c,function(_0x4dee35){if(_0x4dee35[_0x5091('0x4d')]!=='VIRTUAL'){var _0x31fdac={};_0x31fdac[_0x4dee35[_0x5091('0x2b')]]={'$like':'%'+_0x98e08d[_0x5091('0x50')]['filter']+'%'};return _0x31fdac;}})});}_0x4b236f=_[_0x5091('0x5c')]({},_0x4b236f,_0x98e08d['options']);var _0x45e259={'where':_0x4b236f[_0x5091('0x5a')]};return db[_0x5091('0x4b')][_0x5091('0x22')](_0x45e259)[_0x5091('0x26')](function(_0x35f960){_0x12261c['count']=_0x35f960;if(_0x98e08d[_0x5091('0x50')][_0x5091('0x5d')]){_0x4b236f['include']=[{'all':!![]}];}return db[_0x5091('0x4b')]['findAll'](_0x4b236f);})['then'](function(_0x4d1869){_0x12261c[_0x5091('0x5e')]=_0x4d1869;return _0x12261c;})[_0x5091('0x26')](respondWithFilteredResult(_0x24801d,_0x4b236f))[_0x5091('0x1d')](handleError(_0x24801d,null));};exports['show']=function(_0x44a5b9,_0x1e76da){var _0xbfb442={'raw':![],'where':{'id':_0x44a5b9[_0x5091('0x5f')]['id']},'include':[{'model':db[_0x5091('0x46')],'as':_0x5091('0x43')},{'model':db[_0x5091('0x47')],'as':_0x5091('0x45')},{'model':db[_0x5091('0x48')],'as':_0x5091('0x49')}]},_0x146863={};_0x146863[_0x5091('0x52')]=_['keys'](db['MailAccount']['rawAttributes']);_0x146863['query']=_[_0x5091('0x4f')](_0x44a5b9[_0x5091('0x50')]);_0x146863[_0x5091('0x51')]=_[_0x5091('0x53')](_0x146863[_0x5091('0x52')],_0x146863[_0x5091('0x50')]);_0xbfb442[_0x5091('0x55')]=_[_0x5091('0x53')](_0x146863['model'],qs[_0x5091('0x54')](_0x44a5b9[_0x5091('0x50')][_0x5091('0x54')]));_0xbfb442[_0x5091('0x55')]=_0xbfb442[_0x5091('0x55')][_0x5091('0x60')]?_0xbfb442[_0x5091('0x55')]:_0x146863[_0x5091('0x52')];if(_0x44a5b9[_0x5091('0x50')][_0x5091('0x5d')]){_0xbfb442['include']=[{'all':!![]}];}_0xbfb442=_[_0x5091('0x5c')]({},_0xbfb442,_0x44a5b9['options']);return db[_0x5091('0x4b')][_0x5091('0x61')](_0xbfb442)[_0x5091('0x26')](handleEntityNotFound(_0x1e76da,null))[_0x5091('0x26')](respondWithResult(_0x1e76da,null))['catch'](handleError(_0x1e76da,null));};exports[_0x5091('0x62')]=function(_0x13ffe4,_0x40ce1e){if(_0x13ffe4[_0x5091('0x63')]['id']){delete _0x13ffe4[_0x5091('0x63')]['id'];}var _0x40a917=_0x13ffe4[_0x5091('0x63')]['provider']===_0x5091('0x64')?null:_0x13ffe4['body']['provider'];var _0x11563d=_0x13ffe4[_0x5091('0x63')][_0x5091('0x43')]||{};var _0x887d86=_0x13ffe4[_0x5091('0x63')][_0x5091('0x45')]||{};if(_0x40a917){_0x11563d['host']=getImapHost(_0x40a917);_0x11563d[_0x5091('0x44')]=0x3e1;_0x887d86['host']=getSmtpHost(_0x40a917);_0x887d86['port']=0x24b;_0x887d86[_0x5091('0x40')]=![];}if(_0x887d86[_0x5091('0x3d')]){_0x887d86[_0x5091('0x40')]=![];}else{_0x887d86[_0x5091('0x3e')]=null;}if(!_0x11563d[_0x5091('0x3d')])_0x11563d[_0x5091('0x3e')]=null;_0x13ffe4['body'][_0x5091('0x43')]=_0x11563d;_0x13ffe4[_0x5091('0x63')][_0x5091('0x45')]=_0x887d86;return db['MailAccount']['find']({'where':{'id':_0x13ffe4[_0x5091('0x5f')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x5091('0x43')},{'model':db[_0x5091('0x47')],'as':'Smtp'},{'model':db[_0x5091('0x48')],'as':_0x5091('0x49')}]})[_0x5091('0x26')](handleEntityNotFound(_0x40ce1e,null))[_0x5091('0x26')](function(_0xa67255){if(!_0xa67255)throw new Error(_0x5091('0x65'));if(_0xa67255[_0x5091('0x41')])delete _0x13ffe4[_0x5091('0x63')][_0x5091('0x43')];return _0xa67255;})[_0x5091('0x26')](saveUpdates(_0x13ffe4['body'],null))[_0x5091('0x26')](function(_0x4ba2bb){if(!_0x13ffe4[_0x5091('0x63')][_0x5091('0x43')])return _0x4ba2bb;return db['MailServerIn'][_0x5091('0x62')](_0x13ffe4[_0x5091('0x63')][_0x5091('0x43')],{'where':{'MailAccountId':_0x4ba2bb['id']}})['then'](function(){return _0x4ba2bb;});})[_0x5091('0x26')](function(_0x2b8b45){if(!_0x13ffe4[_0x5091('0x63')]['Smtp'])return _0x2b8b45;return db['MailServerOut'][_0x5091('0x62')](_0x13ffe4[_0x5091('0x63')]['Smtp'],{'where':{'MailAccountId':_0x2b8b45['id']}})[_0x5091('0x26')](function(){return _0x2b8b45;});})['then'](respondWithResult(_0x40ce1e,null))[_0x5091('0x1d')](handleError(_0x40ce1e,null));};exports['describe']=function(_0x2728b1,_0x1461e5){return db['MailAccount'][_0x5091('0x66')]()[_0x5091('0x26')](respondWithResult(_0x1461e5,null))[_0x5091('0x1d')](handleError(_0x1461e5,null));};exports[_0x5091('0x67')]=function(_0x53a837,_0x12b905){if(_0x53a837['body']['id']){delete _0x53a837[_0x5091('0x63')]['id'];}return db[_0x5091('0x4b')][_0x5091('0x61')]({'where':{'id':_0x53a837[_0x5091('0x5f')]['id']}})[_0x5091('0x26')](handleEntityNotFound(_0x12b905,null))[_0x5091('0x26')](function(_0x52980b){if(_0x52980b){_0x53a837[_0x5091('0x63')]['MailAccountId']=_0x52980b['id'];return db[_0x5091('0x68')]['create'](_0x53a837['body']);}})['then'](respondWithResult(_0x12b905,null))[_0x5091('0x1d')](handleError(_0x12b905,null));};exports[_0x5091('0x69')]=function(_0x228945,_0x386c67){var _0x403b16={'raw':![],'where':{}};var _0x4925bb={};var _0x1c78a8={'count':0x0,'rows':[]};return db[_0x5091('0x4b')][_0x5091('0x6a')]({'where':{'id':_0x228945[_0x5091('0x5f')]['id']}})[_0x5091('0x26')](handleEntityNotFound(_0x386c67,null))['then'](function(_0x93bfb){if(_0x93bfb){_0x4925bb[_0x5091('0x52')]=_['keys'](db[_0x5091('0x68')][_0x5091('0x6b')]);_0x4925bb['query']=_['keys'](_0x228945[_0x5091('0x50')]);_0x4925bb[_0x5091('0x51')]=_[_0x5091('0x53')](_0x4925bb[_0x5091('0x52')],_0x4925bb['query']);_0x403b16[_0x5091('0x55')]=_['intersection'](_0x4925bb[_0x5091('0x52')],qs['fields'](_0x228945[_0x5091('0x50')][_0x5091('0x54')]));_0x403b16[_0x5091('0x55')]=_0x403b16[_0x5091('0x55')]['length']?_0x403b16[_0x5091('0x55')]:_0x4925bb[_0x5091('0x52')];if(!_0x228945[_0x5091('0x50')][_0x5091('0x56')](_0x5091('0x57'))){_0x403b16['limit']=qs[_0x5091('0x21')](_0x228945[_0x5091('0x50')][_0x5091('0x21')]);_0x403b16['offset']=qs[_0x5091('0x23')](_0x228945['query']['offset']);}_0x403b16[_0x5091('0x58')]=qs['sort'](_0x228945[_0x5091('0x50')][_0x5091('0x59')]);_0x403b16[_0x5091('0x5a')]=qs['filters'](_[_0x5091('0x6c')](_0x228945[_0x5091('0x50')],_0x4925bb[_0x5091('0x51')]));_0x403b16[_0x5091('0x5a')][_0x5091('0x6d')]=_0x93bfb['id'];if(_0x228945['query'][_0x5091('0x5b')]){_0x403b16['where']=_['merge'](_0x403b16['where'],{'$or':_[_0x5091('0x4a')](_0x403b16[_0x5091('0x55')],function(_0x1d5d6e){var _0x5de281={};_0x5de281[_0x1d5d6e]={'$like':'%'+_0x228945[_0x5091('0x50')][_0x5091('0x5b')]+'%'};return _0x5de281;})});}_0x403b16=_[_0x5091('0x5c')]({},_0x403b16,_0x228945[_0x5091('0x6e')]);return db[_0x5091('0x68')][_0x5091('0x22')]({'where':_0x403b16['where']})['then'](function(_0x386fbc){_0x1c78a8[_0x5091('0x22')]=_0x386fbc;if(_0x228945['query']['includeAll']){_0x403b16['include']=[{'all':!![]}];}return db['Disposition'][_0x5091('0x6f')](_0x403b16);})[_0x5091('0x26')](function(_0x15c507){_0x1c78a8[_0x5091('0x5e')]=_0x15c507;return _0x1c78a8;});}})['then'](respondWithFilteredResult(_0x386c67,_0x403b16))[_0x5091('0x1d')](handleError(_0x386c67,null));};exports[_0x5091('0x70')]=function(_0x46ed61,_0x1d8667){return db[_0x5091('0x4b')][_0x5091('0x61')]({'where':{'id':_0x46ed61[_0x5091('0x5f')]['id']}})[_0x5091('0x26')](handleEntityNotFound(_0x1d8667,null))[_0x5091('0x26')](function(_0xd9721){if(_0xd9721){return _0xd9721[_0x5091('0x70')](_0x46ed61[_0x5091('0x50')][_0x5091('0x71')]);}})[_0x5091('0x26')](respondWithStatusCode(_0x1d8667,null))['catch'](handleError(_0x1d8667,null));};exports[_0x5091('0x72')]=function(_0x1d5f81,_0x228980){if(_0x1d5f81[_0x5091('0x63')]['id']){delete _0x1d5f81[_0x5091('0x63')]['id'];}return db[_0x5091('0x4b')][_0x5091('0x61')]({'where':{'id':_0x1d5f81[_0x5091('0x5f')]['id']}})['then'](handleEntityNotFound(_0x228980,null))[_0x5091('0x26')](function(_0x4c1477){if(_0x4c1477){_0x1d5f81[_0x5091('0x63')][_0x5091('0x6d')]=_0x4c1477['id'];return db[_0x5091('0x73')][_0x5091('0x74')](_0x1d5f81[_0x5091('0x63')]);}})['then'](respondWithResult(_0x228980,null))[_0x5091('0x1d')](handleError(_0x228980,null));};exports[_0x5091('0x75')]=function(_0x46c40a,_0x4d68a0){var _0x300c3e={'raw':![],'where':{}};var _0x3cc695={};var _0x3361a3={'count':0x0,'rows':[]};return db[_0x5091('0x4b')]['findOne']({'where':{'id':_0x46c40a['params']['id']}})[_0x5091('0x26')](handleEntityNotFound(_0x4d68a0,null))[_0x5091('0x26')](function(_0x14274d){if(_0x14274d){_0x3cc695['model']=_['keys'](db['CannedAnswer']['rawAttributes']);_0x3cc695[_0x5091('0x50')]=_[_0x5091('0x4f')](_0x46c40a['query']);_0x3cc695[_0x5091('0x51')]=_['intersection'](_0x3cc695[_0x5091('0x52')],_0x3cc695[_0x5091('0x50')]);_0x300c3e[_0x5091('0x55')]=_[_0x5091('0x53')](_0x3cc695[_0x5091('0x52')],qs['fields'](_0x46c40a[_0x5091('0x50')][_0x5091('0x54')]));_0x300c3e['attributes']=_0x300c3e[_0x5091('0x55')][_0x5091('0x60')]?_0x300c3e['attributes']:_0x3cc695[_0x5091('0x52')];if(!_0x46c40a[_0x5091('0x50')]['hasOwnProperty'](_0x5091('0x57'))){_0x300c3e[_0x5091('0x21')]=qs['limit'](_0x46c40a['query']['limit']);_0x300c3e[_0x5091('0x23')]=qs[_0x5091('0x23')](_0x46c40a[_0x5091('0x50')][_0x5091('0x23')]);}_0x300c3e[_0x5091('0x58')]=qs[_0x5091('0x59')](_0x46c40a[_0x5091('0x50')]['sort']);_0x300c3e['where']=qs[_0x5091('0x51')](_['pick'](_0x46c40a[_0x5091('0x50')],_0x3cc695['filters']));_0x300c3e['where'][_0x5091('0x6d')]=_0x14274d['id'];if(_0x46c40a[_0x5091('0x50')]['filter']){_0x300c3e[_0x5091('0x5a')]=_[_0x5091('0x5c')](_0x300c3e['where'],{'$or':_[_0x5091('0x4a')](_0x300c3e[_0x5091('0x55')],function(_0x1f1bdd){var _0x4ab253={};_0x4ab253[_0x1f1bdd]={'$like':'%'+_0x46c40a[_0x5091('0x50')][_0x5091('0x5b')]+'%'};return _0x4ab253;})});}_0x300c3e=_['merge']({},_0x300c3e,_0x46c40a[_0x5091('0x6e')]);return db[_0x5091('0x73')][_0x5091('0x22')]({'where':_0x300c3e[_0x5091('0x5a')]})['then'](function(_0x61c47b){_0x3361a3[_0x5091('0x22')]=_0x61c47b;if(_0x46c40a[_0x5091('0x50')]['includeAll']){_0x300c3e['include']=[{'all':!![]}];}return db[_0x5091('0x73')][_0x5091('0x6f')](_0x300c3e);})[_0x5091('0x26')](function(_0xc392ad){_0x3361a3[_0x5091('0x5e')]=_0xc392ad;return _0x3361a3;});}})['then'](respondWithFilteredResult(_0x4d68a0,_0x300c3e))['catch'](handleError(_0x4d68a0,null));};exports[_0x5091('0x76')]=function(_0x1ed166,_0x3c232c){return db[_0x5091('0x4b')]['find']({'where':{'id':_0x1ed166[_0x5091('0x5f')]['id']}})[_0x5091('0x26')](handleEntityNotFound(_0x3c232c,null))[_0x5091('0x26')](function(_0x3cdc85){if(_0x3cdc85){return _0x3cdc85[_0x5091('0x76')](_0x1ed166['query'][_0x5091('0x71')]);}})['then'](respondWithStatusCode(_0x3c232c,null))[_0x5091('0x1d')](handleError(_0x3c232c,null));};exports[_0x5091('0x74')]=function(_0x4e5715,_0x5506f9){var _0x57ee79={'name':_0x4e5715[_0x5091('0x63')]['name'],'key':_0x4e5715[_0x5091('0x63')][_0x5091('0x4e')],'provider':_0x4e5715[_0x5091('0x63')][_0x5091('0x77')]==='custom'?null:_0x4e5715['body'][_0x5091('0x77')],'email':_0x4e5715[_0x5091('0x63')][_0x5091('0x78')],'ListId':_0x4e5715[_0x5091('0x63')][_0x5091('0x79')],'active':!_['isNil'](_0x4e5715[_0x5091('0x63')][_0x5091('0x7a')])?_0x4e5715[_0x5091('0x63')][_0x5091('0x7a')]:!![],'description':_0x4e5715[_0x5091('0x63')]['description']||null};var _0x2409d6=getAuthenticationOptions(_0x57ee79[_0x5091('0x77')],_0x4e5715[_0x5091('0x63')]);_0x57ee79[_0x5091('0x43')]=_0x2409d6['Imap'];_0x57ee79['Smtp']=_0x2409d6[_0x5091('0x45')];return db['MailAccount']['create'](_0x57ee79,{'include':[{'model':db[_0x5091('0x47')],'as':_0x5091('0x45')},{'model':db[_0x5091('0x46')],'as':_0x5091('0x43')}]})[_0x5091('0x26')](function(_0x5f09dd){var _0x3b17f2=_0x4e5715[_0x5091('0x39')][_0x5091('0x28')]({'plain':!![]});if(!_0x3b17f2)throw new Error(_0x5091('0x7b'));if(_0x3b17f2[_0x5091('0x7c')]==='user'){var _0x16d8eb=_0x5f09dd[_0x5091('0x28')]({'plain':!![]});return db[_0x5091('0x7d')][_0x5091('0x61')]({'where':{'name':_0x5091('0x29'),'userProfileId':_0x3b17f2[_0x5091('0x7e')]},'raw':!![]})[_0x5091('0x26')](function(_0x4c8d9f){if(_0x4c8d9f&&_0x4c8d9f[_0x5091('0x7f')]===0x0){return db[_0x5091('0x2a')][_0x5091('0x74')]({'name':_0x16d8eb[_0x5091('0x2b')],'resourceId':_0x16d8eb['id'],'type':_0x4c8d9f['name'],'sectionId':_0x4c8d9f['id']},{})[_0x5091('0x26')](function(){return _0x5f09dd;});}else{return _0x5f09dd;}})[_0x5091('0x1d')](function(_0x3e0ef3){logger['error'](_0x5091('0x80'),_0x3e0ef3);throw _0x3e0ef3;});}return _0x5f09dd;})['then'](respondWithResult(_0x5506f9,0xc9))['catch'](handleError(_0x5506f9,null));};exports[_0x5091('0x81')]=function(_0x2b1fc4,_0x1c09c9){return db[_0x5091('0x4b')][_0x5091('0x6a')]({'where':{'id':_0x2b1fc4[_0x5091('0x5f')]['id']}})[_0x5091('0x26')](handleEntityNotFound(_0x1c09c9,null))['then'](function(_0x44c669){if(_0x44c669){return _0x44c669[_0x5091('0x81')]();}return null;})[_0x5091('0x26')](respondWithResult(_0x1c09c9,null))[_0x5091('0x1d')](handleError(_0x1c09c9,null));};exports[_0x5091('0x82')]=function(_0x2a0d3e,_0x3adeda){if(_0x2a0d3e['body']['id']){delete _0x2a0d3e[_0x5091('0x63')]['id'];}return db['MailAccount'][_0x5091('0x61')]({'where':{'id':_0x2a0d3e[_0x5091('0x5f')]['id']}})[_0x5091('0x26')](handleEntityNotFound(_0x3adeda,null))['then'](function(_0x43d2d0){if(_0x43d2d0){_0x2a0d3e[_0x5091('0x63')][_0x5091('0x6d')]=_0x43d2d0['id'];return db[_0x5091('0x46')][_0x5091('0x74')](_0x2a0d3e[_0x5091('0x63')]);}})[_0x5091('0x26')](respondWithResult(_0x3adeda,null))[_0x5091('0x1d')](handleError(_0x3adeda,null));};exports[_0x5091('0x83')]=function(_0x3d8069,_0x2fd3e0){return db['MailAccount'][_0x5091('0x6a')]({'where':{'id':_0x3d8069['params']['id']}})[_0x5091('0x26')](handleEntityNotFound(_0x2fd3e0,null))[_0x5091('0x26')](function(_0x4583de){if(_0x4583de){return _0x4583de[_0x5091('0x84')](null);}return null;})[_0x5091('0x26')](respondWithStatusCode(_0x2fd3e0,null))[_0x5091('0x1d')](handleError(_0x2fd3e0,null));};exports[_0x5091('0x85')]=function(_0x6463df,_0x19c988){return db['MailAccount'][_0x5091('0x6a')]({'where':{'id':_0x6463df[_0x5091('0x5f')]['id']}})['then'](handleEntityNotFound(_0x19c988,null))[_0x5091('0x26')](function(_0x5dccbc){if(_0x5dccbc){return _0x5dccbc[_0x5091('0x85')]();}return null;})[_0x5091('0x26')](respondWithResult(_0x19c988,null))[_0x5091('0x1d')](handleError(_0x19c988,null));};exports['addSmtp']=function(_0x1719a9,_0x2728da){if(_0x1719a9[_0x5091('0x63')]['id']){delete _0x1719a9[_0x5091('0x63')]['id'];}return db[_0x5091('0x4b')][_0x5091('0x61')]({'where':{'id':_0x1719a9[_0x5091('0x5f')]['id']}})[_0x5091('0x26')](handleEntityNotFound(_0x2728da,null))[_0x5091('0x26')](function(_0x188986){if(_0x188986){_0x1719a9['body'][_0x5091('0x6d')]=_0x188986['id'];return db[_0x5091('0x47')][_0x5091('0x74')](_0x1719a9[_0x5091('0x63')]);}})['then'](respondWithResult(_0x2728da,null))[_0x5091('0x1d')](handleError(_0x2728da,null));};exports[_0x5091('0x86')]=function(_0x7191e1,_0xbd5923){return db['MailAccount'][_0x5091('0x6a')]({'where':{'id':_0x7191e1[_0x5091('0x5f')]['id']}})['then'](handleEntityNotFound(_0xbd5923,null))[_0x5091('0x26')](function(_0x1d3a6d){if(_0x1d3a6d){return _0x1d3a6d[_0x5091('0x87')](null);}return null;})[_0x5091('0x26')](respondWithStatusCode(_0xbd5923,null))[_0x5091('0x1d')](handleError(_0xbd5923,null));};exports['addInteraction']=function(_0x42cd7b,_0x305616){return db[_0x5091('0x88')]['find']({'where':{'id':_0x42cd7b[_0x5091('0x5f')]['id']}})[_0x5091('0x26')](handleEntityNotFound(_0x305616,null))[_0x5091('0x26')](function(_0x432965){if(_0x432965){return _0x432965[_0x5091('0x89')](_0x42cd7b[_0x5091('0x63')][_0x5091('0x71')],_['omit'](_0x42cd7b['body'],[_0x5091('0x71'),'id'])||{});}})[_0x5091('0x26')](respondWithResult(_0x305616,null))['catch'](handleError(_0x305616,null));};exports[_0x5091('0x8a')]=function(_0x408c97,_0x2c7d1e){var _0x109490={'raw':![],'where':{}};var _0x31a3d1={};var _0x3870a8={'count':0x0,'rows':[]};return db[_0x5091('0x4b')][_0x5091('0x6a')]({'where':{'id':_0x408c97[_0x5091('0x5f')]['id']}})[_0x5091('0x26')](handleEntityNotFound(_0x2c7d1e,null))[_0x5091('0x26')](function(_0x4c3a93){if(_0x4c3a93){_0x31a3d1[_0x5091('0x52')]=_['keys'](db['MailInteraction']['rawAttributes']);_0x31a3d1[_0x5091('0x50')]=_[_0x5091('0x4f')](_0x408c97[_0x5091('0x50')]);_0x31a3d1[_0x5091('0x51')]=_[_0x5091('0x53')](_0x31a3d1['model'],_0x31a3d1[_0x5091('0x50')]);_0x109490[_0x5091('0x55')]=_[_0x5091('0x53')](_0x31a3d1[_0x5091('0x52')],qs[_0x5091('0x54')](_0x408c97[_0x5091('0x50')][_0x5091('0x54')]));_0x109490['attributes']=_0x109490[_0x5091('0x55')][_0x5091('0x60')]?_0x109490['attributes']:_0x31a3d1[_0x5091('0x52')];if(!_0x408c97['query'][_0x5091('0x56')](_0x5091('0x57'))){_0x109490[_0x5091('0x21')]=qs[_0x5091('0x21')](_0x408c97[_0x5091('0x50')][_0x5091('0x21')]);_0x109490[_0x5091('0x23')]=qs[_0x5091('0x23')](_0x408c97[_0x5091('0x50')][_0x5091('0x23')]);}_0x109490[_0x5091('0x58')]=qs[_0x5091('0x59')](_0x408c97[_0x5091('0x50')][_0x5091('0x59')]);_0x109490['where']=qs[_0x5091('0x51')](_[_0x5091('0x6c')](_0x408c97[_0x5091('0x50')],_0x31a3d1['filters']));_0x109490[_0x5091('0x5a')][_0x5091('0x6d')]=_0x4c3a93['id'];if(_0x408c97[_0x5091('0x50')][_0x5091('0x5b')]){_0x109490['where']=_[_0x5091('0x5c')](_0x109490[_0x5091('0x5a')],{'$or':_['map'](_0x109490[_0x5091('0x55')],function(_0x343ee4){var _0x27f47f={};_0x27f47f[_0x343ee4]={'$like':'%'+_0x408c97[_0x5091('0x50')][_0x5091('0x5b')]+'%'};return _0x27f47f;})});}_0x109490=_[_0x5091('0x5c')]({},_0x109490,_0x408c97[_0x5091('0x6e')]);return db['MailInteraction'][_0x5091('0x22')]({'where':_0x109490[_0x5091('0x5a')]})[_0x5091('0x26')](function(_0x55d246){_0x3870a8[_0x5091('0x22')]=_0x55d246;if(_0x408c97['query'][_0x5091('0x5d')]){_0x109490[_0x5091('0x8b')]=[{'model':db[_0x5091('0x8c')],'as':_0x5091('0x8d'),'required':![]},{'model':db[_0x5091('0x8e')],'as':'Owner','attributes':[_0x5091('0x2b'),_0x5091('0x8f'),_0x5091('0x90')],'required':![]},{'model':db[_0x5091('0x91')],'as':_0x5091('0x92'),'attributes':['id','name',_0x5091('0x93')],'where':_0x408c97[_0x5091('0x50')][_0x5091('0x94')]?{'id':_0x408c97['query'][_0x5091('0x94')]}:undefined,'required':_0x408c97['query'][_0x5091('0x94')]?!![]:![]}];}return db[_0x5091('0x88')][_0x5091('0x6f')](_0x109490);})[_0x5091('0x26')](function(_0x144c2e){_0x3870a8[_0x5091('0x5e')]=_0x144c2e;return _0x3870a8;});}})[_0x5091('0x26')](respondWithFilteredResult(_0x2c7d1e,_0x109490))[_0x5091('0x1d')](handleError(_0x2c7d1e,null));};exports[_0x5091('0x95')]=function addApplications(_0x3733b3,_0x6387c4){var _0x53ee33=_0x3733b3[_0x5091('0x5f')]['id'];var _0x1980b0=_0x3733b3[_0x5091('0x63')];var _0x347bef=0xc8;var _0x3e2005=null;return db[_0x5091('0x96')]['transaction']({'isolationLevel':db[_0x5091('0x96')][_0x5091('0x97')][_0x5091('0x98')][_0x5091('0x99')]},function(_0x38fae8){return db[_0x5091('0x4b')][_0x5091('0x6a')]({'where':{'id':_0x53ee33},'transaction':_0x38fae8})[_0x5091('0x26')](function(_0x118be2){if(_0x118be2){return db[_0x5091('0x9a')][_0x5091('0x27')]({'where':{'MailAccountId':_0x53ee33},'transaction':_0x38fae8})['then'](function(){var _0xa525c1=_[_0x5091('0x4a')](_0x1980b0,function(_0x147fc2){_0x147fc2[_0x5091('0x6d')]=_0x53ee33;return _0x147fc2;});return db[_0x5091('0x9a')][_0x5091('0x9b')](_0xa525c1,{'transaction':_0x38fae8});});}else{_0x347bef=0x194;_0x3e2005=[];}});})[_0x5091('0x26')](function(){if(_0x347bef!==0x194){return db['MailApplication']['findAndCountAll']({'where':{'MailAccountId':_0x53ee33},'order':_0x5091('0x9c')})[_0x5091('0x26')](function(_0x3953cb){_0x3e2005=_0x3953cb;});}})[_0x5091('0x1d')](function(_0x4373fa){_0x347bef=0x1f4;logger[_0x5091('0x19')](_0x4373fa[_0x5091('0x9d')]);if(_0x4373fa[_0x5091('0x2b')]){delete _0x4373fa[_0x5091('0x2b')];}_0x3e2005=_0x4373fa;})[_0x5091('0x9e')](function(){if(_0x3e2005===null){_0x6387c4['sendStatus'](_0x347bef);}else{if(_0x347bef===0x1f4){_0x6387c4['status'](_0x347bef)['send'](_0x3e2005);}else{_0x6387c4['status'](_0x347bef)['json'](_0x3e2005);}}});};exports[_0x5091('0x9f')]=function(_0x4875cf,_0x3d7231){var _0x961962={};var _0x2fab7e={};var _0x312f43;var _0x48d9f9;return db[_0x5091('0x4b')][_0x5091('0x6a')]({'where':{'id':_0x4875cf['params']['id']}})[_0x5091('0x26')](handleEntityNotFound(_0x3d7231,null))['then'](function(_0x4148cc){if(_0x4148cc){_0x312f43=_0x4148cc;_0x2fab7e[_0x5091('0x52')]=_[_0x5091('0x4f')](db[_0x5091('0x9a')][_0x5091('0x6b')]);_0x2fab7e['query']=_['keys'](_0x4875cf[_0x5091('0x50')]);_0x2fab7e[_0x5091('0x51')]=_[_0x5091('0x53')](_0x2fab7e[_0x5091('0x52')],_0x2fab7e[_0x5091('0x50')]);_0x961962[_0x5091('0x55')]=_[_0x5091('0x53')](_0x2fab7e[_0x5091('0x52')],qs[_0x5091('0x54')](_0x4875cf[_0x5091('0x50')][_0x5091('0x54')]));_0x961962[_0x5091('0x55')]=_0x961962['attributes'][_0x5091('0x60')]?_0x961962['attributes']:_0x2fab7e[_0x5091('0x52')];_0x961962[_0x5091('0x58')]=qs[_0x5091('0x59')](_0x4875cf[_0x5091('0x50')][_0x5091('0x59')]);_0x961962[_0x5091('0x5a')]=qs[_0x5091('0x51')](_[_0x5091('0x6c')](_0x4875cf[_0x5091('0x50')],_0x2fab7e[_0x5091('0x51')]));if(_0x4875cf['query']['filter']){_0x961962[_0x5091('0x5a')]=_[_0x5091('0x5c')](_0x961962[_0x5091('0x5a')],{'$or':_[_0x5091('0x4a')](_0x961962[_0x5091('0x55')],function(_0x4db8d2){var _0x4bfe07={};_0x4bfe07[_0x4db8d2]={'$like':'%'+_0x4875cf[_0x5091('0x50')][_0x5091('0x5b')]+'%'};return _0x4bfe07;})});}_0x961962=_[_0x5091('0x5c')]({},_0x961962,_0x4875cf['options']);return _0x312f43[_0x5091('0x9f')](_0x961962);}})[_0x5091('0x26')](function(_0xbf7573){if(_0xbf7573){_0x48d9f9=_0xbf7573[_0x5091('0x60')];if(!_0x4875cf[_0x5091('0x50')][_0x5091('0x56')](_0x5091('0x57'))){_0x961962[_0x5091('0x21')]=qs['limit'](_0x4875cf['query'][_0x5091('0x21')]);_0x961962[_0x5091('0x23')]=qs['offset'](_0x4875cf[_0x5091('0x50')][_0x5091('0x23')]);}return _0x312f43[_0x5091('0x9f')](_0x961962);}})['then'](function(_0x3de82f){if(_0x3de82f){return _0x3de82f?{'count':_0x48d9f9,'rows':_0x3de82f}:null;}})[_0x5091('0x26')](respondWithResult(_0x3d7231,null))[_0x5091('0x1d')](handleError(_0x3d7231,null));};exports[_0x5091('0xa0')]=function(_0x70db1d,_0x44e51d){var _0x25fec0={'raw':!![],'where':{}};var _0x888cd7={};var _0x377f1b={'count':0x0,'rows':[]};return db[_0x5091('0x4b')][_0x5091('0x6a')]({'where':{'id':_0x70db1d['params']['id']}})['then'](handleEntityNotFound(_0x44e51d,null))[_0x5091('0x26')](function(_0x37a00a){if(_0x37a00a){_0x888cd7[_0x5091('0x52')]=_[_0x5091('0x4f')](db[_0x5091('0xa1')][_0x5091('0x6b')]);_0x888cd7['query']=_[_0x5091('0x4f')](_0x70db1d[_0x5091('0x50')]);_0x888cd7[_0x5091('0x51')]=_[_0x5091('0x53')](_0x888cd7[_0x5091('0x52')],_0x888cd7[_0x5091('0x50')]);_0x25fec0[_0x5091('0x55')]=_['intersection'](_0x888cd7[_0x5091('0x52')],qs[_0x5091('0x54')](_0x70db1d[_0x5091('0x50')][_0x5091('0x54')]));_0x25fec0[_0x5091('0x55')]=_0x25fec0['attributes'][_0x5091('0x60')]?_0x25fec0['attributes']:_0x888cd7[_0x5091('0x52')];if(!_0x70db1d[_0x5091('0x50')][_0x5091('0x56')](_0x5091('0x57'))){_0x25fec0[_0x5091('0x21')]=qs[_0x5091('0x21')](_0x70db1d['query'][_0x5091('0x21')]);_0x25fec0[_0x5091('0x23')]=qs[_0x5091('0x23')](_0x70db1d[_0x5091('0x50')][_0x5091('0x23')]);}_0x25fec0['order']=qs[_0x5091('0x59')](_0x70db1d[_0x5091('0x50')]['sort']);_0x25fec0[_0x5091('0x5a')]=qs[_0x5091('0x51')](_[_0x5091('0x6c')](_0x70db1d[_0x5091('0x50')],_0x888cd7[_0x5091('0x51')]));_0x25fec0[_0x5091('0x5a')][_0x5091('0x6d')]=_0x37a00a['id'];if(_0x70db1d[_0x5091('0x50')][_0x5091('0x5b')]){_0x25fec0[_0x5091('0x5a')]=_['merge'](_0x25fec0['where'],{'$or':_[_0x5091('0x4a')](_0x25fec0['attributes'],function(_0x1ff522){var _0x1c28fa={};_0x1c28fa[_0x1ff522]={'$like':'%'+_0x70db1d[_0x5091('0x50')][_0x5091('0x5b')]+'%'};return _0x1c28fa;})});}if(_0x70db1d[_0x5091('0x50')][_0x5091('0xa2')]){var _0x4c5080=_0x70db1d[_0x5091('0x50')]['$gte'][_0x5091('0xa3')](',');var _0x172a9a={};_0x172a9a[_0x4c5080[0x0]]={'$gte':moment(_0x4c5080[0x1])[_0x5091('0xa4')]('YYYY-MM-DD\x20HH:mm:ss')};_0x25fec0[_0x5091('0x5a')]=_[_0x5091('0x5c')](_0x25fec0[_0x5091('0x5a')],_0x172a9a);}_0x25fec0=_[_0x5091('0x5c')]({},_0x25fec0,_0x70db1d[_0x5091('0x6e')]);return db[_0x5091('0xa1')]['count']({'where':_0x25fec0[_0x5091('0x5a')]})[_0x5091('0x26')](function(_0x578074){_0x377f1b['count']=_0x578074;if(_0x70db1d[_0x5091('0x50')][_0x5091('0x5d')]){_0x25fec0['include']=[{'all':!![]}];}return db[_0x5091('0xa1')]['findAll'](_0x25fec0);})['then'](function(_0x564884){if(_0x70db1d[_0x5091('0x50')][_0x5091('0xa5')]===_0x5091('0xa6')){for(var _0x4e3e62=0x0;_0x4e3e62<_0x564884[_0x5091('0x60')];_0x4e3e62++){_0x564884[_0x4e3e62][_0x5091('0x63')]=juice(_0x564884[_0x4e3e62][_0x5091('0x63')]);}}_0x377f1b[_0x5091('0x5e')]=_0x564884;return _0x377f1b;});}})['then'](respondWithFilteredResult(_0x44e51d,_0x25fec0))[_0x5091('0x1d')](handleError(_0x44e51d,null));};exports[_0x5091('0x2c')]=function(_0x253e95,_0x39b2aa){var _0x4b3498,_0x3bd152={},_0x299a92;if(_0x253e95[_0x5091('0x63')]['to']){_0x299a92=_0x253e95[_0x5091('0x63')]['to'][_0x5091('0xa3')](',')[0x0];}return db[_0x5091('0x4b')][_0x5091('0x61')]({'where':{'id':_0x253e95[_0x5091('0x5f')]['id']},'include':[{'model':db[_0x5091('0xa7')],'as':'List','include':[{'model':db[_0x5091('0x8c')],'as':_0x5091('0xa8'),'where':{'email':_0x299a92},'limit':0x1,'order':[['updatedAt',_0x5091('0xa9')]]}]},{'model':db[_0x5091('0x47')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x5091('0xaa')],'as':_0x5091('0xaa'),'raw':!![]}]}]})[_0x5091('0x26')](handleEntityNotFound(_0x39b2aa,null))['then'](function(_0x2ecb5d){if(!_0x2ecb5d)return;_0x4b3498=_0x2ecb5d;if(!_0x2ecb5d['Smtp'])throw new Error('Smtp\x20configuration\x20not\x20found');if(_[_0x5091('0xab')](_0x253e95[_0x5091('0x63')][_0x5091('0xac')])){_0x253e95[_0x5091('0x63')]['from']=util['format'](_0x5091('0xad'),_0x2ecb5d[_0x5091('0x2b')],_0x2ecb5d[_0x5091('0x78')]||_0x2ecb5d[_0x5091('0x45')][_0x5091('0x39')]);}if(_0x253e95[_0x5091('0x63')][_0x5091('0xae')]&&_0x253e95[_0x5091('0x63')][_0x5091('0xae')]['length']){for(var _0x2bb76c=0x0;_0x2bb76c<_0x253e95['body']['attachments'][_0x5091('0x60')];_0x2bb76c+=0x1){_0x253e95['body'][_0x5091('0xae')][_0x2bb76c]={'filename':_0x253e95[_0x5091('0x63')]['attachments'][_0x2bb76c][_0x5091('0x2b')],'path':path[_0x5091('0xaf')](config[_0x5091('0xb0')],_0x5091('0xb1'),_0x253e95['body']['attachments'][_0x2bb76c]['basename'])};}}var _0x106fba=_0x2ecb5d[_0x5091('0xb2')]();return respondWithRpcPromise(_0x5091('0xb3'),'sendMail',{'account':_0x106fba,'message':_0x253e95[_0x5091('0x63')]});})[_0x5091('0x26')](function(_0x242e46){if(!_0x242e46)return;_0x3bd152=_0x242e46;if(!_0x4b3498['List'])throw new Error('List\x20not\x20found');if(_0x4b3498['List']['Contacts']['length'])return _0x4b3498[_0x5091('0xb4')][_0x5091('0xa8')][0x0];return db['CmContact'][_0x5091('0x74')](_[_0x5091('0xb')](_0x253e95[_0x5091('0x63')],{'firstName':_0x253e95[_0x5091('0x63')]['to'],'email':_0x253e95['body']['to'],'phone':_0x253e95[_0x5091('0x63')]['to'],'ListId':_0x4b3498['ListId']}));})[_0x5091('0x26')](function(_0x5f4d60){if(!_0x5f4d60)return;var _0x532064={'UserId':_0x253e95[_0x5091('0x39')]['id'],'ContactId':_0x5f4d60['id'],'MailAccountId':_0x4b3498['id'],'inReplyTo':_0x3bd152[_0x5091('0xb5')],'to':_0x253e95[_0x5091('0x63')][_0x5091('0xac')],'cc':_0x253e95[_0x5091('0x63')]['cc'],'subject':_0x253e95[_0x5091('0x63')][_0x5091('0xb6')],'attach':_0x253e95['body'][_0x5091('0xb7')],'firstMsgDirection':_0x5091('0xb8'),'lastMsgAt':moment()['format'](_0x5091('0xb9')),'lastMsgDirection':_0x5091('0xb8'),'Messages':[_[_0x5091('0x5c')](_0x253e95[_0x5091('0x63')],{'messageId':_0x3bd152[_0x5091('0xb5')],'sentAt':moment()[_0x5091('0xa4')](_0x5091('0xb9')),'read':!![],'MailAccountId':_0x4b3498['id'],'UserId':_0x253e95['user']['id'],'ContactId':_0x5f4d60['id']})]};if(_0x253e95[_0x5091('0x63')][_0x5091('0xba')]){_0x532064=_[_0x5091('0x5c')](_0x532064,_0x253e95[_0x5091('0x63')][_0x5091('0xba')]);}return db[_0x5091('0x88')]['create'](_0x532064,{'include':[{'model':db['MailMessage'],'as':_0x5091('0xbb')}]});})[_0x5091('0x26')](respondWithResult(_0x39b2aa,null))[_0x5091('0x1d')](handleError(_0x39b2aa,null));};exports['verifySmtp']=function(_0x939142,_0x3947ab){return db[_0x5091('0x4b')]['find']({'where':{'id':_0x939142[_0x5091('0x5f')]['id']},'include':[{'model':db[_0x5091('0x47')],'as':_0x5091('0x45'),'raw':!![],'include':[{'model':db[_0x5091('0xaa')],'as':_0x5091('0xaa'),'raw':!![]}]}]})[_0x5091('0x26')](handleEntityNotFound(_0x3947ab,null))[_0x5091('0x26')](function(_0x597d64){if(!_0x597d64[_0x5091('0x45')])return;var _0x26baac=_0x597d64[_0x5091('0xb2')]();return respondWithRpcPromise(_0x5091('0xbc'),_0x5091('0xbd'),{'account':_0x26baac});})['then'](respondWithResult(_0x3947ab,null))['catch'](handleError(_0x3947ab,null));};exports[_0x5091('0x27')]=function(_0x3e1b4f,_0x34a938){return db[_0x5091('0x4b')][_0x5091('0x61')]({'where':{'id':_0x3e1b4f['params']['id']}})[_0x5091('0x26')](handleEntityNotFound(_0x34a938,null))[_0x5091('0x26')](function(_0x350924){if(_0x350924&&_0x350924['service']){throw new db['Sequelize']['ValidationError'](_0x5091('0xbe'));}return _0x350924;})[_0x5091('0x26')](removeEntity(_0x34a938,null))[_0x5091('0x1d')](handleError(_0x34a938,null));};exports['addAgents']=function(_0x419c35,_0x18ef1b){return db[_0x5091('0x4b')][_0x5091('0x61')]({'where':{'id':_0x419c35[_0x5091('0x5f')]['id']}})[_0x5091('0x26')](handleEntityNotFound(_0x18ef1b,null))[_0x5091('0x26')](function(_0x49745b){if(_0x49745b){return _0x49745b['addAgents'](_0x419c35['body'][_0x5091('0x71')],_[_0x5091('0xbf')](_0x419c35[_0x5091('0x63')],[_0x5091('0x71'),'id'])||{})[_0x5091('0xc0')](function(_0x5708a9){for(var _0x37f066=0x0;_0x37f066<_0x419c35[_0x5091('0x63')][_0x5091('0x71')][_0x5091('0x60')];_0x37f066+=0x1){socket[_0x5091('0xc1')](_0x5091('0xc2'),{'UserId':Number(_0x419c35['body'][_0x5091('0x71')][_0x37f066]),'MailAccountId':Number(_0x419c35[_0x5091('0x5f')]['id'])});}return _0x5708a9;});}})['then'](respondWithResult(_0x18ef1b,null))[_0x5091('0x1d')](handleError(_0x18ef1b,null));};exports['removeAgents']=function(_0x5e9bc1,_0x6a9a5e){return db[_0x5091('0x4b')][_0x5091('0x61')]({'where':{'id':_0x5e9bc1['params']['id']}})[_0x5091('0x26')](handleEntityNotFound(_0x6a9a5e,null))[_0x5091('0x26')](function(_0x1ade6d){if(_0x1ade6d){return _0x1ade6d[_0x5091('0xc3')](_0x5e9bc1[_0x5091('0x50')][_0x5091('0x71')])[_0x5091('0x26')](function(){if(_[_0x5091('0xc4')](_0x5e9bc1[_0x5091('0x50')][_0x5091('0x71')])){for(var _0x1fc86f=0x0;_0x1fc86f<_0x5e9bc1[_0x5091('0x50')][_0x5091('0x71')][_0x5091('0x60')];_0x1fc86f+=0x1){socket[_0x5091('0xc1')](_0x5091('0xc5'),{'UserId':Number(_0x5e9bc1['query'][_0x5091('0x71')][_0x1fc86f]),'MailAccountId':Number(_0x5e9bc1[_0x5091('0x5f')]['id'])});}}else{socket[_0x5091('0xc1')](_0x5091('0xc5'),{'UserId':Number(_0x5e9bc1[_0x5091('0x50')]['ids']),'MailAccountId':Number(_0x5e9bc1[_0x5091('0x5f')]['id'])});}});}})[_0x5091('0x26')](respondWithStatusCode(_0x6a9a5e,null))[_0x5091('0x1d')](handleError(_0x6a9a5e,null));};exports[_0x5091('0xc6')]=function(_0x92bd84,_0x2dea06){var _0x39edaf={};var _0x454322={};var _0x3f9ddf;var _0x4bd923;return db[_0x5091('0x4b')]['findOne']({'where':{'id':_0x92bd84['params']['id']}})['then'](handleEntityNotFound(_0x2dea06,null))[_0x5091('0x26')](function(_0x4b8934){if(_0x4b8934){_0x3f9ddf=_0x4b8934;_0x454322['model']=_[_0x5091('0x4f')](db[_0x5091('0x8e')]['rawAttributes']);_0x454322[_0x5091('0x50')]=_[_0x5091('0x4f')](_0x92bd84[_0x5091('0x50')]);_0x454322[_0x5091('0x51')]=_[_0x5091('0x53')](_0x454322[_0x5091('0x52')],_0x454322[_0x5091('0x50')]);_0x39edaf[_0x5091('0x55')]=_['intersection'](_0x454322[_0x5091('0x52')],qs['fields'](_0x92bd84[_0x5091('0x50')][_0x5091('0x54')]));_0x39edaf[_0x5091('0x55')]=_0x39edaf[_0x5091('0x55')][_0x5091('0x60')]?_0x39edaf[_0x5091('0x55')]:_0x454322[_0x5091('0x52')];_0x39edaf[_0x5091('0x58')]=qs[_0x5091('0x59')](_0x92bd84[_0x5091('0x50')]['sort']);_0x39edaf[_0x5091('0x5a')]=qs[_0x5091('0x51')](_['pick'](_0x92bd84[_0x5091('0x50')],_0x454322['filters']));if(_0x92bd84[_0x5091('0x50')][_0x5091('0x5b')]){_0x39edaf[_0x5091('0x5a')]=_[_0x5091('0x5c')](_0x39edaf[_0x5091('0x5a')],{'$or':_['map'](_0x39edaf[_0x5091('0x55')],function(_0x50c039){var _0x3e40d={};_0x3e40d[_0x50c039]={'$like':'%'+_0x92bd84['query'][_0x5091('0x5b')]+'%'};return _0x3e40d;})});}_0x39edaf=_[_0x5091('0x5c')]({},_0x39edaf,_0x92bd84['options']);return _0x3f9ddf[_0x5091('0xc6')](_0x39edaf);}})[_0x5091('0x26')](function(_0x419d92){if(_0x419d92){_0x4bd923=_0x419d92['length'];if(!_0x92bd84['query'][_0x5091('0x56')](_0x5091('0x57'))){_0x39edaf[_0x5091('0x21')]=qs['limit'](_0x92bd84[_0x5091('0x50')]['limit']);_0x39edaf[_0x5091('0x23')]=qs['offset'](_0x92bd84[_0x5091('0x50')][_0x5091('0x23')]);}return _0x3f9ddf[_0x5091('0xc6')](_0x39edaf);}})['then'](function(_0x563f88){if(_0x563f88){return _0x563f88?{'count':_0x4bd923,'rows':_0x563f88}:null;}})[_0x5091('0x26')](respondWithResult(_0x2dea06,null))[_0x5091('0x1d')](handleError(_0x2dea06,null));}; \ No newline at end of file +var _0xc479=['Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','user','username','password','pass','modernAuthentication','CloudProviderId','port','host','secure','service','authentication','Imap','Smtp','index','MailServerOut','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','where','VIRTUAL','options','MailAccount','includeAll','include','rows','show','MailServerIn','keys','body','provider','custom','find','params','Pause','describe','MailAccountId','Disposition','create','getDispositions','findOne','findAll','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','email','ListId','active','description','role','UserProfileSection','MailAccounts','userProfileId','autoAssociation','addImap','getSmtp','addSmtp','removeSmtp','addInteraction','omit','getInteractions','MailInteraction','CmContact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','transaction','sequelize','Transaction','READ_COMMITTED','MailApplication','bulkCreate','priority','finally','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','isNil','from','attachments','root','server/files/attachments','basename','getSmtpOptions','sendMail','List\x20not\x20found','messageId','subject','attach','out','Interaction','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','removeAgents','isArray','userMailAccount:remove','getAgents','moment','bluebird','path','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','redis','defaults','socket.io-emitter','./mailAccount.socket','register','jayson/promise','http','request','info','MailAccount,\x20%s,\x20%s','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','json','offset','undefined','count','set','Content-Range','update','then','destroy','get','end','stack','send','gmail','yahoo','imap.mail.yahoo.com','outlook365','outlook.office365.com'];(function(_0x3923d,_0x2c6153){var _0x472db7=function(_0x1a1f33){while(--_0x1a1f33){_0x3923d['push'](_0x3923d['shift']());}};_0x472db7(++_0x2c6153);}(_0xc479,0x151));var _0x9c47=function(_0x42646,_0x2f493c){_0x42646=_0x42646-0x0;var _0x580f81=_0xc479[_0x42646];return _0x580f81;};'use strict';var moment=require(_0x9c47('0x0'));var BPromise=require(_0x9c47('0x1'));var util=require('util');var path=require(_0x9c47('0x2'));var _=require(_0x9c47('0x3'));var juice=require('juice');var Redis=require(_0x9c47('0x4'));var qs=require(_0x9c47('0x5'));var logger=require('../../config/logger')(_0x9c47('0x6'));var config=require(_0x9c47('0x7'));var db=require('../../mysqldb')['db'];config[_0x9c47('0x8')]=_[_0x9c47('0x9')](config[_0x9c47('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x9c47('0xa'))(new Redis(config[_0x9c47('0x8')]));require(_0x9c47('0xb'))[_0x9c47('0xc')](socket);var jayson=require(_0x9c47('0xd'));var client=jayson['client'][_0x9c47('0xe')]({'port':0x232b});function respondWithRpcPromise(_0x55755e,_0x4307b4,_0x2a8945,_0x59bb4c){return new BPromise(function(_0x356e41,_0x49150b){var _0x57a0ed=_0x59bb4c||client;return _0x57a0ed[_0x9c47('0xf')](_0x55755e,_0x2a8945)['then'](function(_0x163fb8){logger[_0x9c47('0x10')](_0x9c47('0x11'),_0x4307b4,'request\x20sent');logger['debug'](_0x9c47('0x12'),_0x4307b4,_0x9c47('0x13'),JSON[_0x9c47('0x14')](_0x163fb8));if(_0x163fb8[_0x9c47('0x15')]){if(_0x163fb8['error']['code']===0x1f4){logger[_0x9c47('0x15')](_0x9c47('0x11'),_0x4307b4,_0x163fb8[_0x9c47('0x15')]['message']);return _0x49150b(_0x163fb8[_0x9c47('0x15')][_0x9c47('0x16')]);}logger['error'](_0x9c47('0x11'),_0x4307b4,_0x163fb8[_0x9c47('0x15')][_0x9c47('0x16')]);return _0x356e41(_0x163fb8['error'][_0x9c47('0x16')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x4307b4,'request\x20sent');_0x356e41(_0x163fb8[_0x9c47('0x17')]['message']);}})[_0x9c47('0x18')](function(_0x173ee4){logger[_0x9c47('0x15')]('MailAccount,\x20%s,\x20%s',_0x4307b4,_0x173ee4);_0x49150b(_0x173ee4);});});}function respondWithStatusCode(_0x416562,_0x21a21c){_0x21a21c=_0x21a21c||0xcc;return function(_0xc2ffd9){if(_0xc2ffd9){return _0x416562[_0x9c47('0x19')](_0x21a21c);}return _0x416562[_0x9c47('0x1a')](_0x21a21c)['end']();};}function respondWithResult(_0x118eaa,_0x227ea6){_0x227ea6=_0x227ea6||0xc8;return function(_0x3a0158){if(_0x3a0158){return _0x118eaa[_0x9c47('0x1a')](_0x227ea6)[_0x9c47('0x1b')](_0x3a0158);}};}function respondWithFilteredResult(_0x33680b,_0x379ee9){return function(_0x9f7dcd){if(_0x9f7dcd){var _0x58eb0c=typeof _0x379ee9[_0x9c47('0x1c')]===_0x9c47('0x1d')&&typeof _0x379ee9['limit']==='undefined';var _0x50a71b=_0x9f7dcd[_0x9c47('0x1e')];var _0x114a0a=_0x58eb0c?0x0:_0x379ee9['offset'];var _0x3a7325=_0x58eb0c?_0x9f7dcd[_0x9c47('0x1e')]:_0x379ee9[_0x9c47('0x1c')]+_0x379ee9['limit'];var _0x379bd5;if(_0x3a7325>=_0x50a71b){_0x3a7325=_0x50a71b;_0x379bd5=0xc8;}else{_0x379bd5=0xce;}_0x33680b[_0x9c47('0x1a')](_0x379bd5);return _0x33680b[_0x9c47('0x1f')](_0x9c47('0x20'),_0x114a0a+'-'+_0x3a7325+'/'+_0x50a71b)['json'](_0x9f7dcd);}return null;};}function saveUpdates(_0x4d8afc){return function(_0x45f749){if(_0x45f749){return _0x45f749[_0x9c47('0x21')](_0x4d8afc)[_0x9c47('0x22')](function(_0x2c08f1){return _0x2c08f1;});}return null;};}function removeEntity(_0x479363){return function(_0xb5b005){if(_0xb5b005){return _0xb5b005[_0x9c47('0x23')]()['then'](function(){var _0x3f6ddd=_0xb5b005[_0x9c47('0x24')]({'plain':!![]});var _0x4d045f='MailAccounts';return db['UserProfileResource'][_0x9c47('0x23')]({'where':{'type':_0x4d045f,'resourceId':_0x3f6ddd['id']}})[_0x9c47('0x22')](function(){return _0xb5b005;});})[_0x9c47('0x22')](function(){_0x479363[_0x9c47('0x1a')](0xcc)[_0x9c47('0x25')]();});}};}function handleEntityNotFound(_0x432da2){return function(_0x43323c){if(!_0x43323c){_0x432da2['sendStatus'](0x194);}return _0x43323c;};}function handleError(_0x46b78d,_0xe23bf4){_0xe23bf4=_0xe23bf4||0x1f4;return function(_0x40a5d5){logger[_0x9c47('0x15')](_0x40a5d5[_0x9c47('0x26')]);if(_0x40a5d5['name']){delete _0x40a5d5['name'];}_0x46b78d['status'](_0xe23bf4)[_0x9c47('0x27')](_0x40a5d5);};}function getImapHost(_0x1fa6ef){switch(_0x1fa6ef){case _0x9c47('0x28'):return'imap.gmail.com';case _0x9c47('0x29'):return _0x9c47('0x2a');case'hotmail':return'imap-mail.outlook.com';case _0x9c47('0x2b'):return _0x9c47('0x2c');}throw new Error(_0x9c47('0x2d'),_0x1fa6ef);}function getSmtpHost(_0xbe5dd9){switch(_0xbe5dd9){case'gmail':return _0x9c47('0x2e');case'yahoo':return _0x9c47('0x2f');case'hotmail':return _0x9c47('0x30');case _0x9c47('0x2b'):return'smtp.office365.com';}throw new Error(_0x9c47('0x2d'),_0xbe5dd9);}function getAuthenticationOptions(_0x150dcb,_0x16a6fc){var _0x5e9cf3={};var _0x41988e={};if(_0x150dcb){_0x5e9cf3[_0x9c47('0x31')]=_0x41988e[_0x9c47('0x31')]=_0x16a6fc[_0x9c47('0x32')];_0x5e9cf3[_0x9c47('0x33')]=_0x41988e[_0x9c47('0x34')]=_0x16a6fc[_0x9c47('0x33')];if(_0x16a6fc[_0x9c47('0x35')]){_0x5e9cf3[_0x9c47('0x35')]=_0x41988e[_0x9c47('0x35')]=!![];_0x5e9cf3[_0x9c47('0x36')]=_0x41988e[_0x9c47('0x36')]=_0x16a6fc[_0x9c47('0x36')];_0x5e9cf3['password']=_0x41988e[_0x9c47('0x34')]=null;}else{_0x5e9cf3[_0x9c47('0x36')]=_0x41988e[_0x9c47('0x36')]=null;}_0x5e9cf3['host']=getImapHost(_0x150dcb);_0x5e9cf3[_0x9c47('0x37')]=0x3e1;_0x41988e[_0x9c47('0x38')]=getSmtpHost(_0x150dcb);_0x41988e[_0x9c47('0x37')]=0x24b;_0x41988e[_0x9c47('0x39')]=![];_0x5e9cf3[_0x9c47('0x3a')]=_0x41988e[_0x9c47('0x3a')]=null;}else{if(_0x16a6fc[_0x9c47('0x3b')]){_0x5e9cf3[_0x9c47('0x31')]=_0x41988e[_0x9c47('0x31')]=_0x16a6fc[_0x9c47('0x32')];_0x5e9cf3['password']=_0x41988e['pass']=_0x16a6fc[_0x9c47('0x33')];}else{_0x5e9cf3[_0x9c47('0x3b')]=_0x41988e[_0x9c47('0x3b')]=![];_0x5e9cf3['user']=_0x41988e[_0x9c47('0x31')]=null;_0x5e9cf3['password']=_0x41988e[_0x9c47('0x34')]=null;}_0x5e9cf3['host']=_0x16a6fc[_0x9c47('0x3c')][_0x9c47('0x38')];_0x5e9cf3[_0x9c47('0x37')]=_0x16a6fc[_0x9c47('0x3c')][_0x9c47('0x37')];_0x41988e[_0x9c47('0x38')]=_0x16a6fc['Smtp'][_0x9c47('0x38')];_0x41988e[_0x9c47('0x37')]=_0x16a6fc[_0x9c47('0x3d')][_0x9c47('0x37')];}return{'Imap':_0x5e9cf3,'Smtp':_0x41988e};}exports[_0x9c47('0x3e')]=function(_0x336c69,_0x4472){var _0x53c2f6={'include':[{'model':db['MailServerIn'],'as':_0x9c47('0x3c')},{'model':db[_0x9c47('0x3f')],'as':'Smtp'},{'model':db['Pause'],'as':_0x9c47('0x40')}]},_0x5a8c7d={},_0x523f63={'count':0x0,'rows':[]};var _0x50547a=_[_0x9c47('0x41')](db['MailAccount'][_0x9c47('0x42')],function(_0x136f18){return{'name':_0x136f18[_0x9c47('0x43')],'type':_0x136f18[_0x9c47('0x44')][_0x9c47('0x45')]};});_0x5a8c7d[_0x9c47('0x46')]=_[_0x9c47('0x41')](_0x50547a,_0x9c47('0x47'));_0x5a8c7d[_0x9c47('0x48')]=_['keys'](_0x336c69[_0x9c47('0x48')]);_0x5a8c7d[_0x9c47('0x49')]=_['intersection'](_0x5a8c7d[_0x9c47('0x46')],_0x5a8c7d['query']);_0x53c2f6['attributes']=_[_0x9c47('0x4a')](_0x5a8c7d[_0x9c47('0x46')],qs[_0x9c47('0x4b')](_0x336c69['query']['fields']));_0x53c2f6[_0x9c47('0x4c')]=_0x53c2f6['attributes'][_0x9c47('0x4d')]?_0x53c2f6['attributes']:_0x5a8c7d[_0x9c47('0x46')];if(!_0x336c69[_0x9c47('0x48')][_0x9c47('0x4e')](_0x9c47('0x4f'))){_0x53c2f6['limit']=qs[_0x9c47('0x50')](_0x336c69[_0x9c47('0x48')]['limit']);_0x53c2f6[_0x9c47('0x1c')]=qs[_0x9c47('0x1c')](_0x336c69[_0x9c47('0x48')]['offset']);}_0x53c2f6[_0x9c47('0x51')]=qs[_0x9c47('0x52')](_0x336c69[_0x9c47('0x48')][_0x9c47('0x52')]);_0x53c2f6['where']=qs[_0x9c47('0x49')](_[_0x9c47('0x53')](_0x336c69[_0x9c47('0x48')],_0x5a8c7d['filters']),_0x50547a);if(_0x336c69[_0x9c47('0x48')][_0x9c47('0x54')]){_0x53c2f6['where']=_[_0x9c47('0x55')](_0x53c2f6[_0x9c47('0x56')],{'$or':_[_0x9c47('0x41')](_0x50547a,function(_0x231bfe){if(_0x231bfe[_0x9c47('0x44')]!==_0x9c47('0x57')){var _0x4f6258={};_0x4f6258[_0x231bfe[_0x9c47('0x47')]]={'$like':'%'+_0x336c69[_0x9c47('0x48')][_0x9c47('0x54')]+'%'};return _0x4f6258;}})});}_0x53c2f6=_[_0x9c47('0x55')]({},_0x53c2f6,_0x336c69[_0x9c47('0x58')]);var _0x901ec={'where':_0x53c2f6['where']};return db[_0x9c47('0x59')][_0x9c47('0x1e')](_0x901ec)[_0x9c47('0x22')](function(_0xa9b253){_0x523f63[_0x9c47('0x1e')]=_0xa9b253;if(_0x336c69[_0x9c47('0x48')][_0x9c47('0x5a')]){_0x53c2f6[_0x9c47('0x5b')]=[{'all':!![]}];}return db[_0x9c47('0x59')]['findAll'](_0x53c2f6);})['then'](function(_0x37dd3d){_0x523f63[_0x9c47('0x5c')]=_0x37dd3d;return _0x523f63;})[_0x9c47('0x22')](respondWithFilteredResult(_0x4472,_0x53c2f6))[_0x9c47('0x18')](handleError(_0x4472,null));};exports[_0x9c47('0x5d')]=function(_0x2f168b,_0x5b9351){var _0x2c5247={'raw':![],'where':{'id':_0x2f168b['params']['id']},'include':[{'model':db[_0x9c47('0x5e')],'as':_0x9c47('0x3c')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db['Pause'],'as':_0x9c47('0x40')}]},_0x443d67={};_0x443d67[_0x9c47('0x46')]=_[_0x9c47('0x5f')](db[_0x9c47('0x59')][_0x9c47('0x42')]);_0x443d67['query']=_[_0x9c47('0x5f')](_0x2f168b[_0x9c47('0x48')]);_0x443d67[_0x9c47('0x49')]=_[_0x9c47('0x4a')](_0x443d67[_0x9c47('0x46')],_0x443d67[_0x9c47('0x48')]);_0x2c5247[_0x9c47('0x4c')]=_['intersection'](_0x443d67[_0x9c47('0x46')],qs['fields'](_0x2f168b['query'][_0x9c47('0x4b')]));_0x2c5247['attributes']=_0x2c5247[_0x9c47('0x4c')][_0x9c47('0x4d')]?_0x2c5247[_0x9c47('0x4c')]:_0x443d67['model'];if(_0x2f168b[_0x9c47('0x48')][_0x9c47('0x5a')]){_0x2c5247[_0x9c47('0x5b')]=[{'all':!![]}];}_0x2c5247=_[_0x9c47('0x55')]({},_0x2c5247,_0x2f168b['options']);return db[_0x9c47('0x59')]['find'](_0x2c5247)[_0x9c47('0x22')](handleEntityNotFound(_0x5b9351,null))[_0x9c47('0x22')](respondWithResult(_0x5b9351,null))['catch'](handleError(_0x5b9351,null));};exports[_0x9c47('0x21')]=function(_0x27e423,_0x11745b){if(_0x27e423['body']['id']){delete _0x27e423[_0x9c47('0x60')]['id'];}var _0x13dc18=_0x27e423[_0x9c47('0x60')][_0x9c47('0x61')]===_0x9c47('0x62')?null:_0x27e423[_0x9c47('0x60')][_0x9c47('0x61')];var _0x538391=_0x27e423['body']['Imap']||{};var _0x17549f=_0x27e423[_0x9c47('0x60')]['Smtp']||{};if(_0x13dc18){_0x538391[_0x9c47('0x38')]=getImapHost(_0x13dc18);_0x538391[_0x9c47('0x37')]=0x3e1;_0x17549f[_0x9c47('0x38')]=getSmtpHost(_0x13dc18);_0x17549f[_0x9c47('0x37')]=0x24b;_0x17549f['secure']=![];}if(_0x17549f[_0x9c47('0x35')]){_0x17549f[_0x9c47('0x39')]=![];}else{_0x17549f[_0x9c47('0x36')]=null;}if(!_0x538391[_0x9c47('0x35')])_0x538391[_0x9c47('0x36')]=null;_0x27e423['body'][_0x9c47('0x3c')]=_0x538391;_0x27e423[_0x9c47('0x60')][_0x9c47('0x3d')]=_0x17549f;return db[_0x9c47('0x59')][_0x9c47('0x63')]({'where':{'id':_0x27e423[_0x9c47('0x64')]['id']},'include':[{'model':db[_0x9c47('0x5e')],'as':_0x9c47('0x3c')},{'model':db[_0x9c47('0x3f')],'as':'Smtp'},{'model':db[_0x9c47('0x65')],'as':_0x9c47('0x40')}]})[_0x9c47('0x22')](handleEntityNotFound(_0x11745b,null))[_0x9c47('0x22')](function(_0x5b4806){if(!_0x5b4806)throw new Error('Mail\x20Account\x20not\x20found');if(_0x5b4806['service'])delete _0x27e423[_0x9c47('0x60')][_0x9c47('0x3c')];return _0x5b4806;})['then'](saveUpdates(_0x27e423[_0x9c47('0x60')],null))[_0x9c47('0x22')](function(_0x2107ea){if(!_0x27e423['body'][_0x9c47('0x3c')])return _0x2107ea;return db['MailServerIn'][_0x9c47('0x21')](_0x27e423[_0x9c47('0x60')]['Imap'],{'where':{'MailAccountId':_0x2107ea['id']}})[_0x9c47('0x22')](function(){return _0x2107ea;});})['then'](function(_0x503116){if(!_0x27e423['body'][_0x9c47('0x3d')])return _0x503116;return db[_0x9c47('0x3f')]['update'](_0x27e423[_0x9c47('0x60')][_0x9c47('0x3d')],{'where':{'MailAccountId':_0x503116['id']}})[_0x9c47('0x22')](function(){return _0x503116;});})[_0x9c47('0x22')](respondWithResult(_0x11745b,null))[_0x9c47('0x18')](handleError(_0x11745b,null));};exports[_0x9c47('0x66')]=function(_0xaba2f2,_0x5bb888){return db['MailAccount']['describe']()['then'](respondWithResult(_0x5bb888,null))[_0x9c47('0x18')](handleError(_0x5bb888,null));};exports['addDisposition']=function(_0x116891,_0x1c5054){if(_0x116891[_0x9c47('0x60')]['id']){delete _0x116891['body']['id'];}return db[_0x9c47('0x59')][_0x9c47('0x63')]({'where':{'id':_0x116891['params']['id']}})['then'](handleEntityNotFound(_0x1c5054,null))['then'](function(_0x220b47){if(_0x220b47){_0x116891[_0x9c47('0x60')][_0x9c47('0x67')]=_0x220b47['id'];return db[_0x9c47('0x68')][_0x9c47('0x69')](_0x116891[_0x9c47('0x60')]);}})[_0x9c47('0x22')](respondWithResult(_0x1c5054,null))[_0x9c47('0x18')](handleError(_0x1c5054,null));};exports[_0x9c47('0x6a')]=function(_0x5a0360,_0x4d06c5){var _0x279608={'raw':![],'where':{}};var _0x3b3b26={};var _0x100666={'count':0x0,'rows':[]};return db[_0x9c47('0x59')][_0x9c47('0x6b')]({'where':{'id':_0x5a0360[_0x9c47('0x64')]['id']}})[_0x9c47('0x22')](handleEntityNotFound(_0x4d06c5,null))[_0x9c47('0x22')](function(_0x472466){if(_0x472466){_0x3b3b26[_0x9c47('0x46')]=_[_0x9c47('0x5f')](db['Disposition']['rawAttributes']);_0x3b3b26[_0x9c47('0x48')]=_[_0x9c47('0x5f')](_0x5a0360['query']);_0x3b3b26['filters']=_[_0x9c47('0x4a')](_0x3b3b26['model'],_0x3b3b26[_0x9c47('0x48')]);_0x279608[_0x9c47('0x4c')]=_[_0x9c47('0x4a')](_0x3b3b26[_0x9c47('0x46')],qs[_0x9c47('0x4b')](_0x5a0360['query'][_0x9c47('0x4b')]));_0x279608[_0x9c47('0x4c')]=_0x279608[_0x9c47('0x4c')][_0x9c47('0x4d')]?_0x279608[_0x9c47('0x4c')]:_0x3b3b26[_0x9c47('0x46')];if(!_0x5a0360['query'][_0x9c47('0x4e')](_0x9c47('0x4f'))){_0x279608[_0x9c47('0x50')]=qs[_0x9c47('0x50')](_0x5a0360[_0x9c47('0x48')][_0x9c47('0x50')]);_0x279608[_0x9c47('0x1c')]=qs[_0x9c47('0x1c')](_0x5a0360['query']['offset']);}_0x279608[_0x9c47('0x51')]=qs[_0x9c47('0x52')](_0x5a0360['query'][_0x9c47('0x52')]);_0x279608[_0x9c47('0x56')]=qs[_0x9c47('0x49')](_[_0x9c47('0x53')](_0x5a0360['query'],_0x3b3b26[_0x9c47('0x49')]));_0x279608[_0x9c47('0x56')][_0x9c47('0x67')]=_0x472466['id'];if(_0x5a0360[_0x9c47('0x48')]['filter']){_0x279608[_0x9c47('0x56')]=_[_0x9c47('0x55')](_0x279608['where'],{'$or':_[_0x9c47('0x41')](_0x279608[_0x9c47('0x4c')],function(_0x3844ff){var _0x3258d8={};_0x3258d8[_0x3844ff]={'$like':'%'+_0x5a0360[_0x9c47('0x48')]['filter']+'%'};return _0x3258d8;})});}_0x279608=_['merge']({},_0x279608,_0x5a0360[_0x9c47('0x58')]);return db[_0x9c47('0x68')][_0x9c47('0x1e')]({'where':_0x279608[_0x9c47('0x56')]})['then'](function(_0x227d5c){_0x100666[_0x9c47('0x1e')]=_0x227d5c;if(_0x5a0360[_0x9c47('0x48')][_0x9c47('0x5a')]){_0x279608[_0x9c47('0x5b')]=[{'all':!![]}];}return db[_0x9c47('0x68')][_0x9c47('0x6c')](_0x279608);})[_0x9c47('0x22')](function(_0x47a8f9){_0x100666['rows']=_0x47a8f9;return _0x100666;});}})[_0x9c47('0x22')](respondWithFilteredResult(_0x4d06c5,_0x279608))[_0x9c47('0x18')](handleError(_0x4d06c5,null));};exports['removeDispositions']=function(_0x42823a,_0x277bab){return db[_0x9c47('0x59')][_0x9c47('0x63')]({'where':{'id':_0x42823a[_0x9c47('0x64')]['id']}})[_0x9c47('0x22')](handleEntityNotFound(_0x277bab,null))[_0x9c47('0x22')](function(_0x5ccbe0){if(_0x5ccbe0){return _0x5ccbe0[_0x9c47('0x6d')](_0x42823a[_0x9c47('0x48')][_0x9c47('0x6e')]);}})[_0x9c47('0x22')](respondWithStatusCode(_0x277bab,null))[_0x9c47('0x18')](handleError(_0x277bab,null));};exports[_0x9c47('0x6f')]=function(_0x45deb3,_0x1ea2a5){if(_0x45deb3[_0x9c47('0x60')]['id']){delete _0x45deb3[_0x9c47('0x60')]['id'];}return db['MailAccount'][_0x9c47('0x63')]({'where':{'id':_0x45deb3[_0x9c47('0x64')]['id']}})[_0x9c47('0x22')](handleEntityNotFound(_0x1ea2a5,null))[_0x9c47('0x22')](function(_0x225b63){if(_0x225b63){_0x45deb3[_0x9c47('0x60')]['MailAccountId']=_0x225b63['id'];return db[_0x9c47('0x70')]['create'](_0x45deb3['body']);}})[_0x9c47('0x22')](respondWithResult(_0x1ea2a5,null))['catch'](handleError(_0x1ea2a5,null));};exports['getAnswers']=function(_0x192ab3,_0x3de2c2){var _0x2f5b6a={'raw':![],'where':{}};var _0x380971={};var _0x529c84={'count':0x0,'rows':[]};return db[_0x9c47('0x59')][_0x9c47('0x6b')]({'where':{'id':_0x192ab3['params']['id']}})[_0x9c47('0x22')](handleEntityNotFound(_0x3de2c2,null))[_0x9c47('0x22')](function(_0x1b015d){if(_0x1b015d){_0x380971['model']=_[_0x9c47('0x5f')](db[_0x9c47('0x70')]['rawAttributes']);_0x380971[_0x9c47('0x48')]=_['keys'](_0x192ab3['query']);_0x380971['filters']=_['intersection'](_0x380971['model'],_0x380971[_0x9c47('0x48')]);_0x2f5b6a[_0x9c47('0x4c')]=_[_0x9c47('0x4a')](_0x380971[_0x9c47('0x46')],qs['fields'](_0x192ab3[_0x9c47('0x48')][_0x9c47('0x4b')]));_0x2f5b6a[_0x9c47('0x4c')]=_0x2f5b6a[_0x9c47('0x4c')]['length']?_0x2f5b6a[_0x9c47('0x4c')]:_0x380971[_0x9c47('0x46')];if(!_0x192ab3[_0x9c47('0x48')][_0x9c47('0x4e')](_0x9c47('0x4f'))){_0x2f5b6a['limit']=qs[_0x9c47('0x50')](_0x192ab3[_0x9c47('0x48')][_0x9c47('0x50')]);_0x2f5b6a['offset']=qs[_0x9c47('0x1c')](_0x192ab3[_0x9c47('0x48')][_0x9c47('0x1c')]);}_0x2f5b6a['order']=qs[_0x9c47('0x52')](_0x192ab3[_0x9c47('0x48')]['sort']);_0x2f5b6a['where']=qs['filters'](_[_0x9c47('0x53')](_0x192ab3[_0x9c47('0x48')],_0x380971['filters']));_0x2f5b6a['where'][_0x9c47('0x67')]=_0x1b015d['id'];if(_0x192ab3[_0x9c47('0x48')][_0x9c47('0x54')]){_0x2f5b6a[_0x9c47('0x56')]=_[_0x9c47('0x55')](_0x2f5b6a['where'],{'$or':_[_0x9c47('0x41')](_0x2f5b6a['attributes'],function(_0xdccdb1){var _0xc8900={};_0xc8900[_0xdccdb1]={'$like':'%'+_0x192ab3[_0x9c47('0x48')][_0x9c47('0x54')]+'%'};return _0xc8900;})});}_0x2f5b6a=_[_0x9c47('0x55')]({},_0x2f5b6a,_0x192ab3[_0x9c47('0x58')]);return db[_0x9c47('0x70')]['count']({'where':_0x2f5b6a[_0x9c47('0x56')]})['then'](function(_0x207e0a){_0x529c84[_0x9c47('0x1e')]=_0x207e0a;if(_0x192ab3[_0x9c47('0x48')][_0x9c47('0x5a')]){_0x2f5b6a['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x9c47('0x6c')](_0x2f5b6a);})[_0x9c47('0x22')](function(_0x48d45f){_0x529c84[_0x9c47('0x5c')]=_0x48d45f;return _0x529c84;});}})[_0x9c47('0x22')](respondWithFilteredResult(_0x3de2c2,_0x2f5b6a))[_0x9c47('0x18')](handleError(_0x3de2c2,null));};exports[_0x9c47('0x71')]=function(_0x215d86,_0x551282){return db['MailAccount'][_0x9c47('0x63')]({'where':{'id':_0x215d86[_0x9c47('0x64')]['id']}})[_0x9c47('0x22')](handleEntityNotFound(_0x551282,null))[_0x9c47('0x22')](function(_0x2db326){if(_0x2db326){return _0x2db326['removeAnswers'](_0x215d86[_0x9c47('0x48')][_0x9c47('0x6e')]);}})['then'](respondWithStatusCode(_0x551282,null))[_0x9c47('0x18')](handleError(_0x551282,null));};exports[_0x9c47('0x69')]=function(_0x1b8eb3,_0x217d14){var _0x3cba9f={'name':_0x1b8eb3['body']['name'],'key':_0x1b8eb3[_0x9c47('0x60')][_0x9c47('0x45')],'provider':_0x1b8eb3[_0x9c47('0x60')][_0x9c47('0x61')]==='custom'?null:_0x1b8eb3['body']['provider'],'email':_0x1b8eb3[_0x9c47('0x60')][_0x9c47('0x72')],'ListId':_0x1b8eb3[_0x9c47('0x60')][_0x9c47('0x73')],'active':!_['isNil'](_0x1b8eb3[_0x9c47('0x60')]['active'])?_0x1b8eb3[_0x9c47('0x60')][_0x9c47('0x74')]:!![],'description':_0x1b8eb3[_0x9c47('0x60')][_0x9c47('0x75')]||null};var _0x218268=getAuthenticationOptions(_0x3cba9f[_0x9c47('0x61')],_0x1b8eb3['body']);_0x3cba9f['Imap']=_0x218268[_0x9c47('0x3c')];_0x3cba9f['Smtp']=_0x218268[_0x9c47('0x3d')];return db[_0x9c47('0x59')][_0x9c47('0x69')](_0x3cba9f,{'include':[{'model':db[_0x9c47('0x3f')],'as':'Smtp'},{'model':db[_0x9c47('0x5e')],'as':_0x9c47('0x3c')}]})[_0x9c47('0x22')](function(_0x1fa99b){var _0x2695d5=_0x1b8eb3[_0x9c47('0x31')][_0x9c47('0x24')]({'plain':!![]});if(!_0x2695d5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2695d5[_0x9c47('0x76')]==='user'){var _0x27e248=_0x1fa99b[_0x9c47('0x24')]({'plain':!![]});return db[_0x9c47('0x77')]['find']({'where':{'name':_0x9c47('0x78'),'userProfileId':_0x2695d5[_0x9c47('0x79')]},'raw':!![]})['then'](function(_0x954b26){if(_0x954b26&&_0x954b26[_0x9c47('0x7a')]===0x0){return db['UserProfileResource']['create']({'name':_0x27e248[_0x9c47('0x47')],'resourceId':_0x27e248['id'],'type':_0x954b26['name'],'sectionId':_0x954b26['id']},{})[_0x9c47('0x22')](function(){return _0x1fa99b;});}else{return _0x1fa99b;}})[_0x9c47('0x18')](function(_0x17f005){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x17f005);throw _0x17f005;});}return _0x1fa99b;})['then'](respondWithResult(_0x217d14,0xc9))[_0x9c47('0x18')](handleError(_0x217d14,null));};exports['getImap']=function(_0x1a2d82,_0x15f3b1){return db[_0x9c47('0x59')][_0x9c47('0x6b')]({'where':{'id':_0x1a2d82['params']['id']}})[_0x9c47('0x22')](handleEntityNotFound(_0x15f3b1,null))[_0x9c47('0x22')](function(_0x55582b){if(_0x55582b){return _0x55582b['getImap']();}return null;})[_0x9c47('0x22')](respondWithResult(_0x15f3b1,null))[_0x9c47('0x18')](handleError(_0x15f3b1,null));};exports[_0x9c47('0x7b')]=function(_0x13dd71,_0x161ab4){if(_0x13dd71[_0x9c47('0x60')]['id']){delete _0x13dd71[_0x9c47('0x60')]['id'];}return db['MailAccount'][_0x9c47('0x63')]({'where':{'id':_0x13dd71['params']['id']}})[_0x9c47('0x22')](handleEntityNotFound(_0x161ab4,null))[_0x9c47('0x22')](function(_0x3d2ba7){if(_0x3d2ba7){_0x13dd71[_0x9c47('0x60')]['MailAccountId']=_0x3d2ba7['id'];return db[_0x9c47('0x5e')]['create'](_0x13dd71[_0x9c47('0x60')]);}})[_0x9c47('0x22')](respondWithResult(_0x161ab4,null))[_0x9c47('0x18')](handleError(_0x161ab4,null));};exports['removeImap']=function(_0xf7b0cd,_0x332ce7){return db[_0x9c47('0x59')][_0x9c47('0x6b')]({'where':{'id':_0xf7b0cd[_0x9c47('0x64')]['id']}})['then'](handleEntityNotFound(_0x332ce7,null))[_0x9c47('0x22')](function(_0x30feef){if(_0x30feef){return _0x30feef['setImap'](null);}return null;})[_0x9c47('0x22')](respondWithStatusCode(_0x332ce7,null))[_0x9c47('0x18')](handleError(_0x332ce7,null));};exports[_0x9c47('0x7c')]=function(_0x4161e0,_0x431cff){return db[_0x9c47('0x59')][_0x9c47('0x6b')]({'where':{'id':_0x4161e0[_0x9c47('0x64')]['id']}})[_0x9c47('0x22')](handleEntityNotFound(_0x431cff,null))[_0x9c47('0x22')](function(_0x1004fc){if(_0x1004fc){return _0x1004fc[_0x9c47('0x7c')]();}return null;})['then'](respondWithResult(_0x431cff,null))[_0x9c47('0x18')](handleError(_0x431cff,null));};exports[_0x9c47('0x7d')]=function(_0x3920f7,_0xd6acb8){if(_0x3920f7['body']['id']){delete _0x3920f7[_0x9c47('0x60')]['id'];}return db[_0x9c47('0x59')][_0x9c47('0x63')]({'where':{'id':_0x3920f7[_0x9c47('0x64')]['id']}})[_0x9c47('0x22')](handleEntityNotFound(_0xd6acb8,null))[_0x9c47('0x22')](function(_0x5db4e8){if(_0x5db4e8){_0x3920f7[_0x9c47('0x60')][_0x9c47('0x67')]=_0x5db4e8['id'];return db[_0x9c47('0x3f')][_0x9c47('0x69')](_0x3920f7[_0x9c47('0x60')]);}})[_0x9c47('0x22')](respondWithResult(_0xd6acb8,null))['catch'](handleError(_0xd6acb8,null));};exports[_0x9c47('0x7e')]=function(_0x21c222,_0x3851fa){return db['MailAccount'][_0x9c47('0x6b')]({'where':{'id':_0x21c222[_0x9c47('0x64')]['id']}})[_0x9c47('0x22')](handleEntityNotFound(_0x3851fa,null))['then'](function(_0x2a75ea){if(_0x2a75ea){return _0x2a75ea['setSmtp'](null);}return null;})['then'](respondWithStatusCode(_0x3851fa,null))['catch'](handleError(_0x3851fa,null));};exports['addInteraction']=function(_0x3134f8,_0x1a1101){return db['MailInteraction'][_0x9c47('0x63')]({'where':{'id':_0x3134f8[_0x9c47('0x64')]['id']}})[_0x9c47('0x22')](handleEntityNotFound(_0x1a1101,null))[_0x9c47('0x22')](function(_0xf39181){if(_0xf39181){return _0xf39181[_0x9c47('0x7f')](_0x3134f8['body'][_0x9c47('0x6e')],_[_0x9c47('0x80')](_0x3134f8[_0x9c47('0x60')],[_0x9c47('0x6e'),'id'])||{});}})[_0x9c47('0x22')](respondWithResult(_0x1a1101,null))[_0x9c47('0x18')](handleError(_0x1a1101,null));};exports[_0x9c47('0x81')]=function(_0x47e47d,_0x39fd01){var _0x4b16e0={'raw':![],'where':{}};var _0x176cc6={};var _0x2163bd={'count':0x0,'rows':[]};return db[_0x9c47('0x59')][_0x9c47('0x6b')]({'where':{'id':_0x47e47d[_0x9c47('0x64')]['id']}})[_0x9c47('0x22')](handleEntityNotFound(_0x39fd01,null))[_0x9c47('0x22')](function(_0x27d72c){if(_0x27d72c){_0x176cc6[_0x9c47('0x46')]=_[_0x9c47('0x5f')](db[_0x9c47('0x82')][_0x9c47('0x42')]);_0x176cc6[_0x9c47('0x48')]=_['keys'](_0x47e47d[_0x9c47('0x48')]);_0x176cc6[_0x9c47('0x49')]=_[_0x9c47('0x4a')](_0x176cc6[_0x9c47('0x46')],_0x176cc6[_0x9c47('0x48')]);_0x4b16e0[_0x9c47('0x4c')]=_[_0x9c47('0x4a')](_0x176cc6[_0x9c47('0x46')],qs[_0x9c47('0x4b')](_0x47e47d[_0x9c47('0x48')]['fields']));_0x4b16e0[_0x9c47('0x4c')]=_0x4b16e0[_0x9c47('0x4c')][_0x9c47('0x4d')]?_0x4b16e0['attributes']:_0x176cc6[_0x9c47('0x46')];if(!_0x47e47d['query'][_0x9c47('0x4e')]('nolimit')){_0x4b16e0['limit']=qs['limit'](_0x47e47d[_0x9c47('0x48')][_0x9c47('0x50')]);_0x4b16e0[_0x9c47('0x1c')]=qs[_0x9c47('0x1c')](_0x47e47d['query']['offset']);}_0x4b16e0['order']=qs[_0x9c47('0x52')](_0x47e47d[_0x9c47('0x48')][_0x9c47('0x52')]);_0x4b16e0['where']=qs[_0x9c47('0x49')](_[_0x9c47('0x53')](_0x47e47d[_0x9c47('0x48')],_0x176cc6[_0x9c47('0x49')]));_0x4b16e0[_0x9c47('0x56')][_0x9c47('0x67')]=_0x27d72c['id'];if(_0x47e47d[_0x9c47('0x48')][_0x9c47('0x54')]){_0x4b16e0[_0x9c47('0x56')]=_['merge'](_0x4b16e0[_0x9c47('0x56')],{'$or':_[_0x9c47('0x41')](_0x4b16e0[_0x9c47('0x4c')],function(_0x2e4485){var _0x3d7865={};_0x3d7865[_0x2e4485]={'$like':'%'+_0x47e47d[_0x9c47('0x48')]['filter']+'%'};return _0x3d7865;})});}_0x4b16e0=_['merge']({},_0x4b16e0,_0x47e47d[_0x9c47('0x58')]);return db[_0x9c47('0x82')]['count']({'where':_0x4b16e0[_0x9c47('0x56')]})[_0x9c47('0x22')](function(_0x22bb72){_0x2163bd[_0x9c47('0x1e')]=_0x22bb72;if(_0x47e47d[_0x9c47('0x48')][_0x9c47('0x5a')]){_0x4b16e0['include']=[{'model':db[_0x9c47('0x83')],'as':'Contact','required':![]},{'model':db[_0x9c47('0x84')],'as':_0x9c47('0x85'),'attributes':[_0x9c47('0x47'),_0x9c47('0x86'),_0x9c47('0x87')],'required':![]},{'model':db[_0x9c47('0x88')],'as':_0x9c47('0x89'),'attributes':['id',_0x9c47('0x47'),_0x9c47('0x8a')],'where':_0x47e47d[_0x9c47('0x48')][_0x9c47('0x8b')]?{'id':_0x47e47d['query'][_0x9c47('0x8b')]}:undefined,'required':_0x47e47d[_0x9c47('0x48')][_0x9c47('0x8b')]?!![]:![]}];}return db['MailInteraction'][_0x9c47('0x6c')](_0x4b16e0);})[_0x9c47('0x22')](function(_0x156961){_0x2163bd[_0x9c47('0x5c')]=_0x156961;return _0x2163bd;});}})[_0x9c47('0x22')](respondWithFilteredResult(_0x39fd01,_0x4b16e0))[_0x9c47('0x18')](handleError(_0x39fd01,null));};exports[_0x9c47('0x8c')]=function addApplications(_0x2beeb3,_0x59f19c){var _0x23f7f2=_0x2beeb3[_0x9c47('0x64')]['id'];var _0x4e6220=_0x2beeb3[_0x9c47('0x60')];var _0x1fe74f=0xc8;var _0x2ad31a=null;return db['sequelize'][_0x9c47('0x8d')]({'isolationLevel':db[_0x9c47('0x8e')][_0x9c47('0x8f')]['ISOLATION_LEVELS'][_0x9c47('0x90')]},function(_0x30adda){return db[_0x9c47('0x59')][_0x9c47('0x6b')]({'where':{'id':_0x23f7f2},'transaction':_0x30adda})['then'](function(_0x2fae4e){if(_0x2fae4e){return db['MailApplication'][_0x9c47('0x23')]({'where':{'MailAccountId':_0x23f7f2},'transaction':_0x30adda})[_0x9c47('0x22')](function(){var _0x1767b4=_[_0x9c47('0x41')](_0x4e6220,function(_0x298630){_0x298630[_0x9c47('0x67')]=_0x23f7f2;return _0x298630;});return db[_0x9c47('0x91')][_0x9c47('0x92')](_0x1767b4,{'transaction':_0x30adda});});}else{_0x1fe74f=0x194;_0x2ad31a=[];}});})[_0x9c47('0x22')](function(){if(_0x1fe74f!==0x194){return db[_0x9c47('0x91')]['findAndCountAll']({'where':{'MailAccountId':_0x23f7f2},'order':_0x9c47('0x93')})[_0x9c47('0x22')](function(_0x558904){_0x2ad31a=_0x558904;});}})[_0x9c47('0x18')](function(_0x554555){_0x1fe74f=0x1f4;logger[_0x9c47('0x15')](_0x554555['stack']);if(_0x554555[_0x9c47('0x47')]){delete _0x554555[_0x9c47('0x47')];}_0x2ad31a=_0x554555;})[_0x9c47('0x94')](function(){if(_0x2ad31a===null){_0x59f19c[_0x9c47('0x19')](_0x1fe74f);}else{if(_0x1fe74f===0x1f4){_0x59f19c[_0x9c47('0x1a')](_0x1fe74f)[_0x9c47('0x27')](_0x2ad31a);}else{_0x59f19c[_0x9c47('0x1a')](_0x1fe74f)['json'](_0x2ad31a);}}});};exports[_0x9c47('0x95')]=function(_0x27d71f,_0x5a10f2){var _0x4ec7ca={};var _0x386578={};var _0xf837b5;var _0x544b0b;return db[_0x9c47('0x59')][_0x9c47('0x6b')]({'where':{'id':_0x27d71f[_0x9c47('0x64')]['id']}})[_0x9c47('0x22')](handleEntityNotFound(_0x5a10f2,null))[_0x9c47('0x22')](function(_0x187fb4){if(_0x187fb4){_0xf837b5=_0x187fb4;_0x386578[_0x9c47('0x46')]=_[_0x9c47('0x5f')](db[_0x9c47('0x91')][_0x9c47('0x42')]);_0x386578['query']=_[_0x9c47('0x5f')](_0x27d71f[_0x9c47('0x48')]);_0x386578[_0x9c47('0x49')]=_[_0x9c47('0x4a')](_0x386578[_0x9c47('0x46')],_0x386578['query']);_0x4ec7ca[_0x9c47('0x4c')]=_[_0x9c47('0x4a')](_0x386578['model'],qs[_0x9c47('0x4b')](_0x27d71f[_0x9c47('0x48')][_0x9c47('0x4b')]));_0x4ec7ca[_0x9c47('0x4c')]=_0x4ec7ca[_0x9c47('0x4c')][_0x9c47('0x4d')]?_0x4ec7ca[_0x9c47('0x4c')]:_0x386578[_0x9c47('0x46')];_0x4ec7ca[_0x9c47('0x51')]=qs[_0x9c47('0x52')](_0x27d71f[_0x9c47('0x48')]['sort']);_0x4ec7ca[_0x9c47('0x56')]=qs['filters'](_[_0x9c47('0x53')](_0x27d71f['query'],_0x386578[_0x9c47('0x49')]));if(_0x27d71f['query'][_0x9c47('0x54')]){_0x4ec7ca[_0x9c47('0x56')]=_[_0x9c47('0x55')](_0x4ec7ca[_0x9c47('0x56')],{'$or':_[_0x9c47('0x41')](_0x4ec7ca[_0x9c47('0x4c')],function(_0x34a2f5){var _0x2dc77b={};_0x2dc77b[_0x34a2f5]={'$like':'%'+_0x27d71f['query'][_0x9c47('0x54')]+'%'};return _0x2dc77b;})});}_0x4ec7ca=_[_0x9c47('0x55')]({},_0x4ec7ca,_0x27d71f[_0x9c47('0x58')]);return _0xf837b5[_0x9c47('0x95')](_0x4ec7ca);}})[_0x9c47('0x22')](function(_0x283c5b){if(_0x283c5b){_0x544b0b=_0x283c5b['length'];if(!_0x27d71f[_0x9c47('0x48')][_0x9c47('0x4e')](_0x9c47('0x4f'))){_0x4ec7ca[_0x9c47('0x50')]=qs['limit'](_0x27d71f[_0x9c47('0x48')]['limit']);_0x4ec7ca[_0x9c47('0x1c')]=qs[_0x9c47('0x1c')](_0x27d71f['query'][_0x9c47('0x1c')]);}return _0xf837b5[_0x9c47('0x95')](_0x4ec7ca);}})[_0x9c47('0x22')](function(_0xbffb58){if(_0xbffb58){return _0xbffb58?{'count':_0x544b0b,'rows':_0xbffb58}:null;}})['then'](respondWithResult(_0x5a10f2,null))['catch'](handleError(_0x5a10f2,null));};exports[_0x9c47('0x96')]=function(_0x36013e,_0x481b3a){var _0x35f218={'raw':!![],'where':{}};var _0x1b2149={};var _0x14899c={'count':0x0,'rows':[]};return db[_0x9c47('0x59')][_0x9c47('0x6b')]({'where':{'id':_0x36013e[_0x9c47('0x64')]['id']}})[_0x9c47('0x22')](handleEntityNotFound(_0x481b3a,null))['then'](function(_0x4c676f){if(_0x4c676f){_0x1b2149['model']=_['keys'](db[_0x9c47('0x97')][_0x9c47('0x42')]);_0x1b2149['query']=_['keys'](_0x36013e[_0x9c47('0x48')]);_0x1b2149[_0x9c47('0x49')]=_[_0x9c47('0x4a')](_0x1b2149[_0x9c47('0x46')],_0x1b2149[_0x9c47('0x48')]);_0x35f218[_0x9c47('0x4c')]=_[_0x9c47('0x4a')](_0x1b2149[_0x9c47('0x46')],qs[_0x9c47('0x4b')](_0x36013e[_0x9c47('0x48')][_0x9c47('0x4b')]));_0x35f218[_0x9c47('0x4c')]=_0x35f218['attributes'][_0x9c47('0x4d')]?_0x35f218['attributes']:_0x1b2149['model'];if(!_0x36013e['query'][_0x9c47('0x4e')](_0x9c47('0x4f'))){_0x35f218['limit']=qs[_0x9c47('0x50')](_0x36013e[_0x9c47('0x48')][_0x9c47('0x50')]);_0x35f218[_0x9c47('0x1c')]=qs['offset'](_0x36013e[_0x9c47('0x48')][_0x9c47('0x1c')]);}_0x35f218[_0x9c47('0x51')]=qs[_0x9c47('0x52')](_0x36013e[_0x9c47('0x48')][_0x9c47('0x52')]);_0x35f218[_0x9c47('0x56')]=qs['filters'](_[_0x9c47('0x53')](_0x36013e[_0x9c47('0x48')],_0x1b2149[_0x9c47('0x49')]));_0x35f218['where'][_0x9c47('0x67')]=_0x4c676f['id'];if(_0x36013e[_0x9c47('0x48')][_0x9c47('0x54')]){_0x35f218[_0x9c47('0x56')]=_[_0x9c47('0x55')](_0x35f218[_0x9c47('0x56')],{'$or':_[_0x9c47('0x41')](_0x35f218[_0x9c47('0x4c')],function(_0x2d1577){var _0xfc9542={};_0xfc9542[_0x2d1577]={'$like':'%'+_0x36013e[_0x9c47('0x48')][_0x9c47('0x54')]+'%'};return _0xfc9542;})});}if(_0x36013e['query']['$gte']){var _0x4b28c1=_0x36013e['query'][_0x9c47('0x98')][_0x9c47('0x99')](',');var _0x2c9deb={};_0x2c9deb[_0x4b28c1[0x0]]={'$gte':moment(_0x4b28c1[0x1])[_0x9c47('0x9a')](_0x9c47('0x9b'))};_0x35f218['where']=_[_0x9c47('0x55')](_0x35f218[_0x9c47('0x56')],_0x2c9deb);}_0x35f218=_[_0x9c47('0x55')]({},_0x35f218,_0x36013e['options']);return db['MailMessage'][_0x9c47('0x1e')]({'where':_0x35f218[_0x9c47('0x56')]})[_0x9c47('0x22')](function(_0x2ab9dd){_0x14899c['count']=_0x2ab9dd;if(_0x36013e[_0x9c47('0x48')][_0x9c47('0x5a')]){_0x35f218[_0x9c47('0x5b')]=[{'all':!![]}];}return db[_0x9c47('0x97')]['findAll'](_0x35f218);})[_0x9c47('0x22')](function(_0x26d790){if(_0x36013e[_0x9c47('0x48')][_0x9c47('0x9c')]===_0x9c47('0x9d')){for(var _0xa3f2f0=0x0;_0xa3f2f0<_0x26d790['length'];_0xa3f2f0++){_0x26d790[_0xa3f2f0][_0x9c47('0x60')]=juice(_0x26d790[_0xa3f2f0][_0x9c47('0x60')]);}}_0x14899c[_0x9c47('0x5c')]=_0x26d790;return _0x14899c;});}})[_0x9c47('0x22')](respondWithFilteredResult(_0x481b3a,_0x35f218))[_0x9c47('0x18')](handleError(_0x481b3a,null));};exports['send']=function(_0x4387db,_0x144462){var _0x4bac36,_0x55ac76={},_0x49295f;if(_0x4387db[_0x9c47('0x60')]['to']){_0x49295f=_0x4387db['body']['to'][_0x9c47('0x99')](',')[0x0];}return db[_0x9c47('0x59')][_0x9c47('0x63')]({'where':{'id':_0x4387db[_0x9c47('0x64')]['id']},'include':[{'model':db[_0x9c47('0x9e')],'as':_0x9c47('0x9f'),'include':[{'model':db['CmContact'],'as':_0x9c47('0xa0'),'where':{'email':_0x49295f},'limit':0x1,'order':[[_0x9c47('0xa1'),_0x9c47('0xa2')]]}]},{'model':db['MailServerOut'],'as':_0x9c47('0x3d'),'raw':!![],'include':[{'model':db[_0x9c47('0xa3')],'as':_0x9c47('0xa3'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x144462,null))['then'](function(_0xf53b9){if(!_0xf53b9)return;_0x4bac36=_0xf53b9;if(!_0xf53b9[_0x9c47('0x3d')])throw new Error(_0x9c47('0xa4'));if(_[_0x9c47('0xa5')](_0x4387db[_0x9c47('0x60')]['from'])){_0x4387db[_0x9c47('0x60')][_0x9c47('0xa6')]=util[_0x9c47('0x9a')]('%s\x20<%s>',_0xf53b9[_0x9c47('0x47')],_0xf53b9[_0x9c47('0x72')]||_0xf53b9[_0x9c47('0x3d')]['user']);}if(_0x4387db[_0x9c47('0x60')][_0x9c47('0xa7')]&&_0x4387db['body'][_0x9c47('0xa7')][_0x9c47('0x4d')]){for(var _0xea06c2=0x0;_0xea06c2<_0x4387db[_0x9c47('0x60')][_0x9c47('0xa7')]['length'];_0xea06c2+=0x1){_0x4387db[_0x9c47('0x60')][_0x9c47('0xa7')][_0xea06c2]={'filename':_0x4387db[_0x9c47('0x60')][_0x9c47('0xa7')][_0xea06c2]['name'],'path':path['join'](config[_0x9c47('0xa8')],_0x9c47('0xa9'),_0x4387db[_0x9c47('0x60')][_0x9c47('0xa7')][_0xea06c2][_0x9c47('0xaa')])};}}var _0x5b8da9=_0xf53b9[_0x9c47('0xab')]();return respondWithRpcPromise('SendMail',_0x9c47('0xac'),{'account':_0x5b8da9,'message':_0x4387db['body']});})[_0x9c47('0x22')](function(_0x2c435c){if(!_0x2c435c)return;_0x55ac76=_0x2c435c;if(!_0x4bac36[_0x9c47('0x9f')])throw new Error(_0x9c47('0xad'));if(_0x4bac36['List']['Contacts']['length'])return _0x4bac36['List']['Contacts'][0x0];return db[_0x9c47('0x83')][_0x9c47('0x69')](_[_0x9c47('0x9')](_0x4387db[_0x9c47('0x60')],{'firstName':_0x4387db[_0x9c47('0x60')]['to'],'email':_0x4387db[_0x9c47('0x60')]['to'],'phone':_0x4387db[_0x9c47('0x60')]['to'],'ListId':_0x4bac36[_0x9c47('0x73')]}));})['then'](function(_0x35f6fc){if(!_0x35f6fc)return;var _0x425eba={'UserId':_0x4387db[_0x9c47('0x31')]['id'],'ContactId':_0x35f6fc['id'],'MailAccountId':_0x4bac36['id'],'inReplyTo':_0x55ac76[_0x9c47('0xae')],'to':_0x4387db[_0x9c47('0x60')][_0x9c47('0xa6')],'cc':_0x4387db[_0x9c47('0x60')]['cc'],'subject':_0x4387db[_0x9c47('0x60')][_0x9c47('0xaf')],'attach':_0x4387db[_0x9c47('0x60')][_0x9c47('0xb0')],'firstMsgDirection':_0x9c47('0xb1'),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x9c47('0xb1'),'Messages':[_[_0x9c47('0x55')](_0x4387db['body'],{'messageId':_0x55ac76[_0x9c47('0xae')],'sentAt':moment()[_0x9c47('0x9a')](_0x9c47('0x9b')),'read':!![],'MailAccountId':_0x4bac36['id'],'UserId':_0x4387db[_0x9c47('0x31')]['id'],'ContactId':_0x35f6fc['id']})]};if(_0x4387db['body'][_0x9c47('0xb2')]){_0x425eba=_[_0x9c47('0x55')](_0x425eba,_0x4387db['body'][_0x9c47('0xb2')]);}return db[_0x9c47('0x82')][_0x9c47('0x69')](_0x425eba,{'include':[{'model':db['MailMessage'],'as':'Messages'}]});})[_0x9c47('0x22')](respondWithResult(_0x144462,null))[_0x9c47('0x18')](handleError(_0x144462,null));};exports[_0x9c47('0xb3')]=function(_0x4fe312,_0x2f1e19){return db[_0x9c47('0x59')][_0x9c47('0x63')]({'where':{'id':_0x4fe312['params']['id']},'include':[{'model':db[_0x9c47('0x3f')],'as':_0x9c47('0x3d'),'raw':!![],'include':[{'model':db[_0x9c47('0xa3')],'as':_0x9c47('0xa3'),'raw':!![]}]}]})[_0x9c47('0x22')](handleEntityNotFound(_0x2f1e19,null))[_0x9c47('0x22')](function(_0x2b80e4){if(!_0x2b80e4['Smtp'])return;var _0x1ee697=_0x2b80e4[_0x9c47('0xab')]();return respondWithRpcPromise(_0x9c47('0xb4'),'verifySmtp',{'account':_0x1ee697});})[_0x9c47('0x22')](respondWithResult(_0x2f1e19,null))[_0x9c47('0x18')](handleError(_0x2f1e19,null));};exports[_0x9c47('0x23')]=function(_0x10c0a4,_0x2c4f26){return db[_0x9c47('0x59')][_0x9c47('0x63')]({'where':{'id':_0x10c0a4[_0x9c47('0x64')]['id']}})[_0x9c47('0x22')](handleEntityNotFound(_0x2c4f26,null))['then'](function(_0xdc6ef3){if(_0xdc6ef3&&_0xdc6ef3[_0x9c47('0x3a')]){throw new db[(_0x9c47('0xb5'))][(_0x9c47('0xb6'))](_0x9c47('0xb7'));}return _0xdc6ef3;})[_0x9c47('0x22')](removeEntity(_0x2c4f26,null))[_0x9c47('0x18')](handleError(_0x2c4f26,null));};exports[_0x9c47('0xb8')]=function(_0x48dd03,_0x1d5e7b){return db[_0x9c47('0x59')][_0x9c47('0x63')]({'where':{'id':_0x48dd03[_0x9c47('0x64')]['id']}})['then'](handleEntityNotFound(_0x1d5e7b,null))[_0x9c47('0x22')](function(_0x53a094){if(_0x53a094){return _0x53a094[_0x9c47('0xb8')](_0x48dd03[_0x9c47('0x60')]['ids'],_['omit'](_0x48dd03[_0x9c47('0x60')],[_0x9c47('0x6e'),'id'])||{})[_0x9c47('0xb9')](function(_0x3d4e4e){for(var _0xfcf9d=0x0;_0xfcf9d<_0x48dd03[_0x9c47('0x60')][_0x9c47('0x6e')][_0x9c47('0x4d')];_0xfcf9d+=0x1){socket[_0x9c47('0xba')]('userMailAccount:save',{'UserId':Number(_0x48dd03[_0x9c47('0x60')][_0x9c47('0x6e')][_0xfcf9d]),'MailAccountId':Number(_0x48dd03[_0x9c47('0x64')]['id'])});}return _0x3d4e4e;});}})[_0x9c47('0x22')](respondWithResult(_0x1d5e7b,null))['catch'](handleError(_0x1d5e7b,null));};exports[_0x9c47('0xbb')]=function(_0x2271db,_0x55196b){return db[_0x9c47('0x59')][_0x9c47('0x63')]({'where':{'id':_0x2271db[_0x9c47('0x64')]['id']}})['then'](handleEntityNotFound(_0x55196b,null))['then'](function(_0x3b37b4){if(_0x3b37b4){return _0x3b37b4[_0x9c47('0xbb')](_0x2271db[_0x9c47('0x48')][_0x9c47('0x6e')])[_0x9c47('0x22')](function(){if(_[_0x9c47('0xbc')](_0x2271db[_0x9c47('0x48')][_0x9c47('0x6e')])){for(var _0x5455b4=0x0;_0x5455b4<_0x2271db[_0x9c47('0x48')]['ids']['length'];_0x5455b4+=0x1){socket[_0x9c47('0xba')](_0x9c47('0xbd'),{'UserId':Number(_0x2271db[_0x9c47('0x48')]['ids'][_0x5455b4]),'MailAccountId':Number(_0x2271db[_0x9c47('0x64')]['id'])});}}else{socket[_0x9c47('0xba')](_0x9c47('0xbd'),{'UserId':Number(_0x2271db[_0x9c47('0x48')][_0x9c47('0x6e')]),'MailAccountId':Number(_0x2271db['params']['id'])});}});}})[_0x9c47('0x22')](respondWithStatusCode(_0x55196b,null))[_0x9c47('0x18')](handleError(_0x55196b,null));};exports[_0x9c47('0xbe')]=function(_0x1342fc,_0x103288){var _0x2c78ce={};var _0xd75871={};var _0x4215aa;var _0x5ba47e;return db['MailAccount'][_0x9c47('0x6b')]({'where':{'id':_0x1342fc['params']['id']}})[_0x9c47('0x22')](handleEntityNotFound(_0x103288,null))[_0x9c47('0x22')](function(_0x5d9396){if(_0x5d9396){_0x4215aa=_0x5d9396;_0xd75871[_0x9c47('0x46')]=_[_0x9c47('0x5f')](db['User'][_0x9c47('0x42')]);_0xd75871[_0x9c47('0x48')]=_[_0x9c47('0x5f')](_0x1342fc[_0x9c47('0x48')]);_0xd75871[_0x9c47('0x49')]=_['intersection'](_0xd75871['model'],_0xd75871[_0x9c47('0x48')]);_0x2c78ce[_0x9c47('0x4c')]=_['intersection'](_0xd75871[_0x9c47('0x46')],qs['fields'](_0x1342fc[_0x9c47('0x48')][_0x9c47('0x4b')]));_0x2c78ce[_0x9c47('0x4c')]=_0x2c78ce[_0x9c47('0x4c')][_0x9c47('0x4d')]?_0x2c78ce[_0x9c47('0x4c')]:_0xd75871[_0x9c47('0x46')];_0x2c78ce[_0x9c47('0x51')]=qs[_0x9c47('0x52')](_0x1342fc[_0x9c47('0x48')]['sort']);_0x2c78ce[_0x9c47('0x56')]=qs[_0x9c47('0x49')](_[_0x9c47('0x53')](_0x1342fc[_0x9c47('0x48')],_0xd75871[_0x9c47('0x49')]));if(_0x1342fc['query'][_0x9c47('0x54')]){_0x2c78ce[_0x9c47('0x56')]=_['merge'](_0x2c78ce[_0x9c47('0x56')],{'$or':_['map'](_0x2c78ce[_0x9c47('0x4c')],function(_0x154295){var _0x346d7d={};_0x346d7d[_0x154295]={'$like':'%'+_0x1342fc[_0x9c47('0x48')][_0x9c47('0x54')]+'%'};return _0x346d7d;})});}_0x2c78ce=_[_0x9c47('0x55')]({},_0x2c78ce,_0x1342fc[_0x9c47('0x58')]);return _0x4215aa[_0x9c47('0xbe')](_0x2c78ce);}})[_0x9c47('0x22')](function(_0x875552){if(_0x875552){_0x5ba47e=_0x875552['length'];if(!_0x1342fc[_0x9c47('0x48')][_0x9c47('0x4e')](_0x9c47('0x4f'))){_0x2c78ce['limit']=qs[_0x9c47('0x50')](_0x1342fc[_0x9c47('0x48')][_0x9c47('0x50')]);_0x2c78ce[_0x9c47('0x1c')]=qs[_0x9c47('0x1c')](_0x1342fc[_0x9c47('0x48')]['offset']);}return _0x4215aa[_0x9c47('0xbe')](_0x2c78ce);}})[_0x9c47('0x22')](function(_0x45a5ea){if(_0x45a5ea){return _0x45a5ea?{'count':_0x5ba47e,'rows':_0x45a5ea}:null;}})[_0x9c47('0x22')](respondWithResult(_0x103288,null))[_0x9c47('0x18')](handleError(_0x103288,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 8010176..40d651f 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 _0x7c7f=['save','update','remove','emit','exports','events','../../mysqldb'];(function(_0x459d30,_0x4e010e){var _0x49526c=function(_0x20772b){while(--_0x20772b){_0x459d30['push'](_0x459d30['shift']());}};_0x49526c(++_0x4e010e);}(_0x7c7f,0x163));var _0xf7c7=function(_0x2c7dc6,_0x3c4ce0){_0x2c7dc6=_0x2c7dc6-0x0;var _0x10002b=_0x7c7f[_0x2c7dc6];return _0x10002b;};'use strict';var EventEmitter=require(_0xf7c7('0x0'));var MailAccount=require(_0xf7c7('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf7c7('0x2'),'afterUpdate':_0xf7c7('0x3'),'afterDestroy':_0xf7c7('0x4')};function emitEvent(_0x493516){return function(_0x2911be,_0x1e7319,_0x580ee5){MailAccountEvents['emit'](_0x493516+':'+_0x2911be['id'],_0x2911be);MailAccountEvents[_0xf7c7('0x5')](_0x493516,_0x2911be);_0x580ee5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0xf7c7('0x6')]=MailAccountEvents; \ No newline at end of file +var _0x8921=['exports','events','MailAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x4449fc,_0x17b871){var _0x244eb8=function(_0x2db585){while(--_0x2db585){_0x4449fc['push'](_0x4449fc['shift']());}};_0x244eb8(++_0x17b871);}(_0x8921,0x9a));var _0x1892=function(_0x26568d,_0x414697){_0x26568d=_0x26568d-0x0;var _0x3e3324=_0x8921[_0x26568d];return _0x3e3324;};'use strict';var EventEmitter=require(_0x1892('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x1892('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x1892('0x2')](0x0);var events={'afterCreate':_0x1892('0x3'),'afterUpdate':_0x1892('0x4'),'afterDestroy':_0x1892('0x5')};function emitEvent(_0x110b75){return function(_0x28a89b,_0x15aa1b,_0x2790a1){MailAccountEvents[_0x1892('0x6')](_0x110b75+':'+_0x28a89b['id'],_0x28a89b);MailAccountEvents[_0x1892('0x6')](_0x110b75,_0x28a89b);_0x2790a1(null);};}for(var e in events){if(events[_0x1892('0x7')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0x1892('0x8')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index bc84cbb..2246270 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 _0xf008=['data5','pass','define','MailAccount','mail_accounts','provider','custom','service','host','Smtp','port','secure','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','user'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf008,0x1cd));var _0x8f00=function(_0x213f7c,_0x362d12){_0x213f7c=_0x213f7c-0x0;var _0x2d2929=_0xf008[_0x213f7c];return _0x2d2929;};'use strict';var attributes=require('./mailAccount.attributes');module['exports']=function(_0x39e4c1){return _0x39e4c1[_0x8f00('0x0')](_0x8f00('0x1'),attributes,{'tableName':_0x8f00('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x2e232c=this;var _0x38200d={'id':_0x2e232c['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2e232c[_0x8f00('0x3')]!==_0x8f00('0x4')){_0x38200d[_0x8f00('0x5')]=_0x2e232c[_0x8f00('0x3')];}else{_0x38200d[_0x8f00('0x6')]=_0x2e232c[_0x8f00('0x7')]['host'];_0x38200d[_0x8f00('0x8')]=_0x2e232c['Smtp']['port'];_0x38200d[_0x8f00('0x9')]=_0x2e232c[_0x8f00('0x7')][_0x8f00('0x9')];}if(_0x2e232c['Smtp']['authentication']){if(_0x2e232c[_0x8f00('0x7')][_0x8f00('0xa')]){if(!_0x2e232c[_0x8f00('0x7')][_0x8f00('0xb')])throw new Error(_0x8f00('0xc'));_0x38200d[_0x8f00('0xd')]={'type':'OAuth2','user':_0x2e232c[_0x8f00('0x7')][_0x8f00('0xe')],'accessToken':_0x2e232c[_0x8f00('0x7')][_0x8f00('0xb')][_0x8f00('0xf')]};}else{_0x38200d[_0x8f00('0xd')]={'user':_0x2e232c['Smtp']['user'],'pass':_0x2e232c[_0x8f00('0x7')][_0x8f00('0x10')]};}}return _0x38200d;}}});}; \ No newline at end of file +var _0x81b7=['mail_accounts','custom','service','provider','Smtp','host','port','secure','authentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','user','data5','./mailAccount.attributes','define','MailAccount'];(function(_0x45fc6a,_0x166adb){var _0x14bcfd=function(_0x3ba718){while(--_0x3ba718){_0x45fc6a['push'](_0x45fc6a['shift']());}};_0x14bcfd(++_0x166adb);}(_0x81b7,0xb1));var _0x781b=function(_0x7d78f,_0x22d980){_0x7d78f=_0x7d78f-0x0;var _0x1005c3=_0x81b7[_0x7d78f];return _0x1005c3;};'use strict';var attributes=require(_0x781b('0x0'));module['exports']=function(_0x5e0eb9){return _0x5e0eb9[_0x781b('0x1')](_0x781b('0x2'),attributes,{'tableName':_0x781b('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x3198c0=this;var _0x2f1e1f={'id':_0x3198c0['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3198c0['provider']!==_0x781b('0x4')){_0x2f1e1f[_0x781b('0x5')]=_0x3198c0[_0x781b('0x6')];}else{_0x2f1e1f['host']=_0x3198c0[_0x781b('0x7')][_0x781b('0x8')];_0x2f1e1f[_0x781b('0x9')]=_0x3198c0['Smtp'][_0x781b('0x9')];_0x2f1e1f[_0x781b('0xa')]=_0x3198c0[_0x781b('0x7')][_0x781b('0xa')];}if(_0x3198c0['Smtp'][_0x781b('0xb')]){if(_0x3198c0[_0x781b('0x7')]['modernAuthentication']){if(!_0x3198c0[_0x781b('0x7')][_0x781b('0xc')])throw new Error(_0x781b('0xd'));_0x2f1e1f[_0x781b('0xe')]={'type':_0x781b('0xf'),'user':_0x3198c0[_0x781b('0x7')][_0x781b('0x10')],'accessToken':_0x3198c0['Smtp'][_0x781b('0xc')][_0x781b('0x11')]};}else{_0x2f1e1f[_0x781b('0xe')]={'user':_0x3198c0['Smtp'][_0x781b('0x10')],'pass':_0x3198c0[_0x781b('0x7')]['pass']};}}return _0x2f1e1f;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index dc648f6..a9f12c9 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 _0x5f66=['../../config/logger','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','debug','request\x20sent','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','GetMailAccount','MailAccount','options','raw','where','limit','include','map','model','attributes','stringify','find','smtp','smtpOptions','ShowMailAccount','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','createdAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','List','Contacts','updatedAt','DESC','MailApplication','Applications','MailServerOut','CloudProvider','get','omit','getSmtpOptions','list','applications','orderBy','priority','autoclose','push','close','defaults','List\x20not\x20found','contact','messageId','generate','subject','attach','format','MailInteraction','Messages','inReplyTo','Contact\x20not\x20found','spread','YYYY-MM-DD\x20HH:mm:ss','interaction','MailMessage','create','attachments','originTo','originCc','ChatWebsiteId','originChannel','ChatOfflineMessageId','Attachment','UserId','name','unshift','agent','*,*,*,*','startRouting','Start','moment','randomstring','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f66,0x1a0));var _0x65f6=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x5f66[_0x122096];return _0x3d1966;};'use strict';var _=require('lodash');var moment=require(_0x65f6('0x0'));var BPromise=require('bluebird');var rs=require(_0x65f6('0x1'));var Redis=require(_0x65f6('0x2'));var db=require(_0x65f6('0x3'))['db'];var logger=require(_0x65f6('0x4'))(_0x65f6('0x5'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x6'));var client=jayson['client'][_0x65f6('0x7')]({'port':0x232c});config[_0x65f6('0x8')]=_['defaults'](config['redis'],{'host':_0x65f6('0x9'),'port':0x18eb});var socket=require(_0x65f6('0xa'))(new Redis(config[_0x65f6('0x8')]));require(_0x65f6('0xb'))[_0x65f6('0xc')](socket);function respondWithRpcPromise(_0x14f4c7,_0x48d85c,_0x5123ee){return new BPromise(function(_0x18fea1,_0x2f6d5b){return client[_0x65f6('0xd')](_0x14f4c7,_0x5123ee)[_0x65f6('0xe')](function(_0x50d26d){logger[_0x65f6('0xf')]('MailAccount,\x20%s,\x20%s',_0x48d85c,'request\x20sent');logger[_0x65f6('0x10')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x48d85c,_0x65f6('0x11'),JSON['stringify'](_0x50d26d));if(_0x50d26d[_0x65f6('0x12')]){if(_0x50d26d[_0x65f6('0x12')][_0x65f6('0x13')]===0x1f4){logger[_0x65f6('0x12')](_0x65f6('0x14'),_0x48d85c,_0x50d26d[_0x65f6('0x12')][_0x65f6('0x15')]);return _0x2f6d5b(_0x50d26d[_0x65f6('0x12')][_0x65f6('0x15')]);}logger[_0x65f6('0x12')]('MailAccount,\x20%s,\x20%s',_0x48d85c,_0x50d26d[_0x65f6('0x12')]['message']);return _0x18fea1(_0x50d26d['error'][_0x65f6('0x15')]);}else{logger[_0x65f6('0xf')](_0x65f6('0x14'),_0x48d85c,_0x65f6('0x11'));_0x18fea1(_0x50d26d[_0x65f6('0x16')][_0x65f6('0x15')]);}})[_0x65f6('0x17')](function(_0x18380e){logger['error']('MailAccount,\x20%s,\x20%s',_0x48d85c,_0x18380e);_0x2f6d5b(_0x18380e);});});}exports[_0x65f6('0x18')]=function(_0x5b4055){var _0x4c81f3=this;return new Promise(function(_0x5c5b91,_0x365159){return db[_0x65f6('0x19')]['findAll']({'raw':_0x5b4055[_0x65f6('0x1a')]?_0x5b4055[_0x65f6('0x1a')][_0x65f6('0x1b')]===undefined?!![]:![]:!![],'where':_0x5b4055[_0x65f6('0x1a')]?_0x5b4055[_0x65f6('0x1a')][_0x65f6('0x1c')]||null:null,'attributes':_0x5b4055['options']?_0x5b4055[_0x65f6('0x1a')]['attributes']||null:null,'limit':_0x5b4055['options']?_0x5b4055[_0x65f6('0x1a')][_0x65f6('0x1d')]||null:null,'include':_0x5b4055['options']?_0x5b4055[_0x65f6('0x1a')][_0x65f6('0x1e')]?_[_0x65f6('0x1f')](_0x5b4055[_0x65f6('0x1a')]['include'],function(_0x9d7bb0){return{'model':db[_0x9d7bb0[_0x65f6('0x20')]],'as':_0x9d7bb0['as'],'attributes':_0x9d7bb0[_0x65f6('0x21')],'include':_0x9d7bb0['include']?_['map'](_0x9d7bb0['include'],function(_0x29abdb){return{'model':db[_0x29abdb[_0x65f6('0x20')]],'as':_0x29abdb['as'],'attributes':_0x29abdb['attributes'],'include':_0x29abdb[_0x65f6('0x1e')]?_[_0x65f6('0x1f')](_0x29abdb['include'],function(_0x325cb4){return{'model':db[_0x325cb4[_0x65f6('0x20')]],'as':_0x325cb4['as'],'attributes':_0x325cb4[_0x65f6('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ac04b){logger['info'](_0x65f6('0x18'),_0x5b4055);logger[_0x65f6('0x10')](_0x65f6('0x18'),_0x5b4055,JSON[_0x65f6('0x22')](_0x4ac04b));_0x5c5b91(_0x4ac04b);})[_0x65f6('0x17')](function(_0x14a387){logger[_0x65f6('0x12')]('GetMailAccount',_0x14a387['message'],_0x5b4055);_0x365159(_0x4c81f3[_0x65f6('0x12')](0x1f4,_0x14a387[_0x65f6('0x15')]));});});};exports['ShowMailAccount']=function(_0x4e50c0){var _0x10b368=this;return new Promise(function(_0x1ce43c,_0x11fe3b){return db[_0x65f6('0x19')][_0x65f6('0x23')]({'raw':_0x4e50c0[_0x65f6('0x1a')]?_0x4e50c0['options'][_0x65f6('0x1b')]===undefined?!![]:![]:!![],'where':_0x4e50c0[_0x65f6('0x1a')]?_0x4e50c0[_0x65f6('0x1a')]['where']||null:null,'attributes':_0x4e50c0[_0x65f6('0x1a')]?_0x4e50c0[_0x65f6('0x1a')][_0x65f6('0x21')]||null:null,'include':_0x4e50c0[_0x65f6('0x1a')]?_0x4e50c0[_0x65f6('0x1a')][_0x65f6('0x1e')]?_['map'](_0x4e50c0[_0x65f6('0x1a')][_0x65f6('0x1e')],function(_0x4f3e22){return{'model':db[_0x4f3e22[_0x65f6('0x20')]],'as':_0x4f3e22['as'],'attributes':_0x4f3e22['attributes'],'include':_0x4f3e22[_0x65f6('0x1e')]?_['map'](_0x4f3e22[_0x65f6('0x1e')],function(_0x24f7fd){return{'model':db[_0x24f7fd['model']],'as':_0x24f7fd['as'],'attributes':_0x24f7fd[_0x65f6('0x21')],'include':_0x24f7fd[_0x65f6('0x1e')]?_[_0x65f6('0x1f')](_0x24f7fd['include'],function(_0x582c7e){return{'model':db[_0x582c7e[_0x65f6('0x20')]],'as':_0x582c7e['as'],'attributes':_0x582c7e['attributes']};}):[]};}):[]};}):[]:[]})[_0x65f6('0xe')](function(_0x4e6653){if(_0x4e50c0[_0x65f6('0x1a')][_0x65f6('0x24')]===!![])_0x4e6653['setDataValue'](_0x65f6('0x25'),_0x4e6653['getSmtpOptions']());logger['info'](_0x65f6('0x26'),_0x4e50c0);logger[_0x65f6('0x10')](_0x65f6('0x26'),_0x4e50c0,JSON[_0x65f6('0x22')](_0x4e6653));_0x1ce43c(_0x4e6653);})[_0x65f6('0x17')](function(_0x28845a){logger[_0x65f6('0x12')](_0x65f6('0x26'),_0x28845a['message'],_0x4e50c0);_0x11fe3b(_0x10b368[_0x65f6('0x12')](0x1f4,_0x28845a['message']));});});};exports[_0x65f6('0x27')]=function(_0xa4394a){var _0x4ba7db=this;return new Promise(function(_0x2ea7f7,_0x5ef5c2){var _0x32148f={'body':_0xa4394a[_0x65f6('0x28')],'channel':_0x65f6('0x29')};var _0x3fb1c6=_[_0x65f6('0x2a')](_[_0x65f6('0x2b')](db[_0x65f6('0x2c')][_0x65f6('0x2d')]),[_0x65f6('0x2e'),'updatedAt',_0x65f6('0x2f'),_0x65f6('0x30')]);var _0x377ae5=![];if(_0xa4394a[_0x65f6('0x28')]['id']){delete _0xa4394a[_0x65f6('0x28')]['id'];}if(_[_0x65f6('0x31')](_0xa4394a[_0x65f6('0x28')][_0x65f6('0x32')])){return _0x5ef5c2(_0x4ba7db[_0x65f6('0x12')](0x1f4,_0x65f6('0x33')));}if(_[_0x65f6('0x31')](_0xa4394a[_0x65f6('0x28')][_0x65f6('0x28')])||_0xa4394a[_0x65f6('0x28')][_0x65f6('0x28')]===''){return _0x5ef5c2(_0x4ba7db[_0x65f6('0x12')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x65f6('0x31')](_0xa4394a[_0x65f6('0x28')][_0x65f6('0x34')])){return _0x5ef5c2(_0x4ba7db[_0x65f6('0x12')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3fb1c6));}if(!_[_0x65f6('0x35')](_0x3fb1c6,_0xa4394a[_0x65f6('0x28')][_0x65f6('0x34')])){return _0x5ef5c2(_0x4ba7db['error'](0x1f4,_0x65f6('0x36')+_0x3fb1c6));}var _0x3386a2={};_0x3386a2[_0xa4394a[_0x65f6('0x28')][_0x65f6('0x34')]]=_0xa4394a['body'][_0x65f6('0x32')];return db['MailAccount'][_0x65f6('0x23')]({'where':{'id':_0xa4394a[_0x65f6('0x37')]['id']},'include':[{'model':db['CmList'],'as':_0x65f6('0x38'),'include':[{'model':db['CmContact'],'as':_0x65f6('0x39'),'where':_0x3386a2,'limit':0x1,'order':[[_0x65f6('0x3a'),_0x65f6('0x3b')]]}]},{'model':db[_0x65f6('0x3c')],'as':_0x65f6('0x3d')},{'model':db[_0x65f6('0x3e')],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':_0x65f6('0x3f')}]}]})[_0x65f6('0xe')](function(_0x3b647a){if(_0x3b647a&&_0x3b647a[_0x65f6('0x38')]){var _0x3b907c=_0x3b647a[_0x65f6('0x40')]({'plain':!![]});_0x32148f[_0x65f6('0x37')]=_[_0x65f6('0x41')](_0x3b907c,[_0x65f6('0x3d'),'List']);_0x32148f[_0x65f6('0x37')][_0x65f6('0x25')]=_0x3b647a[_0x65f6('0x42')]();_0x32148f['applications']=_0x3b907c[_0x65f6('0x3d')];_0x32148f[_0x65f6('0x43')]=_0x3b907c['List'];_0x32148f[_0x65f6('0x44')]=_[_0x65f6('0x45')](_0x32148f['applications'],[_0x65f6('0x46')],['asc']);if(_0x32148f[_0x65f6('0x37')]&&_0x32148f[_0x65f6('0x37')][_0x65f6('0x47')]){_0x32148f['applications'][_0x65f6('0x48')]({'id':0x0,'priority':_0x32148f[_0x65f6('0x44')]['length']+0x1,'app':_0x65f6('0x49'),'appdata':_0x65f6('0x47'),'interval':'*,*,*,*'});}if(_0x32148f[_0x65f6('0x37')][_0x65f6('0x3d')]){delete _0x32148f[_0x65f6('0x37')][_0x65f6('0x3d')];}if(_0x32148f[_0x65f6('0x37')][_0x65f6('0x38')]){delete _0x32148f[_0x65f6('0x37')][_0x65f6('0x38')];}if(_0x3b907c['List']['Contacts']['length']){return _0x3b907c[_0x65f6('0x38')][_0x65f6('0x39')][0x0];}var _0x111a8a=_[_0x65f6('0x4a')](_0xa4394a['body'],{'firstName':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x32')],'ListId':_0x3b907c[_0x65f6('0x30')]});_0x111a8a[_0xa4394a['body'][_0x65f6('0x34')]]=_0xa4394a[_0x65f6('0x28')][_0x65f6('0x32')];return db['CmContact']['create'](_0x111a8a);}else{throw new Error(_0x65f6('0x4b'));}})[_0x65f6('0xe')](function(_0x4125cb){_0x32148f[_0x65f6('0x4c')]=_0x4125cb;if(_0x4125cb){if(!_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x4d')]){_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x4d')]=rs[_0x65f6('0x4e')]()+'\x20'+_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x32')];}var _0x5ba9c6={'ContactId':_0x4125cb['id'],'MailAccountId':_0xa4394a[_0x65f6('0x37')]['id'],'inReplyTo':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')]['messageId'],'to':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x32')],'cc':_0xa4394a[_0x65f6('0x28')]['message']['cc'],'subject':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x4f')],'attach':_0xa4394a[_0x65f6('0x28')]['message'][_0x65f6('0x50')],'lastMsgAt':moment()[_0x65f6('0x51')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x65f6('0x52')][_0x65f6('0x23')]({'where':{'closed':![],'MailAccountId':_0xa4394a[_0x65f6('0x37')]['id']},'include':[{'model':db['MailMessage'],'as':_0x65f6('0x53'),'attributes':[_0x65f6('0x4d')],'where':{'messageId':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x54')]}}]})[_0x65f6('0xe')](function(_0x5e4759){if(_0x5e4759){return[_0x5e4759,![]];}return db['MailInteraction']['create'](_0x5ba9c6)[_0x65f6('0xe')](function(_0x367d95){return[_0x367d95,!![]];});});}else{throw new Error(_0x65f6('0x55'));}})[_0x65f6('0x56')](function(_0xab6f0,_0x304cf9){if(_0xab6f0){_0x377ae5=_0x304cf9;if(!_0x304cf9){return _0xab6f0['update']({'inReplyTo':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')]['messageId'],'to':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x32')],'cc':_0xa4394a['body'][_0x65f6('0x15')]['cc'],'subject':_0xa4394a[_0x65f6('0x28')]['message'][_0x65f6('0x4f')],'attach':_0xab6f0[_0x65f6('0x50')]?_0xab6f0[_0x65f6('0x50')]:_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x50')],'substatus':null,'substatusAt':moment()[_0x65f6('0x51')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()['format'](_0x65f6('0x57')),'lastMsgDirection':'in'});}else{return _0xab6f0;}}})[_0x65f6('0xe')](function(_0x4a9524){_0x32148f[_0x65f6('0x58')]=_0x4a9524['get']({'plain':!![]});_0x32148f[_0x65f6('0x58')]['created']=_0x377ae5;return db[_0x65f6('0x59')][_0x65f6('0x5a')]({'body':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x28')],'MailAccountId':_0xa4394a[_0x65f6('0x37')]['id'],'MailInteractionId':_0x4a9524['id'],'direction':'in','ContactId':_0x32148f[_0x65f6('0x4c')]['id'],'messageId':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x4d')],'from':_0xa4394a['body']['message'][_0x65f6('0x32')],'to':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')]['to'],'cc':_0xa4394a['body']['message']['cc'],'subject':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x4f')],'attach':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x50')],'Attachments':_0xa4394a['body']['message'][_0x65f6('0x5b')],'originTo':_0xa4394a[_0x65f6('0x28')]['message'][_0x65f6('0x5c')],'originCc':_0xa4394a['body'][_0x65f6('0x15')][_0x65f6('0x5d')],'bcc':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')]['bcc'],'ChatWebsiteId':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x5e')]||null,'originChannel':_0xa4394a['body']['message'][_0x65f6('0x5f')]||'Email','ChatOfflineMessageId':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x60')]||null},{'include':[{'model':db[_0x65f6('0x61')],'as':'Attachments'}]});})['then'](function(_0x56f7f1){_0x32148f[_0x65f6('0x15')]=_0x56f7f1;if(_0x32148f[_0x65f6('0x58')][_0x65f6('0x62')]){return db['User'][_0x65f6('0x23')]({'attributes':['id',_0x65f6('0x63')],'where':{'id':_0x32148f[_0x65f6('0x58')]['UserId']}})[_0x65f6('0xe')](function(_0x15809e){if(_0x15809e){_0x32148f['applications'][_0x65f6('0x64')]({'id':0x0,'priority':0x0,'app':_0x65f6('0x65'),'appdata':_0x15809e['name']+','+(_0x32148f[_0x65f6('0x37')]['waitForTheAssignedAgent']||0xa),'interval':_0x65f6('0x66')});}return respondWithRpcPromise('Start',_0x65f6('0x67'),_0x32148f);});}return respondWithRpcPromise(_0x65f6('0x68'),'startRouting',_0x32148f);})[_0x65f6('0xe')](function(_0x442e25){_0x2ea7f7(_0x442e25);})[_0x65f6('0x17')](function(_0x299b85){_0x5ef5c2(_0x4ba7db[_0x65f6('0x12')](0x1f4,_0x299b85[_0x65f6('0x15')]));});});}; \ No newline at end of file +var _0x1967=['getSmtpOptions','NotifyMailAccount','body','mail','difference','keys','rawAttributes','createdAt','CompanyId','ListId','isNil','from','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmContact','updatedAt','Applications','CloudProvider','List','get','applications','list','priority','asc','autoclose','push','close','*,*,*,*','Contacts','length','create','messageId','generate','subject','attach','format','MailInteraction','MailMessage','inReplyTo','Contact\x20not\x20found','spread','update','YYYY-MM-DD\x20HH:mm:ss','interaction','created','contact','attachments','originTo','originCc','bcc','ChatOfflineMessageId','Attachments','UserId','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetMailAccount','findAll','options','where','attributes','limit','map','include','model','ShowMailAccount','MailAccount','find','smtp','setDataValue','smtpOptions'];(function(_0xd9c529,_0x19f8cc){var _0x146760=function(_0x1aa5e8){while(--_0x1aa5e8){_0xd9c529['push'](_0xd9c529['shift']());}};_0x146760(++_0x19f8cc);}(_0x1967,0x173));var _0x7196=function(_0x1e6878,_0x194b10){_0x1e6878=_0x1e6878-0x0;var _0x5644f3=_0x1967[_0x1e6878];return _0x5644f3;};'use strict';var _=require('lodash');var moment=require(_0x7196('0x0'));var BPromise=require(_0x7196('0x1'));var rs=require(_0x7196('0x2'));var Redis=require(_0x7196('0x3'));var db=require(_0x7196('0x4'))['db'];var logger=require(_0x7196('0x5'))(_0x7196('0x6'));var config=require(_0x7196('0x7'));var jayson=require(_0x7196('0x8'));var client=jayson[_0x7196('0x9')]['http']({'port':0x232c});config[_0x7196('0xa')]=_[_0x7196('0xb')](config[_0x7196('0xa')],{'host':_0x7196('0xc'),'port':0x18eb});var socket=require(_0x7196('0xd'))(new Redis(config[_0x7196('0xa')]));require('./mailAccount.socket')[_0x7196('0xe')](socket);function respondWithRpcPromise(_0xc6366f,_0x3f846e,_0x259b18){return new BPromise(function(_0x1e862d,_0x503070){return client['request'](_0xc6366f,_0x259b18)[_0x7196('0xf')](function(_0x10459b){logger[_0x7196('0x10')](_0x7196('0x11'),_0x3f846e,_0x7196('0x12'));logger[_0x7196('0x13')](_0x7196('0x14'),_0x3f846e,_0x7196('0x12'),JSON[_0x7196('0x15')](_0x10459b));if(_0x10459b[_0x7196('0x16')]){if(_0x10459b[_0x7196('0x16')]['code']===0x1f4){logger[_0x7196('0x16')](_0x7196('0x11'),_0x3f846e,_0x10459b[_0x7196('0x16')][_0x7196('0x17')]);return _0x503070(_0x10459b['error'][_0x7196('0x17')]);}logger['error'](_0x7196('0x11'),_0x3f846e,_0x10459b[_0x7196('0x16')][_0x7196('0x17')]);return _0x1e862d(_0x10459b[_0x7196('0x16')][_0x7196('0x17')]);}else{logger[_0x7196('0x10')](_0x7196('0x11'),_0x3f846e,_0x7196('0x12'));_0x1e862d(_0x10459b[_0x7196('0x18')][_0x7196('0x17')]);}})[_0x7196('0x19')](function(_0x5b716a){logger['error'](_0x7196('0x11'),_0x3f846e,_0x5b716a);_0x503070(_0x5b716a);});});}exports[_0x7196('0x1a')]=function(_0x40418d){var _0x517a3e=this;return new Promise(function(_0x39b944,_0x539d8b){return db['MailAccount'][_0x7196('0x1b')]({'raw':_0x40418d[_0x7196('0x1c')]?_0x40418d[_0x7196('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x40418d['options']?_0x40418d[_0x7196('0x1c')][_0x7196('0x1d')]||null:null,'attributes':_0x40418d['options']?_0x40418d[_0x7196('0x1c')][_0x7196('0x1e')]||null:null,'limit':_0x40418d[_0x7196('0x1c')]?_0x40418d[_0x7196('0x1c')][_0x7196('0x1f')]||null:null,'include':_0x40418d['options']?_0x40418d[_0x7196('0x1c')]['include']?_[_0x7196('0x20')](_0x40418d[_0x7196('0x1c')][_0x7196('0x21')],function(_0xa69810){return{'model':db[_0xa69810[_0x7196('0x22')]],'as':_0xa69810['as'],'attributes':_0xa69810[_0x7196('0x1e')],'include':_0xa69810['include']?_['map'](_0xa69810[_0x7196('0x21')],function(_0x2d284f){return{'model':db[_0x2d284f[_0x7196('0x22')]],'as':_0x2d284f['as'],'attributes':_0x2d284f['attributes'],'include':_0x2d284f['include']?_[_0x7196('0x20')](_0x2d284f[_0x7196('0x21')],function(_0x675e64){return{'model':db[_0x675e64['model']],'as':_0x675e64['as'],'attributes':_0x675e64[_0x7196('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4fd339){logger['info'](_0x7196('0x1a'),_0x40418d);logger[_0x7196('0x13')](_0x7196('0x1a'),_0x40418d,JSON['stringify'](_0x4fd339));_0x39b944(_0x4fd339);})[_0x7196('0x19')](function(_0x45d567){logger[_0x7196('0x16')](_0x7196('0x1a'),_0x45d567['message'],_0x40418d);_0x539d8b(_0x517a3e[_0x7196('0x16')](0x1f4,_0x45d567[_0x7196('0x17')]));});});};exports[_0x7196('0x23')]=function(_0x651d7e){var _0x4780e1=this;return new Promise(function(_0x2786f3,_0x15c5f0){return db[_0x7196('0x24')][_0x7196('0x25')]({'raw':_0x651d7e[_0x7196('0x1c')]?_0x651d7e[_0x7196('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x651d7e[_0x7196('0x1c')]?_0x651d7e['options'][_0x7196('0x1d')]||null:null,'attributes':_0x651d7e['options']?_0x651d7e[_0x7196('0x1c')][_0x7196('0x1e')]||null:null,'include':_0x651d7e['options']?_0x651d7e[_0x7196('0x1c')][_0x7196('0x21')]?_[_0x7196('0x20')](_0x651d7e[_0x7196('0x1c')][_0x7196('0x21')],function(_0x4a8580){return{'model':db[_0x4a8580[_0x7196('0x22')]],'as':_0x4a8580['as'],'attributes':_0x4a8580[_0x7196('0x1e')],'include':_0x4a8580[_0x7196('0x21')]?_[_0x7196('0x20')](_0x4a8580[_0x7196('0x21')],function(_0x123cad){return{'model':db[_0x123cad['model']],'as':_0x123cad['as'],'attributes':_0x123cad[_0x7196('0x1e')],'include':_0x123cad[_0x7196('0x21')]?_[_0x7196('0x20')](_0x123cad['include'],function(_0x33831a){return{'model':db[_0x33831a[_0x7196('0x22')]],'as':_0x33831a['as'],'attributes':_0x33831a[_0x7196('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7196('0xf')](function(_0x11d4ec){if(_0x651d7e[_0x7196('0x1c')][_0x7196('0x26')]===!![])_0x11d4ec[_0x7196('0x27')](_0x7196('0x28'),_0x11d4ec[_0x7196('0x29')]());logger['info'](_0x7196('0x23'),_0x651d7e);logger[_0x7196('0x13')]('ShowMailAccount',_0x651d7e,JSON[_0x7196('0x15')](_0x11d4ec));_0x2786f3(_0x11d4ec);})['catch'](function(_0x5bd701){logger[_0x7196('0x16')](_0x7196('0x23'),_0x5bd701['message'],_0x651d7e);_0x15c5f0(_0x4780e1['error'](0x1f4,_0x5bd701[_0x7196('0x17')]));});});};exports[_0x7196('0x2a')]=function(_0xed32cd){var _0x4c2341=this;return new Promise(function(_0x36a990,_0x2d13a5){var _0x29ba1c={'body':_0xed32cd[_0x7196('0x2b')],'channel':_0x7196('0x2c')};var _0x428d76=_[_0x7196('0x2d')](_[_0x7196('0x2e')](db['CmContact'][_0x7196('0x2f')]),[_0x7196('0x30'),'updatedAt',_0x7196('0x31'),_0x7196('0x32')]);var _0x48178f=![];if(_0xed32cd[_0x7196('0x2b')]['id']){delete _0xed32cd[_0x7196('0x2b')]['id'];}if(_[_0x7196('0x33')](_0xed32cd['body'][_0x7196('0x34')])){return _0x2d13a5(_0x4c2341[_0x7196('0x16')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x7196('0x33')](_0xed32cd[_0x7196('0x2b')]['body'])||_0xed32cd[_0x7196('0x2b')]['body']===''){return _0x2d13a5(_0x4c2341['error'](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0xed32cd['body'][_0x7196('0x35')])){return _0x2d13a5(_0x4c2341['error'](0x1f4,_0x7196('0x36')+_0x428d76));}if(!_[_0x7196('0x37')](_0x428d76,_0xed32cd[_0x7196('0x2b')][_0x7196('0x35')])){return _0x2d13a5(_0x4c2341['error'](0x1f4,_0x7196('0x38')+_0x428d76));}var _0x56ffdd={};_0x56ffdd[_0xed32cd[_0x7196('0x2b')][_0x7196('0x35')]]=_0xed32cd[_0x7196('0x2b')]['from'];return db[_0x7196('0x24')][_0x7196('0x25')]({'where':{'id':_0xed32cd[_0x7196('0x39')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x7196('0x3a')],'as':'Contacts','where':_0x56ffdd,'limit':0x1,'order':[[_0x7196('0x3b'),'DESC']]}]},{'model':db['MailApplication'],'as':_0x7196('0x3c')},{'model':db['MailServerOut'],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':_0x7196('0x3d')}]}]})['then'](function(_0x48e3b5){if(_0x48e3b5&&_0x48e3b5[_0x7196('0x3e')]){var _0x182c8b=_0x48e3b5[_0x7196('0x3f')]({'plain':!![]});_0x29ba1c[_0x7196('0x39')]=_['omit'](_0x182c8b,[_0x7196('0x3c'),'List']);_0x29ba1c[_0x7196('0x39')][_0x7196('0x28')]=_0x48e3b5['getSmtpOptions']();_0x29ba1c[_0x7196('0x40')]=_0x182c8b[_0x7196('0x3c')];_0x29ba1c[_0x7196('0x41')]=_0x182c8b['List'];_0x29ba1c[_0x7196('0x40')]=_['orderBy'](_0x29ba1c[_0x7196('0x40')],[_0x7196('0x42')],[_0x7196('0x43')]);if(_0x29ba1c[_0x7196('0x39')]&&_0x29ba1c[_0x7196('0x39')][_0x7196('0x44')]){_0x29ba1c[_0x7196('0x40')][_0x7196('0x45')]({'id':0x0,'priority':_0x29ba1c['applications']['length']+0x1,'app':_0x7196('0x46'),'appdata':_0x7196('0x44'),'interval':_0x7196('0x47')});}if(_0x29ba1c[_0x7196('0x39')]['Applications']){delete _0x29ba1c[_0x7196('0x39')][_0x7196('0x3c')];}if(_0x29ba1c[_0x7196('0x39')][_0x7196('0x3e')]){delete _0x29ba1c[_0x7196('0x39')][_0x7196('0x3e')];}if(_0x182c8b[_0x7196('0x3e')][_0x7196('0x48')][_0x7196('0x49')]){return _0x182c8b[_0x7196('0x3e')][_0x7196('0x48')][0x0];}var _0x4940a2=_[_0x7196('0xb')](_0xed32cd[_0x7196('0x2b')],{'firstName':_0xed32cd[_0x7196('0x2b')]['from'],'ListId':_0x182c8b[_0x7196('0x32')]});_0x4940a2[_0xed32cd['body'][_0x7196('0x35')]]=_0xed32cd[_0x7196('0x2b')][_0x7196('0x34')];return db[_0x7196('0x3a')][_0x7196('0x4a')](_0x4940a2);}else{throw new Error('List\x20not\x20found');}})[_0x7196('0xf')](function(_0x5b77fc){_0x29ba1c['contact']=_0x5b77fc;if(_0x5b77fc){if(!_0xed32cd['body'][_0x7196('0x17')][_0x7196('0x4b')]){_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x4b')]=rs[_0x7196('0x4c')]()+'\x20'+_0xed32cd[_0x7196('0x2b')]['message'][_0x7196('0x34')];}var _0x14dc43={'ContactId':_0x5b77fc['id'],'MailAccountId':_0xed32cd[_0x7196('0x39')]['id'],'inReplyTo':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')]['messageId'],'to':_0xed32cd['body'][_0x7196('0x17')][_0x7196('0x34')],'cc':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')]['cc'],'subject':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x4d')],'attach':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x4e')],'lastMsgAt':moment()[_0x7196('0x4f')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x7196('0x50')][_0x7196('0x25')]({'where':{'closed':![],'MailAccountId':_0xed32cd[_0x7196('0x39')]['id']},'include':[{'model':db[_0x7196('0x51')],'as':'Messages','attributes':[_0x7196('0x4b')],'where':{'messageId':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x52')]}}]})[_0x7196('0xf')](function(_0x3c3d64){if(_0x3c3d64){return[_0x3c3d64,![]];}return db[_0x7196('0x50')]['create'](_0x14dc43)[_0x7196('0xf')](function(_0x2c5cba){return[_0x2c5cba,!![]];});});}else{throw new Error(_0x7196('0x53'));}})[_0x7196('0x54')](function(_0x52827f,_0x418a7a){if(_0x52827f){_0x48178f=_0x418a7a;if(!_0x418a7a){return _0x52827f[_0x7196('0x55')]({'inReplyTo':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x4b')],'to':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')]['from'],'cc':_0xed32cd['body']['message']['cc'],'subject':_0xed32cd[_0x7196('0x2b')]['message'][_0x7196('0x4d')],'attach':_0x52827f[_0x7196('0x4e')]?_0x52827f[_0x7196('0x4e')]:_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x4e')],'substatus':null,'substatusAt':moment()[_0x7196('0x4f')](_0x7196('0x56')),'lastMsgAt':moment()[_0x7196('0x4f')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x52827f;}}})['then'](function(_0x4542c1){_0x29ba1c[_0x7196('0x57')]=_0x4542c1[_0x7196('0x3f')]({'plain':!![]});_0x29ba1c[_0x7196('0x57')][_0x7196('0x58')]=_0x48178f;return db[_0x7196('0x51')][_0x7196('0x4a')]({'body':_0xed32cd[_0x7196('0x2b')]['body'],'MailAccountId':_0xed32cd['account']['id'],'MailInteractionId':_0x4542c1['id'],'direction':'in','ContactId':_0x29ba1c[_0x7196('0x59')]['id'],'messageId':_0xed32cd['body'][_0x7196('0x17')]['messageId'],'from':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x34')],'to':_0xed32cd[_0x7196('0x2b')]['message']['to'],'cc':_0xed32cd['body'][_0x7196('0x17')]['cc'],'subject':_0xed32cd['body'][_0x7196('0x17')][_0x7196('0x4d')],'attach':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x4e')],'Attachments':_0xed32cd[_0x7196('0x2b')]['message'][_0x7196('0x5a')],'originTo':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x5b')],'originCc':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x5c')],'bcc':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x5d')],'ChatWebsiteId':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')]['ChatWebsiteId']||null,'originChannel':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')]['originChannel']||'Email','ChatOfflineMessageId':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x5e')]||null},{'include':[{'model':db['Attachment'],'as':_0x7196('0x5f')}]});})['then'](function(_0x218396){_0x29ba1c[_0x7196('0x17')]=_0x218396;if(_0x29ba1c['interaction'][_0x7196('0x60')]){return db['User']['find']({'attributes':['id',_0x7196('0x61')],'where':{'id':_0x29ba1c[_0x7196('0x57')][_0x7196('0x60')]}})['then'](function(_0x423b83){if(_0x423b83){_0x29ba1c['applications'][_0x7196('0x62')]({'id':0x0,'priority':0x0,'app':_0x7196('0x63'),'appdata':_0x423b83[_0x7196('0x61')]+','+(_0x29ba1c[_0x7196('0x39')][_0x7196('0x64')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x7196('0x65'),_0x7196('0x66'),_0x29ba1c);});}return respondWithRpcPromise(_0x7196('0x65'),_0x7196('0x66'),_0x29ba1c);})[_0x7196('0xf')](function(_0x29bafd){_0x36a990(_0x29bafd);})[_0x7196('0x19')](function(_0x34633a){_0x2d13a5(_0x4c2341['error'](0x1f4,_0x34633a[_0x7196('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 94df93c..b2701e8 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 _0xfc7c=['mailAccount:','save','update','emit','register','length'];(function(_0x34991c,_0x259ad7){var _0x32c838=function(_0x92565c){while(--_0x92565c){_0x34991c['push'](_0x34991c['shift']());}};_0x32c838(++_0x259ad7);}(_0xfc7c,0x18d));var _0xcfc7=function(_0x3eaad3,_0x208951){_0x3eaad3=_0x3eaad3-0x0;var _0xbc29ce=_0xfc7c[_0x3eaad3];return _0xbc29ce;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0xcfc7('0x0'),'remove',_0xcfc7('0x1')];function createListener(_0x21e044,_0x1d5a16){return function(_0x550fa4){_0x1d5a16[_0xcfc7('0x2')](_0x21e044,_0x550fa4);};}function removeListener(_0x1684bd,_0x4852d8){return function(){MailAccountEvents['removeListener'](_0x1684bd,_0x4852d8);};}exports[_0xcfc7('0x3')]=function(_0x23a2ca){for(var _0x1760a2=0x0,_0x20328d=events[_0xcfc7('0x4')];_0x1760a2<_0x20328d;_0x1760a2++){var _0x17b5d5=events[_0x1760a2];var _0x300e06=createListener(_0xcfc7('0x5')+_0x17b5d5,_0x23a2ca);MailAccountEvents['on'](_0x17b5d5,_0x300e06);}}; \ No newline at end of file +var _0x6e9b=['./mailAccount.events','save','remove','update','emit','removeListener','register','length','mailAccount:'];(function(_0x286373,_0x1813c4){var _0x1beb3f=function(_0x1119c8){while(--_0x1119c8){_0x286373['push'](_0x286373['shift']());}};_0x1beb3f(++_0x1813c4);}(_0x6e9b,0xea));var _0xb6e9=function(_0x232556,_0x3f110c){_0x232556=_0x232556-0x0;var _0x4339fa=_0x6e9b[_0x232556];return _0x4339fa;};'use strict';var MailAccountEvents=require(_0xb6e9('0x0'));var events=[_0xb6e9('0x1'),_0xb6e9('0x2'),_0xb6e9('0x3')];function createListener(_0x1476c4,_0x500f4e){return function(_0x2295f1){_0x500f4e[_0xb6e9('0x4')](_0x1476c4,_0x2295f1);};}function removeListener(_0x1ad94e,_0x4eca0f){return function(){MailAccountEvents[_0xb6e9('0x5')](_0x1ad94e,_0x4eca0f);};}exports[_0xb6e9('0x6')]=function(_0x2bdfb8){for(var _0x6b0286=0x0,_0x45f9f0=events[_0xb6e9('0x7')];_0x6b0286<_0x45f9f0;_0x6b0286++){var _0x174772=events[_0x6b0286];var _0x5967ba=createListener(_0xb6e9('0x8')+_0x174772,_0x2bdfb8);MailAccountEvents['on'](_0x174772,_0x5967ba);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index df5a116..76f2935 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 _0x7baf=['update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./mailApplication.controller','show','put','isAuthenticated'];(function(_0x391c03,_0x1d60af){var _0x112dc1=function(_0x24a602){while(--_0x24a602){_0x391c03['push'](_0x391c03['shift']());}};_0x112dc1(++_0x1d60af);}(_0x7baf,0x148));var _0xf7ba=function(_0x6c6400,_0x2a1519){_0x6c6400=_0x6c6400-0x0;var _0x1f4041=_0x7baf[_0x6c6400];return _0x1f4041;};'use strict';var multer=require(_0xf7ba('0x0'));var util=require(_0xf7ba('0x1'));var path=require(_0xf7ba('0x2'));var timeout=require(_0xf7ba('0x3'));var express=require(_0xf7ba('0x4'));var router=express[_0xf7ba('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf7ba('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf7ba('0x7'));var controller=require(_0xf7ba('0x8'));router['get']('/:id',auth['isAuthenticated'](),controller[_0xf7ba('0x9')]);router[_0xf7ba('0xa')]('/:id',auth[_0xf7ba('0xb')](),controller[_0xf7ba('0xc')]);router[_0xf7ba('0xd')](_0xf7ba('0xe'),auth[_0xf7ba('0xb')](),controller[_0xf7ba('0xf')]);module[_0xf7ba('0x10')]=router; \ No newline at end of file +var _0xc0e1=['fs-extra','../../components/auth/service','../../config/environment','get','/:id','isAuthenticated','show','put','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x31a605,_0x4574d4){var _0x3b02d7=function(_0x1b1c7f){while(--_0x1b1c7f){_0x31a605['push'](_0x31a605['shift']());}};_0x3b02d7(++_0x4574d4);}(_0xc0e1,0x16a));var _0x1c0e=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xc0e1[_0x4e9628];return _0x27bc8c;};'use strict';var multer=require(_0x1c0e('0x0'));var util=require(_0x1c0e('0x1'));var path=require(_0x1c0e('0x2'));var timeout=require(_0x1c0e('0x3'));var express=require(_0x1c0e('0x4'));var router=express[_0x1c0e('0x5')]();var fs_extra=require(_0x1c0e('0x6'));var auth=require(_0x1c0e('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x1c0e('0x8'));var controller=require('./mailApplication.controller');router[_0x1c0e('0x9')](_0x1c0e('0xa'),auth[_0x1c0e('0xb')](),controller[_0x1c0e('0xc')]);router[_0x1c0e('0xd')](_0x1c0e('0xa'),auth[_0x1c0e('0xb')](),controller['update']);router[_0x1c0e('0xe')](_0x1c0e('0xa'),auth[_0x1c0e('0xb')](),controller[_0x1c0e('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 9175eae..52b682d 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 _0x7d2b=['noop','TEXT','*,*,*,*','sequelize','INTEGER','STRING'];(function(_0x1b7d9c,_0x4751db){var _0x1c2204=function(_0x542e33){while(--_0x542e33){_0x1b7d9c['push'](_0x1b7d9c['shift']());}};_0x1c2204(++_0x4751db);}(_0x7d2b,0xe1));var _0xb7d2=function(_0x2bec13,_0x415ea3){_0x2bec13=_0x2bec13-0x0;var _0x4b42d5=_0x7d2b[_0x2bec13];return _0x4b42d5;};'use strict';var Sequelize=require(_0xb7d2('0x0'));module['exports']={'priority':{'type':Sequelize[_0xb7d2('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xb7d2('0x2')],'allowNull':![],'defaultValue':_0xb7d2('0x3')},'appdata':{'type':Sequelize[_0xb7d2('0x4')]()},'description':{'type':Sequelize[_0xb7d2('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xb7d2('0x5')}}; \ No newline at end of file +var _0x0724=['sequelize','INTEGER','noop','TEXT','STRING','*,*,*,*'];(function(_0x4bf0d4,_0x594635){var _0x29f6ea=function(_0x98295b){while(--_0x98295b){_0x4bf0d4['push'](_0x4bf0d4['shift']());}};_0x29f6ea(++_0x594635);}(_0x0724,0xd2));var _0x4072=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0724[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x4072('0x0'));module['exports']={'priority':{'type':Sequelize[_0x4072('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4072('0x2')},'appdata':{'type':Sequelize[_0x4072('0x3')]()},'description':{'type':Sequelize[_0x4072('0x4')]},'interval':{'type':Sequelize[_0x4072('0x4')],'defaultValue':_0x4072('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index aff7c79..de63ced 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 _0x70e0=['util','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','apply','save','update','then','error','stack','name','send','show','model','keys','MailApplication','query','filters','attributes','intersection','length','includeAll','include','find','catch','body','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache'];(function(_0x3f3b53,_0x3d035f){var _0x3fa180=function(_0x194ff3){while(--_0x194ff3){_0x3f3b53['push'](_0x3f3b53['shift']());}};_0x3fa180(++_0x3d035f);}(_0x70e0,0x17b));var _0x070e=function(_0x1c667f,_0x3b6e16){_0x1c667f=_0x1c667f-0x0;var _0x540415=_0x70e0[_0x1c667f];return _0x540415;};'use strict';var emlformat=require(_0x070e('0x0'));var rimraf=require(_0x070e('0x1'));var zipdir=require(_0x070e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x070e('0x3'));var BPromise=require(_0x070e('0x4'));var Mustache=require(_0x070e('0x5'));var util=require(_0x070e('0x6'));var path=require('path');var sox=require(_0x070e('0x7'));var csv=require('to-csv');var ejs=require(_0x070e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x070e('0x9'));var jsforce=require(_0x070e('0xa'));var deskjs=require(_0x070e('0xb'));var toCsv=require(_0x070e('0xc'));var querystring=require(_0x070e('0xd'));var Papa=require(_0x070e('0xe'));var Redis=require(_0x070e('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x070e('0x10'));var hardwareService=require(_0x070e('0x11'));var logger=require(_0x070e('0x12'))(_0x070e('0x13'));var utils=require(_0x070e('0x14'));var config=require(_0x070e('0x15'));var licenseUtil=require(_0x070e('0x16'));var db=require(_0x070e('0x17'))['db'];function respondWithStatusCode(_0x39d2b9,_0x5bf079){_0x5bf079=_0x5bf079||0xcc;return function(_0x2930b8){if(_0x2930b8){return _0x39d2b9['sendStatus'](_0x5bf079);}return _0x39d2b9['status'](_0x5bf079)[_0x070e('0x18')]();};}function respondWithResult(_0x56c7ba,_0x4a33d2){_0x4a33d2=_0x4a33d2||0xc8;return function(_0x5bae0f){if(_0x5bae0f){return _0x56c7ba[_0x070e('0x19')](_0x4a33d2)[_0x070e('0x1a')](_0x5bae0f);}};}function respondWithFilteredResult(_0x51d14d,_0x5d3a38){return function(_0x373d86){if(_0x373d86){var _0xeae1a5=typeof _0x5d3a38[_0x070e('0x1b')]===_0x070e('0x1c')&&typeof _0x5d3a38['limit']==='undefined';var _0x17e2e4=_0x373d86[_0x070e('0x1d')];var _0x38f6e6=_0xeae1a5?0x0:_0x5d3a38[_0x070e('0x1b')];var _0x364b3f=_0xeae1a5?_0x373d86['count']:_0x5d3a38[_0x070e('0x1b')]+_0x5d3a38[_0x070e('0x1e')];var _0x1ad3de;if(_0x364b3f>=_0x17e2e4){_0x364b3f=_0x17e2e4;_0x1ad3de=0xc8;}else{_0x1ad3de=0xce;}_0x51d14d[_0x070e('0x19')](_0x1ad3de);return _0x51d14d[_0x070e('0x1f')]('Content-Range',_0x38f6e6+'-'+_0x364b3f+'/'+_0x17e2e4)['json'](_0x373d86);}return null;};}function patchUpdates(_0x4e958f){return function(_0x9907cf){try{jsonpatch[_0x070e('0x20')](_0x9907cf,_0x4e958f,!![]);}catch(_0x20dc60){return BPromise['reject'](_0x20dc60);}return _0x9907cf[_0x070e('0x21')]();};}function saveUpdates(_0x5dc5d2,_0xf8dd5d){return function(_0x3f6985){if(_0x3f6985){return _0x3f6985[_0x070e('0x22')](_0x5dc5d2)[_0x070e('0x23')](function(_0x28a1c3){return _0x28a1c3;});}return null;};}function removeEntity(_0xa86797,_0xe405e){return function(_0x164cdf){if(_0x164cdf){return _0x164cdf['destroy']()[_0x070e('0x23')](function(){_0xa86797[_0x070e('0x19')](0xcc)[_0x070e('0x18')]();});}};}function handleEntityNotFound(_0x503f4d,_0xf17c56){return function(_0x5f3e9d){if(!_0x5f3e9d){_0x503f4d['sendStatus'](0x194);}return _0x5f3e9d;};}function handleError(_0x2ccbd7,_0x25f6e){_0x25f6e=_0x25f6e||0x1f4;return function(_0x41deb1){logger[_0x070e('0x24')](_0x41deb1[_0x070e('0x25')]);if(_0x41deb1['name']){delete _0x41deb1[_0x070e('0x26')];}_0x2ccbd7[_0x070e('0x19')](_0x25f6e)[_0x070e('0x27')](_0x41deb1);};}exports[_0x070e('0x28')]=function(_0x43dd96,_0x28d7f2){var _0x1a1892={'raw':!![],'where':{'id':_0x43dd96['params']['id']}},_0x26373b={};_0x26373b[_0x070e('0x29')]=_[_0x070e('0x2a')](db[_0x070e('0x2b')]['rawAttributes']);_0x26373b['query']=_[_0x070e('0x2a')](_0x43dd96[_0x070e('0x2c')]);_0x26373b[_0x070e('0x2d')]=_['intersection'](_0x26373b[_0x070e('0x29')],_0x26373b[_0x070e('0x2c')]);_0x1a1892[_0x070e('0x2e')]=_[_0x070e('0x2f')](_0x26373b['model'],qs['fields'](_0x43dd96['query']['fields']));_0x1a1892[_0x070e('0x2e')]=_0x1a1892['attributes'][_0x070e('0x30')]?_0x1a1892[_0x070e('0x2e')]:_0x26373b['model'];if(_0x43dd96['query'][_0x070e('0x31')]){_0x1a1892[_0x070e('0x32')]=[{'all':!![]}];}_0x1a1892=_['merge']({},_0x1a1892,_0x43dd96['options']);return db[_0x070e('0x2b')][_0x070e('0x33')](_0x1a1892)[_0x070e('0x23')](handleEntityNotFound(_0x28d7f2,null))[_0x070e('0x23')](respondWithResult(_0x28d7f2,null))[_0x070e('0x34')](handleError(_0x28d7f2,null));};exports['update']=function(_0x482cc2,_0x24d17d){if(_0x482cc2[_0x070e('0x35')]['id']){delete _0x482cc2[_0x070e('0x35')]['id'];}return db[_0x070e('0x2b')][_0x070e('0x33')]({'where':{'id':_0x482cc2['params']['id']}})[_0x070e('0x23')](handleEntityNotFound(_0x24d17d,null))[_0x070e('0x23')](saveUpdates(_0x482cc2['body'],null))[_0x070e('0x23')](respondWithResult(_0x24d17d,null))[_0x070e('0x34')](handleError(_0x24d17d,null));};exports['destroy']=function(_0x4d4ee8,_0x5ddbe9){return db[_0x070e('0x2b')][_0x070e('0x33')]({'where':{'id':_0x4d4ee8[_0x070e('0x36')]['id']}})[_0x070e('0x23')](handleEntityNotFound(_0x5ddbe9,null))[_0x070e('0x23')](removeEntity(_0x5ddbe9,null))['catch'](handleError(_0x5ddbe9,null));}; \ No newline at end of file +var _0x9c44=['Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','show','params','model','keys','MailApplication','rawAttributes','query','attributes','intersection','fields','length','includeAll','include','merge','options','find','then','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set'];(function(_0x3c013a,_0x3ee6ab){var _0x373dca=function(_0x1ccff5){while(--_0x1ccff5){_0x3c013a['push'](_0x3c013a['shift']());}};_0x373dca(++_0x3ee6ab);}(_0x9c44,0x178));var _0x49c4=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x9c44[_0x21549c];return _0x426cbd;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={'raw':!![],'where':{'id':_0x5987ae[_0x49c4('0x29')]['id']}},_0x46e04d={};_0x46e04d[_0x49c4('0x2a')]=_[_0x49c4('0x2b')](db[_0x49c4('0x2c')][_0x49c4('0x2d')]);_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2b')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d['filters']=_['intersection'](_0x46e04d['model'],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x2f')]=_[_0x49c4('0x30')](_0x46e04d[_0x49c4('0x2a')],qs[_0x49c4('0x31')](_0x5987ae['query'][_0x49c4('0x31')]));_0x2b2793[_0x49c4('0x2f')]=_0x2b2793[_0x49c4('0x2f')][_0x49c4('0x32')]?_0x2b2793['attributes']:_0x46e04d['model'];if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x33')]){_0x2b2793[_0x49c4('0x34')]=[{'all':!![]}];}_0x2b2793=_[_0x49c4('0x35')]({},_0x2b2793,_0x5987ae[_0x49c4('0x36')]);return db['MailApplication'][_0x49c4('0x37')](_0x2b2793)[_0x49c4('0x38')](handleEntityNotFound(_0x889909,null))[_0x49c4('0x38')](respondWithResult(_0x889909,null))['catch'](handleError(_0x889909,null));};exports['update']=function(_0x85dce2,_0x1991e9){if(_0x85dce2[_0x49c4('0x39')]['id']){delete _0x85dce2[_0x49c4('0x39')]['id'];}return db[_0x49c4('0x2c')][_0x49c4('0x37')]({'where':{'id':_0x85dce2[_0x49c4('0x29')]['id']}})[_0x49c4('0x38')](handleEntityNotFound(_0x1991e9,null))[_0x49c4('0x38')](saveUpdates(_0x85dce2['body'],null))[_0x49c4('0x38')](respondWithResult(_0x1991e9,null))['catch'](handleError(_0x1991e9,null));};exports[_0x49c4('0x23')]=function(_0x349791,_0x2625a6){return db[_0x49c4('0x2c')]['find']({'where':{'id':_0x349791[_0x49c4('0x29')]['id']}})[_0x49c4('0x38')](handleEntityNotFound(_0x2625a6,null))[_0x49c4('0x38')](removeEntity(_0x2625a6,null))['catch'](handleError(_0x2625a6,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 2e11792..3f856f6 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 _0xdaac=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','lodash'];(function(_0x481604,_0x276ff8){var _0x1ca4ed=function(_0x136e9d){while(--_0x136e9d){_0x481604['push'](_0x481604['shift']());}};_0x1ca4ed(++_0x276ff8);}(_0xdaac,0xbf));var _0xcdaa=function(_0x40f658,_0x1e28ae){_0x40f658=_0x40f658-0x0;var _0x4f617a=_0xdaac[_0x40f658];return _0x4f617a;};'use strict';var _=require(_0xcdaa('0x0'));var util=require(_0xcdaa('0x1'));var logger=require(_0xcdaa('0x2'))(_0xcdaa('0x3'));var moment=require(_0xcdaa('0x4'));var BPromise=require(_0xcdaa('0x5'));var rp=require(_0xcdaa('0x6'));var fs=require('fs');var path=require(_0xcdaa('0x7'));var rimraf=require(_0xcdaa('0x8'));var config=require(_0xcdaa('0x9'));var attributes=require(_0xcdaa('0xa'));module[_0xcdaa('0xb')]=function(_0x563b01,_0x11073b){return _0x563b01[_0xcdaa('0xc')](_0xcdaa('0xd'),attributes,{'tableName':_0xcdaa('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcdaa('0xf'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x7a20=['define','MailApplication','lodash','api','moment','bluebird','request-promise','path','rimraf','./mailApplication.attributes','exports'];(function(_0x2743d2,_0x459ccf){var _0x7044a5=function(_0xe4f13a){while(--_0xe4f13a){_0x2743d2['push'](_0x2743d2['shift']());}};_0x7044a5(++_0x459ccf);}(_0x7a20,0xd3));var _0x07a2=function(_0x1774da,_0x3ba59f){_0x1774da=_0x1774da-0x0;var _0x4db2c3=_0x7a20[_0x1774da];return _0x4db2c3;};'use strict';var _=require(_0x07a2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x07a2('0x1'));var moment=require(_0x07a2('0x2'));var BPromise=require(_0x07a2('0x3'));var rp=require(_0x07a2('0x4'));var fs=require('fs');var path=require(_0x07a2('0x5'));var rimraf=require(_0x07a2('0x6'));var config=require('../../config/environment');var attributes=require(_0x07a2('0x7'));module[_0x07a2('0x8')]=function(_0x15b456,_0x37b764){return _0x15b456[_0x07a2('0x9')](_0x07a2('0xa'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 3327dcf..5ee6a23 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 _0x3cae=['http','then','info','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailApplication,\x20%s,\x20%s','message','result','UpdateMailApplication','update','body','options','raw','limit','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client'];(function(_0x394d66,_0x5a2e70){var _0x30c494=function(_0x2c3ce3){while(--_0x2c3ce3){_0x394d66['push'](_0x394d66['shift']());}};_0x30c494(++_0x5a2e70);}(_0x3cae,0x172));var _0xe3ca=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x3cae[_0x491a7f];return _0x3d8f44;};'use strict';var _=require('lodash');var util=require(_0xe3ca('0x0'));var moment=require('moment');var BPromise=require(_0xe3ca('0x1'));var rs=require(_0xe3ca('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe3ca('0x3'))['db'];var utils=require(_0xe3ca('0x4'));var logger=require(_0xe3ca('0x5'))('rpc');var config=require(_0xe3ca('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe3ca('0x7')][_0xe3ca('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x51c0c9,_0x4b36ef,_0x4d3550){return new BPromise(function(_0xbfc28e,_0x4f531f){return client['request'](_0x51c0c9,_0x4d3550)[_0xe3ca('0x9')](function(_0x4e14a2){logger[_0xe3ca('0xa')]('MailApplication,\x20%s,\x20%s',_0x4b36ef,'request\x20sent');logger[_0xe3ca('0xb')](_0xe3ca('0xc'),_0x4b36ef,_0xe3ca('0xd'),JSON[_0xe3ca('0xe')](_0x4e14a2));if(_0x4e14a2['error']){if(_0x4e14a2[_0xe3ca('0xf')][_0xe3ca('0x10')]===0x1f4){logger[_0xe3ca('0xf')](_0xe3ca('0x11'),_0x4b36ef,_0x4e14a2[_0xe3ca('0xf')][_0xe3ca('0x12')]);return _0x4f531f(_0x4e14a2[_0xe3ca('0xf')][_0xe3ca('0x12')]);}logger['error']('MailApplication,\x20%s,\x20%s',_0x4b36ef,_0x4e14a2[_0xe3ca('0xf')][_0xe3ca('0x12')]);return _0xbfc28e(_0x4e14a2[_0xe3ca('0xf')][_0xe3ca('0x12')]);}else{logger[_0xe3ca('0xa')]('MailApplication,\x20%s,\x20%s',_0x4b36ef,'request\x20sent');_0xbfc28e(_0x4e14a2[_0xe3ca('0x13')]['message']);}})['catch'](function(_0x4867e3){logger[_0xe3ca('0xf')](_0xe3ca('0x11'),_0x4b36ef,_0x4867e3);_0x4f531f(_0x4867e3);});});}exports[_0xe3ca('0x14')]=function(_0x22e605){var _0x2762db=this;return new Promise(function(_0xd2234b,_0x4da510){return db['MailApplication'][_0xe3ca('0x15')](_0x22e605[_0xe3ca('0x16')],{'raw':_0x22e605['options']?_0x22e605[_0xe3ca('0x17')][_0xe3ca('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x22e605[_0xe3ca('0x17')]?_0x22e605[_0xe3ca('0x17')]['where']||null:null,'attributes':_0x22e605['options']?_0x22e605[_0xe3ca('0x17')]['attributes']||null:null,'limit':_0x22e605[_0xe3ca('0x17')]?_0x22e605[_0xe3ca('0x17')][_0xe3ca('0x19')]||null:null})[_0xe3ca('0x9')](function(_0xa73de){logger[_0xe3ca('0xa')](_0xe3ca('0x14'),_0x22e605);logger['debug'](_0xe3ca('0x14'),_0x22e605,JSON[_0xe3ca('0xe')](_0xa73de));_0xd2234b(_0xa73de);})[_0xe3ca('0x1a')](function(_0x17f974){logger[_0xe3ca('0xf')](_0xe3ca('0x14'),_0x17f974[_0xe3ca('0x12')],_0x22e605);_0x4da510(_0x2762db[_0xe3ca('0xf')](0x1f4,_0x17f974['message']));});});}; \ No newline at end of file +var _0x9157=['message','result','UpdateMailApplication','MailApplication','update','body','options','raw','where','attributes','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3d7c32,_0x419db1){var _0x25aec8=function(_0x151cd6){while(--_0x151cd6){_0x3d7c32['push'](_0x3d7c32['shift']());}};_0x25aec8(++_0x419db1);}(_0x9157,0x1e7));var _0x7915=function(_0x9b2bb0,_0x3965b1){_0x9b2bb0=_0x9b2bb0-0x0;var _0x2cdb3b=_0x9157[_0x9b2bb0];return _0x2cdb3b;};'use strict';var _=require(_0x7915('0x0'));var util=require(_0x7915('0x1'));var moment=require(_0x7915('0x2'));var BPromise=require(_0x7915('0x3'));var rs=require(_0x7915('0x4'));var fs=require('fs');var Redis=require(_0x7915('0x5'));var db=require(_0x7915('0x6'))['db'];var utils=require(_0x7915('0x7'));var logger=require('../../config/logger')(_0x7915('0x8'));var config=require(_0x7915('0x9'));var jayson=require(_0x7915('0xa'));var client=jayson[_0x7915('0xb')][_0x7915('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf53ff0,_0xfb26da,_0x207d1a){return new BPromise(function(_0xacc168,_0xb97ed4){return client[_0x7915('0xd')](_0xf53ff0,_0x207d1a)[_0x7915('0xe')](function(_0x54f998){logger[_0x7915('0xf')](_0x7915('0x10'),_0xfb26da,_0x7915('0x11'));logger[_0x7915('0x12')](_0x7915('0x13'),_0xfb26da,_0x7915('0x11'),JSON[_0x7915('0x14')](_0x54f998));if(_0x54f998[_0x7915('0x15')]){if(_0x54f998['error'][_0x7915('0x16')]===0x1f4){logger[_0x7915('0x15')](_0x7915('0x10'),_0xfb26da,_0x54f998[_0x7915('0x15')][_0x7915('0x17')]);return _0xb97ed4(_0x54f998['error']['message']);}logger[_0x7915('0x15')]('MailApplication,\x20%s,\x20%s',_0xfb26da,_0x54f998['error'][_0x7915('0x17')]);return _0xacc168(_0x54f998[_0x7915('0x15')][_0x7915('0x17')]);}else{logger[_0x7915('0xf')](_0x7915('0x10'),_0xfb26da,'request\x20sent');_0xacc168(_0x54f998[_0x7915('0x18')][_0x7915('0x17')]);}})['catch'](function(_0x373629){logger[_0x7915('0x15')](_0x7915('0x10'),_0xfb26da,_0x373629);_0xb97ed4(_0x373629);});});}exports[_0x7915('0x19')]=function(_0x23d4bb){var _0x5590c3=this;return new Promise(function(_0x6927ca,_0x5dcff6){return db[_0x7915('0x1a')][_0x7915('0x1b')](_0x23d4bb[_0x7915('0x1c')],{'raw':_0x23d4bb[_0x7915('0x1d')]?_0x23d4bb[_0x7915('0x1d')][_0x7915('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23d4bb[_0x7915('0x1d')]?_0x23d4bb[_0x7915('0x1d')][_0x7915('0x1f')]||null:null,'attributes':_0x23d4bb['options']?_0x23d4bb['options'][_0x7915('0x20')]||null:null,'limit':_0x23d4bb[_0x7915('0x1d')]?_0x23d4bb[_0x7915('0x1d')]['limit']||null:null})[_0x7915('0xe')](function(_0x2931f5){logger[_0x7915('0xf')](_0x7915('0x19'),_0x23d4bb);logger[_0x7915('0x12')]('UpdateMailApplication',_0x23d4bb,JSON[_0x7915('0x14')](_0x2931f5));_0x6927ca(_0x2931f5);})[_0x7915('0x21')](function(_0x15978b){logger[_0x7915('0x15')]('UpdateMailApplication',_0x15978b[_0x7915('0x17')],_0x23d4bb);_0x5dcff6(_0x5590c3[_0x7915('0x15')](0x1f4,_0x15978b['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 72bd221..5d2b8cd 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 _0x67cb=['post','create','/:id/tags','mail','mailinteraction:addtags','put','tracked','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','removeTags','exports','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','download'];(function(_0x518d82,_0x218926){var _0x583393=function(_0x2588cd){while(--_0x2588cd){_0x518d82['push'](_0x518d82['shift']());}};_0x583393(++_0x218926);}(_0x67cb,0x17a));var _0xb67c=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x67cb[_0x4ff09b];return _0x3f5c2e;};'use strict';var express=require('express');var router=express[_0xb67c('0x0')]();var auth=require(_0xb67c('0x1'));var interaction=require(_0xb67c('0x2'));var controller=require(_0xb67c('0x3'));router[_0xb67c('0x4')]('/',auth[_0xb67c('0x5')](),controller[_0xb67c('0x6')]);router['get'](_0xb67c('0x7'),auth[_0xb67c('0x5')](),controller[_0xb67c('0x8')]);router['get'](_0xb67c('0x9'),auth[_0xb67c('0x5')](),controller['show']);router['get'](_0xb67c('0xa'),auth['isAuthenticated'](),controller['getMessages']);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xb67c('0xb')]);router[_0xb67c('0xc')]('/',auth[_0xb67c('0x5')](),controller[_0xb67c('0xd')]);router[_0xb67c('0xc')](_0xb67c('0xa'),auth[_0xb67c('0x5')](),controller['addMessage']);router[_0xb67c('0xc')](_0xb67c('0xe'),auth[_0xb67c('0x5')](),interaction['tracked'](_0xb67c('0xf'),_0xb67c('0x10')),controller['addTags']);router[_0xb67c('0x11')](_0xb67c('0x9'),auth[_0xb67c('0x5')](),interaction[_0xb67c('0x12')](_0xb67c('0xf'),_0xb67c('0x13')),controller[_0xb67c('0x14')]);router[_0xb67c('0x15')](_0xb67c('0x9'),auth['isAuthenticated'](),interaction[_0xb67c('0x12')]('mail',_0xb67c('0x16')),controller[_0xb67c('0x17')]);router[_0xb67c('0x15')]('/:id/tags',auth[_0xb67c('0x5')](),controller[_0xb67c('0x18')]);module[_0xb67c('0x19')]=router; \ No newline at end of file +var _0x79f8=['/:id/tags','mailinteraction:addtags','addTags','put','tracked','mail','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','removeTags','exports','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','getMessages','/:id/download','download','post'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0x79f8,0x100));var _0x879f=function(_0x26a71c,_0x5a877a){_0x26a71c=_0x26a71c-0x0;var _0x209cfe=_0x79f8[_0x26a71c];return _0x209cfe;};'use strict';var express=require('express');var router=express[_0x879f('0x0')]();var auth=require(_0x879f('0x1'));var interaction=require(_0x879f('0x2'));var controller=require(_0x879f('0x3'));router[_0x879f('0x4')]('/',auth[_0x879f('0x5')](),controller[_0x879f('0x6')]);router['get'](_0x879f('0x7'),auth[_0x879f('0x5')](),controller[_0x879f('0x8')]);router[_0x879f('0x4')](_0x879f('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x879f('0x4')]('/:id/messages',auth[_0x879f('0x5')](),controller[_0x879f('0xa')]);router[_0x879f('0x4')](_0x879f('0xb'),auth[_0x879f('0x5')](),controller[_0x879f('0xc')]);router['post']('/',auth[_0x879f('0x5')](),controller['create']);router['post']('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router[_0x879f('0xd')](_0x879f('0xe'),auth[_0x879f('0x5')](),interaction['tracked']('mail',_0x879f('0xf')),controller[_0x879f('0x10')]);router[_0x879f('0x11')](_0x879f('0x9'),auth[_0x879f('0x5')](),interaction[_0x879f('0x12')](_0x879f('0x13'),_0x879f('0x14')),controller[_0x879f('0x15')]);router[_0x879f('0x16')](_0x879f('0x9'),auth['isAuthenticated'](),interaction[_0x879f('0x12')](_0x879f('0x13'),_0x879f('0x17')),controller[_0x879f('0x18')]);router['delete'](_0x879f('0xe'),auth[_0x879f('0x5')](),controller[_0x879f('0x19')]);module[_0x879f('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index b6c62b3..defcc9f 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 _0xced4=['STRING','long','ENUM','sequelize','iconv','exports','BOOLEAN','DATE'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xced4,0x1c3));var _0x4ced=function(_0x2bd1ec,_0x3fe65f){_0x2bd1ec=_0x2bd1ec-0x0;var _0x2f7577=_0xced4[_0x2bd1ec];return _0x2f7577;};'use strict';var Sequelize=require(_0x4ced('0x0'));var iconv=require(_0x4ced('0x1'));module[_0x4ced('0x2')]={'closed':{'type':Sequelize[_0x4ced('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4ced('0x4')]},'disposition':{'type':Sequelize[_0x4ced('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x4ced('0x5')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x4ced('0x5')]},'cc':{'type':Sequelize['TEXT'](_0x4ced('0x6'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x4ced('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0x4ced('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x4ced('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x4ced('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4ced('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x4ced('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xbe83=['long','TEXT','ENUM','out','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x542137,_0x26afd5){var _0x2451c4=function(_0x40e1d7){while(--_0x40e1d7){_0x542137['push'](_0x542137['shift']());}};_0x2451c4(++_0x26afd5);}(_0xbe83,0xee));var _0x3be8=function(_0x27c7d8,_0x135bcc){_0x27c7d8=_0x27c7d8-0x0;var _0x22b844=_0xbe83[_0x27c7d8];return _0x22b844;};'use strict';var Sequelize=require(_0x3be8('0x0'));var iconv=require('iconv');module[_0x3be8('0x1')]={'closed':{'type':Sequelize[_0x3be8('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3be8('0x3')]},'disposition':{'type':Sequelize[_0x3be8('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x3be8('0x4')]},'note':{'type':Sequelize[_0x3be8('0x4')]},'inReplyTo':{'type':Sequelize[_0x3be8('0x4')](0x1fe)},'to':{'type':Sequelize[_0x3be8('0x4')]},'cc':{'type':Sequelize['TEXT'](_0x3be8('0x5'))},'subject':{'type':Sequelize[_0x3be8('0x6')]()},'attach':{'type':Sequelize[_0x3be8('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0x3be8('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x3be8('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x3be8('0x7')]('in',_0x3be8('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3be8('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x3be8('0x7')]('in',_0x3be8('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index e557fd4..0126461 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 _0x9e2e=['json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','end','error','stack','name','send','Users','map','fullname','Tags','TagIds','split','forEach','MailMessage','findOne','out','plainBody','-id','lastMsgText','catch','waiting','talking','answered','unmanaged','total','closed','UserId','index','MailInteraction','rawAttributes','type','key','model','keys','filters','query','attributes','fields','hasOwnProperty','nolimit','sort','pick','field','from','tools_tags','u.id','u.fullname','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','mail_accounts','a.id\x20=\x20i.MailAccountId','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','compact','isEmpty','where','concat','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','Sequelize','QueryTypes','SELECT','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','role','agent','toString','length','sequelize','keyBy','merge','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.MailAccountId','i.UserId','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','MailInteractionId','Setting','enableEmailPreview','push','all','show','params','intersection','include','options','body','describe','addMessage','ids','getMessages','format','includeAll','findAll','inlineCss','rows','addTags','setTags','omit','spread','color','mailInteractionTags:save','removeTags','download','unix','root','server','files','tmp','join','transcript-%d-%s.zip','Messages','bcc','get','mkdirSync','each','subject','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','bluebird','lodash','squel','juice','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','html-entities','redis','localhost','./mailInteraction.socket','sendStatus','status'];(function(_0x2ee4e8,_0x462ee2){var _0x309879=function(_0x5d6d53){while(--_0x5d6d53){_0x2ee4e8['push'](_0x2ee4e8['shift']());}};_0x309879(++_0x462ee2);}(_0x9e2e,0xd6));var _0xe9e2=function(_0x351579,_0x44e75d){_0x351579=_0x351579-0x0;var _0x841a32=_0x9e2e[_0x351579];return _0x841a32;};'use strict';var emlformat=require(_0xe9e2('0x0'));var rimraf=require(_0xe9e2('0x1'));var zipdir=require(_0xe9e2('0x2'));var moment=require('moment');var BPromise=require(_0xe9e2('0x3'));var util=require('util');var path=require('path');var fs=require('fs');var _=require(_0xe9e2('0x4'));var squel=require(_0xe9e2('0x5'));var juice=require(_0xe9e2('0x6'));var Redis=require(_0xe9e2('0x7'));var qs=require(_0xe9e2('0x8'));var as=require(_0xe9e2('0x9'));var logger=require(_0xe9e2('0xa'))('api');var config=require(_0xe9e2('0xb'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0xe9e2('0xc'));config[_0xe9e2('0xd')]=_['defaults'](config[_0xe9e2('0xd')],{'host':_0xe9e2('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe9e2('0xd')]));require(_0xe9e2('0xf'))['register'](socket);function respondWithStatusCode(_0x53e3c5,_0x116094){_0x116094=_0x116094||0xcc;return function(_0x359f9c){if(_0x359f9c){return _0x53e3c5[_0xe9e2('0x10')](_0x116094);}return _0x53e3c5[_0xe9e2('0x11')](_0x116094)['end']();};}function respondWithResult(_0x57286f,_0x1b6493){_0x1b6493=_0x1b6493||0xc8;return function(_0xc13a68){if(_0xc13a68){return _0x57286f[_0xe9e2('0x11')](_0x1b6493)[_0xe9e2('0x12')](_0xc13a68);}};}function respondWithFilteredResult(_0x13bfad,_0x23331d){return function(_0x41ea08){if(_0x41ea08){var _0x1ba905=typeof _0x23331d[_0xe9e2('0x13')]===_0xe9e2('0x14')&&typeof _0x23331d['limit']==='undefined';var _0x117e38=_0x41ea08['count'];var _0x533e9e=_0x1ba905?0x0:_0x23331d[_0xe9e2('0x13')];var _0x28aff7=_0x1ba905?_0x41ea08[_0xe9e2('0x15')]:_0x23331d[_0xe9e2('0x13')]+_0x23331d[_0xe9e2('0x16')];var _0x25d70f;if(_0x28aff7>=_0x117e38){_0x28aff7=_0x117e38;_0x25d70f=0xc8;}else{_0x25d70f=0xce;}_0x13bfad['status'](_0x25d70f);return _0x13bfad[_0xe9e2('0x17')](_0xe9e2('0x18'),_0x533e9e+'-'+_0x28aff7+'/'+_0x117e38)[_0xe9e2('0x12')](_0x41ea08);}return null;};}function saveUpdates(_0x5b804f){return function(_0x36a67d){if(_0x36a67d){return _0x36a67d[_0xe9e2('0x19')](_0x5b804f)[_0xe9e2('0x1a')](function(_0x4e10cd){return _0x4e10cd;});}return null;};}function removeEntity(_0x2c09aa){return function(_0x1d8dc2){if(_0x1d8dc2){return _0x1d8dc2[_0xe9e2('0x1b')]()['then'](function(){_0x2c09aa[_0xe9e2('0x11')](0xcc)[_0xe9e2('0x1c')]();});}};}function handleEntityNotFound(_0x456455){return function(_0x3f49d0){if(!_0x3f49d0){_0x456455['sendStatus'](0x194);}return _0x3f49d0;};}function handleError(_0x183680,_0x1655fe){_0x1655fe=_0x1655fe||0x1f4;return function(_0x3b1098){logger[_0xe9e2('0x1d')](_0x3b1098[_0xe9e2('0x1e')]);if(_0x3b1098[_0xe9e2('0x1f')]){delete _0x3b1098[_0xe9e2('0x1f')];}_0x183680[_0xe9e2('0x11')](_0x1655fe)[_0xe9e2('0x20')](_0x3b1098);};}function getInteractionUsers(_0x2a7ffc,_0x1c22f6){return new BPromise(function(_0x2e8577,_0x2a3d69){try{if(_0x1c22f6[_0x2a7ffc['id']]){_0x2a7ffc[_0xe9e2('0x21')]=_[_0xe9e2('0x22')](_0x1c22f6[_0x2a7ffc['id']],function(_0x1bf061){return{'id':_0x1bf061['id'],'fullname':_0x1bf061[_0xe9e2('0x23')]};});}}catch(_0x4d4343){_0x2a3d69(_0x4d4343);}_0x2e8577(_0x2a7ffc);});}function getInteractionTags(_0x43445d,_0x435dc4){return new BPromise(function(_0x32775d,_0x3094f0){try{if(_0x43445d['TagIds']){_0x43445d[_0xe9e2('0x24')]=[];_0x43445d[_0xe9e2('0x25')][_0xe9e2('0x26')](',')[_0xe9e2('0x27')](function(_0x257a3a){_0x43445d['Tags']['push'](_0x435dc4[_0x257a3a]);});}delete _0x43445d[_0xe9e2('0x25')];}catch(_0x242319){_0x3094f0(_0x242319);}_0x32775d(_0x43445d);});}function getLastMessageText(_0x20113c){return new BPromise(function(_0x39e7c5,_0x656494){return db[_0xe9e2('0x28')][_0xe9e2('0x29')]({'where':{'$and':[{'MailInteractionId':_0x20113c['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xe9e2('0x2a')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xe9e2('0x2b')],'order':_0xe9e2('0x2c'),'raw':!![]})[_0xe9e2('0x1a')](function(_0xbeb203){if(_0xbeb203&&_0xbeb203[_0xe9e2('0x2b')]){_0x20113c[_0xe9e2('0x2d')]=_['trimStart'](_0xbeb203['plainBody']);}_0x39e7c5(_0x20113c);})[_0xe9e2('0x2e')](function(_0xecccbc){_0x656494(_0xecccbc);});});}function updateMailInteraction(_0x498e12,_0x2e2d55,_0x13a230,_0x3229ed){return new BPromise(function(_0x5be732,_0x21dcdc){return getInteractionUsers(_0x498e12,_0x13a230)[_0xe9e2('0x1a')](function(_0xe3624a){return getInteractionTags(_0xe3624a,_0x2e2d55);})[_0xe9e2('0x1a')](function(_0x573038){return getStateInteraction(_0x573038);})[_0xe9e2('0x1a')](function(_0x245392){if(_0x3229ed){_0x5be732(getLastMessageText(_0x245392));}else{_0x5be732(_0x245392);}})[_0xe9e2('0x2e')](function(_0x4a84bd){_0x21dcdc(_0x4a84bd);});});}function getStateInteraction(_0x47e133){return new BPromise(function(_0x3f66ab){_0x47e133[_0xe9e2('0x2f')]=0x0;_0x47e133[_0xe9e2('0x30')]=0x0;_0x47e133[_0xe9e2('0x31')]=0x0;_0x47e133[_0xe9e2('0x32')]=0x0;_0x47e133[_0xe9e2('0x33')]=0x0;if(!_0x47e133[_0xe9e2('0x34')]&&!_0x47e133['UserId']){_0x47e133['waiting']+=0x1;}if(!_0x47e133[_0xe9e2('0x34')]&&_0x47e133['UserId']){_0x47e133[_0xe9e2('0x30')]+=0x1;if(_0x47e133[_0xe9e2('0x2f')]){_0x47e133['waiting']-=0x1;}}if(_0x47e133[_0xe9e2('0x34')]&&_0x47e133[_0xe9e2('0x35')]){_0x47e133['answered']+=0x1;if(_0x47e133[_0xe9e2('0x30')]){_0x47e133[_0xe9e2('0x30')]-=0x1;}}if(_0x47e133['closed']&&!_0x47e133['UserId']){_0x47e133[_0xe9e2('0x32')]+=0x1;if(_0x47e133[_0xe9e2('0x2f')]){_0x47e133[_0xe9e2('0x2f')]-=0x1;}}_0x47e133['total']+=0x1;_0x3f66ab(_0x47e133);});}exports[_0xe9e2('0x36')]=function(_0x4f9970,_0x176d78){var _0x1041d9={},_0x1a3991={},_0x2be7be={'count':0x0,'rows':[]};var _0x1e3bf9=_[_0xe9e2('0x22')](db[_0xe9e2('0x37')][_0xe9e2('0x38')],function(_0x5815ec){return{'name':_0x5815ec['fieldName'],'type':_0x5815ec[_0xe9e2('0x39')][_0xe9e2('0x3a')]};});_0x1a3991[_0xe9e2('0x3b')]=_[_0xe9e2('0x22')](_0x1e3bf9,_0xe9e2('0x1f'));_0x1a3991['query']=_[_0xe9e2('0x3c')](_0x4f9970['query']);_0x1a3991[_0xe9e2('0x3d')]=_['intersection'](_0x1a3991[_0xe9e2('0x3b')],_0x1a3991[_0xe9e2('0x3e')]);_0x1041d9[_0xe9e2('0x3f')]=_['intersection'](_0x1a3991[_0xe9e2('0x3b')],qs[_0xe9e2('0x40')](_0x4f9970[_0xe9e2('0x3e')][_0xe9e2('0x40')]));_0x1041d9[_0xe9e2('0x3f')]=_0x1041d9[_0xe9e2('0x3f')]['length']?_0x1041d9['attributes']:_0x1a3991[_0xe9e2('0x3b')];if(!_0x4f9970[_0xe9e2('0x3e')][_0xe9e2('0x41')](_0xe9e2('0x42'))){_0x1041d9[_0xe9e2('0x16')]=qs[_0xe9e2('0x16')](_0x4f9970['query'][_0xe9e2('0x16')]);_0x1041d9['offset']=qs['offset'](_0x4f9970[_0xe9e2('0x3e')][_0xe9e2('0x13')]);}_0x1041d9['order']=qs['sort'](_0x4f9970[_0xe9e2('0x3e')][_0xe9e2('0x43')]);_0x1041d9['where']=qs['filters'](_[_0xe9e2('0x44')](_0x4f9970[_0xe9e2('0x3e')],_0x1a3991[_0xe9e2('0x3d')]),_0x1e3bf9);var _0x45e1be=[];var _0x709e6d=squel['select']()[_0xe9e2('0x45')]('id')[_0xe9e2('0x45')](_0xe9e2('0x1f'))[_0xe9e2('0x45')]('color')[_0xe9e2('0x46')](_0xe9e2('0x47'));var _0x5e5b43=squel['select']()[_0xe9e2('0x45')](_0xe9e2('0x48'))[_0xe9e2('0x45')](_0xe9e2('0x49'))[_0xe9e2('0x45')]('ui.MailInteractionId')[_0xe9e2('0x46')](_0xe9e2('0x4a'),'ui')[_0xe9e2('0x4b')](_0xe9e2('0x4c'),'u',_0xe9e2('0x4d'));var _0x568625=squel['select']()[_0xe9e2('0x46')](_0xe9e2('0x4e'),'i')[_0xe9e2('0x4b')]('cm_contacts','c',_0xe9e2('0x4f'))[_0xe9e2('0x4b')](_0xe9e2('0x4c'),'o','o.id\x20=\x20i.UserId')[_0xe9e2('0x4b')](_0xe9e2('0x50'),'a',_0xe9e2('0x51'))[_0xe9e2('0x4b')]('mail_messages','me',_0xe9e2('0x52'))[_0xe9e2('0x4b')](_0xe9e2('0x53'),'it',_0xe9e2('0x54'))[_0xe9e2('0x4b')](_0xe9e2('0x47'),'t','t.id\x20=\x20it.TagId');var _0x2390f1=squel[_0xe9e2('0x55')]();var _0x32221f=[];var _0x695eaa=squel[_0xe9e2('0x55')]();var _0x4bdce1;if(_0x4f9970[_0xe9e2('0x3e')][_0xe9e2('0x56')]){_0x4bdce1=as[_0xe9e2('0x57')](_0x4f9970[_0xe9e2('0x3e')][_0xe9e2('0x56')]);var _0x1c4947=_0x4bdce1['sqlOperator'];for(var _0x485022=0x0;_0x485022<_0x4bdce1[_0xe9e2('0x58')]['length'];_0x485022++){var _0x4260df=_0x4bdce1[_0xe9e2('0x58')][_0x485022];var _0x46b6ad='i';var _0x3109b5=_[_0xe9e2('0x59')](_0x1e3bf9,['name',_0x4260df['field']]);if(!_0x3109b5){switch(_0x4260df[_0xe9e2('0x45')]){case _0xe9e2('0x5a'):if(_0x4260df['value']==0x1){_0x568625[_0xe9e2('0x5b')]('`'+_0x4260df[_0xe9e2('0x45')]+_0xe9e2('0x5c'));}else{_0x568625[_0xe9e2('0x5b')]('`'+_0x4260df[_0xe9e2('0x45')]+_0xe9e2('0x5d'));}break;case _0xe9e2('0x5e'):if(_0x4260df[_0xe9e2('0x5f')]===_0xe9e2('0x60')){if(_0x4260df[_0xe9e2('0x61')][_0xe9e2('0x26')]('\x20')['length']>0x1){_0x2390f1[_0x1c4947]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xe9e2('0x62')](_0x4260df[_0xe9e2('0x61')]),null);}else{var _0x309d3d='%'+_0x4260df[_0xe9e2('0x61')]+'%';_0x2390f1[_0x1c4947](_0xe9e2('0x63'),_0x309d3d,_0x309d3d,_0x309d3d);}}else{_0x3109b5=_[_0xe9e2('0x59')](_0x1e3bf9,[_0xe9e2('0x1f'),'ContactId']);_0x4260df[_0xe9e2('0x45')]=_0xe9e2('0x64');_0x452b62=as[_0xe9e2('0x65')](_0x46b6ad,_0x3109b5[_0xe9e2('0x39')],_0x4260df);_0x2390f1[_0x1c4947](_0x452b62[_0xe9e2('0x66')],_0x452b62['value'][_0xe9e2('0x67')],_0x452b62[_0xe9e2('0x61')]['end']);}break;case'Tag':var _0x40af0a=_0x4260df[_0xe9e2('0x61')]['split'](',')[_0xe9e2('0x22')](function(_0x6a68d1){return Number(_0x6a68d1);});_0x40af0a['forEach'](function(_0x35b743){_0x695eaa['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x35b743+',%');});_0x32221f=_[_0xe9e2('0x68')](_0x32221f,_0x40af0a);break;case _0xe9e2('0x69'):if(_0x4260df[_0xe9e2('0x5f')]===_0xe9e2('0x60')){_0x2390f1[_0x1c4947](_0xe9e2('0x6a'),'%'+_0x4260df[_0xe9e2('0x61')]+'%',null);}else{_0x3109b5=_[_0xe9e2('0x59')](_0x1e3bf9,[_0xe9e2('0x1f'),_0xe9e2('0x35')]);_0x4260df[_0xe9e2('0x45')]='UserId';_0x452b62=as[_0xe9e2('0x65')](_0x46b6ad,_0x3109b5['type'],_0x4260df);_0x2390f1[_0x1c4947](_0x452b62[_0xe9e2('0x66')],_0x452b62[_0xe9e2('0x61')][_0xe9e2('0x67')],_0x452b62[_0xe9e2('0x61')][_0xe9e2('0x1c')]);}break;case _0xe9e2('0x2b'):_0x452b62=as['buildExpression']('me',null,_0x4260df);_0x2390f1[_0x1c4947](_0x452b62['text'],_0x452b62[_0xe9e2('0x61')][_0xe9e2('0x67')],_0x452b62[_0xe9e2('0x61')][_0xe9e2('0x1c')]);break;}}else{var _0x452b62=as['buildExpression'](_0x46b6ad,_0x3109b5['type'],_0x4260df);_0x2390f1[_0x1c4947](_0x452b62[_0xe9e2('0x66')],_0x452b62['value'][_0xe9e2('0x67')],_0x452b62[_0xe9e2('0x61')][_0xe9e2('0x1c')]);}}}else{var _0x315329=_(_0x4f9970[_0xe9e2('0x3e')])[_0xe9e2('0x3c')]()['map'](function(_0x530fcd){return _[_0xe9e2('0x6b')](_0x1e3bf9,[_0xe9e2('0x1f'),_0x530fcd])?_0x530fcd:undefined;})[_0xe9e2('0x6c')]()[_0xe9e2('0x61')]();if(!_[_0xe9e2('0x6d')](_0x315329)){_0x315329['forEach'](function(_0x3234be){if(_0x3234be==='MailAccountId'){_0x568625[_0xe9e2('0x6e')]('i.MailAccountId\x20IN\x20?',[][_0xe9e2('0x6f')](_0x4f9970['query'][_0x3234be]));}else if(_0x3234be==='createdAt'){var _0x3ef8cc=JSON['parse'](_0x4f9970[_0xe9e2('0x3e')][_0x3234be])[_0xe9e2('0x70')];var _0x355ed2=JSON[_0xe9e2('0x71')](_0x4f9970['query'][_0x3234be])[_0xe9e2('0x72')];_0x568625[_0xe9e2('0x6e')](_0xe9e2('0x73'),_0x3ef8cc,_0x355ed2);}else{if(_0x4f9970['query'][_0x3234be]===_0xe9e2('0x74')){_0x568625[_0xe9e2('0x6e')]('i.'+_0x3234be+'\x20IS\x20NULL');}else{_0x568625[_0xe9e2('0x6e')]('i.'+_0x3234be+_0xe9e2('0x75'),_0x4f9970[_0xe9e2('0x3e')][_0x3234be]);}}});}if(_0x4f9970[_0xe9e2('0x3e')]['read']){if(_0x4f9970[_0xe9e2('0x3e')]['read']==0x1){_0x568625[_0xe9e2('0x5b')](_0xe9e2('0x76'));}else{_0x568625['having'](_0xe9e2('0x77'));}}if(_0x4f9970[_0xe9e2('0x3e')][_0xe9e2('0x78')]){_0x32221f=_['isArray'](_0x4f9970['query']['tag'])?_0x4f9970[_0xe9e2('0x3e')]['tag']:new Array(_0x4f9970['query']['tag']);_0x32221f[_0xe9e2('0x27')](function(_0x33473d){_0x695eaa['or'](_0xe9e2('0x79'),'%,'+_0x33473d+',%');});}if(_0x4f9970[_0xe9e2('0x3e')]['filter']){var _0x127439=_0x4f9970['query'][_0xe9e2('0x7a')][_0xe9e2('0x7b')]('\x5c','\x5c\x5c')[_0xe9e2('0x7b')](/'/g,'\x27\x27');if(qs[_0xe9e2('0x7c')](_0x127439)){_0x2390f1['or'](_0xe9e2('0x7d'),_0x127439+'%');}else if(qs['isEmail'](_0x127439)){_0x2390f1['or'](_0xe9e2('0x7e'),_0x127439+'%');}else{_0x2390f1['or'](_0xe9e2('0x7f'),qs[_0xe9e2('0x62')](_0x127439))['or'](_0xe9e2('0x80'),qs[_0xe9e2('0x62')](_0x127439));}}}_0x568625[_0xe9e2('0x6e')](_0x2390f1);_0x568625['group']('i.id');var _0x1ffee6={'type':db[_0xe9e2('0x81')][_0xe9e2('0x82')][_0xe9e2('0x83')],'raw':!![]};var _0x37b12c=_0x568625['clone']();_0x37b12c[_0xe9e2('0x45')](_0xe9e2('0x84'));_0x37b12c[_0xe9e2('0x45')](_0xe9e2('0x85'),_0xe9e2('0x5a'));if(_0x1041d9[_0xe9e2('0x86')]){_0x1041d9[_0xe9e2('0x86')][_0xe9e2('0x27')](function(_0x206391){var _0x1a0be8=_0x206391[0x0]===_0xe9e2('0x87')?_0x206391[0x0]:'i.'+_0x206391[0x0];_0x568625[_0xe9e2('0x86')](_0x1a0be8,_0x206391[0x1]===_0xe9e2('0x88')?![]:!![]);});}if(!_['isEmpty'](_0x32221f)){_0x568625[_0xe9e2('0x5b')](_0x695eaa);_0x37b12c[_0xe9e2('0x6e')](_0xe9e2('0x89'),_0x32221f);}BPromise[_0xe9e2('0x8a')]()[_0xe9e2('0x1a')](function(){if(!_0x4bdce1){if(_0x4f9970[_0xe9e2('0x3e')][_0xe9e2('0x8b')])return;_0x37b12c[_0xe9e2('0x6e')](_0xe9e2('0x8c'));_0x568625[_0xe9e2('0x6e')](_0xe9e2('0x8c'));return;}if(_0x4f9970['user']['role']!=='agent')return;return _0x4f9970[_0xe9e2('0x8d')][_0xe9e2('0x8e')]({'attributes':['id'],'raw':!![]})[_0xe9e2('0x1a')](function(_0x252f55){if(_[_0xe9e2('0x6d')](_0x252f55)){_0x37b12c['where'](_0xe9e2('0x8f'));_0x568625['where'](_0xe9e2('0x8f'));}else{_0x37b12c['where']('i.MailAccountId\x20IN\x20?',_[_0xe9e2('0x22')](_0x252f55,'id'));_0x568625[_0xe9e2('0x6e')]('i.MailAccountId\x20IN\x20?',_[_0xe9e2('0x22')](_0x252f55,'id'));}});})[_0xe9e2('0x1a')](function(){if(_0x4f9970[_0xe9e2('0x8d')][_0xe9e2('0x90')]===_0xe9e2('0x91')&&!_0x4bdce1&&!_0x4f9970[_0xe9e2('0x3e')][_0xe9e2('0x8b')])return[];return db['sequelize']['query'](_0x37b12c[_0xe9e2('0x92')](),_0x1ffee6);})[_0xe9e2('0x1a')](function(_0x1c7db1){_0x2be7be['count']=_0x1c7db1[_0xe9e2('0x93')];if(_0x2be7be[_0xe9e2('0x15')]===0x0)return[];return db[_0xe9e2('0x94')][_0xe9e2('0x3e')](_0x709e6d[_0xe9e2('0x92')](),_0x1ffee6)[_0xe9e2('0x1a')](function(_0x4fee43){_0x45e1be=_[_0xe9e2('0x95')](_0x4fee43,'id');_0x1ffee6=_[_0xe9e2('0x96')](_0x1ffee6,{'model':db[_0xe9e2('0x37')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4f9970[_0xe9e2('0x3e')]['fields']){_0x1041d9['attributes'][_0xe9e2('0x27')](function(_0x5a7c2b){_0x568625[_0xe9e2('0x45')]('i.'+_0x5a7c2b);});}else{_0x568625[_0xe9e2('0x45')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xe9e2('0x5a'));_0x568625['field']('a.key',_0xe9e2('0x97'));_0x568625['field'](_0xe9e2('0x98'),_0xe9e2('0x99'));_0x568625['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',_0xe9e2('0x87'));_0x568625[_0xe9e2('0x45')]('i.id');_0x568625[_0xe9e2('0x45')](_0xe9e2('0x9a'));_0x568625[_0xe9e2('0x45')](_0xe9e2('0x9b'));_0x568625['field'](_0xe9e2('0x9c'));_0x568625[_0xe9e2('0x45')]('i.closedAt');_0x568625[_0xe9e2('0x45')](_0xe9e2('0x9d'));_0x568625['field'](_0xe9e2('0x9e'));_0x568625[_0xe9e2('0x45')](_0xe9e2('0x9f'));_0x568625['field'](_0xe9e2('0xa0'));_0x568625[_0xe9e2('0x45')](_0xe9e2('0xa1'));_0x568625[_0xe9e2('0x45')](_0xe9e2('0xa2'));_0x568625[_0xe9e2('0x45')](_0xe9e2('0xa3'));_0x568625[_0xe9e2('0x45')](_0xe9e2('0xa4'));_0x568625[_0xe9e2('0x45')](_0xe9e2('0xa5'));_0x568625['field']('i.ContactId');_0x568625['field'](_0xe9e2('0xa6'));_0x568625[_0xe9e2('0x45')](_0xe9e2('0xa7'));_0x568625['field']('c.firstName','Contact.firstName');_0x568625[_0xe9e2('0x45')](_0xe9e2('0xa8'),_0xe9e2('0xa9'));_0x568625[_0xe9e2('0x45')](_0xe9e2('0xaa'),_0xe9e2('0xab'));_0x568625[_0xe9e2('0x45')](_0xe9e2('0xac'),_0xe9e2('0xad'));_0x568625[_0xe9e2('0x45')](_0xe9e2('0xae'),'Contact.mobile');_0x568625['field'](_0xe9e2('0xaf'),'Contact.fax');_0x568625[_0xe9e2('0x45')](_0xe9e2('0xb0'),_0xe9e2('0xb1'));_0x568625[_0xe9e2('0x45')]('o.internal',_0xe9e2('0xb2'));_0x568625['field'](_0xe9e2('0xb3'),_0xe9e2('0x25'));}if(_0x1041d9[_0xe9e2('0x16')])_0x568625['limit'](_0x1041d9['limit']);if(_0x1041d9['offset'])_0x568625['offset'](_0x1041d9['offset']);return db[_0xe9e2('0x94')][_0xe9e2('0x3e')](_0x568625['toString'](),_0x1ffee6);})[_0xe9e2('0x1a')](function(_0x21b01d){if(_0x21b01d['length']>0x0)_0x5e5b43[_0xe9e2('0x6e')]('ui.MailInteractionId\x20IN\x20?',_['map'](_0x21b01d,'id'));return db[_0xe9e2('0x94')]['query'](_0x5e5b43[_0xe9e2('0x92')](),_0x1ffee6)[_0xe9e2('0x1a')](function(_0x53d77b){var _0x3e5380=_[_0xe9e2('0xb4')](_0x53d77b,_0xe9e2('0xb5'));var _0x263464=[];return db[_0xe9e2('0xb6')][_0xe9e2('0x29')]({'attributes':[_0xe9e2('0xb7')],'raw':!![]})[_0xe9e2('0x1a')](function(_0x367a33){var _0x52c5da=_0x367a33[_0xe9e2('0xb7')];_0x21b01d['forEach'](function(_0x4cde0f){_0x263464[_0xe9e2('0xb8')](updateMailInteraction(_0x4cde0f,_0x45e1be,_0x3e5380,_0x52c5da));});return BPromise[_0xe9e2('0xb9')](_0x263464);});});});})[_0xe9e2('0x1a')](function(_0x39a793){_0x2be7be['rows']=_0x39a793;return _0x2be7be;})[_0xe9e2('0x1a')](respondWithFilteredResult(_0x176d78,_0x1041d9))['catch'](handleError(_0x176d78,null));};exports[_0xe9e2('0xba')]=function(_0x2ac065,_0x355ed3){var _0x161efa={'raw':![],'where':{'id':_0x2ac065[_0xe9e2('0xbb')]['id']}},_0x45d013={};_0x45d013[_0xe9e2('0x3b')]=_[_0xe9e2('0x3c')](db[_0xe9e2('0x37')][_0xe9e2('0x38')]);_0x45d013[_0xe9e2('0x3e')]=_[_0xe9e2('0x3c')](_0x2ac065[_0xe9e2('0x3e')]);_0x45d013[_0xe9e2('0x3d')]=_[_0xe9e2('0xbc')](_0x45d013[_0xe9e2('0x3b')],_0x45d013[_0xe9e2('0x3e')]);_0x161efa[_0xe9e2('0x3f')]=_['intersection'](_0x45d013['model'],qs['fields'](_0x2ac065[_0xe9e2('0x3e')]['fields']));_0x161efa[_0xe9e2('0x3f')]=_0x161efa[_0xe9e2('0x3f')][_0xe9e2('0x93')]?_0x161efa[_0xe9e2('0x3f')]:_0x45d013[_0xe9e2('0x3b')];if(_0x2ac065[_0xe9e2('0x3e')]['includeAll']){_0x161efa[_0xe9e2('0xbd')]=[{'all':!![]}];}_0x161efa=_['merge']({},_0x161efa,_0x2ac065[_0xe9e2('0xbe')]);return db[_0xe9e2('0x37')]['find'](_0x161efa)[_0xe9e2('0x1a')](handleEntityNotFound(_0x355ed3,null))[_0xe9e2('0x1a')](respondWithResult(_0x355ed3,null))[_0xe9e2('0x2e')](handleError(_0x355ed3,null));};exports['create']=function(_0x1a79d1,_0x52a732){return db[_0xe9e2('0x37')]['create'](_0x1a79d1[_0xe9e2('0xbf')],{})[_0xe9e2('0x1a')](respondWithResult(_0x52a732,0xc9))[_0xe9e2('0x2e')](handleError(_0x52a732,null));};exports[_0xe9e2('0x19')]=function(_0x514310,_0x4e3d47){if(_0x514310[_0xe9e2('0xbf')]['id']){delete _0x514310['body']['id'];}return db[_0xe9e2('0x37')][_0xe9e2('0x59')]({'where':{'id':_0x514310[_0xe9e2('0xbb')]['id']}})[_0xe9e2('0x1a')](handleEntityNotFound(_0x4e3d47,null))['then'](saveUpdates(_0x514310[_0xe9e2('0xbf')],null))[_0xe9e2('0x1a')](respondWithResult(_0x4e3d47,null))[_0xe9e2('0x2e')](handleError(_0x4e3d47,null));};exports['destroy']=function(_0x4e74ed,_0x44cc9b){return db[_0xe9e2('0x37')][_0xe9e2('0x59')]({'where':{'id':_0x4e74ed[_0xe9e2('0xbb')]['id']}})['then'](handleEntityNotFound(_0x44cc9b,null))[_0xe9e2('0x1a')](removeEntity(_0x44cc9b,null))[_0xe9e2('0x2e')](handleError(_0x44cc9b,null));};exports['describe']=function(_0x573cca,_0xa8910e){return db['MailInteraction'][_0xe9e2('0xc0')]()[_0xe9e2('0x1a')](respondWithResult(_0xa8910e,null))[_0xe9e2('0x2e')](handleError(_0xa8910e,null));};exports[_0xe9e2('0xc1')]=function(_0x32dedf,_0x4c008f){return db[_0xe9e2('0x28')][_0xe9e2('0x59')]({'where':{'id':_0x32dedf[_0xe9e2('0xbb')]['id']}})[_0xe9e2('0x1a')](handleEntityNotFound(_0x4c008f,null))[_0xe9e2('0x1a')](function(_0x341079){if(_0x341079){return _0x341079[_0xe9e2('0xc1')](_0x32dedf['body'][_0xe9e2('0xc2')],_['omit'](_0x32dedf[_0xe9e2('0xbf')],[_0xe9e2('0xc2'),'id'])||{});}})[_0xe9e2('0x1a')](respondWithResult(_0x4c008f,null))['catch'](handleError(_0x4c008f,null));};exports[_0xe9e2('0xc3')]=function(_0x239306,_0x59f132){var _0x368066={'raw':![],'where':{}};var _0x166ae3={};var _0x5c2c6a={'count':0x0,'rows':[]};return db['MailInteraction'][_0xe9e2('0x29')]({'where':{'id':_0x239306[_0xe9e2('0xbb')]['id']}})['then'](handleEntityNotFound(_0x59f132,null))[_0xe9e2('0x1a')](function(_0x2a3a5d){if(_0x2a3a5d){_0x166ae3[_0xe9e2('0x3b')]=_[_0xe9e2('0x3c')](db[_0xe9e2('0x28')][_0xe9e2('0x38')]);_0x166ae3[_0xe9e2('0x3e')]=_[_0xe9e2('0x3c')](_0x239306[_0xe9e2('0x3e')]);_0x166ae3['filters']=_['intersection'](_0x166ae3[_0xe9e2('0x3b')],_0x166ae3[_0xe9e2('0x3e')]);_0x368066['attributes']=_[_0xe9e2('0xbc')](_0x166ae3['model'],qs[_0xe9e2('0x40')](_0x239306['query'][_0xe9e2('0x40')]));_0x368066['attributes']=_0x368066[_0xe9e2('0x3f')]['length']?_0x368066[_0xe9e2('0x3f')]:_0x166ae3[_0xe9e2('0x3b')];if(!_0x239306[_0xe9e2('0x3e')][_0xe9e2('0x41')](_0xe9e2('0x42'))){_0x368066[_0xe9e2('0x16')]=qs[_0xe9e2('0x16')](_0x239306[_0xe9e2('0x3e')][_0xe9e2('0x16')]);_0x368066['offset']=qs[_0xe9e2('0x13')](_0x239306[_0xe9e2('0x3e')][_0xe9e2('0x13')]);}_0x368066[_0xe9e2('0x86')]=qs[_0xe9e2('0x43')](_0x239306[_0xe9e2('0x3e')][_0xe9e2('0x43')]);_0x368066[_0xe9e2('0x6e')]=qs['filters'](_[_0xe9e2('0x44')](_0x239306[_0xe9e2('0x3e')],_0x166ae3['filters']));_0x368066[_0xe9e2('0x6e')]['MailInteractionId']=_0x2a3a5d['id'];if(_0x239306['query'][_0xe9e2('0x7a')]){_0x368066[_0xe9e2('0x6e')]=_['merge'](_0x368066[_0xe9e2('0x6e')],{'$or':_['map'](_0x368066[_0xe9e2('0x3f')],function(_0x4e5ab3){var _0x410f75={};_0x410f75[_0x4e5ab3]={'$like':'%'+_0x239306[_0xe9e2('0x3e')]['filter']+'%'};return _0x410f75;})});}if(_0x239306[_0xe9e2('0x3e')][_0xe9e2('0x70')]){var _0x5ee286=_0x239306[_0xe9e2('0x3e')][_0xe9e2('0x70')]['split'](',');var _0x1c1f24={};_0x1c1f24[_0x5ee286[0x0]]={'$gte':moment(_0x5ee286[0x1])[_0xe9e2('0xc4')]('YYYY-MM-DD\x20HH:mm:ss')};_0x368066[_0xe9e2('0x6e')]=_['merge'](_0x368066[_0xe9e2('0x6e')],_0x1c1f24);}_0x368066=_[_0xe9e2('0x96')]({},_0x368066,_0x239306[_0xe9e2('0xbe')]);return db['MailMessage'][_0xe9e2('0x15')]({'where':_0x368066['where']})['then'](function(_0x3fd6b5){_0x5c2c6a[_0xe9e2('0x15')]=_0x3fd6b5;if(_0x239306[_0xe9e2('0x3e')][_0xe9e2('0xc5')]){_0x368066['include']=[{'all':!![]}];}return db['MailMessage'][_0xe9e2('0xc6')](_0x368066);})[_0xe9e2('0x1a')](function(_0x51f4b0){if(_0x239306[_0xe9e2('0x3e')][_0xe9e2('0xc7')]==='true'){for(var _0x219673=0x0;_0x219673<_0x51f4b0[_0xe9e2('0x93')];_0x219673++){_0x51f4b0[_0x219673][_0xe9e2('0xbf')]=juice(_0x51f4b0[_0x219673]['body']);}}_0x5c2c6a[_0xe9e2('0xc8')]=_0x51f4b0;return _0x5c2c6a;});}})[_0xe9e2('0x1a')](respondWithFilteredResult(_0x59f132,_0x368066))['catch'](handleError(_0x59f132,null));};exports[_0xe9e2('0xc9')]=function(_0x4ae986,_0x4743bb){return db[_0xe9e2('0x37')][_0xe9e2('0x59')]({'where':{'id':_0x4ae986['params']['id']}})[_0xe9e2('0x1a')](handleEntityNotFound(_0x4743bb,null))[_0xe9e2('0x1a')](function(_0x497add){if(_0x497add){return _0x497add[_0xe9e2('0xca')](_0x4ae986[_0xe9e2('0xbf')]['ids'],_[_0xe9e2('0xcb')](_0x4ae986[_0xe9e2('0xbf')],[_0xe9e2('0xc2'),'id'])||{})[_0xe9e2('0xcc')](function(){return db['Tag'][_0xe9e2('0xc6')]({'attributes':['id',_0xe9e2('0x1f'),_0xe9e2('0xcd')],'where':{'id':_0x4ae986['body'][_0xe9e2('0xc2')]}});})[_0xe9e2('0x1a')](function(_0x432351){socket['emit'](_0xe9e2('0xce'),{'id':Number(_0x4ae986[_0xe9e2('0xbb')]['id']),'tags':_0x432351||[]});return{'id':Number(_0x4ae986['params']['id']),'tags':_0x432351||[]};});}})[_0xe9e2('0x1a')](respondWithResult(_0x4743bb,null))['catch'](handleError(_0x4743bb,null));};exports[_0xe9e2('0xcf')]=function(_0x18cc6e,_0x14c300){return db[_0xe9e2('0x37')]['find']({'where':{'id':_0x18cc6e[_0xe9e2('0xbb')]['id']}})[_0xe9e2('0x1a')](handleEntityNotFound(_0x14c300,null))[_0xe9e2('0x1a')](function(_0x2c112d){if(_0x2c112d){return _0x2c112d[_0xe9e2('0xcf')](_0x18cc6e['query'][_0xe9e2('0xc2')]);}})[_0xe9e2('0x1a')](respondWithStatusCode(_0x14c300,null))[_0xe9e2('0x2e')](handleError(_0x14c300,null));};exports[_0xe9e2('0xd0')]=function(_0x52a2af,_0x38dac5){var _0x217a19=moment()[_0xe9e2('0xd1')]()[_0xe9e2('0x92')]();var _0x5b5388=path['join'](config[_0xe9e2('0xd2')],_0xe9e2('0xd3'),_0xe9e2('0xd4'),_0xe9e2('0xd5'));var _0x5fa1d=path[_0xe9e2('0xd6')](config[_0xe9e2('0xd2')],_0xe9e2('0xd3'),_0xe9e2('0xd4'),'attachments');var _0x4003db=path[_0xe9e2('0xd6')](_0x5b5388,_0x217a19);var _0x10db69=util[_0xe9e2('0xc4')](_0xe9e2('0xd7'),_0x52a2af['params']['id'],_0x217a19);var _0x6fbbe9=path[_0xe9e2('0xd6')](_0x5b5388,_0x10db69);var _0x27f91f=[];if(_0x52a2af[_0xe9e2('0x3e')]['attachments']){_0x27f91f[_0xe9e2('0xb8')]({'model':db['Attachment'],'as':'Attachments','raw':!![]});}var _0x5f23ac=[{'model':db[_0xe9e2('0x28')],'as':_0xe9e2('0xd8'),'attributes':['id',_0xe9e2('0xbf'),'from','to','cc',_0xe9e2('0xd9'),'subject','createdAt'],'where':{'secret':![]},'order':qs[_0xe9e2('0x43')]('id'),'include':_0x27f91f}];return db[_0xe9e2('0x37')][_0xe9e2('0x59')]({'where':{'id':_0x52a2af['params']['id']},'include':_0x5f23ac})[_0xe9e2('0x1a')](handleEntityNotFound(_0x38dac5,null))['then'](function(_0x18c1cc){if(_0x18c1cc&&_0x18c1cc[_0xe9e2('0xd8')]){var _0x2cb485=_0x18c1cc[_0xe9e2('0xda')]({'plain':!![]});fs[_0xe9e2('0xdb')](_0x4003db);return BPromise[_0xe9e2('0xdc')](_0x2cb485[_0xe9e2('0xd8')],function(_0x55440f,_0x446655){var _0x26571e={'from':_0x55440f['from'],'to':_0x55440f['to'],'subject':_0x55440f[_0xe9e2('0xdd')],'html':htmlEntities['decode'](_0x55440f[_0xe9e2('0xbf')]),'headers':{'Date':moment(_0x55440f[_0xe9e2('0xde')])[_0xe9e2('0xc4')](_0xe9e2('0xdf'))},'attachments':[]};if(_0x55440f['cc']){_0x26571e[_0xe9e2('0xe0')]['Cc']=_0x55440f['cc'];}if(_0x55440f[_0xe9e2('0xd9')]){_0x26571e[_0xe9e2('0xe0')][_0xe9e2('0xe1')]=_0x55440f['bcc'];}return new BPromise(function(_0x52d54b,_0x560772){if(_0x55440f[_0xe9e2('0xe2')]){for(var _0x59402f=0x0;_0x59402f<_0x55440f[_0xe9e2('0xe2')][_0xe9e2('0x93')];_0x59402f++){var _0x3e5056=_0x55440f[_0xe9e2('0xe2')][_0x59402f];var _0x5cc4a4=path[_0xe9e2('0xd6')](_0x5fa1d,_0x3e5056['basename']);if(fs['existsSync'](_0x5cc4a4)){_0x26571e['attachments'][_0xe9e2('0xb8')]({'name':_0x3e5056['name'],'contentType':_0x3e5056['type'],'data':fs[_0xe9e2('0xe3')](_0x5cc4a4)});}}}emlformat[_0xe9e2('0xe4')](_0x26571e,function(_0x1bcc67,_0x46070e){if(_0x1bcc67)return _0x560772(_0x1bcc67);fs[_0xe9e2('0xe5')](path[_0xe9e2('0xd6')](_0x4003db,util[_0xe9e2('0xc4')](_0xe9e2('0xe6'),_0x446655)),_0x46070e);return _0x52d54b(_0x46070e);});});})['then'](function(){return new BPromise(function(_0x32102d,_0x461df6){zipdir(_0x4003db,{'saveTo':_0x6fbbe9},function(_0x5e075c,_0x552c2d){if(_0x5e075c)return _0x461df6(_0x5e075c);return _0x32102d(_0x552c2d);});})['then'](function(){return new BPromise(function(_0xb176ce,_0x5f387f){rimraf(_0x4003db,function(_0x35acfd){if(_0x35acfd)_0x5f387f(_0x35acfd);return _0xb176ce();});});})[_0xe9e2('0x1a')](function(){return _0x38dac5['download'](_0x6fbbe9,_0x10db69,function(_0x5eeb83){if(!_0x5eeb83)fs[_0xe9e2('0xe7')](_0x6fbbe9);});});});}else{return _0x38dac5[_0xe9e2('0x10')](0xc8);}})[_0xe9e2('0x2e')](handleError(_0x38dac5,null));}; \ No newline at end of file +var _0x6596=['api','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','sendStatus','send','Users','map','TagIds','Tags','split','forEach','push','MailMessage','out','plainBody','-id','lastMsgText','catch','talking','answered','unmanaged','total','closed','waiting','UserId','rawAttributes','fieldName','type','key','keys','intersection','model','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','filters','field','color','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_interaction_has_tags','expr','search','parseSearch','sqlOperator','conditions','name','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','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?','find','ContactId','start','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','buildExpression','some','isEmpty','concat','createdAt','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','i.MailAccountId\x20IN\x20?','toString','sequelize','a.key','Account.key','a.mandatoryDisposition','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','i.createdAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','Setting','enableEmailPreview','all','rows','show','MailInteraction','includeAll','include','options','create','body','params','describe','addMessage','ids','omit','getMessages','pick','merge','$gte','format','findAll','inlineCss','true','addTags','emit','mailInteractionTags:save','removeTags','unix','join','server','files','root','attachments','Attachment','Attachments','Messages','bcc','subject','get','mkdirSync','decode','Bcc','basename','existsSync','readFileSync','build','writeFileSync','message%d.eml','download','unlinkSync','eml-format','rimraf','moment','bluebird','util','path','lodash','squel','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x35ef7a,_0x2b3df3){var _0x3e1c56=function(_0x38b48f){while(--_0x38b48f){_0x35ef7a['push'](_0x35ef7a['shift']());}};_0x3e1c56(++_0x2b3df3);}(_0x6596,0x1d3));var _0x6659=function(_0x331e2b,_0x3d3555){_0x331e2b=_0x331e2b-0x0;var _0x25020e=_0x6596[_0x331e2b];return _0x25020e;};'use strict';var emlformat=require(_0x6659('0x0'));var rimraf=require(_0x6659('0x1'));var zipdir=require('zip-dir');var moment=require(_0x6659('0x2'));var BPromise=require(_0x6659('0x3'));var util=require(_0x6659('0x4'));var path=require(_0x6659('0x5'));var fs=require('fs');var _=require(_0x6659('0x6'));var squel=require(_0x6659('0x7'));var juice=require('juice');var Redis=require('ioredis');var qs=require(_0x6659('0x8'));var as=require(_0x6659('0x9'));var logger=require(_0x6659('0xa'))(_0x6659('0xb'));var config=require(_0x6659('0xc'));var db=require('../../mysqldb')['db'];var htmlEntities=require('html-entities');config[_0x6659('0xd')]=_[_0x6659('0xe')](config[_0x6659('0xd')],{'host':_0x6659('0xf'),'port':0x18eb});var socket=require(_0x6659('0x10'))(new Redis(config[_0x6659('0xd')]));require('./mailInteraction.socket')[_0x6659('0x11')](socket);function respondWithStatusCode(_0x4d1337,_0x499b11){_0x499b11=_0x499b11||0xcc;return function(_0x4a463e){if(_0x4a463e){return _0x4d1337['sendStatus'](_0x499b11);}return _0x4d1337[_0x6659('0x12')](_0x499b11)[_0x6659('0x13')]();};}function respondWithResult(_0x2360fc,_0x438f95){_0x438f95=_0x438f95||0xc8;return function(_0x581baa){if(_0x581baa){return _0x2360fc[_0x6659('0x12')](_0x438f95)[_0x6659('0x14')](_0x581baa);}};}function respondWithFilteredResult(_0x518769,_0x2b3118){return function(_0x2fd7da){if(_0x2fd7da){var _0x4238a7=typeof _0x2b3118[_0x6659('0x15')]===_0x6659('0x16')&&typeof _0x2b3118[_0x6659('0x17')]==='undefined';var _0x3246f1=_0x2fd7da[_0x6659('0x18')];var _0x1ddce3=_0x4238a7?0x0:_0x2b3118[_0x6659('0x15')];var _0x324fbc=_0x4238a7?_0x2fd7da[_0x6659('0x18')]:_0x2b3118['offset']+_0x2b3118['limit'];var _0x441d6d;if(_0x324fbc>=_0x3246f1){_0x324fbc=_0x3246f1;_0x441d6d=0xc8;}else{_0x441d6d=0xce;}_0x518769['status'](_0x441d6d);return _0x518769[_0x6659('0x19')](_0x6659('0x1a'),_0x1ddce3+'-'+_0x324fbc+'/'+_0x3246f1)['json'](_0x2fd7da);}return null;};}function saveUpdates(_0x440bc2){return function(_0x5253e5){if(_0x5253e5){return _0x5253e5[_0x6659('0x1b')](_0x440bc2)[_0x6659('0x1c')](function(_0x522f2e){return _0x522f2e;});}return null;};}function removeEntity(_0x36bd4c){return function(_0x18e4a6){if(_0x18e4a6){return _0x18e4a6[_0x6659('0x1d')]()[_0x6659('0x1c')](function(){_0x36bd4c[_0x6659('0x12')](0xcc)[_0x6659('0x13')]();});}};}function handleEntityNotFound(_0x298295){return function(_0x524562){if(!_0x524562){_0x298295[_0x6659('0x1e')](0x194);}return _0x524562;};}function handleError(_0x3506fd,_0x314e40){_0x314e40=_0x314e40||0x1f4;return function(_0x3c0fe6){logger['error'](_0x3c0fe6['stack']);if(_0x3c0fe6['name']){delete _0x3c0fe6['name'];}_0x3506fd[_0x6659('0x12')](_0x314e40)[_0x6659('0x1f')](_0x3c0fe6);};}function getInteractionUsers(_0x3c8986,_0x6fc27){return new BPromise(function(_0x45effc,_0x12b218){try{if(_0x6fc27[_0x3c8986['id']]){_0x3c8986[_0x6659('0x20')]=_[_0x6659('0x21')](_0x6fc27[_0x3c8986['id']],function(_0x19fe18){return{'id':_0x19fe18['id'],'fullname':_0x19fe18['fullname']};});}}catch(_0x187571){_0x12b218(_0x187571);}_0x45effc(_0x3c8986);});}function getInteractionTags(_0x373a3d,_0x1c119e){return new BPromise(function(_0x4866e0,_0x4f6787){try{if(_0x373a3d[_0x6659('0x22')]){_0x373a3d[_0x6659('0x23')]=[];_0x373a3d['TagIds'][_0x6659('0x24')](',')[_0x6659('0x25')](function(_0x36dab5){_0x373a3d[_0x6659('0x23')][_0x6659('0x26')](_0x1c119e[_0x36dab5]);});}delete _0x373a3d['TagIds'];}catch(_0x23ee05){_0x4f6787(_0x23ee05);}_0x4866e0(_0x373a3d);});}function getLastMessageText(_0x393dfb){return new BPromise(function(_0x218753,_0x3bb3c7){return db[_0x6659('0x27')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x393dfb['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x6659('0x28')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x6659('0x29')],'order':_0x6659('0x2a'),'raw':!![]})[_0x6659('0x1c')](function(_0xc5bfe7){if(_0xc5bfe7&&_0xc5bfe7[_0x6659('0x29')]){_0x393dfb[_0x6659('0x2b')]=_['trimStart'](_0xc5bfe7[_0x6659('0x29')]);}_0x218753(_0x393dfb);})[_0x6659('0x2c')](function(_0x58c2c8){_0x3bb3c7(_0x58c2c8);});});}function updateMailInteraction(_0x2707b5,_0x495e8a,_0x176e33,_0x576e16){return new BPromise(function(_0x3340db,_0x385fa9){return getInteractionUsers(_0x2707b5,_0x176e33)['then'](function(_0x559d23){return getInteractionTags(_0x559d23,_0x495e8a);})[_0x6659('0x1c')](function(_0x4d8437){return getStateInteraction(_0x4d8437);})[_0x6659('0x1c')](function(_0x5173c9){if(_0x576e16){_0x3340db(getLastMessageText(_0x5173c9));}else{_0x3340db(_0x5173c9);}})[_0x6659('0x2c')](function(_0x49e692){_0x385fa9(_0x49e692);});});}function getStateInteraction(_0x11e5fe){return new BPromise(function(_0x35a20e){_0x11e5fe['waiting']=0x0;_0x11e5fe[_0x6659('0x2d')]=0x0;_0x11e5fe[_0x6659('0x2e')]=0x0;_0x11e5fe[_0x6659('0x2f')]=0x0;_0x11e5fe[_0x6659('0x30')]=0x0;if(!_0x11e5fe[_0x6659('0x31')]&&!_0x11e5fe['UserId']){_0x11e5fe[_0x6659('0x32')]+=0x1;}if(!_0x11e5fe['closed']&&_0x11e5fe['UserId']){_0x11e5fe[_0x6659('0x2d')]+=0x1;if(_0x11e5fe[_0x6659('0x32')]){_0x11e5fe[_0x6659('0x32')]-=0x1;}}if(_0x11e5fe['closed']&&_0x11e5fe[_0x6659('0x33')]){_0x11e5fe['answered']+=0x1;if(_0x11e5fe['talking']){_0x11e5fe[_0x6659('0x2d')]-=0x1;}}if(_0x11e5fe[_0x6659('0x31')]&&!_0x11e5fe[_0x6659('0x33')]){_0x11e5fe[_0x6659('0x2f')]+=0x1;if(_0x11e5fe[_0x6659('0x32')]){_0x11e5fe[_0x6659('0x32')]-=0x1;}}_0x11e5fe[_0x6659('0x30')]+=0x1;_0x35a20e(_0x11e5fe);});}exports['index']=function(_0x531a19,_0x130746){var _0x1fde99={},_0x3ce47a={},_0x532e2c={'count':0x0,'rows':[]};var _0x1dd5ba=_[_0x6659('0x21')](db['MailInteraction'][_0x6659('0x34')],function(_0xa3311c){return{'name':_0xa3311c[_0x6659('0x35')],'type':_0xa3311c[_0x6659('0x36')][_0x6659('0x37')]};});_0x3ce47a['model']=_['map'](_0x1dd5ba,'name');_0x3ce47a['query']=_[_0x6659('0x38')](_0x531a19['query']);_0x3ce47a['filters']=_[_0x6659('0x39')](_0x3ce47a[_0x6659('0x3a')],_0x3ce47a['query']);_0x1fde99[_0x6659('0x3b')]=_[_0x6659('0x39')](_0x3ce47a['model'],qs[_0x6659('0x3c')](_0x531a19[_0x6659('0x3d')][_0x6659('0x3c')]));_0x1fde99[_0x6659('0x3b')]=_0x1fde99['attributes'][_0x6659('0x3e')]?_0x1fde99['attributes']:_0x3ce47a[_0x6659('0x3a')];if(!_0x531a19[_0x6659('0x3d')][_0x6659('0x3f')](_0x6659('0x40'))){_0x1fde99[_0x6659('0x17')]=qs[_0x6659('0x17')](_0x531a19['query']['limit']);_0x1fde99[_0x6659('0x15')]=qs[_0x6659('0x15')](_0x531a19[_0x6659('0x3d')][_0x6659('0x15')]);}_0x1fde99[_0x6659('0x41')]=qs[_0x6659('0x42')](_0x531a19[_0x6659('0x3d')][_0x6659('0x42')]);_0x1fde99[_0x6659('0x43')]=qs[_0x6659('0x44')](_['pick'](_0x531a19[_0x6659('0x3d')],_0x3ce47a['filters']),_0x1dd5ba);var _0x104d61=[];var _0x395187=squel['select']()[_0x6659('0x45')]('id')[_0x6659('0x45')]('name')[_0x6659('0x45')](_0x6659('0x46'))[_0x6659('0x47')](_0x6659('0x48'));var _0x577f63=squel['select']()[_0x6659('0x45')](_0x6659('0x49'))[_0x6659('0x45')](_0x6659('0x4a'))[_0x6659('0x45')](_0x6659('0x4b'))['from'](_0x6659('0x4c'),'ui')[_0x6659('0x4d')]('users','u',_0x6659('0x4e'));var _0x29e7cc=squel['select']()[_0x6659('0x47')](_0x6659('0x4f'),'i')[_0x6659('0x4d')](_0x6659('0x50'),'c',_0x6659('0x51'))[_0x6659('0x4d')](_0x6659('0x52'),'o',_0x6659('0x53'))[_0x6659('0x4d')](_0x6659('0x54'),'a',_0x6659('0x55'))[_0x6659('0x4d')]('mail_messages','me','me.MailInteractionId\x20=\x20i.id')[_0x6659('0x4d')](_0x6659('0x56'),'it','it.MailInteractionId\x20=\x20i.id')[_0x6659('0x4d')](_0x6659('0x48'),'t','t.id\x20=\x20it.TagId');var _0x3777b9=squel[_0x6659('0x57')]();var _0x2fe793=[];var _0x4f9abf=squel[_0x6659('0x57')]();var _0x4c7269;if(_0x531a19['query'][_0x6659('0x58')]){_0x4c7269=as[_0x6659('0x59')](_0x531a19[_0x6659('0x3d')][_0x6659('0x58')]);var _0x3f9375=_0x4c7269[_0x6659('0x5a')];for(var _0x29c6c4=0x0;_0x29c6c4<_0x4c7269[_0x6659('0x5b')][_0x6659('0x3e')];_0x29c6c4++){var _0xd8a6e4=_0x4c7269[_0x6659('0x5b')][_0x29c6c4];var _0x436254='i';var _0x1d4140=_['find'](_0x1dd5ba,[_0x6659('0x5c'),_0xd8a6e4[_0x6659('0x45')]]);if(!_0x1d4140){switch(_0xd8a6e4['field']){case _0x6659('0x5d'):if(_0xd8a6e4[_0x6659('0x5e')]==0x1){_0x29e7cc[_0x6659('0x5f')]('`'+_0xd8a6e4['field']+_0x6659('0x60'));}else{_0x29e7cc[_0x6659('0x5f')]('`'+_0xd8a6e4[_0x6659('0x45')]+_0x6659('0x61'));}break;case _0x6659('0x62'):if(_0xd8a6e4[_0x6659('0x63')]==='$substring'){if(_0xd8a6e4[_0x6659('0x5e')][_0x6659('0x24')]('\x20')[_0x6659('0x3e')]>0x1){_0x3777b9[_0x3f9375](_0x6659('0x64'),qs['getFullTextValue'](_0xd8a6e4[_0x6659('0x5e')]),null);}else{var _0x3b589d='%'+_0xd8a6e4[_0x6659('0x5e')]+'%';_0x3777b9[_0x3f9375](_0x6659('0x65'),_0x3b589d,_0x3b589d,_0x3b589d);}}else{_0x1d4140=_[_0x6659('0x66')](_0x1dd5ba,[_0x6659('0x5c'),_0x6659('0x67')]);_0xd8a6e4['field']='ContactId';_0x40e920=as['buildExpression'](_0x436254,_0x1d4140['type'],_0xd8a6e4);_0x3777b9[_0x3f9375](_0x40e920['text'],_0x40e920['value'][_0x6659('0x68')],_0x40e920[_0x6659('0x5e')][_0x6659('0x13')]);}break;case'Tag':var _0x1f2e0f=_0xd8a6e4[_0x6659('0x5e')]['split'](',')[_0x6659('0x21')](function(_0x291dcf){return Number(_0x291dcf);});_0x1f2e0f[_0x6659('0x25')](function(_0x47481f){_0x4f9abf['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x47481f+',%');});_0x2fe793=_[_0x6659('0x69')](_0x2fe793,_0x1f2e0f);break;case _0x6659('0x6a'):if(_0xd8a6e4[_0x6659('0x63')]===_0x6659('0x6b')){_0x3777b9[_0x3f9375](_0x6659('0x6c'),'%'+_0xd8a6e4[_0x6659('0x5e')]+'%',null);}else{_0x1d4140=_['find'](_0x1dd5ba,[_0x6659('0x5c'),_0x6659('0x33')]);_0xd8a6e4[_0x6659('0x45')]=_0x6659('0x33');_0x40e920=as['buildExpression'](_0x436254,_0x1d4140[_0x6659('0x36')],_0xd8a6e4);_0x3777b9[_0x3f9375](_0x40e920['text'],_0x40e920['value'][_0x6659('0x68')],_0x40e920['value'][_0x6659('0x13')]);}break;case _0x6659('0x29'):_0x40e920=as['buildExpression']('me',null,_0xd8a6e4);_0x3777b9[_0x3f9375](_0x40e920[_0x6659('0x6d')],_0x40e920[_0x6659('0x5e')][_0x6659('0x68')],_0x40e920['value'][_0x6659('0x13')]);break;}}else{var _0x40e920=as[_0x6659('0x6e')](_0x436254,_0x1d4140['type'],_0xd8a6e4);_0x3777b9[_0x3f9375](_0x40e920['text'],_0x40e920[_0x6659('0x5e')][_0x6659('0x68')],_0x40e920[_0x6659('0x5e')]['end']);}}}else{var _0x27306c=_(_0x531a19[_0x6659('0x3d')])[_0x6659('0x38')]()[_0x6659('0x21')](function(_0x20fa86){return _[_0x6659('0x6f')](_0x1dd5ba,[_0x6659('0x5c'),_0x20fa86])?_0x20fa86:undefined;})['compact']()[_0x6659('0x5e')]();if(!_[_0x6659('0x70')](_0x27306c)){_0x27306c[_0x6659('0x25')](function(_0x36f55c){if(_0x36f55c==='MailAccountId'){_0x29e7cc[_0x6659('0x43')]('i.MailAccountId\x20IN\x20?',[][_0x6659('0x71')](_0x531a19['query'][_0x36f55c]));}else if(_0x36f55c===_0x6659('0x72')){var _0x1b855b=JSON['parse'](_0x531a19['query'][_0x36f55c])['$gte'];var _0x42e469=JSON['parse'](_0x531a19['query'][_0x36f55c])[_0x6659('0x73')];_0x29e7cc[_0x6659('0x43')](_0x6659('0x74'),_0x1b855b,_0x42e469);}else{if(_0x531a19[_0x6659('0x3d')][_0x36f55c]==='null'){_0x29e7cc[_0x6659('0x43')]('i.'+_0x36f55c+_0x6659('0x75'));}else{_0x29e7cc[_0x6659('0x43')]('i.'+_0x36f55c+_0x6659('0x76'),_0x531a19[_0x6659('0x3d')][_0x36f55c]);}}});}if(_0x531a19[_0x6659('0x3d')][_0x6659('0x77')]){if(_0x531a19['query'][_0x6659('0x77')]==0x1){_0x29e7cc['having'](_0x6659('0x78'));}else{_0x29e7cc[_0x6659('0x5f')]('`unreadMessages`\x20>\x200');}}if(_0x531a19['query'][_0x6659('0x79')]){_0x2fe793=_[_0x6659('0x7a')](_0x531a19[_0x6659('0x3d')]['tag'])?_0x531a19[_0x6659('0x3d')][_0x6659('0x79')]:new Array(_0x531a19[_0x6659('0x3d')]['tag']);_0x2fe793[_0x6659('0x25')](function(_0x37b695){_0x4f9abf['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x37b695+',%');});}if(_0x531a19['query'][_0x6659('0x7b')]){var _0x56fc85=_0x531a19[_0x6659('0x3d')][_0x6659('0x7b')][_0x6659('0x7c')]('\x5c','\x5c\x5c')[_0x6659('0x7c')](/'/g,'\x27\x27');if(qs[_0x6659('0x7d')](_0x56fc85)){_0x3777b9['or'](_0x6659('0x7e'),_0x56fc85+'%');}else if(qs[_0x6659('0x7f')](_0x56fc85)){_0x3777b9['or'](_0x6659('0x80'),_0x56fc85+'%');}else{_0x3777b9['or'](_0x6659('0x81'),qs[_0x6659('0x82')](_0x56fc85))['or'](_0x6659('0x83'),qs[_0x6659('0x82')](_0x56fc85));}}}_0x29e7cc[_0x6659('0x43')](_0x3777b9);_0x29e7cc[_0x6659('0x84')](_0x6659('0x85'));var _0x472485={'type':db[_0x6659('0x86')][_0x6659('0x87')][_0x6659('0x88')],'raw':!![]};var _0x280662=_0x29e7cc[_0x6659('0x89')]();_0x280662['field'](_0x6659('0x85'));_0x280662[_0x6659('0x45')](_0x6659('0x8a'),'unreadMessages');if(_0x1fde99[_0x6659('0x41')]){_0x1fde99[_0x6659('0x41')][_0x6659('0x25')](function(_0x4d2559){var _0x3a0899=_0x4d2559[0x0]===_0x6659('0x8b')?_0x4d2559[0x0]:'i.'+_0x4d2559[0x0];_0x29e7cc['order'](_0x3a0899,_0x4d2559[0x1]===_0x6659('0x8c')?![]:!![]);});}if(!_['isEmpty'](_0x2fe793)){_0x29e7cc[_0x6659('0x5f')](_0x4f9abf);_0x280662[_0x6659('0x43')](_0x6659('0x8d'),_0x2fe793);}BPromise[_0x6659('0x8e')]()['then'](function(){if(!_0x4c7269){if(_0x531a19['query'][_0x6659('0x8f')])return;_0x280662[_0x6659('0x43')](_0x6659('0x90'));_0x29e7cc[_0x6659('0x43')](_0x6659('0x90'));return;}if(_0x531a19[_0x6659('0x91')][_0x6659('0x92')]!==_0x6659('0x93'))return;return _0x531a19[_0x6659('0x91')][_0x6659('0x94')]({'attributes':['id'],'raw':!![]})[_0x6659('0x1c')](function(_0x5ee39a){if(_[_0x6659('0x70')](_0x5ee39a)){_0x280662['where'](_0x6659('0x95'));_0x29e7cc[_0x6659('0x43')](_0x6659('0x95'));}else{_0x280662[_0x6659('0x43')]('i.MailAccountId\x20IN\x20?',_[_0x6659('0x21')](_0x5ee39a,'id'));_0x29e7cc[_0x6659('0x43')](_0x6659('0x96'),_['map'](_0x5ee39a,'id'));}});})[_0x6659('0x1c')](function(){if(_0x531a19[_0x6659('0x91')]['role']==='agent'&&!_0x4c7269&&!_0x531a19[_0x6659('0x3d')][_0x6659('0x8f')])return[];return db['sequelize'][_0x6659('0x3d')](_0x280662[_0x6659('0x97')](),_0x472485);})['then'](function(_0x3e4e86){_0x532e2c[_0x6659('0x18')]=_0x3e4e86[_0x6659('0x3e')];if(_0x532e2c['count']===0x0)return[];return db[_0x6659('0x98')][_0x6659('0x3d')](_0x395187[_0x6659('0x97')](),_0x472485)['then'](function(_0x1aeebc){_0x104d61=_['keyBy'](_0x1aeebc,'id');_0x472485=_['merge'](_0x472485,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x531a19[_0x6659('0x3d')]['fields']){_0x1fde99[_0x6659('0x3b')]['forEach'](function(_0x339a4b){_0x29e7cc[_0x6659('0x45')]('i.'+_0x339a4b);});}else{_0x29e7cc[_0x6659('0x45')](_0x6659('0x8a'),_0x6659('0x5d'));_0x29e7cc['field'](_0x6659('0x99'),_0x6659('0x9a'));_0x29e7cc['field'](_0x6659('0x9b'),_0x6659('0x9c'));_0x29e7cc[_0x6659('0x45')](_0x6659('0x9d'),_0x6659('0x8b'));_0x29e7cc['field'](_0x6659('0x85'));_0x29e7cc['field'](_0x6659('0x9e'));_0x29e7cc[_0x6659('0x45')]('i.updatedAt');_0x29e7cc['field'](_0x6659('0x9f'));_0x29e7cc[_0x6659('0x45')](_0x6659('0xa0'));_0x29e7cc[_0x6659('0x45')](_0x6659('0xa1'));_0x29e7cc[_0x6659('0x45')](_0x6659('0xa2'));_0x29e7cc[_0x6659('0x45')]('i.lastMsgDirection');_0x29e7cc[_0x6659('0x45')](_0x6659('0xa3'));_0x29e7cc[_0x6659('0x45')](_0x6659('0xa4'));_0x29e7cc[_0x6659('0x45')](_0x6659('0xa5'));_0x29e7cc['field'](_0x6659('0xa6'));_0x29e7cc['field'](_0x6659('0xa7'));_0x29e7cc[_0x6659('0x45')]('i.to');_0x29e7cc[_0x6659('0x45')](_0x6659('0xa8'));_0x29e7cc[_0x6659('0x45')](_0x6659('0xa9'));_0x29e7cc[_0x6659('0x45')](_0x6659('0xaa'));_0x29e7cc[_0x6659('0x45')](_0x6659('0xab'),_0x6659('0xac'));_0x29e7cc[_0x6659('0x45')]('c.lastName',_0x6659('0xad'));_0x29e7cc[_0x6659('0x45')](_0x6659('0xae'),_0x6659('0xaf'));_0x29e7cc[_0x6659('0x45')](_0x6659('0xb0'),_0x6659('0xb1'));_0x29e7cc[_0x6659('0x45')](_0x6659('0xb2'),_0x6659('0xb3'));_0x29e7cc[_0x6659('0x45')](_0x6659('0xb4'),_0x6659('0xb5'));_0x29e7cc[_0x6659('0x45')](_0x6659('0xb6'),_0x6659('0xb7'));_0x29e7cc[_0x6659('0x45')](_0x6659('0xb8'),'Owner.internal');_0x29e7cc[_0x6659('0x45')](_0x6659('0xb9'),'TagIds');}if(_0x1fde99[_0x6659('0x17')])_0x29e7cc[_0x6659('0x17')](_0x1fde99[_0x6659('0x17')]);if(_0x1fde99['offset'])_0x29e7cc['offset'](_0x1fde99[_0x6659('0x15')]);return db[_0x6659('0x98')]['query'](_0x29e7cc[_0x6659('0x97')](),_0x472485);})[_0x6659('0x1c')](function(_0x2ba50a){if(_0x2ba50a[_0x6659('0x3e')]>0x0)_0x577f63[_0x6659('0x43')](_0x6659('0xba'),_[_0x6659('0x21')](_0x2ba50a,'id'));return db[_0x6659('0x98')]['query'](_0x577f63[_0x6659('0x97')](),_0x472485)['then'](function(_0x3ce25a){var _0x33798d=_[_0x6659('0xbb')](_0x3ce25a,'MailInteractionId');var _0x532e08=[];return db[_0x6659('0xbc')]['findOne']({'attributes':[_0x6659('0xbd')],'raw':!![]})[_0x6659('0x1c')](function(_0x45ded2){var _0x1f355a=_0x45ded2[_0x6659('0xbd')];_0x2ba50a[_0x6659('0x25')](function(_0x15d1a2){_0x532e08[_0x6659('0x26')](updateMailInteraction(_0x15d1a2,_0x104d61,_0x33798d,_0x1f355a));});return BPromise[_0x6659('0xbe')](_0x532e08);});});});})[_0x6659('0x1c')](function(_0x9e5640){_0x532e2c[_0x6659('0xbf')]=_0x9e5640;return _0x532e2c;})[_0x6659('0x1c')](respondWithFilteredResult(_0x130746,_0x1fde99))['catch'](handleError(_0x130746,null));};exports[_0x6659('0xc0')]=function(_0x2e3eec,_0x93b8ec){var _0x38e16b={'raw':![],'where':{'id':_0x2e3eec['params']['id']}},_0x201217={};_0x201217[_0x6659('0x3a')]=_['keys'](db[_0x6659('0xc1')][_0x6659('0x34')]);_0x201217[_0x6659('0x3d')]=_['keys'](_0x2e3eec[_0x6659('0x3d')]);_0x201217[_0x6659('0x44')]=_['intersection'](_0x201217[_0x6659('0x3a')],_0x201217['query']);_0x38e16b[_0x6659('0x3b')]=_[_0x6659('0x39')](_0x201217[_0x6659('0x3a')],qs['fields'](_0x2e3eec['query'][_0x6659('0x3c')]));_0x38e16b['attributes']=_0x38e16b[_0x6659('0x3b')][_0x6659('0x3e')]?_0x38e16b[_0x6659('0x3b')]:_0x201217[_0x6659('0x3a')];if(_0x2e3eec[_0x6659('0x3d')][_0x6659('0xc2')]){_0x38e16b[_0x6659('0xc3')]=[{'all':!![]}];}_0x38e16b=_['merge']({},_0x38e16b,_0x2e3eec[_0x6659('0xc4')]);return db['MailInteraction'][_0x6659('0x66')](_0x38e16b)[_0x6659('0x1c')](handleEntityNotFound(_0x93b8ec,null))[_0x6659('0x1c')](respondWithResult(_0x93b8ec,null))[_0x6659('0x2c')](handleError(_0x93b8ec,null));};exports[_0x6659('0xc5')]=function(_0x141be8,_0x4ca0a7){return db[_0x6659('0xc1')][_0x6659('0xc5')](_0x141be8[_0x6659('0xc6')],{})[_0x6659('0x1c')](respondWithResult(_0x4ca0a7,0xc9))['catch'](handleError(_0x4ca0a7,null));};exports[_0x6659('0x1b')]=function(_0xdccf02,_0x16e840){if(_0xdccf02[_0x6659('0xc6')]['id']){delete _0xdccf02[_0x6659('0xc6')]['id'];}return db[_0x6659('0xc1')]['find']({'where':{'id':_0xdccf02[_0x6659('0xc7')]['id']}})[_0x6659('0x1c')](handleEntityNotFound(_0x16e840,null))[_0x6659('0x1c')](saveUpdates(_0xdccf02[_0x6659('0xc6')],null))['then'](respondWithResult(_0x16e840,null))['catch'](handleError(_0x16e840,null));};exports[_0x6659('0x1d')]=function(_0x271a67,_0x966245){return db[_0x6659('0xc1')][_0x6659('0x66')]({'where':{'id':_0x271a67['params']['id']}})[_0x6659('0x1c')](handleEntityNotFound(_0x966245,null))[_0x6659('0x1c')](removeEntity(_0x966245,null))[_0x6659('0x2c')](handleError(_0x966245,null));};exports[_0x6659('0xc8')]=function(_0x23db2a,_0x167ecc){return db[_0x6659('0xc1')][_0x6659('0xc8')]()[_0x6659('0x1c')](respondWithResult(_0x167ecc,null))[_0x6659('0x2c')](handleError(_0x167ecc,null));};exports['addMessage']=function(_0x35a90a,_0x3915d4){return db[_0x6659('0x27')]['find']({'where':{'id':_0x35a90a['params']['id']}})[_0x6659('0x1c')](handleEntityNotFound(_0x3915d4,null))['then'](function(_0x564ae9){if(_0x564ae9){return _0x564ae9[_0x6659('0xc9')](_0x35a90a[_0x6659('0xc6')][_0x6659('0xca')],_[_0x6659('0xcb')](_0x35a90a[_0x6659('0xc6')],['ids','id'])||{});}})[_0x6659('0x1c')](respondWithResult(_0x3915d4,null))[_0x6659('0x2c')](handleError(_0x3915d4,null));};exports[_0x6659('0xcc')]=function(_0x233929,_0x4a84c7){var _0x40cbbc={'raw':![],'where':{}};var _0x177e20={};var _0x3a91ab={'count':0x0,'rows':[]};return db[_0x6659('0xc1')]['findOne']({'where':{'id':_0x233929[_0x6659('0xc7')]['id']}})[_0x6659('0x1c')](handleEntityNotFound(_0x4a84c7,null))[_0x6659('0x1c')](function(_0x237530){if(_0x237530){_0x177e20[_0x6659('0x3a')]=_['keys'](db['MailMessage']['rawAttributes']);_0x177e20[_0x6659('0x3d')]=_[_0x6659('0x38')](_0x233929['query']);_0x177e20['filters']=_[_0x6659('0x39')](_0x177e20[_0x6659('0x3a')],_0x177e20['query']);_0x40cbbc[_0x6659('0x3b')]=_[_0x6659('0x39')](_0x177e20['model'],qs[_0x6659('0x3c')](_0x233929['query']['fields']));_0x40cbbc['attributes']=_0x40cbbc[_0x6659('0x3b')][_0x6659('0x3e')]?_0x40cbbc[_0x6659('0x3b')]:_0x177e20[_0x6659('0x3a')];if(!_0x233929['query'][_0x6659('0x3f')](_0x6659('0x40'))){_0x40cbbc[_0x6659('0x17')]=qs[_0x6659('0x17')](_0x233929[_0x6659('0x3d')][_0x6659('0x17')]);_0x40cbbc['offset']=qs['offset'](_0x233929[_0x6659('0x3d')][_0x6659('0x15')]);}_0x40cbbc['order']=qs[_0x6659('0x42')](_0x233929[_0x6659('0x3d')][_0x6659('0x42')]);_0x40cbbc['where']=qs[_0x6659('0x44')](_[_0x6659('0xcd')](_0x233929['query'],_0x177e20[_0x6659('0x44')]));_0x40cbbc[_0x6659('0x43')]['MailInteractionId']=_0x237530['id'];if(_0x233929[_0x6659('0x3d')][_0x6659('0x7b')]){_0x40cbbc[_0x6659('0x43')]=_[_0x6659('0xce')](_0x40cbbc[_0x6659('0x43')],{'$or':_[_0x6659('0x21')](_0x40cbbc[_0x6659('0x3b')],function(_0x3441db){var _0x277413={};_0x277413[_0x3441db]={'$like':'%'+_0x233929[_0x6659('0x3d')]['filter']+'%'};return _0x277413;})});}if(_0x233929[_0x6659('0x3d')][_0x6659('0xcf')]){var _0x47e265=_0x233929[_0x6659('0x3d')][_0x6659('0xcf')][_0x6659('0x24')](',');var _0x270284={};_0x270284[_0x47e265[0x0]]={'$gte':moment(_0x47e265[0x1])[_0x6659('0xd0')]('YYYY-MM-DD\x20HH:mm:ss')};_0x40cbbc[_0x6659('0x43')]=_[_0x6659('0xce')](_0x40cbbc[_0x6659('0x43')],_0x270284);}_0x40cbbc=_['merge']({},_0x40cbbc,_0x233929['options']);return db[_0x6659('0x27')][_0x6659('0x18')]({'where':_0x40cbbc[_0x6659('0x43')]})['then'](function(_0x530ded){_0x3a91ab[_0x6659('0x18')]=_0x530ded;if(_0x233929[_0x6659('0x3d')][_0x6659('0xc2')]){_0x40cbbc[_0x6659('0xc3')]=[{'all':!![]}];}return db[_0x6659('0x27')][_0x6659('0xd1')](_0x40cbbc);})[_0x6659('0x1c')](function(_0x15d426){if(_0x233929['query'][_0x6659('0xd2')]===_0x6659('0xd3')){for(var _0x80ace7=0x0;_0x80ace7<_0x15d426[_0x6659('0x3e')];_0x80ace7++){_0x15d426[_0x80ace7]['body']=juice(_0x15d426[_0x80ace7]['body']);}}_0x3a91ab[_0x6659('0xbf')]=_0x15d426;return _0x3a91ab;});}})[_0x6659('0x1c')](respondWithFilteredResult(_0x4a84c7,_0x40cbbc))[_0x6659('0x2c')](handleError(_0x4a84c7,null));};exports[_0x6659('0xd4')]=function(_0x3c3592,_0x34479c){return db[_0x6659('0xc1')]['find']({'where':{'id':_0x3c3592[_0x6659('0xc7')]['id']}})['then'](handleEntityNotFound(_0x34479c,null))[_0x6659('0x1c')](function(_0x524165){if(_0x524165){return _0x524165['setTags'](_0x3c3592[_0x6659('0xc6')][_0x6659('0xca')],_['omit'](_0x3c3592['body'],[_0x6659('0xca'),'id'])||{})['spread'](function(){return db['Tag'][_0x6659('0xd1')]({'attributes':['id','name',_0x6659('0x46')],'where':{'id':_0x3c3592[_0x6659('0xc6')]['ids']}});})[_0x6659('0x1c')](function(_0x3f23f0){socket[_0x6659('0xd5')](_0x6659('0xd6'),{'id':Number(_0x3c3592[_0x6659('0xc7')]['id']),'tags':_0x3f23f0||[]});return{'id':Number(_0x3c3592[_0x6659('0xc7')]['id']),'tags':_0x3f23f0||[]};});}})[_0x6659('0x1c')](respondWithResult(_0x34479c,null))[_0x6659('0x2c')](handleError(_0x34479c,null));};exports[_0x6659('0xd7')]=function(_0x2f08d9,_0x4a86d3){return db[_0x6659('0xc1')][_0x6659('0x66')]({'where':{'id':_0x2f08d9['params']['id']}})[_0x6659('0x1c')](handleEntityNotFound(_0x4a86d3,null))[_0x6659('0x1c')](function(_0x530042){if(_0x530042){return _0x530042['removeTags'](_0x2f08d9[_0x6659('0x3d')][_0x6659('0xca')]);}})[_0x6659('0x1c')](respondWithStatusCode(_0x4a86d3,null))[_0x6659('0x2c')](handleError(_0x4a86d3,null));};exports['download']=function(_0x1ed8c4,_0x257338){var _0x4418d1=moment()[_0x6659('0xd8')]()['toString']();var _0x507987=path[_0x6659('0xd9')](config['root'],_0x6659('0xda'),_0x6659('0xdb'),'tmp');var _0x421957=path[_0x6659('0xd9')](config[_0x6659('0xdc')],_0x6659('0xda'),_0x6659('0xdb'),_0x6659('0xdd'));var _0x25b753=path[_0x6659('0xd9')](_0x507987,_0x4418d1);var _0xc3eacc=util[_0x6659('0xd0')]('transcript-%d-%s.zip',_0x1ed8c4[_0x6659('0xc7')]['id'],_0x4418d1);var _0x4ffbb2=path[_0x6659('0xd9')](_0x507987,_0xc3eacc);var _0x570b78=[];if(_0x1ed8c4[_0x6659('0x3d')][_0x6659('0xdd')]){_0x570b78[_0x6659('0x26')]({'model':db[_0x6659('0xde')],'as':_0x6659('0xdf'),'raw':!![]});}var _0x5078de=[{'model':db[_0x6659('0x27')],'as':_0x6659('0xe0'),'attributes':['id',_0x6659('0xc6'),_0x6659('0x47'),'to','cc',_0x6659('0xe1'),_0x6659('0xe2'),'createdAt'],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x570b78}];return db[_0x6659('0xc1')][_0x6659('0x66')]({'where':{'id':_0x1ed8c4[_0x6659('0xc7')]['id']},'include':_0x5078de})[_0x6659('0x1c')](handleEntityNotFound(_0x257338,null))['then'](function(_0x38608e){if(_0x38608e&&_0x38608e[_0x6659('0xe0')]){var _0x24bfa9=_0x38608e[_0x6659('0xe3')]({'plain':!![]});fs[_0x6659('0xe4')](_0x25b753);return BPromise['each'](_0x24bfa9['Messages'],function(_0x1ad7c8,_0x1f1333){var _0x34a926={'from':_0x1ad7c8[_0x6659('0x47')],'to':_0x1ad7c8['to'],'subject':_0x1ad7c8['subject'],'html':htmlEntities[_0x6659('0xe5')](_0x1ad7c8[_0x6659('0xc6')]),'headers':{'Date':moment(_0x1ad7c8[_0x6659('0x72')])[_0x6659('0xd0')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x1ad7c8['cc']){_0x34a926['headers']['Cc']=_0x1ad7c8['cc'];}if(_0x1ad7c8[_0x6659('0xe1')]){_0x34a926['headers'][_0x6659('0xe6')]=_0x1ad7c8[_0x6659('0xe1')];}return new BPromise(function(_0x5e47bf,_0x3a4f84){if(_0x1ad7c8['Attachments']){for(var _0x3dc8c0=0x0;_0x3dc8c0<_0x1ad7c8[_0x6659('0xdf')][_0x6659('0x3e')];_0x3dc8c0++){var _0x4b4fa9=_0x1ad7c8['Attachments'][_0x3dc8c0];var _0x19fe2f=path[_0x6659('0xd9')](_0x421957,_0x4b4fa9[_0x6659('0xe7')]);if(fs[_0x6659('0xe8')](_0x19fe2f)){_0x34a926['attachments']['push']({'name':_0x4b4fa9['name'],'contentType':_0x4b4fa9[_0x6659('0x36')],'data':fs[_0x6659('0xe9')](_0x19fe2f)});}}}emlformat[_0x6659('0xea')](_0x34a926,function(_0x3398d2,_0x464c99){if(_0x3398d2)return _0x3a4f84(_0x3398d2);fs[_0x6659('0xeb')](path[_0x6659('0xd9')](_0x25b753,util[_0x6659('0xd0')](_0x6659('0xec'),_0x1f1333)),_0x464c99);return _0x5e47bf(_0x464c99);});});})[_0x6659('0x1c')](function(){return new BPromise(function(_0x411368,_0x381e82){zipdir(_0x25b753,{'saveTo':_0x4ffbb2},function(_0xc3ba0c,_0x12ac63){if(_0xc3ba0c)return _0x381e82(_0xc3ba0c);return _0x411368(_0x12ac63);});})['then'](function(){return new BPromise(function(_0x1f2151,_0x374edd){rimraf(_0x25b753,function(_0x2fbc0e){if(_0x2fbc0e)_0x374edd(_0x2fbc0e);return _0x1f2151();});});})['then'](function(){return _0x257338[_0x6659('0xed')](_0x4ffbb2,_0xc3eacc,function(_0x21ccf4){if(!_0x21ccf4)fs[_0x6659('0xee')](_0x4ffbb2);});});});}else{return _0x257338[_0x6659('0x1e')](0xc8);}})[_0x6659('0x2c')](handleError(_0x257338,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index f097eca..e47bf92 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 _0x2997=['length','emit','catch','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','remove','then','map','findAll','setDataValue','unreadMessages'];(function(_0x216ab0,_0x51f6cb){var _0x5b11b4=function(_0x44ac85){while(--_0x44ac85){_0x216ab0['push'](_0x216ab0['shift']());}};_0x5b11b4(++_0x51f6cb);}(_0x2997,0xb9));var _0x7299=function(_0x354df6,_0x4fb714){_0x354df6=_0x354df6-0x0;var _0x3b8676=_0x2997[_0x354df6];return _0x3b8676;};'use strict';var EventEmitter=require(_0x7299('0x0'));var MailInteraction=require(_0x7299('0x1'))['db'][_0x7299('0x2')];var MailMessage=require(_0x7299('0x1'))['db'][_0x7299('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x7299('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x7299('0x5')};function emitEvent(_0x41f0b7){return function(_0x4072fd,_0x1c7dd1,_0x470cb4){_0x4072fd['getUsers']({'attributes':['id'],'raw':!![]})[_0x7299('0x6')](function(_0x15584e){_0x4072fd['setDataValue']('Users',_0x15584e[_0x7299('0x7')](function(_0xf3ca4b){return{'id':_0xf3ca4b['id']};}));return MailMessage[_0x7299('0x8')]({'where':{'MailInteractionId':_0x4072fd['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7299('0x6')](function(_0x4f52bd){_0x4072fd[_0x7299('0x9')](_0x7299('0xa'),_0x4f52bd[_0x7299('0xb')]);MailInteractionEvents[_0x7299('0xc')](_0x41f0b7+':'+_0x4072fd['id'],_0x4072fd);MailInteractionEvents[_0x7299('0xc')](_0x41f0b7,_0x4072fd);_0x470cb4(null);})[_0x7299('0xd')](_0x470cb4(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file +var _0xc0d2=['hook','events','../../mysqldb','MailMessage','setMaxListeners','save','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','emit'];(function(_0x40466a,_0x4dd67e){var _0x850769=function(_0xe61a41){while(--_0xe61a41){_0x40466a['push'](_0x40466a['shift']());}};_0x850769(++_0x4dd67e);}(_0xc0d2,0x171));var _0x2c0d=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xc0d2[_0x3e5086];return _0xfeb102;};'use strict';var EventEmitter=require(_0x2c0d('0x0'));var MailInteraction=require(_0x2c0d('0x1'))['db']['MailInteraction'];var MailMessage=require('../../mysqldb')['db'][_0x2c0d('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x2c0d('0x3')](0x0);var events={'afterCreate':_0x2c0d('0x4'),'afterUpdate':'update','afterDestroy':_0x2c0d('0x5')};function emitEvent(_0x35450d){return function(_0x118e9e,_0x228679,_0x2ffbba){_0x118e9e[_0x2c0d('0x6')]({'attributes':['id'],'raw':!![]})[_0x2c0d('0x7')](function(_0x38bc92){_0x118e9e['setDataValue'](_0x2c0d('0x8'),_0x38bc92[_0x2c0d('0x9')](function(_0x124748){return{'id':_0x124748['id']};}));return MailMessage[_0x2c0d('0xa')]({'where':{'MailInteractionId':_0x118e9e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2c0d('0x7')](function(_0x471a37){_0x118e9e[_0x2c0d('0xb')](_0x2c0d('0xc'),_0x471a37[_0x2c0d('0xd')]);MailInteractionEvents[_0x2c0d('0xe')](_0x35450d+':'+_0x118e9e['id'],_0x118e9e);MailInteractionEvents[_0x2c0d('0xe')](_0x35450d,_0x118e9e);_0x2ffbba(null);})['catch'](_0x2ffbba(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x2c0d('0xf')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index d063c3f..a29a4f7 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 _0xa39d=['moment','bluebird','path','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','subject','FULLTEXT','substatus','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','substatusAt','changed','models','get','update','then','catch','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x3b9934,_0x354bfa){var _0x3fa17d=function(_0x2496bd){while(--_0x2496bd){_0x3b9934['push'](_0x3b9934['shift']());}};_0x3fa17d(++_0x354bfa);}(_0xa39d,0xe7));var _0xda39=function(_0x469eae,_0x3f574f){_0x469eae=_0x469eae-0x0;var _0x50bf07=_0xa39d[_0x469eae];return _0x50bf07;};'use strict';var _=require(_0xda39('0x0'));var util=require(_0xda39('0x1'));var logger=require('../../config/logger')(_0xda39('0x2'));var moment=require(_0xda39('0x3'));var BPromise=require(_0xda39('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xda39('0x5'));var rimraf=require('rimraf');var config=require(_0xda39('0x6'));var attributes=require(_0xda39('0x7'));module[_0xda39('0x8')]=function(_0x1f09d1,_0x3abbfb){return _0x1f09d1[_0xda39('0x9')](_0xda39('0xa'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0xda39('0xb'),'to'],'type':_0xda39('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x44f35b,_0x50f98e,_0x35d616){if(_0x44f35b[_0xda39('0xd')]){_0x44f35b['substatusAt']=moment()[_0xda39('0xe')](_0xda39('0xf'));}if(_0x44f35b[_0xda39('0x10')]){_0x44f35b[_0xda39('0x11')]=moment()[_0xda39('0xe')](_0xda39('0xf'));}_0x35d616(null,_0x50f98e);},'beforeUpdate':function(_0x32c077,_0x59b170,_0x2dad31){if(_0x32c077['changed']('substatus')){_0x32c077[_0xda39('0x12')]=_0x32c077[_0xda39('0xd')]?moment()[_0xda39('0xe')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x32c077[_0xda39('0x13')](_0xda39('0x10'))){_0x32c077['closedAt']=moment()[_0xda39('0xe')](_0xda39('0xf'));_0x32c077['substatus']=null;_0x32c077['substatusAt']=null;}_0x2dad31(null,_0x32c077);},'afterUpdate':function(_0x434203,_0x2c3490,_0x4f38ae){var _0x46f745=_0x1f09d1[_0xda39('0x14')];var _0x3265e1=_0x434203[_0xda39('0x15')]({'plain':!![]});if(_0x3265e1[_0xda39('0x10')]){return _0x46f745['MailMessage'][_0xda39('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x3265e1['id']}})[_0xda39('0x17')](function(){_0x4f38ae();})[_0xda39('0x18')](function(_0x180fc1){_0x4f38ae(_0x180fc1);});}else{_0x4f38ae();}}},'charset':'utf8mb4','collate':_0xda39('0x19')});}; \ No newline at end of file +var _0x9d4f=['update','then','catch','utf8mb4','util','api','moment','bluebird','path','rimraf','../../config/environment','./mailInteraction.attributes','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','get','MailMessage'];(function(_0x4e7af5,_0x474663){var _0x2051f1=function(_0x867878){while(--_0x867878){_0x4e7af5['push'](_0x4e7af5['shift']());}};_0x2051f1(++_0x474663);}(_0x9d4f,0x148));var _0xf9d4=function(_0x1e5a1e,_0x121136){_0x1e5a1e=_0x1e5a1e-0x0;var _0x31156d=_0x9d4f[_0x1e5a1e];return _0x31156d;};'use strict';var _=require('lodash');var util=require(_0xf9d4('0x0'));var logger=require('../../config/logger')(_0xf9d4('0x1'));var moment=require(_0xf9d4('0x2'));var BPromise=require(_0xf9d4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf9d4('0x4'));var rimraf=require(_0xf9d4('0x5'));var config=require(_0xf9d4('0x6'));var attributes=require(_0xf9d4('0x7'));module['exports']=function(_0x53a153,_0x281b42){return _0x53a153[_0xf9d4('0x8')](_0xf9d4('0x9'),attributes,{'tableName':_0xf9d4('0xa'),'paranoid':![],'indexes':[{'name':_0xf9d4('0xb'),'fields':[_0xf9d4('0xc'),'to'],'type':_0xf9d4('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x109ace,_0x201c11,_0x38e106){if(_0x109ace[_0xf9d4('0xe')]){_0x109ace[_0xf9d4('0xf')]=moment()[_0xf9d4('0x10')](_0xf9d4('0x11'));}if(_0x109ace[_0xf9d4('0x12')]){_0x109ace[_0xf9d4('0x13')]=moment()[_0xf9d4('0x10')](_0xf9d4('0x11'));}_0x38e106(null,_0x201c11);},'beforeUpdate':function(_0x144f61,_0x38c939,_0x45f949){if(_0x144f61[_0xf9d4('0x14')](_0xf9d4('0xe'))){_0x144f61['substatusAt']=_0x144f61['substatus']?moment()[_0xf9d4('0x10')](_0xf9d4('0x11')):null;}if(_0x144f61[_0xf9d4('0x14')](_0xf9d4('0x12'))){_0x144f61[_0xf9d4('0x13')]=moment()['format'](_0xf9d4('0x11'));_0x144f61[_0xf9d4('0xe')]=null;_0x144f61[_0xf9d4('0xf')]=null;}_0x45f949(null,_0x144f61);},'afterUpdate':function(_0x564aac,_0x162214,_0x9932af){var _0xd2a016=_0x53a153['models'];var _0x475226=_0x564aac[_0xf9d4('0x15')]({'plain':!![]});if(_0x475226['closed']){return _0xd2a016[_0xf9d4('0x16')][_0xf9d4('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x475226['id']}})[_0xf9d4('0x18')](function(){_0x9932af();})[_0xf9d4('0x19')](function(_0xdb8102){_0x9932af(_0xdb8102);});}else{_0x9932af();}}},'charset':_0xf9d4('0x1a'),'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 2fd1e94..f97b6c0 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 _0x934f=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','socket.io-emitter','./mailInteraction.socket','register','request','info','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateMailInteraction','MailInteraction','update','body','raw','options','limit','then','catch','AddTagsToMailInteraction','find','where','addTags','ids','omit','spread','AddTags','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x20580a,_0xc57976){var _0x2732ec=function(_0x2c7af0){while(--_0x2c7af0){_0x20580a['push'](_0x20580a['shift']());}};_0x2732ec(++_0xc57976);}(_0x934f,0x1d2));var _0xf934=function(_0x2b6854,_0xf09496){_0x2b6854=_0x2b6854-0x0;var _0x3a17df=_0x934f[_0x2b6854];return _0x3a17df;};'use strict';var _=require(_0xf934('0x0'));var util=require(_0xf934('0x1'));var moment=require(_0xf934('0x2'));var BPromise=require(_0xf934('0x3'));var rs=require(_0xf934('0x4'));var fs=require('fs');var Redis=require(_0xf934('0x5'));var db=require(_0xf934('0x6'))['db'];var utils=require(_0xf934('0x7'));var logger=require(_0xf934('0x8'))('rpc');var config=require(_0xf934('0x9'));var jayson=require(_0xf934('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0xf934('0xb')]=_['defaults'](config[_0xf934('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xf934('0xc'))(new Redis(config[_0xf934('0xb')]));require(_0xf934('0xd'))[_0xf934('0xe')](socket);function respondWithRpcPromise(_0x511752,_0x4def6c,_0x41546a){return new BPromise(function(_0x26a57c,_0x1a2eeb){return client[_0xf934('0xf')](_0x511752,_0x41546a)['then'](function(_0x2508b4){logger[_0xf934('0x10')](_0xf934('0x11'),_0x4def6c,_0xf934('0x12'));logger['debug'](_0xf934('0x13'),_0x4def6c,_0xf934('0x12'),JSON[_0xf934('0x14')](_0x2508b4));if(_0x2508b4[_0xf934('0x15')]){if(_0x2508b4[_0xf934('0x15')][_0xf934('0x16')]===0x1f4){logger[_0xf934('0x15')](_0xf934('0x11'),_0x4def6c,_0x2508b4[_0xf934('0x15')][_0xf934('0x17')]);return _0x1a2eeb(_0x2508b4['error'][_0xf934('0x17')]);}logger[_0xf934('0x15')](_0xf934('0x11'),_0x4def6c,_0x2508b4[_0xf934('0x15')][_0xf934('0x17')]);return _0x26a57c(_0x2508b4['error'][_0xf934('0x17')]);}else{logger[_0xf934('0x10')]('MailInteraction,\x20%s,\x20%s',_0x4def6c,_0xf934('0x12'));_0x26a57c(_0x2508b4[_0xf934('0x18')][_0xf934('0x17')]);}})['catch'](function(_0x1c7d57){logger[_0xf934('0x15')](_0xf934('0x11'),_0x4def6c,_0x1c7d57);_0x1a2eeb(_0x1c7d57);});});}exports[_0xf934('0x19')]=function(_0x50be47){var _0x3955dc=this;return new Promise(function(_0x314756,_0x324a84){return db[_0xf934('0x1a')][_0xf934('0x1b')](_0x50be47[_0xf934('0x1c')],{'raw':_0x50be47['options']?_0x50be47['options'][_0xf934('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50be47[_0xf934('0x1e')]?_0x50be47['options']['where']||null:null,'attributes':_0x50be47[_0xf934('0x1e')]?_0x50be47[_0xf934('0x1e')]['attributes']||null:null,'limit':_0x50be47['options']?_0x50be47[_0xf934('0x1e')][_0xf934('0x1f')]||null:null})[_0xf934('0x20')](function(_0x12e804){logger[_0xf934('0x10')](_0xf934('0x19'),_0x50be47);logger['debug'](_0xf934('0x19'),_0x50be47,JSON['stringify'](_0x12e804));_0x314756(_0x12e804);})[_0xf934('0x21')](function(_0x537b2e){logger[_0xf934('0x15')](_0xf934('0x19'),_0x537b2e['message'],_0x50be47);_0x324a84(_0x3955dc[_0xf934('0x15')](0x1f4,_0x537b2e[_0xf934('0x17')]));});});};exports[_0xf934('0x22')]=function(_0x4c71ba){return new Promise(function(_0x426c39,_0x129c07){return db['MailInteraction'][_0xf934('0x23')]({'where':_0x4c71ba[_0xf934('0x1e')]?_0x4c71ba[_0xf934('0x1e')][_0xf934('0x24')]||null:null})[_0xf934('0x20')](function(_0x110a1d){if(_0x110a1d){return _0x110a1d[_0xf934('0x25')](_0x4c71ba[_0xf934('0x1c')][_0xf934('0x26')],_[_0xf934('0x27')](_0x4c71ba['body'],[_0xf934('0x26'),'id'])||{});}})[_0xf934('0x28')](function(_0x24de30){logger['info'](_0xf934('0x29'),_0x4c71ba);logger[_0xf934('0x2a')](_0xf934('0x29'),_0x4c71ba,JSON[_0xf934('0x14')](_0x24de30));_0x426c39(_0x24de30);})[_0xf934('0x21')](function(_0x579606){logger['error'](_0xf934('0x29'),_0x579606[_0xf934('0x17')],_0x4c71ba);_0x129c07(_this[_0xf934('0x15')](0x1f4,_0x579606[_0xf934('0x17')]));});});}; \ No newline at end of file +var _0xa4bd=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','UpdateMailInteraction','MailInteraction','body','options','where','attributes','limit','AddTagsToMailInteraction','addTags','ids','omit','spread','AddTags'];(function(_0x25dddf,_0x40c7e0){var _0x2173b5=function(_0x193809){while(--_0x193809){_0x25dddf['push'](_0x25dddf['shift']());}};_0x2173b5(++_0x40c7e0);}(_0xa4bd,0x1e4));var _0xda4b=function(_0x362b4,_0x1e35bd){_0x362b4=_0x362b4-0x0;var _0x435a96=_0xa4bd[_0x362b4];return _0x435a96;};'use strict';var _=require(_0xda4b('0x0'));var util=require(_0xda4b('0x1'));var moment=require(_0xda4b('0x2'));var BPromise=require('bluebird');var rs=require(_0xda4b('0x3'));var fs=require('fs');var Redis=require(_0xda4b('0x4'));var db=require(_0xda4b('0x5'))['db'];var utils=require(_0xda4b('0x6'));var logger=require(_0xda4b('0x7'))(_0xda4b('0x8'));var config=require(_0xda4b('0x9'));var jayson=require(_0xda4b('0xa'));var client=jayson[_0xda4b('0xb')][_0xda4b('0xc')]({'port':0x232a});config['redis']=_[_0xda4b('0xd')](config[_0xda4b('0xe')],{'host':_0xda4b('0xf'),'port':0x18eb});var socket=require(_0xda4b('0x10'))(new Redis(config['redis']));require(_0xda4b('0x11'))[_0xda4b('0x12')](socket);function respondWithRpcPromise(_0x5bc27f,_0x5b7e54,_0x2e439e){return new BPromise(function(_0x5cd25f,_0x349a17){return client[_0xda4b('0x13')](_0x5bc27f,_0x2e439e)[_0xda4b('0x14')](function(_0x392b6e){logger['info'](_0xda4b('0x15'),_0x5b7e54,_0xda4b('0x16'));logger[_0xda4b('0x17')](_0xda4b('0x18'),_0x5b7e54,_0xda4b('0x16'),JSON[_0xda4b('0x19')](_0x392b6e));if(_0x392b6e[_0xda4b('0x1a')]){if(_0x392b6e[_0xda4b('0x1a')][_0xda4b('0x1b')]===0x1f4){logger[_0xda4b('0x1a')]('MailInteraction,\x20%s,\x20%s',_0x5b7e54,_0x392b6e[_0xda4b('0x1a')][_0xda4b('0x1c')]);return _0x349a17(_0x392b6e[_0xda4b('0x1a')][_0xda4b('0x1c')]);}logger[_0xda4b('0x1a')](_0xda4b('0x15'),_0x5b7e54,_0x392b6e[_0xda4b('0x1a')][_0xda4b('0x1c')]);return _0x5cd25f(_0x392b6e[_0xda4b('0x1a')][_0xda4b('0x1c')]);}else{logger[_0xda4b('0x1d')](_0xda4b('0x15'),_0x5b7e54,'request\x20sent');_0x5cd25f(_0x392b6e[_0xda4b('0x1e')]['message']);}})['catch'](function(_0x26b415){logger[_0xda4b('0x1a')](_0xda4b('0x15'),_0x5b7e54,_0x26b415);_0x349a17(_0x26b415);});});}exports[_0xda4b('0x1f')]=function(_0x9328e0){var _0x5c94de=this;return new Promise(function(_0x5869bb,_0x2397de){return db[_0xda4b('0x20')]['update'](_0x9328e0[_0xda4b('0x21')],{'raw':_0x9328e0[_0xda4b('0x22')]?_0x9328e0[_0xda4b('0x22')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9328e0[_0xda4b('0x22')]?_0x9328e0[_0xda4b('0x22')][_0xda4b('0x23')]||null:null,'attributes':_0x9328e0[_0xda4b('0x22')]?_0x9328e0[_0xda4b('0x22')][_0xda4b('0x24')]||null:null,'limit':_0x9328e0[_0xda4b('0x22')]?_0x9328e0[_0xda4b('0x22')][_0xda4b('0x25')]||null:null})[_0xda4b('0x14')](function(_0x206431){logger['info'](_0xda4b('0x1f'),_0x9328e0);logger['debug'](_0xda4b('0x1f'),_0x9328e0,JSON[_0xda4b('0x19')](_0x206431));_0x5869bb(_0x206431);})['catch'](function(_0x5ecf1a){logger[_0xda4b('0x1a')]('UpdateMailInteraction',_0x5ecf1a[_0xda4b('0x1c')],_0x9328e0);_0x2397de(_0x5c94de[_0xda4b('0x1a')](0x1f4,_0x5ecf1a[_0xda4b('0x1c')]));});});};exports[_0xda4b('0x26')]=function(_0x5f4a3a){return new Promise(function(_0x3f6948,_0x1ce977){return db[_0xda4b('0x20')]['find']({'where':_0x5f4a3a['options']?_0x5f4a3a[_0xda4b('0x22')][_0xda4b('0x23')]||null:null})['then'](function(_0x113c86){if(_0x113c86){return _0x113c86[_0xda4b('0x27')](_0x5f4a3a['body'][_0xda4b('0x28')],_[_0xda4b('0x29')](_0x5f4a3a['body'],[_0xda4b('0x28'),'id'])||{});}})[_0xda4b('0x2a')](function(_0x18eae2){logger['info']('AddTags',_0x5f4a3a);logger[_0xda4b('0x17')](_0xda4b('0x2b'),_0x5f4a3a,JSON[_0xda4b('0x19')](_0x18eae2));_0x3f6948(_0x18eae2);})['catch'](function(_0x21123e){logger['error'](_0xda4b('0x2b'),_0x21123e[_0xda4b('0x1c')],_0x5f4a3a);_0x1ce977(_this['error'](0x1f4,_0x21123e[_0xda4b('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index aabf0e4..f9a08d9 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 _0x4e0c=['save','remove','update','emit','register','mailInteraction:','./mailInteraction.events'];(function(_0x11ba46,_0x1d6752){var _0x1c8c6f=function(_0x4cf96f){while(--_0x4cf96f){_0x11ba46['push'](_0x11ba46['shift']());}};_0x1c8c6f(++_0x1d6752);}(_0x4e0c,0x1e9));var _0xc4e0=function(_0x15ec4e,_0x40b7e0){_0x15ec4e=_0x15ec4e-0x0;var _0xb5e5dd=_0x4e0c[_0x15ec4e];return _0xb5e5dd;};'use strict';var MailInteractionEvents=require(_0xc4e0('0x0'));var events=[_0xc4e0('0x1'),_0xc4e0('0x2'),_0xc4e0('0x3')];function createListener(_0x12eec9,_0x3fa241){return function(_0xe9be1d){_0x3fa241[_0xc4e0('0x4')](_0x12eec9,_0xe9be1d);};}function removeListener(_0xc5295f,_0x3ff568){return function(){MailInteractionEvents['removeListener'](_0xc5295f,_0x3ff568);};}exports[_0xc4e0('0x5')]=function(_0x1196da){for(var _0x1e5911=0x0,_0x1f9fbc=events['length'];_0x1e5911<_0x1f9fbc;_0x1e5911++){var _0x47ded4=events[_0x1e5911];var _0x5e9aed=createListener(_0xc4e0('0x6')+_0x47ded4,_0x1196da);MailInteractionEvents['on'](_0x47ded4,_0x5e9aed);}}; \ No newline at end of file +var _0xd356=['removeListener','register','./mailInteraction.events','remove','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd356,0x80));var _0x6d35=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd356[_0x3dd15e];return _0x231fd0;};'use strict';var MailInteractionEvents=require(_0x6d35('0x0'));var events=['save',_0x6d35('0x1'),_0x6d35('0x2')];function createListener(_0x1fa9b7,_0x355e2b){return function(_0xaafb6b){_0x355e2b[_0x6d35('0x3')](_0x1fa9b7,_0xaafb6b);};}function removeListener(_0x21a3fb,_0xb68ef6){return function(){MailInteractionEvents[_0x6d35('0x4')](_0x21a3fb,_0xb68ef6);};}exports[_0x6d35('0x5')]=function(_0x3b8a7a){for(var _0x306716=0x0,_0x490469=events['length'];_0x306716<_0x490469;_0x306716++){var _0x59de64=events[_0x306716];var _0x2f9d59=createListener('mailInteraction:'+_0x59de64,_0x3b8a7a);MailInteractionEvents['on'](_0x59de64,_0x2f9d59);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 6075a83..318fe02 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 _0x92a2=['../../components/interaction/service','get','isAuthenticated','/describe','describe','show','/:id/download','post','tracked','mail','mailmessage:create','create','put','/:id','/:id/accept','accept','/:id/reject','reject','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x333a22,_0x53877e){var _0x435701=function(_0x4f7dcb){while(--_0x4f7dcb){_0x333a22['push'](_0x333a22['shift']());}};_0x435701(++_0x53877e);}(_0x92a2,0x1ee));var _0x292a=function(_0x549589,_0x8b19df){_0x549589=_0x549589-0x0;var _0x425184=_0x92a2[_0x549589];return _0x425184;};'use strict';var multer=require(_0x292a('0x0'));var util=require(_0x292a('0x1'));var path=require(_0x292a('0x2'));var timeout=require(_0x292a('0x3'));var express=require('express');var router=express[_0x292a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x292a('0x5'));var interaction=require(_0x292a('0x6'));var config=require('../../config/environment');var controller=require('./mailMessage.controller');router[_0x292a('0x7')]('/',auth[_0x292a('0x8')](),controller['index']);router[_0x292a('0x7')](_0x292a('0x9'),auth[_0x292a('0x8')](),controller[_0x292a('0xa')]);router[_0x292a('0x7')]('/:id',auth[_0x292a('0x8')](),controller[_0x292a('0xb')]);router['get'](_0x292a('0xc'),auth[_0x292a('0x8')](),controller['download']);router[_0x292a('0xd')]('/',auth['isAuthenticated'](),interaction[_0x292a('0xe')](_0x292a('0xf'),_0x292a('0x10')),controller[_0x292a('0x11')]);router[_0x292a('0x12')](_0x292a('0x13'),auth[_0x292a('0x8')](),controller['update']);router[_0x292a('0x12')](_0x292a('0x14'),auth[_0x292a('0x8')](),controller[_0x292a('0x15')]);router[_0x292a('0x12')](_0x292a('0x16'),auth['isAuthenticated'](),controller[_0x292a('0x17')]);router['delete'](_0x292a('0x13'),auth['isAuthenticated'](),controller[_0x292a('0x18')]);module['exports']=router; \ No newline at end of file +var _0xc882=['show','download','post','tracked','mail','create','put','update','/:id/accept','reject','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/:id'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0xc882,0xff));var _0x2c88=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xc882[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x2c88('0x0'));var util=require(_0x2c88('0x1'));var path=require(_0x2c88('0x2'));var timeout=require(_0x2c88('0x3'));var express=require(_0x2c88('0x4'));var router=express[_0x2c88('0x5')]();var fs_extra=require(_0x2c88('0x6'));var auth=require(_0x2c88('0x7'));var interaction=require(_0x2c88('0x8'));var config=require(_0x2c88('0x9'));var controller=require(_0x2c88('0xa'));router[_0x2c88('0xb')]('/',auth[_0x2c88('0xc')](),controller[_0x2c88('0xd')]);router[_0x2c88('0xb')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x2c88('0xb')](_0x2c88('0xe'),auth['isAuthenticated'](),controller[_0x2c88('0xf')]);router[_0x2c88('0xb')]('/:id/download',auth[_0x2c88('0xc')](),controller[_0x2c88('0x10')]);router[_0x2c88('0x11')]('/',auth['isAuthenticated'](),interaction[_0x2c88('0x12')](_0x2c88('0x13'),'mailmessage:create'),controller[_0x2c88('0x14')]);router[_0x2c88('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x2c88('0x16')]);router[_0x2c88('0x15')](_0x2c88('0x17'),auth['isAuthenticated'](),controller['accept']);router[_0x2c88('0x15')]('/:id/reject',auth[_0x2c88('0xc')](),controller[_0x2c88('0x18')]);router[_0x2c88('0x19')](_0x2c88('0xe'),auth[_0x2c88('0xc')](),controller[_0x2c88('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 15674af..742f246 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 _0x7d68=['TEXT','long','medium','ENUM','out','STRING','DATE','INTEGER','Email','Chat','sequelize','lodash','exports'];(function(_0x105f10,_0x358d44){var _0x20b907=function(_0x228718){while(--_0x228718){_0x105f10['push'](_0x105f10['shift']());}};_0x20b907(++_0x358d44);}(_0x7d68,0xa6));var _0x87d6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7d68[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x87d6('0x0'));var _=require(_0x87d6('0x1'));module[_0x87d6('0x2')]={'body':{'type':Sequelize[_0x87d6('0x3')](_0x87d6('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x87d6('0x3')](_0x87d6('0x5'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x87d6('0x6')]('in',_0x87d6('0x7')),'defaultValue':_0x87d6('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0x87d6('0x8')](0x1fe)},'from':{'type':Sequelize[_0x87d6('0x8')]},'to':{'type':Sequelize[_0x87d6('0x3')](_0x87d6('0x4'))},'cc':{'type':Sequelize[_0x87d6('0x3')](_0x87d6('0x4'))},'bcc':{'type':Sequelize[_0x87d6('0x3')](_0x87d6('0x4'))},'subject':{'type':Sequelize[_0x87d6('0x3')]},'sentAt':{'type':Sequelize[_0x87d6('0x9')]},'attach':{'type':Sequelize[_0x87d6('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x87d6('0x3')]('long')},'originCc':{'type':Sequelize[_0x87d6('0x3')]('long')},'originChannel':{'type':Sequelize[_0x87d6('0x6')](_0x87d6('0xb'),_0x87d6('0xc')),'defaultValue':_0x87d6('0xb'),'allowNull':![]}}; \ No newline at end of file +var _0xe3f6=['Email','sequelize','lodash','TEXT','long','medium','BOOLEAN','ENUM','STRING','DATE','INTEGER'];(function(_0x4c4325,_0x4a0b4d){var _0xf89a8e=function(_0x4e16f0){while(--_0x4e16f0){_0x4c4325['push'](_0x4c4325['shift']());}};_0xf89a8e(++_0x4a0b4d);}(_0xe3f6,0x7a));var _0x6e3f=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0xe3f6[_0x45b034];return _0x509cb0;};'use strict';var Sequelize=require(_0x6e3f('0x0'));var _=require(_0x6e3f('0x1'));module['exports']={'body':{'type':Sequelize[_0x6e3f('0x2')](_0x6e3f('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x6e3f('0x2')](_0x6e3f('0x4'))},'read':{'type':Sequelize[_0x6e3f('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6e3f('0x6')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x6e3f('0x7')](0x1fe)},'from':{'type':Sequelize[_0x6e3f('0x7')]},'to':{'type':Sequelize[_0x6e3f('0x2')]('long')},'cc':{'type':Sequelize[_0x6e3f('0x2')](_0x6e3f('0x3'))},'bcc':{'type':Sequelize['TEXT'](_0x6e3f('0x3'))},'subject':{'type':Sequelize[_0x6e3f('0x2')]},'sentAt':{'type':Sequelize[_0x6e3f('0x8')]},'attach':{'type':Sequelize[_0x6e3f('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0x6e3f('0x8')]},'originTo':{'type':Sequelize[_0x6e3f('0x2')](_0x6e3f('0x3'))},'originCc':{'type':Sequelize[_0x6e3f('0x2')](_0x6e3f('0x3'))},'originChannel':{'type':Sequelize[_0x6e3f('0x6')](_0x6e3f('0xa'),'Chat'),'defaultValue':_0x6e3f('0xa'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 73d392c..2f24faf 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 _0xd500=['../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register','client','http','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','status','json','offset','undefined','limit','count','set','update','then','destroy','sendStatus','stack','name','send','index','MailMessage','rawAttributes','fieldName','type','key','map','query','intersection','attributes','model','fields','hasOwnProperty','nolimit','sort','pick','filters','where','filter','merge','options','include','findAll','rows','show','params','keys','includeAll','find','body','describe','create','direction','split','MailAccount','MailAccountId','CmList','List','Contacts','updatedAt','DESC','CloudProvider','Smtp','getSmtpOptions','attachments','length','join','root','server/files/attachments','basename','ListId','List\x20not\x20found','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','UserId','user','agent','get','MailInteraction','MailInteractionId','read1stAt','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','fromString','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','motionChannel','rejectmessage','download','unix','toString','server','files','message-%s.eml','from','subject','Attachment','Attachments','decode','createdAt','headers','bcc','Bcc','existsSync','push','readFileSync','build','eml-format','bluebird','path','lodash'];(function(_0x55d911,_0x2b768c){var _0x3104c2=function(_0x1b4386){while(--_0x1b4386){_0x55d911['push'](_0x55d911['shift']());}};_0x3104c2(++_0x2b768c);}(_0xd500,0x97));var _0x0d50=function(_0x519756,_0x288785){_0x519756=_0x519756-0x0;var _0x37047e=_0xd500[_0x519756];return _0x37047e;};'use strict';var emlformat=require(_0x0d50('0x0'));var moment=require('moment');var BPromise=require(_0x0d50('0x1'));var util=require('util');var path=require(_0x0d50('0x2'));var fs=require('fs');var _=require(_0x0d50('0x3'));var Redis=require('ioredis');var htmlToText=require('html-to-text');var qs=require(_0x0d50('0x4'));var logger=require(_0x0d50('0x5'))(_0x0d50('0x6'));var interaction_log=require(_0x0d50('0x5'))(_0x0d50('0x7'));var config=require(_0x0d50('0x8'));var db=require(_0x0d50('0x9'))['db'];config['redis']=_[_0x0d50('0xa')](config[_0x0d50('0xb')],{'host':_0x0d50('0xc'),'port':0x18eb});var socket=require(_0x0d50('0xd'))(new Redis(config['redis']));var htmlEntities=require(_0x0d50('0xe'));require(_0x0d50('0xf'))[_0x0d50('0x10')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9003=jayson[_0x0d50('0x11')][_0x0d50('0x12')]({'port':0x232b});var client9002=jayson[_0x0d50('0x11')][_0x0d50('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x13ad47,_0x10e433,_0x2390b2,_0x7793a4){return new BPromise(function(_0x1626c8,_0x2b4c52){var _0x517305=_0x7793a4||client;return _0x517305[_0x0d50('0x13')](_0x13ad47,_0x2390b2)['then'](function(_0x120457){logger[_0x0d50('0x14')](_0x0d50('0x15'),_0x10e433,_0x0d50('0x16'));logger[_0x0d50('0x17')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x10e433,_0x0d50('0x16'),JSON[_0x0d50('0x18')](_0x120457));if(_0x120457['error']){if(_0x120457['error']['code']===0x1f4){logger[_0x0d50('0x19')](_0x0d50('0x15'),_0x10e433,_0x120457[_0x0d50('0x19')]['message']);return _0x2b4c52(_0x120457[_0x0d50('0x19')][_0x0d50('0x1a')]);}logger['error'](_0x0d50('0x15'),_0x10e433,_0x120457[_0x0d50('0x19')][_0x0d50('0x1a')]);return _0x1626c8(_0x120457[_0x0d50('0x19')][_0x0d50('0x1a')]);}else{logger[_0x0d50('0x14')]('MailMessage,\x20%s,\x20%s',_0x10e433,'request\x20sent');_0x1626c8(_0x120457['result'][_0x0d50('0x1a')]);}})[_0x0d50('0x1b')](function(_0x4e2177){logger[_0x0d50('0x19')](_0x0d50('0x15'),_0x10e433,_0x4e2177);_0x2b4c52(_0x4e2177);});});}function respondWithResult(_0x52564f,_0x5194ce){_0x5194ce=_0x5194ce||0xc8;return function(_0x375429){if(_0x375429){return _0x52564f[_0x0d50('0x1c')](_0x5194ce)[_0x0d50('0x1d')](_0x375429);}};}function respondWithFilteredResult(_0x4fa9d9,_0x297f18){return function(_0x7e5af3){if(_0x7e5af3){var _0x5e7285=typeof _0x297f18[_0x0d50('0x1e')]===_0x0d50('0x1f')&&typeof _0x297f18[_0x0d50('0x20')]===_0x0d50('0x1f');var _0x35a245=_0x7e5af3['count'];var _0x1057e7=_0x5e7285?0x0:_0x297f18['offset'];var _0x320732=_0x5e7285?_0x7e5af3[_0x0d50('0x21')]:_0x297f18['offset']+_0x297f18[_0x0d50('0x20')];var _0xaaf138;if(_0x320732>=_0x35a245){_0x320732=_0x35a245;_0xaaf138=0xc8;}else{_0xaaf138=0xce;}_0x4fa9d9[_0x0d50('0x1c')](_0xaaf138);return _0x4fa9d9[_0x0d50('0x22')]('Content-Range',_0x1057e7+'-'+_0x320732+'/'+_0x35a245)[_0x0d50('0x1d')](_0x7e5af3);}return null;};}function saveUpdates(_0x4c951f){return function(_0x437adc){if(_0x437adc){return _0x437adc[_0x0d50('0x23')](_0x4c951f)[_0x0d50('0x24')](function(_0x3f808f){return _0x3f808f;});}return null;};}function removeEntity(_0x4ec90a){return function(_0x4a28e5){if(_0x4a28e5){return _0x4a28e5[_0x0d50('0x25')]()[_0x0d50('0x24')](function(){_0x4ec90a[_0x0d50('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14f8c8){return function(_0x7cdc0){if(!_0x7cdc0){_0x14f8c8[_0x0d50('0x26')](0x194);}return _0x7cdc0;};}function handleError(_0x66e027,_0x4a091a){_0x4a091a=_0x4a091a||0x1f4;return function(_0x4a9e53){logger[_0x0d50('0x19')](_0x4a9e53[_0x0d50('0x27')]);if(_0x4a9e53[_0x0d50('0x28')]){delete _0x4a9e53['name'];}_0x66e027[_0x0d50('0x1c')](_0x4a091a)[_0x0d50('0x29')](_0x4a9e53);};}exports[_0x0d50('0x2a')]=function(_0x5e8e02,_0x3cb891){var _0x4dca24={},_0x2378e4={},_0x2e7859={'count':0x0,'rows':[]};var _0x574b67=_['map'](db[_0x0d50('0x2b')][_0x0d50('0x2c')],function(_0x43d8df){return{'name':_0x43d8df[_0x0d50('0x2d')],'type':_0x43d8df[_0x0d50('0x2e')][_0x0d50('0x2f')]};});_0x2378e4['model']=_[_0x0d50('0x30')](_0x574b67,_0x0d50('0x28'));_0x2378e4[_0x0d50('0x31')]=_['keys'](_0x5e8e02['query']);_0x2378e4['filters']=_[_0x0d50('0x32')](_0x2378e4['model'],_0x2378e4[_0x0d50('0x31')]);_0x4dca24[_0x0d50('0x33')]=_['intersection'](_0x2378e4[_0x0d50('0x34')],qs[_0x0d50('0x35')](_0x5e8e02[_0x0d50('0x31')][_0x0d50('0x35')]));_0x4dca24[_0x0d50('0x33')]=_0x4dca24[_0x0d50('0x33')]['length']?_0x4dca24[_0x0d50('0x33')]:_0x2378e4[_0x0d50('0x34')];if(!_0x5e8e02[_0x0d50('0x31')][_0x0d50('0x36')](_0x0d50('0x37'))){_0x4dca24[_0x0d50('0x20')]=qs['limit'](_0x5e8e02[_0x0d50('0x31')][_0x0d50('0x20')]);_0x4dca24['offset']=qs[_0x0d50('0x1e')](_0x5e8e02['query']['offset']);}_0x4dca24['order']=qs[_0x0d50('0x38')](_0x5e8e02[_0x0d50('0x31')][_0x0d50('0x38')]);_0x4dca24['where']=qs['filters'](_[_0x0d50('0x39')](_0x5e8e02[_0x0d50('0x31')],_0x2378e4[_0x0d50('0x3a')]),_0x574b67);if(_0x5e8e02[_0x0d50('0x31')]['filter']){_0x4dca24[_0x0d50('0x3b')]=_['merge'](_0x4dca24['where'],{'$or':_['map'](_0x574b67,function(_0x32b4b3){if(_0x32b4b3[_0x0d50('0x2e')]!=='VIRTUAL'){var _0x271b81={};_0x271b81[_0x32b4b3[_0x0d50('0x28')]]={'$like':'%'+_0x5e8e02[_0x0d50('0x31')][_0x0d50('0x3c')]+'%'};return _0x271b81;}})});}_0x4dca24=_[_0x0d50('0x3d')]({},_0x4dca24,_0x5e8e02[_0x0d50('0x3e')]);var _0xdd6149={'where':_0x4dca24[_0x0d50('0x3b')]};return db[_0x0d50('0x2b')][_0x0d50('0x21')](_0xdd6149)[_0x0d50('0x24')](function(_0xea22a8){_0x2e7859[_0x0d50('0x21')]=_0xea22a8;if(_0x5e8e02[_0x0d50('0x31')]['includeAll']){_0x4dca24[_0x0d50('0x3f')]=[{'all':!![]}];}return db[_0x0d50('0x2b')][_0x0d50('0x40')](_0x4dca24);})['then'](function(_0x103035){_0x2e7859[_0x0d50('0x41')]=_0x103035;return _0x2e7859;})[_0x0d50('0x24')](respondWithFilteredResult(_0x3cb891,_0x4dca24))[_0x0d50('0x1b')](handleError(_0x3cb891,null));};exports[_0x0d50('0x42')]=function(_0x1e6540,_0x1b869f){var _0xdca3e0={'raw':!![],'where':{'id':_0x1e6540[_0x0d50('0x43')]['id']}},_0x475289={};_0x475289[_0x0d50('0x34')]=_['keys'](db[_0x0d50('0x2b')][_0x0d50('0x2c')]);_0x475289[_0x0d50('0x31')]=_[_0x0d50('0x44')](_0x1e6540[_0x0d50('0x31')]);_0x475289['filters']=_['intersection'](_0x475289['model'],_0x475289[_0x0d50('0x31')]);_0xdca3e0[_0x0d50('0x33')]=_[_0x0d50('0x32')](_0x475289[_0x0d50('0x34')],qs[_0x0d50('0x35')](_0x1e6540[_0x0d50('0x31')][_0x0d50('0x35')]));_0xdca3e0['attributes']=_0xdca3e0['attributes']['length']?_0xdca3e0[_0x0d50('0x33')]:_0x475289[_0x0d50('0x34')];if(_0x1e6540['query'][_0x0d50('0x45')]){_0xdca3e0['include']=[{'all':!![]}];}_0xdca3e0=_[_0x0d50('0x3d')]({},_0xdca3e0,_0x1e6540[_0x0d50('0x3e')]);return db[_0x0d50('0x2b')][_0x0d50('0x46')](_0xdca3e0)['then'](handleEntityNotFound(_0x1b869f,null))[_0x0d50('0x24')](respondWithResult(_0x1b869f,null))[_0x0d50('0x1b')](handleError(_0x1b869f,null));};exports[_0x0d50('0x23')]=function(_0xbdc642,_0x120521){if(_0xbdc642[_0x0d50('0x47')]['id']){delete _0xbdc642['body']['id'];}return db[_0x0d50('0x2b')][_0x0d50('0x46')]({'where':{'id':_0xbdc642['params']['id']}})[_0x0d50('0x24')](handleEntityNotFound(_0x120521,null))[_0x0d50('0x24')](saveUpdates(_0xbdc642[_0x0d50('0x47')],null))[_0x0d50('0x24')](respondWithResult(_0x120521,null))[_0x0d50('0x1b')](handleError(_0x120521,null));};exports[_0x0d50('0x25')]=function(_0x2f3d32,_0x251c99){return db[_0x0d50('0x2b')][_0x0d50('0x46')]({'where':{'id':_0x2f3d32[_0x0d50('0x43')]['id']}})[_0x0d50('0x24')](handleEntityNotFound(_0x251c99,null))[_0x0d50('0x24')](removeEntity(_0x251c99,null))['catch'](handleError(_0x251c99,null));};exports[_0x0d50('0x48')]=function(_0x496ae7,_0x5341e0){return db['MailMessage'][_0x0d50('0x48')]()[_0x0d50('0x24')](respondWithResult(_0x5341e0,null))[_0x0d50('0x1b')](handleError(_0x5341e0,null));};exports[_0x0d50('0x49')]=function(_0x42a359,_0x46a443){return db['MailMessage'][_0x0d50('0x49')](_0x42a359[_0x0d50('0x47')])[_0x0d50('0x24')](function(_0x5f0f94){if(_0x5f0f94){if(_0x5f0f94[_0x0d50('0x4a')]==='out'&&!_0x5f0f94['secret']){var _0x14bb11,_0x15d424,_0x221e9d;if(_0x42a359[_0x0d50('0x47')]['to']){_0x15d424=_0x42a359[_0x0d50('0x47')]['to'][_0x0d50('0x4b')](',')[0x0];}return db[_0x0d50('0x4c')]['findOne']({'where':{'id':_0x5f0f94[_0x0d50('0x4d')]},'include':[{'model':db[_0x0d50('0x4e')],'as':_0x0d50('0x4f'),'include':[{'model':db['CmContact'],'as':_0x0d50('0x50'),'where':{'email':_0x15d424},'limit':0x1,'order':[[_0x0d50('0x51'),_0x0d50('0x52')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0x0d50('0x53')],'as':_0x0d50('0x53'),'raw':!![]}]}]})[_0x0d50('0x24')](function(_0x59166f){_0x14bb11=_0x59166f;if(!_0x14bb11||!_0x14bb11[_0x0d50('0x54')])return;var _0x3d19fd=_0x14bb11[_0x0d50('0x55')]();if(_0x42a359[_0x0d50('0x47')][_0x0d50('0x56')]&&_0x42a359[_0x0d50('0x47')][_0x0d50('0x56')]['length']){for(var _0x438a3f=0x0;_0x438a3f<_0x42a359['body'][_0x0d50('0x56')][_0x0d50('0x57')];_0x438a3f+=0x1){_0x42a359['body'][_0x0d50('0x56')][_0x438a3f]={'filename':_0x42a359[_0x0d50('0x47')][_0x0d50('0x56')][_0x438a3f][_0x0d50('0x28')],'path':path[_0x0d50('0x58')](config[_0x0d50('0x59')],_0x0d50('0x5a'),_0x42a359[_0x0d50('0x47')][_0x0d50('0x56')][_0x438a3f][_0x0d50('0x5b')])};}}_0x221e9d={'account':_0x3d19fd,'message':_0x42a359[_0x0d50('0x47')]};return;})[_0x0d50('0x24')](function(){if(_0x14bb11[_0x0d50('0x4f')]){if(_0x14bb11[_0x0d50('0x4f')]['Contacts']['length']){return _0x14bb11[_0x0d50('0x4f')][_0x0d50('0x50')][0x0];}else{return db['CmContact'][_0x0d50('0x49')](_[_0x0d50('0xa')](_0x42a359[_0x0d50('0x47')],{'firstName':_0x42a359['body']['to'],'email':_0x42a359[_0x0d50('0x47')]['to'],'phone':_0x42a359[_0x0d50('0x47')]['to'],'ListId':_0x14bb11[_0x0d50('0x5c')]}));}}else{throw new Error(_0x0d50('0x5d'));}})[_0x0d50('0x24')](function(){if(_0x221e9d){return respondWithRpcPromise('SendMail',_0x0d50('0x5e'),_0x221e9d,client9003)[_0x0d50('0x24')](function(_0x35487f){return _0x5f0f94[_0x0d50('0x23')]({'read':!![],'messageId':_0x35487f[_0x0d50('0x5f')],'sentAt':moment()[_0x0d50('0x60')](_0x0d50('0x61'))});})[_0x0d50('0x1b')](function(_0x40dd4f){logger[_0x0d50('0x19')]('%s',JSON[_0x0d50('0x18')](_0x40dd4f));return _0x5f0f94;});}return _0x5f0f94;});}return _0x5f0f94;}})[_0x0d50('0x24')](respondWithResult(_0x46a443,0xc9))[_0x0d50('0x1b')](handleError(_0x46a443,null));};exports[_0x0d50('0x62')]=function(_0x3b92df,_0x4ca8a8){var _0x5a43f1={'agent':{},'channel':_0x0d50('0x63')};if(_0x3b92df[_0x0d50('0x47')]['id']){delete _0x3b92df[_0x0d50('0x47')]['id'];}_0x3b92df[_0x0d50('0x47')][_0x0d50('0x64')]=!![];_0x3b92df[_0x0d50('0x47')]['readAt']=moment()[_0x0d50('0x60')](_0x0d50('0x61'));_0x3b92df['body'][_0x0d50('0x65')]=_0x3b92df[_0x0d50('0x47')][_0x0d50('0x65')]||_0x3b92df[_0x0d50('0x66')]['id'];_0x5a43f1[_0x0d50('0x67')]['id']=_0x3b92df[_0x0d50('0x47')][_0x0d50('0x65')];return db[_0x0d50('0x2b')][_0x0d50('0x46')]({'where':{'id':_0x3b92df['params']['id'],'UserId':null}})[_0x0d50('0x24')](handleEntityNotFound(_0x4ca8a8,null))[_0x0d50('0x24')](saveUpdates(_0x3b92df[_0x0d50('0x47')],null))['then'](function(_0x2d44b5){if(_0x2d44b5){_0x5a43f1[_0x0d50('0x1a')]=_0x2d44b5[_0x0d50('0x68')]({'plain':!![]});return db[_0x0d50('0x69')][_0x0d50('0x46')]({'where':{'id':_0x2d44b5[_0x0d50('0x6a')]}});}return null;})[_0x0d50('0x24')](handleEntityNotFound(_0x4ca8a8,null))['then'](function(_0x181a28){if(_0x181a28){return _0x181a28[_0x0d50('0x23')]({'UserId':_0x3b92df['body'][_0x0d50('0x65')],'read1stAt':_['isNil'](_0x181a28[_0x0d50('0x6b')])?moment()[_0x0d50('0x60')](_0x0d50('0x61')):undefined});}return null;})[_0x0d50('0x24')](function(_0x30a1e9){if(_0x30a1e9){_0x5a43f1['interaction']=_0x30a1e9[_0x0d50('0x68')]({'plain':!![]});interaction_log[_0x0d50('0x14')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3b92df[_0x0d50('0x66')]['id'],_0x3b92df[_0x0d50('0x66')][_0x0d50('0x28')],_0x3b92df[_0x0d50('0x66')]['role'],_0x5a43f1[_0x0d50('0x6c')]['id'],_0x3b92df[_0x0d50('0x47')]?JSON[_0x0d50('0x18')](_0x3b92df['body']):_0x0d50('0x6d'));return respondWithRpcPromise(_0x0d50('0x6e'),_0x0d50('0x6f'),_0x5a43f1);}return null;})[_0x0d50('0x24')](function(_0x590c38){var _0x507a6e=_0x0d50('0x70')+_0x590c38[_0x0d50('0x1a')][_0x0d50('0x71')];return db[_0x0d50('0x72')][_0x0d50('0x31')](_0x507a6e,{'type':db[_0x0d50('0x73')]['QueryTypes'][_0x0d50('0x74')],'raw':!![]})['then'](function(_0x40d2c9){return _0x40d2c9;});})[_0x0d50('0x24')](function(_0x80f672){if(_0x80f672){_0x5a43f1[_0x0d50('0x1a')][_0x0d50('0x75')]=_0x80f672[0x0];if(!_0x3b92df[_0x0d50('0x47')]['UserId'])return;return db[_0x0d50('0x76')][_0x0d50('0x46')]({'where':{'id':_0x3b92df[_0x0d50('0x47')][_0x0d50('0x65')],'role':_0x0d50('0x67')},'attributes':['id',_0x0d50('0x28'),_0x0d50('0x77'),_0x0d50('0x78'),_0x0d50('0x79')],'raw':!![]});}return null;})[_0x0d50('0x24')](function(_0x5dd8e2){if(!_0x5dd8e2)return null;_0x5a43f1[_0x0d50('0x1a')]['agent']=_0x5dd8e2;return _0x5a43f1;})[_0x0d50('0x24')](function(_0x3b4dbb){if(_0x3b4dbb){if(_0x3b92df[_0x0d50('0x47')][_0x0d50('0x7a')]){_0x5a43f1['message'][_0x0d50('0x7b')]=util[_0x0d50('0x60')](_0x0d50('0x7c'),_0x3b92df['user']['name']);_0x5a43f1['message']['channel']=_0x5a43f1[_0x0d50('0x7d')];_0x5a43f1[_0x0d50('0x1a')]['motionChannel']=_0x5a43f1[_0x0d50('0x7d')];_0x5a43f1[_0x0d50('0x1a')][_0x0d50('0x7e')]='accept';_0x5a43f1['message'][_0x0d50('0x47')]=htmlToText[_0x0d50('0x7f')](_0x5a43f1[_0x0d50('0x1a')][_0x0d50('0x47')]);return respondWithRpcPromise(_0x0d50('0x80'),'EventManager',{'event':_0x0d50('0x81'),'message':_0x5a43f1[_0x0d50('0x1a')]},client9002)[_0x0d50('0x24')](function(){return _0x5a43f1;});}return _0x5a43f1;}return null;})[_0x0d50('0x24')](respondWithResult(_0x4ca8a8,null))[_0x0d50('0x1b')](handleError(_0x4ca8a8,null));};exports[_0x0d50('0x82')]=function(_0x56a30c,_0x79b6fe){var _0x4ef8fb={'agent':{},'channel':_0x0d50('0x63')};if(_0x56a30c[_0x0d50('0x47')]['id']){delete _0x56a30c[_0x0d50('0x47')]['id'];}_0x56a30c[_0x0d50('0x47')][_0x0d50('0x65')]=_0x56a30c['body'][_0x0d50('0x65')]||_0x56a30c[_0x0d50('0x66')]['id'];_0x4ef8fb[_0x0d50('0x67')]['id']=_0x56a30c[_0x0d50('0x47')]['UserId'];return db['MailMessage']['find']({'where':{'id':_0x56a30c['params']['id'],'UserId':null}})[_0x0d50('0x24')](handleEntityNotFound(_0x79b6fe,null))[_0x0d50('0x24')](function(_0x422c2a){if(_0x422c2a){_0x4ef8fb[_0x0d50('0x1a')]=_0x422c2a[_0x0d50('0x68')]({'plain':!![]});return db[_0x0d50('0x69')][_0x0d50('0x46')]({'where':{'id':_0x422c2a[_0x0d50('0x6a')]}});}return null;})[_0x0d50('0x24')](handleEntityNotFound(_0x79b6fe,null))['then'](function(_0x386d4f){if(_0x386d4f){_0x4ef8fb['interaction']=_0x386d4f[_0x0d50('0x68')]({'plain':!![]});interaction_log[_0x0d50('0x14')](_0x0d50('0x83'),_0x56a30c[_0x0d50('0x66')]['id'],_0x56a30c['user'][_0x0d50('0x28')],_0x56a30c[_0x0d50('0x66')][_0x0d50('0x84')],_0x4ef8fb['interaction']['id'],_0x56a30c[_0x0d50('0x47')]?JSON[_0x0d50('0x18')](_0x56a30c[_0x0d50('0x47')]):'null');return respondWithRpcPromise('RejectMessage',_0x0d50('0x85'),_0x4ef8fb);}return null;})[_0x0d50('0x24')](function(_0x1698e8){var _0x4dad83='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1698e8[_0x0d50('0x1a')][_0x0d50('0x71')];return db[_0x0d50('0x72')][_0x0d50('0x31')](_0x4dad83,{'type':db[_0x0d50('0x73')]['QueryTypes'][_0x0d50('0x74')],'raw':!![]})[_0x0d50('0x24')](function(_0x3814c4){return _0x3814c4;});})['then'](function(_0x46edf6){if(_0x46edf6){_0x4ef8fb[_0x0d50('0x1a')][_0x0d50('0x75')]=_0x46edf6[0x0];if(!_0x56a30c[_0x0d50('0x47')]['UserId'])return;return db[_0x0d50('0x76')]['find']({'where':{'id':_0x56a30c['body'][_0x0d50('0x65')],'role':_0x0d50('0x67')},'attributes':['id',_0x0d50('0x28'),_0x0d50('0x77'),'email',_0x0d50('0x79')],'raw':!![]});}return null;})[_0x0d50('0x24')](function(_0xd4e832){if(!_0xd4e832)return null;_0x4ef8fb['message'][_0x0d50('0x67')]=_0xd4e832;return _0x4ef8fb;})[_0x0d50('0x24')](function(_0x3bcdab){if(_0x3bcdab){_0x3bcdab[_0x0d50('0x1a')][_0x0d50('0x7b')]=util[_0x0d50('0x60')](_0x0d50('0x7c'),_0x56a30c[_0x0d50('0x66')][_0x0d50('0x28')]);_0x3bcdab[_0x0d50('0x1a')]['channel']=_0x4ef8fb[_0x0d50('0x7d')];_0x3bcdab[_0x0d50('0x1a')][_0x0d50('0x86')]=_0x4ef8fb['channel'];_0x3bcdab[_0x0d50('0x1a')][_0x0d50('0x7e')]=_0x0d50('0x82');_0x3bcdab[_0x0d50('0x1a')][_0x0d50('0x47')]=htmlToText[_0x0d50('0x7f')](_0x4ef8fb[_0x0d50('0x1a')][_0x0d50('0x47')]);respondWithRpcPromise('EventManager','EventManager',{'event':_0x0d50('0x87'),'message':_0x3bcdab[_0x0d50('0x1a')]},client9002);return _0x4ef8fb;}return null;})[_0x0d50('0x24')](respondWithResult(_0x79b6fe,null))[_0x0d50('0x1b')](handleError(_0x79b6fe,null));};exports[_0x0d50('0x88')]=function(_0x354160,_0x22a46b){var _0x157be7=moment()[_0x0d50('0x89')]()[_0x0d50('0x8a')]();var _0x49c23e=path[_0x0d50('0x58')](config['root'],_0x0d50('0x8b'),_0x0d50('0x8c'),'tmp');var _0x3d3161=path[_0x0d50('0x58')](config[_0x0d50('0x59')],'server',_0x0d50('0x8c'),_0x0d50('0x56'));var _0x91fba8=util[_0x0d50('0x60')](_0x0d50('0x8d'),_0x157be7);return db[_0x0d50('0x2b')][_0x0d50('0x46')]({'where':{'id':_0x354160[_0x0d50('0x43')]['id']},'attributes':['id','body',_0x0d50('0x8e'),'to','cc','bcc',_0x0d50('0x8f'),'createdAt'],'include':_0x354160[_0x0d50('0x31')][_0x0d50('0x56')]?[{'model':db[_0x0d50('0x90')],'as':_0x0d50('0x91')}]:undefined})[_0x0d50('0x24')](handleEntityNotFound(_0x22a46b,null))['then'](function(_0x4184a4){if(_0x4184a4){var _0xdaaac9=_0x4184a4;var _0x15789b={'from':_0xdaaac9['from'],'to':_0xdaaac9['to'],'subject':_0xdaaac9[_0x0d50('0x8f')],'html':htmlEntities[_0x0d50('0x92')](_0xdaaac9['body']),'headers':{'Date':moment(_0xdaaac9[_0x0d50('0x93')])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x4184a4['cc']){_0x15789b[_0x0d50('0x94')]['Cc']=_0x4184a4['cc'];}if(_0x4184a4[_0x0d50('0x95')]){_0x15789b['headers'][_0x0d50('0x96')]=_0x4184a4[_0x0d50('0x95')];}return new BPromise(function(_0x422975,_0x51aab8){if(_0x4184a4['Attachments']){for(var _0x1e9e2c=0x0;_0x1e9e2c<_0x4184a4['Attachments'][_0x0d50('0x57')];_0x1e9e2c++){var _0x47784d=_0x4184a4['Attachments'][_0x1e9e2c];var _0x29c84b=path[_0x0d50('0x58')](_0x3d3161,_0x47784d[_0x0d50('0x5b')]);if(fs[_0x0d50('0x97')](_0x29c84b)){_0x15789b[_0x0d50('0x56')][_0x0d50('0x98')]({'name':_0x47784d[_0x0d50('0x28')],'contentType':_0x47784d[_0x0d50('0x2e')],'data':fs[_0x0d50('0x99')](_0x29c84b)});}}}emlformat[_0x0d50('0x9a')](_0x15789b,function(_0x3277e8,_0x35db05){if(_0x3277e8)return _0x51aab8(_0x3277e8);fs['writeFileSync'](path['join'](_0x49c23e,_0x91fba8),_0x35db05);return _0x422975(_0x35db05);});});}})[_0x0d50('0x24')](function(_0x528407){if(_0x528407){return _0x22a46b[_0x0d50('0x88')](path[_0x0d50('0x58')](_0x49c23e,_0x91fba8),_0x91fba8,function(_0x1d27d2){if(!_0x1d27d2)fs['unlinkSync'](path[_0x0d50('0x58')](_0x49c23e,_0x91fba8));});}})[_0x0d50('0x1b')](handleError(_0x22a46b,null));}; \ No newline at end of file +var _0xb22c=['getSmtpOptions','attachments','join','server/files/attachments','basename','Contacts','ListId','List\x20not\x20found','SendMail','sendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','stringify','accept','mail','read','readAt','user','MailInteraction','MailInteractionId','UserId','isNil','read1stAt','format','interaction','info','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','sequelize','Sequelize','QueryTypes','SELECT','contact','email','manual','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','agent','get','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','ContactId','User','fullname','internal','rejectmessage','unix','toString','root','files','tmp','server','message-%s.eml','from','subject','createdAt','Attachment','Attachments','decode','bcc','headers','Bcc','existsSync','push','readFileSync','build','download','unlinkSync','eml-format','bluebird','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','socket.io-emitter','html-entities','./mailMessage.socket','register','http','client','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','end','sendStatus','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','MailMessage','includeAll','include','rows','show','options','body','find','params','describe','create','direction','out','secret','split','findOne','MailAccountId','CmList','List','CmContact','updatedAt','DESC','MailServerOut','Smtp','CloudProvider'];(function(_0x2e167d,_0x157bca){var _0x2d12b7=function(_0x5ea6c0){while(--_0x5ea6c0){_0x2e167d['push'](_0x2e167d['shift']());}};_0x2d12b7(++_0x157bca);}(_0xb22c,0x19d));var _0xcb22=function(_0x2e83b0,_0x15cb2b){_0x2e83b0=_0x2e83b0-0x0;var _0x3911a9=_0xb22c[_0x2e83b0];return _0x3911a9;};'use strict';var emlformat=require(_0xcb22('0x0'));var moment=require('moment');var BPromise=require(_0xcb22('0x1'));var util=require(_0xcb22('0x2'));var path=require(_0xcb22('0x3'));var fs=require('fs');var _=require(_0xcb22('0x4'));var Redis=require(_0xcb22('0x5'));var htmlToText=require(_0xcb22('0x6'));var qs=require(_0xcb22('0x7'));var logger=require(_0xcb22('0x8'))(_0xcb22('0x9'));var interaction_log=require(_0xcb22('0x8'))(_0xcb22('0xa'));var config=require(_0xcb22('0xb'));var db=require(_0xcb22('0xc'))['db'];config['redis']=_['defaults'](config[_0xcb22('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xcb22('0xe'))(new Redis(config[_0xcb22('0xd')]));var htmlEntities=require(_0xcb22('0xf'));require(_0xcb22('0x10'))[_0xcb22('0x11')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xcb22('0x12')]({'port':0x232c});var client9003=jayson[_0xcb22('0x13')][_0xcb22('0x12')]({'port':0x232b});var client9002=jayson[_0xcb22('0x13')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cf2e2,_0x2e9aa5,_0x277171,_0x331d6e){return new BPromise(function(_0x59a082,_0x211ba7){var _0x2270f7=_0x331d6e||client;return _0x2270f7['request'](_0x1cf2e2,_0x277171)[_0xcb22('0x14')](function(_0x3df3f5){logger['info'](_0xcb22('0x15'),_0x2e9aa5,_0xcb22('0x16'));logger[_0xcb22('0x17')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x2e9aa5,_0xcb22('0x16'),JSON['stringify'](_0x3df3f5));if(_0x3df3f5['error']){if(_0x3df3f5[_0xcb22('0x18')]['code']===0x1f4){logger[_0xcb22('0x18')](_0xcb22('0x15'),_0x2e9aa5,_0x3df3f5['error'][_0xcb22('0x19')]);return _0x211ba7(_0x3df3f5[_0xcb22('0x18')][_0xcb22('0x19')]);}logger[_0xcb22('0x18')](_0xcb22('0x15'),_0x2e9aa5,_0x3df3f5[_0xcb22('0x18')][_0xcb22('0x19')]);return _0x59a082(_0x3df3f5[_0xcb22('0x18')][_0xcb22('0x19')]);}else{logger['info'](_0xcb22('0x15'),_0x2e9aa5,'request\x20sent');_0x59a082(_0x3df3f5[_0xcb22('0x1a')][_0xcb22('0x19')]);}})[_0xcb22('0x1b')](function(_0x2d1ee0){logger['error']('MailMessage,\x20%s,\x20%s',_0x2e9aa5,_0x2d1ee0);_0x211ba7(_0x2d1ee0);});});}function respondWithResult(_0x1a6298,_0x27a596){_0x27a596=_0x27a596||0xc8;return function(_0x3cd131){if(_0x3cd131){return _0x1a6298[_0xcb22('0x1c')](_0x27a596)[_0xcb22('0x1d')](_0x3cd131);}};}function respondWithFilteredResult(_0x4b68ec,_0x41a337){return function(_0x257426){if(_0x257426){var _0x5bcf12=typeof _0x41a337[_0xcb22('0x1e')]===_0xcb22('0x1f')&&typeof _0x41a337[_0xcb22('0x20')]==='undefined';var _0x3705f4=_0x257426['count'];var _0x39dbea=_0x5bcf12?0x0:_0x41a337[_0xcb22('0x1e')];var _0x21ecd7=_0x5bcf12?_0x257426[_0xcb22('0x21')]:_0x41a337['offset']+_0x41a337['limit'];var _0x46785f;if(_0x21ecd7>=_0x3705f4){_0x21ecd7=_0x3705f4;_0x46785f=0xc8;}else{_0x46785f=0xce;}_0x4b68ec[_0xcb22('0x1c')](_0x46785f);return _0x4b68ec[_0xcb22('0x22')](_0xcb22('0x23'),_0x39dbea+'-'+_0x21ecd7+'/'+_0x3705f4)[_0xcb22('0x1d')](_0x257426);}return null;};}function saveUpdates(_0x46bc2d){return function(_0x15c3f9){if(_0x15c3f9){return _0x15c3f9[_0xcb22('0x24')](_0x46bc2d)[_0xcb22('0x14')](function(_0x3a6336){return _0x3a6336;});}return null;};}function removeEntity(_0x130728){return function(_0x112d20){if(_0x112d20){return _0x112d20[_0xcb22('0x25')]()[_0xcb22('0x14')](function(){_0x130728[_0xcb22('0x1c')](0xcc)[_0xcb22('0x26')]();});}};}function handleEntityNotFound(_0x17adff){return function(_0x3dcc23){if(!_0x3dcc23){_0x17adff[_0xcb22('0x27')](0x194);}return _0x3dcc23;};}function handleError(_0x1d88fd,_0x4fb3ce){_0x4fb3ce=_0x4fb3ce||0x1f4;return function(_0x13a55c){logger[_0xcb22('0x18')](_0x13a55c['stack']);if(_0x13a55c['name']){delete _0x13a55c[_0xcb22('0x28')];}_0x1d88fd['status'](_0x4fb3ce)[_0xcb22('0x29')](_0x13a55c);};}exports[_0xcb22('0x2a')]=function(_0x3ffda6,_0x38dc3e){var _0x102895={},_0x352ee={},_0x11048b={'count':0x0,'rows':[]};var _0x26381b=_[_0xcb22('0x2b')](db['MailMessage'][_0xcb22('0x2c')],function(_0x2ace2c){return{'name':_0x2ace2c[_0xcb22('0x2d')],'type':_0x2ace2c[_0xcb22('0x2e')][_0xcb22('0x2f')]};});_0x352ee['model']=_[_0xcb22('0x2b')](_0x26381b,'name');_0x352ee[_0xcb22('0x30')]=_[_0xcb22('0x31')](_0x3ffda6[_0xcb22('0x30')]);_0x352ee[_0xcb22('0x32')]=_['intersection'](_0x352ee[_0xcb22('0x33')],_0x352ee[_0xcb22('0x30')]);_0x102895[_0xcb22('0x34')]=_[_0xcb22('0x35')](_0x352ee[_0xcb22('0x33')],qs[_0xcb22('0x36')](_0x3ffda6[_0xcb22('0x30')]['fields']));_0x102895[_0xcb22('0x34')]=_0x102895[_0xcb22('0x34')][_0xcb22('0x37')]?_0x102895[_0xcb22('0x34')]:_0x352ee[_0xcb22('0x33')];if(!_0x3ffda6[_0xcb22('0x30')][_0xcb22('0x38')]('nolimit')){_0x102895[_0xcb22('0x20')]=qs[_0xcb22('0x20')](_0x3ffda6['query']['limit']);_0x102895[_0xcb22('0x1e')]=qs['offset'](_0x3ffda6['query'][_0xcb22('0x1e')]);}_0x102895['order']=qs['sort'](_0x3ffda6['query'][_0xcb22('0x39')]);_0x102895[_0xcb22('0x3a')]=qs[_0xcb22('0x32')](_[_0xcb22('0x3b')](_0x3ffda6[_0xcb22('0x30')],_0x352ee[_0xcb22('0x32')]),_0x26381b);if(_0x3ffda6[_0xcb22('0x30')][_0xcb22('0x3c')]){_0x102895['where']=_[_0xcb22('0x3d')](_0x102895[_0xcb22('0x3a')],{'$or':_['map'](_0x26381b,function(_0x4a958b){if(_0x4a958b[_0xcb22('0x2e')]!==_0xcb22('0x3e')){var _0x3f79e1={};_0x3f79e1[_0x4a958b[_0xcb22('0x28')]]={'$like':'%'+_0x3ffda6[_0xcb22('0x30')]['filter']+'%'};return _0x3f79e1;}})});}_0x102895=_[_0xcb22('0x3d')]({},_0x102895,_0x3ffda6['options']);var _0x98d0a={'where':_0x102895[_0xcb22('0x3a')]};return db[_0xcb22('0x3f')][_0xcb22('0x21')](_0x98d0a)[_0xcb22('0x14')](function(_0x1fb7f5){_0x11048b[_0xcb22('0x21')]=_0x1fb7f5;if(_0x3ffda6[_0xcb22('0x30')][_0xcb22('0x40')]){_0x102895[_0xcb22('0x41')]=[{'all':!![]}];}return db[_0xcb22('0x3f')]['findAll'](_0x102895);})['then'](function(_0x13fd6e){_0x11048b[_0xcb22('0x42')]=_0x13fd6e;return _0x11048b;})['then'](respondWithFilteredResult(_0x38dc3e,_0x102895))[_0xcb22('0x1b')](handleError(_0x38dc3e,null));};exports[_0xcb22('0x43')]=function(_0x384974,_0x365d0f){var _0x36eafa={'raw':!![],'where':{'id':_0x384974['params']['id']}},_0x40b70e={};_0x40b70e[_0xcb22('0x33')]=_[_0xcb22('0x31')](db[_0xcb22('0x3f')][_0xcb22('0x2c')]);_0x40b70e[_0xcb22('0x30')]=_['keys'](_0x384974[_0xcb22('0x30')]);_0x40b70e[_0xcb22('0x32')]=_[_0xcb22('0x35')](_0x40b70e['model'],_0x40b70e[_0xcb22('0x30')]);_0x36eafa['attributes']=_[_0xcb22('0x35')](_0x40b70e['model'],qs['fields'](_0x384974[_0xcb22('0x30')]['fields']));_0x36eafa[_0xcb22('0x34')]=_0x36eafa[_0xcb22('0x34')][_0xcb22('0x37')]?_0x36eafa[_0xcb22('0x34')]:_0x40b70e[_0xcb22('0x33')];if(_0x384974['query'][_0xcb22('0x40')]){_0x36eafa['include']=[{'all':!![]}];}_0x36eafa=_['merge']({},_0x36eafa,_0x384974[_0xcb22('0x44')]);return db[_0xcb22('0x3f')]['find'](_0x36eafa)[_0xcb22('0x14')](handleEntityNotFound(_0x365d0f,null))['then'](respondWithResult(_0x365d0f,null))[_0xcb22('0x1b')](handleError(_0x365d0f,null));};exports['update']=function(_0x1ece4d,_0x4d9600){if(_0x1ece4d[_0xcb22('0x45')]['id']){delete _0x1ece4d[_0xcb22('0x45')]['id'];}return db['MailMessage'][_0xcb22('0x46')]({'where':{'id':_0x1ece4d[_0xcb22('0x47')]['id']}})[_0xcb22('0x14')](handleEntityNotFound(_0x4d9600,null))[_0xcb22('0x14')](saveUpdates(_0x1ece4d[_0xcb22('0x45')],null))[_0xcb22('0x14')](respondWithResult(_0x4d9600,null))['catch'](handleError(_0x4d9600,null));};exports[_0xcb22('0x25')]=function(_0x2170ed,_0x27760e){return db[_0xcb22('0x3f')]['find']({'where':{'id':_0x2170ed[_0xcb22('0x47')]['id']}})[_0xcb22('0x14')](handleEntityNotFound(_0x27760e,null))[_0xcb22('0x14')](removeEntity(_0x27760e,null))[_0xcb22('0x1b')](handleError(_0x27760e,null));};exports[_0xcb22('0x48')]=function(_0x355a31,_0x98adbf){return db[_0xcb22('0x3f')]['describe']()[_0xcb22('0x14')](respondWithResult(_0x98adbf,null))['catch'](handleError(_0x98adbf,null));};exports['create']=function(_0x4be4eb,_0x3374f2){return db[_0xcb22('0x3f')][_0xcb22('0x49')](_0x4be4eb['body'])[_0xcb22('0x14')](function(_0x4e2f5c){if(_0x4e2f5c){if(_0x4e2f5c[_0xcb22('0x4a')]===_0xcb22('0x4b')&&!_0x4e2f5c[_0xcb22('0x4c')]){var _0x5b32e1,_0x101913,_0x565d2b;if(_0x4be4eb[_0xcb22('0x45')]['to']){_0x101913=_0x4be4eb[_0xcb22('0x45')]['to'][_0xcb22('0x4d')](',')[0x0];}return db['MailAccount'][_0xcb22('0x4e')]({'where':{'id':_0x4e2f5c[_0xcb22('0x4f')]},'include':[{'model':db[_0xcb22('0x50')],'as':_0xcb22('0x51'),'include':[{'model':db[_0xcb22('0x52')],'as':'Contacts','where':{'email':_0x101913},'limit':0x1,'order':[[_0xcb22('0x53'),_0xcb22('0x54')]]}]},{'model':db[_0xcb22('0x55')],'as':_0xcb22('0x56'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xcb22('0x57'),'raw':!![]}]}]})[_0xcb22('0x14')](function(_0x383e5c){_0x5b32e1=_0x383e5c;if(!_0x5b32e1||!_0x5b32e1['Smtp'])return;var _0x113bb1=_0x5b32e1[_0xcb22('0x58')]();if(_0x4be4eb['body'][_0xcb22('0x59')]&&_0x4be4eb[_0xcb22('0x45')][_0xcb22('0x59')][_0xcb22('0x37')]){for(var _0x9debe2=0x0;_0x9debe2<_0x4be4eb[_0xcb22('0x45')][_0xcb22('0x59')][_0xcb22('0x37')];_0x9debe2+=0x1){_0x4be4eb[_0xcb22('0x45')]['attachments'][_0x9debe2]={'filename':_0x4be4eb['body'][_0xcb22('0x59')][_0x9debe2][_0xcb22('0x28')],'path':path[_0xcb22('0x5a')](config['root'],_0xcb22('0x5b'),_0x4be4eb[_0xcb22('0x45')]['attachments'][_0x9debe2][_0xcb22('0x5c')])};}}_0x565d2b={'account':_0x113bb1,'message':_0x4be4eb['body']};return;})[_0xcb22('0x14')](function(){if(_0x5b32e1[_0xcb22('0x51')]){if(_0x5b32e1[_0xcb22('0x51')]['Contacts'][_0xcb22('0x37')]){return _0x5b32e1['List'][_0xcb22('0x5d')][0x0];}else{return db[_0xcb22('0x52')][_0xcb22('0x49')](_['defaults'](_0x4be4eb[_0xcb22('0x45')],{'firstName':_0x4be4eb[_0xcb22('0x45')]['to'],'email':_0x4be4eb['body']['to'],'phone':_0x4be4eb['body']['to'],'ListId':_0x5b32e1[_0xcb22('0x5e')]}));}}else{throw new Error(_0xcb22('0x5f'));}})[_0xcb22('0x14')](function(){if(_0x565d2b){return respondWithRpcPromise(_0xcb22('0x60'),_0xcb22('0x61'),_0x565d2b,client9003)['then'](function(_0x31043d){return _0x4e2f5c[_0xcb22('0x24')]({'read':!![],'messageId':_0x31043d[_0xcb22('0x62')],'sentAt':moment()['format'](_0xcb22('0x63'))});})['catch'](function(_0x273449){logger[_0xcb22('0x18')]('%s',JSON[_0xcb22('0x64')](_0x273449));return _0x4e2f5c;});}return _0x4e2f5c;});}return _0x4e2f5c;}})['then'](respondWithResult(_0x3374f2,0xc9))['catch'](handleError(_0x3374f2,null));};exports[_0xcb22('0x65')]=function(_0x57fc40,_0x318b99){var _0xd77ee7={'agent':{},'channel':_0xcb22('0x66')};if(_0x57fc40[_0xcb22('0x45')]['id']){delete _0x57fc40[_0xcb22('0x45')]['id'];}_0x57fc40[_0xcb22('0x45')][_0xcb22('0x67')]=!![];_0x57fc40[_0xcb22('0x45')][_0xcb22('0x68')]=moment()['format'](_0xcb22('0x63'));_0x57fc40[_0xcb22('0x45')]['UserId']=_0x57fc40[_0xcb22('0x45')]['UserId']||_0x57fc40[_0xcb22('0x69')]['id'];_0xd77ee7['agent']['id']=_0x57fc40[_0xcb22('0x45')]['UserId'];return db['MailMessage'][_0xcb22('0x46')]({'where':{'id':_0x57fc40['params']['id'],'UserId':null}})[_0xcb22('0x14')](handleEntityNotFound(_0x318b99,null))[_0xcb22('0x14')](saveUpdates(_0x57fc40[_0xcb22('0x45')],null))['then'](function(_0x3de707){if(_0x3de707){_0xd77ee7[_0xcb22('0x19')]=_0x3de707['get']({'plain':!![]});return db[_0xcb22('0x6a')][_0xcb22('0x46')]({'where':{'id':_0x3de707[_0xcb22('0x6b')]}});}return null;})[_0xcb22('0x14')](handleEntityNotFound(_0x318b99,null))[_0xcb22('0x14')](function(_0x2b569a){if(_0x2b569a){return _0x2b569a['update']({'UserId':_0x57fc40[_0xcb22('0x45')][_0xcb22('0x6c')],'read1stAt':_[_0xcb22('0x6d')](_0x2b569a[_0xcb22('0x6e')])?moment()[_0xcb22('0x6f')](_0xcb22('0x63')):undefined});}return null;})['then'](function(_0x4bc21b){if(_0x4bc21b){_0xd77ee7[_0xcb22('0x70')]=_0x4bc21b['get']({'plain':!![]});interaction_log[_0xcb22('0x71')](_0xcb22('0x72'),_0x57fc40[_0xcb22('0x69')]['id'],_0x57fc40['user'][_0xcb22('0x28')],_0x57fc40[_0xcb22('0x69')]['role'],_0xd77ee7[_0xcb22('0x70')]['id'],_0x57fc40['body']?JSON[_0xcb22('0x64')](_0x57fc40[_0xcb22('0x45')]):_0xcb22('0x73'));return respondWithRpcPromise(_0xcb22('0x74'),_0xcb22('0x75'),_0xd77ee7);}return null;})['then'](function(_0x32f47f){var _0x3f6bac='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x32f47f[_0xcb22('0x19')]['ContactId'];return db[_0xcb22('0x76')][_0xcb22('0x30')](_0x3f6bac,{'type':db[_0xcb22('0x77')][_0xcb22('0x78')][_0xcb22('0x79')],'raw':!![]})['then'](function(_0x56aeb9){return _0x56aeb9;});})[_0xcb22('0x14')](function(_0x2e0e0a){if(_0x2e0e0a){_0xd77ee7['message'][_0xcb22('0x7a')]=_0x2e0e0a[0x0];if(!_0x57fc40[_0xcb22('0x45')][_0xcb22('0x6c')])return;return db['User']['find']({'where':{'id':_0x57fc40['body'][_0xcb22('0x6c')],'role':'agent'},'attributes':['id','name','fullname',_0xcb22('0x7b'),'internal'],'raw':!![]});}return null;})['then'](function(_0xf307f3){if(!_0xf307f3)return null;_0xd77ee7['message']['agent']=_0xf307f3;return _0xd77ee7;})[_0xcb22('0x14')](function(_0x15d6a8){if(_0x15d6a8){if(_0x57fc40['body'][_0xcb22('0x7c')]){_0xd77ee7[_0xcb22('0x19')][_0xcb22('0x7d')]=util[_0xcb22('0x6f')](_0xcb22('0x7e'),_0x57fc40[_0xcb22('0x69')][_0xcb22('0x28')]);_0xd77ee7[_0xcb22('0x19')][_0xcb22('0x7f')]=_0xd77ee7['channel'];_0xd77ee7[_0xcb22('0x19')][_0xcb22('0x80')]=_0xd77ee7[_0xcb22('0x7f')];_0xd77ee7[_0xcb22('0x19')][_0xcb22('0x81')]=_0xcb22('0x65');_0xd77ee7[_0xcb22('0x19')][_0xcb22('0x45')]=htmlToText[_0xcb22('0x82')](_0xd77ee7['message']['body']);return respondWithRpcPromise(_0xcb22('0x83'),'EventManager',{'event':_0xcb22('0x84'),'message':_0xd77ee7['message']},client9002)['then'](function(){return _0xd77ee7;});}return _0xd77ee7;}return null;})[_0xcb22('0x14')](respondWithResult(_0x318b99,null))[_0xcb22('0x1b')](handleError(_0x318b99,null));};exports[_0xcb22('0x85')]=function(_0x48e8d0,_0x4808e3){var _0x1cbc33={'agent':{},'channel':_0xcb22('0x66')};if(_0x48e8d0[_0xcb22('0x45')]['id']){delete _0x48e8d0[_0xcb22('0x45')]['id'];}_0x48e8d0['body']['UserId']=_0x48e8d0[_0xcb22('0x45')]['UserId']||_0x48e8d0[_0xcb22('0x69')]['id'];_0x1cbc33[_0xcb22('0x86')]['id']=_0x48e8d0[_0xcb22('0x45')][_0xcb22('0x6c')];return db[_0xcb22('0x3f')][_0xcb22('0x46')]({'where':{'id':_0x48e8d0[_0xcb22('0x47')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4808e3,null))[_0xcb22('0x14')](function(_0x5177fc){if(_0x5177fc){_0x1cbc33[_0xcb22('0x19')]=_0x5177fc[_0xcb22('0x87')]({'plain':!![]});return db[_0xcb22('0x6a')][_0xcb22('0x46')]({'where':{'id':_0x5177fc['MailInteractionId']}});}return null;})[_0xcb22('0x14')](handleEntityNotFound(_0x4808e3,null))[_0xcb22('0x14')](function(_0x4fa93e){if(_0x4fa93e){_0x1cbc33[_0xcb22('0x70')]=_0x4fa93e[_0xcb22('0x87')]({'plain':!![]});interaction_log[_0xcb22('0x71')](_0xcb22('0x88'),_0x48e8d0[_0xcb22('0x69')]['id'],_0x48e8d0[_0xcb22('0x69')][_0xcb22('0x28')],_0x48e8d0[_0xcb22('0x69')][_0xcb22('0x89')],_0x1cbc33['interaction']['id'],_0x48e8d0[_0xcb22('0x45')]?JSON['stringify'](_0x48e8d0[_0xcb22('0x45')]):_0xcb22('0x73'));return respondWithRpcPromise(_0xcb22('0x8a'),_0xcb22('0x8b'),_0x1cbc33);}return null;})['then'](function(_0x4a8471){var _0x4306fe='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4a8471[_0xcb22('0x19')][_0xcb22('0x8c')];return db[_0xcb22('0x76')][_0xcb22('0x30')](_0x4306fe,{'type':db[_0xcb22('0x77')][_0xcb22('0x78')][_0xcb22('0x79')],'raw':!![]})[_0xcb22('0x14')](function(_0x248cca){return _0x248cca;});})[_0xcb22('0x14')](function(_0x4b5f20){if(_0x4b5f20){_0x1cbc33['message'][_0xcb22('0x7a')]=_0x4b5f20[0x0];if(!_0x48e8d0['body']['UserId'])return;return db[_0xcb22('0x8d')][_0xcb22('0x46')]({'where':{'id':_0x48e8d0[_0xcb22('0x45')]['UserId'],'role':'agent'},'attributes':['id','name',_0xcb22('0x8e'),'email',_0xcb22('0x8f')],'raw':!![]});}return null;})[_0xcb22('0x14')](function(_0x8ad3bf){if(!_0x8ad3bf)return null;_0x1cbc33[_0xcb22('0x19')][_0xcb22('0x86')]=_0x8ad3bf;return _0x1cbc33;})[_0xcb22('0x14')](function(_0xecaad9){if(_0xecaad9){_0xecaad9['message'][_0xcb22('0x7d')]=util['format'](_0xcb22('0x7e'),_0x48e8d0[_0xcb22('0x69')][_0xcb22('0x28')]);_0xecaad9[_0xcb22('0x19')]['channel']=_0x1cbc33[_0xcb22('0x7f')];_0xecaad9[_0xcb22('0x19')][_0xcb22('0x80')]=_0x1cbc33[_0xcb22('0x7f')];_0xecaad9[_0xcb22('0x19')]['event']=_0xcb22('0x85');_0xecaad9[_0xcb22('0x19')][_0xcb22('0x45')]=htmlToText[_0xcb22('0x82')](_0x1cbc33[_0xcb22('0x19')]['body']);respondWithRpcPromise(_0xcb22('0x83'),_0xcb22('0x83'),{'event':_0xcb22('0x90'),'message':_0xecaad9[_0xcb22('0x19')]},client9002);return _0x1cbc33;}return null;})[_0xcb22('0x14')](respondWithResult(_0x4808e3,null))[_0xcb22('0x1b')](handleError(_0x4808e3,null));};exports['download']=function(_0x5de2f8,_0x2f02c7){var _0x429abf=moment()[_0xcb22('0x91')]()[_0xcb22('0x92')]();var _0x251b4a=path[_0xcb22('0x5a')](config[_0xcb22('0x93')],'server',_0xcb22('0x94'),_0xcb22('0x95'));var _0x477c11=path[_0xcb22('0x5a')](config['root'],_0xcb22('0x96'),'files',_0xcb22('0x59'));var _0x538aca=util['format'](_0xcb22('0x97'),_0x429abf);return db[_0xcb22('0x3f')][_0xcb22('0x46')]({'where':{'id':_0x5de2f8[_0xcb22('0x47')]['id']},'attributes':['id','body',_0xcb22('0x98'),'to','cc','bcc',_0xcb22('0x99'),_0xcb22('0x9a')],'include':_0x5de2f8[_0xcb22('0x30')][_0xcb22('0x59')]?[{'model':db[_0xcb22('0x9b')],'as':_0xcb22('0x9c')}]:undefined})['then'](handleEntityNotFound(_0x2f02c7,null))['then'](function(_0x162001){if(_0x162001){var _0x3f76f9=_0x162001;var _0x1f110d={'from':_0x3f76f9[_0xcb22('0x98')],'to':_0x3f76f9['to'],'subject':_0x3f76f9[_0xcb22('0x99')],'html':htmlEntities[_0xcb22('0x9d')](_0x3f76f9['body']),'headers':{'Date':moment(_0x3f76f9['createdAt'])[_0xcb22('0x6f')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x162001['cc']){_0x1f110d['headers']['Cc']=_0x162001['cc'];}if(_0x162001[_0xcb22('0x9e')]){_0x1f110d[_0xcb22('0x9f')][_0xcb22('0xa0')]=_0x162001[_0xcb22('0x9e')];}return new BPromise(function(_0x350034,_0x342e7f){if(_0x162001[_0xcb22('0x9c')]){for(var _0x4421f5=0x0;_0x4421f5<_0x162001[_0xcb22('0x9c')]['length'];_0x4421f5++){var _0xef3d1f=_0x162001[_0xcb22('0x9c')][_0x4421f5];var _0x19964d=path[_0xcb22('0x5a')](_0x477c11,_0xef3d1f[_0xcb22('0x5c')]);if(fs[_0xcb22('0xa1')](_0x19964d)){_0x1f110d['attachments'][_0xcb22('0xa2')]({'name':_0xef3d1f['name'],'contentType':_0xef3d1f['type'],'data':fs[_0xcb22('0xa3')](_0x19964d)});}}}emlformat[_0xcb22('0xa4')](_0x1f110d,function(_0xe7b568,_0x28ba1a){if(_0xe7b568)return _0x342e7f(_0xe7b568);fs['writeFileSync'](path['join'](_0x251b4a,_0x538aca),_0x28ba1a);return _0x350034(_0x28ba1a);});});}})[_0xcb22('0x14')](function(_0x7b188d){if(_0x7b188d){return _0x2f02c7[_0xcb22('0xa5')](path['join'](_0x251b4a,_0x538aca),_0x538aca,function(_0x8e8a1){if(!_0x8e8a1)fs[_0xcb22('0xa6')](path['join'](_0x251b4a,_0x538aca));});}})[_0xcb22('0x1b')](handleError(_0x2f02c7,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 79fe0d8..917e549 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 _0xa896=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','save','update','remove'];(function(_0x43186d,_0x4b40ec){var _0x5f562c=function(_0x18ed7e){while(--_0x18ed7e){_0x43186d['push'](_0x43186d['shift']());}};_0x5f562c(++_0x4b40ec);}(_0xa896,0x159));var _0x6a89=function(_0x212da9,_0x25cb05){_0x212da9=_0x212da9-0x0;var _0x1c6114=_0xa896[_0x212da9];return _0x1c6114;};'use strict';var EventEmitter=require(_0x6a89('0x0'));var MailMessage=require(_0x6a89('0x1'))['db'][_0x6a89('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x6a89('0x3')](0x0);var events={'afterCreate':_0x6a89('0x4'),'afterUpdate':_0x6a89('0x5'),'afterDestroy':_0x6a89('0x6')};function emitEvent(_0x4da9e1){return function(_0x3b60fb,_0x5986e5,_0x5ba359){MailMessageEvents[_0x6a89('0x7')](_0x4da9e1+':'+_0x3b60fb['id'],_0x3b60fb);MailMessageEvents[_0x6a89('0x7')](_0x4da9e1,_0x3b60fb);_0x5ba359(null);};}for(var e in events){if(events[_0x6a89('0x8')](e)){var event=events[e];MailMessage[_0x6a89('0x9')](e,emitEvent(event));}}module[_0x6a89('0xa')]=MailMessageEvents; \ No newline at end of file +var _0xd254=['events','../../mysqldb','MailMessage','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x494a77,_0x208509){var _0x7f10d6=function(_0x1efaec){while(--_0x1efaec){_0x494a77['push'](_0x494a77['shift']());}};_0x7f10d6(++_0x208509);}(_0xd254,0xf3));var _0x4d25=function(_0x10121a,_0x2efbc6){_0x10121a=_0x10121a-0x0;var _0x7e498f=_0xd254[_0x10121a];return _0x7e498f;};'use strict';var EventEmitter=require(_0x4d25('0x0'));var MailMessage=require(_0x4d25('0x1'))['db'][_0x4d25('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4d25('0x3'),'afterUpdate':'update','afterDestroy':_0x4d25('0x4')};function emitEvent(_0x1fd347){return function(_0x2b5668,_0x199eae,_0x4b8df7){MailMessageEvents[_0x4d25('0x5')](_0x1fd347+':'+_0x2b5668['id'],_0x2b5668);MailMessageEvents['emit'](_0x1fd347,_0x2b5668);_0x4b8df7(null);};}for(var e in events){if(events[_0x4d25('0x6')](e)){var event=events[e];MailMessage[_0x4d25('0x7')](e,emitEvent(event));}}module[_0x4d25('0x8')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 339ea31..2bae938 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 _0x050f=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','direction','toLowerCase','secret','isNil','UserId','MailInteraction','findOne','update','catch','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x050f,0x18e));var _0xf050=function(_0x4b2789,_0x43618f){_0x4b2789=_0x4b2789-0x0;var _0x4683ce=_0x050f[_0x4b2789];return _0x4683ce;};'use strict';var _=require(_0xf050('0x0'));var util=require(_0xf050('0x1'));var logger=require(_0xf050('0x2'))('api');var moment=require(_0xf050('0x3'));var BPromise=require('bluebird');var rp=require(_0xf050('0x4'));var htmlToText=require(_0xf050('0x5'));var fs=require('fs');var path=require(_0xf050('0x6'));var rimraf=require(_0xf050('0x7'));var config=require(_0xf050('0x8'));var attributes=require(_0xf050('0x9'));module['exports']=function(_0x3c0aef,_0x172155){return _0x3c0aef[_0xf050('0xa')](_0xf050('0xb'),attributes,{'tableName':_0xf050('0xc'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xf050('0xd')]},{'name':_0xf050('0xe'),'fields':[_0xf050('0xf'),_0xf050('0x10')],'type':_0xf050('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1a1b9b,_0x11aa19,_0x4e8650){if(_0x1a1b9b[_0xf050('0x12')]){_0x1a1b9b[_0xf050('0xf')]=htmlToText[_0xf050('0x13')](_0x1a1b9b[_0xf050('0x12')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x4e8650(null,_0x11aa19);},'afterCreate':function(_0x313c3f,_0x1547bb,_0x208112){var _0x503302=_0x3c0aef[_0xf050('0x14')];var _0x57d864=_0x313c3f['get']({'plain':!![]});if(_0x57d864[_0xf050('0x15')][_0xf050('0x16')]()==='in'||_0x57d864['direction'][_0xf050('0x16')]()==='out'&&!_0x57d864[_0xf050('0x17')]&&!_[_0xf050('0x18')](_0x57d864[_0xf050('0x19')])){_0x503302[_0xf050('0x1a')][_0xf050('0x1b')]({'where':{'id':_0x57d864['MailInteractionId']}})['then'](function(_0x1a31b6){if(_0x1a31b6){_0x1a31b6[_0xf050('0x1c')]({'lastMsgAt':_0x57d864['createdAt'],'lastMsgDirection':_0x57d864[_0xf050('0x15')][_0xf050('0x16')]()});}})[_0xf050('0x1d')](function(_0x5e00c9){console[_0xf050('0x1e')](_0x5e00c9);});}_0x208112();}},'charset':_0xf050('0x1f'),'collate':_0xf050('0x20')});}; \ No newline at end of file +var _0x82ee=['mail_messages','messageId','fti_mail_messages','plainBody','FULLTEXT','body','fromString','models','get','toLowerCase','direction','out','secret','isNil','UserId','MailInteraction','MailInteractionId','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','html-to-text','path','../../config/environment','exports','define','MailMessage'];(function(_0x40aeac,_0x453398){var _0x245a28=function(_0x3f4c24){while(--_0x3f4c24){_0x40aeac['push'](_0x40aeac['shift']());}};_0x245a28(++_0x453398);}(_0x82ee,0x1f2));var _0xe82e=function(_0x1b15ee,_0x15ae7c){_0x1b15ee=_0x1b15ee-0x0;var _0x4fad1f=_0x82ee[_0x1b15ee];return _0x4fad1f;};'use strict';var _=require(_0xe82e('0x0'));var util=require(_0xe82e('0x1'));var logger=require(_0xe82e('0x2'))('api');var moment=require(_0xe82e('0x3'));var BPromise=require(_0xe82e('0x4'));var rp=require(_0xe82e('0x5'));var htmlToText=require(_0xe82e('0x6'));var fs=require('fs');var path=require(_0xe82e('0x7'));var rimraf=require('rimraf');var config=require(_0xe82e('0x8'));var attributes=require('./mailMessage.attributes');module[_0xe82e('0x9')]=function(_0x4ce1e8,_0x3254e8){return _0x4ce1e8[_0xe82e('0xa')](_0xe82e('0xb'),attributes,{'tableName':_0xe82e('0xc'),'paranoid':![],'indexes':[{'name':_0xe82e('0xd'),'fields':[_0xe82e('0xd')]},{'name':_0xe82e('0xe'),'fields':[_0xe82e('0xf'),'subject'],'type':_0xe82e('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x491bab,_0xfdf316,_0x3f0316){if(_0x491bab[_0xe82e('0x11')]){_0x491bab[_0xe82e('0xf')]=htmlToText[_0xe82e('0x12')](_0x491bab['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x3f0316(null,_0xfdf316);},'afterCreate':function(_0x3e35dc,_0x37b22d,_0x22cdf6){var _0x54af99=_0x4ce1e8[_0xe82e('0x13')];var _0x589c9e=_0x3e35dc[_0xe82e('0x14')]({'plain':!![]});if(_0x589c9e['direction'][_0xe82e('0x15')]()==='in'||_0x589c9e[_0xe82e('0x16')][_0xe82e('0x15')]()===_0xe82e('0x17')&&!_0x589c9e[_0xe82e('0x18')]&&!_[_0xe82e('0x19')](_0x589c9e[_0xe82e('0x1a')])){_0x54af99[_0xe82e('0x1b')]['findOne']({'where':{'id':_0x589c9e[_0xe82e('0x1c')]}})['then'](function(_0xc5ab23){if(_0xc5ab23){_0xc5ab23['update']({'lastMsgAt':_0x589c9e[_0xe82e('0x1d')],'lastMsgDirection':_0x589c9e[_0xe82e('0x16')]['toLowerCase']()});}})[_0xe82e('0x1e')](function(_0x207018){console[_0xe82e('0x1f')](_0x207018);});}_0x22cdf6();}},'charset':_0xe82e('0x20'),'collate':_0xe82e('0x21')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 5db5874..992958f 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 _0x9f0e=['MailMessage,\x20%s,\x20%s','message','result','catch','CreateMailMessage','MailMessage','create','raw','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./mailMessage.socket','register','then','info','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x25304f,_0x15e225){var _0x2da7ec=function(_0x2b3855){while(--_0x2b3855){_0x25304f['push'](_0x25304f['shift']());}};_0x2da7ec(++_0x15e225);}(_0x9f0e,0x116));var _0xe9f0=function(_0x370500,_0x1e3731){_0x370500=_0x370500-0x0;var _0xa02b2f=_0x9f0e[_0x370500];return _0xa02b2f;};'use strict';var _=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var moment=require(_0xe9f0('0x2'));var BPromise=require(_0xe9f0('0x3'));var rs=require(_0xe9f0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe9f0('0x5'));var logger=require(_0xe9f0('0x6'))(_0xe9f0('0x7'));var config=require(_0xe9f0('0x8'));var jayson=require(_0xe9f0('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xe9f0('0xa')]=_[_0xe9f0('0xb')](config[_0xe9f0('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xe9f0('0xc'))(new Redis(config[_0xe9f0('0xa')]));require(_0xe9f0('0xd'))[_0xe9f0('0xe')](socket);function respondWithRpcPromise(_0xa523c0,_0x240932,_0x807322){return new BPromise(function(_0x3724f4,_0x6acfb){return client['request'](_0xa523c0,_0x807322)[_0xe9f0('0xf')](function(_0x329ecd){logger[_0xe9f0('0x10')]('MailMessage,\x20%s,\x20%s',_0x240932,_0xe9f0('0x11'));logger['debug'](_0xe9f0('0x12'),_0x240932,_0xe9f0('0x11'),JSON[_0xe9f0('0x13')](_0x329ecd));if(_0x329ecd[_0xe9f0('0x14')]){if(_0x329ecd['error'][_0xe9f0('0x15')]===0x1f4){logger['error'](_0xe9f0('0x16'),_0x240932,_0x329ecd[_0xe9f0('0x14')][_0xe9f0('0x17')]);return _0x6acfb(_0x329ecd['error'][_0xe9f0('0x17')]);}logger[_0xe9f0('0x14')](_0xe9f0('0x16'),_0x240932,_0x329ecd['error'][_0xe9f0('0x17')]);return _0x3724f4(_0x329ecd[_0xe9f0('0x14')][_0xe9f0('0x17')]);}else{logger[_0xe9f0('0x10')](_0xe9f0('0x16'),_0x240932,_0xe9f0('0x11'));_0x3724f4(_0x329ecd[_0xe9f0('0x18')]['message']);}})[_0xe9f0('0x19')](function(_0x19e090){logger[_0xe9f0('0x14')]('MailMessage,\x20%s,\x20%s',_0x240932,_0x19e090);_0x6acfb(_0x19e090);});});}exports[_0xe9f0('0x1a')]=function(_0x30b8c7){var _0x1698cf=this;return new Promise(function(_0x43f399,_0x5ba788){return db[_0xe9f0('0x1b')][_0xe9f0('0x1c')](_0x30b8c7['body'],{'raw':_0x30b8c7['options']?_0x30b8c7['options'][_0xe9f0('0x1d')]===undefined?!![]:![]:!![]})[_0xe9f0('0xf')](function(_0x1211ae){logger[_0xe9f0('0x10')](_0xe9f0('0x1a'),_0x30b8c7);logger['debug'](_0xe9f0('0x1a'),_0x30b8c7,JSON[_0xe9f0('0x13')](_0x1211ae));_0x43f399(_0x1211ae);})[_0xe9f0('0x19')](function(_0x10801b){logger[_0xe9f0('0x14')](_0xe9f0('0x1a'),_0x10801b[_0xe9f0('0x17')],_0x30b8c7);_0x5ba788(_0x1698cf[_0xe9f0('0x14')](0x1f4,_0x10801b[_0xe9f0('0x17')]));});});}; \ No newline at end of file +var _0xd914=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateMailMessage','MailMessage','create','body','options','raw','stringify','lodash'];(function(_0x2b31a8,_0x28b862){var _0x1175a5=function(_0x2cdb5d){while(--_0x2cdb5d){_0x2b31a8['push'](_0x2b31a8['shift']());}};_0x1175a5(++_0x28b862);}(_0xd914,0x17f));var _0x4d91=function(_0x25bca6,_0xe415ea){_0x25bca6=_0x25bca6-0x0;var _0x3f8d02=_0xd914[_0x25bca6];return _0x3f8d02;};'use strict';var _=require(_0x4d91('0x0'));var util=require(_0x4d91('0x1'));var moment=require('moment');var BPromise=require(_0x4d91('0x2'));var rs=require(_0x4d91('0x3'));var fs=require('fs');var Redis=require(_0x4d91('0x4'));var db=require(_0x4d91('0x5'))['db'];var utils=require(_0x4d91('0x6'));var logger=require(_0x4d91('0x7'))('rpc');var config=require(_0x4d91('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4d91('0x9')][_0x4d91('0xa')]({'port':0x232a});config[_0x4d91('0xb')]=_[_0x4d91('0xc')](config[_0x4d91('0xb')],{'host':_0x4d91('0xd'),'port':0x18eb});var socket=require(_0x4d91('0xe'))(new Redis(config[_0x4d91('0xb')]));require('./mailMessage.socket')[_0x4d91('0xf')](socket);function respondWithRpcPromise(_0xa4bb25,_0xc07c64,_0x278648){return new BPromise(function(_0xb234d2,_0x266b31){return client['request'](_0xa4bb25,_0x278648)['then'](function(_0x2ccd08){logger[_0x4d91('0x10')](_0x4d91('0x11'),_0xc07c64,_0x4d91('0x12'));logger[_0x4d91('0x13')](_0x4d91('0x14'),_0xc07c64,'request\x20sent',JSON['stringify'](_0x2ccd08));if(_0x2ccd08[_0x4d91('0x15')]){if(_0x2ccd08[_0x4d91('0x15')][_0x4d91('0x16')]===0x1f4){logger[_0x4d91('0x15')](_0x4d91('0x11'),_0xc07c64,_0x2ccd08[_0x4d91('0x15')][_0x4d91('0x17')]);return _0x266b31(_0x2ccd08['error'][_0x4d91('0x17')]);}logger[_0x4d91('0x15')](_0x4d91('0x11'),_0xc07c64,_0x2ccd08[_0x4d91('0x15')][_0x4d91('0x17')]);return _0xb234d2(_0x2ccd08['error'][_0x4d91('0x17')]);}else{logger[_0x4d91('0x10')](_0x4d91('0x11'),_0xc07c64,_0x4d91('0x12'));_0xb234d2(_0x2ccd08['result'][_0x4d91('0x17')]);}})[_0x4d91('0x18')](function(_0x13254c){logger['error'](_0x4d91('0x11'),_0xc07c64,_0x13254c);_0x266b31(_0x13254c);});});}exports[_0x4d91('0x19')]=function(_0x351388){var _0xd59fe=this;return new Promise(function(_0x10b767,_0x40cde4){return db[_0x4d91('0x1a')][_0x4d91('0x1b')](_0x351388[_0x4d91('0x1c')],{'raw':_0x351388[_0x4d91('0x1d')]?_0x351388['options'][_0x4d91('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x57913e){logger[_0x4d91('0x10')](_0x4d91('0x19'),_0x351388);logger[_0x4d91('0x13')](_0x4d91('0x19'),_0x351388,JSON[_0x4d91('0x1f')](_0x57913e));_0x10b767(_0x57913e);})[_0x4d91('0x18')](function(_0x100cd4){logger[_0x4d91('0x15')]('CreateMailMessage',_0x100cd4['message'],_0x351388);_0x40cde4(_0xd59fe[_0x4d91('0x15')](0x1f4,_0x100cd4[_0x4d91('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index e652822..a0e90d7 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 _0x1829=['removeListener','register','length','mailMessage:','update','emit'];(function(_0x3c4154,_0x425d67){var _0x2c113b=function(_0x4f6b5a){while(--_0x4f6b5a){_0x3c4154['push'](_0x3c4154['shift']());}};_0x2c113b(++_0x425d67);}(_0x1829,0x13c));var _0x9182=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x1829[_0x82129b];return _0x2ae5dc;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=['save','remove',_0x9182('0x0')];function createListener(_0x716dd3,_0x11e9b6){return function(_0x107b90){_0x11e9b6[_0x9182('0x1')](_0x716dd3,_0x107b90);};}function removeListener(_0x21729b,_0x56706a){return function(){MailMessageEvents[_0x9182('0x2')](_0x21729b,_0x56706a);};}exports[_0x9182('0x3')]=function(_0x4a99e4){for(var _0x5b4aac=0x0,_0x21e0c2=events[_0x9182('0x4')];_0x5b4aac<_0x21e0c2;_0x5b4aac++){var _0x14320d=events[_0x5b4aac];var _0x4303ba=createListener(_0x9182('0x5')+_0x14320d,_0x4a99e4);MailMessageEvents['on'](_0x14320d,_0x4303ba);}}; \ No newline at end of file +var _0x2c2b=['mailMessage:','save','remove','update','register','length'];(function(_0x2cd68f,_0x1b0f87){var _0x5ae1d0=function(_0x5ec301){while(--_0x5ec301){_0x2cd68f['push'](_0x2cd68f['shift']());}};_0x5ae1d0(++_0x1b0f87);}(_0x2c2b,0x1b1));var _0xb2c2=function(_0x1f736e,_0x23a84d){_0x1f736e=_0x1f736e-0x0;var _0x5760f1=_0x2c2b[_0x1f736e];return _0x5760f1;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0xb2c2('0x0'),_0xb2c2('0x1'),_0xb2c2('0x2')];function createListener(_0x520671,_0x4f819f){return function(_0xf25a8f){_0x4f819f['emit'](_0x520671,_0xf25a8f);};}function removeListener(_0x29cf5a,_0x5df72c){return function(){MailMessageEvents['removeListener'](_0x29cf5a,_0x5df72c);};}exports[_0xb2c2('0x3')]=function(_0x103254){for(var _0x5d42f4=0x0,_0x303403=events[_0xb2c2('0x4')];_0x5d42f4<_0x303403;_0x5d42f4++){var _0x1694a9=events[_0x5d42f4];var _0x4164a1=createListener(_0xb2c2('0x5')+_0x1694a9,_0x103254);MailMessageEvents['on'](_0x1694a9,_0x4164a1);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 41ef24f..8adba88 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 _0x82e1=['describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','/:id/teams','addTeams','addAgents','update','delete','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','/describe'];(function(_0x21ed54,_0x19f4b3){var _0x18ca9e=function(_0x20f5a2){while(--_0x20f5a2){_0x21ed54['push'](_0x21ed54['shift']());}};_0x18ca9e(++_0x19f4b3);}(_0x82e1,0x9c));var _0x182e=function(_0x3b1d1e,_0x10d8d9){_0x3b1d1e=_0x3b1d1e-0x0;var _0x5670b7=_0x82e1[_0x3b1d1e];return _0x5670b7;};'use strict';var multer=require(_0x182e('0x0'));var util=require(_0x182e('0x1'));var path=require(_0x182e('0x2'));var timeout=require('connect-timeout');var express=require(_0x182e('0x3'));var router=express[_0x182e('0x4')]();var fs_extra=require(_0x182e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x182e('0x6'));var config=require(_0x182e('0x7'));var controller=require(_0x182e('0x8'));router[_0x182e('0x9')]('/',auth[_0x182e('0xa')](),controller['index']);router[_0x182e('0x9')](_0x182e('0xb'),auth[_0x182e('0xa')](),controller[_0x182e('0xc')]);router['get'](_0x182e('0xd'),auth['isAuthenticated'](),controller[_0x182e('0xe')]);router[_0x182e('0x9')](_0x182e('0xf'),auth[_0x182e('0xa')](),controller[_0x182e('0x10')]);router[_0x182e('0x9')]('/:id/teams',auth[_0x182e('0xa')](),controller[_0x182e('0x11')]);router[_0x182e('0x9')](_0x182e('0x12'),auth[_0x182e('0xa')](),controller[_0x182e('0x13')]);router[_0x182e('0x14')]('/',auth[_0x182e('0xa')](),controller['create']);router[_0x182e('0x14')](_0x182e('0x15'),auth[_0x182e('0xa')](),controller[_0x182e('0x16')]);router['post']('/:id/users',auth[_0x182e('0xa')](),controller[_0x182e('0x17')]);router['put'](_0x182e('0xd'),auth[_0x182e('0xa')](),controller[_0x182e('0x18')]);router[_0x182e('0x19')]('/:id',auth[_0x182e('0xa')](),controller['destroy']);router[_0x182e('0x19')](_0x182e('0x15'),auth['isAuthenticated'](),controller['removeTeams']);router['delete'](_0x182e('0x12'),auth['isAuthenticated'](),controller[_0x182e('0x1a')]);module[_0x182e('0x1b')]=router; \ No newline at end of file +var _0x65f3=['create','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post'];(function(_0x2bc3f4,_0x470b26){var _0x14ac53=function(_0x5121bd){while(--_0x5121bd){_0x2bc3f4['push'](_0x2bc3f4['shift']());}};_0x14ac53(++_0x470b26);}(_0x65f3,0x1a9));var _0x365f=function(_0x3f59fb,_0x3e4b01){_0x3f59fb=_0x3f59fb-0x0;var _0x113f31=_0x65f3[_0x3f59fb];return _0x113f31;};'use strict';var multer=require(_0x365f('0x0'));var util=require(_0x365f('0x1'));var path=require('path');var timeout=require(_0x365f('0x2'));var express=require(_0x365f('0x3'));var router=express[_0x365f('0x4')]();var fs_extra=require(_0x365f('0x5'));var auth=require(_0x365f('0x6'));var interaction=require(_0x365f('0x7'));var config=require(_0x365f('0x8'));var controller=require(_0x365f('0x9'));router[_0x365f('0xa')]('/',auth[_0x365f('0xb')](),controller[_0x365f('0xc')]);router[_0x365f('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x365f('0xd')]);router['get'](_0x365f('0xe'),auth[_0x365f('0xb')](),controller[_0x365f('0xf')]);router['get'](_0x365f('0x10'),auth['isAuthenticated'](),controller[_0x365f('0x11')]);router[_0x365f('0xa')](_0x365f('0x12'),auth[_0x365f('0xb')](),controller[_0x365f('0x13')]);router['get'](_0x365f('0x14'),auth[_0x365f('0xb')](),controller[_0x365f('0x15')]);router[_0x365f('0x16')]('/',auth[_0x365f('0xb')](),controller[_0x365f('0x17')]);router['post'](_0x365f('0x12'),auth['isAuthenticated'](),controller['addTeams']);router['post'](_0x365f('0x14'),auth[_0x365f('0xb')](),controller[_0x365f('0x18')]);router[_0x365f('0x19')]('/:id',auth[_0x365f('0xb')](),controller[_0x365f('0x1a')]);router[_0x365f('0x1b')](_0x365f('0xe'),auth[_0x365f('0xb')](),controller[_0x365f('0x1c')]);router[_0x365f('0x1b')](_0x365f('0x12'),auth['isAuthenticated'](),controller[_0x365f('0x1d')]);router[_0x365f('0x1b')](_0x365f('0x14'),auth[_0x365f('0xb')](),controller[_0x365f('0x1e')]);module[_0x365f('0x1f')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 80a8758..bad4958 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 _0xf880=['INTEGER','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x4e3e93,_0x17045c){var _0x4d688c=function(_0x3329c7){while(--_0x3329c7){_0x4e3e93['push'](_0x4e3e93['shift']());}};_0x4d688c(++_0x17045c);}(_0xf880,0x1a7));var _0x0f88=function(_0x4d2263,_0x3fbf0d){_0x4d2263=_0x4d2263-0x0;var _0x24aba0=_0xf880[_0x4d2263];return _0x24aba0;};'use strict';var Sequelize=require(_0x0f88('0x0'));module[_0x0f88('0x1')]={'name':{'type':Sequelize[_0x0f88('0x2')],'unique':_0x0f88('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0f88('0x2')]},'timeout':{'type':Sequelize[_0x0f88('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x0f88('0x5'),_0x0f88('0x6'))}}; \ No newline at end of file +var _0x838b=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','INTEGER'];(function(_0x2e57fb,_0x1c3dd8){var _0x4b4fae=function(_0x5d11ac){while(--_0x5d11ac){_0x2e57fb['push'](_0x2e57fb['shift']());}};_0x4b4fae(++_0x1c3dd8);}(_0x838b,0x1a4));var _0xb838=function(_0x150f85,_0x452f99){_0x150f85=_0x150f85-0x0;var _0x52ac4e=_0x838b[_0x150f85];return _0x52ac4e;};'use strict';var Sequelize=require(_0xb838('0x0'));module[_0xb838('0x1')]={'name':{'type':Sequelize[_0xb838('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb838('0x2')]},'timeout':{'type':Sequelize[_0xb838('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb838('0x4')](_0xb838('0x5'),_0xb838('0x6'),_0xb838('0x7'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 74f5b8d..68bc391 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 _0x16d1=['then','destroy','get','MailQueues','UserProfileResource','stack','name','send','index','map','MailQueue','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','hasOwnProperty','MailQueueId','UserMailQueue','User','findAndCountAll','UserId','createdAt','format','%s/%s','SIP','mailPause','updatedAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','TeamId','all','union','compact','value','isEmpty','removeAgents','forEach','userMailQueue:remove','omit','spread','isArray','getAgents','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','socket.io-emitter','./mailQueue.socket','register','sendStatus','end','status','json','undefined','offset','count','limit','set','Content-Range','apply','reject'];(function(_0x38e6c1,_0x4156be){var _0x93db99=function(_0x31c590){while(--_0x31c590){_0x38e6c1['push'](_0x38e6c1['shift']());}};_0x93db99(++_0x4156be);}(_0x16d1,0xf7));var _0x116d=function(_0x1c490a,_0x217f34){_0x1c490a=_0x1c490a-0x0;var _0x1e0b1d=_0x16d1[_0x1c490a];return _0x1e0b1d;};'use strict';var emlformat=require(_0x116d('0x0'));var rimraf=require(_0x116d('0x1'));var zipdir=require(_0x116d('0x2'));var jsonpatch=require(_0x116d('0x3'));var rp=require(_0x116d('0x4'));var moment=require('moment');var BPromise=require(_0x116d('0x5'));var Mustache=require('mustache');var util=require(_0x116d('0x6'));var path=require(_0x116d('0x7'));var sox=require(_0x116d('0x8'));var csv=require('to-csv');var ejs=require(_0x116d('0x9'));var fs=require('fs');var fs_extra=require(_0x116d('0xa'));var _=require(_0x116d('0xb'));var squel=require('squel');var crypto=require(_0x116d('0xc'));var jsforce=require(_0x116d('0xd'));var deskjs=require(_0x116d('0xe'));var toCsv=require(_0x116d('0xf'));var querystring=require(_0x116d('0x10'));var Papa=require(_0x116d('0x11'));var Redis=require(_0x116d('0x12'));var authService=require(_0x116d('0x13'));var qs=require(_0x116d('0x14'));var as=require(_0x116d('0x15'));var hardwareService=require(_0x116d('0x16'));var logger=require(_0x116d('0x17'))(_0x116d('0x18'));var utils=require(_0x116d('0x19'));var config=require(_0x116d('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x116d('0x1b')]=_['defaults'](config[_0x116d('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x116d('0x1c'))(new Redis(config[_0x116d('0x1b')]));require(_0x116d('0x1d'))[_0x116d('0x1e')](socket);function respondWithStatusCode(_0x239502,_0x37fa48){_0x37fa48=_0x37fa48||0xcc;return function(_0x418c92){if(_0x418c92){return _0x239502[_0x116d('0x1f')](_0x37fa48);}return _0x239502['status'](_0x37fa48)[_0x116d('0x20')]();};}function respondWithResult(_0x4d323b,_0x8b519b){_0x8b519b=_0x8b519b||0xc8;return function(_0x476669){if(_0x476669){return _0x4d323b[_0x116d('0x21')](_0x8b519b)[_0x116d('0x22')](_0x476669);}};}function respondWithFilteredResult(_0x503d43,_0x2f05ac){return function(_0x16f75d){if(_0x16f75d){var _0x2bd23b=typeof _0x2f05ac['offset']===_0x116d('0x23')&&typeof _0x2f05ac['limit']===_0x116d('0x23');var _0x4e783d=_0x16f75d['count'];var _0x589bd6=_0x2bd23b?0x0:_0x2f05ac[_0x116d('0x24')];var _0x2008cd=_0x2bd23b?_0x16f75d[_0x116d('0x25')]:_0x2f05ac[_0x116d('0x24')]+_0x2f05ac[_0x116d('0x26')];var _0x5aaf80;if(_0x2008cd>=_0x4e783d){_0x2008cd=_0x4e783d;_0x5aaf80=0xc8;}else{_0x5aaf80=0xce;}_0x503d43[_0x116d('0x21')](_0x5aaf80);return _0x503d43[_0x116d('0x27')](_0x116d('0x28'),_0x589bd6+'-'+_0x2008cd+'/'+_0x4e783d)['json'](_0x16f75d);}return null;};}function patchUpdates(_0x3eef37){return function(_0x306ae0){try{jsonpatch[_0x116d('0x29')](_0x306ae0,_0x3eef37,!![]);}catch(_0x4db1ee){return BPromise[_0x116d('0x2a')](_0x4db1ee);}return _0x306ae0['save']();};}function saveUpdates(_0x4b7268,_0x1a8ad4){return function(_0x59e044){if(_0x59e044){return _0x59e044['update'](_0x4b7268)[_0x116d('0x2b')](function(_0x25b9b9){return _0x25b9b9;});}return null;};}function removeEntity(_0x402dd7,_0x4be644){return function(_0x40d5a6){if(_0x40d5a6){return _0x40d5a6[_0x116d('0x2c')]()['then'](function(){var _0x278ce8=_0x40d5a6[_0x116d('0x2d')]({'plain':!![]});var _0x519588=_0x116d('0x2e');return db[_0x116d('0x2f')][_0x116d('0x2c')]({'where':{'type':_0x519588,'resourceId':_0x278ce8['id']}})[_0x116d('0x2b')](function(){return _0x40d5a6;});})[_0x116d('0x2b')](function(){_0x402dd7['status'](0xcc)[_0x116d('0x20')]();});}};}function handleEntityNotFound(_0x33bb1d,_0xab0cac){return function(_0x5539b9){if(!_0x5539b9){_0x33bb1d['sendStatus'](0x194);}return _0x5539b9;};}function handleError(_0x4f5320,_0x33f835){_0x33f835=_0x33f835||0x1f4;return function(_0x324f3c){logger['error'](_0x324f3c[_0x116d('0x30')]);if(_0x324f3c['name']){delete _0x324f3c[_0x116d('0x31')];}_0x4f5320[_0x116d('0x21')](_0x33f835)[_0x116d('0x32')](_0x324f3c);};}exports[_0x116d('0x33')]=function(_0x2869dd,_0x279f2){var _0xcbc344={},_0x4feb9e={},_0x5d1696={'count':0x0,'rows':[]};var _0x5bdd6b=_[_0x116d('0x34')](db[_0x116d('0x35')]['rawAttributes'],function(_0x42a064){return{'name':_0x42a064[_0x116d('0x36')],'type':_0x42a064[_0x116d('0x37')][_0x116d('0x38')]};});_0x4feb9e[_0x116d('0x39')]=_[_0x116d('0x34')](_0x5bdd6b,_0x116d('0x31'));_0x4feb9e['query']=_[_0x116d('0x3a')](_0x2869dd['query']);_0x4feb9e[_0x116d('0x3b')]=_[_0x116d('0x3c')](_0x4feb9e[_0x116d('0x39')],_0x4feb9e[_0x116d('0x3d')]);_0xcbc344['attributes']=_[_0x116d('0x3c')](_0x4feb9e[_0x116d('0x39')],qs[_0x116d('0x3e')](_0x2869dd['query']['fields']));_0xcbc344[_0x116d('0x3f')]=_0xcbc344[_0x116d('0x3f')][_0x116d('0x40')]?_0xcbc344[_0x116d('0x3f')]:_0x4feb9e[_0x116d('0x39')];if(!_0x2869dd[_0x116d('0x3d')]['hasOwnProperty'](_0x116d('0x41'))){_0xcbc344[_0x116d('0x26')]=qs[_0x116d('0x26')](_0x2869dd[_0x116d('0x3d')][_0x116d('0x26')]);_0xcbc344[_0x116d('0x24')]=qs[_0x116d('0x24')](_0x2869dd[_0x116d('0x3d')][_0x116d('0x24')]);}_0xcbc344[_0x116d('0x42')]=qs['sort'](_0x2869dd[_0x116d('0x3d')][_0x116d('0x43')]);_0xcbc344[_0x116d('0x44')]=qs[_0x116d('0x3b')](_[_0x116d('0x45')](_0x2869dd[_0x116d('0x3d')],_0x4feb9e[_0x116d('0x3b')]),_0x5bdd6b);if(_0x2869dd['query'][_0x116d('0x46')]){_0xcbc344[_0x116d('0x44')]=_[_0x116d('0x47')](_0xcbc344['where'],{'$or':_[_0x116d('0x34')](_0x5bdd6b,function(_0x31938d){if(_0x31938d[_0x116d('0x37')]!=='VIRTUAL'){var _0x474c0a={};_0x474c0a[_0x31938d[_0x116d('0x31')]]={'$like':'%'+_0x2869dd[_0x116d('0x3d')][_0x116d('0x46')]+'%'};return _0x474c0a;}})});}_0xcbc344=_[_0x116d('0x47')]({},_0xcbc344,_0x2869dd[_0x116d('0x48')]);var _0x40ab73={'where':_0xcbc344[_0x116d('0x44')]};return db[_0x116d('0x35')][_0x116d('0x25')](_0x40ab73)[_0x116d('0x2b')](function(_0x4fc6d8){_0x5d1696[_0x116d('0x25')]=_0x4fc6d8;if(_0x2869dd[_0x116d('0x3d')]['includeAll']){_0xcbc344[_0x116d('0x49')]=[{'all':!![]}];}return db[_0x116d('0x35')][_0x116d('0x4a')](_0xcbc344);})['then'](function(_0x50f72e){_0x5d1696[_0x116d('0x4b')]=_0x50f72e;return _0x5d1696;})[_0x116d('0x2b')](respondWithFilteredResult(_0x279f2,_0xcbc344))[_0x116d('0x4c')](handleError(_0x279f2,null));};exports[_0x116d('0x4d')]=function(_0x4c3559,_0x36fcfd){var _0x13c27a={'raw':!![],'where':{'id':_0x4c3559[_0x116d('0x4e')]['id']}},_0x3736de={};_0x3736de['model']=_[_0x116d('0x3a')](db[_0x116d('0x35')][_0x116d('0x4f')]);_0x3736de['query']=_[_0x116d('0x3a')](_0x4c3559[_0x116d('0x3d')]);_0x3736de[_0x116d('0x3b')]=_[_0x116d('0x3c')](_0x3736de[_0x116d('0x39')],_0x3736de[_0x116d('0x3d')]);_0x13c27a[_0x116d('0x3f')]=_[_0x116d('0x3c')](_0x3736de[_0x116d('0x39')],qs[_0x116d('0x3e')](_0x4c3559['query'][_0x116d('0x3e')]));_0x13c27a[_0x116d('0x3f')]=_0x13c27a[_0x116d('0x3f')][_0x116d('0x40')]?_0x13c27a[_0x116d('0x3f')]:_0x3736de[_0x116d('0x39')];if(_0x4c3559[_0x116d('0x3d')][_0x116d('0x50')]){_0x13c27a[_0x116d('0x49')]=[{'all':!![]}];}_0x13c27a=_[_0x116d('0x47')]({},_0x13c27a,_0x4c3559[_0x116d('0x48')]);return db[_0x116d('0x35')][_0x116d('0x51')](_0x13c27a)['then'](handleEntityNotFound(_0x36fcfd,null))[_0x116d('0x2b')](respondWithResult(_0x36fcfd,null))[_0x116d('0x4c')](handleError(_0x36fcfd,null));};exports[_0x116d('0x52')]=function(_0x3a4e48,_0x545022){return db[_0x116d('0x35')][_0x116d('0x52')](_0x3a4e48[_0x116d('0x53')],{})['then'](function(_0x1c2e0c){var _0x2291bb=_0x3a4e48[_0x116d('0x54')][_0x116d('0x2d')]({'plain':!![]});if(!_0x2291bb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2291bb['role']===_0x116d('0x54')){var _0x20ddf3=_0x1c2e0c[_0x116d('0x2d')]({'plain':!![]});var _0x1b7468=_0x116d('0x2e');return db['UserProfileSection'][_0x116d('0x51')]({'where':{'name':_0x1b7468,'userProfileId':_0x2291bb[_0x116d('0x55')]},'raw':!![]})[_0x116d('0x2b')](function(_0x1eba28){if(_0x1eba28&&_0x1eba28[_0x116d('0x56')]===0x0){return db[_0x116d('0x2f')]['create']({'name':_0x20ddf3[_0x116d('0x31')],'resourceId':_0x20ddf3['id'],'type':_0x1eba28[_0x116d('0x31')],'sectionId':_0x1eba28['id']},{})['then'](function(){return _0x1c2e0c;});}else{return _0x1c2e0c;}})[_0x116d('0x4c')](function(_0x517d85){logger[_0x116d('0x57')](_0x116d('0x58'),_0x517d85);throw _0x517d85;});}return _0x1c2e0c;})[_0x116d('0x2b')](respondWithResult(_0x545022,0xc9))[_0x116d('0x4c')](handleError(_0x545022,null));};exports[_0x116d('0x59')]=function(_0x690b94,_0x2a0b13){if(_0x690b94[_0x116d('0x53')]['id']){delete _0x690b94[_0x116d('0x53')]['id'];}return db[_0x116d('0x35')][_0x116d('0x51')]({'where':{'id':_0x690b94['params']['id']}})[_0x116d('0x2b')](handleEntityNotFound(_0x2a0b13,null))['then'](saveUpdates(_0x690b94[_0x116d('0x53')],null))[_0x116d('0x2b')](respondWithResult(_0x2a0b13,null))['catch'](handleError(_0x2a0b13,null));};exports['destroy']=function(_0x27d569,_0x52e6bd){return db['MailQueue'][_0x116d('0x51')]({'where':{'id':_0x27d569[_0x116d('0x4e')]['id']}})[_0x116d('0x2b')](handleEntityNotFound(_0x52e6bd,null))[_0x116d('0x2b')](removeEntity(_0x52e6bd,null))[_0x116d('0x4c')](handleError(_0x52e6bd,null));};exports[_0x116d('0x5a')]=function(_0x1d033d,_0x51f5e0){return db[_0x116d('0x35')][_0x116d('0x5a')]()[_0x116d('0x2b')](respondWithResult(_0x51f5e0,null))[_0x116d('0x4c')](handleError(_0x51f5e0,null));};exports['getMembers']=function(_0x42e880,_0x4fe598,_0x17e139){var _0x16c0db={'raw':!![],'where':{}},_0x413424={},_0x4e3a9a;return db[_0x116d('0x35')]['findOne']({'where':{'id':_0x42e880[_0x116d('0x4e')]['id']}})[_0x116d('0x2b')](handleEntityNotFound(_0x4fe598,null))[_0x116d('0x2b')](function(_0xad15b6){if(_0xad15b6){_0x4e3a9a=_0xad15b6[_0x116d('0x2d')]({'plain':!![]});_0x413424[_0x116d('0x39')]=_[_0x116d('0x3a')](db['UserMailQueue']['rawAttributes']);_0x413424[_0x116d('0x3d')]=_[_0x116d('0x3a')](_0x42e880[_0x116d('0x3d')]);_0x413424[_0x116d('0x3b')]=_['intersection'](_0x413424[_0x116d('0x39')],_0x413424[_0x116d('0x3d')]);_0x16c0db['attributes']=_['intersection'](_0x413424['model'],qs['fields'](_0x42e880[_0x116d('0x3d')][_0x116d('0x3e')]));_0x16c0db[_0x116d('0x3f')]=_0x16c0db['attributes'][_0x116d('0x40')]?_0x16c0db[_0x116d('0x3f')]:_0x413424['model'];if(!_0x42e880[_0x116d('0x3d')][_0x116d('0x5b')](_0x116d('0x41'))){_0x16c0db[_0x116d('0x26')]=qs[_0x116d('0x26')](_0x42e880[_0x116d('0x3d')][_0x116d('0x26')]);_0x16c0db[_0x116d('0x24')]=qs['offset'](_0x42e880['query']['offset']);}_0x16c0db[_0x116d('0x42')]=qs['sort'](_0x42e880['query'][_0x116d('0x43')]);_0x16c0db[_0x116d('0x44')]=qs[_0x116d('0x3b')](_[_0x116d('0x45')](_0x42e880['query'],_0x413424[_0x116d('0x3b')]));_0x16c0db[_0x116d('0x44')][_0x116d('0x5c')]=_0xad15b6['id'];if(_0x42e880['query'][_0x116d('0x46')]){_0x16c0db[_0x116d('0x44')]=_[_0x116d('0x47')](_0x16c0db[_0x116d('0x44')],{'$or':_[_0x116d('0x34')](_0x16c0db[_0x116d('0x3f')],function(_0x32fa2c){var _0x44453b={};_0x44453b[_0x32fa2c]={'$like':'%'+_0x42e880['query'][_0x116d('0x46')]+'%'};return _0x44453b;})});}_0x16c0db=_[_0x116d('0x47')]({},_0x16c0db,_0x42e880[_0x116d('0x48')]);return db[_0x116d('0x5d')][_0x116d('0x4a')](_0x16c0db);}})['then'](function(_0x228bc0){if(_0x228bc0){return db[_0x116d('0x5e')][_0x116d('0x5f')]({'where':{'id':_['map'](_0x228bc0,_0x116d('0x60')),'role':'agent'},'attributes':['id',_0x116d('0x31'),'mailPause','updatedAt',_0x116d('0x61')]});}})[_0x116d('0x2b')](function(_0x4e9eff){if(_0x4e9eff){return{'count':_0x4e9eff[_0x116d('0x25')],'rows':_['map'](_0x4e9eff[_0x116d('0x4b')],function(_0x1039f6){return{'membername':_0x1039f6[_0x116d('0x31')],'UserId':_0x1039f6['id'],'queue_name':_0x4e3a9a[_0x116d('0x31')],'MailQueueId':_0x4e3a9a['id'],'interface':util[_0x116d('0x62')](_0x116d('0x63'),_0x116d('0x64'),_0x1039f6[_0x116d('0x31')]),'penalty':0x0,'paused':_0x1039f6[_0x116d('0x65')],'createdAt':_0x1039f6[_0x116d('0x61')],'updatedAt':_0x1039f6[_0x116d('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x116d('0x2b')](respondWithFilteredResult(_0x4fe598,_0x16c0db))[_0x116d('0x4c')](handleError(_0x4fe598,null));};exports[_0x116d('0x67')]=function(_0x500738,_0x512c2f,_0x15ab07){var _0x1e4c7b={};var _0x563e0b={};var _0x6376a9;var _0x404bbf;return db[_0x116d('0x35')]['findOne']({'where':{'id':_0x500738[_0x116d('0x4e')]['id']}})[_0x116d('0x2b')](handleEntityNotFound(_0x512c2f,null))[_0x116d('0x2b')](function(_0x2ba31e){if(_0x2ba31e){_0x6376a9=_0x2ba31e;_0x563e0b[_0x116d('0x39')]=_[_0x116d('0x3a')](db[_0x116d('0x68')][_0x116d('0x4f')]);_0x563e0b[_0x116d('0x3d')]=_[_0x116d('0x3a')](_0x500738[_0x116d('0x3d')]);_0x563e0b[_0x116d('0x3b')]=_['intersection'](_0x563e0b[_0x116d('0x39')],_0x563e0b[_0x116d('0x3d')]);_0x1e4c7b[_0x116d('0x3f')]=_[_0x116d('0x3c')](_0x563e0b[_0x116d('0x39')],qs[_0x116d('0x3e')](_0x500738[_0x116d('0x3d')][_0x116d('0x3e')]));_0x1e4c7b['attributes']=_0x1e4c7b['attributes']['length']?_0x1e4c7b['attributes']:_0x563e0b['model'];_0x1e4c7b[_0x116d('0x42')]=qs[_0x116d('0x43')](_0x500738[_0x116d('0x3d')]['sort']);_0x1e4c7b[_0x116d('0x44')]=qs[_0x116d('0x3b')](_[_0x116d('0x45')](_0x500738[_0x116d('0x3d')],_0x563e0b['filters']));if(_0x500738[_0x116d('0x3d')][_0x116d('0x46')]){_0x1e4c7b[_0x116d('0x44')]=_[_0x116d('0x47')](_0x1e4c7b[_0x116d('0x44')],{'$or':_[_0x116d('0x34')](_0x1e4c7b['attributes'],function(_0x4deff2){var _0x1e182c={};_0x1e182c[_0x4deff2]={'$like':'%'+_0x500738[_0x116d('0x3d')][_0x116d('0x46')]+'%'};return _0x1e182c;})});}_0x1e4c7b=_[_0x116d('0x47')]({},_0x1e4c7b,_0x500738['options']);return _0x6376a9['getTeams'](_0x1e4c7b);}})[_0x116d('0x2b')](function(_0x59ee6b){if(_0x59ee6b){_0x404bbf=_0x59ee6b[_0x116d('0x40')];if(!_0x500738['query'][_0x116d('0x5b')](_0x116d('0x41'))){_0x1e4c7b[_0x116d('0x26')]=qs['limit'](_0x500738['query']['limit']);_0x1e4c7b[_0x116d('0x24')]=qs[_0x116d('0x24')](_0x500738[_0x116d('0x3d')][_0x116d('0x24')]);}return _0x6376a9[_0x116d('0x67')](_0x1e4c7b);}})[_0x116d('0x2b')](function(_0x4c6e1c){if(_0x4c6e1c){return _0x4c6e1c?{'count':_0x404bbf,'rows':_0x4c6e1c}:null;}})['then'](respondWithResult(_0x512c2f,null))[_0x116d('0x4c')](handleError(_0x512c2f,null));};exports[_0x116d('0x69')]=function(_0x232fcc,_0x1cc1ec,_0x50bc0b){var _0x23b607=_0x232fcc[_0x116d('0x53')][_0x116d('0x6a')];return db[_0x116d('0x68')][_0x116d('0x4a')]({'where':{'id':_0x23b607},'attributes':['id'],'include':[{'model':db[_0x116d('0x5e')],'as':_0x116d('0x6b'),'attributes':['id',_0x116d('0x31'),_0x116d('0x6c'),_0x116d('0x6d'),_0x116d('0x6e')],'raw':!![]}]})[_0x116d('0x2b')](function(_0x51f1d1){if(_0x51f1d1){var _0x969a5b=_[_0x116d('0x6f')](_0x51f1d1,function(_0x4ae595){var _0x34769a=_0x4ae595['get']({'plain':!![]});return _0x34769a[_0x116d('0x6b')];});return db[_0x116d('0x35')]['find']({'where':{'id':_0x232fcc[_0x116d('0x4e')]['id']}})['then'](function(_0x276dd4){return db[_0x116d('0x70')][_0x116d('0x71')](function(_0x566ada){return _0x276dd4[_0x116d('0x69')](_0x23b607,{'transaction':_0x566ada})[_0x116d('0x2b')](function(){return BPromise[_0x116d('0x72')](_0x969a5b,function(_0x32d3e0){return db[_0x116d('0x5d')][_0x116d('0x73')]({'where':{'UserId':_0x32d3e0['id'],'MailQueueId':_0x232fcc[_0x116d('0x4e')]['id']},'transaction':_0x566ada});});})[_0x116d('0x2b')](function(){_0x969a5b['forEach'](function(_0x551778){socket[_0x116d('0x74')]('userMailQueue:save',{'UserId':_0x551778['id'],'MailQueueId':_0x276dd4['id']});});});});});}})[_0x116d('0x2b')](respondWithStatusCode(_0x1cc1ec,null))[_0x116d('0x4c')](handleError(_0x1cc1ec,null));};exports[_0x116d('0x75')]=function(_0x47dc1e,_0x2d269f,_0x3ea5c0){return db['Team']['findAll']({'where':{'id':_0x47dc1e[_0x116d('0x3d')][_0x116d('0x6a')]},'attributes':['id'],'include':[{'model':db[_0x116d('0x5e')],'as':_0x116d('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x116d('0x2b')](handleEntityNotFound(_0x2d269f,null))[_0x116d('0x2b')](function(_0x278b7d){var _0x26d354=_[_0x116d('0x34')](_0x278b7d,'id');var _0x3e1903=[];var _0x442815=[];var _0x1c29c1=squel[_0x116d('0x76')]();_0x1c29c1[_0x116d('0x77')](_0x116d('0x78'))[_0x116d('0x79')](_0x116d('0x7a'),'tq')[_0x116d('0x7b')]('user_has_teams','ut',_0x116d('0x7c'))['where'](_0x116d('0x7d'),_0x47dc1e['params']['id']);for(var _0x828bf4=0x0;_0x828bf4<_0x278b7d[_0x116d('0x40')];_0x828bf4+=0x1){let _0x5d1538=_0x278b7d[_0x828bf4];for(var _0x44eb01=0x0;_0x44eb01<_0x5d1538['Agents'][_0x116d('0x40')];_0x44eb01+=0x1){let _0xcebd73=_0x5d1538[_0x116d('0x6b')][_0x44eb01];var _0x499f08=_0x1c29c1[_0x116d('0x7e')]();_0x499f08[_0x116d('0x44')](_0x116d('0x7f'),_0xcebd73['id']);_0x442815[_0x116d('0x80')](db[_0x116d('0x70')][_0x116d('0x3d')](_0x499f08['toString'](),{'type':db[_0x116d('0x70')][_0x116d('0x81')][_0x116d('0x82')]})[_0x116d('0x2b')](function(_0x97563f){if(_0x97563f['length']===0x1){return _0xcebd73['id'];}else{var _0x462b75=_['every'](_[_0x116d('0x34')](_0x97563f,_0x116d('0x83')),function(_0x1cd2d0){return _['includes'](_0x26d354,_0x1cd2d0);});if(_0x462b75){return _0xcebd73['id'];}}}));}}return BPromise[_0x116d('0x84')](_0x442815)[_0x116d('0x2b')](function(_0x534b2e){_0x3e1903=_(_0x3e1903)[_0x116d('0x85')](_0x534b2e)[_0x116d('0x86')]()[_0x116d('0x87')]();return db[_0x116d('0x35')][_0x116d('0x51')]({'where':{'id':_0x47dc1e['params']['id']}})['then'](function(_0x5331f3){return db['sequelize'][_0x116d('0x71')](function(_0xec9899){return _0x5331f3[_0x116d('0x75')](_0x47dc1e[_0x116d('0x3d')][_0x116d('0x6a')],{'transaction':_0xec9899})[_0x116d('0x2b')](function(){if(!_[_0x116d('0x88')](_0x3e1903)){return _0x5331f3[_0x116d('0x89')](_0x3e1903,{'transaction':_0xec9899});}})['then'](function(){_0x3e1903[_0x116d('0x8a')](function(_0x35e3f4){socket['emit'](_0x116d('0x8b'),{'UserId':_0x35e3f4,'MailQueueId':_0x5331f3['id']});});});});});});})[_0x116d('0x2b')](respondWithStatusCode(_0x2d269f,null))[_0x116d('0x4c')](handleError(_0x2d269f,null));};exports['addAgents']=function(_0x1c979d,_0x2f9536,_0x1821a5){return db[_0x116d('0x35')][_0x116d('0x51')]({'where':{'id':_0x1c979d[_0x116d('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2f9536,null))[_0x116d('0x2b')](function(_0x3324d7){if(_0x3324d7){return _0x3324d7['addAgents'](_0x1c979d[_0x116d('0x53')][_0x116d('0x6a')],_[_0x116d('0x8c')](_0x1c979d[_0x116d('0x53')],['ids','id'])||{})[_0x116d('0x8d')](function(_0x52c2a9){for(var _0x2e1de7=0x0;_0x2e1de7<_0x1c979d[_0x116d('0x53')][_0x116d('0x6a')][_0x116d('0x40')];_0x2e1de7+=0x1){socket['emit']('userMailQueue:save',{'UserId':Number(_0x1c979d[_0x116d('0x53')]['ids'][_0x2e1de7]),'MailQueueId':Number(_0x1c979d[_0x116d('0x4e')]['id'])});}return _0x52c2a9;});}})[_0x116d('0x2b')](respondWithResult(_0x2f9536,null))['catch'](handleError(_0x2f9536,null));};exports[_0x116d('0x89')]=function(_0x53c417,_0x5fe0e8,_0x5a9c68){return db['MailQueue'][_0x116d('0x51')]({'where':{'id':_0x53c417[_0x116d('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5fe0e8,null))[_0x116d('0x2b')](function(_0x3f1217){if(_0x3f1217){return _0x3f1217['removeAgents'](_0x53c417[_0x116d('0x3d')][_0x116d('0x6a')])['then'](function(){if(_[_0x116d('0x8e')](_0x53c417['query'][_0x116d('0x6a')])){for(var _0x1ea453=0x0;_0x1ea453<_0x53c417[_0x116d('0x3d')][_0x116d('0x6a')][_0x116d('0x40')];_0x1ea453+=0x1){socket[_0x116d('0x74')](_0x116d('0x8b'),{'UserId':Number(_0x53c417[_0x116d('0x3d')][_0x116d('0x6a')][_0x1ea453]),'MailQueueId':Number(_0x53c417[_0x116d('0x4e')]['id'])});}}else{socket[_0x116d('0x74')]('userMailQueue:remove',{'UserId':Number(_0x53c417[_0x116d('0x3d')][_0x116d('0x6a')]),'MailQueueId':Number(_0x53c417[_0x116d('0x4e')]['id'])});}});}})[_0x116d('0x2b')](respondWithStatusCode(_0x5fe0e8,null))['catch'](handleError(_0x5fe0e8,null));};exports[_0x116d('0x8f')]=function(_0xd96d67,_0x4808c3,_0x1a011c){var _0x1ba566={};var _0x1ba8d5={};var _0x10422c;var _0x398e85;return db[_0x116d('0x35')][_0x116d('0x90')]({'where':{'id':_0xd96d67[_0x116d('0x4e')]['id']}})[_0x116d('0x2b')](handleEntityNotFound(_0x4808c3,null))[_0x116d('0x2b')](function(_0x4d68e3){if(_0x4d68e3){_0x10422c=_0x4d68e3;_0x1ba8d5['model']=_[_0x116d('0x3a')](db['User']['rawAttributes']);_0x1ba8d5[_0x116d('0x3d')]=_['keys'](_0xd96d67[_0x116d('0x3d')]);_0x1ba8d5[_0x116d('0x3b')]=_[_0x116d('0x3c')](_0x1ba8d5[_0x116d('0x39')],_0x1ba8d5[_0x116d('0x3d')]);_0x1ba566[_0x116d('0x3f')]=_[_0x116d('0x3c')](_0x1ba8d5[_0x116d('0x39')],qs[_0x116d('0x3e')](_0xd96d67[_0x116d('0x3d')][_0x116d('0x3e')]));_0x1ba566[_0x116d('0x3f')]=_0x1ba566[_0x116d('0x3f')][_0x116d('0x40')]?_0x1ba566['attributes']:_0x1ba8d5[_0x116d('0x39')];_0x1ba566[_0x116d('0x42')]=qs[_0x116d('0x43')](_0xd96d67['query']['sort']);_0x1ba566['where']=qs[_0x116d('0x3b')](_['pick'](_0xd96d67[_0x116d('0x3d')],_0x1ba8d5['filters']));if(_0xd96d67[_0x116d('0x3d')][_0x116d('0x46')]){_0x1ba566['where']=_['merge'](_0x1ba566[_0x116d('0x44')],{'$or':_[_0x116d('0x34')](_0x1ba566[_0x116d('0x3f')],function(_0x5dfd99){var _0x1d5c72={};_0x1d5c72[_0x5dfd99]={'$like':'%'+_0xd96d67['query'][_0x116d('0x46')]+'%'};return _0x1d5c72;})});}_0x1ba566=_['merge']({},_0x1ba566,_0xd96d67[_0x116d('0x48')]);return _0x10422c[_0x116d('0x8f')](_0x1ba566);}})[_0x116d('0x2b')](function(_0x3c82f3){if(_0x3c82f3){_0x398e85=_0x3c82f3[_0x116d('0x40')];if(!_0xd96d67[_0x116d('0x3d')]['hasOwnProperty'](_0x116d('0x41'))){_0x1ba566['limit']=qs[_0x116d('0x26')](_0xd96d67[_0x116d('0x3d')]['limit']);_0x1ba566[_0x116d('0x24')]=qs[_0x116d('0x24')](_0xd96d67[_0x116d('0x3d')]['offset']);}return _0x10422c[_0x116d('0x8f')](_0x1ba566);}})[_0x116d('0x2b')](function(_0x3c2d9e){if(_0x3c2d9e){return _0x3c2d9e?{'count':_0x398e85,'rows':_0x3c2d9e}:null;}})['then'](respondWithResult(_0x4808c3,null))[_0x116d('0x4c')](handleError(_0x4808c3,null));}; \ No newline at end of file +var _0x2137=['sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userMailQueue:save','select','field','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','every','includes','all','union','value','removeTeams','isEmpty','removeAgents','userMailQueue:remove','addAgents','spread','isArray','findOne','getAgents','eml-format','rimraf','zip-dir','moment','mustache','util','path','fs-extra','lodash','crypto','jsforce','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','get','MailQueues','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','type','key','query','keys','filters','model','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','catch','params','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','UserMailQueue','MailQueueId','findAll','User','UserId','agent','mailPause','createdAt','rows','SIP','updatedAt','getTeams','Team','nolimit','ids','Agents','online','voicePause','interface','flatMap'];(function(_0xe95af,_0x4b849b){var _0x16effb=function(_0x454cd0){while(--_0x454cd0){_0xe95af['push'](_0xe95af['shift']());}};_0x16effb(++_0x4b849b);}(_0x2137,0x134));var _0x7213=function(_0x2329f8,_0x3bbf48){_0x2329f8=_0x2329f8-0x0;var _0x287755=_0x2137[_0x2329f8];return _0x287755;};'use strict';var emlformat=require(_0x7213('0x0'));var rimraf=require(_0x7213('0x1'));var zipdir=require(_0x7213('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7213('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7213('0x4'));var util=require(_0x7213('0x5'));var path=require(_0x7213('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7213('0x7'));var _=require(_0x7213('0x8'));var squel=require('squel');var crypto=require(_0x7213('0x9'));var jsforce=require(_0x7213('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x7213('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7213('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x7213('0xd'));var as=require(_0x7213('0xe'));var hardwareService=require(_0x7213('0xf'));var logger=require(_0x7213('0x10'))(_0x7213('0x11'));var utils=require(_0x7213('0x12'));var config=require(_0x7213('0x13'));var licenseUtil=require(_0x7213('0x14'));var db=require(_0x7213('0x15'))['db'];config[_0x7213('0x16')]=_['defaults'](config[_0x7213('0x16')],{'host':_0x7213('0x17'),'port':0x18eb});var socket=require(_0x7213('0x18'))(new Redis(config[_0x7213('0x16')]));require(_0x7213('0x19'))[_0x7213('0x1a')](socket);function respondWithStatusCode(_0x121036,_0x215750){_0x215750=_0x215750||0xcc;return function(_0x2050ab){if(_0x2050ab){return _0x121036[_0x7213('0x1b')](_0x215750);}return _0x121036[_0x7213('0x1c')](_0x215750)[_0x7213('0x1d')]();};}function respondWithResult(_0x4809fb,_0xc6b44e){_0xc6b44e=_0xc6b44e||0xc8;return function(_0x2ed630){if(_0x2ed630){return _0x4809fb[_0x7213('0x1c')](_0xc6b44e)[_0x7213('0x1e')](_0x2ed630);}};}function respondWithFilteredResult(_0x2ab127,_0x90bc4d){return function(_0x6c6c85){if(_0x6c6c85){var _0x24e2a5=typeof _0x90bc4d[_0x7213('0x1f')]===_0x7213('0x20')&&typeof _0x90bc4d[_0x7213('0x21')]===_0x7213('0x20');var _0x1ebb2b=_0x6c6c85['count'];var _0x1a0de8=_0x24e2a5?0x0:_0x90bc4d[_0x7213('0x1f')];var _0xaa8c67=_0x24e2a5?_0x6c6c85[_0x7213('0x22')]:_0x90bc4d[_0x7213('0x1f')]+_0x90bc4d['limit'];var _0x136bd6;if(_0xaa8c67>=_0x1ebb2b){_0xaa8c67=_0x1ebb2b;_0x136bd6=0xc8;}else{_0x136bd6=0xce;}_0x2ab127[_0x7213('0x1c')](_0x136bd6);return _0x2ab127[_0x7213('0x23')](_0x7213('0x24'),_0x1a0de8+'-'+_0xaa8c67+'/'+_0x1ebb2b)[_0x7213('0x1e')](_0x6c6c85);}return null;};}function patchUpdates(_0x2e49d8){return function(_0x13e489){try{jsonpatch[_0x7213('0x25')](_0x13e489,_0x2e49d8,!![]);}catch(_0x13afcc){return BPromise['reject'](_0x13afcc);}return _0x13e489['save']();};}function saveUpdates(_0x40d1a6,_0x5627fd){return function(_0x2d5c85){if(_0x2d5c85){return _0x2d5c85['update'](_0x40d1a6)[_0x7213('0x26')](function(_0xb08e37){return _0xb08e37;});}return null;};}function removeEntity(_0x4eedf1,_0x5ecadd){return function(_0x4a46ac){if(_0x4a46ac){return _0x4a46ac[_0x7213('0x27')]()[_0x7213('0x26')](function(){var _0x1e443d=_0x4a46ac[_0x7213('0x28')]({'plain':!![]});var _0x44f348=_0x7213('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x44f348,'resourceId':_0x1e443d['id']}})[_0x7213('0x26')](function(){return _0x4a46ac;});})[_0x7213('0x26')](function(){_0x4eedf1[_0x7213('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x562783,_0x59a540){return function(_0x11ed63){if(!_0x11ed63){_0x562783[_0x7213('0x1b')](0x194);}return _0x11ed63;};}function handleError(_0x2f8b8c,_0x115485){_0x115485=_0x115485||0x1f4;return function(_0xaeef75){logger['error'](_0xaeef75[_0x7213('0x2a')]);if(_0xaeef75[_0x7213('0x2b')]){delete _0xaeef75[_0x7213('0x2b')];}_0x2f8b8c[_0x7213('0x1c')](_0x115485)[_0x7213('0x2c')](_0xaeef75);};}exports[_0x7213('0x2d')]=function(_0xad9d7f,_0x455142){var _0x2d6e3b={},_0x4e3a11={},_0x5dfa89={'count':0x0,'rows':[]};var _0xcede1c=_[_0x7213('0x2e')](db[_0x7213('0x2f')][_0x7213('0x30')],function(_0x55c6d8){return{'name':_0x55c6d8[_0x7213('0x31')],'type':_0x55c6d8[_0x7213('0x32')][_0x7213('0x33')]};});_0x4e3a11['model']=_['map'](_0xcede1c,_0x7213('0x2b'));_0x4e3a11[_0x7213('0x34')]=_[_0x7213('0x35')](_0xad9d7f[_0x7213('0x34')]);_0x4e3a11[_0x7213('0x36')]=_['intersection'](_0x4e3a11[_0x7213('0x37')],_0x4e3a11[_0x7213('0x34')]);_0x2d6e3b['attributes']=_[_0x7213('0x38')](_0x4e3a11[_0x7213('0x37')],qs['fields'](_0xad9d7f['query']['fields']));_0x2d6e3b[_0x7213('0x39')]=_0x2d6e3b['attributes'][_0x7213('0x3a')]?_0x2d6e3b[_0x7213('0x39')]:_0x4e3a11[_0x7213('0x37')];if(!_0xad9d7f['query'][_0x7213('0x3b')]('nolimit')){_0x2d6e3b[_0x7213('0x21')]=qs['limit'](_0xad9d7f['query'][_0x7213('0x21')]);_0x2d6e3b[_0x7213('0x1f')]=qs['offset'](_0xad9d7f[_0x7213('0x34')][_0x7213('0x1f')]);}_0x2d6e3b[_0x7213('0x3c')]=qs[_0x7213('0x3d')](_0xad9d7f[_0x7213('0x34')][_0x7213('0x3d')]);_0x2d6e3b[_0x7213('0x3e')]=qs[_0x7213('0x36')](_[_0x7213('0x3f')](_0xad9d7f[_0x7213('0x34')],_0x4e3a11[_0x7213('0x36')]),_0xcede1c);if(_0xad9d7f[_0x7213('0x34')][_0x7213('0x40')]){_0x2d6e3b[_0x7213('0x3e')]=_[_0x7213('0x41')](_0x2d6e3b[_0x7213('0x3e')],{'$or':_[_0x7213('0x2e')](_0xcede1c,function(_0x2bfe6d){if(_0x2bfe6d[_0x7213('0x32')]!=='VIRTUAL'){var _0x4c9501={};_0x4c9501[_0x2bfe6d['name']]={'$like':'%'+_0xad9d7f['query']['filter']+'%'};return _0x4c9501;}})});}_0x2d6e3b=_[_0x7213('0x41')]({},_0x2d6e3b,_0xad9d7f[_0x7213('0x42')]);var _0x76dba={'where':_0x2d6e3b[_0x7213('0x3e')]};return db[_0x7213('0x2f')][_0x7213('0x22')](_0x76dba)[_0x7213('0x26')](function(_0x2174d3){_0x5dfa89[_0x7213('0x22')]=_0x2174d3;if(_0xad9d7f[_0x7213('0x34')][_0x7213('0x43')]){_0x2d6e3b[_0x7213('0x44')]=[{'all':!![]}];}return db[_0x7213('0x2f')]['findAll'](_0x2d6e3b);})['then'](function(_0x4c4bad){_0x5dfa89['rows']=_0x4c4bad;return _0x5dfa89;})['then'](respondWithFilteredResult(_0x455142,_0x2d6e3b))[_0x7213('0x45')](handleError(_0x455142,null));};exports['show']=function(_0x37ede1,_0x15e5e8){var _0xc54b88={'raw':!![],'where':{'id':_0x37ede1[_0x7213('0x46')]['id']}},_0x48a22a={};_0x48a22a[_0x7213('0x37')]=_[_0x7213('0x35')](db['MailQueue'][_0x7213('0x30')]);_0x48a22a[_0x7213('0x34')]=_[_0x7213('0x35')](_0x37ede1['query']);_0x48a22a[_0x7213('0x36')]=_[_0x7213('0x38')](_0x48a22a[_0x7213('0x37')],_0x48a22a[_0x7213('0x34')]);_0xc54b88[_0x7213('0x39')]=_[_0x7213('0x38')](_0x48a22a[_0x7213('0x37')],qs[_0x7213('0x47')](_0x37ede1[_0x7213('0x34')]['fields']));_0xc54b88['attributes']=_0xc54b88[_0x7213('0x39')][_0x7213('0x3a')]?_0xc54b88[_0x7213('0x39')]:_0x48a22a['model'];if(_0x37ede1[_0x7213('0x34')][_0x7213('0x43')]){_0xc54b88['include']=[{'all':!![]}];}_0xc54b88=_['merge']({},_0xc54b88,_0x37ede1['options']);return db[_0x7213('0x2f')][_0x7213('0x48')](_0xc54b88)['then'](handleEntityNotFound(_0x15e5e8,null))[_0x7213('0x26')](respondWithResult(_0x15e5e8,null))[_0x7213('0x45')](handleError(_0x15e5e8,null));};exports[_0x7213('0x49')]=function(_0xa7679,_0x4e7b62){return db['MailQueue']['create'](_0xa7679[_0x7213('0x4a')],{})['then'](function(_0x245795){var _0x127b24=_0xa7679[_0x7213('0x4b')][_0x7213('0x28')]({'plain':!![]});if(!_0x127b24)throw new Error(_0x7213('0x4c'));if(_0x127b24[_0x7213('0x4d')]===_0x7213('0x4b')){var _0x412b80=_0x245795[_0x7213('0x28')]({'plain':!![]});var _0xc50ec1=_0x7213('0x29');return db[_0x7213('0x4e')]['find']({'where':{'name':_0xc50ec1,'userProfileId':_0x127b24[_0x7213('0x4f')]},'raw':!![]})['then'](function(_0x4d8313){if(_0x4d8313&&_0x4d8313[_0x7213('0x50')]===0x0){return db['UserProfileResource'][_0x7213('0x49')]({'name':_0x412b80[_0x7213('0x2b')],'resourceId':_0x412b80['id'],'type':_0x4d8313[_0x7213('0x2b')],'sectionId':_0x4d8313['id']},{})[_0x7213('0x26')](function(){return _0x245795;});}else{return _0x245795;}})[_0x7213('0x45')](function(_0x497acf){logger[_0x7213('0x51')](_0x7213('0x52'),_0x497acf);throw _0x497acf;});}return _0x245795;})[_0x7213('0x26')](respondWithResult(_0x4e7b62,0xc9))['catch'](handleError(_0x4e7b62,null));};exports[_0x7213('0x53')]=function(_0x44097b,_0x4cb4ac){if(_0x44097b[_0x7213('0x4a')]['id']){delete _0x44097b[_0x7213('0x4a')]['id'];}return db[_0x7213('0x2f')]['find']({'where':{'id':_0x44097b[_0x7213('0x46')]['id']}})[_0x7213('0x26')](handleEntityNotFound(_0x4cb4ac,null))[_0x7213('0x26')](saveUpdates(_0x44097b[_0x7213('0x4a')],null))['then'](respondWithResult(_0x4cb4ac,null))[_0x7213('0x45')](handleError(_0x4cb4ac,null));};exports[_0x7213('0x27')]=function(_0x5f3581,_0x19b348){return db[_0x7213('0x2f')][_0x7213('0x48')]({'where':{'id':_0x5f3581[_0x7213('0x46')]['id']}})[_0x7213('0x26')](handleEntityNotFound(_0x19b348,null))[_0x7213('0x26')](removeEntity(_0x19b348,null))[_0x7213('0x45')](handleError(_0x19b348,null));};exports[_0x7213('0x54')]=function(_0x239777,_0x24b8d3){return db['MailQueue'][_0x7213('0x54')]()['then'](respondWithResult(_0x24b8d3,null))[_0x7213('0x45')](handleError(_0x24b8d3,null));};exports[_0x7213('0x55')]=function(_0x1e719e,_0x1e7041,_0x8dd958){var _0x452aeb={'raw':!![],'where':{}},_0x199a83={},_0xb1d05a;return db[_0x7213('0x2f')]['findOne']({'where':{'id':_0x1e719e[_0x7213('0x46')]['id']}})['then'](handleEntityNotFound(_0x1e7041,null))[_0x7213('0x26')](function(_0x21fecf){if(_0x21fecf){_0xb1d05a=_0x21fecf['get']({'plain':!![]});_0x199a83['model']=_['keys'](db[_0x7213('0x56')][_0x7213('0x30')]);_0x199a83[_0x7213('0x34')]=_[_0x7213('0x35')](_0x1e719e[_0x7213('0x34')]);_0x199a83[_0x7213('0x36')]=_[_0x7213('0x38')](_0x199a83[_0x7213('0x37')],_0x199a83[_0x7213('0x34')]);_0x452aeb[_0x7213('0x39')]=_[_0x7213('0x38')](_0x199a83[_0x7213('0x37')],qs[_0x7213('0x47')](_0x1e719e[_0x7213('0x34')][_0x7213('0x47')]));_0x452aeb[_0x7213('0x39')]=_0x452aeb['attributes']['length']?_0x452aeb['attributes']:_0x199a83[_0x7213('0x37')];if(!_0x1e719e[_0x7213('0x34')][_0x7213('0x3b')]('nolimit')){_0x452aeb[_0x7213('0x21')]=qs[_0x7213('0x21')](_0x1e719e['query']['limit']);_0x452aeb['offset']=qs['offset'](_0x1e719e[_0x7213('0x34')][_0x7213('0x1f')]);}_0x452aeb['order']=qs[_0x7213('0x3d')](_0x1e719e[_0x7213('0x34')][_0x7213('0x3d')]);_0x452aeb[_0x7213('0x3e')]=qs[_0x7213('0x36')](_['pick'](_0x1e719e[_0x7213('0x34')],_0x199a83[_0x7213('0x36')]));_0x452aeb[_0x7213('0x3e')][_0x7213('0x57')]=_0x21fecf['id'];if(_0x1e719e[_0x7213('0x34')]['filter']){_0x452aeb[_0x7213('0x3e')]=_[_0x7213('0x41')](_0x452aeb[_0x7213('0x3e')],{'$or':_[_0x7213('0x2e')](_0x452aeb['attributes'],function(_0x5ae8fc){var _0x1bb956={};_0x1bb956[_0x5ae8fc]={'$like':'%'+_0x1e719e['query']['filter']+'%'};return _0x1bb956;})});}_0x452aeb=_[_0x7213('0x41')]({},_0x452aeb,_0x1e719e[_0x7213('0x42')]);return db[_0x7213('0x56')][_0x7213('0x58')](_0x452aeb);}})[_0x7213('0x26')](function(_0x1532e8){if(_0x1532e8){return db[_0x7213('0x59')]['findAndCountAll']({'where':{'id':_[_0x7213('0x2e')](_0x1532e8,_0x7213('0x5a')),'role':_0x7213('0x5b')},'attributes':['id',_0x7213('0x2b'),_0x7213('0x5c'),'updatedAt',_0x7213('0x5d')]});}})[_0x7213('0x26')](function(_0x455aa1){if(_0x455aa1){return{'count':_0x455aa1[_0x7213('0x22')],'rows':_['map'](_0x455aa1[_0x7213('0x5e')],function(_0x3b72ad){return{'membername':_0x3b72ad[_0x7213('0x2b')],'UserId':_0x3b72ad['id'],'queue_name':_0xb1d05a[_0x7213('0x2b')],'MailQueueId':_0xb1d05a['id'],'interface':util['format']('%s/%s',_0x7213('0x5f'),_0x3b72ad[_0x7213('0x2b')]),'penalty':0x0,'paused':_0x3b72ad[_0x7213('0x5c')],'createdAt':_0x3b72ad['createdAt'],'updatedAt':_0x3b72ad[_0x7213('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7213('0x26')](respondWithFilteredResult(_0x1e7041,_0x452aeb))[_0x7213('0x45')](handleError(_0x1e7041,null));};exports[_0x7213('0x61')]=function(_0x293a69,_0x5d5100,_0x21aabe){var _0x192870={};var _0x5a6335={};var _0x3b4f72;var _0xc8249c;return db['MailQueue']['findOne']({'where':{'id':_0x293a69[_0x7213('0x46')]['id']}})[_0x7213('0x26')](handleEntityNotFound(_0x5d5100,null))[_0x7213('0x26')](function(_0x1f1f18){if(_0x1f1f18){_0x3b4f72=_0x1f1f18;_0x5a6335[_0x7213('0x37')]=_[_0x7213('0x35')](db[_0x7213('0x62')][_0x7213('0x30')]);_0x5a6335[_0x7213('0x34')]=_[_0x7213('0x35')](_0x293a69[_0x7213('0x34')]);_0x5a6335['filters']=_[_0x7213('0x38')](_0x5a6335[_0x7213('0x37')],_0x5a6335[_0x7213('0x34')]);_0x192870['attributes']=_['intersection'](_0x5a6335[_0x7213('0x37')],qs[_0x7213('0x47')](_0x293a69[_0x7213('0x34')][_0x7213('0x47')]));_0x192870[_0x7213('0x39')]=_0x192870[_0x7213('0x39')][_0x7213('0x3a')]?_0x192870['attributes']:_0x5a6335[_0x7213('0x37')];_0x192870[_0x7213('0x3c')]=qs[_0x7213('0x3d')](_0x293a69[_0x7213('0x34')][_0x7213('0x3d')]);_0x192870[_0x7213('0x3e')]=qs[_0x7213('0x36')](_[_0x7213('0x3f')](_0x293a69[_0x7213('0x34')],_0x5a6335['filters']));if(_0x293a69[_0x7213('0x34')]['filter']){_0x192870[_0x7213('0x3e')]=_['merge'](_0x192870['where'],{'$or':_[_0x7213('0x2e')](_0x192870[_0x7213('0x39')],function(_0x5d9cd9){var _0xd6de4={};_0xd6de4[_0x5d9cd9]={'$like':'%'+_0x293a69['query'][_0x7213('0x40')]+'%'};return _0xd6de4;})});}_0x192870=_['merge']({},_0x192870,_0x293a69[_0x7213('0x42')]);return _0x3b4f72['getTeams'](_0x192870);}})['then'](function(_0x468bb4){if(_0x468bb4){_0xc8249c=_0x468bb4[_0x7213('0x3a')];if(!_0x293a69['query']['hasOwnProperty'](_0x7213('0x63'))){_0x192870[_0x7213('0x21')]=qs[_0x7213('0x21')](_0x293a69[_0x7213('0x34')]['limit']);_0x192870[_0x7213('0x1f')]=qs['offset'](_0x293a69[_0x7213('0x34')]['offset']);}return _0x3b4f72[_0x7213('0x61')](_0x192870);}})[_0x7213('0x26')](function(_0x598010){if(_0x598010){return _0x598010?{'count':_0xc8249c,'rows':_0x598010}:null;}})[_0x7213('0x26')](respondWithResult(_0x5d5100,null))[_0x7213('0x45')](handleError(_0x5d5100,null));};exports['addTeams']=function(_0x26b1a3,_0x5c9dbb,_0x4c581e){var _0x1f804a=_0x26b1a3['body'][_0x7213('0x64')];return db['Team']['findAll']({'where':{'id':_0x1f804a},'attributes':['id'],'include':[{'model':db[_0x7213('0x59')],'as':_0x7213('0x65'),'attributes':['id',_0x7213('0x2b'),_0x7213('0x66'),_0x7213('0x67'),_0x7213('0x68')],'raw':!![]}]})[_0x7213('0x26')](function(_0x4d7209){if(_0x4d7209){var _0x4d7274=_[_0x7213('0x69')](_0x4d7209,function(_0x8d8d98){var _0x315b5d=_0x8d8d98['get']({'plain':!![]});return _0x315b5d[_0x7213('0x65')];});return db[_0x7213('0x2f')][_0x7213('0x48')]({'where':{'id':_0x26b1a3['params']['id']}})['then'](function(_0x41a5bd){return db[_0x7213('0x6a')][_0x7213('0x6b')](function(_0x4f2721){return _0x41a5bd[_0x7213('0x6c')](_0x1f804a,{'transaction':_0x4f2721})[_0x7213('0x26')](function(){return BPromise[_0x7213('0x6d')](_0x4d7274,function(_0x35b407){return db[_0x7213('0x56')][_0x7213('0x6e')]({'where':{'UserId':_0x35b407['id'],'MailQueueId':_0x26b1a3[_0x7213('0x46')]['id']},'transaction':_0x4f2721});});})[_0x7213('0x26')](function(){_0x4d7274[_0x7213('0x6f')](function(_0x2573c3){socket[_0x7213('0x70')](_0x7213('0x71'),{'UserId':_0x2573c3['id'],'MailQueueId':_0x41a5bd['id']});});});});});}})[_0x7213('0x26')](respondWithStatusCode(_0x5c9dbb,null))['catch'](handleError(_0x5c9dbb,null));};exports['removeTeams']=function(_0x151e72,_0x58f81e,_0x4d4aac){return db[_0x7213('0x62')][_0x7213('0x58')]({'where':{'id':_0x151e72['query'][_0x7213('0x64')]},'attributes':['id'],'include':[{'model':db[_0x7213('0x59')],'as':_0x7213('0x65'),'attributes':['id'],'raw':!![]}]})[_0x7213('0x26')](handleEntityNotFound(_0x58f81e,null))['then'](function(_0x131f2b){var _0x3efc68=_['map'](_0x131f2b,'id');var _0x1d6319=[];var _0x42a022=[];var _0xc1f02f=squel[_0x7213('0x72')]();_0xc1f02f[_0x7213('0x73')]('tq.TeamId')[_0x7213('0x74')](_0x7213('0x75'),'tq')[_0x7213('0x76')](_0x7213('0x77'),'ut',_0x7213('0x78'))['where'](_0x7213('0x79'),_0x151e72[_0x7213('0x46')]['id']);for(var _0x497b43=0x0;_0x497b43<_0x131f2b[_0x7213('0x3a')];_0x497b43+=0x1){let _0x540856=_0x131f2b[_0x497b43];for(var _0x52316e=0x0;_0x52316e<_0x540856[_0x7213('0x65')][_0x7213('0x3a')];_0x52316e+=0x1){let _0xca097e=_0x540856['Agents'][_0x52316e];var _0x1a23c6=_0xc1f02f['clone']();_0x1a23c6[_0x7213('0x3e')](_0x7213('0x7a'),_0xca097e['id']);_0x42a022[_0x7213('0x7b')](db[_0x7213('0x6a')][_0x7213('0x34')](_0x1a23c6['toString'](),{'type':db[_0x7213('0x6a')]['QueryTypes']['SELECT']})['then'](function(_0x37afc6){if(_0x37afc6[_0x7213('0x3a')]===0x1){return _0xca097e['id'];}else{var _0x5cdeee=_[_0x7213('0x7c')](_['map'](_0x37afc6,'TeamId'),function(_0x1b5460){return _[_0x7213('0x7d')](_0x3efc68,_0x1b5460);});if(_0x5cdeee){return _0xca097e['id'];}}}));}}return BPromise[_0x7213('0x7e')](_0x42a022)[_0x7213('0x26')](function(_0x497cec){_0x1d6319=_(_0x1d6319)[_0x7213('0x7f')](_0x497cec)['compact']()[_0x7213('0x80')]();return db[_0x7213('0x2f')][_0x7213('0x48')]({'where':{'id':_0x151e72[_0x7213('0x46')]['id']}})[_0x7213('0x26')](function(_0x4fb547){return db[_0x7213('0x6a')]['transaction'](function(_0x48e6c3){return _0x4fb547[_0x7213('0x81')](_0x151e72[_0x7213('0x34')][_0x7213('0x64')],{'transaction':_0x48e6c3})[_0x7213('0x26')](function(){if(!_[_0x7213('0x82')](_0x1d6319)){return _0x4fb547[_0x7213('0x83')](_0x1d6319,{'transaction':_0x48e6c3});}})[_0x7213('0x26')](function(){_0x1d6319[_0x7213('0x6f')](function(_0x7aa0e2){socket[_0x7213('0x70')](_0x7213('0x84'),{'UserId':_0x7aa0e2,'MailQueueId':_0x4fb547['id']});});});});});});})[_0x7213('0x26')](respondWithStatusCode(_0x58f81e,null))[_0x7213('0x45')](handleError(_0x58f81e,null));};exports['addAgents']=function(_0x32479a,_0x453261,_0x4f0043){return db[_0x7213('0x2f')][_0x7213('0x48')]({'where':{'id':_0x32479a[_0x7213('0x46')]['id']}})[_0x7213('0x26')](handleEntityNotFound(_0x453261,null))[_0x7213('0x26')](function(_0x4c6dd3){if(_0x4c6dd3){return _0x4c6dd3[_0x7213('0x85')](_0x32479a[_0x7213('0x4a')][_0x7213('0x64')],_['omit'](_0x32479a[_0x7213('0x4a')],[_0x7213('0x64'),'id'])||{})[_0x7213('0x86')](function(_0xa4ea4d){for(var _0x5a181b=0x0;_0x5a181b<_0x32479a[_0x7213('0x4a')][_0x7213('0x64')][_0x7213('0x3a')];_0x5a181b+=0x1){socket['emit'](_0x7213('0x71'),{'UserId':Number(_0x32479a[_0x7213('0x4a')][_0x7213('0x64')][_0x5a181b]),'MailQueueId':Number(_0x32479a[_0x7213('0x46')]['id'])});}return _0xa4ea4d;});}})[_0x7213('0x26')](respondWithResult(_0x453261,null))['catch'](handleError(_0x453261,null));};exports['removeAgents']=function(_0x42e368,_0x34297b,_0x576402){return db[_0x7213('0x2f')][_0x7213('0x48')]({'where':{'id':_0x42e368['params']['id']}})[_0x7213('0x26')](handleEntityNotFound(_0x34297b,null))[_0x7213('0x26')](function(_0x4a205b){if(_0x4a205b){return _0x4a205b['removeAgents'](_0x42e368[_0x7213('0x34')][_0x7213('0x64')])[_0x7213('0x26')](function(){if(_[_0x7213('0x87')](_0x42e368[_0x7213('0x34')]['ids'])){for(var _0x35cf62=0x0;_0x35cf62<_0x42e368[_0x7213('0x34')][_0x7213('0x64')]['length'];_0x35cf62+=0x1){socket[_0x7213('0x70')](_0x7213('0x84'),{'UserId':Number(_0x42e368[_0x7213('0x34')]['ids'][_0x35cf62]),'MailQueueId':Number(_0x42e368['params']['id'])});}}else{socket[_0x7213('0x70')](_0x7213('0x84'),{'UserId':Number(_0x42e368['query'][_0x7213('0x64')]),'MailQueueId':Number(_0x42e368['params']['id'])});}});}})[_0x7213('0x26')](respondWithStatusCode(_0x34297b,null))[_0x7213('0x45')](handleError(_0x34297b,null));};exports['getAgents']=function(_0x1ed85e,_0x51865c,_0x200fcd){var _0x1bc2a8={};var _0x4f1b8b={};var _0x3d008b;var _0x31c43f;return db[_0x7213('0x2f')][_0x7213('0x88')]({'where':{'id':_0x1ed85e[_0x7213('0x46')]['id']}})[_0x7213('0x26')](handleEntityNotFound(_0x51865c,null))[_0x7213('0x26')](function(_0x357f95){if(_0x357f95){_0x3d008b=_0x357f95;_0x4f1b8b['model']=_[_0x7213('0x35')](db[_0x7213('0x59')][_0x7213('0x30')]);_0x4f1b8b['query']=_['keys'](_0x1ed85e[_0x7213('0x34')]);_0x4f1b8b['filters']=_['intersection'](_0x4f1b8b[_0x7213('0x37')],_0x4f1b8b[_0x7213('0x34')]);_0x1bc2a8['attributes']=_['intersection'](_0x4f1b8b[_0x7213('0x37')],qs[_0x7213('0x47')](_0x1ed85e[_0x7213('0x34')]['fields']));_0x1bc2a8['attributes']=_0x1bc2a8[_0x7213('0x39')]['length']?_0x1bc2a8['attributes']:_0x4f1b8b[_0x7213('0x37')];_0x1bc2a8[_0x7213('0x3c')]=qs['sort'](_0x1ed85e[_0x7213('0x34')][_0x7213('0x3d')]);_0x1bc2a8[_0x7213('0x3e')]=qs['filters'](_['pick'](_0x1ed85e['query'],_0x4f1b8b[_0x7213('0x36')]));if(_0x1ed85e[_0x7213('0x34')][_0x7213('0x40')]){_0x1bc2a8['where']=_[_0x7213('0x41')](_0x1bc2a8['where'],{'$or':_[_0x7213('0x2e')](_0x1bc2a8[_0x7213('0x39')],function(_0x34be36){var _0x1c0b88={};_0x1c0b88[_0x34be36]={'$like':'%'+_0x1ed85e[_0x7213('0x34')][_0x7213('0x40')]+'%'};return _0x1c0b88;})});}_0x1bc2a8=_[_0x7213('0x41')]({},_0x1bc2a8,_0x1ed85e[_0x7213('0x42')]);return _0x3d008b[_0x7213('0x89')](_0x1bc2a8);}})[_0x7213('0x26')](function(_0x375ae7){if(_0x375ae7){_0x31c43f=_0x375ae7[_0x7213('0x3a')];if(!_0x1ed85e[_0x7213('0x34')][_0x7213('0x3b')]('nolimit')){_0x1bc2a8[_0x7213('0x21')]=qs[_0x7213('0x21')](_0x1ed85e[_0x7213('0x34')][_0x7213('0x21')]);_0x1bc2a8[_0x7213('0x1f')]=qs[_0x7213('0x1f')](_0x1ed85e[_0x7213('0x34')][_0x7213('0x1f')]);}return _0x3d008b[_0x7213('0x89')](_0x1bc2a8);}})[_0x7213('0x26')](function(_0x505c06){if(_0x505c06){return _0x505c06?{'count':_0x31c43f,'rows':_0x505c06}:null;}})[_0x7213('0x26')](respondWithResult(_0x51865c,null))[_0x7213('0x45')](handleError(_0x51865c,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index caf5737..41d421e 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 _0x66b6=['events','../../mysqldb','MailQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x5679e5,_0x4e45c9){var _0x34a94=function(_0xda168c){while(--_0xda168c){_0x5679e5['push'](_0x5679e5['shift']());}};_0x34a94(++_0x4e45c9);}(_0x66b6,0xa5));var _0x666b=function(_0x10d670,_0x178996){_0x10d670=_0x10d670-0x0;var _0x20d6f8=_0x66b6[_0x10d670];return _0x20d6f8;};'use strict';var EventEmitter=require(_0x666b('0x0'));var MailQueue=require(_0x666b('0x1'))['db'][_0x666b('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x666b('0x3')](0x0);var events={'afterCreate':_0x666b('0x4'),'afterUpdate':_0x666b('0x5'),'afterDestroy':_0x666b('0x6')};function emitEvent(_0x2dda05){return function(_0x3f9e52,_0x3e1bf5,_0x5e1a29){MailQueueEvents[_0x666b('0x7')](_0x2dda05+':'+_0x3f9e52['id'],_0x3f9e52);MailQueueEvents[_0x666b('0x7')](_0x2dda05,_0x3f9e52);_0x5e1a29(null);};}for(var e in events){if(events[_0x666b('0x8')](e)){var event=events[e];MailQueue[_0x666b('0x9')](e,emitEvent(event));}}module[_0x666b('0xa')]=MailQueueEvents; \ No newline at end of file +var _0x25a8=['remove','emit','hasOwnProperty','hook','../../mysqldb','MailQueue','setMaxListeners','save','update'];(function(_0x5a41e9,_0x545f66){var _0x209919=function(_0x48f915){while(--_0x48f915){_0x5a41e9['push'](_0x5a41e9['shift']());}};_0x209919(++_0x545f66);}(_0x25a8,0x82));var _0x825a=function(_0x283f5d,_0x3458d2){_0x283f5d=_0x283f5d-0x0;var _0x1d698e=_0x25a8[_0x283f5d];return _0x1d698e;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x825a('0x0'))['db'][_0x825a('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x825a('0x2')](0x0);var events={'afterCreate':_0x825a('0x3'),'afterUpdate':_0x825a('0x4'),'afterDestroy':_0x825a('0x5')};function emitEvent(_0x1b9c33){return function(_0x205a4c,_0x114051,_0x674f7c){MailQueueEvents[_0x825a('0x6')](_0x1b9c33+':'+_0x205a4c['id'],_0x205a4c);MailQueueEvents[_0x825a('0x6')](_0x1b9c33,_0x205a4c);_0x674f7c(null);};}for(var e in events){if(events[_0x825a('0x7')](e)){var event=events[e];MailQueue[_0x825a('0x8')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 667d1c5..003ddf0 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 _0xfbbe=['./mailQueue.attributes','define','MailQueue','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x2ed7d1,_0x363741){var _0x38ae3c=function(_0x4a1b42){while(--_0x4a1b42){_0x2ed7d1['push'](_0x2ed7d1['shift']());}};_0x38ae3c(++_0x363741);}(_0xfbbe,0x1d9));var _0xefbb=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0xfbbe[_0x29d94e];return _0x106237;};'use strict';var _=require('lodash');var util=require(_0xefbb('0x0'));var logger=require(_0xefbb('0x1'))(_0xefbb('0x2'));var moment=require('moment');var BPromise=require(_0xefbb('0x3'));var rp=require(_0xefbb('0x4'));var fs=require('fs');var path=require(_0xefbb('0x5'));var rimraf=require('rimraf');var config=require(_0xefbb('0x6'));var attributes=require(_0xefbb('0x7'));module['exports']=function(_0x296afc,_0x7d5b43){return _0x296afc[_0xefbb('0x8')](_0xefbb('0x9'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xceb9=['api','moment','bluebird','path','rimraf','../../config/environment','./mailQueue.attributes','exports','define','mail_queues','lodash','util'];(function(_0x490f1a,_0x4a69ad){var _0x388e32=function(_0x18f37a){while(--_0x18f37a){_0x490f1a['push'](_0x490f1a['shift']());}};_0x388e32(++_0x4a69ad);}(_0xceb9,0x17e));var _0x9ceb=function(_0x50988c,_0x1d472e){_0x50988c=_0x50988c-0x0;var _0x5f3e12=_0xceb9[_0x50988c];return _0x5f3e12;};'use strict';var _=require(_0x9ceb('0x0'));var util=require(_0x9ceb('0x1'));var logger=require('../../config/logger')(_0x9ceb('0x2'));var moment=require(_0x9ceb('0x3'));var BPromise=require(_0x9ceb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9ceb('0x5'));var rimraf=require(_0x9ceb('0x6'));var config=require(_0x9ceb('0x7'));var attributes=require(_0x9ceb('0x8'));module[_0x9ceb('0x9')]=function(_0x14cf3a,_0x59e57e){return _0x14cf3a[_0x9ceb('0xa')]('MailQueue',attributes,{'tableName':_0x9ceb('0xb'),'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 6904fbb..2fb57f8 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 _0xcb06=['then','info','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','GetMailQueue','MailQueue','findAll','options','where','attributes','include','map','model','find','ShowMailQueue','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./mailQueue.socket','register'];(function(_0x3c64a5,_0x952b9){var _0x2d72c7=function(_0x276aac){while(--_0x276aac){_0x3c64a5['push'](_0x3c64a5['shift']());}};_0x2d72c7(++_0x952b9);}(_0xcb06,0x145));var _0x6cb0=function(_0x2287df,_0x5a4a24){_0x2287df=_0x2287df-0x0;var _0x2afbc1=_0xcb06[_0x2287df];return _0x2afbc1;};'use strict';var _=require(_0x6cb0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6cb0('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6cb0('0x2'));var db=require(_0x6cb0('0x3'))['db'];var utils=require(_0x6cb0('0x4'));var logger=require(_0x6cb0('0x5'))(_0x6cb0('0x6'));var config=require(_0x6cb0('0x7'));var jayson=require(_0x6cb0('0x8'));var client=jayson[_0x6cb0('0x9')][_0x6cb0('0xa')]({'port':0x232a});config['redis']=_[_0x6cb0('0xb')](config[_0x6cb0('0xc')],{'host':_0x6cb0('0xd'),'port':0x18eb});var socket=require(_0x6cb0('0xe'))(new Redis(config[_0x6cb0('0xc')]));require(_0x6cb0('0xf'))[_0x6cb0('0x10')](socket);function respondWithRpcPromise(_0x1d09e6,_0x5d7ab2,_0x5d4d02){return new BPromise(function(_0x4404e7,_0x3bf36a){return client['request'](_0x1d09e6,_0x5d4d02)[_0x6cb0('0x11')](function(_0x208dd4){logger[_0x6cb0('0x12')]('MailQueue,\x20%s,\x20%s',_0x5d7ab2,_0x6cb0('0x13'));logger[_0x6cb0('0x14')](_0x6cb0('0x15'),_0x5d7ab2,'request\x20sent',JSON[_0x6cb0('0x16')](_0x208dd4));if(_0x208dd4['error']){if(_0x208dd4['error'][_0x6cb0('0x17')]===0x1f4){logger[_0x6cb0('0x18')]('MailQueue,\x20%s,\x20%s',_0x5d7ab2,_0x208dd4['error']['message']);return _0x3bf36a(_0x208dd4[_0x6cb0('0x18')][_0x6cb0('0x19')]);}logger[_0x6cb0('0x18')]('MailQueue,\x20%s,\x20%s',_0x5d7ab2,_0x208dd4[_0x6cb0('0x18')][_0x6cb0('0x19')]);return _0x4404e7(_0x208dd4[_0x6cb0('0x18')][_0x6cb0('0x19')]);}else{logger['info']('MailQueue,\x20%s,\x20%s',_0x5d7ab2,_0x6cb0('0x13'));_0x4404e7(_0x208dd4['result'][_0x6cb0('0x19')]);}})[_0x6cb0('0x1a')](function(_0x2f6265){logger[_0x6cb0('0x18')]('MailQueue,\x20%s,\x20%s',_0x5d7ab2,_0x2f6265);_0x3bf36a(_0x2f6265);});});}exports[_0x6cb0('0x1b')]=function(_0x11b5c5){var _0xdb1334=this;return new Promise(function(_0x56bad4,_0x1aba81){return db[_0x6cb0('0x1c')][_0x6cb0('0x1d')]({'raw':_0x11b5c5['options']?_0x11b5c5[_0x6cb0('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x11b5c5[_0x6cb0('0x1e')]?_0x11b5c5['options'][_0x6cb0('0x1f')]||null:null,'attributes':_0x11b5c5[_0x6cb0('0x1e')]?_0x11b5c5[_0x6cb0('0x1e')][_0x6cb0('0x20')]||null:null,'limit':_0x11b5c5[_0x6cb0('0x1e')]?_0x11b5c5[_0x6cb0('0x1e')]['limit']||null:null,'include':_0x11b5c5[_0x6cb0('0x1e')]?_0x11b5c5[_0x6cb0('0x1e')][_0x6cb0('0x21')]?_[_0x6cb0('0x22')](_0x11b5c5[_0x6cb0('0x1e')]['include'],function(_0x15289d){return{'model':db[_0x15289d[_0x6cb0('0x23')]],'as':_0x15289d['as'],'attributes':_0x15289d[_0x6cb0('0x20')],'include':_0x15289d[_0x6cb0('0x21')]?_[_0x6cb0('0x22')](_0x15289d[_0x6cb0('0x21')],function(_0x3c640c){return{'model':db[_0x3c640c['model']],'as':_0x3c640c['as'],'attributes':_0x3c640c['attributes'],'include':_0x3c640c[_0x6cb0('0x21')]?_[_0x6cb0('0x22')](_0x3c640c['include'],function(_0x4037e3){return{'model':db[_0x4037e3[_0x6cb0('0x23')]],'as':_0x4037e3['as'],'attributes':_0x4037e3[_0x6cb0('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x100243){logger[_0x6cb0('0x12')](_0x6cb0('0x1b'),_0x11b5c5);logger[_0x6cb0('0x14')](_0x6cb0('0x1b'),_0x11b5c5,JSON['stringify'](_0x100243));_0x56bad4(_0x100243);})[_0x6cb0('0x1a')](function(_0x329fe4){logger[_0x6cb0('0x18')](_0x6cb0('0x1b'),_0x329fe4['message'],_0x11b5c5);_0x1aba81(_0xdb1334[_0x6cb0('0x18')](0x1f4,_0x329fe4[_0x6cb0('0x19')]));});});};exports['ShowMailQueue']=function(_0x17094e){var _0x45f8e3=this;return new Promise(function(_0x590cb5,_0x353dcc){return db['MailQueue'][_0x6cb0('0x24')]({'raw':_0x17094e[_0x6cb0('0x1e')]?_0x17094e[_0x6cb0('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x17094e[_0x6cb0('0x1e')]?_0x17094e[_0x6cb0('0x1e')]['where']||null:null,'attributes':_0x17094e['options']?_0x17094e[_0x6cb0('0x1e')][_0x6cb0('0x20')]||null:null,'include':_0x17094e[_0x6cb0('0x1e')]?_0x17094e['options']['include']?_[_0x6cb0('0x22')](_0x17094e[_0x6cb0('0x1e')][_0x6cb0('0x21')],function(_0x13315b){return{'model':db[_0x13315b['model']],'as':_0x13315b['as'],'attributes':_0x13315b[_0x6cb0('0x20')],'include':_0x13315b['include']?_['map'](_0x13315b[_0x6cb0('0x21')],function(_0x19de75){return{'model':db[_0x19de75[_0x6cb0('0x23')]],'as':_0x19de75['as'],'attributes':_0x19de75['attributes'],'include':_0x19de75[_0x6cb0('0x21')]?_[_0x6cb0('0x22')](_0x19de75[_0x6cb0('0x21')],function(_0x167333){return{'model':db[_0x167333['model']],'as':_0x167333['as'],'attributes':_0x167333[_0x6cb0('0x20')]};}):[]};}):[]};}):[]:[]})[_0x6cb0('0x11')](function(_0x30daf7){logger[_0x6cb0('0x12')](_0x6cb0('0x25'),_0x17094e);logger[_0x6cb0('0x14')](_0x6cb0('0x25'),_0x17094e,JSON['stringify'](_0x30daf7));_0x590cb5(_0x30daf7);})[_0x6cb0('0x1a')](function(_0x52ccd0){logger[_0x6cb0('0x18')](_0x6cb0('0x25'),_0x52ccd0[_0x6cb0('0x19')],_0x17094e);_0x353dcc(_0x45f8e3[_0x6cb0('0x18')](0x1f4,_0x52ccd0['message']));});});}; \ No newline at end of file +var _0x750a=['register','then','info','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','MailQueue','options','where','limit','include','map','model','attributes','GetMailQueue','stringify','ShowMailQueue','find','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x270606,_0x1d96c9){var _0x417d34=function(_0x1b2d0d){while(--_0x1b2d0d){_0x270606['push'](_0x270606['shift']());}};_0x417d34(++_0x1d96c9);}(_0x750a,0x140));var _0xa750=function(_0x30fbc4,_0x48a6b0){_0x30fbc4=_0x30fbc4-0x0;var _0x3a85d3=_0x750a[_0x30fbc4];return _0x3a85d3;};'use strict';var _=require('lodash');var util=require(_0xa750('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa750('0x1'));var fs=require('fs');var Redis=require(_0xa750('0x2'));var db=require(_0xa750('0x3'))['db'];var utils=require(_0xa750('0x4'));var logger=require(_0xa750('0x5'))(_0xa750('0x6'));var config=require(_0xa750('0x7'));var jayson=require(_0xa750('0x8'));var client=jayson[_0xa750('0x9')][_0xa750('0xa')]({'port':0x232a});config[_0xa750('0xb')]=_[_0xa750('0xc')](config[_0xa750('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa750('0xb')]));require('./mailQueue.socket')[_0xa750('0xd')](socket);function respondWithRpcPromise(_0x1760f5,_0x51f594,_0x264284){return new BPromise(function(_0x2c2ea4,_0x5870f0){return client['request'](_0x1760f5,_0x264284)[_0xa750('0xe')](function(_0x4b19a1){logger[_0xa750('0xf')](_0xa750('0x10'),_0x51f594,'request\x20sent');logger[_0xa750('0x11')](_0xa750('0x12'),_0x51f594,_0xa750('0x13'),JSON['stringify'](_0x4b19a1));if(_0x4b19a1[_0xa750('0x14')]){if(_0x4b19a1[_0xa750('0x14')][_0xa750('0x15')]===0x1f4){logger[_0xa750('0x14')](_0xa750('0x10'),_0x51f594,_0x4b19a1[_0xa750('0x14')]['message']);return _0x5870f0(_0x4b19a1[_0xa750('0x14')][_0xa750('0x16')]);}logger[_0xa750('0x14')]('MailQueue,\x20%s,\x20%s',_0x51f594,_0x4b19a1[_0xa750('0x14')][_0xa750('0x16')]);return _0x2c2ea4(_0x4b19a1['error']['message']);}else{logger[_0xa750('0xf')]('MailQueue,\x20%s,\x20%s',_0x51f594,_0xa750('0x13'));_0x2c2ea4(_0x4b19a1[_0xa750('0x17')]['message']);}})[_0xa750('0x18')](function(_0x500a84){logger['error'](_0xa750('0x10'),_0x51f594,_0x500a84);_0x5870f0(_0x500a84);});});}exports['GetMailQueue']=function(_0x3fa031){var _0x4f170f=this;return new Promise(function(_0x174a8c,_0x4a007d){return db[_0xa750('0x19')]['findAll']({'raw':_0x3fa031[_0xa750('0x1a')]?_0x3fa031['options']['raw']===undefined?!![]:![]:!![],'where':_0x3fa031[_0xa750('0x1a')]?_0x3fa031['options'][_0xa750('0x1b')]||null:null,'attributes':_0x3fa031['options']?_0x3fa031['options']['attributes']||null:null,'limit':_0x3fa031['options']?_0x3fa031[_0xa750('0x1a')][_0xa750('0x1c')]||null:null,'include':_0x3fa031[_0xa750('0x1a')]?_0x3fa031[_0xa750('0x1a')][_0xa750('0x1d')]?_[_0xa750('0x1e')](_0x3fa031[_0xa750('0x1a')][_0xa750('0x1d')],function(_0x3d52b3){return{'model':db[_0x3d52b3[_0xa750('0x1f')]],'as':_0x3d52b3['as'],'attributes':_0x3d52b3[_0xa750('0x20')],'include':_0x3d52b3[_0xa750('0x1d')]?_[_0xa750('0x1e')](_0x3d52b3[_0xa750('0x1d')],function(_0x310e2d){return{'model':db[_0x310e2d['model']],'as':_0x310e2d['as'],'attributes':_0x310e2d[_0xa750('0x20')],'include':_0x310e2d[_0xa750('0x1d')]?_[_0xa750('0x1e')](_0x310e2d['include'],function(_0x35ab53){return{'model':db[_0x35ab53[_0xa750('0x1f')]],'as':_0x35ab53['as'],'attributes':_0x35ab53[_0xa750('0x20')]};}):[]};}):[]};}):[]:[]})[_0xa750('0xe')](function(_0x579f1c){logger[_0xa750('0xf')](_0xa750('0x21'),_0x3fa031);logger[_0xa750('0x11')](_0xa750('0x21'),_0x3fa031,JSON[_0xa750('0x22')](_0x579f1c));_0x174a8c(_0x579f1c);})['catch'](function(_0x46cc11){logger['error'](_0xa750('0x21'),_0x46cc11[_0xa750('0x16')],_0x3fa031);_0x4a007d(_0x4f170f['error'](0x1f4,_0x46cc11[_0xa750('0x16')]));});});};exports[_0xa750('0x23')]=function(_0x5e66fd){var _0x314f88=this;return new Promise(function(_0xbf5164,_0xe59fe7){return db[_0xa750('0x19')][_0xa750('0x24')]({'raw':_0x5e66fd['options']?_0x5e66fd[_0xa750('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x5e66fd[_0xa750('0x1a')]?_0x5e66fd[_0xa750('0x1a')][_0xa750('0x1b')]||null:null,'attributes':_0x5e66fd[_0xa750('0x1a')]?_0x5e66fd['options'][_0xa750('0x20')]||null:null,'include':_0x5e66fd[_0xa750('0x1a')]?_0x5e66fd['options'][_0xa750('0x1d')]?_[_0xa750('0x1e')](_0x5e66fd[_0xa750('0x1a')][_0xa750('0x1d')],function(_0x4b13fc){return{'model':db[_0x4b13fc[_0xa750('0x1f')]],'as':_0x4b13fc['as'],'attributes':_0x4b13fc['attributes'],'include':_0x4b13fc['include']?_[_0xa750('0x1e')](_0x4b13fc[_0xa750('0x1d')],function(_0xaa626c){return{'model':db[_0xaa626c['model']],'as':_0xaa626c['as'],'attributes':_0xaa626c[_0xa750('0x20')],'include':_0xaa626c[_0xa750('0x1d')]?_[_0xa750('0x1e')](_0xaa626c['include'],function(_0x37abd2){return{'model':db[_0x37abd2[_0xa750('0x1f')]],'as':_0x37abd2['as'],'attributes':_0x37abd2[_0xa750('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1d09fb){logger[_0xa750('0xf')](_0xa750('0x23'),_0x5e66fd);logger['debug'](_0xa750('0x23'),_0x5e66fd,JSON[_0xa750('0x22')](_0x1d09fb));_0xbf5164(_0x1d09fb);})[_0xa750('0x18')](function(_0x10589b){logger['error']('ShowMailQueue',_0x10589b[_0xa750('0x16')],_0x5e66fd);_0xe59fe7(_0x314f88[_0xa750('0x14')](0x1f4,_0x10589b['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index e4e117c..17d9007 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 _0x00c2=['removeListener','register','length','mailQueue:','save','remove','update'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x00c2,0x146));var _0x200c=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x00c2[_0x3947c9];return _0x2e7871;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x200c('0x0'),_0x200c('0x1'),_0x200c('0x2')];function createListener(_0x2c81ee,_0x22a6e6){return function(_0xb83488){_0x22a6e6['emit'](_0x2c81ee,_0xb83488);};}function removeListener(_0x227a3d,_0x33f431){return function(){MailQueueEvents[_0x200c('0x3')](_0x227a3d,_0x33f431);};}exports[_0x200c('0x4')]=function(_0x22f160){for(var _0x26afdd=0x0,_0x238989=events[_0x200c('0x5')];_0x26afdd<_0x238989;_0x26afdd++){var _0x50ec2c=events[_0x26afdd];var _0x2af741=createListener(_0x200c('0x6')+_0x50ec2c,_0x22f160);MailQueueEvents['on'](_0x50ec2c,_0x2af741);}}; \ No newline at end of file +var _0x7f8c=['remove','update','emit','removeListener','register','length','mailQueue:','./mailQueue.events','save'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0x7f8c,0x139));var _0xc7f8=function(_0x1490f2,_0x293844){_0x1490f2=_0x1490f2-0x0;var _0x2cdf24=_0x7f8c[_0x1490f2];return _0x2cdf24;};'use strict';var MailQueueEvents=require(_0xc7f8('0x0'));var events=[_0xc7f8('0x1'),_0xc7f8('0x2'),_0xc7f8('0x3')];function createListener(_0x2068fb,_0x3371d1){return function(_0x1e15e4){_0x3371d1[_0xc7f8('0x4')](_0x2068fb,_0x1e15e4);};}function removeListener(_0x24730d,_0x52563b){return function(){MailQueueEvents[_0xc7f8('0x5')](_0x24730d,_0x52563b);};}exports[_0xc7f8('0x6')]=function(_0x1a3046){for(var _0x4241e4=0x0,_0x2e747c=events[_0xc7f8('0x7')];_0x4241e4<_0x2e747c;_0x4241e4++){var _0x289b0c=events[_0x4241e4];var _0x504ac1=createListener(_0xc7f8('0x8')+_0x289b0c,_0x1a3046);MailQueueEvents['on'](_0x289b0c,_0x504ac1);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 60d8bea..d0d667c 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 _0x9d4c=['update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','create','put'];(function(_0x27db12,_0x50d733){var _0x61b0e1=function(_0x11e8f4){while(--_0x11e8f4){_0x27db12['push'](_0x27db12['shift']());}};_0x61b0e1(++_0x50d733);}(_0x9d4c,0x180));var _0xc9d4=function(_0x4c39f5,_0x109684){_0x4c39f5=_0x4c39f5-0x0;var _0x1db24f=_0x9d4c[_0x4c39f5];return _0x1db24f;};'use strict';var multer=require('multer');var util=require(_0xc9d4('0x0'));var path=require(_0xc9d4('0x1'));var timeout=require(_0xc9d4('0x2'));var express=require(_0xc9d4('0x3'));var router=express[_0xc9d4('0x4')]();var fs_extra=require(_0xc9d4('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc9d4('0x6'));var controller=require(_0xc9d4('0x7'));router[_0xc9d4('0x8')]('/',auth[_0xc9d4('0x9')](),controller[_0xc9d4('0xa')]);router[_0xc9d4('0x8')]('/describe',auth[_0xc9d4('0x9')](),controller[_0xc9d4('0xb')]);router['get'](_0xc9d4('0xc'),auth[_0xc9d4('0x9')](),controller[_0xc9d4('0xd')]);router['post']('/',auth[_0xc9d4('0x9')](),controller[_0xc9d4('0xe')]);router[_0xc9d4('0xf')](_0xc9d4('0xc'),auth[_0xc9d4('0x9')](),controller[_0xc9d4('0x10')]);router[_0xc9d4('0x11')]('/:id',auth[_0xc9d4('0x9')](),controller[_0xc9d4('0x12')]);module[_0xc9d4('0x13')]=router; \ No newline at end of file +var _0x84b8=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','/:id','show','post','create','update','exports','multer','util'];(function(_0x2a0dc9,_0x3802f4){var _0x198be1=function(_0x154add){while(--_0x154add){_0x2a0dc9['push'](_0x2a0dc9['shift']());}};_0x198be1(++_0x3802f4);}(_0x84b8,0x6a));var _0x884b=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x84b8[_0x28947d];return _0x12d2ee;};'use strict';var multer=require(_0x884b('0x0'));var util=require(_0x884b('0x1'));var path=require(_0x884b('0x2'));var timeout=require(_0x884b('0x3'));var express=require('express');var router=express[_0x884b('0x4')]();var fs_extra=require(_0x884b('0x5'));var auth=require(_0x884b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x884b('0x7'));var controller=require('./mailQueueReport.controller');router[_0x884b('0x8')]('/',auth['isAuthenticated'](),controller[_0x884b('0x9')]);router[_0x884b('0x8')](_0x884b('0xa'),auth[_0x884b('0xb')](),controller['describe']);router[_0x884b('0x8')](_0x884b('0xc'),auth[_0x884b('0xb')](),controller[_0x884b('0xd')]);router[_0x884b('0xe')]('/',auth['isAuthenticated'](),controller[_0x884b('0xf')]);router['put'](_0x884b('0xc'),auth['isAuthenticated'](),controller[_0x884b('0x10')]);router['delete'](_0x884b('0xc'),auth[_0x884b('0xb')](),controller['destroy']);module[_0x884b('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index aae5cc6..a51ba6a 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 _0x629f=['STRING','DATE','moment','sequelize','exports'];(function(_0x5c431d,_0x303e10){var _0x2e5734=function(_0x56368d){while(--_0x56368d){_0x5c431d['push'](_0x5c431d['shift']());}};_0x2e5734(++_0x303e10);}(_0x629f,0x174));var _0xf629=function(_0x4dab14,_0x164ea0){_0x4dab14=_0x4dab14-0x0;var _0xf41aa=_0x629f[_0x4dab14];return _0xf41aa;};'use strict';var moment=require(_0xf629('0x0'));var Sequelize=require(_0xf629('0x1'));module[_0xf629('0x2')]={'uniqueid':{'type':Sequelize[_0xf629('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xf629('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xf629('0x4')]},'acceptAt':{'type':Sequelize[_0xf629('0x4')]},'exitAt':{'type':Sequelize[_0xf629('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8e14=['DATE','moment','sequelize','exports','STRING'];(function(_0x39d28a,_0x2eb058){var _0x43d157=function(_0x27ef24){while(--_0x27ef24){_0x39d28a['push'](_0x39d28a['shift']());}};_0x43d157(++_0x2eb058);}(_0x8e14,0x1c8));var _0x48e1=function(_0x5781e1,_0x5beede){_0x5781e1=_0x5781e1-0x0;var _0x131b3c=_0x8e14[_0x5781e1];return _0x131b3c;};'use strict';var moment=require(_0x48e1('0x0'));var Sequelize=require(_0x48e1('0x1'));module[_0x48e1('0x2')]={'uniqueid':{'type':Sequelize[_0x48e1('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x48e1('0x3')]},'joinAt':{'type':Sequelize[_0x48e1('0x4')]},'leaveAt':{'type':Sequelize[_0x48e1('0x4')]},'acceptAt':{'type':Sequelize[_0x48e1('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x48e1('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 7a39286..d00bb9f 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 _0x5464=['undefined','limit','count','set','Content-Range','json','reject','update','then','end','sendStatus','stack','name','send','index','rawAttributes','fieldName','type','map','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','MailQueueReport','findAll','rows','catch','show','params','keys','includeAll','include','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','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','status','offset'];(function(_0x10f0a3,_0x36ff9c){var _0xedc51c=function(_0x547f49){while(--_0x547f49){_0x10f0a3['push'](_0x10f0a3['shift']());}};_0xedc51c(++_0x36ff9c);}(_0x5464,0x15d));var _0x4546=function(_0x2315cf,_0x5cd52a){_0x2315cf=_0x2315cf-0x0;var _0x5b3d2f=_0x5464[_0x2315cf];return _0x5b3d2f;};'use strict';var emlformat=require(_0x4546('0x0'));var rimraf=require(_0x4546('0x1'));var zipdir=require(_0x4546('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4546('0x3'));var moment=require('moment');var BPromise=require(_0x4546('0x4'));var Mustache=require('mustache');var util=require(_0x4546('0x5'));var path=require(_0x4546('0x6'));var sox=require(_0x4546('0x7'));var csv=require(_0x4546('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4546('0x9'));var crypto=require(_0x4546('0xa'));var jsforce=require(_0x4546('0xb'));var deskjs=require(_0x4546('0xc'));var toCsv=require(_0x4546('0x8'));var querystring=require(_0x4546('0xd'));var Papa=require(_0x4546('0xe'));var Redis=require(_0x4546('0xf'));var authService=require(_0x4546('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4546('0x11'));var hardwareService=require(_0x4546('0x12'));var logger=require(_0x4546('0x13'))('api');var utils=require(_0x4546('0x14'));var config=require(_0x4546('0x15'));var licenseUtil=require(_0x4546('0x16'));var db=require(_0x4546('0x17'))['db'];function respondWithStatusCode(_0x4d31a7,_0x4f2641){_0x4f2641=_0x4f2641||0xcc;return function(_0x3e6622){if(_0x3e6622){return _0x4d31a7['sendStatus'](_0x4f2641);}return _0x4d31a7['status'](_0x4f2641)['end']();};}function respondWithResult(_0x5b64b7,_0x598516){_0x598516=_0x598516||0xc8;return function(_0x4f5571){if(_0x4f5571){return _0x5b64b7[_0x4546('0x18')](_0x598516)['json'](_0x4f5571);}};}function respondWithFilteredResult(_0x363a17,_0x54581c){return function(_0x26fc0e){if(_0x26fc0e){var _0x564f3e=typeof _0x54581c[_0x4546('0x19')]===_0x4546('0x1a')&&typeof _0x54581c[_0x4546('0x1b')]===_0x4546('0x1a');var _0x2a294b=_0x26fc0e[_0x4546('0x1c')];var _0x57d8de=_0x564f3e?0x0:_0x54581c['offset'];var _0x5780a7=_0x564f3e?_0x26fc0e[_0x4546('0x1c')]:_0x54581c[_0x4546('0x19')]+_0x54581c[_0x4546('0x1b')];var _0x3d95c2;if(_0x5780a7>=_0x2a294b){_0x5780a7=_0x2a294b;_0x3d95c2=0xc8;}else{_0x3d95c2=0xce;}_0x363a17[_0x4546('0x18')](_0x3d95c2);return _0x363a17[_0x4546('0x1d')](_0x4546('0x1e'),_0x57d8de+'-'+_0x5780a7+'/'+_0x2a294b)[_0x4546('0x1f')](_0x26fc0e);}return null;};}function patchUpdates(_0x4034a5){return function(_0xceb1d6){try{jsonpatch['apply'](_0xceb1d6,_0x4034a5,!![]);}catch(_0x2d689f){return BPromise[_0x4546('0x20')](_0x2d689f);}return _0xceb1d6['save']();};}function saveUpdates(_0x3067ab,_0x437f55){return function(_0x1a1984){if(_0x1a1984){return _0x1a1984[_0x4546('0x21')](_0x3067ab)[_0x4546('0x22')](function(_0x15b013){return _0x15b013;});}return null;};}function removeEntity(_0x53e402,_0x3dab5c){return function(_0x2cca8b){if(_0x2cca8b){return _0x2cca8b['destroy']()[_0x4546('0x22')](function(){_0x53e402[_0x4546('0x18')](0xcc)[_0x4546('0x23')]();});}};}function handleEntityNotFound(_0x4467ee,_0x23084b){return function(_0x53ae5e){if(!_0x53ae5e){_0x4467ee[_0x4546('0x24')](0x194);}return _0x53ae5e;};}function handleError(_0x3796fe,_0x831fa5){_0x831fa5=_0x831fa5||0x1f4;return function(_0x48fc36){logger['error'](_0x48fc36[_0x4546('0x25')]);if(_0x48fc36[_0x4546('0x26')]){delete _0x48fc36[_0x4546('0x26')];}_0x3796fe[_0x4546('0x18')](_0x831fa5)[_0x4546('0x27')](_0x48fc36);};}exports[_0x4546('0x28')]=function(_0xcea7da,_0x586ff1){var _0x367b23={},_0x52c546={},_0x3a2d12={'count':0x0,'rows':[]};var _0x161815=_['map'](db['MailQueueReport'][_0x4546('0x29')],function(_0x5af997){return{'name':_0x5af997[_0x4546('0x2a')],'type':_0x5af997[_0x4546('0x2b')]['key']};});_0x52c546['model']=_[_0x4546('0x2c')](_0x161815,_0x4546('0x26'));_0x52c546[_0x4546('0x2d')]=_['keys'](_0xcea7da[_0x4546('0x2d')]);_0x52c546[_0x4546('0x2e')]=_['intersection'](_0x52c546[_0x4546('0x2f')],_0x52c546['query']);_0x367b23[_0x4546('0x30')]=_[_0x4546('0x31')](_0x52c546[_0x4546('0x2f')],qs[_0x4546('0x32')](_0xcea7da['query'][_0x4546('0x32')]));_0x367b23[_0x4546('0x30')]=_0x367b23[_0x4546('0x30')][_0x4546('0x33')]?_0x367b23[_0x4546('0x30')]:_0x52c546[_0x4546('0x2f')];if(!_0xcea7da['query'][_0x4546('0x34')](_0x4546('0x35'))){_0x367b23['limit']=qs['limit'](_0xcea7da[_0x4546('0x2d')][_0x4546('0x1b')]);_0x367b23['offset']=qs[_0x4546('0x19')](_0xcea7da[_0x4546('0x2d')]['offset']);}_0x367b23['order']=qs[_0x4546('0x36')](_0xcea7da[_0x4546('0x2d')][_0x4546('0x36')]);_0x367b23[_0x4546('0x37')]=qs[_0x4546('0x2e')](_[_0x4546('0x38')](_0xcea7da['query'],_0x52c546[_0x4546('0x2e')]),_0x161815);if(_0xcea7da[_0x4546('0x2d')]['filter']){_0x367b23[_0x4546('0x37')]=_['merge'](_0x367b23[_0x4546('0x37')],{'$or':_[_0x4546('0x2c')](_0x161815,function(_0x53683e){if(_0x53683e['type']!==_0x4546('0x39')){var _0x453593={};_0x453593[_0x53683e[_0x4546('0x26')]]={'$like':'%'+_0xcea7da['query'][_0x4546('0x3a')]+'%'};return _0x453593;}})});}_0x367b23=_[_0x4546('0x3b')]({},_0x367b23,_0xcea7da[_0x4546('0x3c')]);var _0x1f815e={'where':_0x367b23[_0x4546('0x37')]};return db[_0x4546('0x3d')][_0x4546('0x1c')](_0x1f815e)[_0x4546('0x22')](function(_0x4b67d4){_0x3a2d12[_0x4546('0x1c')]=_0x4b67d4;if(_0xcea7da[_0x4546('0x2d')]['includeAll']){_0x367b23['include']=[{'all':!![]}];}return db[_0x4546('0x3d')][_0x4546('0x3e')](_0x367b23);})[_0x4546('0x22')](function(_0x1ea5c4){_0x3a2d12[_0x4546('0x3f')]=_0x1ea5c4;return _0x3a2d12;})['then'](respondWithFilteredResult(_0x586ff1,_0x367b23))[_0x4546('0x40')](handleError(_0x586ff1,null));};exports[_0x4546('0x41')]=function(_0x1060d1,_0x185b76){var _0x236fc0={'raw':!![],'where':{'id':_0x1060d1[_0x4546('0x42')]['id']}},_0x3fabf0={};_0x3fabf0[_0x4546('0x2f')]=_[_0x4546('0x43')](db['MailQueueReport'][_0x4546('0x29')]);_0x3fabf0[_0x4546('0x2d')]=_[_0x4546('0x43')](_0x1060d1[_0x4546('0x2d')]);_0x3fabf0[_0x4546('0x2e')]=_[_0x4546('0x31')](_0x3fabf0[_0x4546('0x2f')],_0x3fabf0[_0x4546('0x2d')]);_0x236fc0[_0x4546('0x30')]=_[_0x4546('0x31')](_0x3fabf0[_0x4546('0x2f')],qs['fields'](_0x1060d1[_0x4546('0x2d')][_0x4546('0x32')]));_0x236fc0['attributes']=_0x236fc0[_0x4546('0x30')][_0x4546('0x33')]?_0x236fc0[_0x4546('0x30')]:_0x3fabf0['model'];if(_0x1060d1[_0x4546('0x2d')][_0x4546('0x44')]){_0x236fc0[_0x4546('0x45')]=[{'all':!![]}];}_0x236fc0=_[_0x4546('0x3b')]({},_0x236fc0,_0x1060d1[_0x4546('0x3c')]);return db[_0x4546('0x3d')][_0x4546('0x46')](_0x236fc0)[_0x4546('0x22')](handleEntityNotFound(_0x185b76,null))[_0x4546('0x22')](respondWithResult(_0x185b76,null))[_0x4546('0x40')](handleError(_0x185b76,null));};exports['create']=function(_0x395c43,_0x24a637){return db['MailQueueReport'][_0x4546('0x47')](_0x395c43[_0x4546('0x48')],{})[_0x4546('0x22')](respondWithResult(_0x24a637,0xc9))[_0x4546('0x40')](handleError(_0x24a637,null));};exports['update']=function(_0x329566,_0x57bb39){if(_0x329566[_0x4546('0x48')]['id']){delete _0x329566[_0x4546('0x48')]['id'];}return db[_0x4546('0x3d')]['find']({'where':{'id':_0x329566[_0x4546('0x42')]['id']}})[_0x4546('0x22')](handleEntityNotFound(_0x57bb39,null))[_0x4546('0x22')](saveUpdates(_0x329566[_0x4546('0x48')],null))[_0x4546('0x22')](respondWithResult(_0x57bb39,null))[_0x4546('0x40')](handleError(_0x57bb39,null));};exports[_0x4546('0x49')]=function(_0x325181,_0x43f630){return db[_0x4546('0x3d')][_0x4546('0x46')]({'where':{'id':_0x325181['params']['id']}})[_0x4546('0x22')](handleEntityNotFound(_0x43f630,null))[_0x4546('0x22')](removeEntity(_0x43f630,null))['catch'](handleError(_0x43f630,null));};exports[_0x4546('0x4a')]=function(_0xe9e3c1,_0xca0f44){return db['MailQueueReport'][_0x4546('0x4a')]()[_0x4546('0x22')](respondWithResult(_0xca0f44,null))[_0x4546('0x40')](handleError(_0xca0f44,null));}; \ No newline at end of file +var _0xacf4=['findAll','rows','catch','show','params','intersection','length','includeAll','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','MailQueueReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','hasOwnProperty','sort','where','pick','filter','type','VIRTUAL','merge','options','include'];(function(_0x2998db,_0x3424f1){var _0x115fea=function(_0x3b493c){while(--_0x3b493c){_0x2998db['push'](_0x2998db['shift']());}};_0x115fea(++_0x3424f1);}(_0xacf4,0xe7));var _0x4acf=function(_0x652c38,_0x4ec2a3){_0x652c38=_0x652c38-0x0;var _0x31d2fd=_0xacf4[_0x652c38];return _0x31d2fd;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4acf('0x0'));var jsonpatch=require(_0x4acf('0x1'));var rp=require(_0x4acf('0x2'));var moment=require(_0x4acf('0x3'));var BPromise=require(_0x4acf('0x4'));var Mustache=require(_0x4acf('0x5'));var util=require(_0x4acf('0x6'));var path=require('path');var sox=require(_0x4acf('0x7'));var csv=require(_0x4acf('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4acf('0x9'));var _=require(_0x4acf('0xa'));var squel=require(_0x4acf('0xb'));var crypto=require(_0x4acf('0xc'));var jsforce=require(_0x4acf('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4acf('0xe'));var Papa=require('papaparse');var Redis=require(_0x4acf('0xf'));var authService=require(_0x4acf('0x10'));var qs=require(_0x4acf('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4acf('0x12'));var logger=require(_0x4acf('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x4acf('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1783d2,_0x979f49){_0x979f49=_0x979f49||0xcc;return function(_0x3734e1){if(_0x3734e1){return _0x1783d2[_0x4acf('0x15')](_0x979f49);}return _0x1783d2[_0x4acf('0x16')](_0x979f49)[_0x4acf('0x17')]();};}function respondWithResult(_0x7ab3ea,_0x15386a){_0x15386a=_0x15386a||0xc8;return function(_0x2025ca){if(_0x2025ca){return _0x7ab3ea[_0x4acf('0x16')](_0x15386a)[_0x4acf('0x18')](_0x2025ca);}};}function respondWithFilteredResult(_0x5f0260,_0x1b584a){return function(_0x57d8e0){if(_0x57d8e0){var _0x34cec1=typeof _0x1b584a[_0x4acf('0x19')]===_0x4acf('0x1a')&&typeof _0x1b584a['limit']==='undefined';var _0x13d10e=_0x57d8e0[_0x4acf('0x1b')];var _0x240c00=_0x34cec1?0x0:_0x1b584a['offset'];var _0x2a678b=_0x34cec1?_0x57d8e0[_0x4acf('0x1b')]:_0x1b584a[_0x4acf('0x19')]+_0x1b584a[_0x4acf('0x1c')];var _0x2f0cec;if(_0x2a678b>=_0x13d10e){_0x2a678b=_0x13d10e;_0x2f0cec=0xc8;}else{_0x2f0cec=0xce;}_0x5f0260[_0x4acf('0x16')](_0x2f0cec);return _0x5f0260[_0x4acf('0x1d')](_0x4acf('0x1e'),_0x240c00+'-'+_0x2a678b+'/'+_0x13d10e)[_0x4acf('0x18')](_0x57d8e0);}return null;};}function patchUpdates(_0x2feb89){return function(_0x1a3118){try{jsonpatch['apply'](_0x1a3118,_0x2feb89,!![]);}catch(_0x28d698){return BPromise[_0x4acf('0x1f')](_0x28d698);}return _0x1a3118['save']();};}function saveUpdates(_0x41e5d2,_0x17775f){return function(_0x569d9e){if(_0x569d9e){return _0x569d9e[_0x4acf('0x20')](_0x41e5d2)[_0x4acf('0x21')](function(_0x433b7a){return _0x433b7a;});}return null;};}function removeEntity(_0x454555,_0x53885f){return function(_0x1a2286){if(_0x1a2286){return _0x1a2286[_0x4acf('0x22')]()['then'](function(){_0x454555[_0x4acf('0x16')](0xcc)[_0x4acf('0x17')]();});}};}function handleEntityNotFound(_0x52a84a,_0x126522){return function(_0x7ebb){if(!_0x7ebb){_0x52a84a[_0x4acf('0x15')](0x194);}return _0x7ebb;};}function handleError(_0x16458f,_0x571a30){_0x571a30=_0x571a30||0x1f4;return function(_0x50236d){logger[_0x4acf('0x23')](_0x50236d[_0x4acf('0x24')]);if(_0x50236d[_0x4acf('0x25')]){delete _0x50236d[_0x4acf('0x25')];}_0x16458f[_0x4acf('0x16')](_0x571a30)[_0x4acf('0x26')](_0x50236d);};}exports[_0x4acf('0x27')]=function(_0x7a1e79,_0x382c41){var _0x2a3830={},_0x57989e={},_0x3521c2={'count':0x0,'rows':[]};var _0x3f5614=_[_0x4acf('0x28')](db[_0x4acf('0x29')][_0x4acf('0x2a')],function(_0x28570f){return{'name':_0x28570f[_0x4acf('0x2b')],'type':_0x28570f['type'][_0x4acf('0x2c')]};});_0x57989e[_0x4acf('0x2d')]=_[_0x4acf('0x28')](_0x3f5614,'name');_0x57989e[_0x4acf('0x2e')]=_[_0x4acf('0x2f')](_0x7a1e79[_0x4acf('0x2e')]);_0x57989e[_0x4acf('0x30')]=_['intersection'](_0x57989e[_0x4acf('0x2d')],_0x57989e[_0x4acf('0x2e')]);_0x2a3830[_0x4acf('0x31')]=_['intersection'](_0x57989e[_0x4acf('0x2d')],qs[_0x4acf('0x32')](_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x32')]));_0x2a3830[_0x4acf('0x31')]=_0x2a3830[_0x4acf('0x31')]['length']?_0x2a3830[_0x4acf('0x31')]:_0x57989e[_0x4acf('0x2d')];if(!_0x7a1e79['query'][_0x4acf('0x33')]('nolimit')){_0x2a3830['limit']=qs['limit'](_0x7a1e79['query']['limit']);_0x2a3830['offset']=qs['offset'](_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x19')]);}_0x2a3830['order']=qs[_0x4acf('0x34')](_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x34')]);_0x2a3830[_0x4acf('0x35')]=qs[_0x4acf('0x30')](_[_0x4acf('0x36')](_0x7a1e79[_0x4acf('0x2e')],_0x57989e[_0x4acf('0x30')]),_0x3f5614);if(_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x37')]){_0x2a3830['where']=_['merge'](_0x2a3830[_0x4acf('0x35')],{'$or':_[_0x4acf('0x28')](_0x3f5614,function(_0x4859b6){if(_0x4859b6[_0x4acf('0x38')]!==_0x4acf('0x39')){var _0x43a2ea={};_0x43a2ea[_0x4859b6[_0x4acf('0x25')]]={'$like':'%'+_0x7a1e79['query']['filter']+'%'};return _0x43a2ea;}})});}_0x2a3830=_[_0x4acf('0x3a')]({},_0x2a3830,_0x7a1e79[_0x4acf('0x3b')]);var _0x3d5529={'where':_0x2a3830[_0x4acf('0x35')]};return db['MailQueueReport'][_0x4acf('0x1b')](_0x3d5529)[_0x4acf('0x21')](function(_0x4e9370){_0x3521c2['count']=_0x4e9370;if(_0x7a1e79['query']['includeAll']){_0x2a3830[_0x4acf('0x3c')]=[{'all':!![]}];}return db[_0x4acf('0x29')][_0x4acf('0x3d')](_0x2a3830);})['then'](function(_0x1015e3){_0x3521c2[_0x4acf('0x3e')]=_0x1015e3;return _0x3521c2;})[_0x4acf('0x21')](respondWithFilteredResult(_0x382c41,_0x2a3830))[_0x4acf('0x3f')](handleError(_0x382c41,null));};exports[_0x4acf('0x40')]=function(_0xea75e4,_0x7cf2a){var _0x17d5e9={'raw':!![],'where':{'id':_0xea75e4[_0x4acf('0x41')]['id']}},_0x461547={};_0x461547[_0x4acf('0x2d')]=_['keys'](db[_0x4acf('0x29')][_0x4acf('0x2a')]);_0x461547[_0x4acf('0x2e')]=_[_0x4acf('0x2f')](_0xea75e4[_0x4acf('0x2e')]);_0x461547['filters']=_['intersection'](_0x461547[_0x4acf('0x2d')],_0x461547[_0x4acf('0x2e')]);_0x17d5e9[_0x4acf('0x31')]=_[_0x4acf('0x42')](_0x461547[_0x4acf('0x2d')],qs[_0x4acf('0x32')](_0xea75e4['query'][_0x4acf('0x32')]));_0x17d5e9['attributes']=_0x17d5e9[_0x4acf('0x31')][_0x4acf('0x43')]?_0x17d5e9['attributes']:_0x461547['model'];if(_0xea75e4[_0x4acf('0x2e')][_0x4acf('0x44')]){_0x17d5e9[_0x4acf('0x3c')]=[{'all':!![]}];}_0x17d5e9=_[_0x4acf('0x3a')]({},_0x17d5e9,_0xea75e4['options']);return db[_0x4acf('0x29')][_0x4acf('0x45')](_0x17d5e9)[_0x4acf('0x21')](handleEntityNotFound(_0x7cf2a,null))[_0x4acf('0x21')](respondWithResult(_0x7cf2a,null))[_0x4acf('0x3f')](handleError(_0x7cf2a,null));};exports[_0x4acf('0x46')]=function(_0x1bd7d0,_0x2d946c){return db['MailQueueReport']['create'](_0x1bd7d0[_0x4acf('0x47')],{})[_0x4acf('0x21')](respondWithResult(_0x2d946c,0xc9))[_0x4acf('0x3f')](handleError(_0x2d946c,null));};exports[_0x4acf('0x20')]=function(_0x287406,_0x859247){if(_0x287406[_0x4acf('0x47')]['id']){delete _0x287406[_0x4acf('0x47')]['id'];}return db[_0x4acf('0x29')][_0x4acf('0x45')]({'where':{'id':_0x287406[_0x4acf('0x41')]['id']}})[_0x4acf('0x21')](handleEntityNotFound(_0x859247,null))['then'](saveUpdates(_0x287406[_0x4acf('0x47')],null))[_0x4acf('0x21')](respondWithResult(_0x859247,null))[_0x4acf('0x3f')](handleError(_0x859247,null));};exports[_0x4acf('0x22')]=function(_0x392dac,_0x3cf54a){return db[_0x4acf('0x29')][_0x4acf('0x45')]({'where':{'id':_0x392dac[_0x4acf('0x41')]['id']}})[_0x4acf('0x21')](handleEntityNotFound(_0x3cf54a,null))[_0x4acf('0x21')](removeEntity(_0x3cf54a,null))[_0x4acf('0x3f')](handleError(_0x3cf54a,null));};exports[_0x4acf('0x48')]=function(_0x2b62bc,_0x113425){return db[_0x4acf('0x29')]['describe']()[_0x4acf('0x21')](respondWithResult(_0x113425,null))[_0x4acf('0x3f')](handleError(_0x113425,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 7f47706..88e6b3e 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 _0x5a44=['./mailQueueReport.attributes','define','report_mail_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x51c5b6,_0x51d649){var _0x2aab7d=function(_0x1d75dd){while(--_0x1d75dd){_0x51c5b6['push'](_0x51c5b6['shift']());}};_0x2aab7d(++_0x51d649);}(_0x5a44,0x122));var _0x45a4=function(_0x72bb0a,_0x25fd1c){_0x72bb0a=_0x72bb0a-0x0;var _0xf67a70=_0x5a44[_0x72bb0a];return _0xf67a70;};'use strict';var _=require(_0x45a4('0x0'));var util=require(_0x45a4('0x1'));var logger=require(_0x45a4('0x2'))(_0x45a4('0x3'));var moment=require(_0x45a4('0x4'));var BPromise=require(_0x45a4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x45a4('0x6'));var rimraf=require(_0x45a4('0x7'));var config=require(_0x45a4('0x8'));var attributes=require(_0x45a4('0x9'));module['exports']=function(_0xe03077,_0x2df976){return _0xe03077[_0x45a4('0xa')]('MailQueueReport',attributes,{'tableName':_0x45a4('0xb'),'paranoid':![],'indexes':[{'name':_0x45a4('0xc'),'fields':[_0x45a4('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5abc=['uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x5abc,0x105));var _0xc5ab=function(_0x1f88a3,_0x1f5887){_0x1f88a3=_0x1f88a3-0x0;var _0x3cdeda=_0x5abc[_0x1f88a3];return _0x3cdeda;};'use strict';var _=require(_0xc5ab('0x0'));var util=require(_0xc5ab('0x1'));var logger=require(_0xc5ab('0x2'))('api');var moment=require(_0xc5ab('0x3'));var BPromise=require(_0xc5ab('0x4'));var rp=require(_0xc5ab('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc5ab('0x6'));var config=require('../../config/environment');var attributes=require(_0xc5ab('0x7'));module[_0xc5ab('0x8')]=function(_0x1e3ffa,_0x540ff7){return _0x1e3ffa[_0xc5ab('0x9')](_0xc5ab('0xa'),attributes,{'tableName':_0xc5ab('0xb'),'paranoid':![],'indexes':[{'name':_0xc5ab('0xc'),'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 eefd8f3..23cba26 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 _0xdb28=['UpdateMailQueueReport','MailQueueReport','update','raw','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateMailQueueReport','create','body','options'];(function(_0x2a2166,_0x3a077f){var _0x3bcf50=function(_0x3f0300){while(--_0x3f0300){_0x2a2166['push'](_0x2a2166['shift']());}};_0x3bcf50(++_0x3a077f);}(_0xdb28,0x106));var _0x8db2=function(_0x3a2c04,_0x560f03){_0x3a2c04=_0x3a2c04-0x0;var _0x7a3710=_0xdb28[_0x3a2c04];return _0x7a3710;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}exports[_0x8db2('0x16')]=function(_0x3fddc2){var _0x2efd06=this;return new Promise(function(_0x46ce14,_0x51d60d){return db['MailQueueReport'][_0x8db2('0x17')](_0x3fddc2[_0x8db2('0x18')],{'raw':_0x3fddc2[_0x8db2('0x19')]?_0x3fddc2[_0x8db2('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8db2('0xc')](function(_0x36a9ff){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger[_0x8db2('0xf')]('CreateMailQueueReport',_0x3fddc2,JSON[_0x8db2('0x10')](_0x36a9ff));_0x46ce14(_0x36a9ff);})[_0x8db2('0x15')](function(_0x18f69c){logger[_0x8db2('0x11')](_0x8db2('0x16'),_0x18f69c[_0x8db2('0x13')],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0x18f69c['message']));});});};exports[_0x8db2('0x1a')]=function(_0x4f6516){var _0x5725f0=this;return new Promise(function(_0x52a9ca,_0x4d923c){return db[_0x8db2('0x1b')][_0x8db2('0x1c')](_0x4f6516[_0x8db2('0x18')],{'raw':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f6516['options']?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1e')]||null:null,'attributes':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')]['attributes']||null:null,'limit':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1f')]||null:null})[_0x8db2('0xc')](function(_0xbe5ece){logger[_0x8db2('0x14')](_0x8db2('0x1a'),_0x4f6516);logger[_0x8db2('0xf')](_0x8db2('0x1a'),_0x4f6516,JSON['stringify'](_0xbe5ece));_0x52a9ca(_0xbe5ece);})[_0x8db2('0x15')](function(_0x50b28d){logger['error'](_0x8db2('0x1a'),_0x50b28d[_0x8db2('0x13')],_0x4f6516);_0x4d923c(_0x5725f0[_0x8db2('0x11')](0x1f4,_0x50b28d['message']));});});}; \ No newline at end of file +var _0xadb5=['MailQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailQueueReport','create','options','raw','debug','MailQueueReport','body','attributes','limit','UpdateMailQueueReport','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x1269e4,_0x2c4915){var _0x2ec967=function(_0x3d4028){while(--_0x3d4028){_0x1269e4['push'](_0x1269e4['shift']());}};_0x2ec967(++_0x2c4915);}(_0xadb5,0xad));var _0x5adb=function(_0x4d7a78,_0x42c631){_0x4d7a78=_0x4d7a78-0x0;var _0x6e68ec=_0xadb5[_0x4d7a78];return _0x6e68ec;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailQueueReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}exports[_0x5adb('0x15')]=function(_0x529b65){var _0x3fff62=this;return new Promise(function(_0x5de028,_0x1d9e86){return db['MailQueueReport'][_0x5adb('0x16')](_0x529b65['body'],{'raw':_0x529b65['options']?_0x529b65[_0x5adb('0x17')][_0x5adb('0x18')]===undefined?!![]:![]:!![]})[_0x5adb('0xb')](function(_0x1fd4a7){logger[_0x5adb('0xc')]('CreateMailQueueReport',_0x529b65);logger[_0x5adb('0x19')]('CreateMailQueueReport',_0x529b65,JSON['stringify'](_0x1fd4a7));_0x5de028(_0x1fd4a7);})[_0x5adb('0x14')](function(_0x379b33){logger[_0x5adb('0x10')](_0x5adb('0x15'),_0x379b33[_0x5adb('0x12')],_0x529b65);_0x1d9e86(_0x3fff62[_0x5adb('0x10')](0x1f4,_0x379b33[_0x5adb('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x4b1957){var _0x373cc3=this;return new Promise(function(_0x3220cd,_0x3839fb){return db[_0x5adb('0x1a')]['update'](_0x4b1957[_0x5adb('0x1b')],{'raw':_0x4b1957[_0x5adb('0x17')]?_0x4b1957['options'][_0x5adb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')]['where']||null:null,'attributes':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1c')]||null:null,'limit':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1d')]||null:null})['then'](function(_0x49992e){logger['info'](_0x5adb('0x1e'),_0x4b1957);logger[_0x5adb('0x19')](_0x5adb('0x1e'),_0x4b1957,JSON[_0x5adb('0xf')](_0x49992e));_0x3220cd(_0x49992e);})[_0x5adb('0x14')](function(_0x4de310){logger[_0x5adb('0x10')](_0x5adb('0x1e'),_0x4de310[_0x5adb('0x12')],_0x4b1957);_0x3839fb(_0x373cc3[_0x5adb('0x10')](0x1f4,_0x4de310[_0x5adb('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index b367230..115c66f 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x42be34,_0x1de07e){var _0x180459=function(_0x131458){while(--_0x131458){_0x42be34['push'](_0x42be34['shift']());}};_0x180459(++_0x1de07e);}(_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'));module['exports']=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x11fd65,_0x2f79e9){var _0x344f0f=function(_0x7097d8){while(--_0x7097d8){_0x11fd65['push'](_0x11fd65['shift']());}};_0x344f0f(++_0x2f79e9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'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 f04a556..96a509d 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 _0x7daf=['exports','STRING','BOOLEAN','INTEGER','INBOX'];(function(_0x142020,_0x1f7233){var _0x40da8f=function(_0x17f0a3){while(--_0x17f0a3){_0x142020['push'](_0x142020['shift']());}};_0x40da8f(++_0x1f7233);}(_0x7daf,0x163));var _0xf7da=function(_0x16b6fb,_0x7c304f){_0x16b6fb=_0x16b6fb-0x0;var _0x13527d=_0x7daf[_0x16b6fb];return _0x13527d;};'use strict';var Sequelize=require('sequelize');module[_0xf7da('0x0')]={'description':{'type':Sequelize[_0xf7da('0x1')]},'host':{'type':Sequelize[_0xf7da('0x1')]},'authentication':{'type':Sequelize[_0xf7da('0x2')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xf7da('0x3')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xf7da('0x1')],'defaultValue':_0xf7da('0x4')},'connTimeout':{'type':Sequelize[_0xf7da('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xf7da('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0xf7da('0x1')]},'modernAuthentication':{'type':Sequelize[_0xf7da('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xd021=['sequelize','STRING','BOOLEAN','INBOX','INTEGER'];(function(_0x20744f,_0x4f6bda){var _0x3a476a=function(_0x53ea1d){while(--_0x53ea1d){_0x20744f['push'](_0x20744f['shift']());}};_0x3a476a(++_0x4f6bda);}(_0xd021,0x15e));var _0x1d02=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd021[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x1d02('0x0'));module['exports']={'description':{'type':Sequelize[_0x1d02('0x1')]},'host':{'type':Sequelize[_0x1d02('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x1d02('0x1')]},'password':{'type':Sequelize[_0x1d02('0x1')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0x1d02('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x1d02('0x1')],'defaultValue':_0x1d02('0x3')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x1d02('0x4')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index b24e12c..5c240ec 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 _0x2f9d=['exports','MailServerIn','mail_servers_in','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./mailServerIn.attributes'];(function(_0x2e2b2e,_0x354030){var _0x596d22=function(_0x5d9364){while(--_0x5d9364){_0x2e2b2e['push'](_0x2e2b2e['shift']());}};_0x596d22(++_0x354030);}(_0x2f9d,0x10b));var _0xd2f9=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0x2f9d[_0x3899d1];return _0xeb4a7d;};'use strict';var _=require(_0xd2f9('0x0'));var util=require(_0xd2f9('0x1'));var logger=require(_0xd2f9('0x2'))('api');var moment=require(_0xd2f9('0x3'));var BPromise=require(_0xd2f9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd2f9('0x5'));var rimraf=require(_0xd2f9('0x6'));var config=require(_0xd2f9('0x7'));var attributes=require(_0xd2f9('0x8'));module[_0xd2f9('0x9')]=function(_0x38ccd8,_0x1cdb24){return _0x38ccd8['define'](_0xd2f9('0xa'),attributes,{'tableName':_0xd2f9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf09b=['define','../../config/logger','api','request-promise','path','../../config/environment','./mailServerIn.attributes','exports'];(function(_0x54f493,_0x385811){var _0x5f2b47=function(_0x2d2323){while(--_0x2d2323){_0x54f493['push'](_0x54f493['shift']());}};_0x5f2b47(++_0x385811);}(_0xf09b,0xf1));var _0xbf09=function(_0x436865,_0x69b2d1){_0x436865=_0x436865-0x0;var _0x1c027d=_0xf09b[_0x436865];return _0x1c027d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbf09('0x0'))(_0xbf09('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbf09('0x2'));var fs=require('fs');var path=require(_0xbf09('0x3'));var rimraf=require('rimraf');var config=require(_0xbf09('0x4'));var attributes=require(_0xbf09('0x5'));module[_0xbf09('0x6')]=function(_0x3d23a0,_0x2d63dd){return _0x3d23a0[_0xbf09('0x7')]('MailServerIn',attributes,{'tableName':'mail_servers_in','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 e1b2bea..6d424e3 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 _0xbaf3=['http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','limit','include','model','map','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x202028,_0x19aec7){var _0x1d1d8f=function(_0x4bd992){while(--_0x4bd992){_0x202028['push'](_0x202028['shift']());}};_0x1d1d8f(++_0x19aec7);}(_0xbaf3,0x1df));var _0x3baf=function(_0x33875d,_0xf2f624){_0x33875d=_0x33875d-0x0;var _0x477086=_0xbaf3[_0x33875d];return _0x477086;};'use strict';var _=require(_0x3baf('0x0'));var util=require(_0x3baf('0x1'));var moment=require(_0x3baf('0x2'));var BPromise=require(_0x3baf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3baf('0x4'));var db=require(_0x3baf('0x5'))['db'];var utils=require(_0x3baf('0x6'));var logger=require('../../config/logger')(_0x3baf('0x7'));var config=require(_0x3baf('0x8'));var jayson=require(_0x3baf('0x9'));var client=jayson[_0x3baf('0xa')][_0x3baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x518d8d,_0x2775d0,_0x514868){return new BPromise(function(_0x430daf,_0x11ca2a){return client[_0x3baf('0xc')](_0x518d8d,_0x514868)[_0x3baf('0xd')](function(_0x251262){logger[_0x3baf('0xe')](_0x3baf('0xf'),_0x2775d0,_0x3baf('0x10'));logger[_0x3baf('0x11')](_0x3baf('0x12'),_0x2775d0,_0x3baf('0x10'),JSON[_0x3baf('0x13')](_0x251262));if(_0x251262[_0x3baf('0x14')]){if(_0x251262[_0x3baf('0x14')][_0x3baf('0x15')]===0x1f4){logger[_0x3baf('0x14')](_0x3baf('0xf'),_0x2775d0,_0x251262[_0x3baf('0x14')]['message']);return _0x11ca2a(_0x251262[_0x3baf('0x14')][_0x3baf('0x16')]);}logger[_0x3baf('0x14')](_0x3baf('0xf'),_0x2775d0,_0x251262[_0x3baf('0x14')][_0x3baf('0x16')]);return _0x430daf(_0x251262[_0x3baf('0x14')][_0x3baf('0x16')]);}else{logger[_0x3baf('0xe')](_0x3baf('0xf'),_0x2775d0,_0x3baf('0x10'));_0x430daf(_0x251262['result'][_0x3baf('0x16')]);}})[_0x3baf('0x17')](function(_0x5817bb){logger['error'](_0x3baf('0xf'),_0x2775d0,_0x5817bb);_0x11ca2a(_0x5817bb);});});}exports[_0x3baf('0x18')]=function(_0xf92cad){var _0x2d8b8a=this;return new Promise(function(_0x2158cb,_0x32bbc9){return db[_0x3baf('0x19')][_0x3baf('0x1a')]({'raw':_0xf92cad[_0x3baf('0x1b')]?_0xf92cad[_0x3baf('0x1b')][_0x3baf('0x1c')]===undefined?!![]:![]:!![],'where':_0xf92cad[_0x3baf('0x1b')]?_0xf92cad[_0x3baf('0x1b')][_0x3baf('0x1d')]||null:null,'attributes':_0xf92cad['options']?_0xf92cad[_0x3baf('0x1b')][_0x3baf('0x1e')]||null:null,'limit':_0xf92cad[_0x3baf('0x1b')]?_0xf92cad[_0x3baf('0x1b')][_0x3baf('0x1f')]||null:null,'include':_0xf92cad['options']?_0xf92cad[_0x3baf('0x1b')][_0x3baf('0x20')]?_['map'](_0xf92cad[_0x3baf('0x1b')]['include'],function(_0x25482e){return{'model':db[_0x25482e['model']],'as':_0x25482e['as'],'attributes':_0x25482e[_0x3baf('0x1e')],'include':_0x25482e[_0x3baf('0x20')]?_['map'](_0x25482e['include'],function(_0x43dcfb){return{'model':db[_0x43dcfb[_0x3baf('0x21')]],'as':_0x43dcfb['as'],'attributes':_0x43dcfb[_0x3baf('0x1e')],'include':_0x43dcfb[_0x3baf('0x20')]?_[_0x3baf('0x22')](_0x43dcfb[_0x3baf('0x20')],function(_0x3ae7ea){return{'model':db[_0x3ae7ea['model']],'as':_0x3ae7ea['as'],'attributes':_0x3ae7ea[_0x3baf('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3baf('0xd')](function(_0x92f83d){logger['info'](_0x3baf('0x18'),_0xf92cad);logger[_0x3baf('0x11')](_0x3baf('0x18'),_0xf92cad,JSON[_0x3baf('0x13')](_0x92f83d));_0x2158cb(_0x92f83d);})[_0x3baf('0x17')](function(_0x20d55){logger[_0x3baf('0x14')](_0x3baf('0x18'),_0x20d55[_0x3baf('0x16')],_0xf92cad);_0x32bbc9(_0x2d8b8a[_0x3baf('0x14')](0x1f4,_0x20d55[_0x3baf('0x16')]));});});}; \ No newline at end of file +var _0x1d6a=['request\x20sent','stringify','error','code','message','GetMailServerIn','findAll','options','raw','where','attributes','limit','include','map','model','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','MailServerIn,\x20%s,\x20%s','debug','MailServerIn,\x20%s,\x20%s,\x20%s'];(function(_0x5b2152,_0x523a7c){var _0x29af49=function(_0x2cbf8f){while(--_0x2cbf8f){_0x5b2152['push'](_0x5b2152['shift']());}};_0x29af49(++_0x523a7c);}(_0x1d6a,0x190));var _0xa1d6=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x1d6a[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0xa1d6('0x0'));var moment=require(_0xa1d6('0x1'));var BPromise=require(_0xa1d6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa1d6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa1d6('0x4'));var logger=require(_0xa1d6('0x5'))(_0xa1d6('0x6'));var config=require(_0xa1d6('0x7'));var jayson=require(_0xa1d6('0x8'));var client=jayson[_0xa1d6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1452e7,_0x227bd0,_0x5833e4){return new BPromise(function(_0x4678f9,_0x1b53ad){return client[_0xa1d6('0xa')](_0x1452e7,_0x5833e4)[_0xa1d6('0xb')](function(_0x4e4ea8){logger[_0xa1d6('0xc')](_0xa1d6('0xd'),_0x227bd0,'request\x20sent');logger[_0xa1d6('0xe')](_0xa1d6('0xf'),_0x227bd0,_0xa1d6('0x10'),JSON[_0xa1d6('0x11')](_0x4e4ea8));if(_0x4e4ea8['error']){if(_0x4e4ea8[_0xa1d6('0x12')][_0xa1d6('0x13')]===0x1f4){logger[_0xa1d6('0x12')](_0xa1d6('0xd'),_0x227bd0,_0x4e4ea8[_0xa1d6('0x12')][_0xa1d6('0x14')]);return _0x1b53ad(_0x4e4ea8['error'][_0xa1d6('0x14')]);}logger[_0xa1d6('0x12')](_0xa1d6('0xd'),_0x227bd0,_0x4e4ea8[_0xa1d6('0x12')][_0xa1d6('0x14')]);return _0x4678f9(_0x4e4ea8['error']['message']);}else{logger['info'](_0xa1d6('0xd'),_0x227bd0,_0xa1d6('0x10'));_0x4678f9(_0x4e4ea8['result'][_0xa1d6('0x14')]);}})['catch'](function(_0x22d2ca){logger[_0xa1d6('0x12')](_0xa1d6('0xd'),_0x227bd0,_0x22d2ca);_0x1b53ad(_0x22d2ca);});});}exports[_0xa1d6('0x15')]=function(_0xfac043){var _0x408e6c=this;return new Promise(function(_0x330a33,_0x521c8b){return db['MailServerIn'][_0xa1d6('0x16')]({'raw':_0xfac043['options']?_0xfac043[_0xa1d6('0x17')][_0xa1d6('0x18')]===undefined?!![]:![]:!![],'where':_0xfac043[_0xa1d6('0x17')]?_0xfac043[_0xa1d6('0x17')][_0xa1d6('0x19')]||null:null,'attributes':_0xfac043[_0xa1d6('0x17')]?_0xfac043[_0xa1d6('0x17')][_0xa1d6('0x1a')]||null:null,'limit':_0xfac043['options']?_0xfac043[_0xa1d6('0x17')][_0xa1d6('0x1b')]||null:null,'include':_0xfac043[_0xa1d6('0x17')]?_0xfac043[_0xa1d6('0x17')][_0xa1d6('0x1c')]?_[_0xa1d6('0x1d')](_0xfac043['options'][_0xa1d6('0x1c')],function(_0x55c6af){return{'model':db[_0x55c6af[_0xa1d6('0x1e')]],'as':_0x55c6af['as'],'attributes':_0x55c6af[_0xa1d6('0x1a')],'include':_0x55c6af[_0xa1d6('0x1c')]?_['map'](_0x55c6af[_0xa1d6('0x1c')],function(_0x2c01bc){return{'model':db[_0x2c01bc['model']],'as':_0x2c01bc['as'],'attributes':_0x2c01bc[_0xa1d6('0x1a')],'include':_0x2c01bc[_0xa1d6('0x1c')]?_[_0xa1d6('0x1d')](_0x2c01bc['include'],function(_0x540241){return{'model':db[_0x540241[_0xa1d6('0x1e')]],'as':_0x540241['as'],'attributes':_0x540241[_0xa1d6('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1e24fa){logger[_0xa1d6('0xc')](_0xa1d6('0x15'),_0xfac043);logger['debug'](_0xa1d6('0x15'),_0xfac043,JSON[_0xa1d6('0x11')](_0x1e24fa));_0x330a33(_0x1e24fa);})[_0xa1d6('0x1f')](function(_0x3dc96f){logger[_0xa1d6('0x12')]('GetMailServerIn',_0x3dc96f[_0xa1d6('0x14')],_0xfac043);_0x521c8b(_0x408e6c['error'](0x1f4,_0x3dc96f[_0xa1d6('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 46917be..996ee14 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(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index d64790f..bd0b682 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 _0xed3c=['INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0x5039c7,_0x1cf859){var _0x618f61=function(_0x50683c){while(--_0x50683c){_0x5039c7['push'](_0x5039c7['shift']());}};_0x618f61(++_0x1cf859);}(_0xed3c,0x1a6));var _0xced3=function(_0x2fa06e,_0x228d80){_0x2fa06e=_0x2fa06e-0x0;var _0x2df3f2=_0xed3c[_0x2fa06e];return _0x2df3f2;};'use strict';var Sequelize=require(_0xced3('0x0'));module[_0xced3('0x1')]={'description':{'type':Sequelize[_0xced3('0x2')]},'host':{'type':Sequelize[_0xced3('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0xced3('0x2')]},'port':{'type':Sequelize[_0xced3('0x3')]},'secure':{'type':Sequelize[_0xced3('0x4')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xced3('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x373d=['STRING','BOOLEAN','sequelize'];(function(_0x5767d1,_0x20323b){var _0x37b060=function(_0x2f9d9a){while(--_0x2f9d9a){_0x5767d1['push'](_0x5767d1['shift']());}};_0x37b060(++_0x20323b);}(_0x373d,0x1e2));var _0xd373=function(_0x18226e,_0x4c502e){_0x18226e=_0x18226e-0x0;var _0x59d69c=_0x373d[_0x18226e];return _0x59d69c;};'use strict';var Sequelize=require(_0xd373('0x0'));module['exports']={'description':{'type':Sequelize[_0xd373('0x1')]},'host':{'type':Sequelize[_0xd373('0x1')]},'user':{'type':Sequelize[_0xd373('0x1')]},'pass':{'type':Sequelize[_0xd373('0x1')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0xd373('0x2')],'defaultValue':![]},'service':{'type':Sequelize[_0xd373('0x1')]},'authentication':{'type':Sequelize[_0xd373('0x2')],'defaultValue':!![]},'modernAuthentication':{'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 d7e7fc8..9985200 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 _0xc473=['order','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','include','create','body','find','eml-format','zip-dir','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','send','map','MailServerOut','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xc473,0x122));var _0x3c47=function(_0x56b90b,_0x5e4e22){_0x56b90b=_0x56b90b-0x0;var _0x214f61=_0xc473[_0x56b90b];return _0x214f61;};'use strict';var emlformat=require(_0x3c47('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3c47('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3c47('0x2'));var BPromise=require(_0x3c47('0x3'));var Mustache=require(_0x3c47('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x3c47('0x5'));var ejs=require(_0x3c47('0x6'));var fs=require('fs');var fs_extra=require(_0x3c47('0x7'));var _=require(_0x3c47('0x8'));var squel=require(_0x3c47('0x9'));var crypto=require(_0x3c47('0xa'));var jsforce=require(_0x3c47('0xb'));var deskjs=require(_0x3c47('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3c47('0xd'));var Papa=require(_0x3c47('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3c47('0xf'));var as=require(_0x3c47('0x10'));var hardwareService=require(_0x3c47('0x11'));var logger=require(_0x3c47('0x12'))('api');var utils=require(_0x3c47('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3c47('0x14'))['db'];function respondWithStatusCode(_0x847120,_0x2dccda){_0x2dccda=_0x2dccda||0xcc;return function(_0x2564b3){if(_0x2564b3){return _0x847120['sendStatus'](_0x2dccda);}return _0x847120[_0x3c47('0x15')](_0x2dccda)['end']();};}function respondWithResult(_0x300821,_0xb61b34){_0xb61b34=_0xb61b34||0xc8;return function(_0x56da88){if(_0x56da88){return _0x300821[_0x3c47('0x15')](_0xb61b34)[_0x3c47('0x16')](_0x56da88);}};}function respondWithFilteredResult(_0x4bb416,_0x29d69b){return function(_0xbe4c05){if(_0xbe4c05){var _0x4abc61=typeof _0x29d69b['offset']===_0x3c47('0x17')&&typeof _0x29d69b[_0x3c47('0x18')]===_0x3c47('0x17');var _0x3576be=_0xbe4c05[_0x3c47('0x19')];var _0x598746=_0x4abc61?0x0:_0x29d69b['offset'];var _0x1c8bc8=_0x4abc61?_0xbe4c05[_0x3c47('0x19')]:_0x29d69b[_0x3c47('0x1a')]+_0x29d69b[_0x3c47('0x18')];var _0x26842a;if(_0x1c8bc8>=_0x3576be){_0x1c8bc8=_0x3576be;_0x26842a=0xc8;}else{_0x26842a=0xce;}_0x4bb416[_0x3c47('0x15')](_0x26842a);return _0x4bb416[_0x3c47('0x1b')]('Content-Range',_0x598746+'-'+_0x1c8bc8+'/'+_0x3576be)[_0x3c47('0x16')](_0xbe4c05);}return null;};}function patchUpdates(_0x21e190){return function(_0x3e0c7c){try{jsonpatch[_0x3c47('0x1c')](_0x3e0c7c,_0x21e190,!![]);}catch(_0x2fc45f){return BPromise[_0x3c47('0x1d')](_0x2fc45f);}return _0x3e0c7c[_0x3c47('0x1e')]();};}function saveUpdates(_0x387581,_0x12cf73){return function(_0x1ec067){if(_0x1ec067){return _0x1ec067[_0x3c47('0x1f')](_0x387581)[_0x3c47('0x20')](function(_0x448edb){return _0x448edb;});}return null;};}function removeEntity(_0x2b4c78,_0x4f4969){return function(_0x5046ba){if(_0x5046ba){return _0x5046ba[_0x3c47('0x21')]()[_0x3c47('0x20')](function(){_0x2b4c78[_0x3c47('0x15')](0xcc)[_0x3c47('0x22')]();});}};}function handleEntityNotFound(_0x2e3a26,_0xdc182b){return function(_0x4fdb9e){if(!_0x4fdb9e){_0x2e3a26[_0x3c47('0x23')](0x194);}return _0x4fdb9e;};}function handleError(_0x3a9617,_0xa2ca31){_0xa2ca31=_0xa2ca31||0x1f4;return function(_0x3fcaaa){logger['error'](_0x3fcaaa[_0x3c47('0x24')]);if(_0x3fcaaa[_0x3c47('0x25')]){delete _0x3fcaaa[_0x3c47('0x25')];}_0x3a9617[_0x3c47('0x15')](_0xa2ca31)[_0x3c47('0x26')](_0x3fcaaa);};}exports['index']=function(_0x4a8097,_0x23fc28){var _0x5ae6f7={},_0x1c6f6e={},_0x5d728a={'count':0x0,'rows':[]};var _0x7fcac=_[_0x3c47('0x27')](db[_0x3c47('0x28')][_0x3c47('0x29')],function(_0x41e06b){return{'name':_0x41e06b[_0x3c47('0x2a')],'type':_0x41e06b[_0x3c47('0x2b')]['key']};});_0x1c6f6e[_0x3c47('0x2c')]=_[_0x3c47('0x27')](_0x7fcac,'name');_0x1c6f6e[_0x3c47('0x2d')]=_['keys'](_0x4a8097['query']);_0x1c6f6e[_0x3c47('0x2e')]=_[_0x3c47('0x2f')](_0x1c6f6e[_0x3c47('0x2c')],_0x1c6f6e[_0x3c47('0x2d')]);_0x5ae6f7[_0x3c47('0x30')]=_['intersection'](_0x1c6f6e[_0x3c47('0x2c')],qs[_0x3c47('0x31')](_0x4a8097[_0x3c47('0x2d')]['fields']));_0x5ae6f7[_0x3c47('0x30')]=_0x5ae6f7[_0x3c47('0x30')]['length']?_0x5ae6f7['attributes']:_0x1c6f6e['model'];if(!_0x4a8097[_0x3c47('0x2d')]['hasOwnProperty']('nolimit')){_0x5ae6f7[_0x3c47('0x18')]=qs[_0x3c47('0x18')](_0x4a8097[_0x3c47('0x2d')][_0x3c47('0x18')]);_0x5ae6f7[_0x3c47('0x1a')]=qs[_0x3c47('0x1a')](_0x4a8097['query'][_0x3c47('0x1a')]);}_0x5ae6f7[_0x3c47('0x32')]=qs['sort'](_0x4a8097[_0x3c47('0x2d')]['sort']);_0x5ae6f7[_0x3c47('0x33')]=qs[_0x3c47('0x2e')](_[_0x3c47('0x34')](_0x4a8097[_0x3c47('0x2d')],_0x1c6f6e[_0x3c47('0x2e')]),_0x7fcac);if(_0x4a8097[_0x3c47('0x2d')][_0x3c47('0x35')]){_0x5ae6f7['where']=_[_0x3c47('0x36')](_0x5ae6f7[_0x3c47('0x33')],{'$or':_['map'](_0x7fcac,function(_0x3338d9){if(_0x3338d9['type']!==_0x3c47('0x37')){var _0x4e8ca5={};_0x4e8ca5[_0x3338d9['name']]={'$like':'%'+_0x4a8097[_0x3c47('0x2d')][_0x3c47('0x35')]+'%'};return _0x4e8ca5;}})});}_0x5ae6f7=_[_0x3c47('0x36')]({},_0x5ae6f7,_0x4a8097[_0x3c47('0x38')]);var _0x40277e={'where':_0x5ae6f7[_0x3c47('0x33')]};return db[_0x3c47('0x28')][_0x3c47('0x19')](_0x40277e)[_0x3c47('0x20')](function(_0xa9d2dd){_0x5d728a[_0x3c47('0x19')]=_0xa9d2dd;if(_0x4a8097[_0x3c47('0x2d')][_0x3c47('0x39')]){_0x5ae6f7['include']=[{'all':!![]}];}return db[_0x3c47('0x28')][_0x3c47('0x3a')](_0x5ae6f7);})['then'](function(_0x2f00e8){_0x5d728a[_0x3c47('0x3b')]=_0x2f00e8;return _0x5d728a;})['then'](respondWithFilteredResult(_0x23fc28,_0x5ae6f7))[_0x3c47('0x3c')](handleError(_0x23fc28,null));};exports[_0x3c47('0x3d')]=function(_0xd722f,_0x3c3a7c){var _0x594aa8={'raw':!![],'where':{'id':_0xd722f[_0x3c47('0x3e')]['id']}},_0x448ef8={};_0x448ef8[_0x3c47('0x2c')]=_[_0x3c47('0x3f')](db[_0x3c47('0x28')][_0x3c47('0x29')]);_0x448ef8[_0x3c47('0x2d')]=_[_0x3c47('0x3f')](_0xd722f[_0x3c47('0x2d')]);_0x448ef8[_0x3c47('0x2e')]=_['intersection'](_0x448ef8[_0x3c47('0x2c')],_0x448ef8[_0x3c47('0x2d')]);_0x594aa8[_0x3c47('0x30')]=_[_0x3c47('0x2f')](_0x448ef8['model'],qs[_0x3c47('0x31')](_0xd722f[_0x3c47('0x2d')][_0x3c47('0x31')]));_0x594aa8[_0x3c47('0x30')]=_0x594aa8[_0x3c47('0x30')]['length']?_0x594aa8[_0x3c47('0x30')]:_0x448ef8[_0x3c47('0x2c')];if(_0xd722f[_0x3c47('0x2d')][_0x3c47('0x39')]){_0x594aa8[_0x3c47('0x40')]=[{'all':!![]}];}_0x594aa8=_[_0x3c47('0x36')]({},_0x594aa8,_0xd722f[_0x3c47('0x38')]);return db[_0x3c47('0x28')]['find'](_0x594aa8)[_0x3c47('0x20')](handleEntityNotFound(_0x3c3a7c,null))[_0x3c47('0x20')](respondWithResult(_0x3c3a7c,null))[_0x3c47('0x3c')](handleError(_0x3c3a7c,null));};exports[_0x3c47('0x41')]=function(_0xc03df7,_0x45ce12){return db[_0x3c47('0x28')][_0x3c47('0x41')](_0xc03df7[_0x3c47('0x42')],{})[_0x3c47('0x20')](respondWithResult(_0x45ce12,0xc9))[_0x3c47('0x3c')](handleError(_0x45ce12,null));};exports[_0x3c47('0x1f')]=function(_0x14e81c,_0x514d74){if(_0x14e81c[_0x3c47('0x42')]['id']){delete _0x14e81c[_0x3c47('0x42')]['id'];}return db[_0x3c47('0x28')][_0x3c47('0x43')]({'where':{'id':_0x14e81c[_0x3c47('0x3e')]['id']}})['then'](handleEntityNotFound(_0x514d74,null))[_0x3c47('0x20')](saveUpdates(_0x14e81c[_0x3c47('0x42')],null))['then'](respondWithResult(_0x514d74,null))['catch'](handleError(_0x514d74,null));};exports['destroy']=function(_0x3a0212,_0xa78161){return db[_0x3c47('0x28')][_0x3c47('0x43')]({'where':{'id':_0x3a0212[_0x3c47('0x3e')]['id']}})[_0x3c47('0x20')](handleEntityNotFound(_0xa78161,null))[_0x3c47('0x20')](removeEntity(_0xa78161,null))[_0x3c47('0x3c')](handleError(_0xa78161,null));}; \ No newline at end of file +var _0x4631=['jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','MailServerOut','rawAttributes','fieldName','key','query','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','includeAll','findAll','catch','show','keys','include','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto'];(function(_0x389df1,_0x15aab9){var _0x150fbd=function(_0x33642b){while(--_0x33642b){_0x389df1['push'](_0x389df1['shift']());}};_0x150fbd(++_0x15aab9);}(_0x4631,0x1cd));var _0x1463=function(_0x2fb87c,_0x2dee49){_0x2fb87c=_0x2fb87c-0x0;var _0x43038b=_0x4631[_0x2fb87c];return _0x43038b;};'use strict';var emlformat=require(_0x1463('0x0'));var rimraf=require(_0x1463('0x1'));var zipdir=require(_0x1463('0x2'));var jsonpatch=require(_0x1463('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1463('0x4'));var Mustache=require(_0x1463('0x5'));var util=require(_0x1463('0x6'));var path=require(_0x1463('0x7'));var sox=require(_0x1463('0x8'));var csv=require('to-csv');var ejs=require(_0x1463('0x9'));var fs=require('fs');var fs_extra=require(_0x1463('0xa'));var _=require('lodash');var squel=require(_0x1463('0xb'));var crypto=require(_0x1463('0xc'));var jsforce=require(_0x1463('0xd'));var deskjs=require(_0x1463('0xe'));var toCsv=require(_0x1463('0xf'));var querystring=require(_0x1463('0x10'));var Papa=require(_0x1463('0x11'));var Redis=require('ioredis');var authService=require(_0x1463('0x12'));var qs=require(_0x1463('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1463('0x14'));var logger=require(_0x1463('0x15'))(_0x1463('0x16'));var utils=require(_0x1463('0x17'));var config=require(_0x1463('0x18'));var licenseUtil=require(_0x1463('0x19'));var db=require(_0x1463('0x1a'))['db'];function respondWithStatusCode(_0x5ca10f,_0x357839){_0x357839=_0x357839||0xcc;return function(_0x477a50){if(_0x477a50){return _0x5ca10f[_0x1463('0x1b')](_0x357839);}return _0x5ca10f[_0x1463('0x1c')](_0x357839)[_0x1463('0x1d')]();};}function respondWithResult(_0x2e4af8,_0x2d771e){_0x2d771e=_0x2d771e||0xc8;return function(_0x14fc3e){if(_0x14fc3e){return _0x2e4af8[_0x1463('0x1c')](_0x2d771e)[_0x1463('0x1e')](_0x14fc3e);}};}function respondWithFilteredResult(_0x49f960,_0x34e2e7){return function(_0x17a5d4){if(_0x17a5d4){var _0x8e271d=typeof _0x34e2e7[_0x1463('0x1f')]===_0x1463('0x20')&&typeof _0x34e2e7[_0x1463('0x21')]===_0x1463('0x20');var _0x4544cd=_0x17a5d4['count'];var _0x1ba7c8=_0x8e271d?0x0:_0x34e2e7[_0x1463('0x1f')];var _0x5d0f73=_0x8e271d?_0x17a5d4[_0x1463('0x22')]:_0x34e2e7['offset']+_0x34e2e7['limit'];var _0x3ed2e8;if(_0x5d0f73>=_0x4544cd){_0x5d0f73=_0x4544cd;_0x3ed2e8=0xc8;}else{_0x3ed2e8=0xce;}_0x49f960[_0x1463('0x1c')](_0x3ed2e8);return _0x49f960['set'](_0x1463('0x23'),_0x1ba7c8+'-'+_0x5d0f73+'/'+_0x4544cd)[_0x1463('0x1e')](_0x17a5d4);}return null;};}function patchUpdates(_0x4475af){return function(_0x1f8f0c){try{jsonpatch[_0x1463('0x24')](_0x1f8f0c,_0x4475af,!![]);}catch(_0x3f3125){return BPromise[_0x1463('0x25')](_0x3f3125);}return _0x1f8f0c[_0x1463('0x26')]();};}function saveUpdates(_0x5d0916,_0x4c3489){return function(_0x332640){if(_0x332640){return _0x332640[_0x1463('0x27')](_0x5d0916)[_0x1463('0x28')](function(_0x20cc9c){return _0x20cc9c;});}return null;};}function removeEntity(_0x1dc29a,_0x43a924){return function(_0x20f014){if(_0x20f014){return _0x20f014[_0x1463('0x29')]()[_0x1463('0x28')](function(){_0x1dc29a[_0x1463('0x1c')](0xcc)[_0x1463('0x1d')]();});}};}function handleEntityNotFound(_0x464c54,_0x562173){return function(_0xb6a4c1){if(!_0xb6a4c1){_0x464c54[_0x1463('0x1b')](0x194);}return _0xb6a4c1;};}function handleError(_0x521d6d,_0x1234bc){_0x1234bc=_0x1234bc||0x1f4;return function(_0x1ccf70){logger[_0x1463('0x2a')](_0x1ccf70[_0x1463('0x2b')]);if(_0x1ccf70['name']){delete _0x1ccf70[_0x1463('0x2c')];}_0x521d6d['status'](_0x1234bc)[_0x1463('0x2d')](_0x1ccf70);};}exports[_0x1463('0x2e')]=function(_0x5a8e28,_0x1df8ef){var _0x40073a={},_0x1a3a17={},_0xe9306a={'count':0x0,'rows':[]};var _0x18b0e5=_[_0x1463('0x2f')](db[_0x1463('0x30')][_0x1463('0x31')],function(_0x584d88){return{'name':_0x584d88[_0x1463('0x32')],'type':_0x584d88['type'][_0x1463('0x33')]};});_0x1a3a17['model']=_[_0x1463('0x2f')](_0x18b0e5,_0x1463('0x2c'));_0x1a3a17[_0x1463('0x34')]=_['keys'](_0x5a8e28['query']);_0x1a3a17['filters']=_['intersection'](_0x1a3a17[_0x1463('0x35')],_0x1a3a17['query']);_0x40073a[_0x1463('0x36')]=_[_0x1463('0x37')](_0x1a3a17[_0x1463('0x35')],qs[_0x1463('0x38')](_0x5a8e28['query'][_0x1463('0x38')]));_0x40073a['attributes']=_0x40073a[_0x1463('0x36')][_0x1463('0x39')]?_0x40073a['attributes']:_0x1a3a17[_0x1463('0x35')];if(!_0x5a8e28[_0x1463('0x34')][_0x1463('0x3a')]('nolimit')){_0x40073a[_0x1463('0x21')]=qs[_0x1463('0x21')](_0x5a8e28[_0x1463('0x34')]['limit']);_0x40073a[_0x1463('0x1f')]=qs[_0x1463('0x1f')](_0x5a8e28[_0x1463('0x34')]['offset']);}_0x40073a[_0x1463('0x3b')]=qs[_0x1463('0x3c')](_0x5a8e28[_0x1463('0x34')][_0x1463('0x3c')]);_0x40073a[_0x1463('0x3d')]=qs[_0x1463('0x3e')](_[_0x1463('0x3f')](_0x5a8e28[_0x1463('0x34')],_0x1a3a17[_0x1463('0x3e')]),_0x18b0e5);if(_0x5a8e28[_0x1463('0x34')][_0x1463('0x40')]){_0x40073a[_0x1463('0x3d')]=_['merge'](_0x40073a['where'],{'$or':_['map'](_0x18b0e5,function(_0x4aea26){if(_0x4aea26[_0x1463('0x41')]!==_0x1463('0x42')){var _0x1453d={};_0x1453d[_0x4aea26['name']]={'$like':'%'+_0x5a8e28[_0x1463('0x34')][_0x1463('0x40')]+'%'};return _0x1453d;}})});}_0x40073a=_[_0x1463('0x43')]({},_0x40073a,_0x5a8e28[_0x1463('0x44')]);var _0x2e8d58={'where':_0x40073a[_0x1463('0x3d')]};return db[_0x1463('0x30')]['count'](_0x2e8d58)['then'](function(_0x4a97cf){_0xe9306a['count']=_0x4a97cf;if(_0x5a8e28[_0x1463('0x34')][_0x1463('0x45')]){_0x40073a['include']=[{'all':!![]}];}return db[_0x1463('0x30')][_0x1463('0x46')](_0x40073a);})['then'](function(_0x59977a){_0xe9306a['rows']=_0x59977a;return _0xe9306a;})['then'](respondWithFilteredResult(_0x1df8ef,_0x40073a))[_0x1463('0x47')](handleError(_0x1df8ef,null));};exports[_0x1463('0x48')]=function(_0x3237f7,_0x51262a){var _0x2bf0bf={'raw':!![],'where':{'id':_0x3237f7['params']['id']}},_0x46ccab={};_0x46ccab[_0x1463('0x35')]=_[_0x1463('0x49')](db[_0x1463('0x30')][_0x1463('0x31')]);_0x46ccab[_0x1463('0x34')]=_[_0x1463('0x49')](_0x3237f7[_0x1463('0x34')]);_0x46ccab[_0x1463('0x3e')]=_[_0x1463('0x37')](_0x46ccab[_0x1463('0x35')],_0x46ccab[_0x1463('0x34')]);_0x2bf0bf['attributes']=_['intersection'](_0x46ccab[_0x1463('0x35')],qs['fields'](_0x3237f7[_0x1463('0x34')][_0x1463('0x38')]));_0x2bf0bf['attributes']=_0x2bf0bf[_0x1463('0x36')][_0x1463('0x39')]?_0x2bf0bf['attributes']:_0x46ccab[_0x1463('0x35')];if(_0x3237f7[_0x1463('0x34')][_0x1463('0x45')]){_0x2bf0bf[_0x1463('0x4a')]=[{'all':!![]}];}_0x2bf0bf=_[_0x1463('0x43')]({},_0x2bf0bf,_0x3237f7[_0x1463('0x44')]);return db[_0x1463('0x30')][_0x1463('0x4b')](_0x2bf0bf)['then'](handleEntityNotFound(_0x51262a,null))[_0x1463('0x28')](respondWithResult(_0x51262a,null))[_0x1463('0x47')](handleError(_0x51262a,null));};exports[_0x1463('0x4c')]=function(_0xaa94f8,_0x5e6b91){return db[_0x1463('0x30')][_0x1463('0x4c')](_0xaa94f8['body'],{})[_0x1463('0x28')](respondWithResult(_0x5e6b91,0xc9))[_0x1463('0x47')](handleError(_0x5e6b91,null));};exports[_0x1463('0x27')]=function(_0x25b899,_0x52dd41){if(_0x25b899[_0x1463('0x4d')]['id']){delete _0x25b899[_0x1463('0x4d')]['id'];}return db[_0x1463('0x30')][_0x1463('0x4b')]({'where':{'id':_0x25b899[_0x1463('0x4e')]['id']}})['then'](handleEntityNotFound(_0x52dd41,null))[_0x1463('0x28')](saveUpdates(_0x25b899[_0x1463('0x4d')],null))['then'](respondWithResult(_0x52dd41,null))[_0x1463('0x47')](handleError(_0x52dd41,null));};exports[_0x1463('0x29')]=function(_0x5e5ff1,_0x5a3a51){return db[_0x1463('0x30')][_0x1463('0x4b')]({'where':{'id':_0x5e5ff1[_0x1463('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5a3a51,null))[_0x1463('0x28')](removeEntity(_0x5a3a51,null))[_0x1463('0x47')](handleError(_0x5a3a51,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 28fac68..69f751c 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 _0x5337=['define','MailServerOut','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./mailServerOut.attributes','exports'];(function(_0x331d92,_0x562814){var _0x56cfb3=function(_0x2a25de){while(--_0x2a25de){_0x331d92['push'](_0x331d92['shift']());}};_0x56cfb3(++_0x562814);}(_0x5337,0x146));var _0x7533=function(_0x1be3b3,_0x4335ee){_0x1be3b3=_0x1be3b3-0x0;var _0x4f8b2d=_0x5337[_0x1be3b3];return _0x4f8b2d;};'use strict';var _=require(_0x7533('0x0'));var util=require(_0x7533('0x1'));var logger=require(_0x7533('0x2'))(_0x7533('0x3'));var moment=require(_0x7533('0x4'));var BPromise=require(_0x7533('0x5'));var rp=require(_0x7533('0x6'));var fs=require('fs');var path=require(_0x7533('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7533('0x8'));module[_0x7533('0x9')]=function(_0x4850f0,_0x2dab2c){return _0x4850f0[_0x7533('0xa')](_0x7533('0xb'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd600=['./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','util','../../config/logger','api','bluebird','path','../../config/environment'];(function(_0x310b29,_0x37533e){var _0x35a48d=function(_0x4015d6){while(--_0x4015d6){_0x310b29['push'](_0x310b29['shift']());}};_0x35a48d(++_0x37533e);}(_0xd600,0x68));var _0x0d60=function(_0x14483d,_0x4ec19e){_0x14483d=_0x14483d-0x0;var _0x2306bb=_0xd600[_0x14483d];return _0x2306bb;};'use strict';var _=require('lodash');var util=require(_0x0d60('0x0'));var logger=require(_0x0d60('0x1'))(_0x0d60('0x2'));var moment=require('moment');var BPromise=require(_0x0d60('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0d60('0x4'));var rimraf=require('rimraf');var config=require(_0x0d60('0x5'));var attributes=require(_0x0d60('0x6'));module[_0x0d60('0x7')]=function(_0x18eff4,_0x44c324){return _0x18eff4[_0x0d60('0x8')](_0x0d60('0x9'),attributes,{'tableName':_0x0d60('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 60a26a0..21bcda1 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 _0x7a54=['info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7a54,0x106));var _0x47a5=function(_0x3daf57,_0x5c7ff9){_0x3daf57=_0x3daf57-0x0;var _0x2f7872=_0x7a54[_0x3daf57];return _0x2f7872;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x3f8820,_0x390cdf){var _0x595495=function(_0x1becdc){while(--_0x1becdc){_0x3f8820['push'](_0x3f8820['shift']());}};_0x595495(++_0x390cdf);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xc4aa[_0x255d5b];return _0x3e141a;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 574ac3f..2d13cec 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 _0x66d6=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','exports','multer'];(function(_0x5dad35,_0x26f4d5){var _0x5b18ca=function(_0x395327){while(--_0x395327){_0x5dad35['push'](_0x5dad35['shift']());}};_0x5b18ca(++_0x26f4d5);}(_0x66d6,0x12b));var _0x666d=function(_0x4e808c,_0x3ebb84){_0x4e808c=_0x4e808c-0x0;var _0x1db4c6=_0x66d6[_0x4e808c];return _0x1db4c6;};'use strict';var multer=require(_0x666d('0x0'));var util=require(_0x666d('0x1'));var path=require(_0x666d('0x2'));var timeout=require(_0x666d('0x3'));var express=require('express');var router=express[_0x666d('0x4')]();var fs_extra=require(_0x666d('0x5'));var auth=require(_0x666d('0x6'));var interaction=require(_0x666d('0x7'));var config=require(_0x666d('0x8'));var controller=require('./mailSubstatus.controller');router[_0x666d('0x9')]('/',auth[_0x666d('0xa')](),controller[_0x666d('0xb')]);router['get'](_0x666d('0xc'),auth['isAuthenticated'](),controller[_0x666d('0xd')]);router[_0x666d('0x9')](_0x666d('0xe'),auth['isAuthenticated'](),controller[_0x666d('0xf')]);router[_0x666d('0x10')]('/',auth[_0x666d('0xa')](),controller[_0x666d('0x11')]);router[_0x666d('0x12')](_0x666d('0xe'),auth[_0x666d('0xa')](),controller['update']);router['delete']('/:id',auth[_0x666d('0xa')](),controller['destroy']);module[_0x666d('0x13')]=router; \ No newline at end of file +var _0x620c=['delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./mailSubstatus.controller','get','isAuthenticated','describe','/:id','show','post','create','put','update'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0x620c,0x88));var _0xc620=function(_0x51a654,_0xb8c7e4){_0x51a654=_0x51a654-0x0;var _0x1c98aa=_0x620c[_0x51a654];return _0x1c98aa;};'use strict';var multer=require('multer');var util=require(_0xc620('0x0'));var path=require(_0xc620('0x1'));var timeout=require(_0xc620('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc620('0x3'));var auth=require(_0xc620('0x4'));var interaction=require(_0xc620('0x5'));var config=require('../../config/environment');var controller=require(_0xc620('0x6'));router[_0xc620('0x7')]('/',auth[_0xc620('0x8')](),controller['index']);router[_0xc620('0x7')]('/describe',auth[_0xc620('0x8')](),controller[_0xc620('0x9')]);router[_0xc620('0x7')](_0xc620('0xa'),auth[_0xc620('0x8')](),controller[_0xc620('0xb')]);router[_0xc620('0xc')]('/',auth[_0xc620('0x8')](),controller[_0xc620('0xd')]);router[_0xc620('0xe')](_0xc620('0xa'),auth['isAuthenticated'](),controller[_0xc620('0xf')]);router[_0xc620('0x10')](_0xc620('0xa'),auth[_0xc620('0x8')](),controller[_0xc620('0x11')]);module[_0xc620('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 9d0b748..3580fb5 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 _0x236d=['sequelize','exports','name'];(function(_0x4f3c9b,_0x28e078){var _0x84e58a=function(_0x37bf49){while(--_0x37bf49){_0x4f3c9b['push'](_0x4f3c9b['shift']());}};_0x84e58a(++_0x28e078);}(_0x236d,0x7e));var _0xd236=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x236d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd236('0x0'));module[_0xd236('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xd236('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x029b=['name','STRING','sequelize','exports'];(function(_0x505088,_0x23a321){var _0x3eb2c9=function(_0x2fcf8d){while(--_0x2fcf8d){_0x505088['push'](_0x505088['shift']());}};_0x3eb2c9(++_0x23a321);}(_0x029b,0x66));var _0xb029=function(_0x150a27,_0x5cadcc){_0x150a27=_0x150a27-0x0;var _0x1ea5e1=_0x029b[_0x150a27];return _0x1ea5e1;};'use strict';var Sequelize=require(_0xb029('0x0'));module[_0xb029('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xb029('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb029('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 011894a..8badf5b 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 _0x9ebe=['index','MailSubstatus','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','include','rows','catch','show','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','limit','offset','count','set','json','apply','reject','update','then','destroy','error','stack','name'];(function(_0x65c50e,_0x1aa926){var _0x4573e7=function(_0x5bc049){while(--_0x5bc049){_0x65c50e['push'](_0x65c50e['shift']());}};_0x4573e7(++_0x1aa926);}(_0x9ebe,0xa6));var _0xe9eb=function(_0x4371d9,_0x47ff82){_0x4371d9=_0x4371d9-0x0;var _0x1fd8b7=_0x9ebe[_0x4371d9];return _0x1fd8b7;};'use strict';var emlformat=require(_0xe9eb('0x0'));var rimraf=require(_0xe9eb('0x1'));var zipdir=require(_0xe9eb('0x2'));var jsonpatch=require(_0xe9eb('0x3'));var rp=require('request-promise');var moment=require(_0xe9eb('0x4'));var BPromise=require(_0xe9eb('0x5'));var Mustache=require(_0xe9eb('0x6'));var util=require(_0xe9eb('0x7'));var path=require(_0xe9eb('0x8'));var sox=require('sox');var csv=require(_0xe9eb('0x9'));var ejs=require(_0xe9eb('0xa'));var fs=require('fs');var fs_extra=require(_0xe9eb('0xb'));var _=require(_0xe9eb('0xc'));var squel=require(_0xe9eb('0xd'));var crypto=require(_0xe9eb('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe9eb('0xf'));var toCsv=require(_0xe9eb('0x9'));var querystring=require('querystring');var Papa=require(_0xe9eb('0x10'));var Redis=require(_0xe9eb('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe9eb('0x12'));var logger=require(_0xe9eb('0x13'))(_0xe9eb('0x14'));var utils=require(_0xe9eb('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5358eb,_0x342779){_0x342779=_0x342779||0xcc;return function(_0x5e475f){if(_0x5e475f){return _0x5358eb[_0xe9eb('0x16')](_0x342779);}return _0x5358eb[_0xe9eb('0x17')](_0x342779)[_0xe9eb('0x18')]();};}function respondWithResult(_0x405c5c,_0xe9d351){_0xe9d351=_0xe9d351||0xc8;return function(_0x55396b){if(_0x55396b){return _0x405c5c['status'](_0xe9d351)['json'](_0x55396b);}};}function respondWithFilteredResult(_0xe1d0f7,_0x585713){return function(_0x4ad498){if(_0x4ad498){var _0x397715=typeof _0x585713['offset']==='undefined'&&typeof _0x585713[_0xe9eb('0x19')]==='undefined';var _0x58d1bd=_0x4ad498['count'];var _0x527019=_0x397715?0x0:_0x585713[_0xe9eb('0x1a')];var _0x52a3fb=_0x397715?_0x4ad498[_0xe9eb('0x1b')]:_0x585713[_0xe9eb('0x1a')]+_0x585713[_0xe9eb('0x19')];var _0x15a5f5;if(_0x52a3fb>=_0x58d1bd){_0x52a3fb=_0x58d1bd;_0x15a5f5=0xc8;}else{_0x15a5f5=0xce;}_0xe1d0f7[_0xe9eb('0x17')](_0x15a5f5);return _0xe1d0f7[_0xe9eb('0x1c')]('Content-Range',_0x527019+'-'+_0x52a3fb+'/'+_0x58d1bd)[_0xe9eb('0x1d')](_0x4ad498);}return null;};}function patchUpdates(_0x1baabf){return function(_0x2ec123){try{jsonpatch[_0xe9eb('0x1e')](_0x2ec123,_0x1baabf,!![]);}catch(_0x10e952){return BPromise[_0xe9eb('0x1f')](_0x10e952);}return _0x2ec123['save']();};}function saveUpdates(_0x499a7a,_0x1e6599){return function(_0x12908d){if(_0x12908d){return _0x12908d[_0xe9eb('0x20')](_0x499a7a)[_0xe9eb('0x21')](function(_0x1d1843){return _0x1d1843;});}return null;};}function removeEntity(_0x3a5226,_0x128c19){return function(_0x39670a){if(_0x39670a){return _0x39670a[_0xe9eb('0x22')]()[_0xe9eb('0x21')](function(){_0x3a5226['status'](0xcc)[_0xe9eb('0x18')]();});}};}function handleEntityNotFound(_0x713606,_0x8f4d63){return function(_0x4f4a3f){if(!_0x4f4a3f){_0x713606[_0xe9eb('0x16')](0x194);}return _0x4f4a3f;};}function handleError(_0x21b15b,_0x2beaf6){_0x2beaf6=_0x2beaf6||0x1f4;return function(_0x237b77){logger[_0xe9eb('0x23')](_0x237b77[_0xe9eb('0x24')]);if(_0x237b77[_0xe9eb('0x25')]){delete _0x237b77[_0xe9eb('0x25')];}_0x21b15b[_0xe9eb('0x17')](_0x2beaf6)['send'](_0x237b77);};}exports[_0xe9eb('0x26')]=function(_0x4af273,_0x503a3f){var _0x4524db={},_0x1bc151={},_0x24a9e0={'count':0x0,'rows':[]};var _0x25a092=_['map'](db[_0xe9eb('0x27')][_0xe9eb('0x28')],function(_0x347385){return{'name':_0x347385[_0xe9eb('0x29')],'type':_0x347385[_0xe9eb('0x2a')]['key']};});_0x1bc151['model']=_[_0xe9eb('0x2b')](_0x25a092,'name');_0x1bc151[_0xe9eb('0x2c')]=_[_0xe9eb('0x2d')](_0x4af273['query']);_0x1bc151[_0xe9eb('0x2e')]=_[_0xe9eb('0x2f')](_0x1bc151[_0xe9eb('0x30')],_0x1bc151[_0xe9eb('0x2c')]);_0x4524db[_0xe9eb('0x31')]=_[_0xe9eb('0x2f')](_0x1bc151[_0xe9eb('0x30')],qs[_0xe9eb('0x32')](_0x4af273[_0xe9eb('0x2c')][_0xe9eb('0x32')]));_0x4524db[_0xe9eb('0x31')]=_0x4524db[_0xe9eb('0x31')][_0xe9eb('0x33')]?_0x4524db[_0xe9eb('0x31')]:_0x1bc151[_0xe9eb('0x30')];if(!_0x4af273[_0xe9eb('0x2c')]['hasOwnProperty'](_0xe9eb('0x34'))){_0x4524db[_0xe9eb('0x19')]=qs[_0xe9eb('0x19')](_0x4af273[_0xe9eb('0x2c')][_0xe9eb('0x19')]);_0x4524db[_0xe9eb('0x1a')]=qs['offset'](_0x4af273[_0xe9eb('0x2c')][_0xe9eb('0x1a')]);}_0x4524db['order']=qs[_0xe9eb('0x35')](_0x4af273[_0xe9eb('0x2c')][_0xe9eb('0x35')]);_0x4524db['where']=qs[_0xe9eb('0x2e')](_[_0xe9eb('0x36')](_0x4af273['query'],_0x1bc151['filters']),_0x25a092);if(_0x4af273[_0xe9eb('0x2c')][_0xe9eb('0x37')]){_0x4524db[_0xe9eb('0x38')]=_['merge'](_0x4524db['where'],{'$or':_[_0xe9eb('0x2b')](_0x25a092,function(_0x8b69da){if(_0x8b69da['type']!==_0xe9eb('0x39')){var _0x45aaf0={};_0x45aaf0[_0x8b69da[_0xe9eb('0x25')]]={'$like':'%'+_0x4af273[_0xe9eb('0x2c')]['filter']+'%'};return _0x45aaf0;}})});}_0x4524db=_[_0xe9eb('0x3a')]({},_0x4524db,_0x4af273[_0xe9eb('0x3b')]);var _0x596065={'where':_0x4524db[_0xe9eb('0x38')]};return db[_0xe9eb('0x27')][_0xe9eb('0x1b')](_0x596065)[_0xe9eb('0x21')](function(_0x354cc9){_0x24a9e0[_0xe9eb('0x1b')]=_0x354cc9;if(_0x4af273['query']['includeAll']){_0x4524db[_0xe9eb('0x3c')]=[{'all':!![]}];}return db[_0xe9eb('0x27')]['findAll'](_0x4524db);})[_0xe9eb('0x21')](function(_0x4cbac1){_0x24a9e0[_0xe9eb('0x3d')]=_0x4cbac1;return _0x24a9e0;})[_0xe9eb('0x21')](respondWithFilteredResult(_0x503a3f,_0x4524db))[_0xe9eb('0x3e')](handleError(_0x503a3f,null));};exports[_0xe9eb('0x3f')]=function(_0x4169fe,_0xacd2d3){var _0x33ac9d={'raw':!![],'where':{'id':_0x4169fe['params']['id']}},_0x5afebf={};_0x5afebf[_0xe9eb('0x30')]=_['keys'](db['MailSubstatus'][_0xe9eb('0x28')]);_0x5afebf[_0xe9eb('0x2c')]=_[_0xe9eb('0x2d')](_0x4169fe['query']);_0x5afebf[_0xe9eb('0x2e')]=_[_0xe9eb('0x2f')](_0x5afebf[_0xe9eb('0x30')],_0x5afebf[_0xe9eb('0x2c')]);_0x33ac9d['attributes']=_[_0xe9eb('0x2f')](_0x5afebf[_0xe9eb('0x30')],qs['fields'](_0x4169fe['query'][_0xe9eb('0x32')]));_0x33ac9d[_0xe9eb('0x31')]=_0x33ac9d['attributes']['length']?_0x33ac9d['attributes']:_0x5afebf[_0xe9eb('0x30')];if(_0x4169fe['query']['includeAll']){_0x33ac9d[_0xe9eb('0x3c')]=[{'all':!![]}];}_0x33ac9d=_[_0xe9eb('0x3a')]({},_0x33ac9d,_0x4169fe['options']);return db[_0xe9eb('0x27')]['find'](_0x33ac9d)[_0xe9eb('0x21')](handleEntityNotFound(_0xacd2d3,null))[_0xe9eb('0x21')](respondWithResult(_0xacd2d3,null))[_0xe9eb('0x3e')](handleError(_0xacd2d3,null));};exports[_0xe9eb('0x40')]=function(_0x5c6e78,_0x4cd41){return db[_0xe9eb('0x27')][_0xe9eb('0x40')](_0x5c6e78['body'],{})[_0xe9eb('0x21')](respondWithResult(_0x4cd41,0xc9))['catch'](handleError(_0x4cd41,null));};exports['update']=function(_0x5f1989,_0x45097c){if(_0x5f1989[_0xe9eb('0x41')]['id']){delete _0x5f1989[_0xe9eb('0x41')]['id'];}return db[_0xe9eb('0x27')]['find']({'where':{'id':_0x5f1989[_0xe9eb('0x42')]['id']}})['then'](handleEntityNotFound(_0x45097c,null))[_0xe9eb('0x21')](saveUpdates(_0x5f1989['body'],null))[_0xe9eb('0x21')](respondWithResult(_0x45097c,null))['catch'](handleError(_0x45097c,null));};exports['destroy']=function(_0x1c0519,_0x1c1874){return db['MailSubstatus']['find']({'where':{'id':_0x1c0519[_0xe9eb('0x42')]['id']}})[_0xe9eb('0x21')](handleEntityNotFound(_0x1c1874,null))['then'](removeEntity(_0x1c1874,null))[_0xe9eb('0x3e')](handleError(_0x1c1874,null));};exports[_0xe9eb('0x43')]=function(_0x501596,_0x4c3600){return db[_0xe9eb('0x27')]['describe']()['then'](respondWithResult(_0x4c3600,null))[_0xe9eb('0x3e')](handleError(_0x4c3600,null));}; \ No newline at end of file +var _0x557b=['end','json','undefined','limit','count','offset','status','set','Content-Range','apply','save','then','stack','name','index','map','type','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','MailSubstatus','includeAll','include','findAll','rows','show','params','rawAttributes','catch','create','body','destroy','find','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x2edfb7,_0x4c2b5b){var _0x2d66c0=function(_0x2bdcd0){while(--_0x2bdcd0){_0x2edfb7['push'](_0x2edfb7['shift']());}};_0x2d66c0(++_0x4c2b5b);}(_0x557b,0x1e7));var _0xb557=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0x557b[_0x1cfa0d];return _0xe33279;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb557('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb557('0x1'));var rp=require(_0xb557('0x2'));var moment=require(_0xb557('0x3'));var BPromise=require(_0xb557('0x4'));var Mustache=require('mustache');var util=require(_0xb557('0x5'));var path=require(_0xb557('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb557('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb557('0x8'));var crypto=require(_0xb557('0x9'));var jsforce=require(_0xb557('0xa'));var deskjs=require(_0xb557('0xb'));var toCsv=require(_0xb557('0xc'));var querystring=require(_0xb557('0xd'));var Papa=require('papaparse');var Redis=require(_0xb557('0xe'));var authService=require(_0xb557('0xf'));var qs=require(_0xb557('0x10'));var as=require(_0xb557('0x11'));var hardwareService=require(_0xb557('0x12'));var logger=require(_0xb557('0x13'))(_0xb557('0x14'));var utils=require(_0xb557('0x15'));var config=require(_0xb557('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xb557('0x17'))['db'];function respondWithStatusCode(_0x3c1273,_0x31c13d){_0x31c13d=_0x31c13d||0xcc;return function(_0x3242ed){if(_0x3242ed){return _0x3c1273['sendStatus'](_0x31c13d);}return _0x3c1273['status'](_0x31c13d)[_0xb557('0x18')]();};}function respondWithResult(_0x2bc046,_0x4140bb){_0x4140bb=_0x4140bb||0xc8;return function(_0xa79ad6){if(_0xa79ad6){return _0x2bc046['status'](_0x4140bb)[_0xb557('0x19')](_0xa79ad6);}};}function respondWithFilteredResult(_0x18938b,_0x1e5107){return function(_0x43dc7f){if(_0x43dc7f){var _0xec81fb=typeof _0x1e5107['offset']===_0xb557('0x1a')&&typeof _0x1e5107[_0xb557('0x1b')]===_0xb557('0x1a');var _0x4d69bc=_0x43dc7f[_0xb557('0x1c')];var _0x15aa8f=_0xec81fb?0x0:_0x1e5107[_0xb557('0x1d')];var _0x12b8b2=_0xec81fb?_0x43dc7f[_0xb557('0x1c')]:_0x1e5107[_0xb557('0x1d')]+_0x1e5107[_0xb557('0x1b')];var _0xb01164;if(_0x12b8b2>=_0x4d69bc){_0x12b8b2=_0x4d69bc;_0xb01164=0xc8;}else{_0xb01164=0xce;}_0x18938b[_0xb557('0x1e')](_0xb01164);return _0x18938b[_0xb557('0x1f')](_0xb557('0x20'),_0x15aa8f+'-'+_0x12b8b2+'/'+_0x4d69bc)['json'](_0x43dc7f);}return null;};}function patchUpdates(_0x410fb9){return function(_0x4532dd){try{jsonpatch[_0xb557('0x21')](_0x4532dd,_0x410fb9,!![]);}catch(_0x453363){return BPromise['reject'](_0x453363);}return _0x4532dd[_0xb557('0x22')]();};}function saveUpdates(_0x5a5986,_0x1b8a7f){return function(_0x33732d){if(_0x33732d){return _0x33732d['update'](_0x5a5986)[_0xb557('0x23')](function(_0x3c84a6){return _0x3c84a6;});}return null;};}function removeEntity(_0x49fc11,_0x1d98cc){return function(_0x288188){if(_0x288188){return _0x288188['destroy']()['then'](function(){_0x49fc11[_0xb557('0x1e')](0xcc)[_0xb557('0x18')]();});}};}function handleEntityNotFound(_0x51b862,_0x515bc4){return function(_0x3e0c42){if(!_0x3e0c42){_0x51b862['sendStatus'](0x194);}return _0x3e0c42;};}function handleError(_0xd90106,_0x365eba){_0x365eba=_0x365eba||0x1f4;return function(_0xe15e8b){logger['error'](_0xe15e8b[_0xb557('0x24')]);if(_0xe15e8b[_0xb557('0x25')]){delete _0xe15e8b['name'];}_0xd90106[_0xb557('0x1e')](_0x365eba)['send'](_0xe15e8b);};}exports[_0xb557('0x26')]=function(_0x4f283c,_0x4cd04e){var _0x41d48a={},_0x2adef2={},_0x4f057d={'count':0x0,'rows':[]};var _0x3dca50=_[_0xb557('0x27')](db['MailSubstatus']['rawAttributes'],function(_0x2e4a25){return{'name':_0x2e4a25['fieldName'],'type':_0x2e4a25[_0xb557('0x28')]['key']};});_0x2adef2['model']=_[_0xb557('0x27')](_0x3dca50,_0xb557('0x25'));_0x2adef2[_0xb557('0x29')]=_[_0xb557('0x2a')](_0x4f283c[_0xb557('0x29')]);_0x2adef2[_0xb557('0x2b')]=_[_0xb557('0x2c')](_0x2adef2['model'],_0x2adef2[_0xb557('0x29')]);_0x41d48a[_0xb557('0x2d')]=_['intersection'](_0x2adef2[_0xb557('0x2e')],qs[_0xb557('0x2f')](_0x4f283c[_0xb557('0x29')]['fields']));_0x41d48a[_0xb557('0x2d')]=_0x41d48a['attributes'][_0xb557('0x30')]?_0x41d48a[_0xb557('0x2d')]:_0x2adef2[_0xb557('0x2e')];if(!_0x4f283c[_0xb557('0x29')][_0xb557('0x31')](_0xb557('0x32'))){_0x41d48a[_0xb557('0x1b')]=qs[_0xb557('0x1b')](_0x4f283c[_0xb557('0x29')][_0xb557('0x1b')]);_0x41d48a[_0xb557('0x1d')]=qs[_0xb557('0x1d')](_0x4f283c['query'][_0xb557('0x1d')]);}_0x41d48a[_0xb557('0x33')]=qs[_0xb557('0x34')](_0x4f283c[_0xb557('0x29')][_0xb557('0x34')]);_0x41d48a['where']=qs[_0xb557('0x2b')](_[_0xb557('0x35')](_0x4f283c['query'],_0x2adef2[_0xb557('0x2b')]),_0x3dca50);if(_0x4f283c[_0xb557('0x29')][_0xb557('0x36')]){_0x41d48a[_0xb557('0x37')]=_[_0xb557('0x38')](_0x41d48a[_0xb557('0x37')],{'$or':_['map'](_0x3dca50,function(_0x3aa425){if(_0x3aa425[_0xb557('0x28')]!==_0xb557('0x39')){var _0xa6ceaa={};_0xa6ceaa[_0x3aa425[_0xb557('0x25')]]={'$like':'%'+_0x4f283c[_0xb557('0x29')][_0xb557('0x36')]+'%'};return _0xa6ceaa;}})});}_0x41d48a=_[_0xb557('0x38')]({},_0x41d48a,_0x4f283c[_0xb557('0x3a')]);var _0x4dcf9c={'where':_0x41d48a[_0xb557('0x37')]};return db[_0xb557('0x3b')][_0xb557('0x1c')](_0x4dcf9c)[_0xb557('0x23')](function(_0xc863a){_0x4f057d['count']=_0xc863a;if(_0x4f283c[_0xb557('0x29')][_0xb557('0x3c')]){_0x41d48a[_0xb557('0x3d')]=[{'all':!![]}];}return db[_0xb557('0x3b')][_0xb557('0x3e')](_0x41d48a);})[_0xb557('0x23')](function(_0x61fe5f){_0x4f057d[_0xb557('0x3f')]=_0x61fe5f;return _0x4f057d;})[_0xb557('0x23')](respondWithFilteredResult(_0x4cd04e,_0x41d48a))['catch'](handleError(_0x4cd04e,null));};exports[_0xb557('0x40')]=function(_0x3e3884,_0x4545cc){var _0x521af2={'raw':!![],'where':{'id':_0x3e3884[_0xb557('0x41')]['id']}},_0xf3e541={};_0xf3e541[_0xb557('0x2e')]=_[_0xb557('0x2a')](db[_0xb557('0x3b')][_0xb557('0x42')]);_0xf3e541[_0xb557('0x29')]=_[_0xb557('0x2a')](_0x3e3884['query']);_0xf3e541[_0xb557('0x2b')]=_['intersection'](_0xf3e541[_0xb557('0x2e')],_0xf3e541['query']);_0x521af2['attributes']=_[_0xb557('0x2c')](_0xf3e541[_0xb557('0x2e')],qs[_0xb557('0x2f')](_0x3e3884[_0xb557('0x29')]['fields']));_0x521af2['attributes']=_0x521af2[_0xb557('0x2d')]['length']?_0x521af2['attributes']:_0xf3e541[_0xb557('0x2e')];if(_0x3e3884[_0xb557('0x29')][_0xb557('0x3c')]){_0x521af2[_0xb557('0x3d')]=[{'all':!![]}];}_0x521af2=_[_0xb557('0x38')]({},_0x521af2,_0x3e3884['options']);return db[_0xb557('0x3b')]['find'](_0x521af2)[_0xb557('0x23')](handleEntityNotFound(_0x4545cc,null))[_0xb557('0x23')](respondWithResult(_0x4545cc,null))[_0xb557('0x43')](handleError(_0x4545cc,null));};exports['create']=function(_0x307769,_0xdc90f8){return db[_0xb557('0x3b')][_0xb557('0x44')](_0x307769['body'],{})[_0xb557('0x23')](respondWithResult(_0xdc90f8,0xc9))[_0xb557('0x43')](handleError(_0xdc90f8,null));};exports['update']=function(_0x5c818c,_0x1992b0){if(_0x5c818c[_0xb557('0x45')]['id']){delete _0x5c818c[_0xb557('0x45')]['id'];}return db[_0xb557('0x3b')]['find']({'where':{'id':_0x5c818c[_0xb557('0x41')]['id']}})[_0xb557('0x23')](handleEntityNotFound(_0x1992b0,null))[_0xb557('0x23')](saveUpdates(_0x5c818c[_0xb557('0x45')],null))[_0xb557('0x23')](respondWithResult(_0x1992b0,null))['catch'](handleError(_0x1992b0,null));};exports[_0xb557('0x46')]=function(_0x49db8c,_0x55f1e8){return db['MailSubstatus'][_0xb557('0x47')]({'where':{'id':_0x49db8c[_0xb557('0x41')]['id']}})[_0xb557('0x23')](handleEntityNotFound(_0x55f1e8,null))[_0xb557('0x23')](removeEntity(_0x55f1e8,null))['catch'](handleError(_0x55f1e8,null));};exports[_0xb557('0x48')]=function(_0x5f0a08,_0x1928cf){return db['MailSubstatus'][_0xb557('0x48')]()[_0xb557('0x23')](respondWithResult(_0x1928cf,null))[_0xb557('0x43')](handleError(_0x1928cf,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 450a7ec..b892e2d 100644 --- a/server/api/mailSubstatus/mailSubstatus.events.js +++ b/server/api/mailSubstatus/mailSubstatus.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x768c=['hook','exports','events','../../mysqldb','MailSubstatus','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x768c,0x197));var _0xc768=function(_0x294096,_0x40247b){_0x294096=_0x294096-0x0;var _0x18b4b6=_0x768c[_0x294096];return _0x18b4b6;};'use strict';var EventEmitter=require(_0xc768('0x0'));var MailSubstatus=require(_0xc768('0x1'))['db'][_0xc768('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xc768('0x3')](0x0);var events={'afterUpdate':_0xc768('0x4')};function emitEvent(_0x1d92b3){return function(_0x124885,_0x5836fa,_0x5de26a){MailSubstatusEvents[_0xc768('0x5')](_0x1d92b3+':'+_0x124885['id'],_0x124885);MailSubstatusEvents[_0xc768('0x5')](_0x1d92b3,_0x124885);_0x5de26a(null);};}for(var e in events){if(events[_0xc768('0x6')](e)){var event=events[e];MailSubstatus[_0xc768('0x7')](e,emitEvent(event));}}module[_0xc768('0x8')]=MailSubstatusEvents; \ No newline at end of file +var _0x9fd0=['hook','events','../../mysqldb','MailSubstatus','setMaxListeners','emit'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0x9fd0,0xf7));var _0x09fd=function(_0x413a0d,_0x30a7ca){_0x413a0d=_0x413a0d-0x0;var _0x40544a=_0x9fd0[_0x413a0d];return _0x40544a;};'use strict';var EventEmitter=require(_0x09fd('0x0'));var MailSubstatus=require(_0x09fd('0x1'))['db'][_0x09fd('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x09fd('0x3')](0x0);var events={'afterUpdate':'update'};function emitEvent(_0x1a28d0){return function(_0x120d96,_0x5d24ce,_0xe439f6){MailSubstatusEvents[_0x09fd('0x4')](_0x1a28d0+':'+_0x120d96['id'],_0x120d96);MailSubstatusEvents['emit'](_0x1a28d0,_0x120d96);_0xe439f6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0x09fd('0x5')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index d2cb5cf..fe157b0 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 _0x2223=['name','mailSubstatus','_previousDataValues','then','./mailSubstatus.attributes','exports','models','define','mail_substatuses'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0x2223,0xee));var _0x3222=function(_0x3a4ecd,_0x1d322b){_0x3a4ecd=_0x3a4ecd-0x0;var _0x237983=_0x2223[_0x3a4ecd];return _0x237983;};'use strict';var attributes=require(_0x3222('0x0'));module[_0x3222('0x1')]=function(_0x24e188){var _0x3947fa=_0x24e188[_0x3222('0x2')];return _0x24e188[_0x3222('0x3')]('MailSubstatus',attributes,{'tableName':_0x3222('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x3bfdc7,_0x27d727,_0x4752ef){return _0x3947fa['Condition']['update']({'value':_0x3bfdc7[_0x3222('0x5')]},{'where':{'field':_0x3222('0x6'),'value':_0x3bfdc7[_0x3222('0x7')]['name']}})[_0x3222('0x8')](function(){_0x4752ef();})['catch'](function(_0x4da330){_0x4752ef(_0x4da330);});}}});}; \ No newline at end of file +var _0x12fd=['MailSubstatus','mail_substatuses','Condition','update','mailSubstatus','_previousDataValues','catch','models'];(function(_0x18a810,_0xb4fe85){var _0xfcfe45=function(_0x1f2bd1){while(--_0x1f2bd1){_0x18a810['push'](_0x18a810['shift']());}};_0xfcfe45(++_0xb4fe85);}(_0x12fd,0xf7));var _0xd12f=function(_0x4c171c,_0x2ecbc0){_0x4c171c=_0x4c171c-0x0;var _0xb57eed=_0x12fd[_0x4c171c];return _0xb57eed;};'use strict';var attributes=require('./mailSubstatus.attributes');module['exports']=function(_0x3e9c3c){var _0x46ddd6=_0x3e9c3c[_0xd12f('0x0')];return _0x3e9c3c['define'](_0xd12f('0x1'),attributes,{'tableName':_0xd12f('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x314991,_0x4cb72f,_0x13a19e){return _0x46ddd6[_0xd12f('0x3')][_0xd12f('0x4')]({'value':_0x314991['name']},{'where':{'field':_0xd12f('0x5'),'value':_0x314991[_0xd12f('0x6')]['name']}})['then'](function(){_0x13a19e();})[_0xd12f('0x7')](function(_0x3f14ac){_0x13a19e(_0x3f14ac);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 0e220b3..bf52be7 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 _0x338e=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','MailSubstatus,\x20%s,\x20%s','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x338e,0x137));var _0xe338=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x338e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe338('0x0'));var util=require(_0xe338('0x1'));var moment=require(_0xe338('0x2'));var BPromise=require(_0xe338('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe338('0x4'));var db=require(_0xe338('0x5'))['db'];var utils=require(_0xe338('0x6'));var logger=require(_0xe338('0x7'))(_0xe338('0x8'));var config=require(_0xe338('0x9'));var jayson=require(_0xe338('0xa'));var client=jayson[_0xe338('0xb')][_0xe338('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xd33ca7,_0x27f0e7,_0x2ffb42){return new BPromise(function(_0x54977d,_0x3e7ec6){return client[_0xe338('0xd')](_0xd33ca7,_0x2ffb42)[_0xe338('0xe')](function(_0x4b5978){logger['info'](_0xe338('0xf'),_0x27f0e7,'request\x20sent');logger[_0xe338('0x10')](_0xe338('0x11'),_0x27f0e7,_0xe338('0x12'),JSON['stringify'](_0x4b5978));if(_0x4b5978[_0xe338('0x13')]){if(_0x4b5978['error'][_0xe338('0x14')]===0x1f4){logger['error'](_0xe338('0xf'),_0x27f0e7,_0x4b5978[_0xe338('0x13')][_0xe338('0x15')]);return _0x3e7ec6(_0x4b5978[_0xe338('0x13')]['message']);}logger[_0xe338('0x13')]('MailSubstatus,\x20%s,\x20%s',_0x27f0e7,_0x4b5978['error'][_0xe338('0x15')]);return _0x54977d(_0x4b5978['error'][_0xe338('0x15')]);}else{logger['info'](_0xe338('0xf'),_0x27f0e7,'request\x20sent');_0x54977d(_0x4b5978[_0xe338('0x16')]['message']);}})[_0xe338('0x17')](function(_0x4ade13){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x27f0e7,_0x4ade13);_0x3e7ec6(_0x4ade13);});});} \ No newline at end of file +var _0x5b2e=['catch','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','MailSubstatus,\x20%s,\x20%s','debug','request\x20sent','error','code','message'];(function(_0x22b65a,_0x52ac5b){var _0x4e9ce6=function(_0xeb6347){while(--_0xeb6347){_0x22b65a['push'](_0x22b65a['shift']());}};_0x4e9ce6(++_0x52ac5b);}(_0x5b2e,0xe5));var _0xe5b2=function(_0x13c7c2,_0x9846df){_0x13c7c2=_0x13c7c2-0x0;var _0x13a7d8=_0x5b2e[_0x13c7c2];return _0x13a7d8;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xe5b2('0x0'));var rs=require(_0xe5b2('0x1'));var fs=require('fs');var Redis=require(_0xe5b2('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe5b2('0x3'));var logger=require(_0xe5b2('0x4'))(_0xe5b2('0x5'));var config=require(_0xe5b2('0x6'));var jayson=require(_0xe5b2('0x7'));var client=jayson['client'][_0xe5b2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x23fdcb,_0x47a565,_0x109939){return new BPromise(function(_0x615ad,_0x4e13dc){return client[_0xe5b2('0x9')](_0x23fdcb,_0x109939)[_0xe5b2('0xa')](function(_0xaf13c4){logger[_0xe5b2('0xb')](_0xe5b2('0xc'),_0x47a565,'request\x20sent');logger[_0xe5b2('0xd')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x47a565,_0xe5b2('0xe'),JSON['stringify'](_0xaf13c4));if(_0xaf13c4[_0xe5b2('0xf')]){if(_0xaf13c4['error'][_0xe5b2('0x10')]===0x1f4){logger['error'](_0xe5b2('0xc'),_0x47a565,_0xaf13c4['error'][_0xe5b2('0x11')]);return _0x4e13dc(_0xaf13c4[_0xe5b2('0xf')]['message']);}logger[_0xe5b2('0xf')](_0xe5b2('0xc'),_0x47a565,_0xaf13c4[_0xe5b2('0xf')][_0xe5b2('0x11')]);return _0x615ad(_0xaf13c4[_0xe5b2('0xf')][_0xe5b2('0x11')]);}else{logger['info']('MailSubstatus,\x20%s,\x20%s',_0x47a565,_0xe5b2('0xe'));_0x615ad(_0xaf13c4['result'][_0xe5b2('0x11')]);}})[_0xe5b2('0x12')](function(_0x409235){logger[_0xe5b2('0xf')](_0xe5b2('0xc'),_0x47a565,_0x409235);_0x4e13dc(_0x409235);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 9cbcb6c..374edaf 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 _0x3b4a=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','describe','/:id','post','put','delete','exports','multer'];(function(_0x375e07,_0x58015a){var _0x2381af=function(_0x4a8f20){while(--_0x4a8f20){_0x375e07['push'](_0x375e07['shift']());}};_0x2381af(++_0x58015a);}(_0x3b4a,0x168));var _0xa3b4=function(_0x4a0c72,_0x4db3a3){_0x4a0c72=_0x4a0c72-0x0;var _0x37763b=_0x3b4a[_0x4a0c72];return _0x37763b;};'use strict';var multer=require(_0xa3b4('0x0'));var util=require(_0xa3b4('0x1'));var path=require(_0xa3b4('0x2'));var timeout=require(_0xa3b4('0x3'));var express=require(_0xa3b4('0x4'));var router=express[_0xa3b4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xa3b4('0x6'));var interaction=require(_0xa3b4('0x7'));var config=require(_0xa3b4('0x8'));var controller=require(_0xa3b4('0x9'));router[_0xa3b4('0xa')]('/',auth[_0xa3b4('0xb')](),controller[_0xa3b4('0xc')]);router[_0xa3b4('0xa')]('/describe',auth[_0xa3b4('0xb')](),controller[_0xa3b4('0xd')]);router[_0xa3b4('0xa')](_0xa3b4('0xe'),auth[_0xa3b4('0xb')](),controller['show']);router[_0xa3b4('0xf')]('/',auth[_0xa3b4('0xb')](),controller['create']);router[_0xa3b4('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xa3b4('0x11')](_0xa3b4('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0xa3b4('0x12')]=router; \ No newline at end of file +var _0x83ca=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','isAuthenticated','index','get','/describe','describe','create','put','/:id','update','destroy','multer','util','path','express','Router'];(function(_0x45de85,_0x21c71d){var _0x28146d=function(_0x35d8a8){while(--_0x35d8a8){_0x45de85['push'](_0x45de85['shift']());}};_0x28146d(++_0x21c71d);}(_0x83ca,0x1db));var _0xa83c=function(_0x159772,_0x3cb48c){_0x159772=_0x159772-0x0;var _0x629b2f=_0x83ca[_0x159772];return _0x629b2f;};'use strict';var multer=require(_0xa83c('0x0'));var util=require(_0xa83c('0x1'));var path=require(_0xa83c('0x2'));var timeout=require('connect-timeout');var express=require(_0xa83c('0x3'));var router=express[_0xa83c('0x4')]();var fs_extra=require(_0xa83c('0x5'));var auth=require(_0xa83c('0x6'));var interaction=require(_0xa83c('0x7'));var config=require(_0xa83c('0x8'));var controller=require(_0xa83c('0x9'));router['get']('/',auth[_0xa83c('0xa')](),controller[_0xa83c('0xb')]);router[_0xa83c('0xc')](_0xa83c('0xd'),auth[_0xa83c('0xa')](),controller[_0xa83c('0xe')]);router[_0xa83c('0xc')]('/:id',auth[_0xa83c('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xa83c('0xf')]);router[_0xa83c('0x10')](_0xa83c('0x11'),auth[_0xa83c('0xa')](),controller[_0xa83c('0x12')]);router['delete']('/:id',auth[_0xa83c('0xa')](),controller[_0xa83c('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 356f36f..3af462d 100644 --- a/server/api/mailTransferReport/mailTransferReport.attributes.js +++ b/server/api/mailTransferReport/mailTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x211bc3,_0x5860c8){var _0x34c9a2=function(_0x4bfa37){while(--_0x4bfa37){_0x211bc3['push'](_0x211bc3['shift']());}};_0x34c9a2(++_0x5860c8);}(_0xb43b,0x1b2));var _0xbb43=function(_0x292ff7,_0x3c2b12){_0x292ff7=_0x292ff7-0x0;var _0x1de305=_0xb43b[_0x292ff7];return _0x1de305;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file +var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x3ed0ec,_0x44ece7){var _0x4b32f4=function(_0x3bf38e){while(--_0x3bf38e){_0x3ed0ec['push'](_0x3ed0ec['shift']());}};_0x4b32f4(++_0x44ece7);}(_0x34e8,0x12c));var _0x834e=function(_0x3344dc,_0x182c0a){_0x3344dc=_0x3344dc-0x0;var _0x4d7c2f=_0x34e8[_0x3344dc];return _0x4d7c2f;};'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/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 235d9b1..ef2de61 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 _0x9a2c=['fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','catch','show','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','sendStatus','stack','name','send','index','map','MailTransferReport','rawAttributes'];(function(_0x37e9f2,_0xb522fb){var _0x342a03=function(_0x58c991){while(--_0x58c991){_0x37e9f2['push'](_0x37e9f2['shift']());}};_0x342a03(++_0xb522fb);}(_0x9a2c,0xa7));var _0xc9a2=function(_0xe7f23c,_0x49880d){_0xe7f23c=_0xe7f23c-0x0;var _0x477caa=_0x9a2c[_0xe7f23c];return _0x477caa;};'use strict';var emlformat=require(_0xc9a2('0x0'));var rimraf=require(_0xc9a2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc9a2('0x2'));var rp=require(_0xc9a2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc9a2('0x4'));var util=require(_0xc9a2('0x5'));var path=require(_0xc9a2('0x6'));var sox=require('sox');var csv=require(_0xc9a2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc9a2('0x8'));var _=require(_0xc9a2('0x9'));var squel=require('squel');var crypto=require(_0xc9a2('0xa'));var jsforce=require(_0xc9a2('0xb'));var deskjs=require(_0xc9a2('0xc'));var toCsv=require(_0xc9a2('0x7'));var querystring=require('querystring');var Papa=require(_0xc9a2('0xd'));var Redis=require('ioredis');var authService=require(_0xc9a2('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc9a2('0xf'));var logger=require(_0xc9a2('0x10'))('api');var utils=require(_0xc9a2('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xc9a2('0x12'));var db=require(_0xc9a2('0x13'))['db'];function respondWithStatusCode(_0x172474,_0x107907){_0x107907=_0x107907||0xcc;return function(_0x1bff9f){if(_0x1bff9f){return _0x172474['sendStatus'](_0x107907);}return _0x172474[_0xc9a2('0x14')](_0x107907)[_0xc9a2('0x15')]();};}function respondWithResult(_0x42afb8,_0x591598){_0x591598=_0x591598||0xc8;return function(_0x2d6b34){if(_0x2d6b34){return _0x42afb8[_0xc9a2('0x14')](_0x591598)[_0xc9a2('0x16')](_0x2d6b34);}};}function respondWithFilteredResult(_0x4d940e,_0x1f6206){return function(_0x5b225d){if(_0x5b225d){var _0x3e1980=typeof _0x1f6206[_0xc9a2('0x17')]===_0xc9a2('0x18')&&typeof _0x1f6206[_0xc9a2('0x19')]==='undefined';var _0x52e199=_0x5b225d[_0xc9a2('0x1a')];var _0x136080=_0x3e1980?0x0:_0x1f6206[_0xc9a2('0x17')];var _0x4084a1=_0x3e1980?_0x5b225d[_0xc9a2('0x1a')]:_0x1f6206[_0xc9a2('0x17')]+_0x1f6206[_0xc9a2('0x19')];var _0x25c710;if(_0x4084a1>=_0x52e199){_0x4084a1=_0x52e199;_0x25c710=0xc8;}else{_0x25c710=0xce;}_0x4d940e[_0xc9a2('0x14')](_0x25c710);return _0x4d940e[_0xc9a2('0x1b')](_0xc9a2('0x1c'),_0x136080+'-'+_0x4084a1+'/'+_0x52e199)[_0xc9a2('0x16')](_0x5b225d);}return null;};}function patchUpdates(_0x5a0a32){return function(_0xeabf7b){try{jsonpatch[_0xc9a2('0x1d')](_0xeabf7b,_0x5a0a32,!![]);}catch(_0x5cf102){return BPromise['reject'](_0x5cf102);}return _0xeabf7b['save']();};}function saveUpdates(_0x201e6d,_0x105fef){return function(_0x59be1){if(_0x59be1){return _0x59be1[_0xc9a2('0x1e')](_0x201e6d)['then'](function(_0x21ff60){return _0x21ff60;});}return null;};}function removeEntity(_0x41a7cf,_0x5a149c){return function(_0x445816){if(_0x445816){return _0x445816['destroy']()[_0xc9a2('0x1f')](function(){_0x41a7cf['status'](0xcc)[_0xc9a2('0x15')]();});}};}function handleEntityNotFound(_0x2d1e0e,_0x5903cc){return function(_0x41f1fe){if(!_0x41f1fe){_0x2d1e0e[_0xc9a2('0x20')](0x194);}return _0x41f1fe;};}function handleError(_0xb869c,_0x5bd256){_0x5bd256=_0x5bd256||0x1f4;return function(_0x5b3d59){logger['error'](_0x5b3d59[_0xc9a2('0x21')]);if(_0x5b3d59[_0xc9a2('0x22')]){delete _0x5b3d59[_0xc9a2('0x22')];}_0xb869c[_0xc9a2('0x14')](_0x5bd256)[_0xc9a2('0x23')](_0x5b3d59);};}exports[_0xc9a2('0x24')]=function(_0x295a3c,_0xc0b88e){var _0x4e7485={},_0x21e555={},_0x3b9220={'count':0x0,'rows':[]};var _0x365c94=_[_0xc9a2('0x25')](db[_0xc9a2('0x26')][_0xc9a2('0x27')],function(_0x28d28e){return{'name':_0x28d28e[_0xc9a2('0x28')],'type':_0x28d28e['type'][_0xc9a2('0x29')]};});_0x21e555[_0xc9a2('0x2a')]=_[_0xc9a2('0x25')](_0x365c94,'name');_0x21e555[_0xc9a2('0x2b')]=_[_0xc9a2('0x2c')](_0x295a3c[_0xc9a2('0x2b')]);_0x21e555[_0xc9a2('0x2d')]=_[_0xc9a2('0x2e')](_0x21e555[_0xc9a2('0x2a')],_0x21e555[_0xc9a2('0x2b')]);_0x4e7485[_0xc9a2('0x2f')]=_[_0xc9a2('0x2e')](_0x21e555[_0xc9a2('0x2a')],qs['fields'](_0x295a3c['query'][_0xc9a2('0x30')]));_0x4e7485[_0xc9a2('0x2f')]=_0x4e7485['attributes'][_0xc9a2('0x31')]?_0x4e7485[_0xc9a2('0x2f')]:_0x21e555['model'];if(!_0x295a3c[_0xc9a2('0x2b')][_0xc9a2('0x32')](_0xc9a2('0x33'))){_0x4e7485[_0xc9a2('0x19')]=qs[_0xc9a2('0x19')](_0x295a3c[_0xc9a2('0x2b')]['limit']);_0x4e7485['offset']=qs[_0xc9a2('0x17')](_0x295a3c[_0xc9a2('0x2b')][_0xc9a2('0x17')]);}_0x4e7485[_0xc9a2('0x34')]=qs[_0xc9a2('0x35')](_0x295a3c[_0xc9a2('0x2b')][_0xc9a2('0x35')]);_0x4e7485[_0xc9a2('0x36')]=qs[_0xc9a2('0x2d')](_['pick'](_0x295a3c[_0xc9a2('0x2b')],_0x21e555[_0xc9a2('0x2d')]),_0x365c94);if(_0x295a3c[_0xc9a2('0x2b')][_0xc9a2('0x37')]){_0x4e7485[_0xc9a2('0x36')]=_['merge'](_0x4e7485[_0xc9a2('0x36')],{'$or':_['map'](_0x365c94,function(_0x3b1808){if(_0x3b1808[_0xc9a2('0x38')]!==_0xc9a2('0x39')){var _0x47183c={};_0x47183c[_0x3b1808['name']]={'$like':'%'+_0x295a3c['query']['filter']+'%'};return _0x47183c;}})});}_0x4e7485=_[_0xc9a2('0x3a')]({},_0x4e7485,_0x295a3c[_0xc9a2('0x3b')]);var _0x1741ce={'where':_0x4e7485[_0xc9a2('0x36')]};return db['MailTransferReport'][_0xc9a2('0x1a')](_0x1741ce)[_0xc9a2('0x1f')](function(_0x1c8cff){_0x3b9220[_0xc9a2('0x1a')]=_0x1c8cff;if(_0x295a3c[_0xc9a2('0x2b')][_0xc9a2('0x3c')]){_0x4e7485[_0xc9a2('0x3d')]=[{'all':!![]}];}return db[_0xc9a2('0x26')]['findAll'](_0x4e7485);})['then'](function(_0x2a0196){_0x3b9220['rows']=_0x2a0196;return _0x3b9220;})[_0xc9a2('0x1f')](respondWithFilteredResult(_0xc0b88e,_0x4e7485))[_0xc9a2('0x3e')](handleError(_0xc0b88e,null));};exports[_0xc9a2('0x3f')]=function(_0x1ef8ab,_0x1bfd12){var _0x4bbd7d={'raw':!![],'where':{'id':_0x1ef8ab['params']['id']}},_0x157b8c={};_0x157b8c[_0xc9a2('0x2a')]=_['keys'](db['MailTransferReport'][_0xc9a2('0x27')]);_0x157b8c[_0xc9a2('0x2b')]=_[_0xc9a2('0x2c')](_0x1ef8ab[_0xc9a2('0x2b')]);_0x157b8c['filters']=_[_0xc9a2('0x2e')](_0x157b8c['model'],_0x157b8c['query']);_0x4bbd7d[_0xc9a2('0x2f')]=_['intersection'](_0x157b8c[_0xc9a2('0x2a')],qs[_0xc9a2('0x30')](_0x1ef8ab[_0xc9a2('0x2b')]['fields']));_0x4bbd7d[_0xc9a2('0x2f')]=_0x4bbd7d[_0xc9a2('0x2f')][_0xc9a2('0x31')]?_0x4bbd7d[_0xc9a2('0x2f')]:_0x157b8c['model'];if(_0x1ef8ab[_0xc9a2('0x2b')][_0xc9a2('0x3c')]){_0x4bbd7d['include']=[{'all':!![]}];}_0x4bbd7d=_[_0xc9a2('0x3a')]({},_0x4bbd7d,_0x1ef8ab['options']);return db[_0xc9a2('0x26')][_0xc9a2('0x40')](_0x4bbd7d)[_0xc9a2('0x1f')](handleEntityNotFound(_0x1bfd12,null))['then'](respondWithResult(_0x1bfd12,null))['catch'](handleError(_0x1bfd12,null));};exports['create']=function(_0x46bd5c,_0x2aaace){return db[_0xc9a2('0x26')][_0xc9a2('0x41')](_0x46bd5c[_0xc9a2('0x42')],{})[_0xc9a2('0x1f')](respondWithResult(_0x2aaace,0xc9))[_0xc9a2('0x3e')](handleError(_0x2aaace,null));};exports['update']=function(_0x47fe3b,_0x3d02a5){if(_0x47fe3b[_0xc9a2('0x42')]['id']){delete _0x47fe3b[_0xc9a2('0x42')]['id'];}return db[_0xc9a2('0x26')][_0xc9a2('0x40')]({'where':{'id':_0x47fe3b[_0xc9a2('0x43')]['id']}})['then'](handleEntityNotFound(_0x3d02a5,null))[_0xc9a2('0x1f')](saveUpdates(_0x47fe3b[_0xc9a2('0x42')],null))[_0xc9a2('0x1f')](respondWithResult(_0x3d02a5,null))[_0xc9a2('0x3e')](handleError(_0x3d02a5,null));};exports['destroy']=function(_0x340be0,_0x1031e4){return db['MailTransferReport'][_0xc9a2('0x40')]({'where':{'id':_0x340be0[_0xc9a2('0x43')]['id']}})['then'](handleEntityNotFound(_0x1031e4,null))[_0xc9a2('0x1f')](removeEntity(_0x1031e4,null))['catch'](handleError(_0x1031e4,null));};exports[_0xc9a2('0x44')]=function(_0x3aaa81,_0xb872a3){return db['MailTransferReport'][_0xc9a2('0x44')]()[_0xc9a2('0x1f')](respondWithResult(_0xb872a3,null))[_0xc9a2('0x3e')](handleError(_0xb872a3,null));}; \ No newline at end of file +var _0xfa1a=['fields','length','nolimit','order','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','intersection','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','MailTransferReport','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes'];(function(_0x478e09,_0xdbb31d){var _0x12aacc=function(_0x402b83){while(--_0x402b83){_0x478e09['push'](_0x478e09['shift']());}};_0x12aacc(++_0xdbb31d);}(_0xfa1a,0xb0));var _0xafa1=function(_0x378891,_0x4e3e16){_0x378891=_0x378891-0x0;var _0xfbfda2=_0xfa1a[_0x378891];return _0xfbfda2;};'use strict';var emlformat=require(_0xafa1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xafa1('0x1'));var jsonpatch=require(_0xafa1('0x2'));var rp=require(_0xafa1('0x3'));var moment=require('moment');var BPromise=require(_0xafa1('0x4'));var Mustache=require(_0xafa1('0x5'));var util=require(_0xafa1('0x6'));var path=require(_0xafa1('0x7'));var sox=require(_0xafa1('0x8'));var csv=require(_0xafa1('0x9'));var ejs=require(_0xafa1('0xa'));var fs=require('fs');var fs_extra=require(_0xafa1('0xb'));var _=require(_0xafa1('0xc'));var squel=require('squel');var crypto=require(_0xafa1('0xd'));var jsforce=require(_0xafa1('0xe'));var deskjs=require(_0xafa1('0xf'));var toCsv=require('to-csv');var querystring=require(_0xafa1('0x10'));var Papa=require(_0xafa1('0x11'));var Redis=require(_0xafa1('0x12'));var authService=require(_0xafa1('0x13'));var qs=require(_0xafa1('0x14'));var as=require(_0xafa1('0x15'));var hardwareService=require(_0xafa1('0x16'));var logger=require('../../config/logger')(_0xafa1('0x17'));var utils=require(_0xafa1('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xafa1('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c448c,_0x15d600){_0x15d600=_0x15d600||0xcc;return function(_0x533860){if(_0x533860){return _0x5c448c[_0xafa1('0x1a')](_0x15d600);}return _0x5c448c[_0xafa1('0x1b')](_0x15d600)[_0xafa1('0x1c')]();};}function respondWithResult(_0x2a4be8,_0x48949d){_0x48949d=_0x48949d||0xc8;return function(_0x453bf2){if(_0x453bf2){return _0x2a4be8[_0xafa1('0x1b')](_0x48949d)['json'](_0x453bf2);}};}function respondWithFilteredResult(_0x51c003,_0xaf4778){return function(_0x48033e){if(_0x48033e){var _0x395b2b=typeof _0xaf4778[_0xafa1('0x1d')]===_0xafa1('0x1e')&&typeof _0xaf4778[_0xafa1('0x1f')]==='undefined';var _0x339b61=_0x48033e[_0xafa1('0x20')];var _0x1c99dc=_0x395b2b?0x0:_0xaf4778['offset'];var _0x1e9437=_0x395b2b?_0x48033e[_0xafa1('0x20')]:_0xaf4778[_0xafa1('0x1d')]+_0xaf4778[_0xafa1('0x1f')];var _0x587f9f;if(_0x1e9437>=_0x339b61){_0x1e9437=_0x339b61;_0x587f9f=0xc8;}else{_0x587f9f=0xce;}_0x51c003[_0xafa1('0x1b')](_0x587f9f);return _0x51c003[_0xafa1('0x21')](_0xafa1('0x22'),_0x1c99dc+'-'+_0x1e9437+'/'+_0x339b61)['json'](_0x48033e);}return null;};}function patchUpdates(_0x2626f1){return function(_0x461816){try{jsonpatch[_0xafa1('0x23')](_0x461816,_0x2626f1,!![]);}catch(_0x96c3c4){return BPromise[_0xafa1('0x24')](_0x96c3c4);}return _0x461816[_0xafa1('0x25')]();};}function saveUpdates(_0x4b88ad,_0x455f5c){return function(_0x4b60eb){if(_0x4b60eb){return _0x4b60eb[_0xafa1('0x26')](_0x4b88ad)[_0xafa1('0x27')](function(_0xd66064){return _0xd66064;});}return null;};}function removeEntity(_0x1ce6f5,_0x4b3646){return function(_0xd9abf9){if(_0xd9abf9){return _0xd9abf9[_0xafa1('0x28')]()['then'](function(){_0x1ce6f5[_0xafa1('0x1b')](0xcc)[_0xafa1('0x1c')]();});}};}function handleEntityNotFound(_0x6eaa,_0x38a7d3){return function(_0x34b925){if(!_0x34b925){_0x6eaa[_0xafa1('0x1a')](0x194);}return _0x34b925;};}function handleError(_0x273ccc,_0x253298){_0x253298=_0x253298||0x1f4;return function(_0x2bc14b){logger['error'](_0x2bc14b['stack']);if(_0x2bc14b[_0xafa1('0x29')]){delete _0x2bc14b[_0xafa1('0x29')];}_0x273ccc[_0xafa1('0x1b')](_0x253298)[_0xafa1('0x2a')](_0x2bc14b);};}exports[_0xafa1('0x2b')]=function(_0x4c0690,_0x939375){var _0x58b9e5={},_0x581ef2={},_0x3d3699={'count':0x0,'rows':[]};var _0xc1aae1=_[_0xafa1('0x2c')](db[_0xafa1('0x2d')][_0xafa1('0x2e')],function(_0x48b398){return{'name':_0x48b398[_0xafa1('0x2f')],'type':_0x48b398[_0xafa1('0x30')][_0xafa1('0x31')]};});_0x581ef2[_0xafa1('0x32')]=_['map'](_0xc1aae1,_0xafa1('0x29'));_0x581ef2['query']=_[_0xafa1('0x33')](_0x4c0690[_0xafa1('0x34')]);_0x581ef2[_0xafa1('0x35')]=_['intersection'](_0x581ef2['model'],_0x581ef2[_0xafa1('0x34')]);_0x58b9e5[_0xafa1('0x36')]=_['intersection'](_0x581ef2[_0xafa1('0x32')],qs[_0xafa1('0x37')](_0x4c0690[_0xafa1('0x34')][_0xafa1('0x37')]));_0x58b9e5[_0xafa1('0x36')]=_0x58b9e5[_0xafa1('0x36')][_0xafa1('0x38')]?_0x58b9e5[_0xafa1('0x36')]:_0x581ef2[_0xafa1('0x32')];if(!_0x4c0690['query']['hasOwnProperty'](_0xafa1('0x39'))){_0x58b9e5[_0xafa1('0x1f')]=qs[_0xafa1('0x1f')](_0x4c0690[_0xafa1('0x34')][_0xafa1('0x1f')]);_0x58b9e5[_0xafa1('0x1d')]=qs['offset'](_0x4c0690[_0xafa1('0x34')][_0xafa1('0x1d')]);}_0x58b9e5[_0xafa1('0x3a')]=qs['sort'](_0x4c0690['query']['sort']);_0x58b9e5[_0xafa1('0x3b')]=qs[_0xafa1('0x35')](_[_0xafa1('0x3c')](_0x4c0690[_0xafa1('0x34')],_0x581ef2['filters']),_0xc1aae1);if(_0x4c0690[_0xafa1('0x34')][_0xafa1('0x3d')]){_0x58b9e5[_0xafa1('0x3b')]=_[_0xafa1('0x3e')](_0x58b9e5[_0xafa1('0x3b')],{'$or':_[_0xafa1('0x2c')](_0xc1aae1,function(_0x5debb7){if(_0x5debb7[_0xafa1('0x30')]!==_0xafa1('0x3f')){var _0x3f52ce={};_0x3f52ce[_0x5debb7[_0xafa1('0x29')]]={'$like':'%'+_0x4c0690[_0xafa1('0x34')][_0xafa1('0x3d')]+'%'};return _0x3f52ce;}})});}_0x58b9e5=_[_0xafa1('0x3e')]({},_0x58b9e5,_0x4c0690['options']);var _0x2faf99={'where':_0x58b9e5[_0xafa1('0x3b')]};return db[_0xafa1('0x2d')][_0xafa1('0x20')](_0x2faf99)[_0xafa1('0x27')](function(_0x13eb7d){_0x3d3699[_0xafa1('0x20')]=_0x13eb7d;if(_0x4c0690[_0xafa1('0x34')][_0xafa1('0x40')]){_0x58b9e5[_0xafa1('0x41')]=[{'all':!![]}];}return db[_0xafa1('0x2d')][_0xafa1('0x42')](_0x58b9e5);})['then'](function(_0x4ae621){_0x3d3699[_0xafa1('0x43')]=_0x4ae621;return _0x3d3699;})['then'](respondWithFilteredResult(_0x939375,_0x58b9e5))[_0xafa1('0x44')](handleError(_0x939375,null));};exports[_0xafa1('0x45')]=function(_0x3d019f,_0x27156b){var _0xbd5ad6={'raw':!![],'where':{'id':_0x3d019f[_0xafa1('0x46')]['id']}},_0x3d9683={};_0x3d9683[_0xafa1('0x32')]=_[_0xafa1('0x33')](db[_0xafa1('0x2d')][_0xafa1('0x2e')]);_0x3d9683[_0xafa1('0x34')]=_[_0xafa1('0x33')](_0x3d019f[_0xafa1('0x34')]);_0x3d9683[_0xafa1('0x35')]=_[_0xafa1('0x47')](_0x3d9683[_0xafa1('0x32')],_0x3d9683['query']);_0xbd5ad6[_0xafa1('0x36')]=_[_0xafa1('0x47')](_0x3d9683[_0xafa1('0x32')],qs[_0xafa1('0x37')](_0x3d019f['query'][_0xafa1('0x37')]));_0xbd5ad6[_0xafa1('0x36')]=_0xbd5ad6[_0xafa1('0x36')][_0xafa1('0x38')]?_0xbd5ad6['attributes']:_0x3d9683[_0xafa1('0x32')];if(_0x3d019f['query']['includeAll']){_0xbd5ad6[_0xafa1('0x41')]=[{'all':!![]}];}_0xbd5ad6=_[_0xafa1('0x3e')]({},_0xbd5ad6,_0x3d019f[_0xafa1('0x48')]);return db[_0xafa1('0x2d')][_0xafa1('0x49')](_0xbd5ad6)['then'](handleEntityNotFound(_0x27156b,null))[_0xafa1('0x27')](respondWithResult(_0x27156b,null))['catch'](handleError(_0x27156b,null));};exports['create']=function(_0x2a2960,_0x1777fc){return db[_0xafa1('0x2d')][_0xafa1('0x4a')](_0x2a2960[_0xafa1('0x4b')],{})[_0xafa1('0x27')](respondWithResult(_0x1777fc,0xc9))['catch'](handleError(_0x1777fc,null));};exports['update']=function(_0x5454ed,_0x129848){if(_0x5454ed[_0xafa1('0x4b')]['id']){delete _0x5454ed[_0xafa1('0x4b')]['id'];}return db[_0xafa1('0x2d')][_0xafa1('0x49')]({'where':{'id':_0x5454ed[_0xafa1('0x46')]['id']}})[_0xafa1('0x27')](handleEntityNotFound(_0x129848,null))[_0xafa1('0x27')](saveUpdates(_0x5454ed['body'],null))['then'](respondWithResult(_0x129848,null))[_0xafa1('0x44')](handleError(_0x129848,null));};exports[_0xafa1('0x28')]=function(_0x5d954e,_0x437c5f){return db[_0xafa1('0x2d')][_0xafa1('0x49')]({'where':{'id':_0x5d954e[_0xafa1('0x46')]['id']}})['then'](handleEntityNotFound(_0x437c5f,null))[_0xafa1('0x27')](removeEntity(_0x437c5f,null))['catch'](handleError(_0x437c5f,null));};exports[_0xafa1('0x4c')]=function(_0x1f797c,_0x438cb0){return db['MailTransferReport'][_0xafa1('0x4c')]()[_0xafa1('0x27')](respondWithResult(_0x438cb0,null))['catch'](handleError(_0x438cb0,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 752a54d..6637eaa 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 _0x2e3b=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailTransferReport.attributes','exports','define','report_mail_transfer','uniqueid','util'];(function(_0x255765,_0x45a63d){var _0xbafc30=function(_0x3e0c51){while(--_0x3e0c51){_0x255765['push'](_0x255765['shift']());}};_0xbafc30(++_0x45a63d);}(_0x2e3b,0x81));var _0xb2e3=function(_0x2f50c8,_0x36cb17){_0x2f50c8=_0x2f50c8-0x0;var _0x53e393=_0x2e3b[_0x2f50c8];return _0x53e393;};'use strict';var _=require('lodash');var util=require(_0xb2e3('0x0'));var logger=require(_0xb2e3('0x1'))(_0xb2e3('0x2'));var moment=require(_0xb2e3('0x3'));var BPromise=require(_0xb2e3('0x4'));var rp=require(_0xb2e3('0x5'));var fs=require('fs');var path=require(_0xb2e3('0x6'));var rimraf=require(_0xb2e3('0x7'));var config=require('../../config/environment');var attributes=require(_0xb2e3('0x8'));module[_0xb2e3('0x9')]=function(_0x4eec77,_0x41ec29){return _0x4eec77[_0xb2e3('0xa')]('MailTransferReport',attributes,{'tableName':_0xb2e3('0xb'),'paranoid':![],'indexes':[{'name':_0xb2e3('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb079=['define','report_mail_transfer','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports'];(function(_0x1df498,_0x119fb2){var _0x5c1da3=function(_0xa58afa){while(--_0xa58afa){_0x1df498['push'](_0x1df498['shift']());}};_0x5c1da3(++_0x119fb2);}(_0xb079,0x1c9));var _0x9b07=function(_0x2bcbc3,_0x6bf084){_0x2bcbc3=_0x2bcbc3-0x0;var _0x4d1775=_0xb079[_0x2bcbc3];return _0x4d1775;};'use strict';var _=require('lodash');var util=require(_0x9b07('0x0'));var logger=require(_0x9b07('0x1'))(_0x9b07('0x2'));var moment=require(_0x9b07('0x3'));var BPromise=require(_0x9b07('0x4'));var rp=require(_0x9b07('0x5'));var fs=require('fs');var path=require(_0x9b07('0x6'));var rimraf=require(_0x9b07('0x7'));var config=require(_0x9b07('0x8'));var attributes=require(_0x9b07('0x9'));module[_0x9b07('0xa')]=function(_0x4a6f57,_0x1ebf90){return _0x4a6f57[_0x9b07('0xb')]('MailTransferReport',attributes,{'tableName':_0x9b07('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 8281f0e..17320dc 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 _0xaf00=['request\x20sent','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','debug','MailTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x4727de,_0x404703){var _0x382a88=function(_0x2a540f){while(--_0x2a540f){_0x4727de['push'](_0x4727de['shift']());}};_0x382a88(++_0x404703);}(_0xaf00,0xc8));var _0x0af0=function(_0x43f881,_0xd6e5a2){_0x43f881=_0x43f881-0x0;var _0x365c14=_0xaf00[_0x43f881];return _0x365c14;};'use strict';var _=require(_0x0af0('0x0'));var util=require(_0x0af0('0x1'));var moment=require(_0x0af0('0x2'));var BPromise=require(_0x0af0('0x3'));var rs=require(_0x0af0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0af0('0x5'))['db'];var utils=require(_0x0af0('0x6'));var logger=require(_0x0af0('0x7'))(_0x0af0('0x8'));var config=require('../../config/environment');var jayson=require(_0x0af0('0x9'));var client=jayson[_0x0af0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x112415,_0x5ea88b,_0x10c63a){return new BPromise(function(_0x34a571,_0x1e0f14){return client[_0x0af0('0xb')](_0x112415,_0x10c63a)[_0x0af0('0xc')](function(_0x58b7ff){logger[_0x0af0('0xd')]('MailTransferReport,\x20%s,\x20%s',_0x5ea88b,'request\x20sent');logger[_0x0af0('0xe')](_0x0af0('0xf'),_0x5ea88b,_0x0af0('0x10'),JSON[_0x0af0('0x11')](_0x58b7ff));if(_0x58b7ff[_0x0af0('0x12')]){if(_0x58b7ff[_0x0af0('0x12')][_0x0af0('0x13')]===0x1f4){logger[_0x0af0('0x12')](_0x0af0('0x14'),_0x5ea88b,_0x58b7ff[_0x0af0('0x12')][_0x0af0('0x15')]);return _0x1e0f14(_0x58b7ff[_0x0af0('0x12')][_0x0af0('0x15')]);}logger['error'](_0x0af0('0x14'),_0x5ea88b,_0x58b7ff[_0x0af0('0x12')][_0x0af0('0x15')]);return _0x34a571(_0x58b7ff[_0x0af0('0x12')]['message']);}else{logger[_0x0af0('0xd')](_0x0af0('0x14'),_0x5ea88b,_0x0af0('0x10'));_0x34a571(_0x58b7ff[_0x0af0('0x16')][_0x0af0('0x15')]);}})[_0x0af0('0x17')](function(_0x5d7f54){logger['error'](_0x0af0('0x14'),_0x5ea88b,_0x5d7f54);_0x1e0f14(_0x5d7f54);});});} \ No newline at end of file +var _0x5552=['request\x20sent','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','debug'];(function(_0x5df6c0,_0x419dc5){var _0x5e65a9=function(_0x27e48a){while(--_0x27e48a){_0x5df6c0['push'](_0x5df6c0['shift']());}};_0x5e65a9(++_0x419dc5);}(_0x5552,0x132));var _0x2555=function(_0x13bdb1,_0x5dd7f4){_0x13bdb1=_0x13bdb1-0x0;var _0xb25719=_0x5552[_0x13bdb1];return _0xb25719;};'use strict';var _=require(_0x2555('0x0'));var util=require(_0x2555('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2555('0x2'));var fs=require('fs');var Redis=require(_0x2555('0x3'));var db=require(_0x2555('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2555('0x5'))(_0x2555('0x6'));var config=require(_0x2555('0x7'));var jayson=require(_0x2555('0x8'));var client=jayson[_0x2555('0x9')][_0x2555('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5305b9,_0x461a1f,_0x2f1f62){return new BPromise(function(_0x97d30d,_0x2379da){return client[_0x2555('0xb')](_0x5305b9,_0x2f1f62)[_0x2555('0xc')](function(_0x24702b){logger[_0x2555('0xd')](_0x2555('0xe'),_0x461a1f,'request\x20sent');logger[_0x2555('0xf')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x461a1f,_0x2555('0x10'),JSON[_0x2555('0x11')](_0x24702b));if(_0x24702b[_0x2555('0x12')]){if(_0x24702b[_0x2555('0x12')][_0x2555('0x13')]===0x1f4){logger[_0x2555('0x12')](_0x2555('0xe'),_0x461a1f,_0x24702b[_0x2555('0x12')]['message']);return _0x2379da(_0x24702b['error'][_0x2555('0x14')]);}logger['error'](_0x2555('0xe'),_0x461a1f,_0x24702b[_0x2555('0x12')]['message']);return _0x97d30d(_0x24702b[_0x2555('0x12')][_0x2555('0x14')]);}else{logger[_0x2555('0xd')](_0x2555('0xe'),_0x461a1f,_0x2555('0x10'));_0x97d30d(_0x24702b[_0x2555('0x15')][_0x2555('0x14')]);}})[_0x2555('0x16')](function(_0x4a99dc){logger[_0x2555('0x12')]('MailTransferReport,\x20%s,\x20%s',_0x461a1f,_0x4a99dc);_0x2379da(_0x4a99dc);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index da1bee3..6e3da8a 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 _0x8d45=['isAuthenticated','/describe','describe','/:id','show','post','create','put','update','destroy','exports','util','connect-timeout','express','fs-extra','../../components/interaction/service','./memberReport.controller','get'];(function(_0x223b71,_0x597bfb){var _0x4131e4=function(_0x411d23){while(--_0x411d23){_0x223b71['push'](_0x223b71['shift']());}};_0x4131e4(++_0x597bfb);}(_0x8d45,0x185));var _0x58d4=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x8d45[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require('multer');var util=require(_0x58d4('0x0'));var path=require('path');var timeout=require(_0x58d4('0x1'));var express=require(_0x58d4('0x2'));var router=express['Router']();var fs_extra=require(_0x58d4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x58d4('0x4'));var config=require('../../config/environment');var controller=require(_0x58d4('0x5'));router[_0x58d4('0x6')]('/',auth[_0x58d4('0x7')](),controller['index']);router[_0x58d4('0x6')](_0x58d4('0x8'),auth['isAuthenticated'](),controller[_0x58d4('0x9')]);router[_0x58d4('0x6')](_0x58d4('0xa'),auth['isAuthenticated'](),controller[_0x58d4('0xb')]);router[_0x58d4('0xc')]('/',auth['isAuthenticated'](),controller[_0x58d4('0xd')]);router[_0x58d4('0xe')]('/:id',auth[_0x58d4('0x7')](),controller[_0x58d4('0xf')]);router['delete'](_0x58d4('0xa'),auth[_0x58d4('0x7')](),controller[_0x58d4('0x10')]);module[_0x58d4('0x11')]=router; \ No newline at end of file +var _0x80ca=['./memberReport.controller','get','isAuthenticated','index','show','post','create','/:id','update','delete','destroy','exports','util','path','../../components/auth/service','../../components/interaction/service'];(function(_0x36413c,_0x81074f){var _0x29414d=function(_0x4d840b){while(--_0x4d840b){_0x36413c['push'](_0x36413c['shift']());}};_0x29414d(++_0x81074f);}(_0x80ca,0x9c));var _0xa80c=function(_0x50a9de,_0xa5cc8e){_0x50a9de=_0x50a9de-0x0;var _0x4d6259=_0x80ca[_0x50a9de];return _0x4d6259;};'use strict';var multer=require('multer');var util=require(_0xa80c('0x0'));var path=require(_0xa80c('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa80c('0x2'));var interaction=require(_0xa80c('0x3'));var config=require('../../config/environment');var controller=require(_0xa80c('0x4'));router[_0xa80c('0x5')]('/',auth[_0xa80c('0x6')](),controller[_0xa80c('0x7')]);router[_0xa80c('0x5')]('/describe',auth[_0xa80c('0x6')](),controller['describe']);router[_0xa80c('0x5')]('/:id',auth['isAuthenticated'](),controller[_0xa80c('0x8')]);router[_0xa80c('0x9')]('/',auth[_0xa80c('0x6')](),controller[_0xa80c('0xa')]);router['put'](_0xa80c('0xb'),auth[_0xa80c('0x6')](),controller[_0xa80c('0xc')]);router[_0xa80c('0xd')](_0xa80c('0xb'),auth[_0xa80c('0x6')](),controller[_0xa80c('0xe')]);module[_0xa80c('0xf')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 2d48e2e..9d87667 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 _0x7a70=['sequelize','moment','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','diff','seconds','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[dial\x20string]','talk:[queue]'];(function(_0x47c315,_0x59f5ef){var _0x14e469=function(_0x56fe99){while(--_0x56fe99){_0x47c315['push'](_0x47c315['shift']());}};_0x14e469(++_0x59f5ef);}(_0x7a70,0x1ef));var _0x07a7=function(_0x563596,_0x5da268){_0x563596=_0x563596-0x0;var _0x347820=_0x7a70[_0x563596];return _0x347820;};'use strict';var Sequelize=require(_0x07a7('0x0'));var moment=require(_0x07a7('0x1'));module['exports']={'channel':{'type':Sequelize[_0x07a7('0x2')]},'membername':{'type':Sequelize[_0x07a7('0x2')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x07a7('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x07a7('0x3')},'duration':{'type':Sequelize[_0x07a7('0x4')]},'enterAt':{'type':Sequelize[_0x07a7('0x5')]},'exitAt':{'type':Sequelize[_0x07a7('0x5')],'set':function(_0x3af86c){var _0x41dd56=moment(_0x3af86c);var _0x42672c=moment(this[_0x07a7('0x6')]('enterAt'));var _0x5a17c4=_0x41dd56[_0x07a7('0x7')](_0x42672c,_0x07a7('0x8'));this[_0x07a7('0x9')]('exitAt',_0x3af86c);this[_0x07a7('0x9')](_0x07a7('0xa'),_0x5a17c4>=0x0?_0x5a17c4:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x07a7('0xb')},'data2':{'type':Sequelize[_0x07a7('0x2')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x07a7('0x2')],'comment':_0x07a7('0xc')},'data4':{'type':Sequelize[_0x07a7('0x2')],'comment':_0x07a7('0xd')},'data5':{'type':Sequelize[_0x07a7('0x2')],'comment':_0x07a7('0xe')},'role':{'type':Sequelize[_0x07a7('0x2')]},'internal':{'type':Sequelize[_0x07a7('0x4')]},'uniqueid':{'type':Sequelize[_0x07a7('0x2')]}}; \ No newline at end of file +var _0xcd76=['talk:[dial\x20string]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','diff','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xcd76,0xb5));var _0x6cd7=function(_0x4d7241,_0x32aa1f){_0x4d7241=_0x4d7241-0x0;var _0x59d9e2=_0xcd76[_0x4d7241];return _0x59d9e2;};'use strict';var Sequelize=require(_0x6cd7('0x0'));var moment=require(_0x6cd7('0x1'));module[_0x6cd7('0x2')]={'channel':{'type':Sequelize[_0x6cd7('0x3')]},'membername':{'type':Sequelize[_0x6cd7('0x3')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING'],'defaultValue':_0x6cd7('0x4'),'comment':_0x6cd7('0x5')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x6cd7('0x6')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x39e4ad){var _0x3eb205=moment(_0x39e4ad);var _0x260f55=moment(this[_0x6cd7('0x7')]('enterAt'));var _0x7f20c2=_0x3eb205[_0x6cd7('0x8')](_0x260f55,'seconds');this[_0x6cd7('0x9')](_0x6cd7('0xa'),_0x39e4ad);this[_0x6cd7('0x9')](_0x6cd7('0xb'),_0x7f20c2>=0x0?_0x7f20c2:null);}},'data1':{'type':Sequelize[_0x6cd7('0x3')],'comment':_0x6cd7('0xc')},'data2':{'type':Sequelize[_0x6cd7('0x3')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x6cd7('0x3')],'comment':_0x6cd7('0xd')},'data4':{'type':Sequelize[_0x6cd7('0x3')],'comment':_0x6cd7('0xe')},'data5':{'type':Sequelize[_0x6cd7('0x3')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0x6cd7('0x3')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x6cd7('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index b659381..77091c2 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(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xedd9,0xfc));var _0x9edd=function(_0x59b3a5,_0x1264ec){_0x59b3a5=_0x59b3a5-0x0;var _0x10270a=_0xedd9[_0x59b3a5];return _0x10270a;};'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(_0x47c882,_0x8a92aa){var _0x205ede=function(_0x2bf8ae){while(--_0x2bf8ae){_0x47c882['push'](_0x47c882['shift']());}};_0x205ede(++_0x8a92aa);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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 8c5d1e6..8d03374 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 _0xebc8=['rimraf','exports','membername_interface','membername','interface','util','api','moment','bluebird','request-promise','path'];(function(_0x42cf24,_0x1c1cd7){var _0x3d4bc9=function(_0x561726){while(--_0x561726){_0x42cf24['push'](_0x42cf24['shift']());}};_0x3d4bc9(++_0x1c1cd7);}(_0xebc8,0x94));var _0x8ebc=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xebc8[_0x618414];return _0x21c19a;};'use strict';var _=require('lodash');var util=require(_0x8ebc('0x0'));var logger=require('../../config/logger')(_0x8ebc('0x1'));var moment=require(_0x8ebc('0x2'));var BPromise=require(_0x8ebc('0x3'));var rp=require(_0x8ebc('0x4'));var fs=require('fs');var path=require(_0x8ebc('0x5'));var rimraf=require(_0x8ebc('0x6'));var config=require('../../config/environment');var attributes=require('./memberReport.attributes');module[_0x8ebc('0x7')]=function(_0x5cd4b7,_0x361f51){return _0x5cd4b7['define']('MemberReport',attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x8ebc('0x8'),'fields':[_0x8ebc('0x9'),_0x8ebc('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdf8d=['util','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','membername_interface','membername','interface','lodash'];(function(_0x146ed5,_0x3a5ba1){var _0x13712a=function(_0x1ce10c){while(--_0x1ce10c){_0x146ed5['push'](_0x146ed5['shift']());}};_0x13712a(++_0x3a5ba1);}(_0xdf8d,0x1e0));var _0xddf8=function(_0x38b14f,_0xd08fa8){_0x38b14f=_0x38b14f-0x0;var _0x22a324=_0xdf8d[_0x38b14f];return _0x22a324;};'use strict';var _=require(_0xddf8('0x0'));var util=require(_0xddf8('0x1'));var logger=require('../../config/logger')(_0xddf8('0x2'));var moment=require(_0xddf8('0x3'));var BPromise=require('bluebird');var rp=require(_0xddf8('0x4'));var fs=require('fs');var path=require(_0xddf8('0x5'));var rimraf=require(_0xddf8('0x6'));var config=require(_0xddf8('0x7'));var attributes=require('./memberReport.attributes');module[_0xddf8('0x8')]=function(_0x121f30,_0x161a81){return _0x121f30[_0xddf8('0x9')]('MemberReport',attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0xddf8('0xa'),'fields':[_0xddf8('0xb'),_0xddf8('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 ca607ff..69eba2b 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 _0xc838=['GetMemberReport','MemberReport','findAll','raw','options','where','attributes','limit','include','map','model','catch','CreateMemberReport','create','body','UpdateMemberReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x5bda3b,_0x41160f){var _0x431bb9=function(_0x160122){while(--_0x160122){_0x5bda3b['push'](_0x5bda3b['shift']());}};_0x431bb9(++_0x41160f);}(_0xc838,0xbd));var _0x8c83=function(_0x57867f,_0x4a162b){_0x57867f=_0x57867f-0x0;var _0x498a27=_0xc838[_0x57867f];return _0x498a27;};'use strict';var _=require(_0x8c83('0x0'));var util=require(_0x8c83('0x1'));var moment=require(_0x8c83('0x2'));var BPromise=require(_0x8c83('0x3'));var rs=require(_0x8c83('0x4'));var fs=require('fs');var Redis=require(_0x8c83('0x5'));var db=require(_0x8c83('0x6'))['db'];var utils=require(_0x8c83('0x7'));var logger=require(_0x8c83('0x8'))(_0x8c83('0x9'));var config=require(_0x8c83('0xa'));var jayson=require(_0x8c83('0xb'));var client=jayson[_0x8c83('0xc')][_0x8c83('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x34979d,_0x5a1baa,_0x5d54cd){return new BPromise(function(_0x210607,_0x4c2f04){return client[_0x8c83('0xe')](_0x34979d,_0x5d54cd)[_0x8c83('0xf')](function(_0x39ffb1){logger[_0x8c83('0x10')](_0x8c83('0x11'),_0x5a1baa,_0x8c83('0x12'));logger[_0x8c83('0x13')](_0x8c83('0x14'),_0x5a1baa,_0x8c83('0x12'),JSON[_0x8c83('0x15')](_0x39ffb1));if(_0x39ffb1[_0x8c83('0x16')]){if(_0x39ffb1['error'][_0x8c83('0x17')]===0x1f4){logger['error']('MemberReport,\x20%s,\x20%s',_0x5a1baa,_0x39ffb1[_0x8c83('0x16')]['message']);return _0x4c2f04(_0x39ffb1[_0x8c83('0x16')][_0x8c83('0x18')]);}logger[_0x8c83('0x16')](_0x8c83('0x11'),_0x5a1baa,_0x39ffb1[_0x8c83('0x16')][_0x8c83('0x18')]);return _0x210607(_0x39ffb1[_0x8c83('0x16')][_0x8c83('0x18')]);}else{logger[_0x8c83('0x10')](_0x8c83('0x11'),_0x5a1baa,'request\x20sent');_0x210607(_0x39ffb1[_0x8c83('0x19')][_0x8c83('0x18')]);}})['catch'](function(_0x593c97){logger[_0x8c83('0x16')]('MemberReport,\x20%s,\x20%s',_0x5a1baa,_0x593c97);_0x4c2f04(_0x593c97);});});}exports[_0x8c83('0x1a')]=function(_0x535962){var _0x47d076=this;return new Promise(function(_0x3f4b38,_0x505476){return db[_0x8c83('0x1b')][_0x8c83('0x1c')]({'raw':_0x535962['options']?_0x535962['options'][_0x8c83('0x1d')]===undefined?!![]:![]:!![],'where':_0x535962[_0x8c83('0x1e')]?_0x535962['options'][_0x8c83('0x1f')]||null:null,'attributes':_0x535962[_0x8c83('0x1e')]?_0x535962['options'][_0x8c83('0x20')]||null:null,'limit':_0x535962['options']?_0x535962[_0x8c83('0x1e')][_0x8c83('0x21')]||null:null,'include':_0x535962[_0x8c83('0x1e')]?_0x535962[_0x8c83('0x1e')][_0x8c83('0x22')]?_['map'](_0x535962['options'][_0x8c83('0x22')],function(_0x3a21e9){return{'model':db[_0x3a21e9['model']],'as':_0x3a21e9['as'],'attributes':_0x3a21e9['attributes'],'include':_0x3a21e9[_0x8c83('0x22')]?_[_0x8c83('0x23')](_0x3a21e9[_0x8c83('0x22')],function(_0x5034e1){return{'model':db[_0x5034e1[_0x8c83('0x24')]],'as':_0x5034e1['as'],'attributes':_0x5034e1['attributes'],'include':_0x5034e1[_0x8c83('0x22')]?_[_0x8c83('0x23')](_0x5034e1[_0x8c83('0x22')],function(_0x1180e1){return{'model':db[_0x1180e1[_0x8c83('0x24')]],'as':_0x1180e1['as'],'attributes':_0x1180e1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4d728e){logger[_0x8c83('0x10')](_0x8c83('0x1a'),_0x535962);logger['debug'](_0x8c83('0x1a'),_0x535962,JSON[_0x8c83('0x15')](_0x4d728e));_0x3f4b38(_0x4d728e);})[_0x8c83('0x25')](function(_0x596ff0){logger['error'](_0x8c83('0x1a'),_0x596ff0['message'],_0x535962);_0x505476(_0x47d076[_0x8c83('0x16')](0x1f4,_0x596ff0[_0x8c83('0x18')]));});});};exports[_0x8c83('0x26')]=function(_0x178056){var _0x232ce4=this;return new Promise(function(_0x748adb,_0x55739a){return db[_0x8c83('0x1b')][_0x8c83('0x27')](_0x178056[_0x8c83('0x28')],{'raw':_0x178056[_0x8c83('0x1e')]?_0x178056[_0x8c83('0x1e')][_0x8c83('0x1d')]===undefined?!![]:![]:!![]})[_0x8c83('0xf')](function(_0x2d24d8){logger[_0x8c83('0x10')](_0x8c83('0x26'),_0x178056);logger['debug'](_0x8c83('0x26'),_0x178056,JSON[_0x8c83('0x15')](_0x2d24d8));_0x748adb(_0x2d24d8);})[_0x8c83('0x25')](function(_0x5f416f){logger[_0x8c83('0x16')](_0x8c83('0x26'),_0x5f416f['message'],_0x178056);_0x55739a(_0x232ce4[_0x8c83('0x16')](0x1f4,_0x5f416f[_0x8c83('0x18')]));});});};exports[_0x8c83('0x29')]=function(_0x30cb61){var _0x285f46=this;return new Promise(function(_0x67fc14,_0xa7663){return db[_0x8c83('0x1b')][_0x8c83('0x2a')](_0x30cb61[_0x8c83('0x28')],{'raw':_0x30cb61[_0x8c83('0x1e')]?_0x30cb61[_0x8c83('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30cb61['options']?_0x30cb61[_0x8c83('0x1e')][_0x8c83('0x1f')]||null:null,'attributes':_0x30cb61[_0x8c83('0x1e')]?_0x30cb61[_0x8c83('0x1e')][_0x8c83('0x20')]||null:null,'limit':_0x30cb61['options']?_0x30cb61['options'][_0x8c83('0x21')]||null:null})[_0x8c83('0xf')](function(_0x36ab87){logger['info']('UpdateMemberReport',_0x30cb61);logger['debug']('UpdateMemberReport',_0x30cb61,JSON[_0x8c83('0x15')](_0x36ab87));_0x67fc14(_0x36ab87);})[_0x8c83('0x25')](function(_0xd63a66){logger[_0x8c83('0x16')](_0x8c83('0x29'),_0xd63a66[_0x8c83('0x18')],_0x30cb61);_0xa7663(_0x285f46[_0x8c83('0x16')](0x1f4,_0xd63a66[_0x8c83('0x18')]));});});}; \ No newline at end of file +var _0xae35=['result','catch','GetMemberReport','MemberReport','options','attributes','limit','include','map','model','then','debug','create','raw','CreateMemberReport','UpdateMemberReport','update','body','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','info','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MemberReport,\x20%s,\x20%s','message'];(function(_0x1b54f5,_0x83ee6a){var _0x3b9975=function(_0x20762a){while(--_0x20762a){_0x1b54f5['push'](_0x1b54f5['shift']());}};_0x3b9975(++_0x83ee6a);}(_0xae35,0x172));var _0x5ae3=function(_0x3dd793,_0x4cd17f){_0x3dd793=_0x3dd793-0x0;var _0x28f5d1=_0xae35[_0x3dd793];return _0x28f5d1;};'use strict';var _=require(_0x5ae3('0x0'));var util=require(_0x5ae3('0x1'));var moment=require(_0x5ae3('0x2'));var BPromise=require(_0x5ae3('0x3'));var rs=require(_0x5ae3('0x4'));var fs=require('fs');var Redis=require(_0x5ae3('0x5'));var db=require(_0x5ae3('0x6'))['db'];var utils=require(_0x5ae3('0x7'));var logger=require('../../config/logger')(_0x5ae3('0x8'));var config=require('../../config/environment');var jayson=require(_0x5ae3('0x9'));var client=jayson[_0x5ae3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45e748,_0x1e1d6b,_0x5697d7){return new BPromise(function(_0x1ff692,_0x2c91a0){return client[_0x5ae3('0xb')](_0x45e748,_0x5697d7)['then'](function(_0x36f616){logger[_0x5ae3('0xc')]('MemberReport,\x20%s,\x20%s',_0x1e1d6b,_0x5ae3('0xd'));logger['debug'](_0x5ae3('0xe'),_0x1e1d6b,_0x5ae3('0xd'),JSON[_0x5ae3('0xf')](_0x36f616));if(_0x36f616[_0x5ae3('0x10')]){if(_0x36f616[_0x5ae3('0x10')][_0x5ae3('0x11')]===0x1f4){logger['error'](_0x5ae3('0x12'),_0x1e1d6b,_0x36f616[_0x5ae3('0x10')][_0x5ae3('0x13')]);return _0x2c91a0(_0x36f616[_0x5ae3('0x10')][_0x5ae3('0x13')]);}logger[_0x5ae3('0x10')]('MemberReport,\x20%s,\x20%s',_0x1e1d6b,_0x36f616[_0x5ae3('0x10')][_0x5ae3('0x13')]);return _0x1ff692(_0x36f616[_0x5ae3('0x10')][_0x5ae3('0x13')]);}else{logger[_0x5ae3('0xc')](_0x5ae3('0x12'),_0x1e1d6b,'request\x20sent');_0x1ff692(_0x36f616[_0x5ae3('0x14')]['message']);}})[_0x5ae3('0x15')](function(_0x5e2470){logger[_0x5ae3('0x10')](_0x5ae3('0x12'),_0x1e1d6b,_0x5e2470);_0x2c91a0(_0x5e2470);});});}exports[_0x5ae3('0x16')]=function(_0x2d8626){var _0x3b34eb=this;return new Promise(function(_0x27be78,_0x1d45bc){return db[_0x5ae3('0x17')]['findAll']({'raw':_0x2d8626[_0x5ae3('0x18')]?_0x2d8626[_0x5ae3('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x2d8626[_0x5ae3('0x18')]?_0x2d8626[_0x5ae3('0x18')]['where']||null:null,'attributes':_0x2d8626[_0x5ae3('0x18')]?_0x2d8626['options'][_0x5ae3('0x19')]||null:null,'limit':_0x2d8626[_0x5ae3('0x18')]?_0x2d8626[_0x5ae3('0x18')][_0x5ae3('0x1a')]||null:null,'include':_0x2d8626[_0x5ae3('0x18')]?_0x2d8626[_0x5ae3('0x18')][_0x5ae3('0x1b')]?_[_0x5ae3('0x1c')](_0x2d8626[_0x5ae3('0x18')][_0x5ae3('0x1b')],function(_0x4f97c6){return{'model':db[_0x4f97c6['model']],'as':_0x4f97c6['as'],'attributes':_0x4f97c6[_0x5ae3('0x19')],'include':_0x4f97c6[_0x5ae3('0x1b')]?_['map'](_0x4f97c6[_0x5ae3('0x1b')],function(_0x49ec7b){return{'model':db[_0x49ec7b[_0x5ae3('0x1d')]],'as':_0x49ec7b['as'],'attributes':_0x49ec7b[_0x5ae3('0x19')],'include':_0x49ec7b[_0x5ae3('0x1b')]?_[_0x5ae3('0x1c')](_0x49ec7b['include'],function(_0x1b95ed){return{'model':db[_0x1b95ed[_0x5ae3('0x1d')]],'as':_0x1b95ed['as'],'attributes':_0x1b95ed['attributes']};}):[]};}):[]};}):[]:[]})[_0x5ae3('0x1e')](function(_0x4dbe22){logger['info'](_0x5ae3('0x16'),_0x2d8626);logger[_0x5ae3('0x1f')]('GetMemberReport',_0x2d8626,JSON[_0x5ae3('0xf')](_0x4dbe22));_0x27be78(_0x4dbe22);})[_0x5ae3('0x15')](function(_0x4c9c7a){logger[_0x5ae3('0x10')](_0x5ae3('0x16'),_0x4c9c7a['message'],_0x2d8626);_0x1d45bc(_0x3b34eb[_0x5ae3('0x10')](0x1f4,_0x4c9c7a[_0x5ae3('0x13')]));});});};exports['CreateMemberReport']=function(_0x37d206){var _0xf0bb19=this;return new Promise(function(_0xabe28a,_0x2217a8){return db[_0x5ae3('0x17')][_0x5ae3('0x20')](_0x37d206['body'],{'raw':_0x37d206[_0x5ae3('0x18')]?_0x37d206[_0x5ae3('0x18')][_0x5ae3('0x21')]===undefined?!![]:![]:!![]})[_0x5ae3('0x1e')](function(_0xb16eff){logger['info'](_0x5ae3('0x22'),_0x37d206);logger['debug']('CreateMemberReport',_0x37d206,JSON[_0x5ae3('0xf')](_0xb16eff));_0xabe28a(_0xb16eff);})[_0x5ae3('0x15')](function(_0x41526f){logger[_0x5ae3('0x10')](_0x5ae3('0x22'),_0x41526f['message'],_0x37d206);_0x2217a8(_0xf0bb19[_0x5ae3('0x10')](0x1f4,_0x41526f[_0x5ae3('0x13')]));});});};exports[_0x5ae3('0x23')]=function(_0x315c59){var _0x682da0=this;return new Promise(function(_0x2875ba,_0x5b66d9){return db['MemberReport'][_0x5ae3('0x24')](_0x315c59[_0x5ae3('0x25')],{'raw':_0x315c59[_0x5ae3('0x18')]?_0x315c59[_0x5ae3('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x315c59[_0x5ae3('0x18')]?_0x315c59[_0x5ae3('0x18')][_0x5ae3('0x26')]||null:null,'attributes':_0x315c59[_0x5ae3('0x18')]?_0x315c59['options'][_0x5ae3('0x19')]||null:null,'limit':_0x315c59['options']?_0x315c59['options'][_0x5ae3('0x1a')]||null:null})[_0x5ae3('0x1e')](function(_0x1484df){logger[_0x5ae3('0xc')](_0x5ae3('0x23'),_0x315c59);logger['debug'](_0x5ae3('0x23'),_0x315c59,JSON['stringify'](_0x1484df));_0x2875ba(_0x1484df);})['catch'](function(_0x4cf9f5){logger[_0x5ae3('0x10')](_0x5ae3('0x23'),_0x4cf9f5[_0x5ae3('0x13')],_0x315c59);_0x5b66d9(_0x682da0[_0x5ae3('0x10')](0x1f4,_0x4cf9f5['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 5a19a9e..4d878f3 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 _0x3c17=['Router','fs-extra','../../components/interaction/service','../../config/environment','./migration.controller','get','exports','multer','path','express'];(function(_0x48b01f,_0x51f46d){var _0x105614=function(_0x2ddd1d){while(--_0x2ddd1d){_0x48b01f['push'](_0x48b01f['shift']());}};_0x105614(++_0x51f46d);}(_0x3c17,0x1a1));var _0x73c1=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0x3c17[_0x40bffc];return _0x3007e9;};'use strict';var multer=require(_0x73c1('0x0'));var util=require('util');var path=require(_0x73c1('0x1'));var timeout=require('connect-timeout');var express=require(_0x73c1('0x2'));var router=express[_0x73c1('0x3')]();var fs_extra=require(_0x73c1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x73c1('0x5'));var config=require(_0x73c1('0x6'));var controller=require(_0x73c1('0x7'));router[_0x73c1('0x8')]('/',controller['index']);module[_0x73c1('0x9')]=router; \ No newline at end of file +var _0x3be6=['get','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller'];(function(_0x349148,_0x31eabb){var _0x2f2b0f=function(_0x44726e){while(--_0x44726e){_0x349148['push'](_0x349148['shift']());}};_0x2f2b0f(++_0x31eabb);}(_0x3be6,0x6d));var _0x63be=function(_0x587ba2,_0x42eb40){_0x587ba2=_0x587ba2-0x0;var _0x50ec73=_0x3be6[_0x587ba2];return _0x50ec73;};'use strict';var multer=require(_0x63be('0x0'));var util=require(_0x63be('0x1'));var path=require(_0x63be('0x2'));var timeout=require(_0x63be('0x3'));var express=require(_0x63be('0x4'));var router=express[_0x63be('0x5')]();var fs_extra=require(_0x63be('0x6'));var auth=require(_0x63be('0x7'));var interaction=require(_0x63be('0x8'));var config=require(_0x63be('0x9'));var controller=require(_0x63be('0xa'));router[_0x63be('0xb')]('/',controller['index']);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 37023eb..40dd0f4 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 _0x8d24=['version','exports','STRING'];(function(_0x1fcaf1,_0x21c3c2){var _0x55f464=function(_0x348eb3){while(--_0x348eb3){_0x1fcaf1['push'](_0x1fcaf1['shift']());}};_0x55f464(++_0x21c3c2);}(_0x8d24,0xd9));var _0x48d2=function(_0xa8d7ef,_0x4b8b3d){_0xa8d7ef=_0xa8d7ef-0x0;var _0x239d5e=_0x8d24[_0xa8d7ef];return _0x239d5e;};'use strict';var Sequelize=require('sequelize');module[_0x48d2('0x0')]={'version':{'type':Sequelize[_0x48d2('0x1')],'unique':_0x48d2('0x2')}}; \ No newline at end of file +var _0xc970=['sequelize','exports','STRING'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xc970,0x84));var _0x0c97=function(_0x2fb8e9,_0x5c9d56){_0x2fb8e9=_0x2fb8e9-0x0;var _0x4a840f=_0xc970[_0x2fb8e9];return _0x4a840f;};'use strict';var Sequelize=require(_0x0c97('0x0'));module[_0x0c97('0x1')]={'version':{'type':Sequelize[_0x0c97('0x2')],'unique':'version'}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 19982a9..da5170e 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 _0xe548=['../../config/utils','sendStatus','end','status','offset','limit','undefined','count','Content-Range','json','apply','reject','update','then','error','stack','name','send','index','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','Migration','includeAll','include','findAll','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x5d30b4,_0x199248){var _0x1acfb8=function(_0x3544b2){while(--_0x3544b2){_0x5d30b4['push'](_0x5d30b4['shift']());}};_0x1acfb8(++_0x199248);}(_0xe548,0x184));var _0x8e54=function(_0x333767,_0x3e6f9c){_0x333767=_0x333767-0x0;var _0x51661b=_0xe548[_0x333767];return _0x51661b;};'use strict';var emlformat=require(_0x8e54('0x0'));var rimraf=require(_0x8e54('0x1'));var zipdir=require(_0x8e54('0x2'));var jsonpatch=require(_0x8e54('0x3'));var rp=require(_0x8e54('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x8e54('0x5'));var csv=require('to-csv');var ejs=require(_0x8e54('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8e54('0x7'));var squel=require(_0x8e54('0x8'));var crypto=require(_0x8e54('0x9'));var jsforce=require(_0x8e54('0xa'));var deskjs=require(_0x8e54('0xb'));var toCsv=require(_0x8e54('0xc'));var querystring=require(_0x8e54('0xd'));var Papa=require('papaparse');var Redis=require(_0x8e54('0xe'));var authService=require(_0x8e54('0xf'));var qs=require(_0x8e54('0x10'));var as=require(_0x8e54('0x11'));var hardwareService=require(_0x8e54('0x12'));var logger=require('../../config/logger')(_0x8e54('0x13'));var utils=require(_0x8e54('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b3d75,_0x1c3c4c){_0x1c3c4c=_0x1c3c4c||0xcc;return function(_0x42664d){if(_0x42664d){return _0x4b3d75[_0x8e54('0x15')](_0x1c3c4c);}return _0x4b3d75['status'](_0x1c3c4c)[_0x8e54('0x16')]();};}function respondWithResult(_0x349ca4,_0x50fd8b){_0x50fd8b=_0x50fd8b||0xc8;return function(_0x5848e5){if(_0x5848e5){return _0x349ca4[_0x8e54('0x17')](_0x50fd8b)['json'](_0x5848e5);}};}function respondWithFilteredResult(_0x4e66f4,_0x502dbd){return function(_0x5c453f){if(_0x5c453f){var _0x2c75d8=typeof _0x502dbd[_0x8e54('0x18')]==='undefined'&&typeof _0x502dbd[_0x8e54('0x19')]===_0x8e54('0x1a');var _0x20caac=_0x5c453f['count'];var _0x70e384=_0x2c75d8?0x0:_0x502dbd[_0x8e54('0x18')];var _0x48e32e=_0x2c75d8?_0x5c453f[_0x8e54('0x1b')]:_0x502dbd[_0x8e54('0x18')]+_0x502dbd[_0x8e54('0x19')];var _0x3c7939;if(_0x48e32e>=_0x20caac){_0x48e32e=_0x20caac;_0x3c7939=0xc8;}else{_0x3c7939=0xce;}_0x4e66f4[_0x8e54('0x17')](_0x3c7939);return _0x4e66f4['set'](_0x8e54('0x1c'),_0x70e384+'-'+_0x48e32e+'/'+_0x20caac)[_0x8e54('0x1d')](_0x5c453f);}return null;};}function patchUpdates(_0x1c6792){return function(_0x5d065f){try{jsonpatch[_0x8e54('0x1e')](_0x5d065f,_0x1c6792,!![]);}catch(_0x54689f){return BPromise[_0x8e54('0x1f')](_0x54689f);}return _0x5d065f['save']();};}function saveUpdates(_0x52ca51,_0x548d45){return function(_0x4007ba){if(_0x4007ba){return _0x4007ba[_0x8e54('0x20')](_0x52ca51)['then'](function(_0x7b1949){return _0x7b1949;});}return null;};}function removeEntity(_0x60a991,_0x25f012){return function(_0x2387a5){if(_0x2387a5){return _0x2387a5['destroy']()[_0x8e54('0x21')](function(){_0x60a991[_0x8e54('0x17')](0xcc)[_0x8e54('0x16')]();});}};}function handleEntityNotFound(_0xfeed5f,_0x57893c){return function(_0x5a5942){if(!_0x5a5942){_0xfeed5f[_0x8e54('0x15')](0x194);}return _0x5a5942;};}function handleError(_0x3307a5,_0x591fe4){_0x591fe4=_0x591fe4||0x1f4;return function(_0x36c4d3){logger[_0x8e54('0x22')](_0x36c4d3[_0x8e54('0x23')]);if(_0x36c4d3[_0x8e54('0x24')]){delete _0x36c4d3['name'];}_0x3307a5[_0x8e54('0x17')](_0x591fe4)[_0x8e54('0x25')](_0x36c4d3);};}exports[_0x8e54('0x26')]=function(_0x1e5975,_0x43eccc){var _0x1996d0={},_0x44d18d={},_0x54483d={'count':0x0,'rows':[]};var _0x5e81da=_['map'](db['Migration'][_0x8e54('0x27')],function(_0x4cebb7){return{'name':_0x4cebb7[_0x8e54('0x28')],'type':_0x4cebb7['type'][_0x8e54('0x29')]};});_0x44d18d[_0x8e54('0x2a')]=_[_0x8e54('0x2b')](_0x5e81da,_0x8e54('0x24'));_0x44d18d['query']=_[_0x8e54('0x2c')](_0x1e5975[_0x8e54('0x2d')]);_0x44d18d[_0x8e54('0x2e')]=_[_0x8e54('0x2f')](_0x44d18d[_0x8e54('0x2a')],_0x44d18d['query']);_0x1996d0[_0x8e54('0x30')]=_[_0x8e54('0x2f')](_0x44d18d[_0x8e54('0x2a')],qs['fields'](_0x1e5975[_0x8e54('0x2d')][_0x8e54('0x31')]));_0x1996d0[_0x8e54('0x30')]=_0x1996d0[_0x8e54('0x30')][_0x8e54('0x32')]?_0x1996d0['attributes']:_0x44d18d['model'];if(!_0x1e5975[_0x8e54('0x2d')][_0x8e54('0x33')](_0x8e54('0x34'))){_0x1996d0[_0x8e54('0x19')]=qs[_0x8e54('0x19')](_0x1e5975[_0x8e54('0x2d')][_0x8e54('0x19')]);_0x1996d0[_0x8e54('0x18')]=qs[_0x8e54('0x18')](_0x1e5975[_0x8e54('0x2d')][_0x8e54('0x18')]);}_0x1996d0[_0x8e54('0x35')]=qs[_0x8e54('0x36')](_0x1e5975[_0x8e54('0x2d')][_0x8e54('0x36')]);_0x1996d0[_0x8e54('0x37')]=qs[_0x8e54('0x2e')](_[_0x8e54('0x38')](_0x1e5975[_0x8e54('0x2d')],_0x44d18d[_0x8e54('0x2e')]),_0x5e81da);if(_0x1e5975['query']['filter']){_0x1996d0['where']=_[_0x8e54('0x39')](_0x1996d0[_0x8e54('0x37')],{'$or':_[_0x8e54('0x2b')](_0x5e81da,function(_0x63f8f6){if(_0x63f8f6[_0x8e54('0x3a')]!==_0x8e54('0x3b')){var _0x1c063a={};_0x1c063a[_0x63f8f6[_0x8e54('0x24')]]={'$like':'%'+_0x1e5975[_0x8e54('0x2d')][_0x8e54('0x3c')]+'%'};return _0x1c063a;}})});}_0x1996d0=_[_0x8e54('0x39')]({},_0x1996d0,_0x1e5975[_0x8e54('0x3d')]);var _0x1d805b={'where':_0x1996d0[_0x8e54('0x37')]};return db[_0x8e54('0x3e')][_0x8e54('0x1b')](_0x1d805b)[_0x8e54('0x21')](function(_0x9a78ac){_0x54483d[_0x8e54('0x1b')]=_0x9a78ac;if(_0x1e5975[_0x8e54('0x2d')][_0x8e54('0x3f')]){_0x1996d0[_0x8e54('0x40')]=[{'all':!![]}];}return db['Migration'][_0x8e54('0x41')](_0x1996d0);})[_0x8e54('0x21')](function(_0x2075ea){_0x54483d[_0x8e54('0x42')]=_0x2075ea;return _0x54483d;})['then'](respondWithFilteredResult(_0x43eccc,_0x1996d0))[_0x8e54('0x43')](handleError(_0x43eccc,null));}; \ No newline at end of file +var _0xb67e=['json','offset','undefined','count','limit','apply','save','then','destroy','stack','name','send','map','Migration','rawAttributes','fieldName','type','model','query','intersection','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','options','include','findAll','rows','catch','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xb67e,0x11b));var _0xeb67=function(_0x162dc2,_0x36fee4){_0x162dc2=_0x162dc2-0x0;var _0x25c9b8=_0xb67e[_0x162dc2];return _0x25c9b8;};'use strict';var emlformat=require(_0xeb67('0x0'));var rimraf=require(_0xeb67('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xeb67('0x2'));var rp=require(_0xeb67('0x3'));var moment=require(_0xeb67('0x4'));var BPromise=require(_0xeb67('0x5'));var Mustache=require(_0xeb67('0x6'));var util=require('util');var path=require(_0xeb67('0x7'));var sox=require(_0xeb67('0x8'));var csv=require(_0xeb67('0x9'));var ejs=require(_0xeb67('0xa'));var fs=require('fs');var fs_extra=require(_0xeb67('0xb'));var _=require('lodash');var squel=require(_0xeb67('0xc'));var crypto=require(_0xeb67('0xd'));var jsforce=require(_0xeb67('0xe'));var deskjs=require(_0xeb67('0xf'));var toCsv=require(_0xeb67('0x9'));var querystring=require('querystring');var Papa=require(_0xeb67('0x10'));var Redis=require(_0xeb67('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xeb67('0x12'));var as=require(_0xeb67('0x13'));var hardwareService=require(_0xeb67('0x14'));var logger=require(_0xeb67('0x15'))('api');var utils=require(_0xeb67('0x16'));var config=require(_0xeb67('0x17'));var licenseUtil=require(_0xeb67('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2df688,_0x5c3837){_0x5c3837=_0x5c3837||0xcc;return function(_0x3088bb){if(_0x3088bb){return _0x2df688['sendStatus'](_0x5c3837);}return _0x2df688[_0xeb67('0x19')](_0x5c3837)[_0xeb67('0x1a')]();};}function respondWithResult(_0x5b1a5c,_0x494166){_0x494166=_0x494166||0xc8;return function(_0x2d0ed2){if(_0x2d0ed2){return _0x5b1a5c[_0xeb67('0x19')](_0x494166)[_0xeb67('0x1b')](_0x2d0ed2);}};}function respondWithFilteredResult(_0x324854,_0x598244){return function(_0x50a119){if(_0x50a119){var _0x20c43d=typeof _0x598244[_0xeb67('0x1c')]===_0xeb67('0x1d')&&typeof _0x598244['limit']===_0xeb67('0x1d');var _0x2bc236=_0x50a119[_0xeb67('0x1e')];var _0x552194=_0x20c43d?0x0:_0x598244['offset'];var _0x2971dc=_0x20c43d?_0x50a119[_0xeb67('0x1e')]:_0x598244['offset']+_0x598244[_0xeb67('0x1f')];var _0x917fec;if(_0x2971dc>=_0x2bc236){_0x2971dc=_0x2bc236;_0x917fec=0xc8;}else{_0x917fec=0xce;}_0x324854['status'](_0x917fec);return _0x324854['set']('Content-Range',_0x552194+'-'+_0x2971dc+'/'+_0x2bc236)[_0xeb67('0x1b')](_0x50a119);}return null;};}function patchUpdates(_0x5858c5){return function(_0x5a6d7e){try{jsonpatch[_0xeb67('0x20')](_0x5a6d7e,_0x5858c5,!![]);}catch(_0x4fa19c){return BPromise['reject'](_0x4fa19c);}return _0x5a6d7e[_0xeb67('0x21')]();};}function saveUpdates(_0x1ef9b9,_0x5defef){return function(_0x36d76f){if(_0x36d76f){return _0x36d76f['update'](_0x1ef9b9)[_0xeb67('0x22')](function(_0x31da4a){return _0x31da4a;});}return null;};}function removeEntity(_0x17efa7,_0x44a4f8){return function(_0x534348){if(_0x534348){return _0x534348[_0xeb67('0x23')]()[_0xeb67('0x22')](function(){_0x17efa7[_0xeb67('0x19')](0xcc)[_0xeb67('0x1a')]();});}};}function handleEntityNotFound(_0x12c1f4,_0x41085e){return function(_0x5007fd){if(!_0x5007fd){_0x12c1f4['sendStatus'](0x194);}return _0x5007fd;};}function handleError(_0x18a957,_0x2e289d){_0x2e289d=_0x2e289d||0x1f4;return function(_0x3268f0){logger['error'](_0x3268f0[_0xeb67('0x24')]);if(_0x3268f0[_0xeb67('0x25')]){delete _0x3268f0['name'];}_0x18a957[_0xeb67('0x19')](_0x2e289d)[_0xeb67('0x26')](_0x3268f0);};}exports['index']=function(_0x32a9d5,_0x353292){var _0x590c17={},_0x31e922={},_0x171ef0={'count':0x0,'rows':[]};var _0x406e93=_[_0xeb67('0x27')](db[_0xeb67('0x28')][_0xeb67('0x29')],function(_0xcd608){return{'name':_0xcd608[_0xeb67('0x2a')],'type':_0xcd608[_0xeb67('0x2b')]['key']};});_0x31e922[_0xeb67('0x2c')]=_[_0xeb67('0x27')](_0x406e93,_0xeb67('0x25'));_0x31e922['query']=_['keys'](_0x32a9d5[_0xeb67('0x2d')]);_0x31e922['filters']=_[_0xeb67('0x2e')](_0x31e922[_0xeb67('0x2c')],_0x31e922[_0xeb67('0x2d')]);_0x590c17[_0xeb67('0x2f')]=_[_0xeb67('0x2e')](_0x31e922['model'],qs['fields'](_0x32a9d5[_0xeb67('0x2d')]['fields']));_0x590c17[_0xeb67('0x2f')]=_0x590c17[_0xeb67('0x2f')][_0xeb67('0x30')]?_0x590c17[_0xeb67('0x2f')]:_0x31e922['model'];if(!_0x32a9d5[_0xeb67('0x2d')][_0xeb67('0x31')](_0xeb67('0x32'))){_0x590c17[_0xeb67('0x1f')]=qs[_0xeb67('0x1f')](_0x32a9d5[_0xeb67('0x2d')][_0xeb67('0x1f')]);_0x590c17['offset']=qs[_0xeb67('0x1c')](_0x32a9d5[_0xeb67('0x2d')][_0xeb67('0x1c')]);}_0x590c17['order']=qs[_0xeb67('0x33')](_0x32a9d5[_0xeb67('0x2d')]['sort']);_0x590c17['where']=qs[_0xeb67('0x34')](_[_0xeb67('0x35')](_0x32a9d5[_0xeb67('0x2d')],_0x31e922['filters']),_0x406e93);if(_0x32a9d5[_0xeb67('0x2d')][_0xeb67('0x36')]){_0x590c17[_0xeb67('0x37')]=_[_0xeb67('0x38')](_0x590c17[_0xeb67('0x37')],{'$or':_[_0xeb67('0x27')](_0x406e93,function(_0x3f53c4){if(_0x3f53c4[_0xeb67('0x2b')]!=='VIRTUAL'){var _0x374c84={};_0x374c84[_0x3f53c4[_0xeb67('0x25')]]={'$like':'%'+_0x32a9d5[_0xeb67('0x2d')][_0xeb67('0x36')]+'%'};return _0x374c84;}})});}_0x590c17=_['merge']({},_0x590c17,_0x32a9d5[_0xeb67('0x39')]);var _0x13a37f={'where':_0x590c17[_0xeb67('0x37')]};return db['Migration'][_0xeb67('0x1e')](_0x13a37f)[_0xeb67('0x22')](function(_0xc3ad95){_0x171ef0[_0xeb67('0x1e')]=_0xc3ad95;if(_0x32a9d5[_0xeb67('0x2d')]['includeAll']){_0x590c17[_0xeb67('0x3a')]=[{'all':!![]}];}return db['Migration'][_0xeb67('0x3b')](_0x590c17);})['then'](function(_0x103ced){_0x171ef0[_0xeb67('0x3c')]=_0x103ced;return _0x171ef0;})[_0xeb67('0x22')](respondWithFilteredResult(_0x353292,_0x590c17))[_0xeb67('0x3d')](handleError(_0x353292,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index c2375e6..f63b25f 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 _0x498b=['path','rimraf','../../config/environment','./migration.attributes','exports','define','Migration','migrations','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x24a94d,_0x14fbad){var _0x52144b=function(_0xd344d9){while(--_0xd344d9){_0x24a94d['push'](_0x24a94d['shift']());}};_0x52144b(++_0x14fbad);}(_0x498b,0xb0));var _0xb498=function(_0x52f9ee,_0x2133eb){_0x52f9ee=_0x52f9ee-0x0;var _0x4925b5=_0x498b[_0x52f9ee];return _0x4925b5;};'use strict';var _=require(_0xb498('0x0'));var util=require(_0xb498('0x1'));var logger=require(_0xb498('0x2'))('api');var moment=require(_0xb498('0x3'));var BPromise=require(_0xb498('0x4'));var rp=require(_0xb498('0x5'));var fs=require('fs');var path=require(_0xb498('0x6'));var rimraf=require(_0xb498('0x7'));var config=require(_0xb498('0x8'));var attributes=require(_0xb498('0x9'));module[_0xb498('0xa')]=function(_0x4357ec,_0x193239){return _0x4357ec[_0xb498('0xb')](_0xb498('0xc'),attributes,{'tableName':_0xb498('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x36df=['./migration.attributes','define','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x1bcc19,_0x4cd1c6){var _0xe83385=function(_0x4b5f32){while(--_0x4b5f32){_0x1bcc19['push'](_0x1bcc19['shift']());}};_0xe83385(++_0x4cd1c6);}(_0x36df,0x112));var _0xf36d=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x36df[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf36d('0x0'))(_0xf36d('0x1'));var moment=require('moment');var BPromise=require(_0xf36d('0x2'));var rp=require(_0xf36d('0x3'));var fs=require('fs');var path=require(_0xf36d('0x4'));var rimraf=require('rimraf');var config=require(_0xf36d('0x5'));var attributes=require(_0xf36d('0x6'));module['exports']=function(_0x2728b7,_0x5a705e){return _0x2728b7[_0xf36d('0x7')]('Migration',attributes,{'tableName':'migrations','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 b39610b..9617435 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 _0x1b73=['debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','Migration,\x20%s,\x20%s','request\x20sent'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x1b73,0x1d5));var _0x31b7=function(_0x2e788a,_0x146b2b){_0x2e788a=_0x2e788a-0x0;var _0x39b7f5=_0x1b73[_0x2e788a];return _0x39b7f5;};'use strict';var _=require('lodash');var util=require(_0x31b7('0x0'));var moment=require(_0x31b7('0x1'));var BPromise=require(_0x31b7('0x2'));var rs=require(_0x31b7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x31b7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x31b7('0x5'))(_0x31b7('0x6'));var config=require('../../config/environment');var jayson=require(_0x31b7('0x7'));var client=jayson[_0x31b7('0x8')][_0x31b7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x502838,_0x445dbe,_0x1a730f){return new BPromise(function(_0x86ef8e,_0x19b92a){return client[_0x31b7('0xa')](_0x502838,_0x1a730f)[_0x31b7('0xb')](function(_0x3d2b41){logger['info'](_0x31b7('0xc'),_0x445dbe,_0x31b7('0xd'));logger[_0x31b7('0xe')](_0x31b7('0xf'),_0x445dbe,_0x31b7('0xd'),JSON[_0x31b7('0x10')](_0x3d2b41));if(_0x3d2b41[_0x31b7('0x11')]){if(_0x3d2b41[_0x31b7('0x11')][_0x31b7('0x12')]===0x1f4){logger[_0x31b7('0x11')]('Migration,\x20%s,\x20%s',_0x445dbe,_0x3d2b41[_0x31b7('0x11')][_0x31b7('0x13')]);return _0x19b92a(_0x3d2b41[_0x31b7('0x11')][_0x31b7('0x13')]);}logger[_0x31b7('0x11')](_0x31b7('0xc'),_0x445dbe,_0x3d2b41[_0x31b7('0x11')][_0x31b7('0x13')]);return _0x86ef8e(_0x3d2b41[_0x31b7('0x11')]['message']);}else{logger[_0x31b7('0x14')]('Migration,\x20%s,\x20%s',_0x445dbe,_0x31b7('0xd'));_0x86ef8e(_0x3d2b41[_0x31b7('0x15')]['message']);}})[_0x31b7('0x16')](function(_0x3c71ae){logger[_0x31b7('0x11')](_0x31b7('0xc'),_0x445dbe,_0x3c71ae);_0x19b92a(_0x3c71ae);});});} \ No newline at end of file +var _0xc902=['../../config/environment','jayson/promise','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x53f04f,_0x419aa8){var _0x16a824=function(_0x5712c9){while(--_0x5712c9){_0x53f04f['push'](_0x53f04f['shift']());}};_0x16a824(++_0x419aa8);}(_0xc902,0x15c));var _0x2c90=function(_0x4850f5,_0x3365c0){_0x4850f5=_0x4850f5-0x0;var _0x300169=_0xc902[_0x4850f5];return _0x300169;};'use strict';var _=require(_0x2c90('0x0'));var util=require(_0x2c90('0x1'));var moment=require(_0x2c90('0x2'));var BPromise=require(_0x2c90('0x3'));var rs=require(_0x2c90('0x4'));var fs=require('fs');var Redis=require(_0x2c90('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2c90('0x6'));var logger=require(_0x2c90('0x7'))(_0x2c90('0x8'));var config=require(_0x2c90('0x9'));var jayson=require(_0x2c90('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x73546a,_0x2b16eb,_0x2a9ed9){return new BPromise(function(_0x5edd0d,_0xfb5e40){return client['request'](_0x73546a,_0x2a9ed9)['then'](function(_0x1ee22a){logger['info'](_0x2c90('0xb'),_0x2b16eb,_0x2c90('0xc'));logger[_0x2c90('0xd')](_0x2c90('0xe'),_0x2b16eb,_0x2c90('0xc'),JSON[_0x2c90('0xf')](_0x1ee22a));if(_0x1ee22a[_0x2c90('0x10')]){if(_0x1ee22a[_0x2c90('0x10')]['code']===0x1f4){logger[_0x2c90('0x10')](_0x2c90('0xb'),_0x2b16eb,_0x1ee22a['error'][_0x2c90('0x11')]);return _0xfb5e40(_0x1ee22a['error'][_0x2c90('0x11')]);}logger[_0x2c90('0x10')](_0x2c90('0xb'),_0x2b16eb,_0x1ee22a[_0x2c90('0x10')][_0x2c90('0x11')]);return _0x5edd0d(_0x1ee22a[_0x2c90('0x10')]['message']);}else{logger[_0x2c90('0x12')](_0x2c90('0xb'),_0x2b16eb,_0x2c90('0xc'));_0x5edd0d(_0x1ee22a[_0x2c90('0x13')][_0x2c90('0x11')]);}})[_0x2c90('0x14')](function(_0x16be42){logger[_0x2c90('0x10')](_0x2c90('0xb'),_0x2b16eb,_0x16be42);_0xfb5e40(_0x16be42);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 7dbc3e2..c2a9781 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 _0x67d1=['post','create','put','/:id','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./network.controller','get','isAuthenticated','show'];(function(_0x222509,_0x303a54){var _0x44fe99=function(_0x5408fe){while(--_0x5408fe){_0x222509['push'](_0x222509['shift']());}};_0x44fe99(++_0x303a54);}(_0x67d1,0xf1));var _0x167d=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x67d1[_0x2112d4];return _0x434972;};'use strict';var multer=require('multer');var util=require(_0x167d('0x0'));var path=require(_0x167d('0x1'));var timeout=require('connect-timeout');var express=require(_0x167d('0x2'));var router=express[_0x167d('0x3')]();var fs_extra=require(_0x167d('0x4'));var auth=require(_0x167d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x167d('0x6'));var controller=require(_0x167d('0x7'));router[_0x167d('0x8')]('/',auth[_0x167d('0x9')](),controller['index']);router[_0x167d('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x167d('0xa')]);router[_0x167d('0xb')]('/',auth[_0x167d('0x9')](),controller[_0x167d('0xc')]);router[_0x167d('0xd')](_0x167d('0xe'),auth[_0x167d('0x9')](),controller['update']);router[_0x167d('0xf')](_0x167d('0xe'),auth[_0x167d('0x9')](),controller[_0x167d('0x10')]);module[_0x167d('0x11')]=router; \ No newline at end of file +var _0xd4d0=['fs-extra','../../components/auth/service','../../components/interaction/service','./network.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','multer','path','connect-timeout'];(function(_0x3dfce7,_0x190b66){var _0x3f0e60=function(_0x2120f1){while(--_0x2120f1){_0x3dfce7['push'](_0x3dfce7['shift']());}};_0x3f0e60(++_0x190b66);}(_0xd4d0,0x6d));var _0x0d4d=function(_0x1a3210,_0x54fc28){_0x1a3210=_0x1a3210-0x0;var _0x2eb448=_0xd4d0[_0x1a3210];return _0x2eb448;};'use strict';var multer=require(_0x0d4d('0x0'));var util=require('util');var path=require(_0x0d4d('0x1'));var timeout=require(_0x0d4d('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0d4d('0x3'));var auth=require(_0x0d4d('0x4'));var interaction=require(_0x0d4d('0x5'));var config=require('../../config/environment');var controller=require(_0x0d4d('0x6'));router[_0x0d4d('0x7')]('/',auth[_0x0d4d('0x8')](),controller[_0x0d4d('0x9')]);router[_0x0d4d('0x7')](_0x0d4d('0xa'),auth[_0x0d4d('0x8')](),controller['show']);router[_0x0d4d('0xb')]('/',auth[_0x0d4d('0x8')](),controller[_0x0d4d('0xc')]);router[_0x0d4d('0xd')]('/:id',auth[_0x0d4d('0x8')](),controller[_0x0d4d('0xe')]);router[_0x0d4d('0xf')](_0x0d4d('0xa'),auth[_0x0d4d('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 43df8a0..3eeef58 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 _0x9da3=['STRING','sequelize','ENUM','localnet','stun','turn'];(function(_0x5eea49,_0x434f00){var _0x99c1d6=function(_0x9ff32b){while(--_0x9ff32b){_0x5eea49['push'](_0x5eea49['shift']());}};_0x99c1d6(++_0x434f00);}(_0x9da3,0x79));var _0x39da=function(_0x442aaf,_0x1a366c){_0x442aaf=_0x442aaf-0x0;var _0x2ddd51=_0x9da3[_0x442aaf];return _0x2ddd51;};'use strict';var Sequelize=require(_0x39da('0x0'));module['exports']={'type':{'type':Sequelize[_0x39da('0x1')](_0x39da('0x2'),'externip',_0x39da('0x3'),_0x39da('0x4'))},'value':{'type':Sequelize[_0x39da('0x5')]},'username':{'type':Sequelize[_0x39da('0x5')]},'password':{'type':Sequelize[_0x39da('0x5')]}}; \ No newline at end of file +var _0x6b22=['turn','STRING','exports','ENUM','externip','stun'];(function(_0x44216d,_0x4938a7){var _0xeca523=function(_0x11faf1){while(--_0x11faf1){_0x44216d['push'](_0x44216d['shift']());}};_0xeca523(++_0x4938a7);}(_0x6b22,0x1c4));var _0x26b2=function(_0x42258e,_0x5491f0){_0x42258e=_0x42258e-0x0;var _0x2bbc26=_0x6b22[_0x42258e];return _0x2bbc26;};'use strict';var Sequelize=require('sequelize');module[_0x26b2('0x0')]={'type':{'type':Sequelize[_0x26b2('0x1')]('localnet',_0x26b2('0x2'),_0x26b2('0x3'),_0x26b2('0x4'))},'value':{'type':Sequelize[_0x26b2('0x5')]},'username':{'type':Sequelize[_0x26b2('0x5')]},'password':{'type':Sequelize[_0x26b2('0x5')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 6e1cf2d..156482c 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 _0xb5fe=['show','params','keys','rawAttributes','find','create','body','STUN','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','Reload','res_stun_monitor.so','toUpperCase','TURN','readFileSync','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','/etc/asterisk/stun_xcally.conf','util','path','ejs','lodash','../../config/logger','api','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','status','json','offset','undefined','limit','set','update','destroy','end','sendStatus','name','send','index','map','Network','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','catch'];(function(_0x352df8,_0x4cccae){var _0x3b3084=function(_0xc75d06){while(--_0xc75d06){_0x352df8['push'](_0x352df8['shift']());}};_0x3b3084(++_0x4cccae);}(_0xb5fe,0x173));var _0xeb5f=function(_0x4225be,_0x3b869a){_0x4225be=_0x4225be-0x0;var _0x23b5c7=_0xb5fe[_0x4225be];return _0x23b5c7;};'use strict';var util=require(_0xeb5f('0x0'));var path=require(_0xeb5f('0x1'));var ejs=require(_0xeb5f('0x2'));var fs=require('fs');var _=require(_0xeb5f('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0xeb5f('0x4'))(_0xeb5f('0x5'));var config=require(_0xeb5f('0x6'));var db=require('../../mysqldb')['db'];var jayson=require(_0xeb5f('0x7'));var client=jayson[_0xeb5f('0x8')][_0xeb5f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c712b,_0xa06783,_0x1760e9,_0x4c73ac){return new Promise(function(_0x44e9f7,_0x4e14a7){var _0x41ffcd=_0x4c73ac||client;return _0x41ffcd['request'](_0x1c712b,_0x1760e9)[_0xeb5f('0xa')](function(_0x4b0e6a){logger[_0xeb5f('0xb')](_0xeb5f('0xc'),_0xa06783,_0xeb5f('0xd'));logger[_0xeb5f('0xe')]('Network,\x20%s,\x20%s,\x20%s',_0xa06783,_0xeb5f('0xd'),JSON['stringify'](_0x4b0e6a));if(_0x4b0e6a['error']){if(_0x4b0e6a[_0xeb5f('0xf')][_0xeb5f('0x10')]===0x1f4){logger[_0xeb5f('0xf')](_0xeb5f('0xc'),_0xa06783,_0x4b0e6a[_0xeb5f('0xf')][_0xeb5f('0x11')]);return _0x4e14a7(_0x4b0e6a[_0xeb5f('0xf')]['message']);}logger['error'](_0xeb5f('0xc'),_0xa06783,_0x4b0e6a[_0xeb5f('0xf')]['message']);return _0x44e9f7(_0x4b0e6a[_0xeb5f('0xf')][_0xeb5f('0x11')]);}else{logger['info'](_0xeb5f('0xc'),_0xa06783,_0xeb5f('0xd'));_0x44e9f7(_0x4b0e6a[_0xeb5f('0x12')][_0xeb5f('0x11')]);}})['catch'](function(_0x8255cf){logger[_0xeb5f('0xf')](_0xeb5f('0xc'),_0xa06783,_0x8255cf);_0x4e14a7(_0x8255cf);});});}function respondWithResult(_0x1f7d9e,_0x42ed0a){_0x42ed0a=_0x42ed0a||0xc8;return function(_0xa7cc82){if(_0xa7cc82){return _0x1f7d9e[_0xeb5f('0x13')](_0x42ed0a)[_0xeb5f('0x14')](_0xa7cc82);}};}function respondWithFilteredResult(_0x4e55db,_0x27c271){return function(_0x435b2e){if(_0x435b2e){var _0x14aa8a=typeof _0x27c271[_0xeb5f('0x15')]===_0xeb5f('0x16')&&typeof _0x27c271[_0xeb5f('0x17')]==='undefined';var _0x229794=_0x435b2e['count'];var _0x1cfe43=_0x14aa8a?0x0:_0x27c271[_0xeb5f('0x15')];var _0x25b4de=_0x14aa8a?_0x435b2e['count']:_0x27c271['offset']+_0x27c271[_0xeb5f('0x17')];var _0x392a2a;if(_0x25b4de>=_0x229794){_0x25b4de=_0x229794;_0x392a2a=0xc8;}else{_0x392a2a=0xce;}_0x4e55db[_0xeb5f('0x13')](_0x392a2a);return _0x4e55db[_0xeb5f('0x18')]('Content-Range',_0x1cfe43+'-'+_0x25b4de+'/'+_0x229794)[_0xeb5f('0x14')](_0x435b2e);}return null;};}function saveUpdates(_0x5ac736){return function(_0x2dbf68){if(_0x2dbf68){return _0x2dbf68[_0xeb5f('0x19')](_0x5ac736)[_0xeb5f('0xa')](function(_0x166c8b){return _0x166c8b;});}return null;};}function removeEntity(_0xf0eda3){return function(_0x277e6c){if(_0x277e6c){return _0x277e6c[_0xeb5f('0x1a')]()[_0xeb5f('0xa')](function(){_0xf0eda3[_0xeb5f('0x13')](0xcc)[_0xeb5f('0x1b')]();});}};}function handleEntityNotFound(_0x44d45f){return function(_0x52f3fb){if(!_0x52f3fb){_0x44d45f[_0xeb5f('0x1c')](0x194);}return _0x52f3fb;};}function handleError(_0x4aac72,_0x42dbb2){_0x42dbb2=_0x42dbb2||0x1f4;return function(_0x556bf6){logger[_0xeb5f('0xf')](_0x556bf6['stack']);if(_0x556bf6[_0xeb5f('0x1d')]){delete _0x556bf6['name'];}_0x4aac72[_0xeb5f('0x13')](_0x42dbb2)[_0xeb5f('0x1e')](_0x556bf6);};}exports[_0xeb5f('0x1f')]=function(_0x9d0087,_0x5edd22){var _0x108476={},_0x2fced4={},_0xb9baf6={'count':0x0,'rows':[]};var _0x8b50c2=_[_0xeb5f('0x20')](db[_0xeb5f('0x21')]['rawAttributes'],function(_0x3910f3){return{'name':_0x3910f3[_0xeb5f('0x22')],'type':_0x3910f3[_0xeb5f('0x23')][_0xeb5f('0x24')]};});_0x2fced4['model']=_[_0xeb5f('0x20')](_0x8b50c2,_0xeb5f('0x1d'));_0x2fced4[_0xeb5f('0x25')]=_['keys'](_0x9d0087[_0xeb5f('0x25')]);_0x2fced4[_0xeb5f('0x26')]=_[_0xeb5f('0x27')](_0x2fced4[_0xeb5f('0x28')],_0x2fced4['query']);_0x108476[_0xeb5f('0x29')]=_[_0xeb5f('0x27')](_0x2fced4['model'],qs[_0xeb5f('0x2a')](_0x9d0087[_0xeb5f('0x25')][_0xeb5f('0x2a')]));_0x108476[_0xeb5f('0x29')]=_0x108476[_0xeb5f('0x29')][_0xeb5f('0x2b')]?_0x108476['attributes']:_0x2fced4[_0xeb5f('0x28')];if(!_0x9d0087[_0xeb5f('0x25')][_0xeb5f('0x2c')](_0xeb5f('0x2d'))){_0x108476['limit']=qs['limit'](_0x9d0087[_0xeb5f('0x25')][_0xeb5f('0x17')]);_0x108476[_0xeb5f('0x15')]=qs[_0xeb5f('0x15')](_0x9d0087['query'][_0xeb5f('0x15')]);}_0x108476[_0xeb5f('0x2e')]=qs[_0xeb5f('0x2f')](_0x9d0087['query']['sort']);_0x108476[_0xeb5f('0x30')]=qs[_0xeb5f('0x26')](_[_0xeb5f('0x31')](_0x9d0087[_0xeb5f('0x25')],_0x2fced4['filters']),_0x8b50c2);if(_0x9d0087[_0xeb5f('0x25')][_0xeb5f('0x32')]){_0x108476[_0xeb5f('0x30')]=_[_0xeb5f('0x33')](_0x108476[_0xeb5f('0x30')],{'$or':_[_0xeb5f('0x20')](_0x8b50c2,function(_0x149b6c){if(_0x149b6c['type']!==_0xeb5f('0x34')){var _0x3b4605={};_0x3b4605[_0x149b6c['name']]={'$like':'%'+_0x9d0087['query']['filter']+'%'};return _0x3b4605;}})});}_0x108476=_[_0xeb5f('0x33')]({},_0x108476,_0x9d0087[_0xeb5f('0x35')]);var _0x56efa4={'where':_0x108476[_0xeb5f('0x30')]};return db[_0xeb5f('0x21')]['count'](_0x56efa4)[_0xeb5f('0xa')](function(_0x50e236){_0xb9baf6[_0xeb5f('0x36')]=_0x50e236;if(_0x9d0087[_0xeb5f('0x25')][_0xeb5f('0x37')]){_0x108476[_0xeb5f('0x38')]=[{'all':!![]}];}return db[_0xeb5f('0x21')][_0xeb5f('0x39')](_0x108476);})['then'](function(_0x40648e){_0xb9baf6['rows']=_0x40648e;return _0xb9baf6;})['then'](respondWithFilteredResult(_0x5edd22,_0x108476))[_0xeb5f('0x3a')](handleError(_0x5edd22,null));};exports[_0xeb5f('0x3b')]=function(_0x2e8989,_0x20c00f){var _0x3bc292={'raw':!![],'where':{'id':_0x2e8989[_0xeb5f('0x3c')]['id']}},_0x59bc58={};_0x59bc58['model']=_[_0xeb5f('0x3d')](db['Network'][_0xeb5f('0x3e')]);_0x59bc58[_0xeb5f('0x25')]=_['keys'](_0x2e8989[_0xeb5f('0x25')]);_0x59bc58[_0xeb5f('0x26')]=_[_0xeb5f('0x27')](_0x59bc58[_0xeb5f('0x28')],_0x59bc58['query']);_0x3bc292[_0xeb5f('0x29')]=_['intersection'](_0x59bc58[_0xeb5f('0x28')],qs[_0xeb5f('0x2a')](_0x2e8989[_0xeb5f('0x25')][_0xeb5f('0x2a')]));_0x3bc292[_0xeb5f('0x29')]=_0x3bc292[_0xeb5f('0x29')][_0xeb5f('0x2b')]?_0x3bc292[_0xeb5f('0x29')]:_0x59bc58['model'];if(_0x2e8989[_0xeb5f('0x25')][_0xeb5f('0x37')]){_0x3bc292[_0xeb5f('0x38')]=[{'all':!![]}];}_0x3bc292=_['merge']({},_0x3bc292,_0x2e8989[_0xeb5f('0x35')]);return db[_0xeb5f('0x21')][_0xeb5f('0x3f')](_0x3bc292)[_0xeb5f('0xa')](handleEntityNotFound(_0x20c00f,null))[_0xeb5f('0xa')](respondWithResult(_0x20c00f,null))['catch'](handleError(_0x20c00f,null));};exports[_0xeb5f('0x40')]=function(_0x40fb71,_0xcaf7e0){var _0x28a0b7;return db[_0xeb5f('0x21')][_0xeb5f('0x40')](_0x40fb71[_0xeb5f('0x41')],{'raw':!![]})['then'](function(_0x2edaf0){_0x28a0b7=_0x2edaf0;return db['Network'][_0xeb5f('0x39')]({'where':{'type':_0x40fb71[_0xeb5f('0x41')][_0xeb5f('0x23')]},'raw':!![]});})[_0xeb5f('0xa')](function(_0x26a011){if(_0x28a0b7['type']['toUpperCase']()==_0xeb5f('0x42')){var _0x43cd97=fs['readFileSync'](path[_0xeb5f('0x43')](config[_0xeb5f('0x44')],_0xeb5f('0x45')),_0xeb5f('0x46'));var _0x183f4c=ejs[_0xeb5f('0x47')](_0x43cd97,{'networks':_0x26a011||[]});fs[_0xeb5f('0x48')]('/etc/asterisk/stun_xcally.conf',_0x183f4c);return respondWithRpcPromise(_0xeb5f('0x49'),_0xeb5f('0x40'),{'module':_0xeb5f('0x4a')});}else if(_0x28a0b7[_0xeb5f('0x23')][_0xeb5f('0x4b')]()==_0xeb5f('0x4c')){var _0x4ad0e0=fs[_0xeb5f('0x4d')](path['join'](config[_0xeb5f('0x44')],_0xeb5f('0x4e')),'utf8');var _0x2b4638=ejs[_0xeb5f('0x47')](_0x4ad0e0,{'networks':_0x26a011||[]});fs[_0xeb5f('0x48')](_0xeb5f('0x4f'),_0x2b4638);return respondWithRpcPromise('Reload',_0xeb5f('0x40'),{'module':'res_stun_monitor.so'});}else{var _0x2d4b02=fs[_0xeb5f('0x4d')](path[_0xeb5f('0x43')](config[_0xeb5f('0x44')],_0xeb5f('0x50')),_0xeb5f('0x46'));var _0x5117ff=ejs[_0xeb5f('0x47')](_0x2d4b02,{'networks':_0x26a011||[]});fs[_0xeb5f('0x48')](util[_0xeb5f('0x51')](_0xeb5f('0x52'),_0x40fb71['body'][_0xeb5f('0x23')][_0xeb5f('0x53')]()),_0x5117ff);return respondWithRpcPromise(_0xeb5f('0x49'),'create',{'module':_0xeb5f('0x54')});}})[_0xeb5f('0xa')](function(){return _0x28a0b7;})[_0xeb5f('0xa')](respondWithResult(_0xcaf7e0,0xc9))[_0xeb5f('0x3a')](handleError(_0xcaf7e0,null));};exports[_0xeb5f('0x19')]=function(_0x586932,_0x1bd7d1){var _0x3042a6;return db['Network'][_0xeb5f('0x3f')]({'where':{'id':_0x586932[_0xeb5f('0x3c')]['id']}})['then'](handleEntityNotFound(_0x1bd7d1,null))['then'](saveUpdates(_0x586932['body'],null))[_0xeb5f('0xa')](function(_0x502ba7){if(_0x502ba7){_0x3042a6=_0x502ba7;return db[_0xeb5f('0x21')]['findAll']({'where':{'type':_0x3042a6[_0xeb5f('0x23')]},'raw':!![]});}return null;})[_0xeb5f('0xa')](function(_0x5da8aa){if(_0x3042a6[_0xeb5f('0x23')]['toUpperCase']()==_0xeb5f('0x42')){var _0x13691e=fs[_0xeb5f('0x4d')](path['join'](config['root'],_0xeb5f('0x45')),'utf8');var _0x1f489f=ejs[_0xeb5f('0x47')](_0x13691e,{'networks':_0x5da8aa||[]});fs['writeFileSync'](_0xeb5f('0x55'),_0x1f489f);return respondWithRpcPromise('Reload',_0xeb5f('0x19'),{'module':'res_stun_monitor.so'});}else if(_0x3042a6[_0xeb5f('0x23')][_0xeb5f('0x4b')]()==_0xeb5f('0x4c')){var _0x3747b7=fs[_0xeb5f('0x4d')](path[_0xeb5f('0x43')](config[_0xeb5f('0x44')],_0xeb5f('0x4e')),_0xeb5f('0x46'));var _0xb861e8=ejs[_0xeb5f('0x47')](_0x3747b7,{'networks':_0x5da8aa||[]});fs[_0xeb5f('0x48')](_0xeb5f('0x4f'),_0xb861e8);return respondWithRpcPromise(_0xeb5f('0x49'),'update',{'module':_0xeb5f('0x4a')});}else{var _0x3063ce=fs['readFileSync'](path['join'](config[_0xeb5f('0x44')],_0xeb5f('0x50')),_0xeb5f('0x46'));var _0x2e3609=ejs[_0xeb5f('0x47')](_0x3063ce,{'networks':_0x5da8aa||[]});fs['writeFileSync'](util['format'](_0xeb5f('0x52'),_0x586932['body'][_0xeb5f('0x23')][_0xeb5f('0x53')]()),_0x2e3609);return respondWithRpcPromise(_0xeb5f('0x49'),_0xeb5f('0x19'),{'module':_0xeb5f('0x54')});}})[_0xeb5f('0xa')](function(_0x3ee867){if(_0x3ee867){return _0x3042a6;}return null;})['then'](respondWithResult(_0x1bd7d1,null))[_0xeb5f('0x3a')](handleError(_0x1bd7d1,null));};exports[_0xeb5f('0x1a')]=function(_0x9bbed1,_0x211874){var _0x19eeab;return db['Network']['find']({'where':{'id':_0x9bbed1['params']['id']}})[_0xeb5f('0xa')](function(_0x20223c){_0x19eeab=_0x20223c;return _0x20223c;})['then'](handleEntityNotFound(_0x211874,null))[_0xeb5f('0xa')](removeEntity(_0x211874,null))[_0xeb5f('0xa')](function(){if(_0x19eeab){return db[_0xeb5f('0x21')]['findAll']({'where':{'type':_0x19eeab['type']},'raw':!![]});}})[_0xeb5f('0xa')](function(_0x1dbd79){if(_0x19eeab[_0xeb5f('0x23')][_0xeb5f('0x4b')]()=='STUN'){var _0x2f0ace=fs[_0xeb5f('0x4d')](path['join'](config[_0xeb5f('0x44')],_0xeb5f('0x45')),_0xeb5f('0x46'));var _0x46f205=ejs[_0xeb5f('0x47')](_0x2f0ace,{'networks':_0x1dbd79||[]});fs[_0xeb5f('0x48')]('/etc/asterisk/stun_xcally.conf',_0x46f205);return respondWithRpcPromise('Reload',_0xeb5f('0x1a'),{'module':_0xeb5f('0x4a')});}else if(_0x19eeab[_0xeb5f('0x23')][_0xeb5f('0x4b')]()==_0xeb5f('0x4c')){var _0x2bc41e=fs['readFileSync'](path[_0xeb5f('0x43')](config[_0xeb5f('0x44')],_0xeb5f('0x4e')),_0xeb5f('0x46'));var _0x3eafed=ejs[_0xeb5f('0x47')](_0x2bc41e,{'networks':_0x1dbd79||[]});fs[_0xeb5f('0x48')]('/etc/asterisk/turn_xcally.conf',_0x3eafed);return respondWithRpcPromise(_0xeb5f('0x49'),_0xeb5f('0x1a'),{'module':_0xeb5f('0x4a')});}else{var _0x4449ee=fs[_0xeb5f('0x4d')](path[_0xeb5f('0x43')](config[_0xeb5f('0x44')],_0xeb5f('0x50')),_0xeb5f('0x46'));var _0x275a98=ejs['render'](_0x4449ee,{'networks':_0x1dbd79||[]});fs[_0xeb5f('0x48')](util[_0xeb5f('0x51')]('/etc/asterisk/sip_xcally_%s.conf',_0x19eeab[_0xeb5f('0x23')]['toLowerCase']()),_0x275a98);return respondWithRpcPromise(_0xeb5f('0x49'),'destroy',{'module':_0xeb5f('0x54')});}})[_0xeb5f('0x3a')](handleError(_0x211874,null));}; \ No newline at end of file +var _0x05ea=['../../config/logger','api','../../config/environment','../../mysqldb','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','status','json','offset','undefined','limit','count','Content-Range','update','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','Network','findAll','rows','show','params','keys','includeAll','create','body','toUpperCase','STUN','join','root','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs','render','readFileSync','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','find','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','util','lodash','../../components/parsers/qs'];(function(_0x2a7d7f,_0x130785){var _0x21ed50=function(_0x1921af){while(--_0x1921af){_0x2a7d7f['push'](_0x2a7d7f['shift']());}};_0x21ed50(++_0x130785);}(_0x05ea,0x151));var _0xa05e=function(_0x8ae98b,_0x155f88){_0x8ae98b=_0x8ae98b-0x0;var _0xc30bd4=_0x05ea[_0x8ae98b];return _0xc30bd4;};'use strict';var util=require(_0xa05e('0x0'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0xa05e('0x1'));var qs=require(_0xa05e('0x2'));var logger=require(_0xa05e('0x3'))(_0xa05e('0x4'));var config=require(_0xa05e('0x5'));var db=require(_0xa05e('0x6'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xa05e('0x7')][_0xa05e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x273200,_0x259f8e,_0x4eba6c,_0x3a2696){return new Promise(function(_0x1802b7,_0x4fa79){var _0x5ca464=_0x3a2696||client;return _0x5ca464['request'](_0x273200,_0x4eba6c)[_0xa05e('0x9')](function(_0x2ab6e4){logger[_0xa05e('0xa')](_0xa05e('0xb'),_0x259f8e,_0xa05e('0xc'));logger['debug'](_0xa05e('0xd'),_0x259f8e,'request\x20sent',JSON[_0xa05e('0xe')](_0x2ab6e4));if(_0x2ab6e4[_0xa05e('0xf')]){if(_0x2ab6e4[_0xa05e('0xf')]['code']===0x1f4){logger[_0xa05e('0xf')](_0xa05e('0xb'),_0x259f8e,_0x2ab6e4[_0xa05e('0xf')][_0xa05e('0x10')]);return _0x4fa79(_0x2ab6e4[_0xa05e('0xf')][_0xa05e('0x10')]);}logger[_0xa05e('0xf')](_0xa05e('0xb'),_0x259f8e,_0x2ab6e4[_0xa05e('0xf')][_0xa05e('0x10')]);return _0x1802b7(_0x2ab6e4[_0xa05e('0xf')]['message']);}else{logger['info'](_0xa05e('0xb'),_0x259f8e,_0xa05e('0xc'));_0x1802b7(_0x2ab6e4['result']['message']);}})[_0xa05e('0x11')](function(_0x4bbfd2){logger['error'](_0xa05e('0xb'),_0x259f8e,_0x4bbfd2);_0x4fa79(_0x4bbfd2);});});}function respondWithResult(_0x3fad2e,_0x5262e6){_0x5262e6=_0x5262e6||0xc8;return function(_0x345dba){if(_0x345dba){return _0x3fad2e[_0xa05e('0x12')](_0x5262e6)[_0xa05e('0x13')](_0x345dba);}};}function respondWithFilteredResult(_0x287f2a,_0x5dac8d){return function(_0x1dd63e){if(_0x1dd63e){var _0x4dc5d3=typeof _0x5dac8d[_0xa05e('0x14')]===_0xa05e('0x15')&&typeof _0x5dac8d[_0xa05e('0x16')]==='undefined';var _0x1c8c68=_0x1dd63e['count'];var _0x17a430=_0x4dc5d3?0x0:_0x5dac8d[_0xa05e('0x14')];var _0x11daf5=_0x4dc5d3?_0x1dd63e[_0xa05e('0x17')]:_0x5dac8d[_0xa05e('0x14')]+_0x5dac8d[_0xa05e('0x16')];var _0x369ee8;if(_0x11daf5>=_0x1c8c68){_0x11daf5=_0x1c8c68;_0x369ee8=0xc8;}else{_0x369ee8=0xce;}_0x287f2a['status'](_0x369ee8);return _0x287f2a['set'](_0xa05e('0x18'),_0x17a430+'-'+_0x11daf5+'/'+_0x1c8c68)[_0xa05e('0x13')](_0x1dd63e);}return null;};}function saveUpdates(_0x5ddd72){return function(_0x534de3){if(_0x534de3){return _0x534de3[_0xa05e('0x19')](_0x5ddd72)[_0xa05e('0x9')](function(_0x5bd4bc){return _0x5bd4bc;});}return null;};}function removeEntity(_0x133945){return function(_0x4f0081){if(_0x4f0081){return _0x4f0081[_0xa05e('0x1a')]()[_0xa05e('0x9')](function(){_0x133945[_0xa05e('0x12')](0xcc)[_0xa05e('0x1b')]();});}};}function handleEntityNotFound(_0x1b5dc9){return function(_0x3613ec){if(!_0x3613ec){_0x1b5dc9[_0xa05e('0x1c')](0x194);}return _0x3613ec;};}function handleError(_0x26b468,_0x2f5ca4){_0x2f5ca4=_0x2f5ca4||0x1f4;return function(_0x150fd8){logger[_0xa05e('0xf')](_0x150fd8[_0xa05e('0x1d')]);if(_0x150fd8[_0xa05e('0x1e')]){delete _0x150fd8[_0xa05e('0x1e')];}_0x26b468[_0xa05e('0x12')](_0x2f5ca4)[_0xa05e('0x1f')](_0x150fd8);};}exports[_0xa05e('0x20')]=function(_0x54a1fd,_0x5226cc){var _0x3a96e1={},_0x621260={},_0x133aca={'count':0x0,'rows':[]};var _0x264a60=_[_0xa05e('0x21')](db['Network'][_0xa05e('0x22')],function(_0xfb14ec){return{'name':_0xfb14ec[_0xa05e('0x23')],'type':_0xfb14ec[_0xa05e('0x24')]['key']};});_0x621260[_0xa05e('0x25')]=_[_0xa05e('0x21')](_0x264a60,'name');_0x621260[_0xa05e('0x26')]=_['keys'](_0x54a1fd[_0xa05e('0x26')]);_0x621260[_0xa05e('0x27')]=_[_0xa05e('0x28')](_0x621260[_0xa05e('0x25')],_0x621260[_0xa05e('0x26')]);_0x3a96e1[_0xa05e('0x29')]=_[_0xa05e('0x28')](_0x621260[_0xa05e('0x25')],qs['fields'](_0x54a1fd[_0xa05e('0x26')][_0xa05e('0x2a')]));_0x3a96e1['attributes']=_0x3a96e1[_0xa05e('0x29')][_0xa05e('0x2b')]?_0x3a96e1[_0xa05e('0x29')]:_0x621260['model'];if(!_0x54a1fd[_0xa05e('0x26')][_0xa05e('0x2c')](_0xa05e('0x2d'))){_0x3a96e1[_0xa05e('0x16')]=qs[_0xa05e('0x16')](_0x54a1fd[_0xa05e('0x26')][_0xa05e('0x16')]);_0x3a96e1[_0xa05e('0x14')]=qs[_0xa05e('0x14')](_0x54a1fd[_0xa05e('0x26')]['offset']);}_0x3a96e1[_0xa05e('0x2e')]=qs['sort'](_0x54a1fd[_0xa05e('0x26')][_0xa05e('0x2f')]);_0x3a96e1[_0xa05e('0x30')]=qs[_0xa05e('0x27')](_[_0xa05e('0x31')](_0x54a1fd[_0xa05e('0x26')],_0x621260[_0xa05e('0x27')]),_0x264a60);if(_0x54a1fd[_0xa05e('0x26')][_0xa05e('0x32')]){_0x3a96e1[_0xa05e('0x30')]=_['merge'](_0x3a96e1['where'],{'$or':_[_0xa05e('0x21')](_0x264a60,function(_0x38585c){if(_0x38585c[_0xa05e('0x24')]!==_0xa05e('0x33')){var _0x461ec8={};_0x461ec8[_0x38585c[_0xa05e('0x1e')]]={'$like':'%'+_0x54a1fd[_0xa05e('0x26')][_0xa05e('0x32')]+'%'};return _0x461ec8;}})});}_0x3a96e1=_[_0xa05e('0x34')]({},_0x3a96e1,_0x54a1fd[_0xa05e('0x35')]);var _0x3df8c9={'where':_0x3a96e1[_0xa05e('0x30')]};return db['Network'][_0xa05e('0x17')](_0x3df8c9)[_0xa05e('0x9')](function(_0x1892d2){_0x133aca[_0xa05e('0x17')]=_0x1892d2;if(_0x54a1fd[_0xa05e('0x26')]['includeAll']){_0x3a96e1[_0xa05e('0x36')]=[{'all':!![]}];}return db[_0xa05e('0x37')][_0xa05e('0x38')](_0x3a96e1);})[_0xa05e('0x9')](function(_0x436946){_0x133aca[_0xa05e('0x39')]=_0x436946;return _0x133aca;})[_0xa05e('0x9')](respondWithFilteredResult(_0x5226cc,_0x3a96e1))[_0xa05e('0x11')](handleError(_0x5226cc,null));};exports[_0xa05e('0x3a')]=function(_0x2fa193,_0x10c7e0){var _0x3f383e={'raw':!![],'where':{'id':_0x2fa193[_0xa05e('0x3b')]['id']}},_0x5b3cee={};_0x5b3cee[_0xa05e('0x25')]=_['keys'](db['Network'][_0xa05e('0x22')]);_0x5b3cee[_0xa05e('0x26')]=_[_0xa05e('0x3c')](_0x2fa193[_0xa05e('0x26')]);_0x5b3cee[_0xa05e('0x27')]=_[_0xa05e('0x28')](_0x5b3cee['model'],_0x5b3cee[_0xa05e('0x26')]);_0x3f383e[_0xa05e('0x29')]=_[_0xa05e('0x28')](_0x5b3cee[_0xa05e('0x25')],qs['fields'](_0x2fa193['query'][_0xa05e('0x2a')]));_0x3f383e[_0xa05e('0x29')]=_0x3f383e[_0xa05e('0x29')][_0xa05e('0x2b')]?_0x3f383e['attributes']:_0x5b3cee[_0xa05e('0x25')];if(_0x2fa193[_0xa05e('0x26')][_0xa05e('0x3d')]){_0x3f383e[_0xa05e('0x36')]=[{'all':!![]}];}_0x3f383e=_[_0xa05e('0x34')]({},_0x3f383e,_0x2fa193[_0xa05e('0x35')]);return db['Network']['find'](_0x3f383e)[_0xa05e('0x9')](handleEntityNotFound(_0x10c7e0,null))[_0xa05e('0x9')](respondWithResult(_0x10c7e0,null))[_0xa05e('0x11')](handleError(_0x10c7e0,null));};exports[_0xa05e('0x3e')]=function(_0x188ce7,_0x438c0f){var _0x178c2b;return db[_0xa05e('0x37')][_0xa05e('0x3e')](_0x188ce7[_0xa05e('0x3f')],{'raw':!![]})[_0xa05e('0x9')](function(_0x24d726){_0x178c2b=_0x24d726;return db[_0xa05e('0x37')][_0xa05e('0x38')]({'where':{'type':_0x188ce7[_0xa05e('0x3f')][_0xa05e('0x24')]},'raw':!![]});})['then'](function(_0x5cd1ce){if(_0x178c2b[_0xa05e('0x24')][_0xa05e('0x40')]()==_0xa05e('0x41')){var _0x4f2991=fs['readFileSync'](path[_0xa05e('0x42')](config[_0xa05e('0x43')],_0xa05e('0x44')),_0xa05e('0x45'));var _0x5290e8=ejs['render'](_0x4f2991,{'networks':_0x5cd1ce||[]});fs[_0xa05e('0x46')](_0xa05e('0x47'),_0x5290e8);return respondWithRpcPromise(_0xa05e('0x48'),_0xa05e('0x3e'),{'module':_0xa05e('0x49')});}else if(_0x178c2b[_0xa05e('0x24')][_0xa05e('0x40')]()==_0xa05e('0x4a')){var _0x212c2b=fs['readFileSync'](path[_0xa05e('0x42')](config['root'],_0xa05e('0x4b')),_0xa05e('0x45'));var _0x3734bf=ejs[_0xa05e('0x4c')](_0x212c2b,{'networks':_0x5cd1ce||[]});fs[_0xa05e('0x46')]('/etc/asterisk/turn_xcally.conf',_0x3734bf);return respondWithRpcPromise(_0xa05e('0x48'),_0xa05e('0x3e'),{'module':'res_stun_monitor.so'});}else{var _0x19640e=fs[_0xa05e('0x4d')](path[_0xa05e('0x42')](config[_0xa05e('0x43')],'server/files/templates/network.ejs'),_0xa05e('0x45'));var _0x1a83c2=ejs[_0xa05e('0x4c')](_0x19640e,{'networks':_0x5cd1ce||[]});fs[_0xa05e('0x46')](util[_0xa05e('0x4e')](_0xa05e('0x4f'),_0x188ce7[_0xa05e('0x3f')][_0xa05e('0x24')][_0xa05e('0x50')]()),_0x1a83c2);return respondWithRpcPromise(_0xa05e('0x48'),_0xa05e('0x3e'),{'module':_0xa05e('0x51')});}})[_0xa05e('0x9')](function(){return _0x178c2b;})['then'](respondWithResult(_0x438c0f,0xc9))[_0xa05e('0x11')](handleError(_0x438c0f,null));};exports[_0xa05e('0x19')]=function(_0x5cfc40,_0x5588d3){var _0x1361f6;return db[_0xa05e('0x37')][_0xa05e('0x52')]({'where':{'id':_0x5cfc40['params']['id']}})[_0xa05e('0x9')](handleEntityNotFound(_0x5588d3,null))[_0xa05e('0x9')](saveUpdates(_0x5cfc40[_0xa05e('0x3f')],null))['then'](function(_0x4f7e36){if(_0x4f7e36){_0x1361f6=_0x4f7e36;return db['Network']['findAll']({'where':{'type':_0x1361f6['type']},'raw':!![]});}return null;})[_0xa05e('0x9')](function(_0x3b8c2e){if(_0x1361f6[_0xa05e('0x24')][_0xa05e('0x40')]()=='STUN'){var _0x41c72d=fs[_0xa05e('0x4d')](path[_0xa05e('0x42')](config[_0xa05e('0x43')],_0xa05e('0x44')),_0xa05e('0x45'));var _0x1fd12c=ejs[_0xa05e('0x4c')](_0x41c72d,{'networks':_0x3b8c2e||[]});fs[_0xa05e('0x46')](_0xa05e('0x47'),_0x1fd12c);return respondWithRpcPromise(_0xa05e('0x48'),'update',{'module':_0xa05e('0x49')});}else if(_0x1361f6[_0xa05e('0x24')][_0xa05e('0x40')]()==_0xa05e('0x4a')){var _0x3e9d0e=fs[_0xa05e('0x4d')](path[_0xa05e('0x42')](config['root'],_0xa05e('0x4b')),_0xa05e('0x45'));var _0x1f8b24=ejs['render'](_0x3e9d0e,{'networks':_0x3b8c2e||[]});fs[_0xa05e('0x46')](_0xa05e('0x53'),_0x1f8b24);return respondWithRpcPromise(_0xa05e('0x48'),_0xa05e('0x19'),{'module':_0xa05e('0x49')});}else{var _0x42c58c=fs['readFileSync'](path[_0xa05e('0x42')](config[_0xa05e('0x43')],_0xa05e('0x54')),_0xa05e('0x45'));var _0x22b716=ejs[_0xa05e('0x4c')](_0x42c58c,{'networks':_0x3b8c2e||[]});fs['writeFileSync'](util[_0xa05e('0x4e')](_0xa05e('0x4f'),_0x5cfc40[_0xa05e('0x3f')]['type'][_0xa05e('0x50')]()),_0x22b716);return respondWithRpcPromise(_0xa05e('0x48'),_0xa05e('0x19'),{'module':_0xa05e('0x51')});}})[_0xa05e('0x9')](function(_0x3ef8fd){if(_0x3ef8fd){return _0x1361f6;}return null;})['then'](respondWithResult(_0x5588d3,null))[_0xa05e('0x11')](handleError(_0x5588d3,null));};exports[_0xa05e('0x1a')]=function(_0x406c64,_0x141a73){var _0x279047;return db['Network']['find']({'where':{'id':_0x406c64[_0xa05e('0x3b')]['id']}})[_0xa05e('0x9')](function(_0x36d125){_0x279047=_0x36d125;return _0x36d125;})[_0xa05e('0x9')](handleEntityNotFound(_0x141a73,null))[_0xa05e('0x9')](removeEntity(_0x141a73,null))[_0xa05e('0x9')](function(){if(_0x279047){return db['Network']['findAll']({'where':{'type':_0x279047['type']},'raw':!![]});}})['then'](function(_0x614512){if(_0x279047[_0xa05e('0x24')]['toUpperCase']()==_0xa05e('0x41')){var _0x5557e7=fs['readFileSync'](path['join'](config[_0xa05e('0x43')],_0xa05e('0x44')),'utf8');var _0x370304=ejs['render'](_0x5557e7,{'networks':_0x614512||[]});fs[_0xa05e('0x46')](_0xa05e('0x47'),_0x370304);return respondWithRpcPromise(_0xa05e('0x48'),_0xa05e('0x1a'),{'module':_0xa05e('0x49')});}else if(_0x279047[_0xa05e('0x24')][_0xa05e('0x40')]()=='TURN'){var _0xdc4069=fs[_0xa05e('0x4d')](path[_0xa05e('0x42')](config[_0xa05e('0x43')],_0xa05e('0x4b')),_0xa05e('0x45'));var _0x2ea8c0=ejs[_0xa05e('0x4c')](_0xdc4069,{'networks':_0x614512||[]});fs[_0xa05e('0x46')](_0xa05e('0x53'),_0x2ea8c0);return respondWithRpcPromise(_0xa05e('0x48'),_0xa05e('0x1a'),{'module':_0xa05e('0x49')});}else{var _0x3cf021=fs['readFileSync'](path[_0xa05e('0x42')](config['root'],'server/files/templates/network.ejs'),_0xa05e('0x45'));var _0xff6eb6=ejs[_0xa05e('0x4c')](_0x3cf021,{'networks':_0x614512||[]});fs[_0xa05e('0x46')](util['format'](_0xa05e('0x4f'),_0x279047['type'][_0xa05e('0x50')]()),_0xff6eb6);return respondWithRpcPromise(_0xa05e('0x48'),'destroy',{'module':_0xa05e('0x51')});}})[_0xa05e('0x11')](handleError(_0x141a73,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index d328534..93c1511 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 _0xa0bc=['request-promise','path','rimraf','../../config/environment','./network.attributes','exports','define','Network','network','util','../../config/logger','moment','bluebird'];(function(_0x3eb598,_0x2dac95){var _0x35ad6f=function(_0xe0cecb){while(--_0xe0cecb){_0x3eb598['push'](_0x3eb598['shift']());}};_0x35ad6f(++_0x2dac95);}(_0xa0bc,0x1b6));var _0xca0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0bc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xca0b('0x0'));var logger=require(_0xca0b('0x1'))('api');var moment=require(_0xca0b('0x2'));var BPromise=require(_0xca0b('0x3'));var rp=require(_0xca0b('0x4'));var fs=require('fs');var path=require(_0xca0b('0x5'));var rimraf=require(_0xca0b('0x6'));var config=require(_0xca0b('0x7'));var attributes=require(_0xca0b('0x8'));module[_0xca0b('0x9')]=function(_0x3cb084,_0x1aac00){return _0x3cb084[_0xca0b('0xa')](_0xca0b('0xb'),attributes,{'tableName':_0xca0b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55ea=['./network.attributes','Network','network','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x1b71d7,_0x3e4d81){var _0x496332=function(_0x20705b){while(--_0x20705b){_0x1b71d7['push'](_0x1b71d7['shift']());}};_0x496332(++_0x3e4d81);}(_0x55ea,0xc9));var _0xa55e=function(_0x15c9b7,_0x110c02){_0x15c9b7=_0x15c9b7-0x0;var _0x56b110=_0x55ea[_0x15c9b7];return _0x56b110;};'use strict';var _=require(_0xa55e('0x0'));var util=require(_0xa55e('0x1'));var logger=require(_0xa55e('0x2'))('api');var moment=require(_0xa55e('0x3'));var BPromise=require(_0xa55e('0x4'));var rp=require(_0xa55e('0x5'));var fs=require('fs');var path=require(_0xa55e('0x6'));var rimraf=require(_0xa55e('0x7'));var config=require('../../config/environment');var attributes=require(_0xa55e('0x8'));module['exports']=function(_0x515646,_0x588751){return _0x515646['define'](_0xa55e('0x9'),attributes,{'tableName':_0xa55e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 0f98dbd..b5095d4 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3cb12d,_0x3f2a8c){var _0x3688a0=function(_0x46cdc2){while(--_0x46cdc2){_0x3cb12d['push'](_0x3cb12d['shift']());}};_0x3688a0(++_0x3f2a8c);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x163cf1,_0xd7123d){var _0x5bbec9=function(_0x1c2f32){while(--_0x1c2f32){_0x163cf1['push'](_0x163cf1['shift']());}};_0x5bbec9(++_0xd7123d);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index cfbbc2e..f1a0c67 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 _0x0311=['isAuthenticated','index','/:id','show','get','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','addDisposition','/:id/notify','notify','/:id/send','send','put','destroy','removeAnswers','delete','removeAgents','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelAccount.controller'];(function(_0x118d07,_0x31b24e){var _0x1d4d8a=function(_0x1e76a6){while(--_0x1e76a6){_0x118d07['push'](_0x118d07['shift']());}};_0x1d4d8a(++_0x31b24e);}(_0x0311,0xca));var _0x1031=function(_0x5e9fd8,_0x3d8051){_0x5e9fd8=_0x5e9fd8-0x0;var _0x31f9b6=_0x0311[_0x5e9fd8];return _0x31f9b6;};'use strict';var multer=require(_0x1031('0x0'));var util=require(_0x1031('0x1'));var path=require('path');var timeout=require(_0x1031('0x2'));var express=require('express');var router=express[_0x1031('0x3')]();var fs_extra=require(_0x1031('0x4'));var auth=require(_0x1031('0x5'));var interaction=require(_0x1031('0x6'));var config=require('../../config/environment');var controller=require(_0x1031('0x7'));router['get']('/',auth[_0x1031('0x8')](),controller[_0x1031('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x1031('0xa'),auth[_0x1031('0x8')](),controller[_0x1031('0xb')]);router[_0x1031('0xc')](_0x1031('0xd'),auth['isAuthenticated'](),controller[_0x1031('0xe')]);router[_0x1031('0xc')](_0x1031('0xf'),auth[_0x1031('0x8')](),controller['getAnswers']);router[_0x1031('0xc')](_0x1031('0x10'),auth['isAuthenticated'](),controller[_0x1031('0x11')]);router['get'](_0x1031('0x12'),auth[_0x1031('0x8')](),controller[_0x1031('0x13')]);router['get'](_0x1031('0x14'),auth['isAuthenticated'](),controller[_0x1031('0x15')]);router[_0x1031('0x16')]('/',auth[_0x1031('0x8')](),controller[_0x1031('0x17')]);router[_0x1031('0x16')]('/:id/dispositions',auth[_0x1031('0x8')](),controller[_0x1031('0x18')]);router[_0x1031('0x16')]('/:id/canned_answers',auth['isAuthenticated'](),controller['addAnswer']);router[_0x1031('0x16')](_0x1031('0x19'),controller[_0x1031('0x1a')]);router['post'](_0x1031('0x10'),auth[_0x1031('0x8')](),controller['addApplications']);router[_0x1031('0x16')]('/:id/users',auth[_0x1031('0x8')](),controller['addAgents']);router['post'](_0x1031('0x1b'),auth['isAuthenticated'](),controller[_0x1031('0x1c')]);router[_0x1031('0x1d')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x1031('0xa'),auth[_0x1031('0x8')](),controller[_0x1031('0x1e')]);router['delete']('/:id/dispositions',auth[_0x1031('0x8')](),controller['removeDispositions']);router['delete'](_0x1031('0xf'),auth[_0x1031('0x8')](),controller[_0x1031('0x1f')]);router[_0x1031('0x20')]('/:id/users',auth['isAuthenticated'](),controller[_0x1031('0x21')]);module[_0x1031('0x22')]=router; \ No newline at end of file +var _0xe07a=['send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','./openchannelAccount.controller','get','isAuthenticated','/describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','create','post','/:id/dispositions','addAnswer','/:id/notify','notify','addApplications','/:id/send'];(function(_0x5c5c52,_0x36d085){var _0x4229ff=function(_0x3806df){while(--_0x3806df){_0x5c5c52['push'](_0x5c5c52['shift']());}};_0x4229ff(++_0x36d085);}(_0xe07a,0xa1));var _0xae07=function(_0x45a8f7,_0x64b781){_0x45a8f7=_0x45a8f7-0x0;var _0x7e6254=_0xe07a[_0x45a8f7];return _0x7e6254;};'use strict';var multer=require(_0xae07('0x0'));var util=require(_0xae07('0x1'));var path=require('path');var timeout=require(_0xae07('0x2'));var express=require(_0xae07('0x3'));var router=express[_0xae07('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xae07('0x5'));var config=require('../../config/environment');var controller=require(_0xae07('0x6'));router[_0xae07('0x7')]('/',auth[_0xae07('0x8')](),controller['index']);router[_0xae07('0x7')](_0xae07('0x9'),auth[_0xae07('0x8')](),controller['describe']);router[_0xae07('0x7')](_0xae07('0xa'),auth['isAuthenticated'](),controller[_0xae07('0xb')]);router['get']('/:id/dispositions',auth[_0xae07('0x8')](),controller[_0xae07('0xc')]);router[_0xae07('0x7')](_0xae07('0xd'),auth[_0xae07('0x8')](),controller[_0xae07('0xe')]);router[_0xae07('0x7')](_0xae07('0xf'),auth['isAuthenticated'](),controller[_0xae07('0x10')]);router[_0xae07('0x7')](_0xae07('0x11'),auth[_0xae07('0x8')](),controller[_0xae07('0x12')]);router['get'](_0xae07('0x13'),auth[_0xae07('0x8')](),controller[_0xae07('0x14')]);router['post']('/',auth['isAuthenticated'](),controller[_0xae07('0x15')]);router[_0xae07('0x16')](_0xae07('0x17'),auth[_0xae07('0x8')](),controller['addDisposition']);router[_0xae07('0x16')](_0xae07('0xd'),auth[_0xae07('0x8')](),controller[_0xae07('0x18')]);router['post'](_0xae07('0x19'),controller[_0xae07('0x1a')]);router[_0xae07('0x16')]('/:id/applications',auth['isAuthenticated'](),controller[_0xae07('0x1b')]);router[_0xae07('0x16')](_0xae07('0x13'),auth[_0xae07('0x8')](),controller['addAgents']);router[_0xae07('0x16')](_0xae07('0x1c'),auth[_0xae07('0x8')](),controller[_0xae07('0x1d')]);router[_0xae07('0x1e')](_0xae07('0xa'),auth[_0xae07('0x8')](),controller[_0xae07('0x1f')]);router[_0xae07('0x20')](_0xae07('0xa'),auth[_0xae07('0x8')](),controller[_0xae07('0x21')]);router['delete'](_0xae07('0x17'),auth[_0xae07('0x8')](),controller[_0xae07('0x22')]);router[_0xae07('0x20')](_0xae07('0xd'),auth['isAuthenticated'](),controller[_0xae07('0x23')]);router[_0xae07('0x20')](_0xae07('0x13'),auth[_0xae07('0x8')](),controller[_0xae07('0x24')]);module[_0xae07('0x25')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 9fcaf61..707acee 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 _0xf035=['generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING'];(function(_0x1f4343,_0x70d930){var _0x3a000a=function(_0x5a7cde){while(--_0x5a7cde){_0x1f4343['push'](_0x1f4343['shift']());}};_0x3a000a(++_0x70d930);}(_0xf035,0x68));var _0x5f03=function(_0x282840,_0x121fd6){_0x282840=_0x282840-0x0;var _0x19a45d=_0xf035[_0x282840];return _0x19a45d;};'use strict';var Sequelize=require(_0x5f03('0x0'));var rs=require(_0x5f03('0x1'));module[_0x5f03('0x2')]={'name':{'type':Sequelize[_0x5f03('0x3')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x5f03('0x3')]},'token':{'type':Sequelize[_0x5f03('0x3')],'defaultValue':function(){return rs[_0x5f03('0x4')]();}},'replyUri':{'type':Sequelize[_0x5f03('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x5f03('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x5f03('0x5');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x5f03('0x3')]},'queueTransfer':{'type':Sequelize[_0x5f03('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5f03('0x7')],'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[_0x5f03('0x7')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x5f03('0x8'),'set':function(_0x338f2f){if(!_0x338f2f)this[_0x5f03('0x9')](_0x5f03('0xa'),null);this[_0x5f03('0x9')](_0x5f03('0xb'),_0x338f2f);}}}; \ No newline at end of file +var _0x1ff4=['name','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING'];(function(_0x2b7ac6,_0x63e31d){var _0x2cfcce=function(_0x508cfa){while(--_0x508cfa){_0x2b7ac6['push'](_0x2b7ac6['shift']());}};_0x2cfcce(++_0x63e31d);}(_0x1ff4,0x64));var _0x41ff=function(_0x1907ef,_0x5d2ff0){_0x1907ef=_0x1907ef-0x0;var _0x228a0a=_0x1ff4[_0x1907ef];return _0x228a0a;};'use strict';var Sequelize=require(_0x41ff('0x0'));var rs=require(_0x41ff('0x1'));module[_0x41ff('0x2')]={'name':{'type':Sequelize[_0x41ff('0x3')],'unique':_0x41ff('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x41ff('0x3')]},'token':{'type':Sequelize[_0x41ff('0x3')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x41ff('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x41ff('0x5')],'defaultValue':function(){return _0x41ff('0x6');}},'notificationSound':{'type':Sequelize[_0x41ff('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x41ff('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x41ff('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x41ff('0x3')]},'queueTransfer':{'type':Sequelize[_0x41ff('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x41ff('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x41ff('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x41ff('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0x41ff('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x41ff('0x7')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xcd72e){if(!_0xcd72e)this['setDataValue'](_0x41ff('0xa'),null);this[_0x41ff('0xb')](_0x41ff('0xc'),_0xcd72e);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 59f91be..76cc05f 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 _0x23d3=['push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','EventManager','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','finally','getApplications','getInteractions','Contact','Owner','internal','Tag','Tags','color','tag','omit','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','dataValues','Messages','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','end','offset','limit','undefined','count','set','json','apply','reject','update','get','OpenchannelAccounts','UserProfileResource','destroy','sendStatus','name','send','index','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','length','attributes','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','find','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Pause','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','hasOwnProperty','pick','removeDispositions','ids','CannedAnswer','getAnswers','findOne','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','isNil','from\x20is\x20mandatory','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','updatedAt','DESC','OpenchannelApplication','Applications','applications','list','orderBy','priority','account','ListId','contact','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','firstName','messageId','interaction','created','autoclose'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0x23d3,0xe8));var _0x323d=function(_0x37f342,_0x41ac50){_0x37f342=_0x37f342-0x0;var _0x1b0291=_0x23d3[_0x37f342];return _0x1b0291;};'use strict';var emlformat=require(_0x323d('0x0'));var rimraf=require(_0x323d('0x1'));var zipdir=require(_0x323d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x323d('0x3'));var moment=require(_0x323d('0x4'));var BPromise=require(_0x323d('0x5'));var Mustache=require(_0x323d('0x6'));var util=require(_0x323d('0x7'));var path=require(_0x323d('0x8'));var sox=require('sox');var csv=require(_0x323d('0x9'));var ejs=require(_0x323d('0xa'));var fs=require('fs');var fs_extra=require(_0x323d('0xb'));var _=require(_0x323d('0xc'));var squel=require('squel');var crypto=require(_0x323d('0xd'));var jsforce=require(_0x323d('0xe'));var deskjs=require(_0x323d('0xf'));var toCsv=require('to-csv');var querystring=require(_0x323d('0x10'));var Papa=require(_0x323d('0x11'));var Redis=require('ioredis');var authService=require(_0x323d('0x12'));var qs=require(_0x323d('0x13'));var as=require(_0x323d('0x14'));var hardwareService=require(_0x323d('0x15'));var logger=require('../../config/logger')(_0x323d('0x16'));var utils=require(_0x323d('0x17'));var config=require(_0x323d('0x18'));var licenseUtil=require(_0x323d('0x19'));var db=require(_0x323d('0x1a'))['db'];config[_0x323d('0x1b')]=_[_0x323d('0x1c')](config['redis'],{'host':_0x323d('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x323d('0x1b')]));require(_0x323d('0x1e'))[_0x323d('0x1f')](socket);var jayson=require(_0x323d('0x20'));var client=jayson[_0x323d('0x21')][_0x323d('0x22')]({'port':0x232c});var client9002=jayson[_0x323d('0x21')][_0x323d('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x6f6ad1,_0x2ba5c0,_0x2c222e,_0x468d72){return new BPromise(function(_0x464756,_0x35f483){var _0x4db048=_0x468d72||client;return _0x4db048[_0x323d('0x23')](_0x6f6ad1,_0x2c222e)[_0x323d('0x24')](function(_0x2388e0){logger[_0x323d('0x25')](_0x323d('0x26'),_0x2ba5c0,_0x323d('0x27'));logger[_0x323d('0x28')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x2ba5c0,_0x323d('0x27'),JSON[_0x323d('0x29')](_0x2388e0));if(_0x2388e0[_0x323d('0x2a')]){if(_0x2388e0[_0x323d('0x2a')][_0x323d('0x2b')]===0x1f4){logger[_0x323d('0x2a')](_0x323d('0x26'),_0x2ba5c0,_0x2388e0[_0x323d('0x2a')]['message']);return _0x35f483(_0x2388e0[_0x323d('0x2a')][_0x323d('0x2c')]);}logger[_0x323d('0x2a')](_0x323d('0x26'),_0x2ba5c0,_0x2388e0[_0x323d('0x2a')]['message']);return _0x464756(_0x2388e0['error'][_0x323d('0x2c')]);}else{logger[_0x323d('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0x2ba5c0,_0x323d('0x27'));_0x464756(_0x2388e0[_0x323d('0x2d')][_0x323d('0x2c')]);}})[_0x323d('0x2e')](function(_0x8f3191){logger[_0x323d('0x2a')](_0x323d('0x26'),_0x2ba5c0,_0x8f3191);_0x35f483(_0x8f3191);});});}function respondWithStatusCode(_0x4d7fdf,_0x1cf1e){_0x1cf1e=_0x1cf1e||0xcc;return function(_0xf6cd44){if(_0xf6cd44){return _0x4d7fdf['sendStatus'](_0x1cf1e);}return _0x4d7fdf[_0x323d('0x2f')](_0x1cf1e)[_0x323d('0x30')]();};}function respondWithResult(_0xf737ae,_0x17543d){_0x17543d=_0x17543d||0xc8;return function(_0x1456da){if(_0x1456da){return _0xf737ae[_0x323d('0x2f')](_0x17543d)['json'](_0x1456da);}};}function respondWithFilteredResult(_0x146a80,_0xe96ea9){return function(_0x355f51){if(_0x355f51){var _0x473adf=typeof _0xe96ea9[_0x323d('0x31')]==='undefined'&&typeof _0xe96ea9[_0x323d('0x32')]===_0x323d('0x33');var _0x1f2a59=_0x355f51['count'];var _0x4737cc=_0x473adf?0x0:_0xe96ea9[_0x323d('0x31')];var _0x578291=_0x473adf?_0x355f51[_0x323d('0x34')]:_0xe96ea9[_0x323d('0x31')]+_0xe96ea9[_0x323d('0x32')];var _0x458290;if(_0x578291>=_0x1f2a59){_0x578291=_0x1f2a59;_0x458290=0xc8;}else{_0x458290=0xce;}_0x146a80[_0x323d('0x2f')](_0x458290);return _0x146a80[_0x323d('0x35')]('Content-Range',_0x4737cc+'-'+_0x578291+'/'+_0x1f2a59)[_0x323d('0x36')](_0x355f51);}return null;};}function patchUpdates(_0x3e4b66){return function(_0x2b9e16){try{jsonpatch[_0x323d('0x37')](_0x2b9e16,_0x3e4b66,!![]);}catch(_0x1d0e87){return BPromise[_0x323d('0x38')](_0x1d0e87);}return _0x2b9e16['save']();};}function saveUpdates(_0x22dd5f,_0x59a3f5){return function(_0x55d014){if(_0x55d014){return _0x55d014[_0x323d('0x39')](_0x22dd5f)[_0x323d('0x24')](function(_0x2ec250){return _0x2ec250;});}return null;};}function removeEntity(_0x127e00,_0x18076f){return function(_0x5ce9d7){if(_0x5ce9d7){return _0x5ce9d7['destroy']()['then'](function(){var _0x545e93=_0x5ce9d7[_0x323d('0x3a')]({'plain':!![]});var _0xdcb4ac=_0x323d('0x3b');return db[_0x323d('0x3c')][_0x323d('0x3d')]({'where':{'type':_0xdcb4ac,'resourceId':_0x545e93['id']}})[_0x323d('0x24')](function(){return _0x5ce9d7;});})[_0x323d('0x24')](function(){_0x127e00[_0x323d('0x2f')](0xcc)[_0x323d('0x30')]();});}};}function handleEntityNotFound(_0x46199a,_0x5740fb){return function(_0x2f9fab){if(!_0x2f9fab){_0x46199a[_0x323d('0x3e')](0x194);}return _0x2f9fab;};}function handleError(_0x20f0dc,_0x25cab1){_0x25cab1=_0x25cab1||0x1f4;return function(_0x3ac46f){logger[_0x323d('0x2a')](_0x3ac46f['stack']);if(_0x3ac46f['name']){delete _0x3ac46f[_0x323d('0x3f')];}_0x20f0dc[_0x323d('0x2f')](_0x25cab1)[_0x323d('0x40')](_0x3ac46f);};}exports[_0x323d('0x41')]=function(_0x56085d,_0x12318f){var _0x589b95={'include':[{'model':db['Pause'],'as':_0x323d('0x42')}]},_0x397761={},_0x583f2c={'count':0x0,'rows':[]};var _0xa71327=_['map'](db[_0x323d('0x43')][_0x323d('0x44')],function(_0x169d28){return{'name':_0x169d28['fieldName'],'type':_0x169d28[_0x323d('0x45')][_0x323d('0x46')]};});_0x397761[_0x323d('0x47')]=_[_0x323d('0x48')](_0xa71327,_0x323d('0x3f'));_0x397761[_0x323d('0x49')]=_[_0x323d('0x4a')](_0x56085d[_0x323d('0x49')]);_0x397761[_0x323d('0x4b')]=_['intersection'](_0x397761[_0x323d('0x47')],_0x397761[_0x323d('0x49')]);_0x589b95['attributes']=_[_0x323d('0x4c')](_0x397761['model'],qs[_0x323d('0x4d')](_0x56085d['query'][_0x323d('0x4d')]));_0x589b95['attributes']=_0x589b95['attributes'][_0x323d('0x4e')]?_0x589b95[_0x323d('0x4f')]:_0x397761['model'];if(!_0x56085d['query']['hasOwnProperty'](_0x323d('0x50'))){_0x589b95[_0x323d('0x32')]=qs[_0x323d('0x32')](_0x56085d[_0x323d('0x49')][_0x323d('0x32')]);_0x589b95[_0x323d('0x31')]=qs['offset'](_0x56085d[_0x323d('0x49')]['offset']);}_0x589b95[_0x323d('0x51')]=qs[_0x323d('0x52')](_0x56085d['query'][_0x323d('0x52')]);_0x589b95[_0x323d('0x53')]=qs[_0x323d('0x4b')](_['pick'](_0x56085d[_0x323d('0x49')],_0x397761[_0x323d('0x4b')]),_0xa71327);if(_0x56085d[_0x323d('0x49')][_0x323d('0x54')]){_0x589b95['where']=_[_0x323d('0x55')](_0x589b95['where'],{'$or':_[_0x323d('0x48')](_0xa71327,function(_0x3efefc){if(_0x3efefc['type']!==_0x323d('0x56')){var _0x5e01d8={};_0x5e01d8[_0x3efefc['name']]={'$like':'%'+_0x56085d[_0x323d('0x49')]['filter']+'%'};return _0x5e01d8;}})});}_0x589b95=_[_0x323d('0x55')]({},_0x589b95,_0x56085d[_0x323d('0x57')]);var _0x337da3={'where':_0x589b95[_0x323d('0x53')]};return db[_0x323d('0x43')][_0x323d('0x34')](_0x337da3)[_0x323d('0x24')](function(_0xded565){_0x583f2c['count']=_0xded565;if(_0x56085d[_0x323d('0x49')][_0x323d('0x58')]){_0x589b95[_0x323d('0x59')]=[{'all':!![]}];}return db[_0x323d('0x43')][_0x323d('0x5a')](_0x589b95);})[_0x323d('0x24')](function(_0x540686){_0x583f2c[_0x323d('0x5b')]=_0x540686;return _0x583f2c;})[_0x323d('0x24')](respondWithFilteredResult(_0x12318f,_0x589b95))['catch'](handleError(_0x12318f,null));};exports['show']=function(_0x573e19,_0x183ada){var _0x2f89c8={'raw':![],'where':{'id':_0x573e19[_0x323d('0x5c')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0xe6336={};_0xe6336[_0x323d('0x47')]=_[_0x323d('0x4a')](db[_0x323d('0x43')][_0x323d('0x44')]);_0xe6336[_0x323d('0x49')]=_[_0x323d('0x4a')](_0x573e19[_0x323d('0x49')]);_0xe6336[_0x323d('0x4b')]=_['intersection'](_0xe6336[_0x323d('0x47')],_0xe6336['query']);_0x2f89c8[_0x323d('0x4f')]=_[_0x323d('0x4c')](_0xe6336[_0x323d('0x47')],qs[_0x323d('0x4d')](_0x573e19[_0x323d('0x49')][_0x323d('0x4d')]));_0x2f89c8[_0x323d('0x4f')]=_0x2f89c8[_0x323d('0x4f')][_0x323d('0x4e')]?_0x2f89c8[_0x323d('0x4f')]:_0xe6336[_0x323d('0x47')];if(_0x573e19['query']['includeAll']){_0x2f89c8[_0x323d('0x59')]=[{'all':!![]}];}_0x2f89c8=_[_0x323d('0x55')]({},_0x2f89c8,_0x573e19[_0x323d('0x57')]);return db[_0x323d('0x43')][_0x323d('0x5d')](_0x2f89c8)['then'](handleEntityNotFound(_0x183ada,null))['then'](respondWithResult(_0x183ada,null))[_0x323d('0x2e')](handleError(_0x183ada,null));};exports[_0x323d('0x5e')]=function(_0x1e78ed,_0x552487){return db[_0x323d('0x43')][_0x323d('0x5e')](_0x1e78ed[_0x323d('0x5f')],{})[_0x323d('0x24')](function(_0x392f3f){var _0x2f12d3=_0x1e78ed[_0x323d('0x60')][_0x323d('0x3a')]({'plain':!![]});if(!_0x2f12d3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f12d3[_0x323d('0x61')]==='user'){var _0x47cc75=_0x392f3f[_0x323d('0x3a')]({'plain':!![]});var _0x5415a7=_0x323d('0x3b');return db[_0x323d('0x62')][_0x323d('0x5d')]({'where':{'name':_0x5415a7,'userProfileId':_0x2f12d3['userProfileId']},'raw':!![]})[_0x323d('0x24')](function(_0x58975e){if(_0x58975e&&_0x58975e[_0x323d('0x63')]===0x0){return db[_0x323d('0x3c')][_0x323d('0x5e')]({'name':_0x47cc75[_0x323d('0x3f')],'resourceId':_0x47cc75['id'],'type':_0x58975e[_0x323d('0x3f')],'sectionId':_0x58975e['id']},{})[_0x323d('0x24')](function(){return _0x392f3f;});}else{return _0x392f3f;}})[_0x323d('0x2e')](function(_0x593633){logger['error'](_0x323d('0x64'),_0x593633);throw _0x593633;});}return _0x392f3f;})['then'](respondWithResult(_0x552487,0xc9))[_0x323d('0x2e')](handleError(_0x552487,null));};exports[_0x323d('0x39')]=function(_0x34d60f,_0x3623a7){if(_0x34d60f[_0x323d('0x5f')]['id']){delete _0x34d60f[_0x323d('0x5f')]['id'];}return db['OpenchannelAccount'][_0x323d('0x5d')]({'where':{'id':_0x34d60f['params']['id']},'include':[{'model':db[_0x323d('0x65')],'as':_0x323d('0x42')}]})['then'](handleEntityNotFound(_0x3623a7,null))[_0x323d('0x24')](saveUpdates(_0x34d60f[_0x323d('0x5f')],null))[_0x323d('0x24')](respondWithResult(_0x3623a7,null))[_0x323d('0x2e')](handleError(_0x3623a7,null));};exports[_0x323d('0x3d')]=function(_0x59c712,_0x20cefc){return db[_0x323d('0x43')][_0x323d('0x5d')]({'where':{'id':_0x59c712['params']['id']}})['then'](handleEntityNotFound(_0x20cefc,null))[_0x323d('0x24')](removeEntity(_0x20cefc,null))[_0x323d('0x2e')](handleError(_0x20cefc,null));};exports[_0x323d('0x66')]=function(_0x566ad9,_0x555e75){return db[_0x323d('0x43')][_0x323d('0x66')]()[_0x323d('0x24')](respondWithResult(_0x555e75,null))[_0x323d('0x2e')](handleError(_0x555e75,null));};exports[_0x323d('0x67')]=function(_0x24efc7,_0x161a76,_0x4914dd){if(_0x24efc7['body']['id']){delete _0x24efc7[_0x323d('0x5f')]['id'];}return db['OpenchannelAccount'][_0x323d('0x5d')]({'where':{'id':_0x24efc7[_0x323d('0x5c')]['id']}})[_0x323d('0x24')](handleEntityNotFound(_0x161a76,null))[_0x323d('0x24')](function(_0x468069){if(_0x468069){_0x24efc7[_0x323d('0x5f')][_0x323d('0x68')]=_0x468069['id'];return db[_0x323d('0x69')]['create'](_0x24efc7['body']);}})['then'](respondWithResult(_0x161a76,null))[_0x323d('0x2e')](handleError(_0x161a76,null));};exports[_0x323d('0x6a')]=function(_0x227f79,_0x500588,_0x495984){var _0x32c3d3={'raw':![],'where':{}};var _0x15a819={};var _0x5b42a1={'count':0x0,'rows':[]};return db[_0x323d('0x43')]['findOne']({'where':{'id':_0x227f79[_0x323d('0x5c')]['id']}})[_0x323d('0x24')](handleEntityNotFound(_0x500588,null))[_0x323d('0x24')](function(_0x237043){if(_0x237043){_0x15a819[_0x323d('0x47')]=_[_0x323d('0x4a')](db[_0x323d('0x69')][_0x323d('0x44')]);_0x15a819[_0x323d('0x49')]=_[_0x323d('0x4a')](_0x227f79[_0x323d('0x49')]);_0x15a819['filters']=_['intersection'](_0x15a819['model'],_0x15a819[_0x323d('0x49')]);_0x32c3d3['attributes']=_['intersection'](_0x15a819['model'],qs['fields'](_0x227f79['query']['fields']));_0x32c3d3[_0x323d('0x4f')]=_0x32c3d3['attributes'][_0x323d('0x4e')]?_0x32c3d3[_0x323d('0x4f')]:_0x15a819[_0x323d('0x47')];if(!_0x227f79[_0x323d('0x49')][_0x323d('0x6b')](_0x323d('0x50'))){_0x32c3d3[_0x323d('0x32')]=qs[_0x323d('0x32')](_0x227f79['query']['limit']);_0x32c3d3[_0x323d('0x31')]=qs[_0x323d('0x31')](_0x227f79['query'][_0x323d('0x31')]);}_0x32c3d3[_0x323d('0x51')]=qs[_0x323d('0x52')](_0x227f79[_0x323d('0x49')][_0x323d('0x52')]);_0x32c3d3[_0x323d('0x53')]=qs[_0x323d('0x4b')](_[_0x323d('0x6c')](_0x227f79[_0x323d('0x49')],_0x15a819['filters']));_0x32c3d3[_0x323d('0x53')][_0x323d('0x68')]=_0x237043['id'];if(_0x227f79[_0x323d('0x49')][_0x323d('0x54')]){_0x32c3d3[_0x323d('0x53')]=_['merge'](_0x32c3d3[_0x323d('0x53')],{'$or':_['map'](_0x32c3d3[_0x323d('0x4f')],function(_0x62837e){var _0x3ec205={};_0x3ec205[_0x62837e]={'$like':'%'+_0x227f79[_0x323d('0x49')][_0x323d('0x54')]+'%'};return _0x3ec205;})});}_0x32c3d3=_[_0x323d('0x55')]({},_0x32c3d3,_0x227f79[_0x323d('0x57')]);return db[_0x323d('0x69')][_0x323d('0x34')]({'where':_0x32c3d3[_0x323d('0x53')]})[_0x323d('0x24')](function(_0x2082c3){_0x5b42a1[_0x323d('0x34')]=_0x2082c3;if(_0x227f79[_0x323d('0x49')][_0x323d('0x58')]){_0x32c3d3[_0x323d('0x59')]=[{'all':!![]}];}return db[_0x323d('0x69')][_0x323d('0x5a')](_0x32c3d3);})[_0x323d('0x24')](function(_0x44f9ff){_0x5b42a1[_0x323d('0x5b')]=_0x44f9ff;return _0x5b42a1;});}})['then'](respondWithFilteredResult(_0x500588,_0x32c3d3))[_0x323d('0x2e')](handleError(_0x500588,null));};exports[_0x323d('0x6d')]=function(_0x24efa7,_0x5a6eaa,_0x26bd92){return db[_0x323d('0x43')][_0x323d('0x5d')]({'where':{'id':_0x24efa7[_0x323d('0x5c')]['id']}})[_0x323d('0x24')](handleEntityNotFound(_0x5a6eaa,null))['then'](function(_0x51222e){if(_0x51222e){return _0x51222e[_0x323d('0x6d')](_0x24efa7[_0x323d('0x49')][_0x323d('0x6e')]);}})[_0x323d('0x24')](respondWithStatusCode(_0x5a6eaa,null))[_0x323d('0x2e')](handleError(_0x5a6eaa,null));};exports['addAnswer']=function(_0x1bf766,_0x331f20,_0xecbc46){if(_0x1bf766[_0x323d('0x5f')]['id']){delete _0x1bf766[_0x323d('0x5f')]['id'];}return db[_0x323d('0x43')][_0x323d('0x5d')]({'where':{'id':_0x1bf766[_0x323d('0x5c')]['id']}})[_0x323d('0x24')](handleEntityNotFound(_0x331f20,null))[_0x323d('0x24')](function(_0x40775d){if(_0x40775d){_0x1bf766[_0x323d('0x5f')][_0x323d('0x68')]=_0x40775d['id'];return db[_0x323d('0x6f')]['create'](_0x1bf766['body']);}})[_0x323d('0x24')](respondWithResult(_0x331f20,null))[_0x323d('0x2e')](handleError(_0x331f20,null));};exports[_0x323d('0x70')]=function(_0x415624,_0x2e268c,_0x36bc98){var _0x294c8c={'raw':![],'where':{}};var _0x605b5c={};var _0x585098={'count':0x0,'rows':[]};return db[_0x323d('0x43')][_0x323d('0x71')]({'where':{'id':_0x415624[_0x323d('0x5c')]['id']}})[_0x323d('0x24')](handleEntityNotFound(_0x2e268c,null))[_0x323d('0x24')](function(_0x1e428c){if(_0x1e428c){_0x605b5c[_0x323d('0x47')]=_[_0x323d('0x4a')](db[_0x323d('0x6f')][_0x323d('0x44')]);_0x605b5c[_0x323d('0x49')]=_[_0x323d('0x4a')](_0x415624[_0x323d('0x49')]);_0x605b5c[_0x323d('0x4b')]=_[_0x323d('0x4c')](_0x605b5c[_0x323d('0x47')],_0x605b5c['query']);_0x294c8c[_0x323d('0x4f')]=_[_0x323d('0x4c')](_0x605b5c[_0x323d('0x47')],qs[_0x323d('0x4d')](_0x415624[_0x323d('0x49')][_0x323d('0x4d')]));_0x294c8c[_0x323d('0x4f')]=_0x294c8c[_0x323d('0x4f')][_0x323d('0x4e')]?_0x294c8c[_0x323d('0x4f')]:_0x605b5c['model'];if(!_0x415624['query'][_0x323d('0x6b')](_0x323d('0x50'))){_0x294c8c[_0x323d('0x32')]=qs[_0x323d('0x32')](_0x415624[_0x323d('0x49')]['limit']);_0x294c8c['offset']=qs['offset'](_0x415624[_0x323d('0x49')]['offset']);}_0x294c8c[_0x323d('0x51')]=qs[_0x323d('0x52')](_0x415624['query'][_0x323d('0x52')]);_0x294c8c['where']=qs[_0x323d('0x4b')](_[_0x323d('0x6c')](_0x415624[_0x323d('0x49')],_0x605b5c[_0x323d('0x4b')]));_0x294c8c[_0x323d('0x53')][_0x323d('0x68')]=_0x1e428c['id'];if(_0x415624['query'][_0x323d('0x54')]){_0x294c8c[_0x323d('0x53')]=_[_0x323d('0x55')](_0x294c8c[_0x323d('0x53')],{'$or':_[_0x323d('0x48')](_0x294c8c[_0x323d('0x4f')],function(_0x5d9030){var _0x140d71={};_0x140d71[_0x5d9030]={'$like':'%'+_0x415624[_0x323d('0x49')][_0x323d('0x54')]+'%'};return _0x140d71;})});}_0x294c8c=_[_0x323d('0x55')]({},_0x294c8c,_0x415624[_0x323d('0x57')]);return db[_0x323d('0x6f')][_0x323d('0x34')]({'where':_0x294c8c[_0x323d('0x53')]})[_0x323d('0x24')](function(_0x4e4d28){_0x585098['count']=_0x4e4d28;if(_0x415624[_0x323d('0x49')][_0x323d('0x58')]){_0x294c8c[_0x323d('0x59')]=[{'all':!![]}];}return db[_0x323d('0x6f')]['findAll'](_0x294c8c);})[_0x323d('0x24')](function(_0x3997e5){_0x585098[_0x323d('0x5b')]=_0x3997e5;return _0x585098;});}})[_0x323d('0x24')](respondWithFilteredResult(_0x2e268c,_0x294c8c))[_0x323d('0x2e')](handleError(_0x2e268c,null));};exports[_0x323d('0x72')]=function(_0x5df6ed,_0x201e56,_0x274d3f){return db['OpenchannelAccount'][_0x323d('0x5d')]({'where':{'id':_0x5df6ed[_0x323d('0x5c')]['id']}})[_0x323d('0x24')](handleEntityNotFound(_0x201e56,null))[_0x323d('0x24')](function(_0x5a98d6){if(_0x5a98d6){return _0x5a98d6['removeAnswers'](_0x5df6ed[_0x323d('0x49')]['ids']);}})['then'](respondWithStatusCode(_0x201e56,null))[_0x323d('0x2e')](handleError(_0x201e56,null));};exports[_0x323d('0x73')]=function(_0x4a28e2,_0x5e1867,_0x6d7c32){var _0x3c944e={'body':_0x4a28e2[_0x323d('0x5f')],'channel':_0x323d('0x74')};var _0x8b35b2=[];var _0x1a4fd4=[];var _0x4d9faa={};var _0x13cb18=![];return db[_0x323d('0x75')]['describe']()[_0x323d('0x24')](function(_0x24cd86){if(!_0x24cd86){throw new db[(_0x323d('0x76'))][(_0x323d('0x77'))](_0x323d('0x78'));}_0x8b35b2=_[_0x323d('0x79')](_[_0x323d('0x4a')](_0x24cd86),[_0x323d('0x7a'),'updatedAt']);_0x1a4fd4=_['difference'](_['keys'](_0x24cd86),[_0x323d('0x7a'),'updatedAt','CompanyId','ListId']);if(_0x4a28e2[_0x323d('0x5f')]['id']){delete _0x4a28e2[_0x323d('0x5f')]['id'];}if(_[_0x323d('0x7b')](_0x4a28e2[_0x323d('0x5f')]['from'])){throw new db[(_0x323d('0x76'))][(_0x323d('0x77'))](_0x323d('0x7c'));}if(_[_0x323d('0x7b')](_0x4a28e2[_0x323d('0x5f')]['body'])||_0x4a28e2[_0x323d('0x5f')][_0x323d('0x5f')]===''){throw new db[(_0x323d('0x76'))][(_0x323d('0x77'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x4a28e2[_0x323d('0x5f')][_0x323d('0x7d')])){throw new db[(_0x323d('0x76'))][(_0x323d('0x77'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1a4fd4);}if(!_[_0x323d('0x7e')](_0x1a4fd4,_0x4a28e2[_0x323d('0x5f')][_0x323d('0x7d')])){throw new db[(_0x323d('0x76'))][(_0x323d('0x77'))](_0x323d('0x7f')+_0x1a4fd4);}_0x4d9faa[_0x4a28e2[_0x323d('0x5f')][_0x323d('0x7d')]]=_0x4a28e2[_0x323d('0x5f')][_0x323d('0x80')];})['then'](function(){return db['OpenchannelAccount'][_0x323d('0x5d')]({'where':{'id':_0x4a28e2[_0x323d('0x5c')]['id']},'include':[{'model':db[_0x323d('0x81')],'as':_0x323d('0x82'),'include':[{'model':db['CmContact'],'as':_0x323d('0x83'),'where':_0x4d9faa,'limit':0x1,'order':[[_0x323d('0x84'),_0x323d('0x85')]]}]},{'model':db[_0x323d('0x86')],'as':_0x323d('0x87')}]});})[_0x323d('0x24')](handleEntityNotFound(_0x5e1867,null))['then'](function(_0x2f8492){if(_0x2f8492&&_0x2f8492[_0x323d('0x82')]){_0x3c944e['account']=_0x2f8492;_0x3c944e[_0x323d('0x88')]=_0x2f8492[_0x323d('0x87')];_0x3c944e[_0x323d('0x89')]=_0x2f8492[_0x323d('0x82')];_0x3c944e[_0x323d('0x88')]=_[_0x323d('0x8a')](_0x3c944e[_0x323d('0x88')],[_0x323d('0x8b')],['asc']);if(_0x3c944e[_0x323d('0x8c')][_0x323d('0x87')]){delete _0x3c944e['account']['Applications'];}if(_0x3c944e[_0x323d('0x8c')][_0x323d('0x82')]&&_0x3c944e[_0x323d('0x8c')][_0x323d('0x82')][_0x323d('0x83')][_0x323d('0x4e')]){return _0x3c944e[_0x323d('0x8c')]['List']['Contacts'][0x0];}var _0x44ff8d=_[_0x323d('0x1c')](_0x4a28e2['body'],{'firstName':_0x4a28e2[_0x323d('0x5f')][_0x323d('0x80')],'ListId':_0x2f8492[_0x323d('0x8d')]});_0x44ff8d[_0x4a28e2[_0x323d('0x5f')][_0x323d('0x7d')]]=_0x4a28e2[_0x323d('0x5f')][_0x323d('0x80')];return db[_0x323d('0x75')]['create'](_0x44ff8d,{'fields':_0x8b35b2,'raw':!![]});}})['then'](handleEntityNotFound(_0x5e1867,null))['then'](function(_0x266803){_0x3c944e[_0x323d('0x8e')]=_0x266803;if(_0x266803){var _0x4640e8={'ContactId':_0x266803['id'],'OpenchannelAccountId':_0x4a28e2[_0x323d('0x5c')]['id'],'from':(_0x266803['firstName']||'')+'\x20'+(_0x266803[_0x323d('0x8f')]||'')};var _0x42484a={'OpenchannelAccountId':_0x4a28e2[_0x323d('0x5c')]['id'],'closed':![]};if(_0x4a28e2['body'][_0x323d('0x90')]){_0x42484a[_0x323d('0x90')]=_0x4a28e2[_0x323d('0x5f')][_0x323d('0x90')];return db[_0x323d('0x91')]['find']({'where':_0x42484a})[_0x323d('0x24')](function(_0x46bb9b){if(_0x46bb9b){return[_0x46bb9b,![]];}_0x4640e8[_0x323d('0x90')]=_0x4a28e2[_0x323d('0x5f')]['threadId'];_0x4640e8[_0x323d('0x92')]=_0x4a28e2[_0x323d('0x5f')]['externalUrl'];return db['OpenchannelInteraction'][_0x323d('0x5e')](_0x4640e8)[_0x323d('0x24')](function(_0x4fdecf){return[_0x4fdecf,!![]];});});}else{_0x42484a[_0x323d('0x90')]=null;}_0x42484a[_0x323d('0x93')]=_0x266803['id'];return db['OpenchannelInteraction'][_0x323d('0x5d')]({'where':_0x42484a})[_0x323d('0x24')](function(_0x5cb9f9){if(_0x5cb9f9){return[_0x5cb9f9,![]];}return db[_0x323d('0x91')][_0x323d('0x5e')](_0x4640e8)[_0x323d('0x24')](function(_0x4bad4){return[_0x4bad4,!![]];});});}})[_0x323d('0x94')](function(_0x4159ad,_0x4d43eb){if(_0x4159ad){_0x13cb18=_0x4d43eb;if(!_0x4d43eb){var _0x14bf90={'from':(_0x3c944e['contact'][_0x323d('0x95')]||'')+'\x20'+(_0x3c944e['contact']['lastName']||'')};if(_0x4a28e2[_0x323d('0x5f')][_0x323d('0x90')]&&_0x4a28e2['body'][_0x323d('0x96')]&&_0x4a28e2[_0x323d('0x5f')]['threadId']!=_0x4a28e2[_0x323d('0x5f')][_0x323d('0x96')]){_0x14bf90[_0x323d('0x90')]=_0x4a28e2[_0x323d('0x5f')][_0x323d('0x96')];}return _0x4159ad[_0x323d('0x39')](_0x14bf90);}else{return _0x4159ad;}}})[_0x323d('0x24')](function(_0x3c3d40){_0x3c944e[_0x323d('0x97')]=_0x3c3d40[_0x323d('0x3a')]({'plain':!![]});_0x3c944e['interaction']['created']=_0x13cb18;if(_0x3c944e[_0x323d('0x97')][_0x323d('0x98')]){if(_0x3c944e[_0x323d('0x8c')][_0x323d('0x99')]){_0x3c944e['applications'][_0x323d('0x9a')]({'id':0x0,'priority':_0x3c944e[_0x323d('0x88')]['length']+0x1,'app':_0x323d('0x9b'),'appdata':_0x323d('0x9c'),'interval':_0x323d('0x9d')});}}return db[_0x323d('0x9e')][_0x323d('0x5e')]({'body':_0x4a28e2[_0x323d('0x5f')][_0x323d('0x5f')],'OpenchannelAccountId':_0x4a28e2[_0x323d('0x5c')]['id'],'OpenchannelInteractionId':_0x3c3d40['id'],'direction':'in','ContactId':_0x3c944e[_0x323d('0x8e')]['id'],'AttachmentId':_0x4a28e2[_0x323d('0x5f')][_0x323d('0x9f')]});})[_0x323d('0x24')](function(_0x58be82){_0x3c944e[_0x323d('0x2c')]=_0x58be82;if(_0x3c944e[_0x323d('0x97')]['UserId']){return db[_0x323d('0xa0')][_0x323d('0x5d')]({'attributes':['id',_0x323d('0x3f')],'where':{'id':_0x3c944e[_0x323d('0x97')][_0x323d('0xa1')]}})[_0x323d('0x24')](function(_0x35ec6d){if(_0x35ec6d){_0x3c944e['applications'][_0x323d('0xa2')]({'id':0x0,'priority':0x0,'app':_0x323d('0xa3'),'appdata':_0x35ec6d['name']+','+(_0x3c944e[_0x323d('0x8c')][_0x323d('0xa4')]||0xa),'interval':_0x323d('0x9d')});_0x3c944e[_0x323d('0xa5')]=![];}return respondWithRpcPromise('Start',_0x323d('0xa6'),_0x3c944e);});}return respondWithRpcPromise('Start','startRouting',_0x3c944e);})[_0x323d('0x24')](function(_0x3793ee){respondWithRpcPromise(_0x323d('0xa7'),_0x323d('0xa7'),{'event':'notify','message':_0x3793ee},client9002);return _0x3793ee;})[_0x323d('0x24')](respondWithResult(_0x5e1867,null))[_0x323d('0x2e')](handleError(_0x5e1867,null));};exports[_0x323d('0xa8')]=function(_0xdbc783,_0x88d862){var _0x47ae76=_0xdbc783[_0x323d('0x5c')]['id'];var _0x518c11=_0xdbc783['body'];var _0x9f136c=0xc8;var _0x4dc7f1=null;return db[_0x323d('0xa9')][_0x323d('0xaa')]({'isolationLevel':db['sequelize']['Transaction'][_0x323d('0xab')][_0x323d('0xac')]},function(_0x21bfaa){return db[_0x323d('0x43')]['findOne']({'where':{'id':_0x47ae76},'transaction':_0x21bfaa})[_0x323d('0x24')](function(_0x288d5f){if(_0x288d5f){return db['OpenchannelApplication'][_0x323d('0x3d')]({'where':{'OpenchannelAccountId':_0x47ae76},'transaction':_0x21bfaa})['then'](function(){var _0xd18fad=_['map'](_0x518c11,function(_0xe29d41){_0xe29d41[_0x323d('0x68')]=_0x47ae76;return _0xe29d41;});return db[_0x323d('0x86')][_0x323d('0xad')](_0xd18fad,{'transaction':_0x21bfaa});});}else{_0x9f136c=0x194;_0x4dc7f1=[];}});})[_0x323d('0x24')](function(){if(_0x9f136c!==0x194){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0x47ae76},'order':_0x323d('0x8b')})['then'](function(_0x10cce4){_0x4dc7f1=_0x10cce4;});}})[_0x323d('0x2e')](function(_0x53cacb){_0x9f136c=0x1f4;logger[_0x323d('0x2a')](_0x53cacb['stack']);if(_0x53cacb[_0x323d('0x3f')]){delete _0x53cacb['name'];}_0x4dc7f1=_0x53cacb;})[_0x323d('0xae')](function(){if(_0x4dc7f1===null){_0x88d862[_0x323d('0x3e')](_0x9f136c);}else{if(_0x9f136c===0x1f4){_0x88d862[_0x323d('0x2f')](_0x9f136c)['send'](_0x4dc7f1);}else{_0x88d862['status'](_0x9f136c)[_0x323d('0x36')](_0x4dc7f1);}}});};exports[_0x323d('0xaf')]=function(_0x45bd39,_0x1d1203,_0xcf8772){var _0x47b4d1={};var _0x461485={};var _0x1c0e14;var _0x598d51;return db[_0x323d('0x43')]['findOne']({'where':{'id':_0x45bd39[_0x323d('0x5c')]['id']}})[_0x323d('0x24')](handleEntityNotFound(_0x1d1203,null))[_0x323d('0x24')](function(_0x212c79){if(_0x212c79){_0x1c0e14=_0x212c79;_0x461485[_0x323d('0x47')]=_[_0x323d('0x4a')](db[_0x323d('0x86')][_0x323d('0x44')]);_0x461485['query']=_[_0x323d('0x4a')](_0x45bd39[_0x323d('0x49')]);_0x461485[_0x323d('0x4b')]=_['intersection'](_0x461485[_0x323d('0x47')],_0x461485['query']);_0x47b4d1[_0x323d('0x4f')]=_[_0x323d('0x4c')](_0x461485[_0x323d('0x47')],qs[_0x323d('0x4d')](_0x45bd39[_0x323d('0x49')]['fields']));_0x47b4d1['attributes']=_0x47b4d1['attributes']['length']?_0x47b4d1['attributes']:_0x461485[_0x323d('0x47')];_0x47b4d1[_0x323d('0x51')]=qs['sort'](_0x45bd39[_0x323d('0x49')][_0x323d('0x52')]);_0x47b4d1['where']=qs[_0x323d('0x4b')](_[_0x323d('0x6c')](_0x45bd39[_0x323d('0x49')],_0x461485[_0x323d('0x4b')]));if(_0x45bd39[_0x323d('0x49')]['filter']){_0x47b4d1[_0x323d('0x53')]=_[_0x323d('0x55')](_0x47b4d1['where'],{'$or':_[_0x323d('0x48')](_0x47b4d1[_0x323d('0x4f')],function(_0x20e315){var _0x589895={};_0x589895[_0x20e315]={'$like':'%'+_0x45bd39['query']['filter']+'%'};return _0x589895;})});}_0x47b4d1=_[_0x323d('0x55')]({},_0x47b4d1,_0x45bd39[_0x323d('0x57')]);return _0x1c0e14[_0x323d('0xaf')](_0x47b4d1);}})[_0x323d('0x24')](function(_0x23f5ad){if(_0x23f5ad){_0x598d51=_0x23f5ad['length'];if(!_0x45bd39[_0x323d('0x49')]['hasOwnProperty']('nolimit')){_0x47b4d1[_0x323d('0x32')]=qs['limit'](_0x45bd39['query'][_0x323d('0x32')]);_0x47b4d1[_0x323d('0x31')]=qs[_0x323d('0x31')](_0x45bd39[_0x323d('0x49')]['offset']);}return _0x1c0e14[_0x323d('0xaf')](_0x47b4d1);}})['then'](function(_0x139cb0){if(_0x139cb0){return _0x139cb0?{'count':_0x598d51,'rows':_0x139cb0}:null;}})[_0x323d('0x24')](respondWithResult(_0x1d1203,null))[_0x323d('0x2e')](handleError(_0x1d1203,null));};exports[_0x323d('0xb0')]=function(_0x44a679,_0x253e48,_0x4cf1ac){var _0x85881c={'raw':![],'where':{}};var _0x40982f={};var _0x3787d1={'count':0x0,'rows':[]};return db[_0x323d('0x43')]['findOne']({'where':{'id':_0x44a679[_0x323d('0x5c')]['id']}})[_0x323d('0x24')](handleEntityNotFound(_0x253e48,null))[_0x323d('0x24')](function(_0x8c9488){if(_0x8c9488){_0x40982f[_0x323d('0x47')]=_[_0x323d('0x4a')](db[_0x323d('0x91')][_0x323d('0x44')]);_0x40982f[_0x323d('0x49')]=_['keys'](_0x44a679['query']);_0x40982f[_0x323d('0x4b')]=_[_0x323d('0x4c')](_0x40982f[_0x323d('0x47')],_0x40982f['query']);_0x85881c[_0x323d('0x4f')]=_['intersection'](_0x40982f['model'],qs[_0x323d('0x4d')](_0x44a679[_0x323d('0x49')]['fields']));_0x85881c[_0x323d('0x4f')]=_0x85881c[_0x323d('0x4f')]['length']?_0x85881c['attributes']:_0x40982f[_0x323d('0x47')];if(!_0x44a679[_0x323d('0x49')][_0x323d('0x6b')]('nolimit')){_0x85881c[_0x323d('0x32')]=qs[_0x323d('0x32')](_0x44a679[_0x323d('0x49')][_0x323d('0x32')]);_0x85881c[_0x323d('0x31')]=qs[_0x323d('0x31')](_0x44a679['query']['offset']);}_0x85881c[_0x323d('0x51')]=qs[_0x323d('0x52')](_0x44a679[_0x323d('0x49')][_0x323d('0x52')]);_0x85881c[_0x323d('0x53')]=qs[_0x323d('0x4b')](_['pick'](_0x44a679[_0x323d('0x49')],_0x40982f[_0x323d('0x4b')]));_0x85881c[_0x323d('0x53')][_0x323d('0x68')]=_0x8c9488['id'];if(_0x44a679[_0x323d('0x49')]['filter']){_0x85881c[_0x323d('0x53')]=_[_0x323d('0x55')](_0x85881c[_0x323d('0x53')],{'$or':_['map'](_0x85881c[_0x323d('0x4f')],function(_0x740c93){var _0x1c970e={};_0x1c970e[_0x740c93]={'$like':'%'+_0x44a679[_0x323d('0x49')][_0x323d('0x54')]+'%'};return _0x1c970e;})});}_0x85881c=_[_0x323d('0x55')]({},_0x85881c,_0x44a679['options']);return db[_0x323d('0x91')][_0x323d('0x34')]({'where':_0x85881c['where']})[_0x323d('0x24')](function(_0xea1ebe){_0x3787d1[_0x323d('0x34')]=_0xea1ebe;if(_0x44a679[_0x323d('0x49')][_0x323d('0x58')]){_0x85881c['include']=[{'model':db[_0x323d('0x75')],'as':_0x323d('0xb1'),'required':![]},{'model':db[_0x323d('0xa0')],'as':_0x323d('0xb2'),'attributes':['name','fullname',_0x323d('0xb3')],'required':![]},{'model':db[_0x323d('0xb4')],'as':_0x323d('0xb5'),'attributes':['id',_0x323d('0x3f'),_0x323d('0xb6')],'where':_0x44a679[_0x323d('0x49')]['tag']?{'id':_0x44a679[_0x323d('0x49')][_0x323d('0xb7')]}:undefined,'required':_0x44a679[_0x323d('0x49')][_0x323d('0xb7')]?!![]:![]}];}return db[_0x323d('0x91')]['findAll'](_0x85881c);})[_0x323d('0x24')](function(_0x5d9db9){_0x3787d1['rows']=_0x5d9db9;return _0x3787d1;});}})[_0x323d('0x24')](respondWithFilteredResult(_0x253e48,_0x85881c))[_0x323d('0x2e')](handleError(_0x253e48,null));};exports['addAgents']=function(_0x210551,_0x5a7f9d,_0x12b4db){return db[_0x323d('0x43')][_0x323d('0x5d')]({'where':{'id':_0x210551[_0x323d('0x5c')]['id']}})[_0x323d('0x24')](handleEntityNotFound(_0x5a7f9d,null))[_0x323d('0x24')](function(_0x240fd1){if(_0x240fd1){return _0x240fd1['addAgents'](_0x210551[_0x323d('0x5f')][_0x323d('0x6e')],_[_0x323d('0xb8')](_0x210551[_0x323d('0x5f')],['ids','id'])||{})[_0x323d('0x94')](function(_0x177508){for(var _0x15f4f5=0x0;_0x15f4f5<_0x210551[_0x323d('0x5f')][_0x323d('0x6e')][_0x323d('0x4e')];_0x15f4f5+=0x1){socket[_0x323d('0xb9')](_0x323d('0xba'),{'UserId':Number(_0x210551['body'][_0x323d('0x6e')][_0x15f4f5]),'OpenchannelAccountId':Number(_0x210551['params']['id'])});}return _0x177508;});}})[_0x323d('0x24')](respondWithResult(_0x5a7f9d,null))[_0x323d('0x2e')](handleError(_0x5a7f9d,null));};exports[_0x323d('0xbb')]=function(_0x22d9d1,_0x556719,_0x53d981){return db[_0x323d('0x43')][_0x323d('0x5d')]({'where':{'id':_0x22d9d1[_0x323d('0x5c')]['id']}})[_0x323d('0x24')](handleEntityNotFound(_0x556719,null))[_0x323d('0x24')](function(_0x40f10b){if(_0x40f10b){return _0x40f10b[_0x323d('0xbb')](_0x22d9d1[_0x323d('0x49')][_0x323d('0x6e')])[_0x323d('0x24')](function(){if(_['isArray'](_0x22d9d1[_0x323d('0x49')]['ids'])){for(var _0x3f21e3=0x0;_0x3f21e3<_0x22d9d1[_0x323d('0x49')][_0x323d('0x6e')][_0x323d('0x4e')];_0x3f21e3+=0x1){socket[_0x323d('0xb9')](_0x323d('0xbc'),{'UserId':Number(_0x22d9d1[_0x323d('0x49')][_0x323d('0x6e')][_0x3f21e3]),'OpenchannelAccountId':Number(_0x22d9d1[_0x323d('0x5c')]['id'])});}}else{socket['emit'](_0x323d('0xbc'),{'UserId':Number(_0x22d9d1[_0x323d('0x49')][_0x323d('0x6e')]),'OpenchannelAccountId':Number(_0x22d9d1[_0x323d('0x5c')]['id'])});}});}})['then'](respondWithStatusCode(_0x556719,null))[_0x323d('0x2e')](handleError(_0x556719,null));};exports[_0x323d('0xbd')]=function(_0x3f65f0,_0x520f7f,_0x59a6c2){var _0x3e390b={};var _0x2b0626={};var _0x4a8fde;var _0x48d537;return db[_0x323d('0x43')]['findOne']({'where':{'id':_0x3f65f0[_0x323d('0x5c')]['id']}})[_0x323d('0x24')](handleEntityNotFound(_0x520f7f,null))['then'](function(_0x22d2d2){if(_0x22d2d2){_0x4a8fde=_0x22d2d2;_0x2b0626[_0x323d('0x47')]=_[_0x323d('0x4a')](db[_0x323d('0xa0')][_0x323d('0x44')]);_0x2b0626[_0x323d('0x49')]=_['keys'](_0x3f65f0['query']);_0x2b0626[_0x323d('0x4b')]=_['intersection'](_0x2b0626[_0x323d('0x47')],_0x2b0626['query']);_0x3e390b['attributes']=_['intersection'](_0x2b0626['model'],qs[_0x323d('0x4d')](_0x3f65f0[_0x323d('0x49')][_0x323d('0x4d')]));_0x3e390b[_0x323d('0x4f')]=_0x3e390b[_0x323d('0x4f')][_0x323d('0x4e')]?_0x3e390b[_0x323d('0x4f')]:_0x2b0626['model'];_0x3e390b['order']=qs[_0x323d('0x52')](_0x3f65f0[_0x323d('0x49')]['sort']);_0x3e390b[_0x323d('0x53')]=qs[_0x323d('0x4b')](_[_0x323d('0x6c')](_0x3f65f0[_0x323d('0x49')],_0x2b0626[_0x323d('0x4b')]));if(_0x3f65f0[_0x323d('0x49')][_0x323d('0x54')]){_0x3e390b[_0x323d('0x53')]=_[_0x323d('0x55')](_0x3e390b[_0x323d('0x53')],{'$or':_[_0x323d('0x48')](_0x3e390b[_0x323d('0x4f')],function(_0x52ad2b){var _0x430af6={};_0x430af6[_0x52ad2b]={'$like':'%'+_0x3f65f0[_0x323d('0x49')][_0x323d('0x54')]+'%'};return _0x430af6;})});}_0x3e390b=_['merge']({},_0x3e390b,_0x3f65f0[_0x323d('0x57')]);return _0x4a8fde[_0x323d('0xbd')](_0x3e390b);}})['then'](function(_0xda2424){if(_0xda2424){_0x48d537=_0xda2424[_0x323d('0x4e')];if(!_0x3f65f0[_0x323d('0x49')][_0x323d('0x6b')](_0x323d('0x50'))){_0x3e390b[_0x323d('0x32')]=qs['limit'](_0x3f65f0[_0x323d('0x49')][_0x323d('0x32')]);_0x3e390b[_0x323d('0x31')]=qs['offset'](_0x3f65f0['query'][_0x323d('0x31')]);}return _0x4a8fde[_0x323d('0xbd')](_0x3e390b);}})[_0x323d('0x24')](function(_0x1fa923){if(_0x1fa923){return _0x1fa923?{'count':_0x48d537,'rows':_0x1fa923}:null;}})[_0x323d('0x24')](respondWithResult(_0x520f7f,null))['catch'](handleError(_0x520f7f,null));};exports[_0x323d('0x40')]=function(_0x3fc818,_0x501ddc,_0xe71b61){var _0x4afe4e,_0x247623,_0x15b81d;if(_[_0x323d('0x7b')](_0x3fc818['body'][_0x323d('0x5f')])||_0x3fc818[_0x323d('0x5f')][_0x323d('0x5f')]===''){throw new db['Sequelize']['ValidationError'](_0x323d('0xbe'));}if(_[_0x323d('0x7b')](_0x3fc818[_0x323d('0x5f')]['to'])){}_0x4afe4e=_0x3fc818['body']['to'];return db[_0x323d('0x43')][_0x323d('0x71')]({'where':{'id':_0x3fc818[_0x323d('0x5c')]['id']}})['then'](handleEntityNotFound(_0x501ddc,null))[_0x323d('0x24')](function(_0x11bbf8){if(_0x11bbf8){return db[_0x323d('0x43')][_0x323d('0x5d')]({'where':{'id':_0x11bbf8['id']},'include':[{'model':db[_0x323d('0x81')],'as':'List','include':[{'model':db[_0x323d('0x75')],'as':_0x323d('0x83'),'where':{[_0x11bbf8[_0x323d('0x7d')]]:_0x4afe4e},'limit':0x1,'order':[[_0x323d('0x84'),_0x323d('0x85')]]}]}]})[_0x323d('0x24')](handleEntityNotFound(_0x501ddc,null))[_0x323d('0x24')](function(_0x3e0a29){if(_0x3e0a29&&_0x3e0a29[_0x323d('0x82')]){_0x247623=_0x3e0a29[_0x323d('0x3a')]({'plain':!![]});if(_0x247623[_0x323d('0x82')]&&_0x247623[_0x323d('0x82')][_0x323d('0x83')][_0x323d('0x4e')]){return _0x247623[_0x323d('0x82')][_0x323d('0x83')][0x0];}return db['CmContact'][_0x323d('0x5e')](_[_0x323d('0x1c')](_0x3fc818[_0x323d('0x5f')],{'firstName':_0x4afe4e,[_0x3e0a29[_0x323d('0x7d')]]:_0x4afe4e,'phone':_0x4afe4e,'ListId':_0x247623[_0x323d('0x8d')]}));}})[_0x323d('0x24')](handleEntityNotFound(_0x501ddc,null))[_0x323d('0x24')](function(_0x2facad){if(_0x2facad){_0x15b81d=_0x2facad;return db['OpenchannelInteraction'][_0x323d('0x5d')]({'where':{'ContactId':_0x15b81d['id'],'closed':![],'OpenchannelAccountId':_0x247623['id']}})[_0x323d('0x24')](function(_0x2a495b){if(_0x2a495b){return[_0x2a495b,![]];}return db[_0x323d('0x91')][_0x323d('0x5e')]({'UserId':_0x3fc818[_0x323d('0x60')]['id'],'ContactId':_0x15b81d['id'],'OpenchannelAccountId':_0x247623['id'],'lastMsgDirection':'out','firstMsgDirection':'out','Messages':[_[_0x323d('0x55')](_0x3fc818[_0x323d('0x5f')],{'read':![],'body':_0x3fc818[_0x323d('0x5f')][_0x323d('0x5f')],'OpenchannelAccountId':_0x247623['id'],'UserId':_0x3fc818[_0x323d('0x60')]['id'],'ContactId':_0x15b81d['id']})]},{'include':[{'model':db[_0x323d('0x9e')],'as':'Messages'}]})[_0x323d('0x24')](function(_0x1526e8){return[_0x1526e8,!![]];});});}})[_0x323d('0x94')](function(_0x9955e0,_0x60ddc6){if(_0x60ddc6){return _0x9955e0;}return db[_0x323d('0x9e')][_0x323d('0x5e')](_['merge'](_0x3fc818[_0x323d('0x5f')],{'read':![],'body':_0x3fc818['body'][_0x323d('0x5f')],'OpenchannelAccountId':_0x247623['id'],'OpenchannelInteractionId':_0x9955e0['id'],'UserId':_0x3fc818['user']['id'],'ContactId':_0x15b81d['id']}))['then'](function(_0x11ac71){_0x9955e0[_0x323d('0xbf')][_0x323d('0xc0')]=[];_0x9955e0['dataValues'][_0x323d('0xc0')]['push'](_0x11ac71[_0x323d('0xbf')]);return _0x9955e0;});});}})[_0x323d('0x24')](respondWithResult(_0x501ddc,null))[_0x323d('0x2e')](handleError(_0x501ddc,null));}; \ No newline at end of file +var _0x80d9=['util','path','sox','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','client','http','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','status','end','offset','undefined','count','limit','set','Content-Range','destroy','get','OpenchannelAccounts','UserProfileResource','sendStatus','name','send','fieldName','type','key','map','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','OpenchannelAccount','includeAll','include','rows','catch','show','Pause','mandatoryDispositionPause','model','rawAttributes','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','autoAssociation','update','describe','params','OpenchannelAccountId','Disposition','getDispositions','findOne','order','pick','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','OpenchannelApplication','Applications','list','applications','orderBy','priority','account','Contacts','contact','lastName','threadId','externalUrl','OpenchannelInteraction','ContactId','firstName','messageId','interaction','created','autoclose','push','OpenchannelMessage','AttachmentId','UserId','User','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','stack','finally','hasOwnProperty','getApplications','getInteractions','Contact','Owner','fullname','internal','Tags','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','getAgents','DESC','out','dataValues','Messages','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x533fa5,_0x245a44){var _0x4134f7=function(_0x5a5718){while(--_0x5a5718){_0x533fa5['push'](_0x533fa5['shift']());}};_0x4134f7(++_0x245a44);}(_0x80d9,0x15c));var _0x980d=function(_0x1743fb,_0xf38602){_0x1743fb=_0x1743fb-0x0;var _0x15f84e=_0x80d9[_0x1743fb];return _0x15f84e;};'use strict';var emlformat=require(_0x980d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x980d('0x1'));var jsonpatch=require(_0x980d('0x2'));var rp=require(_0x980d('0x3'));var moment=require('moment');var BPromise=require(_0x980d('0x4'));var Mustache=require(_0x980d('0x5'));var util=require(_0x980d('0x6'));var path=require(_0x980d('0x7'));var sox=require(_0x980d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x980d('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x980d('0xa'));var jsforce=require(_0x980d('0xb'));var deskjs=require(_0x980d('0xc'));var toCsv=require(_0x980d('0xd'));var querystring=require(_0x980d('0xe'));var Papa=require(_0x980d('0xf'));var Redis=require(_0x980d('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x980d('0x11'));var logger=require(_0x980d('0x12'))('api');var utils=require(_0x980d('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x980d('0x14'));var db=require('../../mysqldb')['db'];config[_0x980d('0x15')]=_[_0x980d('0x16')](config[_0x980d('0x15')],{'host':_0x980d('0x17'),'port':0x18eb});var socket=require(_0x980d('0x18'))(new Redis(config[_0x980d('0x15')]));require(_0x980d('0x19'))[_0x980d('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x980d('0x1b')][_0x980d('0x1c')]({'port':0x232c});var client9002=jayson[_0x980d('0x1b')][_0x980d('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x2f229b,_0x169648,_0x5824bf,_0x27dd6a){return new BPromise(function(_0x393ae2,_0x539ce8){var _0x1633cf=_0x27dd6a||client;return _0x1633cf['request'](_0x2f229b,_0x5824bf)[_0x980d('0x1d')](function(_0x1bc7e4){logger[_0x980d('0x1e')](_0x980d('0x1f'),_0x169648,_0x980d('0x20'));logger[_0x980d('0x21')](_0x980d('0x22'),_0x169648,_0x980d('0x20'),JSON[_0x980d('0x23')](_0x1bc7e4));if(_0x1bc7e4[_0x980d('0x24')]){if(_0x1bc7e4[_0x980d('0x24')]['code']===0x1f4){logger['error'](_0x980d('0x1f'),_0x169648,_0x1bc7e4['error']['message']);return _0x539ce8(_0x1bc7e4[_0x980d('0x24')][_0x980d('0x25')]);}logger[_0x980d('0x24')](_0x980d('0x1f'),_0x169648,_0x1bc7e4['error']['message']);return _0x393ae2(_0x1bc7e4[_0x980d('0x24')]['message']);}else{logger[_0x980d('0x1e')](_0x980d('0x1f'),_0x169648,'request\x20sent');_0x393ae2(_0x1bc7e4[_0x980d('0x26')]['message']);}})['catch'](function(_0x4ecf91){logger[_0x980d('0x24')](_0x980d('0x1f'),_0x169648,_0x4ecf91);_0x539ce8(_0x4ecf91);});});}function respondWithStatusCode(_0x117053,_0x28adb3){_0x28adb3=_0x28adb3||0xcc;return function(_0x5342dd){if(_0x5342dd){return _0x117053['sendStatus'](_0x28adb3);}return _0x117053[_0x980d('0x27')](_0x28adb3)[_0x980d('0x28')]();};}function respondWithResult(_0x97ca70,_0x1da8ea){_0x1da8ea=_0x1da8ea||0xc8;return function(_0x3d5f19){if(_0x3d5f19){return _0x97ca70['status'](_0x1da8ea)['json'](_0x3d5f19);}};}function respondWithFilteredResult(_0x2830e5,_0x1fb508){return function(_0x7828f1){if(_0x7828f1){var _0xf00845=typeof _0x1fb508[_0x980d('0x29')]===_0x980d('0x2a')&&typeof _0x1fb508['limit']===_0x980d('0x2a');var _0x471f52=_0x7828f1[_0x980d('0x2b')];var _0xd397e3=_0xf00845?0x0:_0x1fb508[_0x980d('0x29')];var _0x38470b=_0xf00845?_0x7828f1[_0x980d('0x2b')]:_0x1fb508[_0x980d('0x29')]+_0x1fb508[_0x980d('0x2c')];var _0x59a847;if(_0x38470b>=_0x471f52){_0x38470b=_0x471f52;_0x59a847=0xc8;}else{_0x59a847=0xce;}_0x2830e5[_0x980d('0x27')](_0x59a847);return _0x2830e5[_0x980d('0x2d')](_0x980d('0x2e'),_0xd397e3+'-'+_0x38470b+'/'+_0x471f52)['json'](_0x7828f1);}return null;};}function patchUpdates(_0x5d0771){return function(_0x3cf71a){try{jsonpatch['apply'](_0x3cf71a,_0x5d0771,!![]);}catch(_0x3e398){return BPromise['reject'](_0x3e398);}return _0x3cf71a['save']();};}function saveUpdates(_0x5a3160,_0x4b2011){return function(_0x4838e0){if(_0x4838e0){return _0x4838e0['update'](_0x5a3160)['then'](function(_0x1581ee){return _0x1581ee;});}return null;};}function removeEntity(_0x3569b8,_0x12530d){return function(_0x58dcc4){if(_0x58dcc4){return _0x58dcc4[_0x980d('0x2f')]()[_0x980d('0x1d')](function(){var _0x6b6a40=_0x58dcc4[_0x980d('0x30')]({'plain':!![]});var _0x120bf1=_0x980d('0x31');return db[_0x980d('0x32')]['destroy']({'where':{'type':_0x120bf1,'resourceId':_0x6b6a40['id']}})[_0x980d('0x1d')](function(){return _0x58dcc4;});})[_0x980d('0x1d')](function(){_0x3569b8['status'](0xcc)[_0x980d('0x28')]();});}};}function handleEntityNotFound(_0x588e89,_0x293f7d){return function(_0x10862f){if(!_0x10862f){_0x588e89[_0x980d('0x33')](0x194);}return _0x10862f;};}function handleError(_0x53b5f2,_0x5d8c31){_0x5d8c31=_0x5d8c31||0x1f4;return function(_0x5d5903){logger[_0x980d('0x24')](_0x5d5903['stack']);if(_0x5d5903['name']){delete _0x5d5903[_0x980d('0x34')];}_0x53b5f2[_0x980d('0x27')](_0x5d8c31)[_0x980d('0x35')](_0x5d5903);};}exports['index']=function(_0x41174b,_0x28d8d2){var _0x32f2f9={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x314e27={},_0x40d3f6={'count':0x0,'rows':[]};var _0x18f844=_['map'](db['OpenchannelAccount']['rawAttributes'],function(_0x487c56){return{'name':_0x487c56[_0x980d('0x36')],'type':_0x487c56[_0x980d('0x37')][_0x980d('0x38')]};});_0x314e27['model']=_[_0x980d('0x39')](_0x18f844,_0x980d('0x34'));_0x314e27[_0x980d('0x3a')]=_[_0x980d('0x3b')](_0x41174b[_0x980d('0x3a')]);_0x314e27[_0x980d('0x3c')]=_[_0x980d('0x3d')](_0x314e27['model'],_0x314e27[_0x980d('0x3a')]);_0x32f2f9[_0x980d('0x3e')]=_[_0x980d('0x3d')](_0x314e27['model'],qs[_0x980d('0x3f')](_0x41174b[_0x980d('0x3a')][_0x980d('0x3f')]));_0x32f2f9[_0x980d('0x3e')]=_0x32f2f9[_0x980d('0x3e')][_0x980d('0x40')]?_0x32f2f9[_0x980d('0x3e')]:_0x314e27['model'];if(!_0x41174b[_0x980d('0x3a')]['hasOwnProperty'](_0x980d('0x41'))){_0x32f2f9[_0x980d('0x2c')]=qs[_0x980d('0x2c')](_0x41174b[_0x980d('0x3a')][_0x980d('0x2c')]);_0x32f2f9[_0x980d('0x29')]=qs[_0x980d('0x29')](_0x41174b[_0x980d('0x3a')]['offset']);}_0x32f2f9['order']=qs[_0x980d('0x42')](_0x41174b[_0x980d('0x3a')][_0x980d('0x42')]);_0x32f2f9[_0x980d('0x43')]=qs[_0x980d('0x3c')](_['pick'](_0x41174b[_0x980d('0x3a')],_0x314e27[_0x980d('0x3c')]),_0x18f844);if(_0x41174b['query'][_0x980d('0x44')]){_0x32f2f9[_0x980d('0x43')]=_[_0x980d('0x45')](_0x32f2f9[_0x980d('0x43')],{'$or':_[_0x980d('0x39')](_0x18f844,function(_0x19433d){if(_0x19433d[_0x980d('0x37')]!==_0x980d('0x46')){var _0x7515ac={};_0x7515ac[_0x19433d['name']]={'$like':'%'+_0x41174b[_0x980d('0x3a')][_0x980d('0x44')]+'%'};return _0x7515ac;}})});}_0x32f2f9=_[_0x980d('0x45')]({},_0x32f2f9,_0x41174b[_0x980d('0x47')]);var _0x2e18c6={'where':_0x32f2f9[_0x980d('0x43')]};return db[_0x980d('0x48')]['count'](_0x2e18c6)[_0x980d('0x1d')](function(_0x50de9a){_0x40d3f6[_0x980d('0x2b')]=_0x50de9a;if(_0x41174b[_0x980d('0x3a')][_0x980d('0x49')]){_0x32f2f9[_0x980d('0x4a')]=[{'all':!![]}];}return db[_0x980d('0x48')]['findAll'](_0x32f2f9);})[_0x980d('0x1d')](function(_0x448b3c){_0x40d3f6[_0x980d('0x4b')]=_0x448b3c;return _0x40d3f6;})[_0x980d('0x1d')](respondWithFilteredResult(_0x28d8d2,_0x32f2f9))[_0x980d('0x4c')](handleError(_0x28d8d2,null));};exports[_0x980d('0x4d')]=function(_0x411b3a,_0x5e5267){var _0x55b721={'raw':![],'where':{'id':_0x411b3a['params']['id']},'include':[{'model':db[_0x980d('0x4e')],'as':_0x980d('0x4f')}]},_0x508663={};_0x508663[_0x980d('0x50')]=_[_0x980d('0x3b')](db[_0x980d('0x48')][_0x980d('0x51')]);_0x508663['query']=_[_0x980d('0x3b')](_0x411b3a['query']);_0x508663[_0x980d('0x3c')]=_[_0x980d('0x3d')](_0x508663[_0x980d('0x50')],_0x508663[_0x980d('0x3a')]);_0x55b721['attributes']=_['intersection'](_0x508663[_0x980d('0x50')],qs[_0x980d('0x3f')](_0x411b3a[_0x980d('0x3a')]['fields']));_0x55b721['attributes']=_0x55b721[_0x980d('0x3e')]['length']?_0x55b721[_0x980d('0x3e')]:_0x508663[_0x980d('0x50')];if(_0x411b3a[_0x980d('0x3a')][_0x980d('0x49')]){_0x55b721[_0x980d('0x4a')]=[{'all':!![]}];}_0x55b721=_[_0x980d('0x45')]({},_0x55b721,_0x411b3a[_0x980d('0x47')]);return db[_0x980d('0x48')]['find'](_0x55b721)['then'](handleEntityNotFound(_0x5e5267,null))[_0x980d('0x1d')](respondWithResult(_0x5e5267,null))['catch'](handleError(_0x5e5267,null));};exports[_0x980d('0x52')]=function(_0x21cf36,_0x5db398){return db[_0x980d('0x48')][_0x980d('0x52')](_0x21cf36[_0x980d('0x53')],{})[_0x980d('0x1d')](function(_0x5498aa){var _0x2ccfff=_0x21cf36['user']['get']({'plain':!![]});if(!_0x2ccfff)throw new Error(_0x980d('0x54'));if(_0x2ccfff['role']===_0x980d('0x55')){var _0x563bb9=_0x5498aa[_0x980d('0x30')]({'plain':!![]});var _0x8ebb87='OpenchannelAccounts';return db[_0x980d('0x56')][_0x980d('0x57')]({'where':{'name':_0x8ebb87,'userProfileId':_0x2ccfff[_0x980d('0x58')]},'raw':!![]})[_0x980d('0x1d')](function(_0x26a600){if(_0x26a600&&_0x26a600[_0x980d('0x59')]===0x0){return db[_0x980d('0x32')][_0x980d('0x52')]({'name':_0x563bb9[_0x980d('0x34')],'resourceId':_0x563bb9['id'],'type':_0x26a600[_0x980d('0x34')],'sectionId':_0x26a600['id']},{})[_0x980d('0x1d')](function(){return _0x5498aa;});}else{return _0x5498aa;}})[_0x980d('0x4c')](function(_0x4cb91f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4cb91f);throw _0x4cb91f;});}return _0x5498aa;})[_0x980d('0x1d')](respondWithResult(_0x5db398,0xc9))['catch'](handleError(_0x5db398,null));};exports[_0x980d('0x5a')]=function(_0x18ce48,_0x45a434){if(_0x18ce48[_0x980d('0x53')]['id']){delete _0x18ce48['body']['id'];}return db[_0x980d('0x48')][_0x980d('0x57')]({'where':{'id':_0x18ce48['params']['id']},'include':[{'model':db[_0x980d('0x4e')],'as':'mandatoryDispositionPause'}]})[_0x980d('0x1d')](handleEntityNotFound(_0x45a434,null))['then'](saveUpdates(_0x18ce48['body'],null))[_0x980d('0x1d')](respondWithResult(_0x45a434,null))[_0x980d('0x4c')](handleError(_0x45a434,null));};exports[_0x980d('0x2f')]=function(_0x16f427,_0x4dbcca){return db[_0x980d('0x48')]['find']({'where':{'id':_0x16f427['params']['id']}})[_0x980d('0x1d')](handleEntityNotFound(_0x4dbcca,null))[_0x980d('0x1d')](removeEntity(_0x4dbcca,null))[_0x980d('0x4c')](handleError(_0x4dbcca,null));};exports[_0x980d('0x5b')]=function(_0x1d9e40,_0x287d47){return db[_0x980d('0x48')][_0x980d('0x5b')]()[_0x980d('0x1d')](respondWithResult(_0x287d47,null))[_0x980d('0x4c')](handleError(_0x287d47,null));};exports['addDisposition']=function(_0x1ee2cf,_0x4e6f36,_0x345b12){if(_0x1ee2cf[_0x980d('0x53')]['id']){delete _0x1ee2cf['body']['id'];}return db[_0x980d('0x48')][_0x980d('0x57')]({'where':{'id':_0x1ee2cf[_0x980d('0x5c')]['id']}})[_0x980d('0x1d')](handleEntityNotFound(_0x4e6f36,null))['then'](function(_0x7a900c){if(_0x7a900c){_0x1ee2cf[_0x980d('0x53')][_0x980d('0x5d')]=_0x7a900c['id'];return db[_0x980d('0x5e')][_0x980d('0x52')](_0x1ee2cf[_0x980d('0x53')]);}})[_0x980d('0x1d')](respondWithResult(_0x4e6f36,null))[_0x980d('0x4c')](handleError(_0x4e6f36,null));};exports[_0x980d('0x5f')]=function(_0x3ccee3,_0x54665f,_0x2d8ef4){var _0x31bd40={'raw':![],'where':{}};var _0x25c579={};var _0x45731c={'count':0x0,'rows':[]};return db[_0x980d('0x48')][_0x980d('0x60')]({'where':{'id':_0x3ccee3['params']['id']}})['then'](handleEntityNotFound(_0x54665f,null))[_0x980d('0x1d')](function(_0x3aa9da){if(_0x3aa9da){_0x25c579[_0x980d('0x50')]=_[_0x980d('0x3b')](db[_0x980d('0x5e')][_0x980d('0x51')]);_0x25c579['query']=_['keys'](_0x3ccee3['query']);_0x25c579[_0x980d('0x3c')]=_['intersection'](_0x25c579[_0x980d('0x50')],_0x25c579[_0x980d('0x3a')]);_0x31bd40[_0x980d('0x3e')]=_[_0x980d('0x3d')](_0x25c579['model'],qs['fields'](_0x3ccee3[_0x980d('0x3a')]['fields']));_0x31bd40[_0x980d('0x3e')]=_0x31bd40[_0x980d('0x3e')][_0x980d('0x40')]?_0x31bd40[_0x980d('0x3e')]:_0x25c579['model'];if(!_0x3ccee3[_0x980d('0x3a')]['hasOwnProperty'](_0x980d('0x41'))){_0x31bd40[_0x980d('0x2c')]=qs[_0x980d('0x2c')](_0x3ccee3[_0x980d('0x3a')]['limit']);_0x31bd40[_0x980d('0x29')]=qs[_0x980d('0x29')](_0x3ccee3[_0x980d('0x3a')][_0x980d('0x29')]);}_0x31bd40[_0x980d('0x61')]=qs[_0x980d('0x42')](_0x3ccee3['query'][_0x980d('0x42')]);_0x31bd40[_0x980d('0x43')]=qs['filters'](_[_0x980d('0x62')](_0x3ccee3[_0x980d('0x3a')],_0x25c579['filters']));_0x31bd40['where']['OpenchannelAccountId']=_0x3aa9da['id'];if(_0x3ccee3[_0x980d('0x3a')][_0x980d('0x44')]){_0x31bd40[_0x980d('0x43')]=_[_0x980d('0x45')](_0x31bd40[_0x980d('0x43')],{'$or':_[_0x980d('0x39')](_0x31bd40[_0x980d('0x3e')],function(_0x1c4791){var _0x2448e3={};_0x2448e3[_0x1c4791]={'$like':'%'+_0x3ccee3[_0x980d('0x3a')]['filter']+'%'};return _0x2448e3;})});}_0x31bd40=_[_0x980d('0x45')]({},_0x31bd40,_0x3ccee3[_0x980d('0x47')]);return db[_0x980d('0x5e')][_0x980d('0x2b')]({'where':_0x31bd40[_0x980d('0x43')]})[_0x980d('0x1d')](function(_0x4884b2){_0x45731c['count']=_0x4884b2;if(_0x3ccee3[_0x980d('0x3a')][_0x980d('0x49')]){_0x31bd40['include']=[{'all':!![]}];}return db[_0x980d('0x5e')][_0x980d('0x63')](_0x31bd40);})[_0x980d('0x1d')](function(_0x2711b0){_0x45731c[_0x980d('0x4b')]=_0x2711b0;return _0x45731c;});}})[_0x980d('0x1d')](respondWithFilteredResult(_0x54665f,_0x31bd40))['catch'](handleError(_0x54665f,null));};exports[_0x980d('0x64')]=function(_0x464f1f,_0x3e1a20,_0xb74fe3){return db['OpenchannelAccount'][_0x980d('0x57')]({'where':{'id':_0x464f1f['params']['id']}})['then'](handleEntityNotFound(_0x3e1a20,null))['then'](function(_0x3964c4){if(_0x3964c4){return _0x3964c4['removeDispositions'](_0x464f1f[_0x980d('0x3a')][_0x980d('0x65')]);}})[_0x980d('0x1d')](respondWithStatusCode(_0x3e1a20,null))[_0x980d('0x4c')](handleError(_0x3e1a20,null));};exports[_0x980d('0x66')]=function(_0x706bd8,_0x54eb5e,_0x1cce28){if(_0x706bd8[_0x980d('0x53')]['id']){delete _0x706bd8[_0x980d('0x53')]['id'];}return db[_0x980d('0x48')]['find']({'where':{'id':_0x706bd8['params']['id']}})[_0x980d('0x1d')](handleEntityNotFound(_0x54eb5e,null))[_0x980d('0x1d')](function(_0x39fa3e){if(_0x39fa3e){_0x706bd8[_0x980d('0x53')][_0x980d('0x5d')]=_0x39fa3e['id'];return db[_0x980d('0x67')][_0x980d('0x52')](_0x706bd8[_0x980d('0x53')]);}})[_0x980d('0x1d')](respondWithResult(_0x54eb5e,null))[_0x980d('0x4c')](handleError(_0x54eb5e,null));};exports[_0x980d('0x68')]=function(_0x394715,_0x1e14c5,_0x37f1dc){var _0x5d71f2={'raw':![],'where':{}};var _0x9f5467={};var _0x577723={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x980d('0x60')]({'where':{'id':_0x394715[_0x980d('0x5c')]['id']}})[_0x980d('0x1d')](handleEntityNotFound(_0x1e14c5,null))[_0x980d('0x1d')](function(_0x43ad4b){if(_0x43ad4b){_0x9f5467['model']=_[_0x980d('0x3b')](db[_0x980d('0x67')][_0x980d('0x51')]);_0x9f5467['query']=_[_0x980d('0x3b')](_0x394715[_0x980d('0x3a')]);_0x9f5467['filters']=_[_0x980d('0x3d')](_0x9f5467[_0x980d('0x50')],_0x9f5467[_0x980d('0x3a')]);_0x5d71f2[_0x980d('0x3e')]=_[_0x980d('0x3d')](_0x9f5467['model'],qs[_0x980d('0x3f')](_0x394715[_0x980d('0x3a')][_0x980d('0x3f')]));_0x5d71f2[_0x980d('0x3e')]=_0x5d71f2[_0x980d('0x3e')]['length']?_0x5d71f2[_0x980d('0x3e')]:_0x9f5467[_0x980d('0x50')];if(!_0x394715['query']['hasOwnProperty'](_0x980d('0x41'))){_0x5d71f2[_0x980d('0x2c')]=qs[_0x980d('0x2c')](_0x394715[_0x980d('0x3a')][_0x980d('0x2c')]);_0x5d71f2['offset']=qs[_0x980d('0x29')](_0x394715['query'][_0x980d('0x29')]);}_0x5d71f2[_0x980d('0x61')]=qs[_0x980d('0x42')](_0x394715[_0x980d('0x3a')]['sort']);_0x5d71f2[_0x980d('0x43')]=qs['filters'](_[_0x980d('0x62')](_0x394715[_0x980d('0x3a')],_0x9f5467[_0x980d('0x3c')]));_0x5d71f2[_0x980d('0x43')][_0x980d('0x5d')]=_0x43ad4b['id'];if(_0x394715[_0x980d('0x3a')]['filter']){_0x5d71f2['where']=_[_0x980d('0x45')](_0x5d71f2['where'],{'$or':_[_0x980d('0x39')](_0x5d71f2['attributes'],function(_0x4478eb){var _0x35bb03={};_0x35bb03[_0x4478eb]={'$like':'%'+_0x394715[_0x980d('0x3a')]['filter']+'%'};return _0x35bb03;})});}_0x5d71f2=_['merge']({},_0x5d71f2,_0x394715[_0x980d('0x47')]);return db[_0x980d('0x67')]['count']({'where':_0x5d71f2['where']})[_0x980d('0x1d')](function(_0x3f541e){_0x577723[_0x980d('0x2b')]=_0x3f541e;if(_0x394715['query'][_0x980d('0x49')]){_0x5d71f2['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x980d('0x63')](_0x5d71f2);})['then'](function(_0x59e20e){_0x577723[_0x980d('0x4b')]=_0x59e20e;return _0x577723;});}})['then'](respondWithFilteredResult(_0x1e14c5,_0x5d71f2))['catch'](handleError(_0x1e14c5,null));};exports['removeAnswers']=function(_0xba6bbc,_0x2e08c9,_0x1b32a1){return db[_0x980d('0x48')][_0x980d('0x57')]({'where':{'id':_0xba6bbc['params']['id']}})['then'](handleEntityNotFound(_0x2e08c9,null))[_0x980d('0x1d')](function(_0x14ee07){if(_0x14ee07){return _0x14ee07[_0x980d('0x69')](_0xba6bbc[_0x980d('0x3a')][_0x980d('0x65')]);}})[_0x980d('0x1d')](respondWithStatusCode(_0x2e08c9,null))['catch'](handleError(_0x2e08c9,null));};exports[_0x980d('0x6a')]=function(_0x1945f8,_0x176cd7,_0x536553){var _0x3806a3={'body':_0x1945f8[_0x980d('0x53')],'channel':'openchannel'};var _0x188f28=[];var _0x480145=[];var _0x4570df={};var _0x215c0b=![];return db[_0x980d('0x6b')][_0x980d('0x5b')]()[_0x980d('0x1d')](function(_0xb14bd9){if(!_0xb14bd9){throw new db[(_0x980d('0x6c'))][(_0x980d('0x6d'))]('no\x20available\x20attributes');}_0x188f28=_['difference'](_[_0x980d('0x3b')](_0xb14bd9),['createdAt','updatedAt']);_0x480145=_[_0x980d('0x6e')](_[_0x980d('0x3b')](_0xb14bd9),[_0x980d('0x6f'),_0x980d('0x70'),_0x980d('0x71'),_0x980d('0x72')]);if(_0x1945f8[_0x980d('0x53')]['id']){delete _0x1945f8[_0x980d('0x53')]['id'];}if(_[_0x980d('0x73')](_0x1945f8[_0x980d('0x53')][_0x980d('0x74')])){throw new db[(_0x980d('0x6c'))][(_0x980d('0x6d'))](_0x980d('0x75'));}if(_[_0x980d('0x73')](_0x1945f8[_0x980d('0x53')][_0x980d('0x53')])||_0x1945f8[_0x980d('0x53')]['body']===''){throw new db[(_0x980d('0x6c'))][(_0x980d('0x6d'))](_0x980d('0x76'));}if(_['isNil'](_0x1945f8['body'][_0x980d('0x77')])){throw new db[(_0x980d('0x6c'))][(_0x980d('0x6d'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x480145);}if(!_['includes'](_0x480145,_0x1945f8['body'][_0x980d('0x77')])){throw new db['Sequelize']['ValidationError'](_0x980d('0x78')+_0x480145);}_0x4570df[_0x1945f8[_0x980d('0x53')][_0x980d('0x77')]]=_0x1945f8[_0x980d('0x53')][_0x980d('0x74')];})[_0x980d('0x1d')](function(){return db[_0x980d('0x48')][_0x980d('0x57')]({'where':{'id':_0x1945f8[_0x980d('0x5c')]['id']},'include':[{'model':db[_0x980d('0x79')],'as':_0x980d('0x7a'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x4570df,'limit':0x1,'order':[[_0x980d('0x70'),'DESC']]}]},{'model':db[_0x980d('0x7b')],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x176cd7,null))[_0x980d('0x1d')](function(_0xa0ac46){if(_0xa0ac46&&_0xa0ac46['List']){_0x3806a3['account']=_0xa0ac46;_0x3806a3['applications']=_0xa0ac46[_0x980d('0x7c')];_0x3806a3[_0x980d('0x7d')]=_0xa0ac46[_0x980d('0x7a')];_0x3806a3[_0x980d('0x7e')]=_[_0x980d('0x7f')](_0x3806a3[_0x980d('0x7e')],[_0x980d('0x80')],['asc']);if(_0x3806a3[_0x980d('0x81')][_0x980d('0x7c')]){delete _0x3806a3['account']['Applications'];}if(_0x3806a3[_0x980d('0x81')][_0x980d('0x7a')]&&_0x3806a3['account'][_0x980d('0x7a')][_0x980d('0x82')][_0x980d('0x40')]){return _0x3806a3['account']['List']['Contacts'][0x0];}var _0x3c2840=_['defaults'](_0x1945f8[_0x980d('0x53')],{'firstName':_0x1945f8['body']['from'],'ListId':_0xa0ac46[_0x980d('0x72')]});_0x3c2840[_0x1945f8[_0x980d('0x53')][_0x980d('0x77')]]=_0x1945f8[_0x980d('0x53')]['from'];return db[_0x980d('0x6b')][_0x980d('0x52')](_0x3c2840,{'fields':_0x188f28,'raw':!![]});}})[_0x980d('0x1d')](handleEntityNotFound(_0x176cd7,null))[_0x980d('0x1d')](function(_0x5d435c){_0x3806a3[_0x980d('0x83')]=_0x5d435c;if(_0x5d435c){var _0x32aaba={'ContactId':_0x5d435c['id'],'OpenchannelAccountId':_0x1945f8[_0x980d('0x5c')]['id'],'from':(_0x5d435c['firstName']||'')+'\x20'+(_0x5d435c[_0x980d('0x84')]||'')};var _0x204bfd={'OpenchannelAccountId':_0x1945f8['params']['id'],'closed':![]};if(_0x1945f8[_0x980d('0x53')][_0x980d('0x85')]){_0x204bfd[_0x980d('0x85')]=_0x1945f8['body'][_0x980d('0x85')];return db['OpenchannelInteraction'][_0x980d('0x57')]({'where':_0x204bfd})[_0x980d('0x1d')](function(_0x2e2fda){if(_0x2e2fda){return[_0x2e2fda,![]];}_0x32aaba[_0x980d('0x85')]=_0x1945f8[_0x980d('0x53')]['threadId'];_0x32aaba['externalUrl']=_0x1945f8['body'][_0x980d('0x86')];return db[_0x980d('0x87')][_0x980d('0x52')](_0x32aaba)[_0x980d('0x1d')](function(_0x5ec714){return[_0x5ec714,!![]];});});}else{_0x204bfd[_0x980d('0x85')]=null;}_0x204bfd[_0x980d('0x88')]=_0x5d435c['id'];return db[_0x980d('0x87')][_0x980d('0x57')]({'where':_0x204bfd})[_0x980d('0x1d')](function(_0x1928a4){if(_0x1928a4){return[_0x1928a4,![]];}return db[_0x980d('0x87')][_0x980d('0x52')](_0x32aaba)[_0x980d('0x1d')](function(_0x40b743){return[_0x40b743,!![]];});});}})['spread'](function(_0x399c47,_0x32279b){if(_0x399c47){_0x215c0b=_0x32279b;if(!_0x32279b){var _0x1c3670={'from':(_0x3806a3[_0x980d('0x83')][_0x980d('0x89')]||'')+'\x20'+(_0x3806a3[_0x980d('0x83')][_0x980d('0x84')]||'')};if(_0x1945f8[_0x980d('0x53')]['threadId']&&_0x1945f8['body'][_0x980d('0x8a')]&&_0x1945f8['body'][_0x980d('0x85')]!=_0x1945f8[_0x980d('0x53')][_0x980d('0x8a')]){_0x1c3670[_0x980d('0x85')]=_0x1945f8['body'][_0x980d('0x8a')];}return _0x399c47['update'](_0x1c3670);}else{return _0x399c47;}}})['then'](function(_0x15c3b7){_0x3806a3[_0x980d('0x8b')]=_0x15c3b7[_0x980d('0x30')]({'plain':!![]});_0x3806a3[_0x980d('0x8b')][_0x980d('0x8c')]=_0x215c0b;if(_0x3806a3[_0x980d('0x8b')][_0x980d('0x8c')]){if(_0x3806a3['account'][_0x980d('0x8d')]){_0x3806a3[_0x980d('0x7e')][_0x980d('0x8e')]({'id':0x0,'priority':_0x3806a3['applications'][_0x980d('0x40')]+0x1,'app':'close','appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0x980d('0x8f')][_0x980d('0x52')]({'body':_0x1945f8['body'][_0x980d('0x53')],'OpenchannelAccountId':_0x1945f8[_0x980d('0x5c')]['id'],'OpenchannelInteractionId':_0x15c3b7['id'],'direction':'in','ContactId':_0x3806a3[_0x980d('0x83')]['id'],'AttachmentId':_0x1945f8[_0x980d('0x53')][_0x980d('0x90')]});})[_0x980d('0x1d')](function(_0xa0db5e){_0x3806a3[_0x980d('0x25')]=_0xa0db5e;if(_0x3806a3[_0x980d('0x8b')][_0x980d('0x91')]){return db[_0x980d('0x92')][_0x980d('0x57')]({'attributes':['id',_0x980d('0x34')],'where':{'id':_0x3806a3[_0x980d('0x8b')][_0x980d('0x91')]}})[_0x980d('0x1d')](function(_0x5ea09b){if(_0x5ea09b){_0x3806a3[_0x980d('0x7e')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5ea09b['name']+','+(_0x3806a3[_0x980d('0x81')][_0x980d('0x93')]||0xa),'interval':'*,*,*,*'});_0x3806a3[_0x980d('0x94')]=![];}return respondWithRpcPromise(_0x980d('0x95'),_0x980d('0x96'),_0x3806a3);});}return respondWithRpcPromise(_0x980d('0x95'),_0x980d('0x96'),_0x3806a3);})[_0x980d('0x1d')](function(_0x28eb78){respondWithRpcPromise('EventManager',_0x980d('0x97'),{'event':_0x980d('0x6a'),'message':_0x28eb78},client9002);return _0x28eb78;})[_0x980d('0x1d')](respondWithResult(_0x176cd7,null))[_0x980d('0x4c')](handleError(_0x176cd7,null));};exports[_0x980d('0x98')]=function(_0x251cba,_0x32c159){var _0x2bae98=_0x251cba[_0x980d('0x5c')]['id'];var _0x47e82e=_0x251cba[_0x980d('0x53')];var _0x1cc361=0xc8;var _0x2a8aa4=null;return db[_0x980d('0x99')][_0x980d('0x9a')]({'isolationLevel':db[_0x980d('0x99')][_0x980d('0x9b')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x16fe6f){return db['OpenchannelAccount'][_0x980d('0x60')]({'where':{'id':_0x2bae98},'transaction':_0x16fe6f})[_0x980d('0x1d')](function(_0x2ad6f6){if(_0x2ad6f6){return db[_0x980d('0x7b')][_0x980d('0x2f')]({'where':{'OpenchannelAccountId':_0x2bae98},'transaction':_0x16fe6f})['then'](function(){var _0x50f4f0=_[_0x980d('0x39')](_0x47e82e,function(_0x3ef738){_0x3ef738['OpenchannelAccountId']=_0x2bae98;return _0x3ef738;});return db[_0x980d('0x7b')]['bulkCreate'](_0x50f4f0,{'transaction':_0x16fe6f});});}else{_0x1cc361=0x194;_0x2a8aa4=[];}});})[_0x980d('0x1d')](function(){if(_0x1cc361!==0x194){return db[_0x980d('0x7b')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x2bae98},'order':_0x980d('0x80')})[_0x980d('0x1d')](function(_0x29d52b){_0x2a8aa4=_0x29d52b;});}})[_0x980d('0x4c')](function(_0x3fbfc6){_0x1cc361=0x1f4;logger[_0x980d('0x24')](_0x3fbfc6[_0x980d('0x9c')]);if(_0x3fbfc6[_0x980d('0x34')]){delete _0x3fbfc6[_0x980d('0x34')];}_0x2a8aa4=_0x3fbfc6;})[_0x980d('0x9d')](function(){if(_0x2a8aa4===null){_0x32c159['sendStatus'](_0x1cc361);}else{if(_0x1cc361===0x1f4){_0x32c159[_0x980d('0x27')](_0x1cc361)[_0x980d('0x35')](_0x2a8aa4);}else{_0x32c159[_0x980d('0x27')](_0x1cc361)['json'](_0x2a8aa4);}}});};exports['getApplications']=function(_0x610c0,_0x5c2780,_0x223ec6){var _0x4689c7={};var _0x252076={};var _0x196362;var _0x58ff32;return db[_0x980d('0x48')][_0x980d('0x60')]({'where':{'id':_0x610c0[_0x980d('0x5c')]['id']}})['then'](handleEntityNotFound(_0x5c2780,null))[_0x980d('0x1d')](function(_0x37534f){if(_0x37534f){_0x196362=_0x37534f;_0x252076[_0x980d('0x50')]=_[_0x980d('0x3b')](db[_0x980d('0x7b')][_0x980d('0x51')]);_0x252076[_0x980d('0x3a')]=_[_0x980d('0x3b')](_0x610c0[_0x980d('0x3a')]);_0x252076['filters']=_[_0x980d('0x3d')](_0x252076[_0x980d('0x50')],_0x252076[_0x980d('0x3a')]);_0x4689c7[_0x980d('0x3e')]=_['intersection'](_0x252076[_0x980d('0x50')],qs[_0x980d('0x3f')](_0x610c0[_0x980d('0x3a')][_0x980d('0x3f')]));_0x4689c7[_0x980d('0x3e')]=_0x4689c7['attributes'][_0x980d('0x40')]?_0x4689c7[_0x980d('0x3e')]:_0x252076[_0x980d('0x50')];_0x4689c7[_0x980d('0x61')]=qs[_0x980d('0x42')](_0x610c0[_0x980d('0x3a')][_0x980d('0x42')]);_0x4689c7[_0x980d('0x43')]=qs[_0x980d('0x3c')](_[_0x980d('0x62')](_0x610c0[_0x980d('0x3a')],_0x252076[_0x980d('0x3c')]));if(_0x610c0[_0x980d('0x3a')][_0x980d('0x44')]){_0x4689c7['where']=_[_0x980d('0x45')](_0x4689c7[_0x980d('0x43')],{'$or':_[_0x980d('0x39')](_0x4689c7[_0x980d('0x3e')],function(_0x367476){var _0x1715e3={};_0x1715e3[_0x367476]={'$like':'%'+_0x610c0[_0x980d('0x3a')]['filter']+'%'};return _0x1715e3;})});}_0x4689c7=_[_0x980d('0x45')]({},_0x4689c7,_0x610c0[_0x980d('0x47')]);return _0x196362['getApplications'](_0x4689c7);}})[_0x980d('0x1d')](function(_0x4df434){if(_0x4df434){_0x58ff32=_0x4df434[_0x980d('0x40')];if(!_0x610c0[_0x980d('0x3a')][_0x980d('0x9e')](_0x980d('0x41'))){_0x4689c7[_0x980d('0x2c')]=qs[_0x980d('0x2c')](_0x610c0[_0x980d('0x3a')][_0x980d('0x2c')]);_0x4689c7[_0x980d('0x29')]=qs[_0x980d('0x29')](_0x610c0[_0x980d('0x3a')]['offset']);}return _0x196362[_0x980d('0x9f')](_0x4689c7);}})[_0x980d('0x1d')](function(_0x3494f5){if(_0x3494f5){return _0x3494f5?{'count':_0x58ff32,'rows':_0x3494f5}:null;}})[_0x980d('0x1d')](respondWithResult(_0x5c2780,null))[_0x980d('0x4c')](handleError(_0x5c2780,null));};exports[_0x980d('0xa0')]=function(_0x582f39,_0x4c11a9,_0x1fa235){var _0x4f4f92={'raw':![],'where':{}};var _0x3f04c2={};var _0x58f9ad={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x980d('0x60')]({'where':{'id':_0x582f39[_0x980d('0x5c')]['id']}})[_0x980d('0x1d')](handleEntityNotFound(_0x4c11a9,null))[_0x980d('0x1d')](function(_0x5b3ca7){if(_0x5b3ca7){_0x3f04c2[_0x980d('0x50')]=_['keys'](db[_0x980d('0x87')]['rawAttributes']);_0x3f04c2[_0x980d('0x3a')]=_['keys'](_0x582f39['query']);_0x3f04c2[_0x980d('0x3c')]=_[_0x980d('0x3d')](_0x3f04c2[_0x980d('0x50')],_0x3f04c2[_0x980d('0x3a')]);_0x4f4f92[_0x980d('0x3e')]=_[_0x980d('0x3d')](_0x3f04c2[_0x980d('0x50')],qs[_0x980d('0x3f')](_0x582f39['query']['fields']));_0x4f4f92[_0x980d('0x3e')]=_0x4f4f92[_0x980d('0x3e')][_0x980d('0x40')]?_0x4f4f92['attributes']:_0x3f04c2['model'];if(!_0x582f39[_0x980d('0x3a')][_0x980d('0x9e')](_0x980d('0x41'))){_0x4f4f92[_0x980d('0x2c')]=qs['limit'](_0x582f39[_0x980d('0x3a')][_0x980d('0x2c')]);_0x4f4f92[_0x980d('0x29')]=qs[_0x980d('0x29')](_0x582f39['query'][_0x980d('0x29')]);}_0x4f4f92[_0x980d('0x61')]=qs[_0x980d('0x42')](_0x582f39[_0x980d('0x3a')][_0x980d('0x42')]);_0x4f4f92['where']=qs[_0x980d('0x3c')](_['pick'](_0x582f39[_0x980d('0x3a')],_0x3f04c2[_0x980d('0x3c')]));_0x4f4f92[_0x980d('0x43')]['OpenchannelAccountId']=_0x5b3ca7['id'];if(_0x582f39[_0x980d('0x3a')][_0x980d('0x44')]){_0x4f4f92['where']=_['merge'](_0x4f4f92[_0x980d('0x43')],{'$or':_[_0x980d('0x39')](_0x4f4f92[_0x980d('0x3e')],function(_0x241a18){var _0x587a70={};_0x587a70[_0x241a18]={'$like':'%'+_0x582f39['query']['filter']+'%'};return _0x587a70;})});}_0x4f4f92=_['merge']({},_0x4f4f92,_0x582f39[_0x980d('0x47')]);return db[_0x980d('0x87')]['count']({'where':_0x4f4f92[_0x980d('0x43')]})[_0x980d('0x1d')](function(_0x6968be){_0x58f9ad['count']=_0x6968be;if(_0x582f39[_0x980d('0x3a')][_0x980d('0x49')]){_0x4f4f92['include']=[{'model':db['CmContact'],'as':_0x980d('0xa1'),'required':![]},{'model':db[_0x980d('0x92')],'as':_0x980d('0xa2'),'attributes':[_0x980d('0x34'),_0x980d('0xa3'),_0x980d('0xa4')],'required':![]},{'model':db['Tag'],'as':_0x980d('0xa5'),'attributes':['id',_0x980d('0x34'),'color'],'where':_0x582f39['query']['tag']?{'id':_0x582f39[_0x980d('0x3a')][_0x980d('0xa6')]}:undefined,'required':_0x582f39[_0x980d('0x3a')][_0x980d('0xa6')]?!![]:![]}];}return db[_0x980d('0x87')][_0x980d('0x63')](_0x4f4f92);})[_0x980d('0x1d')](function(_0x2885fa){_0x58f9ad[_0x980d('0x4b')]=_0x2885fa;return _0x58f9ad;});}})['then'](respondWithFilteredResult(_0x4c11a9,_0x4f4f92))[_0x980d('0x4c')](handleError(_0x4c11a9,null));};exports[_0x980d('0xa7')]=function(_0x3724f4,_0x4774fb,_0x202b2d){return db['OpenchannelAccount'][_0x980d('0x57')]({'where':{'id':_0x3724f4[_0x980d('0x5c')]['id']}})[_0x980d('0x1d')](handleEntityNotFound(_0x4774fb,null))[_0x980d('0x1d')](function(_0xedc927){if(_0xedc927){return _0xedc927[_0x980d('0xa7')](_0x3724f4[_0x980d('0x53')][_0x980d('0x65')],_[_0x980d('0xa8')](_0x3724f4[_0x980d('0x53')],[_0x980d('0x65'),'id'])||{})['spread'](function(_0x1ecb2b){for(var _0x52bdcb=0x0;_0x52bdcb<_0x3724f4['body']['ids'][_0x980d('0x40')];_0x52bdcb+=0x1){socket[_0x980d('0xa9')](_0x980d('0xaa'),{'UserId':Number(_0x3724f4[_0x980d('0x53')][_0x980d('0x65')][_0x52bdcb]),'OpenchannelAccountId':Number(_0x3724f4['params']['id'])});}return _0x1ecb2b;});}})['then'](respondWithResult(_0x4774fb,null))[_0x980d('0x4c')](handleError(_0x4774fb,null));};exports[_0x980d('0xab')]=function(_0x164c5d,_0x1f82b8,_0x2f69b7){return db[_0x980d('0x48')]['find']({'where':{'id':_0x164c5d[_0x980d('0x5c')]['id']}})[_0x980d('0x1d')](handleEntityNotFound(_0x1f82b8,null))['then'](function(_0x2748c4){if(_0x2748c4){return _0x2748c4[_0x980d('0xab')](_0x164c5d[_0x980d('0x3a')][_0x980d('0x65')])['then'](function(){if(_['isArray'](_0x164c5d['query'][_0x980d('0x65')])){for(var _0x3bfe34=0x0;_0x3bfe34<_0x164c5d['query'][_0x980d('0x65')][_0x980d('0x40')];_0x3bfe34+=0x1){socket[_0x980d('0xa9')]('userOpenchannelAccount:remove',{'UserId':Number(_0x164c5d['query'][_0x980d('0x65')][_0x3bfe34]),'OpenchannelAccountId':Number(_0x164c5d[_0x980d('0x5c')]['id'])});}}else{socket[_0x980d('0xa9')]('userOpenchannelAccount:remove',{'UserId':Number(_0x164c5d[_0x980d('0x3a')][_0x980d('0x65')]),'OpenchannelAccountId':Number(_0x164c5d[_0x980d('0x5c')]['id'])});}});}})['then'](respondWithStatusCode(_0x1f82b8,null))[_0x980d('0x4c')](handleError(_0x1f82b8,null));};exports[_0x980d('0xac')]=function(_0x375687,_0x37cbe2,_0x76045){var _0x125f41={};var _0x3434c8={};var _0x5683f9;var _0x1696ea;return db[_0x980d('0x48')]['findOne']({'where':{'id':_0x375687[_0x980d('0x5c')]['id']}})[_0x980d('0x1d')](handleEntityNotFound(_0x37cbe2,null))[_0x980d('0x1d')](function(_0x59b4d4){if(_0x59b4d4){_0x5683f9=_0x59b4d4;_0x3434c8['model']=_[_0x980d('0x3b')](db[_0x980d('0x92')][_0x980d('0x51')]);_0x3434c8[_0x980d('0x3a')]=_['keys'](_0x375687[_0x980d('0x3a')]);_0x3434c8[_0x980d('0x3c')]=_[_0x980d('0x3d')](_0x3434c8['model'],_0x3434c8[_0x980d('0x3a')]);_0x125f41[_0x980d('0x3e')]=_[_0x980d('0x3d')](_0x3434c8[_0x980d('0x50')],qs[_0x980d('0x3f')](_0x375687[_0x980d('0x3a')][_0x980d('0x3f')]));_0x125f41[_0x980d('0x3e')]=_0x125f41['attributes'][_0x980d('0x40')]?_0x125f41[_0x980d('0x3e')]:_0x3434c8[_0x980d('0x50')];_0x125f41[_0x980d('0x61')]=qs[_0x980d('0x42')](_0x375687[_0x980d('0x3a')]['sort']);_0x125f41[_0x980d('0x43')]=qs[_0x980d('0x3c')](_[_0x980d('0x62')](_0x375687[_0x980d('0x3a')],_0x3434c8['filters']));if(_0x375687[_0x980d('0x3a')][_0x980d('0x44')]){_0x125f41[_0x980d('0x43')]=_[_0x980d('0x45')](_0x125f41[_0x980d('0x43')],{'$or':_['map'](_0x125f41[_0x980d('0x3e')],function(_0x348075){var _0x10faf5={};_0x10faf5[_0x348075]={'$like':'%'+_0x375687[_0x980d('0x3a')][_0x980d('0x44')]+'%'};return _0x10faf5;})});}_0x125f41=_[_0x980d('0x45')]({},_0x125f41,_0x375687[_0x980d('0x47')]);return _0x5683f9[_0x980d('0xac')](_0x125f41);}})[_0x980d('0x1d')](function(_0x404173){if(_0x404173){_0x1696ea=_0x404173[_0x980d('0x40')];if(!_0x375687[_0x980d('0x3a')][_0x980d('0x9e')](_0x980d('0x41'))){_0x125f41['limit']=qs[_0x980d('0x2c')](_0x375687[_0x980d('0x3a')][_0x980d('0x2c')]);_0x125f41[_0x980d('0x29')]=qs['offset'](_0x375687[_0x980d('0x3a')][_0x980d('0x29')]);}return _0x5683f9[_0x980d('0xac')](_0x125f41);}})['then'](function(_0x3bbc3f){if(_0x3bbc3f){return _0x3bbc3f?{'count':_0x1696ea,'rows':_0x3bbc3f}:null;}})[_0x980d('0x1d')](respondWithResult(_0x37cbe2,null))[_0x980d('0x4c')](handleError(_0x37cbe2,null));};exports[_0x980d('0x35')]=function(_0x369d1a,_0x4d5e17,_0x4a05c4){var _0x203b2e,_0x1f7c47,_0x448bfd;if(_[_0x980d('0x73')](_0x369d1a[_0x980d('0x53')][_0x980d('0x53')])||_0x369d1a[_0x980d('0x53')]['body']===''){throw new db[(_0x980d('0x6c'))][(_0x980d('0x6d'))](_0x980d('0x76'));}if(_[_0x980d('0x73')](_0x369d1a[_0x980d('0x53')]['to'])){}_0x203b2e=_0x369d1a[_0x980d('0x53')]['to'];return db[_0x980d('0x48')]['findOne']({'where':{'id':_0x369d1a['params']['id']}})[_0x980d('0x1d')](handleEntityNotFound(_0x4d5e17,null))[_0x980d('0x1d')](function(_0x2c5a0a){if(_0x2c5a0a){return db[_0x980d('0x48')][_0x980d('0x57')]({'where':{'id':_0x2c5a0a['id']},'include':[{'model':db['CmList'],'as':_0x980d('0x7a'),'include':[{'model':db[_0x980d('0x6b')],'as':_0x980d('0x82'),'where':{[_0x2c5a0a[_0x980d('0x77')]]:_0x203b2e},'limit':0x1,'order':[[_0x980d('0x70'),_0x980d('0xad')]]}]}]})['then'](handleEntityNotFound(_0x4d5e17,null))['then'](function(_0x12509d){if(_0x12509d&&_0x12509d[_0x980d('0x7a')]){_0x1f7c47=_0x12509d[_0x980d('0x30')]({'plain':!![]});if(_0x1f7c47[_0x980d('0x7a')]&&_0x1f7c47['List'][_0x980d('0x82')]['length']){return _0x1f7c47['List'][_0x980d('0x82')][0x0];}return db[_0x980d('0x6b')][_0x980d('0x52')](_[_0x980d('0x16')](_0x369d1a[_0x980d('0x53')],{'firstName':_0x203b2e,[_0x12509d[_0x980d('0x77')]]:_0x203b2e,'phone':_0x203b2e,'ListId':_0x1f7c47[_0x980d('0x72')]}));}})[_0x980d('0x1d')](handleEntityNotFound(_0x4d5e17,null))[_0x980d('0x1d')](function(_0x10c65a){if(_0x10c65a){_0x448bfd=_0x10c65a;return db['OpenchannelInteraction'][_0x980d('0x57')]({'where':{'ContactId':_0x448bfd['id'],'closed':![],'OpenchannelAccountId':_0x1f7c47['id']}})[_0x980d('0x1d')](function(_0x5f54b3){if(_0x5f54b3){return[_0x5f54b3,![]];}return db[_0x980d('0x87')][_0x980d('0x52')]({'UserId':_0x369d1a[_0x980d('0x55')]['id'],'ContactId':_0x448bfd['id'],'OpenchannelAccountId':_0x1f7c47['id'],'lastMsgDirection':_0x980d('0xae'),'firstMsgDirection':_0x980d('0xae'),'Messages':[_[_0x980d('0x45')](_0x369d1a[_0x980d('0x53')],{'read':![],'body':_0x369d1a[_0x980d('0x53')]['body'],'OpenchannelAccountId':_0x1f7c47['id'],'UserId':_0x369d1a['user']['id'],'ContactId':_0x448bfd['id']})]},{'include':[{'model':db[_0x980d('0x8f')],'as':'Messages'}]})[_0x980d('0x1d')](function(_0x47ff1e){return[_0x47ff1e,!![]];});});}})['spread'](function(_0x1577b1,_0x2fe9cb){if(_0x2fe9cb){return _0x1577b1;}return db['OpenchannelMessage'][_0x980d('0x52')](_['merge'](_0x369d1a['body'],{'read':![],'body':_0x369d1a[_0x980d('0x53')][_0x980d('0x53')],'OpenchannelAccountId':_0x1f7c47['id'],'OpenchannelInteractionId':_0x1577b1['id'],'UserId':_0x369d1a[_0x980d('0x55')]['id'],'ContactId':_0x448bfd['id']}))['then'](function(_0x28e88d){_0x1577b1[_0x980d('0xaf')][_0x980d('0xb0')]=[];_0x1577b1[_0x980d('0xaf')][_0x980d('0xb0')][_0x980d('0x8e')](_0x28e88d[_0x980d('0xaf')]);return _0x1577b1;});});}})['then'](respondWithResult(_0x4d5e17,null))[_0x980d('0x4c')](handleError(_0x4d5e17,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 00b60e6..522bb6e 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 _0x4522=['OpenchannelAccount','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x5837c7,_0x2f863e){var _0x266d06=function(_0x51f1da){while(--_0x51f1da){_0x5837c7['push'](_0x5837c7['shift']());}};_0x266d06(++_0x2f863e);}(_0x4522,0x1a0));var _0x2452=function(_0x12097a,_0x4c9bb3){_0x12097a=_0x12097a-0x0;var _0x215617=_0x4522[_0x12097a];return _0x215617;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0x2452('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x2452('0x1')](0x0);var events={'afterCreate':_0x2452('0x2'),'afterUpdate':'update','afterDestroy':_0x2452('0x3')};function emitEvent(_0x1fdf5b){return function(_0x35e30a,_0x2f21dc,_0x34ff44){OpenchannelAccountEvents[_0x2452('0x4')](_0x1fdf5b+':'+_0x35e30a['id'],_0x35e30a);OpenchannelAccountEvents[_0x2452('0x4')](_0x1fdf5b,_0x35e30a);_0x34ff44(null);};}for(var e in events){if(events[_0x2452('0x5')](e)){var event=events[e];OpenchannelAccount[_0x2452('0x6')](e,emitEvent(event));}}module[_0x2452('0x7')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x9bde=['exports','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0xd40536,_0xd6f24){var _0x4ac571=function(_0x42863a){while(--_0x42863a){_0xd40536['push'](_0xd40536['shift']());}};_0x4ac571(++_0xd6f24);}(_0x9bde,0xe1));var _0xe9bd=function(_0x2ccc74,_0x14bb7a){_0x2ccc74=_0x2ccc74-0x0;var _0x2c3e64=_0x9bde[_0x2ccc74];return _0x2c3e64;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0xe9bd('0x0'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xe9bd('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe9bd('0x2'),'afterDestroy':_0xe9bd('0x3')};function emitEvent(_0x131f6a){return function(_0x1c1b34,_0x10822d,_0x1a4d14){OpenchannelAccountEvents[_0xe9bd('0x4')](_0x131f6a+':'+_0x1c1b34['id'],_0x1c1b34);OpenchannelAccountEvents['emit'](_0x131f6a,_0x1c1b34);_0x1a4d14(null);};}for(var e in events){if(events[_0xe9bd('0x5')](e)){var event=events[e];OpenchannelAccount[_0xe9bd('0x6')](e,emitEvent(event));}}module[_0xe9bd('0x7')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index fb053f1..865fba7 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(_0x4c02ee,_0x953629){var _0x1013a1=function(_0xac0a5a){while(--_0xac0a5a){_0x4c02ee['push'](_0x4c02ee['shift']());}};_0x1013a1(++_0x953629);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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(_0x4ff429,_0x4287fd){var _0xc3516a=function(_0x2f5d50){while(--_0x2f5d50){_0x4ff429['push'](_0x4ff429['shift']());}};_0xc3516a(++_0x4287fd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 58b60b0..f96f11e 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 _0xa699=['rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./openchannelAccount.socket','register','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0xa699,0x6b));var _0x9a69=function(_0x1bbc08,_0x444008){_0x1bbc08=_0x1bbc08-0x0;var _0x5d825b=_0xa699[_0x1bbc08];return _0x5d825b;};'use strict';var _=require(_0x9a69('0x0'));var util=require(_0x9a69('0x1'));var moment=require(_0x9a69('0x2'));var BPromise=require(_0x9a69('0x3'));var rs=require(_0x9a69('0x4'));var fs=require('fs');var Redis=require(_0x9a69('0x5'));var db=require(_0x9a69('0x6'))['db'];var utils=require(_0x9a69('0x7'));var logger=require(_0x9a69('0x8'))(_0x9a69('0x9'));var config=require(_0x9a69('0xa'));var jayson=require(_0x9a69('0xb'));var client=jayson[_0x9a69('0xc')]['http']({'port':0x232a});config[_0x9a69('0xd')]=_[_0x9a69('0xe')](config[_0x9a69('0xd')],{'host':_0x9a69('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9a69('0xd')]));require(_0x9a69('0x10'))[_0x9a69('0x11')](socket);function respondWithRpcPromise(_0x1ee4e3,_0x43d2f2,_0x58b59e){return new BPromise(function(_0x47cc82,_0x1562e2){return client['request'](_0x1ee4e3,_0x58b59e)[_0x9a69('0x12')](function(_0x5016b2){logger['info'](_0x9a69('0x13'),_0x43d2f2,_0x9a69('0x14'));logger['debug'](_0x9a69('0x15'),_0x43d2f2,_0x9a69('0x14'),JSON[_0x9a69('0x16')](_0x5016b2));if(_0x5016b2[_0x9a69('0x17')]){if(_0x5016b2[_0x9a69('0x17')][_0x9a69('0x18')]===0x1f4){logger[_0x9a69('0x17')](_0x9a69('0x13'),_0x43d2f2,_0x5016b2[_0x9a69('0x17')]['message']);return _0x1562e2(_0x5016b2[_0x9a69('0x17')][_0x9a69('0x19')]);}logger[_0x9a69('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x43d2f2,_0x5016b2[_0x9a69('0x17')][_0x9a69('0x19')]);return _0x47cc82(_0x5016b2[_0x9a69('0x17')][_0x9a69('0x19')]);}else{logger[_0x9a69('0x1a')]('OpenchannelAccount,\x20%s,\x20%s',_0x43d2f2,_0x9a69('0x14'));_0x47cc82(_0x5016b2[_0x9a69('0x1b')][_0x9a69('0x19')]);}})[_0x9a69('0x1c')](function(_0x3a09c8){logger[_0x9a69('0x17')](_0x9a69('0x13'),_0x43d2f2,_0x3a09c8);_0x1562e2(_0x3a09c8);});});} \ No newline at end of file +var _0x8caf=['OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','then','info','OpenchannelAccount,\x20%s,\x20%s','debug'];(function(_0x476705,_0x34fe4c){var _0x520734=function(_0x178f06){while(--_0x178f06){_0x476705['push'](_0x476705['shift']());}};_0x520734(++_0x34fe4c);}(_0x8caf,0x1ab));var _0xf8ca=function(_0x216b9b,_0x1bf025){_0x216b9b=_0x216b9b-0x0;var _0x51ba89=_0x8caf[_0x216b9b];return _0x51ba89;};'use strict';var _=require('lodash');var util=require(_0xf8ca('0x0'));var moment=require(_0xf8ca('0x1'));var BPromise=require(_0xf8ca('0x2'));var rs=require(_0xf8ca('0x3'));var fs=require('fs');var Redis=require(_0xf8ca('0x4'));var db=require(_0xf8ca('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf8ca('0x6'))(_0xf8ca('0x7'));var config=require(_0xf8ca('0x8'));var jayson=require(_0xf8ca('0x9'));var client=jayson[_0xf8ca('0xa')][_0xf8ca('0xb')]({'port':0x232a});config['redis']=_[_0xf8ca('0xc')](config[_0xf8ca('0xd')],{'host':_0xf8ca('0xe'),'port':0x18eb});var socket=require(_0xf8ca('0xf'))(new Redis(config['redis']));require('./openchannelAccount.socket')[_0xf8ca('0x10')](socket);function respondWithRpcPromise(_0x576e9d,_0x2f67c5,_0x2e86a6){return new BPromise(function(_0x2daa43,_0x2be477){return client['request'](_0x576e9d,_0x2e86a6)[_0xf8ca('0x11')](function(_0x6f3f7b){logger[_0xf8ca('0x12')](_0xf8ca('0x13'),_0x2f67c5,'request\x20sent');logger[_0xf8ca('0x14')](_0xf8ca('0x15'),_0x2f67c5,'request\x20sent',JSON[_0xf8ca('0x16')](_0x6f3f7b));if(_0x6f3f7b[_0xf8ca('0x17')]){if(_0x6f3f7b[_0xf8ca('0x17')][_0xf8ca('0x18')]===0x1f4){logger[_0xf8ca('0x17')](_0xf8ca('0x13'),_0x2f67c5,_0x6f3f7b[_0xf8ca('0x17')][_0xf8ca('0x19')]);return _0x2be477(_0x6f3f7b[_0xf8ca('0x17')][_0xf8ca('0x19')]);}logger['error'](_0xf8ca('0x13'),_0x2f67c5,_0x6f3f7b[_0xf8ca('0x17')][_0xf8ca('0x19')]);return _0x2daa43(_0x6f3f7b[_0xf8ca('0x17')][_0xf8ca('0x19')]);}else{logger[_0xf8ca('0x12')](_0xf8ca('0x13'),_0x2f67c5,_0xf8ca('0x1a'));_0x2daa43(_0x6f3f7b['result'][_0xf8ca('0x19')]);}})[_0xf8ca('0x1b')](function(_0x17eefa){logger[_0xf8ca('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x2f67c5,_0x17eefa);_0x2be477(_0x17eefa);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index c8ccc88..6dd2e4e 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 _0x8a55=['update','emit','removeListener','register','length','./openchannelAccount.events','save','remove'];(function(_0x55b6b1,_0x9a0112){var _0x3e07ed=function(_0x16769d){while(--_0x16769d){_0x55b6b1['push'](_0x55b6b1['shift']());}};_0x3e07ed(++_0x9a0112);}(_0x8a55,0x185));var _0x58a5=function(_0x43264b,_0x17af45){_0x43264b=_0x43264b-0x0;var _0x37992a=_0x8a55[_0x43264b];return _0x37992a;};'use strict';var OpenchannelAccountEvents=require(_0x58a5('0x0'));var events=[_0x58a5('0x1'),_0x58a5('0x2'),_0x58a5('0x3')];function createListener(_0x2befd3,_0x1cfb30){return function(_0x2ae19a){_0x1cfb30[_0x58a5('0x4')](_0x2befd3,_0x2ae19a);};}function removeListener(_0x5d7d07,_0x3d864a){return function(){OpenchannelAccountEvents[_0x58a5('0x5')](_0x5d7d07,_0x3d864a);};}exports[_0x58a5('0x6')]=function(_0x3edf85){for(var _0x417896=0x0,_0x1690bc=events[_0x58a5('0x7')];_0x417896<_0x1690bc;_0x417896++){var _0xd63fc7=events[_0x417896];var _0x36d8a4=createListener('openchannelAccount:'+_0xd63fc7,_0x3edf85);OpenchannelAccountEvents['on'](_0xd63fc7,_0x36d8a4);}}; \ No newline at end of file +var _0xc686=['removeListener','register','length','remove','emit'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xc686,0x148));var _0x6c68=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xc686[_0xc6be3a];return _0x56a310;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=['save',_0x6c68('0x0'),'update'];function createListener(_0xe45565,_0x5f1f2c){return function(_0x1f6b6d){_0x5f1f2c[_0x6c68('0x1')](_0xe45565,_0x1f6b6d);};}function removeListener(_0x1bfe91,_0x434bb0){return function(){OpenchannelAccountEvents[_0x6c68('0x2')](_0x1bfe91,_0x434bb0);};}exports[_0x6c68('0x3')]=function(_0x1c1b02){for(var _0x2d5dda=0x0,_0x3dc035=events[_0x6c68('0x4')];_0x2d5dda<_0x3dc035;_0x2d5dda++){var _0x12e935=events[_0x2d5dda];var _0x394644=createListener('openchannelAccount:'+_0x12e935,_0x1c1b02);OpenchannelAccountEvents['on'](_0x12e935,_0x394644);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 7faf857..363d098 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 _0x38ff=['../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','index','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0xa20e65,_0x1bf844){var _0x1397d6=function(_0xc26f6a){while(--_0xc26f6a){_0xa20e65['push'](_0xa20e65['shift']());}};_0x1397d6(++_0x1bf844);}(_0x38ff,0x1ee));var _0xf38f=function(_0x1876b2,_0x5d0225){_0x1876b2=_0x1876b2-0x0;var _0x9fb1e0=_0x38ff[_0x1876b2];return _0x9fb1e0;};'use strict';var multer=require(_0xf38f('0x0'));var util=require(_0xf38f('0x1'));var path=require(_0xf38f('0x2'));var timeout=require(_0xf38f('0x3'));var express=require(_0xf38f('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf38f('0x5'));var interaction=require(_0xf38f('0x6'));var config=require(_0xf38f('0x7'));var controller=require(_0xf38f('0x8'));router[_0xf38f('0x9')]('/',auth['isAuthenticated'](),controller[_0xf38f('0xa')]);router[_0xf38f('0x9')](_0xf38f('0xb'),auth[_0xf38f('0xc')](),controller[_0xf38f('0xd')]);router[_0xf38f('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf38f('0xf')](_0xf38f('0xb'),auth['isAuthenticated'](),controller[_0xf38f('0x10')]);router[_0xf38f('0x11')](_0xf38f('0xb'),auth[_0xf38f('0xc')](),controller[_0xf38f('0x12')]);module[_0xf38f('0x13')]=router; \ No newline at end of file +var _0xe190=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x358556,_0x1d8b9b){var _0x113a06=function(_0x359eb9){while(--_0x359eb9){_0x358556['push'](_0x358556['shift']());}};_0x113a06(++_0x1d8b9b);}(_0xe190,0xf7));var _0x0e19=function(_0x202e6c,_0xb884e1){_0x202e6c=_0x202e6c-0x0;var _0x342cb0=_0xe190[_0x202e6c];return _0x342cb0;};'use strict';var multer=require(_0x0e19('0x0'));var util=require(_0x0e19('0x1'));var path=require(_0x0e19('0x2'));var timeout=require(_0x0e19('0x3'));var express=require(_0x0e19('0x4'));var router=express['Router']();var fs_extra=require(_0x0e19('0x5'));var auth=require(_0x0e19('0x6'));var interaction=require(_0x0e19('0x7'));var config=require(_0x0e19('0x8'));var controller=require(_0x0e19('0x9'));router[_0x0e19('0xa')]('/',auth[_0x0e19('0xb')](),controller[_0x0e19('0xc')]);router[_0x0e19('0xa')](_0x0e19('0xd'),auth['isAuthenticated'](),controller[_0x0e19('0xe')]);router[_0x0e19('0xf')]('/',auth[_0x0e19('0xb')](),controller[_0x0e19('0x10')]);router[_0x0e19('0x11')](_0x0e19('0xd'),auth[_0x0e19('0xb')](),controller[_0x0e19('0x12')]);router[_0x0e19('0x13')](_0x0e19('0xd'),auth['isAuthenticated'](),controller[_0x0e19('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 3b6bf08..cd48672 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 _0xb214=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x26b3dd,_0x415db7){var _0x24b1c8=function(_0x1fec7a){while(--_0x1fec7a){_0x26b3dd['push'](_0x26b3dd['shift']());}};_0x24b1c8(++_0x415db7);}(_0xb214,0xb0));var _0x4b21=function(_0x12c7ff,_0x2d631c){_0x12c7ff=_0x12c7ff-0x0;var _0x5459d3=_0xb214[_0x12c7ff];return _0x5459d3;};'use strict';var Sequelize=require(_0x4b21('0x0'));module[_0x4b21('0x1')]={'priority':{'type':Sequelize[_0x4b21('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x4b21('0x3')],'allowNull':![],'defaultValue':_0x4b21('0x4')},'appdata':{'type':Sequelize[_0x4b21('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x4b21('0x3')],'defaultValue':_0x4b21('0x6')}}; \ No newline at end of file +var _0xd324=['noop','*,*,*,*','sequelize','exports','STRING'];(function(_0x469056,_0x4f46e1){var _0xba97aa=function(_0x217722){while(--_0x217722){_0x469056['push'](_0x469056['shift']());}};_0xba97aa(++_0x4f46e1);}(_0xd324,0x12e));var _0x4d32=function(_0x1bb47b,_0x54e02e){_0x1bb47b=_0x1bb47b-0x0;var _0x566418=_0xd324[_0x1bb47b];return _0x566418;};'use strict';var Sequelize=require(_0x4d32('0x0'));module[_0x4d32('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x4d32('0x2')],'allowNull':![],'defaultValue':_0x4d32('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x4d32('0x2')]},'interval':{'type':Sequelize[_0x4d32('0x2')],'defaultValue':_0x4d32('0x4')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 31d0eb2..5425ace 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 _0x81d3=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','set','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','length','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path'];(function(_0x1acb1a,_0x4105e8){var _0x502464=function(_0x18ba02){while(--_0x18ba02){_0x1acb1a['push'](_0x1acb1a['shift']());}};_0x502464(++_0x4105e8);}(_0x81d3,0x92));var _0x381d=function(_0x252e67,_0x2d2cb4){_0x252e67=_0x252e67-0x0;var _0x48dae8=_0x81d3[_0x252e67];return _0x48dae8;};'use strict';var emlformat=require(_0x381d('0x0'));var rimraf=require(_0x381d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x381d('0x2'));var rp=require(_0x381d('0x3'));var moment=require(_0x381d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x381d('0x5'));var util=require(_0x381d('0x6'));var path=require(_0x381d('0x7'));var sox=require(_0x381d('0x8'));var csv=require(_0x381d('0x9'));var ejs=require(_0x381d('0xa'));var fs=require('fs');var fs_extra=require(_0x381d('0xb'));var _=require(_0x381d('0xc'));var squel=require(_0x381d('0xd'));var crypto=require(_0x381d('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x381d('0xf'));var toCsv=require(_0x381d('0x9'));var querystring=require('querystring');var Papa=require(_0x381d('0x10'));var Redis=require('ioredis');var authService=require(_0x381d('0x11'));var qs=require(_0x381d('0x12'));var as=require(_0x381d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x381d('0x14'))('api');var utils=require(_0x381d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x381d('0x16'));var db=require(_0x381d('0x17'))['db'];function respondWithStatusCode(_0x40d80c,_0x19f34a){_0x19f34a=_0x19f34a||0xcc;return function(_0x409a2a){if(_0x409a2a){return _0x40d80c[_0x381d('0x18')](_0x19f34a);}return _0x40d80c[_0x381d('0x19')](_0x19f34a)[_0x381d('0x1a')]();};}function respondWithResult(_0x5eb6f6,_0x5cd83b){_0x5cd83b=_0x5cd83b||0xc8;return function(_0x23115d){if(_0x23115d){return _0x5eb6f6['status'](_0x5cd83b)['json'](_0x23115d);}};}function respondWithFilteredResult(_0x318414,_0x2979cc){return function(_0x1dca26){if(_0x1dca26){var _0x4a7c32=typeof _0x2979cc['offset']===_0x381d('0x1b')&&typeof _0x2979cc['limit']===_0x381d('0x1b');var _0x2ec703=_0x1dca26[_0x381d('0x1c')];var _0x41b47f=_0x4a7c32?0x0:_0x2979cc[_0x381d('0x1d')];var _0x13380a=_0x4a7c32?_0x1dca26['count']:_0x2979cc['offset']+_0x2979cc['limit'];var _0x178ed3;if(_0x13380a>=_0x2ec703){_0x13380a=_0x2ec703;_0x178ed3=0xc8;}else{_0x178ed3=0xce;}_0x318414['status'](_0x178ed3);return _0x318414[_0x381d('0x1e')]('Content-Range',_0x41b47f+'-'+_0x13380a+'/'+_0x2ec703)[_0x381d('0x1f')](_0x1dca26);}return null;};}function patchUpdates(_0x5b877e){return function(_0x1b167a){try{jsonpatch[_0x381d('0x20')](_0x1b167a,_0x5b877e,!![]);}catch(_0x3dd30d){return BPromise[_0x381d('0x21')](_0x3dd30d);}return _0x1b167a[_0x381d('0x22')]();};}function saveUpdates(_0x5e08a2,_0x571faf){return function(_0xf7442f){if(_0xf7442f){return _0xf7442f[_0x381d('0x23')](_0x5e08a2)[_0x381d('0x24')](function(_0x20e408){return _0x20e408;});}return null;};}function removeEntity(_0xbad243,_0x40b792){return function(_0x41df9b){if(_0x41df9b){return _0x41df9b[_0x381d('0x25')]()[_0x381d('0x24')](function(){_0xbad243['status'](0xcc)[_0x381d('0x1a')]();});}};}function handleEntityNotFound(_0x1467b5,_0x21df32){return function(_0x3f6694){if(!_0x3f6694){_0x1467b5[_0x381d('0x18')](0x194);}return _0x3f6694;};}function handleError(_0x1700d6,_0x2022b5){_0x2022b5=_0x2022b5||0x1f4;return function(_0x5c233a){logger[_0x381d('0x26')](_0x5c233a[_0x381d('0x27')]);if(_0x5c233a[_0x381d('0x28')]){delete _0x5c233a[_0x381d('0x28')];}_0x1700d6[_0x381d('0x19')](_0x2022b5)[_0x381d('0x29')](_0x5c233a);};}exports[_0x381d('0x2a')]=function(_0x5139c0,_0x18655d){var _0x2d6edc={},_0x569ae9={},_0x3ab249={'count':0x0,'rows':[]};var _0x5b9799=_[_0x381d('0x2b')](db[_0x381d('0x2c')][_0x381d('0x2d')],function(_0x5c4e40){return{'name':_0x5c4e40[_0x381d('0x2e')],'type':_0x5c4e40[_0x381d('0x2f')][_0x381d('0x30')]};});_0x569ae9[_0x381d('0x31')]=_[_0x381d('0x2b')](_0x5b9799,'name');_0x569ae9[_0x381d('0x32')]=_[_0x381d('0x33')](_0x5139c0[_0x381d('0x32')]);_0x569ae9[_0x381d('0x34')]=_[_0x381d('0x35')](_0x569ae9['model'],_0x569ae9[_0x381d('0x32')]);_0x2d6edc[_0x381d('0x36')]=_[_0x381d('0x35')](_0x569ae9[_0x381d('0x31')],qs['fields'](_0x5139c0[_0x381d('0x32')][_0x381d('0x37')]));_0x2d6edc['attributes']=_0x2d6edc[_0x381d('0x36')]['length']?_0x2d6edc[_0x381d('0x36')]:_0x569ae9[_0x381d('0x31')];if(!_0x5139c0['query'][_0x381d('0x38')](_0x381d('0x39'))){_0x2d6edc['limit']=qs[_0x381d('0x3a')](_0x5139c0[_0x381d('0x32')][_0x381d('0x3a')]);_0x2d6edc[_0x381d('0x1d')]=qs[_0x381d('0x1d')](_0x5139c0[_0x381d('0x32')][_0x381d('0x1d')]);}_0x2d6edc[_0x381d('0x3b')]=qs[_0x381d('0x3c')](_0x5139c0[_0x381d('0x32')][_0x381d('0x3c')]);_0x2d6edc[_0x381d('0x3d')]=qs[_0x381d('0x34')](_[_0x381d('0x3e')](_0x5139c0[_0x381d('0x32')],_0x569ae9[_0x381d('0x34')]),_0x5b9799);if(_0x5139c0[_0x381d('0x32')][_0x381d('0x3f')]){_0x2d6edc[_0x381d('0x3d')]=_['merge'](_0x2d6edc['where'],{'$or':_[_0x381d('0x2b')](_0x5b9799,function(_0x4fcd8b){if(_0x4fcd8b[_0x381d('0x2f')]!==_0x381d('0x40')){var _0x5e2573={};_0x5e2573[_0x4fcd8b['name']]={'$like':'%'+_0x5139c0['query'][_0x381d('0x3f')]+'%'};return _0x5e2573;}})});}_0x2d6edc=_[_0x381d('0x41')]({},_0x2d6edc,_0x5139c0[_0x381d('0x42')]);var _0x4d4cc7={'where':_0x2d6edc['where']};return db[_0x381d('0x2c')][_0x381d('0x1c')](_0x4d4cc7)['then'](function(_0x357226){_0x3ab249[_0x381d('0x1c')]=_0x357226;if(_0x5139c0[_0x381d('0x32')][_0x381d('0x43')]){_0x2d6edc[_0x381d('0x44')]=[{'all':!![]}];}return db[_0x381d('0x2c')]['findAll'](_0x2d6edc);})[_0x381d('0x24')](function(_0x16b2d7){_0x3ab249[_0x381d('0x45')]=_0x16b2d7;return _0x3ab249;})[_0x381d('0x24')](respondWithFilteredResult(_0x18655d,_0x2d6edc))[_0x381d('0x46')](handleError(_0x18655d,null));};exports[_0x381d('0x47')]=function(_0x23eb61,_0x263b2c){var _0x589ff0={'raw':!![],'where':{'id':_0x23eb61[_0x381d('0x48')]['id']}},_0x2a2146={};_0x2a2146[_0x381d('0x31')]=_[_0x381d('0x33')](db[_0x381d('0x2c')][_0x381d('0x2d')]);_0x2a2146[_0x381d('0x32')]=_['keys'](_0x23eb61[_0x381d('0x32')]);_0x2a2146[_0x381d('0x34')]=_[_0x381d('0x35')](_0x2a2146[_0x381d('0x31')],_0x2a2146[_0x381d('0x32')]);_0x589ff0[_0x381d('0x36')]=_[_0x381d('0x35')](_0x2a2146[_0x381d('0x31')],qs[_0x381d('0x37')](_0x23eb61[_0x381d('0x32')][_0x381d('0x37')]));_0x589ff0[_0x381d('0x36')]=_0x589ff0[_0x381d('0x36')][_0x381d('0x49')]?_0x589ff0[_0x381d('0x36')]:_0x2a2146['model'];if(_0x23eb61[_0x381d('0x32')]['includeAll']){_0x589ff0[_0x381d('0x44')]=[{'all':!![]}];}_0x589ff0=_[_0x381d('0x41')]({},_0x589ff0,_0x23eb61[_0x381d('0x42')]);return db[_0x381d('0x2c')][_0x381d('0x4a')](_0x589ff0)[_0x381d('0x24')](handleEntityNotFound(_0x263b2c,null))[_0x381d('0x24')](respondWithResult(_0x263b2c,null))[_0x381d('0x46')](handleError(_0x263b2c,null));};exports['create']=function(_0x3473eb,_0x478a01){return db[_0x381d('0x2c')][_0x381d('0x4b')](_0x3473eb[_0x381d('0x4c')],{})[_0x381d('0x24')](respondWithResult(_0x478a01,0xc9))[_0x381d('0x46')](handleError(_0x478a01,null));};exports[_0x381d('0x23')]=function(_0x46f383,_0xe4c518){if(_0x46f383['body']['id']){delete _0x46f383[_0x381d('0x4c')]['id'];}return db['OpenchannelApplication'][_0x381d('0x4a')]({'where':{'id':_0x46f383[_0x381d('0x48')]['id']}})['then'](handleEntityNotFound(_0xe4c518,null))[_0x381d('0x24')](saveUpdates(_0x46f383[_0x381d('0x4c')],null))[_0x381d('0x24')](respondWithResult(_0xe4c518,null))['catch'](handleError(_0xe4c518,null));};exports[_0x381d('0x25')]=function(_0x4f6ce1,_0x4217fa){return db[_0x381d('0x2c')][_0x381d('0x4a')]({'where':{'id':_0x4f6ce1[_0x381d('0x48')]['id']}})[_0x381d('0x24')](handleEntityNotFound(_0x4217fa,null))[_0x381d('0x24')](removeEntity(_0x4217fa,null))['catch'](handleError(_0x4217fa,null));}; \ No newline at end of file +var _0xa9cb=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','error','name','send','map','OpenchannelApplication','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','include','rows','catch','show','params','keys','includeAll','find','create','body','destroy','eml-format','rimraf','zip-dir','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'];(function(_0xd6e51c,_0x509db7){var _0x22ca22=function(_0x5bbd69){while(--_0x5bbd69){_0xd6e51c['push'](_0xd6e51c['shift']());}};_0x22ca22(++_0x509db7);}(_0xa9cb,0x1eb));var _0xba9c=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9cb[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0xba9c('0x0'));var rimraf=require(_0xba9c('0x1'));var zipdir=require(_0xba9c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xba9c('0x3'));var util=require(_0xba9c('0x4'));var path=require(_0xba9c('0x5'));var sox=require(_0xba9c('0x6'));var csv=require(_0xba9c('0x7'));var ejs=require(_0xba9c('0x8'));var fs=require('fs');var fs_extra=require(_0xba9c('0x9'));var _=require(_0xba9c('0xa'));var squel=require(_0xba9c('0xb'));var crypto=require('crypto');var jsforce=require(_0xba9c('0xc'));var deskjs=require(_0xba9c('0xd'));var toCsv=require(_0xba9c('0x7'));var querystring=require(_0xba9c('0xe'));var Papa=require(_0xba9c('0xf'));var Redis=require(_0xba9c('0x10'));var authService=require(_0xba9c('0x11'));var qs=require(_0xba9c('0x12'));var as=require(_0xba9c('0x13'));var hardwareService=require(_0xba9c('0x14'));var logger=require(_0xba9c('0x15'))(_0xba9c('0x16'));var utils=require(_0xba9c('0x17'));var config=require(_0xba9c('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x306f04,_0x1556ad){_0x1556ad=_0x1556ad||0xcc;return function(_0x2705b7){if(_0x2705b7){return _0x306f04['sendStatus'](_0x1556ad);}return _0x306f04[_0xba9c('0x19')](_0x1556ad)[_0xba9c('0x1a')]();};}function respondWithResult(_0x528d4f,_0x1db71d){_0x1db71d=_0x1db71d||0xc8;return function(_0x5c943a){if(_0x5c943a){return _0x528d4f[_0xba9c('0x19')](_0x1db71d)[_0xba9c('0x1b')](_0x5c943a);}};}function respondWithFilteredResult(_0x60d179,_0x1c82ea){return function(_0xc2ec39){if(_0xc2ec39){var _0x2dadd4=typeof _0x1c82ea[_0xba9c('0x1c')]==='undefined'&&typeof _0x1c82ea[_0xba9c('0x1d')]===_0xba9c('0x1e');var _0x24fe4b=_0xc2ec39[_0xba9c('0x1f')];var _0x33bfab=_0x2dadd4?0x0:_0x1c82ea['offset'];var _0x55c5cc=_0x2dadd4?_0xc2ec39[_0xba9c('0x1f')]:_0x1c82ea['offset']+_0x1c82ea['limit'];var _0x4f6170;if(_0x55c5cc>=_0x24fe4b){_0x55c5cc=_0x24fe4b;_0x4f6170=0xc8;}else{_0x4f6170=0xce;}_0x60d179['status'](_0x4f6170);return _0x60d179[_0xba9c('0x20')](_0xba9c('0x21'),_0x33bfab+'-'+_0x55c5cc+'/'+_0x24fe4b)[_0xba9c('0x1b')](_0xc2ec39);}return null;};}function patchUpdates(_0x3fce51){return function(_0x10584c){try{jsonpatch[_0xba9c('0x22')](_0x10584c,_0x3fce51,!![]);}catch(_0x57e323){return BPromise[_0xba9c('0x23')](_0x57e323);}return _0x10584c[_0xba9c('0x24')]();};}function saveUpdates(_0x45dccd,_0x1f1970){return function(_0x4b1598){if(_0x4b1598){return _0x4b1598[_0xba9c('0x25')](_0x45dccd)[_0xba9c('0x26')](function(_0x120d40){return _0x120d40;});}return null;};}function removeEntity(_0x1d1fb3,_0x2d963b){return function(_0x3d8b07){if(_0x3d8b07){return _0x3d8b07['destroy']()['then'](function(){_0x1d1fb3['status'](0xcc)[_0xba9c('0x1a')]();});}};}function handleEntityNotFound(_0x880316,_0x478c47){return function(_0x18e683){if(!_0x18e683){_0x880316['sendStatus'](0x194);}return _0x18e683;};}function handleError(_0x3a9e35,_0x58e2bb){_0x58e2bb=_0x58e2bb||0x1f4;return function(_0x29c723){logger[_0xba9c('0x27')](_0x29c723['stack']);if(_0x29c723[_0xba9c('0x28')]){delete _0x29c723[_0xba9c('0x28')];}_0x3a9e35[_0xba9c('0x19')](_0x58e2bb)[_0xba9c('0x29')](_0x29c723);};}exports['index']=function(_0x4d5eb0,_0x573450){var _0x6cac80={},_0x4dc845={},_0x161d64={'count':0x0,'rows':[]};var _0x20126a=_[_0xba9c('0x2a')](db[_0xba9c('0x2b')]['rawAttributes'],function(_0xf70d3c){return{'name':_0xf70d3c[_0xba9c('0x2c')],'type':_0xf70d3c[_0xba9c('0x2d')]['key']};});_0x4dc845[_0xba9c('0x2e')]=_['map'](_0x20126a,'name');_0x4dc845[_0xba9c('0x2f')]=_['keys'](_0x4d5eb0['query']);_0x4dc845[_0xba9c('0x30')]=_[_0xba9c('0x31')](_0x4dc845[_0xba9c('0x2e')],_0x4dc845[_0xba9c('0x2f')]);_0x6cac80['attributes']=_[_0xba9c('0x31')](_0x4dc845[_0xba9c('0x2e')],qs[_0xba9c('0x32')](_0x4d5eb0[_0xba9c('0x2f')][_0xba9c('0x32')]));_0x6cac80[_0xba9c('0x33')]=_0x6cac80['attributes'][_0xba9c('0x34')]?_0x6cac80[_0xba9c('0x33')]:_0x4dc845[_0xba9c('0x2e')];if(!_0x4d5eb0['query'][_0xba9c('0x35')]('nolimit')){_0x6cac80[_0xba9c('0x1d')]=qs[_0xba9c('0x1d')](_0x4d5eb0[_0xba9c('0x2f')][_0xba9c('0x1d')]);_0x6cac80['offset']=qs['offset'](_0x4d5eb0[_0xba9c('0x2f')][_0xba9c('0x1c')]);}_0x6cac80[_0xba9c('0x36')]=qs[_0xba9c('0x37')](_0x4d5eb0['query']['sort']);_0x6cac80[_0xba9c('0x38')]=qs[_0xba9c('0x30')](_[_0xba9c('0x39')](_0x4d5eb0[_0xba9c('0x2f')],_0x4dc845['filters']),_0x20126a);if(_0x4d5eb0['query']['filter']){_0x6cac80[_0xba9c('0x38')]=_[_0xba9c('0x3a')](_0x6cac80[_0xba9c('0x38')],{'$or':_[_0xba9c('0x2a')](_0x20126a,function(_0x485489){if(_0x485489[_0xba9c('0x2d')]!==_0xba9c('0x3b')){var _0x538571={};_0x538571[_0x485489[_0xba9c('0x28')]]={'$like':'%'+_0x4d5eb0[_0xba9c('0x2f')][_0xba9c('0x3c')]+'%'};return _0x538571;}})});}_0x6cac80=_['merge']({},_0x6cac80,_0x4d5eb0[_0xba9c('0x3d')]);var _0x2f20ac={'where':_0x6cac80[_0xba9c('0x38')]};return db[_0xba9c('0x2b')][_0xba9c('0x1f')](_0x2f20ac)[_0xba9c('0x26')](function(_0xf5cf5a){_0x161d64[_0xba9c('0x1f')]=_0xf5cf5a;if(_0x4d5eb0[_0xba9c('0x2f')]['includeAll']){_0x6cac80[_0xba9c('0x3e')]=[{'all':!![]}];}return db[_0xba9c('0x2b')]['findAll'](_0x6cac80);})['then'](function(_0x234df1){_0x161d64[_0xba9c('0x3f')]=_0x234df1;return _0x161d64;})[_0xba9c('0x26')](respondWithFilteredResult(_0x573450,_0x6cac80))[_0xba9c('0x40')](handleError(_0x573450,null));};exports[_0xba9c('0x41')]=function(_0x44fe9f,_0x1fe1dd){var _0x4b7fbb={'raw':!![],'where':{'id':_0x44fe9f[_0xba9c('0x42')]['id']}},_0x7dda1e={};_0x7dda1e['model']=_[_0xba9c('0x43')](db[_0xba9c('0x2b')]['rawAttributes']);_0x7dda1e[_0xba9c('0x2f')]=_[_0xba9c('0x43')](_0x44fe9f['query']);_0x7dda1e[_0xba9c('0x30')]=_[_0xba9c('0x31')](_0x7dda1e[_0xba9c('0x2e')],_0x7dda1e['query']);_0x4b7fbb[_0xba9c('0x33')]=_[_0xba9c('0x31')](_0x7dda1e[_0xba9c('0x2e')],qs['fields'](_0x44fe9f[_0xba9c('0x2f')]['fields']));_0x4b7fbb[_0xba9c('0x33')]=_0x4b7fbb[_0xba9c('0x33')][_0xba9c('0x34')]?_0x4b7fbb[_0xba9c('0x33')]:_0x7dda1e['model'];if(_0x44fe9f[_0xba9c('0x2f')][_0xba9c('0x44')]){_0x4b7fbb['include']=[{'all':!![]}];}_0x4b7fbb=_['merge']({},_0x4b7fbb,_0x44fe9f[_0xba9c('0x3d')]);return db[_0xba9c('0x2b')][_0xba9c('0x45')](_0x4b7fbb)[_0xba9c('0x26')](handleEntityNotFound(_0x1fe1dd,null))[_0xba9c('0x26')](respondWithResult(_0x1fe1dd,null))[_0xba9c('0x40')](handleError(_0x1fe1dd,null));};exports['create']=function(_0x356902,_0x2d4fe5){return db[_0xba9c('0x2b')][_0xba9c('0x46')](_0x356902[_0xba9c('0x47')],{})['then'](respondWithResult(_0x2d4fe5,0xc9))['catch'](handleError(_0x2d4fe5,null));};exports[_0xba9c('0x25')]=function(_0x5ac5ad,_0x2a674c){if(_0x5ac5ad[_0xba9c('0x47')]['id']){delete _0x5ac5ad['body']['id'];}return db['OpenchannelApplication'][_0xba9c('0x45')]({'where':{'id':_0x5ac5ad[_0xba9c('0x42')]['id']}})[_0xba9c('0x26')](handleEntityNotFound(_0x2a674c,null))[_0xba9c('0x26')](saveUpdates(_0x5ac5ad[_0xba9c('0x47')],null))['then'](respondWithResult(_0x2a674c,null))['catch'](handleError(_0x2a674c,null));};exports[_0xba9c('0x48')]=function(_0xb6ecb,_0x230093){return db[_0xba9c('0x2b')][_0xba9c('0x45')]({'where':{'id':_0xb6ecb[_0xba9c('0x42')]['id']}})['then'](handleEntityNotFound(_0x230093,null))[_0xba9c('0x26')](removeEntity(_0x230093,null))[_0xba9c('0x40')](handleError(_0x230093,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 1d6bff8..e2fcd30 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 _0xb51a=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x5ce268,_0x1835b6){var _0x28c96a=function(_0x18c1d6){while(--_0x18c1d6){_0x5ce268['push'](_0x5ce268['shift']());}};_0x28c96a(++_0x1835b6);}(_0xb51a,0x7e));var _0xab51=function(_0x121a4b,_0x48e779){_0x121a4b=_0x121a4b-0x0;var _0x4aa5d4=_0xb51a[_0x121a4b];return _0x4aa5d4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xab51('0x0'))(_0xab51('0x1'));var moment=require(_0xab51('0x2'));var BPromise=require(_0xab51('0x3'));var rp=require(_0xab51('0x4'));var fs=require('fs');var path=require(_0xab51('0x5'));var rimraf=require(_0xab51('0x6'));var config=require(_0xab51('0x7'));var attributes=require(_0xab51('0x8'));module['exports']=function(_0x3dc0d6,_0x53b425){return _0x3dc0d6[_0xab51('0x9')](_0xab51('0xa'),attributes,{'tableName':_0xab51('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xab51('0xc'),'collate':_0xab51('0xd')});}; \ No newline at end of file +var _0xb6d3=['request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','openchannel_applications','utf8mb4_unicode_ci','lodash','util','api','moment'];(function(_0x523efc,_0x672796){var _0x1d397d=function(_0x512654){while(--_0x512654){_0x523efc['push'](_0x523efc['shift']());}};_0x1d397d(++_0x672796);}(_0xb6d3,0xe6));var _0x3b6d=function(_0x2dc53c,_0x4a29ce){_0x2dc53c=_0x2dc53c-0x0;var _0x32ea88=_0xb6d3[_0x2dc53c];return _0x32ea88;};'use strict';var _=require(_0x3b6d('0x0'));var util=require(_0x3b6d('0x1'));var logger=require('../../config/logger')(_0x3b6d('0x2'));var moment=require(_0x3b6d('0x3'));var BPromise=require('bluebird');var rp=require(_0x3b6d('0x4'));var fs=require('fs');var path=require(_0x3b6d('0x5'));var rimraf=require(_0x3b6d('0x6'));var config=require(_0x3b6d('0x7'));var attributes=require(_0x3b6d('0x8'));module[_0x3b6d('0x9')]=function(_0x1f48a7,_0x8e42a){return _0x1f48a7[_0x3b6d('0xa')]('OpenchannelApplication',attributes,{'tableName':_0x3b6d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x3b6d('0xc')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 2c9f878..cd16847 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 _0x6c6f=['body','options','where','attributes','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelApplication,\x20%s,\x20%s','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x6c6f,0xf4));var _0xf6c6=function(_0x4346ae,_0x255508){_0x4346ae=_0x4346ae-0x0;var _0x171b80=_0x6c6f[_0x4346ae];return _0x171b80;};'use strict';var _=require(_0xf6c6('0x0'));var util=require('util');var moment=require(_0xf6c6('0x1'));var BPromise=require(_0xf6c6('0x2'));var rs=require(_0xf6c6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf6c6('0x4'));var logger=require(_0xf6c6('0x5'))(_0xf6c6('0x6'));var config=require(_0xf6c6('0x7'));var jayson=require(_0xf6c6('0x8'));var client=jayson[_0xf6c6('0x9')][_0xf6c6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f7f5c,_0x497aa1,_0x3efaac){return new BPromise(function(_0x45f296,_0x2a209b){return client[_0xf6c6('0xb')](_0x4f7f5c,_0x3efaac)['then'](function(_0x21ed49){logger[_0xf6c6('0xc')]('OpenchannelApplication,\x20%s,\x20%s',_0x497aa1,'request\x20sent');logger[_0xf6c6('0xd')](_0xf6c6('0xe'),_0x497aa1,_0xf6c6('0xf'),JSON[_0xf6c6('0x10')](_0x21ed49));if(_0x21ed49[_0xf6c6('0x11')]){if(_0x21ed49['error'][_0xf6c6('0x12')]===0x1f4){logger[_0xf6c6('0x11')](_0xf6c6('0x13'),_0x497aa1,_0x21ed49[_0xf6c6('0x11')][_0xf6c6('0x14')]);return _0x2a209b(_0x21ed49['error'][_0xf6c6('0x14')]);}logger[_0xf6c6('0x11')]('OpenchannelApplication,\x20%s,\x20%s',_0x497aa1,_0x21ed49[_0xf6c6('0x11')][_0xf6c6('0x14')]);return _0x45f296(_0x21ed49['error'][_0xf6c6('0x14')]);}else{logger[_0xf6c6('0xc')](_0xf6c6('0x13'),_0x497aa1,_0xf6c6('0xf'));_0x45f296(_0x21ed49[_0xf6c6('0x15')][_0xf6c6('0x14')]);}})[_0xf6c6('0x16')](function(_0x34cdbb){logger[_0xf6c6('0x11')](_0xf6c6('0x13'),_0x497aa1,_0x34cdbb);_0x2a209b(_0x34cdbb);});});}exports[_0xf6c6('0x17')]=function(_0x2e135f){var _0x3345b9=this;return new Promise(function(_0x5c81ad,_0x2abd5b){return db[_0xf6c6('0x18')][_0xf6c6('0x19')](_0x2e135f[_0xf6c6('0x1a')],{'raw':_0x2e135f[_0xf6c6('0x1b')]?_0x2e135f[_0xf6c6('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e135f[_0xf6c6('0x1b')]?_0x2e135f[_0xf6c6('0x1b')][_0xf6c6('0x1c')]||null:null,'attributes':_0x2e135f[_0xf6c6('0x1b')]?_0x2e135f['options'][_0xf6c6('0x1d')]||null:null,'limit':_0x2e135f[_0xf6c6('0x1b')]?_0x2e135f['options']['limit']||null:null})['then'](function(_0x5ad39e){logger['info'](_0xf6c6('0x17'),_0x2e135f);logger[_0xf6c6('0xd')](_0xf6c6('0x17'),_0x2e135f,JSON[_0xf6c6('0x10')](_0x5ad39e));_0x5c81ad(_0x5ad39e);})[_0xf6c6('0x16')](function(_0x4c2156){logger[_0xf6c6('0x11')]('UpdateOpenchannelApplication',_0x4c2156[_0xf6c6('0x14')],_0x2e135f);_0x2abd5b(_0x3345b9[_0xf6c6('0x11')](0x1f4,_0x4c2156[_0xf6c6('0x14')]));});});}; \ No newline at end of file +var _0x9575=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','OpenchannelApplication,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','where','limit','info','stringify','lodash','util'];(function(_0x35d294,_0x3a9b4){var _0xb9ae9a=function(_0x3c08ce){while(--_0x3c08ce){_0x35d294['push'](_0x35d294['shift']());}};_0xb9ae9a(++_0x3a9b4);}(_0x9575,0x19e));var _0x5957=function(_0x27af80,_0x396b70){_0x27af80=_0x27af80-0x0;var _0x855bc7=_0x9575[_0x27af80];return _0x855bc7;};'use strict';var _=require(_0x5957('0x0'));var util=require(_0x5957('0x1'));var moment=require('moment');var BPromise=require(_0x5957('0x2'));var rs=require(_0x5957('0x3'));var fs=require('fs');var Redis=require(_0x5957('0x4'));var db=require(_0x5957('0x5'))['db'];var utils=require(_0x5957('0x6'));var logger=require(_0x5957('0x7'))(_0x5957('0x8'));var config=require(_0x5957('0x9'));var jayson=require(_0x5957('0xa'));var client=jayson[_0x5957('0xb')][_0x5957('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x574cd9,_0x212589,_0x34d360){return new BPromise(function(_0x26403f,_0x56a6cc){return client[_0x5957('0xd')](_0x574cd9,_0x34d360)[_0x5957('0xe')](function(_0x54f4bf){logger['info'](_0x5957('0xf'),_0x212589,'request\x20sent');logger[_0x5957('0x10')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x212589,_0x5957('0x11'),JSON['stringify'](_0x54f4bf));if(_0x54f4bf[_0x5957('0x12')]){if(_0x54f4bf['error'][_0x5957('0x13')]===0x1f4){logger[_0x5957('0x12')](_0x5957('0xf'),_0x212589,_0x54f4bf[_0x5957('0x12')][_0x5957('0x14')]);return _0x56a6cc(_0x54f4bf[_0x5957('0x12')]['message']);}logger[_0x5957('0x12')]('OpenchannelApplication,\x20%s,\x20%s',_0x212589,_0x54f4bf[_0x5957('0x12')]['message']);return _0x26403f(_0x54f4bf['error'][_0x5957('0x14')]);}else{logger['info'](_0x5957('0xf'),_0x212589,_0x5957('0x11'));_0x26403f(_0x54f4bf[_0x5957('0x15')]['message']);}})[_0x5957('0x16')](function(_0x1558cb){logger[_0x5957('0x12')](_0x5957('0xf'),_0x212589,_0x1558cb);_0x56a6cc(_0x1558cb);});});}exports[_0x5957('0x17')]=function(_0x5adf19){var _0x5daaf8=this;return new Promise(function(_0x26d660,_0x48a1be){return db[_0x5957('0x18')][_0x5957('0x19')](_0x5adf19[_0x5957('0x1a')],{'raw':_0x5adf19[_0x5957('0x1b')]?_0x5adf19['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5adf19[_0x5957('0x1b')]?_0x5adf19['options'][_0x5957('0x1c')]||null:null,'attributes':_0x5adf19[_0x5957('0x1b')]?_0x5adf19['options']['attributes']||null:null,'limit':_0x5adf19['options']?_0x5adf19['options'][_0x5957('0x1d')]||null:null})['then'](function(_0x491a41){logger[_0x5957('0x1e')](_0x5957('0x17'),_0x5adf19);logger[_0x5957('0x10')]('UpdateOpenchannelApplication',_0x5adf19,JSON[_0x5957('0x1f')](_0x491a41));_0x26d660(_0x491a41);})['catch'](function(_0xb95d94){logger[_0x5957('0x12')]('UpdateOpenchannelApplication',_0xb95d94[_0x5957('0x14')],_0x5adf19);_0x48a1be(_0x5daaf8[_0x5957('0x12')](0x1f4,_0xb95d94['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index aa347f7..8da8b14 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 _0x9503=['/:id/download','download','post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','openchannelinteraction:update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages'];(function(_0x63a69b,_0x296888){var _0x425fa1=function(_0x117642){while(--_0x117642){_0x63a69b['push'](_0x63a69b['shift']());}};_0x425fa1(++_0x296888);}(_0x9503,0x72));var _0x3950=function(_0x39f24a,_0x2f2ca3){_0x39f24a=_0x39f24a-0x0;var _0x3b30b8=_0x9503[_0x39f24a];return _0x3b30b8;};'use strict';var multer=require(_0x3950('0x0'));var util=require('util');var path=require(_0x3950('0x1'));var timeout=require(_0x3950('0x2'));var express=require('express');var router=express[_0x3950('0x3')]();var fs_extra=require(_0x3950('0x4'));var auth=require(_0x3950('0x5'));var interaction=require(_0x3950('0x6'));var config=require(_0x3950('0x7'));var controller=require(_0x3950('0x8'));router[_0x3950('0x9')]('/',auth[_0x3950('0xa')](),controller[_0x3950('0xb')]);router['get'](_0x3950('0xc'),auth['isAuthenticated'](),controller[_0x3950('0xd')]);router[_0x3950('0x9')](_0x3950('0xe'),auth[_0x3950('0xa')](),controller[_0x3950('0xf')]);router[_0x3950('0x9')](_0x3950('0x10'),auth[_0x3950('0xa')](),controller[_0x3950('0x11')]);router['get'](_0x3950('0x12'),auth[_0x3950('0xa')](),controller[_0x3950('0x13')]);router[_0x3950('0x14')]('/',auth[_0x3950('0xa')](),controller[_0x3950('0x15')]);router[_0x3950('0x14')](_0x3950('0x10'),auth[_0x3950('0xa')](),controller[_0x3950('0x16')]);router['post'](_0x3950('0x17'),auth[_0x3950('0xa')](),interaction[_0x3950('0x18')](_0x3950('0x19'),_0x3950('0x1a')),controller['addTags']);router['put'](_0x3950('0xe'),auth[_0x3950('0xa')](),interaction[_0x3950('0x18')](_0x3950('0x19'),_0x3950('0x1b')),controller['update']);router[_0x3950('0x1c')]('/:id',auth[_0x3950('0xa')](),interaction[_0x3950('0x18')](_0x3950('0x19'),_0x3950('0x1d')),controller[_0x3950('0x1e')]);router[_0x3950('0x1c')](_0x3950('0x17'),auth['isAuthenticated'](),controller[_0x3950('0x1f')]);module[_0x3950('0x20')]=router; \ No newline at end of file +var _0x1e68=['/describe','/:id','show','getMessages','/:id/download','download','post','/:id/messages','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x478aca,_0x25d969){var _0x1c906e=function(_0x1f2d43){while(--_0x1f2d43){_0x478aca['push'](_0x478aca['shift']());}};_0x1c906e(++_0x25d969);}(_0x1e68,0xfc));var _0x81e6=function(_0x196ef1,_0x479751){_0x196ef1=_0x196ef1-0x0;var _0x1b7533=_0x1e68[_0x196ef1];return _0x1b7533;};'use strict';var multer=require(_0x81e6('0x0'));var util=require(_0x81e6('0x1'));var path=require(_0x81e6('0x2'));var timeout=require(_0x81e6('0x3'));var express=require(_0x81e6('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x81e6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x81e6('0x6'));var controller=require('./openchannelInteraction.controller');router[_0x81e6('0x7')]('/',auth[_0x81e6('0x8')](),controller['index']);router[_0x81e6('0x7')](_0x81e6('0x9'),auth[_0x81e6('0x8')](),controller['describe']);router[_0x81e6('0x7')](_0x81e6('0xa'),auth['isAuthenticated'](),controller[_0x81e6('0xb')]);router[_0x81e6('0x7')]('/:id/messages',auth['isAuthenticated'](),controller[_0x81e6('0xc')]);router[_0x81e6('0x7')](_0x81e6('0xd'),auth[_0x81e6('0x8')](),controller[_0x81e6('0xe')]);router['post']('/',auth[_0x81e6('0x8')](),controller['create']);router[_0x81e6('0xf')](_0x81e6('0x10'),auth['isAuthenticated'](),controller[_0x81e6('0x11')]);router[_0x81e6('0xf')](_0x81e6('0x12'),auth[_0x81e6('0x8')](),interaction[_0x81e6('0x13')](_0x81e6('0x14'),_0x81e6('0x15')),controller[_0x81e6('0x16')]);router['put']('/:id',auth[_0x81e6('0x8')](),interaction[_0x81e6('0x13')](_0x81e6('0x14'),_0x81e6('0x17')),controller[_0x81e6('0x18')]);router[_0x81e6('0x19')](_0x81e6('0xa'),auth[_0x81e6('0x8')](),interaction[_0x81e6('0x13')]('openchannel',_0x81e6('0x1a')),controller[_0x81e6('0x1b')]);router[_0x81e6('0x19')]('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);module[_0x81e6('0x1c')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 02cc842..af86120 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 _0xbc17=['sequelize','exports','DATE','STRING','ENUM','out','BOOLEAN'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0xbc17,0x1ab));var _0x7bc1=function(_0x1a5687,_0xc2188f){_0x1a5687=_0x1a5687-0x0;var _0x257d5c=_0xbc17[_0x1a5687];return _0x257d5c;};'use strict';var Sequelize=require(_0x7bc1('0x0'));module[_0x7bc1('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7bc1('0x2')]},'disposition':{'type':Sequelize[_0x7bc1('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7bc1('0x3')]},'read1stAt':{'type':Sequelize[_0x7bc1('0x2')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0x7bc1('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x7bc1('0x4')]('in',_0x7bc1('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x7bc1('0x4')]('in',_0x7bc1('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x7bc1('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x7bc1('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0xadec=['sequelize','exports','BOOLEAN','DATE','STRING','out'];(function(_0x3ed1de,_0x5e2c81){var _0x5599a6=function(_0x7beac8){while(--_0x7beac8){_0x3ed1de['push'](_0x3ed1de['shift']());}};_0x5599a6(++_0x5e2c81);}(_0xadec,0x156));var _0xcade=function(_0x1ddfbd,_0xfa4d97){_0x1ddfbd=_0x1ddfbd-0x0;var _0x2469b8=_0xadec[_0x1ddfbd];return _0x2469b8;};'use strict';var Sequelize=require(_0xcade('0x0'));module[_0xcade('0x1')]={'closed':{'type':Sequelize[_0xcade('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xcade('0x3')]},'disposition':{'type':Sequelize[_0xcade('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xcade('0x3')]},'threadId':{'type':Sequelize[_0xcade('0x4')]},'externalUrl':{'type':Sequelize[_0xcade('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xcade('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0xcade('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 4ecad70..4905df4 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 _0x1e2b=['it.OpenchannelInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','$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','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?','buildExpression','body','some','compact','isEmpty','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`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?','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','t.id\x20IN\x20?','resolve','OpenchannelAccountId','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','getOpenchannelAccounts','agent','sequelize','toString','merge','a.mandatoryDisposition','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','push','all','show','params','include','create','update','describe','addMessage','ids','omit','getMessages','OpenchannelMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','options','rows','setTags','spread','findAll','removeTags','unix','join','root','server','files','tmp','attachments','CmContact','firstName','lastName','Attachment','OpenchannelAccount','Account','Owner','Openchannel','N.A.','closedAt','threadId','Public','basename','existsSync','createReadStream','createWriteStream','direction','System','out','secret','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','download','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','lodash','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./openchannelInteraction.socket','sendStatus','status','offset','undefined','limit','count','set','apply','reject','save','then','destroy','end','error','name','send','Users','map','fullname','Tags','TagIds','split','forEach','catch','waiting','talking','unmanaged','total','closed','UserId','answered','index','OpenchannelInteraction','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','u.id','u.fullname','user_has_openchannel_interactions','left_join','users','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id'];(function(_0x945ff7,_0x49b3f5){var _0x22481e=function(_0x44cd40){while(--_0x44cd40){_0x945ff7['push'](_0x945ff7['shift']());}};_0x22481e(++_0x49b3f5);}(_0x1e2b,0x181));var _0xb1e2=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x1e2b[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb1e2('0x0'));var zipdir=require(_0xb1e2('0x1'));var jsonpatch=require(_0xb1e2('0x2'));var rp=require(_0xb1e2('0x3'));var moment=require(_0xb1e2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb1e2('0x5'));var util=require(_0xb1e2('0x6'));var path=require(_0xb1e2('0x7'));var sox=require('sox');var csv=require(_0xb1e2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb1e2('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb1e2('0xa'));var deskjs=require(_0xb1e2('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb1e2('0xc'));var Redis=require(_0xb1e2('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xb1e2('0xe'));var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require(_0xb1e2('0xf'));var logger=require('../../config/logger')(_0xb1e2('0x10'));var utils=require(_0xb1e2('0x11'));var config=require(_0xb1e2('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xb1e2('0x13'))['db'];config[_0xb1e2('0x14')]=_[_0xb1e2('0x15')](config[_0xb1e2('0x14')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb1e2('0x16'))['register'](socket);function respondWithStatusCode(_0x561722,_0x1733c7){_0x1733c7=_0x1733c7||0xcc;return function(_0x4497ba){if(_0x4497ba){return _0x561722[_0xb1e2('0x17')](_0x1733c7);}return _0x561722[_0xb1e2('0x18')](_0x1733c7)['end']();};}function respondWithResult(_0x429e51,_0x50fe1a){_0x50fe1a=_0x50fe1a||0xc8;return function(_0x5c9e15){if(_0x5c9e15){return _0x429e51[_0xb1e2('0x18')](_0x50fe1a)['json'](_0x5c9e15);}};}function respondWithFilteredResult(_0xaeee14,_0x528c18){return function(_0x1b7b75){if(_0x1b7b75){var _0xbaebaf=typeof _0x528c18[_0xb1e2('0x19')]===_0xb1e2('0x1a')&&typeof _0x528c18[_0xb1e2('0x1b')]===_0xb1e2('0x1a');var _0x20c2ba=_0x1b7b75[_0xb1e2('0x1c')];var _0x425cd9=_0xbaebaf?0x0:_0x528c18[_0xb1e2('0x19')];var _0x3b2dda=_0xbaebaf?_0x1b7b75['count']:_0x528c18[_0xb1e2('0x19')]+_0x528c18[_0xb1e2('0x1b')];var _0x2606ab;if(_0x3b2dda>=_0x20c2ba){_0x3b2dda=_0x20c2ba;_0x2606ab=0xc8;}else{_0x2606ab=0xce;}_0xaeee14[_0xb1e2('0x18')](_0x2606ab);return _0xaeee14[_0xb1e2('0x1d')]('Content-Range',_0x425cd9+'-'+_0x3b2dda+'/'+_0x20c2ba)['json'](_0x1b7b75);}return null;};}function patchUpdates(_0x26d0c1){return function(_0x362a0c){try{jsonpatch[_0xb1e2('0x1e')](_0x362a0c,_0x26d0c1,!![]);}catch(_0x1f2337){return BPromise[_0xb1e2('0x1f')](_0x1f2337);}return _0x362a0c[_0xb1e2('0x20')]();};}function saveUpdates(_0x58bcdd,_0x35f487){return function(_0x5824db){if(_0x5824db){return _0x5824db['update'](_0x58bcdd)[_0xb1e2('0x21')](function(_0xa0b82d){return _0xa0b82d;});}return null;};}function removeEntity(_0x12b008,_0x3c9fcb){return function(_0x166479){if(_0x166479){return _0x166479[_0xb1e2('0x22')]()['then'](function(){_0x12b008[_0xb1e2('0x18')](0xcc)[_0xb1e2('0x23')]();});}};}function handleEntityNotFound(_0xf95df2,_0x3d5003){return function(_0x4c6496){if(!_0x4c6496){_0xf95df2[_0xb1e2('0x17')](0x194);}return _0x4c6496;};}function handleError(_0x32c6ec,_0x1dbc89){_0x1dbc89=_0x1dbc89||0x1f4;return function(_0x2a8a15){logger[_0xb1e2('0x24')](_0x2a8a15['stack']);if(_0x2a8a15[_0xb1e2('0x25')]){delete _0x2a8a15['name'];}_0x32c6ec[_0xb1e2('0x18')](_0x1dbc89)[_0xb1e2('0x26')](_0x2a8a15);};}function getInteractionUsers(_0x5b8287,_0x17e815){return new BPromise(function(_0x225bdd,_0x3ac1d8){try{if(_0x17e815[_0x5b8287['id']]){_0x5b8287[_0xb1e2('0x27')]=_[_0xb1e2('0x28')](_0x17e815[_0x5b8287['id']],function(_0x160f4f){return{'id':_0x160f4f['id'],'fullname':_0x160f4f[_0xb1e2('0x29')]};});}}catch(_0x4d91e6){_0x3ac1d8(_0x4d91e6);}_0x225bdd(_0x5b8287);});}function getInteractionTags(_0x6581b7,_0x1010f6){return new BPromise(function(_0x1ad377,_0x16e8bf){try{if(_0x6581b7['TagIds']){_0x6581b7[_0xb1e2('0x2a')]=[];_0x6581b7[_0xb1e2('0x2b')][_0xb1e2('0x2c')](',')[_0xb1e2('0x2d')](function(_0x227209){_0x6581b7[_0xb1e2('0x2a')]['push'](_0x1010f6[_0x227209]);});}delete _0x6581b7[_0xb1e2('0x2b')];}catch(_0x4b2194){_0x16e8bf(_0x4b2194);}_0x1ad377(_0x6581b7);});}function updateOpenchannelInteraction(_0x7df4fa,_0x37b6bf,_0x2ec900){return new BPromise(function(_0x287a72,_0x64ba69){return getInteractionUsers(_0x7df4fa,_0x2ec900)[_0xb1e2('0x21')](function(_0xce28b1){return getInteractionTags(_0xce28b1,_0x37b6bf);})[_0xb1e2('0x21')](function(_0x53799f){return getStateInteraction(_0x53799f);})[_0xb1e2('0x21')](function(_0x51655f){_0x287a72(_0x51655f);})[_0xb1e2('0x2e')](function(_0x2ea3c3){_0x64ba69(_0x2ea3c3);});});}function getStateInteraction(_0x59fa68){return new BPromise(function(_0x58bc29){_0x59fa68[_0xb1e2('0x2f')]=0x0;_0x59fa68[_0xb1e2('0x30')]=0x0;_0x59fa68['answered']=0x0;_0x59fa68[_0xb1e2('0x31')]=0x0;_0x59fa68[_0xb1e2('0x32')]=0x0;if(!_0x59fa68[_0xb1e2('0x33')]&&!_0x59fa68['UserId']){_0x59fa68['waiting']+=0x1;}if(!_0x59fa68[_0xb1e2('0x33')]&&_0x59fa68['UserId']){_0x59fa68['talking']+=0x1;if(_0x59fa68['waiting']){_0x59fa68['waiting']-=0x1;}}if(_0x59fa68[_0xb1e2('0x33')]&&_0x59fa68[_0xb1e2('0x34')]){_0x59fa68[_0xb1e2('0x35')]+=0x1;if(_0x59fa68[_0xb1e2('0x30')]){_0x59fa68[_0xb1e2('0x30')]-=0x1;}}if(_0x59fa68[_0xb1e2('0x33')]&&!_0x59fa68['UserId']){_0x59fa68[_0xb1e2('0x31')]+=0x1;if(_0x59fa68[_0xb1e2('0x2f')]){_0x59fa68[_0xb1e2('0x2f')]-=0x1;}}_0x59fa68['total']+=0x1;_0x58bc29(_0x59fa68);});}exports[_0xb1e2('0x36')]=function(_0x15b1ce,_0x48f916){var _0x518162={},_0x433ba2={},_0x85668e={'count':0x0,'rows':[]};var _0x59bf78=_['map'](db[_0xb1e2('0x37')][_0xb1e2('0x38')],function(_0x428adf){return{'name':_0x428adf[_0xb1e2('0x39')],'type':_0x428adf[_0xb1e2('0x3a')]['key']};});_0x433ba2['model']=_[_0xb1e2('0x28')](_0x59bf78,_0xb1e2('0x25'));_0x433ba2[_0xb1e2('0x3b')]=_[_0xb1e2('0x3c')](_0x15b1ce[_0xb1e2('0x3b')]);_0x433ba2[_0xb1e2('0x3d')]=_[_0xb1e2('0x3e')](_0x433ba2[_0xb1e2('0x3f')],_0x433ba2[_0xb1e2('0x3b')]);_0x518162[_0xb1e2('0x40')]=_[_0xb1e2('0x3e')](_0x433ba2[_0xb1e2('0x3f')],qs['fields'](_0x15b1ce['query'][_0xb1e2('0x41')]));_0x518162[_0xb1e2('0x40')]=_0x518162[_0xb1e2('0x40')]['length']?_0x518162[_0xb1e2('0x40')]:_0x433ba2['model'];if(!_0x15b1ce['query'][_0xb1e2('0x42')](_0xb1e2('0x43'))){_0x518162[_0xb1e2('0x1b')]=qs[_0xb1e2('0x1b')](_0x15b1ce[_0xb1e2('0x3b')][_0xb1e2('0x1b')]);_0x518162[_0xb1e2('0x19')]=qs[_0xb1e2('0x19')](_0x15b1ce[_0xb1e2('0x3b')][_0xb1e2('0x19')]);}_0x518162['order']=qs[_0xb1e2('0x44')](_0x15b1ce['query'][_0xb1e2('0x44')]);_0x518162[_0xb1e2('0x45')]=qs[_0xb1e2('0x3d')](_[_0xb1e2('0x46')](_0x15b1ce[_0xb1e2('0x3b')],_0x433ba2['filters']),_0x59bf78);var _0x1aff3f=[];var _0x1d4bb3=squel[_0xb1e2('0x47')]()[_0xb1e2('0x48')]('id')[_0xb1e2('0x48')](_0xb1e2('0x25'))[_0xb1e2('0x48')](_0xb1e2('0x49'))[_0xb1e2('0x4a')]('tools_tags');var _0x582092=squel[_0xb1e2('0x47')]()[_0xb1e2('0x48')](_0xb1e2('0x4b'))[_0xb1e2('0x48')](_0xb1e2('0x4c'))['field']('ui.OpenchannelInteractionId')['from'](_0xb1e2('0x4d'),'ui')[_0xb1e2('0x4e')](_0xb1e2('0x4f'),'u','u.id\x20=\x20ui.UserId');var _0x170c43=squel[_0xb1e2('0x47')]()[_0xb1e2('0x4a')](_0xb1e2('0x50'),'i')[_0xb1e2('0x4e')](_0xb1e2('0x51'),'c',_0xb1e2('0x52'))[_0xb1e2('0x4e')](_0xb1e2('0x4f'),'o',_0xb1e2('0x53'))[_0xb1e2('0x4e')](_0xb1e2('0x54'),'a','a.id\x20=\x20i.OpenchannelAccountId')[_0xb1e2('0x4e')](_0xb1e2('0x55'),'me',_0xb1e2('0x56'))[_0xb1e2('0x4e')]('openchannel_interaction_has_tags','it',_0xb1e2('0x57'))['left_join'](_0xb1e2('0x58'),'t',_0xb1e2('0x59'));var _0x43afd6=squel[_0xb1e2('0x5a')]();var _0x4123a6=[];var _0x1cbcf9=squel[_0xb1e2('0x5a')]();var _0x513f02;if(_0x15b1ce[_0xb1e2('0x3b')][_0xb1e2('0x5b')]){_0x513f02=as[_0xb1e2('0x5c')](_0x15b1ce[_0xb1e2('0x3b')][_0xb1e2('0x5b')]);var _0x1eb9d2=_0x513f02[_0xb1e2('0x5d')];for(var _0x2e9480=0x0;_0x2e9480<_0x513f02[_0xb1e2('0x5e')][_0xb1e2('0x5f')];_0x2e9480++){var _0x396f49=_0x513f02[_0xb1e2('0x5e')][_0x2e9480];var _0x573bb9='i';var _0x4867e8=_[_0xb1e2('0x60')](_0x59bf78,['name',_0x396f49[_0xb1e2('0x48')]]);if(!_0x4867e8){switch(_0x396f49[_0xb1e2('0x48')]){case _0xb1e2('0x61'):if(_0x396f49[_0xb1e2('0x62')]==0x1){_0x170c43[_0xb1e2('0x63')]('`'+_0x396f49['field']+_0xb1e2('0x64'));}else{_0x170c43[_0xb1e2('0x63')]('`'+_0x396f49['field']+_0xb1e2('0x65'));}break;case _0xb1e2('0x66'):if(_0x396f49['operator']===_0xb1e2('0x67')){if(_0x396f49[_0xb1e2('0x62')][_0xb1e2('0x2c')]('\x20')[_0xb1e2('0x5f')]>0x1){_0x43afd6[_0x1eb9d2](_0xb1e2('0x68'),qs[_0xb1e2('0x69')](_0x396f49[_0xb1e2('0x62')]),null);}else{var _0x4b4394='%'+_0x396f49[_0xb1e2('0x62')]+'%';_0x43afd6[_0x1eb9d2](_0xb1e2('0x6a'),_0x4b4394,_0x4b4394,_0x4b4394);}}else{_0x4867e8=_['find'](_0x59bf78,['name',_0xb1e2('0x6b')]);_0x396f49[_0xb1e2('0x48')]=_0xb1e2('0x6b');_0xc8024=as['buildExpression'](_0x573bb9,_0x4867e8[_0xb1e2('0x3a')],_0x396f49);_0x43afd6[_0x1eb9d2](_0xc8024[_0xb1e2('0x6c')],_0xc8024[_0xb1e2('0x62')][_0xb1e2('0x6d')],_0xc8024[_0xb1e2('0x62')]['end']);}break;case _0xb1e2('0x6e'):var _0x116b46=_0x396f49['value'][_0xb1e2('0x2c')](',')[_0xb1e2('0x28')](function(_0xfb4adc){return Number(_0xfb4adc);});_0x116b46[_0xb1e2('0x2d')](function(_0x12deb1){_0x1cbcf9['or'](_0xb1e2('0x6f'),'%,'+_0x12deb1+',%');});_0x4123a6=_[_0xb1e2('0x70')](_0x4123a6,_0x116b46);break;case _0xb1e2('0x71'):if(_0x396f49[_0xb1e2('0x72')]===_0xb1e2('0x67')){_0x43afd6[_0x1eb9d2](_0xb1e2('0x73'),'%'+_0x396f49[_0xb1e2('0x62')]+'%',null);}else{_0x4867e8=_['find'](_0x59bf78,['name',_0xb1e2('0x34')]);_0x396f49[_0xb1e2('0x48')]=_0xb1e2('0x34');_0xc8024=as[_0xb1e2('0x74')](_0x573bb9,_0x4867e8[_0xb1e2('0x3a')],_0x396f49);_0x43afd6[_0x1eb9d2](_0xc8024[_0xb1e2('0x6c')],_0xc8024['value']['start'],_0xc8024[_0xb1e2('0x62')][_0xb1e2('0x23')]);}break;case _0xb1e2('0x75'):_0xc8024=as[_0xb1e2('0x74')]('me',null,_0x396f49);_0x43afd6[_0x1eb9d2](_0xc8024['text'],_0xc8024[_0xb1e2('0x62')][_0xb1e2('0x6d')],_0xc8024['value'][_0xb1e2('0x23')]);break;}}else{var _0xc8024=as['buildExpression'](_0x573bb9,_0x4867e8[_0xb1e2('0x3a')],_0x396f49);_0x43afd6[_0x1eb9d2](_0xc8024[_0xb1e2('0x6c')],_0xc8024['value']['start'],_0xc8024[_0xb1e2('0x62')]['end']);}}}else{var _0x88d80b=_(_0x15b1ce['query'])[_0xb1e2('0x3c')]()[_0xb1e2('0x28')](function(_0x1388a1){return _[_0xb1e2('0x76')](_0x59bf78,[_0xb1e2('0x25'),_0x1388a1])?_0x1388a1:undefined;})[_0xb1e2('0x77')]()['value']();if(!_[_0xb1e2('0x78')](_0x88d80b)){_0x88d80b[_0xb1e2('0x2d')](function(_0x37bbe6){if(_0x37bbe6==='OpenchannelAccountId'){_0x170c43[_0xb1e2('0x45')](_0xb1e2('0x79'),[][_0xb1e2('0x7a')](_0x15b1ce[_0xb1e2('0x3b')][_0x37bbe6]));}else if(_0x37bbe6===_0xb1e2('0x7b')){var _0x3b2277=JSON[_0xb1e2('0x7c')](_0x15b1ce[_0xb1e2('0x3b')][_0x37bbe6])['$gte'];var _0x337be6=JSON[_0xb1e2('0x7c')](_0x15b1ce[_0xb1e2('0x3b')][_0x37bbe6])['$lte'];_0x170c43[_0xb1e2('0x45')](_0xb1e2('0x7d'),_0x3b2277,_0x337be6);}else{if(_0x15b1ce['query'][_0x37bbe6]===_0xb1e2('0x7e')){_0x170c43[_0xb1e2('0x45')]('i.'+_0x37bbe6+'\x20IS\x20NULL');}else{_0x170c43[_0xb1e2('0x45')]('i.'+_0x37bbe6+_0xb1e2('0x7f'),_0x15b1ce[_0xb1e2('0x3b')][_0x37bbe6]);}}});}if(_0x15b1ce[_0xb1e2('0x3b')][_0xb1e2('0x80')]){if(_0x15b1ce[_0xb1e2('0x3b')][_0xb1e2('0x80')]==0x1){_0x170c43[_0xb1e2('0x63')](_0xb1e2('0x81'));}else{_0x170c43[_0xb1e2('0x63')](_0xb1e2('0x82'));}}if(_0x15b1ce[_0xb1e2('0x3b')][_0xb1e2('0x83')]){_0x4123a6=_[_0xb1e2('0x84')](_0x15b1ce['query'][_0xb1e2('0x83')])?_0x15b1ce[_0xb1e2('0x3b')][_0xb1e2('0x83')]:new Array(_0x15b1ce['query'][_0xb1e2('0x83')]);_0x4123a6[_0xb1e2('0x2d')](function(_0x9d8c2){_0x1cbcf9['or'](_0xb1e2('0x6f'),'%,'+_0x9d8c2+',%');});}if(_0x15b1ce[_0xb1e2('0x3b')][_0xb1e2('0x85')]){var _0x486cb4=_0x15b1ce[_0xb1e2('0x3b')]['filter'][_0xb1e2('0x86')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xb1e2('0x87')](_0x486cb4)){_0x43afd6['or'](_0xb1e2('0x88'),_0x486cb4+'%');}else{_0x43afd6['or'](_0xb1e2('0x89'),qs[_0xb1e2('0x69')](_0x486cb4))['or']('i.from\x20LIKE\x20?',_0x486cb4+'%')['or'](_0xb1e2('0x8a'),_0x486cb4+'%');}}}_0x170c43[_0xb1e2('0x45')](_0x43afd6);_0x170c43['group'](_0xb1e2('0x8b'));var _0x19e5e1={'type':db[_0xb1e2('0x8c')][_0xb1e2('0x8d')][_0xb1e2('0x8e')],'raw':!![]};var _0x55692e=_0x170c43[_0xb1e2('0x8f')]();_0x55692e[_0xb1e2('0x48')](_0xb1e2('0x8b'));_0x55692e['field'](_0xb1e2('0x90'),_0xb1e2('0x61'));if(_0x518162[_0xb1e2('0x91')]){_0x518162[_0xb1e2('0x91')][_0xb1e2('0x2d')](function(_0x3f388c){var _0x1d58f6=_0x3f388c[0x0]==='contactName'?_0x3f388c[0x0]:'i.'+_0x3f388c[0x0];_0x170c43[_0xb1e2('0x91')](_0x1d58f6,_0x3f388c[0x1]===_0xb1e2('0x92')?![]:!![]);});}if(!_[_0xb1e2('0x78')](_0x4123a6)){_0x170c43[_0xb1e2('0x63')](_0x1cbcf9);_0x55692e['where'](_0xb1e2('0x93'),_0x4123a6);}BPromise[_0xb1e2('0x94')]()[_0xb1e2('0x21')](function(){if(!_0x513f02){if(_0x15b1ce['query'][_0xb1e2('0x95')])return;_0x55692e[_0xb1e2('0x45')](_0xb1e2('0x96'));_0x170c43[_0xb1e2('0x45')](_0xb1e2('0x96'));return;}if(_0x15b1ce[_0xb1e2('0x97')][_0xb1e2('0x98')]!=='agent')return;return _0x15b1ce['user'][_0xb1e2('0x99')]({'attributes':['id'],'raw':!![]})[_0xb1e2('0x21')](function(_0x35a94e){if(_[_0xb1e2('0x78')](_0x35a94e)){_0x55692e[_0xb1e2('0x45')]('i.OpenchannelAccountId\x20IS\x20NULL');_0x170c43[_0xb1e2('0x45')]('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x55692e[_0xb1e2('0x45')]('i.OpenchannelAccountId\x20IN\x20?',_[_0xb1e2('0x28')](_0x35a94e,'id'));_0x170c43[_0xb1e2('0x45')](_0xb1e2('0x79'),_[_0xb1e2('0x28')](_0x35a94e,'id'));}});})[_0xb1e2('0x21')](function(){if(_0x15b1ce['user'][_0xb1e2('0x98')]===_0xb1e2('0x9a')&&!_0x513f02&&!_0x15b1ce[_0xb1e2('0x3b')]['OpenchannelAccountId'])return[];return db[_0xb1e2('0x9b')][_0xb1e2('0x3b')](_0x55692e[_0xb1e2('0x9c')](),_0x19e5e1);})[_0xb1e2('0x21')](function(_0x543de2){_0x85668e[_0xb1e2('0x1c')]=_0x543de2[_0xb1e2('0x5f')];if(_0x85668e[_0xb1e2('0x1c')]===0x0)return[];return db[_0xb1e2('0x9b')][_0xb1e2('0x3b')](_0x1d4bb3[_0xb1e2('0x9c')](),_0x19e5e1)['then'](function(_0x2c2420){_0x1aff3f=_['keyBy'](_0x2c2420,'id');_0x19e5e1=_[_0xb1e2('0x9d')](_0x19e5e1,{'model':db[_0xb1e2('0x37')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x15b1ce[_0xb1e2('0x3b')][_0xb1e2('0x41')]){_0x518162[_0xb1e2('0x40')][_0xb1e2('0x2d')](function(_0x45b3e8){_0x170c43[_0xb1e2('0x48')]('i.'+_0x45b3e8);});}else{_0x170c43[_0xb1e2('0x48')](_0xb1e2('0x90'),'unreadMessages');_0x170c43['field']('a.key','Account.key');_0x170c43[_0xb1e2('0x48')](_0xb1e2('0x9e'),'Account.mandatoryDisposition');_0x170c43[_0xb1e2('0x48')]('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',_0xb1e2('0x9f'));_0x170c43['field'](_0xb1e2('0xa0'));_0x170c43[_0xb1e2('0x48')](_0xb1e2('0xa1'),_0xb1e2('0xa2'));_0x170c43['field'](_0xb1e2('0xa3'),_0xb1e2('0xa4'));_0x170c43[_0xb1e2('0x48')](_0xb1e2('0xa5'),'Contact.email');_0x170c43[_0xb1e2('0x48')](_0xb1e2('0xa6'),_0xb1e2('0xa7'));_0x170c43[_0xb1e2('0x48')](_0xb1e2('0xa8'),_0xb1e2('0xa9'));_0x170c43[_0xb1e2('0x48')](_0xb1e2('0xaa'),'Contact.fax');_0x170c43['field'](_0xb1e2('0xab'),_0xb1e2('0xac'));_0x170c43[_0xb1e2('0x48')](_0xb1e2('0xad'),'Owner.internal');_0x170c43['field'](_0xb1e2('0xae'),_0xb1e2('0x2b'));}if(_0x518162['limit'])_0x170c43[_0xb1e2('0x1b')](_0x518162[_0xb1e2('0x1b')]);if(_0x518162[_0xb1e2('0x19')])_0x170c43[_0xb1e2('0x19')](_0x518162[_0xb1e2('0x19')]);return db[_0xb1e2('0x9b')][_0xb1e2('0x3b')](_0x170c43['toString'](),_0x19e5e1);})[_0xb1e2('0x21')](function(_0x2c21ef){if(_0x2c21ef['length']>0x0)_0x582092['where'](_0xb1e2('0xaf'),_['map'](_0x2c21ef,'id'));return db[_0xb1e2('0x9b')][_0xb1e2('0x3b')](_0x582092[_0xb1e2('0x9c')](),_0x19e5e1)[_0xb1e2('0x21')](function(_0x5e74c2){var _0x318fe4=_[_0xb1e2('0xb0')](_0x5e74c2,_0xb1e2('0xb1'));var _0x260b6d=[];_0x2c21ef[_0xb1e2('0x2d')](function(_0x28ebbf){_0x260b6d[_0xb1e2('0xb2')](updateOpenchannelInteraction(_0x28ebbf,_0x1aff3f,_0x318fe4));});return BPromise[_0xb1e2('0xb3')](_0x260b6d);});});})[_0xb1e2('0x21')](function(_0x1f5b26){_0x85668e['rows']=_0x1f5b26;return _0x85668e;})[_0xb1e2('0x21')](respondWithFilteredResult(_0x48f916,_0x518162))[_0xb1e2('0x2e')](handleError(_0x48f916,null));};exports[_0xb1e2('0xb4')]=function(_0x4cb73c,_0x544f5f){var _0x54cc27={};if(_0x4cb73c['query'][_0xb1e2('0x3a')]&&_0x4cb73c['query'][_0xb1e2('0x3a')]===_0xb1e2('0x4a')){_0x54cc27['from']=_0x4cb73c[_0xb1e2('0xb5')]['id'];}else{_0x54cc27['id']=_0x4cb73c[_0xb1e2('0xb5')]['id'];}var _0x2c0331={'raw':![],'where':_0x54cc27},_0x17a019={};_0x17a019[_0xb1e2('0x3f')]=_[_0xb1e2('0x3c')](db[_0xb1e2('0x37')][_0xb1e2('0x38')]);_0x17a019[_0xb1e2('0x3b')]=_[_0xb1e2('0x3c')](_0x4cb73c[_0xb1e2('0x3b')]);_0x17a019[_0xb1e2('0x3d')]=_[_0xb1e2('0x3e')](_0x17a019['model'],_0x17a019['query']);_0x2c0331[_0xb1e2('0x40')]=_[_0xb1e2('0x3e')](_0x17a019[_0xb1e2('0x3f')],qs[_0xb1e2('0x41')](_0x4cb73c[_0xb1e2('0x3b')][_0xb1e2('0x41')]));_0x2c0331[_0xb1e2('0x40')]=_0x2c0331[_0xb1e2('0x40')]['length']?_0x2c0331['attributes']:_0x17a019['model'];if(_0x4cb73c['query']['includeAll']){_0x2c0331[_0xb1e2('0xb6')]=[{'all':!![]}];}_0x2c0331=_['merge']({},_0x2c0331,_0x4cb73c['options']);return db[_0xb1e2('0x37')][_0xb1e2('0x60')](_0x2c0331)['then'](handleEntityNotFound(_0x544f5f,null))[_0xb1e2('0x21')](respondWithResult(_0x544f5f,null))[_0xb1e2('0x2e')](handleError(_0x544f5f,null));};exports[_0xb1e2('0xb7')]=function(_0x24dd2e,_0x27205e){return db[_0xb1e2('0x37')][_0xb1e2('0xb7')](_0x24dd2e[_0xb1e2('0x75')],{})[_0xb1e2('0x21')](respondWithResult(_0x27205e,0xc9))['catch'](handleError(_0x27205e,null));};exports[_0xb1e2('0xb8')]=function(_0x43d914,_0x575f34){if(_0x43d914[_0xb1e2('0x75')]['id']){delete _0x43d914[_0xb1e2('0x75')]['id'];}return db[_0xb1e2('0x37')][_0xb1e2('0x60')]({'where':{'id':_0x43d914['params']['id']}})['then'](handleEntityNotFound(_0x575f34,null))['then'](saveUpdates(_0x43d914[_0xb1e2('0x75')],null))[_0xb1e2('0x21')](respondWithResult(_0x575f34,null))[_0xb1e2('0x2e')](handleError(_0x575f34,null));};exports[_0xb1e2('0x22')]=function(_0x50b7dd,_0x498155){return db[_0xb1e2('0x37')][_0xb1e2('0x60')]({'where':{'id':_0x50b7dd[_0xb1e2('0xb5')]['id']}})[_0xb1e2('0x21')](handleEntityNotFound(_0x498155,null))[_0xb1e2('0x21')](removeEntity(_0x498155,null))['catch'](handleError(_0x498155,null));};exports['describe']=function(_0x207717,_0x55e9ba){return db[_0xb1e2('0x37')][_0xb1e2('0xb9')]()[_0xb1e2('0x21')](respondWithResult(_0x55e9ba,null))[_0xb1e2('0x2e')](handleError(_0x55e9ba,null));};exports[_0xb1e2('0xba')]=function(_0x682152,_0x3f6def,_0x400e80){return db['OpenchannelMessage'][_0xb1e2('0x60')]({'where':{'id':_0x682152[_0xb1e2('0xb5')]['id']}})['then'](handleEntityNotFound(_0x3f6def,null))[_0xb1e2('0x21')](function(_0x1fb765){if(_0x1fb765){return _0x1fb765[_0xb1e2('0xba')](_0x682152[_0xb1e2('0x75')][_0xb1e2('0xbb')],_[_0xb1e2('0xbc')](_0x682152[_0xb1e2('0x75')],[_0xb1e2('0xbb'),'id'])||{});}})['then'](respondWithResult(_0x3f6def,null))[_0xb1e2('0x2e')](handleError(_0x3f6def,null));};exports[_0xb1e2('0xbd')]=function(_0x3fa9c3,_0x471817,_0x542935){var _0x3c4a92={'raw':![],'where':{}};var _0x23b6e8={};var _0x3d59f6={'count':0x0,'rows':[]};return db[_0xb1e2('0x37')]['findOne']({'where':{'id':_0x3fa9c3[_0xb1e2('0xb5')]['id']}})[_0xb1e2('0x21')](handleEntityNotFound(_0x471817,null))[_0xb1e2('0x21')](function(_0x1672e8){if(_0x1672e8){_0x23b6e8[_0xb1e2('0x3f')]=_[_0xb1e2('0x3c')](db[_0xb1e2('0xbe')]['rawAttributes']);_0x23b6e8['query']=_[_0xb1e2('0x3c')](_0x3fa9c3[_0xb1e2('0x3b')]);_0x23b6e8[_0xb1e2('0x3d')]=_[_0xb1e2('0x3e')](_0x23b6e8[_0xb1e2('0x3f')],_0x23b6e8[_0xb1e2('0x3b')]);_0x3c4a92[_0xb1e2('0x40')]=_[_0xb1e2('0x3e')](_0x23b6e8[_0xb1e2('0x3f')],qs[_0xb1e2('0x41')](_0x3fa9c3[_0xb1e2('0x3b')][_0xb1e2('0x41')]));_0x3c4a92['attributes']=_0x3c4a92[_0xb1e2('0x40')][_0xb1e2('0x5f')]?_0x3c4a92['attributes']:_0x23b6e8['model'];if(!_0x3fa9c3[_0xb1e2('0x3b')]['hasOwnProperty'](_0xb1e2('0x43'))){_0x3c4a92[_0xb1e2('0x1b')]=qs[_0xb1e2('0x1b')](_0x3fa9c3['query'][_0xb1e2('0x1b')]);_0x3c4a92[_0xb1e2('0x19')]=qs['offset'](_0x3fa9c3[_0xb1e2('0x3b')][_0xb1e2('0x19')]);}_0x3c4a92['order']=qs[_0xb1e2('0x44')](_0x3fa9c3['query'][_0xb1e2('0x44')]);_0x3c4a92[_0xb1e2('0x45')]=qs[_0xb1e2('0x3d')](_['pick'](_0x3fa9c3[_0xb1e2('0x3b')],_0x23b6e8[_0xb1e2('0x3d')]));_0x3c4a92[_0xb1e2('0x45')]['OpenchannelInteractionId']=_0x1672e8['id'];if(_0x3fa9c3['query'][_0xb1e2('0x85')]){_0x3c4a92['where']=_[_0xb1e2('0x9d')](_0x3c4a92['where'],{'$or':_[_0xb1e2('0x28')](_0x3c4a92['attributes'],function(_0x3be53d){var _0x50f1a6={};_0x50f1a6[_0x3be53d]={'$like':'%'+_0x3fa9c3[_0xb1e2('0x3b')][_0xb1e2('0x85')]+'%'};return _0x50f1a6;})});}if(_0x3fa9c3[_0xb1e2('0x3b')][_0xb1e2('0xbf')]){var _0x2fa4e8=_0x3fa9c3[_0xb1e2('0x3b')][_0xb1e2('0xbf')]['split'](',');var _0x92cab8={};_0x92cab8[_0x2fa4e8[0x0]]={'$gte':moment(_0x2fa4e8[0x1])[_0xb1e2('0xc0')](_0xb1e2('0xc1'))};_0x3c4a92[_0xb1e2('0x45')]=_['merge'](_0x3c4a92[_0xb1e2('0x45')],_0x92cab8);}_0x3c4a92=_[_0xb1e2('0x9d')]({},_0x3c4a92,_0x3fa9c3[_0xb1e2('0xc2')]);return db[_0xb1e2('0xbe')][_0xb1e2('0x1c')]({'where':_0x3c4a92[_0xb1e2('0x45')]})[_0xb1e2('0x21')](function(_0x50efb2){_0x3d59f6[_0xb1e2('0x1c')]=_0x50efb2;if(_0x3fa9c3[_0xb1e2('0x3b')]['includeAll']){_0x3c4a92[_0xb1e2('0xb6')]=[{'all':!![]}];}return db[_0xb1e2('0xbe')]['findAll'](_0x3c4a92);})[_0xb1e2('0x21')](function(_0x56e64c){_0x3d59f6[_0xb1e2('0xc3')]=_0x56e64c;return _0x3d59f6;});}})[_0xb1e2('0x21')](respondWithFilteredResult(_0x471817,_0x3c4a92))[_0xb1e2('0x2e')](handleError(_0x471817,null));};exports['addTags']=function(_0x52e25f,_0x55ceea,_0x2d39ab){return db[_0xb1e2('0x37')]['find']({'where':{'id':_0x52e25f[_0xb1e2('0xb5')]['id']}})[_0xb1e2('0x21')](handleEntityNotFound(_0x55ceea,null))[_0xb1e2('0x21')](function(_0x44ea6f){if(_0x44ea6f){return _0x44ea6f[_0xb1e2('0xc4')](_0x52e25f[_0xb1e2('0x75')][_0xb1e2('0xbb')],_[_0xb1e2('0xbc')](_0x52e25f[_0xb1e2('0x75')],[_0xb1e2('0xbb'),'id'])||{})[_0xb1e2('0xc5')](function(){return db[_0xb1e2('0x6e')][_0xb1e2('0xc6')]({'attributes':['id',_0xb1e2('0x25'),_0xb1e2('0x49')],'where':{'id':_0x52e25f[_0xb1e2('0x75')]['ids']}});})['then'](function(_0x38935d){socket['emit']('openchannelInteractionTags:save',{'id':Number(_0x52e25f[_0xb1e2('0xb5')]['id']),'tags':_0x38935d||[]});return{'id':Number(_0x52e25f[_0xb1e2('0xb5')]['id']),'tags':_0x38935d||[]};});}})['then'](respondWithResult(_0x55ceea,null))['catch'](handleError(_0x55ceea,null));};exports[_0xb1e2('0xc7')]=function(_0xbccd2a,_0x9b9c8e,_0x792ada){return db[_0xb1e2('0x37')]['find']({'where':{'id':_0xbccd2a[_0xb1e2('0xb5')]['id']}})['then'](handleEntityNotFound(_0x9b9c8e,null))[_0xb1e2('0x21')](function(_0x204b5a){if(_0x204b5a){return _0x204b5a[_0xb1e2('0xc7')](_0xbccd2a[_0xb1e2('0x3b')][_0xb1e2('0xbb')]);}})[_0xb1e2('0x21')](respondWithStatusCode(_0x9b9c8e,null))[_0xb1e2('0x2e')](handleError(_0x9b9c8e,null));};exports['download']=function(_0x4b2153,_0x1538d9){var _0x3382f3=moment()[_0xb1e2('0xc8')]()[_0xb1e2('0x9c')]();var _0x530e1a=path[_0xb1e2('0xc9')](config[_0xb1e2('0xca')],_0xb1e2('0xcb'),_0xb1e2('0xcc'),_0xb1e2('0xcd'));var _0x1982d6=path['join'](config[_0xb1e2('0xca')],'server','files',_0xb1e2('0xce'));var _0x38ed4a=path[_0xb1e2('0xc9')](_0x530e1a,_0x3382f3);var _0x1840f4=util[_0xb1e2('0xc0')]('transcript-%d-%s.zip',_0x4b2153[_0xb1e2('0xb5')]['id'],_0x3382f3);var _0x278b0d=path[_0xb1e2('0xc9')](_0x530e1a,_0x1840f4);var _0x3e1cd0=[];_0x3e1cd0[_0xb1e2('0xb2')]({'model':db['User'],'as':_0xb1e2('0x71'),'attributes':['id',_0xb1e2('0x29')],'raw':!![]});_0x3e1cd0['push']({'model':db[_0xb1e2('0xcf')],'as':_0xb1e2('0x66'),'attributes':['id',_0xb1e2('0xd0'),_0xb1e2('0xd1')],'raw':!![]});if(_0x4b2153[_0xb1e2('0x3b')]['attachments']){_0x3e1cd0['push']({'model':db['Attachment'],'as':_0xb1e2('0xd2'),'raw':!![]});}var _0x42f62c=[{'model':db['OpenchannelMessage'],'as':'Messages','attributes':['id',_0xb1e2('0x75'),_0xb1e2('0x7b'),'direction','secret','read'],'include':_0x3e1cd0}];_0x42f62c[_0xb1e2('0xb2')]({'model':db[_0xb1e2('0xd3')],'as':_0xb1e2('0xd4'),'attributes':['id','name']});_0x42f62c['push']({'model':db[_0xb1e2('0x71')],'as':_0xb1e2('0xd5'),'attributes':['id',_0xb1e2('0x29')]});return db[_0xb1e2('0x37')][_0xb1e2('0x60')]({'where':{'id':_0x4b2153['params']['id']},'include':_0x42f62c})[_0xb1e2('0x21')](handleEntityNotFound(_0x1538d9,null))[_0xb1e2('0x21')](function(_0x4c3d5c){if(_0x4c3d5c){var _0x136e5a=_0x4c3d5c['get']({'plain':!![]});fs['mkdirSync'](_0x38ed4a);var _0x483ebe={'channel':_0xb1e2('0xd6'),'account':_0x136e5a[_0xb1e2('0xd4')][_0xb1e2('0x25')],'agent':_0x136e5a[_0xb1e2('0xd5')]?_0x136e5a[_0xb1e2('0xd5')][_0xb1e2('0x29')]:_0xb1e2('0xd7'),'createdAt':moment(_0x136e5a[_0xb1e2('0x7b')])[_0xb1e2('0xc0')]('YYYY-MM-DD\x20HH:mm:ss')[_0xb1e2('0x9c')](),'closedAt':_0x136e5a[_0xb1e2('0x33')]?moment(_0x136e5a[_0xb1e2('0xd8')])[_0xb1e2('0xc0')](_0xb1e2('0xc1'))[_0xb1e2('0x9c')]():'','disposition':_0x136e5a['disposition'],'visibility':_0x136e5a[_0xb1e2('0xd9')]?_0xb1e2('0xda'):'Private','messages':_(_0x136e5a['Messages'])[_0xb1e2('0x85')]({'secret':![]})['map'](function(_0x1081bb){if(_0x1081bb[_0xb1e2('0xd2')]){var _0x299b0c=path[_0xb1e2('0xc9')](_0x1982d6,_0x1081bb['Attachment'][_0xb1e2('0xdb')]);if(fs[_0xb1e2('0xdc')](_0x299b0c)){fs[_0xb1e2('0xdd')](_0x299b0c)['pipe'](fs[_0xb1e2('0xde')](path[_0xb1e2('0xc9')](_0x38ed4a,_0x1081bb[_0xb1e2('0xd2')][_0xb1e2('0xdb')])));}}return{'date':moment(_0x1081bb['createdAt'])[_0xb1e2('0xc0')](_0xb1e2('0xc1'))[_0xb1e2('0x9c')](),'sender':_0x1081bb[_0xb1e2('0xdf')]==='out'?_0x1081bb[_0xb1e2('0x71')]?_0x1081bb[_0xb1e2('0x71')]['fullname']:_0xb1e2('0xe0'):_0x1081bb['Contact'][_0xb1e2('0xd0')]+(_0x1081bb['Contact'][_0xb1e2('0xd1')]?'\x20'+_0x1081bb['Contact'][_0xb1e2('0xd1')]:''),'body':_0x1081bb[_0xb1e2('0xd2')]?_0x1081bb[_0xb1e2('0xd2')][_0xb1e2('0xdb')]:_0x1081bb['body'],'direction':_0x1081bb[_0xb1e2('0xdf')]===_0xb1e2('0xe1')?'A':'C','secret':_0x1081bb[_0xb1e2('0xe2')],'read':_0x1081bb[_0xb1e2('0x80')],'attachment':_0x1081bb[_0xb1e2('0xd2')]};})[_0xb1e2('0x62')]()};return ejs[_0xb1e2('0xe3')](path['join'](config[_0xb1e2('0xca')],_0xb1e2('0xcb'),_0xb1e2('0xe4'),_0xb1e2('0xe5')),{'interaction':_0x483ebe})['then'](function(_0x150c5b){var _0x35a9d4=path['join'](_0x38ed4a,'transcript-'+_0x136e5a['id']+'-'+_0x3382f3+_0xb1e2('0xe6'));var _0x5b2dd9={'path':_0x35a9d4,'channel':_0xb1e2('0xd6'),'interactionId':_0x136e5a['id']};return pdf[_0xb1e2('0xe7')](_0x150c5b,_0x5b2dd9);})[_0xb1e2('0x21')](function(){return new BPromise(function(_0x4d3bf8,_0x92d74){zipdir(_0x38ed4a,{'saveTo':_0x278b0d},function(_0x252904,_0x1da92e){if(_0x252904)return _0x92d74(_0x252904);return _0x4d3bf8(_0x1da92e);});})[_0xb1e2('0x21')](function(){return new BPromise(function(_0x1a607e,_0x43cdbb){rimraf(_0x38ed4a,function(_0x13ec5f){if(_0x13ec5f)_0x43cdbb(_0x13ec5f);return _0x1a607e();});});})[_0xb1e2('0x21')](function(){return _0x1538d9[_0xb1e2('0xe8')](_0x278b0d,_0x1840f4,function(_0x1df0ab){if(_0x1df0ab){console[_0xb1e2('0xe9')](_0xb1e2('0xea'),_0x1df0ab);}else{fs[_0xb1e2('0xeb')](_0x278b0d);}});});});}else{return _0x1538d9[_0xb1e2('0x17')](0xc8);}})['catch'](handleError(_0x1538d9,null));}; \ No newline at end of file +var _0x1c8b=['answered','unmanaged','total','closed','UserId','talking','waiting','index','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','sort','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','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)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','Tag','User','operator','keys','map','some','compact','where','concat','$gte','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','isEmpty','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','OpenchannelAccountId','sequelize','toString','keyBy','merge','OpenchannelInteraction','a.key','a.mandatoryDisposition','Account.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.email','Contact.email','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','push','all','rows','params','includeAll','include','options','create','body','destroy','describe','addMessage','OpenchannelMessage','ids','findOne','filters','nolimit','OpenchannelInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','setTags','omit','spread','emit','removeTags','download','unix','join','root','server','tmp','files','attachments','CmContact','firstName','lastName','Attachment','createdAt','direction','secret','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','N.A.','closedAt','disposition','threadId','Public','Private','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','renderFile','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','fullname','TagIds','Tags','split','forEach','catch'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x1c8b,0x1a9));var _0xb1c8=function(_0x58f73c,_0x1fec70){_0x58f73c=_0x58f73c-0x0;var _0x4878ae=_0x1c8b[_0x58f73c];return _0x4878ae;};'use strict';var emlformat=require(_0xb1c8('0x0'));var rimraf=require(_0xb1c8('0x1'));var zipdir=require(_0xb1c8('0x2'));var jsonpatch=require(_0xb1c8('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb1c8('0x4'));var Mustache=require(_0xb1c8('0x5'));var util=require('util');var path=require(_0xb1c8('0x6'));var sox=require(_0xb1c8('0x7'));var csv=require(_0xb1c8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb1c8('0x9'));var _=require(_0xb1c8('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb1c8('0xb'));var deskjs=require(_0xb1c8('0xc'));var toCsv=require(_0xb1c8('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb1c8('0xd'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xb1c8('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb1c8('0xf'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb1c8('0x10'));var db=require(_0xb1c8('0x11'))['db'];config[_0xb1c8('0x12')]=_['defaults'](config['redis'],{'host':_0xb1c8('0x13'),'port':0x18eb});var socket=require(_0xb1c8('0x14'))(new Redis(config[_0xb1c8('0x12')]));require(_0xb1c8('0x15'))[_0xb1c8('0x16')](socket);function respondWithStatusCode(_0xfaa709,_0x74ee39){_0x74ee39=_0x74ee39||0xcc;return function(_0xb09185){if(_0xb09185){return _0xfaa709[_0xb1c8('0x17')](_0x74ee39);}return _0xfaa709[_0xb1c8('0x18')](_0x74ee39)[_0xb1c8('0x19')]();};}function respondWithResult(_0x134c83,_0x1ef12f){_0x1ef12f=_0x1ef12f||0xc8;return function(_0x537716){if(_0x537716){return _0x134c83['status'](_0x1ef12f)[_0xb1c8('0x1a')](_0x537716);}};}function respondWithFilteredResult(_0x1d4180,_0x55c7fe){return function(_0x147975){if(_0x147975){var _0x3959a8=typeof _0x55c7fe[_0xb1c8('0x1b')]===_0xb1c8('0x1c')&&typeof _0x55c7fe[_0xb1c8('0x1d')]==='undefined';var _0x340a16=_0x147975[_0xb1c8('0x1e')];var _0x29e75c=_0x3959a8?0x0:_0x55c7fe['offset'];var _0x35b04b=_0x3959a8?_0x147975[_0xb1c8('0x1e')]:_0x55c7fe[_0xb1c8('0x1b')]+_0x55c7fe[_0xb1c8('0x1d')];var _0x12d1a5;if(_0x35b04b>=_0x340a16){_0x35b04b=_0x340a16;_0x12d1a5=0xc8;}else{_0x12d1a5=0xce;}_0x1d4180['status'](_0x12d1a5);return _0x1d4180['set'](_0xb1c8('0x1f'),_0x29e75c+'-'+_0x35b04b+'/'+_0x340a16)[_0xb1c8('0x1a')](_0x147975);}return null;};}function patchUpdates(_0x37b686){return function(_0x34eb2b){try{jsonpatch[_0xb1c8('0x20')](_0x34eb2b,_0x37b686,!![]);}catch(_0x1a2632){return BPromise[_0xb1c8('0x21')](_0x1a2632);}return _0x34eb2b[_0xb1c8('0x22')]();};}function saveUpdates(_0x42a810,_0xf36b65){return function(_0x421d1d){if(_0x421d1d){return _0x421d1d[_0xb1c8('0x23')](_0x42a810)[_0xb1c8('0x24')](function(_0x46b4ee){return _0x46b4ee;});}return null;};}function removeEntity(_0x253daa,_0x444b04){return function(_0x1c2af8){if(_0x1c2af8){return _0x1c2af8['destroy']()[_0xb1c8('0x24')](function(){_0x253daa['status'](0xcc)[_0xb1c8('0x19')]();});}};}function handleEntityNotFound(_0x5e5406,_0xb236fc){return function(_0x60829b){if(!_0x60829b){_0x5e5406[_0xb1c8('0x17')](0x194);}return _0x60829b;};}function handleError(_0x33aae3,_0x20cb6a){_0x20cb6a=_0x20cb6a||0x1f4;return function(_0x3403e2){logger[_0xb1c8('0x25')](_0x3403e2[_0xb1c8('0x26')]);if(_0x3403e2['name']){delete _0x3403e2[_0xb1c8('0x27')];}_0x33aae3[_0xb1c8('0x18')](_0x20cb6a)[_0xb1c8('0x28')](_0x3403e2);};}function getInteractionUsers(_0xd48004,_0x106a56){return new BPromise(function(_0x3f317f,_0x3068b9){try{if(_0x106a56[_0xd48004['id']]){_0xd48004['Users']=_['map'](_0x106a56[_0xd48004['id']],function(_0x31ef89){return{'id':_0x31ef89['id'],'fullname':_0x31ef89[_0xb1c8('0x29')]};});}}catch(_0x5b8ce6){_0x3068b9(_0x5b8ce6);}_0x3f317f(_0xd48004);});}function getInteractionTags(_0x1f0e5d,_0x532820){return new BPromise(function(_0x5ee104,_0x5015dd){try{if(_0x1f0e5d[_0xb1c8('0x2a')]){_0x1f0e5d[_0xb1c8('0x2b')]=[];_0x1f0e5d[_0xb1c8('0x2a')][_0xb1c8('0x2c')](',')[_0xb1c8('0x2d')](function(_0x433769){_0x1f0e5d['Tags']['push'](_0x532820[_0x433769]);});}delete _0x1f0e5d[_0xb1c8('0x2a')];}catch(_0x4abb0d){_0x5015dd(_0x4abb0d);}_0x5ee104(_0x1f0e5d);});}function updateOpenchannelInteraction(_0x3a09ae,_0x459a7d,_0x382f8c){return new BPromise(function(_0x4d4bbc,_0x4b33ee){return getInteractionUsers(_0x3a09ae,_0x382f8c)['then'](function(_0x311e98){return getInteractionTags(_0x311e98,_0x459a7d);})['then'](function(_0x4b8316){return getStateInteraction(_0x4b8316);})['then'](function(_0x23ac8b){_0x4d4bbc(_0x23ac8b);})[_0xb1c8('0x2e')](function(_0x191800){_0x4b33ee(_0x191800);});});}function getStateInteraction(_0x475fa2){return new BPromise(function(_0x2a2228){_0x475fa2['waiting']=0x0;_0x475fa2['talking']=0x0;_0x475fa2[_0xb1c8('0x2f')]=0x0;_0x475fa2[_0xb1c8('0x30')]=0x0;_0x475fa2[_0xb1c8('0x31')]=0x0;if(!_0x475fa2[_0xb1c8('0x32')]&&!_0x475fa2[_0xb1c8('0x33')]){_0x475fa2['waiting']+=0x1;}if(!_0x475fa2[_0xb1c8('0x32')]&&_0x475fa2[_0xb1c8('0x33')]){_0x475fa2[_0xb1c8('0x34')]+=0x1;if(_0x475fa2['waiting']){_0x475fa2['waiting']-=0x1;}}if(_0x475fa2[_0xb1c8('0x32')]&&_0x475fa2[_0xb1c8('0x33')]){_0x475fa2[_0xb1c8('0x2f')]+=0x1;if(_0x475fa2[_0xb1c8('0x34')]){_0x475fa2[_0xb1c8('0x34')]-=0x1;}}if(_0x475fa2['closed']&&!_0x475fa2[_0xb1c8('0x33')]){_0x475fa2[_0xb1c8('0x30')]+=0x1;if(_0x475fa2[_0xb1c8('0x35')]){_0x475fa2[_0xb1c8('0x35')]-=0x1;}}_0x475fa2['total']+=0x1;_0x2a2228(_0x475fa2);});}exports[_0xb1c8('0x36')]=function(_0x11eb1c,_0x5cb99f){var _0x1db0a7={},_0x3d2d77={},_0x532df6={'count':0x0,'rows':[]};var _0x1b00a0=_['map'](db['OpenchannelInteraction'][_0xb1c8('0x37')],function(_0x219f26){return{'name':_0x219f26[_0xb1c8('0x38')],'type':_0x219f26[_0xb1c8('0x39')][_0xb1c8('0x3a')]};});_0x3d2d77[_0xb1c8('0x3b')]=_['map'](_0x1b00a0,_0xb1c8('0x27'));_0x3d2d77[_0xb1c8('0x3c')]=_['keys'](_0x11eb1c[_0xb1c8('0x3c')]);_0x3d2d77['filters']=_[_0xb1c8('0x3d')](_0x3d2d77[_0xb1c8('0x3b')],_0x3d2d77[_0xb1c8('0x3c')]);_0x1db0a7[_0xb1c8('0x3e')]=_[_0xb1c8('0x3d')](_0x3d2d77['model'],qs[_0xb1c8('0x3f')](_0x11eb1c[_0xb1c8('0x3c')][_0xb1c8('0x3f')]));_0x1db0a7[_0xb1c8('0x3e')]=_0x1db0a7[_0xb1c8('0x3e')][_0xb1c8('0x40')]?_0x1db0a7[_0xb1c8('0x3e')]:_0x3d2d77[_0xb1c8('0x3b')];if(!_0x11eb1c[_0xb1c8('0x3c')]['hasOwnProperty']('nolimit')){_0x1db0a7[_0xb1c8('0x1d')]=qs[_0xb1c8('0x1d')](_0x11eb1c[_0xb1c8('0x3c')][_0xb1c8('0x1d')]);_0x1db0a7[_0xb1c8('0x1b')]=qs[_0xb1c8('0x1b')](_0x11eb1c[_0xb1c8('0x3c')][_0xb1c8('0x1b')]);}_0x1db0a7['order']=qs[_0xb1c8('0x41')](_0x11eb1c[_0xb1c8('0x3c')][_0xb1c8('0x41')]);_0x1db0a7['where']=qs['filters'](_[_0xb1c8('0x42')](_0x11eb1c[_0xb1c8('0x3c')],_0x3d2d77['filters']),_0x1b00a0);var _0x5c07a1=[];var _0x2b23e1=squel[_0xb1c8('0x43')]()[_0xb1c8('0x44')]('id')[_0xb1c8('0x44')]('name')[_0xb1c8('0x44')](_0xb1c8('0x45'))[_0xb1c8('0x46')](_0xb1c8('0x47'));var _0x30dedd=squel[_0xb1c8('0x43')]()[_0xb1c8('0x44')](_0xb1c8('0x48'))['field'](_0xb1c8('0x49'))[_0xb1c8('0x44')](_0xb1c8('0x4a'))['from']('user_has_openchannel_interactions','ui')[_0xb1c8('0x4b')](_0xb1c8('0x4c'),'u',_0xb1c8('0x4d'));var _0x4f690d=squel[_0xb1c8('0x43')]()['from'](_0xb1c8('0x4e'),'i')[_0xb1c8('0x4b')](_0xb1c8('0x4f'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xb1c8('0x4b')]('users','o',_0xb1c8('0x50'))[_0xb1c8('0x4b')](_0xb1c8('0x51'),'a',_0xb1c8('0x52'))[_0xb1c8('0x4b')](_0xb1c8('0x53'),'me',_0xb1c8('0x54'))[_0xb1c8('0x4b')]('openchannel_interaction_has_tags','it','it.OpenchannelInteractionId\x20=\x20i.id')['left_join'](_0xb1c8('0x47'),'t',_0xb1c8('0x55'));var _0xdd826d=squel[_0xb1c8('0x56')]();var _0x879ab=[];var _0x44e1cc=squel[_0xb1c8('0x56')]();var _0x87c8d5;if(_0x11eb1c[_0xb1c8('0x3c')][_0xb1c8('0x57')]){_0x87c8d5=as[_0xb1c8('0x58')](_0x11eb1c[_0xb1c8('0x3c')][_0xb1c8('0x57')]);var _0x5131f4=_0x87c8d5[_0xb1c8('0x59')];for(var _0x358f4a=0x0;_0x358f4a<_0x87c8d5[_0xb1c8('0x5a')][_0xb1c8('0x40')];_0x358f4a++){var _0x5e3926=_0x87c8d5[_0xb1c8('0x5a')][_0x358f4a];var _0x40b2e3='i';var _0x188588=_['find'](_0x1b00a0,[_0xb1c8('0x27'),_0x5e3926[_0xb1c8('0x44')]]);if(!_0x188588){switch(_0x5e3926[_0xb1c8('0x44')]){case _0xb1c8('0x5b'):if(_0x5e3926[_0xb1c8('0x5c')]==0x1){_0x4f690d[_0xb1c8('0x5d')]('`'+_0x5e3926[_0xb1c8('0x44')]+_0xb1c8('0x5e'));}else{_0x4f690d[_0xb1c8('0x5d')]('`'+_0x5e3926[_0xb1c8('0x44')]+'`\x20>\x200');}break;case _0xb1c8('0x5f'):if(_0x5e3926['operator']===_0xb1c8('0x60')){if(_0x5e3926[_0xb1c8('0x5c')][_0xb1c8('0x2c')]('\x20')[_0xb1c8('0x40')]>0x1){_0xdd826d[_0x5131f4](_0xb1c8('0x61'),qs[_0xb1c8('0x62')](_0x5e3926[_0xb1c8('0x5c')]),null);}else{var _0x47d6f6='%'+_0x5e3926[_0xb1c8('0x5c')]+'%';_0xdd826d[_0x5131f4](_0xb1c8('0x63'),_0x47d6f6,_0x47d6f6,_0x47d6f6);}}else{_0x188588=_[_0xb1c8('0x64')](_0x1b00a0,['name','ContactId']);_0x5e3926[_0xb1c8('0x44')]=_0xb1c8('0x65');_0x157817=as[_0xb1c8('0x66')](_0x40b2e3,_0x188588[_0xb1c8('0x39')],_0x5e3926);_0xdd826d[_0x5131f4](_0x157817[_0xb1c8('0x67')],_0x157817[_0xb1c8('0x5c')][_0xb1c8('0x68')],_0x157817['value'][_0xb1c8('0x19')]);}break;case _0xb1c8('0x69'):var _0x1e5b24=_0x5e3926['value'][_0xb1c8('0x2c')](',')['map'](function(_0xf777a7){return Number(_0xf777a7);});_0x1e5b24['forEach'](function(_0x300f94){_0x44e1cc['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x300f94+',%');});_0x879ab=_['union'](_0x879ab,_0x1e5b24);break;case _0xb1c8('0x6a'):if(_0x5e3926[_0xb1c8('0x6b')]===_0xb1c8('0x60')){_0xdd826d[_0x5131f4]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x5e3926[_0xb1c8('0x5c')]+'%',null);}else{_0x188588=_[_0xb1c8('0x64')](_0x1b00a0,[_0xb1c8('0x27'),_0xb1c8('0x33')]);_0x5e3926[_0xb1c8('0x44')]=_0xb1c8('0x33');_0x157817=as[_0xb1c8('0x66')](_0x40b2e3,_0x188588['type'],_0x5e3926);_0xdd826d[_0x5131f4](_0x157817[_0xb1c8('0x67')],_0x157817[_0xb1c8('0x5c')]['start'],_0x157817[_0xb1c8('0x5c')][_0xb1c8('0x19')]);}break;case'body':_0x157817=as['buildExpression']('me',null,_0x5e3926);_0xdd826d[_0x5131f4](_0x157817[_0xb1c8('0x67')],_0x157817[_0xb1c8('0x5c')]['start'],_0x157817[_0xb1c8('0x5c')][_0xb1c8('0x19')]);break;}}else{var _0x157817=as[_0xb1c8('0x66')](_0x40b2e3,_0x188588['type'],_0x5e3926);_0xdd826d[_0x5131f4](_0x157817['text'],_0x157817[_0xb1c8('0x5c')]['start'],_0x157817[_0xb1c8('0x5c')][_0xb1c8('0x19')]);}}}else{var _0x290333=_(_0x11eb1c[_0xb1c8('0x3c')])[_0xb1c8('0x6c')]()[_0xb1c8('0x6d')](function(_0x137757){return _[_0xb1c8('0x6e')](_0x1b00a0,['name',_0x137757])?_0x137757:undefined;})[_0xb1c8('0x6f')]()['value']();if(!_['isEmpty'](_0x290333)){_0x290333['forEach'](function(_0x19791b){if(_0x19791b==='OpenchannelAccountId'){_0x4f690d[_0xb1c8('0x70')]('i.OpenchannelAccountId\x20IN\x20?',[][_0xb1c8('0x71')](_0x11eb1c[_0xb1c8('0x3c')][_0x19791b]));}else if(_0x19791b==='createdAt'){var _0x5ebe9d=JSON['parse'](_0x11eb1c[_0xb1c8('0x3c')][_0x19791b])[_0xb1c8('0x72')];var _0x5d6bee=JSON[_0xb1c8('0x73')](_0x11eb1c[_0xb1c8('0x3c')][_0x19791b])['$lte'];_0x4f690d[_0xb1c8('0x70')](_0xb1c8('0x74'),_0x5ebe9d,_0x5d6bee);}else{if(_0x11eb1c['query'][_0x19791b]==='null'){_0x4f690d['where']('i.'+_0x19791b+'\x20IS\x20NULL');}else{_0x4f690d[_0xb1c8('0x70')]('i.'+_0x19791b+_0xb1c8('0x75'),_0x11eb1c[_0xb1c8('0x3c')][_0x19791b]);}}});}if(_0x11eb1c[_0xb1c8('0x3c')][_0xb1c8('0x76')]){if(_0x11eb1c[_0xb1c8('0x3c')]['read']==0x1){_0x4f690d[_0xb1c8('0x5d')](_0xb1c8('0x77'));}else{_0x4f690d[_0xb1c8('0x5d')](_0xb1c8('0x78'));}}if(_0x11eb1c[_0xb1c8('0x3c')]['tag']){_0x879ab=_[_0xb1c8('0x79')](_0x11eb1c[_0xb1c8('0x3c')][_0xb1c8('0x7a')])?_0x11eb1c[_0xb1c8('0x3c')][_0xb1c8('0x7a')]:new Array(_0x11eb1c[_0xb1c8('0x3c')][_0xb1c8('0x7a')]);_0x879ab[_0xb1c8('0x2d')](function(_0x992c6d){_0x44e1cc['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x992c6d+',%');});}if(_0x11eb1c['query']['filter']){var _0x13755c=_0x11eb1c[_0xb1c8('0x3c')][_0xb1c8('0x7b')][_0xb1c8('0x7c')]('\x5c','\x5c\x5c')[_0xb1c8('0x7c')](/'/g,'\x27\x27');if(qs[_0xb1c8('0x7d')](_0x13755c)){_0xdd826d['or'](_0xb1c8('0x7e'),_0x13755c+'%');}else{_0xdd826d['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x13755c))['or'](_0xb1c8('0x7f'),_0x13755c+'%')['or'](_0xb1c8('0x80'),_0x13755c+'%');}}}_0x4f690d[_0xb1c8('0x70')](_0xdd826d);_0x4f690d['group'](_0xb1c8('0x81'));var _0x4a8649={'type':db['Sequelize']['QueryTypes'][_0xb1c8('0x82')],'raw':!![]};var _0x4343fb=_0x4f690d[_0xb1c8('0x83')]();_0x4343fb[_0xb1c8('0x44')]('i.id');_0x4343fb[_0xb1c8('0x44')](_0xb1c8('0x84'),_0xb1c8('0x5b'));if(_0x1db0a7[_0xb1c8('0x85')]){_0x1db0a7[_0xb1c8('0x85')][_0xb1c8('0x2d')](function(_0x17c7d1){var _0x1fd185=_0x17c7d1[0x0]===_0xb1c8('0x86')?_0x17c7d1[0x0]:'i.'+_0x17c7d1[0x0];_0x4f690d[_0xb1c8('0x85')](_0x1fd185,_0x17c7d1[0x1]==='DESC'?![]:!![]);});}if(!_[_0xb1c8('0x87')](_0x879ab)){_0x4f690d['having'](_0x44e1cc);_0x4343fb[_0xb1c8('0x70')](_0xb1c8('0x88'),_0x879ab);}BPromise[_0xb1c8('0x89')]()[_0xb1c8('0x24')](function(){if(!_0x87c8d5){if(_0x11eb1c['query']['OpenchannelAccountId'])return;_0x4343fb[_0xb1c8('0x70')](_0xb1c8('0x8a'));_0x4f690d[_0xb1c8('0x70')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x11eb1c[_0xb1c8('0x8b')][_0xb1c8('0x8c')]!==_0xb1c8('0x8d'))return;return _0x11eb1c['user'][_0xb1c8('0x8e')]({'attributes':['id'],'raw':!![]})[_0xb1c8('0x24')](function(_0x4a7351){if(_[_0xb1c8('0x87')](_0x4a7351)){_0x4343fb['where'](_0xb1c8('0x8f'));_0x4f690d[_0xb1c8('0x70')]('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x4343fb['where']('i.OpenchannelAccountId\x20IN\x20?',_[_0xb1c8('0x6d')](_0x4a7351,'id'));_0x4f690d[_0xb1c8('0x70')](_0xb1c8('0x90'),_['map'](_0x4a7351,'id'));}});})[_0xb1c8('0x24')](function(){if(_0x11eb1c['user']['role']===_0xb1c8('0x8d')&&!_0x87c8d5&&!_0x11eb1c[_0xb1c8('0x3c')][_0xb1c8('0x91')])return[];return db[_0xb1c8('0x92')][_0xb1c8('0x3c')](_0x4343fb[_0xb1c8('0x93')](),_0x4a8649);})[_0xb1c8('0x24')](function(_0x2ff34d){_0x532df6['count']=_0x2ff34d[_0xb1c8('0x40')];if(_0x532df6[_0xb1c8('0x1e')]===0x0)return[];return db[_0xb1c8('0x92')]['query'](_0x2b23e1[_0xb1c8('0x93')](),_0x4a8649)[_0xb1c8('0x24')](function(_0x3030b7){_0x5c07a1=_[_0xb1c8('0x94')](_0x3030b7,'id');_0x4a8649=_[_0xb1c8('0x95')](_0x4a8649,{'model':db[_0xb1c8('0x96')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x11eb1c[_0xb1c8('0x3c')]['fields']){_0x1db0a7[_0xb1c8('0x3e')][_0xb1c8('0x2d')](function(_0x4a5bb7){_0x4f690d[_0xb1c8('0x44')]('i.'+_0x4a5bb7);});}else{_0x4f690d[_0xb1c8('0x44')](_0xb1c8('0x84'),_0xb1c8('0x5b'));_0x4f690d['field'](_0xb1c8('0x97'),'Account.key');_0x4f690d[_0xb1c8('0x44')](_0xb1c8('0x98'),_0xb1c8('0x99'));_0x4f690d[_0xb1c8('0x44')](_0xb1c8('0x9a'),_0xb1c8('0x86'));_0x4f690d[_0xb1c8('0x44')](_0xb1c8('0x9b'));_0x4f690d[_0xb1c8('0x44')](_0xb1c8('0x9c'),'Contact.firstName');_0x4f690d[_0xb1c8('0x44')](_0xb1c8('0x9d'),_0xb1c8('0x9e'));_0x4f690d[_0xb1c8('0x44')](_0xb1c8('0x9f'),_0xb1c8('0xa0'));_0x4f690d[_0xb1c8('0x44')]('c.phone','Contact.phone');_0x4f690d['field']('c.mobile',_0xb1c8('0xa1'));_0x4f690d['field'](_0xb1c8('0xa2'),_0xb1c8('0xa3'));_0x4f690d[_0xb1c8('0x44')](_0xb1c8('0xa4'),'Owner.fullname');_0x4f690d['field'](_0xb1c8('0xa5'),'Owner.internal');_0x4f690d[_0xb1c8('0x44')](_0xb1c8('0xa6'),_0xb1c8('0x2a'));}if(_0x1db0a7[_0xb1c8('0x1d')])_0x4f690d[_0xb1c8('0x1d')](_0x1db0a7['limit']);if(_0x1db0a7[_0xb1c8('0x1b')])_0x4f690d[_0xb1c8('0x1b')](_0x1db0a7['offset']);return db['sequelize'][_0xb1c8('0x3c')](_0x4f690d[_0xb1c8('0x93')](),_0x4a8649);})[_0xb1c8('0x24')](function(_0x4bc217){if(_0x4bc217[_0xb1c8('0x40')]>0x0)_0x30dedd[_0xb1c8('0x70')](_0xb1c8('0xa7'),_[_0xb1c8('0x6d')](_0x4bc217,'id'));return db[_0xb1c8('0x92')]['query'](_0x30dedd[_0xb1c8('0x93')](),_0x4a8649)['then'](function(_0x319cb8){var _0x1d0858=_['groupBy'](_0x319cb8,'OpenchannelInteractionId');var _0x43a971=[];_0x4bc217[_0xb1c8('0x2d')](function(_0xf9cd55){_0x43a971[_0xb1c8('0xa8')](updateOpenchannelInteraction(_0xf9cd55,_0x5c07a1,_0x1d0858));});return BPromise[_0xb1c8('0xa9')](_0x43a971);});});})['then'](function(_0x904b40){_0x532df6[_0xb1c8('0xaa')]=_0x904b40;return _0x532df6;})[_0xb1c8('0x24')](respondWithFilteredResult(_0x5cb99f,_0x1db0a7))[_0xb1c8('0x2e')](handleError(_0x5cb99f,null));};exports['show']=function(_0x512c9c,_0x11a61e){var _0x1e06e3={};if(_0x512c9c['query'][_0xb1c8('0x39')]&&_0x512c9c[_0xb1c8('0x3c')][_0xb1c8('0x39')]===_0xb1c8('0x46')){_0x1e06e3[_0xb1c8('0x46')]=_0x512c9c[_0xb1c8('0xab')]['id'];}else{_0x1e06e3['id']=_0x512c9c[_0xb1c8('0xab')]['id'];}var _0x289fb5={'raw':![],'where':_0x1e06e3},_0x1d1069={};_0x1d1069[_0xb1c8('0x3b')]=_[_0xb1c8('0x6c')](db['OpenchannelInteraction'][_0xb1c8('0x37')]);_0x1d1069[_0xb1c8('0x3c')]=_[_0xb1c8('0x6c')](_0x512c9c['query']);_0x1d1069['filters']=_[_0xb1c8('0x3d')](_0x1d1069[_0xb1c8('0x3b')],_0x1d1069[_0xb1c8('0x3c')]);_0x289fb5[_0xb1c8('0x3e')]=_['intersection'](_0x1d1069[_0xb1c8('0x3b')],qs[_0xb1c8('0x3f')](_0x512c9c[_0xb1c8('0x3c')][_0xb1c8('0x3f')]));_0x289fb5[_0xb1c8('0x3e')]=_0x289fb5[_0xb1c8('0x3e')][_0xb1c8('0x40')]?_0x289fb5[_0xb1c8('0x3e')]:_0x1d1069[_0xb1c8('0x3b')];if(_0x512c9c[_0xb1c8('0x3c')][_0xb1c8('0xac')]){_0x289fb5[_0xb1c8('0xad')]=[{'all':!![]}];}_0x289fb5=_['merge']({},_0x289fb5,_0x512c9c[_0xb1c8('0xae')]);return db[_0xb1c8('0x96')][_0xb1c8('0x64')](_0x289fb5)[_0xb1c8('0x24')](handleEntityNotFound(_0x11a61e,null))[_0xb1c8('0x24')](respondWithResult(_0x11a61e,null))[_0xb1c8('0x2e')](handleError(_0x11a61e,null));};exports[_0xb1c8('0xaf')]=function(_0x68f22,_0x248e0f){return db[_0xb1c8('0x96')]['create'](_0x68f22[_0xb1c8('0xb0')],{})[_0xb1c8('0x24')](respondWithResult(_0x248e0f,0xc9))[_0xb1c8('0x2e')](handleError(_0x248e0f,null));};exports[_0xb1c8('0x23')]=function(_0x69a605,_0x3d0cbe){if(_0x69a605[_0xb1c8('0xb0')]['id']){delete _0x69a605[_0xb1c8('0xb0')]['id'];}return db[_0xb1c8('0x96')][_0xb1c8('0x64')]({'where':{'id':_0x69a605[_0xb1c8('0xab')]['id']}})[_0xb1c8('0x24')](handleEntityNotFound(_0x3d0cbe,null))[_0xb1c8('0x24')](saveUpdates(_0x69a605[_0xb1c8('0xb0')],null))['then'](respondWithResult(_0x3d0cbe,null))['catch'](handleError(_0x3d0cbe,null));};exports[_0xb1c8('0xb1')]=function(_0x10fe7a,_0x374231){return db['OpenchannelInteraction'][_0xb1c8('0x64')]({'where':{'id':_0x10fe7a[_0xb1c8('0xab')]['id']}})[_0xb1c8('0x24')](handleEntityNotFound(_0x374231,null))['then'](removeEntity(_0x374231,null))[_0xb1c8('0x2e')](handleError(_0x374231,null));};exports[_0xb1c8('0xb2')]=function(_0x5c2fff,_0x16ab03){return db[_0xb1c8('0x96')]['describe']()['then'](respondWithResult(_0x16ab03,null))[_0xb1c8('0x2e')](handleError(_0x16ab03,null));};exports[_0xb1c8('0xb3')]=function(_0x2fef3f,_0x55f5cb,_0x39ebae){return db[_0xb1c8('0xb4')]['find']({'where':{'id':_0x2fef3f[_0xb1c8('0xab')]['id']}})[_0xb1c8('0x24')](handleEntityNotFound(_0x55f5cb,null))[_0xb1c8('0x24')](function(_0x5c344d){if(_0x5c344d){return _0x5c344d['addMessage'](_0x2fef3f[_0xb1c8('0xb0')]['ids'],_['omit'](_0x2fef3f[_0xb1c8('0xb0')],[_0xb1c8('0xb5'),'id'])||{});}})[_0xb1c8('0x24')](respondWithResult(_0x55f5cb,null))['catch'](handleError(_0x55f5cb,null));};exports['getMessages']=function(_0x554fb8,_0x37dbc0,_0x156e68){var _0x54bda2={'raw':![],'where':{}};var _0x50a501={};var _0x475196={'count':0x0,'rows':[]};return db[_0xb1c8('0x96')][_0xb1c8('0xb6')]({'where':{'id':_0x554fb8[_0xb1c8('0xab')]['id']}})[_0xb1c8('0x24')](handleEntityNotFound(_0x37dbc0,null))[_0xb1c8('0x24')](function(_0x42feed){if(_0x42feed){_0x50a501[_0xb1c8('0x3b')]=_['keys'](db[_0xb1c8('0xb4')][_0xb1c8('0x37')]);_0x50a501['query']=_['keys'](_0x554fb8[_0xb1c8('0x3c')]);_0x50a501[_0xb1c8('0xb7')]=_[_0xb1c8('0x3d')](_0x50a501['model'],_0x50a501[_0xb1c8('0x3c')]);_0x54bda2[_0xb1c8('0x3e')]=_[_0xb1c8('0x3d')](_0x50a501[_0xb1c8('0x3b')],qs[_0xb1c8('0x3f')](_0x554fb8[_0xb1c8('0x3c')]['fields']));_0x54bda2[_0xb1c8('0x3e')]=_0x54bda2['attributes'][_0xb1c8('0x40')]?_0x54bda2[_0xb1c8('0x3e')]:_0x50a501[_0xb1c8('0x3b')];if(!_0x554fb8['query']['hasOwnProperty'](_0xb1c8('0xb8'))){_0x54bda2[_0xb1c8('0x1d')]=qs['limit'](_0x554fb8[_0xb1c8('0x3c')][_0xb1c8('0x1d')]);_0x54bda2[_0xb1c8('0x1b')]=qs[_0xb1c8('0x1b')](_0x554fb8[_0xb1c8('0x3c')]['offset']);}_0x54bda2[_0xb1c8('0x85')]=qs[_0xb1c8('0x41')](_0x554fb8[_0xb1c8('0x3c')]['sort']);_0x54bda2[_0xb1c8('0x70')]=qs['filters'](_[_0xb1c8('0x42')](_0x554fb8[_0xb1c8('0x3c')],_0x50a501['filters']));_0x54bda2[_0xb1c8('0x70')][_0xb1c8('0xb9')]=_0x42feed['id'];if(_0x554fb8[_0xb1c8('0x3c')][_0xb1c8('0x7b')]){_0x54bda2['where']=_[_0xb1c8('0x95')](_0x54bda2['where'],{'$or':_[_0xb1c8('0x6d')](_0x54bda2[_0xb1c8('0x3e')],function(_0x59a00c){var _0x146376={};_0x146376[_0x59a00c]={'$like':'%'+_0x554fb8[_0xb1c8('0x3c')][_0xb1c8('0x7b')]+'%'};return _0x146376;})});}if(_0x554fb8[_0xb1c8('0x3c')][_0xb1c8('0x72')]){var _0x3bfa7b=_0x554fb8['query'][_0xb1c8('0x72')][_0xb1c8('0x2c')](',');var _0xaa4ada={};_0xaa4ada[_0x3bfa7b[0x0]]={'$gte':moment(_0x3bfa7b[0x1])[_0xb1c8('0xba')](_0xb1c8('0xbb'))};_0x54bda2[_0xb1c8('0x70')]=_[_0xb1c8('0x95')](_0x54bda2[_0xb1c8('0x70')],_0xaa4ada);}_0x54bda2=_['merge']({},_0x54bda2,_0x554fb8[_0xb1c8('0xae')]);return db[_0xb1c8('0xb4')]['count']({'where':_0x54bda2[_0xb1c8('0x70')]})[_0xb1c8('0x24')](function(_0x12275f){_0x475196[_0xb1c8('0x1e')]=_0x12275f;if(_0x554fb8[_0xb1c8('0x3c')][_0xb1c8('0xac')]){_0x54bda2[_0xb1c8('0xad')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0xb1c8('0xbc')](_0x54bda2);})[_0xb1c8('0x24')](function(_0x343947){_0x475196[_0xb1c8('0xaa')]=_0x343947;return _0x475196;});}})['then'](respondWithFilteredResult(_0x37dbc0,_0x54bda2))['catch'](handleError(_0x37dbc0,null));};exports['addTags']=function(_0x2b3392,_0x541525,_0xa58ffe){return db[_0xb1c8('0x96')][_0xb1c8('0x64')]({'where':{'id':_0x2b3392[_0xb1c8('0xab')]['id']}})[_0xb1c8('0x24')](handleEntityNotFound(_0x541525,null))[_0xb1c8('0x24')](function(_0x25d944){if(_0x25d944){return _0x25d944[_0xb1c8('0xbd')](_0x2b3392[_0xb1c8('0xb0')][_0xb1c8('0xb5')],_[_0xb1c8('0xbe')](_0x2b3392['body'],[_0xb1c8('0xb5'),'id'])||{})[_0xb1c8('0xbf')](function(){return db[_0xb1c8('0x69')][_0xb1c8('0xbc')]({'attributes':['id',_0xb1c8('0x27'),_0xb1c8('0x45')],'where':{'id':_0x2b3392[_0xb1c8('0xb0')][_0xb1c8('0xb5')]}});})['then'](function(_0xcd7d88){socket[_0xb1c8('0xc0')]('openchannelInteractionTags:save',{'id':Number(_0x2b3392[_0xb1c8('0xab')]['id']),'tags':_0xcd7d88||[]});return{'id':Number(_0x2b3392[_0xb1c8('0xab')]['id']),'tags':_0xcd7d88||[]};});}})[_0xb1c8('0x24')](respondWithResult(_0x541525,null))[_0xb1c8('0x2e')](handleError(_0x541525,null));};exports[_0xb1c8('0xc1')]=function(_0x49ed06,_0x3cfe7d,_0x178781){return db[_0xb1c8('0x96')]['find']({'where':{'id':_0x49ed06[_0xb1c8('0xab')]['id']}})[_0xb1c8('0x24')](handleEntityNotFound(_0x3cfe7d,null))[_0xb1c8('0x24')](function(_0x2b944a){if(_0x2b944a){return _0x2b944a[_0xb1c8('0xc1')](_0x49ed06['query']['ids']);}})[_0xb1c8('0x24')](respondWithStatusCode(_0x3cfe7d,null))[_0xb1c8('0x2e')](handleError(_0x3cfe7d,null));};exports[_0xb1c8('0xc2')]=function(_0x4044a7,_0x270990){var _0x40298f=moment()[_0xb1c8('0xc3')]()[_0xb1c8('0x93')]();var _0x4f2be7=path[_0xb1c8('0xc4')](config[_0xb1c8('0xc5')],_0xb1c8('0xc6'),'files',_0xb1c8('0xc7'));var _0x53d9a5=path[_0xb1c8('0xc4')](config[_0xb1c8('0xc5')],_0xb1c8('0xc6'),_0xb1c8('0xc8'),_0xb1c8('0xc9'));var _0x40aed1=path[_0xb1c8('0xc4')](_0x4f2be7,_0x40298f);var _0x2f25f5=util[_0xb1c8('0xba')]('transcript-%d-%s.zip',_0x4044a7[_0xb1c8('0xab')]['id'],_0x40298f);var _0x3fb0f5=path[_0xb1c8('0xc4')](_0x4f2be7,_0x2f25f5);var _0x51aafc=[];_0x51aafc[_0xb1c8('0xa8')]({'model':db[_0xb1c8('0x6a')],'as':_0xb1c8('0x6a'),'attributes':['id',_0xb1c8('0x29')],'raw':!![]});_0x51aafc[_0xb1c8('0xa8')]({'model':db[_0xb1c8('0xca')],'as':_0xb1c8('0x5f'),'attributes':['id',_0xb1c8('0xcb'),_0xb1c8('0xcc')],'raw':!![]});if(_0x4044a7[_0xb1c8('0x3c')][_0xb1c8('0xc9')]){_0x51aafc[_0xb1c8('0xa8')]({'model':db[_0xb1c8('0xcd')],'as':_0xb1c8('0xcd'),'raw':!![]});}var _0x3c9a4c=[{'model':db['OpenchannelMessage'],'as':'Messages','attributes':['id',_0xb1c8('0xb0'),_0xb1c8('0xce'),_0xb1c8('0xcf'),_0xb1c8('0xd0'),'read'],'include':_0x51aafc}];_0x3c9a4c[_0xb1c8('0xa8')]({'model':db[_0xb1c8('0xd1')],'as':_0xb1c8('0xd2'),'attributes':['id',_0xb1c8('0x27')]});_0x3c9a4c['push']({'model':db[_0xb1c8('0x6a')],'as':_0xb1c8('0xd3'),'attributes':['id','fullname']});return db['OpenchannelInteraction'][_0xb1c8('0x64')]({'where':{'id':_0x4044a7[_0xb1c8('0xab')]['id']},'include':_0x3c9a4c})[_0xb1c8('0x24')](handleEntityNotFound(_0x270990,null))[_0xb1c8('0x24')](function(_0x16effa){if(_0x16effa){var _0x1feb2e=_0x16effa[_0xb1c8('0xd4')]({'plain':!![]});fs[_0xb1c8('0xd5')](_0x40aed1);var _0x52206d={'channel':_0xb1c8('0xd6'),'account':_0x1feb2e[_0xb1c8('0xd2')][_0xb1c8('0x27')],'agent':_0x1feb2e[_0xb1c8('0xd3')]?_0x1feb2e[_0xb1c8('0xd3')][_0xb1c8('0x29')]:_0xb1c8('0xd7'),'createdAt':moment(_0x1feb2e[_0xb1c8('0xce')])['format'](_0xb1c8('0xbb'))[_0xb1c8('0x93')](),'closedAt':_0x1feb2e[_0xb1c8('0x32')]?moment(_0x1feb2e[_0xb1c8('0xd8')])['format'](_0xb1c8('0xbb'))[_0xb1c8('0x93')]():'','disposition':_0x1feb2e[_0xb1c8('0xd9')],'visibility':_0x1feb2e[_0xb1c8('0xda')]?_0xb1c8('0xdb'):_0xb1c8('0xdc'),'messages':_(_0x1feb2e[_0xb1c8('0xdd')])[_0xb1c8('0x7b')]({'secret':![]})['map'](function(_0x35a762){if(_0x35a762['Attachment']){var _0x4dce2b=path[_0xb1c8('0xc4')](_0x53d9a5,_0x35a762[_0xb1c8('0xcd')][_0xb1c8('0xde')]);if(fs[_0xb1c8('0xdf')](_0x4dce2b)){fs[_0xb1c8('0xe0')](_0x4dce2b)[_0xb1c8('0xe1')](fs[_0xb1c8('0xe2')](path['join'](_0x40aed1,_0x35a762[_0xb1c8('0xcd')]['basename'])));}}return{'date':moment(_0x35a762[_0xb1c8('0xce')])[_0xb1c8('0xba')](_0xb1c8('0xbb'))[_0xb1c8('0x93')](),'sender':_0x35a762[_0xb1c8('0xcf')]===_0xb1c8('0xe3')?_0x35a762[_0xb1c8('0x6a')]?_0x35a762[_0xb1c8('0x6a')]['fullname']:_0xb1c8('0xe4'):_0x35a762[_0xb1c8('0x5f')][_0xb1c8('0xcb')]+(_0x35a762[_0xb1c8('0x5f')][_0xb1c8('0xcc')]?'\x20'+_0x35a762['Contact'][_0xb1c8('0xcc')]:''),'body':_0x35a762[_0xb1c8('0xcd')]?_0x35a762[_0xb1c8('0xcd')][_0xb1c8('0xde')]:_0x35a762['body'],'direction':_0x35a762[_0xb1c8('0xcf')]==='out'?'A':'C','secret':_0x35a762[_0xb1c8('0xd0')],'read':_0x35a762['read'],'attachment':_0x35a762[_0xb1c8('0xcd')]};})[_0xb1c8('0x5c')]()};return ejs[_0xb1c8('0xe5')](path[_0xb1c8('0xc4')](config[_0xb1c8('0xc5')],'server','views',_0xb1c8('0xe6')),{'interaction':_0x52206d})[_0xb1c8('0x24')](function(_0x25119f){var _0x26a668=path[_0xb1c8('0xc4')](_0x40aed1,'transcript-'+_0x1feb2e['id']+'-'+_0x40298f+_0xb1c8('0xe7'));var _0x38716b={'path':_0x26a668,'channel':_0xb1c8('0xd6'),'interactionId':_0x1feb2e['id']};return pdf[_0xb1c8('0xe8')](_0x25119f,_0x38716b);})[_0xb1c8('0x24')](function(){return new BPromise(function(_0x18a09c,_0x340ad2){zipdir(_0x40aed1,{'saveTo':_0x3fb0f5},function(_0x1797e3,_0x45d62d){if(_0x1797e3)return _0x340ad2(_0x1797e3);return _0x18a09c(_0x45d62d);});})[_0xb1c8('0x24')](function(){return new BPromise(function(_0x4ef41a,_0x28a1a7){rimraf(_0x40aed1,function(_0x2d1775){if(_0x2d1775)_0x28a1a7(_0x2d1775);return _0x4ef41a();});});})[_0xb1c8('0x24')](function(){return _0x270990[_0xb1c8('0xc2')](_0x3fb0f5,_0x2f25f5,function(_0x8564d4){if(_0x8564d4){console[_0xb1c8('0xe9')](_0xb1c8('0xea'),_0x8564d4);}else{fs[_0xb1c8('0xeb')](_0x3fb0f5);}});});});}else{return _0x270990[_0xb1c8('0x17')](0xc8);}})[_0xb1c8('0x2e')](handleError(_0x270990,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 4ae0f89..6d3fc06 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 _0x4e96=['catch','hasOwnProperty','hook','exports','../../mysqldb','OpenchannelInteraction','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit'];(function(_0x1f6216,_0x1c26d7){var _0x29bd28=function(_0xdf42b9){while(--_0xdf42b9){_0x1f6216['push'](_0x1f6216['shift']());}};_0x29bd28(++_0x1c26d7);}(_0x4e96,0xca));var _0x64e9=function(_0x15930e,_0x33812b){_0x15930e=_0x15930e-0x0;var _0x36093a=_0x4e96[_0x15930e];return _0x36093a;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x64e9('0x0'))['db'][_0x64e9('0x1')];var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x64e9('0x2'),'afterUpdate':_0x64e9('0x3'),'afterDestroy':_0x64e9('0x4')};function emitEvent(_0x26739b){return function(_0x469ac8,_0x3df358,_0x121847){_0x469ac8[_0x64e9('0x5')]({'attributes':['id'],'raw':!![]})[_0x64e9('0x6')](function(_0x4ca28f){_0x469ac8[_0x64e9('0x7')](_0x64e9('0x8'),_0x4ca28f[_0x64e9('0x9')](function(_0x39d83e){return{'id':_0x39d83e['id']};}));return OpenchannelMessage[_0x64e9('0xa')]({'where':{'OpenchannelInteractionId':_0x469ac8['id'],'direction':'in','read':![]},'raw':!![]});})[_0x64e9('0x6')](function(_0x1271f9){_0x469ac8[_0x64e9('0x7')](_0x64e9('0xb'),_0x1271f9[_0x64e9('0xc')]);OpenchannelInteractionEvents[_0x64e9('0xd')](_0x26739b+':'+_0x469ac8['id'],_0x469ac8);OpenchannelInteractionEvents['emit'](_0x26739b,_0x469ac8);_0x121847(null);})[_0x64e9('0xe')](_0x121847(null));};}for(var e in events){if(events[_0x64e9('0xf')](e)){var event=events[e];OpenchannelInteraction[_0x64e9('0x10')](e,emitEvent(event));}}module[_0x64e9('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0xec54=['then','setDataValue','Users','map','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelMessage','remove','getUsers'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xec54,0x1db));var _0x4ec5=function(_0x1ecd75,_0x481fa8){_0x1ecd75=_0x1ecd75-0x0;var _0x5067c7=_0xec54[_0x1ecd75];return _0x5067c7;};'use strict';var EventEmitter=require(_0x4ec5('0x0'));var OpenchannelInteraction=require(_0x4ec5('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x4ec5('0x1'))['db'][_0x4ec5('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x4ec5('0x3')};function emitEvent(_0x2f67a6){return function(_0xd61377,_0x177dc4,_0x41fab2){_0xd61377[_0x4ec5('0x4')]({'attributes':['id'],'raw':!![]})[_0x4ec5('0x5')](function(_0x1e1fab){_0xd61377[_0x4ec5('0x6')](_0x4ec5('0x7'),_0x1e1fab[_0x4ec5('0x8')](function(_0x350139){return{'id':_0x350139['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0xd61377['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4ec5('0x5')](function(_0x3c8d13){_0xd61377['setDataValue'](_0x4ec5('0x9'),_0x3c8d13[_0x4ec5('0xa')]);OpenchannelInteractionEvents['emit'](_0x2f67a6+':'+_0xd61377['id'],_0xd61377);OpenchannelInteractionEvents[_0x4ec5('0xb')](_0x2f67a6,_0xd61377);_0x41fab2(null);})[_0x4ec5('0xc')](_0x41fab2(null));};}for(var e in events){if(events[_0x4ec5('0xd')](e)){var event=events[e];OpenchannelInteraction[_0x4ec5('0xe')](e,emitEvent(event));}}module[_0x4ec5('0xf')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 5ac7ea9..1d76951 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 _0xd70d=['../../config/logger','api','bluebird','request-promise','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x549b36,_0x380f1c){var _0x5bbc26=function(_0x4a4ede){while(--_0x4a4ede){_0x549b36['push'](_0x549b36['shift']());}};_0x5bbc26(++_0x380f1c);}(_0xd70d,0x100));var _0xdd70=function(_0x47af57,_0x271c1d){_0x47af57=_0x47af57-0x0;var _0x75d96e=_0xd70d[_0x47af57];return _0x75d96e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdd70('0x0'))(_0xdd70('0x1'));var moment=require('moment');var BPromise=require(_0xdd70('0x2'));var rp=require(_0xdd70('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdd70('0x4'));var attributes=require(_0xdd70('0x5'));module[_0xdd70('0x6')]=function(_0x4d74c5,_0x293bed){return _0x4d74c5[_0xdd70('0x7')](_0xdd70('0x8'),attributes,{'tableName':_0xdd70('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdd70('0xa'),'collate':_0xdd70('0xb'),'hooks':{'beforeUpdate':function(_0xdf8cd8,_0x4cb200,_0x31b99a){if(_0xdf8cd8[_0xdd70('0xc')]('closed')){_0xdf8cd8[_0xdd70('0xd')]=moment()[_0xdd70('0xe')](_0xdd70('0xf'));}_0x31b99a(null,_0xdf8cd8);}}});}; \ No newline at end of file +var _0xd0a8=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','closedAt','format','lodash','../../config/logger','api'];(function(_0x31e2b2,_0x1abd64){var _0x3c6837=function(_0x4830f5){while(--_0x4830f5){_0x31e2b2['push'](_0x31e2b2['shift']());}};_0x3c6837(++_0x1abd64);}(_0xd0a8,0x14d));var _0x8d0a=function(_0x89e140,_0x5eaa7e){_0x89e140=_0x89e140-0x0;var _0x13e437=_0xd0a8[_0x89e140];return _0x13e437;};'use strict';var _=require(_0x8d0a('0x0'));var util=require('util');var logger=require(_0x8d0a('0x1'))(_0x8d0a('0x2'));var moment=require(_0x8d0a('0x3'));var BPromise=require(_0x8d0a('0x4'));var rp=require(_0x8d0a('0x5'));var fs=require('fs');var path=require(_0x8d0a('0x6'));var rimraf=require(_0x8d0a('0x7'));var config=require(_0x8d0a('0x8'));var attributes=require(_0x8d0a('0x9'));module['exports']=function(_0xd9f646,_0x15d669){return _0xd9f646[_0x8d0a('0xa')](_0x8d0a('0xb'),attributes,{'tableName':_0x8d0a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8d0a('0xd'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x74837f,_0x30796c,_0x45035c){if(_0x74837f['changed']('closed')){_0x74837f[_0x8d0a('0xe')]=moment()[_0x8d0a('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x45035c(null,_0x74837f);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 6763686..a9d2dd0 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 _0x1756=['options','raw','where','attributes','limit','AddTagsToOpenchannelInteraction','find','then','addTags','ids','omit','spread','AddTags','lodash','bluebird','ioredis','../../config/utils','rpc','jayson/promise','http','redis','defaults','localhost','./openchannelInteraction.socket','request','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body'];(function(_0x1e8599,_0x2ff22f){var _0x4cd6bf=function(_0x43fa99){while(--_0x43fa99){_0x1e8599['push'](_0x1e8599['shift']());}};_0x4cd6bf(++_0x2ff22f);}(_0x1756,0xfd));var _0x6175=function(_0x124af4,_0x390f70){_0x124af4=_0x124af4-0x0;var _0x4a20cf=_0x1756[_0x124af4];return _0x4a20cf;};'use strict';var _=require(_0x6175('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6175('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6175('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x6175('0x3'));var logger=require('../../config/logger')(_0x6175('0x4'));var config=require('../../config/environment');var jayson=require(_0x6175('0x5'));var client=jayson['client'][_0x6175('0x6')]({'port':0x232a});config[_0x6175('0x7')]=_[_0x6175('0x8')](config[_0x6175('0x7')],{'host':_0x6175('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6175('0x7')]));require(_0x6175('0xa'))['register'](socket);function respondWithRpcPromise(_0x24db82,_0x2cf19b,_0x2ef1a5){return new BPromise(function(_0x37dc66,_0x234d45){return client[_0x6175('0xb')](_0x24db82,_0x2ef1a5)['then'](function(_0x522ee9){logger[_0x6175('0xc')](_0x6175('0xd'),_0x2cf19b,_0x6175('0xe'));logger[_0x6175('0xf')](_0x6175('0x10'),_0x2cf19b,_0x6175('0xe'),JSON[_0x6175('0x11')](_0x522ee9));if(_0x522ee9[_0x6175('0x12')]){if(_0x522ee9[_0x6175('0x12')][_0x6175('0x13')]===0x1f4){logger['error'](_0x6175('0xd'),_0x2cf19b,_0x522ee9[_0x6175('0x12')]['message']);return _0x234d45(_0x522ee9[_0x6175('0x12')][_0x6175('0x14')]);}logger['error'](_0x6175('0xd'),_0x2cf19b,_0x522ee9['error'][_0x6175('0x14')]);return _0x37dc66(_0x522ee9[_0x6175('0x12')][_0x6175('0x14')]);}else{logger[_0x6175('0xc')](_0x6175('0xd'),_0x2cf19b,_0x6175('0xe'));_0x37dc66(_0x522ee9[_0x6175('0x15')][_0x6175('0x14')]);}})[_0x6175('0x16')](function(_0x4e3bfc){logger[_0x6175('0x12')](_0x6175('0xd'),_0x2cf19b,_0x4e3bfc);_0x234d45(_0x4e3bfc);});});}exports[_0x6175('0x17')]=function(_0x2c1617){var _0x101327=this;return new Promise(function(_0x4b5cbb,_0x10714d){return db[_0x6175('0x18')][_0x6175('0x19')](_0x2c1617[_0x6175('0x1a')],{'raw':_0x2c1617[_0x6175('0x1b')]?_0x2c1617[_0x6175('0x1b')][_0x6175('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c1617[_0x6175('0x1b')]?_0x2c1617['options'][_0x6175('0x1d')]||null:null,'attributes':_0x2c1617[_0x6175('0x1b')]?_0x2c1617[_0x6175('0x1b')][_0x6175('0x1e')]||null:null,'limit':_0x2c1617['options']?_0x2c1617[_0x6175('0x1b')][_0x6175('0x1f')]||null:null})['then'](function(_0x5aad91){logger[_0x6175('0xc')](_0x6175('0x17'),_0x2c1617);logger[_0x6175('0xf')](_0x6175('0x17'),_0x2c1617,JSON[_0x6175('0x11')](_0x5aad91));_0x4b5cbb(_0x5aad91);})[_0x6175('0x16')](function(_0x13c08d){logger[_0x6175('0x12')](_0x6175('0x17'),_0x13c08d[_0x6175('0x14')],_0x2c1617);_0x10714d(_0x101327[_0x6175('0x12')](0x1f4,_0x13c08d['message']));});});};exports[_0x6175('0x20')]=function(_0x567656){return new Promise(function(_0x4d9c8e,_0x3504a7){return db[_0x6175('0x18')][_0x6175('0x21')]({'where':_0x567656[_0x6175('0x1b')]?_0x567656['options'][_0x6175('0x1d')]||null:null})[_0x6175('0x22')](function(_0x192054){if(_0x192054){return _0x192054[_0x6175('0x23')](_0x567656['body'][_0x6175('0x24')],_[_0x6175('0x25')](_0x567656[_0x6175('0x1a')],[_0x6175('0x24'),'id'])||{});}})[_0x6175('0x26')](function(_0x198baf){logger[_0x6175('0xc')](_0x6175('0x27'),_0x567656);logger['debug'](_0x6175('0x27'),_0x567656,JSON[_0x6175('0x11')](_0x198baf));_0x4d9c8e(_0x198baf);})[_0x6175('0x16')](function(_0x22cc33){logger[_0x6175('0x12')](_0x6175('0x27'),_0x22cc33[_0x6175('0x14')],_0x567656);_0x3504a7(_this[_0x6175('0x12')](0x1f4,_0x22cc33[_0x6175('0x14')]));});});}; \ No newline at end of file +var _0x009e=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','OpenchannelInteraction,\x20%s,\x20%s','message','result','catch','OpenchannelInteraction','body','options','raw','where','info','debug','AddTagsToOpenchannelInteraction','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x54ebbb,_0x2c7983){var _0x210b1e=function(_0x42f74f){while(--_0x42f74f){_0x54ebbb['push'](_0x54ebbb['shift']());}};_0x210b1e(++_0x2c7983);}(_0x009e,0x17c));var _0xe009=function(_0x102b09,_0x4521f0){_0x102b09=_0x102b09-0x0;var _0x3e68d1=_0x009e[_0x102b09];return _0x3e68d1;};'use strict';var _=require(_0xe009('0x0'));var util=require(_0xe009('0x1'));var moment=require(_0xe009('0x2'));var BPromise=require(_0xe009('0x3'));var rs=require(_0xe009('0x4'));var fs=require('fs');var Redis=require(_0xe009('0x5'));var db=require(_0xe009('0x6'))['db'];var utils=require(_0xe009('0x7'));var logger=require(_0xe009('0x8'))(_0xe009('0x9'));var config=require(_0xe009('0xa'));var jayson=require(_0xe009('0xb'));var client=jayson[_0xe009('0xc')][_0xe009('0xd')]({'port':0x232a});config[_0xe009('0xe')]=_[_0xe009('0xf')](config[_0xe009('0xe')],{'host':_0xe009('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe009('0xe')]));require('./openchannelInteraction.socket')[_0xe009('0x11')](socket);function respondWithRpcPromise(_0x3d872c,_0x345917,_0x12f073){return new BPromise(function(_0x23f7f9,_0x167884){return client[_0xe009('0x12')](_0x3d872c,_0x12f073)[_0xe009('0x13')](function(_0x5f32e9){logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x345917,'request\x20sent');logger['debug'](_0xe009('0x14'),_0x345917,_0xe009('0x15'),JSON[_0xe009('0x16')](_0x5f32e9));if(_0x5f32e9[_0xe009('0x17')]){if(_0x5f32e9[_0xe009('0x17')]['code']===0x1f4){logger[_0xe009('0x17')](_0xe009('0x18'),_0x345917,_0x5f32e9[_0xe009('0x17')][_0xe009('0x19')]);return _0x167884(_0x5f32e9['error']['message']);}logger[_0xe009('0x17')](_0xe009('0x18'),_0x345917,_0x5f32e9[_0xe009('0x17')][_0xe009('0x19')]);return _0x23f7f9(_0x5f32e9[_0xe009('0x17')][_0xe009('0x19')]);}else{logger['info'](_0xe009('0x18'),_0x345917,_0xe009('0x15'));_0x23f7f9(_0x5f32e9[_0xe009('0x1a')][_0xe009('0x19')]);}})[_0xe009('0x1b')](function(_0x5cbc15){logger[_0xe009('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x345917,_0x5cbc15);_0x167884(_0x5cbc15);});});}exports['UpdateOpenchannelInteraction']=function(_0x399dfa){var _0x68481b=this;return new Promise(function(_0x11ae06,_0x352458){return db[_0xe009('0x1c')]['update'](_0x399dfa[_0xe009('0x1d')],{'raw':_0x399dfa['options']?_0x399dfa[_0xe009('0x1e')][_0xe009('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x399dfa[_0xe009('0x1e')]?_0x399dfa[_0xe009('0x1e')][_0xe009('0x20')]||null:null,'attributes':_0x399dfa[_0xe009('0x1e')]?_0x399dfa[_0xe009('0x1e')]['attributes']||null:null,'limit':_0x399dfa[_0xe009('0x1e')]?_0x399dfa[_0xe009('0x1e')]['limit']||null:null})['then'](function(_0x4434bb){logger[_0xe009('0x21')]('UpdateOpenchannelInteraction',_0x399dfa);logger[_0xe009('0x22')]('UpdateOpenchannelInteraction',_0x399dfa,JSON[_0xe009('0x16')](_0x4434bb));_0x11ae06(_0x4434bb);})[_0xe009('0x1b')](function(_0x426d06){logger[_0xe009('0x17')]('UpdateOpenchannelInteraction',_0x426d06[_0xe009('0x19')],_0x399dfa);_0x352458(_0x68481b[_0xe009('0x17')](0x1f4,_0x426d06[_0xe009('0x19')]));});});};exports[_0xe009('0x23')]=function(_0x45ec49){return new Promise(function(_0x14a96c,_0x5e2b2c){return db[_0xe009('0x1c')]['find']({'where':_0x45ec49[_0xe009('0x1e')]?_0x45ec49[_0xe009('0x1e')][_0xe009('0x20')]||null:null})[_0xe009('0x13')](function(_0x578bca){if(_0x578bca){return _0x578bca['addTags'](_0x45ec49[_0xe009('0x1d')][_0xe009('0x24')],_['omit'](_0x45ec49[_0xe009('0x1d')],['ids','id'])||{});}})[_0xe009('0x25')](function(_0x543123){logger[_0xe009('0x21')]('AddTags',_0x45ec49);logger[_0xe009('0x22')](_0xe009('0x26'),_0x45ec49,JSON[_0xe009('0x16')](_0x543123));_0x14a96c(_0x543123);})[_0xe009('0x1b')](function(_0x34aefc){logger['error'](_0xe009('0x26'),_0x34aefc[_0xe009('0x19')],_0x45ec49);_0x5e2b2c(_this[_0xe009('0x17')](0x1f4,_0x34aefc[_0xe009('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 7e566a1..0b92d07 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 _0x1deb=['removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events','save','remove','update'];(function(_0x1883a5,_0x483139){var _0x2af944=function(_0x1706be){while(--_0x1706be){_0x1883a5['push'](_0x1883a5['shift']());}};_0x2af944(++_0x483139);}(_0x1deb,0xb4));var _0xb1de=function(_0x515d6a,_0x4ae3e6){_0x515d6a=_0x515d6a-0x0;var _0x3587d2=_0x1deb[_0x515d6a];return _0x3587d2;};'use strict';var OpenchannelInteractionEvents=require(_0xb1de('0x0'));var events=[_0xb1de('0x1'),_0xb1de('0x2'),_0xb1de('0x3')];function createListener(_0x224cea,_0xabcd4){return function(_0x1b4b7c){_0xabcd4['emit'](_0x224cea,_0x1b4b7c);};}function removeListener(_0x3db8d2,_0x45469a){return function(){OpenchannelInteractionEvents[_0xb1de('0x4')](_0x3db8d2,_0x45469a);};}exports[_0xb1de('0x5')]=function(_0x52482a){for(var _0x4142a1=0x0,_0x59ac3c=events[_0xb1de('0x6')];_0x4142a1<_0x59ac3c;_0x4142a1++){var _0x2bf470=events[_0x4142a1];var _0x404c54=createListener(_0xb1de('0x7')+_0x2bf470,_0x52482a);OpenchannelInteractionEvents['on'](_0x2bf470,_0x404c54);}}; \ No newline at end of file +var _0x8aeb=['emit','removeListener','openchannelInteraction:','./openchannelInteraction.events','save','remove','update'];(function(_0x25e877,_0x109071){var _0x72818b=function(_0x4b7f62){while(--_0x4b7f62){_0x25e877['push'](_0x25e877['shift']());}};_0x72818b(++_0x109071);}(_0x8aeb,0x176));var _0xb8ae=function(_0x49c68e,_0x1c1673){_0x49c68e=_0x49c68e-0x0;var _0x33032b=_0x8aeb[_0x49c68e];return _0x33032b;};'use strict';var OpenchannelInteractionEvents=require(_0xb8ae('0x0'));var events=[_0xb8ae('0x1'),_0xb8ae('0x2'),_0xb8ae('0x3')];function createListener(_0x351fcb,_0x30b29e){return function(_0x1dbee3){_0x30b29e[_0xb8ae('0x4')](_0x351fcb,_0x1dbee3);};}function removeListener(_0x53045c,_0x14640a){return function(){OpenchannelInteractionEvents[_0xb8ae('0x5')](_0x53045c,_0x14640a);};}exports['register']=function(_0x3c1c06){for(var _0x360864=0x0,_0x335c28=events['length'];_0x360864<_0x335c28;_0x360864++){var _0x5da7a9=events[_0x360864];var _0x52bd6f=createListener(_0xb8ae('0x6')+_0x5da7a9,_0x3c1c06);OpenchannelInteractionEvents['on'](_0x5da7a9,_0x52bd6f);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 6f06ef8..0645d19 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 _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','create','update','put','/:id/accept','accept','/:id/reject','exports','multer','util','path','express','Router'];(function(_0x1a18f8,_0x44efac){var _0x160963=function(_0x1fb979){while(--_0x1fb979){_0x1a18f8['push'](_0x1a18f8['shift']());}};_0x160963(++_0x44efac);}(_0xe706,0xa3));var _0x6e70=function(_0x1d1d09,_0x504d77){_0x1d1d09=_0x1d1d09-0x0;var _0x8827e=_0xe706[_0x1d1d09];return _0x8827e;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),interaction[_0x6e70('0x12')](_0x6e70('0x13'),_0x6e70('0x14')),controller[_0x6e70('0x15')]);router['put']('/:id',auth[_0x6e70('0xb')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x17')](_0x6e70('0x18'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x19')]);router[_0x6e70('0x17')](_0x6e70('0x1a'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0x6e70('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x6e70('0x1b')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util'];(function(_0x45911d,_0x25b782){var _0x387de2=function(_0x148819){while(--_0x148819){_0x45911d['push'](_0x45911d['shift']());}};_0x387de2(++_0x25b782);}(_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('./openchannelMessage.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')](),interaction[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x0d8b('0x10')),controller['create']);router[_0x0d8b('0x11')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x11')](_0x0d8b('0x13'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x14')]);router[_0x0d8b('0x11')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x16')]);router[_0x0d8b('0x17')](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x18')]);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 3348c49..d0a05f9 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 _0x1123=['TEXT','BOOLEAN','ENUM','DATE','STRING'];(function(_0x51c0f0,_0xd76a2){var _0x228dac=function(_0x46ada3){while(--_0x46ada3){_0x51c0f0['push'](_0x51c0f0['shift']());}};_0x228dac(++_0xd76a2);}(_0x1123,0x118));var _0x3112=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x1123[_0x1cc8fe];return _0x230054;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x3112('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x3112('0x1')],'defaultValue':![]},'secret':{'type':Sequelize[_0x3112('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3112('0x2')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x3112('0x3')]},'providerName':{'type':Sequelize[_0x3112('0x4')]},'providerResponse':{'type':Sequelize[_0x3112('0x0')]}}; \ No newline at end of file +var _0x153c=['BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports','TEXT','medium'];(function(_0x242802,_0xa81f5){var _0x1bf679=function(_0x4de38f){while(--_0x4de38f){_0x242802['push'](_0x242802['shift']());}};_0x1bf679(++_0xa81f5);}(_0x153c,0x8c));var _0xc153=function(_0x556778,_0x466d31){_0x556778=_0x556778-0x0;var _0x1cd080=_0x153c[_0x556778];return _0x1cd080;};'use strict';var Sequelize=require(_0xc153('0x0'));module[_0xc153('0x1')]={'body':{'type':Sequelize[_0xc153('0x2')](_0xc153('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xc153('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc153('0x5')]('in',_0xc153('0x6')),'defaultValue':_0xc153('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xc153('0x7')]},'providerName':{'type':Sequelize[_0xc153('0x8')]},'providerResponse':{'type':Sequelize[_0xc153('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index e56f61d..506f560 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 _0xef8a=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','./openchannelMessage.socket','jayson/promise','client','http','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','OpenchannelMessage','rawAttributes','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','map','merge','options','includeAll','findAll','rows','show','keys','include','find','create','body','params','describe','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','role','interaction','stringify','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','channel','motionChannel','event','EventManager','openchannel-interactions','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','Sequelize','interface','SIP/%s','rejectmessage','eml-format','rimraf','zip-dir','bluebird','mustache','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0xa02f96,_0x303195){var _0x4b15f4=function(_0x213992){while(--_0x213992){_0xa02f96['push'](_0xa02f96['shift']());}};_0x4b15f4(++_0x303195);}(_0xef8a,0xed));var _0xaef8=function(_0x4b6778,_0x505a76){_0x4b6778=_0x4b6778-0x0;var _0x22dbb9=_0xef8a[_0x4b6778];return _0x22dbb9;};'use strict';var emlformat=require(_0xaef8('0x0'));var rimraf=require(_0xaef8('0x1'));var zipdir=require(_0xaef8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xaef8('0x3'));var Mustache=require(_0xaef8('0x4'));var util=require('util');var path=require('path');var sox=require(_0xaef8('0x5'));var csv=require(_0xaef8('0x6'));var ejs=require(_0xaef8('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaef8('0x8'));var squel=require(_0xaef8('0x9'));var crypto=require('crypto');var jsforce=require(_0xaef8('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xaef8('0x6'));var querystring=require(_0xaef8('0xb'));var Papa=require(_0xaef8('0xc'));var Redis=require(_0xaef8('0xd'));var authService=require(_0xaef8('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xaef8('0xf'));var hardwareService=require(_0xaef8('0x10'));var logger=require(_0xaef8('0x11'))(_0xaef8('0x12'));var utils=require(_0xaef8('0x13'));var config=require(_0xaef8('0x14'));var licenseUtil=require(_0xaef8('0x15'));var db=require(_0xaef8('0x16'))['db'];config[_0xaef8('0x17')]=_['defaults'](config[_0xaef8('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaef8('0x17')]));require(_0xaef8('0x18'))['register'](socket);var jayson=require(_0xaef8('0x19'));var client=jayson[_0xaef8('0x1a')][_0xaef8('0x1b')]({'port':0x232c});var client9002=jayson[_0xaef8('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e9967,_0x30d4ba,_0x30557a,_0x2aba76){return new BPromise(function(_0x197d2b,_0x3a033a){var _0x404921=_0x2aba76||client;return _0x404921['request'](_0x5e9967,_0x30557a)[_0xaef8('0x1c')](function(_0x2b5e63){logger[_0xaef8('0x1d')]('OpenchannelMessage,\x20%s,\x20%s',_0x30d4ba,_0xaef8('0x1e'));logger[_0xaef8('0x1f')](_0xaef8('0x20'),_0x30d4ba,_0xaef8('0x1e'),JSON['stringify'](_0x2b5e63));if(_0x2b5e63[_0xaef8('0x21')]){if(_0x2b5e63[_0xaef8('0x21')][_0xaef8('0x22')]===0x1f4){logger[_0xaef8('0x21')](_0xaef8('0x23'),_0x30d4ba,_0x2b5e63['error']['message']);return _0x3a033a(_0x2b5e63[_0xaef8('0x21')][_0xaef8('0x24')]);}logger[_0xaef8('0x21')](_0xaef8('0x23'),_0x30d4ba,_0x2b5e63[_0xaef8('0x21')][_0xaef8('0x24')]);return _0x197d2b(_0x2b5e63['error'][_0xaef8('0x24')]);}else{logger[_0xaef8('0x1d')](_0xaef8('0x23'),_0x30d4ba,_0xaef8('0x1e'));_0x197d2b(_0x2b5e63[_0xaef8('0x25')]['message']);}})[_0xaef8('0x26')](function(_0x275401){logger[_0xaef8('0x21')](_0xaef8('0x23'),_0x30d4ba,_0x275401);_0x3a033a(_0x275401);});});}function respondWithStatusCode(_0x31cc46,_0x340a00){_0x340a00=_0x340a00||0xcc;return function(_0x193531){if(_0x193531){return _0x31cc46[_0xaef8('0x27')](_0x340a00);}return _0x31cc46[_0xaef8('0x28')](_0x340a00)[_0xaef8('0x29')]();};}function respondWithResult(_0x25c425,_0x2c0920){_0x2c0920=_0x2c0920||0xc8;return function(_0x32e5eb){if(_0x32e5eb){return _0x25c425[_0xaef8('0x28')](_0x2c0920)[_0xaef8('0x2a')](_0x32e5eb);}};}function respondWithFilteredResult(_0x51defd,_0x260c9f){return function(_0x1d90c9){if(_0x1d90c9){var _0x50cbb4=typeof _0x260c9f['offset']==='undefined'&&typeof _0x260c9f[_0xaef8('0x2b')]===_0xaef8('0x2c');var _0x33ac08=_0x1d90c9[_0xaef8('0x2d')];var _0x59331e=_0x50cbb4?0x0:_0x260c9f[_0xaef8('0x2e')];var _0x3dc841=_0x50cbb4?_0x1d90c9['count']:_0x260c9f[_0xaef8('0x2e')]+_0x260c9f[_0xaef8('0x2b')];var _0x5bc546;if(_0x3dc841>=_0x33ac08){_0x3dc841=_0x33ac08;_0x5bc546=0xc8;}else{_0x5bc546=0xce;}_0x51defd['status'](_0x5bc546);return _0x51defd[_0xaef8('0x2f')](_0xaef8('0x30'),_0x59331e+'-'+_0x3dc841+'/'+_0x33ac08)['json'](_0x1d90c9);}return null;};}function patchUpdates(_0x5acec4){return function(_0x3c8a9c){try{jsonpatch[_0xaef8('0x31')](_0x3c8a9c,_0x5acec4,!![]);}catch(_0x3dcae5){return BPromise[_0xaef8('0x32')](_0x3dcae5);}return _0x3c8a9c[_0xaef8('0x33')]();};}function saveUpdates(_0x5595b1,_0x57494c){return function(_0x35ff56){if(_0x35ff56){return _0x35ff56[_0xaef8('0x34')](_0x5595b1)[_0xaef8('0x1c')](function(_0x1e442e){return _0x1e442e;});}return null;};}function removeEntity(_0x541804,_0x1bb863){return function(_0x3a1a3d){if(_0x3a1a3d){return _0x3a1a3d[_0xaef8('0x35')]()[_0xaef8('0x1c')](function(){_0x541804[_0xaef8('0x28')](0xcc)[_0xaef8('0x29')]();});}};}function handleEntityNotFound(_0x301c37,_0xcfe93){return function(_0x80dbe1){if(!_0x80dbe1){_0x301c37[_0xaef8('0x27')](0x194);}return _0x80dbe1;};}function handleError(_0x45afd3,_0x3ca673){_0x3ca673=_0x3ca673||0x1f4;return function(_0xcd2b3e){logger[_0xaef8('0x21')](_0xcd2b3e[_0xaef8('0x36')]);if(_0xcd2b3e[_0xaef8('0x37')]){delete _0xcd2b3e[_0xaef8('0x37')];}_0x45afd3[_0xaef8('0x28')](_0x3ca673)[_0xaef8('0x38')](_0xcd2b3e);};}exports[_0xaef8('0x39')]=function(_0x11cd37,_0x5530eb){var _0x29ed10={},_0x301480={},_0x5179b9={'count':0x0,'rows':[]};var _0xe5969f=_['map'](db[_0xaef8('0x3a')][_0xaef8('0x3b')],function(_0x3ba5dd){return{'name':_0x3ba5dd['fieldName'],'type':_0x3ba5dd[_0xaef8('0x3c')]['key']};});_0x301480[_0xaef8('0x3d')]=_['map'](_0xe5969f,_0xaef8('0x37'));_0x301480[_0xaef8('0x3e')]=_['keys'](_0x11cd37[_0xaef8('0x3e')]);_0x301480['filters']=_[_0xaef8('0x3f')](_0x301480[_0xaef8('0x3d')],_0x301480[_0xaef8('0x3e')]);_0x29ed10[_0xaef8('0x40')]=_[_0xaef8('0x3f')](_0x301480[_0xaef8('0x3d')],qs['fields'](_0x11cd37[_0xaef8('0x3e')][_0xaef8('0x41')]));_0x29ed10[_0xaef8('0x40')]=_0x29ed10['attributes'][_0xaef8('0x42')]?_0x29ed10[_0xaef8('0x40')]:_0x301480[_0xaef8('0x3d')];if(!_0x11cd37[_0xaef8('0x3e')][_0xaef8('0x43')](_0xaef8('0x44'))){_0x29ed10[_0xaef8('0x2b')]=qs['limit'](_0x11cd37[_0xaef8('0x3e')][_0xaef8('0x2b')]);_0x29ed10['offset']=qs['offset'](_0x11cd37[_0xaef8('0x3e')][_0xaef8('0x2e')]);}_0x29ed10['order']=qs['sort'](_0x11cd37[_0xaef8('0x3e')][_0xaef8('0x45')]);_0x29ed10[_0xaef8('0x46')]=qs[_0xaef8('0x47')](_['pick'](_0x11cd37[_0xaef8('0x3e')],_0x301480['filters']),_0xe5969f);if(_0x11cd37[_0xaef8('0x3e')][_0xaef8('0x48')]){_0x29ed10['where']=_['merge'](_0x29ed10[_0xaef8('0x46')],{'$or':_[_0xaef8('0x49')](_0xe5969f,function(_0x58f176){if(_0x58f176[_0xaef8('0x3c')]!=='VIRTUAL'){var _0xf2ed31={};_0xf2ed31[_0x58f176['name']]={'$like':'%'+_0x11cd37['query']['filter']+'%'};return _0xf2ed31;}})});}_0x29ed10=_[_0xaef8('0x4a')]({},_0x29ed10,_0x11cd37[_0xaef8('0x4b')]);var _0x950a5f={'where':_0x29ed10[_0xaef8('0x46')]};return db[_0xaef8('0x3a')]['count'](_0x950a5f)[_0xaef8('0x1c')](function(_0xc64ff1){_0x5179b9[_0xaef8('0x2d')]=_0xc64ff1;if(_0x11cd37[_0xaef8('0x3e')][_0xaef8('0x4c')]){_0x29ed10['include']=[{'all':!![]}];}return db[_0xaef8('0x3a')][_0xaef8('0x4d')](_0x29ed10);})[_0xaef8('0x1c')](function(_0x25377a){_0x5179b9[_0xaef8('0x4e')]=_0x25377a;return _0x5179b9;})[_0xaef8('0x1c')](respondWithFilteredResult(_0x5530eb,_0x29ed10))[_0xaef8('0x26')](handleError(_0x5530eb,null));};exports[_0xaef8('0x4f')]=function(_0x28c06e,_0x514ad7){var _0x238b46={'raw':!![],'where':{'id':_0x28c06e['params']['id']}},_0x3e1380={};_0x3e1380[_0xaef8('0x3d')]=_[_0xaef8('0x50')](db[_0xaef8('0x3a')][_0xaef8('0x3b')]);_0x3e1380[_0xaef8('0x3e')]=_[_0xaef8('0x50')](_0x28c06e[_0xaef8('0x3e')]);_0x3e1380[_0xaef8('0x47')]=_[_0xaef8('0x3f')](_0x3e1380[_0xaef8('0x3d')],_0x3e1380[_0xaef8('0x3e')]);_0x238b46[_0xaef8('0x40')]=_[_0xaef8('0x3f')](_0x3e1380[_0xaef8('0x3d')],qs[_0xaef8('0x41')](_0x28c06e[_0xaef8('0x3e')]['fields']));_0x238b46[_0xaef8('0x40')]=_0x238b46[_0xaef8('0x40')][_0xaef8('0x42')]?_0x238b46[_0xaef8('0x40')]:_0x3e1380[_0xaef8('0x3d')];if(_0x28c06e[_0xaef8('0x3e')]['includeAll']){_0x238b46[_0xaef8('0x51')]=[{'all':!![]}];}_0x238b46=_[_0xaef8('0x4a')]({},_0x238b46,_0x28c06e[_0xaef8('0x4b')]);return db[_0xaef8('0x3a')][_0xaef8('0x52')](_0x238b46)['then'](handleEntityNotFound(_0x514ad7,null))[_0xaef8('0x1c')](respondWithResult(_0x514ad7,null))['catch'](handleError(_0x514ad7,null));};exports['create']=function(_0x41a4c7,_0x2c3bbd){return db['OpenchannelMessage'][_0xaef8('0x53')](_0x41a4c7[_0xaef8('0x54')],{})[_0xaef8('0x1c')](respondWithResult(_0x2c3bbd,0xc9))['catch'](handleError(_0x2c3bbd,null));};exports[_0xaef8('0x34')]=function(_0x47270d,_0xb61b38){if(_0x47270d['body']['id']){delete _0x47270d[_0xaef8('0x54')]['id'];}return db[_0xaef8('0x3a')][_0xaef8('0x52')]({'where':{'id':_0x47270d['params']['id']}})['then'](handleEntityNotFound(_0xb61b38,null))[_0xaef8('0x1c')](saveUpdates(_0x47270d['body'],null))[_0xaef8('0x1c')](respondWithResult(_0xb61b38,null))[_0xaef8('0x26')](handleError(_0xb61b38,null));};exports[_0xaef8('0x35')]=function(_0xb4e43b,_0x1035d6){return db[_0xaef8('0x3a')][_0xaef8('0x52')]({'where':{'id':_0xb4e43b[_0xaef8('0x55')]['id']}})['then'](handleEntityNotFound(_0x1035d6,null))['then'](removeEntity(_0x1035d6,null))[_0xaef8('0x26')](handleError(_0x1035d6,null));};exports[_0xaef8('0x56')]=function(_0x1df2cd,_0x55a63f){return db[_0xaef8('0x3a')]['describe']()[_0xaef8('0x1c')](respondWithResult(_0x55a63f,null))[_0xaef8('0x26')](handleError(_0x55a63f,null));};var interaction_log=require(_0xaef8('0x11'))('openchannel-interactions');exports[_0xaef8('0x57')]=function(_0x41d97d,_0x131f3f,_0x8fe0f7){var _0x2b7972={'agent':{},'channel':_0xaef8('0x58')};if(_0x41d97d[_0xaef8('0x54')]['id']){delete _0x41d97d[_0xaef8('0x54')]['id'];}_0x41d97d[_0xaef8('0x54')][_0xaef8('0x59')]=!![];_0x41d97d[_0xaef8('0x54')][_0xaef8('0x5a')]=moment()[_0xaef8('0x5b')](_0xaef8('0x5c'));_0x41d97d[_0xaef8('0x54')]['UserId']=_0x41d97d[_0xaef8('0x54')][_0xaef8('0x5d')]||_0x41d97d[_0xaef8('0x5e')]['id'];_0x2b7972[_0xaef8('0x5f')]['id']=_0x41d97d[_0xaef8('0x54')][_0xaef8('0x5d')];return db[_0xaef8('0x3a')][_0xaef8('0x52')]({'where':{'id':_0x41d97d['params']['id'],'UserId':null}})[_0xaef8('0x1c')](handleEntityNotFound(_0x131f3f,null))[_0xaef8('0x1c')](saveUpdates(_0x41d97d[_0xaef8('0x54')],null))[_0xaef8('0x1c')](function(_0x540c88){if(_0x540c88){_0x2b7972[_0xaef8('0x24')]=_0x540c88[_0xaef8('0x60')]({'plain':!![]});return db[_0xaef8('0x61')]['find']({'where':{'id':_0x540c88[_0xaef8('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x131f3f,null))[_0xaef8('0x1c')](function(_0x464cce){if(_0x464cce){return _0x464cce[_0xaef8('0x34')]({'UserId':_0x41d97d[_0xaef8('0x54')]['UserId'],'read1stAt':_[_0xaef8('0x63')](_0x464cce['read1stAt'])?moment()[_0xaef8('0x5b')](_0xaef8('0x5c')):undefined});}return null;})['then'](function(_0x2c2e54){if(_0x2c2e54){_0x2b7972['interaction']=_0x2c2e54[_0xaef8('0x60')]({'plain':!![]});interaction_log[_0xaef8('0x1d')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x41d97d[_0xaef8('0x5e')]['id'],_0x41d97d['user'][_0xaef8('0x37')],_0x41d97d[_0xaef8('0x5e')][_0xaef8('0x64')],_0x2b7972[_0xaef8('0x65')]['id'],_0x41d97d[_0xaef8('0x54')]?JSON[_0xaef8('0x66')](_0x41d97d[_0xaef8('0x54')]):_0xaef8('0x67'));return respondWithRpcPromise(_0xaef8('0x68'),'acceptMessage',_0x2b7972);}return null;})['then'](function(_0x46274d){var _0x50413c=_0xaef8('0x69')+_0x46274d[_0xaef8('0x24')][_0xaef8('0x6a')];return db[_0xaef8('0x6b')]['query'](_0x50413c,{'type':db['Sequelize'][_0xaef8('0x6c')][_0xaef8('0x6d')],'raw':!![]})['then'](function(_0x42aaa9){return _0x42aaa9;});})['then'](function(_0x521368){if(_0x521368){_0x2b7972[_0xaef8('0x24')][_0xaef8('0x6e')]=_0x521368[0x0];if(!_0x41d97d[_0xaef8('0x54')][_0xaef8('0x5d')])return;return db[_0xaef8('0x6f')][_0xaef8('0x52')]({'where':{'id':_0x41d97d['body'][_0xaef8('0x5d')],'role':'agent'},'attributes':['id',_0xaef8('0x37'),_0xaef8('0x70'),_0xaef8('0x71'),_0xaef8('0x72')],'raw':!![]});}return null;})['then'](function(_0x53783a){if(!_0x53783a)return null;_0x2b7972[_0xaef8('0x24')][_0xaef8('0x5f')]=_0x53783a;return _0x2b7972;})[_0xaef8('0x1c')](function(_0x9d6790){if(_0x9d6790){if(_0x41d97d['body'][_0xaef8('0x73')]){_0x2b7972[_0xaef8('0x24')]['interface']=util[_0xaef8('0x5b')]('SIP/%s',_0x41d97d[_0xaef8('0x5e')][_0xaef8('0x37')]);_0x2b7972[_0xaef8('0x24')][_0xaef8('0x74')]=_0x2b7972[_0xaef8('0x74')];_0x2b7972[_0xaef8('0x24')][_0xaef8('0x75')]=_0x2b7972['channel'];_0x2b7972[_0xaef8('0x24')][_0xaef8('0x76')]=_0xaef8('0x57');return respondWithRpcPromise(_0xaef8('0x77'),_0xaef8('0x77'),{'event':'acceptmessage','message':_0x2b7972['message']},client9002)[_0xaef8('0x1c')](function(){return _0x2b7972;});}return _0x2b7972;}return null;})[_0xaef8('0x1c')](respondWithResult(_0x131f3f,null))[_0xaef8('0x26')](handleError(_0x131f3f,null));};var interaction_log=require(_0xaef8('0x11'))(_0xaef8('0x78'));exports[_0xaef8('0x32')]=function(_0x43e579,_0x2e2a2a,_0x179d8e){var _0x36282a={'agent':{},'channel':_0xaef8('0x58')};if(_0x43e579[_0xaef8('0x54')]['id']){delete _0x43e579[_0xaef8('0x54')]['id'];}_0x43e579[_0xaef8('0x54')][_0xaef8('0x5d')]=_0x43e579[_0xaef8('0x54')][_0xaef8('0x5d')]||_0x43e579[_0xaef8('0x5e')]['id'];_0x36282a['agent']['id']=_0x43e579[_0xaef8('0x54')][_0xaef8('0x5d')];return db['OpenchannelMessage'][_0xaef8('0x52')]({'where':{'id':_0x43e579[_0xaef8('0x55')]['id'],'UserId':null}})[_0xaef8('0x1c')](handleEntityNotFound(_0x2e2a2a,null))[_0xaef8('0x1c')](function(_0x7772d3){if(_0x7772d3){_0x36282a['message']=_0x7772d3[_0xaef8('0x60')]({'plain':!![]});return db[_0xaef8('0x61')][_0xaef8('0x52')]({'where':{'id':_0x7772d3[_0xaef8('0x62')]}});}return null;})[_0xaef8('0x1c')](handleEntityNotFound(_0x2e2a2a,null))[_0xaef8('0x1c')](function(_0x53b6bf){if(_0x53b6bf){_0x36282a['interaction']=_0x53b6bf[_0xaef8('0x60')]({'plain':!![]});interaction_log[_0xaef8('0x1d')](_0xaef8('0x79'),_0x43e579[_0xaef8('0x5e')]['id'],_0x43e579[_0xaef8('0x5e')][_0xaef8('0x37')],_0x43e579[_0xaef8('0x5e')][_0xaef8('0x64')],_0x36282a[_0xaef8('0x65')]['id'],_0x43e579[_0xaef8('0x54')]?JSON[_0xaef8('0x66')](_0x43e579['body']):_0xaef8('0x67'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x36282a);}return null;})[_0xaef8('0x1c')](function(_0x279967){var _0x4b93c4=_0xaef8('0x69')+_0x279967['message'][_0xaef8('0x6a')];return db[_0xaef8('0x6b')][_0xaef8('0x3e')](_0x4b93c4,{'type':db[_0xaef8('0x7a')][_0xaef8('0x6c')][_0xaef8('0x6d')],'raw':!![]})[_0xaef8('0x1c')](function(_0xe63378){return _0xe63378;});})['then'](function(_0x28c0cc){if(_0x28c0cc){_0x36282a[_0xaef8('0x24')]['contact']=_0x28c0cc[0x0];if(!_0x43e579[_0xaef8('0x54')][_0xaef8('0x5d')])return;return db[_0xaef8('0x6f')][_0xaef8('0x52')]({'where':{'id':_0x43e579[_0xaef8('0x54')][_0xaef8('0x5d')],'role':_0xaef8('0x5f')},'attributes':['id','name',_0xaef8('0x70'),'email',_0xaef8('0x72')],'raw':!![]});}return null;})['then'](function(_0xd1bb9f){if(!_0xd1bb9f)return null;_0x36282a[_0xaef8('0x24')]['agent']=_0xd1bb9f;return _0x36282a;})['then'](function(_0x204247){if(_0x204247){_0x204247['message'][_0xaef8('0x7b')]=util[_0xaef8('0x5b')](_0xaef8('0x7c'),_0x43e579['user'][_0xaef8('0x37')]);_0x204247[_0xaef8('0x24')][_0xaef8('0x74')]=_0x36282a['channel'];_0x204247[_0xaef8('0x24')][_0xaef8('0x75')]=_0x36282a[_0xaef8('0x74')];_0x204247[_0xaef8('0x24')][_0xaef8('0x76')]=_0xaef8('0x32');respondWithRpcPromise(_0xaef8('0x77'),_0xaef8('0x77'),{'event':_0xaef8('0x7d'),'message':_0x204247[_0xaef8('0x24')]},client9002);return _0x36282a;}return null;})[_0xaef8('0x1c')](respondWithResult(_0x2e2a2a,null))[_0xaef8('0x26')](handleError(_0x2e2a2a,null));}; \ No newline at end of file +var _0x9e71=['format','UserId','user','agent','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','get','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','AcceptMessage','acceptMessage','sequelize','QueryTypes','SELECT','contact','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','User','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','register','client','http','request','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','findAll','show','params','include','create','body','update','find','describe','accept','openchannel','read','readAt'];(function(_0x4c573c,_0x384477){var _0x126071=function(_0x20d8bd){while(--_0x20d8bd){_0x4c573c['push'](_0x4c573c['shift']());}};_0x126071(++_0x384477);}(_0x9e71,0x1a8));var _0x19e7=function(_0x10f39f,_0x59cedd){_0x10f39f=_0x10f39f-0x0;var _0x4dbd87=_0x9e71[_0x10f39f];return _0x4dbd87;};'use strict';var emlformat=require(_0x19e7('0x0'));var rimraf=require(_0x19e7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x19e7('0x2'));var rp=require(_0x19e7('0x3'));var moment=require(_0x19e7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x19e7('0x5'));var util=require('util');var path=require(_0x19e7('0x6'));var sox=require(_0x19e7('0x7'));var csv=require(_0x19e7('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x19e7('0x9'));var _=require(_0x19e7('0xa'));var squel=require(_0x19e7('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x19e7('0xc'));var Redis=require('ioredis');var authService=require(_0x19e7('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x19e7('0xe'));var hardwareService=require(_0x19e7('0xf'));var logger=require(_0x19e7('0x10'))(_0x19e7('0x11'));var utils=require(_0x19e7('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x19e7('0x13'));var db=require(_0x19e7('0x14'))['db'];config['redis']=_[_0x19e7('0x15')](config[_0x19e7('0x16')],{'host':_0x19e7('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x19e7('0x16')]));require('./openchannelMessage.socket')[_0x19e7('0x18')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x19e7('0x19')][_0x19e7('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xa2f981,_0x2b56f7,_0xeef5c3,_0x1b17ef){return new BPromise(function(_0x18a9c4,_0xff2874){var _0x188a5f=_0x1b17ef||client;return _0x188a5f[_0x19e7('0x1b')](_0xa2f981,_0xeef5c3)['then'](function(_0xa3d107){logger['info'](_0x19e7('0x1c'),_0x2b56f7,_0x19e7('0x1d'));logger[_0x19e7('0x1e')](_0x19e7('0x1f'),_0x2b56f7,_0x19e7('0x1d'),JSON['stringify'](_0xa3d107));if(_0xa3d107[_0x19e7('0x20')]){if(_0xa3d107['error'][_0x19e7('0x21')]===0x1f4){logger[_0x19e7('0x20')](_0x19e7('0x1c'),_0x2b56f7,_0xa3d107[_0x19e7('0x20')]['message']);return _0xff2874(_0xa3d107['error']['message']);}logger['error'](_0x19e7('0x1c'),_0x2b56f7,_0xa3d107[_0x19e7('0x20')][_0x19e7('0x22')]);return _0x18a9c4(_0xa3d107['error'][_0x19e7('0x22')]);}else{logger[_0x19e7('0x23')](_0x19e7('0x1c'),_0x2b56f7,'request\x20sent');_0x18a9c4(_0xa3d107[_0x19e7('0x24')]['message']);}})[_0x19e7('0x25')](function(_0x1b9186){logger[_0x19e7('0x20')](_0x19e7('0x1c'),_0x2b56f7,_0x1b9186);_0xff2874(_0x1b9186);});});}function respondWithStatusCode(_0x935e49,_0x598031){_0x598031=_0x598031||0xcc;return function(_0x224e47){if(_0x224e47){return _0x935e49[_0x19e7('0x26')](_0x598031);}return _0x935e49[_0x19e7('0x27')](_0x598031)[_0x19e7('0x28')]();};}function respondWithResult(_0x47da00,_0x19c6fe){_0x19c6fe=_0x19c6fe||0xc8;return function(_0x38098a){if(_0x38098a){return _0x47da00[_0x19e7('0x27')](_0x19c6fe)[_0x19e7('0x29')](_0x38098a);}};}function respondWithFilteredResult(_0x5a40d7,_0x1ca8ac){return function(_0x25be2b){if(_0x25be2b){var _0x2a574e=typeof _0x1ca8ac[_0x19e7('0x2a')]===_0x19e7('0x2b')&&typeof _0x1ca8ac[_0x19e7('0x2c')]===_0x19e7('0x2b');var _0x477adc=_0x25be2b[_0x19e7('0x2d')];var _0x285de7=_0x2a574e?0x0:_0x1ca8ac[_0x19e7('0x2a')];var _0x424d91=_0x2a574e?_0x25be2b['count']:_0x1ca8ac[_0x19e7('0x2a')]+_0x1ca8ac[_0x19e7('0x2c')];var _0x37a5f6;if(_0x424d91>=_0x477adc){_0x424d91=_0x477adc;_0x37a5f6=0xc8;}else{_0x37a5f6=0xce;}_0x5a40d7['status'](_0x37a5f6);return _0x5a40d7[_0x19e7('0x2e')](_0x19e7('0x2f'),_0x285de7+'-'+_0x424d91+'/'+_0x477adc)[_0x19e7('0x29')](_0x25be2b);}return null;};}function patchUpdates(_0x1b7968){return function(_0x2e57b1){try{jsonpatch['apply'](_0x2e57b1,_0x1b7968,!![]);}catch(_0x1ce136){return BPromise[_0x19e7('0x30')](_0x1ce136);}return _0x2e57b1[_0x19e7('0x31')]();};}function saveUpdates(_0x489d37,_0xfc7f5e){return function(_0x241eaf){if(_0x241eaf){return _0x241eaf['update'](_0x489d37)[_0x19e7('0x32')](function(_0x2e7ee7){return _0x2e7ee7;});}return null;};}function removeEntity(_0x43fc81,_0x43b821){return function(_0x43ed44){if(_0x43ed44){return _0x43ed44[_0x19e7('0x33')]()[_0x19e7('0x32')](function(){_0x43fc81[_0x19e7('0x27')](0xcc)[_0x19e7('0x28')]();});}};}function handleEntityNotFound(_0x7ab8f5,_0x53349a){return function(_0x28a92a){if(!_0x28a92a){_0x7ab8f5['sendStatus'](0x194);}return _0x28a92a;};}function handleError(_0x48307d,_0x369b9e){_0x369b9e=_0x369b9e||0x1f4;return function(_0x605582){logger[_0x19e7('0x20')](_0x605582[_0x19e7('0x34')]);if(_0x605582[_0x19e7('0x35')]){delete _0x605582[_0x19e7('0x35')];}_0x48307d[_0x19e7('0x27')](_0x369b9e)[_0x19e7('0x36')](_0x605582);};}exports[_0x19e7('0x37')]=function(_0x584b87,_0x49a7c4){var _0x57ab89={},_0x14ee8b={},_0x45b714={'count':0x0,'rows':[]};var _0x1a67d8=_[_0x19e7('0x38')](db[_0x19e7('0x39')][_0x19e7('0x3a')],function(_0xf9c870){return{'name':_0xf9c870[_0x19e7('0x3b')],'type':_0xf9c870[_0x19e7('0x3c')][_0x19e7('0x3d')]};});_0x14ee8b[_0x19e7('0x3e')]=_[_0x19e7('0x38')](_0x1a67d8,'name');_0x14ee8b['query']=_[_0x19e7('0x3f')](_0x584b87[_0x19e7('0x40')]);_0x14ee8b[_0x19e7('0x41')]=_[_0x19e7('0x42')](_0x14ee8b[_0x19e7('0x3e')],_0x14ee8b[_0x19e7('0x40')]);_0x57ab89[_0x19e7('0x43')]=_[_0x19e7('0x42')](_0x14ee8b[_0x19e7('0x3e')],qs['fields'](_0x584b87[_0x19e7('0x40')][_0x19e7('0x44')]));_0x57ab89['attributes']=_0x57ab89['attributes'][_0x19e7('0x45')]?_0x57ab89[_0x19e7('0x43')]:_0x14ee8b[_0x19e7('0x3e')];if(!_0x584b87[_0x19e7('0x40')][_0x19e7('0x46')](_0x19e7('0x47'))){_0x57ab89[_0x19e7('0x2c')]=qs[_0x19e7('0x2c')](_0x584b87['query'][_0x19e7('0x2c')]);_0x57ab89[_0x19e7('0x2a')]=qs[_0x19e7('0x2a')](_0x584b87['query'][_0x19e7('0x2a')]);}_0x57ab89[_0x19e7('0x48')]=qs[_0x19e7('0x49')](_0x584b87[_0x19e7('0x40')]['sort']);_0x57ab89[_0x19e7('0x4a')]=qs[_0x19e7('0x41')](_[_0x19e7('0x4b')](_0x584b87['query'],_0x14ee8b[_0x19e7('0x41')]),_0x1a67d8);if(_0x584b87[_0x19e7('0x40')]['filter']){_0x57ab89[_0x19e7('0x4a')]=_[_0x19e7('0x4c')](_0x57ab89[_0x19e7('0x4a')],{'$or':_['map'](_0x1a67d8,function(_0x127b19){if(_0x127b19[_0x19e7('0x3c')]!=='VIRTUAL'){var _0x180e8b={};_0x180e8b[_0x127b19[_0x19e7('0x35')]]={'$like':'%'+_0x584b87[_0x19e7('0x40')][_0x19e7('0x4d')]+'%'};return _0x180e8b;}})});}_0x57ab89=_[_0x19e7('0x4c')]({},_0x57ab89,_0x584b87[_0x19e7('0x4e')]);var _0x1a72f8={'where':_0x57ab89[_0x19e7('0x4a')]};return db[_0x19e7('0x39')][_0x19e7('0x2d')](_0x1a72f8)[_0x19e7('0x32')](function(_0x2595eb){_0x45b714['count']=_0x2595eb;if(_0x584b87['query']['includeAll']){_0x57ab89['include']=[{'all':!![]}];}return db[_0x19e7('0x39')][_0x19e7('0x4f')](_0x57ab89);})[_0x19e7('0x32')](function(_0x264010){_0x45b714['rows']=_0x264010;return _0x45b714;})['then'](respondWithFilteredResult(_0x49a7c4,_0x57ab89))[_0x19e7('0x25')](handleError(_0x49a7c4,null));};exports[_0x19e7('0x50')]=function(_0x44e012,_0x47bca6){var _0x48eab1={'raw':!![],'where':{'id':_0x44e012[_0x19e7('0x51')]['id']}},_0x4b0a70={};_0x4b0a70['model']=_[_0x19e7('0x3f')](db['OpenchannelMessage'][_0x19e7('0x3a')]);_0x4b0a70[_0x19e7('0x40')]=_[_0x19e7('0x3f')](_0x44e012[_0x19e7('0x40')]);_0x4b0a70['filters']=_[_0x19e7('0x42')](_0x4b0a70['model'],_0x4b0a70['query']);_0x48eab1[_0x19e7('0x43')]=_[_0x19e7('0x42')](_0x4b0a70[_0x19e7('0x3e')],qs[_0x19e7('0x44')](_0x44e012[_0x19e7('0x40')]['fields']));_0x48eab1[_0x19e7('0x43')]=_0x48eab1[_0x19e7('0x43')][_0x19e7('0x45')]?_0x48eab1['attributes']:_0x4b0a70[_0x19e7('0x3e')];if(_0x44e012[_0x19e7('0x40')]['includeAll']){_0x48eab1[_0x19e7('0x52')]=[{'all':!![]}];}_0x48eab1=_[_0x19e7('0x4c')]({},_0x48eab1,_0x44e012['options']);return db[_0x19e7('0x39')]['find'](_0x48eab1)['then'](handleEntityNotFound(_0x47bca6,null))[_0x19e7('0x32')](respondWithResult(_0x47bca6,null))['catch'](handleError(_0x47bca6,null));};exports['create']=function(_0x13f8f8,_0x427d06){return db[_0x19e7('0x39')][_0x19e7('0x53')](_0x13f8f8[_0x19e7('0x54')],{})[_0x19e7('0x32')](respondWithResult(_0x427d06,0xc9))['catch'](handleError(_0x427d06,null));};exports[_0x19e7('0x55')]=function(_0x26d87c,_0x4b5908){if(_0x26d87c[_0x19e7('0x54')]['id']){delete _0x26d87c['body']['id'];}return db['OpenchannelMessage']['find']({'where':{'id':_0x26d87c[_0x19e7('0x51')]['id']}})['then'](handleEntityNotFound(_0x4b5908,null))[_0x19e7('0x32')](saveUpdates(_0x26d87c[_0x19e7('0x54')],null))['then'](respondWithResult(_0x4b5908,null))[_0x19e7('0x25')](handleError(_0x4b5908,null));};exports[_0x19e7('0x33')]=function(_0x1398ad,_0x51c93f){return db[_0x19e7('0x39')][_0x19e7('0x56')]({'where':{'id':_0x1398ad[_0x19e7('0x51')]['id']}})[_0x19e7('0x32')](handleEntityNotFound(_0x51c93f,null))['then'](removeEntity(_0x51c93f,null))[_0x19e7('0x25')](handleError(_0x51c93f,null));};exports['describe']=function(_0x4bebad,_0x2e708e){return db[_0x19e7('0x39')][_0x19e7('0x57')]()[_0x19e7('0x32')](respondWithResult(_0x2e708e,null))[_0x19e7('0x25')](handleError(_0x2e708e,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports[_0x19e7('0x58')]=function(_0x36cbd6,_0x4b97d4,_0x231e2e){var _0x3714e5={'agent':{},'channel':_0x19e7('0x59')};if(_0x36cbd6[_0x19e7('0x54')]['id']){delete _0x36cbd6[_0x19e7('0x54')]['id'];}_0x36cbd6['body'][_0x19e7('0x5a')]=!![];_0x36cbd6[_0x19e7('0x54')][_0x19e7('0x5b')]=moment()[_0x19e7('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x36cbd6[_0x19e7('0x54')]['UserId']=_0x36cbd6[_0x19e7('0x54')][_0x19e7('0x5d')]||_0x36cbd6[_0x19e7('0x5e')]['id'];_0x3714e5[_0x19e7('0x5f')]['id']=_0x36cbd6[_0x19e7('0x54')][_0x19e7('0x5d')];return db[_0x19e7('0x39')]['find']({'where':{'id':_0x36cbd6['params']['id'],'UserId':null}})[_0x19e7('0x32')](handleEntityNotFound(_0x4b97d4,null))[_0x19e7('0x32')](saveUpdates(_0x36cbd6[_0x19e7('0x54')],null))['then'](function(_0x4e832c){if(_0x4e832c){_0x3714e5[_0x19e7('0x22')]=_0x4e832c['get']({'plain':!![]});return db[_0x19e7('0x60')][_0x19e7('0x56')]({'where':{'id':_0x4e832c[_0x19e7('0x61')]}});}return null;})[_0x19e7('0x32')](handleEntityNotFound(_0x4b97d4,null))[_0x19e7('0x32')](function(_0x34f30a){if(_0x34f30a){return _0x34f30a[_0x19e7('0x55')]({'UserId':_0x36cbd6['body']['UserId'],'read1stAt':_[_0x19e7('0x62')](_0x34f30a[_0x19e7('0x63')])?moment()[_0x19e7('0x5c')](_0x19e7('0x64')):undefined});}return null;})['then'](function(_0x229121){if(_0x229121){_0x3714e5['interaction']=_0x229121[_0x19e7('0x65')]({'plain':!![]});interaction_log[_0x19e7('0x23')](_0x19e7('0x66'),_0x36cbd6[_0x19e7('0x5e')]['id'],_0x36cbd6[_0x19e7('0x5e')][_0x19e7('0x35')],_0x36cbd6[_0x19e7('0x5e')][_0x19e7('0x67')],_0x3714e5[_0x19e7('0x68')]['id'],_0x36cbd6[_0x19e7('0x54')]?JSON[_0x19e7('0x69')](_0x36cbd6[_0x19e7('0x54')]):'null');return respondWithRpcPromise(_0x19e7('0x6a'),_0x19e7('0x6b'),_0x3714e5);}return null;})['then'](function(_0x521327){var _0x457996='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x521327[_0x19e7('0x22')]['ContactId'];return db[_0x19e7('0x6c')][_0x19e7('0x40')](_0x457996,{'type':db['Sequelize'][_0x19e7('0x6d')][_0x19e7('0x6e')],'raw':!![]})[_0x19e7('0x32')](function(_0x50d3ea){return _0x50d3ea;});})[_0x19e7('0x32')](function(_0x49e99d){if(_0x49e99d){_0x3714e5['message'][_0x19e7('0x6f')]=_0x49e99d[0x0];if(!_0x36cbd6[_0x19e7('0x54')][_0x19e7('0x5d')])return;return db['User'][_0x19e7('0x56')]({'where':{'id':_0x36cbd6[_0x19e7('0x54')]['UserId'],'role':_0x19e7('0x5f')},'attributes':['id',_0x19e7('0x35'),_0x19e7('0x70'),_0x19e7('0x71'),_0x19e7('0x72')],'raw':!![]});}return null;})['then'](function(_0x882dd3){if(!_0x882dd3)return null;_0x3714e5[_0x19e7('0x22')][_0x19e7('0x5f')]=_0x882dd3;return _0x3714e5;})[_0x19e7('0x32')](function(_0x1cbca1){if(_0x1cbca1){if(_0x36cbd6[_0x19e7('0x54')][_0x19e7('0x73')]){_0x3714e5[_0x19e7('0x22')][_0x19e7('0x74')]=util['format'](_0x19e7('0x75'),_0x36cbd6[_0x19e7('0x5e')][_0x19e7('0x35')]);_0x3714e5['message'][_0x19e7('0x76')]=_0x3714e5[_0x19e7('0x76')];_0x3714e5[_0x19e7('0x22')][_0x19e7('0x77')]=_0x3714e5[_0x19e7('0x76')];_0x3714e5[_0x19e7('0x22')][_0x19e7('0x78')]=_0x19e7('0x58');return respondWithRpcPromise(_0x19e7('0x79'),_0x19e7('0x79'),{'event':'acceptmessage','message':_0x3714e5[_0x19e7('0x22')]},client9002)[_0x19e7('0x32')](function(){return _0x3714e5;});}return _0x3714e5;}return null;})[_0x19e7('0x32')](respondWithResult(_0x4b97d4,null))[_0x19e7('0x25')](handleError(_0x4b97d4,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports['reject']=function(_0x27df03,_0x511202,_0x1ef727){var _0x176c1d={'agent':{},'channel':_0x19e7('0x59')};if(_0x27df03[_0x19e7('0x54')]['id']){delete _0x27df03[_0x19e7('0x54')]['id'];}_0x27df03[_0x19e7('0x54')][_0x19e7('0x5d')]=_0x27df03['body']['UserId']||_0x27df03[_0x19e7('0x5e')]['id'];_0x176c1d[_0x19e7('0x5f')]['id']=_0x27df03[_0x19e7('0x54')][_0x19e7('0x5d')];return db['OpenchannelMessage'][_0x19e7('0x56')]({'where':{'id':_0x27df03[_0x19e7('0x51')]['id'],'UserId':null}})[_0x19e7('0x32')](handleEntityNotFound(_0x511202,null))[_0x19e7('0x32')](function(_0xef01c7){if(_0xef01c7){_0x176c1d['message']=_0xef01c7[_0x19e7('0x65')]({'plain':!![]});return db['OpenchannelInteraction'][_0x19e7('0x56')]({'where':{'id':_0xef01c7[_0x19e7('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x511202,null))[_0x19e7('0x32')](function(_0x3babf5){if(_0x3babf5){_0x176c1d['interaction']=_0x3babf5[_0x19e7('0x65')]({'plain':!![]});interaction_log[_0x19e7('0x23')](_0x19e7('0x7a'),_0x27df03[_0x19e7('0x5e')]['id'],_0x27df03['user'][_0x19e7('0x35')],_0x27df03[_0x19e7('0x5e')][_0x19e7('0x67')],_0x176c1d[_0x19e7('0x68')]['id'],_0x27df03[_0x19e7('0x54')]?JSON[_0x19e7('0x69')](_0x27df03[_0x19e7('0x54')]):_0x19e7('0x7b'));return respondWithRpcPromise(_0x19e7('0x7c'),_0x19e7('0x7d'),_0x176c1d);}return null;})[_0x19e7('0x32')](function(_0x501363){var _0x3222f1=_0x19e7('0x7e')+_0x501363[_0x19e7('0x22')]['ContactId'];return db[_0x19e7('0x6c')]['query'](_0x3222f1,{'type':db['Sequelize']['QueryTypes'][_0x19e7('0x6e')],'raw':!![]})[_0x19e7('0x32')](function(_0x516d87){return _0x516d87;});})[_0x19e7('0x32')](function(_0x55caf9){if(_0x55caf9){_0x176c1d[_0x19e7('0x22')][_0x19e7('0x6f')]=_0x55caf9[0x0];if(!_0x27df03['body'][_0x19e7('0x5d')])return;return db[_0x19e7('0x7f')][_0x19e7('0x56')]({'where':{'id':_0x27df03['body'][_0x19e7('0x5d')],'role':_0x19e7('0x5f')},'attributes':['id',_0x19e7('0x35'),_0x19e7('0x70'),_0x19e7('0x71'),'internal'],'raw':!![]});}return null;})[_0x19e7('0x32')](function(_0x5ac8fc){if(!_0x5ac8fc)return null;_0x176c1d[_0x19e7('0x22')][_0x19e7('0x5f')]=_0x5ac8fc;return _0x176c1d;})[_0x19e7('0x32')](function(_0x59adb3){if(_0x59adb3){_0x59adb3['message'][_0x19e7('0x74')]=util[_0x19e7('0x5c')]('SIP/%s',_0x27df03['user']['name']);_0x59adb3[_0x19e7('0x22')][_0x19e7('0x76')]=_0x176c1d[_0x19e7('0x76')];_0x59adb3[_0x19e7('0x22')]['motionChannel']=_0x176c1d['channel'];_0x59adb3[_0x19e7('0x22')][_0x19e7('0x78')]=_0x19e7('0x30');respondWithRpcPromise(_0x19e7('0x79'),_0x19e7('0x79'),{'event':_0x19e7('0x80'),'message':_0x59adb3[_0x19e7('0x22')]},client9002);return _0x176c1d;}return null;})[_0x19e7('0x32')](respondWithResult(_0x511202,null))[_0x19e7('0x25')](handleError(_0x511202,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 457c6d8..b2d2789 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 _0x567d=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelMessage'];(function(_0x3ef2a0,_0xa705b2){var _0x2a7be7=function(_0x540dd2){while(--_0x540dd2){_0x3ef2a0['push'](_0x3ef2a0['shift']());}};_0x2a7be7(++_0xa705b2);}(_0x567d,0x97));var _0xd567=function(_0x25503e,_0x542f28){_0x25503e=_0x25503e-0x0;var _0x1cc7c4=_0x567d[_0x25503e];return _0x1cc7c4;};'use strict';var EventEmitter=require(_0xd567('0x0'));var OpenchannelMessage=require(_0xd567('0x1'))['db'][_0xd567('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xd567('0x3')](0x0);var events={'afterCreate':_0xd567('0x4'),'afterUpdate':_0xd567('0x5'),'afterDestroy':_0xd567('0x6')};function emitEvent(_0x7a4442){return function(_0x258541,_0x339b05,_0x51d66a){OpenchannelMessageEvents[_0xd567('0x7')](_0x7a4442+':'+_0x258541['id'],_0x258541);OpenchannelMessageEvents[_0xd567('0x7')](_0x7a4442,_0x258541);_0x51d66a(null);};}for(var e in events){if(events[_0xd567('0x8')](e)){var event=events[e];OpenchannelMessage[_0xd567('0x9')](e,emitEvent(event));}}module[_0xd567('0xa')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x5e78=['hook','exports','events','OpenchannelMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x3e73f6,_0x4f7f01){var _0x5af991=function(_0x186e5a){while(--_0x186e5a){_0x3e73f6['push'](_0x3e73f6['shift']());}};_0x5af991(++_0x4f7f01);}(_0x5e78,0xbf));var _0x85e7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5e78[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x85e7('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x85e7('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x85e7('0x2')](0x0);var events={'afterCreate':_0x85e7('0x3'),'afterUpdate':_0x85e7('0x4'),'afterDestroy':'remove'};function emitEvent(_0x19fdbb){return function(_0x5df096,_0x33564f,_0x15e4d9){OpenchannelMessageEvents[_0x85e7('0x5')](_0x19fdbb+':'+_0x5df096['id'],_0x5df096);OpenchannelMessageEvents[_0x85e7('0x5')](_0x19fdbb,_0x5df096);_0x15e4d9(null);};}for(var e in events){if(events[_0x85e7('0x6')](e)){var event=events[e];OpenchannelMessage[_0x85e7('0x7')](e,emitEvent(event));}}module[_0x85e7('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 39fbf3f..5aa4836 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 _0xbf94=['Message\x20%d\x20forwarded\x20to\x20%s','threadId','update','OpenchannelMessage,\x20%s,\x20%s','finally','utf8mb4_unicode_ci','lodash','util','moment','request-promise','path','rimraf','../../config/environment','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','OpenchannelInteractionId','createdAt','catch','error','CmContact','describe','then','OpenchannelAccount','OpenchannelInteraction','Interactions','Contact','replyUri','info','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','method','afterCreate'];(function(_0x1f971e,_0x52bf2b){var _0x1756ba=function(_0x9dd284){while(--_0x9dd284){_0x1f971e['push'](_0x1f971e['shift']());}};_0x1756ba(++_0x52bf2b);}(_0xbf94,0x176));var _0x4bf9=function(_0x4dd4b6,_0x5ba227){_0x4dd4b6=_0x4dd4b6-0x0;var _0x1625c0=_0xbf94[_0x4dd4b6];return _0x1625c0;};'use strict';var _=require(_0x4bf9('0x0'));var util=require(_0x4bf9('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4bf9('0x2'));var BPromise=require('bluebird');var rp=require(_0x4bf9('0x3'));var fs=require('fs');var path=require(_0x4bf9('0x4'));var rimraf=require(_0x4bf9('0x5'));var config=require(_0x4bf9('0x6'));var attributes=require('./openchannelMessage.attributes');module['exports']=function(_0x22a14b,_0x1fdd48){return _0x22a14b[_0x4bf9('0x7')](_0x4bf9('0x8'),attributes,{'tableName':_0x4bf9('0x9'),'paranoid':![],'indexes':[{'name':_0x4bf9('0xa'),'fields':[_0x4bf9('0xb')],'type':_0x4bf9('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x51870d,_0x3c698f,_0x11bb1b){var _0x33b7c5=_0x22a14b['models'];var _0x41dde2=_0x51870d[_0x4bf9('0xd')]({'plain':!![]});if(_0x41dde2[_0x4bf9('0xe')]['toLowerCase']()==='in'||_0x41dde2[_0x4bf9('0xe')][_0x4bf9('0xf')]()===_0x4bf9('0x10')&&!_0x41dde2[_0x4bf9('0x11')]&&!_[_0x4bf9('0x12')](_0x41dde2['UserId'])){_0x33b7c5['OpenchannelInteraction']['findOne']({'where':{'id':_0x41dde2[_0x4bf9('0x13')]}})['then'](function(_0x409f82){if(_0x409f82){_0x409f82['update']({'lastMsgAt':_0x41dde2[_0x4bf9('0x14')],'lastMsgDirection':_0x41dde2[_0x4bf9('0xe')][_0x4bf9('0xf')]()});}})[_0x4bf9('0x15')](function(_0x1a472e){console[_0x4bf9('0x16')](_0x1a472e);});}if(_0x41dde2[_0x4bf9('0xe')]===_0x4bf9('0x10')&&!_0x41dde2[_0x4bf9('0x11')]){var _0x259c8d;_0x33b7c5[_0x4bf9('0x17')][_0x4bf9('0x18')]()[_0x4bf9('0x19')](function(_0x439000){return _0x33b7c5[_0x4bf9('0x1a')]['find']({'where':{'id':_0x41dde2['OpenchannelAccountId']},'include':[{'model':_0x33b7c5[_0x4bf9('0x1b')],'as':_0x4bf9('0x1c'),'where':{'id':_0x41dde2[_0x4bf9('0x13')]},'limit':0x1,'include':[{'model':_0x33b7c5[_0x4bf9('0x17')],'as':_0x4bf9('0x1d'),'attributes':_['keys'](_0x439000)}]}]});})[_0x4bf9('0x19')](function(_0x2ac3eb){_0x259c8d=_0x2ac3eb[_0x4bf9('0xd')]({'plain':!![]});if(_0x259c8d&&_0x259c8d[_0x4bf9('0x1e')]){logger[_0x4bf9('0x1f')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0x4bf9('0x20')](_0x4bf9('0x21'),_0x41dde2['id'],_0x259c8d[_0x4bf9('0x1e')]));if(_0x259c8d[_0x4bf9('0x1c')]&&_0x259c8d['Interactions'][_0x4bf9('0x22')]){_0x41dde2[_0x4bf9('0x23')]=_[_0x4bf9('0x24')](_0x259c8d[_0x4bf9('0x1c')][0x0],_0x4bf9('0x1d'));_0x41dde2[_0x4bf9('0x1d')]=_0x259c8d['Interactions'][0x0][_0x4bf9('0x1d')];}var _0x3c698f={'method':_0x4bf9('0x25'),'uri':encodeURI(_0x259c8d[_0x4bf9('0x1e')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x3c698f[_0x4bf9('0x26')]){case'GET':_0x3c698f['qs']=_0x41dde2;break;case _0x4bf9('0x25'):_0x3c698f[_0x4bf9('0xb')]=_0x41dde2;break;}return rp(_0x3c698f)['then'](function(_0x56843c){logger[_0x4bf9('0x1f')]('OpenchannelMessage,\x20%s,\x20%s',_0x4bf9('0x27'),util[_0x4bf9('0x20')](_0x4bf9('0x28'),_0x41dde2['id'],_0x259c8d[_0x4bf9('0x1e')]));if(_0x56843c[_0x4bf9('0xb')]['threadId']&&_0x56843c[_0x4bf9('0xb')][_0x4bf9('0x29')]!=_0x41dde2[_0x4bf9('0x23')][_0x4bf9('0x29')]){return _0x33b7c5[_0x4bf9('0x1b')]['update']({'threadId':_0x56843c[_0x4bf9('0xb')][_0x4bf9('0x29')]},{'where':{'id':_0x41dde2[_0x4bf9('0x23')]['id']}});}else{return;}})['then'](function(){return _0x51870d[_0x4bf9('0x2a')]({'read':!![]});})[_0x4bf9('0x15')](function(_0x5b6f78){logger[_0x4bf9('0x16')](_0x4bf9('0x2b'),'afterCreate',util['inspect'](_0x5b6f78,{'showHidden':![],'depth':null}));_0x11bb1b();});}else{_0x11bb1b();}})[_0x4bf9('0x2c')](function(){_0x11bb1b();});}else{_0x11bb1b();}}},'charset':'utf8mb4','collate':_0x4bf9('0x2d')});}; \ No newline at end of file +var _0x41df=['body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','OpenchannelInteraction','OpenchannelInteractionId','then','createdAt','catch','error','CmContact','OpenchannelAccount','find','Interactions','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','length','omit','Contact','method','POST','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','update','inspect','finally','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./openchannelMessage.attributes','exports','define','OpenchannelMessage','fti_openchannel_messages'];(function(_0x487ab4,_0x1e24e8){var _0x3bef77=function(_0x5ce664){while(--_0x5ce664){_0x487ab4['push'](_0x487ab4['shift']());}};_0x3bef77(++_0x1e24e8);}(_0x41df,0x14a));var _0xf41d=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x41df[_0x5bd426];return _0x23a7eb;};'use strict';var _=require(_0xf41d('0x0'));var util=require(_0xf41d('0x1'));var logger=require('../../config/logger')(_0xf41d('0x2'));var moment=require(_0xf41d('0x3'));var BPromise=require(_0xf41d('0x4'));var rp=require(_0xf41d('0x5'));var fs=require('fs');var path=require(_0xf41d('0x6'));var rimraf=require(_0xf41d('0x7'));var config=require('../../config/environment');var attributes=require(_0xf41d('0x8'));module[_0xf41d('0x9')]=function(_0xbcd263,_0x412422){return _0xbcd263[_0xf41d('0xa')](_0xf41d('0xb'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xf41d('0xc'),'fields':[_0xf41d('0xd')],'type':_0xf41d('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x49e865,_0x9c3c7f,_0x46f3c3){var _0x935ff0=_0xbcd263[_0xf41d('0xf')];var _0x1381c5=_0x49e865[_0xf41d('0x10')]({'plain':!![]});if(_0x1381c5[_0xf41d('0x11')]['toLowerCase']()==='in'||_0x1381c5[_0xf41d('0x11')][_0xf41d('0x12')]()==='out'&&!_0x1381c5[_0xf41d('0x13')]&&!_[_0xf41d('0x14')](_0x1381c5[_0xf41d('0x15')])){_0x935ff0[_0xf41d('0x16')]['findOne']({'where':{'id':_0x1381c5[_0xf41d('0x17')]}})[_0xf41d('0x18')](function(_0x4b9582){if(_0x4b9582){_0x4b9582['update']({'lastMsgAt':_0x1381c5[_0xf41d('0x19')],'lastMsgDirection':_0x1381c5[_0xf41d('0x11')][_0xf41d('0x12')]()});}})[_0xf41d('0x1a')](function(_0x4d1ac2){console[_0xf41d('0x1b')](_0x4d1ac2);});}if(_0x1381c5[_0xf41d('0x11')]==='out'&&!_0x1381c5[_0xf41d('0x13')]){var _0xd91646;_0x935ff0[_0xf41d('0x1c')]['describe']()[_0xf41d('0x18')](function(_0x3a8118){return _0x935ff0[_0xf41d('0x1d')][_0xf41d('0x1e')]({'where':{'id':_0x1381c5['OpenchannelAccountId']},'include':[{'model':_0x935ff0[_0xf41d('0x16')],'as':_0xf41d('0x1f'),'where':{'id':_0x1381c5[_0xf41d('0x17')]},'limit':0x1,'include':[{'model':_0x935ff0[_0xf41d('0x1c')],'as':'Contact','attributes':_['keys'](_0x3a8118)}]}]});})['then'](function(_0x4c34af){_0xd91646=_0x4c34af[_0xf41d('0x10')]({'plain':!![]});if(_0xd91646&&_0xd91646['replyUri']){logger[_0xf41d('0x20')](_0xf41d('0x21'),_0xf41d('0x22'),util[_0xf41d('0x23')](_0xf41d('0x24'),_0x1381c5['id'],_0xd91646[_0xf41d('0x25')]));if(_0xd91646['Interactions']&&_0xd91646[_0xf41d('0x1f')][_0xf41d('0x26')]){_0x1381c5['Interaction']=_[_0xf41d('0x27')](_0xd91646[_0xf41d('0x1f')][0x0],_0xf41d('0x28'));_0x1381c5[_0xf41d('0x28')]=_0xd91646[_0xf41d('0x1f')][0x0][_0xf41d('0x28')];}var _0x9c3c7f={'method':'POST','uri':encodeURI(_0xd91646['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x9c3c7f[_0xf41d('0x29')]){case'GET':_0x9c3c7f['qs']=_0x1381c5;break;case _0xf41d('0x2a'):_0x9c3c7f[_0xf41d('0xd')]=_0x1381c5;break;}return rp(_0x9c3c7f)['then'](function(_0x137209){logger[_0xf41d('0x20')]('OpenchannelMessage,\x20%s,\x20%s',_0xf41d('0x22'),util[_0xf41d('0x23')](_0xf41d('0x2b'),_0x1381c5['id'],_0xd91646[_0xf41d('0x25')]));if(_0x137209['body'][_0xf41d('0x2c')]&&_0x137209[_0xf41d('0xd')][_0xf41d('0x2c')]!=_0x1381c5[_0xf41d('0x2d')][_0xf41d('0x2c')]){return _0x935ff0['OpenchannelInteraction'][_0xf41d('0x2e')]({'threadId':_0x137209['body'][_0xf41d('0x2c')]},{'where':{'id':_0x1381c5[_0xf41d('0x2d')]['id']}});}else{return;}})[_0xf41d('0x18')](function(){return _0x49e865[_0xf41d('0x2e')]({'read':!![]});})[_0xf41d('0x1a')](function(_0x3087b7){logger[_0xf41d('0x1b')](_0xf41d('0x21'),_0xf41d('0x22'),util[_0xf41d('0x2f')](_0x3087b7,{'showHidden':![],'depth':null}));_0x46f3c3();});}else{_0x46f3c3();}})[_0xf41d('0x30')](function(){_0x46f3c3();});}else{_0x46f3c3();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 43ab7ef..765b37c 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 _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','OpenchannelMessage','options','raw','then','CreateOpenchannelMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3dfa3b,_0x1801d5){var _0x8d32c=function(_0x25bb6b){while(--_0x25bb6b){_0x3dfa3b['push'](_0x3dfa3b['shift']());}};_0x8d32c(++_0x1801d5);}(_0x1261,0x144));var _0x1126=function(_0x239904,_0x4b11e2){_0x239904=_0x239904-0x0;var _0x259609=_0x1261[_0x239904];return _0x259609;};'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});config[_0x1126('0xb')]=_['defaults'](config[_0x1126('0xb')],{'host':_0x1126('0xc'),'port':0x18eb});var socket=require(_0x1126('0xd'))(new Redis(config[_0x1126('0xb')]));require(_0x1126('0xe'))['register'](socket);function respondWithRpcPromise(_0x3f09ac,_0x18dbe6,_0x167ef1){return new BPromise(function(_0x5e72e2,_0x34571c){return client['request'](_0x3f09ac,_0x167ef1)['then'](function(_0x15c071){logger['info'](_0x1126('0xf'),_0x18dbe6,_0x1126('0x10'));logger[_0x1126('0x11')](_0x1126('0x12'),_0x18dbe6,_0x1126('0x10'),JSON[_0x1126('0x13')](_0x15c071));if(_0x15c071[_0x1126('0x14')]){if(_0x15c071[_0x1126('0x14')][_0x1126('0x15')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x34571c(_0x15c071[_0x1126('0x14')]['message']);}logger[_0x1126('0x14')]('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x5e72e2(_0x15c071[_0x1126('0x14')]['message']);}else{logger[_0x1126('0x17')](_0x1126('0xf'),_0x18dbe6,'request\x20sent');_0x5e72e2(_0x15c071['result'][_0x1126('0x16')]);}})[_0x1126('0x18')](function(_0x58d11a){logger['error'](_0x1126('0xf'),_0x18dbe6,_0x58d11a);_0x34571c(_0x58d11a);});});}exports['CreateOpenchannelMessage']=function(_0x22ed37){var _0x1d6d19=this;return new Promise(function(_0x2f70ac,_0x54400a){return db[_0x1126('0x19')]['create'](_0x22ed37['body'],{'raw':_0x22ed37[_0x1126('0x1a')]?_0x22ed37[_0x1126('0x1a')][_0x1126('0x1b')]===undefined?!![]:![]:!![]})[_0x1126('0x1c')](function(_0x526ca1){logger[_0x1126('0x17')](_0x1126('0x1d'),_0x22ed37);logger['debug'](_0x1126('0x1d'),_0x22ed37,JSON['stringify'](_0x526ca1));_0x2f70ac(_0x526ca1);})['catch'](function(_0x4b57ab){logger[_0x1126('0x14')](_0x1126('0x1d'),_0x4b57ab[_0x1126('0x16')],_0x22ed37);_0x54400a(_0x1d6d19[_0x1126('0x14')](0x1f4,_0x4b57ab[_0x1126('0x16')]));});});}; \ No newline at end of file +var _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','OpenchannelMessage','options','raw','then','CreateOpenchannelMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x52fc98,_0x234046){var _0x5ef66b=function(_0x5a991e){while(--_0x5a991e){_0x52fc98['push'](_0x52fc98['shift']());}};_0x5ef66b(++_0x234046);}(_0x1261,0x144));var _0x1126=function(_0x7a8be9,_0x1caf02){_0x7a8be9=_0x7a8be9-0x0;var _0x4bab19=_0x1261[_0x7a8be9];return _0x4bab19;};'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});config[_0x1126('0xb')]=_['defaults'](config[_0x1126('0xb')],{'host':_0x1126('0xc'),'port':0x18eb});var socket=require(_0x1126('0xd'))(new Redis(config[_0x1126('0xb')]));require(_0x1126('0xe'))['register'](socket);function respondWithRpcPromise(_0x3f09ac,_0x18dbe6,_0x167ef1){return new BPromise(function(_0x5e72e2,_0x34571c){return client['request'](_0x3f09ac,_0x167ef1)['then'](function(_0x15c071){logger['info'](_0x1126('0xf'),_0x18dbe6,_0x1126('0x10'));logger[_0x1126('0x11')](_0x1126('0x12'),_0x18dbe6,_0x1126('0x10'),JSON[_0x1126('0x13')](_0x15c071));if(_0x15c071[_0x1126('0x14')]){if(_0x15c071[_0x1126('0x14')][_0x1126('0x15')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x34571c(_0x15c071[_0x1126('0x14')]['message']);}logger[_0x1126('0x14')]('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x5e72e2(_0x15c071[_0x1126('0x14')]['message']);}else{logger[_0x1126('0x17')](_0x1126('0xf'),_0x18dbe6,'request\x20sent');_0x5e72e2(_0x15c071['result'][_0x1126('0x16')]);}})[_0x1126('0x18')](function(_0x58d11a){logger['error'](_0x1126('0xf'),_0x18dbe6,_0x58d11a);_0x34571c(_0x58d11a);});});}exports['CreateOpenchannelMessage']=function(_0x22ed37){var _0x1d6d19=this;return new Promise(function(_0x2f70ac,_0x54400a){return db[_0x1126('0x19')]['create'](_0x22ed37['body'],{'raw':_0x22ed37[_0x1126('0x1a')]?_0x22ed37[_0x1126('0x1a')][_0x1126('0x1b')]===undefined?!![]:![]:!![]})[_0x1126('0x1c')](function(_0x526ca1){logger[_0x1126('0x17')](_0x1126('0x1d'),_0x22ed37);logger['debug'](_0x1126('0x1d'),_0x22ed37,JSON['stringify'](_0x526ca1));_0x2f70ac(_0x526ca1);})['catch'](function(_0x4b57ab){logger[_0x1126('0x14')](_0x1126('0x1d'),_0x4b57ab[_0x1126('0x16')],_0x22ed37);_0x54400a(_0x1d6d19[_0x1126('0x14')](0x1f4,_0x4b57ab[_0x1126('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 835ba28..2249f84 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 _0x3981=['removeListener','register','length','openchannelMessage:','./openchannelMessage.events','remove','update','emit'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0x3981,0x144));var _0x1398=function(_0xb64d8c,_0xea85a4){_0xb64d8c=_0xb64d8c-0x0;var _0x54d3bf=_0x3981[_0xb64d8c];return _0x54d3bf;};'use strict';var OpenchannelMessageEvents=require(_0x1398('0x0'));var events=['save',_0x1398('0x1'),_0x1398('0x2')];function createListener(_0x8739be,_0x1be1d9){return function(_0x1d39c3){_0x1be1d9[_0x1398('0x3')](_0x8739be,_0x1d39c3);};}function removeListener(_0x37fb2f,_0x2860af){return function(){OpenchannelMessageEvents[_0x1398('0x4')](_0x37fb2f,_0x2860af);};}exports[_0x1398('0x5')]=function(_0x199a50){for(var _0x5c5fe0=0x0,_0x216064=events[_0x1398('0x6')];_0x5c5fe0<_0x216064;_0x5c5fe0++){var _0x40e860=events[_0x5c5fe0];var _0x51dd7f=createListener(_0x1398('0x7')+_0x40e860,_0x199a50);OpenchannelMessageEvents['on'](_0x40e860,_0x51dd7f);}}; \ No newline at end of file +var _0x279c=['openchannelMessage:','./openchannelMessage.events','save','remove','emit','removeListener','register','length'];(function(_0x562ce4,_0x3328ba){var _0xc97802=function(_0x49f05f){while(--_0x49f05f){_0x562ce4['push'](_0x562ce4['shift']());}};_0xc97802(++_0x3328ba);}(_0x279c,0x1f1));var _0xc279=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0x279c[_0x3740fe];return _0x55492b;};'use strict';var OpenchannelMessageEvents=require(_0xc279('0x0'));var events=[_0xc279('0x1'),_0xc279('0x2'),'update'];function createListener(_0xcf279d,_0x227b0b){return function(_0x195caa){_0x227b0b[_0xc279('0x3')](_0xcf279d,_0x195caa);};}function removeListener(_0x3dd555,_0x420e1f){return function(){OpenchannelMessageEvents[_0xc279('0x4')](_0x3dd555,_0x420e1f);};}exports[_0xc279('0x5')]=function(_0x5e47ac){for(var _0x4e0816=0x0,_0x91bc06=events[_0xc279('0x6')];_0x4e0816<_0x91bc06;_0x4e0816++){var _0x2c3620=events[_0x4e0816];var _0x24a4d4=createListener(_0xc279('0x7')+_0x2c3620,_0x5e47ac);OpenchannelMessageEvents['on'](_0x2c3620,_0x24a4d4);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index f65d48c..c5110af 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 _0x706d=['delete','destroy','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','get','isAuthenticated','index','/:id','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put'];(function(_0x5ddd81,_0x5a8784){var _0x4d897d=function(_0x16f146){while(--_0x16f146){_0x5ddd81['push'](_0x5ddd81['shift']());}};_0x4d897d(++_0x5a8784);}(_0x706d,0x1e6));var _0xd706=function(_0x476b17,_0x8e55f6){_0x476b17=_0x476b17-0x0;var _0xac8ef7=_0x706d[_0x476b17];return _0xac8ef7;};'use strict';var multer=require('multer');var util=require(_0xd706('0x0'));var path=require(_0xd706('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd706('0x2')]();var fs_extra=require(_0xd706('0x3'));var auth=require(_0xd706('0x4'));var interaction=require(_0xd706('0x5'));var config=require('../../config/environment');var controller=require(_0xd706('0x6'));router[_0xd706('0x7')]('/',auth[_0xd706('0x8')](),controller[_0xd706('0x9')]);router[_0xd706('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xd706('0x7')](_0xd706('0xa'),auth[_0xd706('0x8')](),controller['show']);router[_0xd706('0x7')](_0xd706('0xb'),auth[_0xd706('0x8')](),controller['getMembers']);router['get'](_0xd706('0xc'),auth['isAuthenticated'](),controller[_0xd706('0xd')]);router[_0xd706('0x7')](_0xd706('0xe'),auth[_0xd706('0x8')](),controller[_0xd706('0xf')]);router[_0xd706('0x10')]('/',auth[_0xd706('0x8')](),controller[_0xd706('0x11')]);router[_0xd706('0x10')]('/:id/teams',auth[_0xd706('0x8')](),controller['addTeams']);router[_0xd706('0x10')]('/:id/users',auth[_0xd706('0x8')](),controller[_0xd706('0x12')]);router[_0xd706('0x13')]('/:id',auth[_0xd706('0x8')](),controller['update']);router[_0xd706('0x14')](_0xd706('0xa'),auth['isAuthenticated'](),controller[_0xd706('0x15')]);router[_0xd706('0x14')]('/:id/teams',auth[_0xd706('0x8')](),controller['removeTeams']);router[_0xd706('0x14')]('/:id/users',auth[_0xd706('0x8')](),controller['removeAgents']);module[_0xd706('0x16')]=router; \ No newline at end of file +var _0xd16f=['exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./openchannelQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','post','create','addTeams','addAgents','update','delete','destroy','removeTeams','removeAgents'];(function(_0x43e3bc,_0x53230a){var _0x113f9d=function(_0x44b63c){while(--_0x44b63c){_0x43e3bc['push'](_0x43e3bc['shift']());}};_0x113f9d(++_0x53230a);}(_0xd16f,0x140));var _0xfd16=function(_0x474464,_0x163f51){_0x474464=_0x474464-0x0;var _0x56d0d5=_0xd16f[_0x474464];return _0x56d0d5;};'use strict';var multer=require(_0xfd16('0x0'));var util=require(_0xfd16('0x1'));var path=require(_0xfd16('0x2'));var timeout=require(_0xfd16('0x3'));var express=require(_0xfd16('0x4'));var router=express[_0xfd16('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfd16('0x6'));var controller=require(_0xfd16('0x7'));router['get']('/',auth[_0xfd16('0x8')](),controller[_0xfd16('0x9')]);router[_0xfd16('0xa')](_0xfd16('0xb'),auth[_0xfd16('0x8')](),controller[_0xfd16('0xc')]);router[_0xfd16('0xa')](_0xfd16('0xd'),auth[_0xfd16('0x8')](),controller[_0xfd16('0xe')]);router[_0xfd16('0xa')](_0xfd16('0xf'),auth['isAuthenticated'](),controller[_0xfd16('0x10')]);router[_0xfd16('0xa')](_0xfd16('0x11'),auth[_0xfd16('0x8')](),controller['getTeams']);router[_0xfd16('0xa')](_0xfd16('0x12'),auth[_0xfd16('0x8')](),controller['getAgents']);router[_0xfd16('0x13')]('/',auth[_0xfd16('0x8')](),controller[_0xfd16('0x14')]);router[_0xfd16('0x13')]('/:id/teams',auth[_0xfd16('0x8')](),controller[_0xfd16('0x15')]);router[_0xfd16('0x13')](_0xfd16('0x12'),auth[_0xfd16('0x8')](),controller[_0xfd16('0x16')]);router['put']('/:id',auth[_0xfd16('0x8')](),controller[_0xfd16('0x17')]);router[_0xfd16('0x18')](_0xfd16('0xd'),auth[_0xfd16('0x8')](),controller[_0xfd16('0x19')]);router[_0xfd16('0x18')](_0xfd16('0x11'),auth[_0xfd16('0x8')](),controller[_0xfd16('0x1a')]);router[_0xfd16('0x18')]('/:id/users',auth[_0xfd16('0x8')](),controller[_0xfd16('0x1b')]);module[_0xfd16('0x1c')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 0260cf5..64debfc 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 _0x0ddc=['rrmemory','beepall','roundrobin','sequelize','STRING','name','INTEGER','ENUM'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x0ddc,0xcb));var _0xc0dd=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x0ddc[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require(_0xc0dd('0x0'));module['exports']={'name':{'type':Sequelize[_0xc0dd('0x1')],'unique':_0xc0dd('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc0dd('0x1')]},'timeout':{'type':Sequelize[_0xc0dd('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc0dd('0x4')](_0xc0dd('0x5'),_0xc0dd('0x6'),_0xc0dd('0x7'))}}; \ No newline at end of file +var _0xf0e3=['beepall','roundrobin','sequelize','exports','name','STRING','INTEGER','ENUM','rrmemory'];(function(_0x4f217f,_0x313163){var _0x3b583a=function(_0x334971){while(--_0x334971){_0x4f217f['push'](_0x4f217f['shift']());}};_0x3b583a(++_0x313163);}(_0xf0e3,0x89));var _0x3f0e=function(_0x131b76,_0x266621){_0x131b76=_0x131b76-0x0;var _0xcbc398=_0xf0e3[_0x131b76];return _0xcbc398;};'use strict';var Sequelize=require(_0x3f0e('0x0'));module[_0x3f0e('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x3f0e('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3f0e('0x3')]},'timeout':{'type':Sequelize[_0x3f0e('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3f0e('0x5')](_0x3f0e('0x6'),_0x3f0e('0x7'),_0x3f0e('0x8'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 66728fb..16bb9c7 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 _0x18d5=['all','union','compact','value','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','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/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','destroy','then','get','OpenchannelQueues','end','error','stack','name','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','catch','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','update','describe','getMembers','UserOpenchannelQueue','OpenchannelQueueId','User','findAndCountAll','UserId','agent','updatedAt','rows','format','%s/%s','SIP','openchannelPause','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','select','field','tq.TeamId','from','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','SELECT','every','TeamId','includes'];(function(_0x5b2e3d,_0x2d7f7b){var _0x35a13c=function(_0x831acc){while(--_0x831acc){_0x5b2e3d['push'](_0x5b2e3d['shift']());}};_0x35a13c(++_0x2d7f7b);}(_0x18d5,0x1aa));var _0x518d=function(_0x5c45a2,_0x59052e){_0x5c45a2=_0x5c45a2-0x0;var _0xa49160=_0x18d5[_0x5c45a2];return _0xa49160;};'use strict';var emlformat=require(_0x518d('0x0'));var rimraf=require(_0x518d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x518d('0x2'));var rp=require(_0x518d('0x3'));var moment=require(_0x518d('0x4'));var BPromise=require(_0x518d('0x5'));var Mustache=require(_0x518d('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x518d('0x7'));var ejs=require(_0x518d('0x8'));var fs=require('fs');var fs_extra=require(_0x518d('0x9'));var _=require(_0x518d('0xa'));var squel=require(_0x518d('0xb'));var crypto=require(_0x518d('0xc'));var jsforce=require(_0x518d('0xd'));var deskjs=require(_0x518d('0xe'));var toCsv=require('to-csv');var querystring=require(_0x518d('0xf'));var Papa=require('papaparse');var Redis=require(_0x518d('0x10'));var authService=require(_0x518d('0x11'));var qs=require(_0x518d('0x12'));var as=require(_0x518d('0x13'));var hardwareService=require(_0x518d('0x14'));var logger=require('../../config/logger')(_0x518d('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x518d('0x16'));var db=require(_0x518d('0x17'))['db'];config[_0x518d('0x18')]=_[_0x518d('0x19')](config[_0x518d('0x18')],{'host':_0x518d('0x1a'),'port':0x18eb});var socket=require(_0x518d('0x1b'))(new Redis(config[_0x518d('0x18')]));require('./openchannelQueue.socket')[_0x518d('0x1c')](socket);function respondWithStatusCode(_0x4f840c,_0x2a6213){_0x2a6213=_0x2a6213||0xcc;return function(_0x1675fc){if(_0x1675fc){return _0x4f840c[_0x518d('0x1d')](_0x2a6213);}return _0x4f840c[_0x518d('0x1e')](_0x2a6213)['end']();};}function respondWithResult(_0x495921,_0x565d1b){_0x565d1b=_0x565d1b||0xc8;return function(_0x529ff7){if(_0x529ff7){return _0x495921[_0x518d('0x1e')](_0x565d1b)['json'](_0x529ff7);}};}function respondWithFilteredResult(_0x1acefe,_0x62606){return function(_0x154dc8){if(_0x154dc8){var _0x49d878=typeof _0x62606['offset']===_0x518d('0x1f')&&typeof _0x62606[_0x518d('0x20')]===_0x518d('0x1f');var _0x5be201=_0x154dc8['count'];var _0x54155a=_0x49d878?0x0:_0x62606[_0x518d('0x21')];var _0x5e791=_0x49d878?_0x154dc8[_0x518d('0x22')]:_0x62606[_0x518d('0x21')]+_0x62606[_0x518d('0x20')];var _0x4b440f;if(_0x5e791>=_0x5be201){_0x5e791=_0x5be201;_0x4b440f=0xc8;}else{_0x4b440f=0xce;}_0x1acefe[_0x518d('0x1e')](_0x4b440f);return _0x1acefe[_0x518d('0x23')](_0x518d('0x24'),_0x54155a+'-'+_0x5e791+'/'+_0x5be201)[_0x518d('0x25')](_0x154dc8);}return null;};}function patchUpdates(_0x1e1093){return function(_0x44f62e){try{jsonpatch[_0x518d('0x26')](_0x44f62e,_0x1e1093,!![]);}catch(_0x184b34){return BPromise[_0x518d('0x27')](_0x184b34);}return _0x44f62e[_0x518d('0x28')]();};}function saveUpdates(_0x2b4288,_0x90a70f){return function(_0x4f7875){if(_0x4f7875){return _0x4f7875['update'](_0x2b4288)['then'](function(_0x53570b){return _0x53570b;});}return null;};}function removeEntity(_0x32a50d,_0x3af8e3){return function(_0x5762e1){if(_0x5762e1){return _0x5762e1[_0x518d('0x29')]()[_0x518d('0x2a')](function(){var _0x24279c=_0x5762e1[_0x518d('0x2b')]({'plain':!![]});var _0x5bb788=_0x518d('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x5bb788,'resourceId':_0x24279c['id']}})['then'](function(){return _0x5762e1;});})['then'](function(){_0x32a50d[_0x518d('0x1e')](0xcc)[_0x518d('0x2d')]();});}};}function handleEntityNotFound(_0x383042,_0x44c265){return function(_0x3c2399){if(!_0x3c2399){_0x383042[_0x518d('0x1d')](0x194);}return _0x3c2399;};}function handleError(_0x3dd769,_0xba20ad){_0xba20ad=_0xba20ad||0x1f4;return function(_0x142ce0){logger[_0x518d('0x2e')](_0x142ce0[_0x518d('0x2f')]);if(_0x142ce0[_0x518d('0x30')]){delete _0x142ce0[_0x518d('0x30')];}_0x3dd769[_0x518d('0x1e')](_0xba20ad)['send'](_0x142ce0);};}exports[_0x518d('0x31')]=function(_0x48c675,_0x3dd8de){var _0x3e0602={},_0x2fd3db={},_0x5f3c13={'count':0x0,'rows':[]};var _0x22cd1e=_[_0x518d('0x32')](db[_0x518d('0x33')][_0x518d('0x34')],function(_0x822f88){return{'name':_0x822f88[_0x518d('0x35')],'type':_0x822f88[_0x518d('0x36')][_0x518d('0x37')]};});_0x2fd3db[_0x518d('0x38')]=_[_0x518d('0x32')](_0x22cd1e,'name');_0x2fd3db[_0x518d('0x39')]=_[_0x518d('0x3a')](_0x48c675[_0x518d('0x39')]);_0x2fd3db[_0x518d('0x3b')]=_[_0x518d('0x3c')](_0x2fd3db['model'],_0x2fd3db[_0x518d('0x39')]);_0x3e0602['attributes']=_['intersection'](_0x2fd3db[_0x518d('0x38')],qs['fields'](_0x48c675[_0x518d('0x39')][_0x518d('0x3d')]));_0x3e0602[_0x518d('0x3e')]=_0x3e0602['attributes'][_0x518d('0x3f')]?_0x3e0602['attributes']:_0x2fd3db[_0x518d('0x38')];if(!_0x48c675[_0x518d('0x39')][_0x518d('0x40')](_0x518d('0x41'))){_0x3e0602['limit']=qs['limit'](_0x48c675[_0x518d('0x39')][_0x518d('0x20')]);_0x3e0602[_0x518d('0x21')]=qs['offset'](_0x48c675[_0x518d('0x39')][_0x518d('0x21')]);}_0x3e0602[_0x518d('0x42')]=qs[_0x518d('0x43')](_0x48c675['query']['sort']);_0x3e0602[_0x518d('0x44')]=qs[_0x518d('0x3b')](_[_0x518d('0x45')](_0x48c675[_0x518d('0x39')],_0x2fd3db[_0x518d('0x3b')]),_0x22cd1e);if(_0x48c675['query'][_0x518d('0x46')]){_0x3e0602[_0x518d('0x44')]=_[_0x518d('0x47')](_0x3e0602[_0x518d('0x44')],{'$or':_[_0x518d('0x32')](_0x22cd1e,function(_0x3f8121){if(_0x3f8121[_0x518d('0x36')]!=='VIRTUAL'){var _0x495dd0={};_0x495dd0[_0x3f8121[_0x518d('0x30')]]={'$like':'%'+_0x48c675[_0x518d('0x39')][_0x518d('0x46')]+'%'};return _0x495dd0;}})});}_0x3e0602=_[_0x518d('0x47')]({},_0x3e0602,_0x48c675[_0x518d('0x48')]);var _0x1e2cb5={'where':_0x3e0602[_0x518d('0x44')]};return db[_0x518d('0x33')]['count'](_0x1e2cb5)[_0x518d('0x2a')](function(_0xaf424){_0x5f3c13[_0x518d('0x22')]=_0xaf424;if(_0x48c675[_0x518d('0x39')]['includeAll']){_0x3e0602[_0x518d('0x49')]=[{'all':!![]}];}return db[_0x518d('0x33')][_0x518d('0x4a')](_0x3e0602);})['then'](function(_0x36d117){_0x5f3c13['rows']=_0x36d117;return _0x5f3c13;})[_0x518d('0x2a')](respondWithFilteredResult(_0x3dd8de,_0x3e0602))[_0x518d('0x4b')](handleError(_0x3dd8de,null));};exports['show']=function(_0x1884d1,_0x390a9c){var _0x26b431={'raw':!![],'where':{'id':_0x1884d1[_0x518d('0x4c')]['id']}},_0x104cc2={};_0x104cc2[_0x518d('0x38')]=_['keys'](db[_0x518d('0x33')][_0x518d('0x34')]);_0x104cc2[_0x518d('0x39')]=_[_0x518d('0x3a')](_0x1884d1[_0x518d('0x39')]);_0x104cc2[_0x518d('0x3b')]=_['intersection'](_0x104cc2[_0x518d('0x38')],_0x104cc2[_0x518d('0x39')]);_0x26b431[_0x518d('0x3e')]=_[_0x518d('0x3c')](_0x104cc2[_0x518d('0x38')],qs[_0x518d('0x3d')](_0x1884d1['query']['fields']));_0x26b431[_0x518d('0x3e')]=_0x26b431[_0x518d('0x3e')][_0x518d('0x3f')]?_0x26b431[_0x518d('0x3e')]:_0x104cc2[_0x518d('0x38')];if(_0x1884d1[_0x518d('0x39')]['includeAll']){_0x26b431[_0x518d('0x49')]=[{'all':!![]}];}_0x26b431=_[_0x518d('0x47')]({},_0x26b431,_0x1884d1[_0x518d('0x48')]);return db['OpenchannelQueue'][_0x518d('0x4d')](_0x26b431)['then'](handleEntityNotFound(_0x390a9c,null))[_0x518d('0x2a')](respondWithResult(_0x390a9c,null))['catch'](handleError(_0x390a9c,null));};exports[_0x518d('0x4e')]=function(_0x14dd2c,_0x79e7ec){return db[_0x518d('0x33')]['create'](_0x14dd2c[_0x518d('0x4f')],{})[_0x518d('0x2a')](function(_0x12baf9){var _0x11f775=_0x14dd2c['user'][_0x518d('0x2b')]({'plain':!![]});if(!_0x11f775)throw new Error(_0x518d('0x50'));if(_0x11f775[_0x518d('0x51')]==='user'){var _0x5e5a51=_0x12baf9[_0x518d('0x2b')]({'plain':!![]});var _0x88efe='OpenchannelQueues';return db[_0x518d('0x52')][_0x518d('0x4d')]({'where':{'name':_0x88efe,'userProfileId':_0x11f775['userProfileId']},'raw':!![]})['then'](function(_0x191886){if(_0x191886&&_0x191886[_0x518d('0x53')]===0x0){return db['UserProfileResource'][_0x518d('0x4e')]({'name':_0x5e5a51[_0x518d('0x30')],'resourceId':_0x5e5a51['id'],'type':_0x191886[_0x518d('0x30')],'sectionId':_0x191886['id']},{})[_0x518d('0x2a')](function(){return _0x12baf9;});}else{return _0x12baf9;}})[_0x518d('0x4b')](function(_0x5948ef){logger[_0x518d('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5948ef);throw _0x5948ef;});}return _0x12baf9;})[_0x518d('0x2a')](respondWithResult(_0x79e7ec,0xc9))[_0x518d('0x4b')](handleError(_0x79e7ec,null));};exports[_0x518d('0x54')]=function(_0x5e735b,_0x38be69){if(_0x5e735b[_0x518d('0x4f')]['id']){delete _0x5e735b[_0x518d('0x4f')]['id'];}return db[_0x518d('0x33')][_0x518d('0x4d')]({'where':{'id':_0x5e735b[_0x518d('0x4c')]['id']}})[_0x518d('0x2a')](handleEntityNotFound(_0x38be69,null))['then'](saveUpdates(_0x5e735b['body'],null))[_0x518d('0x2a')](respondWithResult(_0x38be69,null))[_0x518d('0x4b')](handleError(_0x38be69,null));};exports[_0x518d('0x29')]=function(_0x591fdb,_0x54ac69){return db['OpenchannelQueue']['find']({'where':{'id':_0x591fdb[_0x518d('0x4c')]['id']}})[_0x518d('0x2a')](handleEntityNotFound(_0x54ac69,null))[_0x518d('0x2a')](removeEntity(_0x54ac69,null))[_0x518d('0x4b')](handleError(_0x54ac69,null));};exports[_0x518d('0x55')]=function(_0x7f7176,_0x374cd0){return db[_0x518d('0x33')]['describe']()[_0x518d('0x2a')](respondWithResult(_0x374cd0,null))['catch'](handleError(_0x374cd0,null));};exports[_0x518d('0x56')]=function(_0x57b211,_0xde76ed,_0x1a20ad){var _0x1ac85d={'raw':!![],'where':{}},_0x3fd871={},_0x478850;return db[_0x518d('0x33')]['findOne']({'where':{'id':_0x57b211['params']['id']}})[_0x518d('0x2a')](handleEntityNotFound(_0xde76ed,null))[_0x518d('0x2a')](function(_0x45104d){if(_0x45104d){_0x478850=_0x45104d['get']({'plain':!![]});_0x3fd871[_0x518d('0x38')]=_[_0x518d('0x3a')](db[_0x518d('0x57')][_0x518d('0x34')]);_0x3fd871[_0x518d('0x39')]=_[_0x518d('0x3a')](_0x57b211[_0x518d('0x39')]);_0x3fd871[_0x518d('0x3b')]=_[_0x518d('0x3c')](_0x3fd871[_0x518d('0x38')],_0x3fd871[_0x518d('0x39')]);_0x1ac85d[_0x518d('0x3e')]=_['intersection'](_0x3fd871[_0x518d('0x38')],qs['fields'](_0x57b211[_0x518d('0x39')][_0x518d('0x3d')]));_0x1ac85d[_0x518d('0x3e')]=_0x1ac85d[_0x518d('0x3e')][_0x518d('0x3f')]?_0x1ac85d[_0x518d('0x3e')]:_0x3fd871['model'];if(!_0x57b211[_0x518d('0x39')][_0x518d('0x40')]('nolimit')){_0x1ac85d[_0x518d('0x20')]=qs['limit'](_0x57b211['query'][_0x518d('0x20')]);_0x1ac85d[_0x518d('0x21')]=qs[_0x518d('0x21')](_0x57b211[_0x518d('0x39')][_0x518d('0x21')]);}_0x1ac85d[_0x518d('0x42')]=qs[_0x518d('0x43')](_0x57b211['query']['sort']);_0x1ac85d['where']=qs[_0x518d('0x3b')](_[_0x518d('0x45')](_0x57b211[_0x518d('0x39')],_0x3fd871['filters']));_0x1ac85d['where'][_0x518d('0x58')]=_0x45104d['id'];if(_0x57b211['query']['filter']){_0x1ac85d[_0x518d('0x44')]=_['merge'](_0x1ac85d[_0x518d('0x44')],{'$or':_[_0x518d('0x32')](_0x1ac85d['attributes'],function(_0xcaf366){var _0x1df98e={};_0x1df98e[_0xcaf366]={'$like':'%'+_0x57b211['query']['filter']+'%'};return _0x1df98e;})});}_0x1ac85d=_[_0x518d('0x47')]({},_0x1ac85d,_0x57b211[_0x518d('0x48')]);return db[_0x518d('0x57')][_0x518d('0x4a')](_0x1ac85d);}})[_0x518d('0x2a')](function(_0x31a135){if(_0x31a135){return db[_0x518d('0x59')][_0x518d('0x5a')]({'where':{'id':_[_0x518d('0x32')](_0x31a135,_0x518d('0x5b')),'role':_0x518d('0x5c')},'attributes':['id','name','openchannelPause',_0x518d('0x5d'),'createdAt']});}})[_0x518d('0x2a')](function(_0x2100bb){if(_0x2100bb){return{'count':_0x2100bb[_0x518d('0x22')],'rows':_['map'](_0x2100bb[_0x518d('0x5e')],function(_0x46f79e){return{'membername':_0x46f79e[_0x518d('0x30')],'UserId':_0x46f79e['id'],'queue_name':_0x478850[_0x518d('0x30')],'OpenchannelQueueId':_0x478850['id'],'interface':util[_0x518d('0x5f')](_0x518d('0x60'),_0x518d('0x61'),_0x46f79e[_0x518d('0x30')]),'penalty':0x0,'paused':_0x46f79e[_0x518d('0x62')],'createdAt':_0x46f79e['createdAt'],'updatedAt':_0x46f79e[_0x518d('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x518d('0x2a')](respondWithFilteredResult(_0xde76ed,_0x1ac85d))[_0x518d('0x4b')](handleError(_0xde76ed,null));};exports[_0x518d('0x63')]=function(_0x50e2e8,_0x31b896,_0xb5c25c){var _0x447dd2={};var _0x1e480e={};var _0x4f6dad;var _0x444a32;return db[_0x518d('0x33')][_0x518d('0x64')]({'where':{'id':_0x50e2e8[_0x518d('0x4c')]['id']}})['then'](handleEntityNotFound(_0x31b896,null))[_0x518d('0x2a')](function(_0x55fca6){if(_0x55fca6){_0x4f6dad=_0x55fca6;_0x1e480e['model']=_[_0x518d('0x3a')](db[_0x518d('0x65')]['rawAttributes']);_0x1e480e[_0x518d('0x39')]=_[_0x518d('0x3a')](_0x50e2e8['query']);_0x1e480e[_0x518d('0x3b')]=_[_0x518d('0x3c')](_0x1e480e[_0x518d('0x38')],_0x1e480e[_0x518d('0x39')]);_0x447dd2[_0x518d('0x3e')]=_['intersection'](_0x1e480e[_0x518d('0x38')],qs[_0x518d('0x3d')](_0x50e2e8[_0x518d('0x39')][_0x518d('0x3d')]));_0x447dd2[_0x518d('0x3e')]=_0x447dd2[_0x518d('0x3e')]['length']?_0x447dd2['attributes']:_0x1e480e[_0x518d('0x38')];_0x447dd2[_0x518d('0x42')]=qs[_0x518d('0x43')](_0x50e2e8[_0x518d('0x39')][_0x518d('0x43')]);_0x447dd2[_0x518d('0x44')]=qs[_0x518d('0x3b')](_[_0x518d('0x45')](_0x50e2e8[_0x518d('0x39')],_0x1e480e['filters']));if(_0x50e2e8[_0x518d('0x39')][_0x518d('0x46')]){_0x447dd2[_0x518d('0x44')]=_[_0x518d('0x47')](_0x447dd2[_0x518d('0x44')],{'$or':_['map'](_0x447dd2['attributes'],function(_0x5deebe){var _0x18a32a={};_0x18a32a[_0x5deebe]={'$like':'%'+_0x50e2e8['query'][_0x518d('0x46')]+'%'};return _0x18a32a;})});}_0x447dd2=_[_0x518d('0x47')]({},_0x447dd2,_0x50e2e8[_0x518d('0x48')]);return _0x4f6dad['getTeams'](_0x447dd2);}})[_0x518d('0x2a')](function(_0xa8d8c){if(_0xa8d8c){_0x444a32=_0xa8d8c[_0x518d('0x3f')];if(!_0x50e2e8[_0x518d('0x39')][_0x518d('0x40')](_0x518d('0x41'))){_0x447dd2[_0x518d('0x20')]=qs[_0x518d('0x20')](_0x50e2e8['query'][_0x518d('0x20')]);_0x447dd2[_0x518d('0x21')]=qs[_0x518d('0x21')](_0x50e2e8[_0x518d('0x39')]['offset']);}return _0x4f6dad[_0x518d('0x63')](_0x447dd2);}})['then'](function(_0x572b8c){if(_0x572b8c){return _0x572b8c?{'count':_0x444a32,'rows':_0x572b8c}:null;}})['then'](respondWithResult(_0x31b896,null))[_0x518d('0x4b')](handleError(_0x31b896,null));};exports[_0x518d('0x66')]=function(_0x3870a3,_0xabd170,_0x3ff83a){var _0x27b456=_0x3870a3[_0x518d('0x4f')][_0x518d('0x67')];return db[_0x518d('0x65')][_0x518d('0x4a')]({'where':{'id':_0x27b456},'attributes':['id'],'include':[{'model':db['User'],'as':_0x518d('0x68'),'attributes':['id','name',_0x518d('0x69'),_0x518d('0x6a'),_0x518d('0x6b')],'raw':!![]}]})[_0x518d('0x2a')](function(_0x4245f7){if(_0x4245f7){var _0xf84b66=_[_0x518d('0x6c')](_0x4245f7,function(_0x1b0cd6){var _0x4ca113=_0x1b0cd6[_0x518d('0x2b')]({'plain':!![]});return _0x4ca113[_0x518d('0x68')];});return db[_0x518d('0x33')][_0x518d('0x4d')]({'where':{'id':_0x3870a3[_0x518d('0x4c')]['id']}})['then'](function(_0x38bcfa){return db[_0x518d('0x6d')][_0x518d('0x6e')](function(_0x2751e9){return _0x38bcfa[_0x518d('0x66')](_0x27b456,{'transaction':_0x2751e9})['then'](function(){return BPromise[_0x518d('0x6f')](_0xf84b66,function(_0x24a2ca){return db[_0x518d('0x57')]['findOrCreate']({'where':{'UserId':_0x24a2ca['id'],'OpenchannelQueueId':_0x3870a3[_0x518d('0x4c')]['id']},'transaction':_0x2751e9});});})[_0x518d('0x2a')](function(){_0xf84b66[_0x518d('0x70')](function(_0x20ad18){socket[_0x518d('0x71')]('userOpenchannelQueue:save',{'UserId':_0x20ad18['id'],'OpenchannelQueueId':_0x38bcfa['id']});});});});});}})[_0x518d('0x2a')](respondWithStatusCode(_0xabd170,null))[_0x518d('0x4b')](handleError(_0xabd170,null));};exports['removeTeams']=function(_0x5c313b,_0x341058,_0x567a12){return db['Team'][_0x518d('0x4a')]({'where':{'id':_0x5c313b[_0x518d('0x39')][_0x518d('0x67')]},'attributes':['id'],'include':[{'model':db[_0x518d('0x59')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x518d('0x2a')](handleEntityNotFound(_0x341058,null))[_0x518d('0x2a')](function(_0x3e4b2f){var _0x22c963=_['map'](_0x3e4b2f,'id');var _0x42ef58=[];var _0x4335c0=[];var _0x32c2ad=squel[_0x518d('0x72')]();_0x32c2ad[_0x518d('0x73')](_0x518d('0x74'))[_0x518d('0x75')]('team_has_openchannel_queues','tq')['join']('user_has_teams','ut',_0x518d('0x76'))['where']('OpenchannelQueueId\x20=\x20?',_0x5c313b[_0x518d('0x4c')]['id']);for(var _0x12b4d4=0x0;_0x12b4d4<_0x3e4b2f[_0x518d('0x3f')];_0x12b4d4+=0x1){let _0x337b47=_0x3e4b2f[_0x12b4d4];for(var _0x3cb125=0x0;_0x3cb125<_0x337b47[_0x518d('0x68')]['length'];_0x3cb125+=0x1){let _0x5355b3=_0x337b47[_0x518d('0x68')][_0x3cb125];var _0x18b96f=_0x32c2ad[_0x518d('0x77')]();_0x18b96f[_0x518d('0x44')]('ut.UserId\x20=\x20?',_0x5355b3['id']);_0x4335c0[_0x518d('0x78')](db[_0x518d('0x6d')][_0x518d('0x39')](_0x18b96f[_0x518d('0x79')](),{'type':db[_0x518d('0x6d')]['QueryTypes'][_0x518d('0x7a')]})[_0x518d('0x2a')](function(_0x331edb){if(_0x331edb[_0x518d('0x3f')]===0x1){return _0x5355b3['id'];}else{var _0x2749c5=_[_0x518d('0x7b')](_['map'](_0x331edb,_0x518d('0x7c')),function(_0x5055ed){return _[_0x518d('0x7d')](_0x22c963,_0x5055ed);});if(_0x2749c5){return _0x5355b3['id'];}}}));}}return BPromise[_0x518d('0x7e')](_0x4335c0)[_0x518d('0x2a')](function(_0x150d91){_0x42ef58=_(_0x42ef58)[_0x518d('0x7f')](_0x150d91)[_0x518d('0x80')]()[_0x518d('0x81')]();return db[_0x518d('0x33')][_0x518d('0x4d')]({'where':{'id':_0x5c313b[_0x518d('0x4c')]['id']}})[_0x518d('0x2a')](function(_0x13b8cb){return db[_0x518d('0x6d')]['transaction'](function(_0x4c00a7){return _0x13b8cb['removeTeams'](_0x5c313b[_0x518d('0x39')][_0x518d('0x67')],{'transaction':_0x4c00a7})[_0x518d('0x2a')](function(){if(!_[_0x518d('0x82')](_0x42ef58)){return _0x13b8cb[_0x518d('0x83')](_0x42ef58,{'transaction':_0x4c00a7});}})[_0x518d('0x2a')](function(){_0x42ef58['forEach'](function(_0x59d18d){socket[_0x518d('0x71')](_0x518d('0x84'),{'UserId':_0x59d18d,'OpenchannelQueueId':_0x13b8cb['id']});});});});});});})[_0x518d('0x2a')](respondWithStatusCode(_0x341058,null))[_0x518d('0x4b')](handleError(_0x341058,null));};exports[_0x518d('0x85')]=function(_0x2242b9,_0x44c9de,_0x55a523){return db[_0x518d('0x33')]['find']({'where':{'id':_0x2242b9['params']['id']}})[_0x518d('0x2a')](handleEntityNotFound(_0x44c9de,null))[_0x518d('0x2a')](function(_0x427fcd){if(_0x427fcd){return _0x427fcd[_0x518d('0x85')](_0x2242b9[_0x518d('0x4f')][_0x518d('0x67')],_[_0x518d('0x86')](_0x2242b9[_0x518d('0x4f')],[_0x518d('0x67'),'id'])||{})[_0x518d('0x87')](function(_0xdca405){for(var _0xa87548=0x0;_0xa87548<_0x2242b9[_0x518d('0x4f')][_0x518d('0x67')][_0x518d('0x3f')];_0xa87548+=0x1){socket[_0x518d('0x71')]('userOpenchannelQueue:save',{'UserId':Number(_0x2242b9[_0x518d('0x4f')][_0x518d('0x67')][_0xa87548]),'OpenchannelQueueId':Number(_0x2242b9[_0x518d('0x4c')]['id'])});}return _0xdca405;});}})[_0x518d('0x2a')](respondWithResult(_0x44c9de,null))[_0x518d('0x4b')](handleError(_0x44c9de,null));};exports[_0x518d('0x83')]=function(_0x2a5b0d,_0xf8b266,_0x517360){return db[_0x518d('0x33')]['find']({'where':{'id':_0x2a5b0d[_0x518d('0x4c')]['id']}})['then'](handleEntityNotFound(_0xf8b266,null))[_0x518d('0x2a')](function(_0x3879dc){if(_0x3879dc){return _0x3879dc[_0x518d('0x83')](_0x2a5b0d[_0x518d('0x39')][_0x518d('0x67')])[_0x518d('0x2a')](function(){if(_[_0x518d('0x88')](_0x2a5b0d[_0x518d('0x39')][_0x518d('0x67')])){for(var _0x561e9c=0x0;_0x561e9c<_0x2a5b0d[_0x518d('0x39')][_0x518d('0x67')][_0x518d('0x3f')];_0x561e9c+=0x1){socket['emit'](_0x518d('0x84'),{'UserId':Number(_0x2a5b0d[_0x518d('0x39')][_0x518d('0x67')][_0x561e9c]),'OpenchannelQueueId':Number(_0x2a5b0d['params']['id'])});}}else{socket[_0x518d('0x71')]('userOpenchannelQueue:remove',{'UserId':Number(_0x2a5b0d[_0x518d('0x39')][_0x518d('0x67')]),'OpenchannelQueueId':Number(_0x2a5b0d['params']['id'])});}});}})[_0x518d('0x2a')](respondWithStatusCode(_0xf8b266,null))[_0x518d('0x4b')](handleError(_0xf8b266,null));};exports[_0x518d('0x89')]=function(_0x3814b7,_0x1c3b4a,_0x24746c){var _0xed3241={};var _0x13a58b={};var _0xdbf577;var _0x333c2f;return db[_0x518d('0x33')][_0x518d('0x64')]({'where':{'id':_0x3814b7['params']['id']}})['then'](handleEntityNotFound(_0x1c3b4a,null))[_0x518d('0x2a')](function(_0x31ac60){if(_0x31ac60){_0xdbf577=_0x31ac60;_0x13a58b[_0x518d('0x38')]=_[_0x518d('0x3a')](db['User'][_0x518d('0x34')]);_0x13a58b[_0x518d('0x39')]=_[_0x518d('0x3a')](_0x3814b7[_0x518d('0x39')]);_0x13a58b['filters']=_[_0x518d('0x3c')](_0x13a58b[_0x518d('0x38')],_0x13a58b[_0x518d('0x39')]);_0xed3241['attributes']=_[_0x518d('0x3c')](_0x13a58b[_0x518d('0x38')],qs[_0x518d('0x3d')](_0x3814b7[_0x518d('0x39')][_0x518d('0x3d')]));_0xed3241[_0x518d('0x3e')]=_0xed3241['attributes'][_0x518d('0x3f')]?_0xed3241[_0x518d('0x3e')]:_0x13a58b['model'];_0xed3241['order']=qs[_0x518d('0x43')](_0x3814b7[_0x518d('0x39')][_0x518d('0x43')]);_0xed3241[_0x518d('0x44')]=qs[_0x518d('0x3b')](_['pick'](_0x3814b7[_0x518d('0x39')],_0x13a58b[_0x518d('0x3b')]));if(_0x3814b7[_0x518d('0x39')][_0x518d('0x46')]){_0xed3241[_0x518d('0x44')]=_[_0x518d('0x47')](_0xed3241[_0x518d('0x44')],{'$or':_[_0x518d('0x32')](_0xed3241['attributes'],function(_0x2bc8e0){var _0x2b00bd={};_0x2b00bd[_0x2bc8e0]={'$like':'%'+_0x3814b7['query'][_0x518d('0x46')]+'%'};return _0x2b00bd;})});}_0xed3241=_['merge']({},_0xed3241,_0x3814b7[_0x518d('0x48')]);return _0xdbf577[_0x518d('0x89')](_0xed3241);}})[_0x518d('0x2a')](function(_0x4b1589){if(_0x4b1589){_0x333c2f=_0x4b1589[_0x518d('0x3f')];if(!_0x3814b7['query']['hasOwnProperty'](_0x518d('0x41'))){_0xed3241['limit']=qs['limit'](_0x3814b7[_0x518d('0x39')][_0x518d('0x20')]);_0xed3241['offset']=qs[_0x518d('0x21')](_0x3814b7[_0x518d('0x39')]['offset']);}return _0xdbf577['getAgents'](_0xed3241);}})[_0x518d('0x2a')](function(_0x335421){if(_0x335421){return _0x335421?{'count':_0x333c2f,'rows':_0x335421}:null;}})[_0x518d('0x2a')](respondWithResult(_0x1c3b4a,null))['catch'](handleError(_0x1c3b4a,null));}; \ No newline at end of file +var _0x866f=['update','then','destroy','get','OpenchannelQueues','UserProfileResource','sendStatus','error','stack','name','map','OpenchannelQueue','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','params','describe','getMembers','UserOpenchannelQueue','OpenchannelQueueId','User','findAndCountAll','UserId','openchannelPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','findOne','Team','ids','Agents','online','interface','transaction','addTeams','each','forEach','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','union','value','isEmpty','removeAgents','emit','userOpenchannelQueue:remove','addAgents','spread','userOpenchannelQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject'];(function(_0x193c16,_0x444cdb){var _0x406707=function(_0x3f904c){while(--_0x3f904c){_0x193c16['push'](_0x193c16['shift']());}};_0x406707(++_0x444cdb);}(_0x866f,0x182));var _0xf866=function(_0x391f58,_0x504d9b){_0x391f58=_0x391f58-0x0;var _0x4f88ec=_0x866f[_0x391f58];return _0x4f88ec;};'use strict';var emlformat=require(_0xf866('0x0'));var rimraf=require(_0xf866('0x1'));var zipdir=require(_0xf866('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf866('0x3'));var moment=require(_0xf866('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf866('0x5'));var util=require(_0xf866('0x6'));var path=require('path');var sox=require(_0xf866('0x7'));var csv=require(_0xf866('0x8'));var ejs=require(_0xf866('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf866('0xa'));var squel=require(_0xf866('0xb'));var crypto=require('crypto');var jsforce=require(_0xf866('0xc'));var deskjs=require(_0xf866('0xd'));var toCsv=require(_0xf866('0x8'));var querystring=require('querystring');var Papa=require(_0xf866('0xe'));var Redis=require(_0xf866('0xf'));var authService=require(_0xf866('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xf866('0x11'));var hardwareService=require(_0xf866('0x12'));var logger=require(_0xf866('0x13'))(_0xf866('0x14'));var utils=require('../../config/utils');var config=require(_0xf866('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf866('0x16'))['db'];config[_0xf866('0x17')]=_[_0xf866('0x18')](config['redis'],{'host':_0xf866('0x19'),'port':0x18eb});var socket=require(_0xf866('0x1a'))(new Redis(config['redis']));require(_0xf866('0x1b'))[_0xf866('0x1c')](socket);function respondWithStatusCode(_0x30f335,_0x4901dc){_0x4901dc=_0x4901dc||0xcc;return function(_0x4ae0c6){if(_0x4ae0c6){return _0x30f335['sendStatus'](_0x4901dc);}return _0x30f335[_0xf866('0x1d')](_0x4901dc)[_0xf866('0x1e')]();};}function respondWithResult(_0x507a69,_0x4bd03d){_0x4bd03d=_0x4bd03d||0xc8;return function(_0x2d11ca){if(_0x2d11ca){return _0x507a69[_0xf866('0x1d')](_0x4bd03d)['json'](_0x2d11ca);}};}function respondWithFilteredResult(_0x3a079f,_0x2f4049){return function(_0x2cba55){if(_0x2cba55){var _0x37e27e=typeof _0x2f4049[_0xf866('0x1f')]==='undefined'&&typeof _0x2f4049[_0xf866('0x20')]===_0xf866('0x21');var _0x44dfa5=_0x2cba55[_0xf866('0x22')];var _0x3355d9=_0x37e27e?0x0:_0x2f4049['offset'];var _0x4a16ce=_0x37e27e?_0x2cba55['count']:_0x2f4049['offset']+_0x2f4049[_0xf866('0x20')];var _0x3a663d;if(_0x4a16ce>=_0x44dfa5){_0x4a16ce=_0x44dfa5;_0x3a663d=0xc8;}else{_0x3a663d=0xce;}_0x3a079f['status'](_0x3a663d);return _0x3a079f[_0xf866('0x23')](_0xf866('0x24'),_0x3355d9+'-'+_0x4a16ce+'/'+_0x44dfa5)[_0xf866('0x25')](_0x2cba55);}return null;};}function patchUpdates(_0x3f2b84){return function(_0x156bd4){try{jsonpatch[_0xf866('0x26')](_0x156bd4,_0x3f2b84,!![]);}catch(_0x426490){return BPromise[_0xf866('0x27')](_0x426490);}return _0x156bd4['save']();};}function saveUpdates(_0x55d7a1,_0x45b279){return function(_0x2955a9){if(_0x2955a9){return _0x2955a9[_0xf866('0x28')](_0x55d7a1)[_0xf866('0x29')](function(_0x2e07c0){return _0x2e07c0;});}return null;};}function removeEntity(_0x514e2f,_0x3e4aa3){return function(_0x2fe6ef){if(_0x2fe6ef){return _0x2fe6ef[_0xf866('0x2a')]()[_0xf866('0x29')](function(){var _0x1bd49c=_0x2fe6ef[_0xf866('0x2b')]({'plain':!![]});var _0x1d8148=_0xf866('0x2c');return db[_0xf866('0x2d')][_0xf866('0x2a')]({'where':{'type':_0x1d8148,'resourceId':_0x1bd49c['id']}})[_0xf866('0x29')](function(){return _0x2fe6ef;});})[_0xf866('0x29')](function(){_0x514e2f[_0xf866('0x1d')](0xcc)[_0xf866('0x1e')]();});}};}function handleEntityNotFound(_0x3b23f8,_0x2152cb){return function(_0x423818){if(!_0x423818){_0x3b23f8[_0xf866('0x2e')](0x194);}return _0x423818;};}function handleError(_0x3f87f5,_0x2c709b){_0x2c709b=_0x2c709b||0x1f4;return function(_0x38bf7e){logger[_0xf866('0x2f')](_0x38bf7e[_0xf866('0x30')]);if(_0x38bf7e[_0xf866('0x31')]){delete _0x38bf7e[_0xf866('0x31')];}_0x3f87f5[_0xf866('0x1d')](_0x2c709b)['send'](_0x38bf7e);};}exports['index']=function(_0x3b4b0a,_0x58b6b0){var _0x3bb55d={},_0x3162c6={},_0x3a6b73={'count':0x0,'rows':[]};var _0x393eab=_[_0xf866('0x32')](db[_0xf866('0x33')][_0xf866('0x34')],function(_0x22c0af){return{'name':_0x22c0af[_0xf866('0x35')],'type':_0x22c0af[_0xf866('0x36')][_0xf866('0x37')]};});_0x3162c6[_0xf866('0x38')]=_[_0xf866('0x32')](_0x393eab,_0xf866('0x31'));_0x3162c6['query']=_[_0xf866('0x39')](_0x3b4b0a[_0xf866('0x3a')]);_0x3162c6[_0xf866('0x3b')]=_[_0xf866('0x3c')](_0x3162c6['model'],_0x3162c6[_0xf866('0x3a')]);_0x3bb55d[_0xf866('0x3d')]=_['intersection'](_0x3162c6[_0xf866('0x38')],qs[_0xf866('0x3e')](_0x3b4b0a[_0xf866('0x3a')]['fields']));_0x3bb55d[_0xf866('0x3d')]=_0x3bb55d[_0xf866('0x3d')][_0xf866('0x3f')]?_0x3bb55d[_0xf866('0x3d')]:_0x3162c6['model'];if(!_0x3b4b0a[_0xf866('0x3a')][_0xf866('0x40')](_0xf866('0x41'))){_0x3bb55d[_0xf866('0x20')]=qs['limit'](_0x3b4b0a[_0xf866('0x3a')][_0xf866('0x20')]);_0x3bb55d[_0xf866('0x1f')]=qs['offset'](_0x3b4b0a['query'][_0xf866('0x1f')]);}_0x3bb55d[_0xf866('0x42')]=qs[_0xf866('0x43')](_0x3b4b0a[_0xf866('0x3a')]['sort']);_0x3bb55d[_0xf866('0x44')]=qs['filters'](_[_0xf866('0x45')](_0x3b4b0a[_0xf866('0x3a')],_0x3162c6[_0xf866('0x3b')]),_0x393eab);if(_0x3b4b0a['query'][_0xf866('0x46')]){_0x3bb55d[_0xf866('0x44')]=_[_0xf866('0x47')](_0x3bb55d['where'],{'$or':_[_0xf866('0x32')](_0x393eab,function(_0x5e39c6){if(_0x5e39c6[_0xf866('0x36')]!==_0xf866('0x48')){var _0x38b79f={};_0x38b79f[_0x5e39c6[_0xf866('0x31')]]={'$like':'%'+_0x3b4b0a[_0xf866('0x3a')][_0xf866('0x46')]+'%'};return _0x38b79f;}})});}_0x3bb55d=_['merge']({},_0x3bb55d,_0x3b4b0a['options']);var _0x255e57={'where':_0x3bb55d['where']};return db['OpenchannelQueue'][_0xf866('0x22')](_0x255e57)[_0xf866('0x29')](function(_0x51c67d){_0x3a6b73[_0xf866('0x22')]=_0x51c67d;if(_0x3b4b0a[_0xf866('0x3a')][_0xf866('0x49')]){_0x3bb55d[_0xf866('0x4a')]=[{'all':!![]}];}return db[_0xf866('0x33')][_0xf866('0x4b')](_0x3bb55d);})[_0xf866('0x29')](function(_0x3b6d4c){_0x3a6b73[_0xf866('0x4c')]=_0x3b6d4c;return _0x3a6b73;})[_0xf866('0x29')](respondWithFilteredResult(_0x58b6b0,_0x3bb55d))[_0xf866('0x4d')](handleError(_0x58b6b0,null));};exports[_0xf866('0x4e')]=function(_0x5e1056,_0x1a1ff1){var _0x3d2ab5={'raw':!![],'where':{'id':_0x5e1056['params']['id']}},_0x5b0040={};_0x5b0040[_0xf866('0x38')]=_[_0xf866('0x39')](db[_0xf866('0x33')][_0xf866('0x34')]);_0x5b0040[_0xf866('0x3a')]=_[_0xf866('0x39')](_0x5e1056[_0xf866('0x3a')]);_0x5b0040['filters']=_[_0xf866('0x3c')](_0x5b0040[_0xf866('0x38')],_0x5b0040[_0xf866('0x3a')]);_0x3d2ab5['attributes']=_['intersection'](_0x5b0040[_0xf866('0x38')],qs['fields'](_0x5e1056[_0xf866('0x3a')]['fields']));_0x3d2ab5['attributes']=_0x3d2ab5[_0xf866('0x3d')]['length']?_0x3d2ab5[_0xf866('0x3d')]:_0x5b0040[_0xf866('0x38')];if(_0x5e1056[_0xf866('0x3a')][_0xf866('0x49')]){_0x3d2ab5[_0xf866('0x4a')]=[{'all':!![]}];}_0x3d2ab5=_[_0xf866('0x47')]({},_0x3d2ab5,_0x5e1056[_0xf866('0x4f')]);return db['OpenchannelQueue'][_0xf866('0x50')](_0x3d2ab5)[_0xf866('0x29')](handleEntityNotFound(_0x1a1ff1,null))['then'](respondWithResult(_0x1a1ff1,null))[_0xf866('0x4d')](handleError(_0x1a1ff1,null));};exports[_0xf866('0x51')]=function(_0xcb1ce1,_0x3af212){return db[_0xf866('0x33')][_0xf866('0x51')](_0xcb1ce1[_0xf866('0x52')],{})[_0xf866('0x29')](function(_0x263f8d){var _0x55fab6=_0xcb1ce1[_0xf866('0x53')]['get']({'plain':!![]});if(!_0x55fab6)throw new Error(_0xf866('0x54'));if(_0x55fab6[_0xf866('0x55')]==='user'){var _0x2b2dc6=_0x263f8d[_0xf866('0x2b')]({'plain':!![]});var _0x5c7d58=_0xf866('0x2c');return db[_0xf866('0x56')][_0xf866('0x50')]({'where':{'name':_0x5c7d58,'userProfileId':_0x55fab6[_0xf866('0x57')]},'raw':!![]})['then'](function(_0x5eb849){if(_0x5eb849&&_0x5eb849[_0xf866('0x58')]===0x0){return db['UserProfileResource'][_0xf866('0x51')]({'name':_0x2b2dc6[_0xf866('0x31')],'resourceId':_0x2b2dc6['id'],'type':_0x5eb849[_0xf866('0x31')],'sectionId':_0x5eb849['id']},{})[_0xf866('0x29')](function(){return _0x263f8d;});}else{return _0x263f8d;}})['catch'](function(_0x56495e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x56495e);throw _0x56495e;});}return _0x263f8d;})['then'](respondWithResult(_0x3af212,0xc9))[_0xf866('0x4d')](handleError(_0x3af212,null));};exports['update']=function(_0x7f11b4,_0x299130){if(_0x7f11b4[_0xf866('0x52')]['id']){delete _0x7f11b4[_0xf866('0x52')]['id'];}return db[_0xf866('0x33')][_0xf866('0x50')]({'where':{'id':_0x7f11b4['params']['id']}})[_0xf866('0x29')](handleEntityNotFound(_0x299130,null))['then'](saveUpdates(_0x7f11b4[_0xf866('0x52')],null))['then'](respondWithResult(_0x299130,null))[_0xf866('0x4d')](handleError(_0x299130,null));};exports['destroy']=function(_0x21ffa2,_0x228c7c){return db[_0xf866('0x33')][_0xf866('0x50')]({'where':{'id':_0x21ffa2[_0xf866('0x59')]['id']}})[_0xf866('0x29')](handleEntityNotFound(_0x228c7c,null))[_0xf866('0x29')](removeEntity(_0x228c7c,null))[_0xf866('0x4d')](handleError(_0x228c7c,null));};exports['describe']=function(_0x1838ec,_0x4c8725){return db[_0xf866('0x33')][_0xf866('0x5a')]()[_0xf866('0x29')](respondWithResult(_0x4c8725,null))[_0xf866('0x4d')](handleError(_0x4c8725,null));};exports[_0xf866('0x5b')]=function(_0x1b59c0,_0x57e254,_0x1eee5){var _0xb8e79f={'raw':!![],'where':{}},_0x40b530={},_0x529b7d;return db[_0xf866('0x33')]['findOne']({'where':{'id':_0x1b59c0[_0xf866('0x59')]['id']}})[_0xf866('0x29')](handleEntityNotFound(_0x57e254,null))['then'](function(_0x4721bb){if(_0x4721bb){_0x529b7d=_0x4721bb[_0xf866('0x2b')]({'plain':!![]});_0x40b530[_0xf866('0x38')]=_['keys'](db[_0xf866('0x5c')][_0xf866('0x34')]);_0x40b530[_0xf866('0x3a')]=_[_0xf866('0x39')](_0x1b59c0[_0xf866('0x3a')]);_0x40b530[_0xf866('0x3b')]=_['intersection'](_0x40b530[_0xf866('0x38')],_0x40b530['query']);_0xb8e79f[_0xf866('0x3d')]=_[_0xf866('0x3c')](_0x40b530['model'],qs['fields'](_0x1b59c0[_0xf866('0x3a')][_0xf866('0x3e')]));_0xb8e79f[_0xf866('0x3d')]=_0xb8e79f[_0xf866('0x3d')]['length']?_0xb8e79f[_0xf866('0x3d')]:_0x40b530[_0xf866('0x38')];if(!_0x1b59c0['query'][_0xf866('0x40')](_0xf866('0x41'))){_0xb8e79f[_0xf866('0x20')]=qs[_0xf866('0x20')](_0x1b59c0[_0xf866('0x3a')][_0xf866('0x20')]);_0xb8e79f['offset']=qs[_0xf866('0x1f')](_0x1b59c0[_0xf866('0x3a')]['offset']);}_0xb8e79f[_0xf866('0x42')]=qs['sort'](_0x1b59c0[_0xf866('0x3a')][_0xf866('0x43')]);_0xb8e79f[_0xf866('0x44')]=qs['filters'](_['pick'](_0x1b59c0[_0xf866('0x3a')],_0x40b530[_0xf866('0x3b')]));_0xb8e79f['where'][_0xf866('0x5d')]=_0x4721bb['id'];if(_0x1b59c0[_0xf866('0x3a')][_0xf866('0x46')]){_0xb8e79f[_0xf866('0x44')]=_[_0xf866('0x47')](_0xb8e79f[_0xf866('0x44')],{'$or':_[_0xf866('0x32')](_0xb8e79f[_0xf866('0x3d')],function(_0x30f2d4){var _0x301645={};_0x301645[_0x30f2d4]={'$like':'%'+_0x1b59c0[_0xf866('0x3a')]['filter']+'%'};return _0x301645;})});}_0xb8e79f=_[_0xf866('0x47')]({},_0xb8e79f,_0x1b59c0[_0xf866('0x4f')]);return db[_0xf866('0x5c')][_0xf866('0x4b')](_0xb8e79f);}})[_0xf866('0x29')](function(_0x17ae55){if(_0x17ae55){return db[_0xf866('0x5e')][_0xf866('0x5f')]({'where':{'id':_['map'](_0x17ae55,_0xf866('0x60')),'role':'agent'},'attributes':['id',_0xf866('0x31'),_0xf866('0x61'),_0xf866('0x62'),'createdAt']});}})['then'](function(_0x313b6e){if(_0x313b6e){return{'count':_0x313b6e['count'],'rows':_[_0xf866('0x32')](_0x313b6e[_0xf866('0x4c')],function(_0x4733e8){return{'membername':_0x4733e8['name'],'UserId':_0x4733e8['id'],'queue_name':_0x529b7d['name'],'OpenchannelQueueId':_0x529b7d['id'],'interface':util[_0xf866('0x63')](_0xf866('0x64'),_0xf866('0x65'),_0x4733e8[_0xf866('0x31')]),'penalty':0x0,'paused':_0x4733e8[_0xf866('0x61')],'createdAt':_0x4733e8[_0xf866('0x66')],'updatedAt':_0x4733e8['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xf866('0x29')](respondWithFilteredResult(_0x57e254,_0xb8e79f))[_0xf866('0x4d')](handleError(_0x57e254,null));};exports[_0xf866('0x67')]=function(_0x94b37c,_0x54a7b9,_0x22a731){var _0x25fed3={};var _0x1e1cc1={};var _0x35f4da;var _0x1d89d9;return db['OpenchannelQueue'][_0xf866('0x68')]({'where':{'id':_0x94b37c[_0xf866('0x59')]['id']}})[_0xf866('0x29')](handleEntityNotFound(_0x54a7b9,null))[_0xf866('0x29')](function(_0x5acc68){if(_0x5acc68){_0x35f4da=_0x5acc68;_0x1e1cc1[_0xf866('0x38')]=_['keys'](db[_0xf866('0x69')][_0xf866('0x34')]);_0x1e1cc1[_0xf866('0x3a')]=_['keys'](_0x94b37c['query']);_0x1e1cc1[_0xf866('0x3b')]=_[_0xf866('0x3c')](_0x1e1cc1[_0xf866('0x38')],_0x1e1cc1[_0xf866('0x3a')]);_0x25fed3['attributes']=_['intersection'](_0x1e1cc1[_0xf866('0x38')],qs['fields'](_0x94b37c[_0xf866('0x3a')][_0xf866('0x3e')]));_0x25fed3[_0xf866('0x3d')]=_0x25fed3['attributes']['length']?_0x25fed3[_0xf866('0x3d')]:_0x1e1cc1['model'];_0x25fed3[_0xf866('0x42')]=qs[_0xf866('0x43')](_0x94b37c['query'][_0xf866('0x43')]);_0x25fed3[_0xf866('0x44')]=qs['filters'](_[_0xf866('0x45')](_0x94b37c['query'],_0x1e1cc1[_0xf866('0x3b')]));if(_0x94b37c[_0xf866('0x3a')][_0xf866('0x46')]){_0x25fed3[_0xf866('0x44')]=_['merge'](_0x25fed3[_0xf866('0x44')],{'$or':_[_0xf866('0x32')](_0x25fed3[_0xf866('0x3d')],function(_0x30e27f){var _0x3df59d={};_0x3df59d[_0x30e27f]={'$like':'%'+_0x94b37c[_0xf866('0x3a')][_0xf866('0x46')]+'%'};return _0x3df59d;})});}_0x25fed3=_['merge']({},_0x25fed3,_0x94b37c['options']);return _0x35f4da[_0xf866('0x67')](_0x25fed3);}})[_0xf866('0x29')](function(_0x40c870){if(_0x40c870){_0x1d89d9=_0x40c870['length'];if(!_0x94b37c[_0xf866('0x3a')][_0xf866('0x40')](_0xf866('0x41'))){_0x25fed3['limit']=qs[_0xf866('0x20')](_0x94b37c[_0xf866('0x3a')][_0xf866('0x20')]);_0x25fed3[_0xf866('0x1f')]=qs[_0xf866('0x1f')](_0x94b37c['query']['offset']);}return _0x35f4da[_0xf866('0x67')](_0x25fed3);}})['then'](function(_0x197734){if(_0x197734){return _0x197734?{'count':_0x1d89d9,'rows':_0x197734}:null;}})[_0xf866('0x29')](respondWithResult(_0x54a7b9,null))[_0xf866('0x4d')](handleError(_0x54a7b9,null));};exports['addTeams']=function(_0x2afcc4,_0x22752b,_0x4d7d7c){var _0x169b45=_0x2afcc4['body'][_0xf866('0x6a')];return db[_0xf866('0x69')][_0xf866('0x4b')]({'where':{'id':_0x169b45},'attributes':['id'],'include':[{'model':db[_0xf866('0x5e')],'as':_0xf866('0x6b'),'attributes':['id','name',_0xf866('0x6c'),'voicePause',_0xf866('0x6d')],'raw':!![]}]})[_0xf866('0x29')](function(_0x4aa348){if(_0x4aa348){var _0x24b689=_['flatMap'](_0x4aa348,function(_0x2dfba0){var _0x2a1e43=_0x2dfba0[_0xf866('0x2b')]({'plain':!![]});return _0x2a1e43[_0xf866('0x6b')];});return db[_0xf866('0x33')][_0xf866('0x50')]({'where':{'id':_0x2afcc4[_0xf866('0x59')]['id']}})[_0xf866('0x29')](function(_0x5ce1ac){return db['sequelize'][_0xf866('0x6e')](function(_0x4dc8f9){return _0x5ce1ac[_0xf866('0x6f')](_0x169b45,{'transaction':_0x4dc8f9})[_0xf866('0x29')](function(){return BPromise[_0xf866('0x70')](_0x24b689,function(_0x2ef237){return db[_0xf866('0x5c')]['findOrCreate']({'where':{'UserId':_0x2ef237['id'],'OpenchannelQueueId':_0x2afcc4[_0xf866('0x59')]['id']},'transaction':_0x4dc8f9});});})[_0xf866('0x29')](function(){_0x24b689[_0xf866('0x71')](function(_0x5c7cf1){socket['emit']('userOpenchannelQueue:save',{'UserId':_0x5c7cf1['id'],'OpenchannelQueueId':_0x5ce1ac['id']});});});});});}})[_0xf866('0x29')](respondWithStatusCode(_0x22752b,null))[_0xf866('0x4d')](handleError(_0x22752b,null));};exports[_0xf866('0x72')]=function(_0x3147a8,_0x3c8389,_0x4dc11b){return db[_0xf866('0x69')]['findAll']({'where':{'id':_0x3147a8['query'][_0xf866('0x6a')]},'attributes':['id'],'include':[{'model':db[_0xf866('0x5e')],'as':_0xf866('0x6b'),'attributes':['id'],'raw':!![]}]})[_0xf866('0x29')](handleEntityNotFound(_0x3c8389,null))[_0xf866('0x29')](function(_0x11bc88){var _0x26c821=_['map'](_0x11bc88,'id');var _0x262c1d=[];var _0xe5a016=[];var _0x302ba9=squel[_0xf866('0x73')]();_0x302ba9[_0xf866('0x74')](_0xf866('0x75'))[_0xf866('0x76')](_0xf866('0x77'),'tq')[_0xf866('0x78')](_0xf866('0x79'),'ut',_0xf866('0x7a'))[_0xf866('0x44')](_0xf866('0x7b'),_0x3147a8[_0xf866('0x59')]['id']);for(var _0x48851a=0x0;_0x48851a<_0x11bc88['length'];_0x48851a+=0x1){let _0x2a83fa=_0x11bc88[_0x48851a];for(var _0xaee6e0=0x0;_0xaee6e0<_0x2a83fa[_0xf866('0x6b')][_0xf866('0x3f')];_0xaee6e0+=0x1){let _0x1e2a49=_0x2a83fa[_0xf866('0x6b')][_0xaee6e0];var _0x497945=_0x302ba9[_0xf866('0x7c')]();_0x497945[_0xf866('0x44')](_0xf866('0x7d'),_0x1e2a49['id']);_0xe5a016[_0xf866('0x7e')](db[_0xf866('0x7f')]['query'](_0x497945[_0xf866('0x80')](),{'type':db['sequelize'][_0xf866('0x81')][_0xf866('0x82')]})[_0xf866('0x29')](function(_0x1776f3){if(_0x1776f3[_0xf866('0x3f')]===0x1){return _0x1e2a49['id'];}else{var _0x26111f=_['every'](_[_0xf866('0x32')](_0x1776f3,'TeamId'),function(_0x4f1691){return _['includes'](_0x26c821,_0x4f1691);});if(_0x26111f){return _0x1e2a49['id'];}}}));}}return BPromise['all'](_0xe5a016)[_0xf866('0x29')](function(_0x5eb2b6){_0x262c1d=_(_0x262c1d)[_0xf866('0x83')](_0x5eb2b6)['compact']()[_0xf866('0x84')]();return db['OpenchannelQueue']['find']({'where':{'id':_0x3147a8['params']['id']}})[_0xf866('0x29')](function(_0x18c417){return db[_0xf866('0x7f')]['transaction'](function(_0x5d1b13){return _0x18c417[_0xf866('0x72')](_0x3147a8[_0xf866('0x3a')][_0xf866('0x6a')],{'transaction':_0x5d1b13})[_0xf866('0x29')](function(){if(!_[_0xf866('0x85')](_0x262c1d)){return _0x18c417[_0xf866('0x86')](_0x262c1d,{'transaction':_0x5d1b13});}})[_0xf866('0x29')](function(){_0x262c1d['forEach'](function(_0x384f82){socket[_0xf866('0x87')](_0xf866('0x88'),{'UserId':_0x384f82,'OpenchannelQueueId':_0x18c417['id']});});});});});});})[_0xf866('0x29')](respondWithStatusCode(_0x3c8389,null))[_0xf866('0x4d')](handleError(_0x3c8389,null));};exports[_0xf866('0x89')]=function(_0xc44c8c,_0x41602b,_0x3046d9){return db[_0xf866('0x33')][_0xf866('0x50')]({'where':{'id':_0xc44c8c['params']['id']}})[_0xf866('0x29')](handleEntityNotFound(_0x41602b,null))[_0xf866('0x29')](function(_0x1a9932){if(_0x1a9932){return _0x1a9932[_0xf866('0x89')](_0xc44c8c[_0xf866('0x52')][_0xf866('0x6a')],_['omit'](_0xc44c8c[_0xf866('0x52')],[_0xf866('0x6a'),'id'])||{})[_0xf866('0x8a')](function(_0x2fd838){for(var _0xa873df=0x0;_0xa873df<_0xc44c8c[_0xf866('0x52')][_0xf866('0x6a')][_0xf866('0x3f')];_0xa873df+=0x1){socket[_0xf866('0x87')](_0xf866('0x8b'),{'UserId':Number(_0xc44c8c[_0xf866('0x52')]['ids'][_0xa873df]),'OpenchannelQueueId':Number(_0xc44c8c[_0xf866('0x59')]['id'])});}return _0x2fd838;});}})[_0xf866('0x29')](respondWithResult(_0x41602b,null))['catch'](handleError(_0x41602b,null));};exports['removeAgents']=function(_0x3c4891,_0xe2d9f2,_0x22490e){return db[_0xf866('0x33')][_0xf866('0x50')]({'where':{'id':_0x3c4891['params']['id']}})[_0xf866('0x29')](handleEntityNotFound(_0xe2d9f2,null))[_0xf866('0x29')](function(_0x5c79ce){if(_0x5c79ce){return _0x5c79ce[_0xf866('0x86')](_0x3c4891[_0xf866('0x3a')]['ids'])[_0xf866('0x29')](function(){if(_[_0xf866('0x8c')](_0x3c4891['query'][_0xf866('0x6a')])){for(var _0x474aa3=0x0;_0x474aa3<_0x3c4891['query']['ids'][_0xf866('0x3f')];_0x474aa3+=0x1){socket[_0xf866('0x87')](_0xf866('0x88'),{'UserId':Number(_0x3c4891['query'][_0xf866('0x6a')][_0x474aa3]),'OpenchannelQueueId':Number(_0x3c4891[_0xf866('0x59')]['id'])});}}else{socket['emit'](_0xf866('0x88'),{'UserId':Number(_0x3c4891[_0xf866('0x3a')][_0xf866('0x6a')]),'OpenchannelQueueId':Number(_0x3c4891[_0xf866('0x59')]['id'])});}});}})[_0xf866('0x29')](respondWithStatusCode(_0xe2d9f2,null))[_0xf866('0x4d')](handleError(_0xe2d9f2,null));};exports['getAgents']=function(_0x4eac40,_0x5e7fd6,_0x1618d9){var _0x31274e={};var _0x45d056={};var _0x24b461;var _0x34535c;return db['OpenchannelQueue'][_0xf866('0x68')]({'where':{'id':_0x4eac40[_0xf866('0x59')]['id']}})[_0xf866('0x29')](handleEntityNotFound(_0x5e7fd6,null))[_0xf866('0x29')](function(_0x2fa643){if(_0x2fa643){_0x24b461=_0x2fa643;_0x45d056[_0xf866('0x38')]=_[_0xf866('0x39')](db['User'][_0xf866('0x34')]);_0x45d056['query']=_[_0xf866('0x39')](_0x4eac40[_0xf866('0x3a')]);_0x45d056['filters']=_[_0xf866('0x3c')](_0x45d056[_0xf866('0x38')],_0x45d056[_0xf866('0x3a')]);_0x31274e[_0xf866('0x3d')]=_[_0xf866('0x3c')](_0x45d056[_0xf866('0x38')],qs[_0xf866('0x3e')](_0x4eac40['query'][_0xf866('0x3e')]));_0x31274e[_0xf866('0x3d')]=_0x31274e[_0xf866('0x3d')][_0xf866('0x3f')]?_0x31274e[_0xf866('0x3d')]:_0x45d056[_0xf866('0x38')];_0x31274e[_0xf866('0x42')]=qs[_0xf866('0x43')](_0x4eac40[_0xf866('0x3a')][_0xf866('0x43')]);_0x31274e[_0xf866('0x44')]=qs[_0xf866('0x3b')](_['pick'](_0x4eac40['query'],_0x45d056[_0xf866('0x3b')]));if(_0x4eac40[_0xf866('0x3a')][_0xf866('0x46')]){_0x31274e['where']=_[_0xf866('0x47')](_0x31274e[_0xf866('0x44')],{'$or':_[_0xf866('0x32')](_0x31274e[_0xf866('0x3d')],function(_0x38bee3){var _0x297f4c={};_0x297f4c[_0x38bee3]={'$like':'%'+_0x4eac40[_0xf866('0x3a')]['filter']+'%'};return _0x297f4c;})});}_0x31274e=_[_0xf866('0x47')]({},_0x31274e,_0x4eac40[_0xf866('0x4f')]);return _0x24b461['getAgents'](_0x31274e);}})[_0xf866('0x29')](function(_0x5b0721){if(_0x5b0721){_0x34535c=_0x5b0721[_0xf866('0x3f')];if(!_0x4eac40[_0xf866('0x3a')][_0xf866('0x40')]('nolimit')){_0x31274e[_0xf866('0x20')]=qs[_0xf866('0x20')](_0x4eac40[_0xf866('0x3a')][_0xf866('0x20')]);_0x31274e['offset']=qs[_0xf866('0x1f')](_0x4eac40[_0xf866('0x3a')]['offset']);}return _0x24b461[_0xf866('0x8d')](_0x31274e);}})[_0xf866('0x29')](function(_0x4a43f4){if(_0x4a43f4){return _0x4a43f4?{'count':_0x34535c,'rows':_0x4a43f4}:null;}})['then'](respondWithResult(_0x5e7fd6,null))[_0xf866('0x4d')](handleError(_0x5e7fd6,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 504bc66..c087754 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 _0x1d9d=['exports','../../mysqldb','OpenchannelQueue','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x44ac79,_0x4c08e0){var _0x30d7cf=function(_0x241185){while(--_0x241185){_0x44ac79['push'](_0x44ac79['shift']());}};_0x30d7cf(++_0x4c08e0);}(_0x1d9d,0x6d));var _0xd1d9=function(_0x5778b2,_0x40b686){_0x5778b2=_0x5778b2-0x0;var _0x2b452b=_0x1d9d[_0x5778b2];return _0x2b452b;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0xd1d9('0x0'))['db'][_0xd1d9('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xd1d9('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd1d9('0x3'),'afterDestroy':_0xd1d9('0x4')};function emitEvent(_0x4d5eb5){return function(_0x4e4336,_0x3dacc5,_0x404e05){OpenchannelQueueEvents['emit'](_0x4d5eb5+':'+_0x4e4336['id'],_0x4e4336);OpenchannelQueueEvents[_0xd1d9('0x5')](_0x4d5eb5,_0x4e4336);_0x404e05(null);};}for(var e in events){if(events[_0xd1d9('0x6')](e)){var event=events[e];OpenchannelQueue[_0xd1d9('0x7')](e,emitEvent(event));}}module[_0xd1d9('0x8')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x867f=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','OpenchannelQueue'];(function(_0x53799f,_0x3414b6){var _0x552beb=function(_0x50cb73){while(--_0x50cb73){_0x53799f['push'](_0x53799f['shift']());}};_0x552beb(++_0x3414b6);}(_0x867f,0x7f));var _0xf867=function(_0x553621,_0x18ff21){_0x553621=_0x553621-0x0;var _0x30d42f=_0x867f[_0x553621];return _0x30d42f;};'use strict';var EventEmitter=require(_0xf867('0x0'));var OpenchannelQueue=require(_0xf867('0x1'))['db'][_0xf867('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xf867('0x3')](0x0);var events={'afterCreate':_0xf867('0x4'),'afterUpdate':_0xf867('0x5'),'afterDestroy':_0xf867('0x6')};function emitEvent(_0x513e5d){return function(_0x5128f9,_0x59304d,_0x289787){OpenchannelQueueEvents[_0xf867('0x7')](_0x513e5d+':'+_0x5128f9['id'],_0x5128f9);OpenchannelQueueEvents[_0xf867('0x7')](_0x513e5d,_0x5128f9);_0x289787(null);};}for(var e in events){if(events[_0xf867('0x8')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0xf867('0x9')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 7b3ecc5..c20b8b8 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 _0x202e=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','OpenchannelQueue','lodash','util'];(function(_0x14c195,_0x59d195){var _0x17a689=function(_0x2d83ad){while(--_0x2d83ad){_0x14c195['push'](_0x14c195['shift']());}};_0x17a689(++_0x59d195);}(_0x202e,0x184));var _0xe202=function(_0x54a030,_0x2b8053){_0x54a030=_0x54a030-0x0;var _0x5bae45=_0x202e[_0x54a030];return _0x5bae45;};'use strict';var _=require(_0xe202('0x0'));var util=require(_0xe202('0x1'));var logger=require(_0xe202('0x2'))('api');var moment=require(_0xe202('0x3'));var BPromise=require(_0xe202('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe202('0x5'));var rimraf=require(_0xe202('0x6'));var config=require(_0xe202('0x7'));var attributes=require('./openchannelQueue.attributes');module[_0xe202('0x8')]=function(_0x2bd229,_0x420f44){return _0x2bd229['define'](_0xe202('0x9'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5a65=['../../config/environment','define','openchannel_queues','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x392735,_0x17be88){var _0x5ef90f=function(_0x1a25a4){while(--_0x1a25a4){_0x392735['push'](_0x392735['shift']());}};_0x5ef90f(++_0x17be88);}(_0x5a65,0x19d));var _0x55a6=function(_0xff8051,_0x1b6261){_0xff8051=_0xff8051-0x0;var _0x4ea4a6=_0x5a65[_0xff8051];return _0x4ea4a6;};'use strict';var _=require(_0x55a6('0x0'));var util=require('util');var logger=require(_0x55a6('0x1'))(_0x55a6('0x2'));var moment=require('moment');var BPromise=require(_0x55a6('0x3'));var rp=require(_0x55a6('0x4'));var fs=require('fs');var path=require(_0x55a6('0x5'));var rimraf=require(_0x55a6('0x6'));var config=require(_0x55a6('0x7'));var attributes=require('./openchannelQueue.attributes');module['exports']=function(_0x5ee89c,_0x4a04b3){return _0x5ee89c[_0x55a6('0x8')]('OpenchannelQueue',attributes,{'tableName':_0x55a6('0x9'),'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 abc04a7..1cff0d6 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 _0x91fd=['defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','attributes','limit','map','include','model','debug','stringify','ShowOpenchannelQueue','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http'];(function(_0x5bcfd7,_0x50a98c){var _0x4be038=function(_0x24b251){while(--_0x24b251){_0x5bcfd7['push'](_0x5bcfd7['shift']());}};_0x4be038(++_0x50a98c);}(_0x91fd,0x1a2));var _0xd91f=function(_0x4da088,_0x4a2408){_0x4da088=_0x4da088-0x0;var _0x3b6e72=_0x91fd[_0x4da088];return _0x3b6e72;};'use strict';var _=require(_0xd91f('0x0'));var util=require(_0xd91f('0x1'));var moment=require(_0xd91f('0x2'));var BPromise=require(_0xd91f('0x3'));var rs=require(_0xd91f('0x4'));var fs=require('fs');var Redis=require(_0xd91f('0x5'));var db=require(_0xd91f('0x6'))['db'];var utils=require(_0xd91f('0x7'));var logger=require(_0xd91f('0x8'))('rpc');var config=require(_0xd91f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd91f('0xa')][_0xd91f('0xb')]({'port':0x232a});config['redis']=_[_0xd91f('0xc')](config[_0xd91f('0xd')],{'host':_0xd91f('0xe'),'port':0x18eb});var socket=require(_0xd91f('0xf'))(new Redis(config[_0xd91f('0xd')]));require(_0xd91f('0x10'))[_0xd91f('0x11')](socket);function respondWithRpcPromise(_0x35ca9e,_0x3d20b4,_0x122d46){return new BPromise(function(_0x4105a9,_0x4ca782){return client[_0xd91f('0x12')](_0x35ca9e,_0x122d46)[_0xd91f('0x13')](function(_0x189e89){logger[_0xd91f('0x14')](_0xd91f('0x15'),_0x3d20b4,_0xd91f('0x16'));logger['debug'](_0xd91f('0x17'),_0x3d20b4,'request\x20sent',JSON['stringify'](_0x189e89));if(_0x189e89[_0xd91f('0x18')]){if(_0x189e89[_0xd91f('0x18')][_0xd91f('0x19')]===0x1f4){logger[_0xd91f('0x18')](_0xd91f('0x15'),_0x3d20b4,_0x189e89[_0xd91f('0x18')]['message']);return _0x4ca782(_0x189e89[_0xd91f('0x18')][_0xd91f('0x1a')]);}logger['error'](_0xd91f('0x15'),_0x3d20b4,_0x189e89['error']['message']);return _0x4105a9(_0x189e89[_0xd91f('0x18')][_0xd91f('0x1a')]);}else{logger[_0xd91f('0x14')]('OpenchannelQueue,\x20%s,\x20%s',_0x3d20b4,_0xd91f('0x16'));_0x4105a9(_0x189e89['result'][_0xd91f('0x1a')]);}})[_0xd91f('0x1b')](function(_0x1d567c){logger[_0xd91f('0x18')](_0xd91f('0x15'),_0x3d20b4,_0x1d567c);_0x4ca782(_0x1d567c);});});}exports[_0xd91f('0x1c')]=function(_0x39a769){var _0x4c2730=this;return new Promise(function(_0x474fe3,_0x489878){return db[_0xd91f('0x1d')][_0xd91f('0x1e')]({'raw':_0x39a769['options']?_0x39a769[_0xd91f('0x1f')][_0xd91f('0x20')]===undefined?!![]:![]:!![],'where':_0x39a769['options']?_0x39a769['options']['where']||null:null,'attributes':_0x39a769['options']?_0x39a769[_0xd91f('0x1f')][_0xd91f('0x21')]||null:null,'limit':_0x39a769[_0xd91f('0x1f')]?_0x39a769['options'][_0xd91f('0x22')]||null:null,'include':_0x39a769[_0xd91f('0x1f')]?_0x39a769[_0xd91f('0x1f')]['include']?_[_0xd91f('0x23')](_0x39a769[_0xd91f('0x1f')]['include'],function(_0x2f3881){return{'model':db[_0x2f3881['model']],'as':_0x2f3881['as'],'attributes':_0x2f3881['attributes'],'include':_0x2f3881[_0xd91f('0x24')]?_[_0xd91f('0x23')](_0x2f3881[_0xd91f('0x24')],function(_0x2e0b15){return{'model':db[_0x2e0b15[_0xd91f('0x25')]],'as':_0x2e0b15['as'],'attributes':_0x2e0b15[_0xd91f('0x21')],'include':_0x2e0b15[_0xd91f('0x24')]?_[_0xd91f('0x23')](_0x2e0b15['include'],function(_0x14d063){return{'model':db[_0x14d063['model']],'as':_0x14d063['as'],'attributes':_0x14d063[_0xd91f('0x21')]};}):[]};}):[]};}):[]:[]})[_0xd91f('0x13')](function(_0x50039f){logger[_0xd91f('0x14')](_0xd91f('0x1c'),_0x39a769);logger[_0xd91f('0x26')](_0xd91f('0x1c'),_0x39a769,JSON[_0xd91f('0x27')](_0x50039f));_0x474fe3(_0x50039f);})[_0xd91f('0x1b')](function(_0x4b6fa5){logger[_0xd91f('0x18')]('GetOpenchannelQueue',_0x4b6fa5['message'],_0x39a769);_0x489878(_0x4c2730[_0xd91f('0x18')](0x1f4,_0x4b6fa5['message']));});});};exports[_0xd91f('0x28')]=function(_0x3c4052){var _0x2578c8=this;return new Promise(function(_0xa95a23,_0x1470e5){return db[_0xd91f('0x1d')][_0xd91f('0x29')]({'raw':_0x3c4052['options']?_0x3c4052[_0xd91f('0x1f')][_0xd91f('0x20')]===undefined?!![]:![]:!![],'where':_0x3c4052[_0xd91f('0x1f')]?_0x3c4052['options'][_0xd91f('0x2a')]||null:null,'attributes':_0x3c4052[_0xd91f('0x1f')]?_0x3c4052[_0xd91f('0x1f')][_0xd91f('0x21')]||null:null,'include':_0x3c4052['options']?_0x3c4052['options'][_0xd91f('0x24')]?_['map'](_0x3c4052[_0xd91f('0x1f')][_0xd91f('0x24')],function(_0x1bd4e3){return{'model':db[_0x1bd4e3[_0xd91f('0x25')]],'as':_0x1bd4e3['as'],'attributes':_0x1bd4e3[_0xd91f('0x21')],'include':_0x1bd4e3[_0xd91f('0x24')]?_[_0xd91f('0x23')](_0x1bd4e3[_0xd91f('0x24')],function(_0x8a4b5c){return{'model':db[_0x8a4b5c[_0xd91f('0x25')]],'as':_0x8a4b5c['as'],'attributes':_0x8a4b5c[_0xd91f('0x21')],'include':_0x8a4b5c[_0xd91f('0x24')]?_[_0xd91f('0x23')](_0x8a4b5c[_0xd91f('0x24')],function(_0x3748a6){return{'model':db[_0x3748a6[_0xd91f('0x25')]],'as':_0x3748a6['as'],'attributes':_0x3748a6[_0xd91f('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4c170e){logger[_0xd91f('0x14')](_0xd91f('0x28'),_0x3c4052);logger['debug']('ShowOpenchannelQueue',_0x3c4052,JSON[_0xd91f('0x27')](_0x4c170e));_0xa95a23(_0x4c170e);})['catch'](function(_0x507745){logger[_0xd91f('0x18')](_0xd91f('0x28'),_0x507745[_0xd91f('0x1a')],_0x3c4052);_0x1470e5(_0x2578c8[_0xd91f('0x18')](0x1f4,_0x507745['message']));});});}; \ No newline at end of file +var _0xd4d6=['OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','message','result','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','limit','map','include','model','attributes','stringify','catch','ShowOpenchannelQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','socket.io-emitter','./openchannelQueue.socket','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x364e84,_0x1bd4d5){var _0x1468af=function(_0x191b95){while(--_0x191b95){_0x364e84['push'](_0x364e84['shift']());}};_0x1468af(++_0x1bd4d5);}(_0xd4d6,0x1c0));var _0x6d4d=function(_0x385eb4,_0x58ace6){_0x385eb4=_0x385eb4-0x0;var _0x42c30c=_0xd4d6[_0x385eb4];return _0x42c30c;};'use strict';var _=require(_0x6d4d('0x0'));var util=require(_0x6d4d('0x1'));var moment=require(_0x6d4d('0x2'));var BPromise=require(_0x6d4d('0x3'));var rs=require(_0x6d4d('0x4'));var fs=require('fs');var Redis=require(_0x6d4d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6d4d('0x6'));var logger=require(_0x6d4d('0x7'))(_0x6d4d('0x8'));var config=require(_0x6d4d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6d4d('0xa')][_0x6d4d('0xb')]({'port':0x232a});config[_0x6d4d('0xc')]=_['defaults'](config[_0x6d4d('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x6d4d('0xd'))(new Redis(config['redis']));require(_0x6d4d('0xe'))['register'](socket);function respondWithRpcPromise(_0x1ee13a,_0x54c66d,_0x11ff86){return new BPromise(function(_0x22f302,_0x1eeea8){return client['request'](_0x1ee13a,_0x11ff86)[_0x6d4d('0xf')](function(_0xd09054){logger[_0x6d4d('0x10')](_0x6d4d('0x11'),_0x54c66d,_0x6d4d('0x12'));logger[_0x6d4d('0x13')](_0x6d4d('0x14'),_0x54c66d,'request\x20sent',JSON['stringify'](_0xd09054));if(_0xd09054['error']){if(_0xd09054[_0x6d4d('0x15')]['code']===0x1f4){logger[_0x6d4d('0x15')](_0x6d4d('0x11'),_0x54c66d,_0xd09054[_0x6d4d('0x15')]['message']);return _0x1eeea8(_0xd09054[_0x6d4d('0x15')][_0x6d4d('0x16')]);}logger['error'](_0x6d4d('0x11'),_0x54c66d,_0xd09054['error'][_0x6d4d('0x16')]);return _0x22f302(_0xd09054['error'][_0x6d4d('0x16')]);}else{logger[_0x6d4d('0x10')](_0x6d4d('0x11'),_0x54c66d,_0x6d4d('0x12'));_0x22f302(_0xd09054[_0x6d4d('0x17')][_0x6d4d('0x16')]);}})['catch'](function(_0x3fb706){logger['error'](_0x6d4d('0x11'),_0x54c66d,_0x3fb706);_0x1eeea8(_0x3fb706);});});}exports[_0x6d4d('0x18')]=function(_0x134168){var _0x274341=this;return new Promise(function(_0x58389a,_0x42fea2){return db[_0x6d4d('0x19')][_0x6d4d('0x1a')]({'raw':_0x134168[_0x6d4d('0x1b')]?_0x134168[_0x6d4d('0x1b')][_0x6d4d('0x1c')]===undefined?!![]:![]:!![],'where':_0x134168[_0x6d4d('0x1b')]?_0x134168['options'][_0x6d4d('0x1d')]||null:null,'attributes':_0x134168[_0x6d4d('0x1b')]?_0x134168[_0x6d4d('0x1b')]['attributes']||null:null,'limit':_0x134168[_0x6d4d('0x1b')]?_0x134168[_0x6d4d('0x1b')][_0x6d4d('0x1e')]||null:null,'include':_0x134168['options']?_0x134168[_0x6d4d('0x1b')]['include']?_[_0x6d4d('0x1f')](_0x134168['options'][_0x6d4d('0x20')],function(_0x37d359){return{'model':db[_0x37d359[_0x6d4d('0x21')]],'as':_0x37d359['as'],'attributes':_0x37d359['attributes'],'include':_0x37d359['include']?_[_0x6d4d('0x1f')](_0x37d359[_0x6d4d('0x20')],function(_0x4466e4){return{'model':db[_0x4466e4[_0x6d4d('0x21')]],'as':_0x4466e4['as'],'attributes':_0x4466e4['attributes'],'include':_0x4466e4[_0x6d4d('0x20')]?_[_0x6d4d('0x1f')](_0x4466e4[_0x6d4d('0x20')],function(_0x566b10){return{'model':db[_0x566b10['model']],'as':_0x566b10['as'],'attributes':_0x566b10[_0x6d4d('0x22')]};}):[]};}):[]};}):[]:[]})[_0x6d4d('0xf')](function(_0x11cf0e){logger[_0x6d4d('0x10')]('GetOpenchannelQueue',_0x134168);logger[_0x6d4d('0x13')](_0x6d4d('0x18'),_0x134168,JSON[_0x6d4d('0x23')](_0x11cf0e));_0x58389a(_0x11cf0e);})[_0x6d4d('0x24')](function(_0x657f66){logger[_0x6d4d('0x15')](_0x6d4d('0x18'),_0x657f66[_0x6d4d('0x16')],_0x134168);_0x42fea2(_0x274341[_0x6d4d('0x15')](0x1f4,_0x657f66[_0x6d4d('0x16')]));});});};exports[_0x6d4d('0x25')]=function(_0xce8fe6){var _0x372922=this;return new Promise(function(_0x2cc3ec,_0x3f8fe8){return db[_0x6d4d('0x19')][_0x6d4d('0x26')]({'raw':_0xce8fe6[_0x6d4d('0x1b')]?_0xce8fe6['options'][_0x6d4d('0x1c')]===undefined?!![]:![]:!![],'where':_0xce8fe6['options']?_0xce8fe6[_0x6d4d('0x1b')]['where']||null:null,'attributes':_0xce8fe6[_0x6d4d('0x1b')]?_0xce8fe6[_0x6d4d('0x1b')][_0x6d4d('0x22')]||null:null,'include':_0xce8fe6[_0x6d4d('0x1b')]?_0xce8fe6[_0x6d4d('0x1b')][_0x6d4d('0x20')]?_[_0x6d4d('0x1f')](_0xce8fe6[_0x6d4d('0x1b')]['include'],function(_0x37e66f){return{'model':db[_0x37e66f[_0x6d4d('0x21')]],'as':_0x37e66f['as'],'attributes':_0x37e66f[_0x6d4d('0x22')],'include':_0x37e66f['include']?_['map'](_0x37e66f[_0x6d4d('0x20')],function(_0x2743fc){return{'model':db[_0x2743fc[_0x6d4d('0x21')]],'as':_0x2743fc['as'],'attributes':_0x2743fc['attributes'],'include':_0x2743fc[_0x6d4d('0x20')]?_[_0x6d4d('0x1f')](_0x2743fc['include'],function(_0x214163){return{'model':db[_0x214163[_0x6d4d('0x21')]],'as':_0x214163['as'],'attributes':_0x214163[_0x6d4d('0x22')]};}):[]};}):[]};}):[]:[]})[_0x6d4d('0xf')](function(_0x296862){logger[_0x6d4d('0x10')](_0x6d4d('0x25'),_0xce8fe6);logger[_0x6d4d('0x13')](_0x6d4d('0x25'),_0xce8fe6,JSON[_0x6d4d('0x23')](_0x296862));_0x2cc3ec(_0x296862);})['catch'](function(_0x259404){logger[_0x6d4d('0x15')](_0x6d4d('0x25'),_0x259404[_0x6d4d('0x16')],_0xce8fe6);_0x3f8fe8(_0x372922[_0x6d4d('0x15')](0x1f4,_0x259404['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 293e9d4..27de929 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 _0x6a40=['update','removeListener','register','./openchannelQueue.events','remove'];(function(_0x396354,_0x56b56d){var _0x204808=function(_0x307af4){while(--_0x307af4){_0x396354['push'](_0x396354['shift']());}};_0x204808(++_0x56b56d);}(_0x6a40,0x1a7));var _0x06a4=function(_0x595783,_0x528c08){_0x595783=_0x595783-0x0;var _0x325b60=_0x6a40[_0x595783];return _0x325b60;};'use strict';var OpenchannelQueueEvents=require(_0x06a4('0x0'));var events=['save',_0x06a4('0x1'),_0x06a4('0x2')];function createListener(_0x1c5e87,_0x537e86){return function(_0x10d987){_0x537e86['emit'](_0x1c5e87,_0x10d987);};}function removeListener(_0x16ee4b,_0xe9037e){return function(){OpenchannelQueueEvents[_0x06a4('0x3')](_0x16ee4b,_0xe9037e);};}exports[_0x06a4('0x4')]=function(_0x368276){for(var _0x1c4f85=0x0,_0x49f0c2=events['length'];_0x1c4f85<_0x49f0c2;_0x1c4f85++){var _0x3fda6b=events[_0x1c4f85];var _0x461a6b=createListener('openchannelQueue:'+_0x3fda6b,_0x368276);OpenchannelQueueEvents['on'](_0x3fda6b,_0x461a6b);}}; \ No newline at end of file +var _0x8541=['removeListener','register','length','./openchannelQueue.events','save','remove','update','emit'];(function(_0x3f0626,_0x45cd0e){var _0x402d31=function(_0x4ae0d8){while(--_0x4ae0d8){_0x3f0626['push'](_0x3f0626['shift']());}};_0x402d31(++_0x45cd0e);}(_0x8541,0x1a3));var _0x1854=function(_0x5a3c79,_0x28a18d){_0x5a3c79=_0x5a3c79-0x0;var _0x41035d=_0x8541[_0x5a3c79];return _0x41035d;};'use strict';var OpenchannelQueueEvents=require(_0x1854('0x0'));var events=[_0x1854('0x1'),_0x1854('0x2'),_0x1854('0x3')];function createListener(_0x31b6c7,_0x42fc93){return function(_0x374b8a){_0x42fc93[_0x1854('0x4')](_0x31b6c7,_0x374b8a);};}function removeListener(_0x29d206,_0x32957e){return function(){OpenchannelQueueEvents[_0x1854('0x5')](_0x29d206,_0x32957e);};}exports[_0x1854('0x6')]=function(_0x4a5220){for(var _0x4a8134=0x0,_0x34dfec=events[_0x1854('0x7')];_0x4a8134<_0x34dfec;_0x4a8134++){var _0x8df0d3=events[_0x4a8134];var _0x2e418a=createListener('openchannelQueue:'+_0x8df0d3,_0x4a5220);OpenchannelQueueEvents['on'](_0x8df0d3,_0x2e418a);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 1bc0982..9ea124e 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 _0x5e27=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util'];(function(_0x28a815,_0x112c4f){var _0xc90c07=function(_0x10f7b0){while(--_0x10f7b0){_0x28a815['push'](_0x28a815['shift']());}};_0xc90c07(++_0x112c4f);}(_0x5e27,0x124));var _0x75e2=function(_0x51bb33,_0x10c2e8){_0x51bb33=_0x51bb33-0x0;var _0x4a5ad3=_0x5e27[_0x51bb33];return _0x4a5ad3;};'use strict';var multer=require(_0x75e2('0x0'));var util=require(_0x75e2('0x1'));var path=require(_0x75e2('0x2'));var timeout=require(_0x75e2('0x3'));var express=require(_0x75e2('0x4'));var router=express[_0x75e2('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x75e2('0x6'));var config=require(_0x75e2('0x7'));var controller=require('./openchannelQueueReport.controller');router[_0x75e2('0x8')]('/',auth[_0x75e2('0x9')](),controller[_0x75e2('0xa')]);router[_0x75e2('0x8')](_0x75e2('0xb'),auth[_0x75e2('0x9')](),controller[_0x75e2('0xc')]);router[_0x75e2('0x8')](_0x75e2('0xd'),auth['isAuthenticated'](),controller[_0x75e2('0xe')]);router[_0x75e2('0xf')]('/',auth[_0x75e2('0x9')](),controller[_0x75e2('0x10')]);router['put'](_0x75e2('0xd'),auth[_0x75e2('0x9')](),controller[_0x75e2('0x11')]);router[_0x75e2('0x12')](_0x75e2('0xd'),auth[_0x75e2('0x9')](),controller[_0x75e2('0x13')]);module[_0x75e2('0x14')]=router; \ No newline at end of file +var _0xd5fb=['put','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create'];(function(_0x2125cf,_0x37eb72){var _0x5dddc3=function(_0x3d4269){while(--_0x3d4269){_0x2125cf['push'](_0x2125cf['shift']());}};_0x5dddc3(++_0x37eb72);}(_0xd5fb,0xe0));var _0xbd5f=function(_0x19a9a5,_0x2bf8b2){_0x19a9a5=_0x19a9a5-0x0;var _0x5306fe=_0xd5fb[_0x19a9a5];return _0x5306fe;};'use strict';var multer=require(_0xbd5f('0x0'));var util=require(_0xbd5f('0x1'));var path=require('path');var timeout=require(_0xbd5f('0x2'));var express=require('express');var router=express[_0xbd5f('0x3')]();var fs_extra=require(_0xbd5f('0x4'));var auth=require(_0xbd5f('0x5'));var interaction=require(_0xbd5f('0x6'));var config=require('../../config/environment');var controller=require(_0xbd5f('0x7'));router[_0xbd5f('0x8')]('/',auth[_0xbd5f('0x9')](),controller[_0xbd5f('0xa')]);router['get'](_0xbd5f('0xb'),auth['isAuthenticated'](),controller[_0xbd5f('0xc')]);router[_0xbd5f('0x8')](_0xbd5f('0xd'),auth[_0xbd5f('0x9')](),controller[_0xbd5f('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbd5f('0xf')]);router[_0xbd5f('0x10')](_0xbd5f('0xd'),auth[_0xbd5f('0x9')](),controller['update']);router[_0xbd5f('0x11')](_0xbd5f('0xd'),auth[_0xbd5f('0x9')](),controller[_0xbd5f('0x12')]);module[_0xbd5f('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 e62ed97..5333d98 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 _0x1a28=['moment','sequelize','exports','STRING','DATE'];(function(_0x17f618,_0x39044e){var _0xcb17e0=function(_0x2d329d){while(--_0x2d329d){_0x17f618['push'](_0x17f618['shift']());}};_0xcb17e0(++_0x39044e);}(_0x1a28,0x10e));var _0x81a2=function(_0x4f35f4,_0x51a8c3){_0x4f35f4=_0x4f35f4-0x0;var _0x2e9a70=_0x1a28[_0x4f35f4];return _0x2e9a70;};'use strict';var moment=require(_0x81a2('0x0'));var Sequelize=require(_0x81a2('0x1'));module[_0x81a2('0x2')]={'uniqueid':{'type':Sequelize[_0x81a2('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x81a2('0x3')]},'joinAt':{'type':Sequelize[_0x81a2('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x81a2('0x4')]},'reason':{'type':Sequelize[_0x81a2('0x3')]}}; \ No newline at end of file +var _0xfa69=['moment','exports','DATE','STRING'];(function(_0x5959c9,_0x2ed153){var _0x4ffcbc=function(_0x459b7a){while(--_0x459b7a){_0x5959c9['push'](_0x5959c9['shift']());}};_0x4ffcbc(++_0x2ed153);}(_0xfa69,0xac));var _0x9fa6=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xfa69[_0x2c91e9];return _0x13f0ff;};'use strict';var moment=require(_0x9fa6('0x0'));var Sequelize=require('sequelize');module[_0x9fa6('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x9fa6('0x2')]},'leaveAt':{'type':Sequelize[_0x9fa6('0x2')]},'acceptAt':{'type':Sequelize[_0x9fa6('0x2')]},'exitAt':{'type':Sequelize[_0x9fa6('0x2')]},'reason':{'type':Sequelize[_0x9fa6('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 7c9381a..e36b660 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 _0xa6dd=['path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','apply','reject','save','then','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','includeAll','include','rows','catch','show','options','find','create','body','update','params','destroy','describe','zip-dir','fast-json-patch','mustache','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa6dd,0xd7));var _0xda6d=function(_0x1a6a25,_0x2394f6){_0x1a6a25=_0x1a6a25-0x0;var _0x592ccb=_0xa6dd[_0x1a6a25];return _0x592ccb;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xda6d('0x0'));var jsonpatch=require(_0xda6d('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xda6d('0x2'));var util=require(_0xda6d('0x3'));var path=require(_0xda6d('0x4'));var sox=require(_0xda6d('0x5'));var csv=require(_0xda6d('0x6'));var ejs=require(_0xda6d('0x7'));var fs=require('fs');var fs_extra=require(_0xda6d('0x8'));var _=require(_0xda6d('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xda6d('0xa'));var deskjs=require(_0xda6d('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xda6d('0xc'));var qs=require(_0xda6d('0xd'));var as=require(_0xda6d('0xe'));var hardwareService=require(_0xda6d('0xf'));var logger=require(_0xda6d('0x10'))(_0xda6d('0x11'));var utils=require(_0xda6d('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xda6d('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b3cce,_0x20256b){_0x20256b=_0x20256b||0xcc;return function(_0x5db33e){if(_0x5db33e){return _0x5b3cce[_0xda6d('0x14')](_0x20256b);}return _0x5b3cce['status'](_0x20256b)[_0xda6d('0x15')]();};}function respondWithResult(_0x1a0034,_0x18d82d){_0x18d82d=_0x18d82d||0xc8;return function(_0x468bcf){if(_0x468bcf){return _0x1a0034['status'](_0x18d82d)['json'](_0x468bcf);}};}function respondWithFilteredResult(_0x45b5c0,_0x406a2d){return function(_0x18fadd){if(_0x18fadd){var _0xcd4bee=typeof _0x406a2d[_0xda6d('0x16')]===_0xda6d('0x17')&&typeof _0x406a2d[_0xda6d('0x18')]===_0xda6d('0x17');var _0x18a509=_0x18fadd[_0xda6d('0x19')];var _0x44b5b9=_0xcd4bee?0x0:_0x406a2d['offset'];var _0x20855d=_0xcd4bee?_0x18fadd['count']:_0x406a2d[_0xda6d('0x16')]+_0x406a2d[_0xda6d('0x18')];var _0x246bbb;if(_0x20855d>=_0x18a509){_0x20855d=_0x18a509;_0x246bbb=0xc8;}else{_0x246bbb=0xce;}_0x45b5c0[_0xda6d('0x1a')](_0x246bbb);return _0x45b5c0[_0xda6d('0x1b')](_0xda6d('0x1c'),_0x44b5b9+'-'+_0x20855d+'/'+_0x18a509)[_0xda6d('0x1d')](_0x18fadd);}return null;};}function patchUpdates(_0x37d34c){return function(_0x18e880){try{jsonpatch[_0xda6d('0x1e')](_0x18e880,_0x37d34c,!![]);}catch(_0x86f895){return BPromise[_0xda6d('0x1f')](_0x86f895);}return _0x18e880[_0xda6d('0x20')]();};}function saveUpdates(_0x39b5c4,_0x293738){return function(_0x34a4e6){if(_0x34a4e6){return _0x34a4e6['update'](_0x39b5c4)[_0xda6d('0x21')](function(_0x579443){return _0x579443;});}return null;};}function removeEntity(_0x313ff3,_0x1fc93b){return function(_0x3dbd01){if(_0x3dbd01){return _0x3dbd01['destroy']()[_0xda6d('0x21')](function(){_0x313ff3[_0xda6d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x185e0,_0x1c4b34){return function(_0x843d76){if(!_0x843d76){_0x185e0[_0xda6d('0x14')](0x194);}return _0x843d76;};}function handleError(_0x15db88,_0x1f7af0){_0x1f7af0=_0x1f7af0||0x1f4;return function(_0x59cb70){logger[_0xda6d('0x22')](_0x59cb70[_0xda6d('0x23')]);if(_0x59cb70[_0xda6d('0x24')]){delete _0x59cb70[_0xda6d('0x24')];}_0x15db88['status'](_0x1f7af0)[_0xda6d('0x25')](_0x59cb70);};}exports[_0xda6d('0x26')]=function(_0x5d1a4b,_0x5954a4){var _0x1fd367={},_0x18bf02={},_0x3178b2={'count':0x0,'rows':[]};var _0x5a2659=_[_0xda6d('0x27')](db[_0xda6d('0x28')][_0xda6d('0x29')],function(_0x2ea56a){return{'name':_0x2ea56a[_0xda6d('0x2a')],'type':_0x2ea56a[_0xda6d('0x2b')]['key']};});_0x18bf02[_0xda6d('0x2c')]=_[_0xda6d('0x27')](_0x5a2659,_0xda6d('0x24'));_0x18bf02[_0xda6d('0x2d')]=_[_0xda6d('0x2e')](_0x5d1a4b['query']);_0x18bf02[_0xda6d('0x2f')]=_['intersection'](_0x18bf02['model'],_0x18bf02[_0xda6d('0x2d')]);_0x1fd367['attributes']=_[_0xda6d('0x30')](_0x18bf02['model'],qs[_0xda6d('0x31')](_0x5d1a4b[_0xda6d('0x2d')]['fields']));_0x1fd367['attributes']=_0x1fd367[_0xda6d('0x32')][_0xda6d('0x33')]?_0x1fd367[_0xda6d('0x32')]:_0x18bf02[_0xda6d('0x2c')];if(!_0x5d1a4b['query'][_0xda6d('0x34')](_0xda6d('0x35'))){_0x1fd367[_0xda6d('0x18')]=qs[_0xda6d('0x18')](_0x5d1a4b[_0xda6d('0x2d')][_0xda6d('0x18')]);_0x1fd367[_0xda6d('0x16')]=qs[_0xda6d('0x16')](_0x5d1a4b[_0xda6d('0x2d')][_0xda6d('0x16')]);}_0x1fd367[_0xda6d('0x36')]=qs[_0xda6d('0x37')](_0x5d1a4b[_0xda6d('0x2d')]['sort']);_0x1fd367['where']=qs[_0xda6d('0x2f')](_['pick'](_0x5d1a4b[_0xda6d('0x2d')],_0x18bf02['filters']),_0x5a2659);if(_0x5d1a4b[_0xda6d('0x2d')][_0xda6d('0x38')]){_0x1fd367['where']=_[_0xda6d('0x39')](_0x1fd367[_0xda6d('0x3a')],{'$or':_[_0xda6d('0x27')](_0x5a2659,function(_0x1c8afb){if(_0x1c8afb[_0xda6d('0x2b')]!==_0xda6d('0x3b')){var _0x4435e7={};_0x4435e7[_0x1c8afb['name']]={'$like':'%'+_0x5d1a4b['query'][_0xda6d('0x38')]+'%'};return _0x4435e7;}})});}_0x1fd367=_[_0xda6d('0x39')]({},_0x1fd367,_0x5d1a4b['options']);var _0x47dc2f={'where':_0x1fd367[_0xda6d('0x3a')]};return db['OpenchannelQueueReport']['count'](_0x47dc2f)[_0xda6d('0x21')](function(_0x2ffd32){_0x3178b2[_0xda6d('0x19')]=_0x2ffd32;if(_0x5d1a4b[_0xda6d('0x2d')][_0xda6d('0x3c')]){_0x1fd367[_0xda6d('0x3d')]=[{'all':!![]}];}return db['OpenchannelQueueReport']['findAll'](_0x1fd367);})[_0xda6d('0x21')](function(_0x25d570){_0x3178b2[_0xda6d('0x3e')]=_0x25d570;return _0x3178b2;})['then'](respondWithFilteredResult(_0x5954a4,_0x1fd367))[_0xda6d('0x3f')](handleError(_0x5954a4,null));};exports[_0xda6d('0x40')]=function(_0x17e287,_0x24deb1){var _0x7b806c={'raw':!![],'where':{'id':_0x17e287['params']['id']}},_0x744f8c={};_0x744f8c[_0xda6d('0x2c')]=_[_0xda6d('0x2e')](db[_0xda6d('0x28')]['rawAttributes']);_0x744f8c[_0xda6d('0x2d')]=_[_0xda6d('0x2e')](_0x17e287[_0xda6d('0x2d')]);_0x744f8c['filters']=_[_0xda6d('0x30')](_0x744f8c[_0xda6d('0x2c')],_0x744f8c[_0xda6d('0x2d')]);_0x7b806c[_0xda6d('0x32')]=_[_0xda6d('0x30')](_0x744f8c['model'],qs[_0xda6d('0x31')](_0x17e287[_0xda6d('0x2d')][_0xda6d('0x31')]));_0x7b806c[_0xda6d('0x32')]=_0x7b806c['attributes'][_0xda6d('0x33')]?_0x7b806c[_0xda6d('0x32')]:_0x744f8c['model'];if(_0x17e287[_0xda6d('0x2d')][_0xda6d('0x3c')]){_0x7b806c[_0xda6d('0x3d')]=[{'all':!![]}];}_0x7b806c=_['merge']({},_0x7b806c,_0x17e287[_0xda6d('0x41')]);return db['OpenchannelQueueReport'][_0xda6d('0x42')](_0x7b806c)[_0xda6d('0x21')](handleEntityNotFound(_0x24deb1,null))[_0xda6d('0x21')](respondWithResult(_0x24deb1,null))['catch'](handleError(_0x24deb1,null));};exports[_0xda6d('0x43')]=function(_0x307a24,_0x39e6e8){return db[_0xda6d('0x28')][_0xda6d('0x43')](_0x307a24[_0xda6d('0x44')],{})[_0xda6d('0x21')](respondWithResult(_0x39e6e8,0xc9))['catch'](handleError(_0x39e6e8,null));};exports[_0xda6d('0x45')]=function(_0x371b5d,_0x3b0126){if(_0x371b5d[_0xda6d('0x44')]['id']){delete _0x371b5d['body']['id'];}return db[_0xda6d('0x28')]['find']({'where':{'id':_0x371b5d[_0xda6d('0x46')]['id']}})[_0xda6d('0x21')](handleEntityNotFound(_0x3b0126,null))[_0xda6d('0x21')](saveUpdates(_0x371b5d['body'],null))[_0xda6d('0x21')](respondWithResult(_0x3b0126,null))['catch'](handleError(_0x3b0126,null));};exports[_0xda6d('0x47')]=function(_0x4eec29,_0x5ee613){return db[_0xda6d('0x28')][_0xda6d('0x42')]({'where':{'id':_0x4eec29[_0xda6d('0x46')]['id']}})[_0xda6d('0x21')](handleEntityNotFound(_0x5ee613,null))['then'](removeEntity(_0x5ee613,null))[_0xda6d('0x3f')](handleError(_0x5ee613,null));};exports['describe']=function(_0x327192,_0x422f1f){return db[_0xda6d('0x28')][_0xda6d('0x48')]()['then'](respondWithResult(_0x422f1f,null))[_0xda6d('0x3f')](handleError(_0x422f1f,null));}; \ No newline at end of file +var _0x41c9=['papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','name','send','index','map','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','OpenchannelQueueReport','includeAll','include','rows','show','params','keys','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x586c9d,_0x388d27){var _0x4f4b22=function(_0x2fbfba){while(--_0x2fbfba){_0x586c9d['push'](_0x586c9d['shift']());}};_0x4f4b22(++_0x388d27);}(_0x41c9,0x1ac));var _0x941c=function(_0x47c92f,_0x3b83f6){_0x47c92f=_0x47c92f-0x0;var _0x2046b0=_0x41c9[_0x47c92f];return _0x2046b0;};'use strict';var emlformat=require(_0x941c('0x0'));var rimraf=require(_0x941c('0x1'));var zipdir=require(_0x941c('0x2'));var jsonpatch=require(_0x941c('0x3'));var rp=require('request-promise');var moment=require(_0x941c('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x941c('0x5'));var path=require(_0x941c('0x6'));var sox=require(_0x941c('0x7'));var csv=require('to-csv');var ejs=require(_0x941c('0x8'));var fs=require('fs');var fs_extra=require(_0x941c('0x9'));var _=require(_0x941c('0xa'));var squel=require(_0x941c('0xb'));var crypto=require(_0x941c('0xc'));var jsforce=require(_0x941c('0xd'));var deskjs=require(_0x941c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x941c('0xf'));var Papa=require(_0x941c('0x10'));var Redis=require(_0x941c('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x941c('0x12'));var hardwareService=require(_0x941c('0x13'));var logger=require(_0x941c('0x14'))(_0x941c('0x15'));var utils=require('../../config/utils');var config=require(_0x941c('0x16'));var licenseUtil=require(_0x941c('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x529be1,_0x460457){_0x460457=_0x460457||0xcc;return function(_0x15ce7c){if(_0x15ce7c){return _0x529be1[_0x941c('0x18')](_0x460457);}return _0x529be1[_0x941c('0x19')](_0x460457)[_0x941c('0x1a')]();};}function respondWithResult(_0x126a16,_0xce1151){_0xce1151=_0xce1151||0xc8;return function(_0xe7a18d){if(_0xe7a18d){return _0x126a16[_0x941c('0x19')](_0xce1151)[_0x941c('0x1b')](_0xe7a18d);}};}function respondWithFilteredResult(_0x476a99,_0x2ac48b){return function(_0x4b5dbe){if(_0x4b5dbe){var _0x9a4cc6=typeof _0x2ac48b[_0x941c('0x1c')]===_0x941c('0x1d')&&typeof _0x2ac48b[_0x941c('0x1e')]===_0x941c('0x1d');var _0x4fafa1=_0x4b5dbe[_0x941c('0x1f')];var _0x553e22=_0x9a4cc6?0x0:_0x2ac48b[_0x941c('0x1c')];var _0x2d4dad=_0x9a4cc6?_0x4b5dbe[_0x941c('0x1f')]:_0x2ac48b[_0x941c('0x1c')]+_0x2ac48b['limit'];var _0x46b7bd;if(_0x2d4dad>=_0x4fafa1){_0x2d4dad=_0x4fafa1;_0x46b7bd=0xc8;}else{_0x46b7bd=0xce;}_0x476a99['status'](_0x46b7bd);return _0x476a99[_0x941c('0x20')](_0x941c('0x21'),_0x553e22+'-'+_0x2d4dad+'/'+_0x4fafa1)[_0x941c('0x1b')](_0x4b5dbe);}return null;};}function patchUpdates(_0x185ae1){return function(_0x5e28cc){try{jsonpatch[_0x941c('0x22')](_0x5e28cc,_0x185ae1,!![]);}catch(_0x3f761b){return BPromise[_0x941c('0x23')](_0x3f761b);}return _0x5e28cc[_0x941c('0x24')]();};}function saveUpdates(_0x88c532,_0x38eca2){return function(_0x1e440d){if(_0x1e440d){return _0x1e440d[_0x941c('0x25')](_0x88c532)['then'](function(_0x949383){return _0x949383;});}return null;};}function removeEntity(_0x4f8cff,_0x3f323f){return function(_0x3fc19d){if(_0x3fc19d){return _0x3fc19d[_0x941c('0x26')]()[_0x941c('0x27')](function(){_0x4f8cff[_0x941c('0x19')](0xcc)[_0x941c('0x1a')]();});}};}function handleEntityNotFound(_0x262bd8,_0x40c308){return function(_0xe4b587){if(!_0xe4b587){_0x262bd8[_0x941c('0x18')](0x194);}return _0xe4b587;};}function handleError(_0x5bd318,_0x1c647c){_0x1c647c=_0x1c647c||0x1f4;return function(_0x2acfe9){logger[_0x941c('0x28')](_0x2acfe9['stack']);if(_0x2acfe9[_0x941c('0x29')]){delete _0x2acfe9[_0x941c('0x29')];}_0x5bd318[_0x941c('0x19')](_0x1c647c)[_0x941c('0x2a')](_0x2acfe9);};}exports[_0x941c('0x2b')]=function(_0x5de5f0,_0x447c97){var _0x46d560={},_0x52945c={},_0x17b391={'count':0x0,'rows':[]};var _0x53e384=_[_0x941c('0x2c')](db['OpenchannelQueueReport'][_0x941c('0x2d')],function(_0x39b05f){return{'name':_0x39b05f[_0x941c('0x2e')],'type':_0x39b05f['type']['key']};});_0x52945c[_0x941c('0x2f')]=_['map'](_0x53e384,_0x941c('0x29'));_0x52945c[_0x941c('0x30')]=_['keys'](_0x5de5f0['query']);_0x52945c[_0x941c('0x31')]=_[_0x941c('0x32')](_0x52945c[_0x941c('0x2f')],_0x52945c[_0x941c('0x30')]);_0x46d560[_0x941c('0x33')]=_[_0x941c('0x32')](_0x52945c['model'],qs['fields'](_0x5de5f0[_0x941c('0x30')][_0x941c('0x34')]));_0x46d560[_0x941c('0x33')]=_0x46d560['attributes'][_0x941c('0x35')]?_0x46d560[_0x941c('0x33')]:_0x52945c[_0x941c('0x2f')];if(!_0x5de5f0[_0x941c('0x30')][_0x941c('0x36')](_0x941c('0x37'))){_0x46d560['limit']=qs[_0x941c('0x1e')](_0x5de5f0['query']['limit']);_0x46d560[_0x941c('0x1c')]=qs['offset'](_0x5de5f0['query'][_0x941c('0x1c')]);}_0x46d560[_0x941c('0x38')]=qs[_0x941c('0x39')](_0x5de5f0[_0x941c('0x30')][_0x941c('0x39')]);_0x46d560[_0x941c('0x3a')]=qs[_0x941c('0x31')](_[_0x941c('0x3b')](_0x5de5f0[_0x941c('0x30')],_0x52945c['filters']),_0x53e384);if(_0x5de5f0['query'][_0x941c('0x3c')]){_0x46d560[_0x941c('0x3a')]=_[_0x941c('0x3d')](_0x46d560[_0x941c('0x3a')],{'$or':_[_0x941c('0x2c')](_0x53e384,function(_0x4d3500){if(_0x4d3500[_0x941c('0x3e')]!=='VIRTUAL'){var _0x1957ba={};_0x1957ba[_0x4d3500['name']]={'$like':'%'+_0x5de5f0['query']['filter']+'%'};return _0x1957ba;}})});}_0x46d560=_[_0x941c('0x3d')]({},_0x46d560,_0x5de5f0['options']);var _0x3cdd4f={'where':_0x46d560[_0x941c('0x3a')]};return db[_0x941c('0x3f')][_0x941c('0x1f')](_0x3cdd4f)[_0x941c('0x27')](function(_0x51ee36){_0x17b391['count']=_0x51ee36;if(_0x5de5f0[_0x941c('0x30')][_0x941c('0x40')]){_0x46d560[_0x941c('0x41')]=[{'all':!![]}];}return db['OpenchannelQueueReport']['findAll'](_0x46d560);})['then'](function(_0x472164){_0x17b391[_0x941c('0x42')]=_0x472164;return _0x17b391;})[_0x941c('0x27')](respondWithFilteredResult(_0x447c97,_0x46d560))['catch'](handleError(_0x447c97,null));};exports[_0x941c('0x43')]=function(_0x4d2651,_0x177d5c){var _0x5e7bea={'raw':!![],'where':{'id':_0x4d2651[_0x941c('0x44')]['id']}},_0x367661={};_0x367661[_0x941c('0x2f')]=_[_0x941c('0x45')](db[_0x941c('0x3f')][_0x941c('0x2d')]);_0x367661[_0x941c('0x30')]=_[_0x941c('0x45')](_0x4d2651['query']);_0x367661['filters']=_[_0x941c('0x32')](_0x367661[_0x941c('0x2f')],_0x367661['query']);_0x5e7bea['attributes']=_[_0x941c('0x32')](_0x367661[_0x941c('0x2f')],qs[_0x941c('0x34')](_0x4d2651['query']['fields']));_0x5e7bea['attributes']=_0x5e7bea[_0x941c('0x33')][_0x941c('0x35')]?_0x5e7bea[_0x941c('0x33')]:_0x367661[_0x941c('0x2f')];if(_0x4d2651[_0x941c('0x30')][_0x941c('0x40')]){_0x5e7bea[_0x941c('0x41')]=[{'all':!![]}];}_0x5e7bea=_['merge']({},_0x5e7bea,_0x4d2651['options']);return db[_0x941c('0x3f')][_0x941c('0x46')](_0x5e7bea)['then'](handleEntityNotFound(_0x177d5c,null))['then'](respondWithResult(_0x177d5c,null))[_0x941c('0x47')](handleError(_0x177d5c,null));};exports['create']=function(_0x3c7419,_0x1d974c){return db[_0x941c('0x3f')][_0x941c('0x48')](_0x3c7419[_0x941c('0x49')],{})[_0x941c('0x27')](respondWithResult(_0x1d974c,0xc9))[_0x941c('0x47')](handleError(_0x1d974c,null));};exports[_0x941c('0x25')]=function(_0x4b0baa,_0x1d855d){if(_0x4b0baa[_0x941c('0x49')]['id']){delete _0x4b0baa[_0x941c('0x49')]['id'];}return db[_0x941c('0x3f')][_0x941c('0x46')]({'where':{'id':_0x4b0baa['params']['id']}})['then'](handleEntityNotFound(_0x1d855d,null))[_0x941c('0x27')](saveUpdates(_0x4b0baa[_0x941c('0x49')],null))[_0x941c('0x27')](respondWithResult(_0x1d855d,null))[_0x941c('0x47')](handleError(_0x1d855d,null));};exports[_0x941c('0x26')]=function(_0x511a93,_0x1e356d){return db[_0x941c('0x3f')][_0x941c('0x46')]({'where':{'id':_0x511a93[_0x941c('0x44')]['id']}})[_0x941c('0x27')](handleEntityNotFound(_0x1e356d,null))['then'](removeEntity(_0x1e356d,null))['catch'](handleError(_0x1e356d,null));};exports['describe']=function(_0x1eaeeb,_0x461757){return db[_0x941c('0x3f')]['describe']()[_0x941c('0x27')](respondWithResult(_0x461757,null))[_0x941c('0x47')](handleError(_0x461757,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 32f5a73..0eab3d7 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 _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash'];(function(_0x4ec15a,_0x19290b){var _0x18a26d=function(_0x5d51c7){while(--_0x5d51c7){_0x4ec15a['push'](_0x4ec15a['shift']());}};_0x18a26d(++_0x19290b);}(_0x326f,0xd1));var _0xf326=function(_0x24b5d4,_0x1bcbf4){_0x24b5d4=_0x24b5d4-0x0;var _0x5e59f4=_0x326f[_0x24b5d4];return _0x5e59f4;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe14b=['bluebird','path','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','moment'];(function(_0x5d386b,_0x352e3f){var _0xdfc622=function(_0xad5ee7){while(--_0xad5ee7){_0x5d386b['push'](_0x5d386b['shift']());}};_0xdfc622(++_0x352e3f);}(_0xe14b,0x93));var _0xbe14=function(_0x4ba94b,_0x1131a1){_0x4ba94b=_0x4ba94b-0x0;var _0x4ff381=_0xe14b[_0x4ba94b];return _0x4ff381;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 13cf900..af151c9 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 _0xdd4f=['message','info','result','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','options','raw','catch','update','body','where','attributes','UpdateOpenchannelQueueReport','lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x34e200,_0x464036){var _0x586145=function(_0x57115b){while(--_0x57115b){_0x34e200['push'](_0x34e200['shift']());}};_0x586145(++_0x464036);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x297199,_0x115aad){_0x297199=_0x297199-0x0;var _0x2d0aaf=_0xdd4f[_0x297199];return _0x2d0aaf;};'use strict';var _=require(_0xfdd4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfdd4('0x1'));var fs=require('fs');var Redis=require(_0xfdd4('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xfdd4('0x3'));var logger=require(_0xfdd4('0x4'))(_0xfdd4('0x5'));var config=require('../../config/environment');var jayson=require(_0xfdd4('0x6'));var client=jayson[_0xfdd4('0x7')][_0xfdd4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x307ac6,_0x3c72d4,_0x51acd6){return new BPromise(function(_0x3cd8e6,_0x563ae6){return client[_0xfdd4('0x9')](_0x307ac6,_0x51acd6)[_0xfdd4('0xa')](function(_0x1e823e){logger['info'](_0xfdd4('0xb'),_0x3c72d4,'request\x20sent');logger[_0xfdd4('0xc')](_0xfdd4('0xd'),_0x3c72d4,_0xfdd4('0xe'),JSON[_0xfdd4('0xf')](_0x1e823e));if(_0x1e823e[_0xfdd4('0x10')]){if(_0x1e823e[_0xfdd4('0x10')][_0xfdd4('0x11')]===0x1f4){logger[_0xfdd4('0x10')](_0xfdd4('0xb'),_0x3c72d4,_0x1e823e[_0xfdd4('0x10')][_0xfdd4('0x12')]);return _0x563ae6(_0x1e823e['error'][_0xfdd4('0x12')]);}logger[_0xfdd4('0x10')](_0xfdd4('0xb'),_0x3c72d4,_0x1e823e['error'][_0xfdd4('0x12')]);return _0x3cd8e6(_0x1e823e['error'][_0xfdd4('0x12')]);}else{logger[_0xfdd4('0x13')](_0xfdd4('0xb'),_0x3c72d4,_0xfdd4('0xe'));_0x3cd8e6(_0x1e823e[_0xfdd4('0x14')]['message']);}})['catch'](function(_0x559c77){logger[_0xfdd4('0x10')](_0xfdd4('0xb'),_0x3c72d4,_0x559c77);_0x563ae6(_0x559c77);});});}exports[_0xfdd4('0x15')]=function(_0x2ccc88){var _0x32b5f7=this;return new Promise(function(_0x33d752,_0x1746e1){return db[_0xfdd4('0x16')][_0xfdd4('0x17')](_0x2ccc88['body'],{'raw':_0x2ccc88[_0xfdd4('0x18')]?_0x2ccc88[_0xfdd4('0x18')][_0xfdd4('0x19')]===undefined?!![]:![]:!![]})[_0xfdd4('0xa')](function(_0x1454f1){logger[_0xfdd4('0x13')](_0xfdd4('0x15'),_0x2ccc88);logger[_0xfdd4('0xc')]('CreateOpenchannelQueueReport',_0x2ccc88,JSON[_0xfdd4('0xf')](_0x1454f1));_0x33d752(_0x1454f1);})[_0xfdd4('0x1a')](function(_0x2a24e8){logger[_0xfdd4('0x10')](_0xfdd4('0x15'),_0x2a24e8[_0xfdd4('0x12')],_0x2ccc88);_0x1746e1(_0x32b5f7[_0xfdd4('0x10')](0x1f4,_0x2a24e8[_0xfdd4('0x12')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x1e14da){var _0x1112e8=this;return new Promise(function(_0x4397a3,_0x53d35a){return db[_0xfdd4('0x16')][_0xfdd4('0x1b')](_0x1e14da[_0xfdd4('0x1c')],{'raw':_0x1e14da[_0xfdd4('0x18')]?_0x1e14da[_0xfdd4('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e14da[_0xfdd4('0x18')]?_0x1e14da[_0xfdd4('0x18')][_0xfdd4('0x1d')]||null:null,'attributes':_0x1e14da[_0xfdd4('0x18')]?_0x1e14da[_0xfdd4('0x18')][_0xfdd4('0x1e')]||null:null,'limit':_0x1e14da[_0xfdd4('0x18')]?_0x1e14da[_0xfdd4('0x18')]['limit']||null:null})[_0xfdd4('0xa')](function(_0x39981f){logger[_0xfdd4('0x13')](_0xfdd4('0x1f'),_0x1e14da);logger[_0xfdd4('0xc')]('UpdateOpenchannelQueueReport',_0x1e14da,JSON[_0xfdd4('0xf')](_0x39981f));_0x4397a3(_0x39981f);})[_0xfdd4('0x1a')](function(_0xbf38b4){logger[_0xfdd4('0x10')](_0xfdd4('0x1f'),_0xbf38b4['message'],_0x1e14da);_0x53d35a(_0x1112e8[_0xfdd4('0x10')](0x1f4,_0xbf38b4[_0xfdd4('0x12')]));});});}; \ No newline at end of file +var _0x7894=['request\x20sent','stringify','error','message','CreateOpenchannelQueueReport','OpenchannelQueueReport','body','options','raw','then','catch','update','where','attributes','limit','UpdateOpenchannelQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','OpenchannelQueueReport,\x20%s,\x20%s','debug'];(function(_0x55fdd0,_0x28bd64){var _0x2db1b5=function(_0x3b15cd){while(--_0x3b15cd){_0x55fdd0['push'](_0x55fdd0['shift']());}};_0x2db1b5(++_0x28bd64);}(_0x7894,0x170));var _0x4789=function(_0x1a6e93,_0x6e710f){_0x1a6e93=_0x1a6e93-0x0;var _0x427028=_0x7894[_0x1a6e93];return _0x427028;};'use strict';var _=require(_0x4789('0x0'));var util=require(_0x4789('0x1'));var moment=require(_0x4789('0x2'));var BPromise=require(_0x4789('0x3'));var rs=require(_0x4789('0x4'));var fs=require('fs');var Redis=require(_0x4789('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4789('0x6'));var logger=require(_0x4789('0x7'))('rpc');var config=require(_0x4789('0x8'));var jayson=require(_0x4789('0x9'));var client=jayson[_0x4789('0xa')][_0x4789('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x114a90,_0x298902,_0x13b7f6){return new BPromise(function(_0x5a45ae,_0x49d256){return client[_0x4789('0xc')](_0x114a90,_0x13b7f6)['then'](function(_0x2e8038){logger[_0x4789('0xd')](_0x4789('0xe'),_0x298902,'request\x20sent');logger[_0x4789('0xf')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x298902,_0x4789('0x10'),JSON[_0x4789('0x11')](_0x2e8038));if(_0x2e8038[_0x4789('0x12')]){if(_0x2e8038['error']['code']===0x1f4){logger[_0x4789('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x298902,_0x2e8038[_0x4789('0x12')]['message']);return _0x49d256(_0x2e8038[_0x4789('0x12')][_0x4789('0x13')]);}logger['error'](_0x4789('0xe'),_0x298902,_0x2e8038['error'][_0x4789('0x13')]);return _0x5a45ae(_0x2e8038[_0x4789('0x12')][_0x4789('0x13')]);}else{logger['info'](_0x4789('0xe'),_0x298902,_0x4789('0x10'));_0x5a45ae(_0x2e8038['result'][_0x4789('0x13')]);}})['catch'](function(_0x118f97){logger[_0x4789('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x298902,_0x118f97);_0x49d256(_0x118f97);});});}exports[_0x4789('0x14')]=function(_0x5af7b3){var _0x2f1511=this;return new Promise(function(_0x56d799,_0x19dc59){return db[_0x4789('0x15')]['create'](_0x5af7b3[_0x4789('0x16')],{'raw':_0x5af7b3[_0x4789('0x17')]?_0x5af7b3[_0x4789('0x17')][_0x4789('0x18')]===undefined?!![]:![]:!![]})[_0x4789('0x19')](function(_0x3a707d){logger[_0x4789('0xd')](_0x4789('0x14'),_0x5af7b3);logger[_0x4789('0xf')](_0x4789('0x14'),_0x5af7b3,JSON[_0x4789('0x11')](_0x3a707d));_0x56d799(_0x3a707d);})[_0x4789('0x1a')](function(_0x4f7ceb){logger[_0x4789('0x12')](_0x4789('0x14'),_0x4f7ceb['message'],_0x5af7b3);_0x19dc59(_0x2f1511[_0x4789('0x12')](0x1f4,_0x4f7ceb[_0x4789('0x13')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0xff56dd){var _0x1ca6ca=this;return new Promise(function(_0x54d9c1,_0xd8601e){return db['OpenchannelQueueReport'][_0x4789('0x1b')](_0xff56dd[_0x4789('0x16')],{'raw':_0xff56dd[_0x4789('0x17')]?_0xff56dd[_0x4789('0x17')][_0x4789('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xff56dd[_0x4789('0x17')]?_0xff56dd[_0x4789('0x17')][_0x4789('0x1c')]||null:null,'attributes':_0xff56dd[_0x4789('0x17')]?_0xff56dd[_0x4789('0x17')][_0x4789('0x1d')]||null:null,'limit':_0xff56dd[_0x4789('0x17')]?_0xff56dd[_0x4789('0x17')][_0x4789('0x1e')]||null:null})[_0x4789('0x19')](function(_0x3095a1){logger[_0x4789('0xd')](_0x4789('0x1f'),_0xff56dd);logger['debug']('UpdateOpenchannelQueueReport',_0xff56dd,JSON[_0x4789('0x11')](_0x3095a1));_0x54d9c1(_0x3095a1);})['catch'](function(_0x490ea3){logger['error'](_0x4789('0x1f'),_0x490ea3[_0x4789('0x13')],_0xff56dd);_0xd8601e(_0x1ca6ca[_0x4789('0x12')](0x1f4,_0x490ea3[_0x4789('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 9a0a1d8..f3bbb55 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 _0x4b45=['create','/:id','delete','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','describe'];(function(_0x3ca44f,_0x5683fe){var _0x4005a7=function(_0x26edb1){while(--_0x26edb1){_0x3ca44f['push'](_0x3ca44f['shift']());}};_0x4005a7(++_0x5683fe);}(_0x4b45,0x15e));var _0x54b4=function(_0x1392a8,_0x408869){_0x1392a8=_0x1392a8-0x0;var _0x18e025=_0x4b45[_0x1392a8];return _0x18e025;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x54b4('0x0'));var timeout=require(_0x54b4('0x1'));var express=require('express');var router=express[_0x54b4('0x2')]();var fs_extra=require(_0x54b4('0x3'));var auth=require(_0x54b4('0x4'));var interaction=require(_0x54b4('0x5'));var config=require(_0x54b4('0x6'));var controller=require('./openchannelTransferReport.controller');router['get']('/',auth[_0x54b4('0x7')](),controller[_0x54b4('0x8')]);router['get']('/describe',auth[_0x54b4('0x7')](),controller[_0x54b4('0x9')]);router['get']('/:id',auth[_0x54b4('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x54b4('0xa')]);router['put'](_0x54b4('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x54b4('0xc')](_0x54b4('0xb'),auth[_0x54b4('0x7')](),controller[_0x54b4('0xd')]);module[_0x54b4('0xe')]=router; \ No newline at end of file +var _0x238a=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','isAuthenticated','/describe','describe','get','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x4bdf53,_0x32533e){var _0x4bc0dd=function(_0x2be250){while(--_0x2be250){_0x4bdf53['push'](_0x4bdf53['shift']());}};_0x4bc0dd(++_0x32533e);}(_0x238a,0x14a));var _0xa238=function(_0x58c851,_0x1f3d96){_0x58c851=_0x58c851-0x0;var _0x534d8a=_0x238a[_0x58c851];return _0x534d8a;};'use strict';var multer=require(_0xa238('0x0'));var util=require(_0xa238('0x1'));var path=require(_0xa238('0x2'));var timeout=require(_0xa238('0x3'));var express=require('express');var router=express[_0xa238('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa238('0x5'));var interaction=require(_0xa238('0x6'));var config=require(_0xa238('0x7'));var controller=require(_0xa238('0x8'));router['get']('/',auth[_0xa238('0x9')](),controller['index']);router['get'](_0xa238('0xa'),auth[_0xa238('0x9')](),controller[_0xa238('0xb')]);router[_0xa238('0xc')](_0xa238('0xd'),auth[_0xa238('0x9')](),controller[_0xa238('0xe')]);router[_0xa238('0xf')]('/',auth[_0xa238('0x9')](),controller[_0xa238('0x10')]);router[_0xa238('0x11')](_0xa238('0xd'),auth['isAuthenticated'](),controller[_0xa238('0x12')]);router[_0xa238('0x13')](_0xa238('0xd'),auth[_0xa238('0x9')](),controller[_0xa238('0x14')]);module[_0xa238('0x15')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index d8114e7..4c9338f 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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x53c2ec,_0x56b6f8){var _0xbd4cd0=function(_0x3640d1){while(--_0x3640d1){_0x53c2ec['push'](_0x53c2ec['shift']());}};_0xbd4cd0(++_0x56b6f8);}(_0x9c44,0x178));var _0x49c4=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x9c44[_0x3bf83f];return _0x22c4a9;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file +var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x5bb077,_0x314590){var _0x487afc=function(_0x1293b3){while(--_0x1293b3){_0x5bb077['push'](_0x5bb077['shift']());}};_0x487afc(++_0x314590);}(_0x008c,0x188));var _0xc008=function(_0x16b994,_0x22872a){_0x16b994=_0x16b994-0x0;var _0xfc3e0f=_0x008c[_0x16b994];return _0xfc3e0f;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 6102d16..4f819ea 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 _0xad0c=['../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','destroy','then','error','stack','name','map','OpenchannelTransferReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xad0c,0x1d7));var _0xcad0=function(_0x2edb38,_0x19a009){_0x2edb38=_0x2edb38-0x0;var _0x4355fc=_0xad0c[_0x2edb38];return _0x4355fc;};'use strict';var emlformat=require(_0xcad0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcad0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcad0('0x2'));var moment=require(_0xcad0('0x3'));var BPromise=require(_0xcad0('0x4'));var Mustache=require(_0xcad0('0x5'));var util=require('util');var path=require('path');var sox=require(_0xcad0('0x6'));var csv=require('to-csv');var ejs=require(_0xcad0('0x7'));var fs=require('fs');var fs_extra=require(_0xcad0('0x8'));var _=require(_0xcad0('0x9'));var squel=require(_0xcad0('0xa'));var crypto=require(_0xcad0('0xb'));var jsforce=require(_0xcad0('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcad0('0xd'));var authService=require(_0xcad0('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xcad0('0xf'));var hardwareService=require(_0xcad0('0x10'));var logger=require('../../config/logger')(_0xcad0('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xcad0('0x12'));var db=require(_0xcad0('0x13'))['db'];function respondWithStatusCode(_0x1f6b07,_0x3aa27c){_0x3aa27c=_0x3aa27c||0xcc;return function(_0x5e3e1a){if(_0x5e3e1a){return _0x1f6b07['sendStatus'](_0x3aa27c);}return _0x1f6b07[_0xcad0('0x14')](_0x3aa27c)[_0xcad0('0x15')]();};}function respondWithResult(_0x671df3,_0x30d078){_0x30d078=_0x30d078||0xc8;return function(_0x58eddf){if(_0x58eddf){return _0x671df3[_0xcad0('0x14')](_0x30d078)[_0xcad0('0x16')](_0x58eddf);}};}function respondWithFilteredResult(_0x260d30,_0x323ced){return function(_0x29ab5e){if(_0x29ab5e){var _0x185f82=typeof _0x323ced['offset']===_0xcad0('0x17')&&typeof _0x323ced[_0xcad0('0x18')]===_0xcad0('0x17');var _0x147ee6=_0x29ab5e[_0xcad0('0x19')];var _0x250691=_0x185f82?0x0:_0x323ced[_0xcad0('0x1a')];var _0x1c1a73=_0x185f82?_0x29ab5e[_0xcad0('0x19')]:_0x323ced[_0xcad0('0x1a')]+_0x323ced[_0xcad0('0x18')];var _0x379a1b;if(_0x1c1a73>=_0x147ee6){_0x1c1a73=_0x147ee6;_0x379a1b=0xc8;}else{_0x379a1b=0xce;}_0x260d30[_0xcad0('0x14')](_0x379a1b);return _0x260d30[_0xcad0('0x1b')](_0xcad0('0x1c'),_0x250691+'-'+_0x1c1a73+'/'+_0x147ee6)['json'](_0x29ab5e);}return null;};}function patchUpdates(_0x3ad2dd){return function(_0x3fd495){try{jsonpatch[_0xcad0('0x1d')](_0x3fd495,_0x3ad2dd,!![]);}catch(_0x2e05bb){return BPromise['reject'](_0x2e05bb);}return _0x3fd495[_0xcad0('0x1e')]();};}function saveUpdates(_0x31383c,_0xc493fa){return function(_0x57ee12){if(_0x57ee12){return _0x57ee12[_0xcad0('0x1f')](_0x31383c)['then'](function(_0x514c75){return _0x514c75;});}return null;};}function removeEntity(_0xebbd53,_0x547cd3){return function(_0x5d2b22){if(_0x5d2b22){return _0x5d2b22[_0xcad0('0x20')]()[_0xcad0('0x21')](function(){_0xebbd53[_0xcad0('0x14')](0xcc)[_0xcad0('0x15')]();});}};}function handleEntityNotFound(_0x588699,_0xaa7511){return function(_0x3fd172){if(!_0x3fd172){_0x588699['sendStatus'](0x194);}return _0x3fd172;};}function handleError(_0x29e96b,_0xb4bfec){_0xb4bfec=_0xb4bfec||0x1f4;return function(_0x21acb4){logger[_0xcad0('0x22')](_0x21acb4[_0xcad0('0x23')]);if(_0x21acb4[_0xcad0('0x24')]){delete _0x21acb4[_0xcad0('0x24')];}_0x29e96b[_0xcad0('0x14')](_0xb4bfec)['send'](_0x21acb4);};}exports['index']=function(_0x1d2dfd,_0x572483){var _0x3af382={},_0x4520b5={},_0x4a82c0={'count':0x0,'rows':[]};var _0x3370e0=_[_0xcad0('0x25')](db[_0xcad0('0x26')][_0xcad0('0x27')],function(_0x2d8aa5){return{'name':_0x2d8aa5[_0xcad0('0x28')],'type':_0x2d8aa5['type'][_0xcad0('0x29')]};});_0x4520b5[_0xcad0('0x2a')]=_[_0xcad0('0x25')](_0x3370e0,'name');_0x4520b5[_0xcad0('0x2b')]=_['keys'](_0x1d2dfd[_0xcad0('0x2b')]);_0x4520b5[_0xcad0('0x2c')]=_[_0xcad0('0x2d')](_0x4520b5[_0xcad0('0x2a')],_0x4520b5[_0xcad0('0x2b')]);_0x3af382[_0xcad0('0x2e')]=_['intersection'](_0x4520b5['model'],qs[_0xcad0('0x2f')](_0x1d2dfd[_0xcad0('0x2b')][_0xcad0('0x2f')]));_0x3af382['attributes']=_0x3af382[_0xcad0('0x2e')][_0xcad0('0x30')]?_0x3af382[_0xcad0('0x2e')]:_0x4520b5['model'];if(!_0x1d2dfd[_0xcad0('0x2b')][_0xcad0('0x31')](_0xcad0('0x32'))){_0x3af382['limit']=qs[_0xcad0('0x18')](_0x1d2dfd['query'][_0xcad0('0x18')]);_0x3af382[_0xcad0('0x1a')]=qs[_0xcad0('0x1a')](_0x1d2dfd[_0xcad0('0x2b')][_0xcad0('0x1a')]);}_0x3af382[_0xcad0('0x33')]=qs[_0xcad0('0x34')](_0x1d2dfd[_0xcad0('0x2b')]['sort']);_0x3af382[_0xcad0('0x35')]=qs[_0xcad0('0x2c')](_['pick'](_0x1d2dfd[_0xcad0('0x2b')],_0x4520b5['filters']),_0x3370e0);if(_0x1d2dfd[_0xcad0('0x2b')][_0xcad0('0x36')]){_0x3af382[_0xcad0('0x35')]=_[_0xcad0('0x37')](_0x3af382[_0xcad0('0x35')],{'$or':_['map'](_0x3370e0,function(_0x5bef30){if(_0x5bef30[_0xcad0('0x38')]!=='VIRTUAL'){var _0x4d1055={};_0x4d1055[_0x5bef30[_0xcad0('0x24')]]={'$like':'%'+_0x1d2dfd[_0xcad0('0x2b')]['filter']+'%'};return _0x4d1055;}})});}_0x3af382=_[_0xcad0('0x37')]({},_0x3af382,_0x1d2dfd[_0xcad0('0x39')]);var _0x59c029={'where':_0x3af382['where']};return db[_0xcad0('0x26')][_0xcad0('0x19')](_0x59c029)[_0xcad0('0x21')](function(_0x1a70f8){_0x4a82c0[_0xcad0('0x19')]=_0x1a70f8;if(_0x1d2dfd['query'][_0xcad0('0x3a')]){_0x3af382[_0xcad0('0x3b')]=[{'all':!![]}];}return db[_0xcad0('0x26')][_0xcad0('0x3c')](_0x3af382);})[_0xcad0('0x21')](function(_0x104f4b){_0x4a82c0[_0xcad0('0x3d')]=_0x104f4b;return _0x4a82c0;})['then'](respondWithFilteredResult(_0x572483,_0x3af382))[_0xcad0('0x3e')](handleError(_0x572483,null));};exports[_0xcad0('0x3f')]=function(_0x23ebd6,_0xaec5e7){var _0x533040={'raw':!![],'where':{'id':_0x23ebd6[_0xcad0('0x40')]['id']}},_0x3a9611={};_0x3a9611[_0xcad0('0x2a')]=_[_0xcad0('0x41')](db[_0xcad0('0x26')]['rawAttributes']);_0x3a9611[_0xcad0('0x2b')]=_['keys'](_0x23ebd6[_0xcad0('0x2b')]);_0x3a9611[_0xcad0('0x2c')]=_[_0xcad0('0x2d')](_0x3a9611[_0xcad0('0x2a')],_0x3a9611['query']);_0x533040[_0xcad0('0x2e')]=_[_0xcad0('0x2d')](_0x3a9611['model'],qs['fields'](_0x23ebd6[_0xcad0('0x2b')]['fields']));_0x533040[_0xcad0('0x2e')]=_0x533040[_0xcad0('0x2e')][_0xcad0('0x30')]?_0x533040[_0xcad0('0x2e')]:_0x3a9611['model'];if(_0x23ebd6[_0xcad0('0x2b')][_0xcad0('0x3a')]){_0x533040['include']=[{'all':!![]}];}_0x533040=_['merge']({},_0x533040,_0x23ebd6[_0xcad0('0x39')]);return db[_0xcad0('0x26')][_0xcad0('0x42')](_0x533040)[_0xcad0('0x21')](handleEntityNotFound(_0xaec5e7,null))[_0xcad0('0x21')](respondWithResult(_0xaec5e7,null))[_0xcad0('0x3e')](handleError(_0xaec5e7,null));};exports['create']=function(_0x55cf44,_0x3dc0d9){return db[_0xcad0('0x26')][_0xcad0('0x43')](_0x55cf44[_0xcad0('0x44')],{})[_0xcad0('0x21')](respondWithResult(_0x3dc0d9,0xc9))[_0xcad0('0x3e')](handleError(_0x3dc0d9,null));};exports[_0xcad0('0x1f')]=function(_0x3487d2,_0x151f76){if(_0x3487d2[_0xcad0('0x44')]['id']){delete _0x3487d2[_0xcad0('0x44')]['id'];}return db[_0xcad0('0x26')][_0xcad0('0x42')]({'where':{'id':_0x3487d2[_0xcad0('0x40')]['id']}})[_0xcad0('0x21')](handleEntityNotFound(_0x151f76,null))[_0xcad0('0x21')](saveUpdates(_0x3487d2[_0xcad0('0x44')],null))[_0xcad0('0x21')](respondWithResult(_0x151f76,null))[_0xcad0('0x3e')](handleError(_0x151f76,null));};exports[_0xcad0('0x20')]=function(_0x22008e,_0x1dd485){return db[_0xcad0('0x26')]['find']({'where':{'id':_0x22008e[_0xcad0('0x40')]['id']}})['then'](handleEntityNotFound(_0x1dd485,null))[_0xcad0('0x21')](removeEntity(_0x1dd485,null))[_0xcad0('0x3e')](handleError(_0x1dd485,null));};exports[_0xcad0('0x45')]=function(_0x34100e,_0xcd8d80){return db['OpenchannelTransferReport'][_0xcad0('0x45')]()[_0xcad0('0x21')](respondWithResult(_0xcd8d80,null))[_0xcad0('0x3e')](handleError(_0xcd8d80,null));}; \ No newline at end of file +var _0x6588=['OpenchannelTransferReport','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','end','sendStatus','error','stack','name','send','index'];(function(_0x5e07d5,_0x484083){var _0x273a52=function(_0x3ac25c){while(--_0x3ac25c){_0x5e07d5['push'](_0x5e07d5['shift']());}};_0x273a52(++_0x484083);}(_0x6588,0x1a2));var _0x8658=function(_0x2c763e,_0x4654de){_0x2c763e=_0x2c763e-0x0;var _0x53b5b8=_0x6588[_0x2c763e];return _0x53b5b8;};'use strict';var emlformat=require(_0x8658('0x0'));var rimraf=require(_0x8658('0x1'));var zipdir=require(_0x8658('0x2'));var jsonpatch=require(_0x8658('0x3'));var rp=require(_0x8658('0x4'));var moment=require(_0x8658('0x5'));var BPromise=require(_0x8658('0x6'));var Mustache=require('mustache');var util=require(_0x8658('0x7'));var path=require(_0x8658('0x8'));var sox=require(_0x8658('0x9'));var csv=require(_0x8658('0xa'));var ejs=require(_0x8658('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8658('0xc'));var squel=require(_0x8658('0xd'));var crypto=require(_0x8658('0xe'));var jsforce=require(_0x8658('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x8658('0xa'));var querystring=require(_0x8658('0x10'));var Papa=require('papaparse');var Redis=require(_0x8658('0x11'));var authService=require(_0x8658('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8658('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8658('0x14'))(_0x8658('0x15'));var utils=require(_0x8658('0x16'));var config=require(_0x8658('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8658('0x18'))['db'];function respondWithStatusCode(_0xe38387,_0x2f215d){_0x2f215d=_0x2f215d||0xcc;return function(_0x464814){if(_0x464814){return _0xe38387['sendStatus'](_0x2f215d);}return _0xe38387[_0x8658('0x19')](_0x2f215d)['end']();};}function respondWithResult(_0xd5a25,_0x295032){_0x295032=_0x295032||0xc8;return function(_0x10f547){if(_0x10f547){return _0xd5a25['status'](_0x295032)[_0x8658('0x1a')](_0x10f547);}};}function respondWithFilteredResult(_0x391542,_0xcfbde){return function(_0x3a17f4){if(_0x3a17f4){var _0x1afdeb=typeof _0xcfbde[_0x8658('0x1b')]==='undefined'&&typeof _0xcfbde[_0x8658('0x1c')]===_0x8658('0x1d');var _0x534e2f=_0x3a17f4[_0x8658('0x1e')];var _0x1dc15f=_0x1afdeb?0x0:_0xcfbde[_0x8658('0x1b')];var _0x14f094=_0x1afdeb?_0x3a17f4['count']:_0xcfbde[_0x8658('0x1b')]+_0xcfbde[_0x8658('0x1c')];var _0x3b6a31;if(_0x14f094>=_0x534e2f){_0x14f094=_0x534e2f;_0x3b6a31=0xc8;}else{_0x3b6a31=0xce;}_0x391542[_0x8658('0x19')](_0x3b6a31);return _0x391542[_0x8658('0x1f')](_0x8658('0x20'),_0x1dc15f+'-'+_0x14f094+'/'+_0x534e2f)[_0x8658('0x1a')](_0x3a17f4);}return null;};}function patchUpdates(_0x4d4494){return function(_0x4fe1e6){try{jsonpatch[_0x8658('0x21')](_0x4fe1e6,_0x4d4494,!![]);}catch(_0xbd7583){return BPromise[_0x8658('0x22')](_0xbd7583);}return _0x4fe1e6['save']();};}function saveUpdates(_0x53924e,_0x367810){return function(_0x3e888c){if(_0x3e888c){return _0x3e888c[_0x8658('0x23')](_0x53924e)[_0x8658('0x24')](function(_0x3e67e7){return _0x3e67e7;});}return null;};}function removeEntity(_0x1a356c,_0x2924ad){return function(_0x1b7e9f){if(_0x1b7e9f){return _0x1b7e9f['destroy']()[_0x8658('0x24')](function(){_0x1a356c[_0x8658('0x19')](0xcc)[_0x8658('0x25')]();});}};}function handleEntityNotFound(_0x47672b,_0x1454df){return function(_0x1301a4){if(!_0x1301a4){_0x47672b[_0x8658('0x26')](0x194);}return _0x1301a4;};}function handleError(_0x5684b7,_0xad55ac){_0xad55ac=_0xad55ac||0x1f4;return function(_0x63f4a5){logger[_0x8658('0x27')](_0x63f4a5[_0x8658('0x28')]);if(_0x63f4a5['name']){delete _0x63f4a5[_0x8658('0x29')];}_0x5684b7[_0x8658('0x19')](_0xad55ac)[_0x8658('0x2a')](_0x63f4a5);};}exports[_0x8658('0x2b')]=function(_0x50ef64,_0x3c1446){var _0x1a4074={},_0x5a9379={},_0x553cfc={'count':0x0,'rows':[]};var _0x286156=_['map'](db[_0x8658('0x2c')][_0x8658('0x2d')],function(_0x13716a){return{'name':_0x13716a['fieldName'],'type':_0x13716a[_0x8658('0x2e')][_0x8658('0x2f')]};});_0x5a9379[_0x8658('0x30')]=_[_0x8658('0x31')](_0x286156,_0x8658('0x29'));_0x5a9379[_0x8658('0x32')]=_[_0x8658('0x33')](_0x50ef64[_0x8658('0x32')]);_0x5a9379['filters']=_[_0x8658('0x34')](_0x5a9379[_0x8658('0x30')],_0x5a9379['query']);_0x1a4074[_0x8658('0x35')]=_[_0x8658('0x34')](_0x5a9379['model'],qs['fields'](_0x50ef64['query'][_0x8658('0x36')]));_0x1a4074[_0x8658('0x35')]=_0x1a4074[_0x8658('0x35')][_0x8658('0x37')]?_0x1a4074[_0x8658('0x35')]:_0x5a9379[_0x8658('0x30')];if(!_0x50ef64['query'][_0x8658('0x38')]('nolimit')){_0x1a4074[_0x8658('0x1c')]=qs[_0x8658('0x1c')](_0x50ef64[_0x8658('0x32')][_0x8658('0x1c')]);_0x1a4074[_0x8658('0x1b')]=qs[_0x8658('0x1b')](_0x50ef64['query'][_0x8658('0x1b')]);}_0x1a4074[_0x8658('0x39')]=qs[_0x8658('0x3a')](_0x50ef64[_0x8658('0x32')][_0x8658('0x3a')]);_0x1a4074[_0x8658('0x3b')]=qs[_0x8658('0x3c')](_[_0x8658('0x3d')](_0x50ef64['query'],_0x5a9379[_0x8658('0x3c')]),_0x286156);if(_0x50ef64['query'][_0x8658('0x3e')]){_0x1a4074['where']=_['merge'](_0x1a4074[_0x8658('0x3b')],{'$or':_[_0x8658('0x31')](_0x286156,function(_0xc13caa){if(_0xc13caa[_0x8658('0x2e')]!==_0x8658('0x3f')){var _0x271743={};_0x271743[_0xc13caa['name']]={'$like':'%'+_0x50ef64[_0x8658('0x32')]['filter']+'%'};return _0x271743;}})});}_0x1a4074=_[_0x8658('0x40')]({},_0x1a4074,_0x50ef64['options']);var _0x51d943={'where':_0x1a4074[_0x8658('0x3b')]};return db[_0x8658('0x2c')][_0x8658('0x1e')](_0x51d943)[_0x8658('0x24')](function(_0x5e80b3){_0x553cfc[_0x8658('0x1e')]=_0x5e80b3;if(_0x50ef64[_0x8658('0x32')][_0x8658('0x41')]){_0x1a4074[_0x8658('0x42')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x8658('0x43')](_0x1a4074);})[_0x8658('0x24')](function(_0x505467){_0x553cfc[_0x8658('0x44')]=_0x505467;return _0x553cfc;})[_0x8658('0x24')](respondWithFilteredResult(_0x3c1446,_0x1a4074))[_0x8658('0x45')](handleError(_0x3c1446,null));};exports[_0x8658('0x46')]=function(_0x18197d,_0x3f65ef){var _0x3fd97a={'raw':!![],'where':{'id':_0x18197d[_0x8658('0x47')]['id']}},_0x3a241b={};_0x3a241b['model']=_[_0x8658('0x33')](db[_0x8658('0x2c')][_0x8658('0x2d')]);_0x3a241b[_0x8658('0x32')]=_[_0x8658('0x33')](_0x18197d['query']);_0x3a241b[_0x8658('0x3c')]=_[_0x8658('0x34')](_0x3a241b[_0x8658('0x30')],_0x3a241b['query']);_0x3fd97a[_0x8658('0x35')]=_['intersection'](_0x3a241b[_0x8658('0x30')],qs[_0x8658('0x36')](_0x18197d[_0x8658('0x32')]['fields']));_0x3fd97a[_0x8658('0x35')]=_0x3fd97a[_0x8658('0x35')][_0x8658('0x37')]?_0x3fd97a[_0x8658('0x35')]:_0x3a241b[_0x8658('0x30')];if(_0x18197d[_0x8658('0x32')][_0x8658('0x41')]){_0x3fd97a[_0x8658('0x42')]=[{'all':!![]}];}_0x3fd97a=_[_0x8658('0x40')]({},_0x3fd97a,_0x18197d['options']);return db['OpenchannelTransferReport'][_0x8658('0x48')](_0x3fd97a)[_0x8658('0x24')](handleEntityNotFound(_0x3f65ef,null))[_0x8658('0x24')](respondWithResult(_0x3f65ef,null))[_0x8658('0x45')](handleError(_0x3f65ef,null));};exports['create']=function(_0x3d390b,_0xf55e8e){return db[_0x8658('0x2c')][_0x8658('0x49')](_0x3d390b['body'],{})[_0x8658('0x24')](respondWithResult(_0xf55e8e,0xc9))[_0x8658('0x45')](handleError(_0xf55e8e,null));};exports[_0x8658('0x23')]=function(_0x2c137b,_0x17a48a){if(_0x2c137b[_0x8658('0x4a')]['id']){delete _0x2c137b[_0x8658('0x4a')]['id'];}return db[_0x8658('0x2c')][_0x8658('0x48')]({'where':{'id':_0x2c137b[_0x8658('0x47')]['id']}})['then'](handleEntityNotFound(_0x17a48a,null))[_0x8658('0x24')](saveUpdates(_0x2c137b[_0x8658('0x4a')],null))[_0x8658('0x24')](respondWithResult(_0x17a48a,null))[_0x8658('0x45')](handleError(_0x17a48a,null));};exports[_0x8658('0x4b')]=function(_0x524aa0,_0x28fa50){return db[_0x8658('0x2c')]['find']({'where':{'id':_0x524aa0[_0x8658('0x47')]['id']}})[_0x8658('0x24')](handleEntityNotFound(_0x28fa50,null))[_0x8658('0x24')](removeEntity(_0x28fa50,null))[_0x8658('0x45')](handleError(_0x28fa50,null));};exports[_0x8658('0x4c')]=function(_0x52aba9,_0x5cc6a9){return db[_0x8658('0x2c')][_0x8658('0x4c')]()[_0x8658('0x24')](respondWithResult(_0x5cc6a9,null))[_0x8658('0x45')](handleError(_0x5cc6a9,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 8438288..a7e0792 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 _0xf810=['request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','report_openchannel_transfer','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x5e1e90,_0x406ddf){var _0x46217a=function(_0x466185){while(--_0x466185){_0x5e1e90['push'](_0x5e1e90['shift']());}};_0x46217a(++_0x406ddf);}(_0xf810,0x100));var _0x0f81=function(_0x352a31,_0x4fc8ac){_0x352a31=_0x352a31-0x0;var _0x323c55=_0xf810[_0x352a31];return _0x323c55;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0f81('0x0'))(_0x0f81('0x1'));var moment=require(_0x0f81('0x2'));var BPromise=require(_0x0f81('0x3'));var rp=require(_0x0f81('0x4'));var fs=require('fs');var path=require(_0x0f81('0x5'));var rimraf=require(_0x0f81('0x6'));var config=require(_0x0f81('0x7'));var attributes=require(_0x0f81('0x8'));module[_0x0f81('0x9')]=function(_0x12fc3f,_0x5c8e02){return _0x12fc3f[_0x0f81('0xa')]('OpenchannelTransferReport',attributes,{'tableName':_0x0f81('0xb'),'paranoid':![],'indexes':[{'name':_0x0f81('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x793c=['define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','api','bluebird','path','../../config/environment','./openchannelTransferReport.attributes','exports'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x793c,0x118));var _0xc793=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x793c[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xc793('0x0'));var util=require(_0xc793('0x1'));var logger=require('../../config/logger')(_0xc793('0x2'));var moment=require('moment');var BPromise=require(_0xc793('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc793('0x4'));var rimraf=require('rimraf');var config=require(_0xc793('0x5'));var attributes=require(_0xc793('0x6'));module[_0xc793('0x7')]=function(_0x10ed1d,_0x48684b){return _0x10ed1d[_0xc793('0x8')](_0xc793('0x9'),attributes,{'tableName':_0xc793('0xa'),'paranoid':![],'indexes':[{'name':_0xc793('0xb'),'fields':[_0xc793('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index bb325e8..048ab8b 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 _0xaa19=['OpenchannelTransferReport,\x20%s,\x20%s','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info'];(function(_0x2166e4,_0x1aee3a){var _0x11021c=function(_0x2b15a1){while(--_0x2b15a1){_0x2166e4['push'](_0x2166e4['shift']());}};_0x11021c(++_0x1aee3a);}(_0xaa19,0x79));var _0x9aa1=function(_0x10cc59,_0x514d84){_0x10cc59=_0x10cc59-0x0;var _0x5f52da=_0xaa19[_0x10cc59];return _0x5f52da;};'use strict';var _=require(_0x9aa1('0x0'));var util=require(_0x9aa1('0x1'));var moment=require(_0x9aa1('0x2'));var BPromise=require(_0x9aa1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9aa1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9aa1('0x5'));var logger=require('../../config/logger')(_0x9aa1('0x6'));var config=require(_0x9aa1('0x7'));var jayson=require(_0x9aa1('0x8'));var client=jayson['client'][_0x9aa1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x473aa0,_0xc2ac6a,_0x5363e3){return new BPromise(function(_0x302408,_0x55ba17){return client['request'](_0x473aa0,_0x5363e3)[_0x9aa1('0xa')](function(_0x234b36){logger[_0x9aa1('0xb')](_0x9aa1('0xc'),_0xc2ac6a,'request\x20sent');logger['debug'](_0x9aa1('0xd'),_0xc2ac6a,'request\x20sent',JSON[_0x9aa1('0xe')](_0x234b36));if(_0x234b36['error']){if(_0x234b36['error']['code']===0x1f4){logger[_0x9aa1('0xf')](_0x9aa1('0xc'),_0xc2ac6a,_0x234b36['error'][_0x9aa1('0x10')]);return _0x55ba17(_0x234b36[_0x9aa1('0xf')][_0x9aa1('0x10')]);}logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0xc2ac6a,_0x234b36[_0x9aa1('0xf')]['message']);return _0x302408(_0x234b36[_0x9aa1('0xf')]['message']);}else{logger[_0x9aa1('0xb')](_0x9aa1('0xc'),_0xc2ac6a,_0x9aa1('0x11'));_0x302408(_0x234b36[_0x9aa1('0x12')]['message']);}})['catch'](function(_0x9c0a4f){logger[_0x9aa1('0xf')](_0x9aa1('0xc'),_0xc2ac6a,_0x9c0a4f);_0x55ba17(_0x9c0a4f);});});} \ No newline at end of file +var _0x56e6=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x1e4a8e,_0x18022b){var _0x5408f9=function(_0x4ef2ed){while(--_0x4ef2ed){_0x1e4a8e['push'](_0x1e4a8e['shift']());}};_0x5408f9(++_0x18022b);}(_0x56e6,0x6b));var _0x656e=function(_0x2920ea,_0x26eb8f){_0x2920ea=_0x2920ea-0x0;var _0x136de9=_0x56e6[_0x2920ea];return _0x136de9;};'use strict';var _=require(_0x656e('0x0'));var util=require(_0x656e('0x1'));var moment=require(_0x656e('0x2'));var BPromise=require(_0x656e('0x3'));var rs=require(_0x656e('0x4'));var fs=require('fs');var Redis=require(_0x656e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x656e('0x6'));var logger=require(_0x656e('0x7'))(_0x656e('0x8'));var config=require(_0x656e('0x9'));var jayson=require(_0x656e('0xa'));var client=jayson[_0x656e('0xb')][_0x656e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x54eddb,_0x35d629,_0x1538a5){return new BPromise(function(_0x1dad4e,_0x2fc011){return client[_0x656e('0xd')](_0x54eddb,_0x1538a5)[_0x656e('0xe')](function(_0x30d78c){logger[_0x656e('0xf')](_0x656e('0x10'),_0x35d629,_0x656e('0x11'));logger[_0x656e('0x12')](_0x656e('0x13'),_0x35d629,_0x656e('0x11'),JSON[_0x656e('0x14')](_0x30d78c));if(_0x30d78c['error']){if(_0x30d78c['error'][_0x656e('0x15')]===0x1f4){logger[_0x656e('0x16')](_0x656e('0x10'),_0x35d629,_0x30d78c[_0x656e('0x16')]['message']);return _0x2fc011(_0x30d78c['error'][_0x656e('0x17')]);}logger[_0x656e('0x16')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x35d629,_0x30d78c[_0x656e('0x16')]['message']);return _0x1dad4e(_0x30d78c[_0x656e('0x16')][_0x656e('0x17')]);}else{logger[_0x656e('0xf')](_0x656e('0x10'),_0x35d629,'request\x20sent');_0x1dad4e(_0x30d78c[_0x656e('0x18')][_0x656e('0x17')]);}})[_0x656e('0x19')](function(_0x3a6cf8){logger[_0x656e('0x16')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x35d629,_0x3a6cf8);_0x2fc011(_0x3a6cf8);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 4750017..bc43c80 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 _0x662c=['connect-timeout','express','Router','fs-extra','../../config/environment','./pause.controller','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','util','path'];(function(_0x6f0fb8,_0x41a278){var _0x98e20f=function(_0x35618c){while(--_0x35618c){_0x6f0fb8['push'](_0x6f0fb8['shift']());}};_0x98e20f(++_0x41a278);}(_0x662c,0x1e4));var _0xc662=function(_0x56a0d9,_0x43fdb0){_0x56a0d9=_0x56a0d9-0x0;var _0x5bf992=_0x662c[_0x56a0d9];return _0x5bf992;};'use strict';var multer=require('multer');var util=require(_0xc662('0x0'));var path=require(_0xc662('0x1'));var timeout=require(_0xc662('0x2'));var express=require(_0xc662('0x3'));var router=express[_0xc662('0x4')]();var fs_extra=require(_0xc662('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc662('0x6'));var controller=require(_0xc662('0x7'));router['get']('/',auth[_0xc662('0x8')](),controller[_0xc662('0x9')]);router['get'](_0xc662('0xa'),auth[_0xc662('0x8')](),controller[_0xc662('0xb')]);router[_0xc662('0xc')]('/',auth[_0xc662('0x8')](),controller[_0xc662('0xd')]);router['put'](_0xc662('0xa'),auth[_0xc662('0x8')](),controller[_0xc662('0xe')]);router[_0xc662('0xf')](_0xc662('0xa'),auth[_0xc662('0x8')](),controller[_0xc662('0x10')]);module[_0xc662('0x11')]=router; \ No newline at end of file +var _0x22be=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','update','destroy','exports','multer','util'];(function(_0x1c0bdd,_0x4cc6df){var _0x27c908=function(_0x4dfcad){while(--_0x4dfcad){_0x1c0bdd['push'](_0x1c0bdd['shift']());}};_0x27c908(++_0x4cc6df);}(_0x22be,0x185));var _0xe22b=function(_0x2c96f6,_0x877207){_0x2c96f6=_0x2c96f6-0x0;var _0x6d4808=_0x22be[_0x2c96f6];return _0x6d4808;};'use strict';var multer=require(_0xe22b('0x0'));var util=require(_0xe22b('0x1'));var path=require(_0xe22b('0x2'));var timeout=require(_0xe22b('0x3'));var express=require('express');var router=express[_0xe22b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe22b('0x5'));var interaction=require(_0xe22b('0x6'));var config=require('../../config/environment');var controller=require('./pause.controller');router[_0xe22b('0x7')]('/',auth[_0xe22b('0x8')](),controller[_0xe22b('0x9')]);router[_0xe22b('0x7')](_0xe22b('0xa'),auth['isAuthenticated'](),controller[_0xe22b('0xb')]);router[_0xe22b('0xc')]('/',auth[_0xe22b('0x8')](),controller[_0xe22b('0xd')]);router['put'](_0xe22b('0xa'),auth[_0xe22b('0x8')](),controller[_0xe22b('0xe')]);router['delete'](_0xe22b('0xa'),auth['isAuthenticated'](),controller[_0xe22b('0xf')]);module[_0xe22b('0x10')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index f107907..8132246 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 _0x5ce9=['sequelize','name'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0x5ce9,0x10e));var _0x95ce=function(_0x25507f,_0x57f1bb){_0x25507f=_0x25507f-0x0;var _0x1e051f=_0x5ce9[_0x25507f];return _0x1e051f;};'use strict';var Sequelize=require(_0x95ce('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x95ce('0x1'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6444=['name','STRING','exports'];(function(_0x5eb22e,_0x27cbac){var _0x27fed5=function(_0x565467){while(--_0x565467){_0x5eb22e['push'](_0x5eb22e['shift']());}};_0x27fed5(++_0x27cbac);}(_0x6444,0x9b));var _0x4644=function(_0x156515,_0x760da4){_0x156515=_0x156515-0x0;var _0x3e1e8b=_0x6444[_0x156515];return _0x3e1e8b;};'use strict';var Sequelize=require('sequelize');module[_0x4644('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x4644('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x4644('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index a349777..2cf2240 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 _0x5262=['body','user','role','Pauses','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','then','get','UserProfileResource','error','stack','name','send','index','map','Pause','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create'];(function(_0x305be7,_0x527c99){var _0x122e11=function(_0x24ab5a){while(--_0x24ab5a){_0x305be7['push'](_0x305be7['shift']());}};_0x122e11(++_0x527c99);}(_0x5262,0x1b7));var _0x2526=function(_0x385194,_0xe0a331){_0x385194=_0x385194-0x0;var _0x38298c=_0x5262[_0x385194];return _0x38298c;};'use strict';var emlformat=require(_0x2526('0x0'));var rimraf=require(_0x2526('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2526('0x2'));var rp=require(_0x2526('0x3'));var moment=require(_0x2526('0x4'));var BPromise=require(_0x2526('0x5'));var Mustache=require(_0x2526('0x6'));var util=require(_0x2526('0x7'));var path=require(_0x2526('0x8'));var sox=require(_0x2526('0x9'));var csv=require(_0x2526('0xa'));var ejs=require(_0x2526('0xb'));var fs=require('fs');var fs_extra=require(_0x2526('0xc'));var _=require('lodash');var squel=require(_0x2526('0xd'));var crypto=require(_0x2526('0xe'));var jsforce=require(_0x2526('0xf'));var deskjs=require(_0x2526('0x10'));var toCsv=require(_0x2526('0xa'));var querystring=require('querystring');var Papa=require(_0x2526('0x11'));var Redis=require(_0x2526('0x12'));var authService=require(_0x2526('0x13'));var qs=require(_0x2526('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2526('0x15'));var logger=require(_0x2526('0x16'))(_0x2526('0x17'));var utils=require('../../config/utils');var config=require(_0x2526('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x464100,_0x2a55fd){_0x2a55fd=_0x2a55fd||0xcc;return function(_0x240863){if(_0x240863){return _0x464100[_0x2526('0x19')](_0x2a55fd);}return _0x464100[_0x2526('0x1a')](_0x2a55fd)[_0x2526('0x1b')]();};}function respondWithResult(_0x3c4be1,_0x42c206){_0x42c206=_0x42c206||0xc8;return function(_0x550bf5){if(_0x550bf5){return _0x3c4be1[_0x2526('0x1a')](_0x42c206)[_0x2526('0x1c')](_0x550bf5);}};}function respondWithFilteredResult(_0x1b6473,_0x2aef48){return function(_0x5e8c89){if(_0x5e8c89){var _0x49de8b=typeof _0x2aef48['offset']===_0x2526('0x1d')&&typeof _0x2aef48[_0x2526('0x1e')]===_0x2526('0x1d');var _0x3796f2=_0x5e8c89[_0x2526('0x1f')];var _0x39bc11=_0x49de8b?0x0:_0x2aef48[_0x2526('0x20')];var _0x28a2fe=_0x49de8b?_0x5e8c89['count']:_0x2aef48[_0x2526('0x20')]+_0x2aef48[_0x2526('0x1e')];var _0x141cc5;if(_0x28a2fe>=_0x3796f2){_0x28a2fe=_0x3796f2;_0x141cc5=0xc8;}else{_0x141cc5=0xce;}_0x1b6473[_0x2526('0x1a')](_0x141cc5);return _0x1b6473[_0x2526('0x21')](_0x2526('0x22'),_0x39bc11+'-'+_0x28a2fe+'/'+_0x3796f2)[_0x2526('0x1c')](_0x5e8c89);}return null;};}function patchUpdates(_0x2e0683){return function(_0x39f25c){try{jsonpatch[_0x2526('0x23')](_0x39f25c,_0x2e0683,!![]);}catch(_0x5b5b07){return BPromise[_0x2526('0x24')](_0x5b5b07);}return _0x39f25c[_0x2526('0x25')]();};}function saveUpdates(_0x12f5e4,_0x4641bf){return function(_0x588d13){if(_0x588d13){return _0x588d13['update'](_0x12f5e4)['then'](function(_0x3f54cf){return _0x3f54cf;});}return null;};}function removeEntity(_0x16aebb,_0xde6149){return function(_0x2ac34f){if(_0x2ac34f){return _0x2ac34f[_0x2526('0x26')]()[_0x2526('0x27')](function(){var _0x58b03b=_0x2ac34f[_0x2526('0x28')]({'plain':!![]});var _0x42e0de='Pauses';return db[_0x2526('0x29')][_0x2526('0x26')]({'where':{'type':_0x42e0de,'resourceId':_0x58b03b['id']}})[_0x2526('0x27')](function(){return _0x2ac34f;});})[_0x2526('0x27')](function(){_0x16aebb[_0x2526('0x1a')](0xcc)[_0x2526('0x1b')]();});}};}function handleEntityNotFound(_0x49d98a,_0x4005a4){return function(_0x3afa26){if(!_0x3afa26){_0x49d98a['sendStatus'](0x194);}return _0x3afa26;};}function handleError(_0x39d0c2,_0x475eb3){_0x475eb3=_0x475eb3||0x1f4;return function(_0x2fa7af){logger[_0x2526('0x2a')](_0x2fa7af[_0x2526('0x2b')]);if(_0x2fa7af[_0x2526('0x2c')]){delete _0x2fa7af[_0x2526('0x2c')];}_0x39d0c2[_0x2526('0x1a')](_0x475eb3)[_0x2526('0x2d')](_0x2fa7af);};}exports[_0x2526('0x2e')]=function(_0x1fad6e,_0x213f0c){var _0x1a8b8e={},_0x13c473={},_0x1f24e7={'count':0x0,'rows':[]};var _0x536ff1=_[_0x2526('0x2f')](db[_0x2526('0x30')][_0x2526('0x31')],function(_0x13ac65){return{'name':_0x13ac65['fieldName'],'type':_0x13ac65[_0x2526('0x32')]['key']};});_0x13c473[_0x2526('0x33')]=_[_0x2526('0x2f')](_0x536ff1,_0x2526('0x2c'));_0x13c473[_0x2526('0x34')]=_[_0x2526('0x35')](_0x1fad6e[_0x2526('0x34')]);_0x13c473[_0x2526('0x36')]=_['intersection'](_0x13c473['model'],_0x13c473[_0x2526('0x34')]);_0x1a8b8e[_0x2526('0x37')]=_[_0x2526('0x38')](_0x13c473[_0x2526('0x33')],qs[_0x2526('0x39')](_0x1fad6e['query']['fields']));_0x1a8b8e[_0x2526('0x37')]=_0x1a8b8e[_0x2526('0x37')][_0x2526('0x3a')]?_0x1a8b8e[_0x2526('0x37')]:_0x13c473[_0x2526('0x33')];if(!_0x1fad6e['query'][_0x2526('0x3b')](_0x2526('0x3c'))){_0x1a8b8e[_0x2526('0x1e')]=qs[_0x2526('0x1e')](_0x1fad6e[_0x2526('0x34')]['limit']);_0x1a8b8e[_0x2526('0x20')]=qs[_0x2526('0x20')](_0x1fad6e[_0x2526('0x34')][_0x2526('0x20')]);}_0x1a8b8e[_0x2526('0x3d')]=qs['sort'](_0x1fad6e[_0x2526('0x34')][_0x2526('0x3e')]);_0x1a8b8e[_0x2526('0x3f')]=qs[_0x2526('0x36')](_[_0x2526('0x40')](_0x1fad6e[_0x2526('0x34')],_0x13c473['filters']),_0x536ff1);if(_0x1fad6e['query'][_0x2526('0x41')]){_0x1a8b8e['where']=_[_0x2526('0x42')](_0x1a8b8e[_0x2526('0x3f')],{'$or':_[_0x2526('0x2f')](_0x536ff1,function(_0x14b639){if(_0x14b639[_0x2526('0x32')]!=='VIRTUAL'){var _0x17b8be={};_0x17b8be[_0x14b639[_0x2526('0x2c')]]={'$like':'%'+_0x1fad6e[_0x2526('0x34')][_0x2526('0x41')]+'%'};return _0x17b8be;}})});}_0x1a8b8e=_[_0x2526('0x42')]({},_0x1a8b8e,_0x1fad6e[_0x2526('0x43')]);var _0x3c821d={'where':_0x1a8b8e[_0x2526('0x3f')]};return db[_0x2526('0x30')][_0x2526('0x1f')](_0x3c821d)[_0x2526('0x27')](function(_0x1a3916){_0x1f24e7['count']=_0x1a3916;if(_0x1fad6e[_0x2526('0x34')][_0x2526('0x44')]){_0x1a8b8e[_0x2526('0x45')]=[{'all':!![]}];}return db[_0x2526('0x30')][_0x2526('0x46')](_0x1a8b8e);})[_0x2526('0x27')](function(_0x9993ab){_0x1f24e7[_0x2526('0x47')]=_0x9993ab;return _0x1f24e7;})['then'](respondWithFilteredResult(_0x213f0c,_0x1a8b8e))[_0x2526('0x48')](handleError(_0x213f0c,null));};exports[_0x2526('0x49')]=function(_0x463e8f,_0x57967e){var _0x5b5f5d={'raw':!![],'where':{'id':_0x463e8f[_0x2526('0x4a')]['id']}},_0x456098={};_0x456098[_0x2526('0x33')]=_['keys'](db[_0x2526('0x30')]['rawAttributes']);_0x456098['query']=_[_0x2526('0x35')](_0x463e8f[_0x2526('0x34')]);_0x456098[_0x2526('0x36')]=_[_0x2526('0x38')](_0x456098[_0x2526('0x33')],_0x456098['query']);_0x5b5f5d['attributes']=_[_0x2526('0x38')](_0x456098[_0x2526('0x33')],qs[_0x2526('0x39')](_0x463e8f[_0x2526('0x34')][_0x2526('0x39')]));_0x5b5f5d[_0x2526('0x37')]=_0x5b5f5d[_0x2526('0x37')][_0x2526('0x3a')]?_0x5b5f5d[_0x2526('0x37')]:_0x456098[_0x2526('0x33')];if(_0x463e8f[_0x2526('0x34')][_0x2526('0x44')]){_0x5b5f5d[_0x2526('0x45')]=[{'all':!![]}];}_0x5b5f5d=_[_0x2526('0x42')]({},_0x5b5f5d,_0x463e8f[_0x2526('0x43')]);return db['Pause'][_0x2526('0x4b')](_0x5b5f5d)[_0x2526('0x27')](handleEntityNotFound(_0x57967e,null))[_0x2526('0x27')](respondWithResult(_0x57967e,null))[_0x2526('0x48')](handleError(_0x57967e,null));};exports['create']=function(_0x362a5b,_0x21e789){return db[_0x2526('0x30')][_0x2526('0x4c')](_0x362a5b[_0x2526('0x4d')],{})[_0x2526('0x27')](function(_0x244939){var _0x371dee=_0x362a5b[_0x2526('0x4e')][_0x2526('0x28')]({'plain':!![]});if(!_0x371dee)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x371dee[_0x2526('0x4f')]==='user'){var _0x2c7d4e=_0x244939[_0x2526('0x28')]({'plain':!![]});var _0x1dac55=_0x2526('0x50');return db[_0x2526('0x51')][_0x2526('0x4b')]({'where':{'name':_0x1dac55,'userProfileId':_0x371dee[_0x2526('0x52')]},'raw':!![]})['then'](function(_0x43d28a){if(_0x43d28a&&_0x43d28a[_0x2526('0x53')]===0x0){return db['UserProfileResource'][_0x2526('0x4c')]({'name':_0x2c7d4e['name'],'resourceId':_0x2c7d4e['id'],'type':_0x43d28a['name'],'sectionId':_0x43d28a['id']},{})[_0x2526('0x27')](function(){return _0x244939;});}else{return _0x244939;}})[_0x2526('0x48')](function(_0x43e567){logger[_0x2526('0x2a')](_0x2526('0x54'),_0x43e567);throw _0x43e567;});}return _0x244939;})[_0x2526('0x27')](respondWithResult(_0x21e789,0xc9))[_0x2526('0x48')](handleError(_0x21e789,null));};exports[_0x2526('0x55')]=function(_0x308e9a,_0x34e709){if(_0x308e9a[_0x2526('0x4d')]['id']){delete _0x308e9a[_0x2526('0x4d')]['id'];}return db[_0x2526('0x30')][_0x2526('0x4b')]({'where':{'id':_0x308e9a[_0x2526('0x4a')]['id']}})[_0x2526('0x27')](handleEntityNotFound(_0x34e709,null))[_0x2526('0x27')](saveUpdates(_0x308e9a[_0x2526('0x4d')],null))[_0x2526('0x27')](respondWithResult(_0x34e709,null))[_0x2526('0x48')](handleError(_0x34e709,null));};exports[_0x2526('0x26')]=function(_0x565e92,_0x83623f){return db[_0x2526('0x30')][_0x2526('0x4b')]({'where':{'id':_0x565e92[_0x2526('0x4a')]['id']}})[_0x2526('0x27')](handleEntityNotFound(_0x83623f,null))[_0x2526('0x27')](removeEntity(_0x83623f,null))[_0x2526('0x48')](handleError(_0x83623f,null));}; \ No newline at end of file +var _0xd900=['fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','update','then','destroy','get','Pauses','UserProfileResource','error','stack','name','send','index','map','Pause','rawAttributes','type','key','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','length','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','fast-json-patch','moment','mustache','path','sox','to-csv','ejs'];(function(_0x331e28,_0x163e3c){var _0x42abb8=function(_0x2bdc7f){while(--_0x2bdc7f){_0x331e28['push'](_0x331e28['shift']());}};_0x42abb8(++_0x163e3c);}(_0xd900,0xf4));var _0x0d90=function(_0x55d829,_0x43f06c){_0x55d829=_0x55d829-0x0;var _0x52163b=_0xd900[_0x55d829];return _0x52163b;};'use strict';var emlformat=require(_0x0d90('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0d90('0x1'));var rp=require('request-promise');var moment=require(_0x0d90('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x0d90('0x3'));var util=require('util');var path=require(_0x0d90('0x4'));var sox=require(_0x0d90('0x5'));var csv=require(_0x0d90('0x6'));var ejs=require(_0x0d90('0x7'));var fs=require('fs');var fs_extra=require(_0x0d90('0x8'));var _=require(_0x0d90('0x9'));var squel=require(_0x0d90('0xa'));var crypto=require(_0x0d90('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0d90('0xc'));var toCsv=require(_0x0d90('0x6'));var querystring=require('querystring');var Papa=require(_0x0d90('0xd'));var Redis=require(_0x0d90('0xe'));var authService=require(_0x0d90('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x0d90('0x10'));var hardwareService=require(_0x0d90('0x11'));var logger=require(_0x0d90('0x12'))(_0x0d90('0x13'));var utils=require(_0x0d90('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x0d90('0x15'));var db=require(_0x0d90('0x16'))['db'];function respondWithStatusCode(_0x5e2dd6,_0x1eb4d3){_0x1eb4d3=_0x1eb4d3||0xcc;return function(_0x5049c4){if(_0x5049c4){return _0x5e2dd6[_0x0d90('0x17')](_0x1eb4d3);}return _0x5e2dd6[_0x0d90('0x18')](_0x1eb4d3)[_0x0d90('0x19')]();};}function respondWithResult(_0x5bc432,_0x1c5267){_0x1c5267=_0x1c5267||0xc8;return function(_0x2d5e1c){if(_0x2d5e1c){return _0x5bc432[_0x0d90('0x18')](_0x1c5267)[_0x0d90('0x1a')](_0x2d5e1c);}};}function respondWithFilteredResult(_0x3d7dcb,_0x8fbd47){return function(_0x35afd5){if(_0x35afd5){var _0x59e104=typeof _0x8fbd47[_0x0d90('0x1b')]===_0x0d90('0x1c')&&typeof _0x8fbd47[_0x0d90('0x1d')]===_0x0d90('0x1c');var _0x59f336=_0x35afd5[_0x0d90('0x1e')];var _0x33d95b=_0x59e104?0x0:_0x8fbd47['offset'];var _0x36e4d5=_0x59e104?_0x35afd5[_0x0d90('0x1e')]:_0x8fbd47['offset']+_0x8fbd47['limit'];var _0xb2b837;if(_0x36e4d5>=_0x59f336){_0x36e4d5=_0x59f336;_0xb2b837=0xc8;}else{_0xb2b837=0xce;}_0x3d7dcb[_0x0d90('0x18')](_0xb2b837);return _0x3d7dcb[_0x0d90('0x1f')]('Content-Range',_0x33d95b+'-'+_0x36e4d5+'/'+_0x59f336)['json'](_0x35afd5);}return null;};}function patchUpdates(_0x31c8ef){return function(_0x300335){try{jsonpatch['apply'](_0x300335,_0x31c8ef,!![]);}catch(_0x5a9dcb){return BPromise[_0x0d90('0x20')](_0x5a9dcb);}return _0x300335['save']();};}function saveUpdates(_0x1f681c,_0x53baa8){return function(_0x4ff08a){if(_0x4ff08a){return _0x4ff08a[_0x0d90('0x21')](_0x1f681c)[_0x0d90('0x22')](function(_0x336d05){return _0x336d05;});}return null;};}function removeEntity(_0x418214,_0x266078){return function(_0x57e9b0){if(_0x57e9b0){return _0x57e9b0[_0x0d90('0x23')]()[_0x0d90('0x22')](function(){var _0x384883=_0x57e9b0[_0x0d90('0x24')]({'plain':!![]});var _0x365a5c=_0x0d90('0x25');return db[_0x0d90('0x26')][_0x0d90('0x23')]({'where':{'type':_0x365a5c,'resourceId':_0x384883['id']}})['then'](function(){return _0x57e9b0;});})[_0x0d90('0x22')](function(){_0x418214[_0x0d90('0x18')](0xcc)[_0x0d90('0x19')]();});}};}function handleEntityNotFound(_0x1ad391,_0x204320){return function(_0x472753){if(!_0x472753){_0x1ad391['sendStatus'](0x194);}return _0x472753;};}function handleError(_0x4593f3,_0x142a0c){_0x142a0c=_0x142a0c||0x1f4;return function(_0x1dfed2){logger[_0x0d90('0x27')](_0x1dfed2[_0x0d90('0x28')]);if(_0x1dfed2['name']){delete _0x1dfed2[_0x0d90('0x29')];}_0x4593f3[_0x0d90('0x18')](_0x142a0c)[_0x0d90('0x2a')](_0x1dfed2);};}exports[_0x0d90('0x2b')]=function(_0x47bb40,_0x247e54){var _0x2a5cbc={},_0x3d72e4={},_0x465cf7={'count':0x0,'rows':[]};var _0x5df342=_[_0x0d90('0x2c')](db[_0x0d90('0x2d')][_0x0d90('0x2e')],function(_0x1e06b3){return{'name':_0x1e06b3['fieldName'],'type':_0x1e06b3[_0x0d90('0x2f')][_0x0d90('0x30')]};});_0x3d72e4[_0x0d90('0x31')]=_[_0x0d90('0x2c')](_0x5df342,_0x0d90('0x29'));_0x3d72e4['query']=_[_0x0d90('0x32')](_0x47bb40[_0x0d90('0x33')]);_0x3d72e4['filters']=_[_0x0d90('0x34')](_0x3d72e4[_0x0d90('0x31')],_0x3d72e4['query']);_0x2a5cbc['attributes']=_[_0x0d90('0x34')](_0x3d72e4[_0x0d90('0x31')],qs[_0x0d90('0x35')](_0x47bb40[_0x0d90('0x33')]['fields']));_0x2a5cbc[_0x0d90('0x36')]=_0x2a5cbc[_0x0d90('0x36')]['length']?_0x2a5cbc[_0x0d90('0x36')]:_0x3d72e4['model'];if(!_0x47bb40[_0x0d90('0x33')][_0x0d90('0x37')](_0x0d90('0x38'))){_0x2a5cbc[_0x0d90('0x1d')]=qs[_0x0d90('0x1d')](_0x47bb40[_0x0d90('0x33')][_0x0d90('0x1d')]);_0x2a5cbc['offset']=qs['offset'](_0x47bb40[_0x0d90('0x33')][_0x0d90('0x1b')]);}_0x2a5cbc[_0x0d90('0x39')]=qs[_0x0d90('0x3a')](_0x47bb40[_0x0d90('0x33')][_0x0d90('0x3a')]);_0x2a5cbc[_0x0d90('0x3b')]=qs[_0x0d90('0x3c')](_[_0x0d90('0x3d')](_0x47bb40[_0x0d90('0x33')],_0x3d72e4[_0x0d90('0x3c')]),_0x5df342);if(_0x47bb40['query'][_0x0d90('0x3e')]){_0x2a5cbc[_0x0d90('0x3b')]=_[_0x0d90('0x3f')](_0x2a5cbc[_0x0d90('0x3b')],{'$or':_['map'](_0x5df342,function(_0x2752d4){if(_0x2752d4[_0x0d90('0x2f')]!==_0x0d90('0x40')){var _0x17c03d={};_0x17c03d[_0x2752d4['name']]={'$like':'%'+_0x47bb40[_0x0d90('0x33')][_0x0d90('0x3e')]+'%'};return _0x17c03d;}})});}_0x2a5cbc=_[_0x0d90('0x3f')]({},_0x2a5cbc,_0x47bb40[_0x0d90('0x41')]);var _0x3c2729={'where':_0x2a5cbc[_0x0d90('0x3b')]};return db[_0x0d90('0x2d')][_0x0d90('0x1e')](_0x3c2729)[_0x0d90('0x22')](function(_0x441131){_0x465cf7[_0x0d90('0x1e')]=_0x441131;if(_0x47bb40[_0x0d90('0x33')][_0x0d90('0x42')]){_0x2a5cbc[_0x0d90('0x43')]=[{'all':!![]}];}return db['Pause'][_0x0d90('0x44')](_0x2a5cbc);})[_0x0d90('0x22')](function(_0x58d002){_0x465cf7[_0x0d90('0x45')]=_0x58d002;return _0x465cf7;})[_0x0d90('0x22')](respondWithFilteredResult(_0x247e54,_0x2a5cbc))['catch'](handleError(_0x247e54,null));};exports[_0x0d90('0x46')]=function(_0x2d2831,_0x2fbdcd){var _0x143ebd={'raw':!![],'where':{'id':_0x2d2831['params']['id']}},_0x5f12e6={};_0x5f12e6[_0x0d90('0x31')]=_[_0x0d90('0x32')](db['Pause']['rawAttributes']);_0x5f12e6[_0x0d90('0x33')]=_[_0x0d90('0x32')](_0x2d2831['query']);_0x5f12e6[_0x0d90('0x3c')]=_[_0x0d90('0x34')](_0x5f12e6['model'],_0x5f12e6['query']);_0x143ebd[_0x0d90('0x36')]=_[_0x0d90('0x34')](_0x5f12e6['model'],qs[_0x0d90('0x35')](_0x2d2831[_0x0d90('0x33')][_0x0d90('0x35')]));_0x143ebd[_0x0d90('0x36')]=_0x143ebd[_0x0d90('0x36')][_0x0d90('0x47')]?_0x143ebd[_0x0d90('0x36')]:_0x5f12e6[_0x0d90('0x31')];if(_0x2d2831[_0x0d90('0x33')][_0x0d90('0x42')]){_0x143ebd[_0x0d90('0x43')]=[{'all':!![]}];}_0x143ebd=_[_0x0d90('0x3f')]({},_0x143ebd,_0x2d2831[_0x0d90('0x41')]);return db[_0x0d90('0x2d')][_0x0d90('0x48')](_0x143ebd)[_0x0d90('0x22')](handleEntityNotFound(_0x2fbdcd,null))[_0x0d90('0x22')](respondWithResult(_0x2fbdcd,null))[_0x0d90('0x49')](handleError(_0x2fbdcd,null));};exports[_0x0d90('0x4a')]=function(_0x507af7,_0x1b9ffb){return db[_0x0d90('0x2d')]['create'](_0x507af7[_0x0d90('0x4b')],{})[_0x0d90('0x22')](function(_0x521531){var _0x5485fb=_0x507af7[_0x0d90('0x4c')][_0x0d90('0x24')]({'plain':!![]});if(!_0x5485fb)throw new Error(_0x0d90('0x4d'));if(_0x5485fb[_0x0d90('0x4e')]===_0x0d90('0x4c')){var _0x5450f5=_0x521531[_0x0d90('0x24')]({'plain':!![]});var _0x41c37e='Pauses';return db[_0x0d90('0x4f')][_0x0d90('0x48')]({'where':{'name':_0x41c37e,'userProfileId':_0x5485fb[_0x0d90('0x50')]},'raw':!![]})[_0x0d90('0x22')](function(_0x99846d){if(_0x99846d&&_0x99846d[_0x0d90('0x51')]===0x0){return db[_0x0d90('0x26')][_0x0d90('0x4a')]({'name':_0x5450f5['name'],'resourceId':_0x5450f5['id'],'type':_0x99846d[_0x0d90('0x29')],'sectionId':_0x99846d['id']},{})[_0x0d90('0x22')](function(){return _0x521531;});}else{return _0x521531;}})[_0x0d90('0x49')](function(_0x56682c){logger[_0x0d90('0x27')](_0x0d90('0x52'),_0x56682c);throw _0x56682c;});}return _0x521531;})[_0x0d90('0x22')](respondWithResult(_0x1b9ffb,0xc9))['catch'](handleError(_0x1b9ffb,null));};exports[_0x0d90('0x21')]=function(_0x583f2e,_0xfbeb26){if(_0x583f2e[_0x0d90('0x4b')]['id']){delete _0x583f2e[_0x0d90('0x4b')]['id'];}return db[_0x0d90('0x2d')][_0x0d90('0x48')]({'where':{'id':_0x583f2e[_0x0d90('0x53')]['id']}})[_0x0d90('0x22')](handleEntityNotFound(_0xfbeb26,null))[_0x0d90('0x22')](saveUpdates(_0x583f2e[_0x0d90('0x4b')],null))['then'](respondWithResult(_0xfbeb26,null))[_0x0d90('0x49')](handleError(_0xfbeb26,null));};exports[_0x0d90('0x23')]=function(_0x3dd565,_0x480cf0){return db[_0x0d90('0x2d')]['find']({'where':{'id':_0x3dd565[_0x0d90('0x53')]['id']}})[_0x0d90('0x22')](handleEntityNotFound(_0x480cf0,null))[_0x0d90('0x22')](removeEntity(_0x480cf0,null))['catch'](handleError(_0x480cf0,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 2486ecb..39dc351 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 _0x5fc3=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./pause.attributes','exports','define','tools_pauses'];(function(_0x1ae708,_0x1d194f){var _0x21ffa6=function(_0xdcbd7f){while(--_0xdcbd7f){_0x1ae708['push'](_0x1ae708['shift']());}};_0x21ffa6(++_0x1d194f);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5235dd,_0x3f91cf){_0x5235dd=_0x5235dd-0x0;var _0x13059d=_0x5fc3[_0x5235dd];return _0x13059d;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('Pause',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Pause','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./pause.attributes'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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':'tools_pauses','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 5589caa..b56d800 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x331d21,_0x2b28fc){var _0x1680db=function(_0x5b1ff0){while(--_0x5b1ff0){_0x331d21['push'](_0x331d21['shift']());}};_0x1680db(++_0x2b28fc);}(_0xb10b,0x12a));var _0xbb10=function(_0x3e3819,_0x562054){_0x3e3819=_0x3e3819-0x0;var _0x148457=_0xb10b[_0x3e3819];return _0x148457;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x18c8f5,_0x4f41bb){var _0x257ff1=function(_0x5df1dc){while(--_0x5df1dc){_0x18c8f5['push'](_0x18c8f5['shift']());}};_0x257ff1(++_0x4f41bb);}(_0xb10b,0x12a));var _0xbb10=function(_0x236c67,_0x28b77e){_0x236c67=_0x236c67-0x0;var _0x19e4fb=_0xb10b[_0x236c67];return _0x19e4fb;};'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 09d683d..a72d39b 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 _0xec56=['isAuthenticated','index','/webhook','webhookGet','/:id','show','download','diskStorage','join','server/files/plugins','originalname','replace','format','basename','extname','now','single','file','upload','post','webhookPost','put','update','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get'];(function(_0x40abb4,_0x194d45){var _0x36c942=function(_0x4219a2){while(--_0x4219a2){_0x40abb4['push'](_0x40abb4['shift']());}};_0x36c942(++_0x194d45);}(_0xec56,0x1bd));var _0x6ec5=function(_0x5699c1,_0x1ea7b3){_0x5699c1=_0x5699c1-0x0;var _0x3a35f7=_0xec56[_0x5699c1];return _0x3a35f7;};'use strict';var multer=require(_0x6ec5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6ec5('0x1'));var express=require(_0x6ec5('0x2'));var router=express[_0x6ec5('0x3')]();var fs_extra=require(_0x6ec5('0x4'));var auth=require(_0x6ec5('0x5'));var interaction=require(_0x6ec5('0x6'));var config=require(_0x6ec5('0x7'));var controller=require(_0x6ec5('0x8'));router[_0x6ec5('0x9')]('/',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xb')]);router[_0x6ec5('0x9')](_0x6ec5('0xc'),controller[_0x6ec5('0xd')]);router[_0x6ec5('0x9')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xf')]);router[_0x6ec5('0x9')]('/:id/download',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x10')]);var upload=multer({'storage':multer[_0x6ec5('0x11')]({'destination':function(_0x1964ae,_0x143b09,_0x181e79){_0x181e79(null,path[_0x6ec5('0x12')](config['root'],_0x6ec5('0x13')));},'filename':function(_0x1d7180,_0x2b1f61,_0xb04ab6){_0x2b1f61[_0x6ec5('0x14')]=_0x2b1f61[_0x6ec5('0x14')][_0x6ec5('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xb04ab6(null,util[_0x6ec5('0x16')]('%s-%s%s',path[_0x6ec5('0x17')](_0x2b1f61['originalname'],path[_0x6ec5('0x18')](_0x2b1f61[_0x6ec5('0x14')])),Date[_0x6ec5('0x19')](),path[_0x6ec5('0x18')](_0x2b1f61[_0x6ec5('0x14')])));}})});router['post']('/',upload[_0x6ec5('0x1a')](_0x6ec5('0x1b')),controller[_0x6ec5('0x1c')]);router[_0x6ec5('0x1d')](_0x6ec5('0xc'),controller[_0x6ec5('0x1e')]);router[_0x6ec5('0x1f')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x20')]);router[_0x6ec5('0x21')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x21')]);module[_0x6ec5('0x22')]=router; \ No newline at end of file +var _0xb66c=['/:id','show','/:id/download','isAuthenticated','download','join','server/files/plugins','originalname','replace','format','%s-%s%s','extname','single','file','upload','post','webhookPost','put','update','delete','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./plugin.controller','get','/webhook','webhookGet'];(function(_0x3b8f97,_0x18771){var _0x36667d=function(_0x22f7ea){while(--_0x22f7ea){_0x3b8f97['push'](_0x3b8f97['shift']());}};_0x36667d(++_0x18771);}(_0xb66c,0x175));var _0xcb66=function(_0x5034d4,_0x4e64f1){_0x5034d4=_0x5034d4-0x0;var _0x246be5=_0xb66c[_0x5034d4];return _0x246be5;};'use strict';var multer=require(_0xcb66('0x0'));var util=require('util');var path=require(_0xcb66('0x1'));var timeout=require('connect-timeout');var express=require(_0xcb66('0x2'));var router=express[_0xcb66('0x3')]();var fs_extra=require(_0xcb66('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcb66('0x5'));var config=require(_0xcb66('0x6'));var controller=require(_0xcb66('0x7'));router[_0xcb66('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xcb66('0x8')](_0xcb66('0x9'),controller[_0xcb66('0xa')]);router[_0xcb66('0x8')](_0xcb66('0xb'),auth['isAuthenticated'](),controller[_0xcb66('0xc')]);router[_0xcb66('0x8')](_0xcb66('0xd'),auth[_0xcb66('0xe')](),controller[_0xcb66('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x393bde,_0x2b32ec,_0xf12828){_0xf12828(null,path[_0xcb66('0x10')](config['root'],_0xcb66('0x11')));},'filename':function(_0x3471f3,_0x4105d2,_0x2339bb){_0x4105d2['originalname']=_0x4105d2[_0xcb66('0x12')][_0xcb66('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2339bb(null,util[_0xcb66('0x14')](_0xcb66('0x15'),path['basename'](_0x4105d2[_0xcb66('0x12')],path['extname'](_0x4105d2[_0xcb66('0x12')])),Date['now'](),path[_0xcb66('0x16')](_0x4105d2['originalname'])));}})});router['post']('/',upload[_0xcb66('0x17')](_0xcb66('0x18')),controller[_0xcb66('0x19')]);router[_0xcb66('0x1a')]('/webhook',controller[_0xcb66('0x1b')]);router[_0xcb66('0x1c')](_0xcb66('0xb'),auth['isAuthenticated'](),controller[_0xcb66('0x1d')]);router['delete'](_0xcb66('0xb'),auth[_0xcb66('0xe')](),controller[_0xcb66('0x1e')]);module[_0xcb66('0x1f')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index d9d646f..2eddce7 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 _0x45e9=['BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','exports','ENUM','html','script','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'];(function(_0xd29c88,_0x141c80){var _0x375635=function(_0x54adc9){while(--_0x54adc9){_0xd29c88['push'](_0xd29c88['shift']());}};_0x375635(++_0x141c80);}(_0x45e9,0x85));var _0x945e=function(_0x53738a,_0x4e5e81){_0x53738a=_0x53738a-0x0;var _0x31be59=_0x45e9[_0x53738a];return _0x31be59;};'use strict';var Sequelize=require('sequelize');module[_0x945e('0x0')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x945e('0x1')](_0x945e('0x2'),_0x945e('0x3'))},'description':{'type':Sequelize[_0x945e('0x4')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x945e('0x5')],'comment':_0x945e('0x6')},'active':{'type':Sequelize[_0x945e('0x7')],'defaultValue':0x0,'comment':_0x945e('0x8')},'sidebar':{'type':Sequelize['ENUM'](_0x945e('0x9'),_0x945e('0xa'),_0x945e('0xb'),_0x945e('0xc')),'defaultValue':'always','comment':_0x945e('0xd')},'icon':{'type':Sequelize[_0x945e('0x5')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x945e('0x5')]},'scriptName':{'type':Sequelize[_0x945e('0x5')]},'scriptPath':{'type':Sequelize[_0x945e('0x5')]}}; \ No newline at end of file +var _0xb7fb=['adminOnly','agentOnly','always','never','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.'];(function(_0x14c026,_0x3ed32f){var _0xe3b079=function(_0x1e3b26){while(--_0x1e3b26){_0x14c026['push'](_0x14c026['shift']());}};_0xe3b079(++_0x3ed32f);}(_0xb7fb,0x1cc));var _0xbb7f=function(_0x4d8167,_0x48fbdb){_0x4d8167=_0x4d8167-0x0;var _0x3d5a36=_0xb7fb[_0x4d8167];return _0x3d5a36;};'use strict';var Sequelize=require(_0xbb7f('0x0'));module[_0xbb7f('0x1')]={'name':{'type':Sequelize[_0xbb7f('0x2')]},'type':{'type':Sequelize[_0xbb7f('0x3')](_0xbb7f('0x4'),'script')},'description':{'type':Sequelize[_0xbb7f('0x5')]},'version':{'type':Sequelize[_0xbb7f('0x5')]},'path':{'type':Sequelize[_0xbb7f('0x2')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0xbb7f('0x6')],'defaultValue':0x0,'comment':_0xbb7f('0x7')},'sidebar':{'type':Sequelize[_0xbb7f('0x3')](_0xbb7f('0x8'),_0xbb7f('0x9'),_0xbb7f('0xa'),_0xbb7f('0xb')),'defaultValue':_0xbb7f('0xa'),'comment':_0xbb7f('0xc')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0xbb7f('0x2')]},'agentUrl':{'type':Sequelize[_0xbb7f('0x2')]},'scriptName':{'type':Sequelize[_0xbb7f('0x2')]},'scriptPath':{'type':Sequelize[_0xbb7f('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index c1af9b4..561de74 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 _0xdde1=['Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','parse','Invalid\x20manifest:\x20name\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','admin','agent','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','script','scriptPath','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','dirname','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','http://localhost:','encoding','headers','content-length','content-type','statusCode','webhookPost','%s%s','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','rimraf','archiver','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','Plugins','UserProfileResource','end','error','name','send','index','Plugin','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','where','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','find','download','join','format','basename','path','createWriteStream','zip','warning','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','server/files/plugins','attachments/**/*','finalize','Plugin\x20not\x20found','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','upload','file','extname','filename','root'];(function(_0x1b6e7b,_0x3f4b9e){var _0x396859=function(_0x407a2b){while(--_0x407a2b){_0x1b6e7b['push'](_0x1b6e7b['shift']());}};_0x396859(++_0x3f4b9e);}(_0xdde1,0x186));var _0x1dde=function(_0x31f308,_0x3db808){_0x31f308=_0x31f308-0x0;var _0x24faed=_0xdde1[_0x31f308];return _0x24faed;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1dde('0x0'));var rp=require(_0x1dde('0x1'));var moment=require(_0x1dde('0x2'));var BPromise=require(_0x1dde('0x3'));var Mustache=require(_0x1dde('0x4'));var util=require(_0x1dde('0x5'));var path=require('path');var sox=require(_0x1dde('0x6'));var csv=require(_0x1dde('0x7'));var ejs=require(_0x1dde('0x8'));var fs=require('fs');var fs_extra=require(_0x1dde('0x9'));var _=require(_0x1dde('0xa'));var squel=require(_0x1dde('0xb'));var crypto=require('crypto');var jsforce=require(_0x1dde('0xc'));var deskjs=require(_0x1dde('0xd'));var toCsv=require(_0x1dde('0x7'));var querystring=require(_0x1dde('0xe'));var Papa=require(_0x1dde('0xf'));var extract=require('extract-zip');var rimraf=require(_0x1dde('0x10'));var archiver=require(_0x1dde('0x11'));var Redis=require(_0x1dde('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1dde('0x13'));var as=require(_0x1dde('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1dde('0x15'))('api');var utils=require(_0x1dde('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1dde('0x17'));var db=require(_0x1dde('0x18'))['db'];config[_0x1dde('0x19')]=_['defaults'](config[_0x1dde('0x19')],{'host':_0x1dde('0x1a'),'port':0x18eb});var socket=require(_0x1dde('0x1b'))(new Redis(config[_0x1dde('0x19')]));require('./plugin.socket')[_0x1dde('0x1c')](socket);function respondWithStatusCode(_0x21d715,_0x30044c){_0x30044c=_0x30044c||0xcc;return function(_0x36bb9a){if(_0x36bb9a){return _0x21d715[_0x1dde('0x1d')](_0x30044c);}return _0x21d715[_0x1dde('0x1e')](_0x30044c)['end']();};}function respondWithResult(_0x2084bb,_0x77c272){_0x77c272=_0x77c272||0xc8;return function(_0x36661a){if(_0x36661a){return _0x2084bb['status'](_0x77c272)[_0x1dde('0x1f')](_0x36661a);}};}function respondWithFilteredResult(_0x1612ef,_0x4b00ce){return function(_0x193fea){if(_0x193fea){var _0x12eb90=typeof _0x4b00ce[_0x1dde('0x20')]===_0x1dde('0x21')&&typeof _0x4b00ce[_0x1dde('0x22')]==='undefined';var _0x46acea=_0x193fea[_0x1dde('0x23')];var _0x45efb2=_0x12eb90?0x0:_0x4b00ce[_0x1dde('0x20')];var _0x32094d=_0x12eb90?_0x193fea['count']:_0x4b00ce[_0x1dde('0x20')]+_0x4b00ce['limit'];var _0x504ae6;if(_0x32094d>=_0x46acea){_0x32094d=_0x46acea;_0x504ae6=0xc8;}else{_0x504ae6=0xce;}_0x1612ef[_0x1dde('0x1e')](_0x504ae6);return _0x1612ef[_0x1dde('0x24')](_0x1dde('0x25'),_0x45efb2+'-'+_0x32094d+'/'+_0x46acea)[_0x1dde('0x1f')](_0x193fea);}return null;};}function patchUpdates(_0x413bcc){return function(_0x3d3afc){try{jsonpatch[_0x1dde('0x26')](_0x3d3afc,_0x413bcc,!![]);}catch(_0x320094){return BPromise['reject'](_0x320094);}return _0x3d3afc[_0x1dde('0x27')]();};}function saveUpdates(_0x1cedcb,_0x57de15){return function(_0x11f4d7){if(_0x11f4d7){return _0x11f4d7[_0x1dde('0x28')](_0x1cedcb)[_0x1dde('0x29')](function(_0x4d8de5){return _0x4d8de5;});}return null;};}function removeEntity(_0x476ce5,_0x28cad5){return function(_0x52c6b3){if(_0x52c6b3){return _0x52c6b3[_0x1dde('0x2a')]()[_0x1dde('0x29')](function(){var _0x41d3b4=_0x52c6b3['get']({'plain':!![]});var _0x109426=_0x1dde('0x2b');return db[_0x1dde('0x2c')][_0x1dde('0x2a')]({'where':{'type':_0x109426,'resourceId':_0x41d3b4['id']}})[_0x1dde('0x29')](function(){return _0x52c6b3;});})[_0x1dde('0x29')](function(){_0x476ce5[_0x1dde('0x1e')](0xcc)[_0x1dde('0x2d')]();});}};}function handleEntityNotFound(_0x2f8a76,_0xf1203f){return function(_0x4bfd3e){if(!_0x4bfd3e){_0x2f8a76[_0x1dde('0x1d')](0x194);}return _0x4bfd3e;};}function handleError(_0x4a84c1,_0x341250){_0x341250=_0x341250||0x1f4;return function(_0x29bbd1){logger[_0x1dde('0x2e')](_0x29bbd1['stack']);if(_0x29bbd1[_0x1dde('0x2f')]){delete _0x29bbd1[_0x1dde('0x2f')];}_0x4a84c1[_0x1dde('0x1e')](_0x341250)[_0x1dde('0x30')](_0x29bbd1);};}exports[_0x1dde('0x31')]=function(_0x1892d3,_0x1f7d9a){var _0x122a3b={},_0x172a7a={},_0x21d674={'count':0x0,'rows':[]};var _0x48c61d=_['map'](db[_0x1dde('0x32')][_0x1dde('0x33')],function(_0x549671){return{'name':_0x549671[_0x1dde('0x34')],'type':_0x549671[_0x1dde('0x35')][_0x1dde('0x36')]};});_0x172a7a[_0x1dde('0x37')]=_['map'](_0x48c61d,_0x1dde('0x2f'));_0x172a7a[_0x1dde('0x38')]=_[_0x1dde('0x39')](_0x1892d3[_0x1dde('0x38')]);_0x172a7a[_0x1dde('0x3a')]=_['intersection'](_0x172a7a[_0x1dde('0x37')],_0x172a7a['query']);_0x122a3b[_0x1dde('0x3b')]=_[_0x1dde('0x3c')](_0x172a7a[_0x1dde('0x37')],qs[_0x1dde('0x3d')](_0x1892d3[_0x1dde('0x38')][_0x1dde('0x3d')]));_0x122a3b[_0x1dde('0x3b')]=_0x122a3b[_0x1dde('0x3b')][_0x1dde('0x3e')]?_0x122a3b[_0x1dde('0x3b')]:_0x172a7a[_0x1dde('0x37')];if(!_0x1892d3['query']['hasOwnProperty'](_0x1dde('0x3f'))){_0x122a3b[_0x1dde('0x22')]=qs[_0x1dde('0x22')](_0x1892d3[_0x1dde('0x38')]['limit']);_0x122a3b[_0x1dde('0x20')]=qs['offset'](_0x1892d3[_0x1dde('0x38')]['offset']);}_0x122a3b[_0x1dde('0x40')]=qs[_0x1dde('0x41')](_0x1892d3['query'][_0x1dde('0x41')]);_0x122a3b['where']=qs[_0x1dde('0x3a')](_[_0x1dde('0x42')](_0x1892d3[_0x1dde('0x38')],_0x172a7a[_0x1dde('0x3a')]),_0x48c61d);if(_0x1892d3[_0x1dde('0x38')]['filter']){_0x122a3b[_0x1dde('0x43')]=_[_0x1dde('0x44')](_0x122a3b['where'],{'$or':_[_0x1dde('0x45')](_0x48c61d,function(_0x14ed60){if(_0x14ed60[_0x1dde('0x35')]!==_0x1dde('0x46')){var _0x516ab4={};_0x516ab4[_0x14ed60[_0x1dde('0x2f')]]={'$like':'%'+_0x1892d3[_0x1dde('0x38')][_0x1dde('0x47')]+'%'};return _0x516ab4;}})});}_0x122a3b=_[_0x1dde('0x44')]({},_0x122a3b,_0x1892d3[_0x1dde('0x48')]);var _0x14b4fa={'where':_0x122a3b['where']};return db['Plugin'][_0x1dde('0x23')](_0x14b4fa)['then'](function(_0x300b28){_0x21d674[_0x1dde('0x23')]=_0x300b28;if(_0x1892d3['query'][_0x1dde('0x49')]){_0x122a3b[_0x1dde('0x4a')]=[{'all':!![]}];}return db[_0x1dde('0x32')][_0x1dde('0x4b')](_0x122a3b);})['then'](function(_0x8641db){_0x21d674['rows']=_0x8641db;return _0x21d674;})['then'](respondWithFilteredResult(_0x1f7d9a,_0x122a3b))[_0x1dde('0x4c')](handleError(_0x1f7d9a,null));};exports[_0x1dde('0x4d')]=function(_0x1f4ba7,_0xd028f8){var _0x36a364={'raw':!![],'where':{'id':_0x1f4ba7[_0x1dde('0x4e')]['id']}},_0x3b14e0={};_0x3b14e0[_0x1dde('0x37')]=_[_0x1dde('0x39')](db[_0x1dde('0x32')][_0x1dde('0x33')]);_0x3b14e0['query']=_[_0x1dde('0x39')](_0x1f4ba7[_0x1dde('0x38')]);_0x3b14e0['filters']=_[_0x1dde('0x3c')](_0x3b14e0['model'],_0x3b14e0[_0x1dde('0x38')]);_0x36a364['attributes']=_[_0x1dde('0x3c')](_0x3b14e0[_0x1dde('0x37')],qs[_0x1dde('0x3d')](_0x1f4ba7['query']['fields']));_0x36a364[_0x1dde('0x3b')]=_0x36a364['attributes'][_0x1dde('0x3e')]?_0x36a364[_0x1dde('0x3b')]:_0x3b14e0['model'];if(_0x1f4ba7[_0x1dde('0x38')][_0x1dde('0x49')]){_0x36a364['include']=[{'all':!![]}];}_0x36a364=_['merge']({},_0x36a364,_0x1f4ba7[_0x1dde('0x48')]);return db['Plugin'][_0x1dde('0x4f')](_0x36a364)[_0x1dde('0x29')](handleEntityNotFound(_0xd028f8,null))[_0x1dde('0x29')](respondWithResult(_0xd028f8,null))['catch'](handleError(_0xd028f8,null));};exports[_0x1dde('0x50')]=function(_0x347829,_0x3b5043,_0x5607b5){return db[_0x1dde('0x32')][_0x1dde('0x4f')]({'where':{'id':_0x347829[_0x1dde('0x4e')]['id']},'attributes':['name','path'],'raw':!![]})[_0x1dde('0x29')](handleEntityNotFound(_0x3b5043,null))[_0x1dde('0x29')](function(_0x1a696b){if(_0x1a696b){var _0x35dbc5=path[_0x1dde('0x51')](config['root'],'server/files/plugins',util[_0x1dde('0x52')]('%s.zip',path[_0x1dde('0x53')](_0x1a696b[_0x1dde('0x54')])));var _0x146f8b=fs[_0x1dde('0x55')](_0x35dbc5);var _0x8c4865=archiver(_0x1dde('0x56'),{'zlib':{'level':0x9}});_0x8c4865['on'](_0x1dde('0x57'),function(_0x4b9f8b){if(_0x4b9f8b['code']===_0x1dde('0x58')){logger[_0x1dde('0x2e')](_0x4b9f8b);}else{throw new db[(_0x1dde('0x59'))][(_0x1dde('0x5a'))](_0x1dde('0x5b'));}});_0x8c4865['on']('error',function(_0x4b3144){throw new db['Sequelize'][(_0x1dde('0x5a'))](_0x1dde('0x5b'));});_0x8c4865['pipe'](_0x146f8b);_0x8c4865['glob']('**/*',{'cwd':path[_0x1dde('0x51')](config['root'],_0x1dde('0x5c'),path['dirname'](_0x1a696b['path'])),'ignore':[path[_0x1dde('0x51')](path['basename'](_0x1a696b[_0x1dde('0x54')]),'node_modules/**/*'),path[_0x1dde('0x51')](path[_0x1dde('0x53')](_0x1a696b['path']),_0x1dde('0x5d'))],'nodir':!![]})[_0x1dde('0x5e')]();_0x146f8b['on']('close',function(){if(!fs['existsSync'](_0x35dbc5)){throw new db[(_0x1dde('0x59'))][(_0x1dde('0x5a'))](_0x1dde('0x5f'));}return _0x3b5043[_0x1dde('0x50')](_0x35dbc5,util['format'](_0x1dde('0x60'),path[_0x1dde('0x53')](_0x1a696b[_0x1dde('0x54')])),function(_0x46163b){if(_0x46163b){throw new db['Sequelize']['Error'](_0x1dde('0x61'));}fs[_0x1dde('0x62')](_0x35dbc5);logger['info']('Download\x20completed');logger[_0x1dde('0x63')]('Temporary\x20file\x20removed');});});}return null;})[_0x1dde('0x4c')](handleError(_0x3b5043,null));};exports[_0x1dde('0x64')]=function(_0x10bb5a,_0x36cf29,_0x211977){var _0x28b370=path[_0x1dde('0x53')](_0x10bb5a[_0x1dde('0x65')]['filename'],path[_0x1dde('0x66')](_0x10bb5a[_0x1dde('0x65')][_0x1dde('0x67')]));var _0x5a652d=path[_0x1dde('0x51')](config[_0x1dde('0x68')],_0x1dde('0x5c'),_0x10bb5a[_0x1dde('0x65')]['filename']);var _0x280943=path[_0x1dde('0x51')](config[_0x1dde('0x68')],_0x1dde('0x5c'),_0x28b370);logger[_0x1dde('0x63')]('Plugin\x20upload\x20filepath:\x20%s',_0x5a652d);logger[_0x1dde('0x63')](_0x1dde('0x69'),_0x280943);try{fs[_0x1dde('0x6a')](_0x5a652d,parseInt(_0x1dde('0x6b'),0x8));extract(_0x5a652d,{'dir':_0x280943},function(_0xe0f6e7){if(_0xe0f6e7){logger[_0x1dde('0x2e')](_0xe0f6e7);handleError(_0xe0f6e7,!![]);};var _0x325fea=fs[_0x1dde('0x6c')](_0x280943);if(_0x325fea['length']>0x1){removeReferences(_0x5a652d,_0x280943);logger[_0x1dde('0x2e')]('Invalid\x20plugin\x20structure');return _0x211977(new Error(_0x1dde('0x6d')));}var _0x8a038d=fs[_0x1dde('0x6e')](path[_0x1dde('0x51')](_0x280943,_0x325fea[0x0]));if(_0x8a038d['isFile']()){removeReferences(_0x5a652d,_0x280943);logger['error'](_0x1dde('0x6d'));return _0x211977(new Error(_0x1dde('0x6d')));}if(_0x8a038d[_0x1dde('0x6f')]()){var _0x59d3a0=fs[_0x1dde('0x6c')](path[_0x1dde('0x51')](_0x280943,_0x325fea[0x0]));if(_0x59d3a0[_0x1dde('0x3e')]===0x0){removeReferences(_0x5a652d,_0x280943);logger[_0x1dde('0x2e')](_0x1dde('0x6d'));return _0x211977(new Error(_0x1dde('0x6d')));}var _0x5c1bad=_0x59d3a0[_0x1dde('0x70')](function(_0x22e206){return _0x22e206===_0x1dde('0x71');});if(!_0x5c1bad){return _0x211977(new Error(_0x1dde('0x72')));}var _0x3cf0f9=fs['readFileSync'](path[_0x1dde('0x51')](_0x280943,_0x325fea[0x0],_0x1dde('0x71')));var _0x5c0398=JSON[_0x1dde('0x73')](_0x3cf0f9);if(_0x1dde('0x21')==typeof _0x5c0398[_0x1dde('0x2f')]){return _0x211977(new Error(_0x1dde('0x74')));}if(_0x1dde('0x21')==typeof _0x5c0398[_0x1dde('0x35')]){return _0x211977(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0x1dde('0x21')==typeof _0x5c0398[_0x1dde('0x75')]){return _0x211977(new Error(_0x1dde('0x76')));}if('undefined'==typeof _0x5c0398[_0x1dde('0x77')]){return _0x211977(new Error(_0x1dde('0x78')));}if(_0x5c0398[_0x1dde('0x35')]===_0x1dde('0x79')){if(_0x1dde('0x21')==typeof _0x5c0398[_0x1dde('0x77')][_0x1dde('0x7a')]){return _0x211977(new Error('Invalid\x20manifest:\x20views\x20missing'));}if('undefined'==typeof _0x5c0398[_0x1dde('0x77')][_0x1dde('0x7a')][_0x1dde('0x7b')]&&'undefined'==typeof _0x5c0398['parameters'][_0x1dde('0x7a')][_0x1dde('0x7c')]){return _0x211977(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x5c0398['type']==='script'){if('undefined'==typeof _0x5c0398[_0x1dde('0x77')][_0x1dde('0x7d')]){return _0x211977(new Error(_0x1dde('0x7e')));}if(_0x1dde('0x21')==typeof _0x5c0398[_0x1dde('0x77')]['scriptPath']){return _0x211977(new Error(_0x1dde('0x7f')));}}else{return _0x211977(new Error(_0x1dde('0x80')));}var _0x161f0d=_0x5c0398[_0x1dde('0x2f')];var _0xd1e43c=_0x5c0398[_0x1dde('0x81')];var _0x10ec8=_0x5c0398[_0x1dde('0x35')];var _0x9b8a45=_0x5c0398[_0x1dde('0x82')]?_0x5c0398['sidebar']:_0x1dde('0x83');var _0x1f4180=_0x5c0398[_0x1dde('0x84')]?_0x5c0398[_0x1dde('0x84')]:_0x1dde('0x85');var _0x3ecba6='';var _0x27c6b7='';var _0x39f62f='';var _0x2276ae='';var _0x2bff82=_0x5c0398[_0x1dde('0x75')];if(_0x10ec8===_0x1dde('0x79')){if(_0x1dde('0x21')!=typeof _0x5c0398[_0x1dde('0x77')][_0x1dde('0x7a')][_0x1dde('0x7b')]){var _0x15b2c1=_0x5c0398['parameters'][_0x1dde('0x7a')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x1dde('0x86')](_0x15b2c1)){_0x3ecba6=path[_0x1dde('0x51')](_0x1dde('0x87'),_0x28b370,_0x325fea[0x0],_0x15b2c1);}else{_0x3ecba6=_0x15b2c1;}}else{logger['info'](_0x1dde('0x88'));}if(_0x1dde('0x21')!=typeof _0x5c0398[_0x1dde('0x77')][_0x1dde('0x7a')]['agent']){var _0x5e79ac=_0x5c0398[_0x1dde('0x77')][_0x1dde('0x7a')][_0x1dde('0x7c')];if(!/^(f|ht)tps?:\/\//i['test'](_0x5e79ac)){_0x27c6b7=path[_0x1dde('0x51')](_0x1dde('0x87'),_0x28b370,_0x325fea[0x0],_0x5e79ac);}else{_0x27c6b7=_0x5e79ac;}}else{logger['info'](_0x1dde('0x89'));}}else if(_0x10ec8===_0x1dde('0x8a')){_0x39f62f=_0x5c0398['parameters'][_0x1dde('0x7d')];_0x2276ae=_0x5c0398[_0x1dde('0x77')][_0x1dde('0x8b')];if(_0x1dde('0x21')!=typeof _0x5c0398[_0x1dde('0x77')][_0x1dde('0x7a')]){if(_0x1dde('0x21')!=typeof _0x5c0398[_0x1dde('0x77')]['views'][_0x1dde('0x7b')]){var _0x15b2c1=_0x5c0398[_0x1dde('0x77')][_0x1dde('0x7a')][_0x1dde('0x7b')];if(!/^(f|ht)tps?:\/\//i[_0x1dde('0x86')](_0x15b2c1)){_0x3ecba6=path[_0x1dde('0x51')]('plugins',_0x28b370,_0x325fea[0x0],_0x15b2c1);}else{_0x3ecba6=_0x15b2c1;}}if(_0x1dde('0x21')!=typeof _0x5c0398[_0x1dde('0x77')]['views']['agent']){var _0x5e79ac=_0x5c0398[_0x1dde('0x77')][_0x1dde('0x7a')][_0x1dde('0x7c')];if(!/^(f|ht)tps?:\/\//i[_0x1dde('0x86')](_0x5e79ac)){_0x27c6b7=path[_0x1dde('0x51')](_0x1dde('0x87'),_0x28b370,_0x325fea[0x0],_0x5e79ac);}else{_0x27c6b7=_0x5e79ac;}}}}var _0x466b7b={'name':_0x161f0d,'description':_0xd1e43c,'path':path['join'](_0x28b370,_0x325fea[0x0]),'type':_0x10ec8,'sidebar':_0x9b8a45,'icon':_0x1f4180,'adminUrl':_0x3ecba6,'agentUrl':_0x27c6b7,'scriptName':_0x39f62f,'scriptPath':_0x2276ae,'version':_0x2bff82};removeReferences(_0x5a652d,null);return db[_0x1dde('0x32')][_0x1dde('0x8c')](_0x466b7b)[_0x1dde('0x29')](function(_0x599050){var _0x123dfa={'role':_0x10bb5a[_0x1dde('0x8d')][_0x1dde('0x8e')],'userProfileId':_0x10bb5a[_0x1dde('0x8d')][_0x1dde('0x8f')]};if(!_0x123dfa)throw new Error(_0x1dde('0x90'));if(_0x123dfa[_0x1dde('0x8e')]===_0x1dde('0x91')){var _0xe0aaa5=_0x599050['get']({'plain':!![]});return db[_0x1dde('0x92')]['find']({'where':{'name':_0x1dde('0x2b'),'userProfileId':_0x123dfa['userProfileId']},'raw':!![]})[_0x1dde('0x29')](function(_0x111cd0){if(_0x111cd0&&_0x111cd0[_0x1dde('0x93')]===0x0){return db[_0x1dde('0x2c')][_0x1dde('0x8c')]({'name':_0xe0aaa5[_0x1dde('0x2f')],'resourceId':_0xe0aaa5['id'],'type':_0x111cd0[_0x1dde('0x2f')],'sectionId':_0x111cd0['id']},{})[_0x1dde('0x29')](function(){return _0x599050;});}else{return _0x599050;}})[_0x1dde('0x4c')](function(_0x489be4){logger[_0x1dde('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x489be4);throw _0x489be4;});}return _0x599050;})[_0x1dde('0x29')](respondWithResult(_0x36cf29,null))[_0x1dde('0x4c')](handleError(_0x36cf29,null));}});}catch(_0x464278){_0x36cf29[_0x1dde('0x1e')](0x1f4)[_0x1dde('0x30')](_0x464278);}};function removeReferences(_0x4fea7a,_0x4aff84){try{if(_0x4fea7a){fs[_0x1dde('0x62')](_0x4fea7a);logger[_0x1dde('0x63')](_0x1dde('0x94'));}if(_0x4aff84){rimraf(_0x4aff84,function(){});logger[_0x1dde('0x63')](_0x1dde('0x95'));}}catch(_0x499013){logger['error'](_0x499013);}}exports['update']=function(_0x4b452c,_0x1267b5,_0x519d77){return db['Plugin'][_0x1dde('0x4f')]({'where':{'id':_0x4b452c[_0x1dde('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1267b5,null))[_0x1dde('0x29')](saveUpdates(_0x4b452c[_0x1dde('0x8d')],null))['then'](respondWithResult(_0x1267b5,null))[_0x1dde('0x4c')](handleError(_0x1267b5,null));};exports['delete']=function(_0x2fe6fc,_0x3a19be,_0xfd70da){return db['Plugin']['find']({'where':{'id':_0x2fe6fc['params']['id']}})[_0x1dde('0x29')](function(_0x5bd8d7){if(_0x5bd8d7){return _0x5bd8d7[_0x1dde('0x2a')]();}})['then'](function(_0x45fcaa){rimraf(path[_0x1dde('0x51')](config['root'],_0x1dde('0x5c'),path[_0x1dde('0x96')](_0x45fcaa[_0x1dde('0x54')])),function(){});return _0x45fcaa;})[_0x1dde('0x29')](handleEntityNotFound(_0x3a19be,null))[_0x1dde('0x29')](respondWithStatusCode(_0x3a19be,null))[_0x1dde('0x4c')](handleError(_0x3a19be,null));};exports[_0x1dde('0x97')]=function(_0x338d27,_0xdc99fb,_0x3f4599){return BPromise[_0x1dde('0x98')]()[_0x1dde('0x29')](function(){if(!_0x338d27[_0x1dde('0x38')][_0x1dde('0x54')]){throw new Error(_0x1dde('0x99'));}if(!_0x338d27[_0x1dde('0x38')]['port']){throw new Error(_0x1dde('0x9a'));}var _0x6d45e9=_0x338d27[_0x1dde('0x38')][_0x1dde('0x9b')]?_0x338d27[_0x1dde('0x38')][_0x1dde('0x9b')]+':'+_0x338d27[_0x1dde('0x38')][_0x1dde('0x9c')]:_0x1dde('0x9d')+_0x338d27[_0x1dde('0x38')][_0x1dde('0x9c')];var _0x4eec8b=_0x338d27['query'][_0x1dde('0x1f')]?_0x338d27['query'][_0x1dde('0x1f')]:!![];var _0xbec1eb=_0x338d27[_0x1dde('0x38')][_0x1dde('0x9e')]?_0x338d27[_0x1dde('0x38')][_0x1dde('0x9e')]:null;var _0x5333b2={'method':_0x338d27['method'],'uri':util[_0x1dde('0x52')]('%s%s',_0x6d45e9,_0x338d27[_0x1dde('0x38')][_0x1dde('0x54')]),'json':_0x4eec8b,'resolveWithFullResponse':!![],'encoding':_0xbec1eb,'qs':_0x338d27[_0x1dde('0x38')]};if(_0x338d27['headers']){_0x5333b2[_0x1dde('0x9f')]=_0x338d27['headers'];if(_0x5333b2[_0x1dde('0x9f')][_0x1dde('0xa0')]){delete _0x5333b2['headers']['content-length'];}}if(_0x5333b2[_0x1dde('0x9f')][_0x1dde('0xa1')]){delete _0x5333b2[_0x1dde('0x9f')]['content-type'];}return rp(_0x5333b2);})[_0x1dde('0x29')](function(_0xb48bc){if(_0xb48bc){_0xdc99fb[_0x1dde('0x24')](_0xb48bc[_0x1dde('0x9f')]);logger[_0x1dde('0x63')](_0xb48bc['body']);if(_['endsWith'](_0x338d27[_0x1dde('0x38')]['path'],'download')&&_0xb48bc['statusCode']==0x1f4){return _0xdc99fb['sendStatus'](_0xb48bc[_0x1dde('0xa2')]);}else{return _0xdc99fb[_0x1dde('0x1e')](_0xb48bc[_0x1dde('0xa2')])[_0x1dde('0x30')](_0xb48bc[_0x1dde('0x8d')]);}}else{return _0xdc99fb[_0x1dde('0x1d')](0xc8);}})['catch'](handleError(_0xdc99fb,null));};exports[_0x1dde('0xa3')]=function(_0x5309f4,_0x49fd87,_0x5d789c){return BPromise[_0x1dde('0x98')]()[_0x1dde('0x29')](function(){if(!_0x5309f4['query'][_0x1dde('0x54')]){throw new Error(_0x1dde('0x99'));}if(!_0x5309f4[_0x1dde('0x38')][_0x1dde('0x9c')]){throw new Error(_0x1dde('0x9a'));}var _0x23cc44=_0x5309f4['query'][_0x1dde('0x9b')]?_0x5309f4[_0x1dde('0x38')][_0x1dde('0x9b')]+':'+_0x5309f4['query'][_0x1dde('0x9c')]:_0x1dde('0x9d')+_0x5309f4[_0x1dde('0x38')]['port'];var _0x10cbd5=_0x5309f4['query'][_0x1dde('0x1f')]?_0x5309f4[_0x1dde('0x38')][_0x1dde('0x1f')]:!![];var _0x41b93c=_0x5309f4[_0x1dde('0x38')][_0x1dde('0x9e')]?_0x5309f4[_0x1dde('0x38')]['encoding']:null;var _0x2c4391={'method':_0x5309f4['method'],'uri':util['format'](_0x1dde('0xa4'),_0x23cc44,_0x5309f4[_0x1dde('0x38')][_0x1dde('0x54')]),'json':_0x10cbd5,'resolveWithFullResponse':!![],'encoding':_0x41b93c,'body':_0x5309f4[_0x1dde('0x8d')]};if(_0x5309f4[_0x1dde('0x9f')]){_0x2c4391[_0x1dde('0x9f')]=_0x5309f4[_0x1dde('0x9f')];if(_0x2c4391[_0x1dde('0x9f')]['content-length']){delete _0x2c4391[_0x1dde('0x9f')][_0x1dde('0xa0')];}}if(_0x2c4391[_0x1dde('0x9f')][_0x1dde('0xa1')]){delete _0x2c4391[_0x1dde('0x9f')][_0x1dde('0xa1')];}return rp(_0x2c4391);})['then'](function(_0x3c0683){if(_0x3c0683){_0x49fd87[_0x1dde('0x24')](_0x3c0683[_0x1dde('0x9f')]);logger[_0x1dde('0x63')](_0x3c0683[_0x1dde('0x8d')]);return _0x49fd87[_0x1dde('0x1e')](_0x3c0683[_0x1dde('0xa2')])[_0x1dde('0x30')](_0x3c0683['body']);}else{return _0x49fd87[_0x1dde('0x1d')](0xc8);}})['catch'](handleError(_0x49fd87,null));}; \ No newline at end of file +var _0x8369=['hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','options','Plugin','includeAll','include','rows','show','merge','find','catch','download','params','join','server/files/plugins','format','%s.zip','basename','zip','warning','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','pipe','glob','**/*','root','dirname','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','Download\x20completed','Temporary\x20file\x20removed','file','filename','info','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','Plugin\x20manifest\x20missing','readFileSync','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','views','Invalid\x20manifest:\x20views\x20missing','admin','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','icon','icon-apps','html','Warning:\x20admin\x20view\x20not\x20specified','agent','test','plugins','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','update','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','\x27PORT\x27\x20parameter\x20not\x20specified','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','jsforce','querystring','extract-zip','archiver','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','then','destroy','get','Plugins','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x52659c,_0x76f6d1){var _0x42b5fc=function(_0x49cf0e){while(--_0x49cf0e){_0x52659c['push'](_0x52659c['shift']());}};_0x42b5fc(++_0x76f6d1);}(_0x8369,0x6c));var _0x9836=function(_0x51ff2c,_0x3474ac){_0x51ff2c=_0x51ff2c-0x0;var _0x2cca78=_0x8369[_0x51ff2c];return _0x2cca78;};'use strict';var emlformat=require(_0x9836('0x0'));var rimraf=require(_0x9836('0x1'));var zipdir=require(_0x9836('0x2'));var jsonpatch=require(_0x9836('0x3'));var rp=require(_0x9836('0x4'));var moment=require(_0x9836('0x5'));var BPromise=require(_0x9836('0x6'));var Mustache=require(_0x9836('0x7'));var util=require('util');var path=require(_0x9836('0x8'));var sox=require(_0x9836('0x9'));var csv=require(_0x9836('0xa'));var ejs=require(_0x9836('0xb'));var fs=require('fs');var fs_extra=require(_0x9836('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9836('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9836('0xa'));var querystring=require(_0x9836('0xe'));var Papa=require('papaparse');var extract=require(_0x9836('0xf'));var rimraf=require('rimraf');var archiver=require(_0x9836('0x10'));var Redis=require(_0x9836('0x11'));var authService=require(_0x9836('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9836('0x13'));var logger=require(_0x9836('0x14'))(_0x9836('0x15'));var utils=require(_0x9836('0x16'));var config=require(_0x9836('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9836('0x18'))['db'];config[_0x9836('0x19')]=_[_0x9836('0x1a')](config['redis'],{'host':_0x9836('0x1b'),'port':0x18eb});var socket=require(_0x9836('0x1c'))(new Redis(config['redis']));require('./plugin.socket')[_0x9836('0x1d')](socket);function respondWithStatusCode(_0x20c89e,_0x5ea5e0){_0x5ea5e0=_0x5ea5e0||0xcc;return function(_0x568c05){if(_0x568c05){return _0x20c89e[_0x9836('0x1e')](_0x5ea5e0);}return _0x20c89e[_0x9836('0x1f')](_0x5ea5e0)[_0x9836('0x20')]();};}function respondWithResult(_0x2bffbe,_0x2028a2){_0x2028a2=_0x2028a2||0xc8;return function(_0x406ab5){if(_0x406ab5){return _0x2bffbe['status'](_0x2028a2)[_0x9836('0x21')](_0x406ab5);}};}function respondWithFilteredResult(_0x4240ee,_0xf316d0){return function(_0x22f9fc){if(_0x22f9fc){var _0x4670b0=typeof _0xf316d0[_0x9836('0x22')]===_0x9836('0x23')&&typeof _0xf316d0[_0x9836('0x24')]==='undefined';var _0x35c767=_0x22f9fc['count'];var _0x1a20d5=_0x4670b0?0x0:_0xf316d0[_0x9836('0x22')];var _0x4c6b86=_0x4670b0?_0x22f9fc[_0x9836('0x25')]:_0xf316d0[_0x9836('0x22')]+_0xf316d0[_0x9836('0x24')];var _0x3a4c6d;if(_0x4c6b86>=_0x35c767){_0x4c6b86=_0x35c767;_0x3a4c6d=0xc8;}else{_0x3a4c6d=0xce;}_0x4240ee['status'](_0x3a4c6d);return _0x4240ee[_0x9836('0x26')]('Content-Range',_0x1a20d5+'-'+_0x4c6b86+'/'+_0x35c767)[_0x9836('0x21')](_0x22f9fc);}return null;};}function patchUpdates(_0x3311d9){return function(_0x4b70ec){try{jsonpatch[_0x9836('0x27')](_0x4b70ec,_0x3311d9,!![]);}catch(_0x3c080c){return BPromise['reject'](_0x3c080c);}return _0x4b70ec[_0x9836('0x28')]();};}function saveUpdates(_0x3ca9c0,_0x4c76df){return function(_0xc20bd9){if(_0xc20bd9){return _0xc20bd9['update'](_0x3ca9c0)[_0x9836('0x29')](function(_0x36c138){return _0x36c138;});}return null;};}function removeEntity(_0x393c8e,_0x1205cf){return function(_0x1f2a1e){if(_0x1f2a1e){return _0x1f2a1e[_0x9836('0x2a')]()[_0x9836('0x29')](function(){var _0x75f026=_0x1f2a1e[_0x9836('0x2b')]({'plain':!![]});var _0x12ff68=_0x9836('0x2c');return db['UserProfileResource'][_0x9836('0x2a')]({'where':{'type':_0x12ff68,'resourceId':_0x75f026['id']}})[_0x9836('0x29')](function(){return _0x1f2a1e;});})[_0x9836('0x29')](function(){_0x393c8e[_0x9836('0x1f')](0xcc)[_0x9836('0x20')]();});}};}function handleEntityNotFound(_0xc395d6,_0x25edac){return function(_0x35b18e){if(!_0x35b18e){_0xc395d6[_0x9836('0x1e')](0x194);}return _0x35b18e;};}function handleError(_0x16c4c4,_0x5633ae){_0x5633ae=_0x5633ae||0x1f4;return function(_0x479e06){logger[_0x9836('0x2d')](_0x479e06[_0x9836('0x2e')]);if(_0x479e06[_0x9836('0x2f')]){delete _0x479e06['name'];}_0x16c4c4[_0x9836('0x1f')](_0x5633ae)['send'](_0x479e06);};}exports[_0x9836('0x30')]=function(_0x114e31,_0x11648a){var _0x131879={},_0x572c43={},_0x94e39c={'count':0x0,'rows':[]};var _0x279d63=_[_0x9836('0x31')](db['Plugin'][_0x9836('0x32')],function(_0x31758c){return{'name':_0x31758c[_0x9836('0x33')],'type':_0x31758c['type'][_0x9836('0x34')]};});_0x572c43[_0x9836('0x35')]=_[_0x9836('0x31')](_0x279d63,_0x9836('0x2f'));_0x572c43[_0x9836('0x36')]=_[_0x9836('0x37')](_0x114e31['query']);_0x572c43[_0x9836('0x38')]=_[_0x9836('0x39')](_0x572c43[_0x9836('0x35')],_0x572c43[_0x9836('0x36')]);_0x131879[_0x9836('0x3a')]=_['intersection'](_0x572c43['model'],qs['fields'](_0x114e31[_0x9836('0x36')][_0x9836('0x3b')]));_0x131879[_0x9836('0x3a')]=_0x131879[_0x9836('0x3a')][_0x9836('0x3c')]?_0x131879['attributes']:_0x572c43[_0x9836('0x35')];if(!_0x114e31[_0x9836('0x36')][_0x9836('0x3d')](_0x9836('0x3e'))){_0x131879[_0x9836('0x24')]=qs[_0x9836('0x24')](_0x114e31[_0x9836('0x36')][_0x9836('0x24')]);_0x131879[_0x9836('0x22')]=qs[_0x9836('0x22')](_0x114e31[_0x9836('0x36')]['offset']);}_0x131879['order']=qs[_0x9836('0x3f')](_0x114e31[_0x9836('0x36')][_0x9836('0x3f')]);_0x131879[_0x9836('0x40')]=qs['filters'](_[_0x9836('0x41')](_0x114e31[_0x9836('0x36')],_0x572c43[_0x9836('0x38')]),_0x279d63);if(_0x114e31['query']['filter']){_0x131879['where']=_['merge'](_0x131879[_0x9836('0x40')],{'$or':_[_0x9836('0x31')](_0x279d63,function(_0x47baaf){if(_0x47baaf[_0x9836('0x42')]!==_0x9836('0x43')){var _0x29c286={};_0x29c286[_0x47baaf[_0x9836('0x2f')]]={'$like':'%'+_0x114e31[_0x9836('0x36')]['filter']+'%'};return _0x29c286;}})});}_0x131879=_['merge']({},_0x131879,_0x114e31[_0x9836('0x44')]);var _0x46491c={'where':_0x131879[_0x9836('0x40')]};return db[_0x9836('0x45')][_0x9836('0x25')](_0x46491c)[_0x9836('0x29')](function(_0x40c01e){_0x94e39c[_0x9836('0x25')]=_0x40c01e;if(_0x114e31['query'][_0x9836('0x46')]){_0x131879[_0x9836('0x47')]=[{'all':!![]}];}return db['Plugin']['findAll'](_0x131879);})[_0x9836('0x29')](function(_0x234252){_0x94e39c[_0x9836('0x48')]=_0x234252;return _0x94e39c;})[_0x9836('0x29')](respondWithFilteredResult(_0x11648a,_0x131879))['catch'](handleError(_0x11648a,null));};exports[_0x9836('0x49')]=function(_0x128aba,_0x394068){var _0x36b35e={'raw':!![],'where':{'id':_0x128aba['params']['id']}},_0x1b3ce2={};_0x1b3ce2[_0x9836('0x35')]=_[_0x9836('0x37')](db['Plugin'][_0x9836('0x32')]);_0x1b3ce2[_0x9836('0x36')]=_[_0x9836('0x37')](_0x128aba[_0x9836('0x36')]);_0x1b3ce2['filters']=_[_0x9836('0x39')](_0x1b3ce2[_0x9836('0x35')],_0x1b3ce2[_0x9836('0x36')]);_0x36b35e['attributes']=_['intersection'](_0x1b3ce2[_0x9836('0x35')],qs[_0x9836('0x3b')](_0x128aba[_0x9836('0x36')][_0x9836('0x3b')]));_0x36b35e[_0x9836('0x3a')]=_0x36b35e[_0x9836('0x3a')][_0x9836('0x3c')]?_0x36b35e[_0x9836('0x3a')]:_0x1b3ce2[_0x9836('0x35')];if(_0x128aba[_0x9836('0x36')]['includeAll']){_0x36b35e[_0x9836('0x47')]=[{'all':!![]}];}_0x36b35e=_[_0x9836('0x4a')]({},_0x36b35e,_0x128aba[_0x9836('0x44')]);return db[_0x9836('0x45')][_0x9836('0x4b')](_0x36b35e)['then'](handleEntityNotFound(_0x394068,null))[_0x9836('0x29')](respondWithResult(_0x394068,null))[_0x9836('0x4c')](handleError(_0x394068,null));};exports[_0x9836('0x4d')]=function(_0x575efc,_0x2b11c9,_0x3827ed){return db[_0x9836('0x45')][_0x9836('0x4b')]({'where':{'id':_0x575efc[_0x9836('0x4e')]['id']},'attributes':[_0x9836('0x2f'),_0x9836('0x8')],'raw':!![]})[_0x9836('0x29')](handleEntityNotFound(_0x2b11c9,null))[_0x9836('0x29')](function(_0x21e927){if(_0x21e927){var _0x146d58=path[_0x9836('0x4f')](config['root'],_0x9836('0x50'),util[_0x9836('0x51')](_0x9836('0x52'),path[_0x9836('0x53')](_0x21e927[_0x9836('0x8')])));var _0x52823e=fs['createWriteStream'](_0x146d58);var _0x40bfab=archiver(_0x9836('0x54'),{'zlib':{'level':0x9}});_0x40bfab['on'](_0x9836('0x55'),function(_0x2c350d){if(_0x2c350d['code']==='ENOENT'){logger[_0x9836('0x2d')](_0x2c350d);}else{throw new db['Sequelize'][(_0x9836('0x56'))](_0x9836('0x57'));}});_0x40bfab['on'](_0x9836('0x2d'),function(_0x1b0d0d){throw new db[(_0x9836('0x58'))]['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x40bfab[_0x9836('0x59')](_0x52823e);_0x40bfab[_0x9836('0x5a')](_0x9836('0x5b'),{'cwd':path['join'](config[_0x9836('0x5c')],'server/files/plugins',path[_0x9836('0x5d')](_0x21e927[_0x9836('0x8')])),'ignore':[path[_0x9836('0x4f')](path['basename'](_0x21e927[_0x9836('0x8')]),_0x9836('0x5e')),path['join'](path['basename'](_0x21e927[_0x9836('0x8')]),_0x9836('0x5f'))],'nodir':!![]})[_0x9836('0x60')]();_0x52823e['on'](_0x9836('0x61'),function(){if(!fs[_0x9836('0x62')](_0x146d58)){throw new db[(_0x9836('0x58'))][(_0x9836('0x56'))](_0x9836('0x63'));}return _0x2b11c9['download'](_0x146d58,util[_0x9836('0x51')](_0x9836('0x52'),path[_0x9836('0x53')](_0x21e927[_0x9836('0x8')])),function(_0x696096){if(_0x696096){throw new db[(_0x9836('0x58'))]['Error'](_0x9836('0x64'));}fs[_0x9836('0x65')](_0x146d58);logger['info'](_0x9836('0x66'));logger['info'](_0x9836('0x67'));});});}return null;})['catch'](handleError(_0x2b11c9,null));};exports['upload']=function(_0x1ffe87,_0xb5098a,_0x453ffe){var _0x3ae74c=path[_0x9836('0x53')](_0x1ffe87[_0x9836('0x68')][_0x9836('0x69')],path['extname'](_0x1ffe87[_0x9836('0x68')][_0x9836('0x69')]));var _0x40a71b=path['join'](config['root'],'server/files/plugins',_0x1ffe87[_0x9836('0x68')]['filename']);var _0x419b27=path[_0x9836('0x4f')](config[_0x9836('0x5c')],_0x9836('0x50'),_0x3ae74c);logger[_0x9836('0x6a')](_0x9836('0x6b'),_0x40a71b);logger[_0x9836('0x6a')](_0x9836('0x6c'),_0x419b27);try{fs[_0x9836('0x6d')](_0x40a71b,parseInt(_0x9836('0x6e'),0x8));extract(_0x40a71b,{'dir':_0x419b27},function(_0x212b6f){if(_0x212b6f){logger[_0x9836('0x2d')](_0x212b6f);handleError(_0x212b6f,!![]);};var _0x9d8a3b=fs[_0x9836('0x6f')](_0x419b27);if(_0x9d8a3b[_0x9836('0x3c')]>0x1){removeReferences(_0x40a71b,_0x419b27);logger['error'](_0x9836('0x70'));return _0x453ffe(new Error(_0x9836('0x70')));}var _0xe38532=fs[_0x9836('0x71')](path[_0x9836('0x4f')](_0x419b27,_0x9d8a3b[0x0]));if(_0xe38532[_0x9836('0x72')]()){removeReferences(_0x40a71b,_0x419b27);logger['error'](_0x9836('0x70'));return _0x453ffe(new Error('Invalid\x20plugin\x20structure'));}if(_0xe38532[_0x9836('0x73')]()){var _0x274d50=fs['readdirSync'](path['join'](_0x419b27,_0x9d8a3b[0x0]));if(_0x274d50[_0x9836('0x3c')]===0x0){removeReferences(_0x40a71b,_0x419b27);logger[_0x9836('0x2d')](_0x9836('0x70'));return _0x453ffe(new Error('Invalid\x20plugin\x20structure'));}var _0x1a1f44=_0x274d50[_0x9836('0x74')](function(_0x3323ba){return _0x3323ba==='manifest.json';});if(!_0x1a1f44){return _0x453ffe(new Error(_0x9836('0x75')));}var _0x35004c=fs[_0x9836('0x76')](path[_0x9836('0x4f')](_0x419b27,_0x9d8a3b[0x0],_0x9836('0x77')));var _0x12b853=JSON[_0x9836('0x78')](_0x35004c);if(_0x9836('0x23')==typeof _0x12b853[_0x9836('0x2f')]){return _0x453ffe(new Error(_0x9836('0x79')));}if(_0x9836('0x23')==typeof _0x12b853[_0x9836('0x42')]){return _0x453ffe(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0x9836('0x23')==typeof _0x12b853[_0x9836('0x7a')]){return _0x453ffe(new Error(_0x9836('0x7b')));}if('undefined'==typeof _0x12b853[_0x9836('0x7c')]){return _0x453ffe(new Error(_0x9836('0x7d')));}if(_0x12b853['type']==='html'){if('undefined'==typeof _0x12b853[_0x9836('0x7c')][_0x9836('0x7e')]){return _0x453ffe(new Error(_0x9836('0x7f')));}if(_0x9836('0x23')==typeof _0x12b853['parameters'][_0x9836('0x7e')][_0x9836('0x80')]&&_0x9836('0x23')==typeof _0x12b853[_0x9836('0x7c')][_0x9836('0x7e')]['agent']){return _0x453ffe(new Error(_0x9836('0x81')));}}else if(_0x12b853['type']===_0x9836('0x82')){if(_0x9836('0x23')==typeof _0x12b853[_0x9836('0x7c')][_0x9836('0x83')]){return _0x453ffe(new Error(_0x9836('0x84')));}if(_0x9836('0x23')==typeof _0x12b853[_0x9836('0x7c')][_0x9836('0x85')]){return _0x453ffe(new Error(_0x9836('0x86')));}}else{return _0x453ffe(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x1f59bf=_0x12b853[_0x9836('0x2f')];var _0x28cb0e=_0x12b853[_0x9836('0x87')];var _0x281aee=_0x12b853[_0x9836('0x42')];var _0x5dcb6d=_0x12b853[_0x9836('0x88')]?_0x12b853['sidebar']:'always';var _0x716222=_0x12b853[_0x9836('0x89')]?_0x12b853[_0x9836('0x89')]:_0x9836('0x8a');var _0x1255e4='';var _0x564c8c='';var _0x229d9d='';var _0x4c36d9='';var _0x2c4b07=_0x12b853[_0x9836('0x7a')];if(_0x281aee===_0x9836('0x8b')){if(_0x9836('0x23')!=typeof _0x12b853[_0x9836('0x7c')][_0x9836('0x7e')]['admin']){var _0x19b769=_0x12b853['parameters'][_0x9836('0x7e')][_0x9836('0x80')];if(!/^(f|ht)tps?:\/\//i['test'](_0x19b769)){_0x1255e4=path[_0x9836('0x4f')]('plugins',_0x3ae74c,_0x9d8a3b[0x0],_0x19b769);}else{_0x1255e4=_0x19b769;}}else{logger['info'](_0x9836('0x8c'));}if(_0x9836('0x23')!=typeof _0x12b853[_0x9836('0x7c')][_0x9836('0x7e')][_0x9836('0x8d')]){var _0x298afc=_0x12b853[_0x9836('0x7c')][_0x9836('0x7e')][_0x9836('0x8d')];if(!/^(f|ht)tps?:\/\//i[_0x9836('0x8e')](_0x298afc)){_0x564c8c=path['join']('plugins',_0x3ae74c,_0x9d8a3b[0x0],_0x298afc);}else{_0x564c8c=_0x298afc;}}else{logger[_0x9836('0x6a')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x281aee===_0x9836('0x82')){_0x229d9d=_0x12b853['parameters']['scriptName'];_0x4c36d9=_0x12b853[_0x9836('0x7c')][_0x9836('0x85')];if(_0x9836('0x23')!=typeof _0x12b853[_0x9836('0x7c')]['views']){if(_0x9836('0x23')!=typeof _0x12b853[_0x9836('0x7c')][_0x9836('0x7e')][_0x9836('0x80')]){var _0x19b769=_0x12b853[_0x9836('0x7c')][_0x9836('0x7e')]['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x19b769)){_0x1255e4=path['join'](_0x9836('0x8f'),_0x3ae74c,_0x9d8a3b[0x0],_0x19b769);}else{_0x1255e4=_0x19b769;}}if(_0x9836('0x23')!=typeof _0x12b853[_0x9836('0x7c')]['views']['agent']){var _0x298afc=_0x12b853['parameters'][_0x9836('0x7e')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x9836('0x8e')](_0x298afc)){_0x564c8c=path['join'](_0x9836('0x8f'),_0x3ae74c,_0x9d8a3b[0x0],_0x298afc);}else{_0x564c8c=_0x298afc;}}}}var _0x160989={'name':_0x1f59bf,'description':_0x28cb0e,'path':path[_0x9836('0x4f')](_0x3ae74c,_0x9d8a3b[0x0]),'type':_0x281aee,'sidebar':_0x5dcb6d,'icon':_0x716222,'adminUrl':_0x1255e4,'agentUrl':_0x564c8c,'scriptName':_0x229d9d,'scriptPath':_0x4c36d9,'version':_0x2c4b07};removeReferences(_0x40a71b,null);return db[_0x9836('0x45')][_0x9836('0x90')](_0x160989)[_0x9836('0x29')](function(_0x1aa306){var _0x4d9f7f={'role':_0x1ffe87[_0x9836('0x91')]['role'],'userProfileId':_0x1ffe87['body']['userProfileId']};if(!_0x4d9f7f)throw new Error(_0x9836('0x92'));if(_0x4d9f7f['role']===_0x9836('0x93')){var _0x1fcab4=_0x1aa306[_0x9836('0x2b')]({'plain':!![]});return db['UserProfileSection'][_0x9836('0x4b')]({'where':{'name':'Plugins','userProfileId':_0x4d9f7f['userProfileId']},'raw':!![]})['then'](function(_0x5c0d8e){if(_0x5c0d8e&&_0x5c0d8e['autoAssociation']===0x0){return db['UserProfileResource'][_0x9836('0x90')]({'name':_0x1fcab4[_0x9836('0x2f')],'resourceId':_0x1fcab4['id'],'type':_0x5c0d8e['name'],'sectionId':_0x5c0d8e['id']},{})[_0x9836('0x29')](function(){return _0x1aa306;});}else{return _0x1aa306;}})[_0x9836('0x4c')](function(_0x18e931){logger['error'](_0x9836('0x94'),_0x18e931);throw _0x18e931;});}return _0x1aa306;})['then'](respondWithResult(_0xb5098a,null))['catch'](handleError(_0xb5098a,null));}});}catch(_0x4a4c63){_0xb5098a['status'](0x1f4)[_0x9836('0x95')](_0x4a4c63);}};function removeReferences(_0x40dd8b,_0x5dd377){try{if(_0x40dd8b){fs[_0x9836('0x65')](_0x40dd8b);logger['info'](_0x9836('0x96'));}if(_0x5dd377){rimraf(_0x5dd377,function(){});logger[_0x9836('0x6a')](_0x9836('0x97'));}}catch(_0x5008cd){logger[_0x9836('0x2d')](_0x5008cd);}}exports[_0x9836('0x98')]=function(_0x6f4b8c,_0x538b1a,_0x53c001){return db[_0x9836('0x45')][_0x9836('0x4b')]({'where':{'id':_0x6f4b8c[_0x9836('0x4e')]['id']}})[_0x9836('0x29')](handleEntityNotFound(_0x538b1a,null))[_0x9836('0x29')](saveUpdates(_0x6f4b8c[_0x9836('0x91')],null))[_0x9836('0x29')](respondWithResult(_0x538b1a,null))['catch'](handleError(_0x538b1a,null));};exports['delete']=function(_0x500a43,_0x3a40da,_0x58f8e4){return db[_0x9836('0x45')][_0x9836('0x4b')]({'where':{'id':_0x500a43[_0x9836('0x4e')]['id']}})[_0x9836('0x29')](function(_0x3dbf99){if(_0x3dbf99){return _0x3dbf99[_0x9836('0x2a')]();}})[_0x9836('0x29')](function(_0x5127c5){rimraf(path[_0x9836('0x4f')](config[_0x9836('0x5c')],_0x9836('0x50'),path[_0x9836('0x5d')](_0x5127c5[_0x9836('0x8')])),function(){});return _0x5127c5;})['then'](handleEntityNotFound(_0x3a40da,null))[_0x9836('0x29')](respondWithStatusCode(_0x3a40da,null))[_0x9836('0x4c')](handleError(_0x3a40da,null));};exports[_0x9836('0x99')]=function(_0x295987,_0x5a5445,_0x489a92){return BPromise[_0x9836('0x9a')]()['then'](function(){if(!_0x295987[_0x9836('0x36')][_0x9836('0x8')]){throw new Error(_0x9836('0x9b'));}if(!_0x295987[_0x9836('0x36')][_0x9836('0x9c')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x40526b=_0x295987['query'][_0x9836('0x9d')]?_0x295987['query'][_0x9836('0x9d')]+':'+_0x295987[_0x9836('0x36')][_0x9836('0x9c')]:_0x9836('0x9e')+_0x295987[_0x9836('0x36')]['port'];var _0x1fa6fe=_0x295987[_0x9836('0x36')][_0x9836('0x21')]?_0x295987[_0x9836('0x36')][_0x9836('0x21')]:!![];var _0x63a7c9=_0x295987[_0x9836('0x36')][_0x9836('0x9f')]?_0x295987['query'][_0x9836('0x9f')]:null;var _0x2944f6={'method':_0x295987[_0x9836('0xa0')],'uri':util[_0x9836('0x51')](_0x9836('0xa1'),_0x40526b,_0x295987[_0x9836('0x36')]['path']),'json':_0x1fa6fe,'resolveWithFullResponse':!![],'encoding':_0x63a7c9,'qs':_0x295987['query']};if(_0x295987['headers']){_0x2944f6[_0x9836('0xa2')]=_0x295987['headers'];if(_0x2944f6[_0x9836('0xa2')][_0x9836('0xa3')]){delete _0x2944f6['headers']['content-length'];}}if(_0x2944f6[_0x9836('0xa2')][_0x9836('0xa4')]){delete _0x2944f6[_0x9836('0xa2')][_0x9836('0xa4')];}return rp(_0x2944f6);})[_0x9836('0x29')](function(_0x150efc){if(_0x150efc){_0x5a5445[_0x9836('0x26')](_0x150efc[_0x9836('0xa2')]);logger[_0x9836('0x6a')](_0x150efc[_0x9836('0x91')]);if(_[_0x9836('0xa5')](_0x295987[_0x9836('0x36')][_0x9836('0x8')],_0x9836('0x4d'))&&_0x150efc[_0x9836('0xa6')]==0x1f4){return _0x5a5445[_0x9836('0x1e')](_0x150efc[_0x9836('0xa6')]);}else{return _0x5a5445[_0x9836('0x1f')](_0x150efc[_0x9836('0xa6')])[_0x9836('0x95')](_0x150efc[_0x9836('0x91')]);}}else{return _0x5a5445[_0x9836('0x1e')](0xc8);}})[_0x9836('0x4c')](handleError(_0x5a5445,null));};exports[_0x9836('0xa7')]=function(_0x1fd8b6,_0x32dc6b,_0x2aceda){return BPromise[_0x9836('0x9a')]()['then'](function(){if(!_0x1fd8b6[_0x9836('0x36')][_0x9836('0x8')]){throw new Error(_0x9836('0x9b'));}if(!_0x1fd8b6['query']['port']){throw new Error(_0x9836('0xa8'));}var _0x3fc0b2=_0x1fd8b6[_0x9836('0x36')][_0x9836('0x9d')]?_0x1fd8b6[_0x9836('0x36')][_0x9836('0x9d')]+':'+_0x1fd8b6[_0x9836('0x36')]['port']:_0x9836('0x9e')+_0x1fd8b6[_0x9836('0x36')][_0x9836('0x9c')];var _0x498365=_0x1fd8b6[_0x9836('0x36')][_0x9836('0x21')]?_0x1fd8b6['query']['json']:!![];var _0x307b12=_0x1fd8b6[_0x9836('0x36')]['encoding']?_0x1fd8b6['query']['encoding']:null;var _0x3dfd99={'method':_0x1fd8b6[_0x9836('0xa0')],'uri':util[_0x9836('0x51')](_0x9836('0xa1'),_0x3fc0b2,_0x1fd8b6[_0x9836('0x36')][_0x9836('0x8')]),'json':_0x498365,'resolveWithFullResponse':!![],'encoding':_0x307b12,'body':_0x1fd8b6[_0x9836('0x91')]};if(_0x1fd8b6[_0x9836('0xa2')]){_0x3dfd99[_0x9836('0xa2')]=_0x1fd8b6['headers'];if(_0x3dfd99['headers'][_0x9836('0xa3')]){delete _0x3dfd99[_0x9836('0xa2')]['content-length'];}}if(_0x3dfd99[_0x9836('0xa2')]['content-type']){delete _0x3dfd99[_0x9836('0xa2')]['content-type'];}return rp(_0x3dfd99);})[_0x9836('0x29')](function(_0x54386d){if(_0x54386d){_0x32dc6b['set'](_0x54386d[_0x9836('0xa2')]);logger['info'](_0x54386d['body']);return _0x32dc6b[_0x9836('0x1f')](_0x54386d[_0x9836('0xa6')])[_0x9836('0x95')](_0x54386d[_0x9836('0x91')]);}else{return _0x32dc6b[_0x9836('0x1e')](0xc8);}})[_0x9836('0x4c')](handleError(_0x32dc6b,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 97a5dc7..6c002e3 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 _0xf2e0=['remove','emit','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf2e0,0xc7));var _0x0f2e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xf2e0[_0x5b644e];return _0x49c6bf;};'use strict';var EventEmitter=require(_0x0f2e('0x0'));var Plugin=require(_0x0f2e('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x0f2e('0x2')](0x0);var events={'afterCreate':_0x0f2e('0x3'),'afterUpdate':'update','afterDestroy':_0x0f2e('0x4')};function emitEvent(_0x8c11c7){return function(_0x363be3,_0x4d60de,_0x23ab33){PluginEvents[_0x0f2e('0x5')](_0x8c11c7+':'+_0x363be3['id'],_0x363be3);PluginEvents[_0x0f2e('0x5')](_0x8c11c7,_0x363be3);_0x23ab33(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x0f2e('0x6')]=PluginEvents; \ No newline at end of file +var _0x0c42=['exports','events','../../mysqldb','Plugin','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x4ab5fb,_0xb7181){var _0x39e880=function(_0x184dc2){while(--_0x184dc2){_0x4ab5fb['push'](_0x4ab5fb['shift']());}};_0x39e880(++_0xb7181);}(_0x0c42,0x191));var _0x20c4=function(_0x5ee250,_0x225999){_0x5ee250=_0x5ee250-0x0;var _0x117b03=_0x0c42[_0x5ee250];return _0x117b03;};'use strict';var EventEmitter=require(_0x20c4('0x0'));var Plugin=require(_0x20c4('0x1'))['db'][_0x20c4('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x20c4('0x3')](0x0);var events={'afterCreate':_0x20c4('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3a3e5b){return function(_0x1296a8,_0x24bfc1,_0x23231a){PluginEvents[_0x20c4('0x5')](_0x3a3e5b+':'+_0x1296a8['id'],_0x1296a8);PluginEvents['emit'](_0x3a3e5b,_0x1296a8);_0x23231a(null);};}for(var e in events){if(events[_0x20c4('0x6')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x20c4('0x7')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 230e9eb..9889acc 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 _0xf90b=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','Plugin','plugins'];(function(_0x30faec,_0x18940b){var _0x29484f=function(_0x169ae8){while(--_0x169ae8){_0x30faec['push'](_0x30faec['shift']());}};_0x29484f(++_0x18940b);}(_0xf90b,0x1ec));var _0xbf90=function(_0x18465d,_0x446fcb){_0x18465d=_0x18465d-0x0;var _0x3a6d5a=_0xf90b[_0x18465d];return _0x3a6d5a;};'use strict';var _=require(_0xbf90('0x0'));var util=require('util');var logger=require(_0xbf90('0x1'))(_0xbf90('0x2'));var moment=require(_0xbf90('0x3'));var BPromise=require(_0xbf90('0x4'));var rp=require(_0xbf90('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbf90('0x6'));var config=require(_0xbf90('0x7'));var attributes=require('./plugin.attributes');module[_0xbf90('0x8')]=function(_0x235553,_0x348225){return _0x235553[_0xbf90('0x9')](_0xbf90('0xa'),attributes,{'tableName':_0xbf90('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2411=['plugins','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./plugin.attributes','exports','define'];(function(_0x4d60d7,_0x487851){var _0x5021cf=function(_0x519ee6){while(--_0x519ee6){_0x4d60d7['push'](_0x4d60d7['shift']());}};_0x5021cf(++_0x487851);}(_0x2411,0x175));var _0x1241=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x2411[_0x4a53d];return _0x27410e;};'use strict';var _=require('lodash');var util=require(_0x1241('0x0'));var logger=require(_0x1241('0x1'))(_0x1241('0x2'));var moment=require(_0x1241('0x3'));var BPromise=require(_0x1241('0x4'));var rp=require(_0x1241('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1241('0x6'));var config=require(_0x1241('0x7'));var attributes=require(_0x1241('0x8'));module[_0x1241('0x9')]=function(_0x3b2074,_0x1f9d02){return _0x3b2074[_0x1241('0xa')]('Plugin',attributes,{'tableName':_0x1241('0xb'),'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 62febf4..ab1b3d8 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 _0x9b7e=['Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreatePlugin','Plugin','create','body','options','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./plugin.socket','register','then','info'];(function(_0x3ba8f8,_0x5c5bde){var _0x29973e=function(_0x1b8360){while(--_0x1b8360){_0x3ba8f8['push'](_0x3ba8f8['shift']());}};_0x29973e(++_0x5c5bde);}(_0x9b7e,0x12e));var _0xe9b7=function(_0x5bc5fe,_0x2afaef){_0x5bc5fe=_0x5bc5fe-0x0;var _0x298ea7=_0x9b7e[_0x5bc5fe];return _0x298ea7;};'use strict';var _=require('lodash');var util=require(_0xe9b7('0x0'));var moment=require(_0xe9b7('0x1'));var BPromise=require(_0xe9b7('0x2'));var rs=require(_0xe9b7('0x3'));var fs=require('fs');var Redis=require(_0xe9b7('0x4'));var db=require(_0xe9b7('0x5'))['db'];var utils=require(_0xe9b7('0x6'));var logger=require(_0xe9b7('0x7'))(_0xe9b7('0x8'));var config=require(_0xe9b7('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe9b7('0xa')]['http']({'port':0x232a});config[_0xe9b7('0xb')]=_['defaults'](config[_0xe9b7('0xb')],{'host':_0xe9b7('0xc'),'port':0x18eb});var socket=require(_0xe9b7('0xd'))(new Redis(config[_0xe9b7('0xb')]));require(_0xe9b7('0xe'))[_0xe9b7('0xf')](socket);function respondWithRpcPromise(_0xf4d756,_0x48e31d,_0x138e8d){return new BPromise(function(_0x5e83e1,_0x5d605d){return client['request'](_0xf4d756,_0x138e8d)[_0xe9b7('0x10')](function(_0x360058){logger[_0xe9b7('0x11')](_0xe9b7('0x12'),_0x48e31d,_0xe9b7('0x13'));logger[_0xe9b7('0x14')](_0xe9b7('0x15'),_0x48e31d,_0xe9b7('0x13'),JSON[_0xe9b7('0x16')](_0x360058));if(_0x360058[_0xe9b7('0x17')]){if(_0x360058[_0xe9b7('0x17')][_0xe9b7('0x18')]===0x1f4){logger['error'](_0xe9b7('0x12'),_0x48e31d,_0x360058[_0xe9b7('0x17')][_0xe9b7('0x19')]);return _0x5d605d(_0x360058[_0xe9b7('0x17')][_0xe9b7('0x19')]);}logger[_0xe9b7('0x17')]('Plugin,\x20%s,\x20%s',_0x48e31d,_0x360058[_0xe9b7('0x17')][_0xe9b7('0x19')]);return _0x5e83e1(_0x360058[_0xe9b7('0x17')][_0xe9b7('0x19')]);}else{logger[_0xe9b7('0x11')](_0xe9b7('0x12'),_0x48e31d,_0xe9b7('0x13'));_0x5e83e1(_0x360058[_0xe9b7('0x1a')]['message']);}})['catch'](function(_0x150e8e){logger[_0xe9b7('0x17')](_0xe9b7('0x12'),_0x48e31d,_0x150e8e);_0x5d605d(_0x150e8e);});});}exports[_0xe9b7('0x1b')]=function(_0x26c710){var _0x3a3832=this;return new Promise(function(_0x2b84e2,_0xe1d64d){return db[_0xe9b7('0x1c')][_0xe9b7('0x1d')](_0x26c710[_0xe9b7('0x1e')],{'raw':_0x26c710[_0xe9b7('0x1f')]?_0x26c710['options']['raw']===undefined?!![]:![]:!![]})[_0xe9b7('0x10')](function(_0x15c2d5){logger[_0xe9b7('0x11')](_0xe9b7('0x1b'),_0x26c710);logger['debug'](_0xe9b7('0x1b'),_0x26c710,JSON[_0xe9b7('0x16')](_0x15c2d5));_0x2b84e2(_0x15c2d5);})['catch'](function(_0x52bcd0){logger['error'](_0xe9b7('0x1b'),_0x52bcd0[_0xe9b7('0x19')],_0x26c710);_0xe1d64d(_0x3a3832['error'](0x1f4,_0x52bcd0[_0xe9b7('0x19')]));});});}; \ No newline at end of file +var _0x2162=['Plugin','create','body','options','raw','info','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','./plugin.socket','register','then','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','Plugin,\x20%s,\x20%s','message','request\x20sent','result','catch','CreatePlugin'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x2162,0x1b3));var _0x2216=function(_0x301b7a,_0x55fdd0){_0x301b7a=_0x301b7a-0x0;var _0x1e2fab=_0x2162[_0x301b7a];return _0x1e2fab;};'use strict';var _=require(_0x2216('0x0'));var util=require(_0x2216('0x1'));var moment=require(_0x2216('0x2'));var BPromise=require(_0x2216('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2216('0x4'));var db=require(_0x2216('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2216('0x6'))(_0x2216('0x7'));var config=require(_0x2216('0x8'));var jayson=require(_0x2216('0x9'));var client=jayson['client'][_0x2216('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x2216('0xb')],{'host':_0x2216('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2216('0xb')]));require(_0x2216('0xd'))[_0x2216('0xe')](socket);function respondWithRpcPromise(_0x48f6b8,_0x2f1bd7,_0x51d1d0){return new BPromise(function(_0x474288,_0x575968){return client['request'](_0x48f6b8,_0x51d1d0)[_0x2216('0xf')](function(_0x2abeaf){logger['info']('Plugin,\x20%s,\x20%s',_0x2f1bd7,'request\x20sent');logger[_0x2216('0x10')](_0x2216('0x11'),_0x2f1bd7,'request\x20sent',JSON[_0x2216('0x12')](_0x2abeaf));if(_0x2abeaf['error']){if(_0x2abeaf[_0x2216('0x13')][_0x2216('0x14')]===0x1f4){logger['error'](_0x2216('0x15'),_0x2f1bd7,_0x2abeaf[_0x2216('0x13')][_0x2216('0x16')]);return _0x575968(_0x2abeaf[_0x2216('0x13')][_0x2216('0x16')]);}logger[_0x2216('0x13')](_0x2216('0x15'),_0x2f1bd7,_0x2abeaf['error'][_0x2216('0x16')]);return _0x474288(_0x2abeaf[_0x2216('0x13')][_0x2216('0x16')]);}else{logger['info'](_0x2216('0x15'),_0x2f1bd7,_0x2216('0x17'));_0x474288(_0x2abeaf[_0x2216('0x18')][_0x2216('0x16')]);}})[_0x2216('0x19')](function(_0x3bfc03){logger['error'](_0x2216('0x15'),_0x2f1bd7,_0x3bfc03);_0x575968(_0x3bfc03);});});}exports[_0x2216('0x1a')]=function(_0x59aa31){var _0x25ecb1=this;return new Promise(function(_0x3a81b7,_0x133aca){return db[_0x2216('0x1b')][_0x2216('0x1c')](_0x59aa31[_0x2216('0x1d')],{'raw':_0x59aa31[_0x2216('0x1e')]?_0x59aa31[_0x2216('0x1e')][_0x2216('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x5d6ddd){logger[_0x2216('0x20')](_0x2216('0x1a'),_0x59aa31);logger['debug'](_0x2216('0x1a'),_0x59aa31,JSON[_0x2216('0x12')](_0x5d6ddd));_0x3a81b7(_0x5d6ddd);})[_0x2216('0x19')](function(_0x48dcbe){logger['error'](_0x2216('0x1a'),_0x48dcbe['message'],_0x59aa31);_0x133aca(_0x25ecb1[_0x2216('0x13')](0x1f4,_0x48dcbe[_0x2216('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 12cf3e5..18607e7 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 _0x04e7=['remove','update','emit','removeListener','register','length','./plugin.events','save'];(function(_0x369b7d,_0x3a10c8){var _0x134083=function(_0x543fd0){while(--_0x543fd0){_0x369b7d['push'](_0x369b7d['shift']());}};_0x134083(++_0x3a10c8);}(_0x04e7,0x1e6));var _0x704e=function(_0x2cde0a,_0x1f9695){_0x2cde0a=_0x2cde0a-0x0;var _0x260610=_0x04e7[_0x2cde0a];return _0x260610;};'use strict';var PluginEvents=require(_0x704e('0x0'));var events=[_0x704e('0x1'),_0x704e('0x2'),_0x704e('0x3')];function createListener(_0x3e8a13,_0x4ddb54){return function(_0x30889c){_0x4ddb54[_0x704e('0x4')](_0x3e8a13,_0x30889c);};}function removeListener(_0x260aaf,_0x5ba47f){return function(){PluginEvents[_0x704e('0x5')](_0x260aaf,_0x5ba47f);};}exports[_0x704e('0x6')]=function(_0x2b3f20){for(var _0x1f4662=0x0,_0x537a0d=events[_0x704e('0x7')];_0x1f4662<_0x537a0d;_0x1f4662++){var _0x1f0bea=events[_0x1f4662];var _0x4b3fee=createListener('plugin:'+_0x1f0bea,_0x2b3f20);PluginEvents['on'](_0x1f0bea,_0x4b3fee);}}; \ No newline at end of file +var _0x4ad6=['emit','removeListener','register','plugin:','./plugin.events','save','remove','update'];(function(_0x227e24,_0x573dd6){var _0x2ccc99=function(_0x177963){while(--_0x177963){_0x227e24['push'](_0x227e24['shift']());}};_0x2ccc99(++_0x573dd6);}(_0x4ad6,0x144));var _0x64ad=function(_0x516705,_0x19dafd){_0x516705=_0x516705-0x0;var _0x2ad402=_0x4ad6[_0x516705];return _0x2ad402;};'use strict';var PluginEvents=require(_0x64ad('0x0'));var events=[_0x64ad('0x1'),_0x64ad('0x2'),_0x64ad('0x3')];function createListener(_0x46204c,_0x58c15a){return function(_0x360ecc){_0x58c15a[_0x64ad('0x4')](_0x46204c,_0x360ecc);};}function removeListener(_0x2eaf13,_0x4b7b5e){return function(){PluginEvents[_0x64ad('0x5')](_0x2eaf13,_0x4b7b5e);};}exports[_0x64ad('0x6')]=function(_0x1bd851){for(var _0x3a0d75=0x0,_0x58545f=events['length'];_0x3a0d75<_0x58545f;_0x3a0d75++){var _0x2a73c8=events[_0x3a0d75];var _0x4ff3a9=createListener(_0x64ad('0x7')+_0x2a73c8,_0x1bd851);PluginEvents['on'](_0x2a73c8,_0x4ff3a9);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 271bd0d..c7d90e6 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(_0x423a37,_0x1dcff5){var _0x1878d7=function(_0x45c75e){while(--_0x45c75e){_0x423a37['push'](_0x423a37['shift']());}};_0x1878d7(++_0x1dcff5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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(_0x5d4dd7,_0x38229c){var _0x2ce0ad=function(_0x54a7fb){while(--_0x54a7fb){_0x5d4dd7['push'](_0x5d4dd7['shift']());}};_0x2ce0ad(++_0x38229c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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 6850483..7939dff 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 _0x54ef=['bluebird','status','error','name','send','npm\x20install','info','index','list','reject','express','motion2','catch','show','describe','params','then','create','script','join','../../files/plugins','body','cwd','chdir','dirname','dump','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','path','child_process','exec'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0x54ef,0x112));var _0xf54e=function(_0x4ddfbe,_0x236e56){_0x4ddfbe=_0x4ddfbe-0x0;var _0x1ead90=_0x54ef[_0x4ddfbe];return _0x1ead90;};'use strict';var _=require(_0xf54e('0x0'));var pm2=require(_0xf54e('0x1'));var logger=require(_0xf54e('0x2'))('api');var path=require(_0xf54e('0x3'));var exec=require(_0xf54e('0x4'))[_0xf54e('0x5')];var BPromise=require(_0xf54e('0x6'));function handleEntityNotFound(_0x8b6bb6,_0x431e36){return function(_0x12d43f){if(!_0x12d43f){_0x8b6bb6['sendStatus'](0x194);;}return _0x12d43f;};}function respondWithResult(_0x55e611,_0x18e84e){_0x18e84e=_0x18e84e||0xc8;return function(_0x99cf9){if(_0x99cf9){return _0x55e611[_0xf54e('0x7')](_0x18e84e)['json'](_0x99cf9);}return null;};}function handleError(_0x27e69b,_0x57a1ce){_0x57a1ce=_0x57a1ce||0x1f4;return function(_0x40a75d){logger[_0xf54e('0x8')](_0x40a75d['stack']);if(_0x40a75d[_0xf54e('0x9')]){delete _0x40a75d[_0xf54e('0x9')];}_0x27e69b[_0xf54e('0x7')](_0x57a1ce)[_0xf54e('0xa')](_0x40a75d);};}function execChildProcess(){return new BPromise(function(_0x5f232a,_0x558502){exec(_0xf54e('0xb'),function(_0x143d66,_0x326eef,_0x553759){logger[_0xf54e('0xc')](_0x326eef);logger['info'](_0x553759);if(_0x143d66){logger['error'](_0x143d66);return _0x558502(_0x143d66);}return _0x5f232a(_0x326eef);});});}exports[_0xf54e('0xd')]=function(_0x2033e9,_0x28f776){return pm2[_0xf54e('0xe')]()['then'](function(_0x331732){if(_0x331732){var _0x1bbeaa=_[_0xf54e('0xf')](_0x331732,function(_0x15f639){return _0x15f639['name']===_0xf54e('0x10')||_0x15f639[_0xf54e('0x9')]===_0xf54e('0x11');});return{'rows':_0x1bbeaa,'count':_0x1bbeaa['length']};}return null;})['then'](respondWithResult(_0x28f776,null))[_0xf54e('0x12')](handleError(_0x28f776,null));};exports[_0xf54e('0x13')]=function(_0x1c02e7,_0x9647f){return pm2[_0xf54e('0x14')](_0x1c02e7[_0xf54e('0x15')]['id'])[_0xf54e('0x16')](respondWithResult(_0x9647f,null))[_0xf54e('0x16')](handleEntityNotFound(_0x9647f,null))[_0xf54e('0x12')](handleError(_0x9647f,null));};exports[_0xf54e('0x17')]=function(_0x226c96,_0x50fc66){if(_0x226c96['body'][_0xf54e('0x9')]&&_0x226c96['body'][_0xf54e('0x18')]){var _0x1bfe99=path[_0xf54e('0x19')](__dirname,_0xf54e('0x1a'),_0x226c96[_0xf54e('0x1b')][_0xf54e('0x18')]);var _0x388aa0=process[_0xf54e('0x1c')]();process[_0xf54e('0x1d')](path[_0xf54e('0x1e')](_0x1bfe99));return execChildProcess()[_0xf54e('0x16')](function(_0x5b83df){process[_0xf54e('0x1d')](_0x388aa0);return pm2['start']({'name':_0x226c96[_0xf54e('0x1b')][_0xf54e('0x9')],'script':_0x1bfe99});})[_0xf54e('0x16')](function(_0x474b61){pm2[_0xf54e('0x1f')]();return _0x474b61[0x0];})[_0xf54e('0x16')](respondWithResult(_0x50fc66,0xc9))[_0xf54e('0x12')](handleError(_0x50fc66,null));}else{return _0x50fc66[_0xf54e('0x7')](0x1f4)[_0xf54e('0xa')]({'message':_0xf54e('0x20')});}};exports[_0xf54e('0x21')]=function(_0x39c0ae,_0x2ea001){if(_0x39c0ae['body']['id']){delete _0x39c0ae[_0xf54e('0x1b')]['id'];}var _0x4cbf7c={'online':_0xf54e('0x22'),'stopped':'stop'};if(_0x4cbf7c[_0xf54e('0x23')](_0x39c0ae[_0xf54e('0x1b')][_0xf54e('0x7')])){return pm2[_0x4cbf7c[_0x39c0ae[_0xf54e('0x1b')][_0xf54e('0x7')]]](_0x39c0ae[_0xf54e('0x15')]['id'])[_0xf54e('0x16')](respondWithResult(_0x2ea001,0xc8))['catch'](handleError(_0x2ea001,null));}else{return _0x2ea001['status'](0x1f4)[_0xf54e('0xa')]({'message':_0xf54e('0x24')});}};exports[_0xf54e('0x25')]=function(_0x16d00f,_0xb2d4c4){if(_0x16d00f[_0xf54e('0x1b')]['id']){delete _0x16d00f[_0xf54e('0x1b')]['id'];}if(_0x16d00f[_0xf54e('0x15')]['id']){return pm2[_0xf54e('0x26')](_0x16d00f[_0xf54e('0x15')]['id'])['then'](function(_0x5f29d3){pm2[_0xf54e('0x1f')]();return _0x5f29d3[0x0];})[_0xf54e('0x16')](respondWithResult(_0xb2d4c4,null))['catch'](handleError(_0xb2d4c4,null));}else{return _0xb2d4c4[_0xf54e('0x7')](0x1f4)[_0xf54e('0xa')]({'message':_0xf54e('0x27')});}}; \ No newline at end of file +var _0xbdb7=['status','send','npm\x20install','info','index','list','then','express','motion2','length','catch','describe','params','body','join','../../files/plugins','script','cwd','chdir','dirname','start','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','stack','name'];(function(_0x25ff4f,_0x3b9883){var _0x29ef5d=function(_0x40173d){while(--_0x40173d){_0x25ff4f['push'](_0x25ff4f['shift']());}};_0x29ef5d(++_0x3b9883);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x3718b7,_0x2da677){_0x3718b7=_0x3718b7-0x0;var _0xf8c91e=_0xbdb7[_0x3718b7];return _0xf8c91e;};'use strict';var _=require(_0x7bdb('0x0'));var pm2=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var path=require(_0x7bdb('0x4'));var exec=require(_0x7bdb('0x5'))[_0x7bdb('0x6')];var BPromise=require(_0x7bdb('0x7'));function handleEntityNotFound(_0x46c068,_0x47aec5){return function(_0x28542c){if(!_0x28542c){_0x46c068['sendStatus'](0x194);;}return _0x28542c;};}function respondWithResult(_0x4b5fff,_0xffdc86){_0xffdc86=_0xffdc86||0xc8;return function(_0x1e23a3){if(_0x1e23a3){return _0x4b5fff['status'](_0xffdc86)['json'](_0x1e23a3);}return null;};}function handleError(_0x468041,_0x11a877){_0x11a877=_0x11a877||0x1f4;return function(_0x530f81){logger['error'](_0x530f81[_0x7bdb('0x8')]);if(_0x530f81[_0x7bdb('0x9')]){delete _0x530f81[_0x7bdb('0x9')];}_0x468041[_0x7bdb('0xa')](_0x11a877)[_0x7bdb('0xb')](_0x530f81);};}function execChildProcess(){return new BPromise(function(_0x144ff7,_0x297724){exec(_0x7bdb('0xc'),function(_0x5462da,_0x4e5b8e,_0x52b9b9){logger[_0x7bdb('0xd')](_0x4e5b8e);logger[_0x7bdb('0xd')](_0x52b9b9);if(_0x5462da){logger['error'](_0x5462da);return _0x297724(_0x5462da);}return _0x144ff7(_0x4e5b8e);});});}exports[_0x7bdb('0xe')]=function(_0x53021d,_0x5898c1){return pm2[_0x7bdb('0xf')]()[_0x7bdb('0x10')](function(_0x4fd91a){if(_0x4fd91a){var _0x50eeca=_['reject'](_0x4fd91a,function(_0x4476ff){return _0x4476ff[_0x7bdb('0x9')]===_0x7bdb('0x11')||_0x4476ff[_0x7bdb('0x9')]===_0x7bdb('0x12');});return{'rows':_0x50eeca,'count':_0x50eeca[_0x7bdb('0x13')]};}return null;})[_0x7bdb('0x10')](respondWithResult(_0x5898c1,null))[_0x7bdb('0x14')](handleError(_0x5898c1,null));};exports['show']=function(_0x1c5750,_0x43f352){return pm2[_0x7bdb('0x15')](_0x1c5750[_0x7bdb('0x16')]['id'])['then'](respondWithResult(_0x43f352,null))[_0x7bdb('0x10')](handleEntityNotFound(_0x43f352,null))[_0x7bdb('0x14')](handleError(_0x43f352,null));};exports['create']=function(_0x3e5f8e,_0x31f78e){if(_0x3e5f8e[_0x7bdb('0x17')][_0x7bdb('0x9')]&&_0x3e5f8e[_0x7bdb('0x17')]['script']){var _0x49f353=path[_0x7bdb('0x18')](__dirname,_0x7bdb('0x19'),_0x3e5f8e['body'][_0x7bdb('0x1a')]);var _0x118ea1=process[_0x7bdb('0x1b')]();process[_0x7bdb('0x1c')](path[_0x7bdb('0x1d')](_0x49f353));return execChildProcess()['then'](function(_0x1d37ac){process[_0x7bdb('0x1c')](_0x118ea1);return pm2[_0x7bdb('0x1e')]({'name':_0x3e5f8e[_0x7bdb('0x17')]['name'],'script':_0x49f353});})['then'](function(_0x3c423f){pm2['dump']();return _0x3c423f[0x0];})['then'](respondWithResult(_0x31f78e,0xc9))['catch'](handleError(_0x31f78e,null));}else{return _0x31f78e[_0x7bdb('0xa')](0x1f4)['send']({'message':_0x7bdb('0x1f')});}};exports[_0x7bdb('0x20')]=function(_0x3ec129,_0x7c09cf){if(_0x3ec129[_0x7bdb('0x17')]['id']){delete _0x3ec129['body']['id'];}var _0x10e818={'online':_0x7bdb('0x21'),'stopped':_0x7bdb('0x22')};if(_0x10e818[_0x7bdb('0x23')](_0x3ec129[_0x7bdb('0x17')][_0x7bdb('0xa')])){return pm2[_0x10e818[_0x3ec129[_0x7bdb('0x17')][_0x7bdb('0xa')]]](_0x3ec129[_0x7bdb('0x16')]['id'])[_0x7bdb('0x10')](respondWithResult(_0x7c09cf,0xc8))[_0x7bdb('0x14')](handleError(_0x7c09cf,null));}else{return _0x7c09cf[_0x7bdb('0xa')](0x1f4)['send']({'message':_0x7bdb('0x24')});}};exports[_0x7bdb('0x25')]=function(_0x8f7672,_0x9f5c1){if(_0x8f7672[_0x7bdb('0x17')]['id']){delete _0x8f7672['body']['id'];}if(_0x8f7672[_0x7bdb('0x16')]['id']){return pm2[_0x7bdb('0x26')](_0x8f7672[_0x7bdb('0x16')]['id'])[_0x7bdb('0x10')](function(_0x58c6b7){pm2['dump']();return _0x58c6b7[0x0];})['then'](respondWithResult(_0x9f5c1,null))[_0x7bdb('0x14')](handleError(_0x9f5c1,null));}else{return _0x9f5c1['status'](0x1f4)[_0x7bdb('0xb')]({'message':'Unknown\x20id'});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 6db3316..662a998 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 _0xd93f=['../../components/auth/service','./realtime.controller','get','isAuthenticated','getAgents','/queues','getQueues','exports','Router'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xd93f,0x98));var _0xfd93=function(_0x5ca54b,_0x51cce0){_0x5ca54b=_0x5ca54b-0x0;var _0x48647b=_0xd93f[_0x5ca54b];return _0x48647b;};'use strict';var express=require('express');var router=express[_0xfd93('0x0')]();var auth=require(_0xfd93('0x1'));var controller=require(_0xfd93('0x2'));router[_0xfd93('0x3')]('/agents',auth[_0xfd93('0x4')](),controller[_0xfd93('0x5')]);router[_0xfd93('0x3')](_0xfd93('0x6'),auth[_0xfd93('0x4')](),controller[_0xfd93('0x7')]);module[_0xfd93('0x8')]=router; \ No newline at end of file +var _0x2a93=['../../components/auth/service','get','/agents','getAgents','isAuthenticated','getQueues','exports','express','Router'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0x2a93,0x18a));var _0x32a9=function(_0x5ee607,_0x5ef350){_0x5ee607=_0x5ee607-0x0;var _0x49a75a=_0x2a93[_0x5ee607];return _0x49a75a;};'use strict';var express=require(_0x32a9('0x0'));var router=express[_0x32a9('0x1')]();var auth=require(_0x32a9('0x2'));var controller=require('./realtime.controller');router[_0x32a9('0x3')](_0x32a9('0x4'),auth['isAuthenticated'](),controller[_0x32a9('0x5')]);router[_0x32a9('0x3')]('/queues',auth[_0x32a9('0x6')](),controller[_0x32a9('0x7')]);module[_0x32a9('0x8')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index ea3b561..6ca3a2d 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 _0xd4fd=['status','set','error','stack','name','send','request','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','merge','startCase','Queues','format','catch','VoiceQueuesChannels','loggedIn','available','waiting','paused','voice','outbound','push','pTalking','originated','message','dialActive','dialMethod','Trunk','startProgressive','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','map','agents','talking','busy','pick','queue','length','some','connectedlinenum','internal','find','UserId','online','voiceStatus','loggedInDb','User','Queue','QueueId','idle','unknown','unavailable','ringing','isNil','chatPause','faxPause','mailPause','openchannelPause','whatsappPause','every','filter','voicePause','chatStatus','faxStatus','mailStatus','openchannelStatus','whatsappStatus','pause','sms','openchannel','fax','whatsapp','toLowerCase','Invalid\x20channel','isArray','findOne','getAgents','all','flatten','uniq','split','fields','globalStatus','DESC','ASC','sort','pauseType','userpic','lastLoginAt','lastPauseAt','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','smsStatus','chatStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','smsPause','resolve','query','channel','includes','join','globalQueueFilter','rawAttributes','fieldName','type','key','role','raw','isEmpty','where','user','userProfileId','agent','UserProfile','rows','globalStatusFilter','pauseTypeFilter','getOptions','QueueCampaigns','getResources','findAndCountAll','util','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../mysqldb','client','http','offset','undefined','count','limit'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0xd4fd,0x92));var _0xdd4f=function(_0x4b8edf,_0x248654){_0x4b8edf=_0x4b8edf-0x0;var _0x5b3c29=_0xd4fd[_0x4b8edf];return _0x5b3c29;};'use strict';var util=require(_0xdd4f('0x0'));var _=require('lodash');var jayson=require(_0xdd4f('0x1'));var qs=require(_0xdd4f('0x2'));var logger=require(_0xdd4f('0x3'))(_0xdd4f('0x4'));var db=require(_0xdd4f('0x5'))['db'];var amiClient=jayson[_0xdd4f('0x6')]['http']({'port':0x232a});var routingClient=jayson[_0xdd4f('0x6')][_0xdd4f('0x7')]({'port':0x232c});function respondWithFilteredResult(_0x425331,_0x303791){return function(_0x5665f5){if(_0x5665f5){var _0x242f23=typeof _0x303791[_0xdd4f('0x8')]==='undefined'&&typeof _0x303791['limit']===_0xdd4f('0x9');var _0x1d79cc=_0x5665f5[_0xdd4f('0xa')];var _0x2685b6=_0x242f23?0x0:_0x303791[_0xdd4f('0x8')];var _0x5ca09f=_0x242f23?_0x5665f5[_0xdd4f('0xa')]:_0x303791[_0xdd4f('0x8')]+_0x303791[_0xdd4f('0xb')];var _0x2663c2;if(_0x5ca09f>=_0x1d79cc){_0x5ca09f=_0x1d79cc;_0x2663c2=0xc8;}else{_0x2663c2=0xce;}_0x425331[_0xdd4f('0xc')](_0x2663c2);return _0x425331[_0xdd4f('0xd')]('Content-Range',_0x2685b6+'-'+_0x5ca09f+'/'+_0x1d79cc)['json'](_0x5665f5);}return null;};}function handleError(_0xcc7203,_0x124944){_0x124944=_0x124944||0x1f4;return function(_0x1f77dd){logger[_0xdd4f('0xe')](_0x1f77dd[_0xdd4f('0xf')]);if(_0x1f77dd[_0xdd4f('0x10')]){delete _0x1f77dd[_0xdd4f('0x10')];}_0xcc7203[_0xdd4f('0xc')](_0x124944)[_0xdd4f('0x11')](_0x1f77dd);};}function getRealtimeAgents(){return new Promise(function(_0x50d64a,_0x15e6dd){return amiClient[_0xdd4f('0x12')](_0xdd4f('0x13'),{})[_0xdd4f('0x14')](function(_0x2679a4){if(_0x2679a4['error'])throw new Error(_0xdd4f('0x15'));var _0x15355f=_0x2679a4[_0xdd4f('0x16')];return routingClient[_0xdd4f('0x12')]('Agents',{})[_0xdd4f('0x14')](function(_0x443c11){if(_0x443c11[_0xdd4f('0xe')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');var _0x34ee87=_0x443c11['result'];return _0x50d64a(_[_0xdd4f('0x17')]({},_0x15355f,_0x34ee87));});})['catch'](function(_0x285658){_0x15e6dd(_0x285658);});});}function getRealtimeQueues(_0x5aa950,_0x1ba21e){return new Promise(function(_0x3ea02c,_0x42e0d9){var _0x256784=_0x1ba21e==='voice'?amiClient:routingClient;return _0x256784[_0xdd4f('0x12')](_[_0xdd4f('0x18')](_0x1ba21e)+_0xdd4f('0x19'),_0x5aa950)[_0xdd4f('0x14')](function(_0xe6ba08){if(_0xe6ba08['error'])throw new Error(util[_0xdd4f('0x1a')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x1ba21e));return _0x3ea02c(_0xe6ba08[_0xdd4f('0x16')]);})[_0xdd4f('0x1b')](function(_0x540feb){_0x42e0d9(_0x540feb);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x22225f,_0x284fe6){return amiClient['request'](_0xdd4f('0x1c'),{})[_0xdd4f('0x14')](function(_0x318698){if(_0x318698['error'])throw new Error('Unable\x20to\x20retrieve\x20voice\x20queues\x20channels');return _0x22225f(_0x318698[_0xdd4f('0x16')]);})['catch'](function(_0xc9f0cd){_0x284fe6(_0xc9f0cd);});});}function initializeQueues(_0xa146e2,_0x5e8d9b,_0xf08a56,_0x4bf974){var _0x41be0f=[_0xdd4f('0x1d'),_0xdd4f('0x1e'),_0xdd4f('0x1f'),'talking',_0xdd4f('0x20')];if(_0xf08a56===_0xdd4f('0x21')&&_0x4bf974===_0xdd4f('0x22')){_0x41be0f[_0xdd4f('0x23')](_0xdd4f('0x24'),_0xdd4f('0x25'),_0xdd4f('0x26'),_0xdd4f('0x27'),_0xdd4f('0x28'),_0xdd4f('0x29'),'startPredictive',_0xdd4f('0x2a'),_0xdd4f('0x2b'),_0xdd4f('0x2c'),'erlangAbandonmentRate',_0xdd4f('0x2d'),'dialPredictiveInterval',_0xdd4f('0x2e'),_0xdd4f('0x2f'),_0xdd4f('0x30'),_0xdd4f('0x31'),_0xdd4f('0x32'),_0xdd4f('0x33'),'predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime');}return _0xa146e2[_0xdd4f('0x34')](function(_0x3856f2){var _0x14ffdf=_0x3856f2['get']({'plain':!![]});_0x14ffdf[_0xdd4f('0x35')]=[];_0x14ffdf[_0xdd4f('0x20')]=0x0;_0x14ffdf['loggedInDb']=0x0;_0x14ffdf[_0xdd4f('0x1d')]=0x0;_0x14ffdf[_0xdd4f('0x1e')]=0x0;_0x14ffdf[_0xdd4f('0x1f')]=0x0;if(_0xf08a56===_0xdd4f('0x21')){_0x14ffdf[_0xdd4f('0x36')]=0x0;_0x14ffdf[_0xdd4f('0x37')]=0x0;if(_0x4bf974==='outbound'){_0x14ffdf[_0xdd4f('0x24')]=0x0;_0x14ffdf['originated']=0x0;}}var _0x2cfa13=_['find'](_0x5e8d9b,['id',_0x14ffdf['id']]);if(_0x2cfa13)_[_0xdd4f('0x17')](_0x14ffdf,_[_0xdd4f('0x38')](_0x2cfa13,_0x41be0f));return _0x14ffdf;});}function updateAgentVoiceStatus(_0x253192,_0x10cc03,_0x3e6380){var _0x534901=_['filter'](_0x3e6380,[_0xdd4f('0x39'),_0x10cc03['name']]);if(_0x534901[_0xdd4f('0x3a')]===0x0)return _0x253192[_0xdd4f('0x37')]=!![];if(_[_0xdd4f('0x3b')](_0x534901,[_0xdd4f('0x3c'),_0x253192[_0xdd4f('0x3d')]['toString']()]))return _0x253192[_0xdd4f('0x36')]=!![];if(!_0x253192[_0xdd4f('0x36')])return _0x253192[_0xdd4f('0x37')]=!![];}function getVoiceQueueAgents(_0x30cd3f,_0x4e51a7,_0x508017,_0x2e1ce8){var _0x14dfc5=_[_0xdd4f('0x3e')](_0x4e51a7,['id',_0x30cd3f['id']]);if(!_0x14dfc5)return _0x30cd3f;return _0x14dfc5['getMembers']({'raw':!![]})[_0xdd4f('0x14')](function(_0x2dbb11){for(var _0x4fdd82=0x0;_0x4fdd82<_0x2dbb11[_0xdd4f('0x3a')];_0x4fdd82++){var _0x1937bc=_[_0xdd4f('0x3e')](_0x508017,['id',_0x2dbb11[_0x4fdd82][_0xdd4f('0x3f')]]);if(!_0x1937bc){_0x1937bc={'id':_0x2dbb11[_0x4fdd82][_0xdd4f('0x3f')],'name':_0x2dbb11[_0x4fdd82][_0xdd4f('0x3f')],'accountcode':'','online':![]};}var _0x3b58f7={'id':_0x1937bc['id'],'name':_0x1937bc[_0xdd4f('0x10')],'internal':_0x1937bc['accountcode'],'online':Boolean(_0x1937bc[_0xdd4f('0x40')]),'paused':Boolean(_0x2dbb11[_0x4fdd82]['paused'])};if(_0x1937bc[_0xdd4f('0x41')]==='talking')updateAgentVoiceStatus(_0x3b58f7,_0x30cd3f,_0x2e1ce8);if(_0x3b58f7[_0xdd4f('0x40')])_0x30cd3f[_0xdd4f('0x42')]++;if(_0x3b58f7['busy'])_0x30cd3f[_0xdd4f('0x37')]++;if(_0x3b58f7['paused']&&!_0x3b58f7['busy']&&!_0x3b58f7[_0xdd4f('0x36')])_0x30cd3f[_0xdd4f('0x20')]++;_0x30cd3f['agents']['push'](_0x3b58f7);}return _0x30cd3f;});}function getQueueAgents(_0x12ad96,_0x530619,_0x2a9b5e){var _0x5000c9=_0xdd4f('0x43')+_[_0xdd4f('0x18')](_0x2a9b5e)+_0xdd4f('0x44');var _0x5ca4f7=_0x2a9b5e+'Pause';return db[_0x5000c9]['findAll']({'where':{[_[_0xdd4f('0x18')](_0x2a9b5e)+_0xdd4f('0x45')]:_0x12ad96['id']},'raw':!![]})[_0xdd4f('0x14')](function(_0x25078c){for(var _0x2ff587=0x0;_0x2ff587<_0x25078c['length'];_0x2ff587++){var _0x2cda3d=_[_0xdd4f('0x3e')](_0x530619,['id',_0x25078c[_0x2ff587]['UserId']]);if(!_0x2cda3d){_0x2cda3d={'id':_0x25078c[_0x2ff587][_0xdd4f('0x3f')],'name':_0x25078c[_0x2ff587][_0xdd4f('0x3f')],'online':![],['pauseField']:![]};}var _0x1e9564={'id':_0x2cda3d['id'],'name':_0x2cda3d[_0xdd4f('0x10')],'online':Boolean(_0x2cda3d['online']),'paused':Boolean(_0x2cda3d[_0x5ca4f7])};if(_0x1e9564[_0xdd4f('0x40')])_0x12ad96[_0xdd4f('0x42')]++;_0x12ad96[_0xdd4f('0x35')][_0xdd4f('0x23')](_0x1e9564);}return _0x12ad96;});}function isIdle(_0x3f7a0e){return _0x3f7a0e===_0xdd4f('0x46')||_0x3f7a0e===_0xdd4f('0x47')||_0x3f7a0e===_0xdd4f('0x48')||_0x3f7a0e===_0xdd4f('0x49')||_[_0xdd4f('0x4a')](_0x3f7a0e);}function isAgentPaused(_0x329f5a,_0x18c74c){var _0x5c172b=[_0x329f5a[_0xdd4f('0x4b')],_0x329f5a[_0xdd4f('0x4c')],_0x329f5a[_0xdd4f('0x4d')],_0x329f5a[_0xdd4f('0x4e')],_0x329f5a['smsPause'],_0x329f5a['voicePause'],_0x329f5a[_0xdd4f('0x4f')]];if(!_0x18c74c)return _[_0xdd4f('0x50')](_0x5c172b);var _0x343ee7=_[_0xdd4f('0x51')](_0x5c172b);return _0x343ee7[_0xdd4f('0x3a')]>0x0&&_0x343ee7[_0xdd4f('0x3a')]<_0x5c172b[_0xdd4f('0x3a')]?!![]:![];}function isAgentIdle(_0x34bd7a){if(_0x34bd7a['voiceStatus']!==_0xdd4f('0x46')&&_0x34bd7a[_0xdd4f('0x52')]){_0x34bd7a[_0xdd4f('0x41')]='pause';return![];}return _[_0xdd4f('0x50')]([_0x34bd7a[_0xdd4f('0x53')],_0x34bd7a[_0xdd4f('0x54')],_0x34bd7a[_0xdd4f('0x55')],_0x34bd7a[_0xdd4f('0x56')],_0x34bd7a['smsStatus'],_0x34bd7a['voiceStatus'],_0x34bd7a[_0xdd4f('0x57')]],isIdle);}function getAgentStatus(_0x41672b){var _0x55e601='unknown';if(isAgentPaused(_0x41672b))_0x55e601=_0xdd4f('0x58');else if(isAgentPaused(_0x41672b,!![]))_0x55e601='*pause';else if(isAgentIdle(_0x41672b))_0x55e601=_0xdd4f('0x46');else _0x55e601=_0xdd4f('0x37');return _0x55e601;}function validateChannel(_0x27af5d){var _0x3f5d7c=['mail','chat',_0xdd4f('0x59'),_0xdd4f('0x5a'),_0xdd4f('0x5b'),_0xdd4f('0x5c'),_0xdd4f('0x21')];if(!_['includes'](_0x3f5d7c,_0x27af5d[_0xdd4f('0x5d')]()))throw new Error(_0xdd4f('0x5e'));return _0x27af5d[_0xdd4f('0x5d')]();}function getFilteredAgentIds(_0x2afc83,_0x59978d){var _0x3bdbf0=_[_0xdd4f('0x5f')](_0x2afc83)?_0x2afc83:[_0x2afc83];var _0xc0b6b8=_['map'](_0x3bdbf0,function(_0x57fbd1){return db[_0x59978d][_0xdd4f('0x60')]({'where':{'name':_0x57fbd1}})[_0xdd4f('0x14')](function(_0xfe4b3a){if(!_0xfe4b3a)return[];return _0xfe4b3a[_0xdd4f('0x61')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xdd4f('0x62')](_0xc0b6b8)[_0xdd4f('0x14')](function(_0x578dbd){var _0x286c05=_(_0x578dbd)[_0xdd4f('0x63')]()[_0xdd4f('0x34')]('id')[_0xdd4f('0x64')]()['value']();return _0x286c05;});}function getUpdatedSortOptions(_0x2574f2){var _0x3341db={'fields':[],'order':null};var _0x4eb25b=_0x2574f2[_0xdd4f('0x65')](',');_0x3341db[_0xdd4f('0x66')]=_[_0xdd4f('0x51')](_0x4eb25b,function(_0x26cedc){if(!_0x26cedc['includes'](_0xdd4f('0x67')))return!![];_0x3341db['order']=_['startsWith'](_0x26cedc,'-')?_0xdd4f('0x68'):_0xdd4f('0x69');return![];});return _0x3341db;}function orderAgentsByStatus(_0x1cebac,_0x4ed8a9){return _0x1cebac[_0xdd4f('0x6a')](function(_0x185c78,_0x3b1ba5){if(_0x185c78['globalStatus']===_0x3b1ba5[_0xdd4f('0x67')]&&_0x185c78[_0xdd4f('0x67')]===_0xdd4f('0x58')){if(_0x4ed8a9===_0xdd4f('0x68'))return(_0x185c78[_0xdd4f('0x6b')]||'')<(_0x3b1ba5[_0xdd4f('0x6b')]||'')?0x1:-0x1;return _0x185c78['pauseType']<_0x3b1ba5[_0xdd4f('0x6b')]?-0x1:0x1;}else{if(_0x4ed8a9===_0xdd4f('0x68'))return _0x185c78[_0xdd4f('0x67')]<_0x3b1ba5['globalStatus']?0x1:-0x1;return _0x185c78['globalStatus']<_0x3b1ba5[_0xdd4f('0x67')]?-0x1:0x1;}});}exports['getAgents']=function(_0x3cc52c,_0x4fdca6){var _0x11beec={'count':0x0,'rows':[]},_0x55f5b2={},_0x323e19,_0x101f5c,_0x4e8e7e,_0x5a6dd2,_0x54d88f=[_0xdd4f('0x6c'),_0xdd4f('0x40'),_0xdd4f('0x6d'),_0xdd4f('0x6e'),_0xdd4f('0x6b'),_0xdd4f('0x6e'),_0xdd4f('0x3d'),'address',_0xdd4f('0x4b'),'openchannelPause','mailPause','smsPause','whatsappPause','faxPause',_0xdd4f('0x52'),_0xdd4f('0x6f'),_0xdd4f('0x70'),_0xdd4f('0x71'),_0xdd4f('0x72'),_0xdd4f('0x73'),'faxCapacity',_0xdd4f('0x74'),_0xdd4f('0x75'),_0xdd4f('0x76'),_0xdd4f('0x77'),_0xdd4f('0x78'),_0xdd4f('0x79'),_0xdd4f('0x53'),_0xdd4f('0x56'),_0xdd4f('0x55'),_0xdd4f('0x7a'),_0xdd4f('0x57'),'faxStatus','voiceStatus',_0xdd4f('0x7b'),'openchannelStatusTime','mailStatusTime','smsStatusTime',_0xdd4f('0x7c'),_0xdd4f('0x7d'),_0xdd4f('0x7e'),_0xdd4f('0x39'),_0xdd4f('0x7f'),_0xdd4f('0x80'),_0xdd4f('0x81'),_0xdd4f('0x82'),_0xdd4f('0x83')],_0x461cb8=[_0xdd4f('0x4b'),_0xdd4f('0x4e'),'mailPause',_0xdd4f('0x84'),_0xdd4f('0x4f'),_0xdd4f('0x4c'),'voicePause','online'];Promise[_0xdd4f('0x85')]()[_0xdd4f('0x14')](function(){if(_0x3cc52c[_0xdd4f('0x86')][_0xdd4f('0x87')])_0x323e19=validateChannel(_0x3cc52c[_0xdd4f('0x86')]['channel']);if(!_0x3cc52c[_0xdd4f('0x86')]['sort']||!_0x3cc52c['query'][_0xdd4f('0x6a')][_0xdd4f('0x88')](_0xdd4f('0x67')))return;var _0x490c4d=getUpdatedSortOptions(_0x3cc52c[_0xdd4f('0x86')][_0xdd4f('0x6a')]);_0x3cc52c[_0xdd4f('0x86')]['sort']=_0x490c4d[_0xdd4f('0x66')][_0xdd4f('0x89')](',');_0x101f5c=_0x490c4d['order'];})[_0xdd4f('0x14')](function(){if(!_0x3cc52c['query'][_0xdd4f('0x8a')])return[];var _0x390f98=_['startCase'](_0x323e19)+_0xdd4f('0x44');return getFilteredAgentIds(_0x3cc52c[_0xdd4f('0x86')]['globalQueueFilter'],_0x390f98);})['then'](function(_0x157d04){var _0x493057=_[_0xdd4f('0x34')](db[_0xdd4f('0x43')][_0xdd4f('0x8b')],function(_0x25ddf9){return{'name':_0x25ddf9[_0xdd4f('0x8c')],'type':_0x25ddf9[_0xdd4f('0x8d')][_0xdd4f('0x8e')]};});_0x3cc52c['query'][_0xdd4f('0x8f')]='agent';_0x3cc52c[_0xdd4f('0x86')][_0xdd4f('0x40')]=!![];_0x55f5b2=qs['getOptions'](_0x493057,_0x3cc52c);_0x55f5b2[_0xdd4f('0x90')]=!![];if(!_[_0xdd4f('0x91')](_0x157d04)){_0x55f5b2[_0xdd4f('0x92')]=_[_0xdd4f('0x17')](_0x55f5b2[_0xdd4f('0x92')],{'$and':[{'id':{'$in':_0x157d04}}]});}else if(!_['isEmpty'](_0x3cc52c[_0xdd4f('0x86')]['globalQueueFilter'])){return _0x11beec;}if(_0x3cc52c['user'][_0xdd4f('0x8f')]===_0xdd4f('0x93')){var _0x4ec179={'params':{'id':_0x3cc52c[_0xdd4f('0x93')][_0xdd4f('0x94')]},'query':{'section':'Agents','role':_0xdd4f('0x95'),'online':!![],'nolimit':_0x3cc52c[_0xdd4f('0x86')]['nolimit'],'sort':_0x3cc52c['query'][_0xdd4f('0x6a')],'filter':_0x3cc52c[_0xdd4f('0x86')]['filter'],'raw':!![],'ids':_0x157d04}};return db[_0xdd4f('0x96')]['getResources'](_0x4ec179);}return db['User']['findAndCountAll'](_0x55f5b2);})[_0xdd4f('0x14')](function(_0x10d8d9){_0x11beec['count']=_0x10d8d9['count'];_0x4e8e7e=_0x10d8d9[_0xdd4f('0x97')];return getRealtimeAgents();})[_0xdd4f('0x14')](function(_0x27a1d9){_0x5a6dd2=_0x27a1d9[_0xdd4f('0x97')];return _0x4e8e7e[_0xdd4f('0x34')](function(_0x33a4d0){var _0x450861=_[_0xdd4f('0x3e')](_0x5a6dd2,['id',_0x33a4d0['id']]);if(_0x450861)_['merge'](_0x33a4d0,_[_0xdd4f('0x38')](_['omit'](_0x450861,_0x461cb8),_0x54d88f));_0x33a4d0[_0xdd4f('0x67')]=getAgentStatus(_0x33a4d0);return _0x33a4d0;});})['then'](function(_0x2fb55a){var _0x248b19;if(_0x3cc52c[_0xdd4f('0x86')][_0xdd4f('0x98')]){_0x248b19=_[_0xdd4f('0x51')](_0x2fb55a,[_0xdd4f('0x67'),_0x3cc52c[_0xdd4f('0x86')][_0xdd4f('0x98')]]);if(_0x3cc52c[_0xdd4f('0x86')]['pauseTypeFilter']){_0x248b19=_['filter'](_0x248b19,[_0xdd4f('0x6b'),_0x3cc52c['query'][_0xdd4f('0x99')]]);}}if(_0x248b19)_0x2fb55a=_0x248b19;if(!_0x101f5c)return _0x2fb55a;return orderAgentsByStatus(_0x2fb55a,_0x101f5c);})['then'](function(_0x162c84){_0x11beec[_0xdd4f('0x97')]=_0x162c84;return _0x11beec;})[_0xdd4f('0x14')](respondWithFilteredResult(_0x4fdca6,_0x55f5b2))[_0xdd4f('0x1b')](handleError(_0x4fdca6,null));};exports['getQueues']=function(_0x44dfcd,_0x3d771e){var _0x2b5c03={'count':0x0,'rows':[]},_0x30cee9={},_0xc98189,_0x3e8caa,_0x531574,_0x3be471,_0x69784;Promise[_0xdd4f('0x85')]()[_0xdd4f('0x14')](function(){if(_0x44dfcd[_0xdd4f('0x86')][_0xdd4f('0x87')])_0xc98189=validateChannel(_0x44dfcd[_0xdd4f('0x86')][_0xdd4f('0x87')]);var _0x40fa28=_[_0xdd4f('0x18')](_0xc98189)+_0xdd4f('0x44');var _0x548730=_[_0xdd4f('0x34')](db[_0x40fa28]['rawAttributes'],function(_0x3420a0){return{'name':_0x3420a0[_0xdd4f('0x8c')],'type':_0x3420a0['type'][_0xdd4f('0x8e')]};});_0x30cee9=qs[_0xdd4f('0x9a')](_0x548730,_0x44dfcd);if(_0x44dfcd[_0xdd4f('0x93')][_0xdd4f('0x8f')]===_0xdd4f('0x93')){var _0x3b188a={'params':{'id':_0x44dfcd[_0xdd4f('0x93')][_0xdd4f('0x94')]},'query':{'section':_0xc98189===_0xdd4f('0x21')&&_0x44dfcd[_0xdd4f('0x86')][_0xdd4f('0x8d')]===_0xdd4f('0x22')?_0xdd4f('0x9b'):_['startCase'](_0xc98189)+'Queues','type':_0x44dfcd['query'][_0xdd4f('0x8d')],'nolimit':!![],'sort':_0xdd4f('0x10'),'filter':_0x44dfcd['query'][_0xdd4f('0x51')]}};return db[_0xdd4f('0x96')][_0xdd4f('0x9c')](_0x3b188a);}return db[_0x40fa28][_0xdd4f('0x9d')](_0x30cee9);})['then'](function(_0x213852){_0x2b5c03[_0xdd4f('0xa')]=_0x213852[_0xdd4f('0xa')];_0x3e8caa=_0x213852['rows'];return getRealtimeQueues(_0x44dfcd,_0xc98189);})[_0xdd4f('0x14')](function(_0x4b445f){_0x3be471=_0x4b445f[_0xdd4f('0x97')];return getRealtimeAgents();})[_0xdd4f('0x14')](function(_0xb7d320){_0x531574=_0xb7d320[_0xdd4f('0x97')];if(_0xc98189!=_0xdd4f('0x21'))return;return getRealtimeVoiceQueueChannels();})[_0xdd4f('0x14')](function(_0x44c6cd){_0x69784=_0x44c6cd?_0x44c6cd[_0xdd4f('0x97')]:[];return initializeQueues(_0x3e8caa,_0x3be471,_0xc98189,_0x44dfcd[_0xdd4f('0x86')][_0xdd4f('0x8d')]);})['then'](function(_0x1cca81){var _0x462066=_0x1cca81[_0xdd4f('0x34')](function(_0x57e7ca){if(_0xc98189==='voice')return getVoiceQueueAgents(_0x57e7ca,_0x3e8caa,_0x531574,_0x69784);else return getQueueAgents(_0x57e7ca,_0x531574,_0xc98189);});return Promise['all'](_0x462066);})[_0xdd4f('0x14')](function(_0x411cab){_0x2b5c03[_0xdd4f('0x97')]=_0x411cab;return _0x2b5c03;})[_0xdd4f('0x14')](respondWithFilteredResult(_0x3d771e,_0x30cee9))[_0xdd4f('0x1b')](handleError(_0x3d771e,null));}; \ No newline at end of file +var _0x38a2=['../../components/parsers/qs','../../config/logger','client','http','offset','undefined','count','limit','set','json','error','name','status','request','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','voice','startCase','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','available','waiting','talking','push','pTalking','originated','message','dialMethod','startPredictive','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','map','get','agents','paused','loggedInDb','loggedIn','find','pick','filter','queue','length','busy','some','internal','toString','getMembers','UserId','accountcode','voiceStatus','online','User','Queue','Pause','QueueId','idle','unknown','ringing','isNil','chatPause','faxPause','mailPause','smsPause','voicePause','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','whatsappStatus','*pause','mail','chat','sms','openchannel','fax','whatsapp','Invalid\x20channel','toLowerCase','isArray','findOne','getAgents','all','flatten','uniq','value','fields','includes','globalStatus','order','startsWith','DESC','sort','pauseType','userpic','lastPauseAt','openchannelPause','chatCapacity','openchannelCapacity','mailCapacity','whatsappCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','smsStatus','mailStatusTime','smsStatusTime','faxStatusTime','voiceStatusTime','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','whatsappPause','resolve','query','channel','join','globalQueueFilter','rawAttributes','type','role','agent','raw','isEmpty','where','user','UserProfile','getResources','rows','omit','globalStatusFilter','pauseTypeFilter','getQueues','getOptions','userProfileId','outbound','QueueCampaigns','Queues','findAndCountAll','util','lodash'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x38a2,0x13e));var _0x238a=function(_0x49744d,_0x25b571){_0x49744d=_0x49744d-0x0;var _0x965d10=_0x38a2[_0x49744d];return _0x965d10;};'use strict';var util=require(_0x238a('0x0'));var _=require(_0x238a('0x1'));var jayson=require('jayson/promise');var qs=require(_0x238a('0x2'));var logger=require(_0x238a('0x3'))('api');var db=require('../../mysqldb')['db'];var amiClient=jayson[_0x238a('0x4')][_0x238a('0x5')]({'port':0x232a});var routingClient=jayson[_0x238a('0x4')][_0x238a('0x5')]({'port':0x232c});function respondWithFilteredResult(_0x565406,_0x47130b){return function(_0x519480){if(_0x519480){var _0x18e43f=typeof _0x47130b[_0x238a('0x6')]===_0x238a('0x7')&&typeof _0x47130b['limit']===_0x238a('0x7');var _0x516621=_0x519480[_0x238a('0x8')];var _0x3f95ad=_0x18e43f?0x0:_0x47130b[_0x238a('0x6')];var _0x5147ea=_0x18e43f?_0x519480['count']:_0x47130b[_0x238a('0x6')]+_0x47130b[_0x238a('0x9')];var _0x2ef925;if(_0x5147ea>=_0x516621){_0x5147ea=_0x516621;_0x2ef925=0xc8;}else{_0x2ef925=0xce;}_0x565406['status'](_0x2ef925);return _0x565406[_0x238a('0xa')]('Content-Range',_0x3f95ad+'-'+_0x5147ea+'/'+_0x516621)[_0x238a('0xb')](_0x519480);}return null;};}function handleError(_0x1ed712,_0x539575){_0x539575=_0x539575||0x1f4;return function(_0x4e179b){logger[_0x238a('0xc')](_0x4e179b['stack']);if(_0x4e179b[_0x238a('0xd')]){delete _0x4e179b[_0x238a('0xd')];}_0x1ed712[_0x238a('0xe')](_0x539575)['send'](_0x4e179b);};}function getRealtimeAgents(){return new Promise(function(_0x1e93e6,_0x3ebe44){return amiClient[_0x238a('0xf')](_0x238a('0x10'),{})[_0x238a('0x11')](function(_0x2a0379){if(_0x2a0379[_0x238a('0xc')])throw new Error(_0x238a('0x12'));var _0x49cada=_0x2a0379[_0x238a('0x13')];return routingClient[_0x238a('0xf')](_0x238a('0x10'),{})[_0x238a('0x11')](function(_0x42de4d){if(_0x42de4d[_0x238a('0xc')])throw new Error(_0x238a('0x14'));var _0x52f7e2=_0x42de4d['result'];return _0x1e93e6(_[_0x238a('0x15')]({},_0x49cada,_0x52f7e2));});})[_0x238a('0x16')](function(_0x582742){_0x3ebe44(_0x582742);});});}function getRealtimeQueues(_0x4165dd,_0x19627e){return new Promise(function(_0x1be8e7,_0x33defe){var _0x14af50=_0x19627e===_0x238a('0x17')?amiClient:routingClient;return _0x14af50['request'](_[_0x238a('0x18')](_0x19627e)+'Queues',_0x4165dd)[_0x238a('0x11')](function(_0x11a691){if(_0x11a691[_0x238a('0xc')])throw new Error(util[_0x238a('0x19')](_0x238a('0x1a'),_0x19627e));return _0x1be8e7(_0x11a691[_0x238a('0x13')]);})[_0x238a('0x16')](function(_0xcdfe5d){_0x33defe(_0xcdfe5d);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x17f506,_0x3fed09){return amiClient['request'](_0x238a('0x1b'),{})[_0x238a('0x11')](function(_0x577296){if(_0x577296[_0x238a('0xc')])throw new Error(_0x238a('0x1c'));return _0x17f506(_0x577296[_0x238a('0x13')]);})['catch'](function(_0x11607e){_0x3fed09(_0x11607e);});});}function initializeQueues(_0x2f4c2f,_0x29e928,_0x59be3f,_0x34929f){var _0x1c8854=['loggedIn',_0x238a('0x1d'),_0x238a('0x1e'),_0x238a('0x1f'),'paused'];if(_0x59be3f===_0x238a('0x17')&&_0x34929f==='outbound'){_0x1c8854[_0x238a('0x20')](_0x238a('0x21'),_0x238a('0x22'),_0x238a('0x23'),'dialActive',_0x238a('0x24'),'Trunk',_0x238a('0x25'),'startProgressive','erlangCalls','erlangCallToSecond',_0x238a('0x26'),_0x238a('0x27'),_0x238a('0x28'),_0x238a('0x29'),_0x238a('0x2a'),_0x238a('0x2b'),'predictiveIntervalTotalCalls',_0x238a('0x2c'),_0x238a('0x2d'),_0x238a('0x2e'),'predictiveIntervalAvgHoldtime',_0x238a('0x2f'));}return _0x2f4c2f[_0x238a('0x30')](function(_0x3f0bfd){var _0x556ada=_0x3f0bfd[_0x238a('0x31')]({'plain':!![]});_0x556ada[_0x238a('0x32')]=[];_0x556ada[_0x238a('0x33')]=0x0;_0x556ada[_0x238a('0x34')]=0x0;_0x556ada[_0x238a('0x35')]=0x0;_0x556ada['available']=0x0;_0x556ada[_0x238a('0x1e')]=0x0;if(_0x59be3f===_0x238a('0x17')){_0x556ada['talking']=0x0;_0x556ada['busy']=0x0;if(_0x34929f==='outbound'){_0x556ada[_0x238a('0x21')]=0x0;_0x556ada[_0x238a('0x22')]=0x0;}}var _0x3fed2d=_[_0x238a('0x36')](_0x29e928,['id',_0x556ada['id']]);if(_0x3fed2d)_[_0x238a('0x15')](_0x556ada,_[_0x238a('0x37')](_0x3fed2d,_0x1c8854));return _0x556ada;});}function updateAgentVoiceStatus(_0x583de9,_0x83e80f,_0x3842dc){var _0x62e284=_[_0x238a('0x38')](_0x3842dc,[_0x238a('0x39'),_0x83e80f['name']]);if(_0x62e284[_0x238a('0x3a')]===0x0)return _0x583de9[_0x238a('0x3b')]=!![];if(_[_0x238a('0x3c')](_0x62e284,['connectedlinenum',_0x583de9[_0x238a('0x3d')][_0x238a('0x3e')]()]))return _0x583de9['talking']=!![];if(!_0x583de9['talking'])return _0x583de9['busy']=!![];}function getVoiceQueueAgents(_0x7a9115,_0x1f0962,_0x35e964,_0x3eb4f3){var _0x50b5e0=_[_0x238a('0x36')](_0x1f0962,['id',_0x7a9115['id']]);if(!_0x50b5e0)return _0x7a9115;return _0x50b5e0[_0x238a('0x3f')]({'raw':!![]})[_0x238a('0x11')](function(_0x474f54){for(var _0x4e8081=0x0;_0x4e8081<_0x474f54['length'];_0x4e8081++){var _0x1da569=_[_0x238a('0x36')](_0x35e964,['id',_0x474f54[_0x4e8081]['UserId']]);if(!_0x1da569){_0x1da569={'id':_0x474f54[_0x4e8081][_0x238a('0x40')],'name':_0x474f54[_0x4e8081][_0x238a('0x40')],'accountcode':'','online':![]};}var _0x521492={'id':_0x1da569['id'],'name':_0x1da569['name'],'internal':_0x1da569[_0x238a('0x41')],'online':Boolean(_0x1da569['online']),'paused':Boolean(_0x474f54[_0x4e8081]['paused'])};if(_0x1da569[_0x238a('0x42')]===_0x238a('0x1f'))updateAgentVoiceStatus(_0x521492,_0x7a9115,_0x3eb4f3);if(_0x521492[_0x238a('0x43')])_0x7a9115[_0x238a('0x34')]++;if(_0x521492[_0x238a('0x3b')])_0x7a9115['busy']++;if(_0x521492['paused']&&!_0x521492[_0x238a('0x3b')]&&!_0x521492[_0x238a('0x1f')])_0x7a9115['paused']++;_0x7a9115[_0x238a('0x32')]['push'](_0x521492);}return _0x7a9115;});}function getQueueAgents(_0x172b00,_0x1e3b07,_0x1bca10){var _0x34f661=_0x238a('0x44')+_[_0x238a('0x18')](_0x1bca10)+_0x238a('0x45');var _0x5ee3c4=_0x1bca10+_0x238a('0x46');return db[_0x34f661]['findAll']({'where':{[_[_0x238a('0x18')](_0x1bca10)+_0x238a('0x47')]:_0x172b00['id']},'raw':!![]})[_0x238a('0x11')](function(_0x2a35ab){for(var _0x3d9003=0x0;_0x3d9003<_0x2a35ab[_0x238a('0x3a')];_0x3d9003++){var _0x7e79d4=_[_0x238a('0x36')](_0x1e3b07,['id',_0x2a35ab[_0x3d9003][_0x238a('0x40')]]);if(!_0x7e79d4){_0x7e79d4={'id':_0x2a35ab[_0x3d9003]['UserId'],'name':_0x2a35ab[_0x3d9003][_0x238a('0x40')],'online':![],['pauseField']:![]};}var _0x10cd6a={'id':_0x7e79d4['id'],'name':_0x7e79d4[_0x238a('0xd')],'online':Boolean(_0x7e79d4['online']),'paused':Boolean(_0x7e79d4[_0x5ee3c4])};if(_0x10cd6a[_0x238a('0x43')])_0x172b00[_0x238a('0x34')]++;_0x172b00[_0x238a('0x32')]['push'](_0x10cd6a);}return _0x172b00;});}function isIdle(_0x2bbc15){return _0x2bbc15===_0x238a('0x48')||_0x2bbc15===_0x238a('0x49')||_0x2bbc15==='unavailable'||_0x2bbc15===_0x238a('0x4a')||_[_0x238a('0x4b')](_0x2bbc15);}function isAgentPaused(_0x5cde1e,_0x335472){var _0x452b45=[_0x5cde1e[_0x238a('0x4c')],_0x5cde1e[_0x238a('0x4d')],_0x5cde1e[_0x238a('0x4e')],_0x5cde1e['openchannelPause'],_0x5cde1e[_0x238a('0x4f')],_0x5cde1e[_0x238a('0x50')],_0x5cde1e['whatsappPause']];if(!_0x335472)return _['every'](_0x452b45);var _0x1a05a3=_[_0x238a('0x38')](_0x452b45);return _0x1a05a3['length']>0x0&&_0x1a05a3[_0x238a('0x3a')]<_0x452b45[_0x238a('0x3a')]?!![]:![];}function isAgentIdle(_0x1061ab){if(_0x1061ab[_0x238a('0x42')]!==_0x238a('0x48')&&_0x1061ab['voicePause']){_0x1061ab[_0x238a('0x42')]=_0x238a('0x51');return![];}return _['every']([_0x1061ab[_0x238a('0x52')],_0x1061ab[_0x238a('0x53')],_0x1061ab[_0x238a('0x54')],_0x1061ab[_0x238a('0x55')],_0x1061ab['smsStatus'],_0x1061ab[_0x238a('0x42')],_0x1061ab[_0x238a('0x56')]],isIdle);}function getAgentStatus(_0x50414d){var _0x2bf2e4=_0x238a('0x49');if(isAgentPaused(_0x50414d))_0x2bf2e4=_0x238a('0x51');else if(isAgentPaused(_0x50414d,!![]))_0x2bf2e4=_0x238a('0x57');else if(isAgentIdle(_0x50414d))_0x2bf2e4=_0x238a('0x48');else _0x2bf2e4='busy';return _0x2bf2e4;}function validateChannel(_0x39fc8d){var _0x408d17=[_0x238a('0x58'),_0x238a('0x59'),_0x238a('0x5a'),_0x238a('0x5b'),_0x238a('0x5c'),_0x238a('0x5d'),_0x238a('0x17')];if(!_['includes'](_0x408d17,_0x39fc8d['toLowerCase']()))throw new Error(_0x238a('0x5e'));return _0x39fc8d[_0x238a('0x5f')]();}function getFilteredAgentIds(_0x5a3d62,_0x4ea171){var _0x475456=_[_0x238a('0x60')](_0x5a3d62)?_0x5a3d62:[_0x5a3d62];var _0x1c63f9=_[_0x238a('0x30')](_0x475456,function(_0x1c4d33){return db[_0x4ea171][_0x238a('0x61')]({'where':{'name':_0x1c4d33}})[_0x238a('0x11')](function(_0x252612){if(!_0x252612)return[];return _0x252612[_0x238a('0x62')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x238a('0x63')](_0x1c63f9)[_0x238a('0x11')](function(_0x1e7529){var _0x38062a=_(_0x1e7529)[_0x238a('0x64')]()['map']('id')[_0x238a('0x65')]()[_0x238a('0x66')]();return _0x38062a;});}function getUpdatedSortOptions(_0x30f28d){var _0xf7f275={'fields':[],'order':null};var _0x38b56d=_0x30f28d['split'](',');_0xf7f275[_0x238a('0x67')]=_['filter'](_0x38b56d,function(_0x2c3e30){if(!_0x2c3e30[_0x238a('0x68')](_0x238a('0x69')))return!![];_0xf7f275[_0x238a('0x6a')]=_[_0x238a('0x6b')](_0x2c3e30,'-')?_0x238a('0x6c'):'ASC';return![];});return _0xf7f275;}function orderAgentsByStatus(_0x4798e8,_0x2ba3ab){return _0x4798e8[_0x238a('0x6d')](function(_0x5419e1,_0x32a99d){if(_0x5419e1[_0x238a('0x69')]===_0x32a99d[_0x238a('0x69')]&&_0x5419e1[_0x238a('0x69')]===_0x238a('0x51')){if(_0x2ba3ab===_0x238a('0x6c'))return(_0x5419e1['pauseType']||'')<(_0x32a99d[_0x238a('0x6e')]||'')?0x1:-0x1;return _0x5419e1[_0x238a('0x6e')]<_0x32a99d[_0x238a('0x6e')]?-0x1:0x1;}else{if(_0x2ba3ab===_0x238a('0x6c'))return _0x5419e1[_0x238a('0x69')]<_0x32a99d[_0x238a('0x69')]?0x1:-0x1;return _0x5419e1[_0x238a('0x69')]<_0x32a99d[_0x238a('0x69')]?-0x1:0x1;}});}exports[_0x238a('0x62')]=function(_0x471789,_0x3cece5){var _0x8e597a={'count':0x0,'rows':[]},_0x26e378={},_0x5f1428,_0x5488c0,_0x464eee,_0x240216,_0x21d3ee=[_0x238a('0x6f'),_0x238a('0x43'),'lastLoginAt',_0x238a('0x70'),_0x238a('0x6e'),'lastPauseAt',_0x238a('0x3d'),'address',_0x238a('0x4c'),_0x238a('0x71'),_0x238a('0x4e'),_0x238a('0x4f'),'whatsappPause',_0x238a('0x4d'),_0x238a('0x50'),_0x238a('0x72'),_0x238a('0x73'),_0x238a('0x74'),'smsCapacity',_0x238a('0x75'),'faxCapacity',_0x238a('0x76'),_0x238a('0x77'),_0x238a('0x78'),_0x238a('0x79'),_0x238a('0x7a'),_0x238a('0x7b'),_0x238a('0x52'),_0x238a('0x55'),'mailStatus',_0x238a('0x7c'),'whatsappStatus','faxStatus',_0x238a('0x42'),'chatStatusTime','openchannelStatusTime',_0x238a('0x7d'),_0x238a('0x7e'),'whatsappStatusTime',_0x238a('0x7f'),_0x238a('0x80'),'queue','destconnectedlinenum',_0x238a('0x81'),_0x238a('0x82'),_0x238a('0x83'),_0x238a('0x84')],_0x25122b=[_0x238a('0x4c'),_0x238a('0x71'),_0x238a('0x4e'),_0x238a('0x4f'),_0x238a('0x85'),'faxPause','voicePause',_0x238a('0x43')];Promise[_0x238a('0x86')]()[_0x238a('0x11')](function(){if(_0x471789[_0x238a('0x87')][_0x238a('0x88')])_0x5f1428=validateChannel(_0x471789['query'][_0x238a('0x88')]);if(!_0x471789[_0x238a('0x87')][_0x238a('0x6d')]||!_0x471789[_0x238a('0x87')][_0x238a('0x6d')][_0x238a('0x68')](_0x238a('0x69')))return;var _0x4e0278=getUpdatedSortOptions(_0x471789[_0x238a('0x87')][_0x238a('0x6d')]);_0x471789[_0x238a('0x87')][_0x238a('0x6d')]=_0x4e0278[_0x238a('0x67')][_0x238a('0x89')](',');_0x5488c0=_0x4e0278['order'];})['then'](function(){if(!_0x471789[_0x238a('0x87')][_0x238a('0x8a')])return[];var _0x41e934=_[_0x238a('0x18')](_0x5f1428)+'Queue';return getFilteredAgentIds(_0x471789[_0x238a('0x87')][_0x238a('0x8a')],_0x41e934);})[_0x238a('0x11')](function(_0x8c9ed9){var _0x353b5a=_[_0x238a('0x30')](db['User'][_0x238a('0x8b')],function(_0x487b87){return{'name':_0x487b87['fieldName'],'type':_0x487b87[_0x238a('0x8c')]['key']};});_0x471789['query'][_0x238a('0x8d')]=_0x238a('0x8e');_0x471789[_0x238a('0x87')][_0x238a('0x43')]=!![];_0x26e378=qs['getOptions'](_0x353b5a,_0x471789);_0x26e378[_0x238a('0x8f')]=!![];if(!_[_0x238a('0x90')](_0x8c9ed9)){_0x26e378[_0x238a('0x91')]=_[_0x238a('0x15')](_0x26e378[_0x238a('0x91')],{'$and':[{'id':{'$in':_0x8c9ed9}}]});}else if(!_[_0x238a('0x90')](_0x471789[_0x238a('0x87')]['globalQueueFilter'])){return _0x8e597a;}if(_0x471789[_0x238a('0x92')][_0x238a('0x8d')]===_0x238a('0x92')){var _0x1e7c33={'params':{'id':_0x471789[_0x238a('0x92')]['userProfileId']},'query':{'section':'Agents','role':_0x238a('0x8e'),'online':!![],'nolimit':_0x471789[_0x238a('0x87')]['nolimit'],'sort':_0x471789['query'][_0x238a('0x6d')],'filter':_0x471789['query']['filter'],'raw':!![],'ids':_0x8c9ed9}};return db[_0x238a('0x93')][_0x238a('0x94')](_0x1e7c33);}return db[_0x238a('0x44')]['findAndCountAll'](_0x26e378);})[_0x238a('0x11')](function(_0xe859bd){_0x8e597a[_0x238a('0x8')]=_0xe859bd[_0x238a('0x8')];_0x464eee=_0xe859bd[_0x238a('0x95')];return getRealtimeAgents();})['then'](function(_0x59598a){_0x240216=_0x59598a[_0x238a('0x95')];return _0x464eee['map'](function(_0x385086){var _0x4a5e34=_['find'](_0x240216,['id',_0x385086['id']]);if(_0x4a5e34)_[_0x238a('0x15')](_0x385086,_[_0x238a('0x37')](_[_0x238a('0x96')](_0x4a5e34,_0x25122b),_0x21d3ee));_0x385086[_0x238a('0x69')]=getAgentStatus(_0x385086);return _0x385086;});})[_0x238a('0x11')](function(_0x3cf3c3){var _0x447080;if(_0x471789['query'][_0x238a('0x97')]){_0x447080=_[_0x238a('0x38')](_0x3cf3c3,[_0x238a('0x69'),_0x471789[_0x238a('0x87')][_0x238a('0x97')]]);if(_0x471789[_0x238a('0x87')]['pauseTypeFilter']){_0x447080=_['filter'](_0x447080,[_0x238a('0x6e'),_0x471789[_0x238a('0x87')][_0x238a('0x98')]]);}}if(_0x447080)_0x3cf3c3=_0x447080;if(!_0x5488c0)return _0x3cf3c3;return orderAgentsByStatus(_0x3cf3c3,_0x5488c0);})[_0x238a('0x11')](function(_0x9e4d75){_0x8e597a[_0x238a('0x95')]=_0x9e4d75;return _0x8e597a;})['then'](respondWithFilteredResult(_0x3cece5,_0x26e378))['catch'](handleError(_0x3cece5,null));};exports[_0x238a('0x99')]=function(_0x469905,_0x451bab){var _0x2e0ab5={'count':0x0,'rows':[]},_0x36ea4c={},_0x353788,_0x1795b9,_0x3bad0c,_0x3afc9d,_0x42a315;Promise['resolve']()[_0x238a('0x11')](function(){if(_0x469905[_0x238a('0x87')][_0x238a('0x88')])_0x353788=validateChannel(_0x469905[_0x238a('0x87')]['channel']);var _0x2bbc00=_['startCase'](_0x353788)+_0x238a('0x45');var _0x55c0f6=_['map'](db[_0x2bbc00]['rawAttributes'],function(_0x87f288){return{'name':_0x87f288['fieldName'],'type':_0x87f288['type']['key']};});_0x36ea4c=qs[_0x238a('0x9a')](_0x55c0f6,_0x469905);if(_0x469905[_0x238a('0x92')]['role']===_0x238a('0x92')){var _0x2752ac={'params':{'id':_0x469905[_0x238a('0x92')][_0x238a('0x9b')]},'query':{'section':_0x353788==='voice'&&_0x469905['query'][_0x238a('0x8c')]===_0x238a('0x9c')?_0x238a('0x9d'):_[_0x238a('0x18')](_0x353788)+_0x238a('0x9e'),'type':_0x469905[_0x238a('0x87')][_0x238a('0x8c')],'nolimit':!![],'sort':_0x238a('0xd'),'filter':_0x469905[_0x238a('0x87')][_0x238a('0x38')]}};return db[_0x238a('0x93')]['getResources'](_0x2752ac);}return db[_0x2bbc00][_0x238a('0x9f')](_0x36ea4c);})[_0x238a('0x11')](function(_0x154178){_0x2e0ab5[_0x238a('0x8')]=_0x154178[_0x238a('0x8')];_0x1795b9=_0x154178[_0x238a('0x95')];return getRealtimeQueues(_0x469905,_0x353788);})[_0x238a('0x11')](function(_0xc0917b){_0x3afc9d=_0xc0917b[_0x238a('0x95')];return getRealtimeAgents();})[_0x238a('0x11')](function(_0x453e7c){_0x3bad0c=_0x453e7c[_0x238a('0x95')];if(_0x353788!=_0x238a('0x17'))return;return getRealtimeVoiceQueueChannels();})[_0x238a('0x11')](function(_0x37d533){_0x42a315=_0x37d533?_0x37d533[_0x238a('0x95')]:[];return initializeQueues(_0x1795b9,_0x3afc9d,_0x353788,_0x469905[_0x238a('0x87')][_0x238a('0x8c')]);})[_0x238a('0x11')](function(_0x6e3ba4){var _0x5efa2e=_0x6e3ba4[_0x238a('0x30')](function(_0x141404){if(_0x353788===_0x238a('0x17'))return getVoiceQueueAgents(_0x141404,_0x1795b9,_0x3bad0c,_0x42a315);else return getQueueAgents(_0x141404,_0x3bad0c,_0x353788);});return Promise[_0x238a('0x63')](_0x5efa2e);})['then'](function(_0x3c8298){_0x2e0ab5[_0x238a('0x95')]=_0x3c8298;return _0x2e0ab5;})[_0x238a('0x11')](respondWithFilteredResult(_0x451bab,_0x36ea4c))[_0x238a('0x16')](handleError(_0x451bab,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 1547c0f..1a9085f 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x549755,_0x52eabb){var _0x5dfaf5=function(_0xda8259){while(--_0xda8259){_0x549755['push'](_0x549755['shift']());}};_0x5dfaf5(++_0x52eabb);}(_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(_0x301cff,_0x55d2c2){var _0x42075c=function(_0x1b0b24){while(--_0x1b0b24){_0x301cff['push'](_0x301cff['shift']());}};_0x42075c(++_0x55d2c2);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x487496,_0x249683){_0x487496=_0x487496-0x0;var _0x539dc8=_0xcb91[_0x487496];return _0x539dc8;};'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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 150223b..5d2335c 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 _0xc15b=['sequelize','INTEGER','STRING','DATE'];(function(_0x6c5501,_0x44fdf0){var _0x102875=function(_0x459144){while(--_0x459144){_0x6c5501['push'](_0x6c5501['shift']());}};_0x102875(++_0x44fdf0);}(_0xc15b,0xe4));var _0xbc15=function(_0x420b24,_0x382adc){_0x420b24=_0x420b24-0x0;var _0x4da552=_0xc15b[_0x420b24];return _0x4da552;};'use strict';var Sequelize=require(_0xbc15('0x0'));module['exports']={'state':{'type':Sequelize[_0xbc15('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xbc15('0x2')]},'scheduledat':{'type':Sequelize[_0xbc15('0x3')]},'uniqueid':{'type':Sequelize[_0xbc15('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xbc15('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xbc15('0x2')]},'campaigntype':{'type':Sequelize[_0xbc15('0x2')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5785=['DATE','sequelize','exports','INTEGER','STRING'];(function(_0x483195,_0x5d7fa4){var _0x533ad4=function(_0x3554f9){while(--_0x3554f9){_0x483195['push'](_0x483195['shift']());}};_0x533ad4(++_0x5d7fa4);}(_0x5785,0x119));var _0x5578=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0x5785[_0x42bc91];return _0x3f5507;};'use strict';var Sequelize=require(_0x5578('0x0'));module[_0x5578('0x1')]={'state':{'type':Sequelize[_0x5578('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x5578('0x3')]},'scheduledat':{'type':Sequelize[_0x5578('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x5578('0x4')]},'responsetime':{'type':Sequelize[_0x5578('0x4')]},'ringtime':{'type':Sequelize[_0x5578('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x5578('0x3')]},'campaigntype':{'type':Sequelize[_0x5578('0x3')]},'membername':{'type':Sequelize[_0x5578('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 055248f..45b4772 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 _0xc810=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ReportAgentPreview'];(function(_0x3540de,_0x17623d){var _0x2acc29=function(_0x5e0315){while(--_0x5e0315){_0x3540de['push'](_0x3540de['shift']());}};_0x2acc29(++_0x17623d);}(_0xc810,0x68));var _0x0c81=function(_0x40ae56,_0x5a0aa6){_0x40ae56=_0x40ae56-0x0;var _0x455d4f=_0xc810[_0x40ae56];return _0x455d4f;};'use strict';var _=require(_0x0c81('0x0'));var util=require(_0x0c81('0x1'));var logger=require(_0x0c81('0x2'))(_0x0c81('0x3'));var moment=require(_0x0c81('0x4'));var BPromise=require(_0x0c81('0x5'));var rp=require(_0x0c81('0x6'));var fs=require('fs');var path=require(_0x0c81('0x7'));var rimraf=require(_0x0c81('0x8'));var config=require(_0x0c81('0x9'));var attributes=require('./reportAgentPreview.attributes');module[_0x0c81('0xa')]=function(_0x5dce7c,_0x37a8a8){return _0x5dce7c[_0x0c81('0xb')](_0x0c81('0xc'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd841=['request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','lodash','util','../../config/logger','api','moment'];(function(_0xae3d21,_0x2af34f){var _0x61a7a6=function(_0x45fd8f){while(--_0x45fd8f){_0xae3d21['push'](_0xae3d21['shift']());}};_0x61a7a6(++_0x2af34f);}(_0xd841,0xa4));var _0x1d84=function(_0x5c7385,_0x4f76f5){_0x5c7385=_0x5c7385-0x0;var _0x4d289b=_0xd841[_0x5c7385];return _0x4d289b;};'use strict';var _=require(_0x1d84('0x0'));var util=require(_0x1d84('0x1'));var logger=require(_0x1d84('0x2'))(_0x1d84('0x3'));var moment=require(_0x1d84('0x4'));var BPromise=require('bluebird');var rp=require(_0x1d84('0x5'));var fs=require('fs');var path=require(_0x1d84('0x6'));var rimraf=require(_0x1d84('0x7'));var config=require(_0x1d84('0x8'));var attributes=require(_0x1d84('0x9'));module[_0x1d84('0xa')]=function(_0x34ef87,_0xa93533){return _0x34ef87[_0x1d84('0xb')](_0x1d84('0xc'),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 2878c53..e49e00c 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 _0x6da3=['../../config/utils','rpc','jayson/promise','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x510e2e,_0x152551){var _0x52a3d0=function(_0x387cfc){while(--_0x387cfc){_0x510e2e['push'](_0x510e2e['shift']());}};_0x52a3d0(++_0x152551);}(_0x6da3,0x77));var _0x36da=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x6da3[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x36da('0x0'));var util=require(_0x36da('0x1'));var moment=require('moment');var BPromise=require(_0x36da('0x2'));var rs=require(_0x36da('0x3'));var fs=require('fs');var Redis=require(_0x36da('0x4'));var db=require(_0x36da('0x5'))['db'];var utils=require(_0x36da('0x6'));var logger=require('../../config/logger')(_0x36da('0x7'));var config=require('../../config/environment');var jayson=require(_0x36da('0x8'));var client=jayson['client'][_0x36da('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ef464,_0x2919c4,_0x4fe516){return new BPromise(function(_0x287a6e,_0x3902ed){return client[_0x36da('0xa')](_0x4ef464,_0x4fe516)[_0x36da('0xb')](function(_0x3e06d0){logger[_0x36da('0xc')](_0x36da('0xd'),_0x2919c4,_0x36da('0xe'));logger['debug'](_0x36da('0xf'),_0x2919c4,_0x36da('0xe'),JSON['stringify'](_0x3e06d0));if(_0x3e06d0[_0x36da('0x10')]){if(_0x3e06d0['error']['code']===0x1f4){logger[_0x36da('0x10')](_0x36da('0xd'),_0x2919c4,_0x3e06d0[_0x36da('0x10')][_0x36da('0x11')]);return _0x3902ed(_0x3e06d0[_0x36da('0x10')][_0x36da('0x11')]);}logger[_0x36da('0x10')](_0x36da('0xd'),_0x2919c4,_0x3e06d0[_0x36da('0x10')][_0x36da('0x11')]);return _0x287a6e(_0x3e06d0['error'][_0x36da('0x11')]);}else{logger[_0x36da('0xc')](_0x36da('0xd'),_0x2919c4,_0x36da('0xe'));_0x287a6e(_0x3e06d0[_0x36da('0x12')][_0x36da('0x11')]);}})[_0x36da('0x13')](function(_0x4cb035){logger[_0x36da('0x10')](_0x36da('0xd'),_0x2919c4,_0x4cb035);_0x3902ed(_0x4cb035);});});}exports[_0x36da('0x14')]=function(_0x27778c){var _0x4cb7f1=this;return new Promise(function(_0x11a528,_0x3436c4){return db[_0x36da('0x15')]['create'](_0x27778c[_0x36da('0x16')],{'raw':_0x27778c[_0x36da('0x17')]?_0x27778c['options'][_0x36da('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x513f6a){logger[_0x36da('0xc')](_0x36da('0x14'),_0x27778c);logger['debug'](_0x36da('0x14'),_0x27778c,JSON['stringify'](_0x513f6a));_0x11a528(_0x513f6a);})[_0x36da('0x13')](function(_0x4cbc77){logger[_0x36da('0x10')]('CreateReportAgentPreview',_0x4cbc77[_0x36da('0x11')],_0x27778c);_0x3436c4(_0x4cb7f1[_0x36da('0x10')](0x1f4,_0x4cbc77[_0x36da('0x11')]));});});}; \ No newline at end of file +var _0x114c=['CreateReportAgentPreview','ReportAgentPreview','options','raw','info','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','http','request','then','ReportAgentPreview,\x20%s,\x20%s','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch'];(function(_0x513545,_0x158f2e){var _0x18b7c5=function(_0x58514c){while(--_0x58514c){_0x513545['push'](_0x513545['shift']());}};_0x18b7c5(++_0x158f2e);}(_0x114c,0x1e5));var _0xc114=function(_0x50c241,_0x30d4a4){_0x50c241=_0x50c241-0x0;var _0x2b7ea6=_0x114c[_0x50c241];return _0x2b7ea6;};'use strict';var _=require(_0xc114('0x0'));var util=require(_0xc114('0x1'));var moment=require(_0xc114('0x2'));var BPromise=require(_0xc114('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc114('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc114('0x5'));var logger=require(_0xc114('0x6'))('rpc');var config=require(_0xc114('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc114('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x35c384,_0x5a1169,_0x276611){return new BPromise(function(_0xc377c8,_0x154080){return client[_0xc114('0x9')](_0x35c384,_0x276611)[_0xc114('0xa')](function(_0x2f4eb1){logger['info'](_0xc114('0xb'),_0x5a1169,'request\x20sent');logger['debug'](_0xc114('0xc'),_0x5a1169,'request\x20sent',JSON[_0xc114('0xd')](_0x2f4eb1));if(_0x2f4eb1[_0xc114('0xe')]){if(_0x2f4eb1[_0xc114('0xe')][_0xc114('0xf')]===0x1f4){logger['error'](_0xc114('0xb'),_0x5a1169,_0x2f4eb1['error'][_0xc114('0x10')]);return _0x154080(_0x2f4eb1[_0xc114('0xe')][_0xc114('0x10')]);}logger[_0xc114('0xe')](_0xc114('0xb'),_0x5a1169,_0x2f4eb1['error'][_0xc114('0x10')]);return _0xc377c8(_0x2f4eb1[_0xc114('0xe')][_0xc114('0x10')]);}else{logger['info'](_0xc114('0xb'),_0x5a1169,_0xc114('0x11'));_0xc377c8(_0x2f4eb1['result'][_0xc114('0x10')]);}})[_0xc114('0x12')](function(_0x3052ab){logger[_0xc114('0xe')](_0xc114('0xb'),_0x5a1169,_0x3052ab);_0x154080(_0x3052ab);});});}exports[_0xc114('0x13')]=function(_0x95f4f8){var _0x57bc15=this;return new Promise(function(_0x1ac350,_0x456a30){return db[_0xc114('0x14')]['create'](_0x95f4f8['body'],{'raw':_0x95f4f8[_0xc114('0x15')]?_0x95f4f8[_0xc114('0x15')][_0xc114('0x16')]===undefined?!![]:![]:!![]})[_0xc114('0xa')](function(_0x157cdb){logger[_0xc114('0x17')]('CreateReportAgentPreview',_0x95f4f8);logger['debug'](_0xc114('0x13'),_0x95f4f8,JSON[_0xc114('0xd')](_0x157cdb));_0x1ac350(_0x157cdb);})[_0xc114('0x12')](function(_0x2e5f33){logger[_0xc114('0xe')](_0xc114('0x13'),_0x2e5f33[_0xc114('0x10')],_0x95f4f8);_0x456a30(_0x57bc15[_0xc114('0xe')](0x1f4,_0x2e5f33['message']));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index b0aa972..3f5ef1a 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 _0x567a=['isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','voiceQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','openchannelQueues','/sms/queues','whatsappQueues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','showVoiceQueues','/voice/queues/:id','/outbound','outbound','/outbound/channels','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','/mail/queues/:id','showMailQueues','post','queueNotify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','showFaxQueues','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','whatsapp','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','exports','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','/voice/channels','voiceChannels','get','/voice/channels/:uniqueid/mixmonitor'];(function(_0xd3fef3,_0x378e6c){var _0x3809bc=function(_0x11a6e1){while(--_0x11a6e1){_0xd3fef3['push'](_0xd3fef3['shift']());}};_0x3809bc(++_0x378e6c);}(_0x567a,0x8d));var _0xa567=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x567a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xa567('0x0'));var util=require(_0xa567('0x1'));var path=require(_0xa567('0x2'));var express=require(_0xa567('0x3'));var router=express[_0xa567('0x4')]();var auth=require(_0xa567('0x5'));var controller=require(_0xa567('0x6'));router['get'](_0xa567('0x7'),auth['isAuthenticated'](),controller[_0xa567('0x8')]);router[_0xa567('0x9')](_0xa567('0xa'),auth[_0xa567('0xb')](),controller[_0xa567('0xc')]);router[_0xa567('0x9')](_0xa567('0xd'),auth[_0xa567('0xb')](),controller['voiceChannelStopMixMonitor']);router['get'](_0xa567('0xe'),auth['isAuthenticated'](),controller[_0xa567('0xf')]);router['get']('/chat/queues',auth[_0xa567('0xb')](),controller['chatQueues']);router[_0xa567('0x9')](_0xa567('0x10'),auth[_0xa567('0xb')](),controller[_0xa567('0x11')]);router['get'](_0xa567('0x12'),auth[_0xa567('0xb')](),controller[_0xa567('0x13')]);router['get']('/openchannel/queues',auth[_0xa567('0xb')](),controller[_0xa567('0x14')]);router['get'](_0xa567('0x15'),auth[_0xa567('0xb')](),controller['smsQueues']);router[_0xa567('0x9')]('/whatsapp/queues',auth['isAuthenticated'](),controller[_0xa567('0x16')]);router[_0xa567('0x9')]('/fax/queues',auth['isAuthenticated'](),controller[_0xa567('0x17')]);router[_0xa567('0x9')](_0xa567('0x18'),auth['isAuthenticated'](),controller[_0xa567('0x19')]);router[_0xa567('0x9')]('/voice/queues/channels',auth[_0xa567('0xb')](),controller[_0xa567('0x1a')]);router[_0xa567('0x9')](_0xa567('0x1b'),auth[_0xa567('0xb')](),controller[_0xa567('0x1c')]);router['get']('/voice/queues/channels/:uniqueid/hangup',auth[_0xa567('0xb')](),controller[_0xa567('0x1d')]);router[_0xa567('0x9')](_0xa567('0x1e'),auth['isAuthenticated'](),controller[_0xa567('0x1f')]);router[_0xa567('0x9')]('/voice/queues/:id',auth[_0xa567('0xb')](),controller[_0xa567('0x20')]);router['put'](_0xa567('0x21'),auth[_0xa567('0xb')](),controller['updateVoiceQueue']);router[_0xa567('0x9')](_0xa567('0x22'),auth['isAuthenticated'](),controller[_0xa567('0x23')]);router[_0xa567('0x9')](_0xa567('0x24'),auth[_0xa567('0xb')](),controller['outboundChannels']);router[_0xa567('0x9')]('/agents',auth[_0xa567('0xb')](),controller[_0xa567('0x25')]);router['put'](_0xa567('0x26'),auth[_0xa567('0xb')](),controller[_0xa567('0x27')]);router[_0xa567('0x9')](_0xa567('0x28'),auth[_0xa567('0xb')](),controller[_0xa567('0x29')]);router[_0xa567('0x9')](_0xa567('0x2a'),auth['isAuthenticated'](),controller[_0xa567('0x2b')]);router['get'](_0xa567('0x2c'),auth[_0xa567('0xb')](),controller['campaigns']);router[_0xa567('0x9')](_0xa567('0x2d'),auth[_0xa567('0xb')](),controller[_0xa567('0x2e')]);router[_0xa567('0x9')](_0xa567('0x2f'),auth[_0xa567('0xb')](),controller['chatQueuesWaitingInteractions']);router[_0xa567('0x9')]('/mail/queues/waitinginteractions',auth[_0xa567('0xb')](),controller['mailQueuesWaitingInteractions']);router[_0xa567('0x9')](_0xa567('0x30'),auth[_0xa567('0xb')](),controller['openchannelQueuesWaitingInteractions']);router[_0xa567('0x9')](_0xa567('0x31'),auth[_0xa567('0xb')](),controller[_0xa567('0x32')]);router[_0xa567('0x9')](_0xa567('0x33'),auth[_0xa567('0xb')](),controller['smsQueuesWaitingInteractions']);router[_0xa567('0x9')](_0xa567('0x34'),auth['isAuthenticated'](),controller[_0xa567('0x35')]);router[_0xa567('0x9')](_0xa567('0x36'),auth[_0xa567('0xb')](),controller[_0xa567('0x37')]);router['post'](_0xa567('0x38'),auth['isAuthenticated'](),controller['queueNotify']('mail'));router['get'](_0xa567('0x39'),auth[_0xa567('0xb')](),controller[_0xa567('0x3a')]);router[_0xa567('0x3b')]('/chat/queues/:id/notify',auth[_0xa567('0xb')](),controller[_0xa567('0x3c')](_0xa567('0x3d')));router['get'](_0xa567('0x3e'),auth[_0xa567('0xb')](),controller[_0xa567('0x3f')]);router[_0xa567('0x3b')](_0xa567('0x40'),auth['isAuthenticated'](),controller[_0xa567('0x3c')](_0xa567('0x41')));router[_0xa567('0x9')]('/fax/queues/:id',auth[_0xa567('0xb')](),controller[_0xa567('0x42')]);router[_0xa567('0x3b')]('/openchannel/queues/:id/notify',auth[_0xa567('0xb')](),controller['queueNotify'](_0xa567('0x43')));router[_0xa567('0x9')](_0xa567('0x44'),auth[_0xa567('0xb')](),controller[_0xa567('0x45')]);router[_0xa567('0x3b')](_0xa567('0x46'),auth[_0xa567('0xb')](),controller[_0xa567('0x3c')]('sms'));router[_0xa567('0x3b')]('/whatsapp/queues/:id/notify',auth[_0xa567('0xb')](),controller['queueNotify'](_0xa567('0x47')));router[_0xa567('0x9')]('/sms/queues/:id',auth[_0xa567('0xb')](),controller['showSmsQueues']);router[_0xa567('0x9')](_0xa567('0x48'),auth[_0xa567('0xb')](),controller[_0xa567('0x49')]);router['post'](_0xa567('0x4a'),auth['isAuthenticated'](),controller['agentNotify']);module[_0xa567('0x4b')]=router; \ No newline at end of file +var _0x347b=['/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','Router','get','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','/mail/queues','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','whatsappQueues','/fax/queues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','outbound','/outbound/channels','/agents','agents','agentCapacity','/telephones','telephones','/trunks','campaigns','faxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','post','/mail/queues/:id/notify','mail','showMailQueues','queueNotify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x347b,0x12f));var _0xb347=function(_0x29631f,_0xdb767){_0x29631f=_0x29631f-0x0;var _0x486d87=_0x347b[_0x29631f];return _0x486d87;};'use strict';var multer=require(_0xb347('0x0'));var util=require(_0xb347('0x1'));var path=require('path');var express=require('express');var router=express[_0xb347('0x2')]();var auth=require('../../components/auth/service');var controller=require('./rpc.controller');router[_0xb347('0x3')]('/voice/channels',auth[_0xb347('0x4')](),controller[_0xb347('0x5')]);router[_0xb347('0x3')](_0xb347('0x6'),auth['isAuthenticated'](),controller[_0xb347('0x7')]);router[_0xb347('0x3')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0xb347('0x4')](),controller[_0xb347('0x8')]);router['get'](_0xb347('0x9'),auth['isAuthenticated'](),controller[_0xb347('0xa')]);router[_0xb347('0x3')](_0xb347('0xb'),auth[_0xb347('0x4')](),controller['chatQueues']);router[_0xb347('0x3')](_0xb347('0xc'),auth[_0xb347('0x4')](),controller['mailQueues']);router['get']('/mail/accounts',auth[_0xb347('0x4')](),controller['mailAccounts']);router[_0xb347('0x3')](_0xb347('0xd'),auth[_0xb347('0x4')](),controller[_0xb347('0xe')]);router[_0xb347('0x3')](_0xb347('0xf'),auth[_0xb347('0x4')](),controller[_0xb347('0x10')]);router[_0xb347('0x3')]('/whatsapp/queues',auth[_0xb347('0x4')](),controller[_0xb347('0x11')]);router[_0xb347('0x3')](_0xb347('0x12'),auth['isAuthenticated'](),controller['faxQueues']);router[_0xb347('0x3')](_0xb347('0x13'),auth[_0xb347('0x4')](),controller[_0xb347('0x14')]);router['get'](_0xb347('0x15'),auth[_0xb347('0x4')](),controller['voiceQueuesChannels']);router[_0xb347('0x3')](_0xb347('0x16'),auth[_0xb347('0x4')](),controller[_0xb347('0x17')]);router[_0xb347('0x3')](_0xb347('0x18'),auth[_0xb347('0x4')](),controller['voiceQueuesChannelHangup']);router[_0xb347('0x3')](_0xb347('0x19'),auth[_0xb347('0x4')](),controller[_0xb347('0x1a')]);router['get'](_0xb347('0x1b'),auth['isAuthenticated'](),controller[_0xb347('0x1c')]);router[_0xb347('0x1d')](_0xb347('0x1b'),auth['isAuthenticated'](),controller[_0xb347('0x1e')]);router[_0xb347('0x3')]('/outbound',auth[_0xb347('0x4')](),controller[_0xb347('0x1f')]);router[_0xb347('0x3')](_0xb347('0x20'),auth['isAuthenticated'](),controller['outboundChannels']);router[_0xb347('0x3')](_0xb347('0x21'),auth['isAuthenticated'](),controller[_0xb347('0x22')]);router[_0xb347('0x1d')]('/agents/:id/capacity',auth[_0xb347('0x4')](),controller[_0xb347('0x23')]);router[_0xb347('0x3')](_0xb347('0x24'),auth[_0xb347('0x4')](),controller[_0xb347('0x25')]);router[_0xb347('0x3')](_0xb347('0x26'),auth[_0xb347('0x4')](),controller['trunks']);router[_0xb347('0x3')]('/campaigns',auth['isAuthenticated'](),controller[_0xb347('0x27')]);router[_0xb347('0x3')]('/fax/accounts',auth[_0xb347('0x4')](),controller[_0xb347('0x28')]);router[_0xb347('0x3')]('/chat/queues/waitinginteractions',auth[_0xb347('0x4')](),controller[_0xb347('0x29')]);router[_0xb347('0x3')]('/mail/queues/waitinginteractions',auth[_0xb347('0x4')](),controller[_0xb347('0x2a')]);router['get'](_0xb347('0x2b'),auth[_0xb347('0x4')](),controller[_0xb347('0x2c')]);router[_0xb347('0x3')](_0xb347('0x2d'),auth[_0xb347('0x4')](),controller[_0xb347('0x2e')]);router[_0xb347('0x3')](_0xb347('0x2f'),auth[_0xb347('0x4')](),controller[_0xb347('0x30')]);router[_0xb347('0x3')](_0xb347('0x31'),auth['isAuthenticated'](),controller[_0xb347('0x32')]);router[_0xb347('0x3')](_0xb347('0x33'),auth[_0xb347('0x4')](),controller['faxQueuesWaitingInteractions']);router[_0xb347('0x34')](_0xb347('0x35'),auth[_0xb347('0x4')](),controller['queueNotify'](_0xb347('0x36')));router['get']('/mail/queues/:id',auth['isAuthenticated'](),controller[_0xb347('0x37')]);router['post']('/chat/queues/:id/notify',auth[_0xb347('0x4')](),controller[_0xb347('0x38')](_0xb347('0x39')));router[_0xb347('0x3')](_0xb347('0x3a'),auth[_0xb347('0x4')](),controller[_0xb347('0x3b')]);router['post'](_0xb347('0x3c'),auth[_0xb347('0x4')](),controller['queueNotify']('fax'));router['get']('/fax/queues/:id',auth[_0xb347('0x4')](),controller[_0xb347('0x3d')]);router[_0xb347('0x34')](_0xb347('0x3e'),auth['isAuthenticated'](),controller['queueNotify']('openchannel'));router[_0xb347('0x3')](_0xb347('0x3f'),auth[_0xb347('0x4')](),controller['showOpenchannelQueues']);router[_0xb347('0x34')](_0xb347('0x40'),auth['isAuthenticated'](),controller[_0xb347('0x38')](_0xb347('0x41')));router['post'](_0xb347('0x42'),auth[_0xb347('0x4')](),controller[_0xb347('0x38')]('whatsapp'));router[_0xb347('0x3')](_0xb347('0x43'),auth[_0xb347('0x4')](),controller[_0xb347('0x44')]);router['get'](_0xb347('0x45'),auth['isAuthenticated'](),controller[_0xb347('0x46')]);router[_0xb347('0x34')](_0xb347('0x47'),auth[_0xb347('0x4')](),controller[_0xb347('0x48')]);module[_0xb347('0x49')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 6ecfed5..614972f 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 _0x6aa7=['rows','find','VoiceChannels','query','then','voiceChannelMixMonitor','VoiceChannelMixMonitor','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','merge','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','hasOwnProperty','MemberReport','findAll','user','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','findOrCreate','interface','SIP/%s','agent','internal','AgentCapacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','showChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','FaxQueues','showFaxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','queue_id','uniq','value','indexOf','filter','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','Website','Account','Queue','\x20Queue\x20not\x20found','Message','messageId','\x20Message\x20not\x20found','update','Interaction','queue','MessageId','InteractionId','From','TransferReport','create','Start','*,*,*,*','channel','Channel\x20field\x20is\x20mandatory','capitalize','chat','User','findOne','Agent\x20not\x20found','agentTransferTimeout','bluebird','lodash','util','../../mysqldb','../../config/logger','jayson/promise','client','http','request','error','code','message','result','catch','status','json','sendStatus','name','send','isNil'];(function(_0x4102f9,_0x47ff76){var _0x2d3ebc=function(_0x2ede38){while(--_0x2ede38){_0x4102f9['push'](_0x4102f9['shift']());}};_0x2d3ebc(++_0x47ff76);}(_0x6aa7,0x178));var _0x76aa=function(_0x3b09a0,_0x5d7fd1){_0x3b09a0=_0x3b09a0-0x0;var _0x3c7e7f=_0x6aa7[_0x3b09a0];return _0x3c7e7f;};'use strict';var BPromise=require(_0x76aa('0x0'));var moment=require('moment');var _=require(_0x76aa('0x1'));var util=require(_0x76aa('0x2'));var db=require(_0x76aa('0x3'))['db'];var logger=require(_0x76aa('0x4'))('api');var jayson=require(_0x76aa('0x5'));var amiClient=jayson[_0x76aa('0x6')][_0x76aa('0x7')]({'port':0x232a});var mailClient=jayson['client']['http']({'port':0x232b});var routingClient=jayson[_0x76aa('0x6')]['http']({'port':0x232c});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){var _0x266bd5=_0xa9b695?_0xa9b695:amiClient;return _0x266bd5[_0x76aa('0x8')](_0x32dee5,_0x36d12b)['then'](function(_0xcd99aa){if(_0xcd99aa[_0x76aa('0x9')]){if(_0xcd99aa[_0x76aa('0x9')][_0x76aa('0xa')]===0x1f4){return _0x3dae33(_0xcd99aa[_0x76aa('0x9')][_0x76aa('0xb')]);}return _0x56d6bc(_0xcd99aa[_0x76aa('0x9')][_0x76aa('0xb')]);}else{_0x56d6bc(_0xcd99aa[_0x76aa('0xc')]);}})[_0x76aa('0xd')](function(_0x5e5f47){_0x3dae33(_0x5e5f47);});});}function respondWithResult(_0x112c39,_0x5df49c){_0x5df49c=_0x5df49c||0xc8;return function(_0x226536){if(_0x226536){return _0x112c39[_0x76aa('0xe')](_0x5df49c)[_0x76aa('0xf')](_0x226536);}return _0x112c39[_0x76aa('0x10')](0x194);};}function handleError(_0x10432c,_0x4e309f){_0x4e309f=_0x4e309f||0x1f4;return function(_0x5f5b59){logger[_0x76aa('0x9')](_0x5f5b59['stack']);if(_0x5f5b59[_0x76aa('0x11')]){delete _0x5f5b59[_0x76aa('0x11')];}_0x10432c['status'](_0x4e309f)[_0x76aa('0x12')](_0x5f5b59);};}function findById(_0x550d9a){return function(_0x328381){if(!_['isNil'](_0x550d9a)&&!_[_0x76aa('0x13')](_0x328381)&&!_[_0x76aa('0x13')](_0x328381[_0x76aa('0x14')])){return _[_0x76aa('0x15')](_0x328381[_0x76aa('0x14')],function(_0x3ead3f){return _0x3ead3f['id']==_0x550d9a;});}return null;};}exports['voiceChannels']=function(_0x5d6202,_0x256636){return respondWithRpcPromise(_0x76aa('0x16'),_0x5d6202[_0x76aa('0x17')])[_0x76aa('0x18')](respondWithResult(_0x256636,null))[_0x76aa('0xd')](handleError(_0x256636,null));};exports[_0x76aa('0x19')]=function(_0x19af92,_0x2eaf48){return respondWithRpcPromise(_0x76aa('0x1a'),_['merge'](_0x19af92[_0x76aa('0x17')],_0x19af92[_0x76aa('0x1b')]))[_0x76aa('0x18')](respondWithResult(_0x2eaf48,null))['catch'](handleError(_0x2eaf48,null));};exports[_0x76aa('0x1c')]=function(_0x189cb6,_0x31252f){return respondWithRpcPromise(_0x76aa('0x1d'),_[_0x76aa('0x1e')](_0x189cb6[_0x76aa('0x17')],_0x189cb6[_0x76aa('0x1b')]))[_0x76aa('0x18')](respondWithResult(_0x31252f,null))[_0x76aa('0xd')](handleError(_0x31252f,null));};exports[_0x76aa('0x1f')]=function(_0x37f1ab,_0x26b75e){return respondWithRpcPromise(_0x76aa('0x20'),_0x37f1ab['query'])[_0x76aa('0x18')](respondWithResult(_0x26b75e,null))[_0x76aa('0xd')](handleError(_0x26b75e,null));};exports[_0x76aa('0x21')]=function(_0x2e7ab4,_0xa1e6){return respondWithRpcPromise(_0x76aa('0x20'),_0x2e7ab4[_0x76aa('0x17')])[_0x76aa('0x18')](findById(_0x2e7ab4[_0x76aa('0x1b')]['id']))[_0x76aa('0x18')](respondWithResult(_0xa1e6,null))['catch'](handleError(_0xa1e6,null));};exports[_0x76aa('0x22')]=function(_0x5a8030,_0x994550){return respondWithRpcPromise(_0x76aa('0x23'),_[_0x76aa('0x1e')](_0x5a8030[_0x76aa('0x24')],_0x5a8030[_0x76aa('0x1b')]))[_0x76aa('0x18')](respondWithResult(_0x994550,null))[_0x76aa('0xd')](handleError(_0x994550,null));};exports[_0x76aa('0x25')]=function(_0x19fd4f,_0x3ea05a){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x76aa('0x1e')](_0x19fd4f[_0x76aa('0x17')],_0x19fd4f[_0x76aa('0x1b')]))[_0x76aa('0x18')](respondWithResult(_0x3ea05a,null))[_0x76aa('0xd')](handleError(_0x3ea05a,null));};exports[_0x76aa('0x26')]=function(_0x35a705,_0x4eb57a){return respondWithRpcPromise(_0x76aa('0x27'),_0x35a705[_0x76aa('0x17')])['then'](respondWithResult(_0x4eb57a,null))[_0x76aa('0xd')](handleError(_0x4eb57a,null));};exports['voiceQueuesChannel']=function(_0x2e2ba3,_0x4c90b6){return respondWithRpcPromise(_0x76aa('0x28'),_['merge'](_0x2e2ba3['query'],_0x2e2ba3[_0x76aa('0x1b')]))[_0x76aa('0x18')](respondWithResult(_0x4c90b6,null))[_0x76aa('0xd')](handleError(_0x4c90b6,null));};exports[_0x76aa('0x29')]=function(_0x595a0f,_0x592596){return respondWithRpcPromise(_0x76aa('0x2a'),_[_0x76aa('0x1e')](_0x595a0f[_0x76aa('0x17')],_0x595a0f[_0x76aa('0x1b')]))[_0x76aa('0x18')](respondWithResult(_0x592596,null))['catch'](handleError(_0x592596,null));};exports[_0x76aa('0x2b')]=function(_0x5c77f1,_0x5086f5){return respondWithRpcPromise(_0x76aa('0x2c'),_[_0x76aa('0x1e')](_0x5c77f1[_0x76aa('0x17')],_0x5c77f1[_0x76aa('0x1b')]))['then'](respondWithResult(_0x5086f5,null))[_0x76aa('0xd')](handleError(_0x5086f5,null));};exports[_0x76aa('0x2d')]=function(_0x2eea79,_0x4e131a){return respondWithRpcPromise(_0x76aa('0x2e'),_0x2eea79[_0x76aa('0x17')])[_0x76aa('0x18')](respondWithResult(_0x4e131a,null))[_0x76aa('0xd')](handleError(_0x4e131a,null));};exports[_0x76aa('0x2f')]=function(_0x982e62,_0x878903){return respondWithRpcPromise(_0x76aa('0x30'),_0x982e62[_0x76aa('0x17')])['then'](respondWithResult(_0x878903,null))[_0x76aa('0xd')](handleError(_0x878903,null));};exports[_0x76aa('0x31')]=function(_0x4a5a96,_0xa824e8){var _0x64612e;return respondWithRpcPromise(_0x76aa('0x32'),_0x4a5a96['query'])['then'](function(_0x153a47){_0x64612e=_0x153a47;return respondWithRpcPromise(_0x76aa('0x32'),_0x4a5a96[_0x76aa('0x17')],routingClient);})[_0x76aa('0x18')](function(_0x50599f){return _[_0x76aa('0x1e')]({},_0x50599f,_0x64612e);})[_0x76aa('0x18')](respondWithResult(_0xa824e8,null))[_0x76aa('0xd')](handleError(_0xa824e8,null));};exports[_0x76aa('0x33')]=function(_0x1138b5,_0x4aa2f3){if(_0x1138b5[_0x76aa('0x24')]&&_0x1138b5['body'][_0x76aa('0x34')]&&_0x1138b5['user']&&_0x1138b5['user']['name']){for(var _0x144f0a in _0x1138b5['body']['interaction']){if(_0x1138b5['body'][_0x76aa('0x34')][_0x76aa('0x35')](_0x144f0a)){db[_0x76aa('0x36')][_0x76aa('0x37')]({'where':{'channel':_0x144f0a,'membername':_0x1138b5[_0x76aa('0x38')]['name'],'type':_0x76aa('0x39'),'exitAt':null,'uniqueid':_0x1138b5[_0x76aa('0x24')][_0x76aa('0x34')][_0x144f0a]&&_0x1138b5[_0x76aa('0x24')][_0x76aa('0x34')][_0x144f0a]['length']?{'$notIn':_0x1138b5[_0x76aa('0x24')][_0x76aa('0x34')][_0x144f0a]}:{'$ne':null}}})['then'](function(_0x2d3441){var _0x5a984e=moment()[_0x76aa('0x3a')](_0x76aa('0x3b'));for(var _0x31930b=0x0,_0x18fd3e=_0x2d3441[_0x76aa('0x3c')];_0x31930b<_0x18fd3e;_0x31930b+=0x1){_0x2d3441[_0x31930b][_0x76aa('0x3d')]({'exitAt':_0x5a984e});}});for(var _0x2e229d=0x0;_0x2e229d<_0x1138b5[_0x76aa('0x24')][_0x76aa('0x34')][_0x144f0a][_0x76aa('0x3c')];_0x2e229d+=0x1){db['MemberReport'][_0x76aa('0x3e')]({'where':{'channel':_0x144f0a,'membername':_0x1138b5['user'][_0x76aa('0x11')],'type':_0x76aa('0x39'),'uniqueid':_0x1138b5[_0x76aa('0x24')][_0x76aa('0x34')][_0x144f0a][_0x2e229d],'exitAt':null},'defaults':{'channel':_0x144f0a,'membername':_0x1138b5['user']['name'],'interface':_[_0x76aa('0x13')](_0x1138b5['user'][_0x76aa('0x3f')])?util[_0x76aa('0x3a')](_0x76aa('0x40'),_0x1138b5[_0x76aa('0x38')][_0x76aa('0x11')]):_0x1138b5[_0x76aa('0x38')]['interface'],'type':'INTERACTION','enterAt':moment()[_0x76aa('0x3a')](_0x76aa('0x3b')),'role':_0x76aa('0x41'),'internal':_0x1138b5[_0x76aa('0x38')][_0x76aa('0x42')],'uniqueid':_0x1138b5[_0x76aa('0x24')]['interaction'][_0x144f0a][_0x2e229d]}});}}}}return respondWithRpcPromise(_0x76aa('0x43'),{'id':_0x1138b5[_0x76aa('0x1b')]['id'],'capacity':_0x1138b5[_0x76aa('0x24')]['capacity']},routingClient)[_0x76aa('0x18')](respondWithResult(_0x4aa2f3,null))['catch'](handleError(_0x4aa2f3,null));};exports[_0x76aa('0x44')]=function(_0x5e1d84,_0x339b0d){return respondWithRpcPromise(_0x76aa('0x45'),_0x5e1d84[_0x76aa('0x17')])[_0x76aa('0x18')](respondWithResult(_0x339b0d,null))[_0x76aa('0xd')](handleError(_0x339b0d,null));};exports[_0x76aa('0x46')]=function(_0x953726,_0x4f2c2b){return respondWithRpcPromise(_0x76aa('0x47'),_0x953726['query'])[_0x76aa('0x18')](respondWithResult(_0x4f2c2b,null))[_0x76aa('0xd')](handleError(_0x4f2c2b,null));};exports[_0x76aa('0x48')]=function(_0x53be10,_0x3fa7ec){return respondWithRpcPromise(_0x76aa('0x49'),_0x53be10[_0x76aa('0x17')])['then'](respondWithResult(_0x3fa7ec,null))[_0x76aa('0xd')](handleError(_0x3fa7ec,null));};exports[_0x76aa('0x4a')]=function(_0x27fc84,_0x1fd2b6){return respondWithRpcPromise('ChatQueues',_0x27fc84[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](respondWithResult(_0x1fd2b6,null))[_0x76aa('0xd')](handleError(_0x1fd2b6,null));};exports[_0x76aa('0x4b')]=function(_0x2027f8,_0xf7732){return respondWithRpcPromise('ChatQueues',_0x2027f8[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](findById(_0x2027f8[_0x76aa('0x1b')]['id']))[_0x76aa('0x18')](respondWithResult(_0xf7732,null))[_0x76aa('0xd')](handleError(_0xf7732,null));};exports[_0x76aa('0x4c')]=function(_0x37babe,_0x51893b){return respondWithRpcPromise('MailQueues',_0x37babe[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](respondWithResult(_0x51893b,null))['catch'](handleError(_0x51893b,null));};exports[_0x76aa('0x4d')]=function(_0x1e6f3c,_0x4f832d){return respondWithRpcPromise(_0x76aa('0x4e'),_0x1e6f3c[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](findById(_0x1e6f3c[_0x76aa('0x1b')]['id']))[_0x76aa('0x18')](respondWithResult(_0x4f832d,null))[_0x76aa('0xd')](handleError(_0x4f832d,null));};exports[_0x76aa('0x4f')]=function(_0x30573a,_0x69b1af){return respondWithRpcPromise('MailAccounts',_0x30573a[_0x76aa('0x17')],mailClient)['then'](respondWithResult(_0x69b1af,null))[_0x76aa('0xd')](handleError(_0x69b1af,null));};exports[_0x76aa('0x50')]=function(_0x2fef92,_0x16cc85){return respondWithRpcPromise(_0x76aa('0x51'),_0x2fef92[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](respondWithResult(_0x16cc85,null))[_0x76aa('0xd')](handleError(_0x16cc85,null));};exports[_0x76aa('0x52')]=function(_0x5eceba,_0x267fcf){return respondWithRpcPromise(_0x76aa('0x51'),_0x5eceba[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](findById(_0x5eceba[_0x76aa('0x1b')]['id']))[_0x76aa('0x18')](respondWithResult(_0x267fcf,null))[_0x76aa('0xd')](handleError(_0x267fcf,null));};exports[_0x76aa('0x53')]=function(_0x5546b6,_0x364d05){return respondWithRpcPromise('SmsQueues',_0x5546b6[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](respondWithResult(_0x364d05,null))[_0x76aa('0xd')](handleError(_0x364d05,null));};exports[_0x76aa('0x54')]=function(_0x3a82fe,_0x234dc4){return respondWithRpcPromise(_0x76aa('0x55'),_0x3a82fe['query'],routingClient)[_0x76aa('0x18')](findById(_0x3a82fe[_0x76aa('0x1b')]['id']))['then'](respondWithResult(_0x234dc4,null))['catch'](handleError(_0x234dc4,null));};exports[_0x76aa('0x56')]=function(_0x13389d,_0x5295a7){return respondWithRpcPromise(_0x76aa('0x57'),_0x13389d[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](respondWithResult(_0x5295a7,null))['catch'](handleError(_0x5295a7,null));};exports[_0x76aa('0x58')]=function(_0x47f733,_0xf31e1f){return respondWithRpcPromise(_0x76aa('0x57'),_0x47f733[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](findById(_0x47f733['params']['id']))['then'](respondWithResult(_0xf31e1f,null))[_0x76aa('0xd')](handleError(_0xf31e1f,null));};exports['faxQueues']=function(_0x2a8fd3,_0x28feb2){return respondWithRpcPromise(_0x76aa('0x59'),_0x2a8fd3[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](respondWithResult(_0x28feb2,null))[_0x76aa('0xd')](handleError(_0x28feb2,null));};exports[_0x76aa('0x5a')]=function(_0x223c92,_0xa19c1c){return respondWithRpcPromise('FaxQueues',_0x223c92[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](findById(_0x223c92[_0x76aa('0x1b')]['id']))[_0x76aa('0x18')](respondWithResult(_0xa19c1c,null))['catch'](handleError(_0xa19c1c,null));};exports['faxAccounts']=function(_0x557c11,_0x1a01ac){return respondWithRpcPromise('FaxAccounts',_0x557c11[_0x76aa('0x17')])[_0x76aa('0x18')](respondWithResult(_0x1a01ac,null))[_0x76aa('0xd')](handleError(_0x1a01ac,null));};exports[_0x76aa('0x5b')]=function(_0x5754fa,_0x7eb34e){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x5754fa[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](respondWithResult(_0x7eb34e,null))[_0x76aa('0xd')](handleError(_0x7eb34e,null));};exports[_0x76aa('0x5c')]=function(_0x1037fb,_0x496e66){return respondWithRpcPromise(_0x76aa('0x5d'),_0x1037fb[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](respondWithResult(_0x496e66,null))[_0x76aa('0xd')](handleError(_0x496e66,null));};exports[_0x76aa('0x5e')]=function(_0x22432d,_0x1d9c6e){return respondWithRpcPromise(_0x76aa('0x5f'),_0x22432d['query'],routingClient)[_0x76aa('0x18')](respondWithResult(_0x1d9c6e,null))[_0x76aa('0xd')](handleError(_0x1d9c6e,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x3c1b98,_0x215463){return respondWithRpcPromise(_0x76aa('0x5f'),_0x3c1b98[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](function(_0x51b101){if(_0x3c1b98[_0x76aa('0x17')]['type']!==undefined){var _0xdb821b=_(_0x51b101['rows'])['filter']([_0x3c1b98[_0x76aa('0x17')][_0x76aa('0x60')],_0x3c1b98['params']['id']])['map'](_0x76aa('0x61'))[_0x76aa('0x62')]()[_0x76aa('0x63')]();return _0x51b101['rows']['filter'](function(_0x17efc6){return _0xdb821b[_0x76aa('0x64')](_0x17efc6[_0x76aa('0x61')])>-0x1;});}else{return _0x51b101['rows'][_0x76aa('0x65')](function(_0x4c773a){return _0x4c773a[_0x76aa('0x61')]===parseInt(_0x3c1b98[_0x76aa('0x1b')]['id']);});}})[_0x76aa('0x18')](respondWithResult(_0x215463,null))[_0x76aa('0xd')](handleError(_0x215463,null));};exports[_0x76aa('0x66')]=function(_0x486d86,_0x5a79ba){return respondWithRpcPromise(_0x76aa('0x67'),_0x486d86[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](respondWithResult(_0x5a79ba,null))['catch'](handleError(_0x5a79ba,null));};exports[_0x76aa('0x68')]=function(_0x3b6e44,_0x2ce07f){return respondWithRpcPromise(_0x76aa('0x69'),_0x3b6e44[_0x76aa('0x17')],routingClient)['then'](respondWithResult(_0x2ce07f,null))[_0x76aa('0xd')](handleError(_0x2ce07f,null));};exports['faxQueuesWaitingInteractions']=function(_0x213f7f,_0xca8769){return respondWithRpcPromise(_0x76aa('0x6a'),_0x213f7f[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](respondWithResult(_0xca8769,null))[_0x76aa('0xd')](handleError(_0xca8769,null));};exports['queueNotify']=function(_0x555682){return function(_0x547411,_0x47dd29){var _0x490fa4,_0x2203c3;var _0x22f44f=_['capitalize'](_0x555682);var _0x5c2c91=_0x555682==='chat'?_0x76aa('0x6b'):_0x76aa('0x6c');return db[_0x22f44f+_0x76aa('0x6d')]['findOne']({'raw':!![],'where':{'id':_0x547411['params']['id']}})[_0x76aa('0x18')](function(_0x45edd0){if(_[_0x76aa('0x13')](_0x45edd0)){throw new Error(_0x22f44f+_0x76aa('0x6e'));}_0x490fa4=_0x45edd0;return db[_0x22f44f+_0x76aa('0x6f')]['findOne']({'where':{'id':_0x547411['body'][_0x76aa('0x70')]},'include':[{'model':db[_0x22f44f+'Interaction'],'as':'Interaction'},{'model':db[_0x22f44f+_0x5c2c91],'as':'Account'}]});})[_0x76aa('0x18')](function(_0xbb1ccd){if(_['isNil'](_0xbb1ccd)){throw new Error(_0x22f44f+_0x76aa('0x71'));}_0x2203c3=_0xbb1ccd;return _0xbb1ccd[_0x76aa('0x72')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x22063f={'uniqueid':_0x555682+'.'+_0x2203c3['id']+'.'+_0x2203c3[_0x76aa('0x73')]['id'],'FromUserId':_0x547411[_0x76aa('0x38')]['id'],'type':_0x76aa('0x74')};_0x22063f[_0x22f44f+_0x76aa('0x75')]=_0x2203c3['id'];_0x22063f[_0x22f44f+_0x76aa('0x76')]=_0x2203c3[_0x76aa('0x73')]['id'];_0x22063f[_0x76aa('0x77')+_0x22f44f+_0x5c2c91+'Id']=_0x2203c3[_0x76aa('0x6c')]['id'];_0x22063f['To'+_0x22f44f+'QueueId']=_0x490fa4['id'];return db[_0x22f44f+_0x76aa('0x78')][_0x76aa('0x79')](_0x22063f);})['then'](function(){return respondWithRpcPromise(_0x76aa('0x7a'),{'channel':_0x555682,'interaction':_0x2203c3[_0x76aa('0x73')],'message':_0x2203c3,'account':_0x2203c3[_0x76aa('0x6c')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x490fa4[_0x76aa('0x11')]+','+(_0x2203c3[_0x76aa('0x6c')]['queueTransferTimeout']||0x12c),'interval':_0x76aa('0x7b')}]},routingClient);})[_0x76aa('0x18')](respondWithResult(_0x47dd29,null))[_0x76aa('0xd')](handleError(_0x47dd29,null));};};exports['agentNotify']=function(_0xae152a,_0x202acb){var _0x50a51f,_0x5aabe5;if(_['isNil'](_0xae152a[_0x76aa('0x24')][_0x76aa('0x7c')])){throw new Error(_0x76aa('0x7d'));}var _0x16643e=_0xae152a['body']['channel'];var _0x4a449c=_[_0x76aa('0x7e')](_0x16643e);var _0x59876c=_0x16643e===_0x76aa('0x7f')?_0x76aa('0x6b'):'Account';return db[_0x76aa('0x80')][_0x76aa('0x81')]({'raw':!![],'where':{'id':_0xae152a['params']['id'],'role':_0x76aa('0x41')}})[_0x76aa('0x18')](function(_0x41200c){if(_[_0x76aa('0x13')](_0x41200c)){throw new Error(_0x76aa('0x82'));}_0x50a51f=_0x41200c;return db[_0x4a449c+_0x76aa('0x6f')]['findOne']({'where':{'id':_0xae152a[_0x76aa('0x24')]['messageId']},'include':[{'model':db[_0x4a449c+'Interaction'],'as':'Interaction'},{'model':db[_0x4a449c+_0x59876c],'as':'Account'}]});})['then'](function(_0xb65e0b){if(_[_0x76aa('0x13')](_0xb65e0b)){throw new Error(_0x4a449c+_0x76aa('0x71'));}_0x5aabe5=_0xb65e0b;return _0xb65e0b[_0x76aa('0x72')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x447103={'uniqueid':_0x16643e+'.'+_0x5aabe5['id']+'.'+_0x5aabe5[_0x76aa('0x73')]['id'],'FromUserId':_0xae152a[_0x76aa('0x38')]['id'],'type':_0x76aa('0x74'),'ToUserId':_0x50a51f['id']};_0x447103[_0x4a449c+_0x76aa('0x75')]=_0x5aabe5['id'];_0x447103[_0x4a449c+'InteractionId']=_0x5aabe5[_0x76aa('0x73')]['id'];_0x447103[_0x76aa('0x77')+_0x4a449c+_0x59876c+'Id']=_0x5aabe5[_0x76aa('0x6c')]['id'];return db[_0x4a449c+_0x76aa('0x78')][_0x76aa('0x79')](_0x447103);})[_0x76aa('0x18')](function(){return respondWithRpcPromise(_0x76aa('0x7a'),{'channel':_0x16643e,'interaction':_0x5aabe5['Interaction'],'message':_0x5aabe5,'account':_0x5aabe5[_0x76aa('0x6c')],'applications':[{'id':0x0,'priority':0x1,'app':_0x76aa('0x41'),'appdata':_0x50a51f['name']+','+(_0x5aabe5['Account'][_0x76aa('0x83')]||0x12c),'interval':_0x76aa('0x7b')}]},routingClient);})['then'](respondWithResult(_0x202acb,null))[_0x76aa('0xd')](handleError(_0x202acb,null));}; \ No newline at end of file +var _0x33c5=['VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','merge','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','INTERACTION','length','format','updateAttributes','findOrCreate','SIP/%s','interface','agent','internal','AgentCapacity','capacity','telephones','Telephones','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','showSmsQueues','SmsQueues','whatsappQueues','showWhatsappQueues','WhatsappQueues','faxQueues','FaxQueues','showFaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','value','indexOf','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','Account','findOne','Message','messageId','Interaction','update','queue','InteractionId','From','QueueId','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Website','User','Agent\x20not\x20found','\x20Message\x20not\x20found','TransferReport','create','agentTransferTimeout','moment','lodash','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','catch','status','json','sendStatus','stack','name','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','params','voiceChannelStopMixMonitor'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x33c5,0xe6));var _0x533c=function(_0xbc25e1,_0x27007d){_0xbc25e1=_0xbc25e1-0x0;var _0xaf0a85=_0x33c5[_0xbc25e1];return _0xaf0a85;};'use strict';var BPromise=require('bluebird');var moment=require(_0x533c('0x0'));var _=require(_0x533c('0x1'));var util=require('util');var db=require(_0x533c('0x2'))['db'];var logger=require(_0x533c('0x3'))(_0x533c('0x4'));var jayson=require(_0x533c('0x5'));var amiClient=jayson[_0x533c('0x6')]['http']({'port':0x232a});var mailClient=jayson[_0x533c('0x6')][_0x533c('0x7')]({'port':0x232b});var routingClient=jayson[_0x533c('0x6')][_0x533c('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x34ca89,_0x1699d5,_0x3a009b){return new BPromise(function(_0x36d74e,_0x2c297c){var _0x1b929b=_0x3a009b?_0x3a009b:amiClient;return _0x1b929b[_0x533c('0x8')](_0x34ca89,_0x1699d5)[_0x533c('0x9')](function(_0x2c0214){if(_0x2c0214[_0x533c('0xa')]){if(_0x2c0214[_0x533c('0xa')][_0x533c('0xb')]===0x1f4){return _0x2c297c(_0x2c0214['error'][_0x533c('0xc')]);}return _0x36d74e(_0x2c0214[_0x533c('0xa')][_0x533c('0xc')]);}else{_0x36d74e(_0x2c0214[_0x533c('0xd')]);}})[_0x533c('0xe')](function(_0x346e0f){_0x2c297c(_0x346e0f);});});}function respondWithResult(_0x530e10,_0x5c9462){_0x5c9462=_0x5c9462||0xc8;return function(_0xf93007){if(_0xf93007){return _0x530e10[_0x533c('0xf')](_0x5c9462)[_0x533c('0x10')](_0xf93007);}return _0x530e10[_0x533c('0x11')](0x194);};}function handleError(_0x1a2a83,_0x8d7c66){_0x8d7c66=_0x8d7c66||0x1f4;return function(_0xa616ca){logger['error'](_0xa616ca[_0x533c('0x12')]);if(_0xa616ca[_0x533c('0x13')]){delete _0xa616ca[_0x533c('0x13')];}_0x1a2a83[_0x533c('0xf')](_0x8d7c66)['send'](_0xa616ca);};}function findById(_0x1031e7){return function(_0x1ed6ba){if(!_[_0x533c('0x14')](_0x1031e7)&&!_[_0x533c('0x14')](_0x1ed6ba)&&!_[_0x533c('0x14')](_0x1ed6ba[_0x533c('0x15')])){return _[_0x533c('0x16')](_0x1ed6ba[_0x533c('0x15')],function(_0x1f9f85){return _0x1f9f85['id']==_0x1031e7;});}return null;};}exports[_0x533c('0x17')]=function(_0x287b9e,_0x2c41e9){return respondWithRpcPromise(_0x533c('0x18'),_0x287b9e[_0x533c('0x19')])[_0x533c('0x9')](respondWithResult(_0x2c41e9,null))[_0x533c('0xe')](handleError(_0x2c41e9,null));};exports[_0x533c('0x1a')]=function(_0x2bc58f,_0x4ba0bd){return respondWithRpcPromise(_0x533c('0x1b'),_['merge'](_0x2bc58f['query'],_0x2bc58f[_0x533c('0x1c')]))[_0x533c('0x9')](respondWithResult(_0x4ba0bd,null))['catch'](handleError(_0x4ba0bd,null));};exports[_0x533c('0x1d')]=function(_0x37651e,_0x3839fe){return respondWithRpcPromise(_0x533c('0x1e'),_['merge'](_0x37651e[_0x533c('0x19')],_0x37651e[_0x533c('0x1c')]))[_0x533c('0x9')](respondWithResult(_0x3839fe,null))[_0x533c('0xe')](handleError(_0x3839fe,null));};exports[_0x533c('0x1f')]=function(_0x140269,_0xb51a5){return respondWithRpcPromise(_0x533c('0x20'),_0x140269[_0x533c('0x19')])[_0x533c('0x9')](respondWithResult(_0xb51a5,null))['catch'](handleError(_0xb51a5,null));};exports[_0x533c('0x21')]=function(_0xfab4da,_0x503c2e){return respondWithRpcPromise(_0x533c('0x20'),_0xfab4da['query'])[_0x533c('0x9')](findById(_0xfab4da[_0x533c('0x1c')]['id']))[_0x533c('0x9')](respondWithResult(_0x503c2e,null))[_0x533c('0xe')](handleError(_0x503c2e,null));};exports[_0x533c('0x22')]=function(_0x146a8e,_0x212d1b){return respondWithRpcPromise(_0x533c('0x23'),_[_0x533c('0x24')](_0x146a8e[_0x533c('0x25')],_0x146a8e[_0x533c('0x1c')]))[_0x533c('0x9')](respondWithResult(_0x212d1b,null))['catch'](handleError(_0x212d1b,null));};exports[_0x533c('0x26')]=function(_0x591499,_0x3290de){return respondWithRpcPromise(_0x533c('0x27'),_[_0x533c('0x24')](_0x591499[_0x533c('0x19')],_0x591499[_0x533c('0x1c')]))[_0x533c('0x9')](respondWithResult(_0x3290de,null))[_0x533c('0xe')](handleError(_0x3290de,null));};exports[_0x533c('0x28')]=function(_0x287ee5,_0x47831f){return respondWithRpcPromise(_0x533c('0x29'),_0x287ee5[_0x533c('0x19')])[_0x533c('0x9')](respondWithResult(_0x47831f,null))[_0x533c('0xe')](handleError(_0x47831f,null));};exports[_0x533c('0x2a')]=function(_0x5ac6b4,_0x2b801e){return respondWithRpcPromise(_0x533c('0x2b'),_[_0x533c('0x24')](_0x5ac6b4[_0x533c('0x19')],_0x5ac6b4['params']))[_0x533c('0x9')](respondWithResult(_0x2b801e,null))[_0x533c('0xe')](handleError(_0x2b801e,null));};exports[_0x533c('0x2c')]=function(_0x40f077,_0x1255b1){return respondWithRpcPromise('VoiceQueuesChannelHangup',_['merge'](_0x40f077['query'],_0x40f077['params']))['then'](respondWithResult(_0x1255b1,null))[_0x533c('0xe')](handleError(_0x1255b1,null));};exports['voiceQueuesChannelRedirect']=function(_0x42994d,_0x55726a){return respondWithRpcPromise(_0x533c('0x2d'),_[_0x533c('0x24')](_0x42994d[_0x533c('0x19')],_0x42994d['params']))[_0x533c('0x9')](respondWithResult(_0x55726a,null))[_0x533c('0xe')](handleError(_0x55726a,null));};exports[_0x533c('0x2e')]=function(_0x55b010,_0x160d4b){return respondWithRpcPromise(_0x533c('0x2f'),_0x55b010[_0x533c('0x19')])['then'](respondWithResult(_0x160d4b,null))[_0x533c('0xe')](handleError(_0x160d4b,null));};exports[_0x533c('0x30')]=function(_0x2cd02f,_0x3f2b53){return respondWithRpcPromise(_0x533c('0x31'),_0x2cd02f[_0x533c('0x19')])[_0x533c('0x9')](respondWithResult(_0x3f2b53,null))[_0x533c('0xe')](handleError(_0x3f2b53,null));};exports[_0x533c('0x32')]=function(_0x2c03fa,_0x298cea){var _0x55af6e;return respondWithRpcPromise(_0x533c('0x33'),_0x2c03fa[_0x533c('0x19')])[_0x533c('0x9')](function(_0x3562b8){_0x55af6e=_0x3562b8;return respondWithRpcPromise(_0x533c('0x33'),_0x2c03fa[_0x533c('0x19')],routingClient);})['then'](function(_0x88ea5d){return _[_0x533c('0x24')]({},_0x88ea5d,_0x55af6e);})[_0x533c('0x9')](respondWithResult(_0x298cea,null))['catch'](handleError(_0x298cea,null));};exports[_0x533c('0x34')]=function(_0x4170e4,_0x315e67){if(_0x4170e4[_0x533c('0x25')]&&_0x4170e4['body'][_0x533c('0x35')]&&_0x4170e4['user']&&_0x4170e4[_0x533c('0x36')][_0x533c('0x13')]){for(var _0x55a372 in _0x4170e4[_0x533c('0x25')][_0x533c('0x35')]){if(_0x4170e4[_0x533c('0x25')]['interaction']['hasOwnProperty'](_0x55a372)){db['MemberReport']['findAll']({'where':{'channel':_0x55a372,'membername':_0x4170e4[_0x533c('0x36')]['name'],'type':_0x533c('0x37'),'exitAt':null,'uniqueid':_0x4170e4['body'][_0x533c('0x35')][_0x55a372]&&_0x4170e4['body'][_0x533c('0x35')][_0x55a372][_0x533c('0x38')]?{'$notIn':_0x4170e4['body'][_0x533c('0x35')][_0x55a372]}:{'$ne':null}}})[_0x533c('0x9')](function(_0x27ac8e){var _0x10e374=moment()[_0x533c('0x39')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x47cca7=0x0,_0x22dc87=_0x27ac8e[_0x533c('0x38')];_0x47cca7<_0x22dc87;_0x47cca7+=0x1){_0x27ac8e[_0x47cca7][_0x533c('0x3a')]({'exitAt':_0x10e374});}});for(var _0x4fcdc5=0x0;_0x4fcdc5<_0x4170e4[_0x533c('0x25')][_0x533c('0x35')][_0x55a372]['length'];_0x4fcdc5+=0x1){db['MemberReport'][_0x533c('0x3b')]({'where':{'channel':_0x55a372,'membername':_0x4170e4['user'][_0x533c('0x13')],'type':_0x533c('0x37'),'uniqueid':_0x4170e4[_0x533c('0x25')][_0x533c('0x35')][_0x55a372][_0x4fcdc5],'exitAt':null},'defaults':{'channel':_0x55a372,'membername':_0x4170e4[_0x533c('0x36')][_0x533c('0x13')],'interface':_[_0x533c('0x14')](_0x4170e4[_0x533c('0x36')]['interface'])?util[_0x533c('0x39')](_0x533c('0x3c'),_0x4170e4[_0x533c('0x36')]['name']):_0x4170e4[_0x533c('0x36')][_0x533c('0x3d')],'type':'INTERACTION','enterAt':moment()[_0x533c('0x39')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x533c('0x3e'),'internal':_0x4170e4[_0x533c('0x36')][_0x533c('0x3f')],'uniqueid':_0x4170e4[_0x533c('0x25')][_0x533c('0x35')][_0x55a372][_0x4fcdc5]}});}}}}return respondWithRpcPromise(_0x533c('0x40'),{'id':_0x4170e4[_0x533c('0x1c')]['id'],'capacity':_0x4170e4['body'][_0x533c('0x41')]},routingClient)[_0x533c('0x9')](respondWithResult(_0x315e67,null))[_0x533c('0xe')](handleError(_0x315e67,null));};exports[_0x533c('0x42')]=function(_0x24ca50,_0x1558ef){return respondWithRpcPromise(_0x533c('0x43'),_0x24ca50['query'])['then'](respondWithResult(_0x1558ef,null))['catch'](handleError(_0x1558ef,null));};exports['trunks']=function(_0xc99f96,_0x4434a1){return respondWithRpcPromise('Trunks',_0xc99f96[_0x533c('0x19')])[_0x533c('0x9')](respondWithResult(_0x4434a1,null))[_0x533c('0xe')](handleError(_0x4434a1,null));};exports['campaigns']=function(_0x1de19e,_0x564a31){return respondWithRpcPromise('Campaigns',_0x1de19e[_0x533c('0x19')])[_0x533c('0x9')](respondWithResult(_0x564a31,null))[_0x533c('0xe')](handleError(_0x564a31,null));};exports[_0x533c('0x44')]=function(_0x381544,_0x3bb176){return respondWithRpcPromise(_0x533c('0x45'),_0x381544['query'],routingClient)[_0x533c('0x9')](respondWithResult(_0x3bb176,null))['catch'](handleError(_0x3bb176,null));};exports[_0x533c('0x46')]=function(_0x26645d,_0x274686){return respondWithRpcPromise(_0x533c('0x45'),_0x26645d[_0x533c('0x19')],routingClient)[_0x533c('0x9')](findById(_0x26645d[_0x533c('0x1c')]['id']))[_0x533c('0x9')](respondWithResult(_0x274686,null))['catch'](handleError(_0x274686,null));};exports[_0x533c('0x47')]=function(_0x43a333,_0x163563){return respondWithRpcPromise(_0x533c('0x48'),_0x43a333[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x163563,null))['catch'](handleError(_0x163563,null));};exports[_0x533c('0x49')]=function(_0x554a9f,_0x43383e){return respondWithRpcPromise(_0x533c('0x48'),_0x554a9f[_0x533c('0x19')],routingClient)[_0x533c('0x9')](findById(_0x554a9f[_0x533c('0x1c')]['id']))[_0x533c('0x9')](respondWithResult(_0x43383e,null))['catch'](handleError(_0x43383e,null));};exports['mailAccounts']=function(_0x1005a6,_0x376619){return respondWithRpcPromise(_0x533c('0x4a'),_0x1005a6[_0x533c('0x19')],mailClient)['then'](respondWithResult(_0x376619,null))[_0x533c('0xe')](handleError(_0x376619,null));};exports[_0x533c('0x4b')]=function(_0x8e04c7,_0x352e07){return respondWithRpcPromise(_0x533c('0x4c'),_0x8e04c7[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x352e07,null))[_0x533c('0xe')](handleError(_0x352e07,null));};exports[_0x533c('0x4d')]=function(_0x3aba19,_0x404a93){return respondWithRpcPromise(_0x533c('0x4c'),_0x3aba19[_0x533c('0x19')],routingClient)[_0x533c('0x9')](findById(_0x3aba19[_0x533c('0x1c')]['id']))[_0x533c('0x9')](respondWithResult(_0x404a93,null))[_0x533c('0xe')](handleError(_0x404a93,null));};exports['smsQueues']=function(_0x31bba1,_0x5206ad){return respondWithRpcPromise('SmsQueues',_0x31bba1[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x5206ad,null))[_0x533c('0xe')](handleError(_0x5206ad,null));};exports[_0x533c('0x4e')]=function(_0x417158,_0x1eaf34){return respondWithRpcPromise(_0x533c('0x4f'),_0x417158['query'],routingClient)[_0x533c('0x9')](findById(_0x417158[_0x533c('0x1c')]['id']))['then'](respondWithResult(_0x1eaf34,null))[_0x533c('0xe')](handleError(_0x1eaf34,null));};exports[_0x533c('0x50')]=function(_0x8174d0,_0x3e3b25){return respondWithRpcPromise('WhatsappQueues',_0x8174d0[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x3e3b25,null))['catch'](handleError(_0x3e3b25,null));};exports[_0x533c('0x51')]=function(_0x3e8d57,_0x5f2b8b){return respondWithRpcPromise(_0x533c('0x52'),_0x3e8d57[_0x533c('0x19')],routingClient)['then'](findById(_0x3e8d57[_0x533c('0x1c')]['id']))['then'](respondWithResult(_0x5f2b8b,null))['catch'](handleError(_0x5f2b8b,null));};exports[_0x533c('0x53')]=function(_0x28239c,_0x451def){return respondWithRpcPromise(_0x533c('0x54'),_0x28239c['query'],routingClient)[_0x533c('0x9')](respondWithResult(_0x451def,null))[_0x533c('0xe')](handleError(_0x451def,null));};exports[_0x533c('0x55')]=function(_0x245792,_0x20d344){return respondWithRpcPromise('FaxQueues',_0x245792[_0x533c('0x19')],routingClient)['then'](findById(_0x245792[_0x533c('0x1c')]['id']))['then'](respondWithResult(_0x20d344,null))[_0x533c('0xe')](handleError(_0x20d344,null));};exports['faxAccounts']=function(_0x4bd014,_0x511f74){return respondWithRpcPromise(_0x533c('0x56'),_0x4bd014[_0x533c('0x19')])[_0x533c('0x9')](respondWithResult(_0x511f74,null))['catch'](handleError(_0x511f74,null));};exports[_0x533c('0x57')]=function(_0x24a00c,_0x3fbb08){return respondWithRpcPromise(_0x533c('0x58'),_0x24a00c[_0x533c('0x19')],routingClient)['then'](respondWithResult(_0x3fbb08,null))['catch'](handleError(_0x3fbb08,null));};exports[_0x533c('0x59')]=function(_0x313fa5,_0x2c0f59){return respondWithRpcPromise(_0x533c('0x5a'),_0x313fa5[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x2c0f59,null))[_0x533c('0xe')](handleError(_0x2c0f59,null));};exports[_0x533c('0x5b')]=function(_0x45c4ca,_0x4f0961){return respondWithRpcPromise(_0x533c('0x5c'),_0x45c4ca[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x4f0961,null))[_0x533c('0xe')](handleError(_0x4f0961,null));};exports[_0x533c('0x5d')]=function(_0x18102b,_0x1b9816){return respondWithRpcPromise(_0x533c('0x5c'),_0x18102b[_0x533c('0x19')],routingClient)[_0x533c('0x9')](function(_0xfd598d){if(_0x18102b[_0x533c('0x19')][_0x533c('0x5e')]!==undefined){var _0x452915=_(_0xfd598d[_0x533c('0x15')])[_0x533c('0x5f')]([_0x18102b[_0x533c('0x19')]['type'],_0x18102b[_0x533c('0x1c')]['id']])[_0x533c('0x60')]('queue_id')['uniq']()[_0x533c('0x61')]();return _0xfd598d['rows'][_0x533c('0x5f')](function(_0x307fe5){return _0x452915[_0x533c('0x62')](_0x307fe5[_0x533c('0x63')])>-0x1;});}else{return _0xfd598d[_0x533c('0x15')]['filter'](function(_0x275db2){return _0x275db2[_0x533c('0x63')]===parseInt(_0x18102b[_0x533c('0x1c')]['id']);});}})[_0x533c('0x9')](respondWithResult(_0x1b9816,null))[_0x533c('0xe')](handleError(_0x1b9816,null));};exports[_0x533c('0x64')]=function(_0x1aa938,_0x248ede){return respondWithRpcPromise(_0x533c('0x65'),_0x1aa938[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x248ede,null))[_0x533c('0xe')](handleError(_0x248ede,null));};exports[_0x533c('0x66')]=function(_0x452759,_0x9c8d2){return respondWithRpcPromise(_0x533c('0x67'),_0x452759[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x9c8d2,null))['catch'](handleError(_0x9c8d2,null));};exports[_0x533c('0x68')]=function(_0x15d09a,_0x247915){return respondWithRpcPromise(_0x533c('0x69'),_0x15d09a['query'],routingClient)[_0x533c('0x9')](respondWithResult(_0x247915,null))[_0x533c('0xe')](handleError(_0x247915,null));};exports['queueNotify']=function(_0x411f86){return function(_0x5b8ead,_0x291be3){var _0x4be94e,_0x11654c;var _0x33a661=_[_0x533c('0x6a')](_0x411f86);var _0x5c938c=_0x411f86==='chat'?'Website':_0x533c('0x6b');return db[_0x33a661+'Queue'][_0x533c('0x6c')]({'raw':!![],'where':{'id':_0x5b8ead[_0x533c('0x1c')]['id']}})[_0x533c('0x9')](function(_0x450152){if(_['isNil'](_0x450152)){throw new Error(_0x33a661+'\x20Queue\x20not\x20found');}_0x4be94e=_0x450152;return db[_0x33a661+_0x533c('0x6d')]['findOne']({'where':{'id':_0x5b8ead[_0x533c('0x25')][_0x533c('0x6e')]},'include':[{'model':db[_0x33a661+_0x533c('0x6f')],'as':'Interaction'},{'model':db[_0x33a661+_0x5c938c],'as':_0x533c('0x6b')}]});})['then'](function(_0x6e0d38){if(_[_0x533c('0x14')](_0x6e0d38)){throw new Error(_0x33a661+'\x20Message\x20not\x20found');}_0x11654c=_0x6e0d38;return _0x6e0d38[_0x533c('0x70')]({'read':0x0,'readAt':null,'UserId':null});})[_0x533c('0x9')](function(){var _0x1c9381={'uniqueid':_0x411f86+'.'+_0x11654c['id']+'.'+_0x11654c[_0x533c('0x6f')]['id'],'FromUserId':_0x5b8ead[_0x533c('0x36')]['id'],'type':_0x533c('0x71')};_0x1c9381[_0x33a661+'MessageId']=_0x11654c['id'];_0x1c9381[_0x33a661+_0x533c('0x72')]=_0x11654c[_0x533c('0x6f')]['id'];_0x1c9381[_0x533c('0x73')+_0x33a661+_0x5c938c+'Id']=_0x11654c['Account']['id'];_0x1c9381['To'+_0x33a661+_0x533c('0x74')]=_0x4be94e['id'];return db[_0x33a661+'TransferReport']['create'](_0x1c9381);})[_0x533c('0x9')](function(){return respondWithRpcPromise(_0x533c('0x75'),{'channel':_0x411f86,'interaction':_0x11654c['Interaction'],'message':_0x11654c,'account':_0x11654c[_0x533c('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':_0x533c('0x71'),'appdata':_0x4be94e[_0x533c('0x13')]+','+(_0x11654c[_0x533c('0x6b')][_0x533c('0x76')]||0x12c),'interval':_0x533c('0x77')}]},routingClient);})[_0x533c('0x9')](respondWithResult(_0x291be3,null))[_0x533c('0xe')](handleError(_0x291be3,null));};};exports[_0x533c('0x78')]=function(_0x299f43,_0x14db14){var _0x243d1a,_0x368552;if(_['isNil'](_0x299f43[_0x533c('0x25')][_0x533c('0x79')])){throw new Error(_0x533c('0x7a'));}var _0x4c3f6d=_0x299f43[_0x533c('0x25')]['channel'];var _0x2c7faf=_[_0x533c('0x6a')](_0x4c3f6d);var _0x2377a3=_0x4c3f6d==='chat'?_0x533c('0x7b'):_0x533c('0x6b');return db[_0x533c('0x7c')]['findOne']({'raw':!![],'where':{'id':_0x299f43['params']['id'],'role':_0x533c('0x3e')}})['then'](function(_0x392968){if(_['isNil'](_0x392968)){throw new Error(_0x533c('0x7d'));}_0x243d1a=_0x392968;return db[_0x2c7faf+_0x533c('0x6d')][_0x533c('0x6c')]({'where':{'id':_0x299f43['body']['messageId']},'include':[{'model':db[_0x2c7faf+_0x533c('0x6f')],'as':_0x533c('0x6f')},{'model':db[_0x2c7faf+_0x2377a3],'as':_0x533c('0x6b')}]});})[_0x533c('0x9')](function(_0x313916){if(_[_0x533c('0x14')](_0x313916)){throw new Error(_0x2c7faf+_0x533c('0x7e'));}_0x368552=_0x313916;return _0x313916[_0x533c('0x70')]({'read':0x0,'readAt':null,'UserId':null});})[_0x533c('0x9')](function(){var _0x5307b3={'uniqueid':_0x4c3f6d+'.'+_0x368552['id']+'.'+_0x368552[_0x533c('0x6f')]['id'],'FromUserId':_0x299f43[_0x533c('0x36')]['id'],'type':_0x533c('0x71'),'ToUserId':_0x243d1a['id']};_0x5307b3[_0x2c7faf+'MessageId']=_0x368552['id'];_0x5307b3[_0x2c7faf+_0x533c('0x72')]=_0x368552[_0x533c('0x6f')]['id'];_0x5307b3[_0x533c('0x73')+_0x2c7faf+_0x2377a3+'Id']=_0x368552[_0x533c('0x6b')]['id'];return db[_0x2c7faf+_0x533c('0x7f')][_0x533c('0x80')](_0x5307b3);})[_0x533c('0x9')](function(){return respondWithRpcPromise(_0x533c('0x75'),{'channel':_0x4c3f6d,'interaction':_0x368552[_0x533c('0x6f')],'message':_0x368552,'account':_0x368552[_0x533c('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':_0x533c('0x3e'),'appdata':_0x243d1a[_0x533c('0x13')]+','+(_0x368552['Account'][_0x533c('0x81')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x533c('0x9')](respondWithResult(_0x14db14,null))[_0x533c('0xe')](handleError(_0x14db14,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 43b18dd..13fbfd7 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 _0x0a9d=['index','/:id','show','/:id/run','run','post','create','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./schedule.controller','get','isAuthenticated'];(function(_0x17ad1e,_0x5a1d5a){var _0x23bb33=function(_0xcadc7e){while(--_0xcadc7e){_0x17ad1e['push'](_0x17ad1e['shift']());}};_0x23bb33(++_0x5a1d5a);}(_0x0a9d,0x16c));var _0xd0a9=function(_0x640eab,_0x44fa40){_0x640eab=_0x640eab-0x0;var _0x10464a=_0x0a9d[_0x640eab];return _0x10464a;};'use strict';var multer=require('multer');var util=require(_0xd0a9('0x0'));var path=require(_0xd0a9('0x1'));var timeout=require('connect-timeout');var express=require(_0xd0a9('0x2'));var router=express[_0xd0a9('0x3')]();var fs_extra=require(_0xd0a9('0x4'));var auth=require(_0xd0a9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd0a9('0x6'));var controller=require(_0xd0a9('0x7'));router[_0xd0a9('0x8')]('/',auth[_0xd0a9('0x9')](),controller[_0xd0a9('0xa')]);router[_0xd0a9('0x8')](_0xd0a9('0xb'),auth['isAuthenticated'](),controller[_0xd0a9('0xc')]);router['get'](_0xd0a9('0xd'),auth[_0xd0a9('0x9')](),controller[_0xd0a9('0xe')]);router[_0xd0a9('0xf')]('/',auth[_0xd0a9('0x9')](),controller[_0xd0a9('0x10')]);router[_0xd0a9('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xd0a9('0x12')]);router[_0xd0a9('0x13')](_0xd0a9('0xb'),auth[_0xd0a9('0x9')](),controller[_0xd0a9('0x14')]);module[_0xd0a9('0x15')]=router; \ No newline at end of file +var _0xe20c=['multer','path','express','Router','../../components/auth/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','show','post','put','delete','destroy','exports'];(function(_0x54d49e,_0x5d9911){var _0x4af0f1=function(_0xf117b3){while(--_0xf117b3){_0x54d49e['push'](_0x54d49e['shift']());}};_0x4af0f1(++_0x5d9911);}(_0xe20c,0x165));var _0xce20=function(_0x2a4c52,_0x207f11){_0x2a4c52=_0x2a4c52-0x0;var _0x1844eb=_0xe20c[_0x2a4c52];return _0x1844eb;};'use strict';var multer=require(_0xce20('0x0'));var util=require('util');var path=require(_0xce20('0x1'));var timeout=require('connect-timeout');var express=require(_0xce20('0x2'));var router=express[_0xce20('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xce20('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xce20('0x5'));var controller=require(_0xce20('0x6'));router[_0xce20('0x7')]('/',auth[_0xce20('0x8')](),controller[_0xce20('0x9')]);router[_0xce20('0x7')](_0xce20('0xa'),auth['isAuthenticated'](),controller[_0xce20('0xb')]);router['get']('/:id/run',auth[_0xce20('0x8')](),controller['run']);router[_0xce20('0xc')]('/',auth[_0xce20('0x8')](),controller['create']);router[_0xce20('0xd')](_0xce20('0xa'),auth[_0xce20('0x8')](),controller['update']);router[_0xce20('0xe')](_0xce20('0xa'),auth['isAuthenticated'](),controller[_0xce20('0xf')]);module[_0xce20('0x10')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index f633f32..cc3dc47 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 _0xbfe3=['TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','quarters','days','hours','minutes','ENUM','csv','pdf','xlsx','custom'];(function(_0x1445b5,_0x347b59){var _0x4d322a=function(_0x5b34c8){while(--_0x5b34c8){_0x1445b5['push'](_0x1445b5['shift']());}};_0x4d322a(++_0x347b59);}(_0xbfe3,0x9a));var _0x3bfe=function(_0x243655,_0x15e48e){_0x243655=_0x243655-0x0;var _0x3e91e8=_0xbfe3[_0x243655];return _0x3e91e8;};'use strict';var Sequelize=require(_0x3bfe('0x0'));module[_0x3bfe('0x1')]={'name':{'type':Sequelize[_0x3bfe('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3bfe('0x2')]},'active':{'type':Sequelize[_0x3bfe('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x3bfe('0x2')],'allowNull':![],'defaultValue':_0x3bfe('0x4')},'startAt':{'type':Sequelize[_0x3bfe('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0x3bfe('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x3bfe('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM']('years',_0x3bfe('0x7'),'months','weeks',_0x3bfe('0x8'),_0x3bfe('0x9'),_0x3bfe('0xa')),'allowNull':![],'defaultValue':_0x3bfe('0x8')},'output':{'type':Sequelize[_0x3bfe('0xb')](_0x3bfe('0xc'),_0x3bfe('0xd'),_0x3bfe('0xe')),'allowNull':![],'defaultValue':_0x3bfe('0xc')},'type':{'type':Sequelize[_0x3bfe('0xb')](_0x3bfe('0xf'),'default'),'allowNull':![],'defaultValue':_0x3bfe('0xf')},'sendMail':{'type':Sequelize[_0x3bfe('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x3bfe('0x2')]},'cc':{'type':Sequelize[_0x3bfe('0x10')]},'bcc':{'type':Sequelize[_0x3bfe('0x10')]},'sendIfEmpty':{'type':Sequelize[_0x3bfe('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xde77=['default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','quarters','months','minutes','ENUM','pdf','csv','custom'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xde77,0x92));var _0x7de7=function(_0x407cf4,_0x3a491b){_0x407cf4=_0x407cf4-0x0;var _0x3ac633=_0xde77[_0x407cf4];return _0x3ac633;};'use strict';var Sequelize=require(_0x7de7('0x0'));module[_0x7de7('0x1')]={'name':{'type':Sequelize[_0x7de7('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x7de7('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x7de7('0x2')],'allowNull':![],'defaultValue':_0x7de7('0x4')},'startAt':{'type':Sequelize[_0x7de7('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0x7de7('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x7de7('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM']('years',_0x7de7('0x7'),_0x7de7('0x8'),'weeks','days','hours',_0x7de7('0x9')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0x7de7('0xa')]('csv',_0x7de7('0xb'),'xlsx'),'allowNull':![],'defaultValue':_0x7de7('0xc')},'type':{'type':Sequelize[_0x7de7('0xa')](_0x7de7('0xd'),_0x7de7('0xe')),'allowNull':![],'defaultValue':_0x7de7('0xd')},'sendMail':{'type':Sequelize[_0x7de7('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x7de7('0x2')]},'cc':{'type':Sequelize[_0x7de7('0xf')]},'bcc':{'type':Sequelize[_0x7de7('0xf')]},'sendIfEmpty':{'type':Sequelize[_0x7de7('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 731e661..2e7edbe 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 _0x00f7=['jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','get','Scheduler','UserProfileResource','sendStatus','error','name','send','Schedule','rawAttributes','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','includeAll','include','rows','catch','show','params','find','body','role','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','../../config/schedule','run','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto'];(function(_0x7faf3f,_0x4c7fe0){var _0x286164=function(_0x2860b8){while(--_0x2860b8){_0x7faf3f['push'](_0x7faf3f['shift']());}};_0x286164(++_0x4c7fe0);}(_0x00f7,0x130));var _0x700f=function(_0x4fba3f,_0x3bf3bf){_0x4fba3f=_0x4fba3f-0x0;var _0x4fecf5=_0x00f7[_0x4fba3f];return _0x4fecf5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x700f('0x0'));var jsonpatch=require(_0x700f('0x1'));var rp=require(_0x700f('0x2'));var moment=require('moment');var BPromise=require(_0x700f('0x3'));var Mustache=require(_0x700f('0x4'));var util=require(_0x700f('0x5'));var path=require('path');var sox=require(_0x700f('0x6'));var csv=require('to-csv');var ejs=require(_0x700f('0x7'));var fs=require('fs');var fs_extra=require(_0x700f('0x8'));var _=require(_0x700f('0x9'));var squel=require(_0x700f('0xa'));var crypto=require(_0x700f('0xb'));var jsforce=require(_0x700f('0xc'));var deskjs=require(_0x700f('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x700f('0xe'));var qs=require(_0x700f('0xf'));var as=require(_0x700f('0x10'));var hardwareService=require(_0x700f('0x11'));var logger=require(_0x700f('0x12'))(_0x700f('0x13'));var utils=require('../../config/utils');var config=require(_0x700f('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ce3a7,_0x53996d){_0x53996d=_0x53996d||0xcc;return function(_0x7b2299){if(_0x7b2299){return _0x5ce3a7['sendStatus'](_0x53996d);}return _0x5ce3a7[_0x700f('0x15')](_0x53996d)[_0x700f('0x16')]();};}function respondWithResult(_0xe23ade,_0x25af9d){_0x25af9d=_0x25af9d||0xc8;return function(_0xe52e78){if(_0xe52e78){return _0xe23ade[_0x700f('0x15')](_0x25af9d)[_0x700f('0x17')](_0xe52e78);}};}function respondWithFilteredResult(_0x365c85,_0xc39e6f){return function(_0x56203c){if(_0x56203c){var _0x5d8d13=typeof _0xc39e6f['offset']===_0x700f('0x18')&&typeof _0xc39e6f[_0x700f('0x19')]===_0x700f('0x18');var _0x59dbb2=_0x56203c[_0x700f('0x1a')];var _0x207266=_0x5d8d13?0x0:_0xc39e6f[_0x700f('0x1b')];var _0x423785=_0x5d8d13?_0x56203c[_0x700f('0x1a')]:_0xc39e6f[_0x700f('0x1b')]+_0xc39e6f[_0x700f('0x19')];var _0x85c2cc;if(_0x423785>=_0x59dbb2){_0x423785=_0x59dbb2;_0x85c2cc=0xc8;}else{_0x85c2cc=0xce;}_0x365c85['status'](_0x85c2cc);return _0x365c85[_0x700f('0x1c')](_0x700f('0x1d'),_0x207266+'-'+_0x423785+'/'+_0x59dbb2)[_0x700f('0x17')](_0x56203c);}return null;};}function patchUpdates(_0x568233){return function(_0xb05f3e){try{jsonpatch[_0x700f('0x1e')](_0xb05f3e,_0x568233,!![]);}catch(_0x511944){return BPromise[_0x700f('0x1f')](_0x511944);}return _0xb05f3e[_0x700f('0x20')]();};}function saveUpdates(_0x155ffe,_0x547b46){return function(_0x48faf9){if(_0x48faf9){return _0x48faf9[_0x700f('0x21')](_0x155ffe)['then'](function(_0x3060d9){return _0x3060d9;});}return null;};}function removeEntity(_0xd72dbb,_0x501a56){return function(_0x5676e8){if(_0x5676e8){return _0x5676e8[_0x700f('0x22')]()[_0x700f('0x23')](function(){var _0x4961f9=_0x5676e8[_0x700f('0x24')]({'plain':!![]});var _0xbfff67=_0x700f('0x25');return db[_0x700f('0x26')][_0x700f('0x22')]({'where':{'type':_0xbfff67,'resourceId':_0x4961f9['id']}})['then'](function(){return _0x5676e8;});})[_0x700f('0x23')](function(){_0xd72dbb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f5b93,_0x5d8577){return function(_0x4fc46c){if(!_0x4fc46c){_0x3f5b93[_0x700f('0x27')](0x194);}return _0x4fc46c;};}function handleError(_0x3da33e,_0x525dbf){_0x525dbf=_0x525dbf||0x1f4;return function(_0x550d85){logger[_0x700f('0x28')](_0x550d85['stack']);if(_0x550d85[_0x700f('0x29')]){delete _0x550d85[_0x700f('0x29')];}_0x3da33e['status'](_0x525dbf)[_0x700f('0x2a')](_0x550d85);};}exports['index']=function(_0x513987,_0x502a52){var _0x117164={},_0x485d9c={},_0x194052={'count':0x0,'rows':[]};var _0x417eca=_['map'](db[_0x700f('0x2b')][_0x700f('0x2c')],function(_0x209b56){return{'name':_0x209b56['fieldName'],'type':_0x209b56[_0x700f('0x2d')][_0x700f('0x2e')]};});_0x485d9c[_0x700f('0x2f')]=_[_0x700f('0x30')](_0x417eca,_0x700f('0x29'));_0x485d9c[_0x700f('0x31')]=_[_0x700f('0x32')](_0x513987['query']);_0x485d9c[_0x700f('0x33')]=_['intersection'](_0x485d9c['model'],_0x485d9c['query']);_0x117164[_0x700f('0x34')]=_[_0x700f('0x35')](_0x485d9c[_0x700f('0x2f')],qs[_0x700f('0x36')](_0x513987[_0x700f('0x31')][_0x700f('0x36')]));_0x117164[_0x700f('0x34')]=_0x117164[_0x700f('0x34')][_0x700f('0x37')]?_0x117164['attributes']:_0x485d9c[_0x700f('0x2f')];if(!_0x513987[_0x700f('0x31')][_0x700f('0x38')](_0x700f('0x39'))){_0x117164[_0x700f('0x19')]=qs[_0x700f('0x19')](_0x513987['query']['limit']);_0x117164[_0x700f('0x1b')]=qs[_0x700f('0x1b')](_0x513987[_0x700f('0x31')][_0x700f('0x1b')]);}_0x117164[_0x700f('0x3a')]=qs[_0x700f('0x3b')](_0x513987[_0x700f('0x31')][_0x700f('0x3b')]);_0x117164[_0x700f('0x3c')]=qs[_0x700f('0x33')](_[_0x700f('0x3d')](_0x513987['query'],_0x485d9c[_0x700f('0x33')]),_0x417eca);if(_0x513987['query']['filter']){_0x117164[_0x700f('0x3c')]=_['merge'](_0x117164[_0x700f('0x3c')],{'$or':_[_0x700f('0x30')](_0x417eca,function(_0xb043b3){if(_0xb043b3[_0x700f('0x2d')]!=='VIRTUAL'){var _0x15952a={};_0x15952a[_0xb043b3[_0x700f('0x29')]]={'$like':'%'+_0x513987[_0x700f('0x31')]['filter']+'%'};return _0x15952a;}})});}_0x117164=_[_0x700f('0x3e')]({},_0x117164,_0x513987[_0x700f('0x3f')]);var _0x27188a={'where':_0x117164[_0x700f('0x3c')]};return db['Schedule']['count'](_0x27188a)[_0x700f('0x23')](function(_0xde1a8a){_0x194052[_0x700f('0x1a')]=_0xde1a8a;if(_0x513987['query'][_0x700f('0x40')]){_0x117164[_0x700f('0x41')]=[{'all':!![]}];}return db[_0x700f('0x2b')]['findAll'](_0x117164);})['then'](function(_0x1d4136){_0x194052[_0x700f('0x42')]=_0x1d4136;return _0x194052;})['then'](respondWithFilteredResult(_0x502a52,_0x117164))[_0x700f('0x43')](handleError(_0x502a52,null));};exports[_0x700f('0x44')]=function(_0x29b249,_0x386315){var _0x2c1210={'raw':![],'where':{'id':_0x29b249[_0x700f('0x45')]['id']}},_0x3c9e64={};_0x3c9e64['model']=_['keys'](db[_0x700f('0x2b')][_0x700f('0x2c')]);_0x3c9e64[_0x700f('0x31')]=_[_0x700f('0x32')](_0x29b249[_0x700f('0x31')]);_0x3c9e64[_0x700f('0x33')]=_[_0x700f('0x35')](_0x3c9e64[_0x700f('0x2f')],_0x3c9e64[_0x700f('0x31')]);_0x2c1210[_0x700f('0x34')]=_[_0x700f('0x35')](_0x3c9e64[_0x700f('0x2f')],qs['fields'](_0x29b249[_0x700f('0x31')]['fields']));_0x2c1210[_0x700f('0x34')]=_0x2c1210[_0x700f('0x34')]['length']?_0x2c1210['attributes']:_0x3c9e64[_0x700f('0x2f')];if(_0x29b249[_0x700f('0x31')][_0x700f('0x40')]){_0x2c1210[_0x700f('0x41')]=[{'all':!![]}];}_0x2c1210=_[_0x700f('0x3e')]({},_0x2c1210,_0x29b249[_0x700f('0x3f')]);return db[_0x700f('0x2b')][_0x700f('0x46')](_0x2c1210)[_0x700f('0x23')](handleEntityNotFound(_0x386315,null))['then'](respondWithResult(_0x386315,null))[_0x700f('0x43')](handleError(_0x386315,null));};exports['create']=function(_0x29041e,_0x1ad25f){return db[_0x700f('0x2b')]['create'](_0x29041e[_0x700f('0x47')],{})[_0x700f('0x23')](function(_0x40ca78){var _0x520a9b=_0x29041e['user'][_0x700f('0x24')]({'plain':!![]});if(!_0x520a9b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x520a9b[_0x700f('0x48')]==='user'){var _0x1d06b2=_0x40ca78[_0x700f('0x24')]({'plain':!![]});var _0x3cbc57=_0x700f('0x25');return db[_0x700f('0x49')][_0x700f('0x46')]({'where':{'name':_0x3cbc57,'userProfileId':_0x520a9b['userProfileId']},'raw':!![]})[_0x700f('0x23')](function(_0x394187){if(_0x394187&&_0x394187[_0x700f('0x4a')]===0x0){return db['UserProfileResource'][_0x700f('0x4b')]({'name':_0x1d06b2['name'],'resourceId':_0x1d06b2['id'],'type':_0x394187[_0x700f('0x29')],'sectionId':_0x394187['id']},{})[_0x700f('0x23')](function(){return _0x40ca78;});}else{return _0x40ca78;}})[_0x700f('0x43')](function(_0x5b3031){logger['error'](_0x700f('0x4c'),_0x5b3031);throw _0x5b3031;});}return _0x40ca78;})[_0x700f('0x23')](respondWithResult(_0x1ad25f,0xc9))[_0x700f('0x43')](handleError(_0x1ad25f,null));};exports[_0x700f('0x21')]=function(_0x44bfcd,_0x458b54){if(_0x44bfcd['body']['id']){delete _0x44bfcd[_0x700f('0x47')]['id'];}return db[_0x700f('0x2b')][_0x700f('0x46')]({'where':{'id':_0x44bfcd[_0x700f('0x45')]['id']}})[_0x700f('0x23')](handleEntityNotFound(_0x458b54,null))[_0x700f('0x23')](saveUpdates(_0x44bfcd[_0x700f('0x47')],null))[_0x700f('0x23')](respondWithResult(_0x458b54,null))[_0x700f('0x43')](handleError(_0x458b54,null));};exports[_0x700f('0x22')]=function(_0x457b65,_0x1c05d3){return db['Schedule'][_0x700f('0x46')]({'where':{'id':_0x457b65['params']['id']}})['then'](handleEntityNotFound(_0x1c05d3,null))[_0x700f('0x23')](removeEntity(_0x1c05d3,null))[_0x700f('0x43')](handleError(_0x1c05d3,null));};exports['run']=function(_0x34778e,_0x4ab4b3,_0xfb5ad7){var _0x4f61c5=require(_0x700f('0x4d'));return db[_0x700f('0x2b')][_0x700f('0x46')]({'where':{'id':_0x34778e['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x4ab4b3,null))['then'](function(){_0x4f61c5[_0x700f('0x4e')](_0x34778e[_0x700f('0x45')]['id']);})[_0x700f('0x23')](respondWithStatusCode(_0x4ab4b3,null))[_0x700f('0x43')](handleError(_0x4ab4b3,null));}; \ No newline at end of file +var _0xadf1=['get','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','Schedule','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../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'];(function(_0x3d6f7c,_0x3821ed){var _0x3f2014=function(_0x4925fd){while(--_0x4925fd){_0x3d6f7c['push'](_0x3d6f7c['shift']());}};_0x3f2014(++_0x3821ed);}(_0xadf1,0x132));var _0x1adf=function(_0x451169,_0x2a6cb8){_0x451169=_0x451169-0x0;var _0x32f84e=_0xadf1[_0x451169];return _0x32f84e;};'use strict';var emlformat=require(_0x1adf('0x0'));var rimraf=require(_0x1adf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1adf('0x2'));var rp=require('request-promise');var moment=require(_0x1adf('0x3'));var BPromise=require(_0x1adf('0x4'));var Mustache=require(_0x1adf('0x5'));var util=require(_0x1adf('0x6'));var path=require(_0x1adf('0x7'));var sox=require('sox');var csv=require(_0x1adf('0x8'));var ejs=require(_0x1adf('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1adf('0xa'));var squel=require(_0x1adf('0xb'));var crypto=require('crypto');var jsforce=require(_0x1adf('0xc'));var deskjs=require(_0x1adf('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1adf('0xe'));var Papa=require(_0x1adf('0xf'));var Redis=require(_0x1adf('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1adf('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1adf('0x12'))(_0x1adf('0x13'));var utils=require('../../config/utils');var config=require(_0x1adf('0x14'));var licenseUtil=require(_0x1adf('0x15'));var db=require(_0x1adf('0x16'))['db'];function respondWithStatusCode(_0x1a7b35,_0x242057){_0x242057=_0x242057||0xcc;return function(_0x21bb4c){if(_0x21bb4c){return _0x1a7b35[_0x1adf('0x17')](_0x242057);}return _0x1a7b35[_0x1adf('0x18')](_0x242057)['end']();};}function respondWithResult(_0xa3c951,_0x256a27){_0x256a27=_0x256a27||0xc8;return function(_0x32e3a9){if(_0x32e3a9){return _0xa3c951[_0x1adf('0x18')](_0x256a27)['json'](_0x32e3a9);}};}function respondWithFilteredResult(_0x443ed1,_0x2d0374){return function(_0x261de0){if(_0x261de0){var _0x13f098=typeof _0x2d0374[_0x1adf('0x19')]===_0x1adf('0x1a')&&typeof _0x2d0374[_0x1adf('0x1b')]===_0x1adf('0x1a');var _0x1ecfe4=_0x261de0[_0x1adf('0x1c')];var _0x463e1a=_0x13f098?0x0:_0x2d0374[_0x1adf('0x19')];var _0xba602a=_0x13f098?_0x261de0[_0x1adf('0x1c')]:_0x2d0374[_0x1adf('0x19')]+_0x2d0374[_0x1adf('0x1b')];var _0x3bae22;if(_0xba602a>=_0x1ecfe4){_0xba602a=_0x1ecfe4;_0x3bae22=0xc8;}else{_0x3bae22=0xce;}_0x443ed1['status'](_0x3bae22);return _0x443ed1[_0x1adf('0x1d')](_0x1adf('0x1e'),_0x463e1a+'-'+_0xba602a+'/'+_0x1ecfe4)[_0x1adf('0x1f')](_0x261de0);}return null;};}function patchUpdates(_0x408ac4){return function(_0x412ad6){try{jsonpatch[_0x1adf('0x20')](_0x412ad6,_0x408ac4,!![]);}catch(_0x3bdeef){return BPromise[_0x1adf('0x21')](_0x3bdeef);}return _0x412ad6[_0x1adf('0x22')]();};}function saveUpdates(_0x49826c,_0x1b3cef){return function(_0x456ec2){if(_0x456ec2){return _0x456ec2[_0x1adf('0x23')](_0x49826c)[_0x1adf('0x24')](function(_0x3d29fa){return _0x3d29fa;});}return null;};}function removeEntity(_0x505865,_0x47a94b){return function(_0x1fc8ad){if(_0x1fc8ad){return _0x1fc8ad[_0x1adf('0x25')]()[_0x1adf('0x24')](function(){var _0x24a1f1=_0x1fc8ad[_0x1adf('0x26')]({'plain':!![]});var _0x25e4c2='Scheduler';return db[_0x1adf('0x27')][_0x1adf('0x25')]({'where':{'type':_0x25e4c2,'resourceId':_0x24a1f1['id']}})['then'](function(){return _0x1fc8ad;});})[_0x1adf('0x24')](function(){_0x505865[_0x1adf('0x18')](0xcc)[_0x1adf('0x28')]();});}};}function handleEntityNotFound(_0x3ae720,_0x96f682){return function(_0x511d41){if(!_0x511d41){_0x3ae720['sendStatus'](0x194);}return _0x511d41;};}function handleError(_0x55048f,_0x5405ab){_0x5405ab=_0x5405ab||0x1f4;return function(_0x3d9a20){logger[_0x1adf('0x29')](_0x3d9a20[_0x1adf('0x2a')]);if(_0x3d9a20[_0x1adf('0x2b')]){delete _0x3d9a20[_0x1adf('0x2b')];}_0x55048f[_0x1adf('0x18')](_0x5405ab)[_0x1adf('0x2c')](_0x3d9a20);};}exports[_0x1adf('0x2d')]=function(_0x2dbbaf,_0x41e290){var _0x6fb08d={},_0x5b4f92={},_0x24512d={'count':0x0,'rows':[]};var _0x582e7b=_[_0x1adf('0x2e')](db['Schedule'][_0x1adf('0x2f')],function(_0x4637ea){return{'name':_0x4637ea['fieldName'],'type':_0x4637ea['type'][_0x1adf('0x30')]};});_0x5b4f92['model']=_[_0x1adf('0x2e')](_0x582e7b,_0x1adf('0x2b'));_0x5b4f92[_0x1adf('0x31')]=_['keys'](_0x2dbbaf[_0x1adf('0x31')]);_0x5b4f92[_0x1adf('0x32')]=_[_0x1adf('0x33')](_0x5b4f92['model'],_0x5b4f92[_0x1adf('0x31')]);_0x6fb08d['attributes']=_[_0x1adf('0x33')](_0x5b4f92[_0x1adf('0x34')],qs[_0x1adf('0x35')](_0x2dbbaf['query'][_0x1adf('0x35')]));_0x6fb08d[_0x1adf('0x36')]=_0x6fb08d[_0x1adf('0x36')][_0x1adf('0x37')]?_0x6fb08d['attributes']:_0x5b4f92[_0x1adf('0x34')];if(!_0x2dbbaf[_0x1adf('0x31')][_0x1adf('0x38')]('nolimit')){_0x6fb08d[_0x1adf('0x1b')]=qs[_0x1adf('0x1b')](_0x2dbbaf['query'][_0x1adf('0x1b')]);_0x6fb08d[_0x1adf('0x19')]=qs[_0x1adf('0x19')](_0x2dbbaf[_0x1adf('0x31')][_0x1adf('0x19')]);}_0x6fb08d[_0x1adf('0x39')]=qs[_0x1adf('0x3a')](_0x2dbbaf[_0x1adf('0x31')][_0x1adf('0x3a')]);_0x6fb08d[_0x1adf('0x3b')]=qs[_0x1adf('0x32')](_[_0x1adf('0x3c')](_0x2dbbaf['query'],_0x5b4f92['filters']),_0x582e7b);if(_0x2dbbaf[_0x1adf('0x31')][_0x1adf('0x3d')]){_0x6fb08d[_0x1adf('0x3b')]=_[_0x1adf('0x3e')](_0x6fb08d['where'],{'$or':_[_0x1adf('0x2e')](_0x582e7b,function(_0x1c6a6a){if(_0x1c6a6a[_0x1adf('0x3f')]!==_0x1adf('0x40')){var _0x4452a7={};_0x4452a7[_0x1c6a6a['name']]={'$like':'%'+_0x2dbbaf[_0x1adf('0x31')][_0x1adf('0x3d')]+'%'};return _0x4452a7;}})});}_0x6fb08d=_[_0x1adf('0x3e')]({},_0x6fb08d,_0x2dbbaf[_0x1adf('0x41')]);var _0x496c42={'where':_0x6fb08d[_0x1adf('0x3b')]};return db[_0x1adf('0x42')][_0x1adf('0x1c')](_0x496c42)[_0x1adf('0x24')](function(_0x324a93){_0x24512d['count']=_0x324a93;if(_0x2dbbaf[_0x1adf('0x31')][_0x1adf('0x43')]){_0x6fb08d[_0x1adf('0x44')]=[{'all':!![]}];}return db[_0x1adf('0x42')][_0x1adf('0x45')](_0x6fb08d);})[_0x1adf('0x24')](function(_0x52b698){_0x24512d[_0x1adf('0x46')]=_0x52b698;return _0x24512d;})[_0x1adf('0x24')](respondWithFilteredResult(_0x41e290,_0x6fb08d))[_0x1adf('0x47')](handleError(_0x41e290,null));};exports[_0x1adf('0x48')]=function(_0x320c6a,_0x535228){var _0x19f7a8={'raw':![],'where':{'id':_0x320c6a[_0x1adf('0x49')]['id']}},_0x376024={};_0x376024[_0x1adf('0x34')]=_[_0x1adf('0x4a')](db[_0x1adf('0x42')][_0x1adf('0x2f')]);_0x376024[_0x1adf('0x31')]=_[_0x1adf('0x4a')](_0x320c6a[_0x1adf('0x31')]);_0x376024[_0x1adf('0x32')]=_['intersection'](_0x376024[_0x1adf('0x34')],_0x376024[_0x1adf('0x31')]);_0x19f7a8['attributes']=_[_0x1adf('0x33')](_0x376024['model'],qs[_0x1adf('0x35')](_0x320c6a[_0x1adf('0x31')]['fields']));_0x19f7a8[_0x1adf('0x36')]=_0x19f7a8[_0x1adf('0x36')]['length']?_0x19f7a8[_0x1adf('0x36')]:_0x376024[_0x1adf('0x34')];if(_0x320c6a[_0x1adf('0x31')]['includeAll']){_0x19f7a8['include']=[{'all':!![]}];}_0x19f7a8=_['merge']({},_0x19f7a8,_0x320c6a['options']);return db[_0x1adf('0x42')][_0x1adf('0x4b')](_0x19f7a8)[_0x1adf('0x24')](handleEntityNotFound(_0x535228,null))[_0x1adf('0x24')](respondWithResult(_0x535228,null))['catch'](handleError(_0x535228,null));};exports['create']=function(_0x501b90,_0x26ac2b){return db['Schedule'][_0x1adf('0x4c')](_0x501b90[_0x1adf('0x4d')],{})['then'](function(_0x224e02){var _0x1bb8da=_0x501b90[_0x1adf('0x4e')]['get']({'plain':!![]});if(!_0x1bb8da)throw new Error(_0x1adf('0x4f'));if(_0x1bb8da[_0x1adf('0x50')]==='user'){var _0x458e4d=_0x224e02[_0x1adf('0x26')]({'plain':!![]});var _0x711460='Scheduler';return db[_0x1adf('0x51')][_0x1adf('0x4b')]({'where':{'name':_0x711460,'userProfileId':_0x1bb8da['userProfileId']},'raw':!![]})[_0x1adf('0x24')](function(_0x309fda){if(_0x309fda&&_0x309fda[_0x1adf('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0x458e4d['name'],'resourceId':_0x458e4d['id'],'type':_0x309fda['name'],'sectionId':_0x309fda['id']},{})[_0x1adf('0x24')](function(){return _0x224e02;});}else{return _0x224e02;}})[_0x1adf('0x47')](function(_0xa49c47){logger['error'](_0x1adf('0x53'),_0xa49c47);throw _0xa49c47;});}return _0x224e02;})['then'](respondWithResult(_0x26ac2b,0xc9))[_0x1adf('0x47')](handleError(_0x26ac2b,null));};exports[_0x1adf('0x23')]=function(_0x4d521c,_0x354f4c){if(_0x4d521c['body']['id']){delete _0x4d521c['body']['id'];}return db['Schedule'][_0x1adf('0x4b')]({'where':{'id':_0x4d521c[_0x1adf('0x49')]['id']}})[_0x1adf('0x24')](handleEntityNotFound(_0x354f4c,null))[_0x1adf('0x24')](saveUpdates(_0x4d521c[_0x1adf('0x4d')],null))[_0x1adf('0x24')](respondWithResult(_0x354f4c,null))[_0x1adf('0x47')](handleError(_0x354f4c,null));};exports['destroy']=function(_0x45a62f,_0x3b91ac){return db[_0x1adf('0x42')][_0x1adf('0x4b')]({'where':{'id':_0x45a62f[_0x1adf('0x49')]['id']}})[_0x1adf('0x24')](handleEntityNotFound(_0x3b91ac,null))['then'](removeEntity(_0x3b91ac,null))[_0x1adf('0x47')](handleError(_0x3b91ac,null));};exports[_0x1adf('0x54')]=function(_0x3ac05e,_0x36e653,_0x39022e){var _0x21be84=require(_0x1adf('0x55'));return db[_0x1adf('0x42')][_0x1adf('0x4b')]({'where':{'id':_0x3ac05e['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x36e653,null))[_0x1adf('0x24')](function(){_0x21be84[_0x1adf('0x54')](_0x3ac05e[_0x1adf('0x49')]['id']);})[_0x1adf('0x24')](respondWithStatusCode(_0x36e653,null))[_0x1adf('0x47')](handleError(_0x36e653,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 6ca5bc8..8b112cb 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 _0x24fc=['exports','define','lodash','util','moment','bluebird','request-promise','path','./schedule.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x24fc,0x92));var _0xc24f=function(_0x2b0aaf,_0xa14e1f){_0x2b0aaf=_0x2b0aaf-0x0;var _0x34edff=_0x24fc[_0x2b0aaf];return _0x34edff;};'use strict';var _=require(_0xc24f('0x0'));var util=require(_0xc24f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc24f('0x2'));var BPromise=require(_0xc24f('0x3'));var rp=require(_0xc24f('0x4'));var fs=require('fs');var path=require(_0xc24f('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc24f('0x6'));module[_0xc24f('0x7')]=function(_0x3d6d49,_0x46fc23){return _0x3d6d49[_0xc24f('0x8')]('Schedule',attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x90ff=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','Schedule','tools_schedules','lodash','util','api'];(function(_0x3ffa07,_0x5989f7){var _0x1c3050=function(_0x640bd){while(--_0x640bd){_0x3ffa07['push'](_0x3ffa07['shift']());}};_0x1c3050(++_0x5989f7);}(_0x90ff,0x159));var _0xf90f=function(_0x240cee,_0x4e407f){_0x240cee=_0x240cee-0x0;var _0x3874c0=_0x90ff[_0x240cee];return _0x3874c0;};'use strict';var _=require(_0xf90f('0x0'));var util=require(_0xf90f('0x1'));var logger=require('../../config/logger')(_0xf90f('0x2'));var moment=require(_0xf90f('0x3'));var BPromise=require(_0xf90f('0x4'));var rp=require(_0xf90f('0x5'));var fs=require('fs');var path=require(_0xf90f('0x6'));var rimraf=require(_0xf90f('0x7'));var config=require(_0xf90f('0x8'));var attributes=require('./schedule.attributes');module['exports']=function(_0x4eff5b,_0x19c3fd){return _0x4eff5b[_0xf90f('0x9')](_0xf90f('0xa'),attributes,{'tableName':_0xf90f('0xb'),'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 ab0b498..ace9428 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 _0x6bf3=['http','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','error','code','message','Schedule,\x20%s,\x20%s','info','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1118da,_0x2fde4c){var _0x7374da=function(_0x46f897){while(--_0x46f897){_0x1118da['push'](_0x1118da['shift']());}};_0x7374da(++_0x2fde4c);}(_0x6bf3,0x107));var _0x36bf=function(_0x47944c,_0x5c5b09){_0x47944c=_0x47944c-0x0;var _0x363e88=_0x6bf3[_0x47944c];return _0x363e88;};'use strict';var _=require(_0x36bf('0x0'));var util=require('util');var moment=require(_0x36bf('0x1'));var BPromise=require(_0x36bf('0x2'));var rs=require(_0x36bf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x36bf('0x4'))['db'];var utils=require(_0x36bf('0x5'));var logger=require(_0x36bf('0x6'))(_0x36bf('0x7'));var config=require(_0x36bf('0x8'));var jayson=require(_0x36bf('0x9'));var client=jayson['client'][_0x36bf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1cbc5e,_0x3abd57,_0x29b319){return new BPromise(function(_0x4d857f,_0x440758){return client['request'](_0x1cbc5e,_0x29b319)['then'](function(_0x5a72c8){logger['info']('Schedule,\x20%s,\x20%s',_0x3abd57,_0x36bf('0xb'));logger[_0x36bf('0xc')](_0x36bf('0xd'),_0x3abd57,_0x36bf('0xb'),JSON['stringify'](_0x5a72c8));if(_0x5a72c8['error']){if(_0x5a72c8[_0x36bf('0xe')][_0x36bf('0xf')]===0x1f4){logger['error']('Schedule,\x20%s,\x20%s',_0x3abd57,_0x5a72c8[_0x36bf('0xe')][_0x36bf('0x10')]);return _0x440758(_0x5a72c8['error']['message']);}logger['error'](_0x36bf('0x11'),_0x3abd57,_0x5a72c8[_0x36bf('0xe')]['message']);return _0x4d857f(_0x5a72c8[_0x36bf('0xe')]['message']);}else{logger[_0x36bf('0x12')](_0x36bf('0x11'),_0x3abd57,_0x36bf('0xb'));_0x4d857f(_0x5a72c8[_0x36bf('0x13')][_0x36bf('0x10')]);}})[_0x36bf('0x14')](function(_0x2e0548){logger['error'](_0x36bf('0x11'),_0x3abd57,_0x2e0548);_0x440758(_0x2e0548);});});} \ No newline at end of file +var _0x8ce5=['../../config/logger','../../config/environment','client','http','request','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x58bb6b,_0x38e74f){var _0x3a0adc=function(_0x715739){while(--_0x715739){_0x58bb6b['push'](_0x58bb6b['shift']());}};_0x3a0adc(++_0x38e74f);}(_0x8ce5,0x1dc));var _0x58ce=function(_0x1a868,_0x22e7cd){_0x1a868=_0x1a868-0x0;var _0x34250f=_0x8ce5[_0x1a868];return _0x34250f;};'use strict';var _=require(_0x58ce('0x0'));var util=require(_0x58ce('0x1'));var moment=require(_0x58ce('0x2'));var BPromise=require('bluebird');var rs=require(_0x58ce('0x3'));var fs=require('fs');var Redis=require(_0x58ce('0x4'));var db=require(_0x58ce('0x5'))['db'];var utils=require(_0x58ce('0x6'));var logger=require(_0x58ce('0x7'))('rpc');var config=require(_0x58ce('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x58ce('0x9')][_0x58ce('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x629931,_0x331324,_0x149e2c){return new BPromise(function(_0x34286e,_0x220f56){return client[_0x58ce('0xb')](_0x629931,_0x149e2c)['then'](function(_0x2c4601){logger['info'](_0x58ce('0xc'),_0x331324,_0x58ce('0xd'));logger[_0x58ce('0xe')](_0x58ce('0xf'),_0x331324,_0x58ce('0xd'),JSON[_0x58ce('0x10')](_0x2c4601));if(_0x2c4601[_0x58ce('0x11')]){if(_0x2c4601['error'][_0x58ce('0x12')]===0x1f4){logger[_0x58ce('0x11')](_0x58ce('0xc'),_0x331324,_0x2c4601[_0x58ce('0x11')][_0x58ce('0x13')]);return _0x220f56(_0x2c4601[_0x58ce('0x11')][_0x58ce('0x13')]);}logger['error']('Schedule,\x20%s,\x20%s',_0x331324,_0x2c4601['error'][_0x58ce('0x13')]);return _0x34286e(_0x2c4601[_0x58ce('0x11')][_0x58ce('0x13')]);}else{logger[_0x58ce('0x14')](_0x58ce('0xc'),_0x331324,_0x58ce('0xd'));_0x34286e(_0x2c4601[_0x58ce('0x15')][_0x58ce('0x13')]);}})[_0x58ce('0x16')](function(_0x26e3c8){logger[_0x58ce('0x11')](_0x58ce('0xc'),_0x331324,_0x26e3c8);_0x220f56(_0x26e3c8);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index f98b026..678fe65 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 _0xd562=['express','Router','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/download','post','create','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x465ada,_0x3e009c){var _0x836a91=function(_0x3cf028){while(--_0x3cf028){_0x465ada['push'](_0x465ada['shift']());}};_0x836a91(++_0x3e009c);}(_0xd562,0x165));var _0x2d56=function(_0x2eb800,_0x23ed7b){_0x2eb800=_0x2eb800-0x0;var _0xbf0bd8=_0xd562[_0x2eb800];return _0xbf0bd8;};'use strict';var multer=require(_0x2d56('0x0'));var util=require(_0x2d56('0x1'));var path=require('path');var timeout=require(_0x2d56('0x2'));var express=require(_0x2d56('0x3'));var router=express[_0x2d56('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2d56('0x5'));var config=require(_0x2d56('0x6'));var controller=require(_0x2d56('0x7'));router[_0x2d56('0x8')]('/',auth[_0x2d56('0x9')](),controller[_0x2d56('0xa')]);router[_0x2d56('0x8')](_0x2d56('0xb'),auth[_0x2d56('0x9')](),controller[_0x2d56('0xc')]);router[_0x2d56('0x8')](_0x2d56('0xd'),auth[_0x2d56('0x9')](),controller['show']);router[_0x2d56('0x8')](_0x2d56('0xe'),auth['isAuthenticated'](),controller['download']);router[_0x2d56('0xf')]('/',auth[_0x2d56('0x9')](),controller[_0x2d56('0x10')]);router['put'](_0x2d56('0xd'),auth[_0x2d56('0x9')](),controller['update']);router[_0x2d56('0x11')]('/:id',auth[_0x2d56('0x9')](),controller[_0x2d56('0x12')]);module[_0x2d56('0x13')]=router; \ No newline at end of file +var _0x2bfe=['/describe','describe','/:id','show','/:id/download','post','create','update','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./screenRecording.controller','get','isAuthenticated','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2bfe,0x73));var _0xe2bf=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0x2bfe[_0x424a9a];return _0xa7831c;};'use strict';var multer=require(_0xe2bf('0x0'));var util=require(_0xe2bf('0x1'));var path=require(_0xe2bf('0x2'));var timeout=require('connect-timeout');var express=require(_0xe2bf('0x3'));var router=express[_0xe2bf('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe2bf('0x5'));var interaction=require(_0xe2bf('0x6'));var config=require('../../config/environment');var controller=require(_0xe2bf('0x7'));router[_0xe2bf('0x8')]('/',auth[_0xe2bf('0x9')](),controller[_0xe2bf('0xa')]);router[_0xe2bf('0x8')](_0xe2bf('0xb'),auth[_0xe2bf('0x9')](),controller[_0xe2bf('0xc')]);router[_0xe2bf('0x8')](_0xe2bf('0xd'),auth['isAuthenticated'](),controller[_0xe2bf('0xe')]);router['get'](_0xe2bf('0xf'),auth[_0xe2bf('0x9')](),controller['download']);router[_0xe2bf('0x10')]('/',auth[_0xe2bf('0x9')](),controller[_0xe2bf('0x11')]);router['put']('/:id',auth[_0xe2bf('0x9')](),controller[_0xe2bf('0x12')]);router[_0xe2bf('0x13')]('/:id',auth[_0xe2bf('0x9')](),controller['destroy']);module[_0xe2bf('0x14')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index c07da14..faa4c09 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 _0x4ca7=['sequelize','moment','path','exports','VIRTUAL','extname','value','STRING','replace','setDataValue','INTEGER','startedAt','closedAt','duration','DATE','getDataValue','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt'];(function(_0x508eb2,_0x139f8b){var _0x398037=function(_0x5c7ca8){while(--_0x5c7ca8){_0x508eb2['push'](_0x508eb2['shift']());}};_0x398037(++_0x139f8b);}(_0x4ca7,0x1e3));var _0x74ca=function(_0x1c341f,_0x5d6e8c){_0x1c341f=_0x1c341f-0x0;var _0x29a4d8=_0x4ca7[_0x1c341f];return _0x29a4d8;};'use strict';var Sequelize=require(_0x74ca('0x0'));var moment=require(_0x74ca('0x1'));var path=require(_0x74ca('0x2'));var config=require('../../config/environment');module[_0x74ca('0x3')]={'format':{'type':Sequelize[_0x74ca('0x4')],'get':function(){return this['getDataValue']('value')?path[_0x74ca('0x5')](this['getDataValue'](_0x74ca('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x74ca('0x7')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x74ca('0x7')],'set':function(_0x572dc2){var _0x453b45=_0x572dc2[_0x74ca('0x8')](/\\/g,'/');this[_0x74ca('0x9')](_0x74ca('0x6'),_0x453b45);}},'rating':{'type':Sequelize[_0x74ca('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x74ca('0xa')],'set':function(_0x116715){this['setDataValue'](_0x74ca('0xb'),moment()['subtract'](_0x116715,'ms'));this[_0x74ca('0x9')](_0x74ca('0xc'),moment());this['setDataValue'](_0x74ca('0xd'),_0x116715);}},'startedAt':{'type':Sequelize[_0x74ca('0xe')],'get':function(){return moment(this[_0x74ca('0xf')](_0x74ca('0xb')))[_0x74ca('0x10')](_0x74ca('0x11'))[_0x74ca('0x12')]();}},'closedAt':{'type':Sequelize[_0x74ca('0xe')],'get':function(){return moment(this['getDataValue'](_0x74ca('0xc')))[_0x74ca('0x10')](_0x74ca('0x11'))[_0x74ca('0x12')]();}},'createdAt':{'type':Sequelize[_0x74ca('0xe')],'get':function(){return moment(this[_0x74ca('0xf')](_0x74ca('0x13')))[_0x74ca('0x10')](_0x74ca('0x11'))[_0x74ca('0x12')]();}},'updatedAt':{'type':Sequelize[_0x74ca('0xe')],'get':function(){return moment(this[_0x74ca('0xf')](_0x74ca('0x14')))[_0x74ca('0x10')]('MM-DD-YYYY\x20HH:mm')[_0x74ca('0x12')]();}}}; \ No newline at end of file +var _0xd878=['duration','DATE','MM-DD-YYYY\x20HH:mm','format','createdAt','toString','updatedAt','sequelize','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value','STRING','replace','setDataValue','INTEGER','startedAt','closedAt'];(function(_0x454396,_0x3368c4){var _0x587a1c=function(_0x58b0fe){while(--_0x58b0fe){_0x454396['push'](_0x454396['shift']());}};_0x587a1c(++_0x3368c4);}(_0xd878,0x118));var _0x8d87=function(_0x311f12,_0x2bedc3){_0x311f12=_0x311f12-0x0;var _0x5b9dcb=_0xd878[_0x311f12];return _0x5b9dcb;};'use strict';var Sequelize=require(_0x8d87('0x0'));var moment=require(_0x8d87('0x1'));var path=require(_0x8d87('0x2'));var config=require(_0x8d87('0x3'));module[_0x8d87('0x4')]={'format':{'type':Sequelize[_0x8d87('0x5')],'get':function(){return this[_0x8d87('0x6')]('value')?path['extname'](this['getDataValue'](_0x8d87('0x7'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x8d87('0x8')],'set':function(_0x1b504e){var _0xcb4dae=_0x1b504e[_0x8d87('0x9')](/\\/g,'/');this[_0x8d87('0xa')](_0x8d87('0x7'),_0xcb4dae);}},'rating':{'type':Sequelize[_0x8d87('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x8d87('0xb')],'set':function(_0xf6aa49){this['setDataValue'](_0x8d87('0xc'),moment()['subtract'](_0xf6aa49,'ms'));this['setDataValue'](_0x8d87('0xd'),moment());this[_0x8d87('0xa')](_0x8d87('0xe'),_0xf6aa49);}},'startedAt':{'type':Sequelize[_0x8d87('0xf')],'get':function(){return moment(this[_0x8d87('0x6')](_0x8d87('0xc')))['format'](_0x8d87('0x10'))['toString']();}},'closedAt':{'type':Sequelize[_0x8d87('0xf')],'get':function(){return moment(this['getDataValue'](_0x8d87('0xd')))[_0x8d87('0x11')](_0x8d87('0x10'))['toString']();}},'createdAt':{'type':Sequelize[_0x8d87('0xf')],'get':function(){return moment(this[_0x8d87('0x6')](_0x8d87('0x12')))[_0x8d87('0x11')](_0x8d87('0x10'))[_0x8d87('0x13')]();}},'updatedAt':{'type':Sequelize[_0x8d87('0xf')],'get':function(){return moment(this[_0x8d87('0x6')](_0x8d87('0x14')))['format'](_0x8d87('0x10'))[_0x8d87('0x13')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index bc0f358..4ca60ce 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 _0x9957=['sort','pick','filter','where','merge','map','VIRTUAL','options','ScreenRecording','includeAll','include','catch','show','rawAttributes','find','create','body','duration','closedAt','params','describe','download','uniqueid','value','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','Sequelize','filename','extname','unlink','message','ScreenRecording\x20not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','differenceBy','format','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order'];(function(_0x45516a,_0x3a1b59){var _0x314a6c=function(_0x46f841){while(--_0x46f841){_0x45516a['push'](_0x45516a['shift']());}};_0x314a6c(++_0x3a1b59);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ScreenRecording']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_['map'](_0x4253e5,'name'),[_0x7995('0x31')]);_0x456a28['query']=_[_0x7995('0x32')](_0x4b6f99[_0x7995('0x33')]);_0x456a28[_0x7995('0x34')]=_[_0x7995('0x35')](_0x456a28[_0x7995('0x2f')],_0x456a28['query']);_0x514445[_0x7995('0x36')]=_[_0x7995('0x35')](_0x456a28['model'],qs['fields'](_0x4b6f99['query'][_0x7995('0x37')]));_0x514445[_0x7995('0x36')]=_0x514445['attributes'][_0x7995('0x38')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99[_0x7995('0x33')][_0x7995('0x39')]('nolimit')){_0x514445['limit']=qs[_0x7995('0x21')](_0x4b6f99['query']['limit']);_0x514445[_0x7995('0x20')]=qs[_0x7995('0x20')](_0x4b6f99['query'][_0x7995('0x20')]);}_0x514445[_0x7995('0x3a')]=qs[_0x7995('0x3b')](_0x4b6f99[_0x7995('0x33')][_0x7995('0x3b')]);_0x514445['where']=qs[_0x7995('0x34')](_[_0x7995('0x3c')](_0x4b6f99[_0x7995('0x33')],_0x456a28[_0x7995('0x34')]),_0x4253e5);if(_0x4b6f99['query'][_0x7995('0x3d')]){_0x514445[_0x7995('0x3e')]=_[_0x7995('0x3f')](_0x514445[_0x7995('0x3e')],{'$or':_[_0x7995('0x40')](_0x4253e5,function(_0x1035dc){if(_0x1035dc['type']!==_0x7995('0x41')){var _0x3be298={};_0x3be298[_0x1035dc[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x33')][_0x7995('0x3d')]+'%'};return _0x3be298;}})});}_0x514445=_[_0x7995('0x3f')]({},_0x514445,_0x4b6f99[_0x7995('0x42')]);var _0x270c0e={'where':_0x514445[_0x7995('0x3e')]};return db[_0x7995('0x43')][_0x7995('0x1f')](_0x270c0e)[_0x7995('0x26')](function(_0x7b4e67){_0x3250e0['count']=_0x7b4e67;if(_0x4b6f99['query'][_0x7995('0x44')]){_0x514445[_0x7995('0x45')]=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x514445);})[_0x7995('0x26')](function(_0x4a9fef){_0x3250e0['rows']=_0x4a9fef;return _0x3250e0;})[_0x7995('0x26')](respondWithFilteredResult(_0x9b2a15,_0x514445))[_0x7995('0x46')](handleError(_0x9b2a15,null));};exports[_0x7995('0x47')]=function(_0x576b96,_0x46ac4f){var _0x5e85b9={'raw':![],'where':{'id':_0x576b96['params']['id']}},_0x3993b5={};_0x3993b5['model']=_[_0x7995('0x32')](db[_0x7995('0x43')][_0x7995('0x48')]);_0x3993b5[_0x7995('0x33')]=_['keys'](_0x576b96[_0x7995('0x33')]);_0x3993b5[_0x7995('0x34')]=_[_0x7995('0x35')](_0x3993b5[_0x7995('0x2f')],_0x3993b5['query']);_0x5e85b9['attributes']=_[_0x7995('0x35')](_0x3993b5['model'],qs[_0x7995('0x37')](_0x576b96['query'][_0x7995('0x37')]));_0x5e85b9['attributes']=_0x5e85b9[_0x7995('0x36')][_0x7995('0x38')]?_0x5e85b9['attributes']:_0x3993b5[_0x7995('0x2f')];if(_0x576b96[_0x7995('0x33')][_0x7995('0x44')]){_0x5e85b9[_0x7995('0x45')]=[{'all':!![]}];}_0x5e85b9=_['merge']({},_0x5e85b9,_0x576b96[_0x7995('0x42')]);return db[_0x7995('0x43')][_0x7995('0x49')](_0x5e85b9)['then'](handleEntityNotFound(_0x46ac4f,null))[_0x7995('0x26')](respondWithResult(_0x46ac4f,null))[_0x7995('0x46')](handleError(_0x46ac4f,null));};exports[_0x7995('0x4a')]=function(_0x3d8ae3,_0x255313){return db['ScreenRecording'][_0x7995('0x4a')](_0x3d8ae3[_0x7995('0x4b')],{})['then'](respondWithResult(_0x255313,0xc9))[_0x7995('0x46')](handleError(_0x255313,null));};exports['update']=function(_0x1d87f9,_0x187735){if(_0x1d87f9[_0x7995('0x4b')]['id']){delete _0x1d87f9[_0x7995('0x4b')]['id'];}delete _0x1d87f9[_0x7995('0x4b')][_0x7995('0x4c')];delete _0x1d87f9[_0x7995('0x4b')]['createdAt'];delete _0x1d87f9[_0x7995('0x4b')][_0x7995('0x4d')];delete _0x1d87f9[_0x7995('0x4b')]['value'];return db[_0x7995('0x43')][_0x7995('0x49')]({'where':{'id':_0x1d87f9[_0x7995('0x4e')]['id']}})['then'](handleEntityNotFound(_0x187735,null))['then'](saveUpdates(_0x1d87f9['body'],null))[_0x7995('0x26')](respondWithResult(_0x187735,null))[_0x7995('0x46')](handleError(_0x187735,null));};exports['describe']=function(_0x1cd85,_0x29f300){return db[_0x7995('0x43')][_0x7995('0x4f')]()[_0x7995('0x26')](respondWithResult(_0x29f300,null))['catch'](handleError(_0x29f300,null));};exports[_0x7995('0x50')]=function(_0x4ab09f,_0x14fe7f,_0x33c801){var _0x206d2a=require('../../components/encryptor');var _0x5e1f34=![];var _0x54e2b1={};if(_0x4ab09f['query'][_0x7995('0x2d')]&&_0x4ab09f[_0x7995('0x33')][_0x7995('0x2d')]===_0x7995('0x51')){_0x54e2b1[_0x7995('0x51')]=_0x4ab09f[_0x7995('0x4e')]['id'];}else{_0x54e2b1['id']=_0x4ab09f[_0x7995('0x4e')]['id'];}return db[_0x7995('0x43')][_0x7995('0x49')]({'where':_0x54e2b1,'attributes':['id',_0x7995('0x52')],'raw':!![]})[_0x7995('0x26')](handleEntityNotFound(_0x14fe7f,null))[_0x7995('0x26')](function(_0x3da72b){if(_0x3da72b){var _0x35bea3=path[_0x7995('0x53')](config[_0x7995('0x54')],_0x7995('0x55'),_0x3da72b[_0x7995('0x52')]);var _0x45e86e=util['format'](_0x7995('0x56'),_0x35bea3);if(fs[_0x7995('0x57')](_0x45e86e)){_0x5e1f34=!![];return _0x206d2a[_0x7995('0x58')](_0x45e86e,_0x35bea3,config[_0x7995('0x59')]['recording'])['then'](function(){return _0x3da72b;});}return _0x3da72b;}})[_0x7995('0x26')](function(_0x197b52){if(_0x197b52){var _0x5b9467=path[_0x7995('0x53')](config['root'],_0x7995('0x55'),_0x197b52[_0x7995('0x52')]);if(!fs[_0x7995('0x57')](_0x5b9467)){throw new db[(_0x7995('0x5a'))]['ValidationError']('ScreenRecording\x20not\x20found');}if(_0x197b52[_0x7995('0x5b')]){return _0x14fe7f[_0x7995('0x50')](_0x5b9467,_0x197b52[_0x7995('0x5b')]+path[_0x7995('0x5c')](_0x5b9467),function(){if(_0x5e1f34){fs[_0x7995('0x5d')](_0x5b9467);}});}else{return _0x14fe7f[_0x7995('0x50')](_0x5b9467,function(_0x1d4689){if(_0x5e1f34){fs[_0x7995('0x5d')](_0x5b9467);}});}}})[_0x7995('0x46')](function(_0x50caf5){if(_0x50caf5[_0x7995('0x5e')]===_0x7995('0x5f')){_0x14fe7f[_0x7995('0x1c')](0x194)[_0x7995('0x2a')]('Not\x20found');}else{return handleError(_0x14fe7f,null);}});};exports['destroy']=function(_0x3053fd,_0xebb5c8){return db['ScreenRecording'][_0x7995('0x49')]({'where':{'id':_0x3053fd[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](function(_0x57727e){if(_[_0x7995('0x60')](_0x57727e)){throw new ReferenceError('Entity\x20not\x20found');}return _0x57727e;})[_0x7995('0x26')](function(_0x564fca){var _0x3e0a46=path[_0x7995('0x53')](config[_0x7995('0x54')],_0x7995('0x55'),_0x564fca[_0x7995('0x52')]);logger[_0x7995('0x61')](_0x7995('0x62'),_0x3e0a46);if(!_[_0x7995('0x60')](_0x564fca[_0x7995('0x52')])&&fs[_0x7995('0x57')](_0x3e0a46)){logger[_0x7995('0x61')](_0x7995('0x63')+_0x3e0a46+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x7995('0x64')](_0x3e0a46);}_0x3e0a46=_0x3e0a46+_0x7995('0x65');if(!_[_0x7995('0x60')](_0x564fca[_0x7995('0x52')])&&fs[_0x7995('0x57')](_0x3e0a46)){logger['info']('File:\x20\x22'+_0x3e0a46+_0x7995('0x66'));fs[_0x7995('0x64')](_0x3e0a46);}return _0x564fca;})[_0x7995('0x26')](function(_0xae6166){if(!_0xae6166)throw new InternalError();return _0xae6166['destroy']();})[_0x7995('0x26')](function(){_0xebb5c8['status'](0xcc)['end']();})[_0x7995('0x46')](handleError(_0xebb5c8,null));}; \ No newline at end of file +var _0x5c12=['undefined','count','set','Content-Range','apply','reject','update','then','destroy','end','sendStatus','error','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','differenceBy','format','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','merge','filter','include','rows','catch','keys','includeAll','options','find','create','body','createdAt','closedAt','value','params','describe','download','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','json','limit'];(function(_0x3357b6,_0xa8881c){var _0x207c20=function(_0x393d6a){while(--_0x393d6a){_0x3357b6['push'](_0x3357b6['shift']());}};_0x207c20(++_0xa8881c);}(_0x5c12,0x188));var _0x25c1=function(_0x57928b,_0x29a111){_0x57928b=_0x57928b-0x0;var _0x49aad6=_0x5c12[_0x57928b];return _0x49aad6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x25c1('0x0'));var zipdir=require(_0x25c1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x25c1('0x2'));var moment=require(_0x25c1('0x3'));var BPromise=require(_0x25c1('0x4'));var Mustache=require(_0x25c1('0x5'));var util=require(_0x25c1('0x6'));var path=require(_0x25c1('0x7'));var sox=require(_0x25c1('0x8'));var csv=require('to-csv');var ejs=require(_0x25c1('0x9'));var fs=require('fs');var fs_extra=require(_0x25c1('0xa'));var _=require(_0x25c1('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x25c1('0xc'));var deskjs=require(_0x25c1('0xd'));var toCsv=require(_0x25c1('0xe'));var querystring=require(_0x25c1('0xf'));var Papa=require(_0x25c1('0x10'));var Redis=require('ioredis');var authService=require(_0x25c1('0x11'));var qs=require(_0x25c1('0x12'));var as=require(_0x25c1('0x13'));var hardwareService=require(_0x25c1('0x14'));var logger=require(_0x25c1('0x15'))('api');var utils=require(_0x25c1('0x16'));var config=require(_0x25c1('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x25c1('0x18'))['db'];function respondWithStatusCode(_0x209af5,_0x323d3c){_0x323d3c=_0x323d3c||0xcc;return function(_0x329ba9){if(_0x329ba9){return _0x209af5['sendStatus'](_0x323d3c);}return _0x209af5['status'](_0x323d3c)['end']();};}function respondWithResult(_0x54f6f4,_0x3ef429){_0x3ef429=_0x3ef429||0xc8;return function(_0x1412ed){if(_0x1412ed){return _0x54f6f4[_0x25c1('0x19')](_0x3ef429)[_0x25c1('0x1a')](_0x1412ed);}};}function respondWithFilteredResult(_0x17a032,_0x4ea926){return function(_0x4638f0){if(_0x4638f0){var _0x55b62d=typeof _0x4ea926['offset']==='undefined'&&typeof _0x4ea926[_0x25c1('0x1b')]===_0x25c1('0x1c');var _0x4dc64b=_0x4638f0['count'];var _0x61a29f=_0x55b62d?0x0:_0x4ea926['offset'];var _0x7175d4=_0x55b62d?_0x4638f0[_0x25c1('0x1d')]:_0x4ea926['offset']+_0x4ea926['limit'];var _0x542768;if(_0x7175d4>=_0x4dc64b){_0x7175d4=_0x4dc64b;_0x542768=0xc8;}else{_0x542768=0xce;}_0x17a032[_0x25c1('0x19')](_0x542768);return _0x17a032[_0x25c1('0x1e')](_0x25c1('0x1f'),_0x61a29f+'-'+_0x7175d4+'/'+_0x4dc64b)[_0x25c1('0x1a')](_0x4638f0);}return null;};}function patchUpdates(_0x481c12){return function(_0x119639){try{jsonpatch[_0x25c1('0x20')](_0x119639,_0x481c12,!![]);}catch(_0x34454a){return BPromise[_0x25c1('0x21')](_0x34454a);}return _0x119639['save']();};}function saveUpdates(_0x4c3259,_0x2a8a84){return function(_0xac3335){if(_0xac3335){return _0xac3335[_0x25c1('0x22')](_0x4c3259)[_0x25c1('0x23')](function(_0x15cf2f){return _0x15cf2f;});}return null;};}function removeEntity(_0x1a4b89,_0x2ba595){return function(_0x324ea9){if(_0x324ea9){return _0x324ea9[_0x25c1('0x24')]()[_0x25c1('0x23')](function(){_0x1a4b89[_0x25c1('0x19')](0xcc)[_0x25c1('0x25')]();});}};}function handleEntityNotFound(_0x399d72,_0x4915cc){return function(_0x2dadae){if(!_0x2dadae){_0x399d72[_0x25c1('0x26')](0x194);}return _0x2dadae;};}function handleError(_0x1b1c96,_0x1fb59f){_0x1fb59f=_0x1fb59f||0x1f4;return function(_0x21fdb8){logger[_0x25c1('0x27')](_0x21fdb8['stack']);if(_0x21fdb8[_0x25c1('0x28')]){delete _0x21fdb8[_0x25c1('0x28')];}_0x1b1c96[_0x25c1('0x19')](_0x1fb59f)[_0x25c1('0x29')](_0x21fdb8);};}exports[_0x25c1('0x2a')]=function(_0x193a68,_0x5c56ab){var _0x1e498={},_0x478f1e={},_0x76b360={'count':0x0,'rows':[]};var _0x31c153=_[_0x25c1('0x2b')](db[_0x25c1('0x2c')][_0x25c1('0x2d')],function(_0x21069c){return{'name':_0x21069c[_0x25c1('0x2e')],'type':_0x21069c[_0x25c1('0x2f')][_0x25c1('0x30')]};});_0x478f1e['model']=_[_0x25c1('0x31')](_['map'](_0x31c153,'name'),[_0x25c1('0x32')]);_0x478f1e[_0x25c1('0x33')]=_['keys'](_0x193a68[_0x25c1('0x33')]);_0x478f1e['filters']=_[_0x25c1('0x34')](_0x478f1e['model'],_0x478f1e[_0x25c1('0x33')]);_0x1e498[_0x25c1('0x35')]=_[_0x25c1('0x34')](_0x478f1e[_0x25c1('0x36')],qs[_0x25c1('0x37')](_0x193a68[_0x25c1('0x33')][_0x25c1('0x37')]));_0x1e498[_0x25c1('0x35')]=_0x1e498['attributes'][_0x25c1('0x38')]?_0x1e498['attributes']:_0x478f1e[_0x25c1('0x36')];if(!_0x193a68['query'][_0x25c1('0x39')](_0x25c1('0x3a'))){_0x1e498[_0x25c1('0x1b')]=qs[_0x25c1('0x1b')](_0x193a68[_0x25c1('0x33')][_0x25c1('0x1b')]);_0x1e498[_0x25c1('0x3b')]=qs[_0x25c1('0x3b')](_0x193a68[_0x25c1('0x33')][_0x25c1('0x3b')]);}_0x1e498[_0x25c1('0x3c')]=qs[_0x25c1('0x3d')](_0x193a68[_0x25c1('0x33')][_0x25c1('0x3d')]);_0x1e498[_0x25c1('0x3e')]=qs[_0x25c1('0x3f')](_[_0x25c1('0x40')](_0x193a68[_0x25c1('0x33')],_0x478f1e[_0x25c1('0x3f')]),_0x31c153);if(_0x193a68[_0x25c1('0x33')]['filter']){_0x1e498[_0x25c1('0x3e')]=_[_0x25c1('0x41')](_0x1e498['where'],{'$or':_[_0x25c1('0x2b')](_0x31c153,function(_0x5eca99){if(_0x5eca99[_0x25c1('0x2f')]!=='VIRTUAL'){var _0x4326fb={};_0x4326fb[_0x5eca99[_0x25c1('0x28')]]={'$like':'%'+_0x193a68[_0x25c1('0x33')][_0x25c1('0x42')]+'%'};return _0x4326fb;}})});}_0x1e498=_[_0x25c1('0x41')]({},_0x1e498,_0x193a68['options']);var _0x1fe6d7={'where':_0x1e498['where']};return db[_0x25c1('0x2c')][_0x25c1('0x1d')](_0x1fe6d7)[_0x25c1('0x23')](function(_0x17fc23){_0x76b360['count']=_0x17fc23;if(_0x193a68['query']['includeAll']){_0x1e498[_0x25c1('0x43')]=[{'all':!![]}];}return db[_0x25c1('0x2c')]['findAll'](_0x1e498);})[_0x25c1('0x23')](function(_0x58792d){_0x76b360[_0x25c1('0x44')]=_0x58792d;return _0x76b360;})[_0x25c1('0x23')](respondWithFilteredResult(_0x5c56ab,_0x1e498))[_0x25c1('0x45')](handleError(_0x5c56ab,null));};exports['show']=function(_0x5502c1,_0x53f87b){var _0x1b1d17={'raw':![],'where':{'id':_0x5502c1['params']['id']}},_0x3cf9c0={};_0x3cf9c0[_0x25c1('0x36')]=_[_0x25c1('0x46')](db[_0x25c1('0x2c')]['rawAttributes']);_0x3cf9c0['query']=_['keys'](_0x5502c1['query']);_0x3cf9c0[_0x25c1('0x3f')]=_[_0x25c1('0x34')](_0x3cf9c0['model'],_0x3cf9c0[_0x25c1('0x33')]);_0x1b1d17[_0x25c1('0x35')]=_[_0x25c1('0x34')](_0x3cf9c0[_0x25c1('0x36')],qs[_0x25c1('0x37')](_0x5502c1[_0x25c1('0x33')][_0x25c1('0x37')]));_0x1b1d17['attributes']=_0x1b1d17['attributes'][_0x25c1('0x38')]?_0x1b1d17[_0x25c1('0x35')]:_0x3cf9c0[_0x25c1('0x36')];if(_0x5502c1['query'][_0x25c1('0x47')]){_0x1b1d17[_0x25c1('0x43')]=[{'all':!![]}];}_0x1b1d17=_[_0x25c1('0x41')]({},_0x1b1d17,_0x5502c1[_0x25c1('0x48')]);return db['ScreenRecording'][_0x25c1('0x49')](_0x1b1d17)[_0x25c1('0x23')](handleEntityNotFound(_0x53f87b,null))[_0x25c1('0x23')](respondWithResult(_0x53f87b,null))[_0x25c1('0x45')](handleError(_0x53f87b,null));};exports['create']=function(_0x59e96b,_0x13ac06){return db[_0x25c1('0x2c')][_0x25c1('0x4a')](_0x59e96b[_0x25c1('0x4b')],{})['then'](respondWithResult(_0x13ac06,0xc9))[_0x25c1('0x45')](handleError(_0x13ac06,null));};exports[_0x25c1('0x22')]=function(_0x5770dd,_0x102f5){if(_0x5770dd[_0x25c1('0x4b')]['id']){delete _0x5770dd[_0x25c1('0x4b')]['id'];}delete _0x5770dd[_0x25c1('0x4b')]['duration'];delete _0x5770dd['body'][_0x25c1('0x4c')];delete _0x5770dd[_0x25c1('0x4b')][_0x25c1('0x4d')];delete _0x5770dd['body'][_0x25c1('0x4e')];return db[_0x25c1('0x2c')]['find']({'where':{'id':_0x5770dd[_0x25c1('0x4f')]['id']}})[_0x25c1('0x23')](handleEntityNotFound(_0x102f5,null))[_0x25c1('0x23')](saveUpdates(_0x5770dd[_0x25c1('0x4b')],null))[_0x25c1('0x23')](respondWithResult(_0x102f5,null))[_0x25c1('0x45')](handleError(_0x102f5,null));};exports[_0x25c1('0x50')]=function(_0x5102a0,_0x5344da){return db['ScreenRecording'][_0x25c1('0x50')]()['then'](respondWithResult(_0x5344da,null))[_0x25c1('0x45')](handleError(_0x5344da,null));};exports[_0x25c1('0x51')]=function(_0x42fd6e,_0x153603,_0x40fe57){var _0x1b72e5=require('../../components/encryptor');var _0x4a876b=![];var _0x68e295={};if(_0x42fd6e[_0x25c1('0x33')][_0x25c1('0x2f')]&&_0x42fd6e[_0x25c1('0x33')][_0x25c1('0x2f')]==='uniqueid'){_0x68e295[_0x25c1('0x52')]=_0x42fd6e[_0x25c1('0x4f')]['id'];}else{_0x68e295['id']=_0x42fd6e[_0x25c1('0x4f')]['id'];}return db[_0x25c1('0x2c')][_0x25c1('0x49')]({'where':_0x68e295,'attributes':['id','value'],'raw':!![]})[_0x25c1('0x23')](handleEntityNotFound(_0x153603,null))[_0x25c1('0x23')](function(_0x49b192){if(_0x49b192){var _0x1341d2=path[_0x25c1('0x53')](config[_0x25c1('0x54')],_0x25c1('0x55'),_0x49b192[_0x25c1('0x4e')]);var _0x3d051a=util['format'](_0x25c1('0x56'),_0x1341d2);if(fs[_0x25c1('0x57')](_0x3d051a)){_0x4a876b=!![];return _0x1b72e5[_0x25c1('0x58')](_0x3d051a,_0x1341d2,config[_0x25c1('0x59')][_0x25c1('0x5a')])[_0x25c1('0x23')](function(){return _0x49b192;});}return _0x49b192;}})[_0x25c1('0x23')](function(_0x5d54cd){if(_0x5d54cd){var _0x321833=path[_0x25c1('0x53')](config[_0x25c1('0x54')],_0x25c1('0x55'),_0x5d54cd[_0x25c1('0x4e')]);if(!fs[_0x25c1('0x57')](_0x321833)){throw new db['Sequelize'][(_0x25c1('0x5b'))](_0x25c1('0x5c'));}if(_0x5d54cd[_0x25c1('0x5d')]){return _0x153603[_0x25c1('0x51')](_0x321833,_0x5d54cd[_0x25c1('0x5d')]+path[_0x25c1('0x5e')](_0x321833),function(){if(_0x4a876b){fs[_0x25c1('0x5f')](_0x321833);}});}else{return _0x153603['download'](_0x321833,function(_0x44efc9){if(_0x4a876b){fs['unlink'](_0x321833);}});}}})[_0x25c1('0x45')](function(_0x24568c){if(_0x24568c[_0x25c1('0x60')]===_0x25c1('0x5c')){_0x153603[_0x25c1('0x19')](0x194)[_0x25c1('0x29')](_0x25c1('0x61'));}else{return handleError(_0x153603,null);}});};exports[_0x25c1('0x24')]=function(_0x4c435c,_0x7dbbe1){return db[_0x25c1('0x2c')][_0x25c1('0x49')]({'where':{'id':_0x4c435c[_0x25c1('0x4f')]['id']}})[_0x25c1('0x23')](function(_0x338f70){if(_[_0x25c1('0x62')](_0x338f70)){throw new ReferenceError('Entity\x20not\x20found');}return _0x338f70;})[_0x25c1('0x23')](function(_0x51e747){var _0x5e1517=path['join'](config[_0x25c1('0x54')],_0x25c1('0x55'),_0x51e747[_0x25c1('0x4e')]);logger[_0x25c1('0x63')](_0x25c1('0x64'),_0x5e1517);if(!_['isNil'](_0x51e747[_0x25c1('0x4e')])&&fs['existsSync'](_0x5e1517)){logger[_0x25c1('0x63')](_0x25c1('0x65')+_0x5e1517+_0x25c1('0x66'));fs[_0x25c1('0x67')](_0x5e1517);}_0x5e1517=_0x5e1517+_0x25c1('0x68');if(!_[_0x25c1('0x62')](_0x51e747[_0x25c1('0x4e')])&&fs['existsSync'](_0x5e1517)){logger[_0x25c1('0x63')](_0x25c1('0x65')+_0x5e1517+_0x25c1('0x66'));fs[_0x25c1('0x67')](_0x5e1517);}return _0x51e747;})[_0x25c1('0x23')](function(_0x425f3e){if(!_0x425f3e)throw new InternalError();return _0x425f3e['destroy']();})[_0x25c1('0x23')](function(){_0x7dbbe1['status'](0xcc)[_0x25c1('0x25')]();})['catch'](handleError(_0x7dbbe1,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index adf85f6..146227f 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 _0x8928=['screen_recordings','interactionid','lodash','util','api','bluebird','path','rimraf','define','ScreenRecording'];(function(_0x14d896,_0x53578b){var _0x28679a=function(_0x14921f){while(--_0x14921f){_0x14d896['push'](_0x14d896['shift']());}};_0x28679a(++_0x53578b);}(_0x8928,0x156));var _0x8892=function(_0x3e4faa,_0x21ea6b){_0x3e4faa=_0x3e4faa-0x0;var _0x3b9f25=_0x8928[_0x3e4faa];return _0x3b9f25;};'use strict';var _=require(_0x8892('0x0'));var util=require(_0x8892('0x1'));var logger=require('../../config/logger')(_0x8892('0x2'));var moment=require('moment');var BPromise=require(_0x8892('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8892('0x4'));var rimraf=require(_0x8892('0x5'));var config=require('../../config/environment');var attributes=require('./screenRecording.attributes');module['exports']=function(_0x200e5f,_0x5deb8a){return _0x200e5f[_0x8892('0x6')](_0x8892('0x7'),attributes,{'tableName':_0x8892('0x8'),'paranoid':![],'indexes':[{'name':_0x8892('0x9'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3083=['interactionid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes'];(function(_0x10e154,_0x5c33ba){var _0xed6d3a=function(_0xc0d3f0){while(--_0xc0d3f0){_0x10e154['push'](_0x10e154['shift']());}};_0xed6d3a(++_0x5c33ba);}(_0x3083,0xe5));var _0x3308=function(_0x3a99f4,_0x2a81c1){_0x3a99f4=_0x3a99f4-0x0;var _0xea0b42=_0x3083[_0x3a99f4];return _0xea0b42;};'use strict';var _=require(_0x3308('0x0'));var util=require(_0x3308('0x1'));var logger=require(_0x3308('0x2'))(_0x3308('0x3'));var moment=require(_0x3308('0x4'));var BPromise=require(_0x3308('0x5'));var rp=require(_0x3308('0x6'));var fs=require('fs');var path=require(_0x3308('0x7'));var rimraf=require(_0x3308('0x8'));var config=require(_0x3308('0x9'));var attributes=require(_0x3308('0xa'));module['exports']=function(_0x588ad1,_0x28d817){return _0x588ad1['define']('ScreenRecording',attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':'interactionid','fields':[_0x3308('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 550b013..61db890 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 _0x9e5a=['debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','ScreenRecording,\x20%s,\x20%s'];(function(_0x8854f2,_0x79542c){var _0x38505d=function(_0x5af02b){while(--_0x5af02b){_0x8854f2['push'](_0x8854f2['shift']());}};_0x38505d(++_0x79542c);}(_0x9e5a,0x11c));var _0xa9e5=function(_0x59aa62,_0x23a19f){_0x59aa62=_0x59aa62-0x0;var _0x2cf6c1=_0x9e5a[_0x59aa62];return _0x2cf6c1;};'use strict';var _=require(_0xa9e5('0x0'));var util=require(_0xa9e5('0x1'));var moment=require(_0xa9e5('0x2'));var BPromise=require(_0xa9e5('0x3'));var rs=require(_0xa9e5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa9e5('0x5'))['db'];var utils=require(_0xa9e5('0x6'));var logger=require(_0xa9e5('0x7'))(_0xa9e5('0x8'));var config=require(_0xa9e5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa9e5('0xa')][_0xa9e5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a1b0a,_0x3b2b92,_0x153368){return new BPromise(function(_0x197d0b,_0x2af406){return client[_0xa9e5('0xc')](_0x4a1b0a,_0x153368)['then'](function(_0x5ed21c){logger[_0xa9e5('0xd')](_0xa9e5('0xe'),_0x3b2b92,'request\x20sent');logger[_0xa9e5('0xf')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x3b2b92,_0xa9e5('0x10'),JSON[_0xa9e5('0x11')](_0x5ed21c));if(_0x5ed21c[_0xa9e5('0x12')]){if(_0x5ed21c[_0xa9e5('0x12')][_0xa9e5('0x13')]===0x1f4){logger[_0xa9e5('0x12')](_0xa9e5('0xe'),_0x3b2b92,_0x5ed21c[_0xa9e5('0x12')][_0xa9e5('0x14')]);return _0x2af406(_0x5ed21c[_0xa9e5('0x12')][_0xa9e5('0x14')]);}logger['error'](_0xa9e5('0xe'),_0x3b2b92,_0x5ed21c[_0xa9e5('0x12')][_0xa9e5('0x14')]);return _0x197d0b(_0x5ed21c[_0xa9e5('0x12')][_0xa9e5('0x14')]);}else{logger[_0xa9e5('0xd')](_0xa9e5('0xe'),_0x3b2b92,_0xa9e5('0x10'));_0x197d0b(_0x5ed21c[_0xa9e5('0x15')][_0xa9e5('0x14')]);}})[_0xa9e5('0x16')](function(_0x507373){logger[_0xa9e5('0x12')](_0xa9e5('0xe'),_0x3b2b92,_0x507373);_0x2af406(_0x507373);});});} \ No newline at end of file +var _0x600b=['ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info'];(function(_0x1669ed,_0x49a620){var _0x19e270=function(_0x4d12d0){while(--_0x4d12d0){_0x1669ed['push'](_0x1669ed['shift']());}};_0x19e270(++_0x49a620);}(_0x600b,0x1bf));var _0xb600=function(_0x3c4f1f,_0x20d3ec){_0x3c4f1f=_0x3c4f1f-0x0;var _0x19cb69=_0x600b[_0x3c4f1f];return _0x19cb69;};'use strict';var _=require(_0xb600('0x0'));var util=require(_0xb600('0x1'));var moment=require('moment');var BPromise=require(_0xb600('0x2'));var rs=require(_0xb600('0x3'));var fs=require('fs');var Redis=require(_0xb600('0x4'));var db=require(_0xb600('0x5'))['db'];var utils=require(_0xb600('0x6'));var logger=require(_0xb600('0x7'))('rpc');var config=require(_0xb600('0x8'));var jayson=require(_0xb600('0x9'));var client=jayson[_0xb600('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a7838,_0xed607f,_0x14ec5c){return new BPromise(function(_0x569911,_0x1b2a8a){return client[_0xb600('0xb')](_0x4a7838,_0x14ec5c)['then'](function(_0x3d6552){logger[_0xb600('0xc')](_0xb600('0xd'),_0xed607f,_0xb600('0xe'));logger[_0xb600('0xf')](_0xb600('0x10'),_0xed607f,_0xb600('0xe'),JSON[_0xb600('0x11')](_0x3d6552));if(_0x3d6552[_0xb600('0x12')]){if(_0x3d6552['error'][_0xb600('0x13')]===0x1f4){logger[_0xb600('0x12')](_0xb600('0xd'),_0xed607f,_0x3d6552['error'][_0xb600('0x14')]);return _0x1b2a8a(_0x3d6552['error'][_0xb600('0x14')]);}logger[_0xb600('0x12')](_0xb600('0xd'),_0xed607f,_0x3d6552[_0xb600('0x12')][_0xb600('0x14')]);return _0x569911(_0x3d6552[_0xb600('0x12')][_0xb600('0x14')]);}else{logger['info'](_0xb600('0xd'),_0xed607f,_0xb600('0xe'));_0x569911(_0x3d6552[_0xb600('0x15')][_0xb600('0x14')]);}})[_0xb600('0x16')](function(_0x11da6f){logger[_0xb600('0x12')]('ScreenRecording,\x20%s,\x20%s',_0xed607f,_0x11da6f);_0x1b2a8a(_0x11da6f);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 0933ac4..11f7c86 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 _0x1ace=['diskStorage','format','logologin','post','/:id/logo_login','preferred','favicon','isAuthenticated','update','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','index','/now','/:id','show','/:id/gdpr','gdpr','/:id/preferred','getPreferred','join','root','server/files/images/logos/','%s%s','logo','extname','originalname','/:id/logo','single','file','addLogo'];(function(_0x19e300,_0x437613){var _0x11e992=function(_0x27251e){while(--_0x27251e){_0x19e300['push'](_0x19e300['shift']());}};_0x11e992(++_0x437613);}(_0x1ace,0x1b7));var _0xe1ac=function(_0xbc9e5a,_0x22d6c8){_0xbc9e5a=_0xbc9e5a-0x0;var _0x139c60=_0x1ace[_0xbc9e5a];return _0x139c60;};'use strict';var multer=require(_0xe1ac('0x0'));var util=require('util');var path=require(_0xe1ac('0x1'));var timeout=require(_0xe1ac('0x2'));var express=require(_0xe1ac('0x3'));var router=express['Router']();var fs_extra=require(_0xe1ac('0x4'));var auth=require(_0xe1ac('0x5'));var interaction=require(_0xe1ac('0x6'));var config=require(_0xe1ac('0x7'));var controller=require(_0xe1ac('0x8'));router[_0xe1ac('0x9')]('/',auth['isAuthenticated'](),controller[_0xe1ac('0xa')]);router['get'](_0xe1ac('0xb'),controller['getDate']);router[_0xe1ac('0x9')](_0xe1ac('0xc'),controller[_0xe1ac('0xd')]);router[_0xe1ac('0x9')]('/:id/logo',controller['getLogo']);router[_0xe1ac('0x9')]('/:id/logo_login',controller['getLogoLogin']);router['get'](_0xe1ac('0xe'),controller[_0xe1ac('0xf')]);router[_0xe1ac('0x9')](_0xe1ac('0x10'),controller[_0xe1ac('0x11')]);router[_0xe1ac('0x9')]('/:id/favicon',controller['getFavicon']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x15dc61,_0x314e08,_0xf1716d){_0xf1716d(null,path[_0xe1ac('0x12')](config[_0xe1ac('0x13')],_0xe1ac('0x14')));},'filename':function(_0x46f3ff,_0x1edbec,_0x222526){_0x222526(null,util['format'](_0xe1ac('0x15'),_0xe1ac('0x16'),path[_0xe1ac('0x17')](_0x1edbec[_0xe1ac('0x18')])));}})});router['post'](_0xe1ac('0x19'),upload[_0xe1ac('0x1a')](_0xe1ac('0x1b')),controller[_0xe1ac('0x1c')]);var upload=multer({'storage':multer[_0xe1ac('0x1d')]({'destination':function(_0x2c4059,_0x1bbb27,_0xc1ffb5){_0xc1ffb5(null,path[_0xe1ac('0x12')](config[_0xe1ac('0x13')],_0xe1ac('0x14')));},'filename':function(_0x355549,_0x5f5480,_0x1c3800){_0x1c3800(null,util[_0xe1ac('0x1e')](_0xe1ac('0x15'),_0xe1ac('0x1f'),path['extname'](_0x5f5480[_0xe1ac('0x18')])));}})});router[_0xe1ac('0x20')](_0xe1ac('0x21'),upload['single'](_0xe1ac('0x1b')),controller['addLogoLogin']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x47a00b,_0x143a52,_0x347960){_0x347960(null,path['join'](config[_0xe1ac('0x13')],'server/files/images/logos/'));},'filename':function(_0x139d14,_0x59c4f8,_0x3ef40a){_0x3ef40a(null,util[_0xe1ac('0x1e')](_0xe1ac('0x15'),_0xe1ac('0x22'),path[_0xe1ac('0x17')](_0x59c4f8[_0xe1ac('0x18')])));}})});router[_0xe1ac('0x20')]('/:id/preferred',upload[_0xe1ac('0x1a')](_0xe1ac('0x1b')),controller['addPreferred']);var upload=multer({'storage':multer[_0xe1ac('0x1d')]({'destination':function(_0x4a45a0,_0x2dd905,_0x5212cf){_0x5212cf(null,path[_0xe1ac('0x12')](config[_0xe1ac('0x13')],_0xe1ac('0x14')));},'filename':function(_0x951d90,_0xe806f8,_0x2de005){_0x2de005(null,util[_0xe1ac('0x1e')](_0xe1ac('0x15'),_0xe1ac('0x23'),path[_0xe1ac('0x17')](_0xe806f8[_0xe1ac('0x18')])));}})});router['post']('/:id/favicon',upload[_0xe1ac('0x1a')]('file'),controller['addFavicon']);router['put']('/:id',auth[_0xe1ac('0x24')](),controller[_0xe1ac('0x25')]);module[_0xe1ac('0x26')]=router; \ No newline at end of file +var _0x070c=['originalname','post','preferred','addPreferred','favicon','put','update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/now','getDate','/:id','show','getLogo','/:id/logo_login','getLogoLogin','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','root','%s%s','logo','extname','/:id/logo','single','file','join','server/files/images/logos/','format','logologin'];(function(_0x454305,_0x284130){var _0x1f1e8b=function(_0x29878d){while(--_0x29878d){_0x454305['push'](_0x454305['shift']());}};_0x1f1e8b(++_0x284130);}(_0x070c,0xd9));var _0xc070=function(_0x4afac7,_0x4e2808){_0x4afac7=_0x4afac7-0x0;var _0x773068=_0x070c[_0x4afac7];return _0x773068;};'use strict';var multer=require(_0xc070('0x0'));var util=require(_0xc070('0x1'));var path=require(_0xc070('0x2'));var timeout=require(_0xc070('0x3'));var express=require(_0xc070('0x4'));var router=express[_0xc070('0x5')]();var fs_extra=require(_0xc070('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xc070('0x7'));var config=require('../../config/environment');var controller=require('./setting.controller');router[_0xc070('0x8')]('/',auth[_0xc070('0x9')](),controller[_0xc070('0xa')]);router[_0xc070('0x8')](_0xc070('0xb'),controller[_0xc070('0xc')]);router[_0xc070('0x8')](_0xc070('0xd'),controller[_0xc070('0xe')]);router['get']('/:id/logo',controller[_0xc070('0xf')]);router[_0xc070('0x8')](_0xc070('0x10'),controller[_0xc070('0x11')]);router[_0xc070('0x8')]('/:id/gdpr',controller[_0xc070('0x12')]);router[_0xc070('0x8')](_0xc070('0x13'),controller[_0xc070('0x14')]);router[_0xc070('0x8')](_0xc070('0x15'),controller[_0xc070('0x16')]);var upload=multer({'storage':multer[_0xc070('0x17')]({'destination':function(_0xa1a0b7,_0x4b3026,_0x2c7a49){_0x2c7a49(null,path['join'](config[_0xc070('0x18')],'server/files/images/logos/'));},'filename':function(_0x2ab970,_0x6b2246,_0x5dc297){_0x5dc297(null,util['format'](_0xc070('0x19'),_0xc070('0x1a'),path[_0xc070('0x1b')](_0x6b2246['originalname'])));}})});router['post'](_0xc070('0x1c'),upload[_0xc070('0x1d')](_0xc070('0x1e')),controller['addLogo']);var upload=multer({'storage':multer[_0xc070('0x17')]({'destination':function(_0x213ace,_0x4bc6f7,_0x249a39){_0x249a39(null,path[_0xc070('0x1f')](config[_0xc070('0x18')],_0xc070('0x20')));},'filename':function(_0x24f382,_0x1063d0,_0xfc3f6e){_0xfc3f6e(null,util[_0xc070('0x21')](_0xc070('0x19'),_0xc070('0x22'),path[_0xc070('0x1b')](_0x1063d0[_0xc070('0x23')])));}})});router[_0xc070('0x24')](_0xc070('0x10'),upload['single'](_0xc070('0x1e')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0xc070('0x17')]({'destination':function(_0x74c067,_0x3d0213,_0x3de411){_0x3de411(null,path[_0xc070('0x1f')](config[_0xc070('0x18')],_0xc070('0x20')));},'filename':function(_0x35cd15,_0x29a70f,_0x34964c){_0x34964c(null,util['format'](_0xc070('0x19'),_0xc070('0x25'),path[_0xc070('0x1b')](_0x29a70f[_0xc070('0x23')])));}})});router[_0xc070('0x24')](_0xc070('0x13'),upload[_0xc070('0x1d')](_0xc070('0x1e')),controller[_0xc070('0x26')]);var upload=multer({'storage':multer[_0xc070('0x17')]({'destination':function(_0x1f9e89,_0x3e12ac,_0x341bbd){_0x341bbd(null,path[_0xc070('0x1f')](config[_0xc070('0x18')],_0xc070('0x20')));},'filename':function(_0x1dc196,_0x428732,_0x19bc0a){_0x19bc0a(null,util[_0xc070('0x21')]('%s%s',_0xc070('0x27'),path['extname'](_0x428732[_0xc070('0x23')])));}})});router[_0xc070('0x24')](_0xc070('0x15'),upload['single'](_0xc070('0x1e')),controller['addFavicon']);router[_0xc070('0x28')](_0xc070('0xd'),auth[_0xc070('0x9')](),controller[_0xc070('0x29')]);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 9cdee4f..9d93e13 100644 --- a/server/api/setting/setting.attributes.js +++ b/server/api/setting/setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0xa7abe6,_0x3db885){var _0x148868=function(_0x5a6a62){while(--_0x5a6a62){_0xa7abe6['push'](_0xa7abe6['shift']());}};_0x148868(++_0x3db885);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file +var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x51f3a9,_0x4d0303){var _0x15b5ef=function(_0x3b43d5){while(--_0x3b43d5){_0x51f3a9['push'](_0x51f3a9['shift']());}};_0x15b5ef(++_0x4d0303);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 48625ad..59b7a05 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 _0x55a5=['getFavicon','default_favicon.ico','now','utcOffset','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','request','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','stack','send','index','map','Setting','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','length','body','find','addLogo','file','filename','logo','addLogoLogin','server/files/images/logos','getLicense','loginLogo','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','toLower','root','default_logo.svg','default','ValidationError','\x20not\x20found','preferred','default_loginLogo.svg','Sequelize','download','securePassword','addPreferred','getPreferred','upperFirst','custom','addFavicon'];(function(_0x57a6fd,_0x373877){var _0x35f98a=function(_0x46008f){while(--_0x46008f){_0x57a6fd['push'](_0x57a6fd['shift']());}};_0x35f98a(++_0x373877);}(_0x55a5,0xf7));var _0x555a=function(_0x1c1509,_0x2dfa81){_0x1c1509=_0x1c1509-0x0;var _0xf11b7=_0x55a5[_0x1c1509];return _0xf11b7;};'use strict';var emlformat=require(_0x555a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x555a('0x1'));var jsonpatch=require(_0x555a('0x2'));var rp=require(_0x555a('0x3'));var moment=require(_0x555a('0x4'));var BPromise=require(_0x555a('0x5'));var Mustache=require(_0x555a('0x6'));var util=require(_0x555a('0x7'));var path=require(_0x555a('0x8'));var sox=require(_0x555a('0x9'));var csv=require(_0x555a('0xa'));var ejs=require(_0x555a('0xb'));var fs=require('fs');var fs_extra=require(_0x555a('0xc'));var _=require(_0x555a('0xd'));var squel=require(_0x555a('0xe'));var crypto=require(_0x555a('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x555a('0x10'));var toCsv=require(_0x555a('0xa'));var querystring=require(_0x555a('0x11'));var Papa=require(_0x555a('0x12'));var Redis=require(_0x555a('0x13'));var authService=require(_0x555a('0x14'));var qs=require(_0x555a('0x15'));var as=require(_0x555a('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x555a('0x17'))(_0x555a('0x18'));var utils=require(_0x555a('0x19'));var config=require(_0x555a('0x1a'));var licenseUtil=require(_0x555a('0x1b'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5ee47d,_0x29a124,_0xdf5d6f,_0x3a5da6){return new BPromise(function(_0x1c5016,_0x39a30e){var _0x3fe691=_0x3a5da6||client;return _0x3fe691[_0x555a('0x1c')](_0x5ee47d,_0xdf5d6f)['then'](function(_0x4b925b){logger['info'](_0x555a('0x1d'),_0x29a124,_0x555a('0x1e'));logger[_0x555a('0x1f')]('Setting,\x20%s,\x20%s,\x20%s',_0x29a124,_0x555a('0x1e'),JSON[_0x555a('0x20')](_0x4b925b));if(_0x4b925b[_0x555a('0x21')]){if(_0x4b925b['error'][_0x555a('0x22')]===0x1f4){logger['error'](_0x555a('0x1d'),_0x29a124,_0x4b925b[_0x555a('0x21')][_0x555a('0x23')]);return _0x39a30e(_0x4b925b[_0x555a('0x21')][_0x555a('0x23')]);}logger[_0x555a('0x21')](_0x555a('0x1d'),_0x29a124,_0x4b925b[_0x555a('0x21')]['message']);return _0x1c5016(_0x4b925b[_0x555a('0x21')][_0x555a('0x23')]);}else{logger[_0x555a('0x24')]('Setting,\x20%s,\x20%s',_0x29a124,_0x555a('0x1e'));_0x1c5016(_0x4b925b[_0x555a('0x25')]['message']);}})[_0x555a('0x26')](function(_0x22b0d6){logger[_0x555a('0x21')](_0x555a('0x1d'),_0x29a124,_0x22b0d6);_0x39a30e(_0x22b0d6);});});}function respondWithStatusCode(_0x1e6328,_0x2f7a93){_0x2f7a93=_0x2f7a93||0xcc;return function(_0x32a465){if(_0x32a465){return _0x1e6328[_0x555a('0x27')](_0x2f7a93);}return _0x1e6328['status'](_0x2f7a93)[_0x555a('0x28')]();};}function respondWithResult(_0x298450,_0x4491a5){_0x4491a5=_0x4491a5||0xc8;return function(_0x2b84a2){if(_0x2b84a2){return _0x298450[_0x555a('0x29')](_0x4491a5)[_0x555a('0x2a')](_0x2b84a2);}};}function respondWithFilteredResult(_0x4f80f7,_0x5e11bb){return function(_0x41ecd4){if(_0x41ecd4){var _0x2dab06=typeof _0x5e11bb[_0x555a('0x2b')]===_0x555a('0x2c')&&typeof _0x5e11bb[_0x555a('0x2d')]===_0x555a('0x2c');var _0x48f0c8=_0x41ecd4['count'];var _0x59d3ee=_0x2dab06?0x0:_0x5e11bb[_0x555a('0x2b')];var _0x28c2d6=_0x2dab06?_0x41ecd4[_0x555a('0x2e')]:_0x5e11bb[_0x555a('0x2b')]+_0x5e11bb[_0x555a('0x2d')];var _0x2cb3dc;if(_0x28c2d6>=_0x48f0c8){_0x28c2d6=_0x48f0c8;_0x2cb3dc=0xc8;}else{_0x2cb3dc=0xce;}_0x4f80f7[_0x555a('0x29')](_0x2cb3dc);return _0x4f80f7[_0x555a('0x2f')](_0x555a('0x30'),_0x59d3ee+'-'+_0x28c2d6+'/'+_0x48f0c8)[_0x555a('0x2a')](_0x41ecd4);}return null;};}function patchUpdates(_0x4ae051){return function(_0x55be89){try{jsonpatch['apply'](_0x55be89,_0x4ae051,!![]);}catch(_0x1e693c){return BPromise[_0x555a('0x31')](_0x1e693c);}return _0x55be89['save']();};}function saveUpdates(_0x557aee,_0x4577c0){return function(_0xb2d2a9){if(_0xb2d2a9){return _0xb2d2a9[_0x555a('0x32')](_0x557aee)[_0x555a('0x33')](function(_0x4c781e){return _0x4c781e;});}return null;};}function removeEntity(_0x408148,_0x3adc9c){return function(_0x36dfd0){if(_0x36dfd0){return _0x36dfd0['destroy']()[_0x555a('0x33')](function(){_0x408148[_0x555a('0x29')](0xcc)[_0x555a('0x28')]();});}};}function handleEntityNotFound(_0x3187e2,_0x36e9d7){return function(_0x1f2f8d){if(!_0x1f2f8d){_0x3187e2[_0x555a('0x27')](0x194);}return _0x1f2f8d;};}function handleError(_0x638136,_0x281c7a){_0x281c7a=_0x281c7a||0x1f4;return function(_0x4bbd78){logger[_0x555a('0x21')](_0x4bbd78[_0x555a('0x34')]);if(_0x4bbd78['name']){delete _0x4bbd78['name'];}_0x638136['status'](_0x281c7a)[_0x555a('0x35')](_0x4bbd78);};}exports[_0x555a('0x36')]=function(_0x2a49cb,_0x1f868c){var _0xcdd0c3={},_0x39710c={},_0x59c4cc={'count':0x0,'rows':[]};var _0x5c64a1=_[_0x555a('0x37')](db[_0x555a('0x38')][_0x555a('0x39')],function(_0xe77965){return{'name':_0xe77965[_0x555a('0x3a')],'type':_0xe77965[_0x555a('0x3b')]['key']};});_0x39710c[_0x555a('0x3c')]=_[_0x555a('0x37')](_0x5c64a1,'name');_0x39710c[_0x555a('0x3d')]=_[_0x555a('0x3e')](_0x2a49cb[_0x555a('0x3d')]);_0x39710c[_0x555a('0x3f')]=_[_0x555a('0x40')](_0x39710c[_0x555a('0x3c')],_0x39710c[_0x555a('0x3d')]);_0xcdd0c3[_0x555a('0x41')]=_['intersection'](_0x39710c[_0x555a('0x3c')],qs[_0x555a('0x42')](_0x2a49cb['query'][_0x555a('0x42')]));_0xcdd0c3[_0x555a('0x41')]=_0xcdd0c3[_0x555a('0x41')]['length']?_0xcdd0c3[_0x555a('0x41')]:_0x39710c[_0x555a('0x3c')];if(!_0x2a49cb[_0x555a('0x3d')][_0x555a('0x43')](_0x555a('0x44'))){_0xcdd0c3['limit']=qs[_0x555a('0x2d')](_0x2a49cb[_0x555a('0x3d')][_0x555a('0x2d')]);_0xcdd0c3[_0x555a('0x2b')]=qs[_0x555a('0x2b')](_0x2a49cb['query'][_0x555a('0x2b')]);}_0xcdd0c3[_0x555a('0x45')]=qs[_0x555a('0x46')](_0x2a49cb[_0x555a('0x3d')][_0x555a('0x46')]);_0xcdd0c3[_0x555a('0x47')]=qs[_0x555a('0x3f')](_[_0x555a('0x48')](_0x2a49cb[_0x555a('0x3d')],_0x39710c['filters']),_0x5c64a1);if(_0x2a49cb[_0x555a('0x3d')][_0x555a('0x49')]){_0xcdd0c3['where']=_[_0x555a('0x4a')](_0xcdd0c3[_0x555a('0x47')],{'$or':_[_0x555a('0x37')](_0x5c64a1,function(_0x17e5a1){if(_0x17e5a1[_0x555a('0x3b')]!==_0x555a('0x4b')){var _0x1c3d4d={};_0x1c3d4d[_0x17e5a1['name']]={'$like':'%'+_0x2a49cb['query'][_0x555a('0x49')]+'%'};return _0x1c3d4d;}})});}_0xcdd0c3=_[_0x555a('0x4a')]({},_0xcdd0c3,_0x2a49cb[_0x555a('0x4c')]);var _0x443303={'where':_0xcdd0c3['where']};return db[_0x555a('0x38')][_0x555a('0x2e')](_0x443303)[_0x555a('0x33')](function(_0x25081c){_0x59c4cc[_0x555a('0x2e')]=_0x25081c;if(_0x2a49cb[_0x555a('0x3d')][_0x555a('0x4d')]){_0xcdd0c3['include']=[{'all':!![]}];}return db['Setting'][_0x555a('0x4e')](_0xcdd0c3);})['then'](function(_0x4d9fb2){_0x59c4cc[_0x555a('0x4f')]=_0x4d9fb2;return _0x59c4cc;})['then'](respondWithFilteredResult(_0x1f868c,_0xcdd0c3))[_0x555a('0x26')](handleError(_0x1f868c,null));};exports[_0x555a('0x50')]=function(_0x588306,_0x1da9fe){var _0x4517b3={'raw':![],'where':{'id':_0x588306[_0x555a('0x51')]['id']}},_0x27fa27={};_0x27fa27[_0x555a('0x3c')]=_[_0x555a('0x3e')](db[_0x555a('0x38')][_0x555a('0x39')]);_0x27fa27['query']=_[_0x555a('0x3e')](_0x588306['query']);_0x27fa27[_0x555a('0x3f')]=_[_0x555a('0x40')](_0x27fa27['model'],_0x27fa27[_0x555a('0x3d')]);_0x4517b3[_0x555a('0x41')]=_[_0x555a('0x40')](_0x27fa27['model'],qs['fields'](_0x588306['query'][_0x555a('0x42')]));_0x4517b3[_0x555a('0x41')]=_0x4517b3['attributes'][_0x555a('0x52')]?_0x4517b3[_0x555a('0x41')]:_0x27fa27[_0x555a('0x3c')];if(_0x588306[_0x555a('0x3d')]['includeAll']){_0x4517b3['include']=[{'all':!![]}];}_0x4517b3=_['merge']({},_0x4517b3,_0x588306[_0x555a('0x4c')]);return db[_0x555a('0x38')]['find'](_0x4517b3)['then'](handleEntityNotFound(_0x1da9fe,null))['then'](respondWithResult(_0x1da9fe,null))[_0x555a('0x26')](handleError(_0x1da9fe,null));};exports[_0x555a('0x32')]=function(_0x22792a,_0x5b42d9){if(_0x22792a['body']['id']){delete _0x22792a[_0x555a('0x53')]['id'];}return db[_0x555a('0x38')][_0x555a('0x54')]({'where':{'id':_0x22792a[_0x555a('0x51')]['id']}})[_0x555a('0x33')](handleEntityNotFound(_0x5b42d9,null))['then'](saveUpdates(_0x22792a[_0x555a('0x53')],null))[_0x555a('0x33')](respondWithResult(_0x5b42d9,null))[_0x555a('0x26')](handleError(_0x5b42d9,null));};exports[_0x555a('0x55')]=function(_0x5bf9c3,_0x5aa6a4,_0x2d3101){if(_0x5bf9c3[_0x555a('0x56')]&&_0x5bf9c3[_0x555a('0x56')][_0x555a('0x57')]){_0x5bf9c3[_0x555a('0x53')][_0x555a('0x58')]=_0x5bf9c3[_0x555a('0x56')][_0x555a('0x57')];}return db[_0x555a('0x38')][_0x555a('0x54')]({'where':{'id':_0x5bf9c3['params']['id']}})['then'](handleEntityNotFound(_0x5aa6a4,null))['then'](saveUpdates(_0x5bf9c3[_0x555a('0x53')],null))[_0x555a('0x33')](respondWithResult(_0x5aa6a4,null))[_0x555a('0x26')](handleError(_0x5aa6a4,null));};exports[_0x555a('0x59')]=function(_0x41f7f6,_0x18b5cc,_0x3778b3){if(_0x41f7f6['file']&&_0x41f7f6[_0x555a('0x56')][_0x555a('0x57')]){_0x41f7f6['body']['loginLogo']=_0x41f7f6[_0x555a('0x56')][_0x555a('0x57')];}return db[_0x555a('0x38')][_0x555a('0x54')]({'where':{'id':_0x41f7f6['params']['id']}})[_0x555a('0x33')](handleEntityNotFound(_0x18b5cc,null))[_0x555a('0x33')](saveUpdates(_0x41f7f6[_0x555a('0x53')],null))[_0x555a('0x33')](respondWithResult(_0x18b5cc,null))[_0x555a('0x26')](handleError(_0x18b5cc,null));};var utilLicense=require(_0x555a('0x1b'));exports['getLogo']=function(_0x59219c,_0x3050a0,_0x3eaa94){var _0x47c7d9=_0x555a('0x5a');var _0x210c0e={'custom':![]};return utilLicense[_0x555a('0x5b')]()[_0x555a('0x33')](function(_0x2178c7){if(_0x2178c7){_0x210c0e=_0x2178c7;}return db[_0x555a('0x38')][_0x555a('0x54')]({'where':{'id':_0x59219c[_0x555a('0x51')]['id']},'attributes':[_0x555a('0x58'),_0x555a('0x5c'),'preferred',_0x555a('0x5d'),_0x555a('0x5e'),_0x555a('0x5f'),_0x555a('0x60'),_0x555a('0x61')],'raw':!![]});})['then'](handleEntityNotFound(_0x3050a0,null))['then'](function(_0x3f13cc){if(_0x3f13cc){var _0x1de204=_0x3f13cc[_0x555a('0x58')]&&fs[_0x555a('0x62')](path[_0x555a('0x63')](config['root'],_0x47c7d9,_[_0x555a('0x64')](_0x3f13cc[_0x555a('0x58')])))?path[_0x555a('0x63')](config[_0x555a('0x65')],_0x47c7d9,_[_0x555a('0x64')](_0x3f13cc[_0x555a('0x58')])):path[_0x555a('0x63')](config[_0x555a('0x65')],_0x47c7d9,_[_0x555a('0x64')](_0x555a('0x66')));var _0xc94379=_0x555a('0x67')+_['upperFirst']('logo');if(_0x3f13cc[_0xc94379]||!_0x210c0e['custom']){_0x1de204=path[_0x555a('0x63')](config[_0x555a('0x65')],_0x47c7d9,_[_0x555a('0x64')](_0x555a('0x66')));}if(!fs['existsSync'](_0x1de204)){throw new db['Sequelize'][(_0x555a('0x68'))](_['upperFirst']('logo')+_0x555a('0x69'));}return _0x3050a0['download'](_0x1de204);}})[_0x555a('0x26')](handleError(_0x3050a0,null));};var utilLicense=require(_0x555a('0x1b'));exports['getLogoLogin']=function(_0x59e9c4,_0x43b272,_0x587012){var _0x580dc7=_0x555a('0x5a');var _0xfde5d8={'custom':![]};return utilLicense[_0x555a('0x5b')]()[_0x555a('0x33')](function(_0x7b0943){if(_0x7b0943){_0xfde5d8=_0x7b0943;}return db['Setting'][_0x555a('0x54')]({'where':{'id':_0x59e9c4[_0x555a('0x51')]['id']},'attributes':[_0x555a('0x58'),_0x555a('0x5c'),_0x555a('0x6a'),_0x555a('0x5d'),_0x555a('0x5e'),_0x555a('0x5f'),_0x555a('0x60'),_0x555a('0x61')],'raw':!![]});})[_0x555a('0x33')](handleEntityNotFound(_0x43b272,null))[_0x555a('0x33')](function(_0x42e205){if(_0x42e205){var _0x54e815=_0x42e205[_0x555a('0x5c')]&&fs['existsSync'](path[_0x555a('0x63')](config[_0x555a('0x65')],_0x580dc7,_[_0x555a('0x64')](_0x42e205['loginLogo'])))?path[_0x555a('0x63')](config[_0x555a('0x65')],_0x580dc7,_['toLower'](_0x42e205[_0x555a('0x5c')])):path['join'](config['root'],_0x580dc7,_[_0x555a('0x64')](_0x555a('0x6b')));var _0x3f72e4=_0x555a('0x67')+_['upperFirst'](_0x555a('0x5c'));if(_0x42e205[_0x3f72e4]||!_0xfde5d8['custom']){_0x54e815=path[_0x555a('0x63')](config[_0x555a('0x65')],_0x580dc7,_[_0x555a('0x64')]('default_loginLogo.svg'));}if(!fs[_0x555a('0x62')](_0x54e815)){throw new db[(_0x555a('0x6c'))][(_0x555a('0x68'))](_['upperFirst'](_0x555a('0x5c'))+_0x555a('0x69'));}return _0x43b272[_0x555a('0x6d')](_0x54e815);}})[_0x555a('0x26')](handleError(_0x43b272,null));};exports['gdpr']=function(_0x3735e1,_0x353a94){return db['Setting'][_0x555a('0x54')]({'where':{'id':_0x3735e1[_0x555a('0x51')]['id']},'attributes':[_0x555a('0x6e')]})[_0x555a('0x33')](respondWithResult(_0x353a94,null))[_0x555a('0x26')](handleError(_0x353a94,null));};exports[_0x555a('0x6f')]=function(_0x3740fc,_0x2a36f9,_0x537a32){if(_0x3740fc[_0x555a('0x56')]&&_0x3740fc[_0x555a('0x56')][_0x555a('0x57')]){_0x3740fc[_0x555a('0x53')][_0x555a('0x6a')]=_0x3740fc[_0x555a('0x56')]['filename'];}return db['Setting'][_0x555a('0x54')]({'where':{'id':_0x3740fc[_0x555a('0x51')]['id']}})['then'](handleEntityNotFound(_0x2a36f9,null))['then'](saveUpdates(_0x3740fc[_0x555a('0x53')],null))[_0x555a('0x33')](respondWithResult(_0x2a36f9,null))[_0x555a('0x26')](handleError(_0x2a36f9,null));};var utilLicense=require('../../config/license/util');exports[_0x555a('0x70')]=function(_0x57588d,_0x3f0358,_0x1a4142){var _0x225564=_0x555a('0x5a');var _0x26e7df={'custom':![]};return utilLicense[_0x555a('0x5b')]()[_0x555a('0x33')](function(_0x3d3610){if(_0x3d3610){_0x26e7df=_0x3d3610;}return db[_0x555a('0x38')][_0x555a('0x54')]({'where':{'id':_0x57588d[_0x555a('0x51')]['id']},'attributes':['logo',_0x555a('0x5c'),_0x555a('0x6a'),_0x555a('0x5d'),_0x555a('0x5e'),'defaultLoginLogo',_0x555a('0x60'),'defaultFavicon'],'raw':!![]});})[_0x555a('0x33')](handleEntityNotFound(_0x3f0358,null))[_0x555a('0x33')](function(_0x23fd05){if(_0x23fd05){var _0x438d85=_0x23fd05[_0x555a('0x6a')]&&fs[_0x555a('0x62')](path[_0x555a('0x63')](config[_0x555a('0x65')],_0x225564,_[_0x555a('0x64')](_0x23fd05['preferred'])))?path[_0x555a('0x63')](config['root'],_0x225564,_[_0x555a('0x64')](_0x23fd05[_0x555a('0x6a')])):path[_0x555a('0x63')](config[_0x555a('0x65')],_0x225564,_['toLower']('default_preferred.png'));var _0x1d9bf4=_0x555a('0x67')+_[_0x555a('0x71')](_0x555a('0x6a'));if(_0x23fd05[_0x1d9bf4]||!_0x26e7df[_0x555a('0x72')]||!_0x26e7df[_0x555a('0x6a')]){_0x438d85=path['join'](config['root'],_0x225564,_[_0x555a('0x64')]('default_preferred.png'));}if(!fs[_0x555a('0x62')](_0x438d85)){throw new db[(_0x555a('0x6c'))][(_0x555a('0x68'))](_[_0x555a('0x71')](_0x555a('0x6a'))+_0x555a('0x69'));}return _0x3f0358[_0x555a('0x6d')](_0x438d85);}})[_0x555a('0x26')](handleError(_0x3f0358,null));};exports[_0x555a('0x73')]=function(_0x395a87,_0x397a6f,_0x1f473b){if(_0x395a87[_0x555a('0x56')]&&_0x395a87['file'][_0x555a('0x57')]){_0x395a87['body'][_0x555a('0x5d')]=_0x395a87['file']['filename'];}return db[_0x555a('0x38')][_0x555a('0x54')]({'where':{'id':_0x395a87[_0x555a('0x51')]['id']}})['then'](handleEntityNotFound(_0x397a6f,null))[_0x555a('0x33')](saveUpdates(_0x395a87['body'],null))[_0x555a('0x33')](respondWithResult(_0x397a6f,null))[_0x555a('0x26')](handleError(_0x397a6f,null));};var utilLicense=require(_0x555a('0x1b'));exports[_0x555a('0x74')]=function(_0x4cd262,_0x4aebb2,_0x5d8fcd){var _0xb7258f=_0x555a('0x5a');var _0x1de65b={'custom':![]};return utilLicense[_0x555a('0x5b')]()[_0x555a('0x33')](function(_0x5e17d0){if(_0x5e17d0){_0x1de65b=_0x5e17d0;}return db[_0x555a('0x38')][_0x555a('0x54')]({'where':{'id':_0x4cd262[_0x555a('0x51')]['id']},'attributes':[_0x555a('0x58'),'loginLogo',_0x555a('0x6a'),_0x555a('0x5d'),_0x555a('0x5e'),_0x555a('0x5f'),'defaultPreferred',_0x555a('0x61')],'raw':!![]});})[_0x555a('0x33')](handleEntityNotFound(_0x4aebb2,null))[_0x555a('0x33')](function(_0xe28faf){if(_0xe28faf){var _0x11f46d=_0xe28faf['favicon']&&fs[_0x555a('0x62')](path[_0x555a('0x63')](config[_0x555a('0x65')],_0xb7258f,_['toLower'](_0xe28faf[_0x555a('0x5d')])))?path[_0x555a('0x63')](config[_0x555a('0x65')],_0xb7258f,_[_0x555a('0x64')](_0xe28faf['favicon'])):path[_0x555a('0x63')](config[_0x555a('0x65')],_0xb7258f,_[_0x555a('0x64')]('default_favicon.ico'));var _0x35a208=_0x555a('0x67')+_[_0x555a('0x71')]('favicon');if(_0xe28faf[_0x35a208]||!_0x1de65b['custom']){_0x11f46d=path[_0x555a('0x63')](config[_0x555a('0x65')],_0xb7258f,_['toLower'](_0x555a('0x75')));}if(!fs[_0x555a('0x62')](_0x11f46d)){throw new db[(_0x555a('0x6c'))][(_0x555a('0x68'))](_[_0x555a('0x71')]('favicon')+_0x555a('0x69'));}return _0x4aebb2[_0x555a('0x6d')](_0x11f46d);}})['catch'](handleError(_0x4aebb2,null));};exports['getDate']=function(_0x3de370,_0x13e03e){var _0x2e6a17={'offset':moment()['utcOffset']()};_0x2e6a17[_0x555a('0x76')]=moment()[_0x555a('0x77')](_0x2e6a17[_0x555a('0x2b')])['format'](_0x555a('0x78'));return _0x13e03e[_0x555a('0x29')](0xc8)[_0x555a('0x35')](_0x2e6a17);}; \ No newline at end of file +var _0xa7dc=['find','body','file','logo','loginLogo','filename','../../config/license/util','getLogo','server/files/images/logos','getLicense','preferred','defaultLogo','defaultLoginLogo','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','upperFirst','custom','Sequelize','\x20not\x20found','download','getLogoLogin','defaultPreferred','default_loginLogo.svg','default','ValidationError','gdpr','securePassword','getPreferred','default_preferred.png','addFavicon','favicon','getFavicon','default_favicon.ico','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','stack','name','send','index','Setting','fieldName','type','key','map','query','keys','filters','intersection','fields','attributes','model','hasOwnProperty','order','sort','merge','options','include','findAll','rows','show','params','rawAttributes','includeAll'];(function(_0x36f8d9,_0x381e8c){var _0x261804=function(_0x41086b){while(--_0x41086b){_0x36f8d9['push'](_0x36f8d9['shift']());}};_0x261804(++_0x381e8c);}(_0xa7dc,0x11d));var _0xca7d=function(_0x4550ac,_0x5af684){_0x4550ac=_0x4550ac-0x0;var _0x974df8=_0xa7dc[_0x4550ac];return _0x974df8;};'use strict';var emlformat=require(_0xca7d('0x0'));var rimraf=require(_0xca7d('0x1'));var zipdir=require(_0xca7d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xca7d('0x3'));var moment=require('moment');var BPromise=require(_0xca7d('0x4'));var Mustache=require(_0xca7d('0x5'));var util=require(_0xca7d('0x6'));var path=require(_0xca7d('0x7'));var sox=require(_0xca7d('0x8'));var csv=require(_0xca7d('0x9'));var ejs=require(_0xca7d('0xa'));var fs=require('fs');var fs_extra=require(_0xca7d('0xb'));var _=require('lodash');var squel=require(_0xca7d('0xc'));var crypto=require(_0xca7d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xca7d('0xe'));var toCsv=require(_0xca7d('0x9'));var querystring=require(_0xca7d('0xf'));var Papa=require('papaparse');var Redis=require(_0xca7d('0x10'));var authService=require(_0xca7d('0x11'));var qs=require(_0xca7d('0x12'));var as=require(_0xca7d('0x13'));var hardwareService=require(_0xca7d('0x14'));var logger=require('../../config/logger')(_0xca7d('0x15'));var utils=require('../../config/utils');var config=require(_0xca7d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xca7d('0x17'))['db'];var jayson=require(_0xca7d('0x18'));var client=jayson[_0xca7d('0x19')][_0xca7d('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x4c1618,_0x5b5cdd,_0x5c045e,_0x3ed8ec){return new BPromise(function(_0x36f922,_0x3d8e7b){var _0x39caec=_0x3ed8ec||client;return _0x39caec[_0xca7d('0x1b')](_0x4c1618,_0x5c045e)[_0xca7d('0x1c')](function(_0x369923){logger[_0xca7d('0x1d')](_0xca7d('0x1e'),_0x5b5cdd,_0xca7d('0x1f'));logger[_0xca7d('0x20')](_0xca7d('0x21'),_0x5b5cdd,'request\x20sent',JSON['stringify'](_0x369923));if(_0x369923[_0xca7d('0x22')]){if(_0x369923[_0xca7d('0x22')][_0xca7d('0x23')]===0x1f4){logger[_0xca7d('0x22')](_0xca7d('0x1e'),_0x5b5cdd,_0x369923['error']['message']);return _0x3d8e7b(_0x369923[_0xca7d('0x22')]['message']);}logger[_0xca7d('0x22')](_0xca7d('0x1e'),_0x5b5cdd,_0x369923['error'][_0xca7d('0x24')]);return _0x36f922(_0x369923['error']['message']);}else{logger[_0xca7d('0x1d')](_0xca7d('0x1e'),_0x5b5cdd,_0xca7d('0x1f'));_0x36f922(_0x369923[_0xca7d('0x25')]['message']);}})[_0xca7d('0x26')](function(_0x1cca8a){logger[_0xca7d('0x22')](_0xca7d('0x1e'),_0x5b5cdd,_0x1cca8a);_0x3d8e7b(_0x1cca8a);});});}function respondWithStatusCode(_0x79fc7d,_0x351c87){_0x351c87=_0x351c87||0xcc;return function(_0xf4b873){if(_0xf4b873){return _0x79fc7d[_0xca7d('0x27')](_0x351c87);}return _0x79fc7d[_0xca7d('0x28')](_0x351c87)[_0xca7d('0x29')]();};}function respondWithResult(_0x59c71a,_0x24153){_0x24153=_0x24153||0xc8;return function(_0x41938b){if(_0x41938b){return _0x59c71a[_0xca7d('0x28')](_0x24153)[_0xca7d('0x2a')](_0x41938b);}};}function respondWithFilteredResult(_0x24cc8d,_0xc2048d){return function(_0x38ee14){if(_0x38ee14){var _0x162bf8=typeof _0xc2048d[_0xca7d('0x2b')]===_0xca7d('0x2c')&&typeof _0xc2048d['limit']===_0xca7d('0x2c');var _0x36e725=_0x38ee14['count'];var _0x3a1082=_0x162bf8?0x0:_0xc2048d['offset'];var _0x50c290=_0x162bf8?_0x38ee14[_0xca7d('0x2d')]:_0xc2048d['offset']+_0xc2048d[_0xca7d('0x2e')];var _0x1c4e7d;if(_0x50c290>=_0x36e725){_0x50c290=_0x36e725;_0x1c4e7d=0xc8;}else{_0x1c4e7d=0xce;}_0x24cc8d[_0xca7d('0x28')](_0x1c4e7d);return _0x24cc8d[_0xca7d('0x2f')](_0xca7d('0x30'),_0x3a1082+'-'+_0x50c290+'/'+_0x36e725)[_0xca7d('0x2a')](_0x38ee14);}return null;};}function patchUpdates(_0x496f57){return function(_0x86cfac){try{jsonpatch[_0xca7d('0x31')](_0x86cfac,_0x496f57,!![]);}catch(_0x28eeff){return BPromise['reject'](_0x28eeff);}return _0x86cfac[_0xca7d('0x32')]();};}function saveUpdates(_0x3d9356,_0x4487bd){return function(_0x401948){if(_0x401948){return _0x401948[_0xca7d('0x33')](_0x3d9356)[_0xca7d('0x1c')](function(_0x2b5449){return _0x2b5449;});}return null;};}function removeEntity(_0x35f717,_0x5bba0f){return function(_0x508f4b){if(_0x508f4b){return _0x508f4b[_0xca7d('0x34')]()[_0xca7d('0x1c')](function(){_0x35f717[_0xca7d('0x28')](0xcc)[_0xca7d('0x29')]();});}};}function handleEntityNotFound(_0x488fcb,_0x4924db){return function(_0x38f3a0){if(!_0x38f3a0){_0x488fcb['sendStatus'](0x194);}return _0x38f3a0;};}function handleError(_0x509f3a,_0x5b6695){_0x5b6695=_0x5b6695||0x1f4;return function(_0x187135){logger['error'](_0x187135[_0xca7d('0x35')]);if(_0x187135[_0xca7d('0x36')]){delete _0x187135[_0xca7d('0x36')];}_0x509f3a['status'](_0x5b6695)[_0xca7d('0x37')](_0x187135);};}exports[_0xca7d('0x38')]=function(_0x3dc00f,_0x5e3e9d){var _0x3da961={},_0x3950c3={},_0x5037da={'count':0x0,'rows':[]};var _0x1f1de2=_['map'](db[_0xca7d('0x39')]['rawAttributes'],function(_0x4d2d29){return{'name':_0x4d2d29[_0xca7d('0x3a')],'type':_0x4d2d29[_0xca7d('0x3b')][_0xca7d('0x3c')]};});_0x3950c3['model']=_[_0xca7d('0x3d')](_0x1f1de2,_0xca7d('0x36'));_0x3950c3[_0xca7d('0x3e')]=_[_0xca7d('0x3f')](_0x3dc00f[_0xca7d('0x3e')]);_0x3950c3[_0xca7d('0x40')]=_[_0xca7d('0x41')](_0x3950c3['model'],_0x3950c3['query']);_0x3da961['attributes']=_[_0xca7d('0x41')](_0x3950c3['model'],qs[_0xca7d('0x42')](_0x3dc00f['query'][_0xca7d('0x42')]));_0x3da961['attributes']=_0x3da961[_0xca7d('0x43')]['length']?_0x3da961[_0xca7d('0x43')]:_0x3950c3[_0xca7d('0x44')];if(!_0x3dc00f[_0xca7d('0x3e')][_0xca7d('0x45')]('nolimit')){_0x3da961['limit']=qs[_0xca7d('0x2e')](_0x3dc00f['query'][_0xca7d('0x2e')]);_0x3da961[_0xca7d('0x2b')]=qs[_0xca7d('0x2b')](_0x3dc00f[_0xca7d('0x3e')][_0xca7d('0x2b')]);}_0x3da961[_0xca7d('0x46')]=qs[_0xca7d('0x47')](_0x3dc00f['query'][_0xca7d('0x47')]);_0x3da961['where']=qs[_0xca7d('0x40')](_['pick'](_0x3dc00f[_0xca7d('0x3e')],_0x3950c3['filters']),_0x1f1de2);if(_0x3dc00f[_0xca7d('0x3e')]['filter']){_0x3da961['where']=_[_0xca7d('0x48')](_0x3da961['where'],{'$or':_[_0xca7d('0x3d')](_0x1f1de2,function(_0x5922c4){if(_0x5922c4[_0xca7d('0x3b')]!=='VIRTUAL'){var _0x492145={};_0x492145[_0x5922c4[_0xca7d('0x36')]]={'$like':'%'+_0x3dc00f[_0xca7d('0x3e')]['filter']+'%'};return _0x492145;}})});}_0x3da961=_['merge']({},_0x3da961,_0x3dc00f[_0xca7d('0x49')]);var _0x40a998={'where':_0x3da961['where']};return db['Setting']['count'](_0x40a998)[_0xca7d('0x1c')](function(_0x4c2ec1){_0x5037da[_0xca7d('0x2d')]=_0x4c2ec1;if(_0x3dc00f[_0xca7d('0x3e')]['includeAll']){_0x3da961[_0xca7d('0x4a')]=[{'all':!![]}];}return db[_0xca7d('0x39')][_0xca7d('0x4b')](_0x3da961);})['then'](function(_0x420693){_0x5037da[_0xca7d('0x4c')]=_0x420693;return _0x5037da;})[_0xca7d('0x1c')](respondWithFilteredResult(_0x5e3e9d,_0x3da961))[_0xca7d('0x26')](handleError(_0x5e3e9d,null));};exports[_0xca7d('0x4d')]=function(_0x179c80,_0x26c7ba){var _0x2d7a0d={'raw':![],'where':{'id':_0x179c80[_0xca7d('0x4e')]['id']}},_0xc19132={};_0xc19132[_0xca7d('0x44')]=_['keys'](db['Setting'][_0xca7d('0x4f')]);_0xc19132[_0xca7d('0x3e')]=_['keys'](_0x179c80[_0xca7d('0x3e')]);_0xc19132[_0xca7d('0x40')]=_['intersection'](_0xc19132[_0xca7d('0x44')],_0xc19132[_0xca7d('0x3e')]);_0x2d7a0d['attributes']=_[_0xca7d('0x41')](_0xc19132['model'],qs['fields'](_0x179c80[_0xca7d('0x3e')][_0xca7d('0x42')]));_0x2d7a0d['attributes']=_0x2d7a0d[_0xca7d('0x43')]['length']?_0x2d7a0d['attributes']:_0xc19132[_0xca7d('0x44')];if(_0x179c80[_0xca7d('0x3e')][_0xca7d('0x50')]){_0x2d7a0d[_0xca7d('0x4a')]=[{'all':!![]}];}_0x2d7a0d=_[_0xca7d('0x48')]({},_0x2d7a0d,_0x179c80[_0xca7d('0x49')]);return db[_0xca7d('0x39')][_0xca7d('0x51')](_0x2d7a0d)[_0xca7d('0x1c')](handleEntityNotFound(_0x26c7ba,null))['then'](respondWithResult(_0x26c7ba,null))['catch'](handleError(_0x26c7ba,null));};exports['update']=function(_0x5da783,_0x429b0a){if(_0x5da783[_0xca7d('0x52')]['id']){delete _0x5da783[_0xca7d('0x52')]['id'];}return db[_0xca7d('0x39')]['find']({'where':{'id':_0x5da783[_0xca7d('0x4e')]['id']}})[_0xca7d('0x1c')](handleEntityNotFound(_0x429b0a,null))[_0xca7d('0x1c')](saveUpdates(_0x5da783[_0xca7d('0x52')],null))[_0xca7d('0x1c')](respondWithResult(_0x429b0a,null))[_0xca7d('0x26')](handleError(_0x429b0a,null));};exports['addLogo']=function(_0x41f098,_0x55e672,_0x4ca647){if(_0x41f098[_0xca7d('0x53')]&&_0x41f098[_0xca7d('0x53')]['filename']){_0x41f098['body'][_0xca7d('0x54')]=_0x41f098[_0xca7d('0x53')]['filename'];}return db[_0xca7d('0x39')][_0xca7d('0x51')]({'where':{'id':_0x41f098[_0xca7d('0x4e')]['id']}})[_0xca7d('0x1c')](handleEntityNotFound(_0x55e672,null))[_0xca7d('0x1c')](saveUpdates(_0x41f098['body'],null))[_0xca7d('0x1c')](respondWithResult(_0x55e672,null))['catch'](handleError(_0x55e672,null));};exports['addLogoLogin']=function(_0xa9375f,_0x55e0c1,_0x52a671){if(_0xa9375f[_0xca7d('0x53')]&&_0xa9375f['file']['filename']){_0xa9375f['body'][_0xca7d('0x55')]=_0xa9375f['file'][_0xca7d('0x56')];}return db['Setting']['find']({'where':{'id':_0xa9375f[_0xca7d('0x4e')]['id']}})['then'](handleEntityNotFound(_0x55e0c1,null))[_0xca7d('0x1c')](saveUpdates(_0xa9375f[_0xca7d('0x52')],null))['then'](respondWithResult(_0x55e0c1,null))[_0xca7d('0x26')](handleError(_0x55e0c1,null));};var utilLicense=require(_0xca7d('0x57'));exports[_0xca7d('0x58')]=function(_0x33d240,_0x2f8f2c,_0x122eab){var _0x1931f6=_0xca7d('0x59');var _0x33da82={'custom':![]};return utilLicense[_0xca7d('0x5a')]()[_0xca7d('0x1c')](function(_0x4ea55f){if(_0x4ea55f){_0x33da82=_0x4ea55f;}return db[_0xca7d('0x39')][_0xca7d('0x51')]({'where':{'id':_0x33d240[_0xca7d('0x4e')]['id']},'attributes':['logo',_0xca7d('0x55'),_0xca7d('0x5b'),'favicon',_0xca7d('0x5c'),_0xca7d('0x5d'),'defaultPreferred',_0xca7d('0x5e')],'raw':!![]});})[_0xca7d('0x1c')](handleEntityNotFound(_0x2f8f2c,null))[_0xca7d('0x1c')](function(_0x4cef5b){if(_0x4cef5b){var _0xc59fcd=_0x4cef5b[_0xca7d('0x54')]&&fs[_0xca7d('0x5f')](path[_0xca7d('0x60')](config[_0xca7d('0x61')],_0x1931f6,_[_0xca7d('0x62')](_0x4cef5b[_0xca7d('0x54')])))?path[_0xca7d('0x60')](config['root'],_0x1931f6,_[_0xca7d('0x62')](_0x4cef5b[_0xca7d('0x54')])):path[_0xca7d('0x60')](config[_0xca7d('0x61')],_0x1931f6,_[_0xca7d('0x62')](_0xca7d('0x63')));var _0x53c840='default'+_[_0xca7d('0x64')](_0xca7d('0x54'));if(_0x4cef5b[_0x53c840]||!_0x33da82[_0xca7d('0x65')]){_0xc59fcd=path['join'](config[_0xca7d('0x61')],_0x1931f6,_['toLower']('default_logo.svg'));}if(!fs[_0xca7d('0x5f')](_0xc59fcd)){throw new db[(_0xca7d('0x66'))]['ValidationError'](_['upperFirst']('logo')+_0xca7d('0x67'));}return _0x2f8f2c[_0xca7d('0x68')](_0xc59fcd);}})[_0xca7d('0x26')](handleError(_0x2f8f2c,null));};var utilLicense=require(_0xca7d('0x57'));exports[_0xca7d('0x69')]=function(_0x2bfab1,_0x2f7a9c,_0x58f9c7){var _0x4bda07='server/files/images/logos';var _0x55ce2e={'custom':![]};return utilLicense['getLicense']()[_0xca7d('0x1c')](function(_0x24ab4d){if(_0x24ab4d){_0x55ce2e=_0x24ab4d;}return db['Setting']['find']({'where':{'id':_0x2bfab1[_0xca7d('0x4e')]['id']},'attributes':[_0xca7d('0x54'),'loginLogo',_0xca7d('0x5b'),'favicon',_0xca7d('0x5c'),'defaultLoginLogo',_0xca7d('0x6a'),_0xca7d('0x5e')],'raw':!![]});})[_0xca7d('0x1c')](handleEntityNotFound(_0x2f7a9c,null))['then'](function(_0x55aafb){if(_0x55aafb){var _0x2da935=_0x55aafb[_0xca7d('0x55')]&&fs[_0xca7d('0x5f')](path[_0xca7d('0x60')](config['root'],_0x4bda07,_[_0xca7d('0x62')](_0x55aafb['loginLogo'])))?path['join'](config['root'],_0x4bda07,_['toLower'](_0x55aafb['loginLogo'])):path['join'](config[_0xca7d('0x61')],_0x4bda07,_['toLower'](_0xca7d('0x6b')));var _0xdd909f=_0xca7d('0x6c')+_[_0xca7d('0x64')](_0xca7d('0x55'));if(_0x55aafb[_0xdd909f]||!_0x55ce2e[_0xca7d('0x65')]){_0x2da935=path[_0xca7d('0x60')](config['root'],_0x4bda07,_['toLower'](_0xca7d('0x6b')));}if(!fs[_0xca7d('0x5f')](_0x2da935)){throw new db[(_0xca7d('0x66'))][(_0xca7d('0x6d'))](_[_0xca7d('0x64')](_0xca7d('0x55'))+_0xca7d('0x67'));}return _0x2f7a9c[_0xca7d('0x68')](_0x2da935);}})['catch'](handleError(_0x2f7a9c,null));};exports[_0xca7d('0x6e')]=function(_0x3d8d17,_0x46e9d5){return db[_0xca7d('0x39')][_0xca7d('0x51')]({'where':{'id':_0x3d8d17['params']['id']},'attributes':[_0xca7d('0x6f')]})[_0xca7d('0x1c')](respondWithResult(_0x46e9d5,null))[_0xca7d('0x26')](handleError(_0x46e9d5,null));};exports['addPreferred']=function(_0x1ca87a,_0x7a223,_0x348a05){if(_0x1ca87a['file']&&_0x1ca87a[_0xca7d('0x53')][_0xca7d('0x56')]){_0x1ca87a[_0xca7d('0x52')]['preferred']=_0x1ca87a[_0xca7d('0x53')][_0xca7d('0x56')];}return db[_0xca7d('0x39')][_0xca7d('0x51')]({'where':{'id':_0x1ca87a[_0xca7d('0x4e')]['id']}})['then'](handleEntityNotFound(_0x7a223,null))[_0xca7d('0x1c')](saveUpdates(_0x1ca87a[_0xca7d('0x52')],null))[_0xca7d('0x1c')](respondWithResult(_0x7a223,null))[_0xca7d('0x26')](handleError(_0x7a223,null));};var utilLicense=require('../../config/license/util');exports[_0xca7d('0x70')]=function(_0x56cc98,_0x22549c,_0x42f6ec){var _0x5a5dfa=_0xca7d('0x59');var _0xd77d5c={'custom':![]};return utilLicense[_0xca7d('0x5a')]()[_0xca7d('0x1c')](function(_0x213641){if(_0x213641){_0xd77d5c=_0x213641;}return db[_0xca7d('0x39')]['find']({'where':{'id':_0x56cc98[_0xca7d('0x4e')]['id']},'attributes':[_0xca7d('0x54'),'loginLogo',_0xca7d('0x5b'),'favicon','defaultLogo','defaultLoginLogo','defaultPreferred',_0xca7d('0x5e')],'raw':!![]});})[_0xca7d('0x1c')](handleEntityNotFound(_0x22549c,null))['then'](function(_0x5d1eb9){if(_0x5d1eb9){var _0x5ed25c=_0x5d1eb9['preferred']&&fs[_0xca7d('0x5f')](path[_0xca7d('0x60')](config[_0xca7d('0x61')],_0x5a5dfa,_[_0xca7d('0x62')](_0x5d1eb9[_0xca7d('0x5b')])))?path[_0xca7d('0x60')](config[_0xca7d('0x61')],_0x5a5dfa,_[_0xca7d('0x62')](_0x5d1eb9[_0xca7d('0x5b')])):path[_0xca7d('0x60')](config['root'],_0x5a5dfa,_['toLower']('default_preferred.png'));var _0x5d32e2=_0xca7d('0x6c')+_[_0xca7d('0x64')](_0xca7d('0x5b'));if(_0x5d1eb9[_0x5d32e2]||!_0xd77d5c[_0xca7d('0x65')]||!_0xd77d5c[_0xca7d('0x5b')]){_0x5ed25c=path[_0xca7d('0x60')](config[_0xca7d('0x61')],_0x5a5dfa,_['toLower'](_0xca7d('0x71')));}if(!fs['existsSync'](_0x5ed25c)){throw new db[(_0xca7d('0x66'))][(_0xca7d('0x6d'))](_[_0xca7d('0x64')](_0xca7d('0x5b'))+_0xca7d('0x67'));}return _0x22549c[_0xca7d('0x68')](_0x5ed25c);}})[_0xca7d('0x26')](handleError(_0x22549c,null));};exports[_0xca7d('0x72')]=function(_0x114e17,_0x5c3121,_0xaef01f){if(_0x114e17[_0xca7d('0x53')]&&_0x114e17[_0xca7d('0x53')]['filename']){_0x114e17[_0xca7d('0x52')][_0xca7d('0x73')]=_0x114e17['file'][_0xca7d('0x56')];}return db[_0xca7d('0x39')][_0xca7d('0x51')]({'where':{'id':_0x114e17['params']['id']}})['then'](handleEntityNotFound(_0x5c3121,null))[_0xca7d('0x1c')](saveUpdates(_0x114e17[_0xca7d('0x52')],null))['then'](respondWithResult(_0x5c3121,null))[_0xca7d('0x26')](handleError(_0x5c3121,null));};var utilLicense=require(_0xca7d('0x57'));exports[_0xca7d('0x74')]=function(_0x8d244e,_0x3a06f7,_0x355349){var _0x151290=_0xca7d('0x59');var _0x1dd355={'custom':![]};return utilLicense['getLicense']()[_0xca7d('0x1c')](function(_0x2b2090){if(_0x2b2090){_0x1dd355=_0x2b2090;}return db[_0xca7d('0x39')][_0xca7d('0x51')]({'where':{'id':_0x8d244e[_0xca7d('0x4e')]['id']},'attributes':[_0xca7d('0x54'),_0xca7d('0x55'),'preferred',_0xca7d('0x73'),_0xca7d('0x5c'),'defaultLoginLogo',_0xca7d('0x6a'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x3a06f7,null))[_0xca7d('0x1c')](function(_0x4bf73f){if(_0x4bf73f){var _0x1698aa=_0x4bf73f[_0xca7d('0x73')]&&fs['existsSync'](path[_0xca7d('0x60')](config[_0xca7d('0x61')],_0x151290,_[_0xca7d('0x62')](_0x4bf73f[_0xca7d('0x73')])))?path[_0xca7d('0x60')](config['root'],_0x151290,_['toLower'](_0x4bf73f['favicon'])):path[_0xca7d('0x60')](config['root'],_0x151290,_[_0xca7d('0x62')](_0xca7d('0x75')));var _0x233b50='default'+_[_0xca7d('0x64')](_0xca7d('0x73'));if(_0x4bf73f[_0x233b50]||!_0x1dd355[_0xca7d('0x65')]){_0x1698aa=path[_0xca7d('0x60')](config['root'],_0x151290,_['toLower'](_0xca7d('0x75')));}if(!fs[_0xca7d('0x5f')](_0x1698aa)){throw new db[(_0xca7d('0x66'))][(_0xca7d('0x6d'))](_['upperFirst'](_0xca7d('0x73'))+_0xca7d('0x67'));}return _0x3a06f7[_0xca7d('0x68')](_0x1698aa);}})[_0xca7d('0x26')](handleError(_0x3a06f7,null));};exports[_0xca7d('0x76')]=function(_0x48af40,_0x2bddfa){var _0x503b3f={'offset':moment()['utcOffset']()};_0x503b3f['now']=moment()[_0xca7d('0x77')](_0x503b3f[_0xca7d('0x2b')])[_0xca7d('0x78')](_0xca7d('0x79'));return _0x2bddfa[_0xca7d('0x28')](0xc8)['send'](_0x503b3f);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 7774acc..2ff94f8 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 _0x55ca=['./setting.attributes','exports','define','settings','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x308213,_0x224541){var _0x2e1619=function(_0x972b51){while(--_0x972b51){_0x308213['push'](_0x308213['shift']());}};_0x2e1619(++_0x224541);}(_0x55ca,0x126));var _0xa55c=function(_0x5c6244,_0x112ab8){_0x5c6244=_0x5c6244-0x0;var _0x5800ce=_0x55ca[_0x5c6244];return _0x5800ce;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('Setting',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe14b=['bluebird','path','./setting.attributes','exports','define','Setting','settings','lodash','util','moment'];(function(_0x5de909,_0x45d766){var _0x1e9d2d=function(_0x5189db){while(--_0x5189db){_0x5de909['push'](_0x5de909['shift']());}};_0x1e9d2d(++_0x45d766);}(_0xe14b,0x93));var _0xbe14=function(_0x3e3b7e,_0xe059d0){_0x3e3b7e=_0x3e3b7e-0x0;var _0x5bc606=_0xe14b[_0x3e3b7e];return _0x5bc606;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index eb2e99a..0cdabce 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 _0x1978=['options','attributes','include','map','model','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','result','ShowSetting','find'];(function(_0x18d7c4,_0x67c4c2){var _0x221b3d=function(_0x2752cf){while(--_0x2752cf){_0x18d7c4['push'](_0x18d7c4['shift']());}};_0x221b3d(++_0x67c4c2);}(_0x1978,0x11d));var _0x8197=function(_0x35f66e,_0x23a510){_0x35f66e=_0x35f66e-0x0;var _0x139aa2=_0x1978[_0x35f66e];return _0x139aa2;};'use strict';var _=require(_0x8197('0x0'));var util=require('util');var moment=require(_0x8197('0x1'));var BPromise=require(_0x8197('0x2'));var rs=require(_0x8197('0x3'));var fs=require('fs');var Redis=require(_0x8197('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8197('0x5'));var logger=require(_0x8197('0x6'))(_0x8197('0x7'));var config=require('../../config/environment');var jayson=require(_0x8197('0x8'));var client=jayson[_0x8197('0x9')][_0x8197('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33d54e,_0x32dd4e,_0x2168de){return new BPromise(function(_0x2f43b8,_0x2b7caf){return client[_0x8197('0xb')](_0x33d54e,_0x2168de)[_0x8197('0xc')](function(_0x53c207){logger[_0x8197('0xd')]('Setting,\x20%s,\x20%s',_0x32dd4e,_0x8197('0xe'));logger[_0x8197('0xf')](_0x8197('0x10'),_0x32dd4e,_0x8197('0xe'),JSON[_0x8197('0x11')](_0x53c207));if(_0x53c207[_0x8197('0x12')]){if(_0x53c207[_0x8197('0x12')][_0x8197('0x13')]===0x1f4){logger[_0x8197('0x12')](_0x8197('0x14'),_0x32dd4e,_0x53c207[_0x8197('0x12')][_0x8197('0x15')]);return _0x2b7caf(_0x53c207['error']['message']);}logger[_0x8197('0x12')]('Setting,\x20%s,\x20%s',_0x32dd4e,_0x53c207[_0x8197('0x12')][_0x8197('0x15')]);return _0x2f43b8(_0x53c207['error'][_0x8197('0x15')]);}else{logger[_0x8197('0xd')](_0x8197('0x14'),_0x32dd4e,'request\x20sent');_0x2f43b8(_0x53c207[_0x8197('0x16')]['message']);}})['catch'](function(_0x1be860){logger['error'](_0x8197('0x14'),_0x32dd4e,_0x1be860);_0x2b7caf(_0x1be860);});});}exports[_0x8197('0x17')]=function(_0x2fc6cc){var _0x1331cf=this;return new Promise(function(_0xbb4a3b,_0xe02e30){return db['Setting'][_0x8197('0x18')]({'raw':_0x2fc6cc[_0x8197('0x19')]?_0x2fc6cc[_0x8197('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2fc6cc['options']?_0x2fc6cc[_0x8197('0x19')]['where']||null:null,'attributes':_0x2fc6cc[_0x8197('0x19')]?_0x2fc6cc['options'][_0x8197('0x1a')]||null:null,'include':_0x2fc6cc[_0x8197('0x19')]?_0x2fc6cc[_0x8197('0x19')][_0x8197('0x1b')]?_[_0x8197('0x1c')](_0x2fc6cc['options'][_0x8197('0x1b')],function(_0x3e8b53){return{'model':db[_0x3e8b53['model']],'as':_0x3e8b53['as'],'attributes':_0x3e8b53[_0x8197('0x1a')],'include':_0x3e8b53['include']?_[_0x8197('0x1c')](_0x3e8b53[_0x8197('0x1b')],function(_0x447fad){return{'model':db[_0x447fad['model']],'as':_0x447fad['as'],'attributes':_0x447fad[_0x8197('0x1a')],'include':_0x447fad[_0x8197('0x1b')]?_[_0x8197('0x1c')](_0x447fad['include'],function(_0x23ebe5){return{'model':db[_0x23ebe5[_0x8197('0x1d')]],'as':_0x23ebe5['as'],'attributes':_0x23ebe5[_0x8197('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8197('0xc')](function(_0x16fbaf){logger[_0x8197('0xd')](_0x8197('0x17'),_0x2fc6cc);logger[_0x8197('0xf')](_0x8197('0x17'),_0x2fc6cc,JSON[_0x8197('0x11')](_0x16fbaf));_0xbb4a3b(_0x16fbaf);})[_0x8197('0x1e')](function(_0x218ebc){logger[_0x8197('0x12')](_0x8197('0x17'),_0x218ebc['message'],_0x2fc6cc);_0xe02e30(_0x1331cf[_0x8197('0x12')](0x1f4,_0x218ebc['message']));});});}; \ No newline at end of file +var _0x89d1=['request','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','ShowSetting','Setting','find','options','where','attributes','include','map','model','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0xb82940,_0x530318){var _0x2e152a=function(_0x27bf29){while(--_0x27bf29){_0xb82940['push'](_0xb82940['shift']());}};_0x2e152a(++_0x530318);}(_0x89d1,0x188));var _0x189d=function(_0x397ce4,_0x4285b5){_0x397ce4=_0x397ce4-0x0;var _0x220a03=_0x89d1[_0x397ce4];return _0x220a03;};'use strict';var _=require('lodash');var util=require(_0x189d('0x0'));var moment=require(_0x189d('0x1'));var BPromise=require(_0x189d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x189d('0x3'));var db=require(_0x189d('0x4'))['db'];var utils=require(_0x189d('0x5'));var logger=require(_0x189d('0x6'))(_0x189d('0x7'));var config=require(_0x189d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x189d('0x9')][_0x189d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a3ccf,_0x1eeccb,_0x507a44){return new BPromise(function(_0x2741d0,_0x53adb7){return client[_0x189d('0xb')](_0x1a3ccf,_0x507a44)['then'](function(_0x84825e){logger['info'](_0x189d('0xc'),_0x1eeccb,_0x189d('0xd'));logger[_0x189d('0xe')](_0x189d('0xf'),_0x1eeccb,_0x189d('0xd'),JSON[_0x189d('0x10')](_0x84825e));if(_0x84825e[_0x189d('0x11')]){if(_0x84825e['error']['code']===0x1f4){logger[_0x189d('0x11')](_0x189d('0xc'),_0x1eeccb,_0x84825e[_0x189d('0x11')][_0x189d('0x12')]);return _0x53adb7(_0x84825e[_0x189d('0x11')][_0x189d('0x12')]);}logger[_0x189d('0x11')](_0x189d('0xc'),_0x1eeccb,_0x84825e[_0x189d('0x11')][_0x189d('0x12')]);return _0x2741d0(_0x84825e[_0x189d('0x11')]['message']);}else{logger[_0x189d('0x13')](_0x189d('0xc'),_0x1eeccb,'request\x20sent');_0x2741d0(_0x84825e[_0x189d('0x14')][_0x189d('0x12')]);}})['catch'](function(_0x1f3b4e){logger[_0x189d('0x11')]('Setting,\x20%s,\x20%s',_0x1eeccb,_0x1f3b4e);_0x53adb7(_0x1f3b4e);});});}exports[_0x189d('0x15')]=function(_0xd9263){var _0x15ab9c=this;return new Promise(function(_0x1241cb,_0x5955a0){return db[_0x189d('0x16')][_0x189d('0x17')]({'raw':_0xd9263[_0x189d('0x18')]?_0xd9263[_0x189d('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0xd9263['options']?_0xd9263[_0x189d('0x18')][_0x189d('0x19')]||null:null,'attributes':_0xd9263['options']?_0xd9263[_0x189d('0x18')][_0x189d('0x1a')]||null:null,'include':_0xd9263[_0x189d('0x18')]?_0xd9263['options'][_0x189d('0x1b')]?_[_0x189d('0x1c')](_0xd9263[_0x189d('0x18')][_0x189d('0x1b')],function(_0x115706){return{'model':db[_0x115706[_0x189d('0x1d')]],'as':_0x115706['as'],'attributes':_0x115706['attributes'],'include':_0x115706[_0x189d('0x1b')]?_[_0x189d('0x1c')](_0x115706[_0x189d('0x1b')],function(_0x45d20f){return{'model':db[_0x45d20f[_0x189d('0x1d')]],'as':_0x45d20f['as'],'attributes':_0x45d20f['attributes'],'include':_0x45d20f[_0x189d('0x1b')]?_[_0x189d('0x1c')](_0x45d20f['include'],function(_0x20206f){return{'model':db[_0x20206f[_0x189d('0x1d')]],'as':_0x20206f['as'],'attributes':_0x20206f[_0x189d('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a114d){logger[_0x189d('0x13')]('ShowSetting',_0xd9263);logger[_0x189d('0xe')](_0x189d('0x15'),_0xd9263,JSON[_0x189d('0x10')](_0x1a114d));_0x1241cb(_0x1a114d);})[_0x189d('0x1e')](function(_0xd27c29){logger[_0x189d('0x11')](_0x189d('0x15'),_0xd27c29['message'],_0xd9263);_0x5955a0(_0x15ab9c['error'](0x1f4,_0xd27c29[_0x189d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 4ca2697..958284d 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 _0x9957=['getInteractions','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/status','status','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x1f863c,_0x536329){var _0x10256f=function(_0x2ba276){while(--_0x2ba276){_0x1f863c['push'](_0x1f863c['shift']());}};_0x10256f(++_0x536329);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/canned_answers',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x9')](_0x7995('0x14'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router['get']('/:id/status',controller[_0x7995('0x16')]);router[_0x7995('0x9')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x1a')]);router['post'](_0x7995('0xf'),auth['isAuthenticated'](),controller[_0x7995('0x1b')]);router[_0x7995('0x19')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router[_0x7995('0x19')]('/:id/notify',controller['notify']);router[_0x7995('0x19')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7995('0x1e')]);router[_0x7995('0x19')]('/:id/send',auth[_0x7995('0xa')](),controller['send']);router['post'](_0x7995('0x1f'),controller[_0x7995('0x20')]);router[_0x7995('0x19')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x21')]);router['put'](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x23')]);router[_0x7995('0x24')](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x25')]);router[_0x7995('0x24')]('/:id/dispositions',auth[_0x7995('0xa')](),controller[_0x7995('0x26')]);router[_0x7995('0x24')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x27')]);router['delete'](_0x7995('0x17'),auth['isAuthenticated'](),controller[_0x7995('0x28')]);module[_0x7995('0x29')]=router; \ No newline at end of file +var _0x9957=['getInteractions','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/status','status','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x55ef8b,_0x5deb5e){var _0x359c84=function(_0x437673){while(--_0x437673){_0x55ef8b['push'](_0x55ef8b['shift']());}};_0x359c84(++_0x5deb5e);}(_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',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/canned_answers',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x9')](_0x7995('0x14'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router['get']('/:id/status',controller[_0x7995('0x16')]);router[_0x7995('0x9')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x1a')]);router['post'](_0x7995('0xf'),auth['isAuthenticated'](),controller[_0x7995('0x1b')]);router[_0x7995('0x19')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router[_0x7995('0x19')]('/:id/notify',controller['notify']);router[_0x7995('0x19')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7995('0x1e')]);router[_0x7995('0x19')]('/:id/send',auth[_0x7995('0xa')](),controller['send']);router['post'](_0x7995('0x1f'),controller[_0x7995('0x20')]);router[_0x7995('0x19')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x21')]);router['put'](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x23')]);router[_0x7995('0x24')](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x25')]);router[_0x7995('0x24')]('/:id/dispositions',auth[_0x7995('0xa')](),controller[_0x7995('0x26')]);router[_0x7995('0x24')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x27')]);router['delete'](_0x7995('0x17'),auth['isAuthenticated'](),controller[_0x7995('0x28')]);module[_0x7995('0x29')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 97abd4b..dc9df00 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 _0xd5df=['plivo','clickatell','bandwidth','csc','infobip','BOOLEAN','TEXT','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','STRING','generate','twilio','skebby','connectel'];(function(_0x500785,_0x15e5ff){var _0x1f8bcc=function(_0x406983){while(--_0x406983){_0x500785['push'](_0x500785['shift']());}};_0x1f8bcc(++_0x15e5ff);}(_0xd5df,0x10b));var _0xfd5d=function(_0x386e5f,_0x1eed07){_0x386e5f=_0x386e5f-0x0;var _0x556df7=_0xd5df[_0x386e5f];return _0x556df7;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0xfd5d('0x0')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xfd5d('0x0')],'allowNull':![]},'remote':{'type':Sequelize[_0xfd5d('0x0')],'allowNull':![]},'token':{'type':Sequelize[_0xfd5d('0x0')],'defaultValue':function(){return rs[_0xfd5d('0x1')]();}},'phone':{'type':Sequelize[_0xfd5d('0x0')]},'type':{'type':Sequelize['ENUM'](_0xfd5d('0x2'),_0xfd5d('0x3'),_0xfd5d('0x4'),'clicksend',_0xfd5d('0x5'),_0xfd5d('0x6'),_0xfd5d('0x7'),_0xfd5d('0x8'),_0xfd5d('0x9'),'intelepeer')},'accountSid':{'type':Sequelize[_0xfd5d('0x0')]},'authId':{'type':Sequelize[_0xfd5d('0x0')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xfd5d('0x0')]},'apiKey':{'type':Sequelize[_0xfd5d('0x0')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0xfd5d('0x0')]},'senderString':{'type':Sequelize[_0xfd5d('0x0')]},'deliveryReport':{'type':Sequelize[_0xfd5d('0xa')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xfd5d('0xb')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xfd5d('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xfd5d('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xfd5d('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfd5d('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xfd5d('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfd5d('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xfd5d('0x0')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfd5d('0xc')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xfd5d('0xa')],'defaultValue':![],'comment':_0xfd5d('0xd'),'set':function(_0x26502c){if(!_0x26502c)this[_0xfd5d('0xe')](_0xfd5d('0xf'),null);this['setDataValue'](_0xfd5d('0x10'),_0x26502c);}}}; \ No newline at end of file +var _0xaf5b=['BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','generate','ENUM','skebby','connectel','clicksend','plivo','clickatell','bandwidth','csc'];(function(_0x43c50d,_0x1661fa){var _0x37694e=function(_0x5542ee){while(--_0x5542ee){_0x43c50d['push'](_0x43c50d['shift']());}};_0x37694e(++_0x1661fa);}(_0xaf5b,0x147));var _0xbaf5=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xaf5b[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0xbaf5('0x0'));var rs=require(_0xbaf5('0x1'));module[_0xbaf5('0x2')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xbaf5('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xbaf5('0x4')]();}},'phone':{'type':Sequelize[_0xbaf5('0x3')]},'type':{'type':Sequelize[_0xbaf5('0x5')]('twilio',_0xbaf5('0x6'),_0xbaf5('0x7'),_0xbaf5('0x8'),_0xbaf5('0x9'),_0xbaf5('0xa'),_0xbaf5('0xb'),_0xbaf5('0xc'),'infobip','intelepeer')},'accountSid':{'type':Sequelize[_0xbaf5('0x3')]},'authId':{'type':Sequelize[_0xbaf5('0x3')]},'authToken':{'type':Sequelize[_0xbaf5('0x3')]},'smsMethod':{'type':Sequelize[_0xbaf5('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0xbaf5('0x3')]},'password':{'type':Sequelize[_0xbaf5('0x3')]},'apiKey':{'type':Sequelize[_0xbaf5('0x3')]},'applicationId':{'type':Sequelize[_0xbaf5('0x3')]},'accountId':{'type':Sequelize[_0xbaf5('0x3')]},'senderString':{'type':Sequelize[_0xbaf5('0x3')]},'deliveryReport':{'type':Sequelize[_0xbaf5('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0xbaf5('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xbaf5('0xe');}},'notificationSound':{'type':Sequelize[_0xbaf5('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbaf5('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xbaf5('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xbaf5('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbaf5('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbaf5('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xbaf5('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xbaf5('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbaf5('0xf')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xbaf5('0x10'),'set':function(_0x481b81){if(!_0x481b81)this['setDataValue'](_0xbaf5('0x11'),null);this[_0xbaf5('0x12')](_0xbaf5('0x13'),_0x481b81);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index fc6fced..e819dd5 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 _0x06bc=['result','catch','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','SmsAccounts','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','SmsAccount','fieldName','type','key','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','params','rawAttributes','keys','find','create','body','user','role','UserProfileSection','userProfileId','describe','addDisposition','getDispositions','findOne','Disposition','order','SmsAccountId','findAll','removeDispositions','ids','addAnswer','CannedAnswer','pick','removeAnswers','notify','sms','SmsApplication','Applications','applications','orderBy','priority','account','CmContact','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','twilio','From','Body','skebby','from','sender','connectel','clicksend','plivo','Text','messageId','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','replyMessageId','text','intelepeer','refid','isNil','Sequelize','ValidationError','from\x20is\x20mandatory','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','DESC','list','omit','Contacts','defaults','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','text/xml','send','\x0a','json','addApplications','transaction','sequelize','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','to\x20is\x20mandatory','List','ListId','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','message_id','status_code','groupName','DELIVERED','redif','error_code','clickatell','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','bandwidth','DELIVRD','message-id','addAgents','emit','userSmsAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x4e3be8,_0x194867){var _0x496611=function(_0x3cb703){while(--_0x3cb703){_0x4e3be8['push'](_0x4e3be8['shift']());}};_0x496611(++_0x194867);}(_0x06bc,0xc1));var _0xc06b=function(_0xe07c46,_0x18b339){_0xe07c46=_0xe07c46-0x0;var _0x32476d=_0x06bc[_0xe07c46];return _0x32476d;};'use strict';var emlformat=require(_0xc06b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc06b('0x1'));var jsonpatch=require(_0xc06b('0x2'));var rp=require(_0xc06b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc06b('0x4'));var util=require(_0xc06b('0x5'));var path=require(_0xc06b('0x6'));var sox=require(_0xc06b('0x7'));var csv=require(_0xc06b('0x8'));var ejs=require(_0xc06b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xc06b('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc06b('0x8'));var querystring=require(_0xc06b('0xb'));var Papa=require(_0xc06b('0xc'));var Redis=require(_0xc06b('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xc06b('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc06b('0xf'));var logger=require(_0xc06b('0x10'))(_0xc06b('0x11'));var utils=require(_0xc06b('0x12'));var config=require(_0xc06b('0x13'));var licenseUtil=require(_0xc06b('0x14'));var db=require(_0xc06b('0x15'))['db'];config[_0xc06b('0x16')]=_['defaults'](config[_0xc06b('0x16')],{'host':_0xc06b('0x17'),'port':0x18eb});var socket=require(_0xc06b('0x18'))(new Redis(config[_0xc06b('0x16')]));require(_0xc06b('0x19'))[_0xc06b('0x1a')](socket);var jayson=require(_0xc06b('0x1b'));var client=jayson[_0xc06b('0x1c')]['http']({'port':0x232c});function respondWithRpcPromise(_0x11f531,_0x8ea5b3,_0x51399d,_0x3eb181){return new BPromise(function(_0x2c59c7,_0x355031){var _0x6ec4de=_0x3eb181||client;return _0x6ec4de[_0xc06b('0x1d')](_0x11f531,_0x51399d)[_0xc06b('0x1e')](function(_0x407e45){logger[_0xc06b('0x1f')](_0xc06b('0x20'),_0x8ea5b3,_0xc06b('0x21'));logger['debug'](_0xc06b('0x22'),_0x8ea5b3,'request\x20sent',JSON['stringify'](_0x407e45));if(_0x407e45[_0xc06b('0x23')]){if(_0x407e45['error'][_0xc06b('0x24')]===0x1f4){logger['error'](_0xc06b('0x20'),_0x8ea5b3,_0x407e45['error'][_0xc06b('0x25')]);return _0x355031(_0x407e45[_0xc06b('0x23')][_0xc06b('0x25')]);}logger[_0xc06b('0x23')](_0xc06b('0x20'),_0x8ea5b3,_0x407e45[_0xc06b('0x23')][_0xc06b('0x25')]);return _0x2c59c7(_0x407e45[_0xc06b('0x23')][_0xc06b('0x25')]);}else{logger[_0xc06b('0x1f')](_0xc06b('0x20'),_0x8ea5b3,'request\x20sent');_0x2c59c7(_0x407e45[_0xc06b('0x26')][_0xc06b('0x25')]);}})[_0xc06b('0x27')](function(_0xae61eb){logger[_0xc06b('0x23')](_0xc06b('0x20'),_0x8ea5b3,_0xae61eb);_0x355031(_0xae61eb);});});}function respondWithStatusCode(_0xa0d54e,_0x28faf8){_0x28faf8=_0x28faf8||0xcc;return function(_0x26fbf6){if(_0x26fbf6){return _0xa0d54e[_0xc06b('0x28')](_0x28faf8);}return _0xa0d54e['status'](_0x28faf8)[_0xc06b('0x29')]();};}function respondWithResult(_0x58a3c7,_0x3f6640){_0x3f6640=_0x3f6640||0xc8;return function(_0x150503){if(_0x150503){return _0x58a3c7[_0xc06b('0x2a')](_0x3f6640)['json'](_0x150503);}};}function respondWithFilteredResult(_0x2e7bc9,_0x2efb61){return function(_0xde323b){if(_0xde323b){var _0x24253f=typeof _0x2efb61[_0xc06b('0x2b')]===_0xc06b('0x2c')&&typeof _0x2efb61[_0xc06b('0x2d')]==='undefined';var _0x2d5ff9=_0xde323b[_0xc06b('0x2e')];var _0x389593=_0x24253f?0x0:_0x2efb61[_0xc06b('0x2b')];var _0x4b7237=_0x24253f?_0xde323b[_0xc06b('0x2e')]:_0x2efb61['offset']+_0x2efb61[_0xc06b('0x2d')];var _0x2883c3;if(_0x4b7237>=_0x2d5ff9){_0x4b7237=_0x2d5ff9;_0x2883c3=0xc8;}else{_0x2883c3=0xce;}_0x2e7bc9[_0xc06b('0x2a')](_0x2883c3);return _0x2e7bc9[_0xc06b('0x2f')](_0xc06b('0x30'),_0x389593+'-'+_0x4b7237+'/'+_0x2d5ff9)['json'](_0xde323b);}return null;};}function patchUpdates(_0x231d15){return function(_0x3625ea){try{jsonpatch[_0xc06b('0x31')](_0x3625ea,_0x231d15,!![]);}catch(_0x51a02c){return BPromise[_0xc06b('0x32')](_0x51a02c);}return _0x3625ea[_0xc06b('0x33')]();};}function saveUpdates(_0x5d3fd9,_0x5ca162){return function(_0x383d20){if(_0x383d20){return _0x383d20[_0xc06b('0x34')](_0x5d3fd9)[_0xc06b('0x1e')](function(_0xf81f68){return _0xf81f68;});}return null;};}function removeEntity(_0x428ee3,_0x3b5d7e){return function(_0x2913cc){if(_0x2913cc){return _0x2913cc[_0xc06b('0x35')]()[_0xc06b('0x1e')](function(){var _0x1d34f3=_0x2913cc[_0xc06b('0x36')]({'plain':!![]});var _0x437bdb=_0xc06b('0x37');return db[_0xc06b('0x38')]['destroy']({'where':{'type':_0x437bdb,'resourceId':_0x1d34f3['id']}})['then'](function(){return _0x2913cc;});})[_0xc06b('0x1e')](function(){_0x428ee3[_0xc06b('0x2a')](0xcc)[_0xc06b('0x29')]();});}};}function handleEntityNotFound(_0x1d9c95,_0x82291d){return function(_0x733fe4){if(!_0x733fe4){_0x1d9c95[_0xc06b('0x28')](0x194);}return _0x733fe4;};}function handleError(_0x386018,_0x1e0eeb){_0x1e0eeb=_0x1e0eeb||0x1f4;return function(_0x1aaf02){logger[_0xc06b('0x23')](_0x1aaf02[_0xc06b('0x39')]);if(_0x1aaf02[_0xc06b('0x3a')]){delete _0x1aaf02['name'];}_0x386018[_0xc06b('0x2a')](_0x1e0eeb)['send'](_0x1aaf02);};}exports[_0xc06b('0x3b')]=function(_0x242bd2,_0x1eb57e){var _0x361207={'include':[{'model':db[_0xc06b('0x3c')],'as':_0xc06b('0x3d')}]},_0x4d6c69={},_0x38d6e6={'count':0x0,'rows':[]};var _0x2cc250=_[_0xc06b('0x3e')](db[_0xc06b('0x3f')]['rawAttributes'],function(_0x265c87){return{'name':_0x265c87[_0xc06b('0x40')],'type':_0x265c87[_0xc06b('0x41')][_0xc06b('0x42')]};});_0x4d6c69['model']=_[_0xc06b('0x3e')](_0x2cc250,'name');_0x4d6c69[_0xc06b('0x43')]=_['keys'](_0x242bd2[_0xc06b('0x43')]);_0x4d6c69[_0xc06b('0x44')]=_[_0xc06b('0x45')](_0x4d6c69['model'],_0x4d6c69[_0xc06b('0x43')]);_0x361207[_0xc06b('0x46')]=_[_0xc06b('0x45')](_0x4d6c69['model'],qs[_0xc06b('0x47')](_0x242bd2[_0xc06b('0x43')][_0xc06b('0x47')]));_0x361207['attributes']=_0x361207['attributes'][_0xc06b('0x48')]?_0x361207['attributes']:_0x4d6c69[_0xc06b('0x49')];if(!_0x242bd2[_0xc06b('0x43')][_0xc06b('0x4a')](_0xc06b('0x4b'))){_0x361207[_0xc06b('0x2d')]=qs[_0xc06b('0x2d')](_0x242bd2[_0xc06b('0x43')][_0xc06b('0x2d')]);_0x361207['offset']=qs[_0xc06b('0x2b')](_0x242bd2['query']['offset']);}_0x361207['order']=qs['sort'](_0x242bd2[_0xc06b('0x43')][_0xc06b('0x4c')]);_0x361207[_0xc06b('0x4d')]=qs[_0xc06b('0x44')](_['pick'](_0x242bd2['query'],_0x4d6c69[_0xc06b('0x44')]),_0x2cc250);if(_0x242bd2['query'][_0xc06b('0x4e')]){_0x361207[_0xc06b('0x4d')]=_[_0xc06b('0x4f')](_0x361207['where'],{'$or':_[_0xc06b('0x3e')](_0x2cc250,function(_0x51743f){if(_0x51743f[_0xc06b('0x41')]!==_0xc06b('0x50')){var _0x23b77f={};_0x23b77f[_0x51743f[_0xc06b('0x3a')]]={'$like':'%'+_0x242bd2[_0xc06b('0x43')]['filter']+'%'};return _0x23b77f;}})});}_0x361207=_[_0xc06b('0x4f')]({},_0x361207,_0x242bd2[_0xc06b('0x51')]);var _0x17ba0e={'where':_0x361207[_0xc06b('0x4d')]};return db['SmsAccount']['count'](_0x17ba0e)[_0xc06b('0x1e')](function(_0x2a102d){_0x38d6e6[_0xc06b('0x2e')]=_0x2a102d;if(_0x242bd2['query'][_0xc06b('0x52')]){_0x361207[_0xc06b('0x53')]=[{'all':!![]}];}return db[_0xc06b('0x3f')]['findAll'](_0x361207);})[_0xc06b('0x1e')](function(_0x28b65c){_0x38d6e6[_0xc06b('0x54')]=_0x28b65c;return _0x38d6e6;})[_0xc06b('0x1e')](respondWithFilteredResult(_0x1eb57e,_0x361207))[_0xc06b('0x27')](handleError(_0x1eb57e,null));};exports['show']=function(_0x4f6471,_0x378704){var _0x3cea46={'raw':![],'where':{'id':_0x4f6471[_0xc06b('0x55')]['id']},'include':[{'model':db[_0xc06b('0x3c')],'as':_0xc06b('0x3d')}]},_0x556e25={};_0x556e25[_0xc06b('0x49')]=_['keys'](db[_0xc06b('0x3f')][_0xc06b('0x56')]);_0x556e25[_0xc06b('0x43')]=_[_0xc06b('0x57')](_0x4f6471[_0xc06b('0x43')]);_0x556e25[_0xc06b('0x44')]=_[_0xc06b('0x45')](_0x556e25['model'],_0x556e25[_0xc06b('0x43')]);_0x3cea46['attributes']=_[_0xc06b('0x45')](_0x556e25[_0xc06b('0x49')],qs['fields'](_0x4f6471[_0xc06b('0x43')][_0xc06b('0x47')]));_0x3cea46[_0xc06b('0x46')]=_0x3cea46[_0xc06b('0x46')][_0xc06b('0x48')]?_0x3cea46[_0xc06b('0x46')]:_0x556e25[_0xc06b('0x49')];if(_0x4f6471['query'][_0xc06b('0x52')]){_0x3cea46[_0xc06b('0x53')]=[{'all':!![]}];}_0x3cea46=_['merge']({},_0x3cea46,_0x4f6471[_0xc06b('0x51')]);return db[_0xc06b('0x3f')][_0xc06b('0x58')](_0x3cea46)[_0xc06b('0x1e')](handleEntityNotFound(_0x378704,null))['then'](respondWithResult(_0x378704,null))['catch'](handleError(_0x378704,null));};exports[_0xc06b('0x59')]=function(_0x1caa5f,_0x431f1c){return db[_0xc06b('0x3f')][_0xc06b('0x59')](_0x1caa5f[_0xc06b('0x5a')],{})['then'](function(_0x15e178){var _0x189c89=_0x1caa5f[_0xc06b('0x5b')]['get']({'plain':!![]});if(!_0x189c89)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x189c89[_0xc06b('0x5c')]===_0xc06b('0x5b')){var _0x2f4bf5=_0x15e178['get']({'plain':!![]});var _0x5609cd='SmsAccounts';return db[_0xc06b('0x5d')][_0xc06b('0x58')]({'where':{'name':_0x5609cd,'userProfileId':_0x189c89[_0xc06b('0x5e')]},'raw':!![]})['then'](function(_0x4968df){if(_0x4968df&&_0x4968df['autoAssociation']===0x0){return db[_0xc06b('0x38')][_0xc06b('0x59')]({'name':_0x2f4bf5[_0xc06b('0x3a')],'resourceId':_0x2f4bf5['id'],'type':_0x4968df[_0xc06b('0x3a')],'sectionId':_0x4968df['id']},{})[_0xc06b('0x1e')](function(){return _0x15e178;});}else{return _0x15e178;}})[_0xc06b('0x27')](function(_0x471f91){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x471f91);throw _0x471f91;});}return _0x15e178;})[_0xc06b('0x1e')](respondWithResult(_0x431f1c,0xc9))[_0xc06b('0x27')](handleError(_0x431f1c,null));};exports[_0xc06b('0x34')]=function(_0x361611,_0x452df1){if(_0x361611['body']['id']){delete _0x361611[_0xc06b('0x5a')]['id'];}return db[_0xc06b('0x3f')]['find']({'where':{'id':_0x361611[_0xc06b('0x55')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0xc06b('0x1e')](handleEntityNotFound(_0x452df1,null))[_0xc06b('0x1e')](saveUpdates(_0x361611['body'],null))['then'](respondWithResult(_0x452df1,null))['catch'](handleError(_0x452df1,null));};exports['destroy']=function(_0x52b8d2,_0x112a8d){return db[_0xc06b('0x3f')]['find']({'where':{'id':_0x52b8d2[_0xc06b('0x55')]['id']}})[_0xc06b('0x1e')](handleEntityNotFound(_0x112a8d,null))[_0xc06b('0x1e')](removeEntity(_0x112a8d,null))[_0xc06b('0x27')](handleError(_0x112a8d,null));};exports[_0xc06b('0x5f')]=function(_0x27fff8,_0xa8c554){return db[_0xc06b('0x3f')][_0xc06b('0x5f')]()[_0xc06b('0x1e')](respondWithResult(_0xa8c554,null))[_0xc06b('0x27')](handleError(_0xa8c554,null));};exports[_0xc06b('0x60')]=function(_0x5c3145,_0x170a55,_0x2c59c5){if(_0x5c3145['body']['id']){delete _0x5c3145[_0xc06b('0x5a')]['id'];}return db[_0xc06b('0x3f')][_0xc06b('0x58')]({'where':{'id':_0x5c3145[_0xc06b('0x55')]['id']}})[_0xc06b('0x1e')](handleEntityNotFound(_0x170a55,null))[_0xc06b('0x1e')](function(_0x366b94){if(_0x366b94){_0x5c3145['body']['SmsAccountId']=_0x366b94['id'];return db['Disposition'][_0xc06b('0x59')](_0x5c3145[_0xc06b('0x5a')]);}})[_0xc06b('0x1e')](respondWithResult(_0x170a55,null))[_0xc06b('0x27')](handleError(_0x170a55,null));};exports[_0xc06b('0x61')]=function(_0x3a26ae,_0x44888d,_0x28c257){var _0x2b9290={'raw':![],'where':{}};var _0x3b296e={};var _0x27ceb2={'count':0x0,'rows':[]};return db[_0xc06b('0x3f')][_0xc06b('0x62')]({'where':{'id':_0x3a26ae[_0xc06b('0x55')]['id']}})[_0xc06b('0x1e')](handleEntityNotFound(_0x44888d,null))[_0xc06b('0x1e')](function(_0x15e6d4){if(_0x15e6d4){_0x3b296e['model']=_[_0xc06b('0x57')](db[_0xc06b('0x63')][_0xc06b('0x56')]);_0x3b296e[_0xc06b('0x43')]=_['keys'](_0x3a26ae[_0xc06b('0x43')]);_0x3b296e[_0xc06b('0x44')]=_[_0xc06b('0x45')](_0x3b296e['model'],_0x3b296e[_0xc06b('0x43')]);_0x2b9290[_0xc06b('0x46')]=_['intersection'](_0x3b296e[_0xc06b('0x49')],qs[_0xc06b('0x47')](_0x3a26ae['query']['fields']));_0x2b9290['attributes']=_0x2b9290['attributes'][_0xc06b('0x48')]?_0x2b9290[_0xc06b('0x46')]:_0x3b296e['model'];if(!_0x3a26ae[_0xc06b('0x43')][_0xc06b('0x4a')](_0xc06b('0x4b'))){_0x2b9290[_0xc06b('0x2d')]=qs[_0xc06b('0x2d')](_0x3a26ae[_0xc06b('0x43')][_0xc06b('0x2d')]);_0x2b9290[_0xc06b('0x2b')]=qs[_0xc06b('0x2b')](_0x3a26ae[_0xc06b('0x43')]['offset']);}_0x2b9290[_0xc06b('0x64')]=qs[_0xc06b('0x4c')](_0x3a26ae['query'][_0xc06b('0x4c')]);_0x2b9290[_0xc06b('0x4d')]=qs['filters'](_['pick'](_0x3a26ae['query'],_0x3b296e['filters']));_0x2b9290[_0xc06b('0x4d')][_0xc06b('0x65')]=_0x15e6d4['id'];if(_0x3a26ae[_0xc06b('0x43')][_0xc06b('0x4e')]){_0x2b9290[_0xc06b('0x4d')]=_[_0xc06b('0x4f')](_0x2b9290[_0xc06b('0x4d')],{'$or':_['map'](_0x2b9290[_0xc06b('0x46')],function(_0x102dfb){var _0x286c8b={};_0x286c8b[_0x102dfb]={'$like':'%'+_0x3a26ae[_0xc06b('0x43')][_0xc06b('0x4e')]+'%'};return _0x286c8b;})});}_0x2b9290=_['merge']({},_0x2b9290,_0x3a26ae[_0xc06b('0x51')]);return db['Disposition']['count']({'where':_0x2b9290[_0xc06b('0x4d')]})[_0xc06b('0x1e')](function(_0x237e90){_0x27ceb2[_0xc06b('0x2e')]=_0x237e90;if(_0x3a26ae[_0xc06b('0x43')][_0xc06b('0x52')]){_0x2b9290[_0xc06b('0x53')]=[{'all':!![]}];}return db[_0xc06b('0x63')][_0xc06b('0x66')](_0x2b9290);})[_0xc06b('0x1e')](function(_0x722425){_0x27ceb2['rows']=_0x722425;return _0x27ceb2;});}})[_0xc06b('0x1e')](respondWithFilteredResult(_0x44888d,_0x2b9290))[_0xc06b('0x27')](handleError(_0x44888d,null));};exports[_0xc06b('0x67')]=function(_0x4969de,_0x19a7ff,_0x56ae16){return db[_0xc06b('0x3f')][_0xc06b('0x58')]({'where':{'id':_0x4969de[_0xc06b('0x55')]['id']}})[_0xc06b('0x1e')](handleEntityNotFound(_0x19a7ff,null))['then'](function(_0xfb2631){if(_0xfb2631){return _0xfb2631[_0xc06b('0x67')](_0x4969de[_0xc06b('0x43')][_0xc06b('0x68')]);}})[_0xc06b('0x1e')](respondWithStatusCode(_0x19a7ff,null))[_0xc06b('0x27')](handleError(_0x19a7ff,null));};exports[_0xc06b('0x69')]=function(_0x1d8cdb,_0x313a72,_0x26fdd1){if(_0x1d8cdb['body']['id']){delete _0x1d8cdb[_0xc06b('0x5a')]['id'];}return db[_0xc06b('0x3f')][_0xc06b('0x58')]({'where':{'id':_0x1d8cdb['params']['id']}})[_0xc06b('0x1e')](handleEntityNotFound(_0x313a72,null))[_0xc06b('0x1e')](function(_0x27b415){if(_0x27b415){_0x1d8cdb[_0xc06b('0x5a')][_0xc06b('0x65')]=_0x27b415['id'];return db[_0xc06b('0x6a')][_0xc06b('0x59')](_0x1d8cdb[_0xc06b('0x5a')]);}})[_0xc06b('0x1e')](respondWithResult(_0x313a72,null))['catch'](handleError(_0x313a72,null));};exports['getAnswers']=function(_0x13dae5,_0x3f98b5,_0x4a747c){var _0x3041e9={'raw':![],'where':{}};var _0x34a63c={};var _0x5b5e8f={'count':0x0,'rows':[]};return db[_0xc06b('0x3f')][_0xc06b('0x62')]({'where':{'id':_0x13dae5[_0xc06b('0x55')]['id']}})[_0xc06b('0x1e')](handleEntityNotFound(_0x3f98b5,null))[_0xc06b('0x1e')](function(_0x574330){if(_0x574330){_0x34a63c['model']=_['keys'](db['CannedAnswer'][_0xc06b('0x56')]);_0x34a63c[_0xc06b('0x43')]=_['keys'](_0x13dae5[_0xc06b('0x43')]);_0x34a63c[_0xc06b('0x44')]=_[_0xc06b('0x45')](_0x34a63c[_0xc06b('0x49')],_0x34a63c[_0xc06b('0x43')]);_0x3041e9[_0xc06b('0x46')]=_['intersection'](_0x34a63c['model'],qs[_0xc06b('0x47')](_0x13dae5[_0xc06b('0x43')][_0xc06b('0x47')]));_0x3041e9['attributes']=_0x3041e9[_0xc06b('0x46')][_0xc06b('0x48')]?_0x3041e9[_0xc06b('0x46')]:_0x34a63c[_0xc06b('0x49')];if(!_0x13dae5[_0xc06b('0x43')]['hasOwnProperty'](_0xc06b('0x4b'))){_0x3041e9[_0xc06b('0x2d')]=qs[_0xc06b('0x2d')](_0x13dae5[_0xc06b('0x43')][_0xc06b('0x2d')]);_0x3041e9[_0xc06b('0x2b')]=qs[_0xc06b('0x2b')](_0x13dae5[_0xc06b('0x43')]['offset']);}_0x3041e9[_0xc06b('0x64')]=qs['sort'](_0x13dae5[_0xc06b('0x43')][_0xc06b('0x4c')]);_0x3041e9['where']=qs[_0xc06b('0x44')](_[_0xc06b('0x6b')](_0x13dae5[_0xc06b('0x43')],_0x34a63c[_0xc06b('0x44')]));_0x3041e9[_0xc06b('0x4d')][_0xc06b('0x65')]=_0x574330['id'];if(_0x13dae5['query'][_0xc06b('0x4e')]){_0x3041e9[_0xc06b('0x4d')]=_[_0xc06b('0x4f')](_0x3041e9['where'],{'$or':_[_0xc06b('0x3e')](_0x3041e9[_0xc06b('0x46')],function(_0x41dfe1){var _0x522fc3={};_0x522fc3[_0x41dfe1]={'$like':'%'+_0x13dae5['query'][_0xc06b('0x4e')]+'%'};return _0x522fc3;})});}_0x3041e9=_[_0xc06b('0x4f')]({},_0x3041e9,_0x13dae5['options']);return db[_0xc06b('0x6a')][_0xc06b('0x2e')]({'where':_0x3041e9[_0xc06b('0x4d')]})[_0xc06b('0x1e')](function(_0x59dc79){_0x5b5e8f[_0xc06b('0x2e')]=_0x59dc79;if(_0x13dae5[_0xc06b('0x43')][_0xc06b('0x52')]){_0x3041e9[_0xc06b('0x53')]=[{'all':!![]}];}return db[_0xc06b('0x6a')][_0xc06b('0x66')](_0x3041e9);})[_0xc06b('0x1e')](function(_0x3f7866){_0x5b5e8f[_0xc06b('0x54')]=_0x3f7866;return _0x5b5e8f;});}})[_0xc06b('0x1e')](respondWithFilteredResult(_0x3f98b5,_0x3041e9))['catch'](handleError(_0x3f98b5,null));};exports[_0xc06b('0x6c')]=function(_0x31a58c,_0x44c518,_0x4844f8){return db[_0xc06b('0x3f')][_0xc06b('0x58')]({'where':{'id':_0x31a58c[_0xc06b('0x55')]['id']}})[_0xc06b('0x1e')](handleEntityNotFound(_0x44c518,null))[_0xc06b('0x1e')](function(_0x3b3c03){if(_0x3b3c03){return _0x3b3c03[_0xc06b('0x6c')](_0x31a58c[_0xc06b('0x43')][_0xc06b('0x68')]);}})['then'](respondWithStatusCode(_0x44c518,null))[_0xc06b('0x27')](handleError(_0x44c518,null));};exports[_0xc06b('0x6d')]=function(_0x56d163,_0x54e944,_0x663ca4){var _0xffe21c={'channel':_0xc06b('0x6e')};var _0x34d60b=[];var _0x39f530=[];var _0x1fed96={};return db['SmsAccount'][_0xc06b('0x58')]({'where':{'id':_0x56d163[_0xc06b('0x55')]['id']},'include':[{'model':db[_0xc06b('0x6f')],'as':_0xc06b('0x70')}]})[_0xc06b('0x1e')](handleEntityNotFound(_0x54e944,null))[_0xc06b('0x1e')](function(_0x498d0d){_0xffe21c['account']=_0x498d0d;_0xffe21c[_0xc06b('0x71')]=_[_0xc06b('0x72')](_0x498d0d['Applications'],[_0xc06b('0x73')],['asc']);if(_0xffe21c[_0xc06b('0x74')][_0xc06b('0x70')]){delete _0xffe21c[_0xc06b('0x74')]['Applications'];}return db[_0xc06b('0x75')][_0xc06b('0x5f')]();})[_0xc06b('0x1e')](function(_0x4e0f0f){if(!_0x4e0f0f){throw new db['Sequelize']['ValidationError'](_0xc06b('0x76'));}_0x34d60b=_[_0xc06b('0x77')](_['keys'](_0x4e0f0f),['createdAt',_0xc06b('0x78')]);_0x39f530=_[_0xc06b('0x77')](_[_0xc06b('0x57')](_0x4e0f0f),[_0xc06b('0x79'),_0xc06b('0x78'),_0xc06b('0x7a'),'ListId']);_0xffe21c[_0xc06b('0x5a')]={'mapKey':'mobile'};if(_0xffe21c[_0xc06b('0x74')][_0xc06b('0x41')]){switch(_0xffe21c[_0xc06b('0x74')][_0xc06b('0x41')]){case _0xc06b('0x7b'):_0xffe21c[_0xc06b('0x5a')]['from']=_0x56d163[_0xc06b('0x5a')][_0xc06b('0x7c')];_0xffe21c[_0xc06b('0x5a')][_0xc06b('0x5a')]=_0x56d163[_0xc06b('0x5a')][_0xc06b('0x7d')];_0xffe21c[_0xc06b('0x5a')]['messageId']=_0x56d163[_0xc06b('0x5a')]['MessageSid'];break;case _0xc06b('0x7e'):_0xffe21c[_0xc06b('0x5a')][_0xc06b('0x7f')]='+'+_0x56d163[_0xc06b('0x5a')][_0xc06b('0x80')];_0xffe21c[_0xc06b('0x5a')][_0xc06b('0x5a')]=_0x56d163[_0xc06b('0x5a')]['text'];break;case _0xc06b('0x81'):_0xffe21c[_0xc06b('0x5a')]['from']=_0x56d163[_0xc06b('0x5a')][_0xc06b('0x7f')];_0xffe21c[_0xc06b('0x5a')][_0xc06b('0x5a')]=_0x56d163[_0xc06b('0x5a')][_0xc06b('0x25')];break;case _0xc06b('0x82'):_0xffe21c[_0xc06b('0x5a')]['from']=_0x56d163['body'][_0xc06b('0x7f')];_0xffe21c[_0xc06b('0x5a')]['body']=_0x56d163['body']['body'];_0xffe21c['body']['messageId']=_0x56d163[_0xc06b('0x5a')]['message_id'];break;case _0xc06b('0x83'):_0xffe21c['body']['from']=_0x56d163[_0xc06b('0x5a')][_0xc06b('0x7c')];_0xffe21c['body'][_0xc06b('0x5a')]=_0x56d163['body'][_0xc06b('0x84')];_0xffe21c['body'][_0xc06b('0x85')]=_0x56d163['body'][_0xc06b('0x86')];break;case _0xc06b('0x87'):_0xffe21c[_0xc06b('0x5a')][_0xc06b('0x7f')]='+'+_0x56d163[_0xc06b('0x5a')][_0xc06b('0x88')][0x0][_0xc06b('0x7f')];_0xffe21c[_0xc06b('0x5a')][_0xc06b('0x5a')]=_0x56d163[_0xc06b('0x5a')]['results'][0x0]['text'];_0xffe21c[_0xc06b('0x5a')]['messageId']=_0x56d163['body']['results'][0x0][_0xc06b('0x85')];break;case _0xc06b('0x89'):_0xffe21c['body']['from']=_0x56d163[_0xc06b('0x5a')][_0xc06b('0x8a')];_0xffe21c[_0xc06b('0x5a')][_0xc06b('0x5a')]=_0x56d163[_0xc06b('0x5a')][_0xc06b('0x8b')][_0xc06b('0x25')];break;case'clickatell':_0xffe21c[_0xc06b('0x5a')]['from']=_0x56d163[_0xc06b('0x5a')]['fromNumber'];_0xffe21c[_0xc06b('0x5a')][_0xc06b('0x5a')]=_0x56d163[_0xc06b('0x5a')]['text'];_0xffe21c[_0xc06b('0x5a')]['messageId']=_0x56d163[_0xc06b('0x5a')][_0xc06b('0x8c')];break;case'bandwidth':_0xffe21c['body'][_0xc06b('0x85')]=_0x56d163[_0xc06b('0x5a')][0x0][_0xc06b('0x25')]['id'];_0xffe21c[_0xc06b('0x5a')][_0xc06b('0x7f')]=_0x56d163[_0xc06b('0x5a')][0x0][_0xc06b('0x25')][_0xc06b('0x7f')];_0xffe21c[_0xc06b('0x5a')][_0xc06b('0x5a')]=_0x56d163['body'][0x0][_0xc06b('0x25')][_0xc06b('0x8d')];break;case _0xc06b('0x8e'):_0xffe21c[_0xc06b('0x5a')][_0xc06b('0x7f')]=_0x56d163[_0xc06b('0x5a')][_0xc06b('0x7f')];_0xffe21c[_0xc06b('0x5a')]['body']=_0x56d163['body']['message'];_0xffe21c[_0xc06b('0x5a')]['messageId']=_0x56d163[_0xc06b('0x5a')][_0xc06b('0x8f')];break;}}if(_0xffe21c[_0xc06b('0x5a')]['id']){delete _0xffe21c[_0xc06b('0x5a')]['id'];}if(_[_0xc06b('0x90')](_0xffe21c[_0xc06b('0x5a')][_0xc06b('0x7f')])){throw new db[(_0xc06b('0x91'))][(_0xc06b('0x92'))](_0xc06b('0x93'));}if(_['isNil'](_0xffe21c[_0xc06b('0x5a')][_0xc06b('0x5a')])||_0xffe21c[_0xc06b('0x5a')]['body']===''){throw new db['Sequelize'][(_0xc06b('0x92'))](_0xc06b('0x94'));}if(_[_0xc06b('0x90')](_0xffe21c[_0xc06b('0x5a')][_0xc06b('0x95')])){throw new db[(_0xc06b('0x91'))]['ValidationError'](_0xc06b('0x96')+_0x39f530);}if(!_['includes'](_0x39f530,_0xffe21c['body'][_0xc06b('0x95')])){throw new db[(_0xc06b('0x91'))][(_0xc06b('0x92'))](_0xc06b('0x97')+_0x39f530);}_0x1fed96[_0xffe21c[_0xc06b('0x5a')][_0xc06b('0x95')]]=_0xffe21c[_0xc06b('0x5a')]['from'];return db[_0xc06b('0x98')]['find']({'where':{'id':_0xffe21c['account']['ListId']},'include':[{'model':db[_0xc06b('0x75')],'as':'Contacts','where':_0x1fed96,'limit':0x1,'order':[['updatedAt',_0xc06b('0x99')]]}]});})[_0xc06b('0x1e')](handleEntityNotFound(_0x54e944,null))[_0xc06b('0x1e')](function(_0x15d34d){if(_0x15d34d){_0xffe21c[_0xc06b('0x9a')]=_[_0xc06b('0x9b')](_0x15d34d,[_0xc06b('0x9c')]);if(_0x15d34d[_0xc06b('0x9c')][_0xc06b('0x48')]){return _0x15d34d[_0xc06b('0x9c')][0x0];}var _0x412583=_[_0xc06b('0x9d')](_0xffe21c[_0xc06b('0x5a')],{'firstName':_0xffe21c[_0xc06b('0x5a')][_0xc06b('0x7f')],'ListId':_0x15d34d['id']});_0x412583[_0xffe21c[_0xc06b('0x5a')][_0xc06b('0x95')]]=_0xffe21c[_0xc06b('0x5a')][_0xc06b('0x7f')];return db[_0xc06b('0x75')][_0xc06b('0x59')](_0x412583,{'fields':_0x34d60b,'raw':!![]});}})[_0xc06b('0x1e')](handleEntityNotFound(_0x54e944,null))['then'](function(_0x13c756){if(_0x13c756){_0xffe21c[_0xc06b('0x9e')]=_0x13c756;var _0x3373a8={'ContactId':_0x13c756['id'],'phone':_0xffe21c[_0xc06b('0x5a')][_0xc06b('0x7f')],'SmsAccountId':_0x56d163[_0xc06b('0x55')]['id']};var _0x1b6e0c={'ContactId':_0x13c756['id'],'SmsAccountId':_0x56d163[_0xc06b('0x55')]['id'],'closed':![]};return db[_0xc06b('0x9f')]['find']({'where':_0x1b6e0c})[_0xc06b('0x1e')](function(_0x36718e){if(_0x36718e){return[_0x36718e,![]];}return db[_0xc06b('0x9f')]['create'](_0x3373a8)['then'](function(_0x216720){return[_0x216720,!![]];});});}})[_0xc06b('0xa0')](function(_0x44bccb,_0x468a44){_0xffe21c[_0xc06b('0xa1')]=_0x44bccb[_0xc06b('0x36')]({'plain':!![]});_0xffe21c[_0xc06b('0xa1')][_0xc06b('0xa2')]=![];if(_0x468a44){if(_0xffe21c['account'][_0xc06b('0xa3')]){_0xffe21c[_0xc06b('0x71')][_0xc06b('0xa4')]({'id':0x0,'priority':_0xffe21c[_0xc06b('0x71')][_0xc06b('0x48')]+0x1,'app':_0xc06b('0xa5'),'appdata':_0xc06b('0xa6'),'interval':_0xc06b('0xa7')});}_0xffe21c['interaction'][_0xc06b('0xa2')]=!![];}return db[_0xc06b('0xa8')][_0xc06b('0x59')]({'phone':_0xffe21c[_0xc06b('0x5a')][_0xc06b('0x7f')],'messageId':_0xffe21c[_0xc06b('0x5a')][_0xc06b('0x85')],'body':_0xffe21c[_0xc06b('0x5a')][_0xc06b('0x5a')],'SmsAccountId':_0x56d163[_0xc06b('0x55')]['id'],'SmsInteractionId':_0x44bccb['id'],'direction':'in','ContactId':_0x44bccb[_0xc06b('0xa9')],'AttachmentId':_0xffe21c['body'][_0xc06b('0xaa')]});})['then'](function(_0x12d359){_0xffe21c[_0xc06b('0x25')]=_0x12d359;if(_0xffe21c[_0xc06b('0xa1')][_0xc06b('0xab')]){return db[_0xc06b('0xac')][_0xc06b('0x58')]({'attributes':['id',_0xc06b('0x3a')],'where':{'id':_0xffe21c[_0xc06b('0xa1')][_0xc06b('0xab')]}})['then'](function(_0x4d5789){if(_0x4d5789){_0xffe21c[_0xc06b('0x71')][_0xc06b('0xad')]({'id':0x0,'priority':0x0,'app':_0xc06b('0xae'),'appdata':_0x4d5789[_0xc06b('0x3a')]+','+(_0xffe21c[_0xc06b('0x74')][_0xc06b('0xaf')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xc06b('0xb0'),_0xc06b('0xb1'),_0xffe21c);});}return respondWithRpcPromise(_0xc06b('0xb0'),_0xc06b('0xb1'),_0xffe21c);})[_0xc06b('0x1e')](function(_0x292de4){if(_0x292de4){var _0x86c840=0xc8;var _0x4c5183=_0xc06b('0xb2');logger[_0xc06b('0x1f')](_0xc06b('0x22'),_0x4c5183,_0x86c840,'entity\x20found');logger[_0xc06b('0xb3')](_0xc06b('0xb4'),_0x4c5183,_0x86c840,_0xc06b('0xb5'),JSON['stringify'](_0x292de4));if(_0xffe21c['account']['type']===_0xc06b('0x7b')){return _0x54e944[_0xc06b('0x2a')](_0x86c840)[_0xc06b('0x2f')](_0xc06b('0xb6'),_0xc06b('0xb7'))[_0xc06b('0xb8')](_0xc06b('0xb9'));}else{return _0x54e944[_0xc06b('0x2a')](_0x86c840)[_0xc06b('0xba')](_0x292de4);}}})[_0xc06b('0x27')](handleError(_0x54e944,null));};exports[_0xc06b('0xbb')]=function(_0x5edf89,_0x3902ce){var _0x35231a=_0x5edf89[_0xc06b('0x55')]['id'];var _0x31e102=_0x5edf89[_0xc06b('0x5a')];var _0x3e0c36=0xc8;var _0x790393=null;return db['sequelize'][_0xc06b('0xbc')]({'isolationLevel':db[_0xc06b('0xbd')]['Transaction']['ISOLATION_LEVELS'][_0xc06b('0xbe')]},function(_0x4d738d){return db[_0xc06b('0x3f')][_0xc06b('0x62')]({'where':{'id':_0x35231a},'transaction':_0x4d738d})[_0xc06b('0x1e')](function(_0x5b2100){if(_0x5b2100){return db[_0xc06b('0x6f')][_0xc06b('0x35')]({'where':{'SmsAccountId':_0x35231a},'transaction':_0x4d738d})[_0xc06b('0x1e')](function(){var _0x1eec08=_[_0xc06b('0x3e')](_0x31e102,function(_0x21651a){_0x21651a[_0xc06b('0x65')]=_0x35231a;return _0x21651a;});return db[_0xc06b('0x6f')][_0xc06b('0xbf')](_0x1eec08,{'transaction':_0x4d738d});});}else{_0x3e0c36=0x194;_0x790393=[];}});})[_0xc06b('0x1e')](function(){if(_0x3e0c36!==0x194){return db[_0xc06b('0x6f')][_0xc06b('0xc0')]({'where':{'SmsAccountId':_0x35231a},'order':_0xc06b('0x73')})[_0xc06b('0x1e')](function(_0x597d95){_0x790393=_0x597d95;});}})[_0xc06b('0x27')](function(_0x1ed56c){_0x3e0c36=0x1f4;logger['error'](_0x1ed56c[_0xc06b('0x39')]);if(_0x1ed56c[_0xc06b('0x3a')]){delete _0x1ed56c[_0xc06b('0x3a')];}_0x790393=_0x1ed56c;})[_0xc06b('0xc1')](function(){if(_0x790393===null){_0x3902ce[_0xc06b('0x28')](_0x3e0c36);}else{if(_0x3e0c36===0x1f4){_0x3902ce[_0xc06b('0x2a')](_0x3e0c36)[_0xc06b('0xb8')](_0x790393);}else{_0x3902ce[_0xc06b('0x2a')](_0x3e0c36)[_0xc06b('0xba')](_0x790393);}}});};exports[_0xc06b('0xc2')]=function(_0x26b88d,_0x232f0d,_0x580588){var _0x12ddcd={};var _0x491e96={};var _0xaa6966;var _0x10bf41;return db['SmsAccount'][_0xc06b('0x62')]({'where':{'id':_0x26b88d[_0xc06b('0x55')]['id']}})[_0xc06b('0x1e')](handleEntityNotFound(_0x232f0d,null))[_0xc06b('0x1e')](function(_0x556d4b){if(_0x556d4b){_0xaa6966=_0x556d4b;_0x491e96[_0xc06b('0x49')]=_[_0xc06b('0x57')](db['SmsApplication'][_0xc06b('0x56')]);_0x491e96[_0xc06b('0x43')]=_['keys'](_0x26b88d[_0xc06b('0x43')]);_0x491e96[_0xc06b('0x44')]=_[_0xc06b('0x45')](_0x491e96[_0xc06b('0x49')],_0x491e96[_0xc06b('0x43')]);_0x12ddcd[_0xc06b('0x46')]=_['intersection'](_0x491e96[_0xc06b('0x49')],qs[_0xc06b('0x47')](_0x26b88d[_0xc06b('0x43')][_0xc06b('0x47')]));_0x12ddcd[_0xc06b('0x46')]=_0x12ddcd['attributes'][_0xc06b('0x48')]?_0x12ddcd[_0xc06b('0x46')]:_0x491e96[_0xc06b('0x49')];_0x12ddcd['order']=qs[_0xc06b('0x4c')](_0x26b88d[_0xc06b('0x43')][_0xc06b('0x4c')]);_0x12ddcd[_0xc06b('0x4d')]=qs[_0xc06b('0x44')](_[_0xc06b('0x6b')](_0x26b88d[_0xc06b('0x43')],_0x491e96[_0xc06b('0x44')]));if(_0x26b88d[_0xc06b('0x43')][_0xc06b('0x4e')]){_0x12ddcd[_0xc06b('0x4d')]=_['merge'](_0x12ddcd[_0xc06b('0x4d')],{'$or':_[_0xc06b('0x3e')](_0x12ddcd[_0xc06b('0x46')],function(_0x424422){var _0x1ab4c9={};_0x1ab4c9[_0x424422]={'$like':'%'+_0x26b88d[_0xc06b('0x43')][_0xc06b('0x4e')]+'%'};return _0x1ab4c9;})});}_0x12ddcd=_['merge']({},_0x12ddcd,_0x26b88d[_0xc06b('0x51')]);return _0xaa6966[_0xc06b('0xc2')](_0x12ddcd);}})[_0xc06b('0x1e')](function(_0x3d773b){if(_0x3d773b){_0x10bf41=_0x3d773b[_0xc06b('0x48')];if(!_0x26b88d['query'][_0xc06b('0x4a')](_0xc06b('0x4b'))){_0x12ddcd[_0xc06b('0x2d')]=qs[_0xc06b('0x2d')](_0x26b88d[_0xc06b('0x43')][_0xc06b('0x2d')]);_0x12ddcd['offset']=qs[_0xc06b('0x2b')](_0x26b88d[_0xc06b('0x43')][_0xc06b('0x2b')]);}return _0xaa6966[_0xc06b('0xc2')](_0x12ddcd);}})[_0xc06b('0x1e')](function(_0x548cb6){if(_0x548cb6){return _0x548cb6?{'count':_0x10bf41,'rows':_0x548cb6}:null;}})['then'](respondWithResult(_0x232f0d,null))[_0xc06b('0x27')](handleError(_0x232f0d,null));};exports[_0xc06b('0xc3')]=function(_0x1b14cb,_0x39958f,_0x388fe7){var _0x46f3b8={'raw':![],'where':{}};var _0x27c5f8={};var _0x5e5ff1={'count':0x0,'rows':[]};return db[_0xc06b('0x3f')][_0xc06b('0x62')]({'where':{'id':_0x1b14cb[_0xc06b('0x55')]['id']}})[_0xc06b('0x1e')](handleEntityNotFound(_0x39958f,null))['then'](function(_0x34161a){if(_0x34161a){_0x27c5f8[_0xc06b('0x49')]=_[_0xc06b('0x57')](db['SmsInteraction'][_0xc06b('0x56')]);_0x27c5f8[_0xc06b('0x43')]=_[_0xc06b('0x57')](_0x1b14cb['query']);_0x27c5f8[_0xc06b('0x44')]=_[_0xc06b('0x45')](_0x27c5f8['model'],_0x27c5f8[_0xc06b('0x43')]);_0x46f3b8[_0xc06b('0x46')]=_[_0xc06b('0x45')](_0x27c5f8['model'],qs[_0xc06b('0x47')](_0x1b14cb['query']['fields']));_0x46f3b8[_0xc06b('0x46')]=_0x46f3b8[_0xc06b('0x46')][_0xc06b('0x48')]?_0x46f3b8[_0xc06b('0x46')]:_0x27c5f8['model'];if(!_0x1b14cb[_0xc06b('0x43')][_0xc06b('0x4a')](_0xc06b('0x4b'))){_0x46f3b8[_0xc06b('0x2d')]=qs[_0xc06b('0x2d')](_0x1b14cb[_0xc06b('0x43')][_0xc06b('0x2d')]);_0x46f3b8[_0xc06b('0x2b')]=qs[_0xc06b('0x2b')](_0x1b14cb[_0xc06b('0x43')][_0xc06b('0x2b')]);}_0x46f3b8[_0xc06b('0x64')]=qs['sort'](_0x1b14cb['query']['sort']);_0x46f3b8['where']=qs[_0xc06b('0x44')](_[_0xc06b('0x6b')](_0x1b14cb['query'],_0x27c5f8[_0xc06b('0x44')]));_0x46f3b8[_0xc06b('0x4d')][_0xc06b('0x65')]=_0x34161a['id'];if(_0x1b14cb[_0xc06b('0x43')][_0xc06b('0x4e')]){_0x46f3b8[_0xc06b('0x4d')]=_['merge'](_0x46f3b8[_0xc06b('0x4d')],{'$or':_[_0xc06b('0x3e')](_0x46f3b8[_0xc06b('0x46')],function(_0x623d59){var _0x42eb65={};_0x42eb65[_0x623d59]={'$like':'%'+_0x1b14cb[_0xc06b('0x43')][_0xc06b('0x4e')]+'%'};return _0x42eb65;})});}_0x46f3b8=_[_0xc06b('0x4f')]({},_0x46f3b8,_0x1b14cb['options']);return db[_0xc06b('0x9f')]['count']({'where':_0x46f3b8[_0xc06b('0x4d')]})['then'](function(_0x2ff41f){_0x5e5ff1[_0xc06b('0x2e')]=_0x2ff41f;if(_0x1b14cb[_0xc06b('0x43')][_0xc06b('0x52')]){_0x46f3b8[_0xc06b('0x53')]=[{'model':db[_0xc06b('0x75')],'as':_0xc06b('0xc4'),'required':![]},{'model':db['User'],'as':_0xc06b('0xc5'),'attributes':[_0xc06b('0x3a'),_0xc06b('0xc6'),'internal'],'required':![]},{'model':db[_0xc06b('0xc7')],'as':_0xc06b('0xc8'),'attributes':['id',_0xc06b('0x3a'),_0xc06b('0xc9')],'where':_0x1b14cb[_0xc06b('0x43')][_0xc06b('0xca')]?{'id':_0x1b14cb[_0xc06b('0x43')][_0xc06b('0xca')]}:undefined,'required':_0x1b14cb[_0xc06b('0x43')][_0xc06b('0xca')]?!![]:![]}];}return db['SmsInteraction'][_0xc06b('0x66')](_0x46f3b8);})[_0xc06b('0x1e')](function(_0xa3708d){_0x5e5ff1['rows']=_0xa3708d;return _0x5e5ff1;});}})['then'](respondWithFilteredResult(_0x39958f,_0x46f3b8))[_0xc06b('0x27')](handleError(_0x39958f,null));};exports[_0xc06b('0xb8')]=function(_0x21b8d0,_0x28315c,_0x4aa2a4){var _0x29ba5f,_0x4e237a,_0x7610ed;if(_[_0xc06b('0x90')](_0x21b8d0[_0xc06b('0x5a')][_0xc06b('0x5a')])||_0x21b8d0[_0xc06b('0x5a')]['body']===''){throw new db['Sequelize'][(_0xc06b('0x92'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xc06b('0x90')](_0x21b8d0[_0xc06b('0x5a')]['to'])){throw new db[(_0xc06b('0x91'))][(_0xc06b('0x92'))](_0xc06b('0xcb'));}_0x29ba5f=_0x21b8d0[_0xc06b('0x5a')]['to'];return db[_0xc06b('0x3f')][_0xc06b('0x58')]({'where':{'id':_0x21b8d0[_0xc06b('0x55')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xc06b('0x75')],'as':_0xc06b('0x9c'),'where':{'mobile':_0x29ba5f},'limit':0x1,'order':[[_0xc06b('0x78'),_0xc06b('0x99')]]}]}]})['then'](handleEntityNotFound(_0x28315c,null))[_0xc06b('0x1e')](function(_0x551b32){if(_0x551b32&&_0x551b32[_0xc06b('0xcc')]){_0x4e237a=_0x551b32[_0xc06b('0x36')]({'plain':!![]});if(_0x4e237a['List']&&_0x4e237a['List']['Contacts'][_0xc06b('0x48')]){return _0x4e237a[_0xc06b('0xcc')]['Contacts'][0x0];}return db[_0xc06b('0x75')][_0xc06b('0x59')](_['defaults'](_0x21b8d0['body'],{'firstName':_0x29ba5f,'mobile':_0x29ba5f,'phone':_0x29ba5f,'ListId':_0x4e237a[_0xc06b('0xcd')]}));}})[_0xc06b('0x1e')](handleEntityNotFound(_0x28315c,null))[_0xc06b('0x1e')](function(_0x5991c7){if(_0x5991c7){_0x7610ed=_0x5991c7;return db['SmsInteraction'][_0xc06b('0x58')]({'where':{'ContactId':_0x7610ed['id'],'closed':![],'SmsAccountId':_0x4e237a['id']}})[_0xc06b('0x1e')](function(_0x5462a5){if(_0x5462a5){return[_0x5462a5,![]];}return db[_0xc06b('0x9f')][_0xc06b('0x59')]({'UserId':_0x21b8d0['user']['id'],'ContactId':_0x7610ed['id'],'SmsAccountId':_0x4e237a['id'],'phone':_0x29ba5f,'firstMsgDirection':_0xc06b('0xce'),'Messages':[_[_0xc06b('0x4f')](_0x21b8d0[_0xc06b('0x5a')],{'read':![],'body':_0x21b8d0[_0xc06b('0x5a')][_0xc06b('0x5a')],'phone':_0x29ba5f,'SmsAccountId':_0x4e237a['id'],'UserId':_0x21b8d0[_0xc06b('0x5b')]['id'],'ContactId':_0x7610ed['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0xc06b('0xcf')}]})['then'](function(_0x277f35){return[_0x277f35,!![]];});});}})['spread'](function(_0x33cd17,_0x596887){if(_0x596887){return _0x33cd17;}return db[_0xc06b('0xa8')][_0xc06b('0x59')](_[_0xc06b('0x4f')](_0x21b8d0['body'],{'read':![],'body':_0x21b8d0[_0xc06b('0x5a')][_0xc06b('0x5a')],'phone':_0x29ba5f,'SmsAccountId':_0x4e237a['id'],'SmsInteractionId':_0x33cd17['id'],'UserId':_0x21b8d0[_0xc06b('0x5b')]['id'],'ContactId':_0x7610ed['id']}))['then'](function(_0x12ab9b){_0x33cd17[_0xc06b('0xd0')]['Messages']=[];_0x33cd17['dataValues'][_0xc06b('0xcf')][_0xc06b('0xa4')](_0x12ab9b[_0xc06b('0xd0')]);return _0x33cd17;});})['then'](respondWithResult(_0x28315c,null))[_0xc06b('0x27')](handleError(_0x28315c,null));};exports[_0xc06b('0x2a')]=function(_0x3a3543,_0x3ea2b3,_0x17ad18){if(_0x3a3543['body']['id']){delete _0x3a3543[_0xc06b('0x5a')]['id'];}var _0x5cd8d4,_0x4bead5,_0x2267cd;return db['SmsAccount']['find']({'where':{'id':_0x3a3543['params']['id']}})[_0xc06b('0x1e')](handleEntityNotFound(_0x3ea2b3,null))['then'](function(_0x56f258){if(_0x56f258){_0x2267cd=_0x56f258;logger['debug'](_0xc06b('0x22'),'status',_0xc06b('0xd1'),_0x56f258['type'],util[_0xc06b('0xd2')](_0x3a3543[_0xc06b('0x5a')],{'showHidden':![],'depth':null}));switch(_0x56f258[_0xc06b('0x41')]){case _0xc06b('0x7e'):if(_0x3a3543[_0xc06b('0x5a')][_0xc06b('0xd3')]&&_0x3a3543[_0xc06b('0x5a')][_0xc06b('0x2a')]){_0x4bead5=_0x3a3543[_0xc06b('0x5a')]['status'];return db[_0xc06b('0xa8')][_0xc06b('0x58')]({'where':{'messageId':_0x3a3543[_0xc06b('0x5a')]['skebby_dispatch_id']}});}break;case'connectel':if(_0x3a3543['body'][_0xc06b('0xd4')]&&_0x3a3543[_0xc06b('0x5a')][_0xc06b('0xd5')]){_0x4bead5=_0x3a3543[_0xc06b('0x5a')][_0xc06b('0xd5')];return db[_0xc06b('0xa8')][_0xc06b('0x58')]({'where':{'messageId':_0x3a3543[_0xc06b('0x5a')][_0xc06b('0xd4')]}});}break;case _0xc06b('0x82'):if(_0x3a3543[_0xc06b('0x5a')][_0xc06b('0xd6')]&&_0x3a3543[_0xc06b('0x5a')][_0xc06b('0xd7')]){_0x4bead5=_0x3a3543[_0xc06b('0x5a')][_0xc06b('0xd7')];return db[_0xc06b('0xa8')][_0xc06b('0x58')]({'where':{'messageId':_0x3a3543['body'][_0xc06b('0xd6')]}});}break;case _0xc06b('0x87'):var _0x7b2106=_0x3a3543[_0xc06b('0x5a')][_0xc06b('0x88')][0x0];if(_0x7b2106[_0xc06b('0x85')]&&_0x7b2106[_0xc06b('0x2a')][_0xc06b('0xd8')]===_0xc06b('0xd9')){_0x4bead5=_0x7b2106['status'][_0xc06b('0xd8')];return db[_0xc06b('0xa8')][_0xc06b('0x58')]({'where':{'messageId':_0x7b2106[_0xc06b('0x85')]}});}break;case'clickatell':if(_0x3a3543['body'][_0xc06b('0x85')]&&_0x3a3543[_0xc06b('0x5a')]['status']){_0x4bead5=_0x3a3543['body'][_0xc06b('0x2a')];return db[_0xc06b('0xa8')]['find']({'where':{'messageId':_0x3a3543[_0xc06b('0x5a')][_0xc06b('0x85')]}});}break;case'bandwidth':if(_0x3a3543[_0xc06b('0x5a')][0x0]['message']['id']){_0x4bead5=_0x3a3543[_0xc06b('0x5a')][0x0]['type'];return db[_0xc06b('0xa8')]['find']({'where':{'messageId':_0x3a3543[_0xc06b('0x5a')][0x0]['message']['id']}});}break;case'intelepeer':if(_0x3a3543[_0xc06b('0x5a')][_0xc06b('0xda')]&&_0x3a3543[_0xc06b('0x5a')][_0xc06b('0x2a')]){_0x4bead5=_0x3a3543[_0xc06b('0x5a')]['status'];return db[_0xc06b('0xa8')][_0xc06b('0x58')]({'where':{'messageId':_0x3a3543[_0xc06b('0x5a')]['redif']}});}break;}}})['then'](handleEntityNotFound(_0x3ea2b3,null))[_0xc06b('0x1e')](function(_0x3634e8){if(_0x3634e8){_0x5cd8d4=_0x3634e8;switch(_0x2267cd[_0xc06b('0x41')]){case _0xc06b('0x7e'):if(_0x4bead5===_0xc06b('0xd9')){return _0x5cd8d4['update']({'read':!![]});}else{logger[_0xc06b('0x23')](_0xc06b('0x22'),'status','skebby',util['inspect'](_0x3a3543[_0xc06b('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xc06b('0x81'):if(_0x4bead5==='1'){return _0x5cd8d4['update']({'read':!![]});}else{logger[_0xc06b('0x23')](_0xc06b('0x22'),_0xc06b('0x2a'),_0xc06b('0x7e'),util[_0xc06b('0xd2')](_0x3a3543[_0xc06b('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xc06b('0x82'):if(!_0x3a3543[_0xc06b('0x5a')][_0xc06b('0xdb')]&&_0x4bead5>=0xc8&&_0x4bead5<=0xce){return _0x5cd8d4[_0xc06b('0x34')]({'read':!![]});}else{logger[_0xc06b('0x23')](_0xc06b('0x22'),_0xc06b('0x2a'),_0xc06b('0x82'),util[_0xc06b('0xd2')](_0x3a3543[_0xc06b('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xc06b('0x87'):var _0x50cb9f=_0x3a3543[_0xc06b('0x5a')][_0xc06b('0x88')][0x0];if(_0x50cb9f[_0xc06b('0x2a')][_0xc06b('0xd8')]===_0xc06b('0xd9')){return _0x5cd8d4['update']({'read':!![]});}else{logger[_0xc06b('0x23')](_0xc06b('0x22'),_0xc06b('0x2a'),'infobip',util['inspect'](_0x3a3543[_0xc06b('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xc06b('0xdc'):if(_0x4bead5==_0xc06b('0xdd')||_0x4bead5==_0xc06b('0xde')){return _0x5cd8d4['update']({'read':!![]});}else{logger['error'](_0xc06b('0x22'),'status',_0xc06b('0xdc'),util[_0xc06b('0xd2')](_0x3a3543[_0xc06b('0x5a')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x4bead5==_0xc06b('0xdf')){return _0x5cd8d4['update']({'read':!![]});}else{logger[_0xc06b('0x23')](_0xc06b('0x22'),'status',_0xc06b('0xe0'),util[_0xc06b('0xd2')](_0x3a3543['body'],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x4bead5===_0xc06b('0xe1')||_0x4bead5==='ACCEPTD'){return _0x5cd8d4[_0xc06b('0x34')]({'read':!![]});}else{logger[_0xc06b('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xc06b('0x2a'),_0xc06b('0x8e'),util[_0xc06b('0xd2')](_0x3a3543[_0xc06b('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x5cd8d4;}})[_0xc06b('0x1e')](respondWithResult(_0x3ea2b3,null))['catch'](handleError(_0x3ea2b3,null));};exports['statusGet']=function(_0x329c0b,_0x996147,_0x30b36b){var _0x243640,_0x309393,_0x463ab2;return db[_0xc06b('0x3f')][_0xc06b('0x58')]({'where':{'id':_0x329c0b['params']['id']}})[_0xc06b('0x1e')](handleEntityNotFound(_0x996147,null))[_0xc06b('0x1e')](function(_0x31432e){if(_0x31432e){_0x463ab2=_0x31432e;logger[_0xc06b('0xb3')](_0xc06b('0x22'),_0xc06b('0x2a'),_0xc06b('0xd1'),_0x31432e[_0xc06b('0x41')],util['inspect'](_0x329c0b[_0xc06b('0x43')],{'showHidden':![],'depth':null}));switch(_0x31432e[_0xc06b('0x41')]){case _0xc06b('0x89'):if(_0x329c0b['query'][_0xc06b('0xe2')]&&_0x329c0b[_0xc06b('0x43')]['state']){_0x309393=_0x329c0b['query']['state'];return db['SmsMessage'][_0xc06b('0x58')]({'where':{'messageId':_0x329c0b['query'][_0xc06b('0xe2')]}});}break;}}})[_0xc06b('0x1e')](handleEntityNotFound(_0x996147,null))['then'](function(_0x57bff6){if(_0x57bff6){_0x243640=_0x57bff6;switch(_0x463ab2[_0xc06b('0x41')]){case'csc':if(_0x309393==='2'||_0x309393==='6'){return _0x243640[_0xc06b('0x34')]({'read':!![]});}else{logger['error'](_0xc06b('0x22'),_0xc06b('0x2a'),'csc',util[_0xc06b('0xd2')](_0x329c0b[_0xc06b('0x43')],{'showHidden':![],'depth':null}));};break;}return _0x243640;}})[_0xc06b('0x1e')](respondWithResult(_0x996147,null))[_0xc06b('0x27')](handleError(_0x996147,null));};exports[_0xc06b('0xe3')]=function(_0x59c0cf,_0x301a66,_0x164907){return db['SmsAccount']['find']({'where':{'id':_0x59c0cf[_0xc06b('0x55')]['id']}})[_0xc06b('0x1e')](handleEntityNotFound(_0x301a66,null))[_0xc06b('0x1e')](function(_0x50b2c4){if(_0x50b2c4){return _0x50b2c4['addAgents'](_0x59c0cf[_0xc06b('0x5a')]['ids'],_[_0xc06b('0x9b')](_0x59c0cf[_0xc06b('0x5a')],['ids','id'])||{})[_0xc06b('0xa0')](function(_0x86d7d){for(var _0x19910f=0x0;_0x19910f<_0x59c0cf[_0xc06b('0x5a')][_0xc06b('0x68')][_0xc06b('0x48')];_0x19910f+=0x1){socket[_0xc06b('0xe4')]('userSmsAccount:save',{'UserId':Number(_0x59c0cf['body']['ids'][_0x19910f]),'SmsAccountId':Number(_0x59c0cf[_0xc06b('0x55')]['id'])});}return _0x86d7d;});}})[_0xc06b('0x1e')](respondWithResult(_0x301a66,null))['catch'](handleError(_0x301a66,null));};exports['removeAgents']=function(_0x5b3d0a,_0x236683,_0x31a751){return db[_0xc06b('0x3f')][_0xc06b('0x58')]({'where':{'id':_0x5b3d0a[_0xc06b('0x55')]['id']}})['then'](handleEntityNotFound(_0x236683,null))['then'](function(_0x512681){if(_0x512681){return _0x512681['removeAgents'](_0x5b3d0a['query'][_0xc06b('0x68')])[_0xc06b('0x1e')](function(){if(_['isArray'](_0x5b3d0a[_0xc06b('0x43')][_0xc06b('0x68')])){for(var _0x12e1f3=0x0;_0x12e1f3<_0x5b3d0a[_0xc06b('0x43')]['ids'][_0xc06b('0x48')];_0x12e1f3+=0x1){socket[_0xc06b('0xe4')](_0xc06b('0xe5'),{'UserId':Number(_0x5b3d0a[_0xc06b('0x43')][_0xc06b('0x68')][_0x12e1f3]),'SmsAccountId':Number(_0x5b3d0a[_0xc06b('0x55')]['id'])});}}else{socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x5b3d0a[_0xc06b('0x43')][_0xc06b('0x68')]),'SmsAccountId':Number(_0x5b3d0a[_0xc06b('0x55')]['id'])});}});}})[_0xc06b('0x1e')](respondWithStatusCode(_0x236683,null))[_0xc06b('0x27')](handleError(_0x236683,null));};exports[_0xc06b('0xe6')]=function(_0xb49f07,_0x3716d2,_0x78ebaf){var _0x1ed84c={};var _0x1623d9={};var _0x14acfa;var _0xea1bb7;return db[_0xc06b('0x3f')][_0xc06b('0x62')]({'where':{'id':_0xb49f07[_0xc06b('0x55')]['id']}})['then'](handleEntityNotFound(_0x3716d2,null))[_0xc06b('0x1e')](function(_0x52360f){if(_0x52360f){_0x14acfa=_0x52360f;_0x1623d9[_0xc06b('0x49')]=_['keys'](db[_0xc06b('0xac')][_0xc06b('0x56')]);_0x1623d9[_0xc06b('0x43')]=_[_0xc06b('0x57')](_0xb49f07[_0xc06b('0x43')]);_0x1623d9['filters']=_[_0xc06b('0x45')](_0x1623d9[_0xc06b('0x49')],_0x1623d9[_0xc06b('0x43')]);_0x1ed84c['attributes']=_['intersection'](_0x1623d9[_0xc06b('0x49')],qs['fields'](_0xb49f07[_0xc06b('0x43')]['fields']));_0x1ed84c[_0xc06b('0x46')]=_0x1ed84c[_0xc06b('0x46')][_0xc06b('0x48')]?_0x1ed84c[_0xc06b('0x46')]:_0x1623d9[_0xc06b('0x49')];_0x1ed84c[_0xc06b('0x64')]=qs['sort'](_0xb49f07['query'][_0xc06b('0x4c')]);_0x1ed84c['where']=qs[_0xc06b('0x44')](_[_0xc06b('0x6b')](_0xb49f07[_0xc06b('0x43')],_0x1623d9[_0xc06b('0x44')]));if(_0xb49f07[_0xc06b('0x43')]['filter']){_0x1ed84c[_0xc06b('0x4d')]=_[_0xc06b('0x4f')](_0x1ed84c[_0xc06b('0x4d')],{'$or':_[_0xc06b('0x3e')](_0x1ed84c[_0xc06b('0x46')],function(_0x543d5d){var _0x176887={};_0x176887[_0x543d5d]={'$like':'%'+_0xb49f07[_0xc06b('0x43')][_0xc06b('0x4e')]+'%'};return _0x176887;})});}_0x1ed84c=_[_0xc06b('0x4f')]({},_0x1ed84c,_0xb49f07['options']);return _0x14acfa[_0xc06b('0xe6')](_0x1ed84c);}})[_0xc06b('0x1e')](function(_0x25654f){if(_0x25654f){_0xea1bb7=_0x25654f['length'];if(!_0xb49f07[_0xc06b('0x43')][_0xc06b('0x4a')](_0xc06b('0x4b'))){_0x1ed84c[_0xc06b('0x2d')]=qs['limit'](_0xb49f07[_0xc06b('0x43')][_0xc06b('0x2d')]);_0x1ed84c[_0xc06b('0x2b')]=qs[_0xc06b('0x2b')](_0xb49f07[_0xc06b('0x43')][_0xc06b('0x2b')]);}return _0x14acfa['getAgents'](_0x1ed84c);}})['then'](function(_0xc2ce7f){if(_0xc2ce7f){return _0xc2ce7f?{'count':_0xea1bb7,'rows':_0xc2ce7f}:null;}})[_0xc06b('0x1e')](respondWithResult(_0x3716d2,null))['catch'](handleError(_0x3716d2,null));}; \ No newline at end of file +var _0x98a6=['options','include','rows','show','params','length','includeAll','find','create','body','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Pause','destroy','describe','addDisposition','SmsAccountId','Disposition','findOne','order','findAll','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','twilio','from','From','Body','messageId','MessageSid','skebby','sender','clicksend','plivo','Text','MessageUUID','infobip','results','text','csc','segmentedMessage','clickatell','fromNumber','replyMessageId','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','DESC','list','omit','Contacts','contact','SmsInteraction','spread','interaction','autoclose','push','close','*,*,*,*','ContactId','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','sequelize','transaction','Transaction','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','Owner','fullname','Tag','color','tag','to\x20is\x20mandatory','CmList','List','user','out','SmsMessage','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','connectel','requestid','statusInt','message_id','DELIVERED','groupName','bandwidth','redif','message-delivered','ACCEPTD','statusGet','state','message-id','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','get','SmsAccounts','UserProfileResource','stack','name','send','mandatoryDispositionPause','SmsAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','merge','map','VIRTUAL','filter'];(function(_0x192db8,_0xe0a1ca){var _0x4160c8=function(_0x4eb975){while(--_0x4eb975){_0x192db8['push'](_0x192db8['shift']());}};_0x4160c8(++_0xe0a1ca);}(_0x98a6,0x93));var _0x698a=function(_0x6a0266,_0x1552d6){_0x6a0266=_0x6a0266-0x0;var _0x309e00=_0x98a6[_0x6a0266];return _0x309e00;};'use strict';var emlformat=require(_0x698a('0x0'));var rimraf=require(_0x698a('0x1'));var zipdir=require(_0x698a('0x2'));var jsonpatch=require(_0x698a('0x3'));var rp=require('request-promise');var moment=require(_0x698a('0x4'));var BPromise=require(_0x698a('0x5'));var Mustache=require(_0x698a('0x6'));var util=require(_0x698a('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x698a('0x8'));var fs=require('fs');var fs_extra=require(_0x698a('0x9'));var _=require(_0x698a('0xa'));var squel=require('squel');var crypto=require(_0x698a('0xb'));var jsforce=require(_0x698a('0xc'));var deskjs=require(_0x698a('0xd'));var toCsv=require(_0x698a('0xe'));var querystring=require(_0x698a('0xf'));var Papa=require(_0x698a('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x698a('0x11'));var hardwareService=require(_0x698a('0x12'));var logger=require(_0x698a('0x13'))('api');var utils=require(_0x698a('0x14'));var config=require(_0x698a('0x15'));var licenseUtil=require(_0x698a('0x16'));var db=require(_0x698a('0x17'))['db'];config[_0x698a('0x18')]=_[_0x698a('0x19')](config[_0x698a('0x18')],{'host':_0x698a('0x1a'),'port':0x18eb});var socket=require(_0x698a('0x1b'))(new Redis(config[_0x698a('0x18')]));require('./smsAccount.socket')[_0x698a('0x1c')](socket);var jayson=require(_0x698a('0x1d'));var client=jayson['client'][_0x698a('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x2d8ef5,_0x5a4753,_0x353643,_0x5ca624){return new BPromise(function(_0x3a4e69,_0x191c84){var _0x335f6e=_0x5ca624||client;return _0x335f6e[_0x698a('0x1f')](_0x2d8ef5,_0x353643)[_0x698a('0x20')](function(_0x3f0c2e){logger[_0x698a('0x21')](_0x698a('0x22'),_0x5a4753,_0x698a('0x23'));logger[_0x698a('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5a4753,_0x698a('0x23'),JSON[_0x698a('0x25')](_0x3f0c2e));if(_0x3f0c2e[_0x698a('0x26')]){if(_0x3f0c2e[_0x698a('0x26')][_0x698a('0x27')]===0x1f4){logger['error'](_0x698a('0x22'),_0x5a4753,_0x3f0c2e[_0x698a('0x26')][_0x698a('0x28')]);return _0x191c84(_0x3f0c2e['error'][_0x698a('0x28')]);}logger[_0x698a('0x26')](_0x698a('0x22'),_0x5a4753,_0x3f0c2e['error']['message']);return _0x3a4e69(_0x3f0c2e[_0x698a('0x26')][_0x698a('0x28')]);}else{logger['info'](_0x698a('0x22'),_0x5a4753,_0x698a('0x23'));_0x3a4e69(_0x3f0c2e[_0x698a('0x29')][_0x698a('0x28')]);}})[_0x698a('0x2a')](function(_0x1eac88){logger[_0x698a('0x26')](_0x698a('0x22'),_0x5a4753,_0x1eac88);_0x191c84(_0x1eac88);});});}function respondWithStatusCode(_0x45c433,_0x4de0a5){_0x4de0a5=_0x4de0a5||0xcc;return function(_0x4e9d18){if(_0x4e9d18){return _0x45c433[_0x698a('0x2b')](_0x4de0a5);}return _0x45c433[_0x698a('0x2c')](_0x4de0a5)[_0x698a('0x2d')]();};}function respondWithResult(_0x370d7b,_0x55d070){_0x55d070=_0x55d070||0xc8;return function(_0x4091a0){if(_0x4091a0){return _0x370d7b[_0x698a('0x2c')](_0x55d070)['json'](_0x4091a0);}};}function respondWithFilteredResult(_0x19fddb,_0x3e1b86){return function(_0x3e20fb){if(_0x3e20fb){var _0x6f5029=typeof _0x3e1b86['offset']===_0x698a('0x2e')&&typeof _0x3e1b86[_0x698a('0x2f')]==='undefined';var _0x7bd2d2=_0x3e20fb[_0x698a('0x30')];var _0x23a9ea=_0x6f5029?0x0:_0x3e1b86[_0x698a('0x31')];var _0x277eac=_0x6f5029?_0x3e20fb[_0x698a('0x30')]:_0x3e1b86['offset']+_0x3e1b86['limit'];var _0x3ae09f;if(_0x277eac>=_0x7bd2d2){_0x277eac=_0x7bd2d2;_0x3ae09f=0xc8;}else{_0x3ae09f=0xce;}_0x19fddb[_0x698a('0x2c')](_0x3ae09f);return _0x19fddb[_0x698a('0x32')](_0x698a('0x33'),_0x23a9ea+'-'+_0x277eac+'/'+_0x7bd2d2)[_0x698a('0x34')](_0x3e20fb);}return null;};}function patchUpdates(_0x14e71b){return function(_0x4c6726){try{jsonpatch[_0x698a('0x35')](_0x4c6726,_0x14e71b,!![]);}catch(_0xe07a03){return BPromise[_0x698a('0x36')](_0xe07a03);}return _0x4c6726[_0x698a('0x37')]();};}function saveUpdates(_0x159341,_0x3482a6){return function(_0x4f43b3){if(_0x4f43b3){return _0x4f43b3[_0x698a('0x38')](_0x159341)[_0x698a('0x20')](function(_0x4582a0){return _0x4582a0;});}return null;};}function removeEntity(_0x47b300,_0xb0bd69){return function(_0x3a1736){if(_0x3a1736){return _0x3a1736['destroy']()[_0x698a('0x20')](function(){var _0x2345bf=_0x3a1736[_0x698a('0x39')]({'plain':!![]});var _0x521917=_0x698a('0x3a');return db[_0x698a('0x3b')]['destroy']({'where':{'type':_0x521917,'resourceId':_0x2345bf['id']}})['then'](function(){return _0x3a1736;});})[_0x698a('0x20')](function(){_0x47b300[_0x698a('0x2c')](0xcc)[_0x698a('0x2d')]();});}};}function handleEntityNotFound(_0x408161,_0x3bd211){return function(_0xff5793){if(!_0xff5793){_0x408161[_0x698a('0x2b')](0x194);}return _0xff5793;};}function handleError(_0x3d9d62,_0x16c04f){_0x16c04f=_0x16c04f||0x1f4;return function(_0x513076){logger[_0x698a('0x26')](_0x513076[_0x698a('0x3c')]);if(_0x513076[_0x698a('0x3d')]){delete _0x513076[_0x698a('0x3d')];}_0x3d9d62[_0x698a('0x2c')](_0x16c04f)[_0x698a('0x3e')](_0x513076);};}exports['index']=function(_0x131315,_0x426574){var _0x30a202={'include':[{'model':db['Pause'],'as':_0x698a('0x3f')}]},_0x187cf1={},_0x16037c={'count':0x0,'rows':[]};var _0x41677a=_['map'](db[_0x698a('0x40')][_0x698a('0x41')],function(_0x1e0404){return{'name':_0x1e0404[_0x698a('0x42')],'type':_0x1e0404[_0x698a('0x43')][_0x698a('0x44')]};});_0x187cf1['model']=_['map'](_0x41677a,_0x698a('0x3d'));_0x187cf1[_0x698a('0x45')]=_[_0x698a('0x46')](_0x131315[_0x698a('0x45')]);_0x187cf1[_0x698a('0x47')]=_[_0x698a('0x48')](_0x187cf1[_0x698a('0x49')],_0x187cf1[_0x698a('0x45')]);_0x30a202['attributes']=_[_0x698a('0x48')](_0x187cf1[_0x698a('0x49')],qs[_0x698a('0x4a')](_0x131315[_0x698a('0x45')][_0x698a('0x4a')]));_0x30a202[_0x698a('0x4b')]=_0x30a202['attributes']['length']?_0x30a202[_0x698a('0x4b')]:_0x187cf1['model'];if(!_0x131315[_0x698a('0x45')][_0x698a('0x4c')](_0x698a('0x4d'))){_0x30a202[_0x698a('0x2f')]=qs[_0x698a('0x2f')](_0x131315[_0x698a('0x45')][_0x698a('0x2f')]);_0x30a202['offset']=qs[_0x698a('0x31')](_0x131315[_0x698a('0x45')][_0x698a('0x31')]);}_0x30a202['order']=qs[_0x698a('0x4e')](_0x131315[_0x698a('0x45')][_0x698a('0x4e')]);_0x30a202[_0x698a('0x4f')]=qs[_0x698a('0x47')](_[_0x698a('0x50')](_0x131315[_0x698a('0x45')],_0x187cf1['filters']),_0x41677a);if(_0x131315['query']['filter']){_0x30a202[_0x698a('0x4f')]=_[_0x698a('0x51')](_0x30a202[_0x698a('0x4f')],{'$or':_[_0x698a('0x52')](_0x41677a,function(_0x38d9a4){if(_0x38d9a4[_0x698a('0x43')]!==_0x698a('0x53')){var _0x20fe24={};_0x20fe24[_0x38d9a4[_0x698a('0x3d')]]={'$like':'%'+_0x131315[_0x698a('0x45')][_0x698a('0x54')]+'%'};return _0x20fe24;}})});}_0x30a202=_[_0x698a('0x51')]({},_0x30a202,_0x131315[_0x698a('0x55')]);var _0x28cf0f={'where':_0x30a202['where']};return db[_0x698a('0x40')]['count'](_0x28cf0f)[_0x698a('0x20')](function(_0x814194){_0x16037c[_0x698a('0x30')]=_0x814194;if(_0x131315[_0x698a('0x45')]['includeAll']){_0x30a202[_0x698a('0x56')]=[{'all':!![]}];}return db[_0x698a('0x40')]['findAll'](_0x30a202);})[_0x698a('0x20')](function(_0x1ecabc){_0x16037c[_0x698a('0x57')]=_0x1ecabc;return _0x16037c;})[_0x698a('0x20')](respondWithFilteredResult(_0x426574,_0x30a202))[_0x698a('0x2a')](handleError(_0x426574,null));};exports[_0x698a('0x58')]=function(_0x20ea97,_0x4285bd){var _0x466a35={'raw':![],'where':{'id':_0x20ea97[_0x698a('0x59')]['id']},'include':[{'model':db['Pause'],'as':_0x698a('0x3f')}]},_0xa69c2c={};_0xa69c2c['model']=_[_0x698a('0x46')](db['SmsAccount'][_0x698a('0x41')]);_0xa69c2c[_0x698a('0x45')]=_[_0x698a('0x46')](_0x20ea97[_0x698a('0x45')]);_0xa69c2c[_0x698a('0x47')]=_[_0x698a('0x48')](_0xa69c2c['model'],_0xa69c2c[_0x698a('0x45')]);_0x466a35[_0x698a('0x4b')]=_['intersection'](_0xa69c2c[_0x698a('0x49')],qs[_0x698a('0x4a')](_0x20ea97['query'][_0x698a('0x4a')]));_0x466a35[_0x698a('0x4b')]=_0x466a35[_0x698a('0x4b')][_0x698a('0x5a')]?_0x466a35[_0x698a('0x4b')]:_0xa69c2c[_0x698a('0x49')];if(_0x20ea97[_0x698a('0x45')][_0x698a('0x5b')]){_0x466a35['include']=[{'all':!![]}];}_0x466a35=_[_0x698a('0x51')]({},_0x466a35,_0x20ea97[_0x698a('0x55')]);return db['SmsAccount'][_0x698a('0x5c')](_0x466a35)[_0x698a('0x20')](handleEntityNotFound(_0x4285bd,null))[_0x698a('0x20')](respondWithResult(_0x4285bd,null))[_0x698a('0x2a')](handleError(_0x4285bd,null));};exports[_0x698a('0x5d')]=function(_0xf2e3b,_0x3ef267){return db[_0x698a('0x40')]['create'](_0xf2e3b[_0x698a('0x5e')],{})[_0x698a('0x20')](function(_0xc009ca){var _0x414966=_0xf2e3b['user'][_0x698a('0x39')]({'plain':!![]});if(!_0x414966)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x414966[_0x698a('0x5f')]==='user'){var _0xf0b9ae=_0xc009ca[_0x698a('0x39')]({'plain':!![]});var _0x5104e5='SmsAccounts';return db[_0x698a('0x60')][_0x698a('0x5c')]({'where':{'name':_0x5104e5,'userProfileId':_0x414966[_0x698a('0x61')]},'raw':!![]})[_0x698a('0x20')](function(_0x238acd){if(_0x238acd&&_0x238acd[_0x698a('0x62')]===0x0){return db[_0x698a('0x3b')][_0x698a('0x5d')]({'name':_0xf0b9ae[_0x698a('0x3d')],'resourceId':_0xf0b9ae['id'],'type':_0x238acd[_0x698a('0x3d')],'sectionId':_0x238acd['id']},{})[_0x698a('0x20')](function(){return _0xc009ca;});}else{return _0xc009ca;}})[_0x698a('0x2a')](function(_0x55e1bf){logger[_0x698a('0x26')](_0x698a('0x63'),_0x55e1bf);throw _0x55e1bf;});}return _0xc009ca;})[_0x698a('0x20')](respondWithResult(_0x3ef267,0xc9))[_0x698a('0x2a')](handleError(_0x3ef267,null));};exports['update']=function(_0xbe79af,_0x2db25b){if(_0xbe79af[_0x698a('0x5e')]['id']){delete _0xbe79af[_0x698a('0x5e')]['id'];}return db[_0x698a('0x40')][_0x698a('0x5c')]({'where':{'id':_0xbe79af['params']['id']},'include':[{'model':db[_0x698a('0x64')],'as':'mandatoryDispositionPause'}]})[_0x698a('0x20')](handleEntityNotFound(_0x2db25b,null))[_0x698a('0x20')](saveUpdates(_0xbe79af[_0x698a('0x5e')],null))['then'](respondWithResult(_0x2db25b,null))[_0x698a('0x2a')](handleError(_0x2db25b,null));};exports[_0x698a('0x65')]=function(_0x3a33c0,_0xd47996){return db[_0x698a('0x40')][_0x698a('0x5c')]({'where':{'id':_0x3a33c0[_0x698a('0x59')]['id']}})[_0x698a('0x20')](handleEntityNotFound(_0xd47996,null))[_0x698a('0x20')](removeEntity(_0xd47996,null))[_0x698a('0x2a')](handleError(_0xd47996,null));};exports[_0x698a('0x66')]=function(_0x1fe26a,_0x37a761){return db[_0x698a('0x40')][_0x698a('0x66')]()[_0x698a('0x20')](respondWithResult(_0x37a761,null))[_0x698a('0x2a')](handleError(_0x37a761,null));};exports[_0x698a('0x67')]=function(_0x50edf6,_0x1fb7b3,_0x2a5966){if(_0x50edf6[_0x698a('0x5e')]['id']){delete _0x50edf6[_0x698a('0x5e')]['id'];}return db[_0x698a('0x40')]['find']({'where':{'id':_0x50edf6[_0x698a('0x59')]['id']}})[_0x698a('0x20')](handleEntityNotFound(_0x1fb7b3,null))['then'](function(_0x2cbfca){if(_0x2cbfca){_0x50edf6['body'][_0x698a('0x68')]=_0x2cbfca['id'];return db[_0x698a('0x69')][_0x698a('0x5d')](_0x50edf6[_0x698a('0x5e')]);}})[_0x698a('0x20')](respondWithResult(_0x1fb7b3,null))[_0x698a('0x2a')](handleError(_0x1fb7b3,null));};exports['getDispositions']=function(_0x50ced9,_0x30ef7f,_0x3aba66){var _0x4cba3e={'raw':![],'where':{}};var _0x3e84fb={};var _0x20c003={'count':0x0,'rows':[]};return db[_0x698a('0x40')][_0x698a('0x6a')]({'where':{'id':_0x50ced9[_0x698a('0x59')]['id']}})[_0x698a('0x20')](handleEntityNotFound(_0x30ef7f,null))['then'](function(_0x4c9b36){if(_0x4c9b36){_0x3e84fb[_0x698a('0x49')]=_[_0x698a('0x46')](db[_0x698a('0x69')][_0x698a('0x41')]);_0x3e84fb[_0x698a('0x45')]=_['keys'](_0x50ced9[_0x698a('0x45')]);_0x3e84fb[_0x698a('0x47')]=_[_0x698a('0x48')](_0x3e84fb[_0x698a('0x49')],_0x3e84fb[_0x698a('0x45')]);_0x4cba3e[_0x698a('0x4b')]=_[_0x698a('0x48')](_0x3e84fb[_0x698a('0x49')],qs[_0x698a('0x4a')](_0x50ced9[_0x698a('0x45')][_0x698a('0x4a')]));_0x4cba3e[_0x698a('0x4b')]=_0x4cba3e[_0x698a('0x4b')]['length']?_0x4cba3e[_0x698a('0x4b')]:_0x3e84fb[_0x698a('0x49')];if(!_0x50ced9[_0x698a('0x45')][_0x698a('0x4c')]('nolimit')){_0x4cba3e[_0x698a('0x2f')]=qs['limit'](_0x50ced9[_0x698a('0x45')][_0x698a('0x2f')]);_0x4cba3e[_0x698a('0x31')]=qs[_0x698a('0x31')](_0x50ced9[_0x698a('0x45')]['offset']);}_0x4cba3e[_0x698a('0x6b')]=qs[_0x698a('0x4e')](_0x50ced9['query'][_0x698a('0x4e')]);_0x4cba3e[_0x698a('0x4f')]=qs[_0x698a('0x47')](_[_0x698a('0x50')](_0x50ced9['query'],_0x3e84fb[_0x698a('0x47')]));_0x4cba3e[_0x698a('0x4f')][_0x698a('0x68')]=_0x4c9b36['id'];if(_0x50ced9[_0x698a('0x45')]['filter']){_0x4cba3e[_0x698a('0x4f')]=_['merge'](_0x4cba3e[_0x698a('0x4f')],{'$or':_['map'](_0x4cba3e[_0x698a('0x4b')],function(_0x470096){var _0x2aadaf={};_0x2aadaf[_0x470096]={'$like':'%'+_0x50ced9[_0x698a('0x45')]['filter']+'%'};return _0x2aadaf;})});}_0x4cba3e=_[_0x698a('0x51')]({},_0x4cba3e,_0x50ced9[_0x698a('0x55')]);return db['Disposition']['count']({'where':_0x4cba3e[_0x698a('0x4f')]})[_0x698a('0x20')](function(_0x34c730){_0x20c003[_0x698a('0x30')]=_0x34c730;if(_0x50ced9['query'][_0x698a('0x5b')]){_0x4cba3e['include']=[{'all':!![]}];}return db[_0x698a('0x69')][_0x698a('0x6c')](_0x4cba3e);})[_0x698a('0x20')](function(_0xa7df73){_0x20c003[_0x698a('0x57')]=_0xa7df73;return _0x20c003;});}})['then'](respondWithFilteredResult(_0x30ef7f,_0x4cba3e))[_0x698a('0x2a')](handleError(_0x30ef7f,null));};exports[_0x698a('0x6d')]=function(_0x27dffe,_0x4a0503,_0x71174b){return db[_0x698a('0x40')][_0x698a('0x5c')]({'where':{'id':_0x27dffe['params']['id']}})['then'](handleEntityNotFound(_0x4a0503,null))['then'](function(_0x1fa1d9){if(_0x1fa1d9){return _0x1fa1d9[_0x698a('0x6d')](_0x27dffe[_0x698a('0x45')][_0x698a('0x6e')]);}})[_0x698a('0x20')](respondWithStatusCode(_0x4a0503,null))[_0x698a('0x2a')](handleError(_0x4a0503,null));};exports[_0x698a('0x6f')]=function(_0x41600c,_0x381386,_0x4f8077){if(_0x41600c[_0x698a('0x5e')]['id']){delete _0x41600c[_0x698a('0x5e')]['id'];}return db[_0x698a('0x40')][_0x698a('0x5c')]({'where':{'id':_0x41600c[_0x698a('0x59')]['id']}})['then'](handleEntityNotFound(_0x381386,null))[_0x698a('0x20')](function(_0x37f239){if(_0x37f239){_0x41600c[_0x698a('0x5e')][_0x698a('0x68')]=_0x37f239['id'];return db[_0x698a('0x70')][_0x698a('0x5d')](_0x41600c[_0x698a('0x5e')]);}})[_0x698a('0x20')](respondWithResult(_0x381386,null))[_0x698a('0x2a')](handleError(_0x381386,null));};exports['getAnswers']=function(_0x57aab3,_0x123704,_0x22fec1){var _0xbc0455={'raw':![],'where':{}};var _0xc1c394={};var _0x1b1a31={'count':0x0,'rows':[]};return db['SmsAccount'][_0x698a('0x6a')]({'where':{'id':_0x57aab3[_0x698a('0x59')]['id']}})[_0x698a('0x20')](handleEntityNotFound(_0x123704,null))['then'](function(_0x263b28){if(_0x263b28){_0xc1c394['model']=_[_0x698a('0x46')](db[_0x698a('0x70')][_0x698a('0x41')]);_0xc1c394[_0x698a('0x45')]=_[_0x698a('0x46')](_0x57aab3[_0x698a('0x45')]);_0xc1c394[_0x698a('0x47')]=_[_0x698a('0x48')](_0xc1c394[_0x698a('0x49')],_0xc1c394[_0x698a('0x45')]);_0xbc0455[_0x698a('0x4b')]=_['intersection'](_0xc1c394[_0x698a('0x49')],qs['fields'](_0x57aab3['query'][_0x698a('0x4a')]));_0xbc0455[_0x698a('0x4b')]=_0xbc0455['attributes'][_0x698a('0x5a')]?_0xbc0455[_0x698a('0x4b')]:_0xc1c394[_0x698a('0x49')];if(!_0x57aab3[_0x698a('0x45')][_0x698a('0x4c')](_0x698a('0x4d'))){_0xbc0455[_0x698a('0x2f')]=qs[_0x698a('0x2f')](_0x57aab3[_0x698a('0x45')][_0x698a('0x2f')]);_0xbc0455['offset']=qs['offset'](_0x57aab3[_0x698a('0x45')][_0x698a('0x31')]);}_0xbc0455['order']=qs[_0x698a('0x4e')](_0x57aab3[_0x698a('0x45')]['sort']);_0xbc0455[_0x698a('0x4f')]=qs[_0x698a('0x47')](_['pick'](_0x57aab3[_0x698a('0x45')],_0xc1c394[_0x698a('0x47')]));_0xbc0455[_0x698a('0x4f')][_0x698a('0x68')]=_0x263b28['id'];if(_0x57aab3[_0x698a('0x45')][_0x698a('0x54')]){_0xbc0455[_0x698a('0x4f')]=_[_0x698a('0x51')](_0xbc0455[_0x698a('0x4f')],{'$or':_[_0x698a('0x52')](_0xbc0455['attributes'],function(_0x2e5034){var _0x34d2af={};_0x34d2af[_0x2e5034]={'$like':'%'+_0x57aab3[_0x698a('0x45')][_0x698a('0x54')]+'%'};return _0x34d2af;})});}_0xbc0455=_[_0x698a('0x51')]({},_0xbc0455,_0x57aab3[_0x698a('0x55')]);return db['CannedAnswer'][_0x698a('0x30')]({'where':_0xbc0455['where']})[_0x698a('0x20')](function(_0x44d83a){_0x1b1a31[_0x698a('0x30')]=_0x44d83a;if(_0x57aab3[_0x698a('0x45')][_0x698a('0x5b')]){_0xbc0455[_0x698a('0x56')]=[{'all':!![]}];}return db[_0x698a('0x70')][_0x698a('0x6c')](_0xbc0455);})[_0x698a('0x20')](function(_0x40a586){_0x1b1a31[_0x698a('0x57')]=_0x40a586;return _0x1b1a31;});}})[_0x698a('0x20')](respondWithFilteredResult(_0x123704,_0xbc0455))['catch'](handleError(_0x123704,null));};exports[_0x698a('0x71')]=function(_0x806d6c,_0x27be94,_0x50590b){return db['SmsAccount']['find']({'where':{'id':_0x806d6c[_0x698a('0x59')]['id']}})[_0x698a('0x20')](handleEntityNotFound(_0x27be94,null))[_0x698a('0x20')](function(_0x276ee5){if(_0x276ee5){return _0x276ee5['removeAnswers'](_0x806d6c[_0x698a('0x45')][_0x698a('0x6e')]);}})[_0x698a('0x20')](respondWithStatusCode(_0x27be94,null))[_0x698a('0x2a')](handleError(_0x27be94,null));};exports[_0x698a('0x72')]=function(_0xa0f3ef,_0x48a7d5,_0x1289c0){var _0x1f561d={'channel':_0x698a('0x73')};var _0x5076fb=[];var _0x5ae297=[];var _0x1776d5={};return db['SmsAccount'][_0x698a('0x5c')]({'where':{'id':_0xa0f3ef[_0x698a('0x59')]['id']},'include':[{'model':db[_0x698a('0x74')],'as':_0x698a('0x75')}]})[_0x698a('0x20')](handleEntityNotFound(_0x48a7d5,null))[_0x698a('0x20')](function(_0x4836b3){_0x1f561d[_0x698a('0x76')]=_0x4836b3;_0x1f561d[_0x698a('0x77')]=_['orderBy'](_0x4836b3['Applications'],[_0x698a('0x78')],[_0x698a('0x79')]);if(_0x1f561d[_0x698a('0x76')][_0x698a('0x75')]){delete _0x1f561d['account'][_0x698a('0x75')];}return db[_0x698a('0x7a')][_0x698a('0x66')]();})[_0x698a('0x20')](function(_0x4b3d9f){if(!_0x4b3d9f){throw new db[(_0x698a('0x7b'))][(_0x698a('0x7c'))](_0x698a('0x7d'));}_0x5076fb=_[_0x698a('0x7e')](_[_0x698a('0x46')](_0x4b3d9f),[_0x698a('0x7f'),'updatedAt']);_0x5ae297=_[_0x698a('0x7e')](_[_0x698a('0x46')](_0x4b3d9f),[_0x698a('0x7f'),_0x698a('0x80'),_0x698a('0x81'),_0x698a('0x82')]);_0x1f561d[_0x698a('0x5e')]={'mapKey':'mobile'};if(_0x1f561d[_0x698a('0x76')][_0x698a('0x43')]){switch(_0x1f561d['account'][_0x698a('0x43')]){case _0x698a('0x83'):_0x1f561d[_0x698a('0x5e')][_0x698a('0x84')]=_0xa0f3ef['body'][_0x698a('0x85')];_0x1f561d[_0x698a('0x5e')]['body']=_0xa0f3ef[_0x698a('0x5e')][_0x698a('0x86')];_0x1f561d[_0x698a('0x5e')][_0x698a('0x87')]=_0xa0f3ef[_0x698a('0x5e')][_0x698a('0x88')];break;case _0x698a('0x89'):_0x1f561d[_0x698a('0x5e')][_0x698a('0x84')]='+'+_0xa0f3ef[_0x698a('0x5e')][_0x698a('0x8a')];_0x1f561d['body'][_0x698a('0x5e')]=_0xa0f3ef['body']['text'];break;case'connectel':_0x1f561d[_0x698a('0x5e')][_0x698a('0x84')]=_0xa0f3ef['body']['from'];_0x1f561d[_0x698a('0x5e')][_0x698a('0x5e')]=_0xa0f3ef[_0x698a('0x5e')]['message'];break;case _0x698a('0x8b'):_0x1f561d[_0x698a('0x5e')][_0x698a('0x84')]=_0xa0f3ef[_0x698a('0x5e')][_0x698a('0x84')];_0x1f561d[_0x698a('0x5e')][_0x698a('0x5e')]=_0xa0f3ef[_0x698a('0x5e')][_0x698a('0x5e')];_0x1f561d[_0x698a('0x5e')][_0x698a('0x87')]=_0xa0f3ef['body']['message_id'];break;case _0x698a('0x8c'):_0x1f561d[_0x698a('0x5e')][_0x698a('0x84')]=_0xa0f3ef['body'][_0x698a('0x85')];_0x1f561d[_0x698a('0x5e')][_0x698a('0x5e')]=_0xa0f3ef[_0x698a('0x5e')][_0x698a('0x8d')];_0x1f561d[_0x698a('0x5e')][_0x698a('0x87')]=_0xa0f3ef[_0x698a('0x5e')][_0x698a('0x8e')];break;case _0x698a('0x8f'):_0x1f561d[_0x698a('0x5e')][_0x698a('0x84')]='+'+_0xa0f3ef[_0x698a('0x5e')]['results'][0x0][_0x698a('0x84')];_0x1f561d[_0x698a('0x5e')][_0x698a('0x5e')]=_0xa0f3ef[_0x698a('0x5e')][_0x698a('0x90')][0x0][_0x698a('0x91')];_0x1f561d[_0x698a('0x5e')][_0x698a('0x87')]=_0xa0f3ef['body'][_0x698a('0x90')][0x0][_0x698a('0x87')];break;case _0x698a('0x92'):_0x1f561d[_0x698a('0x5e')][_0x698a('0x84')]=_0xa0f3ef[_0x698a('0x5e')]['originatingAddress'];_0x1f561d[_0x698a('0x5e')]['body']=_0xa0f3ef[_0x698a('0x5e')][_0x698a('0x93')][_0x698a('0x28')];break;case _0x698a('0x94'):_0x1f561d[_0x698a('0x5e')]['from']=_0xa0f3ef[_0x698a('0x5e')][_0x698a('0x95')];_0x1f561d[_0x698a('0x5e')][_0x698a('0x5e')]=_0xa0f3ef['body'][_0x698a('0x91')];_0x1f561d['body'][_0x698a('0x87')]=_0xa0f3ef[_0x698a('0x5e')][_0x698a('0x96')];break;case'bandwidth':_0x1f561d['body'][_0x698a('0x87')]=_0xa0f3ef[_0x698a('0x5e')][0x0][_0x698a('0x28')]['id'];_0x1f561d[_0x698a('0x5e')][_0x698a('0x84')]=_0xa0f3ef['body'][0x0][_0x698a('0x28')]['from'];_0x1f561d[_0x698a('0x5e')]['body']=_0xa0f3ef[_0x698a('0x5e')][0x0][_0x698a('0x28')]['text'];break;case _0x698a('0x97'):_0x1f561d[_0x698a('0x5e')][_0x698a('0x84')]=_0xa0f3ef[_0x698a('0x5e')][_0x698a('0x84')];_0x1f561d[_0x698a('0x5e')][_0x698a('0x5e')]=_0xa0f3ef['body'][_0x698a('0x28')];_0x1f561d[_0x698a('0x5e')][_0x698a('0x87')]=_0xa0f3ef[_0x698a('0x5e')][_0x698a('0x98')];break;}}if(_0x1f561d[_0x698a('0x5e')]['id']){delete _0x1f561d[_0x698a('0x5e')]['id'];}if(_[_0x698a('0x99')](_0x1f561d[_0x698a('0x5e')][_0x698a('0x84')])){throw new db[(_0x698a('0x7b'))][(_0x698a('0x7c'))](_0x698a('0x9a'));}if(_[_0x698a('0x99')](_0x1f561d[_0x698a('0x5e')]['body'])||_0x1f561d[_0x698a('0x5e')][_0x698a('0x5e')]===''){throw new db[(_0x698a('0x7b'))][(_0x698a('0x7c'))](_0x698a('0x9b'));}if(_['isNil'](_0x1f561d[_0x698a('0x5e')][_0x698a('0x9c')])){throw new db[(_0x698a('0x7b'))][(_0x698a('0x7c'))](_0x698a('0x9d')+_0x5ae297);}if(!_[_0x698a('0x9e')](_0x5ae297,_0x1f561d[_0x698a('0x5e')][_0x698a('0x9c')])){throw new db[(_0x698a('0x7b'))][(_0x698a('0x7c'))](_0x698a('0x9f')+_0x5ae297);}_0x1776d5[_0x1f561d[_0x698a('0x5e')][_0x698a('0x9c')]]=_0x1f561d[_0x698a('0x5e')][_0x698a('0x84')];return db['CmList']['find']({'where':{'id':_0x1f561d[_0x698a('0x76')][_0x698a('0x82')]},'include':[{'model':db[_0x698a('0x7a')],'as':'Contacts','where':_0x1776d5,'limit':0x1,'order':[['updatedAt',_0x698a('0xa0')]]}]});})['then'](handleEntityNotFound(_0x48a7d5,null))['then'](function(_0x5abbdc){if(_0x5abbdc){_0x1f561d[_0x698a('0xa1')]=_[_0x698a('0xa2')](_0x5abbdc,[_0x698a('0xa3')]);if(_0x5abbdc[_0x698a('0xa3')][_0x698a('0x5a')]){return _0x5abbdc[_0x698a('0xa3')][0x0];}var _0x2a0df7=_[_0x698a('0x19')](_0x1f561d[_0x698a('0x5e')],{'firstName':_0x1f561d[_0x698a('0x5e')]['from'],'ListId':_0x5abbdc['id']});_0x2a0df7[_0x1f561d[_0x698a('0x5e')][_0x698a('0x9c')]]=_0x1f561d[_0x698a('0x5e')][_0x698a('0x84')];return db[_0x698a('0x7a')]['create'](_0x2a0df7,{'fields':_0x5076fb,'raw':!![]});}})[_0x698a('0x20')](handleEntityNotFound(_0x48a7d5,null))['then'](function(_0xeb6726){if(_0xeb6726){_0x1f561d[_0x698a('0xa4')]=_0xeb6726;var _0x15f3cb={'ContactId':_0xeb6726['id'],'phone':_0x1f561d[_0x698a('0x5e')][_0x698a('0x84')],'SmsAccountId':_0xa0f3ef[_0x698a('0x59')]['id']};var _0x3700a8={'ContactId':_0xeb6726['id'],'SmsAccountId':_0xa0f3ef[_0x698a('0x59')]['id'],'closed':![]};return db['SmsInteraction'][_0x698a('0x5c')]({'where':_0x3700a8})[_0x698a('0x20')](function(_0x260a62){if(_0x260a62){return[_0x260a62,![]];}return db[_0x698a('0xa5')][_0x698a('0x5d')](_0x15f3cb)[_0x698a('0x20')](function(_0x3b1503){return[_0x3b1503,!![]];});});}})[_0x698a('0xa6')](function(_0x58899c,_0x321e5b){_0x1f561d[_0x698a('0xa7')]=_0x58899c[_0x698a('0x39')]({'plain':!![]});_0x1f561d[_0x698a('0xa7')]['created']=![];if(_0x321e5b){if(_0x1f561d[_0x698a('0x76')][_0x698a('0xa8')]){_0x1f561d['applications'][_0x698a('0xa9')]({'id':0x0,'priority':_0x1f561d[_0x698a('0x77')]['length']+0x1,'app':_0x698a('0xaa'),'appdata':'unmanaged','interval':_0x698a('0xab')});}_0x1f561d['interaction']['created']=!![];}return db['SmsMessage'][_0x698a('0x5d')]({'phone':_0x1f561d[_0x698a('0x5e')][_0x698a('0x84')],'messageId':_0x1f561d[_0x698a('0x5e')][_0x698a('0x87')],'body':_0x1f561d[_0x698a('0x5e')][_0x698a('0x5e')],'SmsAccountId':_0xa0f3ef[_0x698a('0x59')]['id'],'SmsInteractionId':_0x58899c['id'],'direction':'in','ContactId':_0x58899c[_0x698a('0xac')],'AttachmentId':_0x1f561d[_0x698a('0x5e')][_0x698a('0xad')]});})['then'](function(_0x24042e){_0x1f561d[_0x698a('0x28')]=_0x24042e;if(_0x1f561d[_0x698a('0xa7')]['UserId']){return db[_0x698a('0xae')][_0x698a('0x5c')]({'attributes':['id',_0x698a('0x3d')],'where':{'id':_0x1f561d[_0x698a('0xa7')][_0x698a('0xaf')]}})[_0x698a('0x20')](function(_0x4e2651){if(_0x4e2651){_0x1f561d['applications'][_0x698a('0xb0')]({'id':0x0,'priority':0x0,'app':_0x698a('0xb1'),'appdata':_0x4e2651[_0x698a('0x3d')]+','+(_0x1f561d['account'][_0x698a('0xb2')]||0xa),'interval':_0x698a('0xab')});}return respondWithRpcPromise(_0x698a('0xb3'),'startRouting',_0x1f561d);});}return respondWithRpcPromise(_0x698a('0xb3'),_0x698a('0xb4'),_0x1f561d);})[_0x698a('0x20')](function(_0x5ee78d){if(_0x5ee78d){var _0x377f41=0xc8;var _0x4bac22=_0x698a('0xb5');logger[_0x698a('0x21')](_0x698a('0xb6'),_0x4bac22,_0x377f41,'entity\x20found');logger[_0x698a('0x24')](_0x698a('0xb7'),_0x4bac22,_0x377f41,'entity\x20found',JSON['stringify'](_0x5ee78d));if(_0x1f561d[_0x698a('0x76')]['type']===_0x698a('0x83')){return _0x48a7d5[_0x698a('0x2c')](_0x377f41)[_0x698a('0x32')](_0x698a('0xb8'),_0x698a('0xb9'))[_0x698a('0x3e')](_0x698a('0xba'));}else{return _0x48a7d5['status'](_0x377f41)['json'](_0x5ee78d);}}})[_0x698a('0x2a')](handleError(_0x48a7d5,null));};exports['addApplications']=function(_0x22514b,_0x3d0197){var _0x57f3af=_0x22514b['params']['id'];var _0x1f43cb=_0x22514b[_0x698a('0x5e')];var _0xe82fd5=0xc8;var _0x802160=null;return db[_0x698a('0xbb')][_0x698a('0xbc')]({'isolationLevel':db[_0x698a('0xbb')][_0x698a('0xbd')]['ISOLATION_LEVELS'][_0x698a('0xbe')]},function(_0x30dfb7){return db[_0x698a('0x40')][_0x698a('0x6a')]({'where':{'id':_0x57f3af},'transaction':_0x30dfb7})[_0x698a('0x20')](function(_0x417652){if(_0x417652){return db[_0x698a('0x74')]['destroy']({'where':{'SmsAccountId':_0x57f3af},'transaction':_0x30dfb7})[_0x698a('0x20')](function(){var _0x3e63b6=_[_0x698a('0x52')](_0x1f43cb,function(_0x5204e8){_0x5204e8[_0x698a('0x68')]=_0x57f3af;return _0x5204e8;});return db['SmsApplication'][_0x698a('0xbf')](_0x3e63b6,{'transaction':_0x30dfb7});});}else{_0xe82fd5=0x194;_0x802160=[];}});})[_0x698a('0x20')](function(){if(_0xe82fd5!==0x194){return db[_0x698a('0x74')][_0x698a('0xc0')]({'where':{'SmsAccountId':_0x57f3af},'order':_0x698a('0x78')})[_0x698a('0x20')](function(_0x5d1cd9){_0x802160=_0x5d1cd9;});}})['catch'](function(_0x147618){_0xe82fd5=0x1f4;logger[_0x698a('0x26')](_0x147618['stack']);if(_0x147618[_0x698a('0x3d')]){delete _0x147618[_0x698a('0x3d')];}_0x802160=_0x147618;})[_0x698a('0xc1')](function(){if(_0x802160===null){_0x3d0197[_0x698a('0x2b')](_0xe82fd5);}else{if(_0xe82fd5===0x1f4){_0x3d0197[_0x698a('0x2c')](_0xe82fd5)[_0x698a('0x3e')](_0x802160);}else{_0x3d0197[_0x698a('0x2c')](_0xe82fd5)['json'](_0x802160);}}});};exports[_0x698a('0xc2')]=function(_0x2fbf62,_0x2b2ee0,_0x28e0bc){var _0x5b7099={};var _0x42e9cd={};var _0x16dce9;var _0x434d99;return db['SmsAccount'][_0x698a('0x6a')]({'where':{'id':_0x2fbf62['params']['id']}})[_0x698a('0x20')](handleEntityNotFound(_0x2b2ee0,null))[_0x698a('0x20')](function(_0x59bb47){if(_0x59bb47){_0x16dce9=_0x59bb47;_0x42e9cd[_0x698a('0x49')]=_[_0x698a('0x46')](db[_0x698a('0x74')][_0x698a('0x41')]);_0x42e9cd[_0x698a('0x45')]=_['keys'](_0x2fbf62[_0x698a('0x45')]);_0x42e9cd[_0x698a('0x47')]=_[_0x698a('0x48')](_0x42e9cd[_0x698a('0x49')],_0x42e9cd[_0x698a('0x45')]);_0x5b7099['attributes']=_[_0x698a('0x48')](_0x42e9cd['model'],qs['fields'](_0x2fbf62[_0x698a('0x45')]['fields']));_0x5b7099['attributes']=_0x5b7099['attributes'][_0x698a('0x5a')]?_0x5b7099[_0x698a('0x4b')]:_0x42e9cd[_0x698a('0x49')];_0x5b7099['order']=qs[_0x698a('0x4e')](_0x2fbf62[_0x698a('0x45')][_0x698a('0x4e')]);_0x5b7099['where']=qs[_0x698a('0x47')](_[_0x698a('0x50')](_0x2fbf62[_0x698a('0x45')],_0x42e9cd['filters']));if(_0x2fbf62['query']['filter']){_0x5b7099['where']=_[_0x698a('0x51')](_0x5b7099['where'],{'$or':_[_0x698a('0x52')](_0x5b7099['attributes'],function(_0x33f0bd){var _0x5169d7={};_0x5169d7[_0x33f0bd]={'$like':'%'+_0x2fbf62[_0x698a('0x45')][_0x698a('0x54')]+'%'};return _0x5169d7;})});}_0x5b7099=_[_0x698a('0x51')]({},_0x5b7099,_0x2fbf62['options']);return _0x16dce9[_0x698a('0xc2')](_0x5b7099);}})[_0x698a('0x20')](function(_0x120a36){if(_0x120a36){_0x434d99=_0x120a36[_0x698a('0x5a')];if(!_0x2fbf62[_0x698a('0x45')]['hasOwnProperty'](_0x698a('0x4d'))){_0x5b7099['limit']=qs[_0x698a('0x2f')](_0x2fbf62[_0x698a('0x45')]['limit']);_0x5b7099[_0x698a('0x31')]=qs[_0x698a('0x31')](_0x2fbf62[_0x698a('0x45')][_0x698a('0x31')]);}return _0x16dce9['getApplications'](_0x5b7099);}})['then'](function(_0x355433){if(_0x355433){return _0x355433?{'count':_0x434d99,'rows':_0x355433}:null;}})[_0x698a('0x20')](respondWithResult(_0x2b2ee0,null))[_0x698a('0x2a')](handleError(_0x2b2ee0,null));};exports[_0x698a('0xc3')]=function(_0x4921c0,_0x5d773f,_0x213ed2){var _0x40b924={'raw':![],'where':{}};var _0x361f9b={};var _0x458d5e={'count':0x0,'rows':[]};return db[_0x698a('0x40')]['findOne']({'where':{'id':_0x4921c0[_0x698a('0x59')]['id']}})['then'](handleEntityNotFound(_0x5d773f,null))['then'](function(_0xb8c4b4){if(_0xb8c4b4){_0x361f9b[_0x698a('0x49')]=_[_0x698a('0x46')](db[_0x698a('0xa5')][_0x698a('0x41')]);_0x361f9b['query']=_[_0x698a('0x46')](_0x4921c0[_0x698a('0x45')]);_0x361f9b[_0x698a('0x47')]=_[_0x698a('0x48')](_0x361f9b[_0x698a('0x49')],_0x361f9b[_0x698a('0x45')]);_0x40b924[_0x698a('0x4b')]=_[_0x698a('0x48')](_0x361f9b[_0x698a('0x49')],qs['fields'](_0x4921c0[_0x698a('0x45')][_0x698a('0x4a')]));_0x40b924['attributes']=_0x40b924['attributes'][_0x698a('0x5a')]?_0x40b924[_0x698a('0x4b')]:_0x361f9b[_0x698a('0x49')];if(!_0x4921c0['query'][_0x698a('0x4c')](_0x698a('0x4d'))){_0x40b924['limit']=qs[_0x698a('0x2f')](_0x4921c0[_0x698a('0x45')][_0x698a('0x2f')]);_0x40b924[_0x698a('0x31')]=qs[_0x698a('0x31')](_0x4921c0[_0x698a('0x45')]['offset']);}_0x40b924[_0x698a('0x6b')]=qs[_0x698a('0x4e')](_0x4921c0[_0x698a('0x45')]['sort']);_0x40b924['where']=qs[_0x698a('0x47')](_[_0x698a('0x50')](_0x4921c0[_0x698a('0x45')],_0x361f9b[_0x698a('0x47')]));_0x40b924['where'][_0x698a('0x68')]=_0xb8c4b4['id'];if(_0x4921c0[_0x698a('0x45')][_0x698a('0x54')]){_0x40b924[_0x698a('0x4f')]=_['merge'](_0x40b924[_0x698a('0x4f')],{'$or':_[_0x698a('0x52')](_0x40b924[_0x698a('0x4b')],function(_0x13b9a9){var _0x216e29={};_0x216e29[_0x13b9a9]={'$like':'%'+_0x4921c0[_0x698a('0x45')][_0x698a('0x54')]+'%'};return _0x216e29;})});}_0x40b924=_[_0x698a('0x51')]({},_0x40b924,_0x4921c0[_0x698a('0x55')]);return db[_0x698a('0xa5')][_0x698a('0x30')]({'where':_0x40b924[_0x698a('0x4f')]})[_0x698a('0x20')](function(_0x15cf5c){_0x458d5e[_0x698a('0x30')]=_0x15cf5c;if(_0x4921c0['query'][_0x698a('0x5b')]){_0x40b924['include']=[{'model':db['CmContact'],'as':_0x698a('0xc4'),'required':![]},{'model':db[_0x698a('0xae')],'as':_0x698a('0xc5'),'attributes':[_0x698a('0x3d'),_0x698a('0xc6'),'internal'],'required':![]},{'model':db[_0x698a('0xc7')],'as':'Tags','attributes':['id',_0x698a('0x3d'),_0x698a('0xc8')],'where':_0x4921c0[_0x698a('0x45')][_0x698a('0xc9')]?{'id':_0x4921c0[_0x698a('0x45')][_0x698a('0xc9')]}:undefined,'required':_0x4921c0[_0x698a('0x45')][_0x698a('0xc9')]?!![]:![]}];}return db[_0x698a('0xa5')][_0x698a('0x6c')](_0x40b924);})[_0x698a('0x20')](function(_0x34f69f){_0x458d5e[_0x698a('0x57')]=_0x34f69f;return _0x458d5e;});}})[_0x698a('0x20')](respondWithFilteredResult(_0x5d773f,_0x40b924))['catch'](handleError(_0x5d773f,null));};exports[_0x698a('0x3e')]=function(_0x14fe0d,_0x58f89f,_0x2b77f4){var _0x23bfe8,_0x406f42,_0x20b20c;if(_['isNil'](_0x14fe0d[_0x698a('0x5e')][_0x698a('0x5e')])||_0x14fe0d[_0x698a('0x5e')][_0x698a('0x5e')]===''){throw new db[(_0x698a('0x7b'))][(_0x698a('0x7c'))](_0x698a('0x9b'));}if(_[_0x698a('0x99')](_0x14fe0d[_0x698a('0x5e')]['to'])){throw new db[(_0x698a('0x7b'))]['ValidationError'](_0x698a('0xca'));}_0x23bfe8=_0x14fe0d['body']['to'];return db['SmsAccount'][_0x698a('0x5c')]({'where':{'id':_0x14fe0d['params']['id']},'include':[{'model':db[_0x698a('0xcb')],'as':'List','include':[{'model':db[_0x698a('0x7a')],'as':_0x698a('0xa3'),'where':{'mobile':_0x23bfe8},'limit':0x1,'order':[[_0x698a('0x80'),_0x698a('0xa0')]]}]}]})['then'](handleEntityNotFound(_0x58f89f,null))['then'](function(_0x204c44){if(_0x204c44&&_0x204c44[_0x698a('0xcc')]){_0x406f42=_0x204c44[_0x698a('0x39')]({'plain':!![]});if(_0x406f42[_0x698a('0xcc')]&&_0x406f42[_0x698a('0xcc')][_0x698a('0xa3')][_0x698a('0x5a')]){return _0x406f42[_0x698a('0xcc')][_0x698a('0xa3')][0x0];}return db[_0x698a('0x7a')]['create'](_['defaults'](_0x14fe0d['body'],{'firstName':_0x23bfe8,'mobile':_0x23bfe8,'phone':_0x23bfe8,'ListId':_0x406f42[_0x698a('0x82')]}));}})[_0x698a('0x20')](handleEntityNotFound(_0x58f89f,null))['then'](function(_0x151558){if(_0x151558){_0x20b20c=_0x151558;return db[_0x698a('0xa5')]['find']({'where':{'ContactId':_0x20b20c['id'],'closed':![],'SmsAccountId':_0x406f42['id']}})[_0x698a('0x20')](function(_0x326ca3){if(_0x326ca3){return[_0x326ca3,![]];}return db['SmsInteraction']['create']({'UserId':_0x14fe0d[_0x698a('0xcd')]['id'],'ContactId':_0x20b20c['id'],'SmsAccountId':_0x406f42['id'],'phone':_0x23bfe8,'firstMsgDirection':_0x698a('0xce'),'Messages':[_[_0x698a('0x51')](_0x14fe0d[_0x698a('0x5e')],{'read':![],'body':_0x14fe0d[_0x698a('0x5e')]['body'],'phone':_0x23bfe8,'SmsAccountId':_0x406f42['id'],'UserId':_0x14fe0d[_0x698a('0xcd')]['id'],'ContactId':_0x20b20c['id']})]},{'include':[{'model':db[_0x698a('0xcf')],'as':_0x698a('0xd0')}]})[_0x698a('0x20')](function(_0xab1fe2){return[_0xab1fe2,!![]];});});}})[_0x698a('0xa6')](function(_0x569df3,_0x4ff8c1){if(_0x4ff8c1){return _0x569df3;}return db['SmsMessage']['create'](_[_0x698a('0x51')](_0x14fe0d[_0x698a('0x5e')],{'read':![],'body':_0x14fe0d[_0x698a('0x5e')]['body'],'phone':_0x23bfe8,'SmsAccountId':_0x406f42['id'],'SmsInteractionId':_0x569df3['id'],'UserId':_0x14fe0d[_0x698a('0xcd')]['id'],'ContactId':_0x20b20c['id']}))[_0x698a('0x20')](function(_0x238775){_0x569df3['dataValues']['Messages']=[];_0x569df3['dataValues']['Messages'][_0x698a('0xa9')](_0x238775[_0x698a('0xd1')]);return _0x569df3;});})[_0x698a('0x20')](respondWithResult(_0x58f89f,null))['catch'](handleError(_0x58f89f,null));};exports[_0x698a('0x2c')]=function(_0x455b49,_0x2e29ed,_0x36c83c){if(_0x455b49[_0x698a('0x5e')]['id']){delete _0x455b49[_0x698a('0x5e')]['id'];}var _0xa6d770,_0x4e0fc4,_0xff2495;return db['SmsAccount'][_0x698a('0x5c')]({'where':{'id':_0x455b49[_0x698a('0x59')]['id']}})[_0x698a('0x20')](handleEntityNotFound(_0x2e29ed,null))['then'](function(_0x51c0ee){if(_0x51c0ee){_0xff2495=_0x51c0ee;logger[_0x698a('0x24')](_0x698a('0xb6'),_0x698a('0x2c'),_0x698a('0xd2'),_0x51c0ee[_0x698a('0x43')],util[_0x698a('0xd3')](_0x455b49[_0x698a('0x5e')],{'showHidden':![],'depth':null}));switch(_0x51c0ee[_0x698a('0x43')]){case _0x698a('0x89'):if(_0x455b49[_0x698a('0x5e')][_0x698a('0xd4')]&&_0x455b49[_0x698a('0x5e')][_0x698a('0x2c')]){_0x4e0fc4=_0x455b49['body'][_0x698a('0x2c')];return db[_0x698a('0xcf')][_0x698a('0x5c')]({'where':{'messageId':_0x455b49[_0x698a('0x5e')][_0x698a('0xd4')]}});}break;case _0x698a('0xd5'):if(_0x455b49[_0x698a('0x5e')][_0x698a('0xd6')]&&_0x455b49[_0x698a('0x5e')][_0x698a('0xd7')]){_0x4e0fc4=_0x455b49['body'][_0x698a('0xd7')];return db['SmsMessage'][_0x698a('0x5c')]({'where':{'messageId':_0x455b49[_0x698a('0x5e')][_0x698a('0xd6')]}});}break;case _0x698a('0x8b'):if(_0x455b49[_0x698a('0x5e')][_0x698a('0xd8')]&&_0x455b49[_0x698a('0x5e')]['status_code']){_0x4e0fc4=_0x455b49['body']['status_code'];return db['SmsMessage'][_0x698a('0x5c')]({'where':{'messageId':_0x455b49[_0x698a('0x5e')][_0x698a('0xd8')]}});}break;case _0x698a('0x8f'):var _0x237071=_0x455b49['body'][_0x698a('0x90')][0x0];if(_0x237071[_0x698a('0x87')]&&_0x237071['status']['groupName']===_0x698a('0xd9')){_0x4e0fc4=_0x237071[_0x698a('0x2c')][_0x698a('0xda')];return db[_0x698a('0xcf')]['find']({'where':{'messageId':_0x237071[_0x698a('0x87')]}});}break;case'clickatell':if(_0x455b49[_0x698a('0x5e')][_0x698a('0x87')]&&_0x455b49['body'][_0x698a('0x2c')]){_0x4e0fc4=_0x455b49['body'][_0x698a('0x2c')];return db[_0x698a('0xcf')][_0x698a('0x5c')]({'where':{'messageId':_0x455b49[_0x698a('0x5e')]['messageId']}});}break;case _0x698a('0xdb'):if(_0x455b49['body'][0x0]['message']['id']){_0x4e0fc4=_0x455b49[_0x698a('0x5e')][0x0][_0x698a('0x43')];return db[_0x698a('0xcf')]['find']({'where':{'messageId':_0x455b49[_0x698a('0x5e')][0x0][_0x698a('0x28')]['id']}});}break;case'intelepeer':if(_0x455b49[_0x698a('0x5e')][_0x698a('0xdc')]&&_0x455b49[_0x698a('0x5e')][_0x698a('0x2c')]){_0x4e0fc4=_0x455b49[_0x698a('0x5e')]['status'];return db['SmsMessage'][_0x698a('0x5c')]({'where':{'messageId':_0x455b49[_0x698a('0x5e')][_0x698a('0xdc')]}});}break;}}})[_0x698a('0x20')](handleEntityNotFound(_0x2e29ed,null))[_0x698a('0x20')](function(_0x56b263){if(_0x56b263){_0xa6d770=_0x56b263;switch(_0xff2495[_0x698a('0x43')]){case'skebby':if(_0x4e0fc4===_0x698a('0xd9')){return _0xa6d770['update']({'read':!![]});}else{logger[_0x698a('0x26')](_0x698a('0xb6'),_0x698a('0x2c'),_0x698a('0x89'),util[_0x698a('0xd3')](_0x455b49[_0x698a('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x698a('0xd5'):if(_0x4e0fc4==='1'){return _0xa6d770[_0x698a('0x38')]({'read':!![]});}else{logger[_0x698a('0x26')](_0x698a('0xb6'),_0x698a('0x2c'),_0x698a('0x89'),util[_0x698a('0xd3')](_0x455b49[_0x698a('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x698a('0x8b'):if(!_0x455b49[_0x698a('0x5e')]['error_code']&&_0x4e0fc4>=0xc8&&_0x4e0fc4<=0xce){return _0xa6d770[_0x698a('0x38')]({'read':!![]});}else{logger['error'](_0x698a('0xb6'),_0x698a('0x2c'),_0x698a('0x8b'),util['inspect'](_0x455b49['body'],{'showHidden':![],'depth':null}));}break;case _0x698a('0x8f'):var _0x2ded8c=_0x455b49[_0x698a('0x5e')][_0x698a('0x90')][0x0];if(_0x2ded8c[_0x698a('0x2c')]['groupName']===_0x698a('0xd9')){return _0xa6d770['update']({'read':!![]});}else{logger['error'](_0x698a('0xb6'),_0x698a('0x2c'),_0x698a('0x8f'),util[_0x698a('0xd3')](_0x455b49[_0x698a('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x698a('0x94'):if(_0x4e0fc4=='DELIVERED_TO_GATEWAY'||_0x4e0fc4=='RECEIVED_BY_RECIPIENT'){return _0xa6d770['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x698a('0x2c'),_0x698a('0x94'),util[_0x698a('0xd3')](_0x455b49['body'],{'showHidden':![],'depth':null}));}break;case _0x698a('0xdb'):if(_0x4e0fc4==_0x698a('0xdd')){return _0xa6d770[_0x698a('0x38')]({'read':!![]});}else{logger[_0x698a('0x26')](_0x698a('0xb6'),_0x698a('0x2c'),_0x698a('0xdb'),util['inspect'](_0x455b49[_0x698a('0x5e')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x4e0fc4==='DELIVRD'||_0x4e0fc4===_0x698a('0xde')){return _0xa6d770[_0x698a('0x38')]({'read':!![]});}else{logger['error'](_0x698a('0xb6'),_0x698a('0x2c'),_0x698a('0x97'),util[_0x698a('0xd3')](_0x455b49[_0x698a('0x5e')],{'showHidden':![],'depth':null}));}break;}return _0xa6d770;}})['then'](respondWithResult(_0x2e29ed,null))[_0x698a('0x2a')](handleError(_0x2e29ed,null));};exports[_0x698a('0xdf')]=function(_0x582cbe,_0x1d6d73,_0x27c634){var _0x37ce03,_0x43e9be,_0x1d2aa0;return db[_0x698a('0x40')][_0x698a('0x5c')]({'where':{'id':_0x582cbe['params']['id']}})[_0x698a('0x20')](handleEntityNotFound(_0x1d6d73,null))[_0x698a('0x20')](function(_0x36af7c){if(_0x36af7c){_0x1d2aa0=_0x36af7c;logger[_0x698a('0x24')](_0x698a('0xb6'),_0x698a('0x2c'),'received\x20delivery\x20report\x20from',_0x36af7c[_0x698a('0x43')],util[_0x698a('0xd3')](_0x582cbe[_0x698a('0x45')],{'showHidden':![],'depth':null}));switch(_0x36af7c[_0x698a('0x43')]){case _0x698a('0x92'):if(_0x582cbe[_0x698a('0x45')]['message-id']&&_0x582cbe[_0x698a('0x45')][_0x698a('0xe0')]){_0x43e9be=_0x582cbe['query']['state'];return db[_0x698a('0xcf')][_0x698a('0x5c')]({'where':{'messageId':_0x582cbe[_0x698a('0x45')][_0x698a('0xe1')]}});}break;}}})[_0x698a('0x20')](handleEntityNotFound(_0x1d6d73,null))[_0x698a('0x20')](function(_0x18a378){if(_0x18a378){_0x37ce03=_0x18a378;switch(_0x1d2aa0[_0x698a('0x43')]){case _0x698a('0x92'):if(_0x43e9be==='2'||_0x43e9be==='6'){return _0x37ce03[_0x698a('0x38')]({'read':!![]});}else{logger[_0x698a('0x26')](_0x698a('0xb6'),'status',_0x698a('0x92'),util[_0x698a('0xd3')](_0x582cbe['query'],{'showHidden':![],'depth':null}));};break;}return _0x37ce03;}})[_0x698a('0x20')](respondWithResult(_0x1d6d73,null))['catch'](handleError(_0x1d6d73,null));};exports['addAgents']=function(_0x5a0d74,_0x4405fc,_0x1c8cb8){return db[_0x698a('0x40')][_0x698a('0x5c')]({'where':{'id':_0x5a0d74[_0x698a('0x59')]['id']}})[_0x698a('0x20')](handleEntityNotFound(_0x4405fc,null))[_0x698a('0x20')](function(_0x530566){if(_0x530566){return _0x530566['addAgents'](_0x5a0d74[_0x698a('0x5e')][_0x698a('0x6e')],_[_0x698a('0xa2')](_0x5a0d74['body'],['ids','id'])||{})[_0x698a('0xa6')](function(_0x2edd2a){for(var _0x2c88ec=0x0;_0x2c88ec<_0x5a0d74[_0x698a('0x5e')][_0x698a('0x6e')][_0x698a('0x5a')];_0x2c88ec+=0x1){socket[_0x698a('0xe2')](_0x698a('0xe3'),{'UserId':Number(_0x5a0d74[_0x698a('0x5e')][_0x698a('0x6e')][_0x2c88ec]),'SmsAccountId':Number(_0x5a0d74['params']['id'])});}return _0x2edd2a;});}})['then'](respondWithResult(_0x4405fc,null))[_0x698a('0x2a')](handleError(_0x4405fc,null));};exports[_0x698a('0xe4')]=function(_0x50e16f,_0x2fe867,_0x30169c){return db[_0x698a('0x40')][_0x698a('0x5c')]({'where':{'id':_0x50e16f[_0x698a('0x59')]['id']}})[_0x698a('0x20')](handleEntityNotFound(_0x2fe867,null))[_0x698a('0x20')](function(_0x50396e){if(_0x50396e){return _0x50396e[_0x698a('0xe4')](_0x50e16f[_0x698a('0x45')][_0x698a('0x6e')])[_0x698a('0x20')](function(){if(_[_0x698a('0xe5')](_0x50e16f[_0x698a('0x45')]['ids'])){for(var _0x319ca2=0x0;_0x319ca2<_0x50e16f['query'][_0x698a('0x6e')][_0x698a('0x5a')];_0x319ca2+=0x1){socket[_0x698a('0xe2')]('userSmsAccount:remove',{'UserId':Number(_0x50e16f[_0x698a('0x45')][_0x698a('0x6e')][_0x319ca2]),'SmsAccountId':Number(_0x50e16f[_0x698a('0x59')]['id'])});}}else{socket[_0x698a('0xe2')](_0x698a('0xe6'),{'UserId':Number(_0x50e16f['query'][_0x698a('0x6e')]),'SmsAccountId':Number(_0x50e16f[_0x698a('0x59')]['id'])});}});}})[_0x698a('0x20')](respondWithStatusCode(_0x2fe867,null))['catch'](handleError(_0x2fe867,null));};exports[_0x698a('0xe7')]=function(_0x139d1b,_0x5af00e,_0x3bb3f3){var _0x94c6d4={};var _0x5228c4={};var _0x442a4d;var _0x2380aa;return db[_0x698a('0x40')][_0x698a('0x6a')]({'where':{'id':_0x139d1b['params']['id']}})['then'](handleEntityNotFound(_0x5af00e,null))['then'](function(_0x2bdff1){if(_0x2bdff1){_0x442a4d=_0x2bdff1;_0x5228c4[_0x698a('0x49')]=_[_0x698a('0x46')](db['User'][_0x698a('0x41')]);_0x5228c4[_0x698a('0x45')]=_['keys'](_0x139d1b['query']);_0x5228c4['filters']=_['intersection'](_0x5228c4[_0x698a('0x49')],_0x5228c4[_0x698a('0x45')]);_0x94c6d4[_0x698a('0x4b')]=_[_0x698a('0x48')](_0x5228c4[_0x698a('0x49')],qs['fields'](_0x139d1b['query'][_0x698a('0x4a')]));_0x94c6d4['attributes']=_0x94c6d4[_0x698a('0x4b')][_0x698a('0x5a')]?_0x94c6d4['attributes']:_0x5228c4['model'];_0x94c6d4[_0x698a('0x6b')]=qs['sort'](_0x139d1b[_0x698a('0x45')][_0x698a('0x4e')]);_0x94c6d4[_0x698a('0x4f')]=qs[_0x698a('0x47')](_[_0x698a('0x50')](_0x139d1b[_0x698a('0x45')],_0x5228c4['filters']));if(_0x139d1b[_0x698a('0x45')]['filter']){_0x94c6d4[_0x698a('0x4f')]=_['merge'](_0x94c6d4[_0x698a('0x4f')],{'$or':_[_0x698a('0x52')](_0x94c6d4[_0x698a('0x4b')],function(_0x8b685f){var _0x5a126f={};_0x5a126f[_0x8b685f]={'$like':'%'+_0x139d1b['query'][_0x698a('0x54')]+'%'};return _0x5a126f;})});}_0x94c6d4=_[_0x698a('0x51')]({},_0x94c6d4,_0x139d1b[_0x698a('0x55')]);return _0x442a4d[_0x698a('0xe7')](_0x94c6d4);}})[_0x698a('0x20')](function(_0x541b17){if(_0x541b17){_0x2380aa=_0x541b17[_0x698a('0x5a')];if(!_0x139d1b['query']['hasOwnProperty']('nolimit')){_0x94c6d4[_0x698a('0x2f')]=qs['limit'](_0x139d1b[_0x698a('0x45')][_0x698a('0x2f')]);_0x94c6d4['offset']=qs['offset'](_0x139d1b[_0x698a('0x45')][_0x698a('0x31')]);}return _0x442a4d[_0x698a('0xe7')](_0x94c6d4);}})[_0x698a('0x20')](function(_0x311dac){if(_0x311dac){return _0x311dac?{'count':_0x2380aa,'rows':_0x311dac}:null;}})['then'](respondWithResult(_0x5af00e,null))[_0x698a('0x2a')](handleError(_0x5af00e,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 6cb9019..bda2bbd 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 _0x0d3a=['../../mysqldb','SmsAccount','setMaxListeners','save','update','emit','hook','exports','events'];(function(_0x30fba8,_0x268987){var _0x28fd27=function(_0x518d39){while(--_0x518d39){_0x30fba8['push'](_0x30fba8['shift']());}};_0x28fd27(++_0x268987);}(_0x0d3a,0x131));var _0xa0d3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0d3a[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0xa0d3('0x0'));var SmsAccount=require(_0xa0d3('0x1'))['db'][_0xa0d3('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xa0d3('0x3')](0x0);var events={'afterCreate':_0xa0d3('0x4'),'afterUpdate':_0xa0d3('0x5'),'afterDestroy':'remove'};function emitEvent(_0xa01982){return function(_0x332081,_0x2dfc58,_0x26515a){SmsAccountEvents[_0xa0d3('0x6')](_0xa01982+':'+_0x332081['id'],_0x332081);SmsAccountEvents[_0xa0d3('0x6')](_0xa01982,_0x332081);_0x26515a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0xa0d3('0x7')](e,emitEvent(event));}}module[_0xa0d3('0x8')]=SmsAccountEvents; \ No newline at end of file +var _0x0471=['hook','../../mysqldb','SmsAccount','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x3a9661,_0x530b12){var _0x5bb119=function(_0x1278f){while(--_0x1278f){_0x3a9661['push'](_0x3a9661['shift']());}};_0x5bb119(++_0x530b12);}(_0x0471,0x121));var _0x1047=function(_0x205d83,_0xc9a06b){_0x205d83=_0x205d83-0x0;var _0x15ac78=_0x0471[_0x205d83];return _0x15ac78;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x1047('0x0'))['db'][_0x1047('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x1047('0x2')](0x0);var events={'afterCreate':_0x1047('0x3'),'afterUpdate':_0x1047('0x4'),'afterDestroy':'remove'};function emitEvent(_0x16f5c6){return function(_0x345ee0,_0x541598,_0x17a170){SmsAccountEvents[_0x1047('0x5')](_0x16f5c6+':'+_0x345ee0['id'],_0x345ee0);SmsAccountEvents['emit'](_0x16f5c6,_0x345ee0);_0x17a170(null);};}for(var e in events){if(events[_0x1047('0x6')](e)){var event=events[e];SmsAccount[_0x1047('0x7')](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 6cea855..a4f117a 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 _0x0f34=['request-promise','rimraf','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','lodash','api','moment'];(function(_0x39cf70,_0x3ec55b){var _0x580424=function(_0x580a4e){while(--_0x580a4e){_0x39cf70['push'](_0x39cf70['shift']());}};_0x580424(++_0x3ec55b);}(_0x0f34,0x1dd));var _0x40f3=function(_0x4ef8a0,_0x4bbbcb){_0x4ef8a0=_0x4ef8a0-0x0;var _0x11c017=_0x0f34[_0x4ef8a0];return _0x11c017;};'use strict';var _=require(_0x40f3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x40f3('0x1'));var moment=require(_0x40f3('0x2'));var BPromise=require('bluebird');var rp=require(_0x40f3('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x40f3('0x4'));var config=require('../../config/environment');var attributes=require(_0x40f3('0x5'));module[_0x40f3('0x6')]=function(_0x257874,_0x1a1f1f){return _0x257874[_0x40f3('0x7')](_0x40f3('0x8'),attributes,{'tableName':_0x40f3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4d4a=['moment','bluebird','request-promise','path','rimraf','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','lodash','api'];(function(_0xd35d49,_0x154f41){var _0x545e1f=function(_0x55ac42){while(--_0x55ac42){_0xd35d49['push'](_0xd35d49['shift']());}};_0x545e1f(++_0x154f41);}(_0x4d4a,0x166));var _0xa4d4=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4d4a[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xa4d4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa4d4('0x1'));var moment=require(_0xa4d4('0x2'));var BPromise=require(_0xa4d4('0x3'));var rp=require(_0xa4d4('0x4'));var fs=require('fs');var path=require(_0xa4d4('0x5'));var rimraf=require(_0xa4d4('0x6'));var config=require('../../config/environment');var attributes=require(_0xa4d4('0x7'));module[_0xa4d4('0x8')]=function(_0x10808d,_0xfa906f){return _0x10808d[_0xa4d4('0x9')](_0xa4d4('0xa'),attributes,{'tableName':_0xa4d4('0xb'),'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 e5ba6d3..51e8d82 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 _0xb148=['include','ShowSmsAccount','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','then','info','SmsAccount,\x20%s,\x20%s','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','find','options','raw','where','map','model','attributes'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xb148,0x1e3));var _0x8b14=function(_0x38aeea,_0x57522a){_0x38aeea=_0x38aeea-0x0;var _0x5e8d2c=_0xb148[_0x38aeea];return _0x5e8d2c;};'use strict';var _=require(_0x8b14('0x0'));var util=require(_0x8b14('0x1'));var moment=require(_0x8b14('0x2'));var BPromise=require('bluebird');var rs=require(_0x8b14('0x3'));var fs=require('fs');var Redis=require(_0x8b14('0x4'));var db=require(_0x8b14('0x5'))['db'];var utils=require(_0x8b14('0x6'));var logger=require(_0x8b14('0x7'))(_0x8b14('0x8'));var config=require(_0x8b14('0x9'));var jayson=require(_0x8b14('0xa'));var client=jayson[_0x8b14('0xb')][_0x8b14('0xc')]({'port':0x232a});config[_0x8b14('0xd')]=_[_0x8b14('0xe')](config[_0x8b14('0xd')],{'host':_0x8b14('0xf'),'port':0x18eb});var socket=require(_0x8b14('0x10'))(new Redis(config[_0x8b14('0xd')]));require(_0x8b14('0x11'))[_0x8b14('0x12')](socket);function respondWithRpcPromise(_0x53b0f8,_0x59bad2,_0xd6aded){return new BPromise(function(_0x8bfe68,_0x36edfd){return client['request'](_0x53b0f8,_0xd6aded)[_0x8b14('0x13')](function(_0x429de0){logger[_0x8b14('0x14')](_0x8b14('0x15'),_0x59bad2,'request\x20sent');logger['debug'](_0x8b14('0x16'),_0x59bad2,'request\x20sent',JSON[_0x8b14('0x17')](_0x429de0));if(_0x429de0[_0x8b14('0x18')]){if(_0x429de0['error'][_0x8b14('0x19')]===0x1f4){logger[_0x8b14('0x18')](_0x8b14('0x15'),_0x59bad2,_0x429de0[_0x8b14('0x18')][_0x8b14('0x1a')]);return _0x36edfd(_0x429de0[_0x8b14('0x18')]['message']);}logger[_0x8b14('0x18')]('SmsAccount,\x20%s,\x20%s',_0x59bad2,_0x429de0[_0x8b14('0x18')][_0x8b14('0x1a')]);return _0x8bfe68(_0x429de0[_0x8b14('0x18')]['message']);}else{logger[_0x8b14('0x14')](_0x8b14('0x15'),_0x59bad2,_0x8b14('0x1b'));_0x8bfe68(_0x429de0[_0x8b14('0x1c')]['message']);}})[_0x8b14('0x1d')](function(_0x3e6a52){logger['error'](_0x8b14('0x15'),_0x59bad2,_0x3e6a52);_0x36edfd(_0x3e6a52);});});}exports['ShowSmsAccount']=function(_0x5c449f){var _0x3bb67a=this;return new Promise(function(_0x18ff5d,_0x9a1cd4){return db['SmsAccount'][_0x8b14('0x1e')]({'raw':_0x5c449f[_0x8b14('0x1f')]?_0x5c449f['options'][_0x8b14('0x20')]===undefined?!![]:![]:!![],'where':_0x5c449f['options']?_0x5c449f['options'][_0x8b14('0x21')]||null:null,'attributes':_0x5c449f[_0x8b14('0x1f')]?_0x5c449f[_0x8b14('0x1f')]['attributes']||null:null,'include':_0x5c449f[_0x8b14('0x1f')]?_0x5c449f[_0x8b14('0x1f')]['include']?_[_0x8b14('0x22')](_0x5c449f['options']['include'],function(_0x4255b6){return{'model':db[_0x4255b6[_0x8b14('0x23')]],'as':_0x4255b6['as'],'attributes':_0x4255b6[_0x8b14('0x24')],'include':_0x4255b6[_0x8b14('0x25')]?_[_0x8b14('0x22')](_0x4255b6[_0x8b14('0x25')],function(_0x5ae6b9){return{'model':db[_0x5ae6b9['model']],'as':_0x5ae6b9['as'],'attributes':_0x5ae6b9[_0x8b14('0x24')],'include':_0x5ae6b9['include']?_['map'](_0x5ae6b9[_0x8b14('0x25')],function(_0x255f06){return{'model':db[_0x255f06[_0x8b14('0x23')]],'as':_0x255f06['as'],'attributes':_0x255f06['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2537e0){logger[_0x8b14('0x14')](_0x8b14('0x26'),_0x5c449f);logger[_0x8b14('0x27')](_0x8b14('0x26'),_0x5c449f,JSON[_0x8b14('0x17')](_0x2537e0));_0x18ff5d(_0x2537e0);})[_0x8b14('0x1d')](function(_0x4ee34f){logger[_0x8b14('0x18')]('ShowSmsAccount',_0x4ee34f[_0x8b14('0x1a')],_0x5c449f);_0x9a1cd4(_0x3bb67a[_0x8b14('0x18')](0x1f4,_0x4ee34f[_0x8b14('0x1a')]));});});}; \ No newline at end of file +var _0x9ea0=['jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SmsAccount','find','options','raw','where','attributes','include','map','model','ShowSmsAccount','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2af936,_0x23d8e2){var _0x15d318=function(_0xaaddc){while(--_0xaaddc){_0x2af936['push'](_0x2af936['shift']());}};_0x15d318(++_0x23d8e2);}(_0x9ea0,0xba));var _0x09ea=function(_0x38c0f8,_0x527e6c){_0x38c0f8=_0x38c0f8-0x0;var _0x12e5ab=_0x9ea0[_0x38c0f8];return _0x12e5ab;};'use strict';var _=require(_0x09ea('0x0'));var util=require(_0x09ea('0x1'));var moment=require(_0x09ea('0x2'));var BPromise=require('bluebird');var rs=require(_0x09ea('0x3'));var fs=require('fs');var Redis=require(_0x09ea('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x09ea('0x5'));var logger=require(_0x09ea('0x6'))(_0x09ea('0x7'));var config=require(_0x09ea('0x8'));var jayson=require(_0x09ea('0x9'));var client=jayson[_0x09ea('0xa')][_0x09ea('0xb')]({'port':0x232a});config[_0x09ea('0xc')]=_[_0x09ea('0xd')](config[_0x09ea('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x09ea('0xe'))(new Redis(config[_0x09ea('0xc')]));require('./smsAccount.socket')[_0x09ea('0xf')](socket);function respondWithRpcPromise(_0x3ae9b0,_0x5691bf,_0x17e5aa){return new BPromise(function(_0x5a16d4,_0x5b7c2f){return client[_0x09ea('0x10')](_0x3ae9b0,_0x17e5aa)[_0x09ea('0x11')](function(_0x29fe12){logger[_0x09ea('0x12')](_0x09ea('0x13'),_0x5691bf,_0x09ea('0x14'));logger[_0x09ea('0x15')](_0x09ea('0x16'),_0x5691bf,_0x09ea('0x14'),JSON[_0x09ea('0x17')](_0x29fe12));if(_0x29fe12['error']){if(_0x29fe12[_0x09ea('0x18')][_0x09ea('0x19')]===0x1f4){logger[_0x09ea('0x18')](_0x09ea('0x13'),_0x5691bf,_0x29fe12[_0x09ea('0x18')][_0x09ea('0x1a')]);return _0x5b7c2f(_0x29fe12[_0x09ea('0x18')][_0x09ea('0x1a')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x5691bf,_0x29fe12[_0x09ea('0x18')][_0x09ea('0x1a')]);return _0x5a16d4(_0x29fe12[_0x09ea('0x18')]['message']);}else{logger[_0x09ea('0x12')](_0x09ea('0x13'),_0x5691bf,_0x09ea('0x14'));_0x5a16d4(_0x29fe12[_0x09ea('0x1b')][_0x09ea('0x1a')]);}})[_0x09ea('0x1c')](function(_0x345dd9){logger[_0x09ea('0x18')](_0x09ea('0x13'),_0x5691bf,_0x345dd9);_0x5b7c2f(_0x345dd9);});});}exports['ShowSmsAccount']=function(_0x51cd2d){var _0x344b4e=this;return new Promise(function(_0x1b416d,_0x56a6c0){return db[_0x09ea('0x1d')][_0x09ea('0x1e')]({'raw':_0x51cd2d[_0x09ea('0x1f')]?_0x51cd2d['options'][_0x09ea('0x20')]===undefined?!![]:![]:!![],'where':_0x51cd2d[_0x09ea('0x1f')]?_0x51cd2d[_0x09ea('0x1f')][_0x09ea('0x21')]||null:null,'attributes':_0x51cd2d['options']?_0x51cd2d[_0x09ea('0x1f')][_0x09ea('0x22')]||null:null,'include':_0x51cd2d['options']?_0x51cd2d[_0x09ea('0x1f')][_0x09ea('0x23')]?_[_0x09ea('0x24')](_0x51cd2d[_0x09ea('0x1f')][_0x09ea('0x23')],function(_0x21902d){return{'model':db[_0x21902d[_0x09ea('0x25')]],'as':_0x21902d['as'],'attributes':_0x21902d['attributes'],'include':_0x21902d[_0x09ea('0x23')]?_[_0x09ea('0x24')](_0x21902d[_0x09ea('0x23')],function(_0x595d00){return{'model':db[_0x595d00[_0x09ea('0x25')]],'as':_0x595d00['as'],'attributes':_0x595d00['attributes'],'include':_0x595d00[_0x09ea('0x23')]?_['map'](_0x595d00['include'],function(_0xec660){return{'model':db[_0xec660[_0x09ea('0x25')]],'as':_0xec660['as'],'attributes':_0xec660[_0x09ea('0x22')]};}):[]};}):[]};}):[]:[]})[_0x09ea('0x11')](function(_0x4660a1){logger['info']('ShowSmsAccount',_0x51cd2d);logger['debug']('ShowSmsAccount',_0x51cd2d,JSON['stringify'](_0x4660a1));_0x1b416d(_0x4660a1);})[_0x09ea('0x1c')](function(_0x4a12eb){logger[_0x09ea('0x18')](_0x09ea('0x26'),_0x4a12eb[_0x09ea('0x1a')],_0x51cd2d);_0x56a6c0(_0x344b4e['error'](0x1f4,_0x4a12eb[_0x09ea('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index d3d8ef1..9c36c52 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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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 21f1161..b48538e 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 _0xedd9=['post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x2dad77,_0x5d6107){var _0x5127e1=function(_0x5bafc4){while(--_0x5bafc4){_0x2dad77['push'](_0x2dad77['shift']());}};_0x5127e1(++_0x5d6107);}(_0xedd9,0xfc));var _0x9edd=function(_0x554b62,_0x284c76){_0x554b62=_0x554b62-0x0;var _0x3a50dc=_0xedd9[_0x554b62];return _0x3a50dc;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0xe')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['put'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);module['exports']=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(_0x42b5fe,_0x59ee80){var _0x4b7be2=function(_0x2806a){while(--_0x2806a){_0x42b5fe['push'](_0x42b5fe['shift']());}};_0x4b7be2(++_0x59ee80);}(_0x3e74,0x175));var _0x43e7=function(_0x23617f,_0x1bee44){_0x23617f=_0x23617f-0x0;var _0x5b897c=_0x3e74[_0x23617f];return _0x5b897c;};'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 ba86274..472a2ca 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 _0x34c1=['STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x34c1,0x16c));var _0x134c=function(_0x53b16b,_0x2a6550){_0x53b16b=_0x53b16b-0x0;var _0x5d10f3=_0x34c1[_0x53b16b];return _0x5d10f3;};'use strict';var Sequelize=require(_0x134c('0x0'));module[_0x134c('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x134c('0x2')],'allowNull':![],'defaultValue':_0x134c('0x3')},'appdata':{'type':Sequelize[_0x134c('0x4')]()},'description':{'type':Sequelize[_0x134c('0x2')]},'interval':{'type':Sequelize[_0x134c('0x2')],'defaultValue':_0x134c('0x5')}}; \ No newline at end of file +var _0x3966=['INTEGER','noop','TEXT','STRING','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3966,0x117));var _0x6396=function(_0x2aacd9,_0x5d455d){_0x2aacd9=_0x2aacd9-0x0;var _0x37bdd6=_0x3966[_0x2aacd9];return _0x37bdd6;};'use strict';var Sequelize=require('sequelize');module[_0x6396('0x0')]={'priority':{'type':Sequelize[_0x6396('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6396('0x2')},'appdata':{'type':Sequelize[_0x6396('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x6396('0x4')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index b2c72f3..601d590 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 _0x8a59=['filters','filter','merge','VIRTUAL','SmsApplication','includeAll','include','findAll','catch','show','keys','options','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','rawAttributes','fieldName','type','model','query','attributes','intersection','fields','length','nolimit','order','sort','where','pick'];(function(_0x567b39,_0x1dc05f){var _0x14fa4f=function(_0x222101){while(--_0x222101){_0x567b39['push'](_0x567b39['shift']());}};_0x14fa4f(++_0x1dc05f);}(_0x8a59,0xf1));var _0x98a5=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0x8a59[_0x2cf2e9];return _0xd3670d;};'use strict';var emlformat=require(_0x98a5('0x0'));var rimraf=require(_0x98a5('0x1'));var zipdir=require(_0x98a5('0x2'));var jsonpatch=require(_0x98a5('0x3'));var rp=require(_0x98a5('0x4'));var moment=require(_0x98a5('0x5'));var BPromise=require(_0x98a5('0x6'));var Mustache=require(_0x98a5('0x7'));var util=require(_0x98a5('0x8'));var path=require(_0x98a5('0x9'));var sox=require('sox');var csv=require(_0x98a5('0xa'));var ejs=require(_0x98a5('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x98a5('0xc'));var squel=require(_0x98a5('0xd'));var crypto=require(_0x98a5('0xe'));var jsforce=require(_0x98a5('0xf'));var deskjs=require(_0x98a5('0x10'));var toCsv=require(_0x98a5('0xa'));var querystring=require('querystring');var Papa=require(_0x98a5('0x11'));var Redis=require(_0x98a5('0x12'));var authService=require(_0x98a5('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x98a5('0x14'))(_0x98a5('0x15'));var utils=require(_0x98a5('0x16'));var config=require(_0x98a5('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x98a5('0x18'))['db'];function respondWithStatusCode(_0x526a84,_0x146e56){_0x146e56=_0x146e56||0xcc;return function(_0x26f329){if(_0x26f329){return _0x526a84[_0x98a5('0x19')](_0x146e56);}return _0x526a84['status'](_0x146e56)[_0x98a5('0x1a')]();};}function respondWithResult(_0x45715f,_0x1c16ee){_0x1c16ee=_0x1c16ee||0xc8;return function(_0x3f5033){if(_0x3f5033){return _0x45715f[_0x98a5('0x1b')](_0x1c16ee)[_0x98a5('0x1c')](_0x3f5033);}};}function respondWithFilteredResult(_0x41524a,_0x3c18dc){return function(_0x3f3c8f){if(_0x3f3c8f){var _0x38a945=typeof _0x3c18dc[_0x98a5('0x1d')]===_0x98a5('0x1e')&&typeof _0x3c18dc['limit']===_0x98a5('0x1e');var _0x2c5d95=_0x3f3c8f[_0x98a5('0x1f')];var _0x1b4dec=_0x38a945?0x0:_0x3c18dc[_0x98a5('0x1d')];var _0x2eef27=_0x38a945?_0x3f3c8f['count']:_0x3c18dc[_0x98a5('0x1d')]+_0x3c18dc[_0x98a5('0x20')];var _0x3ba9c4;if(_0x2eef27>=_0x2c5d95){_0x2eef27=_0x2c5d95;_0x3ba9c4=0xc8;}else{_0x3ba9c4=0xce;}_0x41524a[_0x98a5('0x1b')](_0x3ba9c4);return _0x41524a[_0x98a5('0x21')](_0x98a5('0x22'),_0x1b4dec+'-'+_0x2eef27+'/'+_0x2c5d95)[_0x98a5('0x1c')](_0x3f3c8f);}return null;};}function patchUpdates(_0x32b60b){return function(_0x31f650){try{jsonpatch[_0x98a5('0x23')](_0x31f650,_0x32b60b,!![]);}catch(_0x44f82e){return BPromise[_0x98a5('0x24')](_0x44f82e);}return _0x31f650[_0x98a5('0x25')]();};}function saveUpdates(_0x453d3b,_0x540d2c){return function(_0x3e5d77){if(_0x3e5d77){return _0x3e5d77[_0x98a5('0x26')](_0x453d3b)[_0x98a5('0x27')](function(_0x940ba7){return _0x940ba7;});}return null;};}function removeEntity(_0x213f80,_0x38117e){return function(_0x595038){if(_0x595038){return _0x595038[_0x98a5('0x28')]()[_0x98a5('0x27')](function(){_0x213f80[_0x98a5('0x1b')](0xcc)[_0x98a5('0x1a')]();});}};}function handleEntityNotFound(_0x256f39,_0x143158){return function(_0x318ba6){if(!_0x318ba6){_0x256f39[_0x98a5('0x19')](0x194);}return _0x318ba6;};}function handleError(_0x2e268a,_0x5606fe){_0x5606fe=_0x5606fe||0x1f4;return function(_0x2ecfbb){logger['error'](_0x2ecfbb[_0x98a5('0x29')]);if(_0x2ecfbb[_0x98a5('0x2a')]){delete _0x2ecfbb[_0x98a5('0x2a')];}_0x2e268a['status'](_0x5606fe)[_0x98a5('0x2b')](_0x2ecfbb);};}exports['index']=function(_0x7c342,_0xf514ad){var _0x109ea7={},_0x50db2e={},_0x2923f5={'count':0x0,'rows':[]};var _0x5f410d=_[_0x98a5('0x2c')](db['SmsApplication'][_0x98a5('0x2d')],function(_0x22ec23){return{'name':_0x22ec23[_0x98a5('0x2e')],'type':_0x22ec23[_0x98a5('0x2f')]['key']};});_0x50db2e[_0x98a5('0x30')]=_[_0x98a5('0x2c')](_0x5f410d,_0x98a5('0x2a'));_0x50db2e[_0x98a5('0x31')]=_['keys'](_0x7c342[_0x98a5('0x31')]);_0x50db2e['filters']=_['intersection'](_0x50db2e['model'],_0x50db2e[_0x98a5('0x31')]);_0x109ea7[_0x98a5('0x32')]=_[_0x98a5('0x33')](_0x50db2e[_0x98a5('0x30')],qs[_0x98a5('0x34')](_0x7c342[_0x98a5('0x31')][_0x98a5('0x34')]));_0x109ea7[_0x98a5('0x32')]=_0x109ea7[_0x98a5('0x32')][_0x98a5('0x35')]?_0x109ea7[_0x98a5('0x32')]:_0x50db2e[_0x98a5('0x30')];if(!_0x7c342[_0x98a5('0x31')]['hasOwnProperty'](_0x98a5('0x36'))){_0x109ea7['limit']=qs[_0x98a5('0x20')](_0x7c342[_0x98a5('0x31')][_0x98a5('0x20')]);_0x109ea7['offset']=qs[_0x98a5('0x1d')](_0x7c342[_0x98a5('0x31')]['offset']);}_0x109ea7[_0x98a5('0x37')]=qs[_0x98a5('0x38')](_0x7c342[_0x98a5('0x31')]['sort']);_0x109ea7[_0x98a5('0x39')]=qs['filters'](_[_0x98a5('0x3a')](_0x7c342[_0x98a5('0x31')],_0x50db2e[_0x98a5('0x3b')]),_0x5f410d);if(_0x7c342[_0x98a5('0x31')][_0x98a5('0x3c')]){_0x109ea7['where']=_[_0x98a5('0x3d')](_0x109ea7['where'],{'$or':_['map'](_0x5f410d,function(_0x218e38){if(_0x218e38[_0x98a5('0x2f')]!==_0x98a5('0x3e')){var _0x29f7c3={};_0x29f7c3[_0x218e38[_0x98a5('0x2a')]]={'$like':'%'+_0x7c342[_0x98a5('0x31')]['filter']+'%'};return _0x29f7c3;}})});}_0x109ea7=_[_0x98a5('0x3d')]({},_0x109ea7,_0x7c342['options']);var _0x48c1ee={'where':_0x109ea7[_0x98a5('0x39')]};return db[_0x98a5('0x3f')][_0x98a5('0x1f')](_0x48c1ee)['then'](function(_0x271cd6){_0x2923f5[_0x98a5('0x1f')]=_0x271cd6;if(_0x7c342[_0x98a5('0x31')][_0x98a5('0x40')]){_0x109ea7[_0x98a5('0x41')]=[{'all':!![]}];}return db[_0x98a5('0x3f')][_0x98a5('0x42')](_0x109ea7);})[_0x98a5('0x27')](function(_0x500412){_0x2923f5['rows']=_0x500412;return _0x2923f5;})[_0x98a5('0x27')](respondWithFilteredResult(_0xf514ad,_0x109ea7))[_0x98a5('0x43')](handleError(_0xf514ad,null));};exports[_0x98a5('0x44')]=function(_0x1326a5,_0x4790d9){var _0x62575d={'raw':!![],'where':{'id':_0x1326a5['params']['id']}},_0x1cf2e4={};_0x1cf2e4[_0x98a5('0x30')]=_['keys'](db[_0x98a5('0x3f')][_0x98a5('0x2d')]);_0x1cf2e4[_0x98a5('0x31')]=_[_0x98a5('0x45')](_0x1326a5['query']);_0x1cf2e4[_0x98a5('0x3b')]=_[_0x98a5('0x33')](_0x1cf2e4[_0x98a5('0x30')],_0x1cf2e4[_0x98a5('0x31')]);_0x62575d[_0x98a5('0x32')]=_[_0x98a5('0x33')](_0x1cf2e4[_0x98a5('0x30')],qs[_0x98a5('0x34')](_0x1326a5[_0x98a5('0x31')][_0x98a5('0x34')]));_0x62575d[_0x98a5('0x32')]=_0x62575d['attributes']['length']?_0x62575d[_0x98a5('0x32')]:_0x1cf2e4[_0x98a5('0x30')];if(_0x1326a5[_0x98a5('0x31')]['includeAll']){_0x62575d[_0x98a5('0x41')]=[{'all':!![]}];}_0x62575d=_[_0x98a5('0x3d')]({},_0x62575d,_0x1326a5[_0x98a5('0x46')]);return db['SmsApplication']['find'](_0x62575d)[_0x98a5('0x27')](handleEntityNotFound(_0x4790d9,null))[_0x98a5('0x27')](respondWithResult(_0x4790d9,null))[_0x98a5('0x43')](handleError(_0x4790d9,null));};exports['create']=function(_0x1aabb8,_0x1f0c1c){return db[_0x98a5('0x3f')][_0x98a5('0x47')](_0x1aabb8[_0x98a5('0x48')],{})['then'](respondWithResult(_0x1f0c1c,0xc9))[_0x98a5('0x43')](handleError(_0x1f0c1c,null));};exports[_0x98a5('0x26')]=function(_0x32efc7,_0x178dde){if(_0x32efc7[_0x98a5('0x48')]['id']){delete _0x32efc7[_0x98a5('0x48')]['id'];}return db[_0x98a5('0x3f')][_0x98a5('0x49')]({'where':{'id':_0x32efc7[_0x98a5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x178dde,null))['then'](saveUpdates(_0x32efc7[_0x98a5('0x48')],null))[_0x98a5('0x27')](respondWithResult(_0x178dde,null))[_0x98a5('0x43')](handleError(_0x178dde,null));};exports[_0x98a5('0x28')]=function(_0x15ac79,_0x5a0498){return db[_0x98a5('0x3f')][_0x98a5('0x49')]({'where':{'id':_0x15ac79[_0x98a5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5a0498,null))['then'](removeEntity(_0x5a0498,null))[_0x98a5('0x43')](handleError(_0x5a0498,null));}; \ No newline at end of file +var _0x536f=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','save','update','then','name','index','SmsApplication','model','map','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','rawAttributes','merge','create','body','destroy','find','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0xc7348b,_0x145880){var _0x307cec=function(_0x4f1554){while(--_0x4f1554){_0xc7348b['push'](_0xc7348b['shift']());}};_0x307cec(++_0x145880);}(_0x536f,0x150));var _0xf536=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x536f[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xf536('0x0'));var rimraf=require(_0xf536('0x1'));var zipdir=require(_0xf536('0x2'));var jsonpatch=require(_0xf536('0x3'));var rp=require('request-promise');var moment=require(_0xf536('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf536('0x5'));var util=require(_0xf536('0x6'));var path=require(_0xf536('0x7'));var sox=require(_0xf536('0x8'));var csv=require(_0xf536('0x9'));var ejs=require(_0xf536('0xa'));var fs=require('fs');var fs_extra=require(_0xf536('0xb'));var _=require('lodash');var squel=require(_0xf536('0xc'));var crypto=require(_0xf536('0xd'));var jsforce=require(_0xf536('0xe'));var deskjs=require(_0xf536('0xf'));var toCsv=require(_0xf536('0x9'));var querystring=require('querystring');var Papa=require(_0xf536('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf536('0x11'));var as=require(_0xf536('0x12'));var hardwareService=require(_0xf536('0x13'));var logger=require(_0xf536('0x14'))(_0xf536('0x15'));var utils=require(_0xf536('0x16'));var config=require(_0xf536('0x17'));var licenseUtil=require(_0xf536('0x18'));var db=require(_0xf536('0x19'))['db'];function respondWithStatusCode(_0x43400f,_0x516cc5){_0x516cc5=_0x516cc5||0xcc;return function(_0x51fa15){if(_0x51fa15){return _0x43400f[_0xf536('0x1a')](_0x516cc5);}return _0x43400f[_0xf536('0x1b')](_0x516cc5)[_0xf536('0x1c')]();};}function respondWithResult(_0x4c6035,_0x371bf4){_0x371bf4=_0x371bf4||0xc8;return function(_0x4507b3){if(_0x4507b3){return _0x4c6035[_0xf536('0x1b')](_0x371bf4)[_0xf536('0x1d')](_0x4507b3);}};}function respondWithFilteredResult(_0x5111e8,_0x1b9ebf){return function(_0x57016f){if(_0x57016f){var _0x374271=typeof _0x1b9ebf[_0xf536('0x1e')]===_0xf536('0x1f')&&typeof _0x1b9ebf['limit']===_0xf536('0x1f');var _0x365b7b=_0x57016f[_0xf536('0x20')];var _0x23491a=_0x374271?0x0:_0x1b9ebf[_0xf536('0x1e')];var _0x20381d=_0x374271?_0x57016f[_0xf536('0x20')]:_0x1b9ebf[_0xf536('0x1e')]+_0x1b9ebf[_0xf536('0x21')];var _0x3256dc;if(_0x20381d>=_0x365b7b){_0x20381d=_0x365b7b;_0x3256dc=0xc8;}else{_0x3256dc=0xce;}_0x5111e8[_0xf536('0x1b')](_0x3256dc);return _0x5111e8['set']('Content-Range',_0x23491a+'-'+_0x20381d+'/'+_0x365b7b)[_0xf536('0x1d')](_0x57016f);}return null;};}function patchUpdates(_0x2def23){return function(_0x5d6c7f){try{jsonpatch[_0xf536('0x22')](_0x5d6c7f,_0x2def23,!![]);}catch(_0xe3100f){return BPromise[_0xf536('0x23')](_0xe3100f);}return _0x5d6c7f[_0xf536('0x24')]();};}function saveUpdates(_0x10f8e2,_0xbf1398){return function(_0xe7fc7a){if(_0xe7fc7a){return _0xe7fc7a[_0xf536('0x25')](_0x10f8e2)[_0xf536('0x26')](function(_0x127c99){return _0x127c99;});}return null;};}function removeEntity(_0x1e08be,_0x1be0cc){return function(_0x2f0e10){if(_0x2f0e10){return _0x2f0e10['destroy']()[_0xf536('0x26')](function(){_0x1e08be[_0xf536('0x1b')](0xcc)[_0xf536('0x1c')]();});}};}function handleEntityNotFound(_0x3afcbc,_0x494a74){return function(_0x114ea4){if(!_0x114ea4){_0x3afcbc[_0xf536('0x1a')](0x194);}return _0x114ea4;};}function handleError(_0x51b376,_0xa5a883){_0xa5a883=_0xa5a883||0x1f4;return function(_0xca2044){logger['error'](_0xca2044['stack']);if(_0xca2044['name']){delete _0xca2044[_0xf536('0x27')];}_0x51b376['status'](_0xa5a883)['send'](_0xca2044);};}exports[_0xf536('0x28')]=function(_0x3c1262,_0x1de0e5){var _0x5bee8d={},_0x5b8297={},_0x28d14f={'count':0x0,'rows':[]};var _0x5540c6=_['map'](db[_0xf536('0x29')]['rawAttributes'],function(_0x104b41){return{'name':_0x104b41['fieldName'],'type':_0x104b41['type']['key']};});_0x5b8297[_0xf536('0x2a')]=_[_0xf536('0x2b')](_0x5540c6,_0xf536('0x27'));_0x5b8297['query']=_['keys'](_0x3c1262[_0xf536('0x2c')]);_0x5b8297['filters']=_[_0xf536('0x2d')](_0x5b8297[_0xf536('0x2a')],_0x5b8297[_0xf536('0x2c')]);_0x5bee8d[_0xf536('0x2e')]=_[_0xf536('0x2d')](_0x5b8297[_0xf536('0x2a')],qs[_0xf536('0x2f')](_0x3c1262[_0xf536('0x2c')][_0xf536('0x2f')]));_0x5bee8d['attributes']=_0x5bee8d[_0xf536('0x2e')]['length']?_0x5bee8d[_0xf536('0x2e')]:_0x5b8297[_0xf536('0x2a')];if(!_0x3c1262['query'][_0xf536('0x30')](_0xf536('0x31'))){_0x5bee8d[_0xf536('0x21')]=qs[_0xf536('0x21')](_0x3c1262['query']['limit']);_0x5bee8d[_0xf536('0x1e')]=qs[_0xf536('0x1e')](_0x3c1262[_0xf536('0x2c')][_0xf536('0x1e')]);}_0x5bee8d[_0xf536('0x32')]=qs['sort'](_0x3c1262['query'][_0xf536('0x33')]);_0x5bee8d[_0xf536('0x34')]=qs[_0xf536('0x35')](_[_0xf536('0x36')](_0x3c1262['query'],_0x5b8297['filters']),_0x5540c6);if(_0x3c1262[_0xf536('0x2c')][_0xf536('0x37')]){_0x5bee8d['where']=_['merge'](_0x5bee8d[_0xf536('0x34')],{'$or':_[_0xf536('0x2b')](_0x5540c6,function(_0x23948f){if(_0x23948f[_0xf536('0x38')]!==_0xf536('0x39')){var _0x1381ca={};_0x1381ca[_0x23948f[_0xf536('0x27')]]={'$like':'%'+_0x3c1262['query'][_0xf536('0x37')]+'%'};return _0x1381ca;}})});}_0x5bee8d=_['merge']({},_0x5bee8d,_0x3c1262[_0xf536('0x3a')]);var _0x2259df={'where':_0x5bee8d[_0xf536('0x34')]};return db[_0xf536('0x29')][_0xf536('0x20')](_0x2259df)['then'](function(_0x3d69bd){_0x28d14f['count']=_0x3d69bd;if(_0x3c1262[_0xf536('0x2c')][_0xf536('0x3b')]){_0x5bee8d[_0xf536('0x3c')]=[{'all':!![]}];}return db[_0xf536('0x29')][_0xf536('0x3d')](_0x5bee8d);})[_0xf536('0x26')](function(_0x366728){_0x28d14f[_0xf536('0x3e')]=_0x366728;return _0x28d14f;})[_0xf536('0x26')](respondWithFilteredResult(_0x1de0e5,_0x5bee8d))[_0xf536('0x3f')](handleError(_0x1de0e5,null));};exports['show']=function(_0x188b37,_0x2f6ccf){var _0x4b110b={'raw':!![],'where':{'id':_0x188b37['params']['id']}},_0x335992={};_0x335992[_0xf536('0x2a')]=_[_0xf536('0x40')](db[_0xf536('0x29')][_0xf536('0x41')]);_0x335992['query']=_[_0xf536('0x40')](_0x188b37[_0xf536('0x2c')]);_0x335992[_0xf536('0x35')]=_[_0xf536('0x2d')](_0x335992[_0xf536('0x2a')],_0x335992['query']);_0x4b110b[_0xf536('0x2e')]=_[_0xf536('0x2d')](_0x335992[_0xf536('0x2a')],qs[_0xf536('0x2f')](_0x188b37['query'][_0xf536('0x2f')]));_0x4b110b[_0xf536('0x2e')]=_0x4b110b[_0xf536('0x2e')]['length']?_0x4b110b['attributes']:_0x335992['model'];if(_0x188b37[_0xf536('0x2c')][_0xf536('0x3b')]){_0x4b110b[_0xf536('0x3c')]=[{'all':!![]}];}_0x4b110b=_[_0xf536('0x42')]({},_0x4b110b,_0x188b37['options']);return db[_0xf536('0x29')]['find'](_0x4b110b)[_0xf536('0x26')](handleEntityNotFound(_0x2f6ccf,null))[_0xf536('0x26')](respondWithResult(_0x2f6ccf,null))['catch'](handleError(_0x2f6ccf,null));};exports[_0xf536('0x43')]=function(_0x5b5ba3,_0x423e96){return db[_0xf536('0x29')]['create'](_0x5b5ba3[_0xf536('0x44')],{})['then'](respondWithResult(_0x423e96,0xc9))[_0xf536('0x3f')](handleError(_0x423e96,null));};exports[_0xf536('0x25')]=function(_0xf5d105,_0x3718f7){if(_0xf5d105[_0xf536('0x44')]['id']){delete _0xf5d105[_0xf536('0x44')]['id'];}return db[_0xf536('0x29')]['find']({'where':{'id':_0xf5d105['params']['id']}})[_0xf536('0x26')](handleEntityNotFound(_0x3718f7,null))[_0xf536('0x26')](saveUpdates(_0xf5d105[_0xf536('0x44')],null))[_0xf536('0x26')](respondWithResult(_0x3718f7,null))[_0xf536('0x3f')](handleError(_0x3718f7,null));};exports[_0xf536('0x45')]=function(_0x2d12bd,_0x1c6bd5){return db['SmsApplication'][_0xf536('0x46')]({'where':{'id':_0x2d12bd[_0xf536('0x47')]['id']}})[_0xf536('0x26')](handleEntityNotFound(_0x1c6bd5,null))[_0xf536('0x26')](removeEntity(_0x1c6bd5,null))[_0xf536('0x3f')](handleError(_0x1c6bd5,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 030d702..3e39e3a 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 _0xe62a=['SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','util','moment','bluebird','request-promise','path','exports','define'];(function(_0x5c86c8,_0x302107){var _0x5bb6c2=function(_0x39de21){while(--_0x39de21){_0x5c86c8['push'](_0x5c86c8['shift']());}};_0x5bb6c2(++_0x302107);}(_0xe62a,0x7d));var _0xae62=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe62a[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var util=require(_0xae62('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xae62('0x1'));var BPromise=require(_0xae62('0x2'));var rp=require(_0xae62('0x3'));var fs=require('fs');var path=require(_0xae62('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsApplication.attributes');module[_0xae62('0x5')]=function(_0x562748,_0x292646){return _0x562748[_0xae62('0x6')](_0xae62('0x7'),attributes,{'tableName':_0xae62('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xae62('0x9'),'collate':_0xae62('0xa')});}; \ No newline at end of file +var _0x5ad8=['utf8mb4_unicode_ci','lodash','util','request-promise','rimraf','exports','SmsApplication','sms_applications'];(function(_0x1f96bf,_0x2d3391){var _0x167865=function(_0x5c24ff){while(--_0x5c24ff){_0x1f96bf['push'](_0x1f96bf['shift']());}};_0x167865(++_0x2d3391);}(_0x5ad8,0xa9));var _0x85ad=function(_0x298674,_0x3ef0df){_0x298674=_0x298674-0x0;var _0x42d879=_0x5ad8[_0x298674];return _0x42d879;};'use strict';var _=require(_0x85ad('0x0'));var util=require(_0x85ad('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x85ad('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x85ad('0x3'));var config=require('../../config/environment');var attributes=require('./smsApplication.attributes');module[_0x85ad('0x4')]=function(_0xa5ed5c,_0x460c22){return _0xa5ed5c['define'](_0x85ad('0x5'),attributes,{'tableName':_0x85ad('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x85ad('0x7')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 06ac52e..fe16880 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 _0x583c=['../../config/environment','client','http','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x583c,0x12b));var _0xc583=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0x583c[_0x4c440b];return _0x2d48cf;};'use strict';var _=require(_0xc583('0x0'));var util=require(_0xc583('0x1'));var moment=require(_0xc583('0x2'));var BPromise=require(_0xc583('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc583('0x4'));var db=require(_0xc583('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc583('0x6'));var config=require(_0xc583('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc583('0x8')][_0xc583('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2719df,_0x1dd37c,_0x48a8d4){return new BPromise(function(_0x21ed88,_0x26cec0){return client['request'](_0x2719df,_0x48a8d4)[_0xc583('0xa')](function(_0x24ab4f){logger[_0xc583('0xb')](_0xc583('0xc'),_0x1dd37c,_0xc583('0xd'));logger['debug'](_0xc583('0xe'),_0x1dd37c,_0xc583('0xd'),JSON['stringify'](_0x24ab4f));if(_0x24ab4f[_0xc583('0xf')]){if(_0x24ab4f[_0xc583('0xf')]['code']===0x1f4){logger[_0xc583('0xf')](_0xc583('0xc'),_0x1dd37c,_0x24ab4f[_0xc583('0xf')][_0xc583('0x10')]);return _0x26cec0(_0x24ab4f[_0xc583('0xf')][_0xc583('0x10')]);}logger[_0xc583('0xf')](_0xc583('0xc'),_0x1dd37c,_0x24ab4f[_0xc583('0xf')]['message']);return _0x21ed88(_0x24ab4f[_0xc583('0xf')]['message']);}else{logger[_0xc583('0xb')](_0xc583('0xc'),_0x1dd37c,'request\x20sent');_0x21ed88(_0x24ab4f[_0xc583('0x11')][_0xc583('0x10')]);}})['catch'](function(_0x7d1690){logger[_0xc583('0xf')]('SmsApplication,\x20%s,\x20%s',_0x1dd37c,_0x7d1690);_0x26cec0(_0x7d1690);});});} \ No newline at end of file +var _0x68fd=['error','code','message','info','SmsApplication,\x20%s,\x20%s','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x322719,_0x16b381){var _0x30cb6f=function(_0x1e5698){while(--_0x1e5698){_0x322719['push'](_0x322719['shift']());}};_0x30cb6f(++_0x16b381);}(_0x68fd,0x1e9));var _0xd68f=function(_0x13510e,_0x3a5511){_0x13510e=_0x13510e-0x0;var _0x3e7176=_0x68fd[_0x13510e];return _0x3e7176;};'use strict';var _=require(_0xd68f('0x0'));var util=require('util');var moment=require(_0xd68f('0x1'));var BPromise=require(_0xd68f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd68f('0x3'));var db=require(_0xd68f('0x4'))['db'];var utils=require(_0xd68f('0x5'));var logger=require(_0xd68f('0x6'))(_0xd68f('0x7'));var config=require(_0xd68f('0x8'));var jayson=require(_0xd68f('0x9'));var client=jayson[_0xd68f('0xa')][_0xd68f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e59f5,_0xb3cb35,_0x182353){return new BPromise(function(_0x26f6ca,_0x22c199){return client[_0xd68f('0xc')](_0x4e59f5,_0x182353)[_0xd68f('0xd')](function(_0x18438e){logger['info']('SmsApplication,\x20%s,\x20%s',_0xb3cb35,_0xd68f('0xe'));logger['debug'](_0xd68f('0xf'),_0xb3cb35,_0xd68f('0xe'),JSON[_0xd68f('0x10')](_0x18438e));if(_0x18438e[_0xd68f('0x11')]){if(_0x18438e[_0xd68f('0x11')][_0xd68f('0x12')]===0x1f4){logger[_0xd68f('0x11')]('SmsApplication,\x20%s,\x20%s',_0xb3cb35,_0x18438e['error']['message']);return _0x22c199(_0x18438e['error'][_0xd68f('0x13')]);}logger[_0xd68f('0x11')]('SmsApplication,\x20%s,\x20%s',_0xb3cb35,_0x18438e[_0xd68f('0x11')][_0xd68f('0x13')]);return _0x26f6ca(_0x18438e[_0xd68f('0x11')][_0xd68f('0x13')]);}else{logger[_0xd68f('0x14')](_0xd68f('0x15'),_0xb3cb35,_0xd68f('0xe'));_0x26f6ca(_0x18438e['result'][_0xd68f('0x13')]);}})['catch'](function(_0x5db5b1){logger[_0xd68f('0x11')](_0xd68f('0x15'),_0xb3cb35,_0x5db5b1);_0x22c199(_0x5db5b1);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index beef2e8..4100acc 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(_0x17d3ca,_0x58a967){var _0x3c845d=function(_0x502c32){while(--_0x502c32){_0x17d3ca['push'](_0x17d3ca['shift']());}};_0x3c845d(++_0x58a967);}(_0x4fc2,0x111));var _0x24fc=function(_0x59557e,_0x8f9209){_0x59557e=_0x59557e-0x0;var _0x2bfe66=_0x4fc2[_0x59557e];return _0x2bfe66;};'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 _0x0abf=['create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','smsinteraction:destroy','destroy','delete','removeTags','exports','multer','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','describe','/:id','show','/:id/messages','download','post'];(function(_0x205ebc,_0x2f5135){var _0x47a636=function(_0x5c6759){while(--_0x5c6759){_0x205ebc['push'](_0x205ebc['shift']());}};_0x47a636(++_0x2f5135);}(_0x0abf,0xe8));var _0xf0ab=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x0abf[_0x432682];return _0x463d05;};'use strict';var multer=require(_0xf0ab('0x0'));var util=require('util');var path=require(_0xf0ab('0x1'));var timeout=require(_0xf0ab('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf0ab('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf0ab('0x4'));var config=require(_0xf0ab('0x5'));var controller=require(_0xf0ab('0x6'));router[_0xf0ab('0x7')]('/',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x9')]);router[_0xf0ab('0x7')]('/describe',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0xa')]);router[_0xf0ab('0x7')](_0xf0ab('0xb'),auth['isAuthenticated'](),controller[_0xf0ab('0xc')]);router[_0xf0ab('0x7')](_0xf0ab('0xd'),auth['isAuthenticated'](),controller['getMessages']);router[_0xf0ab('0x7')]('/:id/download',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0xe')]);router[_0xf0ab('0xf')]('/',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x10')]);router[_0xf0ab('0xf')](_0xf0ab('0xd'),auth['isAuthenticated'](),controller[_0xf0ab('0x11')]);router[_0xf0ab('0xf')](_0xf0ab('0x12'),auth[_0xf0ab('0x8')](),interaction[_0xf0ab('0x13')](_0xf0ab('0x14'),_0xf0ab('0x15')),controller[_0xf0ab('0x16')]);router[_0xf0ab('0x17')](_0xf0ab('0xb'),auth[_0xf0ab('0x8')](),interaction[_0xf0ab('0x13')](_0xf0ab('0x14'),_0xf0ab('0x18')),controller[_0xf0ab('0x19')]);router['delete'](_0xf0ab('0xb'),auth[_0xf0ab('0x8')](),interaction[_0xf0ab('0x13')](_0xf0ab('0x14'),_0xf0ab('0x1a')),controller[_0xf0ab('0x1b')]);router[_0xf0ab('0x1c')](_0xf0ab('0x12'),auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x1d')]);module[_0xf0ab('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 9917406..34db8b9 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 _0xdcc4=['ENUM','out','sequelize','moment','exports','BOOLEAN','DATE','STRING'];(function(_0x147152,_0x40130f){var _0x429c1d=function(_0x4e6578){while(--_0x4e6578){_0x147152['push'](_0x147152['shift']());}};_0x429c1d(++_0x40130f);}(_0xdcc4,0xea));var _0x4dcc=function(_0x26728d,_0xd08f04){_0x26728d=_0x26728d-0x0;var _0x4670bf=_0xdcc4[_0x26728d];return _0x4670bf;};'use strict';var Sequelize=require(_0x4dcc('0x0'));var moment=require(_0x4dcc('0x1'));module[_0x4dcc('0x2')]={'closed':{'type':Sequelize[_0x4dcc('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4dcc('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x4dcc('0x5')]},'thirdDisposition':{'type':Sequelize[_0x4dcc('0x5')]},'note':{'type':Sequelize[_0x4dcc('0x5')]},'phone':{'type':Sequelize[_0x4dcc('0x5')]},'read1stAt':{'type':Sequelize[_0x4dcc('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x4dcc('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4dcc('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x4dcc('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x4dcc('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x5f71=['DATE','STRING','ENUM','out','BOOLEAN','sequelize','exports'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x5f71,0xc9));var _0x15f7=function(_0x4ea5a1,_0x5c7e5a){_0x4ea5a1=_0x4ea5a1-0x0;var _0x3d9775=_0x5f71[_0x4ea5a1];return _0x3d9775;};'use strict';var Sequelize=require(_0x15f7('0x0'));var moment=require('moment');module[_0x15f7('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x15f7('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x15f7('0x3')]},'phone':{'type':Sequelize[_0x15f7('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x15f7('0x4')]('in',_0x15f7('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x15f7('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x15f7('0x4')]('in',_0x15f7('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x15f7('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 7a69efb..cc47133 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 _0x16d8=['getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','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?','text','body','keys','some','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','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)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','QueryTypes','clone','contactName','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','a.key','a.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','SmsInteractionId','all','rows','show','params','includeAll','options','catch','create','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','setTags','spread','color','emit','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Messages','direction','secret','SmsAccount','Account','Owner','get','mkdirSync','Sms','N.A.','disposition','out','System','renderFile','views','transcript-','.pdf','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','end','error','stack','name','map','fullname','TagIds','Tags','split','forEach','push','waiting','answered','unmanaged','total','closed','UserId','talking','index','SmsInteraction','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','tools_tags','u.id','u.fullname','ui.SmsInteractionId','from','user_has_sms_interactions','left_join','users','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','conditions','value','having','`\x20>\x200','Contact','operator','$substring','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)'];(function(_0x4cea82,_0x5d4bf9){var _0x1689ce=function(_0x15327c){while(--_0x15327c){_0x4cea82['push'](_0x4cea82['shift']());}};_0x1689ce(++_0x5d4bf9);}(_0x16d8,0x176));var _0x816d=function(_0x337ea2,_0x2cf5fd){_0x337ea2=_0x337ea2-0x0;var _0x4f4abc=_0x16d8[_0x337ea2];return _0x4f4abc;};'use strict';var emlformat=require(_0x816d('0x0'));var rimraf=require(_0x816d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x816d('0x2'));var rp=require('request-promise');var moment=require(_0x816d('0x3'));var BPromise=require(_0x816d('0x4'));var Mustache=require(_0x816d('0x5'));var util=require(_0x816d('0x6'));var path=require(_0x816d('0x7'));var sox=require(_0x816d('0x8'));var csv=require(_0x816d('0x9'));var ejs=require(_0x816d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x816d('0xb'));var squel=require('squel');var crypto=require(_0x816d('0xc'));var jsforce=require(_0x816d('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x816d('0xe'));var authService=require(_0x816d('0xf'));var qs=require(_0x816d('0x10'));var as=require(_0x816d('0x11'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x816d('0x12'));var logger=require(_0x816d('0x13'))(_0x816d('0x14'));var utils=require(_0x816d('0x15'));var config=require(_0x816d('0x16'));var licenseUtil=require(_0x816d('0x17'));var db=require(_0x816d('0x18'))['db'];config[_0x816d('0x19')]=_[_0x816d('0x1a')](config[_0x816d('0x19')],{'host':_0x816d('0x1b'),'port':0x18eb});var socket=require(_0x816d('0x1c'))(new Redis(config['redis']));require(_0x816d('0x1d'))[_0x816d('0x1e')](socket);function respondWithStatusCode(_0x5b0d63,_0x5acf0a){_0x5acf0a=_0x5acf0a||0xcc;return function(_0x24e656){if(_0x24e656){return _0x5b0d63[_0x816d('0x1f')](_0x5acf0a);}return _0x5b0d63[_0x816d('0x20')](_0x5acf0a)['end']();};}function respondWithResult(_0x242e0e,_0x13c0a2){_0x13c0a2=_0x13c0a2||0xc8;return function(_0x205120){if(_0x205120){return _0x242e0e[_0x816d('0x20')](_0x13c0a2)[_0x816d('0x21')](_0x205120);}};}function respondWithFilteredResult(_0x5830b3,_0x3013f6){return function(_0x3b93c2){if(_0x3b93c2){var _0x9fe560=typeof _0x3013f6[_0x816d('0x22')]===_0x816d('0x23')&&typeof _0x3013f6[_0x816d('0x24')]==='undefined';var _0x41e52a=_0x3b93c2[_0x816d('0x25')];var _0x45911c=_0x9fe560?0x0:_0x3013f6['offset'];var _0x5061b0=_0x9fe560?_0x3b93c2[_0x816d('0x25')]:_0x3013f6['offset']+_0x3013f6[_0x816d('0x24')];var _0x1ab25d;if(_0x5061b0>=_0x41e52a){_0x5061b0=_0x41e52a;_0x1ab25d=0xc8;}else{_0x1ab25d=0xce;}_0x5830b3['status'](_0x1ab25d);return _0x5830b3[_0x816d('0x26')]('Content-Range',_0x45911c+'-'+_0x5061b0+'/'+_0x41e52a)[_0x816d('0x21')](_0x3b93c2);}return null;};}function patchUpdates(_0x395f6b){return function(_0x168e4a){try{jsonpatch[_0x816d('0x27')](_0x168e4a,_0x395f6b,!![]);}catch(_0x1f8cf4){return BPromise[_0x816d('0x28')](_0x1f8cf4);}return _0x168e4a[_0x816d('0x29')]();};}function saveUpdates(_0x3d74f8,_0x447a32){return function(_0x470228){if(_0x470228){return _0x470228[_0x816d('0x2a')](_0x3d74f8)['then'](function(_0x2e7f2f){return _0x2e7f2f;});}return null;};}function removeEntity(_0x2d17f0,_0x429680){return function(_0x307b15){if(_0x307b15){return _0x307b15[_0x816d('0x2b')]()[_0x816d('0x2c')](function(){_0x2d17f0[_0x816d('0x20')](0xcc)[_0x816d('0x2d')]();});}};}function handleEntityNotFound(_0x4f5600,_0xbf85b3){return function(_0x1e417d){if(!_0x1e417d){_0x4f5600[_0x816d('0x1f')](0x194);}return _0x1e417d;};}function handleError(_0x45a275,_0x4bf541){_0x4bf541=_0x4bf541||0x1f4;return function(_0x13751e){logger[_0x816d('0x2e')](_0x13751e[_0x816d('0x2f')]);if(_0x13751e['name']){delete _0x13751e[_0x816d('0x30')];}_0x45a275[_0x816d('0x20')](_0x4bf541)['send'](_0x13751e);};}function getInteractionUsers(_0x31948e,_0x351366){return new BPromise(function(_0x44d7e6,_0x3b0363){try{if(_0x351366[_0x31948e['id']]){_0x31948e['Users']=_[_0x816d('0x31')](_0x351366[_0x31948e['id']],function(_0x6096fa){return{'id':_0x6096fa['id'],'fullname':_0x6096fa[_0x816d('0x32')]};});}}catch(_0x2d062d){_0x3b0363(_0x2d062d);}_0x44d7e6(_0x31948e);});}function getInteractionTags(_0x3c7311,_0x5ee2a9){return new BPromise(function(_0x123ac2,_0x45799f){try{if(_0x3c7311[_0x816d('0x33')]){_0x3c7311[_0x816d('0x34')]=[];_0x3c7311[_0x816d('0x33')][_0x816d('0x35')](',')[_0x816d('0x36')](function(_0x2359eb){_0x3c7311[_0x816d('0x34')][_0x816d('0x37')](_0x5ee2a9[_0x2359eb]);});}delete _0x3c7311[_0x816d('0x33')];}catch(_0x3cedbe){_0x45799f(_0x3cedbe);}_0x123ac2(_0x3c7311);});}function updateSmsInteraction(_0x3945d7,_0x3e6cf3,_0x18372a){return new BPromise(function(_0x3dc8b7,_0x4ad86a){return getInteractionUsers(_0x3945d7,_0x18372a)[_0x816d('0x2c')](function(_0x2b0c4f){return getInteractionTags(_0x2b0c4f,_0x3e6cf3);})[_0x816d('0x2c')](function(_0x146a89){return getStateInteraction(_0x146a89);})[_0x816d('0x2c')](function(_0xf26e8){_0x3dc8b7(_0xf26e8);})['catch'](function(_0x45001c){_0x4ad86a(_0x45001c);});});}function getStateInteraction(_0x1222ae){return new BPromise(function(_0x4d3aa2){_0x1222ae[_0x816d('0x38')]=0x0;_0x1222ae['talking']=0x0;_0x1222ae[_0x816d('0x39')]=0x0;_0x1222ae[_0x816d('0x3a')]=0x0;_0x1222ae[_0x816d('0x3b')]=0x0;if(!_0x1222ae[_0x816d('0x3c')]&&!_0x1222ae[_0x816d('0x3d')]){_0x1222ae[_0x816d('0x38')]+=0x1;}if(!_0x1222ae[_0x816d('0x3c')]&&_0x1222ae['UserId']){_0x1222ae[_0x816d('0x3e')]+=0x1;if(_0x1222ae[_0x816d('0x38')]){_0x1222ae[_0x816d('0x38')]-=0x1;}}if(_0x1222ae['closed']&&_0x1222ae[_0x816d('0x3d')]){_0x1222ae[_0x816d('0x39')]+=0x1;if(_0x1222ae[_0x816d('0x3e')]){_0x1222ae[_0x816d('0x3e')]-=0x1;}}if(_0x1222ae[_0x816d('0x3c')]&&!_0x1222ae['UserId']){_0x1222ae[_0x816d('0x3a')]+=0x1;if(_0x1222ae[_0x816d('0x38')]){_0x1222ae[_0x816d('0x38')]-=0x1;}}_0x1222ae[_0x816d('0x3b')]+=0x1;_0x4d3aa2(_0x1222ae);});}exports[_0x816d('0x3f')]=function(_0x5d403c,_0x516201){var _0x5a3840={},_0x4bcd38={},_0x34cd56={'count':0x0,'rows':[]};var _0x2f8fc7=_[_0x816d('0x31')](db[_0x816d('0x40')][_0x816d('0x41')],function(_0x2a98fb){return{'name':_0x2a98fb[_0x816d('0x42')],'type':_0x2a98fb[_0x816d('0x43')][_0x816d('0x44')]};});_0x4bcd38[_0x816d('0x45')]=_[_0x816d('0x31')](_0x2f8fc7,_0x816d('0x30'));_0x4bcd38['query']=_['keys'](_0x5d403c[_0x816d('0x46')]);_0x4bcd38[_0x816d('0x47')]=_[_0x816d('0x48')](_0x4bcd38[_0x816d('0x45')],_0x4bcd38[_0x816d('0x46')]);_0x5a3840[_0x816d('0x49')]=_['intersection'](_0x4bcd38['model'],qs[_0x816d('0x4a')](_0x5d403c[_0x816d('0x46')][_0x816d('0x4a')]));_0x5a3840[_0x816d('0x49')]=_0x5a3840[_0x816d('0x49')]['length']?_0x5a3840['attributes']:_0x4bcd38[_0x816d('0x45')];if(!_0x5d403c[_0x816d('0x46')][_0x816d('0x4b')](_0x816d('0x4c'))){_0x5a3840['limit']=qs['limit'](_0x5d403c[_0x816d('0x46')][_0x816d('0x24')]);_0x5a3840[_0x816d('0x22')]=qs[_0x816d('0x22')](_0x5d403c[_0x816d('0x46')][_0x816d('0x22')]);}_0x5a3840[_0x816d('0x4d')]=qs[_0x816d('0x4e')](_0x5d403c[_0x816d('0x46')][_0x816d('0x4e')]);_0x5a3840[_0x816d('0x4f')]=qs[_0x816d('0x47')](_[_0x816d('0x50')](_0x5d403c[_0x816d('0x46')],_0x4bcd38[_0x816d('0x47')]),_0x2f8fc7);var _0x370a68=[];var _0x50cc04=squel[_0x816d('0x51')]()[_0x816d('0x52')]('id')[_0x816d('0x52')]('name')[_0x816d('0x52')]('color')['from'](_0x816d('0x53'));var _0xc6f4c8=squel[_0x816d('0x51')]()[_0x816d('0x52')](_0x816d('0x54'))[_0x816d('0x52')](_0x816d('0x55'))[_0x816d('0x52')](_0x816d('0x56'))[_0x816d('0x57')](_0x816d('0x58'),'ui')[_0x816d('0x59')](_0x816d('0x5a'),'u','u.id\x20=\x20ui.UserId');var _0x17c440=squel['select']()[_0x816d('0x57')](_0x816d('0x5b'),'i')[_0x816d('0x59')](_0x816d('0x5c'),'c',_0x816d('0x5d'))[_0x816d('0x59')]('users','o',_0x816d('0x5e'))['left_join']('sms_accounts','a','a.id\x20=\x20i.SmsAccountId')['left_join'](_0x816d('0x5f'),'me',_0x816d('0x60'))[_0x816d('0x59')](_0x816d('0x61'),'it',_0x816d('0x62'))['left_join'](_0x816d('0x53'),'t',_0x816d('0x63'));var _0x454cf3=squel[_0x816d('0x64')]();var _0x21bff6=[];var _0x5d7321=squel['expr']();var _0x7860c8;if(_0x5d403c[_0x816d('0x46')]['search']){_0x7860c8=as['parseSearch'](_0x5d403c[_0x816d('0x46')]['search']);var _0x46c3a9=_0x7860c8['sqlOperator'];for(var _0x301642=0x0;_0x301642<_0x7860c8[_0x816d('0x65')]['length'];_0x301642++){var _0x33a202=_0x7860c8[_0x816d('0x65')][_0x301642];var _0x36c15c='i';var _0x28ae8c=_['find'](_0x2f8fc7,[_0x816d('0x30'),_0x33a202[_0x816d('0x52')]]);if(!_0x28ae8c){switch(_0x33a202[_0x816d('0x52')]){case'unreadMessages':if(_0x33a202[_0x816d('0x66')]==0x1){_0x17c440[_0x816d('0x67')]('`'+_0x33a202[_0x816d('0x52')]+'`\x20=\x200');}else{_0x17c440[_0x816d('0x67')]('`'+_0x33a202[_0x816d('0x52')]+_0x816d('0x68'));}break;case _0x816d('0x69'):if(_0x33a202[_0x816d('0x6a')]===_0x816d('0x6b')){if(_0x33a202[_0x816d('0x66')][_0x816d('0x35')]('\x20')[_0x816d('0x6c')]>0x1){_0x454cf3[_0x46c3a9](_0x816d('0x6d'),qs[_0x816d('0x6e')](_0x33a202[_0x816d('0x66')]),null);}else{var _0x385c94='%'+_0x33a202[_0x816d('0x66')]+'%';_0x454cf3[_0x46c3a9](_0x816d('0x6f'),_0x385c94,_0x385c94,_0x385c94);}}else{_0x28ae8c=_[_0x816d('0x70')](_0x2f8fc7,[_0x816d('0x30'),_0x816d('0x71')]);_0x33a202[_0x816d('0x52')]=_0x816d('0x71');_0x200230=as[_0x816d('0x72')](_0x36c15c,_0x28ae8c['type'],_0x33a202);_0x454cf3[_0x46c3a9](_0x200230['text'],_0x200230[_0x816d('0x66')][_0x816d('0x73')],_0x200230[_0x816d('0x66')][_0x816d('0x2d')]);}break;case _0x816d('0x74'):var _0x3202e2=_0x33a202[_0x816d('0x66')][_0x816d('0x35')](',')[_0x816d('0x31')](function(_0x2a6070){return Number(_0x2a6070);});_0x3202e2['forEach'](function(_0x5a48b9){_0x5d7321['or'](_0x816d('0x75'),'%,'+_0x5a48b9+',%');});_0x21bff6=_[_0x816d('0x76')](_0x21bff6,_0x3202e2);break;case _0x816d('0x77'):if(_0x33a202['operator']===_0x816d('0x6b')){_0x454cf3[_0x46c3a9](_0x816d('0x78'),'%'+_0x33a202[_0x816d('0x66')]+'%',null);}else{_0x28ae8c=_['find'](_0x2f8fc7,[_0x816d('0x30'),'UserId']);_0x33a202[_0x816d('0x52')]='UserId';_0x200230=as[_0x816d('0x72')](_0x36c15c,_0x28ae8c['type'],_0x33a202);_0x454cf3[_0x46c3a9](_0x200230[_0x816d('0x79')],_0x200230[_0x816d('0x66')][_0x816d('0x73')],_0x200230[_0x816d('0x66')]['end']);}break;case _0x816d('0x7a'):_0x200230=as['buildExpression']('me',null,_0x33a202);_0x454cf3[_0x46c3a9](_0x200230[_0x816d('0x79')],_0x200230[_0x816d('0x66')][_0x816d('0x73')],_0x200230[_0x816d('0x66')][_0x816d('0x2d')]);break;}}else{var _0x200230=as[_0x816d('0x72')](_0x36c15c,_0x28ae8c['type'],_0x33a202);_0x454cf3[_0x46c3a9](_0x200230[_0x816d('0x79')],_0x200230[_0x816d('0x66')]['start'],_0x200230['value'][_0x816d('0x2d')]);}}}else{var _0x13b476=_(_0x5d403c[_0x816d('0x46')])[_0x816d('0x7b')]()[_0x816d('0x31')](function(_0x55e1d6){return _[_0x816d('0x7c')](_0x2f8fc7,[_0x816d('0x30'),_0x55e1d6])?_0x55e1d6:undefined;})[_0x816d('0x7d')]()[_0x816d('0x66')]();if(!_[_0x816d('0x7e')](_0x13b476)){_0x13b476['forEach'](function(_0x4b2eb3){if(_0x4b2eb3===_0x816d('0x7f')){_0x17c440['where'](_0x816d('0x80'),[]['concat'](_0x5d403c[_0x816d('0x46')][_0x4b2eb3]));}else if(_0x4b2eb3===_0x816d('0x81')){var _0x16a561=JSON[_0x816d('0x82')](_0x5d403c[_0x816d('0x46')][_0x4b2eb3])[_0x816d('0x83')];var _0x319350=JSON['parse'](_0x5d403c[_0x816d('0x46')][_0x4b2eb3])[_0x816d('0x84')];_0x17c440[_0x816d('0x4f')](_0x816d('0x85'),_0x16a561,_0x319350);}else{if(_0x5d403c['query'][_0x4b2eb3]===_0x816d('0x86')){_0x17c440['where']('i.'+_0x4b2eb3+_0x816d('0x87'));}else{_0x17c440[_0x816d('0x4f')]('i.'+_0x4b2eb3+_0x816d('0x88'),_0x5d403c[_0x816d('0x46')][_0x4b2eb3]);}}});}if(_0x5d403c[_0x816d('0x46')][_0x816d('0x89')]){if(_0x5d403c[_0x816d('0x46')][_0x816d('0x89')]==0x1){_0x17c440[_0x816d('0x67')](_0x816d('0x8a'));}else{_0x17c440[_0x816d('0x67')](_0x816d('0x8b'));}}if(_0x5d403c[_0x816d('0x46')][_0x816d('0x8c')]){_0x21bff6=_[_0x816d('0x8d')](_0x5d403c[_0x816d('0x46')]['tag'])?_0x5d403c['query'][_0x816d('0x8c')]:new Array(_0x5d403c[_0x816d('0x46')]['tag']);_0x21bff6[_0x816d('0x36')](function(_0x56c623){_0x5d7321['or'](_0x816d('0x75'),'%,'+_0x56c623+',%');});}if(_0x5d403c[_0x816d('0x46')][_0x816d('0x8e')]){var _0x431aa1=_0x5d403c[_0x816d('0x46')][_0x816d('0x8e')][_0x816d('0x8f')]('\x5c','\x5c\x5c')[_0x816d('0x8f')](/'/g,'\x27\x27');if(qs[_0x816d('0x90')](_0x431aa1)){_0x454cf3['or'](_0x816d('0x91'),_0x431aa1+'%')['or'](_0x816d('0x92'),_0x431aa1+'%');}else{_0x454cf3['or'](_0x816d('0x93'),qs[_0x816d('0x6e')](_0x431aa1))['or'](_0x816d('0x94'),_0x431aa1+'%');}}}_0x17c440[_0x816d('0x4f')](_0x454cf3);_0x17c440['group'](_0x816d('0x95'));var _0xbe432c={'type':db['Sequelize'][_0x816d('0x96')]['SELECT'],'raw':!![]};var _0xe39934=_0x17c440[_0x816d('0x97')]();_0xe39934[_0x816d('0x52')](_0x816d('0x95'));_0xe39934['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x5a3840[_0x816d('0x4d')]){_0x5a3840[_0x816d('0x4d')][_0x816d('0x36')](function(_0x278efd){var _0x4bb1e1=_0x278efd[0x0]===_0x816d('0x98')?_0x278efd[0x0]:'i.'+_0x278efd[0x0];_0x17c440[_0x816d('0x4d')](_0x4bb1e1,_0x278efd[0x1]===_0x816d('0x99')?![]:!![]);});}if(!_[_0x816d('0x7e')](_0x21bff6)){_0x17c440[_0x816d('0x67')](_0x5d7321);_0xe39934['where'](_0x816d('0x9a'),_0x21bff6);}BPromise[_0x816d('0x9b')]()[_0x816d('0x2c')](function(){if(!_0x7860c8){if(_0x5d403c['query']['SmsAccountId'])return;_0xe39934[_0x816d('0x4f')](_0x816d('0x9c'));_0x17c440[_0x816d('0x4f')](_0x816d('0x9c'));return;}if(_0x5d403c[_0x816d('0x9d')][_0x816d('0x9e')]!==_0x816d('0x9f'))return;return _0x5d403c[_0x816d('0x9d')][_0x816d('0xa0')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4b904b){if(_['isEmpty'](_0x4b904b)){_0xe39934['where']('i.SmsAccountId\x20IS\x20NULL');_0x17c440['where'](_0x816d('0xa1'));}else{_0xe39934[_0x816d('0x4f')](_0x816d('0x80'),_[_0x816d('0x31')](_0x4b904b,'id'));_0x17c440[_0x816d('0x4f')](_0x816d('0x80'),_['map'](_0x4b904b,'id'));}});})[_0x816d('0x2c')](function(){if(_0x5d403c['user'][_0x816d('0x9e')]===_0x816d('0x9f')&&!_0x7860c8&&!_0x5d403c[_0x816d('0x46')][_0x816d('0x7f')])return[];return db[_0x816d('0xa2')][_0x816d('0x46')](_0xe39934['toString'](),_0xbe432c);})[_0x816d('0x2c')](function(_0x19f429){_0x34cd56[_0x816d('0x25')]=_0x19f429[_0x816d('0x6c')];if(_0x34cd56[_0x816d('0x25')]===0x0)return[];return db[_0x816d('0xa2')][_0x816d('0x46')](_0x50cc04[_0x816d('0xa3')](),_0xbe432c)[_0x816d('0x2c')](function(_0x552855){_0x370a68=_[_0x816d('0xa4')](_0x552855,'id');_0xbe432c=_[_0x816d('0xa5')](_0xbe432c,{'model':db[_0x816d('0x40')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5d403c['query'][_0x816d('0x4a')]){_0x5a3840[_0x816d('0x49')][_0x816d('0x36')](function(_0x58ba4b){_0x17c440[_0x816d('0x52')]('i.'+_0x58ba4b);});}else{_0x17c440[_0x816d('0x52')](_0x816d('0xa6'),_0x816d('0xa7'));_0x17c440[_0x816d('0x52')](_0x816d('0xa8'),'Account.key');_0x17c440['field'](_0x816d('0xa9'),'Account.mandatoryDisposition');_0x17c440[_0x816d('0x52')]('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');_0x17c440['field'](_0x816d('0xaa'));_0x17c440[_0x816d('0x52')](_0x816d('0xab'),_0x816d('0xac'));_0x17c440[_0x816d('0x52')](_0x816d('0xad'),_0x816d('0xae'));_0x17c440[_0x816d('0x52')](_0x816d('0xaf'),_0x816d('0xb0'));_0x17c440[_0x816d('0x52')](_0x816d('0xb1'),_0x816d('0xb2'));_0x17c440[_0x816d('0x52')](_0x816d('0xb3'),'Contact.mobile');_0x17c440['field'](_0x816d('0xb4'),_0x816d('0xb5'));_0x17c440['field']('o.fullname',_0x816d('0xb6'));_0x17c440[_0x816d('0x52')](_0x816d('0xb7'),_0x816d('0xb8'));_0x17c440[_0x816d('0x52')](_0x816d('0xb9'),_0x816d('0x33'));}if(_0x5a3840[_0x816d('0x24')])_0x17c440[_0x816d('0x24')](_0x5a3840['limit']);if(_0x5a3840[_0x816d('0x22')])_0x17c440[_0x816d('0x22')](_0x5a3840[_0x816d('0x22')]);return db['sequelize'][_0x816d('0x46')](_0x17c440[_0x816d('0xa3')](),_0xbe432c);})['then'](function(_0xf3f2f3){if(_0xf3f2f3['length']>0x0)_0xc6f4c8[_0x816d('0x4f')]('ui.SmsInteractionId\x20IN\x20?',_[_0x816d('0x31')](_0xf3f2f3,'id'));return db[_0x816d('0xa2')][_0x816d('0x46')](_0xc6f4c8[_0x816d('0xa3')](),_0xbe432c)[_0x816d('0x2c')](function(_0x4b2160){var _0x259ac4=_['groupBy'](_0x4b2160,_0x816d('0xba'));var _0x53a781=[];_0xf3f2f3['forEach'](function(_0x17e30d){_0x53a781[_0x816d('0x37')](updateSmsInteraction(_0x17e30d,_0x370a68,_0x259ac4));});return BPromise[_0x816d('0xbb')](_0x53a781);});});})[_0x816d('0x2c')](function(_0x2a1629){_0x34cd56[_0x816d('0xbc')]=_0x2a1629;return _0x34cd56;})[_0x816d('0x2c')](respondWithFilteredResult(_0x516201,_0x5a3840))['catch'](handleError(_0x516201,null));};exports[_0x816d('0xbd')]=function(_0x37a83a,_0xe215ff){var _0xa9db5f={'raw':![],'where':{'id':_0x37a83a[_0x816d('0xbe')]['id']}},_0x482036={};_0x482036['model']=_['keys'](db[_0x816d('0x40')][_0x816d('0x41')]);_0x482036['query']=_[_0x816d('0x7b')](_0x37a83a[_0x816d('0x46')]);_0x482036[_0x816d('0x47')]=_['intersection'](_0x482036[_0x816d('0x45')],_0x482036['query']);_0xa9db5f[_0x816d('0x49')]=_['intersection'](_0x482036[_0x816d('0x45')],qs[_0x816d('0x4a')](_0x37a83a[_0x816d('0x46')][_0x816d('0x4a')]));_0xa9db5f['attributes']=_0xa9db5f[_0x816d('0x49')][_0x816d('0x6c')]?_0xa9db5f['attributes']:_0x482036['model'];if(_0x37a83a['query'][_0x816d('0xbf')]){_0xa9db5f['include']=[{'all':!![]}];}_0xa9db5f=_[_0x816d('0xa5')]({},_0xa9db5f,_0x37a83a[_0x816d('0xc0')]);return db[_0x816d('0x40')]['find'](_0xa9db5f)[_0x816d('0x2c')](handleEntityNotFound(_0xe215ff,null))['then'](respondWithResult(_0xe215ff,null))[_0x816d('0xc1')](handleError(_0xe215ff,null));};exports[_0x816d('0xc2')]=function(_0x51150e,_0x37be3c){return db[_0x816d('0x40')][_0x816d('0xc2')](_0x51150e[_0x816d('0x7a')],{})[_0x816d('0x2c')](respondWithResult(_0x37be3c,0xc9))[_0x816d('0xc1')](handleError(_0x37be3c,null));};exports['update']=function(_0x2fbe11,_0x2495d9){if(_0x2fbe11[_0x816d('0x7a')]['id']){delete _0x2fbe11[_0x816d('0x7a')]['id'];}return db[_0x816d('0x40')]['find']({'where':{'id':_0x2fbe11[_0x816d('0xbe')]['id']}})[_0x816d('0x2c')](handleEntityNotFound(_0x2495d9,null))[_0x816d('0x2c')](saveUpdates(_0x2fbe11[_0x816d('0x7a')],null))[_0x816d('0x2c')](respondWithResult(_0x2495d9,null))[_0x816d('0xc1')](handleError(_0x2495d9,null));};exports[_0x816d('0x2b')]=function(_0x24aeaf,_0x30e61c){return db['SmsInteraction'][_0x816d('0x70')]({'where':{'id':_0x24aeaf[_0x816d('0xbe')]['id']}})[_0x816d('0x2c')](handleEntityNotFound(_0x30e61c,null))['then'](removeEntity(_0x30e61c,null))[_0x816d('0xc1')](handleError(_0x30e61c,null));};exports[_0x816d('0xc3')]=function(_0x184c16,_0xd40bed){return db[_0x816d('0x40')]['describe']()[_0x816d('0x2c')](respondWithResult(_0xd40bed,null))['catch'](handleError(_0xd40bed,null));};exports[_0x816d('0xc4')]=function(_0x5e2e0c,_0x1d67e8,_0x5939f8){return db[_0x816d('0xc5')][_0x816d('0x70')]({'where':{'id':_0x5e2e0c[_0x816d('0xbe')]['id']}})['then'](handleEntityNotFound(_0x1d67e8,null))[_0x816d('0x2c')](function(_0x543c20){if(_0x543c20){return _0x543c20['addMessage'](_0x5e2e0c[_0x816d('0x7a')][_0x816d('0xc6')],_[_0x816d('0xc7')](_0x5e2e0c[_0x816d('0x7a')],[_0x816d('0xc6'),'id'])||{});}})[_0x816d('0x2c')](respondWithResult(_0x1d67e8,null))[_0x816d('0xc1')](handleError(_0x1d67e8,null));};exports[_0x816d('0xc8')]=function(_0x3c5274,_0x1da784,_0x592c44){var _0xa80e91={'raw':![],'where':{}};var _0x28aa33={};var _0x1869e7={'count':0x0,'rows':[]};return db['SmsInteraction'][_0x816d('0xc9')]({'where':{'id':_0x3c5274[_0x816d('0xbe')]['id']}})[_0x816d('0x2c')](handleEntityNotFound(_0x1da784,null))['then'](function(_0x30da68){if(_0x30da68){_0x28aa33[_0x816d('0x45')]=_[_0x816d('0x7b')](db[_0x816d('0xc5')][_0x816d('0x41')]);_0x28aa33[_0x816d('0x46')]=_['keys'](_0x3c5274[_0x816d('0x46')]);_0x28aa33[_0x816d('0x47')]=_[_0x816d('0x48')](_0x28aa33[_0x816d('0x45')],_0x28aa33['query']);_0xa80e91[_0x816d('0x49')]=_[_0x816d('0x48')](_0x28aa33[_0x816d('0x45')],qs[_0x816d('0x4a')](_0x3c5274[_0x816d('0x46')][_0x816d('0x4a')]));_0xa80e91[_0x816d('0x49')]=_0xa80e91['attributes'][_0x816d('0x6c')]?_0xa80e91[_0x816d('0x49')]:_0x28aa33[_0x816d('0x45')];if(!_0x3c5274[_0x816d('0x46')][_0x816d('0x4b')](_0x816d('0x4c'))){_0xa80e91[_0x816d('0x24')]=qs['limit'](_0x3c5274[_0x816d('0x46')]['limit']);_0xa80e91[_0x816d('0x22')]=qs[_0x816d('0x22')](_0x3c5274[_0x816d('0x46')][_0x816d('0x22')]);}_0xa80e91['order']=qs['sort'](_0x3c5274['query']['sort']);_0xa80e91['where']=qs[_0x816d('0x47')](_['pick'](_0x3c5274[_0x816d('0x46')],_0x28aa33[_0x816d('0x47')]));_0xa80e91[_0x816d('0x4f')][_0x816d('0xba')]=_0x30da68['id'];if(_0x3c5274[_0x816d('0x46')]['filter']){_0xa80e91[_0x816d('0x4f')]=_[_0x816d('0xa5')](_0xa80e91[_0x816d('0x4f')],{'$or':_[_0x816d('0x31')](_0xa80e91[_0x816d('0x49')],function(_0x19b0a2){var _0xb035d6={};_0xb035d6[_0x19b0a2]={'$like':'%'+_0x3c5274[_0x816d('0x46')][_0x816d('0x8e')]+'%'};return _0xb035d6;})});}if(_0x3c5274['query'][_0x816d('0x83')]){var _0x4adba9=_0x3c5274[_0x816d('0x46')][_0x816d('0x83')][_0x816d('0x35')](',');var _0x5a07b2={};_0x5a07b2[_0x4adba9[0x0]]={'$gte':moment(_0x4adba9[0x1])[_0x816d('0xca')](_0x816d('0xcb'))};_0xa80e91[_0x816d('0x4f')]=_[_0x816d('0xa5')](_0xa80e91[_0x816d('0x4f')],_0x5a07b2);}_0xa80e91=_[_0x816d('0xa5')]({},_0xa80e91,_0x3c5274['options']);return db[_0x816d('0xc5')][_0x816d('0x25')]({'where':_0xa80e91[_0x816d('0x4f')]})['then'](function(_0x468434){_0x1869e7[_0x816d('0x25')]=_0x468434;if(_0x3c5274[_0x816d('0x46')]['includeAll']){_0xa80e91[_0x816d('0xcc')]=[{'all':!![]}];}return db['SmsMessage'][_0x816d('0xcd')](_0xa80e91);})['then'](function(_0x4eac54){_0x1869e7[_0x816d('0xbc')]=_0x4eac54;return _0x1869e7;});}})[_0x816d('0x2c')](respondWithFilteredResult(_0x1da784,_0xa80e91))[_0x816d('0xc1')](handleError(_0x1da784,null));};exports['addTags']=function(_0x1460d2,_0x1652ad,_0x35d0e4){return db[_0x816d('0x40')][_0x816d('0x70')]({'where':{'id':_0x1460d2['params']['id']}})[_0x816d('0x2c')](handleEntityNotFound(_0x1652ad,null))[_0x816d('0x2c')](function(_0x552e3b){if(_0x552e3b){return _0x552e3b[_0x816d('0xce')](_0x1460d2[_0x816d('0x7a')]['ids'],_['omit'](_0x1460d2[_0x816d('0x7a')],[_0x816d('0xc6'),'id'])||{})[_0x816d('0xcf')](function(){return db[_0x816d('0x74')][_0x816d('0xcd')]({'attributes':['id',_0x816d('0x30'),_0x816d('0xd0')],'where':{'id':_0x1460d2[_0x816d('0x7a')][_0x816d('0xc6')]}});})[_0x816d('0x2c')](function(_0x4146cf){socket[_0x816d('0xd1')]('smsInteractionTags:save',{'id':Number(_0x1460d2[_0x816d('0xbe')]['id']),'tags':_0x4146cf||[]});return{'id':Number(_0x1460d2['params']['id']),'tags':_0x4146cf||[]};});}})[_0x816d('0x2c')](respondWithResult(_0x1652ad,null))['catch'](handleError(_0x1652ad,null));};exports['removeTags']=function(_0x1a8959,_0x412fe1,_0xa3e1e7){return db[_0x816d('0x40')][_0x816d('0x70')]({'where':{'id':_0x1a8959[_0x816d('0xbe')]['id']}})[_0x816d('0x2c')](handleEntityNotFound(_0x412fe1,null))[_0x816d('0x2c')](function(_0x3c3fb6){if(_0x3c3fb6){return _0x3c3fb6['removeTags'](_0x1a8959[_0x816d('0x46')][_0x816d('0xc6')]);}})[_0x816d('0x2c')](respondWithStatusCode(_0x412fe1,null))['catch'](handleError(_0x412fe1,null));};exports[_0x816d('0xd2')]=function(_0x1f4892,_0x1eff0e){var _0x38d930=moment()[_0x816d('0xd3')]()['toString']();var _0x2aeb5e=path[_0x816d('0xd4')](config[_0x816d('0xd5')],_0x816d('0xd6'),_0x816d('0xd7'),_0x816d('0xd8'));var _0x2f7ab9=path[_0x816d('0xd4')](config[_0x816d('0xd5')],_0x816d('0xd6'),_0x816d('0xd7'),_0x816d('0xd9'));var _0x34251b=path['join'](_0x2aeb5e,_0x38d930);var _0x487006=util[_0x816d('0xca')](_0x816d('0xda'),_0x1f4892[_0x816d('0xbe')]['id'],_0x38d930);var _0x257a15=path[_0x816d('0xd4')](_0x2aeb5e,_0x487006);var _0xdcf502=[];_0xdcf502[_0x816d('0x37')]({'model':db[_0x816d('0x77')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0xdcf502[_0x816d('0x37')]({'model':db[_0x816d('0xdb')],'as':'Contact','attributes':['id',_0x816d('0xdc'),_0x816d('0xdd')],'raw':!![]});var _0x4a0d30=[{'model':db[_0x816d('0xc5')],'as':_0x816d('0xde'),'attributes':['id','body','createdAt',_0x816d('0xdf'),_0x816d('0xe0'),_0x816d('0x89')],'include':_0xdcf502}];_0x4a0d30[_0x816d('0x37')]({'model':db[_0x816d('0xe1')],'as':_0x816d('0xe2'),'attributes':['id',_0x816d('0x30')]});_0x4a0d30[_0x816d('0x37')]({'model':db[_0x816d('0x77')],'as':_0x816d('0xe3'),'attributes':['id',_0x816d('0x32')]});return db[_0x816d('0x40')][_0x816d('0x70')]({'where':{'id':_0x1f4892['params']['id']},'include':_0x4a0d30})['then'](handleEntityNotFound(_0x1eff0e,null))[_0x816d('0x2c')](function(_0x514239){if(_0x514239){var _0x1a0c1f=_0x514239[_0x816d('0xe4')]({'plain':!![]});fs[_0x816d('0xe5')](_0x34251b);var _0xd675ad={'channel':_0x816d('0xe6'),'account':_0x1a0c1f['Account'][_0x816d('0x30')],'agent':_0x1a0c1f[_0x816d('0xe3')]?_0x1a0c1f[_0x816d('0xe3')][_0x816d('0x32')]:_0x816d('0xe7'),'createdAt':moment(_0x1a0c1f['createdAt'])[_0x816d('0xca')]('YYYY-MM-DD\x20HH:mm:ss')[_0x816d('0xa3')](),'closedAt':_0x1a0c1f[_0x816d('0x3c')]?moment(_0x1a0c1f['closedAt'])[_0x816d('0xca')](_0x816d('0xcb'))[_0x816d('0xa3')]():'','disposition':_0x1a0c1f[_0x816d('0xe8')],'messages':_(_0x1a0c1f['Messages'])[_0x816d('0x8e')]({'secret':![]})[_0x816d('0x31')](function(_0x917f5){return{'date':moment(_0x917f5[_0x816d('0x81')])[_0x816d('0xca')](_0x816d('0xcb'))[_0x816d('0xa3')](),'sender':_0x917f5['direction']===_0x816d('0xe9')?_0x917f5[_0x816d('0x77')]?_0x917f5[_0x816d('0x77')]['fullname']:_0x816d('0xea'):_0x917f5[_0x816d('0x69')][_0x816d('0xdc')]+(_0x917f5['Contact'][_0x816d('0xdd')]?'\x20'+_0x917f5['Contact'][_0x816d('0xdd')]:''),'body':_0x917f5[_0x816d('0x7a')],'direction':_0x917f5[_0x816d('0xdf')]==='out'?'A':'C','secret':_0x917f5[_0x816d('0xe0')],'read':_0x917f5[_0x816d('0x89')]};})['value']()};return ejs[_0x816d('0xeb')](path[_0x816d('0xd4')](config[_0x816d('0xd5')],'server',_0x816d('0xec'),'downloadInteraction.ejs'),{'interaction':_0xd675ad})[_0x816d('0x2c')](function(_0x5b169a){var _0x1fe47c=path['join'](_0x34251b,_0x816d('0xed')+_0x1a0c1f['id']+'-'+_0x38d930+_0x816d('0xee'));var _0x19ec78={'path':_0x1fe47c,'channel':'Sms','interactionId':_0x1a0c1f['id']};return pdf['createPdfFromHTML'](_0x5b169a,_0x19ec78);})['then'](function(){return new BPromise(function(_0x14277c,_0x432b66){zipdir(_0x34251b,{'saveTo':_0x257a15},function(_0x514ed4,_0x1e1c04){if(_0x514ed4)return _0x432b66(_0x514ed4);return _0x14277c(_0x1e1c04);});})[_0x816d('0x2c')](function(){return new BPromise(function(_0x1c01b9,_0x855c15){rimraf(_0x34251b,function(_0x249dfb){if(_0x249dfb)_0x855c15(_0x249dfb);return _0x1c01b9();});});})['then'](function(){return _0x1eff0e[_0x816d('0xd2')](_0x257a15,_0x487006,function(_0x37c605){if(_0x37c605){console[_0x816d('0xef')](_0x816d('0xf0'),_0x37c605);}else{fs[_0x816d('0xf1')](_0x257a15);}});});});}else{return _0x1eff0e[_0x816d('0x1f')](0xc8);}})[_0x816d('0xc1')](handleError(_0x1eff0e,null));}; \ No newline at end of file +var _0x6610=['isEmpty','SmsAccountId','createdAt','$gte','parse','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','filter','replace','isNumeric','getFullTextValue','group','i.id','Sequelize','QueryTypes','clone','contactName','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.SmsAccountId\x20IS\x20NULL','toString','count','sequelize','keyBy','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','c.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.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','catch','params','include','create','describe','SmsMessage','addMessage','omit','ids','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','findAll','rows','addTags','setTags','spread','color','emit','smsInteractionTags:save','removeTags','download','unix','join','server','files','attachments','transcript-%d-%s.zip','User','fullname','CmContact','firstName','lastName','Messages','secret','Account','get','mkdirSync','Sms','Owner','disposition','direction','System','root','views','downloadInteraction.ejs','.pdf','log','unlinkSync','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsInteraction.socket','sendStatus','end','status','json','offset','undefined','limit','Content-Range','apply','update','then','destroy','error','stack','map','TagIds','split','forEach','Tags','push','waiting','talking','answered','unmanaged','closed','UserId','total','index','SmsInteraction','rawAttributes','fieldName','model','name','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','select','field','from','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','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','it.SmsInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','having','`\x20=\x200','Contact','operator','value','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','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','type','some','compact'];(function(_0x1c9c24,_0x2a517b){var _0x349c69=function(_0x259ff7){while(--_0x259ff7){_0x1c9c24['push'](_0x1c9c24['shift']());}};_0x349c69(++_0x2a517b);}(_0x6610,0x152));var _0x0661=function(_0x4c5a9b,_0x3003de){_0x4c5a9b=_0x4c5a9b-0x0;var _0x4972db=_0x6610[_0x4c5a9b];return _0x4972db;};'use strict';var emlformat=require(_0x0661('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0661('0x1'));var moment=require(_0x0661('0x2'));var BPromise=require(_0x0661('0x3'));var Mustache=require(_0x0661('0x4'));var util=require(_0x0661('0x5'));var path=require(_0x0661('0x6'));var sox=require(_0x0661('0x7'));var csv=require(_0x0661('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0661('0x9'));var _=require('lodash');var squel=require(_0x0661('0xa'));var crypto=require(_0x0661('0xb'));var jsforce=require(_0x0661('0xc'));var deskjs=require(_0x0661('0xd'));var toCsv=require(_0x0661('0x8'));var querystring=require(_0x0661('0xe'));var Papa=require(_0x0661('0xf'));var Redis=require(_0x0661('0x10'));var authService=require(_0x0661('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require(_0x0661('0x12'));var logger=require(_0x0661('0x13'))('api');var utils=require(_0x0661('0x14'));var config=require(_0x0661('0x15'));var licenseUtil=require(_0x0661('0x16'));var db=require(_0x0661('0x17'))['db'];config[_0x0661('0x18')]=_[_0x0661('0x19')](config[_0x0661('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x0661('0x1a'))(new Redis(config[_0x0661('0x18')]));require(_0x0661('0x1b'))['register'](socket);function respondWithStatusCode(_0x47fc16,_0x4208ca){_0x4208ca=_0x4208ca||0xcc;return function(_0x31b8bb){if(_0x31b8bb){return _0x47fc16[_0x0661('0x1c')](_0x4208ca);}return _0x47fc16['status'](_0x4208ca)[_0x0661('0x1d')]();};}function respondWithResult(_0x15ecf8,_0x16cafe){_0x16cafe=_0x16cafe||0xc8;return function(_0x9167){if(_0x9167){return _0x15ecf8[_0x0661('0x1e')](_0x16cafe)[_0x0661('0x1f')](_0x9167);}};}function respondWithFilteredResult(_0x3c3edb,_0x57bf79){return function(_0x50f91c){if(_0x50f91c){var _0x465f62=typeof _0x57bf79[_0x0661('0x20')]===_0x0661('0x21')&&typeof _0x57bf79[_0x0661('0x22')]===_0x0661('0x21');var _0x47b649=_0x50f91c['count'];var _0x8a5a6b=_0x465f62?0x0:_0x57bf79[_0x0661('0x20')];var _0x49f81d=_0x465f62?_0x50f91c['count']:_0x57bf79['offset']+_0x57bf79[_0x0661('0x22')];var _0x775da4;if(_0x49f81d>=_0x47b649){_0x49f81d=_0x47b649;_0x775da4=0xc8;}else{_0x775da4=0xce;}_0x3c3edb[_0x0661('0x1e')](_0x775da4);return _0x3c3edb['set'](_0x0661('0x23'),_0x8a5a6b+'-'+_0x49f81d+'/'+_0x47b649)['json'](_0x50f91c);}return null;};}function patchUpdates(_0x3ad28f){return function(_0x48edb2){try{jsonpatch[_0x0661('0x24')](_0x48edb2,_0x3ad28f,!![]);}catch(_0x402025){return BPromise['reject'](_0x402025);}return _0x48edb2['save']();};}function saveUpdates(_0xde9872,_0x3d72de){return function(_0x37ad2e){if(_0x37ad2e){return _0x37ad2e[_0x0661('0x25')](_0xde9872)[_0x0661('0x26')](function(_0x1c2194){return _0x1c2194;});}return null;};}function removeEntity(_0x5d7e10,_0x565865){return function(_0x148b2c){if(_0x148b2c){return _0x148b2c[_0x0661('0x27')]()[_0x0661('0x26')](function(){_0x5d7e10[_0x0661('0x1e')](0xcc)[_0x0661('0x1d')]();});}};}function handleEntityNotFound(_0x19a87c,_0x25739c){return function(_0x15bb43){if(!_0x15bb43){_0x19a87c['sendStatus'](0x194);}return _0x15bb43;};}function handleError(_0x56b7e5,_0x31f28a){_0x31f28a=_0x31f28a||0x1f4;return function(_0x1d6f78){logger[_0x0661('0x28')](_0x1d6f78[_0x0661('0x29')]);if(_0x1d6f78['name']){delete _0x1d6f78['name'];}_0x56b7e5[_0x0661('0x1e')](_0x31f28a)['send'](_0x1d6f78);};}function getInteractionUsers(_0x3ea8b7,_0x31416b){return new BPromise(function(_0x3165a0,_0x2e3a17){try{if(_0x31416b[_0x3ea8b7['id']]){_0x3ea8b7['Users']=_[_0x0661('0x2a')](_0x31416b[_0x3ea8b7['id']],function(_0x541f20){return{'id':_0x541f20['id'],'fullname':_0x541f20['fullname']};});}}catch(_0x5084fd){_0x2e3a17(_0x5084fd);}_0x3165a0(_0x3ea8b7);});}function getInteractionTags(_0x3b9420,_0x3b77f4){return new BPromise(function(_0x851bc2,_0x9e0d22){try{if(_0x3b9420[_0x0661('0x2b')]){_0x3b9420['Tags']=[];_0x3b9420[_0x0661('0x2b')][_0x0661('0x2c')](',')[_0x0661('0x2d')](function(_0x4d7813){_0x3b9420[_0x0661('0x2e')][_0x0661('0x2f')](_0x3b77f4[_0x4d7813]);});}delete _0x3b9420[_0x0661('0x2b')];}catch(_0x37bd86){_0x9e0d22(_0x37bd86);}_0x851bc2(_0x3b9420);});}function updateSmsInteraction(_0x5adfee,_0x2b211f,_0x3edfcb){return new BPromise(function(_0x549967,_0x2b57da){return getInteractionUsers(_0x5adfee,_0x3edfcb)[_0x0661('0x26')](function(_0x40d733){return getInteractionTags(_0x40d733,_0x2b211f);})['then'](function(_0x1845d9){return getStateInteraction(_0x1845d9);})[_0x0661('0x26')](function(_0x557599){_0x549967(_0x557599);})['catch'](function(_0xed94be){_0x2b57da(_0xed94be);});});}function getStateInteraction(_0x5aa102){return new BPromise(function(_0x2834dc){_0x5aa102[_0x0661('0x30')]=0x0;_0x5aa102[_0x0661('0x31')]=0x0;_0x5aa102[_0x0661('0x32')]=0x0;_0x5aa102[_0x0661('0x33')]=0x0;_0x5aa102['total']=0x0;if(!_0x5aa102[_0x0661('0x34')]&&!_0x5aa102[_0x0661('0x35')]){_0x5aa102['waiting']+=0x1;}if(!_0x5aa102[_0x0661('0x34')]&&_0x5aa102[_0x0661('0x35')]){_0x5aa102['talking']+=0x1;if(_0x5aa102[_0x0661('0x30')]){_0x5aa102[_0x0661('0x30')]-=0x1;}}if(_0x5aa102[_0x0661('0x34')]&&_0x5aa102['UserId']){_0x5aa102['answered']+=0x1;if(_0x5aa102[_0x0661('0x31')]){_0x5aa102[_0x0661('0x31')]-=0x1;}}if(_0x5aa102[_0x0661('0x34')]&&!_0x5aa102[_0x0661('0x35')]){_0x5aa102[_0x0661('0x33')]+=0x1;if(_0x5aa102[_0x0661('0x30')]){_0x5aa102[_0x0661('0x30')]-=0x1;}}_0x5aa102[_0x0661('0x36')]+=0x1;_0x2834dc(_0x5aa102);});}exports[_0x0661('0x37')]=function(_0x13a779,_0x49144f){var _0x3603f2={},_0x3fd07d={},_0x14df33={'count':0x0,'rows':[]};var _0x18ed75=_['map'](db[_0x0661('0x38')][_0x0661('0x39')],function(_0x4b08f8){return{'name':_0x4b08f8[_0x0661('0x3a')],'type':_0x4b08f8['type']['key']};});_0x3fd07d[_0x0661('0x3b')]=_[_0x0661('0x2a')](_0x18ed75,_0x0661('0x3c'));_0x3fd07d[_0x0661('0x3d')]=_[_0x0661('0x3e')](_0x13a779[_0x0661('0x3d')]);_0x3fd07d[_0x0661('0x3f')]=_['intersection'](_0x3fd07d[_0x0661('0x3b')],_0x3fd07d[_0x0661('0x3d')]);_0x3603f2[_0x0661('0x40')]=_[_0x0661('0x41')](_0x3fd07d[_0x0661('0x3b')],qs['fields'](_0x13a779[_0x0661('0x3d')][_0x0661('0x42')]));_0x3603f2[_0x0661('0x40')]=_0x3603f2[_0x0661('0x40')]['length']?_0x3603f2['attributes']:_0x3fd07d['model'];if(!_0x13a779[_0x0661('0x3d')][_0x0661('0x43')](_0x0661('0x44'))){_0x3603f2[_0x0661('0x22')]=qs[_0x0661('0x22')](_0x13a779[_0x0661('0x3d')][_0x0661('0x22')]);_0x3603f2[_0x0661('0x20')]=qs['offset'](_0x13a779['query'][_0x0661('0x20')]);}_0x3603f2[_0x0661('0x45')]=qs[_0x0661('0x46')](_0x13a779[_0x0661('0x3d')][_0x0661('0x46')]);_0x3603f2['where']=qs[_0x0661('0x3f')](_[_0x0661('0x47')](_0x13a779[_0x0661('0x3d')],_0x3fd07d[_0x0661('0x3f')]),_0x18ed75);var _0xb666e8=[];var _0x88718a=squel[_0x0661('0x48')]()[_0x0661('0x49')]('id')[_0x0661('0x49')](_0x0661('0x3c'))[_0x0661('0x49')]('color')[_0x0661('0x4a')]('tools_tags');var _0x4af396=squel['select']()[_0x0661('0x49')](_0x0661('0x4b'))[_0x0661('0x49')](_0x0661('0x4c'))[_0x0661('0x49')](_0x0661('0x4d'))[_0x0661('0x4a')](_0x0661('0x4e'),'ui')[_0x0661('0x4f')](_0x0661('0x50'),'u',_0x0661('0x51'));var _0x41078b=squel[_0x0661('0x48')]()[_0x0661('0x4a')](_0x0661('0x52'),'i')['left_join']('cm_contacts','c',_0x0661('0x53'))[_0x0661('0x4f')]('users','o',_0x0661('0x54'))[_0x0661('0x4f')](_0x0661('0x55'),'a',_0x0661('0x56'))[_0x0661('0x4f')](_0x0661('0x57'),'me',_0x0661('0x58'))[_0x0661('0x4f')]('sms_interaction_has_tags','it',_0x0661('0x59'))[_0x0661('0x4f')](_0x0661('0x5a'),'t',_0x0661('0x5b'));var _0x5aa16e=squel['expr']();var _0x2101be=[];var _0x3aab15=squel[_0x0661('0x5c')]();var _0x45146f;if(_0x13a779[_0x0661('0x3d')][_0x0661('0x5d')]){_0x45146f=as[_0x0661('0x5e')](_0x13a779[_0x0661('0x3d')][_0x0661('0x5d')]);var _0x3131a9=_0x45146f[_0x0661('0x5f')];for(var _0x1547cc=0x0;_0x1547cc<_0x45146f[_0x0661('0x60')][_0x0661('0x61')];_0x1547cc++){var _0x5bffde=_0x45146f[_0x0661('0x60')][_0x1547cc];var _0x5d9d8d='i';var _0x36d53b=_[_0x0661('0x62')](_0x18ed75,[_0x0661('0x3c'),_0x5bffde['field']]);if(!_0x36d53b){switch(_0x5bffde[_0x0661('0x49')]){case _0x0661('0x63'):if(_0x5bffde['value']==0x1){_0x41078b[_0x0661('0x64')]('`'+_0x5bffde[_0x0661('0x49')]+_0x0661('0x65'));}else{_0x41078b[_0x0661('0x64')]('`'+_0x5bffde[_0x0661('0x49')]+'`\x20>\x200');}break;case _0x0661('0x66'):if(_0x5bffde[_0x0661('0x67')]==='$substring'){if(_0x5bffde[_0x0661('0x68')][_0x0661('0x2c')]('\x20')[_0x0661('0x61')]>0x1){_0x5aa16e[_0x3131a9](_0x0661('0x69'),qs['getFullTextValue'](_0x5bffde[_0x0661('0x68')]),null);}else{var _0x572c11='%'+_0x5bffde[_0x0661('0x68')]+'%';_0x5aa16e[_0x3131a9](_0x0661('0x6a'),_0x572c11,_0x572c11,_0x572c11);}}else{_0x36d53b=_['find'](_0x18ed75,[_0x0661('0x3c'),_0x0661('0x6b')]);_0x5bffde[_0x0661('0x49')]=_0x0661('0x6b');_0x12b5f8=as[_0x0661('0x6c')](_0x5d9d8d,_0x36d53b['type'],_0x5bffde);_0x5aa16e[_0x3131a9](_0x12b5f8[_0x0661('0x6d')],_0x12b5f8[_0x0661('0x68')][_0x0661('0x6e')],_0x12b5f8[_0x0661('0x68')][_0x0661('0x1d')]);}break;case _0x0661('0x6f'):var _0x90d0e3=_0x5bffde[_0x0661('0x68')][_0x0661('0x2c')](',')['map'](function(_0x1d000d){return Number(_0x1d000d);});_0x90d0e3[_0x0661('0x2d')](function(_0x544a01){_0x3aab15['or'](_0x0661('0x70'),'%,'+_0x544a01+',%');});_0x2101be=_[_0x0661('0x71')](_0x2101be,_0x90d0e3);break;case'User':if(_0x5bffde['operator']===_0x0661('0x72')){_0x5aa16e[_0x3131a9](_0x0661('0x73'),'%'+_0x5bffde[_0x0661('0x68')]+'%',null);}else{_0x36d53b=_[_0x0661('0x62')](_0x18ed75,['name',_0x0661('0x35')]);_0x5bffde[_0x0661('0x49')]=_0x0661('0x35');_0x12b5f8=as[_0x0661('0x6c')](_0x5d9d8d,_0x36d53b['type'],_0x5bffde);_0x5aa16e[_0x3131a9](_0x12b5f8[_0x0661('0x6d')],_0x12b5f8[_0x0661('0x68')][_0x0661('0x6e')],_0x12b5f8[_0x0661('0x68')][_0x0661('0x1d')]);}break;case _0x0661('0x74'):_0x12b5f8=as[_0x0661('0x6c')]('me',null,_0x5bffde);_0x5aa16e[_0x3131a9](_0x12b5f8['text'],_0x12b5f8[_0x0661('0x68')][_0x0661('0x6e')],_0x12b5f8[_0x0661('0x68')][_0x0661('0x1d')]);break;}}else{var _0x12b5f8=as[_0x0661('0x6c')](_0x5d9d8d,_0x36d53b[_0x0661('0x75')],_0x5bffde);_0x5aa16e[_0x3131a9](_0x12b5f8['text'],_0x12b5f8[_0x0661('0x68')][_0x0661('0x6e')],_0x12b5f8['value']['end']);}}}else{var _0x6610b2=_(_0x13a779[_0x0661('0x3d')])[_0x0661('0x3e')]()[_0x0661('0x2a')](function(_0x40f69e){return _[_0x0661('0x76')](_0x18ed75,['name',_0x40f69e])?_0x40f69e:undefined;})[_0x0661('0x77')]()[_0x0661('0x68')]();if(!_[_0x0661('0x78')](_0x6610b2)){_0x6610b2[_0x0661('0x2d')](function(_0x4253ce){if(_0x4253ce===_0x0661('0x79')){_0x41078b['where']('i.SmsAccountId\x20IN\x20?',[]['concat'](_0x13a779[_0x0661('0x3d')][_0x4253ce]));}else if(_0x4253ce===_0x0661('0x7a')){var _0xa2b4fa=JSON['parse'](_0x13a779['query'][_0x4253ce])[_0x0661('0x7b')];var _0x100318=JSON[_0x0661('0x7c')](_0x13a779['query'][_0x4253ce])[_0x0661('0x7d')];_0x41078b[_0x0661('0x7e')](_0x0661('0x7f'),_0xa2b4fa,_0x100318);}else{if(_0x13a779[_0x0661('0x3d')][_0x4253ce]===_0x0661('0x80')){_0x41078b[_0x0661('0x7e')]('i.'+_0x4253ce+'\x20IS\x20NULL');}else{_0x41078b[_0x0661('0x7e')]('i.'+_0x4253ce+_0x0661('0x81'),_0x13a779[_0x0661('0x3d')][_0x4253ce]);}}});}if(_0x13a779['query']['read']){if(_0x13a779['query'][_0x0661('0x82')]==0x1){_0x41078b['having'](_0x0661('0x83'));}else{_0x41078b['having']('`unreadMessages`\x20>\x200');}}if(_0x13a779['query'][_0x0661('0x84')]){_0x2101be=_['isArray'](_0x13a779[_0x0661('0x3d')][_0x0661('0x84')])?_0x13a779[_0x0661('0x3d')][_0x0661('0x84')]:new Array(_0x13a779['query']['tag']);_0x2101be['forEach'](function(_0x343cb0){_0x3aab15['or'](_0x0661('0x70'),'%,'+_0x343cb0+',%');});}if(_0x13a779[_0x0661('0x3d')][_0x0661('0x85')]){var _0x4a54ec=_0x13a779['query'][_0x0661('0x85')][_0x0661('0x86')]('\x5c','\x5c\x5c')[_0x0661('0x86')](/'/g,'\x27\x27');if(qs[_0x0661('0x87')](_0x4a54ec)){_0x5aa16e['or']('i.id\x20LIKE\x20?',_0x4a54ec+'%')['or']('i.phone\x20LIKE\x20?',_0x4a54ec+'%');}else{_0x5aa16e['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0661('0x88')](_0x4a54ec))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x4a54ec+'%');}}}_0x41078b['where'](_0x5aa16e);_0x41078b[_0x0661('0x89')](_0x0661('0x8a'));var _0x531d1c={'type':db[_0x0661('0x8b')][_0x0661('0x8c')]['SELECT'],'raw':!![]};var _0x78c8f6=_0x41078b[_0x0661('0x8d')]();_0x78c8f6[_0x0661('0x49')](_0x0661('0x8a'));_0x78c8f6[_0x0661('0x49')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x0661('0x63'));if(_0x3603f2[_0x0661('0x45')]){_0x3603f2[_0x0661('0x45')][_0x0661('0x2d')](function(_0x368a73){var _0x123cf1=_0x368a73[0x0]===_0x0661('0x8e')?_0x368a73[0x0]:'i.'+_0x368a73[0x0];_0x41078b[_0x0661('0x45')](_0x123cf1,_0x368a73[0x1]===_0x0661('0x8f')?![]:!![]);});}if(!_['isEmpty'](_0x2101be)){_0x41078b[_0x0661('0x64')](_0x3aab15);_0x78c8f6[_0x0661('0x7e')](_0x0661('0x90'),_0x2101be);}BPromise[_0x0661('0x91')]()[_0x0661('0x26')](function(){if(!_0x45146f){if(_0x13a779[_0x0661('0x3d')][_0x0661('0x79')])return;_0x78c8f6[_0x0661('0x7e')](_0x0661('0x92'));_0x41078b[_0x0661('0x7e')](_0x0661('0x92'));return;}if(_0x13a779[_0x0661('0x93')][_0x0661('0x94')]!==_0x0661('0x95'))return;return _0x13a779['user']['getSmsAccounts']({'attributes':['id'],'raw':!![]})[_0x0661('0x26')](function(_0x4e4a14){if(_[_0x0661('0x78')](_0x4e4a14)){_0x78c8f6[_0x0661('0x7e')](_0x0661('0x96'));_0x41078b[_0x0661('0x7e')]('i.SmsAccountId\x20IS\x20NULL');}else{_0x78c8f6['where']('i.SmsAccountId\x20IN\x20?',_[_0x0661('0x2a')](_0x4e4a14,'id'));_0x41078b[_0x0661('0x7e')]('i.SmsAccountId\x20IN\x20?',_[_0x0661('0x2a')](_0x4e4a14,'id'));}});})[_0x0661('0x26')](function(){if(_0x13a779[_0x0661('0x93')]['role']===_0x0661('0x95')&&!_0x45146f&&!_0x13a779[_0x0661('0x3d')][_0x0661('0x79')])return[];return db['sequelize'][_0x0661('0x3d')](_0x78c8f6[_0x0661('0x97')](),_0x531d1c);})['then'](function(_0x3a0983){_0x14df33[_0x0661('0x98')]=_0x3a0983[_0x0661('0x61')];if(_0x14df33[_0x0661('0x98')]===0x0)return[];return db[_0x0661('0x99')][_0x0661('0x3d')](_0x88718a[_0x0661('0x97')](),_0x531d1c)[_0x0661('0x26')](function(_0x5a7212){_0xb666e8=_[_0x0661('0x9a')](_0x5a7212,'id');_0x531d1c=_[_0x0661('0x9b')](_0x531d1c,{'model':db[_0x0661('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x13a779['query']['fields']){_0x3603f2[_0x0661('0x40')][_0x0661('0x2d')](function(_0x260e5a){_0x41078b['field']('i.'+_0x260e5a);});}else{_0x41078b[_0x0661('0x49')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x0661('0x63'));_0x41078b[_0x0661('0x49')](_0x0661('0x9c'),'Account.key');_0x41078b['field'](_0x0661('0x9d'),_0x0661('0x9e'));_0x41078b[_0x0661('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',_0x0661('0x8e'));_0x41078b['field'](_0x0661('0x9f'));_0x41078b['field']('c.firstName',_0x0661('0xa0'));_0x41078b['field'](_0x0661('0xa1'),'Contact.lastName');_0x41078b[_0x0661('0x49')](_0x0661('0xa2'),'Contact.email');_0x41078b[_0x0661('0x49')](_0x0661('0xa3'),_0x0661('0xa4'));_0x41078b[_0x0661('0x49')](_0x0661('0xa5'),_0x0661('0xa6'));_0x41078b[_0x0661('0x49')](_0x0661('0xa7'),'Contact.fax');_0x41078b[_0x0661('0x49')](_0x0661('0xa8'),_0x0661('0xa9'));_0x41078b[_0x0661('0x49')](_0x0661('0xaa'),_0x0661('0xab'));_0x41078b[_0x0661('0x49')](_0x0661('0xac'),_0x0661('0x2b'));}if(_0x3603f2[_0x0661('0x22')])_0x41078b[_0x0661('0x22')](_0x3603f2[_0x0661('0x22')]);if(_0x3603f2[_0x0661('0x20')])_0x41078b['offset'](_0x3603f2[_0x0661('0x20')]);return db[_0x0661('0x99')][_0x0661('0x3d')](_0x41078b[_0x0661('0x97')](),_0x531d1c);})[_0x0661('0x26')](function(_0x289eef){if(_0x289eef['length']>0x0)_0x4af396[_0x0661('0x7e')](_0x0661('0xad'),_[_0x0661('0x2a')](_0x289eef,'id'));return db[_0x0661('0x99')]['query'](_0x4af396[_0x0661('0x97')](),_0x531d1c)[_0x0661('0x26')](function(_0x4c964b){var _0x53b730=_[_0x0661('0xae')](_0x4c964b,_0x0661('0xaf'));var _0x25a436=[];_0x289eef[_0x0661('0x2d')](function(_0x201963){_0x25a436[_0x0661('0x2f')](updateSmsInteraction(_0x201963,_0xb666e8,_0x53b730));});return BPromise[_0x0661('0xb0')](_0x25a436);});});})['then'](function(_0x575f44){_0x14df33['rows']=_0x575f44;return _0x14df33;})[_0x0661('0x26')](respondWithFilteredResult(_0x49144f,_0x3603f2))[_0x0661('0xb1')](handleError(_0x49144f,null));};exports['show']=function(_0x4ea43f,_0x2573ed){var _0x1fc618={'raw':![],'where':{'id':_0x4ea43f[_0x0661('0xb2')]['id']}},_0x4a37ec={};_0x4a37ec[_0x0661('0x3b')]=_['keys'](db[_0x0661('0x38')][_0x0661('0x39')]);_0x4a37ec[_0x0661('0x3d')]=_[_0x0661('0x3e')](_0x4ea43f[_0x0661('0x3d')]);_0x4a37ec[_0x0661('0x3f')]=_[_0x0661('0x41')](_0x4a37ec[_0x0661('0x3b')],_0x4a37ec['query']);_0x1fc618[_0x0661('0x40')]=_[_0x0661('0x41')](_0x4a37ec['model'],qs[_0x0661('0x42')](_0x4ea43f[_0x0661('0x3d')][_0x0661('0x42')]));_0x1fc618[_0x0661('0x40')]=_0x1fc618[_0x0661('0x40')][_0x0661('0x61')]?_0x1fc618[_0x0661('0x40')]:_0x4a37ec[_0x0661('0x3b')];if(_0x4ea43f[_0x0661('0x3d')]['includeAll']){_0x1fc618[_0x0661('0xb3')]=[{'all':!![]}];}_0x1fc618=_[_0x0661('0x9b')]({},_0x1fc618,_0x4ea43f['options']);return db['SmsInteraction'][_0x0661('0x62')](_0x1fc618)['then'](handleEntityNotFound(_0x2573ed,null))[_0x0661('0x26')](respondWithResult(_0x2573ed,null))[_0x0661('0xb1')](handleError(_0x2573ed,null));};exports[_0x0661('0xb4')]=function(_0x347fa7,_0x364af9){return db['SmsInteraction'][_0x0661('0xb4')](_0x347fa7[_0x0661('0x74')],{})['then'](respondWithResult(_0x364af9,0xc9))[_0x0661('0xb1')](handleError(_0x364af9,null));};exports['update']=function(_0x5e62d1,_0x4e1c2e){if(_0x5e62d1[_0x0661('0x74')]['id']){delete _0x5e62d1[_0x0661('0x74')]['id'];}return db[_0x0661('0x38')][_0x0661('0x62')]({'where':{'id':_0x5e62d1['params']['id']}})[_0x0661('0x26')](handleEntityNotFound(_0x4e1c2e,null))[_0x0661('0x26')](saveUpdates(_0x5e62d1[_0x0661('0x74')],null))[_0x0661('0x26')](respondWithResult(_0x4e1c2e,null))[_0x0661('0xb1')](handleError(_0x4e1c2e,null));};exports[_0x0661('0x27')]=function(_0xc46642,_0x16b955){return db[_0x0661('0x38')][_0x0661('0x62')]({'where':{'id':_0xc46642[_0x0661('0xb2')]['id']}})['then'](handleEntityNotFound(_0x16b955,null))[_0x0661('0x26')](removeEntity(_0x16b955,null))[_0x0661('0xb1')](handleError(_0x16b955,null));};exports[_0x0661('0xb5')]=function(_0x989400,_0x14203d){return db[_0x0661('0x38')][_0x0661('0xb5')]()[_0x0661('0x26')](respondWithResult(_0x14203d,null))[_0x0661('0xb1')](handleError(_0x14203d,null));};exports['addMessage']=function(_0x1a1370,_0x286797,_0x265182){return db[_0x0661('0xb6')][_0x0661('0x62')]({'where':{'id':_0x1a1370['params']['id']}})[_0x0661('0x26')](handleEntityNotFound(_0x286797,null))[_0x0661('0x26')](function(_0x2bba11){if(_0x2bba11){return _0x2bba11[_0x0661('0xb7')](_0x1a1370[_0x0661('0x74')]['ids'],_[_0x0661('0xb8')](_0x1a1370['body'],[_0x0661('0xb9'),'id'])||{});}})['then'](respondWithResult(_0x286797,null))['catch'](handleError(_0x286797,null));};exports[_0x0661('0xba')]=function(_0x2f5195,_0x21d8f4,_0x9141f0){var _0x283bd9={'raw':![],'where':{}};var _0x47ff12={};var _0x3ed1bf={'count':0x0,'rows':[]};return db['SmsInteraction'][_0x0661('0xbb')]({'where':{'id':_0x2f5195['params']['id']}})[_0x0661('0x26')](handleEntityNotFound(_0x21d8f4,null))[_0x0661('0x26')](function(_0x4d5bff){if(_0x4d5bff){_0x47ff12[_0x0661('0x3b')]=_['keys'](db[_0x0661('0xb6')][_0x0661('0x39')]);_0x47ff12[_0x0661('0x3d')]=_[_0x0661('0x3e')](_0x2f5195[_0x0661('0x3d')]);_0x47ff12[_0x0661('0x3f')]=_[_0x0661('0x41')](_0x47ff12[_0x0661('0x3b')],_0x47ff12[_0x0661('0x3d')]);_0x283bd9[_0x0661('0x40')]=_[_0x0661('0x41')](_0x47ff12[_0x0661('0x3b')],qs[_0x0661('0x42')](_0x2f5195['query']['fields']));_0x283bd9[_0x0661('0x40')]=_0x283bd9['attributes'][_0x0661('0x61')]?_0x283bd9[_0x0661('0x40')]:_0x47ff12[_0x0661('0x3b')];if(!_0x2f5195['query'][_0x0661('0x43')](_0x0661('0x44'))){_0x283bd9[_0x0661('0x22')]=qs[_0x0661('0x22')](_0x2f5195['query']['limit']);_0x283bd9['offset']=qs[_0x0661('0x20')](_0x2f5195[_0x0661('0x3d')][_0x0661('0x20')]);}_0x283bd9[_0x0661('0x45')]=qs['sort'](_0x2f5195[_0x0661('0x3d')][_0x0661('0x46')]);_0x283bd9[_0x0661('0x7e')]=qs[_0x0661('0x3f')](_[_0x0661('0x47')](_0x2f5195[_0x0661('0x3d')],_0x47ff12[_0x0661('0x3f')]));_0x283bd9[_0x0661('0x7e')]['SmsInteractionId']=_0x4d5bff['id'];if(_0x2f5195[_0x0661('0x3d')][_0x0661('0x85')]){_0x283bd9[_0x0661('0x7e')]=_[_0x0661('0x9b')](_0x283bd9[_0x0661('0x7e')],{'$or':_[_0x0661('0x2a')](_0x283bd9['attributes'],function(_0x1b3feb){var _0x4b2304={};_0x4b2304[_0x1b3feb]={'$like':'%'+_0x2f5195[_0x0661('0x3d')][_0x0661('0x85')]+'%'};return _0x4b2304;})});}if(_0x2f5195[_0x0661('0x3d')][_0x0661('0x7b')]){var _0x13068f=_0x2f5195[_0x0661('0x3d')][_0x0661('0x7b')]['split'](',');var _0x31042b={};_0x31042b[_0x13068f[0x0]]={'$gte':moment(_0x13068f[0x1])[_0x0661('0xbc')](_0x0661('0xbd'))};_0x283bd9['where']=_[_0x0661('0x9b')](_0x283bd9[_0x0661('0x7e')],_0x31042b);}_0x283bd9=_['merge']({},_0x283bd9,_0x2f5195[_0x0661('0xbe')]);return db[_0x0661('0xb6')]['count']({'where':_0x283bd9[_0x0661('0x7e')]})[_0x0661('0x26')](function(_0x1509c5){_0x3ed1bf[_0x0661('0x98')]=_0x1509c5;if(_0x2f5195[_0x0661('0x3d')][_0x0661('0xbf')]){_0x283bd9[_0x0661('0xb3')]=[{'all':!![]}];}return db[_0x0661('0xb6')][_0x0661('0xc0')](_0x283bd9);})[_0x0661('0x26')](function(_0x5103f0){_0x3ed1bf[_0x0661('0xc1')]=_0x5103f0;return _0x3ed1bf;});}})[_0x0661('0x26')](respondWithFilteredResult(_0x21d8f4,_0x283bd9))[_0x0661('0xb1')](handleError(_0x21d8f4,null));};exports[_0x0661('0xc2')]=function(_0x5e585c,_0x4e53b3,_0x2a0936){return db['SmsInteraction'][_0x0661('0x62')]({'where':{'id':_0x5e585c[_0x0661('0xb2')]['id']}})[_0x0661('0x26')](handleEntityNotFound(_0x4e53b3,null))['then'](function(_0x1a2fd9){if(_0x1a2fd9){return _0x1a2fd9[_0x0661('0xc3')](_0x5e585c['body']['ids'],_[_0x0661('0xb8')](_0x5e585c[_0x0661('0x74')],[_0x0661('0xb9'),'id'])||{})[_0x0661('0xc4')](function(){return db[_0x0661('0x6f')]['findAll']({'attributes':['id','name',_0x0661('0xc5')],'where':{'id':_0x5e585c[_0x0661('0x74')][_0x0661('0xb9')]}});})[_0x0661('0x26')](function(_0x548b27){socket[_0x0661('0xc6')](_0x0661('0xc7'),{'id':Number(_0x5e585c[_0x0661('0xb2')]['id']),'tags':_0x548b27||[]});return{'id':Number(_0x5e585c[_0x0661('0xb2')]['id']),'tags':_0x548b27||[]};});}})[_0x0661('0x26')](respondWithResult(_0x4e53b3,null))[_0x0661('0xb1')](handleError(_0x4e53b3,null));};exports['removeTags']=function(_0x140cf2,_0x5f2ec6,_0x3ab681){return db['SmsInteraction'][_0x0661('0x62')]({'where':{'id':_0x140cf2[_0x0661('0xb2')]['id']}})[_0x0661('0x26')](handleEntityNotFound(_0x5f2ec6,null))[_0x0661('0x26')](function(_0x5e71f1){if(_0x5e71f1){return _0x5e71f1[_0x0661('0xc8')](_0x140cf2['query'][_0x0661('0xb9')]);}})['then'](respondWithStatusCode(_0x5f2ec6,null))[_0x0661('0xb1')](handleError(_0x5f2ec6,null));};exports[_0x0661('0xc9')]=function(_0x391ad9,_0x1f3303){var _0x23abe3=moment()[_0x0661('0xca')]()[_0x0661('0x97')]();var _0xb40c76=path[_0x0661('0xcb')](config['root'],_0x0661('0xcc'),_0x0661('0xcd'),'tmp');var _0x43b7c1=path['join'](config['root'],_0x0661('0xcc'),_0x0661('0xcd'),_0x0661('0xce'));var _0x1c199d=path[_0x0661('0xcb')](_0xb40c76,_0x23abe3);var _0x480676=util[_0x0661('0xbc')](_0x0661('0xcf'),_0x391ad9[_0x0661('0xb2')]['id'],_0x23abe3);var _0x46649b=path[_0x0661('0xcb')](_0xb40c76,_0x480676);var _0x1a79b8=[];_0x1a79b8[_0x0661('0x2f')]({'model':db[_0x0661('0xd0')],'as':_0x0661('0xd0'),'attributes':['id',_0x0661('0xd1')],'raw':!![]});_0x1a79b8['push']({'model':db[_0x0661('0xd2')],'as':'Contact','attributes':['id',_0x0661('0xd3'),_0x0661('0xd4')],'raw':!![]});var _0x368b13=[{'model':db[_0x0661('0xb6')],'as':_0x0661('0xd5'),'attributes':['id',_0x0661('0x74'),_0x0661('0x7a'),'direction',_0x0661('0xd6'),_0x0661('0x82')],'include':_0x1a79b8}];_0x368b13[_0x0661('0x2f')]({'model':db['SmsAccount'],'as':_0x0661('0xd7'),'attributes':['id',_0x0661('0x3c')]});_0x368b13[_0x0661('0x2f')]({'model':db[_0x0661('0xd0')],'as':'Owner','attributes':['id',_0x0661('0xd1')]});return db[_0x0661('0x38')]['find']({'where':{'id':_0x391ad9['params']['id']},'include':_0x368b13})[_0x0661('0x26')](handleEntityNotFound(_0x1f3303,null))[_0x0661('0x26')](function(_0xcd3cd5){if(_0xcd3cd5){var _0x4a72c8=_0xcd3cd5[_0x0661('0xd8')]({'plain':!![]});fs[_0x0661('0xd9')](_0x1c199d);var _0x175cfb={'channel':_0x0661('0xda'),'account':_0x4a72c8['Account'][_0x0661('0x3c')],'agent':_0x4a72c8['Owner']?_0x4a72c8[_0x0661('0xdb')][_0x0661('0xd1')]:'N.A.','createdAt':moment(_0x4a72c8['createdAt'])[_0x0661('0xbc')](_0x0661('0xbd'))[_0x0661('0x97')](),'closedAt':_0x4a72c8[_0x0661('0x34')]?moment(_0x4a72c8['closedAt'])[_0x0661('0xbc')](_0x0661('0xbd'))[_0x0661('0x97')]():'','disposition':_0x4a72c8[_0x0661('0xdc')],'messages':_(_0x4a72c8[_0x0661('0xd5')])[_0x0661('0x85')]({'secret':![]})[_0x0661('0x2a')](function(_0x55ca29){return{'date':moment(_0x55ca29['createdAt'])[_0x0661('0xbc')]('YYYY-MM-DD\x20HH:mm:ss')[_0x0661('0x97')](),'sender':_0x55ca29[_0x0661('0xdd')]==='out'?_0x55ca29['User']?_0x55ca29['User'][_0x0661('0xd1')]:_0x0661('0xde'):_0x55ca29[_0x0661('0x66')][_0x0661('0xd3')]+(_0x55ca29['Contact'][_0x0661('0xd4')]?'\x20'+_0x55ca29[_0x0661('0x66')][_0x0661('0xd4')]:''),'body':_0x55ca29[_0x0661('0x74')],'direction':_0x55ca29[_0x0661('0xdd')]==='out'?'A':'C','secret':_0x55ca29[_0x0661('0xd6')],'read':_0x55ca29[_0x0661('0x82')]};})[_0x0661('0x68')]()};return ejs['renderFile'](path[_0x0661('0xcb')](config[_0x0661('0xdf')],_0x0661('0xcc'),_0x0661('0xe0'),_0x0661('0xe1')),{'interaction':_0x175cfb})[_0x0661('0x26')](function(_0x33f94e){var _0xfb9c55=path[_0x0661('0xcb')](_0x1c199d,'transcript-'+_0x4a72c8['id']+'-'+_0x23abe3+_0x0661('0xe2'));var _0x2bb1fe={'path':_0xfb9c55,'channel':'Sms','interactionId':_0x4a72c8['id']};return pdf['createPdfFromHTML'](_0x33f94e,_0x2bb1fe);})[_0x0661('0x26')](function(){return new BPromise(function(_0x53dc4c,_0x894e08){zipdir(_0x1c199d,{'saveTo':_0x46649b},function(_0x4ea218,_0x5eb9a0){if(_0x4ea218)return _0x894e08(_0x4ea218);return _0x53dc4c(_0x5eb9a0);});})[_0x0661('0x26')](function(){return new BPromise(function(_0x37433f,_0xa1354f){rimraf(_0x1c199d,function(_0x6e0861){if(_0x6e0861)_0xa1354f(_0x6e0861);return _0x37433f();});});})[_0x0661('0x26')](function(){return _0x1f3303[_0x0661('0xc9')](_0x46649b,_0x480676,function(_0x14d786){if(_0x14d786){console[_0x0661('0xe3')]('err',_0x14d786);}else{fs[_0x0661('0xe4')](_0x46649b);}});});});}else{return _0x1f3303[_0x0661('0x1c')](0xc8);}})[_0x0661('0xb1')](handleError(_0x1f3303,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index d359b43..e4a5fce 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 _0x4cf8=['unreadMessages','length','emit','catch','exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','findAll'];(function(_0x2fedd9,_0x52dcf5){var _0x1ebc6c=function(_0x4d9d47){while(--_0x4d9d47){_0x2fedd9['push'](_0x2fedd9['shift']());}};_0x1ebc6c(++_0x52dcf5);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x3074f3,_0x4f2c03){_0x3074f3=_0x3074f3-0x0;var _0x53f112=_0x4cf8[_0x3074f3];return _0x53f112;};'use strict';var EventEmitter=require(_0x84cf('0x0'));var SmsInteraction=require(_0x84cf('0x1'))['db'][_0x84cf('0x2')];var SmsMessage=require(_0x84cf('0x1'))['db'][_0x84cf('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x84cf('0x4')](0x0);var events={'afterCreate':_0x84cf('0x5'),'afterUpdate':_0x84cf('0x6'),'afterDestroy':_0x84cf('0x7')};function emitEvent(_0x2d38c0){return function(_0x5844d7,_0x2c613d,_0x50ade2){_0x5844d7['getUsers']({'attributes':['id'],'raw':!![]})[_0x84cf('0x8')](function(_0x56c5cc){_0x5844d7[_0x84cf('0x9')](_0x84cf('0xa'),_0x56c5cc['map'](function(_0x2e0b79){return{'id':_0x2e0b79['id']};}));return SmsMessage[_0x84cf('0xb')]({'where':{'SmsInteractionId':_0x5844d7['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0xfb5398){_0x5844d7[_0x84cf('0x9')](_0x84cf('0xc'),_0xfb5398[_0x84cf('0xd')]);SmsInteractionEvents['emit'](_0x2d38c0+':'+_0x5844d7['id'],_0x5844d7);SmsInteractionEvents[_0x84cf('0xe')](_0x2d38c0,_0x5844d7);_0x50ade2(null);})[_0x84cf('0xf')](_0x50ade2(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x84cf('0x10')]=SmsInteractionEvents; \ No newline at end of file +var _0x0598=['catch','hasOwnProperty','events','../../mysqldb','save','update','setDataValue','Users','map','then','unreadMessages','length'];(function(_0x5af842,_0x168765){var _0x70b917=function(_0x145469){while(--_0x145469){_0x5af842['push'](_0x5af842['shift']());}};_0x70b917(++_0x168765);}(_0x0598,0x92));var _0x8059=function(_0x189a4f,_0x23118b){_0x189a4f=_0x189a4f-0x0;var _0x37a8c9=_0x0598[_0x189a4f];return _0x37a8c9;};'use strict';var EventEmitter=require(_0x8059('0x0'));var SmsInteraction=require(_0x8059('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0x8059('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8059('0x2'),'afterUpdate':_0x8059('0x3'),'afterDestroy':'remove'};function emitEvent(_0x54f42f){return function(_0x555fb5,_0x467206,_0xa7d7c1){_0x555fb5['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x248273){_0x555fb5[_0x8059('0x4')](_0x8059('0x5'),_0x248273[_0x8059('0x6')](function(_0x5df268){return{'id':_0x5df268['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x555fb5['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8059('0x7')](function(_0x1bf5fd){_0x555fb5[_0x8059('0x4')](_0x8059('0x8'),_0x1bf5fd[_0x8059('0x9')]);SmsInteractionEvents['emit'](_0x54f42f+':'+_0x555fb5['id'],_0x555fb5);SmsInteractionEvents['emit'](_0x54f42f,_0x555fb5);_0xa7d7c1(null);})[_0x8059('0xa')](_0xa7d7c1(null));};}for(var e in events){if(events[_0x8059('0xb')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 86df004..c043bd3 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 _0x345b=['path','rimraf','../../config/environment','./smsInteraction.attributes','SmsInteraction','sms_interactions','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1c3f13,_0x30c44d){var _0x2095c0=function(_0x2ae6d8){while(--_0x2ae6d8){_0x1c3f13['push'](_0x1c3f13['shift']());}};_0x2095c0(++_0x30c44d);}(_0x345b,0x149));var _0xb345=function(_0x532127,_0xfd6f56){_0x532127=_0x532127-0x0;var _0x29cd22=_0x345b[_0x532127];return _0x29cd22;};'use strict';var _=require(_0xb345('0x0'));var util=require(_0xb345('0x1'));var logger=require(_0xb345('0x2'))(_0xb345('0x3'));var moment=require(_0xb345('0x4'));var BPromise=require(_0xb345('0x5'));var rp=require(_0xb345('0x6'));var fs=require('fs');var path=require(_0xb345('0x7'));var rimraf=require(_0xb345('0x8'));var config=require(_0xb345('0x9'));var attributes=require(_0xb345('0xa'));module['exports']=function(_0x428080,_0xa906d2){return _0x428080['define'](_0xb345('0xb'),attributes,{'tableName':_0xb345('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2ae8bf,_0x31b025,_0x27900b){if(_0x2ae8bf[_0xb345('0xd')]('closed')){_0x2ae8bf[_0xb345('0xe')]=moment()['format'](_0xb345('0xf'));}_0x27900b(null,_0x2ae8bf);}}});}; \ No newline at end of file +var _0x38c4=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','SmsInteraction','sms_interactions','changed','closed','format','lodash','util','../../config/logger'];(function(_0x29cf89,_0x10ce1f){var _0x34ac61=function(_0x5b29c2){while(--_0x5b29c2){_0x29cf89['push'](_0x29cf89['shift']());}};_0x34ac61(++_0x10ce1f);}(_0x38c4,0x11e));var _0x438c=function(_0x544e77,_0x5183eb){_0x544e77=_0x544e77-0x0;var _0x56b436=_0x38c4[_0x544e77];return _0x56b436;};'use strict';var _=require(_0x438c('0x0'));var util=require(_0x438c('0x1'));var logger=require(_0x438c('0x2'))(_0x438c('0x3'));var moment=require(_0x438c('0x4'));var BPromise=require(_0x438c('0x5'));var rp=require(_0x438c('0x6'));var fs=require('fs');var path=require(_0x438c('0x7'));var rimraf=require(_0x438c('0x8'));var config=require(_0x438c('0x9'));var attributes=require(_0x438c('0xa'));module[_0x438c('0xb')]=function(_0x34a1ab,_0x22442e){return _0x34a1ab['define'](_0x438c('0xc'),attributes,{'tableName':_0x438c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x485fba,_0x5b0118,_0x2d2ad7){if(_0x485fba[_0x438c('0xe')](_0x438c('0xf'))){_0x485fba['closedAt']=moment()[_0x438c('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2d2ad7(null,_0x485fba);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index dacafcf..52291ed 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 _0x90b8=['then','addTags','ids','omit','spread','AddTags','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','request','info','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','SmsInteraction,\x20%s,\x20%s','message','result','catch','UpdateSmsInteraction','body','options','raw','where','limit','AddTagsToSmsInteraction','find'];(function(_0x532316,_0x4f5259){var _0x4e1076=function(_0x18ba10){while(--_0x18ba10){_0x532316['push'](_0x532316['shift']());}};_0x4e1076(++_0x4f5259);}(_0x90b8,0x1f2));var _0x890b=function(_0x4bcfa6,_0x1c7e43){_0x4bcfa6=_0x4bcfa6-0x0;var _0x1c0165=_0x90b8[_0x4bcfa6];return _0x1c0165;};'use strict';var _=require(_0x890b('0x0'));var util=require('util');var moment=require(_0x890b('0x1'));var BPromise=require('bluebird');var rs=require(_0x890b('0x2'));var fs=require('fs');var Redis=require(_0x890b('0x3'));var db=require(_0x890b('0x4'))['db'];var utils=require(_0x890b('0x5'));var logger=require(_0x890b('0x6'))(_0x890b('0x7'));var config=require(_0x890b('0x8'));var jayson=require(_0x890b('0x9'));var client=jayson['client'][_0x890b('0xa')]({'port':0x232a});config[_0x890b('0xb')]=_[_0x890b('0xc')](config[_0x890b('0xb')],{'host':_0x890b('0xd'),'port':0x18eb});var socket=require(_0x890b('0xe'))(new Redis(config['redis']));require(_0x890b('0xf'))['register'](socket);function respondWithRpcPromise(_0x3b7b33,_0x3508d4,_0x305b99){return new BPromise(function(_0xaef9c3,_0x7aa1f){return client[_0x890b('0x10')](_0x3b7b33,_0x305b99)['then'](function(_0x22a047){logger[_0x890b('0x11')]('SmsInteraction,\x20%s,\x20%s',_0x3508d4,_0x890b('0x12'));logger[_0x890b('0x13')](_0x890b('0x14'),_0x3508d4,_0x890b('0x12'),JSON[_0x890b('0x15')](_0x22a047));if(_0x22a047[_0x890b('0x16')]){if(_0x22a047[_0x890b('0x16')]['code']===0x1f4){logger[_0x890b('0x16')](_0x890b('0x17'),_0x3508d4,_0x22a047[_0x890b('0x16')][_0x890b('0x18')]);return _0x7aa1f(_0x22a047[_0x890b('0x16')][_0x890b('0x18')]);}logger['error'](_0x890b('0x17'),_0x3508d4,_0x22a047[_0x890b('0x16')][_0x890b('0x18')]);return _0xaef9c3(_0x22a047[_0x890b('0x16')][_0x890b('0x18')]);}else{logger[_0x890b('0x11')]('SmsInteraction,\x20%s,\x20%s',_0x3508d4,'request\x20sent');_0xaef9c3(_0x22a047[_0x890b('0x19')][_0x890b('0x18')]);}})[_0x890b('0x1a')](function(_0x5a7572){logger[_0x890b('0x16')](_0x890b('0x17'),_0x3508d4,_0x5a7572);_0x7aa1f(_0x5a7572);});});}exports[_0x890b('0x1b')]=function(_0x73f12c){var _0x37615d=this;return new Promise(function(_0xb2b204,_0x30bc82){return db['SmsInteraction']['update'](_0x73f12c[_0x890b('0x1c')],{'raw':_0x73f12c[_0x890b('0x1d')]?_0x73f12c[_0x890b('0x1d')][_0x890b('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x73f12c['options']?_0x73f12c['options'][_0x890b('0x1f')]||null:null,'attributes':_0x73f12c[_0x890b('0x1d')]?_0x73f12c['options']['attributes']||null:null,'limit':_0x73f12c[_0x890b('0x1d')]?_0x73f12c[_0x890b('0x1d')][_0x890b('0x20')]||null:null})['then'](function(_0x2ea69f){logger['info'](_0x890b('0x1b'),_0x73f12c);logger[_0x890b('0x13')]('UpdateSmsInteraction',_0x73f12c,JSON[_0x890b('0x15')](_0x2ea69f));_0xb2b204(_0x2ea69f);})[_0x890b('0x1a')](function(_0x351eff){logger[_0x890b('0x16')](_0x890b('0x1b'),_0x351eff['message'],_0x73f12c);_0x30bc82(_0x37615d[_0x890b('0x16')](0x1f4,_0x351eff[_0x890b('0x18')]));});});};exports[_0x890b('0x21')]=function(_0x51ea02){return new Promise(function(_0x52f2b4,_0x35e21f){return db['SmsInteraction'][_0x890b('0x22')]({'where':_0x51ea02['options']?_0x51ea02['options'][_0x890b('0x1f')]||null:null})[_0x890b('0x23')](function(_0x40c227){if(_0x40c227){return _0x40c227[_0x890b('0x24')](_0x51ea02['body'][_0x890b('0x25')],_[_0x890b('0x26')](_0x51ea02[_0x890b('0x1c')],['ids','id'])||{});}})[_0x890b('0x27')](function(_0x1e75ff){logger[_0x890b('0x11')](_0x890b('0x28'),_0x51ea02);logger[_0x890b('0x13')](_0x890b('0x28'),_0x51ea02,JSON[_0x890b('0x15')](_0x1e75ff));_0x52f2b4(_0x1e75ff);})['catch'](function(_0x1caeff){logger['error'](_0x890b('0x28'),_0x1caeff[_0x890b('0x18')],_0x51ea02);_0x35e21f(_this[_0x890b('0x16')](0x1f4,_0x1caeff[_0x890b('0x18')]));});});}; \ No newline at end of file +var _0x5b74=['AddTagsToSmsInteraction','SmsInteraction','find','where','addTags','ids','omit','spread','AddTags','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./smsInteraction.socket','then','info','SmsInteraction,\x20%s,\x20%s','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','UpdateSmsInteraction','body','options','raw','attributes','limit','debug','catch'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0x5b74,0x1a4));var _0x45b7=function(_0x5d5cd7,_0x5e10b7){_0x5d5cd7=_0x5d5cd7-0x0;var _0x3ae18e=_0x5b74[_0x5d5cd7];return _0x3ae18e;};'use strict';var _=require(_0x45b7('0x0'));var util=require(_0x45b7('0x1'));var moment=require(_0x45b7('0x2'));var BPromise=require(_0x45b7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x45b7('0x4'));var db=require(_0x45b7('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x45b7('0x6'));var config=require(_0x45b7('0x7'));var jayson=require(_0x45b7('0x8'));var client=jayson[_0x45b7('0x9')][_0x45b7('0xa')]({'port':0x232a});config['redis']=_[_0x45b7('0xb')](config[_0x45b7('0xc')],{'host':_0x45b7('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x45b7('0xc')]));require(_0x45b7('0xe'))['register'](socket);function respondWithRpcPromise(_0x2ccee5,_0x42bdae,_0x3436e1){return new BPromise(function(_0x332980,_0x2dd69b){return client['request'](_0x2ccee5,_0x3436e1)[_0x45b7('0xf')](function(_0x4daa9a){logger[_0x45b7('0x10')](_0x45b7('0x11'),_0x42bdae,'request\x20sent');logger['debug'](_0x45b7('0x12'),_0x42bdae,_0x45b7('0x13'),JSON['stringify'](_0x4daa9a));if(_0x4daa9a[_0x45b7('0x14')]){if(_0x4daa9a['error'][_0x45b7('0x15')]===0x1f4){logger[_0x45b7('0x14')](_0x45b7('0x11'),_0x42bdae,_0x4daa9a[_0x45b7('0x14')][_0x45b7('0x16')]);return _0x2dd69b(_0x4daa9a[_0x45b7('0x14')][_0x45b7('0x16')]);}logger[_0x45b7('0x14')](_0x45b7('0x11'),_0x42bdae,_0x4daa9a[_0x45b7('0x14')][_0x45b7('0x16')]);return _0x332980(_0x4daa9a[_0x45b7('0x14')]['message']);}else{logger[_0x45b7('0x10')](_0x45b7('0x11'),_0x42bdae,'request\x20sent');_0x332980(_0x4daa9a['result']['message']);}})['catch'](function(_0x21cce3){logger[_0x45b7('0x14')](_0x45b7('0x11'),_0x42bdae,_0x21cce3);_0x2dd69b(_0x21cce3);});});}exports[_0x45b7('0x17')]=function(_0x525124){var _0x29ecc7=this;return new Promise(function(_0x3c208d,_0xe56111){return db['SmsInteraction']['update'](_0x525124[_0x45b7('0x18')],{'raw':_0x525124[_0x45b7('0x19')]?_0x525124[_0x45b7('0x19')][_0x45b7('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x525124[_0x45b7('0x19')]?_0x525124[_0x45b7('0x19')]['where']||null:null,'attributes':_0x525124['options']?_0x525124[_0x45b7('0x19')][_0x45b7('0x1b')]||null:null,'limit':_0x525124['options']?_0x525124[_0x45b7('0x19')][_0x45b7('0x1c')]||null:null})['then'](function(_0xdae92b){logger[_0x45b7('0x10')]('UpdateSmsInteraction',_0x525124);logger[_0x45b7('0x1d')](_0x45b7('0x17'),_0x525124,JSON['stringify'](_0xdae92b));_0x3c208d(_0xdae92b);})[_0x45b7('0x1e')](function(_0xc704c){logger[_0x45b7('0x14')](_0x45b7('0x17'),_0xc704c[_0x45b7('0x16')],_0x525124);_0xe56111(_0x29ecc7['error'](0x1f4,_0xc704c['message']));});});};exports[_0x45b7('0x1f')]=function(_0x5768e8){return new Promise(function(_0x10cb0b,_0xc42d5f){return db[_0x45b7('0x20')][_0x45b7('0x21')]({'where':_0x5768e8[_0x45b7('0x19')]?_0x5768e8['options'][_0x45b7('0x22')]||null:null})[_0x45b7('0xf')](function(_0x22c25f){if(_0x22c25f){return _0x22c25f[_0x45b7('0x23')](_0x5768e8['body'][_0x45b7('0x24')],_[_0x45b7('0x25')](_0x5768e8['body'],[_0x45b7('0x24'),'id'])||{});}})[_0x45b7('0x26')](function(_0x4ee75d){logger['info'](_0x45b7('0x27'),_0x5768e8);logger[_0x45b7('0x1d')]('AddTags',_0x5768e8,JSON[_0x45b7('0x28')](_0x4ee75d));_0x10cb0b(_0x4ee75d);})[_0x45b7('0x1e')](function(_0x49673d){logger[_0x45b7('0x14')]('AddTags',_0x49673d[_0x45b7('0x16')],_0x5768e8);_0xc42d5f(_this[_0x45b7('0x14')](0x1f4,_0x49673d[_0x45b7('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 69b5d73..c9538ec 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 _0x391f=['smsInteraction:','./smsInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x232c9e,_0x394d13){var _0x2585ff=function(_0x4bb115){while(--_0x4bb115){_0x232c9e['push'](_0x232c9e['shift']());}};_0x2585ff(++_0x394d13);}(_0x391f,0x129));var _0xf391=function(_0x5da6bf,_0x33a262){_0x5da6bf=_0x5da6bf-0x0;var _0x53244a=_0x391f[_0x5da6bf];return _0x53244a;};'use strict';var SmsInteractionEvents=require(_0xf391('0x0'));var events=[_0xf391('0x1'),_0xf391('0x2'),_0xf391('0x3')];function createListener(_0x18f4c2,_0x4fb29a){return function(_0x428240){_0x4fb29a[_0xf391('0x4')](_0x18f4c2,_0x428240);};}function removeListener(_0x2d8d39,_0x11b699){return function(){SmsInteractionEvents[_0xf391('0x5')](_0x2d8d39,_0x11b699);};}exports[_0xf391('0x6')]=function(_0x2c4b1a){for(var _0x14327a=0x0,_0x497bd1=events['length'];_0x14327a<_0x497bd1;_0x14327a++){var _0xc3ec52=events[_0x14327a];var _0x4c308b=createListener(_0xf391('0x7')+_0xc3ec52,_0x2c4b1a);SmsInteractionEvents['on'](_0xc3ec52,_0x4c308b);}}; \ No newline at end of file +var _0xfea9=['./smsInteraction.events','save','remove','update','removeListener','register','length','smsInteraction:'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0xfea9,0x130));var _0x9fea=function(_0x2f2507,_0x3c41a0){_0x2f2507=_0x2f2507-0x0;var _0x2e00a4=_0xfea9[_0x2f2507];return _0x2e00a4;};'use strict';var SmsInteractionEvents=require(_0x9fea('0x0'));var events=[_0x9fea('0x1'),_0x9fea('0x2'),_0x9fea('0x3')];function createListener(_0x45cc36,_0x355b87){return function(_0x37ccf3){_0x355b87['emit'](_0x45cc36,_0x37ccf3);};}function removeListener(_0x16d579,_0x435c3a){return function(){SmsInteractionEvents[_0x9fea('0x4')](_0x16d579,_0x435c3a);};}exports[_0x9fea('0x5')]=function(_0x27643f){for(var _0x912ab0=0x0,_0x466689=events[_0x9fea('0x6')];_0x912ab0<_0x466689;_0x912ab0++){var _0x14159d=events[_0x912ab0];var _0x5d1d21=createListener(_0x9fea('0x7')+_0x14159d,_0x27643f);SmsInteractionEvents['on'](_0x14159d,_0x5d1d21);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index dc22a90..22008d8 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 _0xed35=['tracked','sms','smsmessage:create','/:id/status','status','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x53edb2,_0x4104c5){var _0x325f33=function(_0x1f92a8){while(--_0x1f92a8){_0x53edb2['push'](_0x53edb2['shift']());}};_0x325f33(++_0x4104c5);}(_0xed35,0x89));var _0x5ed3=function(_0x191083,_0x503d68){_0x191083=_0x191083-0x0;var _0x4683fa=_0xed35[_0x191083];return _0x4683fa;};'use strict';var multer=require(_0x5ed3('0x0'));var util=require(_0x5ed3('0x1'));var path=require('path');var timeout=require(_0x5ed3('0x2'));var express=require(_0x5ed3('0x3'));var router=express[_0x5ed3('0x4')]();var fs_extra=require(_0x5ed3('0x5'));var auth=require(_0x5ed3('0x6'));var interaction=require(_0x5ed3('0x7'));var config=require(_0x5ed3('0x8'));var controller=require(_0x5ed3('0x9'));router[_0x5ed3('0xa')]('/',auth[_0x5ed3('0xb')](),controller[_0x5ed3('0xc')]);router['get'](_0x5ed3('0xd'),auth[_0x5ed3('0xb')](),controller[_0x5ed3('0xe')]);router[_0x5ed3('0xa')](_0x5ed3('0xf'),auth[_0x5ed3('0xb')](),controller[_0x5ed3('0x10')]);router[_0x5ed3('0x11')]('/',auth[_0x5ed3('0xb')](),interaction[_0x5ed3('0x12')](_0x5ed3('0x13'),_0x5ed3('0x14')),controller['create']);router[_0x5ed3('0x11')](_0x5ed3('0x15'),controller[_0x5ed3('0x16')]);router[_0x5ed3('0x17')](_0x5ed3('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x5ed3('0x17')](_0x5ed3('0x18'),auth[_0x5ed3('0xb')](),controller[_0x5ed3('0x19')]);router[_0x5ed3('0x17')](_0x5ed3('0x1a'),auth[_0x5ed3('0xb')](),controller[_0x5ed3('0x1b')]);router[_0x5ed3('0x1c')](_0x5ed3('0xf'),auth[_0x5ed3('0xb')](),controller[_0x5ed3('0x1d')]);module[_0x5ed3('0x1e')]=router; \ No newline at end of file +var _0x011a=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','show','tracked','sms','smsmessage:create','create','post','status','put','/:id','update','/:id/accept','accept','reject','delete','destroy','multer','util','path'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x011a,0x1c8));var _0xa011=function(_0x469a2d,_0x53bcbe){_0x469a2d=_0x469a2d-0x0;var _0x148147=_0x011a[_0x469a2d];return _0x148147;};'use strict';var multer=require(_0xa011('0x0'));var util=require(_0xa011('0x1'));var path=require(_0xa011('0x2'));var timeout=require(_0xa011('0x3'));var express=require('express');var router=express[_0xa011('0x4')]();var fs_extra=require(_0xa011('0x5'));var auth=require(_0xa011('0x6'));var interaction=require(_0xa011('0x7'));var config=require(_0xa011('0x8'));var controller=require(_0xa011('0x9'));router[_0xa011('0xa')]('/',auth[_0xa011('0xb')](),controller['index']);router['get']('/describe',auth[_0xa011('0xb')](),controller['describe']);router[_0xa011('0xa')]('/:id',auth[_0xa011('0xb')](),controller[_0xa011('0xc')]);router['post']('/',auth[_0xa011('0xb')](),interaction[_0xa011('0xd')](_0xa011('0xe'),_0xa011('0xf')),controller[_0xa011('0x10')]);router[_0xa011('0x11')]('/:id/status',controller[_0xa011('0x12')]);router[_0xa011('0x13')](_0xa011('0x14'),auth[_0xa011('0xb')](),controller[_0xa011('0x15')]);router[_0xa011('0x13')](_0xa011('0x16'),auth[_0xa011('0xb')](),controller[_0xa011('0x17')]);router[_0xa011('0x13')]('/:id/reject',auth[_0xa011('0xb')](),controller[_0xa011('0x18')]);router[_0xa011('0x19')](_0xa011('0x14'),auth[_0xa011('0xb')](),controller[_0xa011('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 58050b6..7e88b63 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 _0xb398=['exports','TEXT','medium','ENUM','out','STRING','DATE','BOOLEAN','sequelize'];(function(_0x2c69a1,_0x201903){var _0x24bb91=function(_0x3131ac){while(--_0x3131ac){_0x2c69a1['push'](_0x2c69a1['shift']());}};_0x24bb91(++_0x201903);}(_0xb398,0x128));var _0x8b39=function(_0x5b37a2,_0x18f0d7){_0x5b37a2=_0x5b37a2-0x0;var _0x9c6f4f=_0xb398[_0x5b37a2];return _0x9c6f4f;};'use strict';var Sequelize=require(_0x8b39('0x0'));module[_0x8b39('0x1')]={'body':{'type':Sequelize[_0x8b39('0x2')](_0x8b39('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x8b39('0x4')]('in','out'),'defaultValue':_0x8b39('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x8b39('0x6')]},'readAt':{'type':Sequelize[_0x8b39('0x7')]},'secret':{'type':Sequelize[_0x8b39('0x8')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x8b39('0x6')]},'providerResponse':{'type':Sequelize[_0x8b39('0x2')]}}; \ No newline at end of file +var _0x9589=['BOOLEAN','out','STRING','DATE','sequelize','exports','TEXT','medium'];(function(_0x149dcf,_0xd50b61){var _0x200529=function(_0x42317a){while(--_0x42317a){_0x149dcf['push'](_0x149dcf['shift']());}};_0x200529(++_0xd50b61);}(_0x9589,0xbc));var _0x9958=function(_0x14f2f9,_0x38b838){_0x14f2f9=_0x14f2f9-0x0;var _0x3acce7=_0x9589[_0x14f2f9];return _0x3acce7;};'use strict';var Sequelize=require(_0x9958('0x0'));module[_0x9958('0x1')]={'body':{'type':Sequelize[_0x9958('0x2')](_0x9958('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x9958('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x9958('0x5')),'defaultValue':_0x9958('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x9958('0x6')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x9958('0x7')]},'secret':{'type':Sequelize[_0x9958('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x9958('0x6')]},'providerResponse':{'type':Sequelize[_0x9958('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index f377d21..d30085e 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 _0xb19a=['include','findAll','rows','show','params','find','body','describe','sms-interactions','accept','sms','read','readAt','UserId','user','agent','SmsInteraction','isNil','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','SmsInteractionId','interaction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','rejectmessage','SmsAccountId','received\x20delivery\x20report\x20from','twilio','MessageSid','plivo','MessageUUID','messageId','delivered','Status','plivio','inspect','infobip','results','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','http','client','request','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','limit','count','set','apply','reject','save','update','then','destroy','stack','name','send','map','SmsMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll'];(function(_0x565071,_0x4166a3){var _0x2ec9c8=function(_0x3ed8f4){while(--_0x3ed8f4){_0x565071['push'](_0x565071['shift']());}};_0x2ec9c8(++_0x4166a3);}(_0xb19a,0xd0));var _0xab19=function(_0x3d671f,_0x1417e7){_0x3d671f=_0x3d671f-0x0;var _0x59b9e1=_0xb19a[_0x3d671f];return _0x59b9e1;};'use strict';var emlformat=require(_0xab19('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xab19('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xab19('0x2'));var Mustache=require(_0xab19('0x3'));var util=require(_0xab19('0x4'));var path=require(_0xab19('0x5'));var sox=require(_0xab19('0x6'));var csv=require(_0xab19('0x7'));var ejs=require(_0xab19('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xab19('0x9'));var squel=require(_0xab19('0xa'));var crypto=require('crypto');var jsforce=require(_0xab19('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xab19('0x7'));var querystring=require(_0xab19('0xc'));var Papa=require(_0xab19('0xd'));var Redis=require(_0xab19('0xe'));var authService=require(_0xab19('0xf'));var qs=require(_0xab19('0x10'));var as=require(_0xab19('0x11'));var hardwareService=require(_0xab19('0x12'));var logger=require(_0xab19('0x13'))(_0xab19('0x14'));var utils=require(_0xab19('0x15'));var config=require(_0xab19('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xab19('0x17')]=_['defaults'](config[_0xab19('0x17')],{'host':_0xab19('0x18'),'port':0x18eb});var socket=require(_0xab19('0x19'))(new Redis(config[_0xab19('0x17')]));require(_0xab19('0x1a'))[_0xab19('0x1b')](socket);var jayson=require(_0xab19('0x1c'));var client=jayson['client'][_0xab19('0x1d')]({'port':0x232c});var client9002=jayson[_0xab19('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4257d7,_0x30d3f1,_0x496473,_0x4d2927){return new BPromise(function(_0x2284b8,_0x191e12){var _0x766d6=_0x4d2927||client;return _0x766d6[_0xab19('0x1f')](_0x4257d7,_0x496473)['then'](function(_0x37af3d){logger[_0xab19('0x20')]('SmsMessage,\x20%s,\x20%s',_0x30d3f1,_0xab19('0x21'));logger[_0xab19('0x22')](_0xab19('0x23'),_0x30d3f1,'request\x20sent',JSON['stringify'](_0x37af3d));if(_0x37af3d['error']){if(_0x37af3d[_0xab19('0x24')][_0xab19('0x25')]===0x1f4){logger['error'](_0xab19('0x26'),_0x30d3f1,_0x37af3d['error'][_0xab19('0x27')]);return _0x191e12(_0x37af3d['error'][_0xab19('0x27')]);}logger[_0xab19('0x24')](_0xab19('0x26'),_0x30d3f1,_0x37af3d[_0xab19('0x24')][_0xab19('0x27')]);return _0x2284b8(_0x37af3d[_0xab19('0x24')]['message']);}else{logger[_0xab19('0x20')](_0xab19('0x26'),_0x30d3f1,_0xab19('0x21'));_0x2284b8(_0x37af3d[_0xab19('0x28')][_0xab19('0x27')]);}})[_0xab19('0x29')](function(_0x3743c7){logger[_0xab19('0x24')]('SmsMessage,\x20%s,\x20%s',_0x30d3f1,_0x3743c7);_0x191e12(_0x3743c7);});});}function respondWithStatusCode(_0x294d3f,_0x362449){_0x362449=_0x362449||0xcc;return function(_0x3dda13){if(_0x3dda13){return _0x294d3f[_0xab19('0x2a')](_0x362449);}return _0x294d3f[_0xab19('0x2b')](_0x362449)[_0xab19('0x2c')]();};}function respondWithResult(_0x3f4d5e,_0x1538e5){_0x1538e5=_0x1538e5||0xc8;return function(_0x5946ee){if(_0x5946ee){return _0x3f4d5e[_0xab19('0x2b')](_0x1538e5)[_0xab19('0x2d')](_0x5946ee);}};}function respondWithFilteredResult(_0x5c0074,_0x1aacdd){return function(_0x52f3f9){if(_0x52f3f9){var _0x227cb4=typeof _0x1aacdd[_0xab19('0x2e')]==='undefined'&&typeof _0x1aacdd[_0xab19('0x2f')]==='undefined';var _0x3d67ce=_0x52f3f9['count'];var _0x1dabc1=_0x227cb4?0x0:_0x1aacdd[_0xab19('0x2e')];var _0x5df46c=_0x227cb4?_0x52f3f9[_0xab19('0x30')]:_0x1aacdd[_0xab19('0x2e')]+_0x1aacdd[_0xab19('0x2f')];var _0x5975ea;if(_0x5df46c>=_0x3d67ce){_0x5df46c=_0x3d67ce;_0x5975ea=0xc8;}else{_0x5975ea=0xce;}_0x5c0074[_0xab19('0x2b')](_0x5975ea);return _0x5c0074[_0xab19('0x31')]('Content-Range',_0x1dabc1+'-'+_0x5df46c+'/'+_0x3d67ce)[_0xab19('0x2d')](_0x52f3f9);}return null;};}function patchUpdates(_0x10b933){return function(_0x1bd6f9){try{jsonpatch[_0xab19('0x32')](_0x1bd6f9,_0x10b933,!![]);}catch(_0x5e5f41){return BPromise[_0xab19('0x33')](_0x5e5f41);}return _0x1bd6f9[_0xab19('0x34')]();};}function saveUpdates(_0x3c59a3,_0x4dd3d6){return function(_0x571981){if(_0x571981){return _0x571981[_0xab19('0x35')](_0x3c59a3)[_0xab19('0x36')](function(_0x128a58){return _0x128a58;});}return null;};}function removeEntity(_0x48797b,_0x412b5f){return function(_0x5e521f){if(_0x5e521f){return _0x5e521f[_0xab19('0x37')]()[_0xab19('0x36')](function(){_0x48797b[_0xab19('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18bba1,_0x38d317){return function(_0x307500){if(!_0x307500){_0x18bba1['sendStatus'](0x194);}return _0x307500;};}function handleError(_0x5ba8f0,_0x2a17da){_0x2a17da=_0x2a17da||0x1f4;return function(_0x400e4b){logger[_0xab19('0x24')](_0x400e4b[_0xab19('0x38')]);if(_0x400e4b[_0xab19('0x39')]){delete _0x400e4b[_0xab19('0x39')];}_0x5ba8f0[_0xab19('0x2b')](_0x2a17da)[_0xab19('0x3a')](_0x400e4b);};}exports['index']=function(_0x4cc407,_0x22009e){var _0x166b39={},_0x98ccde={},_0x307c38={'count':0x0,'rows':[]};var _0x240e62=_[_0xab19('0x3b')](db[_0xab19('0x3c')][_0xab19('0x3d')],function(_0x3ff5ae){return{'name':_0x3ff5ae[_0xab19('0x3e')],'type':_0x3ff5ae[_0xab19('0x3f')]['key']};});_0x98ccde[_0xab19('0x40')]=_[_0xab19('0x3b')](_0x240e62,_0xab19('0x39'));_0x98ccde[_0xab19('0x41')]=_[_0xab19('0x42')](_0x4cc407['query']);_0x98ccde[_0xab19('0x43')]=_[_0xab19('0x44')](_0x98ccde[_0xab19('0x40')],_0x98ccde[_0xab19('0x41')]);_0x166b39['attributes']=_['intersection'](_0x98ccde[_0xab19('0x40')],qs[_0xab19('0x45')](_0x4cc407[_0xab19('0x41')][_0xab19('0x45')]));_0x166b39[_0xab19('0x46')]=_0x166b39[_0xab19('0x46')][_0xab19('0x47')]?_0x166b39[_0xab19('0x46')]:_0x98ccde[_0xab19('0x40')];if(!_0x4cc407[_0xab19('0x41')][_0xab19('0x48')](_0xab19('0x49'))){_0x166b39[_0xab19('0x2f')]=qs[_0xab19('0x2f')](_0x4cc407['query'][_0xab19('0x2f')]);_0x166b39[_0xab19('0x2e')]=qs[_0xab19('0x2e')](_0x4cc407[_0xab19('0x41')][_0xab19('0x2e')]);}_0x166b39['order']=qs[_0xab19('0x4a')](_0x4cc407[_0xab19('0x41')][_0xab19('0x4a')]);_0x166b39[_0xab19('0x4b')]=qs['filters'](_[_0xab19('0x4c')](_0x4cc407[_0xab19('0x41')],_0x98ccde[_0xab19('0x43')]),_0x240e62);if(_0x4cc407[_0xab19('0x41')][_0xab19('0x4d')]){_0x166b39['where']=_['merge'](_0x166b39['where'],{'$or':_[_0xab19('0x3b')](_0x240e62,function(_0x1b2bba){if(_0x1b2bba[_0xab19('0x3f')]!==_0xab19('0x4e')){var _0xde9892={};_0xde9892[_0x1b2bba['name']]={'$like':'%'+_0x4cc407['query']['filter']+'%'};return _0xde9892;}})});}_0x166b39=_[_0xab19('0x4f')]({},_0x166b39,_0x4cc407[_0xab19('0x50')]);var _0xe1b145={'where':_0x166b39[_0xab19('0x4b')]};return db[_0xab19('0x3c')][_0xab19('0x30')](_0xe1b145)['then'](function(_0x330dc0){_0x307c38[_0xab19('0x30')]=_0x330dc0;if(_0x4cc407[_0xab19('0x41')][_0xab19('0x51')]){_0x166b39[_0xab19('0x52')]=[{'all':!![]}];}return db['SmsMessage'][_0xab19('0x53')](_0x166b39);})[_0xab19('0x36')](function(_0x2484c4){_0x307c38[_0xab19('0x54')]=_0x2484c4;return _0x307c38;})[_0xab19('0x36')](respondWithFilteredResult(_0x22009e,_0x166b39))[_0xab19('0x29')](handleError(_0x22009e,null));};exports[_0xab19('0x55')]=function(_0x3f6bbd,_0x25fa8c){var _0x259f31={'raw':!![],'where':{'id':_0x3f6bbd[_0xab19('0x56')]['id']}},_0x120f2f={};_0x120f2f[_0xab19('0x40')]=_[_0xab19('0x42')](db[_0xab19('0x3c')][_0xab19('0x3d')]);_0x120f2f[_0xab19('0x41')]=_[_0xab19('0x42')](_0x3f6bbd[_0xab19('0x41')]);_0x120f2f[_0xab19('0x43')]=_[_0xab19('0x44')](_0x120f2f['model'],_0x120f2f['query']);_0x259f31[_0xab19('0x46')]=_[_0xab19('0x44')](_0x120f2f[_0xab19('0x40')],qs[_0xab19('0x45')](_0x3f6bbd[_0xab19('0x41')][_0xab19('0x45')]));_0x259f31[_0xab19('0x46')]=_0x259f31['attributes'][_0xab19('0x47')]?_0x259f31[_0xab19('0x46')]:_0x120f2f[_0xab19('0x40')];if(_0x3f6bbd[_0xab19('0x41')][_0xab19('0x51')]){_0x259f31[_0xab19('0x52')]=[{'all':!![]}];}_0x259f31=_['merge']({},_0x259f31,_0x3f6bbd[_0xab19('0x50')]);return db['SmsMessage'][_0xab19('0x57')](_0x259f31)['then'](handleEntityNotFound(_0x25fa8c,null))[_0xab19('0x36')](respondWithResult(_0x25fa8c,null))[_0xab19('0x29')](handleError(_0x25fa8c,null));};exports['create']=function(_0x4fe7d9,_0x294838){return db[_0xab19('0x3c')]['create'](_0x4fe7d9[_0xab19('0x58')],{})[_0xab19('0x36')](respondWithResult(_0x294838,0xc9))['catch'](handleError(_0x294838,null));};exports[_0xab19('0x35')]=function(_0x209a4e,_0x426613){if(_0x209a4e[_0xab19('0x58')]['id']){delete _0x209a4e[_0xab19('0x58')]['id'];}return db[_0xab19('0x3c')][_0xab19('0x57')]({'where':{'id':_0x209a4e['params']['id']}})[_0xab19('0x36')](handleEntityNotFound(_0x426613,null))[_0xab19('0x36')](saveUpdates(_0x209a4e[_0xab19('0x58')],null))[_0xab19('0x36')](respondWithResult(_0x426613,null))[_0xab19('0x29')](handleError(_0x426613,null));};exports[_0xab19('0x37')]=function(_0x176991,_0x4a0fd1){return db['SmsMessage']['find']({'where':{'id':_0x176991[_0xab19('0x56')]['id']}})[_0xab19('0x36')](handleEntityNotFound(_0x4a0fd1,null))[_0xab19('0x36')](removeEntity(_0x4a0fd1,null))[_0xab19('0x29')](handleError(_0x4a0fd1,null));};exports[_0xab19('0x59')]=function(_0x385799,_0x15ecde){return db[_0xab19('0x3c')]['describe']()[_0xab19('0x36')](respondWithResult(_0x15ecde,null))[_0xab19('0x29')](handleError(_0x15ecde,null));};var interaction_log=require('../../config/logger')(_0xab19('0x5a'));exports[_0xab19('0x5b')]=function(_0x531185,_0x437649,_0x51b0c5){var _0x4f6ad3={'agent':{},'channel':_0xab19('0x5c')};if(_0x531185['body']['id']){delete _0x531185[_0xab19('0x58')]['id'];}_0x531185[_0xab19('0x58')][_0xab19('0x5d')]=!![];_0x531185[_0xab19('0x58')][_0xab19('0x5e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x531185['body'][_0xab19('0x5f')]=_0x531185[_0xab19('0x58')][_0xab19('0x5f')]||_0x531185[_0xab19('0x60')]['id'];_0x4f6ad3[_0xab19('0x61')]['id']=_0x531185['body']['UserId'];return db[_0xab19('0x3c')]['find']({'where':{'id':_0x531185[_0xab19('0x56')]['id'],'UserId':null}})[_0xab19('0x36')](handleEntityNotFound(_0x437649,null))[_0xab19('0x36')](saveUpdates(_0x531185[_0xab19('0x58')],null))['then'](function(_0x203d9c){if(_0x203d9c){_0x4f6ad3[_0xab19('0x27')]=_0x203d9c['get']({'plain':!![]});return db[_0xab19('0x62')][_0xab19('0x57')]({'where':{'id':_0x203d9c['SmsInteractionId']}});}return null;})[_0xab19('0x36')](handleEntityNotFound(_0x437649,null))[_0xab19('0x36')](function(_0x32616d){if(_0x32616d){return _0x32616d[_0xab19('0x35')]({'UserId':_0x531185[_0xab19('0x58')]['UserId'],'read1stAt':_[_0xab19('0x63')](_0x32616d[_0xab19('0x64')])?moment()[_0xab19('0x65')](_0xab19('0x66')):undefined});}return null;})[_0xab19('0x36')](function(_0x58f4a3){if(_0x58f4a3){_0x4f6ad3['interaction']=_0x58f4a3[_0xab19('0x67')]({'plain':!![]});interaction_log[_0xab19('0x20')](_0xab19('0x68'),_0x531185[_0xab19('0x60')]['id'],_0x531185[_0xab19('0x60')][_0xab19('0x39')],_0x531185[_0xab19('0x60')]['role'],_0x4f6ad3['interaction']['id'],_0x531185['body']?JSON[_0xab19('0x69')](_0x531185[_0xab19('0x58')]):'null');return respondWithRpcPromise('AcceptMessage',_0xab19('0x6a'),_0x4f6ad3);}return null;})['then'](function(_0x526d9c){var _0x1d2ebc=_0xab19('0x6b')+_0x526d9c[_0xab19('0x27')][_0xab19('0x6c')];return db[_0xab19('0x6d')][_0xab19('0x41')](_0x1d2ebc,{'type':db[_0xab19('0x6e')][_0xab19('0x6f')][_0xab19('0x70')],'raw':!![]})[_0xab19('0x36')](function(_0x138e43){return _0x138e43;});})[_0xab19('0x36')](function(_0x536ce9){if(_0x536ce9){_0x4f6ad3[_0xab19('0x27')][_0xab19('0x71')]=_0x536ce9[0x0];if(!_0x531185['body'][_0xab19('0x5f')])return;return db[_0xab19('0x72')][_0xab19('0x57')]({'where':{'id':_0x531185[_0xab19('0x58')][_0xab19('0x5f')],'role':_0xab19('0x61')},'attributes':['id',_0xab19('0x39'),_0xab19('0x73'),_0xab19('0x74'),_0xab19('0x75')],'raw':!![]});}return null;})[_0xab19('0x36')](function(_0x21a305){if(!_0x21a305)return null;_0x4f6ad3[_0xab19('0x27')][_0xab19('0x61')]=_0x21a305;return _0x4f6ad3;})[_0xab19('0x36')](function(_0x574d09){if(_0x574d09){if(_0x531185[_0xab19('0x58')][_0xab19('0x76')]){_0x4f6ad3[_0xab19('0x27')][_0xab19('0x77')]=util[_0xab19('0x65')](_0xab19('0x78'),_0x531185['user'][_0xab19('0x39')]);_0x4f6ad3[_0xab19('0x27')]['channel']=_0x4f6ad3[_0xab19('0x79')];_0x4f6ad3[_0xab19('0x27')][_0xab19('0x7a')]=_0x4f6ad3[_0xab19('0x79')];_0x4f6ad3[_0xab19('0x27')][_0xab19('0x7b')]='accept';return respondWithRpcPromise(_0xab19('0x7c'),_0xab19('0x7c'),{'event':_0xab19('0x7d'),'message':_0x4f6ad3[_0xab19('0x27')]},client9002)[_0xab19('0x36')](function(){return _0x4f6ad3;});}return _0x4f6ad3;}return null;})[_0xab19('0x36')](respondWithResult(_0x437649,null))['catch'](handleError(_0x437649,null));};var interaction_log=require(_0xab19('0x13'))('sms-interactions');exports['reject']=function(_0xaf93d7,_0x1913ea,_0xc2a904){var _0x283a98={'agent':{},'channel':_0xab19('0x5c')};if(_0xaf93d7[_0xab19('0x58')]['id']){delete _0xaf93d7[_0xab19('0x58')]['id'];}_0xaf93d7[_0xab19('0x58')]['UserId']=_0xaf93d7[_0xab19('0x58')]['UserId']||_0xaf93d7[_0xab19('0x60')]['id'];_0x283a98['agent']['id']=_0xaf93d7['body'][_0xab19('0x5f')];return db['SmsMessage']['find']({'where':{'id':_0xaf93d7[_0xab19('0x56')]['id'],'UserId':null}})[_0xab19('0x36')](handleEntityNotFound(_0x1913ea,null))['then'](function(_0x46597d){if(_0x46597d){_0x283a98[_0xab19('0x27')]=_0x46597d['get']({'plain':!![]});return db[_0xab19('0x62')][_0xab19('0x57')]({'where':{'id':_0x46597d[_0xab19('0x7e')]}});}return null;})[_0xab19('0x36')](handleEntityNotFound(_0x1913ea,null))[_0xab19('0x36')](function(_0x436a00){if(_0x436a00){_0x283a98[_0xab19('0x7f')]=_0x436a00['get']({'plain':!![]});interaction_log[_0xab19('0x20')](_0xab19('0x80'),_0xaf93d7[_0xab19('0x60')]['id'],_0xaf93d7['user'][_0xab19('0x39')],_0xaf93d7['user'][_0xab19('0x81')],_0x283a98['interaction']['id'],_0xaf93d7[_0xab19('0x58')]?JSON[_0xab19('0x69')](_0xaf93d7[_0xab19('0x58')]):_0xab19('0x82'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x283a98);}return null;})[_0xab19('0x36')](function(_0x1300a4){var _0x42937c=_0xab19('0x6b')+_0x1300a4[_0xab19('0x27')][_0xab19('0x6c')];return db[_0xab19('0x6d')][_0xab19('0x41')](_0x42937c,{'type':db[_0xab19('0x6e')][_0xab19('0x6f')]['SELECT'],'raw':!![]})[_0xab19('0x36')](function(_0x61de03){return _0x61de03;});})['then'](function(_0x563b85){if(_0x563b85){_0x283a98[_0xab19('0x27')][_0xab19('0x71')]=_0x563b85[0x0];if(!_0xaf93d7[_0xab19('0x58')][_0xab19('0x5f')])return;return db['User'][_0xab19('0x57')]({'where':{'id':_0xaf93d7[_0xab19('0x58')][_0xab19('0x5f')],'role':_0xab19('0x61')},'attributes':['id',_0xab19('0x39'),'fullname','email','internal'],'raw':!![]});}return null;})[_0xab19('0x36')](function(_0x1f9568){if(!_0x1f9568)return null;_0x283a98[_0xab19('0x27')][_0xab19('0x61')]=_0x1f9568;return _0x283a98;})[_0xab19('0x36')](function(_0x5acb61){if(_0x5acb61){_0x5acb61[_0xab19('0x27')][_0xab19('0x77')]=util[_0xab19('0x65')](_0xab19('0x78'),_0xaf93d7[_0xab19('0x60')][_0xab19('0x39')]);_0x5acb61['message']['channel']=_0x283a98['channel'];_0x5acb61[_0xab19('0x27')][_0xab19('0x7a')]=_0x283a98[_0xab19('0x79')];_0x5acb61[_0xab19('0x27')][_0xab19('0x7b')]=_0xab19('0x33');respondWithRpcPromise(_0xab19('0x7c'),_0xab19('0x7c'),{'event':_0xab19('0x83'),'message':_0x5acb61[_0xab19('0x27')]},client9002);return _0x283a98;}return null;})[_0xab19('0x36')](respondWithResult(_0x1913ea,null))[_0xab19('0x29')](handleError(_0x1913ea,null));};exports[_0xab19('0x2b')]=function(_0x2d0148,_0x1a93ff,_0x6f6a5f){if(_0x2d0148[_0xab19('0x58')]['id']){delete _0x2d0148[_0xab19('0x58')]['id'];}var _0x4f8edf;return db[_0xab19('0x3c')][_0xab19('0x57')]({'where':{'id':_0x2d0148['params']['id']}})[_0xab19('0x36')](handleEntityNotFound(_0x1a93ff,null))[_0xab19('0x36')](function(_0xdb9acc){if(_0xdb9acc){_0x4f8edf=_0xdb9acc;return db['SmsAccount'][_0xab19('0x57')]({'where':{'id':_0xdb9acc[_0xab19('0x84')]}});}})[_0xab19('0x36')](handleEntityNotFound(_0x1a93ff,null))[_0xab19('0x36')](function(_0x2ca568){if(_0x2ca568){logger[_0xab19('0x22')](_0xab19('0x23'),_0xab19('0x2b'),_0xab19('0x85'),_0x2ca568[_0xab19('0x3f')],util['inspect'](_0x2d0148[_0xab19('0x58')],{'showHidden':![],'depth':null}));switch(_0x2ca568[_0xab19('0x3f')]){case _0xab19('0x86'):if(_0x2d0148[_0xab19('0x58')][_0xab19('0x87')]&&_0x2d0148[_0xab19('0x58')][_0xab19('0x87')]===_0x4f8edf['messageId']){return _0x4f8edf['update']({'read':!![]});}else{logger[_0xab19('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xab19('0x86'),util['inspect'](_0x2d0148[_0xab19('0x58')],{'showHidden':![],'depth':null}));}break;case _0xab19('0x88'):if(_0x2d0148[_0xab19('0x58')][_0xab19('0x89')]&&_0x2d0148['body'][_0xab19('0x89')]===_0x4f8edf[_0xab19('0x8a')]&&_['indexOf'](['sent',_0xab19('0x8b')],_0x2d0148[_0xab19('0x58')][_0xab19('0x8c')])>=0x0){return _0x4f8edf['update']({'read':!![]});}else{logger[_0xab19('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xab19('0x2b'),_0xab19('0x8d'),util[_0xab19('0x8e')](_0x2d0148[_0xab19('0x58')],{'showHidden':![],'depth':null}));}break;case _0xab19('0x8f'):var _0x54fd3c=_0x2d0148[_0xab19('0x58')][_0xab19('0x90')][0x0];if(_0x54fd3c[_0xab19('0x2b')]['groupName']==='DELIVERED'){return _0x4f8edf[_0xab19('0x35')]({'read':!![]});}else{logger[_0xab19('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xab19('0x8f'),util[_0xab19('0x8e')](_0x2d0148['body'],{'showHidden':![],'depth':null}));}break;}return _0x4f8edf;}})[_0xab19('0x36')](respondWithResult(_0x1a93ff,null))[_0xab19('0x29')](handleError(_0x1a93ff,null));}; \ No newline at end of file +var _0xcf37=['length','nolimit','order','sort','filter','where','VIRTUAL','merge','SmsMessage','includeAll','findAll','catch','show','params','rawAttributes','include','options','find','body','update','describe','accept','sms','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','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','sequelize','Sequelize','User','fullname','email','manual','interface','format','channel','motionChannel','event','acceptmessage','sms-interactions','agent','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','ContactId','QueryTypes','SELECT','contact','SIP/%s','EventManager','SmsAccount','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','MessageUUID','indexOf','sent','Status','plivio','infobip','results','DELIVERED','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','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','redis','socket.io-emitter','register','jayson/promise','client','http','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','name','send','index','map','type','key','query','keys','filters','intersection','model','attributes','fields'];(function(_0x38c104,_0x2af078){var _0x4aa38f=function(_0x7bb7b8){while(--_0x7bb7b8){_0x38c104['push'](_0x38c104['shift']());}};_0x4aa38f(++_0x2af078);}(_0xcf37,0xdc));var _0x7cf3=function(_0x182ce9,_0x5a5714){_0x182ce9=_0x182ce9-0x0;var _0x5f240c=_0xcf37[_0x182ce9];return _0x5f240c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7cf3('0x0'));var zipdir=require(_0x7cf3('0x1'));var jsonpatch=require(_0x7cf3('0x2'));var rp=require(_0x7cf3('0x3'));var moment=require(_0x7cf3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7cf3('0x5'));var util=require(_0x7cf3('0x6'));var path=require(_0x7cf3('0x7'));var sox=require(_0x7cf3('0x8'));var csv=require(_0x7cf3('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(_0x7cf3('0xa'));var jsforce=require(_0x7cf3('0xb'));var deskjs=require(_0x7cf3('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7cf3('0xd'));var Papa=require(_0x7cf3('0xe'));var Redis=require(_0x7cf3('0xf'));var authService=require(_0x7cf3('0x10'));var qs=require(_0x7cf3('0x11'));var as=require(_0x7cf3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7cf3('0x13'))(_0x7cf3('0x14'));var utils=require(_0x7cf3('0x15'));var config=require(_0x7cf3('0x16'));var licenseUtil=require(_0x7cf3('0x17'));var db=require('../../mysqldb')['db'];config[_0x7cf3('0x18')]=_['defaults'](config[_0x7cf3('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x7cf3('0x19'))(new Redis(config[_0x7cf3('0x18')]));require('./smsMessage.socket')[_0x7cf3('0x1a')](socket);var jayson=require(_0x7cf3('0x1b'));var client=jayson[_0x7cf3('0x1c')][_0x7cf3('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0x7cf3('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5d38cd,_0x32c1d7,_0x247406,_0x346dae){return new BPromise(function(_0x14aef6,_0x25b75a){var _0x427bc6=_0x346dae||client;return _0x427bc6['request'](_0x5d38cd,_0x247406)['then'](function(_0xd7e354){logger[_0x7cf3('0x1e')](_0x7cf3('0x1f'),_0x32c1d7,'request\x20sent');logger[_0x7cf3('0x20')](_0x7cf3('0x21'),_0x32c1d7,_0x7cf3('0x22'),JSON[_0x7cf3('0x23')](_0xd7e354));if(_0xd7e354[_0x7cf3('0x24')]){if(_0xd7e354['error'][_0x7cf3('0x25')]===0x1f4){logger[_0x7cf3('0x24')](_0x7cf3('0x1f'),_0x32c1d7,_0xd7e354[_0x7cf3('0x24')][_0x7cf3('0x26')]);return _0x25b75a(_0xd7e354['error'][_0x7cf3('0x26')]);}logger[_0x7cf3('0x24')]('SmsMessage,\x20%s,\x20%s',_0x32c1d7,_0xd7e354['error']['message']);return _0x14aef6(_0xd7e354[_0x7cf3('0x24')]['message']);}else{logger[_0x7cf3('0x1e')]('SmsMessage,\x20%s,\x20%s',_0x32c1d7,_0x7cf3('0x22'));_0x14aef6(_0xd7e354['result'][_0x7cf3('0x26')]);}})['catch'](function(_0x945d95){logger[_0x7cf3('0x24')](_0x7cf3('0x1f'),_0x32c1d7,_0x945d95);_0x25b75a(_0x945d95);});});}function respondWithStatusCode(_0x30110e,_0x96c3ce){_0x96c3ce=_0x96c3ce||0xcc;return function(_0x370f0d){if(_0x370f0d){return _0x30110e[_0x7cf3('0x27')](_0x96c3ce);}return _0x30110e[_0x7cf3('0x28')](_0x96c3ce)[_0x7cf3('0x29')]();};}function respondWithResult(_0x4a25d5,_0x4cbd7c){_0x4cbd7c=_0x4cbd7c||0xc8;return function(_0x2a618b){if(_0x2a618b){return _0x4a25d5[_0x7cf3('0x28')](_0x4cbd7c)[_0x7cf3('0x2a')](_0x2a618b);}};}function respondWithFilteredResult(_0x5b8732,_0xa4ecf){return function(_0xd7c728){if(_0xd7c728){var _0x565ef7=typeof _0xa4ecf[_0x7cf3('0x2b')]===_0x7cf3('0x2c')&&typeof _0xa4ecf[_0x7cf3('0x2d')]===_0x7cf3('0x2c');var _0xb17bfe=_0xd7c728[_0x7cf3('0x2e')];var _0x206488=_0x565ef7?0x0:_0xa4ecf[_0x7cf3('0x2b')];var _0x41b5c4=_0x565ef7?_0xd7c728[_0x7cf3('0x2e')]:_0xa4ecf['offset']+_0xa4ecf[_0x7cf3('0x2d')];var _0x5d8922;if(_0x41b5c4>=_0xb17bfe){_0x41b5c4=_0xb17bfe;_0x5d8922=0xc8;}else{_0x5d8922=0xce;}_0x5b8732[_0x7cf3('0x28')](_0x5d8922);return _0x5b8732[_0x7cf3('0x2f')](_0x7cf3('0x30'),_0x206488+'-'+_0x41b5c4+'/'+_0xb17bfe)['json'](_0xd7c728);}return null;};}function patchUpdates(_0x30bbf5){return function(_0x1f8917){try{jsonpatch['apply'](_0x1f8917,_0x30bbf5,!![]);}catch(_0x267975){return BPromise[_0x7cf3('0x31')](_0x267975);}return _0x1f8917[_0x7cf3('0x32')]();};}function saveUpdates(_0x4180b3,_0x11402e){return function(_0x2fef84){if(_0x2fef84){return _0x2fef84['update'](_0x4180b3)[_0x7cf3('0x33')](function(_0x1be09c){return _0x1be09c;});}return null;};}function removeEntity(_0x24d0d2,_0x1fe01e){return function(_0x4b905e){if(_0x4b905e){return _0x4b905e[_0x7cf3('0x34')]()[_0x7cf3('0x33')](function(){_0x24d0d2[_0x7cf3('0x28')](0xcc)[_0x7cf3('0x29')]();});}};}function handleEntityNotFound(_0x3c8af0,_0x6633d1){return function(_0x1e1634){if(!_0x1e1634){_0x3c8af0[_0x7cf3('0x27')](0x194);}return _0x1e1634;};}function handleError(_0x347bff,_0x32ea10){_0x32ea10=_0x32ea10||0x1f4;return function(_0x47b5c4){logger['error'](_0x47b5c4['stack']);if(_0x47b5c4[_0x7cf3('0x35')]){delete _0x47b5c4[_0x7cf3('0x35')];}_0x347bff[_0x7cf3('0x28')](_0x32ea10)[_0x7cf3('0x36')](_0x47b5c4);};}exports[_0x7cf3('0x37')]=function(_0x3918d6,_0x2c7f87){var _0xd4ee32={},_0x1b62f5={},_0x4ee41c={'count':0x0,'rows':[]};var _0x47ad84=_[_0x7cf3('0x38')](db['SmsMessage']['rawAttributes'],function(_0x190d7c){return{'name':_0x190d7c['fieldName'],'type':_0x190d7c[_0x7cf3('0x39')][_0x7cf3('0x3a')]};});_0x1b62f5['model']=_[_0x7cf3('0x38')](_0x47ad84,_0x7cf3('0x35'));_0x1b62f5[_0x7cf3('0x3b')]=_[_0x7cf3('0x3c')](_0x3918d6['query']);_0x1b62f5[_0x7cf3('0x3d')]=_[_0x7cf3('0x3e')](_0x1b62f5[_0x7cf3('0x3f')],_0x1b62f5[_0x7cf3('0x3b')]);_0xd4ee32[_0x7cf3('0x40')]=_['intersection'](_0x1b62f5[_0x7cf3('0x3f')],qs[_0x7cf3('0x41')](_0x3918d6['query'][_0x7cf3('0x41')]));_0xd4ee32[_0x7cf3('0x40')]=_0xd4ee32[_0x7cf3('0x40')][_0x7cf3('0x42')]?_0xd4ee32[_0x7cf3('0x40')]:_0x1b62f5[_0x7cf3('0x3f')];if(!_0x3918d6[_0x7cf3('0x3b')]['hasOwnProperty'](_0x7cf3('0x43'))){_0xd4ee32[_0x7cf3('0x2d')]=qs['limit'](_0x3918d6[_0x7cf3('0x3b')][_0x7cf3('0x2d')]);_0xd4ee32[_0x7cf3('0x2b')]=qs[_0x7cf3('0x2b')](_0x3918d6[_0x7cf3('0x3b')][_0x7cf3('0x2b')]);}_0xd4ee32[_0x7cf3('0x44')]=qs[_0x7cf3('0x45')](_0x3918d6[_0x7cf3('0x3b')][_0x7cf3('0x45')]);_0xd4ee32['where']=qs[_0x7cf3('0x3d')](_['pick'](_0x3918d6['query'],_0x1b62f5[_0x7cf3('0x3d')]),_0x47ad84);if(_0x3918d6[_0x7cf3('0x3b')][_0x7cf3('0x46')]){_0xd4ee32[_0x7cf3('0x47')]=_['merge'](_0xd4ee32['where'],{'$or':_[_0x7cf3('0x38')](_0x47ad84,function(_0x185c1b){if(_0x185c1b[_0x7cf3('0x39')]!==_0x7cf3('0x48')){var _0x52fce0={};_0x52fce0[_0x185c1b[_0x7cf3('0x35')]]={'$like':'%'+_0x3918d6[_0x7cf3('0x3b')][_0x7cf3('0x46')]+'%'};return _0x52fce0;}})});}_0xd4ee32=_[_0x7cf3('0x49')]({},_0xd4ee32,_0x3918d6['options']);var _0x3c5554={'where':_0xd4ee32[_0x7cf3('0x47')]};return db[_0x7cf3('0x4a')][_0x7cf3('0x2e')](_0x3c5554)[_0x7cf3('0x33')](function(_0x228484){_0x4ee41c[_0x7cf3('0x2e')]=_0x228484;if(_0x3918d6[_0x7cf3('0x3b')][_0x7cf3('0x4b')]){_0xd4ee32['include']=[{'all':!![]}];}return db['SmsMessage'][_0x7cf3('0x4c')](_0xd4ee32);})[_0x7cf3('0x33')](function(_0xd81bda){_0x4ee41c['rows']=_0xd81bda;return _0x4ee41c;})['then'](respondWithFilteredResult(_0x2c7f87,_0xd4ee32))[_0x7cf3('0x4d')](handleError(_0x2c7f87,null));};exports[_0x7cf3('0x4e')]=function(_0x53b6de,_0x3ace1b){var _0x3136b8={'raw':!![],'where':{'id':_0x53b6de[_0x7cf3('0x4f')]['id']}},_0x1a9078={};_0x1a9078[_0x7cf3('0x3f')]=_['keys'](db[_0x7cf3('0x4a')][_0x7cf3('0x50')]);_0x1a9078[_0x7cf3('0x3b')]=_[_0x7cf3('0x3c')](_0x53b6de[_0x7cf3('0x3b')]);_0x1a9078[_0x7cf3('0x3d')]=_[_0x7cf3('0x3e')](_0x1a9078[_0x7cf3('0x3f')],_0x1a9078[_0x7cf3('0x3b')]);_0x3136b8[_0x7cf3('0x40')]=_[_0x7cf3('0x3e')](_0x1a9078['model'],qs[_0x7cf3('0x41')](_0x53b6de[_0x7cf3('0x3b')]['fields']));_0x3136b8[_0x7cf3('0x40')]=_0x3136b8['attributes'][_0x7cf3('0x42')]?_0x3136b8[_0x7cf3('0x40')]:_0x1a9078[_0x7cf3('0x3f')];if(_0x53b6de['query'][_0x7cf3('0x4b')]){_0x3136b8[_0x7cf3('0x51')]=[{'all':!![]}];}_0x3136b8=_[_0x7cf3('0x49')]({},_0x3136b8,_0x53b6de[_0x7cf3('0x52')]);return db[_0x7cf3('0x4a')][_0x7cf3('0x53')](_0x3136b8)[_0x7cf3('0x33')](handleEntityNotFound(_0x3ace1b,null))['then'](respondWithResult(_0x3ace1b,null))[_0x7cf3('0x4d')](handleError(_0x3ace1b,null));};exports['create']=function(_0x1007d0,_0x3e0bd0){return db[_0x7cf3('0x4a')]['create'](_0x1007d0[_0x7cf3('0x54')],{})['then'](respondWithResult(_0x3e0bd0,0xc9))[_0x7cf3('0x4d')](handleError(_0x3e0bd0,null));};exports[_0x7cf3('0x55')]=function(_0x449099,_0x188df8){if(_0x449099[_0x7cf3('0x54')]['id']){delete _0x449099[_0x7cf3('0x54')]['id'];}return db[_0x7cf3('0x4a')][_0x7cf3('0x53')]({'where':{'id':_0x449099[_0x7cf3('0x4f')]['id']}})['then'](handleEntityNotFound(_0x188df8,null))[_0x7cf3('0x33')](saveUpdates(_0x449099[_0x7cf3('0x54')],null))[_0x7cf3('0x33')](respondWithResult(_0x188df8,null))[_0x7cf3('0x4d')](handleError(_0x188df8,null));};exports['destroy']=function(_0x55a1c3,_0xb5aaff){return db[_0x7cf3('0x4a')]['find']({'where':{'id':_0x55a1c3['params']['id']}})[_0x7cf3('0x33')](handleEntityNotFound(_0xb5aaff,null))['then'](removeEntity(_0xb5aaff,null))[_0x7cf3('0x4d')](handleError(_0xb5aaff,null));};exports[_0x7cf3('0x56')]=function(_0x288032,_0x45f9bd){return db[_0x7cf3('0x4a')][_0x7cf3('0x56')]()[_0x7cf3('0x33')](respondWithResult(_0x45f9bd,null))[_0x7cf3('0x4d')](handleError(_0x45f9bd,null));};var interaction_log=require(_0x7cf3('0x13'))('sms-interactions');exports[_0x7cf3('0x57')]=function(_0x356996,_0x1e7c88,_0xbd9026){var _0x31e339={'agent':{},'channel':_0x7cf3('0x58')};if(_0x356996[_0x7cf3('0x54')]['id']){delete _0x356996['body']['id'];}_0x356996[_0x7cf3('0x54')][_0x7cf3('0x59')]=!![];_0x356996[_0x7cf3('0x54')]['readAt']=moment()['format'](_0x7cf3('0x5a'));_0x356996[_0x7cf3('0x54')]['UserId']=_0x356996[_0x7cf3('0x54')][_0x7cf3('0x5b')]||_0x356996[_0x7cf3('0x5c')]['id'];_0x31e339['agent']['id']=_0x356996[_0x7cf3('0x54')]['UserId'];return db[_0x7cf3('0x4a')][_0x7cf3('0x53')]({'where':{'id':_0x356996[_0x7cf3('0x4f')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1e7c88,null))[_0x7cf3('0x33')](saveUpdates(_0x356996['body'],null))['then'](function(_0x357707){if(_0x357707){_0x31e339['message']=_0x357707[_0x7cf3('0x5d')]({'plain':!![]});return db[_0x7cf3('0x5e')][_0x7cf3('0x53')]({'where':{'id':_0x357707[_0x7cf3('0x5f')]}});}return null;})[_0x7cf3('0x33')](handleEntityNotFound(_0x1e7c88,null))[_0x7cf3('0x33')](function(_0x1f982d){if(_0x1f982d){return _0x1f982d[_0x7cf3('0x55')]({'UserId':_0x356996[_0x7cf3('0x54')][_0x7cf3('0x5b')],'read1stAt':_[_0x7cf3('0x60')](_0x1f982d[_0x7cf3('0x61')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x154030){if(_0x154030){_0x31e339[_0x7cf3('0x62')]=_0x154030[_0x7cf3('0x5d')]({'plain':!![]});interaction_log[_0x7cf3('0x1e')](_0x7cf3('0x63'),_0x356996['user']['id'],_0x356996[_0x7cf3('0x5c')]['name'],_0x356996[_0x7cf3('0x5c')]['role'],_0x31e339[_0x7cf3('0x62')]['id'],_0x356996[_0x7cf3('0x54')]?JSON[_0x7cf3('0x23')](_0x356996[_0x7cf3('0x54')]):_0x7cf3('0x64'));return respondWithRpcPromise(_0x7cf3('0x65'),_0x7cf3('0x66'),_0x31e339);}return null;})[_0x7cf3('0x33')](function(_0xabfa46){var _0x5ed813=_0x7cf3('0x67')+_0xabfa46[_0x7cf3('0x26')]['ContactId'];return db[_0x7cf3('0x68')][_0x7cf3('0x3b')](_0x5ed813,{'type':db[_0x7cf3('0x69')]['QueryTypes']['SELECT'],'raw':!![]})[_0x7cf3('0x33')](function(_0x3349b5){return _0x3349b5;});})['then'](function(_0x40b2d3){if(_0x40b2d3){_0x31e339[_0x7cf3('0x26')]['contact']=_0x40b2d3[0x0];if(!_0x356996['body'][_0x7cf3('0x5b')])return;return db[_0x7cf3('0x6a')][_0x7cf3('0x53')]({'where':{'id':_0x356996['body'][_0x7cf3('0x5b')],'role':'agent'},'attributes':['id',_0x7cf3('0x35'),_0x7cf3('0x6b'),_0x7cf3('0x6c'),'internal'],'raw':!![]});}return null;})[_0x7cf3('0x33')](function(_0x486380){if(!_0x486380)return null;_0x31e339[_0x7cf3('0x26')]['agent']=_0x486380;return _0x31e339;})[_0x7cf3('0x33')](function(_0x125e78){if(_0x125e78){if(_0x356996[_0x7cf3('0x54')][_0x7cf3('0x6d')]){_0x31e339[_0x7cf3('0x26')][_0x7cf3('0x6e')]=util[_0x7cf3('0x6f')]('SIP/%s',_0x356996[_0x7cf3('0x5c')][_0x7cf3('0x35')]);_0x31e339['message'][_0x7cf3('0x70')]=_0x31e339[_0x7cf3('0x70')];_0x31e339['message'][_0x7cf3('0x71')]=_0x31e339[_0x7cf3('0x70')];_0x31e339[_0x7cf3('0x26')][_0x7cf3('0x72')]='accept';return respondWithRpcPromise('EventManager','EventManager',{'event':_0x7cf3('0x73'),'message':_0x31e339['message']},client9002)['then'](function(){return _0x31e339;});}return _0x31e339;}return null;})['then'](respondWithResult(_0x1e7c88,null))[_0x7cf3('0x4d')](handleError(_0x1e7c88,null));};var interaction_log=require(_0x7cf3('0x13'))(_0x7cf3('0x74'));exports[_0x7cf3('0x31')]=function(_0x2f0b15,_0x4149ca,_0x424cf5){var _0x14578a={'agent':{},'channel':'sms'};if(_0x2f0b15[_0x7cf3('0x54')]['id']){delete _0x2f0b15[_0x7cf3('0x54')]['id'];}_0x2f0b15[_0x7cf3('0x54')][_0x7cf3('0x5b')]=_0x2f0b15['body']['UserId']||_0x2f0b15[_0x7cf3('0x5c')]['id'];_0x14578a[_0x7cf3('0x75')]['id']=_0x2f0b15[_0x7cf3('0x54')]['UserId'];return db['SmsMessage'][_0x7cf3('0x53')]({'where':{'id':_0x2f0b15[_0x7cf3('0x4f')]['id'],'UserId':null}})[_0x7cf3('0x33')](handleEntityNotFound(_0x4149ca,null))[_0x7cf3('0x33')](function(_0x2df3f5){if(_0x2df3f5){_0x14578a[_0x7cf3('0x26')]=_0x2df3f5['get']({'plain':!![]});return db[_0x7cf3('0x5e')][_0x7cf3('0x53')]({'where':{'id':_0x2df3f5[_0x7cf3('0x5f')]}});}return null;})[_0x7cf3('0x33')](handleEntityNotFound(_0x4149ca,null))[_0x7cf3('0x33')](function(_0x2096ab){if(_0x2096ab){_0x14578a[_0x7cf3('0x62')]=_0x2096ab[_0x7cf3('0x5d')]({'plain':!![]});interaction_log[_0x7cf3('0x1e')](_0x7cf3('0x76'),_0x2f0b15[_0x7cf3('0x5c')]['id'],_0x2f0b15[_0x7cf3('0x5c')]['name'],_0x2f0b15[_0x7cf3('0x5c')][_0x7cf3('0x77')],_0x14578a[_0x7cf3('0x62')]['id'],_0x2f0b15['body']?JSON[_0x7cf3('0x23')](_0x2f0b15[_0x7cf3('0x54')]):_0x7cf3('0x64'));return respondWithRpcPromise(_0x7cf3('0x78'),_0x7cf3('0x79'),_0x14578a);}return null;})[_0x7cf3('0x33')](function(_0x401a46){var _0x21cfa5=_0x7cf3('0x67')+_0x401a46[_0x7cf3('0x26')][_0x7cf3('0x7a')];return db[_0x7cf3('0x68')]['query'](_0x21cfa5,{'type':db['Sequelize'][_0x7cf3('0x7b')][_0x7cf3('0x7c')],'raw':!![]})[_0x7cf3('0x33')](function(_0xc66756){return _0xc66756;});})['then'](function(_0x15dc82){if(_0x15dc82){_0x14578a[_0x7cf3('0x26')][_0x7cf3('0x7d')]=_0x15dc82[0x0];if(!_0x2f0b15[_0x7cf3('0x54')]['UserId'])return;return db[_0x7cf3('0x6a')][_0x7cf3('0x53')]({'where':{'id':_0x2f0b15[_0x7cf3('0x54')]['UserId'],'role':'agent'},'attributes':['id',_0x7cf3('0x35'),_0x7cf3('0x6b'),_0x7cf3('0x6c'),'internal'],'raw':!![]});}return null;})['then'](function(_0x124dfe){if(!_0x124dfe)return null;_0x14578a[_0x7cf3('0x26')][_0x7cf3('0x75')]=_0x124dfe;return _0x14578a;})['then'](function(_0x19591d){if(_0x19591d){_0x19591d[_0x7cf3('0x26')][_0x7cf3('0x6e')]=util['format'](_0x7cf3('0x7e'),_0x2f0b15[_0x7cf3('0x5c')][_0x7cf3('0x35')]);_0x19591d[_0x7cf3('0x26')][_0x7cf3('0x70')]=_0x14578a[_0x7cf3('0x70')];_0x19591d[_0x7cf3('0x26')][_0x7cf3('0x71')]=_0x14578a[_0x7cf3('0x70')];_0x19591d[_0x7cf3('0x26')][_0x7cf3('0x72')]=_0x7cf3('0x31');respondWithRpcPromise(_0x7cf3('0x7f'),_0x7cf3('0x7f'),{'event':'rejectmessage','message':_0x19591d['message']},client9002);return _0x14578a;}return null;})[_0x7cf3('0x33')](respondWithResult(_0x4149ca,null))[_0x7cf3('0x4d')](handleError(_0x4149ca,null));};exports[_0x7cf3('0x28')]=function(_0x4ee612,_0x3cd8d3,_0x2d032e){if(_0x4ee612[_0x7cf3('0x54')]['id']){delete _0x4ee612[_0x7cf3('0x54')]['id'];}var _0x5108f9;return db[_0x7cf3('0x4a')]['find']({'where':{'id':_0x4ee612[_0x7cf3('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3cd8d3,null))[_0x7cf3('0x33')](function(_0x9d2a03){if(_0x9d2a03){_0x5108f9=_0x9d2a03;return db[_0x7cf3('0x80')][_0x7cf3('0x53')]({'where':{'id':_0x9d2a03['SmsAccountId']}});}})[_0x7cf3('0x33')](handleEntityNotFound(_0x3cd8d3,null))[_0x7cf3('0x33')](function(_0x2889e8){if(_0x2889e8){logger[_0x7cf3('0x20')](_0x7cf3('0x21'),_0x7cf3('0x28'),_0x7cf3('0x81'),_0x2889e8['type'],util[_0x7cf3('0x82')](_0x4ee612[_0x7cf3('0x54')],{'showHidden':![],'depth':null}));switch(_0x2889e8[_0x7cf3('0x39')]){case _0x7cf3('0x83'):if(_0x4ee612[_0x7cf3('0x54')][_0x7cf3('0x84')]&&_0x4ee612[_0x7cf3('0x54')]['MessageSid']===_0x5108f9[_0x7cf3('0x85')]){return _0x5108f9['update']({'read':!![]});}else{logger[_0x7cf3('0x24')](_0x7cf3('0x86'),_0x7cf3('0x28'),_0x7cf3('0x83'),util[_0x7cf3('0x82')](_0x4ee612[_0x7cf3('0x54')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x4ee612['body'][_0x7cf3('0x87')]&&_0x4ee612[_0x7cf3('0x54')][_0x7cf3('0x87')]===_0x5108f9['messageId']&&_[_0x7cf3('0x88')]([_0x7cf3('0x89'),'delivered'],_0x4ee612['body'][_0x7cf3('0x8a')])>=0x0){return _0x5108f9[_0x7cf3('0x55')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7cf3('0x28'),_0x7cf3('0x8b'),util[_0x7cf3('0x82')](_0x4ee612[_0x7cf3('0x54')],{'showHidden':![],'depth':null}));}break;case _0x7cf3('0x8c'):var _0x77e31e=_0x4ee612[_0x7cf3('0x54')][_0x7cf3('0x8d')][0x0];if(_0x77e31e[_0x7cf3('0x28')]['groupName']===_0x7cf3('0x8e')){return _0x5108f9[_0x7cf3('0x55')]({'read':!![]});}else{logger[_0x7cf3('0x24')](_0x7cf3('0x86'),'status','infobip',util[_0x7cf3('0x82')](_0x4ee612[_0x7cf3('0x54')],{'showHidden':![],'depth':null}));}break;}return _0x5108f9;}})[_0x7cf3('0x33')](respondWithResult(_0x3cd8d3,null))[_0x7cf3('0x4d')](handleError(_0x3cd8d3,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 2db45a4..636479b 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 _0x9b13=['../../mysqldb','SmsMessage','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x133277,_0xb1d6b2){var _0x5b4a22=function(_0x484c26){while(--_0x484c26){_0x133277['push'](_0x133277['shift']());}};_0x5b4a22(++_0xb1d6b2);}(_0x9b13,0x74));var _0x39b1=function(_0x421ffa,_0x374a02){_0x421ffa=_0x421ffa-0x0;var _0x26c492=_0x9b13[_0x421ffa];return _0x26c492;};'use strict';var EventEmitter=require(_0x39b1('0x0'));var SmsMessage=require(_0x39b1('0x1'))['db'][_0x39b1('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x39b1('0x3'),'afterUpdate':'update','afterDestroy':_0x39b1('0x4')};function emitEvent(_0x2f8eeb){return function(_0x7ae591,_0x2daa53,_0xd34f53){SmsMessageEvents[_0x39b1('0x5')](_0x2f8eeb+':'+_0x7ae591['id'],_0x7ae591);SmsMessageEvents[_0x39b1('0x5')](_0x2f8eeb,_0x7ae591);_0xd34f53(null);};}for(var e in events){if(events[_0x39b1('0x6')](e)){var event=events[e];SmsMessage[_0x39b1('0x7')](e,emitEvent(event));}}module[_0x39b1('0x8')]=SmsMessageEvents; \ No newline at end of file +var _0xa6cf=['exports','../../mysqldb','SmsMessage','setMaxListeners','save','emit','hasOwnProperty','hook'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xa6cf,0x79));var _0xfa6c=function(_0x4ac50b,_0x99f2ed){_0x4ac50b=_0x4ac50b-0x0;var _0x3c5410=_0xa6cf[_0x4ac50b];return _0x3c5410;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0xfa6c('0x0'))['db'][_0xfa6c('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xfa6c('0x2')](0x0);var events={'afterCreate':_0xfa6c('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5b1358){return function(_0x3a843e,_0x13e240,_0x50dba3){SmsMessageEvents[_0xfa6c('0x4')](_0x5b1358+':'+_0x3a843e['id'],_0x3a843e);SmsMessageEvents['emit'](_0x5b1358,_0x3a843e);_0x50dba3(null);};}for(var e in events){if(events[_0xfa6c('0x5')](e)){var event=events[e];SmsMessage[_0xfa6c('0x6')](e,emitEvent(event));}}module[_0xfa6c('0x7')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 4cc1f0f..58208a8 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 _0xe6a3=['utf8mb4','lodash','util','bluebird','path','define','SmsMessage','messageId','fti_sms_messages','body','models','get','direction','toLowerCase','out','secret','isNil','SmsInteractionId','SmsInteraction','update','catch','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','create','remote','/api/sms/messages/','/status?token=','token','then','sid','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','username','password','smsMethod','sender','login?username=','&password=','GET','sms','total_sent','deliveryReport','read','skebby','error','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','POST','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','http_code','data','queued_count','head','messages','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','authId','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','timestamp','keys','sort','length','createHash','md5','digest','hex','signature=','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','https://messaging.bandwidth.com/api/v2/users/','accountId','base64','bandwidth','application/json','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid','intelepeer','Token\x20not\x20received','finally'];(function(_0x28f19b,_0x56f867){var _0x37bf0e=function(_0x306647){while(--_0x306647){_0x28f19b['push'](_0x28f19b['shift']());}};_0x37bf0e(++_0x56f867);}(_0xe6a3,0x1d5));var _0x3e6a=function(_0x112fe3,_0x16b642){_0x112fe3=_0x112fe3-0x0;var _0x1ec903=_0xe6a3[_0x112fe3];return _0x1ec903;};'use strict';var _=require(_0x3e6a('0x0'));var util=require(_0x3e6a('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x3e6a('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3e6a('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsMessage.attributes');module['exports']=function(_0x5d23c5,_0x101a15){return _0x5d23c5[_0x3e6a('0x4')](_0x3e6a('0x5'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x3e6a('0x6'),'fields':[_0x3e6a('0x6')]},{'name':_0x3e6a('0x7'),'fields':[_0x3e6a('0x8')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x59de19,_0x501e37,_0x3c0ee9){var _0x48f040=_0x5d23c5[_0x3e6a('0x9')];var _0x4fc3c5=_0x59de19[_0x3e6a('0xa')]({'plain':!![]});if(_0x4fc3c5[_0x3e6a('0xb')][_0x3e6a('0xc')]()==='in'||_0x4fc3c5[_0x3e6a('0xb')]['toLowerCase']()===_0x3e6a('0xd')&&!_0x4fc3c5[_0x3e6a('0xe')]&&!_[_0x3e6a('0xf')](_0x4fc3c5['UserId'])&&!_[_0x3e6a('0xf')](_0x4fc3c5[_0x3e6a('0x10')])){_0x48f040[_0x3e6a('0x11')]['findOne']({'where':{'id':_0x4fc3c5[_0x3e6a('0x10')]}})['then'](function(_0x327e75){if(_0x327e75){_0x327e75[_0x3e6a('0x12')]({'lastMsgAt':_0x4fc3c5['createdAt'],'lastMsgDirection':_0x4fc3c5[_0x3e6a('0xb')]['toLowerCase']()});}})[_0x3e6a('0x13')](function(_0x4aaddd){console['error'](_0x4aaddd);});}if(_0x4fc3c5[_0x3e6a('0xb')]==='out'&&!_0x4fc3c5[_0x3e6a('0xe')]){var _0x5acefd;_0x48f040[_0x3e6a('0x14')][_0x3e6a('0x15')]({'where':{'id':_0x4fc3c5[_0x3e6a('0x16')]},'raw':!![]})['then'](function(_0x5607d3){_0x5acefd=_0x5607d3;if(_0x5acefd&&_0x5acefd['type']){switch(_0x5acefd[_0x3e6a('0x17')]){case _0x3e6a('0x18'):var _0x4adc29=require('twilio');if(_0x5acefd[_0x3e6a('0x19')]&&_0x5acefd[_0x3e6a('0x1a')]&&_0x5acefd[_0x3e6a('0x1b')]){var _0x36496d=new _0x4adc29(_0x5acefd[_0x3e6a('0x19')],_0x5acefd[_0x3e6a('0x1a')]);_0x36496d['messages'][_0x3e6a('0x1c')]({'body':_0x4fc3c5[_0x3e6a('0x8')],'to':_0x4fc3c5[_0x3e6a('0x1b')],'from':_0x5acefd[_0x3e6a('0x1b')],'statusCallback':_0x5acefd[_0x3e6a('0x1d')]+_0x3e6a('0x1e')+_0x4fc3c5['id']+_0x3e6a('0x1f')+_0x5acefd[_0x3e6a('0x20')]})[_0x3e6a('0x21')](function(_0x16ed99){if(_0x16ed99[_0x3e6a('0x22')]){return _0x59de19[_0x3e6a('0x12')]({'messageId':_0x16ed99[_0x3e6a('0x22')]});}})[_0x3e6a('0x13')](function(_0x2f0bb1){logger['error'](_0x3e6a('0x23'),'afterCreate',_0x3e6a('0x18'),util[_0x3e6a('0x24')](_0x2f0bb1,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3e6a('0x23'),_0x3e6a('0x25'),_0x3e6a('0x18'),_0x3e6a('0x26'));}break;case'skebby':var _0x50822f='https://api.skebby.it/API/v1.0/REST/';if(_0x5acefd[_0x3e6a('0x27')]&&_0x5acefd[_0x3e6a('0x28')]){var _0x427662={'recipient':[_0x4fc3c5[_0x3e6a('0x1b')]],'message':_0x4fc3c5[_0x3e6a('0x8')],'message_type':_0x5acefd['smsMethod']};if(_0x5acefd[_0x3e6a('0x29')]&&_0x5acefd['smsMethod']!=='SI'){_0x427662[_0x3e6a('0x2a')]=_0x5acefd[_0x3e6a('0x1b')];}var _0x509401={'url':_0x50822f+_0x3e6a('0x2b')+_0x5acefd[_0x3e6a('0x27')]+_0x3e6a('0x2c')+_0x5acefd['password'],'method':_0x3e6a('0x2d')};rp(_0x509401)['then'](function(_0x43c5ac){var _0x4030f9=_0x43c5ac['split'](';');var _0x394708={'user_key':_0x4030f9[0x0],'session_key':_0x4030f9[0x1]};_0x509401={'url':_0x50822f+_0x3e6a('0x2e'),'method':'POST','headers':{'user_key':_0x394708['user_key'],'Session_key':_0x394708['session_key']},'json':!![],'body':_0x427662};return rp(_0x509401);})[_0x3e6a('0x21')](function(_0x1c811d){if(_0x1c811d[_0x3e6a('0x2f')]>=0x1){var _0x3e99d9={'messageId':_0x1c811d['internal_order_id']};if(_0x5acefd[_0x3e6a('0x29')]!=='GP'||!_0x5acefd[_0x3e6a('0x30')]){_0x3e99d9[_0x3e6a('0x31')]=!![];}return _0x59de19['update'](_0x3e99d9);}else{return logger['error'](_0x3e6a('0x23'),_0x3e6a('0x25'),_0x3e6a('0x32'),util[_0x3e6a('0x24')](_0x1c811d,{'showHidden':![],'depth':null}));}})[_0x3e6a('0x13')](function(_0x3dfd7a){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x3e6a('0x32'),util[_0x3e6a('0x24')](_0x3dfd7a,{'showHidden':![],'depth':null}));});}else{logger[_0x3e6a('0x33')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3e6a('0x25'),_0x3e6a('0x32'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x3e6a('0x34'):if(_0x5acefd[_0x3e6a('0x1a')]){var _0x5db95b={'recipient':_0x4fc3c5[_0x3e6a('0x1b')],'message':_0x4fc3c5[_0x3e6a('0x8')],'sender':_0x5acefd[_0x3e6a('0x35')]||_0x5acefd[_0x3e6a('0x1b')],'authorization':_0x5acefd['authToken']};var _0x501e37={'method':'POST','uri':_0x3e6a('0x36'),'body':_0x5db95b,'json':!![]};rp(_0x501e37)[_0x3e6a('0x21')](function(_0x1e4afb){var _0x4f00be={'messageId':_0x1e4afb[_0x3e6a('0x37')]};if(!_0x5acefd[_0x3e6a('0x30')]){_0x4f00be[_0x3e6a('0x31')]=!![];}return _0x59de19['update'](_0x4f00be);})[_0x3e6a('0x13')](function(_0x222135){logger['error'](_0x3e6a('0x23'),_0x3e6a('0x25'),_0x3e6a('0x34'),util[_0x3e6a('0x24')](_0x222135,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3e6a('0x23'),'afterCreate',_0x3e6a('0x34'),_0x3e6a('0x38'));}break;case _0x3e6a('0x39'):if(_0x5acefd['username']&&_0x5acefd['password']){var _0x5db95b={'messages':[{'source':_0x3e6a('0x3a'),'to':_0x4fc3c5[_0x3e6a('0x1b')],'body':_0x4fc3c5['body'],'from':_0x5acefd[_0x3e6a('0x35')]||_0x5acefd['phone']}]};var _0x59d00e=util[_0x3e6a('0x3b')]('%s:%s',_0x5acefd[_0x3e6a('0x27')],_0x5acefd[_0x3e6a('0x28')]);var _0x501e37={'method':_0x3e6a('0x3c'),'uri':_0x3e6a('0x3d'),'body':_0x5db95b,'headers':{'Authorization':util[_0x3e6a('0x3b')](_0x3e6a('0x3e'),new Buffer(_0x59d00e)[_0x3e6a('0x3f')]('base64'))},'json':!![]};rp(_0x501e37)[_0x3e6a('0x21')](function(_0x9ed9b0){if(_0x9ed9b0[_0x3e6a('0x40')]>=0xc8&&_0x9ed9b0[_0x3e6a('0x40')]<=0xce){if(_0x9ed9b0['data']&&_0x9ed9b0[_0x3e6a('0x41')][_0x3e6a('0x42')]>0x0){var _0x5eca76=_[_0x3e6a('0x43')](_0x9ed9b0[_0x3e6a('0x41')][_0x3e6a('0x44')]);var _0x435c9b={'messageId':_0x5eca76[_0x3e6a('0x45')]};if(!_0x5acefd['deliveryReport']){_0x435c9b['read']=!![];}return _0x59de19[_0x3e6a('0x12')](_0x435c9b);}else{logger[_0x3e6a('0x33')](_0x3e6a('0x23'),_0x3e6a('0x25'),_0x3e6a('0x46'),util[_0x3e6a('0x24')](_0x9ed9b0,{'showHidden':![],'depth':null}));}}else{logger[_0x3e6a('0x33')](_0x3e6a('0x23'),_0x3e6a('0x25'),_0x3e6a('0x46'),util[_0x3e6a('0x24')](_0x9ed9b0,{'showHidden':![],'depth':null}));}})['catch'](function(_0x4aa8ff){logger[_0x3e6a('0x33')](_0x3e6a('0x23'),'afterCreate',_0x3e6a('0x46'),util[_0x3e6a('0x24')](_0x4aa8ff,{'showHidden':![],'depth':null}));});}else{logger[_0x3e6a('0x33')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3e6a('0x25'),'clickSend',_0x3e6a('0x47'));}break;case _0x3e6a('0x48'):if(_0x5acefd[_0x3e6a('0x49')]&&_0x5acefd['authToken']){var _0x5db95b={'dst':_0x4fc3c5[_0x3e6a('0x1b')],'text':_0x4fc3c5[_0x3e6a('0x8')],'src':_0x5acefd[_0x3e6a('0x35')]||_0x5acefd[_0x3e6a('0x1b')],'url':_0x5acefd[_0x3e6a('0x1d')]+_0x3e6a('0x1e')+_0x4fc3c5['id']+_0x3e6a('0x1f')+_0x5acefd[_0x3e6a('0x20')]};var _0x59d00e=util[_0x3e6a('0x3b')](_0x3e6a('0x4a'),_0x5acefd[_0x3e6a('0x49')],_0x5acefd[_0x3e6a('0x1a')]);var _0x501e37={'method':'POST','uri':util[_0x3e6a('0x3b')](_0x3e6a('0x4b'),_0x5acefd[_0x3e6a('0x49')]),'body':_0x5db95b,'headers':{'Authorization':util[_0x3e6a('0x3b')](_0x3e6a('0x3e'),new Buffer(_0x59d00e)['toString']('base64'))},'json':!![]};rp(_0x501e37)[_0x3e6a('0x21')](function(_0x523ace){var _0x35a454={'messageId':_0x523ace[_0x3e6a('0x4c')][0x0]};return _0x59de19[_0x3e6a('0x12')](_0x35a454);})[_0x3e6a('0x13')](function(_0x22bf5a){logger['error'](_0x3e6a('0x23'),'afterCreate',_0x3e6a('0x48'),util[_0x3e6a('0x24')](_0x22bf5a,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3e6a('0x25'),_0x3e6a('0x48'),_0x3e6a('0x4d'));}break;case _0x3e6a('0x4e'):if(_0x5acefd[_0x3e6a('0x27')]&&_0x5acefd[_0x3e6a('0x28')]){if(_0x5acefd[_0x3e6a('0x4f')]){var _0x7a5791={'method':'POST','uri':_0x5acefd[_0x3e6a('0x4f')]+_0x3e6a('0x50'),'body':{'username':_0x5acefd[_0x3e6a('0x27')],'password':_0x5acefd['password']},'json':!![]};return rp(_0x7a5791)['then'](function(_0x567793){var _0x34b557={'method':_0x3e6a('0x3c'),'uri':_0x5acefd[_0x3e6a('0x4f')]+_0x3e6a('0x51'),'body':{'messages':[{'from':_0x5acefd['phone'],'destinations':[{'to':_0x4fc3c5[_0x3e6a('0x1b')]}],'text':_0x4fc3c5[_0x3e6a('0x8')],'notifyUrl':_0x5acefd['remote']+_0x3e6a('0x1e')+_0x4fc3c5['id']+'/status?token='+_0x5acefd[_0x3e6a('0x20')],'notifyContentType':'application/json','callbackData':_0x5acefd[_0x3e6a('0x1b')]+';'+_0x4fc3c5[_0x3e6a('0x8')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x567793[_0x3e6a('0x20')]},'json':!![]};return rp(_0x34b557)[_0x3e6a('0x21')](function(_0x403cc9){if(_0x403cc9['messages']){var _0x3cfbe6={'messageId':_0x403cc9[_0x3e6a('0x44')][0x0][_0x3e6a('0x6')]};if(!_0x5acefd[_0x3e6a('0x30')]){_0x3cfbe6[_0x3e6a('0x31')]=!![];}return _0x59de19[_0x3e6a('0x12')](_0x3cfbe6);}else{return logger[_0x3e6a('0x33')](_0x3e6a('0x23'),'afterCreate','infobip',util[_0x3e6a('0x24')](_0x403cc9,{'showHidden':![],'depth':null}));}});})[_0x3e6a('0x13')](function(_0x215cb2){return logger[_0x3e6a('0x33')](_0x3e6a('0x23'),_0x3e6a('0x25'),_0x3e6a('0x4e'),util['inspect'](_0x215cb2,{'showHidden':![],'depth':null}));});}else{logger[_0x3e6a('0x33')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3e6a('0x25'),_0x3e6a('0x4e'),_0x3e6a('0x52'));}}else{logger[_0x3e6a('0x33')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x3e6a('0x4e'),_0x3e6a('0x47'));}break;case _0x3e6a('0x53'):var _0x4c244b=require(_0x3e6a('0x54'));if(_0x5acefd[_0x3e6a('0x55')]){var _0x1d7c70={};_0x1d7c70[_0x3e6a('0x56')]=_0x5acefd[_0x3e6a('0x27')];_0x1d7c70[_0x3e6a('0x1b')]=_0x4fc3c5[_0x3e6a('0x1b')];_0x1d7c70[_0x3e6a('0x2a')]=_0x5acefd[_0x3e6a('0x1b')];_0x1d7c70[_0x3e6a('0x57')]=_0x4fc3c5['body'];_0x1d7c70[_0x3e6a('0x58')]=+new Date();var _0x4f7496='';var _0x3ef17d='';var _0x440e09=Object[_0x3e6a('0x59')](_0x1d7c70);_0x440e09[_0x3e6a('0x5a')]();for(var _0x15b7bf=0x0;_0x15b7bf<_0x440e09[_0x3e6a('0x5b')];_0x15b7bf++){if(_0x4f7496!=''){_0x4f7496+='&';}_0x4f7496+=_0x440e09[_0x15b7bf]+'='+encodeURIComponent(_0x1d7c70[_0x440e09[_0x15b7bf]]);_0x3ef17d+=_0x1d7c70[_0x440e09[_0x15b7bf]];}_0x3ef17d+=_0x5acefd[_0x3e6a('0x55')];_0x3ef17d=_0x4c244b[_0x3e6a('0x5c')](_0x3e6a('0x5d'))[_0x3e6a('0x12')](_0x3ef17d)[_0x3e6a('0x5e')](_0x3e6a('0x5f'));if(_0x4f7496!==''){_0x4f7496+='&';}_0x4f7496+=_0x3e6a('0x60')+_0x3ef17d;var _0x509401={'method':_0x3e6a('0x2d'),'uri':_0x5acefd[_0x3e6a('0x4f')]+'/external/get/send.php?'+_0x4f7496,'json':!![]};return rp(_0x509401)[_0x3e6a('0x21')](function(_0x33ce76){var _0x1539fa=Object[_0x3e6a('0x59')](_0x33ce76);if(_0x33ce76[_0x1539fa[0x0]][_0x3e6a('0x33')]&&parseInt(_0x33ce76[_0x1539fa[0x0]][_0x3e6a('0x33')])===0x0){var _0x252766={'messageId':_0x33ce76[_0x1539fa[0x0]][_0x3e6a('0x61')]};if(!_0x5acefd[_0x3e6a('0x30')]){_0x252766[_0x3e6a('0x31')]=!![];}return _0x59de19['update'](_0x252766);}else{return logger['error'](_0x3e6a('0x23'),'afterCreate',_0x3e6a('0x53'),util[_0x3e6a('0x24')](_0x33ce76['error'],{'showHidden':![],'depth':null}));}})[_0x3e6a('0x13')](function(_0x18f1a9){return logger[_0x3e6a('0x33')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3e6a('0x25'),_0x3e6a('0x53'),util[_0x3e6a('0x24')](_0x18f1a9,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3e6a('0x23'),_0x3e6a('0x25'),_0x3e6a('0x53'),_0x3e6a('0x62'));}break;case _0x3e6a('0x63'):if(_0x5acefd['apiKey']){var _0x103329={'method':_0x3e6a('0x3c'),'uri':_0x3e6a('0x64'),'headers':{'Authorization':_0x5acefd[_0x3e6a('0x55')]},'body':{'content':_0x4fc3c5['body'],'to':[_0x4fc3c5['phone']],'from':_0x5acefd[_0x3e6a('0x1b')],'binary':![],'clientMessageId':_0x3e6a('0x65'),'charset':_0x3e6a('0x66')},'json':!![]};rp(_0x103329)[_0x3e6a('0x21')](function(_0x113be3){if(!_0x113be3[_0x3e6a('0x33')]){var _0x4a96e7={'messageId':_0x113be3[_0x3e6a('0x44')][0x0][_0x3e6a('0x67')]};if(!_0x5acefd['deliveryReport']){_0x4a96e7[_0x3e6a('0x31')]=!![];}return _0x59de19[_0x3e6a('0x12')](_0x4a96e7);}else{return logger[_0x3e6a('0x33')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3e6a('0x25'),'clickatell',util['inspect'](_0x113be3[_0x3e6a('0x33')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x6d664d){return logger[_0x3e6a('0x33')](_0x3e6a('0x23'),_0x3e6a('0x25'),'clickatell',util[_0x3e6a('0x24')](_0x6d664d,{'showHidden':![],'depth':null}));});}else{logger[_0x3e6a('0x33')](_0x3e6a('0x23'),'afterCreate',_0x3e6a('0x63'),'Missing\x20parameters:\x20apiKey');}break;case'bandwidth':if(_0x5acefd['username']&&_0x5acefd['password']){var _0x59d00e=util[_0x3e6a('0x3b')]('%s:%s',_0x5acefd['username'],_0x5acefd[_0x3e6a('0x28')]);var _0x501e37={'method':_0x3e6a('0x3c'),'uri':_0x3e6a('0x68')+_0x5acefd[_0x3e6a('0x69')]+'/messages','body':{'to':[_0x4fc3c5[_0x3e6a('0x1b')]],'text':_0x4fc3c5['body'],'from':_0x5acefd['phone'],'applicationId':_0x5acefd['applicationId']},'headers':{'Authorization':util['format'](_0x3e6a('0x3e'),new Buffer(_0x59d00e)[_0x3e6a('0x3f')](_0x3e6a('0x6a')))},'json':!![]};rp(_0x501e37)['then'](function(_0x1d7e57){if(_0x1d7e57['id']){var _0x124d1f={'messageId':_0x1d7e57['id']};return _0x59de19[_0x3e6a('0x12')](_0x124d1f);}else{logger[_0x3e6a('0x33')](_0x3e6a('0x23'),_0x3e6a('0x25'),'bandwidth',util['inspect'](_0x1d7e57,{'showHidden':![],'depth':null}));}})[_0x3e6a('0x13')](function(_0x9b9182){logger[_0x3e6a('0x33')](_0x3e6a('0x23'),_0x3e6a('0x25'),_0x3e6a('0x6b'),util[_0x3e6a('0x24')](_0x9b9182,{'showHidden':![],'depth':null}));});}else{logger[_0x3e6a('0x33')](_0x3e6a('0x23'),'afterCreate',_0x3e6a('0x6b'),_0x3e6a('0x47'));}break;case'intelepeer':if(_0x5acefd['apiKey']){var _0x2d8d0e={};var _0x509401={'method':_0x3e6a('0x3c'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':'Bearer\x20'+_0x5acefd['apiKey'],'Content-Type':_0x3e6a('0x6c')},'body':{'from':_0x5acefd[_0x3e6a('0x1b')],'to':_0x4fc3c5[_0x3e6a('0x1b')],'text':_0x4fc3c5['body']},'json':!![]};return rp(_0x509401)['then'](function(_0x2c9602){if(_0x2c9602['code']==0xca){_0x2d8d0e[_0x3e6a('0x6d')]=_0x2c9602;var _0x486433={'method':'POST','uri':_0x3e6a('0x6e'),'headers':{'Authorization':_0x3e6a('0x6f')+_0x5acefd[_0x3e6a('0x55')],'Content-Type':_0x3e6a('0x6c')},'body':{'refid':_0x2d8d0e[_0x3e6a('0x6d')][_0x3e6a('0x70')]},'json':!![]};return rp(_0x486433)[_0x3e6a('0x21')](function(_0x2cf53a){_0x2d8d0e['status']=_0x2cf53a;var _0x36d21b={'messageId':_0x2d8d0e['message'][_0x3e6a('0x70')],'read':!![]};return _0x59de19[_0x3e6a('0x12')](_0x36d21b);});}else{return logger[_0x3e6a('0x33')](_0x3e6a('0x23'),_0x3e6a('0x25'),_0x3e6a('0x71'),util[_0x3e6a('0x24')](_0x2c9602,{'showHidden':![],'depth':null}));}})[_0x3e6a('0x13')](function(_0x54c320){return logger[_0x3e6a('0x33')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3e6a('0x25'),_0x3e6a('0x71'),util[_0x3e6a('0x24')](_0x54c320,{'showHidden':![],'depth':null}));});}else{return logger[_0x3e6a('0x33')](_0x3e6a('0x23'),'afterCreate','intelepeer',_0x3e6a('0x72'));}break;}}})[_0x3e6a('0x73')](function(){_0x3c0ee9();});}else{_0x3c0ee9();}}},'charset':_0x3e6a('0x74'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xd414=['sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','then','update','createdAt','error','SmsAccount','type','accountSid','authToken','phone','messages','create','/api/sms/messages/','/status?token=','token','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio','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','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','inspect','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','clicksend','xCALLY\x20Motion','format','https://rest.clicksend.com/v3/sms/send','toString','base64','http_code','data','queued_count','head','clickSend','plivo','authId','remote','%s:%s','Basic\x20%s','message_uuid','infobip','baseUrl','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','crypto','apiKey','login','text','keys','sort','length','createHash','md5','digest','signature=','/external/get/send.php?','csc','clickatell','uuid','UTF-8','apiMessageId','Missing\x20parameters:\x20apiKey','bandwidth','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','refid','status','Token\x20not\x20received','finally','utf8mb4','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','define'];(function(_0x3ee0c3,_0x264b46){var _0x11c90f=function(_0x2193b5){while(--_0x2193b5){_0x3ee0c3['push'](_0x3ee0c3['shift']());}};_0x11c90f(++_0x264b46);}(_0xd414,0x163));var _0x4d41=function(_0x581dd9,_0x3a4319){_0x581dd9=_0x581dd9-0x0;var _0x26a258=_0xd414[_0x581dd9];return _0x26a258;};'use strict';var _=require(_0x4d41('0x0'));var util=require(_0x4d41('0x1'));var logger=require('../../config/logger')(_0x4d41('0x2'));var moment=require(_0x4d41('0x3'));var BPromise=require(_0x4d41('0x4'));var rp=require(_0x4d41('0x5'));var fs=require('fs');var path=require(_0x4d41('0x6'));var rimraf=require(_0x4d41('0x7'));var config=require(_0x4d41('0x8'));var attributes=require(_0x4d41('0x9'));module['exports']=function(_0x2bed65,_0xbbb215){return _0x2bed65[_0x4d41('0xa')]('SmsMessage',attributes,{'tableName':_0x4d41('0xb'),'paranoid':![],'indexes':[{'name':_0x4d41('0xc'),'fields':[_0x4d41('0xc')]},{'name':_0x4d41('0xd'),'fields':[_0x4d41('0xe')],'type':_0x4d41('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1c5e8f,_0x41eaea,_0x212006){var _0x1ec666=_0x2bed65[_0x4d41('0x10')];var _0x1078bf=_0x1c5e8f[_0x4d41('0x11')]({'plain':!![]});if(_0x1078bf[_0x4d41('0x12')][_0x4d41('0x13')]()==='in'||_0x1078bf[_0x4d41('0x12')][_0x4d41('0x13')]()===_0x4d41('0x14')&&!_0x1078bf[_0x4d41('0x15')]&&!_[_0x4d41('0x16')](_0x1078bf[_0x4d41('0x17')])&&!_[_0x4d41('0x16')](_0x1078bf['SmsInteractionId'])){_0x1ec666[_0x4d41('0x18')][_0x4d41('0x19')]({'where':{'id':_0x1078bf[_0x4d41('0x1a')]}})[_0x4d41('0x1b')](function(_0x41b086){if(_0x41b086){_0x41b086[_0x4d41('0x1c')]({'lastMsgAt':_0x1078bf[_0x4d41('0x1d')],'lastMsgDirection':_0x1078bf[_0x4d41('0x12')][_0x4d41('0x13')]()});}})['catch'](function(_0x1736bd){console[_0x4d41('0x1e')](_0x1736bd);});}if(_0x1078bf[_0x4d41('0x12')]===_0x4d41('0x14')&&!_0x1078bf[_0x4d41('0x15')]){var _0x5ba3ed;_0x1ec666[_0x4d41('0x1f')]['find']({'where':{'id':_0x1078bf['SmsAccountId']},'raw':!![]})['then'](function(_0x38d585){_0x5ba3ed=_0x38d585;if(_0x5ba3ed&&_0x5ba3ed['type']){switch(_0x5ba3ed[_0x4d41('0x20')]){case'twilio':var _0x5e96c5=require('twilio');if(_0x5ba3ed[_0x4d41('0x21')]&&_0x5ba3ed[_0x4d41('0x22')]&&_0x5ba3ed[_0x4d41('0x23')]){var _0x3678d3=new _0x5e96c5(_0x5ba3ed['accountSid'],_0x5ba3ed[_0x4d41('0x22')]);_0x3678d3[_0x4d41('0x24')][_0x4d41('0x25')]({'body':_0x1078bf[_0x4d41('0xe')],'to':_0x1078bf[_0x4d41('0x23')],'from':_0x5ba3ed['phone'],'statusCallback':_0x5ba3ed['remote']+_0x4d41('0x26')+_0x1078bf['id']+_0x4d41('0x27')+_0x5ba3ed[_0x4d41('0x28')]})[_0x4d41('0x1b')](function(_0x38034b){if(_0x38034b['sid']){return _0x1c5e8f[_0x4d41('0x1c')]({'messageId':_0x38034b['sid']});}})[_0x4d41('0x29')](function(_0x24a40e){logger['error'](_0x4d41('0x2a'),_0x4d41('0x2b'),_0x4d41('0x2c'),util['inspect'](_0x24a40e,{'showHidden':![],'depth':null}));});}else{logger[_0x4d41('0x1e')](_0x4d41('0x2a'),_0x4d41('0x2b'),_0x4d41('0x2c'),_0x4d41('0x2d'));}break;case _0x4d41('0x2e'):var _0x5e4f91=_0x4d41('0x2f');if(_0x5ba3ed[_0x4d41('0x30')]&&_0x5ba3ed[_0x4d41('0x31')]){var _0x11cac6={'recipient':[_0x1078bf[_0x4d41('0x23')]],'message':_0x1078bf[_0x4d41('0xe')],'message_type':_0x5ba3ed[_0x4d41('0x32')]};if(_0x5ba3ed[_0x4d41('0x32')]&&_0x5ba3ed[_0x4d41('0x32')]!=='SI'){_0x11cac6[_0x4d41('0x33')]=_0x5ba3ed['phone'];}var _0x59d8ba={'url':_0x5e4f91+_0x4d41('0x34')+_0x5ba3ed['username']+_0x4d41('0x35')+_0x5ba3ed[_0x4d41('0x31')],'method':_0x4d41('0x36')};rp(_0x59d8ba)['then'](function(_0x2c191b){var _0x21fe9a=_0x2c191b[_0x4d41('0x37')](';');var _0x26b822={'user_key':_0x21fe9a[0x0],'session_key':_0x21fe9a[0x1]};_0x59d8ba={'url':_0x5e4f91+_0x4d41('0x38'),'method':_0x4d41('0x39'),'headers':{'user_key':_0x26b822[_0x4d41('0x3a')],'Session_key':_0x26b822[_0x4d41('0x3b')]},'json':!![],'body':_0x11cac6};return rp(_0x59d8ba);})[_0x4d41('0x1b')](function(_0x883e65){if(_0x883e65[_0x4d41('0x3c')]>=0x1){var _0x5ef664={'messageId':_0x883e65[_0x4d41('0x3d')]};if(_0x5ba3ed[_0x4d41('0x32')]!=='GP'||!_0x5ba3ed[_0x4d41('0x3e')]){_0x5ef664['read']=!![];}return _0x1c5e8f[_0x4d41('0x1c')](_0x5ef664);}else{return logger[_0x4d41('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x4d41('0x2e'),util[_0x4d41('0x3f')](_0x883e65,{'showHidden':![],'depth':null}));}})[_0x4d41('0x29')](function(_0x4bf120){return logger['error'](_0x4d41('0x2a'),_0x4d41('0x2b'),'skebby',util[_0x4d41('0x3f')](_0x4bf120,{'showHidden':![],'depth':null}));});}else{logger[_0x4d41('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4d41('0x2b'),_0x4d41('0x2e'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x4d41('0x40'):if(_0x5ba3ed[_0x4d41('0x22')]){var _0x4f3e31={'recipient':_0x1078bf[_0x4d41('0x23')],'message':_0x1078bf[_0x4d41('0xe')],'sender':_0x5ba3ed[_0x4d41('0x41')]||_0x5ba3ed[_0x4d41('0x23')],'authorization':_0x5ba3ed['authToken']};var _0x41eaea={'method':_0x4d41('0x39'),'uri':_0x4d41('0x42'),'body':_0x4f3e31,'json':!![]};rp(_0x41eaea)[_0x4d41('0x1b')](function(_0x289ff8){var _0x224bbc={'messageId':_0x289ff8[_0x4d41('0x43')]};if(!_0x5ba3ed[_0x4d41('0x3e')]){_0x224bbc['read']=!![];}return _0x1c5e8f[_0x4d41('0x1c')](_0x224bbc);})[_0x4d41('0x29')](function(_0x16be61){logger['error'](_0x4d41('0x2a'),_0x4d41('0x2b'),'connectel',util[_0x4d41('0x3f')](_0x16be61,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x4d41('0x2a'),_0x4d41('0x2b'),_0x4d41('0x40'),'Missing\x20parameters:\x20authToken');}break;case _0x4d41('0x44'):if(_0x5ba3ed[_0x4d41('0x30')]&&_0x5ba3ed[_0x4d41('0x31')]){var _0x4f3e31={'messages':[{'source':_0x4d41('0x45'),'to':_0x1078bf[_0x4d41('0x23')],'body':_0x1078bf[_0x4d41('0xe')],'from':_0x5ba3ed[_0x4d41('0x41')]||_0x5ba3ed[_0x4d41('0x23')]}]};var _0x6816d7=util[_0x4d41('0x46')]('%s:%s',_0x5ba3ed[_0x4d41('0x30')],_0x5ba3ed[_0x4d41('0x31')]);var _0x41eaea={'method':_0x4d41('0x39'),'uri':_0x4d41('0x47'),'body':_0x4f3e31,'headers':{'Authorization':util[_0x4d41('0x46')]('Basic\x20%s',new Buffer(_0x6816d7)[_0x4d41('0x48')](_0x4d41('0x49')))},'json':!![]};rp(_0x41eaea)['then'](function(_0x3367d5){if(_0x3367d5[_0x4d41('0x4a')]>=0xc8&&_0x3367d5[_0x4d41('0x4a')]<=0xce){if(_0x3367d5[_0x4d41('0x4b')]&&_0x3367d5['data'][_0x4d41('0x4c')]>0x0){var _0x123556=_[_0x4d41('0x4d')](_0x3367d5[_0x4d41('0x4b')][_0x4d41('0x24')]);var _0x1c08ab={'messageId':_0x123556['message_id']};if(!_0x5ba3ed[_0x4d41('0x3e')]){_0x1c08ab['read']=!![];}return _0x1c5e8f['update'](_0x1c08ab);}else{logger[_0x4d41('0x1e')](_0x4d41('0x2a'),_0x4d41('0x2b'),_0x4d41('0x4e'),util['inspect'](_0x3367d5,{'showHidden':![],'depth':null}));}}else{logger[_0x4d41('0x1e')](_0x4d41('0x2a'),'afterCreate',_0x4d41('0x4e'),util[_0x4d41('0x3f')](_0x3367d5,{'showHidden':![],'depth':null}));}})[_0x4d41('0x29')](function(_0xdfff3b){logger[_0x4d41('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4d41('0x2b'),_0x4d41('0x4e'),util['inspect'](_0xdfff3b,{'showHidden':![],'depth':null}));});}else{logger[_0x4d41('0x1e')](_0x4d41('0x2a'),_0x4d41('0x2b'),'clickSend','Missing\x20parameters:\x20username,\x20password');}break;case _0x4d41('0x4f'):if(_0x5ba3ed[_0x4d41('0x50')]&&_0x5ba3ed['authToken']){var _0x4f3e31={'dst':_0x1078bf[_0x4d41('0x23')],'text':_0x1078bf[_0x4d41('0xe')],'src':_0x5ba3ed['senderString']||_0x5ba3ed['phone'],'url':_0x5ba3ed[_0x4d41('0x51')]+_0x4d41('0x26')+_0x1078bf['id']+'/status?token='+_0x5ba3ed[_0x4d41('0x28')]};var _0x6816d7=util[_0x4d41('0x46')](_0x4d41('0x52'),_0x5ba3ed[_0x4d41('0x50')],_0x5ba3ed[_0x4d41('0x22')]);var _0x41eaea={'method':_0x4d41('0x39'),'uri':util[_0x4d41('0x46')]('https://api.plivo.com/v1/Account/%s/Message/',_0x5ba3ed['authId']),'body':_0x4f3e31,'headers':{'Authorization':util[_0x4d41('0x46')](_0x4d41('0x53'),new Buffer(_0x6816d7)[_0x4d41('0x48')](_0x4d41('0x49')))},'json':!![]};rp(_0x41eaea)[_0x4d41('0x1b')](function(_0x35b2a8){var _0x399c46={'messageId':_0x35b2a8[_0x4d41('0x54')][0x0]};return _0x1c5e8f[_0x4d41('0x1c')](_0x399c46);})[_0x4d41('0x29')](function(_0x14a665){logger['error'](_0x4d41('0x2a'),_0x4d41('0x2b'),_0x4d41('0x4f'),util[_0x4d41('0x3f')](_0x14a665,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x4d41('0x2a'),_0x4d41('0x2b'),_0x4d41('0x4f'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0x4d41('0x55'):if(_0x5ba3ed[_0x4d41('0x30')]&&_0x5ba3ed[_0x4d41('0x31')]){if(_0x5ba3ed[_0x4d41('0x56')]){var _0x5ca9df={'method':_0x4d41('0x39'),'uri':_0x5ba3ed['baseUrl']+'/auth/1/session','body':{'username':_0x5ba3ed[_0x4d41('0x30')],'password':_0x5ba3ed[_0x4d41('0x31')]},'json':!![]};return rp(_0x5ca9df)[_0x4d41('0x1b')](function(_0x498b67){var _0x31a5c8={'method':_0x4d41('0x39'),'uri':_0x5ba3ed[_0x4d41('0x56')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x5ba3ed[_0x4d41('0x23')],'destinations':[{'to':_0x1078bf[_0x4d41('0x23')]}],'text':_0x1078bf[_0x4d41('0xe')],'notifyUrl':_0x5ba3ed[_0x4d41('0x51')]+'/api/sms/messages/'+_0x1078bf['id']+'/status?token='+_0x5ba3ed['token'],'notifyContentType':_0x4d41('0x57'),'callbackData':_0x5ba3ed[_0x4d41('0x23')]+';'+_0x1078bf[_0x4d41('0xe')]}]},'headers':{'Authorization':_0x4d41('0x58')+_0x498b67[_0x4d41('0x28')]},'json':!![]};return rp(_0x31a5c8)[_0x4d41('0x1b')](function(_0x499393){if(_0x499393[_0x4d41('0x24')]){var _0x47a8b1={'messageId':_0x499393[_0x4d41('0x24')][0x0][_0x4d41('0xc')]};if(!_0x5ba3ed[_0x4d41('0x3e')]){_0x47a8b1['read']=!![];}return _0x1c5e8f['update'](_0x47a8b1);}else{return logger[_0x4d41('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x4d41('0x55'),util[_0x4d41('0x3f')](_0x499393,{'showHidden':![],'depth':null}));}});})[_0x4d41('0x29')](function(_0x1e5ca1){return logger[_0x4d41('0x1e')](_0x4d41('0x2a'),_0x4d41('0x2b'),'infobip',util[_0x4d41('0x3f')](_0x1e5ca1,{'showHidden':![],'depth':null}));});}else{logger[_0x4d41('0x1e')](_0x4d41('0x2a'),'afterCreate',_0x4d41('0x55'),_0x4d41('0x59'));}}else{logger['error'](_0x4d41('0x2a'),_0x4d41('0x2b'),_0x4d41('0x55'),'Missing\x20parameters:\x20username,\x20password');}break;case'csc':var _0x2b5deb=require(_0x4d41('0x5a'));if(_0x5ba3ed[_0x4d41('0x5b')]){var _0x3fcaa4={};_0x3fcaa4[_0x4d41('0x5c')]=_0x5ba3ed[_0x4d41('0x30')];_0x3fcaa4[_0x4d41('0x23')]=_0x1078bf['phone'];_0x3fcaa4[_0x4d41('0x33')]=_0x5ba3ed['phone'];_0x3fcaa4[_0x4d41('0x5d')]=_0x1078bf[_0x4d41('0xe')];_0x3fcaa4['timestamp']=+new Date();var _0xab694f='';var _0x52d1ad='';var _0x53ebae=Object[_0x4d41('0x5e')](_0x3fcaa4);_0x53ebae[_0x4d41('0x5f')]();for(var _0x26608a=0x0;_0x26608a<_0x53ebae[_0x4d41('0x60')];_0x26608a++){if(_0xab694f!=''){_0xab694f+='&';}_0xab694f+=_0x53ebae[_0x26608a]+'='+encodeURIComponent(_0x3fcaa4[_0x53ebae[_0x26608a]]);_0x52d1ad+=_0x3fcaa4[_0x53ebae[_0x26608a]];}_0x52d1ad+=_0x5ba3ed['apiKey'];_0x52d1ad=_0x2b5deb[_0x4d41('0x61')](_0x4d41('0x62'))['update'](_0x52d1ad)[_0x4d41('0x63')]('hex');if(_0xab694f!==''){_0xab694f+='&';}_0xab694f+=_0x4d41('0x64')+_0x52d1ad;var _0x59d8ba={'method':_0x4d41('0x36'),'uri':_0x5ba3ed[_0x4d41('0x56')]+_0x4d41('0x65')+_0xab694f,'json':!![]};return rp(_0x59d8ba)[_0x4d41('0x1b')](function(_0x1d5db8){var _0x43efe6=Object['keys'](_0x1d5db8);if(_0x1d5db8[_0x43efe6[0x0]][_0x4d41('0x1e')]&&parseInt(_0x1d5db8[_0x43efe6[0x0]][_0x4d41('0x1e')])===0x0){var _0x3d54ba={'messageId':_0x1d5db8[_0x43efe6[0x0]]['id_sms']};if(!_0x5ba3ed['deliveryReport']){_0x3d54ba['read']=!![];}return _0x1c5e8f[_0x4d41('0x1c')](_0x3d54ba);}else{return logger[_0x4d41('0x1e')](_0x4d41('0x2a'),'afterCreate',_0x4d41('0x66'),util[_0x4d41('0x3f')](_0x1d5db8[_0x4d41('0x1e')],{'showHidden':![],'depth':null}));}})[_0x4d41('0x29')](function(_0x23cf12){return logger['error'](_0x4d41('0x2a'),_0x4d41('0x2b'),_0x4d41('0x66'),util['inspect'](_0x23cf12,{'showHidden':![],'depth':null}));});}else{logger[_0x4d41('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4d41('0x2b'),_0x4d41('0x66'),'Missing\x20parameters:\x20apiKey');}break;case _0x4d41('0x67'):if(_0x5ba3ed[_0x4d41('0x5b')]){var _0x39582a={'method':_0x4d41('0x39'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x5ba3ed[_0x4d41('0x5b')]},'body':{'content':_0x1078bf[_0x4d41('0xe')],'to':[_0x1078bf[_0x4d41('0x23')]],'from':_0x5ba3ed[_0x4d41('0x23')],'binary':![],'clientMessageId':_0x4d41('0x68'),'charset':_0x4d41('0x69')},'json':!![]};rp(_0x39582a)[_0x4d41('0x1b')](function(_0x40bf3a){if(!_0x40bf3a[_0x4d41('0x1e')]){var _0x384513={'messageId':_0x40bf3a[_0x4d41('0x24')][0x0][_0x4d41('0x6a')]};if(!_0x5ba3ed[_0x4d41('0x3e')]){_0x384513['read']=!![];}return _0x1c5e8f[_0x4d41('0x1c')](_0x384513);}else{return logger[_0x4d41('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4d41('0x2b'),'clickatell',util[_0x4d41('0x3f')](_0x40bf3a[_0x4d41('0x1e')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x14109c){return logger[_0x4d41('0x1e')](_0x4d41('0x2a'),_0x4d41('0x2b'),_0x4d41('0x67'),util[_0x4d41('0x3f')](_0x14109c,{'showHidden':![],'depth':null}));});}else{logger[_0x4d41('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4d41('0x2b'),'clickatell',_0x4d41('0x6b'));}break;case _0x4d41('0x6c'):if(_0x5ba3ed['username']&&_0x5ba3ed[_0x4d41('0x31')]){var _0x6816d7=util['format']('%s:%s',_0x5ba3ed[_0x4d41('0x30')],_0x5ba3ed['password']);var _0x41eaea={'method':'POST','uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x5ba3ed[_0x4d41('0x6d')]+_0x4d41('0x6e'),'body':{'to':[_0x1078bf['phone']],'text':_0x1078bf['body'],'from':_0x5ba3ed[_0x4d41('0x23')],'applicationId':_0x5ba3ed[_0x4d41('0x6f')]},'headers':{'Authorization':util[_0x4d41('0x46')](_0x4d41('0x53'),new Buffer(_0x6816d7)[_0x4d41('0x48')](_0x4d41('0x49')))},'json':!![]};rp(_0x41eaea)[_0x4d41('0x1b')](function(_0x364d99){if(_0x364d99['id']){var _0x3816a1={'messageId':_0x364d99['id']};return _0x1c5e8f[_0x4d41('0x1c')](_0x3816a1);}else{logger['error'](_0x4d41('0x2a'),_0x4d41('0x2b'),_0x4d41('0x6c'),util[_0x4d41('0x3f')](_0x364d99,{'showHidden':![],'depth':null}));}})[_0x4d41('0x29')](function(_0x4d76a8){logger[_0x4d41('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4d41('0x2b'),'bandwidth',util['inspect'](_0x4d76a8,{'showHidden':![],'depth':null}));});}else{logger[_0x4d41('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4d41('0x2b'),_0x4d41('0x6c'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x4d41('0x70'):if(_0x5ba3ed[_0x4d41('0x5b')]){var _0xfc5e06={};var _0x59d8ba={'method':_0x4d41('0x39'),'uri':_0x4d41('0x71'),'headers':{'Authorization':_0x4d41('0x72')+_0x5ba3ed[_0x4d41('0x5b')],'Content-Type':'application/json'},'body':{'from':_0x5ba3ed[_0x4d41('0x23')],'to':_0x1078bf[_0x4d41('0x23')],'text':_0x1078bf[_0x4d41('0xe')]},'json':!![]};return rp(_0x59d8ba)[_0x4d41('0x1b')](function(_0x24246d){if(_0x24246d[_0x4d41('0x73')]==0xca){_0xfc5e06['message']=_0x24246d;var _0x4c69e0={'method':_0x4d41('0x39'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x4d41('0x72')+_0x5ba3ed[_0x4d41('0x5b')],'Content-Type':_0x4d41('0x57')},'body':{'refid':_0xfc5e06[_0x4d41('0x74')][_0x4d41('0x75')]},'json':!![]};return rp(_0x4c69e0)[_0x4d41('0x1b')](function(_0xf33abc){_0xfc5e06[_0x4d41('0x76')]=_0xf33abc;var _0x5bd77b={'messageId':_0xfc5e06[_0x4d41('0x74')][_0x4d41('0x75')],'read':!![]};return _0x1c5e8f[_0x4d41('0x1c')](_0x5bd77b);});}else{return logger['error'](_0x4d41('0x2a'),'afterCreate',_0x4d41('0x70'),util['inspect'](_0x24246d,{'showHidden':![],'depth':null}));}})[_0x4d41('0x29')](function(_0x31aada){return logger[_0x4d41('0x1e')](_0x4d41('0x2a'),'afterCreate',_0x4d41('0x70'),util[_0x4d41('0x3f')](_0x31aada,{'showHidden':![],'depth':null}));});}else{return logger[_0x4d41('0x1e')](_0x4d41('0x2a'),_0x4d41('0x2b'),_0x4d41('0x70'),_0x4d41('0x77'));}break;}}})[_0x4d41('0x78')](function(){_0x212006();});}else{_0x212006();}}},'charset':_0x4d41('0x79'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 78651c8..1bb6c30 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 _0x18b3=['result','catch','CreateSmsMessage','SmsMessage','body','options','raw','then','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./smsMessage.socket','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3df696,_0x56d782){var _0x1e94e2=function(_0x807c7b){while(--_0x807c7b){_0x3df696['push'](_0x3df696['shift']());}};_0x1e94e2(++_0x56d782);}(_0x18b3,0xb2));var _0x318b=function(_0x3477f2,_0x1b6f4b){_0x3477f2=_0x3477f2-0x0;var _0x402165=_0x18b3[_0x3477f2];return _0x402165;};'use strict';var _=require(_0x318b('0x0'));var util=require('util');var moment=require(_0x318b('0x1'));var BPromise=require(_0x318b('0x2'));var rs=require(_0x318b('0x3'));var fs=require('fs');var Redis=require(_0x318b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x318b('0x5'));var logger=require(_0x318b('0x6'))(_0x318b('0x7'));var config=require(_0x318b('0x8'));var jayson=require(_0x318b('0x9'));var client=jayson[_0x318b('0xa')][_0x318b('0xb')]({'port':0x232a});config['redis']=_[_0x318b('0xc')](config[_0x318b('0xd')],{'host':_0x318b('0xe'),'port':0x18eb});var socket=require(_0x318b('0xf'))(new Redis(config[_0x318b('0xd')]));require(_0x318b('0x10'))['register'](socket);function respondWithRpcPromise(_0x27e6dc,_0x4f41d9,_0x22877b){return new BPromise(function(_0x3fc9d0,_0x4634a0){return client['request'](_0x27e6dc,_0x22877b)['then'](function(_0xa81b89){logger[_0x318b('0x11')](_0x318b('0x12'),_0x4f41d9,_0x318b('0x13'));logger[_0x318b('0x14')](_0x318b('0x15'),_0x4f41d9,'request\x20sent',JSON[_0x318b('0x16')](_0xa81b89));if(_0xa81b89[_0x318b('0x17')]){if(_0xa81b89['error'][_0x318b('0x18')]===0x1f4){logger['error'](_0x318b('0x12'),_0x4f41d9,_0xa81b89[_0x318b('0x17')]['message']);return _0x4634a0(_0xa81b89[_0x318b('0x17')][_0x318b('0x19')]);}logger[_0x318b('0x17')]('SmsMessage,\x20%s,\x20%s',_0x4f41d9,_0xa81b89[_0x318b('0x17')]['message']);return _0x3fc9d0(_0xa81b89[_0x318b('0x17')][_0x318b('0x19')]);}else{logger[_0x318b('0x11')](_0x318b('0x12'),_0x4f41d9,_0x318b('0x13'));_0x3fc9d0(_0xa81b89[_0x318b('0x1a')][_0x318b('0x19')]);}})[_0x318b('0x1b')](function(_0x4aa204){logger['error'](_0x318b('0x12'),_0x4f41d9,_0x4aa204);_0x4634a0(_0x4aa204);});});}exports[_0x318b('0x1c')]=function(_0x3ace2c){var _0x552942=this;return new Promise(function(_0x416c5c,_0x1d6b12){return db[_0x318b('0x1d')]['create'](_0x3ace2c[_0x318b('0x1e')],{'raw':_0x3ace2c[_0x318b('0x1f')]?_0x3ace2c[_0x318b('0x1f')][_0x318b('0x20')]===undefined?!![]:![]:!![]})[_0x318b('0x21')](function(_0x31a711){logger[_0x318b('0x11')](_0x318b('0x1c'),_0x3ace2c);logger[_0x318b('0x14')](_0x318b('0x1c'),_0x3ace2c,JSON[_0x318b('0x16')](_0x31a711));_0x416c5c(_0x31a711);})[_0x318b('0x1b')](function(_0x32d8a4){logger[_0x318b('0x17')]('CreateSmsMessage',_0x32d8a4[_0x318b('0x19')],_0x3ace2c);_0x1d6b12(_0x552942[_0x318b('0x17')](0x1f4,_0x32d8a4[_0x318b('0x19')]));});});}; \ No newline at end of file +var _0x1533=['client','redis','defaults','localhost','socket.io-emitter','register','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateSmsMessage','SmsMessage','body','options','then','debug','stringify','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x220243,_0x20c151){var _0x11bb40=function(_0x584ad2){while(--_0x584ad2){_0x220243['push'](_0x220243['shift']());}};_0x11bb40(++_0x20c151);}(_0x1533,0x11b));var _0x3153=function(_0x569560,_0x16b989){_0x569560=_0x569560-0x0;var _0x3c1de0=_0x1533[_0x569560];return _0x3c1de0;};'use strict';var _=require(_0x3153('0x0'));var util=require('util');var moment=require(_0x3153('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3153('0x2'));var db=require(_0x3153('0x3'))['db'];var utils=require(_0x3153('0x4'));var logger=require(_0x3153('0x5'))('rpc');var config=require(_0x3153('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3153('0x7')]['http']({'port':0x232a});config[_0x3153('0x8')]=_[_0x3153('0x9')](config[_0x3153('0x8')],{'host':_0x3153('0xa'),'port':0x18eb});var socket=require(_0x3153('0xb'))(new Redis(config[_0x3153('0x8')]));require('./smsMessage.socket')[_0x3153('0xc')](socket);function respondWithRpcPromise(_0x91e3c9,_0x6733a7,_0x160395){return new BPromise(function(_0x5f2248,_0x2726ad){return client[_0x3153('0xd')](_0x91e3c9,_0x160395)['then'](function(_0x34de0b){logger[_0x3153('0xe')](_0x3153('0xf'),_0x6733a7,_0x3153('0x10'));logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6733a7,_0x3153('0x10'),JSON['stringify'](_0x34de0b));if(_0x34de0b[_0x3153('0x11')]){if(_0x34de0b['error'][_0x3153('0x12')]===0x1f4){logger[_0x3153('0x11')]('SmsMessage,\x20%s,\x20%s',_0x6733a7,_0x34de0b[_0x3153('0x11')][_0x3153('0x13')]);return _0x2726ad(_0x34de0b['error'][_0x3153('0x13')]);}logger['error'](_0x3153('0xf'),_0x6733a7,_0x34de0b[_0x3153('0x11')]['message']);return _0x5f2248(_0x34de0b[_0x3153('0x11')][_0x3153('0x13')]);}else{logger[_0x3153('0xe')]('SmsMessage,\x20%s,\x20%s',_0x6733a7,_0x3153('0x10'));_0x5f2248(_0x34de0b[_0x3153('0x14')][_0x3153('0x13')]);}})[_0x3153('0x15')](function(_0x26bc9c){logger['error']('SmsMessage,\x20%s,\x20%s',_0x6733a7,_0x26bc9c);_0x2726ad(_0x26bc9c);});});}exports[_0x3153('0x16')]=function(_0x104066){var _0x225cc9=this;return new Promise(function(_0x167970,_0x4cf6bc){return db[_0x3153('0x17')]['create'](_0x104066[_0x3153('0x18')],{'raw':_0x104066[_0x3153('0x19')]?_0x104066['options']['raw']===undefined?!![]:![]:!![]})[_0x3153('0x1a')](function(_0x46df42){logger[_0x3153('0xe')](_0x3153('0x16'),_0x104066);logger[_0x3153('0x1b')](_0x3153('0x16'),_0x104066,JSON[_0x3153('0x1c')](_0x46df42));_0x167970(_0x46df42);})[_0x3153('0x15')](function(_0x306270){logger[_0x3153('0x11')](_0x3153('0x16'),_0x306270[_0x3153('0x13')],_0x104066);_0x4cf6bc(_0x225cc9[_0x3153('0x11')](0x1f4,_0x306270[_0x3153('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index c726226..0a79fdf 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 _0x5928=['length','smsMessage:','save','remove','emit','removeListener','register'];(function(_0x272282,_0x2e94a0){var _0xedf511=function(_0x5d1ab6){while(--_0x5d1ab6){_0x272282['push'](_0x272282['shift']());}};_0xedf511(++_0x2e94a0);}(_0x5928,0x128));var _0x8592=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5928[_0x3dd15e];return _0x231fd0;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x8592('0x0'),_0x8592('0x1'),'update'];function createListener(_0x4bd7c2,_0x561d5d){return function(_0x47830e){_0x561d5d[_0x8592('0x2')](_0x4bd7c2,_0x47830e);};}function removeListener(_0x250cab,_0x46718b){return function(){SmsMessageEvents[_0x8592('0x3')](_0x250cab,_0x46718b);};}exports[_0x8592('0x4')]=function(_0x1f62f7){for(var _0x15bf84=0x0,_0x2b456e=events[_0x8592('0x5')];_0x15bf84<_0x2b456e;_0x15bf84++){var _0x4c6591=events[_0x15bf84];var _0x450a13=createListener(_0x8592('0x6')+_0x4c6591,_0x1f62f7);SmsMessageEvents['on'](_0x4c6591,_0x450a13);}}; \ No newline at end of file +var _0x6cb2=['length','smsMessage:','./smsMessage.events','save','remove','removeListener','register'];(function(_0x44742d,_0x1b9785){var _0x383e67=function(_0x20128c){while(--_0x20128c){_0x44742d['push'](_0x44742d['shift']());}};_0x383e67(++_0x1b9785);}(_0x6cb2,0x128));var _0x26cb=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x6cb2[_0x5a776b];return _0xbbef59;};'use strict';var SmsMessageEvents=require(_0x26cb('0x0'));var events=[_0x26cb('0x1'),_0x26cb('0x2'),'update'];function createListener(_0x3f585e,_0x946226){return function(_0x515782){_0x946226['emit'](_0x3f585e,_0x515782);};}function removeListener(_0xee03ca,_0x2cbca8){return function(){SmsMessageEvents[_0x26cb('0x3')](_0xee03ca,_0x2cbca8);};}exports[_0x26cb('0x4')]=function(_0x4dbf70){for(var _0x14b61d=0x0,_0x13a381=events[_0x26cb('0x5')];_0x14b61d<_0x13a381;_0x14b61d++){var _0x386071=events[_0x14b61d];var _0x200b03=createListener(_0x26cb('0x6')+_0x386071,_0x4dbf70);SmsMessageEvents['on'](_0x386071,_0x200b03);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 01c605e..ff9e36f 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 _0x9d2c=['connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','index','isAuthenticated','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','delete','removeAgents','exports','multer','util'];(function(_0x1dab5f,_0x10cd21){var _0x40c2f3=function(_0x325a0d){while(--_0x325a0d){_0x1dab5f['push'](_0x1dab5f['shift']());}};_0x40c2f3(++_0x10cd21);}(_0x9d2c,0x102));var _0xc9d2=function(_0x329b0e,_0xf757f2){_0x329b0e=_0x329b0e-0x0;var _0x15373c=_0x9d2c[_0x329b0e];return _0x15373c;};'use strict';var multer=require(_0xc9d2('0x0'));var util=require(_0xc9d2('0x1'));var path=require('path');var timeout=require(_0xc9d2('0x2'));var express=require(_0xc9d2('0x3'));var router=express['Router']();var fs_extra=require(_0xc9d2('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc9d2('0x5'));var config=require(_0xc9d2('0x6'));var controller=require(_0xc9d2('0x7'));router[_0xc9d2('0x8')]('/',auth['isAuthenticated'](),controller[_0xc9d2('0x9')]);router[_0xc9d2('0x8')]('/describe',auth[_0xc9d2('0xa')](),controller[_0xc9d2('0xb')]);router['get'](_0xc9d2('0xc'),auth[_0xc9d2('0xa')](),controller['show']);router[_0xc9d2('0x8')](_0xc9d2('0xd'),auth[_0xc9d2('0xa')](),controller[_0xc9d2('0xe')]);router[_0xc9d2('0x8')](_0xc9d2('0xf'),auth[_0xc9d2('0xa')](),controller[_0xc9d2('0x10')]);router[_0xc9d2('0x8')](_0xc9d2('0x11'),auth[_0xc9d2('0xa')](),controller[_0xc9d2('0x12')]);router[_0xc9d2('0x13')]('/',auth[_0xc9d2('0xa')](),controller[_0xc9d2('0x14')]);router[_0xc9d2('0x13')](_0xc9d2('0xf'),auth[_0xc9d2('0xa')](),controller['addTeams']);router[_0xc9d2('0x13')]('/:id/users',auth['isAuthenticated'](),controller[_0xc9d2('0x15')]);router[_0xc9d2('0x16')](_0xc9d2('0xc'),auth[_0xc9d2('0xa')](),controller['update']);router[_0xc9d2('0x17')](_0xc9d2('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0xc9d2('0x17')](_0xc9d2('0xf'),auth['isAuthenticated'](),controller['removeTeams']);router['delete']('/:id/users',auth[_0xc9d2('0xa')](),controller[_0xc9d2('0x18')]);module[_0xc9d2('0x19')]=router; \ No newline at end of file +var _0x4356=['Router','fs-extra','../../components/auth/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','getTeams','/:id/users','post','/:id/teams','addTeams','put','update','delete','removeTeams','removeAgents','multer','path','express'];(function(_0x17cd08,_0x21e4bf){var _0x4b5d31=function(_0x2463e1){while(--_0x2463e1){_0x17cd08['push'](_0x17cd08['shift']());}};_0x4b5d31(++_0x21e4bf);}(_0x4356,0xbd));var _0x6435=function(_0x48b2af,_0x47dcf2){_0x48b2af=_0x48b2af-0x0;var _0x4e964a=_0x4356[_0x48b2af];return _0x4e964a;};'use strict';var multer=require(_0x6435('0x0'));var util=require('util');var path=require(_0x6435('0x1'));var timeout=require('connect-timeout');var express=require(_0x6435('0x2'));var router=express[_0x6435('0x3')]();var fs_extra=require(_0x6435('0x4'));var auth=require(_0x6435('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6435('0x6'));var controller=require(_0x6435('0x7'));router[_0x6435('0x8')]('/',auth[_0x6435('0x9')](),controller[_0x6435('0xa')]);router[_0x6435('0x8')](_0x6435('0xb'),auth['isAuthenticated'](),controller[_0x6435('0xc')]);router['get'](_0x6435('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x6435('0x8')]('/:id/members',auth[_0x6435('0x9')](),controller['getMembers']);router['get']('/:id/teams',auth[_0x6435('0x9')](),controller[_0x6435('0xe')]);router[_0x6435('0x8')](_0x6435('0xf'),auth[_0x6435('0x9')](),controller['getAgents']);router[_0x6435('0x10')]('/',auth[_0x6435('0x9')](),controller['create']);router[_0x6435('0x10')](_0x6435('0x11'),auth[_0x6435('0x9')](),controller[_0x6435('0x12')]);router[_0x6435('0x10')](_0x6435('0xf'),auth[_0x6435('0x9')](),controller['addAgents']);router[_0x6435('0x13')](_0x6435('0xd'),auth[_0x6435('0x9')](),controller[_0x6435('0x14')]);router[_0x6435('0x15')](_0x6435('0xd'),auth[_0x6435('0x9')](),controller['destroy']);router[_0x6435('0x15')](_0x6435('0x11'),auth['isAuthenticated'](),controller[_0x6435('0x16')]);router[_0x6435('0x15')](_0x6435('0xf'),auth['isAuthenticated'](),controller[_0x6435('0x17')]);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 8b3cd61..ee4a124 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 _0x00bc=['rrmemory','roundrobin','sequelize','exports','STRING','name','ENUM'];(function(_0x3938bd,_0x248cc2){var _0x4a7fba=function(_0x283e10){while(--_0x283e10){_0x3938bd['push'](_0x3938bd['shift']());}};_0x4a7fba(++_0x248cc2);}(_0x00bc,0x160));var _0xc00b=function(_0x37746a,_0xccf345){_0x37746a=_0x37746a-0x0;var _0x4c2adf=_0x00bc[_0x37746a];return _0x4c2adf;};'use strict';var Sequelize=require(_0xc00b('0x0'));module[_0xc00b('0x1')]={'name':{'type':Sequelize[_0xc00b('0x2')],'unique':_0xc00b('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc00b('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc00b('0x4')](_0xc00b('0x5'),'beepall',_0xc00b('0x6'))}}; \ No newline at end of file +var _0x10d8=['sequelize','STRING','INTEGER','ENUM','rrmemory','roundrobin'];(function(_0x577ce9,_0x482e24){var _0xb70b35=function(_0x4c4849){while(--_0x4c4849){_0x577ce9['push'](_0x577ce9['shift']());}};_0xb70b35(++_0x482e24);}(_0x10d8,0x90));var _0x810d=function(_0x290d07,_0x16327d){_0x290d07=_0x290d07-0x0;var _0x256489=_0x10d8[_0x290d07];return _0x256489;};'use strict';var Sequelize=require(_0x810d('0x0'));module['exports']={'name':{'type':Sequelize[_0x810d('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x810d('0x1')]},'timeout':{'type':Sequelize[_0x810d('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x810d('0x3')](_0x810d('0x4'),'beepall',_0x810d('0x5'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 243f253..3d8966b 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 _0x7a12=['attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','SmsQueue','findAll','rows','catch','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','update','body','describe','findOne','UserSmsQueue','nolimit','SmsQueueId','options','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','getTeams','rawAttributes','addTeams','Team','online','voicePause','interface','flatMap','Agents','transaction','each','findOrCreate','forEach','userSmsQueue:save','removeTeams','ids','tq.TeamId','from','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','clone','push','sequelize','toString','SELECT','every','TeamId','includes','all','union','isEmpty','removeAgents','emit','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','then','destroy','get','SmsQueues','UserProfileResource','error','stack','name','index','map','key','model','query','keys','filters'];(function(_0x52f166,_0x45d4e8){var _0x2c9523=function(_0x5d8aea){while(--_0x5d8aea){_0x52f166['push'](_0x52f166['shift']());}};_0x2c9523(++_0x45d4e8);}(_0x7a12,0xe8));var _0x27a1=function(_0x3dc6d4,_0x580a5f){_0x3dc6d4=_0x3dc6d4-0x0;var _0x11893a=_0x7a12[_0x3dc6d4];return _0x11893a;};'use strict';var emlformat=require(_0x27a1('0x0'));var rimraf=require(_0x27a1('0x1'));var zipdir=require(_0x27a1('0x2'));var jsonpatch=require(_0x27a1('0x3'));var rp=require(_0x27a1('0x4'));var moment=require(_0x27a1('0x5'));var BPromise=require(_0x27a1('0x6'));var Mustache=require(_0x27a1('0x7'));var util=require('util');var path=require(_0x27a1('0x8'));var sox=require(_0x27a1('0x9'));var csv=require(_0x27a1('0xa'));var ejs=require(_0x27a1('0xb'));var fs=require('fs');var fs_extra=require(_0x27a1('0xc'));var _=require(_0x27a1('0xd'));var squel=require('squel');var crypto=require(_0x27a1('0xe'));var jsforce=require(_0x27a1('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x27a1('0xa'));var querystring=require(_0x27a1('0x10'));var Papa=require('papaparse');var Redis=require(_0x27a1('0x11'));var authService=require(_0x27a1('0x12'));var qs=require(_0x27a1('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x27a1('0x14'));var logger=require(_0x27a1('0x15'))(_0x27a1('0x16'));var utils=require(_0x27a1('0x17'));var config=require(_0x27a1('0x18'));var licenseUtil=require(_0x27a1('0x19'));var db=require(_0x27a1('0x1a'))['db'];config['redis']=_[_0x27a1('0x1b')](config[_0x27a1('0x1c')],{'host':_0x27a1('0x1d'),'port':0x18eb});var socket=require(_0x27a1('0x1e'))(new Redis(config['redis']));require(_0x27a1('0x1f'))[_0x27a1('0x20')](socket);function respondWithStatusCode(_0x4e5cdd,_0x5c70f9){_0x5c70f9=_0x5c70f9||0xcc;return function(_0x11125a){if(_0x11125a){return _0x4e5cdd[_0x27a1('0x21')](_0x5c70f9);}return _0x4e5cdd['status'](_0x5c70f9)[_0x27a1('0x22')]();};}function respondWithResult(_0x17ebb1,_0x5d5b4a){_0x5d5b4a=_0x5d5b4a||0xc8;return function(_0xe3f54){if(_0xe3f54){return _0x17ebb1[_0x27a1('0x23')](_0x5d5b4a)[_0x27a1('0x24')](_0xe3f54);}};}function respondWithFilteredResult(_0xbd87d1,_0x5e8095){return function(_0x18512a){if(_0x18512a){var _0x5800cc=typeof _0x5e8095[_0x27a1('0x25')]===_0x27a1('0x26')&&typeof _0x5e8095['limit']===_0x27a1('0x26');var _0x28a621=_0x18512a[_0x27a1('0x27')];var _0x336d83=_0x5800cc?0x0:_0x5e8095['offset'];var _0x1759d7=_0x5800cc?_0x18512a[_0x27a1('0x27')]:_0x5e8095[_0x27a1('0x25')]+_0x5e8095[_0x27a1('0x28')];var _0x1b6531;if(_0x1759d7>=_0x28a621){_0x1759d7=_0x28a621;_0x1b6531=0xc8;}else{_0x1b6531=0xce;}_0xbd87d1['status'](_0x1b6531);return _0xbd87d1[_0x27a1('0x29')](_0x27a1('0x2a'),_0x336d83+'-'+_0x1759d7+'/'+_0x28a621)['json'](_0x18512a);}return null;};}function patchUpdates(_0x4c02f8){return function(_0x2df393){try{jsonpatch['apply'](_0x2df393,_0x4c02f8,!![]);}catch(_0x17e881){return BPromise[_0x27a1('0x2b')](_0x17e881);}return _0x2df393[_0x27a1('0x2c')]();};}function saveUpdates(_0x2a1f12,_0x165597){return function(_0x32310c){if(_0x32310c){return _0x32310c['update'](_0x2a1f12)[_0x27a1('0x2d')](function(_0x25307a){return _0x25307a;});}return null;};}function removeEntity(_0x5b58a2,_0x348605){return function(_0x530e54){if(_0x530e54){return _0x530e54[_0x27a1('0x2e')]()['then'](function(){var _0x19d9b5=_0x530e54[_0x27a1('0x2f')]({'plain':!![]});var _0x4f71f1=_0x27a1('0x30');return db[_0x27a1('0x31')][_0x27a1('0x2e')]({'where':{'type':_0x4f71f1,'resourceId':_0x19d9b5['id']}})[_0x27a1('0x2d')](function(){return _0x530e54;});})['then'](function(){_0x5b58a2[_0x27a1('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2089aa,_0x23e8b2){return function(_0x3f0194){if(!_0x3f0194){_0x2089aa[_0x27a1('0x21')](0x194);}return _0x3f0194;};}function handleError(_0x5bc26e,_0x3547c4){_0x3547c4=_0x3547c4||0x1f4;return function(_0xaeed0c){logger[_0x27a1('0x32')](_0xaeed0c[_0x27a1('0x33')]);if(_0xaeed0c[_0x27a1('0x34')]){delete _0xaeed0c['name'];}_0x5bc26e[_0x27a1('0x23')](_0x3547c4)['send'](_0xaeed0c);};}exports[_0x27a1('0x35')]=function(_0x43e34e,_0x4ff34b){var _0x17c6f5={},_0x4c8ffb={},_0x13dc2a={'count':0x0,'rows':[]};var _0x256dc2=_[_0x27a1('0x36')](db['SmsQueue']['rawAttributes'],function(_0x213eae){return{'name':_0x213eae['fieldName'],'type':_0x213eae['type'][_0x27a1('0x37')]};});_0x4c8ffb[_0x27a1('0x38')]=_[_0x27a1('0x36')](_0x256dc2,_0x27a1('0x34'));_0x4c8ffb[_0x27a1('0x39')]=_[_0x27a1('0x3a')](_0x43e34e[_0x27a1('0x39')]);_0x4c8ffb[_0x27a1('0x3b')]=_['intersection'](_0x4c8ffb['model'],_0x4c8ffb['query']);_0x17c6f5[_0x27a1('0x3c')]=_[_0x27a1('0x3d')](_0x4c8ffb[_0x27a1('0x38')],qs[_0x27a1('0x3e')](_0x43e34e['query']['fields']));_0x17c6f5[_0x27a1('0x3c')]=_0x17c6f5[_0x27a1('0x3c')][_0x27a1('0x3f')]?_0x17c6f5[_0x27a1('0x3c')]:_0x4c8ffb[_0x27a1('0x38')];if(!_0x43e34e[_0x27a1('0x39')][_0x27a1('0x40')]('nolimit')){_0x17c6f5['limit']=qs[_0x27a1('0x28')](_0x43e34e[_0x27a1('0x39')][_0x27a1('0x28')]);_0x17c6f5['offset']=qs[_0x27a1('0x25')](_0x43e34e[_0x27a1('0x39')][_0x27a1('0x25')]);}_0x17c6f5[_0x27a1('0x41')]=qs['sort'](_0x43e34e[_0x27a1('0x39')][_0x27a1('0x42')]);_0x17c6f5[_0x27a1('0x43')]=qs[_0x27a1('0x3b')](_[_0x27a1('0x44')](_0x43e34e[_0x27a1('0x39')],_0x4c8ffb[_0x27a1('0x3b')]),_0x256dc2);if(_0x43e34e[_0x27a1('0x39')][_0x27a1('0x45')]){_0x17c6f5[_0x27a1('0x43')]=_[_0x27a1('0x46')](_0x17c6f5[_0x27a1('0x43')],{'$or':_['map'](_0x256dc2,function(_0x1494b){if(_0x1494b[_0x27a1('0x47')]!==_0x27a1('0x48')){var _0x589258={};_0x589258[_0x1494b[_0x27a1('0x34')]]={'$like':'%'+_0x43e34e['query'][_0x27a1('0x45')]+'%'};return _0x589258;}})});}_0x17c6f5=_[_0x27a1('0x46')]({},_0x17c6f5,_0x43e34e['options']);var _0x1d8bb4={'where':_0x17c6f5[_0x27a1('0x43')]};return db['SmsQueue']['count'](_0x1d8bb4)[_0x27a1('0x2d')](function(_0x56553b){_0x13dc2a['count']=_0x56553b;if(_0x43e34e[_0x27a1('0x39')][_0x27a1('0x49')]){_0x17c6f5[_0x27a1('0x4a')]=[{'all':!![]}];}return db[_0x27a1('0x4b')][_0x27a1('0x4c')](_0x17c6f5);})['then'](function(_0x5ccd6b){_0x13dc2a[_0x27a1('0x4d')]=_0x5ccd6b;return _0x13dc2a;})[_0x27a1('0x2d')](respondWithFilteredResult(_0x4ff34b,_0x17c6f5))[_0x27a1('0x4e')](handleError(_0x4ff34b,null));};exports[_0x27a1('0x4f')]=function(_0x4493f6,_0x334fbe){var _0x1f60b4={'raw':!![],'where':{'id':_0x4493f6[_0x27a1('0x50')]['id']}},_0x122106={};_0x122106[_0x27a1('0x38')]=_[_0x27a1('0x3a')](db[_0x27a1('0x4b')]['rawAttributes']);_0x122106['query']=_[_0x27a1('0x3a')](_0x4493f6[_0x27a1('0x39')]);_0x122106['filters']=_[_0x27a1('0x3d')](_0x122106[_0x27a1('0x38')],_0x122106['query']);_0x1f60b4[_0x27a1('0x3c')]=_[_0x27a1('0x3d')](_0x122106[_0x27a1('0x38')],qs['fields'](_0x4493f6[_0x27a1('0x39')][_0x27a1('0x3e')]));_0x1f60b4[_0x27a1('0x3c')]=_0x1f60b4[_0x27a1('0x3c')][_0x27a1('0x3f')]?_0x1f60b4['attributes']:_0x122106[_0x27a1('0x38')];if(_0x4493f6[_0x27a1('0x39')]['includeAll']){_0x1f60b4[_0x27a1('0x4a')]=[{'all':!![]}];}_0x1f60b4=_[_0x27a1('0x46')]({},_0x1f60b4,_0x4493f6['options']);return db[_0x27a1('0x4b')][_0x27a1('0x51')](_0x1f60b4)[_0x27a1('0x2d')](handleEntityNotFound(_0x334fbe,null))[_0x27a1('0x2d')](respondWithResult(_0x334fbe,null))[_0x27a1('0x4e')](handleError(_0x334fbe,null));};exports['create']=function(_0x3d3bf7,_0x49fe49){return db[_0x27a1('0x4b')][_0x27a1('0x52')](_0x3d3bf7['body'],{})[_0x27a1('0x2d')](function(_0x288bd0){var _0x27a491=_0x3d3bf7['user'][_0x27a1('0x2f')]({'plain':!![]});if(!_0x27a491)throw new Error(_0x27a1('0x53'));if(_0x27a491[_0x27a1('0x54')]===_0x27a1('0x55')){var _0x126c81=_0x288bd0[_0x27a1('0x2f')]({'plain':!![]});var _0x5a832a=_0x27a1('0x30');return db[_0x27a1('0x56')]['find']({'where':{'name':_0x5a832a,'userProfileId':_0x27a491[_0x27a1('0x57')]},'raw':!![]})[_0x27a1('0x2d')](function(_0x48bf85){if(_0x48bf85&&_0x48bf85[_0x27a1('0x58')]===0x0){return db[_0x27a1('0x31')][_0x27a1('0x52')]({'name':_0x126c81[_0x27a1('0x34')],'resourceId':_0x126c81['id'],'type':_0x48bf85[_0x27a1('0x34')],'sectionId':_0x48bf85['id']},{})[_0x27a1('0x2d')](function(){return _0x288bd0;});}else{return _0x288bd0;}})[_0x27a1('0x4e')](function(_0x234621){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x234621);throw _0x234621;});}return _0x288bd0;})[_0x27a1('0x2d')](respondWithResult(_0x49fe49,0xc9))['catch'](handleError(_0x49fe49,null));};exports[_0x27a1('0x59')]=function(_0xeac52e,_0x1b37d0){if(_0xeac52e['body']['id']){delete _0xeac52e[_0x27a1('0x5a')]['id'];}return db['SmsQueue'][_0x27a1('0x51')]({'where':{'id':_0xeac52e[_0x27a1('0x50')]['id']}})['then'](handleEntityNotFound(_0x1b37d0,null))[_0x27a1('0x2d')](saveUpdates(_0xeac52e['body'],null))[_0x27a1('0x2d')](respondWithResult(_0x1b37d0,null))[_0x27a1('0x4e')](handleError(_0x1b37d0,null));};exports[_0x27a1('0x2e')]=function(_0x4677bc,_0x37cf9f){return db['SmsQueue'][_0x27a1('0x51')]({'where':{'id':_0x4677bc[_0x27a1('0x50')]['id']}})[_0x27a1('0x2d')](handleEntityNotFound(_0x37cf9f,null))[_0x27a1('0x2d')](removeEntity(_0x37cf9f,null))[_0x27a1('0x4e')](handleError(_0x37cf9f,null));};exports[_0x27a1('0x5b')]=function(_0x27f5ef,_0x22e8ea){return db[_0x27a1('0x4b')][_0x27a1('0x5b')]()[_0x27a1('0x2d')](respondWithResult(_0x22e8ea,null))[_0x27a1('0x4e')](handleError(_0x22e8ea,null));};exports['getMembers']=function(_0x24273e,_0x7feff6,_0x1e30e8){var _0x1766ef={'raw':!![],'where':{}},_0x54b64c={},_0x46825c;return db[_0x27a1('0x4b')][_0x27a1('0x5c')]({'where':{'id':_0x24273e[_0x27a1('0x50')]['id']}})[_0x27a1('0x2d')](handleEntityNotFound(_0x7feff6,null))[_0x27a1('0x2d')](function(_0x41acb6){if(_0x41acb6){_0x46825c=_0x41acb6[_0x27a1('0x2f')]({'plain':!![]});_0x54b64c[_0x27a1('0x38')]=_[_0x27a1('0x3a')](db[_0x27a1('0x5d')]['rawAttributes']);_0x54b64c[_0x27a1('0x39')]=_['keys'](_0x24273e[_0x27a1('0x39')]);_0x54b64c[_0x27a1('0x3b')]=_['intersection'](_0x54b64c[_0x27a1('0x38')],_0x54b64c[_0x27a1('0x39')]);_0x1766ef[_0x27a1('0x3c')]=_['intersection'](_0x54b64c[_0x27a1('0x38')],qs[_0x27a1('0x3e')](_0x24273e['query'][_0x27a1('0x3e')]));_0x1766ef[_0x27a1('0x3c')]=_0x1766ef[_0x27a1('0x3c')][_0x27a1('0x3f')]?_0x1766ef['attributes']:_0x54b64c[_0x27a1('0x38')];if(!_0x24273e['query'][_0x27a1('0x40')](_0x27a1('0x5e'))){_0x1766ef[_0x27a1('0x28')]=qs[_0x27a1('0x28')](_0x24273e[_0x27a1('0x39')][_0x27a1('0x28')]);_0x1766ef[_0x27a1('0x25')]=qs[_0x27a1('0x25')](_0x24273e[_0x27a1('0x39')][_0x27a1('0x25')]);}_0x1766ef['order']=qs[_0x27a1('0x42')](_0x24273e[_0x27a1('0x39')]['sort']);_0x1766ef['where']=qs['filters'](_[_0x27a1('0x44')](_0x24273e[_0x27a1('0x39')],_0x54b64c[_0x27a1('0x3b')]));_0x1766ef[_0x27a1('0x43')][_0x27a1('0x5f')]=_0x41acb6['id'];if(_0x24273e['query'][_0x27a1('0x45')]){_0x1766ef[_0x27a1('0x43')]=_[_0x27a1('0x46')](_0x1766ef[_0x27a1('0x43')],{'$or':_[_0x27a1('0x36')](_0x1766ef[_0x27a1('0x3c')],function(_0x523c8b){var _0x5880d6={};_0x5880d6[_0x523c8b]={'$like':'%'+_0x24273e[_0x27a1('0x39')][_0x27a1('0x45')]+'%'};return _0x5880d6;})});}_0x1766ef=_[_0x27a1('0x46')]({},_0x1766ef,_0x24273e[_0x27a1('0x60')]);return db[_0x27a1('0x5d')][_0x27a1('0x4c')](_0x1766ef);}})[_0x27a1('0x2d')](function(_0x58f87c){if(_0x58f87c){return db[_0x27a1('0x61')][_0x27a1('0x62')]({'where':{'id':_[_0x27a1('0x36')](_0x58f87c,_0x27a1('0x63')),'role':_0x27a1('0x64')},'attributes':['id',_0x27a1('0x34'),_0x27a1('0x65'),_0x27a1('0x66'),_0x27a1('0x67')]});}})[_0x27a1('0x2d')](function(_0x31e422){if(_0x31e422){return{'count':_0x31e422['count'],'rows':_['map'](_0x31e422[_0x27a1('0x4d')],function(_0x3f88ea){return{'membername':_0x3f88ea[_0x27a1('0x34')],'UserId':_0x3f88ea['id'],'queue_name':_0x46825c['name'],'SmsQueueId':_0x46825c['id'],'interface':util[_0x27a1('0x68')](_0x27a1('0x69'),'SIP',_0x3f88ea[_0x27a1('0x34')]),'penalty':0x0,'paused':_0x3f88ea['smsPause'],'createdAt':_0x3f88ea[_0x27a1('0x67')],'updatedAt':_0x3f88ea[_0x27a1('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x27a1('0x2d')](respondWithFilteredResult(_0x7feff6,_0x1766ef))['catch'](handleError(_0x7feff6,null));};exports[_0x27a1('0x6a')]=function(_0x166f0e,_0x6e2184,_0x190b7c){var _0x4bc659={};var _0x4931b7={};var _0xdd4bf9;var _0x12113d;return db['SmsQueue']['findOne']({'where':{'id':_0x166f0e[_0x27a1('0x50')]['id']}})['then'](handleEntityNotFound(_0x6e2184,null))[_0x27a1('0x2d')](function(_0x2b045b){if(_0x2b045b){_0xdd4bf9=_0x2b045b;_0x4931b7['model']=_[_0x27a1('0x3a')](db['Team'][_0x27a1('0x6b')]);_0x4931b7[_0x27a1('0x39')]=_[_0x27a1('0x3a')](_0x166f0e[_0x27a1('0x39')]);_0x4931b7['filters']=_['intersection'](_0x4931b7[_0x27a1('0x38')],_0x4931b7[_0x27a1('0x39')]);_0x4bc659[_0x27a1('0x3c')]=_[_0x27a1('0x3d')](_0x4931b7[_0x27a1('0x38')],qs[_0x27a1('0x3e')](_0x166f0e[_0x27a1('0x39')][_0x27a1('0x3e')]));_0x4bc659['attributes']=_0x4bc659[_0x27a1('0x3c')][_0x27a1('0x3f')]?_0x4bc659[_0x27a1('0x3c')]:_0x4931b7[_0x27a1('0x38')];_0x4bc659[_0x27a1('0x41')]=qs[_0x27a1('0x42')](_0x166f0e['query']['sort']);_0x4bc659[_0x27a1('0x43')]=qs[_0x27a1('0x3b')](_[_0x27a1('0x44')](_0x166f0e[_0x27a1('0x39')],_0x4931b7[_0x27a1('0x3b')]));if(_0x166f0e[_0x27a1('0x39')][_0x27a1('0x45')]){_0x4bc659[_0x27a1('0x43')]=_[_0x27a1('0x46')](_0x4bc659[_0x27a1('0x43')],{'$or':_[_0x27a1('0x36')](_0x4bc659[_0x27a1('0x3c')],function(_0x405b20){var _0x5d63bb={};_0x5d63bb[_0x405b20]={'$like':'%'+_0x166f0e[_0x27a1('0x39')][_0x27a1('0x45')]+'%'};return _0x5d63bb;})});}_0x4bc659=_[_0x27a1('0x46')]({},_0x4bc659,_0x166f0e[_0x27a1('0x60')]);return _0xdd4bf9[_0x27a1('0x6a')](_0x4bc659);}})[_0x27a1('0x2d')](function(_0x1fed74){if(_0x1fed74){_0x12113d=_0x1fed74[_0x27a1('0x3f')];if(!_0x166f0e['query'][_0x27a1('0x40')](_0x27a1('0x5e'))){_0x4bc659['limit']=qs['limit'](_0x166f0e[_0x27a1('0x39')][_0x27a1('0x28')]);_0x4bc659['offset']=qs[_0x27a1('0x25')](_0x166f0e[_0x27a1('0x39')][_0x27a1('0x25')]);}return _0xdd4bf9[_0x27a1('0x6a')](_0x4bc659);}})[_0x27a1('0x2d')](function(_0x26e8e1){if(_0x26e8e1){return _0x26e8e1?{'count':_0x12113d,'rows':_0x26e8e1}:null;}})['then'](respondWithResult(_0x6e2184,null))[_0x27a1('0x4e')](handleError(_0x6e2184,null));};exports[_0x27a1('0x6c')]=function(_0x54b9ee,_0x31e08b,_0x215a99){var _0x5bbf69=_0x54b9ee['body']['ids'];return db[_0x27a1('0x6d')][_0x27a1('0x4c')]({'where':{'id':_0x5bbf69},'attributes':['id'],'include':[{'model':db[_0x27a1('0x61')],'as':'Agents','attributes':['id',_0x27a1('0x34'),_0x27a1('0x6e'),_0x27a1('0x6f'),_0x27a1('0x70')],'raw':!![]}]})[_0x27a1('0x2d')](function(_0x4360ed){if(_0x4360ed){var _0x2b0cb5=_[_0x27a1('0x71')](_0x4360ed,function(_0x4c6701){var _0x44e1ba=_0x4c6701['get']({'plain':!![]});return _0x44e1ba[_0x27a1('0x72')];});return db[_0x27a1('0x4b')][_0x27a1('0x51')]({'where':{'id':_0x54b9ee[_0x27a1('0x50')]['id']}})[_0x27a1('0x2d')](function(_0x376e10){return db['sequelize'][_0x27a1('0x73')](function(_0x57bd6d){return _0x376e10[_0x27a1('0x6c')](_0x5bbf69,{'transaction':_0x57bd6d})['then'](function(){return BPromise[_0x27a1('0x74')](_0x2b0cb5,function(_0x163f2d){return db[_0x27a1('0x5d')][_0x27a1('0x75')]({'where':{'UserId':_0x163f2d['id'],'SmsQueueId':_0x54b9ee[_0x27a1('0x50')]['id']},'transaction':_0x57bd6d});});})[_0x27a1('0x2d')](function(){_0x2b0cb5[_0x27a1('0x76')](function(_0x5b0f0c){socket['emit'](_0x27a1('0x77'),{'UserId':_0x5b0f0c['id'],'SmsQueueId':_0x376e10['id']});});});});});}})[_0x27a1('0x2d')](respondWithStatusCode(_0x31e08b,null))[_0x27a1('0x4e')](handleError(_0x31e08b,null));};exports[_0x27a1('0x78')]=function(_0x40baf7,_0x5e314c,_0x5c228a){return db[_0x27a1('0x6d')][_0x27a1('0x4c')]({'where':{'id':_0x40baf7[_0x27a1('0x39')][_0x27a1('0x79')]},'attributes':['id'],'include':[{'model':db[_0x27a1('0x61')],'as':_0x27a1('0x72'),'attributes':['id'],'raw':!![]}]})[_0x27a1('0x2d')](handleEntityNotFound(_0x5e314c,null))[_0x27a1('0x2d')](function(_0x374329){var _0x57ba75=_[_0x27a1('0x36')](_0x374329,'id');var _0x196da5=[];var _0x5acd93=[];var _0x88a44=squel['select']();_0x88a44['field'](_0x27a1('0x7a'))[_0x27a1('0x7b')](_0x27a1('0x7c'),'tq')[_0x27a1('0x7d')]('user_has_teams','ut',_0x27a1('0x7e'))[_0x27a1('0x43')]('SmsQueueId\x20=\x20?',_0x40baf7['params']['id']);for(var _0xcf5173=0x0;_0xcf5173<_0x374329[_0x27a1('0x3f')];_0xcf5173+=0x1){let _0x4a6fc9=_0x374329[_0xcf5173];for(var _0x20f483=0x0;_0x20f483<_0x4a6fc9['Agents'][_0x27a1('0x3f')];_0x20f483+=0x1){let _0x2ce515=_0x4a6fc9[_0x27a1('0x72')][_0x20f483];var _0x4e81ec=_0x88a44[_0x27a1('0x7f')]();_0x4e81ec[_0x27a1('0x43')]('ut.UserId\x20=\x20?',_0x2ce515['id']);_0x5acd93[_0x27a1('0x80')](db[_0x27a1('0x81')][_0x27a1('0x39')](_0x4e81ec[_0x27a1('0x82')](),{'type':db[_0x27a1('0x81')]['QueryTypes'][_0x27a1('0x83')]})[_0x27a1('0x2d')](function(_0x4f0b65){if(_0x4f0b65['length']===0x1){return _0x2ce515['id'];}else{var _0x495bcb=_[_0x27a1('0x84')](_[_0x27a1('0x36')](_0x4f0b65,_0x27a1('0x85')),function(_0x159ff0){return _[_0x27a1('0x86')](_0x57ba75,_0x159ff0);});if(_0x495bcb){return _0x2ce515['id'];}}}));}}return BPromise[_0x27a1('0x87')](_0x5acd93)[_0x27a1('0x2d')](function(_0x2fc68b){_0x196da5=_(_0x196da5)[_0x27a1('0x88')](_0x2fc68b)['compact']()['value']();return db[_0x27a1('0x4b')][_0x27a1('0x51')]({'where':{'id':_0x40baf7[_0x27a1('0x50')]['id']}})['then'](function(_0x1523be){return db['sequelize'][_0x27a1('0x73')](function(_0x39c7b5){return _0x1523be[_0x27a1('0x78')](_0x40baf7[_0x27a1('0x39')][_0x27a1('0x79')],{'transaction':_0x39c7b5})[_0x27a1('0x2d')](function(){if(!_[_0x27a1('0x89')](_0x196da5)){return _0x1523be[_0x27a1('0x8a')](_0x196da5,{'transaction':_0x39c7b5});}})[_0x27a1('0x2d')](function(){_0x196da5['forEach'](function(_0x11ca52){socket[_0x27a1('0x8b')](_0x27a1('0x8c'),{'UserId':_0x11ca52,'SmsQueueId':_0x1523be['id']});});});});});});})[_0x27a1('0x2d')](respondWithStatusCode(_0x5e314c,null))[_0x27a1('0x4e')](handleError(_0x5e314c,null));};exports[_0x27a1('0x8d')]=function(_0xb7b6d3,_0x2da27f,_0x12d0c1){return db[_0x27a1('0x4b')][_0x27a1('0x51')]({'where':{'id':_0xb7b6d3['params']['id']}})[_0x27a1('0x2d')](handleEntityNotFound(_0x2da27f,null))['then'](function(_0x19e25d){if(_0x19e25d){return _0x19e25d['addAgents'](_0xb7b6d3[_0x27a1('0x5a')]['ids'],_[_0x27a1('0x8e')](_0xb7b6d3[_0x27a1('0x5a')],[_0x27a1('0x79'),'id'])||{})[_0x27a1('0x8f')](function(_0x5cc70c){for(var _0x262023=0x0;_0x262023<_0xb7b6d3[_0x27a1('0x5a')][_0x27a1('0x79')][_0x27a1('0x3f')];_0x262023+=0x1){socket[_0x27a1('0x8b')]('userSmsQueue:save',{'UserId':Number(_0xb7b6d3['body']['ids'][_0x262023]),'SmsQueueId':Number(_0xb7b6d3[_0x27a1('0x50')]['id'])});}return _0x5cc70c;});}})[_0x27a1('0x2d')](respondWithResult(_0x2da27f,null))[_0x27a1('0x4e')](handleError(_0x2da27f,null));};exports[_0x27a1('0x8a')]=function(_0x488af0,_0x28ebed,_0x555f39){return db[_0x27a1('0x4b')]['find']({'where':{'id':_0x488af0[_0x27a1('0x50')]['id']}})[_0x27a1('0x2d')](handleEntityNotFound(_0x28ebed,null))['then'](function(_0x5884a2){if(_0x5884a2){return _0x5884a2[_0x27a1('0x8a')](_0x488af0[_0x27a1('0x39')]['ids'])[_0x27a1('0x2d')](function(){if(_[_0x27a1('0x90')](_0x488af0[_0x27a1('0x39')]['ids'])){for(var _0x170c27=0x0;_0x170c27<_0x488af0[_0x27a1('0x39')]['ids'][_0x27a1('0x3f')];_0x170c27+=0x1){socket[_0x27a1('0x8b')](_0x27a1('0x8c'),{'UserId':Number(_0x488af0['query']['ids'][_0x170c27]),'SmsQueueId':Number(_0x488af0[_0x27a1('0x50')]['id'])});}}else{socket[_0x27a1('0x8b')](_0x27a1('0x8c'),{'UserId':Number(_0x488af0[_0x27a1('0x39')][_0x27a1('0x79')]),'SmsQueueId':Number(_0x488af0[_0x27a1('0x50')]['id'])});}});}})['then'](respondWithStatusCode(_0x28ebed,null))[_0x27a1('0x4e')](handleError(_0x28ebed,null));};exports[_0x27a1('0x91')]=function(_0x45bda9,_0x4c3b96,_0x39bc97){var _0x3065c8={};var _0x1dac5f={};var _0xf78667;var _0x259e40;return db['SmsQueue']['findOne']({'where':{'id':_0x45bda9[_0x27a1('0x50')]['id']}})[_0x27a1('0x2d')](handleEntityNotFound(_0x4c3b96,null))[_0x27a1('0x2d')](function(_0x48b38f){if(_0x48b38f){_0xf78667=_0x48b38f;_0x1dac5f[_0x27a1('0x38')]=_['keys'](db['User'][_0x27a1('0x6b')]);_0x1dac5f[_0x27a1('0x39')]=_[_0x27a1('0x3a')](_0x45bda9['query']);_0x1dac5f[_0x27a1('0x3b')]=_[_0x27a1('0x3d')](_0x1dac5f[_0x27a1('0x38')],_0x1dac5f[_0x27a1('0x39')]);_0x3065c8[_0x27a1('0x3c')]=_['intersection'](_0x1dac5f[_0x27a1('0x38')],qs[_0x27a1('0x3e')](_0x45bda9['query'][_0x27a1('0x3e')]));_0x3065c8[_0x27a1('0x3c')]=_0x3065c8['attributes'][_0x27a1('0x3f')]?_0x3065c8['attributes']:_0x1dac5f[_0x27a1('0x38')];_0x3065c8[_0x27a1('0x41')]=qs['sort'](_0x45bda9[_0x27a1('0x39')][_0x27a1('0x42')]);_0x3065c8[_0x27a1('0x43')]=qs['filters'](_[_0x27a1('0x44')](_0x45bda9[_0x27a1('0x39')],_0x1dac5f[_0x27a1('0x3b')]));if(_0x45bda9[_0x27a1('0x39')][_0x27a1('0x45')]){_0x3065c8[_0x27a1('0x43')]=_[_0x27a1('0x46')](_0x3065c8[_0x27a1('0x43')],{'$or':_[_0x27a1('0x36')](_0x3065c8[_0x27a1('0x3c')],function(_0x4d5ea8){var _0x319d91={};_0x319d91[_0x4d5ea8]={'$like':'%'+_0x45bda9[_0x27a1('0x39')][_0x27a1('0x45')]+'%'};return _0x319d91;})});}_0x3065c8=_[_0x27a1('0x46')]({},_0x3065c8,_0x45bda9[_0x27a1('0x60')]);return _0xf78667['getAgents'](_0x3065c8);}})[_0x27a1('0x2d')](function(_0x52185b){if(_0x52185b){_0x259e40=_0x52185b[_0x27a1('0x3f')];if(!_0x45bda9['query'][_0x27a1('0x40')](_0x27a1('0x5e'))){_0x3065c8[_0x27a1('0x28')]=qs[_0x27a1('0x28')](_0x45bda9[_0x27a1('0x39')][_0x27a1('0x28')]);_0x3065c8[_0x27a1('0x25')]=qs[_0x27a1('0x25')](_0x45bda9[_0x27a1('0x39')][_0x27a1('0x25')]);}return _0xf78667[_0x27a1('0x91')](_0x3065c8);}})['then'](function(_0x472061){if(_0x472061){return _0x472061?{'count':_0x259e40,'rows':_0x472061}:null;}})[_0x27a1('0x2d')](respondWithResult(_0x4c3b96,null))['catch'](handleError(_0x4c3b96,null));}; \ No newline at end of file +var _0x0ca8=['reject','update','then','get','destroy','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','SmsQueue','includeAll','rows','catch','show','params','keys','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserSmsQueue','pick','findAll','findAndCountAll','UserId','smsPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','order','addTeams','ids','User','voicePause','interface','flatMap','Agents','sequelize','transaction','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','select','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','SmsQueueId\x20=\x20?','toString','QueryTypes','TeamId','includes','all','compact','removeAgents','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','apply'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0x0ca8,0xe6));var _0x80ca=function(_0x264ce4,_0x334eb4){_0x264ce4=_0x264ce4-0x0;var _0x19c1cf=_0x0ca8[_0x264ce4];return _0x19c1cf;};'use strict';var emlformat=require(_0x80ca('0x0'));var rimraf=require(_0x80ca('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x80ca('0x2'));var rp=require(_0x80ca('0x3'));var moment=require('moment');var BPromise=require(_0x80ca('0x4'));var Mustache=require(_0x80ca('0x5'));var util=require(_0x80ca('0x6'));var path=require(_0x80ca('0x7'));var sox=require(_0x80ca('0x8'));var csv=require(_0x80ca('0x9'));var ejs=require(_0x80ca('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x80ca('0xb'));var squel=require('squel');var crypto=require(_0x80ca('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x80ca('0x9'));var querystring=require(_0x80ca('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x80ca('0xe'));var qs=require(_0x80ca('0xf'));var as=require(_0x80ca('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x80ca('0x11'))('api');var utils=require(_0x80ca('0x12'));var config=require(_0x80ca('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x80ca('0x14'))['db'];config[_0x80ca('0x15')]=_['defaults'](config['redis'],{'host':_0x80ca('0x16'),'port':0x18eb});var socket=require(_0x80ca('0x17'))(new Redis(config['redis']));require('./smsQueue.socket')['register'](socket);function respondWithStatusCode(_0x4420b3,_0x8d6fac){_0x8d6fac=_0x8d6fac||0xcc;return function(_0x37bf8e){if(_0x37bf8e){return _0x4420b3[_0x80ca('0x18')](_0x8d6fac);}return _0x4420b3[_0x80ca('0x19')](_0x8d6fac)[_0x80ca('0x1a')]();};}function respondWithResult(_0x110c8b,_0x35efb8){_0x35efb8=_0x35efb8||0xc8;return function(_0x4947fc){if(_0x4947fc){return _0x110c8b[_0x80ca('0x19')](_0x35efb8)[_0x80ca('0x1b')](_0x4947fc);}};}function respondWithFilteredResult(_0x1d10ca,_0x1a7341){return function(_0x3f6da4){if(_0x3f6da4){var _0xa5f20d=typeof _0x1a7341[_0x80ca('0x1c')]===_0x80ca('0x1d')&&typeof _0x1a7341[_0x80ca('0x1e')]==='undefined';var _0x1ab0b5=_0x3f6da4[_0x80ca('0x1f')];var _0x4cff79=_0xa5f20d?0x0:_0x1a7341[_0x80ca('0x1c')];var _0x560088=_0xa5f20d?_0x3f6da4['count']:_0x1a7341[_0x80ca('0x1c')]+_0x1a7341[_0x80ca('0x1e')];var _0x46a962;if(_0x560088>=_0x1ab0b5){_0x560088=_0x1ab0b5;_0x46a962=0xc8;}else{_0x46a962=0xce;}_0x1d10ca[_0x80ca('0x19')](_0x46a962);return _0x1d10ca[_0x80ca('0x20')]('Content-Range',_0x4cff79+'-'+_0x560088+'/'+_0x1ab0b5)['json'](_0x3f6da4);}return null;};}function patchUpdates(_0x248730){return function(_0x5d9162){try{jsonpatch[_0x80ca('0x21')](_0x5d9162,_0x248730,!![]);}catch(_0x1258ac){return BPromise[_0x80ca('0x22')](_0x1258ac);}return _0x5d9162['save']();};}function saveUpdates(_0x1a427b,_0x5c8544){return function(_0x257c9c){if(_0x257c9c){return _0x257c9c[_0x80ca('0x23')](_0x1a427b)['then'](function(_0x2ebb55){return _0x2ebb55;});}return null;};}function removeEntity(_0x1918a1,_0x429600){return function(_0x59835b){if(_0x59835b){return _0x59835b['destroy']()[_0x80ca('0x24')](function(){var _0x193d97=_0x59835b[_0x80ca('0x25')]({'plain':!![]});var _0x24a818='SmsQueues';return db['UserProfileResource'][_0x80ca('0x26')]({'where':{'type':_0x24a818,'resourceId':_0x193d97['id']}})[_0x80ca('0x24')](function(){return _0x59835b;});})[_0x80ca('0x24')](function(){_0x1918a1[_0x80ca('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6310b8,_0x4e3f75){return function(_0x40b399){if(!_0x40b399){_0x6310b8[_0x80ca('0x18')](0x194);}return _0x40b399;};}function handleError(_0x5da06e,_0x4f1c6f){_0x4f1c6f=_0x4f1c6f||0x1f4;return function(_0x3f7462){logger['error'](_0x3f7462[_0x80ca('0x27')]);if(_0x3f7462[_0x80ca('0x28')]){delete _0x3f7462[_0x80ca('0x28')];}_0x5da06e[_0x80ca('0x19')](_0x4f1c6f)[_0x80ca('0x29')](_0x3f7462);};}exports[_0x80ca('0x2a')]=function(_0x5bab72,_0x1b2b9e){var _0x4cd888={},_0x2e3825={},_0x3f7256={'count':0x0,'rows':[]};var _0x17e33f=_['map'](db['SmsQueue'][_0x80ca('0x2b')],function(_0x35fafe){return{'name':_0x35fafe[_0x80ca('0x2c')],'type':_0x35fafe[_0x80ca('0x2d')][_0x80ca('0x2e')]};});_0x2e3825[_0x80ca('0x2f')]=_[_0x80ca('0x30')](_0x17e33f,_0x80ca('0x28'));_0x2e3825[_0x80ca('0x31')]=_['keys'](_0x5bab72['query']);_0x2e3825[_0x80ca('0x32')]=_[_0x80ca('0x33')](_0x2e3825[_0x80ca('0x2f')],_0x2e3825['query']);_0x4cd888[_0x80ca('0x34')]=_[_0x80ca('0x33')](_0x2e3825['model'],qs[_0x80ca('0x35')](_0x5bab72['query'][_0x80ca('0x35')]));_0x4cd888['attributes']=_0x4cd888[_0x80ca('0x34')][_0x80ca('0x36')]?_0x4cd888['attributes']:_0x2e3825['model'];if(!_0x5bab72['query'][_0x80ca('0x37')](_0x80ca('0x38'))){_0x4cd888[_0x80ca('0x1e')]=qs['limit'](_0x5bab72[_0x80ca('0x31')][_0x80ca('0x1e')]);_0x4cd888['offset']=qs[_0x80ca('0x1c')](_0x5bab72[_0x80ca('0x31')][_0x80ca('0x1c')]);}_0x4cd888['order']=qs['sort'](_0x5bab72[_0x80ca('0x31')][_0x80ca('0x39')]);_0x4cd888[_0x80ca('0x3a')]=qs[_0x80ca('0x32')](_['pick'](_0x5bab72[_0x80ca('0x31')],_0x2e3825[_0x80ca('0x32')]),_0x17e33f);if(_0x5bab72[_0x80ca('0x31')][_0x80ca('0x3b')]){_0x4cd888[_0x80ca('0x3a')]=_[_0x80ca('0x3c')](_0x4cd888[_0x80ca('0x3a')],{'$or':_[_0x80ca('0x30')](_0x17e33f,function(_0x1d97c5){if(_0x1d97c5[_0x80ca('0x2d')]!==_0x80ca('0x3d')){var _0x113936={};_0x113936[_0x1d97c5[_0x80ca('0x28')]]={'$like':'%'+_0x5bab72['query'][_0x80ca('0x3b')]+'%'};return _0x113936;}})});}_0x4cd888=_[_0x80ca('0x3c')]({},_0x4cd888,_0x5bab72['options']);var _0x223697={'where':_0x4cd888['where']};return db[_0x80ca('0x3e')][_0x80ca('0x1f')](_0x223697)[_0x80ca('0x24')](function(_0x5b5a28){_0x3f7256[_0x80ca('0x1f')]=_0x5b5a28;if(_0x5bab72[_0x80ca('0x31')][_0x80ca('0x3f')]){_0x4cd888['include']=[{'all':!![]}];}return db[_0x80ca('0x3e')]['findAll'](_0x4cd888);})[_0x80ca('0x24')](function(_0x44307a){_0x3f7256[_0x80ca('0x40')]=_0x44307a;return _0x3f7256;})['then'](respondWithFilteredResult(_0x1b2b9e,_0x4cd888))[_0x80ca('0x41')](handleError(_0x1b2b9e,null));};exports[_0x80ca('0x42')]=function(_0x4eb8c8,_0xd9a7f3){var _0x4f16dc={'raw':!![],'where':{'id':_0x4eb8c8[_0x80ca('0x43')]['id']}},_0x29e3ef={};_0x29e3ef['model']=_['keys'](db[_0x80ca('0x3e')][_0x80ca('0x2b')]);_0x29e3ef['query']=_[_0x80ca('0x44')](_0x4eb8c8[_0x80ca('0x31')]);_0x29e3ef[_0x80ca('0x32')]=_[_0x80ca('0x33')](_0x29e3ef[_0x80ca('0x2f')],_0x29e3ef[_0x80ca('0x31')]);_0x4f16dc[_0x80ca('0x34')]=_['intersection'](_0x29e3ef[_0x80ca('0x2f')],qs[_0x80ca('0x35')](_0x4eb8c8[_0x80ca('0x31')]['fields']));_0x4f16dc[_0x80ca('0x34')]=_0x4f16dc[_0x80ca('0x34')][_0x80ca('0x36')]?_0x4f16dc[_0x80ca('0x34')]:_0x29e3ef[_0x80ca('0x2f')];if(_0x4eb8c8[_0x80ca('0x31')]['includeAll']){_0x4f16dc[_0x80ca('0x45')]=[{'all':!![]}];}_0x4f16dc=_[_0x80ca('0x3c')]({},_0x4f16dc,_0x4eb8c8[_0x80ca('0x46')]);return db[_0x80ca('0x3e')][_0x80ca('0x47')](_0x4f16dc)[_0x80ca('0x24')](handleEntityNotFound(_0xd9a7f3,null))[_0x80ca('0x24')](respondWithResult(_0xd9a7f3,null))[_0x80ca('0x41')](handleError(_0xd9a7f3,null));};exports['create']=function(_0x1c102a,_0x3b2f55){return db[_0x80ca('0x3e')][_0x80ca('0x48')](_0x1c102a['body'],{})[_0x80ca('0x24')](function(_0x215370){var _0x455b93=_0x1c102a[_0x80ca('0x49')][_0x80ca('0x25')]({'plain':!![]});if(!_0x455b93)throw new Error(_0x80ca('0x4a'));if(_0x455b93[_0x80ca('0x4b')]==='user'){var _0x22606e=_0x215370[_0x80ca('0x25')]({'plain':!![]});var _0x12ddd8='SmsQueues';return db[_0x80ca('0x4c')][_0x80ca('0x47')]({'where':{'name':_0x12ddd8,'userProfileId':_0x455b93[_0x80ca('0x4d')]},'raw':!![]})[_0x80ca('0x24')](function(_0xcca143){if(_0xcca143&&_0xcca143['autoAssociation']===0x0){return db[_0x80ca('0x4e')][_0x80ca('0x48')]({'name':_0x22606e['name'],'resourceId':_0x22606e['id'],'type':_0xcca143[_0x80ca('0x28')],'sectionId':_0xcca143['id']},{})[_0x80ca('0x24')](function(){return _0x215370;});}else{return _0x215370;}})[_0x80ca('0x41')](function(_0x2f98ed){logger[_0x80ca('0x4f')](_0x80ca('0x50'),_0x2f98ed);throw _0x2f98ed;});}return _0x215370;})[_0x80ca('0x24')](respondWithResult(_0x3b2f55,0xc9))[_0x80ca('0x41')](handleError(_0x3b2f55,null));};exports[_0x80ca('0x23')]=function(_0x72b10f,_0x2e4389){if(_0x72b10f[_0x80ca('0x51')]['id']){delete _0x72b10f[_0x80ca('0x51')]['id'];}return db['SmsQueue'][_0x80ca('0x47')]({'where':{'id':_0x72b10f[_0x80ca('0x43')]['id']}})[_0x80ca('0x24')](handleEntityNotFound(_0x2e4389,null))['then'](saveUpdates(_0x72b10f[_0x80ca('0x51')],null))[_0x80ca('0x24')](respondWithResult(_0x2e4389,null))[_0x80ca('0x41')](handleError(_0x2e4389,null));};exports['destroy']=function(_0x26d49c,_0x78e942){return db[_0x80ca('0x3e')][_0x80ca('0x47')]({'where':{'id':_0x26d49c[_0x80ca('0x43')]['id']}})[_0x80ca('0x24')](handleEntityNotFound(_0x78e942,null))['then'](removeEntity(_0x78e942,null))[_0x80ca('0x41')](handleError(_0x78e942,null));};exports[_0x80ca('0x52')]=function(_0x54f80e,_0x1bc126){return db['SmsQueue'][_0x80ca('0x52')]()[_0x80ca('0x24')](respondWithResult(_0x1bc126,null))[_0x80ca('0x41')](handleError(_0x1bc126,null));};exports[_0x80ca('0x53')]=function(_0x174cdd,_0x26ab89,_0x427c04){var _0x4b0a71={'raw':!![],'where':{}},_0x53a9a7={},_0x50d0b8;return db[_0x80ca('0x3e')][_0x80ca('0x54')]({'where':{'id':_0x174cdd['params']['id']}})[_0x80ca('0x24')](handleEntityNotFound(_0x26ab89,null))[_0x80ca('0x24')](function(_0x5636ae){if(_0x5636ae){_0x50d0b8=_0x5636ae[_0x80ca('0x25')]({'plain':!![]});_0x53a9a7[_0x80ca('0x2f')]=_[_0x80ca('0x44')](db[_0x80ca('0x55')][_0x80ca('0x2b')]);_0x53a9a7[_0x80ca('0x31')]=_[_0x80ca('0x44')](_0x174cdd['query']);_0x53a9a7[_0x80ca('0x32')]=_[_0x80ca('0x33')](_0x53a9a7['model'],_0x53a9a7[_0x80ca('0x31')]);_0x4b0a71[_0x80ca('0x34')]=_[_0x80ca('0x33')](_0x53a9a7[_0x80ca('0x2f')],qs[_0x80ca('0x35')](_0x174cdd[_0x80ca('0x31')]['fields']));_0x4b0a71[_0x80ca('0x34')]=_0x4b0a71[_0x80ca('0x34')][_0x80ca('0x36')]?_0x4b0a71[_0x80ca('0x34')]:_0x53a9a7[_0x80ca('0x2f')];if(!_0x174cdd[_0x80ca('0x31')][_0x80ca('0x37')]('nolimit')){_0x4b0a71[_0x80ca('0x1e')]=qs[_0x80ca('0x1e')](_0x174cdd['query'][_0x80ca('0x1e')]);_0x4b0a71['offset']=qs[_0x80ca('0x1c')](_0x174cdd[_0x80ca('0x31')][_0x80ca('0x1c')]);}_0x4b0a71['order']=qs[_0x80ca('0x39')](_0x174cdd[_0x80ca('0x31')][_0x80ca('0x39')]);_0x4b0a71[_0x80ca('0x3a')]=qs[_0x80ca('0x32')](_[_0x80ca('0x56')](_0x174cdd['query'],_0x53a9a7[_0x80ca('0x32')]));_0x4b0a71['where']['SmsQueueId']=_0x5636ae['id'];if(_0x174cdd[_0x80ca('0x31')][_0x80ca('0x3b')]){_0x4b0a71[_0x80ca('0x3a')]=_[_0x80ca('0x3c')](_0x4b0a71[_0x80ca('0x3a')],{'$or':_[_0x80ca('0x30')](_0x4b0a71[_0x80ca('0x34')],function(_0xf57901){var _0x330c49={};_0x330c49[_0xf57901]={'$like':'%'+_0x174cdd[_0x80ca('0x31')]['filter']+'%'};return _0x330c49;})});}_0x4b0a71=_['merge']({},_0x4b0a71,_0x174cdd['options']);return db['UserSmsQueue'][_0x80ca('0x57')](_0x4b0a71);}})[_0x80ca('0x24')](function(_0x454269){if(_0x454269){return db['User'][_0x80ca('0x58')]({'where':{'id':_[_0x80ca('0x30')](_0x454269,_0x80ca('0x59')),'role':'agent'},'attributes':['id','name',_0x80ca('0x5a'),_0x80ca('0x5b'),_0x80ca('0x5c')]});}})[_0x80ca('0x24')](function(_0x392c94){if(_0x392c94){return{'count':_0x392c94[_0x80ca('0x1f')],'rows':_['map'](_0x392c94[_0x80ca('0x40')],function(_0x284a99){return{'membername':_0x284a99[_0x80ca('0x28')],'UserId':_0x284a99['id'],'queue_name':_0x50d0b8[_0x80ca('0x28')],'SmsQueueId':_0x50d0b8['id'],'interface':util['format'](_0x80ca('0x5d'),_0x80ca('0x5e'),_0x284a99[_0x80ca('0x28')]),'penalty':0x0,'paused':_0x284a99[_0x80ca('0x5a')],'createdAt':_0x284a99['createdAt'],'updatedAt':_0x284a99[_0x80ca('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x26ab89,_0x4b0a71))[_0x80ca('0x41')](handleError(_0x26ab89,null));};exports[_0x80ca('0x5f')]=function(_0x890824,_0x7ac249,_0xa5489d){var _0x35c924={};var _0xb404fb={};var _0x3705c3;var _0x1e1b0b;return db[_0x80ca('0x3e')][_0x80ca('0x54')]({'where':{'id':_0x890824[_0x80ca('0x43')]['id']}})['then'](handleEntityNotFound(_0x7ac249,null))[_0x80ca('0x24')](function(_0x314c20){if(_0x314c20){_0x3705c3=_0x314c20;_0xb404fb[_0x80ca('0x2f')]=_[_0x80ca('0x44')](db[_0x80ca('0x60')][_0x80ca('0x2b')]);_0xb404fb['query']=_['keys'](_0x890824[_0x80ca('0x31')]);_0xb404fb[_0x80ca('0x32')]=_['intersection'](_0xb404fb[_0x80ca('0x2f')],_0xb404fb[_0x80ca('0x31')]);_0x35c924[_0x80ca('0x34')]=_[_0x80ca('0x33')](_0xb404fb[_0x80ca('0x2f')],qs[_0x80ca('0x35')](_0x890824['query']['fields']));_0x35c924['attributes']=_0x35c924[_0x80ca('0x34')][_0x80ca('0x36')]?_0x35c924[_0x80ca('0x34')]:_0xb404fb[_0x80ca('0x2f')];_0x35c924[_0x80ca('0x61')]=qs[_0x80ca('0x39')](_0x890824[_0x80ca('0x31')]['sort']);_0x35c924[_0x80ca('0x3a')]=qs['filters'](_[_0x80ca('0x56')](_0x890824['query'],_0xb404fb[_0x80ca('0x32')]));if(_0x890824[_0x80ca('0x31')][_0x80ca('0x3b')]){_0x35c924[_0x80ca('0x3a')]=_[_0x80ca('0x3c')](_0x35c924[_0x80ca('0x3a')],{'$or':_[_0x80ca('0x30')](_0x35c924['attributes'],function(_0xc68a2a){var _0x41e673={};_0x41e673[_0xc68a2a]={'$like':'%'+_0x890824[_0x80ca('0x31')][_0x80ca('0x3b')]+'%'};return _0x41e673;})});}_0x35c924=_[_0x80ca('0x3c')]({},_0x35c924,_0x890824[_0x80ca('0x46')]);return _0x3705c3['getTeams'](_0x35c924);}})['then'](function(_0x4259ae){if(_0x4259ae){_0x1e1b0b=_0x4259ae[_0x80ca('0x36')];if(!_0x890824[_0x80ca('0x31')]['hasOwnProperty'](_0x80ca('0x38'))){_0x35c924[_0x80ca('0x1e')]=qs[_0x80ca('0x1e')](_0x890824[_0x80ca('0x31')][_0x80ca('0x1e')]);_0x35c924['offset']=qs[_0x80ca('0x1c')](_0x890824[_0x80ca('0x31')]['offset']);}return _0x3705c3[_0x80ca('0x5f')](_0x35c924);}})[_0x80ca('0x24')](function(_0x519caa){if(_0x519caa){return _0x519caa?{'count':_0x1e1b0b,'rows':_0x519caa}:null;}})[_0x80ca('0x24')](respondWithResult(_0x7ac249,null))[_0x80ca('0x41')](handleError(_0x7ac249,null));};exports[_0x80ca('0x62')]=function(_0x125025,_0x9da2e4,_0x59f33c){var _0x4da89f=_0x125025[_0x80ca('0x51')][_0x80ca('0x63')];return db[_0x80ca('0x60')][_0x80ca('0x57')]({'where':{'id':_0x4da89f},'attributes':['id'],'include':[{'model':db[_0x80ca('0x64')],'as':'Agents','attributes':['id',_0x80ca('0x28'),'online',_0x80ca('0x65'),_0x80ca('0x66')],'raw':!![]}]})[_0x80ca('0x24')](function(_0x1f0cc0){if(_0x1f0cc0){var _0x51ac4e=_[_0x80ca('0x67')](_0x1f0cc0,function(_0xf3021a){var _0x2d83c9=_0xf3021a['get']({'plain':!![]});return _0x2d83c9[_0x80ca('0x68')];});return db[_0x80ca('0x3e')][_0x80ca('0x47')]({'where':{'id':_0x125025['params']['id']}})[_0x80ca('0x24')](function(_0x1d3a95){return db[_0x80ca('0x69')][_0x80ca('0x6a')](function(_0x22230b){return _0x1d3a95[_0x80ca('0x62')](_0x4da89f,{'transaction':_0x22230b})[_0x80ca('0x24')](function(){return BPromise['each'](_0x51ac4e,function(_0x27a145){return db['UserSmsQueue'][_0x80ca('0x6b')]({'where':{'UserId':_0x27a145['id'],'SmsQueueId':_0x125025[_0x80ca('0x43')]['id']},'transaction':_0x22230b});});})['then'](function(){_0x51ac4e[_0x80ca('0x6c')](function(_0x244701){socket[_0x80ca('0x6d')](_0x80ca('0x6e'),{'UserId':_0x244701['id'],'SmsQueueId':_0x1d3a95['id']});});});});});}})[_0x80ca('0x24')](respondWithStatusCode(_0x9da2e4,null))[_0x80ca('0x41')](handleError(_0x9da2e4,null));};exports[_0x80ca('0x6f')]=function(_0x1f07ea,_0x375ad4,_0x1c3846){return db['Team'][_0x80ca('0x57')]({'where':{'id':_0x1f07ea[_0x80ca('0x31')][_0x80ca('0x63')]},'attributes':['id'],'include':[{'model':db[_0x80ca('0x64')],'as':_0x80ca('0x68'),'attributes':['id'],'raw':!![]}]})[_0x80ca('0x24')](handleEntityNotFound(_0x375ad4,null))[_0x80ca('0x24')](function(_0x45a8a9){var _0x4faadf=_['map'](_0x45a8a9,'id');var _0x2aef1a=[];var _0x1644ab=[];var _0x23752b=squel[_0x80ca('0x70')]();_0x23752b['field'](_0x80ca('0x71'))[_0x80ca('0x72')](_0x80ca('0x73'),'tq')[_0x80ca('0x74')](_0x80ca('0x75'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x80ca('0x3a')](_0x80ca('0x76'),_0x1f07ea['params']['id']);for(var _0x19355d=0x0;_0x19355d<_0x45a8a9['length'];_0x19355d+=0x1){let _0xe7f2e6=_0x45a8a9[_0x19355d];for(var _0xd1eefc=0x0;_0xd1eefc<_0xe7f2e6['Agents'][_0x80ca('0x36')];_0xd1eefc+=0x1){let _0x15b31b=_0xe7f2e6[_0x80ca('0x68')][_0xd1eefc];var _0x4fdf79=_0x23752b['clone']();_0x4fdf79[_0x80ca('0x3a')]('ut.UserId\x20=\x20?',_0x15b31b['id']);_0x1644ab['push'](db[_0x80ca('0x69')][_0x80ca('0x31')](_0x4fdf79[_0x80ca('0x77')](),{'type':db[_0x80ca('0x69')][_0x80ca('0x78')]['SELECT']})[_0x80ca('0x24')](function(_0x4f6476){if(_0x4f6476[_0x80ca('0x36')]===0x1){return _0x15b31b['id'];}else{var _0x38b0ba=_['every'](_[_0x80ca('0x30')](_0x4f6476,_0x80ca('0x79')),function(_0xb6b5b5){return _[_0x80ca('0x7a')](_0x4faadf,_0xb6b5b5);});if(_0x38b0ba){return _0x15b31b['id'];}}}));}}return BPromise[_0x80ca('0x7b')](_0x1644ab)[_0x80ca('0x24')](function(_0x3a619e){_0x2aef1a=_(_0x2aef1a)['union'](_0x3a619e)[_0x80ca('0x7c')]()['value']();return db['SmsQueue'][_0x80ca('0x47')]({'where':{'id':_0x1f07ea[_0x80ca('0x43')]['id']}})[_0x80ca('0x24')](function(_0x2bd965){return db['sequelize'][_0x80ca('0x6a')](function(_0x5c201a){return _0x2bd965[_0x80ca('0x6f')](_0x1f07ea[_0x80ca('0x31')][_0x80ca('0x63')],{'transaction':_0x5c201a})[_0x80ca('0x24')](function(){if(!_['isEmpty'](_0x2aef1a)){return _0x2bd965[_0x80ca('0x7d')](_0x2aef1a,{'transaction':_0x5c201a});}})[_0x80ca('0x24')](function(){_0x2aef1a[_0x80ca('0x6c')](function(_0x51eb7c){socket[_0x80ca('0x6d')](_0x80ca('0x7e'),{'UserId':_0x51eb7c,'SmsQueueId':_0x2bd965['id']});});});});});});})[_0x80ca('0x24')](respondWithStatusCode(_0x375ad4,null))['catch'](handleError(_0x375ad4,null));};exports[_0x80ca('0x7f')]=function(_0x3a5b45,_0x1dc5b2,_0x52ca38){return db[_0x80ca('0x3e')][_0x80ca('0x47')]({'where':{'id':_0x3a5b45['params']['id']}})[_0x80ca('0x24')](handleEntityNotFound(_0x1dc5b2,null))[_0x80ca('0x24')](function(_0xa4b750){if(_0xa4b750){return _0xa4b750['addAgents'](_0x3a5b45[_0x80ca('0x51')][_0x80ca('0x63')],_[_0x80ca('0x80')](_0x3a5b45[_0x80ca('0x51')],[_0x80ca('0x63'),'id'])||{})[_0x80ca('0x81')](function(_0x1542e9){for(var _0x34ba66=0x0;_0x34ba66<_0x3a5b45['body'][_0x80ca('0x63')][_0x80ca('0x36')];_0x34ba66+=0x1){socket['emit']('userSmsQueue:save',{'UserId':Number(_0x3a5b45['body'][_0x80ca('0x63')][_0x34ba66]),'SmsQueueId':Number(_0x3a5b45['params']['id'])});}return _0x1542e9;});}})[_0x80ca('0x24')](respondWithResult(_0x1dc5b2,null))[_0x80ca('0x41')](handleError(_0x1dc5b2,null));};exports['removeAgents']=function(_0x1dcf7e,_0x27f5b6,_0x2a19c9){return db[_0x80ca('0x3e')][_0x80ca('0x47')]({'where':{'id':_0x1dcf7e[_0x80ca('0x43')]['id']}})[_0x80ca('0x24')](handleEntityNotFound(_0x27f5b6,null))['then'](function(_0x1c3756){if(_0x1c3756){return _0x1c3756[_0x80ca('0x7d')](_0x1dcf7e[_0x80ca('0x31')][_0x80ca('0x63')])[_0x80ca('0x24')](function(){if(_[_0x80ca('0x82')](_0x1dcf7e[_0x80ca('0x31')][_0x80ca('0x63')])){for(var _0x37d72b=0x0;_0x37d72b<_0x1dcf7e[_0x80ca('0x31')][_0x80ca('0x63')][_0x80ca('0x36')];_0x37d72b+=0x1){socket['emit'](_0x80ca('0x7e'),{'UserId':Number(_0x1dcf7e[_0x80ca('0x31')]['ids'][_0x37d72b]),'SmsQueueId':Number(_0x1dcf7e[_0x80ca('0x43')]['id'])});}}else{socket[_0x80ca('0x6d')]('userSmsQueue:remove',{'UserId':Number(_0x1dcf7e[_0x80ca('0x31')][_0x80ca('0x63')]),'SmsQueueId':Number(_0x1dcf7e[_0x80ca('0x43')]['id'])});}});}})[_0x80ca('0x24')](respondWithStatusCode(_0x27f5b6,null))[_0x80ca('0x41')](handleError(_0x27f5b6,null));};exports[_0x80ca('0x83')]=function(_0x5c3065,_0x349e1c,_0x280931){var _0x26f203={};var _0x1055bb={};var _0x201118;var _0x5aca2f;return db[_0x80ca('0x3e')][_0x80ca('0x54')]({'where':{'id':_0x5c3065[_0x80ca('0x43')]['id']}})['then'](handleEntityNotFound(_0x349e1c,null))[_0x80ca('0x24')](function(_0x3912c4){if(_0x3912c4){_0x201118=_0x3912c4;_0x1055bb[_0x80ca('0x2f')]=_[_0x80ca('0x44')](db[_0x80ca('0x64')][_0x80ca('0x2b')]);_0x1055bb['query']=_[_0x80ca('0x44')](_0x5c3065[_0x80ca('0x31')]);_0x1055bb[_0x80ca('0x32')]=_[_0x80ca('0x33')](_0x1055bb[_0x80ca('0x2f')],_0x1055bb[_0x80ca('0x31')]);_0x26f203[_0x80ca('0x34')]=_[_0x80ca('0x33')](_0x1055bb['model'],qs[_0x80ca('0x35')](_0x5c3065[_0x80ca('0x31')][_0x80ca('0x35')]));_0x26f203[_0x80ca('0x34')]=_0x26f203[_0x80ca('0x34')][_0x80ca('0x36')]?_0x26f203[_0x80ca('0x34')]:_0x1055bb[_0x80ca('0x2f')];_0x26f203[_0x80ca('0x61')]=qs[_0x80ca('0x39')](_0x5c3065[_0x80ca('0x31')][_0x80ca('0x39')]);_0x26f203[_0x80ca('0x3a')]=qs['filters'](_[_0x80ca('0x56')](_0x5c3065[_0x80ca('0x31')],_0x1055bb[_0x80ca('0x32')]));if(_0x5c3065[_0x80ca('0x31')][_0x80ca('0x3b')]){_0x26f203[_0x80ca('0x3a')]=_[_0x80ca('0x3c')](_0x26f203[_0x80ca('0x3a')],{'$or':_[_0x80ca('0x30')](_0x26f203[_0x80ca('0x34')],function(_0x589be9){var _0x10730f={};_0x10730f[_0x589be9]={'$like':'%'+_0x5c3065[_0x80ca('0x31')][_0x80ca('0x3b')]+'%'};return _0x10730f;})});}_0x26f203=_[_0x80ca('0x3c')]({},_0x26f203,_0x5c3065[_0x80ca('0x46')]);return _0x201118[_0x80ca('0x83')](_0x26f203);}})['then'](function(_0x10ac7d){if(_0x10ac7d){_0x5aca2f=_0x10ac7d[_0x80ca('0x36')];if(!_0x5c3065[_0x80ca('0x31')]['hasOwnProperty'](_0x80ca('0x38'))){_0x26f203[_0x80ca('0x1e')]=qs[_0x80ca('0x1e')](_0x5c3065[_0x80ca('0x31')][_0x80ca('0x1e')]);_0x26f203['offset']=qs['offset'](_0x5c3065['query']['offset']);}return _0x201118[_0x80ca('0x83')](_0x26f203);}})['then'](function(_0xb851ab){if(_0xb851ab){return _0xb851ab?{'count':_0x5aca2f,'rows':_0xb851ab}:null;}})[_0x80ca('0x24')](respondWithResult(_0x349e1c,null))[_0x80ca('0x41')](handleError(_0x349e1c,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 0ed9ac6..17cbd26 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 _0xeff7=['hook','../../mysqldb','SmsQueue','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x5f5816,_0x270087){var _0x1daf54=function(_0x474a0d){while(--_0x474a0d){_0x5f5816['push'](_0x5f5816['shift']());}};_0x1daf54(++_0x270087);}(_0xeff7,0x101));var _0x7eff=function(_0x50006d,_0x5f55b0){_0x50006d=_0x50006d-0x0;var _0x50ef4a=_0xeff7[_0x50006d];return _0x50ef4a;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0x7eff('0x0'))['db'][_0x7eff('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x7eff('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7eff('0x3'),'afterDestroy':_0x7eff('0x4')};function emitEvent(_0x13ce3e){return function(_0x5be290,_0x36a456,_0x4427e6){SmsQueueEvents['emit'](_0x13ce3e+':'+_0x5be290['id'],_0x5be290);SmsQueueEvents[_0x7eff('0x5')](_0x13ce3e,_0x5be290);_0x4427e6(null);};}for(var e in events){if(events[_0x7eff('0x6')](e)){var event=events[e];SmsQueue[_0x7eff('0x7')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file +var _0x961a=['emit','hasOwnProperty','events','../../mysqldb','SmsQueue','setMaxListeners','update','remove'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x961a,0x13a));var _0xa961=function(_0x1e02ff,_0xfd1dfa){_0x1e02ff=_0x1e02ff-0x0;var _0x387bc2=_0x961a[_0x1e02ff];return _0x387bc2;};'use strict';var EventEmitter=require(_0xa961('0x0'));var SmsQueue=require(_0xa961('0x1'))['db'][_0xa961('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xa961('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa961('0x4'),'afterDestroy':_0xa961('0x5')};function emitEvent(_0x63aead){return function(_0x3dd097,_0x41f4df,_0x209cf4){SmsQueueEvents[_0xa961('0x6')](_0x63aead+':'+_0x3dd097['id'],_0x3dd097);SmsQueueEvents['emit'](_0x63aead,_0x3dd097);_0x209cf4(null);};}for(var e in events){if(events[_0xa961('0x7')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 1ccf274..ec60b4b 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 _0x6c0d=['../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash','util','api','moment','request-promise','rimraf'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x6c0d,0xd2));var _0xd6c0=function(_0x37bfa5,_0x2e9e1e){_0x37bfa5=_0x37bfa5-0x0;var _0x337ec2=_0x6c0d[_0x37bfa5];return _0x337ec2;};'use strict';var _=require(_0xd6c0('0x0'));var util=require(_0xd6c0('0x1'));var logger=require('../../config/logger')(_0xd6c0('0x2'));var moment=require(_0xd6c0('0x3'));var BPromise=require('bluebird');var rp=require(_0xd6c0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd6c0('0x5'));var config=require(_0xd6c0('0x6'));var attributes=require(_0xd6c0('0x7'));module[_0xd6c0('0x8')]=function(_0x7f4204,_0x8db2d5){return _0x7f4204[_0xd6c0('0x9')](_0xd6c0('0xa'),attributes,{'tableName':_0xd6c0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6b6a=['exports','SmsQueue','sms_queues','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x37bcd8,_0x27bed9){var _0x422480=function(_0x510db3){while(--_0x510db3){_0x37bcd8['push'](_0x37bcd8['shift']());}};_0x422480(++_0x27bed9);}(_0x6b6a,0x1d9));var _0xa6b6=function(_0x1033a5,_0x4b8902){_0x1033a5=_0x1033a5-0x0;var _0x3d8525=_0x6b6a[_0x1033a5];return _0x3d8525;};'use strict';var _=require(_0xa6b6('0x0'));var util=require('util');var logger=require(_0xa6b6('0x1'))(_0xa6b6('0x2'));var moment=require(_0xa6b6('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa6b6('0x4'));var rimraf=require(_0xa6b6('0x5'));var config=require(_0xa6b6('0x6'));var attributes=require('./smsQueue.attributes');module[_0xa6b6('0x7')]=function(_0x194468,_0x58c073){return _0x194468['define'](_0xa6b6('0x8'),attributes,{'tableName':_0xa6b6('0x9'),'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 b6db0b0..bd88000 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 _0xf6bf=['SmsQueue','find','raw','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','socket.io-emitter','register','info','request\x20sent','debug','stringify','error','SmsQueue,\x20%s,\x20%s','message','result','catch','GetSmsQueue','findAll','options','where','attributes','limit','include','map','model','then','ShowSmsQueue'];(function(_0x5b1786,_0x1f40f8){var _0x49971e=function(_0x2e5c47){while(--_0x2e5c47){_0x5b1786['push'](_0x5b1786['shift']());}};_0x49971e(++_0x1f40f8);}(_0xf6bf,0x179));var _0xff6b=function(_0x345a92,_0x4541b6){_0x345a92=_0x345a92-0x0;var _0x55c48e=_0xf6bf[_0x345a92];return _0x55c48e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xff6b('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xff6b('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xff6b('0x2'));var logger=require(_0xff6b('0x3'))(_0xff6b('0x4'));var config=require(_0xff6b('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xff6b('0x6')]['http']({'port':0x232a});config[_0xff6b('0x7')]=_[_0xff6b('0x8')](config[_0xff6b('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xff6b('0x9'))(new Redis(config[_0xff6b('0x7')]));require('./smsQueue.socket')[_0xff6b('0xa')](socket);function respondWithRpcPromise(_0x29fad9,_0x22550f,_0x39c77a){return new BPromise(function(_0x143134,_0x68c55a){return client['request'](_0x29fad9,_0x39c77a)['then'](function(_0x4a6dcd){logger[_0xff6b('0xb')]('SmsQueue,\x20%s,\x20%s',_0x22550f,_0xff6b('0xc'));logger[_0xff6b('0xd')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x22550f,'request\x20sent',JSON[_0xff6b('0xe')](_0x4a6dcd));if(_0x4a6dcd[_0xff6b('0xf')]){if(_0x4a6dcd['error']['code']===0x1f4){logger['error'](_0xff6b('0x10'),_0x22550f,_0x4a6dcd[_0xff6b('0xf')]['message']);return _0x68c55a(_0x4a6dcd['error'][_0xff6b('0x11')]);}logger['error'](_0xff6b('0x10'),_0x22550f,_0x4a6dcd[_0xff6b('0xf')][_0xff6b('0x11')]);return _0x143134(_0x4a6dcd[_0xff6b('0xf')][_0xff6b('0x11')]);}else{logger[_0xff6b('0xb')](_0xff6b('0x10'),_0x22550f,'request\x20sent');_0x143134(_0x4a6dcd[_0xff6b('0x12')][_0xff6b('0x11')]);}})[_0xff6b('0x13')](function(_0xa43710){logger[_0xff6b('0xf')](_0xff6b('0x10'),_0x22550f,_0xa43710);_0x68c55a(_0xa43710);});});}exports[_0xff6b('0x14')]=function(_0x4ae204){var _0x50c379=this;return new Promise(function(_0x34371f,_0x351b64){return db['SmsQueue'][_0xff6b('0x15')]({'raw':_0x4ae204[_0xff6b('0x16')]?_0x4ae204[_0xff6b('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x4ae204[_0xff6b('0x16')]?_0x4ae204['options'][_0xff6b('0x17')]||null:null,'attributes':_0x4ae204[_0xff6b('0x16')]?_0x4ae204[_0xff6b('0x16')][_0xff6b('0x18')]||null:null,'limit':_0x4ae204['options']?_0x4ae204[_0xff6b('0x16')][_0xff6b('0x19')]||null:null,'include':_0x4ae204[_0xff6b('0x16')]?_0x4ae204['options']['include']?_['map'](_0x4ae204['options'][_0xff6b('0x1a')],function(_0x29bed1){return{'model':db[_0x29bed1['model']],'as':_0x29bed1['as'],'attributes':_0x29bed1[_0xff6b('0x18')],'include':_0x29bed1[_0xff6b('0x1a')]?_[_0xff6b('0x1b')](_0x29bed1[_0xff6b('0x1a')],function(_0x4a074f){return{'model':db[_0x4a074f['model']],'as':_0x4a074f['as'],'attributes':_0x4a074f[_0xff6b('0x18')],'include':_0x4a074f['include']?_['map'](_0x4a074f['include'],function(_0x20d524){return{'model':db[_0x20d524[_0xff6b('0x1c')]],'as':_0x20d524['as'],'attributes':_0x20d524[_0xff6b('0x18')]};}):[]};}):[]};}):[]:[]})[_0xff6b('0x1d')](function(_0x4f7de0){logger[_0xff6b('0xb')]('GetSmsQueue',_0x4ae204);logger[_0xff6b('0xd')](_0xff6b('0x14'),_0x4ae204,JSON[_0xff6b('0xe')](_0x4f7de0));_0x34371f(_0x4f7de0);})[_0xff6b('0x13')](function(_0x3066c){logger[_0xff6b('0xf')](_0xff6b('0x14'),_0x3066c[_0xff6b('0x11')],_0x4ae204);_0x351b64(_0x50c379[_0xff6b('0xf')](0x1f4,_0x3066c[_0xff6b('0x11')]));});});};exports[_0xff6b('0x1e')]=function(_0x5552e0){var _0xbd874e=this;return new Promise(function(_0xd26ef1,_0xabd878){return db[_0xff6b('0x1f')][_0xff6b('0x20')]({'raw':_0x5552e0[_0xff6b('0x16')]?_0x5552e0['options'][_0xff6b('0x21')]===undefined?!![]:![]:!![],'where':_0x5552e0[_0xff6b('0x16')]?_0x5552e0['options'][_0xff6b('0x17')]||null:null,'attributes':_0x5552e0['options']?_0x5552e0[_0xff6b('0x16')][_0xff6b('0x18')]||null:null,'include':_0x5552e0[_0xff6b('0x16')]?_0x5552e0['options']['include']?_[_0xff6b('0x1b')](_0x5552e0[_0xff6b('0x16')][_0xff6b('0x1a')],function(_0x244326){return{'model':db[_0x244326[_0xff6b('0x1c')]],'as':_0x244326['as'],'attributes':_0x244326[_0xff6b('0x18')],'include':_0x244326[_0xff6b('0x1a')]?_['map'](_0x244326[_0xff6b('0x1a')],function(_0x36b495){return{'model':db[_0x36b495['model']],'as':_0x36b495['as'],'attributes':_0x36b495[_0xff6b('0x18')],'include':_0x36b495['include']?_[_0xff6b('0x1b')](_0x36b495[_0xff6b('0x1a')],function(_0x2842bd){return{'model':db[_0x2842bd[_0xff6b('0x1c')]],'as':_0x2842bd['as'],'attributes':_0x2842bd['attributes']};}):[]};}):[]};}):[]:[]})[_0xff6b('0x1d')](function(_0x11b536){logger[_0xff6b('0xb')](_0xff6b('0x1e'),_0x5552e0);logger[_0xff6b('0xd')](_0xff6b('0x1e'),_0x5552e0,JSON[_0xff6b('0xe')](_0x11b536));_0xd26ef1(_0x11b536);})[_0xff6b('0x13')](function(_0x3ce85d){logger[_0xff6b('0xf')](_0xff6b('0x1e'),_0x3ce85d['message'],_0x5552e0);_0xabd878(_0xbd874e['error'](0x1f4,_0x3ce85d[_0xff6b('0x11')]));});});}; \ No newline at end of file +var _0xa097=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','message','error','catch','GetSmsQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowSmsQueue','SmsQueue'];(function(_0x31fa57,_0x5f3ec4){var _0x2bc2d7=function(_0xd13f8c){while(--_0xd13f8c){_0x31fa57['push'](_0x31fa57['shift']());}};_0x2bc2d7(++_0x5f3ec4);}(_0xa097,0x1bc));var _0x7a09=function(_0x1abbf4,_0x2f199d){_0x1abbf4=_0x1abbf4-0x0;var _0x4c28d9=_0xa097[_0x1abbf4];return _0x4c28d9;};'use strict';var _=require('lodash');var util=require(_0x7a09('0x0'));var moment=require(_0x7a09('0x1'));var BPromise=require('bluebird');var rs=require(_0x7a09('0x2'));var fs=require('fs');var Redis=require(_0x7a09('0x3'));var db=require(_0x7a09('0x4'))['db'];var utils=require(_0x7a09('0x5'));var logger=require('../../config/logger')(_0x7a09('0x6'));var config=require(_0x7a09('0x7'));var jayson=require(_0x7a09('0x8'));var client=jayson[_0x7a09('0x9')]['http']({'port':0x232a});config[_0x7a09('0xa')]=_['defaults'](config['redis'],{'host':_0x7a09('0xb'),'port':0x18eb});var socket=require(_0x7a09('0xc'))(new Redis(config[_0x7a09('0xa')]));require(_0x7a09('0xd'))[_0x7a09('0xe')](socket);function respondWithRpcPromise(_0x27689a,_0x2f332d,_0x1e100d){return new BPromise(function(_0x2f8cc5,_0x46ff08){return client[_0x7a09('0xf')](_0x27689a,_0x1e100d)[_0x7a09('0x10')](function(_0x11cd0c){logger[_0x7a09('0x11')](_0x7a09('0x12'),_0x2f332d,_0x7a09('0x13'));logger[_0x7a09('0x14')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x2f332d,_0x7a09('0x13'),JSON[_0x7a09('0x15')](_0x11cd0c));if(_0x11cd0c['error']){if(_0x11cd0c['error']['code']===0x1f4){logger['error'](_0x7a09('0x12'),_0x2f332d,_0x11cd0c['error'][_0x7a09('0x16')]);return _0x46ff08(_0x11cd0c[_0x7a09('0x17')][_0x7a09('0x16')]);}logger[_0x7a09('0x17')](_0x7a09('0x12'),_0x2f332d,_0x11cd0c[_0x7a09('0x17')][_0x7a09('0x16')]);return _0x2f8cc5(_0x11cd0c['error']['message']);}else{logger['info'](_0x7a09('0x12'),_0x2f332d,_0x7a09('0x13'));_0x2f8cc5(_0x11cd0c['result'][_0x7a09('0x16')]);}})[_0x7a09('0x18')](function(_0x1b2443){logger['error'](_0x7a09('0x12'),_0x2f332d,_0x1b2443);_0x46ff08(_0x1b2443);});});}exports[_0x7a09('0x19')]=function(_0x4356f9){var _0x517a4b=this;return new Promise(function(_0x1e5cb3,_0xfcc9a5){return db['SmsQueue'][_0x7a09('0x1a')]({'raw':_0x4356f9[_0x7a09('0x1b')]?_0x4356f9[_0x7a09('0x1b')][_0x7a09('0x1c')]===undefined?!![]:![]:!![],'where':_0x4356f9[_0x7a09('0x1b')]?_0x4356f9[_0x7a09('0x1b')][_0x7a09('0x1d')]||null:null,'attributes':_0x4356f9[_0x7a09('0x1b')]?_0x4356f9['options'][_0x7a09('0x1e')]||null:null,'limit':_0x4356f9[_0x7a09('0x1b')]?_0x4356f9[_0x7a09('0x1b')][_0x7a09('0x1f')]||null:null,'include':_0x4356f9[_0x7a09('0x1b')]?_0x4356f9['options'][_0x7a09('0x20')]?_[_0x7a09('0x21')](_0x4356f9[_0x7a09('0x1b')][_0x7a09('0x20')],function(_0x33d05a){return{'model':db[_0x33d05a[_0x7a09('0x22')]],'as':_0x33d05a['as'],'attributes':_0x33d05a['attributes'],'include':_0x33d05a['include']?_[_0x7a09('0x21')](_0x33d05a['include'],function(_0x450681){return{'model':db[_0x450681[_0x7a09('0x22')]],'as':_0x450681['as'],'attributes':_0x450681[_0x7a09('0x1e')],'include':_0x450681['include']?_[_0x7a09('0x21')](_0x450681[_0x7a09('0x20')],function(_0x1398e4){return{'model':db[_0x1398e4[_0x7a09('0x22')]],'as':_0x1398e4['as'],'attributes':_0x1398e4[_0x7a09('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c12b3){logger['info'](_0x7a09('0x19'),_0x4356f9);logger[_0x7a09('0x14')](_0x7a09('0x19'),_0x4356f9,JSON[_0x7a09('0x15')](_0x1c12b3));_0x1e5cb3(_0x1c12b3);})[_0x7a09('0x18')](function(_0x13f47e){logger['error']('GetSmsQueue',_0x13f47e['message'],_0x4356f9);_0xfcc9a5(_0x517a4b[_0x7a09('0x17')](0x1f4,_0x13f47e[_0x7a09('0x16')]));});});};exports[_0x7a09('0x23')]=function(_0x54ec39){var _0x44cad8=this;return new Promise(function(_0x24a189,_0x4bd334){return db[_0x7a09('0x24')]['find']({'raw':_0x54ec39['options']?_0x54ec39[_0x7a09('0x1b')][_0x7a09('0x1c')]===undefined?!![]:![]:!![],'where':_0x54ec39['options']?_0x54ec39[_0x7a09('0x1b')][_0x7a09('0x1d')]||null:null,'attributes':_0x54ec39[_0x7a09('0x1b')]?_0x54ec39[_0x7a09('0x1b')][_0x7a09('0x1e')]||null:null,'include':_0x54ec39[_0x7a09('0x1b')]?_0x54ec39[_0x7a09('0x1b')][_0x7a09('0x20')]?_[_0x7a09('0x21')](_0x54ec39[_0x7a09('0x1b')][_0x7a09('0x20')],function(_0x403330){return{'model':db[_0x403330[_0x7a09('0x22')]],'as':_0x403330['as'],'attributes':_0x403330[_0x7a09('0x1e')],'include':_0x403330[_0x7a09('0x20')]?_[_0x7a09('0x21')](_0x403330[_0x7a09('0x20')],function(_0x3c9bdb){return{'model':db[_0x3c9bdb[_0x7a09('0x22')]],'as':_0x3c9bdb['as'],'attributes':_0x3c9bdb[_0x7a09('0x1e')],'include':_0x3c9bdb[_0x7a09('0x20')]?_['map'](_0x3c9bdb[_0x7a09('0x20')],function(_0x3cfc5d){return{'model':db[_0x3cfc5d[_0x7a09('0x22')]],'as':_0x3cfc5d['as'],'attributes':_0x3cfc5d[_0x7a09('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7a09('0x10')](function(_0x55e6c4){logger[_0x7a09('0x11')](_0x7a09('0x23'),_0x54ec39);logger[_0x7a09('0x14')](_0x7a09('0x23'),_0x54ec39,JSON[_0x7a09('0x15')](_0x55e6c4));_0x24a189(_0x55e6c4);})[_0x7a09('0x18')](function(_0x8fdc4c){logger[_0x7a09('0x17')](_0x7a09('0x23'),_0x8fdc4c[_0x7a09('0x16')],_0x54ec39);_0x4bd334(_0x44cad8[_0x7a09('0x17')](0x1f4,_0x8fdc4c[_0x7a09('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 2eaca82..4480bbd 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 _0xa867=['register','length','save','remove','update','emit','removeListener'];(function(_0x3212cc,_0x3bfe46){var _0x3ecd2c=function(_0x594465){while(--_0x594465){_0x3212cc['push'](_0x3212cc['shift']());}};_0x3ecd2c(++_0x3bfe46);}(_0xa867,0xb1));var _0x7a86=function(_0x2b6d76,_0x346303){_0x2b6d76=_0x2b6d76-0x0;var _0x2aee72=_0xa867[_0x2b6d76];return _0x2aee72;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x7a86('0x0'),_0x7a86('0x1'),_0x7a86('0x2')];function createListener(_0x62517e,_0x1d3088){return function(_0x38ee97){_0x1d3088[_0x7a86('0x3')](_0x62517e,_0x38ee97);};}function removeListener(_0x124e8c,_0x550306){return function(){SmsQueueEvents[_0x7a86('0x4')](_0x124e8c,_0x550306);};}exports[_0x7a86('0x5')]=function(_0x297609){for(var _0x35be4e=0x0,_0x46b23b=events[_0x7a86('0x6')];_0x35be4e<_0x46b23b;_0x35be4e++){var _0x3dc513=events[_0x35be4e];var _0x5a8dde=createListener('smsQueue:'+_0x3dc513,_0x297609);SmsQueueEvents['on'](_0x3dc513,_0x5a8dde);}}; \ No newline at end of file +var _0x2695=['update','removeListener','register','smsQueue:'];(function(_0x3c2166,_0x41fc16){var _0x30ccc3=function(_0x689bc3){while(--_0x689bc3){_0x3c2166['push'](_0x3c2166['shift']());}};_0x30ccc3(++_0x41fc16);}(_0x2695,0x108));var _0x5269=function(_0x176572,_0x4d4f7c){_0x176572=_0x176572-0x0;var _0x32f1d=_0x2695[_0x176572];return _0x32f1d;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=['save','remove',_0x5269('0x0')];function createListener(_0x3924a7,_0x4179c9){return function(_0x48f83a){_0x4179c9['emit'](_0x3924a7,_0x48f83a);};}function removeListener(_0xf33568,_0x50beca){return function(){SmsQueueEvents[_0x5269('0x1')](_0xf33568,_0x50beca);};}exports[_0x5269('0x2')]=function(_0x47a7b3){for(var _0x2fcd3b=0x0,_0x263396=events['length'];_0x2fcd3b<_0x263396;_0x2fcd3b++){var _0x399f09=events[_0x2fcd3b];var _0x5d09ba=createListener(_0x5269('0x3')+_0x399f09,_0x47a7b3);SmsQueueEvents['on'](_0x399f09,_0x5d09ba);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 915eda0..41cc4a7 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 _0xf03e=['/describe','describe','/:id','show','post','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x6cba86,_0x2caec1){var _0x2c175d=function(_0x297507){while(--_0x297507){_0x6cba86['push'](_0x6cba86['shift']());}};_0x2c175d(++_0x2caec1);}(_0xf03e,0x114));var _0xef03=function(_0x1874f4,_0x2f2393){_0x1874f4=_0x1874f4-0x0;var _0x4e32ad=_0xf03e[_0x1874f4];return _0x4e32ad;};'use strict';var multer=require(_0xef03('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xef03('0x1'));var express=require(_0xef03('0x2'));var router=express[_0xef03('0x3')]();var fs_extra=require(_0xef03('0x4'));var auth=require(_0xef03('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xef03('0x6'));var controller=require('./smsQueueReport.controller');router[_0xef03('0x7')]('/',auth[_0xef03('0x8')](),controller['index']);router[_0xef03('0x7')](_0xef03('0x9'),auth[_0xef03('0x8')](),controller[_0xef03('0xa')]);router[_0xef03('0x7')](_0xef03('0xb'),auth[_0xef03('0x8')](),controller[_0xef03('0xc')]);router[_0xef03('0xd')]('/',auth[_0xef03('0x8')](),controller['create']);router[_0xef03('0xe')](_0xef03('0xb'),auth[_0xef03('0x8')](),controller[_0xef03('0xf')]);router[_0xef03('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xef03('0x11')]);module[_0xef03('0x12')]=router; \ No newline at end of file +var _0x145a=['post','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x145a,0x100));var _0xa145=function(_0x381023,_0x475864){_0x381023=_0x381023-0x0;var _0x281154=_0x145a[_0x381023];return _0x281154;};'use strict';var multer=require(_0xa145('0x0'));var util=require(_0xa145('0x1'));var path=require(_0xa145('0x2'));var timeout=require(_0xa145('0x3'));var express=require(_0xa145('0x4'));var router=express['Router']();var fs_extra=require(_0xa145('0x5'));var auth=require(_0xa145('0x6'));var interaction=require(_0xa145('0x7'));var config=require(_0xa145('0x8'));var controller=require(_0xa145('0x9'));router[_0xa145('0xa')]('/',auth[_0xa145('0xb')](),controller[_0xa145('0xc')]);router['get'](_0xa145('0xd'),auth[_0xa145('0xb')](),controller[_0xa145('0xe')]);router[_0xa145('0xa')](_0xa145('0xf'),auth[_0xa145('0xb')](),controller[_0xa145('0x10')]);router[_0xa145('0x11')]('/',auth[_0xa145('0xb')](),controller['create']);router['put']('/:id',auth[_0xa145('0xb')](),controller[_0xa145('0x12')]);router[_0xa145('0x13')](_0xa145('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0xa145('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 8719689..e64d305 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 _0x7eb2=['moment','sequelize','STRING','DATE'];(function(_0x271107,_0x137fd){var _0xf906e1=function(_0x5e6858){while(--_0x5e6858){_0x271107['push'](_0x271107['shift']());}};_0xf906e1(++_0x137fd);}(_0x7eb2,0x11c));var _0x27eb=function(_0x45fb7b,_0x33df9f){_0x45fb7b=_0x45fb7b-0x0;var _0xe9c142=_0x7eb2[_0x45fb7b];return _0xe9c142;};'use strict';var moment=require(_0x27eb('0x0'));var Sequelize=require(_0x27eb('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x27eb('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x27eb('0x2')]},'joinAt':{'type':Sequelize[_0x27eb('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x27eb('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x27eb('0x2')]}}; \ No newline at end of file +var _0xc830=['DATE','moment','STRING'];(function(_0x5ad568,_0x3651cb){var _0x54097d=function(_0x357b68){while(--_0x357b68){_0x5ad568['push'](_0x5ad568['shift']());}};_0x54097d(++_0x3651cb);}(_0xc830,0x85));var _0x0c83=function(_0x1141a2,_0x165358){_0x1141a2=_0x1141a2-0x0;var _0x2098a6=_0xc830[_0x1141a2];return _0x2098a6;};'use strict';var moment=require(_0x0c83('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x0c83('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x0c83('0x1')]},'joinAt':{'type':Sequelize[_0x0c83('0x2')]},'leaveAt':{'type':Sequelize[_0x0c83('0x2')]},'acceptAt':{'type':Sequelize[_0x0c83('0x2')]},'exitAt':{'type':Sequelize[_0x0c83('0x2')]},'reason':{'type':Sequelize[_0x0c83('0x1')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index be9f80f..c1c6b82 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 _0x720f=['to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','error','name','send','index','SmsQueueReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','rows','catch','params','keys','find','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','fs-extra','crypto','desk.js'];(function(_0x52929b,_0x489ae9){var _0x4d5437=function(_0x507edd){while(--_0x507edd){_0x52929b['push'](_0x52929b['shift']());}};_0x4d5437(++_0x489ae9);}(_0x720f,0x115));var _0xf720=function(_0x56f7e2,_0x145392){_0x56f7e2=_0x56f7e2-0x0;var _0x36240b=_0x720f[_0x56f7e2];return _0x36240b;};'use strict';var emlformat=require(_0xf720('0x0'));var rimraf=require(_0xf720('0x1'));var zipdir=require(_0xf720('0x2'));var jsonpatch=require(_0xf720('0x3'));var rp=require('request-promise');var moment=require(_0xf720('0x4'));var BPromise=require(_0xf720('0x5'));var Mustache=require(_0xf720('0x6'));var util=require(_0xf720('0x7'));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(_0xf720('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf720('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xf720('0xa'));var toCsv=require(_0xf720('0xb'));var querystring=require(_0xf720('0xc'));var Papa=require(_0xf720('0xd'));var Redis=require('ioredis');var authService=require(_0xf720('0xe'));var qs=require(_0xf720('0xf'));var as=require(_0xf720('0x10'));var hardwareService=require(_0xf720('0x11'));var logger=require(_0xf720('0x12'))(_0xf720('0x13'));var utils=require(_0xf720('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc7fa3d,_0x40984d){_0x40984d=_0x40984d||0xcc;return function(_0x55aab4){if(_0x55aab4){return _0xc7fa3d[_0xf720('0x15')](_0x40984d);}return _0xc7fa3d[_0xf720('0x16')](_0x40984d)[_0xf720('0x17')]();};}function respondWithResult(_0x3c64d7,_0x55ec86){_0x55ec86=_0x55ec86||0xc8;return function(_0x3bd5b8){if(_0x3bd5b8){return _0x3c64d7[_0xf720('0x16')](_0x55ec86)[_0xf720('0x18')](_0x3bd5b8);}};}function respondWithFilteredResult(_0x5bc85f,_0x97f809){return function(_0x1c8751){if(_0x1c8751){var _0x517b9d=typeof _0x97f809[_0xf720('0x19')]===_0xf720('0x1a')&&typeof _0x97f809[_0xf720('0x1b')]===_0xf720('0x1a');var _0x5cc590=_0x1c8751[_0xf720('0x1c')];var _0x1ac432=_0x517b9d?0x0:_0x97f809[_0xf720('0x19')];var _0x3a8ce6=_0x517b9d?_0x1c8751['count']:_0x97f809['offset']+_0x97f809[_0xf720('0x1b')];var _0x1743fd;if(_0x3a8ce6>=_0x5cc590){_0x3a8ce6=_0x5cc590;_0x1743fd=0xc8;}else{_0x1743fd=0xce;}_0x5bc85f[_0xf720('0x16')](_0x1743fd);return _0x5bc85f[_0xf720('0x1d')](_0xf720('0x1e'),_0x1ac432+'-'+_0x3a8ce6+'/'+_0x5cc590)[_0xf720('0x18')](_0x1c8751);}return null;};}function patchUpdates(_0x3acaab){return function(_0x17ff7c){try{jsonpatch[_0xf720('0x1f')](_0x17ff7c,_0x3acaab,!![]);}catch(_0x2d8c58){return BPromise[_0xf720('0x20')](_0x2d8c58);}return _0x17ff7c[_0xf720('0x21')]();};}function saveUpdates(_0x1d644d,_0x30d7f8){return function(_0x2b0451){if(_0x2b0451){return _0x2b0451['update'](_0x1d644d)[_0xf720('0x22')](function(_0x16dc6f){return _0x16dc6f;});}return null;};}function removeEntity(_0x1f1502,_0x3d9904){return function(_0xfa6478){if(_0xfa6478){return _0xfa6478['destroy']()[_0xf720('0x22')](function(){_0x1f1502[_0xf720('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24ee78,_0x1155ac){return function(_0x5be8e3){if(!_0x5be8e3){_0x24ee78[_0xf720('0x15')](0x194);}return _0x5be8e3;};}function handleError(_0x3bb44e,_0x82a3a5){_0x82a3a5=_0x82a3a5||0x1f4;return function(_0x502585){logger[_0xf720('0x23')](_0x502585['stack']);if(_0x502585[_0xf720('0x24')]){delete _0x502585[_0xf720('0x24')];}_0x3bb44e['status'](_0x82a3a5)[_0xf720('0x25')](_0x502585);};}exports[_0xf720('0x26')]=function(_0x36984a,_0x4317ec){var _0x28b678={},_0xe2ab9d={},_0x3f2cec={'count':0x0,'rows':[]};var _0x27b2cb=_['map'](db[_0xf720('0x27')][_0xf720('0x28')],function(_0xbfd267){return{'name':_0xbfd267[_0xf720('0x29')],'type':_0xbfd267[_0xf720('0x2a')][_0xf720('0x2b')]};});_0xe2ab9d[_0xf720('0x2c')]=_[_0xf720('0x2d')](_0x27b2cb,_0xf720('0x24'));_0xe2ab9d[_0xf720('0x2e')]=_['keys'](_0x36984a[_0xf720('0x2e')]);_0xe2ab9d[_0xf720('0x2f')]=_[_0xf720('0x30')](_0xe2ab9d[_0xf720('0x2c')],_0xe2ab9d[_0xf720('0x2e')]);_0x28b678['attributes']=_['intersection'](_0xe2ab9d[_0xf720('0x2c')],qs[_0xf720('0x31')](_0x36984a[_0xf720('0x2e')][_0xf720('0x31')]));_0x28b678[_0xf720('0x32')]=_0x28b678[_0xf720('0x32')][_0xf720('0x33')]?_0x28b678[_0xf720('0x32')]:_0xe2ab9d['model'];if(!_0x36984a[_0xf720('0x2e')][_0xf720('0x34')](_0xf720('0x35'))){_0x28b678[_0xf720('0x1b')]=qs[_0xf720('0x1b')](_0x36984a[_0xf720('0x2e')][_0xf720('0x1b')]);_0x28b678['offset']=qs[_0xf720('0x19')](_0x36984a[_0xf720('0x2e')][_0xf720('0x19')]);}_0x28b678[_0xf720('0x36')]=qs[_0xf720('0x37')](_0x36984a['query']['sort']);_0x28b678[_0xf720('0x38')]=qs[_0xf720('0x2f')](_[_0xf720('0x39')](_0x36984a[_0xf720('0x2e')],_0xe2ab9d[_0xf720('0x2f')]),_0x27b2cb);if(_0x36984a[_0xf720('0x2e')][_0xf720('0x3a')]){_0x28b678['where']=_[_0xf720('0x3b')](_0x28b678['where'],{'$or':_[_0xf720('0x2d')](_0x27b2cb,function(_0x381d13){if(_0x381d13['type']!=='VIRTUAL'){var _0x14d3bd={};_0x14d3bd[_0x381d13[_0xf720('0x24')]]={'$like':'%'+_0x36984a[_0xf720('0x2e')][_0xf720('0x3a')]+'%'};return _0x14d3bd;}})});}_0x28b678=_[_0xf720('0x3b')]({},_0x28b678,_0x36984a[_0xf720('0x3c')]);var _0x51f5f1={'where':_0x28b678['where']};return db[_0xf720('0x27')][_0xf720('0x1c')](_0x51f5f1)[_0xf720('0x22')](function(_0x1cad92){_0x3f2cec[_0xf720('0x1c')]=_0x1cad92;if(_0x36984a[_0xf720('0x2e')]['includeAll']){_0x28b678[_0xf720('0x3d')]=[{'all':!![]}];}return db[_0xf720('0x27')]['findAll'](_0x28b678);})[_0xf720('0x22')](function(_0x48b97f){_0x3f2cec[_0xf720('0x3e')]=_0x48b97f;return _0x3f2cec;})[_0xf720('0x22')](respondWithFilteredResult(_0x4317ec,_0x28b678))[_0xf720('0x3f')](handleError(_0x4317ec,null));};exports['show']=function(_0xec9577,_0x527f07){var _0x1dd6c0={'raw':!![],'where':{'id':_0xec9577[_0xf720('0x40')]['id']}},_0x504c95={};_0x504c95['model']=_[_0xf720('0x41')](db['SmsQueueReport'][_0xf720('0x28')]);_0x504c95[_0xf720('0x2e')]=_['keys'](_0xec9577[_0xf720('0x2e')]);_0x504c95[_0xf720('0x2f')]=_[_0xf720('0x30')](_0x504c95[_0xf720('0x2c')],_0x504c95['query']);_0x1dd6c0['attributes']=_['intersection'](_0x504c95[_0xf720('0x2c')],qs[_0xf720('0x31')](_0xec9577['query'][_0xf720('0x31')]));_0x1dd6c0[_0xf720('0x32')]=_0x1dd6c0[_0xf720('0x32')]['length']?_0x1dd6c0['attributes']:_0x504c95[_0xf720('0x2c')];if(_0xec9577[_0xf720('0x2e')]['includeAll']){_0x1dd6c0[_0xf720('0x3d')]=[{'all':!![]}];}_0x1dd6c0=_['merge']({},_0x1dd6c0,_0xec9577['options']);return db['SmsQueueReport'][_0xf720('0x42')](_0x1dd6c0)[_0xf720('0x22')](handleEntityNotFound(_0x527f07,null))[_0xf720('0x22')](respondWithResult(_0x527f07,null))[_0xf720('0x3f')](handleError(_0x527f07,null));};exports[_0xf720('0x43')]=function(_0x584e92,_0x4097ad){return db[_0xf720('0x27')][_0xf720('0x43')](_0x584e92[_0xf720('0x44')],{})[_0xf720('0x22')](respondWithResult(_0x4097ad,0xc9))[_0xf720('0x3f')](handleError(_0x4097ad,null));};exports[_0xf720('0x45')]=function(_0x5bbbc9,_0x4a7bf8){if(_0x5bbbc9[_0xf720('0x44')]['id']){delete _0x5bbbc9[_0xf720('0x44')]['id'];}return db['SmsQueueReport'][_0xf720('0x42')]({'where':{'id':_0x5bbbc9[_0xf720('0x40')]['id']}})[_0xf720('0x22')](handleEntityNotFound(_0x4a7bf8,null))[_0xf720('0x22')](saveUpdates(_0x5bbbc9[_0xf720('0x44')],null))['then'](respondWithResult(_0x4a7bf8,null))['catch'](handleError(_0x4a7bf8,null));};exports[_0xf720('0x46')]=function(_0x3c4a7b,_0x39dc7f){return db['SmsQueueReport'][_0xf720('0x42')]({'where':{'id':_0x3c4a7b['params']['id']}})[_0xf720('0x22')](handleEntityNotFound(_0x39dc7f,null))[_0xf720('0x22')](removeEntity(_0x39dc7f,null))[_0xf720('0x3f')](handleError(_0x39dc7f,null));};exports[_0xf720('0x47')]=function(_0x323b77,_0x15b20f){return db[_0xf720('0x27')][_0xf720('0x47')]()[_0xf720('0x22')](respondWithResult(_0x15b20f,null))[_0xf720('0x3f')](handleError(_0x15b20f,null));}; \ No newline at end of file +var _0x832c=['where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','params','SmsQueueReport','rawAttributes','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort'];(function(_0x22868f,_0x450f48){var _0x97bc75=function(_0x447cb4){while(--_0x447cb4){_0x22868f['push'](_0x22868f['shift']());}};_0x97bc75(++_0x450f48);}(_0x832c,0x144));var _0xc832=function(_0x4e0ffc,_0x238d86){_0x4e0ffc=_0x4e0ffc-0x0;var _0x51e701=_0x832c[_0x4e0ffc];return _0x51e701;};'use strict';var emlformat=require(_0xc832('0x0'));var rimraf=require(_0xc832('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc832('0x2'));var rp=require(_0xc832('0x3'));var moment=require('moment');var BPromise=require(_0xc832('0x4'));var Mustache=require(_0xc832('0x5'));var util=require(_0xc832('0x6'));var path=require(_0xc832('0x7'));var sox=require(_0xc832('0x8'));var csv=require(_0xc832('0x9'));var ejs=require(_0xc832('0xa'));var fs=require('fs');var fs_extra=require(_0xc832('0xb'));var _=require(_0xc832('0xc'));var squel=require(_0xc832('0xd'));var crypto=require(_0xc832('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc832('0xf'));var toCsv=require(_0xc832('0x9'));var querystring=require('querystring');var Papa=require(_0xc832('0x10'));var Redis=require(_0xc832('0x11'));var authService=require(_0xc832('0x12'));var qs=require(_0xc832('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc832('0x14'));var logger=require(_0xc832('0x15'))(_0xc832('0x16'));var utils=require(_0xc832('0x17'));var config=require(_0xc832('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xc832('0x19'))['db'];function respondWithStatusCode(_0x51a28f,_0x31a043){_0x31a043=_0x31a043||0xcc;return function(_0x102699){if(_0x102699){return _0x51a28f['sendStatus'](_0x31a043);}return _0x51a28f[_0xc832('0x1a')](_0x31a043)[_0xc832('0x1b')]();};}function respondWithResult(_0xb2e589,_0x3e375a){_0x3e375a=_0x3e375a||0xc8;return function(_0x34bc1c){if(_0x34bc1c){return _0xb2e589[_0xc832('0x1a')](_0x3e375a)[_0xc832('0x1c')](_0x34bc1c);}};}function respondWithFilteredResult(_0x3999de,_0x24cb8f){return function(_0x5a28a2){if(_0x5a28a2){var _0x57ee98=typeof _0x24cb8f['offset']==='undefined'&&typeof _0x24cb8f[_0xc832('0x1d')]===_0xc832('0x1e');var _0x1d29ca=_0x5a28a2[_0xc832('0x1f')];var _0x56eee1=_0x57ee98?0x0:_0x24cb8f['offset'];var _0x2c9d04=_0x57ee98?_0x5a28a2[_0xc832('0x1f')]:_0x24cb8f[_0xc832('0x20')]+_0x24cb8f[_0xc832('0x1d')];var _0x167935;if(_0x2c9d04>=_0x1d29ca){_0x2c9d04=_0x1d29ca;_0x167935=0xc8;}else{_0x167935=0xce;}_0x3999de[_0xc832('0x1a')](_0x167935);return _0x3999de[_0xc832('0x21')]('Content-Range',_0x56eee1+'-'+_0x2c9d04+'/'+_0x1d29ca)['json'](_0x5a28a2);}return null;};}function patchUpdates(_0x470bbe){return function(_0x89f289){try{jsonpatch[_0xc832('0x22')](_0x89f289,_0x470bbe,!![]);}catch(_0x1b16e9){return BPromise[_0xc832('0x23')](_0x1b16e9);}return _0x89f289[_0xc832('0x24')]();};}function saveUpdates(_0x142ae2,_0x4e98b2){return function(_0x4c1fd2){if(_0x4c1fd2){return _0x4c1fd2[_0xc832('0x25')](_0x142ae2)[_0xc832('0x26')](function(_0x4cd0ab){return _0x4cd0ab;});}return null;};}function removeEntity(_0x5288c5,_0x3a1740){return function(_0x268d6b){if(_0x268d6b){return _0x268d6b[_0xc832('0x27')]()['then'](function(){_0x5288c5[_0xc832('0x1a')](0xcc)[_0xc832('0x1b')]();});}};}function handleEntityNotFound(_0x230ade,_0x38be87){return function(_0x40db5f){if(!_0x40db5f){_0x230ade[_0xc832('0x28')](0x194);}return _0x40db5f;};}function handleError(_0x23c2ae,_0x1ebb7a){_0x1ebb7a=_0x1ebb7a||0x1f4;return function(_0x30712d){logger[_0xc832('0x29')](_0x30712d[_0xc832('0x2a')]);if(_0x30712d[_0xc832('0x2b')]){delete _0x30712d['name'];}_0x23c2ae['status'](_0x1ebb7a)[_0xc832('0x2c')](_0x30712d);};}exports[_0xc832('0x2d')]=function(_0x3fd1e2,_0x1dbac2){var _0x488140={},_0x584dcc={},_0x47e867={'count':0x0,'rows':[]};var _0x496aa9=_[_0xc832('0x2e')](db['SmsQueueReport']['rawAttributes'],function(_0x449d61){return{'name':_0x449d61[_0xc832('0x2f')],'type':_0x449d61[_0xc832('0x30')][_0xc832('0x31')]};});_0x584dcc[_0xc832('0x32')]=_['map'](_0x496aa9,'name');_0x584dcc[_0xc832('0x33')]=_[_0xc832('0x34')](_0x3fd1e2[_0xc832('0x33')]);_0x584dcc[_0xc832('0x35')]=_[_0xc832('0x36')](_0x584dcc[_0xc832('0x32')],_0x584dcc[_0xc832('0x33')]);_0x488140[_0xc832('0x37')]=_[_0xc832('0x36')](_0x584dcc[_0xc832('0x32')],qs[_0xc832('0x38')](_0x3fd1e2['query']['fields']));_0x488140['attributes']=_0x488140[_0xc832('0x37')][_0xc832('0x39')]?_0x488140[_0xc832('0x37')]:_0x584dcc[_0xc832('0x32')];if(!_0x3fd1e2[_0xc832('0x33')]['hasOwnProperty'](_0xc832('0x3a'))){_0x488140['limit']=qs['limit'](_0x3fd1e2[_0xc832('0x33')][_0xc832('0x1d')]);_0x488140[_0xc832('0x20')]=qs[_0xc832('0x20')](_0x3fd1e2[_0xc832('0x33')]['offset']);}_0x488140[_0xc832('0x3b')]=qs[_0xc832('0x3c')](_0x3fd1e2[_0xc832('0x33')][_0xc832('0x3c')]);_0x488140[_0xc832('0x3d')]=qs[_0xc832('0x35')](_[_0xc832('0x3e')](_0x3fd1e2['query'],_0x584dcc[_0xc832('0x35')]),_0x496aa9);if(_0x3fd1e2[_0xc832('0x33')][_0xc832('0x3f')]){_0x488140[_0xc832('0x3d')]=_['merge'](_0x488140['where'],{'$or':_[_0xc832('0x2e')](_0x496aa9,function(_0x2d0f54){if(_0x2d0f54[_0xc832('0x30')]!==_0xc832('0x40')){var _0x170aa1={};_0x170aa1[_0x2d0f54[_0xc832('0x2b')]]={'$like':'%'+_0x3fd1e2['query'][_0xc832('0x3f')]+'%'};return _0x170aa1;}})});}_0x488140=_[_0xc832('0x41')]({},_0x488140,_0x3fd1e2['options']);var _0x3dbf26={'where':_0x488140[_0xc832('0x3d')]};return db['SmsQueueReport'][_0xc832('0x1f')](_0x3dbf26)[_0xc832('0x26')](function(_0x4f0a51){_0x47e867['count']=_0x4f0a51;if(_0x3fd1e2[_0xc832('0x33')][_0xc832('0x42')]){_0x488140[_0xc832('0x43')]=[{'all':!![]}];}return db['SmsQueueReport'][_0xc832('0x44')](_0x488140);})[_0xc832('0x26')](function(_0x4f50c1){_0x47e867['rows']=_0x4f50c1;return _0x47e867;})[_0xc832('0x26')](respondWithFilteredResult(_0x1dbac2,_0x488140))['catch'](handleError(_0x1dbac2,null));};exports['show']=function(_0x3dd9b1,_0x2b52c1){var _0x3872f3={'raw':!![],'where':{'id':_0x3dd9b1[_0xc832('0x45')]['id']}},_0x86dcbe={};_0x86dcbe['model']=_[_0xc832('0x34')](db[_0xc832('0x46')][_0xc832('0x47')]);_0x86dcbe[_0xc832('0x33')]=_[_0xc832('0x34')](_0x3dd9b1[_0xc832('0x33')]);_0x86dcbe['filters']=_[_0xc832('0x36')](_0x86dcbe[_0xc832('0x32')],_0x86dcbe[_0xc832('0x33')]);_0x3872f3[_0xc832('0x37')]=_[_0xc832('0x36')](_0x86dcbe[_0xc832('0x32')],qs[_0xc832('0x38')](_0x3dd9b1[_0xc832('0x33')][_0xc832('0x38')]));_0x3872f3[_0xc832('0x37')]=_0x3872f3[_0xc832('0x37')]['length']?_0x3872f3[_0xc832('0x37')]:_0x86dcbe['model'];if(_0x3dd9b1['query'][_0xc832('0x42')]){_0x3872f3[_0xc832('0x43')]=[{'all':!![]}];}_0x3872f3=_[_0xc832('0x41')]({},_0x3872f3,_0x3dd9b1['options']);return db['SmsQueueReport'][_0xc832('0x48')](_0x3872f3)[_0xc832('0x26')](handleEntityNotFound(_0x2b52c1,null))[_0xc832('0x26')](respondWithResult(_0x2b52c1,null))[_0xc832('0x49')](handleError(_0x2b52c1,null));};exports['create']=function(_0x39c036,_0x49d10a){return db[_0xc832('0x46')][_0xc832('0x4a')](_0x39c036['body'],{})[_0xc832('0x26')](respondWithResult(_0x49d10a,0xc9))[_0xc832('0x49')](handleError(_0x49d10a,null));};exports[_0xc832('0x25')]=function(_0x36bc33,_0x4243dd){if(_0x36bc33[_0xc832('0x4b')]['id']){delete _0x36bc33[_0xc832('0x4b')]['id'];}return db[_0xc832('0x46')][_0xc832('0x48')]({'where':{'id':_0x36bc33[_0xc832('0x45')]['id']}})['then'](handleEntityNotFound(_0x4243dd,null))[_0xc832('0x26')](saveUpdates(_0x36bc33[_0xc832('0x4b')],null))['then'](respondWithResult(_0x4243dd,null))[_0xc832('0x49')](handleError(_0x4243dd,null));};exports[_0xc832('0x27')]=function(_0x39dffd,_0x2fb094){return db[_0xc832('0x46')][_0xc832('0x48')]({'where':{'id':_0x39dffd['params']['id']}})[_0xc832('0x26')](handleEntityNotFound(_0x2fb094,null))[_0xc832('0x26')](removeEntity(_0x2fb094,null))[_0xc832('0x49')](handleError(_0x2fb094,null));};exports[_0xc832('0x4c')]=function(_0x1f182a,_0xf87edd){return db[_0xc832('0x46')][_0xc832('0x4c')]()[_0xc832('0x26')](respondWithResult(_0xf87edd,null))[_0xc832('0x49')](handleError(_0xf87edd,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 5387576..6a6d5cf 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 _0xd8b0=['define','report_sms_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3ed365,_0x3da825){var _0x2da38b=function(_0x475759){while(--_0x475759){_0x3ed365['push'](_0x3ed365['shift']());}};_0x2da38b(++_0x3da825);}(_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 logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./smsQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('SmsQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x70e0=['util','../../config/logger','bluebird','request-promise','path','rimraf','./smsQueueReport.attributes','report_sms_queue','uniqueid','lodash'];(function(_0x5f29b3,_0x407d3e){var _0x43b776=function(_0x4272be){while(--_0x4272be){_0x5f29b3['push'](_0x5f29b3['shift']());}};_0x43b776(++_0x407d3e);}(_0x70e0,0x17b));var _0x070e=function(_0x2e637f,_0x405812){_0x2e637f=_0x2e637f-0x0;var _0x1c89e0=_0x70e0[_0x2e637f];return _0x1c89e0;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('SmsQueueReport',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[{'name':_0x070e('0x9'),'fields':[_0x070e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index ff75116..8c57db4 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 _0x74a7=['error','code','message','result','catch','SmsQueueReport','create','body','options','CreateSmsQueueReport','UpdateSmsQueueReport','update','raw','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x344122,_0x1282b8){var _0x2416a1=function(_0x2bd79b){while(--_0x2bd79b){_0x344122['push'](_0x344122['shift']());}};_0x2416a1(++_0x1282b8);}(_0x74a7,0xdb));var _0x774a=function(_0x94ab9c,_0x4bd40e){_0x94ab9c=_0x94ab9c-0x0;var _0x186330=_0x74a7[_0x94ab9c];return _0x186330;};'use strict';var _=require(_0x774a('0x0'));var util=require(_0x774a('0x1'));var moment=require(_0x774a('0x2'));var BPromise=require(_0x774a('0x3'));var rs=require(_0x774a('0x4'));var fs=require('fs');var Redis=require(_0x774a('0x5'));var db=require(_0x774a('0x6'))['db'];var utils=require(_0x774a('0x7'));var logger=require(_0x774a('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x774a('0x9'));var client=jayson[_0x774a('0xa')][_0x774a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x291d8b,_0x5149ab,_0x156bf7){return new BPromise(function(_0x46d1b1,_0x32dc15){return client[_0x774a('0xc')](_0x291d8b,_0x156bf7)[_0x774a('0xd')](function(_0x2cda71){logger[_0x774a('0xe')](_0x774a('0xf'),_0x5149ab,'request\x20sent');logger[_0x774a('0x10')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x5149ab,_0x774a('0x11'),JSON[_0x774a('0x12')](_0x2cda71));if(_0x2cda71[_0x774a('0x13')]){if(_0x2cda71[_0x774a('0x13')][_0x774a('0x14')]===0x1f4){logger[_0x774a('0x13')](_0x774a('0xf'),_0x5149ab,_0x2cda71[_0x774a('0x13')][_0x774a('0x15')]);return _0x32dc15(_0x2cda71[_0x774a('0x13')][_0x774a('0x15')]);}logger['error'](_0x774a('0xf'),_0x5149ab,_0x2cda71['error'][_0x774a('0x15')]);return _0x46d1b1(_0x2cda71[_0x774a('0x13')]['message']);}else{logger[_0x774a('0xe')](_0x774a('0xf'),_0x5149ab,'request\x20sent');_0x46d1b1(_0x2cda71[_0x774a('0x16')][_0x774a('0x15')]);}})[_0x774a('0x17')](function(_0x1f7a19){logger[_0x774a('0x13')](_0x774a('0xf'),_0x5149ab,_0x1f7a19);_0x32dc15(_0x1f7a19);});});}exports['CreateSmsQueueReport']=function(_0x2d25c2){var _0x5062a5=this;return new Promise(function(_0x9b515f,_0x576b44){return db[_0x774a('0x18')][_0x774a('0x19')](_0x2d25c2[_0x774a('0x1a')],{'raw':_0x2d25c2['options']?_0x2d25c2[_0x774a('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1008db){logger[_0x774a('0xe')](_0x774a('0x1c'),_0x2d25c2);logger[_0x774a('0x10')]('CreateSmsQueueReport',_0x2d25c2,JSON[_0x774a('0x12')](_0x1008db));_0x9b515f(_0x1008db);})[_0x774a('0x17')](function(_0x42de35){logger[_0x774a('0x13')](_0x774a('0x1c'),_0x42de35[_0x774a('0x15')],_0x2d25c2);_0x576b44(_0x5062a5[_0x774a('0x13')](0x1f4,_0x42de35[_0x774a('0x15')]));});});};exports[_0x774a('0x1d')]=function(_0x48ef55){var _0x479dc4=this;return new Promise(function(_0x161354,_0x36da4a){return db[_0x774a('0x18')][_0x774a('0x1e')](_0x48ef55['body'],{'raw':_0x48ef55['options']?_0x48ef55[_0x774a('0x1b')][_0x774a('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48ef55[_0x774a('0x1b')]?_0x48ef55['options']['where']||null:null,'attributes':_0x48ef55[_0x774a('0x1b')]?_0x48ef55[_0x774a('0x1b')][_0x774a('0x20')]||null:null,'limit':_0x48ef55[_0x774a('0x1b')]?_0x48ef55['options'][_0x774a('0x21')]||null:null})[_0x774a('0xd')](function(_0x4e0e25){logger[_0x774a('0xe')]('UpdateSmsQueueReport',_0x48ef55);logger['debug'](_0x774a('0x1d'),_0x48ef55,JSON['stringify'](_0x4e0e25));_0x161354(_0x4e0e25);})[_0x774a('0x17')](function(_0x1f9b27){logger[_0x774a('0x13')]('UpdateSmsQueueReport',_0x1f9b27['message'],_0x48ef55);_0x36da4a(_0x479dc4[_0x774a('0x13')](0x1f4,_0x1f9b27[_0x774a('0x15')]));});});}; \ No newline at end of file +var _0x13dc=['error','SmsQueueReport,\x20%s,\x20%s','message','result','CreateSmsQueueReport','SmsQueueReport','create','options','raw','stringify','UpdateSmsQueueReport','update','body','attributes','limit','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x4f3084,_0x3b1970){var _0x1b2382=function(_0x4a32e5){while(--_0x4a32e5){_0x4f3084['push'](_0x4f3084['shift']());}};_0x1b2382(++_0x3b1970);}(_0x13dc,0xb0));var _0xc13d=function(_0xbaf0a2,_0x535c10){_0xbaf0a2=_0xbaf0a2-0x0;var _0x3dbe0a=_0x13dc[_0xbaf0a2];return _0x3dbe0a;};'use strict';var _=require('lodash');var util=require(_0xc13d('0x0'));var moment=require(_0xc13d('0x1'));var BPromise=require(_0xc13d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc13d('0x3'))['db'];var utils=require(_0xc13d('0x4'));var logger=require(_0xc13d('0x5'))(_0xc13d('0x6'));var config=require(_0xc13d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc13d('0x8')][_0xc13d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x51a8e0,_0x371d88,_0xa293d0){return new BPromise(function(_0x4ebc56,_0x523b3d){return client[_0xc13d('0xa')](_0x51a8e0,_0xa293d0)[_0xc13d('0xb')](function(_0x4eb3d9){logger[_0xc13d('0xc')]('SmsQueueReport,\x20%s,\x20%s',_0x371d88,_0xc13d('0xd'));logger[_0xc13d('0xe')](_0xc13d('0xf'),_0x371d88,'request\x20sent',JSON['stringify'](_0x4eb3d9));if(_0x4eb3d9[_0xc13d('0x10')]){if(_0x4eb3d9[_0xc13d('0x10')]['code']===0x1f4){logger[_0xc13d('0x10')](_0xc13d('0x11'),_0x371d88,_0x4eb3d9[_0xc13d('0x10')][_0xc13d('0x12')]);return _0x523b3d(_0x4eb3d9['error'][_0xc13d('0x12')]);}logger[_0xc13d('0x10')](_0xc13d('0x11'),_0x371d88,_0x4eb3d9[_0xc13d('0x10')][_0xc13d('0x12')]);return _0x4ebc56(_0x4eb3d9['error'][_0xc13d('0x12')]);}else{logger['info'](_0xc13d('0x11'),_0x371d88,_0xc13d('0xd'));_0x4ebc56(_0x4eb3d9[_0xc13d('0x13')][_0xc13d('0x12')]);}})['catch'](function(_0x3eba79){logger[_0xc13d('0x10')](_0xc13d('0x11'),_0x371d88,_0x3eba79);_0x523b3d(_0x3eba79);});});}exports[_0xc13d('0x14')]=function(_0x573276){var _0x3f9555=this;return new Promise(function(_0x564593,_0x235518){return db[_0xc13d('0x15')][_0xc13d('0x16')](_0x573276['body'],{'raw':_0x573276[_0xc13d('0x17')]?_0x573276[_0xc13d('0x17')][_0xc13d('0x18')]===undefined?!![]:![]:!![]})[_0xc13d('0xb')](function(_0x5a3c5c){logger['info'](_0xc13d('0x14'),_0x573276);logger[_0xc13d('0xe')](_0xc13d('0x14'),_0x573276,JSON[_0xc13d('0x19')](_0x5a3c5c));_0x564593(_0x5a3c5c);})['catch'](function(_0x2a92e2){logger[_0xc13d('0x10')](_0xc13d('0x14'),_0x2a92e2[_0xc13d('0x12')],_0x573276);_0x235518(_0x3f9555[_0xc13d('0x10')](0x1f4,_0x2a92e2[_0xc13d('0x12')]));});});};exports[_0xc13d('0x1a')]=function(_0x46db21){var _0x5ecdf0=this;return new Promise(function(_0x54b56a,_0x3af898){return db[_0xc13d('0x15')][_0xc13d('0x1b')](_0x46db21[_0xc13d('0x1c')],{'raw':_0x46db21['options']?_0x46db21[_0xc13d('0x17')][_0xc13d('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46db21[_0xc13d('0x17')]?_0x46db21['options']['where']||null:null,'attributes':_0x46db21[_0xc13d('0x17')]?_0x46db21['options'][_0xc13d('0x1d')]||null:null,'limit':_0x46db21['options']?_0x46db21['options'][_0xc13d('0x1e')]||null:null})['then'](function(_0x419bf9){logger[_0xc13d('0xc')](_0xc13d('0x1a'),_0x46db21);logger[_0xc13d('0xe')](_0xc13d('0x1a'),_0x46db21,JSON[_0xc13d('0x19')](_0x419bf9));_0x54b56a(_0x419bf9);})[_0xc13d('0x1f')](function(_0x5f735a){logger[_0xc13d('0x10')](_0xc13d('0x1a'),_0x5f735a[_0xc13d('0x12')],_0x46db21);_0x3af898(_0x5ecdf0['error'](0x1f4,_0x5f735a[_0xc13d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 3e9ed68..c5a3f78 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 _0xe015=['../../components/interaction/service','../../config/environment','./smsTransferReport.controller','isAuthenticated','index','describe','get','/:id','show','put','update','multer','util','path','Router','../../components/auth/service'];(function(_0x401279,_0x523274){var _0x3a757f=function(_0x2a0840){while(--_0x2a0840){_0x401279['push'](_0x401279['shift']());}};_0x3a757f(++_0x523274);}(_0xe015,0x13b));var _0x5e01=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xe015[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0x5e01('0x0'));var util=require(_0x5e01('0x1'));var path=require(_0x5e01('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5e01('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5e01('0x4'));var interaction=require(_0x5e01('0x5'));var config=require(_0x5e01('0x6'));var controller=require(_0x5e01('0x7'));router['get']('/',auth[_0x5e01('0x8')](),controller[_0x5e01('0x9')]);router['get']('/describe',auth[_0x5e01('0x8')](),controller[_0x5e01('0xa')]);router[_0x5e01('0xb')](_0x5e01('0xc'),auth[_0x5e01('0x8')](),controller[_0x5e01('0xd')]);router['post']('/',auth[_0x5e01('0x8')](),controller['create']);router[_0x5e01('0xe')]('/:id',auth[_0x5e01('0x8')](),controller[_0x5e01('0xf')]);router['delete'](_0x5e01('0xc'),auth[_0x5e01('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8d0a=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','isAuthenticated','index','get','/describe','/:id','create','update','delete','destroy'];(function(_0x118aec,_0x140802){var _0x4e092c=function(_0xaed8ca){while(--_0xaed8ca){_0x118aec['push'](_0x118aec['shift']());}};_0x4e092c(++_0x140802);}(_0x8d0a,0x65));var _0xa8d0=function(_0x4dc003,_0x3d2b4c){_0x4dc003=_0x4dc003-0x0;var _0x45a300=_0x8d0a[_0x4dc003];return _0x45a300;};'use strict';var multer=require(_0xa8d0('0x0'));var util=require('util');var path=require(_0xa8d0('0x1'));var timeout=require(_0xa8d0('0x2'));var express=require(_0xa8d0('0x3'));var router=express[_0xa8d0('0x4')]();var fs_extra=require(_0xa8d0('0x5'));var auth=require(_0xa8d0('0x6'));var interaction=require(_0xa8d0('0x7'));var config=require(_0xa8d0('0x8'));var controller=require(_0xa8d0('0x9'));router['get']('/',auth[_0xa8d0('0xa')](),controller[_0xa8d0('0xb')]);router[_0xa8d0('0xc')](_0xa8d0('0xd'),auth[_0xa8d0('0xa')](),controller['describe']);router['get'](_0xa8d0('0xe'),auth[_0xa8d0('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xa8d0('0xf')]);router['put'](_0xa8d0('0xe'),auth[_0xa8d0('0xa')](),controller[_0xa8d0('0x10')]);router[_0xa8d0('0x11')](_0xa8d0('0xe'),auth[_0xa8d0('0xa')](),controller[_0xa8d0('0x12')]);module[_0xa8d0('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 f62e993..36a33f6 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x3ac7bb,_0x1a5fa3){var _0x55d2e0=function(_0x14005d){while(--_0x14005d){_0x3ac7bb['push'](_0x3ac7bb['shift']());}};_0x55d2e0(++_0x1a5fa3);}(_0xf4eb,0xec));var _0xbf4e=function(_0x8a2e4a,_0x2a5b26){_0x8a2e4a=_0x8a2e4a-0x0;var _0xa34bc0=_0xf4eb[_0x8a2e4a];return _0xa34bc0;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file +var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0xa8239e,_0x44870d){var _0x4bd850=function(_0x7f24f6){while(--_0x7f24f6){_0xa8239e['push'](_0xa8239e['shift']());}};_0x4bd850(++_0x44870d);}(_0x00bb,0x1d8));var _0xb00b=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x00bb[_0x2bf141];return _0x48277b;};'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/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 8601d4d..7a478e9 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 _0x50fe=['catch','show','params','keys','length','include','find','create','body','describe','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','ioredis','../../components/auth/service','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','type','key','model','query','attributes','intersection','fields','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll'];(function(_0x407594,_0x41e55d){var _0x4601e8=function(_0x5edb75){while(--_0x5edb75){_0x407594['push'](_0x407594['shift']());}};_0x4601e8(++_0x41e55d);}(_0x50fe,0x116));var _0xe50f=function(_0x353ada,_0x12ae05){_0x353ada=_0x353ada-0x0;var _0x28ae90=_0x50fe[_0x353ada];return _0x28ae90;};'use strict';var emlformat=require(_0xe50f('0x0'));var rimraf=require(_0xe50f('0x1'));var zipdir=require(_0xe50f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe50f('0x3'));var BPromise=require(_0xe50f('0x4'));var Mustache=require('mustache');var util=require(_0xe50f('0x5'));var path=require(_0xe50f('0x6'));var sox=require(_0xe50f('0x7'));var csv=require(_0xe50f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe50f('0x9'));var _=require(_0xe50f('0xa'));var squel=require('squel');var crypto=require(_0xe50f('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe50f('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe50f('0xc'));var authService=require(_0xe50f('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe50f('0xe'))(_0xe50f('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe50f('0x10'))['db'];function respondWithStatusCode(_0x16650c,_0x409f1e){_0x409f1e=_0x409f1e||0xcc;return function(_0xf09b35){if(_0xf09b35){return _0x16650c[_0xe50f('0x11')](_0x409f1e);}return _0x16650c[_0xe50f('0x12')](_0x409f1e)[_0xe50f('0x13')]();};}function respondWithResult(_0x22556f,_0x37be54){_0x37be54=_0x37be54||0xc8;return function(_0x643c6){if(_0x643c6){return _0x22556f[_0xe50f('0x12')](_0x37be54)[_0xe50f('0x14')](_0x643c6);}};}function respondWithFilteredResult(_0x391f48,_0x1e9ad2){return function(_0x1aa490){if(_0x1aa490){var _0x421c91=typeof _0x1e9ad2['offset']===_0xe50f('0x15')&&typeof _0x1e9ad2['limit']==='undefined';var _0x2938e1=_0x1aa490[_0xe50f('0x16')];var _0x1fa112=_0x421c91?0x0:_0x1e9ad2[_0xe50f('0x17')];var _0x3e4c2b=_0x421c91?_0x1aa490[_0xe50f('0x16')]:_0x1e9ad2[_0xe50f('0x17')]+_0x1e9ad2[_0xe50f('0x18')];var _0x4655c2;if(_0x3e4c2b>=_0x2938e1){_0x3e4c2b=_0x2938e1;_0x4655c2=0xc8;}else{_0x4655c2=0xce;}_0x391f48[_0xe50f('0x12')](_0x4655c2);return _0x391f48['set'](_0xe50f('0x19'),_0x1fa112+'-'+_0x3e4c2b+'/'+_0x2938e1)[_0xe50f('0x14')](_0x1aa490);}return null;};}function patchUpdates(_0x486c41){return function(_0x560ee7){try{jsonpatch[_0xe50f('0x1a')](_0x560ee7,_0x486c41,!![]);}catch(_0x118faf){return BPromise[_0xe50f('0x1b')](_0x118faf);}return _0x560ee7['save']();};}function saveUpdates(_0x3ab2fd,_0x250496){return function(_0x2561e0){if(_0x2561e0){return _0x2561e0[_0xe50f('0x1c')](_0x3ab2fd)[_0xe50f('0x1d')](function(_0x3bb8d4){return _0x3bb8d4;});}return null;};}function removeEntity(_0x22c6f2,_0x3fd720){return function(_0x14e1ae){if(_0x14e1ae){return _0x14e1ae[_0xe50f('0x1e')]()[_0xe50f('0x1d')](function(){_0x22c6f2[_0xe50f('0x12')](0xcc)[_0xe50f('0x13')]();});}};}function handleEntityNotFound(_0x5deeef,_0x34abe6){return function(_0x4ef155){if(!_0x4ef155){_0x5deeef[_0xe50f('0x11')](0x194);}return _0x4ef155;};}function handleError(_0xe0ee0b,_0x116e8c){_0x116e8c=_0x116e8c||0x1f4;return function(_0x595154){logger[_0xe50f('0x1f')](_0x595154[_0xe50f('0x20')]);if(_0x595154[_0xe50f('0x21')]){delete _0x595154[_0xe50f('0x21')];}_0xe0ee0b[_0xe50f('0x12')](_0x116e8c)[_0xe50f('0x22')](_0x595154);};}exports[_0xe50f('0x23')]=function(_0x354fb1,_0x42363b){var _0x279a6d={},_0x5567d8={},_0x23103e={'count':0x0,'rows':[]};var _0x167b3f=_[_0xe50f('0x24')](db[_0xe50f('0x25')][_0xe50f('0x26')],function(_0x2de04d){return{'name':_0x2de04d['fieldName'],'type':_0x2de04d[_0xe50f('0x27')][_0xe50f('0x28')]};});_0x5567d8[_0xe50f('0x29')]=_['map'](_0x167b3f,'name');_0x5567d8[_0xe50f('0x2a')]=_['keys'](_0x354fb1[_0xe50f('0x2a')]);_0x5567d8['filters']=_['intersection'](_0x5567d8[_0xe50f('0x29')],_0x5567d8['query']);_0x279a6d[_0xe50f('0x2b')]=_[_0xe50f('0x2c')](_0x5567d8[_0xe50f('0x29')],qs['fields'](_0x354fb1[_0xe50f('0x2a')][_0xe50f('0x2d')]));_0x279a6d['attributes']=_0x279a6d['attributes']['length']?_0x279a6d[_0xe50f('0x2b')]:_0x5567d8[_0xe50f('0x29')];if(!_0x354fb1[_0xe50f('0x2a')]['hasOwnProperty']('nolimit')){_0x279a6d[_0xe50f('0x18')]=qs[_0xe50f('0x18')](_0x354fb1[_0xe50f('0x2a')]['limit']);_0x279a6d[_0xe50f('0x17')]=qs['offset'](_0x354fb1[_0xe50f('0x2a')][_0xe50f('0x17')]);}_0x279a6d[_0xe50f('0x2e')]=qs['sort'](_0x354fb1[_0xe50f('0x2a')][_0xe50f('0x2f')]);_0x279a6d[_0xe50f('0x30')]=qs[_0xe50f('0x31')](_[_0xe50f('0x32')](_0x354fb1['query'],_0x5567d8[_0xe50f('0x31')]),_0x167b3f);if(_0x354fb1[_0xe50f('0x2a')][_0xe50f('0x33')]){_0x279a6d['where']=_[_0xe50f('0x34')](_0x279a6d[_0xe50f('0x30')],{'$or':_['map'](_0x167b3f,function(_0x2871b6){if(_0x2871b6['type']!==_0xe50f('0x35')){var _0x3edd0f={};_0x3edd0f[_0x2871b6[_0xe50f('0x21')]]={'$like':'%'+_0x354fb1[_0xe50f('0x2a')][_0xe50f('0x33')]+'%'};return _0x3edd0f;}})});}_0x279a6d=_['merge']({},_0x279a6d,_0x354fb1[_0xe50f('0x36')]);var _0x187386={'where':_0x279a6d[_0xe50f('0x30')]};return db[_0xe50f('0x25')][_0xe50f('0x16')](_0x187386)['then'](function(_0x365638){_0x23103e['count']=_0x365638;if(_0x354fb1['query'][_0xe50f('0x37')]){_0x279a6d['include']=[{'all':!![]}];}return db[_0xe50f('0x25')][_0xe50f('0x38')](_0x279a6d);})['then'](function(_0x4a8ff9){_0x23103e['rows']=_0x4a8ff9;return _0x23103e;})[_0xe50f('0x1d')](respondWithFilteredResult(_0x42363b,_0x279a6d))[_0xe50f('0x39')](handleError(_0x42363b,null));};exports[_0xe50f('0x3a')]=function(_0x121515,_0x2e8328){var _0x39d59d={'raw':!![],'where':{'id':_0x121515[_0xe50f('0x3b')]['id']}},_0x126458={};_0x126458[_0xe50f('0x29')]=_[_0xe50f('0x3c')](db['SmsTransferReport']['rawAttributes']);_0x126458['query']=_[_0xe50f('0x3c')](_0x121515[_0xe50f('0x2a')]);_0x126458['filters']=_[_0xe50f('0x2c')](_0x126458[_0xe50f('0x29')],_0x126458['query']);_0x39d59d[_0xe50f('0x2b')]=_['intersection'](_0x126458['model'],qs[_0xe50f('0x2d')](_0x121515[_0xe50f('0x2a')][_0xe50f('0x2d')]));_0x39d59d['attributes']=_0x39d59d['attributes'][_0xe50f('0x3d')]?_0x39d59d[_0xe50f('0x2b')]:_0x126458['model'];if(_0x121515[_0xe50f('0x2a')][_0xe50f('0x37')]){_0x39d59d[_0xe50f('0x3e')]=[{'all':!![]}];}_0x39d59d=_[_0xe50f('0x34')]({},_0x39d59d,_0x121515['options']);return db[_0xe50f('0x25')][_0xe50f('0x3f')](_0x39d59d)[_0xe50f('0x1d')](handleEntityNotFound(_0x2e8328,null))['then'](respondWithResult(_0x2e8328,null))[_0xe50f('0x39')](handleError(_0x2e8328,null));};exports[_0xe50f('0x40')]=function(_0x22c27f,_0x621bc5){return db['SmsTransferReport']['create'](_0x22c27f[_0xe50f('0x41')],{})[_0xe50f('0x1d')](respondWithResult(_0x621bc5,0xc9))[_0xe50f('0x39')](handleError(_0x621bc5,null));};exports['update']=function(_0x543507,_0x385dfd){if(_0x543507[_0xe50f('0x41')]['id']){delete _0x543507[_0xe50f('0x41')]['id'];}return db['SmsTransferReport'][_0xe50f('0x3f')]({'where':{'id':_0x543507[_0xe50f('0x3b')]['id']}})[_0xe50f('0x1d')](handleEntityNotFound(_0x385dfd,null))[_0xe50f('0x1d')](saveUpdates(_0x543507['body'],null))['then'](respondWithResult(_0x385dfd,null))[_0xe50f('0x39')](handleError(_0x385dfd,null));};exports[_0xe50f('0x1e')]=function(_0x16e4fb,_0x19590a){return db[_0xe50f('0x25')][_0xe50f('0x3f')]({'where':{'id':_0x16e4fb['params']['id']}})['then'](handleEntityNotFound(_0x19590a,null))[_0xe50f('0x1d')](removeEntity(_0x19590a,null))['catch'](handleError(_0x19590a,null));};exports[_0xe50f('0x42')]=function(_0x43926d,_0x4b7d38){return db[_0xe50f('0x25')][_0xe50f('0x42')]()[_0xe50f('0x1d')](respondWithResult(_0x4b7d38,null))['catch'](handleError(_0x4b7d38,null));}; \ No newline at end of file +var _0x13ec=['update','destroy','then','sendStatus','error','stack','name','send','index','SmsTransferReport','rawAttributes','type','key','model','map','query','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','keys','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save'];(function(_0x4c9381,_0x3df6e1){var _0x3e593a=function(_0x2ff57c){while(--_0x2ff57c){_0x4c9381['push'](_0x4c9381['shift']());}};_0x3e593a(++_0x3df6e1);}(_0x13ec,0x15c));var _0xc13e=function(_0x2a656f,_0x1565bb){_0x2a656f=_0x2a656f-0x0;var _0xff9a92=_0x13ec[_0x2a656f];return _0xff9a92;};'use strict';var emlformat=require(_0xc13e('0x0'));var rimraf=require(_0xc13e('0x1'));var zipdir=require(_0xc13e('0x2'));var jsonpatch=require(_0xc13e('0x3'));var rp=require('request-promise');var moment=require(_0xc13e('0x4'));var BPromise=require(_0xc13e('0x5'));var Mustache=require(_0xc13e('0x6'));var util=require(_0xc13e('0x7'));var path=require(_0xc13e('0x8'));var sox=require(_0xc13e('0x9'));var csv=require(_0xc13e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc13e('0xb'));var _=require(_0xc13e('0xc'));var squel=require(_0xc13e('0xd'));var crypto=require(_0xc13e('0xe'));var jsforce=require(_0xc13e('0xf'));var deskjs=require(_0xc13e('0x10'));var toCsv=require('to-csv');var querystring=require(_0xc13e('0x11'));var Papa=require('papaparse');var Redis=require(_0xc13e('0x12'));var authService=require(_0xc13e('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc13e('0x14'));var logger=require(_0xc13e('0x15'))('api');var utils=require(_0xc13e('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xc13e('0x17'));var db=require(_0xc13e('0x18'))['db'];function respondWithStatusCode(_0x366b1c,_0x891171){_0x891171=_0x891171||0xcc;return function(_0x5c838e){if(_0x5c838e){return _0x366b1c['sendStatus'](_0x891171);}return _0x366b1c['status'](_0x891171)[_0xc13e('0x19')]();};}function respondWithResult(_0x30dc77,_0x8673bc){_0x8673bc=_0x8673bc||0xc8;return function(_0x58bea0){if(_0x58bea0){return _0x30dc77[_0xc13e('0x1a')](_0x8673bc)['json'](_0x58bea0);}};}function respondWithFilteredResult(_0x3eb84e,_0x171cd5){return function(_0x171802){if(_0x171802){var _0x4fe7dd=typeof _0x171cd5['offset']===_0xc13e('0x1b')&&typeof _0x171cd5[_0xc13e('0x1c')]==='undefined';var _0x352ff8=_0x171802['count'];var _0x1f644b=_0x4fe7dd?0x0:_0x171cd5[_0xc13e('0x1d')];var _0x2f6d70=_0x4fe7dd?_0x171802[_0xc13e('0x1e')]:_0x171cd5[_0xc13e('0x1d')]+_0x171cd5[_0xc13e('0x1c')];var _0x5a41d2;if(_0x2f6d70>=_0x352ff8){_0x2f6d70=_0x352ff8;_0x5a41d2=0xc8;}else{_0x5a41d2=0xce;}_0x3eb84e[_0xc13e('0x1a')](_0x5a41d2);return _0x3eb84e[_0xc13e('0x1f')](_0xc13e('0x20'),_0x1f644b+'-'+_0x2f6d70+'/'+_0x352ff8)[_0xc13e('0x21')](_0x171802);}return null;};}function patchUpdates(_0x54c0a8){return function(_0x13ced0){try{jsonpatch[_0xc13e('0x22')](_0x13ced0,_0x54c0a8,!![]);}catch(_0x3f1fdb){return BPromise[_0xc13e('0x23')](_0x3f1fdb);}return _0x13ced0[_0xc13e('0x24')]();};}function saveUpdates(_0x1ea4f8,_0x3ef298){return function(_0x128ff3){if(_0x128ff3){return _0x128ff3[_0xc13e('0x25')](_0x1ea4f8)['then'](function(_0x5c2391){return _0x5c2391;});}return null;};}function removeEntity(_0x37d70f,_0x54e14f){return function(_0x172ec2){if(_0x172ec2){return _0x172ec2[_0xc13e('0x26')]()[_0xc13e('0x27')](function(){_0x37d70f[_0xc13e('0x1a')](0xcc)[_0xc13e('0x19')]();});}};}function handleEntityNotFound(_0x3e6c60,_0x15e7eb){return function(_0x7b7d1c){if(!_0x7b7d1c){_0x3e6c60[_0xc13e('0x28')](0x194);}return _0x7b7d1c;};}function handleError(_0x20387f,_0x18ab5b){_0x18ab5b=_0x18ab5b||0x1f4;return function(_0x402c59){logger[_0xc13e('0x29')](_0x402c59[_0xc13e('0x2a')]);if(_0x402c59[_0xc13e('0x2b')]){delete _0x402c59['name'];}_0x20387f[_0xc13e('0x1a')](_0x18ab5b)[_0xc13e('0x2c')](_0x402c59);};}exports[_0xc13e('0x2d')]=function(_0xec5f13,_0x4028fc){var _0x6a5428={},_0x1bdb86={},_0x269318={'count':0x0,'rows':[]};var _0x198028=_['map'](db[_0xc13e('0x2e')][_0xc13e('0x2f')],function(_0x46c5b0){return{'name':_0x46c5b0['fieldName'],'type':_0x46c5b0[_0xc13e('0x30')][_0xc13e('0x31')]};});_0x1bdb86[_0xc13e('0x32')]=_[_0xc13e('0x33')](_0x198028,'name');_0x1bdb86[_0xc13e('0x34')]=_['keys'](_0xec5f13['query']);_0x1bdb86[_0xc13e('0x35')]=_['intersection'](_0x1bdb86['model'],_0x1bdb86[_0xc13e('0x34')]);_0x6a5428['attributes']=_[_0xc13e('0x36')](_0x1bdb86[_0xc13e('0x32')],qs[_0xc13e('0x37')](_0xec5f13['query'][_0xc13e('0x37')]));_0x6a5428[_0xc13e('0x38')]=_0x6a5428['attributes']['length']?_0x6a5428['attributes']:_0x1bdb86[_0xc13e('0x32')];if(!_0xec5f13['query']['hasOwnProperty'](_0xc13e('0x39'))){_0x6a5428[_0xc13e('0x1c')]=qs[_0xc13e('0x1c')](_0xec5f13[_0xc13e('0x34')][_0xc13e('0x1c')]);_0x6a5428[_0xc13e('0x1d')]=qs[_0xc13e('0x1d')](_0xec5f13['query']['offset']);}_0x6a5428[_0xc13e('0x3a')]=qs[_0xc13e('0x3b')](_0xec5f13['query'][_0xc13e('0x3b')]);_0x6a5428[_0xc13e('0x3c')]=qs[_0xc13e('0x35')](_[_0xc13e('0x3d')](_0xec5f13[_0xc13e('0x34')],_0x1bdb86['filters']),_0x198028);if(_0xec5f13[_0xc13e('0x34')][_0xc13e('0x3e')]){_0x6a5428['where']=_[_0xc13e('0x3f')](_0x6a5428[_0xc13e('0x3c')],{'$or':_['map'](_0x198028,function(_0x568bd8){if(_0x568bd8[_0xc13e('0x30')]!==_0xc13e('0x40')){var _0xbe6958={};_0xbe6958[_0x568bd8[_0xc13e('0x2b')]]={'$like':'%'+_0xec5f13[_0xc13e('0x34')][_0xc13e('0x3e')]+'%'};return _0xbe6958;}})});}_0x6a5428=_[_0xc13e('0x3f')]({},_0x6a5428,_0xec5f13[_0xc13e('0x41')]);var _0x1472c1={'where':_0x6a5428[_0xc13e('0x3c')]};return db[_0xc13e('0x2e')][_0xc13e('0x1e')](_0x1472c1)[_0xc13e('0x27')](function(_0x313f4b){_0x269318[_0xc13e('0x1e')]=_0x313f4b;if(_0xec5f13[_0xc13e('0x34')][_0xc13e('0x42')]){_0x6a5428[_0xc13e('0x43')]=[{'all':!![]}];}return db[_0xc13e('0x2e')]['findAll'](_0x6a5428);})[_0xc13e('0x27')](function(_0x18c8fc){_0x269318[_0xc13e('0x44')]=_0x18c8fc;return _0x269318;})[_0xc13e('0x27')](respondWithFilteredResult(_0x4028fc,_0x6a5428))[_0xc13e('0x45')](handleError(_0x4028fc,null));};exports['show']=function(_0x52f89e,_0x59e37a){var _0x159972={'raw':!![],'where':{'id':_0x52f89e[_0xc13e('0x46')]['id']}},_0x2524d5={};_0x2524d5[_0xc13e('0x32')]=_[_0xc13e('0x47')](db[_0xc13e('0x2e')]['rawAttributes']);_0x2524d5[_0xc13e('0x34')]=_['keys'](_0x52f89e['query']);_0x2524d5[_0xc13e('0x35')]=_[_0xc13e('0x36')](_0x2524d5[_0xc13e('0x32')],_0x2524d5[_0xc13e('0x34')]);_0x159972['attributes']=_[_0xc13e('0x36')](_0x2524d5[_0xc13e('0x32')],qs[_0xc13e('0x37')](_0x52f89e[_0xc13e('0x34')][_0xc13e('0x37')]));_0x159972['attributes']=_0x159972['attributes'][_0xc13e('0x48')]?_0x159972[_0xc13e('0x38')]:_0x2524d5['model'];if(_0x52f89e[_0xc13e('0x34')][_0xc13e('0x42')]){_0x159972[_0xc13e('0x43')]=[{'all':!![]}];}_0x159972=_[_0xc13e('0x3f')]({},_0x159972,_0x52f89e[_0xc13e('0x41')]);return db[_0xc13e('0x2e')][_0xc13e('0x49')](_0x159972)[_0xc13e('0x27')](handleEntityNotFound(_0x59e37a,null))[_0xc13e('0x27')](respondWithResult(_0x59e37a,null))['catch'](handleError(_0x59e37a,null));};exports[_0xc13e('0x4a')]=function(_0x56a40b,_0x3927eb){return db['SmsTransferReport']['create'](_0x56a40b[_0xc13e('0x4b')],{})[_0xc13e('0x27')](respondWithResult(_0x3927eb,0xc9))['catch'](handleError(_0x3927eb,null));};exports['update']=function(_0x108441,_0x4252ac){if(_0x108441[_0xc13e('0x4b')]['id']){delete _0x108441[_0xc13e('0x4b')]['id'];}return db[_0xc13e('0x2e')][_0xc13e('0x49')]({'where':{'id':_0x108441[_0xc13e('0x46')]['id']}})['then'](handleEntityNotFound(_0x4252ac,null))[_0xc13e('0x27')](saveUpdates(_0x108441[_0xc13e('0x4b')],null))[_0xc13e('0x27')](respondWithResult(_0x4252ac,null))['catch'](handleError(_0x4252ac,null));};exports[_0xc13e('0x26')]=function(_0x35d903,_0x11a97d){return db[_0xc13e('0x2e')][_0xc13e('0x49')]({'where':{'id':_0x35d903[_0xc13e('0x46')]['id']}})[_0xc13e('0x27')](handleEntityNotFound(_0x11a97d,null))[_0xc13e('0x27')](removeEntity(_0x11a97d,null))['catch'](handleError(_0x11a97d,null));};exports[_0xc13e('0x4c')]=function(_0xa90fc,_0x13e833){return db[_0xc13e('0x2e')][_0xc13e('0x4c')]()[_0xc13e('0x27')](respondWithResult(_0x13e833,null))['catch'](handleError(_0x13e833,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 10d25a9..575a2cc 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 _0xb2af=['define','report_sms_transfer','uniqueid','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb2af,0x137));var _0xfb2a=function(_0x4778c7,_0x948cd9){_0x4778c7=_0x4778c7-0x0;var _0x179490=_0xb2af[_0x4778c7];return _0x179490;};'use strict';var _=require('lodash');var util=require(_0xfb2a('0x0'));var logger=require('../../config/logger')(_0xfb2a('0x1'));var moment=require(_0xfb2a('0x2'));var BPromise=require(_0xfb2a('0x3'));var rp=require(_0xfb2a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfb2a('0x5'));var config=require(_0xfb2a('0x6'));var attributes=require('./smsTransferReport.attributes');module[_0xfb2a('0x7')]=function(_0x5532ca,_0x2713a8){return _0x5532ca[_0xfb2a('0x8')]('SmsTransferReport',attributes,{'tableName':_0xfb2a('0x9'),'paranoid':![],'indexes':[{'name':_0xfb2a('0xa'),'fields':[_0xfb2a('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x968b=['rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x1497b5,_0x4c72df){var _0x3080af=function(_0x2fdf75){while(--_0x2fdf75){_0x1497b5['push'](_0x1497b5['shift']());}};_0x3080af(++_0x4c72df);}(_0x968b,0x8f));var _0xb968=function(_0x4e0c67,_0x5bc8e3){_0x4e0c67=_0x4e0c67-0x0;var _0x3455e5=_0x968b[_0x4e0c67];return _0x3455e5;};'use strict';var _=require(_0xb968('0x0'));var util=require(_0xb968('0x1'));var logger=require(_0xb968('0x2'))(_0xb968('0x3'));var moment=require('moment');var BPromise=require(_0xb968('0x4'));var rp=require(_0xb968('0x5'));var fs=require('fs');var path=require(_0xb968('0x6'));var rimraf=require(_0xb968('0x7'));var config=require(_0xb968('0x8'));var attributes=require(_0xb968('0x9'));module[_0xb968('0xa')]=function(_0x482e8d,_0x4c0d59){return _0x482e8d[_0xb968('0xb')](_0xb968('0xc'),attributes,{'tableName':_0xb968('0xd'),'paranoid':![],'indexes':[{'name':_0xb968('0xe'),'fields':[_0xb968('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 61eedc6..8792661 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 _0x9efe=['code','SmsTransferReport,\x20%s,\x20%s','message','info','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xb2ddf3,_0x368a91){var _0x40822e=function(_0x2f4fd1){while(--_0x2f4fd1){_0xb2ddf3['push'](_0xb2ddf3['shift']());}};_0x40822e(++_0x368a91);}(_0x9efe,0xca));var _0xe9ef=function(_0x136492,_0x701cf4){_0x136492=_0x136492-0x0;var _0x1f0083=_0x9efe[_0x136492];return _0x1f0083;};'use strict';var _=require('lodash');var util=require(_0xe9ef('0x0'));var moment=require(_0xe9ef('0x1'));var BPromise=require(_0xe9ef('0x2'));var rs=require(_0xe9ef('0x3'));var fs=require('fs');var Redis=require(_0xe9ef('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe9ef('0x5'));var logger=require(_0xe9ef('0x6'))(_0xe9ef('0x7'));var config=require(_0xe9ef('0x8'));var jayson=require(_0xe9ef('0x9'));var client=jayson[_0xe9ef('0xa')][_0xe9ef('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x58d664,_0x47df46,_0x590cea){return new BPromise(function(_0x40ffdc,_0x2f7280){return client[_0xe9ef('0xc')](_0x58d664,_0x590cea)['then'](function(_0x51b634){logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x47df46,_0xe9ef('0xd'));logger[_0xe9ef('0xe')](_0xe9ef('0xf'),_0x47df46,'request\x20sent',JSON[_0xe9ef('0x10')](_0x51b634));if(_0x51b634[_0xe9ef('0x11')]){if(_0x51b634[_0xe9ef('0x11')][_0xe9ef('0x12')]===0x1f4){logger[_0xe9ef('0x11')](_0xe9ef('0x13'),_0x47df46,_0x51b634['error'][_0xe9ef('0x14')]);return _0x2f7280(_0x51b634[_0xe9ef('0x11')][_0xe9ef('0x14')]);}logger[_0xe9ef('0x11')](_0xe9ef('0x13'),_0x47df46,_0x51b634['error'][_0xe9ef('0x14')]);return _0x40ffdc(_0x51b634[_0xe9ef('0x11')][_0xe9ef('0x14')]);}else{logger[_0xe9ef('0x15')](_0xe9ef('0x13'),_0x47df46,'request\x20sent');_0x40ffdc(_0x51b634['result'][_0xe9ef('0x14')]);}})['catch'](function(_0x8ed5e3){logger[_0xe9ef('0x11')](_0xe9ef('0x13'),_0x47df46,_0x8ed5e3);_0x2f7280(_0x8ed5e3);});});} \ No newline at end of file +var _0x032e=['code','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x522011,_0x5ac458){var _0x223844=function(_0x3c9ea5){while(--_0x3c9ea5){_0x522011['push'](_0x522011['shift']());}};_0x223844(++_0x5ac458);}(_0x032e,0x124));var _0xe032=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x032e[_0x3054be];return _0x3df150;};'use strict';var _=require(_0xe032('0x0'));var util=require('util');var moment=require(_0xe032('0x1'));var BPromise=require(_0xe032('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe032('0x3'))['db'];var utils=require(_0xe032('0x4'));var logger=require(_0xe032('0x5'))(_0xe032('0x6'));var config=require(_0xe032('0x7'));var jayson=require(_0xe032('0x8'));var client=jayson[_0xe032('0x9')][_0xe032('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37432f,_0x1576c8,_0x3289b0){return new BPromise(function(_0xd84027,_0xaf3907){return client[_0xe032('0xb')](_0x37432f,_0x3289b0)[_0xe032('0xc')](function(_0x2d8a14){logger[_0xe032('0xd')](_0xe032('0xe'),_0x1576c8,'request\x20sent');logger[_0xe032('0xf')](_0xe032('0x10'),_0x1576c8,_0xe032('0x11'),JSON[_0xe032('0x12')](_0x2d8a14));if(_0x2d8a14[_0xe032('0x13')]){if(_0x2d8a14[_0xe032('0x13')][_0xe032('0x14')]===0x1f4){logger['error'](_0xe032('0xe'),_0x1576c8,_0x2d8a14[_0xe032('0x13')][_0xe032('0x15')]);return _0xaf3907(_0x2d8a14[_0xe032('0x13')]['message']);}logger[_0xe032('0x13')](_0xe032('0xe'),_0x1576c8,_0x2d8a14[_0xe032('0x13')][_0xe032('0x15')]);return _0xd84027(_0x2d8a14[_0xe032('0x13')][_0xe032('0x15')]);}else{logger[_0xe032('0xd')]('SmsTransferReport,\x20%s,\x20%s',_0x1576c8,_0xe032('0x11'));_0xd84027(_0x2d8a14[_0xe032('0x16')][_0xe032('0x15')]);}})[_0xe032('0x17')](function(_0x1938c4){logger[_0xe032('0x13')]('SmsTransferReport,\x20%s,\x20%s',_0x1576c8,_0x1938c4);_0xaf3907(_0x1938c4);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index d593ca2..3d87279 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 _0xbefa=['single','file','create','put','update','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','/:id/download','download','root','originalname','replace','format','%s-%s%s','basename','extname','post'];(function(_0x16771d,_0x224c60){var _0x386f11=function(_0x3d7a87){while(--_0x3d7a87){_0x16771d['push'](_0x16771d['shift']());}};_0x386f11(++_0x224c60);}(_0xbefa,0x1d7));var _0xabef=function(_0x33f2a0,_0x4da9d6){_0x33f2a0=_0x33f2a0-0x0;var _0x274a0a=_0xbefa[_0x33f2a0];return _0x274a0a;};'use strict';var multer=require(_0xabef('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xabef('0x1'));var express=require(_0xabef('0x2'));var router=express[_0xabef('0x3')]();var fs_extra=require(_0xabef('0x4'));var auth=require(_0xabef('0x5'));var interaction=require(_0xabef('0x6'));var config=require(_0xabef('0x7'));var controller=require('./sound.controller');router[_0xabef('0x8')]('/',auth['isAuthenticated'](),controller[_0xabef('0x9')]);router['get'](_0xabef('0xa'),auth[_0xabef('0xb')](),controller['show']);router[_0xabef('0x8')](_0xabef('0xc'),auth[_0xabef('0xb')](),controller[_0xabef('0xd')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3c75f1,_0x1e0980,_0x54ac11){_0x54ac11(null,path['join'](config[_0xabef('0xe')],'server/files/sounds/original/'));},'filename':function(_0x2c2264,_0x3180de,_0x26b23a){_0x3180de[_0xabef('0xf')]=_0x3180de[_0xabef('0xf')][_0xabef('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x26b23a(null,util[_0xabef('0x11')](_0xabef('0x12'),path[_0xabef('0x13')](_0x3180de[_0xabef('0xf')],path[_0xabef('0x14')](_0x3180de[_0xabef('0xf')])),Date['now'](),path[_0xabef('0x14')](_0x3180de[_0xabef('0xf')])));}})});router[_0xabef('0x15')]('/',upload[_0xabef('0x16')](_0xabef('0x17')),controller[_0xabef('0x18')]);router[_0xabef('0x19')]('/:id',auth[_0xabef('0xb')](),controller[_0xabef('0x1a')]);router['delete'](_0xabef('0xa'),auth[_0xabef('0xb')](),controller[_0xabef('0x1b')]);module[_0xabef('0x1c')]=router; \ No newline at end of file +var _0xe72a=['create','update','delete','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','isAuthenticated','index','/:id','show','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','basename','extname','now','post','file'];(function(_0xd4dfd4,_0x1f5f15){var _0x5d72c3=function(_0x4316d6){while(--_0x4316d6){_0xd4dfd4['push'](_0xd4dfd4['shift']());}};_0x5d72c3(++_0x1f5f15);}(_0xe72a,0x1d3));var _0xae72=function(_0x113bd3,_0x121252){_0x113bd3=_0x113bd3-0x0;var _0x5b15ac=_0xe72a[_0x113bd3];return _0x5b15ac;};'use strict';var multer=require(_0xae72('0x0'));var util=require(_0xae72('0x1'));var path=require(_0xae72('0x2'));var timeout=require('connect-timeout');var express=require(_0xae72('0x3'));var router=express['Router']();var fs_extra=require(_0xae72('0x4'));var auth=require(_0xae72('0x5'));var interaction=require(_0xae72('0x6'));var config=require(_0xae72('0x7'));var controller=require(_0xae72('0x8'));router['get']('/',auth[_0xae72('0x9')](),controller[_0xae72('0xa')]);router['get'](_0xae72('0xb'),auth[_0xae72('0x9')](),controller[_0xae72('0xc')]);router['get']('/:id/download',auth[_0xae72('0x9')](),controller[_0xae72('0xd')]);var upload=multer({'storage':multer[_0xae72('0xe')]({'destination':function(_0x1af966,_0x37d9d9,_0x22fb07){_0x22fb07(null,path[_0xae72('0xf')](config[_0xae72('0x10')],_0xae72('0x11')));},'filename':function(_0x28471b,_0x499eda,_0xdc7baa){_0x499eda[_0xae72('0x12')]=_0x499eda['originalname'][_0xae72('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xdc7baa(null,util[_0xae72('0x14')]('%s-%s%s',path[_0xae72('0x15')](_0x499eda['originalname'],path[_0xae72('0x16')](_0x499eda[_0xae72('0x12')])),Date[_0xae72('0x17')](),path[_0xae72('0x16')](_0x499eda[_0xae72('0x12')])));}})});router[_0xae72('0x18')]('/',upload['single'](_0xae72('0x19')),controller[_0xae72('0x1a')]);router['put'](_0xae72('0xb'),auth['isAuthenticated'](),controller[_0xae72('0x1b')]);router[_0xae72('0x1c')](_0xae72('0xb'),auth[_0xae72('0x9')](),controller['delete']);module['exports']=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index a8969ce..f268505 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 _0xdcb7=['STRING','FLOAT','BIGINT','INTEGER','sequelize','exports'];(function(_0x36c269,_0x5dfb83){var _0x220dcf=function(_0x1238eb){while(--_0x1238eb){_0x36c269['push'](_0x36c269['shift']());}};_0x220dcf(++_0x5dfb83);}(_0xdcb7,0x16c));var _0x7dcb=function(_0x2d0af6,_0x2baeab){_0x2d0af6=_0x2d0af6-0x0;var _0x7d633f=_0xdcb7[_0x2d0af6];return _0x7d633f;};'use strict';var Sequelize=require(_0x7dcb('0x0'));module[_0x7dcb('0x1')]={'name':{'type':Sequelize[_0x7dcb('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x7dcb('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x7dcb('0x2')]},'original_format':{'type':Sequelize[_0x7dcb('0x2')]},'original_duration':{'type':Sequelize[_0x7dcb('0x3')]},'original_sampleCount':{'type':Sequelize[_0x7dcb('0x4')]},'original_channelCount':{'type':Sequelize[_0x7dcb('0x5')]},'original_bitRate':{'type':Sequelize[_0x7dcb('0x4')]},'original_sampleRate':{'type':Sequelize[_0x7dcb('0x5')]},'converted_format':{'type':Sequelize[_0x7dcb('0x2')]},'converted_duration':{'type':Sequelize[_0x7dcb('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x7dcb('0x4')]},'converted_channelCount':{'type':Sequelize[_0x7dcb('0x5')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0x7dcb('0x5')]}}; \ No newline at end of file +var _0xefac=['exports','STRING','name','FLOAT','INTEGER','BIGINT','sequelize'];(function(_0x41172e,_0x2547fa){var _0x499148=function(_0x532d10){while(--_0x532d10){_0x41172e['push'](_0x41172e['shift']());}};_0x499148(++_0x2547fa);}(_0xefac,0x19c));var _0xcefa=function(_0x41903b,_0xb58ca1){_0x41903b=_0x41903b-0x0;var _0x2934fe=_0xefac[_0x41903b];return _0x2934fe;};'use strict';var Sequelize=require(_0xcefa('0x0'));module[_0xcefa('0x1')]={'name':{'type':Sequelize[_0xcefa('0x2')],'unique':_0xcefa('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0xcefa('0x2')]},'display_name':{'type':Sequelize[_0xcefa('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xcefa('0x2')]},'original_format':{'type':Sequelize[_0xcefa('0x2')]},'original_duration':{'type':Sequelize[_0xcefa('0x4')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0xcefa('0x5')]},'original_bitRate':{'type':Sequelize[_0xcefa('0x6')]},'original_sampleRate':{'type':Sequelize[_0xcefa('0x5')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0xcefa('0x4')]},'converted_sampleCount':{'type':Sequelize[_0xcefa('0x6')]},'converted_channelCount':{'type':Sequelize[_0xcefa('0x5')]},'converted_bitRate':{'type':Sequelize[_0xcefa('0x6')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index df59830..8e04f47 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 _0xc864=['sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','converted_duration','converted_sampleCount','converted_bitRate','converted_sampleRate','sampleRate','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Sounds','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','body','description','original_format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','destroy','then','get','UserProfileResource','error','stack','name','send','index','map','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','Sound','findAll','catch','show','params','find','download','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','ValidationError','Sound\x20not\x20found','format','%s.%s','create','basename','file','originalname','extname','filename','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','src','duration'];(function(_0x25bb63,_0x404ac6){var _0x412181=function(_0x2a118c){while(--_0x2a118c){_0x25bb63['push'](_0x25bb63['shift']());}};_0x412181(++_0x404ac6);}(_0xc864,0x112));var _0x4c86=function(_0x46da22,_0x19ea5d){_0x46da22=_0x46da22-0x0;var _0x16eeb9=_0xc864[_0x46da22];return _0x16eeb9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4c86('0x0'));var zipdir=require(_0x4c86('0x1'));var jsonpatch=require(_0x4c86('0x2'));var rp=require(_0x4c86('0x3'));var moment=require(_0x4c86('0x4'));var BPromise=require(_0x4c86('0x5'));var Mustache=require(_0x4c86('0x6'));var util=require(_0x4c86('0x7'));var path=require(_0x4c86('0x8'));var sox=require(_0x4c86('0x9'));var csv=require(_0x4c86('0xa'));var ejs=require(_0x4c86('0xb'));var fs=require('fs');var fs_extra=require(_0x4c86('0xc'));var _=require(_0x4c86('0xd'));var squel=require(_0x4c86('0xe'));var crypto=require('crypto');var jsforce=require(_0x4c86('0xf'));var deskjs=require(_0x4c86('0x10'));var toCsv=require(_0x4c86('0xa'));var querystring=require('querystring');var Papa=require(_0x4c86('0x11'));var Redis=require(_0x4c86('0x12'));var authService=require(_0x4c86('0x13'));var qs=require(_0x4c86('0x14'));var as=require(_0x4c86('0x15'));var hardwareService=require(_0x4c86('0x16'));var logger=require(_0x4c86('0x17'))(_0x4c86('0x18'));var utils=require(_0x4c86('0x19'));var config=require(_0x4c86('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b28e6,_0x5d9d99){_0x5d9d99=_0x5d9d99||0xcc;return function(_0x5a1c4d){if(_0x5a1c4d){return _0x2b28e6[_0x4c86('0x1b')](_0x5d9d99);}return _0x2b28e6[_0x4c86('0x1c')](_0x5d9d99)[_0x4c86('0x1d')]();};}function respondWithResult(_0x5bb7f1,_0xa5e06b){_0xa5e06b=_0xa5e06b||0xc8;return function(_0x1378fa){if(_0x1378fa){return _0x5bb7f1[_0x4c86('0x1c')](_0xa5e06b)[_0x4c86('0x1e')](_0x1378fa);}};}function respondWithFilteredResult(_0x36315d,_0x4d1326){return function(_0x470358){if(_0x470358){var _0x5bc2a3=typeof _0x4d1326[_0x4c86('0x1f')]==='undefined'&&typeof _0x4d1326[_0x4c86('0x20')]==='undefined';var _0x508ff1=_0x470358[_0x4c86('0x21')];var _0x2799ca=_0x5bc2a3?0x0:_0x4d1326[_0x4c86('0x1f')];var _0x3e5155=_0x5bc2a3?_0x470358[_0x4c86('0x21')]:_0x4d1326[_0x4c86('0x1f')]+_0x4d1326[_0x4c86('0x20')];var _0x5a0077;if(_0x3e5155>=_0x508ff1){_0x3e5155=_0x508ff1;_0x5a0077=0xc8;}else{_0x5a0077=0xce;}_0x36315d[_0x4c86('0x1c')](_0x5a0077);return _0x36315d[_0x4c86('0x22')](_0x4c86('0x23'),_0x2799ca+'-'+_0x3e5155+'/'+_0x508ff1)['json'](_0x470358);}return null;};}function patchUpdates(_0x160d86){return function(_0x180810){try{jsonpatch['apply'](_0x180810,_0x160d86,!![]);}catch(_0x1f3f8c){return BPromise[_0x4c86('0x24')](_0x1f3f8c);}return _0x180810[_0x4c86('0x25')]();};}function saveUpdates(_0x90d8a4,_0x1cd58a){return function(_0x35a1d8){if(_0x35a1d8){return _0x35a1d8[_0x4c86('0x26')](_0x90d8a4)['then'](function(_0x25270f){return _0x25270f;});}return null;};}function removeEntity(_0x1c98c0,_0x371b9c){return function(_0x42f989){if(_0x42f989){return _0x42f989[_0x4c86('0x27')]()[_0x4c86('0x28')](function(){var _0x2f0e01=_0x42f989[_0x4c86('0x29')]({'plain':!![]});var _0x23c49b='Sounds';return db[_0x4c86('0x2a')][_0x4c86('0x27')]({'where':{'type':_0x23c49b,'resourceId':_0x2f0e01['id']}})[_0x4c86('0x28')](function(){return _0x42f989;});})['then'](function(){_0x1c98c0[_0x4c86('0x1c')](0xcc)[_0x4c86('0x1d')]();});}};}function handleEntityNotFound(_0x2ce359,_0x482820){return function(_0x5df3fc){if(!_0x5df3fc){_0x2ce359[_0x4c86('0x1b')](0x194);}return _0x5df3fc;};}function handleError(_0x59eb85,_0x2c0250){_0x2c0250=_0x2c0250||0x1f4;return function(_0x39d547){logger[_0x4c86('0x2b')](_0x39d547[_0x4c86('0x2c')]);if(_0x39d547[_0x4c86('0x2d')]){delete _0x39d547[_0x4c86('0x2d')];}_0x59eb85['status'](_0x2c0250)[_0x4c86('0x2e')](_0x39d547);};}exports[_0x4c86('0x2f')]=function(_0x4b3fb4,_0x26279e){var _0x1abf5c={},_0xb083dc={},_0x10060a={'count':0x0,'rows':[]};var _0x4dc539=_[_0x4c86('0x30')](db['Sound'][_0x4c86('0x31')],function(_0x5adff2){return{'name':_0x5adff2['fieldName'],'type':_0x5adff2[_0x4c86('0x32')][_0x4c86('0x33')]};});_0xb083dc[_0x4c86('0x34')]=_[_0x4c86('0x30')](_0x4dc539,'name');_0xb083dc['query']=_[_0x4c86('0x35')](_0x4b3fb4[_0x4c86('0x36')]);_0xb083dc[_0x4c86('0x37')]=_['intersection'](_0xb083dc[_0x4c86('0x34')],_0xb083dc[_0x4c86('0x36')]);_0x1abf5c['attributes']=_[_0x4c86('0x38')](_0xb083dc['model'],qs[_0x4c86('0x39')](_0x4b3fb4[_0x4c86('0x36')][_0x4c86('0x39')]));_0x1abf5c[_0x4c86('0x3a')]=_0x1abf5c[_0x4c86('0x3a')][_0x4c86('0x3b')]?_0x1abf5c['attributes']:_0xb083dc[_0x4c86('0x34')];if(!_0x4b3fb4[_0x4c86('0x36')][_0x4c86('0x3c')](_0x4c86('0x3d'))){_0x1abf5c[_0x4c86('0x20')]=qs[_0x4c86('0x20')](_0x4b3fb4['query']['limit']);_0x1abf5c[_0x4c86('0x1f')]=qs[_0x4c86('0x1f')](_0x4b3fb4[_0x4c86('0x36')][_0x4c86('0x1f')]);}_0x1abf5c['order']=qs[_0x4c86('0x3e')](_0x4b3fb4[_0x4c86('0x36')][_0x4c86('0x3e')]);_0x1abf5c[_0x4c86('0x3f')]=qs[_0x4c86('0x37')](_[_0x4c86('0x40')](_0x4b3fb4[_0x4c86('0x36')],_0xb083dc[_0x4c86('0x37')]),_0x4dc539);if(_0x4b3fb4[_0x4c86('0x36')][_0x4c86('0x41')]){_0x1abf5c[_0x4c86('0x3f')]=_[_0x4c86('0x42')](_0x1abf5c[_0x4c86('0x3f')],{'$or':_[_0x4c86('0x30')](_0x4dc539,function(_0xe2f6a9){if(_0xe2f6a9[_0x4c86('0x32')]!=='VIRTUAL'){var _0x3e80f2={};_0x3e80f2[_0xe2f6a9['name']]={'$like':'%'+_0x4b3fb4[_0x4c86('0x36')][_0x4c86('0x41')]+'%'};return _0x3e80f2;}})});}_0x1abf5c=_[_0x4c86('0x42')]({},_0x1abf5c,_0x4b3fb4[_0x4c86('0x43')]);var _0x24a14e={'where':_0x1abf5c[_0x4c86('0x3f')]};return db['Sound'][_0x4c86('0x21')](_0x24a14e)[_0x4c86('0x28')](function(_0x4309be){_0x10060a['count']=_0x4309be;if(_0x4b3fb4[_0x4c86('0x36')][_0x4c86('0x44')]){_0x1abf5c[_0x4c86('0x45')]=[{'all':!![]}];}return db[_0x4c86('0x46')][_0x4c86('0x47')](_0x1abf5c);})['then'](function(_0x47f9d5){_0x10060a['rows']=_0x47f9d5;return _0x10060a;})['then'](respondWithFilteredResult(_0x26279e,_0x1abf5c))[_0x4c86('0x48')](handleError(_0x26279e,null));};exports[_0x4c86('0x49')]=function(_0x25b924,_0x4319c9){var _0x125a21={'raw':!![],'where':{'id':_0x25b924[_0x4c86('0x4a')]['id']}},_0x41f646={};_0x41f646['model']=_[_0x4c86('0x35')](db[_0x4c86('0x46')][_0x4c86('0x31')]);_0x41f646[_0x4c86('0x36')]=_[_0x4c86('0x35')](_0x25b924[_0x4c86('0x36')]);_0x41f646[_0x4c86('0x37')]=_[_0x4c86('0x38')](_0x41f646[_0x4c86('0x34')],_0x41f646['query']);_0x125a21['attributes']=_[_0x4c86('0x38')](_0x41f646[_0x4c86('0x34')],qs[_0x4c86('0x39')](_0x25b924[_0x4c86('0x36')][_0x4c86('0x39')]));_0x125a21[_0x4c86('0x3a')]=_0x125a21['attributes'][_0x4c86('0x3b')]?_0x125a21[_0x4c86('0x3a')]:_0x41f646[_0x4c86('0x34')];if(_0x25b924[_0x4c86('0x36')]['includeAll']){_0x125a21[_0x4c86('0x45')]=[{'all':!![]}];}_0x125a21=_[_0x4c86('0x42')]({},_0x125a21,_0x25b924[_0x4c86('0x43')]);return db[_0x4c86('0x46')][_0x4c86('0x4b')](_0x125a21)[_0x4c86('0x28')](handleEntityNotFound(_0x4319c9,null))['then'](respondWithResult(_0x4319c9,null))[_0x4c86('0x48')](handleError(_0x4319c9,null));};exports[_0x4c86('0x4c')]=function(_0x28dfee,_0x190b8b,_0x5995ab){return db['Sound']['find']({'where':{'id':_0x28dfee[_0x4c86('0x4a')]['id']},'attributes':[_0x4c86('0x2d'),_0x4c86('0x4d'),_0x4c86('0x4e')],'raw':!![]})[_0x4c86('0x28')](handleEntityNotFound(_0x190b8b,null))['then'](function(_0x141e2f){if(_0x141e2f){if(!fs[_0x4c86('0x4f')](path[_0x4c86('0x50')](config[_0x4c86('0x51')],_0x4c86('0x52'),_0x141e2f[_0x4c86('0x4d')]+'.'+_0x141e2f[_0x4c86('0x4e')]))){throw new db['Sequelize'][(_0x4c86('0x53'))](_0x4c86('0x54'));}return _0x190b8b[_0x4c86('0x4c')](path[_0x4c86('0x50')](config['root'],_0x4c86('0x52'),util[_0x4c86('0x55')](_0x4c86('0x56'),_0x141e2f[_0x4c86('0x4d')],_0x141e2f[_0x4c86('0x4e')])),util[_0x4c86('0x55')]('%s.%s',_0x141e2f[_0x4c86('0x2d')],_0x141e2f[_0x4c86('0x4e')]));}return null;})[_0x4c86('0x48')](handleError(_0x190b8b,null));};exports[_0x4c86('0x57')]=function(_0x30e2f6,_0x49a5ec,_0xe4e678){var _0x15b793={'name':path[_0x4c86('0x58')](_0x30e2f6[_0x4c86('0x59')][_0x4c86('0x5a')],path[_0x4c86('0x5b')](_0x30e2f6[_0x4c86('0x59')][_0x4c86('0x5a')])),'save_name':path['basename'](_0x30e2f6[_0x4c86('0x59')][_0x4c86('0x5c')],path[_0x4c86('0x5b')](_0x30e2f6['file']['filename'])),'original_format':path['extname'](_0x30e2f6[_0x4c86('0x59')][_0x4c86('0x5a')])['substring'](0x1),'converted_format':_0x4c86('0x5d')};var _0x31b414=path[_0x4c86('0x50')](config[_0x4c86('0x51')],_0x4c86('0x5e'),_0x30e2f6[_0x4c86('0x59')][_0x4c86('0x5c')]);var _0x10b42b=path[_0x4c86('0x50')](config[_0x4c86('0x51')],_0x4c86('0x52'),util['format'](_0x4c86('0x56'),path[_0x4c86('0x58')](_0x30e2f6['file']['filename'],path[_0x4c86('0x5b')](_0x30e2f6[_0x4c86('0x59')][_0x4c86('0x5c')])),_0x15b793[_0x4c86('0x4e')]));logger[_0x4c86('0x5f')](_0x4c86('0x60'),_0x31b414);logger[_0x4c86('0x5f')](_0x4c86('0x61'),_0x10b42b);try{fs[_0x4c86('0x62')](_0x31b414,parseInt(_0x4c86('0x63'),0x8));var _0x3e74bc=sox[_0x4c86('0x64')](_0x31b414,_0x10b42b,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3e74bc['on'](_0x4c86('0x2b'),function(_0x293ab9){fs[_0x4c86('0x65')](_0x31b414);_0x49a5ec[_0x4c86('0x1c')](0x1f4)['send'](_0x293ab9);});_0x3e74bc['on'](_0x4c86('0x66'),function(_0x424c8f){_0x15b793['original_duration']=isNaN(_0x424c8f['duration'])?null:_0x424c8f[_0x4c86('0x67')]*0x3e8;_0x15b793['original_sampleCount']=isNaN(_0x424c8f[_0x4c86('0x68')])?null:_0x424c8f[_0x4c86('0x68')];_0x15b793['original_channelCount']=isNaN(_0x424c8f[_0x4c86('0x69')])?null:_0x424c8f[_0x4c86('0x69')];_0x15b793[_0x4c86('0x6a')]=isNaN(_0x424c8f['bitRate'])?null:_0x424c8f[_0x4c86('0x6b')];_0x15b793[_0x4c86('0x6c')]=isNaN(_0x424c8f['sampleRate'])?null:_0x424c8f['sampleRate'];});_0x3e74bc['on']('dest',function(_0x4118e3){_0x15b793[_0x4c86('0x6d')]=isNaN(_0x4118e3[_0x4c86('0x67')])?null:_0x4118e3['duration']*0x3e8;_0x15b793[_0x4c86('0x6e')]=isNaN(_0x4118e3[_0x4c86('0x68')])?null:_0x4118e3[_0x4c86('0x68')];_0x15b793['converted_channelCount']=isNaN(_0x4118e3[_0x4c86('0x69')])?null:_0x4118e3['channelCount'];_0x15b793[_0x4c86('0x6f')]=isNaN(_0x4118e3['bitRate'])?null:_0x4118e3[_0x4c86('0x6b')];_0x15b793[_0x4c86('0x70')]=isNaN(_0x4118e3[_0x4c86('0x71')])?null:_0x4118e3[_0x4c86('0x71')];});_0x3e74bc['on'](_0x4c86('0x1d'),function(){fs[_0x4c86('0x62')](_0x10b42b,parseInt(_0x4c86('0x63'),0x8));return db[_0x4c86('0x46')][_0x4c86('0x57')](_0x15b793)[_0x4c86('0x28')](function(_0xcfa831){var _0x79044a={'role':_0x30e2f6['body'][_0x4c86('0x72')],'userProfileId':_0x30e2f6['body'][_0x4c86('0x73')]};if(!_0x79044a)throw new Error(_0x4c86('0x74'));if(_0x79044a[_0x4c86('0x72')]===_0x4c86('0x75')){var _0x2cd002=_0xcfa831[_0x4c86('0x29')]({'plain':!![]});return db[_0x4c86('0x76')][_0x4c86('0x4b')]({'where':{'name':_0x4c86('0x77'),'userProfileId':_0x79044a[_0x4c86('0x73')]},'raw':!![]})[_0x4c86('0x28')](function(_0x2e3b20){if(_0x2e3b20&&_0x2e3b20[_0x4c86('0x78')]===0x0){return db[_0x4c86('0x2a')][_0x4c86('0x57')]({'name':_0x2cd002[_0x4c86('0x2d')],'resourceId':_0x2cd002['id'],'type':_0x2e3b20[_0x4c86('0x2d')],'sectionId':_0x2e3b20['id']},{})['then'](function(){return _0xcfa831;});}else{return _0xcfa831;}})[_0x4c86('0x48')](function(_0x1f0dda){logger['error'](_0x4c86('0x79'),_0x1f0dda);throw _0x1f0dda;});}return _0xcfa831;})[_0x4c86('0x28')](respondWithResult(_0x49a5ec,null))[_0x4c86('0x48')](handleError(_0x49a5ec,null));});_0x3e74bc[_0x4c86('0x7a')]();}catch(_0x1f1874){_0x49a5ec[_0x4c86('0x1c')](0x1f4)[_0x4c86('0x2e')](_0x1f1874);}};exports[_0x4c86('0x26')]=function(_0x13fe49,_0x248dbc,_0x14ae64){return db[_0x4c86('0x46')][_0x4c86('0x4b')]({'where':{'id':_0x13fe49[_0x4c86('0x4a')]['id']}})[_0x4c86('0x28')](handleEntityNotFound(_0x248dbc,null))[_0x4c86('0x28')](saveUpdates(_['pick'](_0x13fe49[_0x4c86('0x7b')],[_0x4c86('0x2d'),_0x4c86('0x7c')]),null))['then'](respondWithResult(_0x248dbc,null))[_0x4c86('0x48')](handleError(_0x248dbc,null));};exports['delete']=function(_0x1224d3,_0x2086dd,_0x945d39){return db['Sound'][_0x4c86('0x4b')]({'where':{'id':_0x1224d3[_0x4c86('0x4a')]['id']}})[_0x4c86('0x28')](function(_0x39e146){if(_0x39e146){return _0x39e146[_0x4c86('0x27')]();}})[_0x4c86('0x28')](function(_0x212998){var _0x2da387=path[_0x4c86('0x50')](config[_0x4c86('0x51')],_0x4c86('0x5e'),util[_0x4c86('0x55')](_0x4c86('0x56'),_0x212998[_0x4c86('0x4d')],_0x212998[_0x4c86('0x7d')]));var _0x2cdf8d=path['join'](config[_0x4c86('0x51')],_0x4c86('0x52'),util['format'](_0x4c86('0x56'),_0x212998[_0x4c86('0x4d')],_0x212998[_0x4c86('0x4e')]));fs['unlinkSync'](_0x2da387);fs[_0x4c86('0x65')](_0x2cdf8d);return _0x212998;})[_0x4c86('0x28')](function(_0x226920){if(_0x226920){return _0x2086dd['status'](0xcc)[_0x4c86('0x1d')]();}})['then'](handleEntityNotFound(_0x2086dd,null))[_0x4c86('0x48')](handleError(_0x2086dd,null));}; \ No newline at end of file +var _0x2e0a=['update','then','destroy','get','Sounds','UserProfileResource','error','name','send','index','Sound','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','params','length','include','options','find','download','save_name','converted_format','join','root','server/files/sounds/converted','Sequelize','format','%s.%s','basename','file','originalname','extname','filename','info','Sound\x20upload\x20destination:\x20%s','transcode','wav','unlinkSync','duration','original_sampleCount','sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_sampleRate','chmodSync','0777','role','body','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','server/files/sounds/original','original_format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x4c8785,_0x41e18f){var _0xe16c06=function(_0x30bb47){while(--_0x30bb47){_0x4c8785['push'](_0x4c8785['shift']());}};_0xe16c06(++_0x41e18f);}(_0x2e0a,0xcc));var _0xa2e0=function(_0x378ff4,_0x2e7ef4){_0x378ff4=_0x378ff4-0x0;var _0x5d5ee8=_0x2e0a[_0x378ff4];return _0x5d5ee8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa2e0('0x0'));var zipdir=require(_0xa2e0('0x1'));var jsonpatch=require(_0xa2e0('0x2'));var rp=require(_0xa2e0('0x3'));var moment=require('moment');var BPromise=require(_0xa2e0('0x4'));var Mustache=require(_0xa2e0('0x5'));var util=require(_0xa2e0('0x6'));var path=require(_0xa2e0('0x7'));var sox=require('sox');var csv=require(_0xa2e0('0x8'));var ejs=require(_0xa2e0('0x9'));var fs=require('fs');var fs_extra=require(_0xa2e0('0xa'));var _=require(_0xa2e0('0xb'));var squel=require(_0xa2e0('0xc'));var crypto=require(_0xa2e0('0xd'));var jsforce=require(_0xa2e0('0xe'));var deskjs=require(_0xa2e0('0xf'));var toCsv=require(_0xa2e0('0x8'));var querystring=require(_0xa2e0('0x10'));var Papa=require(_0xa2e0('0x11'));var Redis=require('ioredis');var authService=require(_0xa2e0('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa2e0('0x13'));var hardwareService=require(_0xa2e0('0x14'));var logger=require(_0xa2e0('0x15'))('api');var utils=require(_0xa2e0('0x16'));var config=require(_0xa2e0('0x17'));var licenseUtil=require(_0xa2e0('0x18'));var db=require(_0xa2e0('0x19'))['db'];function respondWithStatusCode(_0x26df8c,_0x3cfe49){_0x3cfe49=_0x3cfe49||0xcc;return function(_0x692978){if(_0x692978){return _0x26df8c[_0xa2e0('0x1a')](_0x3cfe49);}return _0x26df8c['status'](_0x3cfe49)[_0xa2e0('0x1b')]();};}function respondWithResult(_0x4d9444,_0x348950){_0x348950=_0x348950||0xc8;return function(_0x3a6d20){if(_0x3a6d20){return _0x4d9444[_0xa2e0('0x1c')](_0x348950)[_0xa2e0('0x1d')](_0x3a6d20);}};}function respondWithFilteredResult(_0xf427c1,_0x16585b){return function(_0x209883){if(_0x209883){var _0x595717=typeof _0x16585b[_0xa2e0('0x1e')]===_0xa2e0('0x1f')&&typeof _0x16585b[_0xa2e0('0x20')]===_0xa2e0('0x1f');var _0x1a9d20=_0x209883[_0xa2e0('0x21')];var _0x426b8d=_0x595717?0x0:_0x16585b[_0xa2e0('0x1e')];var _0x505ac6=_0x595717?_0x209883['count']:_0x16585b[_0xa2e0('0x1e')]+_0x16585b['limit'];var _0x71939a;if(_0x505ac6>=_0x1a9d20){_0x505ac6=_0x1a9d20;_0x71939a=0xc8;}else{_0x71939a=0xce;}_0xf427c1[_0xa2e0('0x1c')](_0x71939a);return _0xf427c1[_0xa2e0('0x22')](_0xa2e0('0x23'),_0x426b8d+'-'+_0x505ac6+'/'+_0x1a9d20)[_0xa2e0('0x1d')](_0x209883);}return null;};}function patchUpdates(_0x3bd887){return function(_0x9c0dcd){try{jsonpatch[_0xa2e0('0x24')](_0x9c0dcd,_0x3bd887,!![]);}catch(_0x3ccd9e){return BPromise[_0xa2e0('0x25')](_0x3ccd9e);}return _0x9c0dcd['save']();};}function saveUpdates(_0x511906,_0x32a238){return function(_0x5a2694){if(_0x5a2694){return _0x5a2694[_0xa2e0('0x26')](_0x511906)[_0xa2e0('0x27')](function(_0x286a77){return _0x286a77;});}return null;};}function removeEntity(_0x5036e5,_0x433dcf){return function(_0x1c6195){if(_0x1c6195){return _0x1c6195[_0xa2e0('0x28')]()[_0xa2e0('0x27')](function(){var _0x450a67=_0x1c6195[_0xa2e0('0x29')]({'plain':!![]});var _0x17e7f2=_0xa2e0('0x2a');return db[_0xa2e0('0x2b')][_0xa2e0('0x28')]({'where':{'type':_0x17e7f2,'resourceId':_0x450a67['id']}})[_0xa2e0('0x27')](function(){return _0x1c6195;});})[_0xa2e0('0x27')](function(){_0x5036e5[_0xa2e0('0x1c')](0xcc)[_0xa2e0('0x1b')]();});}};}function handleEntityNotFound(_0x4c9b0b,_0x48c4c1){return function(_0x3c2bd6){if(!_0x3c2bd6){_0x4c9b0b[_0xa2e0('0x1a')](0x194);}return _0x3c2bd6;};}function handleError(_0x4de342,_0x26adb9){_0x26adb9=_0x26adb9||0x1f4;return function(_0x16aeb2){logger[_0xa2e0('0x2c')](_0x16aeb2['stack']);if(_0x16aeb2[_0xa2e0('0x2d')]){delete _0x16aeb2['name'];}_0x4de342[_0xa2e0('0x1c')](_0x26adb9)[_0xa2e0('0x2e')](_0x16aeb2);};}exports[_0xa2e0('0x2f')]=function(_0x2bdee8,_0x336273){var _0x4d9ca2={},_0x45ab50={},_0x167f46={'count':0x0,'rows':[]};var _0x3cbb1a=_['map'](db[_0xa2e0('0x30')]['rawAttributes'],function(_0x3c8429){return{'name':_0x3c8429[_0xa2e0('0x31')],'type':_0x3c8429[_0xa2e0('0x32')][_0xa2e0('0x33')]};});_0x45ab50['model']=_[_0xa2e0('0x34')](_0x3cbb1a,_0xa2e0('0x2d'));_0x45ab50[_0xa2e0('0x35')]=_[_0xa2e0('0x36')](_0x2bdee8[_0xa2e0('0x35')]);_0x45ab50['filters']=_[_0xa2e0('0x37')](_0x45ab50[_0xa2e0('0x38')],_0x45ab50[_0xa2e0('0x35')]);_0x4d9ca2[_0xa2e0('0x39')]=_[_0xa2e0('0x37')](_0x45ab50[_0xa2e0('0x38')],qs[_0xa2e0('0x3a')](_0x2bdee8[_0xa2e0('0x35')][_0xa2e0('0x3a')]));_0x4d9ca2['attributes']=_0x4d9ca2[_0xa2e0('0x39')]['length']?_0x4d9ca2[_0xa2e0('0x39')]:_0x45ab50[_0xa2e0('0x38')];if(!_0x2bdee8[_0xa2e0('0x35')][_0xa2e0('0x3b')](_0xa2e0('0x3c'))){_0x4d9ca2[_0xa2e0('0x20')]=qs[_0xa2e0('0x20')](_0x2bdee8[_0xa2e0('0x35')]['limit']);_0x4d9ca2[_0xa2e0('0x1e')]=qs[_0xa2e0('0x1e')](_0x2bdee8[_0xa2e0('0x35')]['offset']);}_0x4d9ca2[_0xa2e0('0x3d')]=qs[_0xa2e0('0x3e')](_0x2bdee8[_0xa2e0('0x35')][_0xa2e0('0x3e')]);_0x4d9ca2[_0xa2e0('0x3f')]=qs[_0xa2e0('0x40')](_[_0xa2e0('0x41')](_0x2bdee8[_0xa2e0('0x35')],_0x45ab50[_0xa2e0('0x40')]),_0x3cbb1a);if(_0x2bdee8[_0xa2e0('0x35')][_0xa2e0('0x42')]){_0x4d9ca2[_0xa2e0('0x3f')]=_[_0xa2e0('0x43')](_0x4d9ca2[_0xa2e0('0x3f')],{'$or':_[_0xa2e0('0x34')](_0x3cbb1a,function(_0x41addf){if(_0x41addf[_0xa2e0('0x32')]!==_0xa2e0('0x44')){var _0xdc1a1d={};_0xdc1a1d[_0x41addf[_0xa2e0('0x2d')]]={'$like':'%'+_0x2bdee8['query'][_0xa2e0('0x42')]+'%'};return _0xdc1a1d;}})});}_0x4d9ca2=_[_0xa2e0('0x43')]({},_0x4d9ca2,_0x2bdee8['options']);var _0x19cb96={'where':_0x4d9ca2[_0xa2e0('0x3f')]};return db[_0xa2e0('0x30')][_0xa2e0('0x21')](_0x19cb96)[_0xa2e0('0x27')](function(_0x4d91a9){_0x167f46['count']=_0x4d91a9;if(_0x2bdee8[_0xa2e0('0x35')][_0xa2e0('0x45')]){_0x4d9ca2['include']=[{'all':!![]}];}return db[_0xa2e0('0x30')][_0xa2e0('0x46')](_0x4d9ca2);})[_0xa2e0('0x27')](function(_0x18c17c){_0x167f46[_0xa2e0('0x47')]=_0x18c17c;return _0x167f46;})[_0xa2e0('0x27')](respondWithFilteredResult(_0x336273,_0x4d9ca2))[_0xa2e0('0x48')](handleError(_0x336273,null));};exports['show']=function(_0x25b1b3,_0xbb6e0){var _0x5c00d9={'raw':!![],'where':{'id':_0x25b1b3[_0xa2e0('0x49')]['id']}},_0x29ea48={};_0x29ea48[_0xa2e0('0x38')]=_[_0xa2e0('0x36')](db[_0xa2e0('0x30')]['rawAttributes']);_0x29ea48[_0xa2e0('0x35')]=_['keys'](_0x25b1b3[_0xa2e0('0x35')]);_0x29ea48[_0xa2e0('0x40')]=_[_0xa2e0('0x37')](_0x29ea48['model'],_0x29ea48[_0xa2e0('0x35')]);_0x5c00d9[_0xa2e0('0x39')]=_[_0xa2e0('0x37')](_0x29ea48[_0xa2e0('0x38')],qs[_0xa2e0('0x3a')](_0x25b1b3['query']['fields']));_0x5c00d9[_0xa2e0('0x39')]=_0x5c00d9[_0xa2e0('0x39')][_0xa2e0('0x4a')]?_0x5c00d9[_0xa2e0('0x39')]:_0x29ea48['model'];if(_0x25b1b3['query']['includeAll']){_0x5c00d9[_0xa2e0('0x4b')]=[{'all':!![]}];}_0x5c00d9=_['merge']({},_0x5c00d9,_0x25b1b3[_0xa2e0('0x4c')]);return db[_0xa2e0('0x30')][_0xa2e0('0x4d')](_0x5c00d9)[_0xa2e0('0x27')](handleEntityNotFound(_0xbb6e0,null))[_0xa2e0('0x27')](respondWithResult(_0xbb6e0,null))[_0xa2e0('0x48')](handleError(_0xbb6e0,null));};exports[_0xa2e0('0x4e')]=function(_0x3e0b46,_0xd2e8e4,_0x41c73c){return db[_0xa2e0('0x30')][_0xa2e0('0x4d')]({'where':{'id':_0x3e0b46[_0xa2e0('0x49')]['id']},'attributes':['name',_0xa2e0('0x4f'),_0xa2e0('0x50')],'raw':!![]})[_0xa2e0('0x27')](handleEntityNotFound(_0xd2e8e4,null))[_0xa2e0('0x27')](function(_0x3d19c5){if(_0x3d19c5){if(!fs['existsSync'](path[_0xa2e0('0x51')](config[_0xa2e0('0x52')],_0xa2e0('0x53'),_0x3d19c5[_0xa2e0('0x4f')]+'.'+_0x3d19c5[_0xa2e0('0x50')]))){throw new db[(_0xa2e0('0x54'))]['ValidationError']('Sound\x20not\x20found');}return _0xd2e8e4[_0xa2e0('0x4e')](path[_0xa2e0('0x51')](config[_0xa2e0('0x52')],_0xa2e0('0x53'),util[_0xa2e0('0x55')](_0xa2e0('0x56'),_0x3d19c5['save_name'],_0x3d19c5['converted_format'])),util[_0xa2e0('0x55')](_0xa2e0('0x56'),_0x3d19c5[_0xa2e0('0x2d')],_0x3d19c5[_0xa2e0('0x50')]));}return null;})[_0xa2e0('0x48')](handleError(_0xd2e8e4,null));};exports['create']=function(_0x3d79f2,_0x275836,_0x3e00fa){var _0x59912a={'name':path[_0xa2e0('0x57')](_0x3d79f2[_0xa2e0('0x58')][_0xa2e0('0x59')],path[_0xa2e0('0x5a')](_0x3d79f2[_0xa2e0('0x58')][_0xa2e0('0x59')])),'save_name':path[_0xa2e0('0x57')](_0x3d79f2[_0xa2e0('0x58')][_0xa2e0('0x5b')],path['extname'](_0x3d79f2[_0xa2e0('0x58')][_0xa2e0('0x5b')])),'original_format':path['extname'](_0x3d79f2[_0xa2e0('0x58')][_0xa2e0('0x59')])['substring'](0x1),'converted_format':'wav'};var _0x137a4f=path[_0xa2e0('0x51')](config[_0xa2e0('0x52')],'server/files/sounds/original',_0x3d79f2['file'][_0xa2e0('0x5b')]);var _0x109273=path[_0xa2e0('0x51')](config['root'],_0xa2e0('0x53'),util[_0xa2e0('0x55')](_0xa2e0('0x56'),path['basename'](_0x3d79f2[_0xa2e0('0x58')][_0xa2e0('0x5b')],path[_0xa2e0('0x5a')](_0x3d79f2[_0xa2e0('0x58')]['filename'])),_0x59912a['converted_format']));logger[_0xa2e0('0x5c')]('Sound\x20upload\x20filepath:\x20%s',_0x137a4f);logger[_0xa2e0('0x5c')](_0xa2e0('0x5d'),_0x109273);try{fs['chmodSync'](_0x137a4f,parseInt('0777',0x8));var _0x4abcb0=sox[_0xa2e0('0x5e')](_0x137a4f,_0x109273,{'sampleRate':0x1f40,'format':_0xa2e0('0x5f'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4abcb0['on'](_0xa2e0('0x2c'),function(_0x44b972){fs[_0xa2e0('0x60')](_0x137a4f);_0x275836[_0xa2e0('0x1c')](0x1f4)[_0xa2e0('0x2e')](_0x44b972);});_0x4abcb0['on']('src',function(_0x1713b0){_0x59912a['original_duration']=isNaN(_0x1713b0[_0xa2e0('0x61')])?null:_0x1713b0[_0xa2e0('0x61')]*0x3e8;_0x59912a[_0xa2e0('0x62')]=isNaN(_0x1713b0[_0xa2e0('0x63')])?null:_0x1713b0['sampleCount'];_0x59912a['original_channelCount']=isNaN(_0x1713b0[_0xa2e0('0x64')])?null:_0x1713b0[_0xa2e0('0x64')];_0x59912a[_0xa2e0('0x65')]=isNaN(_0x1713b0['bitRate'])?null:_0x1713b0[_0xa2e0('0x66')];_0x59912a[_0xa2e0('0x67')]=isNaN(_0x1713b0[_0xa2e0('0x68')])?null:_0x1713b0['sampleRate'];});_0x4abcb0['on'](_0xa2e0('0x69'),function(_0x5c46e1){_0x59912a[_0xa2e0('0x6a')]=isNaN(_0x5c46e1[_0xa2e0('0x61')])?null:_0x5c46e1[_0xa2e0('0x61')]*0x3e8;_0x59912a[_0xa2e0('0x6b')]=isNaN(_0x5c46e1[_0xa2e0('0x63')])?null:_0x5c46e1[_0xa2e0('0x63')];_0x59912a['converted_channelCount']=isNaN(_0x5c46e1[_0xa2e0('0x64')])?null:_0x5c46e1[_0xa2e0('0x64')];_0x59912a['converted_bitRate']=isNaN(_0x5c46e1['bitRate'])?null:_0x5c46e1[_0xa2e0('0x66')];_0x59912a[_0xa2e0('0x6c')]=isNaN(_0x5c46e1[_0xa2e0('0x68')])?null:_0x5c46e1[_0xa2e0('0x68')];});_0x4abcb0['on'](_0xa2e0('0x1b'),function(){fs[_0xa2e0('0x6d')](_0x109273,parseInt(_0xa2e0('0x6e'),0x8));return db['Sound']['create'](_0x59912a)[_0xa2e0('0x27')](function(_0x5ae589){var _0x2ac672={'role':_0x3d79f2['body'][_0xa2e0('0x6f')],'userProfileId':_0x3d79f2[_0xa2e0('0x70')]['userProfileId']};if(!_0x2ac672)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2ac672[_0xa2e0('0x6f')]===_0xa2e0('0x71')){var _0x158837=_0x5ae589[_0xa2e0('0x29')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xa2e0('0x2a'),'userProfileId':_0x2ac672[_0xa2e0('0x72')]},'raw':!![]})[_0xa2e0('0x27')](function(_0x1f8c93){if(_0x1f8c93&&_0x1f8c93['autoAssociation']===0x0){return db[_0xa2e0('0x2b')]['create']({'name':_0x158837['name'],'resourceId':_0x158837['id'],'type':_0x1f8c93[_0xa2e0('0x2d')],'sectionId':_0x1f8c93['id']},{})[_0xa2e0('0x27')](function(){return _0x5ae589;});}else{return _0x5ae589;}})[_0xa2e0('0x48')](function(_0x16eba8){logger['error'](_0xa2e0('0x73'),_0x16eba8);throw _0x16eba8;});}return _0x5ae589;})['then'](respondWithResult(_0x275836,null))[_0xa2e0('0x48')](handleError(_0x275836,null));});_0x4abcb0[_0xa2e0('0x74')]();}catch(_0xe6bbc4){_0x275836[_0xa2e0('0x1c')](0x1f4)[_0xa2e0('0x2e')](_0xe6bbc4);}};exports['update']=function(_0x59c0c4,_0x3f4bcd,_0x51dacf){return db[_0xa2e0('0x30')][_0xa2e0('0x4d')]({'where':{'id':_0x59c0c4[_0xa2e0('0x49')]['id']}})[_0xa2e0('0x27')](handleEntityNotFound(_0x3f4bcd,null))[_0xa2e0('0x27')](saveUpdates(_['pick'](_0x59c0c4[_0xa2e0('0x70')],[_0xa2e0('0x2d'),_0xa2e0('0x75')]),null))[_0xa2e0('0x27')](respondWithResult(_0x3f4bcd,null))[_0xa2e0('0x48')](handleError(_0x3f4bcd,null));};exports[_0xa2e0('0x76')]=function(_0x358877,_0xaeb90d,_0x52d75a){return db[_0xa2e0('0x30')][_0xa2e0('0x4d')]({'where':{'id':_0x358877['params']['id']}})[_0xa2e0('0x27')](function(_0x1090b0){if(_0x1090b0){return _0x1090b0['destroy']();}})['then'](function(_0x40f00a){var _0x48fd29=path[_0xa2e0('0x51')](config[_0xa2e0('0x52')],_0xa2e0('0x77'),util[_0xa2e0('0x55')](_0xa2e0('0x56'),_0x40f00a[_0xa2e0('0x4f')],_0x40f00a[_0xa2e0('0x78')]));var _0x5731de=path[_0xa2e0('0x51')](config[_0xa2e0('0x52')],_0xa2e0('0x53'),util[_0xa2e0('0x55')](_0xa2e0('0x56'),_0x40f00a[_0xa2e0('0x4f')],_0x40f00a[_0xa2e0('0x50')]));fs[_0xa2e0('0x60')](_0x48fd29);fs['unlinkSync'](_0x5731de);return _0x40f00a;})[_0xa2e0('0x27')](function(_0x16259d){if(_0x16259d){return _0xaeb90d[_0xa2e0('0x1c')](0xcc)[_0xa2e0('0x1b')]();}})[_0xa2e0('0x27')](handleEntityNotFound(_0xaeb90d,null))[_0xa2e0('0x48')](handleError(_0xaeb90d,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 5b9a9ce..08d35e2 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 _0x6e07=['exports','define','Sound','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./sound.attributes'];(function(_0x441521,_0x1d3227){var _0x18e6d5=function(_0x13bf91){while(--_0x13bf91){_0x441521['push'](_0x441521['shift']());}};_0x18e6d5(++_0x1d3227);}(_0x6e07,0x6f));var _0x76e0=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6e07[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x76e0('0x0'));var util=require(_0x76e0('0x1'));var logger=require(_0x76e0('0x2'))('api');var moment=require(_0x76e0('0x3'));var BPromise=require('bluebird');var rp=require(_0x76e0('0x4'));var fs=require('fs');var path=require(_0x76e0('0x5'));var rimraf=require(_0x76e0('0x6'));var config=require(_0x76e0('0x7'));var attributes=require(_0x76e0('0x8'));module[_0x76e0('0x9')]=function(_0x1cf093,_0x4440c6){return _0x1cf093[_0x76e0('0xa')](_0x76e0('0xb'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5b50=['lodash','../../config/logger','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports','tools_sounds'];(function(_0x5aa66d,_0x20cfd0){var _0xb6f1f6=function(_0x452ef4){while(--_0x452ef4){_0x5aa66d['push'](_0x5aa66d['shift']());}};_0xb6f1f6(++_0x20cfd0);}(_0x5b50,0xd8));var _0x05b5=function(_0x23b642,_0x4da523){_0x23b642=_0x23b642-0x0;var _0x292947=_0x5b50[_0x23b642];return _0x292947;};'use strict';var _=require(_0x05b5('0x0'));var util=require('util');var logger=require(_0x05b5('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x05b5('0x2'));var fs=require('fs');var path=require(_0x05b5('0x3'));var rimraf=require(_0x05b5('0x4'));var config=require(_0x05b5('0x5'));var attributes=require(_0x05b5('0x6'));module[_0x05b5('0x7')]=function(_0x4b48f0,_0x328558){return _0x4b48f0['define']('Sound',attributes,{'tableName':_0x05b5('0x8'),'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 e9adbe6..1edc086 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 _0x70c1=['stringify','error','code','message','catch','Sound','find','options','where','include','model','attributes','map','ShowSound','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s'];(function(_0x1e175b,_0x2ff569){var _0x354d39=function(_0x13c22e){while(--_0x13c22e){_0x1e175b['push'](_0x1e175b['shift']());}};_0x354d39(++_0x2ff569);}(_0x70c1,0xa4));var _0x170c=function(_0x4a763a,_0x249fd4){_0x4a763a=_0x4a763a-0x0;var _0x26befb=_0x70c1[_0x4a763a];return _0x26befb;};'use strict';var _=require(_0x170c('0x0'));var util=require('util');var moment=require(_0x170c('0x1'));var BPromise=require(_0x170c('0x2'));var rs=require(_0x170c('0x3'));var fs=require('fs');var Redis=require(_0x170c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x170c('0x5'));var logger=require(_0x170c('0x6'))(_0x170c('0x7'));var config=require(_0x170c('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x170c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x46f6b7,_0x2350d0,_0x56c790){return new BPromise(function(_0x36aff5,_0x4c6e5e){return client[_0x170c('0xa')](_0x46f6b7,_0x56c790)['then'](function(_0x4ce98a){logger[_0x170c('0xb')](_0x170c('0xc'),_0x2350d0,_0x170c('0xd'));logger[_0x170c('0xe')](_0x170c('0xf'),_0x2350d0,_0x170c('0xd'),JSON[_0x170c('0x10')](_0x4ce98a));if(_0x4ce98a['error']){if(_0x4ce98a[_0x170c('0x11')][_0x170c('0x12')]===0x1f4){logger[_0x170c('0x11')](_0x170c('0xc'),_0x2350d0,_0x4ce98a[_0x170c('0x11')][_0x170c('0x13')]);return _0x4c6e5e(_0x4ce98a[_0x170c('0x11')][_0x170c('0x13')]);}logger[_0x170c('0x11')](_0x170c('0xc'),_0x2350d0,_0x4ce98a[_0x170c('0x11')][_0x170c('0x13')]);return _0x36aff5(_0x4ce98a['error'][_0x170c('0x13')]);}else{logger[_0x170c('0xb')]('Sound,\x20%s,\x20%s',_0x2350d0,'request\x20sent');_0x36aff5(_0x4ce98a['result'][_0x170c('0x13')]);}})[_0x170c('0x14')](function(_0x5101b6){logger[_0x170c('0x11')](_0x170c('0xc'),_0x2350d0,_0x5101b6);_0x4c6e5e(_0x5101b6);});});}exports['ShowSound']=function(_0x37b605){var _0x3bd7d3=this;return new Promise(function(_0x5b7d1c,_0x13343c){return db[_0x170c('0x15')][_0x170c('0x16')]({'raw':_0x37b605[_0x170c('0x17')]?_0x37b605[_0x170c('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x37b605[_0x170c('0x17')]?_0x37b605[_0x170c('0x17')][_0x170c('0x18')]||null:null,'attributes':_0x37b605[_0x170c('0x17')]?_0x37b605['options']['attributes']||null:null,'include':_0x37b605[_0x170c('0x17')]?_0x37b605[_0x170c('0x17')][_0x170c('0x19')]?_['map'](_0x37b605[_0x170c('0x17')][_0x170c('0x19')],function(_0x2636b8){return{'model':db[_0x2636b8[_0x170c('0x1a')]],'as':_0x2636b8['as'],'attributes':_0x2636b8[_0x170c('0x1b')],'include':_0x2636b8[_0x170c('0x19')]?_[_0x170c('0x1c')](_0x2636b8[_0x170c('0x19')],function(_0x45a025){return{'model':db[_0x45a025[_0x170c('0x1a')]],'as':_0x45a025['as'],'attributes':_0x45a025[_0x170c('0x1b')],'include':_0x45a025[_0x170c('0x19')]?_[_0x170c('0x1c')](_0x45a025['include'],function(_0x1ec67c){return{'model':db[_0x1ec67c[_0x170c('0x1a')]],'as':_0x1ec67c['as'],'attributes':_0x1ec67c[_0x170c('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1589d8){logger[_0x170c('0xb')](_0x170c('0x1d'),_0x37b605);logger['debug'](_0x170c('0x1d'),_0x37b605,JSON[_0x170c('0x10')](_0x1589d8));_0x5b7d1c(_0x1589d8);})[_0x170c('0x14')](function(_0x46fcae){logger['error'](_0x170c('0x1d'),_0x46fcae[_0x170c('0x13')],_0x37b605);_0x13343c(_0x3bd7d3[_0x170c('0x11')](0x1f4,_0x46fcae['message']));});});}; \ No newline at end of file +var _0x81ca=['find','options','raw','where','attributes','map','include','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','ShowSound','Sound'];(function(_0x4a7145,_0x14c18b){var _0x9e46d5=function(_0x1602fe){while(--_0x1602fe){_0x4a7145['push'](_0x4a7145['shift']());}};_0x9e46d5(++_0x14c18b);}(_0x81ca,0x1f2));var _0xa81c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x81ca[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa81c('0x0'));var util=require(_0xa81c('0x1'));var moment=require(_0xa81c('0x2'));var BPromise=require(_0xa81c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa81c('0x4'));var db=require(_0xa81c('0x5'))['db'];var utils=require(_0xa81c('0x6'));var logger=require(_0xa81c('0x7'))(_0xa81c('0x8'));var config=require(_0xa81c('0x9'));var jayson=require(_0xa81c('0xa'));var client=jayson[_0xa81c('0xb')][_0xa81c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x7c15c3,_0x4af6fd,_0x25ff71){return new BPromise(function(_0x318578,_0x465e8e){return client[_0xa81c('0xd')](_0x7c15c3,_0x25ff71)[_0xa81c('0xe')](function(_0x441f9d){logger[_0xa81c('0xf')](_0xa81c('0x10'),_0x4af6fd,_0xa81c('0x11'));logger[_0xa81c('0x12')]('Sound,\x20%s,\x20%s,\x20%s',_0x4af6fd,_0xa81c('0x11'),JSON[_0xa81c('0x13')](_0x441f9d));if(_0x441f9d[_0xa81c('0x14')]){if(_0x441f9d[_0xa81c('0x14')][_0xa81c('0x15')]===0x1f4){logger[_0xa81c('0x14')](_0xa81c('0x10'),_0x4af6fd,_0x441f9d['error'][_0xa81c('0x16')]);return _0x465e8e(_0x441f9d['error']['message']);}logger[_0xa81c('0x14')](_0xa81c('0x10'),_0x4af6fd,_0x441f9d[_0xa81c('0x14')][_0xa81c('0x16')]);return _0x318578(_0x441f9d['error'][_0xa81c('0x16')]);}else{logger['info'](_0xa81c('0x10'),_0x4af6fd,_0xa81c('0x11'));_0x318578(_0x441f9d[_0xa81c('0x17')]['message']);}})[_0xa81c('0x18')](function(_0x15983d){logger[_0xa81c('0x14')](_0xa81c('0x10'),_0x4af6fd,_0x15983d);_0x465e8e(_0x15983d);});});}exports[_0xa81c('0x19')]=function(_0x53174f){var _0x489fa0=this;return new Promise(function(_0x61afaa,_0x1a383a){return db[_0xa81c('0x1a')][_0xa81c('0x1b')]({'raw':_0x53174f[_0xa81c('0x1c')]?_0x53174f[_0xa81c('0x1c')][_0xa81c('0x1d')]===undefined?!![]:![]:!![],'where':_0x53174f[_0xa81c('0x1c')]?_0x53174f['options'][_0xa81c('0x1e')]||null:null,'attributes':_0x53174f[_0xa81c('0x1c')]?_0x53174f[_0xa81c('0x1c')][_0xa81c('0x1f')]||null:null,'include':_0x53174f[_0xa81c('0x1c')]?_0x53174f[_0xa81c('0x1c')]['include']?_[_0xa81c('0x20')](_0x53174f['options'][_0xa81c('0x21')],function(_0x5b23e0){return{'model':db[_0x5b23e0['model']],'as':_0x5b23e0['as'],'attributes':_0x5b23e0['attributes'],'include':_0x5b23e0[_0xa81c('0x21')]?_[_0xa81c('0x20')](_0x5b23e0[_0xa81c('0x21')],function(_0x3d612c){return{'model':db[_0x3d612c[_0xa81c('0x22')]],'as':_0x3d612c['as'],'attributes':_0x3d612c[_0xa81c('0x1f')],'include':_0x3d612c[_0xa81c('0x21')]?_[_0xa81c('0x20')](_0x3d612c[_0xa81c('0x21')],function(_0xc7dafb){return{'model':db[_0xc7dafb['model']],'as':_0xc7dafb['as'],'attributes':_0xc7dafb['attributes']};}):[]};}):[]};}):[]:[]})[_0xa81c('0xe')](function(_0x1244ff){logger[_0xa81c('0xf')](_0xa81c('0x19'),_0x53174f);logger[_0xa81c('0x12')](_0xa81c('0x19'),_0x53174f,JSON[_0xa81c('0x13')](_0x1244ff));_0x61afaa(_0x1244ff);})[_0xa81c('0x18')](function(_0x2d1332){logger[_0xa81c('0x14')](_0xa81c('0x19'),_0x2d1332[_0xa81c('0x16')],_0x53174f);_0x1a383a(_0x489fa0[_0xa81c('0x14')](0x1f4,_0x2d1332[_0xa81c('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 55a9fd2..e952a90 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 _0x0b0e=['./squareMessage.controller','get','isAuthenticated','index','show','post','create','/:id','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5d8631,_0x44944b){var _0x34c15e=function(_0x4448f8){while(--_0x4448f8){_0x5d8631['push'](_0x5d8631['shift']());}};_0x34c15e(++_0x44944b);}(_0x0b0e,0x187));var _0xe0b0=function(_0x19ee96,_0x48b7d5){_0x19ee96=_0x19ee96-0x0;var _0x57aaf0=_0x0b0e[_0x19ee96];return _0x57aaf0;};'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('0xd')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xe')]);router['put'](_0xe0b0('0xf'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x10')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x11')]);module[_0xe0b0('0x12')]=router; \ No newline at end of file +var _0xbaf0=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','util','path'];(function(_0x203647,_0x3510d5){var _0x3a3f74=function(_0x755b07){while(--_0x755b07){_0x203647['push'](_0x203647['shift']());}};_0x3a3f74(++_0x3510d5);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['show']);router[_0x0baf('0xd')]('/',auth['isAuthenticated'](),controller[_0x0baf('0xe')]);router[_0x0baf('0xf')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x10')]);router[_0x0baf('0x11')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);module[_0x0baf('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index f2600f6..501de53 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 _0x2b9a=['out','sequelize','exports','STRING','TEXT','medium'];(function(_0x39c747,_0x297706){var _0x523e66=function(_0x170198){while(--_0x170198){_0x39c747['push'](_0x39c747['shift']());}};_0x523e66(++_0x297706);}(_0x2b9a,0x1c3));var _0xa2b9=function(_0x2c8328,_0x21548a){_0x2c8328=_0x2c8328-0x0;var _0x10a892=_0x2b9a[_0x2c8328];return _0x10a892;};'use strict';var Sequelize=require(_0xa2b9('0x0'));module[_0xa2b9('0x1')]={'uniqueid':{'type':Sequelize[_0xa2b9('0x2')]},'body':{'type':Sequelize[_0xa2b9('0x3')](_0xa2b9('0x4')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0xa2b9('0x5')),'defaultValue':_0xa2b9('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0xa2b9('0x2')]},'providerResponse':{'type':Sequelize[_0xa2b9('0x3')]}}; \ No newline at end of file +var _0x5ada=['ENUM','out','sequelize','STRING','TEXT','medium'];(function(_0x4336cf,_0x4ca974){var _0x278f11=function(_0x407e98){while(--_0x407e98){_0x4336cf['push'](_0x4336cf['shift']());}};_0x278f11(++_0x4ca974);}(_0x5ada,0x12e));var _0xa5ad=function(_0x1ca8d8,_0x17aa35){_0x1ca8d8=_0x1ca8d8-0x0;var _0x1161d8=_0x5ada[_0x1ca8d8];return _0x1161d8;};'use strict';var Sequelize=require(_0xa5ad('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xa5ad('0x1')]},'body':{'type':Sequelize[_0xa5ad('0x2')](_0xa5ad('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0xa5ad('0x4')]('in',_0xa5ad('0x5')),'defaultValue':_0xa5ad('0x5'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xa5ad('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index a381294..16aa921 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 _0x46ec=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','end','status','undefined','count','offset','set','Content-Range','json','save','destroy','then','stack','send','index','map','rawAttributes','name','keys','query','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','VIRTUAL','merge','includeAll','include','SquareMessage','findAll','rows','catch','params','intersection','options','find','create','body','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','ioredis'];(function(_0x239131,_0x2aa120){var _0x247bec=function(_0x2c4000){while(--_0x2c4000){_0x239131['push'](_0x239131['shift']());}};_0x247bec(++_0x2aa120);}(_0x46ec,0x145));var _0xc46e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x46ec[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc46e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc46e('0x1'));var rp=require(_0xc46e('0x2'));var moment=require(_0xc46e('0x3'));var BPromise=require(_0xc46e('0x4'));var Mustache=require(_0xc46e('0x5'));var util=require(_0xc46e('0x6'));var path=require('path');var sox=require(_0xc46e('0x7'));var csv=require(_0xc46e('0x8'));var ejs=require(_0xc46e('0x9'));var fs=require('fs');var fs_extra=require(_0xc46e('0xa'));var _=require('lodash');var squel=require(_0xc46e('0xb'));var crypto=require(_0xc46e('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc46e('0x8'));var querystring=require(_0xc46e('0xd'));var Papa=require('papaparse');var Redis=require(_0xc46e('0xe'));var authService=require(_0xc46e('0xf'));var qs=require(_0xc46e('0x10'));var as=require(_0xc46e('0x11'));var hardwareService=require(_0xc46e('0x12'));var logger=require(_0xc46e('0x13'))('api');var utils=require(_0xc46e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xc46e('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45c963,_0x1d752f){_0x1d752f=_0x1d752f||0xcc;return function(_0x2e2a56){if(_0x2e2a56){return _0x45c963[_0xc46e('0x16')](_0x1d752f);}return _0x45c963['status'](_0x1d752f)[_0xc46e('0x17')]();};}function respondWithResult(_0x45d25d,_0x51140c){_0x51140c=_0x51140c||0xc8;return function(_0x51affb){if(_0x51affb){return _0x45d25d[_0xc46e('0x18')](_0x51140c)['json'](_0x51affb);}};}function respondWithFilteredResult(_0x39752c,_0x590b68){return function(_0x3f61d3){if(_0x3f61d3){var _0x3bcf4e=typeof _0x590b68['offset']===_0xc46e('0x19')&&typeof _0x590b68['limit']===_0xc46e('0x19');var _0x285531=_0x3f61d3[_0xc46e('0x1a')];var _0x1952e4=_0x3bcf4e?0x0:_0x590b68[_0xc46e('0x1b')];var _0x35cf35=_0x3bcf4e?_0x3f61d3[_0xc46e('0x1a')]:_0x590b68[_0xc46e('0x1b')]+_0x590b68['limit'];var _0x14a84b;if(_0x35cf35>=_0x285531){_0x35cf35=_0x285531;_0x14a84b=0xc8;}else{_0x14a84b=0xce;}_0x39752c['status'](_0x14a84b);return _0x39752c[_0xc46e('0x1c')](_0xc46e('0x1d'),_0x1952e4+'-'+_0x35cf35+'/'+_0x285531)[_0xc46e('0x1e')](_0x3f61d3);}return null;};}function patchUpdates(_0x429e7b){return function(_0x407c99){try{jsonpatch['apply'](_0x407c99,_0x429e7b,!![]);}catch(_0x33c565){return BPromise['reject'](_0x33c565);}return _0x407c99[_0xc46e('0x1f')]();};}function saveUpdates(_0x13bbec,_0x6cc51b){return function(_0x2ad4cb){if(_0x2ad4cb){return _0x2ad4cb['update'](_0x13bbec)['then'](function(_0x285522){return _0x285522;});}return null;};}function removeEntity(_0x43573d,_0x4db27f){return function(_0x1c164c){if(_0x1c164c){return _0x1c164c[_0xc46e('0x20')]()[_0xc46e('0x21')](function(){_0x43573d[_0xc46e('0x18')](0xcc)[_0xc46e('0x17')]();});}};}function handleEntityNotFound(_0x59edb9,_0x1731a2){return function(_0x3ab660){if(!_0x3ab660){_0x59edb9[_0xc46e('0x16')](0x194);}return _0x3ab660;};}function handleError(_0x16a4d8,_0x22db2f){_0x22db2f=_0x22db2f||0x1f4;return function(_0x5e5ae5){logger['error'](_0x5e5ae5[_0xc46e('0x22')]);if(_0x5e5ae5['name']){delete _0x5e5ae5['name'];}_0x16a4d8[_0xc46e('0x18')](_0x22db2f)[_0xc46e('0x23')](_0x5e5ae5);};}exports[_0xc46e('0x24')]=function(_0xe91168,_0x310ade){var _0x1c9e52={},_0x13bacf={},_0x1e137a={'count':0x0,'rows':[]};var _0x50ac0f=_[_0xc46e('0x25')](db['SquareMessage'][_0xc46e('0x26')],function(_0x1b625b){return{'name':_0x1b625b['fieldName'],'type':_0x1b625b['type']['key']};});_0x13bacf['model']=_[_0xc46e('0x25')](_0x50ac0f,_0xc46e('0x27'));_0x13bacf['query']=_[_0xc46e('0x28')](_0xe91168[_0xc46e('0x29')]);_0x13bacf['filters']=_['intersection'](_0x13bacf[_0xc46e('0x2a')],_0x13bacf[_0xc46e('0x29')]);_0x1c9e52[_0xc46e('0x2b')]=_['intersection'](_0x13bacf[_0xc46e('0x2a')],qs['fields'](_0xe91168[_0xc46e('0x29')][_0xc46e('0x2c')]));_0x1c9e52['attributes']=_0x1c9e52['attributes'][_0xc46e('0x2d')]?_0x1c9e52[_0xc46e('0x2b')]:_0x13bacf[_0xc46e('0x2a')];if(!_0xe91168['query'][_0xc46e('0x2e')](_0xc46e('0x2f'))){_0x1c9e52[_0xc46e('0x30')]=qs[_0xc46e('0x30')](_0xe91168[_0xc46e('0x29')]['limit']);_0x1c9e52['offset']=qs[_0xc46e('0x1b')](_0xe91168[_0xc46e('0x29')][_0xc46e('0x1b')]);}_0x1c9e52[_0xc46e('0x31')]=qs[_0xc46e('0x32')](_0xe91168[_0xc46e('0x29')][_0xc46e('0x32')]);_0x1c9e52[_0xc46e('0x33')]=qs[_0xc46e('0x34')](_['pick'](_0xe91168['query'],_0x13bacf[_0xc46e('0x34')]),_0x50ac0f);if(_0xe91168[_0xc46e('0x29')][_0xc46e('0x35')]){_0x1c9e52[_0xc46e('0x33')]=_['merge'](_0x1c9e52[_0xc46e('0x33')],{'$or':_[_0xc46e('0x25')](_0x50ac0f,function(_0x105f5f){if(_0x105f5f['type']!==_0xc46e('0x36')){var _0x393d7a={};_0x393d7a[_0x105f5f[_0xc46e('0x27')]]={'$like':'%'+_0xe91168[_0xc46e('0x29')]['filter']+'%'};return _0x393d7a;}})});}_0x1c9e52=_[_0xc46e('0x37')]({},_0x1c9e52,_0xe91168['options']);var _0x9dfc5d={'where':_0x1c9e52[_0xc46e('0x33')]};return db['SquareMessage']['count'](_0x9dfc5d)[_0xc46e('0x21')](function(_0x32e24e){_0x1e137a[_0xc46e('0x1a')]=_0x32e24e;if(_0xe91168[_0xc46e('0x29')][_0xc46e('0x38')]){_0x1c9e52[_0xc46e('0x39')]=[{'all':!![]}];}return db[_0xc46e('0x3a')][_0xc46e('0x3b')](_0x1c9e52);})['then'](function(_0x3d3073){_0x1e137a[_0xc46e('0x3c')]=_0x3d3073;return _0x1e137a;})[_0xc46e('0x21')](respondWithFilteredResult(_0x310ade,_0x1c9e52))[_0xc46e('0x3d')](handleError(_0x310ade,null));};exports['show']=function(_0x1016a9,_0x49b15b){var _0x54cd70={'raw':!![],'where':{'id':_0x1016a9[_0xc46e('0x3e')]['id']}},_0x4f1e52={};_0x4f1e52[_0xc46e('0x2a')]=_[_0xc46e('0x28')](db[_0xc46e('0x3a')][_0xc46e('0x26')]);_0x4f1e52['query']=_[_0xc46e('0x28')](_0x1016a9[_0xc46e('0x29')]);_0x4f1e52[_0xc46e('0x34')]=_[_0xc46e('0x3f')](_0x4f1e52['model'],_0x4f1e52['query']);_0x54cd70[_0xc46e('0x2b')]=_[_0xc46e('0x3f')](_0x4f1e52[_0xc46e('0x2a')],qs[_0xc46e('0x2c')](_0x1016a9['query'][_0xc46e('0x2c')]));_0x54cd70[_0xc46e('0x2b')]=_0x54cd70[_0xc46e('0x2b')]['length']?_0x54cd70[_0xc46e('0x2b')]:_0x4f1e52[_0xc46e('0x2a')];if(_0x1016a9['query'][_0xc46e('0x38')]){_0x54cd70[_0xc46e('0x39')]=[{'all':!![]}];}_0x54cd70=_[_0xc46e('0x37')]({},_0x54cd70,_0x1016a9[_0xc46e('0x40')]);return db['SquareMessage'][_0xc46e('0x41')](_0x54cd70)[_0xc46e('0x21')](handleEntityNotFound(_0x49b15b,null))['then'](respondWithResult(_0x49b15b,null))[_0xc46e('0x3d')](handleError(_0x49b15b,null));};exports[_0xc46e('0x42')]=function(_0xff820e,_0xdb1c28){return db['SquareMessage'][_0xc46e('0x42')](_0xff820e['body'],{})['then'](respondWithResult(_0xdb1c28,0xc9))['catch'](handleError(_0xdb1c28,null));};exports['update']=function(_0x19e933,_0x1f1285){if(_0x19e933[_0xc46e('0x43')]['id']){delete _0x19e933[_0xc46e('0x43')]['id'];}return db[_0xc46e('0x3a')][_0xc46e('0x41')]({'where':{'id':_0x19e933[_0xc46e('0x3e')]['id']}})[_0xc46e('0x21')](handleEntityNotFound(_0x1f1285,null))[_0xc46e('0x21')](saveUpdates(_0x19e933[_0xc46e('0x43')],null))[_0xc46e('0x21')](respondWithResult(_0x1f1285,null))[_0xc46e('0x3d')](handleError(_0x1f1285,null));};exports[_0xc46e('0x20')]=function(_0x5cd0fb,_0x2dc23c){return db[_0xc46e('0x3a')][_0xc46e('0x41')]({'where':{'id':_0x5cd0fb['params']['id']}})[_0xc46e('0x21')](handleEntityNotFound(_0x2dc23c,null))['then'](removeEntity(_0x2dc23c,null))['catch'](handleError(_0x2dc23c,null));}; \ No newline at end of file +var _0xd76b=['catch','rawAttributes','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','error','stack','name','index','map','SquareMessage','fieldName','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll'];(function(_0x2fb96e,_0x5d0988){var _0x35d03e=function(_0x3ed445){while(--_0x3ed445){_0x2fb96e['push'](_0x2fb96e['shift']());}};_0x35d03e(++_0x5d0988);}(_0xd76b,0x11a));var _0xbd76=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xd76b[_0x3511d3];return _0x5d6321;};'use strict';var emlformat=require(_0xbd76('0x0'));var rimraf=require(_0xbd76('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbd76('0x2'));var rp=require(_0xbd76('0x3'));var moment=require('moment');var BPromise=require(_0xbd76('0x4'));var Mustache=require(_0xbd76('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xbd76('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbd76('0x7'));var _=require(_0xbd76('0x8'));var squel=require(_0xbd76('0x9'));var crypto=require(_0xbd76('0xa'));var jsforce=require(_0xbd76('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xbd76('0x6'));var querystring=require(_0xbd76('0xc'));var Papa=require(_0xbd76('0xd'));var Redis=require('ioredis');var authService=require(_0xbd76('0xe'));var qs=require(_0xbd76('0xf'));var as=require(_0xbd76('0x10'));var hardwareService=require(_0xbd76('0x11'));var logger=require(_0xbd76('0x12'))('api');var utils=require(_0xbd76('0x13'));var config=require(_0xbd76('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xbd76('0x15'))['db'];function respondWithStatusCode(_0x2e1904,_0x2e0920){_0x2e0920=_0x2e0920||0xcc;return function(_0x3915bc){if(_0x3915bc){return _0x2e1904[_0xbd76('0x16')](_0x2e0920);}return _0x2e1904[_0xbd76('0x17')](_0x2e0920)[_0xbd76('0x18')]();};}function respondWithResult(_0x2dbc00,_0x14583c){_0x14583c=_0x14583c||0xc8;return function(_0x3ed4da){if(_0x3ed4da){return _0x2dbc00['status'](_0x14583c)[_0xbd76('0x19')](_0x3ed4da);}};}function respondWithFilteredResult(_0x228c1c,_0x278763){return function(_0x44ce99){if(_0x44ce99){var _0xcf27e8=typeof _0x278763['offset']===_0xbd76('0x1a')&&typeof _0x278763[_0xbd76('0x1b')]===_0xbd76('0x1a');var _0x27d757=_0x44ce99[_0xbd76('0x1c')];var _0x183962=_0xcf27e8?0x0:_0x278763[_0xbd76('0x1d')];var _0x367b22=_0xcf27e8?_0x44ce99[_0xbd76('0x1c')]:_0x278763[_0xbd76('0x1d')]+_0x278763['limit'];var _0x4f5eaf;if(_0x367b22>=_0x27d757){_0x367b22=_0x27d757;_0x4f5eaf=0xc8;}else{_0x4f5eaf=0xce;}_0x228c1c[_0xbd76('0x17')](_0x4f5eaf);return _0x228c1c[_0xbd76('0x1e')](_0xbd76('0x1f'),_0x183962+'-'+_0x367b22+'/'+_0x27d757)['json'](_0x44ce99);}return null;};}function patchUpdates(_0x33c6cf){return function(_0x5104db){try{jsonpatch[_0xbd76('0x20')](_0x5104db,_0x33c6cf,!![]);}catch(_0x2dce7b){return BPromise['reject'](_0x2dce7b);}return _0x5104db[_0xbd76('0x21')]();};}function saveUpdates(_0x521823,_0x2cc68c){return function(_0x4b0a0a){if(_0x4b0a0a){return _0x4b0a0a[_0xbd76('0x22')](_0x521823)[_0xbd76('0x23')](function(_0x32afae){return _0x32afae;});}return null;};}function removeEntity(_0x3c2b42,_0x5c7d30){return function(_0x1a68d4){if(_0x1a68d4){return _0x1a68d4['destroy']()[_0xbd76('0x23')](function(){_0x3c2b42[_0xbd76('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12bc46,_0x3919c5){return function(_0x644639){if(!_0x644639){_0x12bc46['sendStatus'](0x194);}return _0x644639;};}function handleError(_0x1d09de,_0x130422){_0x130422=_0x130422||0x1f4;return function(_0x23ed77){logger[_0xbd76('0x24')](_0x23ed77[_0xbd76('0x25')]);if(_0x23ed77[_0xbd76('0x26')]){delete _0x23ed77[_0xbd76('0x26')];}_0x1d09de[_0xbd76('0x17')](_0x130422)['send'](_0x23ed77);};}exports[_0xbd76('0x27')]=function(_0x314b23,_0x42ffca){var _0x5c9c28={},_0x2a812f={},_0x235a32={'count':0x0,'rows':[]};var _0x1ac9d9=_[_0xbd76('0x28')](db[_0xbd76('0x29')]['rawAttributes'],function(_0x5bc5cd){return{'name':_0x5bc5cd[_0xbd76('0x2a')],'type':_0x5bc5cd['type'][_0xbd76('0x2b')]};});_0x2a812f['model']=_['map'](_0x1ac9d9,_0xbd76('0x26'));_0x2a812f[_0xbd76('0x2c')]=_[_0xbd76('0x2d')](_0x314b23['query']);_0x2a812f[_0xbd76('0x2e')]=_[_0xbd76('0x2f')](_0x2a812f['model'],_0x2a812f[_0xbd76('0x2c')]);_0x5c9c28[_0xbd76('0x30')]=_['intersection'](_0x2a812f[_0xbd76('0x31')],qs[_0xbd76('0x32')](_0x314b23[_0xbd76('0x2c')]['fields']));_0x5c9c28[_0xbd76('0x30')]=_0x5c9c28[_0xbd76('0x30')][_0xbd76('0x33')]?_0x5c9c28[_0xbd76('0x30')]:_0x2a812f[_0xbd76('0x31')];if(!_0x314b23[_0xbd76('0x2c')][_0xbd76('0x34')](_0xbd76('0x35'))){_0x5c9c28[_0xbd76('0x1b')]=qs[_0xbd76('0x1b')](_0x314b23[_0xbd76('0x2c')][_0xbd76('0x1b')]);_0x5c9c28['offset']=qs[_0xbd76('0x1d')](_0x314b23[_0xbd76('0x2c')]['offset']);}_0x5c9c28[_0xbd76('0x36')]=qs['sort'](_0x314b23[_0xbd76('0x2c')][_0xbd76('0x37')]);_0x5c9c28[_0xbd76('0x38')]=qs['filters'](_[_0xbd76('0x39')](_0x314b23['query'],_0x2a812f[_0xbd76('0x2e')]),_0x1ac9d9);if(_0x314b23['query'][_0xbd76('0x3a')]){_0x5c9c28['where']=_['merge'](_0x5c9c28['where'],{'$or':_[_0xbd76('0x28')](_0x1ac9d9,function(_0x391d29){if(_0x391d29['type']!=='VIRTUAL'){var _0xb8186f={};_0xb8186f[_0x391d29[_0xbd76('0x26')]]={'$like':'%'+_0x314b23[_0xbd76('0x2c')]['filter']+'%'};return _0xb8186f;}})});}_0x5c9c28=_[_0xbd76('0x3b')]({},_0x5c9c28,_0x314b23[_0xbd76('0x3c')]);var _0x13b56a={'where':_0x5c9c28[_0xbd76('0x38')]};return db[_0xbd76('0x29')]['count'](_0x13b56a)[_0xbd76('0x23')](function(_0x12510a){_0x235a32[_0xbd76('0x1c')]=_0x12510a;if(_0x314b23[_0xbd76('0x2c')][_0xbd76('0x3d')]){_0x5c9c28['include']=[{'all':!![]}];}return db['SquareMessage'][_0xbd76('0x3e')](_0x5c9c28);})[_0xbd76('0x23')](function(_0xfdd817){_0x235a32['rows']=_0xfdd817;return _0x235a32;})[_0xbd76('0x23')](respondWithFilteredResult(_0x42ffca,_0x5c9c28))[_0xbd76('0x3f')](handleError(_0x42ffca,null));};exports['show']=function(_0x480665,_0x1a4ae6){var _0x1b9fa7={'raw':!![],'where':{'id':_0x480665['params']['id']}},_0x5292ba={};_0x5292ba[_0xbd76('0x31')]=_[_0xbd76('0x2d')](db[_0xbd76('0x29')][_0xbd76('0x40')]);_0x5292ba[_0xbd76('0x2c')]=_[_0xbd76('0x2d')](_0x480665[_0xbd76('0x2c')]);_0x5292ba['filters']=_[_0xbd76('0x2f')](_0x5292ba[_0xbd76('0x31')],_0x5292ba['query']);_0x1b9fa7[_0xbd76('0x30')]=_['intersection'](_0x5292ba[_0xbd76('0x31')],qs['fields'](_0x480665['query']['fields']));_0x1b9fa7[_0xbd76('0x30')]=_0x1b9fa7[_0xbd76('0x30')]['length']?_0x1b9fa7[_0xbd76('0x30')]:_0x5292ba[_0xbd76('0x31')];if(_0x480665[_0xbd76('0x2c')][_0xbd76('0x3d')]){_0x1b9fa7['include']=[{'all':!![]}];}_0x1b9fa7=_[_0xbd76('0x3b')]({},_0x1b9fa7,_0x480665[_0xbd76('0x3c')]);return db['SquareMessage'][_0xbd76('0x41')](_0x1b9fa7)[_0xbd76('0x23')](handleEntityNotFound(_0x1a4ae6,null))[_0xbd76('0x23')](respondWithResult(_0x1a4ae6,null))[_0xbd76('0x3f')](handleError(_0x1a4ae6,null));};exports[_0xbd76('0x42')]=function(_0x235ee0,_0x3ee2c7){return db[_0xbd76('0x29')][_0xbd76('0x42')](_0x235ee0[_0xbd76('0x43')],{})[_0xbd76('0x23')](respondWithResult(_0x3ee2c7,0xc9))['catch'](handleError(_0x3ee2c7,null));};exports[_0xbd76('0x22')]=function(_0x247084,_0x323551){if(_0x247084['body']['id']){delete _0x247084['body']['id'];}return db[_0xbd76('0x29')][_0xbd76('0x41')]({'where':{'id':_0x247084[_0xbd76('0x44')]['id']}})[_0xbd76('0x23')](handleEntityNotFound(_0x323551,null))['then'](saveUpdates(_0x247084['body'],null))[_0xbd76('0x23')](respondWithResult(_0x323551,null))[_0xbd76('0x3f')](handleError(_0x323551,null));};exports['destroy']=function(_0x58533c,_0x5a9730){return db['SquareMessage']['find']({'where':{'id':_0x58533c[_0xbd76('0x44')]['id']}})['then'](handleEntityNotFound(_0x5a9730,null))[_0xbd76('0x23')](removeEntity(_0x5a9730,null))[_0xbd76('0x3f')](handleError(_0x5a9730,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 13d0f36..9621a1d 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 _0xfaa8=['define','SquareMessage','square_messages','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./squareMessage.attributes','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfaa8,0x71));var _0x8faa=function(_0x5def46,_0xd0427){_0x5def46=_0x5def46-0x0;var _0x5498d3=_0xfaa8[_0x5def46];return _0x5498d3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8faa('0x0'))('api');var moment=require(_0x8faa('0x1'));var BPromise=require('bluebird');var rp=require(_0x8faa('0x2'));var fs=require('fs');var path=require(_0x8faa('0x3'));var rimraf=require(_0x8faa('0x4'));var config=require(_0x8faa('0x5'));var attributes=require(_0x8faa('0x6'));module[_0x8faa('0x7')]=function(_0x1e0452,_0x2659dd){return _0x1e0452[_0x8faa('0x8')](_0x8faa('0x9'),attributes,{'tableName':_0x8faa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf835=['exports','square_messages','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./squareMessage.attributes'];(function(_0x128bef,_0xc7a0af){var _0x1ba862=function(_0x4858e8){while(--_0x4858e8){_0x128bef['push'](_0x128bef['shift']());}};_0x1ba862(++_0xc7a0af);}(_0xf835,0x9e));var _0x5f83=function(_0x4cf747,_0x45269a){_0x4cf747=_0x4cf747-0x0;var _0x581a43=_0xf835[_0x4cf747];return _0x581a43;};'use strict';var _=require(_0x5f83('0x0'));var util=require(_0x5f83('0x1'));var logger=require(_0x5f83('0x2'))(_0x5f83('0x3'));var moment=require(_0x5f83('0x4'));var BPromise=require(_0x5f83('0x5'));var rp=require(_0x5f83('0x6'));var fs=require('fs');var path=require(_0x5f83('0x7'));var rimraf=require(_0x5f83('0x8'));var config=require('../../config/environment');var attributes=require(_0x5f83('0x9'));module[_0x5f83('0xa')]=function(_0x2a7670,_0x129e82){return _0x2a7670['define']('SquareMessage',attributes,{'tableName':_0x5f83('0xb'),'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 6bdd9e4..5f01e51 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 _0xd3e1=['request','info','SquareMessage,\x20%s,\x20%s','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','then','debug','stringify','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x208f56,_0x500f1b){var _0x4868e5=function(_0x56c220){while(--_0x56c220){_0x208f56['push'](_0x208f56['shift']());}};_0x4868e5(++_0x500f1b);}(_0xd3e1,0xb4));var _0x1d3e=function(_0x344718,_0x29f0a0){_0x344718=_0x344718-0x0;var _0x53d74e=_0xd3e1[_0x344718];return _0x53d74e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1d3e('0x0'));var BPromise=require(_0x1d3e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1d3e('0x2'))['db'];var utils=require(_0x1d3e('0x3'));var logger=require('../../config/logger')(_0x1d3e('0x4'));var config=require(_0x1d3e('0x5'));var jayson=require(_0x1d3e('0x6'));var client=jayson[_0x1d3e('0x7')][_0x1d3e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1606ca,_0x3bd4bf,_0x3c35c8){return new BPromise(function(_0x3f601d,_0xf139cb){return client[_0x1d3e('0x9')](_0x1606ca,_0x3c35c8)['then'](function(_0x5d7b95){logger[_0x1d3e('0xa')](_0x1d3e('0xb'),_0x3bd4bf,'request\x20sent');logger['debug'](_0x1d3e('0xc'),_0x3bd4bf,_0x1d3e('0xd'),JSON['stringify'](_0x5d7b95));if(_0x5d7b95[_0x1d3e('0xe')]){if(_0x5d7b95[_0x1d3e('0xe')]['code']===0x1f4){logger[_0x1d3e('0xe')]('SquareMessage,\x20%s,\x20%s',_0x3bd4bf,_0x5d7b95[_0x1d3e('0xe')]['message']);return _0xf139cb(_0x5d7b95[_0x1d3e('0xe')][_0x1d3e('0xf')]);}logger[_0x1d3e('0xe')](_0x1d3e('0xb'),_0x3bd4bf,_0x5d7b95[_0x1d3e('0xe')][_0x1d3e('0xf')]);return _0x3f601d(_0x5d7b95[_0x1d3e('0xe')][_0x1d3e('0xf')]);}else{logger[_0x1d3e('0xa')](_0x1d3e('0xb'),_0x3bd4bf,'request\x20sent');_0x3f601d(_0x5d7b95[_0x1d3e('0x10')][_0x1d3e('0xf')]);}})[_0x1d3e('0x11')](function(_0x4da300){logger[_0x1d3e('0xe')](_0x1d3e('0xb'),_0x3bd4bf,_0x4da300);_0xf139cb(_0x4da300);});});}exports[_0x1d3e('0x12')]=function(_0x4871cc){var _0x1483cb=this;return new Promise(function(_0x30b28e,_0x3b82eb){return db[_0x1d3e('0x13')][_0x1d3e('0x14')](_0x4871cc[_0x1d3e('0x15')],{'raw':_0x4871cc[_0x1d3e('0x16')]?_0x4871cc[_0x1d3e('0x16')][_0x1d3e('0x17')]===undefined?!![]:![]:!![]})[_0x1d3e('0x18')](function(_0x2a0bdc){logger[_0x1d3e('0xa')](_0x1d3e('0x12'),_0x4871cc);logger[_0x1d3e('0x19')]('CreateSquareMessage',_0x4871cc,JSON[_0x1d3e('0x1a')](_0x2a0bdc));_0x30b28e(_0x2a0bdc);})['catch'](function(_0x524b04){logger[_0x1d3e('0xe')]('CreateSquareMessage',_0x524b04[_0x1d3e('0xf')],_0x4871cc);_0x3b82eb(_0x1483cb[_0x1d3e('0xe')](0x1f4,_0x524b04[_0x1d3e('0xf')]));});});}; \ No newline at end of file +var _0x5a8f=['request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareMessage','SquareMessage','create','body','options','debug','lodash','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','SquareMessage,\x20%s,\x20%s'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x5a8f,0x152));var _0xf5a8=function(_0x2aed6b,_0x14ddb2){_0x2aed6b=_0x2aed6b-0x0;var _0x3a703d=_0x5a8f[_0x2aed6b];return _0x3a703d;};'use strict';var _=require(_0xf5a8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf5a8('0x1'));var rs=require(_0xf5a8('0x2'));var fs=require('fs');var Redis=require(_0xf5a8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf5a8('0x4'));var logger=require('../../config/logger')(_0xf5a8('0x5'));var config=require(_0xf5a8('0x6'));var jayson=require(_0xf5a8('0x7'));var client=jayson['client'][_0xf5a8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x23c8f3,_0x56bd1f,_0x4b88fa){return new BPromise(function(_0x15a4c3,_0xfa7066){return client[_0xf5a8('0x9')](_0x23c8f3,_0x4b88fa)[_0xf5a8('0xa')](function(_0x229f74){logger[_0xf5a8('0xb')](_0xf5a8('0xc'),_0x56bd1f,_0xf5a8('0xd'));logger['debug'](_0xf5a8('0xe'),_0x56bd1f,_0xf5a8('0xd'),JSON[_0xf5a8('0xf')](_0x229f74));if(_0x229f74[_0xf5a8('0x10')]){if(_0x229f74['error'][_0xf5a8('0x11')]===0x1f4){logger['error'](_0xf5a8('0xc'),_0x56bd1f,_0x229f74[_0xf5a8('0x10')][_0xf5a8('0x12')]);return _0xfa7066(_0x229f74[_0xf5a8('0x10')][_0xf5a8('0x12')]);}logger[_0xf5a8('0x10')](_0xf5a8('0xc'),_0x56bd1f,_0x229f74[_0xf5a8('0x10')][_0xf5a8('0x12')]);return _0x15a4c3(_0x229f74['error'][_0xf5a8('0x12')]);}else{logger['info'](_0xf5a8('0xc'),_0x56bd1f,_0xf5a8('0xd'));_0x15a4c3(_0x229f74[_0xf5a8('0x13')][_0xf5a8('0x12')]);}})[_0xf5a8('0x14')](function(_0xc4fc9){logger['error'](_0xf5a8('0xc'),_0x56bd1f,_0xc4fc9);_0xfa7066(_0xc4fc9);});});}exports[_0xf5a8('0x15')]=function(_0x2fa7a5){var _0x1213ae=this;return new Promise(function(_0x1c2810,_0x15da2e){return db[_0xf5a8('0x16')][_0xf5a8('0x17')](_0x2fa7a5[_0xf5a8('0x18')],{'raw':_0x2fa7a5[_0xf5a8('0x19')]?_0x2fa7a5[_0xf5a8('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xf5a8('0xa')](function(_0x550917){logger[_0xf5a8('0xb')]('CreateSquareMessage',_0x2fa7a5);logger[_0xf5a8('0x1a')](_0xf5a8('0x15'),_0x2fa7a5,JSON['stringify'](_0x550917));_0x1c2810(_0x550917);})[_0xf5a8('0x14')](function(_0x3705f1){logger[_0xf5a8('0x10')](_0xf5a8('0x15'),_0x3705f1[_0xf5a8('0x12')],_0x2fa7a5);_0x15da2e(_0x1213ae[_0xf5a8('0x10')](0x1f4,_0x3705f1[_0xf5a8('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index a18bd26..cb56d25 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 _0x563d=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id/test','15s','post','create','put','/:id','update','destroy','exports','multer','util','path'];(function(_0x1d255a,_0x4ff7cc){var _0xc3bb0f=function(_0x21fbec){while(--_0x21fbec){_0x1d255a['push'](_0x1d255a['shift']());}};_0xc3bb0f(++_0x4ff7cc);}(_0x563d,0xf9));var _0xd563=function(_0x3bb5b4,_0x128455){_0x3bb5b4=_0x3bb5b4-0x0;var _0x586c60=_0x563d[_0x3bb5b4];return _0x586c60;};'use strict';var multer=require(_0xd563('0x0'));var util=require(_0xd563('0x1'));var path=require(_0xd563('0x2'));var timeout=require(_0xd563('0x3'));var express=require(_0xd563('0x4'));var router=express[_0xd563('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd563('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd563('0x7'));var controller=require(_0xd563('0x8'));router[_0xd563('0x9')]('/',auth[_0xd563('0xa')](),controller[_0xd563('0xb')]);router[_0xd563('0x9')]('/:id',auth[_0xd563('0xa')](),controller['show']);router[_0xd563('0x9')](_0xd563('0xc'),auth[_0xd563('0xa')](),timeout(_0xd563('0xd')),controller['test']);router[_0xd563('0xe')]('/',auth['isAuthenticated'](),controller[_0xd563('0xf')]);router[_0xd563('0x10')](_0xd563('0x11'),auth[_0xd563('0xa')](),controller[_0xd563('0x12')]);router['delete'](_0xd563('0x11'),auth['isAuthenticated'](),controller[_0xd563('0x13')]);module[_0xd563('0x14')]=router; \ No newline at end of file +var _0x4129=['index','/:id','show','/:id/test','15s','test','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x19a0ad,_0x5fccbf){var _0xba8e74=function(_0x5726be){while(--_0x5726be){_0x19a0ad['push'](_0x19a0ad['shift']());}};_0xba8e74(++_0x5fccbf);}(_0x4129,0xfe));var _0x9412=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4129[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x9412('0x0'));var util=require(_0x9412('0x1'));var path=require(_0x9412('0x2'));var timeout=require(_0x9412('0x3'));var express=require(_0x9412('0x4'));var router=express['Router']();var fs_extra=require(_0x9412('0x5'));var auth=require(_0x9412('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9412('0x7'));var controller=require('./squareOdbc.controller');router[_0x9412('0x8')]('/',auth[_0x9412('0x9')](),controller[_0x9412('0xa')]);router[_0x9412('0x8')](_0x9412('0xb'),auth['isAuthenticated'](),controller[_0x9412('0xc')]);router['get'](_0x9412('0xd'),auth['isAuthenticated'](),timeout(_0x9412('0xe')),controller[_0x9412('0xf')]);router[_0x9412('0x10')]('/',auth[_0x9412('0x9')](),controller[_0x9412('0x11')]);router[_0x9412('0x12')](_0x9412('0xb'),auth[_0x9412('0x9')](),controller[_0x9412('0x13')]);router['delete'](_0x9412('0xb'),auth['isAuthenticated'](),controller[_0x9412('0x14')]);module[_0x9412('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 2675d8f..7280012 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 _0xc17d=['sequelize','exports','STRING'];(function(_0x1d5c25,_0x34ec2d){var _0x1a2676=function(_0x188a7b){while(--_0x188a7b){_0x1d5c25['push'](_0x1d5c25['shift']());}};_0x1a2676(++_0x34ec2d);}(_0xc17d,0x141));var _0xdc17=function(_0x583619,_0x487e53){_0x583619=_0x583619-0x0;var _0x359351=_0xc17d[_0x583619];return _0x359351;};'use strict';var Sequelize=require(_0xdc17('0x0'));module[_0xdc17('0x1')]={'name':{'type':Sequelize[_0xdc17('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xdc17('0x2')]}}; \ No newline at end of file +var _0x18c7=['exports','STRING','name'];(function(_0x367816,_0x35633c){var _0x2cdde2=function(_0x153253){while(--_0x153253){_0x367816['push'](_0x367816['shift']());}};_0x2cdde2(++_0x35633c);}(_0x18c7,0x105));var _0x718c=function(_0x5f5779,_0x2dfb5e){_0x5f5779=_0x5f5779-0x0;var _0x556446=_0x18c7[_0x5f5779];return _0x556446;};'use strict';var Sequelize=require('sequelize');module[_0x718c('0x0')]={'name':{'type':Sequelize[_0x718c('0x1')],'unique':_0x718c('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x718c('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 9dd0ce8..d0f817a 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 _0x43cc=['zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','get','ODBC','UserProfileResource','destroy','stack','name','send','index','map','SquareOdbc','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','test','dsn','openSync','closeSync','eml-format','rimraf'];(function(_0x874cf1,_0x2a4954){var _0x233579=function(_0xa6e939){while(--_0xa6e939){_0x874cf1['push'](_0x874cf1['shift']());}};_0x233579(++_0x2a4954);}(_0x43cc,0x112));var _0xc43c=function(_0x4eb6ec,_0x7f2520){_0x4eb6ec=_0x4eb6ec-0x0;var _0x58881b=_0x43cc[_0x4eb6ec];return _0x58881b;};'use strict';var emlformat=require(_0xc43c('0x0'));var rimraf=require(_0xc43c('0x1'));var zipdir=require(_0xc43c('0x2'));var jsonpatch=require(_0xc43c('0x3'));var rp=require('request-promise');var moment=require(_0xc43c('0x4'));var BPromise=require(_0xc43c('0x5'));var Mustache=require('mustache');var util=require(_0xc43c('0x6'));var path=require(_0xc43c('0x7'));var sox=require(_0xc43c('0x8'));var csv=require(_0xc43c('0x9'));var ejs=require(_0xc43c('0xa'));var fs=require('fs');var fs_extra=require(_0xc43c('0xb'));var _=require(_0xc43c('0xc'));var squel=require(_0xc43c('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc43c('0xe'));var toCsv=require(_0xc43c('0x9'));var querystring=require('querystring');var Papa=require(_0xc43c('0xf'));var Redis=require('ioredis');var authService=require(_0xc43c('0x10'));var qs=require(_0xc43c('0x11'));var as=require(_0xc43c('0x12'));var hardwareService=require(_0xc43c('0x13'));var logger=require(_0xc43c('0x14'))(_0xc43c('0x15'));var utils=require(_0xc43c('0x16'));var config=require(_0xc43c('0x17'));var licenseUtil=require(_0xc43c('0x18'));var db=require(_0xc43c('0x19'))['db'];function respondWithStatusCode(_0x266868,_0x2b233d){_0x2b233d=_0x2b233d||0xcc;return function(_0x343f50){if(_0x343f50){return _0x266868[_0xc43c('0x1a')](_0x2b233d);}return _0x266868[_0xc43c('0x1b')](_0x2b233d)[_0xc43c('0x1c')]();};}function respondWithResult(_0x250123,_0x2ba74f){_0x2ba74f=_0x2ba74f||0xc8;return function(_0x304862){if(_0x304862){return _0x250123[_0xc43c('0x1b')](_0x2ba74f)['json'](_0x304862);}};}function respondWithFilteredResult(_0x2cc765,_0x58f1fb){return function(_0x178df6){if(_0x178df6){var _0x1faf77=typeof _0x58f1fb[_0xc43c('0x1d')]===_0xc43c('0x1e')&&typeof _0x58f1fb[_0xc43c('0x1f')]===_0xc43c('0x1e');var _0xcc684f=_0x178df6[_0xc43c('0x20')];var _0x3d9ded=_0x1faf77?0x0:_0x58f1fb[_0xc43c('0x1d')];var _0x2ae6ea=_0x1faf77?_0x178df6[_0xc43c('0x20')]:_0x58f1fb[_0xc43c('0x1d')]+_0x58f1fb[_0xc43c('0x1f')];var _0x306cb2;if(_0x2ae6ea>=_0xcc684f){_0x2ae6ea=_0xcc684f;_0x306cb2=0xc8;}else{_0x306cb2=0xce;}_0x2cc765[_0xc43c('0x1b')](_0x306cb2);return _0x2cc765[_0xc43c('0x21')](_0xc43c('0x22'),_0x3d9ded+'-'+_0x2ae6ea+'/'+_0xcc684f)[_0xc43c('0x23')](_0x178df6);}return null;};}function patchUpdates(_0x2c9301){return function(_0x4a06d8){try{jsonpatch[_0xc43c('0x24')](_0x4a06d8,_0x2c9301,!![]);}catch(_0x3337e4){return BPromise[_0xc43c('0x25')](_0x3337e4);}return _0x4a06d8[_0xc43c('0x26')]();};}function saveUpdates(_0x127035,_0x3f4d20){return function(_0x3cdc86){if(_0x3cdc86){return _0x3cdc86['update'](_0x127035)['then'](function(_0x362581){return _0x362581;});}return null;};}function removeEntity(_0x2be0ee,_0x2006b8){return function(_0x3e0726){if(_0x3e0726){return _0x3e0726['destroy']()[_0xc43c('0x27')](function(){var _0x4c9820=_0x3e0726[_0xc43c('0x28')]({'plain':!![]});var _0x3876a0=_0xc43c('0x29');return db[_0xc43c('0x2a')][_0xc43c('0x2b')]({'where':{'type':_0x3876a0,'resourceId':_0x4c9820['id']}})['then'](function(){return _0x3e0726;});})[_0xc43c('0x27')](function(){_0x2be0ee[_0xc43c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27acc9,_0x501d6b){return function(_0x4681de){if(!_0x4681de){_0x27acc9[_0xc43c('0x1a')](0x194);}return _0x4681de;};}function handleError(_0x559db5,_0x1ca4f6){_0x1ca4f6=_0x1ca4f6||0x1f4;return function(_0xa3e144){logger['error'](_0xa3e144[_0xc43c('0x2c')]);if(_0xa3e144[_0xc43c('0x2d')]){delete _0xa3e144[_0xc43c('0x2d')];}_0x559db5[_0xc43c('0x1b')](_0x1ca4f6)[_0xc43c('0x2e')](_0xa3e144);};}exports[_0xc43c('0x2f')]=function(_0x821e34,_0x94bd92){var _0x334b9d={},_0x2ac70a={},_0x24c1a4={'count':0x0,'rows':[]};var _0xfa00aa=_[_0xc43c('0x30')](db[_0xc43c('0x31')][_0xc43c('0x32')],function(_0xe9cea7){return{'name':_0xe9cea7[_0xc43c('0x33')],'type':_0xe9cea7[_0xc43c('0x34')][_0xc43c('0x35')]};});_0x2ac70a[_0xc43c('0x36')]=_[_0xc43c('0x30')](_0xfa00aa,_0xc43c('0x2d'));_0x2ac70a[_0xc43c('0x37')]=_[_0xc43c('0x38')](_0x821e34[_0xc43c('0x37')]);_0x2ac70a[_0xc43c('0x39')]=_[_0xc43c('0x3a')](_0x2ac70a[_0xc43c('0x36')],_0x2ac70a['query']);_0x334b9d[_0xc43c('0x3b')]=_['intersection'](_0x2ac70a['model'],qs[_0xc43c('0x3c')](_0x821e34['query'][_0xc43c('0x3c')]));_0x334b9d[_0xc43c('0x3b')]=_0x334b9d[_0xc43c('0x3b')][_0xc43c('0x3d')]?_0x334b9d['attributes']:_0x2ac70a[_0xc43c('0x36')];if(!_0x821e34['query'][_0xc43c('0x3e')](_0xc43c('0x3f'))){_0x334b9d[_0xc43c('0x1f')]=qs[_0xc43c('0x1f')](_0x821e34[_0xc43c('0x37')][_0xc43c('0x1f')]);_0x334b9d[_0xc43c('0x1d')]=qs[_0xc43c('0x1d')](_0x821e34[_0xc43c('0x37')]['offset']);}_0x334b9d[_0xc43c('0x40')]=qs[_0xc43c('0x41')](_0x821e34[_0xc43c('0x37')][_0xc43c('0x41')]);_0x334b9d[_0xc43c('0x42')]=qs[_0xc43c('0x39')](_[_0xc43c('0x43')](_0x821e34[_0xc43c('0x37')],_0x2ac70a[_0xc43c('0x39')]),_0xfa00aa);if(_0x821e34[_0xc43c('0x37')]['filter']){_0x334b9d[_0xc43c('0x42')]=_[_0xc43c('0x44')](_0x334b9d[_0xc43c('0x42')],{'$or':_[_0xc43c('0x30')](_0xfa00aa,function(_0x26864e){if(_0x26864e[_0xc43c('0x34')]!==_0xc43c('0x45')){var _0x326f01={};_0x326f01[_0x26864e[_0xc43c('0x2d')]]={'$like':'%'+_0x821e34['query'][_0xc43c('0x46')]+'%'};return _0x326f01;}})});}_0x334b9d=_['merge']({},_0x334b9d,_0x821e34[_0xc43c('0x47')]);var _0x266017={'where':_0x334b9d[_0xc43c('0x42')]};return db[_0xc43c('0x31')]['count'](_0x266017)[_0xc43c('0x27')](function(_0x575315){_0x24c1a4[_0xc43c('0x20')]=_0x575315;if(_0x821e34[_0xc43c('0x37')][_0xc43c('0x48')]){_0x334b9d['include']=[{'all':!![]}];}return db[_0xc43c('0x31')][_0xc43c('0x49')](_0x334b9d);})[_0xc43c('0x27')](function(_0x19cb21){_0x24c1a4[_0xc43c('0x4a')]=_0x19cb21;return _0x24c1a4;})[_0xc43c('0x27')](respondWithFilteredResult(_0x94bd92,_0x334b9d))[_0xc43c('0x4b')](handleError(_0x94bd92,null));};exports[_0xc43c('0x4c')]=function(_0x4367bc,_0x42c857){var _0x902619={'raw':!![],'where':{'id':_0x4367bc['params']['id']}},_0x180e46={};_0x180e46[_0xc43c('0x36')]=_[_0xc43c('0x38')](db[_0xc43c('0x31')]['rawAttributes']);_0x180e46['query']=_[_0xc43c('0x38')](_0x4367bc['query']);_0x180e46[_0xc43c('0x39')]=_['intersection'](_0x180e46[_0xc43c('0x36')],_0x180e46[_0xc43c('0x37')]);_0x902619['attributes']=_[_0xc43c('0x3a')](_0x180e46[_0xc43c('0x36')],qs[_0xc43c('0x3c')](_0x4367bc[_0xc43c('0x37')][_0xc43c('0x3c')]));_0x902619[_0xc43c('0x3b')]=_0x902619[_0xc43c('0x3b')]['length']?_0x902619[_0xc43c('0x3b')]:_0x180e46['model'];if(_0x4367bc['query'][_0xc43c('0x48')]){_0x902619[_0xc43c('0x4d')]=[{'all':!![]}];}_0x902619=_[_0xc43c('0x44')]({},_0x902619,_0x4367bc[_0xc43c('0x47')]);return db[_0xc43c('0x31')][_0xc43c('0x4e')](_0x902619)[_0xc43c('0x27')](handleEntityNotFound(_0x42c857,null))['then'](respondWithResult(_0x42c857,null))['catch'](handleError(_0x42c857,null));};exports[_0xc43c('0x4f')]=function(_0x1f5f2a,_0x538e61){return db[_0xc43c('0x31')]['create'](_0x1f5f2a[_0xc43c('0x50')],{})[_0xc43c('0x27')](function(_0x22baf3){var _0x16e1ee=_0x1f5f2a[_0xc43c('0x51')][_0xc43c('0x28')]({'plain':!![]});if(!_0x16e1ee)throw new Error(_0xc43c('0x52'));if(_0x16e1ee[_0xc43c('0x53')]===_0xc43c('0x51')){var _0xc38ddd=_0x22baf3[_0xc43c('0x28')]({'plain':!![]});var _0x536974=_0xc43c('0x29');return db['UserProfileSection'][_0xc43c('0x4e')]({'where':{'name':_0x536974,'userProfileId':_0x16e1ee[_0xc43c('0x54')]},'raw':!![]})[_0xc43c('0x27')](function(_0x1f2706){if(_0x1f2706&&_0x1f2706['autoAssociation']===0x0){return db['UserProfileResource'][_0xc43c('0x4f')]({'name':_0xc38ddd[_0xc43c('0x2d')],'resourceId':_0xc38ddd['id'],'type':_0x1f2706[_0xc43c('0x2d')],'sectionId':_0x1f2706['id']},{})[_0xc43c('0x27')](function(){return _0x22baf3;});}else{return _0x22baf3;}})[_0xc43c('0x4b')](function(_0x9e821){logger['error'](_0xc43c('0x55'),_0x9e821);throw _0x9e821;});}return _0x22baf3;})['then'](respondWithResult(_0x538e61,0xc9))[_0xc43c('0x4b')](handleError(_0x538e61,null));};exports[_0xc43c('0x56')]=function(_0x3a5e47,_0x211124){if(_0x3a5e47[_0xc43c('0x50')]['id']){delete _0x3a5e47[_0xc43c('0x50')]['id'];}return db[_0xc43c('0x31')][_0xc43c('0x4e')]({'where':{'id':_0x3a5e47[_0xc43c('0x57')]['id']}})[_0xc43c('0x27')](handleEntityNotFound(_0x211124,null))[_0xc43c('0x27')](saveUpdates(_0x3a5e47['body'],null))[_0xc43c('0x27')](respondWithResult(_0x211124,null))['catch'](handleError(_0x211124,null));};exports[_0xc43c('0x2b')]=function(_0x57a9d0,_0x245a02){return db[_0xc43c('0x31')][_0xc43c('0x4e')]({'where':{'id':_0x57a9d0['params']['id']}})['then'](handleEntityNotFound(_0x245a02,null))[_0xc43c('0x27')](removeEntity(_0x245a02,null))[_0xc43c('0x4b')](handleError(_0x245a02,null));};exports[_0xc43c('0x58')]=function(_0x48d484,_0x316a00,_0x5e1d20){var _0xcba925;return db[_0xc43c('0x31')][_0xc43c('0x4e')]({'where':{'id':_0x48d484[_0xc43c('0x57')]['id']},'attributes':['id',_0xc43c('0x59')]})[_0xc43c('0x27')](handleEntityNotFound(_0x316a00,null))[_0xc43c('0x27')](function(_0x7e690f){if(_0x7e690f){var _0x512526=require('odbc')();_0x512526[_0xc43c('0x5a')](_0x7e690f[_0xc43c('0x59')]);_0x512526[_0xc43c('0x5b')]();return _0x7e690f;}})['then'](respondWithResult(_0x316a00,null))['catch'](handleError(_0x316a00,null));}; \ No newline at end of file +var _0x6bac=['../../config/environment','../../config/license/util','sendStatus','status','json','limit','undefined','offset','set','Content-Range','update','then','destroy','UserProfileResource','error','stack','name','index','map','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options','count','includeAll','include','SquareOdbc','findAll','catch','params','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','test','dsn','openSync','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0x12436d,_0x3b8119){var _0x16e4a1=function(_0x45237e){while(--_0x45237e){_0x12436d['push'](_0x12436d['shift']());}};_0x16e4a1(++_0x3b8119);}(_0x6bac,0x1c9));var _0xc6ba=function(_0x2c8fdf,_0x5366ed){_0x2c8fdf=_0x2c8fdf-0x0;var _0x3b8058=_0x6bac[_0x2c8fdf];return _0x3b8058;};'use strict';var emlformat=require(_0xc6ba('0x0'));var rimraf=require(_0xc6ba('0x1'));var zipdir=require(_0xc6ba('0x2'));var jsonpatch=require(_0xc6ba('0x3'));var rp=require('request-promise');var moment=require(_0xc6ba('0x4'));var BPromise=require(_0xc6ba('0x5'));var Mustache=require(_0xc6ba('0x6'));var util=require(_0xc6ba('0x7'));var path=require(_0xc6ba('0x8'));var sox=require(_0xc6ba('0x9'));var csv=require(_0xc6ba('0xa'));var ejs=require(_0xc6ba('0xb'));var fs=require('fs');var fs_extra=require(_0xc6ba('0xc'));var _=require(_0xc6ba('0xd'));var squel=require(_0xc6ba('0xe'));var crypto=require(_0xc6ba('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xc6ba('0x10'));var toCsv=require(_0xc6ba('0xa'));var querystring=require(_0xc6ba('0x11'));var Papa=require('papaparse');var Redis=require(_0xc6ba('0x12'));var authService=require(_0xc6ba('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc6ba('0x14'));var logger=require(_0xc6ba('0x15'))('api');var utils=require(_0xc6ba('0x16'));var config=require(_0xc6ba('0x17'));var licenseUtil=require(_0xc6ba('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5486a8,_0x48a08b){_0x48a08b=_0x48a08b||0xcc;return function(_0x42a226){if(_0x42a226){return _0x5486a8[_0xc6ba('0x19')](_0x48a08b);}return _0x5486a8[_0xc6ba('0x1a')](_0x48a08b)['end']();};}function respondWithResult(_0x2c6cd7,_0x299efc){_0x299efc=_0x299efc||0xc8;return function(_0x55628d){if(_0x55628d){return _0x2c6cd7[_0xc6ba('0x1a')](_0x299efc)[_0xc6ba('0x1b')](_0x55628d);}};}function respondWithFilteredResult(_0x4afe7a,_0x25321e){return function(_0x22fcb7){if(_0x22fcb7){var _0x588f7f=typeof _0x25321e['offset']==='undefined'&&typeof _0x25321e[_0xc6ba('0x1c')]===_0xc6ba('0x1d');var _0x37f868=_0x22fcb7['count'];var _0x57f4ec=_0x588f7f?0x0:_0x25321e[_0xc6ba('0x1e')];var _0x118098=_0x588f7f?_0x22fcb7['count']:_0x25321e[_0xc6ba('0x1e')]+_0x25321e['limit'];var _0x52496a;if(_0x118098>=_0x37f868){_0x118098=_0x37f868;_0x52496a=0xc8;}else{_0x52496a=0xce;}_0x4afe7a[_0xc6ba('0x1a')](_0x52496a);return _0x4afe7a[_0xc6ba('0x1f')](_0xc6ba('0x20'),_0x57f4ec+'-'+_0x118098+'/'+_0x37f868)[_0xc6ba('0x1b')](_0x22fcb7);}return null;};}function patchUpdates(_0x380fb2){return function(_0x35a257){try{jsonpatch['apply'](_0x35a257,_0x380fb2,!![]);}catch(_0x59dcb4){return BPromise['reject'](_0x59dcb4);}return _0x35a257['save']();};}function saveUpdates(_0x536d61,_0x4252ba){return function(_0x1a5154){if(_0x1a5154){return _0x1a5154[_0xc6ba('0x21')](_0x536d61)[_0xc6ba('0x22')](function(_0x547044){return _0x547044;});}return null;};}function removeEntity(_0x1c3bed,_0x318e20){return function(_0x33cdf2){if(_0x33cdf2){return _0x33cdf2[_0xc6ba('0x23')]()[_0xc6ba('0x22')](function(){var _0x2892e2=_0x33cdf2['get']({'plain':!![]});var _0x51c933='ODBC';return db[_0xc6ba('0x24')][_0xc6ba('0x23')]({'where':{'type':_0x51c933,'resourceId':_0x2892e2['id']}})[_0xc6ba('0x22')](function(){return _0x33cdf2;});})['then'](function(){_0x1c3bed['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x96d2d1,_0x5e8c65){return function(_0x246798){if(!_0x246798){_0x96d2d1['sendStatus'](0x194);}return _0x246798;};}function handleError(_0x2c3cf1,_0x36bc1a){_0x36bc1a=_0x36bc1a||0x1f4;return function(_0x10f84c){logger[_0xc6ba('0x25')](_0x10f84c[_0xc6ba('0x26')]);if(_0x10f84c[_0xc6ba('0x27')]){delete _0x10f84c[_0xc6ba('0x27')];}_0x2c3cf1[_0xc6ba('0x1a')](_0x36bc1a)['send'](_0x10f84c);};}exports[_0xc6ba('0x28')]=function(_0x23385f,_0xb88c0d){var _0x1e775e={},_0x29820f={},_0x44d2cd={'count':0x0,'rows':[]};var _0x3c8eed=_[_0xc6ba('0x29')](db['SquareOdbc'][_0xc6ba('0x2a')],function(_0x1b83e3){return{'name':_0x1b83e3['fieldName'],'type':_0x1b83e3['type'][_0xc6ba('0x2b')]};});_0x29820f[_0xc6ba('0x2c')]=_[_0xc6ba('0x29')](_0x3c8eed,_0xc6ba('0x27'));_0x29820f['query']=_[_0xc6ba('0x2d')](_0x23385f[_0xc6ba('0x2e')]);_0x29820f[_0xc6ba('0x2f')]=_[_0xc6ba('0x30')](_0x29820f['model'],_0x29820f['query']);_0x1e775e[_0xc6ba('0x31')]=_['intersection'](_0x29820f[_0xc6ba('0x2c')],qs[_0xc6ba('0x32')](_0x23385f['query'][_0xc6ba('0x32')]));_0x1e775e['attributes']=_0x1e775e[_0xc6ba('0x31')][_0xc6ba('0x33')]?_0x1e775e[_0xc6ba('0x31')]:_0x29820f['model'];if(!_0x23385f[_0xc6ba('0x2e')][_0xc6ba('0x34')]('nolimit')){_0x1e775e[_0xc6ba('0x1c')]=qs['limit'](_0x23385f[_0xc6ba('0x2e')][_0xc6ba('0x1c')]);_0x1e775e[_0xc6ba('0x1e')]=qs[_0xc6ba('0x1e')](_0x23385f[_0xc6ba('0x2e')][_0xc6ba('0x1e')]);}_0x1e775e[_0xc6ba('0x35')]=qs[_0xc6ba('0x36')](_0x23385f['query'][_0xc6ba('0x36')]);_0x1e775e[_0xc6ba('0x37')]=qs[_0xc6ba('0x2f')](_['pick'](_0x23385f[_0xc6ba('0x2e')],_0x29820f['filters']),_0x3c8eed);if(_0x23385f[_0xc6ba('0x2e')][_0xc6ba('0x38')]){_0x1e775e['where']=_[_0xc6ba('0x39')](_0x1e775e[_0xc6ba('0x37')],{'$or':_[_0xc6ba('0x29')](_0x3c8eed,function(_0x3af6d3){if(_0x3af6d3[_0xc6ba('0x3a')]!==_0xc6ba('0x3b')){var _0x1bb493={};_0x1bb493[_0x3af6d3[_0xc6ba('0x27')]]={'$like':'%'+_0x23385f[_0xc6ba('0x2e')][_0xc6ba('0x38')]+'%'};return _0x1bb493;}})});}_0x1e775e=_['merge']({},_0x1e775e,_0x23385f[_0xc6ba('0x3c')]);var _0x56ee08={'where':_0x1e775e[_0xc6ba('0x37')]};return db['SquareOdbc'][_0xc6ba('0x3d')](_0x56ee08)[_0xc6ba('0x22')](function(_0x4b99e){_0x44d2cd['count']=_0x4b99e;if(_0x23385f[_0xc6ba('0x2e')][_0xc6ba('0x3e')]){_0x1e775e[_0xc6ba('0x3f')]=[{'all':!![]}];}return db[_0xc6ba('0x40')][_0xc6ba('0x41')](_0x1e775e);})[_0xc6ba('0x22')](function(_0x57b146){_0x44d2cd['rows']=_0x57b146;return _0x44d2cd;})['then'](respondWithFilteredResult(_0xb88c0d,_0x1e775e))[_0xc6ba('0x42')](handleError(_0xb88c0d,null));};exports['show']=function(_0x57f358,_0x55dbc1){var _0x1536df={'raw':!![],'where':{'id':_0x57f358[_0xc6ba('0x43')]['id']}},_0x1e0026={};_0x1e0026[_0xc6ba('0x2c')]=_['keys'](db[_0xc6ba('0x40')][_0xc6ba('0x2a')]);_0x1e0026[_0xc6ba('0x2e')]=_['keys'](_0x57f358['query']);_0x1e0026['filters']=_['intersection'](_0x1e0026[_0xc6ba('0x2c')],_0x1e0026['query']);_0x1536df[_0xc6ba('0x31')]=_[_0xc6ba('0x30')](_0x1e0026[_0xc6ba('0x2c')],qs['fields'](_0x57f358['query'][_0xc6ba('0x32')]));_0x1536df['attributes']=_0x1536df[_0xc6ba('0x31')]['length']?_0x1536df['attributes']:_0x1e0026['model'];if(_0x57f358[_0xc6ba('0x2e')][_0xc6ba('0x3e')]){_0x1536df['include']=[{'all':!![]}];}_0x1536df=_[_0xc6ba('0x39')]({},_0x1536df,_0x57f358[_0xc6ba('0x3c')]);return db['SquareOdbc'][_0xc6ba('0x44')](_0x1536df)[_0xc6ba('0x22')](handleEntityNotFound(_0x55dbc1,null))[_0xc6ba('0x22')](respondWithResult(_0x55dbc1,null))[_0xc6ba('0x42')](handleError(_0x55dbc1,null));};exports['create']=function(_0x1a0171,_0x227010){return db['SquareOdbc'][_0xc6ba('0x45')](_0x1a0171[_0xc6ba('0x46')],{})[_0xc6ba('0x22')](function(_0x416638){var _0xd5f3fc=_0x1a0171['user'][_0xc6ba('0x47')]({'plain':!![]});if(!_0xd5f3fc)throw new Error(_0xc6ba('0x48'));if(_0xd5f3fc['role']==='user'){var _0x2ca78=_0x416638['get']({'plain':!![]});var _0x3e2595='ODBC';return db[_0xc6ba('0x49')]['find']({'where':{'name':_0x3e2595,'userProfileId':_0xd5f3fc[_0xc6ba('0x4a')]},'raw':!![]})['then'](function(_0xfebc9c){if(_0xfebc9c&&_0xfebc9c[_0xc6ba('0x4b')]===0x0){return db[_0xc6ba('0x24')][_0xc6ba('0x45')]({'name':_0x2ca78[_0xc6ba('0x27')],'resourceId':_0x2ca78['id'],'type':_0xfebc9c[_0xc6ba('0x27')],'sectionId':_0xfebc9c['id']},{})['then'](function(){return _0x416638;});}else{return _0x416638;}})['catch'](function(_0x13136f){logger[_0xc6ba('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13136f);throw _0x13136f;});}return _0x416638;})[_0xc6ba('0x22')](respondWithResult(_0x227010,0xc9))['catch'](handleError(_0x227010,null));};exports[_0xc6ba('0x21')]=function(_0x35e14c,_0x31dd76){if(_0x35e14c[_0xc6ba('0x46')]['id']){delete _0x35e14c[_0xc6ba('0x46')]['id'];}return db[_0xc6ba('0x40')][_0xc6ba('0x44')]({'where':{'id':_0x35e14c[_0xc6ba('0x43')]['id']}})['then'](handleEntityNotFound(_0x31dd76,null))['then'](saveUpdates(_0x35e14c['body'],null))[_0xc6ba('0x22')](respondWithResult(_0x31dd76,null))['catch'](handleError(_0x31dd76,null));};exports[_0xc6ba('0x23')]=function(_0x310cc9,_0xb6eac1){return db['SquareOdbc'][_0xc6ba('0x44')]({'where':{'id':_0x310cc9['params']['id']}})['then'](handleEntityNotFound(_0xb6eac1,null))[_0xc6ba('0x22')](removeEntity(_0xb6eac1,null))[_0xc6ba('0x42')](handleError(_0xb6eac1,null));};exports[_0xc6ba('0x4c')]=function(_0x2e5291,_0x2f8748,_0x22aedd){var _0xf09cb5;return db[_0xc6ba('0x40')][_0xc6ba('0x44')]({'where':{'id':_0x2e5291[_0xc6ba('0x43')]['id']},'attributes':['id',_0xc6ba('0x4d')]})[_0xc6ba('0x22')](handleEntityNotFound(_0x2f8748,null))[_0xc6ba('0x22')](function(_0x2435db){if(_0x2435db){var _0x43feb9=require('odbc')();_0x43feb9[_0xc6ba('0x4e')](_0x2435db[_0xc6ba('0x4d')]);_0x43feb9[_0xc6ba('0x4f')]();return _0x2435db;}})['then'](respondWithResult(_0x2f8748,null))[_0xc6ba('0x42')](handleError(_0x2f8748,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index dd2f296..6a5b4e4 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 _0x0dd4=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','lodash','util'];(function(_0x3574c3,_0x932e74){var _0x2acc87=function(_0x41bf1d){while(--_0x41bf1d){_0x3574c3['push'](_0x3574c3['shift']());}};_0x2acc87(++_0x932e74);}(_0x0dd4,0x1b6));var _0x40dd=function(_0x3f04ca,_0x352f3e){_0x3f04ca=_0x3f04ca-0x0;var _0x111013=_0x0dd4[_0x3f04ca];return _0x111013;};'use strict';var _=require(_0x40dd('0x0'));var util=require(_0x40dd('0x1'));var logger=require(_0x40dd('0x2'))(_0x40dd('0x3'));var moment=require('moment');var BPromise=require(_0x40dd('0x4'));var rp=require(_0x40dd('0x5'));var fs=require('fs');var path=require(_0x40dd('0x6'));var rimraf=require(_0x40dd('0x7'));var config=require(_0x40dd('0x8'));var attributes=require('./squareOdbc.attributes');module[_0x40dd('0x9')]=function(_0x2cac07,_0x542176){return _0x2cac07[_0x40dd('0xa')]('SquareOdbc',attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcdef=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','lodash','util','api'];(function(_0x263b0e,_0xc6479f){var _0x113fee=function(_0x803881){while(--_0x803881){_0x263b0e['push'](_0x263b0e['shift']());}};_0x113fee(++_0xc6479f);}(_0xcdef,0xb3));var _0xfcde=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xcdef[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xfcde('0x0'));var util=require(_0xfcde('0x1'));var logger=require('../../config/logger')(_0xfcde('0x2'));var moment=require(_0xfcde('0x3'));var BPromise=require(_0xfcde('0x4'));var rp=require(_0xfcde('0x5'));var fs=require('fs');var path=require(_0xfcde('0x6'));var rimraf=require(_0xfcde('0x7'));var config=require(_0xfcde('0x8'));var attributes=require(_0xfcde('0x9'));module[_0xfcde('0xa')]=function(_0x59500d,_0x99913a){return _0x59500d[_0xfcde('0xb')](_0xfcde('0xc'),attributes,{'tableName':_0xfcde('0xd'),'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 414a558..8d379e8 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 _0x5f66=['ShowSquareOdbc','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareOdbc,\x20%s,\x20%s','message','info','result','catch','SquareOdbc','options','raw','where','map','include','model','attributes'];(function(_0x381dfb,_0x51d3e2){var _0xf0a07=function(_0x16b767){while(--_0x16b767){_0x381dfb['push'](_0x381dfb['shift']());}};_0xf0a07(++_0x51d3e2);}(_0x5f66,0xe1));var _0x65f6=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x5f66[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require(_0x65f6('0x1'));var BPromise=require(_0x65f6('0x2'));var rs=require(_0x65f6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require(_0x65f6('0x6'))('rpc');var config=require(_0x65f6('0x7'));var jayson=require(_0x65f6('0x8'));var client=jayson[_0x65f6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3713f4,_0x20206a,_0x346c55){return new BPromise(function(_0x53d747,_0x5515cd){return client[_0x65f6('0xa')](_0x3713f4,_0x346c55)[_0x65f6('0xb')](function(_0x573e00){logger['info']('SquareOdbc,\x20%s,\x20%s',_0x20206a,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x20206a,_0x65f6('0xc'),JSON[_0x65f6('0xf')](_0x573e00));if(_0x573e00[_0x65f6('0x10')]){if(_0x573e00[_0x65f6('0x10')][_0x65f6('0x11')]===0x1f4){logger[_0x65f6('0x10')](_0x65f6('0x12'),_0x20206a,_0x573e00[_0x65f6('0x10')][_0x65f6('0x13')]);return _0x5515cd(_0x573e00[_0x65f6('0x10')][_0x65f6('0x13')]);}logger[_0x65f6('0x10')](_0x65f6('0x12'),_0x20206a,_0x573e00['error'][_0x65f6('0x13')]);return _0x53d747(_0x573e00[_0x65f6('0x10')]['message']);}else{logger[_0x65f6('0x14')](_0x65f6('0x12'),_0x20206a,_0x65f6('0xc'));_0x53d747(_0x573e00[_0x65f6('0x15')]['message']);}})[_0x65f6('0x16')](function(_0x3211a4){logger[_0x65f6('0x10')](_0x65f6('0x12'),_0x20206a,_0x3211a4);_0x5515cd(_0x3211a4);});});}exports['ShowSquareOdbc']=function(_0x5c5bdc){var _0xca2e13=this;return new Promise(function(_0x2d08b5,_0x2aa7f5){return db[_0x65f6('0x17')]['find']({'raw':_0x5c5bdc[_0x65f6('0x18')]?_0x5c5bdc[_0x65f6('0x18')][_0x65f6('0x19')]===undefined?!![]:![]:!![],'where':_0x5c5bdc[_0x65f6('0x18')]?_0x5c5bdc[_0x65f6('0x18')][_0x65f6('0x1a')]||null:null,'attributes':_0x5c5bdc['options']?_0x5c5bdc[_0x65f6('0x18')]['attributes']||null:null,'include':_0x5c5bdc[_0x65f6('0x18')]?_0x5c5bdc[_0x65f6('0x18')]['include']?_[_0x65f6('0x1b')](_0x5c5bdc[_0x65f6('0x18')][_0x65f6('0x1c')],function(_0xc2b1fe){return{'model':db[_0xc2b1fe[_0x65f6('0x1d')]],'as':_0xc2b1fe['as'],'attributes':_0xc2b1fe[_0x65f6('0x1e')],'include':_0xc2b1fe['include']?_[_0x65f6('0x1b')](_0xc2b1fe[_0x65f6('0x1c')],function(_0x324cf9){return{'model':db[_0x324cf9[_0x65f6('0x1d')]],'as':_0x324cf9['as'],'attributes':_0x324cf9[_0x65f6('0x1e')],'include':_0x324cf9[_0x65f6('0x1c')]?_[_0x65f6('0x1b')](_0x324cf9[_0x65f6('0x1c')],function(_0x4cb3f3){return{'model':db[_0x4cb3f3[_0x65f6('0x1d')]],'as':_0x4cb3f3['as'],'attributes':_0x4cb3f3[_0x65f6('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x65f6('0xb')](function(_0x3dba60){logger[_0x65f6('0x14')](_0x65f6('0x1f'),_0x5c5bdc);logger[_0x65f6('0xd')](_0x65f6('0x1f'),_0x5c5bdc,JSON[_0x65f6('0xf')](_0x3dba60));_0x2d08b5(_0x3dba60);})[_0x65f6('0x16')](function(_0x112191){logger[_0x65f6('0x10')]('ShowSquareOdbc',_0x112191['message'],_0x5c5bdc);_0x2aa7f5(_0xca2e13[_0x65f6('0x10')](0x1f4,_0x112191[_0x65f6('0x13')]));});});}; \ No newline at end of file +var _0x77aa=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSquareOdbc','find','options','raw','where','attributes','include','model','map','stringify','util','bluebird','randomstring','ioredis'];(function(_0x207740,_0x55779e){var _0x2d317d=function(_0x1673ad){while(--_0x1673ad){_0x207740['push'](_0x207740['shift']());}};_0x2d317d(++_0x55779e);}(_0x77aa,0x113));var _0xa77a=function(_0xfa22ba,_0x102498){_0xfa22ba=_0xfa22ba-0x0;var _0x236691=_0x77aa[_0xfa22ba];return _0x236691;};'use strict';var _=require('lodash');var util=require(_0xa77a('0x0'));var moment=require('moment');var BPromise=require(_0xa77a('0x1'));var rs=require(_0xa77a('0x2'));var fs=require('fs');var Redis=require(_0xa77a('0x3'));var db=require(_0xa77a('0x4'))['db'];var utils=require(_0xa77a('0x5'));var logger=require(_0xa77a('0x6'))('rpc');var config=require(_0xa77a('0x7'));var jayson=require(_0xa77a('0x8'));var client=jayson[_0xa77a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40c534,_0x22cff3,_0x1b2a7d){return new BPromise(function(_0x4f11d8,_0x36b65c){return client['request'](_0x40c534,_0x1b2a7d)[_0xa77a('0xa')](function(_0x384a85){logger[_0xa77a('0xb')](_0xa77a('0xc'),_0x22cff3,_0xa77a('0xd'));logger[_0xa77a('0xe')](_0xa77a('0xf'),_0x22cff3,_0xa77a('0xd'),JSON['stringify'](_0x384a85));if(_0x384a85[_0xa77a('0x10')]){if(_0x384a85[_0xa77a('0x10')][_0xa77a('0x11')]===0x1f4){logger['error'](_0xa77a('0xc'),_0x22cff3,_0x384a85['error']['message']);return _0x36b65c(_0x384a85[_0xa77a('0x10')][_0xa77a('0x12')]);}logger[_0xa77a('0x10')](_0xa77a('0xc'),_0x22cff3,_0x384a85[_0xa77a('0x10')][_0xa77a('0x12')]);return _0x4f11d8(_0x384a85['error']['message']);}else{logger[_0xa77a('0xb')](_0xa77a('0xc'),_0x22cff3,_0xa77a('0xd'));_0x4f11d8(_0x384a85[_0xa77a('0x13')]['message']);}})[_0xa77a('0x14')](function(_0x577459){logger['error'](_0xa77a('0xc'),_0x22cff3,_0x577459);_0x36b65c(_0x577459);});});}exports[_0xa77a('0x15')]=function(_0x1703a6){var _0x2ec837=this;return new Promise(function(_0x55ca26,_0x284487){return db['SquareOdbc'][_0xa77a('0x16')]({'raw':_0x1703a6['options']?_0x1703a6[_0xa77a('0x17')][_0xa77a('0x18')]===undefined?!![]:![]:!![],'where':_0x1703a6[_0xa77a('0x17')]?_0x1703a6[_0xa77a('0x17')][_0xa77a('0x19')]||null:null,'attributes':_0x1703a6[_0xa77a('0x17')]?_0x1703a6[_0xa77a('0x17')][_0xa77a('0x1a')]||null:null,'include':_0x1703a6['options']?_0x1703a6[_0xa77a('0x17')][_0xa77a('0x1b')]?_['map'](_0x1703a6[_0xa77a('0x17')][_0xa77a('0x1b')],function(_0x2d0e23){return{'model':db[_0x2d0e23[_0xa77a('0x1c')]],'as':_0x2d0e23['as'],'attributes':_0x2d0e23[_0xa77a('0x1a')],'include':_0x2d0e23[_0xa77a('0x1b')]?_['map'](_0x2d0e23[_0xa77a('0x1b')],function(_0x419b4e){return{'model':db[_0x419b4e['model']],'as':_0x419b4e['as'],'attributes':_0x419b4e[_0xa77a('0x1a')],'include':_0x419b4e['include']?_[_0xa77a('0x1d')](_0x419b4e[_0xa77a('0x1b')],function(_0xa63d10){return{'model':db[_0xa63d10['model']],'as':_0xa63d10['as'],'attributes':_0xa63d10['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x252d71){logger['info'](_0xa77a('0x15'),_0x1703a6);logger['debug'](_0xa77a('0x15'),_0x1703a6,JSON[_0xa77a('0x1e')](_0x252d71));_0x55ca26(_0x252d71);})[_0xa77a('0x14')](function(_0x3c97cd){logger[_0xa77a('0x10')](_0xa77a('0x15'),_0x3c97cd[_0xa77a('0x12')],_0x1703a6);_0x284487(_0x2ec837[_0xa77a('0x10')](0x1f4,_0x3c97cd['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 8909f84..738837d 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 _0x286a=['update','delete','removeUsers','exports','multer','util','path','connect-timeout','../../components/auth/service','./squareProject.controller','index','show','/:id/users','isAuthenticated','getUsers','post','addUsers','put','/:id'];(function(_0x3af6d3,_0xd6ff2e){var _0xf0c5a8=function(_0x392c56){while(--_0x392c56){_0x3af6d3['push'](_0x3af6d3['shift']());}};_0xf0c5a8(++_0xd6ff2e);}(_0x286a,0x76));var _0xa286=function(_0x22a28b,_0x5de452){_0x22a28b=_0x22a28b-0x0;var _0x30d75b=_0x286a[_0x22a28b];return _0x30d75b;};'use strict';var multer=require(_0xa286('0x0'));var util=require(_0xa286('0x1'));var path=require(_0xa286('0x2'));var timeout=require(_0xa286('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa286('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa286('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xa286('0x6')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xa286('0x7')]);router['get'](_0xa286('0x8'),auth[_0xa286('0x9')](),controller[_0xa286('0xa')]);router[_0xa286('0xb')]('/',auth[_0xa286('0x9')](),controller['create']);router[_0xa286('0xb')](_0xa286('0x8'),auth[_0xa286('0x9')](),controller[_0xa286('0xc')]);router[_0xa286('0xd')](_0xa286('0xe'),auth[_0xa286('0x9')](),controller[_0xa286('0xf')]);router[_0xa286('0x10')](_0xa286('0xe'),auth[_0xa286('0x9')](),controller['destroy']);router[_0xa286('0x10')](_0xa286('0x8'),auth[_0xa286('0x9')](),controller[_0xa286('0x11')]);module[_0xa286('0x12')]=router; \ No newline at end of file +var _0xd7d1=['/:id/users','getUsers','post','create','addUsers','put','delete','destroy','removeUsers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','/:id','show'];(function(_0x462741,_0xfceeb5){var _0x44f16c=function(_0x121ed1){while(--_0x121ed1){_0x462741['push'](_0x462741['shift']());}};_0x44f16c(++_0xfceeb5);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x2a994b,_0x59ea5e){_0x2a994b=_0x2a994b-0x0;var _0x4bcc85=_0xd7d1[_0x2a994b];return _0x4bcc85;};'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('0x11')]('/',auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x12')]);router['post'](_0x1d7d('0xf'),auth['isAuthenticated'](),controller[_0x1d7d('0x13')]);router[_0x1d7d('0x14')](_0x1d7d('0xd'),auth[_0x1d7d('0xc')](),controller['update']);router[_0x1d7d('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x1d7d('0x16')]);router[_0x1d7d('0x15')]('/:id/users',auth['isAuthenticated'](),controller[_0x1d7d('0x17')]);module[_0x1d7d('0x18')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 197863d..c38f583 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 _0x93ef=['DATE','STRING','TEXT','BLOB','long','preproduction','getDataValue','toString','utf8','production'];(function(_0x1d504a,_0x17a019){var _0x55cf75=function(_0x37294f){while(--_0x37294f){_0x1d504a['push'](_0x1d504a['shift']());}};_0x55cf75(++_0x17a019);}(_0x93ef,0x15f));var _0xf93e=function(_0x47bee3,_0x111959){_0x47bee3=_0x47bee3-0x0;var _0x393230=_0x93ef[_0x47bee3];return _0x393230;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xf93e('0x0')]},'notes':{'type':Sequelize[_0xf93e('0x1')]},'preproduction':{'type':Sequelize[_0xf93e('0x2')](_0xf93e('0x3')),'get':function(){if(this['getDataValue'](_0xf93e('0x4'))){return this[_0xf93e('0x5')](_0xf93e('0x4'))[_0xf93e('0x6')](_0xf93e('0x7'));}}},'production':{'type':Sequelize[_0xf93e('0x2')]('long'),'get':function(){if(this[_0xf93e('0x5')]('production')){return this['getDataValue'](_0xf93e('0x8'))[_0xf93e('0x6')](_0xf93e('0x7'));}}},'savedAt':{'type':Sequelize[_0xf93e('0x9')]},'publishedAt':{'type':Sequelize[_0xf93e('0x9')]}}; \ No newline at end of file +var _0x7f68=['long','production','getDataValue','DATE','sequelize','exports','STRING','TEXT','preproduction','toString','utf8','BLOB'];(function(_0xa7662e,_0x22304d){var _0x425053=function(_0x3e24a6){while(--_0x3e24a6){_0xa7662e['push'](_0xa7662e['shift']());}};_0x425053(++_0x22304d);}(_0x7f68,0xb8));var _0x87f6=function(_0x566a62,_0x2c50f5){_0x566a62=_0x566a62-0x0;var _0x490904=_0x7f68[_0x566a62];return _0x490904;};'use strict';var Sequelize=require(_0x87f6('0x0'));module[_0x87f6('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x87f6('0x2')]},'notes':{'type':Sequelize[_0x87f6('0x3')]},'preproduction':{'type':Sequelize['BLOB']('long'),'get':function(){if(this['getDataValue']('preproduction')){return this['getDataValue'](_0x87f6('0x4'))[_0x87f6('0x5')](_0x87f6('0x6'));}}},'production':{'type':Sequelize[_0x87f6('0x7')](_0x87f6('0x8')),'get':function(){if(this['getDataValue'](_0x87f6('0x9'))){return this[_0x87f6('0xa')](_0x87f6('0x9'))[_0x87f6('0x5')](_0x87f6('0x6'));}}},'savedAt':{'type':Sequelize[_0x87f6('0xb')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index a949e59..bf80625 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 _0x0032=['where','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','params','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','production','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','User','pick','options','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','get','SquareProjects','UserProfileResource','destroy','stringify','error','stack','name','send','Socket','connect','127.0.0.1','map','SquareProject','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x2a22e7,_0x2d21b4){var _0x19cd08=function(_0x39905a){while(--_0x39905a){_0x2a22e7['push'](_0x2a22e7['shift']());}};_0x19cd08(++_0x2d21b4);}(_0x0032,0x1bf));var _0x2003=function(_0x2a7236,_0xa73c2b){_0x2a7236=_0x2a7236-0x0;var _0x2899b5=_0x0032[_0x2a7236];return _0x2899b5;};'use strict';var _=require(_0x2003('0x0'));var Redis=require(_0x2003('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x2003('0x2'))(_0x2003('0x3'));var config=require(_0x2003('0x4'));var db=require(_0x2003('0x5'))['db'];config['redis']=_[_0x2003('0x6')](config[_0x2003('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x2003('0x8'))(new Redis(config[_0x2003('0x7')]));require('./squareProject.socket')['register'](socket);function respondWithStatusCode(_0x33023c,_0x437b62){_0x437b62=_0x437b62||0xcc;return function(_0xd024a3){if(_0xd024a3){return _0x33023c[_0x2003('0x9')](_0x437b62);}return _0x33023c[_0x2003('0xa')](_0x437b62)[_0x2003('0xb')]();};}function respondWithResult(_0x36d55a,_0x49d537){_0x49d537=_0x49d537||0xc8;return function(_0x150d44){if(_0x150d44){return _0x36d55a['status'](_0x49d537)[_0x2003('0xc')](_0x150d44);}};}function respondWithFilteredResult(_0x533824,_0x3925c0){return function(_0x2d2565){if(_0x2d2565){var _0x2e69b9=typeof _0x3925c0[_0x2003('0xd')]===_0x2003('0xe')&&typeof _0x3925c0[_0x2003('0xf')]===_0x2003('0xe');var _0x4bac0c=_0x2d2565[_0x2003('0x10')];var _0x54e036=_0x2e69b9?0x0:_0x3925c0[_0x2003('0xd')];var _0x4080b3=_0x2e69b9?_0x2d2565['count']:_0x3925c0[_0x2003('0xd')]+_0x3925c0['limit'];var _0x28586e;if(_0x4080b3>=_0x4bac0c){_0x4080b3=_0x4bac0c;_0x28586e=0xc8;}else{_0x28586e=0xce;}_0x533824[_0x2003('0xa')](_0x28586e);return _0x533824[_0x2003('0x11')](_0x2003('0x12'),_0x54e036+'-'+_0x4080b3+'/'+_0x4bac0c)[_0x2003('0xc')](_0x2d2565);}return null;};}function saveUpdates(_0x18078a){return function(_0x147eb1){if(_0x147eb1){return _0x147eb1[_0x2003('0x13')](_0x18078a)['then'](function(_0x23595d){return _0x23595d;});}return null;};}function removeEntity(_0x8dd1c2){return function(_0x58aa2d){if(_0x58aa2d){return _0x58aa2d['destroy']()[_0x2003('0x14')](function(){var _0x3b9b92=_0x58aa2d[_0x2003('0x15')]({'plain':!![]});var _0x306916=_0x2003('0x16');return db[_0x2003('0x17')][_0x2003('0x18')]({'where':{'type':_0x306916,'resourceId':_0x3b9b92['id']}})['then'](function(){return _0x58aa2d;});})['then'](function(){return createAgiSocket();})[_0x2003('0x14')](function(_0x387da4){_0x387da4[_0x2003('0xb')](JSON[_0x2003('0x19')]({'id':_0x58aa2d['id'],'deleted':!![]}));})[_0x2003('0x14')](function(){_0x8dd1c2[_0x2003('0xa')](0xcc)[_0x2003('0xb')]();});}};}function handleEntityNotFound(_0x38d9da){return function(_0x1a1a0c){if(!_0x1a1a0c){_0x38d9da['sendStatus'](0x194);}return _0x1a1a0c;};}function handleError(_0x50b24c,_0x455137){_0x455137=_0x455137||0x1f4;return function(_0x1c8cd0){logger[_0x2003('0x1a')](_0x1c8cd0[_0x2003('0x1b')]);if(_0x1c8cd0[_0x2003('0x1c')]){delete _0x1c8cd0[_0x2003('0x1c')];}_0x50b24c[_0x2003('0xa')](_0x455137)[_0x2003('0x1d')](_0x1c8cd0);};}function createAgiSocket(){try{var _0x534683=require('net');var _0xcfa72f=new _0x534683[(_0x2003('0x1e'))]();return _0xcfa72f[_0x2003('0x1f')](config['agi']['port']||0x11dd,_0x2003('0x20'));}catch(_0x223979){throw _0x223979;}}exports['index']=function(_0x18767b,_0x1bdd07){var _0x522051={},_0x2625b2={},_0x29e2e3={'count':0x0,'rows':[]};var _0x123c81=_[_0x2003('0x21')](db[_0x2003('0x22')][_0x2003('0x23')],function(_0x13842e){return{'name':_0x13842e[_0x2003('0x24')],'type':_0x13842e[_0x2003('0x25')][_0x2003('0x26')]};});_0x2625b2[_0x2003('0x27')]=_[_0x2003('0x21')](_0x123c81,_0x2003('0x1c'));_0x2625b2[_0x2003('0x28')]=_[_0x2003('0x29')](_0x18767b[_0x2003('0x28')]);_0x2625b2[_0x2003('0x2a')]=_[_0x2003('0x2b')](_0x2625b2['model'],_0x2625b2[_0x2003('0x28')]);_0x522051['attributes']=_['intersection'](_0x2625b2[_0x2003('0x27')],qs['fields'](_0x18767b[_0x2003('0x28')][_0x2003('0x2c')]));_0x522051[_0x2003('0x2d')]=_0x522051[_0x2003('0x2d')][_0x2003('0x2e')]?_0x522051['attributes']:_0x2625b2[_0x2003('0x27')];if(!_0x18767b[_0x2003('0x28')][_0x2003('0x2f')](_0x2003('0x30'))){_0x522051[_0x2003('0xf')]=qs[_0x2003('0xf')](_0x18767b['query']['limit']);_0x522051['offset']=qs[_0x2003('0xd')](_0x18767b[_0x2003('0x28')][_0x2003('0xd')]);}_0x522051[_0x2003('0x31')]=qs[_0x2003('0x32')](_0x18767b[_0x2003('0x28')][_0x2003('0x32')]);_0x522051[_0x2003('0x33')]=qs[_0x2003('0x2a')](_['pick'](_0x18767b[_0x2003('0x28')],_0x2625b2[_0x2003('0x2a')]),_0x123c81);if(_0x18767b[_0x2003('0x28')][_0x2003('0x34')]){_0x522051[_0x2003('0x33')]=_['merge'](_0x522051[_0x2003('0x33')],{'$or':_['map'](_0x123c81,function(_0x16d006){if(_0x16d006[_0x2003('0x25')]!==_0x2003('0x35')){var _0x4f0a39={};_0x4f0a39[_0x16d006[_0x2003('0x1c')]]={'$like':'%'+_0x18767b[_0x2003('0x28')]['filter']+'%'};return _0x4f0a39;}})});}_0x522051=_[_0x2003('0x36')]({},_0x522051,_0x18767b['options']);var _0x29b81c={'where':_0x522051[_0x2003('0x33')]};return db[_0x2003('0x22')]['count'](_0x29b81c)[_0x2003('0x14')](function(_0x5251ad){_0x29e2e3['count']=_0x5251ad;if(_0x18767b['query'][_0x2003('0x37')]){_0x522051[_0x2003('0x38')]=[{'all':!![]}];}return db[_0x2003('0x22')][_0x2003('0x39')](_0x522051);})['then'](function(_0xa09ff0){_0x29e2e3[_0x2003('0x3a')]=_0xa09ff0;return _0x29e2e3;})['then'](respondWithFilteredResult(_0x1bdd07,_0x522051))[_0x2003('0x3b')](handleError(_0x1bdd07,null));};exports['show']=function(_0x2a8196,_0x17c8cb){var _0x36627d={'raw':![],'where':{'id':_0x2a8196[_0x2003('0x3c')]['id']}},_0x2a6ff7={};_0x2a6ff7['model']=_['keys'](db[_0x2003('0x22')][_0x2003('0x23')]);_0x2a6ff7[_0x2003('0x28')]=_[_0x2003('0x29')](_0x2a8196[_0x2003('0x28')]);_0x2a6ff7[_0x2003('0x2a')]=_[_0x2003('0x2b')](_0x2a6ff7[_0x2003('0x27')],_0x2a6ff7['query']);_0x36627d['attributes']=_[_0x2003('0x2b')](_0x2a6ff7[_0x2003('0x27')],qs[_0x2003('0x2c')](_0x2a8196[_0x2003('0x28')][_0x2003('0x2c')]));_0x36627d['attributes']=_0x36627d['attributes'][_0x2003('0x2e')]?_0x36627d[_0x2003('0x2d')]:_0x2a6ff7['model'];if(_0x2a8196[_0x2003('0x28')][_0x2003('0x37')]){_0x36627d[_0x2003('0x38')]=[{'all':!![]}];}_0x36627d=_['merge']({},_0x36627d,_0x2a8196['options']);return db[_0x2003('0x22')]['find'](_0x36627d)[_0x2003('0x14')](handleEntityNotFound(_0x17c8cb,null))[_0x2003('0x14')](respondWithResult(_0x17c8cb,null))[_0x2003('0x3b')](handleError(_0x17c8cb,null));};exports['create']=function(_0x25d16e,_0x3b25c3){return db[_0x2003('0x22')]['create'](_0x25d16e['body'],{})[_0x2003('0x14')](function(_0x5124d6){var _0x2933ee=_0x25d16e[_0x2003('0x3d')]['get']({'plain':!![]});if(!_0x2933ee)throw new Error(_0x2003('0x3e'));if(_0x2933ee[_0x2003('0x3f')]===_0x2003('0x3d')){var _0xc9f124=_0x5124d6['get']({'plain':!![]});var _0x1e2410=_0x2003('0x16');return db[_0x2003('0x40')][_0x2003('0x41')]({'where':{'name':_0x1e2410,'userProfileId':_0x2933ee[_0x2003('0x42')]},'raw':!![]})[_0x2003('0x14')](function(_0x2c0634){if(_0x2c0634&&_0x2c0634[_0x2003('0x43')]===0x0){return db[_0x2003('0x17')][_0x2003('0x44')]({'name':_0xc9f124[_0x2003('0x1c')],'resourceId':_0xc9f124['id'],'type':_0x2c0634[_0x2003('0x1c')],'sectionId':_0x2c0634['id']},{})[_0x2003('0x14')](function(){return _0x5124d6;});}else{return _0x5124d6;}})['catch'](function(_0x4c60d8){logger[_0x2003('0x1a')](_0x2003('0x45'),_0x4c60d8);throw _0x4c60d8;});}return _0x5124d6;})['then'](respondWithResult(_0x3b25c3,0xc9))[_0x2003('0x3b')](handleError(_0x3b25c3,null));};exports[_0x2003('0x13')]=function(_0x2ccd43,_0x5d9570){if(_0x2ccd43[_0x2003('0x46')]['id']){delete _0x2ccd43[_0x2003('0x46')]['id'];}return db['SquareProject']['find']({'where':{'id':_0x2ccd43['params']['id']}})[_0x2003('0x14')](handleEntityNotFound(_0x5d9570,null))[_0x2003('0x14')](saveUpdates(_0x2ccd43['body'],null))[_0x2003('0x14')](function(_0x335803){if(!_0x335803)return;var _0x4fe0ed=_0x335803[_0x2003('0x15')]({'plain':!![]});return _0x4fe0ed;})[_0x2003('0x14')](function(_0x5cb308){var _0x1c9331=new Redis(config[_0x2003('0x7')]);_0x1c9331['publish']('agi',JSON[_0x2003('0x19')](_['pick'](_0x5cb308,['id',_0x2003('0x1c'),_0x2003('0x47')])));return _0x5cb308;})[_0x2003('0x14')](respondWithResult(_0x5d9570,null))[_0x2003('0x3b')](handleError(_0x5d9570,null));};exports[_0x2003('0x18')]=function(_0x48b821,_0x373149){return db[_0x2003('0x22')][_0x2003('0x41')]({'where':{'id':_0x48b821[_0x2003('0x3c')]['id']}})[_0x2003('0x14')](handleEntityNotFound(_0x373149,null))[_0x2003('0x14')](removeEntity(_0x373149,null))['catch'](handleError(_0x373149,null));};exports[_0x2003('0x48')]=function(_0x5cf95e,_0x42008c){return db['SquareProject'][_0x2003('0x41')]({'where':{'id':_0x5cf95e[_0x2003('0x3c')]['id']}})['then'](handleEntityNotFound(_0x42008c,null))['then'](function(_0x4d8aaf){if(_0x4d8aaf){return _0x4d8aaf[_0x2003('0x48')](_0x5cf95e[_0x2003('0x46')][_0x2003('0x49')],_[_0x2003('0x4a')](_0x5cf95e[_0x2003('0x46')],[_0x2003('0x49'),'id'])||{});}})[_0x2003('0x14')](respondWithResult(_0x42008c,null))[_0x2003('0x3b')](handleError(_0x42008c,null));};exports[_0x2003('0x4b')]=function(_0x23cd1b,_0x9e105b){return db[_0x2003('0x22')][_0x2003('0x41')]({'where':{'id':_0x23cd1b[_0x2003('0x3c')]['id']}})[_0x2003('0x14')](handleEntityNotFound(_0x9e105b,null))['then'](function(_0x5e2088){if(_0x5e2088){return _0x5e2088[_0x2003('0x4b')](_0x23cd1b[_0x2003('0x28')][_0x2003('0x49')])[_0x2003('0x14')](function(){if(_[_0x2003('0x4c')](_0x23cd1b[_0x2003('0x28')]['ids'])){for(var _0x413afd=0x0;_0x413afd<_0x23cd1b[_0x2003('0x28')][_0x2003('0x49')][_0x2003('0x2e')];_0x413afd+=0x1){socket[_0x2003('0x4d')]('userSquareProject:remove',{'UserId':Number(_0x23cd1b[_0x2003('0x28')][_0x2003('0x49')][_0x413afd]),'SquareProjectId':Number(_0x23cd1b['params']['id'])});}}else{socket[_0x2003('0x4d')](_0x2003('0x4e'),{'UserId':Number(_0x23cd1b[_0x2003('0x28')][_0x2003('0x49')]),'SquareProjectId':Number(_0x23cd1b[_0x2003('0x3c')]['id'])});}});}})[_0x2003('0x14')](respondWithStatusCode(_0x9e105b,null))['catch'](handleError(_0x9e105b,null));};exports[_0x2003('0x4f')]=function(_0x32c258,_0x3118ba){var _0x1362fb={};var _0x1359d8={};var _0x23f5fd;var _0x59ad8a;return db['SquareProject']['findOne']({'where':{'id':_0x32c258[_0x2003('0x3c')]['id']}})[_0x2003('0x14')](handleEntityNotFound(_0x3118ba,null))[_0x2003('0x14')](function(_0x134204){if(_0x134204){_0x23f5fd=_0x134204;_0x1359d8[_0x2003('0x27')]=_[_0x2003('0x29')](db[_0x2003('0x50')]['rawAttributes']);_0x1359d8['query']=_[_0x2003('0x29')](_0x32c258['query']);_0x1359d8[_0x2003('0x2a')]=_[_0x2003('0x2b')](_0x1359d8['model'],_0x1359d8['query']);_0x1362fb['attributes']=_['intersection'](_0x1359d8[_0x2003('0x27')],qs[_0x2003('0x2c')](_0x32c258[_0x2003('0x28')][_0x2003('0x2c')]));_0x1362fb['attributes']=_0x1362fb[_0x2003('0x2d')][_0x2003('0x2e')]?_0x1362fb[_0x2003('0x2d')]:_0x1359d8[_0x2003('0x27')];_0x1362fb[_0x2003('0x31')]=qs['sort'](_0x32c258[_0x2003('0x28')][_0x2003('0x32')]);_0x1362fb['where']=qs['filters'](_[_0x2003('0x51')](_0x32c258['query'],_0x1359d8[_0x2003('0x2a')]));if(_0x32c258[_0x2003('0x28')][_0x2003('0x34')]){_0x1362fb[_0x2003('0x33')]=_[_0x2003('0x36')](_0x1362fb[_0x2003('0x33')],{'$or':_[_0x2003('0x21')](_0x1362fb[_0x2003('0x2d')],function(_0x3e0547){var _0x45ac51={};_0x45ac51[_0x3e0547]={'$like':'%'+_0x32c258[_0x2003('0x28')][_0x2003('0x34')]+'%'};return _0x45ac51;})});}_0x1362fb=_[_0x2003('0x36')]({},_0x1362fb,_0x32c258[_0x2003('0x52')]);return _0x23f5fd['getUsers'](_0x1362fb);}})[_0x2003('0x14')](function(_0x209ef8){if(_0x209ef8){_0x59ad8a=_0x209ef8[_0x2003('0x2e')];if(!_0x32c258[_0x2003('0x28')][_0x2003('0x2f')](_0x2003('0x30'))){_0x1362fb['limit']=qs[_0x2003('0xf')](_0x32c258[_0x2003('0x28')][_0x2003('0xf')]);_0x1362fb['offset']=qs[_0x2003('0xd')](_0x32c258['query'][_0x2003('0xd')]);}return _0x23f5fd[_0x2003('0x4f')](_0x1362fb);}})[_0x2003('0x14')](function(_0x262a49){if(_0x262a49){return _0x262a49?{'count':_0x59ad8a,'rows':_0x262a49}:null;}})[_0x2003('0x14')](respondWithResult(_0x3118ba,null))[_0x2003('0x3b')](handleError(_0x3118ba,null));}; \ No newline at end of file +var _0xdf5c=['sendStatus','status','offset','undefined','count','limit','set','json','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','agi','port','127.0.0.1','index','map','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','SquareProject','includeAll','findAll','rows','catch','params','include','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SquareProjects','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','stringify','production','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','./squareProject.socket'];(function(_0xd1b4d7,_0x28b2c1){var _0x3002ec=function(_0x3d95ce){while(--_0x3d95ce){_0xd1b4d7['push'](_0xd1b4d7['shift']());}};_0x3002ec(++_0x28b2c1);}(_0xdf5c,0x1e2));var _0xcdf5=function(_0x321d5e,_0x1ae4a9){_0x321d5e=_0x321d5e-0x0;var _0x3458cd=_0xdf5c[_0x321d5e];return _0x3458cd;};'use strict';var _=require(_0xcdf5('0x0'));var Redis=require(_0xcdf5('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0xcdf5('0x2'))(_0xcdf5('0x3'));var config=require(_0xcdf5('0x4'));var db=require(_0xcdf5('0x5'))['db'];config['redis']=_[_0xcdf5('0x6')](config[_0xcdf5('0x7')],{'host':_0xcdf5('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xcdf5('0x9'))['register'](socket);function respondWithStatusCode(_0x31e39a,_0x596ca7){_0x596ca7=_0x596ca7||0xcc;return function(_0x35870f){if(_0x35870f){return _0x31e39a[_0xcdf5('0xa')](_0x596ca7);}return _0x31e39a[_0xcdf5('0xb')](_0x596ca7)['end']();};}function respondWithResult(_0x564c86,_0xfbb636){_0xfbb636=_0xfbb636||0xc8;return function(_0x44ca3b){if(_0x44ca3b){return _0x564c86[_0xcdf5('0xb')](_0xfbb636)['json'](_0x44ca3b);}};}function respondWithFilteredResult(_0x30bee2,_0x8db16b){return function(_0xa28db0){if(_0xa28db0){var _0xc5a907=typeof _0x8db16b[_0xcdf5('0xc')]===_0xcdf5('0xd')&&typeof _0x8db16b['limit']===_0xcdf5('0xd');var _0x1d78d4=_0xa28db0[_0xcdf5('0xe')];var _0x3ffb8d=_0xc5a907?0x0:_0x8db16b[_0xcdf5('0xc')];var _0x486d8e=_0xc5a907?_0xa28db0[_0xcdf5('0xe')]:_0x8db16b[_0xcdf5('0xc')]+_0x8db16b[_0xcdf5('0xf')];var _0x1eacd7;if(_0x486d8e>=_0x1d78d4){_0x486d8e=_0x1d78d4;_0x1eacd7=0xc8;}else{_0x1eacd7=0xce;}_0x30bee2['status'](_0x1eacd7);return _0x30bee2[_0xcdf5('0x10')]('Content-Range',_0x3ffb8d+'-'+_0x486d8e+'/'+_0x1d78d4)[_0xcdf5('0x11')](_0xa28db0);}return null;};}function saveUpdates(_0x1204d7){return function(_0xdaa71e){if(_0xdaa71e){return _0xdaa71e[_0xcdf5('0x12')](_0x1204d7)[_0xcdf5('0x13')](function(_0x274764){return _0x274764;});}return null;};}function removeEntity(_0x212200){return function(_0x45524e){if(_0x45524e){return _0x45524e[_0xcdf5('0x14')]()[_0xcdf5('0x13')](function(){var _0x27de21=_0x45524e[_0xcdf5('0x15')]({'plain':!![]});var _0x558cf6='SquareProjects';return db[_0xcdf5('0x16')][_0xcdf5('0x14')]({'where':{'type':_0x558cf6,'resourceId':_0x27de21['id']}})[_0xcdf5('0x13')](function(){return _0x45524e;});})[_0xcdf5('0x13')](function(){return createAgiSocket();})['then'](function(_0x1490e4){_0x1490e4[_0xcdf5('0x17')](JSON['stringify']({'id':_0x45524e['id'],'deleted':!![]}));})[_0xcdf5('0x13')](function(){_0x212200[_0xcdf5('0xb')](0xcc)[_0xcdf5('0x17')]();});}};}function handleEntityNotFound(_0xd15d3d){return function(_0x139310){if(!_0x139310){_0xd15d3d[_0xcdf5('0xa')](0x194);}return _0x139310;};}function handleError(_0x5c4cb1,_0x319151){_0x319151=_0x319151||0x1f4;return function(_0x422238){logger[_0xcdf5('0x18')](_0x422238[_0xcdf5('0x19')]);if(_0x422238['name']){delete _0x422238[_0xcdf5('0x1a')];}_0x5c4cb1[_0xcdf5('0xb')](_0x319151)[_0xcdf5('0x1b')](_0x422238);};}function createAgiSocket(){try{var _0x1f9a5c=require('net');var _0x5a3836=new _0x1f9a5c['Socket']();return _0x5a3836['connect'](config[_0xcdf5('0x1c')][_0xcdf5('0x1d')]||0x11dd,_0xcdf5('0x1e'));}catch(_0x3a93f7){throw _0x3a93f7;}}exports[_0xcdf5('0x1f')]=function(_0x2809ee,_0x43e413){var _0x206d67={},_0x50c842={},_0x3fed09={'count':0x0,'rows':[]};var _0x588739=_[_0xcdf5('0x20')](db['SquareProject']['rawAttributes'],function(_0x28e348){return{'name':_0x28e348['fieldName'],'type':_0x28e348[_0xcdf5('0x21')][_0xcdf5('0x22')]};});_0x50c842[_0xcdf5('0x23')]=_[_0xcdf5('0x20')](_0x588739,'name');_0x50c842[_0xcdf5('0x24')]=_[_0xcdf5('0x25')](_0x2809ee[_0xcdf5('0x24')]);_0x50c842[_0xcdf5('0x26')]=_[_0xcdf5('0x27')](_0x50c842['model'],_0x50c842['query']);_0x206d67[_0xcdf5('0x28')]=_[_0xcdf5('0x27')](_0x50c842[_0xcdf5('0x23')],qs[_0xcdf5('0x29')](_0x2809ee[_0xcdf5('0x24')][_0xcdf5('0x29')]));_0x206d67['attributes']=_0x206d67['attributes'][_0xcdf5('0x2a')]?_0x206d67[_0xcdf5('0x28')]:_0x50c842[_0xcdf5('0x23')];if(!_0x2809ee[_0xcdf5('0x24')][_0xcdf5('0x2b')](_0xcdf5('0x2c'))){_0x206d67['limit']=qs[_0xcdf5('0xf')](_0x2809ee[_0xcdf5('0x24')][_0xcdf5('0xf')]);_0x206d67[_0xcdf5('0xc')]=qs[_0xcdf5('0xc')](_0x2809ee['query'][_0xcdf5('0xc')]);}_0x206d67[_0xcdf5('0x2d')]=qs[_0xcdf5('0x2e')](_0x2809ee[_0xcdf5('0x24')][_0xcdf5('0x2e')]);_0x206d67['where']=qs['filters'](_[_0xcdf5('0x2f')](_0x2809ee[_0xcdf5('0x24')],_0x50c842[_0xcdf5('0x26')]),_0x588739);if(_0x2809ee[_0xcdf5('0x24')][_0xcdf5('0x30')]){_0x206d67[_0xcdf5('0x31')]=_[_0xcdf5('0x32')](_0x206d67[_0xcdf5('0x31')],{'$or':_[_0xcdf5('0x20')](_0x588739,function(_0x100cf9){if(_0x100cf9[_0xcdf5('0x21')]!==_0xcdf5('0x33')){var _0x50fe8e={};_0x50fe8e[_0x100cf9[_0xcdf5('0x1a')]]={'$like':'%'+_0x2809ee[_0xcdf5('0x24')][_0xcdf5('0x30')]+'%'};return _0x50fe8e;}})});}_0x206d67=_[_0xcdf5('0x32')]({},_0x206d67,_0x2809ee['options']);var _0x18dc32={'where':_0x206d67[_0xcdf5('0x31')]};return db[_0xcdf5('0x34')]['count'](_0x18dc32)['then'](function(_0x12449c){_0x3fed09[_0xcdf5('0xe')]=_0x12449c;if(_0x2809ee[_0xcdf5('0x24')][_0xcdf5('0x35')]){_0x206d67['include']=[{'all':!![]}];}return db[_0xcdf5('0x34')][_0xcdf5('0x36')](_0x206d67);})['then'](function(_0x22e635){_0x3fed09[_0xcdf5('0x37')]=_0x22e635;return _0x3fed09;})[_0xcdf5('0x13')](respondWithFilteredResult(_0x43e413,_0x206d67))[_0xcdf5('0x38')](handleError(_0x43e413,null));};exports['show']=function(_0x2229ed,_0x45e920){var _0x58b503={'raw':![],'where':{'id':_0x2229ed[_0xcdf5('0x39')]['id']}},_0x2f57a3={};_0x2f57a3[_0xcdf5('0x23')]=_[_0xcdf5('0x25')](db[_0xcdf5('0x34')]['rawAttributes']);_0x2f57a3[_0xcdf5('0x24')]=_[_0xcdf5('0x25')](_0x2229ed[_0xcdf5('0x24')]);_0x2f57a3[_0xcdf5('0x26')]=_['intersection'](_0x2f57a3[_0xcdf5('0x23')],_0x2f57a3['query']);_0x58b503[_0xcdf5('0x28')]=_[_0xcdf5('0x27')](_0x2f57a3['model'],qs[_0xcdf5('0x29')](_0x2229ed['query'][_0xcdf5('0x29')]));_0x58b503['attributes']=_0x58b503[_0xcdf5('0x28')]['length']?_0x58b503[_0xcdf5('0x28')]:_0x2f57a3[_0xcdf5('0x23')];if(_0x2229ed[_0xcdf5('0x24')][_0xcdf5('0x35')]){_0x58b503[_0xcdf5('0x3a')]=[{'all':!![]}];}_0x58b503=_[_0xcdf5('0x32')]({},_0x58b503,_0x2229ed[_0xcdf5('0x3b')]);return db['SquareProject'][_0xcdf5('0x3c')](_0x58b503)[_0xcdf5('0x13')](handleEntityNotFound(_0x45e920,null))[_0xcdf5('0x13')](respondWithResult(_0x45e920,null))[_0xcdf5('0x38')](handleError(_0x45e920,null));};exports['create']=function(_0x217f10,_0x217b02){return db[_0xcdf5('0x34')]['create'](_0x217f10[_0xcdf5('0x3d')],{})[_0xcdf5('0x13')](function(_0x59e079){var _0x2bdb14=_0x217f10[_0xcdf5('0x3e')][_0xcdf5('0x15')]({'plain':!![]});if(!_0x2bdb14)throw new Error(_0xcdf5('0x3f'));if(_0x2bdb14[_0xcdf5('0x40')]===_0xcdf5('0x3e')){var _0x2e8b80=_0x59e079[_0xcdf5('0x15')]({'plain':!![]});var _0x59589b=_0xcdf5('0x41');return db[_0xcdf5('0x42')]['find']({'where':{'name':_0x59589b,'userProfileId':_0x2bdb14[_0xcdf5('0x43')]},'raw':!![]})[_0xcdf5('0x13')](function(_0x41d1e9){if(_0x41d1e9&&_0x41d1e9[_0xcdf5('0x44')]===0x0){return db[_0xcdf5('0x16')][_0xcdf5('0x45')]({'name':_0x2e8b80[_0xcdf5('0x1a')],'resourceId':_0x2e8b80['id'],'type':_0x41d1e9[_0xcdf5('0x1a')],'sectionId':_0x41d1e9['id']},{})[_0xcdf5('0x13')](function(){return _0x59e079;});}else{return _0x59e079;}})[_0xcdf5('0x38')](function(_0x4bdeb9){logger[_0xcdf5('0x18')](_0xcdf5('0x46'),_0x4bdeb9);throw _0x4bdeb9;});}return _0x59e079;})[_0xcdf5('0x13')](respondWithResult(_0x217b02,0xc9))[_0xcdf5('0x38')](handleError(_0x217b02,null));};exports[_0xcdf5('0x12')]=function(_0x581e45,_0x251d7e){if(_0x581e45[_0xcdf5('0x3d')]['id']){delete _0x581e45[_0xcdf5('0x3d')]['id'];}return db[_0xcdf5('0x34')][_0xcdf5('0x3c')]({'where':{'id':_0x581e45[_0xcdf5('0x39')]['id']}})[_0xcdf5('0x13')](handleEntityNotFound(_0x251d7e,null))[_0xcdf5('0x13')](saveUpdates(_0x581e45[_0xcdf5('0x3d')],null))[_0xcdf5('0x13')](function(_0x3f034e){if(!_0x3f034e)return;var _0xc05ae=_0x3f034e['get']({'plain':!![]});return _0xc05ae;})[_0xcdf5('0x13')](function(_0x306c66){var _0x53b255=new Redis(config[_0xcdf5('0x7')]);_0x53b255['publish'](_0xcdf5('0x1c'),JSON[_0xcdf5('0x47')](_['pick'](_0x306c66,['id',_0xcdf5('0x1a'),_0xcdf5('0x48')])));return _0x306c66;})[_0xcdf5('0x13')](respondWithResult(_0x251d7e,null))[_0xcdf5('0x38')](handleError(_0x251d7e,null));};exports[_0xcdf5('0x14')]=function(_0x28aec7,_0x475aed){return db[_0xcdf5('0x34')][_0xcdf5('0x3c')]({'where':{'id':_0x28aec7[_0xcdf5('0x39')]['id']}})[_0xcdf5('0x13')](handleEntityNotFound(_0x475aed,null))[_0xcdf5('0x13')](removeEntity(_0x475aed,null))[_0xcdf5('0x38')](handleError(_0x475aed,null));};exports['addUsers']=function(_0x4739a0,_0x33cc59){return db[_0xcdf5('0x34')][_0xcdf5('0x3c')]({'where':{'id':_0x4739a0[_0xcdf5('0x39')]['id']}})[_0xcdf5('0x13')](handleEntityNotFound(_0x33cc59,null))['then'](function(_0x3ff094){if(_0x3ff094){return _0x3ff094[_0xcdf5('0x49')](_0x4739a0['body'][_0xcdf5('0x4a')],_[_0xcdf5('0x4b')](_0x4739a0['body'],[_0xcdf5('0x4a'),'id'])||{});}})[_0xcdf5('0x13')](respondWithResult(_0x33cc59,null))[_0xcdf5('0x38')](handleError(_0x33cc59,null));};exports[_0xcdf5('0x4c')]=function(_0x399f91,_0x72dcc2){return db[_0xcdf5('0x34')][_0xcdf5('0x3c')]({'where':{'id':_0x399f91[_0xcdf5('0x39')]['id']}})['then'](handleEntityNotFound(_0x72dcc2,null))[_0xcdf5('0x13')](function(_0x1ed3a2){if(_0x1ed3a2){return _0x1ed3a2[_0xcdf5('0x4c')](_0x399f91[_0xcdf5('0x24')][_0xcdf5('0x4a')])[_0xcdf5('0x13')](function(){if(_[_0xcdf5('0x4d')](_0x399f91[_0xcdf5('0x24')][_0xcdf5('0x4a')])){for(var _0x2be44b=0x0;_0x2be44b<_0x399f91[_0xcdf5('0x24')][_0xcdf5('0x4a')][_0xcdf5('0x2a')];_0x2be44b+=0x1){socket[_0xcdf5('0x4e')](_0xcdf5('0x4f'),{'UserId':Number(_0x399f91[_0xcdf5('0x24')]['ids'][_0x2be44b]),'SquareProjectId':Number(_0x399f91[_0xcdf5('0x39')]['id'])});}}else{socket[_0xcdf5('0x4e')](_0xcdf5('0x4f'),{'UserId':Number(_0x399f91[_0xcdf5('0x24')][_0xcdf5('0x4a')]),'SquareProjectId':Number(_0x399f91['params']['id'])});}});}})[_0xcdf5('0x13')](respondWithStatusCode(_0x72dcc2,null))[_0xcdf5('0x38')](handleError(_0x72dcc2,null));};exports[_0xcdf5('0x50')]=function(_0xea8e83,_0x44be99){var _0x583ef8={};var _0x11dc91={};var _0x239bce;var _0x55c49b;return db['SquareProject'][_0xcdf5('0x51')]({'where':{'id':_0xea8e83[_0xcdf5('0x39')]['id']}})[_0xcdf5('0x13')](handleEntityNotFound(_0x44be99,null))['then'](function(_0x1e23a3){if(_0x1e23a3){_0x239bce=_0x1e23a3;_0x11dc91['model']=_['keys'](db['User']['rawAttributes']);_0x11dc91[_0xcdf5('0x24')]=_[_0xcdf5('0x25')](_0xea8e83[_0xcdf5('0x24')]);_0x11dc91['filters']=_['intersection'](_0x11dc91[_0xcdf5('0x23')],_0x11dc91[_0xcdf5('0x24')]);_0x583ef8[_0xcdf5('0x28')]=_[_0xcdf5('0x27')](_0x11dc91['model'],qs['fields'](_0xea8e83[_0xcdf5('0x24')][_0xcdf5('0x29')]));_0x583ef8[_0xcdf5('0x28')]=_0x583ef8[_0xcdf5('0x28')][_0xcdf5('0x2a')]?_0x583ef8[_0xcdf5('0x28')]:_0x11dc91['model'];_0x583ef8[_0xcdf5('0x2d')]=qs[_0xcdf5('0x2e')](_0xea8e83[_0xcdf5('0x24')]['sort']);_0x583ef8[_0xcdf5('0x31')]=qs[_0xcdf5('0x26')](_[_0xcdf5('0x2f')](_0xea8e83['query'],_0x11dc91[_0xcdf5('0x26')]));if(_0xea8e83[_0xcdf5('0x24')]['filter']){_0x583ef8[_0xcdf5('0x31')]=_[_0xcdf5('0x32')](_0x583ef8[_0xcdf5('0x31')],{'$or':_[_0xcdf5('0x20')](_0x583ef8[_0xcdf5('0x28')],function(_0x712b22){var _0x5400f1={};_0x5400f1[_0x712b22]={'$like':'%'+_0xea8e83[_0xcdf5('0x24')][_0xcdf5('0x30')]+'%'};return _0x5400f1;})});}_0x583ef8=_['merge']({},_0x583ef8,_0xea8e83[_0xcdf5('0x3b')]);return _0x239bce['getUsers'](_0x583ef8);}})[_0xcdf5('0x13')](function(_0xa8a1b3){if(_0xa8a1b3){_0x55c49b=_0xa8a1b3['length'];if(!_0xea8e83[_0xcdf5('0x24')][_0xcdf5('0x2b')]('nolimit')){_0x583ef8[_0xcdf5('0xf')]=qs[_0xcdf5('0xf')](_0xea8e83[_0xcdf5('0x24')][_0xcdf5('0xf')]);_0x583ef8[_0xcdf5('0xc')]=qs[_0xcdf5('0xc')](_0xea8e83[_0xcdf5('0x24')]['offset']);}return _0x239bce['getUsers'](_0x583ef8);}})['then'](function(_0x4405ac){if(_0x4405ac){return _0x4405ac?{'count':_0x55c49b,'rows':_0x4405ac}:null;}})[_0xcdf5('0x13')](respondWithResult(_0x44be99,null))[_0xcdf5('0x38')](handleError(_0x44be99,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 8a405ef..4bb619f 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 _0x3352=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x157447,_0x71b122){var _0x4b3566=function(_0x4116c2){while(--_0x4116c2){_0x157447['push'](_0x157447['shift']());}};_0x4b3566(++_0x71b122);}(_0x3352,0x1ab));var _0x2335=function(_0x3d44e9,_0x2e8d17){_0x3d44e9=_0x3d44e9-0x0;var _0x40f2cf=_0x3352[_0x3d44e9];return _0x40f2cf;};'use strict';var EventEmitter=require(_0x2335('0x0'));var SquareProject=require(_0x2335('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x2335('0x2')](0x0);var events={'afterCreate':_0x2335('0x3'),'afterUpdate':_0x2335('0x4'),'afterDestroy':_0x2335('0x5')};function emitEvent(_0x483fb2){return function(_0xed3ee2,_0x27343c,_0x5d2ca9){SquareProjectEvents['emit'](_0x483fb2+':'+_0xed3ee2['id'],_0xed3ee2);SquareProjectEvents[_0x2335('0x6')](_0x483fb2,_0xed3ee2);_0x5d2ca9(null);};}for(var e in events){if(events[_0x2335('0x7')](e)){var event=events[e];SquareProject[_0x2335('0x8')](e,emitEvent(event));}}module[_0x2335('0x9')]=SquareProjectEvents; \ No newline at end of file +var _0xaea7=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x4ed4d2,_0x47acf7){var _0x15ae2e=function(_0x3199f0){while(--_0x3199f0){_0x4ed4d2['push'](_0x4ed4d2['shift']());}};_0x15ae2e(++_0x47acf7);}(_0xaea7,0x7c));var _0x7aea=function(_0x278bbb,_0x5785e6){_0x278bbb=_0x278bbb-0x0;var _0x161f31=_0xaea7[_0x278bbb];return _0x161f31;};'use strict';var EventEmitter=require(_0x7aea('0x0'));var SquareProject=require(_0x7aea('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x7aea('0x2')](0x0);var events={'afterCreate':_0x7aea('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x23732b){return function(_0x160484,_0xd0a171,_0x4e7078){SquareProjectEvents[_0x7aea('0x4')](_0x23732b+':'+_0x160484['id'],_0x160484);SquareProjectEvents[_0x7aea('0x4')](_0x23732b,_0x160484);_0x4e7078(null);};}for(var e in events){if(events[_0x7aea('0x5')](e)){var event=events[e];SquareProject[_0x7aea('0x6')](e,emitEvent(event));}}module[_0x7aea('0x7')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index a243626..98ecad4 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 _0x3678=['rimraf','./squareProject.attributes','exports','define','square_projects','changed','preproduction','format','YYYY-MM-DD\x20HH:mm:ss','production','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x8d1246,_0x19dcf8){var _0x598767=function(_0x3be51b){while(--_0x3be51b){_0x8d1246['push'](_0x8d1246['shift']());}};_0x598767(++_0x19dcf8);}(_0x3678,0x9a));var _0x8367=function(_0x1e3671,_0x9ae4fc){_0x1e3671=_0x1e3671-0x0;var _0x48d5f5=_0x3678[_0x1e3671];return _0x48d5f5;};'use strict';var _=require(_0x8367('0x0'));var util=require('util');var logger=require(_0x8367('0x1'))('api');var moment=require(_0x8367('0x2'));var BPromise=require(_0x8367('0x3'));var rp=require(_0x8367('0x4'));var fs=require('fs');var path=require(_0x8367('0x5'));var rimraf=require(_0x8367('0x6'));var config=require('../../config/environment');var attributes=require(_0x8367('0x7'));module[_0x8367('0x8')]=function(_0x37c009,_0x563a95){return _0x37c009[_0x8367('0x9')]('SquareProject',attributes,{'tableName':_0x8367('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x12640d,_0x119aff,_0x47b4bf){if(_0x12640d[_0x8367('0xb')](_0x8367('0xc'))){_0x12640d['savedAt']=moment()[_0x8367('0xd')](_0x8367('0xe'));}if(_0x12640d[_0x8367('0xb')](_0x8367('0xf'))){_0x12640d['publishedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x47b4bf(null,_0x12640d);}}});}; \ No newline at end of file +var _0x12c0=['SquareProject','square_projects','changed','preproduction','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','format','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x12c0,0xa0));var _0x012c=function(_0x559942,_0x2e671a){_0x559942=_0x559942-0x0;var _0x1e86f4=_0x12c0[_0x559942];return _0x1e86f4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x012c('0x0'))(_0x012c('0x1'));var moment=require(_0x012c('0x2'));var BPromise=require(_0x012c('0x3'));var rp=require(_0x012c('0x4'));var fs=require('fs');var path=require(_0x012c('0x5'));var rimraf=require(_0x012c('0x6'));var config=require(_0x012c('0x7'));var attributes=require(_0x012c('0x8'));module[_0x012c('0x9')]=function(_0x525e61,_0x3641e4){return _0x525e61[_0x012c('0xa')](_0x012c('0xb'),attributes,{'tableName':_0x012c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x560423,_0x4aa4c8,_0x5bc8a6){if(_0x560423[_0x012c('0xd')](_0x012c('0xe'))){_0x560423['savedAt']=moment()['format'](_0x012c('0xf'));}if(_0x560423['changed'](_0x012c('0x10'))){_0x560423[_0x012c('0x11')]=moment()[_0x012c('0x12')](_0x012c('0xf'));}_0x5bc8a6(null,_0x560423);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index de77439..c7e8af9 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 _0x015b=['localhost','./squareProject.socket','register','GetSquareProjects','SquareProject','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','stringify','message','error','ShowSquareProject','find','info','catch','lodash','../../mysqldb','../../config/logger','rpc','../../config/environment','redis'];(function(_0x4db9c2,_0x35237e){var _0x1d26dd=function(_0xd6106c){while(--_0xd6106c){_0x4db9c2['push'](_0x4db9c2['shift']());}};_0x1d26dd(++_0x35237e);}(_0x015b,0x1ad));var _0xb015=function(_0x2cbb74,_0x241c10){_0x2cbb74=_0x2cbb74-0x0;var _0xa6d18=_0x015b[_0x2cbb74];return _0xa6d18;};'use strict';var _=require(_0xb015('0x0'));var Redis=require('ioredis');var db=require(_0xb015('0x1'))['db'];var logger=require(_0xb015('0x2'))(_0xb015('0x3'));var config=require(_0xb015('0x4'));config[_0xb015('0x5')]=_['defaults'](config['redis'],{'host':_0xb015('0x6'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb015('0x5')]));require(_0xb015('0x7'))[_0xb015('0x8')](socket);exports[_0xb015('0x9')]=function(_0x5b3936){var _0x5d1f37=this;return new Promise(function(_0x29ff17,_0x2e9c25){return db[_0xb015('0xa')][_0xb015('0xb')]({'raw':_0x5b3936[_0xb015('0xc')]?_0x5b3936['options'][_0xb015('0xd')]===undefined?!![]:![]:!![],'where':_0x5b3936[_0xb015('0xc')]?_0x5b3936[_0xb015('0xc')][_0xb015('0xe')]||null:null,'attributes':_0x5b3936[_0xb015('0xc')]?_0x5b3936[_0xb015('0xc')][_0xb015('0xf')]||null:null,'limit':_0x5b3936[_0xb015('0xc')]?_0x5b3936['options'][_0xb015('0x10')]||null:null,'include':_0x5b3936[_0xb015('0xc')]?_0x5b3936[_0xb015('0xc')][_0xb015('0x11')]?_[_0xb015('0x12')](_0x5b3936[_0xb015('0xc')][_0xb015('0x11')],function(_0x6fb1f6){return{'model':db[_0x6fb1f6[_0xb015('0x13')]],'as':_0x6fb1f6['as'],'attributes':_0x6fb1f6[_0xb015('0xf')],'include':_0x6fb1f6['include']?_[_0xb015('0x12')](_0x6fb1f6['include'],function(_0x36a29c){return{'model':db[_0x36a29c['model']],'as':_0x36a29c['as'],'attributes':_0x36a29c[_0xb015('0xf')],'include':_0x36a29c[_0xb015('0x11')]?_[_0xb015('0x12')](_0x36a29c[_0xb015('0x11')],function(_0xc5e11c){return{'model':db[_0xc5e11c[_0xb015('0x13')]],'as':_0xc5e11c['as'],'attributes':_0xc5e11c[_0xb015('0xf')]};}):[]};}):[]};}):[]:[]})[_0xb015('0x14')](function(_0x50eff2){logger['info'](_0xb015('0x9'),_0x5b3936);logger[_0xb015('0x15')]('GetSquareProjects',_0x5b3936,JSON[_0xb015('0x16')](_0x50eff2));_0x29ff17(_0x50eff2);})['catch'](function(_0x440c93){logger['error'](_0xb015('0x9'),_0x440c93[_0xb015('0x17')],_0x5b3936);_0x2e9c25(_0x5d1f37[_0xb015('0x18')](0x1f4,_0x440c93[_0xb015('0x17')]));});});};exports[_0xb015('0x19')]=function(_0x45176d){var _0x23477e=this;return new Promise(function(_0x6a8f9c,_0x3f1210){return db[_0xb015('0xa')][_0xb015('0x1a')]({'raw':_0x45176d['options']?_0x45176d['options']['raw']===undefined?!![]:![]:!![],'where':_0x45176d[_0xb015('0xc')]?_0x45176d[_0xb015('0xc')]['where']||null:null,'attributes':_0x45176d[_0xb015('0xc')]?_0x45176d[_0xb015('0xc')][_0xb015('0xf')]||null:null,'include':_0x45176d['options']?_0x45176d['options'][_0xb015('0x11')]?_[_0xb015('0x12')](_0x45176d[_0xb015('0xc')][_0xb015('0x11')],function(_0xf54e77){return{'model':db[_0xf54e77[_0xb015('0x13')]],'as':_0xf54e77['as'],'attributes':_0xf54e77[_0xb015('0xf')],'include':_0xf54e77[_0xb015('0x11')]?_[_0xb015('0x12')](_0xf54e77['include'],function(_0x2fd47e){return{'model':db[_0x2fd47e[_0xb015('0x13')]],'as':_0x2fd47e['as'],'attributes':_0x2fd47e[_0xb015('0xf')],'include':_0x2fd47e['include']?_[_0xb015('0x12')](_0x2fd47e[_0xb015('0x11')],function(_0x3d3af5){return{'model':db[_0x3d3af5[_0xb015('0x13')]],'as':_0x3d3af5['as'],'attributes':_0x3d3af5[_0xb015('0xf')]};}):[]};}):[]};}):[]:[]})[_0xb015('0x14')](function(_0x2e1dd6){logger[_0xb015('0x1b')](_0xb015('0x19'),_0x45176d);logger[_0xb015('0x15')](_0xb015('0x19'),_0x45176d,JSON['stringify'](_0x2e1dd6));_0x6a8f9c(_0x2e1dd6);})[_0xb015('0x1c')](function(_0x18242b){logger['error']('ShowSquareProject',_0x18242b['message'],_0x45176d);_0x3f1210(_0x23477e[_0xb015('0x18')](0x1f4,_0x18242b[_0xb015('0x17')]));});});}; \ No newline at end of file +var _0x0268=['attributes','then','info','GetSquareProjects','debug','stringify','error','message','ShowSquareProject','find','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','defaults','socket.io-emitter','./squareProject.socket','register','SquareProject','findAll','options','raw','where','limit','include','map','model'];(function(_0x528ad3,_0x53a1f7){var _0x43b7c5=function(_0x283f21){while(--_0x283f21){_0x528ad3['push'](_0x528ad3['shift']());}};_0x43b7c5(++_0x53a1f7);}(_0x0268,0x184));var _0x8026=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x0268[_0x2bf141];return _0x48277b;};'use strict';var _=require(_0x8026('0x0'));var Redis=require(_0x8026('0x1'));var db=require('../../mysqldb')['db'];var logger=require(_0x8026('0x2'))(_0x8026('0x3'));var config=require(_0x8026('0x4'));config['redis']=_[_0x8026('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8026('0x6'))(new Redis(config['redis']));require(_0x8026('0x7'))[_0x8026('0x8')](socket);exports['GetSquareProjects']=function(_0x5e33d0){var _0x426f6a=this;return new Promise(function(_0x2d665d,_0x1c1b8c){return db[_0x8026('0x9')][_0x8026('0xa')]({'raw':_0x5e33d0[_0x8026('0xb')]?_0x5e33d0[_0x8026('0xb')][_0x8026('0xc')]===undefined?!![]:![]:!![],'where':_0x5e33d0[_0x8026('0xb')]?_0x5e33d0[_0x8026('0xb')][_0x8026('0xd')]||null:null,'attributes':_0x5e33d0[_0x8026('0xb')]?_0x5e33d0['options']['attributes']||null:null,'limit':_0x5e33d0[_0x8026('0xb')]?_0x5e33d0['options'][_0x8026('0xe')]||null:null,'include':_0x5e33d0[_0x8026('0xb')]?_0x5e33d0[_0x8026('0xb')][_0x8026('0xf')]?_[_0x8026('0x10')](_0x5e33d0[_0x8026('0xb')][_0x8026('0xf')],function(_0x12fe56){return{'model':db[_0x12fe56[_0x8026('0x11')]],'as':_0x12fe56['as'],'attributes':_0x12fe56[_0x8026('0x12')],'include':_0x12fe56[_0x8026('0xf')]?_[_0x8026('0x10')](_0x12fe56['include'],function(_0x48033e){return{'model':db[_0x48033e[_0x8026('0x11')]],'as':_0x48033e['as'],'attributes':_0x48033e[_0x8026('0x12')],'include':_0x48033e[_0x8026('0xf')]?_[_0x8026('0x10')](_0x48033e[_0x8026('0xf')],function(_0x4209d2){return{'model':db[_0x4209d2['model']],'as':_0x4209d2['as'],'attributes':_0x4209d2[_0x8026('0x12')]};}):[]};}):[]};}):[]:[]})[_0x8026('0x13')](function(_0x573eb4){logger[_0x8026('0x14')](_0x8026('0x15'),_0x5e33d0);logger[_0x8026('0x16')]('GetSquareProjects',_0x5e33d0,JSON[_0x8026('0x17')](_0x573eb4));_0x2d665d(_0x573eb4);})['catch'](function(_0x52a7e9){logger[_0x8026('0x18')](_0x8026('0x15'),_0x52a7e9[_0x8026('0x19')],_0x5e33d0);_0x1c1b8c(_0x426f6a[_0x8026('0x18')](0x1f4,_0x52a7e9['message']));});});};exports[_0x8026('0x1a')]=function(_0x44d0af){var _0x225567=this;return new Promise(function(_0x4360a8,_0x54ebd8){return db['SquareProject'][_0x8026('0x1b')]({'raw':_0x44d0af['options']?_0x44d0af[_0x8026('0xb')][_0x8026('0xc')]===undefined?!![]:![]:!![],'where':_0x44d0af['options']?_0x44d0af[_0x8026('0xb')]['where']||null:null,'attributes':_0x44d0af[_0x8026('0xb')]?_0x44d0af['options'][_0x8026('0x12')]||null:null,'include':_0x44d0af['options']?_0x44d0af[_0x8026('0xb')]['include']?_['map'](_0x44d0af[_0x8026('0xb')][_0x8026('0xf')],function(_0x4d2e2e){return{'model':db[_0x4d2e2e[_0x8026('0x11')]],'as':_0x4d2e2e['as'],'attributes':_0x4d2e2e[_0x8026('0x12')],'include':_0x4d2e2e['include']?_[_0x8026('0x10')](_0x4d2e2e['include'],function(_0x4e8455){return{'model':db[_0x4e8455[_0x8026('0x11')]],'as':_0x4e8455['as'],'attributes':_0x4e8455[_0x8026('0x12')],'include':_0x4e8455['include']?_[_0x8026('0x10')](_0x4e8455[_0x8026('0xf')],function(_0x4d053b){return{'model':db[_0x4d053b['model']],'as':_0x4d053b['as'],'attributes':_0x4d053b['attributes']};}):[]};}):[]};}):[]:[]})[_0x8026('0x13')](function(_0x328d5b){logger[_0x8026('0x14')]('ShowSquareProject',_0x44d0af);logger[_0x8026('0x16')](_0x8026('0x1a'),_0x44d0af,JSON['stringify'](_0x328d5b));_0x4360a8(_0x328d5b);})[_0x8026('0x1c')](function(_0x4c24e1){logger[_0x8026('0x18')](_0x8026('0x1a'),_0x4c24e1[_0x8026('0x19')],_0x44d0af);_0x54ebd8(_0x225567['error'](0x1f4,_0x4c24e1['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 8528727..8a1c58c 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 _0xc457=['./squareProject.events','save','remove','update','emit','removeListener','length','squareProject:'];(function(_0x356ea8,_0x33a3ab){var _0x143963=function(_0x59d14d){while(--_0x59d14d){_0x356ea8['push'](_0x356ea8['shift']());}};_0x143963(++_0x33a3ab);}(_0xc457,0x1a0));var _0x7c45=function(_0x58dbb9,_0x3e1942){_0x58dbb9=_0x58dbb9-0x0;var _0x4769e4=_0xc457[_0x58dbb9];return _0x4769e4;};'use strict';var SquareProjectEvents=require(_0x7c45('0x0'));var events=[_0x7c45('0x1'),_0x7c45('0x2'),_0x7c45('0x3')];function createListener(_0x598e63,_0x1a8613){return function(_0x570dfc){_0x1a8613[_0x7c45('0x4')](_0x598e63,_0x570dfc);};}function removeListener(_0x34fe54,_0x323a56){return function(){SquareProjectEvents[_0x7c45('0x5')](_0x34fe54,_0x323a56);};}exports['register']=function(_0xdccaad){for(var _0x2de51c=0x0,_0x55d8b0=events[_0x7c45('0x6')];_0x2de51c<_0x55d8b0;_0x2de51c++){var _0x36f3e0=events[_0x2de51c];var _0xd6d625=createListener(_0x7c45('0x7')+_0x36f3e0,_0xdccaad);SquareProjectEvents['on'](_0x36f3e0,_0xd6d625);}}; \ No newline at end of file +var _0xf931=['register','./squareProject.events','save','remove','emit','removeListener'];(function(_0x837fc7,_0x31ab3a){var _0x59f37d=function(_0x3d30f0){while(--_0x3d30f0){_0x837fc7['push'](_0x837fc7['shift']());}};_0x59f37d(++_0x31ab3a);}(_0xf931,0x1ab));var _0x1f93=function(_0x1298f1,_0x109676){_0x1298f1=_0x1298f1-0x0;var _0x16b255=_0xf931[_0x1298f1];return _0x16b255;};'use strict';var SquareProjectEvents=require(_0x1f93('0x0'));var events=[_0x1f93('0x1'),_0x1f93('0x2'),'update'];function createListener(_0x143e0d,_0x384506){return function(_0x34dc50){_0x384506[_0x1f93('0x3')](_0x143e0d,_0x34dc50);};}function removeListener(_0x178266,_0x24718b){return function(){SquareProjectEvents[_0x1f93('0x4')](_0x178266,_0x24718b);};}exports[_0x1f93('0x5')]=function(_0x476680){for(var _0xa42f7c=0x0,_0x16dbbf=events['length'];_0xa42f7c<_0x16dbbf;_0xa42f7c++){var _0x134328=events[_0xa42f7c];var _0x335f39=createListener('squareProject:'+_0x134328,_0x476680);SquareProjectEvents['on'](_0x134328,_0x335f39);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index bfb3764..27375e6 100644 --- a/server/api/squareRecording/index.js +++ b/server/api/squareRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4975=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated','show','/:id/download','download','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x10cb25,_0x36f572){var _0x488840=function(_0x59ea53){while(--_0x59ea53){_0x10cb25['push'](_0x10cb25['shift']());}};_0x488840(++_0x36f572);}(_0x4975,0x86));var _0x5497=function(_0x48eab1,_0x202748){_0x48eab1=_0x48eab1-0x0;var _0x33249a=_0x4975[_0x48eab1];return _0x33249a;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0x11')]('/',auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0x13')](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5497('0x15')]);module[_0x5497('0x16')]=router; \ No newline at end of file +var _0x814b=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','/:id/download','download','post','create','put','delete','destroy','exports'];(function(_0x34694f,_0x5d24eb){var _0x373b14=function(_0x258289){while(--_0x258289){_0x34694f['push'](_0x34694f['shift']());}};_0x373b14(++_0x5d24eb);}(_0x814b,0x1a2));var _0xb814=function(_0x2a8c21,_0x163576){_0x2a8c21=_0x2a8c21-0x0;var _0x5f3061=_0x814b[_0x2a8c21];return _0x5f3061;};'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('0x10')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0x12')](_0xb814('0xc'),auth[_0xb814('0xb')](),controller['update']);router[_0xb814('0x13')]('/:id',auth[_0xb814('0xb')](),controller[_0xb814('0x14')]);module[_0xb814('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 00f026e..a1b319b 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 _0xee14=['VIRTUAL','getDataValue','savePath','substring','STRING'];(function(_0xbd5d9c,_0x374857){var _0x52c9dc=function(_0x3132dd){while(--_0x3132dd){_0xbd5d9c['push'](_0xbd5d9c['shift']());}};_0x52c9dc(++_0x374857);}(_0xee14,0x13a));var _0x4ee1=function(_0x167df0,_0x536e50){_0x167df0=_0x167df0-0x0;var _0x58b8a9=_0xee14[_0x167df0];return _0x58b8a9;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x4ee1('0x0')]},'callerid':{'type':Sequelize[_0x4ee1('0x0')]},'calleridname':{'type':Sequelize[_0x4ee1('0x0')]},'context':{'type':Sequelize[_0x4ee1('0x0')]},'extension':{'type':Sequelize[_0x4ee1('0x0')]},'priority':{'type':Sequelize[_0x4ee1('0x0')]},'accountcode':{'type':Sequelize[_0x4ee1('0x0')]},'dnid':{'type':Sequelize[_0x4ee1('0x0')]},'projectName':{'type':Sequelize[_0x4ee1('0x0')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x4ee1('0x0')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x4ee1('0x1')],'get':function(){var _0x3a45a3='';var _0x187656=this[_0x4ee1('0x2')](_0x4ee1('0x3'));if(_0x187656){_0x3a45a3=_0x187656[_0x4ee1('0x4')](_0x187656['lastIndexOf']('.'));}return _0x3a45a3;}}}; \ No newline at end of file +var _0x2d17=['VIRTUAL','getDataValue','savePath','lastIndexOf','sequelize','exports','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2d17,0x17e));var _0x72d1=function(_0x47939c,_0x2b323b){_0x47939c=_0x47939c-0x0;var _0x1d278f=_0x2d17[_0x47939c];return _0x1d278f;};'use strict';var Sequelize=require(_0x72d1('0x0'));module[_0x72d1('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x72d1('0x2')]},'calleridname':{'type':Sequelize[_0x72d1('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x72d1('0x2')]},'priority':{'type':Sequelize[_0x72d1('0x2')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x72d1('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0x72d1('0x2')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x72d1('0x2')]},'format':{'type':Sequelize[_0x72d1('0x3')],'get':function(){var _0x5b40a9='';var _0x477264=this[_0x72d1('0x4')](_0x72d1('0x5'));if(_0x477264){_0x5b40a9=_0x477264['substring'](_0x477264[_0x72d1('0x6')]('.'));}return _0x5b40a9;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 7d1fc1f..e218550 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 _0x3c02=['recording','Sequelize','ValidationError','extname','unlink','message','SquareRecording\x20not\x20found','destroy','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','end','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../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','save','update','then','error','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','model','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','SquareRecording','catch','show','params','find','create','body','download','../../components/encryptor','uniqueid','savePath','filename','%s.cypher','existsSync','decryptFile','secrets'];(function(_0x5710c9,_0x44780c){var _0x5dd2d5=function(_0x51213d){while(--_0x51213d){_0x5710c9['push'](_0x5710c9['shift']());}};_0x5dd2d5(++_0x44780c);}(_0x3c02,0xd8));var _0x23c0=function(_0x5d529d,_0x52dcaf){_0x5d529d=_0x5d529d-0x0;var _0x59483d=_0x3c02[_0x5d529d];return _0x59483d;};'use strict';var emlformat=require(_0x23c0('0x0'));var rimraf=require(_0x23c0('0x1'));var zipdir=require(_0x23c0('0x2'));var jsonpatch=require(_0x23c0('0x3'));var rp=require(_0x23c0('0x4'));var moment=require(_0x23c0('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x23c0('0x6'));var path=require(_0x23c0('0x7'));var sox=require(_0x23c0('0x8'));var csv=require(_0x23c0('0x9'));var ejs=require(_0x23c0('0xa'));var fs=require('fs');var fs_extra=require(_0x23c0('0xb'));var _=require(_0x23c0('0xc'));var squel=require('squel');var crypto=require(_0x23c0('0xd'));var jsforce=require(_0x23c0('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x23c0('0x9'));var querystring=require('querystring');var Papa=require(_0x23c0('0xf'));var Redis=require(_0x23c0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x23c0('0x11'));var as=require(_0x23c0('0x12'));var hardwareService=require(_0x23c0('0x13'));var logger=require('../../config/logger')(_0x23c0('0x14'));var utils=require(_0x23c0('0x15'));var config=require(_0x23c0('0x16'));var licenseUtil=require(_0x23c0('0x17'));var db=require(_0x23c0('0x18'))['db'];function respondWithStatusCode(_0x52d93f,_0x40f0b4){_0x40f0b4=_0x40f0b4||0xcc;return function(_0x510c57){if(_0x510c57){return _0x52d93f[_0x23c0('0x19')](_0x40f0b4);}return _0x52d93f[_0x23c0('0x1a')](_0x40f0b4)['end']();};}function respondWithResult(_0x387109,_0x3812c7){_0x3812c7=_0x3812c7||0xc8;return function(_0x5d01e2){if(_0x5d01e2){return _0x387109['status'](_0x3812c7)[_0x23c0('0x1b')](_0x5d01e2);}};}function respondWithFilteredResult(_0xf3c535,_0x3dcb36){return function(_0x37e397){if(_0x37e397){var _0x243178=typeof _0x3dcb36[_0x23c0('0x1c')]===_0x23c0('0x1d')&&typeof _0x3dcb36[_0x23c0('0x1e')]===_0x23c0('0x1d');var _0x50614c=_0x37e397['count'];var _0x23f93e=_0x243178?0x0:_0x3dcb36[_0x23c0('0x1c')];var _0x24dfd5=_0x243178?_0x37e397[_0x23c0('0x1f')]:_0x3dcb36[_0x23c0('0x1c')]+_0x3dcb36[_0x23c0('0x1e')];var _0x2128cf;if(_0x24dfd5>=_0x50614c){_0x24dfd5=_0x50614c;_0x2128cf=0xc8;}else{_0x2128cf=0xce;}_0xf3c535[_0x23c0('0x1a')](_0x2128cf);return _0xf3c535[_0x23c0('0x20')](_0x23c0('0x21'),_0x23f93e+'-'+_0x24dfd5+'/'+_0x50614c)['json'](_0x37e397);}return null;};}function patchUpdates(_0x54a531){return function(_0x4add06){try{jsonpatch[_0x23c0('0x22')](_0x4add06,_0x54a531,!![]);}catch(_0x405c37){return BPromise[_0x23c0('0x23')](_0x405c37);}return _0x4add06[_0x23c0('0x24')]();};}function saveUpdates(_0x39ff38,_0x5d2ce7){return function(_0xabc7a1){if(_0xabc7a1){return _0xabc7a1[_0x23c0('0x25')](_0x39ff38)['then'](function(_0x5437b6){return _0x5437b6;});}return null;};}function removeEntity(_0x4a18d2,_0xbc7e36){return function(_0x525d5c){if(_0x525d5c){return _0x525d5c['destroy']()[_0x23c0('0x26')](function(){_0x4a18d2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b276a,_0x36ef20){return function(_0x4e330a){if(!_0x4e330a){_0x3b276a[_0x23c0('0x19')](0x194);}return _0x4e330a;};}function handleError(_0x891318,_0x122174){_0x122174=_0x122174||0x1f4;return function(_0xc675eb){logger[_0x23c0('0x27')](_0xc675eb[_0x23c0('0x28')]);if(_0xc675eb['name']){delete _0xc675eb[_0x23c0('0x29')];}_0x891318[_0x23c0('0x1a')](_0x122174)[_0x23c0('0x2a')](_0xc675eb);};}exports[_0x23c0('0x2b')]=function(_0x51b130,_0x2213f5){var _0x157b44={},_0x187fa0={},_0xcffc9e={'count':0x0,'rows':[]};var _0x1cd427=_['map'](db['SquareRecording'][_0x23c0('0x2c')],function(_0x407007){return{'name':_0x407007[_0x23c0('0x2d')],'type':_0x407007[_0x23c0('0x2e')][_0x23c0('0x2f')]};});_0x187fa0['model']=_[_0x23c0('0x30')](_0x1cd427,'name');_0x187fa0[_0x23c0('0x31')]=_[_0x23c0('0x32')](_0x51b130[_0x23c0('0x31')]);_0x187fa0[_0x23c0('0x33')]=_['intersection'](_0x187fa0[_0x23c0('0x34')],_0x187fa0[_0x23c0('0x31')]);_0x157b44['attributes']=_[_0x23c0('0x35')](_0x187fa0['model'],qs[_0x23c0('0x36')](_0x51b130['query']['fields']));_0x157b44[_0x23c0('0x37')]=_0x157b44['attributes'][_0x23c0('0x38')]?_0x157b44[_0x23c0('0x37')]:_0x187fa0[_0x23c0('0x34')];if(!_0x51b130['query']['hasOwnProperty'](_0x23c0('0x39'))){_0x157b44[_0x23c0('0x1e')]=qs[_0x23c0('0x1e')](_0x51b130['query'][_0x23c0('0x1e')]);_0x157b44['offset']=qs['offset'](_0x51b130[_0x23c0('0x31')][_0x23c0('0x1c')]);}_0x157b44[_0x23c0('0x3a')]=qs[_0x23c0('0x3b')](_0x51b130[_0x23c0('0x31')][_0x23c0('0x3b')]);_0x157b44[_0x23c0('0x3c')]=qs['filters'](_[_0x23c0('0x3d')](_0x51b130['query'],_0x187fa0['filters']),_0x1cd427);if(_0x51b130[_0x23c0('0x31')][_0x23c0('0x3e')]){_0x157b44[_0x23c0('0x3c')]=_['merge'](_0x157b44[_0x23c0('0x3c')],{'$or':_['map'](_0x1cd427,function(_0x1dc399){if(_0x1dc399[_0x23c0('0x2e')]!==_0x23c0('0x3f')){var _0x2188d2={};_0x2188d2[_0x1dc399[_0x23c0('0x29')]]={'$like':'%'+_0x51b130['query'][_0x23c0('0x3e')]+'%'};return _0x2188d2;}})});}_0x157b44=_[_0x23c0('0x40')]({},_0x157b44,_0x51b130[_0x23c0('0x41')]);var _0x3f407f={'where':_0x157b44['where']};return db['SquareRecording'][_0x23c0('0x1f')](_0x3f407f)['then'](function(_0x5401d9){_0xcffc9e[_0x23c0('0x1f')]=_0x5401d9;if(_0x51b130[_0x23c0('0x31')][_0x23c0('0x42')]){_0x157b44[_0x23c0('0x43')]=[{'all':!![]}];}return db[_0x23c0('0x44')]['findAll'](_0x157b44);})[_0x23c0('0x26')](function(_0x25bfb3){_0xcffc9e['rows']=_0x25bfb3;return _0xcffc9e;})[_0x23c0('0x26')](respondWithFilteredResult(_0x2213f5,_0x157b44))[_0x23c0('0x45')](handleError(_0x2213f5,null));};exports[_0x23c0('0x46')]=function(_0x4ebe33,_0x12a086){var _0x5bb60f={'raw':!![],'where':{'id':_0x4ebe33[_0x23c0('0x47')]['id']}},_0x4fa6e2={};_0x4fa6e2[_0x23c0('0x34')]=_[_0x23c0('0x32')](db[_0x23c0('0x44')][_0x23c0('0x2c')]);_0x4fa6e2['query']=_['keys'](_0x4ebe33[_0x23c0('0x31')]);_0x4fa6e2['filters']=_[_0x23c0('0x35')](_0x4fa6e2[_0x23c0('0x34')],_0x4fa6e2[_0x23c0('0x31')]);_0x5bb60f[_0x23c0('0x37')]=_[_0x23c0('0x35')](_0x4fa6e2['model'],qs[_0x23c0('0x36')](_0x4ebe33[_0x23c0('0x31')]['fields']));_0x5bb60f[_0x23c0('0x37')]=_0x5bb60f[_0x23c0('0x37')][_0x23c0('0x38')]?_0x5bb60f[_0x23c0('0x37')]:_0x4fa6e2[_0x23c0('0x34')];if(_0x4ebe33[_0x23c0('0x31')][_0x23c0('0x42')]){_0x5bb60f['include']=[{'all':!![]}];}_0x5bb60f=_[_0x23c0('0x40')]({},_0x5bb60f,_0x4ebe33['options']);return db['SquareRecording'][_0x23c0('0x48')](_0x5bb60f)[_0x23c0('0x26')](handleEntityNotFound(_0x12a086,null))[_0x23c0('0x26')](respondWithResult(_0x12a086,null))[_0x23c0('0x45')](handleError(_0x12a086,null));};exports['create']=function(_0x2591bb,_0x2207f3){return db[_0x23c0('0x44')][_0x23c0('0x49')](_0x2591bb[_0x23c0('0x4a')],{})[_0x23c0('0x26')](respondWithResult(_0x2207f3,0xc9))[_0x23c0('0x45')](handleError(_0x2207f3,null));};exports['update']=function(_0x42a608,_0x577ef8){if(_0x42a608[_0x23c0('0x4a')]['id']){delete _0x42a608[_0x23c0('0x4a')]['id'];}return db[_0x23c0('0x44')][_0x23c0('0x48')]({'where':{'id':_0x42a608[_0x23c0('0x47')]['id']}})[_0x23c0('0x26')](handleEntityNotFound(_0x577ef8,null))[_0x23c0('0x26')](saveUpdates(_0x42a608[_0x23c0('0x4a')],null))[_0x23c0('0x26')](respondWithResult(_0x577ef8,null))['catch'](handleError(_0x577ef8,null));};exports[_0x23c0('0x4b')]=function(_0x1bdd45,_0x525dba,_0x160355){var _0x554ee6=require(_0x23c0('0x4c'));var _0x238002=![];var _0x3a5de8={};if(_0x1bdd45[_0x23c0('0x31')][_0x23c0('0x2e')]&&_0x1bdd45[_0x23c0('0x31')][_0x23c0('0x2e')]===_0x23c0('0x4d')){_0x3a5de8[_0x23c0('0x4d')]=_0x1bdd45[_0x23c0('0x47')]['id'];}else{_0x3a5de8['id']=_0x1bdd45[_0x23c0('0x47')]['id'];}return db[_0x23c0('0x44')]['find']({'where':_0x3a5de8,'attributes':['id',_0x23c0('0x4e'),_0x23c0('0x4f')],'raw':!![]})['then'](handleEntityNotFound(_0x525dba,null))['then'](function(_0x12a9fa){if(_0x12a9fa){var _0x1a83d7=_0x12a9fa[_0x23c0('0x4e')];var _0x43b758=util['format'](_0x23c0('0x50'),_0x1a83d7);if(fs[_0x23c0('0x51')](_0x43b758)){_0x238002=!![];return _0x554ee6[_0x23c0('0x52')](_0x43b758,_0x1a83d7,config[_0x23c0('0x53')][_0x23c0('0x54')])['then'](function(){return _0x12a9fa;});}return _0x12a9fa;}})[_0x23c0('0x26')](function(_0x1c7592){if(_0x1c7592){var _0x260303=_0x1c7592[_0x23c0('0x4e')];if(!fs[_0x23c0('0x51')](_0x260303)){throw new db[(_0x23c0('0x55'))][(_0x23c0('0x56'))]('SquareRecording\x20not\x20found');}if(_0x1c7592['filename']){return _0x525dba[_0x23c0('0x4b')](_0x260303,_0x1c7592['filename']+path[_0x23c0('0x57')](_0x260303),function(){if(_0x238002){fs[_0x23c0('0x58')](_0x260303);}});}else{return _0x525dba[_0x23c0('0x4b')](_0x260303,function(_0x36844f){if(_0x238002){fs[_0x23c0('0x58')](_0x260303);}});}}})['catch'](function(_0xd43076){if(_0xd43076[_0x23c0('0x59')]===_0x23c0('0x5a')){_0x525dba['status'](0x194)[_0x23c0('0x2a')]('Not\x20found');}else{return handleError(_0x525dba,null);}});};exports[_0x23c0('0x5b')]=function(_0x57cbfa,_0xf8dbb4){return db[_0x23c0('0x44')][_0x23c0('0x48')]({'where':{'id':_0x57cbfa[_0x23c0('0x47')]['id']}})['then'](function(_0x3557a4){if(_['isNil'](_0x3557a4)){throw new ReferenceError('Entity\x20not\x20found');}return _0x3557a4;})[_0x23c0('0x26')](function(_0x5d91b9){var _0x2e8b89=_0x5d91b9['savePath'];logger[_0x23c0('0x5c')](_0x23c0('0x5d'),_0x2e8b89);if(!_[_0x23c0('0x5e')](_0x5d91b9[_0x23c0('0x4e')])&&fs[_0x23c0('0x51')](_0x2e8b89)){logger[_0x23c0('0x5c')](_0x23c0('0x5f')+_0x2e8b89+_0x23c0('0x60'));fs[_0x23c0('0x61')](_0x2e8b89);}_0x2e8b89=_0x2e8b89+_0x23c0('0x62');if(!_[_0x23c0('0x5e')](_0x5d91b9['savePath'])&&fs['existsSync'](_0x2e8b89)){logger[_0x23c0('0x5c')]('File:\x20\x22'+_0x2e8b89+_0x23c0('0x60'));fs['unlinkSync'](_0x2e8b89);}return _0x5d91b9;})[_0x23c0('0x26')](function(_0x2dca79){if(!_0x2dca79)throw new InternalError();return _0x2dca79['destroy']();})[_0x23c0('0x26')](function(){_0xf8dbb4[_0x23c0('0x1a')](0xcc)[_0x23c0('0x63')]();})['catch'](handleError(_0xf8dbb4,null));}; \ No newline at end of file +var _0x9d10=['catch','show','params','find','create','body','download','uniqueid','savePath','format','%s.cypher','decryptFile','secrets','Sequelize','ValidationError','filename','extname','unlink','SquareRecording\x20not\x20found','send','Not\x20found','destroy','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','existsSync','info','unlinkSync','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','zip-dir','request-promise','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','limit','count','Content-Range','apply','reject','save','update','then','end','stack','name','map','SquareRecording','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows'];(function(_0x5c5620,_0x5c9ac4){var _0x5f47a6=function(_0x56e71a){while(--_0x56e71a){_0x5c5620['push'](_0x5c5620['shift']());}};_0x5f47a6(++_0x5c9ac4);}(_0x9d10,0x1db));var _0x09d1=function(_0x548597,_0x27f5e3){_0x548597=_0x548597-0x0;var _0x5d9649=_0x9d10[_0x548597];return _0x5d9649;};'use strict';var emlformat=require(_0x09d1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x09d1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x09d1('0x2'));var moment=require('moment');var BPromise=require(_0x09d1('0x3'));var Mustache=require('mustache');var util=require(_0x09d1('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x09d1('0x5'));var ejs=require(_0x09d1('0x6'));var fs=require('fs');var fs_extra=require(_0x09d1('0x7'));var _=require(_0x09d1('0x8'));var squel=require(_0x09d1('0x9'));var crypto=require(_0x09d1('0xa'));var jsforce=require(_0x09d1('0xb'));var deskjs=require(_0x09d1('0xc'));var toCsv=require(_0x09d1('0x5'));var querystring=require('querystring');var Papa=require(_0x09d1('0xd'));var Redis=require(_0x09d1('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x09d1('0xf'));var logger=require(_0x09d1('0x10'))(_0x09d1('0x11'));var utils=require(_0x09d1('0x12'));var config=require(_0x09d1('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x09d1('0x14'))['db'];function respondWithStatusCode(_0x561fdb,_0x161e51){_0x161e51=_0x161e51||0xcc;return function(_0x7402d6){if(_0x7402d6){return _0x561fdb['sendStatus'](_0x161e51);}return _0x561fdb[_0x09d1('0x15')](_0x161e51)['end']();};}function respondWithResult(_0x45984e,_0x152122){_0x152122=_0x152122||0xc8;return function(_0x4260c0){if(_0x4260c0){return _0x45984e[_0x09d1('0x15')](_0x152122)[_0x09d1('0x16')](_0x4260c0);}};}function respondWithFilteredResult(_0x262b96,_0x360a08){return function(_0x186362){if(_0x186362){var _0x498834=typeof _0x360a08[_0x09d1('0x17')]==='undefined'&&typeof _0x360a08[_0x09d1('0x18')]==='undefined';var _0x3c3a82=_0x186362[_0x09d1('0x19')];var _0x195c18=_0x498834?0x0:_0x360a08[_0x09d1('0x17')];var _0x15ba6b=_0x498834?_0x186362[_0x09d1('0x19')]:_0x360a08['offset']+_0x360a08[_0x09d1('0x18')];var _0x5d4cb0;if(_0x15ba6b>=_0x3c3a82){_0x15ba6b=_0x3c3a82;_0x5d4cb0=0xc8;}else{_0x5d4cb0=0xce;}_0x262b96[_0x09d1('0x15')](_0x5d4cb0);return _0x262b96['set'](_0x09d1('0x1a'),_0x195c18+'-'+_0x15ba6b+'/'+_0x3c3a82)['json'](_0x186362);}return null;};}function patchUpdates(_0xc10f3){return function(_0x158318){try{jsonpatch[_0x09d1('0x1b')](_0x158318,_0xc10f3,!![]);}catch(_0x57e19e){return BPromise[_0x09d1('0x1c')](_0x57e19e);}return _0x158318[_0x09d1('0x1d')]();};}function saveUpdates(_0x5d74da,_0x4436d9){return function(_0x5b4076){if(_0x5b4076){return _0x5b4076[_0x09d1('0x1e')](_0x5d74da)[_0x09d1('0x1f')](function(_0x635e86){return _0x635e86;});}return null;};}function removeEntity(_0xefc88c,_0x13a07d){return function(_0x516340){if(_0x516340){return _0x516340['destroy']()[_0x09d1('0x1f')](function(){_0xefc88c[_0x09d1('0x15')](0xcc)[_0x09d1('0x20')]();});}};}function handleEntityNotFound(_0x4f83ef,_0x488ef2){return function(_0x35c0bb){if(!_0x35c0bb){_0x4f83ef['sendStatus'](0x194);}return _0x35c0bb;};}function handleError(_0x4fd2f8,_0x38f191){_0x38f191=_0x38f191||0x1f4;return function(_0x504b2c){logger['error'](_0x504b2c[_0x09d1('0x21')]);if(_0x504b2c[_0x09d1('0x22')]){delete _0x504b2c[_0x09d1('0x22')];}_0x4fd2f8[_0x09d1('0x15')](_0x38f191)['send'](_0x504b2c);};}exports['index']=function(_0x112e37,_0x4155a5){var _0x3f12f7={},_0x107e30={},_0x264a53={'count':0x0,'rows':[]};var _0x3c1ad4=_[_0x09d1('0x23')](db[_0x09d1('0x24')][_0x09d1('0x25')],function(_0x1e1ff0){return{'name':_0x1e1ff0[_0x09d1('0x26')],'type':_0x1e1ff0[_0x09d1('0x27')]['key']};});_0x107e30[_0x09d1('0x28')]=_[_0x09d1('0x23')](_0x3c1ad4,_0x09d1('0x22'));_0x107e30[_0x09d1('0x29')]=_[_0x09d1('0x2a')](_0x112e37[_0x09d1('0x29')]);_0x107e30[_0x09d1('0x2b')]=_[_0x09d1('0x2c')](_0x107e30[_0x09d1('0x28')],_0x107e30[_0x09d1('0x29')]);_0x3f12f7[_0x09d1('0x2d')]=_[_0x09d1('0x2c')](_0x107e30[_0x09d1('0x28')],qs[_0x09d1('0x2e')](_0x112e37[_0x09d1('0x29')][_0x09d1('0x2e')]));_0x3f12f7['attributes']=_0x3f12f7[_0x09d1('0x2d')][_0x09d1('0x2f')]?_0x3f12f7['attributes']:_0x107e30[_0x09d1('0x28')];if(!_0x112e37[_0x09d1('0x29')][_0x09d1('0x30')](_0x09d1('0x31'))){_0x3f12f7[_0x09d1('0x18')]=qs['limit'](_0x112e37['query'][_0x09d1('0x18')]);_0x3f12f7[_0x09d1('0x17')]=qs[_0x09d1('0x17')](_0x112e37[_0x09d1('0x29')][_0x09d1('0x17')]);}_0x3f12f7['order']=qs[_0x09d1('0x32')](_0x112e37[_0x09d1('0x29')][_0x09d1('0x32')]);_0x3f12f7[_0x09d1('0x33')]=qs[_0x09d1('0x2b')](_['pick'](_0x112e37[_0x09d1('0x29')],_0x107e30[_0x09d1('0x2b')]),_0x3c1ad4);if(_0x112e37[_0x09d1('0x29')][_0x09d1('0x34')]){_0x3f12f7[_0x09d1('0x33')]=_[_0x09d1('0x35')](_0x3f12f7[_0x09d1('0x33')],{'$or':_[_0x09d1('0x23')](_0x3c1ad4,function(_0x3188b1){if(_0x3188b1[_0x09d1('0x27')]!==_0x09d1('0x36')){var _0x47c0e7={};_0x47c0e7[_0x3188b1[_0x09d1('0x22')]]={'$like':'%'+_0x112e37[_0x09d1('0x29')][_0x09d1('0x34')]+'%'};return _0x47c0e7;}})});}_0x3f12f7=_[_0x09d1('0x35')]({},_0x3f12f7,_0x112e37[_0x09d1('0x37')]);var _0x1c9741={'where':_0x3f12f7[_0x09d1('0x33')]};return db[_0x09d1('0x24')][_0x09d1('0x19')](_0x1c9741)[_0x09d1('0x1f')](function(_0x6f1d87){_0x264a53[_0x09d1('0x19')]=_0x6f1d87;if(_0x112e37[_0x09d1('0x29')]['includeAll']){_0x3f12f7[_0x09d1('0x38')]=[{'all':!![]}];}return db[_0x09d1('0x24')][_0x09d1('0x39')](_0x3f12f7);})['then'](function(_0x13cddc){_0x264a53[_0x09d1('0x3a')]=_0x13cddc;return _0x264a53;})['then'](respondWithFilteredResult(_0x4155a5,_0x3f12f7))[_0x09d1('0x3b')](handleError(_0x4155a5,null));};exports[_0x09d1('0x3c')]=function(_0x5a2a8a,_0x53b9ff){var _0x360258={'raw':!![],'where':{'id':_0x5a2a8a[_0x09d1('0x3d')]['id']}},_0x376d9e={};_0x376d9e[_0x09d1('0x28')]=_[_0x09d1('0x2a')](db[_0x09d1('0x24')]['rawAttributes']);_0x376d9e[_0x09d1('0x29')]=_['keys'](_0x5a2a8a[_0x09d1('0x29')]);_0x376d9e[_0x09d1('0x2b')]=_['intersection'](_0x376d9e['model'],_0x376d9e[_0x09d1('0x29')]);_0x360258['attributes']=_[_0x09d1('0x2c')](_0x376d9e['model'],qs[_0x09d1('0x2e')](_0x5a2a8a[_0x09d1('0x29')][_0x09d1('0x2e')]));_0x360258[_0x09d1('0x2d')]=_0x360258[_0x09d1('0x2d')][_0x09d1('0x2f')]?_0x360258[_0x09d1('0x2d')]:_0x376d9e['model'];if(_0x5a2a8a[_0x09d1('0x29')]['includeAll']){_0x360258[_0x09d1('0x38')]=[{'all':!![]}];}_0x360258=_[_0x09d1('0x35')]({},_0x360258,_0x5a2a8a[_0x09d1('0x37')]);return db[_0x09d1('0x24')][_0x09d1('0x3e')](_0x360258)[_0x09d1('0x1f')](handleEntityNotFound(_0x53b9ff,null))[_0x09d1('0x1f')](respondWithResult(_0x53b9ff,null))['catch'](handleError(_0x53b9ff,null));};exports[_0x09d1('0x3f')]=function(_0x4860a6,_0x247913){return db[_0x09d1('0x24')][_0x09d1('0x3f')](_0x4860a6[_0x09d1('0x40')],{})[_0x09d1('0x1f')](respondWithResult(_0x247913,0xc9))[_0x09d1('0x3b')](handleError(_0x247913,null));};exports[_0x09d1('0x1e')]=function(_0x1b650f,_0x4e2db3){if(_0x1b650f[_0x09d1('0x40')]['id']){delete _0x1b650f['body']['id'];}return db[_0x09d1('0x24')][_0x09d1('0x3e')]({'where':{'id':_0x1b650f[_0x09d1('0x3d')]['id']}})[_0x09d1('0x1f')](handleEntityNotFound(_0x4e2db3,null))[_0x09d1('0x1f')](saveUpdates(_0x1b650f[_0x09d1('0x40')],null))[_0x09d1('0x1f')](respondWithResult(_0x4e2db3,null))[_0x09d1('0x3b')](handleError(_0x4e2db3,null));};exports[_0x09d1('0x41')]=function(_0xaa7cb3,_0x7398a7,_0x5c8d4e){var _0xfd3c7b=require('../../components/encryptor');var _0x530200=![];var _0x1edf25={};if(_0xaa7cb3[_0x09d1('0x29')][_0x09d1('0x27')]&&_0xaa7cb3['query'][_0x09d1('0x27')]===_0x09d1('0x42')){_0x1edf25['uniqueid']=_0xaa7cb3[_0x09d1('0x3d')]['id'];}else{_0x1edf25['id']=_0xaa7cb3[_0x09d1('0x3d')]['id'];}return db[_0x09d1('0x24')][_0x09d1('0x3e')]({'where':_0x1edf25,'attributes':['id',_0x09d1('0x43'),'filename'],'raw':!![]})[_0x09d1('0x1f')](handleEntityNotFound(_0x7398a7,null))[_0x09d1('0x1f')](function(_0x3ba80e){if(_0x3ba80e){var _0x34ac68=_0x3ba80e[_0x09d1('0x43')];var _0x15555b=util[_0x09d1('0x44')](_0x09d1('0x45'),_0x34ac68);if(fs['existsSync'](_0x15555b)){_0x530200=!![];return _0xfd3c7b[_0x09d1('0x46')](_0x15555b,_0x34ac68,config[_0x09d1('0x47')]['recording'])[_0x09d1('0x1f')](function(){return _0x3ba80e;});}return _0x3ba80e;}})[_0x09d1('0x1f')](function(_0x1e3ad8){if(_0x1e3ad8){var _0x147e1f=_0x1e3ad8[_0x09d1('0x43')];if(!fs['existsSync'](_0x147e1f)){throw new db[(_0x09d1('0x48'))][(_0x09d1('0x49'))]('SquareRecording\x20not\x20found');}if(_0x1e3ad8[_0x09d1('0x4a')]){return _0x7398a7[_0x09d1('0x41')](_0x147e1f,_0x1e3ad8[_0x09d1('0x4a')]+path[_0x09d1('0x4b')](_0x147e1f),function(){if(_0x530200){fs[_0x09d1('0x4c')](_0x147e1f);}});}else{return _0x7398a7[_0x09d1('0x41')](_0x147e1f,function(_0x3f4f8a){if(_0x530200){fs['unlink'](_0x147e1f);}});}}})['catch'](function(_0x3e9949){if(_0x3e9949['message']===_0x09d1('0x4d')){_0x7398a7[_0x09d1('0x15')](0x194)[_0x09d1('0x4e')](_0x09d1('0x4f'));}else{return handleError(_0x7398a7,null);}});};exports[_0x09d1('0x50')]=function(_0x47dd07,_0x2d3b9d){return db['SquareRecording']['find']({'where':{'id':_0x47dd07[_0x09d1('0x3d')]['id']}})['then'](function(_0x48dc0e){if(_[_0x09d1('0x51')](_0x48dc0e)){throw new ReferenceError(_0x09d1('0x52'));}return _0x48dc0e;})[_0x09d1('0x1f')](function(_0x4ad9a5){var _0x2b91fa=_0x4ad9a5[_0x09d1('0x43')];logger['info'](_0x09d1('0x53'),_0x2b91fa);if(!_[_0x09d1('0x51')](_0x4ad9a5[_0x09d1('0x43')])&&fs[_0x09d1('0x54')](_0x2b91fa)){logger[_0x09d1('0x55')]('File:\x20\x22'+_0x2b91fa+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x09d1('0x56')](_0x2b91fa);}_0x2b91fa=_0x2b91fa+'.cypher';if(!_['isNil'](_0x4ad9a5[_0x09d1('0x43')])&&fs[_0x09d1('0x54')](_0x2b91fa)){logger[_0x09d1('0x55')](_0x09d1('0x57')+_0x2b91fa+_0x09d1('0x58'));fs[_0x09d1('0x56')](_0x2b91fa);}return _0x4ad9a5;})[_0x09d1('0x1f')](function(_0x1fb285){if(!_0x1fb285)throw new InternalError();return _0x1fb285[_0x09d1('0x50')]();})['then'](function(){_0x2d3b9d[_0x09d1('0x15')](0xcc)[_0x09d1('0x20')]();})[_0x09d1('0x3b')](handleError(_0x2d3b9d,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 7cdec2f..36f561b 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 _0xd9fb=['api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','square_recordings','lodash','util','../../config/logger'];(function(_0x5829a6,_0xdde0b2){var _0x1bbec7=function(_0xcf5330){while(--_0xcf5330){_0x5829a6['push'](_0x5829a6['shift']());}};_0x1bbec7(++_0xdde0b2);}(_0xd9fb,0x189));var _0xbd9f=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xd9fb[_0x387777];return _0x3f84c0;};'use strict';var _=require(_0xbd9f('0x0'));var util=require(_0xbd9f('0x1'));var logger=require(_0xbd9f('0x2'))(_0xbd9f('0x3'));var moment=require(_0xbd9f('0x4'));var BPromise=require(_0xbd9f('0x5'));var rp=require(_0xbd9f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbd9f('0x7'));var config=require(_0xbd9f('0x8'));var attributes=require('./squareRecording.attributes');module[_0xbd9f('0x9')]=function(_0x5b6052,_0x2e7eea){return _0x5b6052[_0xbd9f('0xa')]('SquareRecording',attributes,{'tableName':_0xbd9f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x62f1=['square_recordings','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','exports','define'];(function(_0x20156c,_0x12e1ff){var _0x4cb19a=function(_0x1e6a2c){while(--_0x1e6a2c){_0x20156c['push'](_0x20156c['shift']());}};_0x4cb19a(++_0x12e1ff);}(_0x62f1,0x112));var _0x162f=function(_0x58b7c9,_0x2b900c){_0x58b7c9=_0x58b7c9-0x0;var _0x514247=_0x62f1[_0x58b7c9];return _0x514247;};'use strict';var _=require(_0x162f('0x0'));var util=require('util');var logger=require(_0x162f('0x1'))(_0x162f('0x2'));var moment=require(_0x162f('0x3'));var BPromise=require(_0x162f('0x4'));var rp=require(_0x162f('0x5'));var fs=require('fs');var path=require(_0x162f('0x6'));var rimraf=require(_0x162f('0x7'));var config=require(_0x162f('0x8'));var attributes=require(_0x162f('0x9'));module[_0x162f('0xa')]=function(_0x4c8c54,_0x3caa89){return _0x4c8c54[_0x162f('0xb')]('SquareRecording',attributes,{'tableName':_0x162f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 9876511..02ac1bb 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 _0x3469=['message','info','result','catch','CreateSquareRecording','SquareRecording','body','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareRecording,\x20%s,\x20%s'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x3469,0x1ad));var _0x9346=function(_0x3439df,_0x2c00bd){_0x3439df=_0x3439df-0x0;var _0x5af0be=_0x3469[_0x3439df];return _0x5af0be;};'use strict';var _=require(_0x9346('0x0'));var util=require('util');var moment=require(_0x9346('0x1'));var BPromise=require(_0x9346('0x2'));var rs=require(_0x9346('0x3'));var fs=require('fs');var Redis=require(_0x9346('0x4'));var db=require(_0x9346('0x5'))['db'];var utils=require(_0x9346('0x6'));var logger=require('../../config/logger')(_0x9346('0x7'));var config=require(_0x9346('0x8'));var jayson=require(_0x9346('0x9'));var client=jayson[_0x9346('0xa')][_0x9346('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a63c1,_0x2a6320,_0x1f8051){return new BPromise(function(_0xba0bb7,_0x5c24cb){return client[_0x9346('0xc')](_0x2a63c1,_0x1f8051)[_0x9346('0xd')](function(_0x31e9d5){logger['info']('SquareRecording,\x20%s,\x20%s',_0x2a6320,_0x9346('0xe'));logger[_0x9346('0xf')](_0x9346('0x10'),_0x2a6320,_0x9346('0xe'),JSON[_0x9346('0x11')](_0x31e9d5));if(_0x31e9d5[_0x9346('0x12')]){if(_0x31e9d5[_0x9346('0x12')][_0x9346('0x13')]===0x1f4){logger[_0x9346('0x12')](_0x9346('0x14'),_0x2a6320,_0x31e9d5[_0x9346('0x12')]['message']);return _0x5c24cb(_0x31e9d5[_0x9346('0x12')][_0x9346('0x15')]);}logger['error'](_0x9346('0x14'),_0x2a6320,_0x31e9d5[_0x9346('0x12')][_0x9346('0x15')]);return _0xba0bb7(_0x31e9d5[_0x9346('0x12')][_0x9346('0x15')]);}else{logger[_0x9346('0x16')](_0x9346('0x14'),_0x2a6320,_0x9346('0xe'));_0xba0bb7(_0x31e9d5[_0x9346('0x17')]['message']);}})[_0x9346('0x18')](function(_0x47f5b6){logger[_0x9346('0x12')](_0x9346('0x14'),_0x2a6320,_0x47f5b6);_0x5c24cb(_0x47f5b6);});});}exports[_0x9346('0x19')]=function(_0x3b4648){var _0x1f5df8=this;return new Promise(function(_0x14fddd,_0x31fbb7){return db[_0x9346('0x1a')]['create'](_0x3b4648[_0x9346('0x1b')],{'raw':_0x3b4648['options']?_0x3b4648[_0x9346('0x1c')][_0x9346('0x1d')]===undefined?!![]:![]:!![]})[_0x9346('0xd')](function(_0x3561bc){logger[_0x9346('0x16')](_0x9346('0x19'),_0x3b4648);logger['debug'](_0x9346('0x19'),_0x3b4648,JSON[_0x9346('0x11')](_0x3561bc));_0x14fddd(_0x3561bc);})['catch'](function(_0x442ddb){logger[_0x9346('0x12')](_0x9346('0x19'),_0x442ddb['message'],_0x3b4648);_0x31fbb7(_0x1f5df8[_0x9346('0x12')](0x1f4,_0x442ddb[_0x9346('0x15')]));});});}; \ No newline at end of file +var _0xe0a9=['SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','util','randomstring','../../mysqldb','../../config/utils','rpc','client','http','request','then','info'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xe0a9,0x12e));var _0x9e0a=function(_0x3d3cf2,_0x7d8eec){_0x3d3cf2=_0x3d3cf2-0x0;var _0xe2a366=_0xe0a9[_0x3d3cf2];return _0xe2a366;};'use strict';var _=require('lodash');var util=require(_0x9e0a('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9e0a('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9e0a('0x2'))['db'];var utils=require(_0x9e0a('0x3'));var logger=require('../../config/logger')(_0x9e0a('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9e0a('0x5')][_0x9e0a('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x31d71a,_0x20c02e,_0x2a6a07){return new BPromise(function(_0x3c21a1,_0x22ca6a){return client[_0x9e0a('0x7')](_0x31d71a,_0x2a6a07)[_0x9e0a('0x8')](function(_0x1727de){logger[_0x9e0a('0x9')](_0x9e0a('0xa'),_0x20c02e,_0x9e0a('0xb'));logger[_0x9e0a('0xc')](_0x9e0a('0xd'),_0x20c02e,_0x9e0a('0xb'),JSON[_0x9e0a('0xe')](_0x1727de));if(_0x1727de[_0x9e0a('0xf')]){if(_0x1727de[_0x9e0a('0xf')][_0x9e0a('0x10')]===0x1f4){logger[_0x9e0a('0xf')]('SquareRecording,\x20%s,\x20%s',_0x20c02e,_0x1727de['error'][_0x9e0a('0x11')]);return _0x22ca6a(_0x1727de[_0x9e0a('0xf')]['message']);}logger[_0x9e0a('0xf')](_0x9e0a('0xa'),_0x20c02e,_0x1727de['error'][_0x9e0a('0x11')]);return _0x3c21a1(_0x1727de['error'][_0x9e0a('0x11')]);}else{logger[_0x9e0a('0x9')](_0x9e0a('0xa'),_0x20c02e,_0x9e0a('0xb'));_0x3c21a1(_0x1727de[_0x9e0a('0x12')]['message']);}})[_0x9e0a('0x13')](function(_0x5e3aad){logger[_0x9e0a('0xf')](_0x9e0a('0xa'),_0x20c02e,_0x5e3aad);_0x22ca6a(_0x5e3aad);});});}exports[_0x9e0a('0x14')]=function(_0x2bd7ea){var _0x13b28e=this;return new Promise(function(_0x52b6c5,_0x1eedea){return db[_0x9e0a('0x15')][_0x9e0a('0x16')](_0x2bd7ea[_0x9e0a('0x17')],{'raw':_0x2bd7ea[_0x9e0a('0x18')]?_0x2bd7ea['options'][_0x9e0a('0x19')]===undefined?!![]:![]:!![]})[_0x9e0a('0x8')](function(_0x148782){logger[_0x9e0a('0x9')]('CreateSquareRecording',_0x2bd7ea);logger[_0x9e0a('0xc')](_0x9e0a('0x14'),_0x2bd7ea,JSON[_0x9e0a('0xe')](_0x148782));_0x52b6c5(_0x148782);})[_0x9e0a('0x13')](function(_0xafcf4c){logger[_0x9e0a('0xf')](_0x9e0a('0x14'),_0xafcf4c[_0x9e0a('0x11')],_0x2bd7ea);_0x1eedea(_0x13b28e[_0x9e0a('0xf')](0x1f4,_0xafcf4c['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 3894605..393045d 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 _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(_0x3e3012,_0x46fe06){var _0x5dfc61=function(_0x4737b8){while(--_0x4737b8){_0x3e3012['push'](_0x3e3012['shift']());}};_0x5dfc61(++_0x46fe06);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _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(_0x20834a,_0x471f90){var _0x33da2d=function(_0x22a346){while(--_0x22a346){_0x20834a['push'](_0x20834a['shift']());}};_0x33da2d(++_0x471f90);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 303de1e..e2241af 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 _0x33dd=['BOOLEAN','sequelize','STRING','DATE'];(function(_0x5a99db,_0x1cece5){var _0x3aad62=function(_0x334cb7){while(--_0x334cb7){_0x5a99db['push'](_0x5a99db['shift']());}};_0x3aad62(++_0x1cece5);}(_0x33dd,0x19d));var _0xd33d=function(_0x443e33,_0x353086){_0x443e33=_0x443e33-0x0;var _0x3de083=_0x33dd[_0x443e33];return _0x3de083;};'use strict';var Sequelize=require(_0xd33d('0x0'));module['exports']={'network':{'type':Sequelize[_0xd33d('0x1')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0xd33d('0x1')]},'channel':{'type':Sequelize[_0xd33d('0x1')]},'language':{'type':Sequelize[_0xd33d('0x1')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xd33d('0x1')]},'version':{'type':Sequelize[_0xd33d('0x1')]},'callerid':{'type':Sequelize[_0xd33d('0x1')]},'calleridname':{'type':Sequelize[_0xd33d('0x1')]},'callingpres':{'type':Sequelize[_0xd33d('0x1')]},'callingani2':{'type':Sequelize[_0xd33d('0x1')]},'callington':{'type':Sequelize[_0xd33d('0x1')]},'callingtns':{'type':Sequelize[_0xd33d('0x1')]},'dnid':{'type':Sequelize[_0xd33d('0x1')]},'rdnis':{'type':Sequelize[_0xd33d('0x1')]},'context':{'type':Sequelize[_0xd33d('0x1')]},'extension':{'type':Sequelize[_0xd33d('0x1')]},'priority':{'type':Sequelize[_0xd33d('0x1')]},'enhanced':{'type':Sequelize[_0xd33d('0x1')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0xd33d('0x1')]},'project_name':{'type':Sequelize[_0xd33d('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xd33d('0x2')]},'bot':{'type':Sequelize[_0xd33d('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x3859=['BOOLEAN','sequelize','STRING','DATE'];(function(_0x1a79c6,_0x4a5adc){var _0x1247ee=function(_0x2f2c7b){while(--_0x2f2c7b){_0x1a79c6['push'](_0x1a79c6['shift']());}};_0x1247ee(++_0x4a5adc);}(_0x3859,0xf9));var _0x9385=function(_0x42a0b3,_0x44e5ec){_0x42a0b3=_0x42a0b3-0x0;var _0x4921c6=_0x3859[_0x42a0b3];return _0x4921c6;};'use strict';var Sequelize=require(_0x9385('0x0'));module['exports']={'network':{'type':Sequelize[_0x9385('0x1')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x9385('0x1')]},'channel':{'type':Sequelize[_0x9385('0x1')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x9385('0x1')]},'version':{'type':Sequelize[_0x9385('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x9385('0x1')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x9385('0x1')]},'callington':{'type':Sequelize[_0x9385('0x1')]},'callingtns':{'type':Sequelize[_0x9385('0x1')]},'dnid':{'type':Sequelize[_0x9385('0x1')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x9385('0x1')]},'extension':{'type':Sequelize[_0x9385('0x1')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x9385('0x1')]},'threadid':{'type':Sequelize[_0x9385('0x1')]},'project_name':{'type':Sequelize[_0x9385('0x1')]},'joinAt':{'type':Sequelize[_0x9385('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x9385('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 1695ce1..9fec8db 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 _0x7a5d=['ejs','fs-extra','lodash','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name','index','SquareReport','rawAttributes','fieldName','type','key','map','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','include','rows','catch','params','keys','includeAll','find','create','body','describe','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x7a5d,0x1b3));var _0xd7a5=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x7a5d[_0x28947d];return _0x12d2ee;};'use strict';var emlformat=require(_0xd7a5('0x0'));var rimraf=require(_0xd7a5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd7a5('0x2'));var moment=require(_0xd7a5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd7a5('0x4'));var util=require(_0xd7a5('0x5'));var path=require(_0xd7a5('0x6'));var sox=require(_0xd7a5('0x7'));var csv=require(_0xd7a5('0x8'));var ejs=require(_0xd7a5('0x9'));var fs=require('fs');var fs_extra=require(_0xd7a5('0xa'));var _=require(_0xd7a5('0xb'));var squel=require('squel');var crypto=require(_0xd7a5('0xc'));var jsforce=require(_0xd7a5('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd7a5('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd7a5('0xe'));var qs=require(_0xd7a5('0xf'));var as=require(_0xd7a5('0x10'));var hardwareService=require(_0xd7a5('0x11'));var logger=require(_0xd7a5('0x12'))(_0xd7a5('0x13'));var utils=require(_0xd7a5('0x14'));var config=require(_0xd7a5('0x15'));var licenseUtil=require(_0xd7a5('0x16'));var db=require(_0xd7a5('0x17'))['db'];function respondWithStatusCode(_0x23a6d8,_0x52b59b){_0x52b59b=_0x52b59b||0xcc;return function(_0x45cdf2){if(_0x45cdf2){return _0x23a6d8['sendStatus'](_0x52b59b);}return _0x23a6d8['status'](_0x52b59b)[_0xd7a5('0x18')]();};}function respondWithResult(_0x1eae02,_0x363ce7){_0x363ce7=_0x363ce7||0xc8;return function(_0x263f83){if(_0x263f83){return _0x1eae02[_0xd7a5('0x19')](_0x363ce7)[_0xd7a5('0x1a')](_0x263f83);}};}function respondWithFilteredResult(_0x366547,_0x314c13){return function(_0x11e803){if(_0x11e803){var _0x30d388=typeof _0x314c13[_0xd7a5('0x1b')]===_0xd7a5('0x1c')&&typeof _0x314c13[_0xd7a5('0x1d')]===_0xd7a5('0x1c');var _0x17f97b=_0x11e803[_0xd7a5('0x1e')];var _0x10da0d=_0x30d388?0x0:_0x314c13['offset'];var _0x263c8b=_0x30d388?_0x11e803[_0xd7a5('0x1e')]:_0x314c13[_0xd7a5('0x1b')]+_0x314c13[_0xd7a5('0x1d')];var _0x4e1483;if(_0x263c8b>=_0x17f97b){_0x263c8b=_0x17f97b;_0x4e1483=0xc8;}else{_0x4e1483=0xce;}_0x366547[_0xd7a5('0x19')](_0x4e1483);return _0x366547[_0xd7a5('0x1f')](_0xd7a5('0x20'),_0x10da0d+'-'+_0x263c8b+'/'+_0x17f97b)[_0xd7a5('0x1a')](_0x11e803);}return null;};}function patchUpdates(_0x58667b){return function(_0x23f112){try{jsonpatch['apply'](_0x23f112,_0x58667b,!![]);}catch(_0x2aff93){return BPromise[_0xd7a5('0x21')](_0x2aff93);}return _0x23f112['save']();};}function saveUpdates(_0x2a66fe,_0x4e16ab){return function(_0x59de7e){if(_0x59de7e){return _0x59de7e[_0xd7a5('0x22')](_0x2a66fe)[_0xd7a5('0x23')](function(_0x4474f8){return _0x4474f8;});}return null;};}function removeEntity(_0x58d319,_0x54803a){return function(_0x51eeb2){if(_0x51eeb2){return _0x51eeb2[_0xd7a5('0x24')]()[_0xd7a5('0x23')](function(){_0x58d319[_0xd7a5('0x19')](0xcc)[_0xd7a5('0x18')]();});}};}function handleEntityNotFound(_0x287f91,_0x46a5b1){return function(_0x277b8c){if(!_0x277b8c){_0x287f91['sendStatus'](0x194);}return _0x277b8c;};}function handleError(_0x383822,_0x5b9445){_0x5b9445=_0x5b9445||0x1f4;return function(_0x3bb233){logger[_0xd7a5('0x25')](_0x3bb233[_0xd7a5('0x26')]);if(_0x3bb233['name']){delete _0x3bb233[_0xd7a5('0x27')];}_0x383822['status'](_0x5b9445)['send'](_0x3bb233);};}exports[_0xd7a5('0x28')]=function(_0x5b77d1,_0x154a48){var _0x462f9a={},_0x376141={},_0x4f3e1d={'count':0x0,'rows':[]};var _0x41621e=_['map'](db[_0xd7a5('0x29')][_0xd7a5('0x2a')],function(_0x5b6d5a){return{'name':_0x5b6d5a[_0xd7a5('0x2b')],'type':_0x5b6d5a[_0xd7a5('0x2c')][_0xd7a5('0x2d')]};});_0x376141['model']=_[_0xd7a5('0x2e')](_0x41621e,_0xd7a5('0x27'));_0x376141[_0xd7a5('0x2f')]=_['keys'](_0x5b77d1[_0xd7a5('0x2f')]);_0x376141['filters']=_[_0xd7a5('0x30')](_0x376141[_0xd7a5('0x31')],_0x376141['query']);_0x462f9a[_0xd7a5('0x32')]=_[_0xd7a5('0x30')](_0x376141['model'],qs['fields'](_0x5b77d1[_0xd7a5('0x2f')][_0xd7a5('0x33')]));_0x462f9a['attributes']=_0x462f9a[_0xd7a5('0x32')][_0xd7a5('0x34')]?_0x462f9a['attributes']:_0x376141[_0xd7a5('0x31')];if(!_0x5b77d1[_0xd7a5('0x2f')][_0xd7a5('0x35')](_0xd7a5('0x36'))){_0x462f9a[_0xd7a5('0x1d')]=qs[_0xd7a5('0x1d')](_0x5b77d1['query'][_0xd7a5('0x1d')]);_0x462f9a[_0xd7a5('0x1b')]=qs[_0xd7a5('0x1b')](_0x5b77d1[_0xd7a5('0x2f')]['offset']);}_0x462f9a[_0xd7a5('0x37')]=qs['sort'](_0x5b77d1[_0xd7a5('0x2f')][_0xd7a5('0x38')]);_0x462f9a['where']=qs[_0xd7a5('0x39')](_[_0xd7a5('0x3a')](_0x5b77d1[_0xd7a5('0x2f')],_0x376141[_0xd7a5('0x39')]),_0x41621e);if(_0x5b77d1[_0xd7a5('0x2f')][_0xd7a5('0x3b')]){_0x462f9a[_0xd7a5('0x3c')]=_[_0xd7a5('0x3d')](_0x462f9a[_0xd7a5('0x3c')],{'$or':_[_0xd7a5('0x2e')](_0x41621e,function(_0xedb1d3){if(_0xedb1d3[_0xd7a5('0x2c')]!==_0xd7a5('0x3e')){var _0x49396f={};_0x49396f[_0xedb1d3['name']]={'$like':'%'+_0x5b77d1[_0xd7a5('0x2f')]['filter']+'%'};return _0x49396f;}})});}_0x462f9a=_['merge']({},_0x462f9a,_0x5b77d1[_0xd7a5('0x3f')]);var _0xa31dc3={'where':_0x462f9a[_0xd7a5('0x3c')]};return db['SquareReport'][_0xd7a5('0x1e')](_0xa31dc3)[_0xd7a5('0x23')](function(_0x5cce2c){_0x4f3e1d['count']=_0x5cce2c;if(_0x5b77d1['query']['includeAll']){_0x462f9a[_0xd7a5('0x40')]=[{'all':!![]}];}return db[_0xd7a5('0x29')]['findAll'](_0x462f9a);})['then'](function(_0x140e75){_0x4f3e1d[_0xd7a5('0x41')]=_0x140e75;return _0x4f3e1d;})['then'](respondWithFilteredResult(_0x154a48,_0x462f9a))[_0xd7a5('0x42')](handleError(_0x154a48,null));};exports['show']=function(_0x52522b,_0x1a3261){var _0x40d20f={'raw':!![],'where':{'id':_0x52522b[_0xd7a5('0x43')]['id']}},_0x485288={};_0x485288[_0xd7a5('0x31')]=_[_0xd7a5('0x44')](db[_0xd7a5('0x29')][_0xd7a5('0x2a')]);_0x485288[_0xd7a5('0x2f')]=_['keys'](_0x52522b[_0xd7a5('0x2f')]);_0x485288[_0xd7a5('0x39')]=_[_0xd7a5('0x30')](_0x485288[_0xd7a5('0x31')],_0x485288['query']);_0x40d20f['attributes']=_[_0xd7a5('0x30')](_0x485288[_0xd7a5('0x31')],qs[_0xd7a5('0x33')](_0x52522b[_0xd7a5('0x2f')][_0xd7a5('0x33')]));_0x40d20f[_0xd7a5('0x32')]=_0x40d20f['attributes'][_0xd7a5('0x34')]?_0x40d20f[_0xd7a5('0x32')]:_0x485288['model'];if(_0x52522b[_0xd7a5('0x2f')][_0xd7a5('0x45')]){_0x40d20f[_0xd7a5('0x40')]=[{'all':!![]}];}_0x40d20f=_[_0xd7a5('0x3d')]({},_0x40d20f,_0x52522b[_0xd7a5('0x3f')]);return db[_0xd7a5('0x29')][_0xd7a5('0x46')](_0x40d20f)['then'](handleEntityNotFound(_0x1a3261,null))[_0xd7a5('0x23')](respondWithResult(_0x1a3261,null))[_0xd7a5('0x42')](handleError(_0x1a3261,null));};exports[_0xd7a5('0x47')]=function(_0x2164ad,_0x45bd74){return db['SquareReport'][_0xd7a5('0x47')](_0x2164ad['body'],{})[_0xd7a5('0x23')](respondWithResult(_0x45bd74,0xc9))[_0xd7a5('0x42')](handleError(_0x45bd74,null));};exports[_0xd7a5('0x22')]=function(_0x1de549,_0x22df03){if(_0x1de549[_0xd7a5('0x48')]['id']){delete _0x1de549[_0xd7a5('0x48')]['id'];}return db['SquareReport'][_0xd7a5('0x46')]({'where':{'id':_0x1de549[_0xd7a5('0x43')]['id']}})[_0xd7a5('0x23')](handleEntityNotFound(_0x22df03,null))[_0xd7a5('0x23')](saveUpdates(_0x1de549[_0xd7a5('0x48')],null))[_0xd7a5('0x23')](respondWithResult(_0x22df03,null))[_0xd7a5('0x42')](handleError(_0x22df03,null));};exports[_0xd7a5('0x24')]=function(_0x5c4b02,_0xe0b1f7){return db[_0xd7a5('0x29')][_0xd7a5('0x46')]({'where':{'id':_0x5c4b02['params']['id']}})[_0xd7a5('0x23')](handleEntityNotFound(_0xe0b1f7,null))[_0xd7a5('0x23')](removeEntity(_0xe0b1f7,null))[_0xd7a5('0x42')](handleError(_0xe0b1f7,null));};exports[_0xd7a5('0x49')]=function(_0x3d3479,_0x4f4589){return db['SquareReport'][_0xd7a5('0x49')]()[_0xd7a5('0x23')](respondWithResult(_0x4f4589,null))[_0xd7a5('0x42')](handleError(_0x4f4589,null));}; \ No newline at end of file +var _0x9b70=['fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','include','SquareReport','findAll','catch','show','params','keys','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv'];(function(_0x37f65a,_0x52f2d3){var _0x49709d=function(_0x484c87){while(--_0x484c87){_0x37f65a['push'](_0x37f65a['shift']());}};_0x49709d(++_0x52f2d3);}(_0x9b70,0x8e));var _0x09b7=function(_0x4afe3b,_0x255e0d){_0x4afe3b=_0x4afe3b-0x0;var _0x2c22d1=_0x9b70[_0x4afe3b];return _0x2c22d1;};'use strict';var emlformat=require(_0x09b7('0x0'));var rimraf=require(_0x09b7('0x1'));var zipdir=require(_0x09b7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x09b7('0x3'));var moment=require(_0x09b7('0x4'));var BPromise=require(_0x09b7('0x5'));var Mustache=require(_0x09b7('0x6'));var util=require(_0x09b7('0x7'));var path=require(_0x09b7('0x8'));var sox=require('sox');var csv=require(_0x09b7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x09b7('0xa'));var _=require('lodash');var squel=require(_0x09b7('0xb'));var crypto=require(_0x09b7('0xc'));var jsforce=require(_0x09b7('0xd'));var deskjs=require(_0x09b7('0xe'));var toCsv=require(_0x09b7('0x9'));var querystring=require(_0x09b7('0xf'));var Papa=require(_0x09b7('0x10'));var Redis=require('ioredis');var authService=require(_0x09b7('0x11'));var qs=require(_0x09b7('0x12'));var as=require(_0x09b7('0x13'));var hardwareService=require(_0x09b7('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x09b7('0x15'));var config=require(_0x09b7('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x09b7('0x17'))['db'];function respondWithStatusCode(_0x34318a,_0x3b42ff){_0x3b42ff=_0x3b42ff||0xcc;return function(_0x44c848){if(_0x44c848){return _0x34318a[_0x09b7('0x18')](_0x3b42ff);}return _0x34318a['status'](_0x3b42ff)[_0x09b7('0x19')]();};}function respondWithResult(_0x23765b,_0x47f5f7){_0x47f5f7=_0x47f5f7||0xc8;return function(_0x4e0386){if(_0x4e0386){return _0x23765b[_0x09b7('0x1a')](_0x47f5f7)[_0x09b7('0x1b')](_0x4e0386);}};}function respondWithFilteredResult(_0x3fe02a,_0x181138){return function(_0x10ff8){if(_0x10ff8){var _0x36b768=typeof _0x181138[_0x09b7('0x1c')]===_0x09b7('0x1d')&&typeof _0x181138['limit']==='undefined';var _0xe6a0f=_0x10ff8[_0x09b7('0x1e')];var _0x4621a5=_0x36b768?0x0:_0x181138[_0x09b7('0x1c')];var _0x3df9c2=_0x36b768?_0x10ff8['count']:_0x181138[_0x09b7('0x1c')]+_0x181138[_0x09b7('0x1f')];var _0x318184;if(_0x3df9c2>=_0xe6a0f){_0x3df9c2=_0xe6a0f;_0x318184=0xc8;}else{_0x318184=0xce;}_0x3fe02a[_0x09b7('0x1a')](_0x318184);return _0x3fe02a[_0x09b7('0x20')](_0x09b7('0x21'),_0x4621a5+'-'+_0x3df9c2+'/'+_0xe6a0f)[_0x09b7('0x1b')](_0x10ff8);}return null;};}function patchUpdates(_0x416002){return function(_0x3d5983){try{jsonpatch[_0x09b7('0x22')](_0x3d5983,_0x416002,!![]);}catch(_0x3d0b07){return BPromise[_0x09b7('0x23')](_0x3d0b07);}return _0x3d5983[_0x09b7('0x24')]();};}function saveUpdates(_0x538d29,_0x950b59){return function(_0x3a2d11){if(_0x3a2d11){return _0x3a2d11[_0x09b7('0x25')](_0x538d29)[_0x09b7('0x26')](function(_0x4887cc){return _0x4887cc;});}return null;};}function removeEntity(_0x488430,_0xb885f3){return function(_0x433802){if(_0x433802){return _0x433802[_0x09b7('0x27')]()[_0x09b7('0x26')](function(){_0x488430[_0x09b7('0x1a')](0xcc)[_0x09b7('0x19')]();});}};}function handleEntityNotFound(_0x2f3d67,_0x20cd93){return function(_0x351ca5){if(!_0x351ca5){_0x2f3d67[_0x09b7('0x18')](0x194);}return _0x351ca5;};}function handleError(_0x1d781c,_0x41f1c7){_0x41f1c7=_0x41f1c7||0x1f4;return function(_0x2c3792){logger['error'](_0x2c3792['stack']);if(_0x2c3792[_0x09b7('0x28')]){delete _0x2c3792[_0x09b7('0x28')];}_0x1d781c[_0x09b7('0x1a')](_0x41f1c7)[_0x09b7('0x29')](_0x2c3792);};}exports[_0x09b7('0x2a')]=function(_0xa6743,_0x1c8596){var _0x31f595={},_0x2264e9={},_0x3df971={'count':0x0,'rows':[]};var _0x5e8694=_[_0x09b7('0x2b')](db['SquareReport'][_0x09b7('0x2c')],function(_0x4ff59f){return{'name':_0x4ff59f[_0x09b7('0x2d')],'type':_0x4ff59f[_0x09b7('0x2e')][_0x09b7('0x2f')]};});_0x2264e9['model']=_[_0x09b7('0x2b')](_0x5e8694,_0x09b7('0x28'));_0x2264e9['query']=_['keys'](_0xa6743[_0x09b7('0x30')]);_0x2264e9[_0x09b7('0x31')]=_[_0x09b7('0x32')](_0x2264e9[_0x09b7('0x33')],_0x2264e9['query']);_0x31f595[_0x09b7('0x34')]=_[_0x09b7('0x32')](_0x2264e9[_0x09b7('0x33')],qs[_0x09b7('0x35')](_0xa6743[_0x09b7('0x30')][_0x09b7('0x35')]));_0x31f595[_0x09b7('0x34')]=_0x31f595[_0x09b7('0x34')][_0x09b7('0x36')]?_0x31f595[_0x09b7('0x34')]:_0x2264e9[_0x09b7('0x33')];if(!_0xa6743['query'][_0x09b7('0x37')]('nolimit')){_0x31f595[_0x09b7('0x1f')]=qs[_0x09b7('0x1f')](_0xa6743['query'][_0x09b7('0x1f')]);_0x31f595['offset']=qs[_0x09b7('0x1c')](_0xa6743[_0x09b7('0x30')][_0x09b7('0x1c')]);}_0x31f595[_0x09b7('0x38')]=qs[_0x09b7('0x39')](_0xa6743[_0x09b7('0x30')][_0x09b7('0x39')]);_0x31f595[_0x09b7('0x3a')]=qs['filters'](_[_0x09b7('0x3b')](_0xa6743['query'],_0x2264e9[_0x09b7('0x31')]),_0x5e8694);if(_0xa6743['query']['filter']){_0x31f595[_0x09b7('0x3a')]=_[_0x09b7('0x3c')](_0x31f595[_0x09b7('0x3a')],{'$or':_[_0x09b7('0x2b')](_0x5e8694,function(_0x151800){if(_0x151800[_0x09b7('0x2e')]!==_0x09b7('0x3d')){var _0x3d3e04={};_0x3d3e04[_0x151800[_0x09b7('0x28')]]={'$like':'%'+_0xa6743[_0x09b7('0x30')][_0x09b7('0x3e')]+'%'};return _0x3d3e04;}})});}_0x31f595=_[_0x09b7('0x3c')]({},_0x31f595,_0xa6743[_0x09b7('0x3f')]);var _0x52657e={'where':_0x31f595[_0x09b7('0x3a')]};return db['SquareReport'][_0x09b7('0x1e')](_0x52657e)[_0x09b7('0x26')](function(_0x281755){_0x3df971[_0x09b7('0x1e')]=_0x281755;if(_0xa6743[_0x09b7('0x30')]['includeAll']){_0x31f595[_0x09b7('0x40')]=[{'all':!![]}];}return db[_0x09b7('0x41')][_0x09b7('0x42')](_0x31f595);})[_0x09b7('0x26')](function(_0x1c7a1d){_0x3df971['rows']=_0x1c7a1d;return _0x3df971;})[_0x09b7('0x26')](respondWithFilteredResult(_0x1c8596,_0x31f595))[_0x09b7('0x43')](handleError(_0x1c8596,null));};exports[_0x09b7('0x44')]=function(_0x53ce35,_0x2df40b){var _0x454b97={'raw':!![],'where':{'id':_0x53ce35[_0x09b7('0x45')]['id']}},_0x3de3fb={};_0x3de3fb['model']=_[_0x09b7('0x46')](db[_0x09b7('0x41')][_0x09b7('0x2c')]);_0x3de3fb['query']=_[_0x09b7('0x46')](_0x53ce35[_0x09b7('0x30')]);_0x3de3fb[_0x09b7('0x31')]=_[_0x09b7('0x32')](_0x3de3fb[_0x09b7('0x33')],_0x3de3fb['query']);_0x454b97[_0x09b7('0x34')]=_[_0x09b7('0x32')](_0x3de3fb[_0x09b7('0x33')],qs[_0x09b7('0x35')](_0x53ce35[_0x09b7('0x30')][_0x09b7('0x35')]));_0x454b97[_0x09b7('0x34')]=_0x454b97['attributes'][_0x09b7('0x36')]?_0x454b97[_0x09b7('0x34')]:_0x3de3fb[_0x09b7('0x33')];if(_0x53ce35[_0x09b7('0x30')][_0x09b7('0x47')]){_0x454b97[_0x09b7('0x40')]=[{'all':!![]}];}_0x454b97=_[_0x09b7('0x3c')]({},_0x454b97,_0x53ce35[_0x09b7('0x3f')]);return db[_0x09b7('0x41')][_0x09b7('0x48')](_0x454b97)[_0x09b7('0x26')](handleEntityNotFound(_0x2df40b,null))[_0x09b7('0x26')](respondWithResult(_0x2df40b,null))[_0x09b7('0x43')](handleError(_0x2df40b,null));};exports[_0x09b7('0x49')]=function(_0x32389,_0xe53aac){return db[_0x09b7('0x41')][_0x09b7('0x49')](_0x32389[_0x09b7('0x4a')],{})[_0x09b7('0x26')](respondWithResult(_0xe53aac,0xc9))[_0x09b7('0x43')](handleError(_0xe53aac,null));};exports[_0x09b7('0x25')]=function(_0x57d9ab,_0x5051af){if(_0x57d9ab[_0x09b7('0x4a')]['id']){delete _0x57d9ab[_0x09b7('0x4a')]['id'];}return db[_0x09b7('0x41')][_0x09b7('0x48')]({'where':{'id':_0x57d9ab[_0x09b7('0x45')]['id']}})['then'](handleEntityNotFound(_0x5051af,null))[_0x09b7('0x26')](saveUpdates(_0x57d9ab[_0x09b7('0x4a')],null))['then'](respondWithResult(_0x5051af,null))[_0x09b7('0x43')](handleError(_0x5051af,null));};exports[_0x09b7('0x27')]=function(_0x524a74,_0x34d33a){return db[_0x09b7('0x41')][_0x09b7('0x48')]({'where':{'id':_0x524a74[_0x09b7('0x45')]['id']}})['then'](handleEntityNotFound(_0x34d33a,null))[_0x09b7('0x26')](removeEntity(_0x34d33a,null))[_0x09b7('0x43')](handleError(_0x34d33a,null));};exports[_0x09b7('0x4b')]=function(_0x1b2600,_0x37c664){return db[_0x09b7('0x41')][_0x09b7('0x4b')]()[_0x09b7('0x26')](respondWithResult(_0x37c664,null))[_0x09b7('0x43')](handleError(_0x37c664,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 8b16f5e..a69f2bb 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 _0xecea=['../../config/environment','./squareReport.attributes','exports','SquareReport','report_square','leaveAt','lodash','util','api','moment','bluebird','path','rimraf'];(function(_0x20d6d9,_0x3790ad){var _0x235ff1=function(_0x479070){while(--_0x479070){_0x20d6d9['push'](_0x20d6d9['shift']());}};_0x235ff1(++_0x3790ad);}(_0xecea,0x14b));var _0xaece=function(_0x1b764f,_0x45af49){_0x1b764f=_0x1b764f-0x0;var _0x497f99=_0xecea[_0x1b764f];return _0x497f99;};'use strict';var _=require(_0xaece('0x0'));var util=require(_0xaece('0x1'));var logger=require('../../config/logger')(_0xaece('0x2'));var moment=require(_0xaece('0x3'));var BPromise=require(_0xaece('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaece('0x5'));var rimraf=require(_0xaece('0x6'));var config=require(_0xaece('0x7'));var attributes=require(_0xaece('0x8'));module[_0xaece('0x9')]=function(_0x17a56c,_0x2bc86){return _0x17a56c['define'](_0xaece('0xa'),attributes,{'tableName':_0xaece('0xb'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':['uniqueid','project_name']},{'name':_0xaece('0xc'),'fields':[_0xaece('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5716=['../../config/environment','define','SquareReport','uid_pname','uniqueid','leaveAt','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x27202d,_0x4f9183){var _0x1281e9=function(_0x25b4af){while(--_0x25b4af){_0x27202d['push'](_0x27202d['shift']());}};_0x1281e9(++_0x4f9183);}(_0x5716,0xa2));var _0x6571=function(_0x2179f1,_0x21c653){_0x2179f1=_0x2179f1-0x0;var _0x176ec9=_0x5716[_0x2179f1];return _0x176ec9;};'use strict';var _=require(_0x6571('0x0'));var util=require(_0x6571('0x1'));var logger=require(_0x6571('0x2'))(_0x6571('0x3'));var moment=require(_0x6571('0x4'));var BPromise=require(_0x6571('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6571('0x6'));var rimraf=require('rimraf');var config=require(_0x6571('0x7'));var attributes=require('./squareReport.attributes');module['exports']=function(_0x21251c,_0x191745){return _0x21251c[_0x6571('0x8')](_0x6571('0x9'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x6571('0xa'),'fields':[_0x6571('0xb'),'project_name']},{'name':'leaveAt','fields':[_0x6571('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 9a8f541..26e86db 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 _0x9481=['then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','SquareReport','create','body','options','raw','CreateSquareReport','catch','UpdateSquareReport','update','where','attributes','limit','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9481,0x175));var _0x1948=function(_0xa3ce0d,_0x2f8f88){_0xa3ce0d=_0xa3ce0d-0x0;var _0x403e55=_0x9481[_0xa3ce0d];return _0x403e55;};'use strict';var _=require(_0x1948('0x0'));var util=require(_0x1948('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1948('0x2'));var fs=require('fs');var Redis=require(_0x1948('0x3'));var db=require(_0x1948('0x4'))['db'];var utils=require(_0x1948('0x5'));var logger=require(_0x1948('0x6'))('rpc');var config=require(_0x1948('0x7'));var jayson=require(_0x1948('0x8'));var client=jayson[_0x1948('0x9')][_0x1948('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33f906,_0x53d89d,_0x469231){return new BPromise(function(_0x5b2658,_0x56e084){return client[_0x1948('0xb')](_0x33f906,_0x469231)[_0x1948('0xc')](function(_0x33aa7f){logger[_0x1948('0xd')](_0x1948('0xe'),_0x53d89d,_0x1948('0xf'));logger[_0x1948('0x10')](_0x1948('0x11'),_0x53d89d,_0x1948('0xf'),JSON[_0x1948('0x12')](_0x33aa7f));if(_0x33aa7f['error']){if(_0x33aa7f[_0x1948('0x13')][_0x1948('0x14')]===0x1f4){logger[_0x1948('0x13')](_0x1948('0xe'),_0x53d89d,_0x33aa7f[_0x1948('0x13')][_0x1948('0x15')]);return _0x56e084(_0x33aa7f[_0x1948('0x13')][_0x1948('0x15')]);}logger[_0x1948('0x13')](_0x1948('0xe'),_0x53d89d,_0x33aa7f['error']['message']);return _0x5b2658(_0x33aa7f[_0x1948('0x13')][_0x1948('0x15')]);}else{logger[_0x1948('0xd')](_0x1948('0xe'),_0x53d89d,'request\x20sent');_0x5b2658(_0x33aa7f[_0x1948('0x16')][_0x1948('0x15')]);}})['catch'](function(_0x28d56a){logger[_0x1948('0x13')](_0x1948('0xe'),_0x53d89d,_0x28d56a);_0x56e084(_0x28d56a);});});}exports['CreateSquareReport']=function(_0x3ee140){var _0x1ec8a5=this;return new Promise(function(_0x498ba6,_0x3b73f2){return db[_0x1948('0x17')][_0x1948('0x18')](_0x3ee140[_0x1948('0x19')],{'raw':_0x3ee140[_0x1948('0x1a')]?_0x3ee140[_0x1948('0x1a')][_0x1948('0x1b')]===undefined?!![]:![]:!![]})[_0x1948('0xc')](function(_0x46b2e5){logger[_0x1948('0xd')](_0x1948('0x1c'),_0x3ee140);logger[_0x1948('0x10')]('CreateSquareReport',_0x3ee140,JSON[_0x1948('0x12')](_0x46b2e5));_0x498ba6(_0x46b2e5);})[_0x1948('0x1d')](function(_0x206abc){logger['error']('CreateSquareReport',_0x206abc['message'],_0x3ee140);_0x3b73f2(_0x1ec8a5['error'](0x1f4,_0x206abc[_0x1948('0x15')]));});});};exports[_0x1948('0x1e')]=function(_0x59881f){var _0x276c5c=this;return new Promise(function(_0x108918,_0x59c5b1){return db['SquareReport'][_0x1948('0x1f')](_0x59881f[_0x1948('0x19')],{'raw':_0x59881f[_0x1948('0x1a')]?_0x59881f[_0x1948('0x1a')][_0x1948('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59881f[_0x1948('0x1a')]?_0x59881f[_0x1948('0x1a')][_0x1948('0x20')]||null:null,'attributes':_0x59881f['options']?_0x59881f['options'][_0x1948('0x21')]||null:null,'limit':_0x59881f['options']?_0x59881f['options'][_0x1948('0x22')]||null:null})['then'](function(_0x37c7e4){logger[_0x1948('0xd')](_0x1948('0x1e'),_0x59881f);logger[_0x1948('0x10')]('UpdateSquareReport',_0x59881f,JSON[_0x1948('0x12')](_0x37c7e4));_0x108918(_0x37c7e4);})[_0x1948('0x1d')](function(_0x4f61ca){logger[_0x1948('0x13')](_0x1948('0x1e'),_0x4f61ca[_0x1948('0x15')],_0x59881f);_0x59c5b1(_0x276c5c[_0x1948('0x13')](0x1f4,_0x4f61ca['message']));});});}; \ No newline at end of file +var _0xa9b2=['bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareReport,\x20%s,\x20%s','message','result','catch','CreateSquareReport','body','options','info','UpdateSquareReport','SquareReport','update','raw','limit','debug','util','moment'];(function(_0x4d8998,_0x3e7ee6){var _0x249cae=function(_0x4e5aa7){while(--_0x4e5aa7){_0x4d8998['push'](_0x4d8998['shift']());}};_0x249cae(++_0x3e7ee6);}(_0xa9b2,0x99));var _0x2a9b=function(_0x28d7b5,_0x1305a4){_0x28d7b5=_0x28d7b5-0x0;var _0x1ed035=_0xa9b2[_0x28d7b5];return _0x1ed035;};'use strict';var _=require('lodash');var util=require(_0x2a9b('0x0'));var moment=require(_0x2a9b('0x1'));var BPromise=require(_0x2a9b('0x2'));var rs=require(_0x2a9b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2a9b('0x4'));var logger=require(_0x2a9b('0x5'))('rpc');var config=require(_0x2a9b('0x6'));var jayson=require(_0x2a9b('0x7'));var client=jayson[_0x2a9b('0x8')][_0x2a9b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17a73b,_0x240c2e,_0x223a75){return new BPromise(function(_0x2328c1,_0x59f4bb){return client[_0x2a9b('0xa')](_0x17a73b,_0x223a75)[_0x2a9b('0xb')](function(_0xe8d6ae){logger['info']('SquareReport,\x20%s,\x20%s',_0x240c2e,_0x2a9b('0xc'));logger['debug'](_0x2a9b('0xd'),_0x240c2e,_0x2a9b('0xc'),JSON[_0x2a9b('0xe')](_0xe8d6ae));if(_0xe8d6ae[_0x2a9b('0xf')]){if(_0xe8d6ae[_0x2a9b('0xf')][_0x2a9b('0x10')]===0x1f4){logger[_0x2a9b('0xf')](_0x2a9b('0x11'),_0x240c2e,_0xe8d6ae[_0x2a9b('0xf')][_0x2a9b('0x12')]);return _0x59f4bb(_0xe8d6ae[_0x2a9b('0xf')][_0x2a9b('0x12')]);}logger[_0x2a9b('0xf')](_0x2a9b('0x11'),_0x240c2e,_0xe8d6ae[_0x2a9b('0xf')]['message']);return _0x2328c1(_0xe8d6ae['error'][_0x2a9b('0x12')]);}else{logger['info']('SquareReport,\x20%s,\x20%s',_0x240c2e,_0x2a9b('0xc'));_0x2328c1(_0xe8d6ae[_0x2a9b('0x13')]['message']);}})[_0x2a9b('0x14')](function(_0x1f444e){logger['error']('SquareReport,\x20%s,\x20%s',_0x240c2e,_0x1f444e);_0x59f4bb(_0x1f444e);});});}exports[_0x2a9b('0x15')]=function(_0x391fd7){var _0x7f0c79=this;return new Promise(function(_0xf35f0d,_0x31d7a6){return db['SquareReport']['create'](_0x391fd7[_0x2a9b('0x16')],{'raw':_0x391fd7[_0x2a9b('0x17')]?_0x391fd7['options']['raw']===undefined?!![]:![]:!![]})[_0x2a9b('0xb')](function(_0x10ec04){logger[_0x2a9b('0x18')](_0x2a9b('0x15'),_0x391fd7);logger['debug'](_0x2a9b('0x15'),_0x391fd7,JSON[_0x2a9b('0xe')](_0x10ec04));_0xf35f0d(_0x10ec04);})['catch'](function(_0x5ae3d9){logger[_0x2a9b('0xf')]('CreateSquareReport',_0x5ae3d9[_0x2a9b('0x12')],_0x391fd7);_0x31d7a6(_0x7f0c79[_0x2a9b('0xf')](0x1f4,_0x5ae3d9[_0x2a9b('0x12')]));});});};exports[_0x2a9b('0x19')]=function(_0x3be0cf){var _0x2dff93=this;return new Promise(function(_0x1e754f,_0x5540a5){return db[_0x2a9b('0x1a')][_0x2a9b('0x1b')](_0x3be0cf[_0x2a9b('0x16')],{'raw':_0x3be0cf[_0x2a9b('0x17')]?_0x3be0cf[_0x2a9b('0x17')][_0x2a9b('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3be0cf[_0x2a9b('0x17')]?_0x3be0cf[_0x2a9b('0x17')]['where']||null:null,'attributes':_0x3be0cf[_0x2a9b('0x17')]?_0x3be0cf[_0x2a9b('0x17')]['attributes']||null:null,'limit':_0x3be0cf[_0x2a9b('0x17')]?_0x3be0cf[_0x2a9b('0x17')][_0x2a9b('0x1d')]||null:null})[_0x2a9b('0xb')](function(_0x3591ad){logger[_0x2a9b('0x18')](_0x2a9b('0x19'),_0x3be0cf);logger[_0x2a9b('0x1e')](_0x2a9b('0x19'),_0x3be0cf,JSON[_0x2a9b('0xe')](_0x3591ad));_0x1e754f(_0x3591ad);})[_0x2a9b('0x14')](function(_0x5c357f){logger[_0x2a9b('0xf')]('UpdateSquareReport',_0x5c357f[_0x2a9b('0x12')],_0x3be0cf);_0x5540a5(_0x2dff93[_0x2a9b('0xf')](0x1f4,_0x5c357f[_0x2a9b('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index e3b98a6..f92056d 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 _0xab68=['../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','/:id','show','put','update','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x595b4f,_0x4071aa){var _0x3ca3b8=function(_0x4307d6){while(--_0x4307d6){_0x595b4f['push'](_0x595b4f['shift']());}};_0x3ca3b8(++_0x4071aa);}(_0xab68,0xe8));var _0x8ab6=function(_0x5afb28,_0x3be7ef){_0x5afb28=_0x5afb28-0x0;var _0xec0175=_0xab68[_0x5afb28];return _0xec0175;};'use strict';var multer=require(_0x8ab6('0x0'));var util=require(_0x8ab6('0x1'));var path=require(_0x8ab6('0x2'));var timeout=require(_0x8ab6('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8ab6('0x4'));var auth=require(_0x8ab6('0x5'));var interaction=require(_0x8ab6('0x6'));var config=require(_0x8ab6('0x7'));var controller=require('./squareReportDetail.controller');router['get']('/',auth[_0x8ab6('0x8')](),controller['index']);router[_0x8ab6('0x9')](_0x8ab6('0xa'),auth[_0x8ab6('0x8')](),controller['describe']);router[_0x8ab6('0x9')](_0x8ab6('0xb'),auth['isAuthenticated'](),controller[_0x8ab6('0xc')]);router['post']('/',auth[_0x8ab6('0x8')](),controller['create']);router[_0x8ab6('0xd')](_0x8ab6('0xb'),auth[_0x8ab6('0x8')](),controller[_0x8ab6('0xe')]);router[_0x8ab6('0xf')]('/:id',auth[_0x8ab6('0x8')](),controller[_0x8ab6('0x10')]);module['exports']=router; \ No newline at end of file +var _0x6e1f=['fs-extra','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','/describe','isAuthenticated','describe','/:id','post','create','delete','destroy','exports','multer','path'];(function(_0x6e5aef,_0x306db5){var _0x2a48a5=function(_0x551482){while(--_0x551482){_0x6e5aef['push'](_0x6e5aef['shift']());}};_0x2a48a5(++_0x306db5);}(_0x6e1f,0x9e));var _0xf6e1=function(_0x2efd2b,_0x187c83){_0x2efd2b=_0x2efd2b-0x0;var _0x50ca3a=_0x6e1f[_0x2efd2b];return _0x50ca3a;};'use strict';var multer=require(_0xf6e1('0x0'));var util=require('util');var path=require(_0xf6e1('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xf6e1('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xf6e1('0x3'));var config=require(_0xf6e1('0x4'));var controller=require(_0xf6e1('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xf6e1('0x6')](_0xf6e1('0x7'),auth[_0xf6e1('0x8')](),controller[_0xf6e1('0x9')]);router[_0xf6e1('0x6')](_0xf6e1('0xa'),auth[_0xf6e1('0x8')](),controller['show']);router[_0xf6e1('0xb')]('/',auth[_0xf6e1('0x8')](),controller[_0xf6e1('0xc')]);router['put'](_0xf6e1('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xf6e1('0xd')]('/:id',auth[_0xf6e1('0x8')](),controller[_0xf6e1('0xe')]);module[_0xf6e1('0xf')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 91e8fe3..06682ff 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 _0x71ce=['STRING','exports'];(function(_0x5c65f0,_0x358764){var _0x115708=function(_0x59abed){while(--_0x59abed){_0x5c65f0['push'](_0x5c65f0['shift']());}};_0x115708(++_0x358764);}(_0x71ce,0x67));var _0xe71c=function(_0x315073,_0x39af93){_0x315073=_0x315073-0x0;var _0x2d3505=_0x71ce[_0x315073];return _0x2d3505;};'use strict';var Sequelize=require('sequelize');module[_0xe71c('0x0')]={'uniqueid':{'type':Sequelize[_0xe71c('0x1')]},'node':{'type':Sequelize[_0xe71c('0x1')]},'application':{'type':Sequelize[_0xe71c('0x1')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7dba=['sequelize','exports','TEXT','STRING'];(function(_0x174ead,_0x352644){var _0x3eb6dc=function(_0x7696b4){while(--_0x7696b4){_0x174ead['push'](_0x174ead['shift']());}};_0x3eb6dc(++_0x352644);}(_0x7dba,0xdc));var _0xa7db=function(_0x456ba5,_0x4403df){_0x456ba5=_0x456ba5-0x0;var _0x2d9300=_0x7dba[_0x456ba5];return _0x2d9300;};'use strict';var Sequelize=require(_0xa7db('0x0'));module[_0xa7db('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0xa7db('0x2')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xa7db('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 4ecd62c..f402359 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 _0x18a3=['params','describe','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','end','error','stack','name','send','map','SquareDetailsReport','rawAttributes','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','then','catch','show','keys','fields','includeAll','include','options','find','create','body'];(function(_0x120bc2,_0x57a253){var _0x454a41=function(_0x21adfe){while(--_0x21adfe){_0x120bc2['push'](_0x120bc2['shift']());}};_0x454a41(++_0x57a253);}(_0x18a3,0xe3));var _0x318a=function(_0x1f5abc,_0x35cd06){_0x1f5abc=_0x1f5abc-0x0;var _0xcfebf=_0x18a3[_0x1f5abc];return _0xcfebf;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x318a('0x0'));var rp=require(_0x318a('0x1'));var moment=require(_0x318a('0x2'));var BPromise=require(_0x318a('0x3'));var Mustache=require(_0x318a('0x4'));var util=require('util');var path=require(_0x318a('0x5'));var sox=require(_0x318a('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x318a('0x7'));var _=require(_0x318a('0x8'));var squel=require('squel');var crypto=require(_0x318a('0x9'));var jsforce=require(_0x318a('0xa'));var deskjs=require(_0x318a('0xb'));var toCsv=require('to-csv');var querystring=require(_0x318a('0xc'));var Papa=require(_0x318a('0xd'));var Redis=require(_0x318a('0xe'));var authService=require(_0x318a('0xf'));var qs=require(_0x318a('0x10'));var as=require(_0x318a('0x11'));var hardwareService=require(_0x318a('0x12'));var logger=require(_0x318a('0x13'))(_0x318a('0x14'));var utils=require(_0x318a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x318a('0x16'));var db=require(_0x318a('0x17'))['db'];function respondWithStatusCode(_0x54a0c5,_0x370fcf){_0x370fcf=_0x370fcf||0xcc;return function(_0x66dd6a){if(_0x66dd6a){return _0x54a0c5[_0x318a('0x18')](_0x370fcf);}return _0x54a0c5['status'](_0x370fcf)['end']();};}function respondWithResult(_0x2ddc37,_0x46f2a8){_0x46f2a8=_0x46f2a8||0xc8;return function(_0x4db535){if(_0x4db535){return _0x2ddc37[_0x318a('0x19')](_0x46f2a8)[_0x318a('0x1a')](_0x4db535);}};}function respondWithFilteredResult(_0x3ee821,_0x315ba1){return function(_0x129de6){if(_0x129de6){var _0x20651f=typeof _0x315ba1[_0x318a('0x1b')]===_0x318a('0x1c')&&typeof _0x315ba1[_0x318a('0x1d')]===_0x318a('0x1c');var _0xac6287=_0x129de6[_0x318a('0x1e')];var _0x3a7169=_0x20651f?0x0:_0x315ba1[_0x318a('0x1b')];var _0x131205=_0x20651f?_0x129de6[_0x318a('0x1e')]:_0x315ba1['offset']+_0x315ba1['limit'];var _0x1cc8c9;if(_0x131205>=_0xac6287){_0x131205=_0xac6287;_0x1cc8c9=0xc8;}else{_0x1cc8c9=0xce;}_0x3ee821[_0x318a('0x19')](_0x1cc8c9);return _0x3ee821[_0x318a('0x1f')](_0x318a('0x20'),_0x3a7169+'-'+_0x131205+'/'+_0xac6287)[_0x318a('0x1a')](_0x129de6);}return null;};}function patchUpdates(_0x3134e8){return function(_0x248dc8){try{jsonpatch[_0x318a('0x21')](_0x248dc8,_0x3134e8,!![]);}catch(_0x26aa3d){return BPromise[_0x318a('0x22')](_0x26aa3d);}return _0x248dc8[_0x318a('0x23')]();};}function saveUpdates(_0x1b41e3,_0xf6b88a){return function(_0x5f0f07){if(_0x5f0f07){return _0x5f0f07[_0x318a('0x24')](_0x1b41e3)['then'](function(_0x57b810){return _0x57b810;});}return null;};}function removeEntity(_0x438dbc,_0xfa19d1){return function(_0x2a45a3){if(_0x2a45a3){return _0x2a45a3[_0x318a('0x25')]()['then'](function(){_0x438dbc['status'](0xcc)[_0x318a('0x26')]();});}};}function handleEntityNotFound(_0x257aa1,_0x5d0bc){return function(_0x306c80){if(!_0x306c80){_0x257aa1[_0x318a('0x18')](0x194);}return _0x306c80;};}function handleError(_0x2492d7,_0x5811b7){_0x5811b7=_0x5811b7||0x1f4;return function(_0x19441d){logger[_0x318a('0x27')](_0x19441d[_0x318a('0x28')]);if(_0x19441d[_0x318a('0x29')]){delete _0x19441d[_0x318a('0x29')];}_0x2492d7[_0x318a('0x19')](_0x5811b7)[_0x318a('0x2a')](_0x19441d);};}exports['index']=function(_0x42e976,_0x3afcfa){var _0x1c2a89={},_0x305554={},_0x39c4a9={'count':0x0,'rows':[]};var _0x5f109e=_[_0x318a('0x2b')](db[_0x318a('0x2c')][_0x318a('0x2d')],function(_0x2aa53c){return{'name':_0x2aa53c['fieldName'],'type':_0x2aa53c[_0x318a('0x2e')][_0x318a('0x2f')]};});_0x305554[_0x318a('0x30')]=_[_0x318a('0x2b')](_0x5f109e,_0x318a('0x29'));_0x305554[_0x318a('0x31')]=_['keys'](_0x42e976[_0x318a('0x31')]);_0x305554[_0x318a('0x32')]=_[_0x318a('0x33')](_0x305554[_0x318a('0x30')],_0x305554[_0x318a('0x31')]);_0x1c2a89['attributes']=_[_0x318a('0x33')](_0x305554[_0x318a('0x30')],qs['fields'](_0x42e976[_0x318a('0x31')]['fields']));_0x1c2a89[_0x318a('0x34')]=_0x1c2a89[_0x318a('0x34')][_0x318a('0x35')]?_0x1c2a89[_0x318a('0x34')]:_0x305554[_0x318a('0x30')];if(!_0x42e976[_0x318a('0x31')][_0x318a('0x36')]('nolimit')){_0x1c2a89[_0x318a('0x1d')]=qs[_0x318a('0x1d')](_0x42e976['query'][_0x318a('0x1d')]);_0x1c2a89['offset']=qs[_0x318a('0x1b')](_0x42e976[_0x318a('0x31')][_0x318a('0x1b')]);}_0x1c2a89[_0x318a('0x37')]=qs[_0x318a('0x38')](_0x42e976[_0x318a('0x31')]['sort']);_0x1c2a89['where']=qs['filters'](_[_0x318a('0x39')](_0x42e976[_0x318a('0x31')],_0x305554[_0x318a('0x32')]),_0x5f109e);if(_0x42e976['query'][_0x318a('0x3a')]){_0x1c2a89[_0x318a('0x3b')]=_['merge'](_0x1c2a89[_0x318a('0x3b')],{'$or':_[_0x318a('0x2b')](_0x5f109e,function(_0x523fb2){if(_0x523fb2['type']!==_0x318a('0x3c')){var _0x435686={};_0x435686[_0x523fb2['name']]={'$like':'%'+_0x42e976[_0x318a('0x31')][_0x318a('0x3a')]+'%'};return _0x435686;}})});}_0x1c2a89=_[_0x318a('0x3d')]({},_0x1c2a89,_0x42e976['options']);var _0x276fd0={'where':_0x1c2a89[_0x318a('0x3b')]};return db[_0x318a('0x2c')][_0x318a('0x1e')](_0x276fd0)['then'](function(_0x3a9da2){_0x39c4a9['count']=_0x3a9da2;if(_0x42e976[_0x318a('0x31')]['includeAll']){_0x1c2a89['include']=[{'all':!![]}];}return db[_0x318a('0x2c')]['findAll'](_0x1c2a89);})[_0x318a('0x3e')](function(_0x3dc4b4){_0x39c4a9['rows']=_0x3dc4b4;return _0x39c4a9;})['then'](respondWithFilteredResult(_0x3afcfa,_0x1c2a89))[_0x318a('0x3f')](handleError(_0x3afcfa,null));};exports[_0x318a('0x40')]=function(_0x5d90ef,_0x12fb48){var _0x2f120a={'raw':!![],'where':{'id':_0x5d90ef['params']['id']}},_0x3c61fb={};_0x3c61fb[_0x318a('0x30')]=_[_0x318a('0x41')](db[_0x318a('0x2c')][_0x318a('0x2d')]);_0x3c61fb[_0x318a('0x31')]=_['keys'](_0x5d90ef[_0x318a('0x31')]);_0x3c61fb[_0x318a('0x32')]=_[_0x318a('0x33')](_0x3c61fb[_0x318a('0x30')],_0x3c61fb[_0x318a('0x31')]);_0x2f120a[_0x318a('0x34')]=_[_0x318a('0x33')](_0x3c61fb[_0x318a('0x30')],qs['fields'](_0x5d90ef[_0x318a('0x31')][_0x318a('0x42')]));_0x2f120a[_0x318a('0x34')]=_0x2f120a[_0x318a('0x34')][_0x318a('0x35')]?_0x2f120a[_0x318a('0x34')]:_0x3c61fb[_0x318a('0x30')];if(_0x5d90ef[_0x318a('0x31')][_0x318a('0x43')]){_0x2f120a[_0x318a('0x44')]=[{'all':!![]}];}_0x2f120a=_[_0x318a('0x3d')]({},_0x2f120a,_0x5d90ef[_0x318a('0x45')]);return db[_0x318a('0x2c')][_0x318a('0x46')](_0x2f120a)['then'](handleEntityNotFound(_0x12fb48,null))[_0x318a('0x3e')](respondWithResult(_0x12fb48,null))[_0x318a('0x3f')](handleError(_0x12fb48,null));};exports['create']=function(_0x2f910d,_0xc1a9a7){return db[_0x318a('0x2c')][_0x318a('0x47')](_0x2f910d[_0x318a('0x48')],{})[_0x318a('0x3e')](respondWithResult(_0xc1a9a7,0xc9))[_0x318a('0x3f')](handleError(_0xc1a9a7,null));};exports[_0x318a('0x24')]=function(_0x506d69,_0x552ec2){if(_0x506d69[_0x318a('0x48')]['id']){delete _0x506d69[_0x318a('0x48')]['id'];}return db[_0x318a('0x2c')][_0x318a('0x46')]({'where':{'id':_0x506d69[_0x318a('0x49')]['id']}})[_0x318a('0x3e')](handleEntityNotFound(_0x552ec2,null))[_0x318a('0x3e')](saveUpdates(_0x506d69[_0x318a('0x48')],null))['then'](respondWithResult(_0x552ec2,null))[_0x318a('0x3f')](handleError(_0x552ec2,null));};exports['destroy']=function(_0x56f7bb,_0x3d841e){return db[_0x318a('0x2c')][_0x318a('0x46')]({'where':{'id':_0x56f7bb['params']['id']}})[_0x318a('0x3e')](handleEntityNotFound(_0x3d841e,null))[_0x318a('0x3e')](removeEntity(_0x3d841e,null))['catch'](handleError(_0x3d841e,null));};exports[_0x318a('0x4a')]=function(_0x3028c0,_0x2f12fe){return db[_0x318a('0x2c')][_0x318a('0x4a')]()['then'](respondWithResult(_0x2f12fe,null))['catch'](handleError(_0x2f12fe,null));}; \ No newline at end of file +var _0x593f=['map','rawAttributes','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','SquareDetailsReport','count','includeAll','include','findAll','catch','show','params','keys','length','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','update','then','destroy','error','stack','name','send'];(function(_0x4dcd24,_0x540cef){var _0x151132=function(_0x21b095){while(--_0x21b095){_0x4dcd24['push'](_0x4dcd24['shift']());}};_0x151132(++_0x540cef);}(_0x593f,0xb7));var _0xf593=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x593f[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf593('0x0'));var zipdir=require(_0xf593('0x1'));var jsonpatch=require(_0xf593('0x2'));var rp=require(_0xf593('0x3'));var moment=require('moment');var BPromise=require(_0xf593('0x4'));var Mustache=require('mustache');var util=require(_0xf593('0x5'));var path=require(_0xf593('0x6'));var sox=require(_0xf593('0x7'));var csv=require(_0xf593('0x8'));var ejs=require(_0xf593('0x9'));var fs=require('fs');var fs_extra=require(_0xf593('0xa'));var _=require(_0xf593('0xb'));var squel=require(_0xf593('0xc'));var crypto=require(_0xf593('0xd'));var jsforce=require(_0xf593('0xe'));var deskjs=require(_0xf593('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf593('0x10'));var Redis=require(_0xf593('0x11'));var authService=require(_0xf593('0x12'));var qs=require(_0xf593('0x13'));var as=require(_0xf593('0x14'));var hardwareService=require(_0xf593('0x15'));var logger=require(_0xf593('0x16'))(_0xf593('0x17'));var utils=require(_0xf593('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xf593('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59cc27,_0x4bdb33){_0x4bdb33=_0x4bdb33||0xcc;return function(_0x295fe8){if(_0x295fe8){return _0x59cc27[_0xf593('0x1a')](_0x4bdb33);}return _0x59cc27[_0xf593('0x1b')](_0x4bdb33)['end']();};}function respondWithResult(_0x363420,_0x18d0c7){_0x18d0c7=_0x18d0c7||0xc8;return function(_0x4f8bdd){if(_0x4f8bdd){return _0x363420[_0xf593('0x1b')](_0x18d0c7)[_0xf593('0x1c')](_0x4f8bdd);}};}function respondWithFilteredResult(_0x20f869,_0x2b985e){return function(_0x4f43d2){if(_0x4f43d2){var _0x64a332=typeof _0x2b985e[_0xf593('0x1d')]===_0xf593('0x1e')&&typeof _0x2b985e[_0xf593('0x1f')]===_0xf593('0x1e');var _0x154d8f=_0x4f43d2['count'];var _0x119f73=_0x64a332?0x0:_0x2b985e['offset'];var _0x1d368=_0x64a332?_0x4f43d2['count']:_0x2b985e[_0xf593('0x1d')]+_0x2b985e[_0xf593('0x1f')];var _0x38d434;if(_0x1d368>=_0x154d8f){_0x1d368=_0x154d8f;_0x38d434=0xc8;}else{_0x38d434=0xce;}_0x20f869[_0xf593('0x1b')](_0x38d434);return _0x20f869[_0xf593('0x20')](_0xf593('0x21'),_0x119f73+'-'+_0x1d368+'/'+_0x154d8f)[_0xf593('0x1c')](_0x4f43d2);}return null;};}function patchUpdates(_0x7ea7f){return function(_0x372521){try{jsonpatch[_0xf593('0x22')](_0x372521,_0x7ea7f,!![]);}catch(_0x531fde){return BPromise['reject'](_0x531fde);}return _0x372521['save']();};}function saveUpdates(_0x77ca3e,_0x2c1bd9){return function(_0x56eb63){if(_0x56eb63){return _0x56eb63[_0xf593('0x23')](_0x77ca3e)[_0xf593('0x24')](function(_0x25262b){return _0x25262b;});}return null;};}function removeEntity(_0x1fcb10,_0x33d228){return function(_0x2146c9){if(_0x2146c9){return _0x2146c9[_0xf593('0x25')]()['then'](function(){_0x1fcb10[_0xf593('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x327e4e,_0x102e66){return function(_0x382e6c){if(!_0x382e6c){_0x327e4e['sendStatus'](0x194);}return _0x382e6c;};}function handleError(_0x523380,_0x587126){_0x587126=_0x587126||0x1f4;return function(_0x1cc89f){logger[_0xf593('0x26')](_0x1cc89f[_0xf593('0x27')]);if(_0x1cc89f[_0xf593('0x28')]){delete _0x1cc89f[_0xf593('0x28')];}_0x523380[_0xf593('0x1b')](_0x587126)[_0xf593('0x29')](_0x1cc89f);};}exports['index']=function(_0x33afc9,_0x5aa9f8){var _0x18df67={},_0x15a60f={},_0x4e92f8={'count':0x0,'rows':[]};var _0x3e0911=_[_0xf593('0x2a')](db['SquareDetailsReport'][_0xf593('0x2b')],function(_0x4585f3){return{'name':_0x4585f3['fieldName'],'type':_0x4585f3['type']['key']};});_0x15a60f[_0xf593('0x2c')]=_['map'](_0x3e0911,'name');_0x15a60f[_0xf593('0x2d')]=_['keys'](_0x33afc9['query']);_0x15a60f[_0xf593('0x2e')]=_[_0xf593('0x2f')](_0x15a60f['model'],_0x15a60f[_0xf593('0x2d')]);_0x18df67[_0xf593('0x30')]=_[_0xf593('0x2f')](_0x15a60f[_0xf593('0x2c')],qs[_0xf593('0x31')](_0x33afc9[_0xf593('0x2d')][_0xf593('0x31')]));_0x18df67[_0xf593('0x30')]=_0x18df67[_0xf593('0x30')]['length']?_0x18df67[_0xf593('0x30')]:_0x15a60f[_0xf593('0x2c')];if(!_0x33afc9[_0xf593('0x2d')][_0xf593('0x32')](_0xf593('0x33'))){_0x18df67['limit']=qs[_0xf593('0x1f')](_0x33afc9[_0xf593('0x2d')]['limit']);_0x18df67[_0xf593('0x1d')]=qs['offset'](_0x33afc9[_0xf593('0x2d')][_0xf593('0x1d')]);}_0x18df67[_0xf593('0x34')]=qs['sort'](_0x33afc9[_0xf593('0x2d')][_0xf593('0x35')]);_0x18df67['where']=qs[_0xf593('0x2e')](_[_0xf593('0x36')](_0x33afc9[_0xf593('0x2d')],_0x15a60f[_0xf593('0x2e')]),_0x3e0911);if(_0x33afc9[_0xf593('0x2d')][_0xf593('0x37')]){_0x18df67[_0xf593('0x38')]=_[_0xf593('0x39')](_0x18df67[_0xf593('0x38')],{'$or':_[_0xf593('0x2a')](_0x3e0911,function(_0x1e2cfb){if(_0x1e2cfb[_0xf593('0x3a')]!==_0xf593('0x3b')){var _0x219eb7={};_0x219eb7[_0x1e2cfb['name']]={'$like':'%'+_0x33afc9[_0xf593('0x2d')][_0xf593('0x37')]+'%'};return _0x219eb7;}})});}_0x18df67=_[_0xf593('0x39')]({},_0x18df67,_0x33afc9[_0xf593('0x3c')]);var _0x18d36a={'where':_0x18df67[_0xf593('0x38')]};return db[_0xf593('0x3d')][_0xf593('0x3e')](_0x18d36a)[_0xf593('0x24')](function(_0x2eafbe){_0x4e92f8['count']=_0x2eafbe;if(_0x33afc9[_0xf593('0x2d')][_0xf593('0x3f')]){_0x18df67[_0xf593('0x40')]=[{'all':!![]}];}return db[_0xf593('0x3d')][_0xf593('0x41')](_0x18df67);})[_0xf593('0x24')](function(_0x1593ed){_0x4e92f8['rows']=_0x1593ed;return _0x4e92f8;})[_0xf593('0x24')](respondWithFilteredResult(_0x5aa9f8,_0x18df67))[_0xf593('0x42')](handleError(_0x5aa9f8,null));};exports[_0xf593('0x43')]=function(_0x10bcfd,_0x3e9bfa){var _0x13b5b3={'raw':!![],'where':{'id':_0x10bcfd[_0xf593('0x44')]['id']}},_0x72924d={};_0x72924d[_0xf593('0x2c')]=_[_0xf593('0x45')](db[_0xf593('0x3d')][_0xf593('0x2b')]);_0x72924d[_0xf593('0x2d')]=_[_0xf593('0x45')](_0x10bcfd[_0xf593('0x2d')]);_0x72924d['filters']=_['intersection'](_0x72924d[_0xf593('0x2c')],_0x72924d[_0xf593('0x2d')]);_0x13b5b3[_0xf593('0x30')]=_[_0xf593('0x2f')](_0x72924d[_0xf593('0x2c')],qs['fields'](_0x10bcfd[_0xf593('0x2d')][_0xf593('0x31')]));_0x13b5b3[_0xf593('0x30')]=_0x13b5b3[_0xf593('0x30')][_0xf593('0x46')]?_0x13b5b3[_0xf593('0x30')]:_0x72924d['model'];if(_0x10bcfd[_0xf593('0x2d')][_0xf593('0x3f')]){_0x13b5b3[_0xf593('0x40')]=[{'all':!![]}];}_0x13b5b3=_[_0xf593('0x39')]({},_0x13b5b3,_0x10bcfd[_0xf593('0x3c')]);return db[_0xf593('0x3d')][_0xf593('0x47')](_0x13b5b3)[_0xf593('0x24')](handleEntityNotFound(_0x3e9bfa,null))[_0xf593('0x24')](respondWithResult(_0x3e9bfa,null))['catch'](handleError(_0x3e9bfa,null));};exports['create']=function(_0x49f816,_0x19638a){return db[_0xf593('0x3d')][_0xf593('0x48')](_0x49f816[_0xf593('0x49')],{})[_0xf593('0x24')](respondWithResult(_0x19638a,0xc9))[_0xf593('0x42')](handleError(_0x19638a,null));};exports[_0xf593('0x23')]=function(_0x1658a2,_0x41a7fc){if(_0x1658a2[_0xf593('0x49')]['id']){delete _0x1658a2['body']['id'];}return db[_0xf593('0x3d')][_0xf593('0x47')]({'where':{'id':_0x1658a2[_0xf593('0x44')]['id']}})[_0xf593('0x24')](handleEntityNotFound(_0x41a7fc,null))[_0xf593('0x24')](saveUpdates(_0x1658a2[_0xf593('0x49')],null))[_0xf593('0x24')](respondWithResult(_0x41a7fc,null))[_0xf593('0x42')](handleError(_0x41a7fc,null));};exports[_0xf593('0x25')]=function(_0x10f203,_0xe7e32b){return db[_0xf593('0x3d')][_0xf593('0x47')]({'where':{'id':_0x10f203[_0xf593('0x44')]['id']}})[_0xf593('0x24')](handleEntityNotFound(_0xe7e32b,null))[_0xf593('0x24')](removeEntity(_0xe7e32b,null))[_0xf593('0x42')](handleError(_0xe7e32b,null));};exports[_0xf593('0x4a')]=function(_0x4315a6,_0xa7e891){return db[_0xf593('0x3d')][_0xf593('0x4a')]()[_0xf593('0x24')](respondWithResult(_0xa7e891,null))[_0xf593('0x42')](handleError(_0xa7e891,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index f0bc186..d12194f 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 _0x3e4e=['../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x3037b9,_0x3f8911){var _0x365d87=function(_0x3971a8){while(--_0x3971a8){_0x3037b9['push'](_0x3037b9['shift']());}};_0x365d87(++_0x3f8911);}(_0x3e4e,0x95));var _0xe3e4=function(_0x607d5d,_0x3b1196){_0x607d5d=_0x607d5d-0x0;var _0x1e4886=_0x3e4e[_0x607d5d];return _0x1e4886;};'use strict';var _=require(_0xe3e4('0x0'));var util=require(_0xe3e4('0x1'));var logger=require('../../config/logger')(_0xe3e4('0x2'));var moment=require(_0xe3e4('0x3'));var BPromise=require(_0xe3e4('0x4'));var rp=require(_0xe3e4('0x5'));var fs=require('fs');var path=require(_0xe3e4('0x6'));var rimraf=require('rimraf');var config=require(_0xe3e4('0x7'));var attributes=require(_0xe3e4('0x8'));module[_0xe3e4('0x9')]=function(_0x5d8987,_0x54ccd6){return _0x5d8987[_0xe3e4('0xa')](_0xe3e4('0xb'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3ece=['rimraf','../../config/environment','define','SquareDetailsReport','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x3ece,0x1c7));var _0xe3ec=function(_0x3a2ca6,_0x49c603){_0x3a2ca6=_0x3a2ca6-0x0;var _0x9300da=_0x3ece[_0x3a2ca6];return _0x9300da;};'use strict';var _=require(_0xe3ec('0x0'));var util=require('util');var logger=require(_0xe3ec('0x1'))(_0xe3ec('0x2'));var moment=require(_0xe3ec('0x3'));var BPromise=require(_0xe3ec('0x4'));var rp=require(_0xe3ec('0x5'));var fs=require('fs');var path=require(_0xe3ec('0x6'));var rimraf=require(_0xe3ec('0x7'));var config=require(_0xe3ec('0x8'));var attributes=require('./squareReportDetail.attributes');module['exports']=function(_0x4a18df,_0x170556){return _0x4a18df[_0xe3ec('0x9')](_0xe3ec('0xa'),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 db7e12f..0af6090 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 _0x6f2f=['ioredis','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','code','error','SquareDetailsReport,\x20%s,\x20%s','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','options','raw','stringify','lodash','util'];(function(_0x125c11,_0xca5cbb){var _0x32a911=function(_0x2bbf45){while(--_0x2bbf45){_0x125c11['push'](_0x125c11['shift']());}};_0x32a911(++_0xca5cbb);}(_0x6f2f,0xbe));var _0xf6f2=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x6f2f[_0x18ab2a];return _0x16dcee;};'use strict';var _=require(_0xf6f2('0x0'));var util=require(_0xf6f2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf6f2('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf6f2('0x3'))(_0xf6f2('0x4'));var config=require(_0xf6f2('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf6f2('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1c94ad,_0x26cd28,_0x774922){return new BPromise(function(_0x15a71c,_0x1873c8){return client[_0xf6f2('0x7')](_0x1c94ad,_0x774922)[_0xf6f2('0x8')](function(_0x294a85){logger[_0xf6f2('0x9')]('SquareDetailsReport,\x20%s,\x20%s',_0x26cd28,_0xf6f2('0xa'));logger[_0xf6f2('0xb')](_0xf6f2('0xc'),_0x26cd28,_0xf6f2('0xa'),JSON['stringify'](_0x294a85));if(_0x294a85['error']){if(_0x294a85['error'][_0xf6f2('0xd')]===0x1f4){logger[_0xf6f2('0xe')](_0xf6f2('0xf'),_0x26cd28,_0x294a85[_0xf6f2('0xe')][_0xf6f2('0x10')]);return _0x1873c8(_0x294a85[_0xf6f2('0xe')]['message']);}logger[_0xf6f2('0xe')](_0xf6f2('0xf'),_0x26cd28,_0x294a85[_0xf6f2('0xe')][_0xf6f2('0x10')]);return _0x15a71c(_0x294a85[_0xf6f2('0xe')]['message']);}else{logger[_0xf6f2('0x9')](_0xf6f2('0xf'),_0x26cd28,_0xf6f2('0xa'));_0x15a71c(_0x294a85[_0xf6f2('0x11')][_0xf6f2('0x10')]);}})[_0xf6f2('0x12')](function(_0x17dec3){logger[_0xf6f2('0xe')](_0xf6f2('0xf'),_0x26cd28,_0x17dec3);_0x1873c8(_0x17dec3);});});}exports[_0xf6f2('0x13')]=function(_0x400055){var _0x506b3=this;return new Promise(function(_0x42b93b,_0x1b11ea){return db[_0xf6f2('0x14')]['create'](_0x400055['body'],{'raw':_0x400055[_0xf6f2('0x15')]?_0x400055['options'][_0xf6f2('0x16')]===undefined?!![]:![]:!![]})[_0xf6f2('0x8')](function(_0x312429){logger[_0xf6f2('0x9')]('CreateSquareDetailsReport',_0x400055);logger[_0xf6f2('0xb')](_0xf6f2('0x13'),_0x400055,JSON[_0xf6f2('0x17')](_0x312429));_0x42b93b(_0x312429);})[_0xf6f2('0x12')](function(_0x5dce4f){logger[_0xf6f2('0xe')]('CreateSquareDetailsReport',_0x5dce4f[_0xf6f2('0x10')],_0x400055);_0x1b11ea(_0x506b3['error'](0x1f4,_0x5dce4f[_0xf6f2('0x10')]));});});}; \ No newline at end of file +var _0xe9e8=['info','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','SquareDetailsReport','create','body','options','then','CreateSquareDetailsReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0xe9e8,0x6b));var _0x8e9e=function(_0x389103,_0x37ffa0){_0x389103=_0x389103-0x0;var _0x51645f=_0xe9e8[_0x389103];return _0x51645f;};'use strict';var _=require(_0x8e9e('0x0'));var util=require(_0x8e9e('0x1'));var moment=require(_0x8e9e('0x2'));var BPromise=require(_0x8e9e('0x3'));var rs=require(_0x8e9e('0x4'));var fs=require('fs');var Redis=require(_0x8e9e('0x5'));var db=require(_0x8e9e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8e9e('0x7'))(_0x8e9e('0x8'));var config=require(_0x8e9e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8e9e('0xa')][_0x8e9e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x204f5c,_0x1fb8d3,_0x58f822){return new BPromise(function(_0x3b5d21,_0x2ae896){return client[_0x8e9e('0xc')](_0x204f5c,_0x58f822)['then'](function(_0x39f5e5){logger[_0x8e9e('0xd')](_0x8e9e('0xe'),_0x1fb8d3,'request\x20sent');logger[_0x8e9e('0xf')](_0x8e9e('0x10'),_0x1fb8d3,_0x8e9e('0x11'),JSON[_0x8e9e('0x12')](_0x39f5e5));if(_0x39f5e5[_0x8e9e('0x13')]){if(_0x39f5e5[_0x8e9e('0x13')][_0x8e9e('0x14')]===0x1f4){logger['error'](_0x8e9e('0xe'),_0x1fb8d3,_0x39f5e5['error'][_0x8e9e('0x15')]);return _0x2ae896(_0x39f5e5[_0x8e9e('0x13')][_0x8e9e('0x15')]);}logger[_0x8e9e('0x13')](_0x8e9e('0xe'),_0x1fb8d3,_0x39f5e5[_0x8e9e('0x13')][_0x8e9e('0x15')]);return _0x3b5d21(_0x39f5e5['error']['message']);}else{logger[_0x8e9e('0xd')](_0x8e9e('0xe'),_0x1fb8d3,'request\x20sent');_0x3b5d21(_0x39f5e5[_0x8e9e('0x16')][_0x8e9e('0x15')]);}})[_0x8e9e('0x17')](function(_0x22b2c7){logger[_0x8e9e('0x13')]('SquareDetailsReport,\x20%s,\x20%s',_0x1fb8d3,_0x22b2c7);_0x2ae896(_0x22b2c7);});});}exports['CreateSquareDetailsReport']=function(_0x42f8e8){var _0x40f4fd=this;return new Promise(function(_0x41cdc0,_0x28584b){return db[_0x8e9e('0x18')][_0x8e9e('0x19')](_0x42f8e8[_0x8e9e('0x1a')],{'raw':_0x42f8e8['options']?_0x42f8e8[_0x8e9e('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x8e9e('0x1c')](function(_0x19a890){logger['info'](_0x8e9e('0x1d'),_0x42f8e8);logger[_0x8e9e('0xf')](_0x8e9e('0x1d'),_0x42f8e8,JSON[_0x8e9e('0x12')](_0x19a890));_0x41cdc0(_0x19a890);})[_0x8e9e('0x17')](function(_0x6a311b){logger[_0x8e9e('0x13')](_0x8e9e('0x1d'),_0x6a311b['message'],_0x42f8e8);_0x28584b(_0x40f4fd['error'](0x1f4,_0x6a311b[_0x8e9e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 0d3abe4..e086e9b 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 _0xeeaa=['killProcess','../../components/auth/service','./system.controller','get','isAuthenticated','index','/process/:pid/kill'];(function(_0x2050aa,_0x2e48ea){var _0x5b03bd=function(_0x16ee1){while(--_0x16ee1){_0x2050aa['push'](_0x2050aa['shift']());}};_0x5b03bd(++_0x2e48ea);}(_0xeeaa,0x112));var _0xaeea=function(_0x4781bd,_0x1a8dc4){_0x4781bd=_0x4781bd-0x0;var _0x308a66=_0xeeaa[_0x4781bd];return _0x308a66;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xaeea('0x0'));var controller=require(_0xaeea('0x1'));router[_0xaeea('0x2')]('/',auth[_0xaeea('0x3')](),controller[_0xaeea('0x4')]);router[_0xaeea('0x2')](_0xaeea('0x5'),auth[_0xaeea('0x3')](),controller[_0xaeea('0x6')]);module['exports']=router; \ No newline at end of file +var _0xc50e=['killProcess','Router','../../components/auth/service','get','index','/process/:pid/kill','isAuthenticated'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xc50e,0x13c));var _0xec50=function(_0xa3339f,_0x21edf6){_0xa3339f=_0xa3339f-0x0;var _0xacaa1c=_0xc50e[_0xa3339f];return _0xacaa1c;};'use strict';var express=require('express');var router=express[_0xec50('0x0')]();var auth=require(_0xec50('0x1'));var controller=require('./system.controller');router[_0xec50('0x2')]('/',auth['isAuthenticated'](),controller[_0xec50('0x3')]);router['get'](_0xec50('0x4'),auth[_0xec50('0x5')](),controller[_0xec50('0x6')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 06b78dc..03e82b9 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 _0xcaf9=['index','getAllData','then','json','catch','killProcess','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','indexOf','kill','SIGINT','systeminformation','child_process','../../config/logger','api','util','lodash','error','status','send'];(function(_0x116071,_0x3a8688){var _0x1fcb0f=function(_0x405202){while(--_0x405202){_0x116071['push'](_0x116071['shift']());}};_0x1fcb0f(++_0x3a8688);}(_0xcaf9,0xc6));var _0x9caf=function(_0x2603ed,_0x5a977c){_0x2603ed=_0x2603ed-0x0;var _0x132089=_0xcaf9[_0x2603ed];return _0x132089;};'use strict';var info=require(_0x9caf('0x0'));var exec=require(_0x9caf('0x1'))['exec'];var logger=require(_0x9caf('0x2'))(_0x9caf('0x3'));var util=require(_0x9caf('0x4'));var BPromise=require('bluebird');var _=require(_0x9caf('0x5'));function handleError(_0x27eb00,_0x11564e,_0x346d00){_0x11564e=_0x11564e||0x1f4;return function(_0x2f201b){logger[_0x9caf('0x6')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x346d00,_0x11564e,util['inspect'](_0x2f201b,{'showHidden':![],'depth':null}));delete _0x2f201b['name'];_0x27eb00[_0x9caf('0x7')](_0x11564e)[_0x9caf('0x8')](_0x2f201b);};}exports[_0x9caf('0x9')]=function(_0x398512,_0x30bb3c){return info[_0x9caf('0xa')]()[_0x9caf('0xb')](function(_0x2dbace){return _0x30bb3c[_0x9caf('0x7')](0xc8)[_0x9caf('0xc')](_0x2dbace);})[_0x9caf('0xd')](function(_0x4dbd61){return _0x30bb3c['status'](0x1f4)[_0x9caf('0xc')](_0x4dbd61);});};exports[_0x9caf('0xe')]=function(_0x5e8669,_0x2825c0){var _0x2d11fb=['components/import/cm'];return new BPromise(function(_0x2e7714,_0x4e8dcd){return exec(util[_0x9caf('0xf')](_0x9caf('0x10'),_0x5e8669[_0x9caf('0x11')][_0x9caf('0x12')]),function(_0x38b334,_0x127529,_0x3188fa){if(_0x38b334){return _0x4e8dcd(_0x38b334);}return _0x2e7714(_0x127529);});})['then'](function(_0x392380){var _0x5db3b6=![];var _0x25f68c=_0x392380[_0x9caf('0x13')](/\n/);for(var _0x2093f5=0x0,_0x40e6dc=_0x2d11fb['length'];_0x2093f5<_0x40e6dc,_0x5db3b6===![];_0x2093f5+=0x1){if(_0x392380[_0x9caf('0x14')](_0x2d11fb[_0x2093f5])>=0x0){_0x5db3b6=!![];}}if(!_0x5db3b6){throw new Error(util[_0x9caf('0xf')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x5e8669[_0x9caf('0x11')][_0x9caf('0x12')]));}process[_0x9caf('0x15')](_0x5e8669['params'][_0x9caf('0x12')],_0x9caf('0x16'));return _0x2825c0['status'](0xc8)[_0x9caf('0xc')]({'message':util['format']('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x5e8669[_0x9caf('0x11')][_0x9caf('0x12')])});})['catch'](handleError(_0x2825c0,null,_0x9caf('0xe')));}; \ No newline at end of file +var _0xcff7=['systeminformation','child_process','exec','../../config/logger','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','status','then','catch','json','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess'];(function(_0x4ea396,_0x11ecb9){var _0x56d04f=function(_0x53a871){while(--_0x53a871){_0x4ea396['push'](_0x4ea396['shift']());}};_0x56d04f(++_0x11ecb9);}(_0xcff7,0xc8));var _0x7cff=function(_0x3aee96,_0x579383){_0x3aee96=_0x3aee96-0x0;var _0x59c37b=_0xcff7[_0x3aee96];return _0x59c37b;};'use strict';var info=require(_0x7cff('0x0'));var exec=require(_0x7cff('0x1'))[_0x7cff('0x2')];var logger=require(_0x7cff('0x3'))('api');var util=require(_0x7cff('0x4'));var BPromise=require(_0x7cff('0x5'));var _=require(_0x7cff('0x6'));function handleError(_0x30eae1,_0x24cfe9,_0x4bdd8a){_0x24cfe9=_0x24cfe9||0x1f4;return function(_0x176013){logger[_0x7cff('0x7')](_0x7cff('0x8'),_0x4bdd8a,_0x24cfe9,util['inspect'](_0x176013,{'showHidden':![],'depth':null}));delete _0x176013['name'];_0x30eae1[_0x7cff('0x9')](_0x24cfe9)['send'](_0x176013);};}exports['index']=function(_0x32a6e1,_0x50ad4f){return info['getAllData']()[_0x7cff('0xa')](function(_0x3e111e){return _0x50ad4f['status'](0xc8)['json'](_0x3e111e);})[_0x7cff('0xb')](function(_0x11dc3e){return _0x50ad4f['status'](0x1f4)[_0x7cff('0xc')](_0x11dc3e);});};exports['killProcess']=function(_0x4077c5,_0x49547e){var _0x1a04bc=[_0x7cff('0xd')];return new BPromise(function(_0x191d0b,_0x45329b){return exec(util[_0x7cff('0xe')](_0x7cff('0xf'),_0x4077c5[_0x7cff('0x10')][_0x7cff('0x11')]),function(_0x547d54,_0x515765,_0x43ef28){if(_0x547d54){return _0x45329b(_0x547d54);}return _0x191d0b(_0x515765);});})[_0x7cff('0xa')](function(_0x1ae4ae){var _0x5b1ad1=![];var _0x480a7a=_0x1ae4ae[_0x7cff('0x12')](/\n/);for(var _0x55d436=0x0,_0x454a1a=_0x1a04bc[_0x7cff('0x13')];_0x55d436<_0x454a1a,_0x5b1ad1===![];_0x55d436+=0x1){if(_0x1ae4ae['indexOf'](_0x1a04bc[_0x55d436])>=0x0){_0x5b1ad1=!![];}}if(!_0x5b1ad1){throw new Error(util[_0x7cff('0xe')](_0x7cff('0x14'),_0x4077c5[_0x7cff('0x10')][_0x7cff('0x11')]));}process[_0x7cff('0x15')](_0x4077c5[_0x7cff('0x10')][_0x7cff('0x11')],_0x7cff('0x16'));return _0x49547e['status'](0xc8)[_0x7cff('0xc')]({'message':util['format'](_0x7cff('0x17'),_0x4077c5[_0x7cff('0x10')]['pid'])});})['catch'](handleError(_0x49547e,null,_0x7cff('0x18')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 47e299b..8123021 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 _0xf944=['create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./tag.controller','isAuthenticated','index','get','/:id','show','post'];(function(_0x2ea41,_0x4f807b){var _0x8ee23b=function(_0x2e5fd8){while(--_0x2e5fd8){_0x2ea41['push'](_0x2ea41['shift']());}};_0x8ee23b(++_0x4f807b);}(_0xf944,0x1a9));var _0x4f94=function(_0x1f02bf,_0xe800e7){_0x1f02bf=_0x1f02bf-0x0;var _0x5ada8d=_0xf944[_0x1f02bf];return _0x5ada8d;};'use strict';var multer=require(_0x4f94('0x0'));var util=require(_0x4f94('0x1'));var path=require('path');var timeout=require(_0x4f94('0x2'));var express=require(_0x4f94('0x3'));var router=express[_0x4f94('0x4')]();var fs_extra=require(_0x4f94('0x5'));var auth=require(_0x4f94('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4f94('0x7'));var controller=require(_0x4f94('0x8'));router['get']('/',auth[_0x4f94('0x9')](),controller[_0x4f94('0xa')]);router[_0x4f94('0xb')](_0x4f94('0xc'),auth[_0x4f94('0x9')](),controller[_0x4f94('0xd')]);router[_0x4f94('0xe')]('/',auth['isAuthenticated'](),controller[_0x4f94('0xf')]);router[_0x4f94('0x10')](_0x4f94('0xc'),auth[_0x4f94('0x9')](),controller[_0x4f94('0x11')]);router['delete'](_0x4f94('0xc'),auth[_0x4f94('0x9')](),controller[_0x4f94('0x12')]);module[_0x4f94('0x13')]=router; \ No newline at end of file +var _0x5025=['post','create','put','update','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','index','/:id','isAuthenticated'];(function(_0x1da6e8,_0x23634d){var _0x2fc8e7=function(_0xc35f3b){while(--_0xc35f3b){_0x1da6e8['push'](_0x1da6e8['shift']());}};_0x2fc8e7(++_0x23634d);}(_0x5025,0xdc));var _0x5502=function(_0x2e1907,_0x229a70){_0x2e1907=_0x2e1907-0x0;var _0x401555=_0x5025[_0x2e1907];return _0x401555;};'use strict';var multer=require(_0x5502('0x0'));var util=require(_0x5502('0x1'));var path=require(_0x5502('0x2'));var timeout=require(_0x5502('0x3'));var express=require(_0x5502('0x4'));var router=express['Router']();var fs_extra=require(_0x5502('0x5'));var auth=require(_0x5502('0x6'));var interaction=require(_0x5502('0x7'));var config=require(_0x5502('0x8'));var controller=require(_0x5502('0x9'));router[_0x5502('0xa')]('/',auth['isAuthenticated'](),controller[_0x5502('0xb')]);router[_0x5502('0xa')](_0x5502('0xc'),auth[_0x5502('0xd')](),controller['show']);router[_0x5502('0xe')]('/',auth[_0x5502('0xd')](),controller[_0x5502('0xf')]);router[_0x5502('0x10')]('/:id',auth[_0x5502('0xd')](),controller[_0x5502('0x11')]);router['delete'](_0x5502('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 570889a..d776b77 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 _0xba5a=['STRING','name','exports'];(function(_0x402c43,_0x51fbd2){var _0x575fe2=function(_0x2b1658){while(--_0x2b1658){_0x402c43['push'](_0x402c43['shift']());}};_0x575fe2(++_0x51fbd2);}(_0xba5a,0x1d0));var _0xaba5=function(_0x515afd,_0x1a1e91){_0x515afd=_0x515afd-0x0;var _0x536d53=_0xba5a[_0x515afd];return _0x536d53;};'use strict';var Sequelize=require('sequelize');module[_0xaba5('0x0')]={'name':{'type':Sequelize[_0xaba5('0x1')],'unique':_0xaba5('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0xaba5('0x1')]}}; \ No newline at end of file +var _0x2b65=['sequelize','exports','STRING','name','#0091EA'];(function(_0x23be51,_0xc02a1b){var _0x47a26d=function(_0xa92395){while(--_0xa92395){_0x23be51['push'](_0x23be51['shift']());}};_0x47a26d(++_0xc02a1b);}(_0x2b65,0x131));var _0x52b6=function(_0x49ff48,_0x413d68){_0x49ff48=_0x49ff48-0x0;var _0x8ed443=_0x2b65[_0x49ff48];return _0x8ed443;};'use strict';var Sequelize=require(_0x52b6('0x0'));module[_0x52b6('0x1')]={'name':{'type':Sequelize[_0x52b6('0x2')],'unique':_0x52b6('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x52b6('0x2')],'defaultValue':_0x52b6('0x4')},'description':{'type':Sequelize[_0x52b6('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 9c21e54..d29d047 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 _0x3140=['filter','options','count','include','findAll','catch','show','keys','rawAttributes','includeAll','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','Content-Range','apply','update','then','get','Tags','UserProfileResource','error','stack','send','map','Tag','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','name'];(function(_0xb20df8,_0x580f99){var _0xf4614a=function(_0x351914){while(--_0x351914){_0xb20df8['push'](_0xb20df8['shift']());}};_0xf4614a(++_0x580f99);}(_0x3140,0xaf));var _0x0314=function(_0x470e72,_0x532a0e){_0x470e72=_0x470e72-0x0;var _0x3386f9=_0x3140[_0x470e72];return _0x3386f9;};'use strict';var emlformat=require(_0x0314('0x0'));var rimraf=require(_0x0314('0x1'));var zipdir=require(_0x0314('0x2'));var jsonpatch=require(_0x0314('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0314('0x4'));var Mustache=require(_0x0314('0x5'));var util=require(_0x0314('0x6'));var path=require(_0x0314('0x7'));var sox=require(_0x0314('0x8'));var csv=require(_0x0314('0x9'));var ejs=require(_0x0314('0xa'));var fs=require('fs');var fs_extra=require(_0x0314('0xb'));var _=require(_0x0314('0xc'));var squel=require(_0x0314('0xd'));var crypto=require(_0x0314('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0314('0xf'));var toCsv=require(_0x0314('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0314('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0314('0x11'));var as=require(_0x0314('0x12'));var hardwareService=require(_0x0314('0x13'));var logger=require(_0x0314('0x14'))(_0x0314('0x15'));var utils=require(_0x0314('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0314('0x17'));var db=require(_0x0314('0x18'))['db'];function respondWithStatusCode(_0xd85ddf,_0x4602ec){_0x4602ec=_0x4602ec||0xcc;return function(_0x153077){if(_0x153077){return _0xd85ddf[_0x0314('0x19')](_0x4602ec);}return _0xd85ddf[_0x0314('0x1a')](_0x4602ec)['end']();};}function respondWithResult(_0x1c26ff,_0xbe0b07){_0xbe0b07=_0xbe0b07||0xc8;return function(_0x1316a0){if(_0x1316a0){return _0x1c26ff[_0x0314('0x1a')](_0xbe0b07)[_0x0314('0x1b')](_0x1316a0);}};}function respondWithFilteredResult(_0x398c91,_0x413bfa){return function(_0x3ea356){if(_0x3ea356){var _0x5e460f=typeof _0x413bfa[_0x0314('0x1c')]===_0x0314('0x1d')&&typeof _0x413bfa[_0x0314('0x1e')]==='undefined';var _0x6c48cb=_0x3ea356['count'];var _0x575b68=_0x5e460f?0x0:_0x413bfa[_0x0314('0x1c')];var _0x329679=_0x5e460f?_0x3ea356['count']:_0x413bfa[_0x0314('0x1c')]+_0x413bfa[_0x0314('0x1e')];var _0x583ffa;if(_0x329679>=_0x6c48cb){_0x329679=_0x6c48cb;_0x583ffa=0xc8;}else{_0x583ffa=0xce;}_0x398c91[_0x0314('0x1a')](_0x583ffa);return _0x398c91['set'](_0x0314('0x1f'),_0x575b68+'-'+_0x329679+'/'+_0x6c48cb)[_0x0314('0x1b')](_0x3ea356);}return null;};}function patchUpdates(_0x16d273){return function(_0x77ddfd){try{jsonpatch[_0x0314('0x20')](_0x77ddfd,_0x16d273,!![]);}catch(_0xdfad84){return BPromise['reject'](_0xdfad84);}return _0x77ddfd['save']();};}function saveUpdates(_0x20305b,_0xbd3ad0){return function(_0x1945f8){if(_0x1945f8){return _0x1945f8[_0x0314('0x21')](_0x20305b)[_0x0314('0x22')](function(_0xd7638b){return _0xd7638b;});}return null;};}function removeEntity(_0x58a1c9,_0x3c743e){return function(_0x43fb0e){if(_0x43fb0e){return _0x43fb0e['destroy']()[_0x0314('0x22')](function(){var _0xfc4893=_0x43fb0e[_0x0314('0x23')]({'plain':!![]});var _0x26c6a4=_0x0314('0x24');return db[_0x0314('0x25')]['destroy']({'where':{'type':_0x26c6a4,'resourceId':_0xfc4893['id']}})[_0x0314('0x22')](function(){return _0x43fb0e;});})[_0x0314('0x22')](function(){_0x58a1c9[_0x0314('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29b4b5,_0x5e3eba){return function(_0x47c102){if(!_0x47c102){_0x29b4b5['sendStatus'](0x194);}return _0x47c102;};}function handleError(_0x2fc520,_0x21d6a5){_0x21d6a5=_0x21d6a5||0x1f4;return function(_0x550dc4){logger[_0x0314('0x26')](_0x550dc4[_0x0314('0x27')]);if(_0x550dc4['name']){delete _0x550dc4['name'];}_0x2fc520[_0x0314('0x1a')](_0x21d6a5)[_0x0314('0x28')](_0x550dc4);};}exports['index']=function(_0x44adb3,_0x16e74a){var _0x3d6652={},_0x4da71c={},_0x5b82b2={'count':0x0,'rows':[]};var _0x37ab90=_[_0x0314('0x29')](db[_0x0314('0x2a')]['rawAttributes'],function(_0x1d01b5){return{'name':_0x1d01b5['fieldName'],'type':_0x1d01b5['type'][_0x0314('0x2b')]};});_0x4da71c[_0x0314('0x2c')]=_[_0x0314('0x29')](_0x37ab90,'name');_0x4da71c[_0x0314('0x2d')]=_['keys'](_0x44adb3[_0x0314('0x2d')]);_0x4da71c['filters']=_['intersection'](_0x4da71c[_0x0314('0x2c')],_0x4da71c['query']);_0x3d6652[_0x0314('0x2e')]=_[_0x0314('0x2f')](_0x4da71c[_0x0314('0x2c')],qs[_0x0314('0x30')](_0x44adb3[_0x0314('0x2d')][_0x0314('0x30')]));_0x3d6652[_0x0314('0x2e')]=_0x3d6652['attributes'][_0x0314('0x31')]?_0x3d6652[_0x0314('0x2e')]:_0x4da71c[_0x0314('0x2c')];if(!_0x44adb3[_0x0314('0x2d')][_0x0314('0x32')](_0x0314('0x33'))){_0x3d6652['limit']=qs[_0x0314('0x1e')](_0x44adb3['query'][_0x0314('0x1e')]);_0x3d6652['offset']=qs[_0x0314('0x1c')](_0x44adb3['query']['offset']);}_0x3d6652['order']=qs[_0x0314('0x34')](_0x44adb3[_0x0314('0x2d')][_0x0314('0x34')]);_0x3d6652[_0x0314('0x35')]=qs[_0x0314('0x36')](_['pick'](_0x44adb3[_0x0314('0x2d')],_0x4da71c[_0x0314('0x36')]),_0x37ab90);if(_0x44adb3[_0x0314('0x2d')]['filter']){_0x3d6652[_0x0314('0x35')]=_['merge'](_0x3d6652[_0x0314('0x35')],{'$or':_['map'](_0x37ab90,function(_0x24fe65){if(_0x24fe65['type']!=='VIRTUAL'){var _0x370539={};_0x370539[_0x24fe65[_0x0314('0x37')]]={'$like':'%'+_0x44adb3['query'][_0x0314('0x38')]+'%'};return _0x370539;}})});}_0x3d6652=_['merge']({},_0x3d6652,_0x44adb3[_0x0314('0x39')]);var _0x438ddd={'where':_0x3d6652[_0x0314('0x35')]};return db[_0x0314('0x2a')][_0x0314('0x3a')](_0x438ddd)['then'](function(_0x52a71c){_0x5b82b2[_0x0314('0x3a')]=_0x52a71c;if(_0x44adb3[_0x0314('0x2d')]['includeAll']){_0x3d6652[_0x0314('0x3b')]=[{'all':!![]}];}return db[_0x0314('0x2a')][_0x0314('0x3c')](_0x3d6652);})['then'](function(_0x2b328c){_0x5b82b2['rows']=_0x2b328c;return _0x5b82b2;})[_0x0314('0x22')](respondWithFilteredResult(_0x16e74a,_0x3d6652))[_0x0314('0x3d')](handleError(_0x16e74a,null));};exports[_0x0314('0x3e')]=function(_0x583aba,_0xcafd05){var _0xf4c4a1={'raw':!![],'where':{'id':_0x583aba['params']['id']}},_0x588e65={};_0x588e65['model']=_[_0x0314('0x3f')](db[_0x0314('0x2a')][_0x0314('0x40')]);_0x588e65['query']=_[_0x0314('0x3f')](_0x583aba[_0x0314('0x2d')]);_0x588e65[_0x0314('0x36')]=_[_0x0314('0x2f')](_0x588e65[_0x0314('0x2c')],_0x588e65['query']);_0xf4c4a1[_0x0314('0x2e')]=_[_0x0314('0x2f')](_0x588e65[_0x0314('0x2c')],qs[_0x0314('0x30')](_0x583aba[_0x0314('0x2d')][_0x0314('0x30')]));_0xf4c4a1[_0x0314('0x2e')]=_0xf4c4a1['attributes'][_0x0314('0x31')]?_0xf4c4a1[_0x0314('0x2e')]:_0x588e65['model'];if(_0x583aba[_0x0314('0x2d')][_0x0314('0x41')]){_0xf4c4a1[_0x0314('0x3b')]=[{'all':!![]}];}_0xf4c4a1=_['merge']({},_0xf4c4a1,_0x583aba['options']);return db[_0x0314('0x2a')][_0x0314('0x42')](_0xf4c4a1)[_0x0314('0x22')](handleEntityNotFound(_0xcafd05,null))[_0x0314('0x22')](respondWithResult(_0xcafd05,null))[_0x0314('0x3d')](handleError(_0xcafd05,null));};exports[_0x0314('0x43')]=function(_0x36a72a,_0x478b8b){return db[_0x0314('0x2a')]['create'](_0x36a72a[_0x0314('0x44')],{})[_0x0314('0x22')](function(_0x3003dd){var _0x362b60=_0x36a72a[_0x0314('0x45')]['get']({'plain':!![]});if(!_0x362b60)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x362b60[_0x0314('0x46')]===_0x0314('0x45')){var _0x20070c=_0x3003dd[_0x0314('0x23')]({'plain':!![]});var _0x5b3c49=_0x0314('0x24');return db[_0x0314('0x47')][_0x0314('0x42')]({'where':{'name':_0x5b3c49,'userProfileId':_0x362b60[_0x0314('0x48')]},'raw':!![]})[_0x0314('0x22')](function(_0x458bd8){if(_0x458bd8&&_0x458bd8[_0x0314('0x49')]===0x0){return db['UserProfileResource'][_0x0314('0x43')]({'name':_0x20070c[_0x0314('0x37')],'resourceId':_0x20070c['id'],'type':_0x458bd8[_0x0314('0x37')],'sectionId':_0x458bd8['id']},{})['then'](function(){return _0x3003dd;});}else{return _0x3003dd;}})[_0x0314('0x3d')](function(_0x11695d){logger['error'](_0x0314('0x4a'),_0x11695d);throw _0x11695d;});}return _0x3003dd;})[_0x0314('0x22')](respondWithResult(_0x478b8b,0xc9))[_0x0314('0x3d')](handleError(_0x478b8b,null));};exports[_0x0314('0x21')]=function(_0x544a03,_0x39b4c1){if(_0x544a03[_0x0314('0x44')]['id']){delete _0x544a03[_0x0314('0x44')]['id'];}return db[_0x0314('0x2a')][_0x0314('0x42')]({'where':{'id':_0x544a03[_0x0314('0x4b')]['id']}})[_0x0314('0x22')](handleEntityNotFound(_0x39b4c1,null))[_0x0314('0x22')](saveUpdates(_0x544a03[_0x0314('0x44')],null))[_0x0314('0x22')](respondWithResult(_0x39b4c1,null))['catch'](handleError(_0x39b4c1,null));};exports[_0x0314('0x4c')]=function(_0x305568,_0xf29a33){return db[_0x0314('0x2a')][_0x0314('0x42')]({'where':{'id':_0x305568[_0x0314('0x4b')]['id']}})[_0x0314('0x22')](handleEntityNotFound(_0xf29a33,null))['then'](removeEntity(_0xf29a33,null))['catch'](handleError(_0xf29a33,null));}; \ No newline at end of file +var _0x7341=['status','end','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','Tags','UserProfileResource','stack','name','send','index','map','Tag','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','include','findAll','rows','show','params','rawAttributes','includeAll','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus'];(function(_0x5a8936,_0x344f75){var _0x5dbab7=function(_0x4fa9fe){while(--_0x4fa9fe){_0x5a8936['push'](_0x5a8936['shift']());}};_0x5dbab7(++_0x344f75);}(_0x7341,0xe4));var _0x1734=function(_0x440ead,_0x2c878a){_0x440ead=_0x440ead-0x0;var _0x39fb78=_0x7341[_0x440ead];return _0x39fb78;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1734('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1734('0x1'));var moment=require(_0x1734('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x1734('0x3'));var util=require(_0x1734('0x4'));var path=require(_0x1734('0x5'));var sox=require(_0x1734('0x6'));var csv=require(_0x1734('0x7'));var ejs=require(_0x1734('0x8'));var fs=require('fs');var fs_extra=require(_0x1734('0x9'));var _=require('lodash');var squel=require(_0x1734('0xa'));var crypto=require(_0x1734('0xb'));var jsforce=require(_0x1734('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1734('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1734('0xd'));var authService=require(_0x1734('0xe'));var qs=require(_0x1734('0xf'));var as=require(_0x1734('0x10'));var hardwareService=require(_0x1734('0x11'));var logger=require(_0x1734('0x12'))(_0x1734('0x13'));var utils=require(_0x1734('0x14'));var config=require(_0x1734('0x15'));var licenseUtil=require(_0x1734('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4391a1,_0x449ab1){_0x449ab1=_0x449ab1||0xcc;return function(_0x44de07){if(_0x44de07){return _0x4391a1[_0x1734('0x17')](_0x449ab1);}return _0x4391a1[_0x1734('0x18')](_0x449ab1)[_0x1734('0x19')]();};}function respondWithResult(_0x9e7cf5,_0xd2f288){_0xd2f288=_0xd2f288||0xc8;return function(_0xb90c22){if(_0xb90c22){return _0x9e7cf5[_0x1734('0x18')](_0xd2f288)[_0x1734('0x1a')](_0xb90c22);}};}function respondWithFilteredResult(_0x27679e,_0x2162c9){return function(_0x2dd53c){if(_0x2dd53c){var _0x3989a6=typeof _0x2162c9[_0x1734('0x1b')]===_0x1734('0x1c')&&typeof _0x2162c9[_0x1734('0x1d')]===_0x1734('0x1c');var _0x56756c=_0x2dd53c['count'];var _0x1fa9c0=_0x3989a6?0x0:_0x2162c9[_0x1734('0x1b')];var _0x4a86d1=_0x3989a6?_0x2dd53c[_0x1734('0x1e')]:_0x2162c9['offset']+_0x2162c9['limit'];var _0x5b2789;if(_0x4a86d1>=_0x56756c){_0x4a86d1=_0x56756c;_0x5b2789=0xc8;}else{_0x5b2789=0xce;}_0x27679e[_0x1734('0x18')](_0x5b2789);return _0x27679e['set'](_0x1734('0x1f'),_0x1fa9c0+'-'+_0x4a86d1+'/'+_0x56756c)[_0x1734('0x1a')](_0x2dd53c);}return null;};}function patchUpdates(_0x4fc4ed){return function(_0x54b1bd){try{jsonpatch['apply'](_0x54b1bd,_0x4fc4ed,!![]);}catch(_0x1e7401){return BPromise['reject'](_0x1e7401);}return _0x54b1bd[_0x1734('0x20')]();};}function saveUpdates(_0x5ad801,_0x215ae4){return function(_0x42485f){if(_0x42485f){return _0x42485f[_0x1734('0x21')](_0x5ad801)[_0x1734('0x22')](function(_0x29bb2c){return _0x29bb2c;});}return null;};}function removeEntity(_0x45593e,_0x4285ee){return function(_0x44e420){if(_0x44e420){return _0x44e420[_0x1734('0x23')]()['then'](function(){var _0x34ac29=_0x44e420['get']({'plain':!![]});var _0x5e0023=_0x1734('0x24');return db[_0x1734('0x25')][_0x1734('0x23')]({'where':{'type':_0x5e0023,'resourceId':_0x34ac29['id']}})[_0x1734('0x22')](function(){return _0x44e420;});})[_0x1734('0x22')](function(){_0x45593e[_0x1734('0x18')](0xcc)[_0x1734('0x19')]();});}};}function handleEntityNotFound(_0x27d6e5,_0x4a670a){return function(_0x381960){if(!_0x381960){_0x27d6e5['sendStatus'](0x194);}return _0x381960;};}function handleError(_0x17e068,_0x16a35f){_0x16a35f=_0x16a35f||0x1f4;return function(_0xfca2ad){logger['error'](_0xfca2ad[_0x1734('0x26')]);if(_0xfca2ad[_0x1734('0x27')]){delete _0xfca2ad[_0x1734('0x27')];}_0x17e068['status'](_0x16a35f)[_0x1734('0x28')](_0xfca2ad);};}exports[_0x1734('0x29')]=function(_0x5594c0,_0x1bd659){var _0x419e75={},_0x1b2d85={},_0xf3d22e={'count':0x0,'rows':[]};var _0x4f4d92=_[_0x1734('0x2a')](db[_0x1734('0x2b')]['rawAttributes'],function(_0x4dd04a){return{'name':_0x4dd04a[_0x1734('0x2c')],'type':_0x4dd04a[_0x1734('0x2d')][_0x1734('0x2e')]};});_0x1b2d85[_0x1734('0x2f')]=_[_0x1734('0x2a')](_0x4f4d92,_0x1734('0x27'));_0x1b2d85[_0x1734('0x30')]=_[_0x1734('0x31')](_0x5594c0[_0x1734('0x30')]);_0x1b2d85[_0x1734('0x32')]=_[_0x1734('0x33')](_0x1b2d85[_0x1734('0x2f')],_0x1b2d85[_0x1734('0x30')]);_0x419e75[_0x1734('0x34')]=_[_0x1734('0x33')](_0x1b2d85[_0x1734('0x2f')],qs[_0x1734('0x35')](_0x5594c0['query'][_0x1734('0x35')]));_0x419e75['attributes']=_0x419e75[_0x1734('0x34')][_0x1734('0x36')]?_0x419e75[_0x1734('0x34')]:_0x1b2d85[_0x1734('0x2f')];if(!_0x5594c0[_0x1734('0x30')][_0x1734('0x37')](_0x1734('0x38'))){_0x419e75[_0x1734('0x1d')]=qs['limit'](_0x5594c0[_0x1734('0x30')][_0x1734('0x1d')]);_0x419e75[_0x1734('0x1b')]=qs[_0x1734('0x1b')](_0x5594c0[_0x1734('0x30')][_0x1734('0x1b')]);}_0x419e75[_0x1734('0x39')]=qs['sort'](_0x5594c0[_0x1734('0x30')][_0x1734('0x3a')]);_0x419e75[_0x1734('0x3b')]=qs[_0x1734('0x32')](_[_0x1734('0x3c')](_0x5594c0[_0x1734('0x30')],_0x1b2d85[_0x1734('0x32')]),_0x4f4d92);if(_0x5594c0[_0x1734('0x30')]['filter']){_0x419e75[_0x1734('0x3b')]=_['merge'](_0x419e75[_0x1734('0x3b')],{'$or':_[_0x1734('0x2a')](_0x4f4d92,function(_0x4ee569){if(_0x4ee569[_0x1734('0x2d')]!==_0x1734('0x3d')){var _0x169db8={};_0x169db8[_0x4ee569[_0x1734('0x27')]]={'$like':'%'+_0x5594c0[_0x1734('0x30')][_0x1734('0x3e')]+'%'};return _0x169db8;}})});}_0x419e75=_[_0x1734('0x3f')]({},_0x419e75,_0x5594c0[_0x1734('0x40')]);var _0x55d67c={'where':_0x419e75[_0x1734('0x3b')]};return db[_0x1734('0x2b')][_0x1734('0x1e')](_0x55d67c)[_0x1734('0x22')](function(_0x5f34e1){_0xf3d22e[_0x1734('0x1e')]=_0x5f34e1;if(_0x5594c0['query']['includeAll']){_0x419e75[_0x1734('0x41')]=[{'all':!![]}];}return db[_0x1734('0x2b')][_0x1734('0x42')](_0x419e75);})[_0x1734('0x22')](function(_0x4fc418){_0xf3d22e[_0x1734('0x43')]=_0x4fc418;return _0xf3d22e;})[_0x1734('0x22')](respondWithFilteredResult(_0x1bd659,_0x419e75))['catch'](handleError(_0x1bd659,null));};exports[_0x1734('0x44')]=function(_0x1b104a,_0x55954e){var _0x17f282={'raw':!![],'where':{'id':_0x1b104a[_0x1734('0x45')]['id']}},_0x4bfc67={};_0x4bfc67[_0x1734('0x2f')]=_[_0x1734('0x31')](db[_0x1734('0x2b')][_0x1734('0x46')]);_0x4bfc67[_0x1734('0x30')]=_[_0x1734('0x31')](_0x1b104a['query']);_0x4bfc67[_0x1734('0x32')]=_[_0x1734('0x33')](_0x4bfc67['model'],_0x4bfc67[_0x1734('0x30')]);_0x17f282[_0x1734('0x34')]=_[_0x1734('0x33')](_0x4bfc67[_0x1734('0x2f')],qs['fields'](_0x1b104a[_0x1734('0x30')][_0x1734('0x35')]));_0x17f282[_0x1734('0x34')]=_0x17f282['attributes'][_0x1734('0x36')]?_0x17f282[_0x1734('0x34')]:_0x4bfc67[_0x1734('0x2f')];if(_0x1b104a[_0x1734('0x30')][_0x1734('0x47')]){_0x17f282[_0x1734('0x41')]=[{'all':!![]}];}_0x17f282=_[_0x1734('0x3f')]({},_0x17f282,_0x1b104a[_0x1734('0x40')]);return db[_0x1734('0x2b')][_0x1734('0x48')](_0x17f282)[_0x1734('0x22')](handleEntityNotFound(_0x55954e,null))[_0x1734('0x22')](respondWithResult(_0x55954e,null))[_0x1734('0x49')](handleError(_0x55954e,null));};exports[_0x1734('0x4a')]=function(_0x470110,_0x121c8c){return db[_0x1734('0x2b')][_0x1734('0x4a')](_0x470110['body'],{})[_0x1734('0x22')](function(_0x50e12d){var _0xfc42f3=_0x470110[_0x1734('0x4b')][_0x1734('0x4c')]({'plain':!![]});if(!_0xfc42f3)throw new Error(_0x1734('0x4d'));if(_0xfc42f3['role']==='user'){var _0x294097=_0x50e12d[_0x1734('0x4c')]({'plain':!![]});var _0x518ef4=_0x1734('0x24');return db[_0x1734('0x4e')][_0x1734('0x48')]({'where':{'name':_0x518ef4,'userProfileId':_0xfc42f3[_0x1734('0x4f')]},'raw':!![]})[_0x1734('0x22')](function(_0x1394bd){if(_0x1394bd&&_0x1394bd[_0x1734('0x50')]===0x0){return db['UserProfileResource'][_0x1734('0x4a')]({'name':_0x294097[_0x1734('0x27')],'resourceId':_0x294097['id'],'type':_0x1394bd[_0x1734('0x27')],'sectionId':_0x1394bd['id']},{})['then'](function(){return _0x50e12d;});}else{return _0x50e12d;}})[_0x1734('0x49')](function(_0x6b6fef){logger[_0x1734('0x51')](_0x1734('0x52'),_0x6b6fef);throw _0x6b6fef;});}return _0x50e12d;})['then'](respondWithResult(_0x121c8c,0xc9))[_0x1734('0x49')](handleError(_0x121c8c,null));};exports[_0x1734('0x21')]=function(_0x19ceed,_0xac0441){if(_0x19ceed[_0x1734('0x53')]['id']){delete _0x19ceed['body']['id'];}return db[_0x1734('0x2b')]['find']({'where':{'id':_0x19ceed['params']['id']}})[_0x1734('0x22')](handleEntityNotFound(_0xac0441,null))[_0x1734('0x22')](saveUpdates(_0x19ceed['body'],null))['then'](respondWithResult(_0xac0441,null))[_0x1734('0x49')](handleError(_0xac0441,null));};exports[_0x1734('0x23')]=function(_0x553fc0,_0x515e39){return db['Tag'][_0x1734('0x48')]({'where':{'id':_0x553fc0[_0x1734('0x45')]['id']}})[_0x1734('0x22')](handleEntityNotFound(_0x515e39,null))[_0x1734('0x22')](removeEntity(_0x515e39,null))['catch'](handleError(_0x515e39,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index c430ae3..517415a 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 _0xb162=['bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','tools_tags','lodash','util','api','moment'];(function(_0x363832,_0x569e4a){var _0x3802a8=function(_0x1eff17){while(--_0x1eff17){_0x363832['push'](_0x363832['shift']());}};_0x3802a8(++_0x569e4a);}(_0xb162,0x110));var _0x2b16=function(_0x127274,_0x1964b6){_0x127274=_0x127274-0x0;var _0x29a08f=_0xb162[_0x127274];return _0x29a08f;};'use strict';var _=require(_0x2b16('0x0'));var util=require(_0x2b16('0x1'));var logger=require('../../config/logger')(_0x2b16('0x2'));var moment=require(_0x2b16('0x3'));var BPromise=require(_0x2b16('0x4'));var rp=require(_0x2b16('0x5'));var fs=require('fs');var path=require(_0x2b16('0x6'));var rimraf=require(_0x2b16('0x7'));var config=require(_0x2b16('0x8'));var attributes=require(_0x2b16('0x9'));module[_0x2b16('0xa')]=function(_0x57cb92,_0x260c7b){return _0x57cb92['define']('Tag',attributes,{'tableName':_0x2b16('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x32f2=['exports','define','Tag','tools_tags','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./tag.attributes'];(function(_0x49996a,_0x5d9e06){var _0x3b541a=function(_0x47f560){while(--_0x47f560){_0x49996a['push'](_0x49996a['shift']());}};_0x3b541a(++_0x5d9e06);}(_0x32f2,0x1a4));var _0x232f=function(_0x4bd50d,_0x3c8330){_0x4bd50d=_0x4bd50d-0x0;var _0x5d8db2=_0x32f2[_0x4bd50d];return _0x5d8db2;};'use strict';var _=require(_0x232f('0x0'));var util=require(_0x232f('0x1'));var logger=require(_0x232f('0x2'))(_0x232f('0x3'));var moment=require(_0x232f('0x4'));var BPromise=require(_0x232f('0x5'));var rp=require(_0x232f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x232f('0x7'));var attributes=require(_0x232f('0x8'));module[_0x232f('0x9')]=function(_0x1d1d76,_0x46586b){return _0x1d1d76[_0x232f('0xa')](_0x232f('0xb'),attributes,{'tableName':_0x232f('0xc'),'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 cf5fc6a..02424f8 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 _0x4ea3=['Tag,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x4ea3,0x70));var _0x34ea=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x4ea3[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x34ea('0x0'));var util=require(_0x34ea('0x1'));var moment=require(_0x34ea('0x2'));var BPromise=require(_0x34ea('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x34ea('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x34ea('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x34ea('0x6'));var jayson=require(_0x34ea('0x7'));var client=jayson[_0x34ea('0x8')][_0x34ea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40434e,_0x18b461,_0x22b09e){return new BPromise(function(_0x5bec7c,_0x341727){return client[_0x34ea('0xa')](_0x40434e,_0x22b09e)[_0x34ea('0xb')](function(_0x5132c4){logger[_0x34ea('0xc')](_0x34ea('0xd'),_0x18b461,'request\x20sent');logger['debug'](_0x34ea('0xe'),_0x18b461,_0x34ea('0xf'),JSON[_0x34ea('0x10')](_0x5132c4));if(_0x5132c4['error']){if(_0x5132c4[_0x34ea('0x11')][_0x34ea('0x12')]===0x1f4){logger[_0x34ea('0x11')](_0x34ea('0xd'),_0x18b461,_0x5132c4[_0x34ea('0x11')][_0x34ea('0x13')]);return _0x341727(_0x5132c4[_0x34ea('0x11')][_0x34ea('0x13')]);}logger[_0x34ea('0x11')](_0x34ea('0xd'),_0x18b461,_0x5132c4[_0x34ea('0x11')]['message']);return _0x5bec7c(_0x5132c4[_0x34ea('0x11')][_0x34ea('0x13')]);}else{logger[_0x34ea('0xc')](_0x34ea('0xd'),_0x18b461,_0x34ea('0xf'));_0x5bec7c(_0x5132c4['result'][_0x34ea('0x13')]);}})[_0x34ea('0x14')](function(_0x3fa3b0){logger[_0x34ea('0x11')]('Tag,\x20%s,\x20%s',_0x18b461,_0x3fa3b0);_0x341727(_0x3fa3b0);});});} \ No newline at end of file +var _0xb205=['../../config/environment','client','http','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xb205,0xf0));var _0x5b20=function(_0x63cd07,_0x46bc54){_0x63cd07=_0x63cd07-0x0;var _0x16e6c7=_0xb205[_0x63cd07];return _0x16e6c7;};'use strict';var _=require(_0x5b20('0x0'));var util=require(_0x5b20('0x1'));var moment=require(_0x5b20('0x2'));var BPromise=require(_0x5b20('0x3'));var rs=require(_0x5b20('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5b20('0x5'));var logger=require('../../config/logger')(_0x5b20('0x6'));var config=require(_0x5b20('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5b20('0x8')][_0x5b20('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x364e48,_0x5c1ff9,_0x32b467){return new BPromise(function(_0x13fb27,_0x528c54){return client['request'](_0x364e48,_0x32b467)[_0x5b20('0xa')](function(_0xb77426){logger[_0x5b20('0xb')](_0x5b20('0xc'),_0x5c1ff9,_0x5b20('0xd'));logger[_0x5b20('0xe')](_0x5b20('0xf'),_0x5c1ff9,'request\x20sent',JSON[_0x5b20('0x10')](_0xb77426));if(_0xb77426[_0x5b20('0x11')]){if(_0xb77426[_0x5b20('0x11')]['code']===0x1f4){logger['error'](_0x5b20('0xc'),_0x5c1ff9,_0xb77426[_0x5b20('0x11')][_0x5b20('0x12')]);return _0x528c54(_0xb77426[_0x5b20('0x11')][_0x5b20('0x12')]);}logger['error'](_0x5b20('0xc'),_0x5c1ff9,_0xb77426[_0x5b20('0x11')][_0x5b20('0x12')]);return _0x13fb27(_0xb77426[_0x5b20('0x11')]['message']);}else{logger['info'](_0x5b20('0xc'),_0x5c1ff9,'request\x20sent');_0x13fb27(_0xb77426['result'][_0x5b20('0x12')]);}})['catch'](function(_0x43b7b0){logger[_0x5b20('0x11')](_0x5b20('0xc'),_0x5c1ff9,_0x43b7b0);_0x528c54(_0x43b7b0);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index c731b47..48c5590 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(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'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 d1d4189..f583e7d 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 _0xbaf0=['name','exports','STRING'];(function(_0x3b7a0c,_0xf1a4c2){var _0x3bb70f=function(_0x248b52){while(--_0x248b52){_0x3b7a0c['push'](_0x3b7a0c['shift']());}};_0x3bb70f(++_0xf1a4c2);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file +var _0x757a=['exports','STRING'];(function(_0x4c0d54,_0x3cb1b7){var _0xec3cf6=function(_0x579972){while(--_0x579972){_0x4c0d54['push'](_0x4c0d54['shift']());}};_0xec3cf6(++_0x3cb1b7);}(_0x757a,0xde));var _0xa757=function(_0x2ada20,_0x4294ca){_0x2ada20=_0x2ada20-0x0;var _0x3b52c5=_0x757a[_0x2ada20];return _0x3b52c5;};'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 diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index b48ddcf..02ff5ab 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 _0x93f1=['model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','order','sort','pick','filters','filter','where','merge','type','VIRTUAL','options','Team','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','QueryTypes','SELECT','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','Sequelize','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','send','getQueues','findOne','channel','isValidChannel','Unknown\x20channel','capitalize','toLowerCase','Queue','get','addQueues','ValidationError','add','ids','removeQueues','remove','Queues','addAgents','isArray','Voice','Chat','Mail','Sms','Fax','penalty','QueueId','TeamVoiceQueue','User','findOrCreate','emit','Queue:save','voicePause','interface','UserVoiceQueueRt','format','all','upsert','spread','removeAgents','Openchannel','Whatsapp','Queue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','end','status','json','undefined','limit','count','set','Content-Range','reject','update','then','error','stack','name','map','rawAttributes','fieldName','key'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x93f1,0x19d));var _0x193f=function(_0x37a447,_0x39d321){_0x37a447=_0x37a447-0x0;var _0x25ad13=_0x93f1[_0x37a447];return _0x25ad13;};'use strict';var emlformat=require(_0x193f('0x0'));var rimraf=require(_0x193f('0x1'));var zipdir=require(_0x193f('0x2'));var jsonpatch=require(_0x193f('0x3'));var rp=require(_0x193f('0x4'));var moment=require('moment');var BPromise=require(_0x193f('0x5'));var Mustache=require(_0x193f('0x6'));var util=require('util');var path=require(_0x193f('0x7'));var sox=require(_0x193f('0x8'));var csv=require('to-csv');var ejs=require(_0x193f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x193f('0xa'));var squel=require(_0x193f('0xb'));var crypto=require('crypto');var jsforce=require(_0x193f('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x193f('0xd'));var Papa=require(_0x193f('0xe'));var Redis=require('ioredis');var authService=require(_0x193f('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x193f('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x193f('0x11'))(_0x193f('0x12'));var utils=require(_0x193f('0x13'));var config=require(_0x193f('0x14'));var licenseUtil=require(_0x193f('0x15'));var db=require(_0x193f('0x16'))['db'];config[_0x193f('0x17')]=_[_0x193f('0x18')](config[_0x193f('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x193f('0x19'))(new Redis(config[_0x193f('0x17')]));require('./team.socket')[_0x193f('0x1a')](socket);function respondWithStatusCode(_0xded076,_0x30e75e){_0x30e75e=_0x30e75e||0xcc;return function(_0x231943){if(_0x231943){return _0xded076[_0x193f('0x1b')](_0x30e75e);}return _0xded076['status'](_0x30e75e)[_0x193f('0x1c')]();};}function respondWithResult(_0xb22915,_0x3e14b0){_0x3e14b0=_0x3e14b0||0xc8;return function(_0x4bcc5a){if(_0x4bcc5a){return _0xb22915[_0x193f('0x1d')](_0x3e14b0)[_0x193f('0x1e')](_0x4bcc5a);}};}function respondWithFilteredResult(_0x5060a2,_0x519e61){return function(_0x4af3c0){if(_0x4af3c0){var _0x5bad1d=typeof _0x519e61['offset']===_0x193f('0x1f')&&typeof _0x519e61[_0x193f('0x20')]==='undefined';var _0x13974a=_0x4af3c0[_0x193f('0x21')];var _0x4d438c=_0x5bad1d?0x0:_0x519e61['offset'];var _0x48490b=_0x5bad1d?_0x4af3c0[_0x193f('0x21')]:_0x519e61['offset']+_0x519e61[_0x193f('0x20')];var _0x1779fd;if(_0x48490b>=_0x13974a){_0x48490b=_0x13974a;_0x1779fd=0xc8;}else{_0x1779fd=0xce;}_0x5060a2['status'](_0x1779fd);return _0x5060a2[_0x193f('0x22')](_0x193f('0x23'),_0x4d438c+'-'+_0x48490b+'/'+_0x13974a)[_0x193f('0x1e')](_0x4af3c0);}return null;};}function patchUpdates(_0xb60625){return function(_0xdbfa62){try{jsonpatch['apply'](_0xdbfa62,_0xb60625,!![]);}catch(_0x224298){return BPromise[_0x193f('0x24')](_0x224298);}return _0xdbfa62['save']();};}function saveUpdates(_0x4d1c8a,_0x5a02ee){return function(_0x1e0c43){if(_0x1e0c43){return _0x1e0c43[_0x193f('0x25')](_0x4d1c8a)[_0x193f('0x26')](function(_0x58fd26){return _0x58fd26;});}return null;};}function handleEntityNotFound(_0x3e3073,_0x237745){return function(_0x533bd8){if(!_0x533bd8){_0x3e3073[_0x193f('0x1b')](0x194);}return _0x533bd8;};}function handleError(_0x2b6453,_0x50d6ce){_0x50d6ce=_0x50d6ce||0x1f4;return function(_0x5952b7){logger[_0x193f('0x27')](_0x5952b7[_0x193f('0x28')]);if(_0x5952b7[_0x193f('0x29')]){delete _0x5952b7['name'];}_0x2b6453[_0x193f('0x1d')](_0x50d6ce)['send'](_0x5952b7);};}exports['index']=function(_0x130b26,_0x183f2f){var _0xecb495={},_0x3d891f={},_0x341ca9={'count':0x0,'rows':[]};var _0x283909=_[_0x193f('0x2a')](db['Team'][_0x193f('0x2b')],function(_0x206523){return{'name':_0x206523[_0x193f('0x2c')],'type':_0x206523['type'][_0x193f('0x2d')]};});_0x3d891f[_0x193f('0x2e')]=_[_0x193f('0x2a')](_0x283909,_0x193f('0x29'));_0x3d891f['query']=_[_0x193f('0x2f')](_0x130b26[_0x193f('0x30')]);_0x3d891f['filters']=_['intersection'](_0x3d891f[_0x193f('0x2e')],_0x3d891f[_0x193f('0x30')]);_0xecb495[_0x193f('0x31')]=_[_0x193f('0x32')](_0x3d891f['model'],qs[_0x193f('0x33')](_0x130b26['query'][_0x193f('0x33')]));_0xecb495[_0x193f('0x31')]=_0xecb495[_0x193f('0x31')][_0x193f('0x34')]?_0xecb495[_0x193f('0x31')]:_0x3d891f[_0x193f('0x2e')];if(!_0x130b26[_0x193f('0x30')][_0x193f('0x35')](_0x193f('0x36'))){_0xecb495['limit']=qs['limit'](_0x130b26[_0x193f('0x30')][_0x193f('0x20')]);_0xecb495['offset']=qs[_0x193f('0x37')](_0x130b26[_0x193f('0x30')][_0x193f('0x37')]);}_0xecb495[_0x193f('0x38')]=qs[_0x193f('0x39')](_0x130b26[_0x193f('0x30')][_0x193f('0x39')]);_0xecb495['where']=qs['filters'](_[_0x193f('0x3a')](_0x130b26[_0x193f('0x30')],_0x3d891f[_0x193f('0x3b')]),_0x283909);if(_0x130b26['query'][_0x193f('0x3c')]){_0xecb495[_0x193f('0x3d')]=_[_0x193f('0x3e')](_0xecb495['where'],{'$or':_[_0x193f('0x2a')](_0x283909,function(_0x24161e){if(_0x24161e[_0x193f('0x3f')]!==_0x193f('0x40')){var _0x3abf7c={};_0x3abf7c[_0x24161e[_0x193f('0x29')]]={'$like':'%'+_0x130b26['query'][_0x193f('0x3c')]+'%'};return _0x3abf7c;}})});}_0xecb495=_[_0x193f('0x3e')]({},_0xecb495,_0x130b26[_0x193f('0x41')]);var _0x4c7e3a={'where':_0xecb495['where']};return db[_0x193f('0x42')][_0x193f('0x21')](_0x4c7e3a)[_0x193f('0x26')](function(_0x937487){_0x341ca9[_0x193f('0x21')]=_0x937487;if(_0x130b26['query']['includeAll']){_0xecb495[_0x193f('0x43')]=[{'all':!![]}];}return db[_0x193f('0x42')][_0x193f('0x44')](_0xecb495);})[_0x193f('0x26')](function(_0x471012){_0x341ca9[_0x193f('0x45')]=_0x471012;return _0x341ca9;})['then'](respondWithFilteredResult(_0x183f2f,_0xecb495))[_0x193f('0x46')](handleError(_0x183f2f,null));};exports[_0x193f('0x47')]=function(_0x43213c,_0x5e12a2){var _0x1d8a8b={'raw':![],'where':{'id':_0x43213c[_0x193f('0x48')]['id']}},_0x322402={};_0x322402[_0x193f('0x2e')]=_[_0x193f('0x2f')](db[_0x193f('0x42')]['rawAttributes']);_0x322402[_0x193f('0x30')]=_['keys'](_0x43213c[_0x193f('0x30')]);_0x322402[_0x193f('0x3b')]=_[_0x193f('0x32')](_0x322402['model'],_0x322402[_0x193f('0x30')]);_0x1d8a8b[_0x193f('0x31')]=_[_0x193f('0x32')](_0x322402[_0x193f('0x2e')],qs[_0x193f('0x33')](_0x43213c[_0x193f('0x30')][_0x193f('0x33')]));_0x1d8a8b[_0x193f('0x31')]=_0x1d8a8b[_0x193f('0x31')]['length']?_0x1d8a8b[_0x193f('0x31')]:_0x322402[_0x193f('0x2e')];if(_0x43213c['query']['includeAll']){_0x1d8a8b[_0x193f('0x43')]=[{'all':!![]}];}_0x1d8a8b=_['merge']({},_0x1d8a8b,_0x43213c[_0x193f('0x41')]);return db['Team'][_0x193f('0x49')](_0x1d8a8b)[_0x193f('0x26')](handleEntityNotFound(_0x5e12a2,null))[_0x193f('0x26')](respondWithResult(_0x5e12a2,null))[_0x193f('0x46')](handleError(_0x5e12a2,null));};exports[_0x193f('0x4a')]=function(_0x1ca251,_0x4fde4e){return db[_0x193f('0x42')][_0x193f('0x4a')](_0x1ca251[_0x193f('0x4b')],{})['then'](function(_0x3f83c5){var _0x2cf8b4=_0x1ca251[_0x193f('0x4c')]['get']({'plain':!![]});if(!_0x2cf8b4)throw new Error(_0x193f('0x4d'));if(_0x2cf8b4[_0x193f('0x4e')]===_0x193f('0x4c')){var _0x29d382=_0x3f83c5['get']({'plain':!![]});var _0x2d55ce='Teams';return db[_0x193f('0x4f')][_0x193f('0x49')]({'where':{'name':_0x2d55ce,'userProfileId':_0x2cf8b4[_0x193f('0x50')]},'raw':!![]})[_0x193f('0x26')](function(_0x4f48ab){if(_0x4f48ab&&_0x4f48ab['autoAssociation']===0x0){return db[_0x193f('0x51')][_0x193f('0x4a')]({'name':_0x29d382[_0x193f('0x29')],'resourceId':_0x29d382['id'],'type':_0x4f48ab['name'],'sectionId':_0x4f48ab['id']},{})['then'](function(){return _0x3f83c5;});}else{return _0x3f83c5;}})['catch'](function(_0x4bda40){logger[_0x193f('0x27')](_0x193f('0x52'),_0x4bda40);throw _0x4bda40;});}return _0x3f83c5;})[_0x193f('0x26')](respondWithResult(_0x4fde4e,0xc9))[_0x193f('0x46')](handleError(_0x4fde4e,null));};exports[_0x193f('0x25')]=function(_0x2be10c,_0x274a59){if(_0x2be10c[_0x193f('0x4b')]['id']){delete _0x2be10c[_0x193f('0x4b')]['id'];}return db['Team']['find']({'where':{'id':_0x2be10c[_0x193f('0x48')]['id']}})[_0x193f('0x26')](handleEntityNotFound(_0x274a59,null))[_0x193f('0x26')](saveUpdates(_0x2be10c[_0x193f('0x4b')],null))[_0x193f('0x26')](respondWithResult(_0x274a59,null))[_0x193f('0x46')](handleError(_0x274a59,null));};exports[_0x193f('0x53')]=function(_0x4dccd2,_0x523cd7){var _0x55cb24=_0x4dccd2[_0x193f('0x48')]['id'];var _0x1b95ca=[];return db[_0x193f('0x54')][_0x193f('0x55')](function(_0x13d8d4){var _0x2002b7=_0x193f('0x56')+_0x55cb24;return db['sequelize'][_0x193f('0x30')](_0x2002b7,{'type':db['Sequelize'][_0x193f('0x57')][_0x193f('0x58')],'raw':!![],'transaction':_0x13d8d4})['then'](function(_0xe84ee7){_0x1b95ca=_[_0x193f('0x2a')](_0xe84ee7,function(_0x3b4ba1){return Number(_0x3b4ba1['UserId']);});})[_0x193f('0x26')](function(){var _0x232da6=_0x193f('0x59')+_0x55cb24;return db[_0x193f('0x54')]['query'](_0x232da6,{'type':db[_0x193f('0x5a')]['QueryTypes'][_0x193f('0x58')],'raw':!![],'transaction':_0x13d8d4});})[_0x193f('0x26')](function(_0x4e09c5){var _0x5c9460=_['map'](_0x4e09c5,function(_0x7704e7){return Number(_0x7704e7[_0x193f('0x5b')]);});return db[_0x193f('0x5c')][_0x193f('0x53')]({'where':{'UserId':{'$in':_0x1b95ca},'VoiceQueueId':{'$in':_0x5c9460}},'transaction':_0x13d8d4});})[_0x193f('0x26')](function(){var _0x40ee07=_0x193f('0x5d')+_0x55cb24;return db[_0x193f('0x54')][_0x193f('0x30')](_0x40ee07,{'type':db['Sequelize'][_0x193f('0x57')]['SELECT'],'raw':!![],'transaction':_0x13d8d4});})[_0x193f('0x26')](function(_0x10af9b){var _0x32e603=_[_0x193f('0x2a')](_0x10af9b,function(_0x7a7dd8){return Number(_0x7a7dd8[_0x193f('0x5e')]);});return db['UserMailQueue']['destroy']({'where':{'UserId':{'$in':_0x1b95ca},'MailQueueId':{'$in':_0x32e603}},'transaction':_0x13d8d4});})[_0x193f('0x26')](function(){var _0x35bebe=_0x193f('0x5f')+_0x55cb24;return db[_0x193f('0x54')]['query'](_0x35bebe,{'type':db[_0x193f('0x5a')][_0x193f('0x57')][_0x193f('0x58')],'raw':!![],'transaction':_0x13d8d4});})[_0x193f('0x26')](function(_0x45222b){var _0x5607e=_[_0x193f('0x2a')](_0x45222b,function(_0x8e0163){return Number(_0x8e0163['SmsQueueId']);});return db[_0x193f('0x60')][_0x193f('0x53')]({'where':{'UserId':{'$in':_0x1b95ca},'SmsQueueId':{'$in':_0x5607e}},'transaction':_0x13d8d4});})[_0x193f('0x26')](function(){var _0x3db465=_0x193f('0x61')+_0x55cb24;return db[_0x193f('0x54')][_0x193f('0x30')](_0x3db465,{'type':db[_0x193f('0x5a')][_0x193f('0x57')][_0x193f('0x58')],'raw':!![],'transaction':_0x13d8d4});})[_0x193f('0x26')](function(_0x25be8a){var _0x27259f=_[_0x193f('0x2a')](_0x25be8a,function(_0x4ef29f){return Number(_0x4ef29f[_0x193f('0x62')]);});return db[_0x193f('0x63')][_0x193f('0x53')]({'where':{'UserId':{'$in':_0x1b95ca},'ChatQueueId':{'$in':_0x27259f}},'transaction':_0x13d8d4});})[_0x193f('0x26')](function(){var _0x5c5a19=_0x193f('0x64')+_0x55cb24;return db[_0x193f('0x54')][_0x193f('0x30')](_0x5c5a19,{'type':db[_0x193f('0x5a')][_0x193f('0x57')][_0x193f('0x58')],'raw':!![],'transaction':_0x13d8d4});})['then'](function(_0x33ddfe){var _0xc564d0=_[_0x193f('0x2a')](_0x33ddfe,function(_0x2dd2f8){return Number(_0x2dd2f8['FaxQueueId']);});return db[_0x193f('0x65')]['destroy']({'where':{'UserId':{'$in':_0x1b95ca},'FaxQueueId':{'$in':_0xc564d0}},'transaction':_0x13d8d4});})[_0x193f('0x26')](function(){var _0x5694fa=_0x193f('0x66')+_0x55cb24;return db[_0x193f('0x54')][_0x193f('0x30')](_0x5694fa,{'type':db[_0x193f('0x5a')][_0x193f('0x57')][_0x193f('0x58')],'raw':!![],'transaction':_0x13d8d4});})[_0x193f('0x26')](function(_0x50c305){var _0x363c05=_[_0x193f('0x2a')](_0x50c305,function(_0x17665a){return Number(_0x17665a[_0x193f('0x67')]);});return db[_0x193f('0x68')]['destroy']({'where':{'UserId':{'$in':_0x1b95ca},'OpenchannelQueueId':{'$in':_0x363c05}},'transaction':_0x13d8d4});})[_0x193f('0x26')](function(){var _0x10d86a=_0x193f('0x69')+_0x55cb24;return db[_0x193f('0x54')][_0x193f('0x30')](_0x10d86a,{'type':db[_0x193f('0x5a')][_0x193f('0x57')]['SELECT'],'raw':!![],'transaction':_0x13d8d4});})[_0x193f('0x26')](function(_0x42503c){var _0x3aaef0=_['map'](_0x42503c,function(_0x503c7f){return Number(_0x503c7f[_0x193f('0x6a')]);});return db['UserWhatsappQueue']['destroy']({'where':{'UserId':{'$in':_0x1b95ca},'WhatsappQueueId':{'$in':_0x3aaef0}},'transaction':_0x13d8d4});})[_0x193f('0x26')](function(){return db[_0x193f('0x6b')][_0x193f('0x49')]({'where':{'TeamId':_0x55cb24}});})[_0x193f('0x26')](function(_0x2f5616){if(_0x2f5616===null){return;}return db[_0x193f('0x6c')]['destroy']({'where':{'UserId':{'$in':_0x1b95ca},'VoicePrefixId':_0x2f5616[_0x193f('0x6d')]},'transaction':_0x13d8d4});})[_0x193f('0x26')](function(){return db['Team'][_0x193f('0x53')]({'where':{'id':_0x55cb24},'cascade':!![],'transaction':_0x13d8d4});})[_0x193f('0x26')](function(_0x3e451a){if(_0x3e451a===0x0){_0x523cd7[_0x193f('0x1b')](0x194);}else{return db[_0x193f('0x51')][_0x193f('0x53')]({'where':{'type':'Teams','resourceId':_0x55cb24},'cascade':!![],'transaction':_0x13d8d4})[_0x193f('0x26')](function(){_0x523cd7[_0x193f('0x1d')](0xcc)[_0x193f('0x1c')]();});}})[_0x193f('0x46')](function(_0x225b37){_0x523cd7['status'](0x1f4)[_0x193f('0x6e')](_0x225b37);});});};exports[_0x193f('0x6f')]=function(_0x3b66b6,_0x5ccff7,_0x37006b){return db[_0x193f('0x42')][_0x193f('0x70')]({'where':{'id':_0x3b66b6[_0x193f('0x48')]['id']}})[_0x193f('0x26')](handleEntityNotFound(_0x5ccff7,null))[_0x193f('0x26')](function(_0x5cd11f){if(!_0x3b66b6[_0x193f('0x30')][_0x193f('0x71')]||!utils[_0x193f('0x72')](_0x3b66b6[_0x193f('0x30')][_0x193f('0x71')])){throw new db['Sequelize']['ValidationError'](_0x193f('0x73'));}var _0x37d659={};var _0xe3a0d4={};_0xe3a0d4[_0x193f('0x2e')]=_[_0x193f('0x2f')](db[_[_0x193f('0x74')](_0x3b66b6[_0x193f('0x30')][_0x193f('0x71')][_0x193f('0x75')]())+_0x193f('0x76')][_0x193f('0x2b')]);_0xe3a0d4[_0x193f('0x30')]=_['keys'](_0x3b66b6['query']);_0xe3a0d4[_0x193f('0x3b')]=_[_0x193f('0x32')](_0xe3a0d4[_0x193f('0x2e')],_0xe3a0d4[_0x193f('0x30')]);_0x37d659[_0x193f('0x31')]=_[_0x193f('0x32')](_0xe3a0d4[_0x193f('0x2e')],qs['fields'](_0x3b66b6[_0x193f('0x30')]['fields']));_0x37d659[_0x193f('0x31')]=_0x37d659['attributes']['length']?_0x37d659[_0x193f('0x31')]:_0xe3a0d4[_0x193f('0x2e')];_0x37d659[_0x193f('0x20')]=qs[_0x193f('0x20')](_0x3b66b6['query'][_0x193f('0x20')]);_0x37d659[_0x193f('0x37')]=qs[_0x193f('0x37')](_0x3b66b6[_0x193f('0x30')][_0x193f('0x37')]);_0x37d659[_0x193f('0x38')]=qs[_0x193f('0x39')](_0x3b66b6[_0x193f('0x30')][_0x193f('0x39')]);_0x37d659['where']=qs[_0x193f('0x3b')](_['pick'](_0x3b66b6[_0x193f('0x30')],_0xe3a0d4[_0x193f('0x3b')]));_0x37d659=_[_0x193f('0x3e')]({},_0x37d659,_0x3b66b6[_0x193f('0x41')]);return _0x5cd11f[_0x193f('0x77')+_[_0x193f('0x74')](_0x3b66b6['query'][_0x193f('0x71')][_0x193f('0x75')]())+'Queues'](_0x37d659);})['then'](respondWithResult(_0x5ccff7,null))['catch'](handleError(_0x5ccff7,null));};exports[_0x193f('0x78')]=function(_0x112926,_0x1ea14c,_0x3eba47){return db[_0x193f('0x42')][_0x193f('0x70')]({'where':{'id':_0x112926[_0x193f('0x48')]['id']}})['then'](function(_0x410afa){if(_0x410afa){if(!_0x112926[_0x193f('0x4b')]['channel']||!utils[_0x193f('0x72')](_0x112926['body'][_0x193f('0x71')])){throw new db[(_0x193f('0x5a'))][(_0x193f('0x79'))](_0x193f('0x73'));}return _0x410afa[_0x193f('0x7a')+_['capitalize'](_0x112926[_0x193f('0x4b')][_0x193f('0x71')]['toLowerCase']())+'Queues'](_0x112926['body'][_0x193f('0x7b')]);}return null;})[_0x193f('0x26')](handleEntityNotFound(_0x1ea14c,null))['then'](respondWithStatusCode(_0x1ea14c,null))[_0x193f('0x46')](handleError(_0x1ea14c,null));};exports[_0x193f('0x7c')]=function(_0x306c98,_0x3848c0,_0x59f590){return db['Team'][_0x193f('0x70')]({'where':{'id':_0x306c98[_0x193f('0x48')]['id']}})[_0x193f('0x26')](function(_0x3c75ee){if(_0x3c75ee){if(!_0x306c98[_0x193f('0x30')][_0x193f('0x71')]||!utils[_0x193f('0x72')](_0x306c98['query'][_0x193f('0x71')])){throw new db[(_0x193f('0x5a'))][(_0x193f('0x79'))](_0x193f('0x73'));}return _0x3c75ee[_0x193f('0x7d')+_[_0x193f('0x74')](_0x306c98[_0x193f('0x30')][_0x193f('0x71')]['toLowerCase']())+_0x193f('0x7e')](_0x306c98[_0x193f('0x30')][_0x193f('0x7b')]);}return null;})['then'](handleEntityNotFound(_0x3848c0,null))['then'](respondWithStatusCode(_0x3848c0,null))[_0x193f('0x46')](handleError(_0x3848c0,null));};exports[_0x193f('0x7f')]=function(_0x473c59,_0x3c5b4f){var _0x160d96=_[_0x193f('0x80')](_0x473c59['body'][_0x193f('0x7b')])?_0x473c59[_0x193f('0x4b')][_0x193f('0x7b')]:[_0x473c59[_0x193f('0x4b')]['ids']];var _0x2f249a=_0x473c59[_0x193f('0x48')]['id'];return db[_0x193f('0x42')][_0x193f('0x49')]({'where':{'id':_0x2f249a}})['then'](handleEntityNotFound(_0x3c5b4f,null))[_0x193f('0x26')](function(_0x42d9f4){if(_0x42d9f4){var _0x885249=[_0x193f('0x81'),_0x193f('0x82'),_0x193f('0x83'),_0x193f('0x84'),_0x193f('0x85'),'Openchannel','Whatsapp'];return db['sequelize']['transaction'](function(_0x39efd1){var _0x313701=_[_0x193f('0x2a')](_0x885249,function(_0x55e4b5){var _0x35ce4d={'attributes':['id',_0x193f('0x29')]};if(_0x55e4b5==='Voice'){_0x35ce4d['through']={'attributes':[_0x193f('0x86')]};}return _0x42d9f4['get'+_0x55e4b5+_0x193f('0x7e')](_0x35ce4d)[_0x193f('0x26')](function(_0x308e8f){var _0x16803d=_['map'](_0x308e8f,function(_0x226e18){var _0x28aaa0=_[_0x193f('0x2a')](_0x160d96,function(_0x3eee31){var _0x47d0de={'where':{'UserId':_0x3eee31,[_0x55e4b5+_0x193f('0x87')]:_0x226e18['id']},'transaction':_0x39efd1};if(_0x55e4b5==='Voice'){_0x47d0de[_0x193f('0x18')]={'penalty':_0x226e18[_0x193f('0x88')]['penalty']};}return db[_0x193f('0x89')+_0x55e4b5+_0x193f('0x76')][_0x193f('0x8a')](_0x47d0de)['then'](function(){socket[_0x193f('0x8b')](_0x193f('0x4c')+_0x55e4b5+_0x193f('0x8c'),{'UserId':_0x3eee31,[_0x55e4b5+_0x193f('0x87')]:_0x226e18['id']});if(_0x55e4b5!==_0x193f('0x81')){return;}return db[_0x193f('0x89')][_0x193f('0x44')]({'where':{'id':_0x160d96,'online':0x1},'attributes':['id','name','online',_0x193f('0x8d'),_0x193f('0x8e')],'raw':!![]})['then'](function(_0xc36b42){var _0x56cb37=_[_0x193f('0x2a')](_0xc36b42,function(_0x44f55c){return db[_0x193f('0x8f')]['upsert']({'membername':_0x44f55c[_0x193f('0x29')],'UserId':_0x44f55c['id'],'queue_name':_0x226e18[_0x193f('0x29')],'VoiceQueueId':_0x226e18['id'],'interface':_['isNil'](_0x44f55c['interface'])?util[_0x193f('0x90')]('SIP/%s',_0x44f55c['name']):_0x44f55c[_0x193f('0x8e')],'paused':_0x44f55c['voicePause']||![],'penalty':_0x226e18['TeamVoiceQueue']['penalty']},{'transaction':_0x39efd1});});return Promise[_0x193f('0x91')](_0x56cb37);});});});return Promise[_0x193f('0x91')](_0x28aaa0);});return Promise[_0x193f('0x91')](_0x16803d);})['then'](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x2f249a}})[_0x193f('0x26')](function(_0x264002){if(_0x264002){var _0x4f5404=_[_0x193f('0x2a')](_0x160d96,function(_0x45fc9b){db[_0x193f('0x6c')][_0x193f('0x92')]({'UserId':_0x45fc9b,'VoicePrefixId':_0x264002[_0x193f('0x6d')]});});return Promise['all'](_0x4f5404);}});});});return Promise[_0x193f('0x91')](_0x313701)[_0x193f('0x26')](function(){return _0x42d9f4['addAgents'](_0x160d96,{'transaction':_0x39efd1})[_0x193f('0x93')](function(_0x87b11c){return _0x87b11c;});});});}})[_0x193f('0x26')](respondWithResult(_0x3c5b4f,null))[_0x193f('0x46')](handleError(_0x3c5b4f,null));};exports[_0x193f('0x94')]=function(_0x4f3c01,_0x1c51df){var _0x3a8b10=_[_0x193f('0x80')](_0x4f3c01[_0x193f('0x30')][_0x193f('0x7b')])?_0x4f3c01[_0x193f('0x30')]['ids']:[_0x4f3c01[_0x193f('0x30')][_0x193f('0x7b')]];var _0x29533b=_0x4f3c01[_0x193f('0x48')]['id'];return db[_0x193f('0x42')][_0x193f('0x49')]({'where':{'id':_0x29533b}})['then'](handleEntityNotFound(_0x1c51df,null))['then'](function(_0x37b8fc){if(_0x37b8fc){var _0x3094ce=['Voice',_0x193f('0x82'),_0x193f('0x83'),_0x193f('0x84'),_0x193f('0x85'),_0x193f('0x95'),_0x193f('0x96')];return db[_0x193f('0x54')]['transaction'](function(_0x28f79d){var _0x470c11=_[_0x193f('0x2a')](_0x3094ce,function(_0x2fc9cd){var _0x5ab5fe={'attributes':['id','name']};return _0x37b8fc[_0x193f('0x77')+_0x2fc9cd+'Queues'](_0x5ab5fe)[_0x193f('0x26')](function(_0x23122e){var _0x4d0344=_[_0x193f('0x2a')](_0x23122e,function(_0x2cb5f4){return _0x2cb5f4[_0x193f('0x94')](_0x3a8b10,{'transaction':_0x28f79d})[_0x193f('0x26')](function(){var _0x3b0f83=_[_0x193f('0x2a')](_0x3a8b10,function(_0x305e0d){socket['emit']('user'+_0x2fc9cd+_0x193f('0x97'),{'UserId':Number(_0x305e0d),[_0x2fc9cd+_0x193f('0x87')]:_0x2cb5f4['id']});if(_0x2fc9cd!=='Voice'){return;}return db[_0x193f('0x8f')][_0x193f('0x53')]({'where':{'VoiceQueueId':_0x2cb5f4['id'],'UserId':_0x305e0d},'transaction':_0x28f79d});});return Promise[_0x193f('0x91')](_0x3b0f83);});});return Promise[_0x193f('0x91')](_0x4d0344);});});return Promise[_0x193f('0x91')](_0x470c11)['then'](function(){return _0x37b8fc['removeAgents'](_0x3a8b10,{'transaction':_0x28f79d});})['then'](function(){return db[_0x193f('0x6b')][_0x193f('0x70')]({'where':{'teamId':_0x29533b}})['then'](function(_0x1c34cf){if(_0x1c34cf){var _0x187820=_[_0x193f('0x2a')](_0x3a8b10,function(_0x1b5f86){db['UserVoicePrefix'][_0x193f('0x53')]({'where':{'UserId':_0x1b5f86,'VoicePrefixId':_0x1c34cf['VoicePrefixId']}});});return Promise[_0x193f('0x91')](_0x187820);}});});});}})[_0x193f('0x26')](respondWithStatusCode(_0x1c51df,null))['catch'](handleError(_0x1c51df,null));};exports[_0x193f('0x98')]=function(_0x6ba1b4,_0x30fd2d,_0xc95ad2){var _0x550a23={};var _0x48e859={};var _0x1d6d94;var _0x4e52f2;return db[_0x193f('0x42')]['findOne']({'where':{'id':_0x6ba1b4[_0x193f('0x48')]['id']}})['then'](handleEntityNotFound(_0x30fd2d,null))['then'](function(_0x2d8624){if(_0x2d8624){_0x1d6d94=_0x2d8624;_0x48e859['model']=_[_0x193f('0x2f')](db[_0x193f('0x89')][_0x193f('0x2b')]);_0x48e859[_0x193f('0x30')]=_[_0x193f('0x2f')](_0x6ba1b4['query']);_0x48e859[_0x193f('0x3b')]=_[_0x193f('0x32')](_0x48e859[_0x193f('0x2e')],_0x48e859[_0x193f('0x30')]);_0x550a23[_0x193f('0x31')]=_[_0x193f('0x32')](_0x48e859[_0x193f('0x2e')],qs['fields'](_0x6ba1b4[_0x193f('0x30')][_0x193f('0x33')]));_0x550a23[_0x193f('0x31')]=_0x550a23[_0x193f('0x31')][_0x193f('0x34')]?_0x550a23[_0x193f('0x31')]:_0x48e859[_0x193f('0x2e')];_0x550a23['order']=qs[_0x193f('0x39')](_0x6ba1b4[_0x193f('0x30')][_0x193f('0x39')]);_0x550a23['where']=qs[_0x193f('0x3b')](_['pick'](_0x6ba1b4['query'],_0x48e859['filters']));if(_0x6ba1b4['query'][_0x193f('0x3c')]){_0x550a23[_0x193f('0x3d')]=_[_0x193f('0x3e')](_0x550a23[_0x193f('0x3d')],{'$or':_[_0x193f('0x2a')](_0x550a23[_0x193f('0x31')],function(_0xc92d0d){var _0x4e4eed={};_0x4e4eed[_0xc92d0d]={'$like':'%'+_0x6ba1b4[_0x193f('0x30')]['filter']+'%'};return _0x4e4eed;})});}_0x550a23=_[_0x193f('0x3e')]({},_0x550a23,_0x6ba1b4[_0x193f('0x41')]);return _0x1d6d94['getAgents'](_0x550a23);}})['then'](function(_0x382fc5){if(_0x382fc5){_0x4e52f2=_0x382fc5[_0x193f('0x34')];if(!_0x6ba1b4[_0x193f('0x30')]['hasOwnProperty'](_0x193f('0x36'))){_0x550a23[_0x193f('0x20')]=qs[_0x193f('0x20')](_0x6ba1b4[_0x193f('0x30')][_0x193f('0x20')]);_0x550a23[_0x193f('0x37')]=qs[_0x193f('0x37')](_0x6ba1b4['query'][_0x193f('0x37')]);}return _0x1d6d94[_0x193f('0x98')](_0x550a23);}})[_0x193f('0x26')](function(_0x1d1fbf){if(_0x1d1fbf){return _0x1d1fbf?{'count':_0x4e52f2,'rows':_0x1d1fbf}:null;}})['then'](respondWithResult(_0x30fd2d,null))[_0x193f('0x46')](handleError(_0x30fd2d,null));}; \ No newline at end of file +var _0x5b0d=['register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','update','then','error','name','send','index','map','Team','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','nolimit','sort','filter','where','VIRTUAL','options','includeAll','rows','catch','show','params','fields','include','merge','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','UserId','SELECT','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','UserOpenchannelQueue','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','UserProfileResource','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','pick','Queues','ids','remove','isArray','Voice','Chat','Fax','Openchannel','Whatsapp','transaction','through','penalty','QueueId','TeamVoiceQueue','Queue','findOrCreate','emit','findAll','voicePause','upsert','isNil','interface','format','all','addAgents','removeAgents','Queue:remove','UserVoiceQueueRt','getAgents','User','order','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','defaults','redis','socket.io-emitter','./team.socket'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5b0d,0x1aa));var _0xd5b0=function(_0x1922d2,_0x224ada){_0x1922d2=_0x1922d2-0x0;var _0x268072=_0x5b0d[_0x1922d2];return _0x268072;};'use strict';var emlformat=require(_0xd5b0('0x0'));var rimraf=require(_0xd5b0('0x1'));var zipdir=require(_0xd5b0('0x2'));var jsonpatch=require(_0xd5b0('0x3'));var rp=require(_0xd5b0('0x4'));var moment=require(_0xd5b0('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd5b0('0x6'));var util=require('util');var path=require(_0xd5b0('0x7'));var sox=require(_0xd5b0('0x8'));var csv=require(_0xd5b0('0x9'));var ejs=require(_0xd5b0('0xa'));var fs=require('fs');var fs_extra=require(_0xd5b0('0xb'));var _=require(_0xd5b0('0xc'));var squel=require(_0xd5b0('0xd'));var crypto=require(_0xd5b0('0xe'));var jsforce=require(_0xd5b0('0xf'));var deskjs=require(_0xd5b0('0x10'));var toCsv=require(_0xd5b0('0x9'));var querystring=require(_0xd5b0('0x11'));var Papa=require(_0xd5b0('0x12'));var Redis=require('ioredis');var authService=require(_0xd5b0('0x13'));var qs=require(_0xd5b0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd5b0('0x15'));var logger=require(_0xd5b0('0x16'))(_0xd5b0('0x17'));var utils=require('../../config/utils');var config=require(_0xd5b0('0x18'));var licenseUtil=require(_0xd5b0('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xd5b0('0x1a')](config[_0xd5b0('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xd5b0('0x1c'))(new Redis(config[_0xd5b0('0x1b')]));require(_0xd5b0('0x1d'))[_0xd5b0('0x1e')](socket);function respondWithStatusCode(_0x192f67,_0xfa5aa6){_0xfa5aa6=_0xfa5aa6||0xcc;return function(_0x4942e6){if(_0x4942e6){return _0x192f67[_0xd5b0('0x1f')](_0xfa5aa6);}return _0x192f67[_0xd5b0('0x20')](_0xfa5aa6)[_0xd5b0('0x21')]();};}function respondWithResult(_0x2504b3,_0x3366ac){_0x3366ac=_0x3366ac||0xc8;return function(_0x25eae3){if(_0x25eae3){return _0x2504b3[_0xd5b0('0x20')](_0x3366ac)['json'](_0x25eae3);}};}function respondWithFilteredResult(_0xe8ef93,_0x531e7d){return function(_0x5b39d0){if(_0x5b39d0){var _0x3ce585=typeof _0x531e7d[_0xd5b0('0x22')]===_0xd5b0('0x23')&&typeof _0x531e7d[_0xd5b0('0x24')]==='undefined';var _0x3299c7=_0x5b39d0[_0xd5b0('0x25')];var _0x36a336=_0x3ce585?0x0:_0x531e7d[_0xd5b0('0x22')];var _0xe57f8d=_0x3ce585?_0x5b39d0[_0xd5b0('0x25')]:_0x531e7d[_0xd5b0('0x22')]+_0x531e7d['limit'];var _0x2ea8d6;if(_0xe57f8d>=_0x3299c7){_0xe57f8d=_0x3299c7;_0x2ea8d6=0xc8;}else{_0x2ea8d6=0xce;}_0xe8ef93[_0xd5b0('0x20')](_0x2ea8d6);return _0xe8ef93[_0xd5b0('0x26')](_0xd5b0('0x27'),_0x36a336+'-'+_0xe57f8d+'/'+_0x3299c7)['json'](_0x5b39d0);}return null;};}function patchUpdates(_0x4ce68e){return function(_0x234f62){try{jsonpatch[_0xd5b0('0x28')](_0x234f62,_0x4ce68e,!![]);}catch(_0x1ba818){return BPromise['reject'](_0x1ba818);}return _0x234f62['save']();};}function saveUpdates(_0x30cbb4,_0x4dbc8b){return function(_0x122c90){if(_0x122c90){return _0x122c90[_0xd5b0('0x29')](_0x30cbb4)[_0xd5b0('0x2a')](function(_0x52d4da){return _0x52d4da;});}return null;};}function handleEntityNotFound(_0x2f850c,_0x3aaea5){return function(_0x33c3d5){if(!_0x33c3d5){_0x2f850c[_0xd5b0('0x1f')](0x194);}return _0x33c3d5;};}function handleError(_0x528bc9,_0x2f58ff){_0x2f58ff=_0x2f58ff||0x1f4;return function(_0x3968ce){logger[_0xd5b0('0x2b')](_0x3968ce['stack']);if(_0x3968ce[_0xd5b0('0x2c')]){delete _0x3968ce[_0xd5b0('0x2c')];}_0x528bc9[_0xd5b0('0x20')](_0x2f58ff)[_0xd5b0('0x2d')](_0x3968ce);};}exports[_0xd5b0('0x2e')]=function(_0x58300c,_0x1c3b57){var _0x517bf8={},_0x2b142e={},_0x3f6b0d={'count':0x0,'rows':[]};var _0x5f2755=_[_0xd5b0('0x2f')](db[_0xd5b0('0x30')][_0xd5b0('0x31')],function(_0x24c776){return{'name':_0x24c776[_0xd5b0('0x32')],'type':_0x24c776[_0xd5b0('0x33')][_0xd5b0('0x34')]};});_0x2b142e[_0xd5b0('0x35')]=_[_0xd5b0('0x2f')](_0x5f2755,_0xd5b0('0x2c'));_0x2b142e['query']=_[_0xd5b0('0x36')](_0x58300c[_0xd5b0('0x37')]);_0x2b142e[_0xd5b0('0x38')]=_[_0xd5b0('0x39')](_0x2b142e[_0xd5b0('0x35')],_0x2b142e['query']);_0x517bf8[_0xd5b0('0x3a')]=_[_0xd5b0('0x39')](_0x2b142e[_0xd5b0('0x35')],qs['fields'](_0x58300c[_0xd5b0('0x37')]['fields']));_0x517bf8[_0xd5b0('0x3a')]=_0x517bf8[_0xd5b0('0x3a')][_0xd5b0('0x3b')]?_0x517bf8['attributes']:_0x2b142e[_0xd5b0('0x35')];if(!_0x58300c[_0xd5b0('0x37')]['hasOwnProperty'](_0xd5b0('0x3c'))){_0x517bf8[_0xd5b0('0x24')]=qs[_0xd5b0('0x24')](_0x58300c['query']['limit']);_0x517bf8[_0xd5b0('0x22')]=qs[_0xd5b0('0x22')](_0x58300c[_0xd5b0('0x37')][_0xd5b0('0x22')]);}_0x517bf8['order']=qs['sort'](_0x58300c['query'][_0xd5b0('0x3d')]);_0x517bf8['where']=qs['filters'](_['pick'](_0x58300c[_0xd5b0('0x37')],_0x2b142e[_0xd5b0('0x38')]),_0x5f2755);if(_0x58300c['query'][_0xd5b0('0x3e')]){_0x517bf8[_0xd5b0('0x3f')]=_['merge'](_0x517bf8[_0xd5b0('0x3f')],{'$or':_[_0xd5b0('0x2f')](_0x5f2755,function(_0x5d29c5){if(_0x5d29c5[_0xd5b0('0x33')]!==_0xd5b0('0x40')){var _0x16030a={};_0x16030a[_0x5d29c5[_0xd5b0('0x2c')]]={'$like':'%'+_0x58300c[_0xd5b0('0x37')][_0xd5b0('0x3e')]+'%'};return _0x16030a;}})});}_0x517bf8=_['merge']({},_0x517bf8,_0x58300c[_0xd5b0('0x41')]);var _0x60c90={'where':_0x517bf8['where']};return db[_0xd5b0('0x30')][_0xd5b0('0x25')](_0x60c90)[_0xd5b0('0x2a')](function(_0x50e78b){_0x3f6b0d[_0xd5b0('0x25')]=_0x50e78b;if(_0x58300c[_0xd5b0('0x37')][_0xd5b0('0x42')]){_0x517bf8['include']=[{'all':!![]}];}return db['Team']['findAll'](_0x517bf8);})[_0xd5b0('0x2a')](function(_0x467a11){_0x3f6b0d[_0xd5b0('0x43')]=_0x467a11;return _0x3f6b0d;})[_0xd5b0('0x2a')](respondWithFilteredResult(_0x1c3b57,_0x517bf8))[_0xd5b0('0x44')](handleError(_0x1c3b57,null));};exports[_0xd5b0('0x45')]=function(_0x5ce6c2,_0x1a4018){var _0x2b47c1={'raw':![],'where':{'id':_0x5ce6c2[_0xd5b0('0x46')]['id']}},_0x40447f={};_0x40447f[_0xd5b0('0x35')]=_[_0xd5b0('0x36')](db['Team'][_0xd5b0('0x31')]);_0x40447f[_0xd5b0('0x37')]=_[_0xd5b0('0x36')](_0x5ce6c2['query']);_0x40447f[_0xd5b0('0x38')]=_[_0xd5b0('0x39')](_0x40447f[_0xd5b0('0x35')],_0x40447f[_0xd5b0('0x37')]);_0x2b47c1[_0xd5b0('0x3a')]=_[_0xd5b0('0x39')](_0x40447f[_0xd5b0('0x35')],qs[_0xd5b0('0x47')](_0x5ce6c2['query'][_0xd5b0('0x47')]));_0x2b47c1['attributes']=_0x2b47c1[_0xd5b0('0x3a')][_0xd5b0('0x3b')]?_0x2b47c1[_0xd5b0('0x3a')]:_0x40447f[_0xd5b0('0x35')];if(_0x5ce6c2['query'][_0xd5b0('0x42')]){_0x2b47c1[_0xd5b0('0x48')]=[{'all':!![]}];}_0x2b47c1=_[_0xd5b0('0x49')]({},_0x2b47c1,_0x5ce6c2[_0xd5b0('0x41')]);return db['Team'][_0xd5b0('0x4a')](_0x2b47c1)[_0xd5b0('0x2a')](handleEntityNotFound(_0x1a4018,null))[_0xd5b0('0x2a')](respondWithResult(_0x1a4018,null))[_0xd5b0('0x44')](handleError(_0x1a4018,null));};exports['create']=function(_0x29a04e,_0x155964){return db[_0xd5b0('0x30')][_0xd5b0('0x4b')](_0x29a04e[_0xd5b0('0x4c')],{})[_0xd5b0('0x2a')](function(_0x150579){var _0x5bfecc=_0x29a04e[_0xd5b0('0x4d')][_0xd5b0('0x4e')]({'plain':!![]});if(!_0x5bfecc)throw new Error(_0xd5b0('0x4f'));if(_0x5bfecc[_0xd5b0('0x50')]===_0xd5b0('0x4d')){var _0x174083=_0x150579[_0xd5b0('0x4e')]({'plain':!![]});var _0x171d03=_0xd5b0('0x51');return db['UserProfileSection']['find']({'where':{'name':_0x171d03,'userProfileId':_0x5bfecc[_0xd5b0('0x52')]},'raw':!![]})[_0xd5b0('0x2a')](function(_0x5c5b09){if(_0x5c5b09&&_0x5c5b09[_0xd5b0('0x53')]===0x0){return db['UserProfileResource'][_0xd5b0('0x4b')]({'name':_0x174083[_0xd5b0('0x2c')],'resourceId':_0x174083['id'],'type':_0x5c5b09[_0xd5b0('0x2c')],'sectionId':_0x5c5b09['id']},{})[_0xd5b0('0x2a')](function(){return _0x150579;});}else{return _0x150579;}})[_0xd5b0('0x44')](function(_0x2d463c){logger['error'](_0xd5b0('0x54'),_0x2d463c);throw _0x2d463c;});}return _0x150579;})[_0xd5b0('0x2a')](respondWithResult(_0x155964,0xc9))['catch'](handleError(_0x155964,null));};exports[_0xd5b0('0x29')]=function(_0x1e386a,_0x313b47){if(_0x1e386a[_0xd5b0('0x4c')]['id']){delete _0x1e386a[_0xd5b0('0x4c')]['id'];}return db[_0xd5b0('0x30')][_0xd5b0('0x4a')]({'where':{'id':_0x1e386a[_0xd5b0('0x46')]['id']}})[_0xd5b0('0x2a')](handleEntityNotFound(_0x313b47,null))[_0xd5b0('0x2a')](saveUpdates(_0x1e386a[_0xd5b0('0x4c')],null))[_0xd5b0('0x2a')](respondWithResult(_0x313b47,null))[_0xd5b0('0x44')](handleError(_0x313b47,null));};exports[_0xd5b0('0x55')]=function(_0xb85031,_0x431490){var _0x325d72=_0xb85031['params']['id'];var _0x191a00=[];return db[_0xd5b0('0x56')]['transaction'](function(_0x250d8e){var _0xa42b00=_0xd5b0('0x57')+_0x325d72;return db[_0xd5b0('0x56')][_0xd5b0('0x37')](_0xa42b00,{'type':db[_0xd5b0('0x58')][_0xd5b0('0x59')]['SELECT'],'raw':!![],'transaction':_0x250d8e})[_0xd5b0('0x2a')](function(_0x3bf579){_0x191a00=_[_0xd5b0('0x2f')](_0x3bf579,function(_0x41287d){return Number(_0x41287d[_0xd5b0('0x5a')]);});})[_0xd5b0('0x2a')](function(){var _0x158891='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x325d72;return db[_0xd5b0('0x56')]['query'](_0x158891,{'type':db[_0xd5b0('0x58')][_0xd5b0('0x59')][_0xd5b0('0x5b')],'raw':!![],'transaction':_0x250d8e});})[_0xd5b0('0x2a')](function(_0x2c960c){var _0x264461=_[_0xd5b0('0x2f')](_0x2c960c,function(_0x1f490c){return Number(_0x1f490c[_0xd5b0('0x5c')]);});return db[_0xd5b0('0x5d')]['destroy']({'where':{'UserId':{'$in':_0x191a00},'VoiceQueueId':{'$in':_0x264461}},'transaction':_0x250d8e});})[_0xd5b0('0x2a')](function(){var _0x4403bb=_0xd5b0('0x5e')+_0x325d72;return db[_0xd5b0('0x56')][_0xd5b0('0x37')](_0x4403bb,{'type':db['Sequelize'][_0xd5b0('0x59')][_0xd5b0('0x5b')],'raw':!![],'transaction':_0x250d8e});})[_0xd5b0('0x2a')](function(_0xac6653){var _0x41b55a=_[_0xd5b0('0x2f')](_0xac6653,function(_0x10e28c){return Number(_0x10e28c[_0xd5b0('0x5f')]);});return db['UserMailQueue'][_0xd5b0('0x55')]({'where':{'UserId':{'$in':_0x191a00},'MailQueueId':{'$in':_0x41b55a}},'transaction':_0x250d8e});})[_0xd5b0('0x2a')](function(){var _0x5a9c9a='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x325d72;return db[_0xd5b0('0x56')][_0xd5b0('0x37')](_0x5a9c9a,{'type':db['Sequelize']['QueryTypes'][_0xd5b0('0x5b')],'raw':!![],'transaction':_0x250d8e});})[_0xd5b0('0x2a')](function(_0x1c5467){var _0x5768cc=_[_0xd5b0('0x2f')](_0x1c5467,function(_0x1a588b){return Number(_0x1a588b['SmsQueueId']);});return db[_0xd5b0('0x60')][_0xd5b0('0x55')]({'where':{'UserId':{'$in':_0x191a00},'SmsQueueId':{'$in':_0x5768cc}},'transaction':_0x250d8e});})[_0xd5b0('0x2a')](function(){var _0xeb883b=_0xd5b0('0x61')+_0x325d72;return db[_0xd5b0('0x56')][_0xd5b0('0x37')](_0xeb883b,{'type':db['Sequelize']['QueryTypes'][_0xd5b0('0x5b')],'raw':!![],'transaction':_0x250d8e});})[_0xd5b0('0x2a')](function(_0x435a8c){var _0x5167a5=_['map'](_0x435a8c,function(_0x20c2d0){return Number(_0x20c2d0[_0xd5b0('0x62')]);});return db[_0xd5b0('0x63')][_0xd5b0('0x55')]({'where':{'UserId':{'$in':_0x191a00},'ChatQueueId':{'$in':_0x5167a5}},'transaction':_0x250d8e});})[_0xd5b0('0x2a')](function(){var _0x2c6bb8=_0xd5b0('0x64')+_0x325d72;return db['sequelize'][_0xd5b0('0x37')](_0x2c6bb8,{'type':db[_0xd5b0('0x58')]['QueryTypes'][_0xd5b0('0x5b')],'raw':!![],'transaction':_0x250d8e});})[_0xd5b0('0x2a')](function(_0x322622){var _0x4e91a4=_[_0xd5b0('0x2f')](_0x322622,function(_0x2b1cb2){return Number(_0x2b1cb2[_0xd5b0('0x65')]);});return db[_0xd5b0('0x66')]['destroy']({'where':{'UserId':{'$in':_0x191a00},'FaxQueueId':{'$in':_0x4e91a4}},'transaction':_0x250d8e});})[_0xd5b0('0x2a')](function(){var _0x29e473=_0xd5b0('0x67')+_0x325d72;return db[_0xd5b0('0x56')]['query'](_0x29e473,{'type':db[_0xd5b0('0x58')][_0xd5b0('0x59')][_0xd5b0('0x5b')],'raw':!![],'transaction':_0x250d8e});})[_0xd5b0('0x2a')](function(_0x2b5707){var _0x461c9f=_[_0xd5b0('0x2f')](_0x2b5707,function(_0x47aada){return Number(_0x47aada['OpenchannelQueueId']);});return db[_0xd5b0('0x68')][_0xd5b0('0x55')]({'where':{'UserId':{'$in':_0x191a00},'OpenchannelQueueId':{'$in':_0x461c9f}},'transaction':_0x250d8e});})[_0xd5b0('0x2a')](function(){var _0x1b6c15='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x325d72;return db[_0xd5b0('0x56')][_0xd5b0('0x37')](_0x1b6c15,{'type':db[_0xd5b0('0x58')][_0xd5b0('0x59')]['SELECT'],'raw':!![],'transaction':_0x250d8e});})[_0xd5b0('0x2a')](function(_0x5dfbd5){var _0x5dcc6c=_[_0xd5b0('0x2f')](_0x5dfbd5,function(_0x572fb7){return Number(_0x572fb7[_0xd5b0('0x69')]);});return db[_0xd5b0('0x6a')][_0xd5b0('0x55')]({'where':{'UserId':{'$in':_0x191a00},'WhatsappQueueId':{'$in':_0x5dcc6c}},'transaction':_0x250d8e});})[_0xd5b0('0x2a')](function(){return db[_0xd5b0('0x6b')][_0xd5b0('0x4a')]({'where':{'TeamId':_0x325d72}});})[_0xd5b0('0x2a')](function(_0x5181ed){if(_0x5181ed===null){return;}return db[_0xd5b0('0x6c')]['destroy']({'where':{'UserId':{'$in':_0x191a00},'VoicePrefixId':_0x5181ed[_0xd5b0('0x6d')]},'transaction':_0x250d8e});})[_0xd5b0('0x2a')](function(){return db[_0xd5b0('0x30')][_0xd5b0('0x55')]({'where':{'id':_0x325d72},'cascade':!![],'transaction':_0x250d8e});})[_0xd5b0('0x2a')](function(_0xb8e4ef){if(_0xb8e4ef===0x0){_0x431490[_0xd5b0('0x1f')](0x194);}else{return db[_0xd5b0('0x6e')][_0xd5b0('0x55')]({'where':{'type':'Teams','resourceId':_0x325d72},'cascade':!![],'transaction':_0x250d8e})[_0xd5b0('0x2a')](function(){_0x431490['status'](0xcc)['end']();});}})['catch'](function(_0x4bfa5c){_0x431490[_0xd5b0('0x20')](0x1f4)[_0xd5b0('0x2d')](_0x4bfa5c);});});};exports[_0xd5b0('0x6f')]=function(_0x3d69de,_0x5213f9,_0x2c1fc7){return db[_0xd5b0('0x30')][_0xd5b0('0x70')]({'where':{'id':_0x3d69de[_0xd5b0('0x46')]['id']}})[_0xd5b0('0x2a')](handleEntityNotFound(_0x5213f9,null))['then'](function(_0x2bb16d){if(!_0x3d69de[_0xd5b0('0x37')][_0xd5b0('0x71')]||!utils[_0xd5b0('0x72')](_0x3d69de[_0xd5b0('0x37')][_0xd5b0('0x71')])){throw new db['Sequelize'][(_0xd5b0('0x73'))](_0xd5b0('0x74'));}var _0x1657c2={};var _0xf06a61={};_0xf06a61[_0xd5b0('0x35')]=_[_0xd5b0('0x36')](db[_[_0xd5b0('0x75')](_0x3d69de[_0xd5b0('0x37')][_0xd5b0('0x71')][_0xd5b0('0x76')]())+'Queue'][_0xd5b0('0x31')]);_0xf06a61[_0xd5b0('0x37')]=_[_0xd5b0('0x36')](_0x3d69de['query']);_0xf06a61['filters']=_[_0xd5b0('0x39')](_0xf06a61[_0xd5b0('0x35')],_0xf06a61[_0xd5b0('0x37')]);_0x1657c2['attributes']=_[_0xd5b0('0x39')](_0xf06a61['model'],qs[_0xd5b0('0x47')](_0x3d69de[_0xd5b0('0x37')]['fields']));_0x1657c2[_0xd5b0('0x3a')]=_0x1657c2[_0xd5b0('0x3a')][_0xd5b0('0x3b')]?_0x1657c2[_0xd5b0('0x3a')]:_0xf06a61[_0xd5b0('0x35')];_0x1657c2[_0xd5b0('0x24')]=qs[_0xd5b0('0x24')](_0x3d69de[_0xd5b0('0x37')][_0xd5b0('0x24')]);_0x1657c2['offset']=qs[_0xd5b0('0x22')](_0x3d69de[_0xd5b0('0x37')]['offset']);_0x1657c2['order']=qs[_0xd5b0('0x3d')](_0x3d69de['query'][_0xd5b0('0x3d')]);_0x1657c2[_0xd5b0('0x3f')]=qs['filters'](_[_0xd5b0('0x77')](_0x3d69de['query'],_0xf06a61[_0xd5b0('0x38')]));_0x1657c2=_[_0xd5b0('0x49')]({},_0x1657c2,_0x3d69de['options']);return _0x2bb16d[_0xd5b0('0x4e')+_[_0xd5b0('0x75')](_0x3d69de[_0xd5b0('0x37')]['channel'][_0xd5b0('0x76')]())+_0xd5b0('0x78')](_0x1657c2);})[_0xd5b0('0x2a')](respondWithResult(_0x5213f9,null))[_0xd5b0('0x44')](handleError(_0x5213f9,null));};exports['addQueues']=function(_0xb4065e,_0x3dd613,_0x3ae165){return db[_0xd5b0('0x30')][_0xd5b0('0x70')]({'where':{'id':_0xb4065e[_0xd5b0('0x46')]['id']}})[_0xd5b0('0x2a')](function(_0x5f05a6){if(_0x5f05a6){if(!_0xb4065e[_0xd5b0('0x4c')][_0xd5b0('0x71')]||!utils[_0xd5b0('0x72')](_0xb4065e[_0xd5b0('0x4c')][_0xd5b0('0x71')])){throw new db[(_0xd5b0('0x58'))][(_0xd5b0('0x73'))](_0xd5b0('0x74'));}return _0x5f05a6['add'+_[_0xd5b0('0x75')](_0xb4065e['body'][_0xd5b0('0x71')]['toLowerCase']())+'Queues'](_0xb4065e[_0xd5b0('0x4c')][_0xd5b0('0x79')]);}return null;})[_0xd5b0('0x2a')](handleEntityNotFound(_0x3dd613,null))[_0xd5b0('0x2a')](respondWithStatusCode(_0x3dd613,null))['catch'](handleError(_0x3dd613,null));};exports['removeQueues']=function(_0x515b89,_0x238387,_0x3bb3c6){return db['Team']['findOne']({'where':{'id':_0x515b89[_0xd5b0('0x46')]['id']}})['then'](function(_0x4d188c){if(_0x4d188c){if(!_0x515b89['query']['channel']||!utils[_0xd5b0('0x72')](_0x515b89[_0xd5b0('0x37')][_0xd5b0('0x71')])){throw new db[(_0xd5b0('0x58'))][(_0xd5b0('0x73'))](_0xd5b0('0x74'));}return _0x4d188c[_0xd5b0('0x7a')+_['capitalize'](_0x515b89['query']['channel'][_0xd5b0('0x76')]())+_0xd5b0('0x78')](_0x515b89['query']['ids']);}return null;})['then'](handleEntityNotFound(_0x238387,null))['then'](respondWithStatusCode(_0x238387,null))[_0xd5b0('0x44')](handleError(_0x238387,null));};exports['addAgents']=function(_0x109d94,_0x172e8f){var _0x4f88b0=_[_0xd5b0('0x7b')](_0x109d94[_0xd5b0('0x4c')][_0xd5b0('0x79')])?_0x109d94[_0xd5b0('0x4c')][_0xd5b0('0x79')]:[_0x109d94[_0xd5b0('0x4c')][_0xd5b0('0x79')]];var _0x4e92ae=_0x109d94['params']['id'];return db[_0xd5b0('0x30')]['find']({'where':{'id':_0x4e92ae}})[_0xd5b0('0x2a')](handleEntityNotFound(_0x172e8f,null))[_0xd5b0('0x2a')](function(_0x405420){if(_0x405420){var _0x4e3a50=[_0xd5b0('0x7c'),_0xd5b0('0x7d'),'Mail','Sms',_0xd5b0('0x7e'),_0xd5b0('0x7f'),_0xd5b0('0x80')];return db[_0xd5b0('0x56')][_0xd5b0('0x81')](function(_0x4d1603){var _0x381237=_[_0xd5b0('0x2f')](_0x4e3a50,function(_0x1cd425){var _0x3fc768={'attributes':['id',_0xd5b0('0x2c')]};if(_0x1cd425===_0xd5b0('0x7c')){_0x3fc768[_0xd5b0('0x82')]={'attributes':[_0xd5b0('0x83')]};}return _0x405420[_0xd5b0('0x4e')+_0x1cd425+_0xd5b0('0x78')](_0x3fc768)['then'](function(_0x32ebdc){var _0x325557=_['map'](_0x32ebdc,function(_0x40c554){var _0x508abe=_[_0xd5b0('0x2f')](_0x4f88b0,function(_0x398518){var _0x1e80a5={'where':{'UserId':_0x398518,[_0x1cd425+_0xd5b0('0x84')]:_0x40c554['id']},'transaction':_0x4d1603};if(_0x1cd425==='Voice'){_0x1e80a5[_0xd5b0('0x1a')]={'penalty':_0x40c554[_0xd5b0('0x85')][_0xd5b0('0x83')]};}return db['User'+_0x1cd425+_0xd5b0('0x86')][_0xd5b0('0x87')](_0x1e80a5)[_0xd5b0('0x2a')](function(){socket[_0xd5b0('0x88')](_0xd5b0('0x4d')+_0x1cd425+'Queue:save',{'UserId':_0x398518,[_0x1cd425+'QueueId']:_0x40c554['id']});if(_0x1cd425!=='Voice'){return;}return db['User'][_0xd5b0('0x89')]({'where':{'id':_0x4f88b0,'online':0x1},'attributes':['id',_0xd5b0('0x2c'),'online',_0xd5b0('0x8a'),'interface'],'raw':!![]})[_0xd5b0('0x2a')](function(_0x379ddb){var _0x1a176d=_[_0xd5b0('0x2f')](_0x379ddb,function(_0x27fb2b){return db['UserVoiceQueueRt'][_0xd5b0('0x8b')]({'membername':_0x27fb2b['name'],'UserId':_0x27fb2b['id'],'queue_name':_0x40c554['name'],'VoiceQueueId':_0x40c554['id'],'interface':_[_0xd5b0('0x8c')](_0x27fb2b[_0xd5b0('0x8d')])?util[_0xd5b0('0x8e')]('SIP/%s',_0x27fb2b[_0xd5b0('0x2c')]):_0x27fb2b[_0xd5b0('0x8d')],'paused':_0x27fb2b[_0xd5b0('0x8a')]||![],'penalty':_0x40c554[_0xd5b0('0x85')]['penalty']},{'transaction':_0x4d1603});});return Promise[_0xd5b0('0x8f')](_0x1a176d);});});});return Promise[_0xd5b0('0x8f')](_0x508abe);});return Promise['all'](_0x325557);})['then'](function(){return db[_0xd5b0('0x6b')][_0xd5b0('0x70')]({'where':{'teamId':_0x4e92ae}})[_0xd5b0('0x2a')](function(_0x3571da){if(_0x3571da){var _0x4737c0=_[_0xd5b0('0x2f')](_0x4f88b0,function(_0x52e2df){db[_0xd5b0('0x6c')][_0xd5b0('0x8b')]({'UserId':_0x52e2df,'VoicePrefixId':_0x3571da[_0xd5b0('0x6d')]});});return Promise[_0xd5b0('0x8f')](_0x4737c0);}});});});return Promise['all'](_0x381237)['then'](function(){return _0x405420[_0xd5b0('0x90')](_0x4f88b0,{'transaction':_0x4d1603})['spread'](function(_0x1bd8b9){return _0x1bd8b9;});});});}})[_0xd5b0('0x2a')](respondWithResult(_0x172e8f,null))['catch'](handleError(_0x172e8f,null));};exports[_0xd5b0('0x91')]=function(_0x56ab5b,_0x399da8){var _0x356c0c=_[_0xd5b0('0x7b')](_0x56ab5b[_0xd5b0('0x37')][_0xd5b0('0x79')])?_0x56ab5b[_0xd5b0('0x37')][_0xd5b0('0x79')]:[_0x56ab5b[_0xd5b0('0x37')][_0xd5b0('0x79')]];var _0x3fd37e=_0x56ab5b['params']['id'];return db[_0xd5b0('0x30')]['find']({'where':{'id':_0x3fd37e}})[_0xd5b0('0x2a')](handleEntityNotFound(_0x399da8,null))['then'](function(_0x295d71){if(_0x295d71){var _0x4b2d04=['Voice','Chat','Mail','Sms',_0xd5b0('0x7e'),_0xd5b0('0x7f'),'Whatsapp'];return db['sequelize'][_0xd5b0('0x81')](function(_0x48e9d7){var _0x12780f=_[_0xd5b0('0x2f')](_0x4b2d04,function(_0x34cbe6){var _0x273b26={'attributes':['id',_0xd5b0('0x2c')]};return _0x295d71[_0xd5b0('0x4e')+_0x34cbe6+_0xd5b0('0x78')](_0x273b26)[_0xd5b0('0x2a')](function(_0x38cd65){var _0x4da9d6=_['map'](_0x38cd65,function(_0x4f15d3){return _0x4f15d3[_0xd5b0('0x91')](_0x356c0c,{'transaction':_0x48e9d7})[_0xd5b0('0x2a')](function(){var _0x417a1b=_[_0xd5b0('0x2f')](_0x356c0c,function(_0x141505){socket[_0xd5b0('0x88')]('user'+_0x34cbe6+_0xd5b0('0x92'),{'UserId':Number(_0x141505),[_0x34cbe6+'QueueId']:_0x4f15d3['id']});if(_0x34cbe6!=='Voice'){return;}return db[_0xd5b0('0x93')][_0xd5b0('0x55')]({'where':{'VoiceQueueId':_0x4f15d3['id'],'UserId':_0x141505},'transaction':_0x48e9d7});});return Promise['all'](_0x417a1b);});});return Promise[_0xd5b0('0x8f')](_0x4da9d6);});});return Promise['all'](_0x12780f)[_0xd5b0('0x2a')](function(){return _0x295d71[_0xd5b0('0x91')](_0x356c0c,{'transaction':_0x48e9d7});})['then'](function(){return db[_0xd5b0('0x6b')]['findOne']({'where':{'teamId':_0x3fd37e}})[_0xd5b0('0x2a')](function(_0x679d5e){if(_0x679d5e){var _0x45ae17=_[_0xd5b0('0x2f')](_0x356c0c,function(_0x4b9436){db[_0xd5b0('0x6c')][_0xd5b0('0x55')]({'where':{'UserId':_0x4b9436,'VoicePrefixId':_0x679d5e[_0xd5b0('0x6d')]}});});return Promise[_0xd5b0('0x8f')](_0x45ae17);}});});});}})[_0xd5b0('0x2a')](respondWithStatusCode(_0x399da8,null))[_0xd5b0('0x44')](handleError(_0x399da8,null));};exports[_0xd5b0('0x94')]=function(_0x2ca927,_0x31fece,_0x471af8){var _0x272e48={};var _0x4eb492={};var _0x2d4b0e;var _0x5843b1;return db[_0xd5b0('0x30')][_0xd5b0('0x70')]({'where':{'id':_0x2ca927[_0xd5b0('0x46')]['id']}})[_0xd5b0('0x2a')](handleEntityNotFound(_0x31fece,null))[_0xd5b0('0x2a')](function(_0x4f51ac){if(_0x4f51ac){_0x2d4b0e=_0x4f51ac;_0x4eb492[_0xd5b0('0x35')]=_[_0xd5b0('0x36')](db[_0xd5b0('0x95')][_0xd5b0('0x31')]);_0x4eb492[_0xd5b0('0x37')]=_[_0xd5b0('0x36')](_0x2ca927['query']);_0x4eb492['filters']=_[_0xd5b0('0x39')](_0x4eb492[_0xd5b0('0x35')],_0x4eb492[_0xd5b0('0x37')]);_0x272e48[_0xd5b0('0x3a')]=_[_0xd5b0('0x39')](_0x4eb492[_0xd5b0('0x35')],qs[_0xd5b0('0x47')](_0x2ca927['query'][_0xd5b0('0x47')]));_0x272e48['attributes']=_0x272e48[_0xd5b0('0x3a')][_0xd5b0('0x3b')]?_0x272e48['attributes']:_0x4eb492[_0xd5b0('0x35')];_0x272e48[_0xd5b0('0x96')]=qs[_0xd5b0('0x3d')](_0x2ca927[_0xd5b0('0x37')][_0xd5b0('0x3d')]);_0x272e48[_0xd5b0('0x3f')]=qs[_0xd5b0('0x38')](_[_0xd5b0('0x77')](_0x2ca927[_0xd5b0('0x37')],_0x4eb492['filters']));if(_0x2ca927['query'][_0xd5b0('0x3e')]){_0x272e48[_0xd5b0('0x3f')]=_[_0xd5b0('0x49')](_0x272e48[_0xd5b0('0x3f')],{'$or':_[_0xd5b0('0x2f')](_0x272e48[_0xd5b0('0x3a')],function(_0x106039){var _0x277038={};_0x277038[_0x106039]={'$like':'%'+_0x2ca927['query'][_0xd5b0('0x3e')]+'%'};return _0x277038;})});}_0x272e48=_[_0xd5b0('0x49')]({},_0x272e48,_0x2ca927[_0xd5b0('0x41')]);return _0x2d4b0e[_0xd5b0('0x94')](_0x272e48);}})[_0xd5b0('0x2a')](function(_0x4da7c0){if(_0x4da7c0){_0x5843b1=_0x4da7c0[_0xd5b0('0x3b')];if(!_0x2ca927['query'][_0xd5b0('0x97')]('nolimit')){_0x272e48[_0xd5b0('0x24')]=qs[_0xd5b0('0x24')](_0x2ca927[_0xd5b0('0x37')][_0xd5b0('0x24')]);_0x272e48[_0xd5b0('0x22')]=qs[_0xd5b0('0x22')](_0x2ca927[_0xd5b0('0x37')][_0xd5b0('0x22')]);}return _0x2d4b0e['getAgents'](_0x272e48);}})['then'](function(_0x68ff4e){if(_0x68ff4e){return _0x68ff4e?{'count':_0x5843b1,'rows':_0x68ff4e}:null;}})[_0xd5b0('0x2a')](respondWithResult(_0x31fece,null))[_0xd5b0('0x44')](handleError(_0x31fece,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index a2a0c1d..fc6ba3b 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 _0xae59=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x22c5d3,_0x5ba8e6){var _0x525fbb=function(_0x2b68ae){while(--_0x2b68ae){_0x22c5d3['push'](_0x22c5d3['shift']());}};_0x525fbb(++_0x5ba8e6);}(_0xae59,0x12f));var _0x9ae5=function(_0x48e506,_0xfdd895){_0x48e506=_0x48e506-0x0;var _0x581d84=_0xae59[_0x48e506];return _0x581d84;};'use strict';var EventEmitter=require(_0x9ae5('0x0'));var Team=require(_0x9ae5('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x9ae5('0x2')](0x0);var events={'afterCreate':_0x9ae5('0x3'),'afterUpdate':_0x9ae5('0x4'),'afterDestroy':_0x9ae5('0x5')};function emitEvent(_0x183ebf){return function(_0x35ae64,_0x216df7,_0x576290){TeamEvents[_0x9ae5('0x6')](_0x183ebf+':'+_0x35ae64['id'],_0x35ae64);TeamEvents['emit'](_0x183ebf,_0x35ae64);_0x576290(null);};}for(var e in events){if(events[_0x9ae5('0x7')](e)){var event=events[e];Team[_0x9ae5('0x8')](e,emitEvent(event));}}module[_0x9ae5('0x9')]=TeamEvents; \ No newline at end of file +var _0x5c85=['hasOwnProperty','hook','exports','../../mysqldb','Team','setMaxListeners','save','emit'];(function(_0x3b12d5,_0x59d7e7){var _0xae69dd=function(_0x42678a){while(--_0x42678a){_0x3b12d5['push'](_0x3b12d5['shift']());}};_0xae69dd(++_0x59d7e7);}(_0x5c85,0x1d3));var _0x55c8=function(_0x17b34d,_0x1f98b1){_0x17b34d=_0x17b34d-0x0;var _0x59b126=_0x5c85[_0x17b34d];return _0x59b126;};'use strict';var EventEmitter=require('events');var Team=require(_0x55c8('0x0'))['db'][_0x55c8('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x55c8('0x2')](0x0);var events={'afterCreate':_0x55c8('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x67d3b4){return function(_0x12d30a,_0x5c85ef,_0x92ca88){TeamEvents[_0x55c8('0x4')](_0x67d3b4+':'+_0x12d30a['id'],_0x12d30a);TeamEvents['emit'](_0x67d3b4,_0x12d30a);_0x92ca88(null);};}for(var e in events){if(events[_0x55c8('0x5')](e)){var event=events[e];Team[_0x55c8('0x6')](e,emitEvent(event));}}module[_0x55c8('0x7')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 771b85c..d290552 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 _0x01cf=['Team','teams','Chat','Mail','Openchannel','Sms','Whatsapp','resolve','all','catch','lodash','./team.attributes','Queues','then','map','channel','exports'];(function(_0x463cd9,_0x3e68d0){var _0x23eadd=function(_0x1b1e10){while(--_0x1b1e10){_0x463cd9['push'](_0x463cd9['shift']());}};_0x23eadd(++_0x3e68d0);}(_0x01cf,0x191));var _0xf01c=function(_0x4686d3,_0x1983f7){_0x4686d3=_0x4686d3-0x0;var _0x5ec0d9=_0x01cf[_0x4686d3];return _0x5ec0d9;};'use strict';var _=require(_0xf01c('0x0'));var attributes=require(_0xf01c('0x1'));function getQueuesByChannel(_0x1a0220,_0x5992d3){var _0x45d243='get'+_0x5992d3+_0xf01c('0x2');return _0x1a0220[_0x45d243]()[_0xf01c('0x3')](function(_0x5bdb98){return _[_0xf01c('0x4')](_0x5bdb98,function(_0x1fa963){_0x1fa963['setDataValue'](_0xf01c('0x5'),_0x5992d3);return _0x1fa963;});})['catch'](function(_0x53a022){throw _0x53a022;});}module[_0xf01c('0x6')]=function(_0x1b33a5){return _0x1b33a5['define'](_0xf01c('0x7'),attributes,{'tableName':_0xf01c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x4e1905=this;var _0x1dc95c=[_0xf01c('0x9'),'Fax',_0xf01c('0xa'),_0xf01c('0xb'),_0xf01c('0xc'),'Voice',_0xf01c('0xd')];return Promise[_0xf01c('0xe')]()[_0xf01c('0x3')](function(){var _0x1f59e9=_['map'](_0x1dc95c,function(_0x109dc8){return getQueuesByChannel(_0x4e1905,_0x109dc8);});return Promise[_0xf01c('0xf')](_0x1f59e9);})[_0xf01c('0x10')](function(_0x553bd2){throw _0x553bd2;});}}});}; \ No newline at end of file +var _0xfa87=['Chat','Fax','Mail','Openchannel','Sms','Voice','then','all','lodash','./team.attributes','get','Queues','map','channel','catch','exports','define','Team','teams'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfa87,0xa0));var _0x7fa8=function(_0x5a9e32,_0x3197fd){_0x5a9e32=_0x5a9e32-0x0;var _0x521b3f=_0xfa87[_0x5a9e32];return _0x521b3f;};'use strict';var _=require(_0x7fa8('0x0'));var attributes=require(_0x7fa8('0x1'));function getQueuesByChannel(_0x413f98,_0x268fc7){var _0x1798f3=_0x7fa8('0x2')+_0x268fc7+_0x7fa8('0x3');return _0x413f98[_0x1798f3]()['then'](function(_0x34d70c){return _[_0x7fa8('0x4')](_0x34d70c,function(_0x4aab1f){_0x4aab1f['setDataValue'](_0x7fa8('0x5'),_0x268fc7);return _0x4aab1f;});})[_0x7fa8('0x6')](function(_0x649da3){throw _0x649da3;});}module[_0x7fa8('0x7')]=function(_0x39e3bc){return _0x39e3bc[_0x7fa8('0x8')](_0x7fa8('0x9'),attributes,{'tableName':_0x7fa8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x5b9b66=this;var _0x476330=[_0x7fa8('0xb'),_0x7fa8('0xc'),_0x7fa8('0xd'),_0x7fa8('0xe'),_0x7fa8('0xf'),_0x7fa8('0x10'),'Whatsapp'];return Promise['resolve']()[_0x7fa8('0x11')](function(){var _0x161c82=_[_0x7fa8('0x4')](_0x476330,function(_0x4a9b1e){return getQueuesByChannel(_0x5b9b66,_0x4a9b1e);});return Promise[_0x7fa8('0x12')](_0x161c82);})[_0x7fa8('0x6')](function(_0x5e2c8f){throw _0x5e2c8f;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index ccb7c82..028b3be 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 _0xfeb3=['./team.socket','register','request','then','info','debug','request\x20sent','stringify','error','code','message','Team,\x20%s,\x20%s','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost'];(function(_0x221e3b,_0x42dd86){var _0x48d01d=function(_0x2caf35){while(--_0x2caf35){_0x221e3b['push'](_0x221e3b['shift']());}};_0x48d01d(++_0x42dd86);}(_0xfeb3,0x11c));var _0x3feb=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xfeb3[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3feb('0x0'));var BPromise=require(_0x3feb('0x1'));var rs=require(_0x3feb('0x2'));var fs=require('fs');var Redis=require(_0x3feb('0x3'));var db=require(_0x3feb('0x4'))['db'];var utils=require(_0x3feb('0x5'));var logger=require(_0x3feb('0x6'))(_0x3feb('0x7'));var config=require(_0x3feb('0x8'));var jayson=require(_0x3feb('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x3feb('0xa')]=_[_0x3feb('0xb')](config[_0x3feb('0xa')],{'host':_0x3feb('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3feb('0xa')]));require(_0x3feb('0xd'))[_0x3feb('0xe')](socket);function respondWithRpcPromise(_0x4466cf,_0x5e163f,_0xde42e9){return new BPromise(function(_0x56f765,_0x35efed){return client[_0x3feb('0xf')](_0x4466cf,_0xde42e9)[_0x3feb('0x10')](function(_0x14ac11){logger[_0x3feb('0x11')]('Team,\x20%s,\x20%s',_0x5e163f,'request\x20sent');logger[_0x3feb('0x12')]('Team,\x20%s,\x20%s,\x20%s',_0x5e163f,_0x3feb('0x13'),JSON[_0x3feb('0x14')](_0x14ac11));if(_0x14ac11['error']){if(_0x14ac11[_0x3feb('0x15')][_0x3feb('0x16')]===0x1f4){logger[_0x3feb('0x15')]('Team,\x20%s,\x20%s',_0x5e163f,_0x14ac11[_0x3feb('0x15')]['message']);return _0x35efed(_0x14ac11[_0x3feb('0x15')][_0x3feb('0x17')]);}logger['error'](_0x3feb('0x18'),_0x5e163f,_0x14ac11['error']['message']);return _0x56f765(_0x14ac11[_0x3feb('0x15')][_0x3feb('0x17')]);}else{logger[_0x3feb('0x11')](_0x3feb('0x18'),_0x5e163f,'request\x20sent');_0x56f765(_0x14ac11[_0x3feb('0x19')][_0x3feb('0x17')]);}})[_0x3feb('0x1a')](function(_0x2f2134){logger['error'](_0x3feb('0x18'),_0x5e163f,_0x2f2134);_0x35efed(_0x2f2134);});});} \ No newline at end of file +var _0x863b=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./team.socket','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x26b2cf,_0x44e3cc){var _0x55c135=function(_0x21945e){while(--_0x21945e){_0x26b2cf['push'](_0x26b2cf['shift']());}};_0x55c135(++_0x44e3cc);}(_0x863b,0x122));var _0xb863=function(_0x58965a,_0x2e71db){_0x58965a=_0x58965a-0x0;var _0x254efc=_0x863b[_0x58965a];return _0x254efc;};'use strict';var _=require(_0xb863('0x0'));var util=require(_0xb863('0x1'));var moment=require(_0xb863('0x2'));var BPromise=require(_0xb863('0x3'));var rs=require(_0xb863('0x4'));var fs=require('fs');var Redis=require(_0xb863('0x5'));var db=require(_0xb863('0x6'))['db'];var utils=require(_0xb863('0x7'));var logger=require(_0xb863('0x8'))('rpc');var config=require(_0xb863('0x9'));var jayson=require(_0xb863('0xa'));var client=jayson[_0xb863('0xb')][_0xb863('0xc')]({'port':0x232a});config[_0xb863('0xd')]=_[_0xb863('0xe')](config[_0xb863('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xb863('0xf'))(new Redis(config[_0xb863('0xd')]));require(_0xb863('0x10'))['register'](socket);function respondWithRpcPromise(_0x418e92,_0x3805ab,_0x377746){return new BPromise(function(_0x2cc746,_0x46bff3){return client[_0xb863('0x11')](_0x418e92,_0x377746)[_0xb863('0x12')](function(_0x3f26fe){logger[_0xb863('0x13')](_0xb863('0x14'),_0x3805ab,_0xb863('0x15'));logger[_0xb863('0x16')](_0xb863('0x17'),_0x3805ab,_0xb863('0x15'),JSON['stringify'](_0x3f26fe));if(_0x3f26fe[_0xb863('0x18')]){if(_0x3f26fe['error'][_0xb863('0x19')]===0x1f4){logger[_0xb863('0x18')](_0xb863('0x14'),_0x3805ab,_0x3f26fe[_0xb863('0x18')]['message']);return _0x46bff3(_0x3f26fe['error'][_0xb863('0x1a')]);}logger[_0xb863('0x18')](_0xb863('0x14'),_0x3805ab,_0x3f26fe['error']['message']);return _0x2cc746(_0x3f26fe['error'][_0xb863('0x1a')]);}else{logger[_0xb863('0x13')](_0xb863('0x14'),_0x3805ab,_0xb863('0x15'));_0x2cc746(_0x3f26fe[_0xb863('0x1b')]['message']);}})[_0xb863('0x1c')](function(_0xfd96fa){logger[_0xb863('0x18')](_0xb863('0x14'),_0x3805ab,_0xfd96fa);_0x46bff3(_0xfd96fa);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index e300eaf..d565124 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 _0x4e8d=['remove','update','emit','removeListener','register','team:','./team.events','save'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x4e8d,0x11e));var _0xd4e8=function(_0x5b90f2,_0x56f698){_0x5b90f2=_0x5b90f2-0x0;var _0x297425=_0x4e8d[_0x5b90f2];return _0x297425;};'use strict';var TeamEvents=require(_0xd4e8('0x0'));var events=[_0xd4e8('0x1'),_0xd4e8('0x2'),_0xd4e8('0x3')];function createListener(_0x25017b,_0x117af1){return function(_0x5d6fd8){_0x117af1[_0xd4e8('0x4')](_0x25017b,_0x5d6fd8);};}function removeListener(_0x95f04c,_0x131227){return function(){TeamEvents[_0xd4e8('0x5')](_0x95f04c,_0x131227);};}exports[_0xd4e8('0x6')]=function(_0x582778){for(var _0x459ce0=0x0,_0x5c8a29=events['length'];_0x459ce0<_0x5c8a29;_0x459ce0++){var _0x22c8ee=events[_0x459ce0];var _0x16c492=createListener(_0xd4e8('0x7')+_0x22c8ee,_0x582778);TeamEvents['on'](_0x22c8ee,_0x16c492);}}; \ No newline at end of file +var _0xe9f9=['./team.events','remove','update','removeListener','register','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe9f9,0x174));var _0x9e9f=function(_0x2ffbd6,_0x5317dd){_0x2ffbd6=_0x2ffbd6-0x0;var _0x2c1f61=_0xe9f9[_0x2ffbd6];return _0x2c1f61;};'use strict';var TeamEvents=require(_0x9e9f('0x0'));var events=['save',_0x9e9f('0x1'),_0x9e9f('0x2')];function createListener(_0x24e489,_0x439590){return function(_0x15d8d0){_0x439590['emit'](_0x24e489,_0x15d8d0);};}function removeListener(_0x2020b3,_0x47f4c7){return function(){TeamEvents[_0x9e9f('0x3')](_0x2020b3,_0x47f4c7);};}exports[_0x9e9f('0x4')]=function(_0x549ea5){for(var _0x32da7a=0x0,_0x54f87c=events[_0x9e9f('0x5')];_0x32da7a<_0x54f87c;_0x32da7a++){var _0x661886=events[_0x32da7a];var _0x10d43b=createListener('team:'+_0x661886,_0x549ea5);TeamEvents['on'](_0x661886,_0x10d43b);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 7066563..2abd4a2 100644 --- a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js +++ b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd3d1=['sequelize','exports'];(function(_0x30cc47,_0x47243c){var _0x4d03b1=function(_0x3b3744){while(--_0x3b3744){_0x30cc47['push'](_0x30cc47['shift']());}};_0x4d03b1(++_0x47243c);}(_0xd3d1,0x172));var _0x1d3d=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xd3d1[_0x13d07a];return _0x5ee0ee;};'use strict';var Sequelize=require(_0x1d3d('0x0'));module[_0x1d3d('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x4e70=['sequelize','exports','INTEGER'];(function(_0x4cd645,_0x17b949){var _0x1510e3=function(_0x19c288){while(--_0x19c288){_0x4cd645['push'](_0x4cd645['shift']());}};_0x1510e3(++_0x17b949);}(_0x4e70,0x69));var _0x04e7=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0x4e70[_0x87b0ff];return _0x3bc0b2;};'use strict';var Sequelize=require(_0x04e7('0x0'));module[_0x04e7('0x1')]={'TeamId':{'type':Sequelize[_0x04e7('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x04e7('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 3ffa960..1bc314d 100644 --- a/server/api/teamVoicePrefix/teamVoicePrefix.model.js +++ b/server/api/teamVoicePrefix/teamVoicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc04a=['exports','team_has_voice_prefixes','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./teamVoicePrefix.attributes'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xc04a,0x12e));var _0xac04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc04a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xac04('0x0'));var util=require('util');var logger=require(_0xac04('0x1'))('api');var moment=require(_0xac04('0x2'));var BPromise=require(_0xac04('0x3'));var rp=require(_0xac04('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xac04('0x5'));var config=require(_0xac04('0x6'));var attributes=require(_0xac04('0x7'));module[_0xac04('0x8')]=function(_0x5add53,_0x5c6f52){return _0x5add53['define']('TeamVoicePrefix',attributes,{'tableName':_0xac04('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1f75=['exports','define','TeamVoicePrefix','team_has_voice_prefixes','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./teamVoicePrefix.attributes'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x1f75,0x13c));var _0x51f7=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x1f75[_0xdea41a];return _0x15d0d8;};'use strict';var _=require('lodash');var util=require(_0x51f7('0x0'));var logger=require(_0x51f7('0x1'))(_0x51f7('0x2'));var moment=require(_0x51f7('0x3'));var BPromise=require(_0x51f7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x51f7('0x5'));var rimraf=require(_0x51f7('0x6'));var config=require(_0x51f7('0x7'));var attributes=require(_0x51f7('0x8'));module[_0x51f7('0x9')]=function(_0x1fe16a,_0x244646){return _0x1fe16a[_0x51f7('0xa')](_0x51f7('0xb'),attributes,{'tableName':_0x51f7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 21680fe..62244a5 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x42f437,_0x41942b){var _0x4e0810=function(_0x395de9){while(--_0x395de9){_0x42f437['push'](_0x42f437['shift']());}};_0x4e0810(++_0x41942b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xcb91[_0x45d55e];return _0x29812a;};'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(_0x524d33,_0x20ac96){var _0xed033a=function(_0x32c35f){while(--_0x32c35f){_0x524d33['push'](_0x524d33['shift']());}};_0xed033a(++_0x20ac96);}(_0xe706,0xa3));var _0x6e70=function(_0x2cd1fb,_0x291f55){_0x2cd1fb=_0x2cd1fb-0x0;var _0x48fd2b=_0xe706[_0x2cd1fb];return _0x48fd2b;};'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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 646bbb7..8121826 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 _0x1239=['sequelize','exports','INTEGER'];(function(_0x351b35,_0x449c4d){var _0xc10b7a=function(_0xfc655f){while(--_0xfc655f){_0x351b35['push'](_0x351b35['shift']());}};_0xc10b7a(++_0x449c4d);}(_0x1239,0x114));var _0x9123=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1239[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x9123('0x0'));module[_0x9123('0x1')]={'penalty':{'type':Sequelize[_0x9123('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7458=['exports','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7458,0x7c));var _0x8745=function(_0x1a6487,_0x26d9e8){_0x1a6487=_0x1a6487-0x0;var _0x275c9d=_0x7458[_0x1a6487];return _0x275c9d;};'use strict';var Sequelize=require('sequelize');module[_0x8745('0x0')]={'penalty':{'type':Sequelize[_0x8745('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index e0045a1..327cf07 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 _0x3d9c=['request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','lodash','../../config/logger','api','moment'];(function(_0x550e1e,_0x170390){var _0x5a5039=function(_0x5ad48f){while(--_0x5ad48f){_0x550e1e['push'](_0x550e1e['shift']());}};_0x5a5039(++_0x170390);}(_0x3d9c,0x134));var _0xc3d9=function(_0x3e75db,_0x538053){_0x3e75db=_0x3e75db-0x0;var _0x2c782b=_0x3d9c[_0x3e75db];return _0x2c782b;};'use strict';var _=require(_0xc3d9('0x0'));var util=require('util');var logger=require(_0xc3d9('0x1'))(_0xc3d9('0x2'));var moment=require(_0xc3d9('0x3'));var BPromise=require('bluebird');var rp=require(_0xc3d9('0x4'));var fs=require('fs');var path=require(_0xc3d9('0x5'));var rimraf=require(_0xc3d9('0x6'));var config=require(_0xc3d9('0x7'));var attributes=require(_0xc3d9('0x8'));module[_0xc3d9('0x9')]=function(_0x137aaf,_0x492577){return _0x137aaf[_0xc3d9('0xa')](_0xc3d9('0xb'),attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x76a3=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','TeamVoiceQueue','lodash','util','../../config/logger','api'];(function(_0x468e87,_0x289d30){var _0x4da27c=function(_0xc757fd){while(--_0xc757fd){_0x468e87['push'](_0x468e87['shift']());}};_0x4da27c(++_0x289d30);}(_0x76a3,0xf8));var _0x376a=function(_0x20fdc1,_0xde1296){_0x20fdc1=_0x20fdc1-0x0;var _0x25397c=_0x76a3[_0x20fdc1];return _0x25397c;};'use strict';var _=require(_0x376a('0x0'));var util=require(_0x376a('0x1'));var logger=require(_0x376a('0x2'))(_0x376a('0x3'));var moment=require(_0x376a('0x4'));var BPromise=require(_0x376a('0x5'));var rp=require(_0x376a('0x6'));var fs=require('fs');var path=require(_0x376a('0x7'));var rimraf=require(_0x376a('0x8'));var config=require(_0x376a('0x9'));var attributes=require('./teamVoiceQueue.attributes');module['exports']=function(_0x19ea68,_0x22904c){return _0x19ea68[_0x376a('0xa')](_0x376a('0xb'),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 dcded54..282895c 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 _0x46de=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','util','moment','bluebird'];(function(_0x497d39,_0x2fef30){var _0x4a9d8f=function(_0x98eaa4){while(--_0x98eaa4){_0x497d39['push'](_0x497d39['shift']());}};_0x4a9d8f(++_0x2fef30);}(_0x46de,0x9e));var _0xe46d=function(_0x514c15,_0x486901){_0x514c15=_0x514c15-0x0;var _0x16283e=_0x46de[_0x514c15];return _0x16283e;};'use strict';var _=require('lodash');var util=require(_0xe46d('0x0'));var moment=require(_0xe46d('0x1'));var BPromise=require(_0xe46d('0x2'));var rs=require(_0xe46d('0x3'));var fs=require('fs');var Redis=require(_0xe46d('0x4'));var db=require(_0xe46d('0x5'))['db'];var utils=require(_0xe46d('0x6'));var logger=require(_0xe46d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe46d('0x8'));var client=jayson[_0xe46d('0x9')][_0xe46d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24a4ad,_0x591fb8,_0x142366){return new BPromise(function(_0x2a2777,_0x12e35a){return client[_0xe46d('0xb')](_0x24a4ad,_0x142366)[_0xe46d('0xc')](function(_0x146223){logger[_0xe46d('0xd')](_0xe46d('0xe'),_0x591fb8,_0xe46d('0xf'));logger[_0xe46d('0x10')](_0xe46d('0x11'),_0x591fb8,_0xe46d('0xf'),JSON['stringify'](_0x146223));if(_0x146223['error']){if(_0x146223['error'][_0xe46d('0x12')]===0x1f4){logger[_0xe46d('0x13')](_0xe46d('0xe'),_0x591fb8,_0x146223[_0xe46d('0x13')]['message']);return _0x12e35a(_0x146223[_0xe46d('0x13')][_0xe46d('0x14')]);}logger[_0xe46d('0x13')]('TeamVoiceQueue,\x20%s,\x20%s',_0x591fb8,_0x146223[_0xe46d('0x13')][_0xe46d('0x14')]);return _0x2a2777(_0x146223['error'][_0xe46d('0x14')]);}else{logger[_0xe46d('0xd')]('TeamVoiceQueue,\x20%s,\x20%s',_0x591fb8,_0xe46d('0xf'));_0x2a2777(_0x146223[_0xe46d('0x15')][_0xe46d('0x14')]);}})[_0xe46d('0x16')](function(_0x4bf5c6){logger[_0xe46d('0x13')](_0xe46d('0xe'),_0x591fb8,_0x4bf5c6);_0x12e35a(_0x4bf5c6);});});} \ No newline at end of file +var _0xcc73=['info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request'];(function(_0x3ef2d5,_0x423d46){var _0x2fefb2=function(_0x54f82f){while(--_0x54f82f){_0x3ef2d5['push'](_0x3ef2d5['shift']());}};_0x2fefb2(++_0x423d46);}(_0xcc73,0x1cb));var _0x3cc7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xcc73[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x3cc7('0x0'));var moment=require(_0x3cc7('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3cc7('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x3cc7('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x3cc7('0x4'));var jayson=require(_0x3cc7('0x5'));var client=jayson[_0x3cc7('0x6')][_0x3cc7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x127590,_0x5604df,_0x416c48){return new BPromise(function(_0x37c184,_0x3f2dd7){return client[_0x3cc7('0x8')](_0x127590,_0x416c48)['then'](function(_0x2ff7ba){logger[_0x3cc7('0x9')](_0x3cc7('0xa'),_0x5604df,_0x3cc7('0xb'));logger[_0x3cc7('0xc')](_0x3cc7('0xd'),_0x5604df,_0x3cc7('0xb'),JSON['stringify'](_0x2ff7ba));if(_0x2ff7ba['error']){if(_0x2ff7ba[_0x3cc7('0xe')]['code']===0x1f4){logger[_0x3cc7('0xe')](_0x3cc7('0xa'),_0x5604df,_0x2ff7ba[_0x3cc7('0xe')][_0x3cc7('0xf')]);return _0x3f2dd7(_0x2ff7ba[_0x3cc7('0xe')][_0x3cc7('0xf')]);}logger[_0x3cc7('0xe')](_0x3cc7('0xa'),_0x5604df,_0x2ff7ba[_0x3cc7('0xe')][_0x3cc7('0xf')]);return _0x37c184(_0x2ff7ba[_0x3cc7('0xe')][_0x3cc7('0xf')]);}else{logger[_0x3cc7('0x9')](_0x3cc7('0xa'),_0x5604df,_0x3cc7('0xb'));_0x37c184(_0x2ff7ba[_0x3cc7('0x10')][_0x3cc7('0xf')]);}})[_0x3cc7('0x11')](function(_0x386a31){logger[_0x3cc7('0xe')](_0x3cc7('0xa'),_0x5604df,_0x386a31);_0x3f2dd7(_0x386a31);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index c533d7f..2a31dff 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 _0x3c85=['multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./template.controller','get','isAuthenticated','show','create','put','delete','destroy','exports'];(function(_0x15a99d,_0x4486ea){var _0x2cb908=function(_0x1243c1){while(--_0x1243c1){_0x15a99d['push'](_0x15a99d['shift']());}};_0x2cb908(++_0x4486ea);}(_0x3c85,0x1a0));var _0x53c8=function(_0x328ec,_0x568fc8){_0x328ec=_0x328ec-0x0;var _0x225287=_0x3c85[_0x328ec];return _0x225287;};'use strict';var multer=require(_0x53c8('0x0'));var util=require(_0x53c8('0x1'));var path=require(_0x53c8('0x2'));var timeout=require(_0x53c8('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x53c8('0x4'));var auth=require(_0x53c8('0x5'));var interaction=require(_0x53c8('0x6'));var config=require('../../config/environment');var controller=require(_0x53c8('0x7'));router[_0x53c8('0x8')]('/',auth[_0x53c8('0x9')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x53c8('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x53c8('0xb')]);router[_0x53c8('0xc')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x53c8('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x53c8('0xe')]);module[_0x53c8('0xf')]=router; \ No newline at end of file +var _0xcf3d=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','show','put','/:id','update','delete','destroy','exports'];(function(_0x311aad,_0x54d658){var _0x1779bd=function(_0x2520fb){while(--_0x2520fb){_0x311aad['push'](_0x311aad['shift']());}};_0x1779bd(++_0x54d658);}(_0xcf3d,0x19e));var _0xdcf3=function(_0x496b35,_0x2bff04){_0x496b35=_0x496b35-0x0;var _0x1a95ca=_0xcf3d[_0x496b35];return _0x1a95ca;};'use strict';var multer=require(_0xdcf3('0x0'));var util=require(_0xdcf3('0x1'));var path=require(_0xdcf3('0x2'));var timeout=require(_0xdcf3('0x3'));var express=require('express');var router=express[_0xdcf3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xdcf3('0x5'));var interaction=require(_0xdcf3('0x6'));var config=require(_0xdcf3('0x7'));var controller=require(_0xdcf3('0x8'));router[_0xdcf3('0x9')]('/',auth[_0xdcf3('0xa')](),controller['index']);router[_0xdcf3('0x9')]('/:id',auth[_0xdcf3('0xa')](),controller[_0xdcf3('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xdcf3('0xc')](_0xdcf3('0xd'),auth[_0xdcf3('0xa')](),controller[_0xdcf3('0xe')]);router[_0xdcf3('0xf')](_0xdcf3('0xd'),auth[_0xdcf3('0xa')](),controller[_0xdcf3('0x10')]);module[_0xdcf3('0x11')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index d2bc619..9a6340c 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 _0x6d46=['TEXT','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x6d46,0x19d));var _0x66d4=function(_0x5d4876,_0x11e6b0){_0x5d4876=_0x5d4876-0x0;var _0x6927ac=_0x6d46[_0x5d4876];return _0x6927ac;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x66d4('0x0')]},'description':{'type':Sequelize[_0x66d4('0x0')]},'html':{'type':Sequelize[_0x66d4('0x1')]}}; \ No newline at end of file +var _0x9a40=['sequelize','exports','STRING','TEXT'];(function(_0x504e71,_0x951bdd){var _0xa80bd7=function(_0x3f8bba){while(--_0x3f8bba){_0x504e71['push'](_0x504e71['shift']());}};_0xa80bd7(++_0x951bdd);}(_0x9a40,0x1c4));var _0x09a4=function(_0x267cf4,_0xcbcf72){_0x267cf4=_0x267cf4-0x0;var _0x4824cf=_0x9a40[_0x267cf4];return _0x4824cf;};'use strict';var Sequelize=require(_0x09a4('0x0'));module[_0x09a4('0x1')]={'name':{'type':Sequelize[_0x09a4('0x2')]},'description':{'type':Sequelize[_0x09a4('0x2')]},'html':{'type':Sequelize[_0x09a4('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index c62b11d..20c3dc4 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 _0x60a1=['body','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Templates','UserProfileResource','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','where','VIRTUAL','filter','merge','options','includeAll','include','Template','findAll','rows','catch','show','params','find','create','user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x1c4a6d,_0x377f38){var _0x467231=function(_0x3fc251){while(--_0x3fc251){_0x1c4a6d['push'](_0x1c4a6d['shift']());}};_0x467231(++_0x377f38);}(_0x60a1,0xa5));var _0x160a=function(_0x540f56,_0x57c9b4){_0x540f56=_0x540f56-0x0;var _0x10ba59=_0x60a1[_0x540f56];return _0x10ba59;};'use strict';var emlformat=require(_0x160a('0x0'));var rimraf=require(_0x160a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x160a('0x2'));var moment=require(_0x160a('0x3'));var BPromise=require(_0x160a('0x4'));var Mustache=require(_0x160a('0x5'));var util=require(_0x160a('0x6'));var path=require('path');var sox=require(_0x160a('0x7'));var csv=require(_0x160a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x160a('0x9'));var _=require(_0x160a('0xa'));var squel=require('squel');var crypto=require(_0x160a('0xb'));var jsforce=require(_0x160a('0xc'));var deskjs=require(_0x160a('0xd'));var toCsv=require(_0x160a('0x8'));var querystring=require(_0x160a('0xe'));var Papa=require(_0x160a('0xf'));var Redis=require('ioredis');var authService=require(_0x160a('0x10'));var qs=require(_0x160a('0x11'));var as=require(_0x160a('0x12'));var hardwareService=require(_0x160a('0x13'));var logger=require('../../config/logger')(_0x160a('0x14'));var utils=require(_0x160a('0x15'));var config=require(_0x160a('0x16'));var licenseUtil=require(_0x160a('0x17'));var db=require(_0x160a('0x18'))['db'];function respondWithStatusCode(_0x57aa84,_0x35e12f){_0x35e12f=_0x35e12f||0xcc;return function(_0x593629){if(_0x593629){return _0x57aa84['sendStatus'](_0x35e12f);}return _0x57aa84[_0x160a('0x19')](_0x35e12f)[_0x160a('0x1a')]();};}function respondWithResult(_0x528aa8,_0x2e45f6){_0x2e45f6=_0x2e45f6||0xc8;return function(_0x406943){if(_0x406943){return _0x528aa8[_0x160a('0x19')](_0x2e45f6)['json'](_0x406943);}};}function respondWithFilteredResult(_0x4e28d5,_0x2c4f96){return function(_0x497a11){if(_0x497a11){var _0x5c2508=typeof _0x2c4f96[_0x160a('0x1b')]===_0x160a('0x1c')&&typeof _0x2c4f96[_0x160a('0x1d')]===_0x160a('0x1c');var _0x19fb79=_0x497a11[_0x160a('0x1e')];var _0x4b6ca9=_0x5c2508?0x0:_0x2c4f96[_0x160a('0x1b')];var _0x2309f4=_0x5c2508?_0x497a11[_0x160a('0x1e')]:_0x2c4f96[_0x160a('0x1b')]+_0x2c4f96[_0x160a('0x1d')];var _0x33a1b0;if(_0x2309f4>=_0x19fb79){_0x2309f4=_0x19fb79;_0x33a1b0=0xc8;}else{_0x33a1b0=0xce;}_0x4e28d5[_0x160a('0x19')](_0x33a1b0);return _0x4e28d5[_0x160a('0x1f')](_0x160a('0x20'),_0x4b6ca9+'-'+_0x2309f4+'/'+_0x19fb79)['json'](_0x497a11);}return null;};}function patchUpdates(_0x2c4375){return function(_0x5ab4be){try{jsonpatch[_0x160a('0x21')](_0x5ab4be,_0x2c4375,!![]);}catch(_0x4385f4){return BPromise[_0x160a('0x22')](_0x4385f4);}return _0x5ab4be[_0x160a('0x23')]();};}function saveUpdates(_0x514e9c,_0x3490d8){return function(_0x5e2f21){if(_0x5e2f21){return _0x5e2f21[_0x160a('0x24')](_0x514e9c)[_0x160a('0x25')](function(_0x5afdd1){return _0x5afdd1;});}return null;};}function removeEntity(_0x88e670,_0x5aea08){return function(_0x2c6c4c){if(_0x2c6c4c){return _0x2c6c4c[_0x160a('0x26')]()[_0x160a('0x25')](function(){var _0x95d6cc=_0x2c6c4c[_0x160a('0x27')]({'plain':!![]});var _0x4a9c05=_0x160a('0x28');return db[_0x160a('0x29')][_0x160a('0x26')]({'where':{'type':_0x4a9c05,'resourceId':_0x95d6cc['id']}})[_0x160a('0x25')](function(){return _0x2c6c4c;});})['then'](function(){_0x88e670[_0x160a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bb6cc,_0x9df60e){return function(_0x3abf96){if(!_0x3abf96){_0x1bb6cc[_0x160a('0x2a')](0x194);}return _0x3abf96;};}function handleError(_0x2368a2,_0x2935c4){_0x2935c4=_0x2935c4||0x1f4;return function(_0x27e49a){logger[_0x160a('0x2b')](_0x27e49a[_0x160a('0x2c')]);if(_0x27e49a[_0x160a('0x2d')]){delete _0x27e49a[_0x160a('0x2d')];}_0x2368a2[_0x160a('0x19')](_0x2935c4)[_0x160a('0x2e')](_0x27e49a);};}exports[_0x160a('0x2f')]=function(_0x3b2ff2,_0x47046b){var _0x529d4f={},_0x2e5c8a={},_0x581533={'count':0x0,'rows':[]};var _0x3f78ea=_[_0x160a('0x30')](db['Template'][_0x160a('0x31')],function(_0x2b5fcb){return{'name':_0x2b5fcb['fieldName'],'type':_0x2b5fcb[_0x160a('0x32')][_0x160a('0x33')]};});_0x2e5c8a['model']=_[_0x160a('0x30')](_0x3f78ea,_0x160a('0x2d'));_0x2e5c8a[_0x160a('0x34')]=_[_0x160a('0x35')](_0x3b2ff2[_0x160a('0x34')]);_0x2e5c8a[_0x160a('0x36')]=_[_0x160a('0x37')](_0x2e5c8a[_0x160a('0x38')],_0x2e5c8a[_0x160a('0x34')]);_0x529d4f[_0x160a('0x39')]=_[_0x160a('0x37')](_0x2e5c8a['model'],qs[_0x160a('0x3a')](_0x3b2ff2['query'][_0x160a('0x3a')]));_0x529d4f[_0x160a('0x39')]=_0x529d4f[_0x160a('0x39')][_0x160a('0x3b')]?_0x529d4f[_0x160a('0x39')]:_0x2e5c8a['model'];if(!_0x3b2ff2['query'][_0x160a('0x3c')]('nolimit')){_0x529d4f[_0x160a('0x1d')]=qs[_0x160a('0x1d')](_0x3b2ff2['query'][_0x160a('0x1d')]);_0x529d4f['offset']=qs[_0x160a('0x1b')](_0x3b2ff2['query'][_0x160a('0x1b')]);}_0x529d4f[_0x160a('0x3d')]=qs['sort'](_0x3b2ff2[_0x160a('0x34')]['sort']);_0x529d4f[_0x160a('0x3e')]=qs['filters'](_['pick'](_0x3b2ff2[_0x160a('0x34')],_0x2e5c8a[_0x160a('0x36')]),_0x3f78ea);if(_0x3b2ff2[_0x160a('0x34')]['filter']){_0x529d4f[_0x160a('0x3e')]=_['merge'](_0x529d4f[_0x160a('0x3e')],{'$or':_['map'](_0x3f78ea,function(_0x110084){if(_0x110084[_0x160a('0x32')]!==_0x160a('0x3f')){var _0x7c80cc={};_0x7c80cc[_0x110084[_0x160a('0x2d')]]={'$like':'%'+_0x3b2ff2['query'][_0x160a('0x40')]+'%'};return _0x7c80cc;}})});}_0x529d4f=_[_0x160a('0x41')]({},_0x529d4f,_0x3b2ff2[_0x160a('0x42')]);var _0x1a8595={'where':_0x529d4f[_0x160a('0x3e')]};return db['Template'][_0x160a('0x1e')](_0x1a8595)[_0x160a('0x25')](function(_0x55dbe4){_0x581533[_0x160a('0x1e')]=_0x55dbe4;if(_0x3b2ff2[_0x160a('0x34')][_0x160a('0x43')]){_0x529d4f[_0x160a('0x44')]=[{'all':!![]}];}return db[_0x160a('0x45')][_0x160a('0x46')](_0x529d4f);})[_0x160a('0x25')](function(_0x706d85){_0x581533[_0x160a('0x47')]=_0x706d85;return _0x581533;})[_0x160a('0x25')](respondWithFilteredResult(_0x47046b,_0x529d4f))[_0x160a('0x48')](handleError(_0x47046b,null));};exports[_0x160a('0x49')]=function(_0x597fbd,_0x3e1ea1){var _0x236fa5={'raw':!![],'where':{'id':_0x597fbd[_0x160a('0x4a')]['id']}},_0x4e88eb={};_0x4e88eb[_0x160a('0x38')]=_[_0x160a('0x35')](db[_0x160a('0x45')][_0x160a('0x31')]);_0x4e88eb[_0x160a('0x34')]=_[_0x160a('0x35')](_0x597fbd['query']);_0x4e88eb[_0x160a('0x36')]=_['intersection'](_0x4e88eb[_0x160a('0x38')],_0x4e88eb[_0x160a('0x34')]);_0x236fa5[_0x160a('0x39')]=_[_0x160a('0x37')](_0x4e88eb[_0x160a('0x38')],qs['fields'](_0x597fbd[_0x160a('0x34')]['fields']));_0x236fa5[_0x160a('0x39')]=_0x236fa5['attributes'][_0x160a('0x3b')]?_0x236fa5[_0x160a('0x39')]:_0x4e88eb['model'];if(_0x597fbd[_0x160a('0x34')][_0x160a('0x43')]){_0x236fa5[_0x160a('0x44')]=[{'all':!![]}];}_0x236fa5=_[_0x160a('0x41')]({},_0x236fa5,_0x597fbd['options']);return db['Template'][_0x160a('0x4b')](_0x236fa5)['then'](handleEntityNotFound(_0x3e1ea1,null))[_0x160a('0x25')](respondWithResult(_0x3e1ea1,null))[_0x160a('0x48')](handleError(_0x3e1ea1,null));};exports[_0x160a('0x4c')]=function(_0xa53b4,_0x53e475){return db[_0x160a('0x45')][_0x160a('0x4c')](_0xa53b4['body'],{})['then'](function(_0x3398b4){var _0x3ec2ab=_0xa53b4[_0x160a('0x4d')][_0x160a('0x27')]({'plain':!![]});if(!_0x3ec2ab)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3ec2ab[_0x160a('0x4e')]==='user'){var _0x4d3167=_0x3398b4['get']({'plain':!![]});var _0x289711=_0x160a('0x28');return db['UserProfileSection'][_0x160a('0x4b')]({'where':{'name':_0x289711,'userProfileId':_0x3ec2ab['userProfileId']},'raw':!![]})[_0x160a('0x25')](function(_0x47755d){if(_0x47755d&&_0x47755d[_0x160a('0x4f')]===0x0){return db['UserProfileResource'][_0x160a('0x4c')]({'name':_0x4d3167[_0x160a('0x2d')],'resourceId':_0x4d3167['id'],'type':_0x47755d[_0x160a('0x2d')],'sectionId':_0x47755d['id']},{})['then'](function(){return _0x3398b4;});}else{return _0x3398b4;}})[_0x160a('0x48')](function(_0x22abac){logger[_0x160a('0x2b')](_0x160a('0x50'),_0x22abac);throw _0x22abac;});}return _0x3398b4;})[_0x160a('0x25')](respondWithResult(_0x53e475,0xc9))[_0x160a('0x48')](handleError(_0x53e475,null));};exports['update']=function(_0x41a1e3,_0x18ab32){if(_0x41a1e3[_0x160a('0x51')]['id']){delete _0x41a1e3[_0x160a('0x51')]['id'];}return db[_0x160a('0x45')][_0x160a('0x4b')]({'where':{'id':_0x41a1e3[_0x160a('0x4a')]['id']}})[_0x160a('0x25')](handleEntityNotFound(_0x18ab32,null))['then'](saveUpdates(_0x41a1e3['body'],null))['then'](respondWithResult(_0x18ab32,null))[_0x160a('0x48')](handleError(_0x18ab32,null));};exports[_0x160a('0x26')]=function(_0x42937c,_0x1e1257){return db[_0x160a('0x45')]['find']({'where':{'id':_0x42937c[_0x160a('0x4a')]['id']}})[_0x160a('0x25')](handleEntityNotFound(_0x1e1257,null))[_0x160a('0x25')](removeEntity(_0x1e1257,null))[_0x160a('0x48')](handleError(_0x1e1257,null));}; \ No newline at end of file +var _0xeae0=['params','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Templates','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','Template','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch'];(function(_0x5de552,_0x5752e0){var _0x506da8=function(_0xff370f){while(--_0xff370f){_0x5de552['push'](_0x5de552['shift']());}};_0x506da8(++_0x5752e0);}(_0xeae0,0x1c2));var _0x0eae=function(_0x5875ad,_0x3597b8){_0x5875ad=_0x5875ad-0x0;var _0x32a922=_0xeae0[_0x5875ad];return _0x32a922;};'use strict';var emlformat=require(_0x0eae('0x0'));var rimraf=require(_0x0eae('0x1'));var zipdir=require(_0x0eae('0x2'));var jsonpatch=require(_0x0eae('0x3'));var rp=require('request-promise');var moment=require(_0x0eae('0x4'));var BPromise=require(_0x0eae('0x5'));var Mustache=require(_0x0eae('0x6'));var util=require(_0x0eae('0x7'));var path=require('path');var sox=require(_0x0eae('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0eae('0x9'));var _=require(_0x0eae('0xa'));var squel=require(_0x0eae('0xb'));var crypto=require(_0x0eae('0xc'));var jsforce=require(_0x0eae('0xd'));var deskjs=require(_0x0eae('0xe'));var toCsv=require(_0x0eae('0xf'));var querystring=require(_0x0eae('0x10'));var Papa=require('papaparse');var Redis=require(_0x0eae('0x11'));var authService=require(_0x0eae('0x12'));var qs=require(_0x0eae('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0eae('0x14'));var logger=require(_0x0eae('0x15'))(_0x0eae('0x16'));var utils=require(_0x0eae('0x17'));var config=require(_0x0eae('0x18'));var licenseUtil=require(_0x0eae('0x19'));var db=require(_0x0eae('0x1a'))['db'];function respondWithStatusCode(_0x4e38fc,_0x1037ba){_0x1037ba=_0x1037ba||0xcc;return function(_0x23e287){if(_0x23e287){return _0x4e38fc[_0x0eae('0x1b')](_0x1037ba);}return _0x4e38fc[_0x0eae('0x1c')](_0x1037ba)[_0x0eae('0x1d')]();};}function respondWithResult(_0x38680,_0x352294){_0x352294=_0x352294||0xc8;return function(_0x36ebdc){if(_0x36ebdc){return _0x38680[_0x0eae('0x1c')](_0x352294)[_0x0eae('0x1e')](_0x36ebdc);}};}function respondWithFilteredResult(_0x3dc9c5,_0x40370a){return function(_0x3c6819){if(_0x3c6819){var _0x332abc=typeof _0x40370a[_0x0eae('0x1f')]===_0x0eae('0x20')&&typeof _0x40370a[_0x0eae('0x21')]===_0x0eae('0x20');var _0xe18e3f=_0x3c6819[_0x0eae('0x22')];var _0x4167ea=_0x332abc?0x0:_0x40370a[_0x0eae('0x1f')];var _0x103213=_0x332abc?_0x3c6819[_0x0eae('0x22')]:_0x40370a[_0x0eae('0x1f')]+_0x40370a[_0x0eae('0x21')];var _0xa216f4;if(_0x103213>=_0xe18e3f){_0x103213=_0xe18e3f;_0xa216f4=0xc8;}else{_0xa216f4=0xce;}_0x3dc9c5[_0x0eae('0x1c')](_0xa216f4);return _0x3dc9c5[_0x0eae('0x23')](_0x0eae('0x24'),_0x4167ea+'-'+_0x103213+'/'+_0xe18e3f)[_0x0eae('0x1e')](_0x3c6819);}return null;};}function patchUpdates(_0x72da64){return function(_0x4a784f){try{jsonpatch[_0x0eae('0x25')](_0x4a784f,_0x72da64,!![]);}catch(_0x1aaf6a){return BPromise[_0x0eae('0x26')](_0x1aaf6a);}return _0x4a784f[_0x0eae('0x27')]();};}function saveUpdates(_0x149478,_0x2f1c1e){return function(_0x2576b9){if(_0x2576b9){return _0x2576b9[_0x0eae('0x28')](_0x149478)[_0x0eae('0x29')](function(_0x12a34e){return _0x12a34e;});}return null;};}function removeEntity(_0x330144,_0x422a55){return function(_0x4b623b){if(_0x4b623b){return _0x4b623b[_0x0eae('0x2a')]()['then'](function(){var _0x1bacea=_0x4b623b['get']({'plain':!![]});var _0x7e2573='Templates';return db['UserProfileResource'][_0x0eae('0x2a')]({'where':{'type':_0x7e2573,'resourceId':_0x1bacea['id']}})[_0x0eae('0x29')](function(){return _0x4b623b;});})['then'](function(){_0x330144[_0x0eae('0x1c')](0xcc)[_0x0eae('0x1d')]();});}};}function handleEntityNotFound(_0x6f5c4,_0x18b376){return function(_0x458866){if(!_0x458866){_0x6f5c4[_0x0eae('0x1b')](0x194);}return _0x458866;};}function handleError(_0x4bf1e3,_0xe6cf16){_0xe6cf16=_0xe6cf16||0x1f4;return function(_0x3c6267){logger['error'](_0x3c6267[_0x0eae('0x2b')]);if(_0x3c6267[_0x0eae('0x2c')]){delete _0x3c6267[_0x0eae('0x2c')];}_0x4bf1e3[_0x0eae('0x1c')](_0xe6cf16)[_0x0eae('0x2d')](_0x3c6267);};}exports['index']=function(_0x25e044,_0x20e4f5){var _0x329ae4={},_0x124d24={},_0x2543ee={'count':0x0,'rows':[]};var _0x35fb77=_[_0x0eae('0x2e')](db[_0x0eae('0x2f')][_0x0eae('0x30')],function(_0xceb05e){return{'name':_0xceb05e['fieldName'],'type':_0xceb05e[_0x0eae('0x31')][_0x0eae('0x32')]};});_0x124d24[_0x0eae('0x33')]=_[_0x0eae('0x2e')](_0x35fb77,_0x0eae('0x2c'));_0x124d24[_0x0eae('0x34')]=_[_0x0eae('0x35')](_0x25e044[_0x0eae('0x34')]);_0x124d24[_0x0eae('0x36')]=_[_0x0eae('0x37')](_0x124d24['model'],_0x124d24[_0x0eae('0x34')]);_0x329ae4[_0x0eae('0x38')]=_[_0x0eae('0x37')](_0x124d24[_0x0eae('0x33')],qs['fields'](_0x25e044['query'][_0x0eae('0x39')]));_0x329ae4['attributes']=_0x329ae4[_0x0eae('0x38')][_0x0eae('0x3a')]?_0x329ae4['attributes']:_0x124d24['model'];if(!_0x25e044[_0x0eae('0x34')][_0x0eae('0x3b')](_0x0eae('0x3c'))){_0x329ae4[_0x0eae('0x21')]=qs[_0x0eae('0x21')](_0x25e044[_0x0eae('0x34')]['limit']);_0x329ae4[_0x0eae('0x1f')]=qs[_0x0eae('0x1f')](_0x25e044[_0x0eae('0x34')][_0x0eae('0x1f')]);}_0x329ae4['order']=qs[_0x0eae('0x3d')](_0x25e044[_0x0eae('0x34')][_0x0eae('0x3d')]);_0x329ae4[_0x0eae('0x3e')]=qs[_0x0eae('0x36')](_['pick'](_0x25e044[_0x0eae('0x34')],_0x124d24[_0x0eae('0x36')]),_0x35fb77);if(_0x25e044['query'][_0x0eae('0x3f')]){_0x329ae4[_0x0eae('0x3e')]=_[_0x0eae('0x40')](_0x329ae4[_0x0eae('0x3e')],{'$or':_[_0x0eae('0x2e')](_0x35fb77,function(_0x43d56e){if(_0x43d56e[_0x0eae('0x31')]!==_0x0eae('0x41')){var _0x48526f={};_0x48526f[_0x43d56e[_0x0eae('0x2c')]]={'$like':'%'+_0x25e044[_0x0eae('0x34')]['filter']+'%'};return _0x48526f;}})});}_0x329ae4=_[_0x0eae('0x40')]({},_0x329ae4,_0x25e044[_0x0eae('0x42')]);var _0x5d9aff={'where':_0x329ae4[_0x0eae('0x3e')]};return db[_0x0eae('0x2f')]['count'](_0x5d9aff)[_0x0eae('0x29')](function(_0x1df8e0){_0x2543ee[_0x0eae('0x22')]=_0x1df8e0;if(_0x25e044[_0x0eae('0x34')][_0x0eae('0x43')]){_0x329ae4[_0x0eae('0x44')]=[{'all':!![]}];}return db['Template'][_0x0eae('0x45')](_0x329ae4);})[_0x0eae('0x29')](function(_0x4b4dd0){_0x2543ee[_0x0eae('0x46')]=_0x4b4dd0;return _0x2543ee;})[_0x0eae('0x29')](respondWithFilteredResult(_0x20e4f5,_0x329ae4))[_0x0eae('0x47')](handleError(_0x20e4f5,null));};exports['show']=function(_0x26bf88,_0x308763){var _0x1a0f79={'raw':!![],'where':{'id':_0x26bf88[_0x0eae('0x48')]['id']}},_0x1f70b6={};_0x1f70b6[_0x0eae('0x33')]=_['keys'](db[_0x0eae('0x2f')][_0x0eae('0x30')]);_0x1f70b6['query']=_[_0x0eae('0x35')](_0x26bf88[_0x0eae('0x34')]);_0x1f70b6[_0x0eae('0x36')]=_['intersection'](_0x1f70b6[_0x0eae('0x33')],_0x1f70b6['query']);_0x1a0f79[_0x0eae('0x38')]=_['intersection'](_0x1f70b6[_0x0eae('0x33')],qs[_0x0eae('0x39')](_0x26bf88[_0x0eae('0x34')][_0x0eae('0x39')]));_0x1a0f79['attributes']=_0x1a0f79[_0x0eae('0x38')][_0x0eae('0x3a')]?_0x1a0f79[_0x0eae('0x38')]:_0x1f70b6['model'];if(_0x26bf88[_0x0eae('0x34')][_0x0eae('0x43')]){_0x1a0f79[_0x0eae('0x44')]=[{'all':!![]}];}_0x1a0f79=_[_0x0eae('0x40')]({},_0x1a0f79,_0x26bf88[_0x0eae('0x42')]);return db[_0x0eae('0x2f')][_0x0eae('0x49')](_0x1a0f79)[_0x0eae('0x29')](handleEntityNotFound(_0x308763,null))[_0x0eae('0x29')](respondWithResult(_0x308763,null))[_0x0eae('0x47')](handleError(_0x308763,null));};exports['create']=function(_0x18fc21,_0x2d5c30){return db['Template']['create'](_0x18fc21[_0x0eae('0x4a')],{})[_0x0eae('0x29')](function(_0x94868){var _0x5769a5=_0x18fc21[_0x0eae('0x4b')][_0x0eae('0x4c')]({'plain':!![]});if(!_0x5769a5)throw new Error(_0x0eae('0x4d'));if(_0x5769a5[_0x0eae('0x4e')]==='user'){var _0x37201b=_0x94868[_0x0eae('0x4c')]({'plain':!![]});var _0x45d821=_0x0eae('0x4f');return db[_0x0eae('0x50')][_0x0eae('0x49')]({'where':{'name':_0x45d821,'userProfileId':_0x5769a5[_0x0eae('0x51')]},'raw':!![]})[_0x0eae('0x29')](function(_0x37e119){if(_0x37e119&&_0x37e119[_0x0eae('0x52')]===0x0){return db[_0x0eae('0x53')][_0x0eae('0x54')]({'name':_0x37201b[_0x0eae('0x2c')],'resourceId':_0x37201b['id'],'type':_0x37e119[_0x0eae('0x2c')],'sectionId':_0x37e119['id']},{})[_0x0eae('0x29')](function(){return _0x94868;});}else{return _0x94868;}})['catch'](function(_0x41cbeb){logger[_0x0eae('0x55')](_0x0eae('0x56'),_0x41cbeb);throw _0x41cbeb;});}return _0x94868;})[_0x0eae('0x29')](respondWithResult(_0x2d5c30,0xc9))[_0x0eae('0x47')](handleError(_0x2d5c30,null));};exports[_0x0eae('0x28')]=function(_0x5c936a,_0x241d86){if(_0x5c936a['body']['id']){delete _0x5c936a['body']['id'];}return db['Template'][_0x0eae('0x49')]({'where':{'id':_0x5c936a[_0x0eae('0x48')]['id']}})['then'](handleEntityNotFound(_0x241d86,null))[_0x0eae('0x29')](saveUpdates(_0x5c936a[_0x0eae('0x4a')],null))['then'](respondWithResult(_0x241d86,null))['catch'](handleError(_0x241d86,null));};exports['destroy']=function(_0x440525,_0x976dee){return db[_0x0eae('0x2f')][_0x0eae('0x49')]({'where':{'id':_0x440525['params']['id']}})[_0x0eae('0x29')](handleEntityNotFound(_0x976dee,null))[_0x0eae('0x29')](removeEntity(_0x976dee,null))['catch'](handleError(_0x976dee,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index e46f6ab..d7648e2 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 _0x6051=['define','Template','tools_templates','lodash','../../config/logger','moment','request-promise','exports'];(function(_0x595f56,_0x47b710){var _0xdd17b0=function(_0x532548){while(--_0x532548){_0x595f56['push'](_0x595f56['shift']());}};_0xdd17b0(++_0x47b710);}(_0x6051,0x93));var _0x1605=function(_0x2b7dcf,_0x4f9a4f){_0x2b7dcf=_0x2b7dcf-0x0;var _0x448baf=_0x6051[_0x2b7dcf];return _0x448baf;};'use strict';var _=require(_0x1605('0x0'));var util=require('util');var logger=require(_0x1605('0x1'))('api');var moment=require(_0x1605('0x2'));var BPromise=require('bluebird');var rp=require(_0x1605('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./template.attributes');module[_0x1605('0x4')]=function(_0x2f4f88,_0x1df272){return _0x2f4f88[_0x1605('0x5')](_0x1605('0x6'),attributes,{'tableName':_0x1605('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0b65=['../../config/logger','moment','request-promise','../../config/environment','./template.attributes','exports','define','lodash','util'];(function(_0x456b8b,_0x442354){var _0x20a9b7=function(_0x2fbfd0){while(--_0x2fbfd0){_0x456b8b['push'](_0x456b8b['shift']());}};_0x20a9b7(++_0x442354);}(_0x0b65,0x15d));var _0x50b6=function(_0xc7be5f,_0x37b7af){_0xc7be5f=_0xc7be5f-0x0;var _0x4d714d=_0x0b65[_0xc7be5f];return _0x4d714d;};'use strict';var _=require(_0x50b6('0x0'));var util=require(_0x50b6('0x1'));var logger=require(_0x50b6('0x2'))('api');var moment=require(_0x50b6('0x3'));var BPromise=require('bluebird');var rp=require(_0x50b6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x50b6('0x5'));var attributes=require(_0x50b6('0x6'));module[_0x50b6('0x7')]=function(_0x28f592,_0x28ef55){return _0x28f592[_0x50b6('0x8')]('Template',attributes,{'tableName':'tools_templates','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 535befb..e986a34 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 _0x2c38=['findAll','options','raw','attributes','limit','include','model','map','then','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Template,\x20%s,\x20%s','message','catch','GetTemplate'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2c38,0x109));var _0x82c3=function(_0xda40ff,_0x2e30cb){_0xda40ff=_0xda40ff-0x0;var _0x35b3e0=_0x2c38[_0xda40ff];return _0x35b3e0;};'use strict';var _=require(_0x82c3('0x0'));var util=require(_0x82c3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x82c3('0x2'));var fs=require('fs');var Redis=require(_0x82c3('0x3'));var db=require(_0x82c3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x82c3('0x5'))(_0x82c3('0x6'));var config=require(_0x82c3('0x7'));var jayson=require(_0x82c3('0x8'));var client=jayson[_0x82c3('0x9')][_0x82c3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5abaeb,_0x17281a,_0x206674){return new BPromise(function(_0x371d87,_0x588b32){return client[_0x82c3('0xb')](_0x5abaeb,_0x206674)['then'](function(_0x41bb6d){logger[_0x82c3('0xc')]('Template,\x20%s,\x20%s',_0x17281a,'request\x20sent');logger[_0x82c3('0xd')](_0x82c3('0xe'),_0x17281a,_0x82c3('0xf'),JSON[_0x82c3('0x10')](_0x41bb6d));if(_0x41bb6d[_0x82c3('0x11')]){if(_0x41bb6d['error'][_0x82c3('0x12')]===0x1f4){logger[_0x82c3('0x11')](_0x82c3('0x13'),_0x17281a,_0x41bb6d[_0x82c3('0x11')]['message']);return _0x588b32(_0x41bb6d[_0x82c3('0x11')][_0x82c3('0x14')]);}logger[_0x82c3('0x11')]('Template,\x20%s,\x20%s',_0x17281a,_0x41bb6d[_0x82c3('0x11')][_0x82c3('0x14')]);return _0x371d87(_0x41bb6d[_0x82c3('0x11')]['message']);}else{logger[_0x82c3('0xc')](_0x82c3('0x13'),_0x17281a,_0x82c3('0xf'));_0x371d87(_0x41bb6d['result'][_0x82c3('0x14')]);}})[_0x82c3('0x15')](function(_0x203db1){logger[_0x82c3('0x11')](_0x82c3('0x13'),_0x17281a,_0x203db1);_0x588b32(_0x203db1);});});}exports[_0x82c3('0x16')]=function(_0xa2ca3){var _0x290887=this;return new Promise(function(_0x2ac318,_0x51227e){return db['Template'][_0x82c3('0x17')]({'raw':_0xa2ca3[_0x82c3('0x18')]?_0xa2ca3[_0x82c3('0x18')][_0x82c3('0x19')]===undefined?!![]:![]:!![],'where':_0xa2ca3[_0x82c3('0x18')]?_0xa2ca3[_0x82c3('0x18')]['where']||null:null,'attributes':_0xa2ca3[_0x82c3('0x18')]?_0xa2ca3[_0x82c3('0x18')][_0x82c3('0x1a')]||null:null,'limit':_0xa2ca3['options']?_0xa2ca3[_0x82c3('0x18')][_0x82c3('0x1b')]||null:null,'include':_0xa2ca3['options']?_0xa2ca3[_0x82c3('0x18')]['include']?_['map'](_0xa2ca3['options'][_0x82c3('0x1c')],function(_0x1ab11e){return{'model':db[_0x1ab11e[_0x82c3('0x1d')]],'as':_0x1ab11e['as'],'attributes':_0x1ab11e[_0x82c3('0x1a')],'include':_0x1ab11e[_0x82c3('0x1c')]?_[_0x82c3('0x1e')](_0x1ab11e[_0x82c3('0x1c')],function(_0x25e4ec){return{'model':db[_0x25e4ec[_0x82c3('0x1d')]],'as':_0x25e4ec['as'],'attributes':_0x25e4ec['attributes'],'include':_0x25e4ec['include']?_['map'](_0x25e4ec[_0x82c3('0x1c')],function(_0x4ef008){return{'model':db[_0x4ef008['model']],'as':_0x4ef008['as'],'attributes':_0x4ef008[_0x82c3('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x82c3('0x1f')](function(_0xa06a0b){logger[_0x82c3('0xc')](_0x82c3('0x16'),_0xa2ca3);logger['debug'](_0x82c3('0x16'),_0xa2ca3,JSON[_0x82c3('0x10')](_0xa06a0b));_0x2ac318(_0xa06a0b);})[_0x82c3('0x15')](function(_0x3d3445){logger[_0x82c3('0x11')](_0x82c3('0x16'),_0x3d3445[_0x82c3('0x14')],_0xa2ca3);_0x51227e(_0x290887[_0x82c3('0x11')](0x1f4,_0x3d3445['message']));});});}; \ No newline at end of file +var _0xf927=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','code','Template,\x20%s,\x20%s','error','message','result','catch','GetTemplate','findAll','options','where','attributes','map','include','model','lodash','util','moment','bluebird'];(function(_0x55c9cf,_0x256d57){var _0x23797e=function(_0x504623){while(--_0x504623){_0x55c9cf['push'](_0x55c9cf['shift']());}};_0x23797e(++_0x256d57);}(_0xf927,0x15c));var _0x7f92=function(_0x362540,_0x3a456e){_0x362540=_0x362540-0x0;var _0x25eb15=_0xf927[_0x362540];return _0x25eb15;};'use strict';var _=require(_0x7f92('0x0'));var util=require(_0x7f92('0x1'));var moment=require(_0x7f92('0x2'));var BPromise=require(_0x7f92('0x3'));var rs=require(_0x7f92('0x4'));var fs=require('fs');var Redis=require(_0x7f92('0x5'));var db=require(_0x7f92('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7f92('0x7'))(_0x7f92('0x8'));var config=require(_0x7f92('0x9'));var jayson=require(_0x7f92('0xa'));var client=jayson[_0x7f92('0xb')][_0x7f92('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x431db2,_0x51e970,_0x2fae61){return new BPromise(function(_0x46ef24,_0x1c280e){return client['request'](_0x431db2,_0x2fae61)['then'](function(_0x2984f4){logger[_0x7f92('0xd')]('Template,\x20%s,\x20%s',_0x51e970,_0x7f92('0xe'));logger[_0x7f92('0xf')](_0x7f92('0x10'),_0x51e970,_0x7f92('0xe'),JSON[_0x7f92('0x11')](_0x2984f4));if(_0x2984f4['error']){if(_0x2984f4['error'][_0x7f92('0x12')]===0x1f4){logger['error'](_0x7f92('0x13'),_0x51e970,_0x2984f4[_0x7f92('0x14')][_0x7f92('0x15')]);return _0x1c280e(_0x2984f4[_0x7f92('0x14')]['message']);}logger['error']('Template,\x20%s,\x20%s',_0x51e970,_0x2984f4[_0x7f92('0x14')][_0x7f92('0x15')]);return _0x46ef24(_0x2984f4[_0x7f92('0x14')][_0x7f92('0x15')]);}else{logger['info'](_0x7f92('0x13'),_0x51e970,_0x7f92('0xe'));_0x46ef24(_0x2984f4[_0x7f92('0x16')][_0x7f92('0x15')]);}})[_0x7f92('0x17')](function(_0x46e1a7){logger[_0x7f92('0x14')]('Template,\x20%s,\x20%s',_0x51e970,_0x46e1a7);_0x1c280e(_0x46e1a7);});});}exports[_0x7f92('0x18')]=function(_0x5eab36){var _0x353407=this;return new Promise(function(_0x135fab,_0x42be4c){return db['Template'][_0x7f92('0x19')]({'raw':_0x5eab36[_0x7f92('0x1a')]?_0x5eab36[_0x7f92('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x5eab36[_0x7f92('0x1a')]?_0x5eab36[_0x7f92('0x1a')][_0x7f92('0x1b')]||null:null,'attributes':_0x5eab36[_0x7f92('0x1a')]?_0x5eab36[_0x7f92('0x1a')][_0x7f92('0x1c')]||null:null,'limit':_0x5eab36[_0x7f92('0x1a')]?_0x5eab36[_0x7f92('0x1a')]['limit']||null:null,'include':_0x5eab36[_0x7f92('0x1a')]?_0x5eab36[_0x7f92('0x1a')]['include']?_[_0x7f92('0x1d')](_0x5eab36[_0x7f92('0x1a')][_0x7f92('0x1e')],function(_0x299b1c){return{'model':db[_0x299b1c[_0x7f92('0x1f')]],'as':_0x299b1c['as'],'attributes':_0x299b1c['attributes'],'include':_0x299b1c['include']?_['map'](_0x299b1c[_0x7f92('0x1e')],function(_0x3bab57){return{'model':db[_0x3bab57['model']],'as':_0x3bab57['as'],'attributes':_0x3bab57['attributes'],'include':_0x3bab57[_0x7f92('0x1e')]?_[_0x7f92('0x1d')](_0x3bab57[_0x7f92('0x1e')],function(_0x5cd42c){return{'model':db[_0x5cd42c['model']],'as':_0x5cd42c['as'],'attributes':_0x5cd42c[_0x7f92('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3296a1){logger[_0x7f92('0xd')](_0x7f92('0x18'),_0x5eab36);logger[_0x7f92('0xf')](_0x7f92('0x18'),_0x5eab36,JSON[_0x7f92('0x11')](_0x3296a1));_0x135fab(_0x3296a1);})[_0x7f92('0x17')](function(_0x281e39){logger[_0x7f92('0x14')](_0x7f92('0x18'),_0x281e39[_0x7f92('0x15')],_0x5eab36);_0x42be4c(_0x353407[_0x7f92('0x14')](0x1f4,_0x281e39[_0x7f92('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index eefcefc..0ad040b 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 _0x95ef=['/:id/any_conditions','getAnyConditions','/:id/actions','getActions','addAllCondition','post','put','update','delete','destroy','multer','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id'];(function(_0x2df864,_0x1e1504){var _0x17a34b=function(_0x549b90){while(--_0x549b90){_0x2df864['push'](_0x2df864['shift']());}};_0x17a34b(++_0x1e1504);}(_0x95ef,0x12a));var _0xf95e=function(_0x1bacc0,_0x564be2){_0x1bacc0=_0x1bacc0-0x0;var _0x2c2840=_0x95ef[_0x1bacc0];return _0x2c2840;};'use strict';var multer=require(_0xf95e('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(_0xf95e('0x1'));var auth=require(_0xf95e('0x2'));var interaction=require(_0xf95e('0x3'));var config=require('../../config/environment');var controller=require('./trigger.controller');router[_0xf95e('0x4')]('/',auth[_0xf95e('0x5')](),controller[_0xf95e('0x6')]);router[_0xf95e('0x4')](_0xf95e('0x7'),auth['isAuthenticated'](),controller['show']);router[_0xf95e('0x4')]('/:id/all_conditions',auth[_0xf95e('0x5')](),controller['getAllConditions']);router[_0xf95e('0x4')](_0xf95e('0x8'),auth[_0xf95e('0x5')](),controller[_0xf95e('0x9')]);router[_0xf95e('0x4')](_0xf95e('0xa'),auth['isAuthenticated'](),controller[_0xf95e('0xb')]);router['post']('/',auth[_0xf95e('0x5')](),controller['create']);router['post']('/:id/all_conditions',auth[_0xf95e('0x5')](),controller[_0xf95e('0xc')]);router['post'](_0xf95e('0x8'),auth['isAuthenticated'](),controller['addAnyCondition']);router[_0xf95e('0xd')](_0xf95e('0xa'),auth['isAuthenticated'](),controller['addAction']);router[_0xf95e('0xe')](_0xf95e('0x7'),auth['isAuthenticated'](),controller[_0xf95e('0xf')]);router[_0xf95e('0x10')](_0xf95e('0x7'),auth[_0xf95e('0x5')](),controller[_0xf95e('0x11')]);module['exports']=router; \ No newline at end of file +var _0xd7c1=['../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','getActions','create','post','addAnyCondition','/:id/actions','addAction','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1d6700,_0xc6a7d){var _0x264e39=function(_0x1854d3){while(--_0x1854d3){_0x1d6700['push'](_0x1d6700['shift']());}};_0x264e39(++_0xc6a7d);}(_0xd7c1,0xa5));var _0x1d7c=function(_0x295a92,_0x7d70dc){_0x295a92=_0x295a92-0x0;var _0x3f5dac=_0xd7c1[_0x295a92];return _0x3f5dac;};'use strict';var multer=require(_0x1d7c('0x0'));var util=require(_0x1d7c('0x1'));var path=require(_0x1d7c('0x2'));var timeout=require(_0x1d7c('0x3'));var express=require(_0x1d7c('0x4'));var router=express[_0x1d7c('0x5')]();var fs_extra=require(_0x1d7c('0x6'));var auth=require(_0x1d7c('0x7'));var interaction=require(_0x1d7c('0x8'));var config=require(_0x1d7c('0x9'));var controller=require(_0x1d7c('0xa'));router[_0x1d7c('0xb')]('/',auth[_0x1d7c('0xc')](),controller[_0x1d7c('0xd')]);router[_0x1d7c('0xb')](_0x1d7c('0xe'),auth[_0x1d7c('0xc')](),controller[_0x1d7c('0xf')]);router[_0x1d7c('0xb')](_0x1d7c('0x10'),auth[_0x1d7c('0xc')](),controller[_0x1d7c('0x11')]);router['get'](_0x1d7c('0x12'),auth[_0x1d7c('0xc')](),controller[_0x1d7c('0x13')]);router[_0x1d7c('0xb')]('/:id/actions',auth[_0x1d7c('0xc')](),controller[_0x1d7c('0x14')]);router['post']('/',auth[_0x1d7c('0xc')](),controller[_0x1d7c('0x15')]);router[_0x1d7c('0x16')]('/:id/all_conditions',auth[_0x1d7c('0xc')](),controller['addAllCondition']);router[_0x1d7c('0x16')](_0x1d7c('0x12'),auth[_0x1d7c('0xc')](),controller[_0x1d7c('0x17')]);router['post'](_0x1d7c('0x18'),auth['isAuthenticated'](),controller[_0x1d7c('0x19')]);router['put'](_0x1d7c('0xe'),auth['isAuthenticated'](),controller[_0x1d7c('0x1a')]);router[_0x1d7c('0x1b')](_0x1d7c('0xe'),auth[_0x1d7c('0xc')](),controller[_0x1d7c('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 85cc14b..38f045c 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 _0xa9f9=['STRING','BOOLEAN','sequelize','exports'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0xa9f9,0xc2));var _0x9a9f=function(_0xf87c2e,_0x5a864b){_0xf87c2e=_0xf87c2e-0x0;var _0x42e44a=_0xa9f9[_0xf87c2e];return _0x42e44a;};'use strict';var Sequelize=require(_0x9a9f('0x0'));module[_0x9a9f('0x1')]={'name':{'type':Sequelize[_0x9a9f('0x2')]},'channel':{'type':Sequelize[_0x9a9f('0x2')]},'description':{'type':Sequelize[_0x9a9f('0x2')]},'status':{'type':Sequelize[_0x9a9f('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x0852=['STRING','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0852,0x130));var _0x2085=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x0852[_0x5c2e3e];return _0x53f64a;};'use strict';var Sequelize=require(_0x2085('0x0'));module[_0x2085('0x1')]={'name':{'type':Sequelize[_0x2085('0x2')]},'channel':{'type':Sequelize[_0x2085('0x2')]},'description':{'type':Sequelize[_0x2085('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 3c8a899..7be869d 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 _0x48bb=['order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addAllCondition','TriggerAllId','Condition','addAnyCondition','getAllConditions','pick','nolimit','findOne','getAnyConditions','Action','getActions','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','get','Triggers','UserProfileResource','error','stack','name','send','index','Trigger','fieldName','map','query','intersection','attributes','model','fields','hasOwnProperty'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x48bb,0x80));var _0xb48b=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x48bb[_0x3ff085];return _0x2b68c3;};'use strict';var emlformat=require(_0xb48b('0x0'));var rimraf=require(_0xb48b('0x1'));var zipdir=require(_0xb48b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb48b('0x3'));var BPromise=require(_0xb48b('0x4'));var Mustache=require(_0xb48b('0x5'));var util=require(_0xb48b('0x6'));var path=require(_0xb48b('0x7'));var sox=require(_0xb48b('0x8'));var csv=require(_0xb48b('0x9'));var ejs=require(_0xb48b('0xa'));var fs=require('fs');var fs_extra=require(_0xb48b('0xb'));var _=require(_0xb48b('0xc'));var squel=require(_0xb48b('0xd'));var crypto=require(_0xb48b('0xe'));var jsforce=require(_0xb48b('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xb48b('0x9'));var querystring=require(_0xb48b('0x10'));var Papa=require(_0xb48b('0x11'));var Redis=require('ioredis');var authService=require(_0xb48b('0x12'));var qs=require(_0xb48b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb48b('0x14'));var logger=require('../../config/logger')(_0xb48b('0x15'));var utils=require('../../config/utils');var config=require(_0xb48b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xb48b('0x17'))['db'];function respondWithStatusCode(_0x114e6c,_0xde321){_0xde321=_0xde321||0xcc;return function(_0x497241){if(_0x497241){return _0x114e6c[_0xb48b('0x18')](_0xde321);}return _0x114e6c[_0xb48b('0x19')](_0xde321)[_0xb48b('0x1a')]();};}function respondWithResult(_0x443889,_0x5e942f){_0x5e942f=_0x5e942f||0xc8;return function(_0xb019e8){if(_0xb019e8){return _0x443889[_0xb48b('0x19')](_0x5e942f)[_0xb48b('0x1b')](_0xb019e8);}};}function respondWithFilteredResult(_0x30ec05,_0x27b264){return function(_0x2dc575){if(_0x2dc575){var _0x5d8199=typeof _0x27b264[_0xb48b('0x1c')]===_0xb48b('0x1d')&&typeof _0x27b264['limit']==='undefined';var _0x45ec09=_0x2dc575['count'];var _0x2979b7=_0x5d8199?0x0:_0x27b264[_0xb48b('0x1c')];var _0x370c47=_0x5d8199?_0x2dc575[_0xb48b('0x1e')]:_0x27b264[_0xb48b('0x1c')]+_0x27b264[_0xb48b('0x1f')];var _0xae3a31;if(_0x370c47>=_0x45ec09){_0x370c47=_0x45ec09;_0xae3a31=0xc8;}else{_0xae3a31=0xce;}_0x30ec05[_0xb48b('0x19')](_0xae3a31);return _0x30ec05[_0xb48b('0x20')](_0xb48b('0x21'),_0x2979b7+'-'+_0x370c47+'/'+_0x45ec09)[_0xb48b('0x1b')](_0x2dc575);}return null;};}function patchUpdates(_0x3e3f56){return function(_0x4bc0d2){try{jsonpatch[_0xb48b('0x22')](_0x4bc0d2,_0x3e3f56,!![]);}catch(_0x38420e){return BPromise[_0xb48b('0x23')](_0x38420e);}return _0x4bc0d2['save']();};}function saveUpdates(_0x130a44,_0x280741){return function(_0xaf16d9){if(_0xaf16d9){return _0xaf16d9[_0xb48b('0x24')](_0x130a44)[_0xb48b('0x25')](function(_0x488048){return _0x488048;});}return null;};}function removeEntity(_0x24be05,_0x3e0eb1){return function(_0x4a70ed){if(_0x4a70ed){return _0x4a70ed[_0xb48b('0x26')]()[_0xb48b('0x25')](function(){var _0x3474a3=_0x4a70ed[_0xb48b('0x27')]({'plain':!![]});var _0x4747f9=_0xb48b('0x28');return db[_0xb48b('0x29')][_0xb48b('0x26')]({'where':{'type':_0x4747f9,'resourceId':_0x3474a3['id']}})[_0xb48b('0x25')](function(){return _0x4a70ed;});})[_0xb48b('0x25')](function(){_0x24be05[_0xb48b('0x19')](0xcc)[_0xb48b('0x1a')]();});}};}function handleEntityNotFound(_0x46b42b,_0x49f691){return function(_0x28b522){if(!_0x28b522){_0x46b42b['sendStatus'](0x194);}return _0x28b522;};}function handleError(_0x22697f,_0x37c1d2){_0x37c1d2=_0x37c1d2||0x1f4;return function(_0x35b2dd){logger[_0xb48b('0x2a')](_0x35b2dd[_0xb48b('0x2b')]);if(_0x35b2dd[_0xb48b('0x2c')]){delete _0x35b2dd[_0xb48b('0x2c')];}_0x22697f[_0xb48b('0x19')](_0x37c1d2)[_0xb48b('0x2d')](_0x35b2dd);};}exports[_0xb48b('0x2e')]=function(_0x58fd90,_0x1e6252){var _0x26e743={},_0x248a76={},_0x43bc9b={'count':0x0,'rows':[]};var _0x4d915e=_['map'](db[_0xb48b('0x2f')]['rawAttributes'],function(_0xb5a48){return{'name':_0xb5a48[_0xb48b('0x30')],'type':_0xb5a48['type']['key']};});_0x248a76['model']=_[_0xb48b('0x31')](_0x4d915e,'name');_0x248a76['query']=_['keys'](_0x58fd90[_0xb48b('0x32')]);_0x248a76['filters']=_[_0xb48b('0x33')](_0x248a76['model'],_0x248a76[_0xb48b('0x32')]);_0x26e743[_0xb48b('0x34')]=_[_0xb48b('0x33')](_0x248a76[_0xb48b('0x35')],qs[_0xb48b('0x36')](_0x58fd90['query']['fields']));_0x26e743['attributes']=_0x26e743['attributes']['length']?_0x26e743[_0xb48b('0x34')]:_0x248a76[_0xb48b('0x35')];if(!_0x58fd90['query'][_0xb48b('0x37')]('nolimit')){_0x26e743[_0xb48b('0x1f')]=qs[_0xb48b('0x1f')](_0x58fd90[_0xb48b('0x32')][_0xb48b('0x1f')]);_0x26e743[_0xb48b('0x1c')]=qs[_0xb48b('0x1c')](_0x58fd90[_0xb48b('0x32')][_0xb48b('0x1c')]);}_0x26e743[_0xb48b('0x38')]=qs['sort'](_0x58fd90[_0xb48b('0x32')][_0xb48b('0x39')]);_0x26e743[_0xb48b('0x3a')]=qs[_0xb48b('0x3b')](_['pick'](_0x58fd90[_0xb48b('0x32')],_0x248a76['filters']),_0x4d915e);if(_0x58fd90[_0xb48b('0x32')][_0xb48b('0x3c')]){_0x26e743['where']=_[_0xb48b('0x3d')](_0x26e743['where'],{'$or':_[_0xb48b('0x31')](_0x4d915e,function(_0x310077){if(_0x310077['type']!==_0xb48b('0x3e')){var _0x5f55dd={};_0x5f55dd[_0x310077['name']]={'$like':'%'+_0x58fd90['query'][_0xb48b('0x3c')]+'%'};return _0x5f55dd;}})});}_0x26e743=_[_0xb48b('0x3d')]({},_0x26e743,_0x58fd90[_0xb48b('0x3f')]);var _0x5df2df={'where':_0x26e743[_0xb48b('0x3a')]};return db[_0xb48b('0x2f')]['count'](_0x5df2df)[_0xb48b('0x25')](function(_0xfd84fe){_0x43bc9b[_0xb48b('0x1e')]=_0xfd84fe;if(_0x58fd90[_0xb48b('0x32')][_0xb48b('0x40')]){_0x26e743['include']=[{'all':!![]}];}return db[_0xb48b('0x2f')][_0xb48b('0x41')](_0x26e743);})[_0xb48b('0x25')](function(_0x1934fa){_0x43bc9b[_0xb48b('0x42')]=_0x1934fa;return _0x43bc9b;})[_0xb48b('0x25')](respondWithFilteredResult(_0x1e6252,_0x26e743))[_0xb48b('0x43')](handleError(_0x1e6252,null));};exports[_0xb48b('0x44')]=function(_0x1eb7df,_0x1c958c){var _0x17477b={'raw':![],'where':{'id':_0x1eb7df[_0xb48b('0x45')]['id']}},_0x4f1195={};_0x4f1195[_0xb48b('0x35')]=_[_0xb48b('0x46')](db['Trigger'][_0xb48b('0x47')]);_0x4f1195[_0xb48b('0x32')]=_[_0xb48b('0x46')](_0x1eb7df[_0xb48b('0x32')]);_0x4f1195[_0xb48b('0x3b')]=_['intersection'](_0x4f1195['model'],_0x4f1195[_0xb48b('0x32')]);_0x17477b[_0xb48b('0x34')]=_['intersection'](_0x4f1195[_0xb48b('0x35')],qs['fields'](_0x1eb7df[_0xb48b('0x32')][_0xb48b('0x36')]));_0x17477b['attributes']=_0x17477b['attributes'][_0xb48b('0x48')]?_0x17477b[_0xb48b('0x34')]:_0x4f1195[_0xb48b('0x35')];if(_0x1eb7df[_0xb48b('0x32')][_0xb48b('0x40')]){_0x17477b['include']=[{'all':!![]}];}_0x17477b=_[_0xb48b('0x3d')]({},_0x17477b,_0x1eb7df[_0xb48b('0x3f')]);return db[_0xb48b('0x2f')][_0xb48b('0x49')](_0x17477b)[_0xb48b('0x25')](handleEntityNotFound(_0x1c958c,null))['then'](respondWithResult(_0x1c958c,null))[_0xb48b('0x43')](handleError(_0x1c958c,null));};exports['create']=function(_0x47071e,_0x312bc3){return db['Trigger'][_0xb48b('0x4a')](_0x47071e['body'],{})['then'](function(_0x145f1e){var _0x41b472=_0x47071e['user'][_0xb48b('0x27')]({'plain':!![]});if(!_0x41b472)throw new Error(_0xb48b('0x4b'));if(_0x41b472[_0xb48b('0x4c')]==='user'){var _0x4295f9=_0x145f1e[_0xb48b('0x27')]({'plain':!![]});var _0x4cdd80=_0xb48b('0x28');return db[_0xb48b('0x4d')][_0xb48b('0x49')]({'where':{'name':_0x4cdd80,'userProfileId':_0x41b472['userProfileId']},'raw':!![]})[_0xb48b('0x25')](function(_0x4bca5d){if(_0x4bca5d&&_0x4bca5d[_0xb48b('0x4e')]===0x0){return db[_0xb48b('0x29')][_0xb48b('0x4a')]({'name':_0x4295f9[_0xb48b('0x2c')],'resourceId':_0x4295f9['id'],'type':_0x4bca5d[_0xb48b('0x2c')],'sectionId':_0x4bca5d['id']},{})[_0xb48b('0x25')](function(){return _0x145f1e;});}else{return _0x145f1e;}})['catch'](function(_0x2fa5ef){logger[_0xb48b('0x2a')](_0xb48b('0x4f'),_0x2fa5ef);throw _0x2fa5ef;});}return _0x145f1e;})[_0xb48b('0x25')](respondWithResult(_0x312bc3,0xc9))['catch'](handleError(_0x312bc3,null));};exports['update']=function(_0x59aef9,_0x370cd3){if(_0x59aef9[_0xb48b('0x50')]['id']){delete _0x59aef9[_0xb48b('0x50')]['id'];}return db['Trigger'][_0xb48b('0x49')]({'where':{'id':_0x59aef9[_0xb48b('0x45')]['id']}})[_0xb48b('0x25')](handleEntityNotFound(_0x370cd3,null))['then'](saveUpdates(_0x59aef9[_0xb48b('0x50')],null))['then'](respondWithResult(_0x370cd3,null))[_0xb48b('0x43')](handleError(_0x370cd3,null));};exports[_0xb48b('0x26')]=function(_0x23b925,_0x5927f0){return db[_0xb48b('0x2f')][_0xb48b('0x49')]({'where':{'id':_0x23b925[_0xb48b('0x45')]['id']}})['then'](handleEntityNotFound(_0x5927f0,null))['then'](removeEntity(_0x5927f0,null))[_0xb48b('0x43')](handleError(_0x5927f0,null));};exports[_0xb48b('0x51')]=function(_0x57753e,_0x18f74e,_0x4ea7bd){if(_0x57753e[_0xb48b('0x50')]['id']){delete _0x57753e[_0xb48b('0x50')]['id'];}return db[_0xb48b('0x2f')]['find']({'where':{'id':_0x57753e[_0xb48b('0x45')]['id']}})[_0xb48b('0x25')](handleEntityNotFound(_0x18f74e,null))[_0xb48b('0x25')](function(_0x28a3f2){if(_0x28a3f2){_0x57753e['body'][_0xb48b('0x52')]=_0x28a3f2['id'];return db[_0xb48b('0x53')][_0xb48b('0x4a')](_0x57753e['body']);}})[_0xb48b('0x25')](respondWithResult(_0x18f74e,null))[_0xb48b('0x43')](handleError(_0x18f74e,null));};exports[_0xb48b('0x54')]=function(_0x273696,_0x2e1d5b,_0x1b6238){if(_0x273696[_0xb48b('0x50')]['id']){delete _0x273696['body']['id'];}return db[_0xb48b('0x2f')][_0xb48b('0x49')]({'where':{'id':_0x273696[_0xb48b('0x45')]['id']}})[_0xb48b('0x25')](handleEntityNotFound(_0x2e1d5b,null))['then'](function(_0x4d7fc5){if(_0x4d7fc5){_0x273696[_0xb48b('0x50')]['TriggerAnyId']=_0x4d7fc5['id'];return db[_0xb48b('0x53')]['create'](_0x273696['body']);}})[_0xb48b('0x25')](respondWithResult(_0x2e1d5b,null))['catch'](handleError(_0x2e1d5b,null));};exports[_0xb48b('0x55')]=function(_0x2af8c9,_0x4b15db,_0x760ce3){var _0x236a7a={};var _0x644dfc={};var _0x17c918;var _0x25f8c2;return db['Trigger']['findOne']({'where':{'id':_0x2af8c9['params']['id']}})[_0xb48b('0x25')](handleEntityNotFound(_0x4b15db,null))['then'](function(_0x1a2e43){if(_0x1a2e43){_0x17c918=_0x1a2e43;_0x644dfc[_0xb48b('0x35')]=_[_0xb48b('0x46')](db['Condition']['rawAttributes']);_0x644dfc[_0xb48b('0x32')]=_[_0xb48b('0x46')](_0x2af8c9[_0xb48b('0x32')]);_0x644dfc[_0xb48b('0x3b')]=_[_0xb48b('0x33')](_0x644dfc[_0xb48b('0x35')],_0x644dfc[_0xb48b('0x32')]);_0x236a7a[_0xb48b('0x34')]=_['intersection'](_0x644dfc[_0xb48b('0x35')],qs[_0xb48b('0x36')](_0x2af8c9['query']['fields']));_0x236a7a[_0xb48b('0x34')]=_0x236a7a['attributes']['length']?_0x236a7a[_0xb48b('0x34')]:_0x644dfc[_0xb48b('0x35')];_0x236a7a[_0xb48b('0x38')]=qs['sort'](_0x2af8c9[_0xb48b('0x32')][_0xb48b('0x39')]);_0x236a7a[_0xb48b('0x3a')]=qs[_0xb48b('0x3b')](_[_0xb48b('0x56')](_0x2af8c9['query'],_0x644dfc['filters']));if(_0x2af8c9[_0xb48b('0x32')]['filter']){_0x236a7a[_0xb48b('0x3a')]=_['merge'](_0x236a7a[_0xb48b('0x3a')],{'$or':_['map'](_0x236a7a['attributes'],function(_0x4f3d6c){var _0xc16236={};_0xc16236[_0x4f3d6c]={'$like':'%'+_0x2af8c9[_0xb48b('0x32')]['filter']+'%'};return _0xc16236;})});}_0x236a7a=_['merge']({},_0x236a7a,_0x2af8c9[_0xb48b('0x3f')]);return _0x17c918[_0xb48b('0x55')](_0x236a7a);}})['then'](function(_0x15cbdb){if(_0x15cbdb){_0x25f8c2=_0x15cbdb[_0xb48b('0x48')];if(!_0x2af8c9[_0xb48b('0x32')][_0xb48b('0x37')](_0xb48b('0x57'))){_0x236a7a['limit']=qs[_0xb48b('0x1f')](_0x2af8c9[_0xb48b('0x32')][_0xb48b('0x1f')]);_0x236a7a[_0xb48b('0x1c')]=qs['offset'](_0x2af8c9[_0xb48b('0x32')][_0xb48b('0x1c')]);}return _0x17c918[_0xb48b('0x55')](_0x236a7a);}})['then'](function(_0x39a045){if(_0x39a045){return _0x39a045?{'count':_0x25f8c2,'rows':_0x39a045}:null;}})[_0xb48b('0x25')](respondWithResult(_0x4b15db,null))[_0xb48b('0x43')](handleError(_0x4b15db,null));};exports['getAnyConditions']=function(_0x262ab5,_0xd7a566,_0x4bd5bf){var _0x196a1a={};var _0x4b7910={};var _0x33777b;var _0x420c47;return db[_0xb48b('0x2f')][_0xb48b('0x58')]({'where':{'id':_0x262ab5['params']['id']}})[_0xb48b('0x25')](handleEntityNotFound(_0xd7a566,null))[_0xb48b('0x25')](function(_0x550a7d){if(_0x550a7d){_0x33777b=_0x550a7d;_0x4b7910[_0xb48b('0x35')]=_[_0xb48b('0x46')](db[_0xb48b('0x53')][_0xb48b('0x47')]);_0x4b7910[_0xb48b('0x32')]=_['keys'](_0x262ab5[_0xb48b('0x32')]);_0x4b7910[_0xb48b('0x3b')]=_[_0xb48b('0x33')](_0x4b7910[_0xb48b('0x35')],_0x4b7910['query']);_0x196a1a[_0xb48b('0x34')]=_[_0xb48b('0x33')](_0x4b7910['model'],qs[_0xb48b('0x36')](_0x262ab5['query'][_0xb48b('0x36')]));_0x196a1a['attributes']=_0x196a1a[_0xb48b('0x34')]['length']?_0x196a1a[_0xb48b('0x34')]:_0x4b7910[_0xb48b('0x35')];_0x196a1a[_0xb48b('0x38')]=qs[_0xb48b('0x39')](_0x262ab5['query'][_0xb48b('0x39')]);_0x196a1a[_0xb48b('0x3a')]=qs[_0xb48b('0x3b')](_[_0xb48b('0x56')](_0x262ab5['query'],_0x4b7910[_0xb48b('0x3b')]));if(_0x262ab5['query']['filter']){_0x196a1a[_0xb48b('0x3a')]=_['merge'](_0x196a1a['where'],{'$or':_[_0xb48b('0x31')](_0x196a1a[_0xb48b('0x34')],function(_0x51df5a){var _0x419ace={};_0x419ace[_0x51df5a]={'$like':'%'+_0x262ab5[_0xb48b('0x32')][_0xb48b('0x3c')]+'%'};return _0x419ace;})});}_0x196a1a=_[_0xb48b('0x3d')]({},_0x196a1a,_0x262ab5['options']);return _0x33777b['getAnyConditions'](_0x196a1a);}})[_0xb48b('0x25')](function(_0xaa9080){if(_0xaa9080){_0x420c47=_0xaa9080[_0xb48b('0x48')];if(!_0x262ab5[_0xb48b('0x32')][_0xb48b('0x37')]('nolimit')){_0x196a1a[_0xb48b('0x1f')]=qs[_0xb48b('0x1f')](_0x262ab5[_0xb48b('0x32')]['limit']);_0x196a1a[_0xb48b('0x1c')]=qs['offset'](_0x262ab5[_0xb48b('0x32')][_0xb48b('0x1c')]);}return _0x33777b[_0xb48b('0x59')](_0x196a1a);}})[_0xb48b('0x25')](function(_0x36c149){if(_0x36c149){return _0x36c149?{'count':_0x420c47,'rows':_0x36c149}:null;}})[_0xb48b('0x25')](respondWithResult(_0xd7a566,null))[_0xb48b('0x43')](handleError(_0xd7a566,null));};exports['addAction']=function(_0x560987,_0x404edb,_0x39a9f3){if(_0x560987[_0xb48b('0x50')]['id']){delete _0x560987[_0xb48b('0x50')]['id'];}return db[_0xb48b('0x2f')]['find']({'where':{'id':_0x560987[_0xb48b('0x45')]['id']}})[_0xb48b('0x25')](handleEntityNotFound(_0x404edb,null))['then'](function(_0x37c1e7){if(_0x37c1e7){_0x560987[_0xb48b('0x50')]['TriggerId']=_0x37c1e7['id'];return db[_0xb48b('0x5a')][_0xb48b('0x4a')](_0x560987[_0xb48b('0x50')]);}})[_0xb48b('0x25')](respondWithResult(_0x404edb,null))['catch'](handleError(_0x404edb,null));};exports[_0xb48b('0x5b')]=function(_0x494825,_0x5552e5,_0x149369){var _0x5be0a3={};var _0x38e17c={};var _0x5414d1;var _0x26ffda;return db['Trigger']['findOne']({'where':{'id':_0x494825['params']['id']}})['then'](handleEntityNotFound(_0x5552e5,null))[_0xb48b('0x25')](function(_0x114a8b){if(_0x114a8b){_0x5414d1=_0x114a8b;_0x38e17c['model']=_[_0xb48b('0x46')](db[_0xb48b('0x5a')][_0xb48b('0x47')]);_0x38e17c[_0xb48b('0x32')]=_[_0xb48b('0x46')](_0x494825[_0xb48b('0x32')]);_0x38e17c['filters']=_[_0xb48b('0x33')](_0x38e17c['model'],_0x38e17c[_0xb48b('0x32')]);_0x5be0a3[_0xb48b('0x34')]=_['intersection'](_0x38e17c[_0xb48b('0x35')],qs[_0xb48b('0x36')](_0x494825[_0xb48b('0x32')][_0xb48b('0x36')]));_0x5be0a3[_0xb48b('0x34')]=_0x5be0a3[_0xb48b('0x34')][_0xb48b('0x48')]?_0x5be0a3['attributes']:_0x38e17c['model'];_0x5be0a3[_0xb48b('0x38')]=qs['sort'](_0x494825[_0xb48b('0x32')][_0xb48b('0x39')]);_0x5be0a3[_0xb48b('0x3a')]=qs[_0xb48b('0x3b')](_[_0xb48b('0x56')](_0x494825[_0xb48b('0x32')],_0x38e17c[_0xb48b('0x3b')]));if(_0x494825[_0xb48b('0x32')][_0xb48b('0x3c')]){_0x5be0a3[_0xb48b('0x3a')]=_[_0xb48b('0x3d')](_0x5be0a3[_0xb48b('0x3a')],{'$or':_['map'](_0x5be0a3[_0xb48b('0x34')],function(_0x12cd74){var _0x180a8a={};_0x180a8a[_0x12cd74]={'$like':'%'+_0x494825[_0xb48b('0x32')][_0xb48b('0x3c')]+'%'};return _0x180a8a;})});}_0x5be0a3=_[_0xb48b('0x3d')]({},_0x5be0a3,_0x494825[_0xb48b('0x3f')]);return _0x5414d1['getActions'](_0x5be0a3);}})[_0xb48b('0x25')](function(_0x7a73ed){if(_0x7a73ed){_0x26ffda=_0x7a73ed[_0xb48b('0x48')];if(!_0x494825[_0xb48b('0x32')][_0xb48b('0x37')](_0xb48b('0x57'))){_0x5be0a3[_0xb48b('0x1f')]=qs[_0xb48b('0x1f')](_0x494825['query']['limit']);_0x5be0a3[_0xb48b('0x1c')]=qs[_0xb48b('0x1c')](_0x494825[_0xb48b('0x32')]['offset']);}return _0x5414d1[_0xb48b('0x5b')](_0x5be0a3);}})[_0xb48b('0x25')](function(_0x5acac0){if(_0x5acac0){return _0x5acac0?{'count':_0x26ffda,'rows':_0x5acac0}:null;}})[_0xb48b('0x25')](respondWithResult(_0x5552e5,null))[_0xb48b('0x43')](handleError(_0x5552e5,null));}; \ No newline at end of file +var _0xe2b1=['findOne','getAnyConditions','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','apply','save','update','then','destroy','get','Triggers','end','error','name','Trigger','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','addAllCondition','TriggerAllId','Condition','addAnyCondition','getAllConditions'];(function(_0x23a717,_0x160b4e){var _0x3e712c=function(_0x1509c3){while(--_0x1509c3){_0x23a717['push'](_0x23a717['shift']());}};_0x3e712c(++_0x160b4e);}(_0xe2b1,0x181));var _0x1e2b=function(_0x246384,_0x3c6556){_0x246384=_0x246384-0x0;var _0x5e5d40=_0xe2b1[_0x246384];return _0x5e5d40;};'use strict';var emlformat=require(_0x1e2b('0x0'));var rimraf=require(_0x1e2b('0x1'));var zipdir=require(_0x1e2b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1e2b('0x3'));var moment=require(_0x1e2b('0x4'));var BPromise=require(_0x1e2b('0x5'));var Mustache=require(_0x1e2b('0x6'));var util=require('util');var path=require(_0x1e2b('0x7'));var sox=require(_0x1e2b('0x8'));var csv=require(_0x1e2b('0x9'));var ejs=require(_0x1e2b('0xa'));var fs=require('fs');var fs_extra=require(_0x1e2b('0xb'));var _=require(_0x1e2b('0xc'));var squel=require(_0x1e2b('0xd'));var crypto=require(_0x1e2b('0xe'));var jsforce=require(_0x1e2b('0xf'));var deskjs=require(_0x1e2b('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1e2b('0x11'));var Redis=require(_0x1e2b('0x12'));var authService=require(_0x1e2b('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x1e2b('0x14'));var hardwareService=require(_0x1e2b('0x15'));var logger=require('../../config/logger')(_0x1e2b('0x16'));var utils=require(_0x1e2b('0x17'));var config=require(_0x1e2b('0x18'));var licenseUtil=require(_0x1e2b('0x19'));var db=require(_0x1e2b('0x1a'))['db'];function respondWithStatusCode(_0x17aded,_0x1675dc){_0x1675dc=_0x1675dc||0xcc;return function(_0x28a927){if(_0x28a927){return _0x17aded[_0x1e2b('0x1b')](_0x1675dc);}return _0x17aded['status'](_0x1675dc)['end']();};}function respondWithResult(_0x41370e,_0x5cfbf2){_0x5cfbf2=_0x5cfbf2||0xc8;return function(_0x4822d2){if(_0x4822d2){return _0x41370e[_0x1e2b('0x1c')](_0x5cfbf2)['json'](_0x4822d2);}};}function respondWithFilteredResult(_0x4439fe,_0x5d33aa){return function(_0x14cb7e){if(_0x14cb7e){var _0x2db95c=typeof _0x5d33aa[_0x1e2b('0x1d')]===_0x1e2b('0x1e')&&typeof _0x5d33aa[_0x1e2b('0x1f')]===_0x1e2b('0x1e');var _0x323a83=_0x14cb7e[_0x1e2b('0x20')];var _0x380fb6=_0x2db95c?0x0:_0x5d33aa[_0x1e2b('0x1d')];var _0xa1cdf=_0x2db95c?_0x14cb7e[_0x1e2b('0x20')]:_0x5d33aa['offset']+_0x5d33aa[_0x1e2b('0x1f')];var _0x36dba5;if(_0xa1cdf>=_0x323a83){_0xa1cdf=_0x323a83;_0x36dba5=0xc8;}else{_0x36dba5=0xce;}_0x4439fe['status'](_0x36dba5);return _0x4439fe[_0x1e2b('0x21')]('Content-Range',_0x380fb6+'-'+_0xa1cdf+'/'+_0x323a83)[_0x1e2b('0x22')](_0x14cb7e);}return null;};}function patchUpdates(_0x2f9166){return function(_0x40a083){try{jsonpatch[_0x1e2b('0x23')](_0x40a083,_0x2f9166,!![]);}catch(_0x536438){return BPromise['reject'](_0x536438);}return _0x40a083[_0x1e2b('0x24')]();};}function saveUpdates(_0x5b5c3a,_0x8b6123){return function(_0xc16ca6){if(_0xc16ca6){return _0xc16ca6[_0x1e2b('0x25')](_0x5b5c3a)[_0x1e2b('0x26')](function(_0x3527c8){return _0x3527c8;});}return null;};}function removeEntity(_0x20b2ad,_0x444f1a){return function(_0xf0e90){if(_0xf0e90){return _0xf0e90[_0x1e2b('0x27')]()['then'](function(){var _0xd1e7ba=_0xf0e90[_0x1e2b('0x28')]({'plain':!![]});var _0x15a3a8=_0x1e2b('0x29');return db['UserProfileResource'][_0x1e2b('0x27')]({'where':{'type':_0x15a3a8,'resourceId':_0xd1e7ba['id']}})[_0x1e2b('0x26')](function(){return _0xf0e90;});})[_0x1e2b('0x26')](function(){_0x20b2ad[_0x1e2b('0x1c')](0xcc)[_0x1e2b('0x2a')]();});}};}function handleEntityNotFound(_0xea3d1f,_0x3339cb){return function(_0x5ecc74){if(!_0x5ecc74){_0xea3d1f['sendStatus'](0x194);}return _0x5ecc74;};}function handleError(_0x1a5506,_0x1402c9){_0x1402c9=_0x1402c9||0x1f4;return function(_0x8225b7){logger[_0x1e2b('0x2b')](_0x8225b7['stack']);if(_0x8225b7['name']){delete _0x8225b7[_0x1e2b('0x2c')];}_0x1a5506['status'](_0x1402c9)['send'](_0x8225b7);};}exports['index']=function(_0x3c8a63,_0x1440db){var _0x4a320e={},_0x142bfd={},_0x474d64={'count':0x0,'rows':[]};var _0x4c1552=_['map'](db[_0x1e2b('0x2d')][_0x1e2b('0x2e')],function(_0x15b446){return{'name':_0x15b446[_0x1e2b('0x2f')],'type':_0x15b446[_0x1e2b('0x30')][_0x1e2b('0x31')]};});_0x142bfd[_0x1e2b('0x32')]=_[_0x1e2b('0x33')](_0x4c1552,_0x1e2b('0x2c'));_0x142bfd[_0x1e2b('0x34')]=_[_0x1e2b('0x35')](_0x3c8a63['query']);_0x142bfd[_0x1e2b('0x36')]=_[_0x1e2b('0x37')](_0x142bfd[_0x1e2b('0x32')],_0x142bfd[_0x1e2b('0x34')]);_0x4a320e[_0x1e2b('0x38')]=_['intersection'](_0x142bfd[_0x1e2b('0x32')],qs[_0x1e2b('0x39')](_0x3c8a63[_0x1e2b('0x34')]['fields']));_0x4a320e[_0x1e2b('0x38')]=_0x4a320e[_0x1e2b('0x38')]['length']?_0x4a320e[_0x1e2b('0x38')]:_0x142bfd[_0x1e2b('0x32')];if(!_0x3c8a63[_0x1e2b('0x34')][_0x1e2b('0x3a')](_0x1e2b('0x3b'))){_0x4a320e[_0x1e2b('0x1f')]=qs[_0x1e2b('0x1f')](_0x3c8a63['query'][_0x1e2b('0x1f')]);_0x4a320e[_0x1e2b('0x1d')]=qs[_0x1e2b('0x1d')](_0x3c8a63['query'][_0x1e2b('0x1d')]);}_0x4a320e[_0x1e2b('0x3c')]=qs[_0x1e2b('0x3d')](_0x3c8a63[_0x1e2b('0x34')]['sort']);_0x4a320e[_0x1e2b('0x3e')]=qs[_0x1e2b('0x36')](_[_0x1e2b('0x3f')](_0x3c8a63['query'],_0x142bfd[_0x1e2b('0x36')]),_0x4c1552);if(_0x3c8a63[_0x1e2b('0x34')][_0x1e2b('0x40')]){_0x4a320e[_0x1e2b('0x3e')]=_[_0x1e2b('0x41')](_0x4a320e['where'],{'$or':_[_0x1e2b('0x33')](_0x4c1552,function(_0x101458){if(_0x101458[_0x1e2b('0x30')]!==_0x1e2b('0x42')){var _0x362865={};_0x362865[_0x101458[_0x1e2b('0x2c')]]={'$like':'%'+_0x3c8a63[_0x1e2b('0x34')][_0x1e2b('0x40')]+'%'};return _0x362865;}})});}_0x4a320e=_[_0x1e2b('0x41')]({},_0x4a320e,_0x3c8a63[_0x1e2b('0x43')]);var _0x147195={'where':_0x4a320e[_0x1e2b('0x3e')]};return db[_0x1e2b('0x2d')]['count'](_0x147195)[_0x1e2b('0x26')](function(_0x1e9964){_0x474d64['count']=_0x1e9964;if(_0x3c8a63['query'][_0x1e2b('0x44')]){_0x4a320e[_0x1e2b('0x45')]=[{'all':!![]}];}return db[_0x1e2b('0x2d')][_0x1e2b('0x46')](_0x4a320e);})[_0x1e2b('0x26')](function(_0x59ca55){_0x474d64[_0x1e2b('0x47')]=_0x59ca55;return _0x474d64;})['then'](respondWithFilteredResult(_0x1440db,_0x4a320e))[_0x1e2b('0x48')](handleError(_0x1440db,null));};exports[_0x1e2b('0x49')]=function(_0x1d8ef4,_0x4d9281){var _0x2fefa5={'raw':![],'where':{'id':_0x1d8ef4[_0x1e2b('0x4a')]['id']}},_0xd26e4f={};_0xd26e4f[_0x1e2b('0x32')]=_[_0x1e2b('0x35')](db['Trigger'][_0x1e2b('0x2e')]);_0xd26e4f['query']=_['keys'](_0x1d8ef4['query']);_0xd26e4f[_0x1e2b('0x36')]=_[_0x1e2b('0x37')](_0xd26e4f[_0x1e2b('0x32')],_0xd26e4f['query']);_0x2fefa5['attributes']=_[_0x1e2b('0x37')](_0xd26e4f[_0x1e2b('0x32')],qs['fields'](_0x1d8ef4[_0x1e2b('0x34')]['fields']));_0x2fefa5[_0x1e2b('0x38')]=_0x2fefa5[_0x1e2b('0x38')][_0x1e2b('0x4b')]?_0x2fefa5['attributes']:_0xd26e4f[_0x1e2b('0x32')];if(_0x1d8ef4[_0x1e2b('0x34')][_0x1e2b('0x44')]){_0x2fefa5[_0x1e2b('0x45')]=[{'all':!![]}];}_0x2fefa5=_[_0x1e2b('0x41')]({},_0x2fefa5,_0x1d8ef4['options']);return db[_0x1e2b('0x2d')][_0x1e2b('0x4c')](_0x2fefa5)[_0x1e2b('0x26')](handleEntityNotFound(_0x4d9281,null))[_0x1e2b('0x26')](respondWithResult(_0x4d9281,null))['catch'](handleError(_0x4d9281,null));};exports[_0x1e2b('0x4d')]=function(_0x30a505,_0x16d4ac){return db[_0x1e2b('0x2d')][_0x1e2b('0x4d')](_0x30a505[_0x1e2b('0x4e')],{})[_0x1e2b('0x26')](function(_0x139caa){var _0x326928=_0x30a505['user'][_0x1e2b('0x28')]({'plain':!![]});if(!_0x326928)throw new Error(_0x1e2b('0x4f'));if(_0x326928[_0x1e2b('0x50')]==='user'){var _0x1fb492=_0x139caa[_0x1e2b('0x28')]({'plain':!![]});var _0x5b2e9e=_0x1e2b('0x29');return db[_0x1e2b('0x51')][_0x1e2b('0x4c')]({'where':{'name':_0x5b2e9e,'userProfileId':_0x326928[_0x1e2b('0x52')]},'raw':!![]})[_0x1e2b('0x26')](function(_0x28fd94){if(_0x28fd94&&_0x28fd94[_0x1e2b('0x53')]===0x0){return db[_0x1e2b('0x54')][_0x1e2b('0x4d')]({'name':_0x1fb492[_0x1e2b('0x2c')],'resourceId':_0x1fb492['id'],'type':_0x28fd94[_0x1e2b('0x2c')],'sectionId':_0x28fd94['id']},{})[_0x1e2b('0x26')](function(){return _0x139caa;});}else{return _0x139caa;}})[_0x1e2b('0x48')](function(_0x23a731){logger[_0x1e2b('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x23a731);throw _0x23a731;});}return _0x139caa;})[_0x1e2b('0x26')](respondWithResult(_0x16d4ac,0xc9))[_0x1e2b('0x48')](handleError(_0x16d4ac,null));};exports[_0x1e2b('0x25')]=function(_0x29c6ad,_0x5b5771){if(_0x29c6ad[_0x1e2b('0x4e')]['id']){delete _0x29c6ad[_0x1e2b('0x4e')]['id'];}return db[_0x1e2b('0x2d')][_0x1e2b('0x4c')]({'where':{'id':_0x29c6ad['params']['id']}})['then'](handleEntityNotFound(_0x5b5771,null))[_0x1e2b('0x26')](saveUpdates(_0x29c6ad[_0x1e2b('0x4e')],null))[_0x1e2b('0x26')](respondWithResult(_0x5b5771,null))['catch'](handleError(_0x5b5771,null));};exports[_0x1e2b('0x27')]=function(_0x33c9f4,_0x5bf36c){return db['Trigger'][_0x1e2b('0x4c')]({'where':{'id':_0x33c9f4[_0x1e2b('0x4a')]['id']}})[_0x1e2b('0x26')](handleEntityNotFound(_0x5bf36c,null))[_0x1e2b('0x26')](removeEntity(_0x5bf36c,null))['catch'](handleError(_0x5bf36c,null));};exports[_0x1e2b('0x55')]=function(_0x435108,_0x15fe2b,_0x4ce4c0){if(_0x435108['body']['id']){delete _0x435108['body']['id'];}return db['Trigger'][_0x1e2b('0x4c')]({'where':{'id':_0x435108[_0x1e2b('0x4a')]['id']}})[_0x1e2b('0x26')](handleEntityNotFound(_0x15fe2b,null))[_0x1e2b('0x26')](function(_0x18f332){if(_0x18f332){_0x435108['body'][_0x1e2b('0x56')]=_0x18f332['id'];return db[_0x1e2b('0x57')]['create'](_0x435108['body']);}})[_0x1e2b('0x26')](respondWithResult(_0x15fe2b,null))[_0x1e2b('0x48')](handleError(_0x15fe2b,null));};exports[_0x1e2b('0x58')]=function(_0x1dd450,_0xbf16d2,_0x560396){if(_0x1dd450[_0x1e2b('0x4e')]['id']){delete _0x1dd450[_0x1e2b('0x4e')]['id'];}return db['Trigger'][_0x1e2b('0x4c')]({'where':{'id':_0x1dd450[_0x1e2b('0x4a')]['id']}})[_0x1e2b('0x26')](handleEntityNotFound(_0xbf16d2,null))['then'](function(_0x2bf9d2){if(_0x2bf9d2){_0x1dd450[_0x1e2b('0x4e')]['TriggerAnyId']=_0x2bf9d2['id'];return db[_0x1e2b('0x57')]['create'](_0x1dd450[_0x1e2b('0x4e')]);}})[_0x1e2b('0x26')](respondWithResult(_0xbf16d2,null))[_0x1e2b('0x48')](handleError(_0xbf16d2,null));};exports[_0x1e2b('0x59')]=function(_0x470dff,_0x2c559b,_0x1cd897){var _0x84a1f8={};var _0x411b28={};var _0x20af04;var _0x2d9040;return db[_0x1e2b('0x2d')][_0x1e2b('0x5a')]({'where':{'id':_0x470dff['params']['id']}})[_0x1e2b('0x26')](handleEntityNotFound(_0x2c559b,null))[_0x1e2b('0x26')](function(_0x447c57){if(_0x447c57){_0x20af04=_0x447c57;_0x411b28[_0x1e2b('0x32')]=_[_0x1e2b('0x35')](db['Condition'][_0x1e2b('0x2e')]);_0x411b28[_0x1e2b('0x34')]=_[_0x1e2b('0x35')](_0x470dff[_0x1e2b('0x34')]);_0x411b28[_0x1e2b('0x36')]=_[_0x1e2b('0x37')](_0x411b28[_0x1e2b('0x32')],_0x411b28[_0x1e2b('0x34')]);_0x84a1f8[_0x1e2b('0x38')]=_[_0x1e2b('0x37')](_0x411b28['model'],qs[_0x1e2b('0x39')](_0x470dff[_0x1e2b('0x34')][_0x1e2b('0x39')]));_0x84a1f8['attributes']=_0x84a1f8[_0x1e2b('0x38')]['length']?_0x84a1f8[_0x1e2b('0x38')]:_0x411b28[_0x1e2b('0x32')];_0x84a1f8[_0x1e2b('0x3c')]=qs[_0x1e2b('0x3d')](_0x470dff[_0x1e2b('0x34')][_0x1e2b('0x3d')]);_0x84a1f8[_0x1e2b('0x3e')]=qs[_0x1e2b('0x36')](_[_0x1e2b('0x3f')](_0x470dff[_0x1e2b('0x34')],_0x411b28[_0x1e2b('0x36')]));if(_0x470dff[_0x1e2b('0x34')][_0x1e2b('0x40')]){_0x84a1f8[_0x1e2b('0x3e')]=_['merge'](_0x84a1f8[_0x1e2b('0x3e')],{'$or':_[_0x1e2b('0x33')](_0x84a1f8[_0x1e2b('0x38')],function(_0x2790ca){var _0x15b734={};_0x15b734[_0x2790ca]={'$like':'%'+_0x470dff[_0x1e2b('0x34')]['filter']+'%'};return _0x15b734;})});}_0x84a1f8=_[_0x1e2b('0x41')]({},_0x84a1f8,_0x470dff['options']);return _0x20af04[_0x1e2b('0x59')](_0x84a1f8);}})[_0x1e2b('0x26')](function(_0x346d5a){if(_0x346d5a){_0x2d9040=_0x346d5a[_0x1e2b('0x4b')];if(!_0x470dff[_0x1e2b('0x34')][_0x1e2b('0x3a')](_0x1e2b('0x3b'))){_0x84a1f8[_0x1e2b('0x1f')]=qs['limit'](_0x470dff[_0x1e2b('0x34')]['limit']);_0x84a1f8[_0x1e2b('0x1d')]=qs[_0x1e2b('0x1d')](_0x470dff[_0x1e2b('0x34')]['offset']);}return _0x20af04[_0x1e2b('0x59')](_0x84a1f8);}})[_0x1e2b('0x26')](function(_0x1157c7){if(_0x1157c7){return _0x1157c7?{'count':_0x2d9040,'rows':_0x1157c7}:null;}})[_0x1e2b('0x26')](respondWithResult(_0x2c559b,null))[_0x1e2b('0x48')](handleError(_0x2c559b,null));};exports[_0x1e2b('0x5b')]=function(_0x2758e6,_0x55be63,_0x247aaf){var _0x54016d={};var _0x21eef7={};var _0x43a8bb;var _0x51f6f4;return db[_0x1e2b('0x2d')][_0x1e2b('0x5a')]({'where':{'id':_0x2758e6[_0x1e2b('0x4a')]['id']}})[_0x1e2b('0x26')](handleEntityNotFound(_0x55be63,null))[_0x1e2b('0x26')](function(_0x58bc0d){if(_0x58bc0d){_0x43a8bb=_0x58bc0d;_0x21eef7[_0x1e2b('0x32')]=_[_0x1e2b('0x35')](db['Condition']['rawAttributes']);_0x21eef7[_0x1e2b('0x34')]=_['keys'](_0x2758e6[_0x1e2b('0x34')]);_0x21eef7[_0x1e2b('0x36')]=_[_0x1e2b('0x37')](_0x21eef7[_0x1e2b('0x32')],_0x21eef7[_0x1e2b('0x34')]);_0x54016d[_0x1e2b('0x38')]=_[_0x1e2b('0x37')](_0x21eef7[_0x1e2b('0x32')],qs[_0x1e2b('0x39')](_0x2758e6[_0x1e2b('0x34')][_0x1e2b('0x39')]));_0x54016d[_0x1e2b('0x38')]=_0x54016d[_0x1e2b('0x38')][_0x1e2b('0x4b')]?_0x54016d['attributes']:_0x21eef7[_0x1e2b('0x32')];_0x54016d[_0x1e2b('0x3c')]=qs['sort'](_0x2758e6[_0x1e2b('0x34')]['sort']);_0x54016d[_0x1e2b('0x3e')]=qs[_0x1e2b('0x36')](_[_0x1e2b('0x3f')](_0x2758e6[_0x1e2b('0x34')],_0x21eef7[_0x1e2b('0x36')]));if(_0x2758e6['query'][_0x1e2b('0x40')]){_0x54016d['where']=_['merge'](_0x54016d[_0x1e2b('0x3e')],{'$or':_['map'](_0x54016d[_0x1e2b('0x38')],function(_0x1193f0){var _0x22f6e9={};_0x22f6e9[_0x1193f0]={'$like':'%'+_0x2758e6[_0x1e2b('0x34')][_0x1e2b('0x40')]+'%'};return _0x22f6e9;})});}_0x54016d=_[_0x1e2b('0x41')]({},_0x54016d,_0x2758e6[_0x1e2b('0x43')]);return _0x43a8bb['getAnyConditions'](_0x54016d);}})[_0x1e2b('0x26')](function(_0x103080){if(_0x103080){_0x51f6f4=_0x103080[_0x1e2b('0x4b')];if(!_0x2758e6[_0x1e2b('0x34')][_0x1e2b('0x3a')]('nolimit')){_0x54016d['limit']=qs[_0x1e2b('0x1f')](_0x2758e6['query']['limit']);_0x54016d['offset']=qs['offset'](_0x2758e6[_0x1e2b('0x34')][_0x1e2b('0x1d')]);}return _0x43a8bb[_0x1e2b('0x5b')](_0x54016d);}})['then'](function(_0x557350){if(_0x557350){return _0x557350?{'count':_0x51f6f4,'rows':_0x557350}:null;}})[_0x1e2b('0x26')](respondWithResult(_0x55be63,null))[_0x1e2b('0x48')](handleError(_0x55be63,null));};exports['addAction']=function(_0x328fe1,_0x2cdfa5,_0x4ae5a1){if(_0x328fe1[_0x1e2b('0x4e')]['id']){delete _0x328fe1['body']['id'];}return db[_0x1e2b('0x2d')][_0x1e2b('0x4c')]({'where':{'id':_0x328fe1['params']['id']}})[_0x1e2b('0x26')](handleEntityNotFound(_0x2cdfa5,null))[_0x1e2b('0x26')](function(_0x4d6fce){if(_0x4d6fce){_0x328fe1['body'][_0x1e2b('0x5c')]=_0x4d6fce['id'];return db[_0x1e2b('0x5d')]['create'](_0x328fe1[_0x1e2b('0x4e')]);}})[_0x1e2b('0x26')](respondWithResult(_0x2cdfa5,null))['catch'](handleError(_0x2cdfa5,null));};exports[_0x1e2b('0x5e')]=function(_0x489b4d,_0x4ed602,_0x565031){var _0xa80537={};var _0x1f8fe1={};var _0x24c4db;var _0x2592b1;return db[_0x1e2b('0x2d')]['findOne']({'where':{'id':_0x489b4d[_0x1e2b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4ed602,null))['then'](function(_0x5a663e){if(_0x5a663e){_0x24c4db=_0x5a663e;_0x1f8fe1[_0x1e2b('0x32')]=_['keys'](db[_0x1e2b('0x5d')]['rawAttributes']);_0x1f8fe1[_0x1e2b('0x34')]=_[_0x1e2b('0x35')](_0x489b4d['query']);_0x1f8fe1[_0x1e2b('0x36')]=_[_0x1e2b('0x37')](_0x1f8fe1[_0x1e2b('0x32')],_0x1f8fe1[_0x1e2b('0x34')]);_0xa80537[_0x1e2b('0x38')]=_[_0x1e2b('0x37')](_0x1f8fe1[_0x1e2b('0x32')],qs[_0x1e2b('0x39')](_0x489b4d[_0x1e2b('0x34')][_0x1e2b('0x39')]));_0xa80537['attributes']=_0xa80537[_0x1e2b('0x38')][_0x1e2b('0x4b')]?_0xa80537[_0x1e2b('0x38')]:_0x1f8fe1[_0x1e2b('0x32')];_0xa80537[_0x1e2b('0x3c')]=qs[_0x1e2b('0x3d')](_0x489b4d[_0x1e2b('0x34')]['sort']);_0xa80537[_0x1e2b('0x3e')]=qs['filters'](_[_0x1e2b('0x3f')](_0x489b4d[_0x1e2b('0x34')],_0x1f8fe1['filters']));if(_0x489b4d[_0x1e2b('0x34')][_0x1e2b('0x40')]){_0xa80537[_0x1e2b('0x3e')]=_[_0x1e2b('0x41')](_0xa80537[_0x1e2b('0x3e')],{'$or':_['map'](_0xa80537['attributes'],function(_0x97ab87){var _0xc4677={};_0xc4677[_0x97ab87]={'$like':'%'+_0x489b4d[_0x1e2b('0x34')][_0x1e2b('0x40')]+'%'};return _0xc4677;})});}_0xa80537=_[_0x1e2b('0x41')]({},_0xa80537,_0x489b4d[_0x1e2b('0x43')]);return _0x24c4db[_0x1e2b('0x5e')](_0xa80537);}})[_0x1e2b('0x26')](function(_0x26ebb9){if(_0x26ebb9){_0x2592b1=_0x26ebb9[_0x1e2b('0x4b')];if(!_0x489b4d[_0x1e2b('0x34')][_0x1e2b('0x3a')](_0x1e2b('0x3b'))){_0xa80537[_0x1e2b('0x1f')]=qs[_0x1e2b('0x1f')](_0x489b4d[_0x1e2b('0x34')][_0x1e2b('0x1f')]);_0xa80537[_0x1e2b('0x1d')]=qs[_0x1e2b('0x1d')](_0x489b4d['query'][_0x1e2b('0x1d')]);}return _0x24c4db[_0x1e2b('0x5e')](_0xa80537);}})[_0x1e2b('0x26')](function(_0x3992fd){if(_0x3992fd){return _0x3992fd?{'count':_0x2592b1,'rows':_0x3992fd}:null;}})[_0x1e2b('0x26')](respondWithResult(_0x4ed602,null))['catch'](handleError(_0x4ed602,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 322bc91..7ece552 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 _0x3a32=['util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./trigger.attributes','define','Trigger','tools_triggers','lodash'];(function(_0x47a297,_0x5b82af){var _0x23c799=function(_0x271c93){while(--_0x271c93){_0x47a297['push'](_0x47a297['shift']());}};_0x23c799(++_0x5b82af);}(_0x3a32,0x9b));var _0x23a3=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x3a32[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x23a3('0x0'));var util=require(_0x23a3('0x1'));var logger=require(_0x23a3('0x2'))(_0x23a3('0x3'));var moment=require(_0x23a3('0x4'));var BPromise=require(_0x23a3('0x5'));var rp=require(_0x23a3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x23a3('0x7'));var attributes=require(_0x23a3('0x8'));module['exports']=function(_0x3b1735,_0x529b70){return _0x3b1735[_0x23a3('0x9')](_0x23a3('0xa'),attributes,{'tableName':_0x23a3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1666=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes','define','Trigger','tools_triggers'];(function(_0x3425c9,_0x4c6caa){var _0x5328d6=function(_0x2510aa){while(--_0x2510aa){_0x3425c9['push'](_0x3425c9['shift']());}};_0x5328d6(++_0x4c6caa);}(_0x1666,0x75));var _0x6166=function(_0x6565f7,_0x1e1653){_0x6565f7=_0x6565f7-0x0;var _0x12bc74=_0x1666[_0x6565f7];return _0x12bc74;};'use strict';var _=require(_0x6166('0x0'));var util=require(_0x6166('0x1'));var logger=require('../../config/logger')(_0x6166('0x2'));var moment=require(_0x6166('0x3'));var BPromise=require(_0x6166('0x4'));var rp=require(_0x6166('0x5'));var fs=require('fs');var path=require(_0x6166('0x6'));var rimraf=require(_0x6166('0x7'));var config=require(_0x6166('0x8'));var attributes=require(_0x6166('0x9'));module['exports']=function(_0x2ee359,_0x1d4f2a){return _0x2ee359[_0x6166('0xa')](_0x6166('0xb'),attributes,{'tableName':_0x6166('0xc'),'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 3d39fa9..35cfd78 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 _0xafdc=['../../config/environment','jayson/promise','http','request','info','Trigger,\x20%s,\x20%s','debug','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetTrigger','Trigger','findAll','options','raw','where','attributes','limit','include','map','model','then','stringify','ShowTrigger','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x43941d,_0x45fd0d){var _0x27b82a=function(_0x21851e){while(--_0x21851e){_0x43941d['push'](_0x43941d['shift']());}};_0x27b82a(++_0x45fd0d);}(_0xafdc,0xd6));var _0xcafd=function(_0x5a9f43,_0x16372e){_0x5a9f43=_0x5a9f43-0x0;var _0x3f4d67=_0xafdc[_0x5a9f43];return _0x3f4d67;};'use strict';var _=require(_0xcafd('0x0'));var util=require(_0xcafd('0x1'));var moment=require(_0xcafd('0x2'));var BPromise=require(_0xcafd('0x3'));var rs=require(_0xcafd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcafd('0x5'))['db'];var utils=require(_0xcafd('0x6'));var logger=require(_0xcafd('0x7'))('rpc');var config=require(_0xcafd('0x8'));var jayson=require(_0xcafd('0x9'));var client=jayson['client'][_0xcafd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10244b,_0x358ede,_0x4212d9){return new BPromise(function(_0x583a77,_0x48aab0){return client[_0xcafd('0xb')](_0x10244b,_0x4212d9)['then'](function(_0x57fc2c){logger[_0xcafd('0xc')](_0xcafd('0xd'),_0x358ede,'request\x20sent');logger[_0xcafd('0xe')](_0xcafd('0xf'),_0x358ede,_0xcafd('0x10'),JSON['stringify'](_0x57fc2c));if(_0x57fc2c[_0xcafd('0x11')]){if(_0x57fc2c[_0xcafd('0x11')][_0xcafd('0x12')]===0x1f4){logger['error']('Trigger,\x20%s,\x20%s',_0x358ede,_0x57fc2c[_0xcafd('0x11')][_0xcafd('0x13')]);return _0x48aab0(_0x57fc2c[_0xcafd('0x11')][_0xcafd('0x13')]);}logger[_0xcafd('0x11')](_0xcafd('0xd'),_0x358ede,_0x57fc2c['error'][_0xcafd('0x13')]);return _0x583a77(_0x57fc2c[_0xcafd('0x11')][_0xcafd('0x13')]);}else{logger['info'](_0xcafd('0xd'),_0x358ede,'request\x20sent');_0x583a77(_0x57fc2c[_0xcafd('0x14')][_0xcafd('0x13')]);}})[_0xcafd('0x15')](function(_0x3e3399){logger[_0xcafd('0x11')]('Trigger,\x20%s,\x20%s',_0x358ede,_0x3e3399);_0x48aab0(_0x3e3399);});});}exports[_0xcafd('0x16')]=function(_0x554f27){var _0x1b3d90=this;return new Promise(function(_0x49e99c,_0x2154f8){return db[_0xcafd('0x17')][_0xcafd('0x18')]({'raw':_0x554f27[_0xcafd('0x19')]?_0x554f27[_0xcafd('0x19')][_0xcafd('0x1a')]===undefined?!![]:![]:!![],'where':_0x554f27[_0xcafd('0x19')]?_0x554f27[_0xcafd('0x19')][_0xcafd('0x1b')]||null:null,'attributes':_0x554f27['options']?_0x554f27['options'][_0xcafd('0x1c')]||null:null,'limit':_0x554f27['options']?_0x554f27[_0xcafd('0x19')][_0xcafd('0x1d')]||null:null,'include':_0x554f27['options']?_0x554f27[_0xcafd('0x19')][_0xcafd('0x1e')]?_[_0xcafd('0x1f')](_0x554f27['options'][_0xcafd('0x1e')],function(_0x2407d4){return{'model':db[_0x2407d4[_0xcafd('0x20')]],'as':_0x2407d4['as'],'attributes':_0x2407d4[_0xcafd('0x1c')],'include':_0x2407d4[_0xcafd('0x1e')]?_['map'](_0x2407d4[_0xcafd('0x1e')],function(_0x246b41){return{'model':db[_0x246b41[_0xcafd('0x20')]],'as':_0x246b41['as'],'attributes':_0x246b41[_0xcafd('0x1c')],'include':_0x246b41[_0xcafd('0x1e')]?_[_0xcafd('0x1f')](_0x246b41[_0xcafd('0x1e')],function(_0x3d5601){return{'model':db[_0x3d5601[_0xcafd('0x20')]],'as':_0x3d5601['as'],'attributes':_0x3d5601['attributes']};}):[]};}):[]};}):[]:[]})[_0xcafd('0x21')](function(_0x2174da){logger['info'](_0xcafd('0x16'),_0x554f27);logger[_0xcafd('0xe')](_0xcafd('0x16'),_0x554f27,JSON[_0xcafd('0x22')](_0x2174da));_0x49e99c(_0x2174da);})[_0xcafd('0x15')](function(_0x28ea35){logger[_0xcafd('0x11')](_0xcafd('0x16'),_0x28ea35[_0xcafd('0x13')],_0x554f27);_0x2154f8(_0x1b3d90[_0xcafd('0x11')](0x1f4,_0x28ea35[_0xcafd('0x13')]));});});};exports[_0xcafd('0x23')]=function(_0x573cce){var _0xfb73b0=this;return new Promise(function(_0x2ad125,_0x4e738f){return db[_0xcafd('0x17')][_0xcafd('0x24')]({'raw':_0x573cce[_0xcafd('0x19')]?_0x573cce[_0xcafd('0x19')][_0xcafd('0x1a')]===undefined?!![]:![]:!![],'where':_0x573cce['options']?_0x573cce[_0xcafd('0x19')]['where']||null:null,'attributes':_0x573cce[_0xcafd('0x19')]?_0x573cce[_0xcafd('0x19')][_0xcafd('0x1c')]||null:null,'include':_0x573cce[_0xcafd('0x19')]?_0x573cce[_0xcafd('0x19')][_0xcafd('0x1e')]?_[_0xcafd('0x1f')](_0x573cce[_0xcafd('0x19')][_0xcafd('0x1e')],function(_0x7309a4){return{'model':db[_0x7309a4[_0xcafd('0x20')]],'as':_0x7309a4['as'],'attributes':_0x7309a4[_0xcafd('0x1c')],'include':_0x7309a4[_0xcafd('0x1e')]?_[_0xcafd('0x1f')](_0x7309a4['include'],function(_0xc0aaff){return{'model':db[_0xc0aaff[_0xcafd('0x20')]],'as':_0xc0aaff['as'],'attributes':_0xc0aaff[_0xcafd('0x1c')],'include':_0xc0aaff[_0xcafd('0x1e')]?_[_0xcafd('0x1f')](_0xc0aaff[_0xcafd('0x1e')],function(_0x2b8cac){return{'model':db[_0x2b8cac['model']],'as':_0x2b8cac['as'],'attributes':_0x2b8cac[_0xcafd('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xcafd('0x21')](function(_0x10c391){logger[_0xcafd('0xc')](_0xcafd('0x23'),_0x573cce);logger[_0xcafd('0xe')](_0xcafd('0x23'),_0x573cce,JSON['stringify'](_0x10c391));_0x2ad125(_0x10c391);})[_0xcafd('0x15')](function(_0x4a2c36){logger[_0xcafd('0x11')](_0xcafd('0x23'),_0x4a2c36[_0xcafd('0x13')],_0x573cce);_0x4e738f(_0xfb73b0['error'](0x1f4,_0x4a2c36[_0xcafd('0x13')]));});});}; \ No newline at end of file +var _0xe760=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','Trigger','options','raw','where','attributes','limit','map','include','model','GetTrigger','catch','ShowTrigger','find','lodash'];(function(_0x49c9a9,_0x3555df){var _0x4e6644=function(_0x8601d2){while(--_0x8601d2){_0x49c9a9['push'](_0x49c9a9['shift']());}};_0x4e6644(++_0x3555df);}(_0xe760,0x87));var _0x0e76=function(_0x5d15c3,_0x1df77c){_0x5d15c3=_0x5d15c3-0x0;var _0x4265fe=_0xe760[_0x5d15c3];return _0x4265fe;};'use strict';var _=require(_0x0e76('0x0'));var util=require(_0x0e76('0x1'));var moment=require(_0x0e76('0x2'));var BPromise=require('bluebird');var rs=require(_0x0e76('0x3'));var fs=require('fs');var Redis=require(_0x0e76('0x4'));var db=require(_0x0e76('0x5'))['db'];var utils=require(_0x0e76('0x6'));var logger=require(_0x0e76('0x7'))(_0x0e76('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0e76('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x39368a,_0x560e18,_0x4e4085){return new BPromise(function(_0x13e53f,_0x216121){return client[_0x0e76('0xa')](_0x39368a,_0x4e4085)[_0x0e76('0xb')](function(_0x33f814){logger[_0x0e76('0xc')](_0x0e76('0xd'),_0x560e18,_0x0e76('0xe'));logger[_0x0e76('0xf')]('Trigger,\x20%s,\x20%s,\x20%s',_0x560e18,_0x0e76('0xe'),JSON[_0x0e76('0x10')](_0x33f814));if(_0x33f814[_0x0e76('0x11')]){if(_0x33f814[_0x0e76('0x11')][_0x0e76('0x12')]===0x1f4){logger[_0x0e76('0x11')](_0x0e76('0xd'),_0x560e18,_0x33f814[_0x0e76('0x11')][_0x0e76('0x13')]);return _0x216121(_0x33f814[_0x0e76('0x11')]['message']);}logger['error']('Trigger,\x20%s,\x20%s',_0x560e18,_0x33f814[_0x0e76('0x11')][_0x0e76('0x13')]);return _0x13e53f(_0x33f814['error'][_0x0e76('0x13')]);}else{logger[_0x0e76('0xc')](_0x0e76('0xd'),_0x560e18,_0x0e76('0xe'));_0x13e53f(_0x33f814[_0x0e76('0x14')]['message']);}})['catch'](function(_0x111a1f){logger[_0x0e76('0x11')](_0x0e76('0xd'),_0x560e18,_0x111a1f);_0x216121(_0x111a1f);});});}exports['GetTrigger']=function(_0x3fc49d){var _0x370b73=this;return new Promise(function(_0xc7c24f,_0x3ca887){return db[_0x0e76('0x15')]['findAll']({'raw':_0x3fc49d['options']?_0x3fc49d[_0x0e76('0x16')][_0x0e76('0x17')]===undefined?!![]:![]:!![],'where':_0x3fc49d[_0x0e76('0x16')]?_0x3fc49d[_0x0e76('0x16')][_0x0e76('0x18')]||null:null,'attributes':_0x3fc49d[_0x0e76('0x16')]?_0x3fc49d[_0x0e76('0x16')][_0x0e76('0x19')]||null:null,'limit':_0x3fc49d[_0x0e76('0x16')]?_0x3fc49d[_0x0e76('0x16')][_0x0e76('0x1a')]||null:null,'include':_0x3fc49d[_0x0e76('0x16')]?_0x3fc49d[_0x0e76('0x16')]['include']?_[_0x0e76('0x1b')](_0x3fc49d['options']['include'],function(_0x3f7975){return{'model':db[_0x3f7975['model']],'as':_0x3f7975['as'],'attributes':_0x3f7975[_0x0e76('0x19')],'include':_0x3f7975['include']?_[_0x0e76('0x1b')](_0x3f7975[_0x0e76('0x1c')],function(_0x503841){return{'model':db[_0x503841[_0x0e76('0x1d')]],'as':_0x503841['as'],'attributes':_0x503841[_0x0e76('0x19')],'include':_0x503841[_0x0e76('0x1c')]?_['map'](_0x503841[_0x0e76('0x1c')],function(_0x3f3dc0){return{'model':db[_0x3f3dc0[_0x0e76('0x1d')]],'as':_0x3f3dc0['as'],'attributes':_0x3f3dc0[_0x0e76('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0e76('0xb')](function(_0x2c11db){logger[_0x0e76('0xc')](_0x0e76('0x1e'),_0x3fc49d);logger[_0x0e76('0xf')](_0x0e76('0x1e'),_0x3fc49d,JSON[_0x0e76('0x10')](_0x2c11db));_0xc7c24f(_0x2c11db);})[_0x0e76('0x1f')](function(_0x2aefe6){logger['error'](_0x0e76('0x1e'),_0x2aefe6[_0x0e76('0x13')],_0x3fc49d);_0x3ca887(_0x370b73[_0x0e76('0x11')](0x1f4,_0x2aefe6['message']));});});};exports[_0x0e76('0x20')]=function(_0x52d4ba){var _0x3a7b8c=this;return new Promise(function(_0x3bc1ed,_0x540f5c){return db[_0x0e76('0x15')][_0x0e76('0x21')]({'raw':_0x52d4ba[_0x0e76('0x16')]?_0x52d4ba[_0x0e76('0x16')][_0x0e76('0x17')]===undefined?!![]:![]:!![],'where':_0x52d4ba['options']?_0x52d4ba['options'][_0x0e76('0x18')]||null:null,'attributes':_0x52d4ba[_0x0e76('0x16')]?_0x52d4ba['options'][_0x0e76('0x19')]||null:null,'include':_0x52d4ba[_0x0e76('0x16')]?_0x52d4ba[_0x0e76('0x16')]['include']?_[_0x0e76('0x1b')](_0x52d4ba[_0x0e76('0x16')][_0x0e76('0x1c')],function(_0x5e6080){return{'model':db[_0x5e6080[_0x0e76('0x1d')]],'as':_0x5e6080['as'],'attributes':_0x5e6080[_0x0e76('0x19')],'include':_0x5e6080[_0x0e76('0x1c')]?_['map'](_0x5e6080[_0x0e76('0x1c')],function(_0x146ed4){return{'model':db[_0x146ed4['model']],'as':_0x146ed4['as'],'attributes':_0x146ed4[_0x0e76('0x19')],'include':_0x146ed4[_0x0e76('0x1c')]?_[_0x0e76('0x1b')](_0x146ed4[_0x0e76('0x1c')],function(_0x309401){return{'model':db[_0x309401[_0x0e76('0x1d')]],'as':_0x309401['as'],'attributes':_0x309401[_0x0e76('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0e76('0xb')](function(_0x3962ab){logger['info'](_0x0e76('0x20'),_0x52d4ba);logger[_0x0e76('0xf')]('ShowTrigger',_0x52d4ba,JSON[_0x0e76('0x10')](_0x3962ab));_0x3bc1ed(_0x3962ab);})[_0x0e76('0x1f')](function(_0x58a9c1){logger[_0x0e76('0x11')](_0x0e76('0x20'),_0x58a9c1[_0x0e76('0x13')],_0x52d4ba);_0x540f5c(_0x3a7b8c[_0x0e76('0x11')](0x1f4,_0x58a9c1[_0x0e76('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 3fbdc96..78cb4fc 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 _0x12bc=['../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','show','post','/:id/clone','clone','put','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x5354ae,_0x26ed68){var _0x101c4e=function(_0x2d52c1){while(--_0x2d52c1){_0x5354ae['push'](_0x5354ae['shift']());}};_0x101c4e(++_0x26ed68);}(_0x12bc,0x72));var _0xc12b=function(_0x222ed2,_0x7c75e0){_0x222ed2=_0x222ed2-0x0;var _0x5cf141=_0x12bc[_0x222ed2];return _0x5cf141;};'use strict';var multer=require(_0xc12b('0x0'));var util=require('util');var path=require(_0xc12b('0x1'));var timeout=require(_0xc12b('0x2'));var express=require(_0xc12b('0x3'));var router=express[_0xc12b('0x4')]();var fs_extra=require(_0xc12b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc12b('0x6'));var config=require(_0xc12b('0x7'));var controller=require(_0xc12b('0x8'));router[_0xc12b('0x9')]('/',auth[_0xc12b('0xa')](),controller[_0xc12b('0xb')]);router[_0xc12b('0x9')](_0xc12b('0xc'),auth[_0xc12b('0xa')](),controller[_0xc12b('0xd')]);router[_0xc12b('0xe')](_0xc12b('0xf'),auth[_0xc12b('0xa')](),controller[_0xc12b('0x10')]);router['post']('/',auth[_0xc12b('0xa')](),controller['create']);router[_0xc12b('0x11')](_0xc12b('0xc'),auth[_0xc12b('0xa')](),controller['update']);router['delete'](_0xc12b('0xc'),auth[_0xc12b('0xa')](),controller[_0xc12b('0x12')]);module[_0xc12b('0x13')]=router; \ No newline at end of file +var _0xa713=['./trunk.controller','get','isAuthenticated','index','post','clone','create','delete','destroy','path','Router','../../components/interaction/service','../../config/environment'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xa713,0x182));var _0x3a71=function(_0x40795f,_0x28270c){_0x40795f=_0x40795f-0x0;var _0xa80bb2=_0xa713[_0x40795f];return _0xa80bb2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3a71('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3a71('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3a71('0x2'));var config=require(_0x3a71('0x3'));var controller=require(_0x3a71('0x4'));router[_0x3a71('0x5')]('/',auth[_0x3a71('0x6')](),controller[_0x3a71('0x7')]);router[_0x3a71('0x5')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x3a71('0x8')]('/:id/clone',auth[_0x3a71('0x6')](),controller[_0x3a71('0x9')]);router[_0x3a71('0x8')]('/',auth['isAuthenticated'](),controller[_0x3a71('0xa')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x3a71('0xb')]('/:id',auth[_0x3a71('0x6')](),controller[_0x3a71('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 78bf6f9..9b85b10 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 _0x4c5f=['active','passive','actpass','nonat','update,nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','friend','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_FAILED_SCREEN','PROHIB','setDataValue','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','auto','yes','force_rport,comedia','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','port,invite','insecure','never','INTEGER','\x22\x22\x20<>','always','accept','originate','uac','uas','pai','fingerprint'];(function(_0x432780,_0x589c97){var _0x5e4647=function(_0x217815){while(--_0x217815){_0x432780['push'](_0x432780['shift']());}};_0x5e4647(++_0x589c97);}(_0x4c5f,0x68));var _0xf4c5=function(_0x14be1b,_0x42912c){_0x14be1b=_0x14be1b-0x0;var _0x5ded9f=_0x4c5f[_0x14be1b];return _0x5ded9f;};'use strict';var Sequelize=require(_0xf4c5('0x0'));module[_0xf4c5('0x1')]={'name':{'type':Sequelize[_0xf4c5('0x2')],'allowNull':![],'unique':_0xf4c5('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xf4c5('0x4')](_0xf4c5('0x5'),'user',_0xf4c5('0x6')),'allowNull':![],'defaultValue':_0xf4c5('0x5')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf4c5('0x7')},'callingpres':{'type':Sequelize[_0xf4c5('0x4')](_0xf4c5('0x8'),_0xf4c5('0x9'),_0xf4c5('0xa'),_0xf4c5('0xb'),'PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN',_0xf4c5('0xc'),_0xf4c5('0xd'))},'deny':{'type':Sequelize[_0xf4c5('0x2')]},'permit':{'type':Sequelize[_0xf4c5('0x2')]},'secret':{'type':Sequelize[_0xf4c5('0x2')]},'md5secret':{'type':Sequelize[_0xf4c5('0x2')]},'remotesecret':{'type':Sequelize[_0xf4c5('0x2')]},'transport':{'type':Sequelize[_0xf4c5('0x2')],'defaultValue':'udp','set':function(_0x397195){this[_0xf4c5('0xe')](_0xf4c5('0xf'),_0x397195?_0x397195[_0xf4c5('0x10')](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0xf4c5('0x11')](_0xf4c5('0xf'))['split'](','):null;},'comment':_0xf4c5('0x12')},'dtmfmode':{'type':Sequelize[_0xf4c5('0x4')](_0xf4c5('0x13'),'info',_0xf4c5('0x14'),_0xf4c5('0x15'),_0xf4c5('0x16')),'defaultValue':_0xf4c5('0x13')},'directmedia':{'type':Sequelize[_0xf4c5('0x4')](_0xf4c5('0x17'),'no','nonat','update','outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xf4c5('0x4')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xf4c5('0x2')]},'directmediadeny':{'type':Sequelize[_0xf4c5('0x2')]},'nat':{'type':Sequelize[_0xf4c5('0x2')],'defaultValue':_0xf4c5('0x18'),'set':function(_0x2bc965){this[_0xf4c5('0xe')]('nat',_0x2bc965?_0x2bc965[_0xf4c5('0x10')](','):null);},'get':function(){return this[_0xf4c5('0x11')](_0xf4c5('0x19'))?this[_0xf4c5('0x11')]('nat')[_0xf4c5('0x1a')](','):null;},'comment':_0xf4c5('0x1b')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xf4c5('0x2')]},'pickupgroup':{'type':Sequelize[_0xf4c5('0x2')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xf4c5('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xf4c5('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xf4c5('0x2')],'defaultValue':_0xf4c5('0x1c')},'allow':{'type':Sequelize[_0xf4c5('0x2')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x2ef482){this[_0xf4c5('0xe')](_0xf4c5('0x1d'),_0x2ef482?_0x2ef482[_0xf4c5('0x10')](';'):_0xf4c5('0x1e'));},'get':function(){return this[_0xf4c5('0x11')](_0xf4c5('0x1d'))?this[_0xf4c5('0x11')]('allow')['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0xf4c5('0x4')](_0xf4c5('0x17'),'no')},'insecure':{'type':Sequelize[_0xf4c5('0x2')],'defaultValue':_0xf4c5('0x1f'),'set':function(_0x402e55){this['setDataValue'](_0xf4c5('0x20'),_0x402e55?_0x402e55[_0xf4c5('0x10')](','):null);},'get':function(){return this[_0xf4c5('0x11')](_0xf4c5('0x20'))?this['getDataValue'](_0xf4c5('0x20'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xf4c5('0x4')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xf4c5('0x4')](_0xf4c5('0x17'),'no',_0xf4c5('0x21'))},'promiscredir':{'type':Sequelize['ENUM'](_0xf4c5('0x17'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0xf4c5('0x17'),'no')},'accountcode':{'type':Sequelize[_0xf4c5('0x22')](0xb)},'setvar':{'type':Sequelize[_0xf4c5('0x2')]},'callerid':{'type':Sequelize[_0xf4c5('0x2')],'defaultValue':_0xf4c5('0x23')},'amaflags':{'type':Sequelize[_0xf4c5('0x2')]},'callcounter':{'type':Sequelize[_0xf4c5('0x4')](_0xf4c5('0x17'),'no'),'defaultValue':_0xf4c5('0x17')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0xf4c5('0x4')](_0xf4c5('0x17'),'no')},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no')},'allowtransfer':{'type':Sequelize[_0xf4c5('0x4')](_0xf4c5('0x17'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xf4c5('0x17'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0xf4c5('0x2')]},'videosupport':{'type':Sequelize[_0xf4c5('0x4')](_0xf4c5('0x17'),'no',_0xf4c5('0x24')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xf4c5('0x22')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xf4c5('0x4')](_0xf4c5('0x17'),'no')},'mailbox':{'type':Sequelize[_0xf4c5('0x2')]},'session_timers':{'type':Sequelize[_0xf4c5('0x4')](_0xf4c5('0x25'),'refuse',_0xf4c5('0x26'))},'session_expires':{'type':Sequelize[_0xf4c5('0x22')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0xf4c5('0x4')](_0xf4c5('0x27'),'uas'),'defaultValue':_0xf4c5('0x28')},'t38pt_usertpsource':{'type':Sequelize[_0xf4c5('0x2')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xf4c5('0x22')](0x5)},'qualify':{'type':Sequelize[_0xf4c5('0x4')]('yes','no'),'defaultValue':_0xf4c5('0x17')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0xf4c5('0x2')]},'rtptimeout':{'type':Sequelize[_0xf4c5('0x22')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xf4c5('0x22')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xf4c5('0x22')](0xb)},'sendrpid':{'type':Sequelize[_0xf4c5('0x4')](_0xf4c5('0x17'),'no',_0xf4c5('0x29')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0xf4c5('0x2')]},'timert1':{'type':Sequelize[_0xf4c5('0x22')](0xb)},'timerb':{'type':Sequelize[_0xf4c5('0x22')](0xb)},'qualifyfreq':{'type':Sequelize[_0xf4c5('0x22')](0xb)},'contactpermit':{'type':Sequelize[_0xf4c5('0x2')]},'contactdeny':{'type':Sequelize[_0xf4c5('0x2')]},'contactacl':{'type':Sequelize[_0xf4c5('0x2')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0xf4c5('0x2')]},'maxforwards':{'type':Sequelize[_0xf4c5('0x22')](0xb)},'encryption':{'type':Sequelize[_0xf4c5('0x4')](_0xf4c5('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xf4c5('0x4')](_0xf4c5('0x17'),'no')},'force_avp':{'type':Sequelize[_0xf4c5('0x4')](_0xf4c5('0x17'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0xf4c5('0x17'),'no')},'dtlsenable':{'type':Sequelize[_0xf4c5('0x4')]('yes','no')},'dtlsverify':{'type':Sequelize[_0xf4c5('0x4')](_0xf4c5('0x17'),'no',_0xf4c5('0x2a'),'certificate')},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0xf4c5('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0xf4c5('0x2')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0xf4c5('0x2')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize['ENUM'](_0xf4c5('0x2b'),_0xf4c5('0x2c'),_0xf4c5('0x2d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0xf4c5('0x4')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xf4c5('0x2')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0xf4c5('0x22')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0xf4c5('0x17'),'no')},'subscribemwi':{'type':Sequelize[_0xf4c5('0x4')]('yes','no')},'vmexten':{'type':Sequelize[_0xf4c5('0x2')]},'mohinterpret':{'type':Sequelize[_0xf4c5('0x2')]},'mohsuggest':{'type':Sequelize[_0xf4c5('0x2')]},'parkinglot':{'type':Sequelize[_0xf4c5('0x2')]},'description':{'type':Sequelize[_0xf4c5('0x2')]},'host':{'type':Sequelize[_0xf4c5('0x2')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0xf4c5('0x4')](_0xf4c5('0x17'),'no',_0xf4c5('0x2e'),'update',_0xf4c5('0x2f')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0xf4c5('0x2')]},'active':{'type':Sequelize[_0xf4c5('0x30')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xf4c5('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0xc5ba=['split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','join','nat','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uas','pai','fingerprint','active','actpass','dynamic','BOOLEAN','sequelize','exports','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB','udp','setDataValue','transport','getDataValue'];(function(_0x147497,_0x43e433){var _0x35f45=function(_0x584421){while(--_0x584421){_0x147497['push'](_0x147497['shift']());}};_0x35f45(++_0x43e433);}(_0xc5ba,0xb9));var _0xac5b=function(_0x5f1b74,_0x498562){_0x5f1b74=_0x5f1b74-0x0;var _0x1fb5a0=_0xc5ba[_0x5f1b74];return _0x1fb5a0;};'use strict';var Sequelize=require(_0xac5b('0x0'));module[_0xac5b('0x1')]={'name':{'type':Sequelize[_0xac5b('0x2')],'allowNull':![],'unique':_0xac5b('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xac5b('0x4')](_0xac5b('0x5'),_0xac5b('0x6'),_0xac5b('0x7')),'allowNull':![],'defaultValue':_0xac5b('0x5')},'context':{'type':Sequelize[_0xac5b('0x2')],'allowNull':![],'defaultValue':_0xac5b('0x8')},'callingpres':{'type':Sequelize[_0xac5b('0x4')](_0xac5b('0x9'),_0xac5b('0xa'),_0xac5b('0xb'),_0xac5b('0xc'),_0xac5b('0xd'),'PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN',_0xac5b('0xe'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0xac5b('0x2')]},'secret':{'type':Sequelize[_0xac5b('0x2')]},'md5secret':{'type':Sequelize[_0xac5b('0x2')]},'remotesecret':{'type':Sequelize[_0xac5b('0x2')]},'transport':{'type':Sequelize[_0xac5b('0x2')],'defaultValue':_0xac5b('0xf'),'set':function(_0xcebab1){this[_0xac5b('0x10')](_0xac5b('0x11'),_0xcebab1?_0xcebab1['join'](','):null);},'get':function(){return this[_0xac5b('0x12')](_0xac5b('0x11'))?this[_0xac5b('0x12')](_0xac5b('0x11'))[_0xac5b('0x13')](','):null;},'comment':_0xac5b('0x14')},'dtmfmode':{'type':Sequelize[_0xac5b('0x4')](_0xac5b('0x15'),_0xac5b('0x16'),_0xac5b('0x17'),_0xac5b('0x18'),_0xac5b('0x19')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xac5b('0x4')](_0xac5b('0x1a'),'no',_0xac5b('0x1b'),_0xac5b('0x1c'),_0xac5b('0x1d')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xac5b('0x4')](_0xac5b('0x1a'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xac5b('0x2')]},'directmediadeny':{'type':Sequelize[_0xac5b('0x2')]},'nat':{'type':Sequelize[_0xac5b('0x2')],'defaultValue':_0xac5b('0x1e'),'set':function(_0x551ccf){this[_0xac5b('0x10')]('nat',_0x551ccf?_0x551ccf[_0xac5b('0x1f')](','):null);},'get':function(){return this['getDataValue'](_0xac5b('0x20'))?this[_0xac5b('0x12')]('nat')['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xac5b('0x2')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xac5b('0x2')]},'namedpickupgroup':{'type':Sequelize[_0xac5b('0x2')]},'language':{'type':Sequelize[_0xac5b('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xac5b('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xac5b('0x2')],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0xf01a69){this['setDataValue'](_0xac5b('0x21'),_0xf01a69?_0xf01a69[_0xac5b('0x1f')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xac5b('0x12')](_0xac5b('0x21'))?this[_0xac5b('0x12')](_0xac5b('0x21'))[_0xac5b('0x13')](';'):null;},'comment':_0xac5b('0x22')},'autoframing':{'type':Sequelize[_0xac5b('0x4')](_0xac5b('0x1a'),'no')},'insecure':{'type':Sequelize[_0xac5b('0x2')],'defaultValue':_0xac5b('0x23'),'set':function(_0x578d11){this[_0xac5b('0x10')](_0xac5b('0x24'),_0x578d11?_0x578d11[_0xac5b('0x1f')](','):null);},'get':function(){return this[_0xac5b('0x12')](_0xac5b('0x24'))?this[_0xac5b('0x12')](_0xac5b('0x24'))[_0xac5b('0x13')](','):null;},'comment':_0xac5b('0x25')},'trustrpid':{'type':Sequelize[_0xac5b('0x4')](_0xac5b('0x1a'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xac5b('0x1a'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xac5b('0x4')](_0xac5b('0x1a'),'no','never')},'promiscredir':{'type':Sequelize[_0xac5b('0x4')]('yes','no')},'useclientcode':{'type':Sequelize[_0xac5b('0x4')](_0xac5b('0x1a'),'no')},'accountcode':{'type':Sequelize[_0xac5b('0x26')](0xb)},'setvar':{'type':Sequelize[_0xac5b('0x2')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0xac5b('0x27')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize['ENUM'](_0xac5b('0x1a'),'no'),'defaultValue':_0xac5b('0x1a')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0xac5b('0x1a'),'no')},'allowsubscribe':{'type':Sequelize[_0xac5b('0x4')]('yes','no')},'allowtransfer':{'type':Sequelize[_0xac5b('0x4')](_0xac5b('0x1a'),'no')},'ignoresdpversion':{'type':Sequelize[_0xac5b('0x4')]('yes','no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0xac5b('0x2')]},'videosupport':{'type':Sequelize[_0xac5b('0x4')]('yes','no',_0xac5b('0x28')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xac5b('0x26')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xac5b('0x4')](_0xac5b('0x1a'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0xac5b('0x4')](_0xac5b('0x29'),_0xac5b('0x2a'),_0xac5b('0x2b'))},'session_expires':{'type':Sequelize[_0xac5b('0x26')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0xac5b('0x4')]('uac',_0xac5b('0x2c')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0xac5b('0x2')]},'regexten':{'type':Sequelize[_0xac5b('0x2')]},'fromdomain':{'type':Sequelize[_0xac5b('0x2')]},'fromuser':{'type':Sequelize[_0xac5b('0x2')]},'port':{'type':Sequelize[_0xac5b('0x26')](0x5)},'qualify':{'type':Sequelize[_0xac5b('0x4')]('yes','no'),'defaultValue':_0xac5b('0x1a')},'keepalive':{'type':Sequelize[_0xac5b('0x26')](0xb)},'defaultip':{'type':Sequelize[_0xac5b('0x2')]},'defaultuser':{'type':Sequelize[_0xac5b('0x2')]},'rtptimeout':{'type':Sequelize[_0xac5b('0x26')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xac5b('0x26')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xac5b('0x26')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0xac5b('0x1a'),'no',_0xac5b('0x2d')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xac5b('0x2')]},'callbackextension':{'type':Sequelize[_0xac5b('0x2')]},'timert1':{'type':Sequelize[_0xac5b('0x26')](0xb)},'timerb':{'type':Sequelize[_0xac5b('0x26')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0xac5b('0x2')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0xac5b('0x2')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0xac5b('0x2')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no')},'force_avp':{'type':Sequelize['ENUM'](_0xac5b('0x1a'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0xac5b('0x1a'),'no')},'dtlsenable':{'type':Sequelize[_0xac5b('0x4')](_0xac5b('0x1a'),'no')},'dtlsverify':{'type':Sequelize['ENUM']('yes','no',_0xac5b('0x2e'),'certificate')},'dtlsrekey':{'type':Sequelize[_0xac5b('0x26')](0xb)},'dtlscertfile':{'type':Sequelize[_0xac5b('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0xac5b('0x2')]},'dtlscipher':{'type':Sequelize[_0xac5b('0x2')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0xac5b('0x2')]},'dtlssetup':{'type':Sequelize[_0xac5b('0x4')](_0xac5b('0x2f'),'passive',_0xac5b('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0xac5b('0x4')](_0xac5b('0x1a'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xac5b('0x2')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0xac5b('0x26')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xac5b('0x4')](_0xac5b('0x1a'),'no')},'subscribemwi':{'type':Sequelize[_0xac5b('0x4')](_0xac5b('0x1a'),'no')},'vmexten':{'type':Sequelize[_0xac5b('0x2')]},'mohinterpret':{'type':Sequelize[_0xac5b('0x2')]},'mohsuggest':{'type':Sequelize[_0xac5b('0x2')]},'parkinglot':{'type':Sequelize[_0xac5b('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING'],'defaultValue':_0xac5b('0x31')},'canreinvite':{'type':Sequelize['ENUM']('yes','no','nonat','update','update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0xac5b('0x2')]},'otherFields':{'type':Sequelize[_0xac5b('0x2')]},'active':{'type':Sequelize[_0xac5b('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xac5b('0x2')],'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 7214777..e28fd8a 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 _0x55ca=['catch','status','json','offset','undefined','count','limit','Content-Range','apply','save','update','destroy','get','UserProfileResource','end','stack','name','send','Trunk','rawAttributes','type','model','map','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','keys','length','options','find','clone','omit','updatedAt','body','createdAt','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Trunks','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8','root','server/files/templates/registry.ejs','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','render','Reload','chan_sip.so','readFileSync','/etc/asterisk/sip_xcally_registers.conf','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x12563a,_0x950141){var _0x4ad924=function(_0x56e2c2){while(--_0x56e2c2){_0x12563a['push'](_0x12563a['shift']());}};_0x4ad924(++_0x950141);}(_0x55ca,0x126));var _0xa55c=function(_0xd75b98,_0x15ad99){_0xd75b98=_0xd75b98-0x0;var _0xdd720e=_0x55ca[_0xd75b98];return _0xdd720e;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xa55c('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x576044,_0x5a3672,_0x59ea8d,_0x18ee85){return new BPromise(function(_0x3930e4,_0x462cd6){var _0x938bd6=_0x18ee85||client;return _0x938bd6[_0xa55c('0x19')](_0x576044,_0x59ea8d)[_0xa55c('0x1a')](function(_0x4e0b2f){logger[_0xa55c('0x1b')](_0xa55c('0x1c'),_0x5a3672,_0xa55c('0x1d'));logger[_0xa55c('0x1e')](_0xa55c('0x1f'),_0x5a3672,_0xa55c('0x1d'),JSON[_0xa55c('0x20')](_0x4e0b2f));if(_0x4e0b2f[_0xa55c('0x21')]){if(_0x4e0b2f[_0xa55c('0x21')]['code']===0x1f4){logger[_0xa55c('0x21')](_0xa55c('0x1c'),_0x5a3672,_0x4e0b2f[_0xa55c('0x21')][_0xa55c('0x22')]);return _0x462cd6(_0x4e0b2f[_0xa55c('0x21')][_0xa55c('0x22')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x5a3672,_0x4e0b2f[_0xa55c('0x21')][_0xa55c('0x22')]);return _0x3930e4(_0x4e0b2f[_0xa55c('0x21')]['message']);}else{logger[_0xa55c('0x1b')](_0xa55c('0x1c'),_0x5a3672,'request\x20sent');_0x3930e4(_0x4e0b2f[_0xa55c('0x23')][_0xa55c('0x22')]);}})[_0xa55c('0x24')](function(_0x1965f1){logger[_0xa55c('0x21')]('Trunk,\x20%s,\x20%s',_0x5a3672,_0x1965f1);_0x462cd6(_0x1965f1);});});}function respondWithStatusCode(_0x1fc828,_0x504c24){_0x504c24=_0x504c24||0xcc;return function(_0x5ba836){if(_0x5ba836){return _0x1fc828['sendStatus'](_0x504c24);}return _0x1fc828[_0xa55c('0x25')](_0x504c24)['end']();};}function respondWithResult(_0x3ecbe7,_0x190757){_0x190757=_0x190757||0xc8;return function(_0x3f64de){if(_0x3f64de){return _0x3ecbe7[_0xa55c('0x25')](_0x190757)[_0xa55c('0x26')](_0x3f64de);}};}function respondWithFilteredResult(_0x170ba4,_0x1da633){return function(_0x11e7f7){if(_0x11e7f7){var _0x192df2=typeof _0x1da633[_0xa55c('0x27')]===_0xa55c('0x28')&&typeof _0x1da633['limit']===_0xa55c('0x28');var _0x28814f=_0x11e7f7[_0xa55c('0x29')];var _0x906caa=_0x192df2?0x0:_0x1da633['offset'];var _0x1377b0=_0x192df2?_0x11e7f7[_0xa55c('0x29')]:_0x1da633[_0xa55c('0x27')]+_0x1da633[_0xa55c('0x2a')];var _0x45ee8d;if(_0x1377b0>=_0x28814f){_0x1377b0=_0x28814f;_0x45ee8d=0xc8;}else{_0x45ee8d=0xce;}_0x170ba4[_0xa55c('0x25')](_0x45ee8d);return _0x170ba4['set'](_0xa55c('0x2b'),_0x906caa+'-'+_0x1377b0+'/'+_0x28814f)['json'](_0x11e7f7);}return null;};}function patchUpdates(_0x35c9c2){return function(_0x1d730b){try{jsonpatch[_0xa55c('0x2c')](_0x1d730b,_0x35c9c2,!![]);}catch(_0x223813){return BPromise['reject'](_0x223813);}return _0x1d730b[_0xa55c('0x2d')]();};}function saveUpdates(_0x2096ae,_0x331e58){return function(_0x20da31){if(_0x20da31){return _0x20da31[_0xa55c('0x2e')](_0x2096ae)[_0xa55c('0x1a')](function(_0x29748a){return _0x29748a;});}return null;};}function removeEntity(_0x24d44d,_0x2808e9){return function(_0xcbaf2e){if(_0xcbaf2e){return _0xcbaf2e[_0xa55c('0x2f')]()['then'](function(){var _0x54ca97=_0xcbaf2e[_0xa55c('0x30')]({'plain':!![]});var _0x19733e='Trunks';return db[_0xa55c('0x31')][_0xa55c('0x2f')]({'where':{'type':_0x19733e,'resourceId':_0x54ca97['id']}})[_0xa55c('0x1a')](function(){return _0xcbaf2e;});})[_0xa55c('0x1a')](function(){_0x24d44d[_0xa55c('0x25')](0xcc)[_0xa55c('0x32')]();});}};}function handleEntityNotFound(_0x3ce1b3,_0x222d4b){return function(_0x3959e3){if(!_0x3959e3){_0x3ce1b3['sendStatus'](0x194);}return _0x3959e3;};}function handleError(_0x5f3e99,_0x4b23d3){_0x4b23d3=_0x4b23d3||0x1f4;return function(_0x3fd75f){logger[_0xa55c('0x21')](_0x3fd75f[_0xa55c('0x33')]);if(_0x3fd75f['name']){delete _0x3fd75f[_0xa55c('0x34')];}_0x5f3e99['status'](_0x4b23d3)[_0xa55c('0x35')](_0x3fd75f);};}exports['index']=function(_0x18c6f1,_0x39267c){var _0x3c0ec1={},_0x4d3eb5={},_0x7c4a47={'count':0x0,'rows':[]};var _0x30f23b=_['map'](db[_0xa55c('0x36')][_0xa55c('0x37')],function(_0x4d9083){return{'name':_0x4d9083['fieldName'],'type':_0x4d9083[_0xa55c('0x38')]['key']};});_0x4d3eb5[_0xa55c('0x39')]=_[_0xa55c('0x3a')](_0x30f23b,'name');_0x4d3eb5['query']=_['keys'](_0x18c6f1['query']);_0x4d3eb5[_0xa55c('0x3b')]=_[_0xa55c('0x3c')](_0x4d3eb5[_0xa55c('0x39')],_0x4d3eb5[_0xa55c('0x3d')]);_0x3c0ec1[_0xa55c('0x3e')]=_['intersection'](_0x4d3eb5[_0xa55c('0x39')],qs[_0xa55c('0x3f')](_0x18c6f1[_0xa55c('0x3d')][_0xa55c('0x3f')]));_0x3c0ec1[_0xa55c('0x3e')]=_0x3c0ec1[_0xa55c('0x3e')]['length']?_0x3c0ec1[_0xa55c('0x3e')]:_0x4d3eb5['model'];if(!_0x18c6f1['query'][_0xa55c('0x40')](_0xa55c('0x41'))){_0x3c0ec1['limit']=qs[_0xa55c('0x2a')](_0x18c6f1['query']['limit']);_0x3c0ec1[_0xa55c('0x27')]=qs[_0xa55c('0x27')](_0x18c6f1[_0xa55c('0x3d')]['offset']);}_0x3c0ec1[_0xa55c('0x42')]=qs[_0xa55c('0x43')](_0x18c6f1['query'][_0xa55c('0x43')]);_0x3c0ec1['where']=qs[_0xa55c('0x3b')](_[_0xa55c('0x44')](_0x18c6f1['query'],_0x4d3eb5[_0xa55c('0x3b')]),_0x30f23b);if(_0x18c6f1[_0xa55c('0x3d')]['filter']){_0x3c0ec1[_0xa55c('0x45')]=_[_0xa55c('0x46')](_0x3c0ec1[_0xa55c('0x45')],{'$or':_['map'](_0x30f23b,function(_0x334f52){if(_0x334f52['type']!==_0xa55c('0x47')){var _0x3a8af4={};_0x3a8af4[_0x334f52[_0xa55c('0x34')]]={'$like':'%'+_0x18c6f1['query'][_0xa55c('0x48')]+'%'};return _0x3a8af4;}})});}_0x3c0ec1=_[_0xa55c('0x46')]({},_0x3c0ec1,_0x18c6f1['options']);var _0x3d19f5={'where':_0x3c0ec1[_0xa55c('0x45')]};return db['Trunk'][_0xa55c('0x29')](_0x3d19f5)[_0xa55c('0x1a')](function(_0x52f9a7){_0x7c4a47[_0xa55c('0x29')]=_0x52f9a7;if(_0x18c6f1[_0xa55c('0x3d')][_0xa55c('0x49')]){_0x3c0ec1[_0xa55c('0x4a')]=[{'all':!![]}];}return db['Trunk'][_0xa55c('0x4b')](_0x3c0ec1);})['then'](function(_0x2157d6){_0x7c4a47[_0xa55c('0x4c')]=_0x2157d6;return _0x7c4a47;})[_0xa55c('0x1a')](respondWithFilteredResult(_0x39267c,_0x3c0ec1))['catch'](handleError(_0x39267c,null));};exports[_0xa55c('0x4d')]=function(_0x250b00,_0x574fe9){var _0x5be06={'raw':![],'where':{'id':_0x250b00[_0xa55c('0x4e')]['id']}},_0x34de95={};_0x34de95[_0xa55c('0x39')]=_[_0xa55c('0x4f')](db[_0xa55c('0x36')][_0xa55c('0x37')]);_0x34de95[_0xa55c('0x3d')]=_[_0xa55c('0x4f')](_0x250b00[_0xa55c('0x3d')]);_0x34de95['filters']=_[_0xa55c('0x3c')](_0x34de95[_0xa55c('0x39')],_0x34de95[_0xa55c('0x3d')]);_0x5be06['attributes']=_[_0xa55c('0x3c')](_0x34de95[_0xa55c('0x39')],qs['fields'](_0x250b00[_0xa55c('0x3d')]['fields']));_0x5be06[_0xa55c('0x3e')]=_0x5be06[_0xa55c('0x3e')][_0xa55c('0x50')]?_0x5be06[_0xa55c('0x3e')]:_0x34de95[_0xa55c('0x39')];if(_0x250b00['query'][_0xa55c('0x49')]){_0x5be06[_0xa55c('0x4a')]=[{'all':!![]}];}_0x5be06=_['merge']({},_0x5be06,_0x250b00[_0xa55c('0x51')]);return db[_0xa55c('0x36')][_0xa55c('0x52')](_0x5be06)[_0xa55c('0x1a')](handleEntityNotFound(_0x574fe9,null))['then'](respondWithResult(_0x574fe9,null))['catch'](handleError(_0x574fe9,null));};exports[_0xa55c('0x53')]=function(_0x250dea,_0x3ca5b8){var _0x44ac57={'where':{'id':_0x250dea[_0xa55c('0x4e')]['id']}},_0x54cbde={};_0x54cbde['model']=_[_0xa55c('0x4f')](db[_0xa55c('0x36')][_0xa55c('0x37')]);_0x44ac57[_0xa55c('0x3e')]=_[_0xa55c('0x3c')](_0x54cbde['model'],qs[_0xa55c('0x3f')](_0x250dea['query'][_0xa55c('0x3f')]));_0x44ac57[_0xa55c('0x3e')]=_0x44ac57[_0xa55c('0x3e')][_0xa55c('0x50')]?_0x44ac57[_0xa55c('0x3e')]:_0x54cbde[_0xa55c('0x39')];if(_0x250dea[_0xa55c('0x3d')]['includeAll']){_0x44ac57[_0xa55c('0x4a')]=[{'all':!![]}];}_0x44ac57=_[_0xa55c('0x46')]({},_0x44ac57,_0x250dea[_0xa55c('0x51')]);return db[_0xa55c('0x36')][_0xa55c('0x52')](_0x44ac57)['then'](handleEntityNotFound(_0x3ca5b8,null))[_0xa55c('0x1a')](function(_0x3cd40d){if(_0x3cd40d){var _0x28bac4=_0x3cd40d[_0xa55c('0x30')]({'plain':!![]});_0x28bac4=qs[_0xa55c('0x54')](_0x28bac4,['id','createdAt',_0xa55c('0x55')]);_0x250dea[_0xa55c('0x56')]=_[_0xa55c('0x54')](_0x250dea[_0xa55c('0x56')],['id',_0xa55c('0x57'),'updatedAt']);return db[_0xa55c('0x36')]['create'](_[_0xa55c('0x46')](_0x28bac4,_0x250dea['body']),{'include':_0x250dea[_0xa55c('0x3d')]['includeAll']?[{'all':!![]}]:undefined})[_0xa55c('0x1a')](function(_0x1333da){var _0x21d6b4=_0x250dea[_0xa55c('0x58')][_0xa55c('0x30')]({'plain':!![]});if(!_0x21d6b4)throw new Error(_0xa55c('0x59'));if(_0x21d6b4[_0xa55c('0x5a')]===_0xa55c('0x58')){var _0x14b515=_0x1333da[_0xa55c('0x30')]({'plain':!![]});var _0x51c736=_0xa55c('0x5b');return db[_0xa55c('0x5c')]['find']({'where':{'name':_0x51c736,'userProfileId':_0x21d6b4[_0xa55c('0x5d')]},'raw':!![]})[_0xa55c('0x1a')](function(_0x3e3b4b){if(_0x3e3b4b&&_0x3e3b4b[_0xa55c('0x5e')]===0x0){return db[_0xa55c('0x31')][_0xa55c('0x5f')]({'name':_0x14b515[_0xa55c('0x34')],'resourceId':_0x14b515['id'],'type':_0x3e3b4b[_0xa55c('0x34')],'sectionId':_0x3e3b4b['id']},{})['then'](function(){return _0x1333da;});}else{return _0x1333da;}})[_0xa55c('0x24')](function(_0x475131){logger[_0xa55c('0x21')](_0xa55c('0x60'),_0x475131);throw _0x475131;});}return _0x1333da;});}})[_0xa55c('0x1a')](respondWithResult(_0x3ca5b8,0xc9))[_0xa55c('0x24')](handleError(_0x3ca5b8,null));};exports[_0xa55c('0x5f')]=function(_0x4249c1,_0x25d5a1,_0x4a08ca){var _0x347562;return db[_0xa55c('0x36')][_0xa55c('0x5f')](_0x4249c1[_0xa55c('0x56')],{'raw':!![]})[_0xa55c('0x1a')](function(_0x10e711){_0x347562=_0x10e711;return db[_0xa55c('0x36')][_0xa55c('0x4b')]({'raw':!![]});})[_0xa55c('0x1a')](function(_0x3178a6){var _0x3bbc4b=fs['readFileSync'](path[_0xa55c('0x61')](config['root'],_0xa55c('0x62')),_0xa55c('0x63'));var _0x129bb4=fs['readFileSync'](path['join'](config[_0xa55c('0x64')],_0xa55c('0x65')),_0xa55c('0x63'));var _0x42529f=ejs['render'](_0x3bbc4b,{'trunks':_0x3178a6||[]});fs[_0xa55c('0x66')](_0xa55c('0x67'),_0x42529f);if(_0x347562[_0xa55c('0x68')]){var _0x3a9910=ejs[_0xa55c('0x69')](_0x129bb4,{'trunks':_0x3178a6||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x3a9910);}})[_0xa55c('0x1a')](function(){return respondWithRpcPromise(_0xa55c('0x6a'),_0xa55c('0x5f'),{'module':_0xa55c('0x6b')});})[_0xa55c('0x1a')](function(){var _0x4b2032=_0x4249c1[_0xa55c('0x58')][_0xa55c('0x30')]({'plain':!![]});if(!_0x4b2032)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4b2032[_0xa55c('0x5a')]===_0xa55c('0x58')){var _0xa340fb=_0x347562['get']({'plain':!![]});return db[_0xa55c('0x5c')][_0xa55c('0x52')]({'where':{'name':_0xa55c('0x5b'),'userProfileId':_0x4b2032[_0xa55c('0x5d')]},'raw':!![]})[_0xa55c('0x1a')](function(_0x506f74){if(_0x506f74&&_0x506f74[_0xa55c('0x5e')]===0x0){return db[_0xa55c('0x31')]['create']({'name':_0xa340fb['name'],'resourceId':_0xa340fb['id'],'type':_0x506f74[_0xa55c('0x34')],'sectionId':_0x506f74['id']},{})['then'](function(){return _0x347562;});}else{return _0x347562;}})[_0xa55c('0x24')](function(_0x5ca0bc){logger[_0xa55c('0x21')](_0xa55c('0x60'),_0x5ca0bc);throw _0x5ca0bc;});}return _0x347562;})[_0xa55c('0x1a')](respondWithResult(_0x25d5a1,0xc9))[_0xa55c('0x24')](handleError(_0x25d5a1,null));};exports[_0xa55c('0x2e')]=function(_0xff7b1c,_0x16dfc6,_0x5d8551){var _0x463195;return db[_0xa55c('0x36')][_0xa55c('0x52')]({'where':{'id':_0xff7b1c[_0xa55c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x16dfc6,null))[_0xa55c('0x1a')](saveUpdates(_0xff7b1c[_0xa55c('0x56')],null))[_0xa55c('0x1a')](function(_0x2298ac){if(_0x2298ac){_0x463195=_0x2298ac;return db['Trunk']['findAll']({'raw':!![]});}})[_0xa55c('0x1a')](function(_0x428872){if(_0x428872){var _0x12e3a8=fs[_0xa55c('0x6c')](path['join'](config['root'],_0xa55c('0x62')),_0xa55c('0x63'));var _0xd33c9c=fs[_0xa55c('0x6c')](path[_0xa55c('0x61')](config[_0xa55c('0x64')],_0xa55c('0x65')),'utf8');var _0x19497b=ejs['render'](_0x12e3a8,{'trunks':_0x428872||[]});fs[_0xa55c('0x66')]('/etc/asterisk/sip_xcally_trunks.conf',_0x19497b);var _0x36ded7=ejs[_0xa55c('0x69')](_0xd33c9c,{'trunks':_0x428872||[]});fs[_0xa55c('0x66')](_0xa55c('0x6d'),_0x36ded7);return respondWithRpcPromise(_0xa55c('0x6a'),_0xa55c('0x2e'),{'module':_0xa55c('0x6b')});}return null;})[_0xa55c('0x1a')](function(_0x576a1b){if(_0x576a1b){return _0x463195;}})['then'](respondWithResult(_0x16dfc6,null))[_0xa55c('0x24')](handleError(_0x16dfc6,null));};exports[_0xa55c('0x2f')]=function(_0xc2ad5c,_0x256db0,_0x1622cb){var _0x137728;return db['Trunk'][_0xa55c('0x52')]({'where':{'id':_0xc2ad5c[_0xa55c('0x4e')]['id']}})[_0xa55c('0x1a')](handleEntityNotFound(_0x256db0,null))[_0xa55c('0x1a')](removeEntity(_0x256db0,null))[_0xa55c('0x1a')](function(){return db[_0xa55c('0x36')][_0xa55c('0x4b')]({'raw':!![]});})[_0xa55c('0x1a')](function(_0x58b670){var _0x25d09d=fs[_0xa55c('0x6c')](path[_0xa55c('0x61')](config[_0xa55c('0x64')],_0xa55c('0x62')),'utf8');var _0x2685d8=fs[_0xa55c('0x6c')](path['join'](config['root'],_0xa55c('0x65')),_0xa55c('0x63'));var _0x5c2229=ejs['render'](_0x25d09d,{'trunks':_0x58b670});var _0x579726=ejs['render'](_0x2685d8,{'trunks':_0x58b670});fs[_0xa55c('0x66')](_0xa55c('0x67'),_0x5c2229);fs[_0xa55c('0x66')](_0xa55c('0x6d'),_0x579726);return respondWithRpcPromise(_0xa55c('0x6a'),_0xa55c('0x2f'),{'module':'chan_sip.so'});})[_0xa55c('0x24')](handleError(_0x256db0,null));}; \ No newline at end of file +var _0xf3cd=['length','limit','sort','where','filter','merge','options','Trunk','includeAll','include','findAll','show','find','clone','createdAt','updatedAt','omit','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Trunks','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','server/files/templates/registry.ejs','utf8','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','render','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','userProfileId','autoAssociation','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../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','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','undefined','offset','count','json','reject','save','update','get','UserProfileResource','destroy','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields'];(function(_0x3db458,_0x57fb5b){var _0x202ec1=function(_0x149ecb){while(--_0x149ecb){_0x3db458['push'](_0x3db458['shift']());}};_0x202ec1(++_0x57fb5b);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x4ab99,_0x219ed2){_0x4ab99=_0x4ab99-0x0;var _0x29e39c=_0xf3cd[_0x4ab99];return _0x29e39c;};'use strict';var emlformat=require(_0xdf3c('0x0'));var rimraf=require(_0xdf3c('0x1'));var zipdir=require(_0xdf3c('0x2'));var jsonpatch=require(_0xdf3c('0x3'));var rp=require(_0xdf3c('0x4'));var moment=require(_0xdf3c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdf3c('0x6'));var util=require(_0xdf3c('0x7'));var path=require(_0xdf3c('0x8'));var sox=require('sox');var csv=require(_0xdf3c('0x9'));var ejs=require(_0xdf3c('0xa'));var fs=require('fs');var fs_extra=require(_0xdf3c('0xb'));var _=require(_0xdf3c('0xc'));var squel=require(_0xdf3c('0xd'));var crypto=require(_0xdf3c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xdf3c('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdf3c('0x10'));var Redis=require(_0xdf3c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdf3c('0x12'));var as=require(_0xdf3c('0x13'));var hardwareService=require(_0xdf3c('0x14'));var logger=require(_0xdf3c('0x15'))(_0xdf3c('0x16'));var utils=require(_0xdf3c('0x17'));var config=require(_0xdf3c('0x18'));var licenseUtil=require(_0xdf3c('0x19'));var db=require('../../mysqldb')['db'];var jayson=require(_0xdf3c('0x1a'));var client=jayson[_0xdf3c('0x1b')][_0xdf3c('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x17319c,_0x59e431,_0x2ae4ad,_0x461079){return new BPromise(function(_0x13ea5f,_0x5e0047){var _0x18aafa=_0x461079||client;return _0x18aafa[_0xdf3c('0x1d')](_0x17319c,_0x2ae4ad)[_0xdf3c('0x1e')](function(_0x4274fd){logger[_0xdf3c('0x1f')](_0xdf3c('0x20'),_0x59e431,_0xdf3c('0x21'));logger[_0xdf3c('0x22')](_0xdf3c('0x23'),_0x59e431,_0xdf3c('0x21'),JSON['stringify'](_0x4274fd));if(_0x4274fd[_0xdf3c('0x24')]){if(_0x4274fd[_0xdf3c('0x24')][_0xdf3c('0x25')]===0x1f4){logger[_0xdf3c('0x24')](_0xdf3c('0x20'),_0x59e431,_0x4274fd[_0xdf3c('0x24')][_0xdf3c('0x26')]);return _0x5e0047(_0x4274fd[_0xdf3c('0x24')][_0xdf3c('0x26')]);}logger[_0xdf3c('0x24')](_0xdf3c('0x20'),_0x59e431,_0x4274fd[_0xdf3c('0x24')][_0xdf3c('0x26')]);return _0x13ea5f(_0x4274fd['error']['message']);}else{logger[_0xdf3c('0x1f')]('Trunk,\x20%s,\x20%s',_0x59e431,_0xdf3c('0x21'));_0x13ea5f(_0x4274fd[_0xdf3c('0x27')][_0xdf3c('0x26')]);}})[_0xdf3c('0x28')](function(_0x33652f){logger[_0xdf3c('0x24')]('Trunk,\x20%s,\x20%s',_0x59e431,_0x33652f);_0x5e0047(_0x33652f);});});}function respondWithStatusCode(_0x22a164,_0x213d75){_0x213d75=_0x213d75||0xcc;return function(_0x13e3ca){if(_0x13e3ca){return _0x22a164[_0xdf3c('0x29')](_0x213d75);}return _0x22a164[_0xdf3c('0x2a')](_0x213d75)[_0xdf3c('0x2b')]();};}function respondWithResult(_0xef54cb,_0x155f54){_0x155f54=_0x155f54||0xc8;return function(_0x18cb46){if(_0x18cb46){return _0xef54cb[_0xdf3c('0x2a')](_0x155f54)['json'](_0x18cb46);}};}function respondWithFilteredResult(_0xd284d7,_0x153daa){return function(_0x4b57a4){if(_0x4b57a4){var _0xdc8962=typeof _0x153daa['offset']==='undefined'&&typeof _0x153daa['limit']===_0xdf3c('0x2c');var _0x186bba=_0x4b57a4['count'];var _0x5c3b5a=_0xdc8962?0x0:_0x153daa[_0xdf3c('0x2d')];var _0x1f2ce4=_0xdc8962?_0x4b57a4[_0xdf3c('0x2e')]:_0x153daa[_0xdf3c('0x2d')]+_0x153daa['limit'];var _0x43ce06;if(_0x1f2ce4>=_0x186bba){_0x1f2ce4=_0x186bba;_0x43ce06=0xc8;}else{_0x43ce06=0xce;}_0xd284d7[_0xdf3c('0x2a')](_0x43ce06);return _0xd284d7['set']('Content-Range',_0x5c3b5a+'-'+_0x1f2ce4+'/'+_0x186bba)[_0xdf3c('0x2f')](_0x4b57a4);}return null;};}function patchUpdates(_0x46f0e3){return function(_0x36937e){try{jsonpatch['apply'](_0x36937e,_0x46f0e3,!![]);}catch(_0x2355f6){return BPromise[_0xdf3c('0x30')](_0x2355f6);}return _0x36937e[_0xdf3c('0x31')]();};}function saveUpdates(_0x10099e,_0x575ae1){return function(_0xda0de0){if(_0xda0de0){return _0xda0de0[_0xdf3c('0x32')](_0x10099e)['then'](function(_0x40ae3d){return _0x40ae3d;});}return null;};}function removeEntity(_0x3daeda,_0x217a65){return function(_0x2287f){if(_0x2287f){return _0x2287f['destroy']()[_0xdf3c('0x1e')](function(){var _0x360d5c=_0x2287f[_0xdf3c('0x33')]({'plain':!![]});var _0x3b9ce8='Trunks';return db[_0xdf3c('0x34')][_0xdf3c('0x35')]({'where':{'type':_0x3b9ce8,'resourceId':_0x360d5c['id']}})['then'](function(){return _0x2287f;});})['then'](function(){_0x3daeda[_0xdf3c('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x216115,_0x5e8130){return function(_0x57faba){if(!_0x57faba){_0x216115['sendStatus'](0x194);}return _0x57faba;};}function handleError(_0x44a478,_0x2ee9ad){_0x2ee9ad=_0x2ee9ad||0x1f4;return function(_0x1d0b8a){logger[_0xdf3c('0x24')](_0x1d0b8a['stack']);if(_0x1d0b8a['name']){delete _0x1d0b8a[_0xdf3c('0x36')];}_0x44a478['status'](_0x2ee9ad)[_0xdf3c('0x37')](_0x1d0b8a);};}exports[_0xdf3c('0x38')]=function(_0x3628ae,_0xcdd731){var _0x1004e9={},_0x1e0cf2={},_0x1c7335={'count':0x0,'rows':[]};var _0x809f3d=_[_0xdf3c('0x39')](db['Trunk'][_0xdf3c('0x3a')],function(_0x54e689){return{'name':_0x54e689['fieldName'],'type':_0x54e689[_0xdf3c('0x3b')]['key']};});_0x1e0cf2[_0xdf3c('0x3c')]=_['map'](_0x809f3d,_0xdf3c('0x36'));_0x1e0cf2[_0xdf3c('0x3d')]=_[_0xdf3c('0x3e')](_0x3628ae[_0xdf3c('0x3d')]);_0x1e0cf2[_0xdf3c('0x3f')]=_[_0xdf3c('0x40')](_0x1e0cf2[_0xdf3c('0x3c')],_0x1e0cf2[_0xdf3c('0x3d')]);_0x1004e9[_0xdf3c('0x41')]=_[_0xdf3c('0x40')](_0x1e0cf2[_0xdf3c('0x3c')],qs[_0xdf3c('0x42')](_0x3628ae['query']['fields']));_0x1004e9[_0xdf3c('0x41')]=_0x1004e9['attributes'][_0xdf3c('0x43')]?_0x1004e9[_0xdf3c('0x41')]:_0x1e0cf2[_0xdf3c('0x3c')];if(!_0x3628ae[_0xdf3c('0x3d')]['hasOwnProperty']('nolimit')){_0x1004e9[_0xdf3c('0x44')]=qs[_0xdf3c('0x44')](_0x3628ae[_0xdf3c('0x3d')]['limit']);_0x1004e9[_0xdf3c('0x2d')]=qs[_0xdf3c('0x2d')](_0x3628ae[_0xdf3c('0x3d')][_0xdf3c('0x2d')]);}_0x1004e9['order']=qs[_0xdf3c('0x45')](_0x3628ae[_0xdf3c('0x3d')][_0xdf3c('0x45')]);_0x1004e9[_0xdf3c('0x46')]=qs[_0xdf3c('0x3f')](_['pick'](_0x3628ae[_0xdf3c('0x3d')],_0x1e0cf2[_0xdf3c('0x3f')]),_0x809f3d);if(_0x3628ae[_0xdf3c('0x3d')][_0xdf3c('0x47')]){_0x1004e9[_0xdf3c('0x46')]=_[_0xdf3c('0x48')](_0x1004e9['where'],{'$or':_['map'](_0x809f3d,function(_0x2c6c6d){if(_0x2c6c6d[_0xdf3c('0x3b')]!=='VIRTUAL'){var _0x5c9885={};_0x5c9885[_0x2c6c6d[_0xdf3c('0x36')]]={'$like':'%'+_0x3628ae[_0xdf3c('0x3d')][_0xdf3c('0x47')]+'%'};return _0x5c9885;}})});}_0x1004e9=_[_0xdf3c('0x48')]({},_0x1004e9,_0x3628ae[_0xdf3c('0x49')]);var _0x2dbf54={'where':_0x1004e9[_0xdf3c('0x46')]};return db[_0xdf3c('0x4a')][_0xdf3c('0x2e')](_0x2dbf54)['then'](function(_0x129c2a){_0x1c7335[_0xdf3c('0x2e')]=_0x129c2a;if(_0x3628ae[_0xdf3c('0x3d')][_0xdf3c('0x4b')]){_0x1004e9[_0xdf3c('0x4c')]=[{'all':!![]}];}return db[_0xdf3c('0x4a')][_0xdf3c('0x4d')](_0x1004e9);})['then'](function(_0x1751a8){_0x1c7335['rows']=_0x1751a8;return _0x1c7335;})[_0xdf3c('0x1e')](respondWithFilteredResult(_0xcdd731,_0x1004e9))['catch'](handleError(_0xcdd731,null));};exports[_0xdf3c('0x4e')]=function(_0x28144f,_0x2ec575){var _0x94c5b9={'raw':![],'where':{'id':_0x28144f['params']['id']}},_0x5eef94={};_0x5eef94['model']=_[_0xdf3c('0x3e')](db['Trunk'][_0xdf3c('0x3a')]);_0x5eef94[_0xdf3c('0x3d')]=_[_0xdf3c('0x3e')](_0x28144f[_0xdf3c('0x3d')]);_0x5eef94[_0xdf3c('0x3f')]=_['intersection'](_0x5eef94['model'],_0x5eef94[_0xdf3c('0x3d')]);_0x94c5b9[_0xdf3c('0x41')]=_['intersection'](_0x5eef94[_0xdf3c('0x3c')],qs[_0xdf3c('0x42')](_0x28144f[_0xdf3c('0x3d')][_0xdf3c('0x42')]));_0x94c5b9[_0xdf3c('0x41')]=_0x94c5b9[_0xdf3c('0x41')][_0xdf3c('0x43')]?_0x94c5b9['attributes']:_0x5eef94['model'];if(_0x28144f[_0xdf3c('0x3d')][_0xdf3c('0x4b')]){_0x94c5b9[_0xdf3c('0x4c')]=[{'all':!![]}];}_0x94c5b9=_[_0xdf3c('0x48')]({},_0x94c5b9,_0x28144f[_0xdf3c('0x49')]);return db[_0xdf3c('0x4a')][_0xdf3c('0x4f')](_0x94c5b9)[_0xdf3c('0x1e')](handleEntityNotFound(_0x2ec575,null))[_0xdf3c('0x1e')](respondWithResult(_0x2ec575,null))[_0xdf3c('0x28')](handleError(_0x2ec575,null));};exports[_0xdf3c('0x50')]=function(_0x4cb28f,_0x1eebcf){var _0x47cb74={'where':{'id':_0x4cb28f['params']['id']}},_0x5e7247={};_0x5e7247['model']=_['keys'](db[_0xdf3c('0x4a')][_0xdf3c('0x3a')]);_0x47cb74['attributes']=_[_0xdf3c('0x40')](_0x5e7247[_0xdf3c('0x3c')],qs['fields'](_0x4cb28f[_0xdf3c('0x3d')][_0xdf3c('0x42')]));_0x47cb74[_0xdf3c('0x41')]=_0x47cb74[_0xdf3c('0x41')][_0xdf3c('0x43')]?_0x47cb74[_0xdf3c('0x41')]:_0x5e7247[_0xdf3c('0x3c')];if(_0x4cb28f[_0xdf3c('0x3d')][_0xdf3c('0x4b')]){_0x47cb74[_0xdf3c('0x4c')]=[{'all':!![]}];}_0x47cb74=_[_0xdf3c('0x48')]({},_0x47cb74,_0x4cb28f['options']);return db[_0xdf3c('0x4a')][_0xdf3c('0x4f')](_0x47cb74)[_0xdf3c('0x1e')](handleEntityNotFound(_0x1eebcf,null))['then'](function(_0x245c68){if(_0x245c68){var _0x3e327e=_0x245c68[_0xdf3c('0x33')]({'plain':!![]});_0x3e327e=qs['omit'](_0x3e327e,['id',_0xdf3c('0x51'),_0xdf3c('0x52')]);_0x4cb28f['body']=_[_0xdf3c('0x53')](_0x4cb28f['body'],['id',_0xdf3c('0x51'),_0xdf3c('0x52')]);return db[_0xdf3c('0x4a')][_0xdf3c('0x54')](_[_0xdf3c('0x48')](_0x3e327e,_0x4cb28f[_0xdf3c('0x55')]),{'include':_0x4cb28f[_0xdf3c('0x3d')][_0xdf3c('0x4b')]?[{'all':!![]}]:undefined})[_0xdf3c('0x1e')](function(_0x330730){var _0x283be2=_0x4cb28f[_0xdf3c('0x56')][_0xdf3c('0x33')]({'plain':!![]});if(!_0x283be2)throw new Error(_0xdf3c('0x57'));if(_0x283be2[_0xdf3c('0x58')]===_0xdf3c('0x56')){var _0xd7fb2d=_0x330730['get']({'plain':!![]});var _0x4dade5=_0xdf3c('0x59');return db[_0xdf3c('0x5a')][_0xdf3c('0x4f')]({'where':{'name':_0x4dade5,'userProfileId':_0x283be2['userProfileId']},'raw':!![]})[_0xdf3c('0x1e')](function(_0x5f2765){if(_0x5f2765&&_0x5f2765['autoAssociation']===0x0){return db[_0xdf3c('0x34')][_0xdf3c('0x54')]({'name':_0xd7fb2d[_0xdf3c('0x36')],'resourceId':_0xd7fb2d['id'],'type':_0x5f2765[_0xdf3c('0x36')],'sectionId':_0x5f2765['id']},{})[_0xdf3c('0x1e')](function(){return _0x330730;});}else{return _0x330730;}})[_0xdf3c('0x28')](function(_0x1a31d7){logger[_0xdf3c('0x24')](_0xdf3c('0x5b'),_0x1a31d7);throw _0x1a31d7;});}return _0x330730;});}})[_0xdf3c('0x1e')](respondWithResult(_0x1eebcf,0xc9))[_0xdf3c('0x28')](handleError(_0x1eebcf,null));};exports[_0xdf3c('0x54')]=function(_0x34000c,_0x4be79a,_0x3febac){var _0x2cb0f5;return db[_0xdf3c('0x4a')][_0xdf3c('0x54')](_0x34000c[_0xdf3c('0x55')],{'raw':!![]})['then'](function(_0x18bf4f){_0x2cb0f5=_0x18bf4f;return db[_0xdf3c('0x4a')][_0xdf3c('0x4d')]({'raw':!![]});})[_0xdf3c('0x1e')](function(_0x1efa9c){var _0x50805c=fs[_0xdf3c('0x5c')](path[_0xdf3c('0x5d')](config[_0xdf3c('0x5e')],_0xdf3c('0x5f')),'utf8');var _0xb867a1=fs[_0xdf3c('0x5c')](path[_0xdf3c('0x5d')](config[_0xdf3c('0x5e')],_0xdf3c('0x60')),_0xdf3c('0x61'));var _0x19c851=ejs['render'](_0x50805c,{'trunks':_0x1efa9c||[]});fs[_0xdf3c('0x62')](_0xdf3c('0x63'),_0x19c851);if(_0x2cb0f5['registry']){var _0x52a2e1=ejs[_0xdf3c('0x64')](_0xb867a1,{'trunks':_0x1efa9c||[]});fs[_0xdf3c('0x62')](_0xdf3c('0x65'),_0x52a2e1);}})[_0xdf3c('0x1e')](function(){return respondWithRpcPromise(_0xdf3c('0x66'),_0xdf3c('0x54'),{'module':_0xdf3c('0x67')});})[_0xdf3c('0x1e')](function(){var _0x5e6606=_0x34000c[_0xdf3c('0x56')][_0xdf3c('0x33')]({'plain':!![]});if(!_0x5e6606)throw new Error(_0xdf3c('0x57'));if(_0x5e6606['role']===_0xdf3c('0x56')){var _0x354ff4=_0x2cb0f5[_0xdf3c('0x33')]({'plain':!![]});return db['UserProfileSection'][_0xdf3c('0x4f')]({'where':{'name':_0xdf3c('0x59'),'userProfileId':_0x5e6606[_0xdf3c('0x68')]},'raw':!![]})[_0xdf3c('0x1e')](function(_0xe01538){if(_0xe01538&&_0xe01538[_0xdf3c('0x69')]===0x0){return db['UserProfileResource']['create']({'name':_0x354ff4['name'],'resourceId':_0x354ff4['id'],'type':_0xe01538['name'],'sectionId':_0xe01538['id']},{})['then'](function(){return _0x2cb0f5;});}else{return _0x2cb0f5;}})[_0xdf3c('0x28')](function(_0x3f43a0){logger[_0xdf3c('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3f43a0);throw _0x3f43a0;});}return _0x2cb0f5;})[_0xdf3c('0x1e')](respondWithResult(_0x4be79a,0xc9))[_0xdf3c('0x28')](handleError(_0x4be79a,null));};exports[_0xdf3c('0x32')]=function(_0x51e8c6,_0x591936,_0x233718){var _0x4e3517;return db[_0xdf3c('0x4a')]['find']({'where':{'id':_0x51e8c6[_0xdf3c('0x6a')]['id']}})[_0xdf3c('0x1e')](handleEntityNotFound(_0x591936,null))[_0xdf3c('0x1e')](saveUpdates(_0x51e8c6[_0xdf3c('0x55')],null))['then'](function(_0x5148f6){if(_0x5148f6){_0x4e3517=_0x5148f6;return db[_0xdf3c('0x4a')][_0xdf3c('0x4d')]({'raw':!![]});}})[_0xdf3c('0x1e')](function(_0x12a7b0){if(_0x12a7b0){var _0x39d9f0=fs[_0xdf3c('0x5c')](path['join'](config[_0xdf3c('0x5e')],'server/files/templates/trunk.ejs'),_0xdf3c('0x61'));var _0x9c761a=fs[_0xdf3c('0x5c')](path[_0xdf3c('0x5d')](config[_0xdf3c('0x5e')],'server/files/templates/registry.ejs'),_0xdf3c('0x61'));var _0x5c27cc=ejs[_0xdf3c('0x64')](_0x39d9f0,{'trunks':_0x12a7b0||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x5c27cc);var _0x53b0c3=ejs['render'](_0x9c761a,{'trunks':_0x12a7b0||[]});fs[_0xdf3c('0x62')](_0xdf3c('0x65'),_0x53b0c3);return respondWithRpcPromise(_0xdf3c('0x66'),_0xdf3c('0x32'),{'module':_0xdf3c('0x67')});}return null;})[_0xdf3c('0x1e')](function(_0x5c8e5e){if(_0x5c8e5e){return _0x4e3517;}})[_0xdf3c('0x1e')](respondWithResult(_0x591936,null))['catch'](handleError(_0x591936,null));};exports[_0xdf3c('0x35')]=function(_0x389708,_0x2e5f82,_0x15a057){var _0x320452;return db[_0xdf3c('0x4a')][_0xdf3c('0x4f')]({'where':{'id':_0x389708[_0xdf3c('0x6a')]['id']}})[_0xdf3c('0x1e')](handleEntityNotFound(_0x2e5f82,null))[_0xdf3c('0x1e')](removeEntity(_0x2e5f82,null))[_0xdf3c('0x1e')](function(){return db[_0xdf3c('0x4a')][_0xdf3c('0x4d')]({'raw':!![]});})[_0xdf3c('0x1e')](function(_0x55fd73){var _0x118ab5=fs[_0xdf3c('0x5c')](path[_0xdf3c('0x5d')](config[_0xdf3c('0x5e')],'server/files/templates/trunk.ejs'),_0xdf3c('0x61'));var _0x1c8fe4=fs['readFileSync'](path['join'](config[_0xdf3c('0x5e')],_0xdf3c('0x60')),_0xdf3c('0x61'));var _0x1aaf8b=ejs[_0xdf3c('0x64')](_0x118ab5,{'trunks':_0x55fd73});var _0x56fc77=ejs[_0xdf3c('0x64')](_0x1c8fe4,{'trunks':_0x55fd73});fs[_0xdf3c('0x62')](_0xdf3c('0x63'),_0x1aaf8b);fs[_0xdf3c('0x62')](_0xdf3c('0x65'),_0x56fc77);return respondWithRpcPromise(_0xdf3c('0x66'),'destroy',{'module':_0xdf3c('0x67')});})[_0xdf3c('0x28')](handleError(_0x2e5f82,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 23be1b5..9b7ba7b 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 _0x0039=['bluebird','rimraf','exports','define','Trunk','lodash','util','../../config/logger','api','moment'];(function(_0x2b3323,_0x30974c){var _0x4a75b9=function(_0x52fc50){while(--_0x52fc50){_0x2b3323['push'](_0x2b3323['shift']());}};_0x4a75b9(++_0x30974c);}(_0x0039,0x16d));var _0x9003=function(_0x4afc9d,_0x34c240){_0x4afc9d=_0x4afc9d-0x0;var _0x2ee56e=_0x0039[_0x4afc9d];return _0x2ee56e;};'use strict';var _=require(_0x9003('0x0'));var util=require(_0x9003('0x1'));var logger=require(_0x9003('0x2'))(_0x9003('0x3'));var moment=require(_0x9003('0x4'));var BPromise=require(_0x9003('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9003('0x6'));var config=require('../../config/environment');var attributes=require('./trunk.attributes');module[_0x9003('0x7')]=function(_0x3feb32,_0x391d99){return _0x3feb32[_0x9003('0x8')](_0x9003('0x9'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x65fb=['tools_trunks','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./trunk.attributes','define','Trunk'];(function(_0x978971,_0x4ca3cb){var _0x48572f=function(_0x58fdd6){while(--_0x58fdd6){_0x978971['push'](_0x978971['shift']());}};_0x48572f(++_0x4ca3cb);}(_0x65fb,0x181));var _0xb65f=function(_0x170cbb,_0x9093e){_0x170cbb=_0x170cbb-0x0;var _0x39fae4=_0x65fb[_0x170cbb];return _0x39fae4;};'use strict';var _=require('lodash');var util=require(_0xb65f('0x0'));var logger=require(_0xb65f('0x1'))(_0xb65f('0x2'));var moment=require(_0xb65f('0x3'));var BPromise=require(_0xb65f('0x4'));var rp=require(_0xb65f('0x5'));var fs=require('fs');var path=require(_0xb65f('0x6'));var rimraf=require('rimraf');var config=require(_0xb65f('0x7'));var attributes=require(_0xb65f('0x8'));module['exports']=function(_0x3a459c,_0x15773a){return _0x3a459c[_0xb65f('0x9')](_0xb65f('0xa'),attributes,{'tableName':_0xb65f('0xb'),'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 2384c52..5684cea 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 _0x841c=['raw','attributes','limit','include','map','model','ShowTrunk','find','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrunk','Trunk','findAll','options'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x841c,0x104));var _0xc841=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x841c[_0x5a776b];return _0xbbef59;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc841('0x0'));var BPromise=require(_0xc841('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc841('0x2'));var db=require(_0xc841('0x3'))['db'];var utils=require(_0xc841('0x4'));var logger=require(_0xc841('0x5'))(_0xc841('0x6'));var config=require(_0xc841('0x7'));var jayson=require(_0xc841('0x8'));var client=jayson[_0xc841('0x9')][_0xc841('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x554817,_0x212bb7,_0x194ebb){return new BPromise(function(_0x4e5915,_0x382b39){return client[_0xc841('0xb')](_0x554817,_0x194ebb)[_0xc841('0xc')](function(_0x208a30){logger[_0xc841('0xd')](_0xc841('0xe'),_0x212bb7,_0xc841('0xf'));logger[_0xc841('0x10')](_0xc841('0x11'),_0x212bb7,_0xc841('0xf'),JSON[_0xc841('0x12')](_0x208a30));if(_0x208a30[_0xc841('0x13')]){if(_0x208a30[_0xc841('0x13')][_0xc841('0x14')]===0x1f4){logger[_0xc841('0x13')](_0xc841('0xe'),_0x212bb7,_0x208a30[_0xc841('0x13')][_0xc841('0x15')]);return _0x382b39(_0x208a30[_0xc841('0x13')][_0xc841('0x15')]);}logger[_0xc841('0x13')](_0xc841('0xe'),_0x212bb7,_0x208a30['error'][_0xc841('0x15')]);return _0x4e5915(_0x208a30[_0xc841('0x13')]['message']);}else{logger[_0xc841('0xd')]('Trunk,\x20%s,\x20%s',_0x212bb7,_0xc841('0xf'));_0x4e5915(_0x208a30[_0xc841('0x16')][_0xc841('0x15')]);}})[_0xc841('0x17')](function(_0x1ad2cf){logger[_0xc841('0x13')](_0xc841('0xe'),_0x212bb7,_0x1ad2cf);_0x382b39(_0x1ad2cf);});});}exports[_0xc841('0x18')]=function(_0x5189c2){var _0x4071ea=this;return new Promise(function(_0x33c98e,_0x4f0328){return db[_0xc841('0x19')][_0xc841('0x1a')]({'raw':_0x5189c2[_0xc841('0x1b')]?_0x5189c2[_0xc841('0x1b')][_0xc841('0x1c')]===undefined?!![]:![]:!![],'where':_0x5189c2[_0xc841('0x1b')]?_0x5189c2[_0xc841('0x1b')]['where']||null:null,'attributes':_0x5189c2[_0xc841('0x1b')]?_0x5189c2[_0xc841('0x1b')][_0xc841('0x1d')]||null:null,'limit':_0x5189c2[_0xc841('0x1b')]?_0x5189c2[_0xc841('0x1b')][_0xc841('0x1e')]||null:null,'include':_0x5189c2[_0xc841('0x1b')]?_0x5189c2['options'][_0xc841('0x1f')]?_[_0xc841('0x20')](_0x5189c2[_0xc841('0x1b')][_0xc841('0x1f')],function(_0x24c7c9){return{'model':db[_0x24c7c9['model']],'as':_0x24c7c9['as'],'attributes':_0x24c7c9[_0xc841('0x1d')],'include':_0x24c7c9[_0xc841('0x1f')]?_[_0xc841('0x20')](_0x24c7c9[_0xc841('0x1f')],function(_0x3310a4){return{'model':db[_0x3310a4[_0xc841('0x21')]],'as':_0x3310a4['as'],'attributes':_0x3310a4['attributes'],'include':_0x3310a4[_0xc841('0x1f')]?_['map'](_0x3310a4['include'],function(_0x5b2465){return{'model':db[_0x5b2465[_0xc841('0x21')]],'as':_0x5b2465['as'],'attributes':_0x5b2465[_0xc841('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xc841('0xc')](function(_0x550270){logger[_0xc841('0xd')]('GetTrunk',_0x5189c2);logger[_0xc841('0x10')]('GetTrunk',_0x5189c2,JSON[_0xc841('0x12')](_0x550270));_0x33c98e(_0x550270);})[_0xc841('0x17')](function(_0x58572f){logger[_0xc841('0x13')](_0xc841('0x18'),_0x58572f[_0xc841('0x15')],_0x5189c2);_0x4f0328(_0x4071ea[_0xc841('0x13')](0x1f4,_0x58572f[_0xc841('0x15')]));});});};exports[_0xc841('0x22')]=function(_0x15aa82){var _0x4efa3b=this;return new Promise(function(_0x20ad5b,_0x7ed5c7){return db[_0xc841('0x19')][_0xc841('0x23')]({'raw':_0x15aa82[_0xc841('0x1b')]?_0x15aa82[_0xc841('0x1b')][_0xc841('0x1c')]===undefined?!![]:![]:!![],'where':_0x15aa82['options']?_0x15aa82[_0xc841('0x1b')]['where']||null:null,'attributes':_0x15aa82[_0xc841('0x1b')]?_0x15aa82[_0xc841('0x1b')][_0xc841('0x1d')]||null:null,'include':_0x15aa82[_0xc841('0x1b')]?_0x15aa82['options'][_0xc841('0x1f')]?_[_0xc841('0x20')](_0x15aa82[_0xc841('0x1b')][_0xc841('0x1f')],function(_0x5bbc79){return{'model':db[_0x5bbc79[_0xc841('0x21')]],'as':_0x5bbc79['as'],'attributes':_0x5bbc79[_0xc841('0x1d')],'include':_0x5bbc79[_0xc841('0x1f')]?_[_0xc841('0x20')](_0x5bbc79['include'],function(_0x9fa0f7){return{'model':db[_0x9fa0f7['model']],'as':_0x9fa0f7['as'],'attributes':_0x9fa0f7[_0xc841('0x1d')],'include':_0x9fa0f7['include']?_['map'](_0x9fa0f7[_0xc841('0x1f')],function(_0x291b90){return{'model':db[_0x291b90[_0xc841('0x21')]],'as':_0x291b90['as'],'attributes':_0x291b90[_0xc841('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xc841('0xc')](function(_0xfe9019){logger[_0xc841('0xd')](_0xc841('0x22'),_0x15aa82);logger[_0xc841('0x10')](_0xc841('0x22'),_0x15aa82,JSON[_0xc841('0x12')](_0xfe9019));_0x20ad5b(_0xfe9019);})[_0xc841('0x17')](function(_0xc3b8ec){logger[_0xc841('0x13')](_0xc841('0x22'),_0xc3b8ec[_0xc841('0x15')],_0x15aa82);_0x7ed5c7(_0x4efa3b[_0xc841('0x13')](0x1f4,_0xc3b8ec[_0xc841('0x15')]));});});}; \ No newline at end of file +var _0x0a51=['then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','Trunk','findAll','options','raw','include','map','model','attributes','GetTrunk','ShowTrunk','find','where','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x23a889,_0x3f3406){var _0x3e87a3=function(_0x58766e){while(--_0x58766e){_0x23a889['push'](_0x23a889['shift']());}};_0x3e87a3(++_0x3f3406);}(_0x0a51,0xbb));var _0x10a5=function(_0x4cc9e7,_0x50dff3){_0x4cc9e7=_0x4cc9e7-0x0;var _0x1db570=_0x0a51[_0x4cc9e7];return _0x1db570;};'use strict';var _=require('lodash');var util=require(_0x10a5('0x0'));var moment=require(_0x10a5('0x1'));var BPromise=require('bluebird');var rs=require(_0x10a5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x10a5('0x3'))['db'];var utils=require(_0x10a5('0x4'));var logger=require(_0x10a5('0x5'))(_0x10a5('0x6'));var config=require(_0x10a5('0x7'));var jayson=require(_0x10a5('0x8'));var client=jayson['client'][_0x10a5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x13204c,_0x4b6ab1,_0x2a9266){return new BPromise(function(_0x1806ff,_0x8067a4){return client[_0x10a5('0xa')](_0x13204c,_0x2a9266)[_0x10a5('0xb')](function(_0x4b8e5f){logger[_0x10a5('0xc')](_0x10a5('0xd'),_0x4b6ab1,_0x10a5('0xe'));logger[_0x10a5('0xf')](_0x10a5('0x10'),_0x4b6ab1,'request\x20sent',JSON[_0x10a5('0x11')](_0x4b8e5f));if(_0x4b8e5f[_0x10a5('0x12')]){if(_0x4b8e5f[_0x10a5('0x12')]['code']===0x1f4){logger['error']('Trunk,\x20%s,\x20%s',_0x4b6ab1,_0x4b8e5f[_0x10a5('0x12')][_0x10a5('0x13')]);return _0x8067a4(_0x4b8e5f[_0x10a5('0x12')]['message']);}logger[_0x10a5('0x12')]('Trunk,\x20%s,\x20%s',_0x4b6ab1,_0x4b8e5f[_0x10a5('0x12')][_0x10a5('0x13')]);return _0x1806ff(_0x4b8e5f[_0x10a5('0x12')][_0x10a5('0x13')]);}else{logger[_0x10a5('0xc')]('Trunk,\x20%s,\x20%s',_0x4b6ab1,_0x10a5('0xe'));_0x1806ff(_0x4b8e5f['result'][_0x10a5('0x13')]);}})[_0x10a5('0x14')](function(_0x2080f5){logger[_0x10a5('0x12')](_0x10a5('0xd'),_0x4b6ab1,_0x2080f5);_0x8067a4(_0x2080f5);});});}exports['GetTrunk']=function(_0x30ab11){var _0x402a0a=this;return new Promise(function(_0x1b331f,_0x258ccb){return db[_0x10a5('0x15')][_0x10a5('0x16')]({'raw':_0x30ab11[_0x10a5('0x17')]?_0x30ab11[_0x10a5('0x17')][_0x10a5('0x18')]===undefined?!![]:![]:!![],'where':_0x30ab11[_0x10a5('0x17')]?_0x30ab11[_0x10a5('0x17')]['where']||null:null,'attributes':_0x30ab11[_0x10a5('0x17')]?_0x30ab11['options']['attributes']||null:null,'limit':_0x30ab11['options']?_0x30ab11[_0x10a5('0x17')]['limit']||null:null,'include':_0x30ab11[_0x10a5('0x17')]?_0x30ab11[_0x10a5('0x17')][_0x10a5('0x19')]?_[_0x10a5('0x1a')](_0x30ab11[_0x10a5('0x17')][_0x10a5('0x19')],function(_0x39b6f7){return{'model':db[_0x39b6f7[_0x10a5('0x1b')]],'as':_0x39b6f7['as'],'attributes':_0x39b6f7[_0x10a5('0x1c')],'include':_0x39b6f7[_0x10a5('0x19')]?_['map'](_0x39b6f7[_0x10a5('0x19')],function(_0xa2b487){return{'model':db[_0xa2b487['model']],'as':_0xa2b487['as'],'attributes':_0xa2b487[_0x10a5('0x1c')],'include':_0xa2b487[_0x10a5('0x19')]?_['map'](_0xa2b487[_0x10a5('0x19')],function(_0xd6ff27){return{'model':db[_0xd6ff27[_0x10a5('0x1b')]],'as':_0xd6ff27['as'],'attributes':_0xd6ff27['attributes']};}):[]};}):[]};}):[]:[]})[_0x10a5('0xb')](function(_0x459161){logger[_0x10a5('0xc')]('GetTrunk',_0x30ab11);logger[_0x10a5('0xf')](_0x10a5('0x1d'),_0x30ab11,JSON[_0x10a5('0x11')](_0x459161));_0x1b331f(_0x459161);})['catch'](function(_0x125720){logger[_0x10a5('0x12')]('GetTrunk',_0x125720[_0x10a5('0x13')],_0x30ab11);_0x258ccb(_0x402a0a['error'](0x1f4,_0x125720[_0x10a5('0x13')]));});});};exports[_0x10a5('0x1e')]=function(_0x24ad4c){var _0x163d75=this;return new Promise(function(_0x1419aa,_0x533596){return db[_0x10a5('0x15')][_0x10a5('0x1f')]({'raw':_0x24ad4c[_0x10a5('0x17')]?_0x24ad4c[_0x10a5('0x17')][_0x10a5('0x18')]===undefined?!![]:![]:!![],'where':_0x24ad4c[_0x10a5('0x17')]?_0x24ad4c[_0x10a5('0x17')][_0x10a5('0x20')]||null:null,'attributes':_0x24ad4c['options']?_0x24ad4c[_0x10a5('0x17')][_0x10a5('0x1c')]||null:null,'include':_0x24ad4c[_0x10a5('0x17')]?_0x24ad4c['options'][_0x10a5('0x19')]?_[_0x10a5('0x1a')](_0x24ad4c[_0x10a5('0x17')]['include'],function(_0x2d80dd){return{'model':db[_0x2d80dd[_0x10a5('0x1b')]],'as':_0x2d80dd['as'],'attributes':_0x2d80dd[_0x10a5('0x1c')],'include':_0x2d80dd[_0x10a5('0x19')]?_[_0x10a5('0x1a')](_0x2d80dd[_0x10a5('0x19')],function(_0xb1cfdc){return{'model':db[_0xb1cfdc[_0x10a5('0x1b')]],'as':_0xb1cfdc['as'],'attributes':_0xb1cfdc[_0x10a5('0x1c')],'include':_0xb1cfdc[_0x10a5('0x19')]?_[_0x10a5('0x1a')](_0xb1cfdc[_0x10a5('0x19')],function(_0x36aeac){return{'model':db[_0x36aeac[_0x10a5('0x1b')]],'as':_0x36aeac['as'],'attributes':_0x36aeac[_0x10a5('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x10a5('0xb')](function(_0x399034){logger[_0x10a5('0xc')](_0x10a5('0x1e'),_0x24ad4c);logger[_0x10a5('0xf')](_0x10a5('0x1e'),_0x24ad4c,JSON[_0x10a5('0x11')](_0x399034));_0x1419aa(_0x399034);})[_0x10a5('0x14')](function(_0x1574bc){logger[_0x10a5('0x12')](_0x10a5('0x1e'),_0x1574bc['message'],_0x24ad4c);_0x533596(_0x163d75['error'](0x1f4,_0x1574bc[_0x10a5('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 2fbb6ef..94f4556 100644 --- a/server/api/user-setting/index.js +++ b/server/api/user-setting/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc22f=['exports','express','Router','./user-setting.controller','put','/:id','isAuthenticated','update'];(function(_0x2969a3,_0x5ea744){var _0x4c9d1b=function(_0x7ece1e){while(--_0x7ece1e){_0x2969a3['push'](_0x2969a3['shift']());}};_0x4c9d1b(++_0x5ea744);}(_0xc22f,0x161));var _0xfc22=function(_0x1faa1c,_0x2579d9){_0x1faa1c=_0x1faa1c-0x0;var _0x4537e8=_0xc22f[_0x1faa1c];return _0x4537e8;};'use strict';var express=require(_0xfc22('0x0'));var router=express[_0xfc22('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xfc22('0x2'));router[_0xfc22('0x3')](_0xfc22('0x4'),auth[_0xfc22('0x5')](),controller[_0xfc22('0x6')]);module[_0xfc22('0x7')]=router; \ No newline at end of file +var _0x947d=['update','exports','Router','../../components/auth/service','./user-setting.controller','put','/:id','isAuthenticated'];(function(_0x16c560,_0x5af0d5){var _0xae370=function(_0xf5bcef){while(--_0xf5bcef){_0x16c560['push'](_0x16c560['shift']());}};_0xae370(++_0x5af0d5);}(_0x947d,0xca));var _0xd947=function(_0x1db831,_0x42b7b5){_0x1db831=_0x1db831-0x0;var _0x39ba56=_0x947d[_0x1db831];return _0x39ba56;};'use strict';var express=require('express');var router=express[_0xd947('0x0')]();var auth=require(_0xd947('0x1'));var controller=require(_0xd947('0x2'));router[_0xd947('0x3')](_0xd947('0x4'),auth[_0xd947('0x5')](),controller[_0xd947('0x6')]);module[_0xd947('0x7')]=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index 1c77f10..0f833a6 100644 --- a/server/api/user-setting/user-setting.attributes.js +++ b/server/api/user-setting/user-setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb481=['ENUM','TEXT','DATE','INTEGER','UserId','sequelize','error','warning','debug'];(function(_0x32d14d,_0x322dbb){var _0x3e78d9=function(_0x14aa5){while(--_0x14aa5){_0x32d14d['push'](_0x32d14d['shift']());}};_0x3e78d9(++_0x322dbb);}(_0xb481,0x1be));var _0x1b48=function(_0x3fc726,_0x3bb2d3){_0x3fc726=_0x3fc726-0x0;var _0x4ca942=_0xb481[_0x3fc726];return _0x4ca942;};'use strict';var Sequelize=require(_0x1b48('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x1b48('0x1'),_0x1b48('0x2'),'info',_0x1b48('0x3')];module['exports']={'clientSideLoggingLevel':{'type':Sequelize[_0x1b48('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x1b48('0x5')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x1b48('0x6')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x1b48('0x7')],'unique':_0x1b48('0x8')}}; \ No newline at end of file +var _0x3a24=['exports','ENUM','BOOLEAN','INTEGER','UserId','sequelize','error','info'];(function(_0x3198a6,_0x3ba80b){var _0xde4962=function(_0x5301da){while(--_0x5301da){_0x3198a6['push'](_0x3198a6['shift']());}};_0xde4962(++_0x3ba80b);}(_0x3a24,0xed));var _0x43a2=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0x3a24[_0x4dc7b9];return _0x3ab114;};'use strict';var Sequelize=require(_0x43a2('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x43a2('0x1'),'warning',_0x43a2('0x2'),'debug'];module[_0x43a2('0x3')]={'clientSideLoggingLevel':{'type':Sequelize[_0x43a2('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x43a2('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x43a2('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x43a2('0x6')],'unique':_0x43a2('0x7')}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index 7a06921..0eaac92 100644 --- a/server/api/user-setting/user-setting.controller.js +++ b/server/api/user-setting/user-setting.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2904=['stack','name','status','role','admin','params','UserSetting','find','then','body','catch','lodash','ioredis','api','../../mysqldb','socket.io-emitter','redis','./user-setting.socket','register','defaults','localhost','json','update','sendStatus','error'];(function(_0x45ca41,_0x5adb99){var _0x29215f=function(_0x377576){while(--_0x377576){_0x45ca41['push'](_0x45ca41['shift']());}};_0x29215f(++_0x5adb99);}(_0x2904,0x137));var _0x4290=function(_0x21d108,_0x51a93a){_0x21d108=_0x21d108-0x0;var _0xbbbcb4=_0x2904[_0x21d108];return _0xbbbcb4;};'use strict';var _=require(_0x4290('0x0'));var Redis=require(_0x4290('0x1'));var logger=require('../../config/logger')(_0x4290('0x2'));var config=require('../../config/environment');var db=require(_0x4290('0x3'))['db'];var socket=require(_0x4290('0x4'))(new Redis(config[_0x4290('0x5')]));require(_0x4290('0x6'))[_0x4290('0x7')](socket);config['redis']=_[_0x4290('0x8')](config[_0x4290('0x5')],{'host':_0x4290('0x9'),'port':0x18eb});function respondWithResult(_0x4b8d4d,_0x4b1476){_0x4b1476=_0x4b1476||0xc8;return function(_0x5a4ac4){if(_0x5a4ac4){return _0x4b8d4d['status'](_0x4b1476)[_0x4290('0xa')](_0x5a4ac4);}};}function saveUpdates(_0x5434eb){return function(_0x22a13c){if(_0x22a13c){return _0x22a13c[_0x4290('0xb')](_0x5434eb)['then'](function(_0xca467e){return _0xca467e;});}return null;};}function handleEntityNotFound(_0x2d9de0){return function(_0x340982){if(!_0x340982){_0x2d9de0[_0x4290('0xc')](0x194);}return _0x340982;};}function handleError(_0xf811e2,_0x3ac886){_0x3ac886=_0x3ac886||0x1f4;return function(_0x2f0907){logger[_0x4290('0xd')](_0x2f0907[_0x4290('0xe')]);if(_0x2f0907['name']){delete _0x2f0907[_0x4290('0xf')];}_0xf811e2[_0x4290('0x10')](_0x3ac886)['send'](_0x2f0907);};}exports[_0x4290('0xb')]=function(_0x56a496,_0x2137b3){if(_0x56a496['user'][_0x4290('0x11')]!==_0x4290('0x12'))throw new Error('Unauthorized');if(isNaN(Number(_0x56a496[_0x4290('0x13')]['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db[_0x4290('0x14')][_0x4290('0x15')]({'where':{'id':_0x56a496[_0x4290('0x13')]['id']}})['then'](handleEntityNotFound(_0x2137b3,null))[_0x4290('0x16')](saveUpdates(_0x56a496[_0x4290('0x17')],null))['then'](respondWithResult(_0x2137b3,null))[_0x4290('0x18')](handleError(_0x2137b3,null));}; \ No newline at end of file +var _0x1c4f=['../../mysqldb','redis','./user-setting.socket','register','defaults','localhost','json','then','sendStatus','error','stack','name','status','send','update','role','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','find','body','catch','lodash','ioredis','../../config/logger','../../config/environment'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x1c4f,0x1f4));var _0xf1c4=function(_0x2223a4,_0x20632e){_0x2223a4=_0x2223a4-0x0;var _0x21d5ce=_0x1c4f[_0x2223a4];return _0x21d5ce;};'use strict';var _=require(_0xf1c4('0x0'));var Redis=require(_0xf1c4('0x1'));var logger=require(_0xf1c4('0x2'))('api');var config=require(_0xf1c4('0x3'));var db=require(_0xf1c4('0x4'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0xf1c4('0x5')]));require(_0xf1c4('0x6'))[_0xf1c4('0x7')](socket);config['redis']=_[_0xf1c4('0x8')](config[_0xf1c4('0x5')],{'host':_0xf1c4('0x9'),'port':0x18eb});function respondWithResult(_0x79689d,_0x3dadae){_0x3dadae=_0x3dadae||0xc8;return function(_0x2b45c2){if(_0x2b45c2){return _0x79689d['status'](_0x3dadae)[_0xf1c4('0xa')](_0x2b45c2);}};}function saveUpdates(_0x1d152c){return function(_0x45d9d5){if(_0x45d9d5){return _0x45d9d5['update'](_0x1d152c)[_0xf1c4('0xb')](function(_0x358730){return _0x358730;});}return null;};}function handleEntityNotFound(_0x1f7c5b){return function(_0x1b96ee){if(!_0x1b96ee){_0x1f7c5b[_0xf1c4('0xc')](0x194);}return _0x1b96ee;};}function handleError(_0x8ecb28,_0x5e1093){_0x5e1093=_0x5e1093||0x1f4;return function(_0x517b0e){logger[_0xf1c4('0xd')](_0x517b0e[_0xf1c4('0xe')]);if(_0x517b0e[_0xf1c4('0xf')]){delete _0x517b0e[_0xf1c4('0xf')];}_0x8ecb28[_0xf1c4('0x10')](_0x5e1093)[_0xf1c4('0x11')](_0x517b0e);};}exports[_0xf1c4('0x12')]=function(_0x55732e,_0x82837a){if(_0x55732e['user'][_0xf1c4('0x13')]!==_0xf1c4('0x14'))throw new Error(_0xf1c4('0x15'));if(isNaN(Number(_0x55732e[_0xf1c4('0x16')]['id'])))throw new Error(_0xf1c4('0x17'));return db[_0xf1c4('0x18')][_0xf1c4('0x19')]({'where':{'id':_0x55732e[_0xf1c4('0x16')]['id']}})[_0xf1c4('0xb')](handleEntityNotFound(_0x82837a,null))[_0xf1c4('0xb')](saveUpdates(_0x55732e[_0xf1c4('0x1a')],null))['then'](respondWithResult(_0x82837a,null))[_0xf1c4('0x1b')](handleError(_0x82837a,null));}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.events.js b/server/api/user-setting/user-setting.events.js index 0c701ea..e936d6d 100644 --- a/server/api/user-setting/user-setting.events.js +++ b/server/api/user-setting/user-setting.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4941=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','UserSetting'];(function(_0x481ddf,_0x34f36d){var _0xe615af=function(_0x133bd0){while(--_0x133bd0){_0x481ddf['push'](_0x481ddf['shift']());}};_0xe615af(++_0x34f36d);}(_0x4941,0x114));var _0x1494=function(_0x3ccdf8,_0x584ceb){_0x3ccdf8=_0x3ccdf8-0x0;var _0x243dab=_0x4941[_0x3ccdf8];return _0x243dab;};'use strict';var EventEmitter=require(_0x1494('0x0'));var UserSetting=require(_0x1494('0x1'))['db'][_0x1494('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1494('0x3'),'afterUpdate':_0x1494('0x4'),'afterDestroy':_0x1494('0x5')};function emitEvent(_0x1fd82a){return function(_0x59a893,_0x589a5a,_0x622039){UserSettingEvents[_0x1494('0x6')](_0x1fd82a+':'+_0x59a893['id'],_0x59a893);UserSettingEvents[_0x1494('0x6')](_0x1fd82a,_0x59a893);_0x622039(null);};}for(var e in events){if(events[_0x1494('0x7')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0x1494('0x8')]=UserSettingEvents; \ No newline at end of file +var _0xdaec=['hook','exports','events','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x3f9a49,_0x2fec08){var _0x20446e=function(_0x4a511d){while(--_0x4a511d){_0x3f9a49['push'](_0x3f9a49['shift']());}};_0x20446e(++_0x2fec08);}(_0xdaec,0x79));var _0xcdae=function(_0x216214,_0x300f2b){_0x216214=_0x216214-0x0;var _0x1539fc=_0xdaec[_0x216214];return _0x1539fc;};'use strict';var EventEmitter=require(_0xcdae('0x0'));var UserSetting=require('../../mysqldb')['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xcdae('0x1')](0x0);var events={'afterCreate':_0xcdae('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xe2e316){return function(_0x11b8d3,_0x230e14,_0xf49d21){UserSettingEvents[_0xcdae('0x3')](_0xe2e316+':'+_0x11b8d3['id'],_0x11b8d3);UserSettingEvents[_0xcdae('0x3')](_0xe2e316,_0x11b8d3);_0xf49d21(null);};}for(var e in events){if(events[_0xcdae('0x4')](e)){var event=events[e];UserSetting[_0xcdae('0x5')](e,emitEvent(event));}}module[_0xcdae('0x6')]=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index 076beb2..9c84165 100644 --- a/server/api/user-setting/user-setting.model.js +++ b/server/api/user-setting/user-setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf6e8=['UserSetting','user_settings','clientSideLoggingEnabledSince','exports','define'];(function(_0x3a1e9f,_0x248b8b){var _0x2e2da1=function(_0x548c9d){while(--_0x548c9d){_0x3a1e9f['push'](_0x3a1e9f['shift']());}};_0x2e2da1(++_0x248b8b);}(_0xf6e8,0xc1));var _0x8f6e=function(_0x526d1d,_0x3e36e6){_0x526d1d=_0x526d1d-0x0;var _0x557b4a=_0xf6e8[_0x526d1d];return _0x557b4a;};'use strict';var attributes=require('./user-setting.attributes');module[_0x8f6e('0x0')]=function(_0x2c1a59){return _0x2c1a59[_0x8f6e('0x1')](_0x8f6e('0x2'),attributes,{'tableName':_0x8f6e('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x24d74f){if(!_0x24d74f['clientSideLoggingEnabled'])_0x24d74f[_0x8f6e('0x4')]=null;else if(_0x24d74f['clientSideLoggingEnabledSince']===null)_0x24d74f[_0x8f6e('0x4')]=new Date();}}});}; \ No newline at end of file +var _0x1be1=['clientSideLoggingEnabled','clientSideLoggingEnabledSince','define','user_settings'];(function(_0x41a8a2,_0x5f570c){var _0x13f2e8=function(_0x524fbc){while(--_0x524fbc){_0x41a8a2['push'](_0x41a8a2['shift']());}};_0x13f2e8(++_0x5f570c);}(_0x1be1,0x192));var _0x11be=function(_0x5db14a,_0x5248c4){_0x5db14a=_0x5db14a-0x0;var _0x1865ba=_0x1be1[_0x5db14a];return _0x1865ba;};'use strict';var attributes=require('./user-setting.attributes');module['exports']=function(_0x3d5d4e){return _0x3d5d4e[_0x11be('0x0')]('UserSetting',attributes,{'tableName':_0x11be('0x1'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xd002ca){if(!_0xd002ca[_0x11be('0x2')])_0xd002ca[_0x11be('0x3')]=null;else if(_0xd002ca['clientSideLoggingEnabledSince']===null)_0xd002ca[_0x11be('0x3')]=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index cdf2e6a..17b8c15 100644 --- a/server/api/user-setting/user-setting.socket.js +++ b/server/api/user-setting/user-setting.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe9b0=['user-setting:update:user-','register','length','user-setting:','remove','user-setting:update','emit'];(function(_0x34ddee,_0x4ba642){var _0x256bb9=function(_0x497071){while(--_0x497071){_0x34ddee['push'](_0x34ddee['shift']());}};_0x256bb9(++_0x4ba642);}(_0xe9b0,0x123));var _0x0e9b=function(_0x3bd93d,_0x49393d){_0x3bd93d=_0x3bd93d-0x0;var _0x4c8680=_0xe9b0[_0x3bd93d];return _0x4c8680;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=['save',_0x0e9b('0x0'),'update'];function createListener(_0x59b6c2,_0x437948){return function(_0x2985c5){_0x437948['emit'](_0x59b6c2,_0x2985c5);if(_0x59b6c2===_0x0e9b('0x1')){_0x437948[_0x0e9b('0x2')](_0x0e9b('0x3')+_0x2985c5['UserId'],_0x2985c5);}};}exports[_0x0e9b('0x4')]=function(_0x4bd708){for(var _0x1665f9=0x0,_0x56abc6=events[_0x0e9b('0x5')];_0x1665f9<_0x56abc6;_0x1665f9++){var _0x38535b=events[_0x1665f9];var _0x2337fb=createListener(_0x0e9b('0x6')+_0x38535b,_0x4bd708);UserSettingEvents['on'](_0x38535b,_0x2337fb);}}; \ No newline at end of file +var _0xc0d2=['update','emit','UserId','register','length','user-setting:','./user-setting.events','save','remove'];(function(_0x19fc2f,_0x2509a1){var _0x24a68f=function(_0x544062){while(--_0x544062){_0x19fc2f['push'](_0x19fc2f['shift']());}};_0x24a68f(++_0x2509a1);}(_0xc0d2,0x114));var _0x2c0d=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xc0d2[_0x13d07a];return _0x5ee0ee;};'use strict';var UserSettingEvents=require(_0x2c0d('0x0'));var events=[_0x2c0d('0x1'),_0x2c0d('0x2'),_0x2c0d('0x3')];function createListener(_0x15c4f,_0x3beacb){return function(_0xa25666){_0x3beacb[_0x2c0d('0x4')](_0x15c4f,_0xa25666);if(_0x15c4f==='user-setting:update'){_0x3beacb[_0x2c0d('0x4')]('user-setting:update:user-'+_0xa25666[_0x2c0d('0x5')],_0xa25666);}};}exports[_0x2c0d('0x6')]=function(_0x81d792){for(var _0xfd46e=0x0,_0x2a4dde=events[_0x2c0d('0x7')];_0xfd46e<_0x2a4dde;_0xfd46e++){var _0x1e3778=events[_0xfd46e];var _0x1e8a53=createListener(_0x2c0d('0x8')+_0x1e3778,_0x81d792);UserSettingEvents['on'](_0x1e3778,_0x1e8a53);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 07422a1..c7026c9 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 _0x3b44=['createApiKey','update','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','/:id/mail_interactions','removeFaxInteractions','/:id/sms_interactions','removeSmsInteractions','/:id/openchannel_interactions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./user.controller','get','index','/describe','isAuthenticated','describe','/whoami','/presence','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','getScheduledCalls','post','addContacts','create','/create_many','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','single','file','/:id/login','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','addSmsInteractions','addOpenchannelInteractions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','/:id/api_key'];(function(_0x31cfbd,_0x147c40){var _0x5f205f=function(_0x34b414){while(--_0x34b414){_0x31cfbd['push'](_0x31cfbd['shift']());}};_0x5f205f(++_0x147c40);}(_0x3b44,0x18b));var _0x43b4=function(_0x104549,_0x347bdb){_0x104549=_0x104549-0x0;var _0x1a1baf=_0x3b44[_0x104549];return _0x1a1baf;};'use strict';var multer=require('multer');var util=require(_0x43b4('0x0'));var path=require(_0x43b4('0x1'));var timeout=require(_0x43b4('0x2'));var express=require(_0x43b4('0x3'));var router=express[_0x43b4('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x43b4('0x5'));var interaction=require(_0x43b4('0x6'));var config=require('../../config/environment');var controller=require(_0x43b4('0x7'));router[_0x43b4('0x8')]('/',auth['isAuthenticated'](),controller[_0x43b4('0x9')]);router['get'](_0x43b4('0xa'),auth[_0x43b4('0xb')](),controller[_0x43b4('0xc')]);router[_0x43b4('0x8')](_0x43b4('0xd'),auth[_0x43b4('0xb')](),controller['whoami']);router['get'](_0x43b4('0xe'),auth[_0x43b4('0xb')](),controller['getPresence']);router['get']('/:id',auth[_0x43b4('0xb')](),controller[_0x43b4('0xf')]);router[_0x43b4('0x8')](_0x43b4('0x10'),controller[_0x43b4('0x11')]);router[_0x43b4('0x8')](_0x43b4('0x12'),auth[_0x43b4('0xb')](),controller[_0x43b4('0x13')]);router['get'](_0x43b4('0x14'),auth[_0x43b4('0xb')](),controller[_0x43b4('0x15')]);router[_0x43b4('0x8')](_0x43b4('0x16'),auth[_0x43b4('0xb')](),controller[_0x43b4('0x17')]);router[_0x43b4('0x8')](_0x43b4('0x18'),auth['isAuthenticated'](),controller[_0x43b4('0x19')]);router['get'](_0x43b4('0x1a'),auth[_0x43b4('0xb')](),controller[_0x43b4('0x1b')]);router[_0x43b4('0x8')]('/:id/recordings',auth[_0x43b4('0xb')](),controller['getRecordings']);router[_0x43b4('0x8')](_0x43b4('0x1c'),auth['isAuthenticated'](),controller[_0x43b4('0x1d')]);router[_0x43b4('0x8')](_0x43b4('0x1e'),auth[_0x43b4('0xb')](),controller[_0x43b4('0x1f')]);router[_0x43b4('0x8')]('/:id/openchannel/interactions',auth[_0x43b4('0xb')](),controller[_0x43b4('0x20')]);router[_0x43b4('0x8')](_0x43b4('0x21'),auth[_0x43b4('0xb')](),controller[_0x43b4('0x22')]);router[_0x43b4('0x8')](_0x43b4('0x23'),auth[_0x43b4('0xb')](),controller[_0x43b4('0x24')]);router[_0x43b4('0x8')]('/:id/fax/interactions',auth[_0x43b4('0xb')](),controller[_0x43b4('0x25')]);router[_0x43b4('0x8')](_0x43b4('0x26'),auth[_0x43b4('0xb')](),controller[_0x43b4('0x27')]);router[_0x43b4('0x8')](_0x43b4('0x28'),auth['isAuthenticated'](),controller[_0x43b4('0x29')]);router[_0x43b4('0x8')](_0x43b4('0x2a'),auth[_0x43b4('0xb')](),controller[_0x43b4('0x2b')]);router[_0x43b4('0x8')](_0x43b4('0x2c'),auth[_0x43b4('0xb')](),controller[_0x43b4('0x2d')]);router[_0x43b4('0x8')](_0x43b4('0x2e'),auth[_0x43b4('0xb')](),controller[_0x43b4('0x2f')]);router[_0x43b4('0x8')]('/:id/fax_accounts',auth[_0x43b4('0xb')](),controller[_0x43b4('0x30')]);router[_0x43b4('0x8')](_0x43b4('0x31'),auth['isAuthenticated'](),controller[_0x43b4('0x32')]);router[_0x43b4('0x8')](_0x43b4('0x33'),auth[_0x43b4('0xb')](),controller[_0x43b4('0x34')]);router[_0x43b4('0x8')](_0x43b4('0x35'),auth[_0x43b4('0xb')](),controller[_0x43b4('0x36')]);router[_0x43b4('0x8')](_0x43b4('0x37'),auth[_0x43b4('0xb')](),controller[_0x43b4('0x38')]);router[_0x43b4('0x8')](_0x43b4('0x39'),auth[_0x43b4('0xb')](),controller[_0x43b4('0x3a')]);router[_0x43b4('0x8')](_0x43b4('0x3b'),auth[_0x43b4('0xb')](),controller[_0x43b4('0x3c')]);router[_0x43b4('0x8')]('/:id/scheduled_calls',auth[_0x43b4('0xb')](),controller[_0x43b4('0x3d')]);router[_0x43b4('0x8')]('/:id/api_key',auth['isAuthenticated'](),controller['getApiKey']);router[_0x43b4('0x3e')]('/:id/contacts',auth[_0x43b4('0xb')](),controller[_0x43b4('0x3f')]);router[_0x43b4('0x3e')]('/',auth[_0x43b4('0xb')](),controller[_0x43b4('0x40')]);router[_0x43b4('0x3e')](_0x43b4('0x41'),auth[_0x43b4('0xb')](),controller[_0x43b4('0x42')]);router[_0x43b4('0x3e')](_0x43b4('0x16'),auth[_0x43b4('0xb')](),controller[_0x43b4('0x43')]);var upload=multer({'storage':multer[_0x43b4('0x44')]({'destination':function(_0xe2b73b,_0x40ed62,_0x4b0f6a){_0x4b0f6a(null,path[_0x43b4('0x45')](config[_0x43b4('0x46')],_0x43b4('0x47')));},'filename':function(_0x1c4d38,_0xe3bd17,_0x4ffc5a){_0x4ffc5a(null,util[_0x43b4('0x48')](_0x43b4('0x49'),Date[_0x43b4('0x4a')](),_0xe3bd17[_0x43b4('0x4b')]));}})});router[_0x43b4('0x3e')]('/:id/avatar',upload[_0x43b4('0x4c')](_0x43b4('0x4d')),controller['addAvatar']);router['post'](_0x43b4('0x4e'),auth['isAuthenticated'](),controller['login']);router[_0x43b4('0x3e')]('/:id/logout',auth[_0x43b4('0xb')](),controller[_0x43b4('0x4f')]);router[_0x43b4('0x3e')](_0x43b4('0x50'),auth['isAuthenticated'](),controller[_0x43b4('0x51')]);router[_0x43b4('0x3e')](_0x43b4('0x52'),auth[_0x43b4('0xb')](),controller[_0x43b4('0x53')]);router['post'](_0x43b4('0x28'),auth[_0x43b4('0xb')](),controller[_0x43b4('0x54')]);router['post'](_0x43b4('0x55'),auth[_0x43b4('0xb')](),controller['addChatInteractions']);router[_0x43b4('0x3e')]('/:id/mail_interactions',auth[_0x43b4('0xb')](),controller[_0x43b4('0x56')]);router[_0x43b4('0x3e')](_0x43b4('0x57'),auth[_0x43b4('0xb')](),controller[_0x43b4('0x58')]);router['post']('/:id/sms_interactions',auth[_0x43b4('0xb')](),controller[_0x43b4('0x59')]);router['post']('/:id/openchannel_interactions',auth['isAuthenticated'](),controller[_0x43b4('0x5a')]);router[_0x43b4('0x3e')]('/:id/whatsapp_interactions',auth[_0x43b4('0xb')](),controller[_0x43b4('0x5b')]);router[_0x43b4('0x3e')](_0x43b4('0x5c'),auth[_0x43b4('0xb')](),controller[_0x43b4('0x5d')]);router[_0x43b4('0x3e')](_0x43b4('0x31'),auth[_0x43b4('0xb')](),controller[_0x43b4('0x5e')]);router[_0x43b4('0x3e')](_0x43b4('0x33'),auth[_0x43b4('0xb')](),controller[_0x43b4('0x5f')]);router[_0x43b4('0x3e')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0x43b4('0x60')]);router[_0x43b4('0x3e')](_0x43b4('0x37'),auth[_0x43b4('0xb')](),controller[_0x43b4('0x61')]);router[_0x43b4('0x3e')](_0x43b4('0x39'),auth['isAuthenticated'](),controller[_0x43b4('0x62')]);router['post']('/:id/square_projects',auth['isAuthenticated'](),controller[_0x43b4('0x63')]);router[_0x43b4('0x3e')](_0x43b4('0x64'),auth[_0x43b4('0xb')](),controller[_0x43b4('0x65')]);router['put']('/:id',auth[_0x43b4('0xb')](),controller[_0x43b4('0x66')]);router['put'](_0x43b4('0x67'),auth['isAuthenticated'](),controller[_0x43b4('0x68')]);router[_0x43b4('0x69')]('/:id/queues',auth[_0x43b4('0xb')](),controller[_0x43b4('0x6a')]);router[_0x43b4('0x69')](_0x43b4('0x28'),auth[_0x43b4('0xb')](),controller[_0x43b4('0x6b')]);router[_0x43b4('0x69')]('/:id',auth['isAuthenticated'](),controller[_0x43b4('0x6c')]);router['delete'](_0x43b4('0x55'),auth[_0x43b4('0xb')](),controller['removeChatInteractions']);router[_0x43b4('0x69')](_0x43b4('0x6d'),auth[_0x43b4('0xb')](),controller['removeMailInteractions']);router[_0x43b4('0x69')](_0x43b4('0x57'),auth[_0x43b4('0xb')](),controller[_0x43b4('0x6e')]);router['delete'](_0x43b4('0x6f'),auth[_0x43b4('0xb')](),controller[_0x43b4('0x70')]);router['delete'](_0x43b4('0x71'),auth[_0x43b4('0xb')](),controller[_0x43b4('0x72')]);router['delete'](_0x43b4('0x73'),auth['isAuthenticated'](),controller[_0x43b4('0x74')]);router[_0x43b4('0x69')]('/:id/fax_accounts',auth[_0x43b4('0xb')](),controller[_0x43b4('0x75')]);router[_0x43b4('0x69')](_0x43b4('0x31'),auth[_0x43b4('0xb')](),controller[_0x43b4('0x76')]);router['delete'](_0x43b4('0x33'),auth[_0x43b4('0xb')](),controller['removeOpenchannelAccounts']);router[_0x43b4('0x69')](_0x43b4('0x35'),auth[_0x43b4('0xb')](),controller[_0x43b4('0x77')]);router[_0x43b4('0x69')](_0x43b4('0x37'),auth[_0x43b4('0xb')](),controller[_0x43b4('0x78')]);router['delete'](_0x43b4('0x39'),auth[_0x43b4('0xb')](),controller[_0x43b4('0x79')]);router[_0x43b4('0x69')]('/:id/square_projects',auth[_0x43b4('0xb')](),controller[_0x43b4('0x7a')]);router[_0x43b4('0x69')](_0x43b4('0x64'),auth[_0x43b4('0xb')](),controller['removeApiKey']);module[_0x43b4('0x7b')]=router; \ No newline at end of file +var _0xc41c=['removeFaxAccounts','removeMailAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','describe','whoami','/presence','show','/:id/avatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','getQueues','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','/:id/mail/interactions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getAgents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','/create_many','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','file','addAvatar','login','/:id/logout','logout','/:id/pause','/:id/unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','/:id/whatsapp_accounts','addWhatsappAccounts','createApiKey','put','/:id','/:id/password','changePassword','delete','/:id/queues','removeQueues','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions'];(function(_0x5e6e06,_0x26983c){var _0x149dc3=function(_0x14442e){while(--_0x14442e){_0x5e6e06['push'](_0x5e6e06['shift']());}};_0x149dc3(++_0x26983c);}(_0xc41c,0x16a));var _0xcc41=function(_0x40015a,_0x415db5){_0x40015a=_0x40015a-0x0;var _0x42f8a4=_0xc41c[_0x40015a];return _0x42f8a4;};'use strict';var multer=require(_0xcc41('0x0'));var util=require(_0xcc41('0x1'));var path=require('path');var timeout=require(_0xcc41('0x2'));var express=require(_0xcc41('0x3'));var router=express[_0xcc41('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcc41('0x5'));var interaction=require(_0xcc41('0x6'));var config=require(_0xcc41('0x7'));var controller=require(_0xcc41('0x8'));router[_0xcc41('0x9')]('/',auth[_0xcc41('0xa')](),controller[_0xcc41('0xb')]);router[_0xcc41('0x9')]('/describe',auth[_0xcc41('0xa')](),controller[_0xcc41('0xc')]);router[_0xcc41('0x9')]('/whoami',auth[_0xcc41('0xa')](),controller[_0xcc41('0xd')]);router['get'](_0xcc41('0xe'),auth['isAuthenticated'](),controller['getPresence']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xcc41('0xf')]);router[_0xcc41('0x9')](_0xcc41('0x10'),controller['getAvatar']);router[_0xcc41('0x9')](_0xcc41('0x11'),auth[_0xcc41('0xa')](),controller[_0xcc41('0x12')]);router[_0xcc41('0x9')](_0xcc41('0x13'),auth['isAuthenticated'](),controller[_0xcc41('0x14')]);router[_0xcc41('0x9')]('/:id/queues',auth[_0xcc41('0xa')](),controller[_0xcc41('0x15')]);router[_0xcc41('0x9')]('/:id/queues_rt',auth[_0xcc41('0xa')](),controller[_0xcc41('0x16')]);router[_0xcc41('0x9')](_0xcc41('0x17'),auth['isAuthenticated'](),controller[_0xcc41('0x18')]);router[_0xcc41('0x9')](_0xcc41('0x19'),auth[_0xcc41('0xa')](),controller['getRecordings']);router[_0xcc41('0x9')]('/:id/screen_recordings',auth['isAuthenticated'](),controller['getScreenRecordings']);router[_0xcc41('0x9')](_0xcc41('0x1a'),auth['isAuthenticated'](),controller[_0xcc41('0x1b')]);router[_0xcc41('0x9')](_0xcc41('0x1c'),auth[_0xcc41('0xa')](),controller['getOpenchannelInteractions']);router[_0xcc41('0x9')](_0xcc41('0x1d'),auth[_0xcc41('0xa')](),controller['getMailInteractions']);router['get'](_0xcc41('0x1e'),auth[_0xcc41('0xa')](),controller['getSmsInteractions']);router[_0xcc41('0x9')](_0xcc41('0x1f'),auth[_0xcc41('0xa')](),controller[_0xcc41('0x20')]);router[_0xcc41('0x9')](_0xcc41('0x21'),auth[_0xcc41('0xa')](),controller[_0xcc41('0x22')]);router[_0xcc41('0x9')](_0xcc41('0x23'),auth[_0xcc41('0xa')](),controller[_0xcc41('0x24')]);router[_0xcc41('0x9')](_0xcc41('0x25'),auth[_0xcc41('0xa')](),controller['getLists']);router['get']('/:id/agents',auth['isAuthenticated'](),controller[_0xcc41('0x26')]);router['get']('/:id/prefixes',auth[_0xcc41('0xa')](),controller[_0xcc41('0x27')]);router['get'](_0xcc41('0x28'),auth['isAuthenticated'](),controller[_0xcc41('0x29')]);router[_0xcc41('0x9')](_0xcc41('0x2a'),auth[_0xcc41('0xa')](),controller[_0xcc41('0x2b')]);router['get']('/:id/openchannel_accounts',auth[_0xcc41('0xa')](),controller['getOpenchannelAccounts']);router[_0xcc41('0x9')](_0xcc41('0x2c'),auth['isAuthenticated'](),controller[_0xcc41('0x2d')]);router[_0xcc41('0x9')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0xcc41('0x2e')]);router[_0xcc41('0x9')]('/:id/whatsapp_accounts',auth[_0xcc41('0xa')](),controller[_0xcc41('0x2f')]);router['get'](_0xcc41('0x30'),auth[_0xcc41('0xa')](),controller[_0xcc41('0x31')]);router[_0xcc41('0x9')](_0xcc41('0x32'),auth[_0xcc41('0xa')](),controller[_0xcc41('0x33')]);router[_0xcc41('0x9')](_0xcc41('0x34'),auth[_0xcc41('0xa')](),controller[_0xcc41('0x35')]);router[_0xcc41('0x36')]('/:id/contacts',auth[_0xcc41('0xa')](),controller[_0xcc41('0x37')]);router['post']('/',auth[_0xcc41('0xa')](),controller['create']);router['post'](_0xcc41('0x38'),auth[_0xcc41('0xa')](),controller[_0xcc41('0x39')]);router[_0xcc41('0x36')]('/:id/queues',auth[_0xcc41('0xa')](),controller[_0xcc41('0x3a')]);var upload=multer({'storage':multer[_0xcc41('0x3b')]({'destination':function(_0x167039,_0x5510b7,_0x7bf465){_0x7bf465(null,path[_0xcc41('0x3c')](config[_0xcc41('0x3d')],_0xcc41('0x3e')));},'filename':function(_0x103160,_0x29015b,_0x4015a1){_0x4015a1(null,util[_0xcc41('0x3f')](_0xcc41('0x40'),Date[_0xcc41('0x41')](),_0x29015b[_0xcc41('0x42')]));}})});router[_0xcc41('0x36')](_0xcc41('0x10'),upload['single'](_0xcc41('0x43')),controller[_0xcc41('0x44')]);router['post']('/:id/login',auth['isAuthenticated'](),controller[_0xcc41('0x45')]);router[_0xcc41('0x36')](_0xcc41('0x46'),auth[_0xcc41('0xa')](),controller[_0xcc41('0x47')]);router['post'](_0xcc41('0x48'),auth[_0xcc41('0xa')](),controller['pause']);router[_0xcc41('0x36')](_0xcc41('0x49'),auth['isAuthenticated'](),controller['unpause']);router[_0xcc41('0x36')](_0xcc41('0x23'),auth[_0xcc41('0xa')](),controller[_0xcc41('0x4a')]);router[_0xcc41('0x36')](_0xcc41('0x4b'),auth[_0xcc41('0xa')](),controller[_0xcc41('0x4c')]);router['post'](_0xcc41('0x4d'),auth[_0xcc41('0xa')](),controller[_0xcc41('0x4e')]);router[_0xcc41('0x36')](_0xcc41('0x4f'),auth[_0xcc41('0xa')](),controller[_0xcc41('0x50')]);router[_0xcc41('0x36')](_0xcc41('0x51'),auth[_0xcc41('0xa')](),controller[_0xcc41('0x52')]);router['post'](_0xcc41('0x53'),auth['isAuthenticated'](),controller['addOpenchannelInteractions']);router[_0xcc41('0x36')](_0xcc41('0x54'),auth['isAuthenticated'](),controller[_0xcc41('0x55')]);router['post']('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0xcc41('0x56')]);router['post'](_0xcc41('0x2a'),auth[_0xcc41('0xa')](),controller[_0xcc41('0x57')]);router[_0xcc41('0x36')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0xcc41('0x58')]);router[_0xcc41('0x36')](_0xcc41('0x2c'),auth[_0xcc41('0xa')](),controller[_0xcc41('0x59')]);router[_0xcc41('0x36')](_0xcc41('0x5a'),auth[_0xcc41('0xa')](),controller[_0xcc41('0x5b')]);router['post'](_0xcc41('0x5c'),auth[_0xcc41('0xa')](),controller[_0xcc41('0x5d')]);router['post']('/:id/square_projects',auth[_0xcc41('0xa')](),controller['addSquareProjects']);router[_0xcc41('0x36')](_0xcc41('0x34'),auth[_0xcc41('0xa')](),controller[_0xcc41('0x5e')]);router[_0xcc41('0x5f')](_0xcc41('0x60'),auth['isAuthenticated'](),controller['update']);router['put'](_0xcc41('0x61'),auth[_0xcc41('0xa')](),controller[_0xcc41('0x62')]);router[_0xcc41('0x63')](_0xcc41('0x64'),auth[_0xcc41('0xa')](),controller[_0xcc41('0x65')]);router[_0xcc41('0x63')](_0xcc41('0x23'),auth[_0xcc41('0xa')](),controller[_0xcc41('0x66')]);router[_0xcc41('0x63')]('/:id',auth[_0xcc41('0xa')](),controller[_0xcc41('0x67')]);router[_0xcc41('0x63')](_0xcc41('0x4b'),auth[_0xcc41('0xa')](),controller[_0xcc41('0x68')]);router[_0xcc41('0x63')](_0xcc41('0x4d'),auth[_0xcc41('0xa')](),controller[_0xcc41('0x69')]);router[_0xcc41('0x63')](_0xcc41('0x4f'),auth[_0xcc41('0xa')](),controller[_0xcc41('0x6a')]);router['delete'](_0xcc41('0x51'),auth[_0xcc41('0xa')](),controller[_0xcc41('0x6b')]);router[_0xcc41('0x63')](_0xcc41('0x53'),auth[_0xcc41('0xa')](),controller[_0xcc41('0x6c')]);router['delete'](_0xcc41('0x54'),auth[_0xcc41('0xa')](),controller[_0xcc41('0x6d')]);router['delete'](_0xcc41('0x28'),auth[_0xcc41('0xa')](),controller[_0xcc41('0x6e')]);router[_0xcc41('0x63')]('/:id/mail_accounts',auth[_0xcc41('0xa')](),controller[_0xcc41('0x6f')]);router[_0xcc41('0x63')]('/:id/openchannel_accounts',auth[_0xcc41('0xa')](),controller['removeOpenchannelAccounts']);router['delete'](_0xcc41('0x2c'),auth[_0xcc41('0xa')](),controller[_0xcc41('0x70')]);router[_0xcc41('0x63')](_0xcc41('0x5a'),auth[_0xcc41('0xa')](),controller[_0xcc41('0x71')]);router[_0xcc41('0x63')]('/:id/whatsapp_accounts',auth[_0xcc41('0xa')](),controller[_0xcc41('0x72')]);router[_0xcc41('0x63')](_0xcc41('0x30'),auth['isAuthenticated'](),controller[_0xcc41('0x73')]);router[_0xcc41('0x63')](_0xcc41('0x34'),auth[_0xcc41('0xa')](),controller[_0xcc41('0x74')]);module[_0xcc41('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 69b8c06..4e3a683 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 _0x70e0=['refuse','originate','uac','uas','fingerprint','update,nonat','TEXT','showWebBar','get','isArray','wss','udp','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','util','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','user','agent','telephone','INTEGER','BOOLEAN','DATE','dynamic','friend','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','join','transport','split','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','ulaw;alaw;gsm','allow','insecure','\x22\x22\x20<>','always','accept'];(function(_0x3de904,_0xda87ab){var _0x349a7f=function(_0x3e7636){while(--_0x3e7636){_0x3de904['push'](_0x3de904['shift']());}};_0x349a7f(++_0xda87ab);}(_0x70e0,0x17b));var _0x070e=function(_0x19e149,_0x2e8603){_0x19e149=_0x19e149-0x0;var _0x322cf4=_0x70e0[_0x19e149];return _0x322cf4;};'use strict';var Sequelize=require(_0x070e('0x0'));var moment=require(_0x070e('0x1'));var util=require(_0x070e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'unique':_0x070e('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x277d32){this[_0x070e('0x5')]('name',_0x277d32);this[_0x070e('0x5')]('defaultuser',_0x277d32);},'comment':_0x070e('0x6')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x56e420){this['setDataValue'](_0x070e('0x7'),_0x56e420);this[_0x070e('0x5')](_0x070e('0x8'),util[_0x070e('0x9')](_0x070e('0xa'),_0x56e420,this[_0x070e('0xb')](_0x070e('0xc'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x070e('0xd'),'validate':{'isEmail':!![]},'set':function(_0x2e3e5e){if(_0x2e3e5e){this[_0x070e('0x5')](_0x070e('0xd'),_0x2e3e5e[_0x070e('0xe')]());}}},'role':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x10'),_0x070e('0x11'),_0x070e('0x12'),_0x070e('0x13')),'allowNull':![]},'password':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':![],'unique':'internal','set':function(_0x4a33d2){this['setDataValue'](_0x070e('0xc'),_0x4a33d2);this[_0x070e('0x5')]('accountcode',_0x4a33d2);this['setDataValue'](_0x070e('0x8'),util[_0x070e('0x9')](_0x070e('0xa'),this[_0x070e('0xb')]('fullname'),_0x4a33d2));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x070e('0x3')]},'mobile':{'type':Sequelize[_0x070e('0x3')]},'address':{'type':Sequelize[_0x070e('0x3')]},'zipcode':{'type':Sequelize[_0x070e('0x3')]},'userpic':{'type':Sequelize[_0x070e('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x070e('0x3')]},'online':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x070e('0x16')]},'voicePause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x070e('0x3')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x070e('0x16')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x070e('0x14')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x070e('0x17')},'ipaddr':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x070e('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x18'),_0x070e('0x11'),_0x070e('0x19')),'allowNull':!![],'defaultValue':_0x070e('0x18')},'context':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x1a'),_0x070e('0x1b'),'ALLOWED_FAILED_SCREEN','ALLOWED',_0x070e('0x1c'),_0x070e('0x1d'),_0x070e('0x1e'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'udp','set':function(_0x59c5b4){this[_0x070e('0x5')]('transport',_0x59c5b4?_0x59c5b4[_0x070e('0x1f')](','):null);},'get':function(){return this[_0x070e('0xb')]('transport')?this['getDataValue'](_0x070e('0x20'))[_0x070e('0x21')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0x070e('0x22'),_0x070e('0x23'),_0x070e('0x24'),_0x070e('0x25'),_0x070e('0x26')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no',_0x070e('0x28'),_0x070e('0x29'),_0x070e('0x2a')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x070e('0x2b'),'set':function(_0x34746e){this['setDataValue']('nat',_0x34746e?_0x34746e['join'](','):null);},'get':function(){return this[_0x070e('0xb')](_0x070e('0x2c'))?this[_0x070e('0xb')](_0x070e('0x2c'))[_0x070e('0x21')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x070e('0x3')]},'namedcallgroup':{'type':Sequelize[_0x070e('0x3')]},'pickupgroup':{'type':Sequelize[_0x070e('0x3')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x070e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x070e('0x3')]},'disallow':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'defaultValue':_0x070e('0x2d'),'set':function(_0x4800a9){this[_0x070e('0x5')]('allow',_0x4800a9?_0x4800a9[_0x070e('0x1f')](';'):_0x070e('0x2d'));},'get':function(){return this[_0x070e('0xb')](_0x070e('0x2e'))?this[_0x070e('0xb')]('allow')[_0x070e('0x21')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![],'set':function(_0x38879f){this['setDataValue'](_0x070e('0x2f'),_0x38879f?_0x38879f[_0x070e('0x1f')](','):null);},'get':function(){return this[_0x070e('0xb')](_0x070e('0x2f'))?this['getDataValue'](_0x070e('0x2f'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x070e('0x30')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':_0x070e('0x27')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no',_0x070e('0x31')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x32'),_0x070e('0x33'),_0x070e('0x34')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x35'),'uas'),'allowNull':!![],'defaultValue':_0x070e('0x36')},'t38pt_usertpsource':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':_0x070e('0x27')},'keepalive':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no',_0x070e('0x37'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x070e('0xf')]('active','passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no',_0x070e('0x28'),'update',_0x070e('0x38')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x070e('0x16')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x070e('0x39')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x4cb86f){this['setDataValue'](_0x070e('0x3a'),_0x4cb86f);var _0x1ae5cb=this[_0x070e('0x3b')]({'plain':!![]});switch(_0x4cb86f){case 0x0:case 0x1:var _0x122198=_0x1ae5cb[_0x070e('0x20')]?_[_0x070e('0x3c')](_0x1ae5cb['transport'])?_0x1ae5cb[_0x070e('0x20')]['join']():_0x1ae5cb[_0x070e('0x20')]:'udp';if(_0x122198===_0x070e('0x3d')){_0x122198=_0x070e('0x3e');}this['setDataValue'](_0x070e('0x20'),_0x122198);this['setDataValue'](_0x070e('0x3f'),'no');this[_0x070e('0x5')](_0x070e('0x40'),null);this[_0x070e('0x5')](_0x070e('0x41'),null);this[_0x070e('0x5')](_0x070e('0x42'),null);this[_0x070e('0x5')](_0x070e('0x43'),null);this[_0x070e('0x5')](_0x070e('0x44'),null);this[_0x070e('0x5')](_0x070e('0x45'),null);this[_0x070e('0x5')]('dtlscertfile',null);this[_0x070e('0x5')](_0x070e('0x46'),null);this[_0x070e('0x5')](_0x070e('0x47'),'no');break;case 0x2:this['setDataValue'](_0x070e('0x20'),_0x070e('0x3d'));this[_0x070e('0x5')](_0x070e('0x3f'),_0x070e('0x27'));this[_0x070e('0x5')]('avpf',_0x070e('0x27'));this[_0x070e('0x5')](_0x070e('0x41'),_0x070e('0x27'));this['setDataValue'](_0x070e('0x42'),'yes');this[_0x070e('0x5')](_0x070e('0x43'),_0x070e('0x27'));this[_0x070e('0x5')](_0x070e('0x44'),'no');this['setDataValue'](_0x070e('0x45'),_0x070e('0x48'));this[_0x070e('0x5')](_0x070e('0x49'),_0x1ae5cb['dtlscertfile']||_0x070e('0x4a'));this['setDataValue'](_0x070e('0x46'),_0x1ae5cb[_0x070e('0x46')]||_0x070e('0x4b'));this['setDataValue'](_0x070e('0x47'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0x070e('0x39')],'set':function(_0x5ce157){this[_0x070e('0x5')](_0x070e('0x4c'),_0x5ce157?_0x5ce157['join'](','):[]);},'get':function(){return this[_0x070e('0xb')]('permissions')?_[_0x070e('0x4d')](this[_0x070e('0xb')]('permissions')['split'](','),function(_0x29ee66){return parseInt(_0x29ee66,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x070e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x070e('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x070e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x070e('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x070e('0x4e')],'get':function(){return this[_0x070e('0xb')](_0x070e('0x4f'))?this[_0x070e('0xb')](_0x070e('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0x070e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x4f720f){if(typeof _0x4f720f==='string'){var _0x1624cd=_0x4f720f==='1'?!![]:_0x4f720f==='0'?![]:_0x4f720f===_0x070e('0x50')?!![]:_0x4f720f===_0x070e('0x51')?![]:![];this[_0x070e('0x5')]('screenrecording',_0x1624cd);}else{this[_0x070e('0x5')](_0x070e('0x52'),_0x4f720f);}}},'blocked':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![],'set':function(_0xd74f9c){this[_0x070e('0x5')](_0x070e('0x53'),_0xd74f9c);if(_0xd74f9c===!![]){this['setDataValue'](_0x070e('0x54'),moment());this['setDataValue'](_0x070e('0x55'),0x0);}else{this[_0x070e('0x5')](_0x070e('0x54'),null);}}},'blockedAt':{'type':Sequelize[_0x070e('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x070e('0x14')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcb91=['toLowerCase','ENUM','admin','user','local','INTEGER','accountcode','\x22%s\x22\x20<%s>','getDataValue','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','insecure','never','always','accept','originate','uac','uas','fingerprint','certificate','active','passive','update','showWebBar','get','isArray','encryption','avpf','icesupport','dtlsverify','dtlssetup','rtcp_mux','wss','force_avp','dtlscertfile','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','loginAttempts','UNSIGNED','util','lodash','exports','STRING','setDataValue','defaultuser','fullname','format','internal','email'];(function(_0x47ebc2,_0x4c356d){var _0x4793d9=function(_0x570a81){while(--_0x570a81){_0x47ebc2['push'](_0x47ebc2['shift']());}};_0x4793d9(++_0x4c356d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x304b67,_0x31cb39){_0x304b67=_0x304b67-0x0;var _0x493afb=_0xcb91[_0x304b67];return _0x493afb;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var util=require(_0x1cb9('0x0'));var _=require(_0x1cb9('0x1'));module[_0x1cb9('0x2')]={'name':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x8c392f){this[_0x1cb9('0x4')]('name',_0x8c392f);this[_0x1cb9('0x4')](_0x1cb9('0x5'),_0x8c392f);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'set':function(_0x3f7deb){this['setDataValue'](_0x1cb9('0x6'),_0x3f7deb);this[_0x1cb9('0x4')]('callerid',util[_0x1cb9('0x7')]('\x22%s\x22\x20<%s>',_0x3f7deb,this['getDataValue'](_0x1cb9('0x8'))));}},'alias':{'type':Sequelize[_0x1cb9('0x3')]},'email':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'unique':_0x1cb9('0x9'),'validate':{'isEmail':!![]},'set':function(_0x2fc627){if(_0x2fc627){this['setDataValue'](_0x1cb9('0x9'),_0x2fc627[_0x1cb9('0xa')]());}}},'role':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0xc'),_0x1cb9('0xd'),'agent','telephone'),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':_0x1cb9('0xe')},'internal':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':![],'unique':_0x1cb9('0x8'),'set':function(_0x56884d){this[_0x1cb9('0x4')](_0x1cb9('0x8'),_0x56884d);this[_0x1cb9('0x4')](_0x1cb9('0x10'),_0x56884d);this[_0x1cb9('0x4')]('callerid',util['format'](_0x1cb9('0x11'),this[_0x1cb9('0x12')](_0x1cb9('0x6')),_0x56884d));}},'salt':{'type':Sequelize[_0x1cb9('0x3')]},'phone':{'type':Sequelize[_0x1cb9('0x3')]},'mobile':{'type':Sequelize[_0x1cb9('0x3')]},'address':{'type':Sequelize[_0x1cb9('0x3')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x1cb9('0x3')]},'country':{'type':Sequelize[_0x1cb9('0x3')]},'online':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x1cb9('0x14')]},'voicePause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':_0x1cb9('0x15')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x1cb9('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'description':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x1cb9('0x16')},'ipaddr':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x17'),_0x1cb9('0xd'),_0x1cb9('0x18')),'allowNull':!![],'defaultValue':_0x1cb9('0x17')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x1cb9('0x19')},'callingpres':{'type':Sequelize['ENUM'](_0x1cb9('0x1a'),'ALLOWED_PASSED_SCREEN',_0x1cb9('0x1b'),_0x1cb9('0x1c'),_0x1cb9('0x1d'),_0x1cb9('0x1e'),'PROHIB_FAILED_SCREEN',_0x1cb9('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'defaultValue':'udp','set':function(_0x3a3543){this['setDataValue'](_0x1cb9('0x20'),_0x3a3543?_0x3a3543[_0x1cb9('0x21')](','):null);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x20'))?this['getDataValue'](_0x1cb9('0x20'))[_0x1cb9('0x22')](','):null;},'comment':_0x1cb9('0x23')},'dtmfmode':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x24'),_0x1cb9('0x25'),_0x1cb9('0x26'),_0x1cb9('0x27'),_0x1cb9('0x28')),'allowNull':!![],'defaultValue':_0x1cb9('0x24')},'directmedia':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no',_0x1cb9('0x2a'),'update','outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'defaultValue':_0x1cb9('0x2b'),'set':function(_0x35f5e8){this[_0x1cb9('0x4')]('nat',_0x35f5e8?_0x35f5e8[_0x1cb9('0x21')](','):null);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x2c'))?this['getDataValue'](_0x1cb9('0x2c'))['split'](','):null;},'comment':_0x1cb9('0x2d')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x1cb9('0x3')]},'pickupgroup':{'type':Sequelize[_0x1cb9('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x1cb9('0x3')]},'language':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x1cb9('0x3')]},'disallow':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'defaultValue':_0x1cb9('0x2e')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x4111b8){this[_0x1cb9('0x4')](_0x1cb9('0x2f'),_0x4111b8?_0x4111b8[_0x1cb9('0x21')](';'):_0x1cb9('0x30'));},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x2f'))?this['getDataValue'](_0x1cb9('0x2f'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'set':function(_0x1bf51c){this[_0x1cb9('0x4')](_0x1cb9('0x31'),_0x1bf51c?_0x1bf51c['join'](','):null);},'get':function(){return this[_0x1cb9('0x12')]('insecure')?this[_0x1cb9('0x12')](_0x1cb9('0x31'))[_0x1cb9('0x22')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0x1cb9('0x32')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':_0x1cb9('0x29')},'busylevel':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x1cb9('0xb')]('yes','no',_0x1cb9('0x33')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x1cb9('0x34'),'refuse',_0x1cb9('0x35')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x36'),_0x1cb9('0x37')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':_0x1cb9('0x29')},'keepalive':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM']('yes','no',_0x1cb9('0x38'),_0x1cb9('0x39')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x3a'),_0x1cb9('0x3b'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no',_0x1cb9('0x2a'),_0x1cb9('0x3c'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x1cb9('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x1cb9('0x14')]},'passwordResetAt':{'type':Sequelize[_0x1cb9('0x14')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x319358){this[_0x1cb9('0x4')](_0x1cb9('0x3d'),_0x319358);var _0x173db5=this[_0x1cb9('0x3e')]({'plain':!![]});switch(_0x319358){case 0x0:case 0x1:var _0x75c734=_0x173db5[_0x1cb9('0x20')]?_[_0x1cb9('0x3f')](_0x173db5['transport'])?_0x173db5['transport'][_0x1cb9('0x21')]():_0x173db5['transport']:'udp';if(_0x75c734==='wss'){_0x75c734='udp';}this['setDataValue'](_0x1cb9('0x20'),_0x75c734);this[_0x1cb9('0x4')](_0x1cb9('0x40'),'no');this[_0x1cb9('0x4')](_0x1cb9('0x41'),null);this[_0x1cb9('0x4')]('force_avp',null);this[_0x1cb9('0x4')](_0x1cb9('0x42'),null);this['setDataValue']('dtlsenable',null);this[_0x1cb9('0x4')](_0x1cb9('0x43'),null);this[_0x1cb9('0x4')](_0x1cb9('0x44'),null);this[_0x1cb9('0x4')]('dtlscertfile',null);this['setDataValue']('dtlsprivatekey',null);this[_0x1cb9('0x4')](_0x1cb9('0x45'),'no');break;case 0x2:this[_0x1cb9('0x4')](_0x1cb9('0x20'),_0x1cb9('0x46'));this['setDataValue'](_0x1cb9('0x40'),_0x1cb9('0x29'));this['setDataValue']('avpf',_0x1cb9('0x29'));this['setDataValue'](_0x1cb9('0x47'),_0x1cb9('0x29'));this[_0x1cb9('0x4')](_0x1cb9('0x42'),_0x1cb9('0x29'));this[_0x1cb9('0x4')]('dtlsenable',_0x1cb9('0x29'));this[_0x1cb9('0x4')](_0x1cb9('0x43'),'no');this[_0x1cb9('0x4')]('dtlssetup','actpass');this[_0x1cb9('0x4')](_0x1cb9('0x48'),_0x173db5[_0x1cb9('0x48')]||_0x1cb9('0x49'));this[_0x1cb9('0x4')](_0x1cb9('0x4a'),_0x173db5['dtlsprivatekey']||_0x1cb9('0x4b'));this['setDataValue'](_0x1cb9('0x45'),_0x1cb9('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0xf5b006){this[_0x1cb9('0x4')](_0x1cb9('0x4c'),_0xf5b006?_0xf5b006['join'](','):[]);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x4c'))?_[_0x1cb9('0x4d')](this[_0x1cb9('0x12')](_0x1cb9('0x4c'))[_0x1cb9('0x22')](','),function(_0x5a3f1d){return parseInt(_0x5a3f1d,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x1cb9('0x4e')],'get':function(){return this['getDataValue'](_0x1cb9('0x4f'))?this['getDataValue'](_0x1cb9('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![],'set':function(_0x4f8d74){if(typeof _0x4f8d74===_0x1cb9('0x50')){var _0x4cb014=_0x4f8d74==='1'?!![]:_0x4f8d74==='0'?![]:_0x4f8d74===_0x1cb9('0x51')?!![]:_0x4f8d74===_0x1cb9('0x52')?![]:![];this[_0x1cb9('0x4')](_0x1cb9('0x53'),_0x4cb014);}else{this[_0x1cb9('0x4')](_0x1cb9('0x53'),_0x4f8d74);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x3db146){this[_0x1cb9('0x4')]('blocked',_0x3db146);if(_0x3db146===!![]){this[_0x1cb9('0x4')](_0x1cb9('0x54'),moment());this[_0x1cb9('0x4')](_0x1cb9('0x55'),0x0);}else{this[_0x1cb9('0x4')](_0x1cb9('0x54'),null);}}},'blockedAt':{'type':Sequelize[_0x1cb9('0x14')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x1cb9('0xf')](0x5)[_0x1cb9('0x56')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index fe594ec..83a5113 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 _0x1e07=['path','squel','jayson/promise','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../errors/api','APIBadRequestError','APINotFoundError','../../mysqldb','socket.io-emitter','redis','register','defaults','localhost','http','request','User,\x20%s,\x20%s','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','update','then','emit','userNotification:recalc:','destroy','get','role','admin','Users','user','telephone','filter','ignore','map','includes','value','name','UserProfileResource','stack','send','index','rawAttributes','type','key','password','salt','getOptions','User','query','includeAll','include','userSetting','UserSetting','attributes','push','findAll','rows','openTabs','true','length','chat','sms','dataValues','fax','openchannel','whatsapp','all','show','params','differenceBy','keys','filters','intersection','model','fields','merge','find','mail','body','describe','addContacts','ids','omit','internal','Setting','findById','validatePasswordPattern','max','min_internal','isNil','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','sequelize','QueryTypes','SELECT','from','voicemail','mailbox','fullname','email','permissions','101','102','103','113','105','106','107','108','109','100','114','create','agent','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','VoiceMail','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','each','Agents','Telephones','isEmpty','compact','oldPassword','newPassword','Sequelize','ValidationError','authenticate','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','passwordHistoryLimit','securePassword','enforcePasswordHistory','previousPasswords','validatePasswordHistory','addQueues','channel','online','loginInPause','interface','isValidChannel','Unknown\x20channel','capitalize','toLowerCase','Queues','penalty','spread','QueueId','VoiceQueue','format','SIP/%s','voicePause','UserVoiceQueueRt','upsert','removeQueues','remove','Queue:remove','voice','addAvatar','userpic','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','SmsOpenTabs','WHATSAPP','concat','getContacts','sort','where','pick','CmList','List','Tag','color','tag','hasOwnProperty','nolimit','getQueues','findOne','Queue','order','Unknown\x20role','options','getVoiceQueuesRt','getGroups','getRecordings','UserId','VoiceRecording','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','getMailInteractions','getSmsInteractions','SmsInteraction','getFaxInteractions','getWhatsappInteractions','login','phone','LOCAL/%s@from-sip/n','intrf','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','LOGIN','device','PAUSE','LOGININPAUSE','isMiddleware','resolve','logout','pause','QueuePause','DEFAULT\x20PAUSE','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsapppause','pauseType','lastPauseAt','manual','set','%s%s','Pause','unpause','getTeams','Team','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','User\x20with\x20id\x20%s\x20not\x20found','flattenDeep','addAgent','getDataValue','Voice','TeamVoicePrefix','UserVoicePrefix','removeTeams','Query\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','removeAgent','getLists','getAgents','values','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','isArray','user_has_chat_interactions:remove','addMailInteractions','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','VoicePrefix','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$gt','$lt','$lte','$ne','$not','$between','$notBetween','$in','$notIn','$like','$iLike','$overlap','$contains','$contained','$any','lastName','CmContact','dialActive','getApiKey','retrieveApiKey','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','token','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','queues','teams','flatten','lower','col','toString','asc','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','client','idle','unknown','unavailable','ringing','voiceStatus','slice','charAt','toUpperCase','field','ui.','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','moment','util'];(function(_0x6317d6,_0x424384){var _0x5add4d=function(_0x176118){while(--_0x176118){_0x6317d6['push'](_0x6317d6['shift']());}};_0x5add4d(++_0x424384);}(_0x1e07,0x197));var _0x71e0=function(_0x503262,_0x1d774c){_0x503262=_0x503262-0x0;var _0x1d49d9=_0x1e07[_0x503262];return _0x1d49d9;};'use strict';var moment=require(_0x71e0('0x0'));var BPromise=require('bluebird');var util=require(_0x71e0('0x1'));var path=require(_0x71e0('0x2'));var fs=require('fs');var _=require('lodash');var squel=require(_0x71e0('0x3'));var jayson=require(_0x71e0('0x4'));var Redis=require(_0x71e0('0x5'));var authService=require(_0x71e0('0x6'));var qs=require(_0x71e0('0x7'));var logger=require(_0x71e0('0x8'))(_0x71e0('0x9'));var utils=require(_0x71e0('0xa'));var config=require(_0x71e0('0xb'));var licenseUtil=require(_0x71e0('0xc'));var APIBadRequestError=require(_0x71e0('0xd'))[_0x71e0('0xe')];var APINotFoundError=require(_0x71e0('0xd'))[_0x71e0('0xf')];var APIHandleError=require('../../errors/api')['handleError'];var db=require(_0x71e0('0x10'))['db'];var socket=require(_0x71e0('0x11'))(new Redis(config[_0x71e0('0x12')]));require('./user.socket')[_0x71e0('0x13')](socket);config[_0x71e0('0x12')]=_[_0x71e0('0x14')](config[_0x71e0('0x12')],{'host':_0x71e0('0x15'),'port':0x18eb});var client=jayson['client'][_0x71e0('0x16')]({'port':0x232a});var values;function respondWithRpcPromise(_0x40cab6,_0x4b891b,_0x4c43ed,_0x3c4905){return new BPromise(function(_0x33e206,_0x1bf018){var _0xdc9910=_0x3c4905||client;return _0xdc9910[_0x71e0('0x17')](_0x40cab6,_0x4c43ed)['then'](function(_0x16a5cb){logger['info'](_0x71e0('0x18'),_0x4b891b,'request\x20sent');logger[_0x71e0('0x19')](_0x71e0('0x1a'),_0x4b891b,'request\x20sent',JSON[_0x71e0('0x1b')](_0x16a5cb));if(_0x16a5cb[_0x71e0('0x1c')]){if(_0x16a5cb[_0x71e0('0x1c')]['code']===0x1f4){logger['error'](_0x71e0('0x18'),_0x4b891b,_0x16a5cb[_0x71e0('0x1c')][_0x71e0('0x1d')]);return _0x1bf018(_0x16a5cb['error'][_0x71e0('0x1d')]);}logger[_0x71e0('0x1c')](_0x71e0('0x18'),_0x4b891b,_0x16a5cb[_0x71e0('0x1c')][_0x71e0('0x1d')]);return _0x33e206(_0x16a5cb[_0x71e0('0x1c')][_0x71e0('0x1d')]);}else{logger[_0x71e0('0x1e')](_0x71e0('0x18'),_0x4b891b,_0x71e0('0x1f'));_0x33e206(_0x16a5cb[_0x71e0('0x20')][_0x71e0('0x1d')]);}})[_0x71e0('0x21')](function(_0x585ef6){logger['error'](_0x71e0('0x18'),_0x4b891b,_0x585ef6);_0x1bf018(_0x585ef6);});});}function respondWithStatusCode(_0x114c4,_0x191909){_0x191909=_0x191909||0xcc;return function(_0x1c2653){if(_0x1c2653){return _0x114c4[_0x71e0('0x22')](_0x191909);}return _0x114c4[_0x71e0('0x23')](_0x191909)[_0x71e0('0x24')]();};}function respondWithResult(_0x2bc9b7,_0x4db8a2){_0x4db8a2=_0x4db8a2||0xc8;return function(_0x21ece1){if(_0x21ece1){return _0x2bc9b7['status'](_0x4db8a2)[_0x71e0('0x25')](_0x21ece1);}};}function respondWithFilteredResult(_0x8ab7fc,_0x5d1fb2){return function(_0x389f4b){if(_0x389f4b){var _0x3be054=typeof _0x5d1fb2[_0x71e0('0x26')]===_0x71e0('0x27')&&typeof _0x5d1fb2['limit']===_0x71e0('0x27');var _0x15231d=_0x389f4b['count'];var _0x174c89=_0x3be054?0x0:_0x5d1fb2[_0x71e0('0x26')];var _0x74062b=_0x3be054?_0x389f4b[_0x71e0('0x28')]:_0x5d1fb2['offset']+_0x5d1fb2[_0x71e0('0x29')];var _0x34aee7;if(_0x74062b>=_0x15231d){_0x74062b=_0x15231d;_0x34aee7=0xc8;}else{_0x34aee7=0xce;}_0x8ab7fc[_0x71e0('0x23')](_0x34aee7);return _0x8ab7fc['set'](_0x71e0('0x2a'),_0x174c89+'-'+_0x74062b+'/'+_0x15231d)[_0x71e0('0x25')](_0x389f4b);}return null;};}function saveUpdates(_0x3bc93a){return function(_0x42cf14){if(_0x42cf14){return _0x42cf14[_0x71e0('0x2b')](_0x3bc93a)[_0x71e0('0x2c')](function(_0x44df9c){socket[_0x71e0('0x2d')](_0x71e0('0x2e')+_0x44df9c['id'],{});return _0x44df9c;});}return null;};}function removeEntity(_0x31880a){return function(_0x14f10d){if(_0x14f10d){return _0x14f10d[_0x71e0('0x2f')]()['then'](function(){var _0x357cca=_0x14f10d[_0x71e0('0x30')]({'plain':!![]});if(_0x357cca[_0x71e0('0x31')]===_0x71e0('0x32'))return;var _0x15fbb1=[{'name':_0x71e0('0x33'),'value':_0x71e0('0x34'),'ignore':!![]},{'name':'Agents','value':'agent','ignore':![]},{'name':'Telephones','value':_0x71e0('0x35'),'ignore':![]}];var _0x46f914=_(_0x15fbb1)[_0x71e0('0x36')](_0x71e0('0x37'))[_0x71e0('0x38')]('value')['value']();if(_[_0x71e0('0x39')](_0x46f914,_0x357cca[_0x71e0('0x31')])){return;}var _0x1d04d4=_['find'](_0x15fbb1,[_0x71e0('0x3a'),_0x357cca[_0x71e0('0x31')]])[_0x71e0('0x3b')];return db[_0x71e0('0x3c')][_0x71e0('0x2f')]({'where':{'type':_0x1d04d4,'resourceId':_0x357cca['id']}})[_0x71e0('0x2c')](function(){return _0x14f10d;});})[_0x71e0('0x2c')](function(){_0x31880a[_0x71e0('0x23')](0xcc)[_0x71e0('0x24')]();});}};}function handleEntityNotFound(_0x389da1){return function(_0x4df36b){if(!_0x4df36b){_0x389da1['sendStatus'](0x194);}return _0x4df36b;};}function handleError(_0x546e45,_0x15e362){_0x15e362=_0x15e362||0x1f4;return function(_0x1e8c67){logger[_0x71e0('0x1c')](_0x1e8c67[_0x71e0('0x3d')]);if(_0x1e8c67[_0x71e0('0x3b')]){delete _0x1e8c67['name'];}_0x546e45['status'](_0x15e362)[_0x71e0('0x3e')](_0x1e8c67);};}exports[_0x71e0('0x3f')]=function(_0x275a6,_0x29d305){var _0x22f125={},_0x1dae64={'count':0x0,'rows':[]};var _0x297392=_(db['User'][_0x71e0('0x40')])[_0x71e0('0x38')](function(_0x5ccede){return{'name':_0x5ccede['fieldName'],'type':_0x5ccede[_0x71e0('0x41')][_0x71e0('0x42')]};})[_0x71e0('0x36')](function(_0x50f6e8){return!_[_0x71e0('0x39')]([_0x71e0('0x43'),_0x71e0('0x44')],_0x50f6e8['name']);})[_0x71e0('0x3a')]();_0x22f125=qs[_0x71e0('0x45')](_0x297392,_0x275a6);var _0x1c4056={'where':_0x22f125['where']};return db[_0x71e0('0x46')][_0x71e0('0x28')](_0x1c4056)[_0x71e0('0x2c')](function(_0x2c4865){_0x1dae64[_0x71e0('0x28')]=_0x2c4865;if(_0x275a6[_0x71e0('0x47')][_0x71e0('0x48')]){_0x22f125[_0x71e0('0x49')]=[{'all':!![]}];}if(_0x275a6[_0x71e0('0x47')][_0x71e0('0x4a')]==='true'){_0x22f125['include']=[{'model':db[_0x71e0('0x4b')],'as':_0x71e0('0x4a')}];}if(!_['includes'](_0x22f125[_0x71e0('0x4c')],'id')){_0x22f125[_0x71e0('0x4c')][_0x71e0('0x4d')]('id');}return db[_0x71e0('0x46')][_0x71e0('0x4e')](_0x22f125);})[_0x71e0('0x2c')](function(_0x526307){_0x1dae64[_0x71e0('0x4f')]=_0x526307;if(_0x275a6[_0x71e0('0x47')][_0x71e0('0x50')]===_0x71e0('0x51')){var _0x64d55f=[];for(var _0x5c6e84=0x0;_0x5c6e84<_0x1dae64[_0x71e0('0x4f')][_0x71e0('0x52')];_0x5c6e84++){_0x64d55f[_0x71e0('0x4d')](get_open_tabs(_0x71e0('0x53'),_0x1dae64['rows'][_0x5c6e84]['dataValues']));_0x64d55f[_0x71e0('0x4d')](get_open_tabs(_0x71e0('0x54'),_0x1dae64[_0x71e0('0x4f')][_0x5c6e84][_0x71e0('0x55')]));_0x64d55f[_0x71e0('0x4d')](get_open_tabs(_0x71e0('0x56'),_0x1dae64[_0x71e0('0x4f')][_0x5c6e84][_0x71e0('0x55')]));_0x64d55f[_0x71e0('0x4d')](get_open_tabs('mail',_0x1dae64[_0x71e0('0x4f')][_0x5c6e84][_0x71e0('0x55')]));_0x64d55f['push'](get_open_tabs(_0x71e0('0x57'),_0x1dae64['rows'][_0x5c6e84]['dataValues']));_0x64d55f[_0x71e0('0x4d')](get_open_tabs(_0x71e0('0x58'),_0x1dae64['rows'][_0x5c6e84][_0x71e0('0x55')]));}return BPromise[_0x71e0('0x59')](_0x64d55f)['then'](function(){return _0x1dae64;});}else{return _0x1dae64;}})[_0x71e0('0x2c')](respondWithFilteredResult(_0x29d305,_0x22f125))[_0x71e0('0x21')](handleError(_0x29d305,null));};exports[_0x71e0('0x5a')]=function(_0x2344fa,_0x55d334){var _0x1c4e76={'raw':![],'where':{'id':_0x2344fa[_0x71e0('0x5b')]['id']}},_0x307571={};_0x307571['model']=_[_0x71e0('0x5c')](_['keys'](db[_0x71e0('0x46')][_0x71e0('0x40')]),[_0x71e0('0x43'),_0x71e0('0x44')]);_0x307571['query']=_[_0x71e0('0x5d')](_0x2344fa['query']);_0x307571[_0x71e0('0x5e')]=_[_0x71e0('0x5f')](_0x307571[_0x71e0('0x60')],_0x307571[_0x71e0('0x47')]);_0x1c4e76[_0x71e0('0x4c')]=_['intersection'](_0x307571[_0x71e0('0x60')],qs['fields'](_0x2344fa[_0x71e0('0x47')][_0x71e0('0x61')]));_0x1c4e76[_0x71e0('0x4c')]=_0x1c4e76[_0x71e0('0x4c')][_0x71e0('0x52')]?_0x1c4e76[_0x71e0('0x4c')]:_0x307571[_0x71e0('0x60')];if(_0x2344fa['query'][_0x71e0('0x48')]){_0x1c4e76[_0x71e0('0x49')]=[{'all':!![]}];}if(_0x2344fa[_0x71e0('0x47')][_0x71e0('0x4a')]===_0x71e0('0x51')){_0x1c4e76[_0x71e0('0x49')]=[{'model':db[_0x71e0('0x4b')],'as':_0x71e0('0x4a')}];}_0x1c4e76=_[_0x71e0('0x62')]({},_0x1c4e76,_0x2344fa['options']);if(!_[_0x71e0('0x39')](_0x1c4e76['attributes'],'id')){_0x1c4e76[_0x71e0('0x4c')][_0x71e0('0x4d')]('id');}return db[_0x71e0('0x46')][_0x71e0('0x63')](_0x1c4e76)[_0x71e0('0x2c')](handleEntityNotFound(_0x55d334,null))['then'](function(_0x3cb17e){var _0x355344=[];values=_0x3cb17e;if(_0x2344fa['query'][_0x71e0('0x50')]===_0x71e0('0x51')){_0x355344[_0x71e0('0x4d')](get_open_tabs('chat',_0x3cb17e[_0x71e0('0x55')]));_0x355344[_0x71e0('0x4d')](get_open_tabs('sms',_0x3cb17e['dataValues']));_0x355344['push'](get_open_tabs(_0x71e0('0x57'),_0x3cb17e['dataValues']));_0x355344['push'](get_open_tabs(_0x71e0('0x58'),_0x3cb17e[_0x71e0('0x55')]));_0x355344[_0x71e0('0x4d')](get_open_tabs(_0x71e0('0x56'),_0x3cb17e['dataValues']));_0x355344[_0x71e0('0x4d')](get_open_tabs(_0x71e0('0x64'),_0x3cb17e[_0x71e0('0x55')]));return BPromise[_0x71e0('0x59')](_0x355344);}else{return values;}})[_0x71e0('0x2c')](function(){return values;})[_0x71e0('0x2c')](respondWithResult(_0x55d334,null))[_0x71e0('0x21')](handleError(_0x55d334,null));};exports[_0x71e0('0x2b')]=function(_0x4fe00c,_0x4bc64f){if(_0x4fe00c[_0x71e0('0x65')]['id']){delete _0x4fe00c['body']['id'];}delete _0x4fe00c[_0x71e0('0x65')][_0x71e0('0x31')];return db[_0x71e0('0x46')]['find']({'where':{'id':_0x4fe00c['params']['id']}})['then'](handleEntityNotFound(_0x4bc64f,null))[_0x71e0('0x2c')](saveUpdates(_0x4fe00c[_0x71e0('0x65')],null))[_0x71e0('0x2c')](respondWithResult(_0x4bc64f,null))['catch'](handleError(_0x4bc64f,null));};exports[_0x71e0('0x66')]=function(_0x22e814,_0x291217){return db[_0x71e0('0x46')][_0x71e0('0x66')]()[_0x71e0('0x2c')](respondWithResult(_0x291217,null))['catch'](handleError(_0x291217,null));};exports['addContacts']=function(_0x4b9829,_0x5e4732){return db['User'][_0x71e0('0x63')]({'where':{'id':_0x4b9829['params']['id']}})[_0x71e0('0x2c')](handleEntityNotFound(_0x5e4732,null))[_0x71e0('0x2c')](function(_0x365ae9){if(_0x365ae9){return _0x365ae9[_0x71e0('0x67')](_0x4b9829[_0x71e0('0x65')][_0x71e0('0x68')],_[_0x71e0('0x69')](_0x4b9829['body'],[_0x71e0('0x68'),'id'])||{});}})[_0x71e0('0x2c')](respondWithResult(_0x5e4732,null))[_0x71e0('0x21')](handleError(_0x5e4732,null));};function validateUser(_0x9da2a2){return new BPromise(function(_0x20810c,_0x46f125){if(_0x9da2a2[_0x71e0('0x6a')])return _0x20810c(_0x9da2a2);return db[_0x71e0('0x6b')][_0x71e0('0x6c')](0x1)[_0x71e0('0x2c')](function(_0x11a432){if(_0x11a432['securePassword'])authService[_0x71e0('0x6d')](_0x9da2a2['password']);db['User'][_0x71e0('0x6e')](_0x71e0('0x6a'))[_0x71e0('0x2c')](function(_0x191edb){if(_['isNil'](_0x191edb)){_0x9da2a2[_0x71e0('0x6a')]=_0x11a432[_0x71e0('0x6f')]||0x1;return;}if(_[_0x71e0('0x70')](_0x11a432[_0x71e0('0x6f')])||_0x11a432[_0x71e0('0x6f')]===_0x191edb){_0x9da2a2[_0x71e0('0x6a')]=_0x191edb+0x1;return;}if(_0x11a432[_0x71e0('0x6f')]>_0x191edb){_0x9da2a2['internal']=_0x11a432[_0x71e0('0x6f')];return;}return db['sequelize'][_0x71e0('0x47')](_0x71e0('0x71'),{'type':db[_0x71e0('0x72')][_0x71e0('0x73')][_0x71e0('0x74')]})['then'](function(_0x3257cd){if(_0x3257cd&&_0x3257cd[_0x71e0('0x52')]){for(var _0xa19b72=0x0,_0x2eff9b=_0x3257cd[_0x71e0('0x52')];_0xa19b72<_0x2eff9b&&_[_0x71e0('0x70')](_0x9da2a2[_0x71e0('0x6a')]);_0xa19b72++){if(_0x11a432['min_internal']<=_0x3257cd[_0xa19b72]['from']){_0x9da2a2[_0x71e0('0x6a')]=_0x3257cd[_0xa19b72][_0x71e0('0x75')];}else if(_0x11a432[_0x71e0('0x6f')]>_0x3257cd[_0xa19b72][_0x71e0('0x75')]&&_0x11a432[_0x71e0('0x6f')]<=_0x3257cd[_0xa19b72]['to']){_0x9da2a2[_0x71e0('0x6a')]=_0x11a432[_0x71e0('0x6f')];}}}if(_[_0x71e0('0x70')](_0x9da2a2[_0x71e0('0x6a')])){_0x9da2a2['internal']=_0x191edb+0x1;}return _0x20810c(_0x9da2a2);});});})[_0x71e0('0x21')](function(_0x2b8101){_0x46f125(_0x2b8101);});});}function updateUser(_0x1e5103){return new BPromise(function(_0x4291fb,_0x1c59e1){try{if(_0x1e5103[_0x71e0('0x76')]){_0x1e5103[_0x71e0('0x77')]=_0x1e5103[_0x71e0('0x6a')];_0x1e5103['VoiceMail']={'mailbox':_0x1e5103[_0x71e0('0x6a')],'password':_0x1e5103[_0x71e0('0x43')],'fullname':_0x1e5103[_0x71e0('0x78')],'email':_0x1e5103[_0x71e0('0x79')]};}if(_0x1e5103[_0x71e0('0x31')]==='agent'){if(!_0x1e5103['permissions'])_0x1e5103[_0x71e0('0x7a')]=[_0x71e0('0x7b'),_0x71e0('0x7c'),_0x71e0('0x7d'),_0x71e0('0x7e'),'110','104',_0x71e0('0x7f'),_0x71e0('0x80'),_0x71e0('0x81'),_0x71e0('0x82'),_0x71e0('0x83'),_0x71e0('0x84'),'111',_0x71e0('0x85'),'115'];}_0x4291fb(_0x1e5103);}catch(_0x35e82a){_0x1c59e1(_0x35e82a);}});}exports[_0x71e0('0x86')]=function(_0x3d3de6,_0x331c45){if(_0x3d3de6[_0x71e0('0x34')][_0x71e0('0x31')]===_0x71e0('0x87'))throw new Error(_0x71e0('0x88'));if(_0x3d3de6[_0x71e0('0x65')][_0x71e0('0x31')]===_0x71e0('0x34')&&_0x3d3de6[_0x71e0('0x34')][_0x71e0('0x31')]!==_0x71e0('0x32')){throw new Error(_0x71e0('0x89'));}if(_0x3d3de6[_0x71e0('0x65')][_0x71e0('0x31')]===_0x71e0('0x32')&&_0x3d3de6['user']['role']!==_0x71e0('0x32')){throw new Error(_0x71e0('0x8a'));}return licenseUtil[_0x71e0('0x8b')]([_0x3d3de6[_0x71e0('0x65')]])[_0x71e0('0x2c')](function(){return validateUser(_0x3d3de6[_0x71e0('0x65')]);})[_0x71e0('0x2c')](function(_0x3c5f73){return updateUser(_0x3c5f73)[_0x71e0('0x2c')](function(_0x1b2283){if(_0x1b2283[_0x71e0('0x31')]===_0x71e0('0x32')){_0x1b2283[_0x71e0('0x8c')]=_0x3d3de6[_0x71e0('0x34')][_0x71e0('0x8c')];delete _0x1b2283['userProfileId'];}return _0x1b2283;});})[_0x71e0('0x2c')](function(_0x41b1f7){return db[_0x71e0('0x46')][_0x71e0('0x86')](_0x41b1f7,{'include':[{'model':db[_0x71e0('0x8d')],'as':'VoiceMail'}]});})[_0x71e0('0x2c')](function(_0x166d73){if(_0x3d3de6[_0x71e0('0x65')][_0x71e0('0x31')]==='user')return _0x166d73;if(_0x3d3de6['user']['role']!=='user')return _0x166d73;return db[_0x71e0('0x8e')][_0x71e0('0x63')]({'where':{'name':_0x166d73['role']===_0x71e0('0x87')?'Agents':'Telephones','userProfileId':_0x3d3de6['user'][_0x71e0('0x8f')]},'raw':!![]})[_0x71e0('0x2c')](function(_0x1ad68b){if(!_0x1ad68b||_0x1ad68b[_0x71e0('0x90')]!=0x0)return _0x166d73;return db[_0x71e0('0x3c')][_0x71e0('0x86')]({'name':_0x166d73['name'],'resourceId':_0x166d73['id'],'type':_0x1ad68b[_0x71e0('0x3b')],'sectionId':_0x1ad68b['id']},{})['then'](function(){return _0x166d73;});})[_0x71e0('0x21')](function(_0x4a8809){logger[_0x71e0('0x1c')](_0x71e0('0x91'),_0x4a8809);throw _0x4a8809;});})[_0x71e0('0x2c')](respondWithResult(_0x331c45,0xc9))['catch'](handleError(_0x331c45,null));};exports[_0x71e0('0x92')]=function(_0x2c34fe,_0x370229){var _0x3b74ef=_0x2c34fe[_0x71e0('0x65')];var _0x41265f=[];if(_0x2c34fe[_0x71e0('0x34')][_0x71e0('0x31')]===_0x71e0('0x87'))throw new Error(_0x71e0('0x88'));if(_['some'](_0x3b74ef,['role',_0x71e0('0x34')])&&_0x2c34fe['user']['role']!==_0x71e0('0x32')){throw new Error(_0x71e0('0x89'));}if(_[_0x71e0('0x93')](_0x3b74ef,[_0x71e0('0x31'),_0x71e0('0x32')])&&_0x2c34fe[_0x71e0('0x34')][_0x71e0('0x31')]!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0x71e0('0x8b')](_0x3b74ef)[_0x71e0('0x2c')](function(){return validateUser(_0x3b74ef[0x0]);})[_0x71e0('0x2c')](function(){for(var _0x8964bb=0x1;_0x8964bb<_0x3b74ef[_0x71e0('0x52')];_0x8964bb++){var _0x174abe=_0x3b74ef[_0x8964bb-0x1]['internal'];if(!_0x3b74ef[_0x8964bb][_0x71e0('0x6a')])_0x3b74ef[_0x8964bb][_0x71e0('0x6a')]=_0x174abe+0x1;_0x41265f['push'](validateUser(_0x3b74ef[_0x8964bb]));}return BPromise[_0x71e0('0x59')](_0x41265f);})['then'](function(){_0x41265f=[];for(var _0x1213b8=0x0;_0x1213b8<_0x3b74ef[_0x71e0('0x52')];_0x1213b8++){_0x41265f[_0x71e0('0x4d')](updateUser(_0x3b74ef[_0x1213b8]));}return BPromise[_0x71e0('0x59')](_0x41265f);})[_0x71e0('0x2c')](function(){return BPromise[_0x71e0('0x94')](_0x3b74ef,function(_0x4410cd){return db[_0x71e0('0x46')][_0x71e0('0x86')](_0x4410cd,{'include':[{'model':db[_0x71e0('0x8d')],'as':_0x71e0('0x8d')}]})[_0x71e0('0x2c')](function(_0x4207cb){_0x4410cd['id']=_0x4207cb['id'];return _0x4410cd;});});})[_0x71e0('0x2c')](function(_0x9df7e5){if(_0x2c34fe['body'][_0x71e0('0x31')]===_0x71e0('0x34'))return _0x9df7e5;if(_0x2c34fe['user'][_0x71e0('0x31')]!==_0x71e0('0x34'))return _0x9df7e5;var _0xf9ce0a=_[_0x71e0('0x93')](_0x9df7e5,function(_0x52ddda){return _0x52ddda[_0x71e0('0x31')]===_0x71e0('0x87')||_0x52ddda[_0x71e0('0x31')]==='telephone';});if(!_0xf9ce0a)return _0x9df7e5;return db['UserProfileSection'][_0x71e0('0x4e')]({'where':{'name':{'$or':[_0x71e0('0x95'),_0x71e0('0x96')]},'userProfileId':_0x2c34fe[_0x71e0('0x34')]['userProfileId']},'raw':!![]})[_0x71e0('0x2c')](function(_0x85546){if(_[_0x71e0('0x97')](_0x85546)||!_[_0x71e0('0x93')](_0x85546,[_0x71e0('0x90'),0x0]))return _0x9df7e5;_0x41265f=[];var _0x38eed6=_(_0x85546)[_0x71e0('0x38')](function(_0x48f1cb){if(_0x48f1cb[_0x71e0('0x90')]===0x1)return;return _0x48f1cb[_0x71e0('0x3b')]===_0x71e0('0x95')?_0x71e0('0x87'):_0x71e0('0x35');})[_0x71e0('0x98')]()[_0x71e0('0x3a')]();for(var _0x47d84e=0x0;_0x47d84e<_0x9df7e5[_0x71e0('0x52')];_0x47d84e++){if(!_['includes'](_0x38eed6,_0x9df7e5[_0x47d84e][_0x71e0('0x31')]))return;var _0x3a9235=_0x9df7e5[_0x47d84e][_0x71e0('0x31')]==='agent'?_0x71e0('0x95'):'Telephones';_0x41265f[_0x71e0('0x4d')](db['UserProfileResource'][_0x71e0('0x86')]({'name':_0x9df7e5[_0x47d84e][_0x71e0('0x3b')],'resourceId':_0x9df7e5[_0x47d84e]['id'],'type':_0x3a9235,'sectionId':_[_0x71e0('0x63')](_0x85546,[_0x71e0('0x3b'),_0x3a9235])['id']},{}));}return BPromise[_0x71e0('0x59')](_0x41265f);});})[_0x71e0('0x2c')](respondWithResult(_0x370229,0xc9))['catch'](handleError(_0x370229,null));};exports['changePassword']=function(_0x1c573b,_0x1c162f){if(_0x1c573b[_0x71e0('0x65')]['id']){delete _0x1c573b['body']['id'];}return db[_0x71e0('0x46')][_0x71e0('0x63')]({'where':{'id':_0x1c573b[_0x71e0('0x5b')]['id']}})[_0x71e0('0x2c')](function(_0xc91d99){if(!_0xc91d99)return null;if(_0xc91d99['id']===_0x1c573b[_0x71e0('0x34')]['id']){if(!_0x1c573b[_0x71e0('0x65')][_0x71e0('0x99')]||!_0x1c573b['body'][_0x71e0('0x9a')]){throw new db[(_0x71e0('0x9b'))][(_0x71e0('0x9c'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0xc91d99[_0x71e0('0x9d')](_0x1c573b[_0x71e0('0x65')][_0x71e0('0x99')])){throw new db[(_0x71e0('0x9b'))][(_0x71e0('0x9c'))]('Wrong\x20credentials');}if(_0x1c573b['body'][_0x71e0('0x99')]===_0x1c573b[_0x71e0('0x65')]['newPassword']){throw new db[(_0x71e0('0x9b'))]['ValidationError'](_0x71e0('0x9e'));}}else if(_0x1c573b[_0x71e0('0x34')][_0x71e0('0x31')]===_0x71e0('0x32')){if(!_0x1c573b['body'][_0x71e0('0x9a')]){throw new db[(_0x71e0('0x9b'))][(_0x71e0('0x9c'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x1c573b['user'][_0x71e0('0x31')]===_0x71e0('0x34')){if(!_0x1c573b['body'][_0x71e0('0x9a')]){throw new db['Sequelize'][(_0x71e0('0x9c'))](_0x71e0('0x9f'));}if(_0xc91d99[_0x71e0('0x31')]!=='agent'){throw new db[(_0x71e0('0x9b'))][(_0x71e0('0x9c'))](_0x71e0('0x88'));}}else{throw new db[(_0x71e0('0x9b'))][(_0x71e0('0x9c'))](_0x71e0('0x88'));}return _0xc91d99;})[_0x71e0('0x2c')](handleEntityNotFound(_0x1c162f,null))[_0x71e0('0x2c')](function(_0xfacde7){return db[_0x71e0('0x6b')]['findOne']({'attributes':['id','securePassword','enforcePasswordHistory',_0x71e0('0xa0')]})['then'](function(_0x545134){if(_0x545134[_0x71e0('0xa1')])authService[_0x71e0('0x6d')](_0x1c573b[_0x71e0('0x65')]['newPassword']);if(!_0x545134[_0x71e0('0xa2')]||!_0xfacde7[_0x71e0('0xa3')])return _0xfacde7;authService[_0x71e0('0xa4')](_0x1c573b['body']['newPassword'],_0xfacde7['previousPasswords'],_0x545134[_0x71e0('0xa0')]);return _0xfacde7;})[_0x71e0('0x2c')](saveUpdates({'password':_0x1c573b[_0x71e0('0x65')]['newPassword'],'passwordResetAt':_0x1c573b['user']['id']==_0x1c573b[_0x71e0('0x5b')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x1c573b[_0x71e0('0x65')][_0x71e0('0x9a')],_0xfacde7['previousPasswords'])},null));})[_0x71e0('0x2c')](respondWithResult(_0x1c162f,null))[_0x71e0('0x21')](handleError(_0x1c162f,null));};exports[_0x71e0('0xa5')]=function(_0x39adc7,_0x550ae5){var _0x5c1a3e=_0x39adc7[_0x71e0('0x65')][_0x71e0('0xa6')];return db[_0x71e0('0x46')][_0x71e0('0x63')]({'where':{'id':_0x39adc7['params']['id']},'attributes':['id',_0x71e0('0x3b'),'role',_0x71e0('0xa7'),_0x71e0('0xa8'),'voicePause',_0x71e0('0xa9')]})[_0x71e0('0x2c')](handleEntityNotFound(_0x550ae5,null))[_0x71e0('0x2c')](function(_0x20e6aa){if(_0x20e6aa){if(!utils[_0x71e0('0xaa')](_0x5c1a3e)){throw new db[(_0x71e0('0x9b'))][(_0x71e0('0x9c'))](_0x71e0('0xab'));}return _0x20e6aa['add'+_[_0x71e0('0xac')](_0x5c1a3e[_0x71e0('0xad')]())+_0x71e0('0xae')](_0x39adc7[_0x71e0('0x65')][_0x71e0('0x68')],{'penalty':_0x39adc7['body'][_0x71e0('0xaf')]||0x0})[_0x71e0('0xb0')](function(_0x16887e){for(var _0x3173ae=0x0;_0x3173ae<_0x39adc7[_0x71e0('0x65')][_0x71e0('0x68')]['length'];_0x3173ae+=0x1){var _0x9df214={'UserId':Number(_0x39adc7[_0x71e0('0x5b')]['id'])};_0x9df214[_[_0x71e0('0xac')](_0x5c1a3e[_0x71e0('0xad')]())+_0x71e0('0xb1')]=Number(_0x39adc7[_0x71e0('0x65')]['ids'][_0x3173ae]);socket['emit'](_0x71e0('0x34')+_[_0x71e0('0xac')](_0x5c1a3e['toLowerCase']())+'Queue:save',_0x9df214);}return _0x16887e;})[_0x71e0('0x2c')](function(){if(_0x5c1a3e==='voice'){return db[_0x71e0('0xb2')]['findAll']({'where':{'id':_0x39adc7[_0x71e0('0x65')][_0x71e0('0x68')]||[]},'raw':!![],'attributes':['id','name']});}})['then'](function(_0x2cb0ac){var _0x3bd9c5=_0x20e6aa[_0x71e0('0x30')]({'plain':!![]});var _0x5060e2=[];if(_0x5c1a3e==='voice'&&_0x3bd9c5[_0x71e0('0x31')]==='agent'&&_0x3bd9c5[_0x71e0('0xa7')]){for(var _0x5b67e7=0x0;_0x5b67e7<_0x2cb0ac[_0x71e0('0x52')];_0x5b67e7+=0x1){_0x5060e2[_0x71e0('0x4d')]({'membername':_0x3bd9c5[_0x71e0('0x3b')],'UserId':_0x3bd9c5['id'],'queue_name':_0x2cb0ac[_0x5b67e7][_0x71e0('0x3b')],'VoiceQueueId':_0x2cb0ac[_0x5b67e7]['id'],'interface':_[_0x71e0('0x70')](_0x3bd9c5['interface'])?util[_0x71e0('0xb3')](_0x71e0('0xb4'),_0x3bd9c5[_0x71e0('0x3b')]):_0x3bd9c5['interface'],'paused':_0x3bd9c5[_0x71e0('0xb5')]||![],'penalty':_0x39adc7[_0x71e0('0x65')][_0x71e0('0xaf')]||0x0});}return BPromise[_0x71e0('0x94')](_0x5060e2,function(_0x33b7f2){return db[_0x71e0('0xb6')][_0x71e0('0xb7')](_0x33b7f2);});}return _0x20e6aa;});}})['then'](respondWithStatusCode(_0x550ae5,null))[_0x71e0('0x21')](handleError(_0x550ae5,null));};exports[_0x71e0('0xb8')]=function(_0x20fa47,_0x2e87bd){var _0x4d1d48,_0x1f48a9;return db['User'][_0x71e0('0x63')]({'where':{'id':_0x20fa47[_0x71e0('0x5b')]['id']},'attributes':['id',_0x71e0('0x3b'),_0x71e0('0x31')]})[_0x71e0('0x2c')](handleEntityNotFound(_0x2e87bd,null))[_0x71e0('0x2c')](function(_0x5a09c6){if(_0x5a09c6){_0x4d1d48=_0x5a09c6;if(!_0x20fa47['query'][_0x71e0('0xa6')]||!utils[_0x71e0('0xaa')](_0x20fa47[_0x71e0('0x47')]['channel'])){throw new db[(_0x71e0('0x9b'))][(_0x71e0('0x9c'))](_0x71e0('0xab'));}return _0x5a09c6[_0x71e0('0xb9')+_[_0x71e0('0xac')](_0x20fa47[_0x71e0('0x47')]['channel']['toLowerCase']())+_0x71e0('0xae')](_0x20fa47['query'][_0x71e0('0x68')]);}})[_0x71e0('0x2c')](function(_0xd65802){if(_['isArray'](_0x20fa47[_0x71e0('0x47')][_0x71e0('0x68')])){for(var _0x4d5aa1=0x0;_0x4d5aa1<_0x20fa47['query']['ids'][_0x71e0('0x52')];_0x4d5aa1+=0x1){_0x1f48a9={'UserId':Number(_0x20fa47['params']['id'])};_0x1f48a9[_[_0x71e0('0xac')](_0x20fa47['query'][_0x71e0('0xa6')][_0x71e0('0xad')]())+_0x71e0('0xb1')]=Number(_0x20fa47[_0x71e0('0x47')]['ids'][_0x4d5aa1]);socket[_0x71e0('0x2d')](_0x71e0('0x34')+_[_0x71e0('0xac')](_0x20fa47[_0x71e0('0x47')][_0x71e0('0xa6')][_0x71e0('0xad')]())+_0x71e0('0xba'),_0x1f48a9);}}else{_0x1f48a9={'UserId':Number(_0x20fa47[_0x71e0('0x5b')]['id'])};_0x1f48a9[_[_0x71e0('0xac')](_0x20fa47['query']['channel']['toLowerCase']())+_0x71e0('0xb1')]=Number(_0x20fa47['query']['ids']);socket[_0x71e0('0x2d')](_0x71e0('0x34')+_['capitalize'](_0x20fa47[_0x71e0('0x47')][_0x71e0('0xa6')][_0x71e0('0xad')]())+_0x71e0('0xba'),_0x1f48a9);}return _0xd65802;})[_0x71e0('0x2c')](function(){if(_0x20fa47[_0x71e0('0x47')][_0x71e0('0xa6')]===_0x71e0('0xbb')){return db[_0x71e0('0xb6')]['destroy']({'where':{'UserId':_0x20fa47[_0x71e0('0x5b')]['id'],'VoiceQueueId':_0x20fa47[_0x71e0('0x47')]['ids']},'individualHooks':!![]})[_0x71e0('0x2c')](function(){return _0x4d1d48;});}return _0x4d1d48;})[_0x71e0('0x2c')](respondWithStatusCode(_0x2e87bd,null))['catch'](handleError(_0x2e87bd,null));};exports[_0x71e0('0xbc')]=function(_0x33b62c,_0x4f6f44){_0x33b62c[_0x71e0('0x65')][_0x71e0('0xbd')]=_0x33b62c['file'][_0x71e0('0xbe')];return db[_0x71e0('0x46')][_0x71e0('0x63')]({'where':{'id':_0x33b62c[_0x71e0('0x5b')]['id']}})[_0x71e0('0x2c')](handleEntityNotFound(_0x4f6f44,null))['then'](saveUpdates(_0x33b62c[_0x71e0('0x65')],null))['then'](respondWithResult(_0x4f6f44,null))[_0x71e0('0x21')](handleError(_0x4f6f44,null));};exports[_0x71e0('0xbf')]=function(_0x47668e,_0x32f7fe){var _0x795ab=path[_0x71e0('0xc0')](config[_0x71e0('0xc1')],_0x71e0('0xc2'));return db['User'][_0x71e0('0x63')]({'where':{'id':_0x47668e[_0x71e0('0x5b')]['id']},'attributes':['id',_0x71e0('0xbd')],'raw':!![]})['then'](handleEntityNotFound(_0x32f7fe,null))[_0x71e0('0x2c')](function(_0x451339){if(_0x451339){if(_[_0x71e0('0x70')](_0x451339[_0x71e0('0xbd')])){return _0x32f7fe[_0x71e0('0xc3')](_0x795ab);}else{if(!fs[_0x71e0('0xc4')](path[_0x71e0('0xc0')](config[_0x71e0('0xc1')],_0x71e0('0xc5'),_0x451339[_0x71e0('0xbd')]))){return _0x32f7fe[_0x71e0('0xc3')](_0x795ab);}return _0x32f7fe[_0x71e0('0xc3')](path[_0x71e0('0xc0')](config[_0x71e0('0xc1')],_0x71e0('0xc5'),_0x451339['userpic']));}}})[_0x71e0('0x21')](handleError(_0x32f7fe,null));};exports['getOpenTabs']=function(_0x49462d,_0x25e5b0){return db[_0x71e0('0x46')][_0x71e0('0x63')]({'where':{'id':_0x49462d['params']['id']},'attributes':['id']})[_0x71e0('0x2c')](handleEntityNotFound(_0x25e5b0,null))['then'](function(_0x109627){var _0x989464=[];values=_0x109627[_0x71e0('0x55')];_0x989464['push'](get_open_tabs(_0x71e0('0x53'),_0x109627[_0x71e0('0x55')]));_0x989464[_0x71e0('0x4d')](get_open_tabs(_0x71e0('0x54'),_0x109627[_0x71e0('0x55')]));_0x989464[_0x71e0('0x4d')](get_open_tabs(_0x71e0('0x57'),_0x109627[_0x71e0('0x55')]));_0x989464[_0x71e0('0x4d')](get_open_tabs(_0x71e0('0x58'),_0x109627['dataValues']));_0x989464['push'](get_open_tabs(_0x71e0('0x56'),_0x109627[_0x71e0('0x55')]));_0x989464['push'](get_open_tabs(_0x71e0('0x64'),_0x109627[_0x71e0('0x55')]));return BPromise[_0x71e0('0x59')](_0x989464);})[_0x71e0('0x2c')](function(_0x492cee){if(_0x492cee){var _0x5a80ef=_[_0x71e0('0x38')](values['ChatOpenTabs'],function(_0x507690){return{'channel':'CHAT','id':_0x507690['id'],'createdAt':_0x507690[_0x71e0('0xc6')]};});var _0x1b2083=_[_0x71e0('0x38')](values[_0x71e0('0xc7')],function(_0x755dcb){return{'channel':_0x71e0('0xc8'),'id':_0x755dcb['id'],'createdAt':_0x755dcb[_0x71e0('0xc6')]};});var _0x2e7676=_[_0x71e0('0x38')](values[_0x71e0('0xc9')],function(_0x552893){return{'channel':_0x71e0('0xca'),'id':_0x552893['id'],'createdAt':_0x552893[_0x71e0('0xc6')]};});var _0x107dc9=_['map'](values['MailOpenTabs'],function(_0xf99d52){return{'channel':'MAIL','id':_0xf99d52['id'],'createdAt':_0xf99d52[_0x71e0('0xc6')]};});var _0x4f4eaf=_['map'](values[_0x71e0('0xcb')],function(_0x158801){return{'channel':'SMS','id':_0x158801['id'],'createdAt':_0x158801[_0x71e0('0xc6')]};});var _0x33440d=_[_0x71e0('0x38')](values['WhatsappOpenTabs'],function(_0x8f5346){return{'channel':_0x71e0('0xcc'),'id':_0x8f5346['id'],'createdAt':_0x8f5346[_0x71e0('0xc6')]};});var _0x58a5ae=_[_0x71e0('0xcd')](_0x5a80ef,_0x1b2083,_0x2e7676,_0x107dc9,_0x4f4eaf,_0x33440d);var _0x51745c={'count':_0x58a5ae[_0x71e0('0x52')],'rows':_0x58a5ae};return _0x51745c;}else return null;})[_0x71e0('0x2c')](respondWithResult(_0x25e5b0,null))[_0x71e0('0x21')](handleError(_0x25e5b0,null));};exports[_0x71e0('0xce')]=function(_0x1c23a5,_0x3b4254){var _0x26379b={};var _0x4e460b={};var _0x1099b0;var _0x5112f1;return db[_0x71e0('0x46')]['findOne']({'where':{'id':_0x1c23a5[_0x71e0('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3b4254,null))[_0x71e0('0x2c')](function(_0x49ee39){if(_0x49ee39){_0x1099b0=_0x49ee39;_0x4e460b[_0x71e0('0x60')]=_[_0x71e0('0x5d')](db['CmContact'][_0x71e0('0x40')]);_0x4e460b[_0x71e0('0x47')]=_[_0x71e0('0x5d')](_0x1c23a5['query']);_0x4e460b['filters']=_[_0x71e0('0x5f')](_0x4e460b[_0x71e0('0x60')],_0x4e460b[_0x71e0('0x47')]);_0x26379b[_0x71e0('0x4c')]=_['intersection'](_0x4e460b[_0x71e0('0x60')],qs['fields'](_0x1c23a5[_0x71e0('0x47')][_0x71e0('0x61')]));_0x26379b[_0x71e0('0x4c')]=_0x26379b[_0x71e0('0x4c')][_0x71e0('0x52')]?_0x26379b[_0x71e0('0x4c')]:_0x4e460b[_0x71e0('0x60')];_0x26379b['order']=qs[_0x71e0('0xcf')](_0x1c23a5[_0x71e0('0x47')][_0x71e0('0xcf')]);_0x26379b[_0x71e0('0xd0')]=qs['filters'](_[_0x71e0('0xd1')](_0x1c23a5[_0x71e0('0x47')],_0x4e460b['filters']));if(_0x1c23a5[_0x71e0('0x47')][_0x71e0('0x36')]){_0x26379b['where']=_[_0x71e0('0x62')](_0x26379b[_0x71e0('0xd0')],{'$or':_[_0x71e0('0x38')](_0x26379b[_0x71e0('0x4c')],function(_0x575150){var _0x318b95={};_0x318b95[_0x575150]={'$like':'%'+_0x1c23a5['query']['filter']+'%'};return _0x318b95;})});}_0x26379b=_['merge']({},_0x26379b,_0x1c23a5['options']);return _0x1099b0['getContacts'](_0x26379b);}})[_0x71e0('0x2c')](function(_0x391bfd){if(_0x391bfd){_0x5112f1=_0x391bfd[_0x71e0('0x52')];if(_0x1c23a5[_0x71e0('0x47')]['hasOwnProperty'](_0x71e0('0x48'))){_0x26379b[_0x71e0('0x49')]=[{'model':db[_0x71e0('0xd2')],'as':_0x71e0('0xd3'),'required':![]},{'model':db[_0x71e0('0xd4')],'as':'Tags','attributes':['id',_0x71e0('0x3b'),_0x71e0('0xd5')],'where':_0x1c23a5[_0x71e0('0x47')]['tag']?{'id':_0x1c23a5[_0x71e0('0x47')][_0x71e0('0xd6')]}:undefined,'required':_0x1c23a5[_0x71e0('0x47')][_0x71e0('0xd6')]?!![]:![]}];}if(!_0x1c23a5[_0x71e0('0x47')][_0x71e0('0xd7')](_0x71e0('0xd8'))){_0x26379b[_0x71e0('0x29')]=qs[_0x71e0('0x29')](_0x1c23a5[_0x71e0('0x47')][_0x71e0('0x29')]);_0x26379b[_0x71e0('0x26')]=qs[_0x71e0('0x26')](_0x1c23a5[_0x71e0('0x47')][_0x71e0('0x26')]);}return _0x1099b0[_0x71e0('0xce')](_0x26379b);}})[_0x71e0('0x2c')](function(_0x5be619){if(_0x5be619){return _0x5be619?{'count':_0x5112f1,'rows':_0x5be619}:null;}})[_0x71e0('0x2c')](respondWithResult(_0x3b4254,null))[_0x71e0('0x21')](handleError(_0x3b4254,null));};exports[_0x71e0('0xd9')]=function(_0x107bac,_0x4739b7){var _0x30e445;var _0x13d4c7={};var _0x2f1931;return db[_0x71e0('0x46')][_0x71e0('0xda')]({'where':{'id':_0x107bac['params']['id']},'attributes':['id',_0x71e0('0x3b'),_0x71e0('0x31')]})[_0x71e0('0x2c')](handleEntityNotFound(_0x4739b7,null))[_0x71e0('0x2c')](function(_0x51b27e){if(!utils[_0x71e0('0xaa')](_0x107bac[_0x71e0('0x47')][_0x71e0('0xa6')])){throw new db['Sequelize'][(_0x71e0('0x9c'))](_0x71e0('0xab'));}_0x30e445=_0x51b27e;var _0x2efcdb={};_0x2efcdb[_0x71e0('0x60')]=_['keys'](db[_['capitalize'](_0x107bac['query']['channel'])+_0x71e0('0xdb')]['rawAttributes']);_0x2efcdb[_0x71e0('0x47')]=_[_0x71e0('0x5d')](_0x107bac[_0x71e0('0x47')]);_0x2efcdb[_0x71e0('0x5e')]=_[_0x71e0('0x5f')](_0x2efcdb[_0x71e0('0x60')],_0x2efcdb[_0x71e0('0x47')]);_0x13d4c7[_0x71e0('0x4c')]=_[_0x71e0('0x5f')](_0x2efcdb[_0x71e0('0x60')],qs[_0x71e0('0x61')](_0x107bac['query'][_0x71e0('0x61')]));_0x13d4c7[_0x71e0('0x4c')]=_0x13d4c7[_0x71e0('0x4c')][_0x71e0('0x52')]?_0x13d4c7[_0x71e0('0x4c')]:_0x2efcdb[_0x71e0('0x60')];_0x13d4c7[_0x71e0('0xdc')]=qs['sort'](_0x107bac[_0x71e0('0x47')][_0x71e0('0xcf')]);_0x13d4c7['where']=qs[_0x71e0('0x5e')](_[_0x71e0('0xd1')](_0x107bac['query'],_0x2efcdb[_0x71e0('0x5e')]));if(_0x107bac[_0x71e0('0x47')][_0x71e0('0x36')]){_0x13d4c7[_0x71e0('0xd0')]=_[_0x71e0('0x62')](_0x13d4c7[_0x71e0('0xd0')],{'$or':_[_0x71e0('0x38')](_0x13d4c7[_0x71e0('0x4c')],function(_0x571ec3){var _0x4a97f0={};_0x4a97f0[_0x571ec3]={'$like':'%'+_0x107bac[_0x71e0('0x47')][_0x71e0('0x36')]+'%'};return _0x4a97f0;})});}_0x13d4c7=_['merge']({},_0x13d4c7,_0x107bac['options']);switch(_0x30e445[_0x71e0('0x31')]){case _0x71e0('0x32'):return db[_['capitalize'](_0x107bac[_0x71e0('0x47')]['channel'])+_0x71e0('0xdb')]['findAll'](_0x13d4c7);case _0x71e0('0x34'):case _0x71e0('0x87'):return _0x30e445[_0x71e0('0x30')+_[_0x71e0('0xac')](_0x107bac['query']['channel'])+'Queues'](_0x13d4c7);default:throw new db[(_0x71e0('0x9b'))][(_0x71e0('0x9c'))](_0x71e0('0xdd'));}})[_0x71e0('0x2c')](function(_0x1f1a19){_0x2f1931=_0x1f1a19[_0x71e0('0x52')];if(!_0x107bac['query']['hasOwnProperty'](_0x71e0('0xd8'))){_0x13d4c7[_0x71e0('0x29')]=qs[_0x71e0('0x29')](_0x107bac[_0x71e0('0x47')]['limit']);_0x13d4c7[_0x71e0('0x26')]=qs[_0x71e0('0x26')](_0x107bac['query'][_0x71e0('0x26')]);}switch(_0x30e445[_0x71e0('0x31')]){case'admin':return db[_[_0x71e0('0xac')](_0x107bac[_0x71e0('0x47')][_0x71e0('0xa6')])+_0x71e0('0xdb')][_0x71e0('0x4e')](_0x13d4c7);case _0x71e0('0x34'):case'agent':return _0x30e445[_0x71e0('0x30')+_[_0x71e0('0xac')](_0x107bac[_0x71e0('0x47')][_0x71e0('0xa6')])+'Queues'](_0x13d4c7);}})[_0x71e0('0x2c')](function(_0x41e937){return{'count':_0x2f1931,'rows':_0x41e937};})['then'](respondWithResult(_0x4739b7,null))[_0x71e0('0x21')](handleError(_0x4739b7,null));};exports['getVoiceQueuesRt']=function(_0x3603e9,_0x4118b7){var _0x1b479b={};var _0x58a8b4={};var _0xac66f6;var _0x4992d7;return db[_0x71e0('0x46')]['findOne']({'where':{'id':_0x3603e9[_0x71e0('0x5b')]['id']}})[_0x71e0('0x2c')](handleEntityNotFound(_0x4118b7,null))[_0x71e0('0x2c')](function(_0x69140){if(_0x69140){_0xac66f6=_0x69140;_0x58a8b4[_0x71e0('0x60')]=_[_0x71e0('0x5d')](db[_0x71e0('0xb6')][_0x71e0('0x40')]);_0x58a8b4[_0x71e0('0x47')]=_[_0x71e0('0x5d')](_0x3603e9[_0x71e0('0x47')]);_0x58a8b4['filters']=_['intersection'](_0x58a8b4['model'],_0x58a8b4[_0x71e0('0x47')]);_0x1b479b[_0x71e0('0x4c')]=_[_0x71e0('0x5f')](_0x58a8b4[_0x71e0('0x60')],qs['fields'](_0x3603e9['query'][_0x71e0('0x61')]));_0x1b479b[_0x71e0('0x4c')]=_0x1b479b[_0x71e0('0x4c')]['length']?_0x1b479b[_0x71e0('0x4c')]:_0x58a8b4[_0x71e0('0x60')];_0x1b479b['order']=qs[_0x71e0('0xcf')](_0x3603e9['query'][_0x71e0('0xcf')]);_0x1b479b[_0x71e0('0xd0')]=qs['filters'](_[_0x71e0('0xd1')](_0x3603e9['query'],_0x58a8b4[_0x71e0('0x5e')]));if(_0x3603e9[_0x71e0('0x47')][_0x71e0('0x36')]){_0x1b479b['where']=_[_0x71e0('0x62')](_0x1b479b[_0x71e0('0xd0')],{'$or':_[_0x71e0('0x38')](_0x1b479b['attributes'],function(_0x89dc80){var _0x39c68f={};_0x39c68f[_0x89dc80]={'$like':'%'+_0x3603e9[_0x71e0('0x47')][_0x71e0('0x36')]+'%'};return _0x39c68f;})});}_0x1b479b=_[_0x71e0('0x62')]({},_0x1b479b,_0x3603e9[_0x71e0('0xde')]);return _0xac66f6[_0x71e0('0xdf')](_0x1b479b);}})[_0x71e0('0x2c')](function(_0x381289){if(_0x381289){_0x4992d7=_0x381289['length'];if(!_0x3603e9[_0x71e0('0x47')][_0x71e0('0xd7')](_0x71e0('0xd8'))){_0x1b479b[_0x71e0('0x29')]=qs[_0x71e0('0x29')](_0x3603e9[_0x71e0('0x47')][_0x71e0('0x29')]);_0x1b479b[_0x71e0('0x26')]=qs[_0x71e0('0x26')](_0x3603e9[_0x71e0('0x47')][_0x71e0('0x26')]);}return _0xac66f6[_0x71e0('0xdf')](_0x1b479b);}})['then'](function(_0x52e01f){if(_0x52e01f){return _0x52e01f?{'count':_0x4992d7,'rows':_0x52e01f}:null;}})['then'](respondWithResult(_0x4118b7,null))[_0x71e0('0x21')](handleError(_0x4118b7,null));};exports[_0x71e0('0xe0')]=function(_0x66e914,_0x55e4fe){var _0x407116={};var _0x15ba11={};var _0xdc20be;var _0x5e8596;return db[_0x71e0('0x46')][_0x71e0('0xda')]({'where':{'id':_0x66e914[_0x71e0('0x5b')]['id']}})[_0x71e0('0x2c')](handleEntityNotFound(_0x55e4fe,null))[_0x71e0('0x2c')](function(_0x298f19){if(_0x298f19){_0xdc20be=_0x298f19;_0x15ba11['model']=_[_0x71e0('0x5d')](db['ChatGroup']['rawAttributes']);_0x15ba11[_0x71e0('0x47')]=_[_0x71e0('0x5d')](_0x66e914[_0x71e0('0x47')]);_0x15ba11[_0x71e0('0x5e')]=_['intersection'](_0x15ba11[_0x71e0('0x60')],_0x15ba11[_0x71e0('0x47')]);_0x407116['attributes']=_[_0x71e0('0x5f')](_0x15ba11['model'],qs[_0x71e0('0x61')](_0x66e914[_0x71e0('0x47')]['fields']));_0x407116['attributes']=_0x407116[_0x71e0('0x4c')][_0x71e0('0x52')]?_0x407116[_0x71e0('0x4c')]:_0x15ba11[_0x71e0('0x60')];_0x407116[_0x71e0('0xdc')]=qs['sort'](_0x66e914[_0x71e0('0x47')][_0x71e0('0xcf')]);_0x407116['where']=qs[_0x71e0('0x5e')](_['pick'](_0x66e914['query'],_0x15ba11['filters']));if(_0x66e914[_0x71e0('0x47')][_0x71e0('0x36')]){_0x407116['where']=_[_0x71e0('0x62')](_0x407116[_0x71e0('0xd0')],{'$or':_[_0x71e0('0x38')](_0x407116[_0x71e0('0x4c')],function(_0x22032e){var _0x5213af={};_0x5213af[_0x22032e]={'$like':'%'+_0x66e914[_0x71e0('0x47')][_0x71e0('0x36')]+'%'};return _0x5213af;})});}_0x407116=_[_0x71e0('0x62')]({},_0x407116,_0x66e914[_0x71e0('0xde')]);return _0xdc20be[_0x71e0('0xe0')](_0x407116);}})['then'](function(_0x30975c){if(_0x30975c){_0x5e8596=_0x30975c[_0x71e0('0x52')];if(!_0x66e914[_0x71e0('0x47')]['hasOwnProperty'](_0x71e0('0xd8'))){_0x407116[_0x71e0('0x29')]=qs[_0x71e0('0x29')](_0x66e914[_0x71e0('0x47')]['limit']);_0x407116[_0x71e0('0x26')]=qs[_0x71e0('0x26')](_0x66e914[_0x71e0('0x47')][_0x71e0('0x26')]);}return _0xdc20be[_0x71e0('0xe0')](_0x407116);}})[_0x71e0('0x2c')](function(_0x2e5d85){if(_0x2e5d85){return _0x2e5d85?{'count':_0x5e8596,'rows':_0x2e5d85}:null;}})['then'](respondWithResult(_0x55e4fe,null))[_0x71e0('0x21')](handleError(_0x55e4fe,null));};exports[_0x71e0('0xe1')]=function(_0x1c2307,_0x824492){var _0x96117b={'raw':!![],'where':{}};var _0x2f1726={};var _0x48f6eb={'count':0x0,'rows':[]};return db[_0x71e0('0x46')][_0x71e0('0xda')]({'where':{'id':_0x1c2307[_0x71e0('0x5b')]['id']}})[_0x71e0('0x2c')](handleEntityNotFound(_0x824492,null))[_0x71e0('0x2c')](function(_0xac77cf){if(_0xac77cf){_0x2f1726[_0x71e0('0x60')]=_['keys'](db['VoiceRecording'][_0x71e0('0x40')]);_0x2f1726['query']=_[_0x71e0('0x5d')](_0x1c2307[_0x71e0('0x47')]);_0x2f1726['filters']=_[_0x71e0('0x5f')](_0x2f1726['model'],_0x2f1726[_0x71e0('0x47')]);_0x96117b['attributes']=_['intersection'](_0x2f1726[_0x71e0('0x60')],qs['fields'](_0x1c2307['query'][_0x71e0('0x61')]));_0x96117b[_0x71e0('0x4c')]=_0x96117b[_0x71e0('0x4c')][_0x71e0('0x52')]?_0x96117b[_0x71e0('0x4c')]:_0x2f1726[_0x71e0('0x60')];if(!_0x1c2307[_0x71e0('0x47')]['hasOwnProperty']('nolimit')){_0x96117b[_0x71e0('0x29')]=qs[_0x71e0('0x29')](_0x1c2307[_0x71e0('0x47')][_0x71e0('0x29')]);_0x96117b[_0x71e0('0x26')]=qs[_0x71e0('0x26')](_0x1c2307['query']['offset']);}_0x96117b[_0x71e0('0xdc')]=qs['sort'](_0x1c2307[_0x71e0('0x47')][_0x71e0('0xcf')]);_0x96117b[_0x71e0('0xd0')]=qs[_0x71e0('0x5e')](_[_0x71e0('0xd1')](_0x1c2307['query'],_0x2f1726[_0x71e0('0x5e')]));_0x96117b[_0x71e0('0xd0')][_0x71e0('0xe2')]=_0xac77cf['id'];if(_0x1c2307[_0x71e0('0x47')]['filter']){_0x96117b[_0x71e0('0xd0')]=_[_0x71e0('0x62')](_0x96117b['where'],{'$or':_[_0x71e0('0x38')](_0x96117b[_0x71e0('0x4c')],function(_0x43cbed){var _0x14703f={};_0x14703f[_0x43cbed]={'$like':'%'+_0x1c2307[_0x71e0('0x47')][_0x71e0('0x36')]+'%'};return _0x14703f;})});}_0x96117b=_[_0x71e0('0x62')]({},_0x96117b,_0x1c2307[_0x71e0('0xde')]);return db[_0x71e0('0xe3')][_0x71e0('0x28')]({'where':_0x96117b['where']})[_0x71e0('0x2c')](function(_0x244bcc){_0x48f6eb[_0x71e0('0x28')]=_0x244bcc;if(_0x1c2307[_0x71e0('0x47')][_0x71e0('0x48')]){_0x96117b[_0x71e0('0x49')]=[{'all':!![]}];}return db[_0x71e0('0xe3')][_0x71e0('0x4e')](_0x96117b);})['then'](function(_0x5acbb5){_0x48f6eb['rows']=_0x5acbb5;return _0x48f6eb;});}})['then'](respondWithFilteredResult(_0x824492,_0x96117b))[_0x71e0('0x21')](handleError(_0x824492,null));};exports[_0x71e0('0xe4')]=function(_0x5b01f9,_0x26488c){var _0x2dd7db={'raw':!![],'where':{}};var _0x521b36={};var _0x270b43={'count':0x0,'rows':[]};return db[_0x71e0('0x46')][_0x71e0('0xda')]({'where':{'id':_0x5b01f9[_0x71e0('0x5b')]['id']}})[_0x71e0('0x2c')](handleEntityNotFound(_0x26488c,null))[_0x71e0('0x2c')](function(_0x5c1c36){if(_0x5c1c36){_0x521b36['model']=_[_0x71e0('0x5d')](db[_0x71e0('0xe5')][_0x71e0('0x40')]);_0x521b36[_0x71e0('0x47')]=_[_0x71e0('0x5d')](_0x5b01f9[_0x71e0('0x47')]);_0x521b36['filters']=_[_0x71e0('0x5f')](_0x521b36[_0x71e0('0x60')],_0x521b36[_0x71e0('0x47')]);_0x2dd7db[_0x71e0('0x4c')]=_[_0x71e0('0x5f')](_0x521b36['model'],qs['fields'](_0x5b01f9[_0x71e0('0x47')][_0x71e0('0x61')]));_0x2dd7db[_0x71e0('0x4c')]=_0x2dd7db[_0x71e0('0x4c')]['length']?_0x2dd7db[_0x71e0('0x4c')]:_0x521b36[_0x71e0('0x60')];if(!_0x5b01f9[_0x71e0('0x47')][_0x71e0('0xd7')]('nolimit')){_0x2dd7db[_0x71e0('0x29')]=qs[_0x71e0('0x29')](_0x5b01f9[_0x71e0('0x47')][_0x71e0('0x29')]);_0x2dd7db['offset']=qs[_0x71e0('0x26')](_0x5b01f9[_0x71e0('0x47')][_0x71e0('0x26')]);}_0x2dd7db[_0x71e0('0xdc')]=qs['sort'](_0x5b01f9[_0x71e0('0x47')][_0x71e0('0xcf')]);_0x2dd7db['where']=qs[_0x71e0('0x5e')](_[_0x71e0('0xd1')](_0x5b01f9[_0x71e0('0x47')],_0x521b36[_0x71e0('0x5e')]));_0x2dd7db[_0x71e0('0xd0')][_0x71e0('0xe2')]=_0x5c1c36['id'];if(_0x5b01f9['query'][_0x71e0('0x36')]){_0x2dd7db[_0x71e0('0xd0')]=_[_0x71e0('0x62')](_0x2dd7db[_0x71e0('0xd0')],{'$or':_[_0x71e0('0x38')](_0x2dd7db[_0x71e0('0x4c')],function(_0x29f8a9){var _0x5ac10a={};_0x5ac10a[_0x29f8a9]={'$like':'%'+_0x5b01f9['query'][_0x71e0('0x36')]+'%'};return _0x5ac10a;})});}_0x2dd7db=_[_0x71e0('0x62')]({},_0x2dd7db,_0x5b01f9[_0x71e0('0xde')]);return db[_0x71e0('0xe5')][_0x71e0('0x28')]({'where':_0x2dd7db[_0x71e0('0xd0')]})[_0x71e0('0x2c')](function(_0x28731c){_0x270b43[_0x71e0('0x28')]=_0x28731c;if(_0x5b01f9[_0x71e0('0x47')]['includeAll']){_0x2dd7db['include']=[{'all':!![]}];}return db[_0x71e0('0xe5')][_0x71e0('0x4e')](_0x2dd7db);})[_0x71e0('0x2c')](function(_0x8dd815){_0x270b43[_0x71e0('0x4f')]=_0x8dd815;return _0x270b43;});}})[_0x71e0('0x2c')](respondWithFilteredResult(_0x26488c,_0x2dd7db))[_0x71e0('0x21')](handleError(_0x26488c,null));};exports[_0x71e0('0xe6')]=function(_0x3ac9fa,_0x962a51){var _0x1393c4={};var _0x1c0dba={};var _0x2d8c8c;var _0x345e60;return db['User'][_0x71e0('0xda')]({'where':{'id':_0x3ac9fa[_0x71e0('0x5b')]['id']}})['then'](handleEntityNotFound(_0x962a51,null))[_0x71e0('0x2c')](function(_0x34b741){if(_0x34b741){_0x2d8c8c=_0x34b741;_0x1c0dba[_0x71e0('0x60')]=_['keys'](db[_0x71e0('0xe7')][_0x71e0('0x40')]);_0x1c0dba[_0x71e0('0x47')]=_[_0x71e0('0x5d')](_0x3ac9fa[_0x71e0('0x47')]);_0x1c0dba['filters']=_[_0x71e0('0x5f')](_0x1c0dba[_0x71e0('0x60')],_0x1c0dba[_0x71e0('0x47')]);_0x1393c4[_0x71e0('0x4c')]=_[_0x71e0('0x5f')](_0x1c0dba['model'],qs[_0x71e0('0x61')](_0x3ac9fa[_0x71e0('0x47')][_0x71e0('0x61')]));_0x1393c4[_0x71e0('0x4c')]=_0x1393c4[_0x71e0('0x4c')][_0x71e0('0x52')]?_0x1393c4[_0x71e0('0x4c')]:_0x1c0dba[_0x71e0('0x60')];_0x1393c4['order']=qs['sort'](_0x3ac9fa[_0x71e0('0x47')][_0x71e0('0xcf')]);_0x1393c4[_0x71e0('0xd0')]=qs[_0x71e0('0x5e')](_[_0x71e0('0xd1')](_0x3ac9fa['query'],_0x1c0dba['filters']));if(_0x3ac9fa['query'][_0x71e0('0x36')]){_0x1393c4[_0x71e0('0xd0')]=_[_0x71e0('0x62')](_0x1393c4['where'],{'$or':_[_0x71e0('0x38')](_0x1393c4['attributes'],function(_0x4aea63){var _0x2cbfda={};_0x2cbfda[_0x4aea63]={'$like':'%'+_0x3ac9fa[_0x71e0('0x47')][_0x71e0('0x36')]+'%'};return _0x2cbfda;})});}_0x1393c4=_['merge']({},_0x1393c4,_0x3ac9fa['options']);return _0x2d8c8c[_0x71e0('0xe6')](_0x1393c4);}})[_0x71e0('0x2c')](function(_0x548fa8){if(_0x548fa8){_0x345e60=_0x548fa8[_0x71e0('0x52')];if(!_0x3ac9fa[_0x71e0('0x47')][_0x71e0('0xd7')]('nolimit')){_0x1393c4[_0x71e0('0x29')]=qs['limit'](_0x3ac9fa[_0x71e0('0x47')]['limit']);_0x1393c4[_0x71e0('0x26')]=qs[_0x71e0('0x26')](_0x3ac9fa[_0x71e0('0x47')][_0x71e0('0x26')]);}return _0x2d8c8c[_0x71e0('0xe6')](_0x1393c4);}})[_0x71e0('0x2c')](function(_0xec827a){if(_0xec827a){return _0xec827a?{'count':_0x345e60,'rows':_0xec827a}:null;}})[_0x71e0('0x2c')](respondWithResult(_0x962a51,null))[_0x71e0('0x21')](handleError(_0x962a51,null));};exports['getOpenchannelInteractions']=function(_0x32f0dc,_0xb7e74c){var _0xde7a1={};var _0x5394f7={};var _0x2d78c9;var _0x52d75d;return db[_0x71e0('0x46')][_0x71e0('0xda')]({'where':{'id':_0x32f0dc[_0x71e0('0x5b')]['id']}})['then'](handleEntityNotFound(_0xb7e74c,null))[_0x71e0('0x2c')](function(_0x554888){if(_0x554888){_0x2d78c9=_0x554888;_0x5394f7[_0x71e0('0x60')]=_[_0x71e0('0x5d')](db['OpenchannelInteraction']['rawAttributes']);_0x5394f7[_0x71e0('0x47')]=_[_0x71e0('0x5d')](_0x32f0dc['query']);_0x5394f7['filters']=_['intersection'](_0x5394f7[_0x71e0('0x60')],_0x5394f7[_0x71e0('0x47')]);_0xde7a1[_0x71e0('0x4c')]=_[_0x71e0('0x5f')](_0x5394f7[_0x71e0('0x60')],qs[_0x71e0('0x61')](_0x32f0dc[_0x71e0('0x47')][_0x71e0('0x61')]));_0xde7a1[_0x71e0('0x4c')]=_0xde7a1[_0x71e0('0x4c')][_0x71e0('0x52')]?_0xde7a1[_0x71e0('0x4c')]:_0x5394f7['model'];_0xde7a1[_0x71e0('0xdc')]=qs[_0x71e0('0xcf')](_0x32f0dc[_0x71e0('0x47')][_0x71e0('0xcf')]);_0xde7a1['where']=qs[_0x71e0('0x5e')](_[_0x71e0('0xd1')](_0x32f0dc[_0x71e0('0x47')],_0x5394f7['filters']));if(_0x32f0dc[_0x71e0('0x47')]['filter']){_0xde7a1[_0x71e0('0xd0')]=_[_0x71e0('0x62')](_0xde7a1[_0x71e0('0xd0')],{'$or':_[_0x71e0('0x38')](_0xde7a1[_0x71e0('0x4c')],function(_0x458dbf){var _0x4e98f3={};_0x4e98f3[_0x458dbf]={'$like':'%'+_0x32f0dc[_0x71e0('0x47')][_0x71e0('0x36')]+'%'};return _0x4e98f3;})});}_0xde7a1=_[_0x71e0('0x62')]({},_0xde7a1,_0x32f0dc[_0x71e0('0xde')]);return _0x2d78c9[_0x71e0('0xe8')](_0xde7a1);}})['then'](function(_0x5aeea7){if(_0x5aeea7){_0x52d75d=_0x5aeea7[_0x71e0('0x52')];if(!_0x32f0dc[_0x71e0('0x47')][_0x71e0('0xd7')]('nolimit')){_0xde7a1[_0x71e0('0x29')]=qs['limit'](_0x32f0dc[_0x71e0('0x47')]['limit']);_0xde7a1[_0x71e0('0x26')]=qs['offset'](_0x32f0dc['query'][_0x71e0('0x26')]);}return _0x2d78c9[_0x71e0('0xe8')](_0xde7a1);}})[_0x71e0('0x2c')](function(_0x336870){if(_0x336870){return _0x336870?{'count':_0x52d75d,'rows':_0x336870}:null;}})[_0x71e0('0x2c')](respondWithResult(_0xb7e74c,null))[_0x71e0('0x21')](handleError(_0xb7e74c,null));};exports[_0x71e0('0xe9')]=function(_0x2caabe,_0x596801){var _0x31ff8d={'raw':!![],'where':{}};var _0x4ee0f0={};var _0xba5999={'count':0x0,'rows':[]};return db[_0x71e0('0x46')]['findOne']({'where':{'id':_0x2caabe['params']['id']}})[_0x71e0('0x2c')](handleEntityNotFound(_0x596801,null))[_0x71e0('0x2c')](function(_0x20195a){if(_0x20195a){_0x4ee0f0[_0x71e0('0x60')]=_[_0x71e0('0x5d')](db['MailInteraction'][_0x71e0('0x40')]);_0x4ee0f0['query']=_[_0x71e0('0x5d')](_0x2caabe['query']);_0x4ee0f0['filters']=_[_0x71e0('0x5f')](_0x4ee0f0[_0x71e0('0x60')],_0x4ee0f0[_0x71e0('0x47')]);_0x31ff8d[_0x71e0('0x4c')]=_[_0x71e0('0x5f')](_0x4ee0f0[_0x71e0('0x60')],qs[_0x71e0('0x61')](_0x2caabe['query'][_0x71e0('0x61')]));_0x31ff8d[_0x71e0('0x4c')]=_0x31ff8d[_0x71e0('0x4c')][_0x71e0('0x52')]?_0x31ff8d[_0x71e0('0x4c')]:_0x4ee0f0['model'];if(!_0x2caabe['query']['hasOwnProperty'](_0x71e0('0xd8'))){_0x31ff8d[_0x71e0('0x29')]=qs[_0x71e0('0x29')](_0x2caabe[_0x71e0('0x47')]['limit']);_0x31ff8d['offset']=qs[_0x71e0('0x26')](_0x2caabe[_0x71e0('0x47')][_0x71e0('0x26')]);}_0x31ff8d['order']=qs[_0x71e0('0xcf')](_0x2caabe[_0x71e0('0x47')][_0x71e0('0xcf')]);_0x31ff8d[_0x71e0('0xd0')]=qs[_0x71e0('0x5e')](_['pick'](_0x2caabe[_0x71e0('0x47')],_0x4ee0f0[_0x71e0('0x5e')]));_0x31ff8d[_0x71e0('0xd0')][_0x71e0('0xe2')]=_0x20195a['id'];if(_0x2caabe[_0x71e0('0x47')][_0x71e0('0x36')]){_0x31ff8d[_0x71e0('0xd0')]=_[_0x71e0('0x62')](_0x31ff8d[_0x71e0('0xd0')],{'$or':_[_0x71e0('0x38')](_0x31ff8d['attributes'],function(_0x469e6e){var _0x2073ec={};_0x2073ec[_0x469e6e]={'$like':'%'+_0x2caabe['query'][_0x71e0('0x36')]+'%'};return _0x2073ec;})});}_0x31ff8d=_[_0x71e0('0x62')]({},_0x31ff8d,_0x2caabe['options']);return db['MailInteraction']['count']({'where':_0x31ff8d[_0x71e0('0xd0')]})[_0x71e0('0x2c')](function(_0xcf71d7){_0xba5999[_0x71e0('0x28')]=_0xcf71d7;if(_0x2caabe[_0x71e0('0x47')][_0x71e0('0x48')]){_0x31ff8d[_0x71e0('0x49')]=[{'all':!![]}];}return db['MailInteraction'][_0x71e0('0x4e')](_0x31ff8d);})[_0x71e0('0x2c')](function(_0x261e09){_0xba5999[_0x71e0('0x4f')]=_0x261e09;return _0xba5999;});}})[_0x71e0('0x2c')](respondWithFilteredResult(_0x596801,_0x31ff8d))[_0x71e0('0x21')](handleError(_0x596801,null));};exports[_0x71e0('0xea')]=function(_0x4c2b8a,_0x5e8549){var _0x50c917={};var _0x148268={};var _0x4d2c4a;var _0x13b316;return db[_0x71e0('0x46')][_0x71e0('0xda')]({'where':{'id':_0x4c2b8a[_0x71e0('0x5b')]['id']}})[_0x71e0('0x2c')](handleEntityNotFound(_0x5e8549,null))[_0x71e0('0x2c')](function(_0x5212c4){if(_0x5212c4){_0x4d2c4a=_0x5212c4;_0x148268['model']=_[_0x71e0('0x5d')](db[_0x71e0('0xeb')][_0x71e0('0x40')]);_0x148268['query']=_[_0x71e0('0x5d')](_0x4c2b8a[_0x71e0('0x47')]);_0x148268[_0x71e0('0x5e')]=_[_0x71e0('0x5f')](_0x148268[_0x71e0('0x60')],_0x148268['query']);_0x50c917['attributes']=_[_0x71e0('0x5f')](_0x148268[_0x71e0('0x60')],qs[_0x71e0('0x61')](_0x4c2b8a['query']['fields']));_0x50c917['attributes']=_0x50c917[_0x71e0('0x4c')][_0x71e0('0x52')]?_0x50c917['attributes']:_0x148268[_0x71e0('0x60')];_0x50c917[_0x71e0('0xdc')]=qs[_0x71e0('0xcf')](_0x4c2b8a[_0x71e0('0x47')][_0x71e0('0xcf')]);_0x50c917['where']=qs[_0x71e0('0x5e')](_[_0x71e0('0xd1')](_0x4c2b8a[_0x71e0('0x47')],_0x148268[_0x71e0('0x5e')]));if(_0x4c2b8a['query'][_0x71e0('0x36')]){_0x50c917['where']=_[_0x71e0('0x62')](_0x50c917[_0x71e0('0xd0')],{'$or':_[_0x71e0('0x38')](_0x50c917['attributes'],function(_0x6ab1b2){var _0x29c5e3={};_0x29c5e3[_0x6ab1b2]={'$like':'%'+_0x4c2b8a['query'][_0x71e0('0x36')]+'%'};return _0x29c5e3;})});}_0x50c917=_[_0x71e0('0x62')]({},_0x50c917,_0x4c2b8a[_0x71e0('0xde')]);return _0x4d2c4a[_0x71e0('0xea')](_0x50c917);}})[_0x71e0('0x2c')](function(_0x236f88){if(_0x236f88){_0x13b316=_0x236f88[_0x71e0('0x52')];if(!_0x4c2b8a[_0x71e0('0x47')][_0x71e0('0xd7')](_0x71e0('0xd8'))){_0x50c917['limit']=qs['limit'](_0x4c2b8a[_0x71e0('0x47')][_0x71e0('0x29')]);_0x50c917[_0x71e0('0x26')]=qs['offset'](_0x4c2b8a[_0x71e0('0x47')][_0x71e0('0x26')]);}return _0x4d2c4a[_0x71e0('0xea')](_0x50c917);}})[_0x71e0('0x2c')](function(_0x37d6c7){if(_0x37d6c7){return _0x37d6c7?{'count':_0x13b316,'rows':_0x37d6c7}:null;}})[_0x71e0('0x2c')](respondWithResult(_0x5e8549,null))['catch'](handleError(_0x5e8549,null));};exports[_0x71e0('0xec')]=function(_0x3bb1fc,_0x3a3252){var _0x3b9991={};var _0x5108b6={};var _0x5cd00f;var _0x16d647;return db['User']['findOne']({'where':{'id':_0x3bb1fc['params']['id']}})[_0x71e0('0x2c')](handleEntityNotFound(_0x3a3252,null))[_0x71e0('0x2c')](function(_0x403479){if(_0x403479){_0x5cd00f=_0x403479;_0x5108b6['model']=_[_0x71e0('0x5d')](db['FaxInteraction'][_0x71e0('0x40')]);_0x5108b6['query']=_['keys'](_0x3bb1fc[_0x71e0('0x47')]);_0x5108b6[_0x71e0('0x5e')]=_[_0x71e0('0x5f')](_0x5108b6['model'],_0x5108b6[_0x71e0('0x47')]);_0x3b9991[_0x71e0('0x4c')]=_[_0x71e0('0x5f')](_0x5108b6[_0x71e0('0x60')],qs[_0x71e0('0x61')](_0x3bb1fc[_0x71e0('0x47')][_0x71e0('0x61')]));_0x3b9991[_0x71e0('0x4c')]=_0x3b9991[_0x71e0('0x4c')][_0x71e0('0x52')]?_0x3b9991[_0x71e0('0x4c')]:_0x5108b6[_0x71e0('0x60')];_0x3b9991[_0x71e0('0xdc')]=qs[_0x71e0('0xcf')](_0x3bb1fc['query']['sort']);_0x3b9991['where']=qs[_0x71e0('0x5e')](_[_0x71e0('0xd1')](_0x3bb1fc[_0x71e0('0x47')],_0x5108b6['filters']));if(_0x3bb1fc[_0x71e0('0x47')][_0x71e0('0x36')]){_0x3b9991[_0x71e0('0xd0')]=_[_0x71e0('0x62')](_0x3b9991[_0x71e0('0xd0')],{'$or':_[_0x71e0('0x38')](_0x3b9991[_0x71e0('0x4c')],function(_0x47b5e6){var _0x5530aa={};_0x5530aa[_0x47b5e6]={'$like':'%'+_0x3bb1fc[_0x71e0('0x47')]['filter']+'%'};return _0x5530aa;})});}_0x3b9991=_[_0x71e0('0x62')]({},_0x3b9991,_0x3bb1fc[_0x71e0('0xde')]);return _0x5cd00f[_0x71e0('0xec')](_0x3b9991);}})[_0x71e0('0x2c')](function(_0x4cb705){if(_0x4cb705){_0x16d647=_0x4cb705[_0x71e0('0x52')];if(!_0x3bb1fc[_0x71e0('0x47')]['hasOwnProperty']('nolimit')){_0x3b9991['limit']=qs[_0x71e0('0x29')](_0x3bb1fc['query']['limit']);_0x3b9991['offset']=qs[_0x71e0('0x26')](_0x3bb1fc[_0x71e0('0x47')]['offset']);}return _0x5cd00f[_0x71e0('0xec')](_0x3b9991);}})[_0x71e0('0x2c')](function(_0x5f072e){if(_0x5f072e){return _0x5f072e?{'count':_0x16d647,'rows':_0x5f072e}:null;}})[_0x71e0('0x2c')](respondWithResult(_0x3a3252,null))['catch'](handleError(_0x3a3252,null));};exports['getWhatsappInteractions']=function(_0x2960dd,_0x4a8b51){var _0x81aa18={};var _0x564eab={};var _0x832e19;var _0x5280ea;return db[_0x71e0('0x46')][_0x71e0('0xda')]({'where':{'id':_0x2960dd[_0x71e0('0x5b')]['id']}})[_0x71e0('0x2c')](handleEntityNotFound(_0x4a8b51,null))[_0x71e0('0x2c')](function(_0x1c6e93){if(_0x1c6e93){_0x832e19=_0x1c6e93;_0x564eab[_0x71e0('0x60')]=_['keys'](db['WhatsappInteraction']['rawAttributes']);_0x564eab[_0x71e0('0x47')]=_[_0x71e0('0x5d')](_0x2960dd['query']);_0x564eab[_0x71e0('0x5e')]=_[_0x71e0('0x5f')](_0x564eab[_0x71e0('0x60')],_0x564eab[_0x71e0('0x47')]);_0x81aa18[_0x71e0('0x4c')]=_[_0x71e0('0x5f')](_0x564eab[_0x71e0('0x60')],qs[_0x71e0('0x61')](_0x2960dd[_0x71e0('0x47')][_0x71e0('0x61')]));_0x81aa18['attributes']=_0x81aa18[_0x71e0('0x4c')][_0x71e0('0x52')]?_0x81aa18[_0x71e0('0x4c')]:_0x564eab[_0x71e0('0x60')];_0x81aa18['order']=qs[_0x71e0('0xcf')](_0x2960dd['query'][_0x71e0('0xcf')]);_0x81aa18[_0x71e0('0xd0')]=qs['filters'](_[_0x71e0('0xd1')](_0x2960dd['query'],_0x564eab['filters']));if(_0x2960dd[_0x71e0('0x47')]['filter']){_0x81aa18[_0x71e0('0xd0')]=_['merge'](_0x81aa18[_0x71e0('0xd0')],{'$or':_[_0x71e0('0x38')](_0x81aa18[_0x71e0('0x4c')],function(_0x165467){var _0x1f2431={};_0x1f2431[_0x165467]={'$like':'%'+_0x2960dd[_0x71e0('0x47')][_0x71e0('0x36')]+'%'};return _0x1f2431;})});}_0x81aa18=_[_0x71e0('0x62')]({},_0x81aa18,_0x2960dd[_0x71e0('0xde')]);return _0x832e19[_0x71e0('0xed')](_0x81aa18);}})['then'](function(_0x3a968d){if(_0x3a968d){_0x5280ea=_0x3a968d[_0x71e0('0x52')];if(!_0x2960dd['query'][_0x71e0('0xd7')](_0x71e0('0xd8'))){_0x81aa18[_0x71e0('0x29')]=qs[_0x71e0('0x29')](_0x2960dd[_0x71e0('0x47')]['limit']);_0x81aa18[_0x71e0('0x26')]=qs[_0x71e0('0x26')](_0x2960dd[_0x71e0('0x47')][_0x71e0('0x26')]);}return _0x832e19['getWhatsappInteractions'](_0x81aa18);}})[_0x71e0('0x2c')](function(_0x4a6a2f){if(_0x4a6a2f){return _0x4a6a2f?{'count':_0x5280ea,'rows':_0x4a6a2f}:null;}})[_0x71e0('0x2c')](respondWithResult(_0x4a8b51,null))[_0x71e0('0x21')](handleError(_0x4a8b51,null));};exports[_0x71e0('0xee')]=function(_0x201911,_0x2a2e84,_0x21e004){var _0x2c3431;var _0x42647c;var _0x375578;var _0x5e744f=!_['isNil'](_0x201911[_0x71e0('0x5b')]['id'])?_0x201911[_0x71e0('0x5b')]['id']:!_[_0x71e0('0x70')](_0x201911[_0x71e0('0x34')]['id'])?_0x201911[_0x71e0('0x34')]['id']:null;return db[_0x71e0('0x46')][_0x71e0('0x63')]({'where':{'id':_0x5e744f,'role':{'$or':[_0x71e0('0x32'),_0x71e0('0x34'),_0x71e0('0x87')]}},'attributes':['id',_0x71e0('0x3b'),_0x71e0('0xef'),'mobile','role',_0x71e0('0x6a'),'loginInPause']})['then'](function(_0x156a51){if(_0x156a51){if(_0x156a51[_0x71e0('0x31')]===_0x71e0('0x87')){_0x2c3431=_0x156a51;if(_0x201911[_0x71e0('0x65')][_0x71e0('0xa9')]){_0x375578=util[_0x71e0('0xb3')](_0x71e0('0xf0'),_0x2c3431[_0x201911['body']['interface']]);}else if(_0x201911[_0x71e0('0x65')][_0x71e0('0xf1')]){_0x375578=util['format'](_0x71e0('0xb4'),_0x201911[_0x71e0('0x65')]['intrf']);}else{_0x375578=util['format']('SIP/%s',_0x2c3431['name']);}socket['to'](util['format']('user:%s',_0x2c3431['name']))[_0x71e0('0x2d')](_0x71e0('0xf2'),{'user':{'id':_0x2c3431['id'],'name':_0x2c3431[_0x71e0('0x3b')]},'ip':_0x201911[_0x71e0('0xf3')][_0x71e0('0xf4')]||_0x201911[_0x71e0('0xf5')][_0x71e0('0xf6')]||_0x201911[_0x71e0('0xf7')][_0x71e0('0xf6')]||_0x201911[_0x71e0('0xf5')][_0x71e0('0xf7')][_0x71e0('0xf6')]});return db[_0x71e0('0xb6')][_0x71e0('0x2f')]({'where':{'membername':_0x2c3431['name']},'individualHooks':!![]});}}else{throw new db[(_0x71e0('0x9b'))][(_0x71e0('0x9c'))](_0x71e0('0xf8'));}})[_0x71e0('0x2c')](function(){if(_0x2c3431){return _0x2c3431[_0x71e0('0xf9')]({'raw':!![]});}})[_0x71e0('0x2c')](function(_0x2f2b89){if(_0x2c3431){var _0x46fe22=[];if(_0x2f2b89){_0x42647c=_0x2f2b89;if(_0x42647c['length']){for(var _0x37aa23=0x0;_0x37aa23<_0x42647c[_0x71e0('0x52')];_0x37aa23++){_0x46fe22[_0x71e0('0x4d')]({'membername':_0x2c3431[_0x71e0('0x3b')],'UserId':_0x2c3431['id'],'queue_name':_0x42647c[_0x37aa23][_0x71e0('0x3b')],'VoiceQueueId':_0x42647c[_0x37aa23]['id'],'interface':_0x375578,'paused':_0x2c3431['loginInPause']||![],'penalty':_0x42647c[_0x37aa23][_0x71e0('0xfa')]||0x0});}return BPromise[_0x71e0('0x94')](_0x46fe22,function(_0x2f7914){return db[_0x71e0('0xb6')][_0x71e0('0xb7')](_0x2f7914);});}}}})[_0x71e0('0x2c')](function(){if(_0x2c3431){return db[_0x71e0('0xfb')]['findAll']({'where':{'membername':_0x2c3431['name'],'exitAt':null}});}})[_0x71e0('0x2c')](function(_0x42b3fc){if(_0x2c3431){var _0x34df2c=[];_0x42b3fc[_0x71e0('0xfc')](function(_0x3a8eee){_0x34df2c['push'](_0x3a8eee[_0x71e0('0x2b')]({'exitAt':moment()[_0x71e0('0xb3')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x71e0('0x59')](_0x34df2c);}})[_0x71e0('0x2c')](function(){if(_0x2c3431){var _0x513c62=[];var _0x341d14=[];var _0x42e5d8=utils['getChannels']();var _0x5a73a3={'membername':_0x2c3431['name'],'interface':_0x375578,'enterAt':moment()['format'](_0x71e0('0xfd')),'role':_0x2c3431['role'],'internal':_0x2c3431[_0x71e0('0x6a')]};_0x42e5d8['forEach'](function(_0x3a0b2e){_0x513c62[_0x71e0('0x4d')](_[_0x71e0('0x62')]({'channel':_0x3a0b2e,'type':_0x71e0('0xfe'),'data1':_0x201911['body'][_0x71e0('0xff')],'data2':_0x375578},_0x5a73a3));if(_0x2c3431[_0x71e0('0xa8')]){_0x341d14[_0x71e0('0x4d')](_['merge']({'channel':_0x3a0b2e,'type':_0x71e0('0x100'),'data1':_0x71e0('0x101')},_0x5a73a3));}});return db[_0x71e0('0xfb')][_0x71e0('0x92')](_0x513c62[_0x71e0('0xcd')](_0x341d14),{'individualHooks':!![]});}})[_0x71e0('0x2c')](function(){if(_0x2c3431){return _0x2c3431[_0x71e0('0x2b')]({'online':!![],'lastLoginAt':moment()['format'](_0x71e0('0xfd')),'voicePause':_0x2c3431[_0x71e0('0xa8')]||![],'mailPause':_0x2c3431[_0x71e0('0xa8')]||![],'chatPause':_0x2c3431[_0x71e0('0xa8')]||![],'faxPause':_0x2c3431[_0x71e0('0xa8')]||![],'smsPause':_0x2c3431[_0x71e0('0xa8')]||![],'openchannelPause':_0x2c3431[_0x71e0('0xa8')]||![],'whatsappPause':_0x2c3431[_0x71e0('0xa8')]||![],'pauseType':_0x2c3431[_0x71e0('0xa8')]?_0x71e0('0x101'):null,'interface':_0x375578,'lastPauseAt':moment()[_0x71e0('0xb3')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x71e0('0x2c')](function(_0x2ee4ae){if(_0x201911[_0x71e0('0x102')]){return _0x21e004();}else{return BPromise[_0x71e0('0x103')](_0x2ee4ae)[_0x71e0('0x2c')](respondWithResult(_0x2a2e84,null));}})[_0x71e0('0x21')](handleError(_0x2a2e84,null));};exports[_0x71e0('0x104')]=function(_0x1e59d2,_0x1d5af6){var _0x312a81;return db['User'][_0x71e0('0x63')]({'where':{'id':_0x1e59d2[_0x71e0('0x5b')]['id'],'role':_0x71e0('0x87')},'attributes':['id',_0x71e0('0x3b'),_0x71e0('0x31')]})[_0x71e0('0x2c')](handleEntityNotFound(_0x1d5af6,null))[_0x71e0('0x2c')](function(_0x5284e9){if(_0x5284e9){_0x312a81=_0x5284e9;return db[_0x71e0('0xb6')][_0x71e0('0x2f')]({'where':{'membername':_0x312a81[_0x71e0('0x3b')]},'individualHooks':!![]});}})[_0x71e0('0x2c')](function(){return db[_0x71e0('0xfb')]['findAll']({'where':{'membername':_0x312a81[_0x71e0('0x3b')],'exitAt':null}});})[_0x71e0('0x2c')](function(_0x13b956){var _0x27bf90=[];_0x13b956[_0x71e0('0xfc')](function(_0x2de665){_0x27bf90['push'](_0x2de665[_0x71e0('0x2b')]({'exitAt':moment()['format'](_0x71e0('0xfd'))}));});return BPromise[_0x71e0('0x59')](_0x27bf90);})[_0x71e0('0x2c')](function(){return _0x312a81[_0x71e0('0x2b')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x71e0('0x2c')](respondWithResult(_0x1d5af6,null))[_0x71e0('0x21')](handleError(_0x1d5af6,null));};exports[_0x71e0('0x105')]=function(_0x52f0f1,_0x45d55f){var _0x44f211;return db[_0x71e0('0xb6')][_0x71e0('0x2b')]({'paused':0x1},{'where':{'UserId':_0x52f0f1['params']['id']},'individualHooks':!![]})[_0x71e0('0x2c')](function(){return db[_0x71e0('0x46')][_0x71e0('0x63')]({'where':{'id':_0x52f0f1[_0x71e0('0x5b')]['id'],'role':_0x71e0('0x87')},'attributes':['id',_0x71e0('0x3b'),_0x71e0('0x31'),_0x71e0('0x6a'),'interface']});})[_0x71e0('0x2c')](handleEntityNotFound(_0x45d55f,null))[_0x71e0('0x2c')](function(_0x5ac828){if(_0x5ac828){_0x44f211=_0x5ac828;return respondWithRpcPromise(_0x71e0('0x106'),'pause',{'id':_0x44f211['id'],'name':_0x44f211['name'],'pause':!![]});}})['then'](function(){if(_0x44f211){return db[_0x71e0('0xfb')]['findAll']({'where':{'membername':_0x44f211['name'],'type':'PAUSE','exitAt':null}});}})[_0x71e0('0x2c')](function(_0x27ae0c){if(_0x27ae0c[_0x71e0('0x52')]){var _0x52926d=moment()['format'](_0x71e0('0xfd'));for(var _0x183e27=0x0,_0x1e9044=_0x27ae0c['length'];_0x183e27<_0x1e9044;_0x183e27++){_0x27ae0c[_0x183e27]['updateAttributes']({'exitAt':_0x52926d});}}})[_0x71e0('0x2c')](function(){var _0x18f2ef=[];var _0x55ce49=utils['getChannels']();_0x55ce49[_0x71e0('0xfc')](function(_0x3a4c66){_0x18f2ef[_0x71e0('0x4d')]({'channel':_0x3a4c66,'membername':_0x44f211[_0x71e0('0x3b')],'interface':_[_0x71e0('0x70')](_0x44f211[_0x71e0('0xa9')])?util[_0x71e0('0xb3')](_0x71e0('0xb4'),_0x44f211['name']):_0x44f211[_0x71e0('0xa9')],'type':_0x71e0('0x100'),'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x52f0f1['body'][_0x71e0('0x41')]||_0x71e0('0x107'),'role':_0x44f211[_0x71e0('0x31')],'internal':_0x44f211[_0x71e0('0x6a')]});});return db['MemberReport'][_0x71e0('0x92')](_0x18f2ef,{'individualHooks':!![]});})[_0x71e0('0x2c')](function(){return _0x44f211[_0x71e0('0x2b')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x52f0f1['body']['type']||_0x71e0('0x107'),'lastPauseAt':moment()['format'](_0x71e0('0xfd'))});})['then'](respondWithResult(_0x45d55f,null))[_0x71e0('0x21')](handleError(_0x45d55f,null));};exports['unpause']=function(_0x5043df,_0x3b88dc){var _0x3f85f9;return db[_0x71e0('0x46')][_0x71e0('0x63')]({'where':{'id':_0x5043df[_0x71e0('0x5b')]['id']},'attributes':['id',_0x71e0('0x3b'),_0x71e0('0x31'),_0x71e0('0xb5'),_0x71e0('0x108'),_0x71e0('0x109'),_0x71e0('0x10a'),_0x71e0('0x10b'),_0x71e0('0x10c'),_0x71e0('0x10d'),_0x71e0('0x10e'),_0x71e0('0x10f')]})[_0x71e0('0x2c')](handleEntityNotFound(_0x3b88dc,null))[_0x71e0('0x2c')](function(_0x7f42ae){if(_0x7f42ae){_0x3f85f9=_0x7f42ae;if(_0x5043df[_0x71e0('0x65')][_0x71e0('0xa6')]&&!utils['isValidChannel'](_0x5043df[_0x71e0('0x65')][_0x71e0('0xa6')])){throw new db[(_0x71e0('0x9b'))][(_0x71e0('0x9c'))](_0x71e0('0xab'));}switch(_0x5043df[_0x71e0('0x65')]['channel']){case _0x71e0('0xbb'):return respondWithRpcPromise(_0x71e0('0x106'),'unpause',{'id':_0x3f85f9['id'],'name':_0x3f85f9[_0x71e0('0x3b')],'pause':![]})[_0x71e0('0x2c')](function(){return db[_0x71e0('0xb6')][_0x71e0('0x2b')]({'paused':0x0},{'where':{'UserId':_0x3f85f9['id']},'individualHooks':!![]});})[_0x71e0('0x2c')](function(){return db['MemberReport']['find']({'where':{'channel':_0x5043df['body'][_0x71e0('0xa6')],'membername':_0x3f85f9[_0x71e0('0x3b')],'type':_0x71e0('0x100'),'exitAt':null}});})['then'](function(_0x27d9f1){if(_0x27d9f1){return _0x27d9f1['update']({'exitAt':moment()[_0x71e0('0xb3')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0x71e0('0x2c')](function(){return _0x3f85f9[_0x71e0('0x2b')]({'voicePause':![]});});case _0x71e0('0x64'):case _0x71e0('0x53'):case _0x71e0('0x56'):case _0x71e0('0x54'):case _0x71e0('0x58'):case'openchannel':return db[_0x71e0('0xfb')][_0x71e0('0x63')]({'where':{'channel':_0x5043df[_0x71e0('0x65')][_0x71e0('0xa6')],'membername':_0x3f85f9[_0x71e0('0x3b')],'type':_0x71e0('0x100'),'exitAt':null}})['then'](function(_0x2de8e3){if(_0x2de8e3){return _0x2de8e3['update']({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x71e0('0x110')},{'individualHooks':!![]});}return null;})['then'](function(){var _0x4ac61b={};_[_0x71e0('0x111')](_0x4ac61b,util[_0x71e0('0xb3')](_0x71e0('0x112'),_0x5043df[_0x71e0('0x65')][_0x71e0('0xa6')],_0x71e0('0x113')),![]);return _0x3f85f9['update'](_0x4ac61b);});default:return respondWithRpcPromise(_0x71e0('0x106'),_0x71e0('0x114'),{'id':_0x3f85f9['id'],'name':_0x3f85f9[_0x71e0('0x3b')],'pause':![]})[_0x71e0('0x2c')](function(){return db['UserVoiceQueueRt']['update']({'paused':0x0},{'where':{'UserId':_0x3f85f9['id']}});})[_0x71e0('0x2c')](function(){return db[_0x71e0('0xfb')][_0x71e0('0x4e')]({'where':{'membername':_0x3f85f9['name'],'type':_0x71e0('0x100'),'exitAt':null}});})[_0x71e0('0x2c')](function(_0x3c490a){var _0x416099=[];_0x3c490a[_0x71e0('0xfc')](function(_0x15a5dc){_0x416099[_0x71e0('0x4d')](_0x15a5dc[_0x71e0('0x2b')]({'exitAt':moment()[_0x71e0('0xb3')](_0x71e0('0xfd')),'data2':'manual'}));});return BPromise[_0x71e0('0x59')](_0x416099);})['then'](function(){return _0x3f85f9[_0x71e0('0x2b')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x71e0('0x2c')](respondWithResult(_0x3b88dc,null))[_0x71e0('0x21')](handleError(_0x3b88dc,null));};exports[_0x71e0('0x115')]=function(_0x48d0f5,_0x2b6720){var _0x508d08={};var _0x447933={};var _0x49a961;var _0xec14a0;return db[_0x71e0('0x46')][_0x71e0('0xda')]({'where':{'id':_0x48d0f5[_0x71e0('0x5b')]['id']}})[_0x71e0('0x2c')](handleEntityNotFound(_0x2b6720,null))[_0x71e0('0x2c')](function(_0x1b82f9){if(_0x1b82f9){_0x49a961=_0x1b82f9;_0x447933['model']=_[_0x71e0('0x5d')](db[_0x71e0('0x116')][_0x71e0('0x40')]);_0x447933[_0x71e0('0x47')]=_[_0x71e0('0x5d')](_0x48d0f5[_0x71e0('0x47')]);_0x447933[_0x71e0('0x5e')]=_[_0x71e0('0x5f')](_0x447933[_0x71e0('0x60')],_0x447933[_0x71e0('0x47')]);_0x508d08['attributes']=_[_0x71e0('0x5f')](_0x447933[_0x71e0('0x60')],qs[_0x71e0('0x61')](_0x48d0f5[_0x71e0('0x47')]['fields']));_0x508d08['attributes']=_0x508d08['attributes'][_0x71e0('0x52')]?_0x508d08[_0x71e0('0x4c')]:_0x447933[_0x71e0('0x60')];_0x508d08['order']=qs[_0x71e0('0xcf')](_0x48d0f5[_0x71e0('0x47')][_0x71e0('0xcf')]);_0x508d08['where']=qs[_0x71e0('0x5e')](_[_0x71e0('0xd1')](_0x48d0f5[_0x71e0('0x47')],_0x447933[_0x71e0('0x5e')]));if(_0x48d0f5['query']['filter']){_0x508d08['where']=_['merge'](_0x508d08[_0x71e0('0xd0')],{'$or':_[_0x71e0('0x38')](_0x508d08['attributes'],function(_0x2ab87b){var _0x65fe06={};_0x65fe06[_0x2ab87b]={'$like':'%'+_0x48d0f5[_0x71e0('0x47')][_0x71e0('0x36')]+'%'};return _0x65fe06;})});}_0x508d08=_[_0x71e0('0x62')]({},_0x508d08,_0x48d0f5[_0x71e0('0xde')]);return _0x49a961[_0x71e0('0x115')](_0x508d08);}})[_0x71e0('0x2c')](function(_0x7af536){if(_0x7af536){_0xec14a0=_0x7af536['length'];if(!_0x48d0f5[_0x71e0('0x47')][_0x71e0('0xd7')](_0x71e0('0xd8'))){_0x508d08[_0x71e0('0x29')]=qs[_0x71e0('0x29')](_0x48d0f5[_0x71e0('0x47')][_0x71e0('0x29')]);_0x508d08['offset']=qs[_0x71e0('0x26')](_0x48d0f5[_0x71e0('0x47')][_0x71e0('0x26')]);}return _0x49a961[_0x71e0('0x115')](_0x508d08);}})[_0x71e0('0x2c')](function(_0x3b1b8a){if(_0x3b1b8a){return _0x3b1b8a?{'count':_0xec14a0,'rows':_0x3b1b8a}:null;}})[_0x71e0('0x2c')](respondWithResult(_0x2b6720,null))['catch'](handleError(_0x2b6720,null));};exports[_0x71e0('0x117')]=function(_0x5313e9,_0x52c0c9){var _0x304fbc=_0x5313e9[_0x71e0('0x5b')]['id'];var _0x12935d=_0x5313e9[_0x71e0('0x65')]?_0x5313e9[_0x71e0('0x65')][_0x71e0('0x68')]:null;var _0x3a600f=[];return Promise[_0x71e0('0x103')]()[_0x71e0('0x2c')](function(){if(!_0x12935d)throw new APIBadRequestError(_0x71e0('0x118'));})['then'](function(){return db[_0x71e0('0x46')][_0x71e0('0xda')]({'where':{'id':_0x304fbc}});})[_0x71e0('0x2c')](function(_0x11dd8e){if(!_0x11dd8e)throw new APINotFoundError(util['format'](_0x71e0('0x119'),_0x5313e9[_0x71e0('0x5b')]['id']));return db['sequelize']['transaction'](function(_0x13cef1){return _0x11dd8e[_0x71e0('0x117')](_0x12935d,{'transaction':_0x13cef1})[_0x71e0('0x2c')](function(){return db['Team'][_0x71e0('0x4e')]({'where':{'id':{'$in':_0x12935d}}});})[_0x71e0('0x2c')](function(_0x3a7491){var _0x44a5ca=_['map'](_0x3a7491,function(_0x471263){return _0x471263['getAssociatedQueues']();});return Promise['all'](_0x44a5ca);})['then'](function(_0x1fdf6f){_0x3a600f=_[_0x71e0('0x11a')](_0x1fdf6f);var _0x51b437=_[_0x71e0('0x38')](_0x3a600f,function(_0x1cddd6){return _0x1cddd6[_0x71e0('0x11b')](_0x11dd8e['id'],{'transaction':_0x13cef1});});return Promise[_0x71e0('0x59')](_0x51b437);})[_0x71e0('0x2c')](function(){if(!_0x11dd8e[_0x71e0('0xa7')])return;var _0x3dc75d=_[_0x71e0('0x36')](_0x3a600f,function(_0x5da157){return _0x5da157[_0x71e0('0x11c')](_0x71e0('0xa6'))===_0x71e0('0x11d');});var _0xb7d1c2=_[_0x71e0('0x38')](_0x3dc75d,function(_0x4060aa){return db[_0x71e0('0xb6')][_0x71e0('0xb7')]({'membername':_0x11dd8e[_0x71e0('0x3b')],'UserId':_0x11dd8e['id'],'queue_name':_0x4060aa['name'],'VoiceQueueId':_0x4060aa['id'],'interface':_[_0x71e0('0x70')](_0x11dd8e[_0x71e0('0xa9')])?util[_0x71e0('0xb3')](_0x71e0('0xb4'),_0x11dd8e['name']):_0x11dd8e[_0x71e0('0xa9')],'paused':_0x11dd8e['voicePause']||![],'penalty':_0x11dd8e['penalty']},{'transaction':_0x13cef1});});return Promise[_0x71e0('0x59')](_0xb7d1c2);})[_0x71e0('0x2c')](function(){return db[_0x71e0('0x11e')][_0x71e0('0x4e')]({'where':{'teamId':{'$in':_0x12935d}}});})[_0x71e0('0x2c')](function(_0x5044be){var _0x5f56fc=_[_0x71e0('0x38')](_0x5044be,function(_0x44dbcb){return db[_0x71e0('0x11f')][_0x71e0('0x86')]({'UserId':_0x11dd8e['id'],'VoicePrefixId':_0x44dbcb['VoicePrefixId']},{'transaction':_0x13cef1});});return Promise[_0x71e0('0x59')](_0x5f56fc);});});})[_0x71e0('0x2c')](function(){for(var _0xc20a94=0x0;_0xc20a94<_0x3a600f[_0x71e0('0x52')];_0xc20a94++){var _0x13b369=_0x3a600f[_0xc20a94][_0x71e0('0x11c')](_0x71e0('0xa6'));var _0x2ef87b=_0x13b369+_0x71e0('0xb1');socket[_0x71e0('0x2d')]('user'+_0x13b369+'Queue:save',{'UserId':_0x304fbc,['queueField']:_0x3a600f[_0xc20a94]['id']});}})[_0x71e0('0x2c')](respondWithStatusCode(_0x52c0c9,null))[_0x71e0('0x21')](APIHandleError(_0x52c0c9));};exports[_0x71e0('0x120')]=function(_0x14f6c5,_0xb4aeb1){var _0x3f96f0=_0x14f6c5[_0x71e0('0x5b')]['id'];var _0x2f761c=null;if(_0x14f6c5[_0x71e0('0x47')]['ids']){_0x2f761c=_['isArray'](_0x14f6c5[_0x71e0('0x47')][_0x71e0('0x68')])?_0x14f6c5[_0x71e0('0x47')][_0x71e0('0x68')]:[_0x14f6c5[_0x71e0('0x47')][_0x71e0('0x68')]];}var _0x100663=[];return Promise[_0x71e0('0x103')]()[_0x71e0('0x2c')](function(){if(!_0x2f761c)throw new APIBadRequestError(_0x71e0('0x121'));})[_0x71e0('0x2c')](function(){return db[_0x71e0('0x46')]['findOne']({'where':{'id':_0x3f96f0}});})[_0x71e0('0x2c')](function(_0x2f41cf){if(!_0x2f41cf)throw new APINotFoundError(util[_0x71e0('0xb3')](_0x71e0('0x119'),_0x14f6c5[_0x71e0('0x5b')]['id']));return db[_0x71e0('0x72')][_0x71e0('0x122')](function(_0x26b6cc){return _0x2f41cf[_0x71e0('0x120')](_0x2f761c,{'transaction':_0x26b6cc})[_0x71e0('0x2c')](function(){return db[_0x71e0('0x116')]['findAll']({'where':{'id':{'$in':_0x2f761c}}});})[_0x71e0('0x2c')](function(_0x4464a0){var _0x2ad7c4=_[_0x71e0('0x38')](_0x4464a0,function(_0xce89be){return _0xce89be['getAssociatedQueues']();});return Promise[_0x71e0('0x59')](_0x2ad7c4);})['then'](function(_0x3d1ed2){_0x100663=_['flattenDeep'](_0x3d1ed2);var _0x31361f=_[_0x71e0('0x38')](_0x100663,function(_0x3423ac){return _0x3423ac[_0x71e0('0x123')](_0x2f41cf['id'],{'transaction':_0x26b6cc});});return Promise[_0x71e0('0x59')](_0x31361f);})[_0x71e0('0x2c')](function(){if(!_0x2f41cf[_0x71e0('0xa7')])return;var _0xfd027a=_[_0x71e0('0x36')](_0x100663,function(_0x126f7e){return _0x126f7e[_0x71e0('0x11c')](_0x71e0('0xa6'))===_0x71e0('0x11d');});var _0x168c99=_[_0x71e0('0x38')](_0xfd027a,function(_0x580054){return db[_0x71e0('0xb6')]['destroy']({'where':{'VoiceQueueId':_0x580054['id'],'UserId':_0x2f41cf['id']},'transaction':_0x26b6cc});});return Promise[_0x71e0('0x59')](_0x168c99);})[_0x71e0('0x2c')](function(){return db[_0x71e0('0x11e')]['findAll']({'where':{'teamId':{'$in':_0x2f761c}}});})[_0x71e0('0x2c')](function(_0x1ca82c){var _0x7f4e0f=_[_0x71e0('0x38')](_0x1ca82c,function(_0x59cbc6){return db[_0x71e0('0x11f')][_0x71e0('0x2f')]({'where':{'UserId':_0x2f41cf['id'],'VoicePrefixId':_0x59cbc6['VoicePrefixId']}},{'transaction':_0x26b6cc});});return Promise[_0x71e0('0x59')](_0x7f4e0f);});});})['then'](function(){for(var _0x36843d=0x0;_0x36843d<_0x100663[_0x71e0('0x52')];_0x36843d++){var _0x3b92de=_0x100663[_0x36843d][_0x71e0('0x11c')](_0x71e0('0xa6'));var _0x18534c=_0x3b92de+_0x71e0('0xb1');socket[_0x71e0('0x2d')](_0x71e0('0x34')+_0x3b92de+'Queue:remove',{'UserId':_0x3f96f0,['queueField']:_0x100663[_0x36843d]['id']});}})[_0x71e0('0x2c')](respondWithStatusCode(_0xb4aeb1,null))[_0x71e0('0x21')](APIHandleError(_0xb4aeb1));};exports[_0x71e0('0x124')]=function(_0x46c03f,_0x50210d){var _0x26bb7b={};var _0x504e0b={};var _0x657877;var _0x411a01;return db[_0x71e0('0x46')][_0x71e0('0xda')]({'where':{'id':_0x46c03f[_0x71e0('0x5b')]['id']}})['then'](handleEntityNotFound(_0x50210d,null))['then'](function(_0x307e62){if(_0x307e62){_0x657877=_0x307e62;_0x504e0b[_0x71e0('0x60')]=_[_0x71e0('0x5d')](db['CmList'][_0x71e0('0x40')]);_0x504e0b['query']=_[_0x71e0('0x5d')](_0x46c03f[_0x71e0('0x47')]);_0x504e0b['filters']=_[_0x71e0('0x5f')](_0x504e0b[_0x71e0('0x60')],_0x504e0b[_0x71e0('0x47')]);_0x26bb7b[_0x71e0('0x4c')]=_[_0x71e0('0x5f')](_0x504e0b[_0x71e0('0x60')],qs[_0x71e0('0x61')](_0x46c03f['query'][_0x71e0('0x61')]));_0x26bb7b[_0x71e0('0x4c')]=_0x26bb7b['attributes']['length']?_0x26bb7b['attributes']:_0x504e0b[_0x71e0('0x60')];_0x26bb7b['order']=qs[_0x71e0('0xcf')](_0x46c03f[_0x71e0('0x47')][_0x71e0('0xcf')]);_0x26bb7b[_0x71e0('0xd0')]=qs[_0x71e0('0x5e')](_[_0x71e0('0xd1')](_0x46c03f[_0x71e0('0x47')],_0x504e0b[_0x71e0('0x5e')]));if(_0x46c03f['query'][_0x71e0('0x36')]){_0x26bb7b[_0x71e0('0xd0')]=_[_0x71e0('0x62')](_0x26bb7b[_0x71e0('0xd0')],{'$or':_[_0x71e0('0x38')](_0x26bb7b[_0x71e0('0x4c')],function(_0x176dee){var _0x39813e={};_0x39813e[_0x176dee]={'$like':'%'+_0x46c03f[_0x71e0('0x47')]['filter']+'%'};return _0x39813e;})});}_0x26bb7b=_['merge']({},_0x26bb7b,_0x46c03f['options']);return _0x657877[_0x71e0('0x124')](_0x26bb7b);}})['then'](function(_0x2b81d5){if(_0x2b81d5){_0x411a01=_0x2b81d5['length'];if(!_0x46c03f[_0x71e0('0x47')][_0x71e0('0xd7')](_0x71e0('0xd8'))){_0x26bb7b[_0x71e0('0x29')]=qs[_0x71e0('0x29')](_0x46c03f[_0x71e0('0x47')]['limit']);_0x26bb7b[_0x71e0('0x26')]=qs[_0x71e0('0x26')](_0x46c03f[_0x71e0('0x47')][_0x71e0('0x26')]);}return _0x657877['getLists'](_0x26bb7b);}})['then'](function(_0x5d8f92){if(_0x5d8f92){return _0x5d8f92?{'count':_0x411a01,'rows':_0x5d8f92}:null;}})[_0x71e0('0x2c')](respondWithResult(_0x50210d,null))[_0x71e0('0x21')](handleError(_0x50210d,null));};exports[_0x71e0('0x125')]=function(_0x56c678,_0x145634){var _0x136596={};var _0xc8712c={};var _0x4816c2;return db['User'][_0x71e0('0xda')]({'where':{'id':_0x56c678[_0x71e0('0x5b')]['id']}})[_0x71e0('0x2c')](handleEntityNotFound(_0x145634,null))[_0x71e0('0x2c')](function(_0x389e68){if(_0x389e68){_0x4816c2=_0x389e68;_0xc8712c['model']=_[_0x71e0('0x5d')](db[_0x71e0('0x46')][_0x71e0('0x40')]);_0xc8712c[_0x71e0('0x47')]=_[_0x71e0('0x5d')](_0x56c678[_0x71e0('0x47')]);_0xc8712c[_0x71e0('0x5e')]=_['intersection'](_0xc8712c[_0x71e0('0x60')],_0xc8712c[_0x71e0('0x47')]);_0x136596[_0x71e0('0x4c')]=_[_0x71e0('0x5f')](_0xc8712c[_0x71e0('0x60')],qs['fields'](_0x56c678[_0x71e0('0x47')][_0x71e0('0x61')]));_0x136596[_0x71e0('0x4c')]=_0x136596[_0x71e0('0x4c')][_0x71e0('0x52')]?_0x136596[_0x71e0('0x4c')]:_0xc8712c['model'];_0x136596[_0x71e0('0xdc')]=qs[_0x71e0('0xcf')](_0x56c678[_0x71e0('0x47')][_0x71e0('0xcf')]);_0x136596[_0x71e0('0xd0')]=qs[_0x71e0('0x5e')](_[_0x71e0('0xd1')](_0x56c678[_0x71e0('0x47')],_0xc8712c['filters']));if(_0x56c678[_0x71e0('0x47')]['filter']){_0x136596['where']=_[_0x71e0('0x62')](_0x136596[_0x71e0('0xd0')],{'$or':_['map'](_0x136596[_0x71e0('0x4c')],function(_0x5bddac){var _0x260954={};_0x260954[_0x5bddac]={'$like':'%'+_0x56c678['query'][_0x71e0('0x36')]+'%'};return _0x260954;})});}_0x136596['model']=db[_0x71e0('0x46')];_0x136596['as']=_0x71e0('0x95');_0x136596=_[_0x71e0('0x62')]({},_0x136596,_0x56c678[_0x71e0('0xde')]);return _0x4816c2[_0x71e0('0xf9')]({'include':[_0x136596]});}})['then'](function(_0x287084){if(_0x287084){var _0x4e927c={},_0x265159=[];for(var _0x4a5676=0x0;_0x4a5676<_0x287084[_0x71e0('0x52')];_0x4a5676+=0x1){for(var _0x521b5d=0x0,_0x23d43a;_0x521b5d<_0x287084[_0x4a5676][_0x71e0('0x95')]['length'];_0x521b5d+=0x1){_0x23d43a=_0x287084[_0x4a5676][_0x71e0('0x95')][_0x521b5d][_0x71e0('0x30')]({'plain':!![]});_0x4e927c[_0x23d43a['id']]=_0x23d43a;}}_0x4e927c=_[_0x71e0('0x126')](_0x4e927c);for(var _0x4732d7=qs[_0x71e0('0x26')](_0x56c678[_0x71e0('0x47')][_0x71e0('0x26')]);_0x4732d7<_0x4e927c[_0x71e0('0x52')]&&_0x265159[_0x71e0('0x52')]=_0x2b3656){_0x39d0b6=_0x2b3656;_0x41bac4=0xc8;}else{_0x41bac4=0xce;}_0x32a2c5[_0x56b3('0x1d')](_0x41bac4);return _0x32a2c5['set']('Content-Range',_0x49c0e7+'-'+_0x39d0b6+'/'+_0x2b3656)[_0x56b3('0x1f')](_0xdc2e1);}return null;};}function saveUpdates(_0x489366){return function(_0x2de533){if(_0x2de533){return _0x2de533[_0x56b3('0x24')](_0x489366)[_0x56b3('0x14')](function(_0x5c02bb){socket[_0x56b3('0x25')](_0x56b3('0x26')+_0x5c02bb['id'],{});return _0x5c02bb;});}return null;};}function removeEntity(_0x39165d){return function(_0x5a5db8){if(_0x5a5db8){return _0x5a5db8[_0x56b3('0x27')]()[_0x56b3('0x14')](function(){var _0x5bf6e5=_0x5a5db8[_0x56b3('0x28')]({'plain':!![]});if(_0x5bf6e5[_0x56b3('0x29')]===_0x56b3('0x2a'))return;var _0x58c053=[{'name':_0x56b3('0x2b'),'value':_0x56b3('0x2c'),'ignore':!![]},{'name':'Agents','value':_0x56b3('0x2d'),'ignore':![]},{'name':_0x56b3('0x2e'),'value':_0x56b3('0x2f'),'ignore':![]}];var _0x6f7794=_(_0x58c053)['filter'](_0x56b3('0x30'))[_0x56b3('0x31')](_0x56b3('0x32'))[_0x56b3('0x32')]();if(_['includes'](_0x6f7794,_0x5bf6e5[_0x56b3('0x29')])){return;}var _0x167dab=_['find'](_0x58c053,[_0x56b3('0x32'),_0x5bf6e5[_0x56b3('0x29')]])[_0x56b3('0x33')];return db[_0x56b3('0x34')][_0x56b3('0x27')]({'where':{'type':_0x167dab,'resourceId':_0x5bf6e5['id']}})[_0x56b3('0x14')](function(){return _0x5a5db8;});})[_0x56b3('0x14')](function(){_0x39165d[_0x56b3('0x1d')](0xcc)[_0x56b3('0x1e')]();});}};}function handleEntityNotFound(_0x556cc4){return function(_0x3e7b29){if(!_0x3e7b29){_0x556cc4[_0x56b3('0x35')](0x194);}return _0x3e7b29;};}function handleError(_0x199b34,_0x49d838){_0x49d838=_0x49d838||0x1f4;return function(_0x5534e7){logger['error'](_0x5534e7[_0x56b3('0x36')]);if(_0x5534e7[_0x56b3('0x33')]){delete _0x5534e7[_0x56b3('0x33')];}_0x199b34['status'](_0x49d838)[_0x56b3('0x37')](_0x5534e7);};}exports[_0x56b3('0x38')]=function(_0x5a4520,_0x456bd7){var _0x5ad6ff={},_0x25d030={'count':0x0,'rows':[]};var _0xef149a=_(db[_0x56b3('0x39')][_0x56b3('0x3a')])[_0x56b3('0x31')](function(_0x18dcdd){return{'name':_0x18dcdd[_0x56b3('0x3b')],'type':_0x18dcdd['type']['key']};})[_0x56b3('0x3c')](function(_0x577468){return!_['includes'](['password',_0x56b3('0x3d')],_0x577468[_0x56b3('0x33')]);})[_0x56b3('0x32')]();_0x5ad6ff=qs[_0x56b3('0x3e')](_0xef149a,_0x5a4520);var _0x4b3599={'where':_0x5ad6ff[_0x56b3('0x3f')]};return db['User'][_0x56b3('0x22')](_0x4b3599)[_0x56b3('0x14')](function(_0x6281cc){_0x25d030[_0x56b3('0x22')]=_0x6281cc;if(_0x5a4520[_0x56b3('0x40')][_0x56b3('0x41')]){_0x5ad6ff[_0x56b3('0x42')]=[{'all':!![]}];}if(_0x5a4520[_0x56b3('0x40')]['userSetting']===_0x56b3('0x43')){_0x5ad6ff[_0x56b3('0x42')]=[{'model':db[_0x56b3('0x44')],'as':_0x56b3('0x45')}];}if(!_[_0x56b3('0x46')](_0x5ad6ff[_0x56b3('0x47')],'id')){_0x5ad6ff[_0x56b3('0x47')][_0x56b3('0x48')]('id');}return db[_0x56b3('0x39')][_0x56b3('0x49')](_0x5ad6ff);})['then'](function(_0x2f4fae){_0x25d030[_0x56b3('0x4a')]=_0x2f4fae;if(_0x5a4520[_0x56b3('0x40')][_0x56b3('0x4b')]==='true'){var _0x1cfa3f=[];for(var _0x4d326c=0x0;_0x4d326c<_0x25d030['rows'][_0x56b3('0x4c')];_0x4d326c++){_0x1cfa3f[_0x56b3('0x48')](get_open_tabs(_0x56b3('0x4d'),_0x25d030[_0x56b3('0x4a')][_0x4d326c][_0x56b3('0x4e')]));_0x1cfa3f[_0x56b3('0x48')](get_open_tabs(_0x56b3('0x4f'),_0x25d030[_0x56b3('0x4a')][_0x4d326c]['dataValues']));_0x1cfa3f['push'](get_open_tabs('fax',_0x25d030[_0x56b3('0x4a')][_0x4d326c][_0x56b3('0x4e')]));_0x1cfa3f[_0x56b3('0x48')](get_open_tabs(_0x56b3('0x50'),_0x25d030['rows'][_0x4d326c][_0x56b3('0x4e')]));_0x1cfa3f[_0x56b3('0x48')](get_open_tabs('openchannel',_0x25d030['rows'][_0x4d326c]['dataValues']));_0x1cfa3f[_0x56b3('0x48')](get_open_tabs(_0x56b3('0x51'),_0x25d030['rows'][_0x4d326c][_0x56b3('0x4e')]));}return BPromise[_0x56b3('0x52')](_0x1cfa3f)[_0x56b3('0x14')](function(){return _0x25d030;});}else{return _0x25d030;}})[_0x56b3('0x14')](respondWithFilteredResult(_0x456bd7,_0x5ad6ff))[_0x56b3('0x1c')](handleError(_0x456bd7,null));};exports[_0x56b3('0x53')]=function(_0x16c853,_0xdbd38){var _0x3c4d26={'raw':![],'where':{'id':_0x16c853['params']['id']}},_0x484765={};_0x484765['model']=_[_0x56b3('0x54')](_[_0x56b3('0x55')](db[_0x56b3('0x39')]['rawAttributes']),[_0x56b3('0x56'),'salt']);_0x484765[_0x56b3('0x40')]=_[_0x56b3('0x55')](_0x16c853['query']);_0x484765[_0x56b3('0x57')]=_['intersection'](_0x484765[_0x56b3('0x58')],_0x484765[_0x56b3('0x40')]);_0x3c4d26[_0x56b3('0x47')]=_[_0x56b3('0x59')](_0x484765[_0x56b3('0x58')],qs[_0x56b3('0x5a')](_0x16c853[_0x56b3('0x40')][_0x56b3('0x5a')]));_0x3c4d26[_0x56b3('0x47')]=_0x3c4d26[_0x56b3('0x47')][_0x56b3('0x4c')]?_0x3c4d26[_0x56b3('0x47')]:_0x484765['model'];if(_0x16c853['query']['includeAll']){_0x3c4d26[_0x56b3('0x42')]=[{'all':!![]}];}if(_0x16c853[_0x56b3('0x40')]['userSetting']===_0x56b3('0x43')){_0x3c4d26['include']=[{'model':db['UserSetting'],'as':_0x56b3('0x45')}];}_0x3c4d26=_['merge']({},_0x3c4d26,_0x16c853[_0x56b3('0x5b')]);if(!_[_0x56b3('0x46')](_0x3c4d26[_0x56b3('0x47')],'id')){_0x3c4d26['attributes'][_0x56b3('0x48')]('id');}return db[_0x56b3('0x39')][_0x56b3('0x5c')](_0x3c4d26)['then'](handleEntityNotFound(_0xdbd38,null))[_0x56b3('0x14')](function(_0x28661c){var _0x5477b5=[];values=_0x28661c;if(_0x16c853[_0x56b3('0x40')][_0x56b3('0x4b')]==='true'){_0x5477b5[_0x56b3('0x48')](get_open_tabs(_0x56b3('0x4d'),_0x28661c[_0x56b3('0x4e')]));_0x5477b5['push'](get_open_tabs(_0x56b3('0x4f'),_0x28661c[_0x56b3('0x4e')]));_0x5477b5[_0x56b3('0x48')](get_open_tabs(_0x56b3('0x5d'),_0x28661c[_0x56b3('0x4e')]));_0x5477b5[_0x56b3('0x48')](get_open_tabs(_0x56b3('0x51'),_0x28661c['dataValues']));_0x5477b5[_0x56b3('0x48')](get_open_tabs('fax',_0x28661c[_0x56b3('0x4e')]));_0x5477b5[_0x56b3('0x48')](get_open_tabs(_0x56b3('0x50'),_0x28661c[_0x56b3('0x4e')]));return BPromise[_0x56b3('0x52')](_0x5477b5);}else{return values;}})[_0x56b3('0x14')](function(){return values;})[_0x56b3('0x14')](respondWithResult(_0xdbd38,null))[_0x56b3('0x1c')](handleError(_0xdbd38,null));};exports[_0x56b3('0x24')]=function(_0xf5d637,_0x454210){if(_0xf5d637[_0x56b3('0x5e')]['id']){delete _0xf5d637[_0x56b3('0x5e')]['id'];}delete _0xf5d637[_0x56b3('0x5e')][_0x56b3('0x29')];return db[_0x56b3('0x39')]['find']({'where':{'id':_0xf5d637[_0x56b3('0x5f')]['id']}})[_0x56b3('0x14')](handleEntityNotFound(_0x454210,null))[_0x56b3('0x14')](saveUpdates(_0xf5d637[_0x56b3('0x5e')],null))[_0x56b3('0x14')](respondWithResult(_0x454210,null))[_0x56b3('0x1c')](handleError(_0x454210,null));};exports[_0x56b3('0x60')]=function(_0xce3b9a,_0x12b70b){return db[_0x56b3('0x39')][_0x56b3('0x60')]()[_0x56b3('0x14')](respondWithResult(_0x12b70b,null))[_0x56b3('0x1c')](handleError(_0x12b70b,null));};exports[_0x56b3('0x61')]=function(_0x563e85,_0xb8bd05){return db[_0x56b3('0x39')]['find']({'where':{'id':_0x563e85[_0x56b3('0x5f')]['id']}})[_0x56b3('0x14')](handleEntityNotFound(_0xb8bd05,null))[_0x56b3('0x14')](function(_0x17f06a){if(_0x17f06a){return _0x17f06a[_0x56b3('0x61')](_0x563e85[_0x56b3('0x5e')]['ids'],_['omit'](_0x563e85[_0x56b3('0x5e')],[_0x56b3('0x62'),'id'])||{});}})[_0x56b3('0x14')](respondWithResult(_0xb8bd05,null))['catch'](handleError(_0xb8bd05,null));};function validateUser(_0x36790d){return new BPromise(function(_0x20c459,_0x2e84f0){if(_0x36790d[_0x56b3('0x63')])return _0x20c459(_0x36790d);return db[_0x56b3('0x64')]['findById'](0x1)[_0x56b3('0x14')](function(_0x347db1){if(_0x347db1[_0x56b3('0x65')])authService[_0x56b3('0x66')](_0x36790d['password']);db[_0x56b3('0x39')]['max'](_0x56b3('0x63'))[_0x56b3('0x14')](function(_0x4fb6bc){if(_[_0x56b3('0x67')](_0x4fb6bc)){_0x36790d[_0x56b3('0x63')]=_0x347db1[_0x56b3('0x68')]||0x1;return;}if(_[_0x56b3('0x67')](_0x347db1[_0x56b3('0x68')])||_0x347db1[_0x56b3('0x68')]===_0x4fb6bc){_0x36790d[_0x56b3('0x63')]=_0x4fb6bc+0x1;return;}if(_0x347db1[_0x56b3('0x68')]>_0x4fb6bc){_0x36790d[_0x56b3('0x63')]=_0x347db1[_0x56b3('0x68')];return;}return db['sequelize']['query'](_0x56b3('0x69'),{'type':db[_0x56b3('0x6a')]['QueryTypes']['SELECT']})[_0x56b3('0x14')](function(_0x2edfd1){if(_0x2edfd1&&_0x2edfd1[_0x56b3('0x4c')]){for(var _0x5bdf06=0x0,_0x56aee2=_0x2edfd1[_0x56b3('0x4c')];_0x5bdf06<_0x56aee2&&_['isNil'](_0x36790d[_0x56b3('0x63')]);_0x5bdf06++){if(_0x347db1[_0x56b3('0x68')]<=_0x2edfd1[_0x5bdf06][_0x56b3('0x6b')]){_0x36790d[_0x56b3('0x63')]=_0x2edfd1[_0x5bdf06]['from'];}else if(_0x347db1['min_internal']>_0x2edfd1[_0x5bdf06][_0x56b3('0x6b')]&&_0x347db1[_0x56b3('0x68')]<=_0x2edfd1[_0x5bdf06]['to']){_0x36790d['internal']=_0x347db1[_0x56b3('0x68')];}}}if(_[_0x56b3('0x67')](_0x36790d[_0x56b3('0x63')])){_0x36790d['internal']=_0x4fb6bc+0x1;}return _0x20c459(_0x36790d);});});})['catch'](function(_0x31e708){_0x2e84f0(_0x31e708);});});}function updateUser(_0x3a5a51){return new BPromise(function(_0x29225e,_0x510883){try{if(_0x3a5a51[_0x56b3('0x6c')]){_0x3a5a51[_0x56b3('0x6d')]=_0x3a5a51[_0x56b3('0x63')];_0x3a5a51[_0x56b3('0x6e')]={'mailbox':_0x3a5a51[_0x56b3('0x63')],'password':_0x3a5a51[_0x56b3('0x56')],'fullname':_0x3a5a51[_0x56b3('0x6f')],'email':_0x3a5a51[_0x56b3('0x70')]};}if(_0x3a5a51['role']===_0x56b3('0x2d')){if(!_0x3a5a51['permissions'])_0x3a5a51[_0x56b3('0x71')]=[_0x56b3('0x72'),_0x56b3('0x73'),_0x56b3('0x74'),_0x56b3('0x75'),_0x56b3('0x76'),_0x56b3('0x77'),'105',_0x56b3('0x78'),'107',_0x56b3('0x79'),_0x56b3('0x7a'),_0x56b3('0x7b'),_0x56b3('0x7c'),_0x56b3('0x7d'),_0x56b3('0x7e')];}_0x29225e(_0x3a5a51);}catch(_0x1b2e9e){_0x510883(_0x1b2e9e);}});}exports['create']=function(_0x45ce8e,_0x26c5a4){if(_0x45ce8e[_0x56b3('0x2c')][_0x56b3('0x29')]===_0x56b3('0x2d'))throw new Error('Unauthorized');if(_0x45ce8e[_0x56b3('0x5e')][_0x56b3('0x29')]===_0x56b3('0x2c')&&_0x45ce8e['user'][_0x56b3('0x29')]!==_0x56b3('0x2a')){throw new Error(_0x56b3('0x7f'));}if(_0x45ce8e[_0x56b3('0x5e')][_0x56b3('0x29')]===_0x56b3('0x2a')&&_0x45ce8e[_0x56b3('0x2c')][_0x56b3('0x29')]!==_0x56b3('0x2a')){throw new Error(_0x56b3('0x80'));}return licenseUtil[_0x56b3('0x81')]([_0x45ce8e['body']])[_0x56b3('0x14')](function(){return validateUser(_0x45ce8e[_0x56b3('0x5e')]);})[_0x56b3('0x14')](function(_0x168b89){return updateUser(_0x168b89)['then'](function(_0x35b796){if(_0x35b796[_0x56b3('0x29')]===_0x56b3('0x2a')){_0x35b796[_0x56b3('0x82')]=_0x45ce8e[_0x56b3('0x2c')]['settingsEnabled'];delete _0x35b796['userProfileId'];}return _0x35b796;});})[_0x56b3('0x14')](function(_0x27b3ee){return db[_0x56b3('0x39')][_0x56b3('0x83')](_0x27b3ee,{'include':[{'model':db[_0x56b3('0x6e')],'as':_0x56b3('0x6e')}]});})[_0x56b3('0x14')](function(_0x6eb927){if(_0x45ce8e[_0x56b3('0x5e')][_0x56b3('0x29')]===_0x56b3('0x2c'))return _0x6eb927;if(_0x45ce8e[_0x56b3('0x2c')][_0x56b3('0x29')]!=='user')return _0x6eb927;return db[_0x56b3('0x84')]['find']({'where':{'name':_0x6eb927[_0x56b3('0x29')]===_0x56b3('0x2d')?'Agents':_0x56b3('0x2e'),'userProfileId':_0x45ce8e[_0x56b3('0x2c')][_0x56b3('0x85')]},'raw':!![]})['then'](function(_0x4fd7fa){if(!_0x4fd7fa||_0x4fd7fa['autoAssociation']!=0x0)return _0x6eb927;return db[_0x56b3('0x34')][_0x56b3('0x83')]({'name':_0x6eb927[_0x56b3('0x33')],'resourceId':_0x6eb927['id'],'type':_0x4fd7fa['name'],'sectionId':_0x4fd7fa['id']},{})['then'](function(){return _0x6eb927;});})[_0x56b3('0x1c')](function(_0x31a259){logger[_0x56b3('0x19')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x31a259);throw _0x31a259;});})[_0x56b3('0x14')](respondWithResult(_0x26c5a4,0xc9))[_0x56b3('0x1c')](handleError(_0x26c5a4,null));};exports[_0x56b3('0x86')]=function(_0x2eec44,_0x2a52d9){var _0x3e5e8f=_0x2eec44['body'];var _0x4cb80c=[];if(_0x2eec44['user'][_0x56b3('0x29')]===_0x56b3('0x2d'))throw new Error('Unauthorized');if(_[_0x56b3('0x87')](_0x3e5e8f,[_0x56b3('0x29'),'user'])&&_0x2eec44['user']['role']!==_0x56b3('0x2a')){throw new Error(_0x56b3('0x7f'));}if(_[_0x56b3('0x87')](_0x3e5e8f,[_0x56b3('0x29'),'admin'])&&_0x2eec44[_0x56b3('0x2c')][_0x56b3('0x29')]!==_0x56b3('0x2a')){throw new Error(_0x56b3('0x88'));}return licenseUtil[_0x56b3('0x81')](_0x3e5e8f)[_0x56b3('0x14')](function(){return validateUser(_0x3e5e8f[0x0]);})['then'](function(){for(var _0x236e17=0x1;_0x236e17<_0x3e5e8f[_0x56b3('0x4c')];_0x236e17++){var _0x89cdff=_0x3e5e8f[_0x236e17-0x1]['internal'];if(!_0x3e5e8f[_0x236e17][_0x56b3('0x63')])_0x3e5e8f[_0x236e17][_0x56b3('0x63')]=_0x89cdff+0x1;_0x4cb80c['push'](validateUser(_0x3e5e8f[_0x236e17]));}return BPromise[_0x56b3('0x52')](_0x4cb80c);})[_0x56b3('0x14')](function(){_0x4cb80c=[];for(var _0x291343=0x0;_0x291343<_0x3e5e8f[_0x56b3('0x4c')];_0x291343++){_0x4cb80c[_0x56b3('0x48')](updateUser(_0x3e5e8f[_0x291343]));}return BPromise[_0x56b3('0x52')](_0x4cb80c);})['then'](function(){return BPromise['each'](_0x3e5e8f,function(_0x46b115){return db[_0x56b3('0x39')][_0x56b3('0x83')](_0x46b115,{'include':[{'model':db[_0x56b3('0x6e')],'as':'VoiceMail'}]})[_0x56b3('0x14')](function(_0x27037d){_0x46b115['id']=_0x27037d['id'];return _0x46b115;});});})[_0x56b3('0x14')](function(_0x3bdc02){if(_0x2eec44[_0x56b3('0x5e')][_0x56b3('0x29')]===_0x56b3('0x2c'))return _0x3bdc02;if(_0x2eec44['user'][_0x56b3('0x29')]!==_0x56b3('0x2c'))return _0x3bdc02;var _0x321088=_['some'](_0x3bdc02,function(_0x1acb09){return _0x1acb09['role']===_0x56b3('0x2d')||_0x1acb09['role']===_0x56b3('0x2f');});if(!_0x321088)return _0x3bdc02;return db[_0x56b3('0x84')][_0x56b3('0x49')]({'where':{'name':{'$or':[_0x56b3('0x89'),_0x56b3('0x2e')]},'userProfileId':_0x2eec44['user'][_0x56b3('0x85')]},'raw':!![]})[_0x56b3('0x14')](function(_0x3262a4){if(_[_0x56b3('0x8a')](_0x3262a4)||!_[_0x56b3('0x87')](_0x3262a4,[_0x56b3('0x8b'),0x0]))return _0x3bdc02;_0x4cb80c=[];var _0x166e14=_(_0x3262a4)[_0x56b3('0x31')](function(_0x28e364){if(_0x28e364[_0x56b3('0x8b')]===0x1)return;return _0x28e364[_0x56b3('0x33')]==='Agents'?_0x56b3('0x2d'):_0x56b3('0x2f');})[_0x56b3('0x8c')]()[_0x56b3('0x32')]();for(var _0xe4f850=0x0;_0xe4f850<_0x3bdc02[_0x56b3('0x4c')];_0xe4f850++){if(!_[_0x56b3('0x46')](_0x166e14,_0x3bdc02[_0xe4f850][_0x56b3('0x29')]))return;var _0x2b2e33=_0x3bdc02[_0xe4f850][_0x56b3('0x29')]===_0x56b3('0x2d')?_0x56b3('0x89'):_0x56b3('0x2e');_0x4cb80c[_0x56b3('0x48')](db['UserProfileResource']['create']({'name':_0x3bdc02[_0xe4f850]['name'],'resourceId':_0x3bdc02[_0xe4f850]['id'],'type':_0x2b2e33,'sectionId':_[_0x56b3('0x5c')](_0x3262a4,[_0x56b3('0x33'),_0x2b2e33])['id']},{}));}return BPromise[_0x56b3('0x52')](_0x4cb80c);});})[_0x56b3('0x14')](respondWithResult(_0x2a52d9,0xc9))[_0x56b3('0x1c')](handleError(_0x2a52d9,null));};exports[_0x56b3('0x8d')]=function(_0x26a831,_0xe07ca6){if(_0x26a831[_0x56b3('0x5e')]['id']){delete _0x26a831[_0x56b3('0x5e')]['id'];}return db[_0x56b3('0x39')][_0x56b3('0x5c')]({'where':{'id':_0x26a831['params']['id']}})[_0x56b3('0x14')](function(_0x43b064){if(!_0x43b064)return null;if(_0x43b064['id']===_0x26a831[_0x56b3('0x2c')]['id']){if(!_0x26a831[_0x56b3('0x5e')][_0x56b3('0x8e')]||!_0x26a831[_0x56b3('0x5e')][_0x56b3('0x8f')]){throw new db[(_0x56b3('0x90'))][(_0x56b3('0x91'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x43b064['authenticate'](_0x26a831[_0x56b3('0x5e')]['oldPassword'])){throw new db[(_0x56b3('0x90'))][(_0x56b3('0x91'))]('Wrong\x20credentials');}if(_0x26a831['body'][_0x56b3('0x8e')]===_0x26a831[_0x56b3('0x5e')]['newPassword']){throw new db['Sequelize'][(_0x56b3('0x91'))](_0x56b3('0x92'));}}else if(_0x26a831[_0x56b3('0x2c')]['role']==='admin'){if(!_0x26a831[_0x56b3('0x5e')][_0x56b3('0x8f')]){throw new db[(_0x56b3('0x90'))][(_0x56b3('0x91'))](_0x56b3('0x93'));}}else if(_0x26a831[_0x56b3('0x2c')]['role']===_0x56b3('0x2c')){if(!_0x26a831[_0x56b3('0x5e')][_0x56b3('0x8f')]){throw new db[(_0x56b3('0x90'))][(_0x56b3('0x91'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x43b064[_0x56b3('0x29')]!==_0x56b3('0x2d')){throw new db[(_0x56b3('0x90'))][(_0x56b3('0x91'))](_0x56b3('0x94'));}}else{throw new db[(_0x56b3('0x90'))][(_0x56b3('0x91'))]('Unauthorized');}return _0x43b064;})['then'](handleEntityNotFound(_0xe07ca6,null))[_0x56b3('0x14')](function(_0x27437d){return db[_0x56b3('0x64')][_0x56b3('0x95')]({'attributes':['id','securePassword',_0x56b3('0x96'),'passwordHistoryLimit']})[_0x56b3('0x14')](function(_0x18aca6){if(_0x18aca6[_0x56b3('0x65')])authService[_0x56b3('0x66')](_0x26a831[_0x56b3('0x5e')][_0x56b3('0x8f')]);if(!_0x18aca6[_0x56b3('0x96')]||!_0x27437d[_0x56b3('0x97')])return _0x27437d;authService['validatePasswordHistory'](_0x26a831[_0x56b3('0x5e')][_0x56b3('0x8f')],_0x27437d[_0x56b3('0x97')],_0x18aca6[_0x56b3('0x98')]);return _0x27437d;})[_0x56b3('0x14')](saveUpdates({'password':_0x26a831[_0x56b3('0x5e')]['newPassword'],'passwordResetAt':_0x26a831['user']['id']==_0x26a831[_0x56b3('0x5f')]['id']?moment():null,'previousPasswords':authService[_0x56b3('0x99')](_0x26a831[_0x56b3('0x5e')]['newPassword'],_0x27437d['previousPasswords'])},null));})[_0x56b3('0x14')](respondWithResult(_0xe07ca6,null))['catch'](handleError(_0xe07ca6,null));};exports['addQueues']=function(_0x1f51bb,_0x489d75){var _0x127f22=_0x1f51bb[_0x56b3('0x5e')]['channel'];return db[_0x56b3('0x39')][_0x56b3('0x5c')]({'where':{'id':_0x1f51bb['params']['id']},'attributes':['id',_0x56b3('0x33'),'role',_0x56b3('0x9a'),_0x56b3('0x9b'),_0x56b3('0x9c'),_0x56b3('0x9d')]})[_0x56b3('0x14')](handleEntityNotFound(_0x489d75,null))[_0x56b3('0x14')](function(_0x5335af){if(_0x5335af){if(!utils[_0x56b3('0x9e')](_0x127f22)){throw new db[(_0x56b3('0x90'))][(_0x56b3('0x91'))]('Unknown\x20channel');}return _0x5335af['add'+_[_0x56b3('0x9f')](_0x127f22['toLowerCase']())+'Queues'](_0x1f51bb[_0x56b3('0x5e')][_0x56b3('0x62')],{'penalty':_0x1f51bb[_0x56b3('0x5e')][_0x56b3('0xa0')]||0x0})[_0x56b3('0xa1')](function(_0x12c561){for(var _0x3b3493=0x0;_0x3b3493<_0x1f51bb[_0x56b3('0x5e')][_0x56b3('0x62')][_0x56b3('0x4c')];_0x3b3493+=0x1){var _0x175a2d={'UserId':Number(_0x1f51bb[_0x56b3('0x5f')]['id'])};_0x175a2d[_[_0x56b3('0x9f')](_0x127f22[_0x56b3('0xa2')]())+'QueueId']=Number(_0x1f51bb[_0x56b3('0x5e')][_0x56b3('0x62')][_0x3b3493]);socket['emit'](_0x56b3('0x2c')+_[_0x56b3('0x9f')](_0x127f22[_0x56b3('0xa2')]())+_0x56b3('0xa3'),_0x175a2d);}return _0x12c561;})[_0x56b3('0x14')](function(){if(_0x127f22==='voice'){return db[_0x56b3('0xa4')][_0x56b3('0x49')]({'where':{'id':_0x1f51bb[_0x56b3('0x5e')]['ids']||[]},'raw':!![],'attributes':['id','name']});}})['then'](function(_0x11625d){var _0x4bc2b8=_0x5335af[_0x56b3('0x28')]({'plain':!![]});var _0x4386a9=[];if(_0x127f22===_0x56b3('0xa5')&&_0x4bc2b8['role']==='agent'&&_0x4bc2b8[_0x56b3('0x9a')]){for(var _0x57dfab=0x0;_0x57dfab<_0x11625d[_0x56b3('0x4c')];_0x57dfab+=0x1){_0x4386a9[_0x56b3('0x48')]({'membername':_0x4bc2b8['name'],'UserId':_0x4bc2b8['id'],'queue_name':_0x11625d[_0x57dfab][_0x56b3('0x33')],'VoiceQueueId':_0x11625d[_0x57dfab]['id'],'interface':_[_0x56b3('0x67')](_0x4bc2b8[_0x56b3('0x9d')])?util[_0x56b3('0xa6')]('SIP/%s',_0x4bc2b8[_0x56b3('0x33')]):_0x4bc2b8[_0x56b3('0x9d')],'paused':_0x4bc2b8[_0x56b3('0x9c')]||![],'penalty':_0x1f51bb[_0x56b3('0x5e')][_0x56b3('0xa0')]||0x0});}return BPromise['each'](_0x4386a9,function(_0x160475){return db[_0x56b3('0xa7')][_0x56b3('0xa8')](_0x160475);});}return _0x5335af;});}})[_0x56b3('0x14')](respondWithStatusCode(_0x489d75,null))[_0x56b3('0x1c')](handleError(_0x489d75,null));};exports['removeQueues']=function(_0x59f250,_0x3f8e3c){var _0x4bc015,_0x3750b1;return db[_0x56b3('0x39')]['find']({'where':{'id':_0x59f250['params']['id']},'attributes':['id',_0x56b3('0x33'),_0x56b3('0x29')]})[_0x56b3('0x14')](handleEntityNotFound(_0x3f8e3c,null))[_0x56b3('0x14')](function(_0x12d891){if(_0x12d891){_0x4bc015=_0x12d891;if(!_0x59f250[_0x56b3('0x40')][_0x56b3('0xa9')]||!utils[_0x56b3('0x9e')](_0x59f250[_0x56b3('0x40')][_0x56b3('0xa9')])){throw new db[(_0x56b3('0x90'))][(_0x56b3('0x91'))]('Unknown\x20channel');}return _0x12d891[_0x56b3('0xaa')+_[_0x56b3('0x9f')](_0x59f250['query']['channel']['toLowerCase']())+_0x56b3('0xab')](_0x59f250['query'][_0x56b3('0x62')]);}})['then'](function(_0x28964c){if(_[_0x56b3('0xac')](_0x59f250[_0x56b3('0x40')]['ids'])){for(var _0x55c9f7=0x0;_0x55c9f7<_0x59f250[_0x56b3('0x40')][_0x56b3('0x62')][_0x56b3('0x4c')];_0x55c9f7+=0x1){_0x3750b1={'UserId':Number(_0x59f250[_0x56b3('0x5f')]['id'])};_0x3750b1[_[_0x56b3('0x9f')](_0x59f250['query']['channel'][_0x56b3('0xa2')]())+_0x56b3('0xad')]=Number(_0x59f250[_0x56b3('0x40')][_0x56b3('0x62')][_0x55c9f7]);socket[_0x56b3('0x25')](_0x56b3('0x2c')+_[_0x56b3('0x9f')](_0x59f250[_0x56b3('0x40')][_0x56b3('0xa9')]['toLowerCase']())+_0x56b3('0xae'),_0x3750b1);}}else{_0x3750b1={'UserId':Number(_0x59f250[_0x56b3('0x5f')]['id'])};_0x3750b1[_[_0x56b3('0x9f')](_0x59f250[_0x56b3('0x40')][_0x56b3('0xa9')][_0x56b3('0xa2')]())+_0x56b3('0xad')]=Number(_0x59f250[_0x56b3('0x40')][_0x56b3('0x62')]);socket[_0x56b3('0x25')](_0x56b3('0x2c')+_[_0x56b3('0x9f')](_0x59f250[_0x56b3('0x40')][_0x56b3('0xa9')][_0x56b3('0xa2')]())+_0x56b3('0xae'),_0x3750b1);}return _0x28964c;})['then'](function(){if(_0x59f250[_0x56b3('0x40')]['channel']===_0x56b3('0xa5')){return db['UserVoiceQueueRt'][_0x56b3('0x27')]({'where':{'UserId':_0x59f250[_0x56b3('0x5f')]['id'],'VoiceQueueId':_0x59f250[_0x56b3('0x40')][_0x56b3('0x62')]},'individualHooks':!![]})[_0x56b3('0x14')](function(){return _0x4bc015;});}return _0x4bc015;})['then'](respondWithStatusCode(_0x3f8e3c,null))[_0x56b3('0x1c')](handleError(_0x3f8e3c,null));};exports['addAvatar']=function(_0x433776,_0x21b2d4){_0x433776[_0x56b3('0x5e')][_0x56b3('0xaf')]=_0x433776[_0x56b3('0xb0')]['filename'];return db['User'][_0x56b3('0x5c')]({'where':{'id':_0x433776[_0x56b3('0x5f')]['id']}})[_0x56b3('0x14')](handleEntityNotFound(_0x21b2d4,null))['then'](saveUpdates(_0x433776[_0x56b3('0x5e')],null))[_0x56b3('0x14')](respondWithResult(_0x21b2d4,null))[_0x56b3('0x1c')](handleError(_0x21b2d4,null));};exports[_0x56b3('0xb1')]=function(_0x3a50a6,_0xc77958){var _0x226227=path[_0x56b3('0xb2')](config['root'],_0x56b3('0xb3'));return db[_0x56b3('0x39')][_0x56b3('0x5c')]({'where':{'id':_0x3a50a6[_0x56b3('0x5f')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0x56b3('0x14')](handleEntityNotFound(_0xc77958,null))['then'](function(_0x315542){if(_0x315542){if(_[_0x56b3('0x67')](_0x315542[_0x56b3('0xaf')])){return _0xc77958[_0x56b3('0xb4')](_0x226227);}else{if(!fs[_0x56b3('0xb5')](path[_0x56b3('0xb2')](config['root'],_0x56b3('0xb6'),_0x315542[_0x56b3('0xaf')]))){return _0xc77958[_0x56b3('0xb4')](_0x226227);}return _0xc77958[_0x56b3('0xb4')](path[_0x56b3('0xb2')](config[_0x56b3('0xb7')],_0x56b3('0xb6'),_0x315542['userpic']));}}})[_0x56b3('0x1c')](handleError(_0xc77958,null));};exports['getOpenTabs']=function(_0xd31cde,_0x250e27){return db[_0x56b3('0x39')][_0x56b3('0x5c')]({'where':{'id':_0xd31cde[_0x56b3('0x5f')]['id']},'attributes':['id']})[_0x56b3('0x14')](handleEntityNotFound(_0x250e27,null))[_0x56b3('0x14')](function(_0x42c688){var _0x6296a9=[];values=_0x42c688['dataValues'];_0x6296a9[_0x56b3('0x48')](get_open_tabs(_0x56b3('0x4d'),_0x42c688[_0x56b3('0x4e')]));_0x6296a9[_0x56b3('0x48')](get_open_tabs(_0x56b3('0x4f'),_0x42c688[_0x56b3('0x4e')]));_0x6296a9[_0x56b3('0x48')](get_open_tabs(_0x56b3('0x5d'),_0x42c688[_0x56b3('0x4e')]));_0x6296a9[_0x56b3('0x48')](get_open_tabs(_0x56b3('0x51'),_0x42c688[_0x56b3('0x4e')]));_0x6296a9[_0x56b3('0x48')](get_open_tabs(_0x56b3('0xb8'),_0x42c688['dataValues']));_0x6296a9['push'](get_open_tabs(_0x56b3('0x50'),_0x42c688['dataValues']));return BPromise[_0x56b3('0x52')](_0x6296a9);})['then'](function(_0x1f1767){if(_0x1f1767){var _0x38312d=_[_0x56b3('0x31')](values[_0x56b3('0xb9')],function(_0x59f806){return{'channel':_0x56b3('0xba'),'id':_0x59f806['id'],'createdAt':_0x59f806['createdAt']};});var _0x34f8e1=_[_0x56b3('0x31')](values['FaxOpenTabs'],function(_0x2fabc8){return{'channel':_0x56b3('0xbb'),'id':_0x2fabc8['id'],'createdAt':_0x2fabc8[_0x56b3('0xbc')]};});var _0x5aef63=_[_0x56b3('0x31')](values['OpenchannelOpenTabs'],function(_0x42c26a){return{'channel':'OPENCHANNEL','id':_0x42c26a['id'],'createdAt':_0x42c26a[_0x56b3('0xbc')]};});var _0x5352a6=_[_0x56b3('0x31')](values['MailOpenTabs'],function(_0x4c5476){return{'channel':_0x56b3('0xbd'),'id':_0x4c5476['id'],'createdAt':_0x4c5476[_0x56b3('0xbc')]};});var _0x54c699=_[_0x56b3('0x31')](values['SmsOpenTabs'],function(_0x48ccfa){return{'channel':_0x56b3('0xbe'),'id':_0x48ccfa['id'],'createdAt':_0x48ccfa[_0x56b3('0xbc')]};});var _0x3bd55f=_[_0x56b3('0x31')](values[_0x56b3('0xbf')],function(_0x3a0c9f){return{'channel':_0x56b3('0xc0'),'id':_0x3a0c9f['id'],'createdAt':_0x3a0c9f[_0x56b3('0xbc')]};});var _0x5a6272=_[_0x56b3('0xc1')](_0x38312d,_0x34f8e1,_0x5aef63,_0x5352a6,_0x54c699,_0x3bd55f);var _0x4041b1={'count':_0x5a6272[_0x56b3('0x4c')],'rows':_0x5a6272};return _0x4041b1;}else return null;})['then'](respondWithResult(_0x250e27,null))[_0x56b3('0x1c')](handleError(_0x250e27,null));};exports['getContacts']=function(_0x1fb759,_0x15249e){var _0x3aea85={};var _0x5a2d9f={};var _0x171af9;var _0x2000b8;return db[_0x56b3('0x39')][_0x56b3('0x95')]({'where':{'id':_0x1fb759[_0x56b3('0x5f')]['id']}})[_0x56b3('0x14')](handleEntityNotFound(_0x15249e,null))[_0x56b3('0x14')](function(_0x7f60da){if(_0x7f60da){_0x171af9=_0x7f60da;_0x5a2d9f['model']=_['keys'](db[_0x56b3('0xc2')][_0x56b3('0x3a')]);_0x5a2d9f['query']=_[_0x56b3('0x55')](_0x1fb759[_0x56b3('0x40')]);_0x5a2d9f[_0x56b3('0x57')]=_[_0x56b3('0x59')](_0x5a2d9f[_0x56b3('0x58')],_0x5a2d9f['query']);_0x3aea85[_0x56b3('0x47')]=_['intersection'](_0x5a2d9f[_0x56b3('0x58')],qs[_0x56b3('0x5a')](_0x1fb759[_0x56b3('0x40')][_0x56b3('0x5a')]));_0x3aea85['attributes']=_0x3aea85['attributes'][_0x56b3('0x4c')]?_0x3aea85[_0x56b3('0x47')]:_0x5a2d9f['model'];_0x3aea85[_0x56b3('0xc3')]=qs[_0x56b3('0xc4')](_0x1fb759[_0x56b3('0x40')][_0x56b3('0xc4')]);_0x3aea85[_0x56b3('0x3f')]=qs[_0x56b3('0x57')](_[_0x56b3('0xc5')](_0x1fb759[_0x56b3('0x40')],_0x5a2d9f[_0x56b3('0x57')]));if(_0x1fb759[_0x56b3('0x40')]['filter']){_0x3aea85[_0x56b3('0x3f')]=_[_0x56b3('0xc6')](_0x3aea85[_0x56b3('0x3f')],{'$or':_[_0x56b3('0x31')](_0x3aea85[_0x56b3('0x47')],function(_0x124d7c){var _0x4a65bb={};_0x4a65bb[_0x124d7c]={'$like':'%'+_0x1fb759[_0x56b3('0x40')][_0x56b3('0x3c')]+'%'};return _0x4a65bb;})});}_0x3aea85=_[_0x56b3('0xc6')]({},_0x3aea85,_0x1fb759[_0x56b3('0x5b')]);return _0x171af9[_0x56b3('0xc7')](_0x3aea85);}})[_0x56b3('0x14')](function(_0x4d7482){if(_0x4d7482){_0x2000b8=_0x4d7482[_0x56b3('0x4c')];if(_0x1fb759[_0x56b3('0x40')][_0x56b3('0xc8')](_0x56b3('0x41'))){_0x3aea85['include']=[{'model':db[_0x56b3('0xc9')],'as':_0x56b3('0xca'),'required':![]},{'model':db[_0x56b3('0xcb')],'as':_0x56b3('0xcc'),'attributes':['id',_0x56b3('0x33'),'color'],'where':_0x1fb759[_0x56b3('0x40')][_0x56b3('0xcd')]?{'id':_0x1fb759[_0x56b3('0x40')][_0x56b3('0xcd')]}:undefined,'required':_0x1fb759[_0x56b3('0x40')][_0x56b3('0xcd')]?!![]:![]}];}if(!_0x1fb759[_0x56b3('0x40')]['hasOwnProperty'](_0x56b3('0xce'))){_0x3aea85[_0x56b3('0x21')]=qs[_0x56b3('0x21')](_0x1fb759[_0x56b3('0x40')][_0x56b3('0x21')]);_0x3aea85[_0x56b3('0x23')]=qs[_0x56b3('0x23')](_0x1fb759[_0x56b3('0x40')][_0x56b3('0x23')]);}return _0x171af9[_0x56b3('0xc7')](_0x3aea85);}})[_0x56b3('0x14')](function(_0x307260){if(_0x307260){return _0x307260?{'count':_0x2000b8,'rows':_0x307260}:null;}})[_0x56b3('0x14')](respondWithResult(_0x15249e,null))[_0x56b3('0x1c')](handleError(_0x15249e,null));};exports[_0x56b3('0xcf')]=function(_0x72076e,_0x21b015){var _0xf1b860;var _0x31fe75={};var _0x47f266;return db[_0x56b3('0x39')][_0x56b3('0x95')]({'where':{'id':_0x72076e['params']['id']},'attributes':['id',_0x56b3('0x33'),_0x56b3('0x29')]})[_0x56b3('0x14')](handleEntityNotFound(_0x21b015,null))['then'](function(_0x26d9f9){if(!utils['isValidChannel'](_0x72076e[_0x56b3('0x40')][_0x56b3('0xa9')])){throw new db[(_0x56b3('0x90'))][(_0x56b3('0x91'))](_0x56b3('0xd0'));}_0xf1b860=_0x26d9f9;var _0x48acf5={};_0x48acf5[_0x56b3('0x58')]=_[_0x56b3('0x55')](db[_[_0x56b3('0x9f')](_0x72076e[_0x56b3('0x40')][_0x56b3('0xa9')])+'Queue'][_0x56b3('0x3a')]);_0x48acf5['query']=_[_0x56b3('0x55')](_0x72076e[_0x56b3('0x40')]);_0x48acf5[_0x56b3('0x57')]=_[_0x56b3('0x59')](_0x48acf5['model'],_0x48acf5[_0x56b3('0x40')]);_0x31fe75['attributes']=_[_0x56b3('0x59')](_0x48acf5[_0x56b3('0x58')],qs[_0x56b3('0x5a')](_0x72076e[_0x56b3('0x40')]['fields']));_0x31fe75[_0x56b3('0x47')]=_0x31fe75[_0x56b3('0x47')][_0x56b3('0x4c')]?_0x31fe75[_0x56b3('0x47')]:_0x48acf5[_0x56b3('0x58')];_0x31fe75[_0x56b3('0xc3')]=qs[_0x56b3('0xc4')](_0x72076e[_0x56b3('0x40')][_0x56b3('0xc4')]);_0x31fe75[_0x56b3('0x3f')]=qs[_0x56b3('0x57')](_[_0x56b3('0xc5')](_0x72076e[_0x56b3('0x40')],_0x48acf5[_0x56b3('0x57')]));if(_0x72076e[_0x56b3('0x40')]['filter']){_0x31fe75[_0x56b3('0x3f')]=_[_0x56b3('0xc6')](_0x31fe75['where'],{'$or':_['map'](_0x31fe75[_0x56b3('0x47')],function(_0x500e74){var _0x433d56={};_0x433d56[_0x500e74]={'$like':'%'+_0x72076e[_0x56b3('0x40')][_0x56b3('0x3c')]+'%'};return _0x433d56;})});}_0x31fe75=_[_0x56b3('0xc6')]({},_0x31fe75,_0x72076e[_0x56b3('0x5b')]);switch(_0xf1b860[_0x56b3('0x29')]){case'admin':return db[_[_0x56b3('0x9f')](_0x72076e['query'][_0x56b3('0xa9')])+_0x56b3('0xd1')][_0x56b3('0x49')](_0x31fe75);case _0x56b3('0x2c'):case _0x56b3('0x2d'):return _0xf1b860[_0x56b3('0x28')+_[_0x56b3('0x9f')](_0x72076e[_0x56b3('0x40')][_0x56b3('0xa9')])+_0x56b3('0xab')](_0x31fe75);default:throw new db['Sequelize'][(_0x56b3('0x91'))]('Unknown\x20role');}})[_0x56b3('0x14')](function(_0x493a4e){_0x47f266=_0x493a4e[_0x56b3('0x4c')];if(!_0x72076e[_0x56b3('0x40')][_0x56b3('0xc8')]('nolimit')){_0x31fe75[_0x56b3('0x21')]=qs[_0x56b3('0x21')](_0x72076e[_0x56b3('0x40')]['limit']);_0x31fe75[_0x56b3('0x23')]=qs[_0x56b3('0x23')](_0x72076e[_0x56b3('0x40')][_0x56b3('0x23')]);}switch(_0xf1b860['role']){case'admin':return db[_[_0x56b3('0x9f')](_0x72076e[_0x56b3('0x40')][_0x56b3('0xa9')])+_0x56b3('0xd1')][_0x56b3('0x49')](_0x31fe75);case _0x56b3('0x2c'):case _0x56b3('0x2d'):return _0xf1b860[_0x56b3('0x28')+_['capitalize'](_0x72076e['query'][_0x56b3('0xa9')])+_0x56b3('0xab')](_0x31fe75);}})[_0x56b3('0x14')](function(_0x5ce1b8){return{'count':_0x47f266,'rows':_0x5ce1b8};})[_0x56b3('0x14')](respondWithResult(_0x21b015,null))[_0x56b3('0x1c')](handleError(_0x21b015,null));};exports[_0x56b3('0xd2')]=function(_0x8a807b,_0x260806){var _0x903038={};var _0x6835a1={};var _0x26811c;var _0x2a31d7;return db[_0x56b3('0x39')][_0x56b3('0x95')]({'where':{'id':_0x8a807b[_0x56b3('0x5f')]['id']}})[_0x56b3('0x14')](handleEntityNotFound(_0x260806,null))[_0x56b3('0x14')](function(_0x58cd11){if(_0x58cd11){_0x26811c=_0x58cd11;_0x6835a1[_0x56b3('0x58')]=_['keys'](db[_0x56b3('0xa7')][_0x56b3('0x3a')]);_0x6835a1[_0x56b3('0x40')]=_[_0x56b3('0x55')](_0x8a807b[_0x56b3('0x40')]);_0x6835a1[_0x56b3('0x57')]=_[_0x56b3('0x59')](_0x6835a1[_0x56b3('0x58')],_0x6835a1[_0x56b3('0x40')]);_0x903038[_0x56b3('0x47')]=_[_0x56b3('0x59')](_0x6835a1[_0x56b3('0x58')],qs[_0x56b3('0x5a')](_0x8a807b[_0x56b3('0x40')]['fields']));_0x903038['attributes']=_0x903038[_0x56b3('0x47')][_0x56b3('0x4c')]?_0x903038[_0x56b3('0x47')]:_0x6835a1['model'];_0x903038['order']=qs[_0x56b3('0xc4')](_0x8a807b['query'][_0x56b3('0xc4')]);_0x903038[_0x56b3('0x3f')]=qs[_0x56b3('0x57')](_['pick'](_0x8a807b[_0x56b3('0x40')],_0x6835a1[_0x56b3('0x57')]));if(_0x8a807b[_0x56b3('0x40')][_0x56b3('0x3c')]){_0x903038[_0x56b3('0x3f')]=_[_0x56b3('0xc6')](_0x903038[_0x56b3('0x3f')],{'$or':_['map'](_0x903038['attributes'],function(_0x5454c2){var _0x1f836e={};_0x1f836e[_0x5454c2]={'$like':'%'+_0x8a807b[_0x56b3('0x40')][_0x56b3('0x3c')]+'%'};return _0x1f836e;})});}_0x903038=_[_0x56b3('0xc6')]({},_0x903038,_0x8a807b[_0x56b3('0x5b')]);return _0x26811c[_0x56b3('0xd2')](_0x903038);}})[_0x56b3('0x14')](function(_0xf17374){if(_0xf17374){_0x2a31d7=_0xf17374['length'];if(!_0x8a807b[_0x56b3('0x40')][_0x56b3('0xc8')]('nolimit')){_0x903038[_0x56b3('0x21')]=qs[_0x56b3('0x21')](_0x8a807b[_0x56b3('0x40')]['limit']);_0x903038['offset']=qs[_0x56b3('0x23')](_0x8a807b[_0x56b3('0x40')][_0x56b3('0x23')]);}return _0x26811c['getVoiceQueuesRt'](_0x903038);}})[_0x56b3('0x14')](function(_0x32ffa0){if(_0x32ffa0){return _0x32ffa0?{'count':_0x2a31d7,'rows':_0x32ffa0}:null;}})['then'](respondWithResult(_0x260806,null))['catch'](handleError(_0x260806,null));};exports['getGroups']=function(_0x4a998b,_0xa95123){var _0x567148={};var _0x190b38={};var _0x61c1ef;var _0x1c758e;return db[_0x56b3('0x39')][_0x56b3('0x95')]({'where':{'id':_0x4a998b['params']['id']}})[_0x56b3('0x14')](handleEntityNotFound(_0xa95123,null))[_0x56b3('0x14')](function(_0x1c9c7c){if(_0x1c9c7c){_0x61c1ef=_0x1c9c7c;_0x190b38['model']=_[_0x56b3('0x55')](db[_0x56b3('0xd3')][_0x56b3('0x3a')]);_0x190b38[_0x56b3('0x40')]=_[_0x56b3('0x55')](_0x4a998b[_0x56b3('0x40')]);_0x190b38['filters']=_[_0x56b3('0x59')](_0x190b38['model'],_0x190b38[_0x56b3('0x40')]);_0x567148['attributes']=_[_0x56b3('0x59')](_0x190b38[_0x56b3('0x58')],qs[_0x56b3('0x5a')](_0x4a998b[_0x56b3('0x40')][_0x56b3('0x5a')]));_0x567148[_0x56b3('0x47')]=_0x567148['attributes'][_0x56b3('0x4c')]?_0x567148[_0x56b3('0x47')]:_0x190b38['model'];_0x567148[_0x56b3('0xc3')]=qs[_0x56b3('0xc4')](_0x4a998b[_0x56b3('0x40')]['sort']);_0x567148[_0x56b3('0x3f')]=qs[_0x56b3('0x57')](_[_0x56b3('0xc5')](_0x4a998b[_0x56b3('0x40')],_0x190b38['filters']));if(_0x4a998b[_0x56b3('0x40')][_0x56b3('0x3c')]){_0x567148[_0x56b3('0x3f')]=_[_0x56b3('0xc6')](_0x567148[_0x56b3('0x3f')],{'$or':_[_0x56b3('0x31')](_0x567148[_0x56b3('0x47')],function(_0x1cb2bd){var _0x585dfc={};_0x585dfc[_0x1cb2bd]={'$like':'%'+_0x4a998b['query']['filter']+'%'};return _0x585dfc;})});}_0x567148=_[_0x56b3('0xc6')]({},_0x567148,_0x4a998b[_0x56b3('0x5b')]);return _0x61c1ef[_0x56b3('0xd4')](_0x567148);}})['then'](function(_0x2ca79b){if(_0x2ca79b){_0x1c758e=_0x2ca79b[_0x56b3('0x4c')];if(!_0x4a998b[_0x56b3('0x40')]['hasOwnProperty'](_0x56b3('0xce'))){_0x567148[_0x56b3('0x21')]=qs[_0x56b3('0x21')](_0x4a998b[_0x56b3('0x40')]['limit']);_0x567148['offset']=qs[_0x56b3('0x23')](_0x4a998b[_0x56b3('0x40')]['offset']);}return _0x61c1ef['getGroups'](_0x567148);}})['then'](function(_0x189076){if(_0x189076){return _0x189076?{'count':_0x1c758e,'rows':_0x189076}:null;}})[_0x56b3('0x14')](respondWithResult(_0xa95123,null))[_0x56b3('0x1c')](handleError(_0xa95123,null));};exports[_0x56b3('0xd5')]=function(_0x242def,_0xb4866b){var _0x1070db={'raw':!![],'where':{}};var _0x5c4296={};var _0x4a1799={'count':0x0,'rows':[]};return db[_0x56b3('0x39')]['findOne']({'where':{'id':_0x242def[_0x56b3('0x5f')]['id']}})[_0x56b3('0x14')](handleEntityNotFound(_0xb4866b,null))['then'](function(_0x31af02){if(_0x31af02){_0x5c4296['model']=_[_0x56b3('0x55')](db[_0x56b3('0xd6')][_0x56b3('0x3a')]);_0x5c4296['query']=_[_0x56b3('0x55')](_0x242def[_0x56b3('0x40')]);_0x5c4296[_0x56b3('0x57')]=_['intersection'](_0x5c4296['model'],_0x5c4296[_0x56b3('0x40')]);_0x1070db[_0x56b3('0x47')]=_[_0x56b3('0x59')](_0x5c4296['model'],qs[_0x56b3('0x5a')](_0x242def[_0x56b3('0x40')]['fields']));_0x1070db[_0x56b3('0x47')]=_0x1070db[_0x56b3('0x47')][_0x56b3('0x4c')]?_0x1070db[_0x56b3('0x47')]:_0x5c4296['model'];if(!_0x242def[_0x56b3('0x40')][_0x56b3('0xc8')](_0x56b3('0xce'))){_0x1070db[_0x56b3('0x21')]=qs['limit'](_0x242def['query'][_0x56b3('0x21')]);_0x1070db[_0x56b3('0x23')]=qs[_0x56b3('0x23')](_0x242def['query'][_0x56b3('0x23')]);}_0x1070db[_0x56b3('0xc3')]=qs[_0x56b3('0xc4')](_0x242def[_0x56b3('0x40')][_0x56b3('0xc4')]);_0x1070db[_0x56b3('0x3f')]=qs['filters'](_[_0x56b3('0xc5')](_0x242def[_0x56b3('0x40')],_0x5c4296[_0x56b3('0x57')]));_0x1070db[_0x56b3('0x3f')]['UserId']=_0x31af02['id'];if(_0x242def[_0x56b3('0x40')][_0x56b3('0x3c')]){_0x1070db[_0x56b3('0x3f')]=_['merge'](_0x1070db['where'],{'$or':_[_0x56b3('0x31')](_0x1070db[_0x56b3('0x47')],function(_0x2136c6){var _0x40892a={};_0x40892a[_0x2136c6]={'$like':'%'+_0x242def[_0x56b3('0x40')][_0x56b3('0x3c')]+'%'};return _0x40892a;})});}_0x1070db=_[_0x56b3('0xc6')]({},_0x1070db,_0x242def[_0x56b3('0x5b')]);return db['VoiceRecording'][_0x56b3('0x22')]({'where':_0x1070db['where']})[_0x56b3('0x14')](function(_0x35b696){_0x4a1799[_0x56b3('0x22')]=_0x35b696;if(_0x242def[_0x56b3('0x40')][_0x56b3('0x41')]){_0x1070db[_0x56b3('0x42')]=[{'all':!![]}];}return db[_0x56b3('0xd6')][_0x56b3('0x49')](_0x1070db);})[_0x56b3('0x14')](function(_0x23617e){_0x4a1799[_0x56b3('0x4a')]=_0x23617e;return _0x4a1799;});}})[_0x56b3('0x14')](respondWithFilteredResult(_0xb4866b,_0x1070db))[_0x56b3('0x1c')](handleError(_0xb4866b,null));};exports[_0x56b3('0xd7')]=function(_0x297b7a,_0x2de414){var _0x2eb87c={'raw':!![],'where':{}};var _0x370e62={};var _0x2935fa={'count':0x0,'rows':[]};return db[_0x56b3('0x39')][_0x56b3('0x95')]({'where':{'id':_0x297b7a[_0x56b3('0x5f')]['id']}})[_0x56b3('0x14')](handleEntityNotFound(_0x2de414,null))[_0x56b3('0x14')](function(_0x1f95ed){if(_0x1f95ed){_0x370e62[_0x56b3('0x58')]=_[_0x56b3('0x55')](db[_0x56b3('0xd8')][_0x56b3('0x3a')]);_0x370e62['query']=_[_0x56b3('0x55')](_0x297b7a[_0x56b3('0x40')]);_0x370e62[_0x56b3('0x57')]=_[_0x56b3('0x59')](_0x370e62[_0x56b3('0x58')],_0x370e62[_0x56b3('0x40')]);_0x2eb87c[_0x56b3('0x47')]=_[_0x56b3('0x59')](_0x370e62[_0x56b3('0x58')],qs[_0x56b3('0x5a')](_0x297b7a[_0x56b3('0x40')][_0x56b3('0x5a')]));_0x2eb87c[_0x56b3('0x47')]=_0x2eb87c[_0x56b3('0x47')][_0x56b3('0x4c')]?_0x2eb87c['attributes']:_0x370e62['model'];if(!_0x297b7a[_0x56b3('0x40')][_0x56b3('0xc8')](_0x56b3('0xce'))){_0x2eb87c['limit']=qs['limit'](_0x297b7a[_0x56b3('0x40')]['limit']);_0x2eb87c[_0x56b3('0x23')]=qs[_0x56b3('0x23')](_0x297b7a[_0x56b3('0x40')][_0x56b3('0x23')]);}_0x2eb87c[_0x56b3('0xc3')]=qs['sort'](_0x297b7a['query'][_0x56b3('0xc4')]);_0x2eb87c[_0x56b3('0x3f')]=qs[_0x56b3('0x57')](_['pick'](_0x297b7a[_0x56b3('0x40')],_0x370e62['filters']));_0x2eb87c['where'][_0x56b3('0xd9')]=_0x1f95ed['id'];if(_0x297b7a[_0x56b3('0x40')][_0x56b3('0x3c')]){_0x2eb87c[_0x56b3('0x3f')]=_[_0x56b3('0xc6')](_0x2eb87c['where'],{'$or':_[_0x56b3('0x31')](_0x2eb87c[_0x56b3('0x47')],function(_0x450615){var _0x1a71a4={};_0x1a71a4[_0x450615]={'$like':'%'+_0x297b7a[_0x56b3('0x40')][_0x56b3('0x3c')]+'%'};return _0x1a71a4;})});}_0x2eb87c=_[_0x56b3('0xc6')]({},_0x2eb87c,_0x297b7a[_0x56b3('0x5b')]);return db['ScreenRecording'][_0x56b3('0x22')]({'where':_0x2eb87c[_0x56b3('0x3f')]})[_0x56b3('0x14')](function(_0x19087f){_0x2935fa[_0x56b3('0x22')]=_0x19087f;if(_0x297b7a[_0x56b3('0x40')][_0x56b3('0x41')]){_0x2eb87c[_0x56b3('0x42')]=[{'all':!![]}];}return db[_0x56b3('0xd8')][_0x56b3('0x49')](_0x2eb87c);})[_0x56b3('0x14')](function(_0x28c5c4){_0x2935fa[_0x56b3('0x4a')]=_0x28c5c4;return _0x2935fa;});}})[_0x56b3('0x14')](respondWithFilteredResult(_0x2de414,_0x2eb87c))[_0x56b3('0x1c')](handleError(_0x2de414,null));};exports[_0x56b3('0xda')]=function(_0x326e4a,_0x51b8c6){var _0x24b047={};var _0x1b856a={};var _0x11fa87;var _0xb6ddea;return db['User'][_0x56b3('0x95')]({'where':{'id':_0x326e4a['params']['id']}})[_0x56b3('0x14')](handleEntityNotFound(_0x51b8c6,null))[_0x56b3('0x14')](function(_0x430493){if(_0x430493){_0x11fa87=_0x430493;_0x1b856a[_0x56b3('0x58')]=_['keys'](db['ChatInteraction'][_0x56b3('0x3a')]);_0x1b856a[_0x56b3('0x40')]=_[_0x56b3('0x55')](_0x326e4a[_0x56b3('0x40')]);_0x1b856a[_0x56b3('0x57')]=_[_0x56b3('0x59')](_0x1b856a[_0x56b3('0x58')],_0x1b856a[_0x56b3('0x40')]);_0x24b047['attributes']=_['intersection'](_0x1b856a['model'],qs[_0x56b3('0x5a')](_0x326e4a['query'][_0x56b3('0x5a')]));_0x24b047[_0x56b3('0x47')]=_0x24b047[_0x56b3('0x47')]['length']?_0x24b047['attributes']:_0x1b856a[_0x56b3('0x58')];_0x24b047[_0x56b3('0xc3')]=qs[_0x56b3('0xc4')](_0x326e4a[_0x56b3('0x40')][_0x56b3('0xc4')]);_0x24b047['where']=qs[_0x56b3('0x57')](_[_0x56b3('0xc5')](_0x326e4a['query'],_0x1b856a['filters']));if(_0x326e4a[_0x56b3('0x40')][_0x56b3('0x3c')]){_0x24b047[_0x56b3('0x3f')]=_[_0x56b3('0xc6')](_0x24b047[_0x56b3('0x3f')],{'$or':_[_0x56b3('0x31')](_0x24b047[_0x56b3('0x47')],function(_0x1d7f60){var _0x37235d={};_0x37235d[_0x1d7f60]={'$like':'%'+_0x326e4a['query'][_0x56b3('0x3c')]+'%'};return _0x37235d;})});}_0x24b047=_['merge']({},_0x24b047,_0x326e4a['options']);return _0x11fa87['getChatInteractions'](_0x24b047);}})['then'](function(_0x46f933){if(_0x46f933){_0xb6ddea=_0x46f933[_0x56b3('0x4c')];if(!_0x326e4a[_0x56b3('0x40')]['hasOwnProperty']('nolimit')){_0x24b047[_0x56b3('0x21')]=qs[_0x56b3('0x21')](_0x326e4a[_0x56b3('0x40')][_0x56b3('0x21')]);_0x24b047[_0x56b3('0x23')]=qs[_0x56b3('0x23')](_0x326e4a[_0x56b3('0x40')][_0x56b3('0x23')]);}return _0x11fa87[_0x56b3('0xda')](_0x24b047);}})['then'](function(_0x1289c0){if(_0x1289c0){return _0x1289c0?{'count':_0xb6ddea,'rows':_0x1289c0}:null;}})[_0x56b3('0x14')](respondWithResult(_0x51b8c6,null))[_0x56b3('0x1c')](handleError(_0x51b8c6,null));};exports[_0x56b3('0xdb')]=function(_0x406e1e,_0x55f5d2){var _0x5d23d6={};var _0x15a6f2={};var _0xad49d0;var _0x2e7a1e;return db[_0x56b3('0x39')][_0x56b3('0x95')]({'where':{'id':_0x406e1e[_0x56b3('0x5f')]['id']}})[_0x56b3('0x14')](handleEntityNotFound(_0x55f5d2,null))[_0x56b3('0x14')](function(_0x5c8f44){if(_0x5c8f44){_0xad49d0=_0x5c8f44;_0x15a6f2[_0x56b3('0x58')]=_['keys'](db[_0x56b3('0xdc')][_0x56b3('0x3a')]);_0x15a6f2[_0x56b3('0x40')]=_[_0x56b3('0x55')](_0x406e1e['query']);_0x15a6f2[_0x56b3('0x57')]=_[_0x56b3('0x59')](_0x15a6f2['model'],_0x15a6f2[_0x56b3('0x40')]);_0x5d23d6['attributes']=_[_0x56b3('0x59')](_0x15a6f2[_0x56b3('0x58')],qs['fields'](_0x406e1e[_0x56b3('0x40')][_0x56b3('0x5a')]));_0x5d23d6[_0x56b3('0x47')]=_0x5d23d6[_0x56b3('0x47')][_0x56b3('0x4c')]?_0x5d23d6[_0x56b3('0x47')]:_0x15a6f2['model'];_0x5d23d6[_0x56b3('0xc3')]=qs[_0x56b3('0xc4')](_0x406e1e[_0x56b3('0x40')][_0x56b3('0xc4')]);_0x5d23d6[_0x56b3('0x3f')]=qs['filters'](_[_0x56b3('0xc5')](_0x406e1e[_0x56b3('0x40')],_0x15a6f2[_0x56b3('0x57')]));if(_0x406e1e['query'][_0x56b3('0x3c')]){_0x5d23d6['where']=_['merge'](_0x5d23d6['where'],{'$or':_[_0x56b3('0x31')](_0x5d23d6[_0x56b3('0x47')],function(_0x29ee58){var _0xb3bfc6={};_0xb3bfc6[_0x29ee58]={'$like':'%'+_0x406e1e[_0x56b3('0x40')][_0x56b3('0x3c')]+'%'};return _0xb3bfc6;})});}_0x5d23d6=_[_0x56b3('0xc6')]({},_0x5d23d6,_0x406e1e[_0x56b3('0x5b')]);return _0xad49d0['getOpenchannelInteractions'](_0x5d23d6);}})[_0x56b3('0x14')](function(_0x57c74c){if(_0x57c74c){_0x2e7a1e=_0x57c74c[_0x56b3('0x4c')];if(!_0x406e1e[_0x56b3('0x40')][_0x56b3('0xc8')](_0x56b3('0xce'))){_0x5d23d6['limit']=qs[_0x56b3('0x21')](_0x406e1e[_0x56b3('0x40')][_0x56b3('0x21')]);_0x5d23d6[_0x56b3('0x23')]=qs[_0x56b3('0x23')](_0x406e1e[_0x56b3('0x40')]['offset']);}return _0xad49d0[_0x56b3('0xdb')](_0x5d23d6);}})['then'](function(_0x18e544){if(_0x18e544){return _0x18e544?{'count':_0x2e7a1e,'rows':_0x18e544}:null;}})[_0x56b3('0x14')](respondWithResult(_0x55f5d2,null))['catch'](handleError(_0x55f5d2,null));};exports[_0x56b3('0xdd')]=function(_0x394d81,_0x17cc5a){var _0x41775b={'raw':!![],'where':{}};var _0x44c4c0={};var _0x55c3f2={'count':0x0,'rows':[]};return db[_0x56b3('0x39')][_0x56b3('0x95')]({'where':{'id':_0x394d81[_0x56b3('0x5f')]['id']}})[_0x56b3('0x14')](handleEntityNotFound(_0x17cc5a,null))[_0x56b3('0x14')](function(_0x2e0cd0){if(_0x2e0cd0){_0x44c4c0[_0x56b3('0x58')]=_[_0x56b3('0x55')](db[_0x56b3('0xde')][_0x56b3('0x3a')]);_0x44c4c0[_0x56b3('0x40')]=_[_0x56b3('0x55')](_0x394d81[_0x56b3('0x40')]);_0x44c4c0[_0x56b3('0x57')]=_[_0x56b3('0x59')](_0x44c4c0[_0x56b3('0x58')],_0x44c4c0[_0x56b3('0x40')]);_0x41775b[_0x56b3('0x47')]=_[_0x56b3('0x59')](_0x44c4c0[_0x56b3('0x58')],qs[_0x56b3('0x5a')](_0x394d81[_0x56b3('0x40')][_0x56b3('0x5a')]));_0x41775b[_0x56b3('0x47')]=_0x41775b[_0x56b3('0x47')]['length']?_0x41775b['attributes']:_0x44c4c0[_0x56b3('0x58')];if(!_0x394d81[_0x56b3('0x40')]['hasOwnProperty'](_0x56b3('0xce'))){_0x41775b['limit']=qs[_0x56b3('0x21')](_0x394d81[_0x56b3('0x40')][_0x56b3('0x21')]);_0x41775b[_0x56b3('0x23')]=qs['offset'](_0x394d81['query']['offset']);}_0x41775b[_0x56b3('0xc3')]=qs['sort'](_0x394d81['query'][_0x56b3('0xc4')]);_0x41775b[_0x56b3('0x3f')]=qs[_0x56b3('0x57')](_[_0x56b3('0xc5')](_0x394d81[_0x56b3('0x40')],_0x44c4c0[_0x56b3('0x57')]));_0x41775b[_0x56b3('0x3f')]['UserId']=_0x2e0cd0['id'];if(_0x394d81[_0x56b3('0x40')][_0x56b3('0x3c')]){_0x41775b['where']=_[_0x56b3('0xc6')](_0x41775b['where'],{'$or':_[_0x56b3('0x31')](_0x41775b[_0x56b3('0x47')],function(_0x45a22a){var _0x2c63a6={};_0x2c63a6[_0x45a22a]={'$like':'%'+_0x394d81[_0x56b3('0x40')][_0x56b3('0x3c')]+'%'};return _0x2c63a6;})});}_0x41775b=_[_0x56b3('0xc6')]({},_0x41775b,_0x394d81[_0x56b3('0x5b')]);return db[_0x56b3('0xde')]['count']({'where':_0x41775b['where']})[_0x56b3('0x14')](function(_0x37910a){_0x55c3f2['count']=_0x37910a;if(_0x394d81[_0x56b3('0x40')][_0x56b3('0x41')]){_0x41775b[_0x56b3('0x42')]=[{'all':!![]}];}return db['MailInteraction'][_0x56b3('0x49')](_0x41775b);})[_0x56b3('0x14')](function(_0x24ea79){_0x55c3f2[_0x56b3('0x4a')]=_0x24ea79;return _0x55c3f2;});}})['then'](respondWithFilteredResult(_0x17cc5a,_0x41775b))['catch'](handleError(_0x17cc5a,null));};exports[_0x56b3('0xdf')]=function(_0x229a9a,_0x49f81c){var _0x302aba={};var _0x5a4c2a={};var _0x29870e;var _0x45763e;return db[_0x56b3('0x39')][_0x56b3('0x95')]({'where':{'id':_0x229a9a[_0x56b3('0x5f')]['id']}})[_0x56b3('0x14')](handleEntityNotFound(_0x49f81c,null))[_0x56b3('0x14')](function(_0x4edf68){if(_0x4edf68){_0x29870e=_0x4edf68;_0x5a4c2a[_0x56b3('0x58')]=_[_0x56b3('0x55')](db[_0x56b3('0xe0')][_0x56b3('0x3a')]);_0x5a4c2a[_0x56b3('0x40')]=_['keys'](_0x229a9a[_0x56b3('0x40')]);_0x5a4c2a['filters']=_[_0x56b3('0x59')](_0x5a4c2a['model'],_0x5a4c2a['query']);_0x302aba[_0x56b3('0x47')]=_[_0x56b3('0x59')](_0x5a4c2a[_0x56b3('0x58')],qs[_0x56b3('0x5a')](_0x229a9a[_0x56b3('0x40')][_0x56b3('0x5a')]));_0x302aba['attributes']=_0x302aba[_0x56b3('0x47')][_0x56b3('0x4c')]?_0x302aba[_0x56b3('0x47')]:_0x5a4c2a[_0x56b3('0x58')];_0x302aba[_0x56b3('0xc3')]=qs[_0x56b3('0xc4')](_0x229a9a[_0x56b3('0x40')]['sort']);_0x302aba[_0x56b3('0x3f')]=qs[_0x56b3('0x57')](_[_0x56b3('0xc5')](_0x229a9a['query'],_0x5a4c2a[_0x56b3('0x57')]));if(_0x229a9a['query'][_0x56b3('0x3c')]){_0x302aba[_0x56b3('0x3f')]=_[_0x56b3('0xc6')](_0x302aba['where'],{'$or':_[_0x56b3('0x31')](_0x302aba[_0x56b3('0x47')],function(_0x3e5713){var _0x3897d4={};_0x3897d4[_0x3e5713]={'$like':'%'+_0x229a9a[_0x56b3('0x40')][_0x56b3('0x3c')]+'%'};return _0x3897d4;})});}_0x302aba=_['merge']({},_0x302aba,_0x229a9a['options']);return _0x29870e[_0x56b3('0xdf')](_0x302aba);}})[_0x56b3('0x14')](function(_0x5786ab){if(_0x5786ab){_0x45763e=_0x5786ab['length'];if(!_0x229a9a[_0x56b3('0x40')][_0x56b3('0xc8')](_0x56b3('0xce'))){_0x302aba[_0x56b3('0x21')]=qs[_0x56b3('0x21')](_0x229a9a[_0x56b3('0x40')][_0x56b3('0x21')]);_0x302aba['offset']=qs['offset'](_0x229a9a[_0x56b3('0x40')]['offset']);}return _0x29870e[_0x56b3('0xdf')](_0x302aba);}})['then'](function(_0x44908d){if(_0x44908d){return _0x44908d?{'count':_0x45763e,'rows':_0x44908d}:null;}})[_0x56b3('0x14')](respondWithResult(_0x49f81c,null))[_0x56b3('0x1c')](handleError(_0x49f81c,null));};exports[_0x56b3('0xe1')]=function(_0x2b59a5,_0x2d7de5){var _0x3cf915={};var _0x3e71c1={};var _0xb17fb5;var _0x22f042;return db[_0x56b3('0x39')]['findOne']({'where':{'id':_0x2b59a5[_0x56b3('0x5f')]['id']}})[_0x56b3('0x14')](handleEntityNotFound(_0x2d7de5,null))['then'](function(_0x24039f){if(_0x24039f){_0xb17fb5=_0x24039f;_0x3e71c1[_0x56b3('0x58')]=_['keys'](db[_0x56b3('0xe2')][_0x56b3('0x3a')]);_0x3e71c1[_0x56b3('0x40')]=_[_0x56b3('0x55')](_0x2b59a5[_0x56b3('0x40')]);_0x3e71c1[_0x56b3('0x57')]=_[_0x56b3('0x59')](_0x3e71c1[_0x56b3('0x58')],_0x3e71c1['query']);_0x3cf915[_0x56b3('0x47')]=_[_0x56b3('0x59')](_0x3e71c1['model'],qs[_0x56b3('0x5a')](_0x2b59a5[_0x56b3('0x40')]['fields']));_0x3cf915['attributes']=_0x3cf915[_0x56b3('0x47')][_0x56b3('0x4c')]?_0x3cf915[_0x56b3('0x47')]:_0x3e71c1['model'];_0x3cf915['order']=qs['sort'](_0x2b59a5[_0x56b3('0x40')][_0x56b3('0xc4')]);_0x3cf915[_0x56b3('0x3f')]=qs[_0x56b3('0x57')](_[_0x56b3('0xc5')](_0x2b59a5['query'],_0x3e71c1[_0x56b3('0x57')]));if(_0x2b59a5[_0x56b3('0x40')][_0x56b3('0x3c')]){_0x3cf915['where']=_[_0x56b3('0xc6')](_0x3cf915[_0x56b3('0x3f')],{'$or':_[_0x56b3('0x31')](_0x3cf915['attributes'],function(_0x155e3e){var _0x442a50={};_0x442a50[_0x155e3e]={'$like':'%'+_0x2b59a5['query'][_0x56b3('0x3c')]+'%'};return _0x442a50;})});}_0x3cf915=_[_0x56b3('0xc6')]({},_0x3cf915,_0x2b59a5[_0x56b3('0x5b')]);return _0xb17fb5[_0x56b3('0xe1')](_0x3cf915);}})[_0x56b3('0x14')](function(_0x542a1a){if(_0x542a1a){_0x22f042=_0x542a1a[_0x56b3('0x4c')];if(!_0x2b59a5[_0x56b3('0x40')]['hasOwnProperty'](_0x56b3('0xce'))){_0x3cf915['limit']=qs['limit'](_0x2b59a5[_0x56b3('0x40')][_0x56b3('0x21')]);_0x3cf915['offset']=qs[_0x56b3('0x23')](_0x2b59a5[_0x56b3('0x40')]['offset']);}return _0xb17fb5['getFaxInteractions'](_0x3cf915);}})['then'](function(_0x48a1b3){if(_0x48a1b3){return _0x48a1b3?{'count':_0x22f042,'rows':_0x48a1b3}:null;}})[_0x56b3('0x14')](respondWithResult(_0x2d7de5,null))[_0x56b3('0x1c')](handleError(_0x2d7de5,null));};exports[_0x56b3('0xe3')]=function(_0x41a547,_0x4ebd14){var _0x2964b7={};var _0x57ac11={};var _0x159171;var _0x381ef6;return db[_0x56b3('0x39')][_0x56b3('0x95')]({'where':{'id':_0x41a547['params']['id']}})[_0x56b3('0x14')](handleEntityNotFound(_0x4ebd14,null))['then'](function(_0xc0478f){if(_0xc0478f){_0x159171=_0xc0478f;_0x57ac11['model']=_['keys'](db[_0x56b3('0xe4')][_0x56b3('0x3a')]);_0x57ac11[_0x56b3('0x40')]=_['keys'](_0x41a547[_0x56b3('0x40')]);_0x57ac11[_0x56b3('0x57')]=_['intersection'](_0x57ac11['model'],_0x57ac11['query']);_0x2964b7[_0x56b3('0x47')]=_['intersection'](_0x57ac11[_0x56b3('0x58')],qs[_0x56b3('0x5a')](_0x41a547[_0x56b3('0x40')][_0x56b3('0x5a')]));_0x2964b7[_0x56b3('0x47')]=_0x2964b7[_0x56b3('0x47')][_0x56b3('0x4c')]?_0x2964b7[_0x56b3('0x47')]:_0x57ac11[_0x56b3('0x58')];_0x2964b7[_0x56b3('0xc3')]=qs[_0x56b3('0xc4')](_0x41a547[_0x56b3('0x40')][_0x56b3('0xc4')]);_0x2964b7[_0x56b3('0x3f')]=qs[_0x56b3('0x57')](_[_0x56b3('0xc5')](_0x41a547[_0x56b3('0x40')],_0x57ac11['filters']));if(_0x41a547[_0x56b3('0x40')]['filter']){_0x2964b7[_0x56b3('0x3f')]=_[_0x56b3('0xc6')](_0x2964b7[_0x56b3('0x3f')],{'$or':_[_0x56b3('0x31')](_0x2964b7[_0x56b3('0x47')],function(_0x14e2ae){var _0x38ab6c={};_0x38ab6c[_0x14e2ae]={'$like':'%'+_0x41a547[_0x56b3('0x40')][_0x56b3('0x3c')]+'%'};return _0x38ab6c;})});}_0x2964b7=_[_0x56b3('0xc6')]({},_0x2964b7,_0x41a547['options']);return _0x159171['getWhatsappInteractions'](_0x2964b7);}})[_0x56b3('0x14')](function(_0x53b020){if(_0x53b020){_0x381ef6=_0x53b020[_0x56b3('0x4c')];if(!_0x41a547[_0x56b3('0x40')][_0x56b3('0xc8')](_0x56b3('0xce'))){_0x2964b7[_0x56b3('0x21')]=qs[_0x56b3('0x21')](_0x41a547['query']['limit']);_0x2964b7[_0x56b3('0x23')]=qs[_0x56b3('0x23')](_0x41a547[_0x56b3('0x40')]['offset']);}return _0x159171[_0x56b3('0xe3')](_0x2964b7);}})[_0x56b3('0x14')](function(_0x4f5cc1){if(_0x4f5cc1){return _0x4f5cc1?{'count':_0x381ef6,'rows':_0x4f5cc1}:null;}})[_0x56b3('0x14')](respondWithResult(_0x4ebd14,null))['catch'](handleError(_0x4ebd14,null));};exports[_0x56b3('0xe5')]=function(_0x3e0c57,_0x4746a6,_0x4f3b57){var _0xa98cc7;var _0x336a29;var _0x16bb90;var _0x370f62=!_[_0x56b3('0x67')](_0x3e0c57[_0x56b3('0x5f')]['id'])?_0x3e0c57[_0x56b3('0x5f')]['id']:!_[_0x56b3('0x67')](_0x3e0c57[_0x56b3('0x2c')]['id'])?_0x3e0c57[_0x56b3('0x2c')]['id']:null;return db['User'][_0x56b3('0x5c')]({'where':{'id':_0x370f62,'role':{'$or':[_0x56b3('0x2a'),'user','agent']}},'attributes':['id',_0x56b3('0x33'),_0x56b3('0xe6'),_0x56b3('0xe7'),'role','internal','loginInPause']})[_0x56b3('0x14')](function(_0x4e9280){if(_0x4e9280){if(_0x4e9280['role']===_0x56b3('0x2d')){_0xa98cc7=_0x4e9280;if(_0x3e0c57['body'][_0x56b3('0x9d')]){_0x16bb90=util['format'](_0x56b3('0xe8'),_0xa98cc7[_0x3e0c57['body']['interface']]);}else if(_0x3e0c57[_0x56b3('0x5e')][_0x56b3('0xe9')]){_0x16bb90=util[_0x56b3('0xa6')](_0x56b3('0xea'),_0x3e0c57['body'][_0x56b3('0xe9')]);}else{_0x16bb90=util[_0x56b3('0xa6')](_0x56b3('0xea'),_0xa98cc7['name']);}socket['to'](util[_0x56b3('0xa6')](_0x56b3('0xeb'),_0xa98cc7[_0x56b3('0x33')]))['emit'](_0x56b3('0xec'),{'user':{'id':_0xa98cc7['id'],'name':_0xa98cc7[_0x56b3('0x33')]},'ip':_0x3e0c57[_0x56b3('0xed')][_0x56b3('0xee')]||_0x3e0c57['connection']['remoteAddress']||_0x3e0c57['socket'][_0x56b3('0xef')]||_0x3e0c57[_0x56b3('0xf0')][_0x56b3('0xf1')][_0x56b3('0xef')]});return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0xa98cc7['name']},'individualHooks':!![]});}}else{throw new db[(_0x56b3('0x90'))]['ValidationError']('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})['then'](function(){if(_0xa98cc7){return _0xa98cc7['getVoiceQueues']({'raw':!![]});}})[_0x56b3('0x14')](function(_0x10d5cf){if(_0xa98cc7){var _0x1cd36a=[];if(_0x10d5cf){_0x336a29=_0x10d5cf;if(_0x336a29[_0x56b3('0x4c')]){for(var _0x1fd717=0x0;_0x1fd717<_0x336a29['length'];_0x1fd717++){_0x1cd36a['push']({'membername':_0xa98cc7[_0x56b3('0x33')],'UserId':_0xa98cc7['id'],'queue_name':_0x336a29[_0x1fd717][_0x56b3('0x33')],'VoiceQueueId':_0x336a29[_0x1fd717]['id'],'interface':_0x16bb90,'paused':_0xa98cc7[_0x56b3('0x9b')]||![],'penalty':_0x336a29[_0x1fd717][_0x56b3('0xf2')]||0x0});}return BPromise['each'](_0x1cd36a,function(_0x8dece1){return db[_0x56b3('0xa7')][_0x56b3('0xa8')](_0x8dece1);});}}}})[_0x56b3('0x14')](function(){if(_0xa98cc7){return db[_0x56b3('0xf3')][_0x56b3('0x49')]({'where':{'membername':_0xa98cc7['name'],'exitAt':null}});}})[_0x56b3('0x14')](function(_0x1d5429){if(_0xa98cc7){var _0x30614d=[];_0x1d5429[_0x56b3('0xf4')](function(_0x44d0e6){_0x30614d[_0x56b3('0x48')](_0x44d0e6[_0x56b3('0x24')]({'exitAt':moment()[_0x56b3('0xa6')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x56b3('0x52')](_0x30614d);}})['then'](function(){if(_0xa98cc7){var _0x46bcb6=[];var _0x45a034=[];var _0x5cb700=utils[_0x56b3('0xf5')]();var _0x2349c8={'membername':_0xa98cc7[_0x56b3('0x33')],'interface':_0x16bb90,'enterAt':moment()[_0x56b3('0xa6')](_0x56b3('0xf6')),'role':_0xa98cc7[_0x56b3('0x29')],'internal':_0xa98cc7[_0x56b3('0x63')]};_0x5cb700[_0x56b3('0xf4')](function(_0x2a2b2d){_0x46bcb6['push'](_[_0x56b3('0xc6')]({'channel':_0x2a2b2d,'type':_0x56b3('0xf7'),'data1':_0x3e0c57['body'][_0x56b3('0xf8')],'data2':_0x16bb90},_0x2349c8));if(_0xa98cc7[_0x56b3('0x9b')]){_0x45a034[_0x56b3('0x48')](_[_0x56b3('0xc6')]({'channel':_0x2a2b2d,'type':'PAUSE','data1':'LOGININPAUSE'},_0x2349c8));}});return db[_0x56b3('0xf3')][_0x56b3('0x86')](_0x46bcb6[_0x56b3('0xc1')](_0x45a034),{'individualHooks':!![]});}})[_0x56b3('0x14')](function(){if(_0xa98cc7){return _0xa98cc7[_0x56b3('0x24')]({'online':!![],'lastLoginAt':moment()[_0x56b3('0xa6')](_0x56b3('0xf6')),'voicePause':_0xa98cc7[_0x56b3('0x9b')]||![],'mailPause':_0xa98cc7[_0x56b3('0x9b')]||![],'chatPause':_0xa98cc7[_0x56b3('0x9b')]||![],'faxPause':_0xa98cc7[_0x56b3('0x9b')]||![],'smsPause':_0xa98cc7[_0x56b3('0x9b')]||![],'openchannelPause':_0xa98cc7[_0x56b3('0x9b')]||![],'whatsappPause':_0xa98cc7[_0x56b3('0x9b')]||![],'pauseType':_0xa98cc7[_0x56b3('0x9b')]?_0x56b3('0xf9'):null,'interface':_0x16bb90,'lastPauseAt':moment()[_0x56b3('0xa6')](_0x56b3('0xf6'))});}})[_0x56b3('0x14')](function(_0x2c766c){if(_0x3e0c57[_0x56b3('0xfa')]){return _0x4f3b57();}else{return BPromise['resolve'](_0x2c766c)[_0x56b3('0x14')](respondWithResult(_0x4746a6,null));}})[_0x56b3('0x1c')](handleError(_0x4746a6,null));};exports[_0x56b3('0xfb')]=function(_0x31cce4,_0x38a841){var _0xa1ddba;return db[_0x56b3('0x39')][_0x56b3('0x5c')]({'where':{'id':_0x31cce4[_0x56b3('0x5f')]['id'],'role':_0x56b3('0x2d')},'attributes':['id',_0x56b3('0x33'),_0x56b3('0x29')]})[_0x56b3('0x14')](handleEntityNotFound(_0x38a841,null))[_0x56b3('0x14')](function(_0x1277a1){if(_0x1277a1){_0xa1ddba=_0x1277a1;return db[_0x56b3('0xa7')][_0x56b3('0x27')]({'where':{'membername':_0xa1ddba['name']},'individualHooks':!![]});}})['then'](function(){return db[_0x56b3('0xf3')][_0x56b3('0x49')]({'where':{'membername':_0xa1ddba[_0x56b3('0x33')],'exitAt':null}});})[_0x56b3('0x14')](function(_0x530348){var _0x1d64ba=[];_0x530348['forEach'](function(_0x4d271d){_0x1d64ba[_0x56b3('0x48')](_0x4d271d[_0x56b3('0x24')]({'exitAt':moment()[_0x56b3('0xa6')](_0x56b3('0xf6'))}));});return BPromise['all'](_0x1d64ba);})[_0x56b3('0x14')](function(){return _0xa1ddba[_0x56b3('0x24')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x38a841,null))[_0x56b3('0x1c')](handleError(_0x38a841,null));};exports['pause']=function(_0x32aded,_0x5e87e0){var _0x4ba643;return db[_0x56b3('0xa7')][_0x56b3('0x24')]({'paused':0x1},{'where':{'UserId':_0x32aded[_0x56b3('0x5f')]['id']},'individualHooks':!![]})[_0x56b3('0x14')](function(){return db[_0x56b3('0x39')][_0x56b3('0x5c')]({'where':{'id':_0x32aded[_0x56b3('0x5f')]['id'],'role':_0x56b3('0x2d')},'attributes':['id','name','role','internal',_0x56b3('0x9d')]});})[_0x56b3('0x14')](handleEntityNotFound(_0x5e87e0,null))[_0x56b3('0x14')](function(_0xaf542e){if(_0xaf542e){_0x4ba643=_0xaf542e;return respondWithRpcPromise(_0x56b3('0xfc'),_0x56b3('0xfd'),{'id':_0x4ba643['id'],'name':_0x4ba643['name'],'pause':!![]});}})[_0x56b3('0x14')](function(){if(_0x4ba643){return db[_0x56b3('0xf3')][_0x56b3('0x49')]({'where':{'membername':_0x4ba643[_0x56b3('0x33')],'type':'PAUSE','exitAt':null}});}})[_0x56b3('0x14')](function(_0x2b70bb){if(_0x2b70bb['length']){var _0x18afc5=moment()[_0x56b3('0xa6')](_0x56b3('0xf6'));for(var _0x40b5b5=0x0,_0x2979a6=_0x2b70bb[_0x56b3('0x4c')];_0x40b5b5<_0x2979a6;_0x40b5b5++){_0x2b70bb[_0x40b5b5][_0x56b3('0xfe')]({'exitAt':_0x18afc5});}}})['then'](function(){var _0x2fbdf4=[];var _0x2a7b66=utils[_0x56b3('0xf5')]();_0x2a7b66[_0x56b3('0xf4')](function(_0x5aa709){_0x2fbdf4[_0x56b3('0x48')]({'channel':_0x5aa709,'membername':_0x4ba643[_0x56b3('0x33')],'interface':_[_0x56b3('0x67')](_0x4ba643[_0x56b3('0x9d')])?util[_0x56b3('0xa6')](_0x56b3('0xea'),_0x4ba643['name']):_0x4ba643[_0x56b3('0x9d')],'type':_0x56b3('0xff'),'enterAt':moment()[_0x56b3('0xa6')](_0x56b3('0xf6')),'data1':_0x32aded[_0x56b3('0x5e')][_0x56b3('0x100')]||_0x56b3('0x101'),'role':_0x4ba643['role'],'internal':_0x4ba643[_0x56b3('0x63')]});});return db[_0x56b3('0xf3')][_0x56b3('0x86')](_0x2fbdf4,{'individualHooks':!![]});})[_0x56b3('0x14')](function(){return _0x4ba643[_0x56b3('0x24')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x32aded[_0x56b3('0x5e')][_0x56b3('0x100')]||_0x56b3('0x101'),'lastPauseAt':moment()[_0x56b3('0xa6')](_0x56b3('0xf6'))});})[_0x56b3('0x14')](respondWithResult(_0x5e87e0,null))[_0x56b3('0x1c')](handleError(_0x5e87e0,null));};exports[_0x56b3('0x102')]=function(_0x1807f4,_0x315915){var _0x1abfe8;return db[_0x56b3('0x39')]['find']({'where':{'id':_0x1807f4[_0x56b3('0x5f')]['id']},'attributes':['id','name',_0x56b3('0x29'),_0x56b3('0x9c'),_0x56b3('0x103'),_0x56b3('0x104'),_0x56b3('0x105'),_0x56b3('0x106'),_0x56b3('0x107'),_0x56b3('0x108'),_0x56b3('0x109'),_0x56b3('0x10a')]})[_0x56b3('0x14')](handleEntityNotFound(_0x315915,null))[_0x56b3('0x14')](function(_0x4a7c36){if(_0x4a7c36){_0x1abfe8=_0x4a7c36;if(_0x1807f4[_0x56b3('0x5e')][_0x56b3('0xa9')]&&!utils[_0x56b3('0x9e')](_0x1807f4[_0x56b3('0x5e')][_0x56b3('0xa9')])){throw new db['Sequelize']['ValidationError'](_0x56b3('0xd0'));}switch(_0x1807f4['body'][_0x56b3('0xa9')]){case'voice':return respondWithRpcPromise(_0x56b3('0xfc'),_0x56b3('0x102'),{'id':_0x1abfe8['id'],'name':_0x1abfe8[_0x56b3('0x33')],'pause':![]})[_0x56b3('0x14')](function(){return db[_0x56b3('0xa7')][_0x56b3('0x24')]({'paused':0x0},{'where':{'UserId':_0x1abfe8['id']},'individualHooks':!![]});})[_0x56b3('0x14')](function(){return db['MemberReport'][_0x56b3('0x5c')]({'where':{'channel':_0x1807f4['body']['channel'],'membername':_0x1abfe8[_0x56b3('0x33')],'type':_0x56b3('0xff'),'exitAt':null}});})[_0x56b3('0x14')](function(_0x4049e9){if(_0x4049e9){return _0x4049e9[_0x56b3('0x24')]({'exitAt':moment()[_0x56b3('0xa6')](_0x56b3('0xf6')),'data2':_0x56b3('0x10b')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x1abfe8[_0x56b3('0x24')]({'voicePause':![]});});case'mail':case _0x56b3('0x4d'):case _0x56b3('0xb8'):case _0x56b3('0x4f'):case _0x56b3('0x51'):case _0x56b3('0x5d'):return db['MemberReport'][_0x56b3('0x5c')]({'where':{'channel':_0x1807f4[_0x56b3('0x5e')][_0x56b3('0xa9')],'membername':_0x1abfe8[_0x56b3('0x33')],'type':_0x56b3('0xff'),'exitAt':null}})['then'](function(_0x49d16b){if(_0x49d16b){return _0x49d16b[_0x56b3('0x24')]({'exitAt':moment()[_0x56b3('0xa6')](_0x56b3('0xf6')),'data2':_0x56b3('0x10b')},{'individualHooks':!![]});}return null;})[_0x56b3('0x14')](function(){var _0x48e4f1={};_['set'](_0x48e4f1,util[_0x56b3('0xa6')]('%s%s',_0x1807f4[_0x56b3('0x5e')][_0x56b3('0xa9')],_0x56b3('0x10c')),![]);return _0x1abfe8[_0x56b3('0x24')](_0x48e4f1);});default:return respondWithRpcPromise(_0x56b3('0xfc'),'unpause',{'id':_0x1abfe8['id'],'name':_0x1abfe8['name'],'pause':![]})['then'](function(){return db[_0x56b3('0xa7')][_0x56b3('0x24')]({'paused':0x0},{'where':{'UserId':_0x1abfe8['id']}});})['then'](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x1abfe8['name'],'type':_0x56b3('0xff'),'exitAt':null}});})['then'](function(_0x7857b8){var _0x3fafd2=[];_0x7857b8[_0x56b3('0xf4')](function(_0x301e01){_0x3fafd2[_0x56b3('0x48')](_0x301e01[_0x56b3('0x24')]({'exitAt':moment()['format'](_0x56b3('0xf6')),'data2':_0x56b3('0x10b')}));});return BPromise[_0x56b3('0x52')](_0x3fafd2);})[_0x56b3('0x14')](function(){return _0x1abfe8[_0x56b3('0x24')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x56b3('0x14')](respondWithResult(_0x315915,null))[_0x56b3('0x1c')](handleError(_0x315915,null));};exports[_0x56b3('0x10d')]=function(_0x39e016,_0x5c1a40){var _0x6b2759={};var _0x18db3f={};var _0x28f2f6;var _0x33e982;return db[_0x56b3('0x39')]['findOne']({'where':{'id':_0x39e016[_0x56b3('0x5f')]['id']}})[_0x56b3('0x14')](handleEntityNotFound(_0x5c1a40,null))[_0x56b3('0x14')](function(_0x387e21){if(_0x387e21){_0x28f2f6=_0x387e21;_0x18db3f[_0x56b3('0x58')]=_[_0x56b3('0x55')](db[_0x56b3('0x10e')][_0x56b3('0x3a')]);_0x18db3f[_0x56b3('0x40')]=_[_0x56b3('0x55')](_0x39e016['query']);_0x18db3f[_0x56b3('0x57')]=_[_0x56b3('0x59')](_0x18db3f[_0x56b3('0x58')],_0x18db3f['query']);_0x6b2759[_0x56b3('0x47')]=_[_0x56b3('0x59')](_0x18db3f[_0x56b3('0x58')],qs['fields'](_0x39e016[_0x56b3('0x40')][_0x56b3('0x5a')]));_0x6b2759[_0x56b3('0x47')]=_0x6b2759[_0x56b3('0x47')][_0x56b3('0x4c')]?_0x6b2759[_0x56b3('0x47')]:_0x18db3f[_0x56b3('0x58')];_0x6b2759[_0x56b3('0xc3')]=qs[_0x56b3('0xc4')](_0x39e016['query']['sort']);_0x6b2759[_0x56b3('0x3f')]=qs[_0x56b3('0x57')](_[_0x56b3('0xc5')](_0x39e016[_0x56b3('0x40')],_0x18db3f[_0x56b3('0x57')]));if(_0x39e016[_0x56b3('0x40')][_0x56b3('0x3c')]){_0x6b2759[_0x56b3('0x3f')]=_[_0x56b3('0xc6')](_0x6b2759[_0x56b3('0x3f')],{'$or':_['map'](_0x6b2759[_0x56b3('0x47')],function(_0x329c17){var _0x52bb5e={};_0x52bb5e[_0x329c17]={'$like':'%'+_0x39e016['query'][_0x56b3('0x3c')]+'%'};return _0x52bb5e;})});}_0x6b2759=_[_0x56b3('0xc6')]({},_0x6b2759,_0x39e016['options']);return _0x28f2f6[_0x56b3('0x10d')](_0x6b2759);}})[_0x56b3('0x14')](function(_0x43798a){if(_0x43798a){_0x33e982=_0x43798a[_0x56b3('0x4c')];if(!_0x39e016[_0x56b3('0x40')][_0x56b3('0xc8')](_0x56b3('0xce'))){_0x6b2759[_0x56b3('0x21')]=qs['limit'](_0x39e016[_0x56b3('0x40')]['limit']);_0x6b2759[_0x56b3('0x23')]=qs[_0x56b3('0x23')](_0x39e016[_0x56b3('0x40')][_0x56b3('0x23')]);}return _0x28f2f6[_0x56b3('0x10d')](_0x6b2759);}})['then'](function(_0x386e09){if(_0x386e09){return _0x386e09?{'count':_0x33e982,'rows':_0x386e09}:null;}})['then'](respondWithResult(_0x5c1a40,null))['catch'](handleError(_0x5c1a40,null));};exports['addTeams']=function(_0x46095d,_0x3d118e){var _0x5bdb09=_0x46095d[_0x56b3('0x5f')]['id'];var _0x47cf83=_0x46095d[_0x56b3('0x5e')]?_0x46095d['body'][_0x56b3('0x62')]:null;var _0x3a6f87=[];return Promise[_0x56b3('0x10f')]()[_0x56b3('0x14')](function(){if(!_0x47cf83)throw new APIBadRequestError(_0x56b3('0x110'));})[_0x56b3('0x14')](function(){return db[_0x56b3('0x39')][_0x56b3('0x95')]({'where':{'id':_0x5bdb09}});})[_0x56b3('0x14')](function(_0xc1f4b){if(!_0xc1f4b)throw new APINotFoundError(util[_0x56b3('0xa6')]('User\x20with\x20id\x20%s\x20not\x20found',_0x46095d[_0x56b3('0x5f')]['id']));return db[_0x56b3('0x6a')][_0x56b3('0x111')](function(_0x4f9b09){return _0xc1f4b[_0x56b3('0x112')](_0x47cf83,{'transaction':_0x4f9b09})[_0x56b3('0x14')](function(){return db[_0x56b3('0x10e')]['findAll']({'where':{'id':{'$in':_0x47cf83}}});})[_0x56b3('0x14')](function(_0xc2dd63){var _0x1559af=_['map'](_0xc2dd63,function(_0x53ee37){return _0x53ee37[_0x56b3('0x113')]();});return Promise[_0x56b3('0x52')](_0x1559af);})[_0x56b3('0x14')](function(_0x320528){_0x3a6f87=_[_0x56b3('0x114')](_0x320528);var _0xfd6d09=_[_0x56b3('0x31')](_0x3a6f87,function(_0x4068bd){return _0x4068bd[_0x56b3('0x115')](_0xc1f4b['id'],{'transaction':_0x4f9b09});});return Promise[_0x56b3('0x52')](_0xfd6d09);})[_0x56b3('0x14')](function(){if(!_0xc1f4b[_0x56b3('0x9a')])return;var _0xfd8e15=_[_0x56b3('0x3c')](_0x3a6f87,function(_0x1a4175){return _0x1a4175[_0x56b3('0x116')](_0x56b3('0xa9'))==='Voice';});var _0x70d2c9=_[_0x56b3('0x31')](_0xfd8e15,function(_0x51b6d1){return db[_0x56b3('0xa7')][_0x56b3('0xa8')]({'membername':_0xc1f4b[_0x56b3('0x33')],'UserId':_0xc1f4b['id'],'queue_name':_0x51b6d1['name'],'VoiceQueueId':_0x51b6d1['id'],'interface':_[_0x56b3('0x67')](_0xc1f4b[_0x56b3('0x9d')])?util[_0x56b3('0xa6')](_0x56b3('0xea'),_0xc1f4b['name']):_0xc1f4b['interface'],'paused':_0xc1f4b[_0x56b3('0x9c')]||![],'penalty':_0xc1f4b['penalty']},{'transaction':_0x4f9b09});});return Promise['all'](_0x70d2c9);})['then'](function(){return db[_0x56b3('0x117')][_0x56b3('0x49')]({'where':{'teamId':{'$in':_0x47cf83}}});})[_0x56b3('0x14')](function(_0x1bd891){var _0x5ab2d0=_['map'](_0x1bd891,function(_0x40f3e8){return db['UserVoicePrefix'][_0x56b3('0x83')]({'UserId':_0xc1f4b['id'],'VoicePrefixId':_0x40f3e8['VoicePrefixId']},{'transaction':_0x4f9b09});});return Promise[_0x56b3('0x52')](_0x5ab2d0);});});})['then'](function(){for(var _0x3b3b59=0x0;_0x3b3b59<_0x3a6f87[_0x56b3('0x4c')];_0x3b3b59++){var _0x462049=_0x3a6f87[_0x3b3b59]['getDataValue'](_0x56b3('0xa9'));var _0x1c00ce=_0x462049+'QueueId';socket[_0x56b3('0x25')](_0x56b3('0x2c')+_0x462049+_0x56b3('0xa3'),{'UserId':_0x5bdb09,['queueField']:_0x3a6f87[_0x3b3b59]['id']});}})[_0x56b3('0x14')](respondWithStatusCode(_0x3d118e,null))[_0x56b3('0x1c')](APIHandleError(_0x3d118e));};exports[_0x56b3('0x118')]=function(_0x51e693,_0x47a8d9){var _0x37a4c7=_0x51e693[_0x56b3('0x5f')]['id'];var _0x2c528f=null;if(_0x51e693['query']['ids']){_0x2c528f=_[_0x56b3('0xac')](_0x51e693['query']['ids'])?_0x51e693[_0x56b3('0x40')][_0x56b3('0x62')]:[_0x51e693[_0x56b3('0x40')][_0x56b3('0x62')]];}var _0x343763=[];return Promise[_0x56b3('0x10f')]()[_0x56b3('0x14')](function(){if(!_0x2c528f)throw new APIBadRequestError(_0x56b3('0x119'));})[_0x56b3('0x14')](function(){return db[_0x56b3('0x39')][_0x56b3('0x95')]({'where':{'id':_0x37a4c7}});})[_0x56b3('0x14')](function(_0x50a40d){if(!_0x50a40d)throw new APINotFoundError(util[_0x56b3('0xa6')]('User\x20with\x20id\x20%s\x20not\x20found',_0x51e693[_0x56b3('0x5f')]['id']));return db['sequelize'][_0x56b3('0x111')](function(_0x112596){return _0x50a40d[_0x56b3('0x118')](_0x2c528f,{'transaction':_0x112596})[_0x56b3('0x14')](function(){return db[_0x56b3('0x10e')][_0x56b3('0x49')]({'where':{'id':{'$in':_0x2c528f}}});})[_0x56b3('0x14')](function(_0x1eb762){var _0x14bb86=_[_0x56b3('0x31')](_0x1eb762,function(_0x5bafd5){return _0x5bafd5[_0x56b3('0x113')]();});return Promise['all'](_0x14bb86);})[_0x56b3('0x14')](function(_0x68cc71){_0x343763=_[_0x56b3('0x114')](_0x68cc71);var _0x2d0347=_['map'](_0x343763,function(_0x484f3e){return _0x484f3e['removeAgent'](_0x50a40d['id'],{'transaction':_0x112596});});return Promise['all'](_0x2d0347);})[_0x56b3('0x14')](function(){if(!_0x50a40d['online'])return;var _0x23a937=_[_0x56b3('0x3c')](_0x343763,function(_0x41790f){return _0x41790f[_0x56b3('0x116')](_0x56b3('0xa9'))===_0x56b3('0x11a');});var _0xc3ef6d=_['map'](_0x23a937,function(_0x388a69){return db['UserVoiceQueueRt'][_0x56b3('0x27')]({'where':{'VoiceQueueId':_0x388a69['id'],'UserId':_0x50a40d['id']},'transaction':_0x112596});});return Promise[_0x56b3('0x52')](_0xc3ef6d);})[_0x56b3('0x14')](function(){return db['TeamVoicePrefix'][_0x56b3('0x49')]({'where':{'teamId':{'$in':_0x2c528f}}});})[_0x56b3('0x14')](function(_0x4ea941){var _0x5ea241=_['map'](_0x4ea941,function(_0x41e56a){return db[_0x56b3('0x11b')]['destroy']({'where':{'UserId':_0x50a40d['id'],'VoicePrefixId':_0x41e56a[_0x56b3('0x11c')]}},{'transaction':_0x112596});});return Promise[_0x56b3('0x52')](_0x5ea241);});});})[_0x56b3('0x14')](function(){for(var _0x1dff6e=0x0;_0x1dff6e<_0x343763[_0x56b3('0x4c')];_0x1dff6e++){var _0x592685=_0x343763[_0x1dff6e][_0x56b3('0x116')]('channel');var _0x2feb77=_0x592685+'QueueId';socket['emit']('user'+_0x592685+_0x56b3('0xae'),{'UserId':_0x37a4c7,['queueField']:_0x343763[_0x1dff6e]['id']});}})[_0x56b3('0x14')](respondWithStatusCode(_0x47a8d9,null))[_0x56b3('0x1c')](APIHandleError(_0x47a8d9));};exports['getLists']=function(_0x37c862,_0x334cb1){var _0x11c8a9={};var _0x4f4068={};var _0x41aeab;var _0x74ac5b;return db[_0x56b3('0x39')][_0x56b3('0x95')]({'where':{'id':_0x37c862[_0x56b3('0x5f')]['id']}})[_0x56b3('0x14')](handleEntityNotFound(_0x334cb1,null))[_0x56b3('0x14')](function(_0x579544){if(_0x579544){_0x41aeab=_0x579544;_0x4f4068[_0x56b3('0x58')]=_[_0x56b3('0x55')](db[_0x56b3('0xc9')]['rawAttributes']);_0x4f4068[_0x56b3('0x40')]=_['keys'](_0x37c862[_0x56b3('0x40')]);_0x4f4068[_0x56b3('0x57')]=_[_0x56b3('0x59')](_0x4f4068[_0x56b3('0x58')],_0x4f4068[_0x56b3('0x40')]);_0x11c8a9['attributes']=_[_0x56b3('0x59')](_0x4f4068[_0x56b3('0x58')],qs[_0x56b3('0x5a')](_0x37c862['query']['fields']));_0x11c8a9[_0x56b3('0x47')]=_0x11c8a9[_0x56b3('0x47')][_0x56b3('0x4c')]?_0x11c8a9['attributes']:_0x4f4068['model'];_0x11c8a9[_0x56b3('0xc3')]=qs[_0x56b3('0xc4')](_0x37c862['query'][_0x56b3('0xc4')]);_0x11c8a9[_0x56b3('0x3f')]=qs[_0x56b3('0x57')](_[_0x56b3('0xc5')](_0x37c862[_0x56b3('0x40')],_0x4f4068[_0x56b3('0x57')]));if(_0x37c862[_0x56b3('0x40')][_0x56b3('0x3c')]){_0x11c8a9[_0x56b3('0x3f')]=_[_0x56b3('0xc6')](_0x11c8a9[_0x56b3('0x3f')],{'$or':_[_0x56b3('0x31')](_0x11c8a9[_0x56b3('0x47')],function(_0x2b189a){var _0x1a2ddf={};_0x1a2ddf[_0x2b189a]={'$like':'%'+_0x37c862[_0x56b3('0x40')][_0x56b3('0x3c')]+'%'};return _0x1a2ddf;})});}_0x11c8a9=_[_0x56b3('0xc6')]({},_0x11c8a9,_0x37c862['options']);return _0x41aeab[_0x56b3('0x11d')](_0x11c8a9);}})['then'](function(_0x45cd51){if(_0x45cd51){_0x74ac5b=_0x45cd51['length'];if(!_0x37c862[_0x56b3('0x40')][_0x56b3('0xc8')]('nolimit')){_0x11c8a9[_0x56b3('0x21')]=qs['limit'](_0x37c862[_0x56b3('0x40')][_0x56b3('0x21')]);_0x11c8a9[_0x56b3('0x23')]=qs['offset'](_0x37c862[_0x56b3('0x40')]['offset']);}return _0x41aeab['getLists'](_0x11c8a9);}})[_0x56b3('0x14')](function(_0x458dbf){if(_0x458dbf){return _0x458dbf?{'count':_0x74ac5b,'rows':_0x458dbf}:null;}})[_0x56b3('0x14')](respondWithResult(_0x334cb1,null))[_0x56b3('0x1c')](handleError(_0x334cb1,null));};exports[_0x56b3('0x11e')]=function(_0x32b4bd,_0x9459a9){var _0x3d3f8b={};var _0x39fa51={};var _0xe67988;return db[_0x56b3('0x39')][_0x56b3('0x95')]({'where':{'id':_0x32b4bd['params']['id']}})['then'](handleEntityNotFound(_0x9459a9,null))[_0x56b3('0x14')](function(_0x294901){if(_0x294901){_0xe67988=_0x294901;_0x39fa51['model']=_[_0x56b3('0x55')](db['User'][_0x56b3('0x3a')]);_0x39fa51[_0x56b3('0x40')]=_[_0x56b3('0x55')](_0x32b4bd[_0x56b3('0x40')]);_0x39fa51[_0x56b3('0x57')]=_[_0x56b3('0x59')](_0x39fa51[_0x56b3('0x58')],_0x39fa51[_0x56b3('0x40')]);_0x3d3f8b['attributes']=_[_0x56b3('0x59')](_0x39fa51[_0x56b3('0x58')],qs[_0x56b3('0x5a')](_0x32b4bd['query'][_0x56b3('0x5a')]));_0x3d3f8b[_0x56b3('0x47')]=_0x3d3f8b[_0x56b3('0x47')][_0x56b3('0x4c')]?_0x3d3f8b[_0x56b3('0x47')]:_0x39fa51[_0x56b3('0x58')];_0x3d3f8b[_0x56b3('0xc3')]=qs[_0x56b3('0xc4')](_0x32b4bd['query']['sort']);_0x3d3f8b[_0x56b3('0x3f')]=qs[_0x56b3('0x57')](_[_0x56b3('0xc5')](_0x32b4bd[_0x56b3('0x40')],_0x39fa51[_0x56b3('0x57')]));if(_0x32b4bd[_0x56b3('0x40')][_0x56b3('0x3c')]){_0x3d3f8b[_0x56b3('0x3f')]=_['merge'](_0x3d3f8b['where'],{'$or':_['map'](_0x3d3f8b['attributes'],function(_0x1b9f63){var _0x471b6f={};_0x471b6f[_0x1b9f63]={'$like':'%'+_0x32b4bd[_0x56b3('0x40')]['filter']+'%'};return _0x471b6f;})});}_0x3d3f8b[_0x56b3('0x58')]=db[_0x56b3('0x39')];_0x3d3f8b['as']=_0x56b3('0x89');_0x3d3f8b=_[_0x56b3('0xc6')]({},_0x3d3f8b,_0x32b4bd[_0x56b3('0x5b')]);return _0xe67988[_0x56b3('0x11f')]({'include':[_0x3d3f8b]});}})[_0x56b3('0x14')](function(_0x2fe7bb){if(_0x2fe7bb){var _0x4003d6={},_0x18f518=[];for(var _0x4f0989=0x0;_0x4f0989<_0x2fe7bb[_0x56b3('0x4c')];_0x4f0989+=0x1){for(var _0x41d1d2=0x0,_0x11ab70;_0x41d1d2<_0x2fe7bb[_0x4f0989][_0x56b3('0x89')][_0x56b3('0x4c')];_0x41d1d2+=0x1){_0x11ab70=_0x2fe7bb[_0x4f0989][_0x56b3('0x89')][_0x41d1d2][_0x56b3('0x28')]({'plain':!![]});_0x4003d6[_0x11ab70['id']]=_0x11ab70;}}_0x4003d6=_[_0x56b3('0x120')](_0x4003d6);for(var _0xe3ef6d=qs[_0x56b3('0x23')](_0x32b4bd[_0x56b3('0x40')][_0x56b3('0x23')]);_0xe3ef6d<_0x4003d6[_0x56b3('0x4c')]&&_0x18f518[_0x56b3('0x4c')]=_0x354d84[_0xf9ef('0x4d')]){throw new Error(_0xf9ef('0x4e'));}})[_0xf9ef('0xc')](function(){if(_0x4f87c2){return db[_0xf9ef('0x26')][_0xf9ef('0x4f')]({'where':{'membername':_0x4f87c2[_0xf9ef('0x23')]},'individualHooks':!![]});}})['then'](function(){if(_0x4f87c2){return _0x4f87c2[_0xf9ef('0x50')]({'raw':!![]});}})[_0xf9ef('0xc')](function(_0x4c507f){if(_0x4f87c2){if(_0x4c507f){var _0x5dece0=[];_0x3e5139=_0x4c507f;if(_0x3e5139[_0xf9ef('0x2a')]){for(var _0x15711e=0x0;_0x15711e<_0x3e5139[_0xf9ef('0x2a')];_0x15711e++){_0x5dece0['push'](db['UserVoiceQueueRt'][_0xf9ef('0x51')]({'membername':_0x4f87c2['name'],'UserId':_0x4f87c2['id'],'queue_name':_0x3e5139[_0x15711e]['name'],'VoiceQueueId':_0x3e5139[_0x15711e]['id'],'interface':_0x386dc7,'paused':_0x4f87c2[_0xf9ef('0x52')]||![],'penalty':_0x3e5139[_0x15711e]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xf9ef('0x45')](_0x5dece0);}}}})['then'](function(){if(_0x4f87c2){return db[_0xf9ef('0x28')][_0xf9ef('0x17')]({'where':{'membername':_0x4f87c2['name'],'exitAt':null}});}})[_0xf9ef('0xc')](function(_0x57eafd){if(_0x4f87c2){if(_0x57eafd&&_0x57eafd['length']){var _0x35b7e4=[];_0x57eafd[_0xf9ef('0x44')](function(_0x40abd4){_0x35b7e4[_0xf9ef('0x53')](_0x40abd4[_0xf9ef('0x27')]({'exitAt':moment()[_0xf9ef('0x2b')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xf9ef('0x45')](_0x35b7e4);}}})[_0xf9ef('0xc')](function(_0x3656e4){if(_0x4f87c2){var _0x1588fa=[];var _0x4f9769=[];var _0x44ad48=utils['getChannels']();var _0x1f2319={'membername':_0x4f87c2['name'],'interface':_0x386dc7,'enterAt':moment()['format'](_0xf9ef('0x2f')),'role':_0x4f87c2[_0xf9ef('0x24')],'internal':_0x4f87c2[_0xf9ef('0x32')]};_0x44ad48[_0xf9ef('0x44')](function(_0x203287){_0x1588fa[_0xf9ef('0x53')](_[_0xf9ef('0x54')]({'channel':_0x203287,'type':_0xf9ef('0x55'),'data1':_0xf9ef('0x56'),'data2':_0x386dc7},_0x1f2319));if(_0x4f87c2['loginInPause']){_0x4f9769[_0xf9ef('0x53')](_[_0xf9ef('0x54')]({'channel':_0x203287,'type':'PAUSE','data1':_0xf9ef('0x57')},_0x1f2319));}});return db['MemberReport'][_0xf9ef('0x35')](_0x1588fa[_0xf9ef('0x58')](_0x4f9769),{'individualHooks':!![]});}})['then'](function(){if(_0x4f87c2){return _0x4f87c2[_0xf9ef('0x27')]({'online':!![],'lastLoginAt':moment()[_0xf9ef('0x2b')](_0xf9ef('0x2f')),'voicePause':_0x4f87c2[_0xf9ef('0x52')]||![],'mailPause':_0x4f87c2[_0xf9ef('0x52')]||![],'chatPause':_0x4f87c2[_0xf9ef('0x52')]||![],'faxPause':_0x4f87c2[_0xf9ef('0x52')]||![],'smsPause':_0x4f87c2[_0xf9ef('0x52')]||![],'openchannelPause':_0x4f87c2[_0xf9ef('0x52')]||![],'pauseType':_0x4f87c2['loginInPause']?'LOGININPAUSE':null,'lastPauseAt':moment()[_0xf9ef('0x2b')](_0xf9ef('0x2f')),'interface':_0x386dc7});}})[_0xf9ef('0xc')](function(_0x5d2ff2){_0x4672d7(_0x5d2ff2);})[_0xf9ef('0x14')](function(_0x3086bb){_0x2d235b(_0x356258['error'](0x1f4,_0x3086bb[_0xf9ef('0x12')]));});});}; \ No newline at end of file +var _0x3cae=['request','then','User,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','findAll','options','where','attributes','include','model','map','info','GetUser','User','ShowUser','PauseUser','find','interface','UserVoiceQueueRt','update','MemberReport','name','length','YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','push','isNil','format','body','type','DEFAULT\x20PAUSE','role','internal','UnpauseUser','findOne','channel','isValidChannel','Unknown\x20channel','voice','mail','chat','openchannel','whatsapp','PAUSE','system','set','%s%s','Pause','catch','destroy','all','LoginUser','mobile','phone','loginInPause','count','agent','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','LOGIN','merge','LOGININPAUSE','bulkCreate','concat','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','redis','socket.io-emitter','./user.socket','register'];(function(_0x19a11f,_0x6d8be7){var _0x51485f=function(_0x1394a1){while(--_0x1394a1){_0x19a11f['push'](_0x19a11f['shift']());}};_0x51485f(++_0x6d8be7);}(_0x3cae,0x9d));var _0xe3ca=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0x3cae[_0x1ddedd];return _0xa3e1ac;};'use strict';var _=require('lodash');var util=require(_0xe3ca('0x0'));var moment=require('moment');var BPromise=require(_0xe3ca('0x1'));var rs=require(_0xe3ca('0x2'));var fs=require('fs');var Redis=require(_0xe3ca('0x3'));var db=require(_0xe3ca('0x4'))['db'];var utils=require(_0xe3ca('0x5'));var logger=require(_0xe3ca('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe3ca('0x7'));var client=jayson[_0xe3ca('0x8')]['http']({'port':0x232a});config[_0xe3ca('0x9')]=_['defaults'](config[_0xe3ca('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xe3ca('0xa'))(new Redis(config[_0xe3ca('0x9')]));require(_0xe3ca('0xb'))[_0xe3ca('0xc')](socket);function respondWithRpcPromise(_0x57fa30,_0x2851fd,_0x34186a){return new BPromise(function(_0x42bc39,_0x3eee29){return client[_0xe3ca('0xd')](_0x57fa30,_0x34186a)[_0xe3ca('0xe')](function(_0x3bc740){logger['info'](_0xe3ca('0xf'),_0x2851fd,_0xe3ca('0x10'));logger[_0xe3ca('0x11')]('User,\x20%s,\x20%s,\x20%s',_0x2851fd,_0xe3ca('0x10'),JSON['stringify'](_0x3bc740));if(_0x3bc740['error']){if(_0x3bc740[_0xe3ca('0x12')][_0xe3ca('0x13')]===0x1f4){logger[_0xe3ca('0x12')](_0xe3ca('0xf'),_0x2851fd,_0x3bc740[_0xe3ca('0x12')][_0xe3ca('0x14')]);return _0x3eee29(_0x3bc740[_0xe3ca('0x12')][_0xe3ca('0x14')]);}logger[_0xe3ca('0x12')]('User,\x20%s,\x20%s',_0x2851fd,_0x3bc740['error'][_0xe3ca('0x14')]);return _0x42bc39(_0x3bc740[_0xe3ca('0x12')]['message']);}else{logger['info'](_0xe3ca('0xf'),_0x2851fd,'request\x20sent');_0x42bc39(_0x3bc740[_0xe3ca('0x15')][_0xe3ca('0x14')]);}})['catch'](function(_0x2581b6){logger[_0xe3ca('0x12')](_0xe3ca('0xf'),_0x2851fd,_0x2581b6);_0x3eee29(_0x2581b6);});});}exports['GetUser']=function(_0x220b0b){var _0x27e545=this;return new Promise(function(_0x140cf0,_0x37b501){return db['User'][_0xe3ca('0x16')]({'raw':_0x220b0b[_0xe3ca('0x17')]?_0x220b0b[_0xe3ca('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x220b0b['options']?_0x220b0b['options'][_0xe3ca('0x18')]||null:null,'attributes':_0x220b0b[_0xe3ca('0x17')]?_0x220b0b[_0xe3ca('0x17')][_0xe3ca('0x19')]||null:null,'limit':_0x220b0b[_0xe3ca('0x17')]?_0x220b0b[_0xe3ca('0x17')]['limit']||null:null,'include':_0x220b0b[_0xe3ca('0x17')]?_0x220b0b[_0xe3ca('0x17')][_0xe3ca('0x1a')]?_['map'](_0x220b0b[_0xe3ca('0x17')][_0xe3ca('0x1a')],function(_0x469a8e){return{'model':db[_0x469a8e[_0xe3ca('0x1b')]],'as':_0x469a8e['as'],'attributes':_0x469a8e['attributes'],'include':_0x469a8e[_0xe3ca('0x1a')]?_[_0xe3ca('0x1c')](_0x469a8e[_0xe3ca('0x1a')],function(_0x5bd8eb){return{'model':db[_0x5bd8eb[_0xe3ca('0x1b')]],'as':_0x5bd8eb['as'],'attributes':_0x5bd8eb[_0xe3ca('0x19')],'include':_0x5bd8eb[_0xe3ca('0x1a')]?_[_0xe3ca('0x1c')](_0x5bd8eb[_0xe3ca('0x1a')],function(_0x54cf46){return{'model':db[_0x54cf46[_0xe3ca('0x1b')]],'as':_0x54cf46['as'],'attributes':_0x54cf46[_0xe3ca('0x19')]};}):[]};}):[]};}):[]:[]})[_0xe3ca('0xe')](function(_0x19bf8a){logger[_0xe3ca('0x1d')](_0xe3ca('0x1e'),_0x220b0b);logger[_0xe3ca('0x11')]('GetUser',_0x220b0b,JSON['stringify'](_0x19bf8a));_0x140cf0(_0x19bf8a);})['catch'](function(_0x5584db){logger[_0xe3ca('0x12')](_0xe3ca('0x1e'),_0x5584db[_0xe3ca('0x14')],_0x220b0b);_0x37b501(_0x27e545[_0xe3ca('0x12')](0x1f4,_0x5584db[_0xe3ca('0x14')]));});});};exports['ShowUser']=function(_0x4774f3){var _0x4c7f59=this;return new Promise(function(_0x1146b0,_0x4ee8f2){return db[_0xe3ca('0x1f')]['find']({'raw':_0x4774f3[_0xe3ca('0x17')]?_0x4774f3[_0xe3ca('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4774f3['options']?_0x4774f3[_0xe3ca('0x17')]['where']||null:null,'attributes':_0x4774f3['options']?_0x4774f3[_0xe3ca('0x17')]['attributes']||null:null,'include':_0x4774f3[_0xe3ca('0x17')]?_0x4774f3[_0xe3ca('0x17')][_0xe3ca('0x1a')]?_[_0xe3ca('0x1c')](_0x4774f3[_0xe3ca('0x17')][_0xe3ca('0x1a')],function(_0x3d28fd){return{'model':db[_0x3d28fd[_0xe3ca('0x1b')]],'as':_0x3d28fd['as'],'attributes':_0x3d28fd[_0xe3ca('0x19')],'include':_0x3d28fd['include']?_[_0xe3ca('0x1c')](_0x3d28fd[_0xe3ca('0x1a')],function(_0x4f1985){return{'model':db[_0x4f1985[_0xe3ca('0x1b')]],'as':_0x4f1985['as'],'attributes':_0x4f1985[_0xe3ca('0x19')],'include':_0x4f1985[_0xe3ca('0x1a')]?_[_0xe3ca('0x1c')](_0x4f1985[_0xe3ca('0x1a')],function(_0x2d22c3){return{'model':db[_0x2d22c3['model']],'as':_0x2d22c3['as'],'attributes':_0x2d22c3['attributes']};}):[]};}):[]};}):[]:[]})[_0xe3ca('0xe')](function(_0x4a98f1){logger[_0xe3ca('0x1d')](_0xe3ca('0x20'),_0x4774f3);logger[_0xe3ca('0x11')](_0xe3ca('0x20'),_0x4774f3,JSON['stringify'](_0x4a98f1));_0x1146b0(_0x4a98f1);})['catch'](function(_0x3516bc){logger[_0xe3ca('0x12')]('ShowUser',_0x3516bc['message'],_0x4774f3);_0x4ee8f2(_0x4c7f59[_0xe3ca('0x12')](0x1f4,_0x3516bc[_0xe3ca('0x14')]));});});};exports[_0xe3ca('0x21')]=function(_0x3ce534){var _0x423134=this;return new Promise(function(_0x43e357,_0x3fb549){var _0x5ea9bf;return db[_0xe3ca('0x1f')][_0xe3ca('0x22')]({'where':_0x3ce534[_0xe3ca('0x17')][_0xe3ca('0x18')]||{},'attributes':['id','name','role','internal',_0xe3ca('0x23')]})[_0xe3ca('0xe')](function(_0x9c51b9){if(_0x9c51b9){_0x5ea9bf=_0x9c51b9;return db[_0xe3ca('0x24')][_0xe3ca('0x25')]({'paused':0x1},{'where':{'UserId':_0x5ea9bf['id']},'individualHooks':!![]});}})['then'](function(){if(_0x5ea9bf){return db[_0xe3ca('0x26')][_0xe3ca('0x16')]({'where':{'membername':_0x5ea9bf[_0xe3ca('0x27')],'type':'PAUSE','exitAt':null}});}})[_0xe3ca('0xe')](function(_0x3ee1bf){if(_0x5ea9bf){if(_0x3ee1bf&&_0x3ee1bf[_0xe3ca('0x28')]){var _0x255b16=moment()['format'](_0xe3ca('0x29'));for(var _0x45c6fe=0x0,_0xa6487d=_0x3ee1bf[_0xe3ca('0x28')];_0x45c6fe<_0xa6487d;_0x45c6fe++){_0x3ee1bf[_0x45c6fe]['updateAttributes']({'exitAt':_0x255b16});}}}})[_0xe3ca('0xe')](function(){if(_0x5ea9bf){var _0x42b4eb=[];var _0x8414a6=utils[_0xe3ca('0x2a')]();_0x8414a6[_0xe3ca('0x2b')](function(_0x4435e8){_0x42b4eb[_0xe3ca('0x2c')]({'channel':_0x4435e8,'membername':_0x5ea9bf['name'],'interface':_[_0xe3ca('0x2d')](_0x5ea9bf[_0xe3ca('0x23')])?util['format']('SIP/%s',_0x5ea9bf[_0xe3ca('0x27')]):_0x5ea9bf[_0xe3ca('0x23')],'type':'PAUSE','enterAt':moment()[_0xe3ca('0x2e')](_0xe3ca('0x29')),'data1':_0x3ce534[_0xe3ca('0x2f')][_0xe3ca('0x30')]||_0xe3ca('0x31'),'role':_0x5ea9bf[_0xe3ca('0x32')],'internal':_0x5ea9bf[_0xe3ca('0x33')],'uniqueid':_0x3ce534[_0xe3ca('0x2f')]['uniqueid']||null});});return db[_0xe3ca('0x26')]['bulkCreate'](_0x42b4eb,{'individualHooks':!![]});}})[_0xe3ca('0xe')](function(){if(_0x5ea9bf){return _0x5ea9bf[_0xe3ca('0x25')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x3ce534[_0xe3ca('0x2f')][_0xe3ca('0x30')]||_0xe3ca('0x31'),'lastPauseAt':moment()['format'](_0xe3ca('0x29'))});}})[_0xe3ca('0xe')](function(_0x1360b3){_0x43e357(_0x1360b3);})['catch'](function(_0x1b2809){_0x3fb549(_0x423134[_0xe3ca('0x12')](0x1f4,_0x1b2809[_0xe3ca('0x14')]));});});};exports[_0xe3ca('0x34')]=function(_0x5abef3){var _0x317647=this;return new Promise(function(_0x4121dd,_0x1008b0){var _0x487157;return db[_0xe3ca('0x1f')][_0xe3ca('0x35')]({'where':_0x5abef3[_0xe3ca('0x17')][_0xe3ca('0x18')]||{},'attributes':['id',_0xe3ca('0x27')]})[_0xe3ca('0xe')](function(_0x538d5f){if(_0x538d5f){_0x487157=_0x538d5f;if(_0x5abef3[_0xe3ca('0x2f')][_0xe3ca('0x36')]&&!utils[_0xe3ca('0x37')](_0x5abef3[_0xe3ca('0x2f')][_0xe3ca('0x36')])){throw new Error(_0xe3ca('0x38'));}switch(_0x5abef3['body'][_0xe3ca('0x36')]){case _0xe3ca('0x39'):return db['UserVoiceQueueRt'][_0xe3ca('0x25')]({'paused':0x0},{'where':{'UserId':_0x487157['id']}})[_0xe3ca('0xe')](function(){return db[_0xe3ca('0x26')][_0xe3ca('0x22')]({'where':{'channel':_0x5abef3[_0xe3ca('0x2f')][_0xe3ca('0x36')],'membername':_0x487157[_0xe3ca('0x27')],'type':'PAUSE','exitAt':null}});})[_0xe3ca('0xe')](function(_0xf4a598){if(_0xf4a598){return _0xf4a598['update']({'exitAt':moment()[_0xe3ca('0x2e')](_0xe3ca('0x29')),'data2':'system'},{'individualHooks':!![]});}return null;})[_0xe3ca('0xe')](function(){return _0x487157[_0xe3ca('0x25')]({'voicePause':![]});});case _0xe3ca('0x3a'):case _0xe3ca('0x3b'):case'fax':case'sms':case _0xe3ca('0x3c'):case _0xe3ca('0x3d'):return db[_0xe3ca('0x26')][_0xe3ca('0x22')]({'where':{'channel':_0x5abef3[_0xe3ca('0x2f')]['channel'],'membername':_0x487157['name'],'type':_0xe3ca('0x3e'),'exitAt':null}})[_0xe3ca('0xe')](function(_0x11c7be){return _0x11c7be['update']({'exitAt':moment()[_0xe3ca('0x2e')](_0xe3ca('0x29')),'data2':_0xe3ca('0x3f')},{'individualHooks':!![]});})[_0xe3ca('0xe')](function(){var _0x58fef1={};_[_0xe3ca('0x40')](_0x58fef1,util[_0xe3ca('0x2e')](_0xe3ca('0x41'),_0x5abef3[_0xe3ca('0x2f')]['channel'],_0xe3ca('0x42')),![]);return _0x487157[_0xe3ca('0x25')](_0x58fef1);});default:return db[_0xe3ca('0x24')][_0xe3ca('0x25')]({'paused':0x0},{'where':{'UserId':_0x487157['id']}})[_0xe3ca('0xe')](function(){return db[_0xe3ca('0x26')][_0xe3ca('0x16')]({'where':{'membername':_0x487157[_0xe3ca('0x27')],'type':_0xe3ca('0x3e'),'exitAt':null}});})[_0xe3ca('0xe')](function(_0xd2c5fb){var _0x48efc7=[];_0xd2c5fb[_0xe3ca('0x2b')](function(_0x36e078){_0x48efc7['push'](_0x36e078['update']({'exitAt':moment()[_0xe3ca('0x2e')](_0xe3ca('0x29')),'data2':'system'}));});return BPromise['all'](_0x48efc7);})[_0xe3ca('0xe')](function(){return _0x487157[_0xe3ca('0x25')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0xe3ca('0xe')](function(_0x2dc292){_0x4121dd(_0x2dc292);})[_0xe3ca('0x43')](function(_0x5715f3){_0x1008b0(_0x317647[_0xe3ca('0x12')](0x1f4,_0x5715f3[_0xe3ca('0x14')]));});});};exports['LogoutUser']=function(_0x5c3030){var _0x3c95bf=this;return new Promise(function(_0x53464b,_0x2255d5){var _0x57ccdd;return db[_0xe3ca('0x1f')][_0xe3ca('0x35')]({'where':_0x5c3030[_0xe3ca('0x17')][_0xe3ca('0x18')]||{},'attributes':['id',_0xe3ca('0x27')]})['then'](function(_0x428b09){if(_0x428b09){_0x57ccdd=_0x428b09;return db[_0xe3ca('0x24')][_0xe3ca('0x44')]({'where':{'membername':_0x57ccdd[_0xe3ca('0x27')]},'individualHooks':!![]});}})[_0xe3ca('0xe')](function(){if(_0x57ccdd){return db[_0xe3ca('0x26')][_0xe3ca('0x16')]({'where':{'membername':_0x57ccdd[_0xe3ca('0x27')],'exitAt':null}});}})['then'](function(_0x305079){if(_0x57ccdd){if(_0x305079&&_0x305079[_0xe3ca('0x28')]){var _0x294c31=[];_0x305079[_0xe3ca('0x2b')](function(_0x47020f){_0x294c31[_0xe3ca('0x2c')](_0x47020f[_0xe3ca('0x25')]({'exitAt':moment()[_0xe3ca('0x2e')](_0xe3ca('0x29'))}));});return BPromise[_0xe3ca('0x45')](_0x294c31);}}})[_0xe3ca('0xe')](function(){if(_0x57ccdd){return _0x57ccdd['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xe3ca('0xe')](function(_0x36d970){_0x53464b(_0x36d970);})[_0xe3ca('0x43')](function(_0x469443){_0x2255d5(_0x3c95bf['error'](0x1f4,_0x469443[_0xe3ca('0x14')]));});});};exports[_0xe3ca('0x46')]=function(_0x475230){var _0x115fa5=this;return new Promise(function(_0x5b58de,_0x5c5359){var _0x1d50ee;var _0x1b52e4;var _0x21d610;var _0x37c948;return db[_0xe3ca('0x1f')][_0xe3ca('0x35')]({'where':_0x475230[_0xe3ca('0x17')][_0xe3ca('0x18')]||{},'attributes':['id',_0xe3ca('0x27'),'role',_0xe3ca('0x47'),_0xe3ca('0x48'),'internal',_0xe3ca('0x49'),'interface']})[_0xe3ca('0xe')](function(_0x318dfd){if(_0x318dfd){_0x1d50ee=_0x318dfd;_0x37c948=_0x475230[_0xe3ca('0x2f')][_0xe3ca('0x23')]?_0x475230[_0xe3ca('0x2f')][_0xe3ca('0x23')]:util[_0xe3ca('0x2e')]('SIP/%s',_0x1d50ee['name']);return db['User'][_0xe3ca('0x4a')]({'where':{'role':_0xe3ca('0x4b'),'online':!![],'id':{'$ne':_0x1d50ee['id']}}});}})[_0xe3ca('0xe')](function(_0x17a29d){if(_0x17a29d){_0x21d610=_0x17a29d;return require('../../config/license/util')[_0xe3ca('0x4c')]();}})['then'](function(_0x3277fd){if(_0x3277fd&&_0x3277fd['agents']&&_0x21d610>=_0x3277fd[_0xe3ca('0x4d')]){throw new Error(_0xe3ca('0x4e'));}})[_0xe3ca('0xe')](function(){if(_0x1d50ee){return db[_0xe3ca('0x24')][_0xe3ca('0x44')]({'where':{'membername':_0x1d50ee['name']},'individualHooks':!![]});}})['then'](function(){if(_0x1d50ee){return _0x1d50ee[_0xe3ca('0x4f')]({'raw':!![]});}})[_0xe3ca('0xe')](function(_0x4cb540){if(_0x1d50ee){if(_0x4cb540){var _0x219001=[];_0x1b52e4=_0x4cb540;if(_0x1b52e4[_0xe3ca('0x28')]){for(var _0x41431e=0x0;_0x41431e<_0x1b52e4[_0xe3ca('0x28')];_0x41431e++){_0x219001[_0xe3ca('0x2c')](db[_0xe3ca('0x24')]['upsert']({'membername':_0x1d50ee['name'],'UserId':_0x1d50ee['id'],'queue_name':_0x1b52e4[_0x41431e][_0xe3ca('0x27')],'VoiceQueueId':_0x1b52e4[_0x41431e]['id'],'interface':_0x37c948,'paused':_0x1d50ee[_0xe3ca('0x49')]||![],'penalty':_0x1b52e4[_0x41431e]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xe3ca('0x45')](_0x219001);}}}})[_0xe3ca('0xe')](function(){if(_0x1d50ee){return db[_0xe3ca('0x26')][_0xe3ca('0x16')]({'where':{'membername':_0x1d50ee[_0xe3ca('0x27')],'exitAt':null}});}})[_0xe3ca('0xe')](function(_0x4dab64){if(_0x1d50ee){if(_0x4dab64&&_0x4dab64[_0xe3ca('0x28')]){var _0x19987e=[];_0x4dab64[_0xe3ca('0x2b')](function(_0x507951){_0x19987e[_0xe3ca('0x2c')](_0x507951[_0xe3ca('0x25')]({'exitAt':moment()[_0xe3ca('0x2e')](_0xe3ca('0x29'))}));});return BPromise[_0xe3ca('0x45')](_0x19987e);}}})[_0xe3ca('0xe')](function(_0x4abde4){if(_0x1d50ee){var _0x5afcb2=[];var _0x3c36ac=[];var _0x8cd549=utils[_0xe3ca('0x2a')]();var _0x5d4931={'membername':_0x1d50ee['name'],'interface':_0x37c948,'enterAt':moment()[_0xe3ca('0x2e')](_0xe3ca('0x29')),'role':_0x1d50ee[_0xe3ca('0x32')],'internal':_0x1d50ee['internal']};_0x8cd549[_0xe3ca('0x2b')](function(_0x5ece5c){_0x5afcb2['push'](_['merge']({'channel':_0x5ece5c,'type':_0xe3ca('0x50'),'data1':'callysquare','data2':_0x37c948},_0x5d4931));if(_0x1d50ee[_0xe3ca('0x49')]){_0x3c36ac[_0xe3ca('0x2c')](_[_0xe3ca('0x51')]({'channel':_0x5ece5c,'type':_0xe3ca('0x3e'),'data1':_0xe3ca('0x52')},_0x5d4931));}});return db[_0xe3ca('0x26')][_0xe3ca('0x53')](_0x5afcb2[_0xe3ca('0x54')](_0x3c36ac),{'individualHooks':!![]});}})[_0xe3ca('0xe')](function(){if(_0x1d50ee){return _0x1d50ee['update']({'online':!![],'lastLoginAt':moment()[_0xe3ca('0x2e')](_0xe3ca('0x29')),'voicePause':_0x1d50ee[_0xe3ca('0x49')]||![],'mailPause':_0x1d50ee[_0xe3ca('0x49')]||![],'chatPause':_0x1d50ee[_0xe3ca('0x49')]||![],'faxPause':_0x1d50ee['loginInPause']||![],'smsPause':_0x1d50ee[_0xe3ca('0x49')]||![],'openchannelPause':_0x1d50ee[_0xe3ca('0x49')]||![],'pauseType':_0x1d50ee['loginInPause']?_0xe3ca('0x52'):null,'lastPauseAt':moment()[_0xe3ca('0x2e')](_0xe3ca('0x29')),'interface':_0x37c948});}})['then'](function(_0x46a7b8){_0x5b58de(_0x46a7b8);})[_0xe3ca('0x43')](function(_0x521b5c){_0x5c5359(_0x115fa5[_0xe3ca('0x12')](0x1f4,_0x521b5c[_0xe3ca('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 7ae3772..77188f6 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 _0x73c8=['remove','update','emit','removeListener','register','length','user:','./user.events','save'];(function(_0x399fb4,_0x3b9673){var _0x599673=function(_0x5f16a1){while(--_0x5f16a1){_0x399fb4['push'](_0x399fb4['shift']());}};_0x599673(++_0x3b9673);}(_0x73c8,0x103));var _0x873c=function(_0x470c92,_0x104210){_0x470c92=_0x470c92-0x0;var _0x16c0ae=_0x73c8[_0x470c92];return _0x16c0ae;};'use strict';var UserEvents=require(_0x873c('0x0'));var events=[_0x873c('0x1'),_0x873c('0x2'),_0x873c('0x3')];function createListener(_0xa385bd,_0x444dea){return function(_0xed1f0e){_0x444dea[_0x873c('0x4')](_0xa385bd,_0xed1f0e);};}function removeListener(_0x2d9de0,_0x1f3ab6){return function(){UserEvents[_0x873c('0x5')](_0x2d9de0,_0x1f3ab6);};}exports[_0x873c('0x6')]=function(_0x428a4d){for(var _0x2a0d65=0x0,_0x28c89a=events[_0x873c('0x7')];_0x2a0d65<_0x28c89a;_0x2a0d65++){var _0x3e31be=events[_0x2a0d65];var _0x36dd74=createListener(_0x873c('0x8')+_0x3e31be,_0x428a4d);UserEvents['on'](_0x3e31be,_0x36dd74);}}; \ No newline at end of file +var _0x93a9=['update','emit','register','./user.events','save','remove'];(function(_0x15b608,_0x33845f){var _0x34cca7=function(_0x25a104){while(--_0x25a104){_0x15b608['push'](_0x15b608['shift']());}};_0x34cca7(++_0x33845f);}(_0x93a9,0x159));var _0x993a=function(_0x5c4d27,_0x5b0822){_0x5c4d27=_0x5c4d27-0x0;var _0x1dda1a=_0x93a9[_0x5c4d27];return _0x1dda1a;};'use strict';var UserEvents=require(_0x993a('0x0'));var events=[_0x993a('0x1'),_0x993a('0x2'),_0x993a('0x3')];function createListener(_0x5e5ef5,_0x35954c){return function(_0xe5c026){_0x35954c[_0x993a('0x4')](_0x5e5ef5,_0xe5c026);};}function removeListener(_0x168a86,_0x33381a){return function(){UserEvents['removeListener'](_0x168a86,_0x33381a);};}exports[_0x993a('0x5')]=function(_0x35af01){for(var _0x1265c1=0x0,_0x58376f=events['length'];_0x1265c1<_0x58376f;_0x1265c1++){var _0x1ab270=events[_0x1265c1];var _0x3893b8=createListener('user:'+_0x1ab270,_0x35af01);UserEvents['on'](_0x1ab270,_0x3893b8);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 67ea2f8..32e1c32 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x209e81,_0x40d7a1){var _0x18ad00=function(_0x5e4cdc){while(--_0x5e4cdc){_0x209e81['push'](_0x209e81['shift']());}};_0x18ad00(++_0x40d7a1);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x397c8d,_0xf0a1a4){var _0x1c5b0a=function(_0x4585d8){while(--_0x4585d8){_0x397c8d['push'](_0x397c8d['shift']());}};_0x1c5b0a(++_0xf0a1a4);}(_0x9c44,0x178));var _0x49c4=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x9c44[_0x3d42d8];return _0x27fc41;};'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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index edb228c..cb79a67 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 _0x8aea=['INTEGER','sequelize','exports'];(function(_0x9138a6,_0xbce9a7){var _0x241acf=function(_0xd96c5e){while(--_0xd96c5e){_0x9138a6['push'](_0x9138a6['shift']());}};_0x241acf(++_0xbce9a7);}(_0x8aea,0x178));var _0xa8ae=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x8aea[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0xa8ae('0x0'));module[_0xa8ae('0x1')]={'penalty':{'type':Sequelize[_0xa8ae('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3c72=['sequelize','exports'];(function(_0x7070a4,_0x317546){var _0x445441=function(_0x491430){while(--_0x491430){_0x7070a4['push'](_0x7070a4['shift']());}};_0x445441(++_0x317546);}(_0x3c72,0xdc));var _0x23c7=function(_0x58e7ca,_0x13575f){_0x58e7ca=_0x58e7ca-0x0;var _0x1d3fb1=_0x3c72[_0x58e7ca];return _0x1d3fb1;};'use strict';var Sequelize=require(_0x23c7('0x0'));module[_0x23c7('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 748ad58..be373aa 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 _0xde56=['../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x5e08ee,_0x45c038){var _0x3b1dcc=function(_0x533646){while(--_0x533646){_0x5e08ee['push'](_0x5e08ee['shift']());}};_0x3b1dcc(++_0x45c038);}(_0xde56,0x1da));var _0x6de5=function(_0x4bb581,_0x6f7037){_0x4bb581=_0x4bb581-0x0;var _0x316bf5=_0xde56[_0x4bb581];return _0x316bf5;};'use strict';var _=require('lodash');var util=require(_0x6de5('0x0'));var logger=require(_0x6de5('0x1'))(_0x6de5('0x2'));var moment=require(_0x6de5('0x3'));var BPromise=require(_0x6de5('0x4'));var rp=require(_0x6de5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6de5('0x6'));var config=require(_0x6de5('0x7'));var attributes=require(_0x6de5('0x8'));module[_0x6de5('0x9')]=function(_0x4b110f,_0x5ed07e){return _0x4b110f[_0x6de5('0xa')](_0x6de5('0xb'),attributes,{'tableName':_0x6de5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0361=['UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','define'];(function(_0x3a9878,_0x5870f7){var _0x5c9a45=function(_0x4ea6de){while(--_0x4ea6de){_0x3a9878['push'](_0x3a9878['shift']());}};_0x5c9a45(++_0x5870f7);}(_0x0361,0xfe));var _0x1036=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x0361[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x1036('0x0'));var util=require(_0x1036('0x1'));var logger=require(_0x1036('0x2'))(_0x1036('0x3'));var moment=require('moment');var BPromise=require(_0x1036('0x4'));var rp=require(_0x1036('0x5'));var fs=require('fs');var path=require(_0x1036('0x6'));var rimraf=require(_0x1036('0x7'));var config=require(_0x1036('0x8'));var attributes=require('./userChatQueue.attributes');module['exports']=function(_0x18dbea,_0x4d8891){return _0x18dbea[_0x1036('0x9')](_0x1036('0xa'),attributes,{'tableName':_0x1036('0xb'),'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 c60413a..73e323e 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 _0x3599=['http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client'];(function(_0x275576,_0x2d98fe){var _0x4aec2f=function(_0x7e6749){while(--_0x7e6749){_0x275576['push'](_0x275576['shift']());}};_0x4aec2f(++_0x2d98fe);}(_0x3599,0x146));var _0x9359=function(_0x2a1f7f,_0xca32e2){_0x2a1f7f=_0x2a1f7f-0x0;var _0x424e4c=_0x3599[_0x2a1f7f];return _0x424e4c;};'use strict';var _=require(_0x9359('0x0'));var util=require('util');var moment=require(_0x9359('0x1'));var BPromise=require(_0x9359('0x2'));var rs=require(_0x9359('0x3'));var fs=require('fs');var Redis=require(_0x9359('0x4'));var db=require(_0x9359('0x5'))['db'];var utils=require(_0x9359('0x6'));var logger=require('../../config/logger')(_0x9359('0x7'));var config=require(_0x9359('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9359('0x9')][_0x9359('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x149f61,_0x3ebd17,_0x4394ef){return new BPromise(function(_0x2d4f8f,_0x4f6e24){return client[_0x9359('0xb')](_0x149f61,_0x4394ef)[_0x9359('0xc')](function(_0xb7df53){logger[_0x9359('0xd')](_0x9359('0xe'),_0x3ebd17,_0x9359('0xf'));logger[_0x9359('0x10')](_0x9359('0x11'),_0x3ebd17,'request\x20sent',JSON[_0x9359('0x12')](_0xb7df53));if(_0xb7df53['error']){if(_0xb7df53['error'][_0x9359('0x13')]===0x1f4){logger[_0x9359('0x14')]('UserChatQueue,\x20%s,\x20%s',_0x3ebd17,_0xb7df53[_0x9359('0x14')][_0x9359('0x15')]);return _0x4f6e24(_0xb7df53[_0x9359('0x14')][_0x9359('0x15')]);}logger['error'](_0x9359('0xe'),_0x3ebd17,_0xb7df53[_0x9359('0x14')]['message']);return _0x2d4f8f(_0xb7df53[_0x9359('0x14')][_0x9359('0x15')]);}else{logger[_0x9359('0xd')](_0x9359('0xe'),_0x3ebd17,_0x9359('0xf'));_0x2d4f8f(_0xb7df53[_0x9359('0x16')][_0x9359('0x15')]);}})[_0x9359('0x17')](function(_0x1c70c0){logger[_0x9359('0x14')](_0x9359('0xe'),_0x3ebd17,_0x1c70c0);_0x4f6e24(_0x1c70c0);});});} \ No newline at end of file +var _0x012c=['lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','UserChatQueue,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0xd41b79,_0xe239b5){var _0x548b25=function(_0x283c34){while(--_0x283c34){_0xd41b79['push'](_0xd41b79['shift']());}};_0x548b25(++_0xe239b5);}(_0x012c,0xff));var _0xc012=function(_0x54fc1f,_0x1703c2){_0x54fc1f=_0x54fc1f-0x0;var _0x53f699=_0x012c[_0x54fc1f];return _0x53f699;};'use strict';var _=require(_0xc012('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc012('0x1'));var rs=require(_0xc012('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc012('0x3'));var logger=require(_0xc012('0x4'))(_0xc012('0x5'));var config=require(_0xc012('0x6'));var jayson=require(_0xc012('0x7'));var client=jayson[_0xc012('0x8')][_0xc012('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1366eb,_0x2b0ea9,_0x381f2e){return new BPromise(function(_0x3d2c7f,_0x5d88c2){return client['request'](_0x1366eb,_0x381f2e)['then'](function(_0x1b3dc0){logger[_0xc012('0xa')](_0xc012('0xb'),_0x2b0ea9,_0xc012('0xc'));logger['debug'](_0xc012('0xd'),_0x2b0ea9,'request\x20sent',JSON['stringify'](_0x1b3dc0));if(_0x1b3dc0[_0xc012('0xe')]){if(_0x1b3dc0[_0xc012('0xe')]['code']===0x1f4){logger[_0xc012('0xe')](_0xc012('0xb'),_0x2b0ea9,_0x1b3dc0[_0xc012('0xe')]['message']);return _0x5d88c2(_0x1b3dc0[_0xc012('0xe')][_0xc012('0xf')]);}logger['error'](_0xc012('0xb'),_0x2b0ea9,_0x1b3dc0[_0xc012('0xe')]['message']);return _0x3d2c7f(_0x1b3dc0[_0xc012('0xe')]['message']);}else{logger[_0xc012('0xa')](_0xc012('0xb'),_0x2b0ea9,_0xc012('0xc'));_0x3d2c7f(_0x1b3dc0[_0xc012('0x10')][_0xc012('0xf')]);}})['catch'](function(_0x57c964){logger[_0xc012('0xe')](_0xc012('0xb'),_0x2b0ea9,_0x57c964);_0x5d88c2(_0x57c964);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 0f8755a..a5dd02e 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x497f84,_0x292619){var _0x419f9c=function(_0x4ec65b){while(--_0x4ec65b){_0x497f84['push'](_0x497f84['shift']());}};_0x419f9c(++_0x292619);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x559008,_0x158d9b){var _0x156fb6=function(_0x34b1f0){while(--_0x34b1f0){_0x559008['push'](_0x559008['shift']());}};_0x156fb6(++_0x158d9b);}(_0x70e0,0x17b));var _0x070e=function(_0x293abe,_0x44989b){_0x293abe=_0x293abe-0x0;var _0x1140e8=_0x70e0[_0x293abe];return _0x1140e8;};'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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index f40e706..3f68171 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 _0x8bde=['INTEGER','STRING','sequelize','exports'];(function(_0x4a5f23,_0x4dafa9){var _0x4b3230=function(_0x2c1386){while(--_0x2c1386){_0x4a5f23['push'](_0x4a5f23['shift']());}};_0x4b3230(++_0x4dafa9);}(_0x8bde,0x13e));var _0xe8bd=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0x8bde[_0x381589];return _0x2a075d;};'use strict';var Sequelize=require(_0xe8bd('0x0'));module[_0xe8bd('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xe8bd('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xe8bd('0x3')]}}; \ No newline at end of file +var _0xa46d=['INTEGER'];(function(_0x5689f7,_0xf19d29){var _0x919aeb=function(_0x3ea7d9){while(--_0x3ea7d9){_0x5689f7['push'](_0x5689f7['shift']());}};_0x919aeb(++_0xf19d29);}(_0xa46d,0x1c6));var _0xda46=function(_0x36c1db,_0x5023bb){_0x36c1db=_0x36c1db-0x0;var _0xbe2ea3=_0xa46d[_0x36c1db];return _0xbe2ea3;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xda46('0x0')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 58a2924..b830d8b 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 _0x37e4=['define','UserFaxQueue','user_has_fax_queues','lodash','bluebird','path','../../config/environment','exports'];(function(_0x3584a7,_0x1e3828){var _0x2ad167=function(_0x41662a){while(--_0x41662a){_0x3584a7['push'](_0x3584a7['shift']());}};_0x2ad167(++_0x1e3828);}(_0x37e4,0x14b));var _0x437e=function(_0x834c09,_0x4a7bb1){_0x834c09=_0x834c09-0x0;var _0x527b97=_0x37e4[_0x834c09];return _0x527b97;};'use strict';var _=require(_0x437e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x437e('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x437e('0x2'));var rimraf=require('rimraf');var config=require(_0x437e('0x3'));var attributes=require('./userFaxQueue.attributes');module[_0x437e('0x4')]=function(_0x5d323e,_0x56dab4){return _0x5d323e[_0x437e('0x5')](_0x437e('0x6'),attributes,{'tableName':_0x437e('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1381=['bluebird','request-promise','../../config/environment','exports','define','user_has_fax_queues','lodash','util','../../config/logger','api','moment'];(function(_0x216fc8,_0x448d7a){var _0x4c5841=function(_0x211c75){while(--_0x211c75){_0x216fc8['push'](_0x216fc8['shift']());}};_0x4c5841(++_0x448d7a);}(_0x1381,0xe2));var _0x1138=function(_0x3523f2,_0x562d96){_0x3523f2=_0x3523f2-0x0;var _0x3a04bd=_0x1381[_0x3523f2];return _0x3a04bd;};'use strict';var _=require(_0x1138('0x0'));var util=require(_0x1138('0x1'));var logger=require(_0x1138('0x2'))(_0x1138('0x3'));var moment=require(_0x1138('0x4'));var BPromise=require(_0x1138('0x5'));var rp=require(_0x1138('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1138('0x7'));var attributes=require('./userFaxQueue.attributes');module[_0x1138('0x8')]=function(_0x1e54a1,_0x112a61){return _0x1e54a1[_0x1138('0x9')]('UserFaxQueue',attributes,{'tableName':_0x1138('0xa'),'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 0abd421..b59df38 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 _0x8a8a=['moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util'];(function(_0x57d4f3,_0x8e4878){var _0x157ae5=function(_0x16578c){while(--_0x16578c){_0x57d4f3['push'](_0x57d4f3['shift']());}};_0x157ae5(++_0x8e4878);}(_0x8a8a,0x167));var _0xa8a8=function(_0x5daf35,_0x4ead6a){_0x5daf35=_0x5daf35-0x0;var _0x236af1=_0x8a8a[_0x5daf35];return _0x236af1;};'use strict';var _=require(_0xa8a8('0x0'));var util=require(_0xa8a8('0x1'));var moment=require(_0xa8a8('0x2'));var BPromise=require(_0xa8a8('0x3'));var rs=require(_0xa8a8('0x4'));var fs=require('fs');var Redis=require(_0xa8a8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa8a8('0x6'));var logger=require('../../config/logger')(_0xa8a8('0x7'));var config=require(_0xa8a8('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x160fce,_0x144f3,_0x3831c2){return new BPromise(function(_0xfae78a,_0x53f0c9){return client['request'](_0x160fce,_0x3831c2)[_0xa8a8('0x9')](function(_0x4f241d){logger[_0xa8a8('0xa')](_0xa8a8('0xb'),_0x144f3,_0xa8a8('0xc'));logger[_0xa8a8('0xd')](_0xa8a8('0xe'),_0x144f3,_0xa8a8('0xc'),JSON['stringify'](_0x4f241d));if(_0x4f241d[_0xa8a8('0xf')]){if(_0x4f241d['error'][_0xa8a8('0x10')]===0x1f4){logger[_0xa8a8('0xf')](_0xa8a8('0xb'),_0x144f3,_0x4f241d[_0xa8a8('0xf')][_0xa8a8('0x11')]);return _0x53f0c9(_0x4f241d[_0xa8a8('0xf')][_0xa8a8('0x11')]);}logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x144f3,_0x4f241d[_0xa8a8('0xf')][_0xa8a8('0x11')]);return _0xfae78a(_0x4f241d['error']['message']);}else{logger[_0xa8a8('0xa')]('UserFaxQueue,\x20%s,\x20%s',_0x144f3,_0xa8a8('0xc'));_0xfae78a(_0x4f241d['result'][_0xa8a8('0x11')]);}})[_0xa8a8('0x12')](function(_0x473c5a){logger[_0xa8a8('0xf')]('UserFaxQueue,\x20%s,\x20%s',_0x144f3,_0x473c5a);_0x53f0c9(_0x473c5a);});});} \ No newline at end of file +var _0x5731=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserFaxQueue,\x20%s,\x20%s','message','result','lodash'];(function(_0x2e3b4c,_0x4931f6){var _0x38457f=function(_0x1436f8){while(--_0x1436f8){_0x2e3b4c['push'](_0x2e3b4c['shift']());}};_0x38457f(++_0x4931f6);}(_0x5731,0x179));var _0x1573=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x5731[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x1573('0x0'));var util=require('util');var moment=require(_0x1573('0x1'));var BPromise=require(_0x1573('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1573('0x3'));var db=require(_0x1573('0x4'))['db'];var utils=require(_0x1573('0x5'));var logger=require('../../config/logger')(_0x1573('0x6'));var config=require(_0x1573('0x7'));var jayson=require(_0x1573('0x8'));var client=jayson['client'][_0x1573('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x53d87a,_0x1925ad,_0x2f2bb9){return new BPromise(function(_0x1bdd69,_0x389269){return client['request'](_0x53d87a,_0x2f2bb9)[_0x1573('0xa')](function(_0x117c14){logger[_0x1573('0xb')]('UserFaxQueue,\x20%s,\x20%s',_0x1925ad,_0x1573('0xc'));logger[_0x1573('0xd')](_0x1573('0xe'),_0x1925ad,_0x1573('0xc'),JSON[_0x1573('0xf')](_0x117c14));if(_0x117c14[_0x1573('0x10')]){if(_0x117c14[_0x1573('0x10')][_0x1573('0x11')]===0x1f4){logger[_0x1573('0x10')](_0x1573('0x12'),_0x1925ad,_0x117c14[_0x1573('0x10')]['message']);return _0x389269(_0x117c14['error']['message']);}logger['error'](_0x1573('0x12'),_0x1925ad,_0x117c14[_0x1573('0x10')][_0x1573('0x13')]);return _0x1bdd69(_0x117c14[_0x1573('0x10')][_0x1573('0x13')]);}else{logger[_0x1573('0xb')]('UserFaxQueue,\x20%s,\x20%s',_0x1925ad,_0x1573('0xc'));_0x1bdd69(_0x117c14[_0x1573('0x14')][_0x1573('0x13')]);}})['catch'](function(_0x29dfdf){logger['error'](_0x1573('0x12'),_0x1925ad,_0x29dfdf);_0x389269(_0x29dfdf);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index ae7f90d..c244d9f 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x299303,_0x52a606){var _0x4545a0=function(_0x10e453){while(--_0x10e453){_0x299303['push'](_0x299303['shift']());}};_0x4545a0(++_0x52a606);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x304b67,_0x31cb39){_0x304b67=_0x304b67-0x0;var _0x493afb=_0xcb91[_0x304b67];return _0x493afb;};'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(_0x1939e2,_0x17e222){var _0x247cbc=function(_0x4288ee){while(--_0x4288ee){_0x1939e2['push'](_0x1939e2['shift']());}};_0x247cbc(++_0x17e222);}(_0xe706,0xa3));var _0x6e70=function(_0x263f81,_0x490cad){_0x263f81=_0x263f81-0x0;var _0xf2563=_0xe706[_0x263f81];return _0xf2563;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index fc30acb..c86dd57 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 _0xec39=['INTEGER','sequelize','exports'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0xec39,0x19f));var _0x9ec3=function(_0x3aee49,_0x334c25){_0x3aee49=_0x3aee49-0x0;var _0x2f55b2=_0xec39[_0x3aee49];return _0x2f55b2;};'use strict';var Sequelize=require(_0x9ec3('0x0'));module[_0x9ec3('0x1')]={'penalty':{'type':Sequelize[_0x9ec3('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x23a3=['sequelize','INTEGER'];(function(_0x18d191,_0x49d54d){var _0x11dd16=function(_0x2f96ae){while(--_0x2f96ae){_0x18d191['push'](_0x18d191['shift']());}};_0x11dd16(++_0x49d54d);}(_0x23a3,0x1ac));var _0x323a=function(_0x4c04a1,_0x41ede1){_0x4c04a1=_0x4c04a1-0x0;var _0x352e1e=_0x23a3[_0x4c04a1];return _0x352e1e;};'use strict';var Sequelize=require(_0x323a('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x323a('0x1')],'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 b591634..efdfd96 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 _0x5e74=['exports','UserMailQueue','user_has_mail_queues','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes'];(function(_0x36249e,_0x49eec6){var _0x36ea38=function(_0x177bff){while(--_0x177bff){_0x36249e['push'](_0x36249e['shift']());}};_0x36ea38(++_0x49eec6);}(_0x5e74,0x16b));var _0x45e7=function(_0xde21fb,_0x9abd7c){_0xde21fb=_0xde21fb-0x0;var _0x31c03a=_0x5e74[_0xde21fb];return _0x31c03a;};'use strict';var _=require('lodash');var util=require(_0x45e7('0x0'));var logger=require('../../config/logger')(_0x45e7('0x1'));var moment=require(_0x45e7('0x2'));var BPromise=require(_0x45e7('0x3'));var rp=require(_0x45e7('0x4'));var fs=require('fs');var path=require(_0x45e7('0x5'));var rimraf=require(_0x45e7('0x6'));var config=require(_0x45e7('0x7'));var attributes=require(_0x45e7('0x8'));module[_0x45e7('0x9')]=function(_0x33904c,_0x4f4a4f){return _0x33904c['define'](_0x45e7('0xa'),attributes,{'tableName':_0x45e7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x806b=['api','moment','bluebird','request-promise','path','rimraf','exports','UserMailQueue','user_has_mail_queues','util','../../config/logger'];(function(_0x3b6144,_0x1ce781){var _0x1b6cd9=function(_0x33f4e5){while(--_0x33f4e5){_0x3b6144['push'](_0x3b6144['shift']());}};_0x1b6cd9(++_0x1ce781);}(_0x806b,0x1a0));var _0xb806=function(_0x2fc55d,_0x987968){_0x2fc55d=_0x2fc55d-0x0;var _0x4442c5=_0x806b[_0x2fc55d];return _0x4442c5;};'use strict';var _=require('lodash');var util=require(_0xb806('0x0'));var logger=require(_0xb806('0x1'))(_0xb806('0x2'));var moment=require(_0xb806('0x3'));var BPromise=require(_0xb806('0x4'));var rp=require(_0xb806('0x5'));var fs=require('fs');var path=require(_0xb806('0x6'));var rimraf=require(_0xb806('0x7'));var config=require('../../config/environment');var attributes=require('./userMailQueue.attributes');module[_0xb806('0x8')]=function(_0x1ef41e,_0x458796){return _0x1ef41e['define'](_0xb806('0x9'),attributes,{'tableName':_0xb806('0xa'),'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 1de3719..d9dcf42 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 _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','UserMailQueue,\x20%s,\x20%s','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x73d814,_0x14be64){var _0x131c4b=function(_0x2de121){while(--_0x2de121){_0x73d814['push'](_0x73d814['shift']());}};_0x131c4b(++_0x14be64);}(_0xe14b,0x93));var _0xbe14=function(_0x23af1b,_0x3c2650){_0x23af1b=_0x23af1b-0x0;var _0xe5b9e3=_0xe14b[_0x23af1b];return _0xe5b9e3;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});} \ No newline at end of file +var _0x3e74=['rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','UserMailQueue,\x20%s,\x20%s','message','info','catch','lodash','moment','bluebird','randomstring','../../config/utils'];(function(_0x4851ff,_0x59cd13){var _0x1be211=function(_0xac8b72){while(--_0xac8b72){_0x4851ff['push'](_0x4851ff['shift']());}};_0x1be211(++_0x59cd13);}(_0x3e74,0x175));var _0x43e7=function(_0x356f5f,_0x3a1e6f){_0x356f5f=_0x356f5f-0x0;var _0x57a317=_0x3e74[_0x356f5f];return _0x57a317;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 5e9f53d..2695195 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 _0x4673=['path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./userNotification.controller','post','isAuthenticated','util'];(function(_0x33b4d3,_0x3ddc19){var _0x1503e4=function(_0x16310e){while(--_0x16310e){_0x33b4d3['push'](_0x33b4d3['shift']());}};_0x1503e4(++_0x3ddc19);}(_0x4673,0xbc));var _0x3467=function(_0x7eacf9,_0x46199f){_0x7eacf9=_0x7eacf9-0x0;var _0x186f00=_0x4673[_0x7eacf9];return _0x186f00;};'use strict';var multer=require('multer');var util=require(_0x3467('0x0'));var path=require(_0x3467('0x1'));var timeout=require(_0x3467('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3467('0x3'));var auth=require(_0x3467('0x4'));var interaction=require(_0x3467('0x5'));var config=require('../../config/environment');var controller=require(_0x3467('0x6'));router[_0x3467('0x7')]('/',auth[_0x3467('0x8')](),controller['sendUserNotification']);module['exports']=router; \ No newline at end of file +var _0x7ee5=['path','connect-timeout','express','Router','fs-extra','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','multer','util'];(function(_0x12ca7a,_0x3295bf){var _0x2249df=function(_0x48b046){while(--_0x48b046){_0x12ca7a['push'](_0x12ca7a['shift']());}};_0x2249df(++_0x3295bf);}(_0x7ee5,0x76));var _0x57ee=function(_0x3e3221,_0x392851){_0x3e3221=_0x3e3221-0x0;var _0x190da4=_0x7ee5[_0x3e3221];return _0x190da4;};'use strict';var multer=require(_0x57ee('0x0'));var util=require(_0x57ee('0x1'));var path=require(_0x57ee('0x2'));var timeout=require(_0x57ee('0x3'));var express=require(_0x57ee('0x4'));var router=express[_0x57ee('0x5')]();var fs_extra=require(_0x57ee('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x57ee('0x7'));router[_0x57ee('0x8')]('/',auth[_0x57ee('0x9')](),controller[_0x57ee('0xa')]);module[_0x57ee('0xb')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 27f34d1..ab135b8 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 _0x5426=['STRING','BOOLEAN','exports','TEXT'];(function(_0x2fe7e6,_0x43ab21){var _0x57d492=function(_0x4ffd4b){while(--_0x4ffd4b){_0x2fe7e6['push'](_0x2fe7e6['shift']());}};_0x57d492(++_0x43ab21);}(_0x5426,0xda));var _0x6542=function(_0xb841b7,_0x3dea30){_0xb841b7=_0xb841b7-0x0;var _0x326d1c=_0x5426[_0xb841b7];return _0x326d1c;};'use strict';var Sequelize=require('sequelize');module[_0x6542('0x0')]={'body':{'type':Sequelize[_0x6542('0x1')]},'senderName':{'type':Sequelize[_0x6542('0x2')]},'recipientsId':{'type':Sequelize[_0x6542('0x1')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x6542('0x3')]}}; \ No newline at end of file +var _0xf0d9=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x29c0fb,_0x458bb9){var _0x4ba569=function(_0x3a2d80){while(--_0x3a2d80){_0x29c0fb['push'](_0x29c0fb['shift']());}};_0x4ba569(++_0x458bb9);}(_0xf0d9,0x1ea));var _0x9f0d=function(_0x209710,_0x3df469){_0x209710=_0x209710-0x0;var _0x510c1b=_0xf0d9[_0x209710];return _0x510c1b;};'use strict';var Sequelize=require(_0x9f0d('0x0'));module[_0x9f0d('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0x9f0d('0x2')]},'recipientsDescription':{'type':Sequelize[_0x9f0d('0x3')]},'beep':{'type':Sequelize[_0x9f0d('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 0bd77c8..0d04013 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 _0x5578=['replace','all','flatten','getAgents','map','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','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','./userNotification.socket','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','destroy','then','error','name','send','body','hasOwnProperty','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','Missing\x20\x27recipients\x27\x20parameter','Invalid\x20\x27recipients\x27\x20object','faxqueue','mailqueue','openchannelqueue','smsqueue','team','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','join','UserNotification','create','forEach','recipient','emit','userNotification:send','catch','text','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','startCase','union','ids','queue'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x5578,0xc1));var _0x8557=function(_0x5cc8b9,_0x20e3c3){_0x5cc8b9=_0x5cc8b9-0x0;var _0x58892e=_0x5578[_0x5cc8b9];return _0x58892e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8557('0x0'));var zipdir=require(_0x8557('0x1'));var jsonpatch=require(_0x8557('0x2'));var rp=require(_0x8557('0x3'));var moment=require('moment');var BPromise=require(_0x8557('0x4'));var Mustache=require('mustache');var util=require(_0x8557('0x5'));var path=require(_0x8557('0x6'));var sox=require('sox');var csv=require(_0x8557('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8557('0x8'));var _=require('lodash');var squel=require(_0x8557('0x9'));var crypto=require(_0x8557('0xa'));var jsforce=require(_0x8557('0xb'));var deskjs=require(_0x8557('0xc'));var toCsv=require(_0x8557('0x7'));var querystring=require(_0x8557('0xd'));var Papa=require(_0x8557('0xe'));var Redis=require(_0x8557('0xf'));var authService=require(_0x8557('0x10'));var qs=require(_0x8557('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8557('0x12'));var logger=require(_0x8557('0x13'))(_0x8557('0x14'));var utils=require('../../config/utils');var config=require(_0x8557('0x15'));var licenseUtil=require(_0x8557('0x16'));var db=require(_0x8557('0x17'))['db'];config[_0x8557('0x18')]=_[_0x8557('0x19')](config[_0x8557('0x18')],{'host':_0x8557('0x1a'),'port':0x18eb});var socket=require(_0x8557('0x1b'))(new Redis(config[_0x8557('0x18')]));require(_0x8557('0x1c'))[_0x8557('0x1d')](socket);function respondWithStatusCode(_0x4a99dc,_0x357f6a){_0x357f6a=_0x357f6a||0xcc;return function(_0xcc725a){if(_0xcc725a){return _0x4a99dc[_0x8557('0x1e')](_0x357f6a);}return _0x4a99dc[_0x8557('0x1f')](_0x357f6a)[_0x8557('0x20')]();};}function respondWithResult(_0x460e04,_0x2acd1f){_0x2acd1f=_0x2acd1f||0xc8;return function(_0x364c91){if(_0x364c91){return _0x460e04['status'](_0x2acd1f)['json'](_0x364c91);}};}function respondWithFilteredResult(_0x3da6e7,_0x1bcf6f){return function(_0x5c9925){if(_0x5c9925){var _0x2e24f5=typeof _0x1bcf6f[_0x8557('0x21')]===_0x8557('0x22')&&typeof _0x1bcf6f[_0x8557('0x23')]===_0x8557('0x22');var _0x598eb2=_0x5c9925[_0x8557('0x24')];var _0x192858=_0x2e24f5?0x0:_0x1bcf6f['offset'];var _0x4b2c51=_0x2e24f5?_0x5c9925[_0x8557('0x24')]:_0x1bcf6f[_0x8557('0x21')]+_0x1bcf6f[_0x8557('0x23')];var _0x32cf85;if(_0x4b2c51>=_0x598eb2){_0x4b2c51=_0x598eb2;_0x32cf85=0xc8;}else{_0x32cf85=0xce;}_0x3da6e7[_0x8557('0x1f')](_0x32cf85);return _0x3da6e7['set'](_0x8557('0x25'),_0x192858+'-'+_0x4b2c51+'/'+_0x598eb2)[_0x8557('0x26')](_0x5c9925);}return null;};}function patchUpdates(_0x4f7f93){return function(_0x4e1b1b){try{jsonpatch[_0x8557('0x27')](_0x4e1b1b,_0x4f7f93,!![]);}catch(_0x13fab2){return BPromise[_0x8557('0x28')](_0x13fab2);}return _0x4e1b1b[_0x8557('0x29')]();};}function saveUpdates(_0x532783,_0x222c63){return function(_0x48066a){if(_0x48066a){return _0x48066a['update'](_0x532783)['then'](function(_0x540760){return _0x540760;});}return null;};}function removeEntity(_0x2adbc5,_0x4c867f){return function(_0x41fcd5){if(_0x41fcd5){return _0x41fcd5[_0x8557('0x2a')]()[_0x8557('0x2b')](function(){_0x2adbc5[_0x8557('0x1f')](0xcc)[_0x8557('0x20')]();});}};}function handleEntityNotFound(_0x1d6afa,_0x42a638){return function(_0x5288a2){if(!_0x5288a2){_0x1d6afa[_0x8557('0x1e')](0x194);}return _0x5288a2;};}function handleError(_0x250dc3,_0xa07648){_0xa07648=_0xa07648||0x1f4;return function(_0x41cc93){logger[_0x8557('0x2c')](_0x41cc93['stack']);if(_0x41cc93['name']){delete _0x41cc93[_0x8557('0x2d')];}_0x250dc3[_0x8557('0x1f')](_0xa07648)[_0x8557('0x2e')](_0x41cc93);};}exports['sendUserNotification']=function(_0x1135a3,_0x32a90c,_0x35887a){if(!_0x1135a3[_0x8557('0x2f')][_0x8557('0x30')]('text')&&!_0x1135a3[_0x8557('0x2f')][_0x8557('0x30')](_0x8557('0x31'))){throw new db[(_0x8557('0x32'))][(_0x8557('0x33'))](_0x8557('0x34'));}else{if(_0x1135a3['body'][_0x8557('0x30')]('TemplateId')&&!_0x1135a3[_0x8557('0x2f')][_0x8557('0x30')](_0x8557('0x35'))){throw new db[(_0x8557('0x32'))]['ValidationError'](_0x8557('0x36'));}if(!_0x1135a3[_0x8557('0x2f')][_0x8557('0x30')]('recipients')){throw new db['Sequelize'][(_0x8557('0x33'))](_0x8557('0x37'));}else{try{var _0x53143a=JSON['parse'](_0x1135a3[_0x8557('0x2f')]['recipients']);}catch(_0x579187){logger[_0x8557('0x2c')](_0x579187);throw new db['Sequelize'][(_0x8557('0x33'))](_0x8557('0x38'));}var _0xa5658f=['chatqueue',_0x8557('0x39'),_0x8557('0x3a'),_0x8557('0x3b'),_0x8557('0x3c'),'voicequeue','whatsappqueue',_0x8557('0x3d'),_0x8557('0x3e')];if(_[_0x8557('0x3f')](_0x53143a,function(_0x4fdc44){return!_[_0x8557('0x40')](_0xa5658f,_0x4fdc44[_0x8557('0x41')][_0x8557('0x42')]());})){throw new db['Sequelize'][(_0x8557('0x33'))](_0x8557('0x43'));}}}var _0x7ac244={};_0x7ac244[_0x8557('0x44')]=_0x1135a3[_0x8557('0x2f')][_0x8557('0x30')](_0x8557('0x44'))?_0x1135a3[_0x8557('0x2f')][_0x8557('0x44')]:_0x1135a3[_0x8557('0x3e')][_0x8557('0x45')];_0x7ac244[_0x8557('0x46')]=_[_0x8557('0x47')](_0x1135a3[_0x8557('0x2f')]['recipientsDescription'])?null:_0x1135a3['body'][_0x8557('0x46')];_0x7ac244[_0x8557('0x48')]=_0x1135a3[_0x8557('0x2f')][_0x8557('0x48')]||![];_0x7ac244[_0x8557('0x49')]=_0x1135a3[_0x8557('0x3e')]['id'];return getContent(_0x1135a3[_0x8557('0x2f')])['then'](function(_0xc63c90){_0x7ac244['body']=_0xc63c90;return getRecipients(_0x53143a);})['then'](function(_0x4b44c2){_0x7ac244['recipientsId']=_['sortBy'](_0x4b44c2)[_0x8557('0x4a')](',');return db['sequelize']['transaction'](function(_0x52c05f){return db[_0x8557('0x4b')][_0x8557('0x4c')](_0x7ac244,{'raw':!![],'transaction':_0x52c05f})[_0x8557('0x2b')](function(_0x21e444){var _0xe86965={'sender':_0x7ac244[_0x8557('0x44')],'description':_0x7ac244[_0x8557('0x46')],'content':_0x7ac244[_0x8557('0x2f')],'beep':_0x7ac244[_0x8557('0x48')]};_0x4b44c2[_0x8557('0x4d')](function(_0x245ec1){_0xe86965[_0x8557('0x4e')]=_0x245ec1;socket[_0x8557('0x4f')](_0x8557('0x50'),_0xe86965);});return _0x21e444;});});})[_0x8557('0x2b')](respondWithResult(_0x32a90c,0xc9))[_0x8557('0x51')](handleError(_0x32a90c,null));};function getContent(_0x2f159a){return new BPromise(function(_0x2e7d8e,_0x3e0221){if(_0x2f159a[_0x8557('0x52')]){_0x2e7d8e(_0x2f159a[_0x8557('0x52')]);return;}return db['Template'][_0x8557('0x53')]({'attributes':['html'],'where':{'id':_0x2f159a[_0x8557('0x31')]},'raw':!![]})[_0x8557('0x2b')](function(_0x5010a8){if(!_0x5010a8)throw new db[(_0x8557('0x32'))][(_0x8557('0x33'))](_0x8557('0x54'));var _0x5421c0=Mustache['render'](_0x5010a8['html'],_0x2f159a[_0x8557('0x35')]);_0x2e7d8e(_0x5421c0);})[_0x8557('0x51')](function(_0x4b3313){_0x3e0221(_0x4b3313);});});}function getRecipients(_0x4fb5e3){return new BPromise(function(_0x191396,_0xb93790){var _0x4e1392=[];var _0x500b9c=[];_0x4fb5e3[_0x8557('0x4d')](function(_0x5a1e49){var _0x44375a=_[_0x8557('0x55')](_0x5a1e49[_0x8557('0x41')][_0x8557('0x42')]());if(_0x44375a==='User'){_0x4e1392=_[_0x8557('0x56')](_0x4e1392,_0x5a1e49[_0x8557('0x57')]);}else{if(_[_0x8557('0x40')](_0x44375a,_0x8557('0x58')))_0x44375a=_0x44375a[_0x8557('0x59')]('queue','Queue');_0x5a1e49['ids'][_0x8557('0x4d')](function(_0x3ff4f6){_0x500b9c['push'](getAgents(_0x44375a,_0x3ff4f6));});}});return BPromise[_0x8557('0x5a')](_0x500b9c)[_0x8557('0x2b')](function(_0x57c500){_0x4e1392=_[_0x8557('0x56')](_0x4e1392,_[_0x8557('0x5b')](_0x57c500));_0x191396(_0x4e1392);})[_0x8557('0x51')](function(_0x21e41f){_0xb93790(_0x21e41f);});});}function getAgents(_0x412a87,_0x1a1757){return new BPromise(function(_0x4ab4df,_0x24b533){return db[_0x412a87][_0x8557('0x53')]({'where':{'id':_0x1a1757}})[_0x8557('0x2b')](function(_0x25b3eb){return _0x25b3eb[_0x8557('0x5c')]({'attributes':['id'],'raw':!![]})[_0x8557('0x2b')](function(_0x5808db){var _0x55956a=_[_0x8557('0x5d')](_0x5808db,'id');_0x4ab4df(_0x55956a);});})[_0x8557('0x51')](function(_0x287ce3){_0x24b533(_0x287ce3);});});} \ No newline at end of file +var _0x6a84=['Missing\x20\x27recipients\x27\x20parameter','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','whatsappqueue','team','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','SenderId','recipientsId','sortBy','join','sequelize','transaction','UserNotification','create','beep','forEach','recipient','userNotification:send','catch','Template','findOne','html','render','User','union','ids','queue','Queue','push','all','flatten','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./userNotification.socket','register','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','update','destroy','then','error','stack','send','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients'];(function(_0x551bd4,_0xd75ce6){var _0x5152e4=function(_0x5aa3e3){while(--_0x5aa3e3){_0x551bd4['push'](_0x551bd4['shift']());}};_0x5152e4(++_0xd75ce6);}(_0x6a84,0x95));var _0x46a8=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x6a84[_0x422905];return _0x33dc6c;};'use strict';var emlformat=require(_0x46a8('0x0'));var rimraf=require(_0x46a8('0x1'));var zipdir=require(_0x46a8('0x2'));var jsonpatch=require(_0x46a8('0x3'));var rp=require('request-promise');var moment=require(_0x46a8('0x4'));var BPromise=require(_0x46a8('0x5'));var Mustache=require(_0x46a8('0x6'));var util=require(_0x46a8('0x7'));var path=require('path');var sox=require(_0x46a8('0x8'));var csv=require(_0x46a8('0x9'));var ejs=require(_0x46a8('0xa'));var fs=require('fs');var fs_extra=require(_0x46a8('0xb'));var _=require(_0x46a8('0xc'));var squel=require('squel');var crypto=require(_0x46a8('0xd'));var jsforce=require(_0x46a8('0xe'));var deskjs=require(_0x46a8('0xf'));var toCsv=require(_0x46a8('0x9'));var querystring=require('querystring');var Papa=require(_0x46a8('0x10'));var Redis=require('ioredis');var authService=require(_0x46a8('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x46a8('0x12'));var hardwareService=require(_0x46a8('0x13'));var logger=require(_0x46a8('0x14'))(_0x46a8('0x15'));var utils=require(_0x46a8('0x16'));var config=require(_0x46a8('0x17'));var licenseUtil=require(_0x46a8('0x18'));var db=require('../../mysqldb')['db'];config[_0x46a8('0x19')]=_[_0x46a8('0x1a')](config[_0x46a8('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x46a8('0x1b'))(new Redis(config[_0x46a8('0x19')]));require(_0x46a8('0x1c'))[_0x46a8('0x1d')](socket);function respondWithStatusCode(_0x54cc70,_0x1fd681){_0x1fd681=_0x1fd681||0xcc;return function(_0x4239cf){if(_0x4239cf){return _0x54cc70[_0x46a8('0x1e')](_0x1fd681);}return _0x54cc70['status'](_0x1fd681)[_0x46a8('0x1f')]();};}function respondWithResult(_0x27fafe,_0x5bd9c6){_0x5bd9c6=_0x5bd9c6||0xc8;return function(_0xed2b2b){if(_0xed2b2b){return _0x27fafe[_0x46a8('0x20')](_0x5bd9c6)[_0x46a8('0x21')](_0xed2b2b);}};}function respondWithFilteredResult(_0x2acb3c,_0x5ae523){return function(_0x68528f){if(_0x68528f){var _0x5e006f=typeof _0x5ae523[_0x46a8('0x22')]==='undefined'&&typeof _0x5ae523[_0x46a8('0x23')]===_0x46a8('0x24');var _0x360cc5=_0x68528f[_0x46a8('0x25')];var _0x34e519=_0x5e006f?0x0:_0x5ae523[_0x46a8('0x22')];var _0x48fa41=_0x5e006f?_0x68528f[_0x46a8('0x25')]:_0x5ae523[_0x46a8('0x22')]+_0x5ae523['limit'];var _0x5cf8ef;if(_0x48fa41>=_0x360cc5){_0x48fa41=_0x360cc5;_0x5cf8ef=0xc8;}else{_0x5cf8ef=0xce;}_0x2acb3c['status'](_0x5cf8ef);return _0x2acb3c[_0x46a8('0x26')](_0x46a8('0x27'),_0x34e519+'-'+_0x48fa41+'/'+_0x360cc5)[_0x46a8('0x21')](_0x68528f);}return null;};}function patchUpdates(_0x19ed64){return function(_0x4fe8c4){try{jsonpatch[_0x46a8('0x28')](_0x4fe8c4,_0x19ed64,!![]);}catch(_0x5d0491){return BPromise['reject'](_0x5d0491);}return _0x4fe8c4['save']();};}function saveUpdates(_0xdb173a,_0x336e7d){return function(_0x4bd8a4){if(_0x4bd8a4){return _0x4bd8a4[_0x46a8('0x29')](_0xdb173a)['then'](function(_0x49726e){return _0x49726e;});}return null;};}function removeEntity(_0x3e32f2,_0x2e8935){return function(_0x37022e){if(_0x37022e){return _0x37022e[_0x46a8('0x2a')]()[_0x46a8('0x2b')](function(){_0x3e32f2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x596f28,_0x280c44){return function(_0x213f2e){if(!_0x213f2e){_0x596f28['sendStatus'](0x194);}return _0x213f2e;};}function handleError(_0x31f6e7,_0x45c70e){_0x45c70e=_0x45c70e||0x1f4;return function(_0x4b5c99){logger[_0x46a8('0x2c')](_0x4b5c99[_0x46a8('0x2d')]);if(_0x4b5c99['name']){delete _0x4b5c99['name'];}_0x31f6e7[_0x46a8('0x20')](_0x45c70e)[_0x46a8('0x2e')](_0x4b5c99);};}exports['sendUserNotification']=function(_0x400cca,_0x48c7b4,_0x529caf){if(!_0x400cca[_0x46a8('0x2f')][_0x46a8('0x30')](_0x46a8('0x31'))&&!_0x400cca[_0x46a8('0x2f')]['hasOwnProperty'](_0x46a8('0x32'))){throw new db[(_0x46a8('0x33'))][(_0x46a8('0x34'))](_0x46a8('0x35'));}else{if(_0x400cca[_0x46a8('0x2f')]['hasOwnProperty'](_0x46a8('0x32'))&&!_0x400cca[_0x46a8('0x2f')][_0x46a8('0x30')](_0x46a8('0x36'))){throw new db[(_0x46a8('0x33'))][(_0x46a8('0x34'))](_0x46a8('0x37'));}if(!_0x400cca[_0x46a8('0x2f')][_0x46a8('0x30')](_0x46a8('0x38'))){throw new db[(_0x46a8('0x33'))][(_0x46a8('0x34'))](_0x46a8('0x39'));}else{try{var _0x3d1b2c=JSON['parse'](_0x400cca[_0x46a8('0x2f')][_0x46a8('0x38')]);}catch(_0x3481b5){logger['error'](_0x3481b5);throw new db['Sequelize'][(_0x46a8('0x34'))](_0x46a8('0x3a'));}var _0xb5c8c3=[_0x46a8('0x3b'),_0x46a8('0x3c'),_0x46a8('0x3d'),_0x46a8('0x3e'),_0x46a8('0x3f'),'voicequeue',_0x46a8('0x40'),_0x46a8('0x41'),_0x46a8('0x42')];if(_[_0x46a8('0x43')](_0x3d1b2c,function(_0x4a6e95){return!_[_0x46a8('0x44')](_0xb5c8c3,_0x4a6e95[_0x46a8('0x45')][_0x46a8('0x46')]());})){throw new db[(_0x46a8('0x33'))]['ValidationError'](_0x46a8('0x47'));}}}var _0x1b2420={};_0x1b2420['senderName']=_0x400cca[_0x46a8('0x2f')]['hasOwnProperty'](_0x46a8('0x48'))?_0x400cca['body'][_0x46a8('0x48')]:_0x400cca[_0x46a8('0x42')][_0x46a8('0x49')];_0x1b2420[_0x46a8('0x4a')]=_[_0x46a8('0x4b')](_0x400cca[_0x46a8('0x2f')][_0x46a8('0x4a')])?null:_0x400cca[_0x46a8('0x2f')][_0x46a8('0x4a')];_0x1b2420['beep']=_0x400cca[_0x46a8('0x2f')]['beep']||![];_0x1b2420[_0x46a8('0x4c')]=_0x400cca[_0x46a8('0x42')]['id'];return getContent(_0x400cca[_0x46a8('0x2f')])[_0x46a8('0x2b')](function(_0x1ce57e){_0x1b2420[_0x46a8('0x2f')]=_0x1ce57e;return getRecipients(_0x3d1b2c);})[_0x46a8('0x2b')](function(_0x1dff44){_0x1b2420[_0x46a8('0x4d')]=_[_0x46a8('0x4e')](_0x1dff44)[_0x46a8('0x4f')](',');return db[_0x46a8('0x50')][_0x46a8('0x51')](function(_0xef196c){return db[_0x46a8('0x52')][_0x46a8('0x53')](_0x1b2420,{'raw':!![],'transaction':_0xef196c})[_0x46a8('0x2b')](function(_0x152c59){var _0x5afd6a={'sender':_0x1b2420[_0x46a8('0x48')],'description':_0x1b2420[_0x46a8('0x4a')],'content':_0x1b2420[_0x46a8('0x2f')],'beep':_0x1b2420[_0x46a8('0x54')]};_0x1dff44[_0x46a8('0x55')](function(_0x4d5f1e){_0x5afd6a[_0x46a8('0x56')]=_0x4d5f1e;socket['emit'](_0x46a8('0x57'),_0x5afd6a);});return _0x152c59;});});})[_0x46a8('0x2b')](respondWithResult(_0x48c7b4,0xc9))[_0x46a8('0x58')](handleError(_0x48c7b4,null));};function getContent(_0x8ca5c1){return new BPromise(function(_0x4de9d9,_0xf3b16f){if(_0x8ca5c1[_0x46a8('0x31')]){_0x4de9d9(_0x8ca5c1['text']);return;}return db[_0x46a8('0x59')][_0x46a8('0x5a')]({'attributes':[_0x46a8('0x5b')],'where':{'id':_0x8ca5c1[_0x46a8('0x32')]},'raw':!![]})[_0x46a8('0x2b')](function(_0x3af8ce){if(!_0x3af8ce)throw new db[(_0x46a8('0x33'))][(_0x46a8('0x34'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x155d6a=Mustache[_0x46a8('0x5c')](_0x3af8ce[_0x46a8('0x5b')],_0x8ca5c1[_0x46a8('0x36')]);_0x4de9d9(_0x155d6a);})[_0x46a8('0x58')](function(_0x4dd4a9){_0xf3b16f(_0x4dd4a9);});});}function getRecipients(_0x1d9ef9){return new BPromise(function(_0x388212,_0x32b5ab){var _0x3f46a9=[];var _0x111571=[];_0x1d9ef9[_0x46a8('0x55')](function(_0x1280af){var _0x45937f=_['startCase'](_0x1280af[_0x46a8('0x45')][_0x46a8('0x46')]());if(_0x45937f===_0x46a8('0x5d')){_0x3f46a9=_[_0x46a8('0x5e')](_0x3f46a9,_0x1280af[_0x46a8('0x5f')]);}else{if(_['includes'](_0x45937f,_0x46a8('0x60')))_0x45937f=_0x45937f['replace'](_0x46a8('0x60'),_0x46a8('0x61'));_0x1280af[_0x46a8('0x5f')][_0x46a8('0x55')](function(_0x1bd384){_0x111571[_0x46a8('0x62')](getAgents(_0x45937f,_0x1bd384));});}});return BPromise[_0x46a8('0x63')](_0x111571)[_0x46a8('0x2b')](function(_0x233d6d){_0x3f46a9=_[_0x46a8('0x5e')](_0x3f46a9,_[_0x46a8('0x64')](_0x233d6d));_0x388212(_0x3f46a9);})[_0x46a8('0x58')](function(_0x233e7c){_0x32b5ab(_0x233e7c);});});}function getAgents(_0x5606e4,_0x5de08b){return new BPromise(function(_0x5834dc,_0xca22d6){return db[_0x5606e4][_0x46a8('0x5a')]({'where':{'id':_0x5de08b}})['then'](function(_0x576897){return _0x576897[_0x46a8('0x65')]({'attributes':['id'],'raw':!![]})['then'](function(_0x59b7d1){var _0x4654a9=_[_0x46a8('0x66')](_0x59b7d1,'id');_0x5834dc(_0x4654a9);});})[_0x46a8('0x58')](function(_0x3af8f8){_0xca22d6(_0x3af8f8);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 6f11109..56e8e28 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 _0x875a=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','UserNotification','save'];(function(_0x4f3a8d,_0x39e6a6){var _0x34eb9e=function(_0x4c976f){while(--_0x4c976f){_0x4f3a8d['push'](_0x4f3a8d['shift']());}};_0x34eb9e(++_0x39e6a6);}(_0x875a,0x11c));var _0xa875=function(_0x49d778,_0x2755b0){_0x49d778=_0x49d778-0x0;var _0x240b15=_0x875a[_0x49d778];return _0x240b15;};'use strict';var EventEmitter=require(_0xa875('0x0'));var UserNotification=require(_0xa875('0x1'))['db'][_0xa875('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa875('0x3'),'afterUpdate':_0xa875('0x4'),'afterDestroy':_0xa875('0x5')};function emitEvent(_0x42bc07){return function(_0x3c437b,_0x3038b1,_0x3280c6){UserNotificationEvents[_0xa875('0x6')](_0x42bc07+':'+_0x3c437b['id'],_0x3c437b);UserNotificationEvents[_0xa875('0x6')](_0x42bc07,_0x3c437b);_0x3280c6(null);};}for(var e in events){if(events[_0xa875('0x7')](e)){var event=events[e];UserNotification[_0xa875('0x8')](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file +var _0x4a8c=['../../mysqldb','UserNotification','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0xb09c2,_0x2a04d1){var _0x5ecc6b=function(_0x51e5f2){while(--_0x51e5f2){_0xb09c2['push'](_0xb09c2['shift']());}};_0x5ecc6b(++_0x2a04d1);}(_0x4a8c,0xe9));var _0xc4a8=function(_0xa47944,_0xa6ebe4){_0xa47944=_0xa47944-0x0;var _0x5c84ea=_0x4a8c[_0xa47944];return _0x5c84ea;};'use strict';var EventEmitter=require(_0xc4a8('0x0'));var UserNotification=require(_0xc4a8('0x1'))['db'][_0xc4a8('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc4a8('0x3'),'afterUpdate':'update','afterDestroy':_0xc4a8('0x4')};function emitEvent(_0x4a5b04){return function(_0x4ef338,_0x4d0460,_0xd0b5be){UserNotificationEvents[_0xc4a8('0x5')](_0x4a5b04+':'+_0x4ef338['id'],_0x4ef338);UserNotificationEvents['emit'](_0x4a5b04,_0x4ef338);_0xd0b5be(null);};}for(var e in events){if(events[_0xc4a8('0x6')](e)){var event=events[e];UserNotification[_0xc4a8('0x7')](e,emitEvent(event));}}module[_0xc4a8('0x8')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 863ef50..a526b2f 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 _0x628a=['request-promise','path','rimraf','./userNotification.attributes','exports','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird'];(function(_0x1e8ad7,_0x1e4171){var _0x157ebb=function(_0x206975){while(--_0x206975){_0x1e8ad7['push'](_0x1e8ad7['shift']());}};_0x157ebb(++_0x1e4171);}(_0x628a,0x1bb));var _0xa628=function(_0x2ade8f,_0x4b65f1){_0x2ade8f=_0x2ade8f-0x0;var _0x153c70=_0x628a[_0x2ade8f];return _0x153c70;};'use strict';var _=require(_0xa628('0x0'));var util=require(_0xa628('0x1'));var logger=require('../../config/logger')(_0xa628('0x2'));var moment=require(_0xa628('0x3'));var BPromise=require(_0xa628('0x4'));var rp=require(_0xa628('0x5'));var fs=require('fs');var path=require(_0xa628('0x6'));var rimraf=require(_0xa628('0x7'));var config=require('../../config/environment');var attributes=require(_0xa628('0x8'));module[_0xa628('0x9')]=function(_0x1ce648,_0x4afbae){return _0x1ce648['define'](_0xa628('0xa'),attributes,{'tableName':_0xa628('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa628('0xc'),'collate':_0xa628('0xd')});}; \ No newline at end of file +var _0x2080=['rimraf','./userNotification.attributes','exports','define','userNotifications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','path'];(function(_0x4f972a,_0x3681f2){var _0x4dddc3=function(_0x4cd917){while(--_0x4cd917){_0x4f972a['push'](_0x4f972a['shift']());}};_0x4dddc3(++_0x3681f2);}(_0x2080,0x19f));var _0x0208=function(_0x1b0d9c,_0x2b9780){_0x1b0d9c=_0x1b0d9c-0x0;var _0x4dd704=_0x2080[_0x1b0d9c];return _0x4dd704;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0208('0x0'))(_0x0208('0x1'));var moment=require(_0x0208('0x2'));var BPromise=require(_0x0208('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0208('0x4'));var rimraf=require(_0x0208('0x5'));var config=require('../../config/environment');var attributes=require(_0x0208('0x6'));module[_0x0208('0x7')]=function(_0x2f21c1,_0x115952){return _0x2f21c1[_0x0208('0x8')]('UserNotification',attributes,{'tableName':_0x0208('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0208('0xa'),'collate':_0x0208('0xb')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 26224d5..e19d55a 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 _0x4e37=['./userNotification.socket','register','request','then','info','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','error','code','UserNotification,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x254e24,_0x46311e){var _0x46f1ad=function(_0x308948){while(--_0x308948){_0x254e24['push'](_0x254e24['shift']());}};_0x46f1ad(++_0x46311e);}(_0x4e37,0x109));var _0x74e3=function(_0x4f0837,_0x2ef53b){_0x4f0837=_0x4f0837-0x0;var _0x30abc4=_0x4e37[_0x4f0837];return _0x30abc4;};'use strict';var _=require(_0x74e3('0x0'));var util=require(_0x74e3('0x1'));var moment=require(_0x74e3('0x2'));var BPromise=require(_0x74e3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x74e3('0x4'));var db=require(_0x74e3('0x5'))['db'];var utils=require(_0x74e3('0x6'));var logger=require(_0x74e3('0x7'))('rpc');var config=require(_0x74e3('0x8'));var jayson=require(_0x74e3('0x9'));var client=jayson[_0x74e3('0xa')][_0x74e3('0xb')]({'port':0x232a});config[_0x74e3('0xc')]=_[_0x74e3('0xd')](config[_0x74e3('0xc')],{'host':_0x74e3('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x74e3('0xc')]));require(_0x74e3('0xf'))[_0x74e3('0x10')](socket);function respondWithRpcPromise(_0x46bf46,_0x56ff65,_0x1d9bfc){return new BPromise(function(_0x2f507a,_0x284b55){return client[_0x74e3('0x11')](_0x46bf46,_0x1d9bfc)[_0x74e3('0x12')](function(_0x31570d){logger[_0x74e3('0x13')]('UserNotification,\x20%s,\x20%s',_0x56ff65,_0x74e3('0x14'));logger[_0x74e3('0x15')](_0x74e3('0x16'),_0x56ff65,_0x74e3('0x14'),JSON['stringify'](_0x31570d));if(_0x31570d[_0x74e3('0x17')]){if(_0x31570d[_0x74e3('0x17')][_0x74e3('0x18')]===0x1f4){logger[_0x74e3('0x17')](_0x74e3('0x19'),_0x56ff65,_0x31570d[_0x74e3('0x17')][_0x74e3('0x1a')]);return _0x284b55(_0x31570d[_0x74e3('0x17')][_0x74e3('0x1a')]);}logger[_0x74e3('0x17')](_0x74e3('0x19'),_0x56ff65,_0x31570d['error'][_0x74e3('0x1a')]);return _0x2f507a(_0x31570d[_0x74e3('0x17')]['message']);}else{logger[_0x74e3('0x13')](_0x74e3('0x19'),_0x56ff65,_0x74e3('0x14'));_0x2f507a(_0x31570d[_0x74e3('0x1b')][_0x74e3('0x1a')]);}})['catch'](function(_0x27c08e){logger[_0x74e3('0x17')](_0x74e3('0x19'),_0x56ff65,_0x27c08e);_0x284b55(_0x27c08e);});});} \ No newline at end of file +var _0xe93c=['register','request','then','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','UserNotification,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./userNotification.socket'];(function(_0x330281,_0x8c753){var _0x6218c1=function(_0x30464a){while(--_0x30464a){_0x330281['push'](_0x330281['shift']());}};_0x6218c1(++_0x8c753);}(_0xe93c,0x158));var _0xce93=function(_0x5e1218,_0x429162){_0x5e1218=_0x5e1218-0x0;var _0xff4d9a=_0xe93c[_0x5e1218];return _0xff4d9a;};'use strict';var _=require(_0xce93('0x0'));var util=require(_0xce93('0x1'));var moment=require(_0xce93('0x2'));var BPromise=require(_0xce93('0x3'));var rs=require(_0xce93('0x4'));var fs=require('fs');var Redis=require(_0xce93('0x5'));var db=require(_0xce93('0x6'))['db'];var utils=require(_0xce93('0x7'));var logger=require(_0xce93('0x8'))(_0xce93('0x9'));var config=require(_0xce93('0xa'));var jayson=require(_0xce93('0xb'));var client=jayson[_0xce93('0xc')][_0xce93('0xd')]({'port':0x232a});config['redis']=_[_0xce93('0xe')](config[_0xce93('0xf')],{'host':_0xce93('0x10'),'port':0x18eb});var socket=require(_0xce93('0x11'))(new Redis(config['redis']));require(_0xce93('0x12'))[_0xce93('0x13')](socket);function respondWithRpcPromise(_0x5bf126,_0x3eeb7d,_0x132e4b){return new BPromise(function(_0x186453,_0x50ec2d){return client[_0xce93('0x14')](_0x5bf126,_0x132e4b)[_0xce93('0x15')](function(_0x16aecf){logger['info']('UserNotification,\x20%s,\x20%s',_0x3eeb7d,_0xce93('0x16'));logger[_0xce93('0x17')](_0xce93('0x18'),_0x3eeb7d,_0xce93('0x16'),JSON[_0xce93('0x19')](_0x16aecf));if(_0x16aecf[_0xce93('0x1a')]){if(_0x16aecf[_0xce93('0x1a')][_0xce93('0x1b')]===0x1f4){logger[_0xce93('0x1a')](_0xce93('0x1c'),_0x3eeb7d,_0x16aecf[_0xce93('0x1a')][_0xce93('0x1d')]);return _0x50ec2d(_0x16aecf[_0xce93('0x1a')][_0xce93('0x1d')]);}logger[_0xce93('0x1a')]('UserNotification,\x20%s,\x20%s',_0x3eeb7d,_0x16aecf[_0xce93('0x1a')][_0xce93('0x1d')]);return _0x186453(_0x16aecf['error'][_0xce93('0x1d')]);}else{logger[_0xce93('0x1e')](_0xce93('0x1c'),_0x3eeb7d,_0xce93('0x16'));_0x186453(_0x16aecf[_0xce93('0x1f')][_0xce93('0x1d')]);}})[_0xce93('0x20')](function(_0x55c432){logger[_0xce93('0x1a')](_0xce93('0x1c'),_0x3eeb7d,_0x55c432);_0x50ec2d(_0x55c432);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 36db408..ad6ae49 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 _0x8448=['userNotification:','./userNotification.events','remove','update','emit','removeListener','register','length'];(function(_0x2e58c7,_0x23d092){var _0x26eb00=function(_0x343124){while(--_0x343124){_0x2e58c7['push'](_0x2e58c7['shift']());}};_0x26eb00(++_0x23d092);}(_0x8448,0x159));var _0x8844=function(_0x5c2c7c,_0xa7d3b1){_0x5c2c7c=_0x5c2c7c-0x0;var _0xea7ffe=_0x8448[_0x5c2c7c];return _0xea7ffe;};'use strict';var UserNotificationEvents=require(_0x8844('0x0'));var events=['save',_0x8844('0x1'),_0x8844('0x2')];function createListener(_0x4464fe,_0x30afb5){return function(_0x527a7e){_0x30afb5[_0x8844('0x3')](_0x4464fe,_0x527a7e);};}function removeListener(_0xdb8bfc,_0x598b53){return function(){UserNotificationEvents[_0x8844('0x4')](_0xdb8bfc,_0x598b53);};}exports[_0x8844('0x5')]=function(_0x3eac06){for(var _0x48b1b1=0x0,_0x3cea07=events[_0x8844('0x6')];_0x48b1b1<_0x3cea07;_0x48b1b1++){var _0x32e3e7=events[_0x48b1b1];var _0x513e1d=createListener(_0x8844('0x7')+_0x32e3e7,_0x3eac06);UserNotificationEvents['on'](_0x32e3e7,_0x513e1d);}}; \ No newline at end of file +var _0xa29f=['userNotification:','./userNotification.events','save','remove','removeListener'];(function(_0x2a7d36,_0x1f3211){var _0x11e907=function(_0x1742ad){while(--_0x1742ad){_0x2a7d36['push'](_0x2a7d36['shift']());}};_0x11e907(++_0x1f3211);}(_0xa29f,0xd3));var _0xfa29=function(_0x4a0f16,_0x21ba18){_0x4a0f16=_0x4a0f16-0x0;var _0x45d653=_0xa29f[_0x4a0f16];return _0x45d653;};'use strict';var UserNotificationEvents=require(_0xfa29('0x0'));var events=[_0xfa29('0x1'),_0xfa29('0x2'),'update'];function createListener(_0x5dbce5,_0x2c6f10){return function(_0x3c4211){_0x2c6f10['emit'](_0x5dbce5,_0x3c4211);};}function removeListener(_0x599e00,_0x16a014){return function(){UserNotificationEvents[_0xfa29('0x3')](_0x599e00,_0x16a014);};}exports['register']=function(_0x39bc1f){for(var _0x7fc0f4=0x0,_0x2687ea=events['length'];_0x7fc0f4<_0x2687ea;_0x7fc0f4++){var _0x5e8ab9=events[_0x7fc0f4];var _0x2b1fd4=createListener(_0xfa29('0x4')+_0x5e8ab9,_0x39bc1f);UserNotificationEvents['on'](_0x5e8ab9,_0x2b1fd4);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 0e7de42..cc564fb 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x21327b,_0x164854){var _0x1d3085=function(_0xabea7b){while(--_0xabea7b){_0x21327b['push'](_0x21327b['shift']());}};_0x1d3085(++_0x164854);}(_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(_0x8110d8,_0x4e96a9){var _0x1ddf27=function(_0x5e4482){while(--_0x5e4482){_0x8110d8['push'](_0x8110d8['shift']());}};_0x1ddf27(++_0x4e96a9);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1abeb2,_0x79f462){_0x1abeb2=_0x1abeb2-0x0;var _0x48da20=_0xcb91[_0x1abeb2];return _0x48da20;};'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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index aa64920..13f144c 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 _0xed87=['INTEGER','sequelize','exports'];(function(_0x34394b,_0x5daa30){var _0x2a72e5=function(_0x17f74a){while(--_0x17f74a){_0x34394b['push'](_0x34394b['shift']());}};_0x2a72e5(++_0x5daa30);}(_0xed87,0xfa));var _0x7ed8=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xed87[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x7ed8('0x0'));module[_0x7ed8('0x1')]={'penalty':{'type':Sequelize[_0x7ed8('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3e0f=['INTEGER'];(function(_0x3d27a,_0x31311d){var _0x314fd7=function(_0x20ac55){while(--_0x20ac55){_0x3d27a['push'](_0x3d27a['shift']());}};_0x314fd7(++_0x31311d);}(_0x3e0f,0x17c));var _0xf3e0=function(_0x2605dc,_0x50cf7e){_0x2605dc=_0x2605dc-0x0;var _0x4568c9=_0x3e0f[_0x2605dc];return _0x4568c9;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xf3e0('0x0')],'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 ea4c226..947b8e8 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 _0x7882=['../../config/environment','./userOpenchannelQueue.attributes','exports','user_has_openchannel_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x2e04ef,_0x31a596){var _0x5722b0=function(_0x386fbd){while(--_0x386fbd){_0x2e04ef['push'](_0x2e04ef['shift']());}};_0x5722b0(++_0x31a596);}(_0x7882,0x130));var _0x2788=function(_0x5c59e9,_0x253541){_0x5c59e9=_0x5c59e9-0x0;var _0x56b0b3=_0x7882[_0x5c59e9];return _0x56b0b3;};'use strict';var _=require(_0x2788('0x0'));var util=require(_0x2788('0x1'));var logger=require(_0x2788('0x2'))(_0x2788('0x3'));var moment=require('moment');var BPromise=require(_0x2788('0x4'));var rp=require(_0x2788('0x5'));var fs=require('fs');var path=require(_0x2788('0x6'));var rimraf=require(_0x2788('0x7'));var config=require(_0x2788('0x8'));var attributes=require(_0x2788('0x9'));module[_0x2788('0xa')]=function(_0x3096b7,_0x57a5a0){return _0x3096b7['define']('UserOpenchannelQueue',attributes,{'tableName':_0x2788('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe703=['../../config/environment','./userOpenchannelQueue.attributes','exports','define','util','../../config/logger','api','bluebird','request-promise'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0xe703,0x190));var _0x3e70=function(_0x352de7,_0x42d665){_0x352de7=_0x352de7-0x0;var _0x76cff2=_0xe703[_0x352de7];return _0x76cff2;};'use strict';var _=require('lodash');var util=require(_0x3e70('0x0'));var logger=require(_0x3e70('0x1'))(_0x3e70('0x2'));var moment=require('moment');var BPromise=require(_0x3e70('0x3'));var rp=require(_0x3e70('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3e70('0x5'));var attributes=require(_0x3e70('0x6'));module[_0x3e70('0x7')]=function(_0x547677,_0x861bc8){return _0x547677[_0x3e70('0x8')]('UserOpenchannelQueue',attributes,{'tableName':'user_has_openchannel_queues','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 92ff4a5..3713d13 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 _0x2a76=['stringify','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x58384b,_0xc9dc35){var _0x4f039f=function(_0x413651){while(--_0x413651){_0x58384b['push'](_0x58384b['shift']());}};_0x4f039f(++_0xc9dc35);}(_0x2a76,0xe9));var _0x62a7=function(_0x1acb72,_0x1585f9){_0x1acb72=_0x1acb72-0x0;var _0x757b5f=_0x2a76[_0x1acb72];return _0x757b5f;};'use strict';var _=require(_0x62a7('0x0'));var util=require(_0x62a7('0x1'));var moment=require(_0x62a7('0x2'));var BPromise=require(_0x62a7('0x3'));var rs=require(_0x62a7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x62a7('0x5'))['db'];var utils=require(_0x62a7('0x6'));var logger=require(_0x62a7('0x7'))(_0x62a7('0x8'));var config=require(_0x62a7('0x9'));var jayson=require(_0x62a7('0xa'));var client=jayson[_0x62a7('0xb')][_0x62a7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5b6b39,_0x1ef3d4,_0x2095e8){return new BPromise(function(_0x1368f3,_0x57921f){return client[_0x62a7('0xd')](_0x5b6b39,_0x2095e8)['then'](function(_0x18dc9b){logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x1ef3d4,'request\x20sent');logger[_0x62a7('0xe')](_0x62a7('0xf'),_0x1ef3d4,_0x62a7('0x10'),JSON[_0x62a7('0x11')](_0x18dc9b));if(_0x18dc9b[_0x62a7('0x12')]){if(_0x18dc9b[_0x62a7('0x12')][_0x62a7('0x13')]===0x1f4){logger['error'](_0x62a7('0x14'),_0x1ef3d4,_0x18dc9b[_0x62a7('0x12')]['message']);return _0x57921f(_0x18dc9b[_0x62a7('0x12')][_0x62a7('0x15')]);}logger['error'](_0x62a7('0x14'),_0x1ef3d4,_0x18dc9b['error'][_0x62a7('0x15')]);return _0x1368f3(_0x18dc9b[_0x62a7('0x12')]['message']);}else{logger[_0x62a7('0x16')](_0x62a7('0x14'),_0x1ef3d4,_0x62a7('0x10'));_0x1368f3(_0x18dc9b[_0x62a7('0x17')]['message']);}})[_0x62a7('0x18')](function(_0x1b8f7e){logger[_0x62a7('0x12')](_0x62a7('0x14'),_0x1ef3d4,_0x1b8f7e);_0x57921f(_0x1b8f7e);});});} \ No newline at end of file +var _0xd2e2=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result'];(function(_0x9d078f,_0xd006b){var _0x540022=function(_0x10b491){while(--_0x10b491){_0x9d078f['push'](_0x9d078f['shift']());}};_0x540022(++_0xd006b);}(_0xd2e2,0xd0));var _0x2d2e=function(_0x1c9404,_0x10c59a){_0x1c9404=_0x1c9404-0x0;var _0x298b53=_0xd2e2[_0x1c9404];return _0x298b53;};'use strict';var _=require(_0x2d2e('0x0'));var util=require(_0x2d2e('0x1'));var moment=require(_0x2d2e('0x2'));var BPromise=require(_0x2d2e('0x3'));var rs=require(_0x2d2e('0x4'));var fs=require('fs');var Redis=require(_0x2d2e('0x5'));var db=require(_0x2d2e('0x6'))['db'];var utils=require(_0x2d2e('0x7'));var logger=require('../../config/logger')(_0x2d2e('0x8'));var config=require('../../config/environment');var jayson=require(_0x2d2e('0x9'));var client=jayson['client'][_0x2d2e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1bb420,_0x51f1fa,_0x1b9ff5){return new BPromise(function(_0x6377e0,_0xa74d86){return client[_0x2d2e('0xb')](_0x1bb420,_0x1b9ff5)[_0x2d2e('0xc')](function(_0x55d4d6){logger[_0x2d2e('0xd')](_0x2d2e('0xe'),_0x51f1fa,'request\x20sent');logger[_0x2d2e('0xf')](_0x2d2e('0x10'),_0x51f1fa,_0x2d2e('0x11'),JSON[_0x2d2e('0x12')](_0x55d4d6));if(_0x55d4d6['error']){if(_0x55d4d6[_0x2d2e('0x13')]['code']===0x1f4){logger[_0x2d2e('0x13')](_0x2d2e('0xe'),_0x51f1fa,_0x55d4d6[_0x2d2e('0x13')][_0x2d2e('0x14')]);return _0xa74d86(_0x55d4d6[_0x2d2e('0x13')][_0x2d2e('0x14')]);}logger[_0x2d2e('0x13')](_0x2d2e('0xe'),_0x51f1fa,_0x55d4d6[_0x2d2e('0x13')]['message']);return _0x6377e0(_0x55d4d6[_0x2d2e('0x13')][_0x2d2e('0x14')]);}else{logger[_0x2d2e('0xd')](_0x2d2e('0xe'),_0x51f1fa,_0x2d2e('0x11'));_0x6377e0(_0x55d4d6[_0x2d2e('0x15')][_0x2d2e('0x14')]);}})[_0x2d2e('0x16')](function(_0x58128f){logger[_0x2d2e('0x13')](_0x2d2e('0xe'),_0x51f1fa,_0x58128f);_0xa74d86(_0x58128f);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 4d94e0a..4fcbfc2 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 _0xb665=['exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./userProfile.controller','isAuthenticated','index','get','show','getSections','post','create','clone','/:id/sections','addSections','/:id/resources','addResources','/:id','update','delete','destroy'];(function(_0x962912,_0x182289){var _0x5c1028=function(_0x242261){while(--_0x242261){_0x962912['push'](_0x962912['shift']());}};_0x5c1028(++_0x182289);}(_0xb665,0x151));var _0x5b66=function(_0x1c852c,_0x113e2d){_0x1c852c=_0x1c852c-0x0;var _0x5037f4=_0xb665[_0x1c852c];return _0x5037f4;};'use strict';var multer=require(_0x5b66('0x0'));var util=require('util');var path=require(_0x5b66('0x1'));var timeout=require(_0x5b66('0x2'));var express=require('express');var router=express[_0x5b66('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5b66('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5b66('0x5'));var controller=require(_0x5b66('0x6'));router['get']('/',auth[_0x5b66('0x7')](),controller[_0x5b66('0x8')]);router[_0x5b66('0x9')]('/describe',auth[_0x5b66('0x7')](),controller['describe']);router[_0x5b66('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x5b66('0xa')]);router[_0x5b66('0x9')]('/:id/sections',auth[_0x5b66('0x7')](),controller[_0x5b66('0xb')]);router[_0x5b66('0x9')]('/:id/resources',auth[_0x5b66('0x7')](),controller['getResources']);router[_0x5b66('0xc')]('/',auth['isAuthenticated'](),controller[_0x5b66('0xd')]);router['post']('/:id/clone',auth[_0x5b66('0x7')](),controller[_0x5b66('0xe')]);router[_0x5b66('0xc')](_0x5b66('0xf'),auth['isAuthenticated'](),controller[_0x5b66('0x10')]);router[_0x5b66('0xc')](_0x5b66('0x11'),auth[_0x5b66('0x7')](),controller[_0x5b66('0x12')]);router['put'](_0x5b66('0x13'),auth[_0x5b66('0x7')](),controller[_0x5b66('0x14')]);router[_0x5b66('0x15')](_0x5b66('0x13'),auth[_0x5b66('0x7')](),controller[_0x5b66('0x16')]);router[_0x5b66('0x15')](_0x5b66('0xf'),auth['isAuthenticated'](),controller['removeSections']);router[_0x5b66('0x15')](_0x5b66('0x11'),auth['isAuthenticated'](),controller['removeResources']);module[_0x5b66('0x17')]=router; \ No newline at end of file +var _0xea63=['show','/:id/sections','getResources','post','create','/:id/clone','clone','addSections','/:id/resources','addResources','put','update','destroy','delete','removeSections','removeResources','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0xfe484e,_0x58f7bd){var _0x513c5b=function(_0x4702fa){while(--_0x4702fa){_0xfe484e['push'](_0xfe484e['shift']());}};_0x513c5b(++_0x58f7bd);}(_0xea63,0xca));var _0x3ea6=function(_0x3a48ea,_0x2ea000){_0x3a48ea=_0x3a48ea-0x0;var _0x27d902=_0xea63[_0x3a48ea];return _0x27d902;};'use strict';var multer=require(_0x3ea6('0x0'));var util=require(_0x3ea6('0x1'));var path=require(_0x3ea6('0x2'));var timeout=require(_0x3ea6('0x3'));var express=require(_0x3ea6('0x4'));var router=express[_0x3ea6('0x5')]();var fs_extra=require(_0x3ea6('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3ea6('0x7'));var controller=require(_0x3ea6('0x8'));router[_0x3ea6('0x9')]('/',auth[_0x3ea6('0xa')](),controller[_0x3ea6('0xb')]);router[_0x3ea6('0x9')](_0x3ea6('0xc'),auth['isAuthenticated'](),controller[_0x3ea6('0xd')]);router['get'](_0x3ea6('0xe'),auth[_0x3ea6('0xa')](),controller[_0x3ea6('0xf')]);router[_0x3ea6('0x9')](_0x3ea6('0x10'),auth[_0x3ea6('0xa')](),controller['getSections']);router[_0x3ea6('0x9')]('/:id/resources',auth[_0x3ea6('0xa')](),controller[_0x3ea6('0x11')]);router[_0x3ea6('0x12')]('/',auth[_0x3ea6('0xa')](),controller[_0x3ea6('0x13')]);router['post'](_0x3ea6('0x14'),auth[_0x3ea6('0xa')](),controller[_0x3ea6('0x15')]);router[_0x3ea6('0x12')](_0x3ea6('0x10'),auth['isAuthenticated'](),controller[_0x3ea6('0x16')]);router[_0x3ea6('0x12')](_0x3ea6('0x17'),auth['isAuthenticated'](),controller[_0x3ea6('0x18')]);router[_0x3ea6('0x19')]('/:id',auth[_0x3ea6('0xa')](),controller[_0x3ea6('0x1a')]);router['delete'](_0x3ea6('0xe'),auth[_0x3ea6('0xa')](),controller[_0x3ea6('0x1b')]);router[_0x3ea6('0x1c')](_0x3ea6('0x10'),auth[_0x3ea6('0xa')](),controller[_0x3ea6('0x1d')]);router[_0x3ea6('0x1c')](_0x3ea6('0x17'),auth['isAuthenticated'](),controller[_0x3ea6('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 9768033..ac5bf1c 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 _0xe08e=['crudPermissions','join','split','BOOLEAN','sequelize','exports','STRING','setDataValue'];(function(_0xb67251,_0x1f6208){var _0x979d96=function(_0x41d0d0){while(--_0x41d0d0){_0xb67251['push'](_0xb67251['shift']());}};_0x979d96(++_0x1f6208);}(_0xe08e,0x94));var _0xee08=function(_0x175e8e,_0x1aafdf){_0x175e8e=_0x175e8e-0x0;var _0x3b06cd=_0xe08e[_0x175e8e];return _0x3b06cd;};'use strict';var Sequelize=require(_0xee08('0x0'));module[_0xee08('0x1')]={'name':{'type':Sequelize[_0xee08('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0xee08('0x2')],'set':function(_0x50aba5){this[_0xee08('0x3')](_0xee08('0x4'),_0x50aba5?_0x50aba5[_0xee08('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0xee08('0x4'))?this['getDataValue'](_0xee08('0x4'))[_0xee08('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xee08('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xee08('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xee08('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xee08('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xee08('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xee08('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xee08('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xee08('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xee08('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0x1b04=['split','BOOLEAN','sequelize','name','STRING','setDataValue','crudPermissions','join','getDataValue'];(function(_0x1977cf,_0x4f863a){var _0x23c6fa=function(_0x5aef0d){while(--_0x5aef0d){_0x1977cf['push'](_0x1977cf['shift']());}};_0x23c6fa(++_0x4f863a);}(_0x1b04,0x6e));var _0x41b0=function(_0x7f37da,_0x30a906){_0x7f37da=_0x7f37da-0x0;var _0x474378=_0x1b04[_0x7f37da];return _0x474378;};'use strict';var Sequelize=require(_0x41b0('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x41b0('0x1')},'crudPermissions':{'type':Sequelize[_0x41b0('0x2')],'set':function(_0x1e808e){this[_0x41b0('0x3')](_0x41b0('0x4'),_0x1e808e?_0x1e808e[_0x41b0('0x5')](''):[]);},'get':function(){return this[_0x41b0('0x6')](_0x41b0('0x4'))?this[_0x41b0('0x6')](_0x41b0('0x4'))[_0x41b0('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x41b0('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x41b0('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x41b0('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x41b0('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x41b0('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x41b0('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 11cb30a..b4bafd8 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 _0x49db=['json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','UserProfile','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','nolimit','order','filter','where','VIRTUAL','merge','options','includeAll','rows','show','params','fields','find','create','catch','clone','include','get','omit','createdAt','updatedAt','crudPermissions','body','sequelize','transaction','UserProfileSection','findAll','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','describe','push','ids','includes','isEmpty','subsections','enabled','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','hasOwnProperty','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end'];(function(_0x2975c7,_0x5dcc22){var _0x26a179=function(_0x150969){while(--_0x150969){_0x2975c7['push'](_0x2975c7['shift']());}};_0x26a179(++_0x5dcc22);}(_0x49db,0xc5));var _0xb49d=function(_0xed09c3,_0x2171f2){_0xed09c3=_0xed09c3-0x0;var _0x5f1794=_0x49db[_0xed09c3];return _0x5f1794;};'use strict';var emlformat=require(_0xb49d('0x0'));var rimraf=require(_0xb49d('0x1'));var zipdir=require(_0xb49d('0x2'));var jsonpatch=require(_0xb49d('0x3'));var rp=require(_0xb49d('0x4'));var moment=require('moment');var BPromise=require(_0xb49d('0x5'));var Mustache=require(_0xb49d('0x6'));var util=require(_0xb49d('0x7'));var path=require('path');var sox=require(_0xb49d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb49d('0x9'));var _=require(_0xb49d('0xa'));var squel=require(_0xb49d('0xb'));var crypto=require('crypto');var jsforce=require(_0xb49d('0xc'));var deskjs=require(_0xb49d('0xd'));var toCsv=require(_0xb49d('0xe'));var querystring=require(_0xb49d('0xf'));var Papa=require(_0xb49d('0x10'));var Redis=require(_0xb49d('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb49d('0x12'));var hardwareService=require(_0xb49d('0x13'));var logger=require(_0xb49d('0x14'))(_0xb49d('0x15'));var utils=require(_0xb49d('0x16'));var config=require(_0xb49d('0x17'));var licenseUtil=require(_0xb49d('0x18'));var db=require(_0xb49d('0x19'))['db'];config[_0xb49d('0x1a')]=_['defaults'](config[_0xb49d('0x1a')],{'host':_0xb49d('0x1b'),'port':0x18eb});var socket=require(_0xb49d('0x1c'))(new Redis(config[_0xb49d('0x1a')]));require('./userProfile.socket')[_0xb49d('0x1d')](socket);function respondWithStatusCode(_0x2c0b41,_0x4ddeb5){_0x4ddeb5=_0x4ddeb5||0xcc;return function(_0xba2804){if(_0xba2804){return _0x2c0b41[_0xb49d('0x1e')](_0x4ddeb5);}return _0x2c0b41[_0xb49d('0x1f')](_0x4ddeb5)[_0xb49d('0x20')]();};}function respondWithResult(_0x1491fb,_0x270298){_0x270298=_0x270298||0xc8;return function(_0x1dba19){if(_0x1dba19){return _0x1491fb['status'](_0x270298)[_0xb49d('0x21')](_0x1dba19);}};}function respondWithFilteredResult(_0x38675e,_0x3781f1){return function(_0xf0bdff){if(_0xf0bdff){var _0x4abce4=typeof _0x3781f1['offset']===_0xb49d('0x22')&&typeof _0x3781f1[_0xb49d('0x23')]===_0xb49d('0x22');var _0x2a87f5=_0xf0bdff[_0xb49d('0x24')];var _0x510f22=_0x4abce4?0x0:_0x3781f1[_0xb49d('0x25')];var _0x47626f=_0x4abce4?_0xf0bdff[_0xb49d('0x24')]:_0x3781f1[_0xb49d('0x25')]+_0x3781f1[_0xb49d('0x23')];var _0x385701;if(_0x47626f>=_0x2a87f5){_0x47626f=_0x2a87f5;_0x385701=0xc8;}else{_0x385701=0xce;}_0x38675e[_0xb49d('0x1f')](_0x385701);return _0x38675e[_0xb49d('0x26')](_0xb49d('0x27'),_0x510f22+'-'+_0x47626f+'/'+_0x2a87f5)[_0xb49d('0x21')](_0xf0bdff);}return null;};}function patchUpdates(_0x19ead9){return function(_0x2ba098){try{jsonpatch[_0xb49d('0x28')](_0x2ba098,_0x19ead9,!![]);}catch(_0x156ff2){return BPromise[_0xb49d('0x29')](_0x156ff2);}return _0x2ba098[_0xb49d('0x2a')]();};}function saveUpdates(_0x26db55,_0x21c0e1){return function(_0x165ec2){if(_0x165ec2){return _0x165ec2[_0xb49d('0x2b')](_0x26db55)[_0xb49d('0x2c')](function(_0x395c9f){return _0x395c9f;});}return null;};}function removeEntity(_0x5a6cbe,_0x227305){return function(_0x4b7134){if(_0x4b7134){return _0x4b7134[_0xb49d('0x2d')]()[_0xb49d('0x2c')](function(){_0x5a6cbe['status'](0xcc)[_0xb49d('0x20')]();});}};}function handleEntityNotFound(_0x1cd841,_0x547d55){return function(_0x3af956){if(!_0x3af956){_0x1cd841[_0xb49d('0x1e')](0x194);}return _0x3af956;};}function handleError(_0x2276ba,_0x5d7323){_0x5d7323=_0x5d7323||0x1f4;return function(_0x3930fe){logger[_0xb49d('0x2e')](_0x3930fe[_0xb49d('0x2f')]);if(_0x3930fe[_0xb49d('0x30')]){delete _0x3930fe[_0xb49d('0x30')];}_0x2276ba[_0xb49d('0x1f')](_0x5d7323)[_0xb49d('0x31')](_0x3930fe);};}exports['index']=function(_0x3f1796,_0x4ca384){var _0xf232e1={},_0x2fbcfa={},_0x978e19={'count':0x0,'rows':[]};var _0x1e66a6=_[_0xb49d('0x32')](db[_0xb49d('0x33')][_0xb49d('0x34')],function(_0x4848c7){return{'name':_0x4848c7[_0xb49d('0x35')],'type':_0x4848c7[_0xb49d('0x36')][_0xb49d('0x37')]};});_0x2fbcfa['model']=_['map'](_0x1e66a6,_0xb49d('0x30'));_0x2fbcfa[_0xb49d('0x38')]=_[_0xb49d('0x39')](_0x3f1796[_0xb49d('0x38')]);_0x2fbcfa[_0xb49d('0x3a')]=_[_0xb49d('0x3b')](_0x2fbcfa[_0xb49d('0x3c')],_0x2fbcfa[_0xb49d('0x38')]);_0xf232e1['attributes']=_['intersection'](_0x2fbcfa[_0xb49d('0x3c')],qs['fields'](_0x3f1796['query']['fields']));_0xf232e1[_0xb49d('0x3d')]=_0xf232e1[_0xb49d('0x3d')][_0xb49d('0x3e')]?_0xf232e1[_0xb49d('0x3d')]:_0x2fbcfa[_0xb49d('0x3c')];if(!_0x3f1796[_0xb49d('0x38')]['hasOwnProperty'](_0xb49d('0x3f'))){_0xf232e1[_0xb49d('0x23')]=qs['limit'](_0x3f1796[_0xb49d('0x38')][_0xb49d('0x23')]);_0xf232e1[_0xb49d('0x25')]=qs['offset'](_0x3f1796[_0xb49d('0x38')][_0xb49d('0x25')]);}_0xf232e1[_0xb49d('0x40')]=qs['sort'](_0x3f1796[_0xb49d('0x38')]['sort']);_0xf232e1['where']=qs['filters'](_['pick'](_0x3f1796[_0xb49d('0x38')],_0x2fbcfa[_0xb49d('0x3a')]),_0x1e66a6);if(_0x3f1796[_0xb49d('0x38')][_0xb49d('0x41')]){_0xf232e1['where']=_['merge'](_0xf232e1[_0xb49d('0x42')],{'$or':_[_0xb49d('0x32')](_0x1e66a6,function(_0x15ca62){if(_0x15ca62[_0xb49d('0x36')]!==_0xb49d('0x43')){var _0x50eb1a={};_0x50eb1a[_0x15ca62['name']]={'$like':'%'+_0x3f1796[_0xb49d('0x38')][_0xb49d('0x41')]+'%'};return _0x50eb1a;}})});}_0xf232e1=_[_0xb49d('0x44')]({},_0xf232e1,_0x3f1796[_0xb49d('0x45')]);var _0x1af36c={'where':_0xf232e1['where']};return db[_0xb49d('0x33')][_0xb49d('0x24')](_0x1af36c)[_0xb49d('0x2c')](function(_0x3c7306){_0x978e19[_0xb49d('0x24')]=_0x3c7306;if(_0x3f1796[_0xb49d('0x38')][_0xb49d('0x46')]){_0xf232e1['include']=[{'all':!![]}];}return db[_0xb49d('0x33')]['findAll'](_0xf232e1);})['then'](function(_0x3f394f){_0x978e19[_0xb49d('0x47')]=_0x3f394f;return _0x978e19;})[_0xb49d('0x2c')](respondWithFilteredResult(_0x4ca384,_0xf232e1))['catch'](handleError(_0x4ca384,null));};exports[_0xb49d('0x48')]=function(_0x40fff4,_0x18a1a0){var _0x5f2952={'raw':![],'where':{'id':_0x40fff4[_0xb49d('0x49')]['id']}},_0x5576b7={};_0x5576b7[_0xb49d('0x3c')]=_[_0xb49d('0x39')](db[_0xb49d('0x33')]['rawAttributes']);_0x5576b7[_0xb49d('0x38')]=_[_0xb49d('0x39')](_0x40fff4[_0xb49d('0x38')]);_0x5576b7['filters']=_[_0xb49d('0x3b')](_0x5576b7[_0xb49d('0x3c')],_0x5576b7[_0xb49d('0x38')]);_0x5f2952[_0xb49d('0x3d')]=_[_0xb49d('0x3b')](_0x5576b7[_0xb49d('0x3c')],qs[_0xb49d('0x4a')](_0x40fff4[_0xb49d('0x38')]['fields']));_0x5f2952['attributes']=_0x5f2952['attributes'][_0xb49d('0x3e')]?_0x5f2952[_0xb49d('0x3d')]:_0x5576b7[_0xb49d('0x3c')];if(_0x40fff4[_0xb49d('0x38')]['includeAll']){_0x5f2952['include']=[{'all':!![]}];}_0x5f2952=_['merge']({},_0x5f2952,_0x40fff4[_0xb49d('0x45')]);return db[_0xb49d('0x33')][_0xb49d('0x4b')](_0x5f2952)[_0xb49d('0x2c')](handleEntityNotFound(_0x18a1a0,null))[_0xb49d('0x2c')](respondWithResult(_0x18a1a0,null))['catch'](handleError(_0x18a1a0,null));};exports[_0xb49d('0x4c')]=function(_0x459af5,_0x578498){return db[_0xb49d('0x33')][_0xb49d('0x4c')](_0x459af5['body'],{})[_0xb49d('0x2c')](respondWithResult(_0x578498,0xc9))[_0xb49d('0x4d')](handleError(_0x578498,null));};exports[_0xb49d('0x4e')]=function(_0x14f461,_0x450485){var _0x29c921={'where':{'id':_0x14f461['params']['id']}},_0x2b3596={};_0x2b3596[_0xb49d('0x3c')]=_['keys'](db[_0xb49d('0x33')][_0xb49d('0x34')]);_0x29c921[_0xb49d('0x3d')]=_[_0xb49d('0x3b')](_0x2b3596[_0xb49d('0x3c')],qs[_0xb49d('0x4a')](_0x14f461[_0xb49d('0x38')]['fields']));_0x29c921['attributes']=_0x29c921['attributes'][_0xb49d('0x3e')]?_0x29c921[_0xb49d('0x3d')]:_0x2b3596['model'];if(_0x14f461[_0xb49d('0x38')][_0xb49d('0x46')]){_0x29c921[_0xb49d('0x4f')]=[{'all':!![]}];}_0x29c921=_[_0xb49d('0x44')]({},_0x29c921,_0x14f461[_0xb49d('0x45')]);return db[_0xb49d('0x33')][_0xb49d('0x4b')](_0x29c921)[_0xb49d('0x2c')](handleEntityNotFound(_0x450485,null))[_0xb49d('0x2c')](function(_0x3b929b){if(_0x3b929b){var _0x563d2b=_0x3b929b[_0xb49d('0x50')]({'plain':!![]});_0x563d2b=qs[_0xb49d('0x51')](_0x563d2b,['id',_0xb49d('0x52'),_0xb49d('0x53'),_0xb49d('0x54')]);_0x14f461[_0xb49d('0x55')]=_[_0xb49d('0x51')](_0x14f461[_0xb49d('0x55')],['id',_0xb49d('0x52'),_0xb49d('0x53')]);return db[_0xb49d('0x56')][_0xb49d('0x57')](function(_0x3bb7a1){return db['UserProfile'][_0xb49d('0x4c')](_[_0xb49d('0x44')](_0x563d2b,_0x14f461[_0xb49d('0x55')]),{'include':_0x14f461[_0xb49d('0x38')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x3bb7a1})[_0xb49d('0x2c')](function(_0x36c949){var _0x1fd68d=_0x36c949[_0xb49d('0x50')]({'plain':!![]});return db[_0xb49d('0x58')][_0xb49d('0x59')]({'where':{'userProfileId':_0x14f461[_0xb49d('0x49')]['id']},'raw':!![]})['then'](function(_0x3bd117){if(_0x3bd117){return BPromise['each'](_0x3bd117,function(_0xe81ea2){return new BPromise(function(_0x58cca2,_0x3667c1){if(_0xe81ea2['autoAssociation']===null||_0xe81ea2[_0xb49d('0x5a')]===0x1)_0x58cca2(null);return db[_0xb49d('0x5b')][_0xb49d('0x59')]({'where':{'sectionId':_0xe81ea2['id']},'raw':!![]})['then'](function(_0xe371b9){var _0x49929f=_['map'](_0xe371b9,function(_0x3216b8){return qs[_0xb49d('0x51')](_0x3216b8,['id',_0xb49d('0x52'),_0xb49d('0x53'),_0xb49d('0x5c')]);});_0x58cca2(_0x49929f);})[_0xb49d('0x4d')](function(_0x4af656){_0x3667c1(_0x4af656);});})['then'](function(_0x1f540e){var _0x279506=qs[_0xb49d('0x51')](_0xe81ea2,['id','createdAt',_0xb49d('0x53')]);_0x279506[_0xb49d('0x5d')]=_0x1fd68d['id'];if(_0x1f540e)_0x279506['Resources']=_0x1f540e;return _0x279506;})[_0xb49d('0x2c')](function(_0x324b70){return db['UserProfileSection'][_0xb49d('0x4c')](_0x324b70,{'include':[{'model':db[_0xb49d('0x5b')],'as':_0xb49d('0x5e')}],'raw':!![],'transaction':_0x3bb7a1});});})[_0xb49d('0x2c')](function(){return _0x1fd68d;});}});});});}})[_0xb49d('0x2c')](respondWithResult(_0x450485,0xc9))[_0xb49d('0x4d')](handleError(_0x450485,null));};exports['update']=function(_0x24884d,_0x23401e){if(_0x24884d[_0xb49d('0x55')]['id']){delete _0x24884d['body']['id'];}return db[_0xb49d('0x33')][_0xb49d('0x4b')]({'where':{'id':_0x24884d[_0xb49d('0x49')]['id']}})[_0xb49d('0x2c')](handleEntityNotFound(_0x23401e,null))[_0xb49d('0x2c')](saveUpdates(_0x24884d[_0xb49d('0x55')],null))['then'](respondWithResult(_0x23401e,null))[_0xb49d('0x4d')](handleError(_0x23401e,null));};exports[_0xb49d('0x2d')]=function(_0x651ea9,_0x291d1a){return db[_0xb49d('0x33')][_0xb49d('0x4b')]({'where':{'id':_0x651ea9[_0xb49d('0x49')]['id']}})[_0xb49d('0x2c')](handleEntityNotFound(_0x291d1a,null))[_0xb49d('0x2c')](removeEntity(_0x291d1a,null))[_0xb49d('0x4d')](handleError(_0x291d1a,null));};exports[_0xb49d('0x5f')]=function(_0x162c46,_0x5bc566){return db[_0xb49d('0x33')]['describe']()[_0xb49d('0x2c')](respondWithResult(_0x5bc566,null))[_0xb49d('0x4d')](handleError(_0x5bc566,null));};exports['addSections']=function(_0x23b73d,_0x55603f){var _0x2cdcc2=_0x23b73d['body'];return db[_0xb49d('0x33')][_0xb49d('0x4b')]({'where':{'id':_0x23b73d[_0xb49d('0x49')]['id']}})[_0xb49d('0x2c')](handleEntityNotFound(_0x55603f,null))[_0xb49d('0x2c')](function(_0x4e32a4){if(_0x4e32a4){return db[_0xb49d('0x56')]['transaction'](function(_0x2d7f16){return db[_0xb49d('0x58')][_0xb49d('0x2d')]({'where':{'userProfileId':_0x23b73d[_0xb49d('0x49')]['id'],'sectionId':_[_0xb49d('0x32')](_0x2cdcc2,function(_0x1c1175){return _0x1c1175[_0xb49d('0x5c')];})},'transaction':_0x2d7f16})[_0xb49d('0x2c')](function(){var _0x47a8bd=_[_0xb49d('0x32')](_0x2cdcc2,function(_0xfa8c9c){_0xfa8c9c['userProfileId']=_0x23b73d[_0xb49d('0x49')]['id'];return _0xfa8c9c;});var _0x4e0711=[];return BPromise['each'](_0x47a8bd,function(_0x5a5177){return db[_0xb49d('0x58')][_0xb49d('0x4c')](_0x5a5177,{'include':[{'model':db[_0xb49d('0x5b')],'as':_0xb49d('0x5e')}],'raw':!![],'transaction':_0x2d7f16})[_0xb49d('0x2c')](function(_0x59a570){_0x4e0711[_0xb49d('0x60')](_0x59a570[_0xb49d('0x50')]({'plain':!![]}));});})[_0xb49d('0x2c')](function(){return _0x4e0711;});});});}})[_0xb49d('0x2c')](function(_0x5ef777){return _0x5ef777;})[_0xb49d('0x2c')](respondWithResult(_0x55603f,null))[_0xb49d('0x4d')](handleError(_0x55603f,null));};exports['removeSections']=function(_0x13bc04,_0x27e799){var _0x48accb;return db[_0xb49d('0x33')][_0xb49d('0x4b')]({'where':{'id':_0x13bc04['params']['id']},'attributes':['id','name']})[_0xb49d('0x2c')](handleEntityNotFound(_0x27e799,null))[_0xb49d('0x2c')](function(_0x3b8cf0){if(_0x3b8cf0){_0x48accb=_0x3b8cf0;return db[_0xb49d('0x58')][_0xb49d('0x2d')]({'where':{'userProfileId':_0x13bc04['params']['id'],'sectionId':_0x13bc04[_0xb49d('0x38')][_0xb49d('0x61')]}});}})[_0xb49d('0x2c')](function(){return _0x48accb;})['then'](respondWithStatusCode(_0x27e799,null))[_0xb49d('0x4d')](handleError(_0x27e799,null));};exports['getSections']=function(_0x3ddf6d,_0x4cac68){var _0x18f4b4=[];var _0x15a1d6=[];return db[_0xb49d('0x58')][_0xb49d('0x59')]({'where':{'userProfileId':_0x3ddf6d[_0xb49d('0x49')]['id']},'raw':!![]})['then'](function(_0x175277){_0x18f4b4=_['filter'](_0x175277,function(_0x4ab29e){return _0x4ab29e['enabled']===0x1||_[_0xb49d('0x62')]([0x3eb,0x709],_0x4ab29e[_0xb49d('0x5c')]);});if(!_[_0xb49d('0x63')](_0x18f4b4)){return _[_0xb49d('0x32')](_0x18f4b4,function(_0x31e8c4){return _0x31e8c4[_0xb49d('0x5c')];});}else{return;}})[_0xb49d('0x2c')](function(_0x5679dc){if(_0x5679dc)_0x15a1d6=_0x5679dc;if(_['includes'](_0x15a1d6,0x64)){var _0x4d7795=_[_0xb49d('0x4b')](_0x18f4b4,{'sectionId':0x64});return hasDefaultDashboard(_0x4d7795)[_0xb49d('0x2c')](function(_0x37af67){return _[_0xb49d('0x32')](_0x18f4b4,function(_0x7845a8){if(_0x7845a8[_0xb49d('0x5c')]===0x64){_0x7845a8[_0xb49d('0x64')]=_0x37af67;}return _0x7845a8;});});}else{return;}})[_0xb49d('0x2c')](function(_0x1f5ba0){if(_0x1f5ba0)_0x18f4b4=_0x1f5ba0;if(_[_0xb49d('0x62')](_0x15a1d6,0x3eb)){var _0x112342=_[_0xb49d('0x4b')](_0x18f4b4,{'sectionId':0x3eb});return getCustomDashboards(_0x112342)[_0xb49d('0x2c')](function(_0x423750){return _['map'](_0x18f4b4,function(_0x45bdee){if(_0x112342['enabled']){if(_0x45bdee[_0xb49d('0x5c')]===0x3eb){_0x45bdee['subsections']=_0x423750;}}else{if(_0x45bdee['sectionId']===0x64){_0x45bdee[_0xb49d('0x64')]=_0x423750;}}return _0x45bdee;});});}else{return;}})[_0xb49d('0x2c')](function(_0x271022){if(_0x271022)_0x18f4b4=_0x271022;if(_['includes'](_0x15a1d6,0x709)){var _0x5525c3=_[_0xb49d('0x4b')](_0x18f4b4,{'sectionId':0x709});return getPlugins(_0x5525c3)[_0xb49d('0x2c')](function(_0x212ad0){if(_0x5525c3[_0xb49d('0x65')]){return _[_0xb49d('0x32')](_0x18f4b4,function(_0x4b4057){if(_0x4b4057['sectionId']===0x709){_0x4b4057['subsections']=_0x212ad0;}return _0x4b4057;});}else{var _0x1fdd6={'sectionId':0x76c,'enabled':0x1,'subsections':_0x212ad0};var _0x30f107=_[_0xb49d('0x32')](_0x18f4b4);_0x30f107['push'](_0x1fdd6);return _0x30f107;}});}else{return;}})[_0xb49d('0x2c')](function(_0x2f8b57){if(_0x2f8b57)_0x18f4b4=_0x2f8b57;return _[_0xb49d('0x41')](_0x18f4b4,[_0xb49d('0x65'),0x1]);})[_0xb49d('0x2c')](respondWithResult(_0x4cac68,null))[_0xb49d('0x4d')](handleError(_0x4cac68,null));};function hasDefaultDashboard(_0x5b46a3){var _0x2e152b=[0x65];return new BPromise(function(_0x145198,_0x221092){try{if(_0x5b46a3[_0xb49d('0x5a')]){_0x145198(_0x2e152b);}else{return db['UserProfileResource'][_0xb49d('0x66')]({'where':{'sectionId':_0x5b46a3['id']},'raw':!![]})[_0xb49d('0x2c')](function(_0x289e09){_0x289e09?_0x145198(_0x2e152b):_0x145198();});}}catch(_0x3a57ea){_0x221092(_0x3a57ea);}});}function getCustomDashboards(_0xa2000){var _0x441b4b=[];return new BPromise(function(_0x33bbb4,_0x397409){try{if(_0xa2000['autoAssociation']){return db[_0xb49d('0x67')][_0xb49d('0x59')]({'raw':!![]})[_0xb49d('0x2c')](function(_0x4ca7a4){_0x4ca7a4[_0xb49d('0x68')](function(_0x559fc4){_0x441b4b['push'](_0x559fc4['id']+0x1869f);});_0x33bbb4(_0x441b4b);});}else{return db[_0xb49d('0x5b')][_0xb49d('0x59')]({'where':{'sectionId':_0xa2000['id']},'raw':!![]})[_0xb49d('0x2c')](function(_0x9b0bca){_0x9b0bca[_0xb49d('0x68')](function(_0x4bdf27){_0x441b4b[_0xb49d('0x60')](_0x4bdf27[_0xb49d('0x69')]+0x1869f);});_0x33bbb4(_0x441b4b);});}}catch(_0x43ed69){_0x397409(_0x43ed69);}});}function getPlugins(_0x16101a){var _0x4cae07=[];return new BPromise(function(_0x523dfb,_0x2b4342){try{if(_0x16101a[_0xb49d('0x5a')]){return db[_0xb49d('0x6a')]['findAll']({'raw':!![]})[_0xb49d('0x2c')](function(_0x4bc3f6){_0x4bc3f6[_0xb49d('0x68')](function(_0x2ddc5d){_0x4cae07[_0xb49d('0x60')](_0x2ddc5d['id']+0x15b38);});_0x523dfb(_0x4cae07);});}else{return db[_0xb49d('0x5b')][_0xb49d('0x59')]({'where':{'sectionId':_0x16101a['id']},'raw':!![]})['then'](function(_0xd1b135){_0xd1b135['forEach'](function(_0x5e3a1b){_0x4cae07[_0xb49d('0x60')](_0x5e3a1b[_0xb49d('0x69')]+0x15b38);});_0x523dfb(_0x4cae07);});}}catch(_0xccde3d){_0x2b4342(_0xccde3d);}});}exports[_0xb49d('0x6b')]=function(_0x25c525,_0xec0914){return db['UserProfile'][_0xb49d('0x4b')]({'where':{'id':_0x25c525[_0xb49d('0x49')]['id']}})[_0xb49d('0x2c')](handleEntityNotFound(_0xec0914,null))[_0xb49d('0x2c')](function(_0x15e426){if(_0x15e426){return db['sequelize'][_0xb49d('0x57')](function(_0x4cf1e7){return db[_0xb49d('0x58')][_0xb49d('0x59')]({'where':{'userProfileId':_0x25c525[_0xb49d('0x49')]['id']},'attributes':['id'],'raw':!![]})[_0xb49d('0x2c')](function(_0x532bc1){if(_0x532bc1){return db[_0xb49d('0x58')][_0xb49d('0x2d')]({'where':{'userProfileId':_0x25c525['params']['id'],'id':_['map'](_0x532bc1,function(_0x333591){return _0x333591['id'];})},'transaction':_0x4cf1e7});}})[_0xb49d('0x2c')](function(_0x7a07b4){var _0x4a222c=_[_0xb49d('0x32')](_0x25c525[_0xb49d('0x55')],function(_0x1cd164){_0x1cd164[_0xb49d('0x5d')]=_0x25c525['params']['id'];return _0x1cd164;});return db[_0xb49d('0x58')][_0xb49d('0x6c')](_0x4a222c,{'raw':!![],'transaction':_0x4cf1e7});})[_0xb49d('0x2c')](function(_0x26fd0e){var _0x7fec66=_[_0xb49d('0x41')](_['map'](_0x26fd0e,function(_0x4a19f7){return _0x4a19f7[_0xb49d('0x50')]({'plain':!![]});}),{'includeAll':![]});if(_0x7fec66){return db[_0xb49d('0x58')][_0xb49d('0x59')]({'where':{'userProfileId':_0x25c525['params']['id'],'sectionId':_[_0xb49d('0x32')](_0x7fec66,function(_0x544fb9){return _0x544fb9[_0xb49d('0x5c')];})},'attributes':['id',_0xb49d('0x5c')],'raw':!![]})[_0xb49d('0x2c')](function(_0x10a7ce){var _0x4dba86=_[_0xb49d('0x32')](_0x25c525[_0xb49d('0x55')],function(_0xda577){_0xda577[_0xb49d('0x5d')]=_0x25c525[_0xb49d('0x49')]['id'];return _0xda577;});return db['UserProfileResource'][_0xb49d('0x6c')](_0x4dba86,{'raw':!![],'transaction':_0x4cf1e7});});}})[_0xb49d('0x4d')](handleError(_0xec0914,null));});}})[_0xb49d('0x2c')](function(_0x2eef83){var _0x252083=_[_0xb49d('0x32')](_0x2eef83,function(_0x53c23c){return _0x53c23c['get']({'plain':!![]});});})['then'](respondWithResult(_0xec0914,null))[_0xb49d('0x4d')](handleError(_0xec0914,null));};exports[_0xb49d('0x6d')]=function(_0x3afc6b,_0x49967,_0x488e26){return db[_0xb49d('0x33')][_0xb49d('0x4b')]({'where':{'id':_0x3afc6b['params']['id']}})['then'](handleEntityNotFound(_0x49967,null))[_0xb49d('0x2c')](function(_0x4fc2fb){if(_0x4fc2fb){return _0x4fc2fb[_0xb49d('0x6d')](_0x3afc6b[_0xb49d('0x38')][_0xb49d('0x61')]);}})[_0xb49d('0x2c')](respondWithStatusCode(_0x49967,null))[_0xb49d('0x4d')](handleError(_0x49967,null));};exports[_0xb49d('0x6e')]=function(_0x12c193,_0x593a08){var _0x23bdc2={};if(!_0x12c193['query'][_0xb49d('0x6f')])throw new Error(_0xb49d('0x70'));if(!_0x12c193[_0xb49d('0x38')][_0xb49d('0x71')](_0xb49d('0x3f'))){_0x23bdc2['limit']=qs[_0xb49d('0x23')](_0x12c193[_0xb49d('0x38')][_0xb49d('0x23')]);_0x23bdc2[_0xb49d('0x25')]=qs[_0xb49d('0x25')](_0x12c193[_0xb49d('0x38')][_0xb49d('0x25')]);}return db[_0xb49d('0x33')]['find']({'where':{'id':_0x12c193[_0xb49d('0x49')]['id']}})[_0xb49d('0x2c')](function(_0x512fe2){if(!_0x512fe2)throw new Error(_0xb49d('0x72')+_0x12c193[_0xb49d('0x49')]['id']);return db[_0xb49d('0x33')][_0xb49d('0x6e')](_0x12c193);})['then'](respondWithFilteredResult(_0x593a08,_0x23bdc2))[_0xb49d('0x4d')](handleError(_0x593a08,null));}; \ No newline at end of file +var _0x9264=['rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','then','include','findAll','rows','catch','show','includeAll','find','create','clone','params','options','get','omit','createdAt','body','updatedAt','sequelize','each','autoAssociation','sectionId','Resources','UserProfileSection','UserProfileResource','destroy','describe','addSections','transaction','userProfileId','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','Plugin','addResources','bulkCreate','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','error','name','send','index','map','UserProfile'];(function(_0x4927dc,_0x54b3f6){var _0x45e1c3=function(_0x45f4f7){while(--_0x45f4f7){_0x4927dc['push'](_0x4927dc['shift']());}};_0x45e1c3(++_0x54b3f6);}(_0x9264,0xb1));var _0x4926=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9264[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x4926('0x0'));var rimraf=require(_0x4926('0x1'));var zipdir=require(_0x4926('0x2'));var jsonpatch=require(_0x4926('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4926('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4926('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4926('0x6'));var _=require(_0x4926('0x7'));var squel=require('squel');var crypto=require(_0x4926('0x8'));var jsforce=require(_0x4926('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x4926('0xa'));var querystring=require(_0x4926('0xb'));var Papa=require(_0x4926('0xc'));var Redis=require('ioredis');var authService=require(_0x4926('0xd'));var qs=require(_0x4926('0xe'));var as=require(_0x4926('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4926('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x4926('0x11'));var licenseUtil=require(_0x4926('0x12'));var db=require(_0x4926('0x13'))['db'];config['redis']=_[_0x4926('0x14')](config[_0x4926('0x15')],{'host':_0x4926('0x16'),'port':0x18eb});var socket=require(_0x4926('0x17'))(new Redis(config[_0x4926('0x15')]));require(_0x4926('0x18'))[_0x4926('0x19')](socket);function respondWithStatusCode(_0x1a280b,_0x21503d){_0x21503d=_0x21503d||0xcc;return function(_0x7782aa){if(_0x7782aa){return _0x1a280b[_0x4926('0x1a')](_0x21503d);}return _0x1a280b[_0x4926('0x1b')](_0x21503d)[_0x4926('0x1c')]();};}function respondWithResult(_0x1ac74f,_0x55b957){_0x55b957=_0x55b957||0xc8;return function(_0x1703ed){if(_0x1703ed){return _0x1ac74f[_0x4926('0x1b')](_0x55b957)[_0x4926('0x1d')](_0x1703ed);}};}function respondWithFilteredResult(_0x5736dd,_0x4d2cd3){return function(_0x1dd78e){if(_0x1dd78e){var _0x5630a8=typeof _0x4d2cd3[_0x4926('0x1e')]===_0x4926('0x1f')&&typeof _0x4d2cd3['limit']===_0x4926('0x1f');var _0x49461e=_0x1dd78e[_0x4926('0x20')];var _0x3d3fbc=_0x5630a8?0x0:_0x4d2cd3[_0x4926('0x1e')];var _0x2d6239=_0x5630a8?_0x1dd78e['count']:_0x4d2cd3['offset']+_0x4d2cd3[_0x4926('0x21')];var _0x588c7a;if(_0x2d6239>=_0x49461e){_0x2d6239=_0x49461e;_0x588c7a=0xc8;}else{_0x588c7a=0xce;}_0x5736dd['status'](_0x588c7a);return _0x5736dd[_0x4926('0x22')](_0x4926('0x23'),_0x3d3fbc+'-'+_0x2d6239+'/'+_0x49461e)['json'](_0x1dd78e);}return null;};}function patchUpdates(_0xfd1095){return function(_0x4792ac){try{jsonpatch[_0x4926('0x24')](_0x4792ac,_0xfd1095,!![]);}catch(_0x55e459){return BPromise[_0x4926('0x25')](_0x55e459);}return _0x4792ac[_0x4926('0x26')]();};}function saveUpdates(_0x2df18c,_0x44eb88){return function(_0x585b91){if(_0x585b91){return _0x585b91['update'](_0x2df18c)['then'](function(_0x1c02e7){return _0x1c02e7;});}return null;};}function removeEntity(_0xbfbe1b,_0x43c077){return function(_0x2519a2){if(_0x2519a2){return _0x2519a2['destroy']()['then'](function(){_0xbfbe1b['status'](0xcc)[_0x4926('0x1c')]();});}};}function handleEntityNotFound(_0x273f4b,_0x18f56d){return function(_0x4adb87){if(!_0x4adb87){_0x273f4b['sendStatus'](0x194);}return _0x4adb87;};}function handleError(_0x50004f,_0x37701c){_0x37701c=_0x37701c||0x1f4;return function(_0x3f06a3){logger[_0x4926('0x27')](_0x3f06a3['stack']);if(_0x3f06a3[_0x4926('0x28')]){delete _0x3f06a3[_0x4926('0x28')];}_0x50004f[_0x4926('0x1b')](_0x37701c)[_0x4926('0x29')](_0x3f06a3);};}exports[_0x4926('0x2a')]=function(_0x14cc3a,_0x5a44a9){var _0x39ad37={},_0x717a1a={},_0x32a6c2={'count':0x0,'rows':[]};var _0x14d8b8=_[_0x4926('0x2b')](db[_0x4926('0x2c')][_0x4926('0x2d')],function(_0x50ea49){return{'name':_0x50ea49[_0x4926('0x2e')],'type':_0x50ea49[_0x4926('0x2f')]['key']};});_0x717a1a[_0x4926('0x30')]=_[_0x4926('0x2b')](_0x14d8b8,_0x4926('0x28'));_0x717a1a[_0x4926('0x31')]=_[_0x4926('0x32')](_0x14cc3a[_0x4926('0x31')]);_0x717a1a[_0x4926('0x33')]=_[_0x4926('0x34')](_0x717a1a[_0x4926('0x30')],_0x717a1a[_0x4926('0x31')]);_0x39ad37[_0x4926('0x35')]=_[_0x4926('0x34')](_0x717a1a[_0x4926('0x30')],qs[_0x4926('0x36')](_0x14cc3a['query'][_0x4926('0x36')]));_0x39ad37[_0x4926('0x35')]=_0x39ad37[_0x4926('0x35')][_0x4926('0x37')]?_0x39ad37['attributes']:_0x717a1a[_0x4926('0x30')];if(!_0x14cc3a[_0x4926('0x31')][_0x4926('0x38')](_0x4926('0x39'))){_0x39ad37[_0x4926('0x21')]=qs['limit'](_0x14cc3a[_0x4926('0x31')][_0x4926('0x21')]);_0x39ad37[_0x4926('0x1e')]=qs['offset'](_0x14cc3a[_0x4926('0x31')][_0x4926('0x1e')]);}_0x39ad37[_0x4926('0x3a')]=qs[_0x4926('0x3b')](_0x14cc3a[_0x4926('0x31')][_0x4926('0x3b')]);_0x39ad37['where']=qs[_0x4926('0x33')](_[_0x4926('0x3c')](_0x14cc3a[_0x4926('0x31')],_0x717a1a[_0x4926('0x33')]),_0x14d8b8);if(_0x14cc3a[_0x4926('0x31')]['filter']){_0x39ad37[_0x4926('0x3d')]=_[_0x4926('0x3e')](_0x39ad37[_0x4926('0x3d')],{'$or':_[_0x4926('0x2b')](_0x14d8b8,function(_0x4ea503){if(_0x4ea503['type']!=='VIRTUAL'){var _0x2e74d9={};_0x2e74d9[_0x4ea503[_0x4926('0x28')]]={'$like':'%'+_0x14cc3a[_0x4926('0x31')][_0x4926('0x3f')]+'%'};return _0x2e74d9;}})});}_0x39ad37=_[_0x4926('0x3e')]({},_0x39ad37,_0x14cc3a['options']);var _0x5a8f61={'where':_0x39ad37['where']};return db['UserProfile'][_0x4926('0x20')](_0x5a8f61)[_0x4926('0x40')](function(_0x4380da){_0x32a6c2[_0x4926('0x20')]=_0x4380da;if(_0x14cc3a[_0x4926('0x31')]['includeAll']){_0x39ad37[_0x4926('0x41')]=[{'all':!![]}];}return db[_0x4926('0x2c')][_0x4926('0x42')](_0x39ad37);})[_0x4926('0x40')](function(_0x437800){_0x32a6c2[_0x4926('0x43')]=_0x437800;return _0x32a6c2;})[_0x4926('0x40')](respondWithFilteredResult(_0x5a44a9,_0x39ad37))[_0x4926('0x44')](handleError(_0x5a44a9,null));};exports[_0x4926('0x45')]=function(_0x39329b,_0x51427e){var _0x571efa={'raw':![],'where':{'id':_0x39329b['params']['id']}},_0x3428be={};_0x3428be[_0x4926('0x30')]=_[_0x4926('0x32')](db[_0x4926('0x2c')]['rawAttributes']);_0x3428be[_0x4926('0x31')]=_[_0x4926('0x32')](_0x39329b[_0x4926('0x31')]);_0x3428be[_0x4926('0x33')]=_[_0x4926('0x34')](_0x3428be[_0x4926('0x30')],_0x3428be[_0x4926('0x31')]);_0x571efa[_0x4926('0x35')]=_[_0x4926('0x34')](_0x3428be[_0x4926('0x30')],qs[_0x4926('0x36')](_0x39329b[_0x4926('0x31')][_0x4926('0x36')]));_0x571efa[_0x4926('0x35')]=_0x571efa[_0x4926('0x35')]['length']?_0x571efa[_0x4926('0x35')]:_0x3428be[_0x4926('0x30')];if(_0x39329b['query'][_0x4926('0x46')]){_0x571efa[_0x4926('0x41')]=[{'all':!![]}];}_0x571efa=_[_0x4926('0x3e')]({},_0x571efa,_0x39329b['options']);return db[_0x4926('0x2c')][_0x4926('0x47')](_0x571efa)[_0x4926('0x40')](handleEntityNotFound(_0x51427e,null))[_0x4926('0x40')](respondWithResult(_0x51427e,null))[_0x4926('0x44')](handleError(_0x51427e,null));};exports[_0x4926('0x48')]=function(_0x43764f,_0x12a89b){return db['UserProfile'][_0x4926('0x48')](_0x43764f['body'],{})['then'](respondWithResult(_0x12a89b,0xc9))[_0x4926('0x44')](handleError(_0x12a89b,null));};exports[_0x4926('0x49')]=function(_0x50d4b4,_0x3afe71){var _0x3ef8ec={'where':{'id':_0x50d4b4[_0x4926('0x4a')]['id']}},_0x37877f={};_0x37877f[_0x4926('0x30')]=_[_0x4926('0x32')](db['UserProfile']['rawAttributes']);_0x3ef8ec['attributes']=_['intersection'](_0x37877f[_0x4926('0x30')],qs[_0x4926('0x36')](_0x50d4b4[_0x4926('0x31')][_0x4926('0x36')]));_0x3ef8ec[_0x4926('0x35')]=_0x3ef8ec[_0x4926('0x35')]['length']?_0x3ef8ec[_0x4926('0x35')]:_0x37877f[_0x4926('0x30')];if(_0x50d4b4['query'][_0x4926('0x46')]){_0x3ef8ec[_0x4926('0x41')]=[{'all':!![]}];}_0x3ef8ec=_['merge']({},_0x3ef8ec,_0x50d4b4[_0x4926('0x4b')]);return db[_0x4926('0x2c')]['find'](_0x3ef8ec)[_0x4926('0x40')](handleEntityNotFound(_0x3afe71,null))['then'](function(_0x1b0b43){if(_0x1b0b43){var _0x691972=_0x1b0b43[_0x4926('0x4c')]({'plain':!![]});_0x691972=qs[_0x4926('0x4d')](_0x691972,['id',_0x4926('0x4e'),'updatedAt','crudPermissions']);_0x50d4b4[_0x4926('0x4f')]=_[_0x4926('0x4d')](_0x50d4b4['body'],['id',_0x4926('0x4e'),_0x4926('0x50')]);return db[_0x4926('0x51')]['transaction'](function(_0x22e537){return db[_0x4926('0x2c')][_0x4926('0x48')](_[_0x4926('0x3e')](_0x691972,_0x50d4b4['body']),{'include':_0x50d4b4['query']['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x22e537})[_0x4926('0x40')](function(_0x391087){var _0x2efca4=_0x391087[_0x4926('0x4c')]({'plain':!![]});return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x50d4b4['params']['id']},'raw':!![]})[_0x4926('0x40')](function(_0x113907){if(_0x113907){return BPromise[_0x4926('0x52')](_0x113907,function(_0x41e090){return new BPromise(function(_0x39c072,_0x5ad039){if(_0x41e090[_0x4926('0x53')]===null||_0x41e090[_0x4926('0x53')]===0x1)_0x39c072(null);return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x41e090['id']},'raw':!![]})[_0x4926('0x40')](function(_0x27ef63){var _0x165d08=_[_0x4926('0x2b')](_0x27ef63,function(_0x48a4ec){return qs['omit'](_0x48a4ec,['id','createdAt',_0x4926('0x50'),_0x4926('0x54')]);});_0x39c072(_0x165d08);})[_0x4926('0x44')](function(_0x55b39b){_0x5ad039(_0x55b39b);});})[_0x4926('0x40')](function(_0x538665){var _0x1696c9=qs[_0x4926('0x4d')](_0x41e090,['id','createdAt',_0x4926('0x50')]);_0x1696c9['userProfileId']=_0x2efca4['id'];if(_0x538665)_0x1696c9[_0x4926('0x55')]=_0x538665;return _0x1696c9;})[_0x4926('0x40')](function(_0x4ebdb8){return db[_0x4926('0x56')][_0x4926('0x48')](_0x4ebdb8,{'include':[{'model':db[_0x4926('0x57')],'as':_0x4926('0x55')}],'raw':!![],'transaction':_0x22e537});});})['then'](function(){return _0x2efca4;});}});});});}})[_0x4926('0x40')](respondWithResult(_0x3afe71,0xc9))[_0x4926('0x44')](handleError(_0x3afe71,null));};exports['update']=function(_0x7ed5fc,_0x155726){if(_0x7ed5fc[_0x4926('0x4f')]['id']){delete _0x7ed5fc[_0x4926('0x4f')]['id'];}return db['UserProfile'][_0x4926('0x47')]({'where':{'id':_0x7ed5fc[_0x4926('0x4a')]['id']}})[_0x4926('0x40')](handleEntityNotFound(_0x155726,null))[_0x4926('0x40')](saveUpdates(_0x7ed5fc['body'],null))[_0x4926('0x40')](respondWithResult(_0x155726,null))[_0x4926('0x44')](handleError(_0x155726,null));};exports[_0x4926('0x58')]=function(_0x4b8873,_0x59df25){return db[_0x4926('0x2c')][_0x4926('0x47')]({'where':{'id':_0x4b8873[_0x4926('0x4a')]['id']}})['then'](handleEntityNotFound(_0x59df25,null))[_0x4926('0x40')](removeEntity(_0x59df25,null))[_0x4926('0x44')](handleError(_0x59df25,null));};exports[_0x4926('0x59')]=function(_0x3180ae,_0x328380){return db[_0x4926('0x2c')][_0x4926('0x59')]()['then'](respondWithResult(_0x328380,null))[_0x4926('0x44')](handleError(_0x328380,null));};exports[_0x4926('0x5a')]=function(_0x17a414,_0x21207f){var _0x5321cc=_0x17a414[_0x4926('0x4f')];return db[_0x4926('0x2c')][_0x4926('0x47')]({'where':{'id':_0x17a414[_0x4926('0x4a')]['id']}})[_0x4926('0x40')](handleEntityNotFound(_0x21207f,null))['then'](function(_0x8f68cf){if(_0x8f68cf){return db['sequelize'][_0x4926('0x5b')](function(_0x129405){return db[_0x4926('0x56')][_0x4926('0x58')]({'where':{'userProfileId':_0x17a414['params']['id'],'sectionId':_[_0x4926('0x2b')](_0x5321cc,function(_0x5854ae){return _0x5854ae['sectionId'];})},'transaction':_0x129405})[_0x4926('0x40')](function(){var _0x2f60f0=_[_0x4926('0x2b')](_0x5321cc,function(_0x28b118){_0x28b118[_0x4926('0x5c')]=_0x17a414[_0x4926('0x4a')]['id'];return _0x28b118;});var _0x564e51=[];return BPromise[_0x4926('0x52')](_0x2f60f0,function(_0x25a345){return db[_0x4926('0x56')][_0x4926('0x48')](_0x25a345,{'include':[{'model':db['UserProfileResource'],'as':_0x4926('0x55')}],'raw':!![],'transaction':_0x129405})[_0x4926('0x40')](function(_0x1de139){_0x564e51[_0x4926('0x5d')](_0x1de139[_0x4926('0x4c')]({'plain':!![]}));});})['then'](function(){return _0x564e51;});});});}})['then'](function(_0x388370){return _0x388370;})[_0x4926('0x40')](respondWithResult(_0x21207f,null))[_0x4926('0x44')](handleError(_0x21207f,null));};exports[_0x4926('0x5e')]=function(_0x522b61,_0x1fad14){var _0x3d788b;return db[_0x4926('0x2c')][_0x4926('0x47')]({'where':{'id':_0x522b61[_0x4926('0x4a')]['id']},'attributes':['id',_0x4926('0x28')]})[_0x4926('0x40')](handleEntityNotFound(_0x1fad14,null))[_0x4926('0x40')](function(_0x36a782){if(_0x36a782){_0x3d788b=_0x36a782;return db[_0x4926('0x56')][_0x4926('0x58')]({'where':{'userProfileId':_0x522b61[_0x4926('0x4a')]['id'],'sectionId':_0x522b61[_0x4926('0x31')][_0x4926('0x5f')]}});}})[_0x4926('0x40')](function(){return _0x3d788b;})[_0x4926('0x40')](respondWithStatusCode(_0x1fad14,null))[_0x4926('0x44')](handleError(_0x1fad14,null));};exports[_0x4926('0x60')]=function(_0x4ae357,_0x2889c1){var _0x30bb83=[];var _0x3f9198=[];return db['UserProfileSection'][_0x4926('0x42')]({'where':{'userProfileId':_0x4ae357[_0x4926('0x4a')]['id']},'raw':!![]})[_0x4926('0x40')](function(_0x152dbf){_0x30bb83=_[_0x4926('0x3f')](_0x152dbf,function(_0x18aa37){return _0x18aa37[_0x4926('0x61')]===0x1||_[_0x4926('0x62')]([0x3eb,0x709],_0x18aa37[_0x4926('0x54')]);});if(!_[_0x4926('0x63')](_0x30bb83)){return _[_0x4926('0x2b')](_0x30bb83,function(_0x45d7c3){return _0x45d7c3['sectionId'];});}else{return;}})['then'](function(_0x162d9c){if(_0x162d9c)_0x3f9198=_0x162d9c;if(_['includes'](_0x3f9198,0x64)){var _0x140eba=_[_0x4926('0x47')](_0x30bb83,{'sectionId':0x64});return hasDefaultDashboard(_0x140eba)['then'](function(_0x3818e4){return _[_0x4926('0x2b')](_0x30bb83,function(_0x246db8){if(_0x246db8[_0x4926('0x54')]===0x64){_0x246db8[_0x4926('0x64')]=_0x3818e4;}return _0x246db8;});});}else{return;}})['then'](function(_0x50141a){if(_0x50141a)_0x30bb83=_0x50141a;if(_[_0x4926('0x62')](_0x3f9198,0x3eb)){var _0x1314b7=_[_0x4926('0x47')](_0x30bb83,{'sectionId':0x3eb});return getCustomDashboards(_0x1314b7)['then'](function(_0x16fe37){return _['map'](_0x30bb83,function(_0x28385a){if(_0x1314b7[_0x4926('0x61')]){if(_0x28385a[_0x4926('0x54')]===0x3eb){_0x28385a[_0x4926('0x64')]=_0x16fe37;}}else{if(_0x28385a[_0x4926('0x54')]===0x64){_0x28385a[_0x4926('0x64')]=_0x16fe37;}}return _0x28385a;});});}else{return;}})[_0x4926('0x40')](function(_0x4d6b56){if(_0x4d6b56)_0x30bb83=_0x4d6b56;if(_[_0x4926('0x62')](_0x3f9198,0x709)){var _0x3ae52e=_[_0x4926('0x47')](_0x30bb83,{'sectionId':0x709});return getPlugins(_0x3ae52e)['then'](function(_0x8d3b96){if(_0x3ae52e[_0x4926('0x61')]){return _[_0x4926('0x2b')](_0x30bb83,function(_0x49fb63){if(_0x49fb63[_0x4926('0x54')]===0x709){_0x49fb63[_0x4926('0x64')]=_0x8d3b96;}return _0x49fb63;});}else{var _0x35690d={'sectionId':0x76c,'enabled':0x1,'subsections':_0x8d3b96};var _0xecac48=_[_0x4926('0x2b')](_0x30bb83);_0xecac48[_0x4926('0x5d')](_0x35690d);return _0xecac48;}});}else{return;}})['then'](function(_0x345922){if(_0x345922)_0x30bb83=_0x345922;return _[_0x4926('0x3f')](_0x30bb83,[_0x4926('0x61'),0x1]);})[_0x4926('0x40')](respondWithResult(_0x2889c1,null))[_0x4926('0x44')](handleError(_0x2889c1,null));};function hasDefaultDashboard(_0x20a068){var _0x3e4da9=[0x65];return new BPromise(function(_0x3ba12b,_0x5bae2b){try{if(_0x20a068[_0x4926('0x53')]){_0x3ba12b(_0x3e4da9);}else{return db['UserProfileResource'][_0x4926('0x65')]({'where':{'sectionId':_0x20a068['id']},'raw':!![]})['then'](function(_0x2c9f29){_0x2c9f29?_0x3ba12b(_0x3e4da9):_0x3ba12b();});}}catch(_0x2d5590){_0x5bae2b(_0x2d5590);}});}function getCustomDashboards(_0x1b01d3){var _0x1d8424=[];return new BPromise(function(_0x2458a5,_0x2aedb7){try{if(_0x1b01d3[_0x4926('0x53')]){return db[_0x4926('0x66')]['findAll']({'raw':!![]})[_0x4926('0x40')](function(_0x48230a){_0x48230a['forEach'](function(_0x2f524c){_0x1d8424[_0x4926('0x5d')](_0x2f524c['id']+0x1869f);});_0x2458a5(_0x1d8424);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x1b01d3['id']},'raw':!![]})['then'](function(_0x5d7c70){_0x5d7c70[_0x4926('0x67')](function(_0x1edfe3){_0x1d8424[_0x4926('0x5d')](_0x1edfe3['resourceId']+0x1869f);});_0x2458a5(_0x1d8424);});}}catch(_0x4011d7){_0x2aedb7(_0x4011d7);}});}function getPlugins(_0x5d6aa0){var _0x2290db=[];return new BPromise(function(_0x4dd23b,_0x2c62e7){try{if(_0x5d6aa0[_0x4926('0x53')]){return db[_0x4926('0x68')][_0x4926('0x42')]({'raw':!![]})[_0x4926('0x40')](function(_0x5a3bcf){_0x5a3bcf[_0x4926('0x67')](function(_0x1ecf6e){_0x2290db[_0x4926('0x5d')](_0x1ecf6e['id']+0x15b38);});_0x4dd23b(_0x2290db);});}else{return db[_0x4926('0x57')][_0x4926('0x42')]({'where':{'sectionId':_0x5d6aa0['id']},'raw':!![]})['then'](function(_0x5bf140){_0x5bf140[_0x4926('0x67')](function(_0x26c5d3){_0x2290db['push'](_0x26c5d3['resourceId']+0x15b38);});_0x4dd23b(_0x2290db);});}}catch(_0x2d4d46){_0x2c62e7(_0x2d4d46);}});}exports[_0x4926('0x69')]=function(_0x3f2f37,_0x5d1adb){return db['UserProfile'][_0x4926('0x47')]({'where':{'id':_0x3f2f37['params']['id']}})[_0x4926('0x40')](handleEntityNotFound(_0x5d1adb,null))[_0x4926('0x40')](function(_0x182039){if(_0x182039){return db[_0x4926('0x51')]['transaction'](function(_0x12d9a3){return db[_0x4926('0x56')][_0x4926('0x42')]({'where':{'userProfileId':_0x3f2f37[_0x4926('0x4a')]['id']},'attributes':['id'],'raw':!![]})[_0x4926('0x40')](function(_0xa4950e){if(_0xa4950e){return db[_0x4926('0x56')][_0x4926('0x58')]({'where':{'userProfileId':_0x3f2f37['params']['id'],'id':_[_0x4926('0x2b')](_0xa4950e,function(_0x1b78b7){return _0x1b78b7['id'];})},'transaction':_0x12d9a3});}})[_0x4926('0x40')](function(_0x1e7ce2){var _0x5a3146=_[_0x4926('0x2b')](_0x3f2f37[_0x4926('0x4f')],function(_0x3068cb){_0x3068cb['userProfileId']=_0x3f2f37['params']['id'];return _0x3068cb;});return db[_0x4926('0x56')]['bulkCreate'](_0x5a3146,{'raw':!![],'transaction':_0x12d9a3});})[_0x4926('0x40')](function(_0x5d8516){var _0x3a0a1a=_[_0x4926('0x3f')](_[_0x4926('0x2b')](_0x5d8516,function(_0x10072b){return _0x10072b[_0x4926('0x4c')]({'plain':!![]});}),{'includeAll':![]});if(_0x3a0a1a){return db[_0x4926('0x56')][_0x4926('0x42')]({'where':{'userProfileId':_0x3f2f37['params']['id'],'sectionId':_[_0x4926('0x2b')](_0x3a0a1a,function(_0xde230e){return _0xde230e['sectionId'];})},'attributes':['id',_0x4926('0x54')],'raw':!![]})['then'](function(_0x108f2c){var _0x296a0c=_[_0x4926('0x2b')](_0x3f2f37[_0x4926('0x4f')],function(_0x4bfc3a){_0x4bfc3a[_0x4926('0x5c')]=_0x3f2f37[_0x4926('0x4a')]['id'];return _0x4bfc3a;});return db[_0x4926('0x57')][_0x4926('0x6a')](_0x296a0c,{'raw':!![],'transaction':_0x12d9a3});});}})[_0x4926('0x44')](handleError(_0x5d1adb,null));});}})[_0x4926('0x40')](function(_0x574517){var _0x23e99c=_[_0x4926('0x2b')](_0x574517,function(_0x556a78){return _0x556a78['get']({'plain':!![]});});})[_0x4926('0x40')](respondWithResult(_0x5d1adb,null))['catch'](handleError(_0x5d1adb,null));};exports['removeResources']=function(_0xaa7b6d,_0x28309e,_0x23c770){return db[_0x4926('0x2c')]['find']({'where':{'id':_0xaa7b6d[_0x4926('0x4a')]['id']}})['then'](handleEntityNotFound(_0x28309e,null))['then'](function(_0x96341a){if(_0x96341a){return _0x96341a['removeResources'](_0xaa7b6d[_0x4926('0x31')][_0x4926('0x5f')]);}})[_0x4926('0x40')](respondWithStatusCode(_0x28309e,null))[_0x4926('0x44')](handleError(_0x28309e,null));};exports[_0x4926('0x6b')]=function(_0x452fe9,_0x5426b8){var _0x41085d={};if(!_0x452fe9[_0x4926('0x31')][_0x4926('0x6c')])throw new Error(_0x4926('0x6d'));if(!_0x452fe9[_0x4926('0x31')][_0x4926('0x38')](_0x4926('0x39'))){_0x41085d['limit']=qs['limit'](_0x452fe9['query'][_0x4926('0x21')]);_0x41085d[_0x4926('0x1e')]=qs[_0x4926('0x1e')](_0x452fe9[_0x4926('0x31')][_0x4926('0x1e')]);}return db[_0x4926('0x2c')][_0x4926('0x47')]({'where':{'id':_0x452fe9[_0x4926('0x4a')]['id']}})[_0x4926('0x40')](function(_0x2d0387){if(!_0x2d0387)throw new Error(_0x4926('0x6e')+_0x452fe9[_0x4926('0x4a')]['id']);return db['UserProfile']['getResources'](_0x452fe9);})[_0x4926('0x40')](respondWithFilteredResult(_0x5426b8,_0x41085d))[_0x4926('0x44')](handleError(_0x5426b8,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 1407b67..9ed7ef4 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 _0x6eec=['events','../../mysqldb','UserProfile','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x6eec,0x1e0));var _0xc6ee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6eec[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xc6ee('0x0'));var UserProfile=require(_0xc6ee('0x1'))['db'][_0xc6ee('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xc6ee('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc6ee('0x4'),'afterDestroy':_0xc6ee('0x5')};function emitEvent(_0x56475c){return function(_0x63587e,_0x26ee43,_0x41c66b){UserProfileEvents[_0xc6ee('0x6')](_0x56475c+':'+_0x63587e['id'],_0x63587e);UserProfileEvents[_0xc6ee('0x6')](_0x56475c,_0x63587e);_0x41c66b(null);};}for(var e in events){if(events[_0xc6ee('0x7')](e)){var event=events[e];UserProfile[_0xc6ee('0x8')](e,emitEvent(event));}}module[_0xc6ee('0x9')]=UserProfileEvents; \ No newline at end of file +var _0x7278=['hook','exports','events','../../mysqldb','UserProfile','setMaxListeners','save','remove','emit'];(function(_0x37e721,_0x295a79){var _0x1e9a4e=function(_0x1c6ab6){while(--_0x1c6ab6){_0x37e721['push'](_0x37e721['shift']());}};_0x1e9a4e(++_0x295a79);}(_0x7278,0x161));var _0x8727=function(_0x5bbbcc,_0x45d919){_0x5bbbcc=_0x5bbbcc-0x0;var _0x165579=_0x7278[_0x5bbbcc];return _0x165579;};'use strict';var EventEmitter=require(_0x8727('0x0'));var UserProfile=require(_0x8727('0x1'))['db'][_0x8727('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x8727('0x3')](0x0);var events={'afterCreate':_0x8727('0x4'),'afterUpdate':'update','afterDestroy':_0x8727('0x5')};function emitEvent(_0x19c8ac){return function(_0x6007de,_0x221021,_0x2df052){UserProfileEvents[_0x8727('0x6')](_0x19c8ac+':'+_0x6007de['id'],_0x6007de);UserProfileEvents[_0x8727('0x6')](_0x19c8ac,_0x6007de);_0x2df052(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x8727('0x7')](e,emitEvent(event));}}module[_0x8727('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 77fb64f..0fbdab5 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 _0x4991=['ui.UserId\x20=\x20?','sequelize','toString','OpenTabs','UserProfile','user_profiles','query','raw','section','isEmpty','push','params','ignore','union','length','find','autoAssociation','all','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','key','VIRTUAL','foreignKey','forEach','merge','options','includeAll','include','reportType','DefaultReports','custom','CustomReports','count','rows','ids','Tags','color','ThroughTags','tag','openTabs','true','chat','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','../../components/parsers/qs','exports','models','filter','field','value','findAll','then','associatedResources','map','model','name','catch','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareRecording','parentSections','SquareProjects','projects','CmContact','Lists','ListId','lists','companies','CmCompany','CmCustomField','ChatQueue','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','role','agent','Telephones','telephone','VoiceQueue','inbound','QueueCampaigns','queue','outbound','musiconholds','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','whatsappqueues','whatsappaccounts','Team','voicequeues','VoiceQueues','users','agents','telephones','Users','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','SugarcrmAccount','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','tags','Tag','Template','triggers','Trunk','Variable','plugins','reportId','AnalyticMetric','toUpperCase','slice','Sequelize','SELECT','ui.','InteractionId','ui.createdAt','from','user_has_','where'];(function(_0x17406e,_0x1049fd){var _0x2bfc5a=function(_0x2aae05){while(--_0x2aae05){_0x17406e['push'](_0x17406e['shift']());}};_0x2bfc5a(++_0x1049fd);}(_0x4991,0xf7));var _0x1499=function(_0x2bf568,_0x1c58a7){_0x2bf568=_0x2bf568-0x0;var _0x4dc9c9=_0x4991[_0x2bf568];return _0x4dc9c9;};'use strict';var _=require(_0x1499('0x0'));var attributes=require('./userProfile.attributes');var qs=require(_0x1499('0x1'));var squel=require('squel');module[_0x1499('0x2')]=function(_0x256e41){var _0x16ac22=_0x256e41[_0x1499('0x3')];function _0x1b291f(_0x158134,_0x19adff){return new Promise(function(_0x209616,_0x4b6154){if(!_0x19adff)return _0x209616(null);var _0x2a8e96=_0x19adff[_0x1499('0x4')]?{[_0x19adff[_0x1499('0x4')][_0x1499('0x5')]]:_0x19adff[_0x1499('0x4')][_0x1499('0x6')]}:undefined;return _0x16ac22[_0x158134][_0x1499('0x7')]({'where':_0x2a8e96,'raw':!![]})[_0x1499('0x8')](function(_0x48d2ca){_0x19adff[_0x1499('0x9')]=_[_0x1499('0xa')](_0x48d2ca,'id');_0x209616(_0x19adff);})['catch'](function(_0x2a4816){_0x4b6154(_0x2a4816);});});}function _0x352180(_0x4c2bd2,_0x4407c2){return new Promise(function(_0x2867b1,_0x5de9a2){var _0x4ab173=_0x4c2bd2['filter']?{[_0x4c2bd2[_0x1499('0x4')][_0x1499('0x5')]]:_0x4c2bd2[_0x1499('0x4')][_0x1499('0x6')]}:undefined;return _0x16ac22[_0x4c2bd2[_0x1499('0xb')]]['findAll']({'where':_0x4ab173,'raw':!![]})['then'](function(_0x308177){_0x4407c2['associatedResources']=_[_0x1499('0xa')](_0x308177,function(_0x12cde0){return _0x12cde0[_0x1499('0xc')];});_0x2867b1(_0x4407c2);})[_0x1499('0xd')](function(_0x48f654){_0x5de9a2(_0x48f654);});});}function _0x1ed43b(_0x373f57,_0x592c27,_0x25164c){if(!_0x592c27)return Promise[_0x1499('0xe')](null);return new Promise(function(_0x46b364,_0xc92272){return _0x16ac22[_0x1499('0xf')][_0x1499('0x7')]({'where':{'sectionId':_0x592c27['id']},'raw':!![]})['then'](function(_0x541477){if(_0x373f57['field']&&_0x373f57[_0x1499('0x5')]!=='id'){_0x592c27[_0x1499('0x9')]=_['map'](_0x541477,function(_0x351da9){return _0x351da9[_0x373f57[_0x1499('0x5')]];});}else{if(_0x25164c===_0x1499('0x10')){_0x592c27[_0x1499('0x9')]=_[_0x1499('0xa')](_0x541477,function(_0x2911ab){return{'id':_0x2911ab[_0x1499('0x11')],'type':_0x2911ab[_0x1499('0x12')]};});}else{_0x592c27[_0x1499('0x9')]=_[_0x1499('0xa')](_0x541477,function(_0x2bb71f){return _0x2bb71f[_0x1499('0x11')];});}}_0x46b364(_0x592c27);})[_0x1499('0xd')](function(_0x3b73f6){_0xc92272(_0x3b73f6);});});}function _0x4ec57a(_0x1e2c51,_0x2c7f57){var _0x5615b4={'parentSections':[]};switch(_0x1e2c51[_0x1499('0x13')]()){case _0x1499('0x14'):_0x5615b4[_0x1499('0x15')]=_0x1499('0x16');break;case _0x1499('0x17'):_0x5615b4[_0x1499('0x15')]='SquareOdbc';break;case'squarerecordings':_0x5615b4[_0x1499('0x15')]=_0x1499('0x18');_0x5615b4[_0x1499('0x19')]=[{'name':_0x1499('0x1a'),'field':_0x1499('0xc'),'foreignKey':'projectName'}];break;case _0x1499('0x1b'):_0x5615b4['childModel']='JscriptyProject';break;case'contacts':_0x5615b4[_0x1499('0x15')]=_0x1499('0x1c');_0x5615b4[_0x1499('0x19')]=[{'name':_0x1499('0x1d'),'field':'id','foreignKey':_0x1499('0x1e')}];break;case _0x1499('0x1f'):_0x5615b4[_0x1499('0x15')]='CmList';break;case _0x1499('0x20'):_0x5615b4[_0x1499('0x15')]=_0x1499('0x21');break;case'globalcustomfields':_0x5615b4[_0x1499('0x15')]=_0x1499('0x22');break;case'chatqueues':_0x5615b4[_0x1499('0x15')]=_0x1499('0x23');break;case'chatwebsites':_0x5615b4[_0x1499('0x15')]=_0x1499('0x24');break;case _0x1499('0x25'):_0x5615b4[_0x1499('0x15')]=_0x1499('0x26');break;case _0x1499('0x27'):_0x5615b4[_0x1499('0x15')]=_0x1499('0x28');break;case _0x1499('0x29'):case _0x1499('0x2a'):case _0x1499('0x2b'):_0x5615b4[_0x1499('0x15')]=_0x1499('0x2c');break;case _0x1499('0x2d'):_0x5615b4[_0x1499('0x15')]=_0x1499('0x2e');break;case _0x1499('0x2f'):_0x5615b4[_0x1499('0x15')]=_0x1499('0x30');break;case _0x1499('0x31'):_0x5615b4['childModel']=_0x1499('0x32');_0x5615b4[_0x1499('0x19')]=[{'name':_0x1499('0x33'),'field':_0x1499('0xc'),'foreignKey':_0x1499('0x34'),'model':_0x1499('0x35'),'filter':{'field':_0x1499('0x36'),'value':[_0x1499('0x37')]}},{'name':_0x1499('0x38'),'field':_0x1499('0xc'),'foreignKey':_0x1499('0x34'),'model':'User','filter':{'field':'role','value':[_0x1499('0x39')]}},{'name':'VoiceQueues','field':_0x1499('0xc'),'foreignKey':'queue','model':_0x1499('0x3a'),'filter':{'field':_0x1499('0x12'),'value':[_0x1499('0x3b')]}},{'name':_0x1499('0x3c'),'field':'name','foreignKey':_0x1499('0x3d'),'model':'VoiceQueue','filter':{'field':_0x1499('0x12'),'value':[_0x1499('0x3e')]}}];break;case _0x1499('0x3f'):_0x5615b4[_0x1499('0x15')]='VoiceMusicOnHold';break;case _0x1499('0x40'):_0x5615b4[_0x1499('0x15')]=_0x1499('0x41');break;case _0x1499('0x42'):_0x5615b4['childModel']=_0x1499('0x43');break;case'ivrcampaigns':_0x5615b4[_0x1499('0x15')]=_0x1499('0x44');break;case _0x1499('0x45'):_0x5615b4[_0x1499('0x15')]=_0x1499('0x46');break;case _0x1499('0x47'):_0x5615b4[_0x1499('0x15')]=_0x1499('0x48');break;case _0x1499('0x49'):_0x5615b4[_0x1499('0x15')]='MailSubstatus';break;case _0x1499('0x4a'):_0x5615b4['childModel']=_0x1499('0x4b');break;case _0x1499('0x4c'):_0x5615b4['childModel']=_0x1499('0x4d');break;case _0x1499('0x4e'):_0x5615b4[_0x1499('0x15')]=_0x1499('0x4f');break;case _0x1499('0x50'):_0x5615b4['childModel']='SmsAccount';break;case _0x1499('0x51'):_0x5615b4[_0x1499('0x15')]='WhatsappQueue';break;case _0x1499('0x52'):_0x5615b4[_0x1499('0x15')]='WhatsappAccount';break;case'teams':_0x5615b4[_0x1499('0x15')]=_0x1499('0x53');break;case _0x1499('0x54'):case'queuecampaigns':_0x5615b4[_0x1499('0x15')]=_0x1499('0x3a');if(_0x2c7f57){_0x5615b4[_0x1499('0x19')]=[{'name':_0x1499('0x55')},{'name':'QueueCampaigns'}];}break;case _0x1499('0x56'):case _0x1499('0x57'):case _0x1499('0x58'):_0x5615b4[_0x1499('0x15')]='User';if(_0x2c7f57){_0x5615b4[_0x1499('0x19')]=[{'name':_0x1499('0x59'),'filter':{'field':_0x1499('0x36'),'value':['admin','user']},'ignore':!![]},{'name':_0x1499('0x33')},{'name':'Telephones'}];}break;case _0x1499('0x5a'):_0x5615b4[_0x1499('0x15')]=_0x1499('0x5b');break;case _0x1499('0x5c'):_0x5615b4[_0x1499('0x15')]=_0x1499('0x5d');break;case _0x1499('0x5e'):_0x5615b4['childModel']=_0x1499('0x5f');break;case'sugarcrmaccounts':_0x5615b4[_0x1499('0x15')]=_0x1499('0x60');break;case'deskaccounts':_0x5615b4[_0x1499('0x15')]=_0x1499('0x61');break;case _0x1499('0x62'):_0x5615b4['childModel']=_0x1499('0x63');break;case _0x1499('0x64'):_0x5615b4[_0x1499('0x15')]=_0x1499('0x35');break;case _0x1499('0x65'):_0x5615b4[_0x1499('0x15')]=_0x1499('0x66');break;case _0x1499('0x67'):_0x5615b4[_0x1499('0x15')]=_0x1499('0x68');break;case'customdashboards':_0x5615b4[_0x1499('0x15')]=_0x1499('0x69');break;case _0x1499('0x6a'):_0x5615b4['childModel']=_0x1499('0x6b');break;case _0x1499('0x6c'):_0x5615b4['childModel']=_0x1499('0x6d');break;case _0x1499('0x6e'):_0x5615b4['childModel']=_0x1499('0x6f');break;case _0x1499('0x70'):_0x5615b4[_0x1499('0x15')]=_0x1499('0x71');break;case _0x1499('0x72'):_0x5615b4[_0x1499('0x15')]=_0x1499('0x73');break;case'templates':_0x5615b4[_0x1499('0x15')]=_0x1499('0x74');break;case _0x1499('0x75'):_0x5615b4[_0x1499('0x15')]='Trigger';break;case'trunks':_0x5615b4[_0x1499('0x15')]=_0x1499('0x76');break;case'variables':_0x5615b4[_0x1499('0x15')]=_0x1499('0x77');break;case _0x1499('0x78'):_0x5615b4['childModel']='Plugin';break;case'extractedreports':_0x5615b4[_0x1499('0x15')]=_0x1499('0x10');_0x5615b4[_0x1499('0x19')]=[{'name':'Reports','field':'id','foreignKey':_0x1499('0x79')}];break;case'metrics':_0x5615b4[_0x1499('0x15')]=_0x1499('0x7a');break;}return _0x5615b4;}function _0x2fc6f9(_0x16ef45,_0x573552){var _0x53a9da=_0x16ef45['charAt'](0x0)[_0x1499('0x7b')]()+_0x16ef45[_0x1499('0x7c')](0x1);var _0x1e9261={'type':_0x16ac22[_0x1499('0x7d')]['QueryTypes'][_0x1499('0x7e')],'raw':!![]};return new Promise(function(_0x2ecfc5,_0x517f15){var _0x11f55a=squel['select']()[_0x1499('0x5')](_0x1499('0x7f')+_0x53a9da+_0x1499('0x80'),'id')['field'](_0x1499('0x81'))[_0x1499('0x82')](_0x1499('0x83')+_0x16ef45+'_interactions','ui')[_0x1499('0x84')](_0x1499('0x85'),_0x573552['id']);return _0x16ac22[_0x1499('0x86')]['query'](_0x11f55a[_0x1499('0x87')](),_0x1e9261)[_0x1499('0x8')](function(_0x217399){_0x573552[_0x53a9da+_0x1499('0x88')]=_0x217399;_0x2ecfc5(_0x217399);})[_0x1499('0xd')](function(_0x96a0ed){_0x517f15(_0x96a0ed);});});}return _0x256e41['define'](_0x1499('0x89'),attributes,{'tableName':_0x1499('0x8a'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x4d6165){var _0x3839da={'raw':_0x4d6165[_0x1499('0x8b')][_0x1499('0x8c')],'where':{}};var _0x1eba4e={};var _0x46b626={'count':0x0,'rows':[]};var _0x34436f=_0x4d6165['query'][_0x1499('0x8d')];var _0x3bd8c9=_0x4d6165[_0x1499('0x8b')]['mergeResources']||![];var _0x1ff29d=_0x4ec57a(_0x34436f,_0x3bd8c9);if(!_0x1ff29d[_0x1499('0x15')])throw new Error('Invalid\x20section\x20\x27'+_0x34436f+'\x27');var _0x2e42a7=[{'name':_0x34436f}];if(!_[_0x1499('0x8e')](_0x1ff29d[_0x1499('0x19')]))_0x2e42a7=_0x1ff29d[_0x1499('0x19')];var _0x2daf06=[];for(var _0x583ea1=0x0;_0x583ea1<_0x2e42a7['length'];_0x583ea1++){_0x2daf06[_0x1499('0x8f')](_0x16ac22['UserProfileSection']['find']({'where':{'userProfileId':_0x4d6165[_0x1499('0x90')]['id'],'name':_0x2e42a7[_0x583ea1][_0x1499('0xc')]},'raw':!![]}));}return Promise['all'](_0x2daf06)[_0x1499('0x8')](function(_0x41a528){var _0x3da29f=_['filter'](_0x41a528,function(_0x4c89c7){return _0x4c89c7?_0x4c89c7:undefined;});var _0x1cc8d1=_[_0x1499('0x4')](_0x2e42a7,[_0x1499('0x91'),!![]]);var _0x392f6f=_[_0x1499('0x8e')](_0x3da29f)&&_['isEmpty'](_0x1cc8d1)?null:_[_0x1499('0x92')](_0x1cc8d1,_0x3da29f);if(!_0x392f6f)return null;var _0x31958d=[];for(var _0x57bb71=0x0;_0x57bb71<_0x392f6f[_0x1499('0x93')];_0x57bb71++){var _0x20e5f3=_[_0x1499('0x94')](_0x2e42a7,function(_0x5741e5){return _0x392f6f[_0x57bb71]?_0x5741e5[_0x1499('0xc')]===_0x392f6f[_0x57bb71][_0x1499('0xc')]:null;});if(_0x20e5f3){if(_0x392f6f[_0x57bb71][_0x1499('0x91')]){_0x31958d[_0x1499('0x8f')](_0x1b291f(_0x1ff29d['childModel'],_0x392f6f[_0x57bb71]));}else{if(!_0x392f6f[_0x57bb71][_0x1499('0x95')]){_0x31958d[_0x1499('0x8f')](_0x1ed43b(_0x20e5f3,_0x392f6f[_0x57bb71],_0x1ff29d[_0x1499('0x15')]));}else{if(_0x20e5f3['model']){_0x31958d[_0x1499('0x8f')](_0x352180(_0x20e5f3,_0x392f6f[_0x57bb71]));}}}}}return Promise[_0x1499('0x96')](_0x31958d);})[_0x1499('0x8')](function(_0x1f9d15){var _0x199516=_0x1f9d15;var _0x2e6136=null;if(_0x199516){_0x2e6136=_0x199516['length']===0x1?_0x199516[0x0]:null;}if(!_0x2e6136&&!_0x199516)return _0x46b626;var _0x2e8461=_0x16ac22[_0x1ff29d['childModel']]['rawAttributes'];_0x1eba4e[_0x1499('0xb')]=_[_0x1499('0x97')](_0x2e8461);_0x1eba4e[_0x1499('0x8b')]=_['keys'](_0x4d6165['query']);_0x1eba4e[_0x1499('0x98')]=_[_0x1499('0x99')](_0x1eba4e['model'],_0x1eba4e[_0x1499('0x8b')]);_0x3839da[_0x1499('0x9a')]=_[_0x1499('0x99')](_0x1eba4e[_0x1499('0xb')],qs[_0x1499('0x9b')](_0x4d6165[_0x1499('0x8b')][_0x1499('0x9b')]));_0x3839da['attributes']=_0x3839da[_0x1499('0x9a')][_0x1499('0x93')]?_0x3839da['attributes']:_0x1eba4e[_0x1499('0xb')];if(!_0x4d6165['query'][_0x1499('0x9c')](_0x1499('0x9d'))){_0x3839da[_0x1499('0x9e')]=qs[_0x1499('0x9e')](_0x4d6165['query'][_0x1499('0x9e')]);_0x3839da['offset']=qs[_0x1499('0x9f')](_0x4d6165['query'][_0x1499('0x9f')]);}_0x3839da[_0x1499('0xa0')]=qs[_0x1499('0xa1')](_0x4d6165['query'][_0x1499('0xa1')]);_0x3839da[_0x1499('0x84')]=qs['filters'](_['pick'](_0x4d6165[_0x1499('0x8b')],_0x1eba4e['filters']));if(_0x4d6165[_0x1499('0x8b')]['filter']){_0x3839da[_0x1499('0x84')]=_['merge'](_0x3839da[_0x1499('0x84')],{'$or':_[_0x1499('0xa')](_0x2e8461,function(_0x6304f3){if(_0x6304f3[_0x1499('0x12')][_0x1499('0xa2')]!==_0x1499('0xa3')){var _0x114aea={};_0x114aea[_0x6304f3[_0x1499('0x5')]]={'$like':'%'+_0x4d6165['query'][_0x1499('0x4')]+'%'};return _0x114aea;}})});}var _0x31e7ae=[];var _0x3c5fa2=null;var _0x57d194={};if(_0x2e6136){_0x3c5fa2=_[_0x1499('0x94')](_0x2e42a7,[_0x1499('0xc'),_0x2e6136['name']]);if(_0x3c5fa2[_0x1499('0x5')]){_0x57d194={};if(_0x1ff29d[_0x1499('0x15')]===_0x1499('0x10')){_0x57d194[_0x3c5fa2[_0x1499('0xa4')]]=_[_0x1499('0xa')](_0x2e6136['associatedResources'],'id');}else{_0x57d194[_0x3c5fa2[_0x1499('0xa4')]]=_0x2e6136['associatedResources'];}_0x31e7ae['push'](_0x57d194);}else{_0x3839da[_0x1499('0x84')]['id']=_0x2e6136[_0x1499('0x9')];}}else{for(var _0x362d8c=0x0;_0x362d8c<_0x199516[_0x1499('0x93')];_0x362d8c++){_0x3c5fa2=_[_0x1499('0x94')](_0x2e42a7,[_0x1499('0xc'),_0x199516[_0x362d8c][_0x1499('0xc')]]);if(_0x3c5fa2['field']){_0x57d194={};_0x57d194[_0x3c5fa2['foreignKey']]=_0x199516[_0x362d8c][_0x1499('0x9')];_0x31e7ae[_0x1499('0x8f')](_0x57d194);}else{if(!_0x3839da['where']['id'])_0x3839da[_0x1499('0x84')]['id']=[];_0x199516[_0x362d8c]['associatedResources'][_0x1499('0xa5')](function(_0x4d2dee){_0x3839da[_0x1499('0x84')]['id']['push'](_0x4d2dee);});}}}if(!_[_0x1499('0x8e')](_0x31e7ae)){_0x3839da['where']=_[_0x1499('0xa6')](_0x3839da[_0x1499('0x84')],{'$and':{'$or':_0x31e7ae}});}_0x3839da=_['merge']({},_0x3839da,_0x4d6165[_0x1499('0xa7')]);if(_0x2e6136&&!_0x2e6136[_0x1499('0x95')]&&_0x1ff29d['childModel']===_0x1499('0x10')){if(_0x4d6165[_0x1499('0x8b')][_0x1499('0xa8')]){_0x3839da[_0x1499('0xa9')]=[{'all':!![]}];}return _0x16ac22[_0x1ff29d[_0x1499('0x15')]][_0x1499('0x7')](_0x3839da)[_0x1499('0x8')](function(_0x5e95ca){var _0x25c8b9=[];_0x5e95ca[_0x1499('0xa5')](function(_0x5180f6){var _0x2c8382;switch(_0x5180f6[_0x1499('0xaa')]){case'default':_0x2c8382=_[_0x1499('0x94')](_0x2e6136[_0x1499('0x9')],function(_0x4b4fbf){return _0x4b4fbf['id']===_0x5180f6[_0x1499('0x79')]&&_0x4b4fbf[_0x1499('0x12')]===_0x1499('0xab');});break;case _0x1499('0xac'):_0x2c8382=_[_0x1499('0x94')](_0x2e6136[_0x1499('0x9')],function(_0x1f4794){return _0x1f4794['id']===_0x5180f6[_0x1499('0x79')]&&_0x1f4794['type']===_0x1499('0xad');});break;}if(_0x2c8382)_0x25c8b9[_0x1499('0x8f')](_0x5180f6);});_0x46b626[_0x1499('0xae')]=_0x25c8b9[_0x1499('0x93')];_0x46b626[_0x1499('0xaf')]=_0x25c8b9;return _0x46b626;});}else{if(!_[_0x1499('0x8e')](_0x4d6165['query']['ids'])){_0x3839da['where']['id']=_0x3839da[_0x1499('0x84')]['id']?_[_0x1499('0x99')](_0x3839da[_0x1499('0x84')]['id'],_0x4d6165[_0x1499('0x8b')][_0x1499('0xb0')]):_0x4d6165[_0x1499('0x8b')][_0x1499('0xb0')];}return _0x16ac22[_0x1ff29d[_0x1499('0x15')]]['count']({'where':_0x3839da[_0x1499('0x84')]})[_0x1499('0x8')](function(_0x59a12f){_0x46b626['count']=_0x59a12f;if(_0x4d6165[_0x1499('0x8b')]['includeAll']){if(_0x1ff29d['childModel']==='CmContact'){_0x3839da[_0x1499('0xa9')]=[{'model':_0x16ac22[_0x1499('0x73')],'as':_0x1499('0xb1'),'attributes':['id',_0x1499('0xc'),_0x1499('0xb2')],'required':_0x4d6165['query']['tag']?!![]:![]},{'model':_0x16ac22[_0x1499('0x73')],'as':_0x1499('0xb3'),'attributes':['id',_0x1499('0xc'),'color'],'through':_0x4d6165[_0x1499('0x8b')]['tag']?{'attributes':[],'where':{'TagId':_0x4d6165['query'][_0x1499('0xb4')]||undefined}}:{},'required':_0x4d6165['query'][_0x1499('0xb4')]?!![]:![]}];}else{_0x3839da['include']=[{'all':!![]}];}}return _0x16ac22[_0x1ff29d[_0x1499('0x15')]]['findAll'](_0x3839da);})[_0x1499('0x8')](function(_0x100a24){_0x46b626['rows']=_0x100a24;if(_0x34436f===_0x1499('0x33')&&_0x4d6165['query'][_0x1499('0xb5')]===_0x1499('0xb6')){var _0x186e4d=[];for(var _0x17cb37=0x0;_0x17cb37<_0x46b626[_0x1499('0xaf')][_0x1499('0x93')];_0x17cb37++){_0x186e4d[_0x1499('0x8f')](_0x2fc6f9(_0x1499('0xb7'),_0x46b626[_0x1499('0xaf')][_0x17cb37][_0x1499('0xb8')]));_0x186e4d[_0x1499('0x8f')](_0x2fc6f9(_0x1499('0xb9'),_0x46b626[_0x1499('0xaf')][_0x17cb37]['dataValues']));_0x186e4d[_0x1499('0x8f')](_0x2fc6f9(_0x1499('0xba'),_0x46b626[_0x1499('0xaf')][_0x17cb37][_0x1499('0xb8')]));_0x186e4d['push'](_0x2fc6f9(_0x1499('0xbb'),_0x46b626[_0x1499('0xaf')][_0x17cb37]['dataValues']));_0x186e4d['push'](_0x2fc6f9(_0x1499('0xbc'),_0x46b626[_0x1499('0xaf')][_0x17cb37][_0x1499('0xb8')]));_0x186e4d[_0x1499('0x8f')](_0x2fc6f9(_0x1499('0xbd'),_0x46b626[_0x1499('0xaf')][_0x17cb37][_0x1499('0xb8')]));}return Promise[_0x1499('0x96')](_0x186e4d)[_0x1499('0x8')](function(){return _0x46b626;});}return _0x46b626;});}});}}});}; \ No newline at end of file +var _0x3423=['keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','pick','merge','VIRTUAL','foreignKey','forEach','options','includeAll','DefaultReports','custom','rows','ids','count','Tags','color','tag','include','openTabs','true','chat','dataValues','mail','openchannel','whatsapp','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','then','map','model','associatedResources','name','catch','resolve','UserProfileResource','resourceId','type','toLowerCase','childModel','parentSections','projects','JscriptyProject','CmContact','Lists','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','ChatQueue','ChatWebsite','faxqueues','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','voicerecordings','VoiceRecording','Agents','membername','User','role','Telephones','VoiceQueues','queue','VoiceQueue','inbound','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailAccount','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','whatsappaccounts','WhatsappAccount','teams','Team','queuecampaigns','QueueCampaigns','agents','telephones','Users','user','zendeskaccounts','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','deskaccounts','DeskAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','intervals','Interval','pauses','scheduler','Schedule','sounds','Sound','tags','Tag','triggers','Trunk','variables','Variable','plugins','Plugin','extractedreports','AnalyticExtractedReport','metrics','AnalyticMetric','charAt','Sequelize','SELECT','select','ui.','InteractionId','ui.createdAt','from','where','sequelize','query','toString','UserProfile','user_profiles','raw','section','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','params','all','ignore','union','autoAssociation','rawAttributes'];(function(_0x2cae1f,_0x40d675){var _0x3c7233=function(_0x35ca27){while(--_0x35ca27){_0x2cae1f['push'](_0x2cae1f['shift']());}};_0x3c7233(++_0x40d675);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var attributes=require('./userProfile.attributes');var qs=require(_0x3342('0x0'));var squel=require(_0x3342('0x1'));module[_0x3342('0x2')]=function(_0x3b763d){var _0x21bdc2=_0x3b763d[_0x3342('0x3')];function _0x2207ce(_0x3c5d8d,_0x3075f8){return new Promise(function(_0x19206f,_0x467453){if(!_0x3075f8)return _0x19206f(null);var _0x2ccbe0=_0x3075f8[_0x3342('0x4')]?{[_0x3075f8[_0x3342('0x4')][_0x3342('0x5')]]:_0x3075f8[_0x3342('0x4')][_0x3342('0x6')]}:undefined;return _0x21bdc2[_0x3c5d8d][_0x3342('0x7')]({'where':_0x2ccbe0,'raw':!![]})[_0x3342('0x8')](function(_0x4ae4f3){_0x3075f8['associatedResources']=_[_0x3342('0x9')](_0x4ae4f3,'id');_0x19206f(_0x3075f8);})['catch'](function(_0x5a1fba){_0x467453(_0x5a1fba);});});}function _0x51b276(_0x4f85e3,_0xb11eb9){return new Promise(function(_0x2f3c47,_0x51496d){var _0x2d14c4=_0x4f85e3['filter']?{[_0x4f85e3[_0x3342('0x4')][_0x3342('0x5')]]:_0x4f85e3['filter'][_0x3342('0x6')]}:undefined;return _0x21bdc2[_0x4f85e3[_0x3342('0xa')]][_0x3342('0x7')]({'where':_0x2d14c4,'raw':!![]})[_0x3342('0x8')](function(_0x61fcc0){_0xb11eb9[_0x3342('0xb')]=_[_0x3342('0x9')](_0x61fcc0,function(_0x59be1d){return _0x59be1d[_0x3342('0xc')];});_0x2f3c47(_0xb11eb9);})[_0x3342('0xd')](function(_0x49afe3){_0x51496d(_0x49afe3);});});}function _0x40d609(_0x2c9df0,_0x51ef91,_0x554f9c){if(!_0x51ef91)return Promise[_0x3342('0xe')](null);return new Promise(function(_0x143cf1,_0x6949fc){return _0x21bdc2[_0x3342('0xf')][_0x3342('0x7')]({'where':{'sectionId':_0x51ef91['id']},'raw':!![]})[_0x3342('0x8')](function(_0x45a3ca){if(_0x2c9df0[_0x3342('0x5')]&&_0x2c9df0[_0x3342('0x5')]!=='id'){_0x51ef91['associatedResources']=_[_0x3342('0x9')](_0x45a3ca,function(_0xda235a){return _0xda235a[_0x2c9df0[_0x3342('0x5')]];});}else{if(_0x554f9c==='AnalyticExtractedReport'){_0x51ef91[_0x3342('0xb')]=_[_0x3342('0x9')](_0x45a3ca,function(_0x52f7b7){return{'id':_0x52f7b7[_0x3342('0x10')],'type':_0x52f7b7[_0x3342('0x11')]};});}else{_0x51ef91['associatedResources']=_[_0x3342('0x9')](_0x45a3ca,function(_0x5a0658){return _0x5a0658[_0x3342('0x10')];});}}_0x143cf1(_0x51ef91);})[_0x3342('0xd')](function(_0xa23053){_0x6949fc(_0xa23053);});});}function _0x2dbad1(_0xd2b87d,_0x2925a2){var _0x26eb87={'parentSections':[]};switch(_0xd2b87d[_0x3342('0x12')]()){case'squareprojects':_0x26eb87[_0x3342('0x13')]='SquareProject';break;case'odbc':_0x26eb87[_0x3342('0x13')]='SquareOdbc';break;case'squarerecordings':_0x26eb87[_0x3342('0x13')]='SquareRecording';_0x26eb87[_0x3342('0x14')]=[{'name':'SquareProjects','field':'name','foreignKey':'projectName'}];break;case _0x3342('0x15'):_0x26eb87[_0x3342('0x13')]=_0x3342('0x16');break;case'contacts':_0x26eb87[_0x3342('0x13')]=_0x3342('0x17');_0x26eb87[_0x3342('0x14')]=[{'name':_0x3342('0x18'),'field':'id','foreignKey':'ListId'}];break;case _0x3342('0x19'):_0x26eb87[_0x3342('0x13')]=_0x3342('0x1a');break;case _0x3342('0x1b'):_0x26eb87[_0x3342('0x13')]=_0x3342('0x1c');break;case _0x3342('0x1d'):_0x26eb87['childModel']=_0x3342('0x1e');break;case'chatqueues':_0x26eb87[_0x3342('0x13')]=_0x3342('0x1f');break;case'chatwebsites':_0x26eb87[_0x3342('0x13')]=_0x3342('0x20');break;case _0x3342('0x21'):_0x26eb87[_0x3342('0x13')]='FaxQueue';break;case _0x3342('0x22'):_0x26eb87[_0x3342('0x13')]=_0x3342('0x23');break;case _0x3342('0x24'):case _0x3342('0x25'):case _0x3342('0x26'):_0x26eb87[_0x3342('0x13')]=_0x3342('0x27');break;case _0x3342('0x28'):_0x26eb87[_0x3342('0x13')]=_0x3342('0x29');break;case _0x3342('0x2a'):_0x26eb87['childModel']='VoiceMail';break;case _0x3342('0x2b'):_0x26eb87['childModel']=_0x3342('0x2c');_0x26eb87[_0x3342('0x14')]=[{'name':_0x3342('0x2d'),'field':_0x3342('0xc'),'foreignKey':_0x3342('0x2e'),'model':_0x3342('0x2f'),'filter':{'field':_0x3342('0x30'),'value':['agent']}},{'name':_0x3342('0x31'),'field':_0x3342('0xc'),'foreignKey':_0x3342('0x2e'),'model':_0x3342('0x2f'),'filter':{'field':_0x3342('0x30'),'value':['telephone']}},{'name':_0x3342('0x32'),'field':'name','foreignKey':_0x3342('0x33'),'model':_0x3342('0x34'),'filter':{'field':_0x3342('0x11'),'value':[_0x3342('0x35')]}},{'name':'QueueCampaigns','field':_0x3342('0xc'),'foreignKey':'queue','model':_0x3342('0x34'),'filter':{'field':_0x3342('0x11'),'value':[_0x3342('0x36')]}}];break;case _0x3342('0x37'):_0x26eb87[_0x3342('0x13')]=_0x3342('0x38');break;case _0x3342('0x39'):_0x26eb87['childModel']=_0x3342('0x3a');break;case _0x3342('0x3b'):_0x26eb87['childModel']=_0x3342('0x3c');break;case _0x3342('0x3d'):_0x26eb87['childModel']=_0x3342('0x3e');break;case _0x3342('0x3f'):_0x26eb87['childModel']='MailQueue';break;case'mailaccounts':_0x26eb87[_0x3342('0x13')]=_0x3342('0x40');break;case'mailsubstatuses':_0x26eb87[_0x3342('0x13')]=_0x3342('0x41');break;case _0x3342('0x42'):_0x26eb87[_0x3342('0x13')]=_0x3342('0x43');break;case _0x3342('0x44'):_0x26eb87[_0x3342('0x13')]=_0x3342('0x45');break;case'smsqueues':_0x26eb87['childModel']=_0x3342('0x46');break;case _0x3342('0x47'):_0x26eb87[_0x3342('0x13')]=_0x3342('0x48');break;case _0x3342('0x49'):_0x26eb87[_0x3342('0x13')]='WhatsappQueue';break;case _0x3342('0x4a'):_0x26eb87[_0x3342('0x13')]=_0x3342('0x4b');break;case _0x3342('0x4c'):_0x26eb87[_0x3342('0x13')]=_0x3342('0x4d');break;case'voicequeues':case _0x3342('0x4e'):_0x26eb87['childModel']=_0x3342('0x34');if(_0x2925a2){_0x26eb87[_0x3342('0x14')]=[{'name':_0x3342('0x32')},{'name':_0x3342('0x4f')}];}break;case'users':case _0x3342('0x50'):case _0x3342('0x51'):_0x26eb87['childModel']=_0x3342('0x2f');if(_0x2925a2){_0x26eb87[_0x3342('0x14')]=[{'name':_0x3342('0x52'),'filter':{'field':_0x3342('0x30'),'value':['admin',_0x3342('0x53')]},'ignore':!![]},{'name':_0x3342('0x2d')},{'name':'Telephones'}];}break;case _0x3342('0x54'):_0x26eb87['childModel']='ZendeskAccount';break;case _0x3342('0x55'):_0x26eb87[_0x3342('0x13')]=_0x3342('0x56');break;case _0x3342('0x57'):_0x26eb87[_0x3342('0x13')]=_0x3342('0x58');break;case _0x3342('0x59'):_0x26eb87['childModel']='SugarcrmAccount';break;case _0x3342('0x5a'):_0x26eb87['childModel']=_0x3342('0x5b');break;case'zohoaccounts':_0x26eb87['childModel']='ZohoAccount';break;case _0x3342('0x5c'):_0x26eb87[_0x3342('0x13')]=_0x3342('0x2f');break;case _0x3342('0x5d'):_0x26eb87['childModel']=_0x3342('0x5e');break;case _0x3342('0x5f'):_0x26eb87['childModel']=_0x3342('0x60');break;case _0x3342('0x61'):_0x26eb87[_0x3342('0x13')]='Dashboard';break;case _0x3342('0x62'):_0x26eb87[_0x3342('0x13')]=_0x3342('0x63');break;case _0x3342('0x64'):_0x26eb87[_0x3342('0x13')]='Pause';break;case _0x3342('0x65'):_0x26eb87[_0x3342('0x13')]=_0x3342('0x66');break;case _0x3342('0x67'):_0x26eb87[_0x3342('0x13')]=_0x3342('0x68');break;case _0x3342('0x69'):_0x26eb87[_0x3342('0x13')]=_0x3342('0x6a');break;case'templates':_0x26eb87[_0x3342('0x13')]='Template';break;case _0x3342('0x6b'):_0x26eb87['childModel']='Trigger';break;case'trunks':_0x26eb87['childModel']=_0x3342('0x6c');break;case _0x3342('0x6d'):_0x26eb87[_0x3342('0x13')]=_0x3342('0x6e');break;case _0x3342('0x6f'):_0x26eb87[_0x3342('0x13')]=_0x3342('0x70');break;case _0x3342('0x71'):_0x26eb87[_0x3342('0x13')]=_0x3342('0x72');_0x26eb87[_0x3342('0x14')]=[{'name':'Reports','field':'id','foreignKey':'reportId'}];break;case _0x3342('0x73'):_0x26eb87['childModel']=_0x3342('0x74');break;}return _0x26eb87;}function _0x59964b(_0x4c777e,_0x44faea){var _0x43d39f=_0x4c777e[_0x3342('0x75')](0x0)['toUpperCase']()+_0x4c777e['slice'](0x1);var _0x54b41d={'type':_0x21bdc2[_0x3342('0x76')]['QueryTypes'][_0x3342('0x77')],'raw':!![]};return new Promise(function(_0x219a17,_0x372af5){var _0x4d3660=squel[_0x3342('0x78')]()[_0x3342('0x5')](_0x3342('0x79')+_0x43d39f+_0x3342('0x7a'),'id')[_0x3342('0x5')](_0x3342('0x7b'))[_0x3342('0x7c')]('user_has_'+_0x4c777e+'_interactions','ui')[_0x3342('0x7d')]('ui.UserId\x20=\x20?',_0x44faea['id']);return _0x21bdc2[_0x3342('0x7e')][_0x3342('0x7f')](_0x4d3660[_0x3342('0x80')](),_0x54b41d)[_0x3342('0x8')](function(_0xe9b979){_0x44faea[_0x43d39f+'OpenTabs']=_0xe9b979;_0x219a17(_0xe9b979);})[_0x3342('0xd')](function(_0x3f2fcb){_0x372af5(_0x3f2fcb);});});}return _0x3b763d['define'](_0x3342('0x81'),attributes,{'tableName':_0x3342('0x82'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x10842c){var _0x2858a6={'raw':_0x10842c[_0x3342('0x7f')][_0x3342('0x83')],'where':{}};var _0x19fcc5={};var _0x2f6a48={'count':0x0,'rows':[]};var _0x16c3f3=_0x10842c[_0x3342('0x7f')][_0x3342('0x84')];var _0x28bbfa=_0x10842c[_0x3342('0x7f')]['mergeResources']||![];var _0x5c9399=_0x2dbad1(_0x16c3f3,_0x28bbfa);if(!_0x5c9399[_0x3342('0x13')])throw new Error(_0x3342('0x85')+_0x16c3f3+'\x27');var _0x14193b=[{'name':_0x16c3f3}];if(!_[_0x3342('0x86')](_0x5c9399['parentSections']))_0x14193b=_0x5c9399['parentSections'];var _0x3310ac=[];for(var _0x18751b=0x0;_0x18751b<_0x14193b[_0x3342('0x87')];_0x18751b++){_0x3310ac[_0x3342('0x88')](_0x21bdc2[_0x3342('0x89')][_0x3342('0x8a')]({'where':{'userProfileId':_0x10842c[_0x3342('0x8b')]['id'],'name':_0x14193b[_0x18751b][_0x3342('0xc')]},'raw':!![]}));}return Promise[_0x3342('0x8c')](_0x3310ac)[_0x3342('0x8')](function(_0x4887d4){var _0x3392a2=_['filter'](_0x4887d4,function(_0x1c5d7d){return _0x1c5d7d?_0x1c5d7d:undefined;});var _0xba7c0e=_['filter'](_0x14193b,[_0x3342('0x8d'),!![]]);var _0x3506d4=_['isEmpty'](_0x3392a2)&&_[_0x3342('0x86')](_0xba7c0e)?null:_[_0x3342('0x8e')](_0xba7c0e,_0x3392a2);if(!_0x3506d4)return null;var _0x1e3353=[];for(var _0x466e06=0x0;_0x466e06<_0x3506d4[_0x3342('0x87')];_0x466e06++){var _0x42bc3b=_[_0x3342('0x8a')](_0x14193b,function(_0x57b8ac){return _0x3506d4[_0x466e06]?_0x57b8ac[_0x3342('0xc')]===_0x3506d4[_0x466e06]['name']:null;});if(_0x42bc3b){if(_0x3506d4[_0x466e06]['ignore']){_0x1e3353[_0x3342('0x88')](_0x2207ce(_0x5c9399[_0x3342('0x13')],_0x3506d4[_0x466e06]));}else{if(!_0x3506d4[_0x466e06][_0x3342('0x8f')]){_0x1e3353[_0x3342('0x88')](_0x40d609(_0x42bc3b,_0x3506d4[_0x466e06],_0x5c9399[_0x3342('0x13')]));}else{if(_0x42bc3b[_0x3342('0xa')]){_0x1e3353[_0x3342('0x88')](_0x51b276(_0x42bc3b,_0x3506d4[_0x466e06]));}}}}}return Promise[_0x3342('0x8c')](_0x1e3353);})['then'](function(_0x3c8fd5){var _0x2766e8=_0x3c8fd5;var _0x2cfbee=null;if(_0x2766e8){_0x2cfbee=_0x2766e8[_0x3342('0x87')]===0x1?_0x2766e8[0x0]:null;}if(!_0x2cfbee&&!_0x2766e8)return _0x2f6a48;var _0x3c151b=_0x21bdc2[_0x5c9399[_0x3342('0x13')]][_0x3342('0x90')];_0x19fcc5['model']=_[_0x3342('0x91')](_0x3c151b);_0x19fcc5[_0x3342('0x7f')]=_[_0x3342('0x91')](_0x10842c[_0x3342('0x7f')]);_0x19fcc5[_0x3342('0x92')]=_[_0x3342('0x93')](_0x19fcc5['model'],_0x19fcc5['query']);_0x2858a6['attributes']=_[_0x3342('0x93')](_0x19fcc5[_0x3342('0xa')],qs[_0x3342('0x94')](_0x10842c[_0x3342('0x7f')][_0x3342('0x94')]));_0x2858a6[_0x3342('0x95')]=_0x2858a6[_0x3342('0x95')][_0x3342('0x87')]?_0x2858a6['attributes']:_0x19fcc5[_0x3342('0xa')];if(!_0x10842c[_0x3342('0x7f')][_0x3342('0x96')](_0x3342('0x97'))){_0x2858a6['limit']=qs[_0x3342('0x98')](_0x10842c[_0x3342('0x7f')][_0x3342('0x98')]);_0x2858a6[_0x3342('0x99')]=qs[_0x3342('0x99')](_0x10842c[_0x3342('0x7f')][_0x3342('0x99')]);}_0x2858a6[_0x3342('0x9a')]=qs[_0x3342('0x9b')](_0x10842c['query'][_0x3342('0x9b')]);_0x2858a6[_0x3342('0x7d')]=qs['filters'](_[_0x3342('0x9c')](_0x10842c['query'],_0x19fcc5[_0x3342('0x92')]));if(_0x10842c['query'][_0x3342('0x4')]){_0x2858a6['where']=_[_0x3342('0x9d')](_0x2858a6[_0x3342('0x7d')],{'$or':_['map'](_0x3c151b,function(_0x3a24b7){if(_0x3a24b7[_0x3342('0x11')]['key']!==_0x3342('0x9e')){var _0x24c9ef={};_0x24c9ef[_0x3a24b7[_0x3342('0x5')]]={'$like':'%'+_0x10842c[_0x3342('0x7f')][_0x3342('0x4')]+'%'};return _0x24c9ef;}})});}var _0x1d58cb=[];var _0x5cb6c5=null;var _0x29a7a1={};if(_0x2cfbee){_0x5cb6c5=_[_0x3342('0x8a')](_0x14193b,[_0x3342('0xc'),_0x2cfbee[_0x3342('0xc')]]);if(_0x5cb6c5[_0x3342('0x5')]){_0x29a7a1={};if(_0x5c9399[_0x3342('0x13')]===_0x3342('0x72')){_0x29a7a1[_0x5cb6c5[_0x3342('0x9f')]]=_[_0x3342('0x9')](_0x2cfbee[_0x3342('0xb')],'id');}else{_0x29a7a1[_0x5cb6c5['foreignKey']]=_0x2cfbee[_0x3342('0xb')];}_0x1d58cb[_0x3342('0x88')](_0x29a7a1);}else{_0x2858a6[_0x3342('0x7d')]['id']=_0x2cfbee['associatedResources'];}}else{for(var _0x5ef689=0x0;_0x5ef689<_0x2766e8[_0x3342('0x87')];_0x5ef689++){_0x5cb6c5=_['find'](_0x14193b,['name',_0x2766e8[_0x5ef689][_0x3342('0xc')]]);if(_0x5cb6c5[_0x3342('0x5')]){_0x29a7a1={};_0x29a7a1[_0x5cb6c5['foreignKey']]=_0x2766e8[_0x5ef689][_0x3342('0xb')];_0x1d58cb['push'](_0x29a7a1);}else{if(!_0x2858a6[_0x3342('0x7d')]['id'])_0x2858a6['where']['id']=[];_0x2766e8[_0x5ef689]['associatedResources'][_0x3342('0xa0')](function(_0x2d3f3e){_0x2858a6[_0x3342('0x7d')]['id']['push'](_0x2d3f3e);});}}}if(!_['isEmpty'](_0x1d58cb)){_0x2858a6[_0x3342('0x7d')]=_['merge'](_0x2858a6[_0x3342('0x7d')],{'$and':{'$or':_0x1d58cb}});}_0x2858a6=_[_0x3342('0x9d')]({},_0x2858a6,_0x10842c[_0x3342('0xa1')]);if(_0x2cfbee&&!_0x2cfbee[_0x3342('0x8f')]&&_0x5c9399['childModel']==='AnalyticExtractedReport'){if(_0x10842c[_0x3342('0x7f')][_0x3342('0xa2')]){_0x2858a6['include']=[{'all':!![]}];}return _0x21bdc2[_0x5c9399[_0x3342('0x13')]]['findAll'](_0x2858a6)[_0x3342('0x8')](function(_0x21a2bc){var _0x45899e=[];_0x21a2bc[_0x3342('0xa0')](function(_0x22b415){var _0x5e368f;switch(_0x22b415['reportType']){case'default':_0x5e368f=_[_0x3342('0x8a')](_0x2cfbee[_0x3342('0xb')],function(_0x3aaf86){return _0x3aaf86['id']===_0x22b415['reportId']&&_0x3aaf86[_0x3342('0x11')]===_0x3342('0xa3');});break;case _0x3342('0xa4'):_0x5e368f=_[_0x3342('0x8a')](_0x2cfbee[_0x3342('0xb')],function(_0x2355c0){return _0x2355c0['id']===_0x22b415['reportId']&&_0x2355c0[_0x3342('0x11')]==='CustomReports';});break;}if(_0x5e368f)_0x45899e['push'](_0x22b415);});_0x2f6a48['count']=_0x45899e[_0x3342('0x87')];_0x2f6a48[_0x3342('0xa5')]=_0x45899e;return _0x2f6a48;});}else{if(!_['isEmpty'](_0x10842c[_0x3342('0x7f')][_0x3342('0xa6')])){_0x2858a6['where']['id']=_0x2858a6[_0x3342('0x7d')]['id']?_[_0x3342('0x93')](_0x2858a6[_0x3342('0x7d')]['id'],_0x10842c[_0x3342('0x7f')][_0x3342('0xa6')]):_0x10842c[_0x3342('0x7f')][_0x3342('0xa6')];}return _0x21bdc2[_0x5c9399[_0x3342('0x13')]]['count']({'where':_0x2858a6[_0x3342('0x7d')]})[_0x3342('0x8')](function(_0x13738c){_0x2f6a48[_0x3342('0xa7')]=_0x13738c;if(_0x10842c[_0x3342('0x7f')][_0x3342('0xa2')]){if(_0x5c9399[_0x3342('0x13')]==='CmContact'){_0x2858a6['include']=[{'model':_0x21bdc2[_0x3342('0x6a')],'as':_0x3342('0xa8'),'attributes':['id',_0x3342('0xc'),_0x3342('0xa9')],'required':_0x10842c[_0x3342('0x7f')][_0x3342('0xaa')]?!![]:![]},{'model':_0x21bdc2[_0x3342('0x6a')],'as':'ThroughTags','attributes':['id',_0x3342('0xc'),_0x3342('0xa9')],'through':_0x10842c[_0x3342('0x7f')][_0x3342('0xaa')]?{'attributes':[],'where':{'TagId':_0x10842c[_0x3342('0x7f')]['tag']||undefined}}:{},'required':_0x10842c[_0x3342('0x7f')][_0x3342('0xaa')]?!![]:![]}];}else{_0x2858a6[_0x3342('0xab')]=[{'all':!![]}];}}return _0x21bdc2[_0x5c9399[_0x3342('0x13')]]['findAll'](_0x2858a6);})[_0x3342('0x8')](function(_0x250317){_0x2f6a48[_0x3342('0xa5')]=_0x250317;if(_0x16c3f3===_0x3342('0x2d')&&_0x10842c[_0x3342('0x7f')][_0x3342('0xac')]===_0x3342('0xad')){var _0x5ccbc6=[];for(var _0x53a9e1=0x0;_0x53a9e1<_0x2f6a48[_0x3342('0xa5')]['length'];_0x53a9e1++){_0x5ccbc6[_0x3342('0x88')](_0x59964b(_0x3342('0xae'),_0x2f6a48[_0x3342('0xa5')][_0x53a9e1][_0x3342('0xaf')]));_0x5ccbc6[_0x3342('0x88')](_0x59964b('sms',_0x2f6a48[_0x3342('0xa5')][_0x53a9e1][_0x3342('0xaf')]));_0x5ccbc6[_0x3342('0x88')](_0x59964b('fax',_0x2f6a48['rows'][_0x53a9e1][_0x3342('0xaf')]));_0x5ccbc6[_0x3342('0x88')](_0x59964b(_0x3342('0xb0'),_0x2f6a48[_0x3342('0xa5')][_0x53a9e1][_0x3342('0xaf')]));_0x5ccbc6[_0x3342('0x88')](_0x59964b(_0x3342('0xb1'),_0x2f6a48[_0x3342('0xa5')][_0x53a9e1][_0x3342('0xaf')]));_0x5ccbc6[_0x3342('0x88')](_0x59964b(_0x3342('0xb2'),_0x2f6a48[_0x3342('0xa5')][_0x53a9e1]['dataValues']));}return Promise['all'](_0x5ccbc6)['then'](function(){return _0x2f6a48;});}return _0x2f6a48;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index ddd977b..2986474 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 _0x8212=['UserProfile,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','request','then','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x138e5a,_0x5bfbbd){var _0x534e66=function(_0x41c83d){while(--_0x41c83d){_0x138e5a['push'](_0x138e5a['shift']());}};_0x534e66(++_0x5bfbbd);}(_0x8212,0xb3));var _0x2821=function(_0x3fbfae,_0x5622ca){_0x3fbfae=_0x3fbfae-0x0;var _0x5db097=_0x8212[_0x3fbfae];return _0x5db097;};'use strict';var _=require(_0x2821('0x0'));var util=require(_0x2821('0x1'));var moment=require('moment');var BPromise=require(_0x2821('0x2'));var rs=require(_0x2821('0x3'));var fs=require('fs');var Redis=require(_0x2821('0x4'));var db=require(_0x2821('0x5'))['db'];var utils=require(_0x2821('0x6'));var logger=require(_0x2821('0x7'))(_0x2821('0x8'));var config=require(_0x2821('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2821('0xa')]['http']({'port':0x232a});config[_0x2821('0xb')]=_[_0x2821('0xc')](config['redis'],{'host':_0x2821('0xd'),'port':0x18eb});var socket=require(_0x2821('0xe'))(new Redis(config[_0x2821('0xb')]));require(_0x2821('0xf'))[_0x2821('0x10')](socket);function respondWithRpcPromise(_0x17d352,_0x258b64,_0x1a6eb6){return new BPromise(function(_0x379eee,_0x4aa28d){return client[_0x2821('0x11')](_0x17d352,_0x1a6eb6)[_0x2821('0x12')](function(_0x7c120a){logger['info']('UserProfile,\x20%s,\x20%s',_0x258b64,'request\x20sent');logger['debug'](_0x2821('0x13'),_0x258b64,_0x2821('0x14'),JSON[_0x2821('0x15')](_0x7c120a));if(_0x7c120a[_0x2821('0x16')]){if(_0x7c120a[_0x2821('0x16')][_0x2821('0x17')]===0x1f4){logger['error'](_0x2821('0x18'),_0x258b64,_0x7c120a['error']['message']);return _0x4aa28d(_0x7c120a[_0x2821('0x16')][_0x2821('0x19')]);}logger[_0x2821('0x16')](_0x2821('0x18'),_0x258b64,_0x7c120a['error'][_0x2821('0x19')]);return _0x379eee(_0x7c120a['error'][_0x2821('0x19')]);}else{logger[_0x2821('0x1a')](_0x2821('0x18'),_0x258b64,_0x2821('0x14'));_0x379eee(_0x7c120a[_0x2821('0x1b')][_0x2821('0x19')]);}})[_0x2821('0x1c')](function(_0x1a7966){logger['error'](_0x2821('0x18'),_0x258b64,_0x1a7966);_0x4aa28d(_0x1a7966);});});} \ No newline at end of file +var _0x78f4=['debug','stringify','error','code','message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','defaults','socket.io-emitter','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x78f4,0x1c8));var _0x478f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x78f4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x478f('0x0'));var moment=require(_0x478f('0x1'));var BPromise=require(_0x478f('0x2'));var rs=require(_0x478f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x478f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x478f('0x5'))(_0x478f('0x6'));var config=require(_0x478f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x478f('0x8')][_0x478f('0x9')]({'port':0x232a});config['redis']=_[_0x478f('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x478f('0xb'))(new Redis(config['redis']));require(_0x478f('0xc'))[_0x478f('0xd')](socket);function respondWithRpcPromise(_0xec2f39,_0x469c69,_0x5a724b){return new BPromise(function(_0x5e6a27,_0x32ea1a){return client[_0x478f('0xe')](_0xec2f39,_0x5a724b)[_0x478f('0xf')](function(_0x45e1dd){logger[_0x478f('0x10')](_0x478f('0x11'),_0x469c69,_0x478f('0x12'));logger[_0x478f('0x13')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x469c69,_0x478f('0x12'),JSON[_0x478f('0x14')](_0x45e1dd));if(_0x45e1dd[_0x478f('0x15')]){if(_0x45e1dd[_0x478f('0x15')][_0x478f('0x16')]===0x1f4){logger[_0x478f('0x15')](_0x478f('0x11'),_0x469c69,_0x45e1dd[_0x478f('0x15')]['message']);return _0x32ea1a(_0x45e1dd[_0x478f('0x15')][_0x478f('0x17')]);}logger[_0x478f('0x15')](_0x478f('0x11'),_0x469c69,_0x45e1dd['error'][_0x478f('0x17')]);return _0x5e6a27(_0x45e1dd['error'][_0x478f('0x17')]);}else{logger[_0x478f('0x10')]('UserProfile,\x20%s,\x20%s',_0x469c69,_0x478f('0x12'));_0x5e6a27(_0x45e1dd['result'][_0x478f('0x17')]);}})[_0x478f('0x18')](function(_0x181d9d){logger[_0x478f('0x15')](_0x478f('0x11'),_0x469c69,_0x181d9d);_0x32ea1a(_0x181d9d);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index dc8d8dc..ac5699b 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 _0xf43c=['length','userProfile:','./userProfile.events','save','remove','update','removeListener'];(function(_0x49fb1c,_0x113891){var _0x36cc02=function(_0x308d72){while(--_0x308d72){_0x49fb1c['push'](_0x49fb1c['shift']());}};_0x36cc02(++_0x113891);}(_0xf43c,0x113));var _0xcf43=function(_0x38afcd,_0x359734){_0x38afcd=_0x38afcd-0x0;var _0x5f3517=_0xf43c[_0x38afcd];return _0x5f3517;};'use strict';var UserProfileEvents=require(_0xcf43('0x0'));var events=[_0xcf43('0x1'),_0xcf43('0x2'),_0xcf43('0x3')];function createListener(_0x21b7c9,_0x567169){return function(_0x128a49){_0x567169['emit'](_0x21b7c9,_0x128a49);};}function removeListener(_0x1a4d07,_0x496c61){return function(){UserProfileEvents[_0xcf43('0x4')](_0x1a4d07,_0x496c61);};}exports['register']=function(_0x41f6bc){for(var _0x36c8b0=0x0,_0x327a75=events[_0xcf43('0x5')];_0x36c8b0<_0x327a75;_0x36c8b0++){var _0x324fc6=events[_0x36c8b0];var _0xa25ca2=createListener(_0xcf43('0x6')+_0x324fc6,_0x41f6bc);UserProfileEvents['on'](_0x324fc6,_0xa25ca2);}}; \ No newline at end of file +var _0x9480=['save','remove','update','emit','removeListener','register','length'];(function(_0x3520fd,_0x46f297){var _0x16e738=function(_0xd9acee){while(--_0xd9acee){_0x3520fd['push'](_0x3520fd['shift']());}};_0x16e738(++_0x46f297);}(_0x9480,0x150));var _0x0948=function(_0x14ba8b,_0x306a0a){_0x14ba8b=_0x14ba8b-0x0;var _0x44aaf0=_0x9480[_0x14ba8b];return _0x44aaf0;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x0948('0x0'),_0x0948('0x1'),_0x0948('0x2')];function createListener(_0x3822eb,_0x509b74){return function(_0xe7c960){_0x509b74[_0x0948('0x3')](_0x3822eb,_0xe7c960);};}function removeListener(_0x3acd54,_0x127851){return function(){UserProfileEvents[_0x0948('0x4')](_0x3acd54,_0x127851);};}exports[_0x0948('0x5')]=function(_0x21501d){for(var _0x5b3494=0x0,_0x59527b=events[_0x0948('0x6')];_0x5b3494<_0x59527b;_0x5b3494++){var _0x4726d4=events[_0x5b3494];var _0x181994=createListener('userProfile:'+_0x4726d4,_0x21501d);UserProfileEvents['on'](_0x4726d4,_0x181994);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 187df95..327a63d 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 _0xfbb0=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','show','create','update','delete','/:id','destroy'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xfbb0,0xe8));var _0x0fbb=function(_0x304f40,_0x1762d0){_0x304f40=_0x304f40-0x0;var _0x40d311=_0xfbb0[_0x304f40];return _0x40d311;};'use strict';var multer=require(_0x0fbb('0x0'));var util=require(_0x0fbb('0x1'));var path=require(_0x0fbb('0x2'));var timeout=require(_0x0fbb('0x3'));var express=require(_0x0fbb('0x4'));var router=express['Router']();var fs_extra=require(_0x0fbb('0x5'));var auth=require(_0x0fbb('0x6'));var interaction=require(_0x0fbb('0x7'));var config=require(_0x0fbb('0x8'));var controller=require('./userProfileResource.controller');router['get']('/',auth[_0x0fbb('0x9')](),controller[_0x0fbb('0xa')]);router[_0x0fbb('0xb')](_0x0fbb('0xc'),auth[_0x0fbb('0x9')](),controller[_0x0fbb('0xd')]);router[_0x0fbb('0xb')]('/:id',auth[_0x0fbb('0x9')](),controller[_0x0fbb('0xe')]);router['post']('/',auth[_0x0fbb('0x9')](),controller[_0x0fbb('0xf')]);router['put']('/:id',auth[_0x0fbb('0x9')](),controller[_0x0fbb('0x10')]);router[_0x0fbb('0x11')](_0x0fbb('0x12'),auth[_0x0fbb('0x9')](),controller[_0x0fbb('0x13')]);module[_0x0fbb('0x14')]=router; \ No newline at end of file +var _0xf575=['index','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated'];(function(_0x4ed1d4,_0x512d9a){var _0x28e363=function(_0x2bdfb7){while(--_0x2bdfb7){_0x4ed1d4['push'](_0x4ed1d4['shift']());}};_0x28e363(++_0x512d9a);}(_0xf575,0xa5));var _0x5f57=function(_0xe5cbdd,_0x4b48ea){_0xe5cbdd=_0xe5cbdd-0x0;var _0x25558c=_0xf575[_0xe5cbdd];return _0x25558c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5f57('0x0'));var timeout=require(_0x5f57('0x1'));var express=require(_0x5f57('0x2'));var router=express[_0x5f57('0x3')]();var fs_extra=require(_0x5f57('0x4'));var auth=require(_0x5f57('0x5'));var interaction=require(_0x5f57('0x6'));var config=require(_0x5f57('0x7'));var controller=require(_0x5f57('0x8'));router[_0x5f57('0x9')]('/',auth[_0x5f57('0xa')](),controller[_0x5f57('0xb')]);router[_0x5f57('0x9')](_0x5f57('0xc'),auth[_0x5f57('0xa')](),controller[_0x5f57('0xd')]);router[_0x5f57('0x9')](_0x5f57('0xe'),auth[_0x5f57('0xa')](),controller[_0x5f57('0xf')]);router[_0x5f57('0x10')]('/',auth[_0x5f57('0xa')](),controller['create']);router[_0x5f57('0x11')]('/:id',auth[_0x5f57('0xa')](),controller[_0x5f57('0x12')]);router[_0x5f57('0x13')](_0x5f57('0xe'),auth[_0x5f57('0xa')](),controller[_0x5f57('0x14')]);module[_0x5f57('0x15')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index d9350a6..37e998a 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 _0x8d97=['sequelize','STRING'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0x8d97,0x80));var _0x78d9=function(_0x1778d6,_0x209414){_0x1778d6=_0x1778d6-0x0;var _0x30188b=_0x8d97[_0x1778d6];return _0x30188b;};'use strict';var Sequelize=require(_0x78d9('0x0'));module['exports']={'name':{'type':Sequelize[_0x78d9('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x78d9('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xdbb2=['sequelize','exports','INTEGER'];(function(_0x3aa849,_0x4f35b1){var _0x3b232b=function(_0x223259){while(--_0x223259){_0x3aa849['push'](_0x3aa849['shift']());}};_0x3b232b(++_0x4f35b1);}(_0xdbb2,0x1d4));var _0x2dbb=function(_0x86b219,_0x43038f){_0x86b219=_0x86b219-0x0;var _0x1f320c=_0xdbb2[_0x86b219];return _0x1f320c;};'use strict';var Sequelize=require(_0x2dbb('0x0'));module[_0x2dbb('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x2dbb('0x2')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index d1120cd..1d4dc5f 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 _0x896e=['hasOwnProperty','nolimit','order','sort','where','merge','filter','UserProfileResource','includeAll','include','findAll','rows','catch','keys','length','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','destroy','then','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x896e,0x1e9));var _0xe896=function(_0x210bd2,_0x1c5ee6){_0x210bd2=_0x210bd2-0x0;var _0x3b1232=_0x896e[_0x210bd2];return _0x3b1232;};'use strict';var emlformat=require(_0xe896('0x0'));var rimraf=require(_0xe896('0x1'));var zipdir=require(_0xe896('0x2'));var jsonpatch=require(_0xe896('0x3'));var rp=require(_0xe896('0x4'));var moment=require(_0xe896('0x5'));var BPromise=require(_0xe896('0x6'));var Mustache=require(_0xe896('0x7'));var util=require(_0xe896('0x8'));var path=require(_0xe896('0x9'));var sox=require(_0xe896('0xa'));var csv=require(_0xe896('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe896('0xc'));var _=require(_0xe896('0xd'));var squel=require(_0xe896('0xe'));var crypto=require(_0xe896('0xf'));var jsforce=require(_0xe896('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xe896('0xb'));var querystring=require(_0xe896('0x11'));var Papa=require(_0xe896('0x12'));var Redis=require('ioredis');var authService=require(_0xe896('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe896('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe896('0x15'))(_0xe896('0x16'));var utils=require(_0xe896('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xe896('0x18'));var db=require(_0xe896('0x19'))['db'];function respondWithStatusCode(_0x3e8ac9,_0x580aac){_0x580aac=_0x580aac||0xcc;return function(_0x2aa522){if(_0x2aa522){return _0x3e8ac9[_0xe896('0x1a')](_0x580aac);}return _0x3e8ac9[_0xe896('0x1b')](_0x580aac)['end']();};}function respondWithResult(_0x2d0e46,_0x7dcf8a){_0x7dcf8a=_0x7dcf8a||0xc8;return function(_0x1e7ef8){if(_0x1e7ef8){return _0x2d0e46['status'](_0x7dcf8a)['json'](_0x1e7ef8);}};}function respondWithFilteredResult(_0x446ce2,_0x25606b){return function(_0x51e7b7){if(_0x51e7b7){var _0x5e78d6=typeof _0x25606b[_0xe896('0x1c')]===_0xe896('0x1d')&&typeof _0x25606b['limit']===_0xe896('0x1d');var _0x4e062a=_0x51e7b7[_0xe896('0x1e')];var _0x32f86d=_0x5e78d6?0x0:_0x25606b[_0xe896('0x1c')];var _0x5dc89d=_0x5e78d6?_0x51e7b7[_0xe896('0x1e')]:_0x25606b[_0xe896('0x1c')]+_0x25606b[_0xe896('0x1f')];var _0xbebbe1;if(_0x5dc89d>=_0x4e062a){_0x5dc89d=_0x4e062a;_0xbebbe1=0xc8;}else{_0xbebbe1=0xce;}_0x446ce2[_0xe896('0x1b')](_0xbebbe1);return _0x446ce2[_0xe896('0x20')](_0xe896('0x21'),_0x32f86d+'-'+_0x5dc89d+'/'+_0x4e062a)[_0xe896('0x22')](_0x51e7b7);}return null;};}function patchUpdates(_0x49547b){return function(_0x180d46){try{jsonpatch['apply'](_0x180d46,_0x49547b,!![]);}catch(_0x5d2c8d){return BPromise[_0xe896('0x23')](_0x5d2c8d);}return _0x180d46[_0xe896('0x24')]();};}function saveUpdates(_0x40502b,_0xeeec7c){return function(_0x498469){if(_0x498469){return _0x498469[_0xe896('0x25')](_0x40502b)['then'](function(_0x5001f7){return _0x5001f7;});}return null;};}function removeEntity(_0x45dd49,_0x41e689){return function(_0x1e952a){if(_0x1e952a){return _0x1e952a[_0xe896('0x26')]()[_0xe896('0x27')](function(){_0x45dd49[_0xe896('0x1b')](0xcc)[_0xe896('0x28')]();});}};}function handleEntityNotFound(_0x4b71cc,_0x390128){return function(_0x163a75){if(!_0x163a75){_0x4b71cc[_0xe896('0x1a')](0x194);}return _0x163a75;};}function handleError(_0x569d5f,_0x26635e){_0x26635e=_0x26635e||0x1f4;return function(_0xd50fe2){logger[_0xe896('0x29')](_0xd50fe2[_0xe896('0x2a')]);if(_0xd50fe2[_0xe896('0x2b')]){delete _0xd50fe2[_0xe896('0x2b')];}_0x569d5f['status'](_0x26635e)[_0xe896('0x2c')](_0xd50fe2);};}exports[_0xe896('0x2d')]=function(_0x201653,_0xbfb15b){var _0xace03f={},_0x5e0d9b={},_0x47c268={'count':0x0,'rows':[]};var _0x5c7dae=_['map'](db['UserProfileResource'][_0xe896('0x2e')],function(_0x29a18e){return{'name':_0x29a18e[_0xe896('0x2f')],'type':_0x29a18e[_0xe896('0x30')][_0xe896('0x31')]};});_0x5e0d9b[_0xe896('0x32')]=_[_0xe896('0x33')](_0x5c7dae,_0xe896('0x2b'));_0x5e0d9b['query']=_['keys'](_0x201653[_0xe896('0x34')]);_0x5e0d9b[_0xe896('0x35')]=_[_0xe896('0x36')](_0x5e0d9b[_0xe896('0x32')],_0x5e0d9b['query']);_0xace03f[_0xe896('0x37')]=_['intersection'](_0x5e0d9b['model'],qs[_0xe896('0x38')](_0x201653[_0xe896('0x34')][_0xe896('0x38')]));_0xace03f['attributes']=_0xace03f['attributes']['length']?_0xace03f[_0xe896('0x37')]:_0x5e0d9b[_0xe896('0x32')];if(!_0x201653[_0xe896('0x34')][_0xe896('0x39')](_0xe896('0x3a'))){_0xace03f['limit']=qs[_0xe896('0x1f')](_0x201653[_0xe896('0x34')][_0xe896('0x1f')]);_0xace03f[_0xe896('0x1c')]=qs[_0xe896('0x1c')](_0x201653[_0xe896('0x34')][_0xe896('0x1c')]);}_0xace03f[_0xe896('0x3b')]=qs['sort'](_0x201653[_0xe896('0x34')][_0xe896('0x3c')]);_0xace03f['where']=qs[_0xe896('0x35')](_['pick'](_0x201653[_0xe896('0x34')],_0x5e0d9b['filters']),_0x5c7dae);if(_0x201653[_0xe896('0x34')]['filter']){_0xace03f[_0xe896('0x3d')]=_[_0xe896('0x3e')](_0xace03f[_0xe896('0x3d')],{'$or':_[_0xe896('0x33')](_0x5c7dae,function(_0xeb9bbf){if(_0xeb9bbf['type']!=='VIRTUAL'){var _0x203aea={};_0x203aea[_0xeb9bbf[_0xe896('0x2b')]]={'$like':'%'+_0x201653[_0xe896('0x34')][_0xe896('0x3f')]+'%'};return _0x203aea;}})});}_0xace03f=_[_0xe896('0x3e')]({},_0xace03f,_0x201653['options']);var _0x5b8131={'where':_0xace03f[_0xe896('0x3d')]};return db[_0xe896('0x40')]['count'](_0x5b8131)['then'](function(_0x19d2fd){_0x47c268[_0xe896('0x1e')]=_0x19d2fd;if(_0x201653[_0xe896('0x34')][_0xe896('0x41')]){_0xace03f[_0xe896('0x42')]=[{'all':!![]}];}return db[_0xe896('0x40')][_0xe896('0x43')](_0xace03f);})[_0xe896('0x27')](function(_0x372c71){_0x47c268[_0xe896('0x44')]=_0x372c71;return _0x47c268;})[_0xe896('0x27')](respondWithFilteredResult(_0xbfb15b,_0xace03f))[_0xe896('0x45')](handleError(_0xbfb15b,null));};exports['show']=function(_0x1e5434,_0x143ad4){var _0x59b97f={'raw':![],'where':{'id':_0x1e5434['params']['id']}},_0x57366b={};_0x57366b[_0xe896('0x32')]=_[_0xe896('0x46')](db[_0xe896('0x40')]['rawAttributes']);_0x57366b[_0xe896('0x34')]=_[_0xe896('0x46')](_0x1e5434['query']);_0x57366b['filters']=_['intersection'](_0x57366b[_0xe896('0x32')],_0x57366b[_0xe896('0x34')]);_0x59b97f[_0xe896('0x37')]=_[_0xe896('0x36')](_0x57366b[_0xe896('0x32')],qs[_0xe896('0x38')](_0x1e5434['query'][_0xe896('0x38')]));_0x59b97f[_0xe896('0x37')]=_0x59b97f['attributes'][_0xe896('0x47')]?_0x59b97f[_0xe896('0x37')]:_0x57366b[_0xe896('0x32')];if(_0x1e5434[_0xe896('0x34')]['includeAll']){_0x59b97f[_0xe896('0x42')]=[{'all':!![]}];}_0x59b97f=_[_0xe896('0x3e')]({},_0x59b97f,_0x1e5434[_0xe896('0x48')]);return db[_0xe896('0x40')][_0xe896('0x49')](_0x59b97f)[_0xe896('0x27')](handleEntityNotFound(_0x143ad4,null))['then'](respondWithResult(_0x143ad4,null))[_0xe896('0x45')](handleError(_0x143ad4,null));};exports['create']=function(_0x234a22,_0x1c6ae1){return db[_0xe896('0x40')][_0xe896('0x4a')](_0x234a22[_0xe896('0x4b')],{})[_0xe896('0x27')](respondWithResult(_0x1c6ae1,0xc9))['catch'](handleError(_0x1c6ae1,null));};exports[_0xe896('0x25')]=function(_0x206ad3,_0x4818cd){if(_0x206ad3[_0xe896('0x4b')]['id']){delete _0x206ad3[_0xe896('0x4b')]['id'];}return db['UserProfileResource'][_0xe896('0x49')]({'where':{'id':_0x206ad3['params']['id']}})[_0xe896('0x27')](handleEntityNotFound(_0x4818cd,null))[_0xe896('0x27')](saveUpdates(_0x206ad3[_0xe896('0x4b')],null))[_0xe896('0x27')](respondWithResult(_0x4818cd,null))[_0xe896('0x45')](handleError(_0x4818cd,null));};exports['destroy']=function(_0x1fa3fd,_0x819c8a){return db[_0xe896('0x40')]['find']({'where':{'id':_0x1fa3fd[_0xe896('0x4c')]['id']}})['then'](handleEntityNotFound(_0x819c8a,null))['then'](removeEntity(_0x819c8a,null))[_0xe896('0x45')](handleError(_0x819c8a,null));};exports[_0xe896('0x4d')]=function(_0x57aed3,_0x343adb){return db[_0xe896('0x40')]['describe']()['then'](respondWithResult(_0x343adb,null))[_0xe896('0x45')](handleError(_0x343adb,null));}; \ No newline at end of file +var _0xf61e=['where','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','find','create','update','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','apply','destroy','then','status','error','stack','name','send','index','map','UserProfileResource','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order'];(function(_0x7972f1,_0x4673eb){var _0x3e6c8a=function(_0x17f9bb){while(--_0x17f9bb){_0x7972f1['push'](_0x7972f1['shift']());}};_0x3e6c8a(++_0x4673eb);}(_0xf61e,0x191));var _0xef61=function(_0x4355e3,_0x3def54){_0x4355e3=_0x4355e3-0x0;var _0x489b8b=_0xf61e[_0x4355e3];return _0x489b8b;};'use strict';var emlformat=require(_0xef61('0x0'));var rimraf=require(_0xef61('0x1'));var zipdir=require(_0xef61('0x2'));var jsonpatch=require(_0xef61('0x3'));var rp=require(_0xef61('0x4'));var moment=require(_0xef61('0x5'));var BPromise=require(_0xef61('0x6'));var Mustache=require(_0xef61('0x7'));var util=require(_0xef61('0x8'));var path=require(_0xef61('0x9'));var sox=require(_0xef61('0xa'));var csv=require(_0xef61('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xef61('0xc'));var _=require(_0xef61('0xd'));var squel=require('squel');var crypto=require(_0xef61('0xe'));var jsforce=require(_0xef61('0xf'));var deskjs=require(_0xef61('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xef61('0x11'));var Redis=require(_0xef61('0x12'));var authService=require(_0xef61('0x13'));var qs=require(_0xef61('0x14'));var as=require(_0xef61('0x15'));var hardwareService=require(_0xef61('0x16'));var logger=require(_0xef61('0x17'))(_0xef61('0x18'));var utils=require(_0xef61('0x19'));var config=require(_0xef61('0x1a'));var licenseUtil=require(_0xef61('0x1b'));var db=require(_0xef61('0x1c'))['db'];function respondWithStatusCode(_0x114e1f,_0x318f1c){_0x318f1c=_0x318f1c||0xcc;return function(_0x5de159){if(_0x5de159){return _0x114e1f[_0xef61('0x1d')](_0x318f1c);}return _0x114e1f['status'](_0x318f1c)[_0xef61('0x1e')]();};}function respondWithResult(_0x1db2a9,_0x370ee0){_0x370ee0=_0x370ee0||0xc8;return function(_0x76ef9b){if(_0x76ef9b){return _0x1db2a9['status'](_0x370ee0)[_0xef61('0x1f')](_0x76ef9b);}};}function respondWithFilteredResult(_0x435beb,_0x1224c2){return function(_0x78ff22){if(_0x78ff22){var _0x588a61=typeof _0x1224c2[_0xef61('0x20')]===_0xef61('0x21')&&typeof _0x1224c2['limit']===_0xef61('0x21');var _0x408541=_0x78ff22[_0xef61('0x22')];var _0x22dc1b=_0x588a61?0x0:_0x1224c2[_0xef61('0x20')];var _0x28315a=_0x588a61?_0x78ff22[_0xef61('0x22')]:_0x1224c2['offset']+_0x1224c2[_0xef61('0x23')];var _0x2c8dad;if(_0x28315a>=_0x408541){_0x28315a=_0x408541;_0x2c8dad=0xc8;}else{_0x2c8dad=0xce;}_0x435beb['status'](_0x2c8dad);return _0x435beb[_0xef61('0x24')](_0xef61('0x25'),_0x22dc1b+'-'+_0x28315a+'/'+_0x408541)[_0xef61('0x1f')](_0x78ff22);}return null;};}function patchUpdates(_0x26cf42){return function(_0xb0d7a4){try{jsonpatch[_0xef61('0x26')](_0xb0d7a4,_0x26cf42,!![]);}catch(_0x92ea33){return BPromise['reject'](_0x92ea33);}return _0xb0d7a4['save']();};}function saveUpdates(_0x3d31c1,_0x58bd7d){return function(_0x389d6d){if(_0x389d6d){return _0x389d6d['update'](_0x3d31c1)['then'](function(_0x2f0569){return _0x2f0569;});}return null;};}function removeEntity(_0x5ce99d,_0x53181b){return function(_0xfbee94){if(_0xfbee94){return _0xfbee94[_0xef61('0x27')]()[_0xef61('0x28')](function(){_0x5ce99d[_0xef61('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16b144,_0x4e738f){return function(_0x2a6832){if(!_0x2a6832){_0x16b144[_0xef61('0x1d')](0x194);}return _0x2a6832;};}function handleError(_0x2419a9,_0xf4c7c9){_0xf4c7c9=_0xf4c7c9||0x1f4;return function(_0x2155f1){logger[_0xef61('0x2a')](_0x2155f1[_0xef61('0x2b')]);if(_0x2155f1[_0xef61('0x2c')]){delete _0x2155f1[_0xef61('0x2c')];}_0x2419a9[_0xef61('0x29')](_0xf4c7c9)[_0xef61('0x2d')](_0x2155f1);};}exports[_0xef61('0x2e')]=function(_0xeb9a62,_0x63edd4){var _0x1f3572={},_0x85978={},_0x39c15e={'count':0x0,'rows':[]};var _0x393ea9=_[_0xef61('0x2f')](db[_0xef61('0x30')][_0xef61('0x31')],function(_0x53fa3b){return{'name':_0x53fa3b['fieldName'],'type':_0x53fa3b['type'][_0xef61('0x32')]};});_0x85978[_0xef61('0x33')]=_[_0xef61('0x2f')](_0x393ea9,'name');_0x85978[_0xef61('0x34')]=_[_0xef61('0x35')](_0xeb9a62['query']);_0x85978[_0xef61('0x36')]=_['intersection'](_0x85978['model'],_0x85978[_0xef61('0x34')]);_0x1f3572['attributes']=_[_0xef61('0x37')](_0x85978['model'],qs[_0xef61('0x38')](_0xeb9a62[_0xef61('0x34')][_0xef61('0x38')]));_0x1f3572[_0xef61('0x39')]=_0x1f3572[_0xef61('0x39')][_0xef61('0x3a')]?_0x1f3572[_0xef61('0x39')]:_0x85978[_0xef61('0x33')];if(!_0xeb9a62[_0xef61('0x34')][_0xef61('0x3b')]('nolimit')){_0x1f3572[_0xef61('0x23')]=qs[_0xef61('0x23')](_0xeb9a62[_0xef61('0x34')][_0xef61('0x23')]);_0x1f3572[_0xef61('0x20')]=qs['offset'](_0xeb9a62[_0xef61('0x34')][_0xef61('0x20')]);}_0x1f3572[_0xef61('0x3c')]=qs['sort'](_0xeb9a62['query']['sort']);_0x1f3572[_0xef61('0x3d')]=qs['filters'](_['pick'](_0xeb9a62['query'],_0x85978[_0xef61('0x36')]),_0x393ea9);if(_0xeb9a62[_0xef61('0x34')][_0xef61('0x3e')]){_0x1f3572['where']=_['merge'](_0x1f3572['where'],{'$or':_[_0xef61('0x2f')](_0x393ea9,function(_0x32ad44){if(_0x32ad44['type']!==_0xef61('0x3f')){var _0x12f442={};_0x12f442[_0x32ad44[_0xef61('0x2c')]]={'$like':'%'+_0xeb9a62[_0xef61('0x34')]['filter']+'%'};return _0x12f442;}})});}_0x1f3572=_[_0xef61('0x40')]({},_0x1f3572,_0xeb9a62[_0xef61('0x41')]);var _0x3103d4={'where':_0x1f3572[_0xef61('0x3d')]};return db['UserProfileResource']['count'](_0x3103d4)[_0xef61('0x28')](function(_0x462972){_0x39c15e[_0xef61('0x22')]=_0x462972;if(_0xeb9a62['query'][_0xef61('0x42')]){_0x1f3572[_0xef61('0x43')]=[{'all':!![]}];}return db[_0xef61('0x30')][_0xef61('0x44')](_0x1f3572);})['then'](function(_0x545597){_0x39c15e['rows']=_0x545597;return _0x39c15e;})[_0xef61('0x28')](respondWithFilteredResult(_0x63edd4,_0x1f3572))[_0xef61('0x45')](handleError(_0x63edd4,null));};exports[_0xef61('0x46')]=function(_0xe40d,_0x3f81a1){var _0x272143={'raw':![],'where':{'id':_0xe40d['params']['id']}},_0xc9b467={};_0xc9b467[_0xef61('0x33')]=_[_0xef61('0x35')](db[_0xef61('0x30')][_0xef61('0x31')]);_0xc9b467['query']=_[_0xef61('0x35')](_0xe40d[_0xef61('0x34')]);_0xc9b467[_0xef61('0x36')]=_[_0xef61('0x37')](_0xc9b467[_0xef61('0x33')],_0xc9b467[_0xef61('0x34')]);_0x272143['attributes']=_[_0xef61('0x37')](_0xc9b467[_0xef61('0x33')],qs[_0xef61('0x38')](_0xe40d['query'][_0xef61('0x38')]));_0x272143[_0xef61('0x39')]=_0x272143[_0xef61('0x39')][_0xef61('0x3a')]?_0x272143[_0xef61('0x39')]:_0xc9b467[_0xef61('0x33')];if(_0xe40d['query'][_0xef61('0x42')]){_0x272143[_0xef61('0x43')]=[{'all':!![]}];}_0x272143=_['merge']({},_0x272143,_0xe40d[_0xef61('0x41')]);return db[_0xef61('0x30')][_0xef61('0x47')](_0x272143)[_0xef61('0x28')](handleEntityNotFound(_0x3f81a1,null))['then'](respondWithResult(_0x3f81a1,null))[_0xef61('0x45')](handleError(_0x3f81a1,null));};exports[_0xef61('0x48')]=function(_0x5e614b,_0x47b09d){return db[_0xef61('0x30')][_0xef61('0x48')](_0x5e614b['body'],{})[_0xef61('0x28')](respondWithResult(_0x47b09d,0xc9))[_0xef61('0x45')](handleError(_0x47b09d,null));};exports[_0xef61('0x49')]=function(_0x2904e0,_0x13bb20){if(_0x2904e0[_0xef61('0x4a')]['id']){delete _0x2904e0[_0xef61('0x4a')]['id'];}return db['UserProfileResource'][_0xef61('0x47')]({'where':{'id':_0x2904e0['params']['id']}})[_0xef61('0x28')](handleEntityNotFound(_0x13bb20,null))[_0xef61('0x28')](saveUpdates(_0x2904e0[_0xef61('0x4a')],null))[_0xef61('0x28')](respondWithResult(_0x13bb20,null))[_0xef61('0x45')](handleError(_0x13bb20,null));};exports[_0xef61('0x27')]=function(_0x3e23eb,_0x1565c7){return db[_0xef61('0x30')]['find']({'where':{'id':_0x3e23eb[_0xef61('0x4b')]['id']}})[_0xef61('0x28')](handleEntityNotFound(_0x1565c7,null))['then'](removeEntity(_0x1565c7,null))['catch'](handleError(_0x1565c7,null));};exports[_0xef61('0x4c')]=function(_0x1ce127,_0x504389){return db[_0xef61('0x30')]['describe']()[_0xef61('0x28')](respondWithResult(_0x504389,null))[_0xef61('0x45')](handleError(_0x504389,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 97018f6..32d6105 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 _0xb1ac=['UserProfileResource','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x5ee6e7,_0x50f466){var _0x572689=function(_0x5c8a99){while(--_0x5c8a99){_0x5ee6e7['push'](_0x5ee6e7['shift']());}};_0x572689(++_0x50f466);}(_0xb1ac,0x114));var _0xcb1a=function(_0x5a1c2e,_0x2df758){_0x5a1c2e=_0x5a1c2e-0x0;var _0x12e351=_0xb1ac[_0x5a1c2e];return _0x12e351;};'use strict';var _=require('lodash');var util=require(_0xcb1a('0x0'));var logger=require(_0xcb1a('0x1'))(_0xcb1a('0x2'));var moment=require(_0xcb1a('0x3'));var BPromise=require('bluebird');var rp=require(_0xcb1a('0x4'));var fs=require('fs');var path=require(_0xcb1a('0x5'));var rimraf=require(_0xcb1a('0x6'));var config=require(_0xcb1a('0x7'));var attributes=require('./userProfileResource.attributes');module[_0xcb1a('0x8')]=function(_0x2b1f0c,_0x3cc63c){return _0x2b1f0c[_0xcb1a('0x9')](_0xcb1a('0xa'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':'compositeIndex','fields':['resourceId','sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa475=['resourceId','sectionId','lodash','util','api','moment','path','rimraf','../../config/environment','./userProfileResource.attributes','compositeIndex'];(function(_0x18a4f7,_0x3f915c){var _0x368cf3=function(_0x173245){while(--_0x173245){_0x18a4f7['push'](_0x18a4f7['shift']());}};_0x368cf3(++_0x3f915c);}(_0xa475,0xc8));var _0x5a47=function(_0x5bcb48,_0x20fae5){_0x5bcb48=_0x5bcb48-0x0;var _0xf0f753=_0xa475[_0x5bcb48];return _0xf0f753;};'use strict';var _=require(_0x5a47('0x0'));var util=require(_0x5a47('0x1'));var logger=require('../../config/logger')(_0x5a47('0x2'));var moment=require(_0x5a47('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5a47('0x4'));var rimraf=require(_0x5a47('0x5'));var config=require(_0x5a47('0x6'));var attributes=require(_0x5a47('0x7'));module['exports']=function(_0x2c601a,_0x23171d){return _0x2c601a['define']('UserProfileResource',attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x5a47('0x8'),'fields':[_0x5a47('0x9'),_0x5a47('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 8a22efe..b3693c3 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 _0xddc5=['../../config/environment','jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x515640,_0x27b10e){var _0x5328b=function(_0x25bb4a){while(--_0x25bb4a){_0x515640['push'](_0x515640['shift']());}};_0x5328b(++_0x27b10e);}(_0xddc5,0x101));var _0x5ddc=function(_0x2debf2,_0x3ee1a1){_0x2debf2=_0x2debf2-0x0;var _0x3f7f75=_0xddc5[_0x2debf2];return _0x3f7f75;};'use strict';var _=require(_0x5ddc('0x0'));var util=require(_0x5ddc('0x1'));var moment=require('moment');var BPromise=require(_0x5ddc('0x2'));var rs=require(_0x5ddc('0x3'));var fs=require('fs');var Redis=require(_0x5ddc('0x4'));var db=require(_0x5ddc('0x5'))['db'];var utils=require(_0x5ddc('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x5ddc('0x7'));var jayson=require(_0x5ddc('0x8'));var client=jayson[_0x5ddc('0x9')][_0x5ddc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38dffb,_0xe29cfd,_0x42ebb6){return new BPromise(function(_0x34ef7a,_0x39ddb9){return client[_0x5ddc('0xb')](_0x38dffb,_0x42ebb6)[_0x5ddc('0xc')](function(_0x31f4ea){logger[_0x5ddc('0xd')](_0x5ddc('0xe'),_0xe29cfd,_0x5ddc('0xf'));logger['debug'](_0x5ddc('0x10'),_0xe29cfd,_0x5ddc('0xf'),JSON['stringify'](_0x31f4ea));if(_0x31f4ea['error']){if(_0x31f4ea[_0x5ddc('0x11')][_0x5ddc('0x12')]===0x1f4){logger['error']('UserProfileResource,\x20%s,\x20%s',_0xe29cfd,_0x31f4ea[_0x5ddc('0x11')]['message']);return _0x39ddb9(_0x31f4ea['error'][_0x5ddc('0x13')]);}logger[_0x5ddc('0x11')](_0x5ddc('0xe'),_0xe29cfd,_0x31f4ea['error'][_0x5ddc('0x13')]);return _0x34ef7a(_0x31f4ea[_0x5ddc('0x11')][_0x5ddc('0x13')]);}else{logger[_0x5ddc('0xd')]('UserProfileResource,\x20%s,\x20%s',_0xe29cfd,_0x5ddc('0xf'));_0x34ef7a(_0x31f4ea[_0x5ddc('0x14')][_0x5ddc('0x13')]);}})[_0x5ddc('0x15')](function(_0x45a45c){logger[_0x5ddc('0x11')](_0x5ddc('0xe'),_0xe29cfd,_0x45a45c);_0x39ddb9(_0x45a45c);});});} \ No newline at end of file +var _0xd331=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xe41883,_0x1a0377){var _0xa727ff=function(_0x370bb5){while(--_0x370bb5){_0xe41883['push'](_0xe41883['shift']());}};_0xa727ff(++_0x1a0377);}(_0xd331,0x19c));var _0x1d33=function(_0x4c9cf5,_0x270730){_0x4c9cf5=_0x4c9cf5-0x0;var _0x58761e=_0xd331[_0x4c9cf5];return _0x58761e;};'use strict';var _=require(_0x1d33('0x0'));var util=require(_0x1d33('0x1'));var moment=require(_0x1d33('0x2'));var BPromise=require(_0x1d33('0x3'));var rs=require(_0x1d33('0x4'));var fs=require('fs');var Redis=require(_0x1d33('0x5'));var db=require(_0x1d33('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1d33('0x7'))(_0x1d33('0x8'));var config=require('../../config/environment');var jayson=require(_0x1d33('0x9'));var client=jayson[_0x1d33('0xa')][_0x1d33('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x37adbb,_0x132177,_0x5d219f){return new BPromise(function(_0x159284,_0x2a4758){return client[_0x1d33('0xc')](_0x37adbb,_0x5d219f)[_0x1d33('0xd')](function(_0x2f791d){logger[_0x1d33('0xe')](_0x1d33('0xf'),_0x132177,_0x1d33('0x10'));logger['debug'](_0x1d33('0x11'),_0x132177,_0x1d33('0x10'),JSON[_0x1d33('0x12')](_0x2f791d));if(_0x2f791d[_0x1d33('0x13')]){if(_0x2f791d['error'][_0x1d33('0x14')]===0x1f4){logger[_0x1d33('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x132177,_0x2f791d[_0x1d33('0x13')][_0x1d33('0x15')]);return _0x2a4758(_0x2f791d[_0x1d33('0x13')][_0x1d33('0x15')]);}logger['error'](_0x1d33('0xf'),_0x132177,_0x2f791d[_0x1d33('0x13')][_0x1d33('0x15')]);return _0x159284(_0x2f791d[_0x1d33('0x13')]['message']);}else{logger[_0x1d33('0xe')](_0x1d33('0xf'),_0x132177,'request\x20sent');_0x159284(_0x2f791d[_0x1d33('0x16')][_0x1d33('0x15')]);}})[_0x1d33('0x17')](function(_0xee37a5){logger[_0x1d33('0x13')](_0x1d33('0xf'),_0x132177,_0xee37a5);_0x2a4758(_0xee37a5);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index f023f4c..1a15870 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 _0x9041=['../../config/environment','isAuthenticated','index','get','/:id','show','post','create','update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9041,0x1c4));var _0x1904=function(_0x5f0a8f,_0x431f9b){_0x5f0a8f=_0x5f0a8f-0x0;var _0xabeb93=_0x9041[_0x5f0a8f];return _0xabeb93;};'use strict';var multer=require(_0x1904('0x0'));var util=require(_0x1904('0x1'));var path=require(_0x1904('0x2'));var timeout=require(_0x1904('0x3'));var express=require(_0x1904('0x4'));var router=express[_0x1904('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1904('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1904('0x7'));var controller=require('./userProfileSection.controller');router['get']('/',auth[_0x1904('0x8')](),controller[_0x1904('0x9')]);router[_0x1904('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x1904('0xa')](_0x1904('0xb'),auth['isAuthenticated'](),controller[_0x1904('0xc')]);router[_0x1904('0xd')]('/',auth['isAuthenticated'](),controller[_0x1904('0xe')]);router['put']('/:id',auth[_0x1904('0x8')](),controller[_0x1904('0xf')]);router[_0x1904('0x10')](_0x1904('0xb'),auth[_0x1904('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe655=['connect-timeout','express','Router','fs-extra','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','/:id','create','put','delete','exports','multer','path'];(function(_0x38b747,_0x355482){var _0x52db08=function(_0x3c328a){while(--_0x3c328a){_0x38b747['push'](_0x38b747['shift']());}};_0x52db08(++_0x355482);}(_0xe655,0xfa));var _0x5e65=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe655[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0x5e65('0x0'));var util=require('util');var path=require(_0x5e65('0x1'));var timeout=require(_0x5e65('0x2'));var express=require(_0x5e65('0x3'));var router=express[_0x5e65('0x4')]();var fs_extra=require(_0x5e65('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5e65('0x6'));var controller=require(_0x5e65('0x7'));router[_0x5e65('0x8')]('/',auth[_0x5e65('0x9')](),controller[_0x5e65('0xa')]);router[_0x5e65('0x8')](_0x5e65('0xb'),auth[_0x5e65('0x9')](),controller[_0x5e65('0xc')]);router['get'](_0x5e65('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x5e65('0x9')](),controller[_0x5e65('0xe')]);router[_0x5e65('0xf')]('/:id',auth[_0x5e65('0x9')](),controller['update']);router[_0x5e65('0x10')](_0x5e65('0xd'),auth[_0x5e65('0x9')](),controller['destroy']);module[_0x5e65('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 f1919fe..ba44cfa 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 _0x7916=['getDataValue','sequelize','STRING','BOOLEAN','crudPermissions'];(function(_0x56c70f,_0x4e4493){var _0x3812ed=function(_0x25460f){while(--_0x25460f){_0x56c70f['push'](_0x56c70f['shift']());}};_0x3812ed(++_0x4e4493);}(_0x7916,0x128));var _0x6791=function(_0x1d2d61,_0x27ab3c){_0x1d2d61=_0x1d2d61-0x0;var _0x312691=_0x7916[_0x1d2d61];return _0x312691;};'use strict';var Sequelize=require(_0x6791('0x0'));module['exports']={'name':{'type':Sequelize[_0x6791('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x6791('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x6791('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x6791('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x6791('0x1')],'set':function(_0x330476){this['setDataValue'](_0x6791('0x3'),_0x330476?_0x330476['join'](''):[]);},'get':function(){return this[_0x6791('0x4')](_0x6791('0x3'))?this['getDataValue'](_0x6791('0x3'))['split'](''):[];}}}; \ No newline at end of file +var _0xcf66=['getDataValue','crudPermissions','split','sequelize','exports','STRING','INTEGER','BOOLEAN','setDataValue','join'];(function(_0x5d8d16,_0x181e03){var _0x3921bb=function(_0x2121cb){while(--_0x2121cb){_0x5d8d16['push'](_0x5d8d16['shift']());}};_0x3921bb(++_0x181e03);}(_0xcf66,0x71));var _0x6cf6=function(_0x4a8336,_0x34571a){_0x4a8336=_0x4a8336-0x0;var _0x1fd385=_0xcf66[_0x4a8336];return _0x1fd385;};'use strict';var Sequelize=require(_0x6cf6('0x0'));module[_0x6cf6('0x1')]={'name':{'type':Sequelize[_0x6cf6('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0x6cf6('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x6cf6('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x1c599d){this[_0x6cf6('0x5')]('crudPermissions',_0x1c599d?_0x1c599d[_0x6cf6('0x6')](''):[]);},'get':function(){return this[_0x6cf6('0x7')](_0x6cf6('0x8'))?this['getDataValue'](_0x6cf6('0x8'))[_0x6cf6('0x9')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index ab3a5ad..011e1e1 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 _0xcd74=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','UserProfileSection','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','hasOwnProperty','nolimit','sort','where','merge','filter','options','findAll','rows','show','params','fields','length','includeAll','include','find','create','body','catch','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv'];(function(_0x3ec122,_0x55150a){var _0x4ecf41=function(_0x1709cd){while(--_0x1709cd){_0x3ec122['push'](_0x3ec122['shift']());}};_0x4ecf41(++_0x55150a);}(_0xcd74,0x180));var _0x4cd7=function(_0x3102a2,_0x54ecda){_0x3102a2=_0x3102a2-0x0;var _0x4fc3fe=_0xcd74[_0x3102a2];return _0x4fc3fe;};'use strict';var emlformat=require(_0x4cd7('0x0'));var rimraf=require(_0x4cd7('0x1'));var zipdir=require(_0x4cd7('0x2'));var jsonpatch=require(_0x4cd7('0x3'));var rp=require(_0x4cd7('0x4'));var moment=require(_0x4cd7('0x5'));var BPromise=require(_0x4cd7('0x6'));var Mustache=require(_0x4cd7('0x7'));var util=require('util');var path=require(_0x4cd7('0x8'));var sox=require(_0x4cd7('0x9'));var csv=require(_0x4cd7('0xa'));var ejs=require(_0x4cd7('0xb'));var fs=require('fs');var fs_extra=require(_0x4cd7('0xc'));var _=require(_0x4cd7('0xd'));var squel=require(_0x4cd7('0xe'));var crypto=require(_0x4cd7('0xf'));var jsforce=require(_0x4cd7('0x10'));var deskjs=require(_0x4cd7('0x11'));var toCsv=require(_0x4cd7('0xa'));var querystring=require('querystring');var Papa=require(_0x4cd7('0x12'));var Redis=require(_0x4cd7('0x13'));var authService=require(_0x4cd7('0x14'));var qs=require(_0x4cd7('0x15'));var as=require(_0x4cd7('0x16'));var hardwareService=require(_0x4cd7('0x17'));var logger=require(_0x4cd7('0x18'))(_0x4cd7('0x19'));var utils=require('../../config/utils');var config=require(_0x4cd7('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x4cd7('0x1b'))['db'];function respondWithStatusCode(_0x5bc728,_0x2765e5){_0x2765e5=_0x2765e5||0xcc;return function(_0x410d26){if(_0x410d26){return _0x5bc728['sendStatus'](_0x2765e5);}return _0x5bc728[_0x4cd7('0x1c')](_0x2765e5)[_0x4cd7('0x1d')]();};}function respondWithResult(_0x4db996,_0x141053){_0x141053=_0x141053||0xc8;return function(_0x13317a){if(_0x13317a){return _0x4db996[_0x4cd7('0x1c')](_0x141053)[_0x4cd7('0x1e')](_0x13317a);}};}function respondWithFilteredResult(_0x89fbb1,_0x59e1d8){return function(_0x2bdce4){if(_0x2bdce4){var _0x27a510=typeof _0x59e1d8[_0x4cd7('0x1f')]==='undefined'&&typeof _0x59e1d8['limit']===_0x4cd7('0x20');var _0x5f63d6=_0x2bdce4['count'];var _0x16813=_0x27a510?0x0:_0x59e1d8[_0x4cd7('0x1f')];var _0x242299=_0x27a510?_0x2bdce4[_0x4cd7('0x21')]:_0x59e1d8['offset']+_0x59e1d8[_0x4cd7('0x22')];var _0x4f6f7a;if(_0x242299>=_0x5f63d6){_0x242299=_0x5f63d6;_0x4f6f7a=0xc8;}else{_0x4f6f7a=0xce;}_0x89fbb1[_0x4cd7('0x1c')](_0x4f6f7a);return _0x89fbb1['set'](_0x4cd7('0x23'),_0x16813+'-'+_0x242299+'/'+_0x5f63d6)['json'](_0x2bdce4);}return null;};}function patchUpdates(_0x1e6bc6){return function(_0x49e6b2){try{jsonpatch[_0x4cd7('0x24')](_0x49e6b2,_0x1e6bc6,!![]);}catch(_0x1ef1bd){return BPromise[_0x4cd7('0x25')](_0x1ef1bd);}return _0x49e6b2[_0x4cd7('0x26')]();};}function saveUpdates(_0x5cfb8a,_0x11c134){return function(_0x56bc10){if(_0x56bc10){return _0x56bc10[_0x4cd7('0x27')](_0x5cfb8a)[_0x4cd7('0x28')](function(_0x3a020e){return _0x3a020e;});}return null;};}function removeEntity(_0x214a39,_0x3e0a07){return function(_0x3eebe9){if(_0x3eebe9){return _0x3eebe9['destroy']()['then'](function(){_0x214a39[_0x4cd7('0x1c')](0xcc)[_0x4cd7('0x1d')]();});}};}function handleEntityNotFound(_0x57072a,_0x1f71fb){return function(_0x3552c8){if(!_0x3552c8){_0x57072a[_0x4cd7('0x29')](0x194);}return _0x3552c8;};}function handleError(_0x55591f,_0x4da840){_0x4da840=_0x4da840||0x1f4;return function(_0x3bc587){logger[_0x4cd7('0x2a')](_0x3bc587[_0x4cd7('0x2b')]);if(_0x3bc587[_0x4cd7('0x2c')]){delete _0x3bc587[_0x4cd7('0x2c')];}_0x55591f[_0x4cd7('0x1c')](_0x4da840)[_0x4cd7('0x2d')](_0x3bc587);};}exports[_0x4cd7('0x2e')]=function(_0x3311be,_0x203785){var _0x5ae266={},_0x1cebef={},_0x23bd67={'count':0x0,'rows':[]};var _0xc9b0db=_[_0x4cd7('0x2f')](db[_0x4cd7('0x30')][_0x4cd7('0x31')],function(_0x4440da){return{'name':_0x4440da[_0x4cd7('0x32')],'type':_0x4440da[_0x4cd7('0x33')]['key']};});_0x1cebef[_0x4cd7('0x34')]=_[_0x4cd7('0x2f')](_0xc9b0db,_0x4cd7('0x2c'));_0x1cebef[_0x4cd7('0x35')]=_[_0x4cd7('0x36')](_0x3311be[_0x4cd7('0x35')]);_0x1cebef[_0x4cd7('0x37')]=_['intersection'](_0x1cebef[_0x4cd7('0x34')],_0x1cebef[_0x4cd7('0x35')]);_0x5ae266[_0x4cd7('0x38')]=_[_0x4cd7('0x39')](_0x1cebef[_0x4cd7('0x34')],qs['fields'](_0x3311be['query']['fields']));_0x5ae266['attributes']=_0x5ae266['attributes']['length']?_0x5ae266['attributes']:_0x1cebef[_0x4cd7('0x34')];if(!_0x3311be[_0x4cd7('0x35')][_0x4cd7('0x3a')](_0x4cd7('0x3b'))){_0x5ae266[_0x4cd7('0x22')]=qs[_0x4cd7('0x22')](_0x3311be['query'][_0x4cd7('0x22')]);_0x5ae266[_0x4cd7('0x1f')]=qs[_0x4cd7('0x1f')](_0x3311be[_0x4cd7('0x35')][_0x4cd7('0x1f')]);}_0x5ae266['order']=qs['sort'](_0x3311be[_0x4cd7('0x35')][_0x4cd7('0x3c')]);_0x5ae266['where']=qs[_0x4cd7('0x37')](_['pick'](_0x3311be[_0x4cd7('0x35')],_0x1cebef['filters']),_0xc9b0db);if(_0x3311be[_0x4cd7('0x35')]['filter']){_0x5ae266[_0x4cd7('0x3d')]=_[_0x4cd7('0x3e')](_0x5ae266['where'],{'$or':_['map'](_0xc9b0db,function(_0x278fb5){if(_0x278fb5[_0x4cd7('0x33')]!=='VIRTUAL'){var _0x4b8451={};_0x4b8451[_0x278fb5[_0x4cd7('0x2c')]]={'$like':'%'+_0x3311be['query'][_0x4cd7('0x3f')]+'%'};return _0x4b8451;}})});}_0x5ae266=_[_0x4cd7('0x3e')]({},_0x5ae266,_0x3311be[_0x4cd7('0x40')]);var _0x59d074={'where':_0x5ae266['where']};return db[_0x4cd7('0x30')]['count'](_0x59d074)[_0x4cd7('0x28')](function(_0x2b89da){_0x23bd67['count']=_0x2b89da;if(_0x3311be[_0x4cd7('0x35')]['includeAll']){_0x5ae266['include']=[{'all':!![]}];}return db[_0x4cd7('0x30')][_0x4cd7('0x41')](_0x5ae266);})[_0x4cd7('0x28')](function(_0x2d1b0d){_0x23bd67[_0x4cd7('0x42')]=_0x2d1b0d;return _0x23bd67;})[_0x4cd7('0x28')](respondWithFilteredResult(_0x203785,_0x5ae266))['catch'](handleError(_0x203785,null));};exports[_0x4cd7('0x43')]=function(_0x5f14fe,_0x87fb94){var _0x4df659={'raw':![],'where':{'id':_0x5f14fe[_0x4cd7('0x44')]['id']}},_0x18e0fe={};_0x18e0fe[_0x4cd7('0x34')]=_[_0x4cd7('0x36')](db[_0x4cd7('0x30')][_0x4cd7('0x31')]);_0x18e0fe[_0x4cd7('0x35')]=_[_0x4cd7('0x36')](_0x5f14fe[_0x4cd7('0x35')]);_0x18e0fe[_0x4cd7('0x37')]=_['intersection'](_0x18e0fe['model'],_0x18e0fe['query']);_0x4df659[_0x4cd7('0x38')]=_[_0x4cd7('0x39')](_0x18e0fe[_0x4cd7('0x34')],qs[_0x4cd7('0x45')](_0x5f14fe[_0x4cd7('0x35')]['fields']));_0x4df659[_0x4cd7('0x38')]=_0x4df659[_0x4cd7('0x38')][_0x4cd7('0x46')]?_0x4df659[_0x4cd7('0x38')]:_0x18e0fe['model'];if(_0x5f14fe['query'][_0x4cd7('0x47')]){_0x4df659[_0x4cd7('0x48')]=[{'all':!![]}];}_0x4df659=_[_0x4cd7('0x3e')]({},_0x4df659,_0x5f14fe['options']);return db[_0x4cd7('0x30')][_0x4cd7('0x49')](_0x4df659)['then'](handleEntityNotFound(_0x87fb94,null))[_0x4cd7('0x28')](respondWithResult(_0x87fb94,null))['catch'](handleError(_0x87fb94,null));};exports['create']=function(_0x4d3924,_0x182a0a){return db[_0x4cd7('0x30')][_0x4cd7('0x4a')](_0x4d3924[_0x4cd7('0x4b')],{})[_0x4cd7('0x28')](respondWithResult(_0x182a0a,0xc9))[_0x4cd7('0x4c')](handleError(_0x182a0a,null));};exports['update']=function(_0x5c22b8,_0x5becfb){if(_0x5c22b8[_0x4cd7('0x4b')]['id']){delete _0x5c22b8['body']['id'];}return db[_0x4cd7('0x30')][_0x4cd7('0x49')]({'where':{'id':_0x5c22b8[_0x4cd7('0x44')]['id']}})[_0x4cd7('0x28')](handleEntityNotFound(_0x5becfb,null))[_0x4cd7('0x28')](saveUpdates(_0x5c22b8[_0x4cd7('0x4b')],null))['then'](respondWithResult(_0x5becfb,null))[_0x4cd7('0x4c')](handleError(_0x5becfb,null));};exports[_0x4cd7('0x4d')]=function(_0x13b3fb,_0x15ba32){return db[_0x4cd7('0x30')]['find']({'where':{'id':_0x13b3fb[_0x4cd7('0x44')]['id']}})['then'](handleEntityNotFound(_0x15ba32,null))['then'](removeEntity(_0x15ba32,null))[_0x4cd7('0x4c')](handleError(_0x15ba32,null));};exports[_0x4cd7('0x4e')]=function(_0x43fa3e,_0x42c215){return db['UserProfileSection'][_0x4cd7('0x4e')]()['then'](respondWithResult(_0x42c215,null))['catch'](handleError(_0x42c215,null));}; \ No newline at end of file +var _0xa4da=['squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','apply','reject','save','update','then','destroy','end','error','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','UserProfileSection','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs'];(function(_0x55707a,_0x393aa5){var _0x2271df=function(_0x4e06cf){while(--_0x4e06cf){_0x55707a['push'](_0x55707a['shift']());}};_0x2271df(++_0x393aa5);}(_0xa4da,0x124));var _0xaa4d=function(_0x3ad7ad,_0x291a8d){_0x3ad7ad=_0x3ad7ad-0x0;var _0x225a60=_0xa4da[_0x3ad7ad];return _0x225a60;};'use strict';var emlformat=require(_0xaa4d('0x0'));var rimraf=require(_0xaa4d('0x1'));var zipdir=require(_0xaa4d('0x2'));var jsonpatch=require(_0xaa4d('0x3'));var rp=require(_0xaa4d('0x4'));var moment=require(_0xaa4d('0x5'));var BPromise=require(_0xaa4d('0x6'));var Mustache=require(_0xaa4d('0x7'));var util=require(_0xaa4d('0x8'));var path=require(_0xaa4d('0x9'));var sox=require('sox');var csv=require(_0xaa4d('0xa'));var ejs=require(_0xaa4d('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xaa4d('0xc'));var crypto=require('crypto');var jsforce=require(_0xaa4d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaa4d('0xa'));var querystring=require('querystring');var Papa=require(_0xaa4d('0xe'));var Redis=require(_0xaa4d('0xf'));var authService=require(_0xaa4d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xaa4d('0x11'));var hardwareService=require(_0xaa4d('0x12'));var logger=require('../../config/logger')(_0xaa4d('0x13'));var utils=require(_0xaa4d('0x14'));var config=require(_0xaa4d('0x15'));var licenseUtil=require(_0xaa4d('0x16'));var db=require(_0xaa4d('0x17'))['db'];function respondWithStatusCode(_0x93a364,_0x2c6164){_0x2c6164=_0x2c6164||0xcc;return function(_0x4339e3){if(_0x4339e3){return _0x93a364[_0xaa4d('0x18')](_0x2c6164);}return _0x93a364[_0xaa4d('0x19')](_0x2c6164)['end']();};}function respondWithResult(_0x771a1,_0x5d0f39){_0x5d0f39=_0x5d0f39||0xc8;return function(_0x373cb0){if(_0x373cb0){return _0x771a1['status'](_0x5d0f39)[_0xaa4d('0x1a')](_0x373cb0);}};}function respondWithFilteredResult(_0x3eb196,_0x4a215b){return function(_0x526e68){if(_0x526e68){var _0x1833e6=typeof _0x4a215b[_0xaa4d('0x1b')]===_0xaa4d('0x1c')&&typeof _0x4a215b['limit']===_0xaa4d('0x1c');var _0x3070f9=_0x526e68['count'];var _0x1c7815=_0x1833e6?0x0:_0x4a215b['offset'];var _0x1e09c2=_0x1833e6?_0x526e68[_0xaa4d('0x1d')]:_0x4a215b['offset']+_0x4a215b['limit'];var _0x5b5647;if(_0x1e09c2>=_0x3070f9){_0x1e09c2=_0x3070f9;_0x5b5647=0xc8;}else{_0x5b5647=0xce;}_0x3eb196[_0xaa4d('0x19')](_0x5b5647);return _0x3eb196['set']('Content-Range',_0x1c7815+'-'+_0x1e09c2+'/'+_0x3070f9)[_0xaa4d('0x1a')](_0x526e68);}return null;};}function patchUpdates(_0x8d9068){return function(_0x2a457e){try{jsonpatch[_0xaa4d('0x1e')](_0x2a457e,_0x8d9068,!![]);}catch(_0x1609f2){return BPromise[_0xaa4d('0x1f')](_0x1609f2);}return _0x2a457e[_0xaa4d('0x20')]();};}function saveUpdates(_0x57d333,_0x16c277){return function(_0x251590){if(_0x251590){return _0x251590[_0xaa4d('0x21')](_0x57d333)[_0xaa4d('0x22')](function(_0xec1f74){return _0xec1f74;});}return null;};}function removeEntity(_0x3797c5,_0x2c04b8){return function(_0x4a1d35){if(_0x4a1d35){return _0x4a1d35[_0xaa4d('0x23')]()[_0xaa4d('0x22')](function(){_0x3797c5[_0xaa4d('0x19')](0xcc)[_0xaa4d('0x24')]();});}};}function handleEntityNotFound(_0x5bc0d1,_0xf88b0c){return function(_0x1ec025){if(!_0x1ec025){_0x5bc0d1[_0xaa4d('0x18')](0x194);}return _0x1ec025;};}function handleError(_0x27e457,_0x11e203){_0x11e203=_0x11e203||0x1f4;return function(_0x357141){logger[_0xaa4d('0x25')](_0x357141['stack']);if(_0x357141[_0xaa4d('0x26')]){delete _0x357141[_0xaa4d('0x26')];}_0x27e457[_0xaa4d('0x19')](_0x11e203)[_0xaa4d('0x27')](_0x357141);};}exports[_0xaa4d('0x28')]=function(_0x9aa633,_0x5d1268){var _0x42dd21={},_0x3cc7fe={},_0x481099={'count':0x0,'rows':[]};var _0x14e182=_[_0xaa4d('0x29')](db['UserProfileSection'][_0xaa4d('0x2a')],function(_0x4d3676){return{'name':_0x4d3676[_0xaa4d('0x2b')],'type':_0x4d3676[_0xaa4d('0x2c')][_0xaa4d('0x2d')]};});_0x3cc7fe[_0xaa4d('0x2e')]=_[_0xaa4d('0x29')](_0x14e182,_0xaa4d('0x26'));_0x3cc7fe['query']=_[_0xaa4d('0x2f')](_0x9aa633[_0xaa4d('0x30')]);_0x3cc7fe[_0xaa4d('0x31')]=_[_0xaa4d('0x32')](_0x3cc7fe['model'],_0x3cc7fe[_0xaa4d('0x30')]);_0x42dd21[_0xaa4d('0x33')]=_[_0xaa4d('0x32')](_0x3cc7fe[_0xaa4d('0x2e')],qs[_0xaa4d('0x34')](_0x9aa633[_0xaa4d('0x30')][_0xaa4d('0x34')]));_0x42dd21[_0xaa4d('0x33')]=_0x42dd21[_0xaa4d('0x33')]['length']?_0x42dd21[_0xaa4d('0x33')]:_0x3cc7fe[_0xaa4d('0x2e')];if(!_0x9aa633[_0xaa4d('0x30')]['hasOwnProperty'](_0xaa4d('0x35'))){_0x42dd21['limit']=qs[_0xaa4d('0x36')](_0x9aa633['query'][_0xaa4d('0x36')]);_0x42dd21[_0xaa4d('0x1b')]=qs[_0xaa4d('0x1b')](_0x9aa633[_0xaa4d('0x30')][_0xaa4d('0x1b')]);}_0x42dd21[_0xaa4d('0x37')]=qs['sort'](_0x9aa633[_0xaa4d('0x30')][_0xaa4d('0x38')]);_0x42dd21[_0xaa4d('0x39')]=qs[_0xaa4d('0x31')](_[_0xaa4d('0x3a')](_0x9aa633[_0xaa4d('0x30')],_0x3cc7fe[_0xaa4d('0x31')]),_0x14e182);if(_0x9aa633['query'][_0xaa4d('0x3b')]){_0x42dd21[_0xaa4d('0x39')]=_[_0xaa4d('0x3c')](_0x42dd21['where'],{'$or':_['map'](_0x14e182,function(_0x15721f){if(_0x15721f[_0xaa4d('0x2c')]!==_0xaa4d('0x3d')){var _0x584ca5={};_0x584ca5[_0x15721f['name']]={'$like':'%'+_0x9aa633[_0xaa4d('0x30')][_0xaa4d('0x3b')]+'%'};return _0x584ca5;}})});}_0x42dd21=_[_0xaa4d('0x3c')]({},_0x42dd21,_0x9aa633[_0xaa4d('0x3e')]);var _0x4041e9={'where':_0x42dd21[_0xaa4d('0x39')]};return db[_0xaa4d('0x3f')][_0xaa4d('0x1d')](_0x4041e9)[_0xaa4d('0x22')](function(_0x10e061){_0x481099[_0xaa4d('0x1d')]=_0x10e061;if(_0x9aa633[_0xaa4d('0x30')][_0xaa4d('0x40')]){_0x42dd21[_0xaa4d('0x41')]=[{'all':!![]}];}return db[_0xaa4d('0x3f')][_0xaa4d('0x42')](_0x42dd21);})[_0xaa4d('0x22')](function(_0x387bb1){_0x481099[_0xaa4d('0x43')]=_0x387bb1;return _0x481099;})[_0xaa4d('0x22')](respondWithFilteredResult(_0x5d1268,_0x42dd21))[_0xaa4d('0x44')](handleError(_0x5d1268,null));};exports[_0xaa4d('0x45')]=function(_0x3ff248,_0x4bf771){var _0x2cb735={'raw':![],'where':{'id':_0x3ff248[_0xaa4d('0x46')]['id']}},_0x58acf8={};_0x58acf8['model']=_[_0xaa4d('0x2f')](db[_0xaa4d('0x3f')][_0xaa4d('0x2a')]);_0x58acf8[_0xaa4d('0x30')]=_['keys'](_0x3ff248[_0xaa4d('0x30')]);_0x58acf8[_0xaa4d('0x31')]=_[_0xaa4d('0x32')](_0x58acf8['model'],_0x58acf8[_0xaa4d('0x30')]);_0x2cb735[_0xaa4d('0x33')]=_[_0xaa4d('0x32')](_0x58acf8[_0xaa4d('0x2e')],qs['fields'](_0x3ff248[_0xaa4d('0x30')][_0xaa4d('0x34')]));_0x2cb735[_0xaa4d('0x33')]=_0x2cb735[_0xaa4d('0x33')][_0xaa4d('0x47')]?_0x2cb735['attributes']:_0x58acf8[_0xaa4d('0x2e')];if(_0x3ff248[_0xaa4d('0x30')][_0xaa4d('0x40')]){_0x2cb735[_0xaa4d('0x41')]=[{'all':!![]}];}_0x2cb735=_[_0xaa4d('0x3c')]({},_0x2cb735,_0x3ff248[_0xaa4d('0x3e')]);return db['UserProfileSection'][_0xaa4d('0x48')](_0x2cb735)['then'](handleEntityNotFound(_0x4bf771,null))[_0xaa4d('0x22')](respondWithResult(_0x4bf771,null))['catch'](handleError(_0x4bf771,null));};exports[_0xaa4d('0x49')]=function(_0x4a1230,_0x118943){return db[_0xaa4d('0x3f')]['create'](_0x4a1230['body'],{})[_0xaa4d('0x22')](respondWithResult(_0x118943,0xc9))['catch'](handleError(_0x118943,null));};exports[_0xaa4d('0x21')]=function(_0x556290,_0x5baed2){if(_0x556290[_0xaa4d('0x4a')]['id']){delete _0x556290['body']['id'];}return db[_0xaa4d('0x3f')][_0xaa4d('0x48')]({'where':{'id':_0x556290[_0xaa4d('0x46')]['id']}})['then'](handleEntityNotFound(_0x5baed2,null))[_0xaa4d('0x22')](saveUpdates(_0x556290[_0xaa4d('0x4a')],null))[_0xaa4d('0x22')](respondWithResult(_0x5baed2,null))[_0xaa4d('0x44')](handleError(_0x5baed2,null));};exports[_0xaa4d('0x23')]=function(_0x340313,_0xa9b411){return db[_0xaa4d('0x3f')][_0xaa4d('0x48')]({'where':{'id':_0x340313[_0xaa4d('0x46')]['id']}})[_0xaa4d('0x22')](handleEntityNotFound(_0xa9b411,null))[_0xaa4d('0x22')](removeEntity(_0xa9b411,null))[_0xaa4d('0x44')](handleError(_0xa9b411,null));};exports[_0xaa4d('0x4b')]=function(_0xe771de,_0x1da335){return db['UserProfileSection'][_0xaa4d('0x4b')]()[_0xaa4d('0x22')](respondWithResult(_0x1da335,null))[_0xaa4d('0x44')](handleError(_0x1da335,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 0d486dd..28d955e 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 _0xa7c0=['./userProfileSection.attributes','UserProfileSection','compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x440364,_0x58b9a2){var _0x4d1620=function(_0x2eccb7){while(--_0x2eccb7){_0x440364['push'](_0x440364['shift']());}};_0x4d1620(++_0x58b9a2);}(_0xa7c0,0xd7));var _0x0a7c=function(_0x4eb591,_0xb05c9d){_0x4eb591=_0x4eb591-0x0;var _0x31ef38=_0xa7c0[_0x4eb591];return _0x31ef38;};'use strict';var _=require(_0x0a7c('0x0'));var util=require(_0x0a7c('0x1'));var logger=require(_0x0a7c('0x2'))(_0x0a7c('0x3'));var moment=require(_0x0a7c('0x4'));var BPromise=require(_0x0a7c('0x5'));var rp=require(_0x0a7c('0x6'));var fs=require('fs');var path=require(_0x0a7c('0x7'));var rimraf=require(_0x0a7c('0x8'));var config=require(_0x0a7c('0x9'));var attributes=require(_0x0a7c('0xa'));module['exports']=function(_0x2d82c6,_0x51fdfd){return _0x2d82c6['define'](_0x0a7c('0xb'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x0a7c('0xc'),'fields':[_0x0a7c('0xd'),_0x0a7c('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb375=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','user_profile_has_sections','compositeIndex','sectionId','userProfileId'];(function(_0x17a21d,_0x3ea703){var _0x1f946a=function(_0x35c225){while(--_0x35c225){_0x17a21d['push'](_0x17a21d['shift']());}};_0x1f946a(++_0x3ea703);}(_0xb375,0x130));var _0x5b37=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb375[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5b37('0x0'));var util=require('util');var logger=require(_0x5b37('0x1'))(_0x5b37('0x2'));var moment=require(_0x5b37('0x3'));var BPromise=require(_0x5b37('0x4'));var rp=require(_0x5b37('0x5'));var fs=require('fs');var path=require(_0x5b37('0x6'));var rimraf=require(_0x5b37('0x7'));var config=require(_0x5b37('0x8'));var attributes=require(_0x5b37('0x9'));module[_0x5b37('0xa')]=function(_0xbe3f6,_0x125509){return _0xbe3f6[_0x5b37('0xb')]('UserProfileSection',attributes,{'tableName':_0x5b37('0xc'),'paranoid':![],'indexes':[{'name':_0x5b37('0xd'),'fields':[_0x5b37('0xe'),_0x5b37('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 d600e9c..710c10c 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 _0x4d9e=['UserProfileSection,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x5953e6,_0x5163c0){var _0x5e42c3=function(_0x38bbce){while(--_0x38bbce){_0x5953e6['push'](_0x5953e6['shift']());}};_0x5e42c3(++_0x5163c0);}(_0x4d9e,0x93));var _0xe4d9=function(_0x44b286,_0x545035){_0x44b286=_0x44b286-0x0;var _0x7d3a0c=_0x4d9e[_0x44b286];return _0x7d3a0c;};'use strict';var _=require('lodash');var util=require(_0xe4d9('0x0'));var moment=require(_0xe4d9('0x1'));var BPromise=require(_0xe4d9('0x2'));var rs=require(_0xe4d9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe4d9('0x4'))['db'];var utils=require(_0xe4d9('0x5'));var logger=require(_0xe4d9('0x6'))(_0xe4d9('0x7'));var config=require(_0xe4d9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe4d9('0x9')][_0xe4d9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30145b,_0x20b829,_0x4e2df0){return new BPromise(function(_0x301dd1,_0x16812c){return client[_0xe4d9('0xb')](_0x30145b,_0x4e2df0)[_0xe4d9('0xc')](function(_0x4224fc){logger[_0xe4d9('0xd')](_0xe4d9('0xe'),_0x20b829,'request\x20sent');logger[_0xe4d9('0xf')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x20b829,_0xe4d9('0x10'),JSON[_0xe4d9('0x11')](_0x4224fc));if(_0x4224fc[_0xe4d9('0x12')]){if(_0x4224fc[_0xe4d9('0x12')][_0xe4d9('0x13')]===0x1f4){logger['error'](_0xe4d9('0xe'),_0x20b829,_0x4224fc[_0xe4d9('0x12')][_0xe4d9('0x14')]);return _0x16812c(_0x4224fc[_0xe4d9('0x12')][_0xe4d9('0x14')]);}logger[_0xe4d9('0x12')](_0xe4d9('0xe'),_0x20b829,_0x4224fc['error'][_0xe4d9('0x14')]);return _0x301dd1(_0x4224fc[_0xe4d9('0x12')][_0xe4d9('0x14')]);}else{logger[_0xe4d9('0xd')]('UserProfileSection,\x20%s,\x20%s',_0x20b829,_0xe4d9('0x10'));_0x301dd1(_0x4224fc[_0xe4d9('0x15')][_0xe4d9('0x14')]);}})[_0xe4d9('0x16')](function(_0x2f79da){logger[_0xe4d9('0x12')](_0xe4d9('0xe'),_0x20b829,_0x2f79da);_0x16812c(_0x2f79da);});});} \ No newline at end of file +var _0xd881=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x3c9741,_0x557e3d){var _0x72aa01=function(_0x2fb44d){while(--_0x2fb44d){_0x3c9741['push'](_0x3c9741['shift']());}};_0x72aa01(++_0x557e3d);}(_0xd881,0x182));var _0x1d88=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xd881[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x1d88('0x0'));var util=require('util');var moment=require(_0x1d88('0x1'));var BPromise=require(_0x1d88('0x2'));var rs=require(_0x1d88('0x3'));var fs=require('fs');var Redis=require(_0x1d88('0x4'));var db=require(_0x1d88('0x5'))['db'];var utils=require(_0x1d88('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x1d88('0x7'));var jayson=require(_0x1d88('0x8'));var client=jayson[_0x1d88('0x9')][_0x1d88('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x576757,_0x3aa622,_0x19534b){return new BPromise(function(_0x4f09c7,_0x35e35f){return client[_0x1d88('0xb')](_0x576757,_0x19534b)[_0x1d88('0xc')](function(_0x34a5b9){logger[_0x1d88('0xd')](_0x1d88('0xe'),_0x3aa622,_0x1d88('0xf'));logger[_0x1d88('0x10')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x3aa622,_0x1d88('0xf'),JSON[_0x1d88('0x11')](_0x34a5b9));if(_0x34a5b9[_0x1d88('0x12')]){if(_0x34a5b9['error'][_0x1d88('0x13')]===0x1f4){logger['error'](_0x1d88('0xe'),_0x3aa622,_0x34a5b9['error']['message']);return _0x35e35f(_0x34a5b9[_0x1d88('0x12')][_0x1d88('0x14')]);}logger['error'](_0x1d88('0xe'),_0x3aa622,_0x34a5b9[_0x1d88('0x12')][_0x1d88('0x14')]);return _0x4f09c7(_0x34a5b9[_0x1d88('0x12')][_0x1d88('0x14')]);}else{logger['info'](_0x1d88('0xe'),_0x3aa622,_0x1d88('0xf'));_0x4f09c7(_0x34a5b9[_0x1d88('0x15')]['message']);}})[_0x1d88('0x16')](function(_0x4bb9a1){logger[_0x1d88('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x3aa622,_0x4bb9a1);_0x35e35f(_0x4bb9a1);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index e920555..d0af4c0 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x7314be,_0x5046a6){var _0x2adde1=function(_0x30d2a9){while(--_0x30d2a9){_0x7314be['push'](_0x7314be['shift']());}};_0x2adde1(++_0x5046a6);}(_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'));module['exports']=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3de8a2,_0x1c8615){var _0x267573=function(_0x51af8f){while(--_0x51af8f){_0x3de8a2['push'](_0x3de8a2['shift']());}};_0x267573(++_0x1c8615);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index fa95b3f..926b6cd 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 _0x5e53=['exports','sequelize'];(function(_0x5a57f2,_0x44e7b6){var _0x2c2c78=function(_0x43bf09){while(--_0x43bf09){_0x5a57f2['push'](_0x5a57f2['shift']());}};_0x2c2c78(++_0x44e7b6);}(_0x5e53,0xa7));var _0x35e5=function(_0x23251f,_0x5e5251){_0x23251f=_0x23251f-0x0;var _0x15a925=_0x5e53[_0x23251f];return _0x15a925;};'use strict';var Sequelize=require(_0x35e5('0x0'));module[_0x35e5('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xe855=['INTEGER','exports'];(function(_0x2ffae7,_0xf4f732){var _0x322914=function(_0x1fb30a){while(--_0x1fb30a){_0x2ffae7['push'](_0x2ffae7['shift']());}};_0x322914(++_0xf4f732);}(_0xe855,0x133));var _0x5e85=function(_0x4c09ff,_0x408200){_0x4c09ff=_0x4c09ff-0x0;var _0x5b3df2=_0xe855[_0x4c09ff];return _0x5b3df2;};'use strict';var Sequelize=require('sequelize');module[_0x5e85('0x0')]={'penalty':{'type':Sequelize[_0x5e85('0x1')],'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 93cc3eb..ac7331d 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 _0x8b8e=['lodash','../../config/logger','moment','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues'];(function(_0x1524e5,_0x3fbc03){var _0xfdf9bd=function(_0x3ce238){while(--_0x3ce238){_0x1524e5['push'](_0x1524e5['shift']());}};_0xfdf9bd(++_0x3fbc03);}(_0x8b8e,0x108));var _0xe8b8=function(_0x5e6346,_0x5d5ffc){_0x5e6346=_0x5e6346-0x0;var _0x500f3f=_0x8b8e[_0x5e6346];return _0x500f3f;};'use strict';var _=require(_0xe8b8('0x0'));var util=require('util');var logger=require(_0xe8b8('0x1'))('api');var moment=require(_0xe8b8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe8b8('0x3'));var rimraf=require(_0xe8b8('0x4'));var config=require(_0xe8b8('0x5'));var attributes=require(_0xe8b8('0x6'));module[_0xe8b8('0x7')]=function(_0x3f5dd7,_0x1c0548){return _0x3f5dd7[_0xe8b8('0x8')](_0xe8b8('0x9'),attributes,{'tableName':_0xe8b8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9fe7=['path','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','lodash','util','api','bluebird','request-promise'];(function(_0x165955,_0x323c0e){var _0x31a8d5=function(_0x1d7606){while(--_0x1d7606){_0x165955['push'](_0x165955['shift']());}};_0x31a8d5(++_0x323c0e);}(_0x9fe7,0x1df));var _0x79fe=function(_0x42e83f,_0x1645b8){_0x42e83f=_0x42e83f-0x0;var _0x5b028b=_0x9fe7[_0x42e83f];return _0x5b028b;};'use strict';var _=require(_0x79fe('0x0'));var util=require(_0x79fe('0x1'));var logger=require('../../config/logger')(_0x79fe('0x2'));var moment=require('moment');var BPromise=require(_0x79fe('0x3'));var rp=require(_0x79fe('0x4'));var fs=require('fs');var path=require(_0x79fe('0x5'));var rimraf=require('rimraf');var config=require(_0x79fe('0x6'));var attributes=require(_0x79fe('0x7'));module[_0x79fe('0x8')]=function(_0x4af9f6,_0x3cec9c){return _0x4af9f6[_0x79fe('0x9')](_0x79fe('0xa'),attributes,{'tableName':'user_has_sms_queues','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 837f1b7..c7df660 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 _0x6128=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x4144ca,_0x3f22e3){var _0x2de8ee=function(_0x160005){while(--_0x160005){_0x4144ca['push'](_0x4144ca['shift']());}};_0x2de8ee(++_0x3f22e3);}(_0x6128,0x85));var _0x8612=function(_0x24fadb,_0x5ea892){_0x24fadb=_0x24fadb-0x0;var _0x5d93f3=_0x6128[_0x24fadb];return _0x5d93f3;};'use strict';var _=require(_0x8612('0x0'));var util=require(_0x8612('0x1'));var moment=require(_0x8612('0x2'));var BPromise=require('bluebird');var rs=require(_0x8612('0x3'));var fs=require('fs');var Redis=require(_0x8612('0x4'));var db=require(_0x8612('0x5'))['db'];var utils=require(_0x8612('0x6'));var logger=require(_0x8612('0x7'))(_0x8612('0x8'));var config=require(_0x8612('0x9'));var jayson=require(_0x8612('0xa'));var client=jayson[_0x8612('0xb')][_0x8612('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x23f21d,_0x2b0537,_0x2fef4e){return new BPromise(function(_0x133e0c,_0x332fea){return client[_0x8612('0xd')](_0x23f21d,_0x2fef4e)['then'](function(_0x2bb55f){logger[_0x8612('0xe')](_0x8612('0xf'),_0x2b0537,_0x8612('0x10'));logger[_0x8612('0x11')](_0x8612('0x12'),_0x2b0537,'request\x20sent',JSON[_0x8612('0x13')](_0x2bb55f));if(_0x2bb55f['error']){if(_0x2bb55f[_0x8612('0x14')]['code']===0x1f4){logger[_0x8612('0x14')](_0x8612('0xf'),_0x2b0537,_0x2bb55f[_0x8612('0x14')][_0x8612('0x15')]);return _0x332fea(_0x2bb55f[_0x8612('0x14')][_0x8612('0x15')]);}logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x2b0537,_0x2bb55f[_0x8612('0x14')]['message']);return _0x133e0c(_0x2bb55f[_0x8612('0x14')][_0x8612('0x15')]);}else{logger[_0x8612('0xe')](_0x8612('0xf'),_0x2b0537,_0x8612('0x10'));_0x133e0c(_0x2bb55f['result'][_0x8612('0x15')]);}})[_0x8612('0x16')](function(_0x4e952a){logger[_0x8612('0x14')](_0x8612('0xf'),_0x2b0537,_0x4e952a);_0x332fea(_0x4e952a);});});} \ No newline at end of file +var _0x334b=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','moment','bluebird','randomstring'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x334b,0x1ea));var _0xb334=function(_0x5872b2,_0x21b9e0){_0x5872b2=_0x5872b2-0x0;var _0x417ba7=_0x334b[_0x5872b2];return _0x417ba7;};'use strict';var _=require(_0xb334('0x0'));var util=require('util');var moment=require(_0xb334('0x1'));var BPromise=require(_0xb334('0x2'));var rs=require(_0xb334('0x3'));var fs=require('fs');var Redis=require(_0xb334('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb334('0x5'));var logger=require(_0xb334('0x6'))(_0xb334('0x7'));var config=require(_0xb334('0x8'));var jayson=require(_0xb334('0x9'));var client=jayson['client'][_0xb334('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e8500,_0x2c377f,_0xb9a4a){return new BPromise(function(_0x7616ba,_0x4446e4){return client[_0xb334('0xb')](_0x1e8500,_0xb9a4a)['then'](function(_0x237025){logger[_0xb334('0xc')](_0xb334('0xd'),_0x2c377f,_0xb334('0xe'));logger['debug'](_0xb334('0xf'),_0x2c377f,'request\x20sent',JSON['stringify'](_0x237025));if(_0x237025[_0xb334('0x10')]){if(_0x237025['error']['code']===0x1f4){logger[_0xb334('0x10')](_0xb334('0xd'),_0x2c377f,_0x237025[_0xb334('0x10')]['message']);return _0x4446e4(_0x237025['error']['message']);}logger[_0xb334('0x10')](_0xb334('0xd'),_0x2c377f,_0x237025[_0xb334('0x10')][_0xb334('0x11')]);return _0x7616ba(_0x237025[_0xb334('0x10')][_0xb334('0x11')]);}else{logger[_0xb334('0xc')](_0xb334('0xd'),_0x2c377f,_0xb334('0xe'));_0x7616ba(_0x237025['result'][_0xb334('0x11')]);}})[_0xb334('0x12')](function(_0x34adc9){logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x2c377f,_0x34adc9);_0x4446e4(_0x34adc9);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 793d892..84f32e8 100644 --- a/server/api/userVoicePrefix/userVoicePrefix.attributes.js +++ b/server/api/userVoicePrefix/userVoicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8785=['INTEGER','sequelize','exports'];(function(_0x3a1522,_0x51684f){var _0x2c7785=function(_0xa99654){while(--_0xa99654){_0x3a1522['push'](_0x3a1522['shift']());}};_0x2c7785(++_0x51684f);}(_0x8785,0x14b));var _0x5878=function(_0x2f1bc2,_0x2b88c8){_0x2f1bc2=_0x2f1bc2-0x0;var _0xd6b8ed=_0x8785[_0x2f1bc2];return _0xd6b8ed;};'use strict';var Sequelize=require(_0x5878('0x0'));module[_0x5878('0x1')]={'UserId':{'type':Sequelize[_0x5878('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x5878('0x2')]}}; \ No newline at end of file +var _0xf849=['exports','INTEGER'];(function(_0x1b2134,_0x116665){var _0x156065=function(_0x4bff79){while(--_0x4bff79){_0x1b2134['push'](_0x1b2134['shift']());}};_0x156065(++_0x116665);}(_0xf849,0xb6));var _0x9f84=function(_0x333767,_0x220733){_0x333767=_0x333767-0x0;var _0x42a755=_0xf849[_0x333767];return _0x42a755;};'use strict';var Sequelize=require('sequelize');module[_0x9f84('0x0')]={'UserId':{'type':Sequelize[_0x9f84('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x9f84('0x1')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 57d9251..6025694 100644 --- a/server/api/userVoicePrefix/userVoicePrefix.model.js +++ b/server/api/userVoicePrefix/userVoicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x16b0e6,_0x1ae53b){var _0xe9a6f9=function(_0x169f07){while(--_0x169f07){_0x16b0e6['push'](_0x16b0e6['shift']());}};_0xe9a6f9(++_0x1ae53b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x150fc3,_0x29fd54){var _0x5bfc86=function(_0x101006){while(--_0x101006){_0x150fc3['push'](_0x150fc3['shift']());}};_0x5bfc86(++_0x29fd54);}(_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':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index d465581..fe6fb6f 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x404fa2,_0x5086b8){var _0x43c310=function(_0x57a180){while(--_0x57a180){_0x404fa2['push'](_0x404fa2['shift']());}};_0x43c310(++_0x5086b8);}(_0xedd9,0xfc));var _0x9edd=function(_0x38bb4e,_0x472809){_0x38bb4e=_0x38bb4e-0x0;var _0x55f334=_0xedd9[_0x38bb4e];return _0x55f334;};'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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4dedc1,_0x528a80){var _0x4b250d=function(_0x238817){while(--_0x238817){_0x4dedc1['push'](_0x4dedc1['shift']());}};_0x4b250d(++_0x528a80);}(_0xe706,0xa3));var _0x6e70=function(_0xec3cab,_0x3d89a1){_0xec3cab=_0xec3cab-0x0;var _0x2e4e51=_0xe706[_0xec3cab];return _0x2e4e51;};'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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 9c42212..d40d21f 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 _0x74ae=['exports','INTEGER','sequelize'];(function(_0x12d4df,_0x37c9d7){var _0x181dc5=function(_0x5e0f17){while(--_0x5e0f17){_0x12d4df['push'](_0x12d4df['shift']());}};_0x181dc5(++_0x37c9d7);}(_0x74ae,0x1d6));var _0xe74a=function(_0xc3bd53,_0x2f849a){_0xc3bd53=_0xc3bd53-0x0;var _0x404eac=_0x74ae[_0xc3bd53];return _0x404eac;};'use strict';var Sequelize=require(_0xe74a('0x0'));module[_0xe74a('0x1')]={'penalty':{'type':Sequelize[_0xe74a('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2243=['exports','INTEGER'];(function(_0x284f39,_0x20d91c){var _0x3987c0=function(_0x28f6e9){while(--_0x28f6e9){_0x284f39['push'](_0x284f39['shift']());}};_0x3987c0(++_0x20d91c);}(_0x2243,0x16a));var _0x3224=function(_0x5d68f4,_0x334b3c){_0x5d68f4=_0x5d68f4-0x0;var _0xf28bd0=_0x2243[_0x5d68f4];return _0xf28bd0;};'use strict';var Sequelize=require('sequelize');module[_0x3224('0x0')]={'penalty':{'type':Sequelize[_0x3224('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 1202356..643355c 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 _0x4c4a=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','util'];(function(_0x3e1681,_0x21ffb8){var _0x571b5a=function(_0x4c71d5){while(--_0x4c71d5){_0x3e1681['push'](_0x3e1681['shift']());}};_0x571b5a(++_0x21ffb8);}(_0x4c4a,0xf6));var _0xa4c4=function(_0x2d2ba8,_0x3648ac){_0x2d2ba8=_0x2d2ba8-0x0;var _0x394f61=_0x4c4a[_0x2d2ba8];return _0x394f61;};'use strict';var _=require('lodash');var util=require(_0xa4c4('0x0'));var logger=require('../../config/logger')(_0xa4c4('0x1'));var moment=require(_0xa4c4('0x2'));var BPromise=require(_0xa4c4('0x3'));var rp=require(_0xa4c4('0x4'));var fs=require('fs');var path=require(_0xa4c4('0x5'));var rimraf=require(_0xa4c4('0x6'));var config=require(_0xa4c4('0x7'));var attributes=require(_0xa4c4('0x8'));module[_0xa4c4('0x9')]=function(_0x5833e6,_0x403596){return _0x5833e6[_0xa4c4('0xa')](_0xa4c4('0xb'),attributes,{'tableName':_0xa4c4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x615b=['user_has_voice_queues','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','./userVoiceQueue.attributes','exports','UserVoiceQueue'];(function(_0x4a2e98,_0x33e945){var _0x141c90=function(_0x1004b8){while(--_0x1004b8){_0x4a2e98['push'](_0x4a2e98['shift']());}};_0x141c90(++_0x33e945);}(_0x615b,0x85));var _0xb615=function(_0x58c9fd,_0x34100c){_0x58c9fd=_0x58c9fd-0x0;var _0x4284f9=_0x615b[_0x58c9fd];return _0x4284f9;};'use strict';var _=require(_0xb615('0x0'));var util=require(_0xb615('0x1'));var logger=require(_0xb615('0x2'))('api');var moment=require(_0xb615('0x3'));var BPromise=require(_0xb615('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb615('0x5'));var rimraf=require('rimraf');var config=require(_0xb615('0x6'));var attributes=require(_0xb615('0x7'));module[_0xb615('0x8')]=function(_0x423845,_0x5adcc6){return _0x423845['define'](_0xb615('0x9'),attributes,{'tableName':_0xb615('0xa'),'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 16a1fa3..a1ff1d0 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 _0x9332=['bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','moment'];(function(_0x37f6b8,_0x171cad){var _0x505c37=function(_0x26b300){while(--_0x26b300){_0x37f6b8['push'](_0x37f6b8['shift']());}};_0x505c37(++_0x171cad);}(_0x9332,0x153));var _0x2933=function(_0x121035,_0x427bb2){_0x121035=_0x121035-0x0;var _0x236663=_0x9332[_0x121035];return _0x236663;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2933('0x0'));var BPromise=require(_0x2933('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2933('0x2'));var db=require(_0x2933('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2933('0x4'));var config=require(_0x2933('0x5'));var jayson=require(_0x2933('0x6'));var client=jayson[_0x2933('0x7')][_0x2933('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2552b5,_0x575d69,_0x70e50f){return new BPromise(function(_0x3366e0,_0x257fcc){return client[_0x2933('0x9')](_0x2552b5,_0x70e50f)['then'](function(_0x40ccd5){logger[_0x2933('0xa')](_0x2933('0xb'),_0x575d69,_0x2933('0xc'));logger[_0x2933('0xd')](_0x2933('0xe'),_0x575d69,'request\x20sent',JSON[_0x2933('0xf')](_0x40ccd5));if(_0x40ccd5[_0x2933('0x10')]){if(_0x40ccd5[_0x2933('0x10')][_0x2933('0x11')]===0x1f4){logger[_0x2933('0x10')](_0x2933('0xb'),_0x575d69,_0x40ccd5['error']['message']);return _0x257fcc(_0x40ccd5[_0x2933('0x10')]['message']);}logger['error'](_0x2933('0xb'),_0x575d69,_0x40ccd5[_0x2933('0x10')][_0x2933('0x12')]);return _0x3366e0(_0x40ccd5[_0x2933('0x10')][_0x2933('0x12')]);}else{logger[_0x2933('0xa')](_0x2933('0xb'),_0x575d69,_0x2933('0xc'));_0x3366e0(_0x40ccd5[_0x2933('0x13')]['message']);}})['catch'](function(_0x48edb7){logger[_0x2933('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x575d69,_0x48edb7);_0x257fcc(_0x48edb7);});});} \ No newline at end of file +var _0x1085=['debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserVoiceQueue,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','then','info','request\x20sent'];(function(_0x5750ea,_0x198bf8){var _0x40f8c0=function(_0x47d8e9){while(--_0x47d8e9){_0x5750ea['push'](_0x5750ea['shift']());}};_0x40f8c0(++_0x198bf8);}(_0x1085,0xd8));var _0x5108=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1085[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5108('0x0'));var util=require(_0x5108('0x1'));var moment=require('moment');var BPromise=require(_0x5108('0x2'));var rs=require(_0x5108('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5108('0x4'))['db'];var utils=require(_0x5108('0x5'));var logger=require('../../config/logger')(_0x5108('0x6'));var config=require(_0x5108('0x7'));var jayson=require(_0x5108('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x47965a,_0x48e3be,_0x11fae5){return new BPromise(function(_0x334bbf,_0x2661df){return client['request'](_0x47965a,_0x11fae5)[_0x5108('0x9')](function(_0x5b0655){logger[_0x5108('0xa')]('UserVoiceQueue,\x20%s,\x20%s',_0x48e3be,_0x5108('0xb'));logger[_0x5108('0xc')](_0x5108('0xd'),_0x48e3be,_0x5108('0xb'),JSON[_0x5108('0xe')](_0x5b0655));if(_0x5b0655[_0x5108('0xf')]){if(_0x5b0655['error']['code']===0x1f4){logger[_0x5108('0xf')](_0x5108('0x10'),_0x48e3be,_0x5b0655[_0x5108('0xf')][_0x5108('0x11')]);return _0x2661df(_0x5b0655[_0x5108('0xf')][_0x5108('0x11')]);}logger['error'](_0x5108('0x10'),_0x48e3be,_0x5b0655['error']['message']);return _0x334bbf(_0x5b0655[_0x5108('0xf')][_0x5108('0x11')]);}else{logger[_0x5108('0xa')](_0x5108('0x10'),_0x48e3be,'request\x20sent');_0x334bbf(_0x5b0655['result'][_0x5108('0x11')]);}})[_0x5108('0x12')](function(_0x50ed3b){logger[_0x5108('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x48e3be,_0x50ed3b);_0x2661df(_0x50ed3b);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 834ae22..b637da5 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x38ed42,_0x3d9a37){var _0x474931=function(_0x1fa601){while(--_0x1fa601){_0x38ed42['push'](_0x38ed42['shift']());}};_0x474931(++_0x3d9a37);}(_0x9c44,0x178));var _0x49c4=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x9c44[_0x543084];return _0x306a57;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x37ffc6,_0x251b7f){var _0x47faac=function(_0x2c8090){while(--_0x2c8090){_0x37ffc6['push'](_0x37ffc6['shift']());}};_0x47faac(++_0x251b7f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 385dca7..4652760 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 _0x7560=['sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x1863ff,_0x37ca63){var _0x23cbb9=function(_0x269c58){while(--_0x269c58){_0x1863ff['push'](_0x1863ff['shift']());}};_0x23cbb9(++_0x37ca63);}(_0x7560,0x18c));var _0x0756=function(_0x34d533,_0x161449){_0x34d533=_0x34d533-0x0;var _0x4731f5=_0x7560[_0x34d533];return _0x4731f5;};'use strict';var Sequelize=require(_0x0756('0x0'));module[_0x0756('0x1')]={'uniqueid':{'type':Sequelize[_0x0756('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x0756('0x3')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x0756('0x3')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x0756('0x4')],'allowNull':![],'unique':_0x0756('0x5'),'comment':_0x0756('0x3')},'VoiceQueueId':{'type':Sequelize[_0x0756('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x0756('0x4')],'allowNull':![],'unique':_0x0756('0x5'),'comment':_0x0756('0x3')},'penalty':{'type':Sequelize[_0x0756('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x0756('0x2')](0xb),'defaultValue':0x0,'comment':_0x0756('0x3')}}; \ No newline at end of file +var _0x977d=['INTEGER','STRING','queue_interface','Required\x20by\x20Asterisk','exports'];(function(_0x2a7e6e,_0x4e7dc6){var _0x9e1953=function(_0xe323cb){while(--_0xe323cb){_0x2a7e6e['push'](_0x2a7e6e['shift']());}};_0x9e1953(++_0x4e7dc6);}(_0x977d,0xea));var _0xd977=function(_0x1cba54,_0x346a8c){_0x1cba54=_0x1cba54-0x0;var _0x5380aa=_0x977d[_0x1cba54];return _0x5380aa;};'use strict';var Sequelize=require('sequelize');module[_0xd977('0x0')]={'uniqueid':{'type':Sequelize[_0xd977('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0xd977('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xd977('0x2')],'allowNull':![],'unique':_0xd977('0x3'),'comment':_0xd977('0x4')},'VoiceQueueId':{'type':Sequelize[_0xd977('0x1')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd977('0x3'),'comment':_0xd977('0x4')},'penalty':{'type':Sequelize[_0xd977('0x1')](0xb),'defaultValue':0x0,'comment':_0xd977('0x4')},'paused':{'type':Sequelize[_0xd977('0x1')](0xb),'defaultValue':0x0,'comment':_0xd977('0x4')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index ff116aa..280792f 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 _0xd055=['remove','emit','hook','events','UserVoiceQueueRt','setMaxListeners','save','update'];(function(_0x3f0553,_0x1ee7d8){var _0x185007=function(_0x47adc1){while(--_0x47adc1){_0x3f0553['push'](_0x3f0553['shift']());}};_0x185007(++_0x1ee7d8);}(_0xd055,0xb3));var _0x5d05=function(_0x5f1d5a,_0x1c85a7){_0x5f1d5a=_0x5f1d5a-0x0;var _0x449071=_0xd055[_0x5f1d5a];return _0x449071;};'use strict';var EventEmitter=require(_0x5d05('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x5d05('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x5d05('0x2')](0x0);var events={'afterCreate':_0x5d05('0x3'),'afterUpdate':_0x5d05('0x4'),'afterDestroy':_0x5d05('0x5')};function emitEvent(_0x754bc6){return function(_0x380bee,_0xcb09d9,_0x55fbad){UserVoiceQueueRtEvents[_0x5d05('0x6')](_0x754bc6+':'+_0x380bee['id'],_0x380bee);UserVoiceQueueRtEvents['emit'](_0x754bc6,_0x380bee);_0x55fbad(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x5d05('0x7')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x0ec1=['events','UserVoiceQueueRt','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x0ec1,0xa0));var _0x10ec=function(_0x11b0d3,_0x29202b){_0x11b0d3=_0x11b0d3-0x0;var _0x7c05c7=_0x0ec1[_0x11b0d3];return _0x7c05c7;};'use strict';var EventEmitter=require(_0x10ec('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x10ec('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x10ec('0x2'),'afterUpdate':_0x10ec('0x3'),'afterDestroy':'remove'};function emitEvent(_0x31530f){return function(_0x5061f1,_0x3aaeed,_0x382de7){UserVoiceQueueRtEvents[_0x10ec('0x4')](_0x31530f+':'+_0x5061f1['id'],_0x5061f1);UserVoiceQueueRtEvents[_0x10ec('0x4')](_0x31530f,_0x5061f1);_0x382de7(null);};}for(var e in events){if(events[_0x10ec('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0x10ec('0x6')](e,emitEvent(event));}}module[_0x10ec('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 0a3e7f5..800bd91 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 _0x9bea=['../../config/environment','exports','UserVoiceQueueRt','lodash','../../config/logger','api','moment','path'];(function(_0x38d271,_0x393700){var _0x146304=function(_0x3a2094){while(--_0x3a2094){_0x38d271['push'](_0x38d271['shift']());}};_0x146304(++_0x393700);}(_0x9bea,0x1db));var _0xa9be=function(_0x131c6d,_0x1569a3){_0x131c6d=_0x131c6d-0x0;var _0x431841=_0x9bea[_0x131c6d];return _0x431841;};'use strict';var _=require(_0xa9be('0x0'));var util=require('util');var logger=require(_0xa9be('0x1'))(_0xa9be('0x2'));var moment=require(_0xa9be('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa9be('0x4'));var rimraf=require('rimraf');var config=require(_0xa9be('0x5'));var attributes=require('./userVoiceQueueRt.attributes');module[_0xa9be('0x6')]=function(_0x493394,_0x463753){return _0x493394['define'](_0xa9be('0x7'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6fff=['rimraf','../../config/environment','./userVoiceQueueRt.attributes','util','api','moment','request-promise','path'];(function(_0x57644f,_0x46f798){var _0x4e5c8c=function(_0x4cd5e0){while(--_0x4cd5e0){_0x57644f['push'](_0x57644f['shift']());}};_0x4e5c8c(++_0x46f798);}(_0x6fff,0x133));var _0xf6ff=function(_0x11c5c5,_0x3bccea){_0x11c5c5=_0x11c5c5-0x0;var _0x3fef68=_0x6fff[_0x11c5c5];return _0x3fef68;};'use strict';var _=require('lodash');var util=require(_0xf6ff('0x0'));var logger=require('../../config/logger')(_0xf6ff('0x1'));var moment=require(_0xf6ff('0x2'));var BPromise=require('bluebird');var rp=require(_0xf6ff('0x3'));var fs=require('fs');var path=require(_0xf6ff('0x4'));var rimraf=require(_0xf6ff('0x5'));var config=require(_0xf6ff('0x6'));var attributes=require(_0xf6ff('0x7'));module['exports']=function(_0x149389,_0x5a9abe){return _0x149389['define']('UserVoiceQueueRt',attributes,{'tableName':'user_has_voice_queues_rt','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 29e7a81..1f6c3b8 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 _0xa0ae=['ioredis','../../mysqldb','../../config/logger','../../config/environment','client','redis','localhost','./userVoiceQueueRt.socket','request','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','sequelize','then','lodash','util','moment'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0xa0ae,0xba));var _0xea0a=function(_0x1ebc88,_0x638cd6){_0x1ebc88=_0x1ebc88-0x0;var _0xcef294=_0xa0ae[_0x1ebc88];return _0xcef294;};'use strict';var _=require(_0xea0a('0x0'));var util=require(_0xea0a('0x1'));var moment=require(_0xea0a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xea0a('0x3'));var db=require(_0xea0a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xea0a('0x5'))('rpc');var config=require(_0xea0a('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xea0a('0x7')]['http']({'port':0x232a});config[_0xea0a('0x8')]=_['defaults'](config['redis'],{'host':_0xea0a('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xea0a('0x8')]));require(_0xea0a('0xa'))['register'](socket);function respondWithRpcPromise(_0x23a7d3,_0x257075,_0x23a640){return new BPromise(function(_0x5d2356,_0x16bf4e){return client[_0xea0a('0xb')](_0x23a7d3,_0x23a640)['then'](function(_0x21d2a1){logger[_0xea0a('0xc')](_0xea0a('0xd'),_0x257075,_0xea0a('0xe'));logger[_0xea0a('0xf')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x257075,'request\x20sent',JSON['stringify'](_0x21d2a1));if(_0x21d2a1[_0xea0a('0x10')]){if(_0x21d2a1['error'][_0xea0a('0x11')]===0x1f4){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x257075,_0x21d2a1[_0xea0a('0x10')][_0xea0a('0x12')]);return _0x16bf4e(_0x21d2a1[_0xea0a('0x10')][_0xea0a('0x12')]);}logger[_0xea0a('0x10')](_0xea0a('0xd'),_0x257075,_0x21d2a1['error'][_0xea0a('0x12')]);return _0x5d2356(_0x21d2a1[_0xea0a('0x10')][_0xea0a('0x12')]);}else{logger[_0xea0a('0xc')](_0xea0a('0xd'),_0x257075,_0xea0a('0xe'));_0x5d2356(_0x21d2a1[_0xea0a('0x13')]['message']);}})['catch'](function(_0x3726be){logger['error'](_0xea0a('0xd'),_0x257075,_0x3726be);_0x16bf4e(_0x3726be);});});}exports[_0xea0a('0x14')]=function(_0x434257){var _0x36f42b=this;return new Promise(function(_0x5c3dc1,_0x2ae82b){return db[_0xea0a('0x15')][_0xea0a('0x16')]({'raw':_0x434257[_0xea0a('0x17')]?_0x434257['options'][_0xea0a('0x18')]===undefined?!![]:![]:!![],'where':_0x434257['options']?_0x434257[_0xea0a('0x17')]['where']||null:null,'attributes':[[db[_0xea0a('0x19')]['fn']('COUNT',db[_0xea0a('0x19')]['fn']('IF',db[_0xea0a('0x19')]['literal']('`paused`\x20=\x201,\x201,\x20null'))),'outboundQueuePauses']]})[_0xea0a('0x1a')](function(_0xc9384c){logger['info']('GetVoiceQueueRtPauses',_0x434257);logger[_0xea0a('0xf')](_0xea0a('0x14'),_0x434257,JSON['stringify'](_0xc9384c));_0x5c3dc1(_0xc9384c);})['catch'](function(_0xffcf79){logger[_0xea0a('0x10')](_0xea0a('0x14'),_0xffcf79[_0xea0a('0x12')],_0x434257);_0x2ae82b(_0x36f42b[_0xea0a('0x10')](0x1f4,_0xffcf79[_0xea0a('0x12')]));});});}; \ No newline at end of file +var _0x7b38=['request','info','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','message','UserVoiceQueueRt,\x20%s,\x20%s','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','then','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket'];(function(_0x81bdf4,_0x1591bc){var _0x415cd9=function(_0xb08ba0){while(--_0xb08ba0){_0x81bdf4['push'](_0x81bdf4['shift']());}};_0x415cd9(++_0x1591bc);}(_0x7b38,0x120));var _0x87b3=function(_0x19fa8e,_0x256878){_0x19fa8e=_0x19fa8e-0x0;var _0x4401dc=_0x7b38[_0x19fa8e];return _0x4401dc;};'use strict';var _=require(_0x87b3('0x0'));var util=require('util');var moment=require(_0x87b3('0x1'));var BPromise=require(_0x87b3('0x2'));var rs=require(_0x87b3('0x3'));var fs=require('fs');var Redis=require(_0x87b3('0x4'));var db=require(_0x87b3('0x5'))['db'];var utils=require(_0x87b3('0x6'));var logger=require(_0x87b3('0x7'))(_0x87b3('0x8'));var config=require(_0x87b3('0x9'));var jayson=require(_0x87b3('0xa'));var client=jayson[_0x87b3('0xb')]['http']({'port':0x232a});config[_0x87b3('0xc')]=_['defaults'](config[_0x87b3('0xc')],{'host':_0x87b3('0xd'),'port':0x18eb});var socket=require(_0x87b3('0xe'))(new Redis(config['redis']));require(_0x87b3('0xf'))['register'](socket);function respondWithRpcPromise(_0x4d0760,_0x5e767e,_0x328276){return new BPromise(function(_0x5c69ee,_0x12cb80){return client[_0x87b3('0x10')](_0x4d0760,_0x328276)['then'](function(_0x1eaa3d){logger[_0x87b3('0x11')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x5e767e,_0x87b3('0x12'));logger[_0x87b3('0x13')](_0x87b3('0x14'),_0x5e767e,_0x87b3('0x12'),JSON[_0x87b3('0x15')](_0x1eaa3d));if(_0x1eaa3d['error']){if(_0x1eaa3d[_0x87b3('0x16')]['code']===0x1f4){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x5e767e,_0x1eaa3d[_0x87b3('0x16')][_0x87b3('0x17')]);return _0x12cb80(_0x1eaa3d[_0x87b3('0x16')][_0x87b3('0x17')]);}logger['error'](_0x87b3('0x18'),_0x5e767e,_0x1eaa3d[_0x87b3('0x16')][_0x87b3('0x17')]);return _0x5c69ee(_0x1eaa3d[_0x87b3('0x16')][_0x87b3('0x17')]);}else{logger[_0x87b3('0x11')](_0x87b3('0x18'),_0x5e767e,_0x87b3('0x12'));_0x5c69ee(_0x1eaa3d[_0x87b3('0x19')][_0x87b3('0x17')]);}})[_0x87b3('0x1a')](function(_0x3dad95){logger[_0x87b3('0x16')](_0x87b3('0x18'),_0x5e767e,_0x3dad95);_0x12cb80(_0x3dad95);});});}exports[_0x87b3('0x1b')]=function(_0x39a1cf){var _0x2d61b6=this;return new Promise(function(_0x3530c2,_0x326180){return db[_0x87b3('0x1c')][_0x87b3('0x1d')]({'raw':_0x39a1cf[_0x87b3('0x1e')]?_0x39a1cf['options'][_0x87b3('0x1f')]===undefined?!![]:![]:!![],'where':_0x39a1cf[_0x87b3('0x1e')]?_0x39a1cf[_0x87b3('0x1e')][_0x87b3('0x20')]||null:null,'attributes':[[db[_0x87b3('0x21')]['fn'](_0x87b3('0x22'),db['sequelize']['fn']('IF',db[_0x87b3('0x21')]['literal'](_0x87b3('0x23')))),_0x87b3('0x24')]]})[_0x87b3('0x25')](function(_0x590f80){logger['info'](_0x87b3('0x1b'),_0x39a1cf);logger[_0x87b3('0x13')](_0x87b3('0x1b'),_0x39a1cf,JSON[_0x87b3('0x15')](_0x590f80));_0x3530c2(_0x590f80);})[_0x87b3('0x1a')](function(_0x8ecb4a){logger['error'](_0x87b3('0x1b'),_0x8ecb4a[_0x87b3('0x17')],_0x39a1cf);_0x326180(_0x2d61b6['error'](0x1f4,_0x8ecb4a['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 5f2cd50..6af6a27 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 _0x85d0=['emit','register','length','userVoiceQueueRt:'];(function(_0x1025bc,_0x421254){var _0x3611d6=function(_0x11c8c2){while(--_0x11c8c2){_0x1025bc['push'](_0x1025bc['shift']());}};_0x3611d6(++_0x421254);}(_0x85d0,0x164));var _0x085d=function(_0x2d0e35,_0x1d78ea){_0x2d0e35=_0x2d0e35-0x0;var _0x1aba0f=_0x85d0[_0x2d0e35];return _0x1aba0f;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=['save','remove','update'];function createListener(_0x297001,_0x1716e5){return function(_0xfd8773){_0x1716e5[_0x085d('0x0')](_0x297001,_0xfd8773);};}function removeListener(_0x231765,_0x19ae4c){return function(){UserVoiceQueueRtEvents['removeListener'](_0x231765,_0x19ae4c);};}exports[_0x085d('0x1')]=function(_0x5c917f){for(var _0x364f09=0x0,_0x9acc97=events[_0x085d('0x2')];_0x364f09<_0x9acc97;_0x364f09++){var _0x4a12b7=events[_0x364f09];var _0xf65d01=createListener(_0x085d('0x3')+_0x4a12b7,_0x5c917f);UserVoiceQueueRtEvents['on'](_0x4a12b7,_0xf65d01);}}; \ No newline at end of file +var _0xa23f=['save','emit','register','userVoiceQueueRt:','./userVoiceQueueRt.events'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa23f,0x7c));var _0xfa23=function(_0x4e415e,_0x391e08){_0x4e415e=_0x4e415e-0x0;var _0x160d23=_0xa23f[_0x4e415e];return _0x160d23;};'use strict';var UserVoiceQueueRtEvents=require(_0xfa23('0x0'));var events=[_0xfa23('0x1'),'remove','update'];function createListener(_0xb81edf,_0x3f714c){return function(_0x1c85a9){_0x3f714c[_0xfa23('0x2')](_0xb81edf,_0x1c85a9);};}function removeListener(_0x5643b1,_0x86778e){return function(){UserVoiceQueueRtEvents['removeListener'](_0x5643b1,_0x86778e);};}exports[_0xfa23('0x3')]=function(_0x2df2f5){for(var _0x4c3f4=0x0,_0x3696ef=events['length'];_0x4c3f4<_0x3696ef;_0x4c3f4++){var _0x5a7882=events[_0x4c3f4];var _0x59d53e=createListener(_0xfa23('0x4')+_0x5a7882,_0x2df2f5);UserVoiceQueueRtEvents['on'](_0x5a7882,_0x59d53e);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 9549710..5138a32 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x49623d,_0x35612e){var _0x53593c=function(_0x17172d){while(--_0x17172d){_0x49623d['push'](_0x49623d['shift']());}};_0x53593c(++_0x35612e);}(_0xe706,0xa3));var _0x6e70=function(_0x2fb16e,_0x161667){_0x2fb16e=_0x2fb16e-0x0;var _0x5e0882=_0xe706[_0x2fb16e];return _0x5e0882;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4e3a14,_0x5b861c){var _0x4b4ef3=function(_0x24e869){while(--_0x24e869){_0x4e3a14['push'](_0x4e3a14['shift']());}};_0x4b4ef3(++_0x5b861c);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 77d3ba6..3996239 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 _0xb85a=['exports','INTEGER'];(function(_0x49ce9f,_0x421056){var _0x154e94=function(_0x2abb23){while(--_0x2abb23){_0x49ce9f['push'](_0x49ce9f['shift']());}};_0x154e94(++_0x421056);}(_0xb85a,0xb0));var _0xab85=function(_0x2a8971,_0x38e53f){_0x2a8971=_0x2a8971-0x0;var _0x16911f=_0xb85a[_0x2a8971];return _0x16911f;};'use strict';var Sequelize=require('sequelize');module[_0xab85('0x0')]={'penalty':{'type':Sequelize[_0xab85('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7889=['INTEGER','exports'];(function(_0x26b34a,_0x3a6148){var _0x47d800=function(_0x45a3a5){while(--_0x45a3a5){_0x26b34a['push'](_0x26b34a['shift']());}};_0x47d800(++_0x3a6148);}(_0x7889,0xf7));var _0x9788=function(_0x5d268b,_0x2f1319){_0x5d268b=_0x5d268b-0x0;var _0x917ea1=_0x7889[_0x5d268b];return _0x917ea1;};'use strict';var Sequelize=require('sequelize');module[_0x9788('0x0')]={'penalty':{'type':Sequelize[_0x9788('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 058e669..ab9640e 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 _0xcc81=['lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','UserWhatsappQueue'];(function(_0x4fd0a5,_0x53b83f){var _0x25c18a=function(_0x48477c){while(--_0x48477c){_0x4fd0a5['push'](_0x4fd0a5['shift']());}};_0x25c18a(++_0x53b83f);}(_0xcc81,0xb4));var _0x1cc8=function(_0x1fb1c1,_0x4ebe69){_0x1fb1c1=_0x1fb1c1-0x0;var _0x1622df=_0xcc81[_0x1fb1c1];return _0x1622df;};'use strict';var _=require(_0x1cc8('0x0'));var util=require('util');var logger=require(_0x1cc8('0x1'))(_0x1cc8('0x2'));var moment=require(_0x1cc8('0x3'));var BPromise=require('bluebird');var rp=require(_0x1cc8('0x4'));var fs=require('fs');var path=require(_0x1cc8('0x5'));var rimraf=require(_0x1cc8('0x6'));var config=require(_0x1cc8('0x7'));var attributes=require(_0x1cc8('0x8'));module['exports']=function(_0x200a5a,_0x41b2d4){return _0x200a5a['define'](_0x1cc8('0x9'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf674=['user_has_whatsapp_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./userWhatsappQueue.attributes','exports','define'];(function(_0x17fdc9,_0x3f79ea){var _0x4b6d5b=function(_0x4aba29){while(--_0x4aba29){_0x17fdc9['push'](_0x17fdc9['shift']());}};_0x4b6d5b(++_0x3f79ea);}(_0xf674,0x1d5));var _0x4f67=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xf674[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x4f67('0x0'));var util=require(_0x4f67('0x1'));var logger=require(_0x4f67('0x2'))(_0x4f67('0x3'));var moment=require(_0x4f67('0x4'));var BPromise=require(_0x4f67('0x5'));var rp=require(_0x4f67('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4f67('0x7'));var config=require('../../config/environment');var attributes=require(_0x4f67('0x8'));module[_0x4f67('0x9')]=function(_0x574858,_0x4583df){return _0x574858[_0x4f67('0xa')]('UserWhatsappQueue',attributes,{'tableName':_0x4f67('0xb'),'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 5bdc5bc..372c573 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 _0xe297=['../../config/environment','client','http','request','then','UserWhatsappQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x529f10,_0x334faa){var _0x176174=function(_0x2d387a){while(--_0x2d387a){_0x529f10['push'](_0x529f10['shift']());}};_0x176174(++_0x334faa);}(_0xe297,0xbe));var _0x7e29=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe297[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7e29('0x0'));var util=require(_0x7e29('0x1'));var moment=require(_0x7e29('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7e29('0x3'));var db=require(_0x7e29('0x4'))['db'];var utils=require(_0x7e29('0x5'));var logger=require(_0x7e29('0x6'))(_0x7e29('0x7'));var config=require(_0x7e29('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7e29('0x9')][_0x7e29('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21c3d1,_0x7ed5ee,_0x21d4c6){return new BPromise(function(_0x220892,_0x2d3e85){return client[_0x7e29('0xb')](_0x21c3d1,_0x21d4c6)[_0x7e29('0xc')](function(_0x1dbf7e){logger['info'](_0x7e29('0xd'),_0x7ed5ee,'request\x20sent');logger[_0x7e29('0xe')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x7ed5ee,_0x7e29('0xf'),JSON[_0x7e29('0x10')](_0x1dbf7e));if(_0x1dbf7e[_0x7e29('0x11')]){if(_0x1dbf7e[_0x7e29('0x11')]['code']===0x1f4){logger[_0x7e29('0x11')](_0x7e29('0xd'),_0x7ed5ee,_0x1dbf7e[_0x7e29('0x11')][_0x7e29('0x12')]);return _0x2d3e85(_0x1dbf7e[_0x7e29('0x11')][_0x7e29('0x12')]);}logger[_0x7e29('0x11')](_0x7e29('0xd'),_0x7ed5ee,_0x1dbf7e[_0x7e29('0x11')][_0x7e29('0x12')]);return _0x220892(_0x1dbf7e[_0x7e29('0x11')][_0x7e29('0x12')]);}else{logger[_0x7e29('0x13')](_0x7e29('0xd'),_0x7ed5ee,_0x7e29('0xf'));_0x220892(_0x1dbf7e[_0x7e29('0x14')][_0x7e29('0x12')]);}})[_0x7e29('0x15')](function(_0x8156c6){logger[_0x7e29('0x11')](_0x7e29('0xd'),_0x7ed5ee,_0x8156c6);_0x2d3e85(_0x8156c6);});});} \ No newline at end of file +var _0x4a3a=['debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x45204a,_0x3efe8d){var _0x4dbbc5=function(_0x3aa8ed){while(--_0x3aa8ed){_0x45204a['push'](_0x45204a['shift']());}};_0x4dbbc5(++_0x3efe8d);}(_0x4a3a,0x142));var _0xa4a3=function(_0x2b887f,_0x5754f2){_0x2b887f=_0x2b887f-0x0;var _0x3f3d34=_0x4a3a[_0x2b887f];return _0x3f3d34;};'use strict';var _=require(_0xa4a3('0x0'));var util=require(_0xa4a3('0x1'));var moment=require(_0xa4a3('0x2'));var BPromise=require(_0xa4a3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa4a3('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xa4a3('0x5'));var jayson=require(_0xa4a3('0x6'));var client=jayson[_0xa4a3('0x7')][_0xa4a3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x49200e,_0x2d1b6c,_0x4d56dd){return new BPromise(function(_0x3e389a,_0x31854c){return client[_0xa4a3('0x9')](_0x49200e,_0x4d56dd)[_0xa4a3('0xa')](function(_0x5b2303){logger[_0xa4a3('0xb')](_0xa4a3('0xc'),_0x2d1b6c,_0xa4a3('0xd'));logger[_0xa4a3('0xe')](_0xa4a3('0xf'),_0x2d1b6c,_0xa4a3('0xd'),JSON[_0xa4a3('0x10')](_0x5b2303));if(_0x5b2303[_0xa4a3('0x11')]){if(_0x5b2303['error'][_0xa4a3('0x12')]===0x1f4){logger[_0xa4a3('0x11')](_0xa4a3('0xc'),_0x2d1b6c,_0x5b2303[_0xa4a3('0x11')][_0xa4a3('0x13')]);return _0x31854c(_0x5b2303[_0xa4a3('0x11')][_0xa4a3('0x13')]);}logger[_0xa4a3('0x11')](_0xa4a3('0xc'),_0x2d1b6c,_0x5b2303[_0xa4a3('0x11')]['message']);return _0x3e389a(_0x5b2303[_0xa4a3('0x11')][_0xa4a3('0x13')]);}else{logger[_0xa4a3('0xb')]('UserWhatsappQueue,\x20%s,\x20%s',_0x2d1b6c,_0xa4a3('0xd'));_0x3e389a(_0x5b2303[_0xa4a3('0x14')][_0xa4a3('0x13')]);}})['catch'](function(_0x7c3bdc){logger[_0xa4a3('0x11')](_0xa4a3('0xc'),_0x2d1b6c,_0x7c3bdc);_0x31854c(_0x7c3bdc);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 2b80190..307fbeb 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 _0xa101=['isAuthenticated','index','show','post','create','put','/:id','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./variable.controller','get'];(function(_0x5214ad,_0x433576){var _0xbc087b=function(_0x1ec549){while(--_0x1ec549){_0x5214ad['push'](_0x5214ad['shift']());}};_0xbc087b(++_0x433576);}(_0xa101,0x15f));var _0x1a10=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0xa101[_0x1deb03];return _0x189fe7;};'use strict';var multer=require(_0x1a10('0x0'));var util=require(_0x1a10('0x1'));var path=require('path');var timeout=require(_0x1a10('0x2'));var express=require(_0x1a10('0x3'));var router=express['Router']();var fs_extra=require(_0x1a10('0x4'));var auth=require(_0x1a10('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1a10('0x6'));var controller=require(_0x1a10('0x7'));router[_0x1a10('0x8')]('/',auth[_0x1a10('0x9')](),controller[_0x1a10('0xa')]);router[_0x1a10('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x1a10('0xb')]);router[_0x1a10('0xc')]('/',auth[_0x1a10('0x9')](),controller[_0x1a10('0xd')]);router[_0x1a10('0xe')](_0x1a10('0xf'),auth[_0x1a10('0x9')](),controller['update']);router[_0x1a10('0x10')](_0x1a10('0xf'),auth[_0x1a10('0x9')](),controller['destroy']);module[_0x1a10('0x11')]=router; \ No newline at end of file +var _0x0434=['./variable.controller','get','isAuthenticated','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xb7d296,_0x5598cd){var _0x5d54c3=function(_0x172a55){while(--_0x172a55){_0xb7d296['push'](_0xb7d296['shift']());}};_0x5d54c3(++_0x5598cd);}(_0x0434,0x1ad));var _0x4043=function(_0x164af1,_0x3cf772){_0x164af1=_0x164af1-0x0;var _0x5d81a2=_0x0434[_0x164af1];return _0x5d81a2;};'use strict';var multer=require(_0x4043('0x0'));var util=require(_0x4043('0x1'));var path=require(_0x4043('0x2'));var timeout=require(_0x4043('0x3'));var express=require(_0x4043('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4043('0x5'));var interaction=require(_0x4043('0x6'));var config=require(_0x4043('0x7'));var controller=require(_0x4043('0x8'));router[_0x4043('0x9')]('/',auth[_0x4043('0xa')](),controller['index']);router[_0x4043('0x9')](_0x4043('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x4043('0xc')]('/',auth[_0x4043('0xa')](),controller[_0x4043('0xd')]);router[_0x4043('0xe')](_0x4043('0xb'),auth[_0x4043('0xa')](),controller[_0x4043('0xf')]);router[_0x4043('0x10')]('/:id',auth[_0x4043('0xa')](),controller[_0x4043('0x11')]);module[_0x4043('0x12')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index e44130d..a05976e 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 _0x0a96=['sequelize','exports','STRING'];(function(_0x111e1a,_0x2bf0c9){var _0x34935b=function(_0xb6829e){while(--_0xb6829e){_0x111e1a['push'](_0x111e1a['shift']());}};_0x34935b(++_0x2bf0c9);}(_0x0a96,0xe4));var _0x60a9=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0a96[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x60a9('0x0'));module[_0x60a9('0x1')]={'name':{'type':Sequelize[_0x60a9('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x60a9('0x2')]}}; \ No newline at end of file +var _0x9335=['exports','name','STRING','sequelize'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x9335,0xab));var _0x5933=function(_0x1f8a8b,_0x12112a){_0x1f8a8b=_0x1f8a8b-0x0;var _0x183fa3=_0x9335[_0x1f8a8b];return _0x183fa3;};'use strict';var Sequelize=require(_0x5933('0x0'));module[_0x5933('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x5933('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5933('0x3')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 71dbfa5..427fe75 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 _0xc6d9=['sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','then','get','Variables','UserProfileResource','destroy','end','name','send','map','Variable','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','includeAll','findAll','catch','show','params','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x1f7b2f,_0x3dc149){var _0x463f8d=function(_0x3dc4bf){while(--_0x3dc4bf){_0x1f7b2f['push'](_0x1f7b2f['shift']());}};_0x463f8d(++_0x3dc149);}(_0xc6d9,0x180));var _0x9c6d=function(_0x7f64e9,_0x52565d){_0x7f64e9=_0x7f64e9-0x0;var _0x5acded=_0xc6d9[_0x7f64e9];return _0x5acded;};'use strict';var emlformat=require(_0x9c6d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9c6d('0x1'));var jsonpatch=require(_0x9c6d('0x2'));var rp=require(_0x9c6d('0x3'));var moment=require(_0x9c6d('0x4'));var BPromise=require(_0x9c6d('0x5'));var Mustache=require(_0x9c6d('0x6'));var util=require(_0x9c6d('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x9c6d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9c6d('0x9'));var crypto=require(_0x9c6d('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x9c6d('0xb'));var toCsv=require('to-csv');var querystring=require(_0x9c6d('0xc'));var Papa=require(_0x9c6d('0xd'));var Redis=require(_0x9c6d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x9c6d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9c6d('0x10'));var logger=require('../../config/logger')(_0x9c6d('0x11'));var utils=require(_0x9c6d('0x12'));var config=require(_0x9c6d('0x13'));var licenseUtil=require(_0x9c6d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1bece1,_0x46c816){_0x46c816=_0x46c816||0xcc;return function(_0x3ba578){if(_0x3ba578){return _0x1bece1[_0x9c6d('0x15')](_0x46c816);}return _0x1bece1[_0x9c6d('0x16')](_0x46c816)['end']();};}function respondWithResult(_0x4e9b74,_0x1ec9c6){_0x1ec9c6=_0x1ec9c6||0xc8;return function(_0x221986){if(_0x221986){return _0x4e9b74[_0x9c6d('0x16')](_0x1ec9c6)[_0x9c6d('0x17')](_0x221986);}};}function respondWithFilteredResult(_0x4955af,_0x40e307){return function(_0x266fe0){if(_0x266fe0){var _0xdea7b9=typeof _0x40e307['offset']===_0x9c6d('0x18')&&typeof _0x40e307[_0x9c6d('0x19')]===_0x9c6d('0x18');var _0x3d6666=_0x266fe0['count'];var _0x2354ca=_0xdea7b9?0x0:_0x40e307[_0x9c6d('0x1a')];var _0x3b27ba=_0xdea7b9?_0x266fe0[_0x9c6d('0x1b')]:_0x40e307['offset']+_0x40e307[_0x9c6d('0x19')];var _0xf823bf;if(_0x3b27ba>=_0x3d6666){_0x3b27ba=_0x3d6666;_0xf823bf=0xc8;}else{_0xf823bf=0xce;}_0x4955af[_0x9c6d('0x16')](_0xf823bf);return _0x4955af[_0x9c6d('0x1c')](_0x9c6d('0x1d'),_0x2354ca+'-'+_0x3b27ba+'/'+_0x3d6666)['json'](_0x266fe0);}return null;};}function patchUpdates(_0x4c2495){return function(_0xfdd464){try{jsonpatch[_0x9c6d('0x1e')](_0xfdd464,_0x4c2495,!![]);}catch(_0xd24fd3){return BPromise['reject'](_0xd24fd3);}return _0xfdd464[_0x9c6d('0x1f')]();};}function saveUpdates(_0x2ada93,_0x4cc4da){return function(_0x3cf307){if(_0x3cf307){return _0x3cf307['update'](_0x2ada93)['then'](function(_0x3e3cea){return _0x3e3cea;});}return null;};}function removeEntity(_0x485820,_0x38914c){return function(_0x5814a6){if(_0x5814a6){return _0x5814a6['destroy']()[_0x9c6d('0x20')](function(){var _0x1180c9=_0x5814a6[_0x9c6d('0x21')]({'plain':!![]});var _0x3e8e39=_0x9c6d('0x22');return db[_0x9c6d('0x23')][_0x9c6d('0x24')]({'where':{'type':_0x3e8e39,'resourceId':_0x1180c9['id']}})[_0x9c6d('0x20')](function(){return _0x5814a6;});})[_0x9c6d('0x20')](function(){_0x485820[_0x9c6d('0x16')](0xcc)[_0x9c6d('0x25')]();});}};}function handleEntityNotFound(_0x2e95db,_0x50db3b){return function(_0x1290ea){if(!_0x1290ea){_0x2e95db['sendStatus'](0x194);}return _0x1290ea;};}function handleError(_0x50376e,_0x5a24a2){_0x5a24a2=_0x5a24a2||0x1f4;return function(_0x31ebbc){logger['error'](_0x31ebbc['stack']);if(_0x31ebbc[_0x9c6d('0x26')]){delete _0x31ebbc['name'];}_0x50376e['status'](_0x5a24a2)[_0x9c6d('0x27')](_0x31ebbc);};}exports['index']=function(_0x18e3ec,_0x4b7e14){var _0x1c3463={},_0xce20f8={},_0x1a3d1b={'count':0x0,'rows':[]};var _0xf7a723=_[_0x9c6d('0x28')](db[_0x9c6d('0x29')][_0x9c6d('0x2a')],function(_0x54d881){return{'name':_0x54d881[_0x9c6d('0x2b')],'type':_0x54d881['type'][_0x9c6d('0x2c')]};});_0xce20f8[_0x9c6d('0x2d')]=_[_0x9c6d('0x28')](_0xf7a723,_0x9c6d('0x26'));_0xce20f8[_0x9c6d('0x2e')]=_[_0x9c6d('0x2f')](_0x18e3ec['query']);_0xce20f8['filters']=_[_0x9c6d('0x30')](_0xce20f8[_0x9c6d('0x2d')],_0xce20f8['query']);_0x1c3463[_0x9c6d('0x31')]=_[_0x9c6d('0x30')](_0xce20f8[_0x9c6d('0x2d')],qs[_0x9c6d('0x32')](_0x18e3ec['query'][_0x9c6d('0x32')]));_0x1c3463['attributes']=_0x1c3463['attributes'][_0x9c6d('0x33')]?_0x1c3463[_0x9c6d('0x31')]:_0xce20f8[_0x9c6d('0x2d')];if(!_0x18e3ec[_0x9c6d('0x2e')]['hasOwnProperty'](_0x9c6d('0x34'))){_0x1c3463[_0x9c6d('0x19')]=qs['limit'](_0x18e3ec[_0x9c6d('0x2e')][_0x9c6d('0x19')]);_0x1c3463[_0x9c6d('0x1a')]=qs['offset'](_0x18e3ec[_0x9c6d('0x2e')]['offset']);}_0x1c3463[_0x9c6d('0x35')]=qs[_0x9c6d('0x36')](_0x18e3ec[_0x9c6d('0x2e')][_0x9c6d('0x36')]);_0x1c3463[_0x9c6d('0x37')]=qs[_0x9c6d('0x38')](_[_0x9c6d('0x39')](_0x18e3ec['query'],_0xce20f8['filters']),_0xf7a723);if(_0x18e3ec[_0x9c6d('0x2e')]['filter']){_0x1c3463[_0x9c6d('0x37')]=_[_0x9c6d('0x3a')](_0x1c3463['where'],{'$or':_[_0x9c6d('0x28')](_0xf7a723,function(_0x1600c5){if(_0x1600c5[_0x9c6d('0x3b')]!==_0x9c6d('0x3c')){var _0x210605={};_0x210605[_0x1600c5[_0x9c6d('0x26')]]={'$like':'%'+_0x18e3ec[_0x9c6d('0x2e')][_0x9c6d('0x3d')]+'%'};return _0x210605;}})});}_0x1c3463=_[_0x9c6d('0x3a')]({},_0x1c3463,_0x18e3ec[_0x9c6d('0x3e')]);var _0xe39525={'where':_0x1c3463[_0x9c6d('0x37')]};return db[_0x9c6d('0x29')]['count'](_0xe39525)[_0x9c6d('0x20')](function(_0x4e74a3){_0x1a3d1b['count']=_0x4e74a3;if(_0x18e3ec[_0x9c6d('0x2e')][_0x9c6d('0x3f')]){_0x1c3463['include']=[{'all':!![]}];}return db[_0x9c6d('0x29')][_0x9c6d('0x40')](_0x1c3463);})['then'](function(_0x2771da){_0x1a3d1b['rows']=_0x2771da;return _0x1a3d1b;})[_0x9c6d('0x20')](respondWithFilteredResult(_0x4b7e14,_0x1c3463))[_0x9c6d('0x41')](handleError(_0x4b7e14,null));};exports[_0x9c6d('0x42')]=function(_0x144a78,_0x46aeda){var _0x1707ab={'raw':!![],'where':{'id':_0x144a78[_0x9c6d('0x43')]['id']}},_0x7841da={};_0x7841da[_0x9c6d('0x2d')]=_['keys'](db[_0x9c6d('0x29')][_0x9c6d('0x2a')]);_0x7841da['query']=_['keys'](_0x144a78[_0x9c6d('0x2e')]);_0x7841da[_0x9c6d('0x38')]=_[_0x9c6d('0x30')](_0x7841da[_0x9c6d('0x2d')],_0x7841da[_0x9c6d('0x2e')]);_0x1707ab['attributes']=_['intersection'](_0x7841da[_0x9c6d('0x2d')],qs[_0x9c6d('0x32')](_0x144a78[_0x9c6d('0x2e')][_0x9c6d('0x32')]));_0x1707ab[_0x9c6d('0x31')]=_0x1707ab[_0x9c6d('0x31')][_0x9c6d('0x33')]?_0x1707ab[_0x9c6d('0x31')]:_0x7841da[_0x9c6d('0x2d')];if(_0x144a78[_0x9c6d('0x2e')][_0x9c6d('0x3f')]){_0x1707ab[_0x9c6d('0x44')]=[{'all':!![]}];}_0x1707ab=_[_0x9c6d('0x3a')]({},_0x1707ab,_0x144a78[_0x9c6d('0x3e')]);return db[_0x9c6d('0x29')]['find'](_0x1707ab)[_0x9c6d('0x20')](handleEntityNotFound(_0x46aeda,null))[_0x9c6d('0x20')](respondWithResult(_0x46aeda,null))['catch'](handleError(_0x46aeda,null));};exports[_0x9c6d('0x45')]=function(_0xf8d5d5,_0x169a82){return db[_0x9c6d('0x29')][_0x9c6d('0x45')](_0xf8d5d5[_0x9c6d('0x46')],{})[_0x9c6d('0x20')](function(_0x2cf628){var _0xd32e94=_0xf8d5d5[_0x9c6d('0x47')][_0x9c6d('0x21')]({'plain':!![]});if(!_0xd32e94)throw new Error(_0x9c6d('0x48'));if(_0xd32e94[_0x9c6d('0x49')]===_0x9c6d('0x47')){var _0x3aa965=_0x2cf628[_0x9c6d('0x21')]({'plain':!![]});var _0x5668b8=_0x9c6d('0x22');return db[_0x9c6d('0x4a')][_0x9c6d('0x4b')]({'where':{'name':_0x5668b8,'userProfileId':_0xd32e94[_0x9c6d('0x4c')]},'raw':!![]})[_0x9c6d('0x20')](function(_0x269038){if(_0x269038&&_0x269038[_0x9c6d('0x4d')]===0x0){return db['UserProfileResource'][_0x9c6d('0x45')]({'name':_0x3aa965[_0x9c6d('0x26')],'resourceId':_0x3aa965['id'],'type':_0x269038[_0x9c6d('0x26')],'sectionId':_0x269038['id']},{})[_0x9c6d('0x20')](function(){return _0x2cf628;});}else{return _0x2cf628;}})['catch'](function(_0x2477c3){logger[_0x9c6d('0x4e')](_0x9c6d('0x4f'),_0x2477c3);throw _0x2477c3;});}return _0x2cf628;})['then'](respondWithResult(_0x169a82,0xc9))[_0x9c6d('0x41')](handleError(_0x169a82,null));};exports[_0x9c6d('0x50')]=function(_0x3e5a73,_0x67cfe){if(_0x3e5a73[_0x9c6d('0x46')]['id']){delete _0x3e5a73[_0x9c6d('0x46')]['id'];}return db[_0x9c6d('0x29')]['find']({'where':{'id':_0x3e5a73[_0x9c6d('0x43')]['id']}})[_0x9c6d('0x20')](handleEntityNotFound(_0x67cfe,null))[_0x9c6d('0x20')](saveUpdates(_0x3e5a73[_0x9c6d('0x46')],null))[_0x9c6d('0x20')](respondWithResult(_0x67cfe,null))[_0x9c6d('0x41')](handleError(_0x67cfe,null));};exports[_0x9c6d('0x24')]=function(_0x20217c,_0x8aeffe){return db[_0x9c6d('0x29')][_0x9c6d('0x4b')]({'where':{'id':_0x20217c[_0x9c6d('0x43')]['id']}})[_0x9c6d('0x20')](handleEntityNotFound(_0x8aeffe,null))['then'](removeEntity(_0x8aeffe,null))[_0x9c6d('0x41')](handleError(_0x8aeffe,null));}; \ No newline at end of file +var _0xbdc1=['error','update','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','json','reject','save','then','get','Variables','end','stack','name','send','index','map','Variable','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation'];(function(_0x423f7b,_0x3fd823){var _0x1f375f=function(_0x120fdc){while(--_0x120fdc){_0x423f7b['push'](_0x423f7b['shift']());}};_0x1f375f(++_0x3fd823);}(_0xbdc1,0xa2));var _0x1bdc=function(_0x19c878,_0x561b38){_0x19c878=_0x19c878-0x0;var _0x4c8a36=_0xbdc1[_0x19c878];return _0x4c8a36;};'use strict';var emlformat=require(_0x1bdc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1bdc('0x1'));var jsonpatch=require(_0x1bdc('0x2'));var rp=require(_0x1bdc('0x3'));var moment=require('moment');var BPromise=require(_0x1bdc('0x4'));var Mustache=require(_0x1bdc('0x5'));var util=require(_0x1bdc('0x6'));var path=require('path');var sox=require(_0x1bdc('0x7'));var csv=require('to-csv');var ejs=require(_0x1bdc('0x8'));var fs=require('fs');var fs_extra=require(_0x1bdc('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1bdc('0xa'));var jsforce=require(_0x1bdc('0xb'));var deskjs=require(_0x1bdc('0xc'));var toCsv=require(_0x1bdc('0xd'));var querystring=require(_0x1bdc('0xe'));var Papa=require(_0x1bdc('0xf'));var Redis=require(_0x1bdc('0x10'));var authService=require(_0x1bdc('0x11'));var qs=require(_0x1bdc('0x12'));var as=require(_0x1bdc('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1bdc('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1bdc('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49d54f,_0x5b6d2c){_0x5b6d2c=_0x5b6d2c||0xcc;return function(_0x2b049f){if(_0x2b049f){return _0x49d54f[_0x1bdc('0x16')](_0x5b6d2c);}return _0x49d54f[_0x1bdc('0x17')](_0x5b6d2c)['end']();};}function respondWithResult(_0x3a14d1,_0x526515){_0x526515=_0x526515||0xc8;return function(_0x1f9f9e){if(_0x1f9f9e){return _0x3a14d1[_0x1bdc('0x17')](_0x526515)['json'](_0x1f9f9e);}};}function respondWithFilteredResult(_0x5b6b0a,_0x48e34b){return function(_0x117311){if(_0x117311){var _0x3747d0=typeof _0x48e34b[_0x1bdc('0x18')]===_0x1bdc('0x19')&&typeof _0x48e34b[_0x1bdc('0x1a')]==='undefined';var _0x560c94=_0x117311[_0x1bdc('0x1b')];var _0x15e613=_0x3747d0?0x0:_0x48e34b[_0x1bdc('0x18')];var _0xa10640=_0x3747d0?_0x117311['count']:_0x48e34b[_0x1bdc('0x18')]+_0x48e34b[_0x1bdc('0x1a')];var _0x352f63;if(_0xa10640>=_0x560c94){_0xa10640=_0x560c94;_0x352f63=0xc8;}else{_0x352f63=0xce;}_0x5b6b0a['status'](_0x352f63);return _0x5b6b0a[_0x1bdc('0x1c')]('Content-Range',_0x15e613+'-'+_0xa10640+'/'+_0x560c94)[_0x1bdc('0x1d')](_0x117311);}return null;};}function patchUpdates(_0x3dc875){return function(_0x4ad958){try{jsonpatch['apply'](_0x4ad958,_0x3dc875,!![]);}catch(_0x35001d){return BPromise[_0x1bdc('0x1e')](_0x35001d);}return _0x4ad958[_0x1bdc('0x1f')]();};}function saveUpdates(_0x236011,_0x174e5a){return function(_0x7bc572){if(_0x7bc572){return _0x7bc572['update'](_0x236011)[_0x1bdc('0x20')](function(_0x2c3320){return _0x2c3320;});}return null;};}function removeEntity(_0x38dae8,_0x403703){return function(_0x3fe21f){if(_0x3fe21f){return _0x3fe21f['destroy']()['then'](function(){var _0x2ecf47=_0x3fe21f[_0x1bdc('0x21')]({'plain':!![]});var _0x2afbdd=_0x1bdc('0x22');return db['UserProfileResource']['destroy']({'where':{'type':_0x2afbdd,'resourceId':_0x2ecf47['id']}})['then'](function(){return _0x3fe21f;});})[_0x1bdc('0x20')](function(){_0x38dae8['status'](0xcc)[_0x1bdc('0x23')]();});}};}function handleEntityNotFound(_0x232a1a,_0x1547d3){return function(_0x3210b2){if(!_0x3210b2){_0x232a1a[_0x1bdc('0x16')](0x194);}return _0x3210b2;};}function handleError(_0x3bfb28,_0x51974d){_0x51974d=_0x51974d||0x1f4;return function(_0x2c0335){logger['error'](_0x2c0335[_0x1bdc('0x24')]);if(_0x2c0335[_0x1bdc('0x25')]){delete _0x2c0335[_0x1bdc('0x25')];}_0x3bfb28[_0x1bdc('0x17')](_0x51974d)[_0x1bdc('0x26')](_0x2c0335);};}exports[_0x1bdc('0x27')]=function(_0x39f9ef,_0x554d04){var _0x1b998b={},_0x1b47c4={},_0x55c682={'count':0x0,'rows':[]};var _0xed4a6e=_[_0x1bdc('0x28')](db[_0x1bdc('0x29')][_0x1bdc('0x2a')],function(_0x2b610a){return{'name':_0x2b610a[_0x1bdc('0x2b')],'type':_0x2b610a[_0x1bdc('0x2c')][_0x1bdc('0x2d')]};});_0x1b47c4[_0x1bdc('0x2e')]=_[_0x1bdc('0x28')](_0xed4a6e,'name');_0x1b47c4[_0x1bdc('0x2f')]=_[_0x1bdc('0x30')](_0x39f9ef[_0x1bdc('0x2f')]);_0x1b47c4['filters']=_['intersection'](_0x1b47c4[_0x1bdc('0x2e')],_0x1b47c4['query']);_0x1b998b['attributes']=_[_0x1bdc('0x31')](_0x1b47c4[_0x1bdc('0x2e')],qs[_0x1bdc('0x32')](_0x39f9ef['query'][_0x1bdc('0x32')]));_0x1b998b[_0x1bdc('0x33')]=_0x1b998b[_0x1bdc('0x33')][_0x1bdc('0x34')]?_0x1b998b[_0x1bdc('0x33')]:_0x1b47c4[_0x1bdc('0x2e')];if(!_0x39f9ef[_0x1bdc('0x2f')][_0x1bdc('0x35')](_0x1bdc('0x36'))){_0x1b998b['limit']=qs[_0x1bdc('0x1a')](_0x39f9ef[_0x1bdc('0x2f')][_0x1bdc('0x1a')]);_0x1b998b[_0x1bdc('0x18')]=qs[_0x1bdc('0x18')](_0x39f9ef[_0x1bdc('0x2f')][_0x1bdc('0x18')]);}_0x1b998b[_0x1bdc('0x37')]=qs[_0x1bdc('0x38')](_0x39f9ef[_0x1bdc('0x2f')]['sort']);_0x1b998b[_0x1bdc('0x39')]=qs[_0x1bdc('0x3a')](_[_0x1bdc('0x3b')](_0x39f9ef[_0x1bdc('0x2f')],_0x1b47c4[_0x1bdc('0x3a')]),_0xed4a6e);if(_0x39f9ef[_0x1bdc('0x2f')][_0x1bdc('0x3c')]){_0x1b998b[_0x1bdc('0x39')]=_[_0x1bdc('0x3d')](_0x1b998b[_0x1bdc('0x39')],{'$or':_['map'](_0xed4a6e,function(_0x3193b5){if(_0x3193b5[_0x1bdc('0x2c')]!==_0x1bdc('0x3e')){var _0x312048={};_0x312048[_0x3193b5[_0x1bdc('0x25')]]={'$like':'%'+_0x39f9ef[_0x1bdc('0x2f')][_0x1bdc('0x3c')]+'%'};return _0x312048;}})});}_0x1b998b=_[_0x1bdc('0x3d')]({},_0x1b998b,_0x39f9ef[_0x1bdc('0x3f')]);var _0x4cda6e={'where':_0x1b998b['where']};return db[_0x1bdc('0x29')][_0x1bdc('0x1b')](_0x4cda6e)[_0x1bdc('0x20')](function(_0x4c7a10){_0x55c682[_0x1bdc('0x1b')]=_0x4c7a10;if(_0x39f9ef['query'][_0x1bdc('0x40')]){_0x1b998b[_0x1bdc('0x41')]=[{'all':!![]}];}return db[_0x1bdc('0x29')][_0x1bdc('0x42')](_0x1b998b);})[_0x1bdc('0x20')](function(_0x87cbdb){_0x55c682[_0x1bdc('0x43')]=_0x87cbdb;return _0x55c682;})[_0x1bdc('0x20')](respondWithFilteredResult(_0x554d04,_0x1b998b))[_0x1bdc('0x44')](handleError(_0x554d04,null));};exports['show']=function(_0x16c7d9,_0x533482){var _0x5fae22={'raw':!![],'where':{'id':_0x16c7d9[_0x1bdc('0x45')]['id']}},_0x4e3dda={};_0x4e3dda[_0x1bdc('0x2e')]=_[_0x1bdc('0x30')](db[_0x1bdc('0x29')][_0x1bdc('0x2a')]);_0x4e3dda[_0x1bdc('0x2f')]=_[_0x1bdc('0x30')](_0x16c7d9[_0x1bdc('0x2f')]);_0x4e3dda['filters']=_[_0x1bdc('0x31')](_0x4e3dda['model'],_0x4e3dda[_0x1bdc('0x2f')]);_0x5fae22[_0x1bdc('0x33')]=_[_0x1bdc('0x31')](_0x4e3dda[_0x1bdc('0x2e')],qs[_0x1bdc('0x32')](_0x16c7d9[_0x1bdc('0x2f')][_0x1bdc('0x32')]));_0x5fae22[_0x1bdc('0x33')]=_0x5fae22[_0x1bdc('0x33')]['length']?_0x5fae22[_0x1bdc('0x33')]:_0x4e3dda[_0x1bdc('0x2e')];if(_0x16c7d9['query']['includeAll']){_0x5fae22['include']=[{'all':!![]}];}_0x5fae22=_[_0x1bdc('0x3d')]({},_0x5fae22,_0x16c7d9[_0x1bdc('0x3f')]);return db[_0x1bdc('0x29')][_0x1bdc('0x46')](_0x5fae22)[_0x1bdc('0x20')](handleEntityNotFound(_0x533482,null))['then'](respondWithResult(_0x533482,null))[_0x1bdc('0x44')](handleError(_0x533482,null));};exports[_0x1bdc('0x47')]=function(_0x1e7c8e,_0x1ebeba){return db[_0x1bdc('0x29')][_0x1bdc('0x47')](_0x1e7c8e[_0x1bdc('0x48')],{})[_0x1bdc('0x20')](function(_0x1c721b){var _0x4dd0cc=_0x1e7c8e[_0x1bdc('0x49')]['get']({'plain':!![]});if(!_0x4dd0cc)throw new Error(_0x1bdc('0x4a'));if(_0x4dd0cc['role']===_0x1bdc('0x49')){var _0x44fc4d=_0x1c721b[_0x1bdc('0x21')]({'plain':!![]});var _0x4ffd53=_0x1bdc('0x22');return db[_0x1bdc('0x4b')][_0x1bdc('0x46')]({'where':{'name':_0x4ffd53,'userProfileId':_0x4dd0cc[_0x1bdc('0x4c')]},'raw':!![]})[_0x1bdc('0x20')](function(_0x1e1a23){if(_0x1e1a23&&_0x1e1a23[_0x1bdc('0x4d')]===0x0){return db['UserProfileResource'][_0x1bdc('0x47')]({'name':_0x44fc4d['name'],'resourceId':_0x44fc4d['id'],'type':_0x1e1a23['name'],'sectionId':_0x1e1a23['id']},{})['then'](function(){return _0x1c721b;});}else{return _0x1c721b;}})[_0x1bdc('0x44')](function(_0x34e463){logger[_0x1bdc('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x34e463);throw _0x34e463;});}return _0x1c721b;})[_0x1bdc('0x20')](respondWithResult(_0x1ebeba,0xc9))[_0x1bdc('0x44')](handleError(_0x1ebeba,null));};exports[_0x1bdc('0x4f')]=function(_0x1b209c,_0x1015dc){if(_0x1b209c[_0x1bdc('0x48')]['id']){delete _0x1b209c[_0x1bdc('0x48')]['id'];}return db[_0x1bdc('0x29')][_0x1bdc('0x46')]({'where':{'id':_0x1b209c[_0x1bdc('0x45')]['id']}})[_0x1bdc('0x20')](handleEntityNotFound(_0x1015dc,null))['then'](saveUpdates(_0x1b209c[_0x1bdc('0x48')],null))[_0x1bdc('0x20')](respondWithResult(_0x1015dc,null))[_0x1bdc('0x44')](handleError(_0x1015dc,null));};exports['destroy']=function(_0x367e16,_0x5cd771){return db['Variable'][_0x1bdc('0x46')]({'where':{'id':_0x367e16[_0x1bdc('0x45')]['id']}})[_0x1bdc('0x20')](handleEntityNotFound(_0x5cd771,null))[_0x1bdc('0x20')](removeEntity(_0x5cd771,null))[_0x1bdc('0x44')](handleError(_0x5cd771,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 665eb18..87e2d70 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 _0xb1ab=['rimraf','../../config/environment','./variable.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0xb1ab,0x1bf));var _0xbb1a=function(_0x538c70,_0x35531f){_0x538c70=_0x538c70-0x0;var _0x42ae01=_0xb1ab[_0x538c70];return _0x42ae01;};'use strict';var _=require(_0xbb1a('0x0'));var util=require(_0xbb1a('0x1'));var logger=require(_0xbb1a('0x2'))(_0xbb1a('0x3'));var moment=require(_0xbb1a('0x4'));var BPromise=require(_0xbb1a('0x5'));var rp=require(_0xbb1a('0x6'));var fs=require('fs');var path=require(_0xbb1a('0x7'));var rimraf=require(_0xbb1a('0x8'));var config=require(_0xbb1a('0x9'));var attributes=require(_0xbb1a('0xa'));module[_0xbb1a('0xb')]=function(_0x236112,_0x3daf1c){return _0x236112[_0xbb1a('0xc')]('Variable',attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfb68=['util','api','moment','path','rimraf','../../config/environment','./variable.attributes','Variable','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfb68,0x1c1));var _0x8fb6=function(_0x2a0db8,_0x3b67dc){_0x2a0db8=_0x2a0db8-0x0;var _0x32cd10=_0xfb68[_0x2a0db8];return _0x32cd10;};'use strict';var _=require(_0x8fb6('0x0'));var util=require(_0x8fb6('0x1'));var logger=require('../../config/logger')(_0x8fb6('0x2'));var moment=require(_0x8fb6('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8fb6('0x4'));var rimraf=require(_0x8fb6('0x5'));var config=require(_0x8fb6('0x6'));var attributes=require(_0x8fb6('0x7'));module['exports']=function(_0x448b56,_0x1714ff){return _0x448b56['define'](_0x8fb6('0x8'),attributes,{'tableName':'tools_variables','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 7034bde..44b8f79 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 _0x8ef6=['result','catch','Variable','find','options','raw','include','model','attributes','map','ShowVariable','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x586fa8,_0x21ae01){var _0x3b2a0f=function(_0xcee18){while(--_0xcee18){_0x586fa8['push'](_0x586fa8['shift']());}};_0x3b2a0f(++_0x21ae01);}(_0x8ef6,0xf2));var _0x68ef=function(_0x11e8bb,_0x3f402e){_0x11e8bb=_0x11e8bb-0x0;var _0x2ccdc3=_0x8ef6[_0x11e8bb];return _0x2ccdc3;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('Variable,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('Variable,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});}exports['ShowVariable']=function(_0x2633c1){var _0x404870=this;return new Promise(function(_0x4ade0d,_0x527870){return db[_0x68ef('0x18')][_0x68ef('0x19')]({'raw':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1['options'][_0x68ef('0x1b')]===undefined?!![]:![]:!![],'where':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')]['where']||null:null,'attributes':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')]['attributes']||null:null,'include':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')][_0x68ef('0x1c')]?_['map'](_0x2633c1['options']['include'],function(_0x26018d){return{'model':db[_0x26018d[_0x68ef('0x1d')]],'as':_0x26018d['as'],'attributes':_0x26018d[_0x68ef('0x1e')],'include':_0x26018d[_0x68ef('0x1c')]?_[_0x68ef('0x1f')](_0x26018d[_0x68ef('0x1c')],function(_0x258cd5){return{'model':db[_0x258cd5[_0x68ef('0x1d')]],'as':_0x258cd5['as'],'attributes':_0x258cd5[_0x68ef('0x1e')],'include':_0x258cd5[_0x68ef('0x1c')]?_['map'](_0x258cd5[_0x68ef('0x1c')],function(_0x57f9ee){return{'model':db[_0x57f9ee['model']],'as':_0x57f9ee['as'],'attributes':_0x57f9ee['attributes']};}):[]};}):[]};}):[]:[]})[_0x68ef('0xc')](function(_0x268f32){logger[_0x68ef('0xd')](_0x68ef('0x20'),_0x2633c1);logger['debug']('ShowVariable',_0x2633c1,JSON[_0x68ef('0x12')](_0x268f32));_0x4ade0d(_0x268f32);})[_0x68ef('0x17')](function(_0x7bf96){logger[_0x68ef('0x13')](_0x68ef('0x20'),_0x7bf96[_0x68ef('0x15')],_0x2633c1);_0x527870(_0x404870[_0x68ef('0x13')](0x1f4,_0x7bf96[_0x68ef('0x15')]));});});}; \ No newline at end of file +var _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(_0x5ae3b2,_0x14f96a){var _0x17c13f=function(_0x3098e9){while(--_0x3098e9){_0x5ae3b2['push'](_0x5ae3b2['shift']());}};_0x17c13f(++_0x14f96a);}(_0xabce,0x103));var _0xeabc=function(_0x3826ad,_0x49a30d){_0x3826ad=_0x3826ad-0x0;var _0x17b900=_0xabce[_0x3826ad];return _0x17b900;};'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 ff733b6..8c49c26 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 _0x4091=['./version.controller','index','get','/fetch','isAuthenticated','canUpdate','fetch','/reset','pull','/restart','Router'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x4091,0x154));var _0x1409=function(_0x5e7ee9,_0x4dbc4b){_0x5e7ee9=_0x5e7ee9-0x0;var _0xadb900=_0x4091[_0x5e7ee9];return _0xadb900;};'use strict';var express=require('express');var router=express[_0x1409('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x1409('0x1'));router['get']('/',controller[_0x1409('0x2')]);router[_0x1409('0x3')](_0x1409('0x4'),auth[_0x1409('0x5')](),auth[_0x1409('0x6')](),controller[_0x1409('0x7')]);router[_0x1409('0x3')](_0x1409('0x8'),auth[_0x1409('0x5')](),auth[_0x1409('0x6')](),controller['reset']);router[_0x1409('0x3')]('/pull',auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x1409('0x9')]);router[_0x1409('0x3')](_0x1409('0xa'),auth[_0x1409('0x5')](),controller['restart']);router[_0x1409('0x3')]('/migrations',controller['migrations']);module['exports']=router; \ No newline at end of file +var _0x3f7b=['/reset','/pull','pull','/restart','restart','migrations','exports','express','../../components/auth/service','./version.controller','get','index','isAuthenticated','canUpdate','fetch'];(function(_0x2b6622,_0x285188){var _0x14bcfc=function(_0x1da220){while(--_0x1da220){_0x2b6622['push'](_0x2b6622['shift']());}};_0x14bcfc(++_0x285188);}(_0x3f7b,0xbb));var _0xb3f7=function(_0xffa198,_0x5a8940){_0xffa198=_0xffa198-0x0;var _0x1e4b50=_0x3f7b[_0xffa198];return _0x1e4b50;};'use strict';var express=require(_0xb3f7('0x0'));var router=express['Router']();var auth=require(_0xb3f7('0x1'));var controller=require(_0xb3f7('0x2'));router[_0xb3f7('0x3')]('/',controller[_0xb3f7('0x4')]);router[_0xb3f7('0x3')]('/fetch',auth[_0xb3f7('0x5')](),auth[_0xb3f7('0x6')](),controller[_0xb3f7('0x7')]);router[_0xb3f7('0x3')](_0xb3f7('0x8'),auth[_0xb3f7('0x5')](),auth[_0xb3f7('0x6')](),controller['reset']);router['get'](_0xb3f7('0x9'),auth[_0xb3f7('0x5')](),auth[_0xb3f7('0x6')](),controller[_0xb3f7('0xa')]);router[_0xb3f7('0x3')](_0xb3f7('0xb'),auth[_0xb3f7('0x5')](),controller[_0xb3f7('0xc')]);router[_0xb3f7('0x3')]('/migrations',controller[_0xb3f7('0xd')]);module[_0xb3f7('0xe')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index b97a729..ccb5e2d 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 _0xca3e=['map','Database\x20migrated\x20successfully\x20from\x20version\x20','last','sequelize','UniqueConstraintError','Database\x20already\x20up-to-date','path','lodash','compare-versions','child_process','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','index','query','latest','fetch','exports','version','2.0.0','status','json','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','length','.js','push','sort','Migration','constructor','server'];(function(_0x43b169,_0x553359){var _0x1a9140=function(_0x5e7e77){while(--_0x5e7e77){_0x43b169['push'](_0x43b169['shift']());}};_0x1a9140(++_0x553359);}(_0xca3e,0x187));var _0xeca3=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xca3e[_0x2dafbe];return _0x58a45a;};'use strict';var Umzug=require('umzug');var path=require(_0xeca3('0x0'));var fs=require('fs');var _=require(_0xeca3('0x1'));var pkginfo=require('pkginfo')(module,'version');var compareVersions=require(_0xeca3('0x2'));var exec=require(_0xeca3('0x3'))['exec'];var db=require(_0xeca3('0x4'))['db'];var config=require(_0xeca3('0x5'));var pm2=require(_0xeca3('0x6'));var logger=require(_0xeca3('0x7'))(_0xeca3('0x8'));var git=require(_0xeca3('0x9'))(config[_0xeca3('0xa')]);exports[_0xeca3('0xb')]=function(_0x34c138,_0x2c2b03){var _0x15cd42={'current':module['exports']['version'],'phonebar':0x2};if(_0x34c138[_0xeca3('0xc')]&&_0x34c138['query'][_0xeca3('0xd')]){return git[_0xeca3('0xe')]()['tags'](function(_0x25749c,_0x22504e){_0x15cd42[_0xeca3('0xd')]=(_0x25749c?module[_0xeca3('0xf')][_0xeca3('0x10')]:_0x22504e[_0xeca3('0xd')])||_0xeca3('0x11');return _0x2c2b03[_0xeca3('0x12')](0xc8)[_0xeca3('0x13')](_0x15cd42);});}else{return _0x2c2b03[_0xeca3('0x12')](0xc8)['json'](_0x15cd42);}};exports[_0xeca3('0xe')]=function(_0x38bbc3,_0x38448d){return git[_0xeca3('0xe')]([_0xeca3('0x14'),_0xeca3('0x15')],function(_0x4381cb){if(_0x4381cb){logger[_0xeca3('0x16')](_0x4381cb);return _0x38448d[_0xeca3('0x12')](0x1f4)[_0xeca3('0x13')](_0x4381cb);}logger[_0xeca3('0x17')](_0xeca3('0x18'));return _0x38448d[_0xeca3('0x12')](0xc8)[_0xeca3('0x13')]({'output':_0xeca3('0x19')});});};exports[_0xeca3('0x1a')]=function(_0x4b511b,_0x3b7c7c){return git['reset']([_0xeca3('0x1b'),_0xeca3('0x1c')],function(_0x5f1c25){if(_0x5f1c25){logger[_0xeca3('0x16')](_0x5f1c25);return _0x3b7c7c[_0xeca3('0x12')](0x1f4)['json'](_0x5f1c25);}logger['info'](_0xeca3('0x1d'));return _0x3b7c7c[_0xeca3('0x12')](0xc8)[_0xeca3('0x13')]({'output':_0xeca3('0x1e')});});};exports[_0xeca3('0x1f')]=function(_0x3cbffc,_0x1a95e8){exec(_0xeca3('0x20'),function(_0x2b739b,_0x2ae2dc,_0x1f2543){logger[_0xeca3('0x17')](_0x2ae2dc);logger[_0xeca3('0x17')](_0x1f2543);if(_0x2b739b){logger[_0xeca3('0x16')](_0x2b739b);return _0x1a95e8['status'](0x1f4)[_0xeca3('0x13')](_0x2b739b);}return _0x1a95e8[_0xeca3('0x12')](0xc8)[_0xeca3('0x13')]({'output':_0x2ae2dc});});};exports[_0xeca3('0x21')]=function(_0x250c8e,_0x16c9cc){return pm2['restart'](_0xeca3('0x22'))[_0xeca3('0x23')](function(_0x238405){logger[_0xeca3('0x17')](_0xeca3('0x24'),_0x238405);return _0x16c9cc['status'](0xc8)[_0xeca3('0x13')]({'output':_0xeca3('0x25')});})[_0xeca3('0x26')](function(_0x30cb55){logger[_0xeca3('0x16')](_0x30cb55);return _0x16c9cc[_0xeca3('0x12')](0x1f4)[_0xeca3('0x13')](_0x30cb55);});};exports[_0xeca3('0x27')]=function(_0x5835da,_0x3ac930){var _0x1c5e84=fs[_0xeca3('0x28')](path[_0xeca3('0x29')](config['root'],'server',_0xeca3('0x27')));var _0x35e2a2=[];for(var _0x1d274d=0x0;_0x1d274d<_0x1c5e84[_0xeca3('0x2a')];_0x1d274d++){var _0x168fdf=_0x1c5e84[_0x1d274d]['replace'](_0xeca3('0x2b'),'');if(compareVersions(module['exports']['version'],_0x168fdf)===-0x1){_0x35e2a2[_0xeca3('0x2c')](_0x168fdf);}}if(_0x35e2a2['length']){var _0x1a3970=_0x35e2a2[_0xeca3('0x2d')](compareVersions);var _0x728420=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0xeca3('0x2e')],'modelName':'Migration','columnName':_0xeca3('0x10')},'migrations':{'params':[db['sequelize']['getQueryInterface'](),db['sequelize'][_0xeca3('0x2f')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0xeca3('0x29')](config[_0xeca3('0xa')],_0xeca3('0x30'),'migrations'),'pattern':/\.js$/}});_0x728420['up']({'migrations':_[_0xeca3('0x31')](_0x1a3970,function(_0x3fb52c){return _0x3fb52c+_0xeca3('0x2b');})})[_0xeca3('0x23')](function(){return _0x3ac930[_0xeca3('0x12')](0xc8)['json']({'output':_0xeca3('0x32')+module[_0xeca3('0xf')][_0xeca3('0x10')]+'\x20to\x20'+_[_0xeca3('0x33')](_0x1a3970),'migrations':_[_0xeca3('0x29')](_0x1a3970)});})['catch'](function(_0x1d566a){if(_0x1d566a instanceof db[_0xeca3('0x34')][_0xeca3('0x35')]){return _0x3ac930[_0xeca3('0x12')](0xc8)[_0xeca3('0x13')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x3ac930[_0xeca3('0x12')](0x1f4)[_0xeca3('0x13')](_0x1d566a);}});}else{return _0x3ac930['status'](0xc8)[_0xeca3('0x13')]({'output':_0xeca3('0x36')});}}; \ No newline at end of file +var _0xdce1=['Database\x20already\x20up-to-date','umzug','path','pkginfo','child_process','exec','../../config/environment','../../config/logger','update','simple-git','root','index','exports','latest','fetch','tags','2.0.0','status','json','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync','join','server','length','replace','.js','Migration','getQueryInterface','sequelize','constructor','migrations','map','version','\x20to\x20','last','UniqueConstraintError'];(function(_0x208c31,_0x46a76e){var _0x36193a=function(_0x5f1daf){while(--_0x5f1daf){_0x208c31['push'](_0x208c31['shift']());}};_0x36193a(++_0x46a76e);}(_0xdce1,0x65));var _0x1dce=function(_0x293de7,_0x1dac0a){_0x293de7=_0x293de7-0x0;var _0x1dc4f7=_0xdce1[_0x293de7];return _0x1dc4f7;};'use strict';var Umzug=require(_0x1dce('0x0'));var path=require(_0x1dce('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x1dce('0x2'))(module,'version');var compareVersions=require('compare-versions');var exec=require(_0x1dce('0x3'))[_0x1dce('0x4')];var db=require('../../mysqldb')['db'];var config=require(_0x1dce('0x5'));var pm2=require('../../config/pm2');var logger=require(_0x1dce('0x6'))(_0x1dce('0x7'));var git=require(_0x1dce('0x8'))(config[_0x1dce('0x9')]);exports[_0x1dce('0xa')]=function(_0x48e1b8,_0xc1bbf4){var _0xe0800b={'current':module[_0x1dce('0xb')]['version'],'phonebar':0x2};if(_0x48e1b8['query']&&_0x48e1b8['query'][_0x1dce('0xc')]){return git[_0x1dce('0xd')]()[_0x1dce('0xe')](function(_0x5a2f0d,_0x46d4a8){_0xe0800b[_0x1dce('0xc')]=(_0x5a2f0d?module[_0x1dce('0xb')]['version']:_0x46d4a8[_0x1dce('0xc')])||_0x1dce('0xf');return _0xc1bbf4[_0x1dce('0x10')](0xc8)[_0x1dce('0x11')](_0xe0800b);});}else{return _0xc1bbf4[_0x1dce('0x10')](0xc8)[_0x1dce('0x11')](_0xe0800b);}};exports[_0x1dce('0xd')]=function(_0x1baa46,_0x407a87){return git[_0x1dce('0xd')]([_0x1dce('0x12'),_0x1dce('0x13')],function(_0x31c0c5){if(_0x31c0c5){logger[_0x1dce('0x14')](_0x31c0c5);return _0x407a87[_0x1dce('0x10')](0x1f4)['json'](_0x31c0c5);}logger[_0x1dce('0x15')](_0x1dce('0x16'));return _0x407a87[_0x1dce('0x10')](0xc8)[_0x1dce('0x11')]({'output':_0x1dce('0x17')});});};exports[_0x1dce('0x18')]=function(_0x543a1e,_0x2f8e79){return git[_0x1dce('0x18')](['--hard','FETCH_HEAD'],function(_0x43b8d1){if(_0x43b8d1){logger[_0x1dce('0x14')](_0x43b8d1);return _0x2f8e79[_0x1dce('0x10')](0x1f4)[_0x1dce('0x11')](_0x43b8d1);}logger[_0x1dce('0x15')](_0x1dce('0x19'));return _0x2f8e79[_0x1dce('0x10')](0xc8)[_0x1dce('0x11')]({'output':_0x1dce('0x1a')});});};exports[_0x1dce('0x1b')]=function(_0x588099,_0x3d7018){exec(_0x1dce('0x1c'),function(_0x454269,_0x1c6327,_0xe78972){logger['info'](_0x1c6327);logger[_0x1dce('0x15')](_0xe78972);if(_0x454269){logger['error'](_0x454269);return _0x3d7018[_0x1dce('0x10')](0x1f4)['json'](_0x454269);}return _0x3d7018[_0x1dce('0x10')](0xc8)[_0x1dce('0x11')]({'output':_0x1c6327});});};exports[_0x1dce('0x1d')]=function(_0xf95870,_0x1f8b26){return pm2[_0x1dce('0x1d')]('motion2')[_0x1dce('0x1e')](function(_0x2ccc6d){logger[_0x1dce('0x15')]('pm2\x20restart\x20motion\x20%s',_0x2ccc6d);return _0x1f8b26[_0x1dce('0x10')](0xc8)[_0x1dce('0x11')]({'output':_0x1dce('0x1f')});})[_0x1dce('0x20')](function(_0x577f27){logger[_0x1dce('0x14')](_0x577f27);return _0x1f8b26[_0x1dce('0x10')](0x1f4)[_0x1dce('0x11')](_0x577f27);});};exports['migrations']=function(_0x10b23c,_0x1229a7){var _0x2c3428=fs[_0x1dce('0x21')](path[_0x1dce('0x22')](config[_0x1dce('0x9')],_0x1dce('0x23'),'migrations'));var _0x242eb8=[];for(var _0x1f3232=0x0;_0x1f3232<_0x2c3428[_0x1dce('0x24')];_0x1f3232++){var _0x37ac8a=_0x2c3428[_0x1f3232][_0x1dce('0x25')](_0x1dce('0x26'),'');if(compareVersions(module[_0x1dce('0xb')]['version'],_0x37ac8a)===-0x1){_0x242eb8['push'](_0x37ac8a);}}if(_0x242eb8[_0x1dce('0x24')]){var _0x27f9b0=_0x242eb8['sort'](compareVersions);var _0x27049d=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x1dce('0x27')],'modelName':_0x1dce('0x27'),'columnName':'version'},'migrations':{'params':[db['sequelize'][_0x1dce('0x28')](),db[_0x1dce('0x29')][_0x1dce('0x2a')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0x1dce('0x22')](config[_0x1dce('0x9')],_0x1dce('0x23'),_0x1dce('0x2b')),'pattern':/\.js$/}});_0x27049d['up']({'migrations':_[_0x1dce('0x2c')](_0x27f9b0,function(_0x56a0e7){return _0x56a0e7+_0x1dce('0x26');})})[_0x1dce('0x1e')](function(){return _0x1229a7[_0x1dce('0x10')](0xc8)[_0x1dce('0x11')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x1dce('0xb')][_0x1dce('0x2d')]+_0x1dce('0x2e')+_[_0x1dce('0x2f')](_0x27f9b0),'migrations':_['join'](_0x27f9b0)});})[_0x1dce('0x20')](function(_0x5d405e){if(_0x5d405e instanceof db[_0x1dce('0x29')][_0x1dce('0x30')]){return _0x1229a7[_0x1dce('0x10')](0xc8)['json']({'output':_0x1dce('0x31')});}else{return _0x1229a7[_0x1dce('0x10')](0x1f4)[_0x1dce('0x11')](_0x5d405e);}});}else{return _0x1229a7[_0x1dce('0x10')](0xc8)[_0x1dce('0x11')]({'output':_0x1dce('0x31')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 74cd0ad..777cda5 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 _0x3e95=['get','isAuthenticated','index','/describe','describe','show','post','create','/:id','update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x407c19,_0x133d60){var _0x2f42c0=function(_0x433b0e){while(--_0x433b0e){_0x407c19['push'](_0x407c19['shift']());}};_0x2f42c0(++_0x133d60);}(_0x3e95,0x13c));var _0x53e9=function(_0x3503f1,_0x34d669){_0x3503f1=_0x3503f1-0x0;var _0x30d966=_0x3e95[_0x3503f1];return _0x30d966;};'use strict';var multer=require(_0x53e9('0x0'));var util=require('util');var path=require(_0x53e9('0x1'));var timeout=require(_0x53e9('0x2'));var express=require(_0x53e9('0x3'));var router=express[_0x53e9('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x53e9('0x5'));var config=require(_0x53e9('0x6'));var controller=require('./voiceAgentReport.controller');router[_0x53e9('0x7')]('/',auth[_0x53e9('0x8')](),controller[_0x53e9('0x9')]);router[_0x53e9('0x7')](_0x53e9('0xa'),auth['isAuthenticated'](),controller[_0x53e9('0xb')]);router[_0x53e9('0x7')]('/:id',auth[_0x53e9('0x8')](),controller[_0x53e9('0xc')]);router[_0x53e9('0xd')]('/',auth[_0x53e9('0x8')](),controller[_0x53e9('0xe')]);router['put'](_0x53e9('0xf'),auth['isAuthenticated'](),controller[_0x53e9('0x10')]);router['delete'](_0x53e9('0xf'),auth[_0x53e9('0x8')](),controller[_0x53e9('0x11')]);module[_0x53e9('0x12')]=router; \ No newline at end of file +var _0x8e89=['exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','put','update','delete','destroy'];(function(_0x2bb8c2,_0x60c302){var _0x5b4e0b=function(_0x51161c){while(--_0x51161c){_0x2bb8c2['push'](_0x2bb8c2['shift']());}};_0x5b4e0b(++_0x60c302);}(_0x8e89,0x1a5));var _0x98e8=function(_0x2525f1,_0x47034f){_0x2525f1=_0x2525f1-0x0;var _0x13c1b5=_0x8e89[_0x2525f1];return _0x13c1b5;};'use strict';var multer=require(_0x98e8('0x0'));var util=require(_0x98e8('0x1'));var path=require('path');var timeout=require(_0x98e8('0x2'));var express=require('express');var router=express[_0x98e8('0x3')]();var fs_extra=require(_0x98e8('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x98e8('0x5'));var config=require(_0x98e8('0x6'));var controller=require(_0x98e8('0x7'));router[_0x98e8('0x8')]('/',auth[_0x98e8('0x9')](),controller['index']);router[_0x98e8('0x8')](_0x98e8('0xa'),auth['isAuthenticated'](),controller[_0x98e8('0xb')]);router[_0x98e8('0x8')](_0x98e8('0xc'),auth[_0x98e8('0x9')](),controller[_0x98e8('0xd')]);router[_0x98e8('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x98e8('0xf')]('/:id',auth[_0x98e8('0x9')](),controller[_0x98e8('0x10')]);router[_0x98e8('0x11')](_0x98e8('0xc'),auth[_0x98e8('0x9')](),controller[_0x98e8('0x12')]);module[_0x98e8('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 7dd189d..09b8671 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 _0xd4dc=['BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING','DATE'];(function(_0x199e76,_0x442c6f){var _0x1a640a=function(_0x1a3337){while(--_0x1a3337){_0x199e76['push'](_0x199e76['shift']());}};_0x1a640a(++_0x442c6f);}(_0xd4dc,0xff));var _0xcd4d=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xd4dc[_0x4e676e];return _0x336a3c;};'use strict';var Sequelize=require(_0xcd4d('0x0'));module['exports']={'type':{'type':Sequelize[_0xcd4d('0x1')]},'uniqueid':{'type':Sequelize[_0xcd4d('0x1')]},'calleridnum':{'type':Sequelize[_0xcd4d('0x1')]},'calleridname':{'type':Sequelize[_0xcd4d('0x1')]},'queue':{'type':Sequelize[_0xcd4d('0x1')]},'interface':{'type':Sequelize[_0xcd4d('0x1')]},'membername':{'type':Sequelize[_0xcd4d('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xcd4d('0x2')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0xcd4d('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xcd4d('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xcd4d('0x3')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xcd4d('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xcd4d('0x4')]},'agentacw':{'type':Sequelize[_0xcd4d('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0xcd4d('0x1')]},'channel':{'type':Sequelize[_0xcd4d('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xcd4d('0x1')]},'connectedlinenum':{'type':Sequelize[_0xcd4d('0x1')]},'connectedlinename':{'type':Sequelize[_0xcd4d('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xcd4d('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xcd4d('0x1')]},'priority':{'type':Sequelize[_0xcd4d('0x1')]},'destchannel':{'type':Sequelize[_0xcd4d('0x1')]},'destchannelstate':{'type':Sequelize[_0xcd4d('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xcd4d('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xcd4d('0x1')]},'destlanguage':{'type':Sequelize[_0xcd4d('0x1')]},'destaccountcode':{'type':Sequelize[_0xcd4d('0x1')]},'destcontext':{'type':Sequelize[_0xcd4d('0x1')]},'destexten':{'type':Sequelize[_0xcd4d('0x1')]},'destpriority':{'type':Sequelize[_0xcd4d('0x1')]},'destuniqueid':{'type':Sequelize[_0xcd4d('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xcd4d('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xcd4d('0x1')]},'transfer':{'type':Sequelize[_0xcd4d('0x3')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0xcd4d('0x5')},'transferexten':{'type':Sequelize[_0xcd4d('0x1')]},'transferuniqueid':{'type':Sequelize[_0xcd4d('0x1')]},'agententerreason':{'type':Sequelize[_0xcd4d('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xef0a=['exports','STRING','DATE','INTEGER','BOOLEAN','sequelize'];(function(_0x18afca,_0x4219d9){var _0x11603f=function(_0x21d5d1){while(--_0x21d5d1){_0x18afca['push'](_0x18afca['shift']());}};_0x11603f(++_0x4219d9);}(_0xef0a,0xdd));var _0xaef0=function(_0x75c5c5,_0x184f41){_0x75c5c5=_0x75c5c5-0x0;var _0x56377d=_0xef0a[_0x75c5c5];return _0x56377d;};'use strict';var Sequelize=require(_0xaef0('0x0'));module[_0xaef0('0x1')]={'type':{'type':Sequelize[_0xaef0('0x2')]},'uniqueid':{'type':Sequelize[_0xaef0('0x2')]},'calleridnum':{'type':Sequelize[_0xaef0('0x2')]},'calleridname':{'type':Sequelize[_0xaef0('0x2')]},'queue':{'type':Sequelize[_0xaef0('0x2')]},'interface':{'type':Sequelize[_0xaef0('0x2')]},'membername':{'type':Sequelize[_0xaef0('0x2')]},'agentcalledAt':{'type':Sequelize[_0xaef0('0x3')]},'agentconnectAt':{'type':Sequelize[_0xaef0('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0xaef0('0x3')]},'agentdumpAt':{'type':Sequelize[_0xaef0('0x3')]},'holdtime':{'type':Sequelize[_0xaef0('0x4')]},'agentcomplete':{'type':Sequelize[_0xaef0('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xaef0('0x4')]},'agentacw':{'type':Sequelize[_0xaef0('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xaef0('0x4')]},'reason':{'type':Sequelize[_0xaef0('0x2')]},'lastevent':{'type':Sequelize[_0xaef0('0x2')]},'channel':{'type':Sequelize[_0xaef0('0x2')]},'channelstate':{'type':Sequelize[_0xaef0('0x4')]},'channelstatedesc':{'type':Sequelize[_0xaef0('0x2')]},'connectedlinenum':{'type':Sequelize[_0xaef0('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xaef0('0x2')]},'accountcode':{'type':Sequelize[_0xaef0('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xaef0('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xaef0('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xaef0('0x2')]},'destcalleridnum':{'type':Sequelize[_0xaef0('0x2')]},'destcalleridname':{'type':Sequelize[_0xaef0('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xaef0('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xaef0('0x2')]},'destlanguage':{'type':Sequelize[_0xaef0('0x2')]},'destaccountcode':{'type':Sequelize[_0xaef0('0x2')]},'destcontext':{'type':Sequelize[_0xaef0('0x2')]},'destexten':{'type':Sequelize[_0xaef0('0x2')]},'destpriority':{'type':Sequelize[_0xaef0('0x2')]},'destuniqueid':{'type':Sequelize[_0xaef0('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xaef0('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xaef0('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xaef0('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xaef0('0x2')]},'transferuniqueid':{'type':Sequelize[_0xaef0('0x2')]},'agententerreason':{'type':Sequelize['INTEGER'],'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 d15e641..f447c43 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(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_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 +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(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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 bca244f..aa81413 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 _0xe5d5=['exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','../../config/logger','moment','request-promise','rimraf','../../config/environment','./voiceAgentReport.attributes'];(function(_0x2bfd4f,_0x1bbf2c){var _0x341849=function(_0x4c246e){while(--_0x4c246e){_0x2bfd4f['push'](_0x2bfd4f['shift']());}};_0x341849(++_0x1bbf2c);}(_0xe5d5,0x156));var _0x5e5d=function(_0x2cbe8b,_0x24a22e){_0x2cbe8b=_0x2cbe8b-0x0;var _0x3af5b4=_0xe5d5[_0x2cbe8b];return _0x3af5b4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5e5d('0x0'))('api');var moment=require(_0x5e5d('0x1'));var BPromise=require('bluebird');var rp=require(_0x5e5d('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5e5d('0x3'));var config=require(_0x5e5d('0x4'));var attributes=require(_0x5e5d('0x5'));module[_0x5e5d('0x6')]=function(_0x13bcb7,_0x39077f){return _0x13bcb7[_0x5e5d('0x7')](_0x5e5d('0x8'),attributes,{'tableName':_0x5e5d('0x9'),'paranoid':![],'indexes':[{'fields':[_0x5e5d('0xa'),_0x5e5d('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xda19=['request-promise','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','util','../../config/logger','moment'];(function(_0x166d93,_0x301f09){var _0xba708=function(_0x349bf7){while(--_0x349bf7){_0x166d93['push'](_0x166d93['shift']());}};_0xba708(++_0x301f09);}(_0xda19,0xd5));var _0x9da1=function(_0x2a0004,_0x319979){_0x2a0004=_0x2a0004-0x0;var _0x544aa5=_0xda19[_0x2a0004];return _0x544aa5;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var logger=require(_0x9da1('0x1'))('api');var moment=require(_0x9da1('0x2'));var BPromise=require('bluebird');var rp=require(_0x9da1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9da1('0x4'));var config=require(_0x9da1('0x5'));var attributes=require(_0x9da1('0x6'));module[_0x9da1('0x7')]=function(_0x156faf,_0x2dcbc6){return _0x156faf[_0x9da1('0x8')](_0x9da1('0x9'),attributes,{'tableName':_0x9da1('0xa'),'paranoid':![],'indexes':[{'fields':[_0x9da1('0xb'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 3c0f377..c341289 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 _0x4cfb=['error','code','message','request\x20sent','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','stringify','UpdateVoiceAgentReport','update','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','debug'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x4cfb,0x19d));var _0xb4cf=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x4cfb[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0xb4cf('0x0'));var util=require(_0xb4cf('0x1'));var moment=require(_0xb4cf('0x2'));var BPromise=require(_0xb4cf('0x3'));var rs=require(_0xb4cf('0x4'));var fs=require('fs');var Redis=require(_0xb4cf('0x5'));var db=require(_0xb4cf('0x6'))['db'];var utils=require(_0xb4cf('0x7'));var logger=require(_0xb4cf('0x8'))(_0xb4cf('0x9'));var config=require(_0xb4cf('0xa'));var jayson=require(_0xb4cf('0xb'));var client=jayson[_0xb4cf('0xc')][_0xb4cf('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x402ee5,_0x35910d,_0x20b863){return new BPromise(function(_0x3d05c3,_0x4b1bdd){return client[_0xb4cf('0xe')](_0x402ee5,_0x20b863)[_0xb4cf('0xf')](function(_0x5122f0){logger[_0xb4cf('0x10')](_0xb4cf('0x11'),_0x35910d,'request\x20sent');logger[_0xb4cf('0x12')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x35910d,'request\x20sent',JSON['stringify'](_0x5122f0));if(_0x5122f0[_0xb4cf('0x13')]){if(_0x5122f0[_0xb4cf('0x13')][_0xb4cf('0x14')]===0x1f4){logger[_0xb4cf('0x13')](_0xb4cf('0x11'),_0x35910d,_0x5122f0[_0xb4cf('0x13')]['message']);return _0x4b1bdd(_0x5122f0['error'][_0xb4cf('0x15')]);}logger[_0xb4cf('0x13')](_0xb4cf('0x11'),_0x35910d,_0x5122f0[_0xb4cf('0x13')][_0xb4cf('0x15')]);return _0x3d05c3(_0x5122f0[_0xb4cf('0x13')][_0xb4cf('0x15')]);}else{logger[_0xb4cf('0x10')](_0xb4cf('0x11'),_0x35910d,_0xb4cf('0x16'));_0x3d05c3(_0x5122f0[_0xb4cf('0x17')][_0xb4cf('0x15')]);}})[_0xb4cf('0x18')](function(_0x48a080){logger[_0xb4cf('0x13')](_0xb4cf('0x11'),_0x35910d,_0x48a080);_0x4b1bdd(_0x48a080);});});}exports[_0xb4cf('0x19')]=function(_0x1e0998){var _0x267f07=this;return new Promise(function(_0x34ff65,_0x245f48){return db[_0xb4cf('0x1a')][_0xb4cf('0x1b')](_0x1e0998[_0xb4cf('0x1c')],{'raw':_0x1e0998[_0xb4cf('0x1d')]?_0x1e0998[_0xb4cf('0x1d')][_0xb4cf('0x1e')]===undefined?!![]:![]:!![]})[_0xb4cf('0xf')](function(_0x284a47){logger[_0xb4cf('0x10')](_0xb4cf('0x19'),_0x1e0998);logger[_0xb4cf('0x12')](_0xb4cf('0x19'),_0x1e0998,JSON[_0xb4cf('0x1f')](_0x284a47));_0x34ff65(_0x284a47);})[_0xb4cf('0x18')](function(_0x444bd8){logger[_0xb4cf('0x13')](_0xb4cf('0x19'),_0x444bd8[_0xb4cf('0x15')],_0x1e0998);_0x245f48(_0x267f07['error'](0x1f4,_0x444bd8[_0xb4cf('0x15')]));});});};exports[_0xb4cf('0x20')]=function(_0x5635c4){var _0x58c1fe=this;return new Promise(function(_0x422da2,_0x204bdc){return db[_0xb4cf('0x1a')][_0xb4cf('0x21')](_0x5635c4['body'],{'raw':_0x5635c4['options']?_0x5635c4['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5635c4[_0xb4cf('0x1d')]?_0x5635c4[_0xb4cf('0x1d')][_0xb4cf('0x22')]||null:null,'attributes':_0x5635c4[_0xb4cf('0x1d')]?_0x5635c4[_0xb4cf('0x1d')][_0xb4cf('0x23')]||null:null,'limit':_0x5635c4['options']?_0x5635c4[_0xb4cf('0x1d')]['limit']||null:null})['then'](function(_0x3b652b){logger[_0xb4cf('0x10')](_0xb4cf('0x20'),_0x5635c4);logger[_0xb4cf('0x12')](_0xb4cf('0x20'),_0x5635c4,JSON[_0xb4cf('0x1f')](_0x3b652b));_0x422da2(_0x3b652b);})[_0xb4cf('0x18')](function(_0x1b39a8){logger[_0xb4cf('0x13')](_0xb4cf('0x20'),_0x1b39a8[_0xb4cf('0x15')],_0x5635c4);_0x204bdc(_0x58c1fe[_0xb4cf('0x13')](0x1f4,_0x1b39a8[_0xb4cf('0x15')]));});});}; \ No newline at end of file +var _0x40db=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceAgentReport,\x20%s,\x20%s','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','UpdateVoiceAgentReport','where','attributes','limit','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2b28ba,_0x444626){var _0x4acc58=function(_0x8ba351){while(--_0x8ba351){_0x2b28ba['push'](_0x2b28ba['shift']());}};_0x4acc58(++_0x444626);}(_0x40db,0x171));var _0xb40d=function(_0xf394d1,_0x4998d6){_0xf394d1=_0xf394d1-0x0;var _0x28c21a=_0x40db[_0xf394d1];return _0x28c21a;};'use strict';var _=require(_0xb40d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb40d('0x1'));var rs=require(_0xb40d('0x2'));var fs=require('fs');var Redis=require(_0xb40d('0x3'));var db=require(_0xb40d('0x4'))['db'];var utils=require(_0xb40d('0x5'));var logger=require(_0xb40d('0x6'))('rpc');var config=require(_0xb40d('0x7'));var jayson=require(_0xb40d('0x8'));var client=jayson[_0xb40d('0x9')][_0xb40d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x572546,_0x413be2,_0x445d76){return new BPromise(function(_0x2423ae,_0x4b6c98){return client[_0xb40d('0xb')](_0x572546,_0x445d76)[_0xb40d('0xc')](function(_0x3d795d){logger[_0xb40d('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x413be2,_0xb40d('0xe'));logger[_0xb40d('0xf')](_0xb40d('0x10'),_0x413be2,_0xb40d('0xe'),JSON[_0xb40d('0x11')](_0x3d795d));if(_0x3d795d['error']){if(_0x3d795d[_0xb40d('0x12')][_0xb40d('0x13')]===0x1f4){logger[_0xb40d('0x12')](_0xb40d('0x14'),_0x413be2,_0x3d795d[_0xb40d('0x12')]['message']);return _0x4b6c98(_0x3d795d['error'][_0xb40d('0x15')]);}logger[_0xb40d('0x12')](_0xb40d('0x14'),_0x413be2,_0x3d795d[_0xb40d('0x12')]['message']);return _0x2423ae(_0x3d795d['error'][_0xb40d('0x15')]);}else{logger[_0xb40d('0xd')](_0xb40d('0x14'),_0x413be2,'request\x20sent');_0x2423ae(_0x3d795d[_0xb40d('0x16')][_0xb40d('0x15')]);}})[_0xb40d('0x17')](function(_0x5031b1){logger['error'](_0xb40d('0x14'),_0x413be2,_0x5031b1);_0x4b6c98(_0x5031b1);});});}exports[_0xb40d('0x18')]=function(_0x45647f){var _0x411432=this;return new Promise(function(_0x507c01,_0x34f26d){return db[_0xb40d('0x19')][_0xb40d('0x1a')](_0x45647f[_0xb40d('0x1b')],{'raw':_0x45647f['options']?_0x45647f[_0xb40d('0x1c')][_0xb40d('0x1d')]===undefined?!![]:![]:!![]})[_0xb40d('0xc')](function(_0x5e8359){logger[_0xb40d('0xd')](_0xb40d('0x18'),_0x45647f);logger[_0xb40d('0xf')](_0xb40d('0x18'),_0x45647f,JSON[_0xb40d('0x11')](_0x5e8359));_0x507c01(_0x5e8359);})[_0xb40d('0x17')](function(_0x544733){logger[_0xb40d('0x12')](_0xb40d('0x18'),_0x544733['message'],_0x45647f);_0x34f26d(_0x411432[_0xb40d('0x12')](0x1f4,_0x544733[_0xb40d('0x15')]));});});};exports[_0xb40d('0x1e')]=function(_0x37db35){var _0x465db5=this;return new Promise(function(_0x2c011b,_0x27bef0){return db[_0xb40d('0x19')]['update'](_0x37db35['body'],{'raw':_0x37db35[_0xb40d('0x1c')]?_0x37db35[_0xb40d('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37db35[_0xb40d('0x1c')]?_0x37db35[_0xb40d('0x1c')][_0xb40d('0x1f')]||null:null,'attributes':_0x37db35['options']?_0x37db35[_0xb40d('0x1c')][_0xb40d('0x20')]||null:null,'limit':_0x37db35[_0xb40d('0x1c')]?_0x37db35[_0xb40d('0x1c')][_0xb40d('0x21')]||null:null})[_0xb40d('0xc')](function(_0xf63567){logger[_0xb40d('0xd')](_0xb40d('0x1e'),_0x37db35);logger[_0xb40d('0xf')]('UpdateVoiceAgentReport',_0x37db35,JSON[_0xb40d('0x11')](_0xf63567));_0x2c011b(_0xf63567);})['catch'](function(_0xf08740){logger[_0xb40d('0x12')](_0xb40d('0x1e'),_0xf08740[_0xb40d('0x15')],_0x37db35);_0x27bef0(_0x465db5[_0xb40d('0x12')](0x1f4,_0xf08740[_0xb40d('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 695fd4b..34f7023 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 _0xd13e=['update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./voiceCallReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','put'];(function(_0x35b76f,_0x324c48){var _0x582906=function(_0x5e4a7b){while(--_0x5e4a7b){_0x35b76f['push'](_0x35b76f['shift']());}};_0x582906(++_0x324c48);}(_0xd13e,0x193));var _0xed13=function(_0x4cab38,_0x52376d){_0x4cab38=_0x4cab38-0x0;var _0x484057=_0xd13e[_0x4cab38];return _0x484057;};'use strict';var multer=require(_0xed13('0x0'));var util=require(_0xed13('0x1'));var path=require(_0xed13('0x2'));var timeout=require(_0xed13('0x3'));var express=require('express');var router=express[_0xed13('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xed13('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xed13('0x6'));var controller=require(_0xed13('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xed13('0x8')](_0xed13('0x9'),auth[_0xed13('0xa')](),controller[_0xed13('0xb')]);router[_0xed13('0x8')](_0xed13('0xc'),auth[_0xed13('0xa')](),controller[_0xed13('0xd')]);router[_0xed13('0xe')]('/',auth['isAuthenticated'](),controller[_0xed13('0xf')]);router[_0xed13('0x10')](_0xed13('0xc'),auth[_0xed13('0xa')](),controller[_0xed13('0x11')]);router['delete'](_0xed13('0xc'),auth[_0xed13('0xa')](),controller[_0xed13('0x12')]);module[_0xed13('0x13')]=router; \ No newline at end of file +var _0x7bae=['isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','destroy','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get'];(function(_0x84b7f2,_0x3bbc1d){var _0x52f617=function(_0x699dd){while(--_0x699dd){_0x84b7f2['push'](_0x84b7f2['shift']());}};_0x52f617(++_0x3bbc1d);}(_0x7bae,0x13b));var _0xe7ba=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x7bae[_0x55f8b4];return _0x2475f9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7ba('0x0'));var timeout=require(_0xe7ba('0x1'));var express=require('express');var router=express[_0xe7ba('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xe7ba('0x3'));var interaction=require(_0xe7ba('0x4'));var config=require(_0xe7ba('0x5'));var controller=require(_0xe7ba('0x6'));router[_0xe7ba('0x7')]('/',auth[_0xe7ba('0x8')](),controller[_0xe7ba('0x9')]);router[_0xe7ba('0x7')](_0xe7ba('0xa'),auth[_0xe7ba('0x8')](),controller[_0xe7ba('0xb')]);router[_0xe7ba('0x7')](_0xe7ba('0xc'),auth[_0xe7ba('0x8')](),controller['show']);router[_0xe7ba('0xd')]('/',auth[_0xe7ba('0x8')](),controller[_0xe7ba('0xe')]);router[_0xe7ba('0xf')](_0xe7ba('0xc'),auth[_0xe7ba('0x8')](),controller[_0xe7ba('0x10')]);router[_0xe7ba('0x11')](_0xe7ba('0xc'),auth['isAuthenticated'](),controller[_0xe7ba('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 20da105..422797f 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 _0xecd7=['STRING','ENUM','outbound','inbound-fax','outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','exports'];(function(_0x12e728,_0x25f4ba){var _0x5d9f3d=function(_0x428818){while(--_0x428818){_0x12e728['push'](_0x12e728['shift']());}};_0x5d9f3d(++_0x25f4ba);}(_0xecd7,0x18a));var _0x7ecd=function(_0x5193ae,_0xcd87c6){_0x5193ae=_0x5193ae-0x0;var _0x58303e=_0xecd7[_0x5193ae];return _0x58303e;};'use strict';var Sequelize=require(_0x7ecd('0x0'));module[_0x7ecd('0x1')]={'uniqueid':{'type':Sequelize[_0x7ecd('0x2')]},'type':{'type':Sequelize[_0x7ecd('0x3')]('inbound','internal',_0x7ecd('0x4'),_0x7ecd('0x5'),_0x7ecd('0x6'),_0x7ecd('0x7'))},'tag':{'type':Sequelize[_0x7ecd('0x2')]},'accountcode':{'type':Sequelize[_0x7ecd('0x2')]},'source':{'type':Sequelize[_0x7ecd('0x2')]},'destination':{'type':Sequelize[_0x7ecd('0x2')]},'destinationcontext':{'type':Sequelize[_0x7ecd('0x2')]},'callerid':{'type':Sequelize[_0x7ecd('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x7ecd('0x2')]},'lastapplication':{'type':Sequelize[_0x7ecd('0x2')]},'lastdata':{'type':Sequelize[_0x7ecd('0x8')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x7ecd('0x9')]},'answertime':{'type':Sequelize[_0x7ecd('0x9')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x7ecd('0xa')]},'mohtime':{'type':Sequelize[_0x7ecd('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x7ecd('0x2')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x7ecd('0x2')]},'userSecondDisposition':{'type':Sequelize[_0x7ecd('0x2')]},'userThirdDisposition':{'type':Sequelize[_0x7ecd('0x2')]},'note':{'type':Sequelize[_0x7ecd('0x2')]},'prefix':{'type':Sequelize[_0x7ecd('0x2')]},'routeid':{'type':Sequelize[_0x7ecd('0xa')]},'sipcallid':{'type':Sequelize[_0x7ecd('0x2')]}}; \ No newline at end of file +var _0xa547=['exports','ENUM','internal','outbound','inbound-fax','outbound-fax','dialer','STRING','TEXT','DATE','INTEGER'];(function(_0x404650,_0x4f4283){var _0x55753d=function(_0x591fa9){while(--_0x591fa9){_0x404650['push'](_0x404650['shift']());}};_0x55753d(++_0x4f4283);}(_0xa547,0xb0));var _0x7a54=function(_0x101b74,_0x280069){_0x101b74=_0x101b74-0x0;var _0x3d5164=_0xa547[_0x101b74];return _0x3d5164;};'use strict';var Sequelize=require('sequelize');module[_0x7a54('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x7a54('0x1')]('inbound',_0x7a54('0x2'),_0x7a54('0x3'),_0x7a54('0x4'),_0x7a54('0x5'),_0x7a54('0x6'))},'tag':{'type':Sequelize[_0x7a54('0x7')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0x7a54('0x7')]},'destination':{'type':Sequelize[_0x7a54('0x7')]},'destinationcontext':{'type':Sequelize[_0x7a54('0x7')]},'callerid':{'type':Sequelize[_0x7a54('0x7')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x7a54('0x7')]},'lastdata':{'type':Sequelize[_0x7a54('0x8')]},'starttime':{'type':Sequelize[_0x7a54('0x9')]},'systemanswertime':{'type':Sequelize[_0x7a54('0x9')]},'answertime':{'type':Sequelize[_0x7a54('0x9')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x7a54('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x7a54('0x7')]},'amaflags':{'type':Sequelize[_0x7a54('0x7')]},'userfield':{'type':Sequelize[_0x7a54('0x7')]},'userDisposition':{'type':Sequelize[_0x7a54('0x7')]},'userSecondDisposition':{'type':Sequelize[_0x7a54('0x7')]},'userThirdDisposition':{'type':Sequelize[_0x7a54('0x7')]},'note':{'type':Sequelize[_0x7a54('0x7')]},'prefix':{'type':Sequelize[_0x7a54('0x7')]},'routeid':{'type':Sequelize[_0x7a54('0xa')]},'sipcallid':{'type':Sequelize[_0x7a54('0x7')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 5ee9e7d..342e9db 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 _0xb10b=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','filter','merge','options','VoiceCallReport','includeAll','include','alias','User','rows','show','find','create','body','catch','params','describe','uniqueid','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce'];(function(_0x52a7d4,_0x14d11c){var _0x416e98=function(_0x31c33a){while(--_0x31c33a){_0x52a7d4['push'](_0x52a7d4['shift']());}};_0x416e98(++_0x14d11c);}(_0xb10b,0x12a));var _0xbb10=function(_0x3fd7ab,_0x3dd0bc){_0x3fd7ab=_0x3fd7ab-0x0;var _0x56cb4b=_0xb10b[_0x3fd7ab];return _0x56cb4b;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x13'));var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require('../../config/utils');var config=require(_0xbb10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb10('0x17'))['db'];function respondWithStatusCode(_0x916a32,_0x285009){_0x285009=_0x285009||0xcc;return function(_0x193a27){if(_0x193a27){return _0x916a32[_0xbb10('0x18')](_0x285009);}return _0x916a32[_0xbb10('0x19')](_0x285009)['end']();};}function respondWithResult(_0x26e021,_0x42d7e4){_0x42d7e4=_0x42d7e4||0xc8;return function(_0x45b9d6){if(_0x45b9d6){return _0x26e021[_0xbb10('0x19')](_0x42d7e4)[_0xbb10('0x1a')](_0x45b9d6);}};}function respondWithFilteredResult(_0x2f2ebf,_0x24a57b){return function(_0x36b5e8){if(_0x36b5e8){var _0x3e26f4=typeof _0x24a57b[_0xbb10('0x1b')]==='undefined'&&typeof _0x24a57b[_0xbb10('0x1c')]===_0xbb10('0x1d');var _0x133ac2=_0x36b5e8[_0xbb10('0x1e')];var _0x378da8=_0x3e26f4?0x0:_0x24a57b[_0xbb10('0x1b')];var _0x575cca=_0x3e26f4?_0x36b5e8[_0xbb10('0x1e')]:_0x24a57b[_0xbb10('0x1b')]+_0x24a57b[_0xbb10('0x1c')];var _0x48b6e9;if(_0x575cca>=_0x133ac2){_0x575cca=_0x133ac2;_0x48b6e9=0xc8;}else{_0x48b6e9=0xce;}_0x2f2ebf[_0xbb10('0x19')](_0x48b6e9);return _0x2f2ebf[_0xbb10('0x1f')](_0xbb10('0x20'),_0x378da8+'-'+_0x575cca+'/'+_0x133ac2)[_0xbb10('0x1a')](_0x36b5e8);}return null;};}function patchUpdates(_0xdf237d){return function(_0x44e563){try{jsonpatch['apply'](_0x44e563,_0xdf237d,!![]);}catch(_0x12f888){return BPromise[_0xbb10('0x21')](_0x12f888);}return _0x44e563['save']();};}function saveUpdates(_0x4c4b0d,_0x8e2b97){return function(_0x311abe){if(_0x311abe){return _0x311abe[_0xbb10('0x22')](_0x4c4b0d)[_0xbb10('0x23')](function(_0x445761){return _0x445761;});}return null;};}function removeEntity(_0x1824b7,_0x407cb4){return function(_0x436104){if(_0x436104){return _0x436104[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x1824b7[_0xbb10('0x19')](0xcc)[_0xbb10('0x25')]();});}};}function handleEntityNotFound(_0x537898,_0x4fedac){return function(_0x4fb5e0){if(!_0x4fb5e0){_0x537898[_0xbb10('0x18')](0x194);}return _0x4fb5e0;};}function handleError(_0x3c5ae7,_0x2c89b9){_0x2c89b9=_0x2c89b9||0x1f4;return function(_0x4e25ff){logger[_0xbb10('0x26')](_0x4e25ff[_0xbb10('0x27')]);if(_0x4e25ff[_0xbb10('0x28')]){delete _0x4e25ff[_0xbb10('0x28')];}_0x3c5ae7[_0xbb10('0x19')](_0x2c89b9)[_0xbb10('0x29')](_0x4e25ff);};}exports[_0xbb10('0x2a')]=function(_0x4aabb9,_0x3796c7){var _0x21ac54={},_0xfc3595={},_0x2e0249={'count':0x0,'rows':[]};var _0x1d30aa=_[_0xbb10('0x2b')](db['VoiceCallReport'][_0xbb10('0x2c')],function(_0x4ee02e){return{'name':_0x4ee02e[_0xbb10('0x2d')],'type':_0x4ee02e['type'][_0xbb10('0x2e')]};});_0xfc3595[_0xbb10('0x2f')]=_[_0xbb10('0x2b')](_0x1d30aa,'name');_0xfc3595['query']=_[_0xbb10('0x30')](_0x4aabb9[_0xbb10('0x31')]);_0xfc3595['filters']=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],_0xfc3595[_0xbb10('0x31')]);_0x21ac54[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x4aabb9['query'][_0xbb10('0x34')]));_0x21ac54[_0xbb10('0x33')]=_0x21ac54[_0xbb10('0x33')][_0xbb10('0x35')]?_0x21ac54[_0xbb10('0x33')]:_0xfc3595[_0xbb10('0x2f')];if(!_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x36')](_0xbb10('0x37'))){_0x21ac54['limit']=qs[_0xbb10('0x1c')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x1c')]);_0x21ac54[_0xbb10('0x1b')]=qs['offset'](_0x4aabb9[_0xbb10('0x31')]['offset']);}_0x21ac54['order']=qs[_0xbb10('0x38')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x38')]);_0x21ac54[_0xbb10('0x39')]=qs[_0xbb10('0x3a')](_[_0xbb10('0x3b')](_0x4aabb9['query'],_0xfc3595[_0xbb10('0x3a')]),_0x1d30aa);if(_0x4aabb9[_0xbb10('0x31')]['filter']){_0x21ac54['where']=_['merge'](_0x21ac54[_0xbb10('0x39')],{'$or':_[_0xbb10('0x2b')](_0x1d30aa,function(_0x2b658a){if(_0x2b658a['type']!==_0xbb10('0x3c')){var _0x3e8538={};_0x3e8538[_0x2b658a[_0xbb10('0x28')]]={'$like':'%'+_0x4aabb9['query'][_0xbb10('0x3d')]+'%'};return _0x3e8538;}})});}_0x21ac54=_[_0xbb10('0x3e')]({},_0x21ac54,_0x4aabb9[_0xbb10('0x3f')]);var _0x446f49={'where':_0x21ac54['where']};return db[_0xbb10('0x40')][_0xbb10('0x1e')](_0x446f49)['then'](function(_0xe2040f){_0x2e0249[_0xbb10('0x1e')]=_0xe2040f;if(_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x41')]){_0x21ac54[_0xbb10('0x42')]=[{'attributes':['id',_0xbb10('0x28'),'fullname',_0xbb10('0x43')],'model':db[_0xbb10('0x44')],'as':_0xbb10('0x44')}];}return db[_0xbb10('0x40')]['findAll'](_0x21ac54);})[_0xbb10('0x23')](function(_0x331751){_0x2e0249[_0xbb10('0x45')]=_0x331751;return _0x2e0249;})[_0xbb10('0x23')](respondWithFilteredResult(_0x3796c7,_0x21ac54))['catch'](handleError(_0x3796c7,null));};exports[_0xbb10('0x46')]=function(_0x202c60,_0x54ac18){var _0x5d9a4f={'raw':!![],'where':{'id':_0x202c60['params']['id']}},_0x38d78f={};_0x38d78f[_0xbb10('0x2f')]=_[_0xbb10('0x30')](db['VoiceCallReport'][_0xbb10('0x2c')]);_0x38d78f[_0xbb10('0x31')]=_[_0xbb10('0x30')](_0x202c60['query']);_0x38d78f[_0xbb10('0x3a')]=_[_0xbb10('0x32')](_0x38d78f[_0xbb10('0x2f')],_0x38d78f[_0xbb10('0x31')]);_0x5d9a4f[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0x38d78f[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x202c60[_0xbb10('0x31')][_0xbb10('0x34')]));_0x5d9a4f[_0xbb10('0x33')]=_0x5d9a4f[_0xbb10('0x33')]['length']?_0x5d9a4f[_0xbb10('0x33')]:_0x38d78f[_0xbb10('0x2f')];if(_0x202c60['query'][_0xbb10('0x41')]){_0x5d9a4f[_0xbb10('0x42')]=[{'all':!![]}];}_0x5d9a4f=_[_0xbb10('0x3e')]({},_0x5d9a4f,_0x202c60[_0xbb10('0x3f')]);return db[_0xbb10('0x40')][_0xbb10('0x47')](_0x5d9a4f)[_0xbb10('0x23')](handleEntityNotFound(_0x54ac18,null))['then'](respondWithResult(_0x54ac18,null))['catch'](handleError(_0x54ac18,null));};exports[_0xbb10('0x48')]=function(_0x76a208,_0x2b12bd){return db['VoiceCallReport']['create'](_0x76a208[_0xbb10('0x49')],{})[_0xbb10('0x23')](respondWithResult(_0x2b12bd,0xc9))[_0xbb10('0x4a')](handleError(_0x2b12bd,null));};exports[_0xbb10('0x24')]=function(_0x10159b,_0x22b315){return db[_0xbb10('0x40')][_0xbb10('0x47')]({'where':{'id':_0x10159b[_0xbb10('0x4b')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x22b315,null))['then'](removeEntity(_0x22b315,null))['catch'](handleError(_0x22b315,null));};exports[_0xbb10('0x4c')]=function(_0x467dba,_0x36ab7d){return db[_0xbb10('0x40')][_0xbb10('0x4c')]()[_0xbb10('0x23')](respondWithResult(_0x36ab7d,null))[_0xbb10('0x4a')](handleError(_0x36ab7d,null));};exports[_0xbb10('0x22')]=function(_0x1c0d8f,_0x1214f7){if(_0x1c0d8f[_0xbb10('0x49')][_0xbb10('0x4d')]){delete _0x1c0d8f[_0xbb10('0x49')][_0xbb10('0x4d')];}return db[_0xbb10('0x40')]['find']({'where':{'uniqueid':_0x1c0d8f[_0xbb10('0x4b')]['id'],'UserId':{'$or':[null,_0x1c0d8f['user']['id']]}}})[_0xbb10('0x23')](handleEntityNotFound(_0x1214f7,null))[_0xbb10('0x23')](saveUpdates(_0x1c0d8f[_0xbb10('0x49')],null))[_0xbb10('0x23')](respondWithResult(_0x1214f7,null))[_0xbb10('0x4a')](handleError(_0x1214f7,null));}; \ No newline at end of file +var _0x5f2f=['stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','fullname','alias','User','findAll','catch','params','keys','find','create','body','destroy','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0x1e2321,_0x3ae1c5){var _0x1d346d=function(_0x24f171){while(--_0x24f171){_0x1e2321['push'](_0x1e2321['shift']());}};_0x1d346d(++_0x3ae1c5);}(_0x5f2f,0x73));var _0xf5f2=function(_0x32856c,_0x21013b){_0x32856c=_0x32856c-0x0;var _0x5694f3=_0x5f2f[_0x32856c];return _0x5694f3;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'attributes':['id',_0xf5f2('0x26'),_0xf5f2('0x3e'),_0xf5f2('0x3f')],'model':db['User'],'as':_0xf5f2('0x40')}];}return db[_0xf5f2('0x29')][_0xf5f2('0x41')](_0x22c826);})['then'](function(_0x509dbc){_0x11c771['rows']=_0x509dbc;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x42')](handleError(_0x53cb96,null));};exports['show']=function(_0x106272,_0xeed03d){var _0x28e33f={'raw':!![],'where':{'id':_0x106272[_0xf5f2('0x43')]['id']}},_0x31f86c={};_0x31f86c[_0xf5f2('0x31')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x31f86c[_0xf5f2('0x2e')]=_[_0xf5f2('0x44')](_0x106272[_0xf5f2('0x2e')]);_0x31f86c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x31f86c['model'],_0x31f86c[_0xf5f2('0x2e')]);_0x28e33f['attributes']=_[_0xf5f2('0x30')](_0x31f86c[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x28e33f[_0xf5f2('0x32')]=_0x28e33f['attributes'][_0xf5f2('0x34')]?_0x28e33f[_0xf5f2('0x32')]:_0x31f86c[_0xf5f2('0x31')];if(_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x28e33f[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x28e33f=_[_0xf5f2('0x39')]({},_0x28e33f,_0x106272[_0xf5f2('0x3b')]);return db['VoiceCallReport'][_0xf5f2('0x45')](_0x28e33f)[_0xf5f2('0x24')](handleEntityNotFound(_0xeed03d,null))[_0xf5f2('0x24')](respondWithResult(_0xeed03d,null))['catch'](handleError(_0xeed03d,null));};exports[_0xf5f2('0x46')]=function(_0xc91b64,_0x3179a9){return db['VoiceCallReport']['create'](_0xc91b64[_0xf5f2('0x47')],{})[_0xf5f2('0x24')](respondWithResult(_0x3179a9,0xc9))['catch'](handleError(_0x3179a9,null));};exports[_0xf5f2('0x48')]=function(_0x533cca,_0x740321){return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'id':_0x533cca['params']['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x740321,null))[_0xf5f2('0x24')](removeEntity(_0x740321,null))[_0xf5f2('0x42')](handleError(_0x740321,null));};exports[_0xf5f2('0x49')]=function(_0x4fa738,_0x3154c1){return db[_0xf5f2('0x29')]['describe']()['then'](respondWithResult(_0x3154c1,null))[_0xf5f2('0x42')](handleError(_0x3154c1,null));};exports[_0xf5f2('0x4a')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x47')][_0xf5f2('0x4b')]){delete _0x57782c[_0xf5f2('0x47')]['uniqueid'];}return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'uniqueid':_0x57782c[_0xf5f2('0x43')]['id'],'UserId':{'$or':[null,_0x57782c['user']['id']]}}})[_0xf5f2('0x24')](handleEntityNotFound(_0x22b645,null))[_0xf5f2('0x24')](saveUpdates(_0x57782c[_0xf5f2('0x47')],null))[_0xf5f2('0x24')](respondWithResult(_0x22b645,null))[_0xf5f2('0x42')](handleError(_0x22b645,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 091124a..570cb0a 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 _0x2a2b=['report_call','uniqueid','util','../../config/logger','moment','bluebird','request-promise','path','./voiceCallReport.attributes','exports','define','VoiceCallReport'];(function(_0x75d2c6,_0x54b8fe){var _0x3f2dc4=function(_0x315f80){while(--_0x315f80){_0x75d2c6['push'](_0x75d2c6['shift']());}};_0x3f2dc4(++_0x54b8fe);}(_0x2a2b,0x116));var _0xb2a2=function(_0x56e1f1,_0x433412){_0x56e1f1=_0x56e1f1-0x0;var _0x5a7b9d=_0x2a2b[_0x56e1f1];return _0x5a7b9d;};'use strict';var _=require('lodash');var util=require(_0xb2a2('0x0'));var logger=require(_0xb2a2('0x1'))('api');var moment=require(_0xb2a2('0x2'));var BPromise=require(_0xb2a2('0x3'));var rp=require(_0xb2a2('0x4'));var fs=require('fs');var path=require(_0xb2a2('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb2a2('0x6'));module[_0xb2a2('0x7')]=function(_0x5ec9f2,_0x3693fd){return _0x5ec9f2[_0xb2a2('0x8')](_0xb2a2('0x9'),attributes,{'tableName':_0xb2a2('0xa'),'paranoid':![],'indexes':[{'fields':[_0xb2a2('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x12e6=['moment','path','rimraf','./voiceCallReport.attributes','exports','VoiceCallReport','report_call','uniqueid','util','api'];(function(_0x31532b,_0x25c972){var _0xf48c5c=function(_0x55326b){while(--_0x55326b){_0x31532b['push'](_0x31532b['shift']());}};_0xf48c5c(++_0x25c972);}(_0x12e6,0x184));var _0x612e=function(_0x408a6e,_0x441d25){_0x408a6e=_0x408a6e-0x0;var _0x3db7cc=_0x12e6[_0x408a6e];return _0x3db7cc;};'use strict';var _=require('lodash');var util=require(_0x612e('0x0'));var logger=require('../../config/logger')(_0x612e('0x1'));var moment=require(_0x612e('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x612e('0x3'));var rimraf=require(_0x612e('0x4'));var config=require('../../config/environment');var attributes=require(_0x612e('0x5'));module[_0x612e('0x6')]=function(_0xed7b29,_0x5e4f0e){return _0xed7b29['define'](_0x612e('0x7'),attributes,{'tableName':_0x612e('0x8'),'paranoid':![],'indexes':[{'fields':[_0x612e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 0175140..15655d8 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 _0x00d5=['map','model','attributes','VoiceCallReport','create','body','CreateVoiceCallReport','UpdateVoiceCallReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceCallReport','findAll','options','raw','where','limit','include'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x00d5,0x19f));var _0x500d=function(_0x188bfe,_0x2517cc){_0x188bfe=_0x188bfe-0x0;var _0x1a9efa=_0x00d5[_0x188bfe];return _0x1a9efa;};'use strict';var _=require(_0x500d('0x0'));var util=require(_0x500d('0x1'));var moment=require(_0x500d('0x2'));var BPromise=require(_0x500d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x500d('0x4'));var db=require(_0x500d('0x5'))['db'];var utils=require(_0x500d('0x6'));var logger=require(_0x500d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x500d('0x8'));var client=jayson[_0x500d('0x9')][_0x500d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54b803,_0x30e217,_0x4895f6){return new BPromise(function(_0xf05d19,_0x4565e8){return client['request'](_0x54b803,_0x4895f6)[_0x500d('0xb')](function(_0x16ec8b){logger[_0x500d('0xc')](_0x500d('0xd'),_0x30e217,'request\x20sent');logger[_0x500d('0xe')](_0x500d('0xf'),_0x30e217,'request\x20sent',JSON[_0x500d('0x10')](_0x16ec8b));if(_0x16ec8b['error']){if(_0x16ec8b[_0x500d('0x11')][_0x500d('0x12')]===0x1f4){logger[_0x500d('0x11')](_0x500d('0xd'),_0x30e217,_0x16ec8b[_0x500d('0x11')][_0x500d('0x13')]);return _0x4565e8(_0x16ec8b[_0x500d('0x11')][_0x500d('0x13')]);}logger[_0x500d('0x11')](_0x500d('0xd'),_0x30e217,_0x16ec8b[_0x500d('0x11')][_0x500d('0x13')]);return _0xf05d19(_0x16ec8b[_0x500d('0x11')][_0x500d('0x13')]);}else{logger[_0x500d('0xc')](_0x500d('0xd'),_0x30e217,'request\x20sent');_0xf05d19(_0x16ec8b[_0x500d('0x14')]['message']);}})[_0x500d('0x15')](function(_0x49456d){logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x30e217,_0x49456d);_0x4565e8(_0x49456d);});});}exports[_0x500d('0x16')]=function(_0x218264){var _0xabe03c=this;return new Promise(function(_0x2b4bd8,_0x157b44){return db['VoiceCallReport'][_0x500d('0x17')]({'raw':_0x218264['options']?_0x218264[_0x500d('0x18')][_0x500d('0x19')]===undefined?!![]:![]:!![],'where':_0x218264[_0x500d('0x18')]?_0x218264[_0x500d('0x18')][_0x500d('0x1a')]||null:null,'attributes':_0x218264[_0x500d('0x18')]?_0x218264[_0x500d('0x18')]['attributes']||null:null,'limit':_0x218264[_0x500d('0x18')]?_0x218264[_0x500d('0x18')][_0x500d('0x1b')]||null:null,'include':_0x218264[_0x500d('0x18')]?_0x218264[_0x500d('0x18')][_0x500d('0x1c')]?_[_0x500d('0x1d')](_0x218264['options']['include'],function(_0x3e9a48){return{'model':db[_0x3e9a48['model']],'as':_0x3e9a48['as'],'attributes':_0x3e9a48['attributes'],'include':_0x3e9a48[_0x500d('0x1c')]?_['map'](_0x3e9a48[_0x500d('0x1c')],function(_0x4aa149){return{'model':db[_0x4aa149[_0x500d('0x1e')]],'as':_0x4aa149['as'],'attributes':_0x4aa149[_0x500d('0x1f')],'include':_0x4aa149[_0x500d('0x1c')]?_[_0x500d('0x1d')](_0x4aa149[_0x500d('0x1c')],function(_0x14f7f8){return{'model':db[_0x14f7f8[_0x500d('0x1e')]],'as':_0x14f7f8['as'],'attributes':_0x14f7f8[_0x500d('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x11e61f){logger[_0x500d('0xc')](_0x500d('0x16'),_0x218264);logger['debug'](_0x500d('0x16'),_0x218264,JSON[_0x500d('0x10')](_0x11e61f));_0x2b4bd8(_0x11e61f);})[_0x500d('0x15')](function(_0x1b9e50){logger[_0x500d('0x11')](_0x500d('0x16'),_0x1b9e50[_0x500d('0x13')],_0x218264);_0x157b44(_0xabe03c[_0x500d('0x11')](0x1f4,_0x1b9e50[_0x500d('0x13')]));});});};exports['CreateVoiceCallReport']=function(_0x2e8c92){var _0x4b6363=this;return new Promise(function(_0x2ea150,_0x52ff0d){return db[_0x500d('0x20')][_0x500d('0x21')](_0x2e8c92[_0x500d('0x22')],{'raw':_0x2e8c92[_0x500d('0x18')]?_0x2e8c92['options'][_0x500d('0x19')]===undefined?!![]:![]:!![]})[_0x500d('0xb')](function(_0x5d4b51){logger[_0x500d('0xc')](_0x500d('0x23'),_0x2e8c92);logger[_0x500d('0xe')](_0x500d('0x23'),_0x2e8c92,JSON[_0x500d('0x10')](_0x5d4b51));_0x2ea150(_0x5d4b51);})[_0x500d('0x15')](function(_0x10b8b9){logger['error'](_0x500d('0x23'),_0x10b8b9[_0x500d('0x13')],_0x2e8c92);_0x52ff0d(_0x4b6363[_0x500d('0x11')](0x1f4,_0x10b8b9[_0x500d('0x13')]));});});};exports[_0x500d('0x24')]=function(_0x59ccf8){var _0x14e38c=this;return new Promise(function(_0x5c4aab,_0x5661d6){return db['VoiceCallReport']['update'](_0x59ccf8[_0x500d('0x22')],{'raw':_0x59ccf8[_0x500d('0x18')]?_0x59ccf8[_0x500d('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59ccf8['options']?_0x59ccf8[_0x500d('0x18')][_0x500d('0x1a')]||null:null,'attributes':_0x59ccf8[_0x500d('0x18')]?_0x59ccf8[_0x500d('0x18')][_0x500d('0x1f')]||null:null,'limit':_0x59ccf8[_0x500d('0x18')]?_0x59ccf8[_0x500d('0x18')][_0x500d('0x1b')]||null:null})['then'](function(_0x48ca39){logger[_0x500d('0xc')](_0x500d('0x24'),_0x59ccf8);logger[_0x500d('0xe')](_0x500d('0x24'),_0x59ccf8,JSON[_0x500d('0x10')](_0x48ca39));_0x5c4aab(_0x48ca39);})[_0x500d('0x15')](function(_0x2b0c14){logger[_0x500d('0x11')](_0x500d('0x24'),_0x2b0c14[_0x500d('0x13')],_0x59ccf8);_0x5661d6(_0x14e38c[_0x500d('0x11')](0x1f4,_0x2b0c14['message']));});});}; \ No newline at end of file +var _0x0817=['limit','map','include','model','GetVoiceCallReport','debug','create','body','CreateVoiceCallReport','UpdateVoiceCallReport','update','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','VoiceCallReport,\x20%s,\x20%s','message','result','catch','VoiceCallReport','findAll','options','raw','where','attributes'];(function(_0xc46059,_0x3ad831){var _0x2139a2=function(_0x53b184){while(--_0x53b184){_0xc46059['push'](_0xc46059['shift']());}};_0x2139a2(++_0x3ad831);}(_0x0817,0x143));var _0x7081=function(_0x18625a,_0x22bf58){_0x18625a=_0x18625a-0x0;var _0x4e0fa3=_0x0817[_0x18625a];return _0x4e0fa3;};'use strict';var _=require(_0x7081('0x0'));var util=require(_0x7081('0x1'));var moment=require(_0x7081('0x2'));var BPromise=require('bluebird');var rs=require(_0x7081('0x3'));var fs=require('fs');var Redis=require(_0x7081('0x4'));var db=require(_0x7081('0x5'))['db'];var utils=require(_0x7081('0x6'));var logger=require('../../config/logger')(_0x7081('0x7'));var config=require(_0x7081('0x8'));var jayson=require(_0x7081('0x9'));var client=jayson['client'][_0x7081('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41eeb8,_0x4245ca,_0x15f22c){return new BPromise(function(_0x5b17b5,_0x5e9b59){return client[_0x7081('0xb')](_0x41eeb8,_0x15f22c)[_0x7081('0xc')](function(_0x373514){logger[_0x7081('0xd')]('VoiceCallReport,\x20%s,\x20%s',_0x4245ca,_0x7081('0xe'));logger['debug'](_0x7081('0xf'),_0x4245ca,_0x7081('0xe'),JSON[_0x7081('0x10')](_0x373514));if(_0x373514[_0x7081('0x11')]){if(_0x373514[_0x7081('0x11')]['code']===0x1f4){logger[_0x7081('0x11')](_0x7081('0x12'),_0x4245ca,_0x373514[_0x7081('0x11')][_0x7081('0x13')]);return _0x5e9b59(_0x373514['error'][_0x7081('0x13')]);}logger[_0x7081('0x11')](_0x7081('0x12'),_0x4245ca,_0x373514['error']['message']);return _0x5b17b5(_0x373514[_0x7081('0x11')][_0x7081('0x13')]);}else{logger[_0x7081('0xd')]('VoiceCallReport,\x20%s,\x20%s',_0x4245ca,_0x7081('0xe'));_0x5b17b5(_0x373514[_0x7081('0x14')][_0x7081('0x13')]);}})[_0x7081('0x15')](function(_0xee432f){logger[_0x7081('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x4245ca,_0xee432f);_0x5e9b59(_0xee432f);});});}exports['GetVoiceCallReport']=function(_0x337baf){var _0x45ef8b=this;return new Promise(function(_0x5e7474,_0x4c71d7){return db[_0x7081('0x16')][_0x7081('0x17')]({'raw':_0x337baf[_0x7081('0x18')]?_0x337baf[_0x7081('0x18')][_0x7081('0x19')]===undefined?!![]:![]:!![],'where':_0x337baf[_0x7081('0x18')]?_0x337baf[_0x7081('0x18')][_0x7081('0x1a')]||null:null,'attributes':_0x337baf[_0x7081('0x18')]?_0x337baf[_0x7081('0x18')][_0x7081('0x1b')]||null:null,'limit':_0x337baf['options']?_0x337baf[_0x7081('0x18')][_0x7081('0x1c')]||null:null,'include':_0x337baf[_0x7081('0x18')]?_0x337baf[_0x7081('0x18')]['include']?_[_0x7081('0x1d')](_0x337baf[_0x7081('0x18')][_0x7081('0x1e')],function(_0x206ef2){return{'model':db[_0x206ef2[_0x7081('0x1f')]],'as':_0x206ef2['as'],'attributes':_0x206ef2['attributes'],'include':_0x206ef2['include']?_[_0x7081('0x1d')](_0x206ef2[_0x7081('0x1e')],function(_0x39bd83){return{'model':db[_0x39bd83[_0x7081('0x1f')]],'as':_0x39bd83['as'],'attributes':_0x39bd83[_0x7081('0x1b')],'include':_0x39bd83[_0x7081('0x1e')]?_['map'](_0x39bd83[_0x7081('0x1e')],function(_0x566040){return{'model':db[_0x566040[_0x7081('0x1f')]],'as':_0x566040['as'],'attributes':_0x566040[_0x7081('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7081('0xc')](function(_0x1c2e5c){logger[_0x7081('0xd')](_0x7081('0x20'),_0x337baf);logger[_0x7081('0x21')](_0x7081('0x20'),_0x337baf,JSON[_0x7081('0x10')](_0x1c2e5c));_0x5e7474(_0x1c2e5c);})[_0x7081('0x15')](function(_0x12e92c){logger[_0x7081('0x11')](_0x7081('0x20'),_0x12e92c['message'],_0x337baf);_0x4c71d7(_0x45ef8b[_0x7081('0x11')](0x1f4,_0x12e92c[_0x7081('0x13')]));});});};exports['CreateVoiceCallReport']=function(_0x52704d){var _0x25b1b9=this;return new Promise(function(_0x24f6e8,_0x52531){return db[_0x7081('0x16')][_0x7081('0x22')](_0x52704d[_0x7081('0x23')],{'raw':_0x52704d[_0x7081('0x18')]?_0x52704d[_0x7081('0x18')][_0x7081('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x156f51){logger[_0x7081('0xd')](_0x7081('0x24'),_0x52704d);logger['debug'](_0x7081('0x24'),_0x52704d,JSON['stringify'](_0x156f51));_0x24f6e8(_0x156f51);})['catch'](function(_0x49c02e){logger[_0x7081('0x11')](_0x7081('0x24'),_0x49c02e[_0x7081('0x13')],_0x52704d);_0x52531(_0x25b1b9[_0x7081('0x11')](0x1f4,_0x49c02e['message']));});});};exports[_0x7081('0x25')]=function(_0x3246c5){var _0x3315ae=this;return new Promise(function(_0x2f00d9,_0x5457cf){return db[_0x7081('0x16')][_0x7081('0x26')](_0x3246c5[_0x7081('0x23')],{'raw':_0x3246c5[_0x7081('0x18')]?_0x3246c5[_0x7081('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3246c5['options']?_0x3246c5[_0x7081('0x18')]['where']||null:null,'attributes':_0x3246c5['options']?_0x3246c5[_0x7081('0x18')][_0x7081('0x1b')]||null:null,'limit':_0x3246c5[_0x7081('0x18')]?_0x3246c5[_0x7081('0x18')][_0x7081('0x1c')]||null:null})['then'](function(_0x2607d9){logger[_0x7081('0xd')](_0x7081('0x25'),_0x3246c5);logger[_0x7081('0x21')]('UpdateVoiceCallReport',_0x3246c5,JSON[_0x7081('0x10')](_0x2607d9));_0x2f00d9(_0x2607d9);})[_0x7081('0x15')](function(_0x3e5cf0){logger[_0x7081('0x11')]('UpdateVoiceCallReport',_0x3e5cf0[_0x7081('0x13')],_0x3246c5);_0x5457cf(_0x3315ae[_0x7081('0x11')](0x1f4,_0x3e5cf0[_0x7081('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index b3897e4..db056b9 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 _0x08c0=['/:id','isAuthenticated','show','post','put','path','express','Router','../../config/environment','get'];(function(_0x1ca707,_0x14767e){var _0x4189da=function(_0x78a318){while(--_0x78a318){_0x1ca707['push'](_0x1ca707['shift']());}};_0x4189da(++_0x14767e);}(_0x08c0,0x127));var _0x008c=function(_0x329a4c,_0x4a124f){_0x329a4c=_0x329a4c-0x0;var _0x4b4197=_0x08c0[_0x329a4c];return _0x4b4197;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x008c('0x0'));var timeout=require('connect-timeout');var express=require(_0x008c('0x1'));var router=express[_0x008c('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x008c('0x3'));var controller=require('./voiceChanSpy.controller');router[_0x008c('0x4')]('/',auth['isAuthenticated'](),controller['index']);router[_0x008c('0x4')](_0x008c('0x5'),auth[_0x008c('0x6')](),controller[_0x008c('0x7')]);router[_0x008c('0x8')]('/',auth[_0x008c('0x6')](),controller['create']);router[_0x008c('0x9')]('/:id',auth[_0x008c('0x6')](),controller['update']);router['delete'](_0x008c('0x5'),auth[_0x008c('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xc730=['../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','index','/:id','post','create','put','isAuthenticated','destroy','exports','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x7e45dc,_0x1a7d77){var _0x1bcae5=function(_0x43bcfb){while(--_0x43bcfb){_0x7e45dc['push'](_0x7e45dc['shift']());}};_0x1bcae5(++_0x1a7d77);}(_0xc730,0xec));var _0x0c73=function(_0x5b7c37,_0x108264){_0x5b7c37=_0x5b7c37-0x0;var _0x57797b=_0xc730[_0x5b7c37];return _0x57797b;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x0c73('0x0'));var express=require(_0x0c73('0x1'));var router=express['Router']();var fs_extra=require(_0x0c73('0x2'));var auth=require(_0x0c73('0x3'));var interaction=require(_0x0c73('0x4'));var config=require(_0x0c73('0x5'));var controller=require(_0x0c73('0x6'));router[_0x0c73('0x7')]('/',auth['isAuthenticated'](),controller[_0x0c73('0x8')]);router[_0x0c73('0x7')](_0x0c73('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x0c73('0xa')]('/',auth['isAuthenticated'](),controller[_0x0c73('0xb')]);router[_0x0c73('0xc')]('/:id',auth[_0x0c73('0xd')](),controller['update']);router['delete']('/:id',auth[_0x0c73('0xd')](),controller[_0x0c73('0xe')]);module[_0x0c73('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index f21d362..7f1b61d 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 _0x8efd=['join','getDataValue','BOOLEAN','sequelize','exports','STRING','setDataValue','options'];(function(_0x217c2e,_0x358f06){var _0x22b7d8=function(_0x111c48){while(--_0x111c48){_0x217c2e['push'](_0x217c2e['shift']());}};_0x22b7d8(++_0x358f06);}(_0x8efd,0x153));var _0xd8ef=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x8efd[_0x46698a];return _0x356db0;};'use strict';var Sequelize=require(_0xd8ef('0x0'));module[_0xd8ef('0x1')]={'name':{'type':Sequelize[_0xd8ef('0x2')]},'prefix':{'type':Sequelize[_0xd8ef('0x2')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0xd8ef('0x2')],'set':function(_0xadc98e){this[_0xd8ef('0x3')](_0xd8ef('0x4'),_0xadc98e?_0xadc98e[_0xd8ef('0x5')](''):[]);},'get':function(){return this[_0xd8ef('0x6')](_0xd8ef('0x4'))?this[_0xd8ef('0x6')](_0xd8ef('0x4'))['split'](''):[];}},'auth':{'type':Sequelize[_0xd8ef('0x7')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0xd8ef('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xd8ef('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9c0c=['setDataValue','options','join','getDataValue','BOOLEAN','exports','STRING','name'];(function(_0x3e2480,_0x2eed70){var _0x652c0=function(_0xaae5d2){while(--_0xaae5d2){_0x3e2480['push'](_0x3e2480['shift']());}};_0x652c0(++_0x2eed70);}(_0x9c0c,0x1ed));var _0xc9c0=function(_0x330723,_0x8de382){_0x330723=_0x330723-0x0;var _0x60c546=_0x9c0c[_0x330723];return _0x60c546;};'use strict';var Sequelize=require('sequelize');module[_0xc9c0('0x0')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xc9c0('0x1')],'unique':_0xc9c0('0x2'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x595e98){this[_0xc9c0('0x3')](_0xc9c0('0x4'),_0x595e98?_0x595e98[_0xc9c0('0x5')](''):[]);},'get':function(){return this[_0xc9c0('0x6')]('options')?this[_0xc9c0('0x6')](_0xc9c0('0x4'))['split'](''):[];}},'auth':{'type':Sequelize[_0xc9c0('0x7')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0xc9c0('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xc9c0('0x1')]},'description':{'type':Sequelize[_0xc9c0('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 57fec40..23c7fb3 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 _0x0a12=['name','send','index','map','VoiceChanSpy','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','options','then','includeAll','include','rawAttributes','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','rimraf','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','save','destroy','error','stack'];(function(_0x5bfa82,_0x1fa15c){var _0x422e3e=function(_0x22ccc8){while(--_0x22ccc8){_0x5bfa82['push'](_0x5bfa82['shift']());}};_0x422e3e(++_0x1fa15c);}(_0x0a12,0xb8));var _0x20a1=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0x0a12[_0x1b5aea];return _0x15cfc6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x20a1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x20a1('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x20a1('0x2'));var util=require(_0x20a1('0x3'));var path=require(_0x20a1('0x4'));var sox=require(_0x20a1('0x5'));var csv=require(_0x20a1('0x6'));var ejs=require(_0x20a1('0x7'));var fs=require('fs');var fs_extra=require(_0x20a1('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x20a1('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x20a1('0x6'));var querystring=require(_0x20a1('0xa'));var Papa=require(_0x20a1('0xb'));var Redis=require(_0x20a1('0xc'));var authService=require(_0x20a1('0xd'));var qs=require(_0x20a1('0xe'));var as=require(_0x20a1('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x20a1('0x10'))(_0x20a1('0x11'));var utils=require(_0x20a1('0x12'));var config=require(_0x20a1('0x13'));var licenseUtil=require(_0x20a1('0x14'));var db=require(_0x20a1('0x15'))['db'];function respondWithStatusCode(_0x53a689,_0x77a193){_0x77a193=_0x77a193||0xcc;return function(_0xfe130a){if(_0xfe130a){return _0x53a689[_0x20a1('0x16')](_0x77a193);}return _0x53a689[_0x20a1('0x17')](_0x77a193)[_0x20a1('0x18')]();};}function respondWithResult(_0x32f1f9,_0x3c2c9f){_0x3c2c9f=_0x3c2c9f||0xc8;return function(_0x55feb0){if(_0x55feb0){return _0x32f1f9[_0x20a1('0x17')](_0x3c2c9f)[_0x20a1('0x19')](_0x55feb0);}};}function respondWithFilteredResult(_0xb736e9,_0x401178){return function(_0x1e6ae6){if(_0x1e6ae6){var _0xec799b=typeof _0x401178['offset']==='undefined'&&typeof _0x401178['limit']==='undefined';var _0x5925d4=_0x1e6ae6['count'];var _0x5c00a6=_0xec799b?0x0:_0x401178['offset'];var _0x4a68c5=_0xec799b?_0x1e6ae6[_0x20a1('0x1a')]:_0x401178[_0x20a1('0x1b')]+_0x401178[_0x20a1('0x1c')];var _0xf5d655;if(_0x4a68c5>=_0x5925d4){_0x4a68c5=_0x5925d4;_0xf5d655=0xc8;}else{_0xf5d655=0xce;}_0xb736e9[_0x20a1('0x17')](_0xf5d655);return _0xb736e9[_0x20a1('0x1d')]('Content-Range',_0x5c00a6+'-'+_0x4a68c5+'/'+_0x5925d4)['json'](_0x1e6ae6);}return null;};}function patchUpdates(_0x463968){return function(_0xce4fc4){try{jsonpatch[_0x20a1('0x1e')](_0xce4fc4,_0x463968,!![]);}catch(_0x4f7590){return BPromise['reject'](_0x4f7590);}return _0xce4fc4[_0x20a1('0x1f')]();};}function saveUpdates(_0x2969cd,_0x9089cc){return function(_0x16605d){if(_0x16605d){return _0x16605d['update'](_0x2969cd)['then'](function(_0x4e0100){return _0x4e0100;});}return null;};}function removeEntity(_0x48eb5d,_0x67313c){return function(_0x2f81a8){if(_0x2f81a8){return _0x2f81a8[_0x20a1('0x20')]()['then'](function(){var _0x10a600=_0x2f81a8['get']({'plain':!![]});var _0x11b83c='ChanSpies';return db['UserProfileResource']['destroy']({'where':{'type':_0x11b83c,'resourceId':_0x10a600['id']}})['then'](function(){return _0x2f81a8;});})['then'](function(){_0x48eb5d[_0x20a1('0x17')](0xcc)[_0x20a1('0x18')]();});}};}function handleEntityNotFound(_0x24d1e2,_0xee9dd8){return function(_0x3927b2){if(!_0x3927b2){_0x24d1e2[_0x20a1('0x16')](0x194);}return _0x3927b2;};}function handleError(_0x5a1352,_0x3697f8){_0x3697f8=_0x3697f8||0x1f4;return function(_0x47877f){logger[_0x20a1('0x21')](_0x47877f[_0x20a1('0x22')]);if(_0x47877f['name']){delete _0x47877f[_0x20a1('0x23')];}_0x5a1352['status'](_0x3697f8)[_0x20a1('0x24')](_0x47877f);};}exports[_0x20a1('0x25')]=function(_0x184a3d,_0x1cdc2c){var _0xe8e6d1={},_0x22627a={},_0x13d9ea={'count':0x0,'rows':[]};var _0x2f6dd0=_[_0x20a1('0x26')](db[_0x20a1('0x27')]['rawAttributes'],function(_0x1e6b14){return{'name':_0x1e6b14['fieldName'],'type':_0x1e6b14['type'][_0x20a1('0x28')]};});_0x22627a[_0x20a1('0x29')]=_[_0x20a1('0x26')](_0x2f6dd0,_0x20a1('0x23'));_0x22627a['query']=_[_0x20a1('0x2a')](_0x184a3d[_0x20a1('0x2b')]);_0x22627a[_0x20a1('0x2c')]=_[_0x20a1('0x2d')](_0x22627a['model'],_0x22627a[_0x20a1('0x2b')]);_0xe8e6d1['attributes']=_['intersection'](_0x22627a[_0x20a1('0x29')],qs[_0x20a1('0x2e')](_0x184a3d[_0x20a1('0x2b')][_0x20a1('0x2e')]));_0xe8e6d1['attributes']=_0xe8e6d1[_0x20a1('0x2f')][_0x20a1('0x30')]?_0xe8e6d1['attributes']:_0x22627a[_0x20a1('0x29')];if(!_0x184a3d[_0x20a1('0x2b')][_0x20a1('0x31')]('nolimit')){_0xe8e6d1['limit']=qs[_0x20a1('0x1c')](_0x184a3d[_0x20a1('0x2b')][_0x20a1('0x1c')]);_0xe8e6d1[_0x20a1('0x1b')]=qs[_0x20a1('0x1b')](_0x184a3d[_0x20a1('0x2b')][_0x20a1('0x1b')]);}_0xe8e6d1[_0x20a1('0x32')]=qs['sort'](_0x184a3d[_0x20a1('0x2b')][_0x20a1('0x33')]);_0xe8e6d1[_0x20a1('0x34')]=qs[_0x20a1('0x2c')](_[_0x20a1('0x35')](_0x184a3d['query'],_0x22627a[_0x20a1('0x2c')]),_0x2f6dd0);if(_0x184a3d['query'][_0x20a1('0x36')]){_0xe8e6d1[_0x20a1('0x34')]=_['merge'](_0xe8e6d1[_0x20a1('0x34')],{'$or':_['map'](_0x2f6dd0,function(_0x12a6ed){if(_0x12a6ed['type']!=='VIRTUAL'){var _0xe1b39b={};_0xe1b39b[_0x12a6ed[_0x20a1('0x23')]]={'$like':'%'+_0x184a3d[_0x20a1('0x2b')][_0x20a1('0x36')]+'%'};return _0xe1b39b;}})});}_0xe8e6d1=_['merge']({},_0xe8e6d1,_0x184a3d[_0x20a1('0x37')]);var _0x1d2aab={'where':_0xe8e6d1['where']};return db[_0x20a1('0x27')][_0x20a1('0x1a')](_0x1d2aab)[_0x20a1('0x38')](function(_0x2c2f12){_0x13d9ea[_0x20a1('0x1a')]=_0x2c2f12;if(_0x184a3d['query'][_0x20a1('0x39')]){_0xe8e6d1[_0x20a1('0x3a')]=[{'all':!![]}];}return db[_0x20a1('0x27')]['findAll'](_0xe8e6d1);})[_0x20a1('0x38')](function(_0x40b931){_0x13d9ea['rows']=_0x40b931;return _0x13d9ea;})[_0x20a1('0x38')](respondWithFilteredResult(_0x1cdc2c,_0xe8e6d1))['catch'](handleError(_0x1cdc2c,null));};exports['show']=function(_0x55133c,_0x4cc2d6){var _0x26c023={'raw':![],'where':{'id':_0x55133c['params']['id']}},_0x29968a={};_0x29968a['model']=_['keys'](db[_0x20a1('0x27')][_0x20a1('0x3b')]);_0x29968a[_0x20a1('0x2b')]=_['keys'](_0x55133c[_0x20a1('0x2b')]);_0x29968a[_0x20a1('0x2c')]=_[_0x20a1('0x2d')](_0x29968a[_0x20a1('0x29')],_0x29968a[_0x20a1('0x2b')]);_0x26c023['attributes']=_['intersection'](_0x29968a['model'],qs[_0x20a1('0x2e')](_0x55133c[_0x20a1('0x2b')]['fields']));_0x26c023[_0x20a1('0x2f')]=_0x26c023[_0x20a1('0x2f')][_0x20a1('0x30')]?_0x26c023['attributes']:_0x29968a[_0x20a1('0x29')];if(_0x55133c['query'][_0x20a1('0x39')]){_0x26c023[_0x20a1('0x3a')]=[{'all':!![]}];}_0x26c023=_['merge']({},_0x26c023,_0x55133c[_0x20a1('0x37')]);return db[_0x20a1('0x27')]['find'](_0x26c023)[_0x20a1('0x38')](handleEntityNotFound(_0x4cc2d6,null))[_0x20a1('0x38')](respondWithResult(_0x4cc2d6,null))['catch'](handleError(_0x4cc2d6,null));};exports[_0x20a1('0x3c')]=function(_0x85cbfd,_0xa74b57){return db['VoiceChanSpy'][_0x20a1('0x3c')](_0x85cbfd[_0x20a1('0x3d')],{})[_0x20a1('0x38')](function(_0x543408){var _0x1d605c=_0x85cbfd['user'][_0x20a1('0x3e')]({'plain':!![]});if(!_0x1d605c)throw new Error(_0x20a1('0x3f'));if(_0x1d605c[_0x20a1('0x40')]===_0x20a1('0x41')){var _0x19bb8d=_0x543408[_0x20a1('0x3e')]({'plain':!![]});var _0x3008ff='ChanSpies';return db[_0x20a1('0x42')][_0x20a1('0x43')]({'where':{'name':_0x3008ff,'userProfileId':_0x1d605c['userProfileId']},'raw':!![]})[_0x20a1('0x38')](function(_0x4abddc){if(_0x4abddc&&_0x4abddc[_0x20a1('0x44')]===0x0){return db[_0x20a1('0x45')]['create']({'name':_0x19bb8d[_0x20a1('0x23')],'resourceId':_0x19bb8d['id'],'type':_0x4abddc[_0x20a1('0x23')],'sectionId':_0x4abddc['id']},{})[_0x20a1('0x38')](function(){return _0x543408;});}else{return _0x543408;}})[_0x20a1('0x46')](function(_0x4003d5){logger[_0x20a1('0x21')](_0x20a1('0x47'),_0x4003d5);throw _0x4003d5;});}return _0x543408;})[_0x20a1('0x38')](respondWithResult(_0xa74b57,0xc9))[_0x20a1('0x46')](handleError(_0xa74b57,null));};exports['update']=function(_0xd4cd57,_0x24c197){if(_0xd4cd57[_0x20a1('0x3d')]['id']){delete _0xd4cd57[_0x20a1('0x3d')]['id'];}return db['VoiceChanSpy'][_0x20a1('0x43')]({'where':{'id':_0xd4cd57[_0x20a1('0x48')]['id']}})['then'](handleEntityNotFound(_0x24c197,null))[_0x20a1('0x38')](saveUpdates(_0xd4cd57['body'],null))[_0x20a1('0x38')](respondWithResult(_0x24c197,null))[_0x20a1('0x46')](handleError(_0x24c197,null));};exports[_0x20a1('0x20')]=function(_0x2cfd78,_0x12c17c){return db[_0x20a1('0x27')][_0x20a1('0x43')]({'where':{'id':_0x2cfd78[_0x20a1('0x48')]['id']}})[_0x20a1('0x38')](handleEntityNotFound(_0x12c17c,null))[_0x20a1('0x38')](removeEntity(_0x12c17c,null))[_0x20a1('0x46')](handleError(_0x12c17c,null));}; \ No newline at end of file +var _0xfecd=['include','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','get','ChanSpies','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VoiceChanSpy','includeAll'];(function(_0x585add,_0x6e1922){var _0x2f1d76=function(_0x262737){while(--_0x262737){_0x585add['push'](_0x585add['shift']());}};_0x2f1d76(++_0x6e1922);}(_0xfecd,0x107));var _0xdfec=function(_0x588c1c,_0x1f581f){_0x588c1c=_0x588c1c-0x0;var _0x476dd9=_0xfecd[_0x588c1c];return _0x476dd9;};'use strict';var emlformat=require(_0xdfec('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdfec('0x1'));var jsonpatch=require(_0xdfec('0x2'));var rp=require('request-promise');var moment=require(_0xdfec('0x3'));var BPromise=require(_0xdfec('0x4'));var Mustache=require('mustache');var util=require(_0xdfec('0x5'));var path=require('path');var sox=require(_0xdfec('0x6'));var csv=require(_0xdfec('0x7'));var ejs=require(_0xdfec('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdfec('0x9'));var squel=require(_0xdfec('0xa'));var crypto=require(_0xdfec('0xb'));var jsforce=require(_0xdfec('0xc'));var deskjs=require(_0xdfec('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdfec('0xe'));var Papa=require(_0xdfec('0xf'));var Redis=require(_0xdfec('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdfec('0x11'));var hardwareService=require(_0xdfec('0x12'));var logger=require('../../config/logger')(_0xdfec('0x13'));var utils=require(_0xdfec('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xdfec('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21371b,_0x367a3c){_0x367a3c=_0x367a3c||0xcc;return function(_0x2384f5){if(_0x2384f5){return _0x21371b[_0xdfec('0x16')](_0x367a3c);}return _0x21371b[_0xdfec('0x17')](_0x367a3c)[_0xdfec('0x18')]();};}function respondWithResult(_0x28ef24,_0x2ccc89){_0x2ccc89=_0x2ccc89||0xc8;return function(_0x4d7c6e){if(_0x4d7c6e){return _0x28ef24[_0xdfec('0x17')](_0x2ccc89)[_0xdfec('0x19')](_0x4d7c6e);}};}function respondWithFilteredResult(_0x493d12,_0x420e3b){return function(_0x53ef23){if(_0x53ef23){var _0x2fbbbb=typeof _0x420e3b[_0xdfec('0x1a')]===_0xdfec('0x1b')&&typeof _0x420e3b[_0xdfec('0x1c')]==='undefined';var _0x443d2f=_0x53ef23[_0xdfec('0x1d')];var _0x336abf=_0x2fbbbb?0x0:_0x420e3b[_0xdfec('0x1a')];var _0x10c44c=_0x2fbbbb?_0x53ef23['count']:_0x420e3b['offset']+_0x420e3b[_0xdfec('0x1c')];var _0x171377;if(_0x10c44c>=_0x443d2f){_0x10c44c=_0x443d2f;_0x171377=0xc8;}else{_0x171377=0xce;}_0x493d12[_0xdfec('0x17')](_0x171377);return _0x493d12['set']('Content-Range',_0x336abf+'-'+_0x10c44c+'/'+_0x443d2f)['json'](_0x53ef23);}return null;};}function patchUpdates(_0x4b9614){return function(_0xce9faf){try{jsonpatch[_0xdfec('0x1e')](_0xce9faf,_0x4b9614,!![]);}catch(_0x577a69){return BPromise[_0xdfec('0x1f')](_0x577a69);}return _0xce9faf[_0xdfec('0x20')]();};}function saveUpdates(_0x58f088,_0x23c8fd){return function(_0x4fb633){if(_0x4fb633){return _0x4fb633[_0xdfec('0x21')](_0x58f088)[_0xdfec('0x22')](function(_0x43d004){return _0x43d004;});}return null;};}function removeEntity(_0x1e1c81,_0x405aae){return function(_0x3e29aa){if(_0x3e29aa){return _0x3e29aa[_0xdfec('0x23')]()[_0xdfec('0x22')](function(){var _0xbeb814=_0x3e29aa[_0xdfec('0x24')]({'plain':!![]});var _0x488212=_0xdfec('0x25');return db['UserProfileResource'][_0xdfec('0x23')]({'where':{'type':_0x488212,'resourceId':_0xbeb814['id']}})[_0xdfec('0x22')](function(){return _0x3e29aa;});})[_0xdfec('0x22')](function(){_0x1e1c81[_0xdfec('0x17')](0xcc)[_0xdfec('0x18')]();});}};}function handleEntityNotFound(_0x13a2ad,_0x4031ca){return function(_0x4cb67f){if(!_0x4cb67f){_0x13a2ad[_0xdfec('0x16')](0x194);}return _0x4cb67f;};}function handleError(_0x2e461a,_0x51c35c){_0x51c35c=_0x51c35c||0x1f4;return function(_0x19a66a){logger['error'](_0x19a66a['stack']);if(_0x19a66a[_0xdfec('0x26')]){delete _0x19a66a[_0xdfec('0x26')];}_0x2e461a[_0xdfec('0x17')](_0x51c35c)[_0xdfec('0x27')](_0x19a66a);};}exports[_0xdfec('0x28')]=function(_0x2839ca,_0x10c31d){var _0x140bb7={},_0x1086bb={},_0x14e76f={'count':0x0,'rows':[]};var _0x317439=_[_0xdfec('0x29')](db['VoiceChanSpy'][_0xdfec('0x2a')],function(_0x29cb9a){return{'name':_0x29cb9a[_0xdfec('0x2b')],'type':_0x29cb9a[_0xdfec('0x2c')][_0xdfec('0x2d')]};});_0x1086bb[_0xdfec('0x2e')]=_[_0xdfec('0x29')](_0x317439,_0xdfec('0x26'));_0x1086bb[_0xdfec('0x2f')]=_['keys'](_0x2839ca['query']);_0x1086bb[_0xdfec('0x30')]=_[_0xdfec('0x31')](_0x1086bb[_0xdfec('0x2e')],_0x1086bb[_0xdfec('0x2f')]);_0x140bb7[_0xdfec('0x32')]=_[_0xdfec('0x31')](_0x1086bb['model'],qs['fields'](_0x2839ca[_0xdfec('0x2f')][_0xdfec('0x33')]));_0x140bb7[_0xdfec('0x32')]=_0x140bb7[_0xdfec('0x32')][_0xdfec('0x34')]?_0x140bb7[_0xdfec('0x32')]:_0x1086bb[_0xdfec('0x2e')];if(!_0x2839ca[_0xdfec('0x2f')][_0xdfec('0x35')](_0xdfec('0x36'))){_0x140bb7[_0xdfec('0x1c')]=qs['limit'](_0x2839ca[_0xdfec('0x2f')][_0xdfec('0x1c')]);_0x140bb7[_0xdfec('0x1a')]=qs['offset'](_0x2839ca[_0xdfec('0x2f')]['offset']);}_0x140bb7[_0xdfec('0x37')]=qs[_0xdfec('0x38')](_0x2839ca['query'][_0xdfec('0x38')]);_0x140bb7[_0xdfec('0x39')]=qs[_0xdfec('0x30')](_[_0xdfec('0x3a')](_0x2839ca[_0xdfec('0x2f')],_0x1086bb[_0xdfec('0x30')]),_0x317439);if(_0x2839ca[_0xdfec('0x2f')][_0xdfec('0x3b')]){_0x140bb7[_0xdfec('0x39')]=_[_0xdfec('0x3c')](_0x140bb7[_0xdfec('0x39')],{'$or':_[_0xdfec('0x29')](_0x317439,function(_0x1301a3){if(_0x1301a3['type']!==_0xdfec('0x3d')){var _0x35dc3d={};_0x35dc3d[_0x1301a3[_0xdfec('0x26')]]={'$like':'%'+_0x2839ca['query'][_0xdfec('0x3b')]+'%'};return _0x35dc3d;}})});}_0x140bb7=_[_0xdfec('0x3c')]({},_0x140bb7,_0x2839ca[_0xdfec('0x3e')]);var _0x497464={'where':_0x140bb7['where']};return db[_0xdfec('0x3f')][_0xdfec('0x1d')](_0x497464)[_0xdfec('0x22')](function(_0x50a096){_0x14e76f[_0xdfec('0x1d')]=_0x50a096;if(_0x2839ca['query'][_0xdfec('0x40')]){_0x140bb7[_0xdfec('0x41')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0xdfec('0x42')](_0x140bb7);})[_0xdfec('0x22')](function(_0x4bf045){_0x14e76f[_0xdfec('0x43')]=_0x4bf045;return _0x14e76f;})[_0xdfec('0x22')](respondWithFilteredResult(_0x10c31d,_0x140bb7))[_0xdfec('0x44')](handleError(_0x10c31d,null));};exports[_0xdfec('0x45')]=function(_0x5f952c,_0x447cc){var _0x528860={'raw':![],'where':{'id':_0x5f952c[_0xdfec('0x46')]['id']}},_0x876a5a={};_0x876a5a[_0xdfec('0x2e')]=_[_0xdfec('0x47')](db[_0xdfec('0x3f')][_0xdfec('0x2a')]);_0x876a5a[_0xdfec('0x2f')]=_[_0xdfec('0x47')](_0x5f952c[_0xdfec('0x2f')]);_0x876a5a[_0xdfec('0x30')]=_[_0xdfec('0x31')](_0x876a5a[_0xdfec('0x2e')],_0x876a5a[_0xdfec('0x2f')]);_0x528860[_0xdfec('0x32')]=_['intersection'](_0x876a5a[_0xdfec('0x2e')],qs[_0xdfec('0x33')](_0x5f952c['query'][_0xdfec('0x33')]));_0x528860[_0xdfec('0x32')]=_0x528860[_0xdfec('0x32')][_0xdfec('0x34')]?_0x528860[_0xdfec('0x32')]:_0x876a5a['model'];if(_0x5f952c[_0xdfec('0x2f')]['includeAll']){_0x528860[_0xdfec('0x41')]=[{'all':!![]}];}_0x528860=_['merge']({},_0x528860,_0x5f952c[_0xdfec('0x3e')]);return db[_0xdfec('0x3f')][_0xdfec('0x48')](_0x528860)[_0xdfec('0x22')](handleEntityNotFound(_0x447cc,null))['then'](respondWithResult(_0x447cc,null))[_0xdfec('0x44')](handleError(_0x447cc,null));};exports[_0xdfec('0x49')]=function(_0x462e61,_0x3eed23){return db[_0xdfec('0x3f')][_0xdfec('0x49')](_0x462e61[_0xdfec('0x4a')],{})[_0xdfec('0x22')](function(_0x2d41ec){var _0x394b43=_0x462e61[_0xdfec('0x4b')][_0xdfec('0x24')]({'plain':!![]});if(!_0x394b43)throw new Error(_0xdfec('0x4c'));if(_0x394b43[_0xdfec('0x4d')]===_0xdfec('0x4b')){var _0x5938fd=_0x2d41ec[_0xdfec('0x24')]({'plain':!![]});var _0x1988d3=_0xdfec('0x25');return db[_0xdfec('0x4e')]['find']({'where':{'name':_0x1988d3,'userProfileId':_0x394b43[_0xdfec('0x4f')]},'raw':!![]})[_0xdfec('0x22')](function(_0x3266b9){if(_0x3266b9&&_0x3266b9['autoAssociation']===0x0){return db[_0xdfec('0x50')][_0xdfec('0x49')]({'name':_0x5938fd[_0xdfec('0x26')],'resourceId':_0x5938fd['id'],'type':_0x3266b9[_0xdfec('0x26')],'sectionId':_0x3266b9['id']},{})[_0xdfec('0x22')](function(){return _0x2d41ec;});}else{return _0x2d41ec;}})[_0xdfec('0x44')](function(_0x4ff22e){logger['error'](_0xdfec('0x51'),_0x4ff22e);throw _0x4ff22e;});}return _0x2d41ec;})[_0xdfec('0x22')](respondWithResult(_0x3eed23,0xc9))[_0xdfec('0x44')](handleError(_0x3eed23,null));};exports['update']=function(_0x1e815e,_0x2b15e6){if(_0x1e815e[_0xdfec('0x4a')]['id']){delete _0x1e815e[_0xdfec('0x4a')]['id'];}return db[_0xdfec('0x3f')][_0xdfec('0x48')]({'where':{'id':_0x1e815e['params']['id']}})['then'](handleEntityNotFound(_0x2b15e6,null))[_0xdfec('0x22')](saveUpdates(_0x1e815e[_0xdfec('0x4a')],null))['then'](respondWithResult(_0x2b15e6,null))[_0xdfec('0x44')](handleError(_0x2b15e6,null));};exports[_0xdfec('0x23')]=function(_0x17469e,_0x3c2c8a){return db[_0xdfec('0x3f')][_0xdfec('0x48')]({'where':{'id':_0x17469e[_0xdfec('0x46')]['id']}})['then'](handleEntityNotFound(_0x3c2c8a,null))[_0xdfec('0x22')](removeEntity(_0x3c2c8a,null))[_0xdfec('0x44')](handleError(_0x3c2c8a,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 1731375..a58bf2c 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 _0x5fbf=['lodash','util','bluebird','./voiceChanSpy.attributes','format','%s%s','push','Set','CDR(type)=%s','chanspy','record','MixMonitor','recordingFormat','auth','merge','ChanSpy','SIP/%s,%s','name','options','StopMixMonitor','length','concat','User','findAll','internal','then','exports','models','VoiceChanSpy','voice_chanspy','VoiceExtension','catch','destroy','bulkCreate'];(function(_0x52b5d9,_0x3ee307){var _0x58f314=function(_0x3b3299){while(--_0x3b3299){_0x52b5d9['push'](_0x52b5d9['shift']());}};_0x58f314(++_0x3ee307);}(_0x5fbf,0x1ba));var _0xf5fb=function(_0x593258,_0x1ee048){_0x593258=_0x593258-0x0;var _0x177b3d=_0x5fbf[_0x593258];return _0x177b3d;};'use strict';var _=require(_0xf5fb('0x0'));var util=require(_0xf5fb('0x1'));var BPromise=require(_0xf5fb('0x2'));var attributes=require(_0xf5fb('0x3'));var getUserApplications=function(_0x2f2e86,_0x3fee36,_0x780384){var _0x590f48=0x1;var _0xa00910=[];var _0xc563ef={'context':_0x3fee36['context']||'from-sip','exten':util[_0xf5fb('0x4')](_0xf5fb('0x5'),_0x2f2e86['prefix'],_0x780384),'type':'system','isApp':![],'ChanSpyId':_0x2f2e86['id'],'UserId':_0x3fee36['id']};_0xa00910[_0xf5fb('0x6')](_['merge']({'app':_0xf5fb('0x7'),'appdata':util[_0xf5fb('0x4')](_0xf5fb('0x8'),_0xf5fb('0x9')),'priority':_0x590f48++},_0xc563ef));if(_0x2f2e86[_0xf5fb('0xa')]){_0xa00910['push'](_['merge']({'app':_0xf5fb('0xb'),'appdata':util[_0xf5fb('0x4')]('${UNIQUEID}.%s,a',_0x2f2e86[_0xf5fb('0xc')]),'priority':_0x590f48++},_0xc563ef));}if(_0x2f2e86[_0xf5fb('0xd')]){_0xa00910[_0xf5fb('0x6')](_[_0xf5fb('0xe')]({'app':'Authenticate','appdata':_0x2f2e86['password'],'priority':_0x590f48++},_0xc563ef));}_0xa00910[_0xf5fb('0x6')](_[_0xf5fb('0xe')]({'app':_0xf5fb('0xf'),'appdata':util[_0xf5fb('0x4')](_0xf5fb('0x10'),_0x3fee36[_0xf5fb('0x11')],_0x2f2e86[_0xf5fb('0x12')]?_0x2f2e86[_0xf5fb('0x12')]['join'](''):''),'priority':_0x590f48++},_0xc563ef));if(_0x2f2e86[_0xf5fb('0xa')]){_0xa00910[_0xf5fb('0x6')](_['merge']({'app':_0xf5fb('0x13'),'priority':_0x590f48++},_0xc563ef));}return _0xa00910;};var getChanSpyApplications=function(_0x4b5214,_0x29affb){var _0x6102e3=[];for(var _0x55490e=0x0,_0x120a41=0x1;_0x55490e<_0x29affb[_0xf5fb('0x14')];_0x55490e++,_0x120a41=0x1){_0x6102e3=_0x6102e3[_0xf5fb('0x15')](getUserApplications(_0x4b5214,_0x29affb[_0x55490e],_0x29affb[_0x55490e]['internal']));if(_0x29affb[_0x55490e]['internal']!=_0x29affb[_0x55490e][_0xf5fb('0x11')]){_0x6102e3=_0x6102e3[_0xf5fb('0x15')](getUserApplications(_0x4b5214,_0x29affb[_0x55490e],_0x29affb[_0x55490e][_0xf5fb('0x11')]));}}return _0x6102e3;};var getChanSpyPromise=function(_0x17b3b0,_0x29419b){return new BPromise(function(_0x31d062,_0x152a37){return _0x17b3b0[_0xf5fb('0x16')][_0xf5fb('0x17')]({'attributes':['id',_0xf5fb('0x11'),_0xf5fb('0x18')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0xf5fb('0x19')](function(_0x242066){if(_0x242066){return _0x31d062(getChanSpyApplications(_0x29419b,_0x242066));}return _0x31d062([]);})['catch'](function(_0x29127b){_0x152a37(_0x29127b);});});};module[_0xf5fb('0x1a')]=function(_0x1bb179,_0x1fbe32){var _0x13dbb5=_0x1bb179[_0xf5fb('0x1b')];return _0x1bb179['define'](_0xf5fb('0x1c'),attributes,{'tableName':_0xf5fb('0x1d'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1855a5,_0x59e741,_0x52f0ec){return getChanSpyPromise(_0x13dbb5,_0x1855a5)['then'](function(_0x13a03a){if(_0x13a03a&&_0x13a03a['length']){return _0x13dbb5[_0xf5fb('0x1e')]['bulkCreate'](_0x13a03a);}})[_0xf5fb('0x19')](function(){_0x52f0ec();})[_0xf5fb('0x1f')](function(_0x566980){_0x52f0ec(_0x566980);});},'afterUpdate':function(_0x274304,_0x58f3bd,_0x1fcc3d){return _0x13dbb5[_0xf5fb('0x1e')][_0xf5fb('0x20')]({'where':{'ChanSpyId':_0x274304['id']}})[_0xf5fb('0x19')](function(){return getChanSpyPromise(_0x13dbb5,_0x274304);})[_0xf5fb('0x19')](function(_0x352293){if(_0x352293&&_0x352293[_0xf5fb('0x14')]){return _0x13dbb5[_0xf5fb('0x1e')][_0xf5fb('0x21')](_0x352293);}})[_0xf5fb('0x19')](function(){_0x1fcc3d();})[_0xf5fb('0x1f')](function(_0x1026d1){_0x1fcc3d(_0x1026d1);});},'afterDestroy':function(_0x56158b,_0x402cc3,_0x4b5ced){return _0x13dbb5[_0xf5fb('0x1e')][_0xf5fb('0x20')]({'where':{'ChanSpyId':_0x56158b['id']}})[_0xf5fb('0x19')](function(){_0x4b5ced();})[_0xf5fb('0x1f')](function(_0x57aead){_0x4b5ced(_0x57aead);});}}});}; \ No newline at end of file +var _0x17f3=['Authenticate','password','ChanSpy','SIP/%s,%s','options','StopMixMonitor','internal','name','User','findAll','agent','then','models','define','VoiceChanSpy','voice_chanspy','length','VoiceExtension','bulkCreate','catch','destroy','lodash','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','merge','Set','record','${UNIQUEID}.%s,a','recordingFormat','auth'];(function(_0x582fdc,_0x39e268){var _0x299419=function(_0x104363){while(--_0x104363){_0x582fdc['push'](_0x582fdc['shift']());}};_0x299419(++_0x39e268);}(_0x17f3,0x187));var _0x317f=function(_0x1bdc43,_0x2228cf){_0x1bdc43=_0x1bdc43-0x0;var _0x10f59a=_0x17f3[_0x1bdc43];return _0x10f59a;};'use strict';var _=require(_0x317f('0x0'));var util=require('util');var BPromise=require(_0x317f('0x1'));var attributes=require(_0x317f('0x2'));var getUserApplications=function(_0x574941,_0x201979,_0x32738f){var _0x4df0db=0x1;var _0x49e4e4=[];var _0x513723={'context':_0x201979[_0x317f('0x3')]||_0x317f('0x4'),'exten':util[_0x317f('0x5')](_0x317f('0x6'),_0x574941[_0x317f('0x7')],_0x32738f),'type':_0x317f('0x8'),'isApp':![],'ChanSpyId':_0x574941['id'],'UserId':_0x201979['id']};_0x49e4e4[_0x317f('0x9')](_[_0x317f('0xa')]({'app':_0x317f('0xb'),'appdata':util[_0x317f('0x5')]('CDR(type)=%s','chanspy'),'priority':_0x4df0db++},_0x513723));if(_0x574941[_0x317f('0xc')]){_0x49e4e4[_0x317f('0x9')](_[_0x317f('0xa')]({'app':'MixMonitor','appdata':util[_0x317f('0x5')](_0x317f('0xd'),_0x574941[_0x317f('0xe')]),'priority':_0x4df0db++},_0x513723));}if(_0x574941[_0x317f('0xf')]){_0x49e4e4[_0x317f('0x9')](_[_0x317f('0xa')]({'app':_0x317f('0x10'),'appdata':_0x574941[_0x317f('0x11')],'priority':_0x4df0db++},_0x513723));}_0x49e4e4[_0x317f('0x9')](_[_0x317f('0xa')]({'app':_0x317f('0x12'),'appdata':util[_0x317f('0x5')](_0x317f('0x13'),_0x201979['name'],_0x574941[_0x317f('0x14')]?_0x574941[_0x317f('0x14')]['join'](''):''),'priority':_0x4df0db++},_0x513723));if(_0x574941[_0x317f('0xc')]){_0x49e4e4['push'](_[_0x317f('0xa')]({'app':_0x317f('0x15'),'priority':_0x4df0db++},_0x513723));}return _0x49e4e4;};var getChanSpyApplications=function(_0x60ee3c,_0x1f4b7f){var _0x11cb53=[];for(var _0xe13e07=0x0,_0x58a53d=0x1;_0xe13e07<_0x1f4b7f['length'];_0xe13e07++,_0x58a53d=0x1){_0x11cb53=_0x11cb53['concat'](getUserApplications(_0x60ee3c,_0x1f4b7f[_0xe13e07],_0x1f4b7f[_0xe13e07][_0x317f('0x16')]));if(_0x1f4b7f[_0xe13e07][_0x317f('0x16')]!=_0x1f4b7f[_0xe13e07][_0x317f('0x17')]){_0x11cb53=_0x11cb53['concat'](getUserApplications(_0x60ee3c,_0x1f4b7f[_0xe13e07],_0x1f4b7f[_0xe13e07][_0x317f('0x17')]));}}return _0x11cb53;};var getChanSpyPromise=function(_0x124931,_0x2205fe){return new BPromise(function(_0x2c160d,_0x13ecaa){return _0x124931[_0x317f('0x18')][_0x317f('0x19')]({'attributes':['id',_0x317f('0x17'),_0x317f('0x16')],'where':{'role':_0x317f('0x1a'),'chanspy':!![]},'raw':!![]})[_0x317f('0x1b')](function(_0x25920f){if(_0x25920f){return _0x2c160d(getChanSpyApplications(_0x2205fe,_0x25920f));}return _0x2c160d([]);})['catch'](function(_0x441334){_0x13ecaa(_0x441334);});});};module['exports']=function(_0x5251c2,_0x32f533){var _0x6600ba=_0x5251c2[_0x317f('0x1c')];return _0x5251c2[_0x317f('0x1d')](_0x317f('0x1e'),attributes,{'tableName':_0x317f('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x301626,_0x409e19,_0x41a912){return getChanSpyPromise(_0x6600ba,_0x301626)['then'](function(_0x260164){if(_0x260164&&_0x260164[_0x317f('0x20')]){return _0x6600ba[_0x317f('0x21')][_0x317f('0x22')](_0x260164);}})['then'](function(){_0x41a912();})['catch'](function(_0x396e47){_0x41a912(_0x396e47);});},'afterUpdate':function(_0x36e062,_0x3ce76b,_0x36c050){return _0x6600ba[_0x317f('0x21')]['destroy']({'where':{'ChanSpyId':_0x36e062['id']}})[_0x317f('0x1b')](function(){return getChanSpyPromise(_0x6600ba,_0x36e062);})[_0x317f('0x1b')](function(_0x2797c7){if(_0x2797c7&&_0x2797c7[_0x317f('0x20')]){return _0x6600ba[_0x317f('0x21')][_0x317f('0x22')](_0x2797c7);}})[_0x317f('0x1b')](function(){_0x36c050();})[_0x317f('0x23')](function(_0x3d0b31){_0x36c050(_0x3d0b31);});},'afterDestroy':function(_0x1b2be4,_0xebdfb8,_0x3e3e88){return _0x6600ba[_0x317f('0x21')][_0x317f('0x24')]({'where':{'ChanSpyId':_0x1b2be4['id']}})[_0x317f('0x1b')](function(){_0x3e3e88();})[_0x317f('0x23')](function(_0x1a4adb){_0x3e3e88(_0x1a4adb);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 4b491c3..fa77224 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 _0xcecc=['info','VoiceChanSpy,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xcecc,0x186));var _0xccec=function(_0x10a0fd,_0x303e5f){_0x10a0fd=_0x10a0fd-0x0;var _0x4192b5=_0xcecc[_0x10a0fd];return _0x4192b5;};'use strict';var _=require(_0xccec('0x0'));var util=require('util');var moment=require(_0xccec('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xccec('0x2'));var db=require(_0xccec('0x3'))['db'];var utils=require(_0xccec('0x4'));var logger=require(_0xccec('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xccec('0x6'));var client=jayson['client'][_0xccec('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x44ed01,_0x2a66e5,_0x5788aa){return new BPromise(function(_0x372ea6,_0x3d7b1a){return client['request'](_0x44ed01,_0x5788aa)[_0xccec('0x8')](function(_0xbbf504){logger[_0xccec('0x9')](_0xccec('0xa'),_0x2a66e5,'request\x20sent');logger[_0xccec('0xb')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x2a66e5,_0xccec('0xc'),JSON[_0xccec('0xd')](_0xbbf504));if(_0xbbf504['error']){if(_0xbbf504[_0xccec('0xe')][_0xccec('0xf')]===0x1f4){logger[_0xccec('0xe')]('VoiceChanSpy,\x20%s,\x20%s',_0x2a66e5,_0xbbf504[_0xccec('0xe')][_0xccec('0x10')]);return _0x3d7b1a(_0xbbf504[_0xccec('0xe')][_0xccec('0x10')]);}logger[_0xccec('0xe')]('VoiceChanSpy,\x20%s,\x20%s',_0x2a66e5,_0xbbf504[_0xccec('0xe')]['message']);return _0x372ea6(_0xbbf504['error']['message']);}else{logger[_0xccec('0x9')](_0xccec('0xa'),_0x2a66e5,_0xccec('0xc'));_0x372ea6(_0xbbf504[_0xccec('0x11')][_0xccec('0x10')]);}})[_0xccec('0x12')](function(_0x7abe38){logger[_0xccec('0xe')](_0xccec('0xa'),_0x2a66e5,_0x7abe38);_0x3d7b1a(_0x7abe38);});});} \ No newline at end of file +var _0x0713=['VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x23e640,_0x2bc1db){var _0x48316d=function(_0x1ab030){while(--_0x1ab030){_0x23e640['push'](_0x23e640['shift']());}};_0x48316d(++_0x2bc1db);}(_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')]('VoiceChanSpy,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('VoiceChanSpy,\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')]('VoiceChanSpy,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index b09eecd..f329563 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 _0xc418=['show','post','create','put','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','/:id'];(function(_0x126a93,_0x3571e3){var _0x161120=function(_0x445d05){while(--_0x445d05){_0x126a93['push'](_0x126a93['shift']());}};_0x161120(++_0x3571e3);}(_0xc418,0x95));var _0x8c41=function(_0x2e7f25,_0x5c0712){_0x2e7f25=_0x2e7f25-0x0;var _0x26a932=_0xc418[_0x2e7f25];return _0x26a932;};'use strict';var multer=require(_0x8c41('0x0'));var util=require(_0x8c41('0x1'));var path=require(_0x8c41('0x2'));var timeout=require(_0x8c41('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8c41('0x4'));var auth=require(_0x8c41('0x5'));var interaction=require(_0x8c41('0x6'));var config=require(_0x8c41('0x7'));var controller=require(_0x8c41('0x8'));router[_0x8c41('0x9')]('/',auth[_0x8c41('0xa')](),controller[_0x8c41('0xb')]);router[_0x8c41('0x9')](_0x8c41('0xc'),auth[_0x8c41('0xa')](),controller[_0x8c41('0xd')]);router[_0x8c41('0xe')]('/',auth[_0x8c41('0xa')](),controller[_0x8c41('0xf')]);router[_0x8c41('0x10')](_0x8c41('0xc'),auth[_0x8c41('0xa')](),controller['update']);router['delete'](_0x8c41('0xc'),auth[_0x8c41('0xa')](),controller['destroy']);module[_0x8c41('0x11')]=router; \ No newline at end of file +var _0x3897=['exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','index','/:id','isAuthenticated','show','put','update','delete','destroy'];(function(_0x43135a,_0x4dbd53){var _0x1aae91=function(_0x2cbbd6){while(--_0x2cbbd6){_0x43135a['push'](_0x43135a['shift']());}};_0x1aae91(++_0x4dbd53);}(_0x3897,0x1c3));var _0x7389=function(_0x411e71,_0xf9652){_0x411e71=_0x411e71-0x0;var _0x226ae3=_0x3897[_0x411e71];return _0x226ae3;};'use strict';var multer=require(_0x7389('0x0'));var util=require(_0x7389('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7389('0x2'));var router=express[_0x7389('0x3')]();var fs_extra=require(_0x7389('0x4'));var auth=require(_0x7389('0x5'));var interaction=require(_0x7389('0x6'));var config=require(_0x7389('0x7'));var controller=require(_0x7389('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x7389('0x9')]);router['get'](_0x7389('0xa'),auth[_0x7389('0xb')](),controller[_0x7389('0xc')]);router['post']('/',auth[_0x7389('0xb')](),controller['create']);router[_0x7389('0xd')](_0x7389('0xa'),auth[_0x7389('0xb')](),controller[_0x7389('0xe')]);router[_0x7389('0xf')](_0x7389('0xa'),auth[_0x7389('0xb')](),controller[_0x7389('0x10')]);module[_0x7389('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 8396260..1eb03bd 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 _0xf505=['sequelize','exports','STRING','BOOLEAN'];(function(_0x424501,_0x42096d){var _0xb719af=function(_0x37adcf){while(--_0x37adcf){_0x424501['push'](_0x424501['shift']());}};_0xb719af(++_0x42096d);}(_0xf505,0x84));var _0x5f50=function(_0x157d23,_0x4027b9){_0x157d23=_0x157d23-0x0;var _0x5b93cc=_0xf505[_0x157d23];return _0x5b93cc;};'use strict';var Sequelize=require(_0x5f50('0x0'));module[_0x5f50('0x1')]={'name':{'type':Sequelize[_0x5f50('0x2')],'unique':'name'},'description':{'type':Sequelize[_0x5f50('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x5f50('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa79b=['sequelize','STRING','name'];(function(_0x3a04ab,_0x31b9fd){var _0x4bff6d=function(_0x125f7e){while(--_0x125f7e){_0x3a04ab['push'](_0x3a04ab['shift']());}};_0x4bff6d(++_0x31b9fd);}(_0xa79b,0x105));var _0xba79=function(_0x4c3550,_0x401419){_0x4c3550=_0x4c3550-0x0;var _0x2a0390=_0xa79b[_0x4c3550];return _0x2a0390;};'use strict';var Sequelize=require(_0xba79('0x0'));module['exports']={'name':{'type':Sequelize[_0xba79('0x1')],'unique':_0xba79('0x2')},'description':{'type':Sequelize[_0xba79('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'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 eb7170d..cd43147 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 _0xa41d=['set','Content-Range','reject','update','destroy','get','Contexts','UserProfileResource','name','index','VoiceContext','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','params','includeAll','find','create','body','join','server/files/templates/context.ejs','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','utf8','render','root','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','jayson/promise','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','end','json','offset','undefined','count','limit','status'];(function(_0x301f35,_0xac7115){var _0x4bc6aa=function(_0x4a72cb){while(--_0x4a72cb){_0x301f35['push'](_0x301f35['shift']());}};_0x4bc6aa(++_0xac7115);}(_0xa41d,0xf5));var _0xda41=function(_0x254330,_0x1d6d4a){_0x254330=_0x254330-0x0;var _0x489771=_0xa41d[_0x254330];return _0x489771;};'use strict';var emlformat=require(_0xda41('0x0'));var rimraf=require(_0xda41('0x1'));var zipdir=require(_0xda41('0x2'));var jsonpatch=require(_0xda41('0x3'));var rp=require(_0xda41('0x4'));var moment=require(_0xda41('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xda41('0x6'));var util=require(_0xda41('0x7'));var path=require(_0xda41('0x8'));var sox=require(_0xda41('0x9'));var csv=require(_0xda41('0xa'));var ejs=require(_0xda41('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xda41('0xc'));var squel=require('squel');var crypto=require(_0xda41('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xda41('0xe'));var toCsv=require(_0xda41('0xa'));var querystring=require(_0xda41('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xda41('0x10'));var qs=require(_0xda41('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xda41('0x12'));var logger=require(_0xda41('0x13'))(_0xda41('0x14'));var utils=require(_0xda41('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0xda41('0x16'));var client=jayson['client'][_0xda41('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x2a0613,_0x58714d,_0x3db8f1,_0x45cc2f){return new BPromise(function(_0x5c8f86,_0x3765f3){var _0x443158=_0x45cc2f||client;return _0x443158[_0xda41('0x18')](_0x2a0613,_0x3db8f1)[_0xda41('0x19')](function(_0x3ae55c){logger[_0xda41('0x1a')](_0xda41('0x1b'),_0x58714d,_0xda41('0x1c'));logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0x58714d,_0xda41('0x1c'),JSON[_0xda41('0x1d')](_0x3ae55c));if(_0x3ae55c[_0xda41('0x1e')]){if(_0x3ae55c[_0xda41('0x1e')][_0xda41('0x1f')]===0x1f4){logger[_0xda41('0x1e')](_0xda41('0x1b'),_0x58714d,_0x3ae55c[_0xda41('0x1e')][_0xda41('0x20')]);return _0x3765f3(_0x3ae55c[_0xda41('0x1e')][_0xda41('0x20')]);}logger[_0xda41('0x1e')](_0xda41('0x1b'),_0x58714d,_0x3ae55c[_0xda41('0x1e')][_0xda41('0x20')]);return _0x5c8f86(_0x3ae55c[_0xda41('0x1e')][_0xda41('0x20')]);}else{logger['info'](_0xda41('0x1b'),_0x58714d,_0xda41('0x1c'));_0x5c8f86(_0x3ae55c[_0xda41('0x21')]['message']);}})[_0xda41('0x22')](function(_0x37e81e){logger[_0xda41('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x58714d,_0x37e81e);_0x3765f3(_0x37e81e);});});}function respondWithStatusCode(_0x3fe185,_0xdd40f0){_0xdd40f0=_0xdd40f0||0xcc;return function(_0x214d1f){if(_0x214d1f){return _0x3fe185[_0xda41('0x23')](_0xdd40f0);}return _0x3fe185['status'](_0xdd40f0)[_0xda41('0x24')]();};}function respondWithResult(_0x4ed087,_0x58cb10){_0x58cb10=_0x58cb10||0xc8;return function(_0x2ff438){if(_0x2ff438){return _0x4ed087['status'](_0x58cb10)[_0xda41('0x25')](_0x2ff438);}};}function respondWithFilteredResult(_0x20ca4a,_0x2455e1){return function(_0x24c4ea){if(_0x24c4ea){var _0x5d2a30=typeof _0x2455e1[_0xda41('0x26')]===_0xda41('0x27')&&typeof _0x2455e1['limit']==='undefined';var _0x56442c=_0x24c4ea[_0xda41('0x28')];var _0x2d85f9=_0x5d2a30?0x0:_0x2455e1[_0xda41('0x26')];var _0x529e8a=_0x5d2a30?_0x24c4ea[_0xda41('0x28')]:_0x2455e1[_0xda41('0x26')]+_0x2455e1[_0xda41('0x29')];var _0xa9202c;if(_0x529e8a>=_0x56442c){_0x529e8a=_0x56442c;_0xa9202c=0xc8;}else{_0xa9202c=0xce;}_0x20ca4a[_0xda41('0x2a')](_0xa9202c);return _0x20ca4a[_0xda41('0x2b')](_0xda41('0x2c'),_0x2d85f9+'-'+_0x529e8a+'/'+_0x56442c)[_0xda41('0x25')](_0x24c4ea);}return null;};}function patchUpdates(_0x521872){return function(_0x34429c){try{jsonpatch['apply'](_0x34429c,_0x521872,!![]);}catch(_0x38f751){return BPromise[_0xda41('0x2d')](_0x38f751);}return _0x34429c['save']();};}function saveUpdates(_0x166e4e,_0x5dfe3d){return function(_0x2b6ae2){if(_0x2b6ae2){return _0x2b6ae2[_0xda41('0x2e')](_0x166e4e)[_0xda41('0x19')](function(_0x12b549){return _0x12b549;});}return null;};}function removeEntity(_0xa96d75,_0x38d4b9){return function(_0x49a94d){if(_0x49a94d){return _0x49a94d[_0xda41('0x2f')]()[_0xda41('0x19')](function(){var _0x282f93=_0x49a94d[_0xda41('0x30')]({'plain':!![]});var _0x4cac4f=_0xda41('0x31');return db[_0xda41('0x32')][_0xda41('0x2f')]({'where':{'type':_0x4cac4f,'resourceId':_0x282f93['id']}})[_0xda41('0x19')](function(){return _0x49a94d;});})[_0xda41('0x19')](function(){_0xa96d75[_0xda41('0x2a')](0xcc)[_0xda41('0x24')]();});}};}function handleEntityNotFound(_0x15c3c9,_0x486116){return function(_0x7add4a){if(!_0x7add4a){_0x15c3c9['sendStatus'](0x194);}return _0x7add4a;};}function handleError(_0x57af27,_0x7e2491){_0x7e2491=_0x7e2491||0x1f4;return function(_0x5606a0){logger[_0xda41('0x1e')](_0x5606a0['stack']);if(_0x5606a0[_0xda41('0x33')]){delete _0x5606a0['name'];}_0x57af27['status'](_0x7e2491)['send'](_0x5606a0);};}exports[_0xda41('0x34')]=function(_0x92d358,_0x58893f){var _0x27546a={},_0x229c40={},_0x4e066f={'count':0x0,'rows':[]};var _0x30c9a9=_['map'](db[_0xda41('0x35')]['rawAttributes'],function(_0x53da8c){return{'name':_0x53da8c[_0xda41('0x36')],'type':_0x53da8c[_0xda41('0x37')][_0xda41('0x38')]};});_0x229c40[_0xda41('0x39')]=_[_0xda41('0x3a')](_0x30c9a9,'name');_0x229c40[_0xda41('0x3b')]=_[_0xda41('0x3c')](_0x92d358[_0xda41('0x3b')]);_0x229c40[_0xda41('0x3d')]=_[_0xda41('0x3e')](_0x229c40[_0xda41('0x39')],_0x229c40[_0xda41('0x3b')]);_0x27546a[_0xda41('0x3f')]=_[_0xda41('0x3e')](_0x229c40[_0xda41('0x39')],qs[_0xda41('0x40')](_0x92d358['query']['fields']));_0x27546a['attributes']=_0x27546a[_0xda41('0x3f')][_0xda41('0x41')]?_0x27546a['attributes']:_0x229c40[_0xda41('0x39')];if(!_0x92d358[_0xda41('0x3b')]['hasOwnProperty']('nolimit')){_0x27546a[_0xda41('0x29')]=qs[_0xda41('0x29')](_0x92d358[_0xda41('0x3b')][_0xda41('0x29')]);_0x27546a[_0xda41('0x26')]=qs[_0xda41('0x26')](_0x92d358['query'][_0xda41('0x26')]);}_0x27546a[_0xda41('0x42')]=qs[_0xda41('0x43')](_0x92d358[_0xda41('0x3b')][_0xda41('0x43')]);_0x27546a[_0xda41('0x44')]=qs[_0xda41('0x3d')](_[_0xda41('0x45')](_0x92d358[_0xda41('0x3b')],_0x229c40[_0xda41('0x3d')]),_0x30c9a9);if(_0x92d358[_0xda41('0x3b')][_0xda41('0x46')]){_0x27546a['where']=_[_0xda41('0x47')](_0x27546a[_0xda41('0x44')],{'$or':_['map'](_0x30c9a9,function(_0x233c1a){if(_0x233c1a[_0xda41('0x37')]!==_0xda41('0x48')){var _0x236073={};_0x236073[_0x233c1a[_0xda41('0x33')]]={'$like':'%'+_0x92d358['query']['filter']+'%'};return _0x236073;}})});}_0x27546a=_[_0xda41('0x47')]({},_0x27546a,_0x92d358[_0xda41('0x49')]);var _0xc6364e={'where':_0x27546a['where']};return db[_0xda41('0x35')][_0xda41('0x28')](_0xc6364e)[_0xda41('0x19')](function(_0x15bba8){_0x4e066f[_0xda41('0x28')]=_0x15bba8;if(_0x92d358[_0xda41('0x3b')]['includeAll']){_0x27546a[_0xda41('0x4a')]=[{'all':!![]}];}return db[_0xda41('0x35')][_0xda41('0x4b')](_0x27546a);})['then'](function(_0x30e98f){_0x4e066f['rows']=_0x30e98f;return _0x4e066f;})[_0xda41('0x19')](respondWithFilteredResult(_0x58893f,_0x27546a))['catch'](handleError(_0x58893f,null));};exports['show']=function(_0x2f3fe6,_0x454b13){var _0x23558b={'raw':![],'where':{'id':_0x2f3fe6[_0xda41('0x4c')]['id']}},_0x2c4c0a={};_0x2c4c0a[_0xda41('0x39')]=_['keys'](db[_0xda41('0x35')]['rawAttributes']);_0x2c4c0a[_0xda41('0x3b')]=_[_0xda41('0x3c')](_0x2f3fe6[_0xda41('0x3b')]);_0x2c4c0a[_0xda41('0x3d')]=_[_0xda41('0x3e')](_0x2c4c0a[_0xda41('0x39')],_0x2c4c0a[_0xda41('0x3b')]);_0x23558b[_0xda41('0x3f')]=_[_0xda41('0x3e')](_0x2c4c0a[_0xda41('0x39')],qs['fields'](_0x2f3fe6[_0xda41('0x3b')][_0xda41('0x40')]));_0x23558b[_0xda41('0x3f')]=_0x23558b['attributes'][_0xda41('0x41')]?_0x23558b[_0xda41('0x3f')]:_0x2c4c0a[_0xda41('0x39')];if(_0x2f3fe6[_0xda41('0x3b')][_0xda41('0x4d')]){_0x23558b[_0xda41('0x4a')]=[{'all':!![]}];}_0x23558b=_[_0xda41('0x47')]({},_0x23558b,_0x2f3fe6[_0xda41('0x49')]);return db[_0xda41('0x35')][_0xda41('0x4e')](_0x23558b)[_0xda41('0x19')](handleEntityNotFound(_0x454b13,null))['then'](respondWithResult(_0x454b13,null))[_0xda41('0x22')](handleError(_0x454b13,null));};exports[_0xda41('0x4f')]=function(_0x4f0c0f,_0xe15777,_0xb66ae5){var _0x5a8ea9;return db[_0xda41('0x35')][_0xda41('0x4f')](_0x4f0c0f[_0xda41('0x50')],{'raw':!![]})[_0xda41('0x19')](function(_0x24e13d){_0x5a8ea9=_0x24e13d;return db[_0xda41('0x35')]['findAll']({'raw':!![]});})[_0xda41('0x19')](function(_0x13df95){var _0x2684c0=fs['readFileSync'](path[_0xda41('0x51')](config['root'],_0xda41('0x52')),'utf8');var _0x9ce5df=ejs['render'](_0x2684c0,{'contexts':_0x13df95||[]});fs[_0xda41('0x53')](_0xda41('0x54'),_0x9ce5df);})[_0xda41('0x19')](function(){return respondWithRpcPromise(_0xda41('0x55'),_0xda41('0x4f'),{'module':_0xda41('0x56')});})[_0xda41('0x19')](function(){var _0xee8e91=_0x4f0c0f[_0xda41('0x57')][_0xda41('0x30')]({'plain':!![]});if(!_0xee8e91)throw new Error(_0xda41('0x58'));if(_0xee8e91[_0xda41('0x59')]===_0xda41('0x57')){var _0x2517dd=_0x5a8ea9[_0xda41('0x30')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xda41('0x31'),'userProfileId':_0xee8e91[_0xda41('0x5a')]},'raw':!![]})[_0xda41('0x19')](function(_0x122539){if(_0x122539&&_0x122539['autoAssociation']===0x0){return db['UserProfileResource'][_0xda41('0x4f')]({'name':_0x2517dd[_0xda41('0x33')],'resourceId':_0x2517dd['id'],'type':_0x122539[_0xda41('0x33')],'sectionId':_0x122539['id']},{})[_0xda41('0x19')](function(){return _0x5a8ea9;});}else{return _0x5a8ea9;}})[_0xda41('0x22')](function(_0x2e2d32){logger[_0xda41('0x1e')](_0xda41('0x5b'),_0x2e2d32);throw _0x2e2d32;});}return _0x5a8ea9;})[_0xda41('0x19')](respondWithResult(_0xe15777,0xc9))['catch'](handleError(_0xe15777,null));};exports[_0xda41('0x2e')]=function(_0x65fe56,_0x5ec4a7,_0x5aeccf){var _0x55c3e9;return db[_0xda41('0x35')][_0xda41('0x4e')]({'where':{'id':_0x65fe56[_0xda41('0x4c')]['id']}})[_0xda41('0x19')](handleEntityNotFound(_0x5ec4a7,null))[_0xda41('0x19')](saveUpdates(_0x65fe56[_0xda41('0x50')],null))['then'](function(_0x58b216){if(_0x58b216){_0x55c3e9=_0x58b216;return db['VoiceContext'][_0xda41('0x4b')]({'raw':!![]});}})['then'](function(_0x2dbb5f){var _0x1d15da=fs[_0xda41('0x5c')](path[_0xda41('0x51')](config['root'],_0xda41('0x52')),_0xda41('0x5d'));var _0x2f58f2=ejs[_0xda41('0x5e')](_0x1d15da,{'contexts':_0x2dbb5f||[]});fs[_0xda41('0x53')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x2f58f2);})[_0xda41('0x19')](function(){return respondWithRpcPromise(_0xda41('0x55'),_0xda41('0x2e'),{'module':_0xda41('0x56')});})[_0xda41('0x19')](function(){return _0x55c3e9;})[_0xda41('0x19')](respondWithResult(_0x5ec4a7,null))[_0xda41('0x22')](handleError(_0x5ec4a7,null));};exports[_0xda41('0x2f')]=function(_0x1ce9ef,_0xa695cf,_0x3ebe08){var _0x4c5247;return db['VoiceContext'][_0xda41('0x4e')]({'where':{'id':_0x1ce9ef[_0xda41('0x4c')]['id']}})['then'](handleEntityNotFound(_0xa695cf,null))[_0xda41('0x19')](removeEntity(_0xa695cf,null))[_0xda41('0x19')](function(){return db[_0xda41('0x35')]['findAll']({'raw':!![]});})[_0xda41('0x19')](function(_0x3863ca){var _0x1dea97=fs[_0xda41('0x5c')](path[_0xda41('0x51')](config[_0xda41('0x5f')],_0xda41('0x52')),'utf8');var _0x44c98f=ejs[_0xda41('0x5e')](_0x1dea97,{'contexts':_0x3863ca});fs[_0xda41('0x53')](_0xda41('0x54'),_0x44c98f);return respondWithRpcPromise('Reload',_0xda41('0x2f'),{'module':_0xda41('0x56')});})['catch'](handleError(_0xa695cf,null));}; \ No newline at end of file +var _0xff8b=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findAll','server/files/templates/context.ejs','writeFileSync','chan_sip.so','params','eml-format','rimraf','zip-dir','bluebird','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','destroy','get','Contexts','UserProfileResource','stack','name','index','map','VoiceContext','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','find','create','body','readFileSync','join','root','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','UserProfileSection'];(function(_0x53b398,_0x39bfd8){var _0x32c9ed=function(_0x5f5c4f){while(--_0x5f5c4f){_0x53b398['push'](_0x53b398['shift']());}};_0x32c9ed(++_0x39bfd8);}(_0xff8b,0x6a));var _0xbff8=function(_0x611761,_0x29bdc7){_0x611761=_0x611761-0x0;var _0x5424e5=_0xff8b[_0x611761];return _0x5424e5;};'use strict';var emlformat=require(_0xbff8('0x0'));var rimraf=require(_0xbff8('0x1'));var zipdir=require(_0xbff8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbff8('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbff8('0x4'));var sox=require('sox');var csv=require(_0xbff8('0x5'));var ejs=require(_0xbff8('0x6'));var fs=require('fs');var fs_extra=require(_0xbff8('0x7'));var _=require(_0xbff8('0x8'));var squel=require('squel');var crypto=require(_0xbff8('0x9'));var jsforce=require(_0xbff8('0xa'));var deskjs=require(_0xbff8('0xb'));var toCsv=require('to-csv');var querystring=require(_0xbff8('0xc'));var Papa=require(_0xbff8('0xd'));var Redis=require('ioredis');var authService=require(_0xbff8('0xe'));var qs=require(_0xbff8('0xf'));var as=require(_0xbff8('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbff8('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xbff8('0x12'));var licenseUtil=require(_0xbff8('0x13'));var db=require(_0xbff8('0x14'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xbff8('0x15')][_0xbff8('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x295ef4,_0x3e54de,_0x1ab12a,_0x49b107){return new BPromise(function(_0x5bc9ba,_0x1e341e){var _0x390910=_0x49b107||client;return _0x390910[_0xbff8('0x17')](_0x295ef4,_0x1ab12a)[_0xbff8('0x18')](function(_0x4a2800){logger[_0xbff8('0x19')](_0xbff8('0x1a'),_0x3e54de,_0xbff8('0x1b'));logger[_0xbff8('0x1c')](_0xbff8('0x1d'),_0x3e54de,'request\x20sent',JSON[_0xbff8('0x1e')](_0x4a2800));if(_0x4a2800[_0xbff8('0x1f')]){if(_0x4a2800[_0xbff8('0x1f')][_0xbff8('0x20')]===0x1f4){logger[_0xbff8('0x1f')](_0xbff8('0x1a'),_0x3e54de,_0x4a2800[_0xbff8('0x1f')]['message']);return _0x1e341e(_0x4a2800[_0xbff8('0x1f')][_0xbff8('0x21')]);}logger[_0xbff8('0x1f')](_0xbff8('0x1a'),_0x3e54de,_0x4a2800['error'][_0xbff8('0x21')]);return _0x5bc9ba(_0x4a2800[_0xbff8('0x1f')][_0xbff8('0x21')]);}else{logger['info'](_0xbff8('0x1a'),_0x3e54de,_0xbff8('0x1b'));_0x5bc9ba(_0x4a2800[_0xbff8('0x22')][_0xbff8('0x21')]);}})[_0xbff8('0x23')](function(_0x261a54){logger[_0xbff8('0x1f')](_0xbff8('0x1a'),_0x3e54de,_0x261a54);_0x1e341e(_0x261a54);});});}function respondWithStatusCode(_0x5d885d,_0x449044){_0x449044=_0x449044||0xcc;return function(_0x646b1f){if(_0x646b1f){return _0x5d885d[_0xbff8('0x24')](_0x449044);}return _0x5d885d['status'](_0x449044)[_0xbff8('0x25')]();};}function respondWithResult(_0x5e1ec0,_0x3a5558){_0x3a5558=_0x3a5558||0xc8;return function(_0x3d1657){if(_0x3d1657){return _0x5e1ec0[_0xbff8('0x26')](_0x3a5558)[_0xbff8('0x27')](_0x3d1657);}};}function respondWithFilteredResult(_0x2ff412,_0x4a3850){return function(_0x1b3b00){if(_0x1b3b00){var _0x3548f5=typeof _0x4a3850[_0xbff8('0x28')]===_0xbff8('0x29')&&typeof _0x4a3850[_0xbff8('0x2a')]==='undefined';var _0x5d5156=_0x1b3b00['count'];var _0x386df4=_0x3548f5?0x0:_0x4a3850['offset'];var _0x5eeacd=_0x3548f5?_0x1b3b00[_0xbff8('0x2b')]:_0x4a3850[_0xbff8('0x28')]+_0x4a3850['limit'];var _0x2bec77;if(_0x5eeacd>=_0x5d5156){_0x5eeacd=_0x5d5156;_0x2bec77=0xc8;}else{_0x2bec77=0xce;}_0x2ff412['status'](_0x2bec77);return _0x2ff412[_0xbff8('0x2c')](_0xbff8('0x2d'),_0x386df4+'-'+_0x5eeacd+'/'+_0x5d5156)[_0xbff8('0x27')](_0x1b3b00);}return null;};}function patchUpdates(_0x28f67f){return function(_0x45770f){try{jsonpatch['apply'](_0x45770f,_0x28f67f,!![]);}catch(_0x5d3c86){return BPromise['reject'](_0x5d3c86);}return _0x45770f[_0xbff8('0x2e')]();};}function saveUpdates(_0x2899b3,_0x15bec9){return function(_0x53cac4){if(_0x53cac4){return _0x53cac4['update'](_0x2899b3)[_0xbff8('0x18')](function(_0x1f781a){return _0x1f781a;});}return null;};}function removeEntity(_0xd90968,_0x264675){return function(_0x182bfc){if(_0x182bfc){return _0x182bfc[_0xbff8('0x2f')]()[_0xbff8('0x18')](function(){var _0x3a530e=_0x182bfc[_0xbff8('0x30')]({'plain':!![]});var _0x34cbd6=_0xbff8('0x31');return db[_0xbff8('0x32')][_0xbff8('0x2f')]({'where':{'type':_0x34cbd6,'resourceId':_0x3a530e['id']}})['then'](function(){return _0x182bfc;});})[_0xbff8('0x18')](function(){_0xd90968[_0xbff8('0x26')](0xcc)[_0xbff8('0x25')]();});}};}function handleEntityNotFound(_0x20734a,_0x3bd1fe){return function(_0x55abc6){if(!_0x55abc6){_0x20734a[_0xbff8('0x24')](0x194);}return _0x55abc6;};}function handleError(_0x96fdaa,_0x30f193){_0x30f193=_0x30f193||0x1f4;return function(_0x21daa5){logger[_0xbff8('0x1f')](_0x21daa5[_0xbff8('0x33')]);if(_0x21daa5[_0xbff8('0x34')]){delete _0x21daa5[_0xbff8('0x34')];}_0x96fdaa[_0xbff8('0x26')](_0x30f193)['send'](_0x21daa5);};}exports[_0xbff8('0x35')]=function(_0x14d254,_0x1717c4){var _0x7fe3ae={},_0x4a79a9={},_0x34cb28={'count':0x0,'rows':[]};var _0x154520=_[_0xbff8('0x36')](db[_0xbff8('0x37')][_0xbff8('0x38')],function(_0xfb59d6){return{'name':_0xfb59d6[_0xbff8('0x39')],'type':_0xfb59d6[_0xbff8('0x3a')][_0xbff8('0x3b')]};});_0x4a79a9[_0xbff8('0x3c')]=_['map'](_0x154520,_0xbff8('0x34'));_0x4a79a9[_0xbff8('0x3d')]=_[_0xbff8('0x3e')](_0x14d254[_0xbff8('0x3d')]);_0x4a79a9[_0xbff8('0x3f')]=_[_0xbff8('0x40')](_0x4a79a9['model'],_0x4a79a9[_0xbff8('0x3d')]);_0x7fe3ae[_0xbff8('0x41')]=_[_0xbff8('0x40')](_0x4a79a9['model'],qs[_0xbff8('0x42')](_0x14d254['query'][_0xbff8('0x42')]));_0x7fe3ae[_0xbff8('0x41')]=_0x7fe3ae[_0xbff8('0x41')][_0xbff8('0x43')]?_0x7fe3ae[_0xbff8('0x41')]:_0x4a79a9['model'];if(!_0x14d254[_0xbff8('0x3d')]['hasOwnProperty']('nolimit')){_0x7fe3ae[_0xbff8('0x2a')]=qs[_0xbff8('0x2a')](_0x14d254[_0xbff8('0x3d')][_0xbff8('0x2a')]);_0x7fe3ae[_0xbff8('0x28')]=qs[_0xbff8('0x28')](_0x14d254[_0xbff8('0x3d')][_0xbff8('0x28')]);}_0x7fe3ae[_0xbff8('0x44')]=qs[_0xbff8('0x45')](_0x14d254['query'][_0xbff8('0x45')]);_0x7fe3ae[_0xbff8('0x46')]=qs[_0xbff8('0x3f')](_[_0xbff8('0x47')](_0x14d254['query'],_0x4a79a9['filters']),_0x154520);if(_0x14d254[_0xbff8('0x3d')][_0xbff8('0x48')]){_0x7fe3ae[_0xbff8('0x46')]=_[_0xbff8('0x49')](_0x7fe3ae[_0xbff8('0x46')],{'$or':_[_0xbff8('0x36')](_0x154520,function(_0x2674d8){if(_0x2674d8[_0xbff8('0x3a')]!==_0xbff8('0x4a')){var _0x14f50a={};_0x14f50a[_0x2674d8[_0xbff8('0x34')]]={'$like':'%'+_0x14d254[_0xbff8('0x3d')]['filter']+'%'};return _0x14f50a;}})});}_0x7fe3ae=_[_0xbff8('0x49')]({},_0x7fe3ae,_0x14d254[_0xbff8('0x4b')]);var _0x3eb856={'where':_0x7fe3ae['where']};return db[_0xbff8('0x37')][_0xbff8('0x2b')](_0x3eb856)[_0xbff8('0x18')](function(_0x2e890e){_0x34cb28[_0xbff8('0x2b')]=_0x2e890e;if(_0x14d254[_0xbff8('0x3d')][_0xbff8('0x4c')]){_0x7fe3ae[_0xbff8('0x4d')]=[{'all':!![]}];}return db[_0xbff8('0x37')]['findAll'](_0x7fe3ae);})[_0xbff8('0x18')](function(_0x31076d){_0x34cb28['rows']=_0x31076d;return _0x34cb28;})['then'](respondWithFilteredResult(_0x1717c4,_0x7fe3ae))['catch'](handleError(_0x1717c4,null));};exports['show']=function(_0x48c002,_0x5583db){var _0x9bf180={'raw':![],'where':{'id':_0x48c002['params']['id']}},_0x56eb05={};_0x56eb05[_0xbff8('0x3c')]=_['keys'](db[_0xbff8('0x37')][_0xbff8('0x38')]);_0x56eb05['query']=_[_0xbff8('0x3e')](_0x48c002['query']);_0x56eb05[_0xbff8('0x3f')]=_[_0xbff8('0x40')](_0x56eb05['model'],_0x56eb05['query']);_0x9bf180[_0xbff8('0x41')]=_[_0xbff8('0x40')](_0x56eb05[_0xbff8('0x3c')],qs['fields'](_0x48c002[_0xbff8('0x3d')][_0xbff8('0x42')]));_0x9bf180['attributes']=_0x9bf180[_0xbff8('0x41')][_0xbff8('0x43')]?_0x9bf180[_0xbff8('0x41')]:_0x56eb05[_0xbff8('0x3c')];if(_0x48c002[_0xbff8('0x3d')][_0xbff8('0x4c')]){_0x9bf180[_0xbff8('0x4d')]=[{'all':!![]}];}_0x9bf180=_['merge']({},_0x9bf180,_0x48c002[_0xbff8('0x4b')]);return db[_0xbff8('0x37')][_0xbff8('0x4e')](_0x9bf180)['then'](handleEntityNotFound(_0x5583db,null))[_0xbff8('0x18')](respondWithResult(_0x5583db,null))[_0xbff8('0x23')](handleError(_0x5583db,null));};exports[_0xbff8('0x4f')]=function(_0x82e1d7,_0x238218,_0x224149){var _0xc58c1;return db[_0xbff8('0x37')]['create'](_0x82e1d7[_0xbff8('0x50')],{'raw':!![]})[_0xbff8('0x18')](function(_0x66cc){_0xc58c1=_0x66cc;return db[_0xbff8('0x37')]['findAll']({'raw':!![]});})[_0xbff8('0x18')](function(_0x3e524e){var _0x4450c1=fs[_0xbff8('0x51')](path[_0xbff8('0x52')](config[_0xbff8('0x53')],'server/files/templates/context.ejs'),_0xbff8('0x54'));var _0x3bc4c1=ejs[_0xbff8('0x55')](_0x4450c1,{'contexts':_0x3e524e||[]});fs['writeFileSync'](_0xbff8('0x56'),_0x3bc4c1);})['then'](function(){return respondWithRpcPromise(_0xbff8('0x57'),_0xbff8('0x4f'),{'module':'chan_sip.so'});})[_0xbff8('0x18')](function(){var _0x5bd1c0=_0x82e1d7[_0xbff8('0x58')]['get']({'plain':!![]});if(!_0x5bd1c0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5bd1c0['role']===_0xbff8('0x58')){var _0x51bc3c=_0xc58c1['get']({'plain':!![]});return db[_0xbff8('0x59')][_0xbff8('0x4e')]({'where':{'name':_0xbff8('0x31'),'userProfileId':_0x5bd1c0[_0xbff8('0x5a')]},'raw':!![]})['then'](function(_0x891992){if(_0x891992&&_0x891992[_0xbff8('0x5b')]===0x0){return db[_0xbff8('0x32')][_0xbff8('0x4f')]({'name':_0x51bc3c[_0xbff8('0x34')],'resourceId':_0x51bc3c['id'],'type':_0x891992[_0xbff8('0x34')],'sectionId':_0x891992['id']},{})[_0xbff8('0x18')](function(){return _0xc58c1;});}else{return _0xc58c1;}})[_0xbff8('0x23')](function(_0x561b73){logger[_0xbff8('0x1f')](_0xbff8('0x5c'),_0x561b73);throw _0x561b73;});}return _0xc58c1;})[_0xbff8('0x18')](respondWithResult(_0x238218,0xc9))['catch'](handleError(_0x238218,null));};exports['update']=function(_0x21c68d,_0x237bd0,_0x1067ed){var _0x525ebe;return db['VoiceContext'][_0xbff8('0x4e')]({'where':{'id':_0x21c68d['params']['id']}})[_0xbff8('0x18')](handleEntityNotFound(_0x237bd0,null))[_0xbff8('0x18')](saveUpdates(_0x21c68d[_0xbff8('0x50')],null))[_0xbff8('0x18')](function(_0x58852d){if(_0x58852d){_0x525ebe=_0x58852d;return db['VoiceContext'][_0xbff8('0x5d')]({'raw':!![]});}})[_0xbff8('0x18')](function(_0x2fd44e){var _0x523866=fs[_0xbff8('0x51')](path[_0xbff8('0x52')](config['root'],_0xbff8('0x5e')),_0xbff8('0x54'));var _0x172115=ejs[_0xbff8('0x55')](_0x523866,{'contexts':_0x2fd44e||[]});fs[_0xbff8('0x5f')](_0xbff8('0x56'),_0x172115);})['then'](function(){return respondWithRpcPromise('Reload','update',{'module':_0xbff8('0x60')});})[_0xbff8('0x18')](function(){return _0x525ebe;})[_0xbff8('0x18')](respondWithResult(_0x237bd0,null))['catch'](handleError(_0x237bd0,null));};exports[_0xbff8('0x2f')]=function(_0x4ddc8e,_0x4a2515,_0x40806b){var _0x13f752;return db[_0xbff8('0x37')][_0xbff8('0x4e')]({'where':{'id':_0x4ddc8e[_0xbff8('0x61')]['id']}})[_0xbff8('0x18')](handleEntityNotFound(_0x4a2515,null))['then'](removeEntity(_0x4a2515,null))['then'](function(){return db[_0xbff8('0x37')][_0xbff8('0x5d')]({'raw':!![]});})[_0xbff8('0x18')](function(_0xb3bc8b){var _0x51e80f=fs[_0xbff8('0x51')](path[_0xbff8('0x52')](config['root'],_0xbff8('0x5e')),'utf8');var _0x148ee7=ejs[_0xbff8('0x55')](_0x51e80f,{'contexts':_0xb3bc8b});fs['writeFileSync'](_0xbff8('0x56'),_0x148ee7);return respondWithRpcPromise(_0xbff8('0x57'),_0xbff8('0x2f'),{'module':_0xbff8('0x60')});})['catch'](handleError(_0x4a2515,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index e0c3a25..40a9fe4 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 _0x531f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceContext','voice_contexts','lodash'];(function(_0x594ece,_0x2a1f27){var _0x471bc4=function(_0x31941c){while(--_0x31941c){_0x594ece['push'](_0x594ece['shift']());}};_0x471bc4(++_0x2a1f27);}(_0x531f,0x137));var _0xf531=function(_0x19cf7a,_0x1dd21e){_0x19cf7a=_0x19cf7a-0x0;var _0x1a75bb=_0x531f[_0x19cf7a];return _0x1a75bb;};'use strict';var _=require(_0xf531('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf531('0x1'));var moment=require(_0xf531('0x2'));var BPromise=require(_0xf531('0x3'));var rp=require(_0xf531('0x4'));var fs=require('fs');var path=require(_0xf531('0x5'));var rimraf=require(_0xf531('0x6'));var config=require(_0xf531('0x7'));var attributes=require('./voiceContext.attributes');module[_0xf531('0x8')]=function(_0x1263fc,_0x1a3dc0){return _0x1263fc[_0xf531('0x9')](_0xf531('0xa'),attributes,{'tableName':_0xf531('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeaa5=['define','VoiceContext','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','exports'];(function(_0x25ede0,_0x29dc39){var _0x16fc37=function(_0x13e4d1){while(--_0x13e4d1){_0x25ede0['push'](_0x25ede0['shift']());}};_0x16fc37(++_0x29dc39);}(_0xeaa5,0x1f0));var _0x5eaa=function(_0x2eb4c9,_0x483552){_0x2eb4c9=_0x2eb4c9-0x0;var _0x12da0f=_0xeaa5[_0x2eb4c9];return _0x12da0f;};'use strict';var _=require(_0x5eaa('0x0'));var util=require(_0x5eaa('0x1'));var logger=require('../../config/logger')(_0x5eaa('0x2'));var moment=require(_0x5eaa('0x3'));var BPromise=require(_0x5eaa('0x4'));var rp=require(_0x5eaa('0x5'));var fs=require('fs');var path=require(_0x5eaa('0x6'));var rimraf=require(_0x5eaa('0x7'));var config=require(_0x5eaa('0x8'));var attributes=require(_0x5eaa('0x9'));module[_0x5eaa('0xa')]=function(_0x54570c,_0x4f69e0){return _0x54570c[_0x5eaa('0xb')](_0x5eaa('0xc'),attributes,{'tableName':'voice_contexts','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 9389ed2..1d878c6 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 _0x317b=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','lodash','util','bluebird','randomstring','../../mysqldb'];(function(_0x2d254a,_0x51727c){var _0x4b3040=function(_0x149a5c){while(--_0x149a5c){_0x2d254a['push'](_0x2d254a['shift']());}};_0x4b3040(++_0x51727c);}(_0x317b,0x1c7));var _0xb317=function(_0x52cc71,_0x36e22d){_0x52cc71=_0x52cc71-0x0;var _0x38b145=_0x317b[_0x52cc71];return _0x38b145;};'use strict';var _=require(_0xb317('0x0'));var util=require(_0xb317('0x1'));var moment=require('moment');var BPromise=require(_0xb317('0x2'));var rs=require(_0xb317('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb317('0x4'))['db'];var utils=require(_0xb317('0x5'));var logger=require(_0xb317('0x6'))(_0xb317('0x7'));var config=require(_0xb317('0x8'));var jayson=require(_0xb317('0x9'));var client=jayson[_0xb317('0xa')][_0xb317('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2161fc,_0x2a790b,_0x59d067){return new BPromise(function(_0x31c7d5,_0x6a96e9){return client['request'](_0x2161fc,_0x59d067)[_0xb317('0xc')](function(_0x3ce77d){logger[_0xb317('0xd')](_0xb317('0xe'),_0x2a790b,_0xb317('0xf'));logger[_0xb317('0x10')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x2a790b,_0xb317('0xf'),JSON[_0xb317('0x11')](_0x3ce77d));if(_0x3ce77d['error']){if(_0x3ce77d[_0xb317('0x12')]['code']===0x1f4){logger[_0xb317('0x12')](_0xb317('0xe'),_0x2a790b,_0x3ce77d[_0xb317('0x12')][_0xb317('0x13')]);return _0x6a96e9(_0x3ce77d['error'][_0xb317('0x13')]);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x2a790b,_0x3ce77d[_0xb317('0x12')]['message']);return _0x31c7d5(_0x3ce77d[_0xb317('0x12')][_0xb317('0x13')]);}else{logger[_0xb317('0xd')]('VoiceContext,\x20%s,\x20%s',_0x2a790b,'request\x20sent');_0x31c7d5(_0x3ce77d['result'][_0xb317('0x13')]);}})['catch'](function(_0x266bdc){logger[_0xb317('0x12')]('VoiceContext,\x20%s,\x20%s',_0x2a790b,_0x266bdc);_0x6a96e9(_0x266bdc);});});} \ No newline at end of file +var _0x0f42=['rpc','../../config/environment','jayson/promise','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils'];(function(_0x39d6bb,_0x5f05f7){var _0x1f359a=function(_0x272a31){while(--_0x272a31){_0x39d6bb['push'](_0x39d6bb['shift']());}};_0x1f359a(++_0x5f05f7);}(_0x0f42,0x126));var _0x20f4=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x0f42[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x20f4('0x0'));var util=require(_0x20f4('0x1'));var moment=require(_0x20f4('0x2'));var BPromise=require(_0x20f4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x20f4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x20f4('0x5'));var logger=require('../../config/logger')(_0x20f4('0x6'));var config=require(_0x20f4('0x7'));var jayson=require(_0x20f4('0x8'));var client=jayson['client'][_0x20f4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1519fe,_0x525da0,_0x45adf6){return new BPromise(function(_0x553d5d,_0x4a452d){return client['request'](_0x1519fe,_0x45adf6)[_0x20f4('0xa')](function(_0x4f3d95){logger[_0x20f4('0xb')](_0x20f4('0xc'),_0x525da0,_0x20f4('0xd'));logger[_0x20f4('0xe')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x525da0,_0x20f4('0xd'),JSON['stringify'](_0x4f3d95));if(_0x4f3d95[_0x20f4('0xf')]){if(_0x4f3d95[_0x20f4('0xf')][_0x20f4('0x10')]===0x1f4){logger[_0x20f4('0xf')]('VoiceContext,\x20%s,\x20%s',_0x525da0,_0x4f3d95[_0x20f4('0xf')][_0x20f4('0x11')]);return _0x4a452d(_0x4f3d95[_0x20f4('0xf')][_0x20f4('0x11')]);}logger[_0x20f4('0xf')](_0x20f4('0xc'),_0x525da0,_0x4f3d95[_0x20f4('0xf')][_0x20f4('0x11')]);return _0x553d5d(_0x4f3d95[_0x20f4('0xf')][_0x20f4('0x11')]);}else{logger[_0x20f4('0xb')]('VoiceContext,\x20%s,\x20%s',_0x525da0,'request\x20sent');_0x553d5d(_0x4f3d95[_0x20f4('0x12')][_0x20f4('0x11')]);}})[_0x20f4('0x13')](function(_0x36fdc2){logger[_0x20f4('0xf')]('VoiceContext,\x20%s,\x20%s',_0x525da0,_0x36fdc2);_0x4a452d(_0x36fdc2);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index ef8e914..120cbd7 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 _0xc678=['put','update','delete','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id','post','create'];(function(_0x9dea64,_0x25987a){var _0x1279eb=function(_0x4a9887){while(--_0x4a9887){_0x9dea64['push'](_0x9dea64['shift']());}};_0x1279eb(++_0x25987a);}(_0xc678,0x1b4));var _0x8c67=function(_0x332e04,_0x4e24cb){_0x332e04=_0x332e04-0x0;var _0x12e2c5=_0xc678[_0x332e04];return _0x12e2c5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8c67('0x0'));var timeout=require(_0x8c67('0x1'));var express=require(_0x8c67('0x2'));var router=express['Router']();var fs_extra=require(_0x8c67('0x3'));var auth=require(_0x8c67('0x4'));var interaction=require(_0x8c67('0x5'));var config=require(_0x8c67('0x6'));var controller=require('./voiceDialReport.controller');router[_0x8c67('0x7')]('/',auth['isAuthenticated'](),controller[_0x8c67('0x8')]);router[_0x8c67('0x7')]('/describe',auth[_0x8c67('0x9')](),controller[_0x8c67('0xa')]);router[_0x8c67('0x7')](_0x8c67('0xb'),auth[_0x8c67('0x9')](),controller['show']);router[_0x8c67('0xc')]('/',auth['isAuthenticated'](),controller[_0x8c67('0xd')]);router[_0x8c67('0xe')](_0x8c67('0xb'),auth['isAuthenticated'](),controller[_0x8c67('0xf')]);router[_0x8c67('0x10')](_0x8c67('0xb'),auth[_0x8c67('0x9')](),controller['destroy']);module[_0x8c67('0x11')]=router; \ No newline at end of file +var _0x12dc=['multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./voiceDialReport.controller','index','/describe','isAuthenticated','describe','get','post','create','put','delete','/:id','destroy','exports'];(function(_0x384f94,_0x5bbce7){var _0x397e5a=function(_0x489707){while(--_0x489707){_0x384f94['push'](_0x384f94['shift']());}};_0x397e5a(++_0x5bbce7);}(_0x12dc,0xab));var _0xc12d=function(_0x229e67,_0x3e4211){_0x229e67=_0x229e67-0x0;var _0x104291=_0x12dc[_0x229e67];return _0x104291;};'use strict';var multer=require(_0xc12d('0x0'));var util=require(_0xc12d('0x1'));var path=require('path');var timeout=require(_0xc12d('0x2'));var express=require('express');var router=express[_0xc12d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc12d('0x4'));var interaction=require(_0xc12d('0x5'));var config=require('../../config/environment');var controller=require(_0xc12d('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xc12d('0x7')]);router['get'](_0xc12d('0x8'),auth[_0xc12d('0x9')](),controller[_0xc12d('0xa')]);router[_0xc12d('0xb')]('/:id',auth[_0xc12d('0x9')](),controller['show']);router[_0xc12d('0xc')]('/',auth[_0xc12d('0x9')](),controller[_0xc12d('0xd')]);router[_0xc12d('0xe')]('/:id',auth[_0xc12d('0x9')](),controller['update']);router[_0xc12d('0xf')](_0xc12d('0x10'),auth[_0xc12d('0x9')](),controller[_0xc12d('0x11')]);module[_0xc12d('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 01e90fa..d798b9a 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 _0xe5b3=['STRING','INTEGER','DATE','exports'];(function(_0x4cda63,_0x16ad47){var _0x3e4fd3=function(_0x193096){while(--_0x193096){_0x4cda63['push'](_0x4cda63['shift']());}};_0x3e4fd3(++_0x16ad47);}(_0xe5b3,0x133));var _0x3e5b=function(_0x321961,_0x2e2ccd){_0x321961=_0x321961-0x0;var _0x5bc995=_0xe5b3[_0x321961];return _0x5bc995;};'use strict';var Sequelize=require('sequelize');module[_0x3e5b('0x0')]={'privilege':{'type':Sequelize[_0x3e5b('0x1')]},'channel':{'type':Sequelize[_0x3e5b('0x1')]},'channelstate':{'type':Sequelize[_0x3e5b('0x2')]},'channelstatedesc':{'type':Sequelize[_0x3e5b('0x1')]},'calleridnum':{'type':Sequelize[_0x3e5b('0x1')]},'calleridname':{'type':Sequelize[_0x3e5b('0x1')]},'connectedlinenum':{'type':Sequelize[_0x3e5b('0x1')]},'connectedlinename':{'type':Sequelize[_0x3e5b('0x1')]},'language':{'type':Sequelize[_0x3e5b('0x1')]},'accountcode':{'type':Sequelize[_0x3e5b('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x3e5b('0x1')]},'priority':{'type':Sequelize[_0x3e5b('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x3e5b('0x1')]},'destchannel':{'type':Sequelize[_0x3e5b('0x1')]},'destchannelstate':{'type':Sequelize[_0x3e5b('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x3e5b('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x3e5b('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x3e5b('0x1')]},'destlanguage':{'type':Sequelize[_0x3e5b('0x1')]},'destaccountcode':{'type':Sequelize[_0x3e5b('0x1')]},'destcontext':{'type':Sequelize[_0x3e5b('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x3e5b('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x3e5b('0x1')]},'dialstring':{'type':Sequelize[_0x3e5b('0x1')]},'dialstatus':{'type':Sequelize[_0x3e5b('0x1')]},'starttime':{'type':Sequelize[_0x3e5b('0x3')]},'answertime':{'type':Sequelize[_0x3e5b('0x3')]},'endtime':{'type':Sequelize[_0x3e5b('0x3')]},'lastevent':{'type':Sequelize[_0x3e5b('0x1')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x3e5b('0x2')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','INTEGER','DATE','sequelize'];(function(_0x19eaff,_0x2c820b){var _0xdef6ee=function(_0x28f55e){while(--_0x28f55e){_0x19eaff['push'](_0x19eaff['shift']());}};_0xdef6ee(++_0x2c820b);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x1526e1,_0x5ed5a5){_0x1526e1=_0x1526e1-0x0;var _0x249a1e=_0xf3cd[_0x1526e1];return _0x249a1e;};'use strict';var Sequelize=require(_0xdf3c('0x0'));module[_0xdf3c('0x1')]={'privilege':{'type':Sequelize[_0xdf3c('0x2')]},'channel':{'type':Sequelize[_0xdf3c('0x2')]},'channelstate':{'type':Sequelize[_0xdf3c('0x3')]},'channelstatedesc':{'type':Sequelize[_0xdf3c('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xdf3c('0x2')]},'connectedlinenum':{'type':Sequelize[_0xdf3c('0x2')]},'connectedlinename':{'type':Sequelize[_0xdf3c('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xdf3c('0x2')]},'context':{'type':Sequelize[_0xdf3c('0x2')]},'exten':{'type':Sequelize[_0xdf3c('0x2')]},'priority':{'type':Sequelize[_0xdf3c('0x3')]},'uniqueid':{'type':Sequelize[_0xdf3c('0x2')]},'linkedid':{'type':Sequelize[_0xdf3c('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xdf3c('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xdf3c('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xdf3c('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xdf3c('0x2')]},'destaccountcode':{'type':Sequelize[_0xdf3c('0x2')]},'destcontext':{'type':Sequelize[_0xdf3c('0x2')]},'destexten':{'type':Sequelize[_0xdf3c('0x2')]},'destpriority':{'type':Sequelize[_0xdf3c('0x3')]},'destuniqueid':{'type':Sequelize[_0xdf3c('0x2')]},'destlinkedid':{'type':Sequelize[_0xdf3c('0x2')]},'dialstring':{'type':Sequelize[_0xdf3c('0x2')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xdf3c('0x4')]},'answertime':{'type':Sequelize[_0xdf3c('0x4')]},'endtime':{'type':Sequelize[_0xdf3c('0x4')]},'lastevent':{'type':Sequelize[_0xdf3c('0x2')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xdf3c('0x3')]},'duration':{'type':Sequelize[_0xdf3c('0x3')]},'holdtime':{'type':Sequelize[_0xdf3c('0x3')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 8fb55fc..e3f3124 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 _0xbde1=['then','destroy','end','error','stack','name','send','index','map','type','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','VoiceDialReport','includeAll','include','findAll','rows','catch','params','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update'];(function(_0x4ce342,_0x1d9321){var _0x451490=function(_0x8ba33b){while(--_0x8ba33b){_0x4ce342['push'](_0x4ce342['shift']());}};_0x451490(++_0x1d9321);}(_0xbde1,0x73));var _0x1bde=function(_0x332c02,_0x4d90be){_0x332c02=_0x332c02-0x0;var _0x20641f=_0xbde1[_0x332c02];return _0x20641f;};'use strict';var emlformat=require(_0x1bde('0x0'));var rimraf=require(_0x1bde('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1bde('0x2'));var rp=require(_0x1bde('0x3'));var moment=require(_0x1bde('0x4'));var BPromise=require(_0x1bde('0x5'));var Mustache=require(_0x1bde('0x6'));var util=require(_0x1bde('0x7'));var path=require(_0x1bde('0x8'));var sox=require(_0x1bde('0x9'));var csv=require(_0x1bde('0xa'));var ejs=require(_0x1bde('0xb'));var fs=require('fs');var fs_extra=require(_0x1bde('0xc'));var _=require(_0x1bde('0xd'));var squel=require(_0x1bde('0xe'));var crypto=require('crypto');var jsforce=require(_0x1bde('0xf'));var deskjs=require(_0x1bde('0x10'));var toCsv=require(_0x1bde('0xa'));var querystring=require(_0x1bde('0x11'));var Papa=require(_0x1bde('0x12'));var Redis=require(_0x1bde('0x13'));var authService=require(_0x1bde('0x14'));var qs=require(_0x1bde('0x15'));var as=require(_0x1bde('0x16'));var hardwareService=require(_0x1bde('0x17'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x1bde('0x18'));var licenseUtil=require(_0x1bde('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43cc71,_0xb49095){_0xb49095=_0xb49095||0xcc;return function(_0x1c4a9d){if(_0x1c4a9d){return _0x43cc71[_0x1bde('0x1a')](_0xb49095);}return _0x43cc71['status'](_0xb49095)['end']();};}function respondWithResult(_0xdb03c2,_0x3d68b2){_0x3d68b2=_0x3d68b2||0xc8;return function(_0x3e41ac){if(_0x3e41ac){return _0xdb03c2[_0x1bde('0x1b')](_0x3d68b2)['json'](_0x3e41ac);}};}function respondWithFilteredResult(_0x1f8911,_0x282e7e){return function(_0x4f9d70){if(_0x4f9d70){var _0x21ef44=typeof _0x282e7e[_0x1bde('0x1c')]===_0x1bde('0x1d')&&typeof _0x282e7e[_0x1bde('0x1e')]===_0x1bde('0x1d');var _0x5ceecb=_0x4f9d70['count'];var _0x117262=_0x21ef44?0x0:_0x282e7e['offset'];var _0x528705=_0x21ef44?_0x4f9d70[_0x1bde('0x1f')]:_0x282e7e['offset']+_0x282e7e[_0x1bde('0x1e')];var _0x33e90f;if(_0x528705>=_0x5ceecb){_0x528705=_0x5ceecb;_0x33e90f=0xc8;}else{_0x33e90f=0xce;}_0x1f8911[_0x1bde('0x1b')](_0x33e90f);return _0x1f8911[_0x1bde('0x20')](_0x1bde('0x21'),_0x117262+'-'+_0x528705+'/'+_0x5ceecb)[_0x1bde('0x22')](_0x4f9d70);}return null;};}function patchUpdates(_0x44ad9c){return function(_0x107e66){try{jsonpatch[_0x1bde('0x23')](_0x107e66,_0x44ad9c,!![]);}catch(_0x1e078d){return BPromise[_0x1bde('0x24')](_0x1e078d);}return _0x107e66[_0x1bde('0x25')]();};}function saveUpdates(_0x67e1b3,_0x5704c9){return function(_0x2f7d7b){if(_0x2f7d7b){return _0x2f7d7b[_0x1bde('0x26')](_0x67e1b3)[_0x1bde('0x27')](function(_0x4e7625){return _0x4e7625;});}return null;};}function removeEntity(_0xc2af3f,_0x5c3483){return function(_0x86b97e){if(_0x86b97e){return _0x86b97e[_0x1bde('0x28')]()[_0x1bde('0x27')](function(){_0xc2af3f[_0x1bde('0x1b')](0xcc)[_0x1bde('0x29')]();});}};}function handleEntityNotFound(_0x42e6a4,_0x4441f0){return function(_0x5c0518){if(!_0x5c0518){_0x42e6a4['sendStatus'](0x194);}return _0x5c0518;};}function handleError(_0x5659ce,_0x10ece0){_0x10ece0=_0x10ece0||0x1f4;return function(_0x1faec1){logger[_0x1bde('0x2a')](_0x1faec1[_0x1bde('0x2b')]);if(_0x1faec1['name']){delete _0x1faec1[_0x1bde('0x2c')];}_0x5659ce[_0x1bde('0x1b')](_0x10ece0)[_0x1bde('0x2d')](_0x1faec1);};}exports[_0x1bde('0x2e')]=function(_0x35b2de,_0x4ecf3a){var _0x28c765={},_0x3519a9={},_0x15b5fb={'count':0x0,'rows':[]};var _0x3dff15=_[_0x1bde('0x2f')](db['VoiceDialReport']['rawAttributes'],function(_0xf53c58){return{'name':_0xf53c58['fieldName'],'type':_0xf53c58[_0x1bde('0x30')]['key']};});_0x3519a9[_0x1bde('0x31')]=_[_0x1bde('0x2f')](_0x3dff15,'name');_0x3519a9['query']=_[_0x1bde('0x32')](_0x35b2de['query']);_0x3519a9[_0x1bde('0x33')]=_[_0x1bde('0x34')](_0x3519a9[_0x1bde('0x31')],_0x3519a9['query']);_0x28c765[_0x1bde('0x35')]=_['intersection'](_0x3519a9[_0x1bde('0x31')],qs[_0x1bde('0x36')](_0x35b2de[_0x1bde('0x37')][_0x1bde('0x36')]));_0x28c765[_0x1bde('0x35')]=_0x28c765[_0x1bde('0x35')][_0x1bde('0x38')]?_0x28c765[_0x1bde('0x35')]:_0x3519a9[_0x1bde('0x31')];if(!_0x35b2de['query'][_0x1bde('0x39')](_0x1bde('0x3a'))){_0x28c765[_0x1bde('0x1e')]=qs[_0x1bde('0x1e')](_0x35b2de[_0x1bde('0x37')][_0x1bde('0x1e')]);_0x28c765[_0x1bde('0x1c')]=qs[_0x1bde('0x1c')](_0x35b2de[_0x1bde('0x37')]['offset']);}_0x28c765[_0x1bde('0x3b')]=qs[_0x1bde('0x3c')](_0x35b2de[_0x1bde('0x37')]['sort']);_0x28c765[_0x1bde('0x3d')]=qs[_0x1bde('0x33')](_[_0x1bde('0x3e')](_0x35b2de['query'],_0x3519a9[_0x1bde('0x33')]),_0x3dff15);if(_0x35b2de[_0x1bde('0x37')][_0x1bde('0x3f')]){_0x28c765[_0x1bde('0x3d')]=_[_0x1bde('0x40')](_0x28c765['where'],{'$or':_[_0x1bde('0x2f')](_0x3dff15,function(_0x3b638e){if(_0x3b638e[_0x1bde('0x30')]!==_0x1bde('0x41')){var _0x209f93={};_0x209f93[_0x3b638e[_0x1bde('0x2c')]]={'$like':'%'+_0x35b2de[_0x1bde('0x37')][_0x1bde('0x3f')]+'%'};return _0x209f93;}})});}_0x28c765=_[_0x1bde('0x40')]({},_0x28c765,_0x35b2de['options']);var _0x3d2b83={'where':_0x28c765[_0x1bde('0x3d')]};return db[_0x1bde('0x42')][_0x1bde('0x1f')](_0x3d2b83)[_0x1bde('0x27')](function(_0x40285e){_0x15b5fb[_0x1bde('0x1f')]=_0x40285e;if(_0x35b2de[_0x1bde('0x37')][_0x1bde('0x43')]){_0x28c765[_0x1bde('0x44')]=[{'all':!![]}];}return db[_0x1bde('0x42')][_0x1bde('0x45')](_0x28c765);})['then'](function(_0x24d779){_0x15b5fb[_0x1bde('0x46')]=_0x24d779;return _0x15b5fb;})[_0x1bde('0x27')](respondWithFilteredResult(_0x4ecf3a,_0x28c765))[_0x1bde('0x47')](handleError(_0x4ecf3a,null));};exports['show']=function(_0x3e709f,_0x130da8){var _0x24750f={'raw':!![],'where':{'id':_0x3e709f[_0x1bde('0x48')]['id']}},_0x4aecca={};_0x4aecca[_0x1bde('0x31')]=_[_0x1bde('0x32')](db[_0x1bde('0x42')]['rawAttributes']);_0x4aecca[_0x1bde('0x37')]=_[_0x1bde('0x32')](_0x3e709f[_0x1bde('0x37')]);_0x4aecca[_0x1bde('0x33')]=_[_0x1bde('0x34')](_0x4aecca['model'],_0x4aecca['query']);_0x24750f[_0x1bde('0x35')]=_[_0x1bde('0x34')](_0x4aecca['model'],qs[_0x1bde('0x36')](_0x3e709f[_0x1bde('0x37')][_0x1bde('0x36')]));_0x24750f[_0x1bde('0x35')]=_0x24750f['attributes'][_0x1bde('0x38')]?_0x24750f[_0x1bde('0x35')]:_0x4aecca[_0x1bde('0x31')];if(_0x3e709f[_0x1bde('0x37')][_0x1bde('0x43')]){_0x24750f[_0x1bde('0x44')]=[{'all':!![]}];}_0x24750f=_[_0x1bde('0x40')]({},_0x24750f,_0x3e709f['options']);return db[_0x1bde('0x42')]['find'](_0x24750f)['then'](handleEntityNotFound(_0x130da8,null))['then'](respondWithResult(_0x130da8,null))[_0x1bde('0x47')](handleError(_0x130da8,null));};exports['create']=function(_0x2fc9fb,_0x2a2a19){return db['VoiceDialReport'][_0x1bde('0x49')](_0x2fc9fb[_0x1bde('0x4a')],{})[_0x1bde('0x27')](respondWithResult(_0x2a2a19,0xc9))[_0x1bde('0x47')](handleError(_0x2a2a19,null));};exports[_0x1bde('0x26')]=function(_0x1a6a3f,_0x309559){if(_0x1a6a3f[_0x1bde('0x4a')]['id']){delete _0x1a6a3f[_0x1bde('0x4a')]['id'];}return db[_0x1bde('0x42')][_0x1bde('0x4b')]({'where':{'id':_0x1a6a3f['params']['id']}})[_0x1bde('0x27')](handleEntityNotFound(_0x309559,null))[_0x1bde('0x27')](saveUpdates(_0x1a6a3f[_0x1bde('0x4a')],null))['then'](respondWithResult(_0x309559,null))['catch'](handleError(_0x309559,null));};exports[_0x1bde('0x28')]=function(_0xa021e6,_0x1cf74e){return db[_0x1bde('0x42')][_0x1bde('0x4b')]({'where':{'id':_0xa021e6[_0x1bde('0x48')]['id']}})[_0x1bde('0x27')](handleEntityNotFound(_0x1cf74e,null))[_0x1bde('0x27')](removeEntity(_0x1cf74e,null))['catch'](handleError(_0x1cf74e,null));};exports[_0x1bde('0x4c')]=function(_0x377888,_0x236864){return db[_0x1bde('0x42')]['describe']()[_0x1bde('0x27')](respondWithResult(_0x236864,null))['catch'](handleError(_0x236864,null));}; \ No newline at end of file +var _0xe3ed=['body','describe','eml-format','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','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','json','offset','limit','count','status','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','stack','name','send','VoiceDialReport','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','then','include','findAll','rows','catch','show','params','keys','includeAll','find','create'];(function(_0x1bd49a,_0x117ed1){var _0x3c8711=function(_0x49f2a4){while(--_0x49f2a4){_0x1bd49a['push'](_0x1bd49a['shift']());}};_0x3c8711(++_0x117ed1);}(_0xe3ed,0x179));var _0xde3e=function(_0x172422,_0x1bca7e){_0x172422=_0x172422-0x0;var _0x18c0f4=_0xe3ed[_0x172422];return _0x18c0f4;};'use strict';var emlformat=require(_0xde3e('0x0'));var rimraf=require(_0xde3e('0x1'));var zipdir=require(_0xde3e('0x2'));var jsonpatch=require(_0xde3e('0x3'));var rp=require(_0xde3e('0x4'));var moment=require('moment');var BPromise=require(_0xde3e('0x5'));var Mustache=require(_0xde3e('0x6'));var util=require('util');var path=require(_0xde3e('0x7'));var sox=require(_0xde3e('0x8'));var csv=require(_0xde3e('0x9'));var ejs=require(_0xde3e('0xa'));var fs=require('fs');var fs_extra=require(_0xde3e('0xb'));var _=require(_0xde3e('0xc'));var squel=require(_0xde3e('0xd'));var crypto=require(_0xde3e('0xe'));var jsforce=require(_0xde3e('0xf'));var deskjs=require(_0xde3e('0x10'));var toCsv=require(_0xde3e('0x9'));var querystring=require(_0xde3e('0x11'));var Papa=require(_0xde3e('0x12'));var Redis=require('ioredis');var authService=require(_0xde3e('0x13'));var qs=require(_0xde3e('0x14'));var as=require(_0xde3e('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xde3e('0x16'));var utils=require('../../config/utils');var config=require(_0xde3e('0x17'));var licenseUtil=require(_0xde3e('0x18'));var db=require(_0xde3e('0x19'))['db'];function respondWithStatusCode(_0x5bbba5,_0x1cff3d){_0x1cff3d=_0x1cff3d||0xcc;return function(_0x24618d){if(_0x24618d){return _0x5bbba5['sendStatus'](_0x1cff3d);}return _0x5bbba5['status'](_0x1cff3d)['end']();};}function respondWithResult(_0x4e0509,_0x5dd0d0){_0x5dd0d0=_0x5dd0d0||0xc8;return function(_0x1d8c3b){if(_0x1d8c3b){return _0x4e0509['status'](_0x5dd0d0)[_0xde3e('0x1a')](_0x1d8c3b);}};}function respondWithFilteredResult(_0x5c1790,_0x2a5c3d){return function(_0x2198f1){if(_0x2198f1){var _0x138d63=typeof _0x2a5c3d[_0xde3e('0x1b')]==='undefined'&&typeof _0x2a5c3d[_0xde3e('0x1c')]==='undefined';var _0x23fb17=_0x2198f1[_0xde3e('0x1d')];var _0x4c3524=_0x138d63?0x0:_0x2a5c3d[_0xde3e('0x1b')];var _0x117cba=_0x138d63?_0x2198f1[_0xde3e('0x1d')]:_0x2a5c3d[_0xde3e('0x1b')]+_0x2a5c3d[_0xde3e('0x1c')];var _0x4ecdcb;if(_0x117cba>=_0x23fb17){_0x117cba=_0x23fb17;_0x4ecdcb=0xc8;}else{_0x4ecdcb=0xce;}_0x5c1790[_0xde3e('0x1e')](_0x4ecdcb);return _0x5c1790[_0xde3e('0x1f')](_0xde3e('0x20'),_0x4c3524+'-'+_0x117cba+'/'+_0x23fb17)['json'](_0x2198f1);}return null;};}function patchUpdates(_0x52f9df){return function(_0x2ffaaf){try{jsonpatch[_0xde3e('0x21')](_0x2ffaaf,_0x52f9df,!![]);}catch(_0x449352){return BPromise[_0xde3e('0x22')](_0x449352);}return _0x2ffaaf[_0xde3e('0x23')]();};}function saveUpdates(_0x2a2799,_0x4719b1){return function(_0x40a0bc){if(_0x40a0bc){return _0x40a0bc[_0xde3e('0x24')](_0x2a2799)['then'](function(_0x6fd085){return _0x6fd085;});}return null;};}function removeEntity(_0x51bfe5,_0x201522){return function(_0x556d2a){if(_0x556d2a){return _0x556d2a[_0xde3e('0x25')]()['then'](function(){_0x51bfe5[_0xde3e('0x1e')](0xcc)[_0xde3e('0x26')]();});}};}function handleEntityNotFound(_0x5a683b,_0x409b05){return function(_0x2bbee8){if(!_0x2bbee8){_0x5a683b[_0xde3e('0x27')](0x194);}return _0x2bbee8;};}function handleError(_0x261f0d,_0x2eea99){_0x2eea99=_0x2eea99||0x1f4;return function(_0x3c675b){logger['error'](_0x3c675b[_0xde3e('0x28')]);if(_0x3c675b[_0xde3e('0x29')]){delete _0x3c675b['name'];}_0x261f0d['status'](_0x2eea99)[_0xde3e('0x2a')](_0x3c675b);};}exports['index']=function(_0x377599,_0x3da962){var _0x42f332={},_0x38ff54={},_0x2785e0={'count':0x0,'rows':[]};var _0x578678=_['map'](db[_0xde3e('0x2b')][_0xde3e('0x2c')],function(_0x3e864d){return{'name':_0x3e864d[_0xde3e('0x2d')],'type':_0x3e864d[_0xde3e('0x2e')]['key']};});_0x38ff54[_0xde3e('0x2f')]=_[_0xde3e('0x30')](_0x578678,'name');_0x38ff54[_0xde3e('0x31')]=_['keys'](_0x377599[_0xde3e('0x31')]);_0x38ff54[_0xde3e('0x32')]=_[_0xde3e('0x33')](_0x38ff54['model'],_0x38ff54[_0xde3e('0x31')]);_0x42f332[_0xde3e('0x34')]=_[_0xde3e('0x33')](_0x38ff54[_0xde3e('0x2f')],qs[_0xde3e('0x35')](_0x377599['query'][_0xde3e('0x35')]));_0x42f332[_0xde3e('0x34')]=_0x42f332[_0xde3e('0x34')][_0xde3e('0x36')]?_0x42f332['attributes']:_0x38ff54[_0xde3e('0x2f')];if(!_0x377599[_0xde3e('0x31')]['hasOwnProperty'](_0xde3e('0x37'))){_0x42f332[_0xde3e('0x1c')]=qs[_0xde3e('0x1c')](_0x377599[_0xde3e('0x31')][_0xde3e('0x1c')]);_0x42f332['offset']=qs[_0xde3e('0x1b')](_0x377599[_0xde3e('0x31')]['offset']);}_0x42f332['order']=qs['sort'](_0x377599[_0xde3e('0x31')][_0xde3e('0x38')]);_0x42f332[_0xde3e('0x39')]=qs[_0xde3e('0x32')](_['pick'](_0x377599[_0xde3e('0x31')],_0x38ff54[_0xde3e('0x32')]),_0x578678);if(_0x377599[_0xde3e('0x31')][_0xde3e('0x3a')]){_0x42f332['where']=_[_0xde3e('0x3b')](_0x42f332[_0xde3e('0x39')],{'$or':_[_0xde3e('0x30')](_0x578678,function(_0x24bee9){if(_0x24bee9[_0xde3e('0x2e')]!==_0xde3e('0x3c')){var _0x297261={};_0x297261[_0x24bee9[_0xde3e('0x29')]]={'$like':'%'+_0x377599[_0xde3e('0x31')][_0xde3e('0x3a')]+'%'};return _0x297261;}})});}_0x42f332=_['merge']({},_0x42f332,_0x377599[_0xde3e('0x3d')]);var _0x4e8e4c={'where':_0x42f332[_0xde3e('0x39')]};return db[_0xde3e('0x2b')][_0xde3e('0x1d')](_0x4e8e4c)[_0xde3e('0x3e')](function(_0xb93e85){_0x2785e0['count']=_0xb93e85;if(_0x377599[_0xde3e('0x31')]['includeAll']){_0x42f332[_0xde3e('0x3f')]=[{'all':!![]}];}return db[_0xde3e('0x2b')][_0xde3e('0x40')](_0x42f332);})[_0xde3e('0x3e')](function(_0x3834ed){_0x2785e0[_0xde3e('0x41')]=_0x3834ed;return _0x2785e0;})[_0xde3e('0x3e')](respondWithFilteredResult(_0x3da962,_0x42f332))[_0xde3e('0x42')](handleError(_0x3da962,null));};exports[_0xde3e('0x43')]=function(_0x531ff2,_0x249f15){var _0x3af6ac={'raw':!![],'where':{'id':_0x531ff2[_0xde3e('0x44')]['id']}},_0x1580aa={};_0x1580aa[_0xde3e('0x2f')]=_['keys'](db['VoiceDialReport'][_0xde3e('0x2c')]);_0x1580aa[_0xde3e('0x31')]=_[_0xde3e('0x45')](_0x531ff2[_0xde3e('0x31')]);_0x1580aa[_0xde3e('0x32')]=_['intersection'](_0x1580aa[_0xde3e('0x2f')],_0x1580aa[_0xde3e('0x31')]);_0x3af6ac[_0xde3e('0x34')]=_['intersection'](_0x1580aa['model'],qs[_0xde3e('0x35')](_0x531ff2[_0xde3e('0x31')]['fields']));_0x3af6ac[_0xde3e('0x34')]=_0x3af6ac[_0xde3e('0x34')]['length']?_0x3af6ac['attributes']:_0x1580aa[_0xde3e('0x2f')];if(_0x531ff2[_0xde3e('0x31')][_0xde3e('0x46')]){_0x3af6ac['include']=[{'all':!![]}];}_0x3af6ac=_[_0xde3e('0x3b')]({},_0x3af6ac,_0x531ff2[_0xde3e('0x3d')]);return db[_0xde3e('0x2b')][_0xde3e('0x47')](_0x3af6ac)[_0xde3e('0x3e')](handleEntityNotFound(_0x249f15,null))[_0xde3e('0x3e')](respondWithResult(_0x249f15,null))['catch'](handleError(_0x249f15,null));};exports[_0xde3e('0x48')]=function(_0x2bb860,_0x427785){return db[_0xde3e('0x2b')]['create'](_0x2bb860[_0xde3e('0x49')],{})[_0xde3e('0x3e')](respondWithResult(_0x427785,0xc9))[_0xde3e('0x42')](handleError(_0x427785,null));};exports[_0xde3e('0x24')]=function(_0x4e4857,_0x5a1ecb){if(_0x4e4857['body']['id']){delete _0x4e4857[_0xde3e('0x49')]['id'];}return db[_0xde3e('0x2b')][_0xde3e('0x47')]({'where':{'id':_0x4e4857[_0xde3e('0x44')]['id']}})[_0xde3e('0x3e')](handleEntityNotFound(_0x5a1ecb,null))[_0xde3e('0x3e')](saveUpdates(_0x4e4857['body'],null))[_0xde3e('0x3e')](respondWithResult(_0x5a1ecb,null))[_0xde3e('0x42')](handleError(_0x5a1ecb,null));};exports[_0xde3e('0x25')]=function(_0x4a5f2a,_0x228a07){return db[_0xde3e('0x2b')][_0xde3e('0x47')]({'where':{'id':_0x4a5f2a[_0xde3e('0x44')]['id']}})[_0xde3e('0x3e')](handleEntityNotFound(_0x228a07,null))['then'](removeEntity(_0x228a07,null))['catch'](handleError(_0x228a07,null));};exports[_0xde3e('0x4a')]=function(_0x3eee85,_0x1d5cb3){return db[_0xde3e('0x2b')][_0xde3e('0x4a')]()[_0xde3e('0x3e')](respondWithResult(_0x1d5cb3,null))[_0xde3e('0x42')](handleError(_0x1d5cb3,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 7ac5577..f8a3cd8 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 _0xa5ef=['path','rimraf','../../config/environment','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x3091ed,_0x1186c4){var _0x3e33fa=function(_0x35058a){while(--_0x35058a){_0x3091ed['push'](_0x3091ed['shift']());}};_0x3e33fa(++_0x1186c4);}(_0xa5ef,0x120));var _0xfa5e=function(_0x2f91a6,_0x4e44ff){_0x2f91a6=_0x2f91a6-0x0;var _0x324cb5=_0xa5ef[_0x2f91a6];return _0x324cb5;};'use strict';var _=require(_0xfa5e('0x0'));var util=require(_0xfa5e('0x1'));var logger=require(_0xfa5e('0x2'))(_0xfa5e('0x3'));var moment=require(_0xfa5e('0x4'));var BPromise=require('bluebird');var rp=require(_0xfa5e('0x5'));var fs=require('fs');var path=require(_0xfa5e('0x6'));var rimraf=require(_0xfa5e('0x7'));var config=require(_0xfa5e('0x8'));var attributes=require('./voiceDialReport.attributes');module[_0xfa5e('0x9')]=function(_0x16df33,_0x595f89){return _0x16df33[_0xfa5e('0xa')](_0xfa5e('0xb'),attributes,{'tableName':_0xfa5e('0xc'),'paranoid':![],'indexes':[{'fields':[_0xfa5e('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6367=['request-promise','path','../../config/environment','./voiceDialReport.attributes','exports','define','uniqueid','util','api','moment','bluebird'];(function(_0x29d4bb,_0x1e12ea){var _0x34d6aa=function(_0x459965){while(--_0x459965){_0x29d4bb['push'](_0x29d4bb['shift']());}};_0x34d6aa(++_0x1e12ea);}(_0x6367,0x1d5));var _0x7636=function(_0x5400a1,_0x2275aa){_0x5400a1=_0x5400a1-0x0;var _0x4006c7=_0x6367[_0x5400a1];return _0x4006c7;};'use strict';var _=require('lodash');var util=require(_0x7636('0x0'));var logger=require('../../config/logger')(_0x7636('0x1'));var moment=require(_0x7636('0x2'));var BPromise=require(_0x7636('0x3'));var rp=require(_0x7636('0x4'));var fs=require('fs');var path=require(_0x7636('0x5'));var rimraf=require('rimraf');var config=require(_0x7636('0x6'));var attributes=require(_0x7636('0x7'));module[_0x7636('0x8')]=function(_0x1dee30,_0x5297d0){return _0x1dee30[_0x7636('0x9')]('VoiceDialReport',attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0x7636('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index c6a5871..fb2d0a3 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 _0x762a=['options','raw','CreateVoiceDialReport','UpdateVoiceDialReport','update','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceDialReport','create','body'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0x762a,0x188));var _0xa762=function(_0x187475,_0x40231a){_0x187475=_0x187475-0x0;var _0x5b59f5=_0x762a[_0x187475];return _0x5b59f5;};'use strict';var _=require(_0xa762('0x0'));var util=require(_0xa762('0x1'));var moment=require(_0xa762('0x2'));var BPromise=require(_0xa762('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa762('0x4'));var db=require(_0xa762('0x5'))['db'];var utils=require(_0xa762('0x6'));var logger=require(_0xa762('0x7'))('rpc');var config=require(_0xa762('0x8'));var jayson=require(_0xa762('0x9'));var client=jayson[_0xa762('0xa')][_0xa762('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xd19ebd,_0x2327a6,_0x20541f){return new BPromise(function(_0x5b4143,_0x4a1c6b){return client[_0xa762('0xc')](_0xd19ebd,_0x20541f)[_0xa762('0xd')](function(_0x29a568){logger[_0xa762('0xe')](_0xa762('0xf'),_0x2327a6,_0xa762('0x10'));logger[_0xa762('0x11')](_0xa762('0x12'),_0x2327a6,_0xa762('0x10'),JSON[_0xa762('0x13')](_0x29a568));if(_0x29a568[_0xa762('0x14')]){if(_0x29a568['error'][_0xa762('0x15')]===0x1f4){logger[_0xa762('0x14')]('VoiceDialReport,\x20%s,\x20%s',_0x2327a6,_0x29a568['error'][_0xa762('0x16')]);return _0x4a1c6b(_0x29a568['error'][_0xa762('0x16')]);}logger[_0xa762('0x14')](_0xa762('0xf'),_0x2327a6,_0x29a568[_0xa762('0x14')][_0xa762('0x16')]);return _0x5b4143(_0x29a568[_0xa762('0x14')][_0xa762('0x16')]);}else{logger[_0xa762('0xe')](_0xa762('0xf'),_0x2327a6,_0xa762('0x10'));_0x5b4143(_0x29a568[_0xa762('0x17')]['message']);}})[_0xa762('0x18')](function(_0x38d936){logger['error'](_0xa762('0xf'),_0x2327a6,_0x38d936);_0x4a1c6b(_0x38d936);});});}exports['CreateVoiceDialReport']=function(_0x4914f6){var _0x10e29c=this;return new Promise(function(_0x58446d,_0x305efc){return db[_0xa762('0x19')][_0xa762('0x1a')](_0x4914f6[_0xa762('0x1b')],{'raw':_0x4914f6['options']?_0x4914f6[_0xa762('0x1c')][_0xa762('0x1d')]===undefined?!![]:![]:!![]})[_0xa762('0xd')](function(_0x42ff99){logger[_0xa762('0xe')](_0xa762('0x1e'),_0x4914f6);logger['debug'](_0xa762('0x1e'),_0x4914f6,JSON['stringify'](_0x42ff99));_0x58446d(_0x42ff99);})[_0xa762('0x18')](function(_0x538e0c){logger[_0xa762('0x14')](_0xa762('0x1e'),_0x538e0c[_0xa762('0x16')],_0x4914f6);_0x305efc(_0x10e29c[_0xa762('0x14')](0x1f4,_0x538e0c['message']));});});};exports[_0xa762('0x1f')]=function(_0x11a320){var _0x706048=this;return new Promise(function(_0x57e608,_0x1e8af2){return db['VoiceDialReport'][_0xa762('0x20')](_0x11a320[_0xa762('0x1b')],{'raw':_0x11a320[_0xa762('0x1c')]?_0x11a320[_0xa762('0x1c')][_0xa762('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11a320['options']?_0x11a320['options'][_0xa762('0x21')]||null:null,'attributes':_0x11a320[_0xa762('0x1c')]?_0x11a320[_0xa762('0x1c')]['attributes']||null:null,'limit':_0x11a320[_0xa762('0x1c')]?_0x11a320[_0xa762('0x1c')][_0xa762('0x22')]||null:null})[_0xa762('0xd')](function(_0x9792cb){logger[_0xa762('0xe')]('UpdateVoiceDialReport',_0x11a320);logger[_0xa762('0x11')](_0xa762('0x1f'),_0x11a320,JSON[_0xa762('0x13')](_0x9792cb));_0x57e608(_0x9792cb);})[_0xa762('0x18')](function(_0x5d97c9){logger[_0xa762('0x14')]('UpdateVoiceDialReport',_0x5d97c9['message'],_0x11a320);_0x1e8af2(_0x706048['error'](0x1f4,_0x5d97c9['message']));});});}; \ No newline at end of file +var _0xdc40=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','then','debug','catch','update','where','limit','UpdateVoiceDialReport','stringify','lodash','util','moment','bluebird'];(function(_0x315c2c,_0x4be2e6){var _0x4bf706=function(_0x336b9f){while(--_0x336b9f){_0x315c2c['push'](_0x315c2c['shift']());}};_0x4bf706(++_0x4be2e6);}(_0xdc40,0xce));var _0x0dc4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xdc40[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0dc4('0x0'));var util=require(_0x0dc4('0x1'));var moment=require(_0x0dc4('0x2'));var BPromise=require(_0x0dc4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0dc4('0x4'));var db=require(_0x0dc4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0dc4('0x6'))(_0x0dc4('0x7'));var config=require(_0x0dc4('0x8'));var jayson=require(_0x0dc4('0x9'));var client=jayson[_0x0dc4('0xa')][_0x0dc4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c0828,_0x8c6fc5,_0x45a9b1){return new BPromise(function(_0x56a6f2,_0x10b634){return client[_0x0dc4('0xc')](_0x2c0828,_0x45a9b1)['then'](function(_0x2378e4){logger[_0x0dc4('0xd')](_0x0dc4('0xe'),_0x8c6fc5,_0x0dc4('0xf'));logger['debug'](_0x0dc4('0x10'),_0x8c6fc5,_0x0dc4('0xf'),JSON['stringify'](_0x2378e4));if(_0x2378e4[_0x0dc4('0x11')]){if(_0x2378e4[_0x0dc4('0x11')][_0x0dc4('0x12')]===0x1f4){logger[_0x0dc4('0x11')](_0x0dc4('0xe'),_0x8c6fc5,_0x2378e4['error'][_0x0dc4('0x13')]);return _0x10b634(_0x2378e4[_0x0dc4('0x11')][_0x0dc4('0x13')]);}logger[_0x0dc4('0x11')](_0x0dc4('0xe'),_0x8c6fc5,_0x2378e4[_0x0dc4('0x11')][_0x0dc4('0x13')]);return _0x56a6f2(_0x2378e4[_0x0dc4('0x11')][_0x0dc4('0x13')]);}else{logger[_0x0dc4('0xd')](_0x0dc4('0xe'),_0x8c6fc5,'request\x20sent');_0x56a6f2(_0x2378e4[_0x0dc4('0x14')][_0x0dc4('0x13')]);}})['catch'](function(_0x354329){logger['error'](_0x0dc4('0xe'),_0x8c6fc5,_0x354329);_0x10b634(_0x354329);});});}exports[_0x0dc4('0x15')]=function(_0x11d810){var _0x50da51=this;return new Promise(function(_0x38aa14,_0x2ad649){return db[_0x0dc4('0x16')][_0x0dc4('0x17')](_0x11d810[_0x0dc4('0x18')],{'raw':_0x11d810['options']?_0x11d810[_0x0dc4('0x19')][_0x0dc4('0x1a')]===undefined?!![]:![]:!![]})[_0x0dc4('0x1b')](function(_0x4b9d77){logger[_0x0dc4('0xd')](_0x0dc4('0x15'),_0x11d810);logger[_0x0dc4('0x1c')](_0x0dc4('0x15'),_0x11d810,JSON['stringify'](_0x4b9d77));_0x38aa14(_0x4b9d77);})[_0x0dc4('0x1d')](function(_0x59ace2){logger['error'](_0x0dc4('0x15'),_0x59ace2[_0x0dc4('0x13')],_0x11d810);_0x2ad649(_0x50da51['error'](0x1f4,_0x59ace2[_0x0dc4('0x13')]));});});};exports['UpdateVoiceDialReport']=function(_0x338ea1){var _0x208489=this;return new Promise(function(_0x2ffd46,_0x1dd69d){return db[_0x0dc4('0x16')][_0x0dc4('0x1e')](_0x338ea1[_0x0dc4('0x18')],{'raw':_0x338ea1[_0x0dc4('0x19')]?_0x338ea1[_0x0dc4('0x19')][_0x0dc4('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x338ea1[_0x0dc4('0x19')]?_0x338ea1[_0x0dc4('0x19')][_0x0dc4('0x1f')]||null:null,'attributes':_0x338ea1[_0x0dc4('0x19')]?_0x338ea1[_0x0dc4('0x19')]['attributes']||null:null,'limit':_0x338ea1['options']?_0x338ea1[_0x0dc4('0x19')][_0x0dc4('0x20')]||null:null})[_0x0dc4('0x1b')](function(_0x22555c){logger['info'](_0x0dc4('0x21'),_0x338ea1);logger[_0x0dc4('0x1c')](_0x0dc4('0x21'),_0x338ea1,JSON[_0x0dc4('0x22')](_0x22555c));_0x2ffd46(_0x22555c);})[_0x0dc4('0x1d')](function(_0x4d341b){logger[_0x0dc4('0x11')](_0x0dc4('0x21'),_0x4d341b[_0x0dc4('0x13')],_0x338ea1);_0x1dd69d(_0x208489[_0x0dc4('0x11')](0x1f4,_0x4d341b[_0x0dc4('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 96f22f1..7b3a4b9 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 _0xc36f=['delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','create','post','/:id/applications','addApplications','put','update'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0xc36f,0x153));var _0xfc36=function(_0x338762,_0x487465){_0x338762=_0x338762-0x0;var _0x280d30=_0xc36f[_0x338762];return _0x280d30;};'use strict';var multer=require(_0xfc36('0x0'));var util=require(_0xfc36('0x1'));var path=require('path');var timeout=require(_0xfc36('0x2'));var express=require(_0xfc36('0x3'));var router=express[_0xfc36('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfc36('0x5'));var config=require(_0xfc36('0x6'));var controller=require(_0xfc36('0x7'));router[_0xfc36('0x8')]('/',auth[_0xfc36('0x9')](),controller[_0xfc36('0xa')]);router[_0xfc36('0x8')](_0xfc36('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xfc36('0x9')](),controller[_0xfc36('0xc')]);router[_0xfc36('0xd')](_0xfc36('0xe'),auth['isAuthenticated'](),controller[_0xfc36('0xf')]);router[_0xfc36('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xfc36('0x11')]);router[_0xfc36('0x12')](_0xfc36('0xb'),auth[_0xfc36('0x9')](),controller[_0xfc36('0x13')]);module[_0xfc36('0x14')]=router; \ No newline at end of file +var _0x61b2=['post','/:id/applications','addApplications','update','delete','destroy','exports','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','index','/:id','isAuthenticated'];(function(_0x999b85,_0x1edc2b){var _0x1d7124=function(_0x59cd29){while(--_0x59cd29){_0x999b85['push'](_0x999b85['shift']());}};_0x1d7124(++_0x1edc2b);}(_0x61b2,0x139));var _0x261b=function(_0x43ef84,_0x1d623a){_0x43ef84=_0x43ef84-0x0;var _0xd6144e=_0x61b2[_0x43ef84];return _0xd6144e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x261b('0x0'));var timeout=require(_0x261b('0x1'));var express=require(_0x261b('0x2'));var router=express['Router']();var fs_extra=require(_0x261b('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x261b('0x4'));var config=require(_0x261b('0x5'));var controller=require(_0x261b('0x6'));router[_0x261b('0x7')]('/',auth['isAuthenticated'](),controller[_0x261b('0x8')]);router[_0x261b('0x7')](_0x261b('0x9'),auth[_0x261b('0xa')](),controller['show']);router[_0x261b('0xb')]('/',auth[_0x261b('0xa')](),controller['create']);router[_0x261b('0xb')](_0x261b('0xc'),auth['isAuthenticated'](),controller[_0x261b('0xd')]);router['put'](_0x261b('0x9'),auth['isAuthenticated'](),controller[_0x261b('0xe')]);router[_0x261b('0xf')](_0x261b('0x9'),auth[_0x261b('0xa')](),controller[_0x261b('0x10')]);module[_0x261b('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 2b7aff8..e2c0a1a 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 _0x5e16=['inbound','outbound','inbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM'];(function(_0x34eae7,_0x172d21){var _0xd7499f=function(_0x441e82){while(--_0x441e82){_0x34eae7['push'](_0x34eae7['shift']());}};_0xd7499f(++_0x172d21);}(_0x5e16,0x150));var _0x65e1=function(_0x20118a,_0x3dbdf3){_0x20118a=_0x20118a-0x0;var _0x538b5f=_0x5e16[_0x20118a];return _0x538b5f;};'use strict';var Sequelize=require(_0x65e1('0x0'));module[_0x65e1('0x1')]={'context':{'type':Sequelize[_0x65e1('0x2')],'allowNull':![],'unique':_0x65e1('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0x65e1('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x65e1('0x3')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x65e1('0x2')],'allowNull':![],'defaultValue':_0x65e1('0x4')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x65e1('0x5')](_0x65e1('0x6'),_0x65e1('0x7'),'internal',_0x65e1('0x8'),'outbound-fax',_0x65e1('0x9'),_0x65e1('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0x65e1('0x2')]},'interval':{'type':Sequelize[_0x65e1('0x2')],'allowNull':![],'defaultValue':_0x65e1('0xb')},'IntervalId':{'type':Sequelize[_0x65e1('0xc')]},'isApp':{'type':Sequelize[_0x65e1('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x65e1('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x65e1('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x65e1('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x65e1('0xc')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0x65e1('0xe')},'answer':{'type':Sequelize[_0x65e1('0xd')],'defaultValue':!![]},'name':{'type':Sequelize[_0x65e1('0xf')],'get':function(_0x32dc5f){return this[_0x65e1('0x10')](_0x65e1('0x11'));}},'alias':{'type':Sequelize[_0x65e1('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xd001=['ENUM','internal','inbound-fax','outbound-fax','system','INTEGER','BOOLEAN','VIRTUAL','sequelize','compositeIndex','STRING','NoOp'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0xd001,0x188));var _0x1d00=function(_0x2bc807,_0x213fd2){_0x2bc807=_0x2bc807-0x0;var _0x56766b=_0xd001[_0x2bc807];return _0x56766b;};'use strict';var Sequelize=require(_0x1d00('0x0'));module['exports']={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1d00('0x1'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x1d00('0x2')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0x1d00('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x1d00('0x1')},'tag':{'type':Sequelize[_0x1d00('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x1d00('0x2')],'allowNull':![],'defaultValue':_0x1d00('0x3')},'appdata':{'type':Sequelize[_0x1d00('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x1d00('0x4')]('inbound','outbound',_0x1d00('0x5'),_0x1d00('0x6'),_0x1d00('0x7'),_0x1d00('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0x1d00('0x2')]},'interval':{'type':Sequelize[_0x1d00('0x2')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0x1d00('0x9')]},'isApp':{'type':Sequelize[_0x1d00('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x1d00('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x1d00('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x1d00('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x1d00('0x9')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x1d00('0xa')],'defaultValue':!![]},'name':{'type':Sequelize[_0x1d00('0xb')],'get':function(_0x201070){return this['getDataValue']('exten');}},'alias':{'type':Sequelize[_0x1d00('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 4de38c6..a90e7e8 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 _0x27e6=['finally','lodash','ioredis','../../components/parsers/qs','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','destroy','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','map','value','type','find','name','UserProfileResource','then','stack','send','index','VoiceExtension','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','merge','options','findAll','params','rawAttributes','include','catch','startsWith','body','exten','concat','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','context','description','recordingFormat','cutdigits','mandatoryDisposition','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','VoiceExtensionId','isApp','createRouting','findAndCountAll','cast(priority\x20as\x20unsigned)'];(function(_0xf1603b,_0x257c11){var _0x298fab=function(_0x5a96fd){while(--_0x5a96fd){_0xf1603b['push'](_0xf1603b['shift']());}};_0x298fab(++_0x257c11);}(_0x27e6,0x115));var _0x627e=function(_0x1e0bde,_0x1a3c8c){_0x1e0bde=_0x1e0bde-0x0;var _0xcf87a8=_0x27e6[_0x1e0bde];return _0xcf87a8;};'use strict';var _=require(_0x627e('0x0'));var Redis=require(_0x627e('0x1'));var qs=require(_0x627e('0x2'));var logger=require('../../config/logger')(_0x627e('0x3'));var config=require('../../config/environment');var db=require(_0x627e('0x4'))['db'];config[_0x627e('0x5')]=_[_0x627e('0x6')](config[_0x627e('0x5')],{'host':_0x627e('0x7'),'port':0x18eb});var socket=require(_0x627e('0x8'))(new Redis(config[_0x627e('0x5')]));require(_0x627e('0x9'))['register'](socket);function respondWithStatusCode(_0x13bbb9,_0x4e709f){_0x4e709f=_0x4e709f||0xcc;return function(_0x165a5b){if(_0x165a5b){return _0x13bbb9[_0x627e('0xa')](_0x4e709f);}return _0x13bbb9['status'](_0x4e709f)[_0x627e('0xb')]();};}function respondWithResult(_0x27d1f6,_0x194647){_0x194647=_0x194647||0xc8;return function(_0x1698f3){if(_0x1698f3){return _0x27d1f6[_0x627e('0xc')](_0x194647)[_0x627e('0xd')](_0x1698f3);}};}function respondWithFilteredResult(_0x118c47,_0x4d5169){return function(_0x1d2573){if(_0x1d2573){var _0x5585d2=typeof _0x4d5169[_0x627e('0xe')]===_0x627e('0xf')&&typeof _0x4d5169[_0x627e('0x10')]===_0x627e('0xf');var _0x56327b=_0x1d2573[_0x627e('0x11')];var _0x411585=_0x5585d2?0x0:_0x4d5169[_0x627e('0xe')];var _0xb09983=_0x5585d2?_0x1d2573[_0x627e('0x11')]:_0x4d5169['offset']+_0x4d5169[_0x627e('0x10')];var _0x413b64;if(_0xb09983>=_0x56327b){_0xb09983=_0x56327b;_0x413b64=0xc8;}else{_0x413b64=0xce;}_0x118c47['status'](_0x413b64);return _0x118c47['set'](_0x627e('0x12'),_0x411585+'-'+_0xb09983+'/'+_0x56327b)[_0x627e('0xd')](_0x1d2573);}return null;};}function removeEntity(_0x861e32){return function(_0x3a303a){if(_0x3a303a){return _0x3a303a[_0x627e('0x13')]()['then'](function(){var _0x4a6ae2=_0x3a303a['get']({'plain':!![]});var _0x1c5fe9=[{'name':_0x627e('0x14'),'value':_0x627e('0x15'),'ignore':![]},{'name':_0x627e('0x16'),'value':_0x627e('0x17'),'ignore':![]},{'name':_0x627e('0x18'),'value':_0x627e('0x19'),'ignore':![]}];var _0x1bef33=_(_0x1c5fe9)[_0x627e('0x1a')]('ignore')[_0x627e('0x1b')](_0x627e('0x1c'))[_0x627e('0x1c')]();if(_['includes'](_0x1bef33,_0x4a6ae2[_0x627e('0x1d')])){return;}var _0x4b33cc=_[_0x627e('0x1e')](_0x1c5fe9,[_0x627e('0x1c'),_0x4a6ae2[_0x627e('0x1d')]])[_0x627e('0x1f')];return db[_0x627e('0x20')]['destroy']({'where':{'type':_0x4b33cc,'resourceId':_0x4a6ae2['id']}})[_0x627e('0x21')](function(){return _0x3a303a;});})[_0x627e('0x21')](function(){_0x861e32[_0x627e('0xc')](0xcc)[_0x627e('0xb')]();});}};}function handleEntityNotFound(_0x1f78c6){return function(_0x456252){if(!_0x456252){_0x1f78c6[_0x627e('0xa')](0x194);}return _0x456252;};}function handleError(_0x445991,_0x12728e){_0x12728e=_0x12728e||0x1f4;return function(_0x12c033){logger['error'](_0x12c033[_0x627e('0x22')]);if(_0x12c033[_0x627e('0x1f')]){delete _0x12c033[_0x627e('0x1f')];}_0x445991[_0x627e('0xc')](_0x12728e)[_0x627e('0x23')](_0x12c033);};}exports[_0x627e('0x24')]=function(_0x5abf12,_0x51aa8f){var _0xb4527e={},_0x5b431d={},_0x3b321c={'count':0x0,'rows':[]};var _0x3d7e14=_[_0x627e('0x1b')](db[_0x627e('0x25')]['rawAttributes'],function(_0x2d9c05){return{'name':_0x2d9c05[_0x627e('0x26')],'type':_0x2d9c05[_0x627e('0x1d')]['key']};});_0x5b431d[_0x627e('0x27')]=_[_0x627e('0x1b')](_0x3d7e14,_0x627e('0x1f'));_0x5b431d[_0x627e('0x28')]=_[_0x627e('0x29')](_0x5abf12[_0x627e('0x28')]);_0x5b431d[_0x627e('0x2a')]=_['intersection'](_0x5b431d['model'],_0x5b431d[_0x627e('0x28')]);_0xb4527e['attributes']=_[_0x627e('0x2b')](_0x5b431d['model'],qs['fields'](_0x5abf12[_0x627e('0x28')][_0x627e('0x2c')]));_0xb4527e[_0x627e('0x2d')]=_0xb4527e['attributes'][_0x627e('0x2e')]?_0xb4527e[_0x627e('0x2d')]:_0x5b431d[_0x627e('0x27')];if(!_0x5abf12[_0x627e('0x28')][_0x627e('0x2f')](_0x627e('0x30'))){_0xb4527e[_0x627e('0x10')]=qs[_0x627e('0x10')](_0x5abf12[_0x627e('0x28')][_0x627e('0x10')]);_0xb4527e[_0x627e('0xe')]=qs[_0x627e('0xe')](_0x5abf12[_0x627e('0x28')][_0x627e('0xe')]);}_0xb4527e[_0x627e('0x31')]=qs[_0x627e('0x32')](_0x5abf12['query'][_0x627e('0x32')]);_0xb4527e[_0x627e('0x33')]=qs['filters'](_['pick'](_0x5abf12[_0x627e('0x28')],_0x5b431d[_0x627e('0x2a')]),_0x3d7e14);if(_0x5abf12[_0x627e('0x28')]['filter']){_0xb4527e[_0x627e('0x33')]=_['merge'](_0xb4527e[_0x627e('0x33')],{'$or':_[_0x627e('0x1b')](_0x3d7e14,function(_0x4338bb){if(_0x4338bb[_0x627e('0x1d')]!==_0x627e('0x34')){var _0x4aeac4={};_0x4aeac4[_0x4338bb['name']]={'$like':'%'+_0x5abf12['query'][_0x627e('0x1a')]+'%'};return _0x4aeac4;}})});}_0xb4527e=_[_0x627e('0x35')]({},_0xb4527e,_0x5abf12[_0x627e('0x36')]);var _0x2acd2c={'where':_0xb4527e[_0x627e('0x33')]};return db[_0x627e('0x25')][_0x627e('0x11')](_0x2acd2c)[_0x627e('0x21')](function(_0x692a27){_0x3b321c['count']=_0x692a27;if(_0x5abf12[_0x627e('0x28')]['includeAll']){_0xb4527e['include']=[{'all':!![]}];}return db['VoiceExtension'][_0x627e('0x37')](_0xb4527e);})[_0x627e('0x21')](function(_0x24f024){_0x3b321c['rows']=_0x24f024;return _0x3b321c;})[_0x627e('0x21')](respondWithFilteredResult(_0x51aa8f,_0xb4527e))['catch'](handleError(_0x51aa8f,null));};exports['show']=function(_0x4f6bd3,_0x2ac544){var _0x2d9bef={'raw':![],'where':{'id':_0x4f6bd3[_0x627e('0x38')]['id']}},_0x3f054b={};_0x3f054b[_0x627e('0x27')]=_[_0x627e('0x29')](db[_0x627e('0x25')][_0x627e('0x39')]);_0x3f054b['query']=_[_0x627e('0x29')](_0x4f6bd3[_0x627e('0x28')]);_0x3f054b[_0x627e('0x2a')]=_['intersection'](_0x3f054b['model'],_0x3f054b[_0x627e('0x28')]);_0x2d9bef[_0x627e('0x2d')]=_['intersection'](_0x3f054b[_0x627e('0x27')],qs[_0x627e('0x2c')](_0x4f6bd3[_0x627e('0x28')][_0x627e('0x2c')]));_0x2d9bef[_0x627e('0x2d')]=_0x2d9bef[_0x627e('0x2d')][_0x627e('0x2e')]?_0x2d9bef['attributes']:_0x3f054b[_0x627e('0x27')];if(_0x4f6bd3[_0x627e('0x28')]['includeAll']){_0x2d9bef[_0x627e('0x3a')]=[{'all':!![]}];}_0x2d9bef=_['merge']({},_0x2d9bef,_0x4f6bd3['options']);return db[_0x627e('0x25')][_0x627e('0x1e')](_0x2d9bef)[_0x627e('0x21')](handleEntityNotFound(_0x2ac544,null))[_0x627e('0x21')](respondWithResult(_0x2ac544,null))[_0x627e('0x3b')](handleError(_0x2ac544,null));};exports[_0x627e('0x13')]=function(_0x291cd3,_0x17cd8f){return db['VoiceExtension'][_0x627e('0x1e')]({'where':{'id':_0x291cd3['params']['id']}})[_0x627e('0x21')](handleEntityNotFound(_0x17cd8f,null))[_0x627e('0x21')](removeEntity(_0x17cd8f,null))['catch'](handleError(_0x17cd8f,null));};exports['create']=function(_0x559a47,_0x15f615){if(_0x559a47['body'][_0x627e('0x1d')]===_0x627e('0x17')&&!_[_0x627e('0x3c')](_0x559a47[_0x627e('0x3d')][_0x627e('0x3e')],'_')){_0x559a47[_0x627e('0x3d')][_0x627e('0x3e')]='_'[_0x627e('0x3f')](_0x559a47['body'][_0x627e('0x3e')]);}return db[_0x627e('0x25')][_0x627e('0x40')](_0x559a47['body'],{'raw':![]})[_0x627e('0x21')](function(_0x13e9e5){var _0x271033=_0x559a47[_0x627e('0x41')][_0x627e('0x42')]({'plain':!![]});if(!_0x271033)throw new Error(_0x627e('0x43'));if(_0x271033[_0x627e('0x44')]===_0x627e('0x41')){var _0x1ce3a5=_0x13e9e5[_0x627e('0x42')]({'plain':!![]});var _0x1b2df0=[{'name':_0x627e('0x14'),'value':'inbound'},{'name':'OutboundRoutes','value':_0x627e('0x17')},{'name':_0x627e('0x18'),'value':_0x627e('0x19')}];var _0x45107b=_[_0x627e('0x1e')](_0x1b2df0,[_0x627e('0x1c'),_0x1ce3a5[_0x627e('0x1d')]])[_0x627e('0x1f')];return db[_0x627e('0x45')][_0x627e('0x1e')]({'where':{'name':_0x45107b,'userProfileId':_0x271033[_0x627e('0x46')]},'raw':!![]})[_0x627e('0x21')](function(_0x215c43){if(_0x215c43&&_0x215c43[_0x627e('0x47')]===0x0){return db[_0x627e('0x20')][_0x627e('0x40')]({'name':_0x1ce3a5['name'],'resourceId':_0x1ce3a5['id'],'type':_0x215c43['name'],'sectionId':_0x215c43['id']},{})['then'](function(){return _0x13e9e5;});}else{return _0x13e9e5;}})[_0x627e('0x3b')](function(_0x28e5b8){logger[_0x627e('0x48')](_0x627e('0x49'),_0x28e5b8);throw _0x28e5b8;});}return _0x13e9e5;})[_0x627e('0x21')](respondWithResult(_0x15f615,0xc9))[_0x627e('0x3b')](handleError(_0x15f615,null));};exports[_0x627e('0x4a')]=function(_0x2b23d8,_0x1db8de){if(_0x2b23d8[_0x627e('0x3d')]['id']){delete _0x2b23d8[_0x627e('0x3d')]['id'];}return db[_0x627e('0x25')][_0x627e('0x1e')]({'where':{'id':_0x2b23d8[_0x627e('0x38')]['id']}})[_0x627e('0x21')](handleEntityNotFound(_0x1db8de,null))[_0x627e('0x21')](function(_0x42dfb2){if(_0x42dfb2){return db[_0x627e('0x25')]['update'](_[_0x627e('0x4b')](_0x2b23d8['body'],[_0x627e('0x3e'),_0x627e('0x4c'),_0x627e('0x4d'),_0x627e('0x4e'),_0x627e('0x4f'),_0x627e('0x50'),'alias']),{'where':{'context':_0x42dfb2[_0x627e('0x4c')],'exten':_0x42dfb2[_0x627e('0x3e')]},'individualHooks':!![]})[_0x627e('0x21')](function(_0x536361){return _0x536361;});}return null;})[_0x627e('0x21')](respondWithStatusCode(_0x1db8de,null))['catch'](handleError(_0x1db8de,null));};exports[_0x627e('0x51')]=function(_0x146621,_0x215753){var _0x2aa320=_0x146621[_0x627e('0x38')]['id'];var _0x5f4e41=_0x146621['body'];var _0x1afdc4=0xc8;var _0x4ff8e5=null;return db[_0x627e('0x52')][_0x627e('0x53')]({'isolationLevel':db[_0x627e('0x52')]['Transaction'][_0x627e('0x54')][_0x627e('0x55')]},function(_0x5d644e){return db[_0x627e('0x25')]['findOne']({'where':{'id':_0x2aa320},'transaction':_0x5d644e})[_0x627e('0x21')](function(_0x54e9af){if(_0x54e9af){return db['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':_0x2aa320},'transaction':_0x5d644e})[_0x627e('0x21')](function(){var _0x3ae0fb=_[_0x627e('0x1b')](_0x5f4e41,function(_0xfc6c93){_0xfc6c93[_0x627e('0x56')]=_0x2aa320;_0xfc6c93[_0x627e('0x57')]=!![];return _0xfc6c93;});return _0x54e9af[_0x627e('0x58')](_0x3ae0fb);})[_0x627e('0x21')](function(_0xdf762d){return db[_0x627e('0x25')]['bulkCreate'](_0xdf762d,{'transaction':_0x5d644e});});}else{_0x1afdc4=0x194;_0x4ff8e5=[];}});})[_0x627e('0x21')](function(){if(_0x1afdc4!==0x194){return db[_0x627e('0x25')][_0x627e('0x59')]({'where':{'isApp':!![],'VoiceExtensionId':_0x2aa320},'order':_0x627e('0x5a')})['then'](function(_0x16f406){_0x4ff8e5=_0x16f406;});}})[_0x627e('0x3b')](function(_0x4f8260){_0x1afdc4=0x1f4;logger[_0x627e('0x48')](_0x4f8260['stack']);if(_0x4f8260[_0x627e('0x1f')]){delete _0x4f8260['name'];}_0x4ff8e5=_0x4f8260;})[_0x627e('0x5b')](function(){if(_0x4ff8e5===null){_0x215753[_0x627e('0xa')](_0x1afdc4);}else{if(_0x1afdc4===0x1f4){_0x215753[_0x627e('0xc')](_0x1afdc4)['send'](_0x4ff8e5);}else{_0x215753[_0x627e('0xc')](_0x1afdc4)[_0x627e('0xd')](_0x4ff8e5);}}});}; \ No newline at end of file +var _0x326f=['ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','localhost','redis','./voiceExtension.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','destroy','then','get','inbound','outbound','InternalRoutes','internal','filter','map','value','type','find','name','UserProfileResource','sendStatus','error','stack','VoiceExtension','rawAttributes','fieldName','key','keys','query','filters','intersection','model','fields','attributes','length','order','sort','where','pick','VIRTUAL','merge','options','include','findAll','catch','params','create','startsWith','body','concat','user','role','InboundRoutes','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','exten','context','recordingFormat','mandatoryDisposition','alias','addApplications','sequelize','transaction','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','cast(priority\x20as\x20unsigned)','finally','send','lodash'];(function(_0x14c018,_0x4d4506){var _0x32f588=function(_0x1f65dd){while(--_0x1f65dd){_0x14c018['push'](_0x14c018['shift']());}};_0x32f588(++_0x4d4506);}(_0x326f,0x163));var _0xf326=function(_0x172052,_0x21d3fe){_0x172052=_0x172052-0x0;var _0x298dcb=_0x326f[_0x172052];return _0x298dcb;};'use strict';var _=require(_0xf326('0x0'));var Redis=require(_0xf326('0x1'));var qs=require(_0xf326('0x2'));var logger=require(_0xf326('0x3'))(_0xf326('0x4'));var config=require(_0xf326('0x5'));var db=require(_0xf326('0x6'))['db'];config['redis']=_[_0xf326('0x7')](config['redis'],{'host':_0xf326('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf326('0x9')]));require(_0xf326('0xa'))[_0xf326('0xb')](socket);function respondWithStatusCode(_0x40258d,_0x59fca8){_0x59fca8=_0x59fca8||0xcc;return function(_0x1e34b1){if(_0x1e34b1){return _0x40258d['sendStatus'](_0x59fca8);}return _0x40258d[_0xf326('0xc')](_0x59fca8)['end']();};}function respondWithResult(_0x169311,_0x18fc24){_0x18fc24=_0x18fc24||0xc8;return function(_0x5c3058){if(_0x5c3058){return _0x169311[_0xf326('0xc')](_0x18fc24)[_0xf326('0xd')](_0x5c3058);}};}function respondWithFilteredResult(_0x2dd2e1,_0x40008f){return function(_0x5dcd59){if(_0x5dcd59){var _0x57e76c=typeof _0x40008f[_0xf326('0xe')]===_0xf326('0xf')&&typeof _0x40008f[_0xf326('0x10')]===_0xf326('0xf');var _0x4e3405=_0x5dcd59[_0xf326('0x11')];var _0x33987e=_0x57e76c?0x0:_0x40008f[_0xf326('0xe')];var _0x5efa5e=_0x57e76c?_0x5dcd59[_0xf326('0x11')]:_0x40008f[_0xf326('0xe')]+_0x40008f['limit'];var _0x33f1ca;if(_0x5efa5e>=_0x4e3405){_0x5efa5e=_0x4e3405;_0x33f1ca=0xc8;}else{_0x33f1ca=0xce;}_0x2dd2e1[_0xf326('0xc')](_0x33f1ca);return _0x2dd2e1[_0xf326('0x12')](_0xf326('0x13'),_0x33987e+'-'+_0x5efa5e+'/'+_0x4e3405)[_0xf326('0xd')](_0x5dcd59);}return null;};}function removeEntity(_0x59d7d2){return function(_0x209c67){if(_0x209c67){return _0x209c67[_0xf326('0x14')]()[_0xf326('0x15')](function(){var _0x47b47f=_0x209c67[_0xf326('0x16')]({'plain':!![]});var _0x308868=[{'name':'InboundRoutes','value':_0xf326('0x17'),'ignore':![]},{'name':'OutboundRoutes','value':_0xf326('0x18'),'ignore':![]},{'name':_0xf326('0x19'),'value':_0xf326('0x1a'),'ignore':![]}];var _0x5b7c00=_(_0x308868)[_0xf326('0x1b')]('ignore')[_0xf326('0x1c')](_0xf326('0x1d'))[_0xf326('0x1d')]();if(_['includes'](_0x5b7c00,_0x47b47f[_0xf326('0x1e')])){return;}var _0x5f1fec=_[_0xf326('0x1f')](_0x308868,[_0xf326('0x1d'),_0x47b47f[_0xf326('0x1e')]])[_0xf326('0x20')];return db[_0xf326('0x21')]['destroy']({'where':{'type':_0x5f1fec,'resourceId':_0x47b47f['id']}})[_0xf326('0x15')](function(){return _0x209c67;});})[_0xf326('0x15')](function(){_0x59d7d2[_0xf326('0xc')](0xcc)['end']();});}};}function handleEntityNotFound(_0x73bf83){return function(_0x120518){if(!_0x120518){_0x73bf83[_0xf326('0x22')](0x194);}return _0x120518;};}function handleError(_0x32f499,_0x5b015d){_0x5b015d=_0x5b015d||0x1f4;return function(_0x297ffa){logger[_0xf326('0x23')](_0x297ffa[_0xf326('0x24')]);if(_0x297ffa[_0xf326('0x20')]){delete _0x297ffa[_0xf326('0x20')];}_0x32f499['status'](_0x5b015d)['send'](_0x297ffa);};}exports['index']=function(_0x20f092,_0x886ce2){var _0x1718b0={},_0x5e85ae={},_0x287e62={'count':0x0,'rows':[]};var _0x19449e=_['map'](db[_0xf326('0x25')][_0xf326('0x26')],function(_0x26c248){return{'name':_0x26c248[_0xf326('0x27')],'type':_0x26c248['type'][_0xf326('0x28')]};});_0x5e85ae['model']=_['map'](_0x19449e,_0xf326('0x20'));_0x5e85ae['query']=_[_0xf326('0x29')](_0x20f092[_0xf326('0x2a')]);_0x5e85ae[_0xf326('0x2b')]=_[_0xf326('0x2c')](_0x5e85ae[_0xf326('0x2d')],_0x5e85ae[_0xf326('0x2a')]);_0x1718b0['attributes']=_[_0xf326('0x2c')](_0x5e85ae[_0xf326('0x2d')],qs[_0xf326('0x2e')](_0x20f092[_0xf326('0x2a')]['fields']));_0x1718b0[_0xf326('0x2f')]=_0x1718b0[_0xf326('0x2f')][_0xf326('0x30')]?_0x1718b0['attributes']:_0x5e85ae['model'];if(!_0x20f092[_0xf326('0x2a')]['hasOwnProperty']('nolimit')){_0x1718b0[_0xf326('0x10')]=qs[_0xf326('0x10')](_0x20f092[_0xf326('0x2a')][_0xf326('0x10')]);_0x1718b0[_0xf326('0xe')]=qs[_0xf326('0xe')](_0x20f092[_0xf326('0x2a')][_0xf326('0xe')]);}_0x1718b0[_0xf326('0x31')]=qs['sort'](_0x20f092[_0xf326('0x2a')][_0xf326('0x32')]);_0x1718b0[_0xf326('0x33')]=qs['filters'](_[_0xf326('0x34')](_0x20f092[_0xf326('0x2a')],_0x5e85ae[_0xf326('0x2b')]),_0x19449e);if(_0x20f092[_0xf326('0x2a')][_0xf326('0x1b')]){_0x1718b0['where']=_['merge'](_0x1718b0['where'],{'$or':_['map'](_0x19449e,function(_0x1e85b1){if(_0x1e85b1['type']!==_0xf326('0x35')){var _0x206c30={};_0x206c30[_0x1e85b1[_0xf326('0x20')]]={'$like':'%'+_0x20f092['query'][_0xf326('0x1b')]+'%'};return _0x206c30;}})});}_0x1718b0=_[_0xf326('0x36')]({},_0x1718b0,_0x20f092[_0xf326('0x37')]);var _0x4d6c5a={'where':_0x1718b0['where']};return db['VoiceExtension'][_0xf326('0x11')](_0x4d6c5a)['then'](function(_0x308980){_0x287e62[_0xf326('0x11')]=_0x308980;if(_0x20f092[_0xf326('0x2a')]['includeAll']){_0x1718b0[_0xf326('0x38')]=[{'all':!![]}];}return db[_0xf326('0x25')][_0xf326('0x39')](_0x1718b0);})['then'](function(_0x14f1a7){_0x287e62['rows']=_0x14f1a7;return _0x287e62;})[_0xf326('0x15')](respondWithFilteredResult(_0x886ce2,_0x1718b0))[_0xf326('0x3a')](handleError(_0x886ce2,null));};exports['show']=function(_0x4d0640,_0x4e9e14){var _0xc1a1e4={'raw':![],'where':{'id':_0x4d0640[_0xf326('0x3b')]['id']}},_0x567050={};_0x567050[_0xf326('0x2d')]=_['keys'](db[_0xf326('0x25')][_0xf326('0x26')]);_0x567050['query']=_['keys'](_0x4d0640[_0xf326('0x2a')]);_0x567050[_0xf326('0x2b')]=_['intersection'](_0x567050[_0xf326('0x2d')],_0x567050['query']);_0xc1a1e4[_0xf326('0x2f')]=_[_0xf326('0x2c')](_0x567050[_0xf326('0x2d')],qs['fields'](_0x4d0640[_0xf326('0x2a')]['fields']));_0xc1a1e4[_0xf326('0x2f')]=_0xc1a1e4[_0xf326('0x2f')][_0xf326('0x30')]?_0xc1a1e4['attributes']:_0x567050[_0xf326('0x2d')];if(_0x4d0640[_0xf326('0x2a')]['includeAll']){_0xc1a1e4['include']=[{'all':!![]}];}_0xc1a1e4=_[_0xf326('0x36')]({},_0xc1a1e4,_0x4d0640['options']);return db[_0xf326('0x25')]['find'](_0xc1a1e4)[_0xf326('0x15')](handleEntityNotFound(_0x4e9e14,null))['then'](respondWithResult(_0x4e9e14,null))[_0xf326('0x3a')](handleError(_0x4e9e14,null));};exports[_0xf326('0x14')]=function(_0x1ec127,_0x24ebd7){return db[_0xf326('0x25')][_0xf326('0x1f')]({'where':{'id':_0x1ec127[_0xf326('0x3b')]['id']}})[_0xf326('0x15')](handleEntityNotFound(_0x24ebd7,null))['then'](removeEntity(_0x24ebd7,null))[_0xf326('0x3a')](handleError(_0x24ebd7,null));};exports[_0xf326('0x3c')]=function(_0x537e41,_0x3d27f1){if(_0x537e41['body'][_0xf326('0x1e')]===_0xf326('0x18')&&!_[_0xf326('0x3d')](_0x537e41[_0xf326('0x3e')]['exten'],'_')){_0x537e41[_0xf326('0x3e')]['exten']='_'[_0xf326('0x3f')](_0x537e41[_0xf326('0x3e')]['exten']);}return db[_0xf326('0x25')][_0xf326('0x3c')](_0x537e41[_0xf326('0x3e')],{'raw':![]})[_0xf326('0x15')](function(_0x297806){var _0x5744a4=_0x537e41[_0xf326('0x40')][_0xf326('0x16')]({'plain':!![]});if(!_0x5744a4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5744a4[_0xf326('0x41')]===_0xf326('0x40')){var _0x2f4e15=_0x297806[_0xf326('0x16')]({'plain':!![]});var _0xe2dbf1=[{'name':_0xf326('0x42'),'value':_0xf326('0x17')},{'name':'OutboundRoutes','value':_0xf326('0x18')},{'name':_0xf326('0x19'),'value':'internal'}];var _0x4eabda=_[_0xf326('0x1f')](_0xe2dbf1,[_0xf326('0x1d'),_0x2f4e15[_0xf326('0x1e')]])[_0xf326('0x20')];return db[_0xf326('0x43')][_0xf326('0x1f')]({'where':{'name':_0x4eabda,'userProfileId':_0x5744a4[_0xf326('0x44')]},'raw':!![]})[_0xf326('0x15')](function(_0x19f53b){if(_0x19f53b&&_0x19f53b[_0xf326('0x45')]===0x0){return db[_0xf326('0x21')][_0xf326('0x3c')]({'name':_0x2f4e15['name'],'resourceId':_0x2f4e15['id'],'type':_0x19f53b[_0xf326('0x20')],'sectionId':_0x19f53b['id']},{})[_0xf326('0x15')](function(){return _0x297806;});}else{return _0x297806;}})[_0xf326('0x3a')](function(_0x349f77){logger[_0xf326('0x23')](_0xf326('0x46'),_0x349f77);throw _0x349f77;});}return _0x297806;})[_0xf326('0x15')](respondWithResult(_0x3d27f1,0xc9))[_0xf326('0x3a')](handleError(_0x3d27f1,null));};exports[_0xf326('0x47')]=function(_0x33629e,_0x47bb69){if(_0x33629e[_0xf326('0x3e')]['id']){delete _0x33629e[_0xf326('0x3e')]['id'];}return db[_0xf326('0x25')][_0xf326('0x1f')]({'where':{'id':_0x33629e[_0xf326('0x3b')]['id']}})[_0xf326('0x15')](handleEntityNotFound(_0x47bb69,null))[_0xf326('0x15')](function(_0x58f3eb){if(_0x58f3eb){return db[_0xf326('0x25')]['update'](_[_0xf326('0x34')](_0x33629e['body'],[_0xf326('0x48'),_0xf326('0x49'),'description',_0xf326('0x4a'),'cutdigits',_0xf326('0x4b'),_0xf326('0x4c')]),{'where':{'context':_0x58f3eb[_0xf326('0x49')],'exten':_0x58f3eb['exten']},'individualHooks':!![]})[_0xf326('0x15')](function(_0x37c8e2){return _0x37c8e2;});}return null;})[_0xf326('0x15')](respondWithStatusCode(_0x47bb69,null))['catch'](handleError(_0x47bb69,null));};exports[_0xf326('0x4d')]=function(_0x48833b,_0x21575d){var _0x49fe3a=_0x48833b['params']['id'];var _0x54a512=_0x48833b['body'];var _0x351711=0xc8;var _0x2588b4=null;return db[_0xf326('0x4e')][_0xf326('0x4f')]({'isolationLevel':db[_0xf326('0x4e')]['Transaction']['ISOLATION_LEVELS'][_0xf326('0x50')]},function(_0x131756){return db[_0xf326('0x25')][_0xf326('0x51')]({'where':{'id':_0x49fe3a},'transaction':_0x131756})[_0xf326('0x15')](function(_0x360cce){if(_0x360cce){return db[_0xf326('0x25')]['destroy']({'where':{'VoiceExtensionId':_0x49fe3a},'transaction':_0x131756})[_0xf326('0x15')](function(){var _0x185958=_[_0xf326('0x1c')](_0x54a512,function(_0x129930){_0x129930[_0xf326('0x52')]=_0x49fe3a;_0x129930[_0xf326('0x53')]=!![];return _0x129930;});return _0x360cce[_0xf326('0x54')](_0x185958);})['then'](function(_0x1fc2af){return db['VoiceExtension'][_0xf326('0x55')](_0x1fc2af,{'transaction':_0x131756});});}else{_0x351711=0x194;_0x2588b4=[];}});})[_0xf326('0x15')](function(){if(_0x351711!==0x194){return db[_0xf326('0x25')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x49fe3a},'order':_0xf326('0x56')})[_0xf326('0x15')](function(_0x3ea17d){_0x2588b4=_0x3ea17d;});}})[_0xf326('0x3a')](function(_0x4ad430){_0x351711=0x1f4;logger['error'](_0x4ad430['stack']);if(_0x4ad430[_0xf326('0x20')]){delete _0x4ad430['name'];}_0x2588b4=_0x4ad430;})[_0xf326('0x57')](function(){if(_0x2588b4===null){_0x21575d[_0xf326('0x22')](_0x351711);}else{if(_0x351711===0x1f4){_0x21575d['status'](_0x351711)[_0xf326('0x58')](_0x2588b4);}else{_0x21575d['status'](_0x351711)[_0xf326('0xd')](_0x2588b4);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 56db2b6..06c89e8 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 _0x23a5=['events','../../mysqldb','VoiceExtension','setMaxListeners','save','update','emit','hook'];(function(_0x246ec6,_0x33f7e2){var _0xf4f48d=function(_0x6ba926){while(--_0x6ba926){_0x246ec6['push'](_0x246ec6['shift']());}};_0xf4f48d(++_0x33f7e2);}(_0x23a5,0xa8));var _0x523a=function(_0x32d1a9,_0x1b470c){_0x32d1a9=_0x32d1a9-0x0;var _0x50eaf1=_0x23a5[_0x32d1a9];return _0x50eaf1;};'use strict';var EventEmitter=require(_0x523a('0x0'));var VoiceExtension=require(_0x523a('0x1'))['db'][_0x523a('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x523a('0x3')](0x0);var events={'afterCreate':_0x523a('0x4'),'afterUpdate':_0x523a('0x5'),'afterDestroy':'remove'};function emitEvent(_0xc837c0){return function(_0x1a9c73,_0x3d3888,_0x238350){VoiceExtensionEvents[_0x523a('0x6')](_0xc837c0+':'+_0x1a9c73['id'],_0x1a9c73);VoiceExtensionEvents['emit'](_0xc837c0,_0x1a9c73);_0x238350(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x523a('0x7')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file +var _0x254e=['save','remove','emit','hook','exports','events','setMaxListeners'];(function(_0x5bc8f5,_0x4a9430){var _0x22870a=function(_0x1c060a){while(--_0x1c060a){_0x5bc8f5['push'](_0x5bc8f5['shift']());}};_0x22870a(++_0x4a9430);}(_0x254e,0xb4));var _0xe254=function(_0x20252e,_0x2d9150){_0x20252e=_0x20252e-0x0;var _0x15b796=_0x254e[_0x20252e];return _0x15b796;};'use strict';var EventEmitter=require(_0xe254('0x0'));var VoiceExtension=require('../../mysqldb')['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xe254('0x1')](0x0);var events={'afterCreate':_0xe254('0x2'),'afterUpdate':'update','afterDestroy':_0xe254('0x3')};function emitEvent(_0x330044){return function(_0x2692c7,_0x3ba90b,_0x4cad1f){VoiceExtensionEvents[_0xe254('0x4')](_0x330044+':'+_0x2692c7['id'],_0x2692c7);VoiceExtensionEvents[_0xe254('0x4')](_0x330044,_0x2692c7);_0x4cad1f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0xe254('0x5')](e,emitEvent(event));}}module[_0xe254('0x6')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 80dfc6a..e3bcd78 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 _0xfb82=['XCALLY-MOTION-ANSWER=0','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','url','length','name','param','split','prefix','phone','${EXTEN:','join','options','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','findAll','interval','then','intervals','map','filter','IntervalId','toLowerCase','tag','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','NoOp(No\x20number\x20available)','queue','playback','app','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appType','outboundDial','appdata','priority','last','concat','VoiceExtension','voice_extensions','get','lodash','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context','exten','NoOp','alias','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0xfb82,0x17f));var _0x2fb8=function(_0x4ab2ff,_0x32dac1){_0x4ab2ff=_0x4ab2ff-0x0;var _0x3e66d1=_0xfb82[_0x4ab2ff];return _0x3e66d1;};'use strict';var _=require(_0x2fb8('0x0'));var attributes=require(_0x2fb8('0x1'));module[_0x2fb8('0x2')]=function(_0x5893e0){var _0x316a4d=_0x5893e0[_0x2fb8('0x3')];function _0x50aa53(_0x283c81){var _0x8d8257=0x2;var _0x34535f=[{'type':_0x283c81[_0x2fb8('0x4')],'app':_0x2fb8('0x5'),'appdata':_0x2fb8('0x6')+_0x283c81[_0x2fb8('0x4')],'context':_0x283c81[_0x2fb8('0x7')],'exten':_0x283c81[_0x2fb8('0x8')],'priority':_0x8d8257++,'VoiceExtensionId':_0x283c81['id']},{'type':_0x283c81[_0x2fb8('0x4')],'app':_0x283c81['alias']?_0x2fb8('0x5'):_0x2fb8('0x9'),'appdata':_0x283c81[_0x2fb8('0xa')]?_0x2fb8('0xb')+_0x283c81[_0x2fb8('0xa')]:_0x2fb8('0xc'),'context':_0x283c81[_0x2fb8('0x7')],'exten':_0x283c81[_0x2fb8('0x8')],'priority':_0x8d8257++,'VoiceExtensionId':_0x283c81['id']}];if(_0x283c81[_0x2fb8('0x4')]===_0x2fb8('0xd')){_0x34535f[_0x2fb8('0xe')]({'type':'inbound','app':_0x2fb8('0x5'),'appdata':_0x2fb8('0xf')+_0x283c81['id'],'context':_0x283c81[_0x2fb8('0x7')],'exten':_0x283c81[_0x2fb8('0x8')],'priority':_0x8d8257++,'VoiceExtensionId':_0x283c81['id']});}_0x34535f['push']({'type':_0x283c81['type'],'app':_0x2fb8('0x5'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x283c81[_0x2fb8('0x7')],'exten':_0x283c81[_0x2fb8('0x8')],'priority':_0x8d8257++,'VoiceExtensionId':_0x283c81['id']},{'type':_0x283c81['type'],'app':_0x2fb8('0x5'),'appdata':_0x2fb8('0x10'),'context':_0x283c81['context'],'exten':_0x283c81['exten'],'priority':_0x8d8257++,'VoiceExtensionId':_0x283c81['id']},{'type':_0x283c81[_0x2fb8('0x4')],'app':_0x2fb8('0x5'),'appdata':_0x2fb8('0x11'),'context':_0x283c81[_0x2fb8('0x7')],'exten':_0x283c81['exten'],'priority':_0x8d8257++,'VoiceExtensionId':_0x283c81['id']});return _0x34535f;}function _0x3fda1b(_0x34f43b){var _0x48296c=0x2;var _0x2f532f=[{'type':_0x2fb8('0x12'),'app':_0x2fb8('0x5'),'appdata':'CDR(type)=outbound','context':_0x34f43b['context'],'exten':_0x34f43b[_0x2fb8('0x8')],'priority':_0x48296c++,'VoiceExtensionId':_0x34f43b['id']},{'type':_0x2fb8('0x12'),'app':_0x34f43b[_0x2fb8('0xa')]?_0x2fb8('0x5'):'NoOp','appdata':_0x34f43b[_0x2fb8('0xa')]?_0x2fb8('0xb')+_0x34f43b[_0x2fb8('0xa')]:_0x2fb8('0xc'),'context':_0x34f43b[_0x2fb8('0x7')],'exten':_0x34f43b['exten'],'priority':_0x48296c++,'VoiceExtensionId':_0x34f43b['id']},{'type':_0x2fb8('0x12'),'app':_0x2fb8('0x5'),'appdata':_0x2fb8('0x13')+(_0x34f43b['cutdigits']?'${EXTEN:'+_0x34f43b[_0x2fb8('0x14')]+'}':_0x2fb8('0x15')),'context':_0x34f43b[_0x2fb8('0x7')],'exten':_0x34f43b[_0x2fb8('0x8')],'priority':_0x48296c++,'VoiceExtensionId':_0x34f43b['id']},{'type':_0x2fb8('0x12'),'app':'Set','appdata':_0x2fb8('0xf')+_0x34f43b['id'],'context':_0x34f43b[_0x2fb8('0x7')],'exten':_0x34f43b[_0x2fb8('0x8')],'priority':_0x48296c++,'VoiceExtensionId':_0x34f43b['id']},{'type':_0x2fb8('0x12'),'app':_0x2fb8('0x16'),'appdata':_0x2fb8('0x17')+(_0x48296c+0x2)+_0x2fb8('0x18')+(_0x48296c+0x1)+')','context':_0x34f43b['context'],'exten':_0x34f43b[_0x2fb8('0x8')],'priority':_0x48296c++,'VoiceExtensionId':_0x34f43b['id']},{'type':'outbound','app':_0x2fb8('0x5'),'appdata':_0x34f43b[_0x2fb8('0x14')]?_0x2fb8('0x19')+_0x34f43b[_0x2fb8('0x14')]+'}':_0x2fb8('0x1a'),'context':_0x34f43b[_0x2fb8('0x7')],'exten':_0x34f43b[_0x2fb8('0x8')],'priority':_0x48296c++,'VoiceExtensionId':_0x34f43b['id']},{'type':_0x2fb8('0x12'),'app':_0x2fb8('0x5'),'appdata':_0x2fb8('0x1b'),'context':_0x34f43b[_0x2fb8('0x7')],'exten':_0x34f43b[_0x2fb8('0x8')],'priority':_0x48296c++,'VoiceExtensionId':_0x34f43b['id']},{'type':_0x2fb8('0x12'),'app':_0x2fb8('0x5'),'appdata':_0x2fb8('0x10'),'context':_0x34f43b[_0x2fb8('0x7')],'exten':_0x34f43b['exten'],'priority':_0x48296c++,'VoiceExtensionId':_0x34f43b['id']},{'type':'outbound','app':_0x2fb8('0x5'),'appdata':_0x2fb8('0x11'),'context':_0x34f43b['context'],'exten':_0x34f43b['exten'],'priority':_0x48296c++,'VoiceExtensionId':_0x34f43b['id']},{'type':_0x2fb8('0x12'),'app':'Set','appdata':'outboundrouteid='+_0x34f43b['id'],'context':_0x34f43b[_0x2fb8('0x7')],'exten':_0x34f43b[_0x2fb8('0x8')],'priority':_0x48296c++,'VoiceExtensionId':_0x34f43b['id']}];if(_0x34f43b[_0x2fb8('0x1c')](_0x2fb8('0x1d'))&&_0x34f43b[_0x2fb8('0x1d')]!==_0x2fb8('0x1e')){_0x2f532f[_0x2fb8('0xe')]({'type':_0x2fb8('0x12'),'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x34f43b[_0x2fb8('0x7')],'exten':_0x34f43b[_0x2fb8('0x8')],'priority':_0x48296c++,'VoiceExtensionId':_0x34f43b['id']},{'type':_0x2fb8('0x12'),'app':_0x2fb8('0x5'),'appdata':_0x2fb8('0x1f')+_0x34f43b[_0x2fb8('0x1d')]||_0x2fb8('0x20'),'context':_0x34f43b['context'],'exten':_0x34f43b[_0x2fb8('0x8')],'priority':_0x48296c++,'VoiceExtensionId':_0x34f43b['id']});}return _0x2f532f;}function _0x12ca46(_0x4602cf,_0x161287){var _0x3b36aa=[{'name':_0x2fb8('0x21'),'param':0x0},{'name':_0x2fb8('0x22'),'param':0x1},{'name':'options','param':0x2},{'name':_0x2fb8('0x23'),'param':0x3}];var _0x771f56={};var _0xcc86cd=_0x161287['split'](',');var _0x2c068f=[];for(var _0x151abb=0x0;_0x151abb<_0x3b36aa[_0x2fb8('0x24')];_0x151abb++){switch(_0x3b36aa[_0x151abb][_0x2fb8('0x25')]){case _0x2fb8('0x21'):_0x771f56['trunk']=_0xcc86cd[_0x3b36aa[_0x151abb][_0x2fb8('0x26')]][_0x2fb8('0x27')]('/')[0x1];_0x771f56['phone']=_0xcc86cd[_0x3b36aa[_0x151abb]['param']][_0x2fb8('0x27')]('/')[0x2];_0x771f56[_0x2fb8('0x28')]=_0x771f56[_0x2fb8('0x29')]?_0x771f56['phone'][_0x2fb8('0x27')]('$')[0x0]:undefined;_0x771f56['phone']=_0x4602cf[_0x2fb8('0x14')]?(_0x771f56[_0x2fb8('0x28')]||'')+_0x2fb8('0x2a')+_0x4602cf[_0x2fb8('0x14')]+'}':(_0x771f56[_0x2fb8('0x28')]||'')+_0x2fb8('0x15');_0x2c068f[_0x3b36aa[_0x151abb]['param']]=['SIP',_0x771f56[_0x2fb8('0x21')],_0x771f56[_0x2fb8('0x29')]][_0x2fb8('0x2b')]('/');break;case _0x2fb8('0x2c'):_0x771f56[_0x2fb8('0x2c')]=_0xcc86cd[_0x3b36aa[_0x151abb][_0x2fb8('0x26')]];if(_0x4602cf['recordingFormat']!==_0x2fb8('0x1e')){if(_0x771f56[_0x2fb8('0x2c')][_0x2fb8('0x2d')](_0x2fb8('0x2e'))<0x0){_0x771f56[_0x2fb8('0x2c')]+='U(xcally-mixmonitor-context)';}}else{_0x771f56['options']=_0x771f56['options'][_0x2fb8('0x2f')]('U(xcally-mixmonitor-context)','');}_0x2c068f[_0x3b36aa[_0x151abb][_0x2fb8('0x26')]]=_0x771f56['options'];break;default:_0x2c068f[_0x3b36aa[_0x151abb][_0x2fb8('0x26')]]=_0xcc86cd[_0x3b36aa[_0x151abb][_0x2fb8('0x26')]];}}return _0x2c068f[_0x2fb8('0x2b')](',');}function _0x28cff5(_0x4f35da,_0x313eb5,_0x237119){return new Promise(function(_0x495c91,_0x17d967){var _0x45c638=[];if(_[_0x2fb8('0x30')](_0x313eb5))return _0x495c91(_0x45c638);_0x316a4d['Interval'][_0x2fb8('0x31')]({'attributes':['id',_0x2fb8('0x32'),'IntervalId'],'raw':!![]})[_0x2fb8('0x33')](function(_0x3ff92e){for(var _0x129796=0x0,_0x10f352=0x0;_0x129796<_0x313eb5[_0x2fb8('0x24')];_0x129796++,_0x10f352=0x0){var _0x10277d=_0x313eb5[_0x129796];var _0x14d224=[];var _0x4d5de9=[];delete _0x10277d['id'];if(_0x10277d[_0x2fb8('0x32')]!=='*,*,*,*'){_0x10277d[_0x2fb8('0x34')]=[_0x10277d[_0x2fb8('0x32')]];}else{_0x10277d[_0x2fb8('0x34')]=_0x10277d['IntervalId']?_[_0x2fb8('0x35')](_[_0x2fb8('0x36')](_0x3ff92e,{'IntervalId':_0x10277d[_0x2fb8('0x37')]}),_0x2fb8('0x32')):[];}_0x10277d[_0x2fb8('0x7')]=_0x4f35da[_0x2fb8('0x7')];_0x10277d[_0x2fb8('0x8')]=_0x4f35da[_0x2fb8('0x8')];if(_0x10277d[_0x2fb8('0x4')])_0x10277d[_0x2fb8('0x4')]=_0x10277d[_0x2fb8('0x4')][_0x2fb8('0x38')]();if(_0x4f35da[_0x2fb8('0x4')]===_0x2fb8('0x12')){if(_0x10277d[_0x2fb8('0x1c')](_0x2fb8('0x39'))&&_0x10277d[_0x2fb8('0x39')]&&_0x10277d['tag']!=='--'){_0x14d224[_0x2fb8('0xe')]({'type':_0x10277d[_0x2fb8('0x4')][_0x2fb8('0x38')](),'app':_0x2fb8('0x5'),'appdata':'CDR(tag)='+_0x10277d[_0x2fb8('0x39')],'context':_0x4f35da[_0x2fb8('0x7')],'exten':_0x4f35da['exten'],'priority':_0x10277d[_0x2fb8('0x34')]['length']+_0x237119+_0x10f352++,'VoiceExtensionId':_0x4f35da['id']});}_0x14d224[_0x2fb8('0xe')]({'type':_0x10277d[_0x2fb8('0x4')][_0x2fb8('0x38')](),'app':_0x2fb8('0x16'),'appdata':_0x2fb8('0x3a')+(_0x10277d[_0x2fb8('0x3b')]?'Set(CALLERID(all)='+_0x10277d['callerID']+')':_0x2fb8('0x3c')),'context':_0x4f35da['context'],'exten':_0x4f35da[_0x2fb8('0x8')],'priority':_0x10277d[_0x2fb8('0x34')][_0x2fb8('0x24')]+_0x237119+_0x10f352++,'VoiceExtensionId':_0x4f35da['id']});}else{if(_0x10277d['hasOwnProperty']('answer')){if([_0x2fb8('0x3d'),_0x2fb8('0x3e')]['includes'](_0x10277d[_0x2fb8('0x3f')][_0x2fb8('0x38')]())&&_0x10277d['appType']!==_0x2fb8('0x40')){if(_0x10277d[_0x2fb8('0x41')]){_0x14d224[_0x2fb8('0xe')]({'type':_0x10277d[_0x2fb8('0x4')][_0x2fb8('0x38')](),'app':_0x2fb8('0x16'),'appdata':_0x2fb8('0x42'),'context':_0x4f35da[_0x2fb8('0x7')],'exten':_0x4f35da[_0x2fb8('0x8')],'priority':_0x10277d[_0x2fb8('0x34')][_0x2fb8('0x24')]+_0x237119+_0x10f352++,'VoiceExtensionId':_0x4f35da['id']});_0x14d224['push']({'type':_0x10277d['type'][_0x2fb8('0x38')](),'app':_0x2fb8('0x5'),'appdata':_0x2fb8('0x43'),'context':_0x4f35da[_0x2fb8('0x7')],'exten':_0x4f35da[_0x2fb8('0x8')],'priority':_0x10277d[_0x2fb8('0x34')][_0x2fb8('0x24')]+_0x237119+_0x10f352++,'VoiceExtensionId':_0x4f35da['id']});}else{_0x14d224['push']({'type':_0x10277d[_0x2fb8('0x4')][_0x2fb8('0x38')](),'app':_0x2fb8('0x16'),'appdata':_0x2fb8('0x44'),'context':_0x4f35da['context'],'exten':_0x4f35da[_0x2fb8('0x8')],'priority':_0x10277d[_0x2fb8('0x34')]['length']+_0x237119+_0x10f352++,'VoiceExtensionId':_0x4f35da['id']});_0x14d224[_0x2fb8('0xe')]({'type':_0x10277d[_0x2fb8('0x4')]['toLowerCase'](),'app':_0x2fb8('0x5'),'appdata':_0x2fb8('0x45'),'context':_0x4f35da['context'],'exten':_0x4f35da['exten'],'priority':_0x10277d['intervals'][_0x2fb8('0x24')]+_0x237119+_0x10f352++,'VoiceExtensionId':_0x4f35da['id']});}}}}for(var _0x4eb237=0x0;_0x4eb237<_0x10277d[_0x2fb8('0x34')][_0x2fb8('0x24')];_0x4eb237++){var _0x4f98b5=_0x237119+_0x10277d[_0x2fb8('0x34')][_0x2fb8('0x24')];var _0x478401=_0x4eb237===_0x10277d[_0x2fb8('0x34')]['length']-0x1?_0x237119+_0x14d224[_0x2fb8('0x24')]+_0x4d5de9[_0x2fb8('0x24')]+0x2:_0x237119+_0x4eb237+0x1;_0x14d224[_0x2fb8('0x46')](_0x4eb237,0x0,{'type':_0x4f35da[_0x2fb8('0x4')],'app':_0x2fb8('0x47'),'appdata':_0x10277d[_0x2fb8('0x34')][_0x4eb237]+'?'+_0x4f35da[_0x2fb8('0x7')]+_0x2fb8('0x48')+_0x4f98b5+':'+_0x4f35da[_0x2fb8('0x7')]+',${EXTEN},'+_0x478401,'exten':_0x4f35da[_0x2fb8('0x8')],'context':_0x4f35da[_0x2fb8('0x7')],'priority':_0x237119+_0x4eb237,'VoiceExtensionId':_0x4f35da['id']});}if(_0x10277d[_0x2fb8('0x49')]===_0x2fb8('0x4a'))_0x10277d['appdata']=_0x12ca46(_0x4f35da,_0x10277d[_0x2fb8('0x4b')]);_0x10277d[_0x2fb8('0x4c')]=_0x14d224['length']?_[_0x2fb8('0x4d')](_0x14d224)[_0x2fb8('0x4c')]+0x1:_0x237119;_0x45c638=_[_0x2fb8('0x4e')](_0x45c638,_0x14d224,[_0x10277d],_0x4d5de9);_0x237119=_['last'](_0x45c638)[_0x2fb8('0x4c')]+0x1;}return _0x495c91(_0x45c638);})['catch'](function(_0x6131fe){_0x17d967(_0x6131fe);});});}return _0x5893e0['define'](_0x2fb8('0x4f'),attributes,{'tableName':_0x2fb8('0x50'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x36a912){var _0x48903c=this[_0x2fb8('0x51')]({'plain':!![]});var _0x534e75=_0x48903c['type']===_0x2fb8('0x12')?_0x3fda1b(_0x48903c):_0x50aa53(_0x48903c);return _0x28cff5(_0x48903c,_0x36a912,_[_0x2fb8('0x4d')](_0x534e75)[_0x2fb8('0x4c')]+0x1)[_0x2fb8('0x33')](function(_0x41d9b){var _0x53c6af=_[_0x2fb8('0x4e')](_0x534e75,_0x41d9b);_0x53c6af['push']({'type':_0x48903c['type'],'app':'Hangup','exten':_0x48903c[_0x2fb8('0x8')],'context':_0x48903c['context'],'priority':_[_0x2fb8('0x4d')](_0x53c6af)[_0x2fb8('0x4c')]+0x1,'VoiceExtensionId':_0x48903c['id']});return _0x53c6af;});}}});}; \ No newline at end of file +var _0xcc30=['lodash','./voiceExtension.attributes','Set','CDR(type)=','type','context','exten','alias','NoOp','CDR(routeAlias)=','inbound','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','No\x20alias\x20set','CDR(destination)=','cutdigits','${EXTEN}','CDR(routeid)=','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','none','_XCALLY_MIXMONITOR_FORMAT=','recordingFormat','wav','trunk','timeout','url','split','name','param','phone','prefix','${EXTEN:','SIP','join','options','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','IntervalId','then','intervals','map','filter','toLowerCase','tag','length','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','hasOwnProperty','answer','queue','playback','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime','outboundDial','appdata','last','priority','concat','catch','define','VoiceExtension','voice_extensions','get'];(function(_0x2a5435,_0xce7d58){var _0x3213bf=function(_0x3cf333){while(--_0x3cf333){_0x2a5435['push'](_0x2a5435['shift']());}};_0x3213bf(++_0xce7d58);}(_0xcc30,0x1a9));var _0x0cc3=function(_0x29df9a,_0x42aff3){_0x29df9a=_0x29df9a-0x0;var _0x3a8e96=_0xcc30[_0x29df9a];return _0x3a8e96;};'use strict';var _=require(_0x0cc3('0x0'));var attributes=require(_0x0cc3('0x1'));module['exports']=function(_0xe2cd51){var _0x383a20=_0xe2cd51['models'];function _0x302798(_0x2382e3){var _0x2ea6a4=0x2;var _0x3191b1=[{'type':_0x2382e3['type'],'app':_0x0cc3('0x2'),'appdata':_0x0cc3('0x3')+_0x2382e3[_0x0cc3('0x4')],'context':_0x2382e3[_0x0cc3('0x5')],'exten':_0x2382e3[_0x0cc3('0x6')],'priority':_0x2ea6a4++,'VoiceExtensionId':_0x2382e3['id']},{'type':_0x2382e3[_0x0cc3('0x4')],'app':_0x2382e3[_0x0cc3('0x7')]?'Set':_0x0cc3('0x8'),'appdata':_0x2382e3[_0x0cc3('0x7')]?_0x0cc3('0x9')+_0x2382e3[_0x0cc3('0x7')]:'No\x20alias\x20set','context':_0x2382e3['context'],'exten':_0x2382e3[_0x0cc3('0x6')],'priority':_0x2ea6a4++,'VoiceExtensionId':_0x2382e3['id']}];if(_0x2382e3[_0x0cc3('0x4')]===_0x0cc3('0xa')){_0x3191b1['push']({'type':'inbound','app':_0x0cc3('0x2'),'appdata':'CDR(routeid)='+_0x2382e3['id'],'context':_0x2382e3[_0x0cc3('0x5')],'exten':_0x2382e3[_0x0cc3('0x6')],'priority':_0x2ea6a4++,'VoiceExtensionId':_0x2382e3['id']});}_0x3191b1[_0x0cc3('0xb')]({'type':_0x2382e3[_0x0cc3('0x4')],'app':'Set','appdata':_0x0cc3('0xc'),'context':_0x2382e3[_0x0cc3('0x5')],'exten':_0x2382e3[_0x0cc3('0x6')],'priority':_0x2ea6a4++,'VoiceExtensionId':_0x2382e3['id']},{'type':_0x2382e3[_0x0cc3('0x4')],'app':_0x0cc3('0x2'),'appdata':_0x0cc3('0xd'),'context':_0x2382e3['context'],'exten':_0x2382e3[_0x0cc3('0x6')],'priority':_0x2ea6a4++,'VoiceExtensionId':_0x2382e3['id']},{'type':_0x2382e3[_0x0cc3('0x4')],'app':_0x0cc3('0x2'),'appdata':_0x0cc3('0xe'),'context':_0x2382e3[_0x0cc3('0x5')],'exten':_0x2382e3[_0x0cc3('0x6')],'priority':_0x2ea6a4++,'VoiceExtensionId':_0x2382e3['id']});return _0x3191b1;}function _0x1b2056(_0x120881){var _0x3f0caf=0x2;var _0xf231f=[{'type':_0x0cc3('0xf'),'app':'Set','appdata':_0x0cc3('0x10'),'context':_0x120881['context'],'exten':_0x120881['exten'],'priority':_0x3f0caf++,'VoiceExtensionId':_0x120881['id']},{'type':_0x0cc3('0xf'),'app':_0x120881[_0x0cc3('0x7')]?'Set':_0x0cc3('0x8'),'appdata':_0x120881[_0x0cc3('0x7')]?'CDR(routeAlias)='+_0x120881[_0x0cc3('0x7')]:_0x0cc3('0x11'),'context':_0x120881['context'],'exten':_0x120881[_0x0cc3('0x6')],'priority':_0x3f0caf++,'VoiceExtensionId':_0x120881['id']},{'type':_0x0cc3('0xf'),'app':_0x0cc3('0x2'),'appdata':_0x0cc3('0x12')+(_0x120881[_0x0cc3('0x13')]?'${EXTEN:'+_0x120881[_0x0cc3('0x13')]+'}':_0x0cc3('0x14')),'context':_0x120881[_0x0cc3('0x5')],'exten':_0x120881[_0x0cc3('0x6')],'priority':_0x3f0caf++,'VoiceExtensionId':_0x120881['id']},{'type':_0x0cc3('0xf'),'app':'Set','appdata':_0x0cc3('0x15')+_0x120881['id'],'context':_0x120881[_0x0cc3('0x5')],'exten':_0x120881[_0x0cc3('0x6')],'priority':_0x3f0caf++,'VoiceExtensionId':_0x120881['id']},{'type':_0x0cc3('0xf'),'app':'ExecIf','appdata':_0x0cc3('0x16')+(_0x3f0caf+0x2)+_0x0cc3('0x17')+(_0x3f0caf+0x1)+')','context':_0x120881[_0x0cc3('0x5')],'exten':_0x120881[_0x0cc3('0x6')],'priority':_0x3f0caf++,'VoiceExtensionId':_0x120881['id']},{'type':'outbound','app':_0x0cc3('0x2'),'appdata':_0x120881[_0x0cc3('0x13')]?'CDR(prefix)=${EXTEN:0:'+_0x120881[_0x0cc3('0x13')]+'}':_0x0cc3('0x18'),'context':_0x120881[_0x0cc3('0x5')],'exten':_0x120881[_0x0cc3('0x6')],'priority':_0x3f0caf++,'VoiceExtensionId':_0x120881['id']},{'type':_0x0cc3('0xf'),'app':_0x0cc3('0x2'),'appdata':_0x0cc3('0xc'),'context':_0x120881['context'],'exten':_0x120881[_0x0cc3('0x6')],'priority':_0x3f0caf++,'VoiceExtensionId':_0x120881['id']},{'type':_0x0cc3('0xf'),'app':'Set','appdata':_0x0cc3('0xd'),'context':_0x120881[_0x0cc3('0x5')],'exten':_0x120881[_0x0cc3('0x6')],'priority':_0x3f0caf++,'VoiceExtensionId':_0x120881['id']},{'type':'outbound','app':_0x0cc3('0x2'),'appdata':_0x0cc3('0xe'),'context':_0x120881[_0x0cc3('0x5')],'exten':_0x120881[_0x0cc3('0x6')],'priority':_0x3f0caf++,'VoiceExtensionId':_0x120881['id']},{'type':_0x0cc3('0xf'),'app':_0x0cc3('0x2'),'appdata':_0x0cc3('0x19')+_0x120881['id'],'context':_0x120881[_0x0cc3('0x5')],'exten':_0x120881[_0x0cc3('0x6')],'priority':_0x3f0caf++,'VoiceExtensionId':_0x120881['id']}];if(_0x120881['hasOwnProperty']('recordingFormat')&&_0x120881['recordingFormat']!==_0x0cc3('0x1a')){_0xf231f[_0x0cc3('0xb')]({'type':_0x0cc3('0xf'),'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x120881[_0x0cc3('0x5')],'exten':_0x120881[_0x0cc3('0x6')],'priority':_0x3f0caf++,'VoiceExtensionId':_0x120881['id']},{'type':_0x0cc3('0xf'),'app':_0x0cc3('0x2'),'appdata':_0x0cc3('0x1b')+_0x120881[_0x0cc3('0x1c')]||_0x0cc3('0x1d'),'context':_0x120881['context'],'exten':_0x120881[_0x0cc3('0x6')],'priority':_0x3f0caf++,'VoiceExtensionId':_0x120881['id']});}return _0xf231f;}function _0x3b50e9(_0xb1244b,_0x44769a){var _0xd5679f=[{'name':_0x0cc3('0x1e'),'param':0x0},{'name':_0x0cc3('0x1f'),'param':0x1},{'name':'options','param':0x2},{'name':_0x0cc3('0x20'),'param':0x3}];var _0x2e0524={};var _0x8917c2=_0x44769a[_0x0cc3('0x21')](',');var _0x504f62=[];for(var _0x3f66b7=0x0;_0x3f66b7<_0xd5679f['length'];_0x3f66b7++){switch(_0xd5679f[_0x3f66b7][_0x0cc3('0x22')]){case _0x0cc3('0x1e'):_0x2e0524[_0x0cc3('0x1e')]=_0x8917c2[_0xd5679f[_0x3f66b7][_0x0cc3('0x23')]]['split']('/')[0x1];_0x2e0524[_0x0cc3('0x24')]=_0x8917c2[_0xd5679f[_0x3f66b7][_0x0cc3('0x23')]][_0x0cc3('0x21')]('/')[0x2];_0x2e0524[_0x0cc3('0x25')]=_0x2e0524[_0x0cc3('0x24')]?_0x2e0524[_0x0cc3('0x24')][_0x0cc3('0x21')]('$')[0x0]:undefined;_0x2e0524['phone']=_0xb1244b[_0x0cc3('0x13')]?(_0x2e0524[_0x0cc3('0x25')]||'')+_0x0cc3('0x26')+_0xb1244b[_0x0cc3('0x13')]+'}':(_0x2e0524['prefix']||'')+_0x0cc3('0x14');_0x504f62[_0xd5679f[_0x3f66b7][_0x0cc3('0x23')]]=[_0x0cc3('0x27'),_0x2e0524[_0x0cc3('0x1e')],_0x2e0524[_0x0cc3('0x24')]][_0x0cc3('0x28')]('/');break;case _0x0cc3('0x29'):_0x2e0524[_0x0cc3('0x29')]=_0x8917c2[_0xd5679f[_0x3f66b7][_0x0cc3('0x23')]];if(_0xb1244b[_0x0cc3('0x1c')]!==_0x0cc3('0x1a')){if(_0x2e0524[_0x0cc3('0x29')]['indexOf'](_0x0cc3('0x2a'))<0x0){_0x2e0524[_0x0cc3('0x29')]+=_0x0cc3('0x2a');}}else{_0x2e0524[_0x0cc3('0x29')]=_0x2e0524[_0x0cc3('0x29')][_0x0cc3('0x2b')]('U(xcally-mixmonitor-context)','');}_0x504f62[_0xd5679f[_0x3f66b7][_0x0cc3('0x23')]]=_0x2e0524[_0x0cc3('0x29')];break;default:_0x504f62[_0xd5679f[_0x3f66b7][_0x0cc3('0x23')]]=_0x8917c2[_0xd5679f[_0x3f66b7][_0x0cc3('0x23')]];}}return _0x504f62[_0x0cc3('0x28')](',');}function _0x338556(_0x14711f,_0x564b60,_0x526b94){return new Promise(function(_0x31b108,_0x2b067d){var _0xbc832b=[];if(_[_0x0cc3('0x2c')](_0x564b60))return _0x31b108(_0xbc832b);_0x383a20[_0x0cc3('0x2d')][_0x0cc3('0x2e')]({'attributes':['id',_0x0cc3('0x2f'),_0x0cc3('0x30')],'raw':!![]})[_0x0cc3('0x31')](function(_0x33429b){for(var _0x2b87c6=0x0,_0x5c6f4e=0x0;_0x2b87c6<_0x564b60['length'];_0x2b87c6++,_0x5c6f4e=0x0){var _0x189b78=_0x564b60[_0x2b87c6];var _0x37ab3d=[];var _0xf8dc6a=[];delete _0x189b78['id'];if(_0x189b78[_0x0cc3('0x2f')]!=='*,*,*,*'){_0x189b78[_0x0cc3('0x32')]=[_0x189b78[_0x0cc3('0x2f')]];}else{_0x189b78['intervals']=_0x189b78[_0x0cc3('0x30')]?_[_0x0cc3('0x33')](_[_0x0cc3('0x34')](_0x33429b,{'IntervalId':_0x189b78[_0x0cc3('0x30')]}),_0x0cc3('0x2f')):[];}_0x189b78[_0x0cc3('0x5')]=_0x14711f['context'];_0x189b78[_0x0cc3('0x6')]=_0x14711f[_0x0cc3('0x6')];if(_0x189b78[_0x0cc3('0x4')])_0x189b78[_0x0cc3('0x4')]=_0x189b78['type'][_0x0cc3('0x35')]();if(_0x14711f[_0x0cc3('0x4')]===_0x0cc3('0xf')){if(_0x189b78['hasOwnProperty'](_0x0cc3('0x36'))&&_0x189b78[_0x0cc3('0x36')]&&_0x189b78['tag']!=='--'){_0x37ab3d[_0x0cc3('0xb')]({'type':_0x189b78[_0x0cc3('0x4')][_0x0cc3('0x35')](),'app':'Set','appdata':'CDR(tag)='+_0x189b78[_0x0cc3('0x36')],'context':_0x14711f[_0x0cc3('0x5')],'exten':_0x14711f[_0x0cc3('0x6')],'priority':_0x189b78[_0x0cc3('0x32')][_0x0cc3('0x37')]+_0x526b94+_0x5c6f4e++,'VoiceExtensionId':_0x14711f['id']});}_0x37ab3d['push']({'type':_0x189b78[_0x0cc3('0x4')]['toLowerCase'](),'app':_0x0cc3('0x38'),'appdata':_0x0cc3('0x39')+(_0x189b78[_0x0cc3('0x3a')]?_0x0cc3('0x3b')+_0x189b78[_0x0cc3('0x3a')]+')':_0x0cc3('0x3c')),'context':_0x14711f[_0x0cc3('0x5')],'exten':_0x14711f[_0x0cc3('0x6')],'priority':_0x189b78[_0x0cc3('0x32')]['length']+_0x526b94+_0x5c6f4e++,'VoiceExtensionId':_0x14711f['id']});}else{if(_0x189b78[_0x0cc3('0x3d')](_0x0cc3('0x3e'))){if([_0x0cc3('0x3f'),_0x0cc3('0x40')][_0x0cc3('0x41')](_0x189b78[_0x0cc3('0x42')][_0x0cc3('0x35')]())&&_0x189b78[_0x0cc3('0x43')]!==_0x0cc3('0x44')){if(_0x189b78[_0x0cc3('0x3e')]){_0x37ab3d['push']({'type':_0x189b78[_0x0cc3('0x4')][_0x0cc3('0x35')](),'app':_0x0cc3('0x38'),'appdata':_0x0cc3('0x45'),'context':_0x14711f[_0x0cc3('0x5')],'exten':_0x14711f[_0x0cc3('0x6')],'priority':_0x189b78[_0x0cc3('0x32')][_0x0cc3('0x37')]+_0x526b94+_0x5c6f4e++,'VoiceExtensionId':_0x14711f['id']});_0x37ab3d[_0x0cc3('0xb')]({'type':_0x189b78[_0x0cc3('0x4')][_0x0cc3('0x35')](),'app':_0x0cc3('0x2'),'appdata':_0x0cc3('0x46'),'context':_0x14711f['context'],'exten':_0x14711f[_0x0cc3('0x6')],'priority':_0x189b78[_0x0cc3('0x32')]['length']+_0x526b94+_0x5c6f4e++,'VoiceExtensionId':_0x14711f['id']});}else{_0x37ab3d[_0x0cc3('0xb')]({'type':_0x189b78[_0x0cc3('0x4')]['toLowerCase'](),'app':_0x0cc3('0x38'),'appdata':_0x0cc3('0x47'),'context':_0x14711f[_0x0cc3('0x5')],'exten':_0x14711f['exten'],'priority':_0x189b78['intervals'][_0x0cc3('0x37')]+_0x526b94+_0x5c6f4e++,'VoiceExtensionId':_0x14711f['id']});_0x37ab3d[_0x0cc3('0xb')]({'type':_0x189b78[_0x0cc3('0x4')][_0x0cc3('0x35')](),'app':_0x0cc3('0x2'),'appdata':_0x0cc3('0x48'),'context':_0x14711f[_0x0cc3('0x5')],'exten':_0x14711f[_0x0cc3('0x6')],'priority':_0x189b78['intervals'][_0x0cc3('0x37')]+_0x526b94+_0x5c6f4e++,'VoiceExtensionId':_0x14711f['id']});}}}}for(var _0x2ea4d7=0x0;_0x2ea4d7<_0x189b78[_0x0cc3('0x32')][_0x0cc3('0x37')];_0x2ea4d7++){var _0x14831c=_0x526b94+_0x189b78[_0x0cc3('0x32')][_0x0cc3('0x37')];var _0x3173e3=_0x2ea4d7===_0x189b78[_0x0cc3('0x32')][_0x0cc3('0x37')]-0x1?_0x526b94+_0x37ab3d['length']+_0xf8dc6a[_0x0cc3('0x37')]+0x2:_0x526b94+_0x2ea4d7+0x1;_0x37ab3d[_0x0cc3('0x49')](_0x2ea4d7,0x0,{'type':_0x14711f[_0x0cc3('0x4')],'app':_0x0cc3('0x4a'),'appdata':_0x189b78[_0x0cc3('0x32')][_0x2ea4d7]+'?'+_0x14711f['context']+',${EXTEN},'+_0x14831c+':'+_0x14711f[_0x0cc3('0x5')]+',${EXTEN},'+_0x3173e3,'exten':_0x14711f[_0x0cc3('0x6')],'context':_0x14711f[_0x0cc3('0x5')],'priority':_0x526b94+_0x2ea4d7,'VoiceExtensionId':_0x14711f['id']});}if(_0x189b78[_0x0cc3('0x43')]===_0x0cc3('0x4b'))_0x189b78[_0x0cc3('0x4c')]=_0x3b50e9(_0x14711f,_0x189b78[_0x0cc3('0x4c')]);_0x189b78['priority']=_0x37ab3d[_0x0cc3('0x37')]?_[_0x0cc3('0x4d')](_0x37ab3d)[_0x0cc3('0x4e')]+0x1:_0x526b94;_0xbc832b=_[_0x0cc3('0x4f')](_0xbc832b,_0x37ab3d,[_0x189b78],_0xf8dc6a);_0x526b94=_[_0x0cc3('0x4d')](_0xbc832b)['priority']+0x1;}return _0x31b108(_0xbc832b);})[_0x0cc3('0x50')](function(_0x4dfd13){_0x2b067d(_0x4dfd13);});});}return _0xe2cd51[_0x0cc3('0x51')](_0x0cc3('0x52'),attributes,{'tableName':_0x0cc3('0x53'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x5a073f){var _0x24ad29=this[_0x0cc3('0x54')]({'plain':!![]});var _0x37daa0=_0x24ad29[_0x0cc3('0x4')]==='outbound'?_0x1b2056(_0x24ad29):_0x302798(_0x24ad29);return _0x338556(_0x24ad29,_0x5a073f,_[_0x0cc3('0x4d')](_0x37daa0)[_0x0cc3('0x4e')]+0x1)[_0x0cc3('0x31')](function(_0x11901b){var _0x38353b=_[_0x0cc3('0x4f')](_0x37daa0,_0x11901b);_0x38353b['push']({'type':_0x24ad29[_0x0cc3('0x4')],'app':'Hangup','exten':_0x24ad29[_0x0cc3('0x6')],'context':_0x24ad29[_0x0cc3('0x5')],'priority':_[_0x0cc3('0x4d')](_0x38353b)['priority']+0x1,'VoiceExtensionId':_0x24ad29['id']});return _0x38353b;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 7f304ba..559d14e 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 _0x90b5=['redis','localhost','socket.io-emitter','./voiceExtension.socket','register','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetVoiceExtension','VoiceExtension','findAll','options','attributes','limit','include','model','map','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','defaults'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x90b5,0x139));var _0x590b=function(_0x422e1c,_0x1ee46d){_0x422e1c=_0x422e1c-0x0;var _0x3adca3=_0x90b5[_0x422e1c];return _0x3adca3;};'use strict';var _=require(_0x590b('0x0'));var util=require('util');var moment=require(_0x590b('0x1'));var BPromise=require(_0x590b('0x2'));var rs=require(_0x590b('0x3'));var fs=require('fs');var Redis=require(_0x590b('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x590b('0x5'))(_0x590b('0x6'));var config=require('../../config/environment');var jayson=require(_0x590b('0x7'));var client=jayson[_0x590b('0x8')][_0x590b('0x9')]({'port':0x232a});config['redis']=_[_0x590b('0xa')](config[_0x590b('0xb')],{'host':_0x590b('0xc'),'port':0x18eb});var socket=require(_0x590b('0xd'))(new Redis(config[_0x590b('0xb')]));require(_0x590b('0xe'))[_0x590b('0xf')](socket);function respondWithRpcPromise(_0xe0b13d,_0x137f11,_0x50a7b8){return new BPromise(function(_0x5e567,_0x381bfe){return client['request'](_0xe0b13d,_0x50a7b8)[_0x590b('0x10')](function(_0x4a5939){logger[_0x590b('0x11')](_0x590b('0x12'),_0x137f11,_0x590b('0x13'));logger[_0x590b('0x14')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x137f11,_0x590b('0x13'),JSON[_0x590b('0x15')](_0x4a5939));if(_0x4a5939[_0x590b('0x16')]){if(_0x4a5939[_0x590b('0x16')][_0x590b('0x17')]===0x1f4){logger[_0x590b('0x16')](_0x590b('0x12'),_0x137f11,_0x4a5939[_0x590b('0x16')][_0x590b('0x18')]);return _0x381bfe(_0x4a5939[_0x590b('0x16')][_0x590b('0x18')]);}logger[_0x590b('0x16')](_0x590b('0x12'),_0x137f11,_0x4a5939[_0x590b('0x16')][_0x590b('0x18')]);return _0x5e567(_0x4a5939['error'][_0x590b('0x18')]);}else{logger['info'](_0x590b('0x12'),_0x137f11,_0x590b('0x13'));_0x5e567(_0x4a5939[_0x590b('0x19')]['message']);}})['catch'](function(_0x466dcc){logger['error'](_0x590b('0x12'),_0x137f11,_0x466dcc);_0x381bfe(_0x466dcc);});});}exports[_0x590b('0x1a')]=function(_0x3fbeb2){var _0x4ff96d=this;return new Promise(function(_0x6d0a17,_0x8ab843){return db[_0x590b('0x1b')][_0x590b('0x1c')]({'raw':_0x3fbeb2['options']?_0x3fbeb2[_0x590b('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x3fbeb2[_0x590b('0x1d')]?_0x3fbeb2[_0x590b('0x1d')]['where']||null:null,'attributes':_0x3fbeb2['options']?_0x3fbeb2[_0x590b('0x1d')][_0x590b('0x1e')]||null:null,'limit':_0x3fbeb2['options']?_0x3fbeb2[_0x590b('0x1d')][_0x590b('0x1f')]||null:null,'include':_0x3fbeb2['options']?_0x3fbeb2['options'][_0x590b('0x20')]?_['map'](_0x3fbeb2[_0x590b('0x1d')]['include'],function(_0x4d3ff9){return{'model':db[_0x4d3ff9[_0x590b('0x21')]],'as':_0x4d3ff9['as'],'attributes':_0x4d3ff9[_0x590b('0x1e')],'include':_0x4d3ff9['include']?_[_0x590b('0x22')](_0x4d3ff9[_0x590b('0x20')],function(_0x91e491){return{'model':db[_0x91e491[_0x590b('0x21')]],'as':_0x91e491['as'],'attributes':_0x91e491[_0x590b('0x1e')],'include':_0x91e491['include']?_[_0x590b('0x22')](_0x91e491[_0x590b('0x20')],function(_0x333af8){return{'model':db[_0x333af8[_0x590b('0x21')]],'as':_0x333af8['as'],'attributes':_0x333af8[_0x590b('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x590b('0x10')](function(_0x5ee979){logger[_0x590b('0x11')]('GetVoiceExtension',_0x3fbeb2);logger[_0x590b('0x14')](_0x590b('0x1a'),_0x3fbeb2,JSON[_0x590b('0x15')](_0x5ee979));_0x6d0a17(_0x5ee979);})[_0x590b('0x23')](function(_0x53a751){logger[_0x590b('0x16')]('GetVoiceExtension',_0x53a751[_0x590b('0x18')],_0x3fbeb2);_0x8ab843(_0x4ff96d[_0x590b('0x16')](0x1f4,_0x53a751[_0x590b('0x18')]));});});}; \ No newline at end of file +var _0xfafd=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','where','attributes','limit','include','map','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x18b931,_0x2cad1d){var _0x114958=function(_0x445b4f){while(--_0x445b4f){_0x18b931['push'](_0x18b931['shift']());}};_0x114958(++_0x2cad1d);}(_0xfafd,0xcc));var _0xdfaf=function(_0xa27a8b,_0x163948){_0xa27a8b=_0xa27a8b-0x0;var _0x1bf9fe=_0xfafd[_0xa27a8b];return _0x1bf9fe;};'use strict';var _=require('lodash');var util=require(_0xdfaf('0x0'));var moment=require(_0xdfaf('0x1'));var BPromise=require(_0xdfaf('0x2'));var rs=require(_0xdfaf('0x3'));var fs=require('fs');var Redis=require(_0xdfaf('0x4'));var db=require(_0xdfaf('0x5'))['db'];var utils=require(_0xdfaf('0x6'));var logger=require(_0xdfaf('0x7'))(_0xdfaf('0x8'));var config=require(_0xdfaf('0x9'));var jayson=require(_0xdfaf('0xa'));var client=jayson[_0xdfaf('0xb')][_0xdfaf('0xc')]({'port':0x232a});config[_0xdfaf('0xd')]=_[_0xdfaf('0xe')](config['redis'],{'host':_0xdfaf('0xf'),'port':0x18eb});var socket=require(_0xdfaf('0x10'))(new Redis(config[_0xdfaf('0xd')]));require(_0xdfaf('0x11'))[_0xdfaf('0x12')](socket);function respondWithRpcPromise(_0x23712a,_0x466923,_0x26fd47){return new BPromise(function(_0x5092d6,_0x3747ce){return client[_0xdfaf('0x13')](_0x23712a,_0x26fd47)[_0xdfaf('0x14')](function(_0x42ea9f){logger[_0xdfaf('0x15')]('VoiceExtension,\x20%s,\x20%s',_0x466923,_0xdfaf('0x16'));logger[_0xdfaf('0x17')](_0xdfaf('0x18'),_0x466923,_0xdfaf('0x16'),JSON[_0xdfaf('0x19')](_0x42ea9f));if(_0x42ea9f[_0xdfaf('0x1a')]){if(_0x42ea9f[_0xdfaf('0x1a')][_0xdfaf('0x1b')]===0x1f4){logger[_0xdfaf('0x1a')](_0xdfaf('0x1c'),_0x466923,_0x42ea9f['error'][_0xdfaf('0x1d')]);return _0x3747ce(_0x42ea9f[_0xdfaf('0x1a')][_0xdfaf('0x1d')]);}logger['error'](_0xdfaf('0x1c'),_0x466923,_0x42ea9f[_0xdfaf('0x1a')][_0xdfaf('0x1d')]);return _0x5092d6(_0x42ea9f['error']['message']);}else{logger[_0xdfaf('0x15')]('VoiceExtension,\x20%s,\x20%s',_0x466923,'request\x20sent');_0x5092d6(_0x42ea9f[_0xdfaf('0x1e')][_0xdfaf('0x1d')]);}})[_0xdfaf('0x1f')](function(_0x120e5d){logger[_0xdfaf('0x1a')](_0xdfaf('0x1c'),_0x466923,_0x120e5d);_0x3747ce(_0x120e5d);});});}exports[_0xdfaf('0x20')]=function(_0x1a5f5f){var _0x133918=this;return new Promise(function(_0x15987e,_0x58b3a8){return db[_0xdfaf('0x21')][_0xdfaf('0x22')]({'raw':_0x1a5f5f[_0xdfaf('0x23')]?_0x1a5f5f['options']['raw']===undefined?!![]:![]:!![],'where':_0x1a5f5f[_0xdfaf('0x23')]?_0x1a5f5f[_0xdfaf('0x23')][_0xdfaf('0x24')]||null:null,'attributes':_0x1a5f5f['options']?_0x1a5f5f[_0xdfaf('0x23')][_0xdfaf('0x25')]||null:null,'limit':_0x1a5f5f[_0xdfaf('0x23')]?_0x1a5f5f['options'][_0xdfaf('0x26')]||null:null,'include':_0x1a5f5f['options']?_0x1a5f5f[_0xdfaf('0x23')][_0xdfaf('0x27')]?_[_0xdfaf('0x28')](_0x1a5f5f[_0xdfaf('0x23')]['include'],function(_0x215f06){return{'model':db[_0x215f06[_0xdfaf('0x29')]],'as':_0x215f06['as'],'attributes':_0x215f06['attributes'],'include':_0x215f06[_0xdfaf('0x27')]?_['map'](_0x215f06[_0xdfaf('0x27')],function(_0xc87a12){return{'model':db[_0xc87a12[_0xdfaf('0x29')]],'as':_0xc87a12['as'],'attributes':_0xc87a12['attributes'],'include':_0xc87a12[_0xdfaf('0x27')]?_[_0xdfaf('0x28')](_0xc87a12[_0xdfaf('0x27')],function(_0x30f1ec){return{'model':db[_0x30f1ec[_0xdfaf('0x29')]],'as':_0x30f1ec['as'],'attributes':_0x30f1ec[_0xdfaf('0x25')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3404e1){logger[_0xdfaf('0x15')](_0xdfaf('0x20'),_0x1a5f5f);logger[_0xdfaf('0x17')]('GetVoiceExtension',_0x1a5f5f,JSON[_0xdfaf('0x19')](_0x3404e1));_0x15987e(_0x3404e1);})[_0xdfaf('0x1f')](function(_0x531fb4){logger[_0xdfaf('0x1a')](_0xdfaf('0x20'),_0x531fb4['message'],_0x1a5f5f);_0x58b3a8(_0x133918[_0xdfaf('0x1a')](0x1f4,_0x531fb4[_0xdfaf('0x1d')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index accad1d..6a3e27a 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 _0x1cb9=['update','emit','removeListener','register','length','./voiceExtension.events','remove'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x1cb9,0x14e));var _0x91cb=function(_0x808220,_0x40e522){_0x808220=_0x808220-0x0;var _0x1af417=_0x1cb9[_0x808220];return _0x1af417;};'use strict';var VoiceExtensionEvents=require(_0x91cb('0x0'));var events=['save',_0x91cb('0x1'),_0x91cb('0x2')];function createListener(_0x2b1894,_0x351bdb){return function(_0x57ea48){_0x351bdb[_0x91cb('0x3')](_0x2b1894,_0x57ea48);};}function removeListener(_0x2b7314,_0x5652cd){return function(){VoiceExtensionEvents[_0x91cb('0x4')](_0x2b7314,_0x5652cd);};}exports[_0x91cb('0x5')]=function(_0x186dc3){for(var _0x28543e=0x0,_0x3b9d98=events[_0x91cb('0x6')];_0x28543e<_0x3b9d98;_0x28543e++){var _0x4c1f56=events[_0x28543e];var _0x15c517=createListener('voiceExtension:'+_0x4c1f56,_0x186dc3);VoiceExtensionEvents['on'](_0x4c1f56,_0x15c517);}}; \ No newline at end of file +var _0x1261=['save','remove','update','emit','removeListener','voiceExtension:'];(function(_0x958352,_0x157aa2){var _0x24402d=function(_0x466e19){while(--_0x466e19){_0x958352['push'](_0x958352['shift']());}};_0x24402d(++_0x157aa2);}(_0x1261,0x144));var _0x1126=function(_0x24b53b,_0x57c20d){_0x24b53b=_0x24b53b-0x0;var _0x3b5c00=_0x1261[_0x24b53b];return _0x3b5c00;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=[_0x1126('0x0'),_0x1126('0x1'),_0x1126('0x2')];function createListener(_0x331a2c,_0x39b786){return function(_0x350f3a){_0x39b786[_0x1126('0x3')](_0x331a2c,_0x350f3a);};}function removeListener(_0x4245ca,_0x21a480){return function(){VoiceExtensionEvents[_0x1126('0x4')](_0x4245ca,_0x21a480);};}exports['register']=function(_0x5c68c8){for(var _0x40ba58=0x0,_0x907180=events['length'];_0x40ba58<_0x907180;_0x40ba58++){var _0x17e5f0=events[_0x40ba58];var _0x28772d=createListener(_0x1126('0x5')+_0x17e5f0,_0x5c68c8);VoiceExtensionEvents['on'](_0x17e5f0,_0x28772d);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 2f37b15..a5e1c1b 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 _0x32f4=['multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','/:id','getMessages','post','create','update','exports'];(function(_0x244ddb,_0x4f9421){var _0x5ce49e=function(_0x482cfd){while(--_0x482cfd){_0x244ddb['push'](_0x244ddb['shift']());}};_0x5ce49e(++_0x4f9421);}(_0x32f4,0x154));var _0x432f=function(_0x24277c,_0x4436d3){_0x24277c=_0x24277c-0x0;var _0x2cb290=_0x32f4[_0x24277c];return _0x2cb290;};'use strict';var multer=require(_0x432f('0x0'));var util=require(_0x432f('0x1'));var path=require(_0x432f('0x2'));var timeout=require(_0x432f('0x3'));var express=require('express');var router=express[_0x432f('0x4')]();var fs_extra=require(_0x432f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x432f('0x6'));var config=require(_0x432f('0x7'));var controller=require(_0x432f('0x8'));router[_0x432f('0x9')]('/',auth[_0x432f('0xa')](),controller['index']);router['get'](_0x432f('0xb'),auth[_0x432f('0xa')](),controller['show']);router[_0x432f('0x9')]('/:id/messages',auth[_0x432f('0xa')](),controller[_0x432f('0xc')]);router[_0x432f('0xd')]('/',auth[_0x432f('0xa')](),controller[_0x432f('0xe')]);router['put'](_0x432f('0xb'),auth['isAuthenticated'](),controller[_0x432f('0xf')]);router['delete'](_0x432f('0xb'),auth[_0x432f('0xa')](),controller['destroy']);module[_0x432f('0x10')]=router; \ No newline at end of file +var _0x6050=['/:id/messages','isAuthenticated','getMessages','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','show','get'];(function(_0x5742ce,_0x2ea804){var _0xdb17c=function(_0x346c0d){while(--_0x346c0d){_0x5742ce['push'](_0x5742ce['shift']());}};_0xdb17c(++_0x2ea804);}(_0x6050,0x196));var _0x0605=function(_0x2aa181,_0x4001f1){_0x2aa181=_0x2aa181-0x0;var _0x1a07f9=_0x6050[_0x2aa181];return _0x1a07f9;};'use strict';var multer=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var path=require(_0x0605('0x2'));var timeout=require(_0x0605('0x3'));var express=require(_0x0605('0x4'));var router=express[_0x0605('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0605('0x6'));var interaction=require(_0x0605('0x7'));var config=require(_0x0605('0x8'));var controller=require('./voiceMail.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0605('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x0605('0xa')]);router[_0x0605('0xb')](_0x0605('0xc'),auth[_0x0605('0xd')](),controller[_0x0605('0xe')]);router['post']('/',auth[_0x0605('0xd')](),controller[_0x0605('0xf')]);router[_0x0605('0x10')](_0x0605('0x11'),auth[_0x0605('0xd')](),controller[_0x0605('0x12')]);router[_0x0605('0x13')](_0x0605('0x11'),auth[_0x0605('0xd')](),controller[_0x0605('0x14')]);module[_0x0605('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index cd1a2eb..04ba3ba 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 _0xadfa=['ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','fullname','\x20-\x20','getDataValue','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0xadfa,0x1d1));var _0xaadf=function(_0x26d415,_0x54f5ec){_0x26d415=_0x26d415-0x0;var _0x2f5ddc=_0xadfa[_0x26d415];return _0x2f5ddc;};'use strict';var Sequelize=require(_0xaadf('0x0'));module[_0xaadf('0x1')]={'customer_id':{'type':Sequelize[_0xaadf('0x2')]},'context':{'type':Sequelize[_0xaadf('0x2')],'defaultValue':_0xaadf('0x3'),'unique':_0xaadf('0x4')},'mailbox':{'type':Sequelize[_0xaadf('0x2')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0xaadf('0x2')]},'fullname':{'type':Sequelize[_0xaadf('0x2')]},'email':{'type':Sequelize[_0xaadf('0x2')],'validate':{'isEmail':!![]},'set':function(_0x2b4cb8){this[_0xaadf('0x5')](_0xaadf('0x6'),typeof _0x2b4cb8===_0xaadf('0x7')&&_0x2b4cb8[_0xaadf('0x8')]()?_0x2b4cb8[_0xaadf('0x8')]():null);}},'pager':{'type':Sequelize[_0xaadf('0x2')]},'tz':{'type':Sequelize[_0xaadf('0x2')],'defaultValue':_0xaadf('0x9')},'attach':{'type':Sequelize[_0xaadf('0xa')]('yes','no'),'defaultValue':_0xaadf('0xb'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0xaadf('0xb'),'no'),'defaultValue':_0xaadf('0xb'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0xaadf('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xaadf('0xa')](_0xaadf('0xb'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xaadf('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xaadf('0xa')](_0xaadf('0xb'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xaadf('0xc'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0xaadf('0xb'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0xaadf('0xb'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xaadf('0xa')](_0xaadf('0xb'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0xaadf('0xa')](_0xaadf('0xb'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0xaadf('0xb'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0xaadf('0xb'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0xaadf('0xd')},'emailsubject':{'type':Sequelize[_0xaadf('0x2')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0xaadf('0xe')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xaadf('0xe')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0xaadf('0xf'))+_0xaadf('0x10')+this[_0xaadf('0x11')](_0xaadf('0x12'));}}}; \ No newline at end of file +var _0x7d91=['central','yes','ENUM','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','fullname','\x20-\x20','getDataValue','mailbox','exports','STRING','from-voicemail','contest_mailbox','setDataValue','string','trim'];(function(_0x406fbd,_0x84e068){var _0x3d5ea4=function(_0x2978a5){while(--_0x2978a5){_0x406fbd['push'](_0x406fbd['shift']());}};_0x3d5ea4(++_0x84e068);}(_0x7d91,0xe3));var _0x17d9=function(_0x316e3f,_0x3bf7f9){_0x316e3f=_0x316e3f-0x0;var _0x4d5b48=_0x7d91[_0x316e3f];return _0x4d5b48;};'use strict';var Sequelize=require('sequelize');module[_0x17d9('0x0')]={'customer_id':{'type':Sequelize[_0x17d9('0x1')]},'context':{'type':Sequelize[_0x17d9('0x1')],'defaultValue':_0x17d9('0x2'),'unique':_0x17d9('0x3')},'mailbox':{'type':Sequelize[_0x17d9('0x1')],'defaultValue':'','allowNull':![],'unique':_0x17d9('0x3')},'password':{'type':Sequelize[_0x17d9('0x1')]},'fullname':{'type':Sequelize[_0x17d9('0x1')]},'email':{'type':Sequelize[_0x17d9('0x1')],'validate':{'isEmail':!![]},'set':function(_0x2ca429){this[_0x17d9('0x4')]('email',typeof _0x2ca429===_0x17d9('0x5')&&_0x2ca429[_0x17d9('0x6')]()?_0x2ca429[_0x17d9('0x6')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x17d9('0x1')],'defaultValue':_0x17d9('0x7')},'attach':{'type':Sequelize['ENUM'](_0x17d9('0x8'),'no'),'defaultValue':_0x17d9('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0x17d9('0x9')](_0x17d9('0x8'),'no'),'defaultValue':_0x17d9('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0x17d9('0x1')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x17d9('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x17d9('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x17d9('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x17d9('0x9')](_0x17d9('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x17d9('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x17d9('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x17d9('0x9')](_0x17d9('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x17d9('0x9')](_0x17d9('0x8'),'no'),'defaultValue':_0x17d9('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0x17d9('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x17d9('0x9')](_0x17d9('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x17d9('0x9')](_0x17d9('0x8'),'no'),'defaultValue':_0x17d9('0x8'),'allowNull':![]},'stamp':{'type':_0x17d9('0xb')},'emailsubject':{'type':Sequelize[_0x17d9('0x1')]},'emailbody':{'type':Sequelize[_0x17d9('0x1')]},'maxsecs':{'type':Sequelize[_0x17d9('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x17d9('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x17d9('0xd')],'get':function(){return this['getDataValue'](_0x17d9('0xe'))+_0x17d9('0xf')+this[_0x17d9('0x10')](_0x17d9('0x11'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 25b8c1f..a82777d 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 _0xcf66=['nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','findOne','VoiceMailMessage','pick','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','request-promise','moment','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','error','stack','name','VoiceMail','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0xcf66,0x71));var _0x6cf6=function(_0x27ee11,_0x5ef688){_0x27ee11=_0x27ee11-0x0;var _0x42f9ad=_0xcf66[_0x27ee11];return _0x42f9ad;};'use strict';var emlformat=require(_0x6cf6('0x0'));var rimraf=require(_0x6cf6('0x1'));var zipdir=require(_0x6cf6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6cf6('0x3'));var moment=require(_0x6cf6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6cf6('0x5'));var path=require(_0x6cf6('0x6'));var sox=require('sox');var csv=require(_0x6cf6('0x7'));var ejs=require(_0x6cf6('0x8'));var fs=require('fs');var fs_extra=require(_0x6cf6('0x9'));var _=require('lodash');var squel=require(_0x6cf6('0xa'));var crypto=require(_0x6cf6('0xb'));var jsforce=require(_0x6cf6('0xc'));var deskjs=require(_0x6cf6('0xd'));var toCsv=require(_0x6cf6('0x7'));var querystring=require(_0x6cf6('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6cf6('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6cf6('0x10'));var logger=require(_0x6cf6('0x11'))(_0x6cf6('0x12'));var utils=require(_0x6cf6('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3fdfea,_0x13b1ad){_0x13b1ad=_0x13b1ad||0xcc;return function(_0x372d12){if(_0x372d12){return _0x3fdfea[_0x6cf6('0x14')](_0x13b1ad);}return _0x3fdfea[_0x6cf6('0x15')](_0x13b1ad)[_0x6cf6('0x16')]();};}function respondWithResult(_0x57909f,_0x32fe64){_0x32fe64=_0x32fe64||0xc8;return function(_0x494ece){if(_0x494ece){return _0x57909f[_0x6cf6('0x15')](_0x32fe64)[_0x6cf6('0x17')](_0x494ece);}};}function respondWithFilteredResult(_0x4b073f,_0x40e413){return function(_0x1b40f8){if(_0x1b40f8){var _0x2d23ab=typeof _0x40e413[_0x6cf6('0x18')]===_0x6cf6('0x19')&&typeof _0x40e413[_0x6cf6('0x1a')]===_0x6cf6('0x19');var _0x39ec25=_0x1b40f8[_0x6cf6('0x1b')];var _0x2ca2b1=_0x2d23ab?0x0:_0x40e413['offset'];var _0x11d994=_0x2d23ab?_0x1b40f8[_0x6cf6('0x1b')]:_0x40e413[_0x6cf6('0x18')]+_0x40e413['limit'];var _0x18abd9;if(_0x11d994>=_0x39ec25){_0x11d994=_0x39ec25;_0x18abd9=0xc8;}else{_0x18abd9=0xce;}_0x4b073f[_0x6cf6('0x15')](_0x18abd9);return _0x4b073f[_0x6cf6('0x1c')](_0x6cf6('0x1d'),_0x2ca2b1+'-'+_0x11d994+'/'+_0x39ec25)[_0x6cf6('0x17')](_0x1b40f8);}return null;};}function patchUpdates(_0x21e903){return function(_0x123993){try{jsonpatch['apply'](_0x123993,_0x21e903,!![]);}catch(_0x19f2cd){return BPromise[_0x6cf6('0x1e')](_0x19f2cd);}return _0x123993[_0x6cf6('0x1f')]();};}function saveUpdates(_0x380a40,_0x5cba3a){return function(_0x470ea4){if(_0x470ea4){return _0x470ea4[_0x6cf6('0x20')](_0x380a40)[_0x6cf6('0x21')](function(_0x5b2767){return _0x5b2767;});}return null;};}function removeEntity(_0x5b30e0,_0x276225){return function(_0x59f838){if(_0x59f838){return _0x59f838[_0x6cf6('0x22')]()[_0x6cf6('0x21')](function(){var _0x14ae3e=_0x59f838[_0x6cf6('0x23')]({'plain':!![]});var _0x3f9871=_0x6cf6('0x24');return db[_0x6cf6('0x25')]['destroy']({'where':{'type':_0x3f9871,'resourceId':_0x14ae3e['id']}})[_0x6cf6('0x21')](function(){return _0x59f838;});})[_0x6cf6('0x21')](function(){_0x5b30e0[_0x6cf6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf4eec5,_0x2e56ca){return function(_0x2224db){if(!_0x2224db){_0xf4eec5[_0x6cf6('0x14')](0x194);}return _0x2224db;};}function handleError(_0x5c9236,_0x584594){_0x584594=_0x584594||0x1f4;return function(_0x2afe84){logger[_0x6cf6('0x26')](_0x2afe84[_0x6cf6('0x27')]);if(_0x2afe84[_0x6cf6('0x28')]){delete _0x2afe84['name'];}_0x5c9236[_0x6cf6('0x15')](_0x584594)['send'](_0x2afe84);};}exports['index']=function(_0x519a70,_0x10bde5){var _0x65433={},_0x33d308={},_0x42f488={'count':0x0,'rows':[]};var _0x11c848=_['map'](db[_0x6cf6('0x29')][_0x6cf6('0x2a')],function(_0x356340){return{'name':_0x356340['fieldName'],'type':_0x356340[_0x6cf6('0x2b')][_0x6cf6('0x2c')]};});_0x33d308[_0x6cf6('0x2d')]=_[_0x6cf6('0x2e')](_0x11c848,_0x6cf6('0x28'));_0x33d308[_0x6cf6('0x2f')]=_[_0x6cf6('0x30')](_0x519a70[_0x6cf6('0x2f')]);_0x33d308[_0x6cf6('0x31')]=_[_0x6cf6('0x32')](_0x33d308[_0x6cf6('0x2d')],_0x33d308[_0x6cf6('0x2f')]);_0x65433[_0x6cf6('0x33')]=_[_0x6cf6('0x32')](_0x33d308[_0x6cf6('0x2d')],qs[_0x6cf6('0x34')](_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x34')]));_0x65433['attributes']=_0x65433[_0x6cf6('0x33')][_0x6cf6('0x35')]?_0x65433[_0x6cf6('0x33')]:_0x33d308[_0x6cf6('0x2d')];if(!_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x36')](_0x6cf6('0x37'))){_0x65433[_0x6cf6('0x1a')]=qs[_0x6cf6('0x1a')](_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x1a')]);_0x65433['offset']=qs[_0x6cf6('0x18')](_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x18')]);}_0x65433[_0x6cf6('0x38')]=qs[_0x6cf6('0x39')](_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x39')]);_0x65433[_0x6cf6('0x3a')]=qs[_0x6cf6('0x31')](_['pick'](_0x519a70[_0x6cf6('0x2f')],_0x33d308[_0x6cf6('0x31')]),_0x11c848);if(_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x3b')]){_0x65433[_0x6cf6('0x3a')]=_[_0x6cf6('0x3c')](_0x65433[_0x6cf6('0x3a')],{'$or':_[_0x6cf6('0x2e')](_0x11c848,function(_0x3a7c3b){if(_0x3a7c3b['type']!==_0x6cf6('0x3d')){var _0x5a9727={};_0x5a9727[_0x3a7c3b[_0x6cf6('0x28')]]={'$like':'%'+_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x3b')]+'%'};return _0x5a9727;}})});}_0x65433=_[_0x6cf6('0x3c')]({},_0x65433,_0x519a70[_0x6cf6('0x3e')]);var _0x29541e={'where':_0x65433[_0x6cf6('0x3a')]};return db[_0x6cf6('0x29')]['count'](_0x29541e)[_0x6cf6('0x21')](function(_0x335dce){_0x42f488['count']=_0x335dce;if(_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x3f')]){_0x65433[_0x6cf6('0x40')]=[{'all':!![]}];}return db['VoiceMail'][_0x6cf6('0x41')](_0x65433);})[_0x6cf6('0x21')](function(_0x51d915){_0x42f488[_0x6cf6('0x42')]=_0x51d915;return _0x42f488;})[_0x6cf6('0x21')](respondWithFilteredResult(_0x10bde5,_0x65433))[_0x6cf6('0x43')](handleError(_0x10bde5,null));};exports[_0x6cf6('0x44')]=function(_0x41195e,_0x20dacd){var _0xbcb6a7={'raw':!![],'where':{'id':_0x41195e[_0x6cf6('0x45')]['id']}},_0x5a2ef8={};_0x5a2ef8['model']=_[_0x6cf6('0x30')](db[_0x6cf6('0x29')]['rawAttributes']);_0x5a2ef8[_0x6cf6('0x2f')]=_[_0x6cf6('0x30')](_0x41195e[_0x6cf6('0x2f')]);_0x5a2ef8[_0x6cf6('0x31')]=_[_0x6cf6('0x32')](_0x5a2ef8['model'],_0x5a2ef8[_0x6cf6('0x2f')]);_0xbcb6a7[_0x6cf6('0x33')]=_[_0x6cf6('0x32')](_0x5a2ef8['model'],qs[_0x6cf6('0x34')](_0x41195e[_0x6cf6('0x2f')][_0x6cf6('0x34')]));_0xbcb6a7['attributes']=_0xbcb6a7[_0x6cf6('0x33')]['length']?_0xbcb6a7['attributes']:_0x5a2ef8[_0x6cf6('0x2d')];if(_0x41195e[_0x6cf6('0x2f')][_0x6cf6('0x3f')]){_0xbcb6a7[_0x6cf6('0x40')]=[{'all':!![]}];}_0xbcb6a7=_[_0x6cf6('0x3c')]({},_0xbcb6a7,_0x41195e[_0x6cf6('0x3e')]);return db[_0x6cf6('0x29')][_0x6cf6('0x46')](_0xbcb6a7)[_0x6cf6('0x21')](handleEntityNotFound(_0x20dacd,null))[_0x6cf6('0x21')](respondWithResult(_0x20dacd,null))[_0x6cf6('0x43')](handleError(_0x20dacd,null));};exports[_0x6cf6('0x47')]=function(_0x3786d1,_0x4c8ada){return db[_0x6cf6('0x29')][_0x6cf6('0x47')](_0x3786d1['body'],{})['then'](function(_0x10047a){var _0x17dd6e=_0x3786d1[_0x6cf6('0x48')][_0x6cf6('0x23')]({'plain':!![]});if(!_0x17dd6e)throw new Error(_0x6cf6('0x49'));if(_0x17dd6e[_0x6cf6('0x4a')]==='user'){var _0x115b9b=_0x10047a[_0x6cf6('0x23')]({'plain':!![]});var _0x2503dc='Voicemails';return db['UserProfileSection'][_0x6cf6('0x46')]({'where':{'name':_0x2503dc,'userProfileId':_0x17dd6e[_0x6cf6('0x4b')]},'raw':!![]})[_0x6cf6('0x21')](function(_0x255e88){if(_0x255e88&&_0x255e88[_0x6cf6('0x4c')]===0x0){return db[_0x6cf6('0x25')][_0x6cf6('0x47')]({'name':_0x115b9b[_0x6cf6('0x28')],'resourceId':_0x115b9b['id'],'type':_0x255e88[_0x6cf6('0x28')],'sectionId':_0x255e88['id']},{})[_0x6cf6('0x21')](function(){return _0x10047a;});}else{return _0x10047a;}})['catch'](function(_0x217072){logger[_0x6cf6('0x26')](_0x6cf6('0x4d'),_0x217072);throw _0x217072;});}return _0x10047a;})[_0x6cf6('0x21')](respondWithResult(_0x4c8ada,0xc9))[_0x6cf6('0x43')](handleError(_0x4c8ada,null));};exports[_0x6cf6('0x20')]=function(_0x2e1ee7,_0xce361){if(_0x2e1ee7[_0x6cf6('0x4e')]['id']){delete _0x2e1ee7[_0x6cf6('0x4e')]['id'];}return db[_0x6cf6('0x29')]['find']({'where':{'id':_0x2e1ee7[_0x6cf6('0x45')]['id']}})['then'](handleEntityNotFound(_0xce361,null))[_0x6cf6('0x21')](saveUpdates(_0x2e1ee7[_0x6cf6('0x4e')],null))['then'](respondWithResult(_0xce361,null))[_0x6cf6('0x43')](handleError(_0xce361,null));};exports[_0x6cf6('0x22')]=function(_0x4699d5,_0x1bdbc1){return db[_0x6cf6('0x29')][_0x6cf6('0x46')]({'where':{'id':_0x4699d5['params']['id']}})[_0x6cf6('0x21')](handleEntityNotFound(_0x1bdbc1,null))[_0x6cf6('0x21')](removeEntity(_0x1bdbc1,null))[_0x6cf6('0x43')](handleError(_0x1bdbc1,null));};exports['getMessages']=function(_0x4f1de3,_0x2c8736,_0x140ed2){return db['VoiceMail'][_0x6cf6('0x4f')]({'where':{'id':_0x4f1de3[_0x6cf6('0x45')]['id']}})[_0x6cf6('0x21')](handleEntityNotFound(_0x2c8736,null))[_0x6cf6('0x21')](function(_0x2e460a){var _0x58ec7e;var _0x3e7e5b={},_0x40b31f={};_0x40b31f['model']=_['keys'](db[_0x6cf6('0x50')][_0x6cf6('0x2a')]);_0x40b31f[_0x6cf6('0x2f')]=_[_0x6cf6('0x30')](_0x4f1de3[_0x6cf6('0x2f')]);_0x40b31f['filters']=_['intersection'](_0x40b31f[_0x6cf6('0x2d')],_0x40b31f[_0x6cf6('0x2f')]);_0x3e7e5b[_0x6cf6('0x33')]=_[_0x6cf6('0x32')](_0x40b31f[_0x6cf6('0x2d')],qs['fields'](_0x4f1de3['query']['fields']));_0x3e7e5b[_0x6cf6('0x33')]=_0x3e7e5b[_0x6cf6('0x33')][_0x6cf6('0x35')]?_0x3e7e5b[_0x6cf6('0x33')]:_0x40b31f['model'];if(!_0x4f1de3[_0x6cf6('0x2f')]['hasOwnProperty'](_0x6cf6('0x37'))){_0x3e7e5b['limit']=qs[_0x6cf6('0x1a')](_0x4f1de3[_0x6cf6('0x2f')][_0x6cf6('0x1a')]);_0x3e7e5b[_0x6cf6('0x18')]=qs[_0x6cf6('0x18')](_0x4f1de3['query'][_0x6cf6('0x18')]);}_0x3e7e5b['order']=qs[_0x6cf6('0x39')](_0x4f1de3['query'][_0x6cf6('0x39')]);_0x3e7e5b['where']=qs[_0x6cf6('0x31')](_[_0x6cf6('0x51')](_0x4f1de3['query'],_0x40b31f[_0x6cf6('0x31')]));if(_0x4f1de3[_0x6cf6('0x2f')][_0x6cf6('0x3b')]){_0x3e7e5b[_0x6cf6('0x3a')]=_[_0x6cf6('0x3c')](_0x3e7e5b[_0x6cf6('0x3a')],{'$or':_[_0x6cf6('0x2e')](_0x3e7e5b['attributes'],function(_0x4ff62b){var _0x2df3ea={};_0x2df3ea[_0x4ff62b]={'$like':'%'+_0x4f1de3[_0x6cf6('0x2f')]['filter']+'%'};return _0x2df3ea;})});}_0x3e7e5b[_0x6cf6('0x3a')]=_['merge'](_0x3e7e5b['where'],{'mailboxuser':_0x2e460a[_0x6cf6('0x52')]});_0x3e7e5b=_['merge']({},_0x3e7e5b,_0x4f1de3['options']);return db[_0x6cf6('0x50')][_0x6cf6('0x53')](_0x3e7e5b)[_0x6cf6('0x21')](respondWithFilteredResult(_0x2c8736,_0x3e7e5b));})['catch'](handleError(_0x2c8736,null));}; \ No newline at end of file +var _0x065e=['findOne','VoiceMailMessage','findAndCountAll','eml-format','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','reject','save','update','then','destroy','UserProfileResource','error','name','send','index','map','VoiceMail','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Voicemails','UserProfileSection','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getMessages'];(function(_0x2d8967,_0x19a567){var _0x55f197=function(_0x1bc2e0){while(--_0x1bc2e0){_0x2d8967['push'](_0x2d8967['shift']());}};_0x55f197(++_0x19a567);}(_0x065e,0x1a7));var _0xe065=function(_0x22627b,_0x258be0){_0x22627b=_0x22627b-0x0;var _0x5c1e9c=_0x065e[_0x22627b];return _0x5c1e9c;};'use strict';var emlformat=require(_0xe065('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe065('0x1'));var moment=require(_0xe065('0x2'));var BPromise=require(_0xe065('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe065('0x4'));var sox=require(_0xe065('0x5'));var csv=require('to-csv');var ejs=require(_0xe065('0x6'));var fs=require('fs');var fs_extra=require(_0xe065('0x7'));var _=require(_0xe065('0x8'));var squel=require('squel');var crypto=require(_0xe065('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xe065('0xa'));var toCsv=require(_0xe065('0xb'));var querystring=require(_0xe065('0xc'));var Papa=require(_0xe065('0xd'));var Redis=require(_0xe065('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe065('0xf'));var as=require(_0xe065('0x10'));var hardwareService=require(_0xe065('0x11'));var logger=require(_0xe065('0x12'))(_0xe065('0x13'));var utils=require(_0xe065('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe065('0x15'))['db'];function respondWithStatusCode(_0x13b697,_0xf5ab44){_0xf5ab44=_0xf5ab44||0xcc;return function(_0x5bd30f){if(_0x5bd30f){return _0x13b697[_0xe065('0x16')](_0xf5ab44);}return _0x13b697[_0xe065('0x17')](_0xf5ab44)[_0xe065('0x18')]();};}function respondWithResult(_0x2e9480,_0x29297b){_0x29297b=_0x29297b||0xc8;return function(_0x541985){if(_0x541985){return _0x2e9480[_0xe065('0x17')](_0x29297b)[_0xe065('0x19')](_0x541985);}};}function respondWithFilteredResult(_0x15d365,_0xc5ef4f){return function(_0x434e07){if(_0x434e07){var _0x352206=typeof _0xc5ef4f[_0xe065('0x1a')]==='undefined'&&typeof _0xc5ef4f[_0xe065('0x1b')]===_0xe065('0x1c');var _0x54d260=_0x434e07[_0xe065('0x1d')];var _0x1d2f7a=_0x352206?0x0:_0xc5ef4f[_0xe065('0x1a')];var _0x14c97c=_0x352206?_0x434e07[_0xe065('0x1d')]:_0xc5ef4f[_0xe065('0x1a')]+_0xc5ef4f[_0xe065('0x1b')];var _0x5000e1;if(_0x14c97c>=_0x54d260){_0x14c97c=_0x54d260;_0x5000e1=0xc8;}else{_0x5000e1=0xce;}_0x15d365[_0xe065('0x17')](_0x5000e1);return _0x15d365['set'](_0xe065('0x1e'),_0x1d2f7a+'-'+_0x14c97c+'/'+_0x54d260)[_0xe065('0x19')](_0x434e07);}return null;};}function patchUpdates(_0x55f55c){return function(_0x1c6567){try{jsonpatch['apply'](_0x1c6567,_0x55f55c,!![]);}catch(_0xe26e9b){return BPromise[_0xe065('0x1f')](_0xe26e9b);}return _0x1c6567[_0xe065('0x20')]();};}function saveUpdates(_0x110556,_0x3ecd13){return function(_0x105cb2){if(_0x105cb2){return _0x105cb2[_0xe065('0x21')](_0x110556)[_0xe065('0x22')](function(_0x1c5dd9){return _0x1c5dd9;});}return null;};}function removeEntity(_0x5081a3,_0x7208af){return function(_0x43b712){if(_0x43b712){return _0x43b712[_0xe065('0x23')]()[_0xe065('0x22')](function(){var _0x5e8b60=_0x43b712['get']({'plain':!![]});var _0x164965='Voicemails';return db[_0xe065('0x24')][_0xe065('0x23')]({'where':{'type':_0x164965,'resourceId':_0x5e8b60['id']}})[_0xe065('0x22')](function(){return _0x43b712;});})[_0xe065('0x22')](function(){_0x5081a3[_0xe065('0x17')](0xcc)[_0xe065('0x18')]();});}};}function handleEntityNotFound(_0x3b1caf,_0x26a159){return function(_0x52cd9c){if(!_0x52cd9c){_0x3b1caf['sendStatus'](0x194);}return _0x52cd9c;};}function handleError(_0x14de01,_0x10e6ba){_0x10e6ba=_0x10e6ba||0x1f4;return function(_0x23aee9){logger[_0xe065('0x25')](_0x23aee9['stack']);if(_0x23aee9[_0xe065('0x26')]){delete _0x23aee9['name'];}_0x14de01['status'](_0x10e6ba)[_0xe065('0x27')](_0x23aee9);};}exports[_0xe065('0x28')]=function(_0x2aa766,_0x5b8523){var _0x883747={},_0x59b915={},_0x12679d={'count':0x0,'rows':[]};var _0x46db7e=_[_0xe065('0x29')](db[_0xe065('0x2a')]['rawAttributes'],function(_0x3f02b2){return{'name':_0x3f02b2['fieldName'],'type':_0x3f02b2[_0xe065('0x2b')][_0xe065('0x2c')]};});_0x59b915['model']=_[_0xe065('0x29')](_0x46db7e,'name');_0x59b915[_0xe065('0x2d')]=_['keys'](_0x2aa766[_0xe065('0x2d')]);_0x59b915[_0xe065('0x2e')]=_[_0xe065('0x2f')](_0x59b915[_0xe065('0x30')],_0x59b915['query']);_0x883747[_0xe065('0x31')]=_[_0xe065('0x2f')](_0x59b915[_0xe065('0x30')],qs[_0xe065('0x32')](_0x2aa766[_0xe065('0x2d')][_0xe065('0x32')]));_0x883747['attributes']=_0x883747[_0xe065('0x31')][_0xe065('0x33')]?_0x883747['attributes']:_0x59b915[_0xe065('0x30')];if(!_0x2aa766[_0xe065('0x2d')][_0xe065('0x34')](_0xe065('0x35'))){_0x883747[_0xe065('0x1b')]=qs[_0xe065('0x1b')](_0x2aa766[_0xe065('0x2d')]['limit']);_0x883747[_0xe065('0x1a')]=qs['offset'](_0x2aa766[_0xe065('0x2d')][_0xe065('0x1a')]);}_0x883747[_0xe065('0x36')]=qs[_0xe065('0x37')](_0x2aa766[_0xe065('0x2d')][_0xe065('0x37')]);_0x883747['where']=qs[_0xe065('0x2e')](_[_0xe065('0x38')](_0x2aa766[_0xe065('0x2d')],_0x59b915['filters']),_0x46db7e);if(_0x2aa766[_0xe065('0x2d')][_0xe065('0x39')]){_0x883747[_0xe065('0x3a')]=_[_0xe065('0x3b')](_0x883747[_0xe065('0x3a')],{'$or':_['map'](_0x46db7e,function(_0x341740){if(_0x341740[_0xe065('0x2b')]!=='VIRTUAL'){var _0x236e75={};_0x236e75[_0x341740['name']]={'$like':'%'+_0x2aa766[_0xe065('0x2d')][_0xe065('0x39')]+'%'};return _0x236e75;}})});}_0x883747=_['merge']({},_0x883747,_0x2aa766[_0xe065('0x3c')]);var _0x20c881={'where':_0x883747['where']};return db[_0xe065('0x2a')][_0xe065('0x1d')](_0x20c881)[_0xe065('0x22')](function(_0x44a3f6){_0x12679d[_0xe065('0x1d')]=_0x44a3f6;if(_0x2aa766[_0xe065('0x2d')][_0xe065('0x3d')]){_0x883747[_0xe065('0x3e')]=[{'all':!![]}];}return db[_0xe065('0x2a')][_0xe065('0x3f')](_0x883747);})[_0xe065('0x22')](function(_0x4364c3){_0x12679d[_0xe065('0x40')]=_0x4364c3;return _0x12679d;})['then'](respondWithFilteredResult(_0x5b8523,_0x883747))['catch'](handleError(_0x5b8523,null));};exports[_0xe065('0x41')]=function(_0x2bf092,_0x5ee4ec){var _0x3ba838={'raw':!![],'where':{'id':_0x2bf092[_0xe065('0x42')]['id']}},_0x448044={};_0x448044[_0xe065('0x30')]=_[_0xe065('0x43')](db[_0xe065('0x2a')][_0xe065('0x44')]);_0x448044[_0xe065('0x2d')]=_[_0xe065('0x43')](_0x2bf092['query']);_0x448044[_0xe065('0x2e')]=_[_0xe065('0x2f')](_0x448044[_0xe065('0x30')],_0x448044['query']);_0x3ba838[_0xe065('0x31')]=_[_0xe065('0x2f')](_0x448044[_0xe065('0x30')],qs[_0xe065('0x32')](_0x2bf092['query'][_0xe065('0x32')]));_0x3ba838[_0xe065('0x31')]=_0x3ba838[_0xe065('0x31')][_0xe065('0x33')]?_0x3ba838[_0xe065('0x31')]:_0x448044[_0xe065('0x30')];if(_0x2bf092[_0xe065('0x2d')]['includeAll']){_0x3ba838[_0xe065('0x3e')]=[{'all':!![]}];}_0x3ba838=_[_0xe065('0x3b')]({},_0x3ba838,_0x2bf092[_0xe065('0x3c')]);return db[_0xe065('0x2a')][_0xe065('0x45')](_0x3ba838)[_0xe065('0x22')](handleEntityNotFound(_0x5ee4ec,null))[_0xe065('0x22')](respondWithResult(_0x5ee4ec,null))['catch'](handleError(_0x5ee4ec,null));};exports[_0xe065('0x46')]=function(_0x5a2360,_0x45fe1f){return db[_0xe065('0x2a')][_0xe065('0x46')](_0x5a2360['body'],{})[_0xe065('0x22')](function(_0x16898c){var _0x3ab70d=_0x5a2360[_0xe065('0x47')][_0xe065('0x48')]({'plain':!![]});if(!_0x3ab70d)throw new Error(_0xe065('0x49'));if(_0x3ab70d[_0xe065('0x4a')]===_0xe065('0x47')){var _0x3095c8=_0x16898c[_0xe065('0x48')]({'plain':!![]});var _0x3f91a2=_0xe065('0x4b');return db[_0xe065('0x4c')]['find']({'where':{'name':_0x3f91a2,'userProfileId':_0x3ab70d['userProfileId']},'raw':!![]})['then'](function(_0x23ba0b){if(_0x23ba0b&&_0x23ba0b['autoAssociation']===0x0){return db[_0xe065('0x24')][_0xe065('0x46')]({'name':_0x3095c8[_0xe065('0x26')],'resourceId':_0x3095c8['id'],'type':_0x23ba0b['name'],'sectionId':_0x23ba0b['id']},{})[_0xe065('0x22')](function(){return _0x16898c;});}else{return _0x16898c;}})[_0xe065('0x4d')](function(_0x5cce78){logger[_0xe065('0x25')](_0xe065('0x4e'),_0x5cce78);throw _0x5cce78;});}return _0x16898c;})[_0xe065('0x22')](respondWithResult(_0x45fe1f,0xc9))[_0xe065('0x4d')](handleError(_0x45fe1f,null));};exports[_0xe065('0x21')]=function(_0x1ea568,_0xe77af6){if(_0x1ea568[_0xe065('0x4f')]['id']){delete _0x1ea568[_0xe065('0x4f')]['id'];}return db[_0xe065('0x2a')]['find']({'where':{'id':_0x1ea568[_0xe065('0x42')]['id']}})[_0xe065('0x22')](handleEntityNotFound(_0xe77af6,null))[_0xe065('0x22')](saveUpdates(_0x1ea568[_0xe065('0x4f')],null))['then'](respondWithResult(_0xe77af6,null))[_0xe065('0x4d')](handleError(_0xe77af6,null));};exports[_0xe065('0x23')]=function(_0x21884d,_0xb1fca1){return db['VoiceMail'][_0xe065('0x45')]({'where':{'id':_0x21884d[_0xe065('0x42')]['id']}})[_0xe065('0x22')](handleEntityNotFound(_0xb1fca1,null))['then'](removeEntity(_0xb1fca1,null))[_0xe065('0x4d')](handleError(_0xb1fca1,null));};exports[_0xe065('0x50')]=function(_0x18b43e,_0x1f782f,_0x2d13ab){return db[_0xe065('0x2a')][_0xe065('0x51')]({'where':{'id':_0x18b43e[_0xe065('0x42')]['id']}})[_0xe065('0x22')](handleEntityNotFound(_0x1f782f,null))['then'](function(_0x2accad){var _0x550c37;var _0x44edf0={},_0x24fc1c={};_0x24fc1c[_0xe065('0x30')]=_['keys'](db['VoiceMailMessage']['rawAttributes']);_0x24fc1c[_0xe065('0x2d')]=_[_0xe065('0x43')](_0x18b43e[_0xe065('0x2d')]);_0x24fc1c[_0xe065('0x2e')]=_[_0xe065('0x2f')](_0x24fc1c[_0xe065('0x30')],_0x24fc1c[_0xe065('0x2d')]);_0x44edf0[_0xe065('0x31')]=_[_0xe065('0x2f')](_0x24fc1c[_0xe065('0x30')],qs[_0xe065('0x32')](_0x18b43e['query']['fields']));_0x44edf0[_0xe065('0x31')]=_0x44edf0[_0xe065('0x31')]['length']?_0x44edf0[_0xe065('0x31')]:_0x24fc1c['model'];if(!_0x18b43e['query'][_0xe065('0x34')](_0xe065('0x35'))){_0x44edf0[_0xe065('0x1b')]=qs[_0xe065('0x1b')](_0x18b43e[_0xe065('0x2d')][_0xe065('0x1b')]);_0x44edf0[_0xe065('0x1a')]=qs['offset'](_0x18b43e[_0xe065('0x2d')][_0xe065('0x1a')]);}_0x44edf0[_0xe065('0x36')]=qs[_0xe065('0x37')](_0x18b43e[_0xe065('0x2d')]['sort']);_0x44edf0[_0xe065('0x3a')]=qs[_0xe065('0x2e')](_[_0xe065('0x38')](_0x18b43e[_0xe065('0x2d')],_0x24fc1c[_0xe065('0x2e')]));if(_0x18b43e[_0xe065('0x2d')]['filter']){_0x44edf0['where']=_['merge'](_0x44edf0['where'],{'$or':_['map'](_0x44edf0[_0xe065('0x31')],function(_0x45b033){var _0x1733b4={};_0x1733b4[_0x45b033]={'$like':'%'+_0x18b43e[_0xe065('0x2d')][_0xe065('0x39')]+'%'};return _0x1733b4;})});}_0x44edf0[_0xe065('0x3a')]=_[_0xe065('0x3b')](_0x44edf0[_0xe065('0x3a')],{'mailboxuser':_0x2accad['mailbox']});_0x44edf0=_['merge']({},_0x44edf0,_0x18b43e[_0xe065('0x3c')]);return db[_0xe065('0x52')][_0xe065('0x53')](_0x44edf0)['then'](respondWithFilteredResult(_0x1f782f,_0x44edf0));})[_0xe065('0x4d')](handleError(_0x1f782f,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index c79e952..201fcb6 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 _0x510b=['api','bluebird','request-promise','path','rimraf','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox','context','lodash','util','../../config/logger'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x510b,0x138));var _0xb510=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x510b[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xb510('0x0'));var util=require(_0xb510('0x1'));var logger=require(_0xb510('0x2'))(_0xb510('0x3'));var moment=require('moment');var BPromise=require(_0xb510('0x4'));var rp=require(_0xb510('0x5'));var fs=require('fs');var path=require(_0xb510('0x6'));var rimraf=require(_0xb510('0x7'));var config=require('../../config/environment');var attributes=require(_0xb510('0x8'));module[_0xb510('0x9')]=function(_0x3ededb,_0x57452c){return _0x3ededb[_0xb510('0xa')](_0xb510('0xb'),attributes,{'tableName':_0xb510('0xc'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0xb510('0xd'),_0xb510('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x36f9=['VoiceMail','mailbox_context','mailbox','context','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceMail.attributes','exports','define'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x36f9,0x104));var _0x936f=function(_0x1123bb,_0x54472a){_0x1123bb=_0x1123bb-0x0;var _0xdeb602=_0x36f9[_0x1123bb];return _0xdeb602;};'use strict';var _=require(_0x936f('0x0'));var util=require(_0x936f('0x1'));var logger=require(_0x936f('0x2'))(_0x936f('0x3'));var moment=require(_0x936f('0x4'));var BPromise=require(_0x936f('0x5'));var rp=require(_0x936f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x936f('0x7'));var config=require(_0x936f('0x8'));var attributes=require(_0x936f('0x9'));module[_0x936f('0xa')]=function(_0x504049,_0x493e0b){return _0x504049[_0x936f('0xb')](_0x936f('0xc'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0x936f('0xd'),'fields':[_0x936f('0xe'),_0x936f('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 429813f..a014b48 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 _0xfd47=['stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x2c094f,_0xe5a1b0){var _0x2f7176=function(_0x28e5f5){while(--_0x28e5f5){_0x2c094f['push'](_0x2c094f['shift']());}};_0x2f7176(++_0xe5a1b0);}(_0xfd47,0xc6));var _0x7fd4=function(_0x4727ea,_0x18ec67){_0x4727ea=_0x4727ea-0x0;var _0x3478c=_0xfd47[_0x4727ea];return _0x3478c;};'use strict';var _=require('lodash');var util=require(_0x7fd4('0x0'));var moment=require(_0x7fd4('0x1'));var BPromise=require(_0x7fd4('0x2'));var rs=require(_0x7fd4('0x3'));var fs=require('fs');var Redis=require(_0x7fd4('0x4'));var db=require(_0x7fd4('0x5'))['db'];var utils=require(_0x7fd4('0x6'));var logger=require('../../config/logger')(_0x7fd4('0x7'));var config=require(_0x7fd4('0x8'));var jayson=require(_0x7fd4('0x9'));var client=jayson[_0x7fd4('0xa')][_0x7fd4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x58f75d,_0x21a210,_0x58ce32){return new BPromise(function(_0x9a25f3,_0x459d9f){return client[_0x7fd4('0xc')](_0x58f75d,_0x58ce32)[_0x7fd4('0xd')](function(_0x49adf8){logger[_0x7fd4('0xe')](_0x7fd4('0xf'),_0x21a210,'request\x20sent');logger[_0x7fd4('0x10')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x21a210,_0x7fd4('0x11'),JSON[_0x7fd4('0x12')](_0x49adf8));if(_0x49adf8['error']){if(_0x49adf8[_0x7fd4('0x13')][_0x7fd4('0x14')]===0x1f4){logger[_0x7fd4('0x13')](_0x7fd4('0xf'),_0x21a210,_0x49adf8['error'][_0x7fd4('0x15')]);return _0x459d9f(_0x49adf8[_0x7fd4('0x13')][_0x7fd4('0x15')]);}logger[_0x7fd4('0x13')](_0x7fd4('0xf'),_0x21a210,_0x49adf8[_0x7fd4('0x13')]['message']);return _0x9a25f3(_0x49adf8[_0x7fd4('0x13')][_0x7fd4('0x15')]);}else{logger[_0x7fd4('0xe')](_0x7fd4('0xf'),_0x21a210,_0x7fd4('0x11'));_0x9a25f3(_0x49adf8[_0x7fd4('0x16')][_0x7fd4('0x15')]);}})[_0x7fd4('0x17')](function(_0x22d3b3){logger[_0x7fd4('0x13')]('VoiceMail,\x20%s,\x20%s',_0x21a210,_0x22d3b3);_0x459d9f(_0x22d3b3);});});} \ No newline at end of file +var _0x6bf6=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s'];(function(_0x3564ef,_0x4bdc10){var _0x20835e=function(_0x1f1e64){while(--_0x1f1e64){_0x3564ef['push'](_0x3564ef['shift']());}};_0x20835e(++_0x4bdc10);}(_0x6bf6,0x158));var _0x66bf=function(_0x48df04,_0x1522b1){_0x48df04=_0x48df04-0x0;var _0x4de5fa=_0x6bf6[_0x48df04];return _0x4de5fa;};'use strict';var _=require(_0x66bf('0x0'));var util=require(_0x66bf('0x1'));var moment=require(_0x66bf('0x2'));var BPromise=require(_0x66bf('0x3'));var rs=require(_0x66bf('0x4'));var fs=require('fs');var Redis=require(_0x66bf('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x66bf('0x6'));var logger=require(_0x66bf('0x7'))(_0x66bf('0x8'));var config=require(_0x66bf('0x9'));var jayson=require(_0x66bf('0xa'));var client=jayson[_0x66bf('0xb')][_0x66bf('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x48b418,_0x1f3f5e,_0x585fb6){return new BPromise(function(_0x52eabb,_0x371587){return client[_0x66bf('0xd')](_0x48b418,_0x585fb6)[_0x66bf('0xe')](function(_0x870b0){logger[_0x66bf('0xf')](_0x66bf('0x10'),_0x1f3f5e,_0x66bf('0x11'));logger[_0x66bf('0x12')](_0x66bf('0x13'),_0x1f3f5e,_0x66bf('0x11'),JSON[_0x66bf('0x14')](_0x870b0));if(_0x870b0[_0x66bf('0x15')]){if(_0x870b0[_0x66bf('0x15')][_0x66bf('0x16')]===0x1f4){logger[_0x66bf('0x15')](_0x66bf('0x10'),_0x1f3f5e,_0x870b0[_0x66bf('0x15')][_0x66bf('0x17')]);return _0x371587(_0x870b0[_0x66bf('0x15')][_0x66bf('0x17')]);}logger[_0x66bf('0x15')]('VoiceMail,\x20%s,\x20%s',_0x1f3f5e,_0x870b0['error'][_0x66bf('0x17')]);return _0x52eabb(_0x870b0[_0x66bf('0x15')]['message']);}else{logger['info'](_0x66bf('0x10'),_0x1f3f5e,_0x66bf('0x11'));_0x52eabb(_0x870b0[_0x66bf('0x18')][_0x66bf('0x17')]);}})[_0x66bf('0x19')](function(_0x3f637e){logger[_0x66bf('0x15')](_0x66bf('0x10'),_0x1f3f5e,_0x3f637e);_0x371587(_0x3f637e);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 693b71b..ed4f507 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 _0xbcea=['index','/:id','show','/:id/download','download','create','put','update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x450bf9,_0x1895de){var _0x268350=function(_0xebafa7){while(--_0xebafa7){_0x450bf9['push'](_0x450bf9['shift']());}};_0x268350(++_0x1895de);}(_0xbcea,0x137));var _0xabce=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xbcea[_0x199572];return _0x13cfa3;};'use strict';var multer=require(_0xabce('0x0'));var util=require(_0xabce('0x1'));var path=require(_0xabce('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xabce('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xabce('0x4'));var interaction=require(_0xabce('0x5'));var config=require(_0xabce('0x6'));var controller=require('./voiceMailMessage.controller');router[_0xabce('0x7')]('/',auth[_0xabce('0x8')](),controller[_0xabce('0x9')]);router['get'](_0xabce('0xa'),auth[_0xabce('0x8')](),controller[_0xabce('0xb')]);router['get'](_0xabce('0xc'),auth['isAuthenticated'](),controller[_0xabce('0xd')]);router['post']('/',auth[_0xabce('0x8')](),controller[_0xabce('0xe')]);router[_0xabce('0xf')]('/:id',auth[_0xabce('0x8')](),controller[_0xabce('0x10')]);router[_0xabce('0x11')]('/:id',auth[_0xabce('0x8')](),controller[_0xabce('0x12')]);module[_0xabce('0x13')]=router; \ No newline at end of file +var _0x25a7=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','/:id','isAuthenticated','get','/:id/download','download','create','put','update','destroy','exports','multer','path'];(function(_0x3cb11b,_0xfd38f4){var _0x37b8fc=function(_0x19e084){while(--_0x19e084){_0x3cb11b['push'](_0x3cb11b['shift']());}};_0x37b8fc(++_0xfd38f4);}(_0x25a7,0x154));var _0x725a=function(_0x29b7fa,_0x28b497){_0x29b7fa=_0x29b7fa-0x0;var _0x35b345=_0x25a7[_0x29b7fa];return _0x35b345;};'use strict';var multer=require(_0x725a('0x0'));var util=require('util');var path=require(_0x725a('0x1'));var timeout=require(_0x725a('0x2'));var express=require(_0x725a('0x3'));var router=express['Router']();var fs_extra=require(_0x725a('0x4'));var auth=require(_0x725a('0x5'));var interaction=require(_0x725a('0x6'));var config=require(_0x725a('0x7'));var controller=require(_0x725a('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x725a('0x9'),auth[_0x725a('0xa')](),controller['show']);router[_0x725a('0xb')](_0x725a('0xc'),auth[_0x725a('0xa')](),controller[_0x725a('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x725a('0xe')]);router[_0x725a('0xf')](_0x725a('0x9'),auth[_0x725a('0xa')](),controller[_0x725a('0x10')]);router['delete'](_0x725a('0x9'),auth[_0x725a('0xa')](),controller[_0x725a('0x11')]);module[_0x725a('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index d58f92a..e78c956 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 _0x011b=['INTEGER','STRING','BLOB','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','VIRTUAL','getDataValue'];(function(_0x525af9,_0x4edd23){var _0x129fbf=function(_0x4f44fe){while(--_0x4f44fe){_0x525af9['push'](_0x525af9['shift']());}};_0x129fbf(++_0x4edd23);}(_0x011b,0x135));var _0xb011=function(_0x1e7552,_0x24dd98){_0x1e7552=_0x1e7552-0x0;var _0x46e9dd=_0x011b[_0x1e7552];return _0x46e9dd;};'use strict';var Sequelize=require(_0xb011('0x0'));module['exports']={'name':{'type':Sequelize[_0xb011('0x1')],'get':function(_0x1d2f06){return this[_0xb011('0x2')]('id');}},'msgnum':{'type':Sequelize[_0xb011('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xb011('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xb011('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xb011('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xb011('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xb011('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0xb011('0x5')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0xb011('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xb011('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0xb011('0x6')](_0xb011('0x7'))}}; \ No newline at end of file +var _0x62fc=['long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','STRING'];(function(_0x336e99,_0x25995b){var _0x1afcf8=function(_0x276c62){while(--_0x276c62){_0x336e99['push'](_0x336e99['shift']());}};_0x1afcf8(++_0x25995b);}(_0x62fc,0x1c6));var _0xc62f=function(_0x571bb8,_0x174156){_0x571bb8=_0x571bb8-0x0;var _0x52b728=_0x62fc[_0x571bb8];return _0x52b728;};'use strict';var Sequelize=require(_0xc62f('0x0'));module[_0xc62f('0x1')]={'name':{'type':Sequelize[_0xc62f('0x2')],'get':function(_0x51143f){return this[_0xc62f('0x3')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0xc62f('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0xc62f('0x4')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0xc62f('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xc62f('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xc62f('0x4')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0xc62f('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0xc62f('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xc62f('0x4')],'defaultValue':''},'stamp':{'type':_0xc62f('0x6'),'defaultValue':Sequelize[_0xc62f('0x7')](_0xc62f('0x8'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 78e31e7..cf1dca4 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 _0x08d2=['query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','keys','include','find','create','body','params','recording','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','set','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','count','limit','reject','save','destroy','then','stack','send','map','VoiceMailMessage','rawAttributes','fieldName','key','model','differenceBy','name','filters'];(function(_0x39f088,_0x252868){var _0x8934d6=function(_0x5d7c15){while(--_0x5d7c15){_0x39f088['push'](_0x39f088['shift']());}};_0x8934d6(++_0x252868);}(_0x08d2,0x15b));var _0x208d=function(_0x285543,_0x3072cc){_0x285543=_0x285543-0x0;var _0x1fb8c8=_0x08d2[_0x285543];return _0x1fb8c8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x208d('0x0'));var zipdir=require(_0x208d('0x1'));var jsonpatch=require(_0x208d('0x2'));var rp=require(_0x208d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x208d('0x4'));var util=require('util');var path=require(_0x208d('0x5'));var sox=require(_0x208d('0x6'));var csv=require(_0x208d('0x7'));var ejs=require(_0x208d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x208d('0x9'));var squel=require(_0x208d('0xa'));var crypto=require(_0x208d('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x208d('0xc'));var toCsv=require(_0x208d('0x7'));var querystring=require(_0x208d('0xd'));var Papa=require(_0x208d('0xe'));var Redis=require(_0x208d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x208d('0x10'));var as=require(_0x208d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x208d('0x12'));var config=require(_0x208d('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1efa0c,_0x3e51bc){_0x3e51bc=_0x3e51bc||0xcc;return function(_0x1035bf){if(_0x1035bf){return _0x1efa0c[_0x208d('0x14')](_0x3e51bc);}return _0x1efa0c['status'](_0x3e51bc)[_0x208d('0x15')]();};}function respondWithResult(_0x2c1642,_0x4a8b46){_0x4a8b46=_0x4a8b46||0xc8;return function(_0x103400){if(_0x103400){return _0x2c1642[_0x208d('0x16')](_0x4a8b46)[_0x208d('0x17')](_0x103400);}};}function respondWithFilteredResult(_0x2c898e,_0x23a601){return function(_0xdb4cb6){if(_0xdb4cb6){var _0x22dcbe=typeof _0x23a601[_0x208d('0x18')]===_0x208d('0x19')&&typeof _0x23a601['limit']==='undefined';var _0xccd767=_0xdb4cb6[_0x208d('0x1a')];var _0x385c86=_0x22dcbe?0x0:_0x23a601['offset'];var _0x46683b=_0x22dcbe?_0xdb4cb6[_0x208d('0x1a')]:_0x23a601[_0x208d('0x18')]+_0x23a601[_0x208d('0x1b')];var _0x452ddb;if(_0x46683b>=_0xccd767){_0x46683b=_0xccd767;_0x452ddb=0xc8;}else{_0x452ddb=0xce;}_0x2c898e['status'](_0x452ddb);return _0x2c898e['set']('Content-Range',_0x385c86+'-'+_0x46683b+'/'+_0xccd767)['json'](_0xdb4cb6);}return null;};}function patchUpdates(_0x5d5ec7){return function(_0x1884c2){try{jsonpatch['apply'](_0x1884c2,_0x5d5ec7,!![]);}catch(_0x268aae){return BPromise[_0x208d('0x1c')](_0x268aae);}return _0x1884c2[_0x208d('0x1d')]();};}function saveUpdates(_0x2fea90,_0x3183ea){return function(_0x3d180c){if(_0x3d180c){return _0x3d180c['update'](_0x2fea90)['then'](function(_0x51b73b){return _0x51b73b;});}return null;};}function removeEntity(_0x1bd10a,_0x52b56e){return function(_0x10e4ec){if(_0x10e4ec){return _0x10e4ec[_0x208d('0x1e')]()[_0x208d('0x1f')](function(){_0x1bd10a[_0x208d('0x16')](0xcc)[_0x208d('0x15')]();});}};}function handleEntityNotFound(_0xa8e10,_0x42770f){return function(_0x2014a7){if(!_0x2014a7){_0xa8e10[_0x208d('0x14')](0x194);}return _0x2014a7;};}function handleError(_0xe2b1f2,_0x273e8c){_0x273e8c=_0x273e8c||0x1f4;return function(_0x32fac0){logger['error'](_0x32fac0[_0x208d('0x20')]);if(_0x32fac0['name']){delete _0x32fac0['name'];}_0xe2b1f2[_0x208d('0x16')](_0x273e8c)[_0x208d('0x21')](_0x32fac0);};}exports['index']=function(_0x84f044,_0x12ca12){var _0x123aff={},_0x4eb6d5={},_0x184de9={'count':0x0,'rows':[]};var _0x4fd706=_[_0x208d('0x22')](db[_0x208d('0x23')][_0x208d('0x24')],function(_0x120c1d){return{'name':_0x120c1d[_0x208d('0x25')],'type':_0x120c1d['type'][_0x208d('0x26')]};});_0x4eb6d5[_0x208d('0x27')]=_[_0x208d('0x28')](_[_0x208d('0x22')](_0x4fd706,'name'),[_0x208d('0x29')]);_0x4eb6d5['query']=_['keys'](_0x84f044['query']);_0x4eb6d5[_0x208d('0x2a')]=_['intersection'](_0x4eb6d5[_0x208d('0x27')],_0x4eb6d5[_0x208d('0x2b')]);_0x123aff[_0x208d('0x2c')]=_[_0x208d('0x2d')](_0x4eb6d5[_0x208d('0x27')],qs[_0x208d('0x2e')](_0x84f044[_0x208d('0x2b')]['fields']));_0x123aff['attributes']=_0x123aff[_0x208d('0x2c')][_0x208d('0x2f')]?_0x123aff['attributes']:_0x4eb6d5['model'];if(!_0x84f044[_0x208d('0x2b')][_0x208d('0x30')](_0x208d('0x31'))){_0x123aff[_0x208d('0x1b')]=qs[_0x208d('0x1b')](_0x84f044[_0x208d('0x2b')][_0x208d('0x1b')]);_0x123aff[_0x208d('0x18')]=qs[_0x208d('0x18')](_0x84f044[_0x208d('0x2b')][_0x208d('0x18')]);}_0x123aff[_0x208d('0x32')]=qs[_0x208d('0x33')](_0x84f044['query'][_0x208d('0x33')]);_0x123aff[_0x208d('0x34')]=qs[_0x208d('0x2a')](_['pick'](_0x84f044[_0x208d('0x2b')],_0x4eb6d5[_0x208d('0x2a')]),_0x4fd706);if(_0x84f044[_0x208d('0x2b')][_0x208d('0x35')]){_0x123aff[_0x208d('0x34')]=_[_0x208d('0x36')](_0x123aff[_0x208d('0x34')],{'$or':_[_0x208d('0x22')](_0x4fd706,function(_0x56f4fe){if(_0x56f4fe[_0x208d('0x37')]!==_0x208d('0x38')){var _0x507b1c={};_0x507b1c[_0x56f4fe['name']]={'$like':'%'+_0x84f044[_0x208d('0x2b')][_0x208d('0x35')]+'%'};return _0x507b1c;}})});}_0x123aff=_[_0x208d('0x36')]({},_0x123aff,_0x84f044[_0x208d('0x39')]);var _0x1768b0={'where':_0x123aff[_0x208d('0x34')]};return db[_0x208d('0x23')]['count'](_0x1768b0)[_0x208d('0x1f')](function(_0x201401){_0x184de9['count']=_0x201401;if(_0x84f044[_0x208d('0x2b')][_0x208d('0x3a')]){_0x123aff['include']=[{'all':!![]}];}return db[_0x208d('0x23')][_0x208d('0x3b')](_0x123aff);})[_0x208d('0x1f')](function(_0x4fffa7){_0x184de9[_0x208d('0x3c')]=_0x4fffa7;return _0x184de9;})[_0x208d('0x1f')](respondWithFilteredResult(_0x12ca12,_0x123aff))[_0x208d('0x3d')](handleError(_0x12ca12,null));};exports[_0x208d('0x3e')]=function(_0x3a867f,_0x4907ed){var _0x4d1c01={'raw':!![],'where':{'id':_0x3a867f['params']['id']}},_0x1ec3af={};_0x1ec3af[_0x208d('0x27')]=_[_0x208d('0x3f')](db[_0x208d('0x23')]['rawAttributes']);_0x1ec3af[_0x208d('0x2b')]=_['keys'](_0x3a867f[_0x208d('0x2b')]);_0x1ec3af[_0x208d('0x2a')]=_[_0x208d('0x2d')](_0x1ec3af['model'],_0x1ec3af[_0x208d('0x2b')]);_0x4d1c01[_0x208d('0x2c')]=_[_0x208d('0x2d')](_0x1ec3af[_0x208d('0x27')],qs[_0x208d('0x2e')](_0x3a867f[_0x208d('0x2b')][_0x208d('0x2e')]));_0x4d1c01[_0x208d('0x2c')]=_0x4d1c01['attributes']['length']?_0x4d1c01['attributes']:_0x1ec3af[_0x208d('0x27')];if(_0x3a867f['query']['includeAll']){_0x4d1c01[_0x208d('0x40')]=[{'all':!![]}];}_0x4d1c01=_['merge']({},_0x4d1c01,_0x3a867f[_0x208d('0x39')]);return db['VoiceMailMessage'][_0x208d('0x41')](_0x4d1c01)[_0x208d('0x1f')](handleEntityNotFound(_0x4907ed,null))[_0x208d('0x1f')](respondWithResult(_0x4907ed,null))[_0x208d('0x3d')](handleError(_0x4907ed,null));};exports[_0x208d('0x42')]=function(_0x439b55,_0x430c51){return db[_0x208d('0x23')][_0x208d('0x42')](_0x439b55['body'],{})[_0x208d('0x1f')](respondWithResult(_0x430c51,0xc9))[_0x208d('0x3d')](handleError(_0x430c51,null));};exports['update']=function(_0xe18a4e,_0x2d29aa){if(_0xe18a4e[_0x208d('0x43')]['id']){delete _0xe18a4e[_0x208d('0x43')]['id'];}return db['VoiceMailMessage'][_0x208d('0x41')]({'where':{'id':_0xe18a4e['params']['id']}})[_0x208d('0x1f')](handleEntityNotFound(_0x2d29aa,null))['then'](saveUpdates(_0xe18a4e['body'],null))[_0x208d('0x1f')](respondWithResult(_0x2d29aa,null))[_0x208d('0x3d')](handleError(_0x2d29aa,null));};exports['destroy']=function(_0x17e849,_0x4a50b2){return db[_0x208d('0x23')]['find']({'where':{'id':_0x17e849['params']['id']}})['then'](handleEntityNotFound(_0x4a50b2,null))[_0x208d('0x1f')](removeEntity(_0x4a50b2,null))[_0x208d('0x3d')](handleError(_0x4a50b2,null));};exports['download']=function(_0x587913,_0xf932ac,_0x116312){return db[_0x208d('0x23')][_0x208d('0x41')]({'where':{'id':_0x587913[_0x208d('0x44')]['id']},'attributes':['id',_0x208d('0x45'),_0x208d('0x46')]})[_0x208d('0x1f')](handleEntityNotFound(_0xf932ac,null))[_0x208d('0x1f')](function(_0x4b2508){if(_0x4b2508){if(!_0x4b2508['recording']){throw new db[(_0x208d('0x47'))]['ValidationError'](_0x208d('0x48'));}var _0x5670d1={'Content-Type':_0x208d('0x49'),'Content-Disposition':'attachment'};if(_0x4b2508[_0x208d('0x46')]){_0x5670d1[_0x208d('0x4a')]=_0x208d('0x4b')+_0x4b2508[_0x208d('0x46')]+_0x208d('0x4c');}_0xf932ac[_0x208d('0x4d')](_0x5670d1);return _0xf932ac[_0x208d('0x21')](new Buffer(_0x4b2508['recording']));}})[_0x208d('0x3d')](handleError(_0xf932ac,null));}; \ No newline at end of file +var _0x41c6=['ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','attachment;\x20filename=\x22','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','save','update','then','destroy','error','stack','send','index','map','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','merge','filter','options','VoiceMailMessage','includeAll','findAll','rows','catch','show','params','include','create','body','find','download','msg_id','recording','Sequelize'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x41c6,0x151));var _0x641c=function(_0x3ccb1c,_0x565790){_0x3ccb1c=_0x3ccb1c-0x0;var _0x4262ac=_0x41c6[_0x3ccb1c];return _0x4262ac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x641c('0x0'));var zipdir=require(_0x641c('0x1'));var jsonpatch=require(_0x641c('0x2'));var rp=require('request-promise');var moment=require(_0x641c('0x3'));var BPromise=require(_0x641c('0x4'));var Mustache=require(_0x641c('0x5'));var util=require('util');var path=require(_0x641c('0x6'));var sox=require(_0x641c('0x7'));var csv=require(_0x641c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x641c('0x9'));var _=require('lodash');var squel=require(_0x641c('0xa'));var crypto=require(_0x641c('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x641c('0xc'));var toCsv=require(_0x641c('0x8'));var querystring=require(_0x641c('0xd'));var Papa=require(_0x641c('0xe'));var Redis=require(_0x641c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x641c('0x10'));var as=require(_0x641c('0x11'));var hardwareService=require(_0x641c('0x12'));var logger=require(_0x641c('0x13'))(_0x641c('0x14'));var utils=require(_0x641c('0x15'));var config=require(_0x641c('0x16'));var licenseUtil=require(_0x641c('0x17'));var db=require(_0x641c('0x18'))['db'];function respondWithStatusCode(_0x5d9a95,_0x3c5314){_0x3c5314=_0x3c5314||0xcc;return function(_0x1ed298){if(_0x1ed298){return _0x5d9a95[_0x641c('0x19')](_0x3c5314);}return _0x5d9a95[_0x641c('0x1a')](_0x3c5314)[_0x641c('0x1b')]();};}function respondWithResult(_0x27c2f1,_0x10f945){_0x10f945=_0x10f945||0xc8;return function(_0x37a88b){if(_0x37a88b){return _0x27c2f1[_0x641c('0x1a')](_0x10f945)['json'](_0x37a88b);}};}function respondWithFilteredResult(_0x196739,_0x2c7ffd){return function(_0x37ac70){if(_0x37ac70){var _0x4fd65b=typeof _0x2c7ffd[_0x641c('0x1c')]===_0x641c('0x1d')&&typeof _0x2c7ffd[_0x641c('0x1e')]===_0x641c('0x1d');var _0x1f2e82=_0x37ac70[_0x641c('0x1f')];var _0xf9c2bf=_0x4fd65b?0x0:_0x2c7ffd[_0x641c('0x1c')];var _0x2b83b0=_0x4fd65b?_0x37ac70[_0x641c('0x1f')]:_0x2c7ffd[_0x641c('0x1c')]+_0x2c7ffd[_0x641c('0x1e')];var _0x59fab2;if(_0x2b83b0>=_0x1f2e82){_0x2b83b0=_0x1f2e82;_0x59fab2=0xc8;}else{_0x59fab2=0xce;}_0x196739['status'](_0x59fab2);return _0x196739[_0x641c('0x20')]('Content-Range',_0xf9c2bf+'-'+_0x2b83b0+'/'+_0x1f2e82)['json'](_0x37ac70);}return null;};}function patchUpdates(_0x45753f){return function(_0x456aa7){try{jsonpatch['apply'](_0x456aa7,_0x45753f,!![]);}catch(_0x164de1){return BPromise['reject'](_0x164de1);}return _0x456aa7[_0x641c('0x21')]();};}function saveUpdates(_0x19456a,_0x3b00ac){return function(_0x19cbce){if(_0x19cbce){return _0x19cbce[_0x641c('0x22')](_0x19456a)[_0x641c('0x23')](function(_0x1c3b84){return _0x1c3b84;});}return null;};}function removeEntity(_0x1da85a,_0x482f4c){return function(_0x477f6f){if(_0x477f6f){return _0x477f6f[_0x641c('0x24')]()[_0x641c('0x23')](function(){_0x1da85a[_0x641c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30471b,_0x346abc){return function(_0x3edd5a){if(!_0x3edd5a){_0x30471b[_0x641c('0x19')](0x194);}return _0x3edd5a;};}function handleError(_0x4e8df7,_0x6d1eb8){_0x6d1eb8=_0x6d1eb8||0x1f4;return function(_0x1ae6fc){logger[_0x641c('0x25')](_0x1ae6fc[_0x641c('0x26')]);if(_0x1ae6fc['name']){delete _0x1ae6fc['name'];}_0x4e8df7['status'](_0x6d1eb8)[_0x641c('0x27')](_0x1ae6fc);};}exports[_0x641c('0x28')]=function(_0x48625e,_0x12db36){var _0x116bb0={},_0x2a1eff={},_0x110373={'count':0x0,'rows':[]};var _0x3c1b24=_[_0x641c('0x29')](db['VoiceMailMessage'][_0x641c('0x2a')],function(_0x51eac7){return{'name':_0x51eac7[_0x641c('0x2b')],'type':_0x51eac7[_0x641c('0x2c')][_0x641c('0x2d')]};});_0x2a1eff['model']=_['differenceBy'](_[_0x641c('0x29')](_0x3c1b24,_0x641c('0x2e')),[_0x641c('0x2e')]);_0x2a1eff[_0x641c('0x2f')]=_[_0x641c('0x30')](_0x48625e[_0x641c('0x2f')]);_0x2a1eff[_0x641c('0x31')]=_[_0x641c('0x32')](_0x2a1eff[_0x641c('0x33')],_0x2a1eff['query']);_0x116bb0[_0x641c('0x34')]=_[_0x641c('0x32')](_0x2a1eff[_0x641c('0x33')],qs[_0x641c('0x35')](_0x48625e[_0x641c('0x2f')]['fields']));_0x116bb0['attributes']=_0x116bb0[_0x641c('0x34')][_0x641c('0x36')]?_0x116bb0[_0x641c('0x34')]:_0x2a1eff[_0x641c('0x33')];if(!_0x48625e[_0x641c('0x2f')]['hasOwnProperty'](_0x641c('0x37'))){_0x116bb0[_0x641c('0x1e')]=qs[_0x641c('0x1e')](_0x48625e[_0x641c('0x2f')][_0x641c('0x1e')]);_0x116bb0[_0x641c('0x1c')]=qs['offset'](_0x48625e[_0x641c('0x2f')][_0x641c('0x1c')]);}_0x116bb0[_0x641c('0x38')]=qs[_0x641c('0x39')](_0x48625e[_0x641c('0x2f')][_0x641c('0x39')]);_0x116bb0[_0x641c('0x3a')]=qs[_0x641c('0x31')](_[_0x641c('0x3b')](_0x48625e[_0x641c('0x2f')],_0x2a1eff['filters']),_0x3c1b24);if(_0x48625e[_0x641c('0x2f')]['filter']){_0x116bb0[_0x641c('0x3a')]=_[_0x641c('0x3c')](_0x116bb0['where'],{'$or':_[_0x641c('0x29')](_0x3c1b24,function(_0x56dc70){if(_0x56dc70['type']!=='VIRTUAL'){var _0x231a9a={};_0x231a9a[_0x56dc70['name']]={'$like':'%'+_0x48625e[_0x641c('0x2f')][_0x641c('0x3d')]+'%'};return _0x231a9a;}})});}_0x116bb0=_[_0x641c('0x3c')]({},_0x116bb0,_0x48625e[_0x641c('0x3e')]);var _0x457eda={'where':_0x116bb0['where']};return db[_0x641c('0x3f')][_0x641c('0x1f')](_0x457eda)['then'](function(_0x256df8){_0x110373[_0x641c('0x1f')]=_0x256df8;if(_0x48625e[_0x641c('0x2f')][_0x641c('0x40')]){_0x116bb0['include']=[{'all':!![]}];}return db[_0x641c('0x3f')][_0x641c('0x41')](_0x116bb0);})[_0x641c('0x23')](function(_0x4bc597){_0x110373[_0x641c('0x42')]=_0x4bc597;return _0x110373;})['then'](respondWithFilteredResult(_0x12db36,_0x116bb0))[_0x641c('0x43')](handleError(_0x12db36,null));};exports[_0x641c('0x44')]=function(_0x33ef03,_0x595550){var _0x143140={'raw':!![],'where':{'id':_0x33ef03[_0x641c('0x45')]['id']}},_0x5e5d32={};_0x5e5d32[_0x641c('0x33')]=_[_0x641c('0x30')](db[_0x641c('0x3f')][_0x641c('0x2a')]);_0x5e5d32['query']=_[_0x641c('0x30')](_0x33ef03[_0x641c('0x2f')]);_0x5e5d32[_0x641c('0x31')]=_['intersection'](_0x5e5d32['model'],_0x5e5d32['query']);_0x143140[_0x641c('0x34')]=_[_0x641c('0x32')](_0x5e5d32[_0x641c('0x33')],qs[_0x641c('0x35')](_0x33ef03[_0x641c('0x2f')][_0x641c('0x35')]));_0x143140[_0x641c('0x34')]=_0x143140[_0x641c('0x34')]['length']?_0x143140['attributes']:_0x5e5d32[_0x641c('0x33')];if(_0x33ef03[_0x641c('0x2f')]['includeAll']){_0x143140[_0x641c('0x46')]=[{'all':!![]}];}_0x143140=_[_0x641c('0x3c')]({},_0x143140,_0x33ef03[_0x641c('0x3e')]);return db[_0x641c('0x3f')]['find'](_0x143140)[_0x641c('0x23')](handleEntityNotFound(_0x595550,null))['then'](respondWithResult(_0x595550,null))['catch'](handleError(_0x595550,null));};exports[_0x641c('0x47')]=function(_0x196be8,_0x1ea005){return db[_0x641c('0x3f')][_0x641c('0x47')](_0x196be8[_0x641c('0x48')],{})[_0x641c('0x23')](respondWithResult(_0x1ea005,0xc9))[_0x641c('0x43')](handleError(_0x1ea005,null));};exports[_0x641c('0x22')]=function(_0x51c0eb,_0x58da1c){if(_0x51c0eb[_0x641c('0x48')]['id']){delete _0x51c0eb[_0x641c('0x48')]['id'];}return db[_0x641c('0x3f')][_0x641c('0x49')]({'where':{'id':_0x51c0eb[_0x641c('0x45')]['id']}})[_0x641c('0x23')](handleEntityNotFound(_0x58da1c,null))[_0x641c('0x23')](saveUpdates(_0x51c0eb[_0x641c('0x48')],null))['then'](respondWithResult(_0x58da1c,null))['catch'](handleError(_0x58da1c,null));};exports[_0x641c('0x24')]=function(_0x3bc13c,_0x4d929b){return db[_0x641c('0x3f')]['find']({'where':{'id':_0x3bc13c['params']['id']}})[_0x641c('0x23')](handleEntityNotFound(_0x4d929b,null))[_0x641c('0x23')](removeEntity(_0x4d929b,null))['catch'](handleError(_0x4d929b,null));};exports[_0x641c('0x4a')]=function(_0x47c818,_0x51f9c7,_0x1b1ed3){return db[_0x641c('0x3f')]['find']({'where':{'id':_0x47c818[_0x641c('0x45')]['id']},'attributes':['id','recording',_0x641c('0x4b')]})['then'](handleEntityNotFound(_0x51f9c7,null))['then'](function(_0x1dae3a){if(_0x1dae3a){if(!_0x1dae3a[_0x641c('0x4c')]){throw new db[(_0x641c('0x4d'))][(_0x641c('0x4e'))](_0x641c('0x4f'));}var _0x2460e3={'Content-Type':_0x641c('0x50'),'Content-Disposition':_0x641c('0x51')};if(_0x1dae3a[_0x641c('0x4b')]){_0x2460e3['Content-Disposition']=_0x641c('0x52')+_0x1dae3a[_0x641c('0x4b')]+'.wav\x22';}_0x51f9c7[_0x641c('0x20')](_0x2460e3);return _0x51f9c7[_0x641c('0x27')](new Buffer(_0x1dae3a[_0x641c('0x4c')]));}})[_0x641c('0x43')](handleError(_0x51f9c7,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index f2665eb..c759cad 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 _0x0a10=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceMailMessage.attributes','define','voice_voicemail_messages','dir'];(function(_0x3228b7,_0x4b1e76){var _0x32015f=function(_0x13814c){while(--_0x13814c){_0x3228b7['push'](_0x3228b7['shift']());}};_0x32015f(++_0x4b1e76);}(_0x0a10,0x108));var _0x00a1=function(_0x5537e6,_0xddf3dc){_0x5537e6=_0x5537e6-0x0;var _0x44115a=_0x0a10[_0x5537e6];return _0x44115a;};'use strict';var _=require(_0x00a1('0x0'));var util=require(_0x00a1('0x1'));var logger=require('../../config/logger')(_0x00a1('0x2'));var moment=require(_0x00a1('0x3'));var BPromise=require(_0x00a1('0x4'));var rp=require(_0x00a1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x00a1('0x6'));var config=require(_0x00a1('0x7'));var attributes=require(_0x00a1('0x8'));module['exports']=function(_0xb5161b,_0x56f615){return _0xb5161b[_0x00a1('0x9')]('VoiceMailMessage',attributes,{'tableName':_0x00a1('0xa'),'paranoid':![],'indexes':[{'name':_0x00a1('0xb'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file +var _0x08b5=['util','api','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','voice_voicemail_messages','dir','lodash'];(function(_0x1d0bdd,_0x52c6d1){var _0x205377=function(_0x2ff6fc){while(--_0x2ff6fc){_0x1d0bdd['push'](_0x1d0bdd['shift']());}};_0x205377(++_0x52c6d1);}(_0x08b5,0x77));var _0x508b=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x08b5[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0x508b('0x0'));var util=require(_0x508b('0x1'));var logger=require('../../config/logger')(_0x508b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x508b('0x3'));var fs=require('fs');var path=require(_0x508b('0x4'));var rimraf=require(_0x508b('0x5'));var config=require(_0x508b('0x6'));var attributes=require(_0x508b('0x7'));module[_0x508b('0x8')]=function(_0x7d4c76,_0x2b4f59){return _0x7d4c76[_0x508b('0x9')]('VoiceMailMessage',attributes,{'tableName':_0x508b('0xa'),'paranoid':![],'indexes':[{'name':_0x508b('0xb'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index a40258e..5bc45f2 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 _0xf78f=['then','info','VoiceMailMessage,\x20%s,\x20%s','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xf78f,0x128));var _0xff78=function(_0x2f80db,_0x1d38ea){_0x2f80db=_0x2f80db-0x0;var _0x5f5a26=_0xf78f[_0x2f80db];return _0x5f5a26;};'use strict';var _=require(_0xff78('0x0'));var util=require(_0xff78('0x1'));var moment=require(_0xff78('0x2'));var BPromise=require(_0xff78('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xff78('0x4'));var db=require(_0xff78('0x5'))['db'];var utils=require(_0xff78('0x6'));var logger=require(_0xff78('0x7'))('rpc');var config=require(_0xff78('0x8'));var jayson=require(_0xff78('0x9'));var client=jayson[_0xff78('0xa')][_0xff78('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe35633,_0x1f30a2,_0x5cfb28){return new BPromise(function(_0x44d13f,_0x13b9f2){return client['request'](_0xe35633,_0x5cfb28)[_0xff78('0xc')](function(_0x1f79cc){logger[_0xff78('0xd')](_0xff78('0xe'),_0x1f30a2,'request\x20sent');logger[_0xff78('0xf')](_0xff78('0x10'),_0x1f30a2,_0xff78('0x11'),JSON['stringify'](_0x1f79cc));if(_0x1f79cc[_0xff78('0x12')]){if(_0x1f79cc[_0xff78('0x12')][_0xff78('0x13')]===0x1f4){logger[_0xff78('0x12')](_0xff78('0xe'),_0x1f30a2,_0x1f79cc[_0xff78('0x12')]['message']);return _0x13b9f2(_0x1f79cc[_0xff78('0x12')][_0xff78('0x14')]);}logger[_0xff78('0x12')](_0xff78('0xe'),_0x1f30a2,_0x1f79cc[_0xff78('0x12')]['message']);return _0x44d13f(_0x1f79cc[_0xff78('0x12')]['message']);}else{logger[_0xff78('0xd')](_0xff78('0xe'),_0x1f30a2,_0xff78('0x11'));_0x44d13f(_0x1f79cc['result'][_0xff78('0x14')]);}})[_0xff78('0x15')](function(_0x433c03){logger[_0xff78('0x12')]('VoiceMailMessage,\x20%s,\x20%s',_0x1f30a2,_0x433c03);_0x13b9f2(_0x433c03);});});} \ No newline at end of file +var _0x210b=['request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','ioredis','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x4a4ef3,_0x45a9b9){var _0x3e83da=function(_0x42ce7b){while(--_0x42ce7b){_0x4a4ef3['push'](_0x4a4ef3['shift']());}};_0x3e83da(++_0x45a9b9);}(_0x210b,0xc9));var _0xb210=function(_0x1b4002,_0x5b4094){_0x1b4002=_0x1b4002-0x0;var _0x1716f3=_0x210b[_0x1b4002];return _0x1716f3;};'use strict';var _=require(_0xb210('0x0'));var util=require(_0xb210('0x1'));var moment=require('moment');var BPromise=require(_0xb210('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb210('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb210('0x4'));var config=require(_0xb210('0x5'));var jayson=require(_0xb210('0x6'));var client=jayson[_0xb210('0x7')][_0xb210('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4c430a,_0x570c33,_0x1634a8){return new BPromise(function(_0x2397b1,_0x3533c3){return client[_0xb210('0x9')](_0x4c430a,_0x1634a8)[_0xb210('0xa')](function(_0x5e68ae){logger[_0xb210('0xb')](_0xb210('0xc'),_0x570c33,_0xb210('0xd'));logger[_0xb210('0xe')](_0xb210('0xf'),_0x570c33,_0xb210('0xd'),JSON[_0xb210('0x10')](_0x5e68ae));if(_0x5e68ae[_0xb210('0x11')]){if(_0x5e68ae[_0xb210('0x11')]['code']===0x1f4){logger[_0xb210('0x11')](_0xb210('0xc'),_0x570c33,_0x5e68ae[_0xb210('0x11')][_0xb210('0x12')]);return _0x3533c3(_0x5e68ae['error'][_0xb210('0x12')]);}logger[_0xb210('0x11')](_0xb210('0xc'),_0x570c33,_0x5e68ae[_0xb210('0x11')]['message']);return _0x2397b1(_0x5e68ae[_0xb210('0x11')][_0xb210('0x12')]);}else{logger[_0xb210('0xb')](_0xb210('0xc'),_0x570c33,_0xb210('0xd'));_0x2397b1(_0x5e68ae[_0xb210('0x13')][_0xb210('0x12')]);}})[_0xb210('0x14')](function(_0xb2c3e){logger['error'](_0xb210('0xc'),_0x570c33,_0xb2c3e);_0x3533c3(_0xb2c3e);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 9af89ca..59946aa 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 _0x6ac1=['util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMusicOnHold.controller','get','/:id','isAuthenticated','getSounds','post','create','put','update','delete','exports','multer'];(function(_0xe98431,_0x18e4a0){var _0x4a03d9=function(_0x53002a){while(--_0x53002a){_0xe98431['push'](_0xe98431['shift']());}};_0x4a03d9(++_0x18e4a0);}(_0x6ac1,0x7d));var _0x16ac=function(_0xa5fdf4,_0x553bc8){_0xa5fdf4=_0xa5fdf4-0x0;var _0x45a73d=_0x6ac1[_0xa5fdf4];return _0x45a73d;};'use strict';var multer=require(_0x16ac('0x0'));var util=require(_0x16ac('0x1'));var path=require(_0x16ac('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x16ac('0x3')]();var fs_extra=require(_0x16ac('0x4'));var auth=require(_0x16ac('0x5'));var interaction=require(_0x16ac('0x6'));var config=require('../../config/environment');var controller=require(_0x16ac('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x16ac('0x8')](_0x16ac('0x9'),auth[_0x16ac('0xa')](),controller['show']);router[_0x16ac('0x8')]('/:id/sounds',auth['isAuthenticated'](),controller[_0x16ac('0xb')]);router[_0x16ac('0xc')]('/',auth[_0x16ac('0xa')](),controller[_0x16ac('0xd')]);router[_0x16ac('0xc')]('/:id/sounds',auth[_0x16ac('0xa')](),controller['addSound']);router[_0x16ac('0xe')](_0x16ac('0x9'),auth[_0x16ac('0xa')](),controller[_0x16ac('0xf')]);router[_0x16ac('0x10')](_0x16ac('0x9'),auth[_0x16ac('0xa')](),controller['destroy']);router[_0x16ac('0x10')]('/:id/sounds/:id2',auth[_0x16ac('0xa')](),controller['removeSound']);module[_0x16ac('0x11')]=router; \ No newline at end of file +var _0xd894=['put','update','delete','destroy','/:id/sounds/:id2','removeSound','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','/:id/sounds','create'];(function(_0x2b4cd3,_0x3b5c02){var _0x29447a=function(_0x1d5595){while(--_0x1d5595){_0x2b4cd3['push'](_0x2b4cd3['shift']());}};_0x29447a(++_0x3b5c02);}(_0xd894,0x176));var _0x4d89=function(_0xf541e,_0x5065a4){_0xf541e=_0xf541e-0x0;var _0x2bb5d9=_0xd894[_0xf541e];return _0x2bb5d9;};'use strict';var multer=require(_0x4d89('0x0'));var util=require(_0x4d89('0x1'));var path=require(_0x4d89('0x2'));var timeout=require(_0x4d89('0x3'));var express=require(_0x4d89('0x4'));var router=express[_0x4d89('0x5')]();var fs_extra=require(_0x4d89('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x4d89('0x7'));var config=require(_0x4d89('0x8'));var controller=require(_0x4d89('0x9'));router[_0x4d89('0xa')]('/',auth[_0x4d89('0xb')](),controller[_0x4d89('0xc')]);router[_0x4d89('0xa')](_0x4d89('0xd'),auth[_0x4d89('0xb')](),controller[_0x4d89('0xe')]);router[_0x4d89('0xa')](_0x4d89('0xf'),auth[_0x4d89('0xb')](),controller['getSounds']);router['post']('/',auth[_0x4d89('0xb')](),controller[_0x4d89('0x10')]);router['post'](_0x4d89('0xf'),auth[_0x4d89('0xb')](),controller['addSound']);router[_0x4d89('0x11')](_0x4d89('0xd'),auth[_0x4d89('0xb')](),controller[_0x4d89('0x12')]);router[_0x4d89('0x13')](_0x4d89('0xd'),auth[_0x4d89('0xb')](),controller[_0x4d89('0x14')]);router[_0x4d89('0x13')](_0x4d89('0x15'),auth[_0x4d89('0xb')](),controller[_0x4d89('0x16')]);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 d542795..b5a2656 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 _0xaa25=['sequelize','exports','name','ENUM','custom','files','mp3nb','quietmp3','STRING','alpha','TIMESTAMP','BOOLEAN'];(function(_0x5ceb9c,_0x52f459){var _0x1c7bfc=function(_0x2acf45){while(--_0x2acf45){_0x5ceb9c['push'](_0x5ceb9c['shift']());}};_0x1c7bfc(++_0x52f459);}(_0xaa25,0xb4));var _0x5aa2=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xaa25[_0x51020b];return _0x371e47;};'use strict';var Sequelize=require(_0x5aa2('0x0'));module[_0x5aa2('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x5aa2('0x2')},'mode':{'type':Sequelize[_0x5aa2('0x3')](_0x5aa2('0x4'),_0x5aa2('0x5'),_0x5aa2('0x6'),'quietmp3nb',_0x5aa2('0x7'),'mp3'),'allowNull':!![],'defaultValue':_0x5aa2('0x5')},'directory':{'type':Sequelize[_0x5aa2('0x8')],'allowNull':!![]},'application':{'type':Sequelize[_0x5aa2('0x8')],'allowNull':!![]},'digit':{'type':Sequelize[_0x5aa2('0x8')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x5aa2('0x9')},'format':{'type':Sequelize[_0x5aa2('0x8')],'allowNull':!![]},'stamp':{'type':_0x5aa2('0xa')},'defaultEntry':{'type':Sequelize[_0x5aa2('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0635=['exports','name','ENUM','files','mp3nb','quietmp3nb','quietmp3','mp3','STRING','alpha','TIMESTAMP','BOOLEAN','sequelize'];(function(_0x2bd1ec,_0x3fe65f){var _0x2f7577=function(_0x5234fb){while(--_0x5234fb){_0x2bd1ec['push'](_0x2bd1ec['shift']());}};_0x2f7577(++_0x3fe65f);}(_0x0635,0x1b9));var _0x5063=function(_0x49af33,_0x120748){_0x49af33=_0x49af33-0x0;var _0x5e18b6=_0x0635[_0x49af33];return _0x5e18b6;};'use strict';var Sequelize=require(_0x5063('0x0'));module[_0x5063('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x5063('0x2')},'mode':{'type':Sequelize[_0x5063('0x3')]('custom',_0x5063('0x4'),_0x5063('0x5'),_0x5063('0x6'),_0x5063('0x7'),_0x5063('0x8')),'allowNull':!![],'defaultValue':_0x5063('0x4')},'directory':{'type':Sequelize[_0x5063('0x9')],'allowNull':!![]},'application':{'type':Sequelize[_0x5063('0x9')],'allowNull':!![]},'digit':{'type':Sequelize[_0x5063('0x9')],'allowNull':!![]},'sort':{'type':Sequelize[_0x5063('0x9')],'allowNull':!![],'defaultValue':_0x5063('0xa')},'format':{'type':Sequelize[_0x5063('0x9')],'allowNull':!![]},'stamp':{'type':_0x5063('0xb')},'defaultEntry':{'type':Sequelize[_0x5063('0xc')],'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 4d1e435..1069add 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 _0xb3fd=['api','../../config/utils','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','get','MusicOnHolds','UserProfileResource','then','error','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','model','keys','filters','intersection','attributes','fields','query','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','rows','catch','show','params','find','body','create','transaction','files','directory','root','server/files/moh','mode','mkdirSync','0777','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','forEach','unlinkSync','join','rmdirSync','message','save_name','converted_format','server/files/sounds/converted','format','%s.%s','basename','extname','symlinkSync','Sequelize','removeSound','findOne','id2','Sound','createdAt','ValidationError','getSounds','length','eml-format','rimraf','zip-dir','request-promise','moment','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/logger'];(function(_0x1a15d9,_0x4f1731){var _0x3464c6=function(_0x7c1fc1){while(--_0x7c1fc1){_0x1a15d9['push'](_0x1a15d9['shift']());}};_0x3464c6(++_0x4f1731);}(_0xb3fd,0x1b2));var _0xdb3f=function(_0x3885c1,_0x61ea3c){_0x3885c1=_0x3885c1-0x0;var _0x3bacf7=_0xb3fd[_0x3885c1];return _0x3bacf7;};'use strict';var emlformat=require(_0xdb3f('0x0'));var rimraf=require(_0xdb3f('0x1'));var zipdir=require(_0xdb3f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdb3f('0x3'));var moment=require(_0xdb3f('0x4'));var BPromise=require(_0xdb3f('0x5'));var Mustache=require(_0xdb3f('0x6'));var util=require(_0xdb3f('0x7'));var path=require(_0xdb3f('0x8'));var sox=require(_0xdb3f('0x9'));var csv=require(_0xdb3f('0xa'));var ejs=require(_0xdb3f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdb3f('0xc'));var squel=require(_0xdb3f('0xd'));var crypto=require('crypto');var jsforce=require(_0xdb3f('0xe'));var deskjs=require(_0xdb3f('0xf'));var toCsv=require(_0xdb3f('0xa'));var querystring=require(_0xdb3f('0x10'));var Papa=require(_0xdb3f('0x11'));var Redis=require('ioredis');var authService=require(_0xdb3f('0x12'));var qs=require(_0xdb3f('0x13'));var as=require(_0xdb3f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdb3f('0x15'))(_0xdb3f('0x16'));var utils=require(_0xdb3f('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdb3f('0x18'))['db'];function respondWithStatusCode(_0x210a22,_0x11a3ee){_0x11a3ee=_0x11a3ee||0xcc;return function(_0x5e96a5){if(_0x5e96a5){return _0x210a22[_0xdb3f('0x19')](_0x11a3ee);}return _0x210a22[_0xdb3f('0x1a')](_0x11a3ee)[_0xdb3f('0x1b')]();};}function respondWithResult(_0x2b0419,_0x1b6388){_0x1b6388=_0x1b6388||0xc8;return function(_0x1d602f){if(_0x1d602f){return _0x2b0419[_0xdb3f('0x1a')](_0x1b6388)['json'](_0x1d602f);}};}function respondWithFilteredResult(_0x12a994,_0x2942f5){return function(_0x481db3){if(_0x481db3){var _0x396625=typeof _0x2942f5['offset']===_0xdb3f('0x1c')&&typeof _0x2942f5[_0xdb3f('0x1d')]==='undefined';var _0x1d4b79=_0x481db3[_0xdb3f('0x1e')];var _0x13f084=_0x396625?0x0:_0x2942f5[_0xdb3f('0x1f')];var _0x4656c4=_0x396625?_0x481db3[_0xdb3f('0x1e')]:_0x2942f5[_0xdb3f('0x1f')]+_0x2942f5[_0xdb3f('0x1d')];var _0x3976ed;if(_0x4656c4>=_0x1d4b79){_0x4656c4=_0x1d4b79;_0x3976ed=0xc8;}else{_0x3976ed=0xce;}_0x12a994[_0xdb3f('0x1a')](_0x3976ed);return _0x12a994[_0xdb3f('0x20')](_0xdb3f('0x21'),_0x13f084+'-'+_0x4656c4+'/'+_0x1d4b79)[_0xdb3f('0x22')](_0x481db3);}return null;};}function patchUpdates(_0x3b8223){return function(_0x3c606b){try{jsonpatch[_0xdb3f('0x23')](_0x3c606b,_0x3b8223,!![]);}catch(_0x533bb6){return BPromise[_0xdb3f('0x24')](_0x533bb6);}return _0x3c606b[_0xdb3f('0x25')]();};}function saveUpdates(_0x5fab16,_0x5321e5){return function(_0x5b4cf6){if(_0x5b4cf6){return _0x5b4cf6[_0xdb3f('0x26')](_0x5fab16)['then'](function(_0x47bb56){return _0x47bb56;});}return null;};}function removeEntity(_0x57b437,_0x1ac630){return function(_0x1ce359){if(_0x1ce359){return _0x1ce359[_0xdb3f('0x27')]()['then'](function(){var _0x343fd8=_0x1ce359[_0xdb3f('0x28')]({'plain':!![]});var _0x503454=_0xdb3f('0x29');return db[_0xdb3f('0x2a')]['destroy']({'where':{'type':_0x503454,'resourceId':_0x343fd8['id']}})[_0xdb3f('0x2b')](function(){return _0x1ce359;});})[_0xdb3f('0x2b')](function(){_0x57b437[_0xdb3f('0x1a')](0xcc)[_0xdb3f('0x1b')]();});}};}function handleEntityNotFound(_0x3f36fa,_0x5cde4e){return function(_0x2bd5c4){if(!_0x2bd5c4){_0x3f36fa['sendStatus'](0x194);}return _0x2bd5c4;};}function handleError(_0x1196a5,_0x143471){_0x143471=_0x143471||0x1f4;return function(_0x303669){logger[_0xdb3f('0x2c')](_0x303669[_0xdb3f('0x2d')]);if(_0x303669[_0xdb3f('0x2e')]){delete _0x303669[_0xdb3f('0x2e')];}_0x1196a5[_0xdb3f('0x1a')](_0x143471)[_0xdb3f('0x2f')](_0x303669);};}exports[_0xdb3f('0x30')]=function(_0x7b58dd,_0x3a533c){var _0x101481={},_0x47099c={},_0xb8ac00={'count':0x0,'rows':[]};var _0x3412ac=_[_0xdb3f('0x31')](db[_0xdb3f('0x32')][_0xdb3f('0x33')],function(_0x1ceaf4){return{'name':_0x1ceaf4[_0xdb3f('0x34')],'type':_0x1ceaf4['type']['key']};});_0x47099c[_0xdb3f('0x35')]=_[_0xdb3f('0x31')](_0x3412ac,_0xdb3f('0x2e'));_0x47099c['query']=_[_0xdb3f('0x36')](_0x7b58dd['query']);_0x47099c[_0xdb3f('0x37')]=_[_0xdb3f('0x38')](_0x47099c['model'],_0x47099c['query']);_0x101481[_0xdb3f('0x39')]=_[_0xdb3f('0x38')](_0x47099c['model'],qs[_0xdb3f('0x3a')](_0x7b58dd[_0xdb3f('0x3b')]['fields']));_0x101481[_0xdb3f('0x39')]=_0x101481[_0xdb3f('0x39')]['length']?_0x101481['attributes']:_0x47099c['model'];if(!_0x7b58dd['query'][_0xdb3f('0x3c')](_0xdb3f('0x3d'))){_0x101481[_0xdb3f('0x1d')]=qs['limit'](_0x7b58dd[_0xdb3f('0x3b')][_0xdb3f('0x1d')]);_0x101481[_0xdb3f('0x1f')]=qs[_0xdb3f('0x1f')](_0x7b58dd[_0xdb3f('0x3b')][_0xdb3f('0x1f')]);}_0x101481[_0xdb3f('0x3e')]=qs[_0xdb3f('0x3f')](_0x7b58dd['query']['sort']);delete _0x7b58dd['query'][_0xdb3f('0x3f')];_0x101481[_0xdb3f('0x40')]=qs[_0xdb3f('0x37')](_[_0xdb3f('0x41')](_0x7b58dd[_0xdb3f('0x3b')],_0x47099c['filters']),_0x3412ac);if(_0x7b58dd[_0xdb3f('0x3b')][_0xdb3f('0x42')]){_0x101481['where']=_[_0xdb3f('0x43')](_0x101481[_0xdb3f('0x40')],{'$or':_[_0xdb3f('0x31')](_0x3412ac,function(_0x1ed7f2){if(_0x1ed7f2[_0xdb3f('0x44')]!==_0xdb3f('0x45')){var _0x333c01={};_0x333c01[_0x1ed7f2[_0xdb3f('0x2e')]]={'$like':'%'+_0x7b58dd[_0xdb3f('0x3b')]['filter']+'%'};return _0x333c01;}})});}_0x101481=_[_0xdb3f('0x43')]({},_0x101481,_0x7b58dd[_0xdb3f('0x46')]);var _0x5651a7={'where':_0x101481[_0xdb3f('0x40')]};return db[_0xdb3f('0x32')][_0xdb3f('0x1e')](_0x5651a7)[_0xdb3f('0x2b')](function(_0x3424fa){_0xb8ac00[_0xdb3f('0x1e')]=_0x3424fa;if(_0x7b58dd['query'][_0xdb3f('0x47')]){_0x101481['include']=[{'all':!![]}];}return db[_0xdb3f('0x32')]['findAll'](_0x101481);})[_0xdb3f('0x2b')](function(_0x2875a8){_0xb8ac00[_0xdb3f('0x48')]=_0x2875a8;return _0xb8ac00;})['then'](respondWithFilteredResult(_0x3a533c,_0x101481))[_0xdb3f('0x49')](handleError(_0x3a533c,null));};exports[_0xdb3f('0x4a')]=function(_0x2b2bc5,_0x36a834){var _0x495be6={'raw':![],'where':{'id':_0x2b2bc5[_0xdb3f('0x4b')]['id']}},_0x5064b9={};_0x5064b9[_0xdb3f('0x35')]=_['keys'](db[_0xdb3f('0x32')][_0xdb3f('0x33')]);_0x5064b9[_0xdb3f('0x3b')]=_['keys'](_0x2b2bc5['query']);_0x5064b9['filters']=_[_0xdb3f('0x38')](_0x5064b9[_0xdb3f('0x35')],_0x5064b9[_0xdb3f('0x3b')]);_0x495be6[_0xdb3f('0x39')]=_['intersection'](_0x5064b9['model'],qs[_0xdb3f('0x3a')](_0x2b2bc5[_0xdb3f('0x3b')][_0xdb3f('0x3a')]));_0x495be6['attributes']=_0x495be6[_0xdb3f('0x39')]['length']?_0x495be6[_0xdb3f('0x39')]:_0x5064b9['model'];if(_0x2b2bc5['query'][_0xdb3f('0x47')]){_0x495be6['include']=[{'all':!![]}];}_0x495be6=_[_0xdb3f('0x43')]({},_0x495be6,_0x2b2bc5['options']);return db[_0xdb3f('0x32')][_0xdb3f('0x4c')](_0x495be6)[_0xdb3f('0x2b')](handleEntityNotFound(_0x36a834,null))[_0xdb3f('0x2b')](respondWithResult(_0x36a834,null))['catch'](handleError(_0x36a834,null));};exports['update']=function(_0x26ed3c,_0x7aa54){if(_0x26ed3c['body']['id']){delete _0x26ed3c[_0xdb3f('0x4d')]['id'];}return db[_0xdb3f('0x32')][_0xdb3f('0x4c')]({'where':{'id':_0x26ed3c[_0xdb3f('0x4b')]['id']}})['then'](handleEntityNotFound(_0x7aa54,null))['then'](saveUpdates(_0x26ed3c[_0xdb3f('0x4d')],null))[_0xdb3f('0x2b')](respondWithResult(_0x7aa54,null))[_0xdb3f('0x49')](handleError(_0x7aa54,null));};exports[_0xdb3f('0x4e')]=function(_0x46c41e,_0x25b78d,_0x45f4f9){return db['sequelize'][_0xdb3f('0x4f')](function(_0x5d8c2b){if(_0x46c41e[_0xdb3f('0x4d')]['mode']===_0xdb3f('0x50')){_0x46c41e[_0xdb3f('0x4d')][_0xdb3f('0x51')]=path['join'](config[_0xdb3f('0x52')],_0xdb3f('0x53'),_0x46c41e[_0xdb3f('0x4d')]['name']);}return db[_0xdb3f('0x32')][_0xdb3f('0x4e')](_0x46c41e[_0xdb3f('0x4d')],{'transaction':_0x5d8c2b})[_0xdb3f('0x2b')](function(_0x683c25){if(_0x46c41e[_0xdb3f('0x4d')][_0xdb3f('0x54')]==='files'){fs[_0xdb3f('0x55')](_0x683c25[_0xdb3f('0x51')],parseInt(_0xdb3f('0x56'),0x8));}var _0x1fdecc=_0x46c41e['user'][_0xdb3f('0x28')]({'plain':!![]});if(!_0x1fdecc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1fdecc[_0xdb3f('0x57')]==='user'){var _0x29851b=_0x683c25[_0xdb3f('0x28')]({'plain':!![]});return db[_0xdb3f('0x58')][_0xdb3f('0x4c')]({'where':{'name':_0xdb3f('0x29'),'userProfileId':_0x1fdecc['userProfileId']},'raw':!![]})[_0xdb3f('0x2b')](function(_0x2b7b83){if(_0x2b7b83&&_0x2b7b83[_0xdb3f('0x59')]===0x0){return db[_0xdb3f('0x2a')][_0xdb3f('0x4e')]({'name':_0x29851b[_0xdb3f('0x2e')],'resourceId':_0x29851b['id'],'type':_0x2b7b83[_0xdb3f('0x2e')],'sectionId':_0x2b7b83['id']},{})[_0xdb3f('0x2b')](function(){return _0x683c25;});}else{return _0x683c25;}})[_0xdb3f('0x49')](function(_0x58366e){logger[_0xdb3f('0x2c')](_0xdb3f('0x5a'),_0x58366e);});}return _0x683c25;});})[_0xdb3f('0x2b')](respondWithResult(_0x25b78d,0xc9))[_0xdb3f('0x49')](handleError(_0x25b78d,null));};exports[_0xdb3f('0x27')]=function(_0x482463,_0x29a16d,_0x33fe92){var _0x1edf89;return db[_0xdb3f('0x32')]['find']({'where':{'id':_0x482463[_0xdb3f('0x4b')]['id']}})[_0xdb3f('0x2b')](function(_0x1dc156){if(_0x1dc156){return db[_0xdb3f('0x5b')][_0xdb3f('0x4f')](function(_0x1bfab8){return _0x1dc156[_0xdb3f('0x27')]({'transaction':_0x1bfab8,'raw':!![]})['then'](function(_0x16bbb8){if(_0x16bbb8['directory']){fs['readdirSync'](_0x16bbb8[_0xdb3f('0x51')])[_0xdb3f('0x5c')](function(_0x83e04b){fs[_0xdb3f('0x5d')](path[_0xdb3f('0x5e')](_0x16bbb8[_0xdb3f('0x51')],_0x83e04b));});fs[_0xdb3f('0x5f')](_0x16bbb8['directory']);}return _0x16bbb8;});})[_0xdb3f('0x49')](function(_0x5b4964){throw new db['Sequelize']['ValidationError'](_0x5b4964[_0xdb3f('0x60')]);});}})[_0xdb3f('0x2b')](handleEntityNotFound(_0x29a16d,null))[_0xdb3f('0x2b')](removeEntity(_0x29a16d,null))['catch'](handleError(_0x29a16d,null));};exports['addSound']=function(_0x58c7fe,_0x1e3c6d,_0x222348){return db[_0xdb3f('0x5b')][_0xdb3f('0x4f')](function(_0x1ad5f5){var _0x5eca89;return db[_0xdb3f('0x32')][_0xdb3f('0x4c')]({'where':{'id':_0x58c7fe['params']['id']}})['then'](function(_0x55cfb6){if(_0x55cfb6){_0x5eca89=_0x55cfb6;return _0x55cfb6['addSound'](_0x58c7fe[_0xdb3f('0x4d')]['id'],{'transaction':_0x1ad5f5});}})['then'](function(_0x19b756){if(_0x19b756){return db['Sound']['findOne']({'where':{'id':_0x58c7fe['body']['id']},'attributes':['id',_0xdb3f('0x2e'),_0xdb3f('0x61'),_0xdb3f('0x62'),'createdAt'],'raw':!![]});}})[_0xdb3f('0x2b')](function(_0x323b64){if(_0x323b64){var _0x4c3253=path['join'](config[_0xdb3f('0x52')],_0xdb3f('0x63'),util[_0xdb3f('0x64')](_0xdb3f('0x65'),path[_0xdb3f('0x66')](_0x323b64['save_name'],path[_0xdb3f('0x67')](_0x323b64[_0xdb3f('0x61')])),_0x323b64[_0xdb3f('0x62')]));var _0x11a5f3=path[_0xdb3f('0x5e')](config[_0xdb3f('0x52')],'server/files/moh',_0x5eca89[_0xdb3f('0x2e')],util['format'](_0xdb3f('0x65'),_0x323b64['name'],_0x323b64[_0xdb3f('0x62')]));fs[_0xdb3f('0x68')](_0x4c3253,_0x11a5f3);return _0x323b64;}})[_0xdb3f('0x49')](function(_0x74d16d){throw new db[(_0xdb3f('0x69'))]['ValidationError'](_0x74d16d[_0xdb3f('0x60')]);});})[_0xdb3f('0x2b')](handleEntityNotFound(_0x1e3c6d,null))[_0xdb3f('0x2b')](respondWithResult(_0x1e3c6d,0xc9))['catch'](handleError(_0x1e3c6d,null));};exports[_0xdb3f('0x6a')]=function(_0x3305ee,_0x394c36,_0x244a9f){return db[_0xdb3f('0x5b')]['transaction'](function(_0x2793e9){var _0x57e6a2;return db[_0xdb3f('0x32')][_0xdb3f('0x6b')]({'where':{'id':_0x3305ee[_0xdb3f('0x4b')]['id']}})['then'](handleEntityNotFound(_0x394c36,null))[_0xdb3f('0x2b')](function(_0x111acb){if(_0x111acb){_0x57e6a2=_0x111acb;return _0x111acb[_0xdb3f('0x6a')](_0x3305ee['params'][_0xdb3f('0x6c')]);}})[_0xdb3f('0x2b')](function(_0x5e0c59){if(_0x5e0c59){return db[_0xdb3f('0x6d')]['findOne']({'where':{'id':_0x3305ee[_0xdb3f('0x4b')][_0xdb3f('0x6c')]},'attributes':['id',_0xdb3f('0x2e'),'save_name',_0xdb3f('0x62'),_0xdb3f('0x6e')],'raw':!![]});}})['then'](function(_0x1e8b9b){if(_0x1e8b9b){fs[_0xdb3f('0x5d')](path[_0xdb3f('0x5e')](_0x57e6a2[_0xdb3f('0x51')],util['format'](_0xdb3f('0x65'),_0x1e8b9b['name'],_0x1e8b9b[_0xdb3f('0x62')])));return _0x1e8b9b;}})[_0xdb3f('0x49')](function(_0x4f1462){throw new db[(_0xdb3f('0x69'))][(_0xdb3f('0x6f'))](_0x4f1462[_0xdb3f('0x60')]);});})[_0xdb3f('0x2b')](handleEntityNotFound(_0x394c36,null))[_0xdb3f('0x2b')](respondWithStatusCode(_0x394c36,0xcc))[_0xdb3f('0x49')](handleError(_0x394c36,null));};exports[_0xdb3f('0x70')]=function(_0x50114d,_0x35e99b,_0x150429){var _0x374684={};var _0x138560={};var _0x4b8b71;var _0x341da9;return db[_0xdb3f('0x32')][_0xdb3f('0x6b')]({'where':{'id':_0x50114d[_0xdb3f('0x4b')]['id']}})[_0xdb3f('0x2b')](handleEntityNotFound(_0x35e99b,null))[_0xdb3f('0x2b')](function(_0x15c656){if(_0x15c656){_0x4b8b71=_0x15c656;_0x138560[_0xdb3f('0x35')]=_[_0xdb3f('0x36')](db[_0xdb3f('0x6d')]['rawAttributes']);_0x138560[_0xdb3f('0x3b')]=_[_0xdb3f('0x36')](_0x50114d[_0xdb3f('0x3b')]);_0x138560['filters']=_[_0xdb3f('0x38')](_0x138560[_0xdb3f('0x35')],_0x138560[_0xdb3f('0x3b')]);_0x374684['attributes']=_[_0xdb3f('0x38')](_0x138560[_0xdb3f('0x35')],qs[_0xdb3f('0x3a')](_0x50114d[_0xdb3f('0x3b')]['fields']));_0x374684['attributes']=_0x374684[_0xdb3f('0x39')][_0xdb3f('0x71')]?_0x374684[_0xdb3f('0x39')]:_0x138560[_0xdb3f('0x35')];_0x374684[_0xdb3f('0x3e')]=qs[_0xdb3f('0x3f')](_0x50114d[_0xdb3f('0x3b')][_0xdb3f('0x3f')]);_0x374684[_0xdb3f('0x40')]=qs[_0xdb3f('0x37')](_[_0xdb3f('0x41')](_0x50114d[_0xdb3f('0x3b')],_0x138560[_0xdb3f('0x37')]));if(_0x50114d[_0xdb3f('0x3b')][_0xdb3f('0x42')]){_0x374684['where']=_[_0xdb3f('0x43')](_0x374684[_0xdb3f('0x40')],{'$or':_[_0xdb3f('0x31')](_0x374684['attributes'],function(_0x3169ad){var _0x4195b5={};_0x4195b5[_0x3169ad]={'$like':'%'+_0x50114d[_0xdb3f('0x3b')]['filter']+'%'};return _0x4195b5;})});}_0x374684=_['merge']({},_0x374684,_0x50114d[_0xdb3f('0x46')]);return _0x4b8b71[_0xdb3f('0x70')](_0x374684);}})[_0xdb3f('0x2b')](function(_0x4111f0){if(_0x4111f0){_0x341da9=_0x4111f0[_0xdb3f('0x71')];if(!_0x50114d[_0xdb3f('0x3b')][_0xdb3f('0x3c')](_0xdb3f('0x3d'))){_0x374684['limit']=qs['limit'](_0x50114d[_0xdb3f('0x3b')][_0xdb3f('0x1d')]);_0x374684['offset']=qs['offset'](_0x50114d['query']['offset']);}return _0x4b8b71[_0xdb3f('0x70')](_0x374684);}})[_0xdb3f('0x2b')](function(_0x5c63a1){if(_0x5c63a1){return _0x5c63a1?{'count':_0x341da9,'rows':_0x5c63a1}:null;}})['then'](respondWithResult(_0x35e99b,null))[_0xdb3f('0x49')](handleError(_0x35e99b,null));}; \ No newline at end of file +var _0x7fd8=['role','user','get','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','rmdirSync','ValidationError','message','addSound','Sound','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','symlinkSync','id2','findOne','getSounds','merge','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','MusicOnHolds','UserProfileResource','destroy','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','keys','query','intersection','model','attributes','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','rows','catch','params','filters','fields','length','options','find','body','create','sequelize','transaction','mode','files','directory','join','server/files/moh','mkdirSync','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x5ce9c2,_0x4c0a20){var _0x5e2782=function(_0x136277){while(--_0x136277){_0x5ce9c2['push'](_0x5ce9c2['shift']());}};_0x5e2782(++_0x4c0a20);}(_0x7fd8,0x1e2));var _0x87fd=function(_0x2fe37c,_0xab5f5){_0x2fe37c=_0x2fe37c-0x0;var _0x57a8f1=_0x7fd8[_0x2fe37c];return _0x57a8f1;};'use strict';var emlformat=require(_0x87fd('0x0'));var rimraf=require(_0x87fd('0x1'));var zipdir=require(_0x87fd('0x2'));var jsonpatch=require(_0x87fd('0x3'));var rp=require(_0x87fd('0x4'));var moment=require(_0x87fd('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x87fd('0x6'));var util=require(_0x87fd('0x7'));var path=require(_0x87fd('0x8'));var sox=require('sox');var csv=require(_0x87fd('0x9'));var ejs=require(_0x87fd('0xa'));var fs=require('fs');var fs_extra=require(_0x87fd('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x87fd('0xc'));var jsforce=require(_0x87fd('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x87fd('0x9'));var querystring=require('querystring');var Papa=require(_0x87fd('0xe'));var Redis=require(_0x87fd('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x87fd('0x10'));var as=require(_0x87fd('0x11'));var hardwareService=require(_0x87fd('0x12'));var logger=require(_0x87fd('0x13'))(_0x87fd('0x14'));var utils=require(_0x87fd('0x15'));var config=require(_0x87fd('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x87fd('0x17'))['db'];function respondWithStatusCode(_0x5f6e99,_0x1e12bc){_0x1e12bc=_0x1e12bc||0xcc;return function(_0x12fa74){if(_0x12fa74){return _0x5f6e99[_0x87fd('0x18')](_0x1e12bc);}return _0x5f6e99[_0x87fd('0x19')](_0x1e12bc)['end']();};}function respondWithResult(_0xb8220e,_0x5416e7){_0x5416e7=_0x5416e7||0xc8;return function(_0x367fbb){if(_0x367fbb){return _0xb8220e[_0x87fd('0x19')](_0x5416e7)[_0x87fd('0x1a')](_0x367fbb);}};}function respondWithFilteredResult(_0x2a6b0b,_0x4efb7c){return function(_0x24021e){if(_0x24021e){var _0x3ef151=typeof _0x4efb7c[_0x87fd('0x1b')]===_0x87fd('0x1c')&&typeof _0x4efb7c['limit']===_0x87fd('0x1c');var _0x352740=_0x24021e[_0x87fd('0x1d')];var _0x225991=_0x3ef151?0x0:_0x4efb7c[_0x87fd('0x1b')];var _0x4d765a=_0x3ef151?_0x24021e['count']:_0x4efb7c['offset']+_0x4efb7c[_0x87fd('0x1e')];var _0x5e8374;if(_0x4d765a>=_0x352740){_0x4d765a=_0x352740;_0x5e8374=0xc8;}else{_0x5e8374=0xce;}_0x2a6b0b[_0x87fd('0x19')](_0x5e8374);return _0x2a6b0b['set'](_0x87fd('0x1f'),_0x225991+'-'+_0x4d765a+'/'+_0x352740)['json'](_0x24021e);}return null;};}function patchUpdates(_0x4aed5d){return function(_0x1f45be){try{jsonpatch[_0x87fd('0x20')](_0x1f45be,_0x4aed5d,!![]);}catch(_0x23f38d){return BPromise[_0x87fd('0x21')](_0x23f38d);}return _0x1f45be[_0x87fd('0x22')]();};}function saveUpdates(_0x111de8,_0x4294f3){return function(_0x1c8b0c){if(_0x1c8b0c){return _0x1c8b0c[_0x87fd('0x23')](_0x111de8)['then'](function(_0xe100a1){return _0xe100a1;});}return null;};}function removeEntity(_0x4ecd5a,_0x159196){return function(_0x4c803e){if(_0x4c803e){return _0x4c803e['destroy']()[_0x87fd('0x24')](function(){var _0x3c1986=_0x4c803e['get']({'plain':!![]});var _0x282597=_0x87fd('0x25');return db[_0x87fd('0x26')][_0x87fd('0x27')]({'where':{'type':_0x282597,'resourceId':_0x3c1986['id']}})[_0x87fd('0x24')](function(){return _0x4c803e;});})[_0x87fd('0x24')](function(){_0x4ecd5a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c9de5,_0x465787){return function(_0x190900){if(!_0x190900){_0x2c9de5['sendStatus'](0x194);}return _0x190900;};}function handleError(_0x2e8b58,_0xc4ba2a){_0xc4ba2a=_0xc4ba2a||0x1f4;return function(_0x31668f){logger['error'](_0x31668f[_0x87fd('0x28')]);if(_0x31668f[_0x87fd('0x29')]){delete _0x31668f[_0x87fd('0x29')];}_0x2e8b58[_0x87fd('0x19')](_0xc4ba2a)[_0x87fd('0x2a')](_0x31668f);};}exports[_0x87fd('0x2b')]=function(_0x4dd8b0,_0x3b5a6e){var _0x1d44c8={},_0x16fe94={},_0x3f7e0d={'count':0x0,'rows':[]};var _0x548611=_[_0x87fd('0x2c')](db[_0x87fd('0x2d')][_0x87fd('0x2e')],function(_0x7f693e){return{'name':_0x7f693e[_0x87fd('0x2f')],'type':_0x7f693e[_0x87fd('0x30')][_0x87fd('0x31')]};});_0x16fe94['model']=_[_0x87fd('0x2c')](_0x548611,'name');_0x16fe94['query']=_[_0x87fd('0x32')](_0x4dd8b0[_0x87fd('0x33')]);_0x16fe94['filters']=_[_0x87fd('0x34')](_0x16fe94[_0x87fd('0x35')],_0x16fe94[_0x87fd('0x33')]);_0x1d44c8['attributes']=_[_0x87fd('0x34')](_0x16fe94[_0x87fd('0x35')],qs['fields'](_0x4dd8b0[_0x87fd('0x33')]['fields']));_0x1d44c8[_0x87fd('0x36')]=_0x1d44c8[_0x87fd('0x36')]['length']?_0x1d44c8[_0x87fd('0x36')]:_0x16fe94[_0x87fd('0x35')];if(!_0x4dd8b0[_0x87fd('0x33')]['hasOwnProperty'](_0x87fd('0x37'))){_0x1d44c8[_0x87fd('0x1e')]=qs[_0x87fd('0x1e')](_0x4dd8b0[_0x87fd('0x33')][_0x87fd('0x1e')]);_0x1d44c8[_0x87fd('0x1b')]=qs[_0x87fd('0x1b')](_0x4dd8b0['query']['offset']);}_0x1d44c8[_0x87fd('0x38')]=qs[_0x87fd('0x39')](_0x4dd8b0[_0x87fd('0x33')][_0x87fd('0x39')]);delete _0x4dd8b0['query'][_0x87fd('0x39')];_0x1d44c8[_0x87fd('0x3a')]=qs['filters'](_[_0x87fd('0x3b')](_0x4dd8b0[_0x87fd('0x33')],_0x16fe94['filters']),_0x548611);if(_0x4dd8b0[_0x87fd('0x33')][_0x87fd('0x3c')]){_0x1d44c8[_0x87fd('0x3a')]=_['merge'](_0x1d44c8['where'],{'$or':_[_0x87fd('0x2c')](_0x548611,function(_0x216860){if(_0x216860[_0x87fd('0x30')]!==_0x87fd('0x3d')){var _0x1c5fcd={};_0x1c5fcd[_0x216860[_0x87fd('0x29')]]={'$like':'%'+_0x4dd8b0[_0x87fd('0x33')][_0x87fd('0x3c')]+'%'};return _0x1c5fcd;}})});}_0x1d44c8=_['merge']({},_0x1d44c8,_0x4dd8b0['options']);var _0x255cdd={'where':_0x1d44c8[_0x87fd('0x3a')]};return db[_0x87fd('0x2d')][_0x87fd('0x1d')](_0x255cdd)[_0x87fd('0x24')](function(_0x57a4ee){_0x3f7e0d[_0x87fd('0x1d')]=_0x57a4ee;if(_0x4dd8b0[_0x87fd('0x33')][_0x87fd('0x3e')]){_0x1d44c8[_0x87fd('0x3f')]=[{'all':!![]}];}return db['VoiceMusicOnHold']['findAll'](_0x1d44c8);})['then'](function(_0x4e04f3){_0x3f7e0d[_0x87fd('0x40')]=_0x4e04f3;return _0x3f7e0d;})[_0x87fd('0x24')](respondWithFilteredResult(_0x3b5a6e,_0x1d44c8))[_0x87fd('0x41')](handleError(_0x3b5a6e,null));};exports['show']=function(_0x25c2ed,_0x41bcae){var _0x13ce9a={'raw':![],'where':{'id':_0x25c2ed[_0x87fd('0x42')]['id']}},_0x3f5a36={};_0x3f5a36['model']=_[_0x87fd('0x32')](db['VoiceMusicOnHold']['rawAttributes']);_0x3f5a36[_0x87fd('0x33')]=_[_0x87fd('0x32')](_0x25c2ed[_0x87fd('0x33')]);_0x3f5a36[_0x87fd('0x43')]=_[_0x87fd('0x34')](_0x3f5a36[_0x87fd('0x35')],_0x3f5a36[_0x87fd('0x33')]);_0x13ce9a[_0x87fd('0x36')]=_[_0x87fd('0x34')](_0x3f5a36[_0x87fd('0x35')],qs[_0x87fd('0x44')](_0x25c2ed[_0x87fd('0x33')]['fields']));_0x13ce9a[_0x87fd('0x36')]=_0x13ce9a['attributes'][_0x87fd('0x45')]?_0x13ce9a['attributes']:_0x3f5a36[_0x87fd('0x35')];if(_0x25c2ed[_0x87fd('0x33')][_0x87fd('0x3e')]){_0x13ce9a[_0x87fd('0x3f')]=[{'all':!![]}];}_0x13ce9a=_['merge']({},_0x13ce9a,_0x25c2ed[_0x87fd('0x46')]);return db['VoiceMusicOnHold'][_0x87fd('0x47')](_0x13ce9a)['then'](handleEntityNotFound(_0x41bcae,null))[_0x87fd('0x24')](respondWithResult(_0x41bcae,null))[_0x87fd('0x41')](handleError(_0x41bcae,null));};exports[_0x87fd('0x23')]=function(_0x282ee2,_0x43b14a){if(_0x282ee2[_0x87fd('0x48')]['id']){delete _0x282ee2[_0x87fd('0x48')]['id'];}return db[_0x87fd('0x2d')][_0x87fd('0x47')]({'where':{'id':_0x282ee2[_0x87fd('0x42')]['id']}})[_0x87fd('0x24')](handleEntityNotFound(_0x43b14a,null))[_0x87fd('0x24')](saveUpdates(_0x282ee2[_0x87fd('0x48')],null))[_0x87fd('0x24')](respondWithResult(_0x43b14a,null))['catch'](handleError(_0x43b14a,null));};exports[_0x87fd('0x49')]=function(_0x21cab7,_0x193607,_0x1190fe){return db[_0x87fd('0x4a')][_0x87fd('0x4b')](function(_0x44cd55){if(_0x21cab7[_0x87fd('0x48')][_0x87fd('0x4c')]===_0x87fd('0x4d')){_0x21cab7[_0x87fd('0x48')][_0x87fd('0x4e')]=path[_0x87fd('0x4f')](config['root'],_0x87fd('0x50'),_0x21cab7[_0x87fd('0x48')][_0x87fd('0x29')]);}return db[_0x87fd('0x2d')][_0x87fd('0x49')](_0x21cab7[_0x87fd('0x48')],{'transaction':_0x44cd55})[_0x87fd('0x24')](function(_0x4ab929){if(_0x21cab7[_0x87fd('0x48')][_0x87fd('0x4c')]===_0x87fd('0x4d')){fs[_0x87fd('0x51')](_0x4ab929[_0x87fd('0x4e')],parseInt('0777',0x8));}var _0x4a549c=_0x21cab7['user']['get']({'plain':!![]});if(!_0x4a549c)throw new Error(_0x87fd('0x52'));if(_0x4a549c[_0x87fd('0x53')]===_0x87fd('0x54')){var _0x19d9f7=_0x4ab929[_0x87fd('0x55')]({'plain':!![]});return db[_0x87fd('0x56')][_0x87fd('0x47')]({'where':{'name':'MusicOnHolds','userProfileId':_0x4a549c[_0x87fd('0x57')]},'raw':!![]})[_0x87fd('0x24')](function(_0x2d3e2d){if(_0x2d3e2d&&_0x2d3e2d[_0x87fd('0x58')]===0x0){return db[_0x87fd('0x26')][_0x87fd('0x49')]({'name':_0x19d9f7['name'],'resourceId':_0x19d9f7['id'],'type':_0x2d3e2d[_0x87fd('0x29')],'sectionId':_0x2d3e2d['id']},{})[_0x87fd('0x24')](function(){return _0x4ab929;});}else{return _0x4ab929;}})['catch'](function(_0x4862f0){logger[_0x87fd('0x59')](_0x87fd('0x5a'),_0x4862f0);});}return _0x4ab929;});})[_0x87fd('0x24')](respondWithResult(_0x193607,0xc9))[_0x87fd('0x41')](handleError(_0x193607,null));};exports[_0x87fd('0x27')]=function(_0x180be2,_0x1f2e2f,_0x4726c5){var _0x1e42e8;return db[_0x87fd('0x2d')]['find']({'where':{'id':_0x180be2[_0x87fd('0x42')]['id']}})[_0x87fd('0x24')](function(_0x236feb){if(_0x236feb){return db[_0x87fd('0x4a')][_0x87fd('0x4b')](function(_0x2e8e34){return _0x236feb[_0x87fd('0x27')]({'transaction':_0x2e8e34,'raw':!![]})['then'](function(_0x34e30d){if(_0x34e30d[_0x87fd('0x4e')]){fs[_0x87fd('0x5b')](_0x34e30d[_0x87fd('0x4e')])[_0x87fd('0x5c')](function(_0x483de4){fs[_0x87fd('0x5d')](path['join'](_0x34e30d[_0x87fd('0x4e')],_0x483de4));});fs[_0x87fd('0x5e')](_0x34e30d[_0x87fd('0x4e')]);}return _0x34e30d;});})['catch'](function(_0xd76f2b){throw new db['Sequelize'][(_0x87fd('0x5f'))](_0xd76f2b[_0x87fd('0x60')]);});}})[_0x87fd('0x24')](handleEntityNotFound(_0x1f2e2f,null))[_0x87fd('0x24')](removeEntity(_0x1f2e2f,null))['catch'](handleError(_0x1f2e2f,null));};exports[_0x87fd('0x61')]=function(_0x1f0635,_0x4b55be,_0x394163){return db[_0x87fd('0x4a')][_0x87fd('0x4b')](function(_0x2e8376){var _0x4eeeb8;return db[_0x87fd('0x2d')][_0x87fd('0x47')]({'where':{'id':_0x1f0635['params']['id']}})[_0x87fd('0x24')](function(_0x2f9004){if(_0x2f9004){_0x4eeeb8=_0x2f9004;return _0x2f9004['addSound'](_0x1f0635['body']['id'],{'transaction':_0x2e8376});}})[_0x87fd('0x24')](function(_0xc2478){if(_0xc2478){return db[_0x87fd('0x62')]['findOne']({'where':{'id':_0x1f0635[_0x87fd('0x48')]['id']},'attributes':['id',_0x87fd('0x29'),_0x87fd('0x63'),_0x87fd('0x64'),_0x87fd('0x65')],'raw':!![]});}})[_0x87fd('0x24')](function(_0x4c33e0){if(_0x4c33e0){var _0x578572=path['join'](config['root'],_0x87fd('0x66'),util[_0x87fd('0x67')](_0x87fd('0x68'),path[_0x87fd('0x69')](_0x4c33e0[_0x87fd('0x63')],path[_0x87fd('0x6a')](_0x4c33e0[_0x87fd('0x63')])),_0x4c33e0[_0x87fd('0x64')]));var _0x330a2e=path['join'](config['root'],'server/files/moh',_0x4eeeb8[_0x87fd('0x29')],util[_0x87fd('0x67')](_0x87fd('0x68'),_0x4c33e0[_0x87fd('0x29')],_0x4c33e0[_0x87fd('0x64')]));fs[_0x87fd('0x6b')](_0x578572,_0x330a2e);return _0x4c33e0;}})[_0x87fd('0x41')](function(_0x135f06){throw new db['Sequelize'][(_0x87fd('0x5f'))](_0x135f06['message']);});})[_0x87fd('0x24')](handleEntityNotFound(_0x4b55be,null))[_0x87fd('0x24')](respondWithResult(_0x4b55be,0xc9))[_0x87fd('0x41')](handleError(_0x4b55be,null));};exports['removeSound']=function(_0x228336,_0x374645,_0x5de852){return db[_0x87fd('0x4a')]['transaction'](function(_0x1fa08c){var _0x1596a3;return db[_0x87fd('0x2d')]['findOne']({'where':{'id':_0x228336[_0x87fd('0x42')]['id']}})['then'](handleEntityNotFound(_0x374645,null))[_0x87fd('0x24')](function(_0x439065){if(_0x439065){_0x1596a3=_0x439065;return _0x439065['removeSound'](_0x228336[_0x87fd('0x42')][_0x87fd('0x6c')]);}})['then'](function(_0x3faf44){if(_0x3faf44){return db[_0x87fd('0x62')][_0x87fd('0x6d')]({'where':{'id':_0x228336['params'][_0x87fd('0x6c')]},'attributes':['id',_0x87fd('0x29'),_0x87fd('0x63'),_0x87fd('0x64'),_0x87fd('0x65')],'raw':!![]});}})[_0x87fd('0x24')](function(_0x4dc140){if(_0x4dc140){fs[_0x87fd('0x5d')](path[_0x87fd('0x4f')](_0x1596a3['directory'],util[_0x87fd('0x67')](_0x87fd('0x68'),_0x4dc140[_0x87fd('0x29')],_0x4dc140['converted_format'])));return _0x4dc140;}})[_0x87fd('0x41')](function(_0x16a44b){throw new db['Sequelize'][(_0x87fd('0x5f'))](_0x16a44b[_0x87fd('0x60')]);});})[_0x87fd('0x24')](handleEntityNotFound(_0x374645,null))['then'](respondWithStatusCode(_0x374645,0xcc))['catch'](handleError(_0x374645,null));};exports[_0x87fd('0x6e')]=function(_0x3f5bdf,_0x391a60,_0x4d193f){var _0xa655b0={};var _0x1d97ca={};var _0x4f1f5f;var _0x295a20;return db[_0x87fd('0x2d')][_0x87fd('0x6d')]({'where':{'id':_0x3f5bdf[_0x87fd('0x42')]['id']}})[_0x87fd('0x24')](handleEntityNotFound(_0x391a60,null))['then'](function(_0x4b28f6){if(_0x4b28f6){_0x4f1f5f=_0x4b28f6;_0x1d97ca[_0x87fd('0x35')]=_['keys'](db[_0x87fd('0x62')]['rawAttributes']);_0x1d97ca['query']=_['keys'](_0x3f5bdf[_0x87fd('0x33')]);_0x1d97ca[_0x87fd('0x43')]=_[_0x87fd('0x34')](_0x1d97ca[_0x87fd('0x35')],_0x1d97ca[_0x87fd('0x33')]);_0xa655b0[_0x87fd('0x36')]=_['intersection'](_0x1d97ca['model'],qs[_0x87fd('0x44')](_0x3f5bdf['query'][_0x87fd('0x44')]));_0xa655b0[_0x87fd('0x36')]=_0xa655b0[_0x87fd('0x36')][_0x87fd('0x45')]?_0xa655b0[_0x87fd('0x36')]:_0x1d97ca[_0x87fd('0x35')];_0xa655b0[_0x87fd('0x38')]=qs['sort'](_0x3f5bdf[_0x87fd('0x33')][_0x87fd('0x39')]);_0xa655b0['where']=qs[_0x87fd('0x43')](_['pick'](_0x3f5bdf[_0x87fd('0x33')],_0x1d97ca['filters']));if(_0x3f5bdf['query']['filter']){_0xa655b0[_0x87fd('0x3a')]=_[_0x87fd('0x6f')](_0xa655b0[_0x87fd('0x3a')],{'$or':_[_0x87fd('0x2c')](_0xa655b0[_0x87fd('0x36')],function(_0x411211){var _0x10803d={};_0x10803d[_0x411211]={'$like':'%'+_0x3f5bdf[_0x87fd('0x33')][_0x87fd('0x3c')]+'%'};return _0x10803d;})});}_0xa655b0=_[_0x87fd('0x6f')]({},_0xa655b0,_0x3f5bdf[_0x87fd('0x46')]);return _0x4f1f5f['getSounds'](_0xa655b0);}})[_0x87fd('0x24')](function(_0x39b0ec){if(_0x39b0ec){_0x295a20=_0x39b0ec[_0x87fd('0x45')];if(!_0x3f5bdf[_0x87fd('0x33')][_0x87fd('0x70')](_0x87fd('0x37'))){_0xa655b0['limit']=qs[_0x87fd('0x1e')](_0x3f5bdf[_0x87fd('0x33')]['limit']);_0xa655b0[_0x87fd('0x1b')]=qs[_0x87fd('0x1b')](_0x3f5bdf['query'][_0x87fd('0x1b')]);}return _0x4f1f5f[_0x87fd('0x6e')](_0xa655b0);}})['then'](function(_0x414eaf){if(_0x414eaf){return _0x414eaf?{'count':_0x295a20,'rows':_0x414eaf}:null;}})[_0x87fd('0x24')](respondWithResult(_0x391a60,null))[_0x87fd('0x41')](handleError(_0x391a60,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index dcbcf72..b807425 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 _0x7337=['api','path','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger'];(function(_0x491cbe,_0x45c8ba){var _0x59449d=function(_0x21b463){while(--_0x21b463){_0x491cbe['push'](_0x491cbe['shift']());}};_0x59449d(++_0x45c8ba);}(_0x7337,0x97));var _0x7733=function(_0x55e726,_0x1737fd){_0x55e726=_0x55e726-0x0;var _0xd3f408=_0x7337[_0x55e726];return _0xd3f408;};'use strict';var _=require(_0x7733('0x0'));var util=require(_0x7733('0x1'));var logger=require(_0x7733('0x2'))(_0x7733('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7733('0x4'));var rimraf=require('rimraf');var config=require(_0x7733('0x5'));var attributes=require(_0x7733('0x6'));module[_0x7733('0x7')]=function(_0x9e0f2d,_0x30b314){return _0x9e0f2d[_0x7733('0x8')](_0x7733('0x9'),attributes,{'tableName':_0x7733('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdf7c=['moment','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','util','../../config/logger'];(function(_0xe69acb,_0x804882){var _0xa7034e=function(_0x245919){while(--_0x245919){_0xe69acb['push'](_0xe69acb['shift']());}};_0xa7034e(++_0x804882);}(_0xdf7c,0x127));var _0xcdf7=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0xdf7c[_0x1da527];return _0x40fc7c;};'use strict';var _=require('lodash');var util=require(_0xcdf7('0x0'));var logger=require(_0xcdf7('0x1'))('api');var moment=require(_0xcdf7('0x2'));var BPromise=require('bluebird');var rp=require(_0xcdf7('0x3'));var fs=require('fs');var path=require(_0xcdf7('0x4'));var rimraf=require(_0xcdf7('0x5'));var config=require(_0xcdf7('0x6'));var attributes=require(_0xcdf7('0x7'));module[_0xcdf7('0x8')]=function(_0x3a7d0f,_0x390a87){return _0x3a7d0f[_0xcdf7('0x9')](_0xcdf7('0xa'),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 610a83d..83d8339 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 _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x376698,_0x139e41){var _0xc3df86=function(_0x1e5519){while(--_0x1e5519){_0x376698['push'](_0x376698['shift']());}};_0xc3df86(++_0x139e41);}(_0x70e0,0x17b));var _0x070e=function(_0x3b5334,_0x4b634d){_0x3b5334=_0x3b5334-0x0;var _0x335080=_0x70e0[_0x3b5334];return _0x335080;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file +var _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','VoiceMusicOnHold,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x471523,_0x335e3a){var _0x394281=function(_0x2cadb8){while(--_0x2cadb8){_0x471523['push'](_0x471523['shift']());}};_0x394281(++_0x335e3a);}(_0x9c44,0x178));var _0x49c4=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x9c44[_0x2d2c16];return _0x53f2fb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 44cbcc5..2555fe7 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 _0x207d=['../../components/interaction/service','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/users','/:id/teams','getTeams','addAgents','post','addTeams','put','update','delete','destroy','removeTeams','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x207d,0x10d));var _0xd207=function(_0x136e98,_0x20a159){_0x136e98=_0x136e98-0x0;var _0xe8a5e=_0x207d[_0x136e98];return _0xe8a5e;};'use strict';var multer=require(_0xd207('0x0'));var util=require(_0xd207('0x1'));var path=require(_0xd207('0x2'));var timeout=require(_0xd207('0x3'));var express=require('express');var router=express[_0xd207('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd207('0x5'));var interaction=require(_0xd207('0x6'));var config=require('../../config/environment');var controller=require(_0xd207('0x7'));router[_0xd207('0x8')]('/',auth[_0xd207('0x9')](),controller[_0xd207('0xa')]);router[_0xd207('0x8')](_0xd207('0xb'),auth[_0xd207('0x9')](),controller[_0xd207('0xc')]);router[_0xd207('0x8')](_0xd207('0xd'),auth[_0xd207('0x9')](),controller['show']);router[_0xd207('0x8')](_0xd207('0xe'),auth[_0xd207('0x9')](),controller['getAgents']);router['get'](_0xd207('0xf'),auth[_0xd207('0x9')](),controller[_0xd207('0x10')]);router['post']('/',auth[_0xd207('0x9')](),controller['create']);router['post']('/:id/users',auth[_0xd207('0x9')](),controller[_0xd207('0x11')]);router[_0xd207('0x12')](_0xd207('0xf'),auth[_0xd207('0x9')](),controller[_0xd207('0x13')]);router[_0xd207('0x14')](_0xd207('0xd'),auth[_0xd207('0x9')](),controller[_0xd207('0x15')]);router[_0xd207('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xd207('0x17')]);router[_0xd207('0x16')](_0xd207('0xe'),auth['isAuthenticated'](),controller['removeAgents']);router[_0xd207('0x16')](_0xd207('0xf'),auth[_0xd207('0x9')](),controller[_0xd207('0x18')]);module['exports']=router; \ No newline at end of file +var _0x61b8=['getTeams','post','create','addAgents','addTeams','put','update','delete','removeAgents','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/users','getAgents','/:id/teams'];(function(_0x11dc6a,_0x3a5d46){var _0x23259a=function(_0x22ccf6){while(--_0x22ccf6){_0x11dc6a['push'](_0x11dc6a['shift']());}};_0x23259a(++_0x3a5d46);}(_0x61b8,0x169));var _0x861b=function(_0x5eab55,_0xe3da9f){_0x5eab55=_0x5eab55-0x0;var _0x2c0ec4=_0x61b8[_0x5eab55];return _0x2c0ec4;};'use strict';var multer=require(_0x861b('0x0'));var util=require(_0x861b('0x1'));var path=require(_0x861b('0x2'));var timeout=require('connect-timeout');var express=require(_0x861b('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x861b('0x4'));var interaction=require(_0x861b('0x5'));var config=require(_0x861b('0x6'));var controller=require('./voicePrefix.controller');router[_0x861b('0x7')]('/',auth[_0x861b('0x8')](),controller[_0x861b('0x9')]);router[_0x861b('0x7')](_0x861b('0xa'),auth[_0x861b('0x8')](),controller[_0x861b('0xb')]);router[_0x861b('0x7')](_0x861b('0xc'),auth[_0x861b('0x8')](),controller[_0x861b('0xd')]);router['get'](_0x861b('0xe'),auth[_0x861b('0x8')](),controller[_0x861b('0xf')]);router['get'](_0x861b('0x10'),auth['isAuthenticated'](),controller[_0x861b('0x11')]);router[_0x861b('0x12')]('/',auth['isAuthenticated'](),controller[_0x861b('0x13')]);router[_0x861b('0x12')](_0x861b('0xe'),auth[_0x861b('0x8')](),controller[_0x861b('0x14')]);router[_0x861b('0x12')](_0x861b('0x10'),auth[_0x861b('0x8')](),controller[_0x861b('0x15')]);router[_0x861b('0x16')](_0x861b('0xc'),auth[_0x861b('0x8')](),controller[_0x861b('0x17')]);router[_0x861b('0x18')](_0x861b('0xc'),auth[_0x861b('0x8')](),controller['destroy']);router[_0x861b('0x18')]('/:id/users',auth['isAuthenticated'](),controller[_0x861b('0x19')]);router['delete'](_0x861b('0x10'),auth[_0x861b('0x8')](),controller['removeTeams']);module[_0x861b('0x1a')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index f9c5f77..5c6f77b 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 _0x3a16=['exports','STRING','name','VIRTUAL','system-','getDataValue','INTEGER','sequelize'];(function(_0x3bed74,_0x4052ff){var _0x448723=function(_0x1bc07f){while(--_0x1bc07f){_0x3bed74['push'](_0x3bed74['shift']());}};_0x448723(++_0x4052ff);}(_0x3a16,0xb7));var _0x63a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3a16[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x63a1('0x0'));module[_0x63a1('0x1')]={'name':{'type':Sequelize[_0x63a1('0x2')],'allowNull':![],'unique':_0x63a1('0x3')},'prefix':{'type':Sequelize[_0x63a1('0x4')],'get':function(_0x1fe2ef){return _0x63a1('0x5')+this[_0x63a1('0x6')]('name')+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x63a1('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x63a1('0x7')]}}; \ No newline at end of file +var _0x2a26=['STRING','name','getDataValue','INTEGER','exports'];(function(_0x53582a,_0x972fe7){var _0xc4296f=function(_0x150ed8){while(--_0x150ed8){_0x53582a['push'](_0x53582a['shift']());}};_0xc4296f(++_0x972fe7);}(_0x2a26,0x162));var _0x62a2=function(_0x228a4a,_0x23d65e){_0x228a4a=_0x228a4a-0x0;var _0x3d3937=_0x2a26[_0x228a4a];return _0x3d3937;};'use strict';var Sequelize=require('sequelize');module[_0x62a2('0x0')]={'name':{'type':Sequelize[_0x62a2('0x1')],'allowNull':![],'unique':_0x62a2('0x2')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x37b35b){return'system-'+this[_0x62a2('0x3')](_0x62a2('0x2'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x62a2('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x62a2('0x4')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 6f612b3..fad6a47 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 _0xb574=['count','set','apply','reject','save','update','then','get','VoicePrefixes','UserProfileResource','end','error','stack','name','send','VoicePrefix','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','destroy','params','describe','sequelize','transaction','VoiceExtension','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','app','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','VoicePrefixId','bulkCreate','push','Set','CDR(prefix)=','callerIdAll','goto','charAt','body','system-','addAgents','spread','ids','emit','userVoicePrefix:save','isArray','userVoicePrefix:remove','getAgents','findOne','User','Team','getTeams','addTeams','Agents','online','voicePause','interface','flatMap','each','TeamVoicePrefix','forEach','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','removeTeams','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','json','offset','undefined','limit'];(function(_0x6eb833,_0x2bb5e5){var _0xdfc38c=function(_0x13c4a4){while(--_0x13c4a4){_0x6eb833['push'](_0x6eb833['shift']());}};_0xdfc38c(++_0x2bb5e5);}(_0xb574,0x106));var _0x4b57=function(_0x5db43d,_0x184136){_0x5db43d=_0x5db43d-0x0;var _0x584c83=_0xb574[_0x5db43d];return _0x584c83;};'use strict';var emlformat=require(_0x4b57('0x0'));var rimraf=require(_0x4b57('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4b57('0x2'));var rp=require(_0x4b57('0x3'));var moment=require('moment');var BPromise=require(_0x4b57('0x4'));var Mustache=require(_0x4b57('0x5'));var util=require(_0x4b57('0x6'));var path=require(_0x4b57('0x7'));var sox=require(_0x4b57('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4b57('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4b57('0xa'));var toCsv=require(_0x4b57('0xb'));var querystring=require(_0x4b57('0xc'));var Papa=require(_0x4b57('0xd'));var Redis=require(_0x4b57('0xe'));var authService=require(_0x4b57('0xf'));var qs=require(_0x4b57('0x10'));var as=require(_0x4b57('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4b57('0x12'))(_0x4b57('0x13'));var utils=require(_0x4b57('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4b57('0x15'))['db'];config[_0x4b57('0x16')]=_[_0x4b57('0x17')](config[_0x4b57('0x16')],{'host':_0x4b57('0x18'),'port':0x18eb});var socket=require(_0x4b57('0x19'))(new Redis(config[_0x4b57('0x16')]));require(_0x4b57('0x1a'))[_0x4b57('0x1b')](socket);function respondWithStatusCode(_0x4e15be,_0x4a58dc){_0x4a58dc=_0x4a58dc||0xcc;return function(_0x236c95){if(_0x236c95){return _0x4e15be[_0x4b57('0x1c')](_0x4a58dc);}return _0x4e15be[_0x4b57('0x1d')](_0x4a58dc)['end']();};}function respondWithResult(_0x284640,_0x48bd13){_0x48bd13=_0x48bd13||0xc8;return function(_0x159ce5){if(_0x159ce5){return _0x284640[_0x4b57('0x1d')](_0x48bd13)[_0x4b57('0x1e')](_0x159ce5);}};}function respondWithFilteredResult(_0x10eda5,_0x20cf5e){return function(_0xfb71cc){if(_0xfb71cc){var _0x4ede42=typeof _0x20cf5e[_0x4b57('0x1f')]===_0x4b57('0x20')&&typeof _0x20cf5e[_0x4b57('0x21')]===_0x4b57('0x20');var _0x4baaeb=_0xfb71cc[_0x4b57('0x22')];var _0x1ca49e=_0x4ede42?0x0:_0x20cf5e[_0x4b57('0x1f')];var _0x2682d6=_0x4ede42?_0xfb71cc[_0x4b57('0x22')]:_0x20cf5e[_0x4b57('0x1f')]+_0x20cf5e['limit'];var _0x4b504b;if(_0x2682d6>=_0x4baaeb){_0x2682d6=_0x4baaeb;_0x4b504b=0xc8;}else{_0x4b504b=0xce;}_0x10eda5[_0x4b57('0x1d')](_0x4b504b);return _0x10eda5[_0x4b57('0x23')]('Content-Range',_0x1ca49e+'-'+_0x2682d6+'/'+_0x4baaeb)[_0x4b57('0x1e')](_0xfb71cc);}return null;};}function patchUpdates(_0x4a34b2){return function(_0x286c7d){try{jsonpatch[_0x4b57('0x24')](_0x286c7d,_0x4a34b2,!![]);}catch(_0x56f017){return BPromise[_0x4b57('0x25')](_0x56f017);}return _0x286c7d[_0x4b57('0x26')]();};}function saveUpdates(_0x4d07c9,_0x3e7b96){return function(_0x12dedf){if(_0x12dedf){return _0x12dedf[_0x4b57('0x27')](_0x4d07c9)[_0x4b57('0x28')](function(_0x540eff){return _0x540eff;});}return null;};}function removeEntity(_0x156962,_0x51d0c3){return function(_0x131dab){if(_0x131dab){return _0x131dab['destroy']()[_0x4b57('0x28')](function(){var _0x2dc9d8=_0x131dab[_0x4b57('0x29')]({'plain':!![]});var _0x6584c4=_0x4b57('0x2a');return db[_0x4b57('0x2b')]['destroy']({'where':{'type':_0x6584c4,'resourceId':_0x2dc9d8['id']}})['then'](function(){return _0x131dab;});})[_0x4b57('0x28')](function(){_0x156962['status'](0xcc)[_0x4b57('0x2c')]();});}};}function handleEntityNotFound(_0x458f70,_0x874cf7){return function(_0x3af22f){if(!_0x3af22f){_0x458f70[_0x4b57('0x1c')](0x194);}return _0x3af22f;};}function handleError(_0x2c20d2,_0x49ba89){_0x49ba89=_0x49ba89||0x1f4;return function(_0xab365c){logger[_0x4b57('0x2d')](_0xab365c[_0x4b57('0x2e')]);if(_0xab365c[_0x4b57('0x2f')]){delete _0xab365c['name'];}_0x2c20d2[_0x4b57('0x1d')](_0x49ba89)[_0x4b57('0x30')](_0xab365c);};}exports['index']=function(_0xbfb420,_0xa5b5dc){var _0x4726a6={},_0x255c7d={},_0x492de8={'count':0x0,'rows':[]};var _0x5742a0=_['map'](db[_0x4b57('0x31')][_0x4b57('0x32')],function(_0xccc679){return{'name':_0xccc679[_0x4b57('0x33')],'type':_0xccc679[_0x4b57('0x34')]['key']};});_0x255c7d[_0x4b57('0x35')]=_[_0x4b57('0x36')](_0x5742a0,_0x4b57('0x2f'));_0x255c7d['query']=_[_0x4b57('0x37')](_0xbfb420[_0x4b57('0x38')]);_0x255c7d[_0x4b57('0x39')]=_['intersection'](_0x255c7d[_0x4b57('0x35')],_0x255c7d[_0x4b57('0x38')]);_0x4726a6['attributes']=_[_0x4b57('0x3a')](_0x255c7d[_0x4b57('0x35')],qs[_0x4b57('0x3b')](_0xbfb420[_0x4b57('0x38')][_0x4b57('0x3b')]));_0x4726a6[_0x4b57('0x3c')]=_0x4726a6['attributes'][_0x4b57('0x3d')]?_0x4726a6[_0x4b57('0x3c')]:_0x255c7d[_0x4b57('0x35')];if(!_0xbfb420[_0x4b57('0x38')][_0x4b57('0x3e')](_0x4b57('0x3f'))){_0x4726a6[_0x4b57('0x21')]=qs['limit'](_0xbfb420['query'][_0x4b57('0x21')]);_0x4726a6[_0x4b57('0x1f')]=qs[_0x4b57('0x1f')](_0xbfb420['query'][_0x4b57('0x1f')]);}_0x4726a6[_0x4b57('0x40')]=qs[_0x4b57('0x41')](_0xbfb420[_0x4b57('0x38')]['sort']);_0x4726a6[_0x4b57('0x42')]=qs[_0x4b57('0x39')](_[_0x4b57('0x43')](_0xbfb420[_0x4b57('0x38')],_0x255c7d['filters']),_0x5742a0);if(_0xbfb420['query']['filter']){_0x4726a6[_0x4b57('0x42')]=_[_0x4b57('0x44')](_0x4726a6[_0x4b57('0x42')],{'$or':_[_0x4b57('0x36')](_0x5742a0,function(_0x5f4971){if(_0x5f4971[_0x4b57('0x34')]!==_0x4b57('0x45')){var _0x286606={};_0x286606[_0x5f4971[_0x4b57('0x2f')]]={'$like':'%'+_0xbfb420[_0x4b57('0x38')][_0x4b57('0x46')]+'%'};return _0x286606;}})});}_0x4726a6=_[_0x4b57('0x44')]({},_0x4726a6,_0xbfb420[_0x4b57('0x47')]);var _0x1e222b={'where':_0x4726a6['where']};return db[_0x4b57('0x31')][_0x4b57('0x22')](_0x1e222b)[_0x4b57('0x28')](function(_0x5b2f50){_0x492de8[_0x4b57('0x22')]=_0x5b2f50;if(_0xbfb420['query'][_0x4b57('0x48')]){_0x4726a6[_0x4b57('0x49')]=[{'all':!![]}];}return db[_0x4b57('0x31')][_0x4b57('0x4a')](_0x4726a6);})[_0x4b57('0x28')](function(_0x477352){_0x492de8[_0x4b57('0x4b')]=_0x477352;return _0x492de8;})[_0x4b57('0x28')](respondWithFilteredResult(_0xa5b5dc,_0x4726a6))[_0x4b57('0x4c')](handleError(_0xa5b5dc,null));};exports[_0x4b57('0x4d')]=function(_0x9864b8,_0x423144){var _0x3a87a1={'raw':![],'where':{'id':_0x9864b8['params']['id']}},_0x4fbed3={};_0x4fbed3[_0x4b57('0x35')]=_[_0x4b57('0x37')](db[_0x4b57('0x31')][_0x4b57('0x32')]);_0x4fbed3['query']=_[_0x4b57('0x37')](_0x9864b8[_0x4b57('0x38')]);_0x4fbed3['filters']=_[_0x4b57('0x3a')](_0x4fbed3['model'],_0x4fbed3[_0x4b57('0x38')]);_0x3a87a1['attributes']=_['intersection'](_0x4fbed3[_0x4b57('0x35')],qs[_0x4b57('0x3b')](_0x9864b8['query'][_0x4b57('0x3b')]));_0x3a87a1[_0x4b57('0x3c')]=_0x3a87a1[_0x4b57('0x3c')][_0x4b57('0x3d')]?_0x3a87a1[_0x4b57('0x3c')]:_0x4fbed3[_0x4b57('0x35')];if(_0x9864b8['query'][_0x4b57('0x48')]){_0x3a87a1[_0x4b57('0x49')]=[{'all':!![]}];}_0x3a87a1=_['merge']({},_0x3a87a1,_0x9864b8[_0x4b57('0x47')]);return db[_0x4b57('0x31')][_0x4b57('0x4e')](_0x3a87a1)['then'](handleEntityNotFound(_0x423144,null))[_0x4b57('0x28')](respondWithResult(_0x423144,null))['catch'](handleError(_0x423144,null));};exports[_0x4b57('0x4f')]=function(_0xfbe7ed,_0x2ae205){return db[_0x4b57('0x31')][_0x4b57('0x4e')]({'where':{'id':_0xfbe7ed[_0x4b57('0x50')]['id']}})[_0x4b57('0x28')](handleEntityNotFound(_0x2ae205,null))[_0x4b57('0x28')](removeEntity(_0x2ae205,null))['catch'](handleError(_0x2ae205,null));};exports[_0x4b57('0x51')]=function(_0x19349b,_0x3ad98f){return db['VoicePrefix'][_0x4b57('0x51')]()[_0x4b57('0x28')](respondWithResult(_0x3ad98f,null))[_0x4b57('0x4c')](handleError(_0x3ad98f,null));};exports['create']=function(_0x1579d1,_0x3d2336){var _0x343cec;return db[_0x4b57('0x52')][_0x4b57('0x53')](function(_0xb7c37c){return db[_0x4b57('0x31')]['create'](_0x1579d1['body'],{'transaction':_0xb7c37c})[_0x4b57('0x28')](function(_0x61a1ae){_0x343cec=_0x61a1ae[_0x4b57('0x29')]({'plain':!![]});return db[_0x4b57('0x54')]['find']({'where':{'id':_0x343cec[_0x4b57('0x55')]},'raw':!![]})[_0x4b57('0x28')](function(_0x41529e){return createVoicePrefixExtensions(_0x343cec,_0x41529e,_0xb7c37c);});});})[_0x4b57('0x28')](function(){var _0x4857c3=_0x1579d1['user'][_0x4b57('0x29')]({'plain':!![]});if(!_0x4857c3)throw new Error(_0x4b57('0x56'));if(_0x4857c3['role']==='user'){var _0x451737=_0x343cec;return db['UserProfileSection'][_0x4b57('0x4e')]({'where':{'name':_0x4b57('0x2a'),'userProfileId':_0x4857c3[_0x4b57('0x57')]},'raw':!![]})[_0x4b57('0x28')](function(_0x37d420){if(_0x37d420&&_0x37d420['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x451737['name'],'resourceId':_0x451737['id'],'type':_0x37d420[_0x4b57('0x2f')],'sectionId':_0x37d420['id']},{})[_0x4b57('0x28')](function(){return _0x343cec;});}else{return _0x343cec;}})['catch'](function(_0x34aa23){logger[_0x4b57('0x2d')](_0x4b57('0x58'),_0x34aa23);throw _0x34aa23;});}return _0x343cec;})[_0x4b57('0x28')](respondWithResult(_0x3d2336,null))[_0x4b57('0x4c')](handleError(_0x3d2336,null));};function Extension(_0x1fcc10,_0xf1bf63,_0x40cab4,_0x2c5289){this['context']=_0x4b57('0x59');this['exten']=_0x1fcc10;this[_0x4b57('0x5a')]=_0x40cab4;this[_0x4b57('0x34')]='system';this[_0x4b57('0x5b')]=_0x4b57('0x5c');this[_0x4b57('0x5d')]=_0xf1bf63;this[_0x4b57('0x5e')]=_0x2c5289;}function createVoicePrefixExtensions(_0x36f154,_0xc24706,_0xb58059){return new BPromise(function(_0xbe6f94,_0x3ed705){var _0x8851dd=new Extension(formatPrefixName(_0x36f154[_0x4b57('0x5f')]),0x1,_0x4b57('0x60'),'Voice\x20Prefix');_0x8851dd[_0x4b57('0x61')]=_0x36f154['id'];return db[_0x4b57('0x54')]['create'](_0x8851dd,{'transaction':_0xb58059})[_0x4b57('0x28')](function(_0x564792){var _0x566fec=_0x564792['get']({'plain':!![]});var _0x1004ac=_['map'](addVoicePrefixExtensions(_0x36f154,_0xc24706),function(_0x310db6){_0x310db6[_0x4b57('0x55')]=_0x566fec['id'];_0x310db6['VoicePrefixId']=_0x36f154['id'];return _0x310db6;});return db['VoiceExtension'][_0x4b57('0x62')](_0x1004ac,{'transaction':_0xb58059})[_0x4b57('0x28')](function(_0x431f24){if(!_0x431f24){return _0x3ed705('Extensions\x20creation\x20failed');}else{return _0xbe6f94(_0x431f24);}})[_0x4b57('0x4c')](function(_0x3619a1){return _0x3ed705(_0x3619a1);});});;});};function addVoicePrefixExtensions(_0x5f372d,_0x20172a){var _0x119933=[];var _0x5a0c38=formatPrefixName(_0x5f372d[_0x4b57('0x5f')]);_0x119933[_0x4b57('0x63')](new Extension(_0x5a0c38,0x2,_0x4b57('0x64'),_0x4b57('0x65')+_0x5f372d[_0x4b57('0x2f')]));if(_0x5f372d[_0x4b57('0x66')]){_0x119933[_0x4b57('0x63')](new Extension(_0x5a0c38,0x3,'Set','PREFIX-CALLERIDALL='+_0x5f372d[_0x4b57('0x66')]));}else{_0x119933[_0x4b57('0x63')](new Extension(_0x5a0c38,0x3,'NoOp','No\x20callerid\x20available'));}_0x119933[_0x4b57('0x63')](new Extension(_0x5a0c38,0x4,_0x4b57('0x67'),_0x20172a['context']+','+'${EXTEN:'+(0x8+_0x5f372d['name'][_0x4b57('0x3d')])+'}'+','+0x1));return _0x119933;}function formatPrefixName(_0x438f3e){var _0x243f4d='_';for(var _0x5976ce=0x0;_0x5976ce<_0x438f3e['length'];_0x5976ce++){if(_0x438f3e['charAt'](_0x5976ce)=='-'){_0x243f4d+=_0x438f3e[_0x4b57('0x68')](_0x5976ce);}else{_0x243f4d+='['+_0x438f3e['charAt'](_0x5976ce)+']';}}_0x243f4d+='.';return _0x243f4d;}exports[_0x4b57('0x27')]=function(_0x502313,_0x13c680,_0x425fe0){var _0x29b8ac=_0x502313[_0x4b57('0x69')];_0x29b8ac['prefix']=_0x4b57('0x6a')+_0x29b8ac['name']+'-';return db['sequelize'][_0x4b57('0x53')](function(_0x2a5bbd){return db['VoicePrefix'][_0x4b57('0x27')](_0x29b8ac,{'where':{'id':_0x29b8ac['id']},'transaction':_0x2a5bbd})[_0x4b57('0x28')](function(){return db[_0x4b57('0x54')][_0x4b57('0x4f')]({'where':{'VoicePrefixId':_0x29b8ac['id']},'transaction':_0x2a5bbd})[_0x4b57('0x28')](function(){return db[_0x4b57('0x54')]['find']({'where':{'id':_0x29b8ac[_0x4b57('0x55')]},'raw':!![]})[_0x4b57('0x28')](function(_0x3db213){return createVoicePrefixExtensions(_0x29b8ac,_0x3db213,_0x2a5bbd);});});});})[_0x4b57('0x28')](function(){return db[_0x4b57('0x31')]['findById'](_0x29b8ac['id']);})[_0x4b57('0x28')](respondWithResult(_0x13c680,null))[_0x4b57('0x4c')](handleError(_0x13c680,null));};exports[_0x4b57('0x6b')]=function(_0x24bd50,_0x5565f4,_0x4b17c3){return db[_0x4b57('0x31')][_0x4b57('0x4e')]({'where':{'id':_0x24bd50[_0x4b57('0x50')]['id']}})['then'](handleEntityNotFound(_0x5565f4,null))[_0x4b57('0x28')](function(_0x5c1679){if(_0x5c1679){return _0x5c1679[_0x4b57('0x6b')](_0x24bd50[_0x4b57('0x69')]['ids'],_['omit'](_0x24bd50[_0x4b57('0x69')],['ids','id'])||{})[_0x4b57('0x6c')](function(_0x428450){for(var _0x374d6f=0x0;_0x374d6f<_0x24bd50[_0x4b57('0x69')][_0x4b57('0x6d')]['length'];_0x374d6f+=0x1){socket[_0x4b57('0x6e')](_0x4b57('0x6f'),{'UserId':Number(_0x24bd50[_0x4b57('0x69')]['ids'][_0x374d6f]),'VoicePrefixId':Number(_0x24bd50['params']['id'])});}return _0x428450;});}})[_0x4b57('0x28')](respondWithResult(_0x5565f4,null))[_0x4b57('0x4c')](handleError(_0x5565f4,null));};exports['removeAgents']=function(_0x1ceb74,_0x1148ff,_0x5d4ff9){return db[_0x4b57('0x31')][_0x4b57('0x4e')]({'where':{'id':_0x1ceb74['params']['id']}})[_0x4b57('0x28')](handleEntityNotFound(_0x1148ff,null))[_0x4b57('0x28')](function(_0x36ab03){if(_0x36ab03){return _0x36ab03['removeAgents'](_0x1ceb74[_0x4b57('0x38')][_0x4b57('0x6d')])[_0x4b57('0x28')](function(){if(_[_0x4b57('0x70')](_0x1ceb74[_0x4b57('0x38')][_0x4b57('0x6d')])){for(var _0x3d15eb=0x0;_0x3d15eb<_0x1ceb74['query'][_0x4b57('0x6d')][_0x4b57('0x3d')];_0x3d15eb+=0x1){socket['emit'](_0x4b57('0x71'),{'UserId':Number(_0x1ceb74[_0x4b57('0x38')]['ids'][_0x3d15eb]),'VoicePrefixId':Number(_0x1ceb74[_0x4b57('0x50')]['id'])});}}else{socket[_0x4b57('0x6e')](_0x4b57('0x71'),{'UserId':Number(_0x1ceb74[_0x4b57('0x38')][_0x4b57('0x6d')]),'VoicePrefixId':Number(_0x1ceb74[_0x4b57('0x50')]['id'])});}});}})[_0x4b57('0x28')](respondWithStatusCode(_0x1148ff,null))[_0x4b57('0x4c')](handleError(_0x1148ff,null));};exports[_0x4b57('0x72')]=function(_0x830213,_0x87a28b,_0x3ab6b0){var _0x1dbfb8={};var _0x11f513={};var _0x185dab;var _0x4468fb;return db[_0x4b57('0x31')][_0x4b57('0x73')]({'where':{'id':_0x830213[_0x4b57('0x50')]['id']}})[_0x4b57('0x28')](handleEntityNotFound(_0x87a28b,null))[_0x4b57('0x28')](function(_0x20da30){if(_0x20da30){_0x185dab=_0x20da30;_0x11f513[_0x4b57('0x35')]=_[_0x4b57('0x37')](db[_0x4b57('0x74')]['rawAttributes']);_0x11f513['query']=_['keys'](_0x830213['query']);_0x11f513[_0x4b57('0x39')]=_[_0x4b57('0x3a')](_0x11f513['model'],_0x11f513[_0x4b57('0x38')]);_0x1dbfb8[_0x4b57('0x3c')]=_['intersection'](_0x11f513[_0x4b57('0x35')],qs[_0x4b57('0x3b')](_0x830213['query']['fields']));_0x1dbfb8[_0x4b57('0x3c')]=_0x1dbfb8[_0x4b57('0x3c')][_0x4b57('0x3d')]?_0x1dbfb8[_0x4b57('0x3c')]:_0x11f513[_0x4b57('0x35')];_0x1dbfb8[_0x4b57('0x40')]=qs[_0x4b57('0x41')](_0x830213['query']['sort']);_0x1dbfb8[_0x4b57('0x42')]=qs[_0x4b57('0x39')](_[_0x4b57('0x43')](_0x830213[_0x4b57('0x38')],_0x11f513[_0x4b57('0x39')]));if(_0x830213[_0x4b57('0x38')][_0x4b57('0x46')]){_0x1dbfb8[_0x4b57('0x42')]=_[_0x4b57('0x44')](_0x1dbfb8['where'],{'$or':_[_0x4b57('0x36')](_0x1dbfb8[_0x4b57('0x3c')],function(_0x3dacb2){var _0x62df8b={};_0x62df8b[_0x3dacb2]={'$like':'%'+_0x830213['query']['filter']+'%'};return _0x62df8b;})});}_0x1dbfb8=_[_0x4b57('0x44')]({},_0x1dbfb8,_0x830213[_0x4b57('0x47')]);return _0x185dab['getAgents'](_0x1dbfb8);}})[_0x4b57('0x28')](function(_0x71a944){if(_0x71a944){_0x4468fb=_0x71a944['length'];if(!_0x830213[_0x4b57('0x38')]['hasOwnProperty']('nolimit')){_0x1dbfb8[_0x4b57('0x21')]=qs[_0x4b57('0x21')](_0x830213[_0x4b57('0x38')][_0x4b57('0x21')]);_0x1dbfb8[_0x4b57('0x1f')]=qs['offset'](_0x830213[_0x4b57('0x38')][_0x4b57('0x1f')]);}return _0x185dab[_0x4b57('0x72')](_0x1dbfb8);}})[_0x4b57('0x28')](function(_0x14c1d6){if(_0x14c1d6){return _0x14c1d6?{'count':_0x4468fb,'rows':_0x14c1d6}:null;}})[_0x4b57('0x28')](respondWithResult(_0x87a28b,null))[_0x4b57('0x4c')](handleError(_0x87a28b,null));};exports['getTeams']=function(_0xe1bf71,_0x5ea27c,_0x35a29b){var _0x181029={};var _0x3b5100={};var _0x53b4a5;var _0x5357a3;return db[_0x4b57('0x31')][_0x4b57('0x73')]({'where':{'id':_0xe1bf71[_0x4b57('0x50')]['id']}})['then'](handleEntityNotFound(_0x5ea27c,null))[_0x4b57('0x28')](function(_0x455949){if(_0x455949){_0x53b4a5=_0x455949;_0x3b5100['model']=_[_0x4b57('0x37')](db[_0x4b57('0x75')][_0x4b57('0x32')]);_0x3b5100[_0x4b57('0x38')]=_[_0x4b57('0x37')](_0xe1bf71[_0x4b57('0x38')]);_0x3b5100[_0x4b57('0x39')]=_[_0x4b57('0x3a')](_0x3b5100['model'],_0x3b5100[_0x4b57('0x38')]);_0x181029[_0x4b57('0x3c')]=_[_0x4b57('0x3a')](_0x3b5100['model'],qs[_0x4b57('0x3b')](_0xe1bf71['query']['fields']));_0x181029[_0x4b57('0x3c')]=_0x181029[_0x4b57('0x3c')][_0x4b57('0x3d')]?_0x181029[_0x4b57('0x3c')]:_0x3b5100[_0x4b57('0x35')];_0x181029[_0x4b57('0x40')]=qs[_0x4b57('0x41')](_0xe1bf71[_0x4b57('0x38')][_0x4b57('0x41')]);_0x181029['where']=qs[_0x4b57('0x39')](_['pick'](_0xe1bf71[_0x4b57('0x38')],_0x3b5100['filters']));if(_0xe1bf71['query'][_0x4b57('0x46')]){_0x181029[_0x4b57('0x42')]=_[_0x4b57('0x44')](_0x181029[_0x4b57('0x42')],{'$or':_[_0x4b57('0x36')](_0x181029[_0x4b57('0x3c')],function(_0x30e3ab){var _0xca5674={};_0xca5674[_0x30e3ab]={'$like':'%'+_0xe1bf71[_0x4b57('0x38')][_0x4b57('0x46')]+'%'};return _0xca5674;})});}_0x181029=_[_0x4b57('0x44')]({},_0x181029,_0xe1bf71[_0x4b57('0x47')]);return _0x53b4a5[_0x4b57('0x76')](_0x181029);}})[_0x4b57('0x28')](function(_0x52d476){if(_0x52d476){_0x5357a3=_0x52d476[_0x4b57('0x3d')];if(!_0xe1bf71[_0x4b57('0x38')][_0x4b57('0x3e')]('nolimit')){_0x181029[_0x4b57('0x21')]=qs[_0x4b57('0x21')](_0xe1bf71[_0x4b57('0x38')][_0x4b57('0x21')]);_0x181029[_0x4b57('0x1f')]=qs['offset'](_0xe1bf71[_0x4b57('0x38')][_0x4b57('0x1f')]);}return _0x53b4a5[_0x4b57('0x76')](_0x181029);}})[_0x4b57('0x28')](function(_0x1c63c1){if(_0x1c63c1){return _0x1c63c1?{'count':_0x5357a3,'rows':_0x1c63c1}:null;}})[_0x4b57('0x28')](respondWithResult(_0x5ea27c,null))[_0x4b57('0x4c')](handleError(_0x5ea27c,null));};exports[_0x4b57('0x77')]=function(_0x20560b,_0x535ccc,_0x320a0a){var _0x2a2689=_0x20560b[_0x4b57('0x69')][_0x4b57('0x6d')];var _0x19e09a;return db[_0x4b57('0x75')][_0x4b57('0x4a')]({'where':{'id':_0x2a2689},'attributes':['id'],'include':[{'model':db['User'],'as':_0x4b57('0x78'),'attributes':['id',_0x4b57('0x2f'),_0x4b57('0x79'),_0x4b57('0x7a'),_0x4b57('0x7b')],'raw':!![]}]})[_0x4b57('0x28')](function(_0x4c7fa8){if(_0x4c7fa8){_0x19e09a=_0x4c7fa8;var _0x46e1b0=_[_0x4b57('0x7c')](_0x4c7fa8,function(_0x448b3d){var _0x287c29=_0x448b3d[_0x4b57('0x29')]({'plain':!![]});return _0x287c29[_0x4b57('0x78')];});return db['VoicePrefix'][_0x4b57('0x4e')]({'where':{'id':_0x20560b[_0x4b57('0x50')]['id']}})['then'](function(_0x60d8d0){return db[_0x4b57('0x52')][_0x4b57('0x53')](function(_0x34d45d){return _0x60d8d0[_0x4b57('0x77')](_0x2a2689,{'transaction':_0x34d45d})[_0x4b57('0x28')](function(){return BPromise[_0x4b57('0x7d')](_0x19e09a,function(_0x50bbdc){return db[_0x4b57('0x7e')]['upsert']({'TeamId':_0x50bbdc['id'],'VoicePrefixId':_0x20560b[_0x4b57('0x50')]['id']},{'transaction':_0x34d45d});});})[_0x4b57('0x28')](function(){return BPromise[_0x4b57('0x7d')](_0x46e1b0,function(_0x46037e){return db['UserVoicePrefix']['findOrCreate']({'where':{'UserId':_0x46037e['id'],'VoicePrefixId':_0x20560b['params']['id']},'transaction':_0x34d45d});});})['then'](function(){_0x46e1b0[_0x4b57('0x7f')](function(_0x2e0bf0){socket['emit'](_0x4b57('0x6f'),{'UserId':_0x2e0bf0['id'],'VoicePrefixId':_0x60d8d0['id']});});});});});}})[_0x4b57('0x28')](respondWithStatusCode(_0x535ccc,null))[_0x4b57('0x4c')](handleError(_0x535ccc,null));};exports['removeTeams']=function(_0x5c4333,_0x4fff4a,_0x515113){return db[_0x4b57('0x75')][_0x4b57('0x4a')]({'where':{'id':_0x5c4333[_0x4b57('0x38')][_0x4b57('0x6d')]},'attributes':['id'],'include':[{'model':db[_0x4b57('0x74')],'as':_0x4b57('0x78'),'attributes':['id'],'raw':!![]}]})[_0x4b57('0x28')](handleEntityNotFound(_0x4fff4a,null))[_0x4b57('0x28')](function(_0xa1ce41){var _0x191975=_['map'](_0xa1ce41,'id');var _0xd16e62=[];var _0x2115cf=[];var _0x4555dc=squel[_0x4b57('0x80')]();_0x4555dc[_0x4b57('0x81')](_0x4b57('0x82'))[_0x4b57('0x83')]('team_has_voice_prefixes','tq')[_0x4b57('0x84')](_0x4b57('0x85'),'ut',_0x4b57('0x86'))['where'](_0x4b57('0x87'),_0x5c4333[_0x4b57('0x50')]['id']);for(var _0x9eb896=0x0;_0x9eb896<_0xa1ce41[_0x4b57('0x3d')];_0x9eb896+=0x1){let _0x1f930b=_0xa1ce41[_0x9eb896];for(var _0x19d369=0x0;_0x19d369<_0x1f930b[_0x4b57('0x78')][_0x4b57('0x3d')];_0x19d369+=0x1){let _0x1e7f07=_0x1f930b[_0x4b57('0x78')][_0x19d369];var _0x51c328=_0x4555dc[_0x4b57('0x88')]();_0x51c328[_0x4b57('0x42')](_0x4b57('0x89'),_0x1e7f07['id']);_0x2115cf[_0x4b57('0x63')](db[_0x4b57('0x52')][_0x4b57('0x38')](_0x51c328[_0x4b57('0x8a')](),{'type':db[_0x4b57('0x52')][_0x4b57('0x8b')][_0x4b57('0x8c')]})[_0x4b57('0x28')](function(_0x307e53){if(_0x307e53['length']===0x1){return _0x1e7f07['id'];}else{var _0x365017=_[_0x4b57('0x8d')](_['map'](_0x307e53,_0x4b57('0x8e')),function(_0x5569e4){return _[_0x4b57('0x8f')](_0x191975,_0x5569e4);});if(_0x365017){return _0x1e7f07['id'];}}}));}}return BPromise[_0x4b57('0x90')](_0x2115cf)[_0x4b57('0x28')](function(_0x3b3373){_0xd16e62=_(_0xd16e62)['union'](_0x3b3373)[_0x4b57('0x91')]()[_0x4b57('0x92')]();return db[_0x4b57('0x31')][_0x4b57('0x4e')]({'where':{'id':_0x5c4333[_0x4b57('0x50')]['id']}})[_0x4b57('0x28')](function(_0x6083ae){return db['sequelize'][_0x4b57('0x53')](function(_0x29f8a1){return _0x6083ae[_0x4b57('0x93')](_0x5c4333['query']['ids'],{'transaction':_0x29f8a1})[_0x4b57('0x28')](function(){if(!_['isEmpty'](_0xd16e62)){return _0x6083ae['removeAgents'](_0xd16e62,{'transaction':_0x29f8a1});}})[_0x4b57('0x28')](function(){_0xd16e62[_0x4b57('0x7f')](function(_0x592b7d){socket[_0x4b57('0x6e')](_0x4b57('0x71'),{'UserId':_0x592b7d,'VoicePrefixId':_0x6083ae['id']});});});});});});})['then'](respondWithStatusCode(_0x4fff4a,null))['catch'](handleError(_0x4fff4a,null));}; \ No newline at end of file +var _0x4fc2=['set','save','update','then','get','VoicePrefixes','UserProfileResource','destroy','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','VoicePrefix','include','findAll','rows','catch','show','params','length','find','describe','sequelize','transaction','create','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','from-sip','exten','system','description','Voice\x20Prefix\x20Extension','priority','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','prefix','push','Set','CDR(prefix)=','callerIdAll','No\x20callerid\x20available','goto','context','charAt','body','findById','addAgents','omit','spread','ids','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','getAgents','nolimit','getTeams','Team','addTeams','Agents','online','voicePause','interface','findOrCreate','forEach','removeTeams','User','select','field','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','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','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','sendStatus','end','status','json','offset','undefined','count'];(function(_0x13be2a,_0xb98d41){var _0x30e7a7=function(_0x5d8c77){while(--_0x5d8c77){_0x13be2a['push'](_0x13be2a['shift']());}};_0x30e7a7(++_0xb98d41);}(_0x4fc2,0x111));var _0x24fc=function(_0x217ecd,_0x5b35da){_0x217ecd=_0x217ecd-0x0;var _0x50b480=_0x4fc2[_0x217ecd];return _0x50b480;};'use strict';var emlformat=require(_0x24fc('0x0'));var rimraf=require(_0x24fc('0x1'));var zipdir=require(_0x24fc('0x2'));var jsonpatch=require(_0x24fc('0x3'));var rp=require('request-promise');var moment=require(_0x24fc('0x4'));var BPromise=require(_0x24fc('0x5'));var Mustache=require(_0x24fc('0x6'));var util=require('util');var path=require(_0x24fc('0x7'));var sox=require(_0x24fc('0x8'));var csv=require('to-csv');var ejs=require(_0x24fc('0x9'));var fs=require('fs');var fs_extra=require(_0x24fc('0xa'));var _=require('lodash');var squel=require(_0x24fc('0xb'));var crypto=require(_0x24fc('0xc'));var jsforce=require(_0x24fc('0xd'));var deskjs=require(_0x24fc('0xe'));var toCsv=require(_0x24fc('0xf'));var querystring=require(_0x24fc('0x10'));var Papa=require('papaparse');var Redis=require(_0x24fc('0x11'));var authService=require(_0x24fc('0x12'));var qs=require(_0x24fc('0x13'));var as=require(_0x24fc('0x14'));var hardwareService=require(_0x24fc('0x15'));var logger=require(_0x24fc('0x16'))(_0x24fc('0x17'));var utils=require(_0x24fc('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x24fc('0x19'));var db=require(_0x24fc('0x1a'))['db'];config['redis']=_[_0x24fc('0x1b')](config[_0x24fc('0x1c')],{'host':_0x24fc('0x1d'),'port':0x18eb});var socket=require(_0x24fc('0x1e'))(new Redis(config[_0x24fc('0x1c')]));require(_0x24fc('0x1f'))['register'](socket);function respondWithStatusCode(_0x2a0971,_0x18c0a7){_0x18c0a7=_0x18c0a7||0xcc;return function(_0x2ffed3){if(_0x2ffed3){return _0x2a0971[_0x24fc('0x20')](_0x18c0a7);}return _0x2a0971['status'](_0x18c0a7)[_0x24fc('0x21')]();};}function respondWithResult(_0x588543,_0x4af098){_0x4af098=_0x4af098||0xc8;return function(_0x3385c7){if(_0x3385c7){return _0x588543[_0x24fc('0x22')](_0x4af098)[_0x24fc('0x23')](_0x3385c7);}};}function respondWithFilteredResult(_0x25cb40,_0x52a884){return function(_0x23873c){if(_0x23873c){var _0x1cb3d0=typeof _0x52a884[_0x24fc('0x24')]===_0x24fc('0x25')&&typeof _0x52a884['limit']===_0x24fc('0x25');var _0x4073e0=_0x23873c[_0x24fc('0x26')];var _0x5b0516=_0x1cb3d0?0x0:_0x52a884[_0x24fc('0x24')];var _0x36a771=_0x1cb3d0?_0x23873c[_0x24fc('0x26')]:_0x52a884[_0x24fc('0x24')]+_0x52a884['limit'];var _0x323beb;if(_0x36a771>=_0x4073e0){_0x36a771=_0x4073e0;_0x323beb=0xc8;}else{_0x323beb=0xce;}_0x25cb40['status'](_0x323beb);return _0x25cb40[_0x24fc('0x27')]('Content-Range',_0x5b0516+'-'+_0x36a771+'/'+_0x4073e0)[_0x24fc('0x23')](_0x23873c);}return null;};}function patchUpdates(_0x44c121){return function(_0x2ffade){try{jsonpatch['apply'](_0x2ffade,_0x44c121,!![]);}catch(_0x313a25){return BPromise['reject'](_0x313a25);}return _0x2ffade[_0x24fc('0x28')]();};}function saveUpdates(_0x2bb93a,_0x36a9b4){return function(_0x34b5b2){if(_0x34b5b2){return _0x34b5b2[_0x24fc('0x29')](_0x2bb93a)[_0x24fc('0x2a')](function(_0x3f0875){return _0x3f0875;});}return null;};}function removeEntity(_0x20192b,_0x168d98){return function(_0x2a5c4b){if(_0x2a5c4b){return _0x2a5c4b['destroy']()[_0x24fc('0x2a')](function(){var _0x16f27f=_0x2a5c4b[_0x24fc('0x2b')]({'plain':!![]});var _0x5bb4c8=_0x24fc('0x2c');return db[_0x24fc('0x2d')][_0x24fc('0x2e')]({'where':{'type':_0x5bb4c8,'resourceId':_0x16f27f['id']}})[_0x24fc('0x2a')](function(){return _0x2a5c4b;});})[_0x24fc('0x2a')](function(){_0x20192b[_0x24fc('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x240ae7,_0x29a461){return function(_0x3c99ed){if(!_0x3c99ed){_0x240ae7[_0x24fc('0x20')](0x194);}return _0x3c99ed;};}function handleError(_0x9f7bbc,_0x490aa5){_0x490aa5=_0x490aa5||0x1f4;return function(_0x55c27f){logger['error'](_0x55c27f[_0x24fc('0x2f')]);if(_0x55c27f['name']){delete _0x55c27f[_0x24fc('0x30')];}_0x9f7bbc[_0x24fc('0x22')](_0x490aa5)[_0x24fc('0x31')](_0x55c27f);};}exports[_0x24fc('0x32')]=function(_0x4dbd52,_0x66eec0){var _0x33f368={},_0x523c1f={},_0xf46cd5={'count':0x0,'rows':[]};var _0x1b174d=_['map'](db['VoicePrefix'][_0x24fc('0x33')],function(_0x56eae7){return{'name':_0x56eae7[_0x24fc('0x34')],'type':_0x56eae7[_0x24fc('0x35')]['key']};});_0x523c1f[_0x24fc('0x36')]=_[_0x24fc('0x37')](_0x1b174d,_0x24fc('0x30'));_0x523c1f[_0x24fc('0x38')]=_[_0x24fc('0x39')](_0x4dbd52[_0x24fc('0x38')]);_0x523c1f[_0x24fc('0x3a')]=_[_0x24fc('0x3b')](_0x523c1f[_0x24fc('0x36')],_0x523c1f['query']);_0x33f368[_0x24fc('0x3c')]=_[_0x24fc('0x3b')](_0x523c1f[_0x24fc('0x36')],qs[_0x24fc('0x3d')](_0x4dbd52[_0x24fc('0x38')]['fields']));_0x33f368['attributes']=_0x33f368[_0x24fc('0x3c')]['length']?_0x33f368[_0x24fc('0x3c')]:_0x523c1f[_0x24fc('0x36')];if(!_0x4dbd52[_0x24fc('0x38')][_0x24fc('0x3e')]('nolimit')){_0x33f368[_0x24fc('0x3f')]=qs['limit'](_0x4dbd52[_0x24fc('0x38')][_0x24fc('0x3f')]);_0x33f368[_0x24fc('0x24')]=qs[_0x24fc('0x24')](_0x4dbd52[_0x24fc('0x38')]['offset']);}_0x33f368[_0x24fc('0x40')]=qs[_0x24fc('0x41')](_0x4dbd52[_0x24fc('0x38')][_0x24fc('0x41')]);_0x33f368['where']=qs[_0x24fc('0x3a')](_[_0x24fc('0x42')](_0x4dbd52['query'],_0x523c1f[_0x24fc('0x3a')]),_0x1b174d);if(_0x4dbd52['query'][_0x24fc('0x43')]){_0x33f368[_0x24fc('0x44')]=_[_0x24fc('0x45')](_0x33f368[_0x24fc('0x44')],{'$or':_[_0x24fc('0x37')](_0x1b174d,function(_0x278b18){if(_0x278b18[_0x24fc('0x35')]!==_0x24fc('0x46')){var _0x4a18bb={};_0x4a18bb[_0x278b18[_0x24fc('0x30')]]={'$like':'%'+_0x4dbd52[_0x24fc('0x38')][_0x24fc('0x43')]+'%'};return _0x4a18bb;}})});}_0x33f368=_['merge']({},_0x33f368,_0x4dbd52[_0x24fc('0x47')]);var _0x1e3b52={'where':_0x33f368['where']};return db[_0x24fc('0x48')][_0x24fc('0x26')](_0x1e3b52)[_0x24fc('0x2a')](function(_0x5e4e9b){_0xf46cd5[_0x24fc('0x26')]=_0x5e4e9b;if(_0x4dbd52[_0x24fc('0x38')]['includeAll']){_0x33f368[_0x24fc('0x49')]=[{'all':!![]}];}return db[_0x24fc('0x48')][_0x24fc('0x4a')](_0x33f368);})[_0x24fc('0x2a')](function(_0x4c8dad){_0xf46cd5[_0x24fc('0x4b')]=_0x4c8dad;return _0xf46cd5;})[_0x24fc('0x2a')](respondWithFilteredResult(_0x66eec0,_0x33f368))[_0x24fc('0x4c')](handleError(_0x66eec0,null));};exports[_0x24fc('0x4d')]=function(_0xbcbcfa,_0x58a950){var _0x2a27e6={'raw':![],'where':{'id':_0xbcbcfa[_0x24fc('0x4e')]['id']}},_0x1b9c90={};_0x1b9c90[_0x24fc('0x36')]=_['keys'](db[_0x24fc('0x48')][_0x24fc('0x33')]);_0x1b9c90['query']=_['keys'](_0xbcbcfa[_0x24fc('0x38')]);_0x1b9c90['filters']=_['intersection'](_0x1b9c90[_0x24fc('0x36')],_0x1b9c90['query']);_0x2a27e6[_0x24fc('0x3c')]=_[_0x24fc('0x3b')](_0x1b9c90[_0x24fc('0x36')],qs['fields'](_0xbcbcfa[_0x24fc('0x38')][_0x24fc('0x3d')]));_0x2a27e6[_0x24fc('0x3c')]=_0x2a27e6[_0x24fc('0x3c')][_0x24fc('0x4f')]?_0x2a27e6[_0x24fc('0x3c')]:_0x1b9c90[_0x24fc('0x36')];if(_0xbcbcfa[_0x24fc('0x38')]['includeAll']){_0x2a27e6['include']=[{'all':!![]}];}_0x2a27e6=_[_0x24fc('0x45')]({},_0x2a27e6,_0xbcbcfa[_0x24fc('0x47')]);return db[_0x24fc('0x48')]['find'](_0x2a27e6)['then'](handleEntityNotFound(_0x58a950,null))[_0x24fc('0x2a')](respondWithResult(_0x58a950,null))[_0x24fc('0x4c')](handleError(_0x58a950,null));};exports[_0x24fc('0x2e')]=function(_0x134f64,_0x21f8b8){return db[_0x24fc('0x48')][_0x24fc('0x50')]({'where':{'id':_0x134f64[_0x24fc('0x4e')]['id']}})[_0x24fc('0x2a')](handleEntityNotFound(_0x21f8b8,null))[_0x24fc('0x2a')](removeEntity(_0x21f8b8,null))[_0x24fc('0x4c')](handleError(_0x21f8b8,null));};exports[_0x24fc('0x51')]=function(_0x5ec1c0,_0x1c9a28){return db[_0x24fc('0x48')][_0x24fc('0x51')]()[_0x24fc('0x2a')](respondWithResult(_0x1c9a28,null))[_0x24fc('0x4c')](handleError(_0x1c9a28,null));};exports['create']=function(_0x428012,_0x4bf3a8){var _0x2c8f74;return db[_0x24fc('0x52')][_0x24fc('0x53')](function(_0x41ddfb){return db[_0x24fc('0x48')][_0x24fc('0x54')](_0x428012['body'],{'transaction':_0x41ddfb})[_0x24fc('0x2a')](function(_0xc2ba88){_0x2c8f74=_0xc2ba88[_0x24fc('0x2b')]({'plain':!![]});return db[_0x24fc('0x55')][_0x24fc('0x50')]({'where':{'id':_0x2c8f74[_0x24fc('0x56')]},'raw':!![]})['then'](function(_0x36d500){return createVoicePrefixExtensions(_0x2c8f74,_0x36d500,_0x41ddfb);});});})[_0x24fc('0x2a')](function(){var _0x1628b4=_0x428012[_0x24fc('0x57')][_0x24fc('0x2b')]({'plain':!![]});if(!_0x1628b4)throw new Error(_0x24fc('0x58'));if(_0x1628b4[_0x24fc('0x59')]==='user'){var _0xd673f8=_0x2c8f74;return db[_0x24fc('0x5a')]['find']({'where':{'name':_0x24fc('0x2c'),'userProfileId':_0x1628b4[_0x24fc('0x5b')]},'raw':!![]})[_0x24fc('0x2a')](function(_0x2ba959){if(_0x2ba959&&_0x2ba959[_0x24fc('0x5c')]===0x0){return db[_0x24fc('0x2d')]['create']({'name':_0xd673f8[_0x24fc('0x30')],'resourceId':_0xd673f8['id'],'type':_0x2ba959['name'],'sectionId':_0x2ba959['id']},{})[_0x24fc('0x2a')](function(){return _0x2c8f74;});}else{return _0x2c8f74;}})[_0x24fc('0x4c')](function(_0x50e5b0){logger[_0x24fc('0x5d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x50e5b0);throw _0x50e5b0;});}return _0x2c8f74;})[_0x24fc('0x2a')](respondWithResult(_0x4bf3a8,null))['catch'](handleError(_0x4bf3a8,null));};function Extension(_0xdff811,_0x27b612,_0x57daaf,_0x2edef7){this['context']=_0x24fc('0x5e');this[_0x24fc('0x5f')]=_0xdff811;this['app']=_0x57daaf;this[_0x24fc('0x35')]=_0x24fc('0x60');this[_0x24fc('0x61')]=_0x24fc('0x62');this[_0x24fc('0x63')]=_0x27b612;this['appdata']=_0x2edef7;}function createVoicePrefixExtensions(_0x39da59,_0x2f62b0,_0x2d657a){return new BPromise(function(_0x2b5dca,_0x11d0e0){var _0x5e9c03=new Extension(formatPrefixName(_0x39da59['prefix']),0x1,_0x24fc('0x64'),_0x24fc('0x65'));_0x5e9c03['VoicePrefixId']=_0x39da59['id'];return db['VoiceExtension'][_0x24fc('0x54')](_0x5e9c03,{'transaction':_0x2d657a})[_0x24fc('0x2a')](function(_0x28ef6a){var _0x1c47cd=_0x28ef6a['get']({'plain':!![]});var _0x20973d=_[_0x24fc('0x37')](addVoicePrefixExtensions(_0x39da59,_0x2f62b0),function(_0x14427b){_0x14427b[_0x24fc('0x56')]=_0x1c47cd['id'];_0x14427b[_0x24fc('0x66')]=_0x39da59['id'];return _0x14427b;});return db[_0x24fc('0x55')][_0x24fc('0x67')](_0x20973d,{'transaction':_0x2d657a})[_0x24fc('0x2a')](function(_0xbe136e){if(!_0xbe136e){return _0x11d0e0(_0x24fc('0x68'));}else{return _0x2b5dca(_0xbe136e);}})[_0x24fc('0x4c')](function(_0x456690){return _0x11d0e0(_0x456690);});});;});};function addVoicePrefixExtensions(_0x8dbb4a,_0x24ca4b){var _0x354fc6=[];var _0x54ead5=formatPrefixName(_0x8dbb4a[_0x24fc('0x69')]);_0x354fc6[_0x24fc('0x6a')](new Extension(_0x54ead5,0x2,_0x24fc('0x6b'),_0x24fc('0x6c')+_0x8dbb4a[_0x24fc('0x30')]));if(_0x8dbb4a[_0x24fc('0x6d')]){_0x354fc6[_0x24fc('0x6a')](new Extension(_0x54ead5,0x3,_0x24fc('0x6b'),'PREFIX-CALLERIDALL='+_0x8dbb4a[_0x24fc('0x6d')]));}else{_0x354fc6[_0x24fc('0x6a')](new Extension(_0x54ead5,0x3,_0x24fc('0x64'),_0x24fc('0x6e')));}_0x354fc6['push'](new Extension(_0x54ead5,0x4,_0x24fc('0x6f'),_0x24ca4b[_0x24fc('0x70')]+','+'${EXTEN:'+(0x8+_0x8dbb4a['name']['length'])+'}'+','+0x1));return _0x354fc6;}function formatPrefixName(_0x2ae2ac){var _0x698283='_';for(var _0x246ef1=0x0;_0x246ef1<_0x2ae2ac[_0x24fc('0x4f')];_0x246ef1++){if(_0x2ae2ac[_0x24fc('0x71')](_0x246ef1)=='-'){_0x698283+=_0x2ae2ac[_0x24fc('0x71')](_0x246ef1);}else{_0x698283+='['+_0x2ae2ac['charAt'](_0x246ef1)+']';}}_0x698283+='.';return _0x698283;}exports[_0x24fc('0x29')]=function(_0x15e8a3,_0x5a2c09,_0x51b1c0){var _0xfc6b7f=_0x15e8a3[_0x24fc('0x72')];_0xfc6b7f[_0x24fc('0x69')]='system-'+_0xfc6b7f[_0x24fc('0x30')]+'-';return db[_0x24fc('0x52')][_0x24fc('0x53')](function(_0x4f5547){return db['VoicePrefix']['update'](_0xfc6b7f,{'where':{'id':_0xfc6b7f['id']},'transaction':_0x4f5547})['then'](function(){return db['VoiceExtension'][_0x24fc('0x2e')]({'where':{'VoicePrefixId':_0xfc6b7f['id']},'transaction':_0x4f5547})[_0x24fc('0x2a')](function(){return db[_0x24fc('0x55')][_0x24fc('0x50')]({'where':{'id':_0xfc6b7f['VoiceExtensionId']},'raw':!![]})[_0x24fc('0x2a')](function(_0x56dd0b){return createVoicePrefixExtensions(_0xfc6b7f,_0x56dd0b,_0x4f5547);});});});})[_0x24fc('0x2a')](function(){return db['VoicePrefix'][_0x24fc('0x73')](_0xfc6b7f['id']);})[_0x24fc('0x2a')](respondWithResult(_0x5a2c09,null))[_0x24fc('0x4c')](handleError(_0x5a2c09,null));};exports[_0x24fc('0x74')]=function(_0x3c4e2c,_0x291d60,_0x35c5f7){return db['VoicePrefix'][_0x24fc('0x50')]({'where':{'id':_0x3c4e2c[_0x24fc('0x4e')]['id']}})[_0x24fc('0x2a')](handleEntityNotFound(_0x291d60,null))['then'](function(_0x5201e7){if(_0x5201e7){return _0x5201e7[_0x24fc('0x74')](_0x3c4e2c[_0x24fc('0x72')]['ids'],_[_0x24fc('0x75')](_0x3c4e2c[_0x24fc('0x72')],['ids','id'])||{})[_0x24fc('0x76')](function(_0x383503){for(var _0x5249ea=0x0;_0x5249ea<_0x3c4e2c[_0x24fc('0x72')][_0x24fc('0x77')][_0x24fc('0x4f')];_0x5249ea+=0x1){socket[_0x24fc('0x78')](_0x24fc('0x79'),{'UserId':Number(_0x3c4e2c[_0x24fc('0x72')]['ids'][_0x5249ea]),'VoicePrefixId':Number(_0x3c4e2c['params']['id'])});}return _0x383503;});}})[_0x24fc('0x2a')](respondWithResult(_0x291d60,null))['catch'](handleError(_0x291d60,null));};exports[_0x24fc('0x7a')]=function(_0x52d54e,_0x5233c5,_0x436652){return db[_0x24fc('0x48')][_0x24fc('0x50')]({'where':{'id':_0x52d54e[_0x24fc('0x4e')]['id']}})[_0x24fc('0x2a')](handleEntityNotFound(_0x5233c5,null))[_0x24fc('0x2a')](function(_0x44eb26){if(_0x44eb26){return _0x44eb26[_0x24fc('0x7a')](_0x52d54e['query'][_0x24fc('0x77')])[_0x24fc('0x2a')](function(){if(_['isArray'](_0x52d54e['query'][_0x24fc('0x77')])){for(var _0x3cb0b5=0x0;_0x3cb0b5<_0x52d54e[_0x24fc('0x38')][_0x24fc('0x77')][_0x24fc('0x4f')];_0x3cb0b5+=0x1){socket['emit'](_0x24fc('0x7b'),{'UserId':Number(_0x52d54e[_0x24fc('0x38')]['ids'][_0x3cb0b5]),'VoicePrefixId':Number(_0x52d54e[_0x24fc('0x4e')]['id'])});}}else{socket[_0x24fc('0x78')](_0x24fc('0x7b'),{'UserId':Number(_0x52d54e['query'][_0x24fc('0x77')]),'VoicePrefixId':Number(_0x52d54e[_0x24fc('0x4e')]['id'])});}});}})[_0x24fc('0x2a')](respondWithStatusCode(_0x5233c5,null))[_0x24fc('0x4c')](handleError(_0x5233c5,null));};exports[_0x24fc('0x7c')]=function(_0x1ce8cb,_0x17f88a,_0x46b320){var _0x188edb={};var _0x54f379={};var _0x7f4f80;var _0x2921a7;return db[_0x24fc('0x48')]['findOne']({'where':{'id':_0x1ce8cb['params']['id']}})['then'](handleEntityNotFound(_0x17f88a,null))[_0x24fc('0x2a')](function(_0x560c80){if(_0x560c80){_0x7f4f80=_0x560c80;_0x54f379[_0x24fc('0x36')]=_[_0x24fc('0x39')](db['User'][_0x24fc('0x33')]);_0x54f379['query']=_[_0x24fc('0x39')](_0x1ce8cb['query']);_0x54f379[_0x24fc('0x3a')]=_[_0x24fc('0x3b')](_0x54f379[_0x24fc('0x36')],_0x54f379[_0x24fc('0x38')]);_0x188edb[_0x24fc('0x3c')]=_[_0x24fc('0x3b')](_0x54f379['model'],qs[_0x24fc('0x3d')](_0x1ce8cb[_0x24fc('0x38')][_0x24fc('0x3d')]));_0x188edb[_0x24fc('0x3c')]=_0x188edb[_0x24fc('0x3c')][_0x24fc('0x4f')]?_0x188edb[_0x24fc('0x3c')]:_0x54f379[_0x24fc('0x36')];_0x188edb[_0x24fc('0x40')]=qs['sort'](_0x1ce8cb[_0x24fc('0x38')][_0x24fc('0x41')]);_0x188edb[_0x24fc('0x44')]=qs[_0x24fc('0x3a')](_['pick'](_0x1ce8cb[_0x24fc('0x38')],_0x54f379[_0x24fc('0x3a')]));if(_0x1ce8cb[_0x24fc('0x38')]['filter']){_0x188edb[_0x24fc('0x44')]=_['merge'](_0x188edb['where'],{'$or':_['map'](_0x188edb[_0x24fc('0x3c')],function(_0x49c35c){var _0x29f1c1={};_0x29f1c1[_0x49c35c]={'$like':'%'+_0x1ce8cb[_0x24fc('0x38')][_0x24fc('0x43')]+'%'};return _0x29f1c1;})});}_0x188edb=_[_0x24fc('0x45')]({},_0x188edb,_0x1ce8cb['options']);return _0x7f4f80[_0x24fc('0x7c')](_0x188edb);}})[_0x24fc('0x2a')](function(_0x3d8394){if(_0x3d8394){_0x2921a7=_0x3d8394[_0x24fc('0x4f')];if(!_0x1ce8cb[_0x24fc('0x38')]['hasOwnProperty'](_0x24fc('0x7d'))){_0x188edb[_0x24fc('0x3f')]=qs[_0x24fc('0x3f')](_0x1ce8cb[_0x24fc('0x38')]['limit']);_0x188edb['offset']=qs[_0x24fc('0x24')](_0x1ce8cb[_0x24fc('0x38')][_0x24fc('0x24')]);}return _0x7f4f80[_0x24fc('0x7c')](_0x188edb);}})[_0x24fc('0x2a')](function(_0x49e6f2){if(_0x49e6f2){return _0x49e6f2?{'count':_0x2921a7,'rows':_0x49e6f2}:null;}})[_0x24fc('0x2a')](respondWithResult(_0x17f88a,null))[_0x24fc('0x4c')](handleError(_0x17f88a,null));};exports[_0x24fc('0x7e')]=function(_0x5d5a59,_0xa8881f,_0x69a2cd){var _0x437233={};var _0x1e1474={};var _0xc52004;var _0x4c10d9;return db['VoicePrefix']['findOne']({'where':{'id':_0x5d5a59[_0x24fc('0x4e')]['id']}})[_0x24fc('0x2a')](handleEntityNotFound(_0xa8881f,null))[_0x24fc('0x2a')](function(_0x23a033){if(_0x23a033){_0xc52004=_0x23a033;_0x1e1474[_0x24fc('0x36')]=_[_0x24fc('0x39')](db[_0x24fc('0x7f')][_0x24fc('0x33')]);_0x1e1474[_0x24fc('0x38')]=_[_0x24fc('0x39')](_0x5d5a59[_0x24fc('0x38')]);_0x1e1474[_0x24fc('0x3a')]=_['intersection'](_0x1e1474['model'],_0x1e1474[_0x24fc('0x38')]);_0x437233['attributes']=_[_0x24fc('0x3b')](_0x1e1474[_0x24fc('0x36')],qs[_0x24fc('0x3d')](_0x5d5a59[_0x24fc('0x38')][_0x24fc('0x3d')]));_0x437233[_0x24fc('0x3c')]=_0x437233[_0x24fc('0x3c')][_0x24fc('0x4f')]?_0x437233[_0x24fc('0x3c')]:_0x1e1474['model'];_0x437233[_0x24fc('0x40')]=qs[_0x24fc('0x41')](_0x5d5a59['query']['sort']);_0x437233[_0x24fc('0x44')]=qs[_0x24fc('0x3a')](_[_0x24fc('0x42')](_0x5d5a59[_0x24fc('0x38')],_0x1e1474[_0x24fc('0x3a')]));if(_0x5d5a59[_0x24fc('0x38')]['filter']){_0x437233[_0x24fc('0x44')]=_[_0x24fc('0x45')](_0x437233[_0x24fc('0x44')],{'$or':_[_0x24fc('0x37')](_0x437233['attributes'],function(_0x2fb68a){var _0x10519f={};_0x10519f[_0x2fb68a]={'$like':'%'+_0x5d5a59[_0x24fc('0x38')]['filter']+'%'};return _0x10519f;})});}_0x437233=_[_0x24fc('0x45')]({},_0x437233,_0x5d5a59[_0x24fc('0x47')]);return _0xc52004[_0x24fc('0x7e')](_0x437233);}})['then'](function(_0x163a99){if(_0x163a99){_0x4c10d9=_0x163a99[_0x24fc('0x4f')];if(!_0x5d5a59['query']['hasOwnProperty'](_0x24fc('0x7d'))){_0x437233[_0x24fc('0x3f')]=qs[_0x24fc('0x3f')](_0x5d5a59[_0x24fc('0x38')][_0x24fc('0x3f')]);_0x437233[_0x24fc('0x24')]=qs['offset'](_0x5d5a59[_0x24fc('0x38')][_0x24fc('0x24')]);}return _0xc52004[_0x24fc('0x7e')](_0x437233);}})[_0x24fc('0x2a')](function(_0x6f8974){if(_0x6f8974){return _0x6f8974?{'count':_0x4c10d9,'rows':_0x6f8974}:null;}})[_0x24fc('0x2a')](respondWithResult(_0xa8881f,null))['catch'](handleError(_0xa8881f,null));};exports[_0x24fc('0x80')]=function(_0x4a2522,_0x5226aa,_0x260a62){var _0x19b426=_0x4a2522['body'][_0x24fc('0x77')];var _0x45e8da;return db[_0x24fc('0x7f')][_0x24fc('0x4a')]({'where':{'id':_0x19b426},'attributes':['id'],'include':[{'model':db['User'],'as':_0x24fc('0x81'),'attributes':['id',_0x24fc('0x30'),_0x24fc('0x82'),_0x24fc('0x83'),_0x24fc('0x84')],'raw':!![]}]})[_0x24fc('0x2a')](function(_0x4e31bd){if(_0x4e31bd){_0x45e8da=_0x4e31bd;var _0x492328=_['flatMap'](_0x4e31bd,function(_0xc4f001){var _0x3fb8fc=_0xc4f001['get']({'plain':!![]});return _0x3fb8fc[_0x24fc('0x81')];});return db[_0x24fc('0x48')][_0x24fc('0x50')]({'where':{'id':_0x4a2522['params']['id']}})[_0x24fc('0x2a')](function(_0x15dbba){return db['sequelize']['transaction'](function(_0x33c581){return _0x15dbba[_0x24fc('0x80')](_0x19b426,{'transaction':_0x33c581})[_0x24fc('0x2a')](function(){return BPromise['each'](_0x45e8da,function(_0x2e4e38){return db['TeamVoicePrefix']['upsert']({'TeamId':_0x2e4e38['id'],'VoicePrefixId':_0x4a2522[_0x24fc('0x4e')]['id']},{'transaction':_0x33c581});});})['then'](function(){return BPromise['each'](_0x492328,function(_0x6dee4c){return db['UserVoicePrefix'][_0x24fc('0x85')]({'where':{'UserId':_0x6dee4c['id'],'VoicePrefixId':_0x4a2522[_0x24fc('0x4e')]['id']},'transaction':_0x33c581});});})[_0x24fc('0x2a')](function(){_0x492328[_0x24fc('0x86')](function(_0x4ae346){socket[_0x24fc('0x78')](_0x24fc('0x79'),{'UserId':_0x4ae346['id'],'VoicePrefixId':_0x15dbba['id']});});});});});}})['then'](respondWithStatusCode(_0x5226aa,null))[_0x24fc('0x4c')](handleError(_0x5226aa,null));};exports[_0x24fc('0x87')]=function(_0x30d523,_0x8b1efd,_0x2a19f9){return db['Team'][_0x24fc('0x4a')]({'where':{'id':_0x30d523[_0x24fc('0x38')]['ids']},'attributes':['id'],'include':[{'model':db[_0x24fc('0x88')],'as':_0x24fc('0x81'),'attributes':['id'],'raw':!![]}]})[_0x24fc('0x2a')](handleEntityNotFound(_0x8b1efd,null))[_0x24fc('0x2a')](function(_0x18197a){var _0x5aaa55=_[_0x24fc('0x37')](_0x18197a,'id');var _0x5d6e00=[];var _0x5c8969=[];var _0x42c158=squel[_0x24fc('0x89')]();_0x42c158[_0x24fc('0x8a')]('tq.TeamId')['from'](_0x24fc('0x8b'),'tq')[_0x24fc('0x8c')](_0x24fc('0x8d'),'ut',_0x24fc('0x8e'))[_0x24fc('0x44')](_0x24fc('0x8f'),_0x30d523[_0x24fc('0x4e')]['id']);for(var _0x1efb25=0x0;_0x1efb25<_0x18197a['length'];_0x1efb25+=0x1){let _0x5bbe2c=_0x18197a[_0x1efb25];for(var _0x316b8f=0x0;_0x316b8f<_0x5bbe2c['Agents']['length'];_0x316b8f+=0x1){let _0x1bf646=_0x5bbe2c[_0x24fc('0x81')][_0x316b8f];var _0x31c499=_0x42c158[_0x24fc('0x90')]();_0x31c499[_0x24fc('0x44')](_0x24fc('0x91'),_0x1bf646['id']);_0x5c8969[_0x24fc('0x6a')](db['sequelize'][_0x24fc('0x38')](_0x31c499[_0x24fc('0x92')](),{'type':db[_0x24fc('0x52')][_0x24fc('0x93')][_0x24fc('0x94')]})[_0x24fc('0x2a')](function(_0x3be176){if(_0x3be176[_0x24fc('0x4f')]===0x1){return _0x1bf646['id'];}else{var _0x9fd1b5=_[_0x24fc('0x95')](_[_0x24fc('0x37')](_0x3be176,_0x24fc('0x96')),function(_0x11ed4f){return _[_0x24fc('0x97')](_0x5aaa55,_0x11ed4f);});if(_0x9fd1b5){return _0x1bf646['id'];}}}));}}return BPromise[_0x24fc('0x98')](_0x5c8969)[_0x24fc('0x2a')](function(_0x29af09){_0x5d6e00=_(_0x5d6e00)[_0x24fc('0x99')](_0x29af09)[_0x24fc('0x9a')]()[_0x24fc('0x9b')]();return db[_0x24fc('0x48')][_0x24fc('0x50')]({'where':{'id':_0x30d523[_0x24fc('0x4e')]['id']}})[_0x24fc('0x2a')](function(_0x219be8){return db['sequelize'][_0x24fc('0x53')](function(_0x4217f0){return _0x219be8[_0x24fc('0x87')](_0x30d523[_0x24fc('0x38')]['ids'],{'transaction':_0x4217f0})['then'](function(){if(!_['isEmpty'](_0x5d6e00)){return _0x219be8[_0x24fc('0x7a')](_0x5d6e00,{'transaction':_0x4217f0});}})['then'](function(){_0x5d6e00[_0x24fc('0x86')](function(_0x49e026){socket[_0x24fc('0x78')](_0x24fc('0x7b'),{'UserId':_0x49e026,'VoicePrefixId':_0x219be8['id']});});});});});});})[_0x24fc('0x2a')](respondWithStatusCode(_0x8b1efd,null))[_0x24fc('0x4c')](handleError(_0x8b1efd,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 12796bd..d273f57 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 _0xd482=['emit','hasOwnProperty','exports','events','../../mysqldb','VoicePrefix','setMaxListeners','save','remove'];(function(_0x58bc10,_0x1ad52e){var _0x3097aa=function(_0xbccaa3){while(--_0xbccaa3){_0x58bc10['push'](_0x58bc10['shift']());}};_0x3097aa(++_0x1ad52e);}(_0xd482,0xa5));var _0x2d48=function(_0x5259b4,_0xe16164){_0x5259b4=_0x5259b4-0x0;var _0x374a8e=_0xd482[_0x5259b4];return _0x374a8e;};'use strict';var EventEmitter=require(_0x2d48('0x0'));var VoicePrefix=require(_0x2d48('0x1'))['db'][_0x2d48('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x2d48('0x3')](0x0);var events={'afterCreate':_0x2d48('0x4'),'afterUpdate':'update','afterDestroy':_0x2d48('0x5')};function emitEvent(_0x590fcb){return function(_0x3d7e8e,_0x5b9fc5,_0x171da8){VoicePrefixEvents[_0x2d48('0x6')](_0x590fcb+':'+_0x3d7e8e['id'],_0x3d7e8e);VoicePrefixEvents['emit'](_0x590fcb,_0x3d7e8e);_0x171da8(null);};}for(var e in events){if(events[_0x2d48('0x7')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x2d48('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0xfe11=['hasOwnProperty','hook','events','../../mysqldb','VoicePrefix','setMaxListeners','save','remove','emit'];(function(_0x3bf181,_0x217849){var _0x41eb54=function(_0x18fb4e){while(--_0x18fb4e){_0x3bf181['push'](_0x3bf181['shift']());}};_0x41eb54(++_0x217849);}(_0xfe11,0xda));var _0x1fe1=function(_0x2e09cf,_0x3e042f){_0x2e09cf=_0x2e09cf-0x0;var _0x251a4f=_0xfe11[_0x2e09cf];return _0x251a4f;};'use strict';var EventEmitter=require(_0x1fe1('0x0'));var VoicePrefix=require(_0x1fe1('0x1'))['db'][_0x1fe1('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x1fe1('0x3')](0x0);var events={'afterCreate':_0x1fe1('0x4'),'afterUpdate':'update','afterDestroy':_0x1fe1('0x5')};function emitEvent(_0x1e1f9d){return function(_0x4b33f0,_0x48f77f,_0x2e08a1){VoicePrefixEvents[_0x1fe1('0x6')](_0x1e1f9d+':'+_0x4b33f0['id'],_0x4b33f0);VoicePrefixEvents['emit'](_0x1e1f9d,_0x4b33f0);_0x2e08a1(null);};}for(var e in events){if(events[_0x1fe1('0x7')](e)){var event=events[e];VoicePrefix[_0x1fe1('0x8')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 29da7aa..46596d7 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 _0xc860=['path','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x291b8f,_0x3b8484){var _0x3b504b=function(_0x319559){while(--_0x319559){_0x291b8f['push'](_0x291b8f['shift']());}};_0x3b504b(++_0x3b8484);}(_0xc860,0x112));var _0x0c86=function(_0x3c4f1f,_0x20d3ec){_0x3c4f1f=_0x3c4f1f-0x0;var _0x19cb69=_0xc860[_0x3c4f1f];return _0x19cb69;};'use strict';var _=require(_0x0c86('0x0'));var util=require(_0x0c86('0x1'));var logger=require(_0x0c86('0x2'))('api');var moment=require(_0x0c86('0x3'));var BPromise=require(_0x0c86('0x4'));var rp=require(_0x0c86('0x5'));var fs=require('fs');var path=require(_0x0c86('0x6'));var rimraf=require(_0x0c86('0x7'));var config=require(_0x0c86('0x8'));var attributes=require(_0x0c86('0x9'));module[_0x0c86('0xa')]=function(_0x45c2ce,_0xd9ed06){return _0x45c2ce[_0x0c86('0xb')](_0x0c86('0xc'),attributes,{'tableName':_0x0c86('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf12c=['./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment'];(function(_0x11bfe4,_0x148b49){var _0x1cb40a=function(_0x2266b8){while(--_0x2266b8){_0x11bfe4['push'](_0x11bfe4['shift']());}};_0x1cb40a(++_0x148b49);}(_0xf12c,0x131));var _0xcf12=function(_0x3363ae,_0x5c3f3f){_0x3363ae=_0x3363ae-0x0;var _0x2bc795=_0xf12c[_0x3363ae];return _0x2bc795;};'use strict';var _=require(_0xcf12('0x0'));var util=require(_0xcf12('0x1'));var logger=require(_0xcf12('0x2'))(_0xcf12('0x3'));var moment=require(_0xcf12('0x4'));var BPromise=require(_0xcf12('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xcf12('0x6'));var attributes=require(_0xcf12('0x7'));module[_0xcf12('0x8')]=function(_0x2dde72,_0x515bad){return _0x2dde72[_0xcf12('0x9')](_0xcf12('0xa'),attributes,{'tableName':_0xcf12('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 7d4bd2a..991b0a4 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 _0xa817=['VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','request','then','info','VoicePrefix,\x20%s,\x20%s','debug'];(function(_0x51e86f,_0x5a3eea){var _0x1874c2=function(_0x632c2f){while(--_0x632c2f){_0x51e86f['push'](_0x51e86f['shift']());}};_0x1874c2(++_0x5a3eea);}(_0xa817,0x7b));var _0x7a81=function(_0x368024,_0xaf46d9){_0x368024=_0x368024-0x0;var _0x1493f2=_0xa817[_0x368024];return _0x1493f2;};'use strict';var _=require(_0x7a81('0x0'));var util=require(_0x7a81('0x1'));var moment=require(_0x7a81('0x2'));var BPromise=require(_0x7a81('0x3'));var rs=require(_0x7a81('0x4'));var fs=require('fs');var Redis=require(_0x7a81('0x5'));var db=require(_0x7a81('0x6'))['db'];var utils=require(_0x7a81('0x7'));var logger=require(_0x7a81('0x8'))('rpc');var config=require(_0x7a81('0x9'));var jayson=require(_0x7a81('0xa'));var client=jayson['client'][_0x7a81('0xb')]({'port':0x232a});config[_0x7a81('0xc')]=_[_0x7a81('0xd')](config[_0x7a81('0xc')],{'host':_0x7a81('0xe'),'port':0x18eb});var socket=require(_0x7a81('0xf'))(new Redis(config['redis']));require(_0x7a81('0x10'))['register'](socket);function respondWithRpcPromise(_0x5ae346,_0x2b8dc7,_0x493b02){return new BPromise(function(_0x41d90b,_0x37fee1){return client[_0x7a81('0x11')](_0x5ae346,_0x493b02)[_0x7a81('0x12')](function(_0x45b768){logger[_0x7a81('0x13')](_0x7a81('0x14'),_0x2b8dc7,'request\x20sent');logger[_0x7a81('0x15')](_0x7a81('0x16'),_0x2b8dc7,_0x7a81('0x17'),JSON['stringify'](_0x45b768));if(_0x45b768[_0x7a81('0x18')]){if(_0x45b768[_0x7a81('0x18')][_0x7a81('0x19')]===0x1f4){logger[_0x7a81('0x18')](_0x7a81('0x14'),_0x2b8dc7,_0x45b768[_0x7a81('0x18')]['message']);return _0x37fee1(_0x45b768['error'][_0x7a81('0x1a')]);}logger[_0x7a81('0x18')]('VoicePrefix,\x20%s,\x20%s',_0x2b8dc7,_0x45b768[_0x7a81('0x18')][_0x7a81('0x1a')]);return _0x41d90b(_0x45b768[_0x7a81('0x18')][_0x7a81('0x1a')]);}else{logger[_0x7a81('0x13')](_0x7a81('0x14'),_0x2b8dc7,_0x7a81('0x17'));_0x41d90b(_0x45b768[_0x7a81('0x1b')][_0x7a81('0x1a')]);}})[_0x7a81('0x1c')](function(_0x3c3c59){logger[_0x7a81('0x18')](_0x7a81('0x14'),_0x2b8dc7,_0x3c3c59);_0x37fee1(_0x3c3c59);});});} \ No newline at end of file +var _0x8277=['moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util'];(function(_0x51d836,_0xf398c3){var _0x24fd3d=function(_0x3f8647){while(--_0x3f8647){_0x51d836['push'](_0x51d836['shift']());}};_0x24fd3d(++_0xf398c3);}(_0x8277,0xcf));var _0x7827=function(_0x296809,_0x1c9665){_0x296809=_0x296809-0x0;var _0x18c0d3=_0x8277[_0x296809];return _0x18c0d3;};'use strict';var _=require('lodash');var util=require(_0x7827('0x0'));var moment=require(_0x7827('0x1'));var BPromise=require('bluebird');var rs=require(_0x7827('0x2'));var fs=require('fs');var Redis=require(_0x7827('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7827('0x4'));var logger=require(_0x7827('0x5'))('rpc');var config=require(_0x7827('0x6'));var jayson=require(_0x7827('0x7'));var client=jayson[_0x7827('0x8')]['http']({'port':0x232a});config[_0x7827('0x9')]=_[_0x7827('0xa')](config[_0x7827('0x9')],{'host':_0x7827('0xb'),'port':0x18eb});var socket=require(_0x7827('0xc'))(new Redis(config[_0x7827('0x9')]));require(_0x7827('0xd'))[_0x7827('0xe')](socket);function respondWithRpcPromise(_0xfd2a88,_0x2392d8,_0x2abc26){return new BPromise(function(_0x4472b2,_0x21f5d5){return client[_0x7827('0xf')](_0xfd2a88,_0x2abc26)['then'](function(_0x457717){logger[_0x7827('0x10')](_0x7827('0x11'),_0x2392d8,_0x7827('0x12'));logger['debug'](_0x7827('0x13'),_0x2392d8,_0x7827('0x12'),JSON[_0x7827('0x14')](_0x457717));if(_0x457717[_0x7827('0x15')]){if(_0x457717[_0x7827('0x15')][_0x7827('0x16')]===0x1f4){logger[_0x7827('0x15')](_0x7827('0x11'),_0x2392d8,_0x457717[_0x7827('0x15')][_0x7827('0x17')]);return _0x21f5d5(_0x457717[_0x7827('0x15')][_0x7827('0x17')]);}logger[_0x7827('0x15')](_0x7827('0x11'),_0x2392d8,_0x457717[_0x7827('0x15')]['message']);return _0x4472b2(_0x457717[_0x7827('0x15')][_0x7827('0x17')]);}else{logger[_0x7827('0x10')](_0x7827('0x11'),_0x2392d8,_0x7827('0x12'));_0x4472b2(_0x457717[_0x7827('0x18')][_0x7827('0x17')]);}})[_0x7827('0x19')](function(_0x4f6500){logger[_0x7827('0x15')](_0x7827('0x11'),_0x2392d8,_0x4f6500);_0x21f5d5(_0x4f6500);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 174a6ad..0e0aa56 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 _0x1bb2=['register','length','save','remove','update','emit','removeListener'];(function(_0x4a7912,_0x4ede97){var _0x2fe7c5=function(_0x13c6da){while(--_0x13c6da){_0x4a7912['push'](_0x4a7912['shift']());}};_0x2fe7c5(++_0x4ede97);}(_0x1bb2,0x152));var _0x21bb=function(_0x54fce9,_0x1ecf79){_0x54fce9=_0x54fce9-0x0;var _0x3915a4=_0x1bb2[_0x54fce9];return _0x3915a4;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0x21bb('0x0'),_0x21bb('0x1'),_0x21bb('0x2')];function createListener(_0x480fcb,_0x4e514f){return function(_0x170632){_0x4e514f[_0x21bb('0x3')](_0x480fcb,_0x170632);};}function removeListener(_0x1c21c6,_0x469984){return function(){VoicePrefixEvents[_0x21bb('0x4')](_0x1c21c6,_0x469984);};}exports[_0x21bb('0x5')]=function(_0x198344){for(var _0x267bb0=0x0,_0x36217b=events[_0x21bb('0x6')];_0x267bb0<_0x36217b;_0x267bb0++){var _0x642998=events[_0x267bb0];var _0x316b77=createListener('voicePrefix:'+_0x642998,_0x198344);VoicePrefixEvents['on'](_0x642998,_0x316b77);}}; \ No newline at end of file +var _0x2179=['./voicePrefix.events','save','remove','update','emit','removeListener','register','voicePrefix:'];(function(_0x160814,_0x57b5c6){var _0x427a69=function(_0x3f1485){while(--_0x3f1485){_0x160814['push'](_0x160814['shift']());}};_0x427a69(++_0x57b5c6);}(_0x2179,0xc0));var _0x9217=function(_0x467622,_0x4ad91){_0x467622=_0x467622-0x0;var _0x35ca1a=_0x2179[_0x467622];return _0x35ca1a;};'use strict';var VoicePrefixEvents=require(_0x9217('0x0'));var events=[_0x9217('0x1'),_0x9217('0x2'),_0x9217('0x3')];function createListener(_0x1cd7c5,_0x30b6bf){return function(_0x86c47c){_0x30b6bf[_0x9217('0x4')](_0x1cd7c5,_0x86c47c);};}function removeListener(_0xe708c9,_0x2e397c){return function(){VoicePrefixEvents[_0x9217('0x5')](_0xe708c9,_0x2e397c);};}exports[_0x9217('0x6')]=function(_0x471e4c){for(var _0x17a107=0x0,_0x1ed3f7=events['length'];_0x17a107<_0x1ed3f7;_0x17a107++){var _0x1a0b98=events[_0x17a107];var _0x38127f=createListener(_0x9217('0x7')+_0x1a0b98,_0x471e4c);VoicePrefixEvents['on'](_0x1a0b98,_0x38127f);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 602e921..9e8360a 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 _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x134827,_0x21f6ed){var _0x366671=function(_0x4dc8d4){while(--_0x4dc8d4){_0x134827['push'](_0x134827['shift']());}};_0x366671(++_0x21f6ed);}(_0xb10b,0x12a));var _0xbb10=function(_0x2c8d85,_0x590fef){_0x2c8d85=_0x2c8d85-0x0;var _0x277ef4=_0xb10b[_0x2c8d85];return _0x277ef4;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file +var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x1d20b5,_0x19a3c6){var _0xdbbd2d=function(_0x4e40b0){while(--_0x4e40b0){_0x1d20b5['push'](_0x1d20b5['shift']());}};_0xdbbd2d(++_0x19a3c6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 578d2bb..33e169d 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 _0xc927=['exports','STRING','ENUM','outbound','inbound','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','ringall','strategy','getDataValue','type','dialMethod','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','setDataValue','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','preview','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','tTxX','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#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)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','mandatoryDispositionPauseId','mandatoryDisposition','sequelize'];(function(_0x1af5b2,_0x1b82fe){var _0xf1aa2d=function(_0x2ceae2){while(--_0x2ceae2){_0x1af5b2['push'](_0x1af5b2['shift']());}};_0xf1aa2d(++_0x1b82fe);}(_0xc927,0x1d9));var _0x7c92=function(_0x48b594,_0x540548){_0x48b594=_0x48b594-0x0;var _0x38aceb=_0xc927[_0x48b594];return _0x38aceb;};'use strict';var Sequelize=require(_0x7c92('0x0'));module[_0x7c92('0x1')]={'name':{'type':Sequelize[_0x7c92('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x7c92('0x3')]('inbound',_0x7c92('0x4')),'allowNull':![],'defaultValue':_0x7c92('0x5')},'musiconhold':{'type':Sequelize[_0x7c92('0x2')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x7c92('0x2')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr','ringall',_0x7c92('0x6'),_0x7c92('0x7'),_0x7c92('0x8'),_0x7c92('0x9'),_0x7c92('0xa'),_0x7c92('0xb'),'rrordered'),'allowNull':![],'defaultValue':_0x7c92('0xc'),'set':function(_0xf0c519){this['setDataValue'](_0x7c92('0xd'),_0xf0c519?_0xf0c519:_0x7c92('0x9'));},'get':function(){var _0x53a6e6=this[_0x7c92('0xe')](_0x7c92('0xf'));var _0x5de224=this[_0x7c92('0xe')](_0x7c92('0x10'));var _0x127150=this['getDataValue'](_0x7c92('0xd'));if(_0x53a6e6===_0x7c92('0x5')){return _0x127150;}if(_0x5de224===_0x7c92('0x11')&&_0x127150===_0x7c92('0x9')||_0x5de224===_0x7c92('0x11')&&_0x127150===_0x7c92('0x12')){return _0x127150;}if(_0x5de224===_0x7c92('0x13')||_0x5de224===_0x7c92('0x14')||_0x5de224===_0x7c92('0x15')){return _0x127150;}return null;}},'servicelevel':{'type':Sequelize[_0x7c92('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x7c92('0x16')](0xb)},'timeout':{'type':Sequelize[_0x7c92('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x7c92('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x7c92('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x7c92('0x3')](_0x7c92('0x17'),'no'),'defaultValue':_0x7c92('0x17')},'autopause':{'type':Sequelize[_0x7c92('0x3')](_0x7c92('0x17'),'no',_0x7c92('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x7c92('0x16')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x7c92('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x7c92('0x3')](_0x7c92('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x7c92('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x7c92('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x7c92('0x3')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x7c92('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x7c92('0x3')](_0x7c92('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x7c92('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x7c92('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x7c92('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x7c92('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x7c92('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x7c92('0x3')](_0x7c92('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x7c92('0x3')](_0x7c92('0x17'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize['ENUM'](_0x7c92('0x17'),'no',_0x7c92('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x7c92('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x7c92('0x3')](_0x7c92('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0x7c92('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x7c92('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x7c92('0x2')]},'queue_youarenext':{'type':Sequelize[_0x7c92('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x7c92('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x7c92('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x7c92('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x7c92('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x7c92('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x7c92('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x7c92('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x7c92('0x2')]},'queue_quantity1':{'type':Sequelize[_0x7c92('0x2')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x7c92('0x2')]},'queue_less_than':{'type':Sequelize[_0x7c92('0x2')]},'periodic_announce':{'type':Sequelize[_0x7c92('0x1a')],'set':function(_0x3b1f79){this[_0x7c92('0x1b')](_0x7c92('0x1c'),_0x3b1f79?_0x3b1f79[_0x7c92('0x1d')](','):[]);},'get':function(){return this[_0x7c92('0xe')](_0x7c92('0x1c'))?this[_0x7c92('0xe')](_0x7c92('0x1c'))[_0x7c92('0x1e')](','):[];}},'joinempty':{'type':Sequelize[_0x7c92('0x2')],'defaultValue':_0x7c92('0x17'),'set':function(_0x5bc2bc){this[_0x7c92('0x1b')](_0x7c92('0x1f'),_0x5bc2bc?_0x5bc2bc[_0x7c92('0x1d')](','):undefined);},'get':function(){return this[_0x7c92('0xe')]('joinempty')?this[_0x7c92('0xe')](_0x7c92('0x1f'))[_0x7c92('0x1e')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x7c92('0x2')],'defaultValue':'no','set':function(_0x1f5db1){this['setDataValue'](_0x7c92('0x20'),_0x1f5db1?_0x1f5db1[_0x7c92('0x1d')](','):undefined);},'get':function(){return this[_0x7c92('0xe')]('leavewhenempty')?this[_0x7c92('0xe')](_0x7c92('0x20'))[_0x7c92('0x1e')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x7c92('0x3')](_0x7c92('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x7c92('0x3')](_0x7c92('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x7c92('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x7c92('0x3')](_0x7c92('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x7c92('0x2')]},'description':{'type':Sequelize[_0x7c92('0x2')]},'acw':{'type':Sequelize[_0x7c92('0x21')],'defaultValue':0x0,'set':function(_0x67628d){this[_0x7c92('0x1b')](_0x7c92('0x22'),_0x67628d);if(_0x67628d){if(this[_0x7c92('0xe')](_0x7c92('0x23'))<0x2){this[_0x7c92('0x1b')](_0x7c92('0x23'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x7c92('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x7c92('0x21')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x7c92('0x3')](_0x7c92('0x24'),'progressive',_0x7c92('0x15'),_0x7c92('0x14'),_0x7c92('0x11')),'defaultValue':_0x7c92('0x13'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0x7c92('0x16')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x7c92('0x25')},'dialLimitQueue':{'type':Sequelize[_0x7c92('0x16')](0x4)[_0x7c92('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x7c92('0x27')},'dialPowerLevel':{'type':Sequelize[_0x7c92('0x28')](0x2)[_0x7c92('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x7c92('0x29')},'dialPredictiveOptimization':{'type':Sequelize['ENUM']('agentBusyFactor',_0x7c92('0x2a')),'defaultValue':_0x7c92('0x2a'),'comment':_0x7c92('0x2b')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x7c92('0x28')](0x2)[_0x7c92('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x7c92('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x7c92('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x7c92('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x7c92('0x16')](0x3)[_0x7c92('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x7c92('0x2')],'defaultValue':_0x7c92('0x2d'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x7c92('0x16')](0x3)[_0x7c92('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7c92('0x2e')},'dialQueueProject':{'type':Sequelize[_0x7c92('0x2')],'comment':_0x7c92('0x2f')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7c92('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7c92('0x30')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x7c92('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7c92('0x31')},'dialBusyMaxRetry':{'type':Sequelize[_0x7c92('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7c92('0x32')},'dialBusyRetryFrequency':{'type':Sequelize[_0x7c92('0x16')](0x5)[_0x7c92('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7c92('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x7c92('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x7c92('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x7c92('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7c92('0x35')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7c92('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x7c92('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x7c92('0x2')],'defaultValue':_0x7c92('0x36')},'dialPrefix':{'type':Sequelize[_0x7c92('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x7c92('0x3')](_0x7c92('0x37'),'never',_0x7c92('0x38')),'defaultValue':_0x7c92('0x37')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x7c92('0x39')},'dialAMDInitialSilence':{'type':Sequelize[_0x7c92('0x16')](0x9)[_0x7c92('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x7c92('0x3a')},'dialAMDGreeting':{'type':Sequelize[_0x7c92('0x16')](0x9)[_0x7c92('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x7c92('0x16')](0x9)[_0x7c92('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7c92('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0x7c92('0x16')](0x9)[_0x7c92('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x7c92('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x7c92('0x16')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x7c92('0x16')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x7c92('0x3d')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x7c92('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x7c92('0x3e')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x7c92('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7c92('0x3f')},'dialRecallMeTimeout':{'type':Sequelize[_0x7c92('0x16')](0x5)[_0x7c92('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x7c92('0x40')},'dialRecallInQueue':{'type':Sequelize[_0x7c92('0x21')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x7c92('0x41'),_0x7c92('0x42')),'defaultValue':_0x7c92('0x41')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x7c92('0x2f')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x7c92('0x21')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x7c92('0x21')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x7c92('0x16')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7c92('0x43')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x7c92('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7c92('0x44')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x7c92('0x16')](0x3)[_0x7c92('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7c92('0x45')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x7c92('0x16')](0x5)[_0x7c92('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7c92('0x46')},'dialDropMaxRetry':{'type':Sequelize[_0x7c92('0x16')](0x3)[_0x7c92('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7c92('0x47')},'dialDropRetryFrequency':{'type':Sequelize[_0x7c92('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7c92('0x48')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x7c92('0x16')](0x3)[_0x7c92('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x7c92('0x16')](0x5)[_0x7c92('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x7c92('0x16')](0x3)[_0x7c92('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7c92('0x49')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7c92('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7c92('0x4a')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x7c92('0x16')](0x3)[_0x7c92('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7c92('0x4b')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x7c92('0x16')](0x5)[_0x7c92('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7c92('0x4c')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2f660d){if(!_0x2f660d)this[_0x7c92('0x1b')](_0x7c92('0x4d'),null);this['setDataValue'](_0x7c92('0x4e'),_0x2f660d);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x7c92('0x16')](0x3)[_0x7c92('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x7c92('0x16')](0x3)[_0x7c92('0x26')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x7c92('0x21')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x7c92('0x16')](0x3)[_0x7c92('0x26')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x7c92('0x21')],'defaultValue':![]}}; \ No newline at end of file +var _0x22cb=['never','onlyIfOpen','always','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','exports','name','ENUM','inbound','STRING','default','ringall','leastrecent','fewestcalls','random','wrandom','rrordered','setDataValue','strategy','getDataValue','type','dialMethod','booked','rrmemory','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','split','joinempty','join','leavewhenempty','BOOLEAN','acw','wrapuptime','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#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,*,*,*'];(function(_0x35916e,_0x4dfd1e){var _0x1a029a=function(_0x55cd38){while(--_0x55cd38){_0x35916e['push'](_0x35916e['shift']());}};_0x1a029a(++_0x4dfd1e);}(_0x22cb,0x14d));var _0xb22c=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x22cb[_0x178e48];return _0x440d7e;};'use strict';var Sequelize=require(_0xb22c('0x0'));module[_0xb22c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb22c('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xb22c('0x3')](_0xb22c('0x4'),'outbound'),'allowNull':![],'defaultValue':_0xb22c('0x4')},'musiconhold':{'type':Sequelize[_0xb22c('0x5')],'defaultValue':_0xb22c('0x6')},'announce':{'type':Sequelize[_0xb22c('0x5')],'defaultValue':''},'strategy':{'type':Sequelize[_0xb22c('0x3')]('rr',_0xb22c('0x7'),_0xb22c('0x8'),_0xb22c('0x9'),_0xb22c('0xa'),'rrmemory','linear',_0xb22c('0xb'),_0xb22c('0xc')),'allowNull':![],'defaultValue':_0xb22c('0x7'),'set':function(_0x1484c8){this[_0xb22c('0xd')](_0xb22c('0xe'),_0x1484c8?_0x1484c8:'rrmemory');},'get':function(){var _0xae419=this[_0xb22c('0xf')](_0xb22c('0x10'));var _0x18eaf5=this[_0xb22c('0xf')](_0xb22c('0x11'));var _0x2b3a53=this[_0xb22c('0xf')]('strategy');if(_0xae419===_0xb22c('0x4')){return _0x2b3a53;}if(_0x18eaf5===_0xb22c('0x12')&&_0x2b3a53===_0xb22c('0x13')||_0x18eaf5===_0xb22c('0x12')&&_0x2b3a53==='roundrobin'){return _0x2b3a53;}if(_0x18eaf5===_0xb22c('0x14')||_0x18eaf5===_0xb22c('0x15')||_0x18eaf5===_0xb22c('0x16')){return _0x2b3a53;}return null;}},'servicelevel':{'type':Sequelize[_0xb22c('0x17')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xb22c('0x5')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xb22c('0x17')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xb22c('0x17')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xb22c('0x5')]},'weight':{'type':Sequelize[_0xb22c('0x17')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xb22c('0x17')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xb22c('0x3')](_0xb22c('0x18'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0xb22c('0x3')](_0xb22c('0x18'),'no',_0xb22c('0x19')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xb22c('0x17')](0xb)},'autopausebusy':{'type':Sequelize[_0xb22c('0x3')](_0xb22c('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xb22c('0x3')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xb22c('0x3')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0xb22c('0x18'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0xb22c('0x18'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xb22c('0x3')](_0xb22c('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xb22c('0x5')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xb22c('0x5')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xb22c('0x17')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xb22c('0x17')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0xb22c('0x18'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xb22c('0x3')]('yes','no'),'defaultValue':_0xb22c('0x18')},'announce_holdtime':{'type':Sequelize[_0xb22c('0x3')](_0xb22c('0x18'),'no',_0xb22c('0x1a')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xb22c('0x5')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xb22c('0x3')](_0xb22c('0x18'),'no')},'announce_position_limit':{'type':Sequelize[_0xb22c('0x17')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xb22c('0x5')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xb22c('0x5')]},'queue_youarenext':{'type':Sequelize[_0xb22c('0x5')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xb22c('0x5')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xb22c('0x5')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xb22c('0x5')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xb22c('0x5')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xb22c('0x5')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xb22c('0x5')]},'queue_quantity1':{'type':Sequelize[_0xb22c('0x5')]},'queue_quantity2':{'type':Sequelize[_0xb22c('0x5')]},'queue_periodic_announce':{'type':Sequelize[_0xb22c('0x5')]},'queue_less_than':{'type':Sequelize[_0xb22c('0x5')]},'periodic_announce':{'type':Sequelize[_0xb22c('0x1b')],'set':function(_0x3d4bf9){this[_0xb22c('0xd')](_0xb22c('0x1c'),_0x3d4bf9?_0x3d4bf9['join'](','):[]);},'get':function(){return this['getDataValue'](_0xb22c('0x1c'))?this['getDataValue'](_0xb22c('0x1c'))[_0xb22c('0x1d')](','):[];}},'joinempty':{'type':Sequelize[_0xb22c('0x5')],'defaultValue':_0xb22c('0x18'),'set':function(_0x185a30){this['setDataValue'](_0xb22c('0x1e'),_0x185a30?_0x185a30[_0xb22c('0x1f')](','):undefined);},'get':function(){return this[_0xb22c('0xf')](_0xb22c('0x1e'))?this[_0xb22c('0xf')](_0xb22c('0x1e'))[_0xb22c('0x1d')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xb22c('0x5')],'defaultValue':'no','set':function(_0x18f9a6){this['setDataValue'](_0xb22c('0x20'),_0x18f9a6?_0x18f9a6[_0xb22c('0x1f')](','):undefined);},'get':function(){return this['getDataValue'](_0xb22c('0x20'))?this[_0xb22c('0xf')]('leavewhenempty')[_0xb22c('0x1d')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xb22c('0x3')](_0xb22c('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xb22c('0x3')](_0xb22c('0x18'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xb22c('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0xb22c('0x18'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xb22c('0x5')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0xb22c('0x21')],'defaultValue':0x0,'set':function(_0xfbcc24){this[_0xb22c('0xd')](_0xb22c('0x22'),_0xfbcc24);if(_0xfbcc24){if(this['getDataValue'](_0xb22c('0x23'))<0x2){this[_0xb22c('0xd')](_0xb22c('0x23'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xb22c('0x17')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0xb22c('0x3')](_0xb22c('0x24'),'progressive',_0xb22c('0x16'),_0xb22c('0x15'),_0xb22c('0x12')),'defaultValue':_0xb22c('0x14'),'comment':_0xb22c('0x25')},'dialLimitChannel':{'type':Sequelize[_0xb22c('0x17')](0x4)[_0xb22c('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xb22c('0x27')},'dialLimitQueue':{'type':Sequelize[_0xb22c('0x17')](0x4)[_0xb22c('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xb22c('0x28')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0xb22c('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0xb22c('0x29'),_0xb22c('0x2a')),'defaultValue':_0xb22c('0x2a'),'comment':_0xb22c('0x2b')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0xb22c('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xb22c('0x2c')},'dialPredictiveInterval':{'type':Sequelize[_0xb22c('0x17')](0x3)[_0xb22c('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xb22c('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xb22c('0x17')](0x3)[_0xb22c('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb22c('0x2e')},'dialQueueOptions':{'type':Sequelize[_0xb22c('0x5')],'defaultValue':_0xb22c('0x2f'),'comment':_0xb22c('0x30')},'dialQueueTimeout':{'type':Sequelize[_0xb22c('0x17')](0x3)[_0xb22c('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb22c('0x31')},'dialQueueProject':{'type':Sequelize[_0xb22c('0x5')],'comment':_0xb22c('0x32')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb22c('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xb22c('0x17')](0x5)[_0xb22c('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xb22c('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb22c('0x33')},'dialBusyRetryFrequency':{'type':Sequelize[_0xb22c('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb22c('0x34')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xb22c('0x17')](0x3)[_0xb22c('0x26')],'defaultValue':0x3,'comment':_0xb22c('0x35')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xb22c('0x17')](0x5)[_0xb22c('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb22c('0x36')},'dialGlobalMaxRetry':{'type':Sequelize[_0xb22c('0x17')](0x3)[_0xb22c('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xb22c('0x37')},'dialTimezone':{'type':Sequelize[_0xb22c('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xb22c('0x38')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0xb22c('0x39'),_0xb22c('0x3a')),'defaultValue':_0xb22c('0x3b')},'dialAMDActive':{'type':Sequelize[_0xb22c('0x21')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xb22c('0x17')](0x9)[_0xb22c('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xb22c('0x3c')},'dialAMDGreeting':{'type':Sequelize[_0xb22c('0x17')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xb22c('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xb22c('0x3d')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xb22c('0x17')](0x9)[_0xb22c('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb22c('0x3e')},'dialAMDMinWordLength':{'type':Sequelize[_0xb22c('0x17')](0x9)[_0xb22c('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xb22c('0x3f')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xb22c('0x17')](0x9)[_0xb22c('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xb22c('0x17')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xb22c('0x40')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xb22c('0x17')](0x5)[_0xb22c('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xb22c('0x41')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xb22c('0x17')](0x9)[_0xb22c('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb22c('0x42')},'dialRecallMeTimeout':{'type':Sequelize[_0xb22c('0x17')](0x5)[_0xb22c('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xb22c('0x43')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xb22c('0x44')},'dialOrderByScheduledAt':{'type':Sequelize[_0xb22c('0x3')](_0xb22c('0x45'),'ASC'),'defaultValue':_0xb22c('0x45')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0xb22c('0x32')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xb22c('0x21')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xb22c('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xb22c('0x17')](0x3)[_0xb22c('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb22c('0x46')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xb22c('0x17')](0x3)[_0xb22c('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xb22c('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xb22c('0x17')](0x3)[_0xb22c('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb22c('0x47')},'dialDropRetryFrequency':{'type':Sequelize[_0xb22c('0x17')](0x5)[_0xb22c('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb22c('0x48')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xb22c('0x17')](0x3)[_0xb22c('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xb22c('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xb22c('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb22c('0x49')},'dialMachineRetryFrequency':{'type':Sequelize[_0xb22c('0x17')](0x5)[_0xb22c('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xb22c('0x17')](0x3)[_0xb22c('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb22c('0x4a')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xb22c('0x17')](0x5)[_0xb22c('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb22c('0x4b')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb22c('0x17')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xb22c('0x21')],'defaultValue':![],'comment':_0xb22c('0x4c'),'set':function(_0x58405e){if(!_0x58405e)this[_0xb22c('0xd')](_0xb22c('0x4d'),null);this['setDataValue']('mandatoryDisposition',_0x58405e);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xb22c('0x17')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xb22c('0x26')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xb22c('0x21')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0xb22c('0x17')](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 7d7bf77..c857fa3 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 _0xd8a5=['map','value','includes','find','type','name','UserProfileResource','end','error','stack','send','index','fieldName','key','model','query','keys','attributes','intersection','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','VoiceQueue','includeAll','include','findAll','catch','show','params','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','QueueCampaigns','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','rawAttributes','createdAt','updatedAt','omit','UserProfileSection','userProfileId','getHoppers','CmHopper','hasOwnProperty','nolimit','rows','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','VoiceQueueId','getHopperBlacks','CmHopperBlack','getTeams','Team','User','voicePause','interface','flatMap','penalty','Agents','sequelize','addTeams','each','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids','select','from','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','SELECT','every','TeamId','all','union','compact','transaction','isEmpty','removeAgents','forEach','userVoiceQueue:remove','addAgents','spread','online','push','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','ContactId','ListId','phone','field','scheduledAt','CmListId','toString','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_contacts','CmHopperId','OrderBy','h.id','ci.OrderBy+1','cm_contact_has_items','join','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','NOW()','removeBlackLists','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','destroy','then','VoiceQueues','inbound','outbound','ignore'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0xd8a5,0x160));var _0x5d8a=function(_0x5adcd2,_0x53b894){_0x5adcd2=_0x5adcd2-0x0;var _0x4bf22c=_0xd8a5[_0x5adcd2];return _0x4bf22c;};'use strict';var emlformat=require(_0x5d8a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5d8a('0x1'));var jsonpatch=require(_0x5d8a('0x2'));var rp=require('request-promise');var moment=require(_0x5d8a('0x3'));var BPromise=require(_0x5d8a('0x4'));var Mustache=require(_0x5d8a('0x5'));var util=require(_0x5d8a('0x6'));var path=require(_0x5d8a('0x7'));var sox=require(_0x5d8a('0x8'));var csv=require(_0x5d8a('0x9'));var ejs=require(_0x5d8a('0xa'));var fs=require('fs');var fs_extra=require(_0x5d8a('0xb'));var _=require(_0x5d8a('0xc'));var squel=require(_0x5d8a('0xd'));var crypto=require(_0x5d8a('0xe'));var jsforce=require(_0x5d8a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x5d8a('0x9'));var querystring=require(_0x5d8a('0x10'));var Papa=require(_0x5d8a('0x11'));var Redis=require(_0x5d8a('0x12'));var authService=require(_0x5d8a('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5d8a('0x14'));var hardwareService=require(_0x5d8a('0x15'));var logger=require(_0x5d8a('0x16'))(_0x5d8a('0x17'));var utils=require('../../config/utils');var config=require(_0x5d8a('0x18'));var licenseUtil=require(_0x5d8a('0x19'));var db=require('../../mysqldb')['db'];config[_0x5d8a('0x1a')]=_[_0x5d8a('0x1b')](config[_0x5d8a('0x1a')],{'host':_0x5d8a('0x1c'),'port':0x18eb});var socket=require(_0x5d8a('0x1d'))(new Redis(config[_0x5d8a('0x1a')]));require(_0x5d8a('0x1e'))[_0x5d8a('0x1f')](socket);function respondWithStatusCode(_0x3d852e,_0x33b2de){_0x33b2de=_0x33b2de||0xcc;return function(_0x94a2ba){if(_0x94a2ba){return _0x3d852e[_0x5d8a('0x20')](_0x33b2de);}return _0x3d852e['status'](_0x33b2de)['end']();};}function respondWithResult(_0x39a1b8,_0x1567e0){_0x1567e0=_0x1567e0||0xc8;return function(_0x596ab7){if(_0x596ab7){return _0x39a1b8[_0x5d8a('0x21')](_0x1567e0)[_0x5d8a('0x22')](_0x596ab7);}};}function respondWithFilteredResult(_0x341262,_0x129a1d){return function(_0x5eb748){if(_0x5eb748){var _0x16ff4e=typeof _0x129a1d['offset']===_0x5d8a('0x23')&&typeof _0x129a1d[_0x5d8a('0x24')]===_0x5d8a('0x23');var _0x235257=_0x5eb748[_0x5d8a('0x25')];var _0x478612=_0x16ff4e?0x0:_0x129a1d[_0x5d8a('0x26')];var _0x48fc2b=_0x16ff4e?_0x5eb748[_0x5d8a('0x25')]:_0x129a1d[_0x5d8a('0x26')]+_0x129a1d[_0x5d8a('0x24')];var _0x3c2524;if(_0x48fc2b>=_0x235257){_0x48fc2b=_0x235257;_0x3c2524=0xc8;}else{_0x3c2524=0xce;}_0x341262['status'](_0x3c2524);return _0x341262[_0x5d8a('0x27')](_0x5d8a('0x28'),_0x478612+'-'+_0x48fc2b+'/'+_0x235257)[_0x5d8a('0x22')](_0x5eb748);}return null;};}function patchUpdates(_0x5443b9){return function(_0x43d9ec){try{jsonpatch[_0x5d8a('0x29')](_0x43d9ec,_0x5443b9,!![]);}catch(_0x186aa9){return BPromise[_0x5d8a('0x2a')](_0x186aa9);}return _0x43d9ec['save']();};}function saveUpdates(_0x8cbf6e,_0x463519){return function(_0x482532){if(_0x482532){return _0x482532[_0x5d8a('0x2b')](_0x8cbf6e)['then'](function(_0x194b9e){return _0x194b9e;});}return null;};}function removeEntity(_0x281c93,_0x2f57da){return function(_0x564636){if(_0x564636){return _0x564636[_0x5d8a('0x2c')]()[_0x5d8a('0x2d')](function(){var _0x4cb5e2=_0x564636['get']({'plain':!![]});var _0x3a637f=[{'name':_0x5d8a('0x2e'),'value':_0x5d8a('0x2f'),'ignore':![]},{'name':'QueueCampaigns','value':_0x5d8a('0x30'),'ignore':![]}];var _0x3cafbf=_(_0x3a637f)['filter'](_0x5d8a('0x31'))[_0x5d8a('0x32')](_0x5d8a('0x33'))[_0x5d8a('0x33')]();if(_[_0x5d8a('0x34')](_0x3cafbf,_0x4cb5e2['type'])){return;}var _0x1205f8=_[_0x5d8a('0x35')](_0x3a637f,[_0x5d8a('0x33'),_0x4cb5e2[_0x5d8a('0x36')]])[_0x5d8a('0x37')];return db[_0x5d8a('0x38')][_0x5d8a('0x2c')]({'where':{'type':_0x1205f8,'resourceId':_0x4cb5e2['id']}})[_0x5d8a('0x2d')](function(){return _0x564636;});})['then'](function(){_0x281c93[_0x5d8a('0x21')](0xcc)[_0x5d8a('0x39')]();});}};}function handleEntityNotFound(_0x404458,_0x2e7390){return function(_0x121207){if(!_0x121207){_0x404458[_0x5d8a('0x20')](0x194);}return _0x121207;};}function handleError(_0x143e5d,_0x1be83e){_0x1be83e=_0x1be83e||0x1f4;return function(_0x310709){logger[_0x5d8a('0x3a')](_0x310709[_0x5d8a('0x3b')]);if(_0x310709[_0x5d8a('0x37')]){delete _0x310709['name'];}_0x143e5d[_0x5d8a('0x21')](_0x1be83e)[_0x5d8a('0x3c')](_0x310709);};}exports[_0x5d8a('0x3d')]=function(_0x527ce2,_0x3d6b9c){var _0x592743={},_0x104138={},_0x4b33b4={'count':0x0,'rows':[]};var _0x5ce9d6=_[_0x5d8a('0x32')](db['VoiceQueue']['rawAttributes'],function(_0x213cd4){return{'name':_0x213cd4[_0x5d8a('0x3e')],'type':_0x213cd4[_0x5d8a('0x36')][_0x5d8a('0x3f')]};});_0x104138[_0x5d8a('0x40')]=_[_0x5d8a('0x32')](_0x5ce9d6,_0x5d8a('0x37'));_0x104138[_0x5d8a('0x41')]=_[_0x5d8a('0x42')](_0x527ce2['query']);_0x104138['filters']=_['intersection'](_0x104138[_0x5d8a('0x40')],_0x104138[_0x5d8a('0x41')]);_0x592743[_0x5d8a('0x43')]=_[_0x5d8a('0x44')](_0x104138['model'],qs['fields'](_0x527ce2[_0x5d8a('0x41')][_0x5d8a('0x45')]));_0x592743[_0x5d8a('0x43')]=_0x592743[_0x5d8a('0x43')][_0x5d8a('0x46')]?_0x592743[_0x5d8a('0x43')]:_0x104138[_0x5d8a('0x40')];if(!_0x527ce2['query']['hasOwnProperty']('nolimit')){_0x592743[_0x5d8a('0x24')]=qs[_0x5d8a('0x24')](_0x527ce2[_0x5d8a('0x41')][_0x5d8a('0x24')]);_0x592743[_0x5d8a('0x26')]=qs[_0x5d8a('0x26')](_0x527ce2[_0x5d8a('0x41')]['offset']);}_0x592743[_0x5d8a('0x47')]=qs[_0x5d8a('0x48')](_0x527ce2[_0x5d8a('0x41')]['sort']);_0x592743[_0x5d8a('0x49')]=qs[_0x5d8a('0x4a')](_[_0x5d8a('0x4b')](_0x527ce2[_0x5d8a('0x41')],_0x104138['filters']),_0x5ce9d6);if(_0x527ce2['query'][_0x5d8a('0x4c')]){_0x592743[_0x5d8a('0x49')]=_[_0x5d8a('0x4d')](_0x592743['where'],{'$or':_[_0x5d8a('0x32')](_0x5ce9d6,function(_0x4bf1f8){if(_0x4bf1f8[_0x5d8a('0x36')]!==_0x5d8a('0x4e')){var _0x4ee290={};_0x4ee290[_0x4bf1f8['name']]={'$like':'%'+_0x527ce2[_0x5d8a('0x41')][_0x5d8a('0x4c')]+'%'};return _0x4ee290;}})});}_0x592743=_[_0x5d8a('0x4d')]({},_0x592743,_0x527ce2[_0x5d8a('0x4f')]);var _0x33abde={'where':_0x592743[_0x5d8a('0x49')]};return db[_0x5d8a('0x50')][_0x5d8a('0x25')](_0x33abde)[_0x5d8a('0x2d')](function(_0x2679a8){_0x4b33b4[_0x5d8a('0x25')]=_0x2679a8;if(_0x527ce2['query'][_0x5d8a('0x51')]){_0x592743[_0x5d8a('0x52')]=[{'all':!![]}];}return db[_0x5d8a('0x50')][_0x5d8a('0x53')](_0x592743);})[_0x5d8a('0x2d')](function(_0x64717e){_0x4b33b4['rows']=_0x64717e;return _0x4b33b4;})['then'](respondWithFilteredResult(_0x3d6b9c,_0x592743))[_0x5d8a('0x54')](handleError(_0x3d6b9c,null));};exports[_0x5d8a('0x55')]=function(_0x25654e,_0x14db73){var _0x35de3e={'raw':![],'where':{'id':_0x25654e[_0x5d8a('0x56')]['id']}},_0x20e5be={};_0x20e5be[_0x5d8a('0x40')]=_['keys'](db[_0x5d8a('0x50')]['rawAttributes']);_0x20e5be['query']=_[_0x5d8a('0x42')](_0x25654e['query']);_0x20e5be[_0x5d8a('0x4a')]=_[_0x5d8a('0x44')](_0x20e5be[_0x5d8a('0x40')],_0x20e5be[_0x5d8a('0x41')]);_0x35de3e['attributes']=_['intersection'](_0x20e5be[_0x5d8a('0x40')],qs[_0x5d8a('0x45')](_0x25654e['query'][_0x5d8a('0x45')]));_0x35de3e['attributes']=_0x35de3e['attributes'][_0x5d8a('0x46')]?_0x35de3e[_0x5d8a('0x43')]:_0x20e5be[_0x5d8a('0x40')];if(_0x25654e[_0x5d8a('0x41')]['includeAll']){_0x35de3e[_0x5d8a('0x52')]=[{'all':!![]}];}_0x35de3e=_[_0x5d8a('0x4d')]({},_0x35de3e,_0x25654e[_0x5d8a('0x4f')]);return db[_0x5d8a('0x50')][_0x5d8a('0x35')](_0x35de3e)[_0x5d8a('0x2d')](handleEntityNotFound(_0x14db73,null))[_0x5d8a('0x2d')](respondWithResult(_0x14db73,null))[_0x5d8a('0x54')](handleError(_0x14db73,null));};exports['create']=function(_0x5052af,_0x2be2c6){return db['VoiceQueue']['create'](_0x5052af[_0x5d8a('0x57')],{})[_0x5d8a('0x2d')](function(_0x4c3145){var _0x5cfb3b=_0x5052af[_0x5d8a('0x58')]['get']({'plain':!![]});if(!_0x5cfb3b)throw new Error(_0x5d8a('0x59'));if(_0x5cfb3b['role']===_0x5d8a('0x58')){var _0x457a20=_0x4c3145[_0x5d8a('0x5a')]({'plain':!![]});var _0xfe0723=[{'name':_0x5d8a('0x2e'),'value':_0x5d8a('0x2f')},{'name':_0x5d8a('0x5b'),'value':'outbound'}];var _0x20ec58=_[_0x5d8a('0x35')](_0xfe0723,[_0x5d8a('0x33'),_0x457a20[_0x5d8a('0x36')]])[_0x5d8a('0x37')];return db['UserProfileSection'][_0x5d8a('0x35')]({'where':{'name':_0x20ec58,'userProfileId':_0x5cfb3b['userProfileId']},'raw':!![]})[_0x5d8a('0x2d')](function(_0x4a5f95){if(_0x4a5f95&&_0x4a5f95[_0x5d8a('0x5c')]===0x0){return db['UserProfileResource'][_0x5d8a('0x5d')]({'name':_0x457a20[_0x5d8a('0x37')],'resourceId':_0x457a20['id'],'type':_0x4a5f95[_0x5d8a('0x37')],'sectionId':_0x4a5f95['id']},{})[_0x5d8a('0x2d')](function(){return _0x4c3145;});}else{return _0x4c3145;}})[_0x5d8a('0x54')](function(_0x238948){logger[_0x5d8a('0x3a')](_0x5d8a('0x5e'),_0x238948);throw _0x238948;});}return _0x4c3145;})[_0x5d8a('0x2d')](respondWithResult(_0x2be2c6,0xc9))[_0x5d8a('0x54')](handleError(_0x2be2c6,null));};exports[_0x5d8a('0x5f')]=function(_0x15ce89,_0x132b8a){var _0x209ad2={'where':{'id':_0x15ce89['params']['id']}},_0xb389ca={};_0xb389ca[_0x5d8a('0x40')]=_[_0x5d8a('0x42')](db[_0x5d8a('0x50')][_0x5d8a('0x60')]);_0x209ad2[_0x5d8a('0x43')]=_[_0x5d8a('0x44')](_0xb389ca[_0x5d8a('0x40')],qs['fields'](_0x15ce89['query'][_0x5d8a('0x45')]));_0x209ad2[_0x5d8a('0x43')]=_0x209ad2[_0x5d8a('0x43')]['length']?_0x209ad2[_0x5d8a('0x43')]:_0xb389ca[_0x5d8a('0x40')];if(_0x15ce89[_0x5d8a('0x41')][_0x5d8a('0x51')]){_0x209ad2[_0x5d8a('0x52')]=[{'all':!![]}];}_0x209ad2=_['merge']({},_0x209ad2,_0x15ce89[_0x5d8a('0x4f')]);return db['VoiceQueue']['find'](_0x209ad2)[_0x5d8a('0x2d')](handleEntityNotFound(_0x132b8a,null))[_0x5d8a('0x2d')](function(_0x3559f0){if(_0x3559f0){var _0x342ccb=_0x3559f0[_0x5d8a('0x5a')]({'plain':!![]});_0x342ccb=qs['omit'](_0x342ccb,['id',_0x5d8a('0x61'),_0x5d8a('0x62')]);_0x15ce89['body']=_[_0x5d8a('0x63')](_0x15ce89['body'],['id','createdAt','updatedAt']);return db[_0x5d8a('0x50')]['create'](_[_0x5d8a('0x4d')](_0x342ccb,_0x15ce89[_0x5d8a('0x57')]),{'include':_0x15ce89[_0x5d8a('0x41')][_0x5d8a('0x51')]?[{'all':!![]}]:undefined})[_0x5d8a('0x2d')](function(_0x522119){var _0x44becd=_0x15ce89[_0x5d8a('0x58')][_0x5d8a('0x5a')]({'plain':!![]});if(!_0x44becd)throw new Error(_0x5d8a('0x59'));if(_0x44becd['role']===_0x5d8a('0x58')){var _0x342f45=_0x522119[_0x5d8a('0x5a')]({'plain':!![]});var _0x31f2bc=[{'name':_0x5d8a('0x2e'),'value':_0x5d8a('0x2f')},{'name':_0x5d8a('0x5b'),'value':'outbound'}];var _0x16b070=_[_0x5d8a('0x35')](_0x31f2bc,['value',_0x342f45['type']])[_0x5d8a('0x37')];return db[_0x5d8a('0x64')][_0x5d8a('0x35')]({'where':{'name':_0x16b070,'userProfileId':_0x44becd[_0x5d8a('0x65')]},'raw':!![]})[_0x5d8a('0x2d')](function(_0x11abfd){if(_0x11abfd&&_0x11abfd[_0x5d8a('0x5c')]===0x0){return db[_0x5d8a('0x38')][_0x5d8a('0x5d')]({'name':_0x342f45[_0x5d8a('0x37')],'resourceId':_0x342f45['id'],'type':_0x11abfd[_0x5d8a('0x37')],'sectionId':_0x11abfd['id']},{})[_0x5d8a('0x2d')](function(){return _0x522119;});}else{return _0x522119;}})[_0x5d8a('0x54')](function(_0x5d7a25){logger[_0x5d8a('0x3a')](_0x5d8a('0x5e'),_0x5d7a25);throw _0x5d7a25;});}return _0x522119;});}})[_0x5d8a('0x2d')](respondWithResult(_0x132b8a,0xc9))[_0x5d8a('0x54')](handleError(_0x132b8a,null));};exports[_0x5d8a('0x2b')]=function(_0x49c8e3,_0x198ff5){if(_0x49c8e3[_0x5d8a('0x57')]['id']){delete _0x49c8e3[_0x5d8a('0x57')]['id'];}return db['VoiceQueue'][_0x5d8a('0x35')]({'where':{'id':_0x49c8e3[_0x5d8a('0x56')]['id']}})[_0x5d8a('0x2d')](handleEntityNotFound(_0x198ff5,null))[_0x5d8a('0x2d')](saveUpdates(_0x49c8e3[_0x5d8a('0x57')],null))[_0x5d8a('0x2d')](respondWithResult(_0x198ff5,null))[_0x5d8a('0x54')](handleError(_0x198ff5,null));};exports['destroy']=function(_0x3de906,_0x898de1){return db[_0x5d8a('0x50')]['find']({'where':{'id':_0x3de906[_0x5d8a('0x56')]['id']}})[_0x5d8a('0x2d')](handleEntityNotFound(_0x898de1,null))[_0x5d8a('0x2d')](removeEntity(_0x898de1,null))[_0x5d8a('0x54')](handleError(_0x898de1,null));};exports[_0x5d8a('0x66')]=function(_0x5859f0,_0x3d9e74,_0x1a3084){var _0x1bc626={'raw':![],'where':{}};var _0x183c60={};var _0x976785={'count':0x0,'rows':[]};return db[_0x5d8a('0x50')]['findOne']({'where':{'id':_0x5859f0[_0x5d8a('0x56')]['id']}})['then'](handleEntityNotFound(_0x3d9e74,null))[_0x5d8a('0x2d')](function(_0x5aaf74){if(_0x5aaf74){_0x183c60['model']=_[_0x5d8a('0x42')](db[_0x5d8a('0x67')]['rawAttributes']);_0x183c60['query']=_[_0x5d8a('0x42')](_0x5859f0[_0x5d8a('0x41')]);_0x183c60['filters']=_[_0x5d8a('0x44')](_0x183c60[_0x5d8a('0x40')],_0x183c60[_0x5d8a('0x41')]);_0x1bc626[_0x5d8a('0x43')]=_['intersection'](_0x183c60['model'],qs[_0x5d8a('0x45')](_0x5859f0[_0x5d8a('0x41')][_0x5d8a('0x45')]));_0x1bc626[_0x5d8a('0x43')]=_0x1bc626[_0x5d8a('0x43')][_0x5d8a('0x46')]?_0x1bc626[_0x5d8a('0x43')]:_0x183c60[_0x5d8a('0x40')];if(!_0x5859f0[_0x5d8a('0x41')][_0x5d8a('0x68')](_0x5d8a('0x69'))){_0x1bc626[_0x5d8a('0x24')]=qs[_0x5d8a('0x24')](_0x5859f0['query'][_0x5d8a('0x24')]);_0x1bc626[_0x5d8a('0x26')]=qs[_0x5d8a('0x26')](_0x5859f0[_0x5d8a('0x41')][_0x5d8a('0x26')]);}_0x1bc626['order']=qs[_0x5d8a('0x48')](_0x5859f0['query'][_0x5d8a('0x48')]);_0x1bc626[_0x5d8a('0x49')]=qs['filters'](_['pick'](_0x5859f0[_0x5d8a('0x41')],_0x183c60[_0x5d8a('0x4a')]));_0x1bc626['where']['VoiceQueueId']=_0x5aaf74['id'];if(_0x5859f0[_0x5d8a('0x41')]['filter']){_0x1bc626['where']=_[_0x5d8a('0x4d')](_0x1bc626['where'],{'$or':_[_0x5d8a('0x32')](_0x1bc626[_0x5d8a('0x43')],function(_0x3fb5f4){var _0x48826c={};_0x48826c[_0x3fb5f4]={'$like':'%'+_0x5859f0[_0x5d8a('0x41')][_0x5d8a('0x4c')]+'%'};return _0x48826c;})});}_0x1bc626=_['merge']({},_0x1bc626,_0x5859f0['options']);return db[_0x5d8a('0x67')][_0x5d8a('0x25')]({'where':_0x1bc626[_0x5d8a('0x49')]})[_0x5d8a('0x2d')](function(_0x3d4e49){_0x976785['count']=_0x3d4e49;if(_0x5859f0[_0x5d8a('0x41')][_0x5d8a('0x51')]){_0x1bc626[_0x5d8a('0x52')]=[{'all':!![]}];}return db[_0x5d8a('0x67')][_0x5d8a('0x53')](_0x1bc626);})['then'](function(_0x2a5df9){_0x976785[_0x5d8a('0x6a')]=_0x2a5df9;return _0x976785;});}})[_0x5d8a('0x2d')](respondWithFilteredResult(_0x3d9e74,_0x1bc626))[_0x5d8a('0x54')](handleError(_0x3d9e74,null));};exports[_0x5d8a('0x6b')]=function(_0x4cbf24,_0x222b5a,_0x40658c){var _0x491f35={'raw':!![],'where':{}};var _0x5e89bc={};var _0x564bf2={'count':0x0,'rows':[]};return db[_0x5d8a('0x50')][_0x5d8a('0x6c')]({'where':{'id':_0x4cbf24[_0x5d8a('0x56')]['id']}})[_0x5d8a('0x2d')](handleEntityNotFound(_0x222b5a,null))['then'](function(_0x368fc5){if(_0x368fc5){_0x5e89bc[_0x5d8a('0x40')]=_[_0x5d8a('0x42')](db['CmHopperHistory'][_0x5d8a('0x60')]);_0x5e89bc[_0x5d8a('0x41')]=_['keys'](_0x4cbf24[_0x5d8a('0x41')]);_0x5e89bc[_0x5d8a('0x4a')]=_[_0x5d8a('0x44')](_0x5e89bc[_0x5d8a('0x40')],_0x5e89bc[_0x5d8a('0x41')]);_0x491f35['attributes']=_['intersection'](_0x5e89bc[_0x5d8a('0x40')],qs[_0x5d8a('0x45')](_0x4cbf24[_0x5d8a('0x41')][_0x5d8a('0x45')]));_0x491f35[_0x5d8a('0x43')]=_0x491f35['attributes'][_0x5d8a('0x46')]?_0x491f35[_0x5d8a('0x43')]:_0x5e89bc[_0x5d8a('0x40')];if(!_0x4cbf24[_0x5d8a('0x41')][_0x5d8a('0x68')]('nolimit')){_0x491f35[_0x5d8a('0x24')]=qs[_0x5d8a('0x24')](_0x4cbf24[_0x5d8a('0x41')]['limit']);_0x491f35[_0x5d8a('0x26')]=qs[_0x5d8a('0x26')](_0x4cbf24[_0x5d8a('0x41')][_0x5d8a('0x26')]);}_0x491f35[_0x5d8a('0x47')]=qs[_0x5d8a('0x48')](_0x4cbf24[_0x5d8a('0x41')][_0x5d8a('0x48')]);_0x491f35['where']=qs[_0x5d8a('0x4a')](_[_0x5d8a('0x4b')](_0x4cbf24[_0x5d8a('0x41')],_0x5e89bc[_0x5d8a('0x4a')]));_0x491f35['where']['VoiceQueueId']=_0x368fc5['id'];if(_0x4cbf24[_0x5d8a('0x41')]['filter']){_0x491f35['where']=_[_0x5d8a('0x4d')](_0x491f35['where'],{'$or':_[_0x5d8a('0x32')](_0x491f35[_0x5d8a('0x43')],function(_0x45d9f0){var _0x438469={};_0x438469[_0x45d9f0]={'$like':'%'+_0x4cbf24['query']['filter']+'%'};return _0x438469;})});}_0x491f35=_[_0x5d8a('0x4d')]({},_0x491f35,_0x4cbf24[_0x5d8a('0x4f')]);return db[_0x5d8a('0x6d')]['count']({'where':_0x491f35[_0x5d8a('0x49')]})[_0x5d8a('0x2d')](function(_0x5c65cc){_0x564bf2[_0x5d8a('0x25')]=_0x5c65cc;if(_0x4cbf24[_0x5d8a('0x41')][_0x5d8a('0x51')]){_0x491f35['include']=[{'all':!![]}];}return db[_0x5d8a('0x6d')]['findAll'](_0x491f35);})['then'](function(_0x2b4c02){_0x564bf2[_0x5d8a('0x6a')]=_0x2b4c02;return _0x564bf2;});}})[_0x5d8a('0x2d')](respondWithFilteredResult(_0x222b5a,_0x491f35))[_0x5d8a('0x54')](handleError(_0x222b5a,null));};exports[_0x5d8a('0x6e')]=function(_0x2ecef8,_0x150185,_0x4ecc40){var _0x1199c7={'raw':!![],'where':{}};var _0x28077c={};var _0x40fcc8={'count':0x0,'rows':[]};return db[_0x5d8a('0x50')]['findOne']({'where':{'id':_0x2ecef8[_0x5d8a('0x56')]['id']}})[_0x5d8a('0x2d')](handleEntityNotFound(_0x150185,null))['then'](function(_0x51eca4){if(_0x51eca4){_0x28077c['model']=_['keys'](db[_0x5d8a('0x6f')][_0x5d8a('0x60')]);_0x28077c[_0x5d8a('0x41')]=_['keys'](_0x2ecef8['query']);_0x28077c[_0x5d8a('0x4a')]=_[_0x5d8a('0x44')](_0x28077c[_0x5d8a('0x40')],_0x28077c[_0x5d8a('0x41')]);_0x1199c7['attributes']=_[_0x5d8a('0x44')](_0x28077c[_0x5d8a('0x40')],qs['fields'](_0x2ecef8[_0x5d8a('0x41')][_0x5d8a('0x45')]));_0x1199c7[_0x5d8a('0x43')]=_0x1199c7[_0x5d8a('0x43')][_0x5d8a('0x46')]?_0x1199c7['attributes']:_0x28077c[_0x5d8a('0x40')];if(!_0x2ecef8['query'][_0x5d8a('0x68')]('nolimit')){_0x1199c7[_0x5d8a('0x24')]=qs[_0x5d8a('0x24')](_0x2ecef8[_0x5d8a('0x41')]['limit']);_0x1199c7['offset']=qs[_0x5d8a('0x26')](_0x2ecef8[_0x5d8a('0x41')][_0x5d8a('0x26')]);}_0x1199c7[_0x5d8a('0x47')]=qs[_0x5d8a('0x48')](_0x2ecef8[_0x5d8a('0x41')][_0x5d8a('0x48')]);_0x1199c7[_0x5d8a('0x49')]=qs[_0x5d8a('0x4a')](_[_0x5d8a('0x4b')](_0x2ecef8[_0x5d8a('0x41')],_0x28077c['filters']));_0x1199c7[_0x5d8a('0x49')][_0x5d8a('0x70')]=_0x51eca4['id'];if(_0x2ecef8['query']['filter']){_0x1199c7[_0x5d8a('0x49')]=_['merge'](_0x1199c7['where'],{'$or':_[_0x5d8a('0x32')](_0x1199c7[_0x5d8a('0x43')],function(_0x336147){var _0x1b49ce={};_0x1b49ce[_0x336147]={'$like':'%'+_0x2ecef8['query'][_0x5d8a('0x4c')]+'%'};return _0x1b49ce;})});}_0x1199c7=_[_0x5d8a('0x4d')]({},_0x1199c7,_0x2ecef8[_0x5d8a('0x4f')]);return db[_0x5d8a('0x6f')][_0x5d8a('0x25')]({'where':_0x1199c7[_0x5d8a('0x49')]})[_0x5d8a('0x2d')](function(_0x32dbff){_0x40fcc8[_0x5d8a('0x25')]=_0x32dbff;if(_0x2ecef8[_0x5d8a('0x41')][_0x5d8a('0x51')]){_0x1199c7[_0x5d8a('0x52')]=[{'all':!![]}];}return db[_0x5d8a('0x6f')][_0x5d8a('0x53')](_0x1199c7);})[_0x5d8a('0x2d')](function(_0x15590a){_0x40fcc8[_0x5d8a('0x6a')]=_0x15590a;return _0x40fcc8;});}})[_0x5d8a('0x2d')](respondWithFilteredResult(_0x150185,_0x1199c7))[_0x5d8a('0x54')](handleError(_0x150185,null));};exports[_0x5d8a('0x71')]=function(_0x123158,_0x3e4cf6,_0x16a492){var _0x4c6125={'raw':!![],'where':{}};var _0x5355a7={};var _0x251c98={'count':0x0,'rows':[]};return db[_0x5d8a('0x50')][_0x5d8a('0x6c')]({'where':{'id':_0x123158[_0x5d8a('0x56')]['id']}})[_0x5d8a('0x2d')](handleEntityNotFound(_0x3e4cf6,null))[_0x5d8a('0x2d')](function(_0x39c89a){if(_0x39c89a){_0x5355a7[_0x5d8a('0x40')]=_['keys'](db[_0x5d8a('0x72')][_0x5d8a('0x60')]);_0x5355a7[_0x5d8a('0x41')]=_[_0x5d8a('0x42')](_0x123158[_0x5d8a('0x41')]);_0x5355a7[_0x5d8a('0x4a')]=_[_0x5d8a('0x44')](_0x5355a7[_0x5d8a('0x40')],_0x5355a7[_0x5d8a('0x41')]);_0x4c6125[_0x5d8a('0x43')]=_[_0x5d8a('0x44')](_0x5355a7[_0x5d8a('0x40')],qs[_0x5d8a('0x45')](_0x123158[_0x5d8a('0x41')][_0x5d8a('0x45')]));_0x4c6125['attributes']=_0x4c6125[_0x5d8a('0x43')]['length']?_0x4c6125[_0x5d8a('0x43')]:_0x5355a7[_0x5d8a('0x40')];if(!_0x123158[_0x5d8a('0x41')][_0x5d8a('0x68')]('nolimit')){_0x4c6125['limit']=qs[_0x5d8a('0x24')](_0x123158[_0x5d8a('0x41')][_0x5d8a('0x24')]);_0x4c6125[_0x5d8a('0x26')]=qs[_0x5d8a('0x26')](_0x123158[_0x5d8a('0x41')][_0x5d8a('0x26')]);}_0x4c6125[_0x5d8a('0x47')]=qs[_0x5d8a('0x48')](_0x123158[_0x5d8a('0x41')][_0x5d8a('0x48')]);_0x4c6125['where']=qs['filters'](_[_0x5d8a('0x4b')](_0x123158[_0x5d8a('0x41')],_0x5355a7[_0x5d8a('0x4a')]));_0x4c6125[_0x5d8a('0x49')]['VoiceQueueId']=_0x39c89a['id'];if(_0x123158[_0x5d8a('0x41')][_0x5d8a('0x4c')]){_0x4c6125[_0x5d8a('0x49')]=_[_0x5d8a('0x4d')](_0x4c6125[_0x5d8a('0x49')],{'$or':_[_0x5d8a('0x32')](_0x4c6125[_0x5d8a('0x43')],function(_0x6ab621){var _0x2753ea={};_0x2753ea[_0x6ab621]={'$like':'%'+_0x123158[_0x5d8a('0x41')][_0x5d8a('0x4c')]+'%'};return _0x2753ea;})});}_0x4c6125=_[_0x5d8a('0x4d')]({},_0x4c6125,_0x123158['options']);return db['CmHopperBlack'][_0x5d8a('0x25')]({'where':_0x4c6125['where']})[_0x5d8a('0x2d')](function(_0xd8ef54){_0x251c98['count']=_0xd8ef54;if(_0x123158[_0x5d8a('0x41')][_0x5d8a('0x51')]){_0x4c6125[_0x5d8a('0x52')]=[{'all':!![]}];}return db[_0x5d8a('0x72')][_0x5d8a('0x53')](_0x4c6125);})[_0x5d8a('0x2d')](function(_0x233224){_0x251c98[_0x5d8a('0x6a')]=_0x233224;return _0x251c98;});}})[_0x5d8a('0x2d')](respondWithFilteredResult(_0x3e4cf6,_0x4c6125))['catch'](handleError(_0x3e4cf6,null));};exports[_0x5d8a('0x73')]=function(_0x5eb04c,_0x212088,_0x5eaf7c){var _0x160dc9={};var _0x203479={};var _0x4e782b;var _0x202e59;return db[_0x5d8a('0x50')][_0x5d8a('0x6c')]({'where':{'id':_0x5eb04c[_0x5d8a('0x56')]['id']}})['then'](handleEntityNotFound(_0x212088,null))['then'](function(_0x5290ce){if(_0x5290ce){_0x4e782b=_0x5290ce;_0x203479[_0x5d8a('0x40')]=_[_0x5d8a('0x42')](db['Team'][_0x5d8a('0x60')]);_0x203479['query']=_['keys'](_0x5eb04c[_0x5d8a('0x41')]);_0x203479[_0x5d8a('0x4a')]=_[_0x5d8a('0x44')](_0x203479['model'],_0x203479['query']);_0x160dc9[_0x5d8a('0x43')]=_['intersection'](_0x203479[_0x5d8a('0x40')],qs[_0x5d8a('0x45')](_0x5eb04c[_0x5d8a('0x41')][_0x5d8a('0x45')]));_0x160dc9[_0x5d8a('0x43')]=_0x160dc9[_0x5d8a('0x43')][_0x5d8a('0x46')]?_0x160dc9[_0x5d8a('0x43')]:_0x203479[_0x5d8a('0x40')];_0x160dc9[_0x5d8a('0x47')]=qs['sort'](_0x5eb04c[_0x5d8a('0x41')]['sort']);_0x160dc9[_0x5d8a('0x49')]=qs[_0x5d8a('0x4a')](_[_0x5d8a('0x4b')](_0x5eb04c[_0x5d8a('0x41')],_0x203479[_0x5d8a('0x4a')]));if(_0x5eb04c['query'][_0x5d8a('0x4c')]){_0x160dc9[_0x5d8a('0x49')]=_['merge'](_0x160dc9[_0x5d8a('0x49')],{'$or':_[_0x5d8a('0x32')](_0x160dc9[_0x5d8a('0x43')],function(_0x4b5c2b){var _0x453aed={};_0x453aed[_0x4b5c2b]={'$like':'%'+_0x5eb04c[_0x5d8a('0x41')][_0x5d8a('0x4c')]+'%'};return _0x453aed;})});}_0x160dc9=_[_0x5d8a('0x4d')]({},_0x160dc9,_0x5eb04c[_0x5d8a('0x4f')]);return _0x4e782b[_0x5d8a('0x73')](_0x160dc9);}})[_0x5d8a('0x2d')](function(_0x2522a2){if(_0x2522a2){_0x202e59=_0x2522a2[_0x5d8a('0x46')];if(!_0x5eb04c['query'][_0x5d8a('0x68')](_0x5d8a('0x69'))){_0x160dc9[_0x5d8a('0x24')]=qs[_0x5d8a('0x24')](_0x5eb04c[_0x5d8a('0x41')][_0x5d8a('0x24')]);_0x160dc9[_0x5d8a('0x26')]=qs[_0x5d8a('0x26')](_0x5eb04c[_0x5d8a('0x41')]['offset']);}return _0x4e782b['getTeams'](_0x160dc9);}})['then'](function(_0x52f9e1){if(_0x52f9e1){return _0x52f9e1?{'count':_0x202e59,'rows':_0x52f9e1}:null;}})[_0x5d8a('0x2d')](respondWithResult(_0x212088,null))[_0x5d8a('0x54')](handleError(_0x212088,null));};exports['addTeams']=function(_0xa9d1b5,_0x599ae2,_0x571318){var _0x43947c=_0xa9d1b5[_0x5d8a('0x57')]['teams'];var _0x574ec0=_[_0x5d8a('0x32')](_0x43947c,'id');return db[_0x5d8a('0x74')]['findAll']({'where':{'id':_0x574ec0},'attributes':['id'],'include':[{'model':db[_0x5d8a('0x75')],'as':'Agents','attributes':['id',_0x5d8a('0x37'),'online',_0x5d8a('0x76'),_0x5d8a('0x77')],'raw':!![]}]})[_0x5d8a('0x2d')](function(_0x487fd3){if(_0x487fd3){var _0x26461f=_[_0x5d8a('0x78')](_0x487fd3,function(_0x43d858){var _0x487720=_0x43d858['get']({'plain':!![]});_0x487720['Agents']['forEach'](function(_0xdda62d){_0xdda62d[_0x5d8a('0x79')]=_[_0x5d8a('0x35')](_0x43947c,{'id':_0x487720['id']})['penalty'];});return _0x487720[_0x5d8a('0x7a')];});return db[_0x5d8a('0x50')][_0x5d8a('0x35')]({'where':{'id':_0xa9d1b5['params']['id']}})[_0x5d8a('0x2d')](function(_0x3366b5){return db[_0x5d8a('0x7b')]['transaction'](function(_0x13c24f){return _0x3366b5[_0x5d8a('0x7c')](_0x574ec0,{'transaction':_0x13c24f})[_0x5d8a('0x2d')](function(){return BPromise[_0x5d8a('0x7d')](_0x43947c,function(_0x2ec8dc){return db['TeamVoiceQueue'][_0x5d8a('0x7e')]({'TeamId':_0x2ec8dc['id'],'VoiceQueueId':_0xa9d1b5[_0x5d8a('0x56')]['id'],'penalty':_0x2ec8dc[_0x5d8a('0x79')]},{'transaction':_0x13c24f});});})[_0x5d8a('0x2d')](function(){return BPromise['each'](_0x26461f,function(_0x4b8334){return db[_0x5d8a('0x7f')][_0x5d8a('0x80')]({'where':{'UserId':_0x4b8334['id'],'VoiceQueueId':_0xa9d1b5['params']['id']},'defaults':{'penalty':_0x4b8334[_0x5d8a('0x79')]},'transaction':_0x13c24f});});})[_0x5d8a('0x2d')](function(){return BPromise[_0x5d8a('0x7d')](_[_0x5d8a('0x4c')](_0x26461f,{'online':!![]}),function(_0x539950){return db[_0x5d8a('0x81')][_0x5d8a('0x7e')]({'membername':_0x539950[_0x5d8a('0x37')],'UserId':_0x539950['id'],'queue_name':_0x3366b5[_0x5d8a('0x37')],'VoiceQueueId':_0x3366b5['id'],'interface':_[_0x5d8a('0x82')](_0x539950[_0x5d8a('0x77')])?util[_0x5d8a('0x83')](_0x5d8a('0x84'),_0x539950['name']):_0x539950['interface'],'paused':_0x539950[_0x5d8a('0x76')]||![],'penalty':_0x539950[_0x5d8a('0x79')]},{'transaction':_0x13c24f});});})[_0x5d8a('0x2d')](function(){_0x26461f['forEach'](function(_0x11925f){socket[_0x5d8a('0x85')](_0x5d8a('0x86'),{'UserId':_0x11925f['id'],'VoiceQueueId':_0x3366b5['id']});});});});});}})['then'](respondWithStatusCode(_0x599ae2,null))[_0x5d8a('0x54')](handleError(_0x599ae2,null));};exports[_0x5d8a('0x87')]=function(_0x4b1ff0,_0x268ce9,_0x443374){return db[_0x5d8a('0x74')][_0x5d8a('0x53')]({'where':{'id':_0x4b1ff0[_0x5d8a('0x41')][_0x5d8a('0x88')]},'attributes':['id'],'include':[{'model':db[_0x5d8a('0x75')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x5d8a('0x2d')](handleEntityNotFound(_0x268ce9,null))[_0x5d8a('0x2d')](function(_0x3b650e){var _0x5d9b69=_[_0x5d8a('0x32')](_0x3b650e,'id');var _0x87aaca=[];var _0x3c1a97=[];var _0x416683=squel[_0x5d8a('0x89')]();_0x416683['field']('tq.TeamId')[_0x5d8a('0x8a')](_0x5d8a('0x8b'),'tq')['join'](_0x5d8a('0x8c'),'ut',_0x5d8a('0x8d'))[_0x5d8a('0x49')](_0x5d8a('0x8e'),_0x4b1ff0[_0x5d8a('0x56')]['id']);for(var _0x55944c=0x0;_0x55944c<_0x3b650e[_0x5d8a('0x46')];_0x55944c+=0x1){let _0x4307a3=_0x3b650e[_0x55944c];for(var _0xffa541=0x0;_0xffa541<_0x4307a3[_0x5d8a('0x7a')][_0x5d8a('0x46')];_0xffa541+=0x1){let _0x2f75a8=_0x4307a3['Agents'][_0xffa541];var _0x235f85=_0x416683[_0x5d8a('0x5f')]();_0x235f85[_0x5d8a('0x49')](_0x5d8a('0x8f'),_0x2f75a8['id']);_0x3c1a97['push'](db[_0x5d8a('0x7b')][_0x5d8a('0x41')](_0x235f85['toString'](),{'type':db[_0x5d8a('0x7b')]['QueryTypes'][_0x5d8a('0x90')]})[_0x5d8a('0x2d')](function(_0x43758f){if(_0x43758f['length']===0x1){return _0x2f75a8['id'];}else{var _0xcad217=_[_0x5d8a('0x91')](_[_0x5d8a('0x32')](_0x43758f,_0x5d8a('0x92')),function(_0x3cdea3){return _[_0x5d8a('0x34')](_0x5d9b69,_0x3cdea3);});if(_0xcad217){return _0x2f75a8['id'];}}}));}}return BPromise[_0x5d8a('0x93')](_0x3c1a97)[_0x5d8a('0x2d')](function(_0x1d75aa){_0x87aaca=_(_0x87aaca)[_0x5d8a('0x94')](_0x1d75aa)[_0x5d8a('0x95')]()[_0x5d8a('0x33')]();return db['VoiceQueue']['find']({'where':{'id':_0x4b1ff0[_0x5d8a('0x56')]['id']}})[_0x5d8a('0x2d')](function(_0x1a83d2){return db['sequelize'][_0x5d8a('0x96')](function(_0x56b141){return _0x1a83d2['removeTeams'](_0x4b1ff0[_0x5d8a('0x41')][_0x5d8a('0x88')],{'transaction':_0x56b141})[_0x5d8a('0x2d')](function(){if(!_[_0x5d8a('0x97')](_0x87aaca)){return _0x1a83d2[_0x5d8a('0x98')](_0x87aaca,{'transaction':_0x56b141})[_0x5d8a('0x2d')](function(){return db[_0x5d8a('0x81')][_0x5d8a('0x2c')]({'where':{'VoiceQueueId':_0x4b1ff0[_0x5d8a('0x56')]['id'],'UserId':_0x87aaca},'transaction':_0x56b141});});}})[_0x5d8a('0x2d')](function(){_0x87aaca[_0x5d8a('0x99')](function(_0x4a6831){socket[_0x5d8a('0x85')](_0x5d8a('0x9a'),{'UserId':_0x4a6831,'VoiceQueueId':_0x1a83d2['id']});});});});});});})[_0x5d8a('0x2d')](respondWithStatusCode(_0x268ce9,null))[_0x5d8a('0x54')](handleError(_0x268ce9,null));};exports[_0x5d8a('0x9b')]=function(_0xc5da7,_0x147185,_0x16a394){var _0xa93564,_0x1b50cb;return db[_0x5d8a('0x50')][_0x5d8a('0x35')]({'where':{'id':_0xc5da7['params']['id']}})[_0x5d8a('0x2d')](handleEntityNotFound(_0x147185,null))[_0x5d8a('0x2d')](function(_0x129e1c){if(_0x129e1c){_0x1b50cb=_0x129e1c;return _0x129e1c['addAgents'](_0xc5da7[_0x5d8a('0x57')][_0x5d8a('0x88')],_[_0x5d8a('0x63')](_0xc5da7[_0x5d8a('0x57')],[_0x5d8a('0x88'),'id'])||{})[_0x5d8a('0x9c')](function(_0x50d948){for(var _0x2f3b6f=0x0;_0x2f3b6f<_0xc5da7[_0x5d8a('0x57')][_0x5d8a('0x88')][_0x5d8a('0x46')];_0x2f3b6f+=0x1){socket[_0x5d8a('0x85')](_0x5d8a('0x86'),{'UserId':Number(_0xc5da7[_0x5d8a('0x57')][_0x5d8a('0x88')][_0x2f3b6f]),'VoiceQueueId':Number(_0xc5da7[_0x5d8a('0x56')]['id'])});}return _0x50d948;});}})['then'](function(_0x224aa3){_0xa93564=_0x224aa3||[];if(_0x1b50cb){return db['User']['findAll']({'where':{'id':_0xc5da7[_0x5d8a('0x57')][_0x5d8a('0x88')]},'attributes':['id',_0x5d8a('0x37'),_0x5d8a('0x9d'),_0x5d8a('0x76'),_0x5d8a('0x77')],'raw':!![]});}})['then'](function(_0x48931b){if(!_[_0x5d8a('0x97')](_0x48931b)){var _0xb14378=[];for(var _0x1e2c94=0x0;_0x1e2c94<_0x48931b[_0x5d8a('0x46')];_0x1e2c94++){if(_0x48931b[_0x1e2c94]['online']){_0xb14378[_0x5d8a('0x9e')](db['UserVoiceQueueRt'][_0x5d8a('0x7e')]({'membername':_0x48931b[_0x1e2c94][_0x5d8a('0x37')],'UserId':_0x48931b[_0x1e2c94]['id'],'queue_name':_0x1b50cb[_0x5d8a('0x37')],'VoiceQueueId':_0x1b50cb['id'],'interface':_[_0x5d8a('0x82')](_0x48931b[_0x1e2c94][_0x5d8a('0x77')])?util['format'](_0x5d8a('0x84'),_0x48931b[_0x1e2c94][_0x5d8a('0x37')]):_0x48931b[_0x1e2c94][_0x5d8a('0x77')],'paused':_0x48931b[_0x1e2c94]['voicePause']||![],'penalty':_0xc5da7['body'][_0x5d8a('0x79')]||0x0}));}}return BPromise['all'](_0xb14378);}})[_0x5d8a('0x2d')](function(){return _0xa93564;})['then'](respondWithResult(_0x147185,null))[_0x5d8a('0x54')](handleError(_0x147185,null));};exports[_0x5d8a('0x98')]=function(_0x37c780,_0x3c597b,_0x530f0e){return db[_0x5d8a('0x50')][_0x5d8a('0x35')]({'where':{'id':_0x37c780[_0x5d8a('0x56')]['id']}})[_0x5d8a('0x2d')](handleEntityNotFound(_0x3c597b,null))['then'](function(_0x8968ee){if(_0x8968ee){return _0x8968ee[_0x5d8a('0x98')](_0x37c780['query']['ids'])[_0x5d8a('0x2d')](function(){if(_[_0x5d8a('0x9f')](_0x37c780['query'][_0x5d8a('0x88')])){for(var _0xdb483c=0x0;_0xdb483c<_0x37c780['query'][_0x5d8a('0x88')]['length'];_0xdb483c+=0x1){socket['emit'](_0x5d8a('0x9a'),{'UserId':Number(_0x37c780[_0x5d8a('0x41')][_0x5d8a('0x88')][_0xdb483c]),'VoiceQueueId':Number(_0x37c780['params']['id'])});}}else{socket[_0x5d8a('0x85')](_0x5d8a('0x9a'),{'UserId':Number(_0x37c780[_0x5d8a('0x41')][_0x5d8a('0x88')]),'VoiceQueueId':Number(_0x37c780[_0x5d8a('0x56')]['id'])});}});}})[_0x5d8a('0x2d')](function(_0x3b4a79){return db[_0x5d8a('0x81')][_0x5d8a('0x2c')]({'where':{'VoiceQueueId':_0x37c780[_0x5d8a('0x56')]['id'],'UserId':_0x37c780[_0x5d8a('0x41')][_0x5d8a('0x88')]}})[_0x5d8a('0x2d')](function(){return _0x3b4a79;});})[_0x5d8a('0x2d')](respondWithStatusCode(_0x3c597b,null))[_0x5d8a('0x54')](handleError(_0x3c597b,null));};exports[_0x5d8a('0xa0')]=function(_0x40ae0a,_0x5400c0,_0x4c976a){var _0x3a68b6={};var _0xdab423={};var _0x33ad2f;var _0x28ba28;return db['VoiceQueue'][_0x5d8a('0x6c')]({'where':{'id':_0x40ae0a[_0x5d8a('0x56')]['id']}})['then'](handleEntityNotFound(_0x5400c0,null))[_0x5d8a('0x2d')](function(_0x186040){if(_0x186040){_0x33ad2f=_0x186040;_0xdab423[_0x5d8a('0x40')]=_[_0x5d8a('0x42')](db[_0x5d8a('0x75')]['rawAttributes']);_0xdab423[_0x5d8a('0x41')]=_['keys'](_0x40ae0a[_0x5d8a('0x41')]);_0xdab423[_0x5d8a('0x4a')]=_[_0x5d8a('0x44')](_0xdab423[_0x5d8a('0x40')],_0xdab423[_0x5d8a('0x41')]);_0x3a68b6['attributes']=_[_0x5d8a('0x44')](_0xdab423[_0x5d8a('0x40')],qs['fields'](_0x40ae0a[_0x5d8a('0x41')][_0x5d8a('0x45')]));_0x3a68b6[_0x5d8a('0x43')]=_0x3a68b6[_0x5d8a('0x43')]['length']?_0x3a68b6[_0x5d8a('0x43')]:_0xdab423[_0x5d8a('0x40')];_0x3a68b6['order']=qs[_0x5d8a('0x48')](_0x40ae0a['query'][_0x5d8a('0x48')]);_0x3a68b6[_0x5d8a('0x49')]=qs[_0x5d8a('0x4a')](_[_0x5d8a('0x4b')](_0x40ae0a[_0x5d8a('0x41')],_0xdab423[_0x5d8a('0x4a')]));if(_0x40ae0a[_0x5d8a('0x41')][_0x5d8a('0x4c')]){_0x3a68b6[_0x5d8a('0x49')]=_['merge'](_0x3a68b6['where'],{'$or':_['map'](_0x3a68b6[_0x5d8a('0x43')],function(_0x54c5c3){var _0x26f4b2={};_0x26f4b2[_0x54c5c3]={'$like':'%'+_0x40ae0a['query'][_0x5d8a('0x4c')]+'%'};return _0x26f4b2;})});}_0x3a68b6=_[_0x5d8a('0x4d')]({},_0x3a68b6,_0x40ae0a['options']);return _0x33ad2f[_0x5d8a('0xa0')](_0x3a68b6);}})['then'](function(_0x326a41){if(_0x326a41){_0x28ba28=_0x326a41[_0x5d8a('0x46')];if(!_0x40ae0a[_0x5d8a('0x41')][_0x5d8a('0x68')](_0x5d8a('0x69'))){_0x3a68b6[_0x5d8a('0x24')]=qs[_0x5d8a('0x24')](_0x40ae0a[_0x5d8a('0x41')][_0x5d8a('0x24')]);_0x3a68b6[_0x5d8a('0x26')]=qs[_0x5d8a('0x26')](_0x40ae0a[_0x5d8a('0x41')][_0x5d8a('0x26')]);}return _0x33ad2f['getAgents'](_0x3a68b6);}})['then'](function(_0x1d758f){if(_0x1d758f){return _0x1d758f?{'count':_0x28ba28,'rows':_0x1d758f}:null;}})[_0x5d8a('0x2d')](respondWithResult(_0x5400c0,null))[_0x5d8a('0x54')](handleError(_0x5400c0,null));};exports[_0x5d8a('0xa1')]=function(_0x3064bc,_0x39e868,_0x59d541){var _0x34a46f={};var _0x55b1a3={};var _0x630a3d;var _0x5dfe77;return db[_0x5d8a('0x50')][_0x5d8a('0x6c')]({'where':{'id':_0x3064bc['params']['id']}})[_0x5d8a('0x2d')](handleEntityNotFound(_0x39e868,null))[_0x5d8a('0x2d')](function(_0x4bc16d){if(_0x4bc16d){_0x630a3d=_0x4bc16d;_0x55b1a3[_0x5d8a('0x40')]=_[_0x5d8a('0x42')](db[_0x5d8a('0x81')][_0x5d8a('0x60')]);_0x55b1a3[_0x5d8a('0x41')]=_[_0x5d8a('0x42')](_0x3064bc[_0x5d8a('0x41')]);_0x55b1a3[_0x5d8a('0x4a')]=_[_0x5d8a('0x44')](_0x55b1a3[_0x5d8a('0x40')],_0x55b1a3[_0x5d8a('0x41')]);_0x34a46f[_0x5d8a('0x43')]=_[_0x5d8a('0x44')](_0x55b1a3['model'],qs['fields'](_0x3064bc[_0x5d8a('0x41')][_0x5d8a('0x45')]));_0x34a46f['attributes']=_0x34a46f[_0x5d8a('0x43')][_0x5d8a('0x46')]?_0x34a46f[_0x5d8a('0x43')]:_0x55b1a3['model'];_0x34a46f[_0x5d8a('0x47')]=qs[_0x5d8a('0x48')](_0x3064bc[_0x5d8a('0x41')][_0x5d8a('0x48')]);_0x34a46f[_0x5d8a('0x49')]=qs[_0x5d8a('0x4a')](_[_0x5d8a('0x4b')](_0x3064bc[_0x5d8a('0x41')],_0x55b1a3['filters']));if(_0x3064bc[_0x5d8a('0x41')][_0x5d8a('0x4c')]){_0x34a46f[_0x5d8a('0x49')]=_[_0x5d8a('0x4d')](_0x34a46f[_0x5d8a('0x49')],{'$or':_['map'](_0x34a46f[_0x5d8a('0x43')],function(_0x4e9000){var _0x3de604={};_0x3de604[_0x4e9000]={'$like':'%'+_0x3064bc[_0x5d8a('0x41')]['filter']+'%'};return _0x3de604;})});}_0x34a46f=_[_0x5d8a('0x4d')]({},_0x34a46f,_0x3064bc[_0x5d8a('0x4f')]);return _0x630a3d['getMembers'](_0x34a46f);}})[_0x5d8a('0x2d')](function(_0x216875){if(_0x216875){_0x5dfe77=_0x216875['length'];if(!_0x3064bc['query']['hasOwnProperty'](_0x5d8a('0x69'))){_0x34a46f[_0x5d8a('0x24')]=qs['limit'](_0x3064bc['query'][_0x5d8a('0x24')]);_0x34a46f[_0x5d8a('0x26')]=qs['offset'](_0x3064bc[_0x5d8a('0x41')]['offset']);}return _0x630a3d[_0x5d8a('0xa1')](_0x34a46f);}})[_0x5d8a('0x2d')](function(_0x23145e){return _0x23145e?{'count':_0x5dfe77,'rows':_0x23145e}:null;})[_0x5d8a('0x2d')](respondWithResult(_0x39e868,null))[_0x5d8a('0x54')](handleError(_0x39e868,null));};exports[_0x5d8a('0xa2')]=function(_0x27b230,_0x3d032b,_0x423077){var _0x19e1d2={};var _0x2109d0={};var _0x3599b2;var _0x3774a8;return db[_0x5d8a('0x50')][_0x5d8a('0x6c')]({'where':{'id':_0x27b230[_0x5d8a('0x56')]['id']}})[_0x5d8a('0x2d')](handleEntityNotFound(_0x3d032b,null))[_0x5d8a('0x2d')](function(_0x2cfb2b){if(_0x2cfb2b){_0x3599b2=_0x2cfb2b;_0x2109d0[_0x5d8a('0x40')]=_[_0x5d8a('0x42')](db[_0x5d8a('0xa3')][_0x5d8a('0x60')]);_0x2109d0[_0x5d8a('0x41')]=_[_0x5d8a('0x42')](_0x27b230[_0x5d8a('0x41')]);_0x2109d0[_0x5d8a('0x4a')]=_[_0x5d8a('0x44')](_0x2109d0[_0x5d8a('0x40')],_0x2109d0[_0x5d8a('0x41')]);_0x19e1d2['attributes']=_['intersection'](_0x2109d0[_0x5d8a('0x40')],qs['fields'](_0x27b230['query']['fields']));_0x19e1d2[_0x5d8a('0x43')]=_0x19e1d2[_0x5d8a('0x43')][_0x5d8a('0x46')]?_0x19e1d2['attributes']:_0x2109d0[_0x5d8a('0x40')];_0x19e1d2['order']=qs[_0x5d8a('0x48')](_0x27b230[_0x5d8a('0x41')]['sort']);_0x19e1d2[_0x5d8a('0x49')]=qs[_0x5d8a('0x4a')](_[_0x5d8a('0x4b')](_0x27b230['query'],_0x2109d0['filters']));if(_0x27b230[_0x5d8a('0x41')][_0x5d8a('0x4c')]){_0x19e1d2[_0x5d8a('0x49')]=_[_0x5d8a('0x4d')](_0x19e1d2[_0x5d8a('0x49')],{'$or':_[_0x5d8a('0x32')](_0x19e1d2['attributes'],function(_0x4a9b4e){var _0x35d5f9={};_0x35d5f9[_0x4a9b4e]={'$like':'%'+_0x27b230[_0x5d8a('0x41')][_0x5d8a('0x4c')]+'%'};return _0x35d5f9;})});}_0x19e1d2=_['merge']({},_0x19e1d2,_0x27b230[_0x5d8a('0x4f')]);return _0x3599b2[_0x5d8a('0xa2')](_0x19e1d2);}})[_0x5d8a('0x2d')](function(_0xeaada6){if(_0xeaada6){_0x3774a8=_0xeaada6[_0x5d8a('0x46')];if(!_0x27b230[_0x5d8a('0x41')]['hasOwnProperty'](_0x5d8a('0x69'))){_0x19e1d2[_0x5d8a('0x24')]=qs['limit'](_0x27b230[_0x5d8a('0x41')][_0x5d8a('0x24')]);_0x19e1d2['offset']=qs['offset'](_0x27b230[_0x5d8a('0x41')][_0x5d8a('0x26')]);}return _0x3599b2[_0x5d8a('0xa2')](_0x19e1d2);}})[_0x5d8a('0x2d')](function(_0x18df86){if(_0x18df86){return _0x18df86?{'count':_0x3774a8,'rows':_0x18df86}:null;}})[_0x5d8a('0x2d')](respondWithResult(_0x3d032b,null))['catch'](handleError(_0x3d032b,null));};exports[_0x5d8a('0xa4')]=function(_0x4e338e,_0x4f8f06,_0x2194b5){var _0x1956cb=moment()[_0x5d8a('0x83')]('YYYY-MM-DD\x20HH:mm:ss');var _0x3ba090,_0x566a6e;return db['VoiceQueue'][_0x5d8a('0x35')]({'where':{'id':_0x4e338e['params']['id']}})[_0x5d8a('0x2d')](handleEntityNotFound(_0x4f8f06,null))['then'](function(_0x52f332){if(_0x52f332){_0x566a6e=_0x52f332;return _0x52f332[_0x5d8a('0xa4')](_0x4e338e['body'][_0x5d8a('0x88')],_[_0x5d8a('0x63')](_0x4e338e[_0x5d8a('0x57')],[_0x5d8a('0x88'),'id'])||{});}return null;})[_0x5d8a('0x9c')](function(_0x32f3d3){var _0x33ad5b;_0x3ba090=_0x32f3d3||[];var _0x103a79=[];if(_0x32f3d3){for(var _0x376d75=0x0;_0x376d75<_0x32f3d3['length'];_0x376d75+=0x1){var _0x1aa657=_0x32f3d3[_0x376d75][_0x5d8a('0x5a')]({'plain':!![]});_0x566a6e[_0x5d8a('0xa5')]=_0x4e338e[_0x5d8a('0x57')]['dialCheckDuplicateType']?_0x4e338e[_0x5d8a('0x57')][_0x5d8a('0xa5')]:_0x566a6e[_0x5d8a('0xa5')];switch(_0x566a6e[_0x5d8a('0xa5')]){case'always':_0x33ad5b=squel[_0x5d8a('0xa6')]()[_0x5d8a('0xa7')](_0x5d8a('0xa8'))[_0x5d8a('0xa9')](['phone','scheduledAt',_0x5d8a('0xaa'),_0x5d8a('0xab'),_0x5d8a('0x70'),_0x5d8a('0x61'),_0x5d8a('0x62')],squel[_0x5d8a('0x89')]()['field'](_0x5d8a('0xac'),_0x5d8a('0xac'))[_0x5d8a('0xad')]('\x27'+_0x1956cb+'\x27',_0x5d8a('0xae'))[_0x5d8a('0xad')]('id',_0x5d8a('0xaa'))[_0x5d8a('0xad')](_0x1aa657[_0x5d8a('0xaf')][_0x5d8a('0xb0')](),_0x5d8a('0xab'))[_0x5d8a('0xad')](_0x4e338e[_0x5d8a('0x56')]['id']['toString'](),_0x5d8a('0x70'))['field']('\x27'+_0x1956cb+'\x27',_0x5d8a('0x61'))[_0x5d8a('0xad')]('\x27'+_0x1956cb+'\x27',_0x5d8a('0x62'))['from']('cm_contacts')[_0x5d8a('0x49')](_0x5d8a('0xb1'))[_0x5d8a('0x49')](_0x5d8a('0xb2'),_0x1aa657[_0x5d8a('0xaf')][_0x5d8a('0xb0')]())[_0x5d8a('0x49')](_0x5d8a('0xb3'))[_0x5d8a('0x49')](_0x5d8a('0xb4'),squel['select']()[_0x5d8a('0xad')](_0x5d8a('0xb5'))[_0x5d8a('0x8a')](_0x5d8a('0xb6'))[_0x5d8a('0x49')](_0x5d8a('0x8e'),_0x4e338e[_0x5d8a('0x56')]['id']['toString']()))[_0x5d8a('0x49')]('phone\x20NOT\x20IN\x20(?)',squel[_0x5d8a('0x89')]()[_0x5d8a('0xad')](_0x5d8a('0xb7'))[_0x5d8a('0x8a')](_0x5d8a('0xa8'))['where'](_0x5d8a('0x8e'),_0x4e338e[_0x5d8a('0x56')]['id']['toString']())))[_0x5d8a('0xb0')]();break;case _0x5d8a('0xb8'):_0x33ad5b=squel[_0x5d8a('0xa6')]()['into'](_0x5d8a('0xa8'))[_0x5d8a('0xa9')]([_0x5d8a('0xac'),_0x5d8a('0xae'),_0x5d8a('0xaa'),_0x5d8a('0xab'),_0x5d8a('0x70'),_0x5d8a('0x61'),'updatedAt'],squel[_0x5d8a('0x89')]()['field'](_0x5d8a('0xac'),'phone')['field']('\x27'+_0x1956cb+'\x27',_0x5d8a('0xae'))['field']('id',_0x5d8a('0xaa'))[_0x5d8a('0xad')](_0x1aa657[_0x5d8a('0xaf')][_0x5d8a('0xb0')](),_0x5d8a('0xab'))[_0x5d8a('0xad')](_0x4e338e[_0x5d8a('0x56')]['id']['toString'](),_0x5d8a('0x70'))[_0x5d8a('0xad')]('\x27'+_0x1956cb+'\x27',_0x5d8a('0x61'))[_0x5d8a('0xad')]('\x27'+_0x1956cb+'\x27',_0x5d8a('0x62'))['from']('cm_contacts')[_0x5d8a('0x49')]('deletedAt\x20IS\x20NULL')[_0x5d8a('0x49')](_0x5d8a('0xb2'),_0x1aa657[_0x5d8a('0xaf')]['toString']())[_0x5d8a('0x49')](_0x5d8a('0xb3'))[_0x5d8a('0x49')](_0x5d8a('0xb4'),squel[_0x5d8a('0x89')]()[_0x5d8a('0xad')](_0x5d8a('0xb7'))['from']('cm_hopper')[_0x5d8a('0x49')]('VoiceQueueId\x20=\x20?',_0x4e338e['params']['id'][_0x5d8a('0xb0')]())))[_0x5d8a('0xb0')]();break;default:_0x33ad5b=squel[_0x5d8a('0xa6')]()[_0x5d8a('0xa7')](_0x5d8a('0xa8'))['fromQuery']([_0x5d8a('0xac'),_0x5d8a('0xae'),_0x5d8a('0xaa'),_0x5d8a('0xab'),_0x5d8a('0x70'),_0x5d8a('0x61'),'updatedAt'],squel[_0x5d8a('0x89')]()[_0x5d8a('0xad')](_0x5d8a('0xac'),_0x5d8a('0xac'))[_0x5d8a('0xad')]('\x27'+_0x1956cb+'\x27','scheduledAt')[_0x5d8a('0xad')]('id','ContactId')[_0x5d8a('0xad')](_0x1aa657['CmListId'][_0x5d8a('0xb0')](),'ListId')[_0x5d8a('0xad')](_0x4e338e[_0x5d8a('0x56')]['id'][_0x5d8a('0xb0')](),_0x5d8a('0x70'))[_0x5d8a('0xad')]('\x27'+_0x1956cb+'\x27',_0x5d8a('0x61'))[_0x5d8a('0xad')]('\x27'+_0x1956cb+'\x27',_0x5d8a('0x62'))[_0x5d8a('0x8a')](_0x5d8a('0xb9'))[_0x5d8a('0x49')](_0x5d8a('0xb1'))[_0x5d8a('0x49')]('ListId\x20=\x20?',_0x1aa657[_0x5d8a('0xaf')][_0x5d8a('0xb0')]())[_0x5d8a('0x49')]('phone\x20IS\x20NOT\x20NULL'))[_0x5d8a('0xb0')]();}_0x103a79['push'](db['sequelize']['query'](_0x33ad5b));}return BPromise[_0x5d8a('0x93')](_0x103a79);}})[_0x5d8a('0x2d')](function(){var _0x59c573=[];var _0x411d84=squel['insert']()[_0x5d8a('0xa7')]('cm_hopper_additional_phones')[_0x5d8a('0xa9')]([_0x5d8a('0xba'),_0x5d8a('0xac'),_0x5d8a('0xbb'),_0x5d8a('0x61'),_0x5d8a('0x62')],squel[_0x5d8a('0x89')]()[_0x5d8a('0xad')](_0x5d8a('0xbc'))['field']('ci.item')[_0x5d8a('0xad')](_0x5d8a('0xbd'))['field']('\x27'+_0x1956cb+'\x27','createdAt')['field']('\x27'+_0x1956cb+'\x27',_0x5d8a('0x62'))[_0x5d8a('0x8a')](_0x5d8a('0xbe'),'ci')[_0x5d8a('0xbf')]('cm_hopper','h',_0x5d8a('0xc0'))['where'](_0x5d8a('0xc1'),_0x1956cb)[_0x5d8a('0x49')](_0x5d8a('0xc2'),_0x5d8a('0xc3')))[_0x5d8a('0xb0')]();_0x59c573[_0x5d8a('0x9e')](db[_0x5d8a('0x7b')][_0x5d8a('0x41')](_0x411d84));return BPromise[_0x5d8a('0x93')](_0x59c573);})['then'](function(){return _0x3ba090;})[_0x5d8a('0x2d')](respondWithResult(_0x4f8f06,null))[_0x5d8a('0x54')](handleError(_0x4f8f06,null));};exports[_0x5d8a('0xc4')]=function(_0x53dbce,_0x522760,_0x50e2c6){return db[_0x5d8a('0x50')][_0x5d8a('0x35')]({'where':{'id':_0x53dbce[_0x5d8a('0x56')]['id']}})['then'](handleEntityNotFound(_0x522760,null))[_0x5d8a('0x2d')](function(_0x18b230){if(_0x18b230){return _0x18b230[_0x5d8a('0xc4')](_0x53dbce['query'][_0x5d8a('0x88')]);}})[_0x5d8a('0x2d')](function(_0x1420c2){if(_0x1420c2){return db[_0x5d8a('0x67')][_0x5d8a('0x2c')]({'where':{'ListId':_0x53dbce['query'][_0x5d8a('0x88')],'VoiceQueueId':_0x53dbce[_0x5d8a('0x56')]['id']}})[_0x5d8a('0x2d')](function(){return _0x1420c2;});}})[_0x5d8a('0x2d')](respondWithStatusCode(_0x522760,null))[_0x5d8a('0x54')](handleError(_0x522760,null));};exports[_0x5d8a('0xc5')]=function(_0x1705f1,_0x5ccb66,_0x1cb9a1){var _0x55d991={};var _0x1b698d={};var _0x211b3f;var _0x43c16;return db[_0x5d8a('0x50')]['findOne']({'where':{'id':_0x1705f1[_0x5d8a('0x56')]['id']}})['then'](handleEntityNotFound(_0x5ccb66,null))[_0x5d8a('0x2d')](function(_0x5403a8){if(_0x5403a8){_0x211b3f=_0x5403a8;_0x1b698d[_0x5d8a('0x40')]=_[_0x5d8a('0x42')](db[_0x5d8a('0xa3')]['rawAttributes']);_0x1b698d[_0x5d8a('0x41')]=_[_0x5d8a('0x42')](_0x1705f1[_0x5d8a('0x41')]);_0x1b698d[_0x5d8a('0x4a')]=_[_0x5d8a('0x44')](_0x1b698d['model'],_0x1b698d[_0x5d8a('0x41')]);_0x55d991[_0x5d8a('0x43')]=_[_0x5d8a('0x44')](_0x1b698d[_0x5d8a('0x40')],qs['fields'](_0x1705f1[_0x5d8a('0x41')][_0x5d8a('0x45')]));_0x55d991[_0x5d8a('0x43')]=_0x55d991[_0x5d8a('0x43')][_0x5d8a('0x46')]?_0x55d991[_0x5d8a('0x43')]:_0x1b698d[_0x5d8a('0x40')];_0x55d991[_0x5d8a('0x47')]=qs[_0x5d8a('0x48')](_0x1705f1[_0x5d8a('0x41')]['sort']);_0x55d991[_0x5d8a('0x49')]=qs[_0x5d8a('0x4a')](_[_0x5d8a('0x4b')](_0x1705f1['query'],_0x1b698d[_0x5d8a('0x4a')]));if(_0x1705f1[_0x5d8a('0x41')][_0x5d8a('0x4c')]){_0x55d991[_0x5d8a('0x49')]=_[_0x5d8a('0x4d')](_0x55d991[_0x5d8a('0x49')],{'$or':_['map'](_0x55d991[_0x5d8a('0x43')],function(_0x4e434e){var _0x10fe90={};_0x10fe90[_0x4e434e]={'$like':'%'+_0x1705f1[_0x5d8a('0x41')][_0x5d8a('0x4c')]+'%'};return _0x10fe90;})});}_0x55d991=_[_0x5d8a('0x4d')]({},_0x55d991,_0x1705f1['options']);return _0x211b3f[_0x5d8a('0xc5')](_0x55d991);}})[_0x5d8a('0x2d')](function(_0x3ef5c6){if(_0x3ef5c6){_0x43c16=_0x3ef5c6[_0x5d8a('0x46')];if(!_0x1705f1[_0x5d8a('0x41')][_0x5d8a('0x68')](_0x5d8a('0x69'))){_0x55d991[_0x5d8a('0x24')]=qs['limit'](_0x1705f1[_0x5d8a('0x41')][_0x5d8a('0x24')]);_0x55d991['offset']=qs['offset'](_0x1705f1[_0x5d8a('0x41')][_0x5d8a('0x26')]);}return _0x211b3f[_0x5d8a('0xc5')](_0x55d991);}})[_0x5d8a('0x2d')](function(_0x52dc1f){if(_0x52dc1f){return _0x52dc1f?{'count':_0x43c16,'rows':_0x52dc1f}:null;}})[_0x5d8a('0x2d')](respondWithResult(_0x5ccb66,null))['catch'](handleError(_0x5ccb66,null));};exports[_0x5d8a('0xc6')]=function(_0x14d055,_0x59bda3,_0x5d950a){var _0xed4762,_0x3fc2ea;return db[_0x5d8a('0x50')][_0x5d8a('0x35')]({'where':{'id':_0x14d055[_0x5d8a('0x56')]['id']}})[_0x5d8a('0x2d')](handleEntityNotFound(_0x59bda3,null))[_0x5d8a('0x2d')](function(_0x80651c){if(_0x80651c){_0x3fc2ea=_0x80651c;return _0x80651c[_0x5d8a('0xc6')](_0x14d055[_0x5d8a('0x57')][_0x5d8a('0x88')],_[_0x5d8a('0x63')](_0x14d055[_0x5d8a('0x57')],[_0x5d8a('0x88'),'id'])||{});}return null;})[_0x5d8a('0x9c')](function(_0x19a601){var _0x40c101;_0xed4762=_0x19a601||[];var _0xaf6051=[];if(_0x19a601){for(var _0x117ce3=0x0;_0x117ce3<_0x19a601[_0x5d8a('0x46')];_0x117ce3+=0x1){var _0x424570=_0x19a601[_0x117ce3]['get']({'plain':!![]});_0x40c101=squel[_0x5d8a('0xa6')]()['into']('cm_hopper_black')[_0x5d8a('0xa9')]([_0x5d8a('0xac'),_0x5d8a('0xaa'),'ListId',_0x5d8a('0x70'),'createdAt',_0x5d8a('0x62')],squel[_0x5d8a('0x89')]()[_0x5d8a('0xad')](_0x5d8a('0xac'),_0x5d8a('0xac'))[_0x5d8a('0xad')]('id',_0x5d8a('0xaa'))['field'](_0x424570[_0x5d8a('0xaf')]['toString'](),_0x5d8a('0xab'))['field'](_0x14d055[_0x5d8a('0x56')]['id']['toString'](),_0x5d8a('0x70'))[_0x5d8a('0xad')]('NOW()',_0x5d8a('0x61'))[_0x5d8a('0xad')](_0x5d8a('0xc7'),'updatedAt')[_0x5d8a('0x8a')](_0x5d8a('0xb9'))[_0x5d8a('0x49')](_0x5d8a('0xb1'))['where'](_0x5d8a('0xb2'),_0x424570[_0x5d8a('0xaf')][_0x5d8a('0xb0')]())['where']('phone\x20IS\x20NOT\x20NULL'))['toString']();_0xaf6051[_0x5d8a('0x9e')](db['sequelize']['query'](_0x40c101));}return BPromise[_0x5d8a('0x93')](_0xaf6051);}})[_0x5d8a('0x2d')](function(){return _0xed4762;})['then'](respondWithResult(_0x59bda3,null))[_0x5d8a('0x54')](handleError(_0x59bda3,null));};exports[_0x5d8a('0xc8')]=function(_0x162ad6,_0x19e4ef,_0x38df19){return db[_0x5d8a('0x50')]['find']({'where':{'id':_0x162ad6[_0x5d8a('0x56')]['id']}})[_0x5d8a('0x2d')](handleEntityNotFound(_0x19e4ef,null))[_0x5d8a('0x2d')](function(_0x398ebd){if(_0x398ebd){return _0x398ebd[_0x5d8a('0xc8')](_0x162ad6[_0x5d8a('0x41')]['ids']);}})[_0x5d8a('0x2d')](function(_0x2b84f8){if(_0x2b84f8){return db['CmHopperBlack'][_0x5d8a('0x2c')]({'where':{'ListId':_0x162ad6[_0x5d8a('0x41')][_0x5d8a('0x88')],'VoiceQueueId':_0x162ad6[_0x5d8a('0x56')]['id']}})[_0x5d8a('0x2d')](function(){return _0x2b84f8;});}})['then'](respondWithStatusCode(_0x19e4ef,null))['catch'](handleError(_0x19e4ef,null));}; \ No newline at end of file +var _0xad68=['ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','union','compact','sequelize','isEmpty','userVoiceQueue:remove','addAgents','ids','spread','all','removeAgents','isArray','getAgents','getMembers','getLists','CmList','YYYY-MM-DD\x20HH:mm:ss','addLists','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','phone','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','ListId','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','CmHopperId','OrderBy','ci.item','cm_contact_has_items','join','h.ContactId=ci.CmContactId','h.scheduledat=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','./voiceQueue.socket','status','end','json','offset','undefined','limit','set','Content-Range','reject','save','update','destroy','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','includes','type','name','sendStatus','stack','rawAttributes','fieldName','query','filters','intersection','attributes','model','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','VoiceQueue','count','includeAll','include','rows','show','params','keys','fields','length','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','updatedAt','omit','find','UserProfileResource','getHoppers','findOne','CmHopper','VoiceQueueId','findAll','getHopperHistories','CmHopperHistory','order','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','online','voicePause','flatMap','forEach','penalty','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','interface','format','SIP/%s','emit','removeTeams','select','field','tq.TeamId','from','user_has_teams','Agents'];(function(_0x4e3b63,_0x5dc407){var _0x25f3d5=function(_0x3cc624){while(--_0x3cc624){_0x4e3b63['push'](_0x4e3b63['shift']());}};_0x25f3d5(++_0x5dc407);}(_0xad68,0x100));var _0x8ad6=function(_0x53c8c7,_0x348f83){_0x53c8c7=_0x53c8c7-0x0;var _0x4f9626=_0xad68[_0x53c8c7];return _0x4f9626;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8ad6('0x0'));var jsonpatch=require(_0x8ad6('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8ad6('0x2'));var Mustache=require(_0x8ad6('0x3'));var util=require(_0x8ad6('0x4'));var path=require(_0x8ad6('0x5'));var sox=require(_0x8ad6('0x6'));var csv=require(_0x8ad6('0x7'));var ejs=require(_0x8ad6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8ad6('0x9'));var squel=require(_0x8ad6('0xa'));var crypto=require(_0x8ad6('0xb'));var jsforce=require(_0x8ad6('0xc'));var deskjs=require(_0x8ad6('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8ad6('0xe'));var Redis=require(_0x8ad6('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8ad6('0x10'));var hardwareService=require(_0x8ad6('0x11'));var logger=require(_0x8ad6('0x12'))(_0x8ad6('0x13'));var utils=require(_0x8ad6('0x14'));var config=require(_0x8ad6('0x15'));var licenseUtil=require(_0x8ad6('0x16'));var db=require(_0x8ad6('0x17'))['db'];config['redis']=_[_0x8ad6('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8ad6('0x19'))(new Redis(config['redis']));require(_0x8ad6('0x1a'))['register'](socket);function respondWithStatusCode(_0x307afc,_0xabb88e){_0xabb88e=_0xabb88e||0xcc;return function(_0xc0ca7f){if(_0xc0ca7f){return _0x307afc['sendStatus'](_0xabb88e);}return _0x307afc[_0x8ad6('0x1b')](_0xabb88e)[_0x8ad6('0x1c')]();};}function respondWithResult(_0x37a7f0,_0x3c6116){_0x3c6116=_0x3c6116||0xc8;return function(_0x10a21c){if(_0x10a21c){return _0x37a7f0[_0x8ad6('0x1b')](_0x3c6116)[_0x8ad6('0x1d')](_0x10a21c);}};}function respondWithFilteredResult(_0x2e9a2e,_0x513b8e){return function(_0x8ca3e3){if(_0x8ca3e3){var _0x3e5f02=typeof _0x513b8e[_0x8ad6('0x1e')]===_0x8ad6('0x1f')&&typeof _0x513b8e[_0x8ad6('0x20')]===_0x8ad6('0x1f');var _0x144b50=_0x8ca3e3['count'];var _0x37ffb3=_0x3e5f02?0x0:_0x513b8e[_0x8ad6('0x1e')];var _0xd62878=_0x3e5f02?_0x8ca3e3['count']:_0x513b8e[_0x8ad6('0x1e')]+_0x513b8e[_0x8ad6('0x20')];var _0x3074e7;if(_0xd62878>=_0x144b50){_0xd62878=_0x144b50;_0x3074e7=0xc8;}else{_0x3074e7=0xce;}_0x2e9a2e[_0x8ad6('0x1b')](_0x3074e7);return _0x2e9a2e[_0x8ad6('0x21')](_0x8ad6('0x22'),_0x37ffb3+'-'+_0xd62878+'/'+_0x144b50)[_0x8ad6('0x1d')](_0x8ca3e3);}return null;};}function patchUpdates(_0x5edc1){return function(_0x2fd6ab){try{jsonpatch['apply'](_0x2fd6ab,_0x5edc1,!![]);}catch(_0x47af23){return BPromise[_0x8ad6('0x23')](_0x47af23);}return _0x2fd6ab[_0x8ad6('0x24')]();};}function saveUpdates(_0x558430,_0xe0c92c){return function(_0xfa1947){if(_0xfa1947){return _0xfa1947[_0x8ad6('0x25')](_0x558430)['then'](function(_0x54adf7){return _0x54adf7;});}return null;};}function removeEntity(_0x4795d8,_0x850dc6){return function(_0x39228c){if(_0x39228c){return _0x39228c[_0x8ad6('0x26')]()[_0x8ad6('0x27')](function(){var _0x1c79c9=_0x39228c[_0x8ad6('0x28')]({'plain':!![]});var _0xa20d8c=[{'name':_0x8ad6('0x29'),'value':_0x8ad6('0x2a'),'ignore':![]},{'name':_0x8ad6('0x2b'),'value':_0x8ad6('0x2c'),'ignore':![]}];var _0xe1e026=_(_0xa20d8c)[_0x8ad6('0x2d')](_0x8ad6('0x2e'))[_0x8ad6('0x2f')](_0x8ad6('0x30'))[_0x8ad6('0x30')]();if(_[_0x8ad6('0x31')](_0xe1e026,_0x1c79c9[_0x8ad6('0x32')])){return;}var _0x358948=_['find'](_0xa20d8c,[_0x8ad6('0x30'),_0x1c79c9[_0x8ad6('0x32')]])[_0x8ad6('0x33')];return db['UserProfileResource'][_0x8ad6('0x26')]({'where':{'type':_0x358948,'resourceId':_0x1c79c9['id']}})['then'](function(){return _0x39228c;});})['then'](function(){_0x4795d8['status'](0xcc)[_0x8ad6('0x1c')]();});}};}function handleEntityNotFound(_0x40ed1e,_0x4e02a3){return function(_0x1b8508){if(!_0x1b8508){_0x40ed1e[_0x8ad6('0x34')](0x194);}return _0x1b8508;};}function handleError(_0x434ba5,_0x168eb3){_0x168eb3=_0x168eb3||0x1f4;return function(_0x32f541){logger['error'](_0x32f541[_0x8ad6('0x35')]);if(_0x32f541[_0x8ad6('0x33')]){delete _0x32f541['name'];}_0x434ba5[_0x8ad6('0x1b')](_0x168eb3)['send'](_0x32f541);};}exports['index']=function(_0x250ec4,_0x450fd8){var _0x5d2665={},_0x325f23={},_0x272f41={'count':0x0,'rows':[]};var _0x370a78=_[_0x8ad6('0x2f')](db['VoiceQueue'][_0x8ad6('0x36')],function(_0x28440e){return{'name':_0x28440e[_0x8ad6('0x37')],'type':_0x28440e[_0x8ad6('0x32')]['key']};});_0x325f23['model']=_[_0x8ad6('0x2f')](_0x370a78,_0x8ad6('0x33'));_0x325f23[_0x8ad6('0x38')]=_['keys'](_0x250ec4['query']);_0x325f23[_0x8ad6('0x39')]=_[_0x8ad6('0x3a')](_0x325f23['model'],_0x325f23[_0x8ad6('0x38')]);_0x5d2665[_0x8ad6('0x3b')]=_['intersection'](_0x325f23[_0x8ad6('0x3c')],qs['fields'](_0x250ec4[_0x8ad6('0x38')]['fields']));_0x5d2665[_0x8ad6('0x3b')]=_0x5d2665[_0x8ad6('0x3b')]['length']?_0x5d2665[_0x8ad6('0x3b')]:_0x325f23['model'];if(!_0x250ec4['query'][_0x8ad6('0x3d')](_0x8ad6('0x3e'))){_0x5d2665[_0x8ad6('0x20')]=qs[_0x8ad6('0x20')](_0x250ec4[_0x8ad6('0x38')][_0x8ad6('0x20')]);_0x5d2665[_0x8ad6('0x1e')]=qs[_0x8ad6('0x1e')](_0x250ec4['query'][_0x8ad6('0x1e')]);}_0x5d2665['order']=qs[_0x8ad6('0x3f')](_0x250ec4['query'][_0x8ad6('0x3f')]);_0x5d2665[_0x8ad6('0x40')]=qs[_0x8ad6('0x39')](_[_0x8ad6('0x41')](_0x250ec4['query'],_0x325f23[_0x8ad6('0x39')]),_0x370a78);if(_0x250ec4[_0x8ad6('0x38')][_0x8ad6('0x2d')]){_0x5d2665[_0x8ad6('0x40')]=_[_0x8ad6('0x42')](_0x5d2665['where'],{'$or':_['map'](_0x370a78,function(_0x1e429d){if(_0x1e429d[_0x8ad6('0x32')]!==_0x8ad6('0x43')){var _0x43f60d={};_0x43f60d[_0x1e429d[_0x8ad6('0x33')]]={'$like':'%'+_0x250ec4[_0x8ad6('0x38')][_0x8ad6('0x2d')]+'%'};return _0x43f60d;}})});}_0x5d2665=_[_0x8ad6('0x42')]({},_0x5d2665,_0x250ec4[_0x8ad6('0x44')]);var _0x3f654d={'where':_0x5d2665['where']};return db[_0x8ad6('0x45')][_0x8ad6('0x46')](_0x3f654d)[_0x8ad6('0x27')](function(_0x1dea40){_0x272f41[_0x8ad6('0x46')]=_0x1dea40;if(_0x250ec4[_0x8ad6('0x38')][_0x8ad6('0x47')]){_0x5d2665[_0x8ad6('0x48')]=[{'all':!![]}];}return db[_0x8ad6('0x45')]['findAll'](_0x5d2665);})[_0x8ad6('0x27')](function(_0x2d62e6){_0x272f41[_0x8ad6('0x49')]=_0x2d62e6;return _0x272f41;})['then'](respondWithFilteredResult(_0x450fd8,_0x5d2665))['catch'](handleError(_0x450fd8,null));};exports[_0x8ad6('0x4a')]=function(_0x1bf873,_0x133f99){var _0x3af5b5={'raw':![],'where':{'id':_0x1bf873[_0x8ad6('0x4b')]['id']}},_0x7c38a1={};_0x7c38a1[_0x8ad6('0x3c')]=_['keys'](db[_0x8ad6('0x45')][_0x8ad6('0x36')]);_0x7c38a1[_0x8ad6('0x38')]=_[_0x8ad6('0x4c')](_0x1bf873[_0x8ad6('0x38')]);_0x7c38a1[_0x8ad6('0x39')]=_[_0x8ad6('0x3a')](_0x7c38a1[_0x8ad6('0x3c')],_0x7c38a1['query']);_0x3af5b5['attributes']=_[_0x8ad6('0x3a')](_0x7c38a1[_0x8ad6('0x3c')],qs[_0x8ad6('0x4d')](_0x1bf873['query']['fields']));_0x3af5b5['attributes']=_0x3af5b5['attributes'][_0x8ad6('0x4e')]?_0x3af5b5['attributes']:_0x7c38a1[_0x8ad6('0x3c')];if(_0x1bf873[_0x8ad6('0x38')]['includeAll']){_0x3af5b5[_0x8ad6('0x48')]=[{'all':!![]}];}_0x3af5b5=_[_0x8ad6('0x42')]({},_0x3af5b5,_0x1bf873[_0x8ad6('0x44')]);return db[_0x8ad6('0x45')]['find'](_0x3af5b5)[_0x8ad6('0x27')](handleEntityNotFound(_0x133f99,null))['then'](respondWithResult(_0x133f99,null))[_0x8ad6('0x4f')](handleError(_0x133f99,null));};exports[_0x8ad6('0x50')]=function(_0x3a678e,_0x2c6bd9){return db[_0x8ad6('0x45')][_0x8ad6('0x50')](_0x3a678e[_0x8ad6('0x51')],{})['then'](function(_0x54404b){var _0x122293=_0x3a678e[_0x8ad6('0x52')][_0x8ad6('0x28')]({'plain':!![]});if(!_0x122293)throw new Error(_0x8ad6('0x53'));if(_0x122293[_0x8ad6('0x54')]==='user'){var _0x82e953=_0x54404b[_0x8ad6('0x28')]({'plain':!![]});var _0x51c0d8=[{'name':_0x8ad6('0x29'),'value':'inbound'},{'name':_0x8ad6('0x2b'),'value':_0x8ad6('0x2c')}];var _0x481c5a=_['find'](_0x51c0d8,[_0x8ad6('0x30'),_0x82e953['type']])['name'];return db[_0x8ad6('0x55')]['find']({'where':{'name':_0x481c5a,'userProfileId':_0x122293[_0x8ad6('0x56')]},'raw':!![]})['then'](function(_0x61f655){if(_0x61f655&&_0x61f655[_0x8ad6('0x57')]===0x0){return db['UserProfileResource'][_0x8ad6('0x50')]({'name':_0x82e953[_0x8ad6('0x33')],'resourceId':_0x82e953['id'],'type':_0x61f655[_0x8ad6('0x33')],'sectionId':_0x61f655['id']},{})[_0x8ad6('0x27')](function(){return _0x54404b;});}else{return _0x54404b;}})['catch'](function(_0x29cff7){logger[_0x8ad6('0x58')](_0x8ad6('0x59'),_0x29cff7);throw _0x29cff7;});}return _0x54404b;})[_0x8ad6('0x27')](respondWithResult(_0x2c6bd9,0xc9))[_0x8ad6('0x4f')](handleError(_0x2c6bd9,null));};exports[_0x8ad6('0x5a')]=function(_0x35e8ad,_0xbc6bab){var _0x2875d1={'where':{'id':_0x35e8ad[_0x8ad6('0x4b')]['id']}},_0x12b548={};_0x12b548[_0x8ad6('0x3c')]=_[_0x8ad6('0x4c')](db[_0x8ad6('0x45')][_0x8ad6('0x36')]);_0x2875d1['attributes']=_[_0x8ad6('0x3a')](_0x12b548[_0x8ad6('0x3c')],qs[_0x8ad6('0x4d')](_0x35e8ad['query'][_0x8ad6('0x4d')]));_0x2875d1['attributes']=_0x2875d1[_0x8ad6('0x3b')][_0x8ad6('0x4e')]?_0x2875d1[_0x8ad6('0x3b')]:_0x12b548[_0x8ad6('0x3c')];if(_0x35e8ad['query'][_0x8ad6('0x47')]){_0x2875d1['include']=[{'all':!![]}];}_0x2875d1=_[_0x8ad6('0x42')]({},_0x2875d1,_0x35e8ad[_0x8ad6('0x44')]);return db[_0x8ad6('0x45')]['find'](_0x2875d1)[_0x8ad6('0x27')](handleEntityNotFound(_0xbc6bab,null))[_0x8ad6('0x27')](function(_0x4d454c){if(_0x4d454c){var _0x4a0101=_0x4d454c[_0x8ad6('0x28')]({'plain':!![]});_0x4a0101=qs['omit'](_0x4a0101,['id','createdAt',_0x8ad6('0x5b')]);_0x35e8ad[_0x8ad6('0x51')]=_[_0x8ad6('0x5c')](_0x35e8ad[_0x8ad6('0x51')],['id','createdAt',_0x8ad6('0x5b')]);return db['VoiceQueue']['create'](_['merge'](_0x4a0101,_0x35e8ad['body']),{'include':_0x35e8ad[_0x8ad6('0x38')][_0x8ad6('0x47')]?[{'all':!![]}]:undefined})[_0x8ad6('0x27')](function(_0x5a0d8c){var _0x2ed664=_0x35e8ad['user'][_0x8ad6('0x28')]({'plain':!![]});if(!_0x2ed664)throw new Error(_0x8ad6('0x53'));if(_0x2ed664[_0x8ad6('0x54')]===_0x8ad6('0x52')){var _0x3787e8=_0x5a0d8c[_0x8ad6('0x28')]({'plain':!![]});var _0x3e949f=[{'name':_0x8ad6('0x29'),'value':_0x8ad6('0x2a')},{'name':'QueueCampaigns','value':_0x8ad6('0x2c')}];var _0x154754=_['find'](_0x3e949f,[_0x8ad6('0x30'),_0x3787e8[_0x8ad6('0x32')]])[_0x8ad6('0x33')];return db[_0x8ad6('0x55')][_0x8ad6('0x5d')]({'where':{'name':_0x154754,'userProfileId':_0x2ed664[_0x8ad6('0x56')]},'raw':!![]})['then'](function(_0x51a1ef){if(_0x51a1ef&&_0x51a1ef[_0x8ad6('0x57')]===0x0){return db[_0x8ad6('0x5e')][_0x8ad6('0x50')]({'name':_0x3787e8[_0x8ad6('0x33')],'resourceId':_0x3787e8['id'],'type':_0x51a1ef[_0x8ad6('0x33')],'sectionId':_0x51a1ef['id']},{})[_0x8ad6('0x27')](function(){return _0x5a0d8c;});}else{return _0x5a0d8c;}})[_0x8ad6('0x4f')](function(_0xe0a60b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xe0a60b);throw _0xe0a60b;});}return _0x5a0d8c;});}})['then'](respondWithResult(_0xbc6bab,0xc9))['catch'](handleError(_0xbc6bab,null));};exports[_0x8ad6('0x25')]=function(_0x25099d,_0x3b11e3){if(_0x25099d[_0x8ad6('0x51')]['id']){delete _0x25099d[_0x8ad6('0x51')]['id'];}return db[_0x8ad6('0x45')]['find']({'where':{'id':_0x25099d[_0x8ad6('0x4b')]['id']}})[_0x8ad6('0x27')](handleEntityNotFound(_0x3b11e3,null))[_0x8ad6('0x27')](saveUpdates(_0x25099d[_0x8ad6('0x51')],null))['then'](respondWithResult(_0x3b11e3,null))[_0x8ad6('0x4f')](handleError(_0x3b11e3,null));};exports['destroy']=function(_0xa7804,_0x4e1c73){return db[_0x8ad6('0x45')][_0x8ad6('0x5d')]({'where':{'id':_0xa7804['params']['id']}})[_0x8ad6('0x27')](handleEntityNotFound(_0x4e1c73,null))[_0x8ad6('0x27')](removeEntity(_0x4e1c73,null))[_0x8ad6('0x4f')](handleError(_0x4e1c73,null));};exports[_0x8ad6('0x5f')]=function(_0x33e1ef,_0x1f97f0,_0x4ee6e6){var _0x167f51={'raw':![],'where':{}};var _0x5cb35d={};var _0x3b8ed3={'count':0x0,'rows':[]};return db[_0x8ad6('0x45')][_0x8ad6('0x60')]({'where':{'id':_0x33e1ef[_0x8ad6('0x4b')]['id']}})[_0x8ad6('0x27')](handleEntityNotFound(_0x1f97f0,null))[_0x8ad6('0x27')](function(_0x1593ae){if(_0x1593ae){_0x5cb35d[_0x8ad6('0x3c')]=_[_0x8ad6('0x4c')](db[_0x8ad6('0x61')]['rawAttributes']);_0x5cb35d[_0x8ad6('0x38')]=_[_0x8ad6('0x4c')](_0x33e1ef[_0x8ad6('0x38')]);_0x5cb35d[_0x8ad6('0x39')]=_['intersection'](_0x5cb35d[_0x8ad6('0x3c')],_0x5cb35d[_0x8ad6('0x38')]);_0x167f51[_0x8ad6('0x3b')]=_[_0x8ad6('0x3a')](_0x5cb35d['model'],qs['fields'](_0x33e1ef[_0x8ad6('0x38')][_0x8ad6('0x4d')]));_0x167f51[_0x8ad6('0x3b')]=_0x167f51['attributes'][_0x8ad6('0x4e')]?_0x167f51[_0x8ad6('0x3b')]:_0x5cb35d['model'];if(!_0x33e1ef[_0x8ad6('0x38')][_0x8ad6('0x3d')](_0x8ad6('0x3e'))){_0x167f51[_0x8ad6('0x20')]=qs['limit'](_0x33e1ef['query'][_0x8ad6('0x20')]);_0x167f51[_0x8ad6('0x1e')]=qs[_0x8ad6('0x1e')](_0x33e1ef['query'][_0x8ad6('0x1e')]);}_0x167f51['order']=qs[_0x8ad6('0x3f')](_0x33e1ef['query'][_0x8ad6('0x3f')]);_0x167f51[_0x8ad6('0x40')]=qs[_0x8ad6('0x39')](_[_0x8ad6('0x41')](_0x33e1ef[_0x8ad6('0x38')],_0x5cb35d[_0x8ad6('0x39')]));_0x167f51[_0x8ad6('0x40')][_0x8ad6('0x62')]=_0x1593ae['id'];if(_0x33e1ef['query'][_0x8ad6('0x2d')]){_0x167f51['where']=_[_0x8ad6('0x42')](_0x167f51[_0x8ad6('0x40')],{'$or':_[_0x8ad6('0x2f')](_0x167f51[_0x8ad6('0x3b')],function(_0x3462ce){var _0x11f220={};_0x11f220[_0x3462ce]={'$like':'%'+_0x33e1ef[_0x8ad6('0x38')]['filter']+'%'};return _0x11f220;})});}_0x167f51=_[_0x8ad6('0x42')]({},_0x167f51,_0x33e1ef['options']);return db['CmHopper'][_0x8ad6('0x46')]({'where':_0x167f51[_0x8ad6('0x40')]})[_0x8ad6('0x27')](function(_0x5db742){_0x3b8ed3[_0x8ad6('0x46')]=_0x5db742;if(_0x33e1ef[_0x8ad6('0x38')][_0x8ad6('0x47')]){_0x167f51[_0x8ad6('0x48')]=[{'all':!![]}];}return db['CmHopper'][_0x8ad6('0x63')](_0x167f51);})[_0x8ad6('0x27')](function(_0x182cc0){_0x3b8ed3[_0x8ad6('0x49')]=_0x182cc0;return _0x3b8ed3;});}})[_0x8ad6('0x27')](respondWithFilteredResult(_0x1f97f0,_0x167f51))[_0x8ad6('0x4f')](handleError(_0x1f97f0,null));};exports[_0x8ad6('0x64')]=function(_0x1fc200,_0x58d67a,_0x1c2afc){var _0x5f1d11={'raw':!![],'where':{}};var _0x389112={};var _0x23fb34={'count':0x0,'rows':[]};return db[_0x8ad6('0x45')][_0x8ad6('0x60')]({'where':{'id':_0x1fc200[_0x8ad6('0x4b')]['id']}})[_0x8ad6('0x27')](handleEntityNotFound(_0x58d67a,null))[_0x8ad6('0x27')](function(_0x22e838){if(_0x22e838){_0x389112[_0x8ad6('0x3c')]=_[_0x8ad6('0x4c')](db[_0x8ad6('0x65')][_0x8ad6('0x36')]);_0x389112[_0x8ad6('0x38')]=_['keys'](_0x1fc200['query']);_0x389112[_0x8ad6('0x39')]=_[_0x8ad6('0x3a')](_0x389112['model'],_0x389112[_0x8ad6('0x38')]);_0x5f1d11[_0x8ad6('0x3b')]=_[_0x8ad6('0x3a')](_0x389112['model'],qs[_0x8ad6('0x4d')](_0x1fc200[_0x8ad6('0x38')][_0x8ad6('0x4d')]));_0x5f1d11[_0x8ad6('0x3b')]=_0x5f1d11[_0x8ad6('0x3b')][_0x8ad6('0x4e')]?_0x5f1d11[_0x8ad6('0x3b')]:_0x389112[_0x8ad6('0x3c')];if(!_0x1fc200['query']['hasOwnProperty'](_0x8ad6('0x3e'))){_0x5f1d11[_0x8ad6('0x20')]=qs[_0x8ad6('0x20')](_0x1fc200['query'][_0x8ad6('0x20')]);_0x5f1d11[_0x8ad6('0x1e')]=qs['offset'](_0x1fc200[_0x8ad6('0x38')]['offset']);}_0x5f1d11[_0x8ad6('0x66')]=qs[_0x8ad6('0x3f')](_0x1fc200[_0x8ad6('0x38')][_0x8ad6('0x3f')]);_0x5f1d11[_0x8ad6('0x40')]=qs[_0x8ad6('0x39')](_['pick'](_0x1fc200['query'],_0x389112[_0x8ad6('0x39')]));_0x5f1d11[_0x8ad6('0x40')][_0x8ad6('0x62')]=_0x22e838['id'];if(_0x1fc200[_0x8ad6('0x38')][_0x8ad6('0x2d')]){_0x5f1d11['where']=_['merge'](_0x5f1d11[_0x8ad6('0x40')],{'$or':_[_0x8ad6('0x2f')](_0x5f1d11['attributes'],function(_0x1b6ccf){var _0x54b5bf={};_0x54b5bf[_0x1b6ccf]={'$like':'%'+_0x1fc200[_0x8ad6('0x38')][_0x8ad6('0x2d')]+'%'};return _0x54b5bf;})});}_0x5f1d11=_[_0x8ad6('0x42')]({},_0x5f1d11,_0x1fc200['options']);return db[_0x8ad6('0x65')]['count']({'where':_0x5f1d11[_0x8ad6('0x40')]})['then'](function(_0x4a8496){_0x23fb34[_0x8ad6('0x46')]=_0x4a8496;if(_0x1fc200[_0x8ad6('0x38')]['includeAll']){_0x5f1d11['include']=[{'all':!![]}];}return db[_0x8ad6('0x65')]['findAll'](_0x5f1d11);})[_0x8ad6('0x27')](function(_0x221efc){_0x23fb34[_0x8ad6('0x49')]=_0x221efc;return _0x23fb34;});}})[_0x8ad6('0x27')](respondWithFilteredResult(_0x58d67a,_0x5f1d11))['catch'](handleError(_0x58d67a,null));};exports[_0x8ad6('0x67')]=function(_0x3f89ee,_0x1ae4d5,_0x3faf57){var _0x2aae16={'raw':!![],'where':{}};var _0x28275e={};var _0x26ae6a={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x3f89ee['params']['id']}})[_0x8ad6('0x27')](handleEntityNotFound(_0x1ae4d5,null))[_0x8ad6('0x27')](function(_0x36399e){if(_0x36399e){_0x28275e['model']=_[_0x8ad6('0x4c')](db['CmHopperFinal'][_0x8ad6('0x36')]);_0x28275e[_0x8ad6('0x38')]=_[_0x8ad6('0x4c')](_0x3f89ee[_0x8ad6('0x38')]);_0x28275e[_0x8ad6('0x39')]=_[_0x8ad6('0x3a')](_0x28275e['model'],_0x28275e[_0x8ad6('0x38')]);_0x2aae16[_0x8ad6('0x3b')]=_[_0x8ad6('0x3a')](_0x28275e[_0x8ad6('0x3c')],qs[_0x8ad6('0x4d')](_0x3f89ee[_0x8ad6('0x38')][_0x8ad6('0x4d')]));_0x2aae16[_0x8ad6('0x3b')]=_0x2aae16[_0x8ad6('0x3b')][_0x8ad6('0x4e')]?_0x2aae16[_0x8ad6('0x3b')]:_0x28275e['model'];if(!_0x3f89ee['query'][_0x8ad6('0x3d')]('nolimit')){_0x2aae16[_0x8ad6('0x20')]=qs[_0x8ad6('0x20')](_0x3f89ee[_0x8ad6('0x38')]['limit']);_0x2aae16[_0x8ad6('0x1e')]=qs['offset'](_0x3f89ee[_0x8ad6('0x38')][_0x8ad6('0x1e')]);}_0x2aae16['order']=qs[_0x8ad6('0x3f')](_0x3f89ee[_0x8ad6('0x38')][_0x8ad6('0x3f')]);_0x2aae16[_0x8ad6('0x40')]=qs[_0x8ad6('0x39')](_[_0x8ad6('0x41')](_0x3f89ee['query'],_0x28275e[_0x8ad6('0x39')]));_0x2aae16['where'][_0x8ad6('0x62')]=_0x36399e['id'];if(_0x3f89ee['query'][_0x8ad6('0x2d')]){_0x2aae16['where']=_[_0x8ad6('0x42')](_0x2aae16['where'],{'$or':_[_0x8ad6('0x2f')](_0x2aae16['attributes'],function(_0x10744d){var _0x3e33f0={};_0x3e33f0[_0x10744d]={'$like':'%'+_0x3f89ee[_0x8ad6('0x38')]['filter']+'%'};return _0x3e33f0;})});}_0x2aae16=_[_0x8ad6('0x42')]({},_0x2aae16,_0x3f89ee['options']);return db['CmHopperFinal'][_0x8ad6('0x46')]({'where':_0x2aae16[_0x8ad6('0x40')]})[_0x8ad6('0x27')](function(_0x5a3810){_0x26ae6a[_0x8ad6('0x46')]=_0x5a3810;if(_0x3f89ee[_0x8ad6('0x38')][_0x8ad6('0x47')]){_0x2aae16[_0x8ad6('0x48')]=[{'all':!![]}];}return db[_0x8ad6('0x68')][_0x8ad6('0x63')](_0x2aae16);})['then'](function(_0x352be1){_0x26ae6a[_0x8ad6('0x49')]=_0x352be1;return _0x26ae6a;});}})['then'](respondWithFilteredResult(_0x1ae4d5,_0x2aae16))['catch'](handleError(_0x1ae4d5,null));};exports[_0x8ad6('0x69')]=function(_0x4836f2,_0x1d3f48,_0x1259d2){var _0x4a24cb={'raw':!![],'where':{}};var _0x1503c4={};var _0x21f828={'count':0x0,'rows':[]};return db[_0x8ad6('0x45')]['findOne']({'where':{'id':_0x4836f2['params']['id']}})[_0x8ad6('0x27')](handleEntityNotFound(_0x1d3f48,null))['then'](function(_0x67c330){if(_0x67c330){_0x1503c4[_0x8ad6('0x3c')]=_['keys'](db[_0x8ad6('0x6a')]['rawAttributes']);_0x1503c4[_0x8ad6('0x38')]=_[_0x8ad6('0x4c')](_0x4836f2['query']);_0x1503c4[_0x8ad6('0x39')]=_[_0x8ad6('0x3a')](_0x1503c4[_0x8ad6('0x3c')],_0x1503c4[_0x8ad6('0x38')]);_0x4a24cb['attributes']=_[_0x8ad6('0x3a')](_0x1503c4[_0x8ad6('0x3c')],qs['fields'](_0x4836f2[_0x8ad6('0x38')][_0x8ad6('0x4d')]));_0x4a24cb[_0x8ad6('0x3b')]=_0x4a24cb[_0x8ad6('0x3b')][_0x8ad6('0x4e')]?_0x4a24cb['attributes']:_0x1503c4[_0x8ad6('0x3c')];if(!_0x4836f2[_0x8ad6('0x38')][_0x8ad6('0x3d')]('nolimit')){_0x4a24cb[_0x8ad6('0x20')]=qs[_0x8ad6('0x20')](_0x4836f2['query'][_0x8ad6('0x20')]);_0x4a24cb[_0x8ad6('0x1e')]=qs[_0x8ad6('0x1e')](_0x4836f2['query']['offset']);}_0x4a24cb[_0x8ad6('0x66')]=qs['sort'](_0x4836f2[_0x8ad6('0x38')][_0x8ad6('0x3f')]);_0x4a24cb[_0x8ad6('0x40')]=qs[_0x8ad6('0x39')](_['pick'](_0x4836f2['query'],_0x1503c4[_0x8ad6('0x39')]));_0x4a24cb[_0x8ad6('0x40')][_0x8ad6('0x62')]=_0x67c330['id'];if(_0x4836f2[_0x8ad6('0x38')][_0x8ad6('0x2d')]){_0x4a24cb[_0x8ad6('0x40')]=_[_0x8ad6('0x42')](_0x4a24cb[_0x8ad6('0x40')],{'$or':_['map'](_0x4a24cb['attributes'],function(_0x45a255){var _0x202f64={};_0x202f64[_0x45a255]={'$like':'%'+_0x4836f2[_0x8ad6('0x38')][_0x8ad6('0x2d')]+'%'};return _0x202f64;})});}_0x4a24cb=_['merge']({},_0x4a24cb,_0x4836f2['options']);return db[_0x8ad6('0x6a')][_0x8ad6('0x46')]({'where':_0x4a24cb['where']})[_0x8ad6('0x27')](function(_0x37ca25){_0x21f828[_0x8ad6('0x46')]=_0x37ca25;if(_0x4836f2[_0x8ad6('0x38')][_0x8ad6('0x47')]){_0x4a24cb['include']=[{'all':!![]}];}return db[_0x8ad6('0x6a')][_0x8ad6('0x63')](_0x4a24cb);})[_0x8ad6('0x27')](function(_0x1daf66){_0x21f828[_0x8ad6('0x49')]=_0x1daf66;return _0x21f828;});}})[_0x8ad6('0x27')](respondWithFilteredResult(_0x1d3f48,_0x4a24cb))[_0x8ad6('0x4f')](handleError(_0x1d3f48,null));};exports[_0x8ad6('0x6b')]=function(_0x3b7908,_0x55c052,_0x53b726){var _0x4bc4e6={};var _0x1a237a={};var _0x1cc6cd;var _0x21c020;return db[_0x8ad6('0x45')][_0x8ad6('0x60')]({'where':{'id':_0x3b7908[_0x8ad6('0x4b')]['id']}})[_0x8ad6('0x27')](handleEntityNotFound(_0x55c052,null))['then'](function(_0x5e69f5){if(_0x5e69f5){_0x1cc6cd=_0x5e69f5;_0x1a237a[_0x8ad6('0x3c')]=_[_0x8ad6('0x4c')](db[_0x8ad6('0x6c')][_0x8ad6('0x36')]);_0x1a237a[_0x8ad6('0x38')]=_[_0x8ad6('0x4c')](_0x3b7908[_0x8ad6('0x38')]);_0x1a237a['filters']=_[_0x8ad6('0x3a')](_0x1a237a[_0x8ad6('0x3c')],_0x1a237a[_0x8ad6('0x38')]);_0x4bc4e6[_0x8ad6('0x3b')]=_[_0x8ad6('0x3a')](_0x1a237a['model'],qs[_0x8ad6('0x4d')](_0x3b7908[_0x8ad6('0x38')][_0x8ad6('0x4d')]));_0x4bc4e6[_0x8ad6('0x3b')]=_0x4bc4e6['attributes'][_0x8ad6('0x4e')]?_0x4bc4e6[_0x8ad6('0x3b')]:_0x1a237a['model'];_0x4bc4e6[_0x8ad6('0x66')]=qs['sort'](_0x3b7908[_0x8ad6('0x38')][_0x8ad6('0x3f')]);_0x4bc4e6['where']=qs[_0x8ad6('0x39')](_[_0x8ad6('0x41')](_0x3b7908['query'],_0x1a237a['filters']));if(_0x3b7908[_0x8ad6('0x38')][_0x8ad6('0x2d')]){_0x4bc4e6[_0x8ad6('0x40')]=_[_0x8ad6('0x42')](_0x4bc4e6[_0x8ad6('0x40')],{'$or':_[_0x8ad6('0x2f')](_0x4bc4e6[_0x8ad6('0x3b')],function(_0x1445c4){var _0x3e2018={};_0x3e2018[_0x1445c4]={'$like':'%'+_0x3b7908[_0x8ad6('0x38')]['filter']+'%'};return _0x3e2018;})});}_0x4bc4e6=_['merge']({},_0x4bc4e6,_0x3b7908[_0x8ad6('0x44')]);return _0x1cc6cd[_0x8ad6('0x6b')](_0x4bc4e6);}})[_0x8ad6('0x27')](function(_0x4d29b7){if(_0x4d29b7){_0x21c020=_0x4d29b7[_0x8ad6('0x4e')];if(!_0x3b7908['query'][_0x8ad6('0x3d')](_0x8ad6('0x3e'))){_0x4bc4e6[_0x8ad6('0x20')]=qs['limit'](_0x3b7908[_0x8ad6('0x38')][_0x8ad6('0x20')]);_0x4bc4e6[_0x8ad6('0x1e')]=qs[_0x8ad6('0x1e')](_0x3b7908[_0x8ad6('0x38')][_0x8ad6('0x1e')]);}return _0x1cc6cd['getTeams'](_0x4bc4e6);}})['then'](function(_0x5d4e73){if(_0x5d4e73){return _0x5d4e73?{'count':_0x21c020,'rows':_0x5d4e73}:null;}})[_0x8ad6('0x27')](respondWithResult(_0x55c052,null))['catch'](handleError(_0x55c052,null));};exports[_0x8ad6('0x6d')]=function(_0x5b7025,_0x361ceb,_0x90cbbe){var _0x5ca211=_0x5b7025[_0x8ad6('0x51')][_0x8ad6('0x6e')];var _0x2c33d0=_['map'](_0x5ca211,'id');return db['Team'][_0x8ad6('0x63')]({'where':{'id':_0x2c33d0},'attributes':['id'],'include':[{'model':db[_0x8ad6('0x6f')],'as':'Agents','attributes':['id','name',_0x8ad6('0x70'),_0x8ad6('0x71'),'interface'],'raw':!![]}]})[_0x8ad6('0x27')](function(_0x4a50b2){if(_0x4a50b2){var _0x5de2e4=_[_0x8ad6('0x72')](_0x4a50b2,function(_0x3558a4){var _0x5242cd=_0x3558a4[_0x8ad6('0x28')]({'plain':!![]});_0x5242cd['Agents'][_0x8ad6('0x73')](function(_0x39d163){_0x39d163[_0x8ad6('0x74')]=_['find'](_0x5ca211,{'id':_0x5242cd['id']})[_0x8ad6('0x74')];});return _0x5242cd['Agents'];});return db[_0x8ad6('0x45')]['find']({'where':{'id':_0x5b7025['params']['id']}})['then'](function(_0x209844){return db['sequelize'][_0x8ad6('0x75')](function(_0x25ca7f){return _0x209844[_0x8ad6('0x6d')](_0x2c33d0,{'transaction':_0x25ca7f})[_0x8ad6('0x27')](function(){return BPromise[_0x8ad6('0x76')](_0x5ca211,function(_0x5ca093){return db[_0x8ad6('0x77')][_0x8ad6('0x78')]({'TeamId':_0x5ca093['id'],'VoiceQueueId':_0x5b7025['params']['id'],'penalty':_0x5ca093[_0x8ad6('0x74')]},{'transaction':_0x25ca7f});});})['then'](function(){return BPromise[_0x8ad6('0x76')](_0x5de2e4,function(_0x3e8f1e){return db[_0x8ad6('0x79')][_0x8ad6('0x7a')]({'where':{'UserId':_0x3e8f1e['id'],'VoiceQueueId':_0x5b7025[_0x8ad6('0x4b')]['id']},'defaults':{'penalty':_0x3e8f1e[_0x8ad6('0x74')]},'transaction':_0x25ca7f});});})[_0x8ad6('0x27')](function(){return BPromise[_0x8ad6('0x76')](_[_0x8ad6('0x2d')](_0x5de2e4,{'online':!![]}),function(_0x135a0c){return db[_0x8ad6('0x7b')][_0x8ad6('0x78')]({'membername':_0x135a0c[_0x8ad6('0x33')],'UserId':_0x135a0c['id'],'queue_name':_0x209844['name'],'VoiceQueueId':_0x209844['id'],'interface':_[_0x8ad6('0x7c')](_0x135a0c[_0x8ad6('0x7d')])?util[_0x8ad6('0x7e')](_0x8ad6('0x7f'),_0x135a0c[_0x8ad6('0x33')]):_0x135a0c[_0x8ad6('0x7d')],'paused':_0x135a0c[_0x8ad6('0x71')]||![],'penalty':_0x135a0c[_0x8ad6('0x74')]},{'transaction':_0x25ca7f});});})[_0x8ad6('0x27')](function(){_0x5de2e4[_0x8ad6('0x73')](function(_0x4bc2ca){socket[_0x8ad6('0x80')]('userVoiceQueue:save',{'UserId':_0x4bc2ca['id'],'VoiceQueueId':_0x209844['id']});});});});});}})['then'](respondWithStatusCode(_0x361ceb,null))['catch'](handleError(_0x361ceb,null));};exports[_0x8ad6('0x81')]=function(_0x294f3c,_0x459060,_0x34739a){return db['Team'][_0x8ad6('0x63')]({'where':{'id':_0x294f3c[_0x8ad6('0x38')]['ids']},'attributes':['id'],'include':[{'model':db[_0x8ad6('0x6f')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x8ad6('0x27')](handleEntityNotFound(_0x459060,null))[_0x8ad6('0x27')](function(_0x2cc58a){var _0x5d78d3=_[_0x8ad6('0x2f')](_0x2cc58a,'id');var _0x2c37bb=[];var _0x2b4b23=[];var _0xd63519=squel[_0x8ad6('0x82')]();_0xd63519[_0x8ad6('0x83')](_0x8ad6('0x84'))[_0x8ad6('0x85')]('team_has_voice_queues','tq')['join'](_0x8ad6('0x86'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x8ad6('0x40')]('VoiceQueueId\x20=\x20?',_0x294f3c[_0x8ad6('0x4b')]['id']);for(var _0x21d9d5=0x0;_0x21d9d5<_0x2cc58a[_0x8ad6('0x4e')];_0x21d9d5+=0x1){let _0x5c95fc=_0x2cc58a[_0x21d9d5];for(var _0x337114=0x0;_0x337114<_0x5c95fc[_0x8ad6('0x87')][_0x8ad6('0x4e')];_0x337114+=0x1){let _0x3e3f90=_0x5c95fc[_0x8ad6('0x87')][_0x337114];var _0x592dd9=_0xd63519[_0x8ad6('0x5a')]();_0x592dd9[_0x8ad6('0x40')](_0x8ad6('0x88'),_0x3e3f90['id']);_0x2b4b23[_0x8ad6('0x89')](db['sequelize']['query'](_0x592dd9[_0x8ad6('0x8a')](),{'type':db['sequelize'][_0x8ad6('0x8b')][_0x8ad6('0x8c')]})[_0x8ad6('0x27')](function(_0x5adcc7){if(_0x5adcc7['length']===0x1){return _0x3e3f90['id'];}else{var _0x5ce7f8=_[_0x8ad6('0x8d')](_[_0x8ad6('0x2f')](_0x5adcc7,'TeamId'),function(_0x19eda7){return _[_0x8ad6('0x31')](_0x5d78d3,_0x19eda7);});if(_0x5ce7f8){return _0x3e3f90['id'];}}}));}}return BPromise['all'](_0x2b4b23)[_0x8ad6('0x27')](function(_0x353af6){_0x2c37bb=_(_0x2c37bb)[_0x8ad6('0x8e')](_0x353af6)[_0x8ad6('0x8f')]()[_0x8ad6('0x30')]();return db['VoiceQueue']['find']({'where':{'id':_0x294f3c[_0x8ad6('0x4b')]['id']}})['then'](function(_0x337c42){return db[_0x8ad6('0x90')][_0x8ad6('0x75')](function(_0x335748){return _0x337c42['removeTeams'](_0x294f3c[_0x8ad6('0x38')]['ids'],{'transaction':_0x335748})[_0x8ad6('0x27')](function(){if(!_[_0x8ad6('0x91')](_0x2c37bb)){return _0x337c42['removeAgents'](_0x2c37bb,{'transaction':_0x335748})[_0x8ad6('0x27')](function(){return db[_0x8ad6('0x7b')]['destroy']({'where':{'VoiceQueueId':_0x294f3c[_0x8ad6('0x4b')]['id'],'UserId':_0x2c37bb},'transaction':_0x335748});});}})['then'](function(){_0x2c37bb[_0x8ad6('0x73')](function(_0x3f49c0){socket[_0x8ad6('0x80')](_0x8ad6('0x92'),{'UserId':_0x3f49c0,'VoiceQueueId':_0x337c42['id']});});});});});});})['then'](respondWithStatusCode(_0x459060,null))[_0x8ad6('0x4f')](handleError(_0x459060,null));};exports[_0x8ad6('0x93')]=function(_0x28bdb6,_0x387c70,_0x38b305){var _0x2e376b,_0x1c5f5c;return db['VoiceQueue']['find']({'where':{'id':_0x28bdb6[_0x8ad6('0x4b')]['id']}})[_0x8ad6('0x27')](handleEntityNotFound(_0x387c70,null))[_0x8ad6('0x27')](function(_0x310388){if(_0x310388){_0x1c5f5c=_0x310388;return _0x310388[_0x8ad6('0x93')](_0x28bdb6['body']['ids'],_[_0x8ad6('0x5c')](_0x28bdb6[_0x8ad6('0x51')],[_0x8ad6('0x94'),'id'])||{})[_0x8ad6('0x95')](function(_0x20d320){for(var _0x24a8f9=0x0;_0x24a8f9<_0x28bdb6[_0x8ad6('0x51')]['ids'][_0x8ad6('0x4e')];_0x24a8f9+=0x1){socket[_0x8ad6('0x80')]('userVoiceQueue:save',{'UserId':Number(_0x28bdb6[_0x8ad6('0x51')]['ids'][_0x24a8f9]),'VoiceQueueId':Number(_0x28bdb6[_0x8ad6('0x4b')]['id'])});}return _0x20d320;});}})[_0x8ad6('0x27')](function(_0x5a175c){_0x2e376b=_0x5a175c||[];if(_0x1c5f5c){return db[_0x8ad6('0x6f')]['findAll']({'where':{'id':_0x28bdb6[_0x8ad6('0x51')][_0x8ad6('0x94')]},'attributes':['id','name',_0x8ad6('0x70'),_0x8ad6('0x71'),_0x8ad6('0x7d')],'raw':!![]});}})[_0x8ad6('0x27')](function(_0x102b28){if(!_['isEmpty'](_0x102b28)){var _0xf8cd6=[];for(var _0x5e538e=0x0;_0x5e538e<_0x102b28[_0x8ad6('0x4e')];_0x5e538e++){if(_0x102b28[_0x5e538e]['online']){_0xf8cd6[_0x8ad6('0x89')](db[_0x8ad6('0x7b')][_0x8ad6('0x78')]({'membername':_0x102b28[_0x5e538e]['name'],'UserId':_0x102b28[_0x5e538e]['id'],'queue_name':_0x1c5f5c[_0x8ad6('0x33')],'VoiceQueueId':_0x1c5f5c['id'],'interface':_[_0x8ad6('0x7c')](_0x102b28[_0x5e538e]['interface'])?util[_0x8ad6('0x7e')](_0x8ad6('0x7f'),_0x102b28[_0x5e538e][_0x8ad6('0x33')]):_0x102b28[_0x5e538e][_0x8ad6('0x7d')],'paused':_0x102b28[_0x5e538e][_0x8ad6('0x71')]||![],'penalty':_0x28bdb6[_0x8ad6('0x51')][_0x8ad6('0x74')]||0x0}));}}return BPromise[_0x8ad6('0x96')](_0xf8cd6);}})[_0x8ad6('0x27')](function(){return _0x2e376b;})[_0x8ad6('0x27')](respondWithResult(_0x387c70,null))[_0x8ad6('0x4f')](handleError(_0x387c70,null));};exports[_0x8ad6('0x97')]=function(_0x2c9adf,_0x597543,_0x5cdd68){return db['VoiceQueue']['find']({'where':{'id':_0x2c9adf[_0x8ad6('0x4b')]['id']}})[_0x8ad6('0x27')](handleEntityNotFound(_0x597543,null))[_0x8ad6('0x27')](function(_0x57b561){if(_0x57b561){return _0x57b561['removeAgents'](_0x2c9adf[_0x8ad6('0x38')][_0x8ad6('0x94')])['then'](function(){if(_[_0x8ad6('0x98')](_0x2c9adf[_0x8ad6('0x38')]['ids'])){for(var _0x1690fb=0x0;_0x1690fb<_0x2c9adf[_0x8ad6('0x38')][_0x8ad6('0x94')][_0x8ad6('0x4e')];_0x1690fb+=0x1){socket[_0x8ad6('0x80')]('userVoiceQueue:remove',{'UserId':Number(_0x2c9adf[_0x8ad6('0x38')]['ids'][_0x1690fb]),'VoiceQueueId':Number(_0x2c9adf['params']['id'])});}}else{socket[_0x8ad6('0x80')]('userVoiceQueue:remove',{'UserId':Number(_0x2c9adf[_0x8ad6('0x38')][_0x8ad6('0x94')]),'VoiceQueueId':Number(_0x2c9adf['params']['id'])});}});}})['then'](function(_0x4e228b){return db['UserVoiceQueueRt'][_0x8ad6('0x26')]({'where':{'VoiceQueueId':_0x2c9adf[_0x8ad6('0x4b')]['id'],'UserId':_0x2c9adf[_0x8ad6('0x38')]['ids']}})['then'](function(){return _0x4e228b;});})[_0x8ad6('0x27')](respondWithStatusCode(_0x597543,null))[_0x8ad6('0x4f')](handleError(_0x597543,null));};exports[_0x8ad6('0x99')]=function(_0x1bfded,_0xfee74b,_0x108328){var _0x7ba7b1={};var _0x2b9260={};var _0x31bdce;var _0x5d4fab;return db[_0x8ad6('0x45')][_0x8ad6('0x60')]({'where':{'id':_0x1bfded[_0x8ad6('0x4b')]['id']}})['then'](handleEntityNotFound(_0xfee74b,null))[_0x8ad6('0x27')](function(_0x85d6cb){if(_0x85d6cb){_0x31bdce=_0x85d6cb;_0x2b9260[_0x8ad6('0x3c')]=_[_0x8ad6('0x4c')](db[_0x8ad6('0x6f')]['rawAttributes']);_0x2b9260[_0x8ad6('0x38')]=_[_0x8ad6('0x4c')](_0x1bfded[_0x8ad6('0x38')]);_0x2b9260[_0x8ad6('0x39')]=_[_0x8ad6('0x3a')](_0x2b9260[_0x8ad6('0x3c')],_0x2b9260[_0x8ad6('0x38')]);_0x7ba7b1[_0x8ad6('0x3b')]=_[_0x8ad6('0x3a')](_0x2b9260[_0x8ad6('0x3c')],qs['fields'](_0x1bfded[_0x8ad6('0x38')][_0x8ad6('0x4d')]));_0x7ba7b1[_0x8ad6('0x3b')]=_0x7ba7b1['attributes'][_0x8ad6('0x4e')]?_0x7ba7b1[_0x8ad6('0x3b')]:_0x2b9260[_0x8ad6('0x3c')];_0x7ba7b1[_0x8ad6('0x66')]=qs['sort'](_0x1bfded[_0x8ad6('0x38')][_0x8ad6('0x3f')]);_0x7ba7b1[_0x8ad6('0x40')]=qs[_0x8ad6('0x39')](_['pick'](_0x1bfded[_0x8ad6('0x38')],_0x2b9260[_0x8ad6('0x39')]));if(_0x1bfded[_0x8ad6('0x38')][_0x8ad6('0x2d')]){_0x7ba7b1[_0x8ad6('0x40')]=_[_0x8ad6('0x42')](_0x7ba7b1[_0x8ad6('0x40')],{'$or':_[_0x8ad6('0x2f')](_0x7ba7b1[_0x8ad6('0x3b')],function(_0x1acec6){var _0x24604a={};_0x24604a[_0x1acec6]={'$like':'%'+_0x1bfded[_0x8ad6('0x38')]['filter']+'%'};return _0x24604a;})});}_0x7ba7b1=_[_0x8ad6('0x42')]({},_0x7ba7b1,_0x1bfded['options']);return _0x31bdce['getAgents'](_0x7ba7b1);}})['then'](function(_0x5842a0){if(_0x5842a0){_0x5d4fab=_0x5842a0[_0x8ad6('0x4e')];if(!_0x1bfded[_0x8ad6('0x38')][_0x8ad6('0x3d')](_0x8ad6('0x3e'))){_0x7ba7b1[_0x8ad6('0x20')]=qs[_0x8ad6('0x20')](_0x1bfded[_0x8ad6('0x38')][_0x8ad6('0x20')]);_0x7ba7b1[_0x8ad6('0x1e')]=qs['offset'](_0x1bfded['query'][_0x8ad6('0x1e')]);}return _0x31bdce[_0x8ad6('0x99')](_0x7ba7b1);}})[_0x8ad6('0x27')](function(_0x4a31ad){if(_0x4a31ad){return _0x4a31ad?{'count':_0x5d4fab,'rows':_0x4a31ad}:null;}})[_0x8ad6('0x27')](respondWithResult(_0xfee74b,null))[_0x8ad6('0x4f')](handleError(_0xfee74b,null));};exports['getMembers']=function(_0x486ce2,_0x37defd,_0x143804){var _0x2a770e={};var _0x358e74={};var _0x49e468;var _0x376182;return db['VoiceQueue'][_0x8ad6('0x60')]({'where':{'id':_0x486ce2[_0x8ad6('0x4b')]['id']}})[_0x8ad6('0x27')](handleEntityNotFound(_0x37defd,null))[_0x8ad6('0x27')](function(_0x1f6aad){if(_0x1f6aad){_0x49e468=_0x1f6aad;_0x358e74[_0x8ad6('0x3c')]=_[_0x8ad6('0x4c')](db['UserVoiceQueueRt'][_0x8ad6('0x36')]);_0x358e74[_0x8ad6('0x38')]=_[_0x8ad6('0x4c')](_0x486ce2['query']);_0x358e74[_0x8ad6('0x39')]=_[_0x8ad6('0x3a')](_0x358e74[_0x8ad6('0x3c')],_0x358e74[_0x8ad6('0x38')]);_0x2a770e['attributes']=_[_0x8ad6('0x3a')](_0x358e74['model'],qs['fields'](_0x486ce2[_0x8ad6('0x38')][_0x8ad6('0x4d')]));_0x2a770e[_0x8ad6('0x3b')]=_0x2a770e[_0x8ad6('0x3b')][_0x8ad6('0x4e')]?_0x2a770e[_0x8ad6('0x3b')]:_0x358e74[_0x8ad6('0x3c')];_0x2a770e['order']=qs['sort'](_0x486ce2[_0x8ad6('0x38')][_0x8ad6('0x3f')]);_0x2a770e['where']=qs[_0x8ad6('0x39')](_[_0x8ad6('0x41')](_0x486ce2[_0x8ad6('0x38')],_0x358e74[_0x8ad6('0x39')]));if(_0x486ce2[_0x8ad6('0x38')][_0x8ad6('0x2d')]){_0x2a770e['where']=_[_0x8ad6('0x42')](_0x2a770e[_0x8ad6('0x40')],{'$or':_[_0x8ad6('0x2f')](_0x2a770e[_0x8ad6('0x3b')],function(_0x147819){var _0x3e9897={};_0x3e9897[_0x147819]={'$like':'%'+_0x486ce2[_0x8ad6('0x38')][_0x8ad6('0x2d')]+'%'};return _0x3e9897;})});}_0x2a770e=_['merge']({},_0x2a770e,_0x486ce2[_0x8ad6('0x44')]);return _0x49e468['getMembers'](_0x2a770e);}})['then'](function(_0x19a522){if(_0x19a522){_0x376182=_0x19a522[_0x8ad6('0x4e')];if(!_0x486ce2[_0x8ad6('0x38')][_0x8ad6('0x3d')](_0x8ad6('0x3e'))){_0x2a770e[_0x8ad6('0x20')]=qs[_0x8ad6('0x20')](_0x486ce2[_0x8ad6('0x38')][_0x8ad6('0x20')]);_0x2a770e[_0x8ad6('0x1e')]=qs['offset'](_0x486ce2[_0x8ad6('0x38')]['offset']);}return _0x49e468[_0x8ad6('0x9a')](_0x2a770e);}})[_0x8ad6('0x27')](function(_0x55ca9e){return _0x55ca9e?{'count':_0x376182,'rows':_0x55ca9e}:null;})[_0x8ad6('0x27')](respondWithResult(_0x37defd,null))[_0x8ad6('0x4f')](handleError(_0x37defd,null));};exports[_0x8ad6('0x9b')]=function(_0x2a8951,_0x586450,_0x595dbe){var _0x55e856={};var _0x2317ff={};var _0x1da889;var _0x3e237e;return db[_0x8ad6('0x45')]['findOne']({'where':{'id':_0x2a8951['params']['id']}})[_0x8ad6('0x27')](handleEntityNotFound(_0x586450,null))[_0x8ad6('0x27')](function(_0x1c4d2b){if(_0x1c4d2b){_0x1da889=_0x1c4d2b;_0x2317ff[_0x8ad6('0x3c')]=_[_0x8ad6('0x4c')](db[_0x8ad6('0x9c')][_0x8ad6('0x36')]);_0x2317ff[_0x8ad6('0x38')]=_[_0x8ad6('0x4c')](_0x2a8951[_0x8ad6('0x38')]);_0x2317ff[_0x8ad6('0x39')]=_[_0x8ad6('0x3a')](_0x2317ff[_0x8ad6('0x3c')],_0x2317ff[_0x8ad6('0x38')]);_0x55e856[_0x8ad6('0x3b')]=_[_0x8ad6('0x3a')](_0x2317ff[_0x8ad6('0x3c')],qs[_0x8ad6('0x4d')](_0x2a8951['query'][_0x8ad6('0x4d')]));_0x55e856[_0x8ad6('0x3b')]=_0x55e856['attributes']['length']?_0x55e856[_0x8ad6('0x3b')]:_0x2317ff[_0x8ad6('0x3c')];_0x55e856[_0x8ad6('0x66')]=qs[_0x8ad6('0x3f')](_0x2a8951[_0x8ad6('0x38')][_0x8ad6('0x3f')]);_0x55e856[_0x8ad6('0x40')]=qs[_0x8ad6('0x39')](_[_0x8ad6('0x41')](_0x2a8951[_0x8ad6('0x38')],_0x2317ff[_0x8ad6('0x39')]));if(_0x2a8951[_0x8ad6('0x38')]['filter']){_0x55e856['where']=_['merge'](_0x55e856[_0x8ad6('0x40')],{'$or':_[_0x8ad6('0x2f')](_0x55e856[_0x8ad6('0x3b')],function(_0x5c41f1){var _0x529310={};_0x529310[_0x5c41f1]={'$like':'%'+_0x2a8951[_0x8ad6('0x38')][_0x8ad6('0x2d')]+'%'};return _0x529310;})});}_0x55e856=_[_0x8ad6('0x42')]({},_0x55e856,_0x2a8951['options']);return _0x1da889[_0x8ad6('0x9b')](_0x55e856);}})['then'](function(_0x39b308){if(_0x39b308){_0x3e237e=_0x39b308[_0x8ad6('0x4e')];if(!_0x2a8951[_0x8ad6('0x38')][_0x8ad6('0x3d')]('nolimit')){_0x55e856['limit']=qs['limit'](_0x2a8951['query'][_0x8ad6('0x20')]);_0x55e856[_0x8ad6('0x1e')]=qs['offset'](_0x2a8951[_0x8ad6('0x38')][_0x8ad6('0x1e')]);}return _0x1da889[_0x8ad6('0x9b')](_0x55e856);}})['then'](function(_0x119d8b){if(_0x119d8b){return _0x119d8b?{'count':_0x3e237e,'rows':_0x119d8b}:null;}})[_0x8ad6('0x27')](respondWithResult(_0x586450,null))[_0x8ad6('0x4f')](handleError(_0x586450,null));};exports['addLists']=function(_0xa807a8,_0x100472,_0x498bf8){var _0x417b7d=moment()['format'](_0x8ad6('0x9d'));var _0x112ba4,_0x1717b9;return db[_0x8ad6('0x45')][_0x8ad6('0x5d')]({'where':{'id':_0xa807a8[_0x8ad6('0x4b')]['id']}})[_0x8ad6('0x27')](handleEntityNotFound(_0x100472,null))['then'](function(_0x3ce116){if(_0x3ce116){_0x1717b9=_0x3ce116;return _0x3ce116[_0x8ad6('0x9e')](_0xa807a8['body']['ids'],_[_0x8ad6('0x5c')](_0xa807a8[_0x8ad6('0x51')],['ids','id'])||{});}return null;})[_0x8ad6('0x95')](function(_0x413d45){var _0x2852af;_0x112ba4=_0x413d45||[];var _0x37f6af=[];if(_0x413d45){for(var _0x4a00c7=0x0;_0x4a00c7<_0x413d45[_0x8ad6('0x4e')];_0x4a00c7+=0x1){var _0x5b8748=_0x413d45[_0x4a00c7]['get']({'plain':!![]});_0x1717b9[_0x8ad6('0x9f')]=_0xa807a8['body']['dialCheckDuplicateType']?_0xa807a8[_0x8ad6('0x51')][_0x8ad6('0x9f')]:_0x1717b9[_0x8ad6('0x9f')];switch(_0x1717b9[_0x8ad6('0x9f')]){case _0x8ad6('0xa0'):_0x2852af=squel['insert']()[_0x8ad6('0xa1')](_0x8ad6('0xa2'))[_0x8ad6('0xa3')](['phone',_0x8ad6('0xa4'),_0x8ad6('0xa5'),'ListId',_0x8ad6('0x62'),_0x8ad6('0xa6'),_0x8ad6('0x5b')],squel[_0x8ad6('0x82')]()[_0x8ad6('0x83')](_0x8ad6('0xa7'),_0x8ad6('0xa7'))[_0x8ad6('0x83')]('\x27'+_0x417b7d+'\x27',_0x8ad6('0xa4'))[_0x8ad6('0x83')]('id',_0x8ad6('0xa5'))[_0x8ad6('0x83')](_0x5b8748[_0x8ad6('0xa8')][_0x8ad6('0x8a')](),'ListId')['field'](_0xa807a8[_0x8ad6('0x4b')]['id'][_0x8ad6('0x8a')](),_0x8ad6('0x62'))[_0x8ad6('0x83')]('\x27'+_0x417b7d+'\x27',_0x8ad6('0xa6'))[_0x8ad6('0x83')]('\x27'+_0x417b7d+'\x27',_0x8ad6('0x5b'))[_0x8ad6('0x85')](_0x8ad6('0xa9'))[_0x8ad6('0x40')](_0x8ad6('0xaa'))[_0x8ad6('0x40')](_0x8ad6('0xab'),_0x5b8748['CmListId'][_0x8ad6('0x8a')]())[_0x8ad6('0x40')]('phone\x20IS\x20NOT\x20NULL')[_0x8ad6('0x40')](_0x8ad6('0xac'),squel['select']()[_0x8ad6('0x83')](_0x8ad6('0xad'))['from'](_0x8ad6('0xae'))[_0x8ad6('0x40')](_0x8ad6('0xaf'),_0xa807a8[_0x8ad6('0x4b')]['id'][_0x8ad6('0x8a')]()))[_0x8ad6('0x40')](_0x8ad6('0xac'),squel[_0x8ad6('0x82')]()[_0x8ad6('0x83')](_0x8ad6('0xb0'))[_0x8ad6('0x85')](_0x8ad6('0xa2'))[_0x8ad6('0x40')](_0x8ad6('0xaf'),_0xa807a8[_0x8ad6('0x4b')]['id']['toString']())))[_0x8ad6('0x8a')]();break;case _0x8ad6('0xb1'):_0x2852af=squel[_0x8ad6('0xb2')]()['into']('cm_hopper')[_0x8ad6('0xa3')]([_0x8ad6('0xa7'),_0x8ad6('0xa4'),_0x8ad6('0xa5'),'ListId','VoiceQueueId','createdAt',_0x8ad6('0x5b')],squel['select']()[_0x8ad6('0x83')](_0x8ad6('0xa7'),_0x8ad6('0xa7'))[_0x8ad6('0x83')]('\x27'+_0x417b7d+'\x27',_0x8ad6('0xa4'))[_0x8ad6('0x83')]('id',_0x8ad6('0xa5'))['field'](_0x5b8748['CmListId'][_0x8ad6('0x8a')](),_0x8ad6('0xb3'))[_0x8ad6('0x83')](_0xa807a8['params']['id'][_0x8ad6('0x8a')](),_0x8ad6('0x62'))['field']('\x27'+_0x417b7d+'\x27','createdAt')['field']('\x27'+_0x417b7d+'\x27','updatedAt')[_0x8ad6('0x85')](_0x8ad6('0xa9'))[_0x8ad6('0x40')](_0x8ad6('0xaa'))[_0x8ad6('0x40')]('ListId\x20=\x20?',_0x5b8748[_0x8ad6('0xa8')][_0x8ad6('0x8a')]())[_0x8ad6('0x40')](_0x8ad6('0xb4'))[_0x8ad6('0x40')](_0x8ad6('0xac'),squel[_0x8ad6('0x82')]()[_0x8ad6('0x83')](_0x8ad6('0xb0'))[_0x8ad6('0x85')]('cm_hopper')[_0x8ad6('0x40')]('VoiceQueueId\x20=\x20?',_0xa807a8[_0x8ad6('0x4b')]['id'][_0x8ad6('0x8a')]())))[_0x8ad6('0x8a')]();break;default:_0x2852af=squel[_0x8ad6('0xb2')]()['into'](_0x8ad6('0xa2'))[_0x8ad6('0xa3')]([_0x8ad6('0xa7'),_0x8ad6('0xa4'),_0x8ad6('0xa5'),_0x8ad6('0xb3'),_0x8ad6('0x62'),_0x8ad6('0xa6'),_0x8ad6('0x5b')],squel[_0x8ad6('0x82')]()[_0x8ad6('0x83')](_0x8ad6('0xa7'),_0x8ad6('0xa7'))[_0x8ad6('0x83')]('\x27'+_0x417b7d+'\x27',_0x8ad6('0xa4'))[_0x8ad6('0x83')]('id',_0x8ad6('0xa5'))[_0x8ad6('0x83')](_0x5b8748[_0x8ad6('0xa8')][_0x8ad6('0x8a')](),'ListId')[_0x8ad6('0x83')](_0xa807a8[_0x8ad6('0x4b')]['id'][_0x8ad6('0x8a')](),'VoiceQueueId')[_0x8ad6('0x83')]('\x27'+_0x417b7d+'\x27',_0x8ad6('0xa6'))[_0x8ad6('0x83')]('\x27'+_0x417b7d+'\x27','updatedAt')[_0x8ad6('0x85')](_0x8ad6('0xa9'))[_0x8ad6('0x40')](_0x8ad6('0xaa'))[_0x8ad6('0x40')](_0x8ad6('0xab'),_0x5b8748[_0x8ad6('0xa8')]['toString']())[_0x8ad6('0x40')]('phone\x20IS\x20NOT\x20NULL'))[_0x8ad6('0x8a')]();}_0x37f6af[_0x8ad6('0x89')](db['sequelize'][_0x8ad6('0x38')](_0x2852af));}return BPromise[_0x8ad6('0x96')](_0x37f6af);}})[_0x8ad6('0x27')](function(){var _0x2727be=[];var _0x3a01d3=squel[_0x8ad6('0xb2')]()[_0x8ad6('0xa1')](_0x8ad6('0xb5'))[_0x8ad6('0xa3')]([_0x8ad6('0xb6'),_0x8ad6('0xa7'),_0x8ad6('0xb7'),_0x8ad6('0xa6'),_0x8ad6('0x5b')],squel[_0x8ad6('0x82')]()[_0x8ad6('0x83')]('h.id')['field'](_0x8ad6('0xb8'))[_0x8ad6('0x83')]('ci.OrderBy+1')[_0x8ad6('0x83')]('\x27'+_0x417b7d+'\x27','createdAt')['field']('\x27'+_0x417b7d+'\x27',_0x8ad6('0x5b'))[_0x8ad6('0x85')](_0x8ad6('0xb9'),'ci')[_0x8ad6('0xba')]('cm_hopper','h',_0x8ad6('0xbb'))[_0x8ad6('0x40')](_0x8ad6('0xbc'),_0x417b7d)[_0x8ad6('0x40')]('ci.ItemClass=?',_0x8ad6('0xbd')))[_0x8ad6('0x8a')]();_0x2727be[_0x8ad6('0x89')](db[_0x8ad6('0x90')]['query'](_0x3a01d3));return BPromise[_0x8ad6('0x96')](_0x2727be);})[_0x8ad6('0x27')](function(){return _0x112ba4;})[_0x8ad6('0x27')](respondWithResult(_0x100472,null))[_0x8ad6('0x4f')](handleError(_0x100472,null));};exports[_0x8ad6('0xbe')]=function(_0x5b4387,_0x34f444,_0x2dd8f0){return db['VoiceQueue'][_0x8ad6('0x5d')]({'where':{'id':_0x5b4387[_0x8ad6('0x4b')]['id']}})[_0x8ad6('0x27')](handleEntityNotFound(_0x34f444,null))[_0x8ad6('0x27')](function(_0x24ac1e){if(_0x24ac1e){return _0x24ac1e[_0x8ad6('0xbe')](_0x5b4387['query'][_0x8ad6('0x94')]);}})['then'](function(_0x2c0cd8){if(_0x2c0cd8){return db[_0x8ad6('0x61')][_0x8ad6('0x26')]({'where':{'ListId':_0x5b4387['query'][_0x8ad6('0x94')],'VoiceQueueId':_0x5b4387[_0x8ad6('0x4b')]['id']}})[_0x8ad6('0x27')](function(){return _0x2c0cd8;});}})['then'](respondWithStatusCode(_0x34f444,null))['catch'](handleError(_0x34f444,null));};exports[_0x8ad6('0xbf')]=function(_0x4482d2,_0x25bd7c,_0x4152b2){var _0x4c182c={};var _0x414271={};var _0x1f503c;var _0x46f2e6;return db[_0x8ad6('0x45')][_0x8ad6('0x60')]({'where':{'id':_0x4482d2['params']['id']}})['then'](handleEntityNotFound(_0x25bd7c,null))['then'](function(_0x52773f){if(_0x52773f){_0x1f503c=_0x52773f;_0x414271[_0x8ad6('0x3c')]=_['keys'](db[_0x8ad6('0x9c')][_0x8ad6('0x36')]);_0x414271[_0x8ad6('0x38')]=_[_0x8ad6('0x4c')](_0x4482d2[_0x8ad6('0x38')]);_0x414271[_0x8ad6('0x39')]=_[_0x8ad6('0x3a')](_0x414271[_0x8ad6('0x3c')],_0x414271[_0x8ad6('0x38')]);_0x4c182c[_0x8ad6('0x3b')]=_[_0x8ad6('0x3a')](_0x414271[_0x8ad6('0x3c')],qs[_0x8ad6('0x4d')](_0x4482d2['query'][_0x8ad6('0x4d')]));_0x4c182c[_0x8ad6('0x3b')]=_0x4c182c[_0x8ad6('0x3b')][_0x8ad6('0x4e')]?_0x4c182c['attributes']:_0x414271[_0x8ad6('0x3c')];_0x4c182c['order']=qs['sort'](_0x4482d2[_0x8ad6('0x38')][_0x8ad6('0x3f')]);_0x4c182c[_0x8ad6('0x40')]=qs['filters'](_[_0x8ad6('0x41')](_0x4482d2[_0x8ad6('0x38')],_0x414271['filters']));if(_0x4482d2[_0x8ad6('0x38')][_0x8ad6('0x2d')]){_0x4c182c['where']=_[_0x8ad6('0x42')](_0x4c182c[_0x8ad6('0x40')],{'$or':_[_0x8ad6('0x2f')](_0x4c182c['attributes'],function(_0x21ea72){var _0xd14dd={};_0xd14dd[_0x21ea72]={'$like':'%'+_0x4482d2[_0x8ad6('0x38')]['filter']+'%'};return _0xd14dd;})});}_0x4c182c=_[_0x8ad6('0x42')]({},_0x4c182c,_0x4482d2[_0x8ad6('0x44')]);return _0x1f503c['getBlackLists'](_0x4c182c);}})[_0x8ad6('0x27')](function(_0xcb2eb5){if(_0xcb2eb5){_0x46f2e6=_0xcb2eb5[_0x8ad6('0x4e')];if(!_0x4482d2['query'][_0x8ad6('0x3d')](_0x8ad6('0x3e'))){_0x4c182c[_0x8ad6('0x20')]=qs[_0x8ad6('0x20')](_0x4482d2[_0x8ad6('0x38')][_0x8ad6('0x20')]);_0x4c182c[_0x8ad6('0x1e')]=qs[_0x8ad6('0x1e')](_0x4482d2[_0x8ad6('0x38')]['offset']);}return _0x1f503c[_0x8ad6('0xbf')](_0x4c182c);}})['then'](function(_0x59523d){if(_0x59523d){return _0x59523d?{'count':_0x46f2e6,'rows':_0x59523d}:null;}})['then'](respondWithResult(_0x25bd7c,null))[_0x8ad6('0x4f')](handleError(_0x25bd7c,null));};exports[_0x8ad6('0xc0')]=function(_0xd8a8e9,_0x478894,_0x2f5b39){var _0x300a35,_0xba1338;return db['VoiceQueue'][_0x8ad6('0x5d')]({'where':{'id':_0xd8a8e9[_0x8ad6('0x4b')]['id']}})[_0x8ad6('0x27')](handleEntityNotFound(_0x478894,null))[_0x8ad6('0x27')](function(_0xd2ad02){if(_0xd2ad02){_0xba1338=_0xd2ad02;return _0xd2ad02[_0x8ad6('0xc0')](_0xd8a8e9[_0x8ad6('0x51')][_0x8ad6('0x94')],_[_0x8ad6('0x5c')](_0xd8a8e9[_0x8ad6('0x51')],[_0x8ad6('0x94'),'id'])||{});}return null;})[_0x8ad6('0x95')](function(_0x14e3e3){var _0x179da8;_0x300a35=_0x14e3e3||[];var _0x276bf6=[];if(_0x14e3e3){for(var _0x217c84=0x0;_0x217c84<_0x14e3e3[_0x8ad6('0x4e')];_0x217c84+=0x1){var _0x20eb78=_0x14e3e3[_0x217c84][_0x8ad6('0x28')]({'plain':!![]});_0x179da8=squel['insert']()[_0x8ad6('0xa1')](_0x8ad6('0xc1'))[_0x8ad6('0xa3')]([_0x8ad6('0xa7'),_0x8ad6('0xa5'),_0x8ad6('0xb3'),'VoiceQueueId',_0x8ad6('0xa6'),_0x8ad6('0x5b')],squel['select']()[_0x8ad6('0x83')]('phone',_0x8ad6('0xa7'))['field']('id',_0x8ad6('0xa5'))['field'](_0x20eb78['CmListId']['toString'](),_0x8ad6('0xb3'))[_0x8ad6('0x83')](_0xd8a8e9[_0x8ad6('0x4b')]['id'][_0x8ad6('0x8a')](),_0x8ad6('0x62'))[_0x8ad6('0x83')](_0x8ad6('0xc2'),_0x8ad6('0xa6'))[_0x8ad6('0x83')]('NOW()','updatedAt')[_0x8ad6('0x85')](_0x8ad6('0xa9'))['where'](_0x8ad6('0xaa'))[_0x8ad6('0x40')]('ListId\x20=\x20?',_0x20eb78[_0x8ad6('0xa8')][_0x8ad6('0x8a')]())[_0x8ad6('0x40')]('phone\x20IS\x20NOT\x20NULL'))[_0x8ad6('0x8a')]();_0x276bf6[_0x8ad6('0x89')](db[_0x8ad6('0x90')][_0x8ad6('0x38')](_0x179da8));}return BPromise[_0x8ad6('0x96')](_0x276bf6);}})[_0x8ad6('0x27')](function(){return _0x300a35;})['then'](respondWithResult(_0x478894,null))[_0x8ad6('0x4f')](handleError(_0x478894,null));};exports[_0x8ad6('0xc3')]=function(_0x1ec387,_0x47d176,_0x410366){return db[_0x8ad6('0x45')]['find']({'where':{'id':_0x1ec387[_0x8ad6('0x4b')]['id']}})[_0x8ad6('0x27')](handleEntityNotFound(_0x47d176,null))[_0x8ad6('0x27')](function(_0x3ab366){if(_0x3ab366){return _0x3ab366[_0x8ad6('0xc3')](_0x1ec387[_0x8ad6('0x38')][_0x8ad6('0x94')]);}})[_0x8ad6('0x27')](function(_0x373dc1){if(_0x373dc1){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x1ec387[_0x8ad6('0x38')]['ids'],'VoiceQueueId':_0x1ec387[_0x8ad6('0x4b')]['id']}})[_0x8ad6('0x27')](function(){return _0x373dc1;});}})[_0x8ad6('0x27')](respondWithStatusCode(_0x47d176,null))[_0x8ad6('0x4f')](handleError(_0x47d176,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 809e9fe..7cdeecc 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 _0xdbd3=['emit','hasOwnProperty','hook','exports','events','VoiceQueue','setMaxListeners','save','remove'];(function(_0xe3363e,_0x2e0093){var _0x4e15fa=function(_0x46c139){while(--_0x46c139){_0xe3363e['push'](_0xe3363e['shift']());}};_0x4e15fa(++_0x2e0093);}(_0xdbd3,0x11b));var _0x3dbd=function(_0x56b794,_0x50003f){_0x56b794=_0x56b794-0x0;var _0x80c80=_0xdbd3[_0x56b794];return _0x80c80;};'use strict';var EventEmitter=require(_0x3dbd('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0x3dbd('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x3dbd('0x2')](0x0);var events={'afterCreate':_0x3dbd('0x3'),'afterUpdate':'update','afterDestroy':_0x3dbd('0x4')};function emitEvent(_0x3d1a93){return function(_0x3ae49c,_0x593ef5,_0x4ba4c3){VoiceQueueEvents[_0x3dbd('0x5')](_0x3d1a93+':'+_0x3ae49c['id'],_0x3ae49c);VoiceQueueEvents[_0x3dbd('0x5')](_0x3d1a93,_0x3ae49c);_0x4ba4c3(null);};}for(var e in events){if(events[_0x3dbd('0x6')](e)){var event=events[e];VoiceQueue[_0x3dbd('0x7')](e,emitEvent(event));}}module[_0x3dbd('0x8')]=VoiceQueueEvents; \ No newline at end of file +var _0x4809=['exports','../../mysqldb','VoiceQueue','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x5da14a,_0x42113c){var _0x10c536=function(_0x5f5d9e){while(--_0x5f5d9e){_0x5da14a['push'](_0x5da14a['shift']());}};_0x10c536(++_0x42113c);}(_0x4809,0x172));var _0x9480=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0x4809[_0x1a9204];return _0x17ca68;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x9480('0x0'))['db'][_0x9480('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9480('0x2'),'afterUpdate':_0x9480('0x3'),'afterDestroy':_0x9480('0x4')};function emitEvent(_0x17b5f0){return function(_0x353bb3,_0x4ddc98,_0x412d49){VoiceQueueEvents[_0x9480('0x5')](_0x17b5f0+':'+_0x353bb3['id'],_0x353bb3);VoiceQueueEvents[_0x9480('0x5')](_0x17b5f0,_0x353bb3);_0x412d49(null);};}for(var e in events){if(events[_0x9480('0x6')](e)){var event=events[e];VoiceQueue[_0x9480('0x7')](e,emitEvent(event));}}module[_0x9480('0x8')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index ec0b94b..ccac24a 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 _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueue.attributes','exports','VoiceQueue','util'];(function(_0x465944,_0x511fd7){var _0x58c6cb=function(_0x1a4f5c){while(--_0x1a4f5c){_0x465944['push'](_0x465944['shift']());}};_0x58c6cb(++_0x511fd7);}(_0xedd9,0xfc));var _0x9edd=function(_0x1501e8,_0x44af89){_0x1501e8=_0x1501e8-0x0;var _0x96cc6=_0xedd9[_0x1501e8];return _0x96cc6;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34e8=['voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue'];(function(_0x4e52d0,_0x1e0ef4){var _0x5b4cc5=function(_0x55c7f3){while(--_0x55c7f3){_0x4e52d0['push'](_0x4e52d0['shift']());}};_0x5b4cc5(++_0x1e0ef4);}(_0x34e8,0x12c));var _0x834e=function(_0x27fb57,_0x5c4583){_0x27fb57=_0x27fb57-0x0;var _0x536b06=_0x34e8[_0x27fb57];return _0x536b06;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 893d631..2938f74 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 _0x6400=['message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowVoiceQueue','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','socket.io-emitter','redis','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6400,0xb3));var _0x0640=function(_0x304600,_0x4ecdfe){_0x304600=_0x304600-0x0;var _0x337878=_0x6400[_0x304600];return _0x337878;};'use strict';var _=require(_0x0640('0x0'));var util=require(_0x0640('0x1'));var moment=require(_0x0640('0x2'));var BPromise=require(_0x0640('0x3'));var rs=require(_0x0640('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0640('0x5'))(_0x0640('0x6'));var config=require(_0x0640('0x7'));var jayson=require(_0x0640('0x8'));var client=jayson[_0x0640('0x9')][_0x0640('0xa')]({'port':0x232a});config['redis']=_[_0x0640('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0640('0xc'))(new Redis(config[_0x0640('0xd')]));require(_0x0640('0xe'))[_0x0640('0xf')](socket);function respondWithRpcPromise(_0x49877c,_0x454ebb,_0x48126a){return new BPromise(function(_0x5d38f8,_0x56fee3){return client[_0x0640('0x10')](_0x49877c,_0x48126a)[_0x0640('0x11')](function(_0x5b0062){logger[_0x0640('0x12')](_0x0640('0x13'),_0x454ebb,_0x0640('0x14'));logger[_0x0640('0x15')](_0x0640('0x16'),_0x454ebb,_0x0640('0x14'),JSON[_0x0640('0x17')](_0x5b0062));if(_0x5b0062['error']){if(_0x5b0062['error'][_0x0640('0x18')]===0x1f4){logger[_0x0640('0x19')](_0x0640('0x13'),_0x454ebb,_0x5b0062[_0x0640('0x19')]['message']);return _0x56fee3(_0x5b0062[_0x0640('0x19')][_0x0640('0x1a')]);}logger[_0x0640('0x19')](_0x0640('0x13'),_0x454ebb,_0x5b0062[_0x0640('0x19')][_0x0640('0x1a')]);return _0x5d38f8(_0x5b0062['error'][_0x0640('0x1a')]);}else{logger[_0x0640('0x12')](_0x0640('0x13'),_0x454ebb,_0x0640('0x14'));_0x5d38f8(_0x5b0062[_0x0640('0x1b')]['message']);}})[_0x0640('0x1c')](function(_0x403346){logger[_0x0640('0x19')]('VoiceQueue,\x20%s,\x20%s',_0x454ebb,_0x403346);_0x56fee3(_0x403346);});});}exports[_0x0640('0x1d')]=function(_0x23f00a){var _0x1030f6=this;return new Promise(function(_0x5d3852,_0x14c11f){return db[_0x0640('0x1e')][_0x0640('0x1f')]({'raw':_0x23f00a[_0x0640('0x20')]?_0x23f00a[_0x0640('0x20')][_0x0640('0x21')]===undefined?!![]:![]:!![],'where':_0x23f00a['options']?_0x23f00a[_0x0640('0x20')][_0x0640('0x22')]||null:null,'attributes':_0x23f00a[_0x0640('0x20')]?_0x23f00a['options'][_0x0640('0x23')]||null:null,'limit':_0x23f00a['options']?_0x23f00a[_0x0640('0x20')][_0x0640('0x24')]||null:null,'include':_0x23f00a[_0x0640('0x20')]?_0x23f00a[_0x0640('0x20')][_0x0640('0x25')]?_['map'](_0x23f00a[_0x0640('0x20')][_0x0640('0x25')],function(_0x341780){return{'model':db[_0x341780['model']],'as':_0x341780['as'],'attributes':_0x341780[_0x0640('0x23')],'include':_0x341780[_0x0640('0x25')]?_[_0x0640('0x26')](_0x341780[_0x0640('0x25')],function(_0x5145e4){return{'model':db[_0x5145e4['model']],'as':_0x5145e4['as'],'attributes':_0x5145e4[_0x0640('0x23')],'include':_0x5145e4['include']?_[_0x0640('0x26')](_0x5145e4[_0x0640('0x25')],function(_0x4319fd){return{'model':db[_0x4319fd[_0x0640('0x27')]],'as':_0x4319fd['as'],'attributes':_0x4319fd[_0x0640('0x23')]};}):[]};}):[]};}):[]:[]})[_0x0640('0x11')](function(_0x20d2b1){logger[_0x0640('0x12')](_0x0640('0x1d'),_0x23f00a);logger['debug'](_0x0640('0x1d'),_0x23f00a,JSON[_0x0640('0x17')](_0x20d2b1));_0x5d3852(_0x20d2b1);})[_0x0640('0x1c')](function(_0x2d8e1c){logger[_0x0640('0x19')]('GetVoiceQueue',_0x2d8e1c[_0x0640('0x1a')],_0x23f00a);_0x14c11f(_0x1030f6[_0x0640('0x19')](0x1f4,_0x2d8e1c[_0x0640('0x1a')]));});});};exports[_0x0640('0x28')]=function(_0x4b66e4){var _0x11ed4a=this;return new Promise(function(_0x11f661,_0x44d8e4){return db[_0x0640('0x1e')]['find']({'raw':_0x4b66e4[_0x0640('0x20')]?_0x4b66e4[_0x0640('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x4b66e4['options']?_0x4b66e4[_0x0640('0x20')][_0x0640('0x22')]||null:null,'attributes':_0x4b66e4[_0x0640('0x20')]?_0x4b66e4['options']['attributes']||null:null,'include':_0x4b66e4[_0x0640('0x20')]?_0x4b66e4[_0x0640('0x20')][_0x0640('0x25')]?_[_0x0640('0x26')](_0x4b66e4['options'][_0x0640('0x25')],function(_0x24c810){return{'model':db[_0x24c810[_0x0640('0x27')]],'as':_0x24c810['as'],'attributes':_0x24c810[_0x0640('0x23')],'include':_0x24c810['include']?_[_0x0640('0x26')](_0x24c810[_0x0640('0x25')],function(_0x199291){return{'model':db[_0x199291['model']],'as':_0x199291['as'],'attributes':_0x199291[_0x0640('0x23')],'include':_0x199291[_0x0640('0x25')]?_[_0x0640('0x26')](_0x199291[_0x0640('0x25')],function(_0x29c5d1){return{'model':db[_0x29c5d1[_0x0640('0x27')]],'as':_0x29c5d1['as'],'attributes':_0x29c5d1[_0x0640('0x23')]};}):[]};}):[]};}):[]:[]})[_0x0640('0x11')](function(_0x2c575e){logger[_0x0640('0x12')]('ShowVoiceQueue',_0x4b66e4);logger[_0x0640('0x15')](_0x0640('0x28'),_0x4b66e4,JSON[_0x0640('0x17')](_0x2c575e));_0x11f661(_0x2c575e);})[_0x0640('0x1c')](function(_0x1c1d62){logger['error'](_0x0640('0x28'),_0x1c1d62[_0x0640('0x1a')],_0x4b66e4);_0x44d8e4(_0x11ed4a['error'](0x1f4,_0x1c1d62[_0x0640('0x1a')]));});});}; \ No newline at end of file +var _0x1817=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceQueue','findAll','options','raw','attributes','limit','include','map','model','stringify','ShowVoiceQueue','find','where','lodash','moment','bluebird','randomstring','ioredis'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x1817,0xcd));var _0x7181=function(_0x450791,_0x126560){_0x450791=_0x450791-0x0;var _0x2015e5=_0x1817[_0x450791];return _0x2015e5;};'use strict';var _=require(_0x7181('0x0'));var util=require('util');var moment=require(_0x7181('0x1'));var BPromise=require(_0x7181('0x2'));var rs=require(_0x7181('0x3'));var fs=require('fs');var Redis=require(_0x7181('0x4'));var db=require(_0x7181('0x5'))['db'];var utils=require(_0x7181('0x6'));var logger=require('../../config/logger')(_0x7181('0x7'));var config=require(_0x7181('0x8'));var jayson=require(_0x7181('0x9'));var client=jayson[_0x7181('0xa')][_0x7181('0xb')]({'port':0x232a});config[_0x7181('0xc')]=_[_0x7181('0xd')](config[_0x7181('0xc')],{'host':_0x7181('0xe'),'port':0x18eb});var socket=require(_0x7181('0xf'))(new Redis(config[_0x7181('0xc')]));require(_0x7181('0x10'))[_0x7181('0x11')](socket);function respondWithRpcPromise(_0x10aaba,_0x27af94,_0x503ca0){return new BPromise(function(_0xff44d6,_0x36f33b){return client['request'](_0x10aaba,_0x503ca0)[_0x7181('0x12')](function(_0x2314c8){logger[_0x7181('0x13')](_0x7181('0x14'),_0x27af94,_0x7181('0x15'));logger[_0x7181('0x16')](_0x7181('0x17'),_0x27af94,_0x7181('0x15'),JSON['stringify'](_0x2314c8));if(_0x2314c8['error']){if(_0x2314c8[_0x7181('0x18')][_0x7181('0x19')]===0x1f4){logger['error'](_0x7181('0x14'),_0x27af94,_0x2314c8[_0x7181('0x18')][_0x7181('0x1a')]);return _0x36f33b(_0x2314c8[_0x7181('0x18')][_0x7181('0x1a')]);}logger[_0x7181('0x18')](_0x7181('0x14'),_0x27af94,_0x2314c8[_0x7181('0x18')][_0x7181('0x1a')]);return _0xff44d6(_0x2314c8[_0x7181('0x18')][_0x7181('0x1a')]);}else{logger[_0x7181('0x13')](_0x7181('0x14'),_0x27af94,_0x7181('0x15'));_0xff44d6(_0x2314c8[_0x7181('0x1b')][_0x7181('0x1a')]);}})[_0x7181('0x1c')](function(_0x3dfe55){logger[_0x7181('0x18')](_0x7181('0x14'),_0x27af94,_0x3dfe55);_0x36f33b(_0x3dfe55);});});}exports[_0x7181('0x1d')]=function(_0x24396c){var _0xfbca09=this;return new Promise(function(_0x247067,_0x41486e){return db['VoiceQueue'][_0x7181('0x1e')]({'raw':_0x24396c[_0x7181('0x1f')]?_0x24396c['options'][_0x7181('0x20')]===undefined?!![]:![]:!![],'where':_0x24396c[_0x7181('0x1f')]?_0x24396c[_0x7181('0x1f')]['where']||null:null,'attributes':_0x24396c[_0x7181('0x1f')]?_0x24396c[_0x7181('0x1f')][_0x7181('0x21')]||null:null,'limit':_0x24396c['options']?_0x24396c[_0x7181('0x1f')][_0x7181('0x22')]||null:null,'include':_0x24396c['options']?_0x24396c[_0x7181('0x1f')]['include']?_['map'](_0x24396c[_0x7181('0x1f')][_0x7181('0x23')],function(_0x18e2c6){return{'model':db[_0x18e2c6['model']],'as':_0x18e2c6['as'],'attributes':_0x18e2c6[_0x7181('0x21')],'include':_0x18e2c6['include']?_[_0x7181('0x24')](_0x18e2c6[_0x7181('0x23')],function(_0x8e33f3){return{'model':db[_0x8e33f3['model']],'as':_0x8e33f3['as'],'attributes':_0x8e33f3[_0x7181('0x21')],'include':_0x8e33f3['include']?_[_0x7181('0x24')](_0x8e33f3[_0x7181('0x23')],function(_0x2306a0){return{'model':db[_0x2306a0[_0x7181('0x25')]],'as':_0x2306a0['as'],'attributes':_0x2306a0[_0x7181('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x14a9d6){logger[_0x7181('0x13')]('GetVoiceQueue',_0x24396c);logger[_0x7181('0x16')]('GetVoiceQueue',_0x24396c,JSON[_0x7181('0x26')](_0x14a9d6));_0x247067(_0x14a9d6);})[_0x7181('0x1c')](function(_0x100fc9){logger[_0x7181('0x18')](_0x7181('0x1d'),_0x100fc9[_0x7181('0x1a')],_0x24396c);_0x41486e(_0xfbca09[_0x7181('0x18')](0x1f4,_0x100fc9[_0x7181('0x1a')]));});});};exports[_0x7181('0x27')]=function(_0x9e1955){var _0xacd7d2=this;return new Promise(function(_0x53bf77,_0x545d01){return db['VoiceQueue'][_0x7181('0x28')]({'raw':_0x9e1955[_0x7181('0x1f')]?_0x9e1955[_0x7181('0x1f')][_0x7181('0x20')]===undefined?!![]:![]:!![],'where':_0x9e1955[_0x7181('0x1f')]?_0x9e1955[_0x7181('0x1f')][_0x7181('0x29')]||null:null,'attributes':_0x9e1955[_0x7181('0x1f')]?_0x9e1955[_0x7181('0x1f')][_0x7181('0x21')]||null:null,'include':_0x9e1955[_0x7181('0x1f')]?_0x9e1955[_0x7181('0x1f')][_0x7181('0x23')]?_[_0x7181('0x24')](_0x9e1955['options'][_0x7181('0x23')],function(_0x4fdd28){return{'model':db[_0x4fdd28['model']],'as':_0x4fdd28['as'],'attributes':_0x4fdd28[_0x7181('0x21')],'include':_0x4fdd28[_0x7181('0x23')]?_['map'](_0x4fdd28[_0x7181('0x23')],function(_0x383bae){return{'model':db[_0x383bae[_0x7181('0x25')]],'as':_0x383bae['as'],'attributes':_0x383bae[_0x7181('0x21')],'include':_0x383bae[_0x7181('0x23')]?_[_0x7181('0x24')](_0x383bae[_0x7181('0x23')],function(_0x948304){return{'model':db[_0x948304['model']],'as':_0x948304['as'],'attributes':_0x948304[_0x7181('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xe03a56){logger[_0x7181('0x13')]('ShowVoiceQueue',_0x9e1955);logger[_0x7181('0x16')](_0x7181('0x27'),_0x9e1955,JSON[_0x7181('0x26')](_0xe03a56));_0x53bf77(_0xe03a56);})[_0x7181('0x1c')](function(_0x1866ac){logger[_0x7181('0x18')](_0x7181('0x27'),_0x1866ac['message'],_0x9e1955);_0x545d01(_0xacd7d2[_0x7181('0x18')](0x1f4,_0x1866ac[_0x7181('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index aa97ad3..96d3807 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 _0xb244=['./voiceQueue.events','save','remove','update','emit','removeListener','register','length','voiceQueue:'];(function(_0x5e4563,_0x3ff918){var _0x8d1bf5=function(_0x3bf7a9){while(--_0x3bf7a9){_0x5e4563['push'](_0x5e4563['shift']());}};_0x8d1bf5(++_0x3ff918);}(_0xb244,0x156));var _0x4b24=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xb244[_0x160c73];return _0xd9302;};'use strict';var VoiceQueueEvents=require(_0x4b24('0x0'));var events=[_0x4b24('0x1'),_0x4b24('0x2'),_0x4b24('0x3')];function createListener(_0x116790,_0x25af45){return function(_0x1a0ae3){_0x25af45[_0x4b24('0x4')](_0x116790,_0x1a0ae3);};}function removeListener(_0x528021,_0x5b1949){return function(){VoiceQueueEvents[_0x4b24('0x5')](_0x528021,_0x5b1949);};}exports[_0x4b24('0x6')]=function(_0x1e1ea8){for(var _0x57a4da=0x0,_0x4644df=events[_0x4b24('0x7')];_0x57a4da<_0x4644df;_0x57a4da++){var _0x2f94a8=events[_0x57a4da];var _0x238a84=createListener(_0x4b24('0x8')+_0x2f94a8,_0x1e1ea8);VoiceQueueEvents['on'](_0x2f94a8,_0x238a84);}}; \ No newline at end of file +var _0xde98=['emit','removeListener','register','./voiceQueue.events','save','remove'];(function(_0x3a623f,_0x3e46e0){var _0x56b7d1=function(_0x1e74d6){while(--_0x1e74d6){_0x3a623f['push'](_0x3a623f['shift']());}};_0x56b7d1(++_0x3e46e0);}(_0xde98,0x1e9));var _0x8de9=function(_0x2f9b60,_0x4f482c){_0x2f9b60=_0x2f9b60-0x0;var _0x82275b=_0xde98[_0x2f9b60];return _0x82275b;};'use strict';var VoiceQueueEvents=require(_0x8de9('0x0'));var events=[_0x8de9('0x1'),_0x8de9('0x2'),'update'];function createListener(_0x40c719,_0x41c951){return function(_0x478bda){_0x41c951[_0x8de9('0x3')](_0x40c719,_0x478bda);};}function removeListener(_0x3aaf73,_0x11c950){return function(){VoiceQueueEvents[_0x8de9('0x4')](_0x3aaf73,_0x11c950);};}exports[_0x8de9('0x5')]=function(_0x5c498a){for(var _0x127e30=0x0,_0x30ae3f=events['length'];_0x127e30<_0x30ae3f;_0x127e30++){var _0x3f9ed4=events[_0x127e30];var _0x2fafa8=createListener('voiceQueue:'+_0x3f9ed4,_0x5c498a);VoiceQueueEvents['on'](_0x3f9ed4,_0x2fafa8);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 59b98de..a2303e2 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 _0x19f6=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','/index','/:id','show','post','create','put','update','multer','util','connect-timeout','express'];(function(_0x15ea45,_0x20d2ae){var _0x5aaf79=function(_0x3c47fe){while(--_0x3c47fe){_0x15ea45['push'](_0x15ea45['shift']());}};_0x5aaf79(++_0x20d2ae);}(_0x19f6,0x1f0));var _0x619f=function(_0x43bed9,_0x26adca){_0x43bed9=_0x43bed9-0x0;var _0x27b03d=_0x19f6[_0x43bed9];return _0x27b03d;};'use strict';var multer=require(_0x619f('0x0'));var util=require(_0x619f('0x1'));var path=require('path');var timeout=require(_0x619f('0x2'));var express=require(_0x619f('0x3'));var router=express[_0x619f('0x4')]();var fs_extra=require(_0x619f('0x5'));var auth=require(_0x619f('0x6'));var interaction=require(_0x619f('0x7'));var config=require('../../config/environment');var controller=require(_0x619f('0x8'));router[_0x619f('0x9')]('/',auth[_0x619f('0xa')](),controller[_0x619f('0xb')]);router[_0x619f('0x9')](_0x619f('0xc'),auth[_0x619f('0xa')](),controller['describe']);router[_0x619f('0x9')](_0x619f('0xd'),auth[_0x619f('0xa')](),controller['getVoiceQueuesReport']);router[_0x619f('0x9')](_0x619f('0xe'),auth['isAuthenticated'](),controller[_0x619f('0xf')]);router[_0x619f('0x10')]('/',auth[_0x619f('0xa')](),controller[_0x619f('0x11')]);router[_0x619f('0x12')](_0x619f('0xe'),auth[_0x619f('0xa')](),controller[_0x619f('0x13')]);router['delete']('/:id',auth[_0x619f('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xa7c3=['post','create','put','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','getVoiceQueuesReport','show'];(function(_0x5622f3,_0x1cc8f7){var _0x3df4ad=function(_0x267473){while(--_0x267473){_0x5622f3['push'](_0x5622f3['shift']());}};_0x3df4ad(++_0x1cc8f7);}(_0xa7c3,0x10a));var _0x3a7c=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xa7c3[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0x3a7c('0x0'));var util=require('util');var path=require(_0x3a7c('0x1'));var timeout=require('connect-timeout');var express=require(_0x3a7c('0x2'));var router=express[_0x3a7c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3a7c('0x4'));var interaction=require(_0x3a7c('0x5'));var config=require(_0x3a7c('0x6'));var controller=require(_0x3a7c('0x7'));router[_0x3a7c('0x8')]('/',auth[_0x3a7c('0x9')](),controller[_0x3a7c('0xa')]);router['get'](_0x3a7c('0xb'),auth[_0x3a7c('0x9')](),controller['describe']);router[_0x3a7c('0x8')]('/index',auth['isAuthenticated'](),controller[_0x3a7c('0xc')]);router[_0x3a7c('0x8')]('/:id',auth[_0x3a7c('0x9')](),controller[_0x3a7c('0xd')]);router[_0x3a7c('0xe')]('/',auth['isAuthenticated'](),controller[_0x3a7c('0xf')]);router[_0x3a7c('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x3a7c('0x11')]('/:id',auth[_0x3a7c('0x9')](),controller[_0x3a7c('0x12')]);module[_0x3a7c('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 3d56da2..5a9f039 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 _0xba0b=['DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','moment','exports','STRING'];(function(_0x81bf2f,_0x2a705e){var _0x447f8e=function(_0x22e247){while(--_0x22e247){_0x81bf2f['push'](_0x81bf2f['shift']());}};_0x447f8e(++_0x2a705e);}(_0xba0b,0xdd));var _0xbba0=function(_0x52152c,_0x40db38){_0x52152c=_0x52152c-0x0;var _0x23742a=_0xba0b[_0x52152c];return _0x23742a;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xbba0('0x0'));module[_0xbba0('0x1')]={'type':{'type':Sequelize[_0xbba0('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xbba0('0x2')]},'calleridname':{'type':Sequelize[_0xbba0('0x2')]},'queue':{'type':Sequelize[_0xbba0('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0xbba0('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0xbba0('0x3')],'set':function(_0x31ac0c){var _0x343c0b=moment(_0x31ac0c);var _0x5ae09a=moment(this[_0xbba0('0x4')](_0xbba0('0x5')))[_0xbba0('0x6')](_0xbba0('0x7'));var _0x4f30e2=_0x343c0b[_0xbba0('0x8')](_0x5ae09a,_0xbba0('0x9'));this[_0xbba0('0xa')]('queuecallerleaveAt',_0x31ac0c);this[_0xbba0('0xa')](_0xbba0('0xb'),_0x4f30e2||null);}},'position':{'type':Sequelize[_0xbba0('0xc')]},'count':{'type':Sequelize[_0xbba0('0xc')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xbba0('0x3')]},'queuecallercomplete':{'type':Sequelize[_0xbba0('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xbba0('0x3')]},'queuecallerexit':{'type':Sequelize[_0xbba0('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xbba0('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0xbba0('0x2')],'comment':_0xbba0('0xe')},'originalposition':{'type':Sequelize[_0xbba0('0xc')]},'channel':{'type':Sequelize[_0xbba0('0x2')]},'connectedlinenum':{'type':Sequelize[_0xbba0('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xbba0('0x2')]},'context':{'type':Sequelize[_0xbba0('0x2')]},'exten':{'type':Sequelize[_0xbba0('0x2')]},'priority':{'type':Sequelize[_0xbba0('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xbba0('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xbba0('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xbba0('0x2')]},'transfer':{'type':Sequelize[_0xbba0('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xbba0('0x2')],'comment':_0xbba0('0xf')},'transferexten':{'type':Sequelize[_0xbba0('0x2')]},'transferuniqueid':{'type':Sequelize[_0xbba0('0x2')]},'disposition':{'type':Sequelize[_0xbba0('0x2')]},'secondDisposition':{'type':Sequelize[_0xbba0('0x2')]},'thirdDisposition':{'type':Sequelize[_0xbba0('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0xbba0('0xc')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9457=['YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue','holdtime','INTEGER','BOOLEAN','moment','exports','STRING','DATE','queuecallerjoinAt','format'];(function(_0x5cd253,_0x4162da){var _0x36e179=function(_0x597977){while(--_0x597977){_0x5cd253['push'](_0x5cd253['shift']());}};_0x36e179(++_0x4162da);}(_0x9457,0x156));var _0x7945=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9457[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x7945('0x0'));module[_0x7945('0x1')]={'type':{'type':Sequelize[_0x7945('0x2')]},'uniqueid':{'type':Sequelize[_0x7945('0x2')]},'calleridnum':{'type':Sequelize[_0x7945('0x2')]},'calleridname':{'type':Sequelize[_0x7945('0x2')]},'queue':{'type':Sequelize[_0x7945('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x7945('0x3')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x242f91){var _0x1fe4fa=moment(_0x242f91);var _0x52c26a=moment(this['getDataValue'](_0x7945('0x4')))[_0x7945('0x5')](_0x7945('0x6'));var _0x51ab27=_0x1fe4fa[_0x7945('0x7')](_0x52c26a,'seconds');this[_0x7945('0x8')]('queuecallerleaveAt',_0x242f91);this['setDataValue'](_0x7945('0x9'),_0x51ab27||null);}},'position':{'type':Sequelize[_0x7945('0xa')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x7945('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x7945('0x3')]},'queuecallerexit':{'type':Sequelize[_0x7945('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x7945('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x7945('0x2')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x7945('0xa')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x7945('0x2')]},'connectedlinename':{'type':Sequelize[_0x7945('0x2')]},'accountcode':{'type':Sequelize[_0x7945('0x2')]},'context':{'type':Sequelize[_0x7945('0x2')]},'exten':{'type':Sequelize[_0x7945('0x2')]},'priority':{'type':Sequelize[_0x7945('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x7945('0xa')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x7945('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x7945('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x7945('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x7945('0x2')]},'disposition':{'type':Sequelize[_0x7945('0x2')]},'secondDisposition':{'type':Sequelize[_0x7945('0x2')]},'thirdDisposition':{'type':Sequelize[_0x7945('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x7945('0xa')],'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 09a2f5a..0771707 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 _0x8616=['mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','redis','./voiceQueueReport.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','VoiceQueueReport','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','options','includeAll','include','rows','show','find','create','catch','body','describe','getVoiceQueuesReport','nolimit','pick','findAll','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x25c72c,_0x14f0ab){var _0x57e28b=function(_0x188d1e){while(--_0x188d1e){_0x25c72c['push'](_0x25c72c['shift']());}};_0x57e28b(++_0x14f0ab);}(_0x8616,0xd5));var _0x6861=function(_0x12ddb2,_0x5ad61e){_0x12ddb2=_0x12ddb2-0x0;var _0x10b6dd=_0x8616[_0x12ddb2];return _0x10b6dd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6861('0x0'));var zipdir=require(_0x6861('0x1'));var jsonpatch=require(_0x6861('0x2'));var rp=require(_0x6861('0x3'));var moment=require(_0x6861('0x4'));var BPromise=require(_0x6861('0x5'));var Mustache=require(_0x6861('0x6'));var util=require(_0x6861('0x7'));var path=require(_0x6861('0x8'));var sox=require('sox');var csv=require(_0x6861('0x9'));var ejs=require(_0x6861('0xa'));var fs=require('fs');var fs_extra=require(_0x6861('0xb'));var _=require('lodash');var squel=require(_0x6861('0xc'));var crypto=require('crypto');var jsforce=require(_0x6861('0xd'));var deskjs=require(_0x6861('0xe'));var toCsv=require(_0x6861('0x9'));var querystring=require(_0x6861('0xf'));var Papa=require(_0x6861('0x10'));var Redis=require(_0x6861('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6861('0x12'));var as=require(_0x6861('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x6861('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x6861('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6861('0x15')]));require(_0x6861('0x16'))[_0x6861('0x17')](socket);function respondWithStatusCode(_0x281640,_0x14ca62){_0x14ca62=_0x14ca62||0xcc;return function(_0x245dd0){if(_0x245dd0){return _0x281640[_0x6861('0x18')](_0x14ca62);}return _0x281640[_0x6861('0x19')](_0x14ca62)[_0x6861('0x1a')]();};}function respondWithResult(_0x1c39d2,_0x4eb520){_0x4eb520=_0x4eb520||0xc8;return function(_0x3f360e){if(_0x3f360e){return _0x1c39d2[_0x6861('0x19')](_0x4eb520)['json'](_0x3f360e);}};}function respondWithFilteredResult(_0x2bd677,_0x4cef3e){return function(_0x573bb0){if(_0x573bb0){var _0x314036=typeof _0x4cef3e[_0x6861('0x1b')]===_0x6861('0x1c')&&typeof _0x4cef3e[_0x6861('0x1d')]===_0x6861('0x1c');var _0x38d34f=_0x573bb0[_0x6861('0x1e')];var _0x271e83=_0x314036?0x0:_0x4cef3e[_0x6861('0x1b')];var _0x19b5c1=_0x314036?_0x573bb0[_0x6861('0x1e')]:_0x4cef3e[_0x6861('0x1b')]+_0x4cef3e[_0x6861('0x1d')];var _0x3ce19b;if(_0x19b5c1>=_0x38d34f){_0x19b5c1=_0x38d34f;_0x3ce19b=0xc8;}else{_0x3ce19b=0xce;}_0x2bd677['status'](_0x3ce19b);return _0x2bd677[_0x6861('0x1f')](_0x6861('0x20'),_0x271e83+'-'+_0x19b5c1+'/'+_0x38d34f)['json'](_0x573bb0);}return null;};}function patchUpdates(_0x41295d){return function(_0x3801cf){try{jsonpatch['apply'](_0x3801cf,_0x41295d,!![]);}catch(_0x3af496){return BPromise[_0x6861('0x21')](_0x3af496);}return _0x3801cf[_0x6861('0x22')]();};}function saveUpdates(_0x31c2ea,_0x274771){return function(_0xcf8683){if(_0xcf8683){return _0xcf8683[_0x6861('0x23')](_0x31c2ea)[_0x6861('0x24')](function(_0xe4a290){return _0xe4a290;});}return null;};}function removeEntity(_0x4dcc73,_0x13fd5e){return function(_0x3203a7){if(_0x3203a7){return _0x3203a7[_0x6861('0x25')]()[_0x6861('0x24')](function(){_0x4dcc73[_0x6861('0x19')](0xcc)[_0x6861('0x1a')]();});}};}function handleEntityNotFound(_0x1c00b8,_0x4e1ecc){return function(_0x5b98fe){if(!_0x5b98fe){_0x1c00b8[_0x6861('0x18')](0x194);}return _0x5b98fe;};}function handleError(_0x2879dc,_0x7bfad3){_0x7bfad3=_0x7bfad3||0x1f4;return function(_0x18c5ec){logger[_0x6861('0x26')](_0x18c5ec[_0x6861('0x27')]);if(_0x18c5ec[_0x6861('0x28')]){delete _0x18c5ec[_0x6861('0x28')];}_0x2879dc[_0x6861('0x19')](_0x7bfad3)['send'](_0x18c5ec);};}exports[_0x6861('0x29')]=function(_0x5d4021,_0x507a72){var _0x1d57d6={},_0x8d08ed={},_0x4d5eb2={'count':0x0,'rows':[]};var _0x19376e=_[_0x6861('0x2a')](db[_0x6861('0x2b')][_0x6861('0x2c')],function(_0x5ac17e){return{'name':_0x5ac17e['fieldName'],'type':_0x5ac17e[_0x6861('0x2d')]['key']};});_0x8d08ed[_0x6861('0x2e')]=_[_0x6861('0x2a')](_0x19376e,_0x6861('0x28'));_0x8d08ed[_0x6861('0x2f')]=_[_0x6861('0x30')](_0x5d4021[_0x6861('0x2f')]);_0x8d08ed[_0x6861('0x31')]=_[_0x6861('0x32')](_0x8d08ed[_0x6861('0x2e')],_0x8d08ed[_0x6861('0x2f')]);_0x1d57d6[_0x6861('0x33')]=_[_0x6861('0x32')](_0x8d08ed[_0x6861('0x2e')],qs['fields'](_0x5d4021[_0x6861('0x2f')][_0x6861('0x34')]));_0x1d57d6[_0x6861('0x33')]=_0x1d57d6[_0x6861('0x33')][_0x6861('0x35')]?_0x1d57d6[_0x6861('0x33')]:_0x8d08ed[_0x6861('0x2e')];if(!_0x5d4021[_0x6861('0x2f')][_0x6861('0x36')]('nolimit')){_0x1d57d6[_0x6861('0x1d')]=qs['limit'](_0x5d4021[_0x6861('0x2f')][_0x6861('0x1d')]);_0x1d57d6[_0x6861('0x1b')]=qs[_0x6861('0x1b')](_0x5d4021['query'][_0x6861('0x1b')]);}_0x1d57d6['order']=qs['sort'](_0x5d4021[_0x6861('0x2f')][_0x6861('0x37')]);_0x1d57d6[_0x6861('0x38')]=qs[_0x6861('0x31')](_['pick'](_0x5d4021[_0x6861('0x2f')],_0x8d08ed[_0x6861('0x31')]),_0x19376e);if(_0x5d4021['query'][_0x6861('0x39')]){_0x1d57d6[_0x6861('0x38')]=_[_0x6861('0x3a')](_0x1d57d6[_0x6861('0x38')],{'$or':_[_0x6861('0x2a')](_0x19376e,function(_0x634315){if(_0x634315['type']!=='VIRTUAL'){var _0x4a4edb={};_0x4a4edb[_0x634315[_0x6861('0x28')]]={'$like':'%'+_0x5d4021[_0x6861('0x2f')][_0x6861('0x39')]+'%'};return _0x4a4edb;}})});}_0x1d57d6=_[_0x6861('0x3a')]({},_0x1d57d6,_0x5d4021[_0x6861('0x3b')]);var _0x86147b={'where':_0x1d57d6[_0x6861('0x38')]};return db[_0x6861('0x2b')][_0x6861('0x1e')](_0x86147b)['then'](function(_0x4e9936){_0x4d5eb2[_0x6861('0x1e')]=_0x4e9936;if(_0x5d4021[_0x6861('0x2f')][_0x6861('0x3c')]){_0x1d57d6[_0x6861('0x3d')]=[{'all':!![]}];}return db[_0x6861('0x2b')]['findAll'](_0x1d57d6);})['then'](function(_0xf4a403){_0x4d5eb2[_0x6861('0x3e')]=_0xf4a403;return _0x4d5eb2;})['then'](respondWithFilteredResult(_0x507a72,_0x1d57d6))['catch'](handleError(_0x507a72,null));};exports[_0x6861('0x3f')]=function(_0x13ac5f,_0x2c6a39){var _0x4e0d6e={'raw':![],'where':{'id':_0x13ac5f['params']['id']}},_0x4d9b5a={};_0x4d9b5a[_0x6861('0x2e')]=_[_0x6861('0x30')](db[_0x6861('0x2b')][_0x6861('0x2c')]);_0x4d9b5a[_0x6861('0x2f')]=_[_0x6861('0x30')](_0x13ac5f[_0x6861('0x2f')]);_0x4d9b5a[_0x6861('0x31')]=_[_0x6861('0x32')](_0x4d9b5a['model'],_0x4d9b5a['query']);_0x4e0d6e[_0x6861('0x33')]=_[_0x6861('0x32')](_0x4d9b5a[_0x6861('0x2e')],qs[_0x6861('0x34')](_0x13ac5f[_0x6861('0x2f')][_0x6861('0x34')]));_0x4e0d6e[_0x6861('0x33')]=_0x4e0d6e['attributes']['length']?_0x4e0d6e['attributes']:_0x4d9b5a[_0x6861('0x2e')];if(_0x13ac5f[_0x6861('0x2f')][_0x6861('0x3c')]){_0x4e0d6e[_0x6861('0x3d')]=[{'all':!![]}];}_0x4e0d6e=_[_0x6861('0x3a')]({},_0x4e0d6e,_0x13ac5f['options']);return db[_0x6861('0x2b')][_0x6861('0x40')](_0x4e0d6e)[_0x6861('0x24')](handleEntityNotFound(_0x2c6a39,null))[_0x6861('0x24')](respondWithResult(_0x2c6a39,null))['catch'](handleError(_0x2c6a39,null));};exports[_0x6861('0x41')]=function(_0x2920ab,_0x1c1c8a){return db[_0x6861('0x2b')][_0x6861('0x41')](_0x2920ab['body'],{})[_0x6861('0x24')](respondWithResult(_0x1c1c8a,0xc9))[_0x6861('0x42')](handleError(_0x1c1c8a,null));};exports[_0x6861('0x23')]=function(_0x347337,_0x4c02e0){if(_0x347337[_0x6861('0x43')]['id']){delete _0x347337[_0x6861('0x43')]['id'];}return db[_0x6861('0x2b')][_0x6861('0x40')]({'where':{'id':_0x347337['params']['id']}})[_0x6861('0x24')](handleEntityNotFound(_0x4c02e0,null))['then'](saveUpdates(_0x347337[_0x6861('0x43')],null))[_0x6861('0x24')](respondWithResult(_0x4c02e0,null))[_0x6861('0x42')](handleError(_0x4c02e0,null));};exports[_0x6861('0x25')]=function(_0x2b364c,_0x56dd28){return db[_0x6861('0x2b')]['find']({'where':{'id':_0x2b364c['params']['id']}})[_0x6861('0x24')](handleEntityNotFound(_0x56dd28,null))[_0x6861('0x24')](removeEntity(_0x56dd28,null))[_0x6861('0x42')](handleError(_0x56dd28,null));};exports[_0x6861('0x44')]=function(_0x38c4b7,_0x9e77c5){return db['VoiceQueueReport']['describe']()['then'](respondWithResult(_0x9e77c5,null))[_0x6861('0x42')](handleError(_0x9e77c5,null));};exports[_0x6861('0x45')]=function(_0x13bce0,_0x5278e6){var _0x5b115a={},_0x1e86ce={},_0x195f86={'count':0x0,'rows':[]};_0x1e86ce[_0x6861('0x2e')]=_[_0x6861('0x30')](db['VoiceQueueReport'][_0x6861('0x2c')]);_0x1e86ce['query']=_[_0x6861('0x30')](_0x13bce0[_0x6861('0x2f')]);_0x1e86ce[_0x6861('0x31')]=_[_0x6861('0x32')](_0x1e86ce[_0x6861('0x2e')],_0x1e86ce[_0x6861('0x2f')]);_0x5b115a['attributes']=_[_0x6861('0x32')](_0x1e86ce[_0x6861('0x2e')],qs[_0x6861('0x34')](_0x13bce0[_0x6861('0x2f')]['fields']));_0x5b115a[_0x6861('0x33')]=_0x5b115a[_0x6861('0x33')][_0x6861('0x35')]?_0x5b115a[_0x6861('0x33')]:_0x1e86ce[_0x6861('0x2e')];if(!_0x13bce0[_0x6861('0x2f')][_0x6861('0x36')](_0x6861('0x46'))){_0x5b115a[_0x6861('0x1d')]=qs[_0x6861('0x1d')](_0x13bce0[_0x6861('0x2f')][_0x6861('0x1d')]);_0x5b115a[_0x6861('0x1b')]=qs[_0x6861('0x1b')](_0x13bce0[_0x6861('0x2f')][_0x6861('0x1b')]);}_0x5b115a['order']=qs[_0x6861('0x37')](_0x13bce0['query'][_0x6861('0x37')]);_0x5b115a[_0x6861('0x38')]=qs[_0x6861('0x31')](_[_0x6861('0x47')](_0x13bce0[_0x6861('0x2f')],_0x1e86ce[_0x6861('0x31')]));if(_0x13bce0[_0x6861('0x2f')]['filter']){_0x5b115a[_0x6861('0x38')]=_['merge'](_0x5b115a[_0x6861('0x38')],{'$or':_[_0x6861('0x2a')](_0x5b115a[_0x6861('0x33')],function(_0x20c36d){var _0xb2826f={};_0xb2826f[_0x20c36d]={'$like':'%'+_0x13bce0['query'][_0x6861('0x39')]+'%'};return _0xb2826f;})});}_0x5b115a=_[_0x6861('0x3a')]({},_0x5b115a,_0x13bce0['options']);var _0x3879c0={'where':_0x5b115a[_0x6861('0x38')]};return db[_0x6861('0x2b')][_0x6861('0x1e')](_0x3879c0)[_0x6861('0x24')](function(_0x3f67b2){_0x195f86['count']=_0x3f67b2;if(_0x13bce0['query'][_0x6861('0x3c')]){_0x5b115a[_0x6861('0x3d')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x6861('0x48')](_0x5b115a);})['then'](function(_0x241385){_0x195f86['rows']=_0x241385;return _0x195f86;})[_0x6861('0x24')](respondWithFilteredResult(_0x5278e6,_0x5b115a,_0x6861('0x45')))['catch'](handleError(_0x5278e6,null,_0x6861('0x45')));}; \ No newline at end of file +var _0x3ff3=['crypto','jsforce','desk.js','../../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','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','name','send','index','map','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','include','VoiceQueueReport','findAll','rows','show','params','rawAttributes','includeAll','find','create','body','update','catch','describe','getVoiceQueuesReport','pick','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel'];(function(_0x40a713,_0x360aff){var _0x5125ab=function(_0x2369a3){while(--_0x2369a3){_0x40a713['push'](_0x40a713['shift']());}};_0x5125ab(++_0x360aff);}(_0x3ff3,0x138));var _0x33ff=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x3ff3[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0x33ff('0x0'));var rimraf=require(_0x33ff('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x33ff('0x2'));var rp=require(_0x33ff('0x3'));var moment=require(_0x33ff('0x4'));var BPromise=require(_0x33ff('0x5'));var Mustache=require(_0x33ff('0x6'));var util=require(_0x33ff('0x7'));var path=require('path');var sox=require(_0x33ff('0x8'));var csv=require(_0x33ff('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x33ff('0xa'));var _=require('lodash');var squel=require(_0x33ff('0xb'));var crypto=require(_0x33ff('0xc'));var jsforce=require(_0x33ff('0xd'));var deskjs=require(_0x33ff('0xe'));var toCsv=require(_0x33ff('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x33ff('0xf'));var qs=require(_0x33ff('0x10'));var as=require(_0x33ff('0x11'));var hardwareService=require(_0x33ff('0x12'));var logger=require('../../config/logger')(_0x33ff('0x13'));var utils=require(_0x33ff('0x14'));var config=require(_0x33ff('0x15'));var licenseUtil=require(_0x33ff('0x16'));var db=require('../../mysqldb')['db'];config[_0x33ff('0x17')]=_[_0x33ff('0x18')](config['redis'],{'host':_0x33ff('0x19'),'port':0x18eb});var socket=require(_0x33ff('0x1a'))(new Redis(config['redis']));require('./voiceQueueReport.socket')['register'](socket);function respondWithStatusCode(_0x3498a6,_0x1730cb){_0x1730cb=_0x1730cb||0xcc;return function(_0x250aa7){if(_0x250aa7){return _0x3498a6[_0x33ff('0x1b')](_0x1730cb);}return _0x3498a6[_0x33ff('0x1c')](_0x1730cb)[_0x33ff('0x1d')]();};}function respondWithResult(_0x8d6a80,_0x1aea91){_0x1aea91=_0x1aea91||0xc8;return function(_0x4d99e3){if(_0x4d99e3){return _0x8d6a80[_0x33ff('0x1c')](_0x1aea91)[_0x33ff('0x1e')](_0x4d99e3);}};}function respondWithFilteredResult(_0x286e8b,_0x52c042){return function(_0x56f41f){if(_0x56f41f){var _0x4c22f4=typeof _0x52c042[_0x33ff('0x1f')]===_0x33ff('0x20')&&typeof _0x52c042[_0x33ff('0x21')]===_0x33ff('0x20');var _0x365d48=_0x56f41f[_0x33ff('0x22')];var _0xd01a34=_0x4c22f4?0x0:_0x52c042[_0x33ff('0x1f')];var _0x2ae2d1=_0x4c22f4?_0x56f41f[_0x33ff('0x22')]:_0x52c042[_0x33ff('0x1f')]+_0x52c042[_0x33ff('0x21')];var _0x4148a5;if(_0x2ae2d1>=_0x365d48){_0x2ae2d1=_0x365d48;_0x4148a5=0xc8;}else{_0x4148a5=0xce;}_0x286e8b[_0x33ff('0x1c')](_0x4148a5);return _0x286e8b['set'](_0x33ff('0x23'),_0xd01a34+'-'+_0x2ae2d1+'/'+_0x365d48)['json'](_0x56f41f);}return null;};}function patchUpdates(_0x40c9c3){return function(_0x15ade8){try{jsonpatch[_0x33ff('0x24')](_0x15ade8,_0x40c9c3,!![]);}catch(_0x14768d){return BPromise[_0x33ff('0x25')](_0x14768d);}return _0x15ade8[_0x33ff('0x26')]();};}function saveUpdates(_0x576664,_0x2fd835){return function(_0x165931){if(_0x165931){return _0x165931['update'](_0x576664)[_0x33ff('0x27')](function(_0x583dd2){return _0x583dd2;});}return null;};}function removeEntity(_0x3fa7b7,_0x4da9c1){return function(_0x9d20cb){if(_0x9d20cb){return _0x9d20cb[_0x33ff('0x28')]()[_0x33ff('0x27')](function(){_0x3fa7b7[_0x33ff('0x1c')](0xcc)[_0x33ff('0x1d')]();});}};}function handleEntityNotFound(_0xb0a1ac,_0x2bd009){return function(_0x40ac87){if(!_0x40ac87){_0xb0a1ac['sendStatus'](0x194);}return _0x40ac87;};}function handleError(_0x3d1dfc,_0x359c49){_0x359c49=_0x359c49||0x1f4;return function(_0x39dd17){logger['error'](_0x39dd17['stack']);if(_0x39dd17[_0x33ff('0x29')]){delete _0x39dd17[_0x33ff('0x29')];}_0x3d1dfc['status'](_0x359c49)[_0x33ff('0x2a')](_0x39dd17);};}exports[_0x33ff('0x2b')]=function(_0x475c4e,_0x13f83d){var _0x2d9c0d={},_0x513851={},_0x2417fe={'count':0x0,'rows':[]};var _0x2cbf5a=_[_0x33ff('0x2c')](db['VoiceQueueReport']['rawAttributes'],function(_0x2a98c7){return{'name':_0x2a98c7[_0x33ff('0x2d')],'type':_0x2a98c7['type'][_0x33ff('0x2e')]};});_0x513851['model']=_[_0x33ff('0x2c')](_0x2cbf5a,_0x33ff('0x29'));_0x513851[_0x33ff('0x2f')]=_[_0x33ff('0x30')](_0x475c4e[_0x33ff('0x2f')]);_0x513851[_0x33ff('0x31')]=_[_0x33ff('0x32')](_0x513851['model'],_0x513851['query']);_0x2d9c0d['attributes']=_[_0x33ff('0x32')](_0x513851[_0x33ff('0x33')],qs[_0x33ff('0x34')](_0x475c4e[_0x33ff('0x2f')][_0x33ff('0x34')]));_0x2d9c0d['attributes']=_0x2d9c0d[_0x33ff('0x35')][_0x33ff('0x36')]?_0x2d9c0d[_0x33ff('0x35')]:_0x513851[_0x33ff('0x33')];if(!_0x475c4e[_0x33ff('0x2f')][_0x33ff('0x37')](_0x33ff('0x38'))){_0x2d9c0d[_0x33ff('0x21')]=qs[_0x33ff('0x21')](_0x475c4e['query'][_0x33ff('0x21')]);_0x2d9c0d[_0x33ff('0x1f')]=qs[_0x33ff('0x1f')](_0x475c4e[_0x33ff('0x2f')]['offset']);}_0x2d9c0d[_0x33ff('0x39')]=qs[_0x33ff('0x3a')](_0x475c4e['query'][_0x33ff('0x3a')]);_0x2d9c0d[_0x33ff('0x3b')]=qs[_0x33ff('0x31')](_['pick'](_0x475c4e[_0x33ff('0x2f')],_0x513851['filters']),_0x2cbf5a);if(_0x475c4e['query']['filter']){_0x2d9c0d[_0x33ff('0x3b')]=_[_0x33ff('0x3c')](_0x2d9c0d['where'],{'$or':_[_0x33ff('0x2c')](_0x2cbf5a,function(_0x4d03a9){if(_0x4d03a9[_0x33ff('0x3d')]!==_0x33ff('0x3e')){var _0x108034={};_0x108034[_0x4d03a9['name']]={'$like':'%'+_0x475c4e[_0x33ff('0x2f')][_0x33ff('0x3f')]+'%'};return _0x108034;}})});}_0x2d9c0d=_['merge']({},_0x2d9c0d,_0x475c4e[_0x33ff('0x40')]);var _0x121e3a={'where':_0x2d9c0d['where']};return db['VoiceQueueReport'][_0x33ff('0x22')](_0x121e3a)[_0x33ff('0x27')](function(_0x52d323){_0x2417fe[_0x33ff('0x22')]=_0x52d323;if(_0x475c4e[_0x33ff('0x2f')]['includeAll']){_0x2d9c0d[_0x33ff('0x41')]=[{'all':!![]}];}return db[_0x33ff('0x42')][_0x33ff('0x43')](_0x2d9c0d);})[_0x33ff('0x27')](function(_0x507cbb){_0x2417fe[_0x33ff('0x44')]=_0x507cbb;return _0x2417fe;})['then'](respondWithFilteredResult(_0x13f83d,_0x2d9c0d))['catch'](handleError(_0x13f83d,null));};exports[_0x33ff('0x45')]=function(_0x419787,_0x2ef1e4){var _0x4eac0f={'raw':![],'where':{'id':_0x419787[_0x33ff('0x46')]['id']}},_0x47d080={};_0x47d080['model']=_[_0x33ff('0x30')](db['VoiceQueueReport'][_0x33ff('0x47')]);_0x47d080[_0x33ff('0x2f')]=_[_0x33ff('0x30')](_0x419787[_0x33ff('0x2f')]);_0x47d080[_0x33ff('0x31')]=_[_0x33ff('0x32')](_0x47d080['model'],_0x47d080[_0x33ff('0x2f')]);_0x4eac0f['attributes']=_['intersection'](_0x47d080['model'],qs[_0x33ff('0x34')](_0x419787[_0x33ff('0x2f')][_0x33ff('0x34')]));_0x4eac0f[_0x33ff('0x35')]=_0x4eac0f['attributes'][_0x33ff('0x36')]?_0x4eac0f[_0x33ff('0x35')]:_0x47d080[_0x33ff('0x33')];if(_0x419787[_0x33ff('0x2f')][_0x33ff('0x48')]){_0x4eac0f[_0x33ff('0x41')]=[{'all':!![]}];}_0x4eac0f=_['merge']({},_0x4eac0f,_0x419787[_0x33ff('0x40')]);return db[_0x33ff('0x42')][_0x33ff('0x49')](_0x4eac0f)[_0x33ff('0x27')](handleEntityNotFound(_0x2ef1e4,null))[_0x33ff('0x27')](respondWithResult(_0x2ef1e4,null))['catch'](handleError(_0x2ef1e4,null));};exports['create']=function(_0x38055a,_0x3d544c){return db['VoiceQueueReport'][_0x33ff('0x4a')](_0x38055a[_0x33ff('0x4b')],{})['then'](respondWithResult(_0x3d544c,0xc9))['catch'](handleError(_0x3d544c,null));};exports[_0x33ff('0x4c')]=function(_0x2feff4,_0x391333){if(_0x2feff4[_0x33ff('0x4b')]['id']){delete _0x2feff4[_0x33ff('0x4b')]['id'];}return db[_0x33ff('0x42')][_0x33ff('0x49')]({'where':{'id':_0x2feff4[_0x33ff('0x46')]['id']}})[_0x33ff('0x27')](handleEntityNotFound(_0x391333,null))['then'](saveUpdates(_0x2feff4['body'],null))[_0x33ff('0x27')](respondWithResult(_0x391333,null))[_0x33ff('0x4d')](handleError(_0x391333,null));};exports[_0x33ff('0x28')]=function(_0xc65a1e,_0x1b2576){return db[_0x33ff('0x42')][_0x33ff('0x49')]({'where':{'id':_0xc65a1e['params']['id']}})[_0x33ff('0x27')](handleEntityNotFound(_0x1b2576,null))[_0x33ff('0x27')](removeEntity(_0x1b2576,null))['catch'](handleError(_0x1b2576,null));};exports[_0x33ff('0x4e')]=function(_0x5a318b,_0x24181f){return db[_0x33ff('0x42')][_0x33ff('0x4e')]()[_0x33ff('0x27')](respondWithResult(_0x24181f,null))['catch'](handleError(_0x24181f,null));};exports[_0x33ff('0x4f')]=function(_0x14d17b,_0x32b2a4){var _0x57c50b={},_0xc97d14={},_0x4147b5={'count':0x0,'rows':[]};_0xc97d14[_0x33ff('0x33')]=_[_0x33ff('0x30')](db[_0x33ff('0x42')]['rawAttributes']);_0xc97d14[_0x33ff('0x2f')]=_['keys'](_0x14d17b[_0x33ff('0x2f')]);_0xc97d14['filters']=_[_0x33ff('0x32')](_0xc97d14[_0x33ff('0x33')],_0xc97d14[_0x33ff('0x2f')]);_0x57c50b[_0x33ff('0x35')]=_[_0x33ff('0x32')](_0xc97d14[_0x33ff('0x33')],qs[_0x33ff('0x34')](_0x14d17b[_0x33ff('0x2f')][_0x33ff('0x34')]));_0x57c50b['attributes']=_0x57c50b[_0x33ff('0x35')][_0x33ff('0x36')]?_0x57c50b[_0x33ff('0x35')]:_0xc97d14[_0x33ff('0x33')];if(!_0x14d17b[_0x33ff('0x2f')][_0x33ff('0x37')](_0x33ff('0x38'))){_0x57c50b['limit']=qs['limit'](_0x14d17b['query'][_0x33ff('0x21')]);_0x57c50b[_0x33ff('0x1f')]=qs['offset'](_0x14d17b['query']['offset']);}_0x57c50b[_0x33ff('0x39')]=qs[_0x33ff('0x3a')](_0x14d17b[_0x33ff('0x2f')][_0x33ff('0x3a')]);_0x57c50b[_0x33ff('0x3b')]=qs[_0x33ff('0x31')](_[_0x33ff('0x50')](_0x14d17b[_0x33ff('0x2f')],_0xc97d14['filters']));if(_0x14d17b[_0x33ff('0x2f')][_0x33ff('0x3f')]){_0x57c50b[_0x33ff('0x3b')]=_['merge'](_0x57c50b[_0x33ff('0x3b')],{'$or':_[_0x33ff('0x2c')](_0x57c50b[_0x33ff('0x35')],function(_0x2d86a0){var _0x268b5c={};_0x268b5c[_0x2d86a0]={'$like':'%'+_0x14d17b['query'][_0x33ff('0x3f')]+'%'};return _0x268b5c;})});}_0x57c50b=_['merge']({},_0x57c50b,_0x14d17b[_0x33ff('0x40')]);var _0x4978c8={'where':_0x57c50b[_0x33ff('0x3b')]};return db[_0x33ff('0x42')][_0x33ff('0x22')](_0x4978c8)[_0x33ff('0x27')](function(_0x411da5){_0x4147b5[_0x33ff('0x22')]=_0x411da5;if(_0x14d17b[_0x33ff('0x2f')]['includeAll']){_0x57c50b[_0x33ff('0x41')]=[{'all':!![]}];}return db[_0x33ff('0x42')][_0x33ff('0x43')](_0x57c50b);})[_0x33ff('0x27')](function(_0x5438aa){_0x4147b5['rows']=_0x5438aa;return _0x4147b5;})[_0x33ff('0x27')](respondWithFilteredResult(_0x32b2a4,_0x57c50b,_0x33ff('0x4f')))[_0x33ff('0x4d')](handleError(_0x32b2a4,null,_0x33ff('0x4f')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 5f8036d..69ffde7 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 _0xf4e6=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','VoiceQueueReport'];(function(_0x178307,_0x57a662){var _0x47d971=function(_0x5afa47){while(--_0x5afa47){_0x178307['push'](_0x178307['shift']());}};_0x47d971(++_0x57a662);}(_0xf4e6,0x142));var _0x6f4e=function(_0x3e6d5d,_0x264c7a){_0x3e6d5d=_0x3e6d5d-0x0;var _0x238923=_0xf4e6[_0x3e6d5d];return _0x238923;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0x6f4e('0x0'))['db'][_0x6f4e('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x6f4e('0x2')](0x0);var events={'afterCreate':_0x6f4e('0x3'),'afterUpdate':'update','afterDestroy':_0x6f4e('0x4')};function emitEvent(_0x2d0d96){return function(_0x31903e,_0xe668a5,_0x4b0028){VoiceQueueReportEvents[_0x6f4e('0x5')](_0x2d0d96+':'+_0x31903e['id'],_0x31903e);VoiceQueueReportEvents['emit'](_0x2d0d96,_0x31903e);_0x4b0028(null);};}for(var e in events){if(events[_0x6f4e('0x6')](e)){var event=events[e];VoiceQueueReport[_0x6f4e('0x7')](e,emitEvent(event));}}module[_0x6f4e('0x8')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x4051=['exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x3cfa4a,_0x10defd){var _0x4e8dfc=function(_0x297739){while(--_0x297739){_0x3cfa4a['push'](_0x3cfa4a['shift']());}};_0x4e8dfc(++_0x10defd);}(_0x4051,0x10f));var _0x1405=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x4051[_0x279d37];return _0x530173;};'use strict';var EventEmitter=require(_0x1405('0x0'));var VoiceQueueReport=require(_0x1405('0x1'))['db'][_0x1405('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x1405('0x3')](0x0);var events={'afterCreate':_0x1405('0x4'),'afterUpdate':'update','afterDestroy':_0x1405('0x5')};function emitEvent(_0x2ae5d6){return function(_0x24dcb9,_0xfd1629,_0x1389b1){VoiceQueueReportEvents[_0x1405('0x6')](_0x2ae5d6+':'+_0x24dcb9['id'],_0x24dcb9);VoiceQueueReportEvents['emit'](_0x2ae5d6,_0x24dcb9);_0x1389b1(null);};}for(var e in events){if(events[_0x1405('0x7')](e)){var event=events[e];VoiceQueueReport[_0x1405('0x8')](e,emitEvent(event));}}module[_0x1405('0x9')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index ddedd0d..71eff90 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 _0x3713=['../../config/environment','./voiceQueueReport.attributes','define','report_queue','uniqueid','calleridnum','lodash','util','api','moment','bluebird','path'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0x3713,0x192));var _0x3371=function(_0x14e99a,_0xc478ee){_0x14e99a=_0x14e99a-0x0;var _0x47212a=_0x3713[_0x14e99a];return _0x47212a;};'use strict';var _=require(_0x3371('0x0'));var util=require(_0x3371('0x1'));var logger=require('../../config/logger')(_0x3371('0x2'));var moment=require(_0x3371('0x3'));var BPromise=require(_0x3371('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3371('0x5'));var rimraf=require('rimraf');var config=require(_0x3371('0x6'));var attributes=require(_0x3371('0x7'));module['exports']=function(_0x2ff0a9,_0x5bbcb2){return _0x2ff0a9[_0x3371('0x8')]('VoiceQueueReport',attributes,{'tableName':_0x3371('0x9'),'paranoid':![],'indexes':[{'fields':[_0x3371('0xa')]},{'fields':[_0x3371('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbcc2=['bluebird','request-promise','path','rimraf','../../config/environment','exports','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger','api','moment'];(function(_0x2f7e30,_0x2b41dd){var _0x396548=function(_0x50e22a){while(--_0x50e22a){_0x2f7e30['push'](_0x2f7e30['shift']());}};_0x396548(++_0x2b41dd);}(_0xbcc2,0xcd));var _0x2bcc=function(_0x16f4f1,_0x47d307){_0x16f4f1=_0x16f4f1-0x0;var _0x255f38=_0xbcc2[_0x16f4f1];return _0x255f38;};'use strict';var _=require(_0x2bcc('0x0'));var util=require(_0x2bcc('0x1'));var logger=require(_0x2bcc('0x2'))(_0x2bcc('0x3'));var moment=require(_0x2bcc('0x4'));var BPromise=require(_0x2bcc('0x5'));var rp=require(_0x2bcc('0x6'));var fs=require('fs');var path=require(_0x2bcc('0x7'));var rimraf=require(_0x2bcc('0x8'));var config=require(_0x2bcc('0x9'));var attributes=require('./voiceQueueReport.attributes');module[_0x2bcc('0xa')]=function(_0x4a80ec,_0x66fe2a){return _0x4a80ec['define'](_0x2bcc('0xb'),attributes,{'tableName':_0x2bcc('0xc'),'paranoid':![],'indexes':[{'fields':[_0x2bcc('0xd')]},{'fields':[_0x2bcc('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 603447c..85b0bf7 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 _0xc56f=['info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','options','raw','attributes','limit','include','map','model','debug','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','update','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','socket.io-emitter','register','request','then'];(function(_0x2b90e2,_0x3c0729){var _0x1431e6=function(_0x1766de){while(--_0x1766de){_0x2b90e2['push'](_0x2b90e2['shift']());}};_0x1431e6(++_0x3c0729);}(_0xc56f,0x162));var _0xfc56=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0xc56f[_0x5834bc];return _0x3e183a;};'use strict';var _=require(_0xfc56('0x0'));var util=require(_0xfc56('0x1'));var moment=require(_0xfc56('0x2'));var BPromise=require(_0xfc56('0x3'));var rs=require(_0xfc56('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfc56('0x5'))['db'];var utils=require(_0xfc56('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xfc56('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfc56('0x8')][_0xfc56('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xfc56('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xfc56('0xb'))(new Redis(config[_0xfc56('0xa')]));require('./voiceQueueReport.socket')[_0xfc56('0xc')](socket);function respondWithRpcPromise(_0x16f697,_0x45275c,_0x250614){return new BPromise(function(_0x334393,_0x1ab29c){return client[_0xfc56('0xd')](_0x16f697,_0x250614)[_0xfc56('0xe')](function(_0x28eaa3){logger[_0xfc56('0xf')](_0xfc56('0x10'),_0x45275c,_0xfc56('0x11'));logger['debug'](_0xfc56('0x12'),_0x45275c,_0xfc56('0x11'),JSON[_0xfc56('0x13')](_0x28eaa3));if(_0x28eaa3['error']){if(_0x28eaa3[_0xfc56('0x14')][_0xfc56('0x15')]===0x1f4){logger[_0xfc56('0x14')](_0xfc56('0x10'),_0x45275c,_0x28eaa3[_0xfc56('0x14')][_0xfc56('0x16')]);return _0x1ab29c(_0x28eaa3[_0xfc56('0x14')][_0xfc56('0x16')]);}logger['error'](_0xfc56('0x10'),_0x45275c,_0x28eaa3[_0xfc56('0x14')][_0xfc56('0x16')]);return _0x334393(_0x28eaa3[_0xfc56('0x14')]['message']);}else{logger[_0xfc56('0xf')](_0xfc56('0x10'),_0x45275c,'request\x20sent');_0x334393(_0x28eaa3[_0xfc56('0x17')][_0xfc56('0x16')]);}})[_0xfc56('0x18')](function(_0x4f06bc){logger[_0xfc56('0x14')](_0xfc56('0x10'),_0x45275c,_0x4f06bc);_0x1ab29c(_0x4f06bc);});});}exports[_0xfc56('0x19')]=function(_0x51bb39){var _0x4fb9f1=this;return new Promise(function(_0x77821d,_0x51bed6){return db[_0xfc56('0x1a')]['findAll']({'raw':_0x51bb39[_0xfc56('0x1b')]?_0x51bb39[_0xfc56('0x1b')][_0xfc56('0x1c')]===undefined?!![]:![]:!![],'where':_0x51bb39[_0xfc56('0x1b')]?_0x51bb39[_0xfc56('0x1b')]['where']||null:null,'attributes':_0x51bb39[_0xfc56('0x1b')]?_0x51bb39[_0xfc56('0x1b')][_0xfc56('0x1d')]||null:null,'limit':_0x51bb39['options']?_0x51bb39['options'][_0xfc56('0x1e')]||null:null,'include':_0x51bb39['options']?_0x51bb39[_0xfc56('0x1b')][_0xfc56('0x1f')]?_[_0xfc56('0x20')](_0x51bb39[_0xfc56('0x1b')]['include'],function(_0x582093){return{'model':db[_0x582093[_0xfc56('0x21')]],'as':_0x582093['as'],'attributes':_0x582093['attributes'],'include':_0x582093['include']?_[_0xfc56('0x20')](_0x582093[_0xfc56('0x1f')],function(_0x12f49d){return{'model':db[_0x12f49d[_0xfc56('0x21')]],'as':_0x12f49d['as'],'attributes':_0x12f49d[_0xfc56('0x1d')],'include':_0x12f49d[_0xfc56('0x1f')]?_[_0xfc56('0x20')](_0x12f49d[_0xfc56('0x1f')],function(_0x500293){return{'model':db[_0x500293[_0xfc56('0x21')]],'as':_0x500293['as'],'attributes':_0x500293[_0xfc56('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xfc56('0xe')](function(_0x39de08){logger['info']('GetVoiceQueueReport',_0x51bb39);logger[_0xfc56('0x22')]('GetVoiceQueueReport',_0x51bb39,JSON[_0xfc56('0x13')](_0x39de08));_0x77821d(_0x39de08);})[_0xfc56('0x18')](function(_0x4c5018){logger[_0xfc56('0x14')](_0xfc56('0x19'),_0x4c5018['message'],_0x51bb39);_0x51bed6(_0x4fb9f1[_0xfc56('0x14')](0x1f4,_0x4c5018[_0xfc56('0x16')]));});});};exports[_0xfc56('0x23')]=function(_0x659698){var _0x48a91b=this;return new Promise(function(_0xb550d7,_0xb2820b){return db['VoiceQueueReport'][_0xfc56('0x24')](_0x659698[_0xfc56('0x25')],{'raw':_0x659698[_0xfc56('0x1b')]?_0x659698[_0xfc56('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xfc56('0xe')](function(_0x173eb1){logger[_0xfc56('0xf')]('CreateVoiceQueueReport',_0x659698);logger['debug']('CreateVoiceQueueReport',_0x659698,JSON[_0xfc56('0x13')](_0x173eb1));_0xb550d7(_0x173eb1);})[_0xfc56('0x18')](function(_0x5a7175){logger[_0xfc56('0x14')](_0xfc56('0x23'),_0x5a7175['message'],_0x659698);_0xb2820b(_0x48a91b[_0xfc56('0x14')](0x1f4,_0x5a7175[_0xfc56('0x16')]));});});};exports[_0xfc56('0x26')]=function(_0x3ce292){var _0x416ffe=this;return new Promise(function(_0x65bba3,_0x59c569){return db[_0xfc56('0x1a')][_0xfc56('0x27')](_0x3ce292[_0xfc56('0x25')],{'raw':_0x3ce292[_0xfc56('0x1b')]?_0x3ce292['options'][_0xfc56('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ce292[_0xfc56('0x1b')]?_0x3ce292[_0xfc56('0x1b')][_0xfc56('0x28')]||null:null,'attributes':_0x3ce292[_0xfc56('0x1b')]?_0x3ce292[_0xfc56('0x1b')][_0xfc56('0x1d')]||null:null,'limit':_0x3ce292['options']?_0x3ce292[_0xfc56('0x1b')]['limit']||null:null})[_0xfc56('0xe')](function(_0x301605){logger['info']('UpdateVoiceQueueReport',_0x3ce292);logger['debug'](_0xfc56('0x26'),_0x3ce292,JSON['stringify'](_0x301605));_0x65bba3(_0x301605);})[_0xfc56('0x18')](function(_0x2919e2){logger[_0xfc56('0x14')](_0xfc56('0x26'),_0x2919e2['message'],_0x3ce292);_0x59c569(_0x416ffe[_0xfc56('0x14')](0x1f4,_0x2919e2[_0xfc56('0x16')]));});});}; \ No newline at end of file +var _0x8437=['model','attributes','debug','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','map','include'];(function(_0x1f83a5,_0x59843f){var _0x45edf0=function(_0x431e25){while(--_0x431e25){_0x1f83a5['push'](_0x1f83a5['shift']());}};_0x45edf0(++_0x59843f);}(_0x8437,0x157));var _0x7843=function(_0x42657a,_0x1a17d9){_0x42657a=_0x42657a-0x0;var _0x732e58=_0x8437[_0x42657a];return _0x732e58;};'use strict';var _=require(_0x7843('0x0'));var util=require(_0x7843('0x1'));var moment=require(_0x7843('0x2'));var BPromise=require(_0x7843('0x3'));var rs=require(_0x7843('0x4'));var fs=require('fs');var Redis=require(_0x7843('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7843('0x6'))(_0x7843('0x7'));var config=require(_0x7843('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7843('0x9')]['http']({'port':0x232a});config[_0x7843('0xa')]=_[_0x7843('0xb')](config[_0x7843('0xa')],{'host':_0x7843('0xc'),'port':0x18eb});var socket=require(_0x7843('0xd'))(new Redis(config['redis']));require(_0x7843('0xe'))[_0x7843('0xf')](socket);function respondWithRpcPromise(_0x374015,_0x2bdaf3,_0x3b5965){return new BPromise(function(_0x37823d,_0x57eb14){return client[_0x7843('0x10')](_0x374015,_0x3b5965)[_0x7843('0x11')](function(_0x27b145){logger[_0x7843('0x12')](_0x7843('0x13'),_0x2bdaf3,_0x7843('0x14'));logger['debug'](_0x7843('0x15'),_0x2bdaf3,_0x7843('0x14'),JSON[_0x7843('0x16')](_0x27b145));if(_0x27b145[_0x7843('0x17')]){if(_0x27b145['error']['code']===0x1f4){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x2bdaf3,_0x27b145['error'][_0x7843('0x18')]);return _0x57eb14(_0x27b145[_0x7843('0x17')]['message']);}logger[_0x7843('0x17')](_0x7843('0x13'),_0x2bdaf3,_0x27b145['error']['message']);return _0x37823d(_0x27b145['error']['message']);}else{logger['info'](_0x7843('0x13'),_0x2bdaf3,_0x7843('0x14'));_0x37823d(_0x27b145[_0x7843('0x19')][_0x7843('0x18')]);}})[_0x7843('0x1a')](function(_0x3a0fdd){logger[_0x7843('0x17')](_0x7843('0x13'),_0x2bdaf3,_0x3a0fdd);_0x57eb14(_0x3a0fdd);});});}exports[_0x7843('0x1b')]=function(_0x5d021e){var _0x5219e1=this;return new Promise(function(_0x759aec,_0x107513){return db[_0x7843('0x1c')][_0x7843('0x1d')]({'raw':_0x5d021e['options']?_0x5d021e[_0x7843('0x1e')][_0x7843('0x1f')]===undefined?!![]:![]:!![],'where':_0x5d021e[_0x7843('0x1e')]?_0x5d021e['options'][_0x7843('0x20')]||null:null,'attributes':_0x5d021e[_0x7843('0x1e')]?_0x5d021e[_0x7843('0x1e')]['attributes']||null:null,'limit':_0x5d021e['options']?_0x5d021e[_0x7843('0x1e')]['limit']||null:null,'include':_0x5d021e[_0x7843('0x1e')]?_0x5d021e[_0x7843('0x1e')]['include']?_[_0x7843('0x21')](_0x5d021e[_0x7843('0x1e')][_0x7843('0x22')],function(_0x468ab7){return{'model':db[_0x468ab7[_0x7843('0x23')]],'as':_0x468ab7['as'],'attributes':_0x468ab7[_0x7843('0x24')],'include':_0x468ab7['include']?_[_0x7843('0x21')](_0x468ab7[_0x7843('0x22')],function(_0x26a728){return{'model':db[_0x26a728[_0x7843('0x23')]],'as':_0x26a728['as'],'attributes':_0x26a728[_0x7843('0x24')],'include':_0x26a728[_0x7843('0x22')]?_[_0x7843('0x21')](_0x26a728[_0x7843('0x22')],function(_0x437be0){return{'model':db[_0x437be0[_0x7843('0x23')]],'as':_0x437be0['as'],'attributes':_0x437be0[_0x7843('0x24')]};}):[]};}):[]};}):[]:[]})[_0x7843('0x11')](function(_0x5f211c){logger[_0x7843('0x12')](_0x7843('0x1b'),_0x5d021e);logger[_0x7843('0x25')](_0x7843('0x1b'),_0x5d021e,JSON[_0x7843('0x16')](_0x5f211c));_0x759aec(_0x5f211c);})['catch'](function(_0x2df27c){logger['error'](_0x7843('0x1b'),_0x2df27c['message'],_0x5d021e);_0x107513(_0x5219e1[_0x7843('0x17')](0x1f4,_0x2df27c[_0x7843('0x18')]));});});};exports[_0x7843('0x26')]=function(_0x12e49f){var _0x4c48df=this;return new Promise(function(_0x273266,_0x3cc85f){return db['VoiceQueueReport'][_0x7843('0x27')](_0x12e49f[_0x7843('0x28')],{'raw':_0x12e49f[_0x7843('0x1e')]?_0x12e49f[_0x7843('0x1e')][_0x7843('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x2c765b){logger[_0x7843('0x12')]('CreateVoiceQueueReport',_0x12e49f);logger[_0x7843('0x25')](_0x7843('0x26'),_0x12e49f,JSON['stringify'](_0x2c765b));_0x273266(_0x2c765b);})[_0x7843('0x1a')](function(_0x505b3d){logger['error'](_0x7843('0x26'),_0x505b3d['message'],_0x12e49f);_0x3cc85f(_0x4c48df[_0x7843('0x17')](0x1f4,_0x505b3d[_0x7843('0x18')]));});});};exports[_0x7843('0x29')]=function(_0x81aade){var _0x534145=this;return new Promise(function(_0x45fd82,_0x5a5edb){return db[_0x7843('0x1c')]['update'](_0x81aade[_0x7843('0x28')],{'raw':_0x81aade[_0x7843('0x1e')]?_0x81aade[_0x7843('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x81aade[_0x7843('0x1e')]?_0x81aade[_0x7843('0x1e')][_0x7843('0x20')]||null:null,'attributes':_0x81aade['options']?_0x81aade[_0x7843('0x1e')][_0x7843('0x24')]||null:null,'limit':_0x81aade[_0x7843('0x1e')]?_0x81aade[_0x7843('0x1e')]['limit']||null:null})[_0x7843('0x11')](function(_0x5bd510){logger[_0x7843('0x12')](_0x7843('0x29'),_0x81aade);logger['debug'](_0x7843('0x29'),_0x81aade,JSON[_0x7843('0x16')](_0x5bd510));_0x45fd82(_0x5bd510);})['catch'](function(_0x280a24){logger['error'](_0x7843('0x29'),_0x280a24['message'],_0x81aade);_0x5a5edb(_0x534145['error'](0x1f4,_0x280a24[_0x7843('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index a10da2c..27ddb2c 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 _0xd0a4=['remove','update','./voiceQueueReport.events','save'];(function(_0x3708f4,_0x4a1fcf){var _0x249fd0=function(_0x21bed1){while(--_0x21bed1){_0x3708f4['push'](_0x3708f4['shift']());}};_0x249fd0(++_0x4a1fcf);}(_0xd0a4,0x13e));var _0x4d0a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd0a4[_0x3dd15e];return _0x231fd0;};'use strict';var VoiceQueueReportEvents=require(_0x4d0a('0x0'));var events=[_0x4d0a('0x1'),_0x4d0a('0x2'),_0x4d0a('0x3')];function createListener(_0x34644b,_0x1d4d97){return function(_0xe486d0){_0x1d4d97['emit'](_0x34644b,_0xe486d0);};}function removeListener(_0x344180,_0x98ca03){return function(){VoiceQueueReportEvents['removeListener'](_0x344180,_0x98ca03);};}exports['register']=function(_0x4dae1f){for(var _0x44c7a7=0x0,_0x5ebbb3=events['length'];_0x44c7a7<_0x5ebbb3;_0x44c7a7++){var _0x2491d0=events[_0x44c7a7];var _0x5b1797=createListener('voiceQueueReport:'+_0x2491d0,_0x4dae1f);VoiceQueueReportEvents['on'](_0x2491d0,_0x5b1797);}}; \ No newline at end of file +var _0x3212=['register','length','voiceQueueReport:','./voiceQueueReport.events','save','remove','update','emit','removeListener'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0x3212,0x6f));var _0x2321=function(_0x3a819a,_0x37defe){_0x3a819a=_0x3a819a-0x0;var _0x519899=_0x3212[_0x3a819a];return _0x519899;};'use strict';var VoiceQueueReportEvents=require(_0x2321('0x0'));var events=[_0x2321('0x1'),_0x2321('0x2'),_0x2321('0x3')];function createListener(_0x305ffa,_0x232e6c){return function(_0x13a610){_0x232e6c[_0x2321('0x4')](_0x305ffa,_0x13a610);};}function removeListener(_0x4732b7,_0x3e090a){return function(){VoiceQueueReportEvents[_0x2321('0x5')](_0x4732b7,_0x3e090a);};}exports[_0x2321('0x6')]=function(_0x53d2e1){for(var _0x14b94e=0x0,_0x17a560=events[_0x2321('0x7')];_0x14b94e<_0x17a560;_0x14b94e++){var _0x4ff02a=events[_0x14b94e];var _0x900de6=createListener(_0x2321('0x8')+_0x4ff02a,_0x53d2e1);VoiceQueueReportEvents['on'](_0x4ff02a,_0x900de6);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index dd3e839..95577ee 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 _0xcc8c=['connect-timeout','express','Router','fs-extra','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','/:id','show','create','put','update','exports','multer','util','path'];(function(_0x31f371,_0x1714d9){var _0x19b41c=function(_0x14f363){while(--_0x14f363){_0x31f371['push'](_0x31f371['shift']());}};_0x19b41c(++_0x1714d9);}(_0xcc8c,0x151));var _0xccc8=function(_0x3fe6df,_0x5a04d4){_0x3fe6df=_0x3fe6df-0x0;var _0x372a0e=_0xcc8c[_0x3fe6df];return _0x372a0e;};'use strict';var multer=require(_0xccc8('0x0'));var util=require(_0xccc8('0x1'));var path=require(_0xccc8('0x2'));var timeout=require(_0xccc8('0x3'));var express=require(_0xccc8('0x4'));var router=express[_0xccc8('0x5')]();var fs_extra=require(_0xccc8('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xccc8('0x7'));var controller=require(_0xccc8('0x8'));router[_0xccc8('0x9')]('/',auth[_0xccc8('0xa')](),controller['index']);router['get'](_0xccc8('0xb'),auth['isAuthenticated'](),controller[_0xccc8('0xc')]);router['post']('/',auth[_0xccc8('0xa')](),controller[_0xccc8('0xd')]);router[_0xccc8('0xe')](_0xccc8('0xb'),auth[_0xccc8('0xa')](),controller[_0xccc8('0xf')]);router['delete'](_0xccc8('0xb'),auth[_0xccc8('0xa')](),controller['destroy']);module[_0xccc8('0x10')]=router; \ No newline at end of file +var _0xba76=['delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','post','put','update'];(function(_0x5cbf0e,_0x4cd140){var _0x1c76f8=function(_0xcc9be4){while(--_0xcc9be4){_0x5cbf0e['push'](_0x5cbf0e['shift']());}};_0x1c76f8(++_0x4cd140);}(_0xba76,0x17e));var _0x6ba7=function(_0x265544,_0x5ea72a){_0x265544=_0x265544-0x0;var _0x209885=_0xba76[_0x265544];return _0x209885;};'use strict';var multer=require(_0x6ba7('0x0'));var util=require(_0x6ba7('0x1'));var path=require(_0x6ba7('0x2'));var timeout=require(_0x6ba7('0x3'));var express=require(_0x6ba7('0x4'));var router=express[_0x6ba7('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6ba7('0x6'));var interaction=require(_0x6ba7('0x7'));var config=require(_0x6ba7('0x8'));var controller=require(_0x6ba7('0x9'));router[_0x6ba7('0xa')]('/',auth[_0x6ba7('0xb')](),controller[_0x6ba7('0xc')]);router[_0x6ba7('0xa')](_0x6ba7('0xd'),auth[_0x6ba7('0xb')](),controller[_0x6ba7('0xe')]);router[_0x6ba7('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6ba7('0x10')](_0x6ba7('0xd'),auth[_0x6ba7('0xb')](),controller[_0x6ba7('0x11')]);router[_0x6ba7('0x12')](_0x6ba7('0xd'),auth[_0x6ba7('0xb')](),controller[_0x6ba7('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 7a9f91f..7df864b 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 _0xf88f=['format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports','STRING','DATE'];(function(_0x45e4ae,_0x35e87c){var _0x391f30=function(_0x3d8f6c){while(--_0x3d8f6c){_0x45e4ae['push'](_0x45e4ae['shift']());}};_0x391f30(++_0x35e87c);}(_0xf88f,0x1bb));var _0xff88=function(_0x80fce,_0x8ee1d7){_0x80fce=_0x80fce-0x0;var _0x2ed712=_0xf88f[_0x80fce];return _0x2ed712;};'use strict';var Sequelize=require(_0xff88('0x0'));var moment=require(_0xff88('0x1'));module[_0xff88('0x2')]={'time':{'type':Sequelize[_0xff88('0x3')]},'callid':{'type':Sequelize[_0xff88('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xff88('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xff88('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xff88('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xff88('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xff88('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xff88('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xff88('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xff88('0x4')],'allowNull':![],'defaultValue':moment()[_0xff88('0x5')](_0xff88('0x6'))}}; \ No newline at end of file +var _0xa253=['format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports','STRING'];(function(_0x528ec8,_0x50e63c){var _0x3e149d=function(_0x285ff9){while(--_0x285ff9){_0x528ec8['push'](_0x528ec8['shift']());}};_0x3e149d(++_0x50e63c);}(_0xa253,0x176));var _0x3a25=function(_0x4057ca,_0xbe5390){_0x4057ca=_0x4057ca-0x0;var _0x20f2ea=_0xa253[_0x4057ca];return _0x20f2ea;};'use strict';var Sequelize=require(_0x3a25('0x0'));var moment=require(_0x3a25('0x1'));module[_0x3a25('0x2')]={'time':{'type':Sequelize[_0x3a25('0x3')]},'callid':{'type':Sequelize[_0x3a25('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x3a25('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x3a25('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x3a25('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x3a25('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x3a25('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x3a25('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x3a25('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0x3a25('0x4')](_0x3a25('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 7949ce0..d0394f4 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 _0x6a10=['destroy','error','stack','name','map','VoiceQueuesLog','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','create','catch','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then'];(function(_0x43dd75,_0x4000c3){var _0x3cc554=function(_0x2d567d){while(--_0x2d567d){_0x43dd75['push'](_0x43dd75['shift']());}};_0x3cc554(++_0x4000c3);}(_0x6a10,0x6e));var _0x06a1=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x6a10[_0x46e363];return _0x3fb059;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x06a1('0x0'));var zipdir=require(_0x06a1('0x1'));var jsonpatch=require(_0x06a1('0x2'));var rp=require(_0x06a1('0x3'));var moment=require(_0x06a1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x06a1('0x5'));var util=require(_0x06a1('0x6'));var path=require(_0x06a1('0x7'));var sox=require(_0x06a1('0x8'));var csv=require(_0x06a1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x06a1('0xa'));var _=require(_0x06a1('0xb'));var squel=require(_0x06a1('0xc'));var crypto=require('crypto');var jsforce=require(_0x06a1('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x06a1('0xe'));var Papa=require(_0x06a1('0xf'));var Redis=require(_0x06a1('0x10'));var authService=require(_0x06a1('0x11'));var qs=require(_0x06a1('0x12'));var as=require(_0x06a1('0x13'));var hardwareService=require(_0x06a1('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x06a1('0x15'));var config=require(_0x06a1('0x16'));var licenseUtil=require(_0x06a1('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3dd2f3,_0x4e1d77){_0x4e1d77=_0x4e1d77||0xcc;return function(_0x588998){if(_0x588998){return _0x3dd2f3[_0x06a1('0x18')](_0x4e1d77);}return _0x3dd2f3['status'](_0x4e1d77)[_0x06a1('0x19')]();};}function respondWithResult(_0x471bae,_0x2d7ae4){_0x2d7ae4=_0x2d7ae4||0xc8;return function(_0x6d3af3){if(_0x6d3af3){return _0x471bae[_0x06a1('0x1a')](_0x2d7ae4)[_0x06a1('0x1b')](_0x6d3af3);}};}function respondWithFilteredResult(_0x5ded52,_0x209510){return function(_0x506f61){if(_0x506f61){var _0x2c2039=typeof _0x209510[_0x06a1('0x1c')]===_0x06a1('0x1d')&&typeof _0x209510[_0x06a1('0x1e')]===_0x06a1('0x1d');var _0x19be81=_0x506f61[_0x06a1('0x1f')];var _0x4bd19a=_0x2c2039?0x0:_0x209510[_0x06a1('0x1c')];var _0x46f5c0=_0x2c2039?_0x506f61[_0x06a1('0x1f')]:_0x209510['offset']+_0x209510[_0x06a1('0x1e')];var _0x52039e;if(_0x46f5c0>=_0x19be81){_0x46f5c0=_0x19be81;_0x52039e=0xc8;}else{_0x52039e=0xce;}_0x5ded52[_0x06a1('0x1a')](_0x52039e);return _0x5ded52['set'](_0x06a1('0x20'),_0x4bd19a+'-'+_0x46f5c0+'/'+_0x19be81)[_0x06a1('0x1b')](_0x506f61);}return null;};}function patchUpdates(_0x41a6b5){return function(_0x9ea80f){try{jsonpatch[_0x06a1('0x21')](_0x9ea80f,_0x41a6b5,!![]);}catch(_0x8ac93d){return BPromise[_0x06a1('0x22')](_0x8ac93d);}return _0x9ea80f[_0x06a1('0x23')]();};}function saveUpdates(_0x118ae8,_0xb73a32){return function(_0x2eacda){if(_0x2eacda){return _0x2eacda[_0x06a1('0x24')](_0x118ae8)[_0x06a1('0x25')](function(_0x190ac8){return _0x190ac8;});}return null;};}function removeEntity(_0xf67086,_0x8c1484){return function(_0x252833){if(_0x252833){return _0x252833[_0x06a1('0x26')]()[_0x06a1('0x25')](function(){_0xf67086[_0x06a1('0x1a')](0xcc)[_0x06a1('0x19')]();});}};}function handleEntityNotFound(_0x545714,_0x4f8bc9){return function(_0x4a3357){if(!_0x4a3357){_0x545714['sendStatus'](0x194);}return _0x4a3357;};}function handleError(_0x4fae7b,_0x2bb6a5){_0x2bb6a5=_0x2bb6a5||0x1f4;return function(_0x265f59){logger[_0x06a1('0x27')](_0x265f59[_0x06a1('0x28')]);if(_0x265f59[_0x06a1('0x29')]){delete _0x265f59[_0x06a1('0x29')];}_0x4fae7b[_0x06a1('0x1a')](_0x2bb6a5)['send'](_0x265f59);};}exports['index']=function(_0x384f40,_0x5c10d5){var _0x47385d={},_0x4ea394={},_0x54915f={'count':0x0,'rows':[]};var _0x1fa3df=_[_0x06a1('0x2a')](db[_0x06a1('0x2b')]['rawAttributes'],function(_0xb2a880){return{'name':_0xb2a880[_0x06a1('0x2c')],'type':_0xb2a880[_0x06a1('0x2d')][_0x06a1('0x2e')]};});_0x4ea394[_0x06a1('0x2f')]=_[_0x06a1('0x2a')](_0x1fa3df,_0x06a1('0x29'));_0x4ea394[_0x06a1('0x30')]=_[_0x06a1('0x31')](_0x384f40[_0x06a1('0x30')]);_0x4ea394[_0x06a1('0x32')]=_[_0x06a1('0x33')](_0x4ea394[_0x06a1('0x2f')],_0x4ea394[_0x06a1('0x30')]);_0x47385d['attributes']=_[_0x06a1('0x33')](_0x4ea394[_0x06a1('0x2f')],qs[_0x06a1('0x34')](_0x384f40[_0x06a1('0x30')][_0x06a1('0x34')]));_0x47385d[_0x06a1('0x35')]=_0x47385d['attributes'][_0x06a1('0x36')]?_0x47385d[_0x06a1('0x35')]:_0x4ea394[_0x06a1('0x2f')];if(!_0x384f40[_0x06a1('0x30')][_0x06a1('0x37')]('nolimit')){_0x47385d['limit']=qs[_0x06a1('0x1e')](_0x384f40[_0x06a1('0x30')][_0x06a1('0x1e')]);_0x47385d['offset']=qs['offset'](_0x384f40[_0x06a1('0x30')]['offset']);}_0x47385d[_0x06a1('0x38')]=qs[_0x06a1('0x39')](_0x384f40[_0x06a1('0x30')]['sort']);_0x47385d[_0x06a1('0x3a')]=qs[_0x06a1('0x32')](_[_0x06a1('0x3b')](_0x384f40[_0x06a1('0x30')],_0x4ea394['filters']),_0x1fa3df);if(_0x384f40[_0x06a1('0x30')]['filter']){_0x47385d[_0x06a1('0x3a')]=_[_0x06a1('0x3c')](_0x47385d[_0x06a1('0x3a')],{'$or':_[_0x06a1('0x2a')](_0x1fa3df,function(_0x1a2d35){if(_0x1a2d35['type']!==_0x06a1('0x3d')){var _0x5dfcdc={};_0x5dfcdc[_0x1a2d35[_0x06a1('0x29')]]={'$like':'%'+_0x384f40[_0x06a1('0x30')][_0x06a1('0x3e')]+'%'};return _0x5dfcdc;}})});}_0x47385d=_[_0x06a1('0x3c')]({},_0x47385d,_0x384f40[_0x06a1('0x3f')]);var _0x4e242={'where':_0x47385d[_0x06a1('0x3a')]};return db[_0x06a1('0x2b')]['count'](_0x4e242)['then'](function(_0x4873ae){_0x54915f['count']=_0x4873ae;if(_0x384f40[_0x06a1('0x30')][_0x06a1('0x40')]){_0x47385d[_0x06a1('0x41')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0x06a1('0x42')](_0x47385d);})[_0x06a1('0x25')](function(_0x1a1be6){_0x54915f[_0x06a1('0x43')]=_0x1a1be6;return _0x54915f;})[_0x06a1('0x25')](respondWithFilteredResult(_0x5c10d5,_0x47385d))['catch'](handleError(_0x5c10d5,null));};exports[_0x06a1('0x44')]=function(_0x28f0df,_0x19bef1){var _0xb7703f={'raw':!![],'where':{'id':_0x28f0df[_0x06a1('0x45')]['id']}},_0x5152d6={};_0x5152d6['model']=_[_0x06a1('0x31')](db[_0x06a1('0x2b')]['rawAttributes']);_0x5152d6[_0x06a1('0x30')]=_[_0x06a1('0x31')](_0x28f0df[_0x06a1('0x30')]);_0x5152d6[_0x06a1('0x32')]=_[_0x06a1('0x33')](_0x5152d6['model'],_0x5152d6[_0x06a1('0x30')]);_0xb7703f[_0x06a1('0x35')]=_[_0x06a1('0x33')](_0x5152d6[_0x06a1('0x2f')],qs[_0x06a1('0x34')](_0x28f0df[_0x06a1('0x30')]['fields']));_0xb7703f[_0x06a1('0x35')]=_0xb7703f[_0x06a1('0x35')][_0x06a1('0x36')]?_0xb7703f['attributes']:_0x5152d6[_0x06a1('0x2f')];if(_0x28f0df[_0x06a1('0x30')][_0x06a1('0x40')]){_0xb7703f['include']=[{'all':!![]}];}_0xb7703f=_[_0x06a1('0x3c')]({},_0xb7703f,_0x28f0df[_0x06a1('0x3f')]);return db['VoiceQueuesLog'][_0x06a1('0x46')](_0xb7703f)[_0x06a1('0x25')](handleEntityNotFound(_0x19bef1,null))[_0x06a1('0x25')](respondWithResult(_0x19bef1,null))['catch'](handleError(_0x19bef1,null));};exports['create']=function(_0xd4bd94,_0x26623c){return db[_0x06a1('0x2b')][_0x06a1('0x47')](_0xd4bd94['body'],{})[_0x06a1('0x25')](respondWithResult(_0x26623c,0xc9))[_0x06a1('0x48')](handleError(_0x26623c,null));};exports[_0x06a1('0x24')]=function(_0x1a541d,_0x406e72){if(_0x1a541d['body']['id']){delete _0x1a541d[_0x06a1('0x49')]['id'];}return db['VoiceQueuesLog']['find']({'where':{'id':_0x1a541d[_0x06a1('0x45')]['id']}})[_0x06a1('0x25')](handleEntityNotFound(_0x406e72,null))['then'](saveUpdates(_0x1a541d[_0x06a1('0x49')],null))[_0x06a1('0x25')](respondWithResult(_0x406e72,null))[_0x06a1('0x48')](handleError(_0x406e72,null));};exports[_0x06a1('0x26')]=function(_0x2aa546,_0xea71fe){return db['VoiceQueuesLog'][_0x06a1('0x46')]({'where':{'id':_0x2aa546['params']['id']}})[_0x06a1('0x25')](handleEntityNotFound(_0xea71fe,null))[_0x06a1('0x25')](removeEntity(_0xea71fe,null))[_0x06a1('0x48')](handleError(_0xea71fe,null));}; \ No newline at end of file +var _0x4f91=['../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','end','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VoiceQueuesLog','include','findAll','rows','catch','params','includeAll','options','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x56e4b7,_0x418cac){var _0x45a4f1=function(_0x587247){while(--_0x587247){_0x56e4b7['push'](_0x56e4b7['shift']());}};_0x45a4f1(++_0x418cac);}(_0x4f91,0xce));var _0x14f9=function(_0x265c2a,_0x2d3040){_0x265c2a=_0x265c2a-0x0;var _0x59ff9c=_0x4f91[_0x265c2a];return _0x59ff9c;};'use strict';var emlformat=require(_0x14f9('0x0'));var rimraf=require(_0x14f9('0x1'));var zipdir=require(_0x14f9('0x2'));var jsonpatch=require(_0x14f9('0x3'));var rp=require(_0x14f9('0x4'));var moment=require(_0x14f9('0x5'));var BPromise=require(_0x14f9('0x6'));var Mustache=require(_0x14f9('0x7'));var util=require('util');var path=require(_0x14f9('0x8'));var sox=require(_0x14f9('0x9'));var csv=require(_0x14f9('0xa'));var ejs=require(_0x14f9('0xb'));var fs=require('fs');var fs_extra=require(_0x14f9('0xc'));var _=require('lodash');var squel=require(_0x14f9('0xd'));var crypto=require(_0x14f9('0xe'));var jsforce=require(_0x14f9('0xf'));var deskjs=require(_0x14f9('0x10'));var toCsv=require(_0x14f9('0xa'));var querystring=require(_0x14f9('0x11'));var Papa=require('papaparse');var Redis=require(_0x14f9('0x12'));var authService=require(_0x14f9('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x14f9('0x14'));var hardwareService=require(_0x14f9('0x15'));var logger=require(_0x14f9('0x16'))(_0x14f9('0x17'));var utils=require(_0x14f9('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x14f9('0x19'));var db=require(_0x14f9('0x1a'))['db'];function respondWithStatusCode(_0x3dfe42,_0x6d179e){_0x6d179e=_0x6d179e||0xcc;return function(_0x44ff6e){if(_0x44ff6e){return _0x3dfe42[_0x14f9('0x1b')](_0x6d179e);}return _0x3dfe42['status'](_0x6d179e)['end']();};}function respondWithResult(_0x36b3b6,_0x2150d9){_0x2150d9=_0x2150d9||0xc8;return function(_0x14b2d4){if(_0x14b2d4){return _0x36b3b6[_0x14f9('0x1c')](_0x2150d9)['json'](_0x14b2d4);}};}function respondWithFilteredResult(_0x2eb76e,_0x9be0b7){return function(_0x2f68b1){if(_0x2f68b1){var _0x4039e8=typeof _0x9be0b7[_0x14f9('0x1d')]===_0x14f9('0x1e')&&typeof _0x9be0b7[_0x14f9('0x1f')]===_0x14f9('0x1e');var _0x597999=_0x2f68b1[_0x14f9('0x20')];var _0x4c2059=_0x4039e8?0x0:_0x9be0b7['offset'];var _0x858a77=_0x4039e8?_0x2f68b1[_0x14f9('0x20')]:_0x9be0b7[_0x14f9('0x1d')]+_0x9be0b7[_0x14f9('0x1f')];var _0x5ddb8f;if(_0x858a77>=_0x597999){_0x858a77=_0x597999;_0x5ddb8f=0xc8;}else{_0x5ddb8f=0xce;}_0x2eb76e[_0x14f9('0x1c')](_0x5ddb8f);return _0x2eb76e[_0x14f9('0x21')](_0x14f9('0x22'),_0x4c2059+'-'+_0x858a77+'/'+_0x597999)[_0x14f9('0x23')](_0x2f68b1);}return null;};}function patchUpdates(_0x4b1fe7){return function(_0x3d4129){try{jsonpatch[_0x14f9('0x24')](_0x3d4129,_0x4b1fe7,!![]);}catch(_0x43670d){return BPromise['reject'](_0x43670d);}return _0x3d4129[_0x14f9('0x25')]();};}function saveUpdates(_0x30c713,_0x5c913e){return function(_0x4e86c8){if(_0x4e86c8){return _0x4e86c8[_0x14f9('0x26')](_0x30c713)[_0x14f9('0x27')](function(_0x3f32c2){return _0x3f32c2;});}return null;};}function removeEntity(_0x125f1f,_0x1ac7d2){return function(_0x192c83){if(_0x192c83){return _0x192c83[_0x14f9('0x28')]()['then'](function(){_0x125f1f['status'](0xcc)[_0x14f9('0x29')]();});}};}function handleEntityNotFound(_0x42b2ae,_0x499e41){return function(_0x1653b9){if(!_0x1653b9){_0x42b2ae['sendStatus'](0x194);}return _0x1653b9;};}function handleError(_0x4b4fa4,_0x63de51){_0x63de51=_0x63de51||0x1f4;return function(_0x287e10){logger['error'](_0x287e10['stack']);if(_0x287e10[_0x14f9('0x2a')]){delete _0x287e10[_0x14f9('0x2a')];}_0x4b4fa4[_0x14f9('0x1c')](_0x63de51)[_0x14f9('0x2b')](_0x287e10);};}exports[_0x14f9('0x2c')]=function(_0x4d82d6,_0x545212){var _0x3f9b01={},_0x38e985={},_0x267029={'count':0x0,'rows':[]};var _0x41aca5=_[_0x14f9('0x2d')](db['VoiceQueuesLog'][_0x14f9('0x2e')],function(_0x392fab){return{'name':_0x392fab[_0x14f9('0x2f')],'type':_0x392fab[_0x14f9('0x30')][_0x14f9('0x31')]};});_0x38e985[_0x14f9('0x32')]=_[_0x14f9('0x2d')](_0x41aca5,_0x14f9('0x2a'));_0x38e985[_0x14f9('0x33')]=_[_0x14f9('0x34')](_0x4d82d6[_0x14f9('0x33')]);_0x38e985[_0x14f9('0x35')]=_[_0x14f9('0x36')](_0x38e985[_0x14f9('0x32')],_0x38e985[_0x14f9('0x33')]);_0x3f9b01['attributes']=_['intersection'](_0x38e985[_0x14f9('0x32')],qs[_0x14f9('0x37')](_0x4d82d6[_0x14f9('0x33')]['fields']));_0x3f9b01[_0x14f9('0x38')]=_0x3f9b01[_0x14f9('0x38')][_0x14f9('0x39')]?_0x3f9b01[_0x14f9('0x38')]:_0x38e985[_0x14f9('0x32')];if(!_0x4d82d6['query'][_0x14f9('0x3a')](_0x14f9('0x3b'))){_0x3f9b01[_0x14f9('0x1f')]=qs[_0x14f9('0x1f')](_0x4d82d6[_0x14f9('0x33')][_0x14f9('0x1f')]);_0x3f9b01['offset']=qs[_0x14f9('0x1d')](_0x4d82d6[_0x14f9('0x33')]['offset']);}_0x3f9b01[_0x14f9('0x3c')]=qs['sort'](_0x4d82d6[_0x14f9('0x33')][_0x14f9('0x3d')]);_0x3f9b01[_0x14f9('0x3e')]=qs[_0x14f9('0x35')](_[_0x14f9('0x3f')](_0x4d82d6['query'],_0x38e985[_0x14f9('0x35')]),_0x41aca5);if(_0x4d82d6['query'][_0x14f9('0x40')]){_0x3f9b01[_0x14f9('0x3e')]=_[_0x14f9('0x41')](_0x3f9b01[_0x14f9('0x3e')],{'$or':_[_0x14f9('0x2d')](_0x41aca5,function(_0x43dac7){if(_0x43dac7[_0x14f9('0x30')]!=='VIRTUAL'){var _0x14528c={};_0x14528c[_0x43dac7['name']]={'$like':'%'+_0x4d82d6[_0x14f9('0x33')][_0x14f9('0x40')]+'%'};return _0x14528c;}})});}_0x3f9b01=_[_0x14f9('0x41')]({},_0x3f9b01,_0x4d82d6['options']);var _0x20b539={'where':_0x3f9b01['where']};return db[_0x14f9('0x42')][_0x14f9('0x20')](_0x20b539)['then'](function(_0x5e441f){_0x267029[_0x14f9('0x20')]=_0x5e441f;if(_0x4d82d6[_0x14f9('0x33')]['includeAll']){_0x3f9b01[_0x14f9('0x43')]=[{'all':!![]}];}return db[_0x14f9('0x42')][_0x14f9('0x44')](_0x3f9b01);})['then'](function(_0x45b12f){_0x267029[_0x14f9('0x45')]=_0x45b12f;return _0x267029;})[_0x14f9('0x27')](respondWithFilteredResult(_0x545212,_0x3f9b01))[_0x14f9('0x46')](handleError(_0x545212,null));};exports['show']=function(_0x3cf25a,_0x55809c){var _0x4ed691={'raw':!![],'where':{'id':_0x3cf25a[_0x14f9('0x47')]['id']}},_0x12fabf={};_0x12fabf[_0x14f9('0x32')]=_[_0x14f9('0x34')](db['VoiceQueuesLog']['rawAttributes']);_0x12fabf['query']=_['keys'](_0x3cf25a['query']);_0x12fabf[_0x14f9('0x35')]=_[_0x14f9('0x36')](_0x12fabf[_0x14f9('0x32')],_0x12fabf['query']);_0x4ed691['attributes']=_[_0x14f9('0x36')](_0x12fabf[_0x14f9('0x32')],qs[_0x14f9('0x37')](_0x3cf25a[_0x14f9('0x33')]['fields']));_0x4ed691[_0x14f9('0x38')]=_0x4ed691['attributes'][_0x14f9('0x39')]?_0x4ed691[_0x14f9('0x38')]:_0x12fabf[_0x14f9('0x32')];if(_0x3cf25a[_0x14f9('0x33')][_0x14f9('0x48')]){_0x4ed691[_0x14f9('0x43')]=[{'all':!![]}];}_0x4ed691=_[_0x14f9('0x41')]({},_0x4ed691,_0x3cf25a[_0x14f9('0x49')]);return db['VoiceQueuesLog']['find'](_0x4ed691)[_0x14f9('0x27')](handleEntityNotFound(_0x55809c,null))[_0x14f9('0x27')](respondWithResult(_0x55809c,null))[_0x14f9('0x46')](handleError(_0x55809c,null));};exports[_0x14f9('0x4a')]=function(_0x43c177,_0x48bc40){return db[_0x14f9('0x42')][_0x14f9('0x4a')](_0x43c177['body'],{})[_0x14f9('0x27')](respondWithResult(_0x48bc40,0xc9))[_0x14f9('0x46')](handleError(_0x48bc40,null));};exports[_0x14f9('0x26')]=function(_0x4a0c0c,_0x3477ea){if(_0x4a0c0c[_0x14f9('0x4b')]['id']){delete _0x4a0c0c[_0x14f9('0x4b')]['id'];}return db[_0x14f9('0x42')][_0x14f9('0x4c')]({'where':{'id':_0x4a0c0c[_0x14f9('0x47')]['id']}})[_0x14f9('0x27')](handleEntityNotFound(_0x3477ea,null))[_0x14f9('0x27')](saveUpdates(_0x4a0c0c[_0x14f9('0x4b')],null))[_0x14f9('0x27')](respondWithResult(_0x3477ea,null))[_0x14f9('0x46')](handleError(_0x3477ea,null));};exports['destroy']=function(_0x2c1b83,_0x31cb6f){return db[_0x14f9('0x42')][_0x14f9('0x4c')]({'where':{'id':_0x2c1b83[_0x14f9('0x47')]['id']}})[_0x14f9('0x27')](handleEntityNotFound(_0x31cb6f,null))[_0x14f9('0x27')](removeEntity(_0x31cb6f,null))[_0x14f9('0x46')](handleError(_0x31cb6f,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 04e0ede..f73a64c 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 _0xa3b4=['bluebird','request-promise','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','util','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa3b4,0x130));var _0x4a3b=function(_0x401fb4,_0x3317d7){_0x401fb4=_0x401fb4-0x0;var _0x5bed92=_0xa3b4[_0x401fb4];return _0x5bed92;};'use strict';var _=require('lodash');var util=require(_0x4a3b('0x0'));var logger=require(_0x4a3b('0x1'))(_0x4a3b('0x2'));var moment=require(_0x4a3b('0x3'));var BPromise=require(_0x4a3b('0x4'));var rp=require(_0x4a3b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4a3b('0x6'));var attributes=require(_0x4a3b('0x7'));module[_0x4a3b('0x8')]=function(_0x3acfed,_0x4b6b77){return _0x3acfed[_0x4a3b('0x9')](_0x4a3b('0xa'),attributes,{'tableName':_0x4a3b('0xb'),'paranoid':![],'indexes':[{'name':_0x4a3b('0xc'),'fields':[_0x4a3b('0xd'),'dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0xd698=['dtm','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','define','VoiceQueuesLog','voice_queues_log','event_dtm','event'];(function(_0x327c12,_0x2874c9){var _0x4cd602=function(_0x3b82f4){while(--_0x3b82f4){_0x327c12['push'](_0x327c12['shift']());}};_0x4cd602(++_0x2874c9);}(_0xd698,0x1a5));var _0x8d69=function(_0x17137d,_0x505ed0){_0x17137d=_0x17137d-0x0;var _0x1a5ae4=_0xd698[_0x17137d];return _0x1a5ae4;};'use strict';var _=require(_0x8d69('0x0'));var util=require('util');var logger=require(_0x8d69('0x1'))(_0x8d69('0x2'));var moment=require('moment');var BPromise=require(_0x8d69('0x3'));var rp=require(_0x8d69('0x4'));var fs=require('fs');var path=require(_0x8d69('0x5'));var rimraf=require(_0x8d69('0x6'));var config=require(_0x8d69('0x7'));var attributes=require(_0x8d69('0x8'));module['exports']=function(_0x5deded,_0x42072e){return _0x5deded[_0x8d69('0x9')](_0x8d69('0xa'),attributes,{'tableName':_0x8d69('0xb'),'paranoid':![],'indexes':[{'name':_0x8d69('0xc'),'fields':[_0x8d69('0xd'),_0x8d69('0xe')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index d97eaac..306d6b2 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 _0xf430=['error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','then','info','VoiceQueuesLog,\x20%s,\x20%s','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x402731,_0x43c115){var _0x111736=function(_0x5a7044){while(--_0x5a7044){_0x402731['push'](_0x402731['shift']());}};_0x111736(++_0x43c115);}(_0xf430,0x1e4));var _0x0f43=function(_0x4d6bfd,_0x8d79ff){_0x4d6bfd=_0x4d6bfd-0x0;var _0x243a46=_0xf430[_0x4d6bfd];return _0x243a46;};'use strict';var _=require(_0x0f43('0x0'));var util=require(_0x0f43('0x1'));var moment=require(_0x0f43('0x2'));var BPromise=require('bluebird');var rs=require(_0x0f43('0x3'));var fs=require('fs');var Redis=require(_0x0f43('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0f43('0x5'))(_0x0f43('0x6'));var config=require(_0x0f43('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0f43('0x8')][_0x0f43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x490bc1,_0x562cf2,_0x2e8f68){return new BPromise(function(_0x39bc4c,_0x18e735){return client['request'](_0x490bc1,_0x2e8f68)[_0x0f43('0xa')](function(_0x59508b){logger[_0x0f43('0xb')](_0x0f43('0xc'),_0x562cf2,'request\x20sent');logger['debug'](_0x0f43('0xd'),_0x562cf2,_0x0f43('0xe'),JSON[_0x0f43('0xf')](_0x59508b));if(_0x59508b[_0x0f43('0x10')]){if(_0x59508b[_0x0f43('0x10')]['code']===0x1f4){logger[_0x0f43('0x10')](_0x0f43('0xc'),_0x562cf2,_0x59508b[_0x0f43('0x10')][_0x0f43('0x11')]);return _0x18e735(_0x59508b[_0x0f43('0x10')][_0x0f43('0x11')]);}logger[_0x0f43('0x10')](_0x0f43('0xc'),_0x562cf2,_0x59508b[_0x0f43('0x10')][_0x0f43('0x11')]);return _0x39bc4c(_0x59508b[_0x0f43('0x10')]['message']);}else{logger[_0x0f43('0xb')](_0x0f43('0xc'),_0x562cf2,'request\x20sent');_0x39bc4c(_0x59508b[_0x0f43('0x12')][_0x0f43('0x11')]);}})[_0x0f43('0x13')](function(_0x5631e1){logger[_0x0f43('0x10')]('VoiceQueuesLog,\x20%s,\x20%s',_0x562cf2,_0x5631e1);_0x18e735(_0x5631e1);});});} \ No newline at end of file +var _0xc2fe=['then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x38fb8b,_0x70dd0a){var _0x1ec681=function(_0x58f130){while(--_0x58f130){_0x38fb8b['push'](_0x38fb8b['shift']());}};_0x1ec681(++_0x70dd0a);}(_0xc2fe,0x1d9));var _0xec2f=function(_0x4bc3c9,_0x433e41){_0x4bc3c9=_0x4bc3c9-0x0;var _0x4173bf=_0xc2fe[_0x4bc3c9];return _0x4173bf;};'use strict';var _=require(_0xec2f('0x0'));var util=require(_0xec2f('0x1'));var moment=require(_0xec2f('0x2'));var BPromise=require(_0xec2f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xec2f('0x4'))['db'];var utils=require(_0xec2f('0x5'));var logger=require(_0xec2f('0x6'))('rpc');var config=require(_0xec2f('0x7'));var jayson=require(_0xec2f('0x8'));var client=jayson[_0xec2f('0x9')][_0xec2f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b52a8,_0x2602d9,_0x4d0ed0){return new BPromise(function(_0x516ff3,_0x1fbd46){return client['request'](_0x4b52a8,_0x4d0ed0)[_0xec2f('0xb')](function(_0x31d706){logger[_0xec2f('0xc')](_0xec2f('0xd'),_0x2602d9,_0xec2f('0xe'));logger[_0xec2f('0xf')](_0xec2f('0x10'),_0x2602d9,'request\x20sent',JSON['stringify'](_0x31d706));if(_0x31d706[_0xec2f('0x11')]){if(_0x31d706['error'][_0xec2f('0x12')]===0x1f4){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x2602d9,_0x31d706[_0xec2f('0x11')][_0xec2f('0x13')]);return _0x1fbd46(_0x31d706[_0xec2f('0x11')][_0xec2f('0x13')]);}logger['error'](_0xec2f('0xd'),_0x2602d9,_0x31d706['error'][_0xec2f('0x13')]);return _0x516ff3(_0x31d706[_0xec2f('0x11')][_0xec2f('0x13')]);}else{logger[_0xec2f('0xc')](_0xec2f('0xd'),_0x2602d9,_0xec2f('0xe'));_0x516ff3(_0x31d706[_0xec2f('0x14')][_0xec2f('0x13')]);}})[_0xec2f('0x15')](function(_0x1d4131){logger[_0xec2f('0x11')](_0xec2f('0xd'),_0x2602d9,_0x1d4131);_0x1fbd46(_0x1d4131);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 6301b6e..9446889 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 _0x21d3=['Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/download','download','downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','update','delete','destroy','exports','path','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x21d3,0x16a));var _0x321d=function(_0x253ff4,_0x421e57){_0x253ff4=_0x253ff4-0x0;var _0x25b98e=_0x21d3[_0x253ff4];return _0x25b98e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x321d('0x0'));var timeout=require(_0x321d('0x1'));var express=require('express');var router=express[_0x321d('0x2')]();var fs_extra=require(_0x321d('0x3'));var auth=require(_0x321d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x321d('0x5'));var controller=require('./voiceRecording.controller');router['get']('/',auth[_0x321d('0x6')](),controller[_0x321d('0x7')]);router[_0x321d('0x8')](_0x321d('0x9'),auth[_0x321d('0x6')](),controller[_0x321d('0xa')]);router[_0x321d('0x8')](_0x321d('0xb'),auth[_0x321d('0x6')](),controller[_0x321d('0xc')]);router[_0x321d('0x8')](_0x321d('0xd'),auth[_0x321d('0x6')](),controller[_0x321d('0xe')]);router['get']('/:id/downloads',controller[_0x321d('0xf')]);router['get'](_0x321d('0x10'),auth[_0x321d('0x6')](),controller[_0x321d('0x11')]);router[_0x321d('0x12')]('/',auth['isAuthenticated'](),controller[_0x321d('0x13')]);router[_0x321d('0x12')](_0x321d('0x10'),auth[_0x321d('0x6')](),controller[_0x321d('0x14')]);router[_0x321d('0x15')](_0x321d('0xb'),auth['isAuthenticated'](),controller[_0x321d('0x16')]);router[_0x321d('0x17')]('/:id',auth[_0x321d('0x6')](),controller[_0x321d('0x18')]);module[_0x321d('0x19')]=router; \ No newline at end of file +var _0x81f1=['delete','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/download','download','downloadTranscribe','post','create','/:id/transcribe','put'];(function(_0x44c974,_0x1bcfde){var _0x5214c6=function(_0x10aad5){while(--_0x10aad5){_0x44c974['push'](_0x44c974['shift']());}};_0x5214c6(++_0x1bcfde);}(_0x81f1,0xca));var _0x181f=function(_0x4a0f68,_0x55c774){_0x4a0f68=_0x4a0f68-0x0;var _0x52e11b=_0x81f1[_0x4a0f68];return _0x52e11b;};'use strict';var multer=require('multer');var util=require(_0x181f('0x0'));var path=require(_0x181f('0x1'));var timeout=require(_0x181f('0x2'));var express=require(_0x181f('0x3'));var router=express['Router']();var fs_extra=require(_0x181f('0x4'));var auth=require(_0x181f('0x5'));var interaction=require(_0x181f('0x6'));var config=require(_0x181f('0x7'));var controller=require(_0x181f('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x181f('0x9')]);router[_0x181f('0xa')](_0x181f('0xb'),auth[_0x181f('0xc')](),controller[_0x181f('0xd')]);router[_0x181f('0xa')](_0x181f('0xe'),auth[_0x181f('0xc')](),controller[_0x181f('0xf')]);router[_0x181f('0xa')](_0x181f('0x10'),auth[_0x181f('0xc')](),controller[_0x181f('0x11')]);router['get']('/:id/downloads',controller['downloads']);router[_0x181f('0xa')]('/:id/transcribe',auth[_0x181f('0xc')](),controller[_0x181f('0x12')]);router[_0x181f('0x13')]('/',auth['isAuthenticated'](),controller[_0x181f('0x14')]);router[_0x181f('0x13')](_0x181f('0x15'),auth[_0x181f('0xc')](),controller['runTranscribe']);router[_0x181f('0x16')]('/:id',auth[_0x181f('0xc')](),controller['update']);router[_0x181f('0x17')]('/:id',auth[_0x181f('0xc')](),controller['destroy']);module[_0x181f('0x18')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index d31ece0..391a723 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(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file +var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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 2175685..53cd528 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 _0xecc7=['value','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','filename','extname','unlink','message','VoiceRecording\x20not\x20found','send','Not\x20found','sequelize','MD5','token','$and','push','ValidationError','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','isNil','unlinkSync','listBuckets','createBucket','upload','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','bucket','Bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','transcribeName','TranscriptionJob','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','save','update','then','destroy','error','name','index','map','VoiceRecording','rawAttributes','fieldName','type','key','differenceBy','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','findAll','rows','catch','show','params','keys','length','include','options','find','create','body','describe','download','../../components/encryptor','uniqueid'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0xecc7,0xe7));var _0x7ecc=function(_0xd02042,_0x571a85){_0xd02042=_0xd02042-0x0;var _0x4cc1fd=_0xecc7[_0xd02042];return _0x4cc1fd;};'use strict';var emlformat=require(_0x7ecc('0x0'));var rimraf=require(_0x7ecc('0x1'));var zipdir=require(_0x7ecc('0x2'));var jsonpatch=require(_0x7ecc('0x3'));var rp=require('request-promise');var moment=require(_0x7ecc('0x4'));var BPromise=require(_0x7ecc('0x5'));var Mustache=require(_0x7ecc('0x6'));var util=require('util');var path=require(_0x7ecc('0x7'));var sox=require('sox');var csv=require(_0x7ecc('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7ecc('0x9'));var _=require(_0x7ecc('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7ecc('0x8'));var querystring=require('querystring');var Papa=require(_0x7ecc('0xb'));var AWS=require(_0x7ecc('0xc'));var uuidv4=require(_0x7ecc('0xd'));var Redis=require(_0x7ecc('0xe'));var authService=require(_0x7ecc('0xf'));var qs=require(_0x7ecc('0x10'));var as=require(_0x7ecc('0x11'));var hardwareService=require(_0x7ecc('0x12'));var logger=require(_0x7ecc('0x13'))('api');var utils=require(_0x7ecc('0x14'));var config=require(_0x7ecc('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x7ecc('0x16'))['db'];function respondWithStatusCode(_0x207889,_0x27e923){_0x27e923=_0x27e923||0xcc;return function(_0xf002c8){if(_0xf002c8){return _0x207889[_0x7ecc('0x17')](_0x27e923);}return _0x207889['status'](_0x27e923)[_0x7ecc('0x18')]();};}function respondWithResult(_0x54eb0f,_0x32552d){_0x32552d=_0x32552d||0xc8;return function(_0x17c3eb){if(_0x17c3eb){return _0x54eb0f[_0x7ecc('0x19')](_0x32552d)['json'](_0x17c3eb);}};}function respondWithFilteredResult(_0x15b441,_0x4122dd){return function(_0xa636d9){if(_0xa636d9){var _0x5c62fe=typeof _0x4122dd[_0x7ecc('0x1a')]===_0x7ecc('0x1b')&&typeof _0x4122dd[_0x7ecc('0x1c')]==='undefined';var _0x5ceaf3=_0xa636d9[_0x7ecc('0x1d')];var _0x2f724b=_0x5c62fe?0x0:_0x4122dd[_0x7ecc('0x1a')];var _0x55b8c5=_0x5c62fe?_0xa636d9[_0x7ecc('0x1d')]:_0x4122dd[_0x7ecc('0x1a')]+_0x4122dd['limit'];var _0x1bc690;if(_0x55b8c5>=_0x5ceaf3){_0x55b8c5=_0x5ceaf3;_0x1bc690=0xc8;}else{_0x1bc690=0xce;}_0x15b441[_0x7ecc('0x19')](_0x1bc690);return _0x15b441['set'](_0x7ecc('0x1e'),_0x2f724b+'-'+_0x55b8c5+'/'+_0x5ceaf3)[_0x7ecc('0x1f')](_0xa636d9);}return null;};}function patchUpdates(_0x21186e){return function(_0x13e085){try{jsonpatch[_0x7ecc('0x20')](_0x13e085,_0x21186e,!![]);}catch(_0xcbc133){return BPromise['reject'](_0xcbc133);}return _0x13e085[_0x7ecc('0x21')]();};}function saveUpdates(_0x16f7b2,_0x45b2a9){return function(_0x5c7300){if(_0x5c7300){return _0x5c7300[_0x7ecc('0x22')](_0x16f7b2)[_0x7ecc('0x23')](function(_0x39976f){return _0x39976f;});}return null;};}function removeEntity(_0x3f3c49,_0x5673fd){return function(_0xffc5a1){if(_0xffc5a1){return _0xffc5a1[_0x7ecc('0x24')]()[_0x7ecc('0x23')](function(){_0x3f3c49['status'](0xcc)[_0x7ecc('0x18')]();});}};}function handleEntityNotFound(_0x45bd74,_0x11d80b){return function(_0x249a29){if(!_0x249a29){_0x45bd74[_0x7ecc('0x17')](0x194);}return _0x249a29;};}function handleError(_0x3bd888,_0x45f719){_0x45f719=_0x45f719||0x1f4;return function(_0x277673){logger[_0x7ecc('0x25')](_0x277673['stack']);if(_0x277673[_0x7ecc('0x26')]){delete _0x277673['name'];}_0x3bd888[_0x7ecc('0x19')](_0x45f719)['send'](_0x277673);};}exports[_0x7ecc('0x27')]=function(_0x413dc4,_0x52aa49){var _0x19e997={},_0x5e57f0={},_0x39c067={'count':0x0,'rows':[]};var _0x1a2bbb=_[_0x7ecc('0x28')](db[_0x7ecc('0x29')][_0x7ecc('0x2a')],function(_0x37461b){return{'name':_0x37461b[_0x7ecc('0x2b')],'type':_0x37461b[_0x7ecc('0x2c')][_0x7ecc('0x2d')]};});_0x5e57f0['model']=_[_0x7ecc('0x2e')](_[_0x7ecc('0x28')](_0x1a2bbb,_0x7ecc('0x26')),['format']);_0x5e57f0[_0x7ecc('0x2f')]=_['keys'](_0x413dc4[_0x7ecc('0x2f')]);_0x5e57f0[_0x7ecc('0x30')]=_[_0x7ecc('0x31')](_0x5e57f0[_0x7ecc('0x32')],_0x5e57f0[_0x7ecc('0x2f')]);_0x19e997['attributes']=_[_0x7ecc('0x31')](_0x5e57f0['model'],qs['fields'](_0x413dc4[_0x7ecc('0x2f')][_0x7ecc('0x33')]));_0x19e997['attributes']=_0x19e997[_0x7ecc('0x34')]['length']?_0x19e997['attributes']:_0x5e57f0[_0x7ecc('0x32')];if(!_0x413dc4['query'][_0x7ecc('0x35')](_0x7ecc('0x36'))){_0x19e997[_0x7ecc('0x1c')]=qs[_0x7ecc('0x1c')](_0x413dc4['query']['limit']);_0x19e997['offset']=qs[_0x7ecc('0x1a')](_0x413dc4[_0x7ecc('0x2f')]['offset']);}_0x19e997['order']=qs[_0x7ecc('0x37')](_0x413dc4[_0x7ecc('0x2f')][_0x7ecc('0x37')]);_0x19e997[_0x7ecc('0x38')]=qs[_0x7ecc('0x30')](_[_0x7ecc('0x39')](_0x413dc4['query'],_0x5e57f0[_0x7ecc('0x30')]),_0x1a2bbb);if(_0x413dc4[_0x7ecc('0x2f')][_0x7ecc('0x3a')]){_0x19e997[_0x7ecc('0x38')]=_['merge'](_0x19e997[_0x7ecc('0x38')],{'$or':_[_0x7ecc('0x28')](_0x1a2bbb,function(_0x396726){if(_0x396726[_0x7ecc('0x2c')]!==_0x7ecc('0x3b')){var _0x30e12b={};_0x30e12b[_0x396726[_0x7ecc('0x26')]]={'$like':'%'+_0x413dc4[_0x7ecc('0x2f')][_0x7ecc('0x3a')]+'%'};return _0x30e12b;}})});}_0x19e997=_[_0x7ecc('0x3c')]({},_0x19e997,_0x413dc4['options']);var _0x3d52a0={'where':_0x19e997[_0x7ecc('0x38')]};return db['VoiceRecording'][_0x7ecc('0x1d')](_0x3d52a0)[_0x7ecc('0x23')](function(_0x39e7b9){_0x39c067[_0x7ecc('0x1d')]=_0x39e7b9;if(_0x413dc4[_0x7ecc('0x2f')]['includeAll']){_0x19e997['include']=[{'all':!![]}];}return db['VoiceRecording'][_0x7ecc('0x3d')](_0x19e997);})['then'](function(_0x2b5b0c){_0x39c067[_0x7ecc('0x3e')]=_0x2b5b0c;return _0x39c067;})[_0x7ecc('0x23')](respondWithFilteredResult(_0x52aa49,_0x19e997))[_0x7ecc('0x3f')](handleError(_0x52aa49,null));};exports[_0x7ecc('0x40')]=function(_0x49184c,_0x3826d9){var _0x24add1={'raw':![],'where':{'id':_0x49184c[_0x7ecc('0x41')]['id']}},_0x381e61={};_0x381e61['model']=_[_0x7ecc('0x42')](db[_0x7ecc('0x29')]['rawAttributes']);_0x381e61[_0x7ecc('0x2f')]=_[_0x7ecc('0x42')](_0x49184c[_0x7ecc('0x2f')]);_0x381e61['filters']=_[_0x7ecc('0x31')](_0x381e61[_0x7ecc('0x32')],_0x381e61[_0x7ecc('0x2f')]);_0x24add1[_0x7ecc('0x34')]=_[_0x7ecc('0x31')](_0x381e61[_0x7ecc('0x32')],qs[_0x7ecc('0x33')](_0x49184c[_0x7ecc('0x2f')][_0x7ecc('0x33')]));_0x24add1[_0x7ecc('0x34')]=_0x24add1[_0x7ecc('0x34')][_0x7ecc('0x43')]?_0x24add1[_0x7ecc('0x34')]:_0x381e61['model'];if(_0x49184c['query']['includeAll']){_0x24add1[_0x7ecc('0x44')]=[{'all':!![]}];}_0x24add1=_[_0x7ecc('0x3c')]({},_0x24add1,_0x49184c[_0x7ecc('0x45')]);return db[_0x7ecc('0x29')][_0x7ecc('0x46')](_0x24add1)['then'](handleEntityNotFound(_0x3826d9,null))[_0x7ecc('0x23')](respondWithResult(_0x3826d9,null))[_0x7ecc('0x3f')](handleError(_0x3826d9,null));};exports[_0x7ecc('0x47')]=function(_0x2bee19,_0x5ec663){return db[_0x7ecc('0x29')][_0x7ecc('0x47')](_0x2bee19[_0x7ecc('0x48')],{})[_0x7ecc('0x23')](respondWithResult(_0x5ec663,0xc9))[_0x7ecc('0x3f')](handleError(_0x5ec663,null));};exports[_0x7ecc('0x22')]=function(_0x3355f5,_0x5a88d6){if(_0x3355f5[_0x7ecc('0x48')]['id']){delete _0x3355f5[_0x7ecc('0x48')]['id'];}return db[_0x7ecc('0x29')][_0x7ecc('0x46')]({'where':{'id':_0x3355f5[_0x7ecc('0x41')]['id']}})['then'](handleEntityNotFound(_0x5a88d6,null))[_0x7ecc('0x23')](saveUpdates(_0x3355f5[_0x7ecc('0x48')],null))[_0x7ecc('0x23')](respondWithResult(_0x5a88d6,null))[_0x7ecc('0x3f')](handleError(_0x5a88d6,null));};exports[_0x7ecc('0x49')]=function(_0x4debea,_0x16ad5f){return db[_0x7ecc('0x29')][_0x7ecc('0x49')]()[_0x7ecc('0x23')](respondWithResult(_0x16ad5f,null))[_0x7ecc('0x3f')](handleError(_0x16ad5f,null));};exports[_0x7ecc('0x4a')]=function(_0x4e1c4a,_0x5a8681,_0x2a05eb){var _0x44d59d=require(_0x7ecc('0x4b'));var _0x8650e7=![];var _0x373c43={};if(_0x4e1c4a['query']['type']&&_0x4e1c4a[_0x7ecc('0x2f')]['type']===_0x7ecc('0x4c')){_0x373c43['uniqueid']=_0x4e1c4a[_0x7ecc('0x41')]['id'];}else{_0x373c43['id']=_0x4e1c4a[_0x7ecc('0x41')]['id'];}return db[_0x7ecc('0x29')][_0x7ecc('0x46')]({'where':_0x373c43,'attributes':['id',_0x7ecc('0x4d')],'raw':!![]})['then'](handleEntityNotFound(_0x5a8681,null))[_0x7ecc('0x23')](function(_0x42ff93){if(_0x42ff93){var _0x2d6cb3=_0x42ff93[_0x7ecc('0x4d')];var _0x4ec59a=util[_0x7ecc('0x4e')](_0x7ecc('0x4f'),_0x2d6cb3);if(fs[_0x7ecc('0x50')](_0x4ec59a)){_0x8650e7=!![];return _0x44d59d[_0x7ecc('0x51')](_0x4ec59a,_0x2d6cb3,config[_0x7ecc('0x52')][_0x7ecc('0x53')])[_0x7ecc('0x23')](function(){return _0x42ff93;});}return _0x42ff93;}})[_0x7ecc('0x23')](function(_0x393c02){if(_0x393c02){var _0xb9778a=_0x393c02[_0x7ecc('0x4d')];if(!fs[_0x7ecc('0x50')](_0xb9778a)){throw new db[(_0x7ecc('0x54'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x393c02[_0x7ecc('0x55')]){return _0x5a8681[_0x7ecc('0x4a')](_0xb9778a,_0x393c02[_0x7ecc('0x55')]+path[_0x7ecc('0x56')](_0xb9778a),function(){if(_0x8650e7){fs[_0x7ecc('0x57')](_0xb9778a);}});}else{return _0x5a8681[_0x7ecc('0x4a')](_0xb9778a,function(_0xc1c155){if(_0x8650e7){fs[_0x7ecc('0x57')](_0xb9778a);}});}}})[_0x7ecc('0x3f')](function(_0x2841a5){if(_0x2841a5[_0x7ecc('0x58')]===_0x7ecc('0x59')){_0x5a8681['status'](0x194)[_0x7ecc('0x5a')](_0x7ecc('0x5b'));}else{return handleError(_0x5a8681,null);}});};exports['downloads']=function(_0x40127c,_0x5c4eab,_0x5015e2){var _0x45c7f9=require(_0x7ecc('0x4b'));var _0x3aff38=![];var _0x17a3b7={'$and':[db['sequelize'][_0x7ecc('0x38')](db[_0x7ecc('0x5c')]['fn'](_0x7ecc('0x5d'),db[_0x7ecc('0x5c')]['col'](_0x7ecc('0x4c'))),_0x40127c['query'][_0x7ecc('0x5e')])]};if(_0x40127c[_0x7ecc('0x2f')]['type']&&_0x40127c['query'][_0x7ecc('0x2c')]===_0x7ecc('0x4c')){_0x17a3b7[_0x7ecc('0x5f')][_0x7ecc('0x60')]({'uniqueid':_0x40127c['params']['id']});}else{_0x17a3b7[_0x7ecc('0x5f')][_0x7ecc('0x60')]({'id':_0x40127c[_0x7ecc('0x41')]['id']});}return db[_0x7ecc('0x29')][_0x7ecc('0x46')]({'where':_0x17a3b7,'attributes':['id',_0x7ecc('0x4d')],'raw':!![]})['then'](handleEntityNotFound(_0x5c4eab,null))[_0x7ecc('0x23')](function(_0x5aecf1){if(_0x5aecf1){var _0x80900f=util[_0x7ecc('0x4e')](_0x7ecc('0x4f'),_0x5aecf1[_0x7ecc('0x4d')]);if(fs[_0x7ecc('0x50')](_0x80900f)){_0x3aff38=!![];return _0x45c7f9['decryptFile'](_0x80900f,_0x5aecf1[_0x7ecc('0x4d')],config[_0x7ecc('0x52')][_0x7ecc('0x53')])[_0x7ecc('0x23')](function(){return _0x5aecf1;});}return _0x5aecf1;}})[_0x7ecc('0x23')](function(_0x5e7a1e){if(_0x5e7a1e){if(!fs[_0x7ecc('0x50')](_0x5e7a1e[_0x7ecc('0x4d')])){throw new db[(_0x7ecc('0x54'))][(_0x7ecc('0x61'))](_0x7ecc('0x59'));}if(_0x5e7a1e[_0x7ecc('0x55')]){return _0x5c4eab[_0x7ecc('0x4a')](_0x5e7a1e[_0x7ecc('0x4d')],_0x5e7a1e[_0x7ecc('0x55')]+path[_0x7ecc('0x56')](_0x5e7a1e[_0x7ecc('0x4d')]),function(){if(_0x3aff38){fs[_0x7ecc('0x57')](_0x5e7a1e[_0x7ecc('0x4d')]);}});}else{return _0x5c4eab[_0x7ecc('0x4a')](_0x5e7a1e[_0x7ecc('0x4d')],function(_0x5dbec7){if(_0x3aff38){fs[_0x7ecc('0x57')](_0x5e7a1e['value']);}});}}})['catch'](handleError(_0x5c4eab,null));};exports[_0x7ecc('0x24')]=function(_0xbc479b,_0x5e9180){return db[_0x7ecc('0x29')][_0x7ecc('0x46')]({'where':{'id':_0xbc479b[_0x7ecc('0x41')]['id']}})[_0x7ecc('0x23')](function(_0x4329a9){if(_['isNil'](_0x4329a9)){throw new ReferenceError(_0x7ecc('0x62'));}return _0x4329a9;})[_0x7ecc('0x23')](function(_0x3a2a12){var _0x396719=_0x3a2a12[_0x7ecc('0x4d')];logger[_0x7ecc('0x63')](_0x7ecc('0x64'),_0x396719);if(!_['isNil'](_0x3a2a12[_0x7ecc('0x4d')])&&fs[_0x7ecc('0x50')](_0x396719)){logger[_0x7ecc('0x63')](_0x7ecc('0x65')+_0x396719+_0x7ecc('0x66'));fs['unlinkSync'](_0x396719);}_0x396719=_0x396719+_0x7ecc('0x67');if(!_[_0x7ecc('0x68')](_0x3a2a12[_0x7ecc('0x4d')])&&fs[_0x7ecc('0x50')](_0x396719)){logger['info'](_0x7ecc('0x65')+_0x396719+_0x7ecc('0x66'));fs[_0x7ecc('0x69')](_0x396719);}return _0x3a2a12;})['then'](function(_0x2c21ed){if(!_0x2c21ed)throw new InternalError();return _0x2c21ed['destroy']();})['then'](function(){_0x5e9180[_0x7ecc('0x19')](0xcc)['end']();})['catch'](handleError(_0x5e9180,null));};function getBucketslist(_0x450920,_0x3b5566,_0x4c69d9){return new Promise(function(_0x2fbcbd,_0x2770a9){var _0x151cdf=new AWS['S3']({'accessKeyId':_0x3b5566,'secretAccessKey':_0x450920,'region':_0x4c69d9});_0x151cdf[_0x7ecc('0x6a')]({},function(_0x58f323,_0x2d5306){if(_0x58f323){return _0x2770a9(_0x58f323);}else{return _0x2fbcbd(_0x2d5306);}});});}function createBucket(_0x3a0f36,_0x30b74f,_0x3b19cb,_0x2cb0a8){return new Promise(function(_0x9602b8,_0x24d0d3){var _0x294796=new AWS['S3']({'accessKeyId':_0x30b74f,'secretAccessKey':_0x3a0f36,'region':_0x3b19cb});_0x294796[_0x7ecc('0x6b')]({'Bucket':_0x2cb0a8},function(_0x4157f4,_0x136e41){if(_0x4157f4){return _0x24d0d3(_0x4157f4);}else{return _0x9602b8(_0x136e41);}});});}function uploadFile(_0x2f3370,_0x361f68,_0x21a2b4,_0x1f38e8,_0x4087c0,_0x3ccd4b){return new Promise(function(_0x231e4b,_0x483313){var _0x1cba97=new AWS['S3']({'accessKeyId':_0x361f68,'secretAccessKey':_0x2f3370,'region':_0x21a2b4});_0x1cba97[_0x7ecc('0x6c')]({'Bucket':_0x1f38e8,'Key':_0x4087c0,'Body':_0x3ccd4b},function(_0x51c5e3,_0x394abc){if(_0x51c5e3){return _0x483313(_0x51c5e3);}else{return _0x231e4b(_0x394abc);}});});}function startTranscribe(_0x2e8ba3,_0x5b6692,_0x1bef7b,_0x207d61,_0x3b6ff3,_0x10e029){return new Promise(function(_0x420f66,_0x15677e){var _0x3acbc4=new AWS[(_0x7ecc('0x6d'))]({'accessKeyId':_0x5b6692,'secretAccessKey':_0x2e8ba3,'region':_0x1bef7b});_0x3acbc4['startTranscriptionJob']({'TranscriptionJobName':_0x207d61,'LanguageCode':_0x3b6ff3,'Media':{'MediaFileUri':_0x10e029}},function(_0x2c167d,_0x30ad95){if(_0x2c167d){return _0x15677e(_0x2c167d);}else{return _0x420f66(_0x30ad95);}});});}function transcribe(_0x331f47,_0x235a0a,_0x3ed6ec,_0x5034ca,_0x30e4c5,_0x36522d,_0x348965){return new Promise(function(_0x253dad,_0x229610){var _0x297fb8={};logger[_0x7ecc('0x63')](util[_0x7ecc('0x4e')](_0x7ecc('0x6e'),_0x331f47,_0x30e4c5));return uploadFile(_0x235a0a,_0x3ed6ec,_0x5034ca,_0x30e4c5,path['basename'](_0x36522d),fs['readFileSync'](_0x36522d))[_0x7ecc('0x23')](function(_0x176e68){logger[_0x7ecc('0x63')](util[_0x7ecc('0x4e')](_0x7ecc('0x6f'),_0x331f47,_0x30e4c5,_0x176e68['Location']));_0x297fb8[_0x7ecc('0x70')]=_0x176e68[_0x7ecc('0x71')];_0x297fb8[_0x7ecc('0x72')]=_0x176e68[_0x7ecc('0x73')];logger[_0x7ecc('0x63')](util['format']('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x331f47));return startTranscribe(_0x235a0a,_0x3ed6ec,_0x5034ca,uuidv4(),_0x348965,_0x176e68[_0x7ecc('0x73')]);})[_0x7ecc('0x23')](function(_0x5ed6d8){logger[_0x7ecc('0x63')](util[_0x7ecc('0x4e')](_0x7ecc('0x74'),_0x331f47,_0x5ed6d8['TranscriptionJob'][_0x7ecc('0x75')]));_0x297fb8[_0x7ecc('0x76')]=_0x5ed6d8[_0x7ecc('0x77')][_0x7ecc('0x75')];_0x297fb8[_0x7ecc('0x78')]=_0x5ed6d8[_0x7ecc('0x77')][_0x7ecc('0x79')];return _0x253dad(_0x297fb8);})['catch'](function(_0x3fbf19){return _0x229610(_0x3fbf19);});});}exports[_0x7ecc('0x7a')]=function(_0x45530c,_0xc15653,_0x1e9b07){var _0x2b8683;var _0x4c6221;var _0x409fe9;var _0xd727e1=require(_0x7ecc('0x4b'));return db[_0x7ecc('0x29')][_0x7ecc('0x7b')]({'where':{'id':_0x45530c[_0x7ecc('0x41')]['id']}})[_0x7ecc('0x23')](function(_0x58a1bc){if(_0x58a1bc){var _0x3ac9b5=util[_0x7ecc('0x4e')](_0x7ecc('0x4f'),_0x58a1bc[_0x7ecc('0x4d')]);if(fs[_0x7ecc('0x50')](_0x3ac9b5)){cypher=!![];return _0xd727e1['decryptFile'](_0x3ac9b5,_0x58a1bc[_0x7ecc('0x4d')],config[_0x7ecc('0x52')][_0x7ecc('0x53')])['then'](function(){return _0x58a1bc;});}return _0x58a1bc;}})[_0x7ecc('0x23')](function(_0x5143d7){if(!_0x5143d7){throw new db[(_0x7ecc('0x54'))][(_0x7ecc('0x61'))](_0x7ecc('0x7c'));}_0x4c6221=_0x5143d7;return db[_0x7ecc('0x7d')][_0x7ecc('0x7b')]({'where':{'id':0x1}});})[_0x7ecc('0x23')](handleEntityNotFound(_0xc15653,null))[_0x7ecc('0x23')](function(_0x4acc6c){if(_0x4acc6c){_0x2b8683=_0x4acc6c;if(!_0x2b8683['transcribe']||!_0x2b8683[_0x7ecc('0x7e')]||!_0x2b8683[_0x7ecc('0x7f')]||!_0x2b8683[_0x7ecc('0x80')]||!_0x2b8683[_0x7ecc('0x70')]){throw new db[(_0x7ecc('0x54'))]['ValidationError'](_0x7ecc('0x81'));}if(_0x45530c[_0x7ecc('0x48')][_0x7ecc('0x82')]&&(!_0x2b8683[_0x7ecc('0x83')]||!_0x2b8683[_0x7ecc('0x84')]||!_0x2b8683[_0x7ecc('0x85')]||!_0x2b8683[_0x7ecc('0x80')]||!_0x2b8683[_0x7ecc('0x70')])){throw new db[(_0x7ecc('0x54'))]['ValidationError'](_0x7ecc('0x86'));}return db[_0x7ecc('0x87')][_0x7ecc('0x7b')]({'where':{'id':_0x2b8683[_0x7ecc('0x7e')]}});}})[_0x7ecc('0x23')](function(_0x2a62c2){if(!_0x2a62c2){throw new db['Sequelize'][(_0x7ecc('0x61'))](_0x7ecc('0x88'));}if(!_0x2a62c2[_0x7ecc('0x89')]||!_0x2a62c2[_0x7ecc('0x8a')]){throw new db['Sequelize'][(_0x7ecc('0x61'))](_0x7ecc('0x8b'));}_0x409fe9=_0x2a62c2;return getBucketslist(_0x409fe9[_0x7ecc('0x89')],_0x409fe9[_0x7ecc('0x8a')],_0x2b8683[_0x7ecc('0x7f')]);})[_0x7ecc('0x23')](function(_0xf85314){if(_0xf85314&&_0xf85314[_0x7ecc('0x8c')]){var _0x264c26=_[_0x7ecc('0x46')](_0xf85314[_0x7ecc('0x8c')],function(_0x58f918){return _0x58f918[_0x7ecc('0x8d')]===_0x2b8683['bucket'];});if(!_0x264c26){logger[_0x7ecc('0x63')](util['format'](_0x7ecc('0x8e'),_0x45530c[_0x7ecc('0x41')]['id'],_0x2b8683[_0x7ecc('0x70')]));return createBucket(_0x409fe9[_0x7ecc('0x89')],_0x409fe9[_0x7ecc('0x8a')],_0x2b8683[_0x7ecc('0x7f')],_0x2b8683[_0x7ecc('0x70')]);}logger[_0x7ecc('0x63')](util[_0x7ecc('0x4e')](_0x7ecc('0x8f'),_0x45530c['params']['id'],_0x2b8683[_0x7ecc('0x70')]));return;}})['then'](function(_0x52a333){if(_0x4c6221[_0x7ecc('0x78')]===_0x7ecc('0x90')){return transcribe(_0x45530c[_0x7ecc('0x41')]['id'],_0x409fe9['data1'],_0x409fe9['data2'],_0x2b8683['transcribeRegion'],_0x2b8683[_0x7ecc('0x70')],_0x4c6221[_0x7ecc('0x4d')],_0x2b8683[_0x7ecc('0x80')]);}else{logger[_0x7ecc('0x63')](util[_0x7ecc('0x4e')](_0x7ecc('0x91'),_0x45530c[_0x7ecc('0x41')]['id']));return{'transcribeStatus':_0x7ecc('0x92')};}})['then'](function(_0xb246c5){if(_0xb246c5){_0xb246c5[_0x7ecc('0x93')]=_0x45530c[_0x7ecc('0x48')]['runSentiment'];return _0x4c6221[_0x7ecc('0x94')](_0xb246c5);}})[_0x7ecc('0x23')](respondWithResult(_0xc15653,null))[_0x7ecc('0x3f')](handleError(_0xc15653,null));};function writeFile(_0x4dffc0,_0x32081a){return new Promise(function(_0x454460,_0x5dd3f7){fs['writeFile'](_0x32081a,_0x4dffc0,function(_0x4e9c89,_0x19aa0c){if(_0x4e9c89){return _0x5dd3f7(_0x4e9c89);}else{return _0x454460(_0x19aa0c);}});});}exports[_0x7ecc('0x95')]=function(_0x4cd176,_0x203c2e,_0x506b55){return db[_0x7ecc('0x29')][_0x7ecc('0x7b')]({'where':{'id':_0x4cd176['params']['id']}})[_0x7ecc('0x23')](handleEntityNotFound(_0x203c2e))[_0x7ecc('0x23')](function(_0x39eeaf){if(_0x39eeaf&&_0x39eeaf[_0x7ecc('0x96')]){var _0x4eef89=_0x39eeaf['fileText'];var _0x47cba5=config[_0x7ecc('0x97')]+_0x7ecc('0x98')+_0x39eeaf['id']+'.txt';if(fs[_0x7ecc('0x50')](_0x47cba5)){return _0x47cba5;}return writeFile(_0x4eef89,_0x47cba5)[_0x7ecc('0x23')](function(){return _0x47cba5;});}else{throw new db[(_0x7ecc('0x54'))]['ValidationError'](_0x7ecc('0x99'));}})[_0x7ecc('0x23')](function(_0x1ab472){return _0x203c2e[_0x7ecc('0x4a')](_0x1ab472);})[_0x7ecc('0x3f')](handleError(_0x203c2e));}; \ No newline at end of file +var _0xfa69=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','VoiceRecording','rawAttributes','type','key','differenceBy','format','keys','filters','intersection','model','query','attributes','length','nolimit','order','sort','where','filter','merge','includeAll','include','findAll','rows','catch','show','params','fields','create','body','find','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','decryptFile','secrets','recording','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','sequelize','MD5','token','push','$and','existsSync','Sequelize','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','bucket','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','.txt','Transcript\x20not\x20available','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x2045a9,_0x4aa369){var _0x38f76f=function(_0x6ac2dc){while(--_0x6ac2dc){_0x2045a9['push'](_0x2045a9['shift']());}};_0x38f76f(++_0x4aa369);}(_0xfa69,0x84));var _0x9fa6=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xfa69[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0x9fa6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9fa6('0x1'));var jsonpatch=require(_0x9fa6('0x2'));var rp=require(_0x9fa6('0x3'));var moment=require(_0x9fa6('0x4'));var BPromise=require(_0x9fa6('0x5'));var Mustache=require(_0x9fa6('0x6'));var util=require(_0x9fa6('0x7'));var path=require(_0x9fa6('0x8'));var sox=require(_0x9fa6('0x9'));var csv=require(_0x9fa6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9fa6('0xb'));var _=require('lodash');var squel=require(_0x9fa6('0xc'));var crypto=require('crypto');var jsforce=require(_0x9fa6('0xd'));var deskjs=require(_0x9fa6('0xe'));var toCsv=require(_0x9fa6('0xa'));var querystring=require(_0x9fa6('0xf'));var Papa=require('papaparse');var AWS=require(_0x9fa6('0x10'));var uuidv4=require(_0x9fa6('0x11'));var Redis=require(_0x9fa6('0x12'));var authService=require(_0x9fa6('0x13'));var qs=require(_0x9fa6('0x14'));var as=require(_0x9fa6('0x15'));var hardwareService=require(_0x9fa6('0x16'));var logger=require(_0x9fa6('0x17'))('api');var utils=require(_0x9fa6('0x18'));var config=require(_0x9fa6('0x19'));var licenseUtil=require(_0x9fa6('0x1a'));var db=require(_0x9fa6('0x1b'))['db'];function respondWithStatusCode(_0x70f552,_0x5c5f2c){_0x5c5f2c=_0x5c5f2c||0xcc;return function(_0x3edae6){if(_0x3edae6){return _0x70f552['sendStatus'](_0x5c5f2c);}return _0x70f552[_0x9fa6('0x1c')](_0x5c5f2c)['end']();};}function respondWithResult(_0x2600fb,_0x1f94a8){_0x1f94a8=_0x1f94a8||0xc8;return function(_0x599d50){if(_0x599d50){return _0x2600fb[_0x9fa6('0x1c')](_0x1f94a8)[_0x9fa6('0x1d')](_0x599d50);}};}function respondWithFilteredResult(_0x59e515,_0x46ea28){return function(_0x39f0f9){if(_0x39f0f9){var _0x3927ef=typeof _0x46ea28['offset']===_0x9fa6('0x1e')&&typeof _0x46ea28[_0x9fa6('0x1f')]==='undefined';var _0x15d1d2=_0x39f0f9[_0x9fa6('0x20')];var _0x1158f8=_0x3927ef?0x0:_0x46ea28[_0x9fa6('0x21')];var _0xaa6b15=_0x3927ef?_0x39f0f9[_0x9fa6('0x20')]:_0x46ea28[_0x9fa6('0x21')]+_0x46ea28[_0x9fa6('0x1f')];var _0x38a99f;if(_0xaa6b15>=_0x15d1d2){_0xaa6b15=_0x15d1d2;_0x38a99f=0xc8;}else{_0x38a99f=0xce;}_0x59e515[_0x9fa6('0x1c')](_0x38a99f);return _0x59e515['set'](_0x9fa6('0x22'),_0x1158f8+'-'+_0xaa6b15+'/'+_0x15d1d2)[_0x9fa6('0x1d')](_0x39f0f9);}return null;};}function patchUpdates(_0x4ff4d7){return function(_0x3407da){try{jsonpatch[_0x9fa6('0x23')](_0x3407da,_0x4ff4d7,!![]);}catch(_0x911b9f){return BPromise[_0x9fa6('0x24')](_0x911b9f);}return _0x3407da['save']();};}function saveUpdates(_0x5eb59d,_0x3fbdb6){return function(_0x37d183){if(_0x37d183){return _0x37d183[_0x9fa6('0x25')](_0x5eb59d)[_0x9fa6('0x26')](function(_0xc353fe){return _0xc353fe;});}return null;};}function removeEntity(_0x11343b,_0x567087){return function(_0x1f3560){if(_0x1f3560){return _0x1f3560[_0x9fa6('0x27')]()['then'](function(){_0x11343b[_0x9fa6('0x1c')](0xcc)[_0x9fa6('0x28')]();});}};}function handleEntityNotFound(_0x1f434b,_0xee18fd){return function(_0x23d4f7){if(!_0x23d4f7){_0x1f434b[_0x9fa6('0x29')](0x194);}return _0x23d4f7;};}function handleError(_0x18c88e,_0x3f5bf8){_0x3f5bf8=_0x3f5bf8||0x1f4;return function(_0x16c001){logger[_0x9fa6('0x2a')](_0x16c001[_0x9fa6('0x2b')]);if(_0x16c001[_0x9fa6('0x2c')]){delete _0x16c001['name'];}_0x18c88e[_0x9fa6('0x1c')](_0x3f5bf8)[_0x9fa6('0x2d')](_0x16c001);};}exports[_0x9fa6('0x2e')]=function(_0x58a765,_0x40ce96){var _0x36feb3={},_0x1a3aae={},_0x1cfed8={'count':0x0,'rows':[]};var _0x492adc=_[_0x9fa6('0x2f')](db[_0x9fa6('0x30')][_0x9fa6('0x31')],function(_0xb12f00){return{'name':_0xb12f00['fieldName'],'type':_0xb12f00[_0x9fa6('0x32')][_0x9fa6('0x33')]};});_0x1a3aae['model']=_[_0x9fa6('0x34')](_['map'](_0x492adc,'name'),[_0x9fa6('0x35')]);_0x1a3aae['query']=_[_0x9fa6('0x36')](_0x58a765['query']);_0x1a3aae[_0x9fa6('0x37')]=_[_0x9fa6('0x38')](_0x1a3aae[_0x9fa6('0x39')],_0x1a3aae[_0x9fa6('0x3a')]);_0x36feb3[_0x9fa6('0x3b')]=_[_0x9fa6('0x38')](_0x1a3aae[_0x9fa6('0x39')],qs['fields'](_0x58a765['query']['fields']));_0x36feb3['attributes']=_0x36feb3[_0x9fa6('0x3b')][_0x9fa6('0x3c')]?_0x36feb3[_0x9fa6('0x3b')]:_0x1a3aae['model'];if(!_0x58a765[_0x9fa6('0x3a')]['hasOwnProperty'](_0x9fa6('0x3d'))){_0x36feb3[_0x9fa6('0x1f')]=qs['limit'](_0x58a765[_0x9fa6('0x3a')][_0x9fa6('0x1f')]);_0x36feb3[_0x9fa6('0x21')]=qs['offset'](_0x58a765[_0x9fa6('0x3a')][_0x9fa6('0x21')]);}_0x36feb3[_0x9fa6('0x3e')]=qs['sort'](_0x58a765['query'][_0x9fa6('0x3f')]);_0x36feb3[_0x9fa6('0x40')]=qs[_0x9fa6('0x37')](_['pick'](_0x58a765[_0x9fa6('0x3a')],_0x1a3aae[_0x9fa6('0x37')]),_0x492adc);if(_0x58a765[_0x9fa6('0x3a')][_0x9fa6('0x41')]){_0x36feb3[_0x9fa6('0x40')]=_[_0x9fa6('0x42')](_0x36feb3[_0x9fa6('0x40')],{'$or':_[_0x9fa6('0x2f')](_0x492adc,function(_0x264328){if(_0x264328[_0x9fa6('0x32')]!=='VIRTUAL'){var _0x11c6fa={};_0x11c6fa[_0x264328[_0x9fa6('0x2c')]]={'$like':'%'+_0x58a765[_0x9fa6('0x3a')][_0x9fa6('0x41')]+'%'};return _0x11c6fa;}})});}_0x36feb3=_[_0x9fa6('0x42')]({},_0x36feb3,_0x58a765['options']);var _0x5c7278={'where':_0x36feb3[_0x9fa6('0x40')]};return db['VoiceRecording'][_0x9fa6('0x20')](_0x5c7278)[_0x9fa6('0x26')](function(_0x1b9f88){_0x1cfed8[_0x9fa6('0x20')]=_0x1b9f88;if(_0x58a765[_0x9fa6('0x3a')][_0x9fa6('0x43')]){_0x36feb3[_0x9fa6('0x44')]=[{'all':!![]}];}return db[_0x9fa6('0x30')][_0x9fa6('0x45')](_0x36feb3);})[_0x9fa6('0x26')](function(_0x4d35b0){_0x1cfed8[_0x9fa6('0x46')]=_0x4d35b0;return _0x1cfed8;})[_0x9fa6('0x26')](respondWithFilteredResult(_0x40ce96,_0x36feb3))[_0x9fa6('0x47')](handleError(_0x40ce96,null));};exports[_0x9fa6('0x48')]=function(_0x514a7c,_0x57eaad){var _0x42ffab={'raw':![],'where':{'id':_0x514a7c[_0x9fa6('0x49')]['id']}},_0x87bfc8={};_0x87bfc8['model']=_[_0x9fa6('0x36')](db['VoiceRecording'][_0x9fa6('0x31')]);_0x87bfc8[_0x9fa6('0x3a')]=_[_0x9fa6('0x36')](_0x514a7c['query']);_0x87bfc8['filters']=_[_0x9fa6('0x38')](_0x87bfc8[_0x9fa6('0x39')],_0x87bfc8[_0x9fa6('0x3a')]);_0x42ffab[_0x9fa6('0x3b')]=_[_0x9fa6('0x38')](_0x87bfc8['model'],qs['fields'](_0x514a7c[_0x9fa6('0x3a')][_0x9fa6('0x4a')]));_0x42ffab[_0x9fa6('0x3b')]=_0x42ffab[_0x9fa6('0x3b')]['length']?_0x42ffab[_0x9fa6('0x3b')]:_0x87bfc8[_0x9fa6('0x39')];if(_0x514a7c[_0x9fa6('0x3a')][_0x9fa6('0x43')]){_0x42ffab[_0x9fa6('0x44')]=[{'all':!![]}];}_0x42ffab=_[_0x9fa6('0x42')]({},_0x42ffab,_0x514a7c['options']);return db['VoiceRecording']['find'](_0x42ffab)[_0x9fa6('0x26')](handleEntityNotFound(_0x57eaad,null))[_0x9fa6('0x26')](respondWithResult(_0x57eaad,null))[_0x9fa6('0x47')](handleError(_0x57eaad,null));};exports['create']=function(_0x6ed650,_0x67500e){return db['VoiceRecording'][_0x9fa6('0x4b')](_0x6ed650[_0x9fa6('0x4c')],{})[_0x9fa6('0x26')](respondWithResult(_0x67500e,0xc9))[_0x9fa6('0x47')](handleError(_0x67500e,null));};exports[_0x9fa6('0x25')]=function(_0xfbf28a,_0x2feabe){if(_0xfbf28a[_0x9fa6('0x4c')]['id']){delete _0xfbf28a[_0x9fa6('0x4c')]['id'];}return db[_0x9fa6('0x30')][_0x9fa6('0x4d')]({'where':{'id':_0xfbf28a[_0x9fa6('0x49')]['id']}})[_0x9fa6('0x26')](handleEntityNotFound(_0x2feabe,null))['then'](saveUpdates(_0xfbf28a[_0x9fa6('0x4c')],null))[_0x9fa6('0x26')](respondWithResult(_0x2feabe,null))[_0x9fa6('0x47')](handleError(_0x2feabe,null));};exports[_0x9fa6('0x4e')]=function(_0x3c4a6d,_0x57911e){return db[_0x9fa6('0x30')][_0x9fa6('0x4e')]()['then'](respondWithResult(_0x57911e,null))[_0x9fa6('0x47')](handleError(_0x57911e,null));};exports[_0x9fa6('0x4f')]=function(_0x45b551,_0x210e67,_0x45677c){var _0x20ffc7=require(_0x9fa6('0x50'));var _0x30c2ca=![];var _0x21318e={};if(_0x45b551['query'][_0x9fa6('0x32')]&&_0x45b551[_0x9fa6('0x3a')][_0x9fa6('0x32')]===_0x9fa6('0x51')){_0x21318e[_0x9fa6('0x51')]=_0x45b551[_0x9fa6('0x49')]['id'];}else{_0x21318e['id']=_0x45b551[_0x9fa6('0x49')]['id'];}return db[_0x9fa6('0x30')]['find']({'where':_0x21318e,'attributes':['id','value'],'raw':!![]})[_0x9fa6('0x26')](handleEntityNotFound(_0x210e67,null))['then'](function(_0x496ab0){if(_0x496ab0){var _0x677eab=_0x496ab0[_0x9fa6('0x52')];var _0x290d3f=util[_0x9fa6('0x35')](_0x9fa6('0x53'),_0x677eab);if(fs['existsSync'](_0x290d3f)){_0x30c2ca=!![];return _0x20ffc7[_0x9fa6('0x54')](_0x290d3f,_0x677eab,config[_0x9fa6('0x55')][_0x9fa6('0x56')])[_0x9fa6('0x26')](function(){return _0x496ab0;});}return _0x496ab0;}})[_0x9fa6('0x26')](function(_0x3b4c83){if(_0x3b4c83){var _0xf294ee=_0x3b4c83[_0x9fa6('0x52')];if(!fs['existsSync'](_0xf294ee)){throw new db['Sequelize'][(_0x9fa6('0x57'))](_0x9fa6('0x58'));}if(_0x3b4c83[_0x9fa6('0x59')]){return _0x210e67[_0x9fa6('0x4f')](_0xf294ee,_0x3b4c83[_0x9fa6('0x59')]+path[_0x9fa6('0x5a')](_0xf294ee),function(){if(_0x30c2ca){fs[_0x9fa6('0x5b')](_0xf294ee);}});}else{return _0x210e67[_0x9fa6('0x4f')](_0xf294ee,function(_0xbf8e7c){if(_0x30c2ca){fs[_0x9fa6('0x5b')](_0xf294ee);}});}}})['catch'](function(_0x6069bf){if(_0x6069bf[_0x9fa6('0x5c')]===_0x9fa6('0x58')){_0x210e67[_0x9fa6('0x1c')](0x194)[_0x9fa6('0x2d')](_0x9fa6('0x5d'));}else{return handleError(_0x210e67,null);}});};exports['downloads']=function(_0x462b76,_0x55248b,_0xc241a1){var _0x4e3eed=require(_0x9fa6('0x50'));var _0x421ea9=![];var _0x113bd2={'$and':[db['sequelize'][_0x9fa6('0x40')](db[_0x9fa6('0x5e')]['fn'](_0x9fa6('0x5f'),db[_0x9fa6('0x5e')]['col'](_0x9fa6('0x51'))),_0x462b76[_0x9fa6('0x3a')][_0x9fa6('0x60')])]};if(_0x462b76[_0x9fa6('0x3a')][_0x9fa6('0x32')]&&_0x462b76[_0x9fa6('0x3a')][_0x9fa6('0x32')]==='uniqueid'){_0x113bd2['$and'][_0x9fa6('0x61')]({'uniqueid':_0x462b76[_0x9fa6('0x49')]['id']});}else{_0x113bd2[_0x9fa6('0x62')]['push']({'id':_0x462b76[_0x9fa6('0x49')]['id']});}return db['VoiceRecording']['find']({'where':_0x113bd2,'attributes':['id',_0x9fa6('0x52')],'raw':!![]})[_0x9fa6('0x26')](handleEntityNotFound(_0x55248b,null))[_0x9fa6('0x26')](function(_0x1f99d6){if(_0x1f99d6){var _0x262654=util[_0x9fa6('0x35')](_0x9fa6('0x53'),_0x1f99d6[_0x9fa6('0x52')]);if(fs[_0x9fa6('0x63')](_0x262654)){_0x421ea9=!![];return _0x4e3eed[_0x9fa6('0x54')](_0x262654,_0x1f99d6[_0x9fa6('0x52')],config[_0x9fa6('0x55')][_0x9fa6('0x56')])[_0x9fa6('0x26')](function(){return _0x1f99d6;});}return _0x1f99d6;}})['then'](function(_0x319d7d){if(_0x319d7d){if(!fs['existsSync'](_0x319d7d[_0x9fa6('0x52')])){throw new db[(_0x9fa6('0x64'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x319d7d[_0x9fa6('0x59')]){return _0x55248b[_0x9fa6('0x4f')](_0x319d7d[_0x9fa6('0x52')],_0x319d7d[_0x9fa6('0x59')]+path[_0x9fa6('0x5a')](_0x319d7d[_0x9fa6('0x52')]),function(){if(_0x421ea9){fs['unlink'](_0x319d7d[_0x9fa6('0x52')]);}});}else{return _0x55248b['download'](_0x319d7d[_0x9fa6('0x52')],function(_0x5c5979){if(_0x421ea9){fs[_0x9fa6('0x5b')](_0x319d7d['value']);}});}}})['catch'](handleError(_0x55248b,null));};exports[_0x9fa6('0x27')]=function(_0x29baaa,_0x45562f){return db['VoiceRecording'][_0x9fa6('0x4d')]({'where':{'id':_0x29baaa['params']['id']}})['then'](function(_0x22cc98){if(_[_0x9fa6('0x65')](_0x22cc98)){throw new ReferenceError(_0x9fa6('0x66'));}return _0x22cc98;})[_0x9fa6('0x26')](function(_0x5ca54c){var _0x234690=_0x5ca54c[_0x9fa6('0x52')];logger['info'](_0x9fa6('0x67'),_0x234690);if(!_['isNil'](_0x5ca54c[_0x9fa6('0x52')])&&fs['existsSync'](_0x234690)){logger[_0x9fa6('0x68')](_0x9fa6('0x69')+_0x234690+_0x9fa6('0x6a'));fs[_0x9fa6('0x6b')](_0x234690);}_0x234690=_0x234690+_0x9fa6('0x6c');if(!_[_0x9fa6('0x65')](_0x5ca54c[_0x9fa6('0x52')])&&fs['existsSync'](_0x234690)){logger['info'](_0x9fa6('0x69')+_0x234690+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x9fa6('0x6b')](_0x234690);}return _0x5ca54c;})[_0x9fa6('0x26')](function(_0x2c2eb3){if(!_0x2c2eb3)throw new InternalError();return _0x2c2eb3[_0x9fa6('0x27')]();})[_0x9fa6('0x26')](function(){_0x45562f[_0x9fa6('0x1c')](0xcc)[_0x9fa6('0x28')]();})[_0x9fa6('0x47')](handleError(_0x45562f,null));};function getBucketslist(_0x4eaa69,_0x10a5f5,_0x1e2c9c){return new Promise(function(_0xa26ae4,_0x3dd6b0){var _0x504449=new AWS['S3']({'accessKeyId':_0x10a5f5,'secretAccessKey':_0x4eaa69,'region':_0x1e2c9c});_0x504449[_0x9fa6('0x6d')]({},function(_0x1a311b,_0x43e9f2){if(_0x1a311b){return _0x3dd6b0(_0x1a311b);}else{return _0xa26ae4(_0x43e9f2);}});});}function createBucket(_0x52b22b,_0x74b180,_0x1120d1,_0x33cca8){return new Promise(function(_0x8b8a30,_0x2d4709){var _0x47b0f7=new AWS['S3']({'accessKeyId':_0x74b180,'secretAccessKey':_0x52b22b,'region':_0x1120d1});_0x47b0f7[_0x9fa6('0x6e')]({'Bucket':_0x33cca8},function(_0x5e3590,_0x13b281){if(_0x5e3590){return _0x2d4709(_0x5e3590);}else{return _0x8b8a30(_0x13b281);}});});}function uploadFile(_0x3a77b2,_0x45cb32,_0x26e6c0,_0x44f62a,_0x5ccc21,_0x294e5e){return new Promise(function(_0x38eb7d,_0x3fef36){var _0x4c2c58=new AWS['S3']({'accessKeyId':_0x45cb32,'secretAccessKey':_0x3a77b2,'region':_0x26e6c0});_0x4c2c58[_0x9fa6('0x6f')]({'Bucket':_0x44f62a,'Key':_0x5ccc21,'Body':_0x294e5e},function(_0x3b4e79,_0x1fc19d){if(_0x3b4e79){return _0x3fef36(_0x3b4e79);}else{return _0x38eb7d(_0x1fc19d);}});});}function startTranscribe(_0xe5db95,_0x1ae55e,_0x18ee0d,_0x55d70f,_0x49e8af,_0x46ef28){return new Promise(function(_0xab2999,_0x47c699){var _0x77cda7=new AWS[(_0x9fa6('0x70'))]({'accessKeyId':_0x1ae55e,'secretAccessKey':_0xe5db95,'region':_0x18ee0d});_0x77cda7[_0x9fa6('0x71')]({'TranscriptionJobName':_0x55d70f,'LanguageCode':_0x49e8af,'Media':{'MediaFileUri':_0x46ef28}},function(_0x103021,_0x39f0a1){if(_0x103021){return _0x47c699(_0x103021);}else{return _0xab2999(_0x39f0a1);}});});}function transcribe(_0x546691,_0x192583,_0x180ec8,_0x552758,_0x4adbd2,_0xb5780c,_0x4d32c2){return new Promise(function(_0x4318b7,_0x1b3505){var _0x3f7291={};logger['info'](util[_0x9fa6('0x35')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x546691,_0x4adbd2));return uploadFile(_0x192583,_0x180ec8,_0x552758,_0x4adbd2,path[_0x9fa6('0x72')](_0xb5780c),fs['readFileSync'](_0xb5780c))[_0x9fa6('0x26')](function(_0x5cbdc7){logger[_0x9fa6('0x68')](util[_0x9fa6('0x35')](_0x9fa6('0x73'),_0x546691,_0x4adbd2,_0x5cbdc7[_0x9fa6('0x74')]));_0x3f7291['bucket']=_0x5cbdc7['Bucket'];_0x3f7291['location']=_0x5cbdc7['Location'];logger[_0x9fa6('0x68')](util[_0x9fa6('0x35')](_0x9fa6('0x75'),_0x546691));return startTranscribe(_0x192583,_0x180ec8,_0x552758,uuidv4(),_0x4d32c2,_0x5cbdc7['Location']);})['then'](function(_0x27475c){logger['info'](util[_0x9fa6('0x35')](_0x9fa6('0x76'),_0x546691,_0x27475c[_0x9fa6('0x77')][_0x9fa6('0x78')]));_0x3f7291[_0x9fa6('0x79')]=_0x27475c[_0x9fa6('0x77')][_0x9fa6('0x78')];_0x3f7291[_0x9fa6('0x7a')]=_0x27475c[_0x9fa6('0x77')][_0x9fa6('0x7b')];return _0x4318b7(_0x3f7291);})[_0x9fa6('0x47')](function(_0x377286){return _0x1b3505(_0x377286);});});}exports['runTranscribe']=function(_0x34819e,_0x518ed0,_0x337b19){var _0x36e0e1;var _0x36e5dd;var _0x3e3954;var _0x506cc5=require('../../components/encryptor');return db[_0x9fa6('0x30')][_0x9fa6('0x7c')]({'where':{'id':_0x34819e[_0x9fa6('0x49')]['id']}})[_0x9fa6('0x26')](function(_0x43bf58){if(_0x43bf58){var _0x8c0c9=util[_0x9fa6('0x35')](_0x9fa6('0x53'),_0x43bf58[_0x9fa6('0x52')]);if(fs['existsSync'](_0x8c0c9)){cypher=!![];return _0x506cc5[_0x9fa6('0x54')](_0x8c0c9,_0x43bf58[_0x9fa6('0x52')],config['secrets'][_0x9fa6('0x56')])[_0x9fa6('0x26')](function(){return _0x43bf58;});}return _0x43bf58;}})[_0x9fa6('0x26')](function(_0x4945a8){if(!_0x4945a8){throw new db[(_0x9fa6('0x64'))][(_0x9fa6('0x57'))](_0x9fa6('0x7d'));}_0x36e5dd=_0x4945a8;return db[_0x9fa6('0x7e')]['findOne']({'where':{'id':0x1}});})[_0x9fa6('0x26')](handleEntityNotFound(_0x518ed0,null))[_0x9fa6('0x26')](function(_0x4677f0){if(_0x4677f0){_0x36e0e1=_0x4677f0;if(!_0x36e0e1[_0x9fa6('0x7f')]||!_0x36e0e1[_0x9fa6('0x80')]||!_0x36e0e1[_0x9fa6('0x81')]||!_0x36e0e1[_0x9fa6('0x82')]||!_0x36e0e1[_0x9fa6('0x83')]){throw new db[(_0x9fa6('0x64'))][(_0x9fa6('0x57'))](_0x9fa6('0x84'));}if(_0x34819e[_0x9fa6('0x4c')][_0x9fa6('0x85')]&&(!_0x36e0e1[_0x9fa6('0x86')]||!_0x36e0e1[_0x9fa6('0x87')]||!_0x36e0e1['sentimentRegion']||!_0x36e0e1[_0x9fa6('0x82')]||!_0x36e0e1[_0x9fa6('0x83')])){throw new db['Sequelize'][(_0x9fa6('0x57'))]('Sentiment\x20Analysis\x20not\x20configured');}return db['CloudProvider'][_0x9fa6('0x7c')]({'where':{'id':_0x36e0e1[_0x9fa6('0x80')]}});}})['then'](function(_0x3653dd){if(!_0x3653dd){throw new db[(_0x9fa6('0x64'))][(_0x9fa6('0x57'))](_0x9fa6('0x88'));}if(!_0x3653dd[_0x9fa6('0x89')]||!_0x3653dd['data2']){throw new db[(_0x9fa6('0x64'))]['ValidationError'](_0x9fa6('0x8a'));}_0x3e3954=_0x3653dd;return getBucketslist(_0x3e3954[_0x9fa6('0x89')],_0x3e3954[_0x9fa6('0x8b')],_0x36e0e1[_0x9fa6('0x81')]);})[_0x9fa6('0x26')](function(_0x355d15){if(_0x355d15&&_0x355d15[_0x9fa6('0x8c')]){var _0x4a3e42=_[_0x9fa6('0x4d')](_0x355d15['Buckets'],function(_0x39533a){return _0x39533a[_0x9fa6('0x8d')]===_0x36e0e1[_0x9fa6('0x83')];});if(!_0x4a3e42){logger[_0x9fa6('0x68')](util[_0x9fa6('0x35')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x34819e[_0x9fa6('0x49')]['id'],_0x36e0e1[_0x9fa6('0x83')]));return createBucket(_0x3e3954[_0x9fa6('0x89')],_0x3e3954[_0x9fa6('0x8b')],_0x36e0e1[_0x9fa6('0x81')],_0x36e0e1[_0x9fa6('0x83')]);}logger[_0x9fa6('0x68')](util['format'](_0x9fa6('0x8e'),_0x34819e[_0x9fa6('0x49')]['id'],_0x36e0e1[_0x9fa6('0x83')]));return;}})['then'](function(_0x34e536){if(_0x36e5dd[_0x9fa6('0x7a')]===_0x9fa6('0x8f')){return transcribe(_0x34819e['params']['id'],_0x3e3954[_0x9fa6('0x89')],_0x3e3954['data2'],_0x36e0e1[_0x9fa6('0x81')],_0x36e0e1['bucket'],_0x36e5dd[_0x9fa6('0x52')],_0x36e0e1[_0x9fa6('0x82')]);}else{logger[_0x9fa6('0x68')](util['format'](_0x9fa6('0x90'),_0x34819e[_0x9fa6('0x49')]['id']));return{'transcribeStatus':_0x9fa6('0x91')};}})[_0x9fa6('0x26')](function(_0xea674d){if(_0xea674d){_0xea674d[_0x9fa6('0x92')]=_0x34819e[_0x9fa6('0x4c')][_0x9fa6('0x85')];return _0x36e5dd[_0x9fa6('0x93')](_0xea674d);}})['then'](respondWithResult(_0x518ed0,null))[_0x9fa6('0x47')](handleError(_0x518ed0,null));};function writeFile(_0x156580,_0x281be4){return new Promise(function(_0x41c945,_0x4ec9c0){fs[_0x9fa6('0x94')](_0x281be4,_0x156580,function(_0x4b819d,_0x25a128){if(_0x4b819d){return _0x4ec9c0(_0x4b819d);}else{return _0x41c945(_0x25a128);}});});}exports[_0x9fa6('0x95')]=function(_0x2c5be5,_0x1d84ae,_0x46c18b){return db[_0x9fa6('0x30')]['findOne']({'where':{'id':_0x2c5be5[_0x9fa6('0x49')]['id']}})[_0x9fa6('0x26')](handleEntityNotFound(_0x1d84ae))[_0x9fa6('0x26')](function(_0x12c81f){if(_0x12c81f&&_0x12c81f[_0x9fa6('0x96')]){var _0x2a68a1=_0x12c81f[_0x9fa6('0x96')];var _0xe97906=config[_0x9fa6('0x97')]+'/server/files/transcribes/transcribe_'+_0x12c81f['id']+_0x9fa6('0x98');if(fs['existsSync'](_0xe97906)){return _0xe97906;}return writeFile(_0x2a68a1,_0xe97906)['then'](function(){return _0xe97906;});}else{throw new db['Sequelize'][(_0x9fa6('0x57'))](_0x9fa6('0x99'));}})[_0x9fa6('0x26')](function(_0x35d3bc){return _0x1d84ae['download'](_0x35d3bc);})[_0x9fa6('0x47')](handleError(_0x1d84ae));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 18c2766..af5f121 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 _0x65fe=['uniqueid','util','api','moment','bluebird','path','../../config/environment','./voiceRecording.attributes','exports','VoiceRecording','voice_recordings'];(function(_0x332684,_0x4c5b5b){var _0x42c520=function(_0x443b9b){while(--_0x443b9b){_0x332684['push'](_0x332684['shift']());}};_0x42c520(++_0x4c5b5b);}(_0x65fe,0x16c));var _0xe65f=function(_0x468441,_0x519dc8){_0x468441=_0x468441-0x0;var _0xbbad55=_0x65fe[_0x468441];return _0xbbad55;};'use strict';var _=require('lodash');var util=require(_0xe65f('0x0'));var logger=require('../../config/logger')(_0xe65f('0x1'));var moment=require(_0xe65f('0x2'));var BPromise=require(_0xe65f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe65f('0x4'));var rimraf=require('rimraf');var config=require(_0xe65f('0x5'));var attributes=require(_0xe65f('0x6'));module[_0xe65f('0x7')]=function(_0x53bf45,_0x1d378a){return _0x53bf45['define'](_0xe65f('0x8'),attributes,{'tableName':_0xe65f('0x9'),'paranoid':![],'indexes':[{'name':_0xe65f('0xa'),'fields':[_0xe65f('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x563a=['api','moment','request-promise','rimraf','../../config/environment','./voiceRecording.attributes','exports','define','VoiceRecording','uniqueid','../../config/logger'];(function(_0x3bae68,_0x5ad1b0){var _0x37d80c=function(_0x44a200){while(--_0x44a200){_0x3bae68['push'](_0x3bae68['shift']());}};_0x37d80c(++_0x5ad1b0);}(_0x563a,0xfc));var _0xa563=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0x563a[_0x2555d0];return _0x3bb486;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa563('0x0'))(_0xa563('0x1'));var moment=require(_0xa563('0x2'));var BPromise=require('bluebird');var rp=require(_0xa563('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa563('0x4'));var config=require(_0xa563('0x5'));var attributes=require(_0xa563('0x6'));module[_0xa563('0x7')]=function(_0x1ea42b,_0x26cec5){return _0x1ea42b[_0xa563('0x8')](_0xa563('0x9'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xa563('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 6566688..3014320 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 _0x7880=['encryptFile','secrets','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','UpdateVoiceRecording','update','body','options','where','attributes','then','stringify','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x7880,0x1f4));var _0x0788=function(_0x41c31b,_0xdda69e){_0x41c31b=_0x41c31b-0x0;var _0x356ace=_0x7880[_0x41c31b];return _0x356ace;};'use strict';var _=require('lodash');var util=require(_0x0788('0x0'));var moment=require(_0x0788('0x1'));var BPromise=require(_0x0788('0x2'));var rs=require(_0x0788('0x3'));var fs=require('fs');var Redis=require(_0x0788('0x4'));var db=require(_0x0788('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0788('0x6'))(_0x0788('0x7'));var config=require(_0x0788('0x8'));var jayson=require(_0x0788('0x9'));var client=jayson[_0x0788('0xa')][_0x0788('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f9cb8,_0x44bbb5,_0x3c29f3){return new BPromise(function(_0x422f8b,_0x55e48a){return client[_0x0788('0xc')](_0x3f9cb8,_0x3c29f3)['then'](function(_0xabaf81){logger['info'](_0x0788('0xd'),_0x44bbb5,_0x0788('0xe'));logger[_0x0788('0xf')](_0x0788('0x10'),_0x44bbb5,_0x0788('0xe'),JSON['stringify'](_0xabaf81));if(_0xabaf81[_0x0788('0x11')]){if(_0xabaf81[_0x0788('0x11')][_0x0788('0x12')]===0x1f4){logger[_0x0788('0x11')](_0x0788('0xd'),_0x44bbb5,_0xabaf81[_0x0788('0x11')][_0x0788('0x13')]);return _0x55e48a(_0xabaf81['error'][_0x0788('0x13')]);}logger[_0x0788('0x11')](_0x0788('0xd'),_0x44bbb5,_0xabaf81[_0x0788('0x11')]['message']);return _0x422f8b(_0xabaf81[_0x0788('0x11')]['message']);}else{logger[_0x0788('0x14')](_0x0788('0xd'),_0x44bbb5,_0x0788('0xe'));_0x422f8b(_0xabaf81[_0x0788('0x15')][_0x0788('0x13')]);}})[_0x0788('0x16')](function(_0x5e1a29){logger['error'](_0x0788('0xd'),_0x44bbb5,_0x5e1a29);_0x55e48a(_0x5e1a29);});});}exports[_0x0788('0x17')]=function(_0x5b2bdc){var _0x654e4b=this;return new Promise(function(_0x415f19,_0x17ae59){return db['VoiceRecording'][_0x0788('0x18')](_0x5b2bdc[_0x0788('0x19')],{'raw':_0x5b2bdc['options']?_0x5b2bdc[_0x0788('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b2bdc[_0x0788('0x1a')]?_0x5b2bdc['options'][_0x0788('0x1b')]||null:null,'attributes':_0x5b2bdc[_0x0788('0x1a')]?_0x5b2bdc[_0x0788('0x1a')][_0x0788('0x1c')]||null:null,'limit':_0x5b2bdc[_0x0788('0x1a')]?_0x5b2bdc['options']['limit']||null:null})[_0x0788('0x1d')](function(_0x2a1460){logger[_0x0788('0x14')](_0x0788('0x17'),_0x5b2bdc);logger['debug']('UpdateVoiceRecording',_0x5b2bdc,JSON[_0x0788('0x1e')](_0x2a1460));_0x415f19(_0x2a1460);})[_0x0788('0x16')](function(_0x40309d){logger['error']('UpdateVoiceRecording',_0x40309d[_0x0788('0x13')],_0x5b2bdc);_0x17ae59(_0x654e4b[_0x0788('0x11')](0x1f4,_0x40309d['message']));});});};exports['CreateVoiceRecording']=function(_0x5a54a5){var _0x44798c=this;return new Promise(function(_0x57fda1,_0x286730){var _0x40e7a6=require(_0x0788('0x1f'));var _0x18fc0e;return db[_0x0788('0x20')][_0x0788('0x21')]({'attributes':['id',_0x0788('0x22')],'where':{'id':0x1},'raw':!![]})[_0x0788('0x1d')](function(_0x5b7594){_0x18fc0e=_0x5b7594;return db['VoiceRecording'][_0x0788('0x23')](_0x5a54a5[_0x0788('0x19')]);})['then'](function(_0x4aa48b){if(_0x18fc0e[_0x0788('0x22')]&&fs[_0x0788('0x24')](_0x4aa48b[_0x0788('0x25')])){var _0x436031=util[_0x0788('0x26')](_0x0788('0x27'),_0x4aa48b[_0x0788('0x25')]);return _0x40e7a6[_0x0788('0x28')](_0x4aa48b[_0x0788('0x25')],_0x436031,config[_0x0788('0x29')]['recording'])[_0x0788('0x1d')](function(){fs[_0x0788('0x2a')](_0x4aa48b[_0x0788('0x25')]);logger[_0x0788('0x14')](_0x0788('0x2b'));return _0x4aa48b;});}return _0x4aa48b;})[_0x0788('0x1d')](function(_0x26f584){logger[_0x0788('0x14')](_0x0788('0x2c'),_0x5a54a5);logger[_0x0788('0xf')]('CreateVoiceRecording',_0x5a54a5,JSON['stringify'](_0x26f584));_0x57fda1(_0x26f584);})['catch'](function(_0x5633da){logger['error']('CreateVoiceRecording',_0x5633da[_0x0788('0x13')],_0x5a54a5);_0x286730(_0x44798c[_0x0788('0x11')](0x1f4,_0x5633da[_0x0788('0x13')]));});});}; \ No newline at end of file +var _0x2da6=['stringify','error','code','message','result','catch','VoiceRecording','body','options','raw','where','attributes','limit','UpdateVoiceRecording','CreateVoiceRecording','Setting','findOne','create','callRecordingEncryption','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','VoiceRecording,\x20%s,\x20%s','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x20a8f0,_0x5a30e2){var _0x440f9d=function(_0x3b78f3){while(--_0x3b78f3){_0x20a8f0['push'](_0x20a8f0['shift']());}};_0x440f9d(++_0x5a30e2);}(_0x2da6,0x1dd));var _0x62da=function(_0x1c8c34,_0x3ca226){_0x1c8c34=_0x1c8c34-0x0;var _0x5d3025=_0x2da6[_0x1c8c34];return _0x5d3025;};'use strict';var _=require(_0x62da('0x0'));var util=require(_0x62da('0x1'));var moment=require(_0x62da('0x2'));var BPromise=require(_0x62da('0x3'));var rs=require(_0x62da('0x4'));var fs=require('fs');var Redis=require(_0x62da('0x5'));var db=require(_0x62da('0x6'))['db'];var utils=require(_0x62da('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x62da('0x8'));var jayson=require(_0x62da('0x9'));var client=jayson[_0x62da('0xa')][_0x62da('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x100e73,_0x9d9139,_0x310c15){return new BPromise(function(_0x16f919,_0xbfd2b0){return client['request'](_0x100e73,_0x310c15)[_0x62da('0xc')](function(_0x2a3937){logger[_0x62da('0xd')](_0x62da('0xe'),_0x9d9139,'request\x20sent');logger[_0x62da('0xf')](_0x62da('0x10'),_0x9d9139,_0x62da('0x11'),JSON[_0x62da('0x12')](_0x2a3937));if(_0x2a3937[_0x62da('0x13')]){if(_0x2a3937['error'][_0x62da('0x14')]===0x1f4){logger[_0x62da('0x13')](_0x62da('0xe'),_0x9d9139,_0x2a3937[_0x62da('0x13')][_0x62da('0x15')]);return _0xbfd2b0(_0x2a3937['error']['message']);}logger[_0x62da('0x13')](_0x62da('0xe'),_0x9d9139,_0x2a3937[_0x62da('0x13')][_0x62da('0x15')]);return _0x16f919(_0x2a3937[_0x62da('0x13')][_0x62da('0x15')]);}else{logger[_0x62da('0xd')](_0x62da('0xe'),_0x9d9139,_0x62da('0x11'));_0x16f919(_0x2a3937[_0x62da('0x16')][_0x62da('0x15')]);}})[_0x62da('0x17')](function(_0x1f6bc8){logger[_0x62da('0x13')]('VoiceRecording,\x20%s,\x20%s',_0x9d9139,_0x1f6bc8);_0xbfd2b0(_0x1f6bc8);});});}exports['UpdateVoiceRecording']=function(_0xa7050b){var _0x4ae4fb=this;return new Promise(function(_0x4d6482,_0x264366){return db[_0x62da('0x18')]['update'](_0xa7050b[_0x62da('0x19')],{'raw':_0xa7050b['options']?_0xa7050b[_0x62da('0x1a')][_0x62da('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa7050b[_0x62da('0x1a')]?_0xa7050b[_0x62da('0x1a')][_0x62da('0x1c')]||null:null,'attributes':_0xa7050b[_0x62da('0x1a')]?_0xa7050b[_0x62da('0x1a')][_0x62da('0x1d')]||null:null,'limit':_0xa7050b[_0x62da('0x1a')]?_0xa7050b['options'][_0x62da('0x1e')]||null:null})[_0x62da('0xc')](function(_0x2fd925){logger[_0x62da('0xd')](_0x62da('0x1f'),_0xa7050b);logger[_0x62da('0xf')](_0x62da('0x1f'),_0xa7050b,JSON['stringify'](_0x2fd925));_0x4d6482(_0x2fd925);})['catch'](function(_0x509fd9){logger[_0x62da('0x13')](_0x62da('0x1f'),_0x509fd9[_0x62da('0x15')],_0xa7050b);_0x264366(_0x4ae4fb[_0x62da('0x13')](0x1f4,_0x509fd9['message']));});});};exports[_0x62da('0x20')]=function(_0x3b9c06){var _0x5f0a9c=this;return new Promise(function(_0x3ccf96,_0x195dc4){var _0x1775ea=require('../../components/encryptor');var _0x41de3a;return db[_0x62da('0x21')][_0x62da('0x22')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})['then'](function(_0x3c6274){_0x41de3a=_0x3c6274;return db[_0x62da('0x18')][_0x62da('0x23')](_0x3b9c06['body']);})[_0x62da('0xc')](function(_0x2a4681){if(_0x41de3a[_0x62da('0x24')]&&fs[_0x62da('0x25')](_0x2a4681[_0x62da('0x26')])){var _0x1cf765=util['format'](_0x62da('0x27'),_0x2a4681['value']);return _0x1775ea[_0x62da('0x28')](_0x2a4681[_0x62da('0x26')],_0x1cf765,config[_0x62da('0x29')][_0x62da('0x2a')])[_0x62da('0xc')](function(){fs[_0x62da('0x2b')](_0x2a4681['value']);logger[_0x62da('0xd')](_0x62da('0x2c'));return _0x2a4681;});}return _0x2a4681;})[_0x62da('0xc')](function(_0x5107b1){logger[_0x62da('0xd')](_0x62da('0x20'),_0x3b9c06);logger[_0x62da('0xf')]('CreateVoiceRecording',_0x3b9c06,JSON[_0x62da('0x12')](_0x5107b1));_0x3ccf96(_0x5107b1);})[_0x62da('0x17')](function(_0x55eda7){logger[_0x62da('0x13')](_0x62da('0x20'),_0x55eda7['message'],_0x3b9c06);_0x195dc4(_0x5f0a9c[_0x62da('0x13')](0x1f4,_0x55eda7[_0x62da('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index a787b43..5b1a7b3 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 _0x8714=['create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','post'];(function(_0x39b61f,_0x4f8b39){var _0x48b055=function(_0xb6ca17){while(--_0xb6ca17){_0x39b61f['push'](_0x39b61f['shift']());}};_0x48b055(++_0x4f8b39);}(_0x8714,0xf5));var _0x4871=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x8714[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x4871('0x0'));var util=require(_0x4871('0x1'));var path=require(_0x4871('0x2'));var timeout=require(_0x4871('0x3'));var express=require(_0x4871('0x4'));var router=express['Router']();var fs_extra=require(_0x4871('0x5'));var auth=require(_0x4871('0x6'));var interaction=require(_0x4871('0x7'));var config=require(_0x4871('0x8'));var controller=require('./voiceTransferReport.controller');router[_0x4871('0x9')]('/',auth[_0x4871('0xa')](),controller['index']);router['get'](_0x4871('0xb'),auth[_0x4871('0xa')](),controller['describe']);router[_0x4871('0x9')](_0x4871('0xc'),auth['isAuthenticated'](),controller[_0x4871('0xd')]);router[_0x4871('0xe')]('/',auth[_0x4871('0xa')](),controller[_0x4871('0xf')]);router['put']('/:id',auth[_0x4871('0xa')](),controller[_0x4871('0x10')]);router[_0x4871('0x11')](_0x4871('0xc'),auth[_0x4871('0xa')](),controller[_0x4871('0x12')]);module[_0x4871('0x13')]=router; \ No newline at end of file +var _0xcb03=['multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','create','update','delete','destroy','exports'];(function(_0x56f58a,_0x31408f){var _0x5d4aec=function(_0x9c5d83){while(--_0x9c5d83){_0x56f58a['push'](_0x56f58a['shift']());}};_0x5d4aec(++_0x31408f);}(_0xcb03,0xa0));var _0x3cb0=function(_0xdc70b3,_0x57bc07){_0xdc70b3=_0xdc70b3-0x0;var _0x5539be=_0xcb03[_0xdc70b3];return _0x5539be;};'use strict';var multer=require(_0x3cb0('0x0'));var util=require('util');var path=require(_0x3cb0('0x1'));var timeout=require('connect-timeout');var express=require(_0x3cb0('0x2'));var router=express[_0x3cb0('0x3')]();var fs_extra=require(_0x3cb0('0x4'));var auth=require(_0x3cb0('0x5'));var interaction=require(_0x3cb0('0x6'));var config=require(_0x3cb0('0x7'));var controller=require('./voiceTransferReport.controller');router[_0x3cb0('0x8')]('/',auth[_0x3cb0('0x9')](),controller[_0x3cb0('0xa')]);router[_0x3cb0('0x8')](_0x3cb0('0xb'),auth[_0x3cb0('0x9')](),controller[_0x3cb0('0xc')]);router['get'](_0x3cb0('0xd'),auth[_0x3cb0('0x9')](),controller['show']);router[_0x3cb0('0xe')]('/',auth[_0x3cb0('0x9')](),controller[_0x3cb0('0xf')]);router['put'](_0x3cb0('0xd'),auth[_0x3cb0('0x9')](),controller[_0x3cb0('0x10')]);router[_0x3cb0('0x11')]('/:id',auth[_0x3cb0('0x9')](),controller[_0x3cb0('0x12')]);module[_0x3cb0('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 baf3e47..42cf2ec 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 _0xabf1=['ENUM','Yes','STRING'];(function(_0x98a2a5,_0x3b4e87){var _0x106685=function(_0x47d40e){while(--_0x47d40e){_0x98a2a5['push'](_0x98a2a5['shift']());}};_0x106685(++_0x3b4e87);}(_0xabf1,0xdd));var _0x1abf=function(_0x381cbe,_0x17511b){_0x381cbe=_0x381cbe-0x0;var _0x1a615d=_0xabf1[_0x381cbe];return _0x1a615d;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'type':{'type':Sequelize['ENUM']('blind','attended')},'result':{'type':Sequelize[_0x1abf('0x0')]},'transfererchannel':{'type':Sequelize[_0x1abf('0x0')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x1abf('0x0')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x1abf('0x0')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x1abf('0x0')]},'transfererlinkedid':{'type':Sequelize[_0x1abf('0x0')]},'transfereechannel':{'type':Sequelize[_0x1abf('0x0')]},'transfereecalleridnum':{'type':Sequelize[_0x1abf('0x0')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x1abf('0x0')]},'transfereecontext':{'type':Sequelize[_0x1abf('0x0')]},'transfereeexten':{'type':Sequelize[_0x1abf('0x0')]},'transfereelinkedid':{'type':Sequelize[_0x1abf('0x0')]},'isexternal':{'type':Sequelize[_0x1abf('0x1')](_0x1abf('0x2'),'No')},'context':{'type':Sequelize[_0x1abf('0x0')]},'extension':{'type':Sequelize[_0x1abf('0x0')]}}; \ No newline at end of file +var _0xb20b=['ENUM','attended','STRING','Yes','sequelize','exports'];(function(_0x55a802,_0x10ab3a){var _0x1a0461=function(_0x43d162){while(--_0x43d162){_0x55a802['push'](_0x55a802['shift']());}};_0x1a0461(++_0x10ab3a);}(_0xb20b,0x17e));var _0xbb20=function(_0x1aa6a2,_0x2cf6c7){_0x1aa6a2=_0x1aa6a2-0x0;var _0x285f64=_0xb20b[_0x1aa6a2];return _0x285f64;};'use strict';var Sequelize=require(_0xbb20('0x0'));var moment=require('moment');module[_0xbb20('0x1')]={'type':{'type':Sequelize[_0xbb20('0x2')]('blind',_0xbb20('0x3'))},'result':{'type':Sequelize[_0xbb20('0x4')]},'transfererchannel':{'type':Sequelize[_0xbb20('0x4')]},'transferercalleridnum':{'type':Sequelize[_0xbb20('0x4')]},'transferercalleridname':{'type':Sequelize[_0xbb20('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0xbb20('0x4')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0xbb20('0x4')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0xbb20('0x4')]},'transfererlinkedid':{'type':Sequelize[_0xbb20('0x4')]},'transfereechannel':{'type':Sequelize[_0xbb20('0x4')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0xbb20('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0xbb20('0x4')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0xbb20('0x4')]},'transfereelinkedid':{'type':Sequelize[_0xbb20('0x4')]},'isexternal':{'type':Sequelize['ENUM'](_0xbb20('0x5'),'No')},'context':{'type':Sequelize[_0xbb20('0x4')]},'extension':{'type':Sequelize[_0xbb20('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 18b298c..eef0d48 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 _0xdc13=['sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','filters','query','attributes','intersection','fields','order','sort','where','pick','filter','merge','type','VIRTUAL','VoiceTransferReport','includeAll','findAll','rows','catch','show','params','keys','length','include','options','create','body','update','find','describe','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','reject','save','then','destroy'];(function(_0x124e0b,_0x50d410){var _0x2f4c1b=function(_0x38367b){while(--_0x38367b){_0x124e0b['push'](_0x124e0b['shift']());}};_0x2f4c1b(++_0x50d410);}(_0xdc13,0x71));var _0x3dc1=function(_0x15e5bb,_0x13449d){_0x15e5bb=_0x15e5bb-0x0;var _0x12aabc=_0xdc13[_0x15e5bb];return _0x12aabc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3dc1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3dc1('0x1'));var rp=require(_0x3dc1('0x2'));var moment=require('moment');var BPromise=require(_0x3dc1('0x3'));var Mustache=require(_0x3dc1('0x4'));var util=require(_0x3dc1('0x5'));var path=require('path');var sox=require(_0x3dc1('0x6'));var csv=require('to-csv');var ejs=require(_0x3dc1('0x7'));var fs=require('fs');var fs_extra=require(_0x3dc1('0x8'));var _=require('lodash');var squel=require(_0x3dc1('0x9'));var crypto=require(_0x3dc1('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x3dc1('0xb'));var toCsv=require(_0x3dc1('0xc'));var querystring=require('querystring');var Papa=require(_0x3dc1('0xd'));var Redis=require(_0x3dc1('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3dc1('0xf'));var as=require(_0x3dc1('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3dc1('0x11'))(_0x3dc1('0x12'));var utils=require(_0x3dc1('0x13'));var config=require(_0x3dc1('0x14'));var licenseUtil=require(_0x3dc1('0x15'));var db=require(_0x3dc1('0x16'))['db'];function respondWithStatusCode(_0x1c04d3,_0x52af37){_0x52af37=_0x52af37||0xcc;return function(_0x2d3389){if(_0x2d3389){return _0x1c04d3['sendStatus'](_0x52af37);}return _0x1c04d3[_0x3dc1('0x17')](_0x52af37)[_0x3dc1('0x18')]();};}function respondWithResult(_0x1baf31,_0x265dca){_0x265dca=_0x265dca||0xc8;return function(_0x5ed58d){if(_0x5ed58d){return _0x1baf31[_0x3dc1('0x17')](_0x265dca)['json'](_0x5ed58d);}};}function respondWithFilteredResult(_0x531e2c,_0x2fcf62){return function(_0x15f6cc){if(_0x15f6cc){var _0x555c4b=typeof _0x2fcf62[_0x3dc1('0x19')]==='undefined'&&typeof _0x2fcf62[_0x3dc1('0x1a')]===_0x3dc1('0x1b');var _0x9c217c=_0x15f6cc[_0x3dc1('0x1c')];var _0x142b7b=_0x555c4b?0x0:_0x2fcf62[_0x3dc1('0x19')];var _0x4103d5=_0x555c4b?_0x15f6cc[_0x3dc1('0x1c')]:_0x2fcf62[_0x3dc1('0x19')]+_0x2fcf62[_0x3dc1('0x1a')];var _0x267a03;if(_0x4103d5>=_0x9c217c){_0x4103d5=_0x9c217c;_0x267a03=0xc8;}else{_0x267a03=0xce;}_0x531e2c[_0x3dc1('0x17')](_0x267a03);return _0x531e2c['set']('Content-Range',_0x142b7b+'-'+_0x4103d5+'/'+_0x9c217c)['json'](_0x15f6cc);}return null;};}function patchUpdates(_0xe3a320){return function(_0x179c2c){try{jsonpatch['apply'](_0x179c2c,_0xe3a320,!![]);}catch(_0x2e9854){return BPromise[_0x3dc1('0x1d')](_0x2e9854);}return _0x179c2c[_0x3dc1('0x1e')]();};}function saveUpdates(_0x373c88,_0x391aec){return function(_0x287d1c){if(_0x287d1c){return _0x287d1c['update'](_0x373c88)[_0x3dc1('0x1f')](function(_0xc589cd){return _0xc589cd;});}return null;};}function removeEntity(_0xa32c7c,_0x109a9d){return function(_0x2e4810){if(_0x2e4810){return _0x2e4810[_0x3dc1('0x20')]()['then'](function(){_0xa32c7c[_0x3dc1('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28963f,_0x5ccf8f){return function(_0x9cc7d8){if(!_0x9cc7d8){_0x28963f[_0x3dc1('0x21')](0x194);}return _0x9cc7d8;};}function handleError(_0x230c61,_0x1eb104){_0x1eb104=_0x1eb104||0x1f4;return function(_0x9c865f){logger[_0x3dc1('0x22')](_0x9c865f[_0x3dc1('0x23')]);if(_0x9c865f[_0x3dc1('0x24')]){delete _0x9c865f['name'];}_0x230c61[_0x3dc1('0x17')](_0x1eb104)[_0x3dc1('0x25')](_0x9c865f);};}exports[_0x3dc1('0x26')]=function(_0x24e1d4,_0x1c4c90){var _0x2834b4={},_0x5293f3={},_0x30f764={'count':0x0,'rows':[]};var _0x565f02=_[_0x3dc1('0x27')](db['VoiceTransferReport'][_0x3dc1('0x28')],function(_0x1d855c){return{'name':_0x1d855c[_0x3dc1('0x29')],'type':_0x1d855c['type'][_0x3dc1('0x2a')]};});_0x5293f3[_0x3dc1('0x2b')]=_[_0x3dc1('0x27')](_0x565f02,_0x3dc1('0x24'));_0x5293f3['query']=_['keys'](_0x24e1d4['query']);_0x5293f3[_0x3dc1('0x2c')]=_['intersection'](_0x5293f3[_0x3dc1('0x2b')],_0x5293f3[_0x3dc1('0x2d')]);_0x2834b4[_0x3dc1('0x2e')]=_[_0x3dc1('0x2f')](_0x5293f3[_0x3dc1('0x2b')],qs['fields'](_0x24e1d4[_0x3dc1('0x2d')][_0x3dc1('0x30')]));_0x2834b4[_0x3dc1('0x2e')]=_0x2834b4[_0x3dc1('0x2e')]['length']?_0x2834b4[_0x3dc1('0x2e')]:_0x5293f3[_0x3dc1('0x2b')];if(!_0x24e1d4[_0x3dc1('0x2d')]['hasOwnProperty']('nolimit')){_0x2834b4[_0x3dc1('0x1a')]=qs[_0x3dc1('0x1a')](_0x24e1d4[_0x3dc1('0x2d')][_0x3dc1('0x1a')]);_0x2834b4[_0x3dc1('0x19')]=qs[_0x3dc1('0x19')](_0x24e1d4['query'][_0x3dc1('0x19')]);}_0x2834b4[_0x3dc1('0x31')]=qs[_0x3dc1('0x32')](_0x24e1d4[_0x3dc1('0x2d')]['sort']);_0x2834b4[_0x3dc1('0x33')]=qs[_0x3dc1('0x2c')](_[_0x3dc1('0x34')](_0x24e1d4[_0x3dc1('0x2d')],_0x5293f3[_0x3dc1('0x2c')]),_0x565f02);if(_0x24e1d4[_0x3dc1('0x2d')][_0x3dc1('0x35')]){_0x2834b4[_0x3dc1('0x33')]=_[_0x3dc1('0x36')](_0x2834b4[_0x3dc1('0x33')],{'$or':_[_0x3dc1('0x27')](_0x565f02,function(_0x5c3ca2){if(_0x5c3ca2[_0x3dc1('0x37')]!==_0x3dc1('0x38')){var _0x3dc2e6={};_0x3dc2e6[_0x5c3ca2['name']]={'$like':'%'+_0x24e1d4[_0x3dc1('0x2d')][_0x3dc1('0x35')]+'%'};return _0x3dc2e6;}})});}_0x2834b4=_['merge']({},_0x2834b4,_0x24e1d4['options']);var _0x2fecf8={'where':_0x2834b4[_0x3dc1('0x33')]};return db[_0x3dc1('0x39')][_0x3dc1('0x1c')](_0x2fecf8)[_0x3dc1('0x1f')](function(_0x255e10){_0x30f764['count']=_0x255e10;if(_0x24e1d4[_0x3dc1('0x2d')][_0x3dc1('0x3a')]){_0x2834b4['include']=[{'all':!![]}];}return db['VoiceTransferReport'][_0x3dc1('0x3b')](_0x2834b4);})['then'](function(_0x16c007){_0x30f764[_0x3dc1('0x3c')]=_0x16c007;return _0x30f764;})[_0x3dc1('0x1f')](respondWithFilteredResult(_0x1c4c90,_0x2834b4))[_0x3dc1('0x3d')](handleError(_0x1c4c90,null));};exports[_0x3dc1('0x3e')]=function(_0x1a4582,_0xab4a21){var _0x3997d4={'raw':!![],'where':{'id':_0x1a4582[_0x3dc1('0x3f')]['id']}},_0x2a2a3c={};_0x2a2a3c[_0x3dc1('0x2b')]=_[_0x3dc1('0x40')](db[_0x3dc1('0x39')]['rawAttributes']);_0x2a2a3c[_0x3dc1('0x2d')]=_[_0x3dc1('0x40')](_0x1a4582[_0x3dc1('0x2d')]);_0x2a2a3c[_0x3dc1('0x2c')]=_[_0x3dc1('0x2f')](_0x2a2a3c[_0x3dc1('0x2b')],_0x2a2a3c[_0x3dc1('0x2d')]);_0x3997d4[_0x3dc1('0x2e')]=_[_0x3dc1('0x2f')](_0x2a2a3c[_0x3dc1('0x2b')],qs['fields'](_0x1a4582[_0x3dc1('0x2d')][_0x3dc1('0x30')]));_0x3997d4[_0x3dc1('0x2e')]=_0x3997d4[_0x3dc1('0x2e')][_0x3dc1('0x41')]?_0x3997d4[_0x3dc1('0x2e')]:_0x2a2a3c[_0x3dc1('0x2b')];if(_0x1a4582[_0x3dc1('0x2d')][_0x3dc1('0x3a')]){_0x3997d4[_0x3dc1('0x42')]=[{'all':!![]}];}_0x3997d4=_[_0x3dc1('0x36')]({},_0x3997d4,_0x1a4582[_0x3dc1('0x43')]);return db[_0x3dc1('0x39')]['find'](_0x3997d4)[_0x3dc1('0x1f')](handleEntityNotFound(_0xab4a21,null))[_0x3dc1('0x1f')](respondWithResult(_0xab4a21,null))['catch'](handleError(_0xab4a21,null));};exports[_0x3dc1('0x44')]=function(_0x404e2b,_0x501ee3){return db[_0x3dc1('0x39')][_0x3dc1('0x44')](_0x404e2b[_0x3dc1('0x45')],{})[_0x3dc1('0x1f')](respondWithResult(_0x501ee3,0xc9))[_0x3dc1('0x3d')](handleError(_0x501ee3,null));};exports[_0x3dc1('0x46')]=function(_0x143f15,_0x2fbeb5){if(_0x143f15['body']['id']){delete _0x143f15[_0x3dc1('0x45')]['id'];}return db[_0x3dc1('0x39')][_0x3dc1('0x47')]({'where':{'id':_0x143f15[_0x3dc1('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2fbeb5,null))['then'](saveUpdates(_0x143f15[_0x3dc1('0x45')],null))[_0x3dc1('0x1f')](respondWithResult(_0x2fbeb5,null))['catch'](handleError(_0x2fbeb5,null));};exports['destroy']=function(_0x32c612,_0x68e856){return db[_0x3dc1('0x39')][_0x3dc1('0x47')]({'where':{'id':_0x32c612[_0x3dc1('0x3f')]['id']}})[_0x3dc1('0x1f')](handleEntityNotFound(_0x68e856,null))['then'](removeEntity(_0x68e856,null))['catch'](handleError(_0x68e856,null));};exports[_0x3dc1('0x48')]=function(_0x1af822,_0x4fd3b3){return db[_0x3dc1('0x39')][_0x3dc1('0x48')]()['then'](respondWithResult(_0x4fd3b3,null))['catch'](handleError(_0x4fd3b3,null));}; \ No newline at end of file +var _0xae20=['then','destroy','stack','name','index','VoiceTransferReport','type','key','model','map','keys','query','intersection','fields','length','attributes','hasOwnProperty','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update'];(function(_0xd83052,_0x2788ef){var _0x277059=function(_0x4cfd7c){while(--_0x4cfd7c){_0xd83052['push'](_0xd83052['shift']());}};_0x277059(++_0x2788ef);}(_0xae20,0x1e5));var _0x0ae2=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xae20[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0x0ae2('0x0'));var rimraf=require(_0x0ae2('0x1'));var zipdir=require(_0x0ae2('0x2'));var jsonpatch=require(_0x0ae2('0x3'));var rp=require(_0x0ae2('0x4'));var moment=require(_0x0ae2('0x5'));var BPromise=require(_0x0ae2('0x6'));var Mustache=require(_0x0ae2('0x7'));var util=require(_0x0ae2('0x8'));var path=require('path');var sox=require(_0x0ae2('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0ae2('0xa'));var _=require(_0x0ae2('0xb'));var squel=require(_0x0ae2('0xc'));var crypto=require(_0x0ae2('0xd'));var jsforce=require(_0x0ae2('0xe'));var deskjs=require(_0x0ae2('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0ae2('0x10'));var Papa=require(_0x0ae2('0x11'));var Redis=require(_0x0ae2('0x12'));var authService=require(_0x0ae2('0x13'));var qs=require(_0x0ae2('0x14'));var as=require(_0x0ae2('0x15'));var hardwareService=require(_0x0ae2('0x16'));var logger=require(_0x0ae2('0x17'))('api');var utils=require(_0x0ae2('0x18'));var config=require(_0x0ae2('0x19'));var licenseUtil=require(_0x0ae2('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c6a86,_0x1068fa){_0x1068fa=_0x1068fa||0xcc;return function(_0x491a1b){if(_0x491a1b){return _0x4c6a86[_0x0ae2('0x1b')](_0x1068fa);}return _0x4c6a86[_0x0ae2('0x1c')](_0x1068fa)[_0x0ae2('0x1d')]();};}function respondWithResult(_0x3ac908,_0x19cdc3){_0x19cdc3=_0x19cdc3||0xc8;return function(_0x313de1){if(_0x313de1){return _0x3ac908[_0x0ae2('0x1c')](_0x19cdc3)[_0x0ae2('0x1e')](_0x313de1);}};}function respondWithFilteredResult(_0x13106e,_0x5511e6){return function(_0x13066b){if(_0x13066b){var _0x50f0af=typeof _0x5511e6[_0x0ae2('0x1f')]===_0x0ae2('0x20')&&typeof _0x5511e6[_0x0ae2('0x21')]===_0x0ae2('0x20');var _0x512c38=_0x13066b[_0x0ae2('0x22')];var _0x5246b0=_0x50f0af?0x0:_0x5511e6[_0x0ae2('0x1f')];var _0x3bd7bd=_0x50f0af?_0x13066b[_0x0ae2('0x22')]:_0x5511e6[_0x0ae2('0x1f')]+_0x5511e6[_0x0ae2('0x21')];var _0x3b02d0;if(_0x3bd7bd>=_0x512c38){_0x3bd7bd=_0x512c38;_0x3b02d0=0xc8;}else{_0x3b02d0=0xce;}_0x13106e[_0x0ae2('0x1c')](_0x3b02d0);return _0x13106e['set'](_0x0ae2('0x23'),_0x5246b0+'-'+_0x3bd7bd+'/'+_0x512c38)[_0x0ae2('0x1e')](_0x13066b);}return null;};}function patchUpdates(_0xbac902){return function(_0x265914){try{jsonpatch[_0x0ae2('0x24')](_0x265914,_0xbac902,!![]);}catch(_0x5ba9d9){return BPromise[_0x0ae2('0x25')](_0x5ba9d9);}return _0x265914[_0x0ae2('0x26')]();};}function saveUpdates(_0x5bdd87,_0x1cf79c){return function(_0x26d6c0){if(_0x26d6c0){return _0x26d6c0[_0x0ae2('0x27')](_0x5bdd87)[_0x0ae2('0x28')](function(_0x20a06d){return _0x20a06d;});}return null;};}function removeEntity(_0x3f867b,_0x4f94cf){return function(_0x3711d4){if(_0x3711d4){return _0x3711d4[_0x0ae2('0x29')]()[_0x0ae2('0x28')](function(){_0x3f867b[_0x0ae2('0x1c')](0xcc)[_0x0ae2('0x1d')]();});}};}function handleEntityNotFound(_0x3d6aa5,_0xd6929b){return function(_0x910134){if(!_0x910134){_0x3d6aa5['sendStatus'](0x194);}return _0x910134;};}function handleError(_0x4823bb,_0xbf82fa){_0xbf82fa=_0xbf82fa||0x1f4;return function(_0x15d8d5){logger['error'](_0x15d8d5[_0x0ae2('0x2a')]);if(_0x15d8d5[_0x0ae2('0x2b')]){delete _0x15d8d5[_0x0ae2('0x2b')];}_0x4823bb[_0x0ae2('0x1c')](_0xbf82fa)['send'](_0x15d8d5);};}exports[_0x0ae2('0x2c')]=function(_0x3c0b89,_0x59088d){var _0x1a81f1={},_0xe2262b={},_0x529931={'count':0x0,'rows':[]};var _0x59d26b=_['map'](db[_0x0ae2('0x2d')]['rawAttributes'],function(_0x360779){return{'name':_0x360779['fieldName'],'type':_0x360779[_0x0ae2('0x2e')][_0x0ae2('0x2f')]};});_0xe2262b[_0x0ae2('0x30')]=_[_0x0ae2('0x31')](_0x59d26b,_0x0ae2('0x2b'));_0xe2262b['query']=_[_0x0ae2('0x32')](_0x3c0b89[_0x0ae2('0x33')]);_0xe2262b['filters']=_[_0x0ae2('0x34')](_0xe2262b[_0x0ae2('0x30')],_0xe2262b['query']);_0x1a81f1['attributes']=_[_0x0ae2('0x34')](_0xe2262b[_0x0ae2('0x30')],qs[_0x0ae2('0x35')](_0x3c0b89['query'][_0x0ae2('0x35')]));_0x1a81f1['attributes']=_0x1a81f1['attributes'][_0x0ae2('0x36')]?_0x1a81f1[_0x0ae2('0x37')]:_0xe2262b[_0x0ae2('0x30')];if(!_0x3c0b89['query'][_0x0ae2('0x38')]('nolimit')){_0x1a81f1['limit']=qs[_0x0ae2('0x21')](_0x3c0b89[_0x0ae2('0x33')]['limit']);_0x1a81f1[_0x0ae2('0x1f')]=qs[_0x0ae2('0x1f')](_0x3c0b89[_0x0ae2('0x33')]['offset']);}_0x1a81f1[_0x0ae2('0x39')]=qs[_0x0ae2('0x3a')](_0x3c0b89[_0x0ae2('0x33')]['sort']);_0x1a81f1[_0x0ae2('0x3b')]=qs[_0x0ae2('0x3c')](_['pick'](_0x3c0b89['query'],_0xe2262b[_0x0ae2('0x3c')]),_0x59d26b);if(_0x3c0b89[_0x0ae2('0x33')]['filter']){_0x1a81f1[_0x0ae2('0x3b')]=_[_0x0ae2('0x3d')](_0x1a81f1[_0x0ae2('0x3b')],{'$or':_['map'](_0x59d26b,function(_0xfdfa45){if(_0xfdfa45[_0x0ae2('0x2e')]!==_0x0ae2('0x3e')){var _0x1bd232={};_0x1bd232[_0xfdfa45[_0x0ae2('0x2b')]]={'$like':'%'+_0x3c0b89[_0x0ae2('0x33')][_0x0ae2('0x3f')]+'%'};return _0x1bd232;}})});}_0x1a81f1=_[_0x0ae2('0x3d')]({},_0x1a81f1,_0x3c0b89[_0x0ae2('0x40')]);var _0x46dba4={'where':_0x1a81f1['where']};return db[_0x0ae2('0x2d')][_0x0ae2('0x22')](_0x46dba4)[_0x0ae2('0x28')](function(_0x128f09){_0x529931['count']=_0x128f09;if(_0x3c0b89['query'][_0x0ae2('0x41')]){_0x1a81f1[_0x0ae2('0x42')]=[{'all':!![]}];}return db[_0x0ae2('0x2d')]['findAll'](_0x1a81f1);})['then'](function(_0x45d300){_0x529931[_0x0ae2('0x43')]=_0x45d300;return _0x529931;})[_0x0ae2('0x28')](respondWithFilteredResult(_0x59088d,_0x1a81f1))[_0x0ae2('0x44')](handleError(_0x59088d,null));};exports[_0x0ae2('0x45')]=function(_0x195ecf,_0x2769c6){var _0x73c1ea={'raw':!![],'where':{'id':_0x195ecf[_0x0ae2('0x46')]['id']}},_0x2847c9={};_0x2847c9['model']=_[_0x0ae2('0x32')](db[_0x0ae2('0x2d')]['rawAttributes']);_0x2847c9[_0x0ae2('0x33')]=_['keys'](_0x195ecf[_0x0ae2('0x33')]);_0x2847c9[_0x0ae2('0x3c')]=_[_0x0ae2('0x34')](_0x2847c9['model'],_0x2847c9['query']);_0x73c1ea['attributes']=_['intersection'](_0x2847c9[_0x0ae2('0x30')],qs[_0x0ae2('0x35')](_0x195ecf[_0x0ae2('0x33')][_0x0ae2('0x35')]));_0x73c1ea[_0x0ae2('0x37')]=_0x73c1ea[_0x0ae2('0x37')]['length']?_0x73c1ea[_0x0ae2('0x37')]:_0x2847c9[_0x0ae2('0x30')];if(_0x195ecf[_0x0ae2('0x33')]['includeAll']){_0x73c1ea[_0x0ae2('0x42')]=[{'all':!![]}];}_0x73c1ea=_[_0x0ae2('0x3d')]({},_0x73c1ea,_0x195ecf[_0x0ae2('0x40')]);return db[_0x0ae2('0x2d')][_0x0ae2('0x47')](_0x73c1ea)[_0x0ae2('0x28')](handleEntityNotFound(_0x2769c6,null))[_0x0ae2('0x28')](respondWithResult(_0x2769c6,null))['catch'](handleError(_0x2769c6,null));};exports[_0x0ae2('0x48')]=function(_0x53fd72,_0x26e9fd){return db[_0x0ae2('0x2d')][_0x0ae2('0x48')](_0x53fd72[_0x0ae2('0x49')],{})[_0x0ae2('0x28')](respondWithResult(_0x26e9fd,0xc9))[_0x0ae2('0x44')](handleError(_0x26e9fd,null));};exports[_0x0ae2('0x27')]=function(_0x544560,_0x853a28){if(_0x544560[_0x0ae2('0x49')]['id']){delete _0x544560['body']['id'];}return db[_0x0ae2('0x2d')][_0x0ae2('0x47')]({'where':{'id':_0x544560[_0x0ae2('0x46')]['id']}})[_0x0ae2('0x28')](handleEntityNotFound(_0x853a28,null))['then'](saveUpdates(_0x544560[_0x0ae2('0x49')],null))['then'](respondWithResult(_0x853a28,null))[_0x0ae2('0x44')](handleError(_0x853a28,null));};exports[_0x0ae2('0x29')]=function(_0x1fec04,_0x56a5c8){return db['VoiceTransferReport'][_0x0ae2('0x47')]({'where':{'id':_0x1fec04[_0x0ae2('0x46')]['id']}})[_0x0ae2('0x28')](handleEntityNotFound(_0x56a5c8,null))[_0x0ae2('0x28')](removeEntity(_0x56a5c8,null))[_0x0ae2('0x44')](handleError(_0x56a5c8,null));};exports[_0x0ae2('0x4a')]=function(_0x530774,_0x313f78){return db[_0x0ae2('0x2d')][_0x0ae2('0x4a')]()[_0x0ae2('0x28')](respondWithResult(_0x313f78,null))[_0x0ae2('0x44')](handleError(_0x313f78,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 18efa42..87114f8 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 _0x66ed=['moment','bluebird','request-promise','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api'];(function(_0x3aef9b,_0x4a52c5){var _0x5613f9=function(_0x2f4bc0){while(--_0x2f4bc0){_0x3aef9b['push'](_0x3aef9b['shift']());}};_0x5613f9(++_0x4a52c5);}(_0x66ed,0x1dc));var _0xd66e=function(_0x492a04,_0x4943bd){_0x492a04=_0x492a04-0x0;var _0x42aec6=_0x66ed[_0x492a04];return _0x42aec6;};'use strict';var _=require(_0xd66e('0x0'));var util=require(_0xd66e('0x1'));var logger=require(_0xd66e('0x2'))(_0xd66e('0x3'));var moment=require(_0xd66e('0x4'));var BPromise=require(_0xd66e('0x5'));var rp=require(_0xd66e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd66e('0x7'));module[_0xd66e('0x8')]=function(_0x3836be,_0x11b807){return _0x3836be[_0xd66e('0x9')](_0xd66e('0xa'),attributes,{'tableName':_0xd66e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf2c5=['../../config/environment','./voiceTransferReport.attributes','exports','VoiceTransferReport','report_call_transfer','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x44b977,_0x262769){var _0xaedec5=function(_0x166aa6){while(--_0x166aa6){_0x44b977['push'](_0x44b977['shift']());}};_0xaedec5(++_0x262769);}(_0xf2c5,0x13d));var _0x5f2c=function(_0x23211e,_0x5deaa9){_0x23211e=_0x23211e-0x0;var _0x80cda2=_0xf2c5[_0x23211e];return _0x80cda2;};'use strict';var _=require(_0x5f2c('0x0'));var util=require('util');var logger=require(_0x5f2c('0x1'))('api');var moment=require(_0x5f2c('0x2'));var BPromise=require(_0x5f2c('0x3'));var rp=require(_0x5f2c('0x4'));var fs=require('fs');var path=require(_0x5f2c('0x5'));var rimraf=require(_0x5f2c('0x6'));var config=require(_0x5f2c('0x7'));var attributes=require(_0x5f2c('0x8'));module[_0x5f2c('0x9')]=function(_0x502672,_0x3ec64b){return _0x502672['define'](_0x5f2c('0xa'),attributes,{'tableName':_0x5f2c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 0568f51..ff98927 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 _0xafb9=['catch','CreateVoiceTransferReport','body','options','then','debug','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','stringify','error','code','message','VoiceTransferReport,\x20%s,\x20%s','result'];(function(_0x50745e,_0x4722a9){var _0x17886c=function(_0x49a8e9){while(--_0x49a8e9){_0x50745e['push'](_0x50745e['shift']());}};_0x17886c(++_0x4722a9);}(_0xafb9,0x1f4));var _0x9afb=function(_0x37efed,_0x4a39c4){_0x37efed=_0x37efed-0x0;var _0x43ff38=_0xafb9[_0x37efed];return _0x43ff38;};'use strict';var _=require(_0x9afb('0x0'));var util=require('util');var moment=require(_0x9afb('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9afb('0x2'));var db=require(_0x9afb('0x3'))['db'];var utils=require(_0x9afb('0x4'));var logger=require(_0x9afb('0x5'))(_0x9afb('0x6'));var config=require(_0x9afb('0x7'));var jayson=require(_0x9afb('0x8'));var client=jayson[_0x9afb('0x9')][_0x9afb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x513320,_0x246d18,_0x115505){return new BPromise(function(_0xefadcb,_0x31ef56){return client[_0x9afb('0xb')](_0x513320,_0x115505)['then'](function(_0x11488c){logger[_0x9afb('0xc')]('VoiceTransferReport,\x20%s,\x20%s',_0x246d18,_0x9afb('0xd'));logger['debug']('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x246d18,_0x9afb('0xd'),JSON[_0x9afb('0xe')](_0x11488c));if(_0x11488c['error']){if(_0x11488c[_0x9afb('0xf')][_0x9afb('0x10')]===0x1f4){logger[_0x9afb('0xf')]('VoiceTransferReport,\x20%s,\x20%s',_0x246d18,_0x11488c[_0x9afb('0xf')]['message']);return _0x31ef56(_0x11488c[_0x9afb('0xf')][_0x9afb('0x11')]);}logger[_0x9afb('0xf')]('VoiceTransferReport,\x20%s,\x20%s',_0x246d18,_0x11488c[_0x9afb('0xf')][_0x9afb('0x11')]);return _0xefadcb(_0x11488c['error'][_0x9afb('0x11')]);}else{logger[_0x9afb('0xc')](_0x9afb('0x12'),_0x246d18,_0x9afb('0xd'));_0xefadcb(_0x11488c[_0x9afb('0x13')][_0x9afb('0x11')]);}})[_0x9afb('0x14')](function(_0xb50eb0){logger[_0x9afb('0xf')](_0x9afb('0x12'),_0x246d18,_0xb50eb0);_0x31ef56(_0xb50eb0);});});}exports[_0x9afb('0x15')]=function(_0x5f0e0e){var _0x1f3fa9=this;return new Promise(function(_0x21dbbc,_0x58010b){return db['VoiceTransferReport']['create'](_0x5f0e0e[_0x9afb('0x16')],{'raw':_0x5f0e0e[_0x9afb('0x17')]?_0x5f0e0e[_0x9afb('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x9afb('0x18')](function(_0x390e5e){logger[_0x9afb('0xc')](_0x9afb('0x15'),_0x5f0e0e);logger[_0x9afb('0x19')](_0x9afb('0x15'),_0x5f0e0e,JSON[_0x9afb('0xe')](_0x390e5e));_0x21dbbc(_0x390e5e);})[_0x9afb('0x14')](function(_0xd0bdab){logger[_0x9afb('0xf')](_0x9afb('0x15'),_0xd0bdab[_0x9afb('0x11')],_0x5f0e0e);_0x58010b(_0x1f3fa9[_0x9afb('0xf')](0x1f4,_0xd0bdab[_0x9afb('0x11')]));});});}; \ No newline at end of file +var _0x4c88=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceTransferReport','create','options','raw','CreateVoiceTransferReport','debug','lodash','util'];(function(_0x43ecd0,_0x3bc7f2){var _0x4f446f=function(_0x38ecb6){while(--_0x38ecb6){_0x43ecd0['push'](_0x43ecd0['shift']());}};_0x4f446f(++_0x3bc7f2);}(_0x4c88,0xfa));var _0x84c8=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x4c88[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x84c8('0x0'));var util=require(_0x84c8('0x1'));var moment=require(_0x84c8('0x2'));var BPromise=require(_0x84c8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x84c8('0x4'))['db'];var utils=require(_0x84c8('0x5'));var logger=require(_0x84c8('0x6'))(_0x84c8('0x7'));var config=require('../../config/environment');var jayson=require(_0x84c8('0x8'));var client=jayson['client'][_0x84c8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2422fe,_0x1ee2c9,_0x5340d2){return new BPromise(function(_0x5dd805,_0xf44263){return client[_0x84c8('0xa')](_0x2422fe,_0x5340d2)[_0x84c8('0xb')](function(_0x54e852){logger[_0x84c8('0xc')](_0x84c8('0xd'),_0x1ee2c9,_0x84c8('0xe'));logger['debug'](_0x84c8('0xf'),_0x1ee2c9,_0x84c8('0xe'),JSON[_0x84c8('0x10')](_0x54e852));if(_0x54e852['error']){if(_0x54e852[_0x84c8('0x11')][_0x84c8('0x12')]===0x1f4){logger[_0x84c8('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x1ee2c9,_0x54e852['error']['message']);return _0xf44263(_0x54e852[_0x84c8('0x11')]['message']);}logger['error'](_0x84c8('0xd'),_0x1ee2c9,_0x54e852[_0x84c8('0x11')][_0x84c8('0x13')]);return _0x5dd805(_0x54e852['error'][_0x84c8('0x13')]);}else{logger[_0x84c8('0xc')](_0x84c8('0xd'),_0x1ee2c9,'request\x20sent');_0x5dd805(_0x54e852[_0x84c8('0x14')][_0x84c8('0x13')]);}})[_0x84c8('0x15')](function(_0x5edf53){logger[_0x84c8('0x11')](_0x84c8('0xd'),_0x1ee2c9,_0x5edf53);_0xf44263(_0x5edf53);});});}exports['CreateVoiceTransferReport']=function(_0x536e5f){var _0x22bd6a=this;return new Promise(function(_0x3d1f4b,_0x4ccf83){return db[_0x84c8('0x16')][_0x84c8('0x17')](_0x536e5f['body'],{'raw':_0x536e5f[_0x84c8('0x18')]?_0x536e5f['options'][_0x84c8('0x19')]===undefined?!![]:![]:!![]})[_0x84c8('0xb')](function(_0x3a95cf){logger['info'](_0x84c8('0x1a'),_0x536e5f);logger[_0x84c8('0x1b')](_0x84c8('0x1a'),_0x536e5f,JSON['stringify'](_0x3a95cf));_0x3d1f4b(_0x3a95cf);})['catch'](function(_0x5a8beb){logger[_0x84c8('0x11')](_0x84c8('0x1a'),_0x5a8beb['message'],_0x536e5f);_0x4ccf83(_0x22bd6a[_0x84c8('0x11')](0x1f4,_0x5a8beb[_0x84c8('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index f3239dc..921f3a9 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 _0xdace=['unhold','calls','/transfer','transfer','exports','express','../../components/auth/service','./webbar.controller','post','isAuthenticated','isWebrtcLicence','originate','hangup','/answer','/hold','/unhold'];(function(_0x4e9274,_0x49576e){var _0x8b474c=function(_0x204cca){while(--_0x204cca){_0x4e9274['push'](_0x4e9274['shift']());}};_0x8b474c(++_0x49576e);}(_0xdace,0xc5));var _0xedac=function(_0x37e886,_0x17d0ad){_0x37e886=_0x37e886-0x0;var _0x57c5cd=_0xdace[_0x37e886];return _0x57c5cd;};'use strict';var express=require(_0xedac('0x0'));var router=express['Router']();var auth=require(_0xedac('0x1'));var controller=require(_0xedac('0x2'));router[_0xedac('0x3')]('/originate',auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller[_0xedac('0x6')]);router[_0xedac('0x3')]('/hangup',auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller[_0xedac('0x7')]);router['post'](_0xedac('0x8'),auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller['answer']);router[_0xedac('0x3')](_0xedac('0x9'),auth[_0xedac('0x4')](),auth['isWebrtcLicence'](),controller['hold']);router[_0xedac('0x3')](_0xedac('0xa'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xedac('0xb')]);router[_0xedac('0x3')]('/calls',auth[_0xedac('0x4')](),auth['isWebrtcLicence'](),controller[_0xedac('0xc')]);router[_0xedac('0x3')](_0xedac('0xd'),auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller[_0xedac('0xe')]);module[_0xedac('0xf')]=router; \ No newline at end of file +var _0xb4e6=['unhold','calls','/transfer','exports','express','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','/hold','hold','/unhold'];(function(_0xb29283,_0x318abf){var _0xe212a1=function(_0x2fb09d){while(--_0x2fb09d){_0xb29283['push'](_0xb29283['shift']());}};_0xe212a1(++_0x318abf);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x28a5ad,_0x520afa){_0x28a5ad=_0x28a5ad-0x0;var _0x176b8a=_0xb4e6[_0x28a5ad];return _0x176b8a;};'use strict';var express=require(_0x6b4e('0x0'));var router=express['Router']();var auth=require(_0x6b4e('0x1'));var controller=require(_0x6b4e('0x2'));router[_0x6b4e('0x3')](_0x6b4e('0x4'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller[_0x6b4e('0x7')]);router['post'](_0x6b4e('0x8'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller['hangup']);router[_0x6b4e('0x3')]('/answer',auth['isAuthenticated'](),auth[_0x6b4e('0x6')](),controller['answer']);router['post'](_0x6b4e('0x9'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller[_0x6b4e('0xa')]);router[_0x6b4e('0x3')](_0x6b4e('0xb'),auth[_0x6b4e('0x5')](),auth['isWebrtcLicence'](),controller[_0x6b4e('0xc')]);router[_0x6b4e('0x3')]('/calls',auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller[_0x6b4e('0xd')]);router[_0x6b4e('0x3')](_0x6b4e('0xe'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller['transfer']);module[_0x6b4e('0xf')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 0338d85..879acaa 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 _0x74f0=['callbackUrl','entityFound:','user:%s','json','originate\x20executed!','catch','hangup','hangup\x20fired:','hangup\x20executed!','answer','answer\x20fired:','format','webbar:answer','hold','webbar:hold','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','rows','conference','conference\x20executed!','transfer','webbar:transfer','transfer\x20executed!','lodash','util','bluebird','jayson/promise','client','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','string','callNumber\x20is\x20required','userId\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','emit','log','handleError:','error','name','status','send','NotFound','request','then','code','message','User','findOne','all','filter','UserId','sessionId','length','\x20not\x20found!','originate','originate\x20fired:','body','userId','callNumber','callerId'];(function(_0x533652,_0x2d755e){var _0x365e33=function(_0x1b917f){while(--_0x1b917f){_0x533652['push'](_0x533652['shift']());}};_0x365e33(++_0x2d755e);}(_0x74f0,0xf3));var _0x074f=function(_0x422b48,_0xf131fb){_0x422b48=_0x422b48-0x0;var _0x4a6f67=_0x74f0[_0x422b48];return _0x4a6f67;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x074f('0x0'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var util=require(_0x074f('0x1'));var BPromise=require(_0x074f('0x2'));var jayson=require(_0x074f('0x3'));var amiClient=jayson[_0x074f('0x4')]['http']({'port':0x232a});var logger=require('../../config/logger')(_0x074f('0x5'));var Redis=require(_0x074f('0x6'));config[_0x074f('0x7')]=_[_0x074f('0x8')](config[_0x074f('0x7')],{'host':_0x074f('0x9'),'port':0x18eb});var io=require(_0x074f('0xa'))(new Redis(config['redis']));var Schema=require(_0x074f('0xb'));var originateValidation=new Schema({'userId':{'type':_0x074f('0xc'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0x074f('0xd'),'required':[!![],_0x074f('0xe')]},'callerId':{'type':_0x074f('0xd')},'callbackUrl':{'type':_0x074f('0xd')}});var hangupValidation=new Schema({'userId':{'type':_0x074f('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0x074f('0xc'),'required':[!![],_0x074f('0xf')]},'sessionId':{'type':_0x074f('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x074f('0xc'),'required':[!![],_0x074f('0xf')]},'sessionId':{'type':_0x074f('0xd'),'required':[!![],_0x074f('0x10')]},'transferNumber':{'type':_0x074f('0xd'),'required':[!![],_0x074f('0x11')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x074f('0xf')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x074f('0xc'),'required':[!![],_0x074f('0xf')]},'sessionId':{'type':_0x074f('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x074f('0xc'),'required':[!![],_0x074f('0xf')]}});var conferenceValidation=new Schema({'userId':{'type':_0x074f('0xc'),'required':[!![],_0x074f('0xf')]}});function emit(_0x1edf9c,_0x3f1a47,_0x428987){logger[_0x074f('0x12')](_0x1edf9c,_0x3f1a47,JSON['stringify'](_0x428987));io['to'](_0x1edf9c)[_0x074f('0x13')](_0x3f1a47,_0x428987);}function handleError(_0x367b52){return function(_0x200e43){console[_0x074f('0x14')](_0x074f('0x15'),_0x200e43,_0x200e43 instanceof RangeError);logger[_0x074f('0x16')](_0x200e43['stack']);if(_0x200e43 instanceof RangeError){if(_0x200e43['name']){delete _0x200e43[_0x074f('0x17')];}_0x367b52['status'](0x194)['send'](_0x200e43);}else{if(_0x200e43[_0x074f('0x17')]){delete _0x200e43[_0x074f('0x17')];}_0x367b52[_0x074f('0x18')](0x1f4)[_0x074f('0x19')](_0x200e43);}};}function checkError(){return function(_0xfa07ea){if(!_0xfa07ea){throw new RangeError(_0x074f('0x1a'));}return _0xfa07ea;};}function respondWithRpcPromise(_0x23406f,_0x3ecb4b){return new BPromise(function(_0x1acf0a,_0x2c3b23){var _0x335170=amiClient;return _0x335170[_0x074f('0x1b')](_0x23406f,_0x3ecb4b)[_0x074f('0x1c')](function(_0x2fc5b0){if(_0x2fc5b0[_0x074f('0x16')]){if(_0x2fc5b0[_0x074f('0x16')][_0x074f('0x1d')]===0x1f4){return _0x2c3b23(_0x2fc5b0[_0x074f('0x16')][_0x074f('0x1e')]);}return _0x1acf0a(_0x2fc5b0[_0x074f('0x16')]['message']);}else{_0x1acf0a(_0x2fc5b0['result']);}})['catch'](function(_0x1051ce){_0x2c3b23(_0x1051ce);});});}function getAgent(_0x22ce4f){return db[_0x074f('0x1f')][_0x074f('0x20')]({'where':{'id':_0x22ce4f,'role':'agent'}})[_0x074f('0x1c')](checkError());}function getAgentCheckSession(_0x339370,_0x3fb202){return new BPromise(function(_0x312119,_0x470acc){var _0xb9722a=respondWithRpcPromise('VoiceChannels');var _0x1bf574=getAgent(_0x339370);Promise[_0x074f('0x21')]([_0xb9722a,_0x1bf574])[_0x074f('0x1c')](function(_0x53b76d){var _0x1ee652=_0x53b76d[0x0];var _0x5d6edd=_0x53b76d[0x1];var _0x4fcfb5=_[_0x074f('0x22')](_0x1ee652['rows'],function(_0x4aa96f){return _0x4aa96f[_0x074f('0x23')]==_0x5d6edd['id']&&_0x4aa96f[_0x074f('0x24')]==_0x3fb202;});if(_0x4fcfb5[_0x074f('0x25')]==0x1){_0x312119(_0x5d6edd);}else{_0x470acc(new RangeError('sessionId\x20'+_0x3fb202+_0x074f('0x26')));}});});}exports[_0x074f('0x27')]=function(_0x269df3,_0x50314d){logger[_0x074f('0x12')](_0x074f('0x28'),_0x269df3[_0x074f('0x29')]);var _0x41ccb4=originateValidation[_0x074f('0xb')](_0x269df3['body']);if(_0x41ccb4[_0x074f('0x25')]>0x0){return _0x50314d[_0x074f('0x18')](0x190)['json'](_0x41ccb4);}var _0x16ff4c=_0x269df3[_0x074f('0x29')][_0x074f('0x2a')];var _0x498288=_0x269df3[_0x074f('0x29')][_0x074f('0x2b')];var _0x493cc3=_0x269df3[_0x074f('0x29')][_0x074f('0x2c')];var _0x3407bd=_0x269df3[_0x074f('0x29')][_0x074f('0x2d')];return getAgent(_0x16ff4c)[_0x074f('0x1c')](function(_0x283211){logger[_0x074f('0x12')](_0x074f('0x2e'),_0x283211[_0x074f('0x17')]);emit(util['format'](_0x074f('0x2f'),_0x283211[_0x074f('0x17')]),'webbar:originate',{'callNumber':_0x498288,'callerId':_0x493cc3,'callbackUrl':_0x3407bd});return _0x50314d[_0x074f('0x18')](0xc8)[_0x074f('0x30')]({'error':![],'message':_0x074f('0x31')});})[_0x074f('0x32')](handleError(_0x50314d));};exports[_0x074f('0x33')]=function(_0x380c0e,_0x29d5c7){logger['info'](_0x074f('0x34'),_0x380c0e[_0x074f('0x29')]);var _0x251532=hangupValidation[_0x074f('0xb')](_0x380c0e[_0x074f('0x29')]);if(_0x251532[_0x074f('0x25')]>0x0){return _0x29d5c7['status'](0x190)[_0x074f('0x30')](_0x251532);}var _0x19866e=_0x380c0e['body'][_0x074f('0x2a')];var _0x41b1f2=_0x380c0e[_0x074f('0x29')]['sessionId'];return getAgent(_0x19866e)['then'](function(_0x5f39e5){logger[_0x074f('0x12')](_0x074f('0x2e'),_0x5f39e5[_0x074f('0x17')]);emit(util['format'](_0x074f('0x2f'),_0x5f39e5[_0x074f('0x17')]),'webbar:hangup',{'sessionId':_0x41b1f2});return _0x29d5c7[_0x074f('0x18')](0xc8)[_0x074f('0x30')]({'error':![],'message':_0x074f('0x35')});})[_0x074f('0x32')](handleError(_0x29d5c7));};exports[_0x074f('0x36')]=function(_0x42de45,_0x40dac1){logger[_0x074f('0x12')](_0x074f('0x37'),_0x42de45[_0x074f('0x29')]);var _0x58ff4d=answerValidation[_0x074f('0xb')](_0x42de45['body']);if(_0x58ff4d[_0x074f('0x25')]>0x0){return _0x40dac1['status'](0x190)[_0x074f('0x30')](_0x58ff4d);}var _0x4c59ec=_0x42de45[_0x074f('0x29')]['userId'];var _0x654e6e=_0x42de45[_0x074f('0x29')][_0x074f('0x24')];return getAgent(_0x4c59ec)[_0x074f('0x1c')](function(_0xe20f2b){logger[_0x074f('0x12')](_0x074f('0x2e'),_0xe20f2b['name']);emit(util[_0x074f('0x38')](_0x074f('0x2f'),_0xe20f2b[_0x074f('0x17')]),_0x074f('0x39'),{'sessionId':_0x654e6e});return _0x40dac1['status'](0xc8)[_0x074f('0x30')]({'error':![],'message':'answer\x20executed!'});})[_0x074f('0x32')](handleError(_0x40dac1));};exports[_0x074f('0x3a')]=function(_0x324ca3,_0x5ebf87){logger[_0x074f('0x12')]('hold\x20fired:',_0x324ca3[_0x074f('0x29')]);var _0x2ed08a=holdValidation['validate'](_0x324ca3[_0x074f('0x29')]);if(_0x2ed08a['length']>0x0){return _0x5ebf87[_0x074f('0x18')](0x190)[_0x074f('0x30')](_0x2ed08a);}var _0x598fee=_0x324ca3['body']['userId'];var _0x4d5731=_0x324ca3[_0x074f('0x29')][_0x074f('0x24')];return getAgent(_0x598fee)[_0x074f('0x1c')](function(_0xdd3709){logger['info'](_0x074f('0x2e'),_0xdd3709[_0x074f('0x17')]);emit(util[_0x074f('0x38')](_0x074f('0x2f'),_0xdd3709[_0x074f('0x17')]),_0x074f('0x3b'),{'sessionId':_0x4d5731});return _0x5ebf87[_0x074f('0x18')](0xc8)[_0x074f('0x30')]({'error':![],'message':'hold\x20executed!'});})[_0x074f('0x32')](handleError(_0x5ebf87));};exports[_0x074f('0x3c')]=function(_0x2ff3ab,_0x306a17){logger['info'](_0x074f('0x3d'),_0x2ff3ab[_0x074f('0x29')]);var _0x50bb3d=unholdValidation['validate'](_0x2ff3ab[_0x074f('0x29')]);if(_0x50bb3d[_0x074f('0x25')]>0x0){return _0x306a17[_0x074f('0x18')](0x190)[_0x074f('0x30')](_0x50bb3d);}var _0x563343=_0x2ff3ab['body'][_0x074f('0x2a')];var _0xc38f21=_0x2ff3ab[_0x074f('0x29')][_0x074f('0x24')];return getAgent(_0x563343)[_0x074f('0x1c')](function(_0x151c90){logger[_0x074f('0x12')](_0x074f('0x2e'),_0x151c90[_0x074f('0x17')]);emit(util['format'](_0x074f('0x2f'),_0x151c90[_0x074f('0x17')]),_0x074f('0x3e'),{'sessionId':_0xc38f21});return _0x306a17[_0x074f('0x18')](0xc8)[_0x074f('0x30')]({'error':![],'message':_0x074f('0x3f')});})['catch'](handleError(_0x306a17));};exports[_0x074f('0x40')]=function(_0xe69ce5,_0x56b286){logger[_0x074f('0x12')](_0x074f('0x41'),_0x56b286[_0x074f('0x29')]);var _0x417fa1=callsValidation[_0x074f('0xb')](_0xe69ce5[_0x074f('0x29')]);if(_0x417fa1[_0x074f('0x25')]>0x0){return _0x56b286[_0x074f('0x18')](0x190)[_0x074f('0x30')](_0x417fa1);}var _0x2d2787=_0xe69ce5['body'][_0x074f('0x2a')];var _0x51ede6=respondWithRpcPromise('VoiceChannels');var _0x41aec7=getAgent(_0x2d2787);return Promise['all']([_0x51ede6,_0x41aec7])['then'](function(_0x24eb7a){var _0x183c51=_0x24eb7a[0x0];var _0x668a47=_0x24eb7a[0x1];var _0x3f3762=_[_0x074f('0x22')](_0x183c51[_0x074f('0x42')],function(_0x311d36){return _0x311d36[_0x074f('0x23')]==_0x668a47['id'];});return _0x56b286['status'](0xc8)['json']({'count':_0x3f3762[_0x074f('0x25')],'rows':_0x3f3762});})[_0x074f('0x32')](handleError(_0x56b286));};exports[_0x074f('0x43')]=function(_0x5ce8d2,_0x1de8f2){logger[_0x074f('0x12')]('conference\x20fired:',_0x5ce8d2['body']);var _0x274ce9=conferenceValidation['validate'](_0x5ce8d2[_0x074f('0x29')]);if(_0x274ce9[_0x074f('0x25')]>0x0){return _0x1de8f2['status'](0x190)[_0x074f('0x30')](_0x274ce9);}var _0x104933=_0x5ce8d2[_0x074f('0x29')][_0x074f('0x2a')];return getAgent(_0x104933)[_0x074f('0x1c')](function(_0x9fe79e){logger[_0x074f('0x12')](_0x074f('0x2e'),_0x9fe79e[_0x074f('0x17')]);emit(util[_0x074f('0x38')](_0x074f('0x2f'),_0x9fe79e[_0x074f('0x17')]),'webbar:conference');return _0x1de8f2['status'](0xc8)['json']({'error':![],'message':_0x074f('0x44')});})['catch'](handleError(_0x1de8f2));};exports[_0x074f('0x45')]=function(_0x4e449f,_0x30296f){logger[_0x074f('0x12')]('transfer\x20fired:',_0x4e449f[_0x074f('0x29')]);var _0x1253f7=transferValidation[_0x074f('0xb')](_0x4e449f[_0x074f('0x29')]);if(_0x1253f7[_0x074f('0x25')]>0x0){return _0x30296f[_0x074f('0x18')](0x190)[_0x074f('0x30')](_0x1253f7);}var _0x5bb76b=_0x4e449f[_0x074f('0x29')][_0x074f('0x2a')];var _0x547922=_0x4e449f[_0x074f('0x29')][_0x074f('0x24')];var _0x125d07=_0x4e449f[_0x074f('0x29')]['transferNumber'];return getAgent(_0x5bb76b)[_0x074f('0x1c')](function(_0x110fa1){logger[_0x074f('0x12')]('entityFound:',_0x110fa1['name']);emit(util[_0x074f('0x38')](_0x074f('0x2f'),_0x110fa1[_0x074f('0x17')]),_0x074f('0x46'),{'sessionId':_0x547922,'transferNumber':_0x125d07});return _0x30296f[_0x074f('0x18')](0xc8)['json']({'error':![],'message':_0x074f('0x47')});})['catch'](handleError(_0x30296f));}; \ No newline at end of file +var _0xf2cb=['all','filter','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','info','originate\x20fired:','body','json','userId','callerId','callbackUrl','entityFound:','format','webbar:originate','originate\x20executed!','user:%s','webbar:hangup','hangup\x20executed!','answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','unhold','webbar:unhold','unhold\x20executed!','calls','rows','conference','conference\x20executed!','transferNumber','webbar:transfer','lodash','../../config/environment','bluebird','client','http','ioredis','redis','defaults','socket.io-emitter','validate','string','callNumber\x20is\x20required','number','userId\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','stringify','log','handleError:','error','name','status','send','NotFound','then','message','result','catch','findOne','agent','VoiceChannels'];(function(_0x2ff0a0,_0x2f2983){var _0x3e2af8=function(_0x4f7bb1){while(--_0x4f7bb1){_0x2ff0a0['push'](_0x2ff0a0['shift']());}};_0x3e2af8(++_0x2f2983);}(_0xf2cb,0x130));var _0xbf2c=function(_0x3f10de,_0x391f22){_0x3f10de=_0x3f10de-0x0;var _0x6707a3=_0xf2cb[_0x3f10de];return _0x6707a3;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0xbf2c('0x0'));var db=require('../../mysqldb')['db'];var config=require(_0xbf2c('0x1'));var util=require('util');var BPromise=require(_0xbf2c('0x2'));var jayson=require('jayson/promise');var amiClient=jayson[_0xbf2c('0x3')][_0xbf2c('0x4')]({'port':0x232a});var logger=require('../../config/logger')('webbarapi');var Redis=require(_0xbf2c('0x5'));config[_0xbf2c('0x6')]=_[_0xbf2c('0x7')](config[_0xbf2c('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xbf2c('0x8'))(new Redis(config['redis']));var Schema=require(_0xbf2c('0x9'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0xbf2c('0xa'),'required':[!![],_0xbf2c('0xb')]},'callerId':{'type':_0xbf2c('0xa')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0xbf2c('0xc'),'required':[!![],_0xbf2c('0xd')]},'sessionId':{'type':_0xbf2c('0xa'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xbf2c('0xc'),'required':[!![],_0xbf2c('0xd')]},'sessionId':{'type':_0xbf2c('0xa'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xbf2c('0xc'),'required':[!![],_0xbf2c('0xd')]},'sessionId':{'type':'string','required':[!![],_0xbf2c('0xe')]},'transferNumber':{'type':_0xbf2c('0xa'),'required':[!![],_0xbf2c('0xf')]}});var holdValidation=new Schema({'userId':{'type':_0xbf2c('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xbf2c('0xa'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xbf2c('0xa'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0xbf2c('0xc'),'required':[!![],_0xbf2c('0xd')]}});function emit(_0x2dc80e,_0x334900,_0x2af371){logger['info'](_0x2dc80e,_0x334900,JSON[_0xbf2c('0x10')](_0x2af371));io['to'](_0x2dc80e)['emit'](_0x334900,_0x2af371);}function handleError(_0x4ced7f){return function(_0x1df2ab){console[_0xbf2c('0x11')](_0xbf2c('0x12'),_0x1df2ab,_0x1df2ab instanceof RangeError);logger[_0xbf2c('0x13')](_0x1df2ab['stack']);if(_0x1df2ab instanceof RangeError){if(_0x1df2ab[_0xbf2c('0x14')]){delete _0x1df2ab[_0xbf2c('0x14')];}_0x4ced7f[_0xbf2c('0x15')](0x194)[_0xbf2c('0x16')](_0x1df2ab);}else{if(_0x1df2ab[_0xbf2c('0x14')]){delete _0x1df2ab[_0xbf2c('0x14')];}_0x4ced7f[_0xbf2c('0x15')](0x1f4)['send'](_0x1df2ab);}};}function checkError(){return function(_0x61248b){if(!_0x61248b){throw new RangeError(_0xbf2c('0x17'));}return _0x61248b;};}function respondWithRpcPromise(_0x96a759,_0xe6dad9){return new BPromise(function(_0x57873c,_0x2bc2ad){var _0x1f5515=amiClient;return _0x1f5515['request'](_0x96a759,_0xe6dad9)[_0xbf2c('0x18')](function(_0x356f26){if(_0x356f26[_0xbf2c('0x13')]){if(_0x356f26['error']['code']===0x1f4){return _0x2bc2ad(_0x356f26[_0xbf2c('0x13')][_0xbf2c('0x19')]);}return _0x57873c(_0x356f26[_0xbf2c('0x13')][_0xbf2c('0x19')]);}else{_0x57873c(_0x356f26[_0xbf2c('0x1a')]);}})[_0xbf2c('0x1b')](function(_0x11ffbe){_0x2bc2ad(_0x11ffbe);});});}function getAgent(_0x4df358){return db['User'][_0xbf2c('0x1c')]({'where':{'id':_0x4df358,'role':_0xbf2c('0x1d')}})[_0xbf2c('0x18')](checkError());}function getAgentCheckSession(_0x4314d6,_0x3ed68d){return new BPromise(function(_0x4a0257,_0x30ca){var _0x2976fa=respondWithRpcPromise(_0xbf2c('0x1e'));var _0x4f3191=getAgent(_0x4314d6);Promise[_0xbf2c('0x1f')]([_0x2976fa,_0x4f3191])['then'](function(_0x3a9130){var _0x3442fa=_0x3a9130[0x0];var _0x40e866=_0x3a9130[0x1];var _0x17238f=_[_0xbf2c('0x20')](_0x3442fa['rows'],function(_0x1e946c){return _0x1e946c[_0xbf2c('0x21')]==_0x40e866['id']&&_0x1e946c[_0xbf2c('0x22')]==_0x3ed68d;});if(_0x17238f[_0xbf2c('0x23')]==0x1){_0x4a0257(_0x40e866);}else{_0x30ca(new RangeError(_0xbf2c('0x24')+_0x3ed68d+_0xbf2c('0x25')));}});});}exports[_0xbf2c('0x26')]=function(_0x3462dd,_0x4d731d){logger[_0xbf2c('0x27')](_0xbf2c('0x28'),_0x3462dd[_0xbf2c('0x29')]);var _0x5b93aa=originateValidation['validate'](_0x3462dd[_0xbf2c('0x29')]);if(_0x5b93aa[_0xbf2c('0x23')]>0x0){return _0x4d731d[_0xbf2c('0x15')](0x190)[_0xbf2c('0x2a')](_0x5b93aa);}var _0x286634=_0x3462dd[_0xbf2c('0x29')][_0xbf2c('0x2b')];var _0x255cbc=_0x3462dd[_0xbf2c('0x29')]['callNumber'];var _0x218363=_0x3462dd[_0xbf2c('0x29')][_0xbf2c('0x2c')];var _0x3a0134=_0x3462dd[_0xbf2c('0x29')][_0xbf2c('0x2d')];return getAgent(_0x286634)[_0xbf2c('0x18')](function(_0x4722b3){logger['info'](_0xbf2c('0x2e'),_0x4722b3[_0xbf2c('0x14')]);emit(util[_0xbf2c('0x2f')]('user:%s',_0x4722b3[_0xbf2c('0x14')]),_0xbf2c('0x30'),{'callNumber':_0x255cbc,'callerId':_0x218363,'callbackUrl':_0x3a0134});return _0x4d731d[_0xbf2c('0x15')](0xc8)['json']({'error':![],'message':_0xbf2c('0x31')});})[_0xbf2c('0x1b')](handleError(_0x4d731d));};exports['hangup']=function(_0x5d683d,_0x47ab9a){logger['info']('hangup\x20fired:',_0x5d683d[_0xbf2c('0x29')]);var _0x13652a=hangupValidation[_0xbf2c('0x9')](_0x5d683d[_0xbf2c('0x29')]);if(_0x13652a[_0xbf2c('0x23')]>0x0){return _0x47ab9a[_0xbf2c('0x15')](0x190)[_0xbf2c('0x2a')](_0x13652a);}var _0x325581=_0x5d683d[_0xbf2c('0x29')][_0xbf2c('0x2b')];var _0x245eaf=_0x5d683d[_0xbf2c('0x29')][_0xbf2c('0x22')];return getAgent(_0x325581)[_0xbf2c('0x18')](function(_0x4776e0){logger[_0xbf2c('0x27')]('entityFound:',_0x4776e0[_0xbf2c('0x14')]);emit(util[_0xbf2c('0x2f')](_0xbf2c('0x32'),_0x4776e0[_0xbf2c('0x14')]),_0xbf2c('0x33'),{'sessionId':_0x245eaf});return _0x47ab9a[_0xbf2c('0x15')](0xc8)[_0xbf2c('0x2a')]({'error':![],'message':_0xbf2c('0x34')});})['catch'](handleError(_0x47ab9a));};exports[_0xbf2c('0x35')]=function(_0x2bccc2,_0x652066){logger[_0xbf2c('0x27')]('answer\x20fired:',_0x2bccc2[_0xbf2c('0x29')]);var _0x5067d2=answerValidation[_0xbf2c('0x9')](_0x2bccc2[_0xbf2c('0x29')]);if(_0x5067d2[_0xbf2c('0x23')]>0x0){return _0x652066[_0xbf2c('0x15')](0x190)[_0xbf2c('0x2a')](_0x5067d2);}var _0x14107c=_0x2bccc2['body'][_0xbf2c('0x2b')];var _0x55c3d7=_0x2bccc2['body'][_0xbf2c('0x22')];return getAgent(_0x14107c)['then'](function(_0x57ddb9){logger[_0xbf2c('0x27')](_0xbf2c('0x2e'),_0x57ddb9['name']);emit(util[_0xbf2c('0x2f')]('user:%s',_0x57ddb9[_0xbf2c('0x14')]),'webbar:answer',{'sessionId':_0x55c3d7});return _0x652066[_0xbf2c('0x15')](0xc8)[_0xbf2c('0x2a')]({'error':![],'message':_0xbf2c('0x36')});})[_0xbf2c('0x1b')](handleError(_0x652066));};exports[_0xbf2c('0x37')]=function(_0x4187cf,_0x54ce68){logger[_0xbf2c('0x27')](_0xbf2c('0x38'),_0x4187cf[_0xbf2c('0x29')]);var _0x1b50a6=holdValidation[_0xbf2c('0x9')](_0x4187cf['body']);if(_0x1b50a6['length']>0x0){return _0x54ce68[_0xbf2c('0x15')](0x190)['json'](_0x1b50a6);}var _0xa08482=_0x4187cf[_0xbf2c('0x29')][_0xbf2c('0x2b')];var _0x1750ec=_0x4187cf[_0xbf2c('0x29')][_0xbf2c('0x22')];return getAgent(_0xa08482)[_0xbf2c('0x18')](function(_0x1c3b78){logger[_0xbf2c('0x27')](_0xbf2c('0x2e'),_0x1c3b78[_0xbf2c('0x14')]);emit(util['format'](_0xbf2c('0x32'),_0x1c3b78[_0xbf2c('0x14')]),_0xbf2c('0x39'),{'sessionId':_0x1750ec});return _0x54ce68[_0xbf2c('0x15')](0xc8)['json']({'error':![],'message':'hold\x20executed!'});})['catch'](handleError(_0x54ce68));};exports[_0xbf2c('0x3a')]=function(_0x2451ba,_0x56c470){logger['info']('unhold\x20fired:',_0x2451ba[_0xbf2c('0x29')]);var _0x314f7b=unholdValidation[_0xbf2c('0x9')](_0x2451ba[_0xbf2c('0x29')]);if(_0x314f7b[_0xbf2c('0x23')]>0x0){return _0x56c470[_0xbf2c('0x15')](0x190)['json'](_0x314f7b);}var _0xfff73d=_0x2451ba[_0xbf2c('0x29')][_0xbf2c('0x2b')];var _0x3fa07e=_0x2451ba[_0xbf2c('0x29')][_0xbf2c('0x22')];return getAgent(_0xfff73d)[_0xbf2c('0x18')](function(_0x180aad){logger['info']('entityFound:',_0x180aad['name']);emit(util[_0xbf2c('0x2f')](_0xbf2c('0x32'),_0x180aad[_0xbf2c('0x14')]),_0xbf2c('0x3b'),{'sessionId':_0x3fa07e});return _0x56c470['status'](0xc8)[_0xbf2c('0x2a')]({'error':![],'message':_0xbf2c('0x3c')});})['catch'](handleError(_0x56c470));};exports[_0xbf2c('0x3d')]=function(_0xcbe3be,_0x20229f){logger['info']('calls\x20fired:',_0x20229f['body']);var _0x49cae6=callsValidation[_0xbf2c('0x9')](_0xcbe3be[_0xbf2c('0x29')]);if(_0x49cae6[_0xbf2c('0x23')]>0x0){return _0x20229f[_0xbf2c('0x15')](0x190)[_0xbf2c('0x2a')](_0x49cae6);}var _0x5c7321=_0xcbe3be[_0xbf2c('0x29')][_0xbf2c('0x2b')];var _0x58b66a=respondWithRpcPromise(_0xbf2c('0x1e'));var _0x3f0129=getAgent(_0x5c7321);return Promise['all']([_0x58b66a,_0x3f0129])['then'](function(_0x5062a3){var _0x363f77=_0x5062a3[0x0];var _0x5df133=_0x5062a3[0x1];var _0x5cf1df=_[_0xbf2c('0x20')](_0x363f77[_0xbf2c('0x3e')],function(_0x2b84c6){return _0x2b84c6[_0xbf2c('0x21')]==_0x5df133['id'];});return _0x20229f['status'](0xc8)['json']({'count':_0x5cf1df[_0xbf2c('0x23')],'rows':_0x5cf1df});})[_0xbf2c('0x1b')](handleError(_0x20229f));};exports[_0xbf2c('0x3f')]=function(_0x2960fc,_0x151341){logger['info']('conference\x20fired:',_0x2960fc[_0xbf2c('0x29')]);var _0x1a4bf7=conferenceValidation[_0xbf2c('0x9')](_0x2960fc[_0xbf2c('0x29')]);if(_0x1a4bf7[_0xbf2c('0x23')]>0x0){return _0x151341[_0xbf2c('0x15')](0x190)['json'](_0x1a4bf7);}var _0x5b37b1=_0x2960fc[_0xbf2c('0x29')][_0xbf2c('0x2b')];return getAgent(_0x5b37b1)[_0xbf2c('0x18')](function(_0x1b9f8d){logger[_0xbf2c('0x27')](_0xbf2c('0x2e'),_0x1b9f8d[_0xbf2c('0x14')]);emit(util[_0xbf2c('0x2f')](_0xbf2c('0x32'),_0x1b9f8d['name']),'webbar:conference');return _0x151341[_0xbf2c('0x15')](0xc8)[_0xbf2c('0x2a')]({'error':![],'message':_0xbf2c('0x40')});})[_0xbf2c('0x1b')](handleError(_0x151341));};exports['transfer']=function(_0x436c4d,_0x2a1816){logger[_0xbf2c('0x27')]('transfer\x20fired:',_0x436c4d[_0xbf2c('0x29')]);var _0x1aa7c3=transferValidation[_0xbf2c('0x9')](_0x436c4d[_0xbf2c('0x29')]);if(_0x1aa7c3['length']>0x0){return _0x2a1816[_0xbf2c('0x15')](0x190)[_0xbf2c('0x2a')](_0x1aa7c3);}var _0x425a46=_0x436c4d['body']['userId'];var _0x295790=_0x436c4d['body']['sessionId'];var _0x1e2d67=_0x436c4d[_0xbf2c('0x29')][_0xbf2c('0x41')];return getAgent(_0x425a46)[_0xbf2c('0x18')](function(_0x1d7bf8){logger['info']('entityFound:',_0x1d7bf8[_0xbf2c('0x14')]);emit(util[_0xbf2c('0x2f')]('user:%s',_0x1d7bf8[_0xbf2c('0x14')]),_0xbf2c('0x42'),{'sessionId':_0x295790,'transferNumber':_0x1e2d67});return _0x2a1816['status'](0xc8)[_0xbf2c('0x2a')]({'error':![],'message':'transfer\x20executed!'});})[_0xbf2c('0x1b')](handleError(_0x2a1816));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 9c66d60..574ce3e 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 _0xd117=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/users','getAgents','getApplications','create','post','addDisposition','/:id/canned_answers','addAnswer','addAgents','/:id/applications','/:id/notify','send','put','update','delete','destroy','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout'];(function(_0x15ca1a,_0x30fc82){var _0x507626=function(_0x14c9bc){while(--_0x14c9bc){_0x15ca1a['push'](_0x15ca1a['shift']());}};_0x507626(++_0x30fc82);}(_0xd117,0x182));var _0x7d11=function(_0x32c98a,_0x5e6eb0){_0x32c98a=_0x32c98a-0x0;var _0x1796d3=_0xd117[_0x32c98a];return _0x1796d3;};'use strict';var multer=require(_0x7d11('0x0'));var util=require(_0x7d11('0x1'));var path=require(_0x7d11('0x2'));var timeout=require(_0x7d11('0x3'));var express=require(_0x7d11('0x4'));var router=express[_0x7d11('0x5')]();var fs_extra=require(_0x7d11('0x6'));var auth=require(_0x7d11('0x7'));var interaction=require(_0x7d11('0x8'));var config=require(_0x7d11('0x9'));var controller=require(_0x7d11('0xa'));router[_0x7d11('0xb')]('/',auth[_0x7d11('0xc')](),controller[_0x7d11('0xd')]);router[_0x7d11('0xb')](_0x7d11('0xe'),auth['isAuthenticated'](),controller[_0x7d11('0xf')]);router[_0x7d11('0xb')](_0x7d11('0x10'),auth['isAuthenticated'](),controller[_0x7d11('0x11')]);router[_0x7d11('0xb')](_0x7d11('0x12'),auth['isAuthenticated'](),controller[_0x7d11('0x13')]);router['get']('/:id/canned_answers',auth[_0x7d11('0xc')](),controller['getAnswers']);router['get'](_0x7d11('0x14'),auth['isAuthenticated'](),controller[_0x7d11('0x15')]);router[_0x7d11('0xb')]('/:id/applications',auth[_0x7d11('0xc')](),controller[_0x7d11('0x16')]);router['post']('/',auth[_0x7d11('0xc')](),controller[_0x7d11('0x17')]);router[_0x7d11('0x18')](_0x7d11('0x12'),auth[_0x7d11('0xc')](),controller[_0x7d11('0x19')]);router[_0x7d11('0x18')](_0x7d11('0x1a'),auth['isAuthenticated'](),controller[_0x7d11('0x1b')]);router[_0x7d11('0x18')](_0x7d11('0x14'),auth[_0x7d11('0xc')](),controller[_0x7d11('0x1c')]);router['post'](_0x7d11('0x1d'),auth[_0x7d11('0xc')](),controller['addApplications']);router['post'](_0x7d11('0x1e'),controller['notify']);router[_0x7d11('0x18')]('/:id/send',auth[_0x7d11('0xc')](),controller[_0x7d11('0x1f')]);router[_0x7d11('0x20')](_0x7d11('0x10'),auth[_0x7d11('0xc')](),controller[_0x7d11('0x21')]);router[_0x7d11('0x22')](_0x7d11('0x10'),auth['isAuthenticated'](),controller[_0x7d11('0x23')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x7d11('0x24')]);router[_0x7d11('0x22')](_0x7d11('0x1a'),auth[_0x7d11('0xc')](),controller[_0x7d11('0x25')]);router[_0x7d11('0x22')](_0x7d11('0x14'),auth[_0x7d11('0xc')](),controller['removeAgents']);module[_0x7d11('0x26')]=router; \ No newline at end of file +var _0x1a85=['removeAgents','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','create','post','addAnswer','addApplications','/:id/notify','/:id/send','send','put','/:id','update','destroy','delete','removeAnswers'];(function(_0x4c0c18,_0x2b6eca){var _0x395636=function(_0x2f533a){while(--_0x2f533a){_0x4c0c18['push'](_0x4c0c18['shift']());}};_0x395636(++_0x2b6eca);}(_0x1a85,0x178));var _0x51a8=function(_0x2d2623,_0x1aaea0){_0x2d2623=_0x2d2623-0x0;var _0x28f6c1=_0x1a85[_0x2d2623];return _0x28f6c1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x51a8('0x0'));var timeout=require(_0x51a8('0x1'));var express=require(_0x51a8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x51a8('0x3'));var interaction=require(_0x51a8('0x4'));var config=require(_0x51a8('0x5'));var controller=require('./whatsappAccount.controller');router[_0x51a8('0x6')]('/',auth['isAuthenticated'](),controller[_0x51a8('0x7')]);router['get'](_0x51a8('0x8'),auth[_0x51a8('0x9')](),controller['describe']);router[_0x51a8('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x51a8('0xa')]);router[_0x51a8('0x6')](_0x51a8('0xb'),auth[_0x51a8('0x9')](),controller[_0x51a8('0xc')]);router[_0x51a8('0x6')](_0x51a8('0xd'),auth[_0x51a8('0x9')](),controller[_0x51a8('0xe')]);router[_0x51a8('0x6')](_0x51a8('0xf'),auth[_0x51a8('0x9')](),controller[_0x51a8('0x10')]);router[_0x51a8('0x6')](_0x51a8('0x11'),auth[_0x51a8('0x9')](),controller[_0x51a8('0x12')]);router['post']('/',auth[_0x51a8('0x9')](),controller[_0x51a8('0x13')]);router[_0x51a8('0x14')]('/:id/dispositions',auth[_0x51a8('0x9')](),controller['addDisposition']);router[_0x51a8('0x14')](_0x51a8('0xd'),auth[_0x51a8('0x9')](),controller[_0x51a8('0x15')]);router[_0x51a8('0x14')](_0x51a8('0xf'),auth[_0x51a8('0x9')](),controller['addAgents']);router[_0x51a8('0x14')](_0x51a8('0x11'),auth[_0x51a8('0x9')](),controller[_0x51a8('0x16')]);router[_0x51a8('0x14')](_0x51a8('0x17'),controller['notify']);router[_0x51a8('0x14')](_0x51a8('0x18'),auth[_0x51a8('0x9')](),controller[_0x51a8('0x19')]);router[_0x51a8('0x1a')](_0x51a8('0x1b'),auth[_0x51a8('0x9')](),controller[_0x51a8('0x1c')]);router['delete'](_0x51a8('0x1b'),auth['isAuthenticated'](),controller[_0x51a8('0x1d')]);router[_0x51a8('0x1e')](_0x51a8('0xb'),auth[_0x51a8('0x9')](),controller['removeDispositions']);router[_0x51a8('0x1e')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x51a8('0x1f')]);router['delete'](_0x51a8('0xf'),auth[_0x51a8('0x9')](),controller[_0x51a8('0x20')]);module[_0x51a8('0x21')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index ebd15cb..4edf00d 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 _0x3b2e=['STRING','ENUM','sinch','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x3b2e,0x184));var _0xe3b2=function(_0x320b8e,_0x1da3fe){_0x320b8e=_0x320b8e-0x0;var _0x55a10a=_0x3b2e[_0x320b8e];return _0x55a10a;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xe3b2('0x0'));module[_0xe3b2('0x1')]={'name':{'type':Sequelize[_0xe3b2('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xe3b2('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xe3b2('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xe3b2('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xe3b2('0x3')]('twilio',_0xe3b2('0x4'))},'accountSid':{'type':Sequelize[_0xe3b2('0x2')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xe3b2('0x2')]},'notificationTemplate':{'type':Sequelize[_0xe3b2('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xe3b2('0x6')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xe3b2('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xe3b2('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe3b2('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe3b2('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe3b2('0x7')],'comment':_0xe3b2('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xe3b2('0x6')],'defaultValue':![],'comment':_0xe3b2('0x9'),'set':function(_0x5c7f12){if(!_0x5c7f12){this[_0xe3b2('0xa')](_0xe3b2('0xb'),null);}this['setDataValue'](_0xe3b2('0xc'),_0x5c7f12);}},'description':{'type':Sequelize[_0xe3b2('0x2')]}}; \ No newline at end of file +var _0xc787=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','generate','ENUM','twilio','sinch','TEXT','BOOLEAN'];(function(_0x37ef38,_0x2cfe4e){var _0x499daa=function(_0x18d0f5){while(--_0x18d0f5){_0x37ef38['push'](_0x37ef38['shift']());}};_0x499daa(++_0x2cfe4e);}(_0xc787,0x186));var _0x7c78=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0xc787[_0x9cd4c3];return _0x4c9025;};'use strict';var Sequelize=require(_0x7c78('0x0'));var rs=require('randomstring');module[_0x7c78('0x1')]={'name':{'type':Sequelize[_0x7c78('0x2')],'unique':_0x7c78('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x7c78('0x2')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x7c78('0x2')],'defaultValue':function(){return rs[_0x7c78('0x4')]();}},'phone':{'type':Sequelize[_0x7c78('0x2')]},'type':{'type':Sequelize[_0x7c78('0x5')](_0x7c78('0x6'),_0x7c78('0x7'))},'accountSid':{'type':Sequelize[_0x7c78('0x2')]},'baseUrl':{'type':Sequelize[_0x7c78('0x2')]},'authToken':{'type':Sequelize[_0x7c78('0x2')]},'notificationTemplate':{'type':Sequelize[_0x7c78('0x8')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x7c78('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x7c78('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7c78('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7c78('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7c78('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7c78('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7c78('0xa')],'comment':_0x7c78('0xb')},'mandatoryDisposition':{'type':Sequelize[_0x7c78('0x9')],'defaultValue':![],'comment':_0x7c78('0xc'),'set':function(_0x594e70){if(!_0x594e70){this[_0x7c78('0xd')](_0x7c78('0xe'),null);}this[_0x7c78('0xd')](_0x7c78('0xf'),_0x594e70);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index cf16cd0..72d3b19 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 _0x056d=['WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','send','getApplications','whatsapp','Applications','account','type','statuses','state','read','WhatsappMessage','message_id','applications','orderBy','asc','Sequelize','difference','createdAt','updatedAt','ListId','mobile','twilio','replace','whatsapp:','Body','messageId','sinch','from','notifications','isNil','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmContact','Contacts','list','contact','WhatsappInteraction','interaction','push','close','unmanaged','created','ContactId','AttachmentId','User','unshift','agent','*,*,*,*','startRouting','Start','receiveMessage','entity\x20found','stringify','Content-Type','text/xml','to\x20is\x20mandatory','CmList','List','DESC','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','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','api','../../config/utils','../../mysqldb','redis','defaults','localhost','./whatsappAccount.socket','register','jayson/promise','client','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','get','WhatsappAccounts','stack','name','index','mandatoryDispositionPause','map','WhatsappAccount','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','Pause','keys','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','UserProfileResource','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','options','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED'];(function(_0x44bd1a,_0x409a13){var _0x13f270=function(_0x20bdf4){while(--_0x20bdf4){_0x44bd1a['push'](_0x44bd1a['shift']());}};_0x13f270(++_0x409a13);}(_0x056d,0x10d));var _0xd056=function(_0x1098f3,_0x2d9803){_0x1098f3=_0x1098f3-0x0;var _0x37a3aa=_0x056d[_0x1098f3];return _0x37a3aa;};'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(_0xd056('0x7'));var util=require(_0xd056('0x8'));var path=require(_0xd056('0x9'));var sox=require(_0xd056('0xa'));var csv=require('to-csv');var ejs=require(_0xd056('0xb'));var fs=require('fs');var fs_extra=require(_0xd056('0xc'));var _=require('lodash');var squel=require(_0xd056('0xd'));var crypto=require('crypto');var jsforce=require(_0xd056('0xe'));var deskjs=require(_0xd056('0xf'));var toCsv=require(_0xd056('0x10'));var querystring=require(_0xd056('0x11'));var Papa=require(_0xd056('0x12'));var Redis=require(_0xd056('0x13'));var authService=require(_0xd056('0x14'));var qs=require(_0xd056('0x15'));var as=require(_0xd056('0x16'));var hardwareService=require(_0xd056('0x17'));var logger=require(_0xd056('0x18'))(_0xd056('0x19'));var utils=require(_0xd056('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd056('0x1b'))['db'];config[_0xd056('0x1c')]=_[_0xd056('0x1d')](config[_0xd056('0x1c')],{'host':_0xd056('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd056('0x1c')]));require(_0xd056('0x1f'))[_0xd056('0x20')](socket);var jayson=require(_0xd056('0x21'));var client=jayson[_0xd056('0x22')]['http']({'port':0x232c});function respondWithRpcPromise(_0x4378f4,_0x273b91,_0x25f811,_0x380cd6){return new BPromise(function(_0x4ae574,_0x19cfa8){var _0x40fb09=_0x380cd6||client;return _0x40fb09[_0xd056('0x23')](_0x4378f4,_0x25f811)[_0xd056('0x24')](function(_0x2e321a){logger['info'](_0xd056('0x25'),_0x273b91,_0xd056('0x26'));logger[_0xd056('0x27')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x273b91,_0xd056('0x26'),JSON['stringify'](_0x2e321a));if(_0x2e321a[_0xd056('0x28')]){if(_0x2e321a[_0xd056('0x28')][_0xd056('0x29')]===0x1f4){logger[_0xd056('0x28')](_0xd056('0x25'),_0x273b91,_0x2e321a['error'][_0xd056('0x2a')]);return _0x19cfa8(_0x2e321a['error'][_0xd056('0x2a')]);}logger[_0xd056('0x28')]('WhatsappAccount,\x20%s,\x20%s',_0x273b91,_0x2e321a['error']['message']);return _0x4ae574(_0x2e321a[_0xd056('0x28')][_0xd056('0x2a')]);}else{logger['info'](_0xd056('0x25'),_0x273b91,_0xd056('0x26'));_0x4ae574(_0x2e321a[_0xd056('0x2b')][_0xd056('0x2a')]);}})[_0xd056('0x2c')](function(_0x55b592){logger[_0xd056('0x28')]('WhatsappAccount,\x20%s,\x20%s',_0x273b91,_0x55b592);_0x19cfa8(_0x55b592);});});}function respondWithStatusCode(_0x4ee3f7,_0x297003){_0x297003=_0x297003||0xcc;return function(_0x2dc49b){if(_0x2dc49b){return _0x4ee3f7[_0xd056('0x2d')](_0x297003);}return _0x4ee3f7[_0xd056('0x2e')](_0x297003)[_0xd056('0x2f')]();};}function respondWithResult(_0x4c37b6,_0x3c62f8){_0x3c62f8=_0x3c62f8||0xc8;return function(_0x3f888b){if(_0x3f888b){return _0x4c37b6['status'](_0x3c62f8)[_0xd056('0x30')](_0x3f888b);}};}function respondWithFilteredResult(_0x5df6b1,_0x3504c1){return function(_0x306883){if(_0x306883){var _0x310c0d=typeof _0x3504c1[_0xd056('0x31')]===_0xd056('0x32')&&typeof _0x3504c1[_0xd056('0x33')]==='undefined';var _0x4f10ac=_0x306883[_0xd056('0x34')];var _0x2b4056=_0x310c0d?0x0:_0x3504c1[_0xd056('0x31')];var _0x5aa10b=_0x310c0d?_0x306883['count']:_0x3504c1['offset']+_0x3504c1[_0xd056('0x33')];var _0x425753;if(_0x5aa10b>=_0x4f10ac){_0x5aa10b=_0x4f10ac;_0x425753=0xc8;}else{_0x425753=0xce;}_0x5df6b1[_0xd056('0x2e')](_0x425753);return _0x5df6b1[_0xd056('0x35')](_0xd056('0x36'),_0x2b4056+'-'+_0x5aa10b+'/'+_0x4f10ac)[_0xd056('0x30')](_0x306883);}return null;};}function patchUpdates(_0x3100a0){return function(_0x5081e6){try{jsonpatch['apply'](_0x5081e6,_0x3100a0,!![]);}catch(_0x1adf1b){return BPromise[_0xd056('0x37')](_0x1adf1b);}return _0x5081e6[_0xd056('0x38')]();};}function saveUpdates(_0x5d16fb,_0x5dcb45){return function(_0x4823a5){if(_0x4823a5){return _0x4823a5[_0xd056('0x39')](_0x5d16fb)[_0xd056('0x24')](function(_0xf35855){return _0xf35855;});}return null;};}function removeEntity(_0x2005d7,_0x2a4a7b){return function(_0xbf3cbd){if(_0xbf3cbd){return _0xbf3cbd[_0xd056('0x3a')]()[_0xd056('0x24')](function(){var _0x13de53=_0xbf3cbd[_0xd056('0x3b')]({'plain':!![]});var _0x1e5448=_0xd056('0x3c');return db['UserProfileResource'][_0xd056('0x3a')]({'where':{'type':_0x1e5448,'resourceId':_0x13de53['id']}})['then'](function(){return _0xbf3cbd;});})[_0xd056('0x24')](function(){_0x2005d7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x365eba,_0x27527c){return function(_0x501282){if(!_0x501282){_0x365eba[_0xd056('0x2d')](0x194);}return _0x501282;};}function handleError(_0xc4c1a1,_0x4d2146){_0x4d2146=_0x4d2146||0x1f4;return function(_0x1d1595){logger[_0xd056('0x28')](_0x1d1595[_0xd056('0x3d')]);if(_0x1d1595['name']){delete _0x1d1595[_0xd056('0x3e')];}_0xc4c1a1[_0xd056('0x2e')](_0x4d2146)['send'](_0x1d1595);};}exports[_0xd056('0x3f')]=function(_0x1b9356,_0x30ae10){var _0x5b31f4={'include':[{'model':db['Pause'],'as':_0xd056('0x40')}]},_0x2414f8={},_0x542f0c={'count':0x0,'rows':[]};var _0x34d53e=_[_0xd056('0x41')](db[_0xd056('0x42')]['rawAttributes'],function(_0x2d933){return{'name':_0x2d933[_0xd056('0x43')],'type':_0x2d933['type'][_0xd056('0x44')]};});_0x2414f8[_0xd056('0x45')]=_['map'](_0x34d53e,_0xd056('0x3e'));_0x2414f8[_0xd056('0x46')]=_['keys'](_0x1b9356[_0xd056('0x46')]);_0x2414f8[_0xd056('0x47')]=_[_0xd056('0x48')](_0x2414f8[_0xd056('0x45')],_0x2414f8['query']);_0x5b31f4[_0xd056('0x49')]=_[_0xd056('0x48')](_0x2414f8[_0xd056('0x45')],qs[_0xd056('0x4a')](_0x1b9356[_0xd056('0x46')][_0xd056('0x4a')]));_0x5b31f4[_0xd056('0x49')]=_0x5b31f4[_0xd056('0x49')][_0xd056('0x4b')]?_0x5b31f4[_0xd056('0x49')]:_0x2414f8[_0xd056('0x45')];if(!_0x1b9356[_0xd056('0x46')][_0xd056('0x4c')](_0xd056('0x4d'))){_0x5b31f4[_0xd056('0x33')]=qs[_0xd056('0x33')](_0x1b9356[_0xd056('0x46')][_0xd056('0x33')]);_0x5b31f4[_0xd056('0x31')]=qs[_0xd056('0x31')](_0x1b9356[_0xd056('0x46')][_0xd056('0x31')]);}_0x5b31f4[_0xd056('0x4e')]=qs[_0xd056('0x4f')](_0x1b9356[_0xd056('0x46')][_0xd056('0x4f')]);_0x5b31f4[_0xd056('0x50')]=qs[_0xd056('0x47')](_[_0xd056('0x51')](_0x1b9356[_0xd056('0x46')],_0x2414f8[_0xd056('0x47')]),_0x34d53e);if(_0x1b9356[_0xd056('0x46')][_0xd056('0x52')]){_0x5b31f4[_0xd056('0x50')]=_[_0xd056('0x53')](_0x5b31f4[_0xd056('0x50')],{'$or':_[_0xd056('0x41')](_0x34d53e,function(_0x191a50){if(_0x191a50['type']!==_0xd056('0x54')){var _0xcbbc81={};_0xcbbc81[_0x191a50['name']]={'$like':'%'+_0x1b9356['query']['filter']+'%'};return _0xcbbc81;}})});}_0x5b31f4=_[_0xd056('0x53')]({},_0x5b31f4,_0x1b9356['options']);var _0x54af8a={'where':_0x5b31f4[_0xd056('0x50')]};return db['WhatsappAccount'][_0xd056('0x34')](_0x54af8a)[_0xd056('0x24')](function(_0x110e69){_0x542f0c['count']=_0x110e69;if(_0x1b9356[_0xd056('0x46')][_0xd056('0x55')]){_0x5b31f4[_0xd056('0x56')]=[{'all':!![]}];}return db[_0xd056('0x42')][_0xd056('0x57')](_0x5b31f4);})[_0xd056('0x24')](function(_0x1b9bba){_0x542f0c[_0xd056('0x58')]=_0x1b9bba;return _0x542f0c;})[_0xd056('0x24')](respondWithFilteredResult(_0x30ae10,_0x5b31f4))['catch'](handleError(_0x30ae10,null));};exports[_0xd056('0x59')]=function(_0x5c8e30,_0x725e00){var _0x46e67a={'raw':![],'where':{'id':_0x5c8e30[_0xd056('0x5a')]['id']},'include':[{'model':db[_0xd056('0x5b')],'as':_0xd056('0x40')}]},_0x5f567b={};_0x5f567b[_0xd056('0x45')]=_[_0xd056('0x5c')](db[_0xd056('0x42')][_0xd056('0x5d')]);_0x5f567b[_0xd056('0x46')]=_['keys'](_0x5c8e30['query']);_0x5f567b[_0xd056('0x47')]=_[_0xd056('0x48')](_0x5f567b['model'],_0x5f567b['query']);_0x46e67a[_0xd056('0x49')]=_[_0xd056('0x48')](_0x5f567b[_0xd056('0x45')],qs['fields'](_0x5c8e30[_0xd056('0x46')][_0xd056('0x4a')]));_0x46e67a[_0xd056('0x49')]=_0x46e67a[_0xd056('0x49')][_0xd056('0x4b')]?_0x46e67a[_0xd056('0x49')]:_0x5f567b[_0xd056('0x45')];if(_0x5c8e30[_0xd056('0x46')][_0xd056('0x55')]){_0x46e67a[_0xd056('0x56')]=[{'all':!![]}];}_0x46e67a=_[_0xd056('0x53')]({},_0x46e67a,_0x5c8e30['options']);return db[_0xd056('0x42')][_0xd056('0x5e')](_0x46e67a)[_0xd056('0x24')](handleEntityNotFound(_0x725e00,null))[_0xd056('0x24')](respondWithResult(_0x725e00,null))[_0xd056('0x2c')](handleError(_0x725e00,null));};exports[_0xd056('0x5f')]=function(_0x3e0245,_0x60b07d){return db[_0xd056('0x42')][_0xd056('0x5f')](_0x3e0245[_0xd056('0x60')],{})['then'](function(_0x411bd2){var _0x4eaa96=_0x3e0245['user']['get']({'plain':!![]});if(!_0x4eaa96)throw new Error(_0xd056('0x61'));if(_0x4eaa96[_0xd056('0x62')]===_0xd056('0x63')){var _0x2a6fb3=_0x411bd2['get']({'plain':!![]});var _0x43b9bd=_0xd056('0x3c');return db['UserProfileSection'][_0xd056('0x5e')]({'where':{'name':_0x43b9bd,'userProfileId':_0x4eaa96[_0xd056('0x64')]},'raw':!![]})[_0xd056('0x24')](function(_0x54fc74){if(_0x54fc74&&_0x54fc74[_0xd056('0x65')]===0x0){return db[_0xd056('0x66')][_0xd056('0x5f')]({'name':_0x2a6fb3['name'],'resourceId':_0x2a6fb3['id'],'type':_0x54fc74[_0xd056('0x3e')],'sectionId':_0x54fc74['id']},{})[_0xd056('0x24')](function(){return _0x411bd2;});}else{return _0x411bd2;}})[_0xd056('0x2c')](function(_0x26c655){logger[_0xd056('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x26c655);throw _0x26c655;});}return _0x411bd2;})['then'](respondWithResult(_0x60b07d,0xc9))['catch'](handleError(_0x60b07d,null));};exports[_0xd056('0x39')]=function(_0x38aa58,_0x5af8d1){if(_0x38aa58[_0xd056('0x60')]['id']){delete _0x38aa58[_0xd056('0x60')]['id'];}return db[_0xd056('0x42')][_0xd056('0x5e')]({'where':{'id':_0x38aa58[_0xd056('0x5a')]['id']},'include':[{'model':db[_0xd056('0x5b')],'as':_0xd056('0x40')}]})[_0xd056('0x24')](handleEntityNotFound(_0x5af8d1,null))[_0xd056('0x24')](saveUpdates(_0x38aa58['body'],null))[_0xd056('0x24')](respondWithResult(_0x5af8d1,null))[_0xd056('0x2c')](handleError(_0x5af8d1,null));};exports[_0xd056('0x3a')]=function(_0x30a699,_0x2dab1b){return db['WhatsappAccount'][_0xd056('0x5e')]({'where':{'id':_0x30a699['params']['id']}})[_0xd056('0x24')](handleEntityNotFound(_0x2dab1b,null))[_0xd056('0x24')](removeEntity(_0x2dab1b,null))['catch'](handleError(_0x2dab1b,null));};exports[_0xd056('0x67')]=function(_0x1ecfdf,_0x3116a4){return db[_0xd056('0x42')][_0xd056('0x67')]()[_0xd056('0x24')](respondWithResult(_0x3116a4,null))['catch'](handleError(_0x3116a4,null));};exports[_0xd056('0x68')]=function(_0x20bdd3,_0x32aef2,_0x3da393){if(_0x20bdd3[_0xd056('0x60')]['id']){delete _0x20bdd3[_0xd056('0x60')]['id'];}return db[_0xd056('0x42')]['find']({'where':{'id':_0x20bdd3[_0xd056('0x5a')]['id']}})['then'](handleEntityNotFound(_0x32aef2,null))[_0xd056('0x24')](function(_0x31b116){if(_0x31b116){_0x20bdd3[_0xd056('0x60')][_0xd056('0x69')]=_0x31b116['id'];return db[_0xd056('0x6a')][_0xd056('0x5f')](_0x20bdd3[_0xd056('0x60')]);}})[_0xd056('0x24')](respondWithResult(_0x32aef2,null))['catch'](handleError(_0x32aef2,null));};exports[_0xd056('0x6b')]=function(_0x27333e,_0x5c3f15,_0x204f8d){var _0x3e0156={'raw':![],'where':{}};var _0x4f6447={};var _0x166653={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0xd056('0x6c')]({'where':{'id':_0x27333e[_0xd056('0x5a')]['id']}})['then'](handleEntityNotFound(_0x5c3f15,null))['then'](function(_0x3e547c){if(_0x3e547c){_0x4f6447[_0xd056('0x45')]=_[_0xd056('0x5c')](db[_0xd056('0x6a')][_0xd056('0x5d')]);_0x4f6447[_0xd056('0x46')]=_[_0xd056('0x5c')](_0x27333e[_0xd056('0x46')]);_0x4f6447['filters']=_[_0xd056('0x48')](_0x4f6447[_0xd056('0x45')],_0x4f6447['query']);_0x3e0156['attributes']=_[_0xd056('0x48')](_0x4f6447[_0xd056('0x45')],qs[_0xd056('0x4a')](_0x27333e[_0xd056('0x46')][_0xd056('0x4a')]));_0x3e0156[_0xd056('0x49')]=_0x3e0156[_0xd056('0x49')][_0xd056('0x4b')]?_0x3e0156[_0xd056('0x49')]:_0x4f6447['model'];if(!_0x27333e['query'][_0xd056('0x4c')](_0xd056('0x4d'))){_0x3e0156[_0xd056('0x33')]=qs[_0xd056('0x33')](_0x27333e[_0xd056('0x46')][_0xd056('0x33')]);_0x3e0156[_0xd056('0x31')]=qs[_0xd056('0x31')](_0x27333e[_0xd056('0x46')][_0xd056('0x31')]);}_0x3e0156[_0xd056('0x4e')]=qs[_0xd056('0x4f')](_0x27333e[_0xd056('0x46')]['sort']);_0x3e0156['where']=qs['filters'](_[_0xd056('0x51')](_0x27333e[_0xd056('0x46')],_0x4f6447[_0xd056('0x47')]));_0x3e0156[_0xd056('0x50')][_0xd056('0x69')]=_0x3e547c['id'];if(_0x27333e[_0xd056('0x46')][_0xd056('0x52')]){_0x3e0156[_0xd056('0x50')]=_[_0xd056('0x53')](_0x3e0156[_0xd056('0x50')],{'$or':_['map'](_0x3e0156[_0xd056('0x49')],function(_0x1f50da){var _0x4300fe={};_0x4300fe[_0x1f50da]={'$like':'%'+_0x27333e['query'][_0xd056('0x52')]+'%'};return _0x4300fe;})});}_0x3e0156=_[_0xd056('0x53')]({},_0x3e0156,_0x27333e[_0xd056('0x6d')]);return db[_0xd056('0x6a')]['count']({'where':_0x3e0156[_0xd056('0x50')]})[_0xd056('0x24')](function(_0x124058){_0x166653[_0xd056('0x34')]=_0x124058;if(_0x27333e['query'][_0xd056('0x55')]){_0x3e0156['include']=[{'all':!![]}];}return db['Disposition'][_0xd056('0x57')](_0x3e0156);})[_0xd056('0x24')](function(_0x549365){_0x166653[_0xd056('0x58')]=_0x549365;return _0x166653;});}})['then'](respondWithFilteredResult(_0x5c3f15,_0x3e0156))['catch'](handleError(_0x5c3f15,null));};exports[_0xd056('0x6e')]=function(_0x226719,_0x397d7d,_0x6590b2){return db[_0xd056('0x42')][_0xd056('0x5e')]({'where':{'id':_0x226719[_0xd056('0x5a')]['id']}})[_0xd056('0x24')](handleEntityNotFound(_0x397d7d,null))['then'](function(_0x306bbd){if(_0x306bbd){return _0x306bbd[_0xd056('0x6e')](_0x226719[_0xd056('0x46')][_0xd056('0x6f')]);}})[_0xd056('0x24')](respondWithStatusCode(_0x397d7d,null))[_0xd056('0x2c')](handleError(_0x397d7d,null));};exports[_0xd056('0x70')]=function(_0x3fdd01,_0x336817,_0x23279a){if(_0x3fdd01[_0xd056('0x60')]['id']){delete _0x3fdd01[_0xd056('0x60')]['id'];}return db[_0xd056('0x42')][_0xd056('0x5e')]({'where':{'id':_0x3fdd01['params']['id']}})[_0xd056('0x24')](handleEntityNotFound(_0x336817,null))[_0xd056('0x24')](function(_0x28151d){if(_0x28151d){_0x3fdd01['body'][_0xd056('0x69')]=_0x28151d['id'];return db[_0xd056('0x71')][_0xd056('0x5f')](_0x3fdd01['body']);}})['then'](respondWithResult(_0x336817,null))['catch'](handleError(_0x336817,null));};exports[_0xd056('0x72')]=function(_0x2e86d9,_0x3bfc39,_0x3fbc5c){var _0x2db347={'raw':![],'where':{}};var _0x28e5b8={};var _0x4a32cc={'count':0x0,'rows':[]};return db[_0xd056('0x42')]['findOne']({'where':{'id':_0x2e86d9[_0xd056('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3bfc39,null))[_0xd056('0x24')](function(_0x284849){if(_0x284849){_0x28e5b8[_0xd056('0x45')]=_['keys'](db[_0xd056('0x71')]['rawAttributes']);_0x28e5b8[_0xd056('0x46')]=_[_0xd056('0x5c')](_0x2e86d9[_0xd056('0x46')]);_0x28e5b8['filters']=_[_0xd056('0x48')](_0x28e5b8[_0xd056('0x45')],_0x28e5b8[_0xd056('0x46')]);_0x2db347['attributes']=_[_0xd056('0x48')](_0x28e5b8[_0xd056('0x45')],qs[_0xd056('0x4a')](_0x2e86d9[_0xd056('0x46')][_0xd056('0x4a')]));_0x2db347[_0xd056('0x49')]=_0x2db347[_0xd056('0x49')][_0xd056('0x4b')]?_0x2db347[_0xd056('0x49')]:_0x28e5b8[_0xd056('0x45')];if(!_0x2e86d9[_0xd056('0x46')][_0xd056('0x4c')](_0xd056('0x4d'))){_0x2db347[_0xd056('0x33')]=qs[_0xd056('0x33')](_0x2e86d9[_0xd056('0x46')][_0xd056('0x33')]);_0x2db347[_0xd056('0x31')]=qs['offset'](_0x2e86d9[_0xd056('0x46')][_0xd056('0x31')]);}_0x2db347['order']=qs[_0xd056('0x4f')](_0x2e86d9['query'][_0xd056('0x4f')]);_0x2db347['where']=qs[_0xd056('0x47')](_[_0xd056('0x51')](_0x2e86d9[_0xd056('0x46')],_0x28e5b8[_0xd056('0x47')]));_0x2db347[_0xd056('0x50')][_0xd056('0x69')]=_0x284849['id'];if(_0x2e86d9[_0xd056('0x46')][_0xd056('0x52')]){_0x2db347[_0xd056('0x50')]=_[_0xd056('0x53')](_0x2db347['where'],{'$or':_[_0xd056('0x41')](_0x2db347[_0xd056('0x49')],function(_0x1988bd){var _0x18e1f6={};_0x18e1f6[_0x1988bd]={'$like':'%'+_0x2e86d9['query'][_0xd056('0x52')]+'%'};return _0x18e1f6;})});}_0x2db347=_[_0xd056('0x53')]({},_0x2db347,_0x2e86d9[_0xd056('0x6d')]);return db[_0xd056('0x71')][_0xd056('0x34')]({'where':_0x2db347[_0xd056('0x50')]})[_0xd056('0x24')](function(_0x35dcd1){_0x4a32cc[_0xd056('0x34')]=_0x35dcd1;if(_0x2e86d9['query'][_0xd056('0x55')]){_0x2db347[_0xd056('0x56')]=[{'all':!![]}];}return db['CannedAnswer'][_0xd056('0x57')](_0x2db347);})[_0xd056('0x24')](function(_0x300685){_0x4a32cc[_0xd056('0x58')]=_0x300685;return _0x4a32cc;});}})[_0xd056('0x24')](respondWithFilteredResult(_0x3bfc39,_0x2db347))[_0xd056('0x2c')](handleError(_0x3bfc39,null));};exports[_0xd056('0x73')]=function(_0x36242d,_0x57d791,_0x3cfd5b){return db[_0xd056('0x42')][_0xd056('0x5e')]({'where':{'id':_0x36242d[_0xd056('0x5a')]['id']}})[_0xd056('0x24')](handleEntityNotFound(_0x57d791,null))[_0xd056('0x24')](function(_0x2080e1){if(_0x2080e1){return _0x2080e1[_0xd056('0x73')](_0x36242d[_0xd056('0x46')][_0xd056('0x6f')]);}})['then'](respondWithStatusCode(_0x57d791,null))['catch'](handleError(_0x57d791,null));};exports[_0xd056('0x74')]=function(_0x4d82e1,_0x255518,_0x134e17){return db['WhatsappAccount']['find']({'where':{'id':_0x4d82e1[_0xd056('0x5a')]['id']}})[_0xd056('0x24')](handleEntityNotFound(_0x255518,null))['then'](function(_0x987e0c){if(_0x987e0c){return _0x987e0c[_0xd056('0x74')](_0x4d82e1[_0xd056('0x60')][_0xd056('0x6f')],_[_0xd056('0x75')](_0x4d82e1[_0xd056('0x60')],[_0xd056('0x6f'),'id'])||{})[_0xd056('0x76')](function(_0x5aa70a){for(var _0x20f444=0x0;_0x20f444<_0x4d82e1[_0xd056('0x60')][_0xd056('0x6f')][_0xd056('0x4b')];_0x20f444+=0x1){socket[_0xd056('0x77')](_0xd056('0x78'),{'UserId':Number(_0x4d82e1[_0xd056('0x60')][_0xd056('0x6f')][_0x20f444]),'WhatsappAccountId':Number(_0x4d82e1[_0xd056('0x5a')]['id'])});}return _0x5aa70a;});}})[_0xd056('0x24')](respondWithResult(_0x255518,null))[_0xd056('0x2c')](handleError(_0x255518,null));};exports[_0xd056('0x79')]=function(_0x579da3,_0x5a3e60,_0x188558){return db[_0xd056('0x42')][_0xd056('0x5e')]({'where':{'id':_0x579da3['params']['id']}})[_0xd056('0x24')](handleEntityNotFound(_0x5a3e60,null))[_0xd056('0x24')](function(_0x368c27){if(_0x368c27){return _0x368c27['removeAgents'](_0x579da3['query'][_0xd056('0x6f')])[_0xd056('0x24')](function(){if(_[_0xd056('0x7a')](_0x579da3[_0xd056('0x46')][_0xd056('0x6f')])){for(var _0x236707=0x0;_0x236707<_0x579da3[_0xd056('0x46')]['ids']['length'];_0x236707+=0x1){socket[_0xd056('0x77')](_0xd056('0x7b'),{'UserId':Number(_0x579da3[_0xd056('0x46')][_0xd056('0x6f')][_0x236707]),'WhatsappAccountId':Number(_0x579da3[_0xd056('0x5a')]['id'])});}}else{socket[_0xd056('0x77')](_0xd056('0x7b'),{'UserId':Number(_0x579da3[_0xd056('0x46')]['ids']),'WhatsappAccountId':Number(_0x579da3[_0xd056('0x5a')]['id'])});}});}})[_0xd056('0x24')](respondWithStatusCode(_0x5a3e60,null))[_0xd056('0x2c')](handleError(_0x5a3e60,null));};exports[_0xd056('0x7c')]=function(_0x166a22,_0x17ac9f,_0x4ec285){var _0x215609={};var _0x35f1e4={};var _0x269afe;var _0x4f0aca;return db['WhatsappAccount'][_0xd056('0x6c')]({'where':{'id':_0x166a22[_0xd056('0x5a')]['id']}})[_0xd056('0x24')](handleEntityNotFound(_0x17ac9f,null))[_0xd056('0x24')](function(_0x5010a7){if(_0x5010a7){_0x269afe=_0x5010a7;_0x35f1e4[_0xd056('0x45')]=_['keys'](db['User'][_0xd056('0x5d')]);_0x35f1e4[_0xd056('0x46')]=_['keys'](_0x166a22[_0xd056('0x46')]);_0x35f1e4[_0xd056('0x47')]=_[_0xd056('0x48')](_0x35f1e4[_0xd056('0x45')],_0x35f1e4['query']);_0x215609[_0xd056('0x49')]=_['intersection'](_0x35f1e4[_0xd056('0x45')],qs['fields'](_0x166a22['query'][_0xd056('0x4a')]));_0x215609[_0xd056('0x49')]=_0x215609[_0xd056('0x49')]['length']?_0x215609[_0xd056('0x49')]:_0x35f1e4[_0xd056('0x45')];_0x215609[_0xd056('0x4e')]=qs[_0xd056('0x4f')](_0x166a22[_0xd056('0x46')][_0xd056('0x4f')]);_0x215609[_0xd056('0x50')]=qs['filters'](_['pick'](_0x166a22['query'],_0x35f1e4['filters']));if(_0x166a22[_0xd056('0x46')]['filter']){_0x215609['where']=_['merge'](_0x215609[_0xd056('0x50')],{'$or':_[_0xd056('0x41')](_0x215609['attributes'],function(_0x4b1146){var _0x18c414={};_0x18c414[_0x4b1146]={'$like':'%'+_0x166a22['query'][_0xd056('0x52')]+'%'};return _0x18c414;})});}_0x215609=_['merge']({},_0x215609,_0x166a22[_0xd056('0x6d')]);return _0x269afe[_0xd056('0x7c')](_0x215609);}})['then'](function(_0x438ac1){if(_0x438ac1){_0x4f0aca=_0x438ac1[_0xd056('0x4b')];if(!_0x166a22[_0xd056('0x46')][_0xd056('0x4c')]('nolimit')){_0x215609[_0xd056('0x33')]=qs['limit'](_0x166a22[_0xd056('0x46')]['limit']);_0x215609[_0xd056('0x31')]=qs[_0xd056('0x31')](_0x166a22['query'][_0xd056('0x31')]);}return _0x269afe['getAgents'](_0x215609);}})[_0xd056('0x24')](function(_0x1c5497){if(_0x1c5497){return _0x1c5497?{'count':_0x4f0aca,'rows':_0x1c5497}:null;}})[_0xd056('0x24')](respondWithResult(_0x17ac9f,null))[_0xd056('0x2c')](handleError(_0x17ac9f,null));};exports[_0xd056('0x7d')]=function(_0x72279,_0x2d4101){var _0x5a789a=_0x72279['params']['id'];var _0x1ebc5b=_0x72279['body'];var _0x1ae1a3=0xc8;var _0x15a79f=null;return db[_0xd056('0x7e')][_0xd056('0x7f')]({'isolationLevel':db['sequelize'][_0xd056('0x80')][_0xd056('0x81')][_0xd056('0x82')]},function(_0x528631){return db[_0xd056('0x42')]['findOne']({'where':{'id':_0x5a789a},'transaction':_0x528631})[_0xd056('0x24')](function(_0x28bffd){if(_0x28bffd){return db['WhatsappApplication'][_0xd056('0x3a')]({'where':{'WhatsappAccountId':_0x5a789a},'transaction':_0x528631})['then'](function(){var _0x5fa5ad=_['map'](_0x1ebc5b,function(_0x1b050a){_0x1b050a['WhatsappAccountId']=_0x5a789a;return _0x1b050a;});return db[_0xd056('0x83')][_0xd056('0x84')](_0x5fa5ad,{'transaction':_0x528631});});}else{_0x1ae1a3=0x194;_0x15a79f=[];}});})[_0xd056('0x24')](function(){if(_0x1ae1a3!==0x194){return db['WhatsappApplication'][_0xd056('0x85')]({'where':{'WhatsappAccountId':_0x5a789a},'order':_0xd056('0x86')})[_0xd056('0x24')](function(_0x46ec6f){_0x15a79f=_0x46ec6f;});}})[_0xd056('0x2c')](function(_0x4cd743){_0x1ae1a3=0x1f4;logger[_0xd056('0x28')](_0x4cd743[_0xd056('0x3d')]);if(_0x4cd743[_0xd056('0x3e')]){delete _0x4cd743[_0xd056('0x3e')];}_0x15a79f=_0x4cd743;})[_0xd056('0x87')](function(){if(_0x15a79f===null){_0x2d4101[_0xd056('0x2d')](_0x1ae1a3);}else{if(_0x1ae1a3===0x1f4){_0x2d4101['status'](_0x1ae1a3)[_0xd056('0x88')](_0x15a79f);}else{_0x2d4101['status'](_0x1ae1a3)[_0xd056('0x30')](_0x15a79f);}}});};exports[_0xd056('0x89')]=function(_0x2ff9da,_0x1c6d78,_0x2aad51){var _0x204c3c={};var _0x745ecc={};var _0x5d8941;var _0x5a40a8;return db[_0xd056('0x42')]['findOne']({'where':{'id':_0x2ff9da[_0xd056('0x5a')]['id']}})[_0xd056('0x24')](handleEntityNotFound(_0x1c6d78,null))['then'](function(_0x798986){if(_0x798986){_0x5d8941=_0x798986;_0x745ecc[_0xd056('0x45')]=_[_0xd056('0x5c')](db[_0xd056('0x83')][_0xd056('0x5d')]);_0x745ecc[_0xd056('0x46')]=_[_0xd056('0x5c')](_0x2ff9da['query']);_0x745ecc['filters']=_[_0xd056('0x48')](_0x745ecc['model'],_0x745ecc[_0xd056('0x46')]);_0x204c3c[_0xd056('0x49')]=_['intersection'](_0x745ecc[_0xd056('0x45')],qs[_0xd056('0x4a')](_0x2ff9da[_0xd056('0x46')][_0xd056('0x4a')]));_0x204c3c['attributes']=_0x204c3c[_0xd056('0x49')][_0xd056('0x4b')]?_0x204c3c['attributes']:_0x745ecc[_0xd056('0x45')];_0x204c3c['order']=qs[_0xd056('0x4f')](_0x2ff9da[_0xd056('0x46')][_0xd056('0x4f')]);_0x204c3c[_0xd056('0x50')]=qs['filters'](_[_0xd056('0x51')](_0x2ff9da[_0xd056('0x46')],_0x745ecc[_0xd056('0x47')]));if(_0x2ff9da[_0xd056('0x46')][_0xd056('0x52')]){_0x204c3c[_0xd056('0x50')]=_[_0xd056('0x53')](_0x204c3c[_0xd056('0x50')],{'$or':_['map'](_0x204c3c['attributes'],function(_0x472204){var _0x467fef={};_0x467fef[_0x472204]={'$like':'%'+_0x2ff9da[_0xd056('0x46')][_0xd056('0x52')]+'%'};return _0x467fef;})});}_0x204c3c=_[_0xd056('0x53')]({},_0x204c3c,_0x2ff9da[_0xd056('0x6d')]);return _0x5d8941[_0xd056('0x89')](_0x204c3c);}})[_0xd056('0x24')](function(_0x243a21){if(_0x243a21){_0x5a40a8=_0x243a21[_0xd056('0x4b')];if(!_0x2ff9da[_0xd056('0x46')][_0xd056('0x4c')](_0xd056('0x4d'))){_0x204c3c[_0xd056('0x33')]=qs[_0xd056('0x33')](_0x2ff9da[_0xd056('0x46')][_0xd056('0x33')]);_0x204c3c[_0xd056('0x31')]=qs[_0xd056('0x31')](_0x2ff9da[_0xd056('0x46')][_0xd056('0x31')]);}return _0x5d8941[_0xd056('0x89')](_0x204c3c);}})[_0xd056('0x24')](function(_0x3c14d5){if(_0x3c14d5){return _0x3c14d5?{'count':_0x5a40a8,'rows':_0x3c14d5}:null;}})[_0xd056('0x24')](respondWithResult(_0x1c6d78,null))[_0xd056('0x2c')](handleError(_0x1c6d78,null));};exports['notify']=function(_0xc550b7,_0x883f54,_0x2c464d){var _0x2063c2={'channel':_0xd056('0x8a')};var _0x3da695=[];var _0x9e5fbd=[];var _0x17ea4a={};return db[_0xd056('0x42')][_0xd056('0x5e')]({'where':{'id':_0xc550b7[_0xd056('0x5a')]['id']},'include':[{'model':db[_0xd056('0x83')],'as':_0xd056('0x8b')}]})[_0xd056('0x24')](handleEntityNotFound(_0x883f54,null))[_0xd056('0x24')](function(_0x19544){_0x2063c2['account']=_0x19544;if(_0x2063c2[_0xd056('0x8c')]&&_0x2063c2[_0xd056('0x8c')][_0xd056('0x8d')]==='sinch'&&_0xc550b7[_0xd056('0x60')][_0xd056('0x8e')]){if(_0xc550b7['body'][_0xd056('0x8e')][_0xd056('0x4b')]===0x0)return;if(_0xc550b7[_0xd056('0x60')]['statuses'][0x0][_0xd056('0x8f')]!==_0xd056('0x90'))return;return db[_0xd056('0x91')][_0xd056('0x39')]({'read':!![],'readAt':_0xc550b7[_0xd056('0x60')][_0xd056('0x8e')][0x0]['timestamp']},{'where':{'messageId':_0xc550b7['body'][_0xd056('0x8e')][0x0][_0xd056('0x92')]},'individualHooks':!![]})[_0xd056('0x24')](function(_0x4854ed){return _0x883f54[_0xd056('0x2e')](0xc8)[_0xd056('0x30')](_0x4854ed);});}_0x2063c2[_0xd056('0x93')]=_[_0xd056('0x94')](_0x19544[_0xd056('0x8b')],[_0xd056('0x86')],[_0xd056('0x95')]);if(_0x2063c2[_0xd056('0x8c')][_0xd056('0x8b')]){delete _0x2063c2[_0xd056('0x8c')][_0xd056('0x8b')];}return db['CmContact'][_0xd056('0x67')]()['then'](function(_0x10091a){if(!_0x10091a){throw new db[(_0xd056('0x96'))]['ValidationError']('no\x20available\x20attributes');}_0x3da695=_[_0xd056('0x97')](_[_0xd056('0x5c')](_0x10091a),[_0xd056('0x98'),_0xd056('0x99')]);_0x9e5fbd=_[_0xd056('0x97')](_[_0xd056('0x5c')](_0x10091a),[_0xd056('0x98'),_0xd056('0x99'),'CompanyId',_0xd056('0x9a')]);_0x2063c2[_0xd056('0x60')]={'mapKey':_0xd056('0x9b')};if(_0x2063c2['account']&&_0x2063c2[_0xd056('0x8c')][_0xd056('0x8d')]===_0xd056('0x9c')){_0x2063c2[_0xd056('0x60')]['from']=_0xc550b7[_0xd056('0x60')]['From'][_0xd056('0x9d')](_0xd056('0x9e'),'');_0x2063c2[_0xd056('0x60')][_0xd056('0x60')]=_0xc550b7[_0xd056('0x60')][_0xd056('0x9f')];_0x2063c2[_0xd056('0x60')][_0xd056('0xa0')]=_0xc550b7[_0xd056('0x60')]['MessageSid'];}if(_0x2063c2[_0xd056('0x8c')]&&_0x2063c2[_0xd056('0x8c')]['type']===_0xd056('0xa1')){_0x2063c2['body'][_0xd056('0xa2')]=_0xc550b7[_0xd056('0x60')][_0xd056('0xa3')][0x0]['from'];_0x2063c2[_0xd056('0x60')]['body']=_0xc550b7[_0xd056('0x60')][_0xd056('0xa3')][0x0][_0xd056('0x2a')]['body'];_0x2063c2[_0xd056('0x60')]['messageId']=_0xc550b7[_0xd056('0x60')][_0xd056('0xa3')][0x0][_0xd056('0x92')];}if(_0x2063c2[_0xd056('0x60')]['id']){delete _0x2063c2['body']['id'];}if(_[_0xd056('0xa4')](_0x2063c2[_0xd056('0x60')]['from'])){throw new db['Sequelize'][(_0xd056('0xa5'))](_0xd056('0xa6'));}if(_['isNil'](_0x2063c2['body'][_0xd056('0x60')])||_0x2063c2[_0xd056('0x60')][_0xd056('0x60')]===''){throw new db['Sequelize'][(_0xd056('0xa5'))](_0xd056('0xa7'));}if(_[_0xd056('0xa4')](_0x2063c2[_0xd056('0x60')][_0xd056('0xa8')])){throw new db['Sequelize'][(_0xd056('0xa5'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x9e5fbd);}if(!_['includes'](_0x9e5fbd,_0x2063c2[_0xd056('0x60')][_0xd056('0xa8')])){throw new db[(_0xd056('0x96'))][(_0xd056('0xa5'))](_0xd056('0xa9')+_0x9e5fbd);}_0x17ea4a[_0x2063c2[_0xd056('0x60')][_0xd056('0xa8')]]=_0x2063c2[_0xd056('0x60')]['from'];return db['CmList'][_0xd056('0x5e')]({'where':{'id':_0x2063c2[_0xd056('0x8c')]['ListId']},'include':[{'model':db[_0xd056('0xaa')],'as':_0xd056('0xab'),'where':_0x17ea4a,'limit':0x1,'order':[[_0xd056('0x99'),'DESC']]}]});})[_0xd056('0x24')](handleEntityNotFound(_0x883f54,null))[_0xd056('0x24')](function(_0x5f3864){if(_0x5f3864){_0x2063c2[_0xd056('0xac')]=_[_0xd056('0x75')](_0x5f3864,[_0xd056('0xab')]);if(_0x5f3864[_0xd056('0xab')][_0xd056('0x4b')]){return _0x5f3864[_0xd056('0xab')][0x0];}var _0x23a307=_[_0xd056('0x1d')](_0x2063c2[_0xd056('0x60')],{'firstName':_0x2063c2[_0xd056('0x60')][_0xd056('0xa2')],'ListId':_0x5f3864['id']});_0x23a307[_0x2063c2[_0xd056('0x60')][_0xd056('0xa8')]]=_0x2063c2[_0xd056('0x60')]['from'];return db[_0xd056('0xaa')][_0xd056('0x5f')](_0x23a307,{'fields':_0x3da695,'raw':!![]});}})[_0xd056('0x24')](handleEntityNotFound(_0x883f54,null))[_0xd056('0x24')](function(_0x5d00c4){if(_0x5d00c4){_0x2063c2[_0xd056('0xad')]=_0x5d00c4;var _0x3ff8cc={'ContactId':_0x5d00c4['id'],'phone':_0x2063c2[_0xd056('0x60')]['from'],'WhatsappAccountId':_0xc550b7[_0xd056('0x5a')]['id']};var _0x526ed4={'ContactId':_0x5d00c4['id'],'WhatsappAccountId':_0xc550b7[_0xd056('0x5a')]['id'],'closed':![]};return db[_0xd056('0xae')][_0xd056('0x5e')]({'where':_0x526ed4})[_0xd056('0x24')](function(_0x155f67){if(_0x155f67){return[_0x155f67,![]];}return db[_0xd056('0xae')][_0xd056('0x5f')](_0x3ff8cc)[_0xd056('0x24')](function(_0x101731){return[_0x101731,!![]];});});}})[_0xd056('0x76')](function(_0x491c4a,_0x245c15){_0x2063c2[_0xd056('0xaf')]=_0x491c4a['get']({'plain':!![]});_0x2063c2[_0xd056('0xaf')]['created']=![];if(_0x245c15){if(_0x2063c2['account']['autoclose']){_0x2063c2['applications'][_0xd056('0xb0')]({'id':0x0,'priority':_0x2063c2['applications']['length']+0x1,'app':_0xd056('0xb1'),'appdata':_0xd056('0xb2'),'interval':'*,*,*,*'});}_0x2063c2[_0xd056('0xaf')][_0xd056('0xb3')]=!![];}return db[_0xd056('0x91')]['create']({'phone':_0x2063c2[_0xd056('0x60')][_0xd056('0xa2')],'messageId':_0x2063c2[_0xd056('0x60')]['messageId'],'body':_0x2063c2['body'][_0xd056('0x60')],'WhatsappAccountId':_0xc550b7['params']['id'],'WhatsappInteractionId':_0x491c4a['id'],'direction':'in','ContactId':_0x491c4a[_0xd056('0xb4')],'AttachmentId':_0x2063c2[_0xd056('0x60')][_0xd056('0xb5')]});})[_0xd056('0x24')](function(_0x34c8dd){_0x2063c2[_0xd056('0x2a')]=_0x34c8dd;if(_0x2063c2['interaction']['UserId']){return db[_0xd056('0xb6')][_0xd056('0x5e')]({'attributes':['id',_0xd056('0x3e')],'where':{'id':_0x2063c2[_0xd056('0xaf')]['UserId']}})['then'](function(_0xb553b3){if(_0xb553b3){_0x2063c2[_0xd056('0x93')][_0xd056('0xb7')]({'id':0x0,'priority':0x0,'app':_0xd056('0xb8'),'appdata':_0xb553b3[_0xd056('0x3e')]+','+(_0x2063c2[_0xd056('0x8c')]['waitForTheAssignedAgent']||0xa),'interval':_0xd056('0xb9')});}return respondWithRpcPromise('Start',_0xd056('0xba'),_0x2063c2);});}return respondWithRpcPromise(_0xd056('0xbb'),'startRouting',_0x2063c2);})['then'](function(_0x5176cc){if(_0x5176cc){var _0xbc644d=0xc8;var _0x283372=_0xd056('0xbc');logger['info']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x283372,_0xbc644d,_0xd056('0xbd'));logger[_0xd056('0x27')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x283372,_0xbc644d,_0xd056('0xbd'),JSON[_0xd056('0xbe')](_0x5176cc));if(_0x2063c2[_0xd056('0x8c')]['type']===_0xd056('0x9c')){return _0x883f54[_0xd056('0x2e')](_0xbc644d)[_0xd056('0x35')](_0xd056('0xbf'),_0xd056('0xc0'))['send']('\x0a');}else{return _0x883f54['status'](_0xbc644d)['json'](_0x5176cc);}}});})[_0xd056('0x2c')](handleError(_0x883f54,null));};exports[_0xd056('0x88')]=function(_0x2c7647,_0x554afd,_0x130d2f){var _0x5bdbee,_0x3ed3e4,_0x3cb0b3;if(_[_0xd056('0xa4')](_0x2c7647[_0xd056('0x60')]['body'])||_0x2c7647[_0xd056('0x60')][_0xd056('0x60')]===''){throw new db[(_0xd056('0x96'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xd056('0xa4')](_0x2c7647[_0xd056('0x60')]['to'])){throw new db['Sequelize']['ValidationError'](_0xd056('0xc1'));}_0x5bdbee=_0x2c7647[_0xd056('0x60')]['to'];return db[_0xd056('0x42')][_0xd056('0x5e')]({'where':{'id':_0x2c7647[_0xd056('0x5a')]['id']},'include':[{'model':db[_0xd056('0xc2')],'as':_0xd056('0xc3'),'include':[{'model':db[_0xd056('0xaa')],'as':_0xd056('0xab'),'where':{'mobile':_0x5bdbee},'limit':0x1,'order':[['updatedAt',_0xd056('0xc4')]]}]}]})[_0xd056('0x24')](handleEntityNotFound(_0x554afd,null))[_0xd056('0x24')](function(_0x3c8723){if(_0x3c8723&&_0x3c8723[_0xd056('0xc3')]){_0x3ed3e4=_0x3c8723[_0xd056('0x3b')]({'plain':!![]});if(_0x3ed3e4[_0xd056('0xc3')]&&_0x3ed3e4[_0xd056('0xc3')][_0xd056('0xab')][_0xd056('0x4b')]){return _0x3ed3e4[_0xd056('0xc3')]['Contacts'][0x0];}return db[_0xd056('0xaa')][_0xd056('0x5f')](_['defaults'](_0x2c7647['body'],{'firstName':_0x5bdbee,'mobile':_0x5bdbee,'phone':_0x5bdbee,'ListId':_0x3ed3e4[_0xd056('0x9a')]}));}})[_0xd056('0x24')](handleEntityNotFound(_0x554afd,null))[_0xd056('0x24')](function(_0x2657b3){if(_0x2657b3){_0x3cb0b3=_0x2657b3;return db['WhatsappInteraction'][_0xd056('0x5e')]({'where':{'ContactId':_0x3cb0b3['id'],'closed':![],'WhatsappAccountId':_0x3ed3e4['id']}})[_0xd056('0x24')](function(_0x5f5581){if(_0x5f5581){return[_0x5f5581,![]];}return db[_0xd056('0xae')][_0xd056('0x5f')]({'UserId':_0x2c7647[_0xd056('0x63')]['id'],'ContactId':_0x3cb0b3['id'],'WhatsappAccountId':_0x3ed3e4['id'],'phone':_0x5bdbee,'firstMsgDirection':_0xd056('0xc5'),'Messages':[_[_0xd056('0x53')](_0x2c7647[_0xd056('0x60')],{'read':![],'body':_0x2c7647[_0xd056('0x60')][_0xd056('0x60')],'phone':_0x5bdbee,'WhatsappAccountId':_0x3ed3e4['id'],'UserId':_0x2c7647['user']['id'],'ContactId':_0x3cb0b3['id']})]},{'include':[{'model':db[_0xd056('0x91')],'as':_0xd056('0xc6')}]})['then'](function(_0x38c105){return[_0x38c105,!![]];});});}})[_0xd056('0x76')](function(_0x119e4e,_0xbcf746){if(_0xbcf746){return _0x119e4e;}return db['WhatsappMessage'][_0xd056('0x5f')](_[_0xd056('0x53')](_0x2c7647[_0xd056('0x60')],{'read':![],'body':_0x2c7647[_0xd056('0x60')][_0xd056('0x60')],'phone':_0x5bdbee,'WhatsappAccountId':_0x3ed3e4['id'],'WhatsappInteractionId':_0x119e4e['id'],'UserId':_0x2c7647['user']['id'],'ContactId':_0x3cb0b3['id']}))[_0xd056('0x24')](function(_0x1a4d3c){_0x119e4e[_0xd056('0xc7')]['Messages']=[];_0x119e4e[_0xd056('0xc7')]['Messages']['push'](_0x1a4d3c['dataValues']);return _0x119e4e;});})[_0xd056('0x24')](respondWithResult(_0x554afd,null))[_0xd056('0x2c')](handleError(_0x554afd,null));}; \ No newline at end of file +var _0xa4fb=['ListId','mobile','twilio','from','replace','Body','messageId','MessageSid','notifications','isNil','ValidationError','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','list','Contacts','contact','WhatsappInteraction','spread','interaction','created','push','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','agent','waitForTheAssignedAgent','Start','startRouting','Content-Type','text/xml','to\x20is\x20mandatory','List','out','Messages','WhatsappMessage','dataValues','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','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','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','http','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','get','UserProfileResource','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','show','options','find','create','body','user','role','userProfileId','params','describe','WhatsappAccountId','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addAgents','omit','emit','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','sequelize','Transaction','READ_COMMITTED','findOne','WhatsappApplication','priority','finally','json','getApplications','notify','Applications','account','sinch','statuses','state','read','timestamp','message_id','applications','asc','CmContact','Sequelize','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa4fb,0xe9));var _0xba4f=function(_0x1b3564,_0x16c919){_0x1b3564=_0x1b3564-0x0;var _0x504069=_0xa4fb[_0x1b3564];return _0x504069;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xba4f('0x0'));var zipdir=require(_0xba4f('0x1'));var jsonpatch=require(_0xba4f('0x2'));var rp=require(_0xba4f('0x3'));var moment=require(_0xba4f('0x4'));var BPromise=require(_0xba4f('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xba4f('0x6'));var sox=require(_0xba4f('0x7'));var csv=require('to-csv');var ejs=require(_0xba4f('0x8'));var fs=require('fs');var fs_extra=require(_0xba4f('0x9'));var _=require(_0xba4f('0xa'));var squel=require('squel');var crypto=require(_0xba4f('0xb'));var jsforce=require(_0xba4f('0xc'));var deskjs=require(_0xba4f('0xd'));var toCsv=require(_0xba4f('0xe'));var querystring=require(_0xba4f('0xf'));var Papa=require(_0xba4f('0x10'));var Redis=require(_0xba4f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xba4f('0x12'));var as=require(_0xba4f('0x13'));var hardwareService=require(_0xba4f('0x14'));var logger=require(_0xba4f('0x15'))(_0xba4f('0x16'));var utils=require(_0xba4f('0x17'));var config=require(_0xba4f('0x18'));var licenseUtil=require(_0xba4f('0x19'));var db=require(_0xba4f('0x1a'))['db'];config[_0xba4f('0x1b')]=_[_0xba4f('0x1c')](config[_0xba4f('0x1b')],{'host':_0xba4f('0x1d'),'port':0x18eb});var socket=require(_0xba4f('0x1e'))(new Redis(config[_0xba4f('0x1b')]));require('./whatsappAccount.socket')[_0xba4f('0x1f')](socket);var jayson=require(_0xba4f('0x20'));var client=jayson['client'][_0xba4f('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x2c7e99,_0x4871e0,_0x3f0cc4,_0x2a6e15){return new BPromise(function(_0x91c259,_0x55f082){var _0x4dc61f=_0x2a6e15||client;return _0x4dc61f['request'](_0x2c7e99,_0x3f0cc4)[_0xba4f('0x22')](function(_0x539396){logger[_0xba4f('0x23')](_0xba4f('0x24'),_0x4871e0,_0xba4f('0x25'));logger[_0xba4f('0x26')](_0xba4f('0x27'),_0x4871e0,'request\x20sent',JSON[_0xba4f('0x28')](_0x539396));if(_0x539396[_0xba4f('0x29')]){if(_0x539396[_0xba4f('0x29')][_0xba4f('0x2a')]===0x1f4){logger[_0xba4f('0x29')]('WhatsappAccount,\x20%s,\x20%s',_0x4871e0,_0x539396[_0xba4f('0x29')][_0xba4f('0x2b')]);return _0x55f082(_0x539396[_0xba4f('0x29')][_0xba4f('0x2b')]);}logger[_0xba4f('0x29')](_0xba4f('0x24'),_0x4871e0,_0x539396[_0xba4f('0x29')][_0xba4f('0x2b')]);return _0x91c259(_0x539396[_0xba4f('0x29')]['message']);}else{logger[_0xba4f('0x23')]('WhatsappAccount,\x20%s,\x20%s',_0x4871e0,_0xba4f('0x25'));_0x91c259(_0x539396[_0xba4f('0x2c')][_0xba4f('0x2b')]);}})[_0xba4f('0x2d')](function(_0x1c1c7d){logger[_0xba4f('0x29')](_0xba4f('0x24'),_0x4871e0,_0x1c1c7d);_0x55f082(_0x1c1c7d);});});}function respondWithStatusCode(_0xc086f0,_0x1b5e59){_0x1b5e59=_0x1b5e59||0xcc;return function(_0x22057e){if(_0x22057e){return _0xc086f0['sendStatus'](_0x1b5e59);}return _0xc086f0['status'](_0x1b5e59)[_0xba4f('0x2e')]();};}function respondWithResult(_0x92a3e3,_0xa6e42b){_0xa6e42b=_0xa6e42b||0xc8;return function(_0x36c6b2){if(_0x36c6b2){return _0x92a3e3[_0xba4f('0x2f')](_0xa6e42b)['json'](_0x36c6b2);}};}function respondWithFilteredResult(_0x26bd6b,_0x1e1c62){return function(_0x26c7a4){if(_0x26c7a4){var _0x2e534b=typeof _0x1e1c62[_0xba4f('0x30')]===_0xba4f('0x31')&&typeof _0x1e1c62[_0xba4f('0x32')]===_0xba4f('0x31');var _0x121441=_0x26c7a4[_0xba4f('0x33')];var _0x4cf066=_0x2e534b?0x0:_0x1e1c62[_0xba4f('0x30')];var _0x36f818=_0x2e534b?_0x26c7a4[_0xba4f('0x33')]:_0x1e1c62[_0xba4f('0x30')]+_0x1e1c62['limit'];var _0x12ad55;if(_0x36f818>=_0x121441){_0x36f818=_0x121441;_0x12ad55=0xc8;}else{_0x12ad55=0xce;}_0x26bd6b['status'](_0x12ad55);return _0x26bd6b[_0xba4f('0x34')](_0xba4f('0x35'),_0x4cf066+'-'+_0x36f818+'/'+_0x121441)['json'](_0x26c7a4);}return null;};}function patchUpdates(_0x28a9db){return function(_0x2856c9){try{jsonpatch[_0xba4f('0x36')](_0x2856c9,_0x28a9db,!![]);}catch(_0x2be215){return BPromise[_0xba4f('0x37')](_0x2be215);}return _0x2856c9['save']();};}function saveUpdates(_0x230934,_0x35309e){return function(_0x3b6de7){if(_0x3b6de7){return _0x3b6de7[_0xba4f('0x38')](_0x230934)[_0xba4f('0x22')](function(_0x34ec6c){return _0x34ec6c;});}return null;};}function removeEntity(_0x1fbca6,_0x335acf){return function(_0x44ecc6){if(_0x44ecc6){return _0x44ecc6[_0xba4f('0x39')]()[_0xba4f('0x22')](function(){var _0x3cac=_0x44ecc6[_0xba4f('0x3a')]({'plain':!![]});var _0x24aa82='WhatsappAccounts';return db[_0xba4f('0x3b')][_0xba4f('0x39')]({'where':{'type':_0x24aa82,'resourceId':_0x3cac['id']}})[_0xba4f('0x22')](function(){return _0x44ecc6;});})['then'](function(){_0x1fbca6[_0xba4f('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f650d,_0x5df949){return function(_0xaa3f2d){if(!_0xaa3f2d){_0x3f650d[_0xba4f('0x3c')](0x194);}return _0xaa3f2d;};}function handleError(_0x58e812,_0x216cd6){_0x216cd6=_0x216cd6||0x1f4;return function(_0x29cedc){logger[_0xba4f('0x29')](_0x29cedc[_0xba4f('0x3d')]);if(_0x29cedc[_0xba4f('0x3e')]){delete _0x29cedc['name'];}_0x58e812[_0xba4f('0x2f')](_0x216cd6)[_0xba4f('0x3f')](_0x29cedc);};}exports[_0xba4f('0x40')]=function(_0x50c962,_0x150d98){var _0x2f5cd1={'include':[{'model':db[_0xba4f('0x41')],'as':_0xba4f('0x42')}]},_0x26360c={},_0x12c47d={'count':0x0,'rows':[]};var _0xc9e328=_[_0xba4f('0x43')](db[_0xba4f('0x44')][_0xba4f('0x45')],function(_0x45a834){return{'name':_0x45a834['fieldName'],'type':_0x45a834[_0xba4f('0x46')][_0xba4f('0x47')]};});_0x26360c['model']=_['map'](_0xc9e328,'name');_0x26360c[_0xba4f('0x48')]=_[_0xba4f('0x49')](_0x50c962[_0xba4f('0x48')]);_0x26360c['filters']=_[_0xba4f('0x4a')](_0x26360c[_0xba4f('0x4b')],_0x26360c[_0xba4f('0x48')]);_0x2f5cd1[_0xba4f('0x4c')]=_[_0xba4f('0x4a')](_0x26360c[_0xba4f('0x4b')],qs[_0xba4f('0x4d')](_0x50c962[_0xba4f('0x48')][_0xba4f('0x4d')]));_0x2f5cd1[_0xba4f('0x4c')]=_0x2f5cd1[_0xba4f('0x4c')][_0xba4f('0x4e')]?_0x2f5cd1[_0xba4f('0x4c')]:_0x26360c['model'];if(!_0x50c962[_0xba4f('0x48')][_0xba4f('0x4f')](_0xba4f('0x50'))){_0x2f5cd1[_0xba4f('0x32')]=qs[_0xba4f('0x32')](_0x50c962['query'][_0xba4f('0x32')]);_0x2f5cd1['offset']=qs[_0xba4f('0x30')](_0x50c962[_0xba4f('0x48')][_0xba4f('0x30')]);}_0x2f5cd1[_0xba4f('0x51')]=qs[_0xba4f('0x52')](_0x50c962[_0xba4f('0x48')]['sort']);_0x2f5cd1[_0xba4f('0x53')]=qs[_0xba4f('0x54')](_[_0xba4f('0x55')](_0x50c962['query'],_0x26360c['filters']),_0xc9e328);if(_0x50c962[_0xba4f('0x48')][_0xba4f('0x56')]){_0x2f5cd1['where']=_['merge'](_0x2f5cd1['where'],{'$or':_['map'](_0xc9e328,function(_0x409a48){if(_0x409a48[_0xba4f('0x46')]!==_0xba4f('0x57')){var _0x5659f2={};_0x5659f2[_0x409a48[_0xba4f('0x3e')]]={'$like':'%'+_0x50c962[_0xba4f('0x48')][_0xba4f('0x56')]+'%'};return _0x5659f2;}})});}_0x2f5cd1=_[_0xba4f('0x58')]({},_0x2f5cd1,_0x50c962['options']);var _0x41af1={'where':_0x2f5cd1[_0xba4f('0x53')]};return db['WhatsappAccount'][_0xba4f('0x33')](_0x41af1)[_0xba4f('0x22')](function(_0x584db8){_0x12c47d[_0xba4f('0x33')]=_0x584db8;if(_0x50c962[_0xba4f('0x48')][_0xba4f('0x59')]){_0x2f5cd1[_0xba4f('0x5a')]=[{'all':!![]}];}return db[_0xba4f('0x44')][_0xba4f('0x5b')](_0x2f5cd1);})['then'](function(_0x4108e6){_0x12c47d[_0xba4f('0x5c')]=_0x4108e6;return _0x12c47d;})[_0xba4f('0x22')](respondWithFilteredResult(_0x150d98,_0x2f5cd1))['catch'](handleError(_0x150d98,null));};exports[_0xba4f('0x5d')]=function(_0xf0e455,_0xfaa0b7){var _0x59b99f={'raw':![],'where':{'id':_0xf0e455['params']['id']},'include':[{'model':db['Pause'],'as':_0xba4f('0x42')}]},_0xbf5d1e={};_0xbf5d1e[_0xba4f('0x4b')]=_[_0xba4f('0x49')](db[_0xba4f('0x44')]['rawAttributes']);_0xbf5d1e[_0xba4f('0x48')]=_['keys'](_0xf0e455[_0xba4f('0x48')]);_0xbf5d1e[_0xba4f('0x54')]=_[_0xba4f('0x4a')](_0xbf5d1e[_0xba4f('0x4b')],_0xbf5d1e[_0xba4f('0x48')]);_0x59b99f['attributes']=_['intersection'](_0xbf5d1e[_0xba4f('0x4b')],qs[_0xba4f('0x4d')](_0xf0e455[_0xba4f('0x48')][_0xba4f('0x4d')]));_0x59b99f[_0xba4f('0x4c')]=_0x59b99f['attributes'][_0xba4f('0x4e')]?_0x59b99f[_0xba4f('0x4c')]:_0xbf5d1e[_0xba4f('0x4b')];if(_0xf0e455[_0xba4f('0x48')][_0xba4f('0x59')]){_0x59b99f[_0xba4f('0x5a')]=[{'all':!![]}];}_0x59b99f=_[_0xba4f('0x58')]({},_0x59b99f,_0xf0e455[_0xba4f('0x5e')]);return db['WhatsappAccount'][_0xba4f('0x5f')](_0x59b99f)[_0xba4f('0x22')](handleEntityNotFound(_0xfaa0b7,null))[_0xba4f('0x22')](respondWithResult(_0xfaa0b7,null))[_0xba4f('0x2d')](handleError(_0xfaa0b7,null));};exports[_0xba4f('0x60')]=function(_0xf498e,_0x5b9131){return db[_0xba4f('0x44')][_0xba4f('0x60')](_0xf498e[_0xba4f('0x61')],{})[_0xba4f('0x22')](function(_0x454ffc){var _0x3677fe=_0xf498e[_0xba4f('0x62')][_0xba4f('0x3a')]({'plain':!![]});if(!_0x3677fe)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3677fe[_0xba4f('0x63')]===_0xba4f('0x62')){var _0x2b6313=_0x454ffc[_0xba4f('0x3a')]({'plain':!![]});var _0x1d7b80='WhatsappAccounts';return db['UserProfileSection'][_0xba4f('0x5f')]({'where':{'name':_0x1d7b80,'userProfileId':_0x3677fe[_0xba4f('0x64')]},'raw':!![]})[_0xba4f('0x22')](function(_0x20cdbf){if(_0x20cdbf&&_0x20cdbf['autoAssociation']===0x0){return db[_0xba4f('0x3b')][_0xba4f('0x60')]({'name':_0x2b6313[_0xba4f('0x3e')],'resourceId':_0x2b6313['id'],'type':_0x20cdbf[_0xba4f('0x3e')],'sectionId':_0x20cdbf['id']},{})[_0xba4f('0x22')](function(){return _0x454ffc;});}else{return _0x454ffc;}})['catch'](function(_0xb2c15){logger[_0xba4f('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb2c15);throw _0xb2c15;});}return _0x454ffc;})['then'](respondWithResult(_0x5b9131,0xc9))['catch'](handleError(_0x5b9131,null));};exports[_0xba4f('0x38')]=function(_0xdf59fd,_0xd32db1){if(_0xdf59fd[_0xba4f('0x61')]['id']){delete _0xdf59fd[_0xba4f('0x61')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0xdf59fd[_0xba4f('0x65')]['id']},'include':[{'model':db[_0xba4f('0x41')],'as':_0xba4f('0x42')}]})[_0xba4f('0x22')](handleEntityNotFound(_0xd32db1,null))[_0xba4f('0x22')](saveUpdates(_0xdf59fd[_0xba4f('0x61')],null))[_0xba4f('0x22')](respondWithResult(_0xd32db1,null))['catch'](handleError(_0xd32db1,null));};exports[_0xba4f('0x39')]=function(_0x558d88,_0x14eb23){return db[_0xba4f('0x44')]['find']({'where':{'id':_0x558d88[_0xba4f('0x65')]['id']}})[_0xba4f('0x22')](handleEntityNotFound(_0x14eb23,null))[_0xba4f('0x22')](removeEntity(_0x14eb23,null))[_0xba4f('0x2d')](handleError(_0x14eb23,null));};exports[_0xba4f('0x66')]=function(_0x41f5fc,_0x5a1540){return db[_0xba4f('0x44')][_0xba4f('0x66')]()[_0xba4f('0x22')](respondWithResult(_0x5a1540,null))[_0xba4f('0x2d')](handleError(_0x5a1540,null));};exports['addDisposition']=function(_0x40bb87,_0x14eb4b,_0x15e462){if(_0x40bb87[_0xba4f('0x61')]['id']){delete _0x40bb87[_0xba4f('0x61')]['id'];}return db[_0xba4f('0x44')][_0xba4f('0x5f')]({'where':{'id':_0x40bb87['params']['id']}})['then'](handleEntityNotFound(_0x14eb4b,null))[_0xba4f('0x22')](function(_0x57560a){if(_0x57560a){_0x40bb87[_0xba4f('0x61')][_0xba4f('0x67')]=_0x57560a['id'];return db[_0xba4f('0x68')][_0xba4f('0x60')](_0x40bb87[_0xba4f('0x61')]);}})[_0xba4f('0x22')](respondWithResult(_0x14eb4b,null))[_0xba4f('0x2d')](handleError(_0x14eb4b,null));};exports['getDispositions']=function(_0x5578b2,_0x1ffb37,_0x42c994){var _0x5391f0={'raw':![],'where':{}};var _0x4fe086={};var _0x4f7ef1={'count':0x0,'rows':[]};return db['WhatsappAccount']['findOne']({'where':{'id':_0x5578b2[_0xba4f('0x65')]['id']}})[_0xba4f('0x22')](handleEntityNotFound(_0x1ffb37,null))[_0xba4f('0x22')](function(_0x225673){if(_0x225673){_0x4fe086[_0xba4f('0x4b')]=_['keys'](db[_0xba4f('0x68')][_0xba4f('0x45')]);_0x4fe086['query']=_[_0xba4f('0x49')](_0x5578b2[_0xba4f('0x48')]);_0x4fe086[_0xba4f('0x54')]=_['intersection'](_0x4fe086[_0xba4f('0x4b')],_0x4fe086['query']);_0x5391f0[_0xba4f('0x4c')]=_[_0xba4f('0x4a')](_0x4fe086[_0xba4f('0x4b')],qs[_0xba4f('0x4d')](_0x5578b2[_0xba4f('0x48')][_0xba4f('0x4d')]));_0x5391f0['attributes']=_0x5391f0['attributes']['length']?_0x5391f0[_0xba4f('0x4c')]:_0x4fe086[_0xba4f('0x4b')];if(!_0x5578b2[_0xba4f('0x48')][_0xba4f('0x4f')](_0xba4f('0x50'))){_0x5391f0[_0xba4f('0x32')]=qs['limit'](_0x5578b2[_0xba4f('0x48')][_0xba4f('0x32')]);_0x5391f0[_0xba4f('0x30')]=qs[_0xba4f('0x30')](_0x5578b2[_0xba4f('0x48')][_0xba4f('0x30')]);}_0x5391f0[_0xba4f('0x51')]=qs[_0xba4f('0x52')](_0x5578b2[_0xba4f('0x48')][_0xba4f('0x52')]);_0x5391f0['where']=qs[_0xba4f('0x54')](_[_0xba4f('0x55')](_0x5578b2[_0xba4f('0x48')],_0x4fe086[_0xba4f('0x54')]));_0x5391f0[_0xba4f('0x53')]['WhatsappAccountId']=_0x225673['id'];if(_0x5578b2[_0xba4f('0x48')][_0xba4f('0x56')]){_0x5391f0['where']=_['merge'](_0x5391f0[_0xba4f('0x53')],{'$or':_[_0xba4f('0x43')](_0x5391f0[_0xba4f('0x4c')],function(_0x4b9103){var _0x58fa55={};_0x58fa55[_0x4b9103]={'$like':'%'+_0x5578b2[_0xba4f('0x48')][_0xba4f('0x56')]+'%'};return _0x58fa55;})});}_0x5391f0=_[_0xba4f('0x58')]({},_0x5391f0,_0x5578b2[_0xba4f('0x5e')]);return db[_0xba4f('0x68')][_0xba4f('0x33')]({'where':_0x5391f0['where']})['then'](function(_0xe10694){_0x4f7ef1[_0xba4f('0x33')]=_0xe10694;if(_0x5578b2[_0xba4f('0x48')]['includeAll']){_0x5391f0[_0xba4f('0x5a')]=[{'all':!![]}];}return db['Disposition'][_0xba4f('0x5b')](_0x5391f0);})[_0xba4f('0x22')](function(_0x2198dc){_0x4f7ef1[_0xba4f('0x5c')]=_0x2198dc;return _0x4f7ef1;});}})[_0xba4f('0x22')](respondWithFilteredResult(_0x1ffb37,_0x5391f0))[_0xba4f('0x2d')](handleError(_0x1ffb37,null));};exports[_0xba4f('0x69')]=function(_0x4f6b98,_0x131cfb,_0x2d7686){return db[_0xba4f('0x44')][_0xba4f('0x5f')]({'where':{'id':_0x4f6b98[_0xba4f('0x65')]['id']}})[_0xba4f('0x22')](handleEntityNotFound(_0x131cfb,null))[_0xba4f('0x22')](function(_0x1e185d){if(_0x1e185d){return _0x1e185d[_0xba4f('0x69')](_0x4f6b98['query'][_0xba4f('0x6a')]);}})[_0xba4f('0x22')](respondWithStatusCode(_0x131cfb,null))['catch'](handleError(_0x131cfb,null));};exports[_0xba4f('0x6b')]=function(_0x30b905,_0x48e485,_0x3dc79c){if(_0x30b905['body']['id']){delete _0x30b905[_0xba4f('0x61')]['id'];}return db[_0xba4f('0x44')][_0xba4f('0x5f')]({'where':{'id':_0x30b905['params']['id']}})[_0xba4f('0x22')](handleEntityNotFound(_0x48e485,null))[_0xba4f('0x22')](function(_0xb81346){if(_0xb81346){_0x30b905[_0xba4f('0x61')][_0xba4f('0x67')]=_0xb81346['id'];return db[_0xba4f('0x6c')]['create'](_0x30b905['body']);}})['then'](respondWithResult(_0x48e485,null))[_0xba4f('0x2d')](handleError(_0x48e485,null));};exports['getAnswers']=function(_0xdd44fa,_0x2a709e,_0x41c2d6){var _0x331b98={'raw':![],'where':{}};var _0x4a66c6={};var _0x51f74c={'count':0x0,'rows':[]};return db[_0xba4f('0x44')]['findOne']({'where':{'id':_0xdd44fa[_0xba4f('0x65')]['id']}})[_0xba4f('0x22')](handleEntityNotFound(_0x2a709e,null))[_0xba4f('0x22')](function(_0x335671){if(_0x335671){_0x4a66c6['model']=_[_0xba4f('0x49')](db[_0xba4f('0x6c')]['rawAttributes']);_0x4a66c6[_0xba4f('0x48')]=_[_0xba4f('0x49')](_0xdd44fa[_0xba4f('0x48')]);_0x4a66c6[_0xba4f('0x54')]=_[_0xba4f('0x4a')](_0x4a66c6[_0xba4f('0x4b')],_0x4a66c6['query']);_0x331b98[_0xba4f('0x4c')]=_[_0xba4f('0x4a')](_0x4a66c6[_0xba4f('0x4b')],qs[_0xba4f('0x4d')](_0xdd44fa[_0xba4f('0x48')][_0xba4f('0x4d')]));_0x331b98[_0xba4f('0x4c')]=_0x331b98[_0xba4f('0x4c')][_0xba4f('0x4e')]?_0x331b98[_0xba4f('0x4c')]:_0x4a66c6[_0xba4f('0x4b')];if(!_0xdd44fa[_0xba4f('0x48')][_0xba4f('0x4f')]('nolimit')){_0x331b98[_0xba4f('0x32')]=qs['limit'](_0xdd44fa[_0xba4f('0x48')][_0xba4f('0x32')]);_0x331b98[_0xba4f('0x30')]=qs['offset'](_0xdd44fa[_0xba4f('0x48')][_0xba4f('0x30')]);}_0x331b98[_0xba4f('0x51')]=qs[_0xba4f('0x52')](_0xdd44fa['query'][_0xba4f('0x52')]);_0x331b98[_0xba4f('0x53')]=qs['filters'](_[_0xba4f('0x55')](_0xdd44fa['query'],_0x4a66c6[_0xba4f('0x54')]));_0x331b98[_0xba4f('0x53')][_0xba4f('0x67')]=_0x335671['id'];if(_0xdd44fa[_0xba4f('0x48')]['filter']){_0x331b98[_0xba4f('0x53')]=_['merge'](_0x331b98['where'],{'$or':_[_0xba4f('0x43')](_0x331b98[_0xba4f('0x4c')],function(_0x578651){var _0x187b49={};_0x187b49[_0x578651]={'$like':'%'+_0xdd44fa['query'][_0xba4f('0x56')]+'%'};return _0x187b49;})});}_0x331b98=_['merge']({},_0x331b98,_0xdd44fa[_0xba4f('0x5e')]);return db['CannedAnswer']['count']({'where':_0x331b98[_0xba4f('0x53')]})[_0xba4f('0x22')](function(_0x549097){_0x51f74c[_0xba4f('0x33')]=_0x549097;if(_0xdd44fa[_0xba4f('0x48')]['includeAll']){_0x331b98['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xba4f('0x5b')](_0x331b98);})[_0xba4f('0x22')](function(_0x393534){_0x51f74c[_0xba4f('0x5c')]=_0x393534;return _0x51f74c;});}})[_0xba4f('0x22')](respondWithFilteredResult(_0x2a709e,_0x331b98))[_0xba4f('0x2d')](handleError(_0x2a709e,null));};exports[_0xba4f('0x6d')]=function(_0x1c7ac4,_0x601f01,_0x47fa87){return db[_0xba4f('0x44')]['find']({'where':{'id':_0x1c7ac4[_0xba4f('0x65')]['id']}})[_0xba4f('0x22')](handleEntityNotFound(_0x601f01,null))[_0xba4f('0x22')](function(_0x5d31c3){if(_0x5d31c3){return _0x5d31c3[_0xba4f('0x6d')](_0x1c7ac4['query'][_0xba4f('0x6a')]);}})[_0xba4f('0x22')](respondWithStatusCode(_0x601f01,null))[_0xba4f('0x2d')](handleError(_0x601f01,null));};exports[_0xba4f('0x6e')]=function(_0x3e0dcd,_0x5793c9,_0x1ce573){return db[_0xba4f('0x44')][_0xba4f('0x5f')]({'where':{'id':_0x3e0dcd[_0xba4f('0x65')]['id']}})[_0xba4f('0x22')](handleEntityNotFound(_0x5793c9,null))[_0xba4f('0x22')](function(_0x255dcd){if(_0x255dcd){return _0x255dcd[_0xba4f('0x6e')](_0x3e0dcd[_0xba4f('0x61')]['ids'],_[_0xba4f('0x6f')](_0x3e0dcd[_0xba4f('0x61')],[_0xba4f('0x6a'),'id'])||{})['spread'](function(_0x588059){for(var _0x203c19=0x0;_0x203c19<_0x3e0dcd['body'][_0xba4f('0x6a')][_0xba4f('0x4e')];_0x203c19+=0x1){socket[_0xba4f('0x70')]('userWhatsappAccount:save',{'UserId':Number(_0x3e0dcd[_0xba4f('0x61')][_0xba4f('0x6a')][_0x203c19]),'WhatsappAccountId':Number(_0x3e0dcd[_0xba4f('0x65')]['id'])});}return _0x588059;});}})[_0xba4f('0x22')](respondWithResult(_0x5793c9,null))[_0xba4f('0x2d')](handleError(_0x5793c9,null));};exports[_0xba4f('0x71')]=function(_0x13347b,_0xe5bc98,_0x186b85){return db[_0xba4f('0x44')]['find']({'where':{'id':_0x13347b[_0xba4f('0x65')]['id']}})[_0xba4f('0x22')](handleEntityNotFound(_0xe5bc98,null))[_0xba4f('0x22')](function(_0x41bcf8){if(_0x41bcf8){return _0x41bcf8['removeAgents'](_0x13347b['query'][_0xba4f('0x6a')])[_0xba4f('0x22')](function(){if(_[_0xba4f('0x72')](_0x13347b['query'][_0xba4f('0x6a')])){for(var _0x519af7=0x0;_0x519af7<_0x13347b[_0xba4f('0x48')]['ids'][_0xba4f('0x4e')];_0x519af7+=0x1){socket[_0xba4f('0x70')](_0xba4f('0x73'),{'UserId':Number(_0x13347b[_0xba4f('0x48')]['ids'][_0x519af7]),'WhatsappAccountId':Number(_0x13347b[_0xba4f('0x65')]['id'])});}}else{socket[_0xba4f('0x70')](_0xba4f('0x73'),{'UserId':Number(_0x13347b[_0xba4f('0x48')][_0xba4f('0x6a')]),'WhatsappAccountId':Number(_0x13347b[_0xba4f('0x65')]['id'])});}});}})['then'](respondWithStatusCode(_0xe5bc98,null))['catch'](handleError(_0xe5bc98,null));};exports[_0xba4f('0x74')]=function(_0x545554,_0x1bad66,_0x51c18b){var _0x1d2e01={};var _0x3c33b8={};var _0x4a93cf;var _0x447411;return db[_0xba4f('0x44')]['findOne']({'where':{'id':_0x545554[_0xba4f('0x65')]['id']}})[_0xba4f('0x22')](handleEntityNotFound(_0x1bad66,null))[_0xba4f('0x22')](function(_0x788941){if(_0x788941){_0x4a93cf=_0x788941;_0x3c33b8[_0xba4f('0x4b')]=_[_0xba4f('0x49')](db[_0xba4f('0x75')]['rawAttributes']);_0x3c33b8[_0xba4f('0x48')]=_[_0xba4f('0x49')](_0x545554[_0xba4f('0x48')]);_0x3c33b8[_0xba4f('0x54')]=_[_0xba4f('0x4a')](_0x3c33b8[_0xba4f('0x4b')],_0x3c33b8[_0xba4f('0x48')]);_0x1d2e01[_0xba4f('0x4c')]=_[_0xba4f('0x4a')](_0x3c33b8[_0xba4f('0x4b')],qs[_0xba4f('0x4d')](_0x545554['query'][_0xba4f('0x4d')]));_0x1d2e01[_0xba4f('0x4c')]=_0x1d2e01[_0xba4f('0x4c')][_0xba4f('0x4e')]?_0x1d2e01['attributes']:_0x3c33b8[_0xba4f('0x4b')];_0x1d2e01[_0xba4f('0x51')]=qs[_0xba4f('0x52')](_0x545554[_0xba4f('0x48')][_0xba4f('0x52')]);_0x1d2e01[_0xba4f('0x53')]=qs[_0xba4f('0x54')](_[_0xba4f('0x55')](_0x545554[_0xba4f('0x48')],_0x3c33b8[_0xba4f('0x54')]));if(_0x545554['query'][_0xba4f('0x56')]){_0x1d2e01['where']=_[_0xba4f('0x58')](_0x1d2e01[_0xba4f('0x53')],{'$or':_['map'](_0x1d2e01[_0xba4f('0x4c')],function(_0x1bb4b3){var _0x4f2f6d={};_0x4f2f6d[_0x1bb4b3]={'$like':'%'+_0x545554['query'][_0xba4f('0x56')]+'%'};return _0x4f2f6d;})});}_0x1d2e01=_[_0xba4f('0x58')]({},_0x1d2e01,_0x545554[_0xba4f('0x5e')]);return _0x4a93cf[_0xba4f('0x74')](_0x1d2e01);}})[_0xba4f('0x22')](function(_0x51d3fd){if(_0x51d3fd){_0x447411=_0x51d3fd['length'];if(!_0x545554[_0xba4f('0x48')][_0xba4f('0x4f')]('nolimit')){_0x1d2e01[_0xba4f('0x32')]=qs[_0xba4f('0x32')](_0x545554[_0xba4f('0x48')][_0xba4f('0x32')]);_0x1d2e01[_0xba4f('0x30')]=qs[_0xba4f('0x30')](_0x545554['query'][_0xba4f('0x30')]);}return _0x4a93cf['getAgents'](_0x1d2e01);}})[_0xba4f('0x22')](function(_0x2741f8){if(_0x2741f8){return _0x2741f8?{'count':_0x447411,'rows':_0x2741f8}:null;}})[_0xba4f('0x22')](respondWithResult(_0x1bad66,null))[_0xba4f('0x2d')](handleError(_0x1bad66,null));};exports['addApplications']=function(_0x5b41e6,_0x444d60){var _0x2ede50=_0x5b41e6[_0xba4f('0x65')]['id'];var _0x36d229=_0x5b41e6['body'];var _0x54e60d=0xc8;var _0x1f8bcd=null;return db[_0xba4f('0x76')]['transaction']({'isolationLevel':db['sequelize'][_0xba4f('0x77')]['ISOLATION_LEVELS'][_0xba4f('0x78')]},function(_0x2e543a){return db[_0xba4f('0x44')][_0xba4f('0x79')]({'where':{'id':_0x2ede50},'transaction':_0x2e543a})[_0xba4f('0x22')](function(_0x5cdd93){if(_0x5cdd93){return db[_0xba4f('0x7a')][_0xba4f('0x39')]({'where':{'WhatsappAccountId':_0x2ede50},'transaction':_0x2e543a})['then'](function(){var _0x348c64=_[_0xba4f('0x43')](_0x36d229,function(_0xa4b822){_0xa4b822[_0xba4f('0x67')]=_0x2ede50;return _0xa4b822;});return db[_0xba4f('0x7a')]['bulkCreate'](_0x348c64,{'transaction':_0x2e543a});});}else{_0x54e60d=0x194;_0x1f8bcd=[];}});})[_0xba4f('0x22')](function(){if(_0x54e60d!==0x194){return db[_0xba4f('0x7a')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x2ede50},'order':_0xba4f('0x7b')})[_0xba4f('0x22')](function(_0x3492c7){_0x1f8bcd=_0x3492c7;});}})[_0xba4f('0x2d')](function(_0x5e1128){_0x54e60d=0x1f4;logger[_0xba4f('0x29')](_0x5e1128[_0xba4f('0x3d')]);if(_0x5e1128[_0xba4f('0x3e')]){delete _0x5e1128[_0xba4f('0x3e')];}_0x1f8bcd=_0x5e1128;})[_0xba4f('0x7c')](function(){if(_0x1f8bcd===null){_0x444d60[_0xba4f('0x3c')](_0x54e60d);}else{if(_0x54e60d===0x1f4){_0x444d60['status'](_0x54e60d)[_0xba4f('0x3f')](_0x1f8bcd);}else{_0x444d60[_0xba4f('0x2f')](_0x54e60d)[_0xba4f('0x7d')](_0x1f8bcd);}}});};exports['getApplications']=function(_0x4291ba,_0x5a719f,_0x10c165){var _0x47ce6a={};var _0xd0ac3a={};var _0x591861;var _0x412fb3;return db[_0xba4f('0x44')]['findOne']({'where':{'id':_0x4291ba['params']['id']}})[_0xba4f('0x22')](handleEntityNotFound(_0x5a719f,null))[_0xba4f('0x22')](function(_0x49b57f){if(_0x49b57f){_0x591861=_0x49b57f;_0xd0ac3a[_0xba4f('0x4b')]=_[_0xba4f('0x49')](db['WhatsappApplication']['rawAttributes']);_0xd0ac3a[_0xba4f('0x48')]=_[_0xba4f('0x49')](_0x4291ba[_0xba4f('0x48')]);_0xd0ac3a[_0xba4f('0x54')]=_['intersection'](_0xd0ac3a[_0xba4f('0x4b')],_0xd0ac3a[_0xba4f('0x48')]);_0x47ce6a[_0xba4f('0x4c')]=_[_0xba4f('0x4a')](_0xd0ac3a[_0xba4f('0x4b')],qs[_0xba4f('0x4d')](_0x4291ba[_0xba4f('0x48')][_0xba4f('0x4d')]));_0x47ce6a[_0xba4f('0x4c')]=_0x47ce6a[_0xba4f('0x4c')][_0xba4f('0x4e')]?_0x47ce6a[_0xba4f('0x4c')]:_0xd0ac3a[_0xba4f('0x4b')];_0x47ce6a['order']=qs[_0xba4f('0x52')](_0x4291ba[_0xba4f('0x48')][_0xba4f('0x52')]);_0x47ce6a[_0xba4f('0x53')]=qs['filters'](_[_0xba4f('0x55')](_0x4291ba[_0xba4f('0x48')],_0xd0ac3a[_0xba4f('0x54')]));if(_0x4291ba[_0xba4f('0x48')][_0xba4f('0x56')]){_0x47ce6a[_0xba4f('0x53')]=_[_0xba4f('0x58')](_0x47ce6a['where'],{'$or':_['map'](_0x47ce6a[_0xba4f('0x4c')],function(_0x31d6b1){var _0x572b3a={};_0x572b3a[_0x31d6b1]={'$like':'%'+_0x4291ba[_0xba4f('0x48')][_0xba4f('0x56')]+'%'};return _0x572b3a;})});}_0x47ce6a=_[_0xba4f('0x58')]({},_0x47ce6a,_0x4291ba[_0xba4f('0x5e')]);return _0x591861['getApplications'](_0x47ce6a);}})[_0xba4f('0x22')](function(_0x1cd0be){if(_0x1cd0be){_0x412fb3=_0x1cd0be['length'];if(!_0x4291ba[_0xba4f('0x48')][_0xba4f('0x4f')](_0xba4f('0x50'))){_0x47ce6a[_0xba4f('0x32')]=qs['limit'](_0x4291ba[_0xba4f('0x48')][_0xba4f('0x32')]);_0x47ce6a['offset']=qs[_0xba4f('0x30')](_0x4291ba[_0xba4f('0x48')][_0xba4f('0x30')]);}return _0x591861[_0xba4f('0x7e')](_0x47ce6a);}})[_0xba4f('0x22')](function(_0x2d8036){if(_0x2d8036){return _0x2d8036?{'count':_0x412fb3,'rows':_0x2d8036}:null;}})[_0xba4f('0x22')](respondWithResult(_0x5a719f,null))[_0xba4f('0x2d')](handleError(_0x5a719f,null));};exports[_0xba4f('0x7f')]=function(_0x39206b,_0xe0ffd0,_0x1225eb){var _0x55f2fd={'channel':'whatsapp'};var _0x2d2a1f=[];var _0x47d39a=[];var _0x2e289c={};return db[_0xba4f('0x44')][_0xba4f('0x5f')]({'where':{'id':_0x39206b[_0xba4f('0x65')]['id']},'include':[{'model':db[_0xba4f('0x7a')],'as':_0xba4f('0x80')}]})[_0xba4f('0x22')](handleEntityNotFound(_0xe0ffd0,null))[_0xba4f('0x22')](function(_0x482795){_0x55f2fd[_0xba4f('0x81')]=_0x482795;if(_0x55f2fd['account']&&_0x55f2fd[_0xba4f('0x81')][_0xba4f('0x46')]===_0xba4f('0x82')&&_0x39206b[_0xba4f('0x61')]['statuses']){if(_0x39206b[_0xba4f('0x61')]['statuses'][_0xba4f('0x4e')]===0x0)return;if(_0x39206b[_0xba4f('0x61')][_0xba4f('0x83')][0x0][_0xba4f('0x84')]!==_0xba4f('0x85'))return;return db['WhatsappMessage']['update']({'read':!![],'readAt':_0x39206b['body'][_0xba4f('0x83')][0x0][_0xba4f('0x86')]},{'where':{'messageId':_0x39206b['body'][_0xba4f('0x83')][0x0][_0xba4f('0x87')]},'individualHooks':!![]})['then'](function(_0x40fa53){return _0xe0ffd0[_0xba4f('0x2f')](0xc8)[_0xba4f('0x7d')](_0x40fa53);});}_0x55f2fd[_0xba4f('0x88')]=_['orderBy'](_0x482795[_0xba4f('0x80')],[_0xba4f('0x7b')],[_0xba4f('0x89')]);if(_0x55f2fd[_0xba4f('0x81')][_0xba4f('0x80')]){delete _0x55f2fd[_0xba4f('0x81')][_0xba4f('0x80')];}return db[_0xba4f('0x8a')][_0xba4f('0x66')]()[_0xba4f('0x22')](function(_0x466182){if(!_0x466182){throw new db[(_0xba4f('0x8b'))]['ValidationError'](_0xba4f('0x8c'));}_0x2d2a1f=_[_0xba4f('0x8d')](_[_0xba4f('0x49')](_0x466182),['createdAt',_0xba4f('0x8e')]);_0x47d39a=_[_0xba4f('0x8d')](_['keys'](_0x466182),[_0xba4f('0x8f'),_0xba4f('0x8e'),_0xba4f('0x90'),_0xba4f('0x91')]);_0x55f2fd['body']={'mapKey':_0xba4f('0x92')};if(_0x55f2fd[_0xba4f('0x81')]&&_0x55f2fd[_0xba4f('0x81')]['type']===_0xba4f('0x93')){_0x55f2fd[_0xba4f('0x61')][_0xba4f('0x94')]=_0x39206b[_0xba4f('0x61')]['From'][_0xba4f('0x95')]('whatsapp:','');_0x55f2fd['body'][_0xba4f('0x61')]=_0x39206b[_0xba4f('0x61')][_0xba4f('0x96')];_0x55f2fd['body'][_0xba4f('0x97')]=_0x39206b[_0xba4f('0x61')][_0xba4f('0x98')];}if(_0x55f2fd[_0xba4f('0x81')]&&_0x55f2fd[_0xba4f('0x81')][_0xba4f('0x46')]===_0xba4f('0x82')){_0x55f2fd['body'][_0xba4f('0x94')]=_0x39206b['body'][_0xba4f('0x99')][0x0]['from'];_0x55f2fd[_0xba4f('0x61')][_0xba4f('0x61')]=_0x39206b[_0xba4f('0x61')][_0xba4f('0x99')][0x0][_0xba4f('0x2b')][_0xba4f('0x61')];_0x55f2fd[_0xba4f('0x61')]['messageId']=_0x39206b[_0xba4f('0x61')][_0xba4f('0x99')][0x0][_0xba4f('0x87')];}if(_0x55f2fd[_0xba4f('0x61')]['id']){delete _0x55f2fd['body']['id'];}if(_[_0xba4f('0x9a')](_0x55f2fd[_0xba4f('0x61')][_0xba4f('0x94')])){throw new db['Sequelize'][(_0xba4f('0x9b'))](_0xba4f('0x9c'));}if(_['isNil'](_0x55f2fd[_0xba4f('0x61')][_0xba4f('0x61')])||_0x55f2fd[_0xba4f('0x61')][_0xba4f('0x61')]===''){throw new db[(_0xba4f('0x8b'))][(_0xba4f('0x9b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xba4f('0x9a')](_0x55f2fd[_0xba4f('0x61')][_0xba4f('0x9d')])){throw new db['Sequelize'][(_0xba4f('0x9b'))](_0xba4f('0x9e')+_0x47d39a);}if(!_[_0xba4f('0x9f')](_0x47d39a,_0x55f2fd[_0xba4f('0x61')][_0xba4f('0x9d')])){throw new db[(_0xba4f('0x8b'))]['ValidationError'](_0xba4f('0xa0')+_0x47d39a);}_0x2e289c[_0x55f2fd[_0xba4f('0x61')]['mapKey']]=_0x55f2fd['body'][_0xba4f('0x94')];return db[_0xba4f('0xa1')][_0xba4f('0x5f')]({'where':{'id':_0x55f2fd['account'][_0xba4f('0x91')]},'include':[{'model':db[_0xba4f('0x8a')],'as':'Contacts','where':_0x2e289c,'limit':0x1,'order':[[_0xba4f('0x8e'),_0xba4f('0xa2')]]}]});})[_0xba4f('0x22')](handleEntityNotFound(_0xe0ffd0,null))[_0xba4f('0x22')](function(_0x4331cc){if(_0x4331cc){_0x55f2fd[_0xba4f('0xa3')]=_['omit'](_0x4331cc,[_0xba4f('0xa4')]);if(_0x4331cc[_0xba4f('0xa4')][_0xba4f('0x4e')]){return _0x4331cc[_0xba4f('0xa4')][0x0];}var _0x428bde=_['defaults'](_0x55f2fd['body'],{'firstName':_0x55f2fd[_0xba4f('0x61')][_0xba4f('0x94')],'ListId':_0x4331cc['id']});_0x428bde[_0x55f2fd[_0xba4f('0x61')][_0xba4f('0x9d')]]=_0x55f2fd['body'][_0xba4f('0x94')];return db['CmContact'][_0xba4f('0x60')](_0x428bde,{'fields':_0x2d2a1f,'raw':!![]});}})['then'](handleEntityNotFound(_0xe0ffd0,null))[_0xba4f('0x22')](function(_0x32d469){if(_0x32d469){_0x55f2fd[_0xba4f('0xa5')]=_0x32d469;var _0x50ba3c={'ContactId':_0x32d469['id'],'phone':_0x55f2fd[_0xba4f('0x61')][_0xba4f('0x94')],'WhatsappAccountId':_0x39206b[_0xba4f('0x65')]['id']};var _0x363995={'ContactId':_0x32d469['id'],'WhatsappAccountId':_0x39206b[_0xba4f('0x65')]['id'],'closed':![]};return db[_0xba4f('0xa6')][_0xba4f('0x5f')]({'where':_0x363995})[_0xba4f('0x22')](function(_0x75c2f7){if(_0x75c2f7){return[_0x75c2f7,![]];}return db['WhatsappInteraction'][_0xba4f('0x60')](_0x50ba3c)[_0xba4f('0x22')](function(_0x191bce){return[_0x191bce,!![]];});});}})[_0xba4f('0xa7')](function(_0x453760,_0x3496a5){_0x55f2fd['interaction']=_0x453760[_0xba4f('0x3a')]({'plain':!![]});_0x55f2fd[_0xba4f('0xa8')][_0xba4f('0xa9')]=![];if(_0x3496a5){if(_0x55f2fd[_0xba4f('0x81')]['autoclose']){_0x55f2fd[_0xba4f('0x88')][_0xba4f('0xaa')]({'id':0x0,'priority':_0x55f2fd[_0xba4f('0x88')]['length']+0x1,'app':_0xba4f('0xab'),'appdata':_0xba4f('0xac'),'interval':_0xba4f('0xad')});}_0x55f2fd[_0xba4f('0xa8')][_0xba4f('0xa9')]=!![];}return db['WhatsappMessage']['create']({'phone':_0x55f2fd[_0xba4f('0x61')][_0xba4f('0x94')],'messageId':_0x55f2fd[_0xba4f('0x61')][_0xba4f('0x97')],'body':_0x55f2fd[_0xba4f('0x61')][_0xba4f('0x61')],'WhatsappAccountId':_0x39206b[_0xba4f('0x65')]['id'],'WhatsappInteractionId':_0x453760['id'],'direction':'in','ContactId':_0x453760[_0xba4f('0xae')],'AttachmentId':_0x55f2fd[_0xba4f('0x61')][_0xba4f('0xaf')]});})['then'](function(_0x4e16ab){_0x55f2fd[_0xba4f('0x2b')]=_0x4e16ab;if(_0x55f2fd[_0xba4f('0xa8')][_0xba4f('0xb0')]){return db[_0xba4f('0x75')][_0xba4f('0x5f')]({'attributes':['id','name'],'where':{'id':_0x55f2fd['interaction']['UserId']}})['then'](function(_0x37e6b5){if(_0x37e6b5){_0x55f2fd[_0xba4f('0x88')]['unshift']({'id':0x0,'priority':0x0,'app':_0xba4f('0xb1'),'appdata':_0x37e6b5['name']+','+(_0x55f2fd['account'][_0xba4f('0xb2')]||0xa),'interval':_0xba4f('0xad')});}return respondWithRpcPromise(_0xba4f('0xb3'),_0xba4f('0xb4'),_0x55f2fd);});}return respondWithRpcPromise('Start',_0xba4f('0xb4'),_0x55f2fd);})[_0xba4f('0x22')](function(_0x20a5f8){if(_0x20a5f8){var _0x554aac=0xc8;var _0x42f383='receiveMessage';logger['info']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x42f383,_0x554aac,'entity\x20found');logger[_0xba4f('0x26')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x42f383,_0x554aac,'entity\x20found',JSON[_0xba4f('0x28')](_0x20a5f8));if(_0x55f2fd[_0xba4f('0x81')][_0xba4f('0x46')]===_0xba4f('0x93')){return _0xe0ffd0[_0xba4f('0x2f')](_0x554aac)[_0xba4f('0x34')](_0xba4f('0xb5'),_0xba4f('0xb6'))[_0xba4f('0x3f')]('\x0a');}else{return _0xe0ffd0[_0xba4f('0x2f')](_0x554aac)[_0xba4f('0x7d')](_0x20a5f8);}}});})[_0xba4f('0x2d')](handleError(_0xe0ffd0,null));};exports[_0xba4f('0x3f')]=function(_0x1976c7,_0x2e391c,_0x105581){var _0x25dc84,_0x51502d,_0x34d1db;if(_[_0xba4f('0x9a')](_0x1976c7['body']['body'])||_0x1976c7[_0xba4f('0x61')][_0xba4f('0x61')]===''){throw new db[(_0xba4f('0x8b'))][(_0xba4f('0x9b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xba4f('0x9a')](_0x1976c7[_0xba4f('0x61')]['to'])){throw new db[(_0xba4f('0x8b'))][(_0xba4f('0x9b'))](_0xba4f('0xb7'));}_0x25dc84=_0x1976c7[_0xba4f('0x61')]['to'];return db[_0xba4f('0x44')]['find']({'where':{'id':_0x1976c7[_0xba4f('0x65')]['id']},'include':[{'model':db['CmList'],'as':_0xba4f('0xb8'),'include':[{'model':db[_0xba4f('0x8a')],'as':_0xba4f('0xa4'),'where':{'mobile':_0x25dc84},'limit':0x1,'order':[[_0xba4f('0x8e'),_0xba4f('0xa2')]]}]}]})[_0xba4f('0x22')](handleEntityNotFound(_0x2e391c,null))[_0xba4f('0x22')](function(_0x55905f){if(_0x55905f&&_0x55905f[_0xba4f('0xb8')]){_0x51502d=_0x55905f[_0xba4f('0x3a')]({'plain':!![]});if(_0x51502d[_0xba4f('0xb8')]&&_0x51502d[_0xba4f('0xb8')][_0xba4f('0xa4')][_0xba4f('0x4e')]){return _0x51502d[_0xba4f('0xb8')][_0xba4f('0xa4')][0x0];}return db[_0xba4f('0x8a')][_0xba4f('0x60')](_['defaults'](_0x1976c7[_0xba4f('0x61')],{'firstName':_0x25dc84,'mobile':_0x25dc84,'phone':_0x25dc84,'ListId':_0x51502d[_0xba4f('0x91')]}));}})[_0xba4f('0x22')](handleEntityNotFound(_0x2e391c,null))[_0xba4f('0x22')](function(_0x267757){if(_0x267757){_0x34d1db=_0x267757;return db['WhatsappInteraction'][_0xba4f('0x5f')]({'where':{'ContactId':_0x34d1db['id'],'closed':![],'WhatsappAccountId':_0x51502d['id']}})['then'](function(_0x1228a8){if(_0x1228a8){return[_0x1228a8,![]];}return db[_0xba4f('0xa6')][_0xba4f('0x60')]({'UserId':_0x1976c7['user']['id'],'ContactId':_0x34d1db['id'],'WhatsappAccountId':_0x51502d['id'],'phone':_0x25dc84,'firstMsgDirection':_0xba4f('0xb9'),'Messages':[_['merge'](_0x1976c7['body'],{'read':![],'body':_0x1976c7[_0xba4f('0x61')][_0xba4f('0x61')],'phone':_0x25dc84,'WhatsappAccountId':_0x51502d['id'],'UserId':_0x1976c7[_0xba4f('0x62')]['id'],'ContactId':_0x34d1db['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0xba4f('0xba')}]})[_0xba4f('0x22')](function(_0x43616a){return[_0x43616a,!![]];});});}})[_0xba4f('0xa7')](function(_0x246ac7,_0x3dd6b3){if(_0x3dd6b3){return _0x246ac7;}return db[_0xba4f('0xbb')][_0xba4f('0x60')](_[_0xba4f('0x58')](_0x1976c7['body'],{'read':![],'body':_0x1976c7[_0xba4f('0x61')][_0xba4f('0x61')],'phone':_0x25dc84,'WhatsappAccountId':_0x51502d['id'],'WhatsappInteractionId':_0x246ac7['id'],'UserId':_0x1976c7[_0xba4f('0x62')]['id'],'ContactId':_0x34d1db['id']}))[_0xba4f('0x22')](function(_0x11598b){_0x246ac7[_0xba4f('0xbc')]['Messages']=[];_0x246ac7[_0xba4f('0xbc')][_0xba4f('0xba')][_0xba4f('0xaa')](_0x11598b[_0xba4f('0xbc')]);return _0x246ac7;});})[_0xba4f('0x22')](respondWithResult(_0x2e391c,null))[_0xba4f('0x2d')](handleError(_0x2e391c,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index ba7d488..bf5effd 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 _0x5275=['emit','hook','../../mysqldb','WhatsappAccount','save','update','remove'];(function(_0x4cb824,_0x3a2ccb){var _0x59996=function(_0x526086){while(--_0x526086){_0x4cb824['push'](_0x4cb824['shift']());}};_0x59996(++_0x3a2ccb);}(_0x5275,0x80));var _0x5527=function(_0x49f66e,_0x3e2369){_0x49f66e=_0x49f66e-0x0;var _0x55a1e2=_0x5275[_0x49f66e];return _0x55a1e2;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x5527('0x0'))['db'][_0x5527('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5527('0x2'),'afterUpdate':_0x5527('0x3'),'afterDestroy':_0x5527('0x4')};function emitEvent(_0x2b63aa){return function(_0x5957e0,_0x1c4117,_0x19a5f6){WhatsappAccountEvents[_0x5527('0x5')](_0x2b63aa+':'+_0x5957e0['id'],_0x5957e0);WhatsappAccountEvents[_0x5527('0x5')](_0x2b63aa,_0x5957e0);_0x19a5f6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x5527('0x6')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file +var _0xd474=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','WhatsappAccount','setMaxListeners','save'];(function(_0x3c13b6,_0x2ed9e1){var _0x207bd5=function(_0x32dd4c){while(--_0x32dd4c){_0x3c13b6['push'](_0x3c13b6['shift']());}};_0x207bd5(++_0x2ed9e1);}(_0xd474,0x125));var _0x4d47=function(_0x2b68fc,_0x10362e){_0x2b68fc=_0x2b68fc-0x0;var _0x2e3490=_0xd474[_0x2b68fc];return _0x2e3490;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x4d47('0x0'))['db'][_0x4d47('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x4d47('0x2')](0x0);var events={'afterCreate':_0x4d47('0x3'),'afterUpdate':'update','afterDestroy':_0x4d47('0x4')};function emitEvent(_0x2eb99d){return function(_0x256225,_0x2ad635,_0x5b4284){WhatsappAccountEvents[_0x4d47('0x5')](_0x2eb99d+':'+_0x256225['id'],_0x256225);WhatsappAccountEvents[_0x4d47('0x5')](_0x2eb99d,_0x256225);_0x5b4284(null);};}for(var e in events){if(events[_0x4d47('0x6')](e)){var event=events[e];WhatsappAccount[_0x4d47('0x7')](e,emitEvent(event));}}module[_0x4d47('0x8')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 0a4234b..f345ea0 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 _0x639a=['bluebird','request-promise','path','rimraf','./whatsappAccount.attributes','exports','define','whatsapp_accounts','util','../../config/logger','api','moment'];(function(_0x240362,_0x156794){var _0x26de18=function(_0x4a4431){while(--_0x4a4431){_0x240362['push'](_0x240362['shift']());}};_0x26de18(++_0x156794);}(_0x639a,0x80));var _0xa639=function(_0x9c62d6,_0x22bcba){_0x9c62d6=_0x9c62d6-0x0;var _0x22876c=_0x639a[_0x9c62d6];return _0x22876c;};'use strict';var _=require('lodash');var util=require(_0xa639('0x0'));var logger=require(_0xa639('0x1'))(_0xa639('0x2'));var moment=require(_0xa639('0x3'));var BPromise=require(_0xa639('0x4'));var rp=require(_0xa639('0x5'));var fs=require('fs');var path=require(_0xa639('0x6'));var rimraf=require(_0xa639('0x7'));var config=require('../../config/environment');var attributes=require(_0xa639('0x8'));module[_0xa639('0x9')]=function(_0x1ccd34,_0x18bc3e){return _0x1ccd34[_0xa639('0xa')]('WhatsappAccount',attributes,{'tableName':_0xa639('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x860f=['WhatsappAccount','whatsapp_accounts','lodash','../../config/logger','api','bluebird','request-promise','path','exports'];(function(_0x1b3264,_0x2427e8){var _0x34eed6=function(_0x2c42da){while(--_0x2c42da){_0x1b3264['push'](_0x1b3264['shift']());}};_0x34eed6(++_0x2427e8);}(_0x860f,0x1c4));var _0xf860=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x860f[_0xbb091];return _0x467a04;};'use strict';var _=require(_0xf860('0x0'));var util=require('util');var logger=require(_0xf860('0x1'))(_0xf860('0x2'));var moment=require('moment');var BPromise=require(_0xf860('0x3'));var rp=require(_0xf860('0x4'));var fs=require('fs');var path=require(_0xf860('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./whatsappAccount.attributes');module[_0xf860('0x6')]=function(_0x24a6cc,_0x4d9a10){return _0x24a6cc['define'](_0xf860('0x7'),attributes,{'tableName':_0xf860('0x8'),'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 000a14e..fe09be1 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 _0xef52=['rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappAccount.socket','request','then','info','request\x20sent','stringify','code','WhatsappAccount,\x20%s,\x20%s','error','message','result','catch','ShowWhatsappAccount','WhatsappAccount','options','raw','where','attributes','include','map','model','debug','moment','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x1da600,_0x5b12f1){var _0x3abbef=function(_0x4070cf){while(--_0x4070cf){_0x1da600['push'](_0x1da600['shift']());}};_0x3abbef(++_0x5b12f1);}(_0xef52,0x1c2));var _0x2ef5=function(_0x4706a6,_0x5a1c63){_0x4706a6=_0x4706a6-0x0;var _0x1bb705=_0xef52[_0x4706a6];return _0x1bb705;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2ef5('0x0'));var BPromise=require(_0x2ef5('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2ef5('0x2'));var db=require(_0x2ef5('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2ef5('0x4'))(_0x2ef5('0x5'));var config=require(_0x2ef5('0x6'));var jayson=require(_0x2ef5('0x7'));var client=jayson[_0x2ef5('0x8')][_0x2ef5('0x9')]({'port':0x232a});config[_0x2ef5('0xa')]=_['defaults'](config[_0x2ef5('0xa')],{'host':_0x2ef5('0xb'),'port':0x18eb});var socket=require(_0x2ef5('0xc'))(new Redis(config['redis']));require(_0x2ef5('0xd'))['register'](socket);function respondWithRpcPromise(_0x11e011,_0x2ebee8,_0x535bfd){return new BPromise(function(_0x12c0e6,_0x222784){return client[_0x2ef5('0xe')](_0x11e011,_0x535bfd)[_0x2ef5('0xf')](function(_0x413889){logger[_0x2ef5('0x10')]('WhatsappAccount,\x20%s,\x20%s',_0x2ebee8,_0x2ef5('0x11'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x2ebee8,'request\x20sent',JSON[_0x2ef5('0x12')](_0x413889));if(_0x413889['error']){if(_0x413889['error'][_0x2ef5('0x13')]===0x1f4){logger['error'](_0x2ef5('0x14'),_0x2ebee8,_0x413889[_0x2ef5('0x15')]['message']);return _0x222784(_0x413889[_0x2ef5('0x15')][_0x2ef5('0x16')]);}logger[_0x2ef5('0x15')](_0x2ef5('0x14'),_0x2ebee8,_0x413889[_0x2ef5('0x15')][_0x2ef5('0x16')]);return _0x12c0e6(_0x413889[_0x2ef5('0x15')][_0x2ef5('0x16')]);}else{logger[_0x2ef5('0x10')](_0x2ef5('0x14'),_0x2ebee8,'request\x20sent');_0x12c0e6(_0x413889[_0x2ef5('0x17')][_0x2ef5('0x16')]);}})[_0x2ef5('0x18')](function(_0x5a5b6b){logger[_0x2ef5('0x15')](_0x2ef5('0x14'),_0x2ebee8,_0x5a5b6b);_0x222784(_0x5a5b6b);});});}exports[_0x2ef5('0x19')]=function(_0x351564){var _0x408aee=this;return new Promise(function(_0x27b42f,_0x5a205d){return db[_0x2ef5('0x1a')]['find']({'raw':_0x351564[_0x2ef5('0x1b')]?_0x351564['options'][_0x2ef5('0x1c')]===undefined?!![]:![]:!![],'where':_0x351564[_0x2ef5('0x1b')]?_0x351564[_0x2ef5('0x1b')][_0x2ef5('0x1d')]||null:null,'attributes':_0x351564[_0x2ef5('0x1b')]?_0x351564[_0x2ef5('0x1b')][_0x2ef5('0x1e')]||null:null,'include':_0x351564[_0x2ef5('0x1b')]?_0x351564[_0x2ef5('0x1b')][_0x2ef5('0x1f')]?_[_0x2ef5('0x20')](_0x351564[_0x2ef5('0x1b')][_0x2ef5('0x1f')],function(_0x2e4b6a){return{'model':db[_0x2e4b6a['model']],'as':_0x2e4b6a['as'],'attributes':_0x2e4b6a[_0x2ef5('0x1e')],'include':_0x2e4b6a['include']?_[_0x2ef5('0x20')](_0x2e4b6a[_0x2ef5('0x1f')],function(_0x4405bb){return{'model':db[_0x4405bb[_0x2ef5('0x21')]],'as':_0x4405bb['as'],'attributes':_0x4405bb['attributes'],'include':_0x4405bb[_0x2ef5('0x1f')]?_[_0x2ef5('0x20')](_0x4405bb['include'],function(_0x34c3fa){return{'model':db[_0x34c3fa[_0x2ef5('0x21')]],'as':_0x34c3fa['as'],'attributes':_0x34c3fa[_0x2ef5('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2ef5('0xf')](function(_0x1cf14a){logger[_0x2ef5('0x10')](_0x2ef5('0x19'),_0x351564);logger[_0x2ef5('0x22')]('ShowWhatsappAccount',_0x351564,JSON[_0x2ef5('0x12')](_0x1cf14a));_0x27b42f(_0x1cf14a);})[_0x2ef5('0x18')](function(_0x442c9a){logger[_0x2ef5('0x15')]('ShowWhatsappAccount',_0x442c9a['message'],_0x351564);_0x5a205d(_0x408aee['error'](0x1f4,_0x442c9a[_0x2ef5('0x16')]));});});}; \ No newline at end of file +var _0x1685=['jayson/promise','client','http','redis','localhost','./whatsappAccount.socket','register','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','find','options','raw','where','attributes','include','model','map','ShowWhatsappAccount','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x1685,0x66));var _0x5168=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0x1685[_0x556927];return _0x5f1235;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5168('0x0'));var BPromise=require(_0x5168('0x1'));var rs=require(_0x5168('0x2'));var fs=require('fs');var Redis=require(_0x5168('0x3'));var db=require(_0x5168('0x4'))['db'];var utils=require(_0x5168('0x5'));var logger=require(_0x5168('0x6'))(_0x5168('0x7'));var config=require(_0x5168('0x8'));var jayson=require(_0x5168('0x9'));var client=jayson[_0x5168('0xa')][_0x5168('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x5168('0xc')],{'host':_0x5168('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5168('0xc')]));require(_0x5168('0xe'))[_0x5168('0xf')](socket);function respondWithRpcPromise(_0x2b20ba,_0x58a322,_0x18c5a7){return new BPromise(function(_0xf9d1e7,_0x32a42c){return client[_0x5168('0x10')](_0x2b20ba,_0x18c5a7)[_0x5168('0x11')](function(_0x580a4b){logger['info'](_0x5168('0x12'),_0x58a322,_0x5168('0x13'));logger[_0x5168('0x14')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x58a322,_0x5168('0x13'),JSON[_0x5168('0x15')](_0x580a4b));if(_0x580a4b[_0x5168('0x16')]){if(_0x580a4b[_0x5168('0x16')][_0x5168('0x17')]===0x1f4){logger[_0x5168('0x16')](_0x5168('0x12'),_0x58a322,_0x580a4b[_0x5168('0x16')][_0x5168('0x18')]);return _0x32a42c(_0x580a4b['error']['message']);}logger['error'](_0x5168('0x12'),_0x58a322,_0x580a4b[_0x5168('0x16')]['message']);return _0xf9d1e7(_0x580a4b['error'][_0x5168('0x18')]);}else{logger[_0x5168('0x19')]('WhatsappAccount,\x20%s,\x20%s',_0x58a322,_0x5168('0x13'));_0xf9d1e7(_0x580a4b[_0x5168('0x1a')][_0x5168('0x18')]);}})['catch'](function(_0x3c94d9){logger[_0x5168('0x16')](_0x5168('0x12'),_0x58a322,_0x3c94d9);_0x32a42c(_0x3c94d9);});});}exports['ShowWhatsappAccount']=function(_0x39832e){var _0x170953=this;return new Promise(function(_0x262619,_0x507349){return db['WhatsappAccount'][_0x5168('0x1b')]({'raw':_0x39832e[_0x5168('0x1c')]?_0x39832e['options'][_0x5168('0x1d')]===undefined?!![]:![]:!![],'where':_0x39832e[_0x5168('0x1c')]?_0x39832e[_0x5168('0x1c')][_0x5168('0x1e')]||null:null,'attributes':_0x39832e[_0x5168('0x1c')]?_0x39832e[_0x5168('0x1c')][_0x5168('0x1f')]||null:null,'include':_0x39832e[_0x5168('0x1c')]?_0x39832e[_0x5168('0x1c')][_0x5168('0x20')]?_['map'](_0x39832e[_0x5168('0x1c')][_0x5168('0x20')],function(_0x16f71b){return{'model':db[_0x16f71b[_0x5168('0x21')]],'as':_0x16f71b['as'],'attributes':_0x16f71b['attributes'],'include':_0x16f71b[_0x5168('0x20')]?_[_0x5168('0x22')](_0x16f71b[_0x5168('0x20')],function(_0x35fbe6){return{'model':db[_0x35fbe6[_0x5168('0x21')]],'as':_0x35fbe6['as'],'attributes':_0x35fbe6[_0x5168('0x1f')],'include':_0x35fbe6[_0x5168('0x20')]?_[_0x5168('0x22')](_0x35fbe6[_0x5168('0x20')],function(_0x1ff805){return{'model':db[_0x1ff805[_0x5168('0x21')]],'as':_0x1ff805['as'],'attributes':_0x1ff805[_0x5168('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x393561){logger[_0x5168('0x19')]('ShowWhatsappAccount',_0x39832e);logger[_0x5168('0x14')](_0x5168('0x23'),_0x39832e,JSON[_0x5168('0x15')](_0x393561));_0x262619(_0x393561);})[_0x5168('0x24')](function(_0x170bd1){logger[_0x5168('0x16')]('ShowWhatsappAccount',_0x170bd1[_0x5168('0x18')],_0x39832e);_0x507349(_0x170953[_0x5168('0x16')](0x1f4,_0x170bd1['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 5f97202..ff5f8f9 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 _0x58d5=['emit','removeListener','register','length','whatsappAccount:','./whatsappAccount.events','save','remove','update'];(function(_0x3ef830,_0x20f402){var _0x434b82=function(_0x103987){while(--_0x103987){_0x3ef830['push'](_0x3ef830['shift']());}};_0x434b82(++_0x20f402);}(_0x58d5,0x1d9));var _0x558d=function(_0x56ec07,_0x56a55f){_0x56ec07=_0x56ec07-0x0;var _0x3ce6f7=_0x58d5[_0x56ec07];return _0x3ce6f7;};'use strict';var WhatsappAccountEvents=require(_0x558d('0x0'));var events=[_0x558d('0x1'),_0x558d('0x2'),_0x558d('0x3')];function createListener(_0x5f32cc,_0x3bde25){return function(_0x3e33f0){_0x3bde25[_0x558d('0x4')](_0x5f32cc,_0x3e33f0);};}function removeListener(_0x2169c8,_0x4675a0){return function(){WhatsappAccountEvents[_0x558d('0x5')](_0x2169c8,_0x4675a0);};}exports[_0x558d('0x6')]=function(_0x480143){for(var _0x20ddb0=0x0,_0x313ed6=events[_0x558d('0x7')];_0x20ddb0<_0x313ed6;_0x20ddb0++){var _0x33485=events[_0x20ddb0];var _0x2f35f3=createListener(_0x558d('0x8')+_0x33485,_0x480143);WhatsappAccountEvents['on'](_0x33485,_0x2f35f3);}}; \ No newline at end of file +var _0xf743=['whatsappAccount:','./whatsappAccount.events','remove','update','emit','length'];(function(_0x2307fa,_0x266e5e){var _0x496486=function(_0x53466e){while(--_0x53466e){_0x2307fa['push'](_0x2307fa['shift']());}};_0x496486(++_0x266e5e);}(_0xf743,0x1e1));var _0x3f74=function(_0x286f8b,_0x30720e){_0x286f8b=_0x286f8b-0x0;var _0x58e705=_0xf743[_0x286f8b];return _0x58e705;};'use strict';var WhatsappAccountEvents=require(_0x3f74('0x0'));var events=['save',_0x3f74('0x1'),_0x3f74('0x2')];function createListener(_0xca7e3e,_0x51848e){return function(_0x4d48f8){_0x51848e[_0x3f74('0x3')](_0xca7e3e,_0x4d48f8);};}function removeListener(_0x4c8bdb,_0x579e87){return function(){WhatsappAccountEvents['removeListener'](_0x4c8bdb,_0x579e87);};}exports['register']=function(_0xd5194f){for(var _0x5e0fb9=0x0,_0x40b255=events[_0x3f74('0x4')];_0x5e0fb9<_0x40b255;_0x5e0fb9++){var _0x111139=events[_0x5e0fb9];var _0x3cc92d=createListener(_0x3f74('0x5')+_0x111139,_0xd5194f);WhatsappAccountEvents['on'](_0x111139,_0x3cc92d);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 77abf69..570713e 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 _0x545b=['/:id','show','create','put','update','multer','path','express','Router','fs-extra','../../components/interaction/service','./whatsappApplication.controller','get','isAuthenticated','index'];(function(_0x418b24,_0x37a5bb){var _0xe6741a=function(_0x2b53f0){while(--_0x2b53f0){_0x418b24['push'](_0x418b24['shift']());}};_0xe6741a(++_0x37a5bb);}(_0x545b,0x19a));var _0xb545=function(_0x33b62d,_0x507d01){_0x33b62d=_0x33b62d-0x0;var _0x215d79=_0x545b[_0x33b62d];return _0x215d79;};'use strict';var multer=require(_0xb545('0x0'));var util=require('util');var path=require(_0xb545('0x1'));var timeout=require('connect-timeout');var express=require(_0xb545('0x2'));var router=express[_0xb545('0x3')]();var fs_extra=require(_0xb545('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb545('0x5'));var config=require('../../config/environment');var controller=require(_0xb545('0x6'));router[_0xb545('0x7')]('/',auth[_0xb545('0x8')](),controller[_0xb545('0x9')]);router[_0xb545('0x7')](_0xb545('0xa'),auth[_0xb545('0x8')](),controller[_0xb545('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb545('0xc')]);router[_0xb545('0xd')](_0xb545('0xa'),auth['isAuthenticated'](),controller[_0xb545('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5795=['/:id','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','show','post','create','put','update','delete'];(function(_0x112e2a,_0x364486){var _0x4f8af9=function(_0xa11c0d){while(--_0xa11c0d){_0x112e2a['push'](_0x112e2a['shift']());}};_0x4f8af9(++_0x364486);}(_0x5795,0x1b8));var _0x5579=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x5795[_0x2dea24];return _0x309d58;};'use strict';var multer=require(_0x5579('0x0'));var util=require(_0x5579('0x1'));var path=require(_0x5579('0x2'));var timeout=require('connect-timeout');var express=require(_0x5579('0x3'));var router=express[_0x5579('0x4')]();var fs_extra=require(_0x5579('0x5'));var auth=require(_0x5579('0x6'));var interaction=require(_0x5579('0x7'));var config=require('../../config/environment');var controller=require('./whatsappApplication.controller');router[_0x5579('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x5579('0x9')](),controller[_0x5579('0xa')]);router[_0x5579('0xb')]('/',auth[_0x5579('0x9')](),controller[_0x5579('0xc')]);router[_0x5579('0xd')]('/:id',auth[_0x5579('0x9')](),controller[_0x5579('0xe')]);router[_0x5579('0xf')](_0x5579('0x10'),auth[_0x5579('0x9')](),controller[_0x5579('0x11')]);module[_0x5579('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 8743c48..a0b96c2 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 _0x95ae=['noop','STRING','sequelize','exports'];(function(_0x2c366f,_0x1bd4f8){var _0x180634=function(_0x5dcd2c){while(--_0x5dcd2c){_0x2c366f['push'](_0x2c366f['shift']());}};_0x180634(++_0x1bd4f8);}(_0x95ae,0x16e));var _0xe95a=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x95ae[_0x1203f];return _0x365f0a;};'use strict';var Sequelize=require(_0xe95a('0x0'));module[_0xe95a('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe95a('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xe95a('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xca7b=['noop','TEXT','*,*,*,*','sequelize','INTEGER','STRING'];(function(_0x45bf7d,_0x5c58c3){var _0x5d43b0=function(_0x491aef){while(--_0x491aef){_0x45bf7d['push'](_0x45bf7d['shift']());}};_0x5d43b0(++_0x5c58c3);}(_0xca7b,0xc3));var _0xbca7=function(_0x243b80,_0x75a1d2){_0x243b80=_0x243b80-0x0;var _0x4c448a=_0xca7b[_0x243b80];return _0x4c448a;};'use strict';var Sequelize=require(_0xbca7('0x0'));module['exports']={'priority':{'type':Sequelize[_0xbca7('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xbca7('0x2')],'allowNull':![],'defaultValue':_0xbca7('0x3')},'appdata':{'type':Sequelize[_0xbca7('0x4')]()},'description':{'type':Sequelize[_0xbca7('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xbca7('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index f1532ad..5daaeca 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 _0x761c=['Content-Range','reject','save','update','then','destroy','error','name','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','includeAll','include','rows','catch','show','params','options','create','body','find','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set'];(function(_0x47eaa3,_0x19cfd6){var _0x4597f8=function(_0x1bac88){while(--_0x1bac88){_0x47eaa3['push'](_0x47eaa3['shift']());}};_0x4597f8(++_0x19cfd6);}(_0x761c,0x18a));var _0xc761=function(_0x3626e7,_0x40d2e6){_0x3626e7=_0x3626e7-0x0;var _0x54a938=_0x761c[_0x3626e7];return _0x54a938;};'use strict';var emlformat=require(_0xc761('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc761('0x1'));var jsonpatch=require(_0xc761('0x2'));var rp=require('request-promise');var moment=require(_0xc761('0x3'));var BPromise=require(_0xc761('0x4'));var Mustache=require(_0xc761('0x5'));var util=require('util');var path=require(_0xc761('0x6'));var sox=require('sox');var csv=require(_0xc761('0x7'));var ejs=require(_0xc761('0x8'));var fs=require('fs');var fs_extra=require(_0xc761('0x9'));var _=require(_0xc761('0xa'));var squel=require(_0xc761('0xb'));var crypto=require(_0xc761('0xc'));var jsforce=require(_0xc761('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc761('0x7'));var querystring=require(_0xc761('0xe'));var Papa=require(_0xc761('0xf'));var Redis=require(_0xc761('0x10'));var authService=require(_0xc761('0x11'));var qs=require(_0xc761('0x12'));var as=require(_0xc761('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc761('0x14'));var utils=require(_0xc761('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc761('0x16'))['db'];function respondWithStatusCode(_0x47a712,_0x1444ff){_0x1444ff=_0x1444ff||0xcc;return function(_0x54dc3e){if(_0x54dc3e){return _0x47a712[_0xc761('0x17')](_0x1444ff);}return _0x47a712['status'](_0x1444ff)[_0xc761('0x18')]();};}function respondWithResult(_0x2fb125,_0x186315){_0x186315=_0x186315||0xc8;return function(_0x31cc11){if(_0x31cc11){return _0x2fb125[_0xc761('0x19')](_0x186315)[_0xc761('0x1a')](_0x31cc11);}};}function respondWithFilteredResult(_0x21384f,_0x5d83cc){return function(_0x4c487e){if(_0x4c487e){var _0x32d276=typeof _0x5d83cc[_0xc761('0x1b')]===_0xc761('0x1c')&&typeof _0x5d83cc['limit']===_0xc761('0x1c');var _0xdfc44c=_0x4c487e[_0xc761('0x1d')];var _0x281750=_0x32d276?0x0:_0x5d83cc[_0xc761('0x1b')];var _0x5939ee=_0x32d276?_0x4c487e['count']:_0x5d83cc[_0xc761('0x1b')]+_0x5d83cc[_0xc761('0x1e')];var _0x5dfd75;if(_0x5939ee>=_0xdfc44c){_0x5939ee=_0xdfc44c;_0x5dfd75=0xc8;}else{_0x5dfd75=0xce;}_0x21384f['status'](_0x5dfd75);return _0x21384f[_0xc761('0x1f')](_0xc761('0x20'),_0x281750+'-'+_0x5939ee+'/'+_0xdfc44c)[_0xc761('0x1a')](_0x4c487e);}return null;};}function patchUpdates(_0x4ba60c){return function(_0x637d5e){try{jsonpatch['apply'](_0x637d5e,_0x4ba60c,!![]);}catch(_0x2863a9){return BPromise[_0xc761('0x21')](_0x2863a9);}return _0x637d5e[_0xc761('0x22')]();};}function saveUpdates(_0x31b014,_0xb27b65){return function(_0x51eeba){if(_0x51eeba){return _0x51eeba[_0xc761('0x23')](_0x31b014)[_0xc761('0x24')](function(_0xb48d6b){return _0xb48d6b;});}return null;};}function removeEntity(_0x13a002,_0x47c0d9){return function(_0x5a4b77){if(_0x5a4b77){return _0x5a4b77[_0xc761('0x25')]()[_0xc761('0x24')](function(){_0x13a002[_0xc761('0x19')](0xcc)[_0xc761('0x18')]();});}};}function handleEntityNotFound(_0x2a8b01,_0x3728bd){return function(_0x2909ce){if(!_0x2909ce){_0x2a8b01[_0xc761('0x17')](0x194);}return _0x2909ce;};}function handleError(_0x4a7690,_0x362dbb){_0x362dbb=_0x362dbb||0x1f4;return function(_0x475e24){logger[_0xc761('0x26')](_0x475e24['stack']);if(_0x475e24['name']){delete _0x475e24[_0xc761('0x27')];}_0x4a7690[_0xc761('0x19')](_0x362dbb)['send'](_0x475e24);};}exports[_0xc761('0x28')]=function(_0x5f2655,_0x43c0fd){var _0x54f031={},_0x47eda8={},_0x53b615={'count':0x0,'rows':[]};var _0x1e713e=_[_0xc761('0x29')](db[_0xc761('0x2a')][_0xc761('0x2b')],function(_0x58b80a){return{'name':_0x58b80a[_0xc761('0x2c')],'type':_0x58b80a[_0xc761('0x2d')][_0xc761('0x2e')]};});_0x47eda8[_0xc761('0x2f')]=_[_0xc761('0x29')](_0x1e713e,'name');_0x47eda8[_0xc761('0x30')]=_[_0xc761('0x31')](_0x5f2655[_0xc761('0x30')]);_0x47eda8[_0xc761('0x32')]=_[_0xc761('0x33')](_0x47eda8[_0xc761('0x2f')],_0x47eda8[_0xc761('0x30')]);_0x54f031[_0xc761('0x34')]=_[_0xc761('0x33')](_0x47eda8[_0xc761('0x2f')],qs['fields'](_0x5f2655[_0xc761('0x30')][_0xc761('0x35')]));_0x54f031['attributes']=_0x54f031['attributes'][_0xc761('0x36')]?_0x54f031[_0xc761('0x34')]:_0x47eda8[_0xc761('0x2f')];if(!_0x5f2655['query']['hasOwnProperty']('nolimit')){_0x54f031[_0xc761('0x1e')]=qs[_0xc761('0x1e')](_0x5f2655[_0xc761('0x30')][_0xc761('0x1e')]);_0x54f031['offset']=qs[_0xc761('0x1b')](_0x5f2655['query']['offset']);}_0x54f031[_0xc761('0x37')]=qs[_0xc761('0x38')](_0x5f2655[_0xc761('0x30')]['sort']);_0x54f031[_0xc761('0x39')]=qs[_0xc761('0x32')](_[_0xc761('0x3a')](_0x5f2655['query'],_0x47eda8[_0xc761('0x32')]),_0x1e713e);if(_0x5f2655[_0xc761('0x30')][_0xc761('0x3b')]){_0x54f031['where']=_[_0xc761('0x3c')](_0x54f031[_0xc761('0x39')],{'$or':_['map'](_0x1e713e,function(_0x42c7ae){if(_0x42c7ae['type']!=='VIRTUAL'){var _0x12b715={};_0x12b715[_0x42c7ae[_0xc761('0x27')]]={'$like':'%'+_0x5f2655[_0xc761('0x30')][_0xc761('0x3b')]+'%'};return _0x12b715;}})});}_0x54f031=_['merge']({},_0x54f031,_0x5f2655['options']);var _0x3ac3cc={'where':_0x54f031[_0xc761('0x39')]};return db[_0xc761('0x2a')][_0xc761('0x1d')](_0x3ac3cc)[_0xc761('0x24')](function(_0x3ad04b){_0x53b615['count']=_0x3ad04b;if(_0x5f2655[_0xc761('0x30')][_0xc761('0x3d')]){_0x54f031[_0xc761('0x3e')]=[{'all':!![]}];}return db[_0xc761('0x2a')]['findAll'](_0x54f031);})['then'](function(_0x19d777){_0x53b615[_0xc761('0x3f')]=_0x19d777;return _0x53b615;})['then'](respondWithFilteredResult(_0x43c0fd,_0x54f031))[_0xc761('0x40')](handleError(_0x43c0fd,null));};exports[_0xc761('0x41')]=function(_0x3ba0a4,_0xd95f13){var _0x4395cb={'raw':!![],'where':{'id':_0x3ba0a4[_0xc761('0x42')]['id']}},_0x55546e={};_0x55546e[_0xc761('0x2f')]=_[_0xc761('0x31')](db['WhatsappApplication'][_0xc761('0x2b')]);_0x55546e['query']=_['keys'](_0x3ba0a4['query']);_0x55546e[_0xc761('0x32')]=_[_0xc761('0x33')](_0x55546e['model'],_0x55546e[_0xc761('0x30')]);_0x4395cb[_0xc761('0x34')]=_[_0xc761('0x33')](_0x55546e[_0xc761('0x2f')],qs[_0xc761('0x35')](_0x3ba0a4['query'][_0xc761('0x35')]));_0x4395cb[_0xc761('0x34')]=_0x4395cb[_0xc761('0x34')][_0xc761('0x36')]?_0x4395cb[_0xc761('0x34')]:_0x55546e[_0xc761('0x2f')];if(_0x3ba0a4[_0xc761('0x30')][_0xc761('0x3d')]){_0x4395cb[_0xc761('0x3e')]=[{'all':!![]}];}_0x4395cb=_[_0xc761('0x3c')]({},_0x4395cb,_0x3ba0a4[_0xc761('0x43')]);return db[_0xc761('0x2a')]['find'](_0x4395cb)[_0xc761('0x24')](handleEntityNotFound(_0xd95f13,null))['then'](respondWithResult(_0xd95f13,null))['catch'](handleError(_0xd95f13,null));};exports[_0xc761('0x44')]=function(_0x8f4ad6,_0x232d8b){return db['WhatsappApplication']['create'](_0x8f4ad6[_0xc761('0x45')],{})[_0xc761('0x24')](respondWithResult(_0x232d8b,0xc9))['catch'](handleError(_0x232d8b,null));};exports[_0xc761('0x23')]=function(_0x4bdef6,_0x5f1062){if(_0x4bdef6['body']['id']){delete _0x4bdef6['body']['id'];}return db[_0xc761('0x2a')][_0xc761('0x46')]({'where':{'id':_0x4bdef6[_0xc761('0x42')]['id']}})[_0xc761('0x24')](handleEntityNotFound(_0x5f1062,null))[_0xc761('0x24')](saveUpdates(_0x4bdef6[_0xc761('0x45')],null))[_0xc761('0x24')](respondWithResult(_0x5f1062,null))['catch'](handleError(_0x5f1062,null));};exports['destroy']=function(_0x5aafc2,_0x5f229d){return db[_0xc761('0x2a')][_0xc761('0x46')]({'where':{'id':_0x5aafc2[_0xc761('0x42')]['id']}})[_0xc761('0x24')](handleEntityNotFound(_0x5f229d,null))[_0xc761('0x24')](removeEntity(_0x5f229d,null))['catch'](handleError(_0x5f229d,null));}; \ No newline at end of file +var _0x46cb=['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','apply','reject','save','update','then','end','error','stack','name','send','index','WhatsappApplication','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','rows','catch','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce'];(function(_0x3979d4,_0x2f816f){var _0x381f3c=function(_0x3d5408){while(--_0x3d5408){_0x3979d4['push'](_0x3979d4['shift']());}};_0x381f3c(++_0x2f816f);}(_0x46cb,0x84));var _0xb46c=function(_0x5cb71a,_0x263bdf){_0x5cb71a=_0x5cb71a-0x0;var _0x3f380f=_0x46cb[_0x5cb71a];return _0x3f380f;};'use strict';var emlformat=require(_0xb46c('0x0'));var rimraf=require(_0xb46c('0x1'));var zipdir=require(_0xb46c('0x2'));var jsonpatch=require(_0xb46c('0x3'));var rp=require('request-promise');var moment=require(_0xb46c('0x4'));var BPromise=require(_0xb46c('0x5'));var Mustache=require(_0xb46c('0x6'));var util=require(_0xb46c('0x7'));var path=require('path');var sox=require(_0xb46c('0x8'));var csv=require(_0xb46c('0x9'));var ejs=require(_0xb46c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb46c('0xb'));var squel=require('squel');var crypto=require(_0xb46c('0xc'));var jsforce=require(_0xb46c('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb46c('0xe'));var Papa=require(_0xb46c('0xf'));var Redis=require(_0xb46c('0x10'));var authService=require(_0xb46c('0x11'));var qs=require(_0xb46c('0x12'));var as=require(_0xb46c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb46c('0x14'))(_0xb46c('0x15'));var utils=require(_0xb46c('0x16'));var config=require(_0xb46c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb46c('0x18'))['db'];function respondWithStatusCode(_0x3059da,_0x1dd251){_0x1dd251=_0x1dd251||0xcc;return function(_0x4a3399){if(_0x4a3399){return _0x3059da[_0xb46c('0x19')](_0x1dd251);}return _0x3059da[_0xb46c('0x1a')](_0x1dd251)['end']();};}function respondWithResult(_0x18f1d0,_0x213f4a){_0x213f4a=_0x213f4a||0xc8;return function(_0x967278){if(_0x967278){return _0x18f1d0[_0xb46c('0x1a')](_0x213f4a)[_0xb46c('0x1b')](_0x967278);}};}function respondWithFilteredResult(_0x45c3e1,_0x172bb8){return function(_0x5d431b){if(_0x5d431b){var _0xe4261a=typeof _0x172bb8[_0xb46c('0x1c')]===_0xb46c('0x1d')&&typeof _0x172bb8[_0xb46c('0x1e')]===_0xb46c('0x1d');var _0x2437a0=_0x5d431b['count'];var _0x572860=_0xe4261a?0x0:_0x172bb8[_0xb46c('0x1c')];var _0x4c7ef6=_0xe4261a?_0x5d431b[_0xb46c('0x1f')]:_0x172bb8[_0xb46c('0x1c')]+_0x172bb8[_0xb46c('0x1e')];var _0x32ade3;if(_0x4c7ef6>=_0x2437a0){_0x4c7ef6=_0x2437a0;_0x32ade3=0xc8;}else{_0x32ade3=0xce;}_0x45c3e1['status'](_0x32ade3);return _0x45c3e1[_0xb46c('0x20')]('Content-Range',_0x572860+'-'+_0x4c7ef6+'/'+_0x2437a0)['json'](_0x5d431b);}return null;};}function patchUpdates(_0x87d31d){return function(_0x1b8c8d){try{jsonpatch[_0xb46c('0x21')](_0x1b8c8d,_0x87d31d,!![]);}catch(_0x43ae7c){return BPromise[_0xb46c('0x22')](_0x43ae7c);}return _0x1b8c8d[_0xb46c('0x23')]();};}function saveUpdates(_0x5f3cfb,_0x4d68b1){return function(_0x184038){if(_0x184038){return _0x184038[_0xb46c('0x24')](_0x5f3cfb)[_0xb46c('0x25')](function(_0x11b121){return _0x11b121;});}return null;};}function removeEntity(_0x1e40ed,_0x2b4412){return function(_0x8d71cd){if(_0x8d71cd){return _0x8d71cd['destroy']()[_0xb46c('0x25')](function(){_0x1e40ed[_0xb46c('0x1a')](0xcc)[_0xb46c('0x26')]();});}};}function handleEntityNotFound(_0x47960b,_0x4e822a){return function(_0x20fc36){if(!_0x20fc36){_0x47960b[_0xb46c('0x19')](0x194);}return _0x20fc36;};}function handleError(_0x3ff2a6,_0x2585c6){_0x2585c6=_0x2585c6||0x1f4;return function(_0x463a71){logger[_0xb46c('0x27')](_0x463a71[_0xb46c('0x28')]);if(_0x463a71[_0xb46c('0x29')]){delete _0x463a71[_0xb46c('0x29')];}_0x3ff2a6[_0xb46c('0x1a')](_0x2585c6)[_0xb46c('0x2a')](_0x463a71);};}exports[_0xb46c('0x2b')]=function(_0x4220a9,_0x2c8956){var _0x3cd6e0={},_0x3fab04={},_0x56310b={'count':0x0,'rows':[]};var _0x2412a7=_['map'](db[_0xb46c('0x2c')]['rawAttributes'],function(_0x4dd0bd){return{'name':_0x4dd0bd[_0xb46c('0x2d')],'type':_0x4dd0bd[_0xb46c('0x2e')][_0xb46c('0x2f')]};});_0x3fab04[_0xb46c('0x30')]=_['map'](_0x2412a7,_0xb46c('0x29'));_0x3fab04[_0xb46c('0x31')]=_[_0xb46c('0x32')](_0x4220a9['query']);_0x3fab04[_0xb46c('0x33')]=_['intersection'](_0x3fab04[_0xb46c('0x30')],_0x3fab04['query']);_0x3cd6e0[_0xb46c('0x34')]=_[_0xb46c('0x35')](_0x3fab04[_0xb46c('0x30')],qs[_0xb46c('0x36')](_0x4220a9[_0xb46c('0x31')][_0xb46c('0x36')]));_0x3cd6e0[_0xb46c('0x34')]=_0x3cd6e0[_0xb46c('0x34')][_0xb46c('0x37')]?_0x3cd6e0[_0xb46c('0x34')]:_0x3fab04[_0xb46c('0x30')];if(!_0x4220a9[_0xb46c('0x31')]['hasOwnProperty'](_0xb46c('0x38'))){_0x3cd6e0[_0xb46c('0x1e')]=qs['limit'](_0x4220a9['query']['limit']);_0x3cd6e0['offset']=qs[_0xb46c('0x1c')](_0x4220a9['query'][_0xb46c('0x1c')]);}_0x3cd6e0[_0xb46c('0x39')]=qs[_0xb46c('0x3a')](_0x4220a9[_0xb46c('0x31')]['sort']);_0x3cd6e0[_0xb46c('0x3b')]=qs[_0xb46c('0x33')](_['pick'](_0x4220a9[_0xb46c('0x31')],_0x3fab04[_0xb46c('0x33')]),_0x2412a7);if(_0x4220a9['query'][_0xb46c('0x3c')]){_0x3cd6e0['where']=_[_0xb46c('0x3d')](_0x3cd6e0[_0xb46c('0x3b')],{'$or':_[_0xb46c('0x3e')](_0x2412a7,function(_0x302580){if(_0x302580['type']!==_0xb46c('0x3f')){var _0x4c9db1={};_0x4c9db1[_0x302580[_0xb46c('0x29')]]={'$like':'%'+_0x4220a9[_0xb46c('0x31')]['filter']+'%'};return _0x4c9db1;}})});}_0x3cd6e0=_[_0xb46c('0x3d')]({},_0x3cd6e0,_0x4220a9[_0xb46c('0x40')]);var _0xfa2a48={'where':_0x3cd6e0['where']};return db['WhatsappApplication'][_0xb46c('0x1f')](_0xfa2a48)[_0xb46c('0x25')](function(_0x4e4169){_0x56310b[_0xb46c('0x1f')]=_0x4e4169;if(_0x4220a9['query'][_0xb46c('0x41')]){_0x3cd6e0[_0xb46c('0x42')]=[{'all':!![]}];}return db['WhatsappApplication']['findAll'](_0x3cd6e0);})[_0xb46c('0x25')](function(_0x1c38fe){_0x56310b[_0xb46c('0x43')]=_0x1c38fe;return _0x56310b;})[_0xb46c('0x25')](respondWithFilteredResult(_0x2c8956,_0x3cd6e0))[_0xb46c('0x44')](handleError(_0x2c8956,null));};exports['show']=function(_0x1b9af7,_0x7e15f3){var _0x4fd0d9={'raw':!![],'where':{'id':_0x1b9af7['params']['id']}},_0x20d2e5={};_0x20d2e5[_0xb46c('0x30')]=_[_0xb46c('0x32')](db[_0xb46c('0x2c')]['rawAttributes']);_0x20d2e5[_0xb46c('0x31')]=_['keys'](_0x1b9af7[_0xb46c('0x31')]);_0x20d2e5[_0xb46c('0x33')]=_[_0xb46c('0x35')](_0x20d2e5[_0xb46c('0x30')],_0x20d2e5[_0xb46c('0x31')]);_0x4fd0d9[_0xb46c('0x34')]=_[_0xb46c('0x35')](_0x20d2e5['model'],qs[_0xb46c('0x36')](_0x1b9af7['query'][_0xb46c('0x36')]));_0x4fd0d9[_0xb46c('0x34')]=_0x4fd0d9['attributes'][_0xb46c('0x37')]?_0x4fd0d9[_0xb46c('0x34')]:_0x20d2e5[_0xb46c('0x30')];if(_0x1b9af7['query']['includeAll']){_0x4fd0d9['include']=[{'all':!![]}];}_0x4fd0d9=_['merge']({},_0x4fd0d9,_0x1b9af7['options']);return db[_0xb46c('0x2c')][_0xb46c('0x45')](_0x4fd0d9)[_0xb46c('0x25')](handleEntityNotFound(_0x7e15f3,null))[_0xb46c('0x25')](respondWithResult(_0x7e15f3,null))[_0xb46c('0x44')](handleError(_0x7e15f3,null));};exports[_0xb46c('0x46')]=function(_0x40ca97,_0x44b792){return db[_0xb46c('0x2c')][_0xb46c('0x46')](_0x40ca97['body'],{})[_0xb46c('0x25')](respondWithResult(_0x44b792,0xc9))[_0xb46c('0x44')](handleError(_0x44b792,null));};exports['update']=function(_0x4db28a,_0x63d0d6){if(_0x4db28a['body']['id']){delete _0x4db28a[_0xb46c('0x47')]['id'];}return db[_0xb46c('0x2c')][_0xb46c('0x45')]({'where':{'id':_0x4db28a[_0xb46c('0x48')]['id']}})[_0xb46c('0x25')](handleEntityNotFound(_0x63d0d6,null))[_0xb46c('0x25')](saveUpdates(_0x4db28a[_0xb46c('0x47')],null))[_0xb46c('0x25')](respondWithResult(_0x63d0d6,null))[_0xb46c('0x44')](handleError(_0x63d0d6,null));};exports['destroy']=function(_0x1e0ffe,_0x841649){return db[_0xb46c('0x2c')][_0xb46c('0x45')]({'where':{'id':_0x1e0ffe[_0xb46c('0x48')]['id']}})[_0xb46c('0x25')](handleEntityNotFound(_0x841649,null))[_0xb46c('0x25')](removeEntity(_0x841649,null))[_0xb46c('0x44')](handleError(_0x841649,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 610efa7..5e8e6b3 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 _0x64f5=['path','../../config/environment','./whatsappApplication.attributes','exports','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','moment','request-promise'];(function(_0x25701b,_0x2a6976){var _0x3a8a2c=function(_0x1a5e78){while(--_0x1a5e78){_0x25701b['push'](_0x25701b['shift']());}};_0x3a8a2c(++_0x2a6976);}(_0x64f5,0x17e));var _0x564f=function(_0x1b6948,_0x3f7cdf){_0x1b6948=_0x1b6948-0x0;var _0x20133c=_0x64f5[_0x1b6948];return _0x20133c;};'use strict';var _=require(_0x564f('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x564f('0x1'));var BPromise=require('bluebird');var rp=require(_0x564f('0x2'));var fs=require('fs');var path=require(_0x564f('0x3'));var rimraf=require('rimraf');var config=require(_0x564f('0x4'));var attributes=require(_0x564f('0x5'));module[_0x564f('0x6')]=function(_0x72b009,_0x4bbedf){return _0x72b009['define'](_0x564f('0x7'),attributes,{'tableName':_0x564f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x564f('0x9'),'collate':_0x564f('0xa')});}; \ No newline at end of file +var _0x7217=['../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x8abd64,_0x539570){var _0xd2511e=function(_0x9fef7d){while(--_0x9fef7d){_0x8abd64['push'](_0x8abd64['shift']());}};_0xd2511e(++_0x539570);}(_0x7217,0x19e));var _0x7721=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0x7217[_0x4e1d03];return _0x362d4b;};'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':!![],'charset':_0x7721('0xc'),'collate':_0x7721('0xd')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index ce32bbc..412d5e8 100644 --- a/server/api/whatsappApplication/whatsappApplication.rpc.js +++ b/server/api/whatsappApplication/whatsappApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd28=['error','code','message','info','result','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','WhatsappApplication,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x58df2b,_0x263f67){var _0x3f30fd=function(_0x4c1fe8){while(--_0x4c1fe8){_0x58df2b['push'](_0x58df2b['shift']());}};_0x3f30fd(++_0x263f67);}(_0xfd28,0x148));var _0x8fd2=function(_0x57d13b,_0x52d8cb){_0x57d13b=_0x57d13b-0x0;var _0x467696=_0xfd28[_0x57d13b];return _0x467696;};'use strict';var _=require('lodash');var util=require(_0x8fd2('0x0'));var moment=require(_0x8fd2('0x1'));var BPromise=require('bluebird');var rs=require(_0x8fd2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8fd2('0x3'))['db'];var utils=require(_0x8fd2('0x4'));var logger=require(_0x8fd2('0x5'))('rpc');var config=require(_0x8fd2('0x6'));var jayson=require(_0x8fd2('0x7'));var client=jayson[_0x8fd2('0x8')][_0x8fd2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f0afc,_0x4bdc1a,_0x53d938){return new BPromise(function(_0x10fccf,_0x466c3d){return client[_0x8fd2('0xa')](_0x2f0afc,_0x53d938)['then'](function(_0x13cc69){logger['info'](_0x8fd2('0xb'),_0x4bdc1a,'request\x20sent');logger[_0x8fd2('0xc')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x4bdc1a,_0x8fd2('0xd'),JSON['stringify'](_0x13cc69));if(_0x13cc69[_0x8fd2('0xe')]){if(_0x13cc69['error'][_0x8fd2('0xf')]===0x1f4){logger[_0x8fd2('0xe')](_0x8fd2('0xb'),_0x4bdc1a,_0x13cc69[_0x8fd2('0xe')][_0x8fd2('0x10')]);return _0x466c3d(_0x13cc69[_0x8fd2('0xe')][_0x8fd2('0x10')]);}logger[_0x8fd2('0xe')](_0x8fd2('0xb'),_0x4bdc1a,_0x13cc69[_0x8fd2('0xe')][_0x8fd2('0x10')]);return _0x10fccf(_0x13cc69[_0x8fd2('0xe')][_0x8fd2('0x10')]);}else{logger[_0x8fd2('0x11')](_0x8fd2('0xb'),_0x4bdc1a,'request\x20sent');_0x10fccf(_0x13cc69[_0x8fd2('0x12')]['message']);}})['catch'](function(_0x56f75d){logger[_0x8fd2('0xe')](_0x8fd2('0xb'),_0x4bdc1a,_0x56f75d);_0x466c3d(_0x56f75d);});});} \ No newline at end of file +var _0x24ca=['request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s'];(function(_0x2a1866,_0x3f8038){var _0x604541=function(_0x77e5eb){while(--_0x77e5eb){_0x2a1866['push'](_0x2a1866['shift']());}};_0x604541(++_0x3f8038);}(_0x24ca,0x1bc));var _0xa24c=function(_0x5ce3c8,_0x2503bd){_0x5ce3c8=_0x5ce3c8-0x0;var _0xa76867=_0x24ca[_0x5ce3c8];return _0xa76867;};'use strict';var _=require(_0xa24c('0x0'));var util=require('util');var moment=require(_0xa24c('0x1'));var BPromise=require(_0xa24c('0x2'));var rs=require(_0xa24c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa24c('0x4'))['db'];var utils=require(_0xa24c('0x5'));var logger=require(_0xa24c('0x6'))(_0xa24c('0x7'));var config=require(_0xa24c('0x8'));var jayson=require(_0xa24c('0x9'));var client=jayson[_0xa24c('0xa')][_0xa24c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2dd348,_0x257264,_0x9a5013){return new BPromise(function(_0x481196,_0x42d89c){return client[_0xa24c('0xc')](_0x2dd348,_0x9a5013)[_0xa24c('0xd')](function(_0x5eac78){logger[_0xa24c('0xe')](_0xa24c('0xf'),_0x257264,_0xa24c('0x10'));logger[_0xa24c('0x11')](_0xa24c('0x12'),_0x257264,_0xa24c('0x10'),JSON[_0xa24c('0x13')](_0x5eac78));if(_0x5eac78[_0xa24c('0x14')]){if(_0x5eac78[_0xa24c('0x14')]['code']===0x1f4){logger[_0xa24c('0x14')](_0xa24c('0xf'),_0x257264,_0x5eac78[_0xa24c('0x14')][_0xa24c('0x15')]);return _0x42d89c(_0x5eac78['error'][_0xa24c('0x15')]);}logger[_0xa24c('0x14')](_0xa24c('0xf'),_0x257264,_0x5eac78[_0xa24c('0x14')][_0xa24c('0x15')]);return _0x481196(_0x5eac78[_0xa24c('0x14')][_0xa24c('0x15')]);}else{logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x257264,_0xa24c('0x10'));_0x481196(_0x5eac78[_0xa24c('0x16')]['message']);}})['catch'](function(_0x221d21){logger[_0xa24c('0x14')]('WhatsappApplication,\x20%s,\x20%s',_0x257264,_0x221d21);_0x42d89c(_0x221d21);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 40438d9..18bede8 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 _0x31af=['addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','update','destroy','delete','removeTags','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/messages','getMessages','download','post'];(function(_0xdeffe6,_0x198150){var _0x5baeb=function(_0x51e1c5){while(--_0x51e1c5){_0xdeffe6['push'](_0xdeffe6['shift']());}};_0x5baeb(++_0x198150);}(_0x31af,0xde));var _0xf31a=function(_0x15ddb5,_0x372908){_0x15ddb5=_0x15ddb5-0x0;var _0x5aec39=_0x31af[_0x15ddb5];return _0x5aec39;};'use strict';var multer=require(_0xf31a('0x0'));var util=require(_0xf31a('0x1'));var path=require(_0xf31a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf31a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf31a('0x4'));var interaction=require(_0xf31a('0x5'));var config=require(_0xf31a('0x6'));var controller=require(_0xf31a('0x7'));router['get']('/',auth[_0xf31a('0x8')](),controller[_0xf31a('0x9')]);router[_0xf31a('0xa')](_0xf31a('0xb'),auth['isAuthenticated'](),controller[_0xf31a('0xc')]);router[_0xf31a('0xa')](_0xf31a('0xd'),auth[_0xf31a('0x8')](),controller['show']);router[_0xf31a('0xa')](_0xf31a('0xe'),auth[_0xf31a('0x8')](),controller[_0xf31a('0xf')]);router[_0xf31a('0xa')]('/:id/download',auth[_0xf31a('0x8')](),controller[_0xf31a('0x10')]);router[_0xf31a('0x11')]('/',auth[_0xf31a('0x8')](),controller['create']);router[_0xf31a('0x11')](_0xf31a('0xe'),auth['isAuthenticated'](),controller[_0xf31a('0x12')]);router[_0xf31a('0x11')](_0xf31a('0x13'),auth[_0xf31a('0x8')](),interaction[_0xf31a('0x14')](_0xf31a('0x15'),_0xf31a('0x16')),controller[_0xf31a('0x17')]);router[_0xf31a('0x18')](_0xf31a('0xd'),auth[_0xf31a('0x8')](),interaction[_0xf31a('0x14')](_0xf31a('0x15'),_0xf31a('0x19')),controller[_0xf31a('0x1a')]);router['delete'](_0xf31a('0xd'),auth[_0xf31a('0x8')](),interaction[_0xf31a('0x14')](_0xf31a('0x15'),'whatsappinteraction:destroy'),controller[_0xf31a('0x1b')]);router[_0xf31a('0x1c')](_0xf31a('0x13'),auth[_0xf31a('0x8')](),controller[_0xf31a('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x06ae=['isAuthenticated','describe','/:id','/:id/download','post','/:id/messages','/:id/tags','tracked','whatsapp','addTags','put','update','whatsappinteraction:destroy','delete','removeTags','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x06ae,0x16e));var _0xe06a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x06ae[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0xe06a('0x0'));var path=require(_0xe06a('0x1'));var timeout=require(_0xe06a('0x2'));var express=require(_0xe06a('0x3'));var router=express[_0xe06a('0x4')]();var fs_extra=require(_0xe06a('0x5'));var auth=require(_0xe06a('0x6'));var interaction=require(_0xe06a('0x7'));var config=require(_0xe06a('0x8'));var controller=require('./whatsappInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xe06a('0x9')]);router[_0xe06a('0xa')](_0xe06a('0xb'),auth[_0xe06a('0xc')](),controller[_0xe06a('0xd')]);router['get'](_0xe06a('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xe06a('0xa')]('/:id/messages',auth[_0xe06a('0xc')](),controller['getMessages']);router['get'](_0xe06a('0xf'),auth[_0xe06a('0xc')](),controller['download']);router[_0xe06a('0x10')]('/',auth[_0xe06a('0xc')](),controller['create']);router[_0xe06a('0x10')](_0xe06a('0x11'),auth[_0xe06a('0xc')](),controller['addMessage']);router[_0xe06a('0x10')](_0xe06a('0x12'),auth[_0xe06a('0xc')](),interaction[_0xe06a('0x13')](_0xe06a('0x14'),'whatsappinteraction:addtags'),controller[_0xe06a('0x15')]);router[_0xe06a('0x16')](_0xe06a('0xe'),auth[_0xe06a('0xc')](),interaction[_0xe06a('0x13')](_0xe06a('0x14'),'whatsappinteraction:update'),controller[_0xe06a('0x17')]);router['delete']('/:id',auth['isAuthenticated'](),interaction[_0xe06a('0x13')](_0xe06a('0x14'),_0xe06a('0x18')),controller['destroy']);router[_0xe06a('0x19')](_0xe06a('0x12'),auth['isAuthenticated'](),controller[_0xe06a('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index bf6f0e4..58f92e7 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 _0x1501=['moment','exports','BOOLEAN','STRING','DATE','out','ENUM'];(function(_0x5e1bbe,_0x357d56){var _0x1e2a4b=function(_0x27d369){while(--_0x27d369){_0x5e1bbe['push'](_0x5e1bbe['shift']());}};_0x1e2a4b(++_0x357d56);}(_0x1501,0x126));var _0x1150=function(_0x50ade0,_0x27b006){_0x50ade0=_0x50ade0-0x0;var _0x28472e=_0x1501[_0x50ade0];return _0x28472e;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x1150('0x0'));module[_0x1150('0x1')]={'closed':{'type':Sequelize[_0x1150('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x1150('0x3')]},'secondDisposition':{'type':Sequelize[_0x1150('0x3')]},'thirdDisposition':{'type':Sequelize[_0x1150('0x3')]},'note':{'type':Sequelize[_0x1150('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x1150('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x1150('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1150('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x1150('0x6')]('in',_0x1150('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x1150('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x13f5=['DATE','ENUM','out','sequelize','moment','exports','BOOLEAN','STRING'];(function(_0x5b564d,_0x533fa7){var _0x37cac6=function(_0x5e12a0){while(--_0x5e12a0){_0x5b564d['push'](_0x5b564d['shift']());}};_0x37cac6(++_0x533fa7);}(_0x13f5,0xc3));var _0x513f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x13f5[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x513f('0x0'));var moment=require(_0x513f('0x1'));module[_0x513f('0x2')]={'closed':{'type':Sequelize[_0x513f('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x513f('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x513f('0x4')]},'phone':{'type':Sequelize[_0x513f('0x4')]},'read1stAt':{'type':Sequelize[_0x513f('0x5')]},'firstMsgDirection':{'type':Sequelize[_0x513f('0x6')]('in',_0x513f('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x513f('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x513f('0x6')]('in',_0x513f('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x513f('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 33beb2f..4d6bcf8 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 _0xb4e2=['Tags','split','forEach','push','catch','waiting','talking','answered','unmanaged','total','closed','UserId','index','WhatsappInteraction','rawAttributes','type','model','name','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','field','color','from','u.id','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','text','some','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','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)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','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.*','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Owner.fullname','o.internal','Owner.internal','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','show','params','intersection','includeAll','include','options','create','body','describe','addMessage','WhatsappMessage','omit','ids','findOne','format','YYYY-MM-DD\x20HH:mm:ss','findAll','setTags','spread','emit','whatsappInteractionTags:save','removeTags','download','join','root','server','files','attachments','transcript-%d-%s.zip','User','CmContact','firstName','Attachment','createdAt','secret','WhatsappAccount','Account','mkdirSync','Whatsapp','Owner','N.A.','disposition','basename','createReadStream','pipe','createWriteStream','direction','out','System','lastName','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','unlinkSync','eml-format','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./whatsappInteraction.socket','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','end','error','send','map','fullname','TagIds'];(function(_0x3413ec,_0x12e45f){var _0x5c6065=function(_0x51921){while(--_0x51921){_0x3413ec['push'](_0x3413ec['shift']());}};_0x5c6065(++_0x12e45f);}(_0xb4e2,0x1aa));var _0x2b4e=function(_0x7a47a1,_0x45f928){_0x7a47a1=_0x7a47a1-0x0;var _0xf9c025=_0xb4e2[_0x7a47a1];return _0xf9c025;};'use strict';var emlformat=require(_0x2b4e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2b4e('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2b4e('0x2'));var util=require(_0x2b4e('0x3'));var path=require(_0x2b4e('0x4'));var sox=require(_0x2b4e('0x5'));var csv=require(_0x2b4e('0x6'));var ejs=require(_0x2b4e('0x7'));var fs=require('fs');var fs_extra=require(_0x2b4e('0x8'));var _=require('lodash');var squel=require(_0x2b4e('0x9'));var crypto=require(_0x2b4e('0xa'));var jsforce=require(_0x2b4e('0xb'));var deskjs=require(_0x2b4e('0xc'));var toCsv=require(_0x2b4e('0x6'));var querystring=require(_0x2b4e('0xd'));var Papa=require(_0x2b4e('0xe'));var Redis=require(_0x2b4e('0xf'));var authService=require(_0x2b4e('0x10'));var qs=require(_0x2b4e('0x11'));var as=require(_0x2b4e('0x12'));var pdf=require(_0x2b4e('0x13'));var hardwareService=require(_0x2b4e('0x14'));var logger=require(_0x2b4e('0x15'))('api');var utils=require(_0x2b4e('0x16'));var config=require(_0x2b4e('0x17'));var licenseUtil=require(_0x2b4e('0x18'));var db=require(_0x2b4e('0x19'))['db'];config['redis']=_[_0x2b4e('0x1a')](config['redis'],{'host':_0x2b4e('0x1b'),'port':0x18eb});var socket=require(_0x2b4e('0x1c'))(new Redis(config[_0x2b4e('0x1d')]));require(_0x2b4e('0x1e'))[_0x2b4e('0x1f')](socket);function respondWithStatusCode(_0x94c6c8,_0x4a0c25){_0x4a0c25=_0x4a0c25||0xcc;return function(_0xbe3558){if(_0xbe3558){return _0x94c6c8[_0x2b4e('0x20')](_0x4a0c25);}return _0x94c6c8[_0x2b4e('0x21')](_0x4a0c25)['end']();};}function respondWithResult(_0x1d39af,_0x2d6d8c){_0x2d6d8c=_0x2d6d8c||0xc8;return function(_0x4b87ec){if(_0x4b87ec){return _0x1d39af[_0x2b4e('0x21')](_0x2d6d8c)['json'](_0x4b87ec);}};}function respondWithFilteredResult(_0x3d9c2d,_0x30b754){return function(_0xb8b550){if(_0xb8b550){var _0x2b9480=typeof _0x30b754[_0x2b4e('0x22')]===_0x2b4e('0x23')&&typeof _0x30b754[_0x2b4e('0x24')]===_0x2b4e('0x23');var _0x12e3da=_0xb8b550['count'];var _0x23ca97=_0x2b9480?0x0:_0x30b754['offset'];var _0x4293ae=_0x2b9480?_0xb8b550[_0x2b4e('0x25')]:_0x30b754[_0x2b4e('0x22')]+_0x30b754[_0x2b4e('0x24')];var _0x4a4d1d;if(_0x4293ae>=_0x12e3da){_0x4293ae=_0x12e3da;_0x4a4d1d=0xc8;}else{_0x4a4d1d=0xce;}_0x3d9c2d[_0x2b4e('0x21')](_0x4a4d1d);return _0x3d9c2d[_0x2b4e('0x26')](_0x2b4e('0x27'),_0x23ca97+'-'+_0x4293ae+'/'+_0x12e3da)['json'](_0xb8b550);}return null;};}function patchUpdates(_0x1b0b8f){return function(_0xe3883d){try{jsonpatch['apply'](_0xe3883d,_0x1b0b8f,!![]);}catch(_0x12c511){return BPromise['reject'](_0x12c511);}return _0xe3883d[_0x2b4e('0x28')]();};}function saveUpdates(_0x3462cd,_0x4911d6){return function(_0x5e37f7){if(_0x5e37f7){return _0x5e37f7[_0x2b4e('0x29')](_0x3462cd)[_0x2b4e('0x2a')](function(_0x2eb2e2){return _0x2eb2e2;});}return null;};}function removeEntity(_0x47b641,_0x327555){return function(_0x17a469){if(_0x17a469){return _0x17a469[_0x2b4e('0x2b')]()[_0x2b4e('0x2a')](function(){_0x47b641[_0x2b4e('0x21')](0xcc)[_0x2b4e('0x2c')]();});}};}function handleEntityNotFound(_0x37c9f0,_0x18289b){return function(_0x270c90){if(!_0x270c90){_0x37c9f0['sendStatus'](0x194);}return _0x270c90;};}function handleError(_0x3daddb,_0x2776fb){_0x2776fb=_0x2776fb||0x1f4;return function(_0x368a1b){logger[_0x2b4e('0x2d')](_0x368a1b['stack']);if(_0x368a1b['name']){delete _0x368a1b['name'];}_0x3daddb[_0x2b4e('0x21')](_0x2776fb)[_0x2b4e('0x2e')](_0x368a1b);};}function getInteractionUsers(_0x3ada5d,_0x5377fc){return new BPromise(function(_0x1feebb,_0x5771d7){try{if(_0x5377fc[_0x3ada5d['id']]){_0x3ada5d['Users']=_[_0x2b4e('0x2f')](_0x5377fc[_0x3ada5d['id']],function(_0x3b9491){return{'id':_0x3b9491['id'],'fullname':_0x3b9491[_0x2b4e('0x30')]};});}}catch(_0x19618a){_0x5771d7(_0x19618a);}_0x1feebb(_0x3ada5d);});}function getInteractionTags(_0x3ba601,_0x38a067){return new BPromise(function(_0x473629,_0x5f2888){try{if(_0x3ba601[_0x2b4e('0x31')]){_0x3ba601[_0x2b4e('0x32')]=[];_0x3ba601[_0x2b4e('0x31')][_0x2b4e('0x33')](',')[_0x2b4e('0x34')](function(_0x5102ce){_0x3ba601[_0x2b4e('0x32')][_0x2b4e('0x35')](_0x38a067[_0x5102ce]);});}delete _0x3ba601[_0x2b4e('0x31')];}catch(_0x3bf19c){_0x5f2888(_0x3bf19c);}_0x473629(_0x3ba601);});}function updateWhatsappInteraction(_0x5c27b3,_0xece573,_0xf73183){return new BPromise(function(_0x58b099,_0x5a0d29){return getInteractionUsers(_0x5c27b3,_0xf73183)[_0x2b4e('0x2a')](function(_0x3f19a8){return getInteractionTags(_0x3f19a8,_0xece573);})[_0x2b4e('0x2a')](function(_0x491c27){return getStateInteraction(_0x491c27);})[_0x2b4e('0x2a')](function(_0x13b2d6){_0x58b099(_0x13b2d6);})[_0x2b4e('0x36')](function(_0x1472d6){_0x5a0d29(_0x1472d6);});});}function getStateInteraction(_0x54ccd4){return new BPromise(function(_0x584d3a){_0x54ccd4[_0x2b4e('0x37')]=0x0;_0x54ccd4[_0x2b4e('0x38')]=0x0;_0x54ccd4[_0x2b4e('0x39')]=0x0;_0x54ccd4[_0x2b4e('0x3a')]=0x0;_0x54ccd4[_0x2b4e('0x3b')]=0x0;if(!_0x54ccd4[_0x2b4e('0x3c')]&&!_0x54ccd4[_0x2b4e('0x3d')]){_0x54ccd4['waiting']+=0x1;}if(!_0x54ccd4['closed']&&_0x54ccd4['UserId']){_0x54ccd4[_0x2b4e('0x38')]+=0x1;if(_0x54ccd4[_0x2b4e('0x37')]){_0x54ccd4[_0x2b4e('0x37')]-=0x1;}}if(_0x54ccd4[_0x2b4e('0x3c')]&&_0x54ccd4[_0x2b4e('0x3d')]){_0x54ccd4[_0x2b4e('0x39')]+=0x1;if(_0x54ccd4['talking']){_0x54ccd4['talking']-=0x1;}}if(_0x54ccd4[_0x2b4e('0x3c')]&&!_0x54ccd4['UserId']){_0x54ccd4[_0x2b4e('0x3a')]+=0x1;if(_0x54ccd4[_0x2b4e('0x37')]){_0x54ccd4[_0x2b4e('0x37')]-=0x1;}}_0x54ccd4[_0x2b4e('0x3b')]+=0x1;_0x584d3a(_0x54ccd4);});}exports[_0x2b4e('0x3e')]=function(_0x4eb0e1,_0x37e42f){var _0xbf45ba={},_0x5b7403={},_0x3d18a7={'count':0x0,'rows':[]};var _0x2c75f4=_[_0x2b4e('0x2f')](db[_0x2b4e('0x3f')][_0x2b4e('0x40')],function(_0x2d5766){return{'name':_0x2d5766['fieldName'],'type':_0x2d5766[_0x2b4e('0x41')]['key']};});_0x5b7403[_0x2b4e('0x42')]=_[_0x2b4e('0x2f')](_0x2c75f4,_0x2b4e('0x43'));_0x5b7403['query']=_[_0x2b4e('0x44')](_0x4eb0e1[_0x2b4e('0x45')]);_0x5b7403[_0x2b4e('0x46')]=_['intersection'](_0x5b7403[_0x2b4e('0x42')],_0x5b7403['query']);_0xbf45ba[_0x2b4e('0x47')]=_['intersection'](_0x5b7403['model'],qs[_0x2b4e('0x48')](_0x4eb0e1[_0x2b4e('0x45')]['fields']));_0xbf45ba['attributes']=_0xbf45ba[_0x2b4e('0x47')][_0x2b4e('0x49')]?_0xbf45ba[_0x2b4e('0x47')]:_0x5b7403[_0x2b4e('0x42')];if(!_0x4eb0e1[_0x2b4e('0x45')][_0x2b4e('0x4a')](_0x2b4e('0x4b'))){_0xbf45ba[_0x2b4e('0x24')]=qs[_0x2b4e('0x24')](_0x4eb0e1[_0x2b4e('0x45')][_0x2b4e('0x24')]);_0xbf45ba[_0x2b4e('0x22')]=qs[_0x2b4e('0x22')](_0x4eb0e1[_0x2b4e('0x45')]['offset']);}_0xbf45ba['order']=qs[_0x2b4e('0x4c')](_0x4eb0e1[_0x2b4e('0x45')][_0x2b4e('0x4c')]);_0xbf45ba[_0x2b4e('0x4d')]=qs[_0x2b4e('0x46')](_[_0x2b4e('0x4e')](_0x4eb0e1['query'],_0x5b7403[_0x2b4e('0x46')]),_0x2c75f4);var _0x318c6b=[];var _0x56f83c=squel['select']()[_0x2b4e('0x4f')]('id')[_0x2b4e('0x4f')](_0x2b4e('0x43'))['field'](_0x2b4e('0x50'))[_0x2b4e('0x51')]('tools_tags');var _0x3b3532=squel['select']()['field'](_0x2b4e('0x52'))[_0x2b4e('0x4f')]('u.fullname')[_0x2b4e('0x4f')](_0x2b4e('0x53'))[_0x2b4e('0x51')](_0x2b4e('0x54'),'ui')[_0x2b4e('0x55')]('users','u',_0x2b4e('0x56'));var _0x201e42=squel['select']()[_0x2b4e('0x51')]('whatsapp_interactions','i')[_0x2b4e('0x55')](_0x2b4e('0x57'),'c',_0x2b4e('0x58'))[_0x2b4e('0x55')]('users','o','o.id\x20=\x20i.UserId')[_0x2b4e('0x55')](_0x2b4e('0x59'),'a',_0x2b4e('0x5a'))[_0x2b4e('0x55')]('whatsapp_messages','me',_0x2b4e('0x5b'))[_0x2b4e('0x55')](_0x2b4e('0x5c'),'it',_0x2b4e('0x5d'))[_0x2b4e('0x55')](_0x2b4e('0x5e'),'t',_0x2b4e('0x5f'));var _0x19c058=squel['expr']();var _0xb3e3d3=[];var _0x10bdf2=squel[_0x2b4e('0x60')]();var _0x410397;if(_0x4eb0e1['query'][_0x2b4e('0x61')]){_0x410397=as['parseSearch'](_0x4eb0e1[_0x2b4e('0x45')]['search']);var _0x27dec4=_0x410397[_0x2b4e('0x62')];for(var _0x1609bd=0x0;_0x1609bd<_0x410397['conditions'][_0x2b4e('0x49')];_0x1609bd++){var _0x334a97=_0x410397[_0x2b4e('0x63')][_0x1609bd];var _0x5a3c13='i';var _0x811c67=_[_0x2b4e('0x64')](_0x2c75f4,[_0x2b4e('0x43'),_0x334a97[_0x2b4e('0x4f')]]);if(!_0x811c67){switch(_0x334a97[_0x2b4e('0x4f')]){case _0x2b4e('0x65'):if(_0x334a97[_0x2b4e('0x66')]==0x1){_0x201e42[_0x2b4e('0x67')]('`'+_0x334a97[_0x2b4e('0x4f')]+'`\x20=\x200');}else{_0x201e42[_0x2b4e('0x67')]('`'+_0x334a97[_0x2b4e('0x4f')]+_0x2b4e('0x68'));}break;case _0x2b4e('0x69'):if(_0x334a97[_0x2b4e('0x6a')]===_0x2b4e('0x6b')){if(_0x334a97[_0x2b4e('0x66')][_0x2b4e('0x33')]('\x20')[_0x2b4e('0x49')]>0x1){_0x19c058[_0x27dec4]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x2b4e('0x6c')](_0x334a97['value']),null);}else{var _0x166540='%'+_0x334a97[_0x2b4e('0x66')]+'%';_0x19c058[_0x27dec4](_0x2b4e('0x6d'),_0x166540,_0x166540,_0x166540);}}else{_0x811c67=_[_0x2b4e('0x64')](_0x2c75f4,[_0x2b4e('0x43'),_0x2b4e('0x6e')]);_0x334a97[_0x2b4e('0x4f')]='ContactId';_0x49d1f0=as['buildExpression'](_0x5a3c13,_0x811c67[_0x2b4e('0x41')],_0x334a97);_0x19c058[_0x27dec4](_0x49d1f0['text'],_0x49d1f0[_0x2b4e('0x66')][_0x2b4e('0x6f')],_0x49d1f0[_0x2b4e('0x66')]['end']);}break;case _0x2b4e('0x70'):var _0x4a1fac=_0x334a97[_0x2b4e('0x66')]['split'](',')[_0x2b4e('0x2f')](function(_0xd16a72){return Number(_0xd16a72);});_0x4a1fac[_0x2b4e('0x34')](function(_0x1c5c89){_0x10bdf2['or'](_0x2b4e('0x71'),'%,'+_0x1c5c89+',%');});_0xb3e3d3=_['union'](_0xb3e3d3,_0x4a1fac);break;case'User':if(_0x334a97['operator']==='$substring'){_0x19c058[_0x27dec4](_0x2b4e('0x72'),'%'+_0x334a97[_0x2b4e('0x66')]+'%',null);}else{_0x811c67=_[_0x2b4e('0x64')](_0x2c75f4,[_0x2b4e('0x43'),_0x2b4e('0x3d')]);_0x334a97[_0x2b4e('0x4f')]=_0x2b4e('0x3d');_0x49d1f0=as[_0x2b4e('0x73')](_0x5a3c13,_0x811c67['type'],_0x334a97);_0x19c058[_0x27dec4](_0x49d1f0[_0x2b4e('0x74')],_0x49d1f0['value'][_0x2b4e('0x6f')],_0x49d1f0[_0x2b4e('0x66')][_0x2b4e('0x2c')]);}break;case'body':_0x49d1f0=as['buildExpression']('me',null,_0x334a97);_0x19c058[_0x27dec4](_0x49d1f0[_0x2b4e('0x74')],_0x49d1f0[_0x2b4e('0x66')]['start'],_0x49d1f0[_0x2b4e('0x66')][_0x2b4e('0x2c')]);break;}}else{var _0x49d1f0=as[_0x2b4e('0x73')](_0x5a3c13,_0x811c67['type'],_0x334a97);_0x19c058[_0x27dec4](_0x49d1f0['text'],_0x49d1f0[_0x2b4e('0x66')][_0x2b4e('0x6f')],_0x49d1f0[_0x2b4e('0x66')][_0x2b4e('0x2c')]);}}}else{var _0x99ff6c=_(_0x4eb0e1[_0x2b4e('0x45')])[_0x2b4e('0x44')]()[_0x2b4e('0x2f')](function(_0x38f92c){return _[_0x2b4e('0x75')](_0x2c75f4,['name',_0x38f92c])?_0x38f92c:undefined;})[_0x2b4e('0x76')]()[_0x2b4e('0x66')]();if(!_[_0x2b4e('0x77')](_0x99ff6c)){_0x99ff6c[_0x2b4e('0x34')](function(_0x3457e7){if(_0x3457e7===_0x2b4e('0x78')){_0x201e42[_0x2b4e('0x4d')](_0x2b4e('0x79'),[][_0x2b4e('0x7a')](_0x4eb0e1[_0x2b4e('0x45')][_0x3457e7]));}else if(_0x3457e7==='createdAt'){var _0x35ecd4=JSON[_0x2b4e('0x7b')](_0x4eb0e1[_0x2b4e('0x45')][_0x3457e7])[_0x2b4e('0x7c')];var _0x334caf=JSON['parse'](_0x4eb0e1[_0x2b4e('0x45')][_0x3457e7])[_0x2b4e('0x7d')];_0x201e42[_0x2b4e('0x4d')](_0x2b4e('0x7e'),_0x35ecd4,_0x334caf);}else{if(_0x4eb0e1[_0x2b4e('0x45')][_0x3457e7]===_0x2b4e('0x7f')){_0x201e42[_0x2b4e('0x4d')]('i.'+_0x3457e7+_0x2b4e('0x80'));}else{_0x201e42[_0x2b4e('0x4d')]('i.'+_0x3457e7+'\x20=\x20?',_0x4eb0e1[_0x2b4e('0x45')][_0x3457e7]);}}});}if(_0x4eb0e1[_0x2b4e('0x45')][_0x2b4e('0x81')]){if(_0x4eb0e1[_0x2b4e('0x45')]['read']==0x1){_0x201e42[_0x2b4e('0x67')](_0x2b4e('0x82'));}else{_0x201e42['having'](_0x2b4e('0x83'));}}if(_0x4eb0e1['query'][_0x2b4e('0x84')]){_0xb3e3d3=_[_0x2b4e('0x85')](_0x4eb0e1['query']['tag'])?_0x4eb0e1['query'][_0x2b4e('0x84')]:new Array(_0x4eb0e1[_0x2b4e('0x45')][_0x2b4e('0x84')]);_0xb3e3d3['forEach'](function(_0x327dab){_0x10bdf2['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x327dab+',%');});}if(_0x4eb0e1[_0x2b4e('0x45')][_0x2b4e('0x86')]){var _0x3a05d4=_0x4eb0e1[_0x2b4e('0x45')][_0x2b4e('0x86')][_0x2b4e('0x87')]('\x5c','\x5c\x5c')[_0x2b4e('0x87')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x3a05d4)){_0x19c058['or'](_0x2b4e('0x88'),_0x3a05d4+'%')['or'](_0x2b4e('0x89'),_0x3a05d4+'%');}else{_0x19c058['or'](_0x2b4e('0x8a'),qs[_0x2b4e('0x6c')](_0x3a05d4))['or'](_0x2b4e('0x8b'),_0x3a05d4+'%');}}}_0x201e42[_0x2b4e('0x4d')](_0x19c058);_0x201e42[_0x2b4e('0x8c')](_0x2b4e('0x8d'));var _0x53fabd={'type':db[_0x2b4e('0x8e')][_0x2b4e('0x8f')][_0x2b4e('0x90')],'raw':!![]};var _0xd3f0f=_0x201e42[_0x2b4e('0x91')]();_0xd3f0f[_0x2b4e('0x4f')](_0x2b4e('0x8d'));_0xd3f0f['field'](_0x2b4e('0x92'),_0x2b4e('0x65'));if(_0xbf45ba[_0x2b4e('0x93')]){_0xbf45ba[_0x2b4e('0x93')][_0x2b4e('0x34')](function(_0x4e3e6d){var _0x30ec67=_0x4e3e6d[0x0]===_0x2b4e('0x94')?_0x4e3e6d[0x0]:'i.'+_0x4e3e6d[0x0];_0x201e42['order'](_0x30ec67,_0x4e3e6d[0x1]==='DESC'?![]:!![]);});}if(!_[_0x2b4e('0x77')](_0xb3e3d3)){_0x201e42[_0x2b4e('0x67')](_0x10bdf2);_0xd3f0f['where']('t.id\x20IN\x20?',_0xb3e3d3);}BPromise[_0x2b4e('0x95')]()[_0x2b4e('0x2a')](function(){if(!_0x410397){if(_0x4eb0e1['query']['WhatsappAccountId'])return;_0xd3f0f['where'](_0x2b4e('0x96'));_0x201e42[_0x2b4e('0x4d')](_0x2b4e('0x96'));return;}if(_0x4eb0e1[_0x2b4e('0x97')][_0x2b4e('0x98')]!==_0x2b4e('0x99'))return;return _0x4eb0e1[_0x2b4e('0x97')]['getWhatsappAccounts']({'attributes':['id'],'raw':!![]})[_0x2b4e('0x2a')](function(_0x5ef40b){if(_['isEmpty'](_0x5ef40b)){_0xd3f0f[_0x2b4e('0x4d')](_0x2b4e('0x9a'));_0x201e42[_0x2b4e('0x4d')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0xd3f0f[_0x2b4e('0x4d')](_0x2b4e('0x79'),_[_0x2b4e('0x2f')](_0x5ef40b,'id'));_0x201e42[_0x2b4e('0x4d')](_0x2b4e('0x79'),_['map'](_0x5ef40b,'id'));}});})[_0x2b4e('0x2a')](function(){if(_0x4eb0e1['user'][_0x2b4e('0x98')]===_0x2b4e('0x99')&&!_0x410397&&!_0x4eb0e1[_0x2b4e('0x45')]['WhatsappAccountId'])return[];return db['sequelize'][_0x2b4e('0x45')](_0xd3f0f['toString'](),_0x53fabd);})['then'](function(_0x35f564){_0x3d18a7[_0x2b4e('0x25')]=_0x35f564[_0x2b4e('0x49')];if(_0x3d18a7[_0x2b4e('0x25')]===0x0)return[];return db[_0x2b4e('0x9b')][_0x2b4e('0x45')](_0x56f83c[_0x2b4e('0x9c')](),_0x53fabd)[_0x2b4e('0x2a')](function(_0x31036f){_0x318c6b=_[_0x2b4e('0x9d')](_0x31036f,'id');_0x53fabd=_[_0x2b4e('0x9e')](_0x53fabd,{'model':db[_0x2b4e('0x3f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4eb0e1[_0x2b4e('0x45')][_0x2b4e('0x48')]){_0xbf45ba[_0x2b4e('0x47')][_0x2b4e('0x34')](function(_0x54e252){_0x201e42[_0x2b4e('0x4f')]('i.'+_0x54e252);});}else{_0x201e42[_0x2b4e('0x4f')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x2b4e('0x65'));_0x201e42[_0x2b4e('0x4f')]('a.key',_0x2b4e('0x9f'));_0x201e42[_0x2b4e('0x4f')](_0x2b4e('0xa0'),_0x2b4e('0xa1'));_0x201e42[_0x2b4e('0x4f')](_0x2b4e('0xa2'),_0x2b4e('0x94'));_0x201e42[_0x2b4e('0x4f')](_0x2b4e('0xa3'));_0x201e42['field']('c.firstName','Contact.firstName');_0x201e42[_0x2b4e('0x4f')](_0x2b4e('0xa4'),_0x2b4e('0xa5'));_0x201e42[_0x2b4e('0x4f')](_0x2b4e('0xa6'),_0x2b4e('0xa7'));_0x201e42['field'](_0x2b4e('0xa8'),_0x2b4e('0xa9'));_0x201e42[_0x2b4e('0x4f')](_0x2b4e('0xaa'),'Contact.mobile');_0x201e42[_0x2b4e('0x4f')](_0x2b4e('0xab'),'Contact.fax');_0x201e42['field']('o.fullname',_0x2b4e('0xac'));_0x201e42[_0x2b4e('0x4f')](_0x2b4e('0xad'),_0x2b4e('0xae'));_0x201e42['field']('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0xbf45ba[_0x2b4e('0x24')])_0x201e42['limit'](_0xbf45ba[_0x2b4e('0x24')]);if(_0xbf45ba['offset'])_0x201e42[_0x2b4e('0x22')](_0xbf45ba['offset']);return db[_0x2b4e('0x9b')][_0x2b4e('0x45')](_0x201e42[_0x2b4e('0x9c')](),_0x53fabd);})['then'](function(_0x41a287){if(_0x41a287[_0x2b4e('0x49')]>0x0)_0x3b3532[_0x2b4e('0x4d')](_0x2b4e('0xaf'),_['map'](_0x41a287,'id'));return db['sequelize'][_0x2b4e('0x45')](_0x3b3532[_0x2b4e('0x9c')](),_0x53fabd)[_0x2b4e('0x2a')](function(_0x34ef2f){var _0x3764aa=_[_0x2b4e('0xb0')](_0x34ef2f,_0x2b4e('0xb1'));var _0x52c5f7=[];_0x41a287[_0x2b4e('0x34')](function(_0x5112ba){_0x52c5f7[_0x2b4e('0x35')](updateWhatsappInteraction(_0x5112ba,_0x318c6b,_0x3764aa));});return BPromise[_0x2b4e('0xb2')](_0x52c5f7);});});})['then'](function(_0x3e2e69){_0x3d18a7[_0x2b4e('0xb3')]=_0x3e2e69;return _0x3d18a7;})['then'](respondWithFilteredResult(_0x37e42f,_0xbf45ba))[_0x2b4e('0x36')](handleError(_0x37e42f,null));};exports[_0x2b4e('0xb4')]=function(_0x52bac9,_0x2b25c2){var _0xaf7006={'raw':![],'where':{'id':_0x52bac9[_0x2b4e('0xb5')]['id']}},_0x423d6c={};_0x423d6c[_0x2b4e('0x42')]=_['keys'](db[_0x2b4e('0x3f')][_0x2b4e('0x40')]);_0x423d6c[_0x2b4e('0x45')]=_[_0x2b4e('0x44')](_0x52bac9[_0x2b4e('0x45')]);_0x423d6c['filters']=_['intersection'](_0x423d6c[_0x2b4e('0x42')],_0x423d6c[_0x2b4e('0x45')]);_0xaf7006['attributes']=_[_0x2b4e('0xb6')](_0x423d6c[_0x2b4e('0x42')],qs[_0x2b4e('0x48')](_0x52bac9[_0x2b4e('0x45')][_0x2b4e('0x48')]));_0xaf7006['attributes']=_0xaf7006[_0x2b4e('0x47')][_0x2b4e('0x49')]?_0xaf7006[_0x2b4e('0x47')]:_0x423d6c[_0x2b4e('0x42')];if(_0x52bac9['query'][_0x2b4e('0xb7')]){_0xaf7006[_0x2b4e('0xb8')]=[{'all':!![]}];}_0xaf7006=_[_0x2b4e('0x9e')]({},_0xaf7006,_0x52bac9[_0x2b4e('0xb9')]);return db['WhatsappInteraction'][_0x2b4e('0x64')](_0xaf7006)['then'](handleEntityNotFound(_0x2b25c2,null))[_0x2b4e('0x2a')](respondWithResult(_0x2b25c2,null))[_0x2b4e('0x36')](handleError(_0x2b25c2,null));};exports[_0x2b4e('0xba')]=function(_0x524b25,_0x6da318){return db[_0x2b4e('0x3f')][_0x2b4e('0xba')](_0x524b25[_0x2b4e('0xbb')],{})[_0x2b4e('0x2a')](respondWithResult(_0x6da318,0xc9))[_0x2b4e('0x36')](handleError(_0x6da318,null));};exports[_0x2b4e('0x29')]=function(_0x94c45d,_0x37de67){if(_0x94c45d[_0x2b4e('0xbb')]['id']){delete _0x94c45d['body']['id'];}return db[_0x2b4e('0x3f')]['find']({'where':{'id':_0x94c45d[_0x2b4e('0xb5')]['id']}})[_0x2b4e('0x2a')](handleEntityNotFound(_0x37de67,null))[_0x2b4e('0x2a')](saveUpdates(_0x94c45d['body'],null))['then'](respondWithResult(_0x37de67,null))[_0x2b4e('0x36')](handleError(_0x37de67,null));};exports[_0x2b4e('0x2b')]=function(_0x2298df,_0x1f3008){return db[_0x2b4e('0x3f')][_0x2b4e('0x64')]({'where':{'id':_0x2298df[_0x2b4e('0xb5')]['id']}})['then'](handleEntityNotFound(_0x1f3008,null))[_0x2b4e('0x2a')](removeEntity(_0x1f3008,null))['catch'](handleError(_0x1f3008,null));};exports[_0x2b4e('0xbc')]=function(_0x3bc9ce,_0x61c7f9){return db['WhatsappInteraction'][_0x2b4e('0xbc')]()['then'](respondWithResult(_0x61c7f9,null))[_0x2b4e('0x36')](handleError(_0x61c7f9,null));};exports[_0x2b4e('0xbd')]=function(_0x1a1f33,_0x1674d0,_0x152143){return db[_0x2b4e('0xbe')]['find']({'where':{'id':_0x1a1f33['params']['id']}})[_0x2b4e('0x2a')](handleEntityNotFound(_0x1674d0,null))[_0x2b4e('0x2a')](function(_0x53c2b6){if(_0x53c2b6){return _0x53c2b6[_0x2b4e('0xbd')](_0x1a1f33[_0x2b4e('0xbb')]['ids'],_[_0x2b4e('0xbf')](_0x1a1f33[_0x2b4e('0xbb')],[_0x2b4e('0xc0'),'id'])||{});}})['then'](respondWithResult(_0x1674d0,null))[_0x2b4e('0x36')](handleError(_0x1674d0,null));};exports['getMessages']=function(_0x710a25,_0xc49113,_0x3975cc){var _0x497239={'raw':![],'where':{}};var _0x27c53e={};var _0x31b9aa={'count':0x0,'rows':[]};return db[_0x2b4e('0x3f')][_0x2b4e('0xc1')]({'where':{'id':_0x710a25[_0x2b4e('0xb5')]['id']}})['then'](handleEntityNotFound(_0xc49113,null))[_0x2b4e('0x2a')](function(_0x389599){if(_0x389599){_0x27c53e[_0x2b4e('0x42')]=_[_0x2b4e('0x44')](db[_0x2b4e('0xbe')]['rawAttributes']);_0x27c53e[_0x2b4e('0x45')]=_[_0x2b4e('0x44')](_0x710a25['query']);_0x27c53e['filters']=_['intersection'](_0x27c53e[_0x2b4e('0x42')],_0x27c53e['query']);_0x497239[_0x2b4e('0x47')]=_[_0x2b4e('0xb6')](_0x27c53e['model'],qs[_0x2b4e('0x48')](_0x710a25[_0x2b4e('0x45')][_0x2b4e('0x48')]));_0x497239[_0x2b4e('0x47')]=_0x497239[_0x2b4e('0x47')]['length']?_0x497239[_0x2b4e('0x47')]:_0x27c53e[_0x2b4e('0x42')];if(!_0x710a25[_0x2b4e('0x45')][_0x2b4e('0x4a')](_0x2b4e('0x4b'))){_0x497239[_0x2b4e('0x24')]=qs[_0x2b4e('0x24')](_0x710a25[_0x2b4e('0x45')]['limit']);_0x497239[_0x2b4e('0x22')]=qs[_0x2b4e('0x22')](_0x710a25[_0x2b4e('0x45')]['offset']);}_0x497239['order']=qs['sort'](_0x710a25['query'][_0x2b4e('0x4c')]);_0x497239[_0x2b4e('0x4d')]=qs[_0x2b4e('0x46')](_['pick'](_0x710a25[_0x2b4e('0x45')],_0x27c53e[_0x2b4e('0x46')]));_0x497239[_0x2b4e('0x4d')][_0x2b4e('0xb1')]=_0x389599['id'];if(_0x710a25[_0x2b4e('0x45')][_0x2b4e('0x86')]){_0x497239[_0x2b4e('0x4d')]=_[_0x2b4e('0x9e')](_0x497239['where'],{'$or':_[_0x2b4e('0x2f')](_0x497239[_0x2b4e('0x47')],function(_0x2a3680){var _0x3e78b4={};_0x3e78b4[_0x2a3680]={'$like':'%'+_0x710a25[_0x2b4e('0x45')][_0x2b4e('0x86')]+'%'};return _0x3e78b4;})});}if(_0x710a25[_0x2b4e('0x45')][_0x2b4e('0x7c')]){var _0x5b9420=_0x710a25[_0x2b4e('0x45')][_0x2b4e('0x7c')][_0x2b4e('0x33')](',');var _0x1abbf0={};_0x1abbf0[_0x5b9420[0x0]]={'$gte':moment(_0x5b9420[0x1])[_0x2b4e('0xc2')](_0x2b4e('0xc3'))};_0x497239['where']=_[_0x2b4e('0x9e')](_0x497239['where'],_0x1abbf0);}_0x497239=_['merge']({},_0x497239,_0x710a25['options']);return db[_0x2b4e('0xbe')][_0x2b4e('0x25')]({'where':_0x497239[_0x2b4e('0x4d')]})[_0x2b4e('0x2a')](function(_0x1d49fa){_0x31b9aa['count']=_0x1d49fa;if(_0x710a25[_0x2b4e('0x45')][_0x2b4e('0xb7')]){_0x497239[_0x2b4e('0xb8')]=[{'all':!![]}];}return db[_0x2b4e('0xbe')][_0x2b4e('0xc4')](_0x497239);})[_0x2b4e('0x2a')](function(_0x417144){_0x31b9aa[_0x2b4e('0xb3')]=_0x417144;return _0x31b9aa;});}})[_0x2b4e('0x2a')](respondWithFilteredResult(_0xc49113,_0x497239))['catch'](handleError(_0xc49113,null));};exports['addTags']=function(_0x4f10a3,_0x34b8d8,_0x5cc3a9){return db[_0x2b4e('0x3f')][_0x2b4e('0x64')]({'where':{'id':_0x4f10a3[_0x2b4e('0xb5')]['id']}})[_0x2b4e('0x2a')](handleEntityNotFound(_0x34b8d8,null))[_0x2b4e('0x2a')](function(_0xf1893a){if(_0xf1893a){return _0xf1893a[_0x2b4e('0xc5')](_0x4f10a3[_0x2b4e('0xbb')]['ids'],_[_0x2b4e('0xbf')](_0x4f10a3[_0x2b4e('0xbb')],['ids','id'])||{})[_0x2b4e('0xc6')](function(){return db['Tag'][_0x2b4e('0xc4')]({'attributes':['id',_0x2b4e('0x43'),_0x2b4e('0x50')],'where':{'id':_0x4f10a3[_0x2b4e('0xbb')]['ids']}});})[_0x2b4e('0x2a')](function(_0x45cf64){socket[_0x2b4e('0xc7')](_0x2b4e('0xc8'),{'id':Number(_0x4f10a3[_0x2b4e('0xb5')]['id']),'tags':_0x45cf64||[]});return{'id':Number(_0x4f10a3[_0x2b4e('0xb5')]['id']),'tags':_0x45cf64||[]};});}})['then'](respondWithResult(_0x34b8d8,null))[_0x2b4e('0x36')](handleError(_0x34b8d8,null));};exports[_0x2b4e('0xc9')]=function(_0x59cdc2,_0x3e3675,_0x5aae6b){return db[_0x2b4e('0x3f')]['find']({'where':{'id':_0x59cdc2[_0x2b4e('0xb5')]['id']}})['then'](handleEntityNotFound(_0x3e3675,null))[_0x2b4e('0x2a')](function(_0x4f3bf2){if(_0x4f3bf2){return _0x4f3bf2[_0x2b4e('0xc9')](_0x59cdc2[_0x2b4e('0x45')][_0x2b4e('0xc0')]);}})[_0x2b4e('0x2a')](respondWithStatusCode(_0x3e3675,null))[_0x2b4e('0x36')](handleError(_0x3e3675,null));};exports[_0x2b4e('0xca')]=function(_0x2693d8,_0x582f02){var _0x22f317=moment()['unix']()[_0x2b4e('0x9c')]();var _0x10f454=path[_0x2b4e('0xcb')](config[_0x2b4e('0xcc')],_0x2b4e('0xcd'),'files','tmp');var _0x40869c=path[_0x2b4e('0xcb')](config['root'],_0x2b4e('0xcd'),_0x2b4e('0xce'),_0x2b4e('0xcf'));var _0x1fc045=path['join'](_0x10f454,_0x22f317);var _0x360996=util[_0x2b4e('0xc2')](_0x2b4e('0xd0'),_0x2693d8[_0x2b4e('0xb5')]['id'],_0x22f317);var _0x18942f=path[_0x2b4e('0xcb')](_0x10f454,_0x360996);var _0x56a139=[];_0x56a139[_0x2b4e('0x35')]({'model':db[_0x2b4e('0xd1')],'as':_0x2b4e('0xd1'),'attributes':['id',_0x2b4e('0x30')],'raw':!![]});_0x56a139['push']({'model':db[_0x2b4e('0xd2')],'as':_0x2b4e('0x69'),'attributes':['id',_0x2b4e('0xd3'),'lastName'],'raw':!![]});if(_0x2693d8[_0x2b4e('0x45')]['attachments']){_0x56a139[_0x2b4e('0x35')]({'model':db[_0x2b4e('0xd4')],'as':_0x2b4e('0xd4'),'raw':!![]});}var _0x545995=[{'model':db[_0x2b4e('0xbe')],'as':'Messages','attributes':['id',_0x2b4e('0xbb'),_0x2b4e('0xd5'),'direction',_0x2b4e('0xd6'),_0x2b4e('0x81')],'include':_0x56a139}];_0x545995[_0x2b4e('0x35')]({'model':db[_0x2b4e('0xd7')],'as':_0x2b4e('0xd8'),'attributes':['id','name']});_0x545995[_0x2b4e('0x35')]({'model':db[_0x2b4e('0xd1')],'as':'Owner','attributes':['id',_0x2b4e('0x30')]});return db['WhatsappInteraction']['find']({'where':{'id':_0x2693d8['params']['id']},'include':_0x545995})['then'](handleEntityNotFound(_0x582f02,null))['then'](function(_0x47f947){if(_0x47f947){var _0x4dd6ab=_0x47f947['get']({'plain':!![]});fs[_0x2b4e('0xd9')](_0x1fc045);var _0x2d3443={'channel':_0x2b4e('0xda'),'account':_0x4dd6ab[_0x2b4e('0xd8')][_0x2b4e('0x43')],'agent':_0x4dd6ab['Owner']?_0x4dd6ab[_0x2b4e('0xdb')][_0x2b4e('0x30')]:_0x2b4e('0xdc'),'createdAt':moment(_0x4dd6ab['createdAt'])[_0x2b4e('0xc2')](_0x2b4e('0xc3'))['toString'](),'closedAt':_0x4dd6ab[_0x2b4e('0x3c')]?moment(_0x4dd6ab['closedAt'])[_0x2b4e('0xc2')](_0x2b4e('0xc3'))[_0x2b4e('0x9c')]():'','disposition':_0x4dd6ab[_0x2b4e('0xdd')],'messages':_(_0x4dd6ab['Messages'])[_0x2b4e('0x86')]({'secret':![]})[_0x2b4e('0x2f')](function(_0x25d499){if(_0x25d499['Attachment']){var _0x2b2e16=path[_0x2b4e('0xcb')](_0x40869c,_0x25d499[_0x2b4e('0xd4')][_0x2b4e('0xde')]);if(fs['existsSync'](_0x2b2e16)){fs[_0x2b4e('0xdf')](_0x2b2e16)[_0x2b4e('0xe0')](fs[_0x2b4e('0xe1')](path[_0x2b4e('0xcb')](_0x1fc045,_0x25d499['Attachment'][_0x2b4e('0xde')])));}}return{'date':moment(_0x25d499[_0x2b4e('0xd5')])[_0x2b4e('0xc2')]('YYYY-MM-DD\x20HH:mm:ss')[_0x2b4e('0x9c')](),'sender':_0x25d499[_0x2b4e('0xe2')]===_0x2b4e('0xe3')?_0x25d499[_0x2b4e('0xd1')]?_0x25d499['User'][_0x2b4e('0x30')]:_0x2b4e('0xe4'):_0x25d499[_0x2b4e('0x69')][_0x2b4e('0xd3')]+(_0x25d499[_0x2b4e('0x69')]['lastName']?'\x20'+_0x25d499[_0x2b4e('0x69')][_0x2b4e('0xe5')]:''),'body':_0x25d499[_0x2b4e('0xd4')]?_0x25d499[_0x2b4e('0xd4')]['basename']:_0x25d499[_0x2b4e('0xbb')],'direction':_0x25d499[_0x2b4e('0xe2')]===_0x2b4e('0xe3')?'A':'C','secret':_0x25d499['secret'],'read':_0x25d499[_0x2b4e('0x81')],'attachment':_0x25d499[_0x2b4e('0xd4')]};})[_0x2b4e('0x66')]()};return ejs[_0x2b4e('0xe6')](path[_0x2b4e('0xcb')](config[_0x2b4e('0xcc')],'server',_0x2b4e('0xe7'),_0x2b4e('0xe8')),{'interaction':_0x2d3443})[_0x2b4e('0x2a')](function(_0x92782e){var _0x4a23e6=path['join'](_0x1fc045,_0x2b4e('0xe9')+_0x4dd6ab['id']+'-'+_0x22f317+'.pdf');var _0x42d1e2={'path':_0x4a23e6,'channel':_0x2b4e('0xda'),'interactionId':_0x4dd6ab['id']};return pdf[_0x2b4e('0xea')](_0x92782e,_0x42d1e2);})[_0x2b4e('0x2a')](function(){return new BPromise(function(_0xd22f0d,_0x2f9d5e){zipdir(_0x1fc045,{'saveTo':_0x18942f},function(_0x254935,_0xbb912){if(_0x254935)return _0x2f9d5e(_0x254935);return _0xd22f0d(_0xbb912);});})[_0x2b4e('0x2a')](function(){return new BPromise(function(_0x570526,_0x1330e6){rimraf(_0x1fc045,function(_0x108789){if(_0x108789)_0x1330e6(_0x108789);return _0x570526();});});})[_0x2b4e('0x2a')](function(){return _0x582f02[_0x2b4e('0xca')](_0x18942f,_0x360996,function(_0x4fed7c){if(_0x4fed7c){console[_0x2b4e('0xeb')](_0x2b4e('0xec'),_0x4fed7c);}else{fs[_0x2b4e('0xed')](_0x18942f);}});});});}else{return _0x582f02[_0x2b4e('0x20')](0xc8);}})[_0x2b4e('0x36')](handleError(_0x582f02,null));}; \ No newline at end of file +var _0x9bdb=['c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','rows','show','params','includeAll','include','options','create','body','describe','addMessage','ids','omit','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','WhatsappMessage','findAll','addTags','setTags','spread','emit','whatsappInteractionTags:save','removeTags','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','firstName','Attachment','Messages','direction','secret','WhatsappAccount','Owner','fullname','get','mkdirSync','Account','N.A.','closedAt','basename','existsSync','createReadStream','pipe','out','System','lastName','views','downloadInteraction.ejs','transcript-','.pdf','Whatsapp','download','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','defaults','redis','localhost','./whatsappInteraction.socket','register','status','json','offset','undefined','count','limit','set','Content-Range','reject','update','destroy','then','end','sendStatus','error','stack','name','send','Users','map','TagIds','Tags','split','forEach','push','catch','waiting','talking','unmanaged','total','closed','UserId','answered','index','WhatsappInteraction','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','o.id\x20=\x20i.UserId','whatsapp_accounts','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','length','having','`\x20>\x200','Contact','operator','$substring','getFullTextValue','value','find','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?','start','some','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.phone\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','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','DESC','isEmpty','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','role','getWhatsappAccounts','user','agent','sequelize','toString','merge','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'];(function(_0x384412,_0x59bd8e){var _0x5a4c53=function(_0xec1605){while(--_0xec1605){_0x384412['push'](_0x384412['shift']());}};_0x5a4c53(++_0x59bd8e);}(_0x9bdb,0x13c));var _0xb9bd=function(_0x4de924,_0x175aba){_0x4de924=_0x4de924-0x0;var _0x3eeea1=_0x9bdb[_0x4de924];return _0x3eeea1;};'use strict';var emlformat=require(_0xb9bd('0x0'));var rimraf=require(_0xb9bd('0x1'));var zipdir=require(_0xb9bd('0x2'));var jsonpatch=require(_0xb9bd('0x3'));var rp=require('request-promise');var moment=require(_0xb9bd('0x4'));var BPromise=require(_0xb9bd('0x5'));var Mustache=require(_0xb9bd('0x6'));var util=require(_0xb9bd('0x7'));var path=require(_0xb9bd('0x8'));var sox=require(_0xb9bd('0x9'));var csv=require(_0xb9bd('0xa'));var ejs=require(_0xb9bd('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb9bd('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb9bd('0xd'));var deskjs=require(_0xb9bd('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb9bd('0xf'));var Papa=require(_0xb9bd('0x10'));var Redis=require(_0xb9bd('0x11'));var authService=require(_0xb9bd('0x12'));var qs=require(_0xb9bd('0x13'));var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require(_0xb9bd('0x14'));var logger=require(_0xb9bd('0x15'))(_0xb9bd('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb9bd('0x17'));var db=require(_0xb9bd('0x18'))['db'];config['redis']=_[_0xb9bd('0x19')](config[_0xb9bd('0x1a')],{'host':_0xb9bd('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb9bd('0x1a')]));require(_0xb9bd('0x1c'))[_0xb9bd('0x1d')](socket);function respondWithStatusCode(_0x559855,_0x56450d){_0x56450d=_0x56450d||0xcc;return function(_0x1f74da){if(_0x1f74da){return _0x559855['sendStatus'](_0x56450d);}return _0x559855[_0xb9bd('0x1e')](_0x56450d)['end']();};}function respondWithResult(_0x1e0c3a,_0x1ad774){_0x1ad774=_0x1ad774||0xc8;return function(_0x33488e){if(_0x33488e){return _0x1e0c3a[_0xb9bd('0x1e')](_0x1ad774)[_0xb9bd('0x1f')](_0x33488e);}};}function respondWithFilteredResult(_0x15dc9f,_0x2f6edc){return function(_0xd65adc){if(_0xd65adc){var _0x2c5bee=typeof _0x2f6edc[_0xb9bd('0x20')]===_0xb9bd('0x21')&&typeof _0x2f6edc['limit']==='undefined';var _0x1b1103=_0xd65adc[_0xb9bd('0x22')];var _0x3abcf9=_0x2c5bee?0x0:_0x2f6edc[_0xb9bd('0x20')];var _0x1f1ac6=_0x2c5bee?_0xd65adc['count']:_0x2f6edc[_0xb9bd('0x20')]+_0x2f6edc[_0xb9bd('0x23')];var _0x2f8196;if(_0x1f1ac6>=_0x1b1103){_0x1f1ac6=_0x1b1103;_0x2f8196=0xc8;}else{_0x2f8196=0xce;}_0x15dc9f[_0xb9bd('0x1e')](_0x2f8196);return _0x15dc9f[_0xb9bd('0x24')](_0xb9bd('0x25'),_0x3abcf9+'-'+_0x1f1ac6+'/'+_0x1b1103)[_0xb9bd('0x1f')](_0xd65adc);}return null;};}function patchUpdates(_0x3162b7){return function(_0x89d5fb){try{jsonpatch['apply'](_0x89d5fb,_0x3162b7,!![]);}catch(_0x2c8e16){return BPromise[_0xb9bd('0x26')](_0x2c8e16);}return _0x89d5fb['save']();};}function saveUpdates(_0x50dced,_0x4b3940){return function(_0x136930){if(_0x136930){return _0x136930[_0xb9bd('0x27')](_0x50dced)['then'](function(_0x9f087d){return _0x9f087d;});}return null;};}function removeEntity(_0x18f4c1,_0x3b9846){return function(_0x2b7fad){if(_0x2b7fad){return _0x2b7fad[_0xb9bd('0x28')]()[_0xb9bd('0x29')](function(){_0x18f4c1[_0xb9bd('0x1e')](0xcc)[_0xb9bd('0x2a')]();});}};}function handleEntityNotFound(_0x2647a5,_0x364e2f){return function(_0x768bfd){if(!_0x768bfd){_0x2647a5[_0xb9bd('0x2b')](0x194);}return _0x768bfd;};}function handleError(_0x5d09c9,_0x4f8248){_0x4f8248=_0x4f8248||0x1f4;return function(_0x2b81c4){logger[_0xb9bd('0x2c')](_0x2b81c4[_0xb9bd('0x2d')]);if(_0x2b81c4[_0xb9bd('0x2e')]){delete _0x2b81c4[_0xb9bd('0x2e')];}_0x5d09c9[_0xb9bd('0x1e')](_0x4f8248)[_0xb9bd('0x2f')](_0x2b81c4);};}function getInteractionUsers(_0x42ffc1,_0x28fd26){return new BPromise(function(_0x5881ec,_0x2521c0){try{if(_0x28fd26[_0x42ffc1['id']]){_0x42ffc1[_0xb9bd('0x30')]=_[_0xb9bd('0x31')](_0x28fd26[_0x42ffc1['id']],function(_0xa9acb4){return{'id':_0xa9acb4['id'],'fullname':_0xa9acb4['fullname']};});}}catch(_0x2c0fdc){_0x2521c0(_0x2c0fdc);}_0x5881ec(_0x42ffc1);});}function getInteractionTags(_0x58b67f,_0x23d9d5){return new BPromise(function(_0x111bc9,_0x235a99){try{if(_0x58b67f[_0xb9bd('0x32')]){_0x58b67f[_0xb9bd('0x33')]=[];_0x58b67f[_0xb9bd('0x32')][_0xb9bd('0x34')](',')[_0xb9bd('0x35')](function(_0x28a2ec){_0x58b67f[_0xb9bd('0x33')][_0xb9bd('0x36')](_0x23d9d5[_0x28a2ec]);});}delete _0x58b67f[_0xb9bd('0x32')];}catch(_0xde03a0){_0x235a99(_0xde03a0);}_0x111bc9(_0x58b67f);});}function updateWhatsappInteraction(_0x350f87,_0x481309,_0x502e02){return new BPromise(function(_0x16254a,_0x5a6f20){return getInteractionUsers(_0x350f87,_0x502e02)['then'](function(_0x438b23){return getInteractionTags(_0x438b23,_0x481309);})[_0xb9bd('0x29')](function(_0x3666ba){return getStateInteraction(_0x3666ba);})[_0xb9bd('0x29')](function(_0x352339){_0x16254a(_0x352339);})[_0xb9bd('0x37')](function(_0x239009){_0x5a6f20(_0x239009);});});}function getStateInteraction(_0x32a4b0){return new BPromise(function(_0x37469c){_0x32a4b0[_0xb9bd('0x38')]=0x0;_0x32a4b0[_0xb9bd('0x39')]=0x0;_0x32a4b0['answered']=0x0;_0x32a4b0[_0xb9bd('0x3a')]=0x0;_0x32a4b0[_0xb9bd('0x3b')]=0x0;if(!_0x32a4b0[_0xb9bd('0x3c')]&&!_0x32a4b0[_0xb9bd('0x3d')]){_0x32a4b0['waiting']+=0x1;}if(!_0x32a4b0['closed']&&_0x32a4b0[_0xb9bd('0x3d')]){_0x32a4b0[_0xb9bd('0x39')]+=0x1;if(_0x32a4b0[_0xb9bd('0x38')]){_0x32a4b0['waiting']-=0x1;}}if(_0x32a4b0[_0xb9bd('0x3c')]&&_0x32a4b0['UserId']){_0x32a4b0[_0xb9bd('0x3e')]+=0x1;if(_0x32a4b0[_0xb9bd('0x39')]){_0x32a4b0[_0xb9bd('0x39')]-=0x1;}}if(_0x32a4b0[_0xb9bd('0x3c')]&&!_0x32a4b0[_0xb9bd('0x3d')]){_0x32a4b0[_0xb9bd('0x3a')]+=0x1;if(_0x32a4b0['waiting']){_0x32a4b0[_0xb9bd('0x38')]-=0x1;}}_0x32a4b0[_0xb9bd('0x3b')]+=0x1;_0x37469c(_0x32a4b0);});}exports[_0xb9bd('0x3f')]=function(_0x11da60,_0x89e03d){var _0x2e4226={},_0x358dd3={},_0x42e19d={'count':0x0,'rows':[]};var _0x50b603=_[_0xb9bd('0x31')](db[_0xb9bd('0x40')][_0xb9bd('0x41')],function(_0x594e9c){return{'name':_0x594e9c[_0xb9bd('0x42')],'type':_0x594e9c['type'][_0xb9bd('0x43')]};});_0x358dd3[_0xb9bd('0x44')]=_[_0xb9bd('0x31')](_0x50b603,_0xb9bd('0x2e'));_0x358dd3['query']=_[_0xb9bd('0x45')](_0x11da60[_0xb9bd('0x46')]);_0x358dd3[_0xb9bd('0x47')]=_[_0xb9bd('0x48')](_0x358dd3['model'],_0x358dd3[_0xb9bd('0x46')]);_0x2e4226['attributes']=_[_0xb9bd('0x48')](_0x358dd3[_0xb9bd('0x44')],qs[_0xb9bd('0x49')](_0x11da60[_0xb9bd('0x46')]['fields']));_0x2e4226[_0xb9bd('0x4a')]=_0x2e4226['attributes']['length']?_0x2e4226[_0xb9bd('0x4a')]:_0x358dd3['model'];if(!_0x11da60[_0xb9bd('0x46')]['hasOwnProperty'](_0xb9bd('0x4b'))){_0x2e4226[_0xb9bd('0x23')]=qs['limit'](_0x11da60[_0xb9bd('0x46')][_0xb9bd('0x23')]);_0x2e4226[_0xb9bd('0x20')]=qs[_0xb9bd('0x20')](_0x11da60['query'][_0xb9bd('0x20')]);}_0x2e4226[_0xb9bd('0x4c')]=qs[_0xb9bd('0x4d')](_0x11da60[_0xb9bd('0x46')][_0xb9bd('0x4d')]);_0x2e4226[_0xb9bd('0x4e')]=qs['filters'](_[_0xb9bd('0x4f')](_0x11da60[_0xb9bd('0x46')],_0x358dd3[_0xb9bd('0x47')]),_0x50b603);var _0x31ef15=[];var _0x4e1a1d=squel[_0xb9bd('0x50')]()[_0xb9bd('0x51')]('id')[_0xb9bd('0x51')](_0xb9bd('0x2e'))[_0xb9bd('0x51')](_0xb9bd('0x52'))[_0xb9bd('0x53')](_0xb9bd('0x54'));var _0x1550d5=squel[_0xb9bd('0x50')]()[_0xb9bd('0x51')](_0xb9bd('0x55'))[_0xb9bd('0x51')]('u.fullname')[_0xb9bd('0x51')]('ui.WhatsappInteractionId')[_0xb9bd('0x53')]('user_has_whatsapp_interactions','ui')[_0xb9bd('0x56')](_0xb9bd('0x57'),'u',_0xb9bd('0x58'));var _0x56e7e5=squel[_0xb9bd('0x50')]()['from'](_0xb9bd('0x59'),'i')[_0xb9bd('0x56')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0xb9bd('0x57'),'o',_0xb9bd('0x5a'))[_0xb9bd('0x56')](_0xb9bd('0x5b'),'a','a.id\x20=\x20i.WhatsappAccountId')[_0xb9bd('0x56')](_0xb9bd('0x5c'),'me',_0xb9bd('0x5d'))['left_join'](_0xb9bd('0x5e'),'it',_0xb9bd('0x5f'))['left_join'](_0xb9bd('0x54'),'t',_0xb9bd('0x60'));var _0x583a34=squel['expr']();var _0x5314ba=[];var _0x2b682e=squel[_0xb9bd('0x61')]();var _0x580f52;if(_0x11da60[_0xb9bd('0x46')][_0xb9bd('0x62')]){_0x580f52=as[_0xb9bd('0x63')](_0x11da60[_0xb9bd('0x46')][_0xb9bd('0x62')]);var _0x557f3d=_0x580f52['sqlOperator'];for(var _0x3e57b3=0x0;_0x3e57b3<_0x580f52[_0xb9bd('0x64')][_0xb9bd('0x65')];_0x3e57b3++){var _0x2c5c32=_0x580f52['conditions'][_0x3e57b3];var _0x5c4164='i';var _0x101414=_['find'](_0x50b603,[_0xb9bd('0x2e'),_0x2c5c32[_0xb9bd('0x51')]]);if(!_0x101414){switch(_0x2c5c32['field']){case'unreadMessages':if(_0x2c5c32['value']==0x1){_0x56e7e5[_0xb9bd('0x66')]('`'+_0x2c5c32[_0xb9bd('0x51')]+'`\x20=\x200');}else{_0x56e7e5['having']('`'+_0x2c5c32[_0xb9bd('0x51')]+_0xb9bd('0x67'));}break;case _0xb9bd('0x68'):if(_0x2c5c32[_0xb9bd('0x69')]===_0xb9bd('0x6a')){if(_0x2c5c32['value']['split']('\x20')[_0xb9bd('0x65')]>0x1){_0x583a34[_0x557f3d]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xb9bd('0x6b')](_0x2c5c32[_0xb9bd('0x6c')]),null);}else{var _0x1410fb='%'+_0x2c5c32[_0xb9bd('0x6c')]+'%';_0x583a34[_0x557f3d]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x1410fb,_0x1410fb,_0x1410fb);}}else{_0x101414=_[_0xb9bd('0x6d')](_0x50b603,[_0xb9bd('0x2e'),'ContactId']);_0x2c5c32[_0xb9bd('0x51')]=_0xb9bd('0x6e');_0x36df35=as[_0xb9bd('0x6f')](_0x5c4164,_0x101414[_0xb9bd('0x70')],_0x2c5c32);_0x583a34[_0x557f3d](_0x36df35[_0xb9bd('0x71')],_0x36df35['value']['start'],_0x36df35[_0xb9bd('0x6c')][_0xb9bd('0x2a')]);}break;case _0xb9bd('0x72'):var _0x39689f=_0x2c5c32[_0xb9bd('0x6c')]['split'](',')[_0xb9bd('0x31')](function(_0x5e42d8){return Number(_0x5e42d8);});_0x39689f[_0xb9bd('0x35')](function(_0x519efd){_0x2b682e['or'](_0xb9bd('0x73'),'%,'+_0x519efd+',%');});_0x5314ba=_[_0xb9bd('0x74')](_0x5314ba,_0x39689f);break;case _0xb9bd('0x75'):if(_0x2c5c32[_0xb9bd('0x69')]===_0xb9bd('0x6a')){_0x583a34[_0x557f3d](_0xb9bd('0x76'),'%'+_0x2c5c32['value']+'%',null);}else{_0x101414=_[_0xb9bd('0x6d')](_0x50b603,[_0xb9bd('0x2e'),_0xb9bd('0x3d')]);_0x2c5c32[_0xb9bd('0x51')]=_0xb9bd('0x3d');_0x36df35=as['buildExpression'](_0x5c4164,_0x101414[_0xb9bd('0x70')],_0x2c5c32);_0x583a34[_0x557f3d](_0x36df35[_0xb9bd('0x71')],_0x36df35[_0xb9bd('0x6c')][_0xb9bd('0x77')],_0x36df35[_0xb9bd('0x6c')][_0xb9bd('0x2a')]);}break;case'body':_0x36df35=as[_0xb9bd('0x6f')]('me',null,_0x2c5c32);_0x583a34[_0x557f3d](_0x36df35[_0xb9bd('0x71')],_0x36df35[_0xb9bd('0x6c')][_0xb9bd('0x77')],_0x36df35['value'][_0xb9bd('0x2a')]);break;}}else{var _0x36df35=as[_0xb9bd('0x6f')](_0x5c4164,_0x101414[_0xb9bd('0x70')],_0x2c5c32);_0x583a34[_0x557f3d](_0x36df35['text'],_0x36df35[_0xb9bd('0x6c')][_0xb9bd('0x77')],_0x36df35[_0xb9bd('0x6c')][_0xb9bd('0x2a')]);}}}else{var _0x582c3b=_(_0x11da60['query'])[_0xb9bd('0x45')]()[_0xb9bd('0x31')](function(_0xbca498){return _[_0xb9bd('0x78')](_0x50b603,[_0xb9bd('0x2e'),_0xbca498])?_0xbca498:undefined;})['compact']()[_0xb9bd('0x6c')]();if(!_['isEmpty'](_0x582c3b)){_0x582c3b[_0xb9bd('0x35')](function(_0x1ac1a0){if(_0x1ac1a0===_0xb9bd('0x79')){_0x56e7e5[_0xb9bd('0x4e')](_0xb9bd('0x7a'),[]['concat'](_0x11da60['query'][_0x1ac1a0]));}else if(_0x1ac1a0===_0xb9bd('0x7b')){var _0x2216de=JSON[_0xb9bd('0x7c')](_0x11da60[_0xb9bd('0x46')][_0x1ac1a0])[_0xb9bd('0x7d')];var _0x39ae3a=JSON[_0xb9bd('0x7c')](_0x11da60[_0xb9bd('0x46')][_0x1ac1a0])[_0xb9bd('0x7e')];_0x56e7e5['where'](_0xb9bd('0x7f'),_0x2216de,_0x39ae3a);}else{if(_0x11da60[_0xb9bd('0x46')][_0x1ac1a0]===_0xb9bd('0x80')){_0x56e7e5['where']('i.'+_0x1ac1a0+_0xb9bd('0x81'));}else{_0x56e7e5[_0xb9bd('0x4e')]('i.'+_0x1ac1a0+_0xb9bd('0x82'),_0x11da60[_0xb9bd('0x46')][_0x1ac1a0]);}}});}if(_0x11da60[_0xb9bd('0x46')][_0xb9bd('0x83')]){if(_0x11da60['query'][_0xb9bd('0x83')]==0x1){_0x56e7e5[_0xb9bd('0x66')]('`unreadMessages`\x20=\x200');}else{_0x56e7e5['having'](_0xb9bd('0x84'));}}if(_0x11da60['query'][_0xb9bd('0x85')]){_0x5314ba=_[_0xb9bd('0x86')](_0x11da60[_0xb9bd('0x46')][_0xb9bd('0x85')])?_0x11da60['query'][_0xb9bd('0x85')]:new Array(_0x11da60[_0xb9bd('0x46')]['tag']);_0x5314ba['forEach'](function(_0x233574){_0x2b682e['or'](_0xb9bd('0x73'),'%,'+_0x233574+',%');});}if(_0x11da60[_0xb9bd('0x46')][_0xb9bd('0x87')]){var _0x2b46d0=_0x11da60[_0xb9bd('0x46')][_0xb9bd('0x87')][_0xb9bd('0x88')]('\x5c','\x5c\x5c')[_0xb9bd('0x88')](/'/g,'\x27\x27');if(qs[_0xb9bd('0x89')](_0x2b46d0)){_0x583a34['or']('i.id\x20LIKE\x20?',_0x2b46d0+'%')['or'](_0xb9bd('0x8a'),_0x2b46d0+'%');}else{_0x583a34['or'](_0xb9bd('0x8b'),qs[_0xb9bd('0x6b')](_0x2b46d0))['or'](_0xb9bd('0x8c'),_0x2b46d0+'%');}}}_0x56e7e5['where'](_0x583a34);_0x56e7e5[_0xb9bd('0x8d')](_0xb9bd('0x8e'));var _0x3a5878={'type':db[_0xb9bd('0x8f')][_0xb9bd('0x90')]['SELECT'],'raw':!![]};var _0x422ed0=_0x56e7e5[_0xb9bd('0x91')]();_0x422ed0['field'](_0xb9bd('0x8e'));_0x422ed0[_0xb9bd('0x51')](_0xb9bd('0x92'),_0xb9bd('0x93'));if(_0x2e4226['order']){_0x2e4226['order'][_0xb9bd('0x35')](function(_0x17b959){var _0x9d3dc4=_0x17b959[0x0]==='contactName'?_0x17b959[0x0]:'i.'+_0x17b959[0x0];_0x56e7e5[_0xb9bd('0x4c')](_0x9d3dc4,_0x17b959[0x1]===_0xb9bd('0x94')?![]:!![]);});}if(!_[_0xb9bd('0x95')](_0x5314ba)){_0x56e7e5[_0xb9bd('0x66')](_0x2b682e);_0x422ed0[_0xb9bd('0x4e')]('t.id\x20IN\x20?',_0x5314ba);}BPromise[_0xb9bd('0x96')]()['then'](function(){if(!_0x580f52){if(_0x11da60[_0xb9bd('0x46')][_0xb9bd('0x79')])return;_0x422ed0[_0xb9bd('0x4e')](_0xb9bd('0x97'));_0x56e7e5[_0xb9bd('0x4e')](_0xb9bd('0x97'));return;}if(_0x11da60['user'][_0xb9bd('0x98')]!=='agent')return;return _0x11da60['user'][_0xb9bd('0x99')]({'attributes':['id'],'raw':!![]})['then'](function(_0x146821){if(_[_0xb9bd('0x95')](_0x146821)){_0x422ed0['where']('i.WhatsappAccountId\x20IS\x20NULL');_0x56e7e5[_0xb9bd('0x4e')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x422ed0[_0xb9bd('0x4e')](_0xb9bd('0x7a'),_[_0xb9bd('0x31')](_0x146821,'id'));_0x56e7e5['where'](_0xb9bd('0x7a'),_[_0xb9bd('0x31')](_0x146821,'id'));}});})['then'](function(){if(_0x11da60[_0xb9bd('0x9a')][_0xb9bd('0x98')]===_0xb9bd('0x9b')&&!_0x580f52&&!_0x11da60['query']['WhatsappAccountId'])return[];return db[_0xb9bd('0x9c')][_0xb9bd('0x46')](_0x422ed0['toString'](),_0x3a5878);})['then'](function(_0x463e63){_0x42e19d[_0xb9bd('0x22')]=_0x463e63[_0xb9bd('0x65')];if(_0x42e19d[_0xb9bd('0x22')]===0x0)return[];return db[_0xb9bd('0x9c')][_0xb9bd('0x46')](_0x4e1a1d[_0xb9bd('0x9d')](),_0x3a5878)[_0xb9bd('0x29')](function(_0x851b7){_0x31ef15=_['keyBy'](_0x851b7,'id');_0x3a5878=_[_0xb9bd('0x9e')](_0x3a5878,{'model':db[_0xb9bd('0x40')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x11da60['query'][_0xb9bd('0x49')]){_0x2e4226[_0xb9bd('0x4a')][_0xb9bd('0x35')](function(_0x4c6afd){_0x56e7e5[_0xb9bd('0x51')]('i.'+_0x4c6afd);});}else{_0x56e7e5[_0xb9bd('0x51')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x56e7e5['field'](_0xb9bd('0x9f'),_0xb9bd('0xa0'));_0x56e7e5[_0xb9bd('0x51')](_0xb9bd('0xa1'),_0xb9bd('0xa2'));_0x56e7e5[_0xb9bd('0x51')](_0xb9bd('0xa3'),_0xb9bd('0xa4'));_0x56e7e5[_0xb9bd('0x51')](_0xb9bd('0xa5'));_0x56e7e5[_0xb9bd('0x51')](_0xb9bd('0xa6'),_0xb9bd('0xa7'));_0x56e7e5[_0xb9bd('0x51')](_0xb9bd('0xa8'),_0xb9bd('0xa9'));_0x56e7e5[_0xb9bd('0x51')](_0xb9bd('0xaa'),_0xb9bd('0xab'));_0x56e7e5[_0xb9bd('0x51')]('c.phone',_0xb9bd('0xac'));_0x56e7e5['field'](_0xb9bd('0xad'),_0xb9bd('0xae'));_0x56e7e5[_0xb9bd('0x51')](_0xb9bd('0xaf'),_0xb9bd('0xb0'));_0x56e7e5[_0xb9bd('0x51')]('o.fullname','Owner.fullname');_0x56e7e5[_0xb9bd('0x51')](_0xb9bd('0xb1'),_0xb9bd('0xb2'));_0x56e7e5[_0xb9bd('0x51')](_0xb9bd('0xb3'),_0xb9bd('0x32'));}if(_0x2e4226[_0xb9bd('0x23')])_0x56e7e5[_0xb9bd('0x23')](_0x2e4226['limit']);if(_0x2e4226[_0xb9bd('0x20')])_0x56e7e5['offset'](_0x2e4226[_0xb9bd('0x20')]);return db[_0xb9bd('0x9c')][_0xb9bd('0x46')](_0x56e7e5[_0xb9bd('0x9d')](),_0x3a5878);})[_0xb9bd('0x29')](function(_0x1ed7fc){if(_0x1ed7fc[_0xb9bd('0x65')]>0x0)_0x1550d5[_0xb9bd('0x4e')](_0xb9bd('0xb4'),_[_0xb9bd('0x31')](_0x1ed7fc,'id'));return db[_0xb9bd('0x9c')][_0xb9bd('0x46')](_0x1550d5[_0xb9bd('0x9d')](),_0x3a5878)['then'](function(_0x2b9cb2){var _0x140a6e=_[_0xb9bd('0xb5')](_0x2b9cb2,_0xb9bd('0xb6'));var _0x3ed6ab=[];_0x1ed7fc[_0xb9bd('0x35')](function(_0x20149d){_0x3ed6ab[_0xb9bd('0x36')](updateWhatsappInteraction(_0x20149d,_0x31ef15,_0x140a6e));});return BPromise['all'](_0x3ed6ab);});});})[_0xb9bd('0x29')](function(_0x5519cf){_0x42e19d[_0xb9bd('0xb7')]=_0x5519cf;return _0x42e19d;})[_0xb9bd('0x29')](respondWithFilteredResult(_0x89e03d,_0x2e4226))[_0xb9bd('0x37')](handleError(_0x89e03d,null));};exports[_0xb9bd('0xb8')]=function(_0x5bda50,_0x1683f8){var _0x5b06ee={'raw':![],'where':{'id':_0x5bda50[_0xb9bd('0xb9')]['id']}},_0x235c0d={};_0x235c0d[_0xb9bd('0x44')]=_[_0xb9bd('0x45')](db['WhatsappInteraction'][_0xb9bd('0x41')]);_0x235c0d[_0xb9bd('0x46')]=_[_0xb9bd('0x45')](_0x5bda50[_0xb9bd('0x46')]);_0x235c0d[_0xb9bd('0x47')]=_[_0xb9bd('0x48')](_0x235c0d['model'],_0x235c0d[_0xb9bd('0x46')]);_0x5b06ee['attributes']=_['intersection'](_0x235c0d[_0xb9bd('0x44')],qs[_0xb9bd('0x49')](_0x5bda50[_0xb9bd('0x46')]['fields']));_0x5b06ee[_0xb9bd('0x4a')]=_0x5b06ee[_0xb9bd('0x4a')][_0xb9bd('0x65')]?_0x5b06ee[_0xb9bd('0x4a')]:_0x235c0d['model'];if(_0x5bda50[_0xb9bd('0x46')][_0xb9bd('0xba')]){_0x5b06ee[_0xb9bd('0xbb')]=[{'all':!![]}];}_0x5b06ee=_[_0xb9bd('0x9e')]({},_0x5b06ee,_0x5bda50[_0xb9bd('0xbc')]);return db[_0xb9bd('0x40')][_0xb9bd('0x6d')](_0x5b06ee)[_0xb9bd('0x29')](handleEntityNotFound(_0x1683f8,null))[_0xb9bd('0x29')](respondWithResult(_0x1683f8,null))[_0xb9bd('0x37')](handleError(_0x1683f8,null));};exports[_0xb9bd('0xbd')]=function(_0x129f9e,_0x3793f5){return db[_0xb9bd('0x40')]['create'](_0x129f9e['body'],{})[_0xb9bd('0x29')](respondWithResult(_0x3793f5,0xc9))[_0xb9bd('0x37')](handleError(_0x3793f5,null));};exports[_0xb9bd('0x27')]=function(_0x29d08c,_0x1d3fd5){if(_0x29d08c[_0xb9bd('0xbe')]['id']){delete _0x29d08c[_0xb9bd('0xbe')]['id'];}return db['WhatsappInteraction'][_0xb9bd('0x6d')]({'where':{'id':_0x29d08c[_0xb9bd('0xb9')]['id']}})[_0xb9bd('0x29')](handleEntityNotFound(_0x1d3fd5,null))[_0xb9bd('0x29')](saveUpdates(_0x29d08c[_0xb9bd('0xbe')],null))['then'](respondWithResult(_0x1d3fd5,null))[_0xb9bd('0x37')](handleError(_0x1d3fd5,null));};exports[_0xb9bd('0x28')]=function(_0x19d83e,_0x37e26e){return db[_0xb9bd('0x40')][_0xb9bd('0x6d')]({'where':{'id':_0x19d83e['params']['id']}})[_0xb9bd('0x29')](handleEntityNotFound(_0x37e26e,null))['then'](removeEntity(_0x37e26e,null))[_0xb9bd('0x37')](handleError(_0x37e26e,null));};exports[_0xb9bd('0xbf')]=function(_0x5cd364,_0x4a248f){return db['WhatsappInteraction'][_0xb9bd('0xbf')]()['then'](respondWithResult(_0x4a248f,null))[_0xb9bd('0x37')](handleError(_0x4a248f,null));};exports[_0xb9bd('0xc0')]=function(_0x599cb1,_0x3bea7f,_0x5938d8){return db['WhatsappMessage'][_0xb9bd('0x6d')]({'where':{'id':_0x599cb1[_0xb9bd('0xb9')]['id']}})[_0xb9bd('0x29')](handleEntityNotFound(_0x3bea7f,null))[_0xb9bd('0x29')](function(_0x19fd0f){if(_0x19fd0f){return _0x19fd0f[_0xb9bd('0xc0')](_0x599cb1['body'][_0xb9bd('0xc1')],_[_0xb9bd('0xc2')](_0x599cb1[_0xb9bd('0xbe')],['ids','id'])||{});}})[_0xb9bd('0x29')](respondWithResult(_0x3bea7f,null))[_0xb9bd('0x37')](handleError(_0x3bea7f,null));};exports[_0xb9bd('0xc3')]=function(_0x4b0690,_0x1035bb,_0x213691){var _0x1a4185={'raw':![],'where':{}};var _0x391bd5={};var _0x11946c={'count':0x0,'rows':[]};return db['WhatsappInteraction']['findOne']({'where':{'id':_0x4b0690['params']['id']}})[_0xb9bd('0x29')](handleEntityNotFound(_0x1035bb,null))['then'](function(_0x19e19a){if(_0x19e19a){_0x391bd5[_0xb9bd('0x44')]=_[_0xb9bd('0x45')](db['WhatsappMessage']['rawAttributes']);_0x391bd5['query']=_['keys'](_0x4b0690[_0xb9bd('0x46')]);_0x391bd5[_0xb9bd('0x47')]=_[_0xb9bd('0x48')](_0x391bd5[_0xb9bd('0x44')],_0x391bd5['query']);_0x1a4185[_0xb9bd('0x4a')]=_[_0xb9bd('0x48')](_0x391bd5[_0xb9bd('0x44')],qs[_0xb9bd('0x49')](_0x4b0690['query']['fields']));_0x1a4185[_0xb9bd('0x4a')]=_0x1a4185['attributes'][_0xb9bd('0x65')]?_0x1a4185['attributes']:_0x391bd5[_0xb9bd('0x44')];if(!_0x4b0690[_0xb9bd('0x46')]['hasOwnProperty'](_0xb9bd('0x4b'))){_0x1a4185[_0xb9bd('0x23')]=qs[_0xb9bd('0x23')](_0x4b0690['query'][_0xb9bd('0x23')]);_0x1a4185['offset']=qs[_0xb9bd('0x20')](_0x4b0690[_0xb9bd('0x46')][_0xb9bd('0x20')]);}_0x1a4185[_0xb9bd('0x4c')]=qs[_0xb9bd('0x4d')](_0x4b0690[_0xb9bd('0x46')][_0xb9bd('0x4d')]);_0x1a4185[_0xb9bd('0x4e')]=qs[_0xb9bd('0x47')](_[_0xb9bd('0x4f')](_0x4b0690[_0xb9bd('0x46')],_0x391bd5[_0xb9bd('0x47')]));_0x1a4185['where']['WhatsappInteractionId']=_0x19e19a['id'];if(_0x4b0690[_0xb9bd('0x46')]['filter']){_0x1a4185[_0xb9bd('0x4e')]=_[_0xb9bd('0x9e')](_0x1a4185['where'],{'$or':_[_0xb9bd('0x31')](_0x1a4185[_0xb9bd('0x4a')],function(_0x532b8f){var _0x4ffff6={};_0x4ffff6[_0x532b8f]={'$like':'%'+_0x4b0690[_0xb9bd('0x46')][_0xb9bd('0x87')]+'%'};return _0x4ffff6;})});}if(_0x4b0690[_0xb9bd('0x46')][_0xb9bd('0x7d')]){var _0x2ce86a=_0x4b0690[_0xb9bd('0x46')][_0xb9bd('0x7d')]['split'](',');var _0x30c055={};_0x30c055[_0x2ce86a[0x0]]={'$gte':moment(_0x2ce86a[0x1])[_0xb9bd('0xc4')](_0xb9bd('0xc5'))};_0x1a4185[_0xb9bd('0x4e')]=_[_0xb9bd('0x9e')](_0x1a4185[_0xb9bd('0x4e')],_0x30c055);}_0x1a4185=_[_0xb9bd('0x9e')]({},_0x1a4185,_0x4b0690['options']);return db[_0xb9bd('0xc6')][_0xb9bd('0x22')]({'where':_0x1a4185[_0xb9bd('0x4e')]})[_0xb9bd('0x29')](function(_0xed6e07){_0x11946c['count']=_0xed6e07;if(_0x4b0690['query'][_0xb9bd('0xba')]){_0x1a4185[_0xb9bd('0xbb')]=[{'all':!![]}];}return db[_0xb9bd('0xc6')][_0xb9bd('0xc7')](_0x1a4185);})['then'](function(_0x17c670){_0x11946c['rows']=_0x17c670;return _0x11946c;});}})[_0xb9bd('0x29')](respondWithFilteredResult(_0x1035bb,_0x1a4185))[_0xb9bd('0x37')](handleError(_0x1035bb,null));};exports[_0xb9bd('0xc8')]=function(_0x518ef2,_0x1caa4c,_0x51447a){return db['WhatsappInteraction'][_0xb9bd('0x6d')]({'where':{'id':_0x518ef2[_0xb9bd('0xb9')]['id']}})[_0xb9bd('0x29')](handleEntityNotFound(_0x1caa4c,null))['then'](function(_0x1cdd0d){if(_0x1cdd0d){return _0x1cdd0d[_0xb9bd('0xc9')](_0x518ef2[_0xb9bd('0xbe')][_0xb9bd('0xc1')],_[_0xb9bd('0xc2')](_0x518ef2[_0xb9bd('0xbe')],[_0xb9bd('0xc1'),'id'])||{})[_0xb9bd('0xca')](function(){return db['Tag'][_0xb9bd('0xc7')]({'attributes':['id',_0xb9bd('0x2e'),'color'],'where':{'id':_0x518ef2[_0xb9bd('0xbe')]['ids']}});})[_0xb9bd('0x29')](function(_0xd6bceb){socket[_0xb9bd('0xcb')](_0xb9bd('0xcc'),{'id':Number(_0x518ef2[_0xb9bd('0xb9')]['id']),'tags':_0xd6bceb||[]});return{'id':Number(_0x518ef2[_0xb9bd('0xb9')]['id']),'tags':_0xd6bceb||[]};});}})['then'](respondWithResult(_0x1caa4c,null))['catch'](handleError(_0x1caa4c,null));};exports[_0xb9bd('0xcd')]=function(_0x2160da,_0x19e2e9,_0x4dd127){return db[_0xb9bd('0x40')][_0xb9bd('0x6d')]({'where':{'id':_0x2160da[_0xb9bd('0xb9')]['id']}})[_0xb9bd('0x29')](handleEntityNotFound(_0x19e2e9,null))['then'](function(_0x53b519){if(_0x53b519){return _0x53b519[_0xb9bd('0xcd')](_0x2160da[_0xb9bd('0x46')][_0xb9bd('0xc1')]);}})[_0xb9bd('0x29')](respondWithStatusCode(_0x19e2e9,null))[_0xb9bd('0x37')](handleError(_0x19e2e9,null));};exports['download']=function(_0x194141,_0x289b76){var _0x174e4e=moment()['unix']()[_0xb9bd('0x9d')]();var _0x572191=path[_0xb9bd('0xce')](config[_0xb9bd('0xcf')],_0xb9bd('0xd0'),_0xb9bd('0xd1'),_0xb9bd('0xd2'));var _0x560a55=path[_0xb9bd('0xce')](config[_0xb9bd('0xcf')],_0xb9bd('0xd0'),'files',_0xb9bd('0xd3'));var _0x10ee50=path['join'](_0x572191,_0x174e4e);var _0x39a78f=util[_0xb9bd('0xc4')](_0xb9bd('0xd4'),_0x194141['params']['id'],_0x174e4e);var _0x2fd30f=path[_0xb9bd('0xce')](_0x572191,_0x39a78f);var _0x41089d=[];_0x41089d[_0xb9bd('0x36')]({'model':db[_0xb9bd('0x75')],'as':_0xb9bd('0x75'),'attributes':['id','fullname'],'raw':!![]});_0x41089d[_0xb9bd('0x36')]({'model':db[_0xb9bd('0xd5')],'as':_0xb9bd('0x68'),'attributes':['id',_0xb9bd('0xd6'),'lastName'],'raw':!![]});if(_0x194141[_0xb9bd('0x46')][_0xb9bd('0xd3')]){_0x41089d['push']({'model':db[_0xb9bd('0xd7')],'as':_0xb9bd('0xd7'),'raw':!![]});}var _0x4d9c79=[{'model':db['WhatsappMessage'],'as':_0xb9bd('0xd8'),'attributes':['id',_0xb9bd('0xbe'),_0xb9bd('0x7b'),_0xb9bd('0xd9'),_0xb9bd('0xda'),'read'],'include':_0x41089d}];_0x4d9c79[_0xb9bd('0x36')]({'model':db[_0xb9bd('0xdb')],'as':'Account','attributes':['id',_0xb9bd('0x2e')]});_0x4d9c79[_0xb9bd('0x36')]({'model':db['User'],'as':_0xb9bd('0xdc'),'attributes':['id',_0xb9bd('0xdd')]});return db['WhatsappInteraction'][_0xb9bd('0x6d')]({'where':{'id':_0x194141[_0xb9bd('0xb9')]['id']},'include':_0x4d9c79})[_0xb9bd('0x29')](handleEntityNotFound(_0x289b76,null))[_0xb9bd('0x29')](function(_0x453066){if(_0x453066){var _0x9b8cef=_0x453066[_0xb9bd('0xde')]({'plain':!![]});fs[_0xb9bd('0xdf')](_0x10ee50);var _0x432d73={'channel':'Whatsapp','account':_0x9b8cef[_0xb9bd('0xe0')]['name'],'agent':_0x9b8cef['Owner']?_0x9b8cef[_0xb9bd('0xdc')][_0xb9bd('0xdd')]:_0xb9bd('0xe1'),'createdAt':moment(_0x9b8cef['createdAt'])['format'](_0xb9bd('0xc5'))[_0xb9bd('0x9d')](),'closedAt':_0x9b8cef[_0xb9bd('0x3c')]?moment(_0x9b8cef[_0xb9bd('0xe2')])[_0xb9bd('0xc4')](_0xb9bd('0xc5'))[_0xb9bd('0x9d')]():'','disposition':_0x9b8cef['disposition'],'messages':_(_0x9b8cef['Messages'])['filter']({'secret':![]})[_0xb9bd('0x31')](function(_0x3288d0){if(_0x3288d0[_0xb9bd('0xd7')]){var _0x4cfd71=path[_0xb9bd('0xce')](_0x560a55,_0x3288d0[_0xb9bd('0xd7')][_0xb9bd('0xe3')]);if(fs[_0xb9bd('0xe4')](_0x4cfd71)){fs[_0xb9bd('0xe5')](_0x4cfd71)[_0xb9bd('0xe6')](fs['createWriteStream'](path['join'](_0x10ee50,_0x3288d0[_0xb9bd('0xd7')][_0xb9bd('0xe3')])));}}return{'date':moment(_0x3288d0[_0xb9bd('0x7b')])['format'](_0xb9bd('0xc5'))[_0xb9bd('0x9d')](),'sender':_0x3288d0['direction']===_0xb9bd('0xe7')?_0x3288d0[_0xb9bd('0x75')]?_0x3288d0['User'][_0xb9bd('0xdd')]:_0xb9bd('0xe8'):_0x3288d0[_0xb9bd('0x68')][_0xb9bd('0xd6')]+(_0x3288d0[_0xb9bd('0x68')][_0xb9bd('0xe9')]?'\x20'+_0x3288d0[_0xb9bd('0x68')][_0xb9bd('0xe9')]:''),'body':_0x3288d0[_0xb9bd('0xd7')]?_0x3288d0[_0xb9bd('0xd7')][_0xb9bd('0xe3')]:_0x3288d0[_0xb9bd('0xbe')],'direction':_0x3288d0['direction']==='out'?'A':'C','secret':_0x3288d0[_0xb9bd('0xda')],'read':_0x3288d0[_0xb9bd('0x83')],'attachment':_0x3288d0[_0xb9bd('0xd7')]};})[_0xb9bd('0x6c')]()};return ejs['renderFile'](path[_0xb9bd('0xce')](config[_0xb9bd('0xcf')],_0xb9bd('0xd0'),_0xb9bd('0xea'),_0xb9bd('0xeb')),{'interaction':_0x432d73})[_0xb9bd('0x29')](function(_0x19ce77){var _0x4c61f8=path['join'](_0x10ee50,_0xb9bd('0xec')+_0x9b8cef['id']+'-'+_0x174e4e+_0xb9bd('0xed'));var _0x22d963={'path':_0x4c61f8,'channel':_0xb9bd('0xee'),'interactionId':_0x9b8cef['id']};return pdf['createPdfFromHTML'](_0x19ce77,_0x22d963);})[_0xb9bd('0x29')](function(){return new BPromise(function(_0x50ad80,_0x20e9cf){zipdir(_0x10ee50,{'saveTo':_0x2fd30f},function(_0x32954a,_0x45e840){if(_0x32954a)return _0x20e9cf(_0x32954a);return _0x50ad80(_0x45e840);});})[_0xb9bd('0x29')](function(){return new BPromise(function(_0x3da944,_0x53527b){rimraf(_0x10ee50,function(_0x1259dd){if(_0x1259dd)_0x53527b(_0x1259dd);return _0x3da944();});});})[_0xb9bd('0x29')](function(){return _0x289b76[_0xb9bd('0xef')](_0x2fd30f,_0x39a78f,function(_0x36b217){if(_0x36b217){console[_0xb9bd('0xf0')](_0xb9bd('0xf1'),_0x36b217);}else{fs[_0xb9bd('0xf2')](_0x2fd30f);}});});});}else{return _0x289b76[_0xb9bd('0x2b')](0xc8);}})[_0xb9bd('0x37')](handleError(_0x289b76,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 8614148..c5f9160 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 _0xd87e=['../../mysqldb','WhatsappMessage','setMaxListeners','update','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','exports','events'];(function(_0x555428,_0x223f21){var _0x3e2fef=function(_0x319154){while(--_0x319154){_0x555428['push'](_0x555428['shift']());}};_0x3e2fef(++_0x223f21);}(_0xd87e,0x1bf));var _0xed87=function(_0x70a8a5,_0x35a384){_0x70a8a5=_0x70a8a5-0x0;var _0x2b563b=_0xd87e[_0x70a8a5];return _0x2b563b;};'use strict';var EventEmitter=require(_0xed87('0x0'));var WhatsappInteraction=require(_0xed87('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0xed87('0x1'))['db'][_0xed87('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xed87('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xed87('0x4'),'afterDestroy':'remove'};function emitEvent(_0x11a5d9){return function(_0x41ca7c,_0x5c9f03,_0x17adfe){_0x41ca7c['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0xa33c67){_0x41ca7c[_0xed87('0x5')](_0xed87('0x6'),_0xa33c67[_0xed87('0x7')](function(_0x569d66){return{'id':_0x569d66['id']};}));return WhatsappMessage[_0xed87('0x8')]({'where':{'WhatsappInteractionId':_0x41ca7c['id'],'direction':'in','read':![]},'raw':!![]});})[_0xed87('0x9')](function(_0x21d399){_0x41ca7c[_0xed87('0x5')](_0xed87('0xa'),_0x21d399[_0xed87('0xb')]);WhatsappInteractionEvents[_0xed87('0xc')](_0x11a5d9+':'+_0x41ca7c['id'],_0x41ca7c);WhatsappInteractionEvents['emit'](_0x11a5d9,_0x41ca7c);_0x17adfe(null);})[_0xed87('0xd')](_0x17adfe(null));};}for(var e in events){if(events[_0xed87('0xe')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0xed87('0xf')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x2c54=['Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','save','update','remove','then','setDataValue'];(function(_0x44d62d,_0x128717){var _0xd4383f=function(_0x288653){while(--_0x288653){_0x44d62d['push'](_0x44d62d['shift']());}};_0xd4383f(++_0x128717);}(_0x2c54,0x136));var _0x42c5=function(_0x1cd562,_0x36b569){_0x1cd562=_0x1cd562-0x0;var _0x182088=_0x2c54[_0x1cd562];return _0x182088;};'use strict';var EventEmitter=require(_0x42c5('0x0'));var WhatsappInteraction=require(_0x42c5('0x1'))['db'][_0x42c5('0x2')];var WhatsappMessage=require('../../mysqldb')['db'][_0x42c5('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x42c5('0x4')](0x0);var events={'afterCreate':_0x42c5('0x5'),'afterUpdate':_0x42c5('0x6'),'afterDestroy':_0x42c5('0x7')};function emitEvent(_0x17924f){return function(_0x5bb3d8,_0x1c5b7a,_0x551181){_0x5bb3d8['getUsers']({'attributes':['id'],'raw':!![]})[_0x42c5('0x8')](function(_0x44516e){_0x5bb3d8[_0x42c5('0x9')](_0x42c5('0xa'),_0x44516e[_0x42c5('0xb')](function(_0x4ce554){return{'id':_0x4ce554['id']};}));return WhatsappMessage[_0x42c5('0xc')]({'where':{'WhatsappInteractionId':_0x5bb3d8['id'],'direction':'in','read':![]},'raw':!![]});})[_0x42c5('0x8')](function(_0x8d1224){_0x5bb3d8[_0x42c5('0x9')](_0x42c5('0xd'),_0x8d1224[_0x42c5('0xe')]);WhatsappInteractionEvents[_0x42c5('0xf')](_0x17924f+':'+_0x5bb3d8['id'],_0x5bb3d8);WhatsappInteractionEvents[_0x42c5('0xf')](_0x17924f,_0x5bb3d8);_0x551181(null);})[_0x42c5('0x10')](_0x551181(null));};}for(var e in events){if(events[_0x42c5('0x11')](e)){var event=events[e];WhatsappInteraction[_0x42c5('0x12')](e,emitEvent(event));}}module[_0x42c5('0x13')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 32c391e..9f333a6 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 _0x6583=['../../config/environment','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','api','moment','path','rimraf'];(function(_0x191a0c,_0x5483be){var _0x4ba3eb=function(_0x3c81c0){while(--_0x3c81c0){_0x191a0c['push'](_0x191a0c['shift']());}};_0x4ba3eb(++_0x5483be);}(_0x6583,0x1e5));var _0x3658=function(_0x30bef2,_0x3d4186){_0x30bef2=_0x30bef2-0x0;var _0x567d67=_0x6583[_0x30bef2];return _0x567d67;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3658('0x0'))(_0x3658('0x1'));var moment=require(_0x3658('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3658('0x3'));var rimraf=require(_0x3658('0x4'));var config=require(_0x3658('0x5'));var attributes=require('./whatsappInteraction.attributes');module['exports']=function(_0x2ac4b1,_0x1ef792){return _0x2ac4b1[_0x3658('0x6')](_0x3658('0x7'),attributes,{'tableName':_0x3658('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x39f88a,_0x1e2172,_0x99f24a){if(_0x39f88a[_0x3658('0x9')](_0x3658('0xa'))){_0x39f88a[_0x3658('0xb')]=moment()[_0x3658('0xc')](_0x3658('0xd'));}_0x99f24a(null,_0x39f88a);}}});}; \ No newline at end of file +var _0x15bd=['define','WhatsappInteraction','whatsapp_interactions','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports'];(function(_0x2d154d,_0x310b93){var _0x44e59f=function(_0x83ae32){while(--_0x83ae32){_0x2d154d['push'](_0x2d154d['shift']());}};_0x44e59f(++_0x310b93);}(_0x15bd,0x6f));var _0xd15b=function(_0x4346aa,_0x1e597e){_0x4346aa=_0x4346aa-0x0;var _0x31a809=_0x15bd[_0x4346aa];return _0x31a809;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xd15b('0x0'));var moment=require(_0xd15b('0x1'));var BPromise=require(_0xd15b('0x2'));var rp=require(_0xd15b('0x3'));var fs=require('fs');var path=require(_0xd15b('0x4'));var rimraf=require(_0xd15b('0x5'));var config=require(_0xd15b('0x6'));var attributes=require(_0xd15b('0x7'));module[_0xd15b('0x8')]=function(_0x140c29,_0x1de998){return _0x140c29[_0xd15b('0x9')](_0xd15b('0xa'),attributes,{'tableName':_0xd15b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x9a3bf3,_0x1c2632,_0x40e14e){if(_0x9a3bf3['changed']('closed')){_0x9a3bf3[_0xd15b('0xc')]=moment()[_0xd15b('0xd')](_0xd15b('0xe'));}_0x40e14e(null,_0x9a3bf3);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index a9908e8..7b7ed86 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 _0x39de=['message','info','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','options','raw','where','limit','then','stringify','AddTagsToWhatsappInteraction','find','body','ids','spread','AddTags','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./whatsappInteraction.socket','register','request','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x35eec2,_0x516e28){var _0x1e7a36=function(_0x5c1cfb){while(--_0x5c1cfb){_0x35eec2['push'](_0x35eec2['shift']());}};_0x1e7a36(++_0x516e28);}(_0x39de,0x85));var _0xe39d=function(_0xdb576,_0x13705e){_0xdb576=_0xdb576-0x0;var _0x98a94b=_0x39de[_0xdb576];return _0x98a94b;};'use strict';var _=require(_0xe39d('0x0'));var util=require(_0xe39d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe39d('0x2'));var db=require(_0xe39d('0x3'))['db'];var utils=require(_0xe39d('0x4'));var logger=require('../../config/logger')(_0xe39d('0x5'));var config=require(_0xe39d('0x6'));var jayson=require(_0xe39d('0x7'));var client=jayson[_0xe39d('0x8')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xe39d('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xe39d('0xa'))(new Redis(config[_0xe39d('0x9')]));require(_0xe39d('0xb'))[_0xe39d('0xc')](socket);function respondWithRpcPromise(_0x51379e,_0x2651dc,_0x1120a3){return new BPromise(function(_0x2b8bf2,_0x500b31){return client[_0xe39d('0xd')](_0x51379e,_0x1120a3)['then'](function(_0x2851c8){logger['info'](_0xe39d('0xe'),_0x2651dc,_0xe39d('0xf'));logger[_0xe39d('0x10')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x2651dc,_0xe39d('0xf'),JSON['stringify'](_0x2851c8));if(_0x2851c8[_0xe39d('0x11')]){if(_0x2851c8[_0xe39d('0x11')][_0xe39d('0x12')]===0x1f4){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x2651dc,_0x2851c8[_0xe39d('0x11')][_0xe39d('0x13')]);return _0x500b31(_0x2851c8[_0xe39d('0x11')][_0xe39d('0x13')]);}logger[_0xe39d('0x11')](_0xe39d('0xe'),_0x2651dc,_0x2851c8[_0xe39d('0x11')]['message']);return _0x2b8bf2(_0x2851c8[_0xe39d('0x11')][_0xe39d('0x13')]);}else{logger[_0xe39d('0x14')](_0xe39d('0xe'),_0x2651dc,_0xe39d('0xf'));_0x2b8bf2(_0x2851c8[_0xe39d('0x15')][_0xe39d('0x13')]);}})[_0xe39d('0x16')](function(_0x47596b){logger['error'](_0xe39d('0xe'),_0x2651dc,_0x47596b);_0x500b31(_0x47596b);});});}exports[_0xe39d('0x17')]=function(_0x1bb0f3){var _0x57b732=this;return new Promise(function(_0x1ded74,_0x426c2e){return db[_0xe39d('0x18')][_0xe39d('0x19')](_0x1bb0f3['body'],{'raw':_0x1bb0f3[_0xe39d('0x1a')]?_0x1bb0f3[_0xe39d('0x1a')][_0xe39d('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1bb0f3['options']?_0x1bb0f3[_0xe39d('0x1a')][_0xe39d('0x1c')]||null:null,'attributes':_0x1bb0f3[_0xe39d('0x1a')]?_0x1bb0f3[_0xe39d('0x1a')]['attributes']||null:null,'limit':_0x1bb0f3['options']?_0x1bb0f3[_0xe39d('0x1a')][_0xe39d('0x1d')]||null:null})[_0xe39d('0x1e')](function(_0x57d467){logger[_0xe39d('0x14')](_0xe39d('0x17'),_0x1bb0f3);logger[_0xe39d('0x10')](_0xe39d('0x17'),_0x1bb0f3,JSON[_0xe39d('0x1f')](_0x57d467));_0x1ded74(_0x57d467);})['catch'](function(_0x283b6b){logger['error']('UpdateWhatsappInteraction',_0x283b6b[_0xe39d('0x13')],_0x1bb0f3);_0x426c2e(_0x57b732[_0xe39d('0x11')](0x1f4,_0x283b6b[_0xe39d('0x13')]));});});};exports[_0xe39d('0x20')]=function(_0x2a7661){return new Promise(function(_0x263927,_0x42f10a){return db[_0xe39d('0x18')][_0xe39d('0x21')]({'where':_0x2a7661[_0xe39d('0x1a')]?_0x2a7661['options'][_0xe39d('0x1c')]||null:null})['then'](function(_0x20c0db){if(_0x20c0db){return _0x20c0db['addTags'](_0x2a7661[_0xe39d('0x22')][_0xe39d('0x23')],_['omit'](_0x2a7661['body'],[_0xe39d('0x23'),'id'])||{});}})[_0xe39d('0x24')](function(_0x5ad959){logger[_0xe39d('0x14')](_0xe39d('0x25'),_0x2a7661);logger[_0xe39d('0x10')](_0xe39d('0x25'),_0x2a7661,JSON[_0xe39d('0x1f')](_0x5ad959));_0x263927(_0x5ad959);})['catch'](function(_0x349ffd){logger[_0xe39d('0x11')](_0xe39d('0x25'),_0x349ffd[_0xe39d('0x13')],_0x2a7661);_0x42f10a(_this['error'](0x1f4,_0x349ffd[_0xe39d('0x13')]));});});}; \ No newline at end of file +var _0xd866=['then','stringify','AddTagsToWhatsappInteraction','find','addTags','ids','spread','AddTags','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./whatsappInteraction.socket','register','request','info','WhatsappInteraction,\x20%s,\x20%s','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','limit'];(function(_0x3b52c8,_0x2da80a){var _0x465f18=function(_0x314d26){while(--_0x314d26){_0x3b52c8['push'](_0x3b52c8['shift']());}};_0x465f18(++_0x2da80a);}(_0xd866,0x140));var _0x6d86=function(_0x1db0d2,_0x2c0712){_0x1db0d2=_0x1db0d2-0x0;var _0x2a442b=_0xd866[_0x1db0d2];return _0x2a442b;};'use strict';var _=require(_0x6d86('0x0'));var util=require(_0x6d86('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6d86('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6d86('0x3'));var logger=require(_0x6d86('0x4'))(_0x6d86('0x5'));var config=require(_0x6d86('0x6'));var jayson=require(_0x6d86('0x7'));var client=jayson[_0x6d86('0x8')][_0x6d86('0x9')]({'port':0x232a});config[_0x6d86('0xa')]=_['defaults'](config[_0x6d86('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x6d86('0xb'))(new Redis(config['redis']));require(_0x6d86('0xc'))[_0x6d86('0xd')](socket);function respondWithRpcPromise(_0x2830cd,_0x30f7b6,_0x1a04eb){return new BPromise(function(_0x2f12d0,_0x284179){return client[_0x6d86('0xe')](_0x2830cd,_0x1a04eb)['then'](function(_0x3ba201){logger[_0x6d86('0xf')](_0x6d86('0x10'),_0x30f7b6,'request\x20sent');logger['debug'](_0x6d86('0x11'),_0x30f7b6,_0x6d86('0x12'),JSON['stringify'](_0x3ba201));if(_0x3ba201[_0x6d86('0x13')]){if(_0x3ba201['error']['code']===0x1f4){logger[_0x6d86('0x13')](_0x6d86('0x10'),_0x30f7b6,_0x3ba201[_0x6d86('0x13')][_0x6d86('0x14')]);return _0x284179(_0x3ba201[_0x6d86('0x13')][_0x6d86('0x14')]);}logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x30f7b6,_0x3ba201[_0x6d86('0x13')]['message']);return _0x2f12d0(_0x3ba201['error'][_0x6d86('0x14')]);}else{logger[_0x6d86('0xf')](_0x6d86('0x10'),_0x30f7b6,_0x6d86('0x12'));_0x2f12d0(_0x3ba201['result'][_0x6d86('0x14')]);}})[_0x6d86('0x15')](function(_0xb1ec1c){logger['error'](_0x6d86('0x10'),_0x30f7b6,_0xb1ec1c);_0x284179(_0xb1ec1c);});});}exports[_0x6d86('0x16')]=function(_0x246072){var _0x3ac87f=this;return new Promise(function(_0x144308,_0x22550d){return db[_0x6d86('0x17')][_0x6d86('0x18')](_0x246072[_0x6d86('0x19')],{'raw':_0x246072['options']?_0x246072[_0x6d86('0x1a')][_0x6d86('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x246072[_0x6d86('0x1a')]?_0x246072[_0x6d86('0x1a')][_0x6d86('0x1c')]||null:null,'attributes':_0x246072['options']?_0x246072[_0x6d86('0x1a')][_0x6d86('0x1d')]||null:null,'limit':_0x246072[_0x6d86('0x1a')]?_0x246072['options'][_0x6d86('0x1e')]||null:null})[_0x6d86('0x1f')](function(_0x4c6c08){logger[_0x6d86('0xf')]('UpdateWhatsappInteraction',_0x246072);logger['debug'](_0x6d86('0x16'),_0x246072,JSON[_0x6d86('0x20')](_0x4c6c08));_0x144308(_0x4c6c08);})[_0x6d86('0x15')](function(_0xdaf6e6){logger[_0x6d86('0x13')](_0x6d86('0x16'),_0xdaf6e6[_0x6d86('0x14')],_0x246072);_0x22550d(_0x3ac87f[_0x6d86('0x13')](0x1f4,_0xdaf6e6[_0x6d86('0x14')]));});});};exports[_0x6d86('0x21')]=function(_0x34a2b1){return new Promise(function(_0x36219c,_0x16e659){return db[_0x6d86('0x17')][_0x6d86('0x22')]({'where':_0x34a2b1[_0x6d86('0x1a')]?_0x34a2b1[_0x6d86('0x1a')][_0x6d86('0x1c')]||null:null})[_0x6d86('0x1f')](function(_0x5f4e94){if(_0x5f4e94){return _0x5f4e94[_0x6d86('0x23')](_0x34a2b1[_0x6d86('0x19')][_0x6d86('0x24')],_['omit'](_0x34a2b1['body'],['ids','id'])||{});}})[_0x6d86('0x25')](function(_0x3197ec){logger[_0x6d86('0xf')](_0x6d86('0x26'),_0x34a2b1);logger['debug'](_0x6d86('0x26'),_0x34a2b1,JSON[_0x6d86('0x20')](_0x3197ec));_0x36219c(_0x3197ec);})[_0x6d86('0x15')](function(_0x563fa8){logger['error'](_0x6d86('0x26'),_0x563fa8['message'],_0x34a2b1);_0x16e659(_this['error'](0x1f4,_0x563fa8['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 60dffa9..c5a1e0c 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 _0x4df6=['emit','register','length','./whatsappInteraction.events','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4df6,0x1ca));var _0x64df=function(_0x3d8bee,_0x2fabfc){_0x3d8bee=_0x3d8bee-0x0;var _0x92cb0d=_0x4df6[_0x3d8bee];return _0x92cb0d;};'use strict';var WhatsappInteractionEvents=require(_0x64df('0x0'));var events=['save',_0x64df('0x1'),'update'];function createListener(_0x1ff009,_0x55243c){return function(_0x2de287){_0x55243c[_0x64df('0x2')](_0x1ff009,_0x2de287);};}function removeListener(_0x167e5a,_0x2a642c){return function(){WhatsappInteractionEvents['removeListener'](_0x167e5a,_0x2a642c);};}exports[_0x64df('0x3')]=function(_0x265dc4){for(var _0xf1e381=0x0,_0x46d676=events[_0x64df('0x4')];_0xf1e381<_0x46d676;_0xf1e381++){var _0x4d6e2c=events[_0xf1e381];var _0x5c04b8=createListener('whatsappInteraction:'+_0x4d6e2c,_0x265dc4);WhatsappInteractionEvents['on'](_0x4d6e2c,_0x5c04b8);}}; \ No newline at end of file +var _0xc84c=['save','update','emit','removeListener','register','./whatsappInteraction.events'];(function(_0x2b8dc7,_0x20c50e){var _0x1595b9=function(_0x85cd28){while(--_0x85cd28){_0x2b8dc7['push'](_0x2b8dc7['shift']());}};_0x1595b9(++_0x20c50e);}(_0xc84c,0x9b));var _0xcc84=function(_0x418549,_0x11b13d){_0x418549=_0x418549-0x0;var _0x288826=_0xc84c[_0x418549];return _0x288826;};'use strict';var WhatsappInteractionEvents=require(_0xcc84('0x0'));var events=[_0xcc84('0x1'),'remove',_0xcc84('0x2')];function createListener(_0x53db88,_0xb5bc00){return function(_0x1e8086){_0xb5bc00[_0xcc84('0x3')](_0x53db88,_0x1e8086);};}function removeListener(_0x364215,_0x2cf3f7){return function(){WhatsappInteractionEvents[_0xcc84('0x4')](_0x364215,_0x2cf3f7);};}exports[_0xcc84('0x5')]=function(_0x5dd457){for(var _0x3bc1d5=0x0,_0x5e42f9=events['length'];_0x3bc1d5<_0x5e42f9;_0x3bc1d5++){var _0x44919c=events[_0x3bc1d5];var _0x2e427c=createListener('whatsappInteraction:'+_0x44919c,_0x5dd457);WhatsappInteractionEvents['on'](_0x44919c,_0x2e427c);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index f4823dd..1f7d602 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 _0x38ef=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','tracked','whatsapp','create','post','status','put','/:id/accept','accept','/:id/reject','delete'];(function(_0x5a3d49,_0x24b21a){var _0x4d5c23=function(_0x4f62b0){while(--_0x4f62b0){_0x5a3d49['push'](_0x5a3d49['shift']());}};_0x4d5c23(++_0x24b21a);}(_0x38ef,0x106));var _0xf38e=function(_0x4c108f,_0x300dd0){_0x4c108f=_0x4c108f-0x0;var _0x3c88cb=_0x38ef[_0x4c108f];return _0x3c88cb;};'use strict';var multer=require(_0xf38e('0x0'));var util=require(_0xf38e('0x1'));var path=require(_0xf38e('0x2'));var timeout=require(_0xf38e('0x3'));var express=require(_0xf38e('0x4'));var router=express['Router']();var fs_extra=require(_0xf38e('0x5'));var auth=require(_0xf38e('0x6'));var interaction=require(_0xf38e('0x7'));var config=require(_0xf38e('0x8'));var controller=require('./whatsappMessage.controller');router[_0xf38e('0x9')]('/',auth[_0xf38e('0xa')](),controller[_0xf38e('0xb')]);router[_0xf38e('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xf38e('0xc')]);router['get'](_0xf38e('0xd'),auth[_0xf38e('0xa')](),controller['show']);router['post']('/',auth[_0xf38e('0xa')](),interaction[_0xf38e('0xe')](_0xf38e('0xf'),'whatsappmessage:create'),controller[_0xf38e('0x10')]);router[_0xf38e('0x11')]('/:id/status',controller[_0xf38e('0x12')]);router[_0xf38e('0x13')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xf38e('0x13')](_0xf38e('0x14'),auth['isAuthenticated'](),controller[_0xf38e('0x15')]);router[_0xf38e('0x13')](_0xf38e('0x16'),auth[_0xf38e('0xa')](),controller['reject']);router[_0xf38e('0x17')](_0xf38e('0xd'),auth[_0xf38e('0xa')](),controller[_0xf38e('0x18')]);module[_0xf38e('0x19')]=router; \ No newline at end of file +var _0x41ef=['post','/:id/status','put','update','/:id/accept','accept','/:id/reject','reject','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/:id','show','tracked','whatsapp','whatsappmessage:create','create'];(function(_0x76cbd5,_0x27490b){var _0x5c71a9=function(_0x88fbc7){while(--_0x88fbc7){_0x76cbd5['push'](_0x76cbd5['shift']());}};_0x5c71a9(++_0x27490b);}(_0x41ef,0x121));var _0xf41e=function(_0x355ca3,_0xd3e1e7){_0x355ca3=_0x355ca3-0x0;var _0x55edba=_0x41ef[_0x355ca3];return _0x55edba;};'use strict';var multer=require(_0xf41e('0x0'));var util=require(_0xf41e('0x1'));var path=require(_0xf41e('0x2'));var timeout=require(_0xf41e('0x3'));var express=require(_0xf41e('0x4'));var router=express[_0xf41e('0x5')]();var fs_extra=require(_0xf41e('0x6'));var auth=require(_0xf41e('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xf41e('0x8'));var controller=require(_0xf41e('0x9'));router[_0xf41e('0xa')]('/',auth[_0xf41e('0xb')](),controller[_0xf41e('0xc')]);router[_0xf41e('0xa')]('/describe',auth[_0xf41e('0xb')](),controller['describe']);router['get'](_0xf41e('0xd'),auth[_0xf41e('0xb')](),controller[_0xf41e('0xe')]);router['post']('/',auth['isAuthenticated'](),interaction[_0xf41e('0xf')](_0xf41e('0x10'),_0xf41e('0x11')),controller[_0xf41e('0x12')]);router[_0xf41e('0x13')](_0xf41e('0x14'),controller['status']);router[_0xf41e('0x15')](_0xf41e('0xd'),auth[_0xf41e('0xb')](),controller[_0xf41e('0x16')]);router[_0xf41e('0x15')](_0xf41e('0x17'),auth[_0xf41e('0xb')](),controller[_0xf41e('0x18')]);router[_0xf41e('0x15')](_0xf41e('0x19'),auth[_0xf41e('0xb')](),controller[_0xf41e('0x1a')]);router[_0xf41e('0x1b')]('/:id',auth[_0xf41e('0xb')](),controller['destroy']);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 1383a8c..36690e6 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 _0xed92=['medium','BOOLEAN','ENUM','out','STRING','DATE','exports','TEXT'];(function(_0x15420f,_0x3deca8){var _0x3a0280=function(_0x419f34){while(--_0x419f34){_0x15420f['push'](_0x15420f['shift']());}};_0x3a0280(++_0x3deca8);}(_0xed92,0x166));var _0x2ed9=function(_0x2ef2a2,_0x51e096){_0x2ef2a2=_0x2ef2a2-0x0;var _0x3270bd=_0xed92[_0x2ef2a2];return _0x3270bd;};'use strict';var Sequelize=require('sequelize');module[_0x2ed9('0x0')]={'body':{'type':Sequelize[_0x2ed9('0x1')](_0x2ed9('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x2ed9('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2ed9('0x4')]('in',_0x2ed9('0x5')),'defaultValue':_0x2ed9('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x2ed9('0x6')](0xbe)},'phone':{'type':Sequelize[_0x2ed9('0x6')]},'readAt':{'type':Sequelize[_0x2ed9('0x7')]},'secret':{'type':Sequelize[_0x2ed9('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x2ed9('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x8dab=['out','STRING','DATE','TEXT','sequelize','exports','medium','BOOLEAN','ENUM'];(function(_0x3eb45e,_0x562a78){var _0x361d7f=function(_0x219b07){while(--_0x219b07){_0x3eb45e['push'](_0x3eb45e['shift']());}};_0x361d7f(++_0x562a78);}(_0x8dab,0xd3));var _0xb8da=function(_0x1d5d1d,_0x3beab9){_0x1d5d1d=_0x1d5d1d-0x0;var _0x2f049b=_0x8dab[_0x1d5d1d];return _0x2f049b;};'use strict';var Sequelize=require(_0xb8da('0x0'));module[_0xb8da('0x1')]={'body':{'type':Sequelize['TEXT'](_0xb8da('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xb8da('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb8da('0x4')]('in','out'),'defaultValue':_0xb8da('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xb8da('0x6')](0xbe)},'phone':{'type':Sequelize[_0xb8da('0x6')]},'readAt':{'type':Sequelize[_0xb8da('0x7')]},'secret':{'type':Sequelize[_0xb8da('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xb8da('0x8')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 5366a00..27245d1 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 _0xdfe1=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','http','client','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','code','error','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','stack','name','index','map','WhatsappMessage','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','include','rows','show','params','rawAttributes','fields','includeAll','find','create','body','describe','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','agent','UserId','isNil','interaction','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','whatsapp-interactions','WhatsappInteraction','WhatsappInteractionId','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','Sequelize','SELECT','WhatsappAccount','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','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x435fa1,_0x58550a){var _0x845f9f=function(_0x89867e){while(--_0x89867e){_0x435fa1['push'](_0x435fa1['shift']());}};_0x845f9f(++_0x58550a);}(_0xdfe1,0x10a));var _0x1dfe=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xdfe1[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1dfe('0x0'));var zipdir=require(_0x1dfe('0x1'));var jsonpatch=require(_0x1dfe('0x2'));var rp=require(_0x1dfe('0x3'));var moment=require(_0x1dfe('0x4'));var BPromise=require(_0x1dfe('0x5'));var Mustache=require(_0x1dfe('0x6'));var util=require(_0x1dfe('0x7'));var path=require(_0x1dfe('0x8'));var sox=require('sox');var csv=require(_0x1dfe('0x9'));var ejs=require(_0x1dfe('0xa'));var fs=require('fs');var fs_extra=require(_0x1dfe('0xb'));var _=require(_0x1dfe('0xc'));var squel=require(_0x1dfe('0xd'));var crypto=require(_0x1dfe('0xe'));var jsforce=require(_0x1dfe('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1dfe('0x10'));var Papa=require(_0x1dfe('0x11'));var Redis=require(_0x1dfe('0x12'));var authService=require(_0x1dfe('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x1dfe('0x14'));var hardwareService=require(_0x1dfe('0x15'));var logger=require(_0x1dfe('0x16'))(_0x1dfe('0x17'));var utils=require(_0x1dfe('0x18'));var config=require(_0x1dfe('0x19'));var licenseUtil=require(_0x1dfe('0x1a'));var db=require(_0x1dfe('0x1b'))['db'];config['redis']=_[_0x1dfe('0x1c')](config[_0x1dfe('0x1d')],{'host':_0x1dfe('0x1e'),'port':0x18eb});var socket=require(_0x1dfe('0x1f'))(new Redis(config[_0x1dfe('0x1d')]));require('./whatsappMessage.socket')[_0x1dfe('0x20')](socket);var jayson=require(_0x1dfe('0x21'));var client=jayson['client'][_0x1dfe('0x22')]({'port':0x232c});var client9002=jayson[_0x1dfe('0x23')]['http']({'port':0x232a});function respondWithRpcPromise(_0x386a48,_0x5f22f7,_0x1cbf38,_0x48e524){return new BPromise(function(_0x46d820,_0x2ab17f){var _0xfcf9a6=_0x48e524||client;return _0xfcf9a6['request'](_0x386a48,_0x1cbf38)[_0x1dfe('0x24')](function(_0xe9710a){logger[_0x1dfe('0x25')](_0x1dfe('0x26'),_0x5f22f7,_0x1dfe('0x27'));logger[_0x1dfe('0x28')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x5f22f7,'request\x20sent',JSON['stringify'](_0xe9710a));if(_0xe9710a['error']){if(_0xe9710a['error'][_0x1dfe('0x29')]===0x1f4){logger[_0x1dfe('0x2a')]('WhatsappMessage,\x20%s,\x20%s',_0x5f22f7,_0xe9710a[_0x1dfe('0x2a')][_0x1dfe('0x2b')]);return _0x2ab17f(_0xe9710a[_0x1dfe('0x2a')]['message']);}logger['error'](_0x1dfe('0x26'),_0x5f22f7,_0xe9710a[_0x1dfe('0x2a')][_0x1dfe('0x2b')]);return _0x46d820(_0xe9710a[_0x1dfe('0x2a')][_0x1dfe('0x2b')]);}else{logger[_0x1dfe('0x25')](_0x1dfe('0x26'),_0x5f22f7,_0x1dfe('0x27'));_0x46d820(_0xe9710a['result']['message']);}})[_0x1dfe('0x2c')](function(_0x340b82){logger[_0x1dfe('0x2a')](_0x1dfe('0x26'),_0x5f22f7,_0x340b82);_0x2ab17f(_0x340b82);});});}function respondWithStatusCode(_0x54f635,_0x1d2a2b){_0x1d2a2b=_0x1d2a2b||0xcc;return function(_0x54195a){if(_0x54195a){return _0x54f635[_0x1dfe('0x2d')](_0x1d2a2b);}return _0x54f635[_0x1dfe('0x2e')](_0x1d2a2b)[_0x1dfe('0x2f')]();};}function respondWithResult(_0x29f626,_0x150a05){_0x150a05=_0x150a05||0xc8;return function(_0x3112ba){if(_0x3112ba){return _0x29f626[_0x1dfe('0x2e')](_0x150a05)[_0x1dfe('0x30')](_0x3112ba);}};}function respondWithFilteredResult(_0x4717c3,_0x5ec3a9){return function(_0x2fe29b){if(_0x2fe29b){var _0x51ef4e=typeof _0x5ec3a9[_0x1dfe('0x31')]===_0x1dfe('0x32')&&typeof _0x5ec3a9[_0x1dfe('0x33')]===_0x1dfe('0x32');var _0x1192c8=_0x2fe29b[_0x1dfe('0x34')];var _0x183684=_0x51ef4e?0x0:_0x5ec3a9[_0x1dfe('0x31')];var _0x5b95f0=_0x51ef4e?_0x2fe29b['count']:_0x5ec3a9['offset']+_0x5ec3a9['limit'];var _0x62158b;if(_0x5b95f0>=_0x1192c8){_0x5b95f0=_0x1192c8;_0x62158b=0xc8;}else{_0x62158b=0xce;}_0x4717c3['status'](_0x62158b);return _0x4717c3[_0x1dfe('0x35')]('Content-Range',_0x183684+'-'+_0x5b95f0+'/'+_0x1192c8)[_0x1dfe('0x30')](_0x2fe29b);}return null;};}function patchUpdates(_0x41bd68){return function(_0x5c1c3a){try{jsonpatch[_0x1dfe('0x36')](_0x5c1c3a,_0x41bd68,!![]);}catch(_0x5771d2){return BPromise[_0x1dfe('0x37')](_0x5771d2);}return _0x5c1c3a[_0x1dfe('0x38')]();};}function saveUpdates(_0x382f6c,_0x1a3cc6){return function(_0x4e4efa){if(_0x4e4efa){return _0x4e4efa[_0x1dfe('0x39')](_0x382f6c)[_0x1dfe('0x24')](function(_0x3052f8){return _0x3052f8;});}return null;};}function removeEntity(_0x11458d,_0x61583d){return function(_0x247502){if(_0x247502){return _0x247502[_0x1dfe('0x3a')]()['then'](function(){_0x11458d[_0x1dfe('0x2e')](0xcc)[_0x1dfe('0x2f')]();});}};}function handleEntityNotFound(_0x5d3068,_0x4e3c47){return function(_0x37d28d){if(!_0x37d28d){_0x5d3068[_0x1dfe('0x2d')](0x194);}return _0x37d28d;};}function handleError(_0xcd42a9,_0x2c1902){_0x2c1902=_0x2c1902||0x1f4;return function(_0x4c44d3){logger[_0x1dfe('0x2a')](_0x4c44d3[_0x1dfe('0x3b')]);if(_0x4c44d3[_0x1dfe('0x3c')]){delete _0x4c44d3['name'];}_0xcd42a9[_0x1dfe('0x2e')](_0x2c1902)['send'](_0x4c44d3);};}exports[_0x1dfe('0x3d')]=function(_0x1eeab6,_0x25840b){var _0x4a6081={},_0x5e25b2={},_0x3eec85={'count':0x0,'rows':[]};var _0x2e27f5=_[_0x1dfe('0x3e')](db[_0x1dfe('0x3f')]['rawAttributes'],function(_0x1f9c23){return{'name':_0x1f9c23[_0x1dfe('0x40')],'type':_0x1f9c23[_0x1dfe('0x41')][_0x1dfe('0x42')]};});_0x5e25b2[_0x1dfe('0x43')]=_['map'](_0x2e27f5,'name');_0x5e25b2['query']=_[_0x1dfe('0x44')](_0x1eeab6[_0x1dfe('0x45')]);_0x5e25b2[_0x1dfe('0x46')]=_[_0x1dfe('0x47')](_0x5e25b2['model'],_0x5e25b2[_0x1dfe('0x45')]);_0x4a6081[_0x1dfe('0x48')]=_[_0x1dfe('0x47')](_0x5e25b2['model'],qs['fields'](_0x1eeab6[_0x1dfe('0x45')]['fields']));_0x4a6081[_0x1dfe('0x48')]=_0x4a6081['attributes'][_0x1dfe('0x49')]?_0x4a6081[_0x1dfe('0x48')]:_0x5e25b2[_0x1dfe('0x43')];if(!_0x1eeab6[_0x1dfe('0x45')]['hasOwnProperty'](_0x1dfe('0x4a'))){_0x4a6081[_0x1dfe('0x33')]=qs[_0x1dfe('0x33')](_0x1eeab6[_0x1dfe('0x45')]['limit']);_0x4a6081[_0x1dfe('0x31')]=qs['offset'](_0x1eeab6[_0x1dfe('0x45')][_0x1dfe('0x31')]);}_0x4a6081[_0x1dfe('0x4b')]=qs['sort'](_0x1eeab6[_0x1dfe('0x45')][_0x1dfe('0x4c')]);_0x4a6081[_0x1dfe('0x4d')]=qs['filters'](_[_0x1dfe('0x4e')](_0x1eeab6[_0x1dfe('0x45')],_0x5e25b2['filters']),_0x2e27f5);if(_0x1eeab6['query'][_0x1dfe('0x4f')]){_0x4a6081[_0x1dfe('0x4d')]=_[_0x1dfe('0x50')](_0x4a6081[_0x1dfe('0x4d')],{'$or':_[_0x1dfe('0x3e')](_0x2e27f5,function(_0x25c019){if(_0x25c019['type']!=='VIRTUAL'){var _0x54d9a3={};_0x54d9a3[_0x25c019[_0x1dfe('0x3c')]]={'$like':'%'+_0x1eeab6['query'][_0x1dfe('0x4f')]+'%'};return _0x54d9a3;}})});}_0x4a6081=_[_0x1dfe('0x50')]({},_0x4a6081,_0x1eeab6[_0x1dfe('0x51')]);var _0x5226a8={'where':_0x4a6081[_0x1dfe('0x4d')]};return db[_0x1dfe('0x3f')][_0x1dfe('0x34')](_0x5226a8)['then'](function(_0xcbdab2){_0x3eec85[_0x1dfe('0x34')]=_0xcbdab2;if(_0x1eeab6[_0x1dfe('0x45')]['includeAll']){_0x4a6081[_0x1dfe('0x52')]=[{'all':!![]}];}return db[_0x1dfe('0x3f')]['findAll'](_0x4a6081);})[_0x1dfe('0x24')](function(_0xecd41){_0x3eec85[_0x1dfe('0x53')]=_0xecd41;return _0x3eec85;})[_0x1dfe('0x24')](respondWithFilteredResult(_0x25840b,_0x4a6081))['catch'](handleError(_0x25840b,null));};exports[_0x1dfe('0x54')]=function(_0x50e633,_0x33621b){var _0x513c31={'raw':!![],'where':{'id':_0x50e633[_0x1dfe('0x55')]['id']}},_0x4ee218={};_0x4ee218[_0x1dfe('0x43')]=_['keys'](db[_0x1dfe('0x3f')][_0x1dfe('0x56')]);_0x4ee218[_0x1dfe('0x45')]=_['keys'](_0x50e633[_0x1dfe('0x45')]);_0x4ee218[_0x1dfe('0x46')]=_[_0x1dfe('0x47')](_0x4ee218[_0x1dfe('0x43')],_0x4ee218[_0x1dfe('0x45')]);_0x513c31['attributes']=_[_0x1dfe('0x47')](_0x4ee218[_0x1dfe('0x43')],qs[_0x1dfe('0x57')](_0x50e633[_0x1dfe('0x45')][_0x1dfe('0x57')]));_0x513c31['attributes']=_0x513c31[_0x1dfe('0x48')][_0x1dfe('0x49')]?_0x513c31[_0x1dfe('0x48')]:_0x4ee218['model'];if(_0x50e633[_0x1dfe('0x45')][_0x1dfe('0x58')]){_0x513c31[_0x1dfe('0x52')]=[{'all':!![]}];}_0x513c31=_[_0x1dfe('0x50')]({},_0x513c31,_0x50e633[_0x1dfe('0x51')]);return db[_0x1dfe('0x3f')][_0x1dfe('0x59')](_0x513c31)['then'](handleEntityNotFound(_0x33621b,null))[_0x1dfe('0x24')](respondWithResult(_0x33621b,null))['catch'](handleError(_0x33621b,null));};exports[_0x1dfe('0x5a')]=function(_0x5aadcf,_0x45c710){return db[_0x1dfe('0x3f')][_0x1dfe('0x5a')](_0x5aadcf[_0x1dfe('0x5b')],{})[_0x1dfe('0x24')](respondWithResult(_0x45c710,0xc9))[_0x1dfe('0x2c')](handleError(_0x45c710,null));};exports[_0x1dfe('0x39')]=function(_0x34a4ff,_0x4ee4ac){if(_0x34a4ff[_0x1dfe('0x5b')]['id']){delete _0x34a4ff[_0x1dfe('0x5b')]['id'];}return db[_0x1dfe('0x3f')][_0x1dfe('0x59')]({'where':{'id':_0x34a4ff[_0x1dfe('0x55')]['id']}})['then'](handleEntityNotFound(_0x4ee4ac,null))[_0x1dfe('0x24')](saveUpdates(_0x34a4ff[_0x1dfe('0x5b')],null))[_0x1dfe('0x24')](respondWithResult(_0x4ee4ac,null))[_0x1dfe('0x2c')](handleError(_0x4ee4ac,null));};exports[_0x1dfe('0x3a')]=function(_0x178a06,_0x1923d7){return db[_0x1dfe('0x3f')][_0x1dfe('0x59')]({'where':{'id':_0x178a06[_0x1dfe('0x55')]['id']}})['then'](handleEntityNotFound(_0x1923d7,null))[_0x1dfe('0x24')](removeEntity(_0x1923d7,null))[_0x1dfe('0x2c')](handleError(_0x1923d7,null));};exports['describe']=function(_0x4fade0,_0x6aa74c){return db[_0x1dfe('0x3f')][_0x1dfe('0x5c')]()[_0x1dfe('0x24')](respondWithResult(_0x6aa74c,null))['catch'](handleError(_0x6aa74c,null));};var interaction_log=require(_0x1dfe('0x16'))('whatsapp-interactions');exports[_0x1dfe('0x5d')]=function(_0x395c77,_0x4e1612,_0x413255){var _0x2be4b6={'agent':{},'channel':_0x1dfe('0x5e')};if(_0x395c77['body']['id']){delete _0x395c77[_0x1dfe('0x5b')]['id'];}_0x395c77[_0x1dfe('0x5b')][_0x1dfe('0x5f')]=!![];_0x395c77['body'][_0x1dfe('0x60')]=moment()[_0x1dfe('0x61')](_0x1dfe('0x62'));_0x395c77[_0x1dfe('0x5b')]['UserId']=_0x395c77[_0x1dfe('0x5b')]['UserId']||_0x395c77['user']['id'];_0x2be4b6[_0x1dfe('0x63')]['id']=_0x395c77[_0x1dfe('0x5b')][_0x1dfe('0x64')];return db[_0x1dfe('0x3f')][_0x1dfe('0x59')]({'where':{'id':_0x395c77[_0x1dfe('0x55')]['id'],'UserId':null}})[_0x1dfe('0x24')](handleEntityNotFound(_0x4e1612,null))[_0x1dfe('0x24')](saveUpdates(_0x395c77[_0x1dfe('0x5b')],null))[_0x1dfe('0x24')](function(_0x3ee88b){if(_0x3ee88b){_0x2be4b6['message']=_0x3ee88b['get']({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0x3ee88b['WhatsappInteractionId']}});}return null;})[_0x1dfe('0x24')](handleEntityNotFound(_0x4e1612,null))[_0x1dfe('0x24')](function(_0x409aba){if(_0x409aba){return _0x409aba['update']({'UserId':_0x395c77[_0x1dfe('0x5b')][_0x1dfe('0x64')],'read1stAt':_[_0x1dfe('0x65')](_0x409aba['read1stAt'])?moment()[_0x1dfe('0x61')](_0x1dfe('0x62')):undefined});}return null;})[_0x1dfe('0x24')](function(_0x555c43){if(_0x555c43){_0x2be4b6[_0x1dfe('0x66')]=_0x555c43[_0x1dfe('0x67')]({'plain':!![]});interaction_log[_0x1dfe('0x25')](_0x1dfe('0x68'),_0x395c77[_0x1dfe('0x69')]['id'],_0x395c77[_0x1dfe('0x69')]['name'],_0x395c77['user'][_0x1dfe('0x6a')],_0x2be4b6[_0x1dfe('0x66')]['id'],_0x395c77[_0x1dfe('0x5b')]?JSON[_0x1dfe('0x6b')](_0x395c77[_0x1dfe('0x5b')]):'null');return respondWithRpcPromise(_0x1dfe('0x6c'),_0x1dfe('0x6d'),_0x2be4b6);}return null;})[_0x1dfe('0x24')](function(_0x4762c9){var _0x31d9b6=_0x1dfe('0x6e')+_0x4762c9[_0x1dfe('0x2b')]['ContactId'];return db[_0x1dfe('0x6f')][_0x1dfe('0x45')](_0x31d9b6,{'type':db['Sequelize'][_0x1dfe('0x70')]['SELECT'],'raw':!![]})[_0x1dfe('0x24')](function(_0x135c7c){return _0x135c7c;});})[_0x1dfe('0x24')](function(_0x52003b){if(_0x52003b){_0x2be4b6[_0x1dfe('0x2b')][_0x1dfe('0x71')]=_0x52003b[0x0];if(!_0x395c77[_0x1dfe('0x5b')][_0x1dfe('0x64')])return;return db[_0x1dfe('0x72')][_0x1dfe('0x59')]({'where':{'id':_0x395c77['body'][_0x1dfe('0x64')],'role':_0x1dfe('0x63')},'attributes':['id',_0x1dfe('0x3c'),_0x1dfe('0x73'),_0x1dfe('0x74'),_0x1dfe('0x75')],'raw':!![]});}return null;})[_0x1dfe('0x24')](function(_0x21f79f){if(!_0x21f79f)return null;_0x2be4b6['message']['agent']=_0x21f79f;return _0x2be4b6;})[_0x1dfe('0x24')](function(_0x1d24d4){if(_0x1d24d4){if(_0x395c77[_0x1dfe('0x5b')][_0x1dfe('0x76')]){_0x2be4b6[_0x1dfe('0x2b')][_0x1dfe('0x77')]=util[_0x1dfe('0x61')](_0x1dfe('0x78'),_0x395c77[_0x1dfe('0x69')][_0x1dfe('0x3c')]);_0x2be4b6['message'][_0x1dfe('0x79')]=_0x2be4b6[_0x1dfe('0x79')];_0x2be4b6[_0x1dfe('0x2b')]['motionChannel']=_0x2be4b6[_0x1dfe('0x79')];_0x2be4b6[_0x1dfe('0x2b')][_0x1dfe('0x7a')]=_0x1dfe('0x5d');return respondWithRpcPromise(_0x1dfe('0x7b'),_0x1dfe('0x7b'),{'event':_0x1dfe('0x7c'),'message':_0x2be4b6[_0x1dfe('0x2b')]},client9002)['then'](function(){return _0x2be4b6;});}return _0x2be4b6;}return null;})[_0x1dfe('0x24')](respondWithResult(_0x4e1612,null))['catch'](handleError(_0x4e1612,null));};var interaction_log=require(_0x1dfe('0x16'))(_0x1dfe('0x7d'));exports[_0x1dfe('0x37')]=function(_0x5d1184,_0x566b1c,_0x1da7bd){var _0x592de8={'agent':{},'channel':_0x1dfe('0x5e')};if(_0x5d1184[_0x1dfe('0x5b')]['id']){delete _0x5d1184[_0x1dfe('0x5b')]['id'];}_0x5d1184[_0x1dfe('0x5b')][_0x1dfe('0x64')]=_0x5d1184[_0x1dfe('0x5b')][_0x1dfe('0x64')]||_0x5d1184[_0x1dfe('0x69')]['id'];_0x592de8[_0x1dfe('0x63')]['id']=_0x5d1184[_0x1dfe('0x5b')][_0x1dfe('0x64')];return db[_0x1dfe('0x3f')][_0x1dfe('0x59')]({'where':{'id':_0x5d1184[_0x1dfe('0x55')]['id'],'UserId':null}})[_0x1dfe('0x24')](handleEntityNotFound(_0x566b1c,null))[_0x1dfe('0x24')](function(_0x5dcf9d){if(_0x5dcf9d){_0x592de8[_0x1dfe('0x2b')]=_0x5dcf9d[_0x1dfe('0x67')]({'plain':!![]});return db[_0x1dfe('0x7e')]['find']({'where':{'id':_0x5dcf9d[_0x1dfe('0x7f')]}});}return null;})[_0x1dfe('0x24')](handleEntityNotFound(_0x566b1c,null))[_0x1dfe('0x24')](function(_0x342dfa){if(_0x342dfa){_0x592de8[_0x1dfe('0x66')]=_0x342dfa[_0x1dfe('0x67')]({'plain':!![]});interaction_log['info'](_0x1dfe('0x80'),_0x5d1184[_0x1dfe('0x69')]['id'],_0x5d1184[_0x1dfe('0x69')][_0x1dfe('0x3c')],_0x5d1184[_0x1dfe('0x69')][_0x1dfe('0x6a')],_0x592de8[_0x1dfe('0x66')]['id'],_0x5d1184['body']?JSON[_0x1dfe('0x6b')](_0x5d1184[_0x1dfe('0x5b')]):_0x1dfe('0x81'));return respondWithRpcPromise(_0x1dfe('0x82'),_0x1dfe('0x83'),_0x592de8);}return null;})[_0x1dfe('0x24')](function(_0x1d8e0e){var _0x25818e=_0x1dfe('0x6e')+_0x1d8e0e[_0x1dfe('0x2b')]['ContactId'];return db[_0x1dfe('0x6f')][_0x1dfe('0x45')](_0x25818e,{'type':db[_0x1dfe('0x84')][_0x1dfe('0x70')][_0x1dfe('0x85')],'raw':!![]})[_0x1dfe('0x24')](function(_0x56efee){return _0x56efee;});})['then'](function(_0x30afb5){if(_0x30afb5){_0x592de8[_0x1dfe('0x2b')][_0x1dfe('0x71')]=_0x30afb5[0x0];if(!_0x5d1184[_0x1dfe('0x5b')][_0x1dfe('0x64')])return;return db['User'][_0x1dfe('0x59')]({'where':{'id':_0x5d1184['body'][_0x1dfe('0x64')],'role':_0x1dfe('0x63')},'attributes':['id',_0x1dfe('0x3c'),_0x1dfe('0x73'),_0x1dfe('0x74'),_0x1dfe('0x75')],'raw':!![]});}return null;})[_0x1dfe('0x24')](function(_0x5aedd){if(!_0x5aedd)return null;_0x592de8[_0x1dfe('0x2b')][_0x1dfe('0x63')]=_0x5aedd;return _0x592de8;})['then'](function(_0x2ae9da){if(_0x2ae9da){_0x2ae9da['message'][_0x1dfe('0x77')]=util['format'](_0x1dfe('0x78'),_0x5d1184['user'][_0x1dfe('0x3c')]);_0x2ae9da[_0x1dfe('0x2b')][_0x1dfe('0x79')]=_0x592de8[_0x1dfe('0x79')];_0x2ae9da[_0x1dfe('0x2b')]['motionChannel']=_0x592de8[_0x1dfe('0x79')];_0x2ae9da['message'][_0x1dfe('0x7a')]=_0x1dfe('0x37');respondWithRpcPromise(_0x1dfe('0x7b'),_0x1dfe('0x7b'),{'event':'rejectmessage','message':_0x2ae9da[_0x1dfe('0x2b')]},client9002);return _0x592de8;}return null;})['then'](respondWithResult(_0x566b1c,null))[_0x1dfe('0x2c')](handleError(_0x566b1c,null));};exports[_0x1dfe('0x2e')]=function(_0x5aa237,_0x2bf2c7,_0x34faf1){if(_0x5aa237[_0x1dfe('0x5b')]['id']){delete _0x5aa237[_0x1dfe('0x5b')]['id'];}var _0x49825e;return db[_0x1dfe('0x3f')][_0x1dfe('0x59')]({'where':{'id':_0x5aa237['params']['id']}})[_0x1dfe('0x24')](handleEntityNotFound(_0x2bf2c7,null))[_0x1dfe('0x24')](function(_0x50a10f){if(_0x50a10f){_0x49825e=_0x50a10f;return db[_0x1dfe('0x86')][_0x1dfe('0x59')]({'where':{'id':_0x50a10f['WhatsappAccountId']}});}})[_0x1dfe('0x24')](handleEntityNotFound(_0x2bf2c7,null))[_0x1dfe('0x24')](function(_0x541908){if(_0x541908){logger['debug'](_0x1dfe('0x87'),_0x1dfe('0x2e'),_0x1dfe('0x88'),_0x541908['type'],util[_0x1dfe('0x89')](_0x5aa237[_0x1dfe('0x5b')],{'showHidden':![],'depth':null}));switch(_0x541908[_0x1dfe('0x41')]){case'twilio':if(_0x5aa237['body'][_0x1dfe('0x8a')]&&_0x5aa237[_0x1dfe('0x5b')][_0x1dfe('0x8a')]===_0x49825e[_0x1dfe('0x8b')]&&_0x5aa237[_0x1dfe('0x5b')][_0x1dfe('0x8c')]&&_0x5aa237[_0x1dfe('0x5b')][_0x1dfe('0x8c')]===_0x1dfe('0x5f')){return _0x49825e[_0x1dfe('0x39')]({'read':!![]});}else{logger[_0x1dfe('0x2a')](_0x1dfe('0x8d'),_0x1dfe('0x2e'),_0x1dfe('0x8e'),util[_0x1dfe('0x89')](_0x5aa237['body'],{'showHidden':![],'depth':null}));}break;}return _0x49825e;}})['then'](respondWithResult(_0x2bf2c7,null))[_0x1dfe('0x2c')](handleError(_0x2bf2c7,null));}; \ No newline at end of file +var _0x11a3=['channel','motionChannel','event','EventManager','acceptmessage','WhatsappInteraction','WhatsappInteractionId','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','SELECT','rejectmessage','WhatsappAccount','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','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./whatsappMessage.socket','register','http','request','then','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','status','offset','undefined','count','limit','Content-Range','json','apply','reject','save','destroy','end','stack','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','options','include','findAll','catch','show','length','merge','find','create','body','update','params','describe','../../config/logger','whatsapp-interactions','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','contact','User','fullname','email','internal','manual','interface','SIP/%s'];(function(_0x11729d,_0x439171){var _0x4cffcc=function(_0x459a84){while(--_0x459a84){_0x11729d['push'](_0x11729d['shift']());}};_0x4cffcc(++_0x439171);}(_0x11a3,0x1c6));var _0x311a=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x11a3[_0x565c49];return _0x20ca34;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x311a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x311a('0x1'));var rp=require('request-promise');var moment=require(_0x311a('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x311a('0x3'));var util=require(_0x311a('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x311a('0x5'));var ejs=require(_0x311a('0x6'));var fs=require('fs');var fs_extra=require(_0x311a('0x7'));var _=require(_0x311a('0x8'));var squel=require(_0x311a('0x9'));var crypto=require(_0x311a('0xa'));var jsforce=require(_0x311a('0xb'));var deskjs=require(_0x311a('0xc'));var toCsv=require(_0x311a('0x5'));var querystring=require('querystring');var Papa=require(_0x311a('0xd'));var Redis=require(_0x311a('0xe'));var authService=require(_0x311a('0xf'));var qs=require(_0x311a('0x10'));var as=require(_0x311a('0x11'));var hardwareService=require(_0x311a('0x12'));var logger=require('../../config/logger')(_0x311a('0x13'));var utils=require(_0x311a('0x14'));var config=require(_0x311a('0x15'));var licenseUtil=require(_0x311a('0x16'));var db=require(_0x311a('0x17'))['db'];config['redis']=_[_0x311a('0x18')](config[_0x311a('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x311a('0x1a'))(new Redis(config[_0x311a('0x19')]));require(_0x311a('0x1b'))[_0x311a('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x311a('0x1d')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x21a676,_0x3b941c,_0xc45610,_0x581e35){return new BPromise(function(_0x41db89,_0x1fc9ed){var _0x2118e0=_0x581e35||client;return _0x2118e0[_0x311a('0x1e')](_0x21a676,_0xc45610)[_0x311a('0x1f')](function(_0x1a06ca){logger['info'](_0x311a('0x20'),_0x3b941c,'request\x20sent');logger[_0x311a('0x21')](_0x311a('0x22'),_0x3b941c,'request\x20sent',JSON[_0x311a('0x23')](_0x1a06ca));if(_0x1a06ca[_0x311a('0x24')]){if(_0x1a06ca['error'][_0x311a('0x25')]===0x1f4){logger[_0x311a('0x24')]('WhatsappMessage,\x20%s,\x20%s',_0x3b941c,_0x1a06ca[_0x311a('0x24')][_0x311a('0x26')]);return _0x1fc9ed(_0x1a06ca[_0x311a('0x24')][_0x311a('0x26')]);}logger[_0x311a('0x24')](_0x311a('0x20'),_0x3b941c,_0x1a06ca[_0x311a('0x24')]['message']);return _0x41db89(_0x1a06ca[_0x311a('0x24')]['message']);}else{logger[_0x311a('0x27')](_0x311a('0x20'),_0x3b941c,'request\x20sent');_0x41db89(_0x1a06ca[_0x311a('0x28')][_0x311a('0x26')]);}})['catch'](function(_0x6671c7){logger[_0x311a('0x24')](_0x311a('0x20'),_0x3b941c,_0x6671c7);_0x1fc9ed(_0x6671c7);});});}function respondWithStatusCode(_0x408330,_0x28a468){_0x28a468=_0x28a468||0xcc;return function(_0x221e13){if(_0x221e13){return _0x408330[_0x311a('0x29')](_0x28a468);}return _0x408330[_0x311a('0x2a')](_0x28a468)['end']();};}function respondWithResult(_0xa6985f,_0x486a2d){_0x486a2d=_0x486a2d||0xc8;return function(_0x18c1ff){if(_0x18c1ff){return _0xa6985f[_0x311a('0x2a')](_0x486a2d)['json'](_0x18c1ff);}};}function respondWithFilteredResult(_0x261385,_0x346c56){return function(_0x552960){if(_0x552960){var _0x29b782=typeof _0x346c56[_0x311a('0x2b')]===_0x311a('0x2c')&&typeof _0x346c56['limit']===_0x311a('0x2c');var _0x2ad060=_0x552960[_0x311a('0x2d')];var _0x5c61a6=_0x29b782?0x0:_0x346c56['offset'];var _0x2c47fd=_0x29b782?_0x552960[_0x311a('0x2d')]:_0x346c56[_0x311a('0x2b')]+_0x346c56[_0x311a('0x2e')];var _0x53d0f4;if(_0x2c47fd>=_0x2ad060){_0x2c47fd=_0x2ad060;_0x53d0f4=0xc8;}else{_0x53d0f4=0xce;}_0x261385[_0x311a('0x2a')](_0x53d0f4);return _0x261385['set'](_0x311a('0x2f'),_0x5c61a6+'-'+_0x2c47fd+'/'+_0x2ad060)[_0x311a('0x30')](_0x552960);}return null;};}function patchUpdates(_0x4fe8d0){return function(_0x4a9422){try{jsonpatch[_0x311a('0x31')](_0x4a9422,_0x4fe8d0,!![]);}catch(_0x1da564){return BPromise[_0x311a('0x32')](_0x1da564);}return _0x4a9422[_0x311a('0x33')]();};}function saveUpdates(_0x499706,_0x35c0b3){return function(_0x23ab69){if(_0x23ab69){return _0x23ab69['update'](_0x499706)[_0x311a('0x1f')](function(_0x80f0d1){return _0x80f0d1;});}return null;};}function removeEntity(_0x50ac88,_0x2e2676){return function(_0x28e291){if(_0x28e291){return _0x28e291[_0x311a('0x34')]()[_0x311a('0x1f')](function(){_0x50ac88[_0x311a('0x2a')](0xcc)[_0x311a('0x35')]();});}};}function handleEntityNotFound(_0x7f9829,_0x11d3ec){return function(_0x5f554d){if(!_0x5f554d){_0x7f9829['sendStatus'](0x194);}return _0x5f554d;};}function handleError(_0x1d014c,_0x5412f4){_0x5412f4=_0x5412f4||0x1f4;return function(_0x4490cf){logger[_0x311a('0x24')](_0x4490cf[_0x311a('0x36')]);if(_0x4490cf['name']){delete _0x4490cf[_0x311a('0x37')];}_0x1d014c[_0x311a('0x2a')](_0x5412f4)[_0x311a('0x38')](_0x4490cf);};}exports[_0x311a('0x39')]=function(_0x243509,_0x3e6eb2){var _0x1edbb5={},_0x3affa5={},_0x4e95e5={'count':0x0,'rows':[]};var _0x51ab95=_[_0x311a('0x3a')](db[_0x311a('0x3b')][_0x311a('0x3c')],function(_0x521b26){return{'name':_0x521b26[_0x311a('0x3d')],'type':_0x521b26[_0x311a('0x3e')]['key']};});_0x3affa5[_0x311a('0x3f')]=_[_0x311a('0x3a')](_0x51ab95,'name');_0x3affa5[_0x311a('0x40')]=_[_0x311a('0x41')](_0x243509[_0x311a('0x40')]);_0x3affa5[_0x311a('0x42')]=_['intersection'](_0x3affa5[_0x311a('0x3f')],_0x3affa5[_0x311a('0x40')]);_0x1edbb5[_0x311a('0x43')]=_[_0x311a('0x44')](_0x3affa5[_0x311a('0x3f')],qs['fields'](_0x243509[_0x311a('0x40')][_0x311a('0x45')]));_0x1edbb5[_0x311a('0x43')]=_0x1edbb5[_0x311a('0x43')]['length']?_0x1edbb5['attributes']:_0x3affa5[_0x311a('0x3f')];if(!_0x243509[_0x311a('0x40')]['hasOwnProperty'](_0x311a('0x46'))){_0x1edbb5[_0x311a('0x2e')]=qs[_0x311a('0x2e')](_0x243509[_0x311a('0x40')][_0x311a('0x2e')]);_0x1edbb5[_0x311a('0x2b')]=qs[_0x311a('0x2b')](_0x243509[_0x311a('0x40')][_0x311a('0x2b')]);}_0x1edbb5[_0x311a('0x47')]=qs[_0x311a('0x48')](_0x243509[_0x311a('0x40')][_0x311a('0x48')]);_0x1edbb5[_0x311a('0x49')]=qs[_0x311a('0x42')](_[_0x311a('0x4a')](_0x243509['query'],_0x3affa5[_0x311a('0x42')]),_0x51ab95);if(_0x243509[_0x311a('0x40')][_0x311a('0x4b')]){_0x1edbb5[_0x311a('0x49')]=_['merge'](_0x1edbb5[_0x311a('0x49')],{'$or':_[_0x311a('0x3a')](_0x51ab95,function(_0x347db6){if(_0x347db6[_0x311a('0x3e')]!==_0x311a('0x4c')){var _0x2eae69={};_0x2eae69[_0x347db6[_0x311a('0x37')]]={'$like':'%'+_0x243509['query'][_0x311a('0x4b')]+'%'};return _0x2eae69;}})});}_0x1edbb5=_['merge']({},_0x1edbb5,_0x243509[_0x311a('0x4d')]);var _0x596240={'where':_0x1edbb5[_0x311a('0x49')]};return db['WhatsappMessage'][_0x311a('0x2d')](_0x596240)[_0x311a('0x1f')](function(_0x4c08a6){_0x4e95e5[_0x311a('0x2d')]=_0x4c08a6;if(_0x243509[_0x311a('0x40')]['includeAll']){_0x1edbb5[_0x311a('0x4e')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x311a('0x4f')](_0x1edbb5);})[_0x311a('0x1f')](function(_0x2e260c){_0x4e95e5['rows']=_0x2e260c;return _0x4e95e5;})[_0x311a('0x1f')](respondWithFilteredResult(_0x3e6eb2,_0x1edbb5))[_0x311a('0x50')](handleError(_0x3e6eb2,null));};exports[_0x311a('0x51')]=function(_0x4889cd,_0x25a180){var _0x4d11ab={'raw':!![],'where':{'id':_0x4889cd['params']['id']}},_0x2faa54={};_0x2faa54[_0x311a('0x3f')]=_['keys'](db['WhatsappMessage'][_0x311a('0x3c')]);_0x2faa54[_0x311a('0x40')]=_[_0x311a('0x41')](_0x4889cd['query']);_0x2faa54[_0x311a('0x42')]=_[_0x311a('0x44')](_0x2faa54[_0x311a('0x3f')],_0x2faa54[_0x311a('0x40')]);_0x4d11ab[_0x311a('0x43')]=_['intersection'](_0x2faa54[_0x311a('0x3f')],qs[_0x311a('0x45')](_0x4889cd[_0x311a('0x40')][_0x311a('0x45')]));_0x4d11ab[_0x311a('0x43')]=_0x4d11ab[_0x311a('0x43')][_0x311a('0x52')]?_0x4d11ab[_0x311a('0x43')]:_0x2faa54['model'];if(_0x4889cd[_0x311a('0x40')]['includeAll']){_0x4d11ab[_0x311a('0x4e')]=[{'all':!![]}];}_0x4d11ab=_[_0x311a('0x53')]({},_0x4d11ab,_0x4889cd[_0x311a('0x4d')]);return db[_0x311a('0x3b')][_0x311a('0x54')](_0x4d11ab)[_0x311a('0x1f')](handleEntityNotFound(_0x25a180,null))[_0x311a('0x1f')](respondWithResult(_0x25a180,null))[_0x311a('0x50')](handleError(_0x25a180,null));};exports[_0x311a('0x55')]=function(_0x43a3f0,_0x599129){return db[_0x311a('0x3b')][_0x311a('0x55')](_0x43a3f0[_0x311a('0x56')],{})['then'](respondWithResult(_0x599129,0xc9))[_0x311a('0x50')](handleError(_0x599129,null));};exports[_0x311a('0x57')]=function(_0x263d0,_0x5c5422){if(_0x263d0[_0x311a('0x56')]['id']){delete _0x263d0[_0x311a('0x56')]['id'];}return db[_0x311a('0x3b')][_0x311a('0x54')]({'where':{'id':_0x263d0[_0x311a('0x58')]['id']}})[_0x311a('0x1f')](handleEntityNotFound(_0x5c5422,null))[_0x311a('0x1f')](saveUpdates(_0x263d0[_0x311a('0x56')],null))[_0x311a('0x1f')](respondWithResult(_0x5c5422,null))['catch'](handleError(_0x5c5422,null));};exports[_0x311a('0x34')]=function(_0x2cce2e,_0x12e025){return db[_0x311a('0x3b')][_0x311a('0x54')]({'where':{'id':_0x2cce2e[_0x311a('0x58')]['id']}})[_0x311a('0x1f')](handleEntityNotFound(_0x12e025,null))[_0x311a('0x1f')](removeEntity(_0x12e025,null))[_0x311a('0x50')](handleError(_0x12e025,null));};exports[_0x311a('0x59')]=function(_0x2859c5,_0x19f251){return db[_0x311a('0x3b')][_0x311a('0x59')]()[_0x311a('0x1f')](respondWithResult(_0x19f251,null))[_0x311a('0x50')](handleError(_0x19f251,null));};var interaction_log=require(_0x311a('0x5a'))(_0x311a('0x5b'));exports[_0x311a('0x5c')]=function(_0x208a78,_0x51a88e,_0x3924fb){var _0x3c11bf={'agent':{},'channel':_0x311a('0x5d')};if(_0x208a78['body']['id']){delete _0x208a78[_0x311a('0x56')]['id'];}_0x208a78[_0x311a('0x56')][_0x311a('0x5e')]=!![];_0x208a78[_0x311a('0x56')][_0x311a('0x5f')]=moment()[_0x311a('0x60')](_0x311a('0x61'));_0x208a78[_0x311a('0x56')][_0x311a('0x62')]=_0x208a78[_0x311a('0x56')][_0x311a('0x62')]||_0x208a78['user']['id'];_0x3c11bf[_0x311a('0x63')]['id']=_0x208a78[_0x311a('0x56')]['UserId'];return db[_0x311a('0x3b')][_0x311a('0x54')]({'where':{'id':_0x208a78[_0x311a('0x58')]['id'],'UserId':null}})[_0x311a('0x1f')](handleEntityNotFound(_0x51a88e,null))[_0x311a('0x1f')](saveUpdates(_0x208a78[_0x311a('0x56')],null))[_0x311a('0x1f')](function(_0x242af8){if(_0x242af8){_0x3c11bf[_0x311a('0x26')]=_0x242af8[_0x311a('0x64')]({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0x242af8['WhatsappInteractionId']}});}return null;})[_0x311a('0x1f')](handleEntityNotFound(_0x51a88e,null))[_0x311a('0x1f')](function(_0x22d423){if(_0x22d423){return _0x22d423['update']({'UserId':_0x208a78[_0x311a('0x56')][_0x311a('0x62')],'read1stAt':_[_0x311a('0x65')](_0x22d423[_0x311a('0x66')])?moment()[_0x311a('0x60')](_0x311a('0x61')):undefined});}return null;})[_0x311a('0x1f')](function(_0x4153e2){if(_0x4153e2){_0x3c11bf[_0x311a('0x67')]=_0x4153e2[_0x311a('0x64')]({'plain':!![]});interaction_log['info'](_0x311a('0x68'),_0x208a78[_0x311a('0x69')]['id'],_0x208a78['user'][_0x311a('0x37')],_0x208a78[_0x311a('0x69')][_0x311a('0x6a')],_0x3c11bf[_0x311a('0x67')]['id'],_0x208a78['body']?JSON[_0x311a('0x23')](_0x208a78[_0x311a('0x56')]):_0x311a('0x6b'));return respondWithRpcPromise(_0x311a('0x6c'),_0x311a('0x6d'),_0x3c11bf);}return null;})[_0x311a('0x1f')](function(_0x4b7604){var _0x44cc38=_0x311a('0x6e')+_0x4b7604[_0x311a('0x26')][_0x311a('0x6f')];return db[_0x311a('0x70')][_0x311a('0x40')](_0x44cc38,{'type':db['Sequelize'][_0x311a('0x71')]['SELECT'],'raw':!![]})[_0x311a('0x1f')](function(_0x132c22){return _0x132c22;});})['then'](function(_0xf77717){if(_0xf77717){_0x3c11bf[_0x311a('0x26')][_0x311a('0x72')]=_0xf77717[0x0];if(!_0x208a78[_0x311a('0x56')][_0x311a('0x62')])return;return db[_0x311a('0x73')][_0x311a('0x54')]({'where':{'id':_0x208a78[_0x311a('0x56')][_0x311a('0x62')],'role':_0x311a('0x63')},'attributes':['id',_0x311a('0x37'),_0x311a('0x74'),_0x311a('0x75'),_0x311a('0x76')],'raw':!![]});}return null;})['then'](function(_0x5e6278){if(!_0x5e6278)return null;_0x3c11bf[_0x311a('0x26')]['agent']=_0x5e6278;return _0x3c11bf;})[_0x311a('0x1f')](function(_0x475b6a){if(_0x475b6a){if(_0x208a78[_0x311a('0x56')][_0x311a('0x77')]){_0x3c11bf[_0x311a('0x26')][_0x311a('0x78')]=util['format'](_0x311a('0x79'),_0x208a78[_0x311a('0x69')][_0x311a('0x37')]);_0x3c11bf[_0x311a('0x26')][_0x311a('0x7a')]=_0x3c11bf[_0x311a('0x7a')];_0x3c11bf['message'][_0x311a('0x7b')]=_0x3c11bf[_0x311a('0x7a')];_0x3c11bf['message'][_0x311a('0x7c')]=_0x311a('0x5c');return respondWithRpcPromise(_0x311a('0x7d'),_0x311a('0x7d'),{'event':_0x311a('0x7e'),'message':_0x3c11bf[_0x311a('0x26')]},client9002)['then'](function(){return _0x3c11bf;});}return _0x3c11bf;}return null;})[_0x311a('0x1f')](respondWithResult(_0x51a88e,null))['catch'](handleError(_0x51a88e,null));};var interaction_log=require(_0x311a('0x5a'))(_0x311a('0x5b'));exports[_0x311a('0x32')]=function(_0x2b7945,_0x2c1241,_0x5026d0){var _0x8d3a66={'agent':{},'channel':_0x311a('0x5d')};if(_0x2b7945['body']['id']){delete _0x2b7945[_0x311a('0x56')]['id'];}_0x2b7945[_0x311a('0x56')][_0x311a('0x62')]=_0x2b7945['body'][_0x311a('0x62')]||_0x2b7945[_0x311a('0x69')]['id'];_0x8d3a66[_0x311a('0x63')]['id']=_0x2b7945['body'][_0x311a('0x62')];return db[_0x311a('0x3b')][_0x311a('0x54')]({'where':{'id':_0x2b7945[_0x311a('0x58')]['id'],'UserId':null}})[_0x311a('0x1f')](handleEntityNotFound(_0x2c1241,null))['then'](function(_0x534ab1){if(_0x534ab1){_0x8d3a66[_0x311a('0x26')]=_0x534ab1[_0x311a('0x64')]({'plain':!![]});return db[_0x311a('0x7f')][_0x311a('0x54')]({'where':{'id':_0x534ab1[_0x311a('0x80')]}});}return null;})['then'](handleEntityNotFound(_0x2c1241,null))['then'](function(_0x57ea9e){if(_0x57ea9e){_0x8d3a66[_0x311a('0x67')]=_0x57ea9e[_0x311a('0x64')]({'plain':!![]});interaction_log[_0x311a('0x27')](_0x311a('0x81'),_0x2b7945['user']['id'],_0x2b7945['user'][_0x311a('0x37')],_0x2b7945[_0x311a('0x69')][_0x311a('0x6a')],_0x8d3a66['interaction']['id'],_0x2b7945[_0x311a('0x56')]?JSON[_0x311a('0x23')](_0x2b7945['body']):_0x311a('0x6b'));return respondWithRpcPromise(_0x311a('0x82'),_0x311a('0x83'),_0x8d3a66);}return null;})[_0x311a('0x1f')](function(_0x2cfccf){var _0x8a9c31=_0x311a('0x6e')+_0x2cfccf[_0x311a('0x26')][_0x311a('0x6f')];return db[_0x311a('0x70')]['query'](_0x8a9c31,{'type':db[_0x311a('0x84')][_0x311a('0x71')][_0x311a('0x85')],'raw':!![]})[_0x311a('0x1f')](function(_0x301d60){return _0x301d60;});})['then'](function(_0x5f28da){if(_0x5f28da){_0x8d3a66[_0x311a('0x26')][_0x311a('0x72')]=_0x5f28da[0x0];if(!_0x2b7945[_0x311a('0x56')][_0x311a('0x62')])return;return db['User']['find']({'where':{'id':_0x2b7945[_0x311a('0x56')][_0x311a('0x62')],'role':_0x311a('0x63')},'attributes':['id',_0x311a('0x37'),_0x311a('0x74'),_0x311a('0x75'),'internal'],'raw':!![]});}return null;})['then'](function(_0xcb871a){if(!_0xcb871a)return null;_0x8d3a66[_0x311a('0x26')]['agent']=_0xcb871a;return _0x8d3a66;})[_0x311a('0x1f')](function(_0x1f1a3e){if(_0x1f1a3e){_0x1f1a3e[_0x311a('0x26')]['interface']=util[_0x311a('0x60')]('SIP/%s',_0x2b7945[_0x311a('0x69')]['name']);_0x1f1a3e['message']['channel']=_0x8d3a66['channel'];_0x1f1a3e[_0x311a('0x26')][_0x311a('0x7b')]=_0x8d3a66[_0x311a('0x7a')];_0x1f1a3e[_0x311a('0x26')][_0x311a('0x7c')]=_0x311a('0x32');respondWithRpcPromise('EventManager',_0x311a('0x7d'),{'event':_0x311a('0x86'),'message':_0x1f1a3e[_0x311a('0x26')]},client9002);return _0x8d3a66;}return null;})[_0x311a('0x1f')](respondWithResult(_0x2c1241,null))['catch'](handleError(_0x2c1241,null));};exports[_0x311a('0x2a')]=function(_0x30ab06,_0xc9a5ed,_0x1234d7){if(_0x30ab06['body']['id']){delete _0x30ab06[_0x311a('0x56')]['id'];}var _0x8987e4;return db[_0x311a('0x3b')]['find']({'where':{'id':_0x30ab06[_0x311a('0x58')]['id']}})[_0x311a('0x1f')](handleEntityNotFound(_0xc9a5ed,null))[_0x311a('0x1f')](function(_0x4ba148){if(_0x4ba148){_0x8987e4=_0x4ba148;return db[_0x311a('0x87')][_0x311a('0x54')]({'where':{'id':_0x4ba148['WhatsappAccountId']}});}})[_0x311a('0x1f')](handleEntityNotFound(_0xc9a5ed,null))[_0x311a('0x1f')](function(_0x5c338f){if(_0x5c338f){logger['debug'](_0x311a('0x88'),_0x311a('0x2a'),_0x311a('0x89'),_0x5c338f[_0x311a('0x3e')],util[_0x311a('0x8a')](_0x30ab06['body'],{'showHidden':![],'depth':null}));switch(_0x5c338f[_0x311a('0x3e')]){case _0x311a('0x8b'):if(_0x30ab06[_0x311a('0x56')][_0x311a('0x8c')]&&_0x30ab06[_0x311a('0x56')][_0x311a('0x8c')]===_0x8987e4[_0x311a('0x8d')]&&_0x30ab06[_0x311a('0x56')][_0x311a('0x8e')]&&_0x30ab06[_0x311a('0x56')][_0x311a('0x8e')]===_0x311a('0x5e')){return _0x8987e4[_0x311a('0x57')]({'read':!![]});}else{logger[_0x311a('0x24')](_0x311a('0x8f'),_0x311a('0x2a'),_0x311a('0x8b'),util[_0x311a('0x8a')](_0x30ab06[_0x311a('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x8987e4;}})[_0x311a('0x1f')](respondWithResult(_0xc9a5ed,null))['catch'](handleError(_0xc9a5ed,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 5fbdcd1..c6e2098 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 _0x7462=['events','../../mysqldb','save','emit','hasOwnProperty','hook','exports'];(function(_0x298346,_0x5e8d11){var _0x380ade=function(_0x3ac8d8){while(--_0x3ac8d8){_0x298346['push'](_0x298346['shift']());}};_0x380ade(++_0x5e8d11);}(_0x7462,0x165));var _0x2746=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x7462[_0x37c22c];return _0x119d79;};'use strict';var EventEmitter=require(_0x2746('0x0'));var WhatsappMessage=require(_0x2746('0x1'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2746('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3a2c7f){return function(_0x2274b7,_0x57c788,_0x2afbbd){WhatsappMessageEvents[_0x2746('0x3')](_0x3a2c7f+':'+_0x2274b7['id'],_0x2274b7);WhatsappMessageEvents[_0x2746('0x3')](_0x3a2c7f,_0x2274b7);_0x2afbbd(null);};}for(var e in events){if(events[_0x2746('0x4')](e)){var event=events[e];WhatsappMessage[_0x2746('0x5')](e,emitEvent(event));}}module[_0x2746('0x6')]=WhatsappMessageEvents; \ No newline at end of file +var _0x0833=['setMaxListeners','save','emit','hook','exports','events','../../mysqldb','WhatsappMessage'];(function(_0x699b0c,_0x7936c9){var _0x472854=function(_0x28405c){while(--_0x28405c){_0x699b0c['push'](_0x699b0c['shift']());}};_0x472854(++_0x7936c9);}(_0x0833,0x1bd));var _0x3083=function(_0x60dd04,_0x2ef711){_0x60dd04=_0x60dd04-0x0;var _0x285a78=_0x0833[_0x60dd04];return _0x285a78;};'use strict';var EventEmitter=require(_0x3083('0x0'));var WhatsappMessage=require(_0x3083('0x1'))['db'][_0x3083('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x3083('0x3')](0x0);var events={'afterCreate':_0x3083('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4eec30){return function(_0x22717c,_0x58a865,_0xa26470){WhatsappMessageEvents[_0x3083('0x5')](_0x4eec30+':'+_0x22717c['id'],_0x22717c);WhatsappMessageEvents[_0x3083('0x5')](_0x4eec30,_0x22717c);_0xa26470(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0x3083('0x6')](e,emitEvent(event));}}module[_0x3083('0x7')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 5ebb5ae..f3b877b 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 _0x9203=['lodash','util','../../config/logger','api','moment','request-promise','node-fetch','rimraf','../../config/environment','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','models','get','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','update','createdAt','direction','catch','error','find','WhatsappAccountId','then','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/messages/','text','POST','Bearer\x20','statuses','message_id','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci'];(function(_0x368973,_0x29f084){var _0x19d1f3=function(_0x589c97){while(--_0x589c97){_0x368973['push'](_0x368973['shift']());}};_0x19d1f3(++_0x29f084);}(_0x9203,0x1a4));var _0x3920=function(_0x2d6197,_0x82ebfb){_0x2d6197=_0x2d6197-0x0;var _0x4d0e75=_0x9203[_0x2d6197];return _0x4d0e75;};'use strict';var _=require(_0x3920('0x0'));var util=require(_0x3920('0x1'));var logger=require(_0x3920('0x2'))(_0x3920('0x3'));var moment=require(_0x3920('0x4'));var BPromise=require('bluebird');var rp=require(_0x3920('0x5'));var fetch=require(_0x3920('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3920('0x7'));var config=require(_0x3920('0x8'));var attributes=require('./whatsappMessage.attributes');module['exports']=function(_0x41159c,_0x1059c7){return _0x41159c[_0x3920('0x9')](_0x3920('0xa'),attributes,{'tableName':_0x3920('0xb'),'paranoid':![],'indexes':[{'name':_0x3920('0xc'),'fields':['messageId']},{'name':_0x3920('0xd'),'fields':[_0x3920('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2673c1,_0x27422e,_0x2f296e){var _0x2f5125=_0x41159c[_0x3920('0xf')];var _0x41d432=_0x2673c1[_0x3920('0x10')]({'plain':!![]});if(_0x41d432['direction'][_0x3920('0x11')]()==='in'||_0x41d432['direction']['toLowerCase']()===_0x3920('0x12')&&!_0x41d432[_0x3920('0x13')]&&!_[_0x3920('0x14')](_0x41d432[_0x3920('0x15')])){_0x2f5125[_0x3920('0x16')][_0x3920('0x17')]({'where':{'id':_0x41d432['WhatsappInteractionId']}})['then'](function(_0x1881a9){if(_0x1881a9){_0x1881a9[_0x3920('0x18')]({'lastMsgAt':_0x41d432[_0x3920('0x19')],'lastMsgDirection':_0x41d432[_0x3920('0x1a')]['toLowerCase']()});}})[_0x3920('0x1b')](function(_0x4c3518){console[_0x3920('0x1c')](_0x4c3518);});}if(_0x41d432['direction']===_0x3920('0x12')&&!_0x41d432[_0x3920('0x13')]){var _0x37fbe3;_0x2f5125['WhatsappAccount'][_0x3920('0x1d')]({'where':{'id':_0x41d432[_0x3920('0x1e')]},'raw':!![]})[_0x3920('0x1f')](function(_0x1888bf){_0x37fbe3=_0x1888bf;if(_0x37fbe3&&_0x37fbe3[_0x3920('0x20')]){switch(_0x37fbe3[_0x3920('0x20')]){case _0x3920('0x21'):var _0xdd0fe0=require(_0x3920('0x21'));if(_0x37fbe3[_0x3920('0x22')]&&_0x37fbe3[_0x3920('0x23')]&&_0x37fbe3[_0x3920('0x24')]){var _0x1461d5=new _0xdd0fe0(_0x37fbe3[_0x3920('0x22')],_0x37fbe3[_0x3920('0x23')]);_0x1461d5[_0x3920('0x25')][_0x3920('0x26')]({'body':_0x41d432['body'],'to':_0x3920('0x27')+_0x41d432[_0x3920('0x24')],'from':_0x3920('0x27')+_0x37fbe3[_0x3920('0x24')],'statusCallback':_0x37fbe3[_0x3920('0x28')]+_0x3920('0x29')+_0x41d432['id']+'/status?token='+_0x37fbe3[_0x3920('0x2a')]})['then'](function(_0x56263a){if(_0x56263a[_0x3920('0x2b')]){return _0x2673c1[_0x3920('0x18')]({'messageId':_0x56263a['sid']});}})[_0x3920('0x1b')](function(_0x25cd40){logger[_0x3920('0x1c')](_0x3920('0x2c'),_0x3920('0x2d'),_0x3920('0x21'),util[_0x3920('0x2e')](_0x25cd40,{'showHidden':![],'depth':null}));});}else{logger[_0x3920('0x1c')](_0x3920('0x2c'),_0x3920('0x2d'),_0x3920('0x21'),_0x3920('0x2f'));}break;case _0x3920('0x30'):var _0x32afbb=_0x37fbe3['accountSid'];var _0x55bf5b=_0x37fbe3['authToken'];var _0x51db3d=_0x37fbe3[_0x3920('0x31')]+'/whatsapp/v1/'+_0x32afbb+_0x3920('0x32');var _0x4da35c={'to':[_0x41d432[_0x3920('0x24')]],'message':{'type':_0x3920('0x33'),'text':_0x41d432['body']}};var _0x310852={'method':_0x3920('0x34'),'uri':_0x51db3d,'headers':{'Authorization':_0x3920('0x35')+_0x55bf5b,'Content-Type':'application/json'},'body':_0x4da35c,'json':!![]};rp(_0x310852)[_0x3920('0x1f')](function(_0x1236a5){if(_0x1236a5[_0x3920('0x36')][0x0][_0x3920('0x37')]){return _0x2673c1[_0x3920('0x18')]({'messageId':_0x1236a5[_0x3920('0x36')][0x0][_0x3920('0x37')]});}})[_0x3920('0x1b')](function(_0x16772b){logger['err'](_0x3920('0x38'),_0x16772b);});break;}}})[_0x3920('0x39')](function(){_0x2f296e();});}else{_0x2f296e();}}},'charset':_0x3920('0x3a'),'collate':_0x3920('0x3b')});}; \ No newline at end of file +var _0xf3cd=['text','POST','Bearer\x20','application/json','statuses','message_id','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','node-fetch','path','rimraf','./whatsappMessage.attributes','exports','define','WhatsappMessage','messageId','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','WhatsappInteraction','findOne','WhatsappInteractionId','update','createdAt','catch','error','WhatsappAccount','find','WhatsappAccountId','then','type','twilio','accountSid','authToken','messages','create','whatsapp:','phone','remote','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','baseUrl','/whatsapp/v1/'];(function(_0x45b7e1,_0xa481cb){var _0x328dd2=function(_0x117824){while(--_0x117824){_0x45b7e1['push'](_0x45b7e1['shift']());}};_0x328dd2(++_0xa481cb);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x35b7d4,_0x5a5c43){_0x35b7d4=_0x35b7d4-0x0;var _0x4e8cee=_0xf3cd[_0x35b7d4];return _0x4e8cee;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var logger=require(_0xdf3c('0x2'))(_0xdf3c('0x3'));var moment=require(_0xdf3c('0x4'));var BPromise=require(_0xdf3c('0x5'));var rp=require('request-promise');var fetch=require(_0xdf3c('0x6'));var fs=require('fs');var path=require(_0xdf3c('0x7'));var rimraf=require(_0xdf3c('0x8'));var config=require('../../config/environment');var attributes=require(_0xdf3c('0x9'));module[_0xdf3c('0xa')]=function(_0x1313d5,_0x1f0601){return _0x1313d5[_0xdf3c('0xb')](_0xdf3c('0xc'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0xdf3c('0xd'),'fields':['messageId']},{'name':'fti_whatsapp_messages','fields':[_0xdf3c('0xe')],'type':_0xdf3c('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5ef936,_0x1dba4c,_0x205f33){var _0x2d420c=_0x1313d5[_0xdf3c('0x10')];var _0x3a3154=_0x5ef936[_0xdf3c('0x11')]({'plain':!![]});if(_0x3a3154[_0xdf3c('0x12')][_0xdf3c('0x13')]()==='in'||_0x3a3154['direction'][_0xdf3c('0x13')]()===_0xdf3c('0x14')&&!_0x3a3154[_0xdf3c('0x15')]&&!_[_0xdf3c('0x16')](_0x3a3154['UserId'])){_0x2d420c[_0xdf3c('0x17')][_0xdf3c('0x18')]({'where':{'id':_0x3a3154[_0xdf3c('0x19')]}})['then'](function(_0x18aafa){if(_0x18aafa){_0x18aafa[_0xdf3c('0x1a')]({'lastMsgAt':_0x3a3154[_0xdf3c('0x1b')],'lastMsgDirection':_0x3a3154[_0xdf3c('0x12')][_0xdf3c('0x13')]()});}})[_0xdf3c('0x1c')](function(_0x305ea5){console[_0xdf3c('0x1d')](_0x305ea5);});}if(_0x3a3154[_0xdf3c('0x12')]===_0xdf3c('0x14')&&!_0x3a3154['secret']){var _0x13b0e6;_0x2d420c[_0xdf3c('0x1e')][_0xdf3c('0x1f')]({'where':{'id':_0x3a3154[_0xdf3c('0x20')]},'raw':!![]})[_0xdf3c('0x21')](function(_0x113b56){_0x13b0e6=_0x113b56;if(_0x13b0e6&&_0x13b0e6[_0xdf3c('0x22')]){switch(_0x13b0e6[_0xdf3c('0x22')]){case _0xdf3c('0x23'):var _0x18fb5f=require(_0xdf3c('0x23'));if(_0x13b0e6[_0xdf3c('0x24')]&&_0x13b0e6[_0xdf3c('0x25')]&&_0x13b0e6['phone']){var _0x4d620f=new _0x18fb5f(_0x13b0e6[_0xdf3c('0x24')],_0x13b0e6['authToken']);_0x4d620f[_0xdf3c('0x26')][_0xdf3c('0x27')]({'body':_0x3a3154[_0xdf3c('0xe')],'to':_0xdf3c('0x28')+_0x3a3154[_0xdf3c('0x29')],'from':_0xdf3c('0x28')+_0x13b0e6['phone'],'statusCallback':_0x13b0e6[_0xdf3c('0x2a')]+_0xdf3c('0x2b')+_0x3a3154['id']+_0xdf3c('0x2c')+_0x13b0e6[_0xdf3c('0x2d')]})[_0xdf3c('0x21')](function(_0x3b5371){if(_0x3b5371[_0xdf3c('0x2e')]){return _0x5ef936[_0xdf3c('0x1a')]({'messageId':_0x3b5371[_0xdf3c('0x2e')]});}})[_0xdf3c('0x1c')](function(_0x4c076c){logger[_0xdf3c('0x1d')](_0xdf3c('0x2f'),'afterCreate',_0xdf3c('0x23'),util['inspect'](_0x4c076c,{'showHidden':![],'depth':null}));});}else{logger['error']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xdf3c('0x30'),_0xdf3c('0x23'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case'sinch':var _0x37ecfd=_0x13b0e6[_0xdf3c('0x24')];var _0xd3cfcb=_0x13b0e6[_0xdf3c('0x25')];var _0x5c98a2=_0x13b0e6[_0xdf3c('0x31')]+_0xdf3c('0x32')+_0x37ecfd+'/messages/';var _0x51e0a4={'to':[_0x3a3154[_0xdf3c('0x29')]],'message':{'type':_0xdf3c('0x33'),'text':_0x3a3154[_0xdf3c('0xe')]}};var _0x540f3a={'method':_0xdf3c('0x34'),'uri':_0x5c98a2,'headers':{'Authorization':_0xdf3c('0x35')+_0xd3cfcb,'Content-Type':_0xdf3c('0x36')},'body':_0x51e0a4,'json':!![]};rp(_0x540f3a)[_0xdf3c('0x21')](function(_0x575ae1){if(_0x575ae1[_0xdf3c('0x37')][0x0][_0xdf3c('0x38')]){return _0x5ef936['update']({'messageId':_0x575ae1[_0xdf3c('0x37')][0x0][_0xdf3c('0x38')]});}})[_0xdf3c('0x1c')](function(_0x2287f){logger['err'](_0xdf3c('0x39'),_0x2287f);});break;}}})[_0xdf3c('0x3a')](function(){_0x205f33();});}else{_0x205f33();}}},'charset':_0xdf3c('0x3b'),'collate':_0xdf3c('0x3c')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 3e968ce..8b6333c 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 _0x319b=['localhost','socket.io-emitter','./whatsappMessage.socket','register','then','debug','request\x20sent','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','info','result','catch','CreateWhatsappMessage','WhatsappMessage','create','options','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','client','redis','defaults'];(function(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0x319b,0xa4));var _0xb319=function(_0x231400,_0x371bee){_0x231400=_0x231400-0x0;var _0x5cbd2d=_0x319b[_0x231400];return _0x5cbd2d;};'use strict';var _=require('lodash');var util=require(_0xb319('0x0'));var moment=require(_0xb319('0x1'));var BPromise=require(_0xb319('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb319('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb319('0x4'));var logger=require('../../config/logger')(_0xb319('0x5'));var config=require(_0xb319('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb319('0x7')]['http']({'port':0x232a});config[_0xb319('0x8')]=_[_0xb319('0x9')](config['redis'],{'host':_0xb319('0xa'),'port':0x18eb});var socket=require(_0xb319('0xb'))(new Redis(config[_0xb319('0x8')]));require(_0xb319('0xc'))[_0xb319('0xd')](socket);function respondWithRpcPromise(_0x58699b,_0x51a292,_0x141cb7){return new BPromise(function(_0x47c555,_0x1cb6d1){return client['request'](_0x58699b,_0x141cb7)[_0xb319('0xe')](function(_0x184c65){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x51a292,'request\x20sent');logger[_0xb319('0xf')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x51a292,_0xb319('0x10'),JSON[_0xb319('0x11')](_0x184c65));if(_0x184c65[_0xb319('0x12')]){if(_0x184c65[_0xb319('0x12')][_0xb319('0x13')]===0x1f4){logger['error'](_0xb319('0x14'),_0x51a292,_0x184c65[_0xb319('0x12')]['message']);return _0x1cb6d1(_0x184c65[_0xb319('0x12')][_0xb319('0x15')]);}logger[_0xb319('0x12')](_0xb319('0x14'),_0x51a292,_0x184c65['error'][_0xb319('0x15')]);return _0x47c555(_0x184c65[_0xb319('0x12')]['message']);}else{logger[_0xb319('0x16')](_0xb319('0x14'),_0x51a292,_0xb319('0x10'));_0x47c555(_0x184c65[_0xb319('0x17')][_0xb319('0x15')]);}})[_0xb319('0x18')](function(_0x36523e){logger['error'](_0xb319('0x14'),_0x51a292,_0x36523e);_0x1cb6d1(_0x36523e);});});}exports[_0xb319('0x19')]=function(_0xef25ef){var _0x4324c2=this;return new Promise(function(_0x481f3c,_0x3ea595){return db[_0xb319('0x1a')][_0xb319('0x1b')](_0xef25ef['body'],{'raw':_0xef25ef[_0xb319('0x1c')]?_0xef25ef['options']['raw']===undefined?!![]:![]:!![]})[_0xb319('0xe')](function(_0x2802c4){logger[_0xb319('0x16')](_0xb319('0x19'),_0xef25ef);logger[_0xb319('0xf')](_0xb319('0x19'),_0xef25ef,JSON[_0xb319('0x11')](_0x2802c4));_0x481f3c(_0x2802c4);})['catch'](function(_0x1ec3cf){logger['error'](_0xb319('0x19'),_0x1ec3cf[_0xb319('0x15')],_0xef25ef);_0x3ea595(_0x4324c2[_0xb319('0x12')](0x1f4,_0x1ec3cf[_0xb319('0x15')]));});});}; \ No newline at end of file +var _0xb94a=['../../config/environment','http','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateWhatsappMessage','create','options','raw','stringify','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x530425,_0x38fa97){var _0x4b132f=function(_0x301c35){while(--_0x301c35){_0x530425['push'](_0x530425['shift']());}};_0x4b132f(++_0x38fa97);}(_0xb94a,0x141));var _0xab94=function(_0x448820,_0x2aadb3){_0x448820=_0x448820-0x0;var _0x44e606=_0xb94a[_0x448820];return _0x44e606;};'use strict';var _=require(_0xab94('0x0'));var util=require(_0xab94('0x1'));var moment=require(_0xab94('0x2'));var BPromise=require('bluebird');var rs=require(_0xab94('0x3'));var fs=require('fs');var Redis=require(_0xab94('0x4'));var db=require(_0xab94('0x5'))['db'];var utils=require(_0xab94('0x6'));var logger=require(_0xab94('0x7'))(_0xab94('0x8'));var config=require(_0xab94('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xab94('0xa')]({'port':0x232a});config[_0xab94('0xb')]=_['defaults'](config[_0xab94('0xb')],{'host':_0xab94('0xc'),'port':0x18eb});var socket=require(_0xab94('0xd'))(new Redis(config[_0xab94('0xb')]));require(_0xab94('0xe'))[_0xab94('0xf')](socket);function respondWithRpcPromise(_0x21ca8e,_0x453786,_0x278dd7){return new BPromise(function(_0x345495,_0x45f1f2){return client[_0xab94('0x10')](_0x21ca8e,_0x278dd7)[_0xab94('0x11')](function(_0x5d0c9e){logger[_0xab94('0x12')](_0xab94('0x13'),_0x453786,_0xab94('0x14'));logger[_0xab94('0x15')](_0xab94('0x16'),_0x453786,_0xab94('0x14'),JSON['stringify'](_0x5d0c9e));if(_0x5d0c9e[_0xab94('0x17')]){if(_0x5d0c9e['error'][_0xab94('0x18')]===0x1f4){logger[_0xab94('0x17')]('WhatsappMessage,\x20%s,\x20%s',_0x453786,_0x5d0c9e[_0xab94('0x17')][_0xab94('0x19')]);return _0x45f1f2(_0x5d0c9e[_0xab94('0x17')][_0xab94('0x19')]);}logger[_0xab94('0x17')](_0xab94('0x13'),_0x453786,_0x5d0c9e[_0xab94('0x17')][_0xab94('0x19')]);return _0x345495(_0x5d0c9e[_0xab94('0x17')][_0xab94('0x19')]);}else{logger[_0xab94('0x12')](_0xab94('0x13'),_0x453786,_0xab94('0x14'));_0x345495(_0x5d0c9e[_0xab94('0x1a')]['message']);}})['catch'](function(_0x10be1f){logger[_0xab94('0x17')](_0xab94('0x13'),_0x453786,_0x10be1f);_0x45f1f2(_0x10be1f);});});}exports[_0xab94('0x1b')]=function(_0x2d885d){var _0x53d4e6=this;return new Promise(function(_0x13a89f,_0x1a8e8b){return db['WhatsappMessage'][_0xab94('0x1c')](_0x2d885d['body'],{'raw':_0x2d885d[_0xab94('0x1d')]?_0x2d885d[_0xab94('0x1d')][_0xab94('0x1e')]===undefined?!![]:![]:!![]})[_0xab94('0x11')](function(_0x5031b2){logger[_0xab94('0x12')]('CreateWhatsappMessage',_0x2d885d);logger[_0xab94('0x15')](_0xab94('0x1b'),_0x2d885d,JSON[_0xab94('0x1f')](_0x5031b2));_0x13a89f(_0x5031b2);})[_0xab94('0x20')](function(_0x1d377a){logger['error'](_0xab94('0x1b'),_0x1d377a[_0xab94('0x19')],_0x2d885d);_0x1a8e8b(_0x53d4e6[_0xab94('0x17')](0x1f4,_0x1d377a['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index e5c8a7d..33f528d 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 _0x53ce=['whatsappMessage:','./whatsappMessage.events','save','remove','update','emit','register'];(function(_0x8e8ca7,_0x5a5e07){var _0x561381=function(_0x2f4bda){while(--_0x2f4bda){_0x8e8ca7['push'](_0x8e8ca7['shift']());}};_0x561381(++_0x5a5e07);}(_0x53ce,0x135));var _0xe53c=function(_0x116fff,_0x1d3257){_0x116fff=_0x116fff-0x0;var _0x3ffa53=_0x53ce[_0x116fff];return _0x3ffa53;};'use strict';var WhatsappMessageEvents=require(_0xe53c('0x0'));var events=[_0xe53c('0x1'),_0xe53c('0x2'),_0xe53c('0x3')];function createListener(_0x29a3e3,_0xc29b86){return function(_0x557c97){_0xc29b86[_0xe53c('0x4')](_0x29a3e3,_0x557c97);};}function removeListener(_0x37e73c,_0x479689){return function(){WhatsappMessageEvents['removeListener'](_0x37e73c,_0x479689);};}exports[_0xe53c('0x5')]=function(_0xe413a3){for(var _0x1d4c31=0x0,_0x43be4b=events['length'];_0x1d4c31<_0x43be4b;_0x1d4c31++){var _0x1b4488=events[_0x1d4c31];var _0x3c3cac=createListener(_0xe53c('0x6')+_0x1b4488,_0xe413a3);WhatsappMessageEvents['on'](_0x1b4488,_0x3c3cac);}}; \ No newline at end of file +var _0x7c66=['emit','length','./whatsappMessage.events','save','remove','update'];(function(_0x27913d,_0x14b663){var _0x3cc142=function(_0x57ca63){while(--_0x57ca63){_0x27913d['push'](_0x27913d['shift']());}};_0x3cc142(++_0x14b663);}(_0x7c66,0x92));var _0x67c6=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x7c66[_0x5ddb1c];return _0x354adc;};'use strict';var WhatsappMessageEvents=require(_0x67c6('0x0'));var events=[_0x67c6('0x1'),_0x67c6('0x2'),_0x67c6('0x3')];function createListener(_0x343ac6,_0x5c7358){return function(_0x2625eb){_0x5c7358[_0x67c6('0x4')](_0x343ac6,_0x2625eb);};}function removeListener(_0x36857e,_0x1235bf){return function(){WhatsappMessageEvents['removeListener'](_0x36857e,_0x1235bf);};}exports['register']=function(_0x2e26dc){for(var _0xdd5ad0=0x0,_0x4e3c0c=events[_0x67c6('0x5')];_0xdd5ad0<_0x4e3c0c;_0xdd5ad0++){var _0x5e010a=events[_0xdd5ad0];var _0x35a210=createListener('whatsappMessage:'+_0x5e010a,_0x2e26dc);WhatsappMessageEvents['on'](_0x5e010a,_0x35a210);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 09b97c3..2ee484f 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 _0x8a25=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./whatsappQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/teams','getTeams','/:id/users','create','post','addTeams','addAgents','put','delete','destroy','removeAgents'];(function(_0x2bdc4d,_0x4f26d1){var _0x3050f5=function(_0x24ff3f){while(--_0x24ff3f){_0x2bdc4d['push'](_0x2bdc4d['shift']());}};_0x3050f5(++_0x4f26d1);}(_0x8a25,0xb7));var _0x58a2=function(_0x53c2db,_0x552d4d){_0x53c2db=_0x53c2db-0x0;var _0x197d71=_0x8a25[_0x53c2db];return _0x197d71;};'use strict';var multer=require(_0x58a2('0x0'));var util=require(_0x58a2('0x1'));var path=require(_0x58a2('0x2'));var timeout=require(_0x58a2('0x3'));var express=require(_0x58a2('0x4'));var router=express[_0x58a2('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x58a2('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x58a2('0x7'));router[_0x58a2('0x8')]('/',auth[_0x58a2('0x9')](),controller[_0x58a2('0xa')]);router[_0x58a2('0x8')](_0x58a2('0xb'),auth[_0x58a2('0x9')](),controller['describe']);router[_0x58a2('0x8')](_0x58a2('0xc'),auth[_0x58a2('0x9')](),controller[_0x58a2('0xd')]);router['get']('/:id/members',auth[_0x58a2('0x9')](),controller['getMembers']);router['get'](_0x58a2('0xe'),auth[_0x58a2('0x9')](),controller[_0x58a2('0xf')]);router[_0x58a2('0x8')](_0x58a2('0x10'),auth[_0x58a2('0x9')](),controller['getAgents']);router['post']('/',auth[_0x58a2('0x9')](),controller[_0x58a2('0x11')]);router[_0x58a2('0x12')](_0x58a2('0xe'),auth[_0x58a2('0x9')](),controller[_0x58a2('0x13')]);router[_0x58a2('0x12')](_0x58a2('0x10'),auth[_0x58a2('0x9')](),controller[_0x58a2('0x14')]);router[_0x58a2('0x15')](_0x58a2('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x58a2('0x16')](_0x58a2('0xc'),auth[_0x58a2('0x9')](),controller[_0x58a2('0x17')]);router[_0x58a2('0x16')]('/:id/teams',auth[_0x58a2('0x9')](),controller['removeTeams']);router[_0x58a2('0x16')](_0x58a2('0x10'),auth['isAuthenticated'](),controller[_0x58a2('0x18')]);module[_0x58a2('0x19')]=router; \ No newline at end of file +var _0xef7e=['getTeams','/:id/users','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/teams'];(function(_0x3e53a6,_0x273b09){var _0x5be7a1=function(_0x48a874){while(--_0x48a874){_0x3e53a6['push'](_0x3e53a6['shift']());}};_0x5be7a1(++_0x273b09);}(_0xef7e,0x194));var _0xeef7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xef7e[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xeef7('0x0'));var util=require('util');var path=require(_0xeef7('0x1'));var timeout=require(_0xeef7('0x2'));var express=require('express');var router=express[_0xeef7('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xeef7('0x4'));var interaction=require(_0xeef7('0x5'));var config=require(_0xeef7('0x6'));var controller=require(_0xeef7('0x7'));router[_0xeef7('0x8')]('/',auth[_0xeef7('0x9')](),controller[_0xeef7('0xa')]);router[_0xeef7('0x8')](_0xeef7('0xb'),auth[_0xeef7('0x9')](),controller[_0xeef7('0xc')]);router[_0xeef7('0x8')](_0xeef7('0xd'),auth[_0xeef7('0x9')](),controller[_0xeef7('0xe')]);router[_0xeef7('0x8')]('/:id/members',auth[_0xeef7('0x9')](),controller['getMembers']);router[_0xeef7('0x8')](_0xeef7('0xf'),auth[_0xeef7('0x9')](),controller[_0xeef7('0x10')]);router[_0xeef7('0x8')](_0xeef7('0x11'),auth['isAuthenticated'](),controller['getAgents']);router[_0xeef7('0x12')]('/',auth[_0xeef7('0x9')](),controller[_0xeef7('0x13')]);router['post'](_0xeef7('0xf'),auth[_0xeef7('0x9')](),controller[_0xeef7('0x14')]);router[_0xeef7('0x12')]('/:id/users',auth[_0xeef7('0x9')](),controller[_0xeef7('0x15')]);router[_0xeef7('0x16')]('/:id',auth[_0xeef7('0x9')](),controller[_0xeef7('0x17')]);router[_0xeef7('0x18')](_0xeef7('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0xeef7('0x18')](_0xeef7('0xf'),auth[_0xeef7('0x9')](),controller[_0xeef7('0x19')]);router[_0xeef7('0x18')]('/:id/users',auth['isAuthenticated'](),controller[_0xeef7('0x1a')]);module[_0xeef7('0x1b')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 34d76c3..2eef83b 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(_0x523671,_0x4657fc){_0x523671=_0x523671-0x0;var _0x5b0bdc=_0x1f38[_0x523671];return _0x5b0bdc;};'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 _0xfa20=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x395586,_0x102ef2){var _0x28ed74=function(_0x2b630e){while(--_0x2b630e){_0x395586['push'](_0x395586['shift']());}};_0x28ed74(++_0x102ef2);}(_0xfa20,0x141));var _0x0fa2=function(_0x5b2155,_0x11bf44){_0x5b2155=_0x5b2155-0x0;var _0x1fd657=_0xfa20[_0x5b2155];return _0x1fd657;};'use strict';var Sequelize=require(_0x0fa2('0x0'));module[_0x0fa2('0x1')]={'name':{'type':Sequelize[_0x0fa2('0x2')],'unique':_0x0fa2('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x0fa2('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0fa2('0x5')](_0x0fa2('0x6'),_0x0fa2('0x7'),_0x0fa2('0x8'))},'description':{'type':Sequelize[_0x0fa2('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 97fb878..f4c693b 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 _0x73a7=['rawAttributes','intersection','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','describe','getMembers','findOne','WhatsappQueueId','UserWhatsappQueue','findAll','UserId','updatedAt','rows','%s/%s','SIP','createdAt','getTeams','Team','nolimit','addTeams','ids','User','online','interface','Agents','transaction','forEach','emit','userWhatsappQueue:save','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','sequelize','toString','every','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','getAgents','order','eml-format','rimraf','zip-dir','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','./whatsappQueue.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','error','stack','name','send','index','map','WhatsappQueue','fieldName','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params'];(function(_0x45321d,_0x58eb4f){var _0x1a999a=function(_0x3195c1){while(--_0x3195c1){_0x45321d['push'](_0x45321d['shift']());}};_0x1a999a(++_0x58eb4f);}(_0x73a7,0x158));var _0x773a=function(_0x46a6bc,_0x3d51cd){_0x46a6bc=_0x46a6bc-0x0;var _0x35ce6b=_0x73a7[_0x46a6bc];return _0x35ce6b;};'use strict';var emlformat=require(_0x773a('0x0'));var rimraf=require(_0x773a('0x1'));var zipdir=require(_0x773a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x773a('0x3'));var Mustache=require(_0x773a('0x4'));var util=require('util');var path=require(_0x773a('0x5'));var sox=require(_0x773a('0x6'));var csv=require(_0x773a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x773a('0x8'));var _=require(_0x773a('0x9'));var squel=require(_0x773a('0xa'));var crypto=require(_0x773a('0xb'));var jsforce=require(_0x773a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x773a('0x7'));var querystring=require(_0x773a('0xd'));var Papa=require(_0x773a('0xe'));var Redis=require(_0x773a('0xf'));var authService=require(_0x773a('0x10'));var qs=require(_0x773a('0x11'));var as=require(_0x773a('0x12'));var hardwareService=require(_0x773a('0x13'));var logger=require(_0x773a('0x14'))('api');var utils=require(_0x773a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x773a('0x16'));var db=require(_0x773a('0x17'))['db'];config['redis']=_[_0x773a('0x18')](config[_0x773a('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x773a('0x19')]));require(_0x773a('0x1a'))[_0x773a('0x1b')](socket);function respondWithStatusCode(_0x282e19,_0x4ceb08){_0x4ceb08=_0x4ceb08||0xcc;return function(_0x5d75b2){if(_0x5d75b2){return _0x282e19[_0x773a('0x1c')](_0x4ceb08);}return _0x282e19[_0x773a('0x1d')](_0x4ceb08)[_0x773a('0x1e')]();};}function respondWithResult(_0x57f462,_0x3e1348){_0x3e1348=_0x3e1348||0xc8;return function(_0x1bf999){if(_0x1bf999){return _0x57f462[_0x773a('0x1d')](_0x3e1348)[_0x773a('0x1f')](_0x1bf999);}};}function respondWithFilteredResult(_0x44922e,_0x226a72){return function(_0x327cf6){if(_0x327cf6){var _0x27a4c1=typeof _0x226a72['offset']===_0x773a('0x20')&&typeof _0x226a72[_0x773a('0x21')]===_0x773a('0x20');var _0x299b27=_0x327cf6[_0x773a('0x22')];var _0x1ef994=_0x27a4c1?0x0:_0x226a72[_0x773a('0x23')];var _0x2661ff=_0x27a4c1?_0x327cf6[_0x773a('0x22')]:_0x226a72['offset']+_0x226a72['limit'];var _0x27233d;if(_0x2661ff>=_0x299b27){_0x2661ff=_0x299b27;_0x27233d=0xc8;}else{_0x27233d=0xce;}_0x44922e[_0x773a('0x1d')](_0x27233d);return _0x44922e[_0x773a('0x24')](_0x773a('0x25'),_0x1ef994+'-'+_0x2661ff+'/'+_0x299b27)[_0x773a('0x1f')](_0x327cf6);}return null;};}function patchUpdates(_0x1fab22){return function(_0x3b4cde){try{jsonpatch['apply'](_0x3b4cde,_0x1fab22,!![]);}catch(_0x115df9){return BPromise[_0x773a('0x26')](_0x115df9);}return _0x3b4cde[_0x773a('0x27')]();};}function saveUpdates(_0x2899f4,_0x30405a){return function(_0x38a090){if(_0x38a090){return _0x38a090[_0x773a('0x28')](_0x2899f4)[_0x773a('0x29')](function(_0x41fccc){return _0x41fccc;});}return null;};}function removeEntity(_0x53ad0a,_0x4f2fd8){return function(_0x81ad39){if(_0x81ad39){return _0x81ad39[_0x773a('0x2a')]()['then'](function(){var _0x12889e=_0x81ad39[_0x773a('0x2b')]({'plain':!![]});var _0x58b29a=_0x773a('0x2c');return db[_0x773a('0x2d')][_0x773a('0x2a')]({'where':{'type':_0x58b29a,'resourceId':_0x12889e['id']}})[_0x773a('0x29')](function(){return _0x81ad39;});})[_0x773a('0x29')](function(){_0x53ad0a[_0x773a('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10ebfa,_0x42aaf7){return function(_0x15d730){if(!_0x15d730){_0x10ebfa['sendStatus'](0x194);}return _0x15d730;};}function handleError(_0x189905,_0xd5b1c8){_0xd5b1c8=_0xd5b1c8||0x1f4;return function(_0x7d7e10){logger[_0x773a('0x2e')](_0x7d7e10[_0x773a('0x2f')]);if(_0x7d7e10[_0x773a('0x30')]){delete _0x7d7e10['name'];}_0x189905['status'](_0xd5b1c8)[_0x773a('0x31')](_0x7d7e10);};}exports[_0x773a('0x32')]=function(_0x3f434a,_0x4c6f7a){var _0x2fea54={},_0x235d4e={},_0x443299={'count':0x0,'rows':[]};var _0x3376b7=_[_0x773a('0x33')](db[_0x773a('0x34')]['rawAttributes'],function(_0x4b10ad){return{'name':_0x4b10ad[_0x773a('0x35')],'type':_0x4b10ad[_0x773a('0x36')][_0x773a('0x37')]};});_0x235d4e[_0x773a('0x38')]=_[_0x773a('0x33')](_0x3376b7,_0x773a('0x30'));_0x235d4e[_0x773a('0x39')]=_[_0x773a('0x3a')](_0x3f434a['query']);_0x235d4e[_0x773a('0x3b')]=_['intersection'](_0x235d4e[_0x773a('0x38')],_0x235d4e[_0x773a('0x39')]);_0x2fea54['attributes']=_['intersection'](_0x235d4e[_0x773a('0x38')],qs[_0x773a('0x3c')](_0x3f434a[_0x773a('0x39')][_0x773a('0x3c')]));_0x2fea54[_0x773a('0x3d')]=_0x2fea54['attributes'][_0x773a('0x3e')]?_0x2fea54[_0x773a('0x3d')]:_0x235d4e[_0x773a('0x38')];if(!_0x3f434a['query'][_0x773a('0x3f')]('nolimit')){_0x2fea54['limit']=qs[_0x773a('0x21')](_0x3f434a[_0x773a('0x39')][_0x773a('0x21')]);_0x2fea54['offset']=qs[_0x773a('0x23')](_0x3f434a['query'][_0x773a('0x23')]);}_0x2fea54['order']=qs[_0x773a('0x40')](_0x3f434a[_0x773a('0x39')][_0x773a('0x40')]);_0x2fea54[_0x773a('0x41')]=qs[_0x773a('0x3b')](_[_0x773a('0x42')](_0x3f434a['query'],_0x235d4e[_0x773a('0x3b')]),_0x3376b7);if(_0x3f434a[_0x773a('0x39')][_0x773a('0x43')]){_0x2fea54[_0x773a('0x41')]=_[_0x773a('0x44')](_0x2fea54[_0x773a('0x41')],{'$or':_[_0x773a('0x33')](_0x3376b7,function(_0xb760dc){if(_0xb760dc[_0x773a('0x36')]!==_0x773a('0x45')){var _0x28f594={};_0x28f594[_0xb760dc['name']]={'$like':'%'+_0x3f434a[_0x773a('0x39')][_0x773a('0x43')]+'%'};return _0x28f594;}})});}_0x2fea54=_[_0x773a('0x44')]({},_0x2fea54,_0x3f434a[_0x773a('0x46')]);var _0x57c297={'where':_0x2fea54[_0x773a('0x41')]};return db['WhatsappQueue'][_0x773a('0x22')](_0x57c297)[_0x773a('0x29')](function(_0x490ddf){_0x443299[_0x773a('0x22')]=_0x490ddf;if(_0x3f434a[_0x773a('0x39')][_0x773a('0x47')]){_0x2fea54[_0x773a('0x48')]=[{'all':!![]}];}return db[_0x773a('0x34')]['findAll'](_0x2fea54);})['then'](function(_0x311e65){_0x443299['rows']=_0x311e65;return _0x443299;})[_0x773a('0x29')](respondWithFilteredResult(_0x4c6f7a,_0x2fea54))[_0x773a('0x49')](handleError(_0x4c6f7a,null));};exports[_0x773a('0x4a')]=function(_0x4a9c0c,_0x2628cf){var _0x325569={'raw':!![],'where':{'id':_0x4a9c0c[_0x773a('0x4b')]['id']}},_0x53631e={};_0x53631e[_0x773a('0x38')]=_['keys'](db[_0x773a('0x34')][_0x773a('0x4c')]);_0x53631e[_0x773a('0x39')]=_['keys'](_0x4a9c0c[_0x773a('0x39')]);_0x53631e[_0x773a('0x3b')]=_[_0x773a('0x4d')](_0x53631e['model'],_0x53631e[_0x773a('0x39')]);_0x325569[_0x773a('0x3d')]=_[_0x773a('0x4d')](_0x53631e[_0x773a('0x38')],qs[_0x773a('0x3c')](_0x4a9c0c[_0x773a('0x39')][_0x773a('0x3c')]));_0x325569['attributes']=_0x325569[_0x773a('0x3d')]['length']?_0x325569[_0x773a('0x3d')]:_0x53631e[_0x773a('0x38')];if(_0x4a9c0c[_0x773a('0x39')][_0x773a('0x47')]){_0x325569['include']=[{'all':!![]}];}_0x325569=_[_0x773a('0x44')]({},_0x325569,_0x4a9c0c[_0x773a('0x46')]);return db[_0x773a('0x34')]['find'](_0x325569)[_0x773a('0x29')](handleEntityNotFound(_0x2628cf,null))[_0x773a('0x29')](respondWithResult(_0x2628cf,null))['catch'](handleError(_0x2628cf,null));};exports[_0x773a('0x4e')]=function(_0x5a5dab,_0x430989){return db[_0x773a('0x34')][_0x773a('0x4e')](_0x5a5dab[_0x773a('0x4f')],{})[_0x773a('0x29')](function(_0x2aeabe){var _0x112fef=_0x5a5dab[_0x773a('0x50')][_0x773a('0x2b')]({'plain':!![]});if(!_0x112fef)throw new Error(_0x773a('0x51'));if(_0x112fef[_0x773a('0x52')]===_0x773a('0x50')){var _0x49eef6=_0x2aeabe[_0x773a('0x2b')]({'plain':!![]});var _0x3243a5='WhatsappQueues';return db[_0x773a('0x53')][_0x773a('0x54')]({'where':{'name':_0x3243a5,'userProfileId':_0x112fef[_0x773a('0x55')]},'raw':!![]})[_0x773a('0x29')](function(_0x48a9e9){if(_0x48a9e9&&_0x48a9e9[_0x773a('0x56')]===0x0){return db[_0x773a('0x2d')][_0x773a('0x4e')]({'name':_0x49eef6['name'],'resourceId':_0x49eef6['id'],'type':_0x48a9e9[_0x773a('0x30')],'sectionId':_0x48a9e9['id']},{})[_0x773a('0x29')](function(){return _0x2aeabe;});}else{return _0x2aeabe;}})['catch'](function(_0x162069){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x162069);throw _0x162069;});}return _0x2aeabe;})[_0x773a('0x29')](respondWithResult(_0x430989,0xc9))[_0x773a('0x49')](handleError(_0x430989,null));};exports['update']=function(_0x3c761d,_0x186d06){if(_0x3c761d[_0x773a('0x4f')]['id']){delete _0x3c761d['body']['id'];}return db['WhatsappQueue'][_0x773a('0x54')]({'where':{'id':_0x3c761d[_0x773a('0x4b')]['id']}})[_0x773a('0x29')](handleEntityNotFound(_0x186d06,null))['then'](saveUpdates(_0x3c761d[_0x773a('0x4f')],null))['then'](respondWithResult(_0x186d06,null))[_0x773a('0x49')](handleError(_0x186d06,null));};exports[_0x773a('0x2a')]=function(_0x30c485,_0x2b815e){return db[_0x773a('0x34')][_0x773a('0x54')]({'where':{'id':_0x30c485[_0x773a('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2b815e,null))[_0x773a('0x29')](removeEntity(_0x2b815e,null))['catch'](handleError(_0x2b815e,null));};exports['describe']=function(_0x5577df,_0x89477f){return db['WhatsappQueue'][_0x773a('0x57')]()[_0x773a('0x29')](respondWithResult(_0x89477f,null))[_0x773a('0x49')](handleError(_0x89477f,null));};exports[_0x773a('0x58')]=function(_0x54352b,_0x504115,_0x52e3cb){var _0xef960={'raw':!![],'where':{}},_0x524ed7={},_0x378a0b;return db['WhatsappQueue'][_0x773a('0x59')]({'where':{'id':_0x54352b[_0x773a('0x4b')]['id']}})[_0x773a('0x29')](handleEntityNotFound(_0x504115,null))[_0x773a('0x29')](function(_0x56909b){if(_0x56909b){_0x378a0b=_0x56909b[_0x773a('0x2b')]({'plain':!![]});_0x524ed7['model']=_[_0x773a('0x3a')](db['UserWhatsappQueue']['rawAttributes']);_0x524ed7['query']=_['keys'](_0x54352b[_0x773a('0x39')]);_0x524ed7[_0x773a('0x3b')]=_[_0x773a('0x4d')](_0x524ed7['model'],_0x524ed7[_0x773a('0x39')]);_0xef960['attributes']=_[_0x773a('0x4d')](_0x524ed7['model'],qs[_0x773a('0x3c')](_0x54352b[_0x773a('0x39')][_0x773a('0x3c')]));_0xef960[_0x773a('0x3d')]=_0xef960[_0x773a('0x3d')][_0x773a('0x3e')]?_0xef960[_0x773a('0x3d')]:_0x524ed7[_0x773a('0x38')];if(!_0x54352b[_0x773a('0x39')]['hasOwnProperty']('nolimit')){_0xef960[_0x773a('0x21')]=qs['limit'](_0x54352b[_0x773a('0x39')]['limit']);_0xef960[_0x773a('0x23')]=qs[_0x773a('0x23')](_0x54352b[_0x773a('0x39')][_0x773a('0x23')]);}_0xef960['order']=qs[_0x773a('0x40')](_0x54352b[_0x773a('0x39')]['sort']);_0xef960[_0x773a('0x41')]=qs['filters'](_[_0x773a('0x42')](_0x54352b['query'],_0x524ed7[_0x773a('0x3b')]));_0xef960[_0x773a('0x41')][_0x773a('0x5a')]=_0x56909b['id'];if(_0x54352b[_0x773a('0x39')]['filter']){_0xef960[_0x773a('0x41')]=_[_0x773a('0x44')](_0xef960['where'],{'$or':_['map'](_0xef960[_0x773a('0x3d')],function(_0x1d6a12){var _0x5ab6ce={};_0x5ab6ce[_0x1d6a12]={'$like':'%'+_0x54352b['query'][_0x773a('0x43')]+'%'};return _0x5ab6ce;})});}_0xef960=_[_0x773a('0x44')]({},_0xef960,_0x54352b[_0x773a('0x46')]);return db[_0x773a('0x5b')][_0x773a('0x5c')](_0xef960);}})[_0x773a('0x29')](function(_0x590ddc){if(_0x590ddc){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0x590ddc,_0x773a('0x5d')),'role':'agent'},'attributes':['id',_0x773a('0x30'),'whatsappPause',_0x773a('0x5e'),'createdAt']});}})[_0x773a('0x29')](function(_0xe2b7f0){if(_0xe2b7f0){return{'count':_0xe2b7f0['count'],'rows':_[_0x773a('0x33')](_0xe2b7f0[_0x773a('0x5f')],function(_0x357e45){return{'membername':_0x357e45[_0x773a('0x30')],'UserId':_0x357e45['id'],'queue_name':_0x378a0b[_0x773a('0x30')],'WhatsappQueueId':_0x378a0b['id'],'interface':util['format'](_0x773a('0x60'),_0x773a('0x61'),_0x357e45[_0x773a('0x30')]),'penalty':0x0,'paused':_0x357e45['whatsappPause'],'createdAt':_0x357e45[_0x773a('0x62')],'updatedAt':_0x357e45['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x773a('0x29')](respondWithFilteredResult(_0x504115,_0xef960))['catch'](handleError(_0x504115,null));};exports[_0x773a('0x63')]=function(_0x2dd542,_0x4f8945,_0x1cf8e9){var _0x4fcac1={};var _0x5ebf45={};var _0x20c9d4;var _0x2a8e0e;return db[_0x773a('0x34')][_0x773a('0x59')]({'where':{'id':_0x2dd542[_0x773a('0x4b')]['id']}})[_0x773a('0x29')](handleEntityNotFound(_0x4f8945,null))[_0x773a('0x29')](function(_0x3463fd){if(_0x3463fd){_0x20c9d4=_0x3463fd;_0x5ebf45['model']=_['keys'](db[_0x773a('0x64')][_0x773a('0x4c')]);_0x5ebf45[_0x773a('0x39')]=_['keys'](_0x2dd542[_0x773a('0x39')]);_0x5ebf45[_0x773a('0x3b')]=_[_0x773a('0x4d')](_0x5ebf45[_0x773a('0x38')],_0x5ebf45[_0x773a('0x39')]);_0x4fcac1[_0x773a('0x3d')]=_['intersection'](_0x5ebf45[_0x773a('0x38')],qs['fields'](_0x2dd542[_0x773a('0x39')][_0x773a('0x3c')]));_0x4fcac1['attributes']=_0x4fcac1[_0x773a('0x3d')][_0x773a('0x3e')]?_0x4fcac1[_0x773a('0x3d')]:_0x5ebf45[_0x773a('0x38')];_0x4fcac1['order']=qs[_0x773a('0x40')](_0x2dd542[_0x773a('0x39')][_0x773a('0x40')]);_0x4fcac1[_0x773a('0x41')]=qs[_0x773a('0x3b')](_[_0x773a('0x42')](_0x2dd542[_0x773a('0x39')],_0x5ebf45[_0x773a('0x3b')]));if(_0x2dd542[_0x773a('0x39')][_0x773a('0x43')]){_0x4fcac1['where']=_[_0x773a('0x44')](_0x4fcac1[_0x773a('0x41')],{'$or':_[_0x773a('0x33')](_0x4fcac1['attributes'],function(_0x1f765c){var _0x2a4153={};_0x2a4153[_0x1f765c]={'$like':'%'+_0x2dd542[_0x773a('0x39')]['filter']+'%'};return _0x2a4153;})});}_0x4fcac1=_[_0x773a('0x44')]({},_0x4fcac1,_0x2dd542[_0x773a('0x46')]);return _0x20c9d4[_0x773a('0x63')](_0x4fcac1);}})[_0x773a('0x29')](function(_0x175f46){if(_0x175f46){_0x2a8e0e=_0x175f46[_0x773a('0x3e')];if(!_0x2dd542['query'][_0x773a('0x3f')](_0x773a('0x65'))){_0x4fcac1[_0x773a('0x21')]=qs[_0x773a('0x21')](_0x2dd542[_0x773a('0x39')][_0x773a('0x21')]);_0x4fcac1[_0x773a('0x23')]=qs[_0x773a('0x23')](_0x2dd542[_0x773a('0x39')][_0x773a('0x23')]);}return _0x20c9d4[_0x773a('0x63')](_0x4fcac1);}})[_0x773a('0x29')](function(_0x50612f){if(_0x50612f){return _0x50612f?{'count':_0x2a8e0e,'rows':_0x50612f}:null;}})['then'](respondWithResult(_0x4f8945,null))[_0x773a('0x49')](handleError(_0x4f8945,null));};exports[_0x773a('0x66')]=function(_0x51c868,_0x40267e,_0x4a9ee1){var _0x8e82dc=_0x51c868[_0x773a('0x4f')][_0x773a('0x67')];return db['Team'][_0x773a('0x5c')]({'where':{'id':_0x8e82dc},'attributes':['id'],'include':[{'model':db[_0x773a('0x68')],'as':'Agents','attributes':['id',_0x773a('0x30'),_0x773a('0x69'),'voicePause',_0x773a('0x6a')],'raw':!![]}]})[_0x773a('0x29')](function(_0x39c32c){if(_0x39c32c){var _0x25323e=_['flatMap'](_0x39c32c,function(_0x986d2c){var _0x446a7d=_0x986d2c['get']({'plain':!![]});return _0x446a7d[_0x773a('0x6b')];});return db[_0x773a('0x34')]['find']({'where':{'id':_0x51c868['params']['id']}})[_0x773a('0x29')](function(_0x54d807){return db['sequelize'][_0x773a('0x6c')](function(_0x3c5ccb){return _0x54d807[_0x773a('0x66')](_0x8e82dc,{'transaction':_0x3c5ccb})[_0x773a('0x29')](function(){return BPromise['each'](_0x25323e,function(_0x53ea52){return db['UserWhatsappQueue']['findOrCreate']({'where':{'UserId':_0x53ea52['id'],'WhatsappQueueId':_0x51c868[_0x773a('0x4b')]['id']},'transaction':_0x3c5ccb});});})[_0x773a('0x29')](function(){_0x25323e[_0x773a('0x6d')](function(_0x23ca4f){socket[_0x773a('0x6e')](_0x773a('0x6f'),{'UserId':_0x23ca4f['id'],'WhatsappQueueId':_0x54d807['id']});});});});});}})[_0x773a('0x29')](respondWithStatusCode(_0x40267e,null))[_0x773a('0x49')](handleError(_0x40267e,null));};exports['removeTeams']=function(_0x39e689,_0x3d8a57,_0x5400f1){return db['Team'][_0x773a('0x5c')]({'where':{'id':_0x39e689[_0x773a('0x39')][_0x773a('0x67')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x773a('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x773a('0x29')](handleEntityNotFound(_0x3d8a57,null))[_0x773a('0x29')](function(_0x5367bd){var _0x4d477b=_[_0x773a('0x33')](_0x5367bd,'id');var _0x5861fd=[];var _0x1998ff=[];var _0x1c3a2c=squel[_0x773a('0x70')]();_0x1c3a2c[_0x773a('0x71')](_0x773a('0x72'))[_0x773a('0x73')](_0x773a('0x74'),'tq')[_0x773a('0x75')](_0x773a('0x76'),'ut',_0x773a('0x77'))[_0x773a('0x41')]('WhatsappQueueId\x20=\x20?',_0x39e689[_0x773a('0x4b')]['id']);for(var _0x2ab8d2=0x0;_0x2ab8d2<_0x5367bd[_0x773a('0x3e')];_0x2ab8d2+=0x1){let _0x563fbf=_0x5367bd[_0x2ab8d2];for(var _0x4860c7=0x0;_0x4860c7<_0x563fbf[_0x773a('0x6b')][_0x773a('0x3e')];_0x4860c7+=0x1){let _0x305b59=_0x563fbf[_0x773a('0x6b')][_0x4860c7];var _0x329de7=_0x1c3a2c[_0x773a('0x78')]();_0x329de7['where'](_0x773a('0x79'),_0x305b59['id']);_0x1998ff[_0x773a('0x7a')](db[_0x773a('0x7b')][_0x773a('0x39')](_0x329de7[_0x773a('0x7c')](),{'type':db['sequelize']['QueryTypes']['SELECT']})[_0x773a('0x29')](function(_0x760c6b){if(_0x760c6b[_0x773a('0x3e')]===0x1){return _0x305b59['id'];}else{var _0x53f402=_[_0x773a('0x7d')](_[_0x773a('0x33')](_0x760c6b,_0x773a('0x7e')),function(_0xbfcea9){return _[_0x773a('0x7f')](_0x4d477b,_0xbfcea9);});if(_0x53f402){return _0x305b59['id'];}}}));}}return BPromise[_0x773a('0x80')](_0x1998ff)['then'](function(_0x3bdb7c){_0x5861fd=_(_0x5861fd)[_0x773a('0x81')](_0x3bdb7c)[_0x773a('0x82')]()[_0x773a('0x83')]();return db[_0x773a('0x34')][_0x773a('0x54')]({'where':{'id':_0x39e689['params']['id']}})['then'](function(_0x2b418e){return db['sequelize'][_0x773a('0x6c')](function(_0x4faf57){return _0x2b418e[_0x773a('0x84')](_0x39e689[_0x773a('0x39')][_0x773a('0x67')],{'transaction':_0x4faf57})['then'](function(){if(!_[_0x773a('0x85')](_0x5861fd)){return _0x2b418e[_0x773a('0x86')](_0x5861fd,{'transaction':_0x4faf57});}})[_0x773a('0x29')](function(){_0x5861fd['forEach'](function(_0x5e6151){socket[_0x773a('0x6e')](_0x773a('0x87'),{'UserId':_0x5e6151,'WhatsappQueueId':_0x2b418e['id']});});});});});});})[_0x773a('0x29')](respondWithStatusCode(_0x3d8a57,null))[_0x773a('0x49')](handleError(_0x3d8a57,null));};exports[_0x773a('0x88')]=function(_0x114003,_0x103e8d,_0xe2846e){return db[_0x773a('0x34')][_0x773a('0x54')]({'where':{'id':_0x114003[_0x773a('0x4b')]['id']}})[_0x773a('0x29')](handleEntityNotFound(_0x103e8d,null))[_0x773a('0x29')](function(_0x1c070f){if(_0x1c070f){return _0x1c070f[_0x773a('0x88')](_0x114003[_0x773a('0x4f')]['ids'],_[_0x773a('0x89')](_0x114003[_0x773a('0x4f')],['ids','id'])||{})['spread'](function(_0x2647aa){for(var _0x3d1b95=0x0;_0x3d1b95<_0x114003[_0x773a('0x4f')][_0x773a('0x67')][_0x773a('0x3e')];_0x3d1b95+=0x1){socket[_0x773a('0x6e')]('userWhatsappQueue:save',{'UserId':Number(_0x114003[_0x773a('0x4f')][_0x773a('0x67')][_0x3d1b95]),'WhatsappQueueId':Number(_0x114003[_0x773a('0x4b')]['id'])});}return _0x2647aa;});}})[_0x773a('0x29')](respondWithResult(_0x103e8d,null))['catch'](handleError(_0x103e8d,null));};exports['removeAgents']=function(_0x569284,_0x2f81dc,_0x28ba0d){return db['WhatsappQueue'][_0x773a('0x54')]({'where':{'id':_0x569284[_0x773a('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2f81dc,null))['then'](function(_0x3a33b2){if(_0x3a33b2){return _0x3a33b2[_0x773a('0x86')](_0x569284['query'][_0x773a('0x67')])[_0x773a('0x29')](function(){if(_['isArray'](_0x569284['query'][_0x773a('0x67')])){for(var _0x3e6853=0x0;_0x3e6853<_0x569284['query']['ids'][_0x773a('0x3e')];_0x3e6853+=0x1){socket[_0x773a('0x6e')]('userWhatsappQueue:remove',{'UserId':Number(_0x569284[_0x773a('0x39')][_0x773a('0x67')][_0x3e6853]),'WhatsappQueueId':Number(_0x569284[_0x773a('0x4b')]['id'])});}}else{socket[_0x773a('0x6e')]('userWhatsappQueue:remove',{'UserId':Number(_0x569284[_0x773a('0x39')]['ids']),'WhatsappQueueId':Number(_0x569284[_0x773a('0x4b')]['id'])});}});}})[_0x773a('0x29')](respondWithStatusCode(_0x2f81dc,null))[_0x773a('0x49')](handleError(_0x2f81dc,null));};exports[_0x773a('0x8a')]=function(_0x394820,_0x4078e2,_0x12a3d6){var _0x170262={};var _0x44b9ce={};var _0x3d28a9;var _0x566849;return db[_0x773a('0x34')][_0x773a('0x59')]({'where':{'id':_0x394820[_0x773a('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4078e2,null))[_0x773a('0x29')](function(_0x25c7f4){if(_0x25c7f4){_0x3d28a9=_0x25c7f4;_0x44b9ce[_0x773a('0x38')]=_['keys'](db[_0x773a('0x68')][_0x773a('0x4c')]);_0x44b9ce[_0x773a('0x39')]=_[_0x773a('0x3a')](_0x394820[_0x773a('0x39')]);_0x44b9ce[_0x773a('0x3b')]=_[_0x773a('0x4d')](_0x44b9ce[_0x773a('0x38')],_0x44b9ce[_0x773a('0x39')]);_0x170262['attributes']=_[_0x773a('0x4d')](_0x44b9ce[_0x773a('0x38')],qs['fields'](_0x394820[_0x773a('0x39')][_0x773a('0x3c')]));_0x170262[_0x773a('0x3d')]=_0x170262['attributes']['length']?_0x170262[_0x773a('0x3d')]:_0x44b9ce[_0x773a('0x38')];_0x170262[_0x773a('0x8b')]=qs[_0x773a('0x40')](_0x394820[_0x773a('0x39')]['sort']);_0x170262[_0x773a('0x41')]=qs[_0x773a('0x3b')](_[_0x773a('0x42')](_0x394820[_0x773a('0x39')],_0x44b9ce['filters']));if(_0x394820[_0x773a('0x39')][_0x773a('0x43')]){_0x170262[_0x773a('0x41')]=_[_0x773a('0x44')](_0x170262['where'],{'$or':_['map'](_0x170262[_0x773a('0x3d')],function(_0x1e2447){var _0x2f8299={};_0x2f8299[_0x1e2447]={'$like':'%'+_0x394820[_0x773a('0x39')][_0x773a('0x43')]+'%'};return _0x2f8299;})});}_0x170262=_[_0x773a('0x44')]({},_0x170262,_0x394820[_0x773a('0x46')]);return _0x3d28a9['getAgents'](_0x170262);}})['then'](function(_0xbc9e04){if(_0xbc9e04){_0x566849=_0xbc9e04[_0x773a('0x3e')];if(!_0x394820[_0x773a('0x39')][_0x773a('0x3f')]('nolimit')){_0x170262[_0x773a('0x21')]=qs[_0x773a('0x21')](_0x394820[_0x773a('0x39')][_0x773a('0x21')]);_0x170262[_0x773a('0x23')]=qs[_0x773a('0x23')](_0x394820[_0x773a('0x39')][_0x773a('0x23')]);}return _0x3d28a9[_0x773a('0x8a')](_0x170262);}})[_0x773a('0x29')](function(_0x5c3352){if(_0x5c3352){return _0x5c3352?{'count':_0x566849,'rows':_0x5c3352}:null;}})[_0x773a('0x29')](respondWithResult(_0x4078e2,null))['catch'](handleError(_0x4078e2,null));}; \ No newline at end of file +var _0x6bfb=['WhatsappQueues','UserProfileResource','error','stack','name','send','index','map','WhatsappQueue','rawAttributes','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','keys','intersection','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserWhatsappQueue','WhatsappQueueId','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','%s/%s','createdAt','Team','getTeams','addTeams','Agents','online','sequelize','transaction','each','forEach','emit','userWhatsappQueue:save','removeTeams','ids','field','tq.TeamId','from','user_has_teams','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','compact','isEmpty','removeAgents','addAgents','isArray','userWhatsappQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','./whatsappQueue.socket','register','status','end','json','limit','undefined','count','offset','Content-Range','apply','save','update','destroy','then'];(function(_0x5759d4,_0x2856e8){var _0x25721e=function(_0xadb567){while(--_0xadb567){_0x5759d4['push'](_0x5759d4['shift']());}};_0x25721e(++_0x2856e8);}(_0x6bfb,0xde));var _0xb6bf=function(_0x97192b,_0x23eddf){_0x97192b=_0x97192b-0x0;var _0x2ad8ea=_0x6bfb[_0x97192b];return _0x2ad8ea;};'use strict';var emlformat=require(_0xb6bf('0x0'));var rimraf=require(_0xb6bf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb6bf('0x2'));var rp=require('request-promise');var moment=require(_0xb6bf('0x3'));var BPromise=require(_0xb6bf('0x4'));var Mustache=require(_0xb6bf('0x5'));var util=require('util');var path=require(_0xb6bf('0x6'));var sox=require(_0xb6bf('0x7'));var csv=require(_0xb6bf('0x8'));var ejs=require(_0xb6bf('0x9'));var fs=require('fs');var fs_extra=require(_0xb6bf('0xa'));var _=require(_0xb6bf('0xb'));var squel=require('squel');var crypto=require(_0xb6bf('0xc'));var jsforce=require(_0xb6bf('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb6bf('0x8'));var querystring=require(_0xb6bf('0xe'));var Papa=require('papaparse');var Redis=require(_0xb6bf('0xf'));var authService=require(_0xb6bf('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb6bf('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xb6bf('0x12'));var config=require(_0xb6bf('0x13'));var licenseUtil=require(_0xb6bf('0x14'));var db=require('../../mysqldb')['db'];config[_0xb6bf('0x15')]=_[_0xb6bf('0x16')](config[_0xb6bf('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb6bf('0x15')]));require(_0xb6bf('0x17'))[_0xb6bf('0x18')](socket);function respondWithStatusCode(_0x4d3f09,_0x335b68){_0x335b68=_0x335b68||0xcc;return function(_0x1a61e0){if(_0x1a61e0){return _0x4d3f09['sendStatus'](_0x335b68);}return _0x4d3f09[_0xb6bf('0x19')](_0x335b68)[_0xb6bf('0x1a')]();};}function respondWithResult(_0x478004,_0x206380){_0x206380=_0x206380||0xc8;return function(_0x19b1cd){if(_0x19b1cd){return _0x478004['status'](_0x206380)[_0xb6bf('0x1b')](_0x19b1cd);}};}function respondWithFilteredResult(_0x181fa5,_0x35d7ef){return function(_0x226a09){if(_0x226a09){var _0x499cf8=typeof _0x35d7ef['offset']==='undefined'&&typeof _0x35d7ef[_0xb6bf('0x1c')]===_0xb6bf('0x1d');var _0x32afad=_0x226a09[_0xb6bf('0x1e')];var _0xd37761=_0x499cf8?0x0:_0x35d7ef['offset'];var _0xf3eeaf=_0x499cf8?_0x226a09[_0xb6bf('0x1e')]:_0x35d7ef[_0xb6bf('0x1f')]+_0x35d7ef[_0xb6bf('0x1c')];var _0x38dd55;if(_0xf3eeaf>=_0x32afad){_0xf3eeaf=_0x32afad;_0x38dd55=0xc8;}else{_0x38dd55=0xce;}_0x181fa5[_0xb6bf('0x19')](_0x38dd55);return _0x181fa5['set'](_0xb6bf('0x20'),_0xd37761+'-'+_0xf3eeaf+'/'+_0x32afad)[_0xb6bf('0x1b')](_0x226a09);}return null;};}function patchUpdates(_0x282b24){return function(_0x4bdcec){try{jsonpatch[_0xb6bf('0x21')](_0x4bdcec,_0x282b24,!![]);}catch(_0xac8ca9){return BPromise['reject'](_0xac8ca9);}return _0x4bdcec[_0xb6bf('0x22')]();};}function saveUpdates(_0x4eff70,_0x4c3cc0){return function(_0x49dbc0){if(_0x49dbc0){return _0x49dbc0[_0xb6bf('0x23')](_0x4eff70)['then'](function(_0x127a77){return _0x127a77;});}return null;};}function removeEntity(_0x4c8886,_0x3ab756){return function(_0x3b6c5c){if(_0x3b6c5c){return _0x3b6c5c[_0xb6bf('0x24')]()[_0xb6bf('0x25')](function(){var _0x2722bd=_0x3b6c5c['get']({'plain':!![]});var _0x5d95b4=_0xb6bf('0x26');return db[_0xb6bf('0x27')][_0xb6bf('0x24')]({'where':{'type':_0x5d95b4,'resourceId':_0x2722bd['id']}})[_0xb6bf('0x25')](function(){return _0x3b6c5c;});})[_0xb6bf('0x25')](function(){_0x4c8886['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xa18455,_0x4bfee3){return function(_0x547f07){if(!_0x547f07){_0xa18455['sendStatus'](0x194);}return _0x547f07;};}function handleError(_0x8fc077,_0x1d6079){_0x1d6079=_0x1d6079||0x1f4;return function(_0x1f8aaa){logger[_0xb6bf('0x28')](_0x1f8aaa[_0xb6bf('0x29')]);if(_0x1f8aaa[_0xb6bf('0x2a')]){delete _0x1f8aaa[_0xb6bf('0x2a')];}_0x8fc077['status'](_0x1d6079)[_0xb6bf('0x2b')](_0x1f8aaa);};}exports[_0xb6bf('0x2c')]=function(_0x5ad5e8,_0x469fea){var _0x1879b1={},_0x28739f={},_0xed23e0={'count':0x0,'rows':[]};var _0x36e5a9=_[_0xb6bf('0x2d')](db[_0xb6bf('0x2e')][_0xb6bf('0x2f')],function(_0x2d9154){return{'name':_0x2d9154['fieldName'],'type':_0x2d9154[_0xb6bf('0x30')][_0xb6bf('0x31')]};});_0x28739f[_0xb6bf('0x32')]=_['map'](_0x36e5a9,_0xb6bf('0x2a'));_0x28739f[_0xb6bf('0x33')]=_['keys'](_0x5ad5e8['query']);_0x28739f[_0xb6bf('0x34')]=_['intersection'](_0x28739f[_0xb6bf('0x32')],_0x28739f[_0xb6bf('0x33')]);_0x1879b1[_0xb6bf('0x35')]=_['intersection'](_0x28739f[_0xb6bf('0x32')],qs[_0xb6bf('0x36')](_0x5ad5e8['query']['fields']));_0x1879b1[_0xb6bf('0x35')]=_0x1879b1[_0xb6bf('0x35')][_0xb6bf('0x37')]?_0x1879b1[_0xb6bf('0x35')]:_0x28739f[_0xb6bf('0x32')];if(!_0x5ad5e8[_0xb6bf('0x33')][_0xb6bf('0x38')](_0xb6bf('0x39'))){_0x1879b1[_0xb6bf('0x1c')]=qs[_0xb6bf('0x1c')](_0x5ad5e8[_0xb6bf('0x33')][_0xb6bf('0x1c')]);_0x1879b1[_0xb6bf('0x1f')]=qs[_0xb6bf('0x1f')](_0x5ad5e8[_0xb6bf('0x33')][_0xb6bf('0x1f')]);}_0x1879b1[_0xb6bf('0x3a')]=qs[_0xb6bf('0x3b')](_0x5ad5e8[_0xb6bf('0x33')][_0xb6bf('0x3b')]);_0x1879b1[_0xb6bf('0x3c')]=qs['filters'](_[_0xb6bf('0x3d')](_0x5ad5e8[_0xb6bf('0x33')],_0x28739f[_0xb6bf('0x34')]),_0x36e5a9);if(_0x5ad5e8['query'][_0xb6bf('0x3e')]){_0x1879b1['where']=_['merge'](_0x1879b1[_0xb6bf('0x3c')],{'$or':_[_0xb6bf('0x2d')](_0x36e5a9,function(_0x1fd7ce){if(_0x1fd7ce[_0xb6bf('0x30')]!=='VIRTUAL'){var _0x78738e={};_0x78738e[_0x1fd7ce[_0xb6bf('0x2a')]]={'$like':'%'+_0x5ad5e8['query'][_0xb6bf('0x3e')]+'%'};return _0x78738e;}})});}_0x1879b1=_[_0xb6bf('0x3f')]({},_0x1879b1,_0x5ad5e8[_0xb6bf('0x40')]);var _0x5a45e6={'where':_0x1879b1[_0xb6bf('0x3c')]};return db[_0xb6bf('0x2e')]['count'](_0x5a45e6)['then'](function(_0x1e5022){_0xed23e0[_0xb6bf('0x1e')]=_0x1e5022;if(_0x5ad5e8[_0xb6bf('0x33')][_0xb6bf('0x41')]){_0x1879b1[_0xb6bf('0x42')]=[{'all':!![]}];}return db[_0xb6bf('0x2e')][_0xb6bf('0x43')](_0x1879b1);})[_0xb6bf('0x25')](function(_0x292245){_0xed23e0[_0xb6bf('0x44')]=_0x292245;return _0xed23e0;})[_0xb6bf('0x25')](respondWithFilteredResult(_0x469fea,_0x1879b1))[_0xb6bf('0x45')](handleError(_0x469fea,null));};exports[_0xb6bf('0x46')]=function(_0x1ab38e,_0x3e4236){var _0x10b184={'raw':!![],'where':{'id':_0x1ab38e['params']['id']}},_0x1ec0ad={};_0x1ec0ad[_0xb6bf('0x32')]=_[_0xb6bf('0x47')](db[_0xb6bf('0x2e')][_0xb6bf('0x2f')]);_0x1ec0ad[_0xb6bf('0x33')]=_['keys'](_0x1ab38e[_0xb6bf('0x33')]);_0x1ec0ad[_0xb6bf('0x34')]=_[_0xb6bf('0x48')](_0x1ec0ad[_0xb6bf('0x32')],_0x1ec0ad['query']);_0x10b184[_0xb6bf('0x35')]=_[_0xb6bf('0x48')](_0x1ec0ad['model'],qs[_0xb6bf('0x36')](_0x1ab38e['query']['fields']));_0x10b184[_0xb6bf('0x35')]=_0x10b184['attributes'][_0xb6bf('0x37')]?_0x10b184[_0xb6bf('0x35')]:_0x1ec0ad[_0xb6bf('0x32')];if(_0x1ab38e[_0xb6bf('0x33')][_0xb6bf('0x41')]){_0x10b184[_0xb6bf('0x42')]=[{'all':!![]}];}_0x10b184=_[_0xb6bf('0x3f')]({},_0x10b184,_0x1ab38e[_0xb6bf('0x40')]);return db[_0xb6bf('0x2e')]['find'](_0x10b184)[_0xb6bf('0x25')](handleEntityNotFound(_0x3e4236,null))['then'](respondWithResult(_0x3e4236,null))[_0xb6bf('0x45')](handleError(_0x3e4236,null));};exports['create']=function(_0x26c02d,_0x29dee2){return db[_0xb6bf('0x2e')][_0xb6bf('0x49')](_0x26c02d[_0xb6bf('0x4a')],{})[_0xb6bf('0x25')](function(_0x48d5ce){var _0x37b5aa=_0x26c02d[_0xb6bf('0x4b')]['get']({'plain':!![]});if(!_0x37b5aa)throw new Error(_0xb6bf('0x4c'));if(_0x37b5aa[_0xb6bf('0x4d')]===_0xb6bf('0x4b')){var _0x41e17e=_0x48d5ce[_0xb6bf('0x4e')]({'plain':!![]});var _0x57cf71=_0xb6bf('0x26');return db['UserProfileSection'][_0xb6bf('0x4f')]({'where':{'name':_0x57cf71,'userProfileId':_0x37b5aa[_0xb6bf('0x50')]},'raw':!![]})['then'](function(_0x196b4d){if(_0x196b4d&&_0x196b4d['autoAssociation']===0x0){return db[_0xb6bf('0x27')]['create']({'name':_0x41e17e[_0xb6bf('0x2a')],'resourceId':_0x41e17e['id'],'type':_0x196b4d[_0xb6bf('0x2a')],'sectionId':_0x196b4d['id']},{})[_0xb6bf('0x25')](function(){return _0x48d5ce;});}else{return _0x48d5ce;}})[_0xb6bf('0x45')](function(_0x307e3e){logger['error'](_0xb6bf('0x51'),_0x307e3e);throw _0x307e3e;});}return _0x48d5ce;})['then'](respondWithResult(_0x29dee2,0xc9))[_0xb6bf('0x45')](handleError(_0x29dee2,null));};exports[_0xb6bf('0x23')]=function(_0x29f061,_0x6467fc){if(_0x29f061[_0xb6bf('0x4a')]['id']){delete _0x29f061[_0xb6bf('0x4a')]['id'];}return db[_0xb6bf('0x2e')][_0xb6bf('0x4f')]({'where':{'id':_0x29f061[_0xb6bf('0x52')]['id']}})[_0xb6bf('0x25')](handleEntityNotFound(_0x6467fc,null))[_0xb6bf('0x25')](saveUpdates(_0x29f061[_0xb6bf('0x4a')],null))['then'](respondWithResult(_0x6467fc,null))[_0xb6bf('0x45')](handleError(_0x6467fc,null));};exports[_0xb6bf('0x24')]=function(_0x1035a2,_0x3b0f79){return db[_0xb6bf('0x2e')]['find']({'where':{'id':_0x1035a2[_0xb6bf('0x52')]['id']}})[_0xb6bf('0x25')](handleEntityNotFound(_0x3b0f79,null))[_0xb6bf('0x25')](removeEntity(_0x3b0f79,null))[_0xb6bf('0x45')](handleError(_0x3b0f79,null));};exports[_0xb6bf('0x53')]=function(_0x1fd23e,_0x1b3de3){return db[_0xb6bf('0x2e')][_0xb6bf('0x53')]()[_0xb6bf('0x25')](respondWithResult(_0x1b3de3,null))[_0xb6bf('0x45')](handleError(_0x1b3de3,null));};exports[_0xb6bf('0x54')]=function(_0x2cb282,_0x41bcf5,_0x3fdf47){var _0x549f50={'raw':!![],'where':{}},_0x4c852c={},_0x4c9c6a;return db[_0xb6bf('0x2e')][_0xb6bf('0x55')]({'where':{'id':_0x2cb282[_0xb6bf('0x52')]['id']}})[_0xb6bf('0x25')](handleEntityNotFound(_0x41bcf5,null))[_0xb6bf('0x25')](function(_0x48f028){if(_0x48f028){_0x4c9c6a=_0x48f028[_0xb6bf('0x4e')]({'plain':!![]});_0x4c852c[_0xb6bf('0x32')]=_[_0xb6bf('0x47')](db[_0xb6bf('0x56')][_0xb6bf('0x2f')]);_0x4c852c[_0xb6bf('0x33')]=_[_0xb6bf('0x47')](_0x2cb282['query']);_0x4c852c['filters']=_[_0xb6bf('0x48')](_0x4c852c[_0xb6bf('0x32')],_0x4c852c[_0xb6bf('0x33')]);_0x549f50[_0xb6bf('0x35')]=_[_0xb6bf('0x48')](_0x4c852c[_0xb6bf('0x32')],qs[_0xb6bf('0x36')](_0x2cb282['query'][_0xb6bf('0x36')]));_0x549f50['attributes']=_0x549f50['attributes'][_0xb6bf('0x37')]?_0x549f50['attributes']:_0x4c852c[_0xb6bf('0x32')];if(!_0x2cb282[_0xb6bf('0x33')][_0xb6bf('0x38')]('nolimit')){_0x549f50[_0xb6bf('0x1c')]=qs['limit'](_0x2cb282[_0xb6bf('0x33')][_0xb6bf('0x1c')]);_0x549f50[_0xb6bf('0x1f')]=qs['offset'](_0x2cb282[_0xb6bf('0x33')]['offset']);}_0x549f50['order']=qs[_0xb6bf('0x3b')](_0x2cb282[_0xb6bf('0x33')][_0xb6bf('0x3b')]);_0x549f50[_0xb6bf('0x3c')]=qs[_0xb6bf('0x34')](_[_0xb6bf('0x3d')](_0x2cb282[_0xb6bf('0x33')],_0x4c852c[_0xb6bf('0x34')]));_0x549f50[_0xb6bf('0x3c')][_0xb6bf('0x57')]=_0x48f028['id'];if(_0x2cb282[_0xb6bf('0x33')][_0xb6bf('0x3e')]){_0x549f50[_0xb6bf('0x3c')]=_[_0xb6bf('0x3f')](_0x549f50[_0xb6bf('0x3c')],{'$or':_[_0xb6bf('0x2d')](_0x549f50['attributes'],function(_0x106460){var _0x176c89={};_0x176c89[_0x106460]={'$like':'%'+_0x2cb282['query'][_0xb6bf('0x3e')]+'%'};return _0x176c89;})});}_0x549f50=_[_0xb6bf('0x3f')]({},_0x549f50,_0x2cb282[_0xb6bf('0x40')]);return db[_0xb6bf('0x56')][_0xb6bf('0x43')](_0x549f50);}})[_0xb6bf('0x25')](function(_0x4cd9ed){if(_0x4cd9ed){return db[_0xb6bf('0x58')][_0xb6bf('0x59')]({'where':{'id':_[_0xb6bf('0x2d')](_0x4cd9ed,_0xb6bf('0x5a')),'role':_0xb6bf('0x5b')},'attributes':['id',_0xb6bf('0x2a'),_0xb6bf('0x5c'),_0xb6bf('0x5d'),'createdAt']});}})[_0xb6bf('0x25')](function(_0x26254b){if(_0x26254b){return{'count':_0x26254b['count'],'rows':_[_0xb6bf('0x2d')](_0x26254b['rows'],function(_0x292ab2){return{'membername':_0x292ab2[_0xb6bf('0x2a')],'UserId':_0x292ab2['id'],'queue_name':_0x4c9c6a[_0xb6bf('0x2a')],'WhatsappQueueId':_0x4c9c6a['id'],'interface':util['format'](_0xb6bf('0x5e'),'SIP',_0x292ab2[_0xb6bf('0x2a')]),'penalty':0x0,'paused':_0x292ab2[_0xb6bf('0x5c')],'createdAt':_0x292ab2[_0xb6bf('0x5f')],'updatedAt':_0x292ab2[_0xb6bf('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb6bf('0x25')](respondWithFilteredResult(_0x41bcf5,_0x549f50))[_0xb6bf('0x45')](handleError(_0x41bcf5,null));};exports['getTeams']=function(_0x11e1a5,_0x495c47,_0x16f0a2){var _0x1a4f50={};var _0x3001a5={};var _0x5ca938;var _0x55bb2d;return db[_0xb6bf('0x2e')][_0xb6bf('0x55')]({'where':{'id':_0x11e1a5['params']['id']}})[_0xb6bf('0x25')](handleEntityNotFound(_0x495c47,null))[_0xb6bf('0x25')](function(_0xeda13f){if(_0xeda13f){_0x5ca938=_0xeda13f;_0x3001a5['model']=_[_0xb6bf('0x47')](db[_0xb6bf('0x60')][_0xb6bf('0x2f')]);_0x3001a5[_0xb6bf('0x33')]=_[_0xb6bf('0x47')](_0x11e1a5[_0xb6bf('0x33')]);_0x3001a5['filters']=_[_0xb6bf('0x48')](_0x3001a5[_0xb6bf('0x32')],_0x3001a5[_0xb6bf('0x33')]);_0x1a4f50[_0xb6bf('0x35')]=_[_0xb6bf('0x48')](_0x3001a5[_0xb6bf('0x32')],qs['fields'](_0x11e1a5[_0xb6bf('0x33')][_0xb6bf('0x36')]));_0x1a4f50[_0xb6bf('0x35')]=_0x1a4f50['attributes']['length']?_0x1a4f50[_0xb6bf('0x35')]:_0x3001a5['model'];_0x1a4f50[_0xb6bf('0x3a')]=qs[_0xb6bf('0x3b')](_0x11e1a5[_0xb6bf('0x33')][_0xb6bf('0x3b')]);_0x1a4f50['where']=qs['filters'](_[_0xb6bf('0x3d')](_0x11e1a5['query'],_0x3001a5['filters']));if(_0x11e1a5[_0xb6bf('0x33')]['filter']){_0x1a4f50[_0xb6bf('0x3c')]=_['merge'](_0x1a4f50['where'],{'$or':_[_0xb6bf('0x2d')](_0x1a4f50[_0xb6bf('0x35')],function(_0x3e8966){var _0x1fe539={};_0x1fe539[_0x3e8966]={'$like':'%'+_0x11e1a5[_0xb6bf('0x33')]['filter']+'%'};return _0x1fe539;})});}_0x1a4f50=_[_0xb6bf('0x3f')]({},_0x1a4f50,_0x11e1a5[_0xb6bf('0x40')]);return _0x5ca938[_0xb6bf('0x61')](_0x1a4f50);}})[_0xb6bf('0x25')](function(_0x28cbeb){if(_0x28cbeb){_0x55bb2d=_0x28cbeb['length'];if(!_0x11e1a5['query'][_0xb6bf('0x38')]('nolimit')){_0x1a4f50[_0xb6bf('0x1c')]=qs[_0xb6bf('0x1c')](_0x11e1a5[_0xb6bf('0x33')]['limit']);_0x1a4f50[_0xb6bf('0x1f')]=qs['offset'](_0x11e1a5[_0xb6bf('0x33')][_0xb6bf('0x1f')]);}return _0x5ca938['getTeams'](_0x1a4f50);}})[_0xb6bf('0x25')](function(_0x3c7d8a){if(_0x3c7d8a){return _0x3c7d8a?{'count':_0x55bb2d,'rows':_0x3c7d8a}:null;}})[_0xb6bf('0x25')](respondWithResult(_0x495c47,null))[_0xb6bf('0x45')](handleError(_0x495c47,null));};exports[_0xb6bf('0x62')]=function(_0x1390da,_0x3bc2a5,_0x183ac6){var _0x44da99=_0x1390da['body']['ids'];return db[_0xb6bf('0x60')][_0xb6bf('0x43')]({'where':{'id':_0x44da99},'attributes':['id'],'include':[{'model':db['User'],'as':_0xb6bf('0x63'),'attributes':['id','name',_0xb6bf('0x64'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x3ba231){if(_0x3ba231){var _0x4582a2=_['flatMap'](_0x3ba231,function(_0x4c2e2e){var _0x323e4a=_0x4c2e2e[_0xb6bf('0x4e')]({'plain':!![]});return _0x323e4a[_0xb6bf('0x63')];});return db[_0xb6bf('0x2e')][_0xb6bf('0x4f')]({'where':{'id':_0x1390da[_0xb6bf('0x52')]['id']}})[_0xb6bf('0x25')](function(_0x3e0b29){return db[_0xb6bf('0x65')][_0xb6bf('0x66')](function(_0x43fc2f){return _0x3e0b29['addTeams'](_0x44da99,{'transaction':_0x43fc2f})[_0xb6bf('0x25')](function(){return BPromise[_0xb6bf('0x67')](_0x4582a2,function(_0x1a3b49){return db['UserWhatsappQueue']['findOrCreate']({'where':{'UserId':_0x1a3b49['id'],'WhatsappQueueId':_0x1390da[_0xb6bf('0x52')]['id']},'transaction':_0x43fc2f});});})[_0xb6bf('0x25')](function(){_0x4582a2[_0xb6bf('0x68')](function(_0x4f5ede){socket[_0xb6bf('0x69')](_0xb6bf('0x6a'),{'UserId':_0x4f5ede['id'],'WhatsappQueueId':_0x3e0b29['id']});});});});});}})[_0xb6bf('0x25')](respondWithStatusCode(_0x3bc2a5,null))[_0xb6bf('0x45')](handleError(_0x3bc2a5,null));};exports[_0xb6bf('0x6b')]=function(_0x252863,_0x261185,_0x3c0905){return db[_0xb6bf('0x60')][_0xb6bf('0x43')]({'where':{'id':_0x252863[_0xb6bf('0x33')][_0xb6bf('0x6c')]},'attributes':['id'],'include':[{'model':db[_0xb6bf('0x58')],'as':_0xb6bf('0x63'),'attributes':['id'],'raw':!![]}]})[_0xb6bf('0x25')](handleEntityNotFound(_0x261185,null))[_0xb6bf('0x25')](function(_0x5c5d60){var _0x26cba5=_['map'](_0x5c5d60,'id');var _0x1bd721=[];var _0x58bf87=[];var _0x487b77=squel['select']();_0x487b77[_0xb6bf('0x6d')](_0xb6bf('0x6e'))[_0xb6bf('0x6f')]('team_has_whatsapp_queues','tq')['join'](_0xb6bf('0x70'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xb6bf('0x71'),_0x252863[_0xb6bf('0x52')]['id']);for(var _0x17759d=0x0;_0x17759d<_0x5c5d60['length'];_0x17759d+=0x1){let _0x336ec4=_0x5c5d60[_0x17759d];for(var _0x17268f=0x0;_0x17268f<_0x336ec4[_0xb6bf('0x63')][_0xb6bf('0x37')];_0x17268f+=0x1){let _0x4db2c0=_0x336ec4[_0xb6bf('0x63')][_0x17268f];var _0x2056eb=_0x487b77[_0xb6bf('0x72')]();_0x2056eb['where'](_0xb6bf('0x73'),_0x4db2c0['id']);_0x58bf87[_0xb6bf('0x74')](db[_0xb6bf('0x65')]['query'](_0x2056eb['toString'](),{'type':db[_0xb6bf('0x65')][_0xb6bf('0x75')][_0xb6bf('0x76')]})[_0xb6bf('0x25')](function(_0x8ec390){if(_0x8ec390['length']===0x1){return _0x4db2c0['id'];}else{var _0x1118b8=_[_0xb6bf('0x77')](_[_0xb6bf('0x2d')](_0x8ec390,_0xb6bf('0x78')),function(_0x4f6bc4){return _[_0xb6bf('0x79')](_0x26cba5,_0x4f6bc4);});if(_0x1118b8){return _0x4db2c0['id'];}}}));}}return BPromise[_0xb6bf('0x7a')](_0x58bf87)[_0xb6bf('0x25')](function(_0x106173){_0x1bd721=_(_0x1bd721)['union'](_0x106173)[_0xb6bf('0x7b')]()['value']();return db[_0xb6bf('0x2e')][_0xb6bf('0x4f')]({'where':{'id':_0x252863[_0xb6bf('0x52')]['id']}})[_0xb6bf('0x25')](function(_0x7b4e8){return db['sequelize']['transaction'](function(_0xfc7661){return _0x7b4e8[_0xb6bf('0x6b')](_0x252863[_0xb6bf('0x33')][_0xb6bf('0x6c')],{'transaction':_0xfc7661})[_0xb6bf('0x25')](function(){if(!_[_0xb6bf('0x7c')](_0x1bd721)){return _0x7b4e8[_0xb6bf('0x7d')](_0x1bd721,{'transaction':_0xfc7661});}})['then'](function(){_0x1bd721[_0xb6bf('0x68')](function(_0x350852){socket['emit']('userWhatsappQueue:remove',{'UserId':_0x350852,'WhatsappQueueId':_0x7b4e8['id']});});});});});});})[_0xb6bf('0x25')](respondWithStatusCode(_0x261185,null))[_0xb6bf('0x45')](handleError(_0x261185,null));};exports[_0xb6bf('0x7e')]=function(_0x129b35,_0x2ce732,_0x2d6701){return db[_0xb6bf('0x2e')][_0xb6bf('0x4f')]({'where':{'id':_0x129b35[_0xb6bf('0x52')]['id']}})['then'](handleEntityNotFound(_0x2ce732,null))['then'](function(_0x5e077f){if(_0x5e077f){return _0x5e077f[_0xb6bf('0x7e')](_0x129b35[_0xb6bf('0x4a')][_0xb6bf('0x6c')],_['omit'](_0x129b35[_0xb6bf('0x4a')],[_0xb6bf('0x6c'),'id'])||{})['spread'](function(_0x20c535){for(var _0x494a40=0x0;_0x494a40<_0x129b35['body'][_0xb6bf('0x6c')]['length'];_0x494a40+=0x1){socket['emit'](_0xb6bf('0x6a'),{'UserId':Number(_0x129b35[_0xb6bf('0x4a')][_0xb6bf('0x6c')][_0x494a40]),'WhatsappQueueId':Number(_0x129b35[_0xb6bf('0x52')]['id'])});}return _0x20c535;});}})[_0xb6bf('0x25')](respondWithResult(_0x2ce732,null))[_0xb6bf('0x45')](handleError(_0x2ce732,null));};exports['removeAgents']=function(_0x35a824,_0x31787b,_0x68f4ee){return db['WhatsappQueue'][_0xb6bf('0x4f')]({'where':{'id':_0x35a824['params']['id']}})[_0xb6bf('0x25')](handleEntityNotFound(_0x31787b,null))[_0xb6bf('0x25')](function(_0x492d03){if(_0x492d03){return _0x492d03['removeAgents'](_0x35a824[_0xb6bf('0x33')]['ids'])[_0xb6bf('0x25')](function(){if(_[_0xb6bf('0x7f')](_0x35a824[_0xb6bf('0x33')][_0xb6bf('0x6c')])){for(var _0x53dddc=0x0;_0x53dddc<_0x35a824[_0xb6bf('0x33')][_0xb6bf('0x6c')][_0xb6bf('0x37')];_0x53dddc+=0x1){socket[_0xb6bf('0x69')]('userWhatsappQueue:remove',{'UserId':Number(_0x35a824['query']['ids'][_0x53dddc]),'WhatsappQueueId':Number(_0x35a824[_0xb6bf('0x52')]['id'])});}}else{socket[_0xb6bf('0x69')](_0xb6bf('0x80'),{'UserId':Number(_0x35a824[_0xb6bf('0x33')]['ids']),'WhatsappQueueId':Number(_0x35a824['params']['id'])});}});}})[_0xb6bf('0x25')](respondWithStatusCode(_0x31787b,null))['catch'](handleError(_0x31787b,null));};exports[_0xb6bf('0x81')]=function(_0x4aa2d0,_0x28e472,_0x1739e2){var _0xb373b6={};var _0x42e92c={};var _0x5b65a5;var _0x3e016c;return db[_0xb6bf('0x2e')][_0xb6bf('0x55')]({'where':{'id':_0x4aa2d0['params']['id']}})[_0xb6bf('0x25')](handleEntityNotFound(_0x28e472,null))[_0xb6bf('0x25')](function(_0x5732de){if(_0x5732de){_0x5b65a5=_0x5732de;_0x42e92c[_0xb6bf('0x32')]=_['keys'](db[_0xb6bf('0x58')][_0xb6bf('0x2f')]);_0x42e92c[_0xb6bf('0x33')]=_[_0xb6bf('0x47')](_0x4aa2d0['query']);_0x42e92c[_0xb6bf('0x34')]=_['intersection'](_0x42e92c[_0xb6bf('0x32')],_0x42e92c['query']);_0xb373b6[_0xb6bf('0x35')]=_[_0xb6bf('0x48')](_0x42e92c[_0xb6bf('0x32')],qs[_0xb6bf('0x36')](_0x4aa2d0[_0xb6bf('0x33')]['fields']));_0xb373b6[_0xb6bf('0x35')]=_0xb373b6[_0xb6bf('0x35')]['length']?_0xb373b6[_0xb6bf('0x35')]:_0x42e92c[_0xb6bf('0x32')];_0xb373b6[_0xb6bf('0x3a')]=qs[_0xb6bf('0x3b')](_0x4aa2d0[_0xb6bf('0x33')][_0xb6bf('0x3b')]);_0xb373b6[_0xb6bf('0x3c')]=qs[_0xb6bf('0x34')](_['pick'](_0x4aa2d0['query'],_0x42e92c['filters']));if(_0x4aa2d0[_0xb6bf('0x33')][_0xb6bf('0x3e')]){_0xb373b6['where']=_[_0xb6bf('0x3f')](_0xb373b6[_0xb6bf('0x3c')],{'$or':_[_0xb6bf('0x2d')](_0xb373b6[_0xb6bf('0x35')],function(_0x2e8d2c){var _0x24055f={};_0x24055f[_0x2e8d2c]={'$like':'%'+_0x4aa2d0['query'][_0xb6bf('0x3e')]+'%'};return _0x24055f;})});}_0xb373b6=_[_0xb6bf('0x3f')]({},_0xb373b6,_0x4aa2d0[_0xb6bf('0x40')]);return _0x5b65a5['getAgents'](_0xb373b6);}})['then'](function(_0x4f2ebd){if(_0x4f2ebd){_0x3e016c=_0x4f2ebd[_0xb6bf('0x37')];if(!_0x4aa2d0[_0xb6bf('0x33')][_0xb6bf('0x38')](_0xb6bf('0x39'))){_0xb373b6['limit']=qs[_0xb6bf('0x1c')](_0x4aa2d0[_0xb6bf('0x33')][_0xb6bf('0x1c')]);_0xb373b6[_0xb6bf('0x1f')]=qs[_0xb6bf('0x1f')](_0x4aa2d0[_0xb6bf('0x33')][_0xb6bf('0x1f')]);}return _0x5b65a5[_0xb6bf('0x81')](_0xb373b6);}})['then'](function(_0x2d262e){if(_0x2d262e){return _0x2d262e?{'count':_0x3e016c,'rows':_0x2d262e}:null;}})[_0xb6bf('0x25')](respondWithResult(_0x28e472,null))[_0xb6bf('0x45')](handleError(_0x28e472,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 17eead3..633849e 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 _0x8ff2=['save','update','emit','hasOwnProperty','exports','events','../../mysqldb','WhatsappQueue','setMaxListeners'];(function(_0x287cf6,_0x26aab9){var _0x388575=function(_0x5993b3){while(--_0x5993b3){_0x287cf6['push'](_0x287cf6['shift']());}};_0x388575(++_0x26aab9);}(_0x8ff2,0x113));var _0x28ff=function(_0x1d4f5f,_0x3f8d75){_0x1d4f5f=_0x1d4f5f-0x0;var _0x3a02f8=_0x8ff2[_0x1d4f5f];return _0x3a02f8;};'use strict';var EventEmitter=require(_0x28ff('0x0'));var WhatsappQueue=require(_0x28ff('0x1'))['db'][_0x28ff('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x28ff('0x3')](0x0);var events={'afterCreate':_0x28ff('0x4'),'afterUpdate':_0x28ff('0x5'),'afterDestroy':'remove'};function emitEvent(_0x23a685){return function(_0x349acc,_0x298055,_0x47759e){WhatsappQueueEvents['emit'](_0x23a685+':'+_0x349acc['id'],_0x349acc);WhatsappQueueEvents[_0x28ff('0x6')](_0x23a685,_0x349acc);_0x47759e(null);};}for(var e in events){if(events[_0x28ff('0x7')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x28ff('0x8')]=WhatsappQueueEvents; \ No newline at end of file +var _0xd963=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','WhatsappQueue'];(function(_0x3afe28,_0x17b9f4){var _0x3f5319=function(_0x37ceac){while(--_0x37ceac){_0x3afe28['push'](_0x3afe28['shift']());}};_0x3f5319(++_0x17b9f4);}(_0xd963,0xbc));var _0x3d96=function(_0x192b1c,_0x2d6f00){_0x192b1c=_0x192b1c-0x0;var _0x3c102f=_0xd963[_0x192b1c];return _0x3c102f;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require('../../mysqldb')['db'][_0x3d96('0x0')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x3d96('0x1')](0x0);var events={'afterCreate':_0x3d96('0x2'),'afterUpdate':_0x3d96('0x3'),'afterDestroy':_0x3d96('0x4')};function emitEvent(_0x4e64b9){return function(_0x1fbcbd,_0x56abf2,_0x534fe0){WhatsappQueueEvents[_0x3d96('0x5')](_0x4e64b9+':'+_0x1fbcbd['id'],_0x1fbcbd);WhatsappQueueEvents[_0x3d96('0x5')](_0x4e64b9,_0x1fbcbd);_0x534fe0(null);};}for(var e in events){if(events[_0x3d96('0x6')](e)){var event=events[e];WhatsappQueue[_0x3d96('0x7')](e,emitEvent(event));}}module[_0x3d96('0x8')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 1634318..bf6a4eb 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 _0x24c1=['bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','define','WhatsappQueue','whatsapp_queues','lodash','util','api','moment'];(function(_0x35950c,_0xcec6a5){var _0x512425=function(_0x50ca37){while(--_0x50ca37){_0x35950c['push'](_0x35950c['shift']());}};_0x512425(++_0xcec6a5);}(_0x24c1,0x1ca));var _0x124c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x24c1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x124c('0x0'));var util=require(_0x124c('0x1'));var logger=require('../../config/logger')(_0x124c('0x2'));var moment=require(_0x124c('0x3'));var BPromise=require(_0x124c('0x4'));var rp=require(_0x124c('0x5'));var fs=require('fs');var path=require(_0x124c('0x6'));var rimraf=require(_0x124c('0x7'));var config=require(_0x124c('0x8'));var attributes=require(_0x124c('0x9'));module[_0x124c('0xa')]=function(_0x549080,_0x64956f){return _0x549080[_0x124c('0xb')](_0x124c('0xc'),attributes,{'tableName':_0x124c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd5b9=['WhatsappQueue','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes','exports'];(function(_0x503185,_0x20d261){var _0xb29eff=function(_0x15e65e){while(--_0x15e65e){_0x503185['push'](_0x503185['shift']());}};_0xb29eff(++_0x20d261);}(_0xd5b9,0x1c4));var _0x9d5b=function(_0x80f933,_0x585621){_0x80f933=_0x80f933-0x0;var _0x1de143=_0xd5b9[_0x80f933];return _0x1de143;};'use strict';var _=require(_0x9d5b('0x0'));var util=require(_0x9d5b('0x1'));var logger=require(_0x9d5b('0x2'))(_0x9d5b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9d5b('0x4'));var fs=require('fs');var path=require(_0x9d5b('0x5'));var rimraf=require(_0x9d5b('0x6'));var config=require(_0x9d5b('0x7'));var attributes=require(_0x9d5b('0x8'));module[_0x9d5b('0x9')]=function(_0xdbbcab,_0x545d68){return _0xdbbcab['define'](_0x9d5b('0xa'),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 d060b4b..928c848 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 _0x8520=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','socket.io-emitter','./whatsappQueue.socket','register','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetWhatsappQueue','WhatsappQueue','options','raw','where','attributes','limit','include','map','model','ShowWhatsappQueue','find'];(function(_0x47aade,_0x5bea0b){var _0x12c921=function(_0x584895){while(--_0x584895){_0x47aade['push'](_0x47aade['shift']());}};_0x12c921(++_0x5bea0b);}(_0x8520,0x1bc));var _0x0852=function(_0x3d15e0,_0x4e4777){_0x3d15e0=_0x3d15e0-0x0;var _0x4746c3=_0x8520[_0x3d15e0];return _0x4746c3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0852('0x0'));var BPromise=require(_0x0852('0x1'));var rs=require(_0x0852('0x2'));var fs=require('fs');var Redis=require(_0x0852('0x3'));var db=require(_0x0852('0x4'))['db'];var utils=require(_0x0852('0x5'));var logger=require(_0x0852('0x6'))(_0x0852('0x7'));var config=require(_0x0852('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0852('0x9')][_0x0852('0xa')]({'port':0x232a});config[_0x0852('0xb')]=_['defaults'](config[_0x0852('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x0852('0xc'))(new Redis(config[_0x0852('0xb')]));require(_0x0852('0xd'))[_0x0852('0xe')](socket);function respondWithRpcPromise(_0x452bc5,_0x2b14b6,_0x57c641){return new BPromise(function(_0x159b0c,_0x5cb98c){return client['request'](_0x452bc5,_0x57c641)[_0x0852('0xf')](function(_0x26de5c){logger[_0x0852('0x10')](_0x0852('0x11'),_0x2b14b6,_0x0852('0x12'));logger['debug'](_0x0852('0x13'),_0x2b14b6,_0x0852('0x12'),JSON[_0x0852('0x14')](_0x26de5c));if(_0x26de5c[_0x0852('0x15')]){if(_0x26de5c['error']['code']===0x1f4){logger[_0x0852('0x15')](_0x0852('0x11'),_0x2b14b6,_0x26de5c[_0x0852('0x15')]['message']);return _0x5cb98c(_0x26de5c[_0x0852('0x15')][_0x0852('0x16')]);}logger[_0x0852('0x15')](_0x0852('0x11'),_0x2b14b6,_0x26de5c[_0x0852('0x15')][_0x0852('0x16')]);return _0x159b0c(_0x26de5c[_0x0852('0x15')][_0x0852('0x16')]);}else{logger[_0x0852('0x10')](_0x0852('0x11'),_0x2b14b6,'request\x20sent');_0x159b0c(_0x26de5c[_0x0852('0x17')]['message']);}})[_0x0852('0x18')](function(_0x149d4e){logger[_0x0852('0x15')](_0x0852('0x11'),_0x2b14b6,_0x149d4e);_0x5cb98c(_0x149d4e);});});}exports[_0x0852('0x19')]=function(_0x5722dd){var _0x159e1c=this;return new Promise(function(_0x1887a7,_0x57b483){return db[_0x0852('0x1a')]['findAll']({'raw':_0x5722dd['options']?_0x5722dd[_0x0852('0x1b')][_0x0852('0x1c')]===undefined?!![]:![]:!![],'where':_0x5722dd['options']?_0x5722dd[_0x0852('0x1b')][_0x0852('0x1d')]||null:null,'attributes':_0x5722dd['options']?_0x5722dd[_0x0852('0x1b')][_0x0852('0x1e')]||null:null,'limit':_0x5722dd[_0x0852('0x1b')]?_0x5722dd[_0x0852('0x1b')][_0x0852('0x1f')]||null:null,'include':_0x5722dd[_0x0852('0x1b')]?_0x5722dd['options'][_0x0852('0x20')]?_[_0x0852('0x21')](_0x5722dd[_0x0852('0x1b')][_0x0852('0x20')],function(_0x4c52ef){return{'model':db[_0x4c52ef[_0x0852('0x22')]],'as':_0x4c52ef['as'],'attributes':_0x4c52ef['attributes'],'include':_0x4c52ef[_0x0852('0x20')]?_[_0x0852('0x21')](_0x4c52ef['include'],function(_0x275343){return{'model':db[_0x275343[_0x0852('0x22')]],'as':_0x275343['as'],'attributes':_0x275343[_0x0852('0x1e')],'include':_0x275343['include']?_[_0x0852('0x21')](_0x275343['include'],function(_0x12ccc5){return{'model':db[_0x12ccc5['model']],'as':_0x12ccc5['as'],'attributes':_0x12ccc5[_0x0852('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0852('0xf')](function(_0x2d900b){logger[_0x0852('0x10')](_0x0852('0x19'),_0x5722dd);logger['debug']('GetWhatsappQueue',_0x5722dd,JSON['stringify'](_0x2d900b));_0x1887a7(_0x2d900b);})[_0x0852('0x18')](function(_0x2fbcc1){logger['error'](_0x0852('0x19'),_0x2fbcc1[_0x0852('0x16')],_0x5722dd);_0x57b483(_0x159e1c['error'](0x1f4,_0x2fbcc1['message']));});});};exports[_0x0852('0x23')]=function(_0x4d3f67){var _0x2fe8e0=this;return new Promise(function(_0x2bad5b,_0x2cd00a){return db[_0x0852('0x1a')][_0x0852('0x24')]({'raw':_0x4d3f67[_0x0852('0x1b')]?_0x4d3f67[_0x0852('0x1b')][_0x0852('0x1c')]===undefined?!![]:![]:!![],'where':_0x4d3f67[_0x0852('0x1b')]?_0x4d3f67[_0x0852('0x1b')][_0x0852('0x1d')]||null:null,'attributes':_0x4d3f67[_0x0852('0x1b')]?_0x4d3f67[_0x0852('0x1b')][_0x0852('0x1e')]||null:null,'include':_0x4d3f67[_0x0852('0x1b')]?_0x4d3f67[_0x0852('0x1b')][_0x0852('0x20')]?_[_0x0852('0x21')](_0x4d3f67[_0x0852('0x1b')][_0x0852('0x20')],function(_0x3b585b){return{'model':db[_0x3b585b[_0x0852('0x22')]],'as':_0x3b585b['as'],'attributes':_0x3b585b[_0x0852('0x1e')],'include':_0x3b585b[_0x0852('0x20')]?_[_0x0852('0x21')](_0x3b585b[_0x0852('0x20')],function(_0x59212b){return{'model':db[_0x59212b[_0x0852('0x22')]],'as':_0x59212b['as'],'attributes':_0x59212b[_0x0852('0x1e')],'include':_0x59212b[_0x0852('0x20')]?_['map'](_0x59212b[_0x0852('0x20')],function(_0x410e06){return{'model':db[_0x410e06[_0x0852('0x22')]],'as':_0x410e06['as'],'attributes':_0x410e06[_0x0852('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0852('0xf')](function(_0x18b157){logger[_0x0852('0x10')](_0x0852('0x23'),_0x4d3f67);logger['debug'](_0x0852('0x23'),_0x4d3f67,JSON['stringify'](_0x18b157));_0x2bad5b(_0x18b157);})[_0x0852('0x18')](function(_0x2a42a2){logger['error'](_0x0852('0x23'),_0x2a42a2[_0x0852('0x16')],_0x4d3f67);_0x2cd00a(_0x2fe8e0[_0x0852('0x15')](0x1f4,_0x2a42a2['message']));});});}; \ No newline at end of file +var _0xffb1=['GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes','include','map','model','then','debug','stringify','ShowWhatsappQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x53a0a9,_0x39c3e9){var _0x119dbf=function(_0x332c98){while(--_0x332c98){_0x53a0a9['push'](_0x53a0a9['shift']());}};_0x119dbf(++_0x39c3e9);}(_0xffb1,0x143));var _0x1ffb=function(_0x569caa,_0x5174ce){_0x569caa=_0x569caa-0x0;var _0x44cb5a=_0xffb1[_0x569caa];return _0x44cb5a;};'use strict';var _=require(_0x1ffb('0x0'));var util=require(_0x1ffb('0x1'));var moment=require(_0x1ffb('0x2'));var BPromise=require(_0x1ffb('0x3'));var rs=require(_0x1ffb('0x4'));var fs=require('fs');var Redis=require(_0x1ffb('0x5'));var db=require(_0x1ffb('0x6'))['db'];var utils=require(_0x1ffb('0x7'));var logger=require(_0x1ffb('0x8'))(_0x1ffb('0x9'));var config=require(_0x1ffb('0xa'));var jayson=require(_0x1ffb('0xb'));var client=jayson[_0x1ffb('0xc')][_0x1ffb('0xd')]({'port':0x232a});config[_0x1ffb('0xe')]=_['defaults'](config[_0x1ffb('0xe')],{'host':_0x1ffb('0xf'),'port':0x18eb});var socket=require(_0x1ffb('0x10'))(new Redis(config[_0x1ffb('0xe')]));require(_0x1ffb('0x11'))[_0x1ffb('0x12')](socket);function respondWithRpcPromise(_0x28ecb9,_0x16e2da,_0x551422){return new BPromise(function(_0x1096ab,_0x144957){return client[_0x1ffb('0x13')](_0x28ecb9,_0x551422)['then'](function(_0x44b276){logger[_0x1ffb('0x14')](_0x1ffb('0x15'),_0x16e2da,_0x1ffb('0x16'));logger['debug'](_0x1ffb('0x17'),_0x16e2da,_0x1ffb('0x16'),JSON['stringify'](_0x44b276));if(_0x44b276[_0x1ffb('0x18')]){if(_0x44b276[_0x1ffb('0x18')][_0x1ffb('0x19')]===0x1f4){logger[_0x1ffb('0x18')](_0x1ffb('0x15'),_0x16e2da,_0x44b276['error'][_0x1ffb('0x1a')]);return _0x144957(_0x44b276[_0x1ffb('0x18')]['message']);}logger[_0x1ffb('0x18')]('WhatsappQueue,\x20%s,\x20%s',_0x16e2da,_0x44b276[_0x1ffb('0x18')][_0x1ffb('0x1a')]);return _0x1096ab(_0x44b276['error'][_0x1ffb('0x1a')]);}else{logger[_0x1ffb('0x14')](_0x1ffb('0x15'),_0x16e2da,'request\x20sent');_0x1096ab(_0x44b276[_0x1ffb('0x1b')][_0x1ffb('0x1a')]);}})[_0x1ffb('0x1c')](function(_0x4343e4){logger['error'](_0x1ffb('0x15'),_0x16e2da,_0x4343e4);_0x144957(_0x4343e4);});});}exports[_0x1ffb('0x1d')]=function(_0x5335e6){var _0x3cc7f2=this;return new Promise(function(_0x593be0,_0x2d2f6e){return db[_0x1ffb('0x1e')][_0x1ffb('0x1f')]({'raw':_0x5335e6[_0x1ffb('0x20')]?_0x5335e6[_0x1ffb('0x20')][_0x1ffb('0x21')]===undefined?!![]:![]:!![],'where':_0x5335e6[_0x1ffb('0x20')]?_0x5335e6[_0x1ffb('0x20')][_0x1ffb('0x22')]||null:null,'attributes':_0x5335e6[_0x1ffb('0x20')]?_0x5335e6[_0x1ffb('0x20')][_0x1ffb('0x23')]||null:null,'limit':_0x5335e6['options']?_0x5335e6[_0x1ffb('0x20')]['limit']||null:null,'include':_0x5335e6[_0x1ffb('0x20')]?_0x5335e6[_0x1ffb('0x20')][_0x1ffb('0x24')]?_[_0x1ffb('0x25')](_0x5335e6[_0x1ffb('0x20')][_0x1ffb('0x24')],function(_0x265976){return{'model':db[_0x265976[_0x1ffb('0x26')]],'as':_0x265976['as'],'attributes':_0x265976[_0x1ffb('0x23')],'include':_0x265976['include']?_[_0x1ffb('0x25')](_0x265976[_0x1ffb('0x24')],function(_0x48b8dc){return{'model':db[_0x48b8dc[_0x1ffb('0x26')]],'as':_0x48b8dc['as'],'attributes':_0x48b8dc[_0x1ffb('0x23')],'include':_0x48b8dc[_0x1ffb('0x24')]?_[_0x1ffb('0x25')](_0x48b8dc[_0x1ffb('0x24')],function(_0x5c85f4){return{'model':db[_0x5c85f4[_0x1ffb('0x26')]],'as':_0x5c85f4['as'],'attributes':_0x5c85f4[_0x1ffb('0x23')]};}):[]};}):[]};}):[]:[]})[_0x1ffb('0x27')](function(_0x3e36d2){logger['info'](_0x1ffb('0x1d'),_0x5335e6);logger[_0x1ffb('0x28')](_0x1ffb('0x1d'),_0x5335e6,JSON[_0x1ffb('0x29')](_0x3e36d2));_0x593be0(_0x3e36d2);})[_0x1ffb('0x1c')](function(_0x49622d){logger[_0x1ffb('0x18')](_0x1ffb('0x1d'),_0x49622d[_0x1ffb('0x1a')],_0x5335e6);_0x2d2f6e(_0x3cc7f2[_0x1ffb('0x18')](0x1f4,_0x49622d[_0x1ffb('0x1a')]));});});};exports[_0x1ffb('0x2a')]=function(_0x10ff2c){var _0x2a26c4=this;return new Promise(function(_0x54092d,_0x1f2c3d){return db[_0x1ffb('0x1e')][_0x1ffb('0x2b')]({'raw':_0x10ff2c[_0x1ffb('0x20')]?_0x10ff2c[_0x1ffb('0x20')][_0x1ffb('0x21')]===undefined?!![]:![]:!![],'where':_0x10ff2c[_0x1ffb('0x20')]?_0x10ff2c[_0x1ffb('0x20')][_0x1ffb('0x22')]||null:null,'attributes':_0x10ff2c['options']?_0x10ff2c[_0x1ffb('0x20')][_0x1ffb('0x23')]||null:null,'include':_0x10ff2c[_0x1ffb('0x20')]?_0x10ff2c[_0x1ffb('0x20')]['include']?_[_0x1ffb('0x25')](_0x10ff2c[_0x1ffb('0x20')][_0x1ffb('0x24')],function(_0x20fb21){return{'model':db[_0x20fb21[_0x1ffb('0x26')]],'as':_0x20fb21['as'],'attributes':_0x20fb21['attributes'],'include':_0x20fb21[_0x1ffb('0x24')]?_[_0x1ffb('0x25')](_0x20fb21[_0x1ffb('0x24')],function(_0x32307c){return{'model':db[_0x32307c[_0x1ffb('0x26')]],'as':_0x32307c['as'],'attributes':_0x32307c[_0x1ffb('0x23')],'include':_0x32307c[_0x1ffb('0x24')]?_['map'](_0x32307c['include'],function(_0x3d2ca5){return{'model':db[_0x3d2ca5[_0x1ffb('0x26')]],'as':_0x3d2ca5['as'],'attributes':_0x3d2ca5['attributes']};}):[]};}):[]};}):[]:[]})[_0x1ffb('0x27')](function(_0x5f264a){logger['info'](_0x1ffb('0x2a'),_0x10ff2c);logger[_0x1ffb('0x28')](_0x1ffb('0x2a'),_0x10ff2c,JSON['stringify'](_0x5f264a));_0x54092d(_0x5f264a);})[_0x1ffb('0x1c')](function(_0x462ee0){logger['error']('ShowWhatsappQueue',_0x462ee0[_0x1ffb('0x1a')],_0x10ff2c);_0x1f2c3d(_0x2a26c4[_0x1ffb('0x18')](0x1f4,_0x462ee0[_0x1ffb('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 7c75504..558c3e6 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 _0xfdd9=['save','remove','update','emit','removeListener','register','length','whatsappQueue:','./whatsappQueue.events'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xfdd9,0x182));var _0x9fdd=function(_0x4ff0db,_0x2a9fe6){_0x4ff0db=_0x4ff0db-0x0;var _0xa2db67=_0xfdd9[_0x4ff0db];return _0xa2db67;};'use strict';var WhatsappQueueEvents=require(_0x9fdd('0x0'));var events=[_0x9fdd('0x1'),_0x9fdd('0x2'),_0x9fdd('0x3')];function createListener(_0x105636,_0x50bc27){return function(_0x5b1c6a){_0x50bc27[_0x9fdd('0x4')](_0x105636,_0x5b1c6a);};}function removeListener(_0x3065bf,_0x1258ed){return function(){WhatsappQueueEvents[_0x9fdd('0x5')](_0x3065bf,_0x1258ed);};}exports[_0x9fdd('0x6')]=function(_0x5540ba){for(var _0x10e7db=0x0,_0x512462=events[_0x9fdd('0x7')];_0x10e7db<_0x512462;_0x10e7db++){var _0x27d81c=events[_0x10e7db];var _0x20aaff=createListener(_0x9fdd('0x8')+_0x27d81c,_0x5540ba);WhatsappQueueEvents['on'](_0x27d81c,_0x20aaff);}}; \ No newline at end of file +var _0xea46=['register','whatsappQueue:','./whatsappQueue.events','remove','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xea46,0x115));var _0x6ea4=function(_0x3553b3,_0x491559){_0x3553b3=_0x3553b3-0x0;var _0x3d2904=_0xea46[_0x3553b3];return _0x3d2904;};'use strict';var WhatsappQueueEvents=require(_0x6ea4('0x0'));var events=['save',_0x6ea4('0x1'),'update'];function createListener(_0xf0f12f,_0x47785f){return function(_0xfad8a2){_0x47785f[_0x6ea4('0x2')](_0xf0f12f,_0xfad8a2);};}function removeListener(_0x54268b,_0x5b4d88){return function(){WhatsappQueueEvents['removeListener'](_0x54268b,_0x5b4d88);};}exports[_0x6ea4('0x3')]=function(_0x5dc241){for(var _0x1d7e4d=0x0,_0x328446=events['length'];_0x1d7e4d<_0x328446;_0x1d7e4d++){var _0x3a3595=events[_0x1d7e4d];var _0x3c8f5d=createListener(_0x6ea4('0x4')+_0x3a3595,_0x5dc241);WhatsappQueueEvents['on'](_0x3a3595,_0x3c8f5d);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 71f8837..4278050 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 _0xaa16=['delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','describe','/:id','show','post','create','put','update'];(function(_0x46dfd6,_0x3f82fe){var _0x297678=function(_0x5622af){while(--_0x5622af){_0x46dfd6['push'](_0x46dfd6['shift']());}};_0x297678(++_0x3f82fe);}(_0xaa16,0x192));var _0x6aa1=function(_0x446737,_0x411246){_0x446737=_0x446737-0x0;var _0x575b95=_0xaa16[_0x446737];return _0x575b95;};'use strict';var multer=require('multer');var util=require(_0x6aa1('0x0'));var path=require(_0x6aa1('0x1'));var timeout=require(_0x6aa1('0x2'));var express=require(_0x6aa1('0x3'));var router=express[_0x6aa1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6aa1('0x5'));var interaction=require(_0x6aa1('0x6'));var config=require(_0x6aa1('0x7'));var controller=require(_0x6aa1('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x6aa1('0x9')]('/describe',auth[_0x6aa1('0xa')](),controller[_0x6aa1('0xb')]);router[_0x6aa1('0x9')](_0x6aa1('0xc'),auth[_0x6aa1('0xa')](),controller[_0x6aa1('0xd')]);router[_0x6aa1('0xe')]('/',auth[_0x6aa1('0xa')](),controller[_0x6aa1('0xf')]);router[_0x6aa1('0x10')](_0x6aa1('0xc'),auth[_0x6aa1('0xa')](),controller[_0x6aa1('0x11')]);router[_0x6aa1('0x12')](_0x6aa1('0xc'),auth[_0x6aa1('0xa')](),controller[_0x6aa1('0x13')]);module['exports']=router; \ No newline at end of file +var _0x4bc9=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','put','destroy','multer','util','connect-timeout','express'];(function(_0x26fbd9,_0x58d0e4){var _0x9ce764=function(_0x2e425f){while(--_0x2e425f){_0x26fbd9['push'](_0x26fbd9['shift']());}};_0x9ce764(++_0x58d0e4);}(_0x4bc9,0x12e));var _0x94bc=function(_0x5f2e17,_0x2de9f2){_0x5f2e17=_0x5f2e17-0x0;var _0x388526=_0x4bc9[_0x5f2e17];return _0x388526;};'use strict';var multer=require(_0x94bc('0x0'));var util=require(_0x94bc('0x1'));var path=require('path');var timeout=require(_0x94bc('0x2'));var express=require(_0x94bc('0x3'));var router=express[_0x94bc('0x4')]();var fs_extra=require(_0x94bc('0x5'));var auth=require(_0x94bc('0x6'));var interaction=require(_0x94bc('0x7'));var config=require(_0x94bc('0x8'));var controller=require('./whatsappQueueReport.controller');router[_0x94bc('0x9')]('/',auth[_0x94bc('0xa')](),controller['index']);router['get'](_0x94bc('0xb'),auth[_0x94bc('0xa')](),controller[_0x94bc('0xc')]);router[_0x94bc('0x9')](_0x94bc('0xd'),auth['isAuthenticated'](),controller[_0x94bc('0xe')]);router[_0x94bc('0xf')]('/',auth[_0x94bc('0xa')](),controller['create']);router[_0x94bc('0x10')]('/:id',auth[_0x94bc('0xa')](),controller['update']);router['delete'](_0x94bc('0xd'),auth[_0x94bc('0xa')](),controller[_0x94bc('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 5489553..1ca1f80 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(_0x40ecac,_0x235974){var _0xe32ec3=function(_0x29dd08){while(--_0x29dd08){_0x40ecac['push'](_0x40ecac['shift']());}};_0xe32ec3(++_0x235974);}(_0x7a54,0x106));var _0x47a5=function(_0x4d143f,_0x915099){_0x4d143f=_0x4d143f-0x0;var _0x250c9b=_0x7a54[_0x4d143f];return _0x250c9b;};'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(_0x4005a,_0x205433){var _0x2b3cb1=function(_0x1c5e52){while(--_0x1c5e52){_0x4005a['push'](_0x4005a['shift']());}};_0x2b3cb1(++_0x205433);}(_0x7a54,0x106));var _0x47a5=function(_0x29f00c,_0x2b5700){_0x29f00c=_0x29f00c-0x0;var _0x55c8ef=_0x7a54[_0x29f00c];return _0x55c8ef;};'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 8f0e071..0290b50 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 _0x1d2d=['options','WhatsappQueueReport','includeAll','findAll','catch','show','params','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge'];(function(_0x397385,_0x146bcf){var _0xdeca13=function(_0x1443ba){while(--_0x1443ba){_0x397385['push'](_0x397385['shift']());}};_0xdeca13(++_0x146bcf);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x428aca,_0x396fc0){_0x428aca=_0x428aca-0x0;var _0x3caaa7=_0x1d2d[_0x428aca];return _0x3caaa7;};'use strict';var emlformat=require(_0xd1d2('0x0'));var rimraf=require(_0xd1d2('0x1'));var zipdir=require(_0xd1d2('0x2'));var jsonpatch=require(_0xd1d2('0x3'));var rp=require(_0xd1d2('0x4'));var moment=require('moment');var BPromise=require(_0xd1d2('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd1d2('0x6'));var sox=require(_0xd1d2('0x7'));var csv=require(_0xd1d2('0x8'));var ejs=require(_0xd1d2('0x9'));var fs=require('fs');var fs_extra=require(_0xd1d2('0xa'));var _=require(_0xd1d2('0xb'));var squel=require('squel');var crypto=require(_0xd1d2('0xc'));var jsforce=require(_0xd1d2('0xd'));var deskjs=require(_0xd1d2('0xe'));var toCsv=require(_0xd1d2('0x8'));var querystring=require(_0xd1d2('0xf'));var Papa=require(_0xd1d2('0x10'));var Redis=require(_0xd1d2('0x11'));var authService=require(_0xd1d2('0x12'));var qs=require(_0xd1d2('0x13'));var as=require(_0xd1d2('0x14'));var hardwareService=require(_0xd1d2('0x15'));var logger=require(_0xd1d2('0x16'))(_0xd1d2('0x17'));var utils=require('../../config/utils');var config=require(_0xd1d2('0x18'));var licenseUtil=require(_0xd1d2('0x19'));var db=require(_0xd1d2('0x1a'))['db'];function respondWithStatusCode(_0x33f088,_0x129d8f){_0x129d8f=_0x129d8f||0xcc;return function(_0xc3ee82){if(_0xc3ee82){return _0x33f088[_0xd1d2('0x1b')](_0x129d8f);}return _0x33f088[_0xd1d2('0x1c')](_0x129d8f)[_0xd1d2('0x1d')]();};}function respondWithResult(_0x3f670f,_0x4cf702){_0x4cf702=_0x4cf702||0xc8;return function(_0x2e7fec){if(_0x2e7fec){return _0x3f670f[_0xd1d2('0x1c')](_0x4cf702)[_0xd1d2('0x1e')](_0x2e7fec);}};}function respondWithFilteredResult(_0x56de25,_0x35381b){return function(_0xc36ce){if(_0xc36ce){var _0x208425=typeof _0x35381b[_0xd1d2('0x1f')]===_0xd1d2('0x20')&&typeof _0x35381b[_0xd1d2('0x21')]===_0xd1d2('0x20');var _0x57f2f9=_0xc36ce['count'];var _0x3be186=_0x208425?0x0:_0x35381b['offset'];var _0x247b3a=_0x208425?_0xc36ce[_0xd1d2('0x22')]:_0x35381b[_0xd1d2('0x1f')]+_0x35381b[_0xd1d2('0x21')];var _0x4ab386;if(_0x247b3a>=_0x57f2f9){_0x247b3a=_0x57f2f9;_0x4ab386=0xc8;}else{_0x4ab386=0xce;}_0x56de25['status'](_0x4ab386);return _0x56de25[_0xd1d2('0x23')]('Content-Range',_0x3be186+'-'+_0x247b3a+'/'+_0x57f2f9)['json'](_0xc36ce);}return null;};}function patchUpdates(_0x1ab67c){return function(_0x27e26b){try{jsonpatch[_0xd1d2('0x24')](_0x27e26b,_0x1ab67c,!![]);}catch(_0x40170b){return BPromise['reject'](_0x40170b);}return _0x27e26b[_0xd1d2('0x25')]();};}function saveUpdates(_0xbb4d27,_0x24b8db){return function(_0x4eb082){if(_0x4eb082){return _0x4eb082['update'](_0xbb4d27)[_0xd1d2('0x26')](function(_0x3a1078){return _0x3a1078;});}return null;};}function removeEntity(_0x19d535,_0x2f92ee){return function(_0x3f229c){if(_0x3f229c){return _0x3f229c[_0xd1d2('0x27')]()[_0xd1d2('0x26')](function(){_0x19d535['status'](0xcc)[_0xd1d2('0x1d')]();});}};}function handleEntityNotFound(_0x42da6d,_0x41330f){return function(_0x2e1709){if(!_0x2e1709){_0x42da6d[_0xd1d2('0x1b')](0x194);}return _0x2e1709;};}function handleError(_0x39e991,_0x28b8be){_0x28b8be=_0x28b8be||0x1f4;return function(_0x34faf7){logger[_0xd1d2('0x28')](_0x34faf7[_0xd1d2('0x29')]);if(_0x34faf7[_0xd1d2('0x2a')]){delete _0x34faf7['name'];}_0x39e991['status'](_0x28b8be)[_0xd1d2('0x2b')](_0x34faf7);};}exports[_0xd1d2('0x2c')]=function(_0x1e6072,_0x2b4c1f){var _0xc815ea={},_0x48ade1={},_0x39d694={'count':0x0,'rows':[]};var _0x41171c=_[_0xd1d2('0x2d')](db['WhatsappQueueReport'][_0xd1d2('0x2e')],function(_0x1db17f){return{'name':_0x1db17f[_0xd1d2('0x2f')],'type':_0x1db17f['type'][_0xd1d2('0x30')]};});_0x48ade1[_0xd1d2('0x31')]=_[_0xd1d2('0x2d')](_0x41171c,_0xd1d2('0x2a'));_0x48ade1[_0xd1d2('0x32')]=_[_0xd1d2('0x33')](_0x1e6072[_0xd1d2('0x32')]);_0x48ade1[_0xd1d2('0x34')]=_[_0xd1d2('0x35')](_0x48ade1[_0xd1d2('0x31')],_0x48ade1[_0xd1d2('0x32')]);_0xc815ea[_0xd1d2('0x36')]=_[_0xd1d2('0x35')](_0x48ade1[_0xd1d2('0x31')],qs[_0xd1d2('0x37')](_0x1e6072[_0xd1d2('0x32')][_0xd1d2('0x37')]));_0xc815ea[_0xd1d2('0x36')]=_0xc815ea['attributes'][_0xd1d2('0x38')]?_0xc815ea[_0xd1d2('0x36')]:_0x48ade1[_0xd1d2('0x31')];if(!_0x1e6072['query'][_0xd1d2('0x39')]('nolimit')){_0xc815ea['limit']=qs[_0xd1d2('0x21')](_0x1e6072[_0xd1d2('0x32')][_0xd1d2('0x21')]);_0xc815ea[_0xd1d2('0x1f')]=qs[_0xd1d2('0x1f')](_0x1e6072[_0xd1d2('0x32')]['offset']);}_0xc815ea[_0xd1d2('0x3a')]=qs[_0xd1d2('0x3b')](_0x1e6072['query'][_0xd1d2('0x3b')]);_0xc815ea[_0xd1d2('0x3c')]=qs[_0xd1d2('0x34')](_[_0xd1d2('0x3d')](_0x1e6072['query'],_0x48ade1['filters']),_0x41171c);if(_0x1e6072[_0xd1d2('0x32')]['filter']){_0xc815ea['where']=_['merge'](_0xc815ea[_0xd1d2('0x3c')],{'$or':_['map'](_0x41171c,function(_0x3f4fd7){if(_0x3f4fd7['type']!=='VIRTUAL'){var _0x4bcea4={};_0x4bcea4[_0x3f4fd7[_0xd1d2('0x2a')]]={'$like':'%'+_0x1e6072[_0xd1d2('0x32')][_0xd1d2('0x3e')]+'%'};return _0x4bcea4;}})});}_0xc815ea=_[_0xd1d2('0x3f')]({},_0xc815ea,_0x1e6072[_0xd1d2('0x40')]);var _0xb5bec2={'where':_0xc815ea[_0xd1d2('0x3c')]};return db[_0xd1d2('0x41')][_0xd1d2('0x22')](_0xb5bec2)[_0xd1d2('0x26')](function(_0x2cedb4){_0x39d694[_0xd1d2('0x22')]=_0x2cedb4;if(_0x1e6072[_0xd1d2('0x32')][_0xd1d2('0x42')]){_0xc815ea['include']=[{'all':!![]}];}return db['WhatsappQueueReport'][_0xd1d2('0x43')](_0xc815ea);})[_0xd1d2('0x26')](function(_0x24fc93){_0x39d694['rows']=_0x24fc93;return _0x39d694;})['then'](respondWithFilteredResult(_0x2b4c1f,_0xc815ea))[_0xd1d2('0x44')](handleError(_0x2b4c1f,null));};exports[_0xd1d2('0x45')]=function(_0x4dc730,_0x2fe92a){var _0x4c5d49={'raw':!![],'where':{'id':_0x4dc730[_0xd1d2('0x46')]['id']}},_0x5a3790={};_0x5a3790['model']=_['keys'](db[_0xd1d2('0x41')][_0xd1d2('0x2e')]);_0x5a3790[_0xd1d2('0x32')]=_['keys'](_0x4dc730[_0xd1d2('0x32')]);_0x5a3790[_0xd1d2('0x34')]=_[_0xd1d2('0x35')](_0x5a3790[_0xd1d2('0x31')],_0x5a3790['query']);_0x4c5d49[_0xd1d2('0x36')]=_[_0xd1d2('0x35')](_0x5a3790['model'],qs[_0xd1d2('0x37')](_0x4dc730['query'][_0xd1d2('0x37')]));_0x4c5d49[_0xd1d2('0x36')]=_0x4c5d49[_0xd1d2('0x36')][_0xd1d2('0x38')]?_0x4c5d49[_0xd1d2('0x36')]:_0x5a3790['model'];if(_0x4dc730['query'][_0xd1d2('0x42')]){_0x4c5d49[_0xd1d2('0x47')]=[{'all':!![]}];}_0x4c5d49=_['merge']({},_0x4c5d49,_0x4dc730[_0xd1d2('0x40')]);return db[_0xd1d2('0x41')][_0xd1d2('0x48')](_0x4c5d49)[_0xd1d2('0x26')](handleEntityNotFound(_0x2fe92a,null))[_0xd1d2('0x26')](respondWithResult(_0x2fe92a,null))[_0xd1d2('0x44')](handleError(_0x2fe92a,null));};exports[_0xd1d2('0x49')]=function(_0x57c668,_0xed9e9){return db[_0xd1d2('0x41')]['create'](_0x57c668[_0xd1d2('0x4a')],{})[_0xd1d2('0x26')](respondWithResult(_0xed9e9,0xc9))['catch'](handleError(_0xed9e9,null));};exports['update']=function(_0x3d4fe3,_0x182ea8){if(_0x3d4fe3['body']['id']){delete _0x3d4fe3[_0xd1d2('0x4a')]['id'];}return db[_0xd1d2('0x41')][_0xd1d2('0x48')]({'where':{'id':_0x3d4fe3[_0xd1d2('0x46')]['id']}})[_0xd1d2('0x26')](handleEntityNotFound(_0x182ea8,null))['then'](saveUpdates(_0x3d4fe3['body'],null))[_0xd1d2('0x26')](respondWithResult(_0x182ea8,null))['catch'](handleError(_0x182ea8,null));};exports[_0xd1d2('0x27')]=function(_0xcd4b70,_0x4f4cb9){return db[_0xd1d2('0x41')][_0xd1d2('0x48')]({'where':{'id':_0xcd4b70['params']['id']}})['then'](handleEntityNotFound(_0x4f4cb9,null))[_0xd1d2('0x26')](removeEntity(_0x4f4cb9,null))[_0xd1d2('0x44')](handleError(_0x4f4cb9,null));};exports[_0xd1d2('0x4b')]=function(_0xfd8024,_0xa013ce){return db[_0xd1d2('0x41')][_0xd1d2('0x4b')]()[_0xd1d2('0x26')](respondWithResult(_0xa013ce,null))[_0xd1d2('0x44')](handleError(_0xa013ce,null));}; \ No newline at end of file +var _0x373d=['order','sort','pick','filter','where','VIRTUAL','merge','include','findAll','rows','show','rawAttributes','includeAll','options','catch','create','body','find','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','WhatsappQueueReport','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x23cf31,_0x2a90f6){var _0x2f4517=function(_0xb076b1){while(--_0xb076b1){_0x23cf31['push'](_0x23cf31['shift']());}};_0x2f4517(++_0x2a90f6);}(_0x373d,0x1e2));var _0xd373=function(_0x12833e,_0x302abb){_0x12833e=_0x12833e-0x0;var _0xe6208a=_0x373d[_0x12833e];return _0xe6208a;};'use strict';var emlformat=require(_0xd373('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd373('0x1'));var jsonpatch=require(_0xd373('0x2'));var rp=require(_0xd373('0x3'));var moment=require(_0xd373('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd373('0x5'));var util=require(_0xd373('0x6'));var path=require(_0xd373('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd373('0x8'));var fs=require('fs');var fs_extra=require(_0xd373('0x9'));var _=require(_0xd373('0xa'));var squel=require(_0xd373('0xb'));var crypto=require('crypto');var jsforce=require(_0xd373('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd373('0xd'));var Redis=require(_0xd373('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd373('0xf'));var as=require(_0xd373('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd373('0x11'));var utils=require(_0xd373('0x12'));var config=require(_0xd373('0x13'));var licenseUtil=require(_0xd373('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c7f91,_0x5ab89c){_0x5ab89c=_0x5ab89c||0xcc;return function(_0xcd9b8c){if(_0xcd9b8c){return _0x4c7f91[_0xd373('0x15')](_0x5ab89c);}return _0x4c7f91['status'](_0x5ab89c)[_0xd373('0x16')]();};}function respondWithResult(_0x129475,_0x27c161){_0x27c161=_0x27c161||0xc8;return function(_0x23ed86){if(_0x23ed86){return _0x129475[_0xd373('0x17')](_0x27c161)[_0xd373('0x18')](_0x23ed86);}};}function respondWithFilteredResult(_0x20aca5,_0x2eacb1){return function(_0x5a286a){if(_0x5a286a){var _0x2c5854=typeof _0x2eacb1[_0xd373('0x19')]===_0xd373('0x1a')&&typeof _0x2eacb1[_0xd373('0x1b')]==='undefined';var _0x1e26cf=_0x5a286a['count'];var _0x460259=_0x2c5854?0x0:_0x2eacb1[_0xd373('0x19')];var _0x55c5c7=_0x2c5854?_0x5a286a[_0xd373('0x1c')]:_0x2eacb1['offset']+_0x2eacb1['limit'];var _0x23fada;if(_0x55c5c7>=_0x1e26cf){_0x55c5c7=_0x1e26cf;_0x23fada=0xc8;}else{_0x23fada=0xce;}_0x20aca5[_0xd373('0x17')](_0x23fada);return _0x20aca5[_0xd373('0x1d')](_0xd373('0x1e'),_0x460259+'-'+_0x55c5c7+'/'+_0x1e26cf)[_0xd373('0x18')](_0x5a286a);}return null;};}function patchUpdates(_0x181eb2){return function(_0x4ba510){try{jsonpatch[_0xd373('0x1f')](_0x4ba510,_0x181eb2,!![]);}catch(_0xd808f8){return BPromise[_0xd373('0x20')](_0xd808f8);}return _0x4ba510[_0xd373('0x21')]();};}function saveUpdates(_0x165e21,_0x3aa1c5){return function(_0x4f64bd){if(_0x4f64bd){return _0x4f64bd[_0xd373('0x22')](_0x165e21)[_0xd373('0x23')](function(_0x157f81){return _0x157f81;});}return null;};}function removeEntity(_0x209ca7,_0x217ee7){return function(_0x238ffd){if(_0x238ffd){return _0x238ffd[_0xd373('0x24')]()[_0xd373('0x23')](function(){_0x209ca7[_0xd373('0x17')](0xcc)[_0xd373('0x16')]();});}};}function handleEntityNotFound(_0x437110,_0x34f05a){return function(_0x388182){if(!_0x388182){_0x437110[_0xd373('0x15')](0x194);}return _0x388182;};}function handleError(_0x18d7ab,_0x38ba50){_0x38ba50=_0x38ba50||0x1f4;return function(_0x50b987){logger[_0xd373('0x25')](_0x50b987[_0xd373('0x26')]);if(_0x50b987[_0xd373('0x27')]){delete _0x50b987[_0xd373('0x27')];}_0x18d7ab[_0xd373('0x17')](_0x38ba50)[_0xd373('0x28')](_0x50b987);};}exports[_0xd373('0x29')]=function(_0xf85ca8,_0x2869e5){var _0x158825={},_0xbc420b={},_0x2ee37c={'count':0x0,'rows':[]};var _0x7dad3e=_['map'](db[_0xd373('0x2a')]['rawAttributes'],function(_0x498aaa){return{'name':_0x498aaa[_0xd373('0x2b')],'type':_0x498aaa[_0xd373('0x2c')][_0xd373('0x2d')]};});_0xbc420b[_0xd373('0x2e')]=_[_0xd373('0x2f')](_0x7dad3e,'name');_0xbc420b[_0xd373('0x30')]=_[_0xd373('0x31')](_0xf85ca8['query']);_0xbc420b[_0xd373('0x32')]=_[_0xd373('0x33')](_0xbc420b[_0xd373('0x2e')],_0xbc420b[_0xd373('0x30')]);_0x158825[_0xd373('0x34')]=_[_0xd373('0x33')](_0xbc420b[_0xd373('0x2e')],qs[_0xd373('0x35')](_0xf85ca8[_0xd373('0x30')]['fields']));_0x158825[_0xd373('0x34')]=_0x158825[_0xd373('0x34')][_0xd373('0x36')]?_0x158825[_0xd373('0x34')]:_0xbc420b[_0xd373('0x2e')];if(!_0xf85ca8[_0xd373('0x30')][_0xd373('0x37')](_0xd373('0x38'))){_0x158825[_0xd373('0x1b')]=qs[_0xd373('0x1b')](_0xf85ca8[_0xd373('0x30')][_0xd373('0x1b')]);_0x158825[_0xd373('0x19')]=qs[_0xd373('0x19')](_0xf85ca8[_0xd373('0x30')]['offset']);}_0x158825[_0xd373('0x39')]=qs[_0xd373('0x3a')](_0xf85ca8[_0xd373('0x30')][_0xd373('0x3a')]);_0x158825['where']=qs[_0xd373('0x32')](_[_0xd373('0x3b')](_0xf85ca8[_0xd373('0x30')],_0xbc420b[_0xd373('0x32')]),_0x7dad3e);if(_0xf85ca8[_0xd373('0x30')][_0xd373('0x3c')]){_0x158825['where']=_['merge'](_0x158825[_0xd373('0x3d')],{'$or':_['map'](_0x7dad3e,function(_0x37c97e){if(_0x37c97e[_0xd373('0x2c')]!==_0xd373('0x3e')){var _0x51ba69={};_0x51ba69[_0x37c97e[_0xd373('0x27')]]={'$like':'%'+_0xf85ca8[_0xd373('0x30')][_0xd373('0x3c')]+'%'};return _0x51ba69;}})});}_0x158825=_[_0xd373('0x3f')]({},_0x158825,_0xf85ca8['options']);var _0x513038={'where':_0x158825['where']};return db[_0xd373('0x2a')]['count'](_0x513038)[_0xd373('0x23')](function(_0x2fa6c4){_0x2ee37c['count']=_0x2fa6c4;if(_0xf85ca8['query']['includeAll']){_0x158825[_0xd373('0x40')]=[{'all':!![]}];}return db[_0xd373('0x2a')][_0xd373('0x41')](_0x158825);})['then'](function(_0x5c3b22){_0x2ee37c[_0xd373('0x42')]=_0x5c3b22;return _0x2ee37c;})[_0xd373('0x23')](respondWithFilteredResult(_0x2869e5,_0x158825))['catch'](handleError(_0x2869e5,null));};exports[_0xd373('0x43')]=function(_0x2ee75f,_0x1e3de1){var _0x9989e4={'raw':!![],'where':{'id':_0x2ee75f['params']['id']}},_0x2d8c7d={};_0x2d8c7d['model']=_[_0xd373('0x31')](db[_0xd373('0x2a')][_0xd373('0x44')]);_0x2d8c7d[_0xd373('0x30')]=_['keys'](_0x2ee75f[_0xd373('0x30')]);_0x2d8c7d['filters']=_[_0xd373('0x33')](_0x2d8c7d[_0xd373('0x2e')],_0x2d8c7d[_0xd373('0x30')]);_0x9989e4[_0xd373('0x34')]=_[_0xd373('0x33')](_0x2d8c7d['model'],qs[_0xd373('0x35')](_0x2ee75f[_0xd373('0x30')]['fields']));_0x9989e4[_0xd373('0x34')]=_0x9989e4[_0xd373('0x34')][_0xd373('0x36')]?_0x9989e4[_0xd373('0x34')]:_0x2d8c7d[_0xd373('0x2e')];if(_0x2ee75f[_0xd373('0x30')][_0xd373('0x45')]){_0x9989e4[_0xd373('0x40')]=[{'all':!![]}];}_0x9989e4=_[_0xd373('0x3f')]({},_0x9989e4,_0x2ee75f[_0xd373('0x46')]);return db['WhatsappQueueReport']['find'](_0x9989e4)[_0xd373('0x23')](handleEntityNotFound(_0x1e3de1,null))['then'](respondWithResult(_0x1e3de1,null))[_0xd373('0x47')](handleError(_0x1e3de1,null));};exports['create']=function(_0x5e5279,_0x5cbc16){return db[_0xd373('0x2a')][_0xd373('0x48')](_0x5e5279[_0xd373('0x49')],{})[_0xd373('0x23')](respondWithResult(_0x5cbc16,0xc9))[_0xd373('0x47')](handleError(_0x5cbc16,null));};exports[_0xd373('0x22')]=function(_0x1855aa,_0x4d1088){if(_0x1855aa[_0xd373('0x49')]['id']){delete _0x1855aa['body']['id'];}return db[_0xd373('0x2a')][_0xd373('0x4a')]({'where':{'id':_0x1855aa['params']['id']}})[_0xd373('0x23')](handleEntityNotFound(_0x4d1088,null))['then'](saveUpdates(_0x1855aa[_0xd373('0x49')],null))[_0xd373('0x23')](respondWithResult(_0x4d1088,null))[_0xd373('0x47')](handleError(_0x4d1088,null));};exports[_0xd373('0x24')]=function(_0xe22cbd,_0x4bc631){return db['WhatsappQueueReport']['find']({'where':{'id':_0xe22cbd[_0xd373('0x4b')]['id']}})[_0xd373('0x23')](handleEntityNotFound(_0x4bc631,null))['then'](removeEntity(_0x4bc631,null))[_0xd373('0x47')](handleError(_0x4bc631,null));};exports[_0xd373('0x4c')]=function(_0x4d7020,_0xae7067){return db[_0xd373('0x2a')][_0xd373('0x4c')]()[_0xd373('0x23')](respondWithResult(_0xae7067,null))[_0xd373('0x47')](handleError(_0xae7067,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 7fabe2a..22c486a 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 _0xf883=['rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','report_whatsapp_queue','uniqueid','../../config/logger','api','moment','request-promise','path'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0xf883,0x150));var _0x3f88=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf883[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3f88('0x0'))(_0x3f88('0x1'));var moment=require(_0x3f88('0x2'));var BPromise=require('bluebird');var rp=require(_0x3f88('0x3'));var fs=require('fs');var path=require(_0x3f88('0x4'));var rimraf=require(_0x3f88('0x5'));var config=require(_0x3f88('0x6'));var attributes=require(_0x3f88('0x7'));module[_0x3f88('0x8')]=function(_0x525754,_0x420cbf){return _0x525754['define']('WhatsappQueueReport',attributes,{'tableName':_0x3f88('0x9'),'paranoid':![],'indexes':[{'name':_0x3f88('0xa'),'fields':[_0x3f88('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xeed4=['define','WhatsappQueueReport','uniqueid','util','../../config/logger','moment','bluebird','path','./whatsappQueueReport.attributes','exports'];(function(_0x3aa8ce,_0x192faf){var _0x3e9336=function(_0x21cdad){while(--_0x21cdad){_0x3aa8ce['push'](_0x3aa8ce['shift']());}};_0x3e9336(++_0x192faf);}(_0xeed4,0xfd));var _0x4eed=function(_0x1fc7b5,_0x5d4779){_0x1fc7b5=_0x1fc7b5-0x0;var _0x3ef5db=_0xeed4[_0x1fc7b5];return _0x3ef5db;};'use strict';var _=require('lodash');var util=require(_0x4eed('0x0'));var logger=require(_0x4eed('0x1'))('api');var moment=require(_0x4eed('0x2'));var BPromise=require(_0x4eed('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4eed('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4eed('0x5'));module[_0x4eed('0x6')]=function(_0x4ca624,_0x2ab69b){return _0x4ca624[_0x4eed('0x7')](_0x4eed('0x8'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x4eed('0x9'),'fields':[_0x4eed('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 09ef102..a3d420d 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 _0x3e37=['code','WhatsappQueueReport,\x20%s,\x20%s','message','result','catch','WhatsappQueueReport','create','body','options','raw','CreateWhatsappQueueReport','debug','stringify','UpdateWhatsappQueueReport','update','attributes','limit','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x532cda,_0x1d0eaf){var _0x1fd91b=function(_0x74c028){while(--_0x74c028){_0x532cda['push'](_0x532cda['shift']());}};_0x1fd91b(++_0x1d0eaf);}(_0x3e37,0x14c));var _0x73e3=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x3e37[_0x1cc8fe];return _0x230054;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x73e3('0x0'));var BPromise=require(_0x73e3('0x1'));var rs=require(_0x73e3('0x2'));var fs=require('fs');var Redis=require(_0x73e3('0x3'));var db=require(_0x73e3('0x4'))['db'];var utils=require(_0x73e3('0x5'));var logger=require(_0x73e3('0x6'))(_0x73e3('0x7'));var config=require(_0x73e3('0x8'));var jayson=require(_0x73e3('0x9'));var client=jayson[_0x73e3('0xa')][_0x73e3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x41c15e,_0x28675d,_0x1fcd1c){return new BPromise(function(_0x5c53c9,_0x1181bf){return client[_0x73e3('0xc')](_0x41c15e,_0x1fcd1c)[_0x73e3('0xd')](function(_0xe7a202){logger[_0x73e3('0xe')]('WhatsappQueueReport,\x20%s,\x20%s',_0x28675d,_0x73e3('0xf'));logger['debug'](_0x73e3('0x10'),_0x28675d,_0x73e3('0xf'),JSON['stringify'](_0xe7a202));if(_0xe7a202[_0x73e3('0x11')]){if(_0xe7a202[_0x73e3('0x11')][_0x73e3('0x12')]===0x1f4){logger['error'](_0x73e3('0x13'),_0x28675d,_0xe7a202['error']['message']);return _0x1181bf(_0xe7a202[_0x73e3('0x11')][_0x73e3('0x14')]);}logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x28675d,_0xe7a202[_0x73e3('0x11')][_0x73e3('0x14')]);return _0x5c53c9(_0xe7a202[_0x73e3('0x11')][_0x73e3('0x14')]);}else{logger[_0x73e3('0xe')](_0x73e3('0x13'),_0x28675d,_0x73e3('0xf'));_0x5c53c9(_0xe7a202[_0x73e3('0x15')][_0x73e3('0x14')]);}})[_0x73e3('0x16')](function(_0x5e2d4a){logger[_0x73e3('0x11')](_0x73e3('0x13'),_0x28675d,_0x5e2d4a);_0x1181bf(_0x5e2d4a);});});}exports['CreateWhatsappQueueReport']=function(_0x17621c){var _0x1ae1cd=this;return new Promise(function(_0x294ee6,_0x54cb3a){return db[_0x73e3('0x17')][_0x73e3('0x18')](_0x17621c[_0x73e3('0x19')],{'raw':_0x17621c[_0x73e3('0x1a')]?_0x17621c[_0x73e3('0x1a')][_0x73e3('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x68cd1f){logger[_0x73e3('0xe')](_0x73e3('0x1c'),_0x17621c);logger[_0x73e3('0x1d')]('CreateWhatsappQueueReport',_0x17621c,JSON[_0x73e3('0x1e')](_0x68cd1f));_0x294ee6(_0x68cd1f);})[_0x73e3('0x16')](function(_0x35f874){logger[_0x73e3('0x11')](_0x73e3('0x1c'),_0x35f874[_0x73e3('0x14')],_0x17621c);_0x54cb3a(_0x1ae1cd[_0x73e3('0x11')](0x1f4,_0x35f874[_0x73e3('0x14')]));});});};exports[_0x73e3('0x1f')]=function(_0x5f0ded){var _0x107b47=this;return new Promise(function(_0x5e6fa9,_0x2c4c1c){return db[_0x73e3('0x17')][_0x73e3('0x20')](_0x5f0ded[_0x73e3('0x19')],{'raw':_0x5f0ded['options']?_0x5f0ded[_0x73e3('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f0ded[_0x73e3('0x1a')]?_0x5f0ded['options']['where']||null:null,'attributes':_0x5f0ded['options']?_0x5f0ded[_0x73e3('0x1a')][_0x73e3('0x21')]||null:null,'limit':_0x5f0ded['options']?_0x5f0ded[_0x73e3('0x1a')][_0x73e3('0x22')]||null:null})[_0x73e3('0xd')](function(_0x623f71){logger[_0x73e3('0xe')](_0x73e3('0x1f'),_0x5f0ded);logger[_0x73e3('0x1d')](_0x73e3('0x1f'),_0x5f0ded,JSON[_0x73e3('0x1e')](_0x623f71));_0x5e6fa9(_0x623f71);})[_0x73e3('0x16')](function(_0x38ea64){logger['error'](_0x73e3('0x1f'),_0x38ea64['message'],_0x5f0ded);_0x2c4c1c(_0x107b47[_0x73e3('0x11')](0x1f4,_0x38ea64['message']));});});}; \ No newline at end of file +var _0xa2a1=['UpdateWhatsappQueueReport','update','limit','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','WhatsappQueueReport,\x20%s,\x20%s','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','WhatsappQueueReport','create','body','options','raw','CreateWhatsappQueueReport'];(function(_0x1ccc3f,_0x547108){var _0x29f78a=function(_0x13f240){while(--_0x13f240){_0x1ccc3f['push'](_0x1ccc3f['shift']());}};_0x29f78a(++_0x547108);}(_0xa2a1,0xe3));var _0x1a2a=function(_0x1b11e0,_0x5c4c08){_0x1b11e0=_0x1b11e0-0x0;var _0x2eba9f=_0xa2a1[_0x1b11e0];return _0x2eba9f;};'use strict';var _=require(_0x1a2a('0x0'));var util=require('util');var moment=require(_0x1a2a('0x1'));var BPromise=require('bluebird');var rs=require(_0x1a2a('0x2'));var fs=require('fs');var Redis=require(_0x1a2a('0x3'));var db=require(_0x1a2a('0x4'))['db'];var utils=require(_0x1a2a('0x5'));var logger=require(_0x1a2a('0x6'))(_0x1a2a('0x7'));var config=require(_0x1a2a('0x8'));var jayson=require(_0x1a2a('0x9'));var client=jayson[_0x1a2a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x414575,_0x857a73,_0x5d6b7a){return new BPromise(function(_0x3d71f8,_0x5d1783){return client['request'](_0x414575,_0x5d6b7a)[_0x1a2a('0xb')](function(_0x1b2be0){logger[_0x1a2a('0xc')](_0x1a2a('0xd'),_0x857a73,'request\x20sent');logger[_0x1a2a('0xe')](_0x1a2a('0xf'),_0x857a73,_0x1a2a('0x10'),JSON[_0x1a2a('0x11')](_0x1b2be0));if(_0x1b2be0['error']){if(_0x1b2be0[_0x1a2a('0x12')][_0x1a2a('0x13')]===0x1f4){logger[_0x1a2a('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x857a73,_0x1b2be0[_0x1a2a('0x12')][_0x1a2a('0x14')]);return _0x5d1783(_0x1b2be0[_0x1a2a('0x12')]['message']);}logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x857a73,_0x1b2be0[_0x1a2a('0x12')]['message']);return _0x3d71f8(_0x1b2be0[_0x1a2a('0x12')]['message']);}else{logger[_0x1a2a('0xc')](_0x1a2a('0xd'),_0x857a73,_0x1a2a('0x10'));_0x3d71f8(_0x1b2be0[_0x1a2a('0x15')][_0x1a2a('0x14')]);}})[_0x1a2a('0x16')](function(_0x555fa9){logger[_0x1a2a('0x12')](_0x1a2a('0xd'),_0x857a73,_0x555fa9);_0x5d1783(_0x555fa9);});});}exports['CreateWhatsappQueueReport']=function(_0x178321){var _0x1e9b8e=this;return new Promise(function(_0x5d29ee,_0x5a1c8a){return db[_0x1a2a('0x17')][_0x1a2a('0x18')](_0x178321[_0x1a2a('0x19')],{'raw':_0x178321[_0x1a2a('0x1a')]?_0x178321[_0x1a2a('0x1a')][_0x1a2a('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x574c2f){logger['info'](_0x1a2a('0x1c'),_0x178321);logger[_0x1a2a('0xe')](_0x1a2a('0x1c'),_0x178321,JSON['stringify'](_0x574c2f));_0x5d29ee(_0x574c2f);})[_0x1a2a('0x16')](function(_0x4e1362){logger[_0x1a2a('0x12')](_0x1a2a('0x1c'),_0x4e1362['message'],_0x178321);_0x5a1c8a(_0x1e9b8e['error'](0x1f4,_0x4e1362[_0x1a2a('0x14')]));});});};exports[_0x1a2a('0x1d')]=function(_0x3cbd35){var _0x4035e8=this;return new Promise(function(_0x254cb3,_0x17ed97){return db['WhatsappQueueReport'][_0x1a2a('0x1e')](_0x3cbd35[_0x1a2a('0x19')],{'raw':_0x3cbd35[_0x1a2a('0x1a')]?_0x3cbd35[_0x1a2a('0x1a')][_0x1a2a('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3cbd35[_0x1a2a('0x1a')]?_0x3cbd35[_0x1a2a('0x1a')]['where']||null:null,'attributes':_0x3cbd35['options']?_0x3cbd35['options']['attributes']||null:null,'limit':_0x3cbd35['options']?_0x3cbd35[_0x1a2a('0x1a')][_0x1a2a('0x1f')]||null:null})[_0x1a2a('0xb')](function(_0x1d0efa){logger[_0x1a2a('0xc')](_0x1a2a('0x1d'),_0x3cbd35);logger[_0x1a2a('0xe')]('UpdateWhatsappQueueReport',_0x3cbd35,JSON[_0x1a2a('0x11')](_0x1d0efa));_0x254cb3(_0x1d0efa);})['catch'](function(_0x493be2){logger[_0x1a2a('0x12')](_0x1a2a('0x1d'),_0x493be2[_0x1a2a('0x14')],_0x3cbd35);_0x17ed97(_0x4035e8[_0x1a2a('0x12')](0x1f4,_0x493be2[_0x1a2a('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 4ba9536..4c348da 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 _0xa0dd=['/:id','post','create','put','delete','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','index','/describe','isAuthenticated','describe'];(function(_0x36ae30,_0x426345){var _0x47b2bb=function(_0x514d06){while(--_0x514d06){_0x36ae30['push'](_0x36ae30['shift']());}};_0x47b2bb(++_0x426345);}(_0xa0dd,0x1ce));var _0xda0d=function(_0x5a8db3,_0xfbecee){_0x5a8db3=_0x5a8db3-0x0;var _0x40d5d1=_0xa0dd[_0x5a8db3];return _0x40d5d1;};'use strict';var multer=require(_0xda0d('0x0'));var util=require(_0xda0d('0x1'));var path=require(_0xda0d('0x2'));var timeout=require('connect-timeout');var express=require(_0xda0d('0x3'));var router=express['Router']();var fs_extra=require(_0xda0d('0x4'));var auth=require(_0xda0d('0x5'));var interaction=require(_0xda0d('0x6'));var config=require(_0xda0d('0x7'));var controller=require(_0xda0d('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xda0d('0x9')]);router['get'](_0xda0d('0xa'),auth[_0xda0d('0xb')](),controller[_0xda0d('0xc')]);router['get'](_0xda0d('0xd'),auth[_0xda0d('0xb')](),controller['show']);router[_0xda0d('0xe')]('/',auth['isAuthenticated'](),controller[_0xda0d('0xf')]);router[_0xda0d('0x10')]('/:id',auth[_0xda0d('0xb')](),controller['update']);router[_0xda0d('0x11')](_0xda0d('0xd'),auth[_0xda0d('0xb')](),controller['destroy']);module[_0xda0d('0x12')]=router; \ No newline at end of file +var _0x5d7d=['../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','/:id','post','put','delete','exports','multer','path','connect-timeout'];(function(_0x4cc492,_0x162c85){var _0x1f36b9=function(_0xce4b2){while(--_0xce4b2){_0x4cc492['push'](_0x4cc492['shift']());}};_0x1f36b9(++_0x162c85);}(_0x5d7d,0xad));var _0xd5d7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d7d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd5d7('0x0'));var util=require('util');var path=require(_0xd5d7('0x1'));var timeout=require(_0xd5d7('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd5d7('0x3'));var interaction=require(_0xd5d7('0x4'));var config=require(_0xd5d7('0x5'));var controller=require(_0xd5d7('0x6'));router[_0xd5d7('0x7')]('/',auth[_0xd5d7('0x8')](),controller[_0xd5d7('0x9')]);router[_0xd5d7('0x7')](_0xd5d7('0xa'),auth[_0xd5d7('0x8')](),controller['describe']);router['get'](_0xd5d7('0xb'),auth[_0xd5d7('0x8')](),controller['show']);router[_0xd5d7('0xc')]('/',auth[_0xd5d7('0x8')](),controller['create']);router[_0xd5d7('0xd')](_0xd5d7('0xb'),auth[_0xd5d7('0x8')](),controller['update']);router[_0xd5d7('0xe')](_0xd5d7('0xb'),auth[_0xd5d7('0x8')](),controller['destroy']);module[_0xd5d7('0xf')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 41a7474..462dd6a 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 _0x0ac0=['agent','queue','DATE','sequelize','exports','STRING','account'];(function(_0x301502,_0x174937){var _0x263e3e=function(_0x5ba23e){while(--_0x5ba23e){_0x301502['push'](_0x301502['shift']());}};_0x263e3e(++_0x174937);}(_0x0ac0,0x130));var _0x00ac=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x0ac0[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x00ac('0x0'));module[_0x00ac('0x1')]={'uniqueid':{'type':Sequelize[_0x00ac('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x00ac('0x3'),_0x00ac('0x4'),_0x00ac('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x00ac('0x6')]}}; \ No newline at end of file +var _0x30c7=['account','queue','DATE','sequelize','STRING','ENUM'];(function(_0x11f345,_0x258812){var _0x34bb94=function(_0x1e3e3b){while(--_0x1e3e3b){_0x11f345['push'](_0x11f345['shift']());}};_0x34bb94(++_0x258812);}(_0x30c7,0x111));var _0x730c=function(_0x5b98bd,_0x1461c9){_0x5b98bd=_0x5b98bd-0x0;var _0x5147be=_0x30c7[_0x5b98bd];return _0x5147be;};'use strict';var Sequelize=require(_0x730c('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x730c('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x730c('0x2')](_0x730c('0x3'),'agent',_0x730c('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x730c('0x5')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index c3dda99..2d7918a 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 _0x5e36=['to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','apply','reject','save','update','then','destroy','name','map','WhatsappTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','merge','filter','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x18c02d,_0x50caba){var _0xa0c2c4=function(_0xa2c64a){while(--_0xa2c64a){_0x18c02d['push'](_0x18c02d['shift']());}};_0xa0c2c4(++_0x50caba);}(_0x5e36,0xc8));var _0x65e3=function(_0x356f52,_0x11079a){_0x356f52=_0x356f52-0x0;var _0x9945ad=_0x5e36[_0x356f52];return _0x9945ad;};'use strict';var emlformat=require(_0x65e3('0x0'));var rimraf=require(_0x65e3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65e3('0x2'));var rp=require(_0x65e3('0x3'));var moment=require(_0x65e3('0x4'));var BPromise=require(_0x65e3('0x5'));var Mustache=require(_0x65e3('0x6'));var util=require(_0x65e3('0x7'));var path=require(_0x65e3('0x8'));var sox=require(_0x65e3('0x9'));var csv=require(_0x65e3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x65e3('0xb'));var _=require(_0x65e3('0xc'));var squel=require(_0x65e3('0xd'));var crypto=require(_0x65e3('0xe'));var jsforce=require(_0x65e3('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x65e3('0xa'));var querystring=require(_0x65e3('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x65e3('0x11'));var hardwareService=require(_0x65e3('0x12'));var logger=require('../../config/logger')(_0x65e3('0x13'));var utils=require('../../config/utils');var config=require(_0x65e3('0x14'));var licenseUtil=require(_0x65e3('0x15'));var db=require(_0x65e3('0x16'))['db'];function respondWithStatusCode(_0x3e019f,_0xef9861){_0xef9861=_0xef9861||0xcc;return function(_0x3743ca){if(_0x3743ca){return _0x3e019f[_0x65e3('0x17')](_0xef9861);}return _0x3e019f['status'](_0xef9861)[_0x65e3('0x18')]();};}function respondWithResult(_0x34200b,_0x249df1){_0x249df1=_0x249df1||0xc8;return function(_0x4ca459){if(_0x4ca459){return _0x34200b['status'](_0x249df1)['json'](_0x4ca459);}};}function respondWithFilteredResult(_0x22a393,_0x5bcdc3){return function(_0x41728b){if(_0x41728b){var _0x30fa8a=typeof _0x5bcdc3[_0x65e3('0x19')]===_0x65e3('0x1a')&&typeof _0x5bcdc3[_0x65e3('0x1b')]===_0x65e3('0x1a');var _0x4e2097=_0x41728b[_0x65e3('0x1c')];var _0x47af07=_0x30fa8a?0x0:_0x5bcdc3[_0x65e3('0x19')];var _0x154449=_0x30fa8a?_0x41728b[_0x65e3('0x1c')]:_0x5bcdc3[_0x65e3('0x19')]+_0x5bcdc3['limit'];var _0x5dc2d9;if(_0x154449>=_0x4e2097){_0x154449=_0x4e2097;_0x5dc2d9=0xc8;}else{_0x5dc2d9=0xce;}_0x22a393[_0x65e3('0x1d')](_0x5dc2d9);return _0x22a393[_0x65e3('0x1e')](_0x65e3('0x1f'),_0x47af07+'-'+_0x154449+'/'+_0x4e2097)[_0x65e3('0x20')](_0x41728b);}return null;};}function patchUpdates(_0x43cd35){return function(_0x568473){try{jsonpatch[_0x65e3('0x21')](_0x568473,_0x43cd35,!![]);}catch(_0x16aecb){return BPromise[_0x65e3('0x22')](_0x16aecb);}return _0x568473[_0x65e3('0x23')]();};}function saveUpdates(_0x1b3f1f,_0x44d255){return function(_0x346cd4){if(_0x346cd4){return _0x346cd4[_0x65e3('0x24')](_0x1b3f1f)[_0x65e3('0x25')](function(_0x33cf2e){return _0x33cf2e;});}return null;};}function removeEntity(_0x1a96f1,_0x53e3e6){return function(_0x3049e9){if(_0x3049e9){return _0x3049e9[_0x65e3('0x26')]()[_0x65e3('0x25')](function(){_0x1a96f1[_0x65e3('0x1d')](0xcc)[_0x65e3('0x18')]();});}};}function handleEntityNotFound(_0x57fb76,_0xcb4215){return function(_0x57e4a6){if(!_0x57e4a6){_0x57fb76[_0x65e3('0x17')](0x194);}return _0x57e4a6;};}function handleError(_0x163236,_0x5cc0eb){_0x5cc0eb=_0x5cc0eb||0x1f4;return function(_0x5481d7){logger['error'](_0x5481d7['stack']);if(_0x5481d7['name']){delete _0x5481d7[_0x65e3('0x27')];}_0x163236[_0x65e3('0x1d')](_0x5cc0eb)['send'](_0x5481d7);};}exports['index']=function(_0x1740d3,_0x3fc461){var _0x273b82={},_0x384dfd={},_0x21e7a5={'count':0x0,'rows':[]};var _0x570eae=_[_0x65e3('0x28')](db[_0x65e3('0x29')][_0x65e3('0x2a')],function(_0x41d7d6){return{'name':_0x41d7d6[_0x65e3('0x2b')],'type':_0x41d7d6[_0x65e3('0x2c')][_0x65e3('0x2d')]};});_0x384dfd[_0x65e3('0x2e')]=_[_0x65e3('0x28')](_0x570eae,_0x65e3('0x27'));_0x384dfd[_0x65e3('0x2f')]=_[_0x65e3('0x30')](_0x1740d3['query']);_0x384dfd[_0x65e3('0x31')]=_['intersection'](_0x384dfd[_0x65e3('0x2e')],_0x384dfd['query']);_0x273b82[_0x65e3('0x32')]=_[_0x65e3('0x33')](_0x384dfd[_0x65e3('0x2e')],qs[_0x65e3('0x34')](_0x1740d3['query'][_0x65e3('0x34')]));_0x273b82[_0x65e3('0x32')]=_0x273b82[_0x65e3('0x32')]['length']?_0x273b82[_0x65e3('0x32')]:_0x384dfd['model'];if(!_0x1740d3['query'][_0x65e3('0x35')]('nolimit')){_0x273b82['limit']=qs[_0x65e3('0x1b')](_0x1740d3['query'][_0x65e3('0x1b')]);_0x273b82[_0x65e3('0x19')]=qs[_0x65e3('0x19')](_0x1740d3['query']['offset']);}_0x273b82[_0x65e3('0x36')]=qs[_0x65e3('0x37')](_0x1740d3[_0x65e3('0x2f')][_0x65e3('0x37')]);_0x273b82[_0x65e3('0x38')]=qs[_0x65e3('0x31')](_['pick'](_0x1740d3[_0x65e3('0x2f')],_0x384dfd[_0x65e3('0x31')]),_0x570eae);if(_0x1740d3['query']['filter']){_0x273b82[_0x65e3('0x38')]=_[_0x65e3('0x39')](_0x273b82['where'],{'$or':_[_0x65e3('0x28')](_0x570eae,function(_0x3286e3){if(_0x3286e3['type']!=='VIRTUAL'){var _0x4df494={};_0x4df494[_0x3286e3[_0x65e3('0x27')]]={'$like':'%'+_0x1740d3[_0x65e3('0x2f')][_0x65e3('0x3a')]+'%'};return _0x4df494;}})});}_0x273b82=_[_0x65e3('0x39')]({},_0x273b82,_0x1740d3[_0x65e3('0x3b')]);var _0x2b2daa={'where':_0x273b82[_0x65e3('0x38')]};return db[_0x65e3('0x29')][_0x65e3('0x1c')](_0x2b2daa)['then'](function(_0x9e85f4){_0x21e7a5[_0x65e3('0x1c')]=_0x9e85f4;if(_0x1740d3[_0x65e3('0x2f')][_0x65e3('0x3c')]){_0x273b82[_0x65e3('0x3d')]=[{'all':!![]}];}return db[_0x65e3('0x29')][_0x65e3('0x3e')](_0x273b82);})['then'](function(_0x33b12f){_0x21e7a5['rows']=_0x33b12f;return _0x21e7a5;})[_0x65e3('0x25')](respondWithFilteredResult(_0x3fc461,_0x273b82))[_0x65e3('0x3f')](handleError(_0x3fc461,null));};exports[_0x65e3('0x40')]=function(_0x28638c,_0x2461c5){var _0x5d5af0={'raw':!![],'where':{'id':_0x28638c[_0x65e3('0x41')]['id']}},_0x48176b={};_0x48176b[_0x65e3('0x2e')]=_['keys'](db[_0x65e3('0x29')]['rawAttributes']);_0x48176b['query']=_[_0x65e3('0x30')](_0x28638c[_0x65e3('0x2f')]);_0x48176b['filters']=_[_0x65e3('0x33')](_0x48176b[_0x65e3('0x2e')],_0x48176b['query']);_0x5d5af0['attributes']=_[_0x65e3('0x33')](_0x48176b[_0x65e3('0x2e')],qs['fields'](_0x28638c['query'][_0x65e3('0x34')]));_0x5d5af0[_0x65e3('0x32')]=_0x5d5af0['attributes']['length']?_0x5d5af0['attributes']:_0x48176b[_0x65e3('0x2e')];if(_0x28638c[_0x65e3('0x2f')][_0x65e3('0x3c')]){_0x5d5af0[_0x65e3('0x3d')]=[{'all':!![]}];}_0x5d5af0=_['merge']({},_0x5d5af0,_0x28638c[_0x65e3('0x3b')]);return db[_0x65e3('0x29')][_0x65e3('0x42')](_0x5d5af0)[_0x65e3('0x25')](handleEntityNotFound(_0x2461c5,null))[_0x65e3('0x25')](respondWithResult(_0x2461c5,null))[_0x65e3('0x3f')](handleError(_0x2461c5,null));};exports[_0x65e3('0x43')]=function(_0xf91bb4,_0x37c3ee){return db['WhatsappTransferReport'][_0x65e3('0x43')](_0xf91bb4['body'],{})[_0x65e3('0x25')](respondWithResult(_0x37c3ee,0xc9))[_0x65e3('0x3f')](handleError(_0x37c3ee,null));};exports[_0x65e3('0x24')]=function(_0x17308b,_0x593edb){if(_0x17308b[_0x65e3('0x44')]['id']){delete _0x17308b[_0x65e3('0x44')]['id'];}return db[_0x65e3('0x29')][_0x65e3('0x42')]({'where':{'id':_0x17308b[_0x65e3('0x41')]['id']}})[_0x65e3('0x25')](handleEntityNotFound(_0x593edb,null))[_0x65e3('0x25')](saveUpdates(_0x17308b['body'],null))[_0x65e3('0x25')](respondWithResult(_0x593edb,null))[_0x65e3('0x3f')](handleError(_0x593edb,null));};exports[_0x65e3('0x26')]=function(_0x3313e9,_0x201758){return db[_0x65e3('0x29')][_0x65e3('0x42')]({'where':{'id':_0x3313e9['params']['id']}})['then'](handleEntityNotFound(_0x201758,null))[_0x65e3('0x25')](removeEntity(_0x201758,null))[_0x65e3('0x3f')](handleError(_0x201758,null));};exports[_0x65e3('0x45')]=function(_0x304e82,_0x958baa){return db[_0x65e3('0x29')][_0x65e3('0x45')]()[_0x65e3('0x25')](respondWithResult(_0x958baa,null))[_0x65e3('0x3f')](handleError(_0x958baa,null));}; \ No newline at end of file +var _0x0e08=['error','stack','name','WhatsappTransferReport','rawAttributes','fieldName','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','includeAll','findAll','catch','show','params','keys','include','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus'];(function(_0x5e87f2,_0x4c8f60){var _0x25ecbf=function(_0x9b8b9f){while(--_0x9b8b9f){_0x5e87f2['push'](_0x5e87f2['shift']());}};_0x25ecbf(++_0x4c8f60);}(_0x0e08,0x18e));var _0x80e0=function(_0x52fe48,_0x208ea7){_0x52fe48=_0x52fe48-0x0;var _0x3da651=_0x0e08[_0x52fe48];return _0x3da651;};'use strict';var emlformat=require(_0x80e0('0x0'));var rimraf=require(_0x80e0('0x1'));var zipdir=require(_0x80e0('0x2'));var jsonpatch=require(_0x80e0('0x3'));var rp=require(_0x80e0('0x4'));var moment=require(_0x80e0('0x5'));var BPromise=require(_0x80e0('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x80e0('0x7'));var sox=require(_0x80e0('0x8'));var csv=require('to-csv');var ejs=require(_0x80e0('0x9'));var fs=require('fs');var fs_extra=require(_0x80e0('0xa'));var _=require(_0x80e0('0xb'));var squel=require('squel');var crypto=require(_0x80e0('0xc'));var jsforce=require(_0x80e0('0xd'));var deskjs=require(_0x80e0('0xe'));var toCsv=require('to-csv');var querystring=require(_0x80e0('0xf'));var Papa=require(_0x80e0('0x10'));var Redis=require(_0x80e0('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x80e0('0x12'));var as=require(_0x80e0('0x13'));var hardwareService=require(_0x80e0('0x14'));var logger=require('../../config/logger')(_0x80e0('0x15'));var utils=require(_0x80e0('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x80e0('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x38bc2e,_0x1e038c){_0x1e038c=_0x1e038c||0xcc;return function(_0xb69720){if(_0xb69720){return _0x38bc2e['sendStatus'](_0x1e038c);}return _0x38bc2e[_0x80e0('0x18')](_0x1e038c)[_0x80e0('0x19')]();};}function respondWithResult(_0x5a26bd,_0x5e6fdf){_0x5e6fdf=_0x5e6fdf||0xc8;return function(_0x53effd){if(_0x53effd){return _0x5a26bd['status'](_0x5e6fdf)[_0x80e0('0x1a')](_0x53effd);}};}function respondWithFilteredResult(_0x52d3f4,_0xc90791){return function(_0x5a72bd){if(_0x5a72bd){var _0x452e78=typeof _0xc90791[_0x80e0('0x1b')]===_0x80e0('0x1c')&&typeof _0xc90791['limit']===_0x80e0('0x1c');var _0x3fe88e=_0x5a72bd[_0x80e0('0x1d')];var _0x2483d3=_0x452e78?0x0:_0xc90791[_0x80e0('0x1b')];var _0x1b48e0=_0x452e78?_0x5a72bd[_0x80e0('0x1d')]:_0xc90791[_0x80e0('0x1b')]+_0xc90791[_0x80e0('0x1e')];var _0x1e15ae;if(_0x1b48e0>=_0x3fe88e){_0x1b48e0=_0x3fe88e;_0x1e15ae=0xc8;}else{_0x1e15ae=0xce;}_0x52d3f4['status'](_0x1e15ae);return _0x52d3f4[_0x80e0('0x1f')](_0x80e0('0x20'),_0x2483d3+'-'+_0x1b48e0+'/'+_0x3fe88e)[_0x80e0('0x1a')](_0x5a72bd);}return null;};}function patchUpdates(_0x1fdc21){return function(_0x2f1ef6){try{jsonpatch[_0x80e0('0x21')](_0x2f1ef6,_0x1fdc21,!![]);}catch(_0x5e7140){return BPromise[_0x80e0('0x22')](_0x5e7140);}return _0x2f1ef6[_0x80e0('0x23')]();};}function saveUpdates(_0x1cefff,_0x3558d0){return function(_0xad5ea9){if(_0xad5ea9){return _0xad5ea9[_0x80e0('0x24')](_0x1cefff)[_0x80e0('0x25')](function(_0x1dd823){return _0x1dd823;});}return null;};}function removeEntity(_0x718402,_0x1515db){return function(_0x3bd986){if(_0x3bd986){return _0x3bd986[_0x80e0('0x26')]()[_0x80e0('0x25')](function(){_0x718402['status'](0xcc)[_0x80e0('0x19')]();});}};}function handleEntityNotFound(_0x2c344d,_0x33c7aa){return function(_0x4505f7){if(!_0x4505f7){_0x2c344d[_0x80e0('0x27')](0x194);}return _0x4505f7;};}function handleError(_0x147c6f,_0x5dcc1a){_0x5dcc1a=_0x5dcc1a||0x1f4;return function(_0x36a58f){logger[_0x80e0('0x28')](_0x36a58f[_0x80e0('0x29')]);if(_0x36a58f[_0x80e0('0x2a')]){delete _0x36a58f[_0x80e0('0x2a')];}_0x147c6f[_0x80e0('0x18')](_0x5dcc1a)['send'](_0x36a58f);};}exports['index']=function(_0x56c659,_0x50e1ad){var _0x2169fd={},_0xe2d2f0={},_0x2fd02e={'count':0x0,'rows':[]};var _0x504b57=_['map'](db[_0x80e0('0x2b')][_0x80e0('0x2c')],function(_0x551085){return{'name':_0x551085[_0x80e0('0x2d')],'type':_0x551085['type'][_0x80e0('0x2e')]};});_0xe2d2f0[_0x80e0('0x2f')]=_[_0x80e0('0x30')](_0x504b57,_0x80e0('0x2a'));_0xe2d2f0['query']=_['keys'](_0x56c659[_0x80e0('0x31')]);_0xe2d2f0['filters']=_[_0x80e0('0x32')](_0xe2d2f0[_0x80e0('0x2f')],_0xe2d2f0['query']);_0x2169fd[_0x80e0('0x33')]=_[_0x80e0('0x32')](_0xe2d2f0[_0x80e0('0x2f')],qs[_0x80e0('0x34')](_0x56c659[_0x80e0('0x31')][_0x80e0('0x34')]));_0x2169fd[_0x80e0('0x33')]=_0x2169fd[_0x80e0('0x33')][_0x80e0('0x35')]?_0x2169fd[_0x80e0('0x33')]:_0xe2d2f0[_0x80e0('0x2f')];if(!_0x56c659['query'][_0x80e0('0x36')](_0x80e0('0x37'))){_0x2169fd[_0x80e0('0x1e')]=qs[_0x80e0('0x1e')](_0x56c659['query'][_0x80e0('0x1e')]);_0x2169fd[_0x80e0('0x1b')]=qs[_0x80e0('0x1b')](_0x56c659[_0x80e0('0x31')]['offset']);}_0x2169fd[_0x80e0('0x38')]=qs[_0x80e0('0x39')](_0x56c659[_0x80e0('0x31')][_0x80e0('0x39')]);_0x2169fd[_0x80e0('0x3a')]=qs['filters'](_['pick'](_0x56c659[_0x80e0('0x31')],_0xe2d2f0['filters']),_0x504b57);if(_0x56c659[_0x80e0('0x31')][_0x80e0('0x3b')]){_0x2169fd[_0x80e0('0x3a')]=_[_0x80e0('0x3c')](_0x2169fd[_0x80e0('0x3a')],{'$or':_['map'](_0x504b57,function(_0x1075af){if(_0x1075af[_0x80e0('0x3d')]!=='VIRTUAL'){var _0x36fb01={};_0x36fb01[_0x1075af['name']]={'$like':'%'+_0x56c659[_0x80e0('0x31')][_0x80e0('0x3b')]+'%'};return _0x36fb01;}})});}_0x2169fd=_[_0x80e0('0x3c')]({},_0x2169fd,_0x56c659['options']);var _0x1911db={'where':_0x2169fd['where']};return db[_0x80e0('0x2b')]['count'](_0x1911db)[_0x80e0('0x25')](function(_0x5f356b){_0x2fd02e['count']=_0x5f356b;if(_0x56c659['query'][_0x80e0('0x3e')]){_0x2169fd['include']=[{'all':!![]}];}return db['WhatsappTransferReport'][_0x80e0('0x3f')](_0x2169fd);})[_0x80e0('0x25')](function(_0x4735aa){_0x2fd02e['rows']=_0x4735aa;return _0x2fd02e;})[_0x80e0('0x25')](respondWithFilteredResult(_0x50e1ad,_0x2169fd))[_0x80e0('0x40')](handleError(_0x50e1ad,null));};exports[_0x80e0('0x41')]=function(_0x37ef41,_0x4ac82b){var _0x4e8983={'raw':!![],'where':{'id':_0x37ef41[_0x80e0('0x42')]['id']}},_0x32975c={};_0x32975c[_0x80e0('0x2f')]=_['keys'](db[_0x80e0('0x2b')][_0x80e0('0x2c')]);_0x32975c[_0x80e0('0x31')]=_[_0x80e0('0x43')](_0x37ef41[_0x80e0('0x31')]);_0x32975c['filters']=_[_0x80e0('0x32')](_0x32975c['model'],_0x32975c[_0x80e0('0x31')]);_0x4e8983[_0x80e0('0x33')]=_[_0x80e0('0x32')](_0x32975c[_0x80e0('0x2f')],qs['fields'](_0x37ef41['query'][_0x80e0('0x34')]));_0x4e8983['attributes']=_0x4e8983['attributes'][_0x80e0('0x35')]?_0x4e8983[_0x80e0('0x33')]:_0x32975c[_0x80e0('0x2f')];if(_0x37ef41[_0x80e0('0x31')][_0x80e0('0x3e')]){_0x4e8983[_0x80e0('0x44')]=[{'all':!![]}];}_0x4e8983=_[_0x80e0('0x3c')]({},_0x4e8983,_0x37ef41[_0x80e0('0x45')]);return db[_0x80e0('0x2b')][_0x80e0('0x46')](_0x4e8983)['then'](handleEntityNotFound(_0x4ac82b,null))[_0x80e0('0x25')](respondWithResult(_0x4ac82b,null))[_0x80e0('0x40')](handleError(_0x4ac82b,null));};exports[_0x80e0('0x47')]=function(_0x485f0b,_0x5e794c){return db['WhatsappTransferReport']['create'](_0x485f0b['body'],{})[_0x80e0('0x25')](respondWithResult(_0x5e794c,0xc9))[_0x80e0('0x40')](handleError(_0x5e794c,null));};exports[_0x80e0('0x24')]=function(_0x254116,_0x36e0c1){if(_0x254116['body']['id']){delete _0x254116[_0x80e0('0x48')]['id'];}return db[_0x80e0('0x2b')]['find']({'where':{'id':_0x254116[_0x80e0('0x42')]['id']}})['then'](handleEntityNotFound(_0x36e0c1,null))[_0x80e0('0x25')](saveUpdates(_0x254116[_0x80e0('0x48')],null))[_0x80e0('0x25')](respondWithResult(_0x36e0c1,null))[_0x80e0('0x40')](handleError(_0x36e0c1,null));};exports[_0x80e0('0x26')]=function(_0x1d48a7,_0x3982a0){return db[_0x80e0('0x2b')][_0x80e0('0x46')]({'where':{'id':_0x1d48a7[_0x80e0('0x42')]['id']}})[_0x80e0('0x25')](handleEntityNotFound(_0x3982a0,null))[_0x80e0('0x25')](removeEntity(_0x3982a0,null))[_0x80e0('0x40')](handleError(_0x3982a0,null));};exports['describe']=function(_0x5e97d4,_0x30d0a4){return db[_0x80e0('0x2b')]['describe']()[_0x80e0('0x25')](respondWithResult(_0x30d0a4,null))[_0x80e0('0x40')](handleError(_0x30d0a4,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 9f9f5a4..ea0f630 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 _0xad64=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','WhatsappTransferReport','uniqueid','lodash'];(function(_0x2f9851,_0x112453){var _0x1f9875=function(_0x4a47a0){while(--_0x4a47a0){_0x2f9851['push'](_0x2f9851['shift']());}};_0x1f9875(++_0x112453);}(_0xad64,0x103));var _0x4ad6=function(_0x3a8551,_0x4c3a72){_0x3a8551=_0x3a8551-0x0;var _0x38fdb7=_0xad64[_0x3a8551];return _0x38fdb7;};'use strict';var _=require(_0x4ad6('0x0'));var util=require('util');var logger=require(_0x4ad6('0x1'))(_0x4ad6('0x2'));var moment=require('moment');var BPromise=require(_0x4ad6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4ad6('0x4'));var rimraf=require(_0x4ad6('0x5'));var config=require(_0x4ad6('0x6'));var attributes=require('./whatsappTransferReport.attributes');module[_0x4ad6('0x7')]=function(_0x384aed,_0x354d5a){return _0x384aed['define'](_0x4ad6('0x8'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0x4ad6('0x9'),'fields':[_0x4ad6('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4da4=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','report_whatsapp_transfer','uniqueid','util'];(function(_0x1e129a,_0x4bfa91){var _0x595d15=function(_0x116179){while(--_0x116179){_0x1e129a['push'](_0x1e129a['shift']());}};_0x595d15(++_0x4bfa91);}(_0x4da4,0xa9));var _0x44da=function(_0x2f71f6,_0x3a1f4d){_0x2f71f6=_0x2f71f6-0x0;var _0x2b23ea=_0x4da4[_0x2f71f6];return _0x2b23ea;};'use strict';var _=require('lodash');var util=require(_0x44da('0x0'));var logger=require(_0x44da('0x1'))('api');var moment=require('moment');var BPromise=require(_0x44da('0x2'));var rp=require(_0x44da('0x3'));var fs=require('fs');var path=require(_0x44da('0x4'));var rimraf=require(_0x44da('0x5'));var config=require(_0x44da('0x6'));var attributes=require('./whatsappTransferReport.attributes');module[_0x44da('0x7')]=function(_0x40bb60,_0x24f7ef){return _0x40bb60['define']('WhatsappTransferReport',attributes,{'tableName':_0x44da('0x8'),'paranoid':![],'indexes':[{'name':_0x44da('0x9'),'fields':[_0x44da('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index b22ce5e..a7cbbb6 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 _0xc145=['error','WhatsappTransferReport,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x459a0a,_0x25c46f){var _0x4ab46c=function(_0x451a6a){while(--_0x451a6a){_0x459a0a['push'](_0x459a0a['shift']());}};_0x4ab46c(++_0x25c46f);}(_0xc145,0x94));var _0x5c14=function(_0x17b104,_0x3d5b67){_0x17b104=_0x17b104-0x0;var _0x1f7f00=_0xc145[_0x17b104];return _0x1f7f00;};'use strict';var _=require(_0x5c14('0x0'));var util=require(_0x5c14('0x1'));var moment=require(_0x5c14('0x2'));var BPromise=require(_0x5c14('0x3'));var rs=require(_0x5c14('0x4'));var fs=require('fs');var Redis=require(_0x5c14('0x5'));var db=require(_0x5c14('0x6'))['db'];var utils=require(_0x5c14('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x5c14('0x8'));var jayson=require(_0x5c14('0x9'));var client=jayson[_0x5c14('0xa')][_0x5c14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47ec91,_0x34d748,_0x5f27ad){return new BPromise(function(_0x3eaa27,_0x4c3f3f){return client[_0x5c14('0xc')](_0x47ec91,_0x5f27ad)[_0x5c14('0xd')](function(_0x104569){logger[_0x5c14('0xe')]('WhatsappTransferReport,\x20%s,\x20%s',_0x34d748,_0x5c14('0xf'));logger[_0x5c14('0x10')](_0x5c14('0x11'),_0x34d748,_0x5c14('0xf'),JSON[_0x5c14('0x12')](_0x104569));if(_0x104569['error']){if(_0x104569['error'][_0x5c14('0x13')]===0x1f4){logger[_0x5c14('0x14')](_0x5c14('0x15'),_0x34d748,_0x104569[_0x5c14('0x14')][_0x5c14('0x16')]);return _0x4c3f3f(_0x104569[_0x5c14('0x14')][_0x5c14('0x16')]);}logger[_0x5c14('0x14')]('WhatsappTransferReport,\x20%s,\x20%s',_0x34d748,_0x104569[_0x5c14('0x14')][_0x5c14('0x16')]);return _0x3eaa27(_0x104569[_0x5c14('0x14')][_0x5c14('0x16')]);}else{logger[_0x5c14('0xe')](_0x5c14('0x15'),_0x34d748,'request\x20sent');_0x3eaa27(_0x104569['result'][_0x5c14('0x16')]);}})[_0x5c14('0x17')](function(_0x5b334d){logger[_0x5c14('0x14')](_0x5c14('0x15'),_0x34d748,_0x5b334d);_0x4c3f3f(_0x5b334d);});});} \ No newline at end of file +var _0x93a8=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4077bf,_0x13a740){var _0x56e90d=function(_0x512440){while(--_0x512440){_0x4077bf['push'](_0x4077bf['shift']());}};_0x56e90d(++_0x13a740);}(_0x93a8,0x64));var _0x893a=function(_0x5c88b0,_0x52b3cf){_0x5c88b0=_0x5c88b0-0x0;var _0x2d5b54=_0x93a8[_0x5c88b0];return _0x2d5b54;};'use strict';var _=require(_0x893a('0x0'));var util=require(_0x893a('0x1'));var moment=require(_0x893a('0x2'));var BPromise=require(_0x893a('0x3'));var rs=require(_0x893a('0x4'));var fs=require('fs');var Redis=require(_0x893a('0x5'));var db=require(_0x893a('0x6'))['db'];var utils=require(_0x893a('0x7'));var logger=require('../../config/logger')(_0x893a('0x8'));var config=require(_0x893a('0x9'));var jayson=require(_0x893a('0xa'));var client=jayson[_0x893a('0xb')][_0x893a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x58d7ee,_0x42930e,_0x5e6bc7){return new BPromise(function(_0x4a50fa,_0x1e4bfe){return client['request'](_0x58d7ee,_0x5e6bc7)[_0x893a('0xd')](function(_0x5ccae9){logger[_0x893a('0xe')](_0x893a('0xf'),_0x42930e,_0x893a('0x10'));logger['debug'](_0x893a('0x11'),_0x42930e,_0x893a('0x10'),JSON[_0x893a('0x12')](_0x5ccae9));if(_0x5ccae9[_0x893a('0x13')]){if(_0x5ccae9[_0x893a('0x13')][_0x893a('0x14')]===0x1f4){logger[_0x893a('0x13')](_0x893a('0xf'),_0x42930e,_0x5ccae9['error']['message']);return _0x1e4bfe(_0x5ccae9[_0x893a('0x13')]['message']);}logger[_0x893a('0x13')](_0x893a('0xf'),_0x42930e,_0x5ccae9[_0x893a('0x13')][_0x893a('0x15')]);return _0x4a50fa(_0x5ccae9['error']['message']);}else{logger['info'](_0x893a('0xf'),_0x42930e,_0x893a('0x10'));_0x4a50fa(_0x5ccae9[_0x893a('0x16')][_0x893a('0x15')]);}})[_0x893a('0x17')](function(_0x416da2){logger[_0x893a('0x13')](_0x893a('0xf'),_0x42930e,_0x416da2);_0x1e4bfe(_0x416da2);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index c38feb4..5686bae 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6b8f=['online','join','status','None','log','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./mysqldb','./config/license','./config/logger','app','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','default','then','listen','info','start','filter','exitCode','number','length','name'];(function(_0x56df6c,_0x434ff3){var _0x1911b2=function(_0xc7c90e){while(--_0xc7c90e){_0x56df6c['push'](_0x56df6c['shift']());}};_0x1911b2(++_0x434ff3);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x27ffaa,_0x46a6eb){_0x27ffaa=_0x27ffaa-0x0;var _0x6f79d0=_0x6b8f[_0x27ffaa];return _0x6f79d0;};'use strict';var _=require('lodash');var db=require(_0xf6b8('0x0'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0xf6b8('0x1'));var rpc=require('./rpc');var config=require('./config/environment');var logger=require(_0xf6b8('0x2'))(_0xf6b8('0x3'));var pm2=require('./config/pm2');var pm2Config=require(_0xf6b8('0x4'));var schedule=require(_0xf6b8('0x5'));var chat=require(_0xf6b8('0x6'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0xf6b8('0x7'));var provider=require(_0xf6b8('0x8'));function main(){return db[_0xf6b8('0x9')][_0xf6b8('0xa')]()['then'](function(){if(config['seedDB']){return seedDb[_0xf6b8('0xb')]();}})['then'](function(){return checkLicense[_0xf6b8('0xb')]();})[_0xf6b8('0xc')](function(){return rpc[_0xf6b8('0xd')]();})[_0xf6b8('0xc')](function(_0x21734d){logger[_0xf6b8('0xe')](_0x21734d);return chat['start']();})['then'](function(){return whatsapp['start']();})[_0xf6b8('0xc')](function(){return schedule[_0xf6b8('0xf')]();})[_0xf6b8('0xc')](function(){return transcribe[_0xf6b8('0xf')]();})['then'](function(){return provider['start']();})[_0xf6b8('0xc')](function(_0x3899a9){logger['info'](_0x3899a9);return pm2[_0xf6b8('0xf')](pm2Config);})[_0xf6b8('0xc')](function(_0x454d8a){var _0x59bfed=_0x454d8a[_0xf6b8('0x10')](function(_0x53d744){return typeof _0x53d744[_0xf6b8('0x11')]===_0xf6b8('0x12')&&_0x53d744[_0xf6b8('0x11')]>=0x0;});if(_0x59bfed[_0xf6b8('0x13')]>0x0){throw new Error(_0x59bfed[_0xf6b8('0x13')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_['map'](_0x59bfed,function(_0x3bb9ae){return'\x22'+_0x3bb9ae['pm2_env'][_0xf6b8('0x14')]+'\x22';}));}logger[_0xf6b8('0xe')]('Online\x20apps:',_['map'](_[_0xf6b8('0x10')](_0x454d8a,{'status':_0xf6b8('0x15')}),_0xf6b8('0x14'))[_0xf6b8('0x16')]());logger['info']('Offline\x20apps:',_['map'](_[_0xf6b8('0x10')](_0x454d8a,function(_0x2a8195){return _0x2a8195[_0xf6b8('0x17')]!=='online';}),_0xf6b8('0x14'))[_0xf6b8('0x16')]()||_0xf6b8('0x18'));console[_0xf6b8('0x19')]('App\x20Ready!');})[_0xf6b8('0x1a')](function(_0x5c92ed){console[_0xf6b8('0x19')](_0xf6b8('0x1b'),_0x5c92ed);logger[_0xf6b8('0x1c')](_0xf6b8('0x1d'),_0x5c92ed);process[_0xf6b8('0x1e')](0x1);});}main(); \ No newline at end of file +var _0xbf25=['./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2/config','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/cloud-provider','sequelize','sync','seedDB','default','then','listen','info','start','filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','name','Online\x20apps:','join','Offline\x20apps:','status','online','None','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash'];(function(_0x38d0dd,_0x4b164b){var _0x2a8bc4=function(_0x12f6e5){while(--_0x12f6e5){_0x38d0dd['push'](_0x38d0dd['shift']());}};_0x2a8bc4(++_0x4b164b);}(_0xbf25,0x15e));var _0x5bf2=function(_0x264590,_0x1d2f28){_0x264590=_0x264590-0x0;var _0x46b3e4=_0xbf25[_0x264590];return _0x46b3e4;};'use strict';var _=require(_0x5bf2('0x0'));var db=require('./mysqldb')['db'];var seedDb=require(_0x5bf2('0x1'));var checkLicense=require(_0x5bf2('0x2'));var rpc=require(_0x5bf2('0x3'));var config=require(_0x5bf2('0x4'));var logger=require(_0x5bf2('0x5'))(_0x5bf2('0x6'));var pm2=require('./config/pm2');var pm2Config=require(_0x5bf2('0x7'));var schedule=require('./config/schedule');var chat=require(_0x5bf2('0x8'));var whatsapp=require(_0x5bf2('0x9'));var transcribe=require('./config/schedule/transcribe');var provider=require(_0x5bf2('0xa'));function main(){return db[_0x5bf2('0xb')][_0x5bf2('0xc')]()['then'](function(){if(config[_0x5bf2('0xd')]){return seedDb[_0x5bf2('0xe')]();}})[_0x5bf2('0xf')](function(){return checkLicense['default']();})[_0x5bf2('0xf')](function(){return rpc[_0x5bf2('0x10')]();})[_0x5bf2('0xf')](function(_0xefe019){logger[_0x5bf2('0x11')](_0xefe019);return chat[_0x5bf2('0x12')]();})[_0x5bf2('0xf')](function(){return whatsapp[_0x5bf2('0x12')]();})[_0x5bf2('0xf')](function(){return schedule[_0x5bf2('0x12')]();})[_0x5bf2('0xf')](function(){return transcribe[_0x5bf2('0x12')]();})[_0x5bf2('0xf')](function(){return provider['start']();})['then'](function(_0x2b2e52){logger[_0x5bf2('0x11')](_0x2b2e52);return pm2['start'](pm2Config);})[_0x5bf2('0xf')](function(_0x43a83b){var _0x1bdb56=_0x43a83b[_0x5bf2('0x13')](function(_0x15abc4){return typeof _0x15abc4[_0x5bf2('0x14')]===_0x5bf2('0x15')&&_0x15abc4[_0x5bf2('0x14')]>=0x0;});if(_0x1bdb56[_0x5bf2('0x16')]>0x0){throw new Error(_0x1bdb56[_0x5bf2('0x16')]+_0x5bf2('0x17')+_[_0x5bf2('0x18')](_0x1bdb56,function(_0x4d1990){return'\x22'+_0x4d1990['pm2_env'][_0x5bf2('0x19')]+'\x22';}));}logger['info'](_0x5bf2('0x1a'),_[_0x5bf2('0x18')](_['filter'](_0x43a83b,{'status':'online'}),_0x5bf2('0x19'))[_0x5bf2('0x1b')]());logger[_0x5bf2('0x11')](_0x5bf2('0x1c'),_[_0x5bf2('0x18')](_[_0x5bf2('0x13')](_0x43a83b,function(_0x3a9694){return _0x3a9694[_0x5bf2('0x1d')]!==_0x5bf2('0x1e');}),'name')['join']()||_0x5bf2('0x1f'));console[_0x5bf2('0x20')](_0x5bf2('0x21'));})[_0x5bf2('0x22')](function(_0x18caac){console[_0x5bf2('0x20')](_0x5bf2('0x23'),_0x18caac);logger[_0x5bf2('0x24')](_0x5bf2('0x25'),_0x18caac);process[_0x5bf2('0x26')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index bd05151..69930f2 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 _0x55ca=['It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','redirect','/dashboards/general','send','isNil','apiKeyIat','generateApiKey','regenerateApiKey','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','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','splice','unshift','encryptString','join','promisify','payload','options','session','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','lodash','jsonwebtoken','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','role','fullname','internal','email','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','allowmessenger','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswerDelay','whatsappAutoanswer','isChatInteractionAuthorized','isAuthenticated','use','user','closed','then','status','disposition','unmanaged','json','Unmanaged.','Forbidden.','headers','authorization','startsWith','User','find','name','authenticate','pass','Wrong\x20credentials.','catch','query','apikey','getUuid','Setting','allowedLoginAttempts','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','blockDuration','add','Invalid\x20API\x20access\x20key','Unknown\x20authorization\x20format','User\x20not\x20found.','canUpdate','update','isWebrtcLicence','getLicense','webrtc','Forbidden','isMiddleware','signToken'];(function(_0x1d723a,_0x4f968e){var _0x14b7ac=function(_0x45601d){while(--_0x45601d){_0x1d723a['push'](_0x1d723a['shift']());}};_0x14b7ac(++_0x4f968e);}(_0x55ca,0x126));var _0xa55c=function(_0x1878db,_0x18d9f6){_0x1878db=_0x1878db-0x0;var _0x1ae242=_0x55ca[_0x1878db];return _0x1ae242;};'use strict';var db=require(_0xa55c('0x0'))['db'];var config=require(_0xa55c('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require('../../config/license/util');var encryptor=require('../encryptor');var _=require(_0xa55c('0x2'));var jwt=require(_0xa55c('0x3'));var expressJwt=require('express-jwt');var compose=require(_0xa55c('0x4'));var basicAuth=require(_0xa55c('0x5'));var crypto=require(_0xa55c('0x6'));var BPromise=require(_0xa55c('0x7'));var util=require(_0xa55c('0x8'));var moment=require(_0xa55c('0x9'));var validateJwt=expressJwt({'secret':config[_0xa55c('0xa')]['session']});var userAttributes=['id',_0xa55c('0xb'),_0xa55c('0xc'),'name',_0xa55c('0xd'),_0xa55c('0xe'),'userpic','permissions',_0xa55c('0xf'),_0xa55c('0x10'),_0xa55c('0x11'),_0xa55c('0x12'),_0xa55c('0x13'),_0xa55c('0x14'),_0xa55c('0x15'),_0xa55c('0x16'),_0xa55c('0x17'),_0xa55c('0x18'),'lastPauseAt','crudPermissions',_0xa55c('0x19'),'passwordResetAt','alias','phoneBarAutoAnswer',_0xa55c('0x1a'),_0xa55c('0x1b'),_0xa55c('0x1c'),_0xa55c('0x1d'),_0xa55c('0x1e'),_0xa55c('0x1f'),'phoneBarPrefixRequired',_0xa55c('0x20'),_0xa55c('0x21'),_0xa55c('0x22'),_0xa55c('0x23'),_0xa55c('0x24'),_0xa55c('0x25'),_0xa55c('0x26'),_0xa55c('0x27'),_0xa55c('0x28'),'downloadOmnichannelInteractions',_0xa55c('0x29'),_0xa55c('0x2a'),_0xa55c('0x2b'),_0xa55c('0x2c'),_0xa55c('0x2d'),_0xa55c('0x2e'),'emailAutoanswerDelay','smsAutoanswer',_0xa55c('0x2f'),_0xa55c('0x30'),_0xa55c('0x31'),'faxAutoanswer',_0xa55c('0x32'),_0xa55c('0x33'),'whatsappAutoanswerDelay'];exports[_0xa55c('0x34')]=function(){return this[_0xa55c('0x35')](!![])[_0xa55c('0x36')](function(_0x1965f1,_0x234372,_0x49ed04){if(_0x1965f1[_0xa55c('0x37')]){_0x49ed04();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x1965f1['params']['id']},'attributes':['id',_0xa55c('0x38'),'disposition'],'raw':!![]})[_0xa55c('0x39')](function(_0x190757){if(_0x190757&&_0x190757[_0xa55c('0x38')]){return _0x234372[_0xa55c('0x3a')](_0x190757[_0xa55c('0x3b')]===_0xa55c('0x3c')?0x195:0x193)[_0xa55c('0x3d')]({'message':_0x190757[_0xa55c('0x3b')]===_0xa55c('0x3c')?_0xa55c('0x3e'):_0xa55c('0x3f')});}else{_0x49ed04();}})['catch'](function(_0x430d55){_0x49ed04(_0x430d55);});}});};exports[_0xa55c('0x35')]=function isAuthenticated(_0x1c9f6b){return compose()[_0xa55c('0x36')](function(_0x5d940d,_0x1377b0,_0x22f6b6){var _0x1b8388;if(_0x5d940d[_0xa55c('0x40')][_0xa55c('0x41')]){if(_[_0xa55c('0x42')](_0x5d940d['headers'][_0xa55c('0x41')],'Basic')){var _0x35c9c2=basicAuth(_0x5d940d);db[_0xa55c('0x43')][_0xa55c('0x44')]({'where':{'name':_0x35c9c2[_0xa55c('0x45')]}})['then'](function(_0x3d28fb){if(!_0x3d28fb||!_0x3d28fb[_0xa55c('0x46')](_0x35c9c2[_0xa55c('0x47')])){return _0x1377b0[_0xa55c('0x3a')](0x191)[_0xa55c('0x3d')]({'message':_0xa55c('0x48')});}_0x5d940d[_0xa55c('0x37')]={'id':_0x3d28fb['id']};_0x22f6b6();})[_0xa55c('0x49')](function(_0x2808e9){_0x22f6b6(_0x2808e9);});}else if(_[_0xa55c('0x42')](_0x5d940d[_0xa55c('0x40')]['authorization'],'Bearer')){validateJwt(_0x5d940d,_0x1377b0,_0x22f6b6);}else{if(_0x1c9f6b){_0x22f6b6();}else{return _0x1377b0[_0xa55c('0x3a')](0x193)[_0xa55c('0x3d')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x5d940d[_0xa55c('0x4a')][_0xa55c('0x4b')]){try{var _0x2e9623={'audience':hardwareConf[_0xa55c('0x4c')](),'issuer':hardwareConf[_0xa55c('0x4c')]()};verifyJwt(_0x5d940d[_0xa55c('0x4a')][_0xa55c('0x4b')],_0x2e9623)[_0xa55c('0x39')](function(_0x3959e3){return db['User']['find']({'where':{'id':_0x3959e3['sub']}})[_0xa55c('0x39')](function(_0x18e00e){_0x1b8388=_0x18e00e;return db[_0xa55c('0x4d')]['findOne']({'where':{'id':0x1},'attributes':[_0xa55c('0x4e'),'blockDuration'],'raw':!![]});})[_0xa55c('0x39')](function(_0x4ad813){if(!_0x1b8388||!_[_0xa55c('0x4f')](_0x1b8388[_0xa55c('0x50')],_0x3959e3[_0xa55c('0x51')])){return _0x1377b0['status'](0x191)[_0xa55c('0x3d')]({'message':_0xa55c('0x52')});}if(_0x1b8388['disabled']){return _0x1377b0[_0xa55c('0x3a')](0x191)[_0xa55c('0x3d')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x1b8388['blocked']){if(_0x4ad813[_0xa55c('0x53')]>0x0){if(moment(_0x1b8388['blockedAt'])[_0xa55c('0x54')](_0x4ad813[_0xa55c('0x53')],'minutes')>moment()){return _0x1377b0['status'](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x1377b0[_0xa55c('0x3a')](0x191)[_0xa55c('0x3d')]({'message':_0xa55c('0x55')});}}_0x5d940d[_0xa55c('0x37')]={'id':_0x1b8388['id']};_0x22f6b6();});})[_0xa55c('0x49')](function(){return _0x1377b0['status'](0x191)[_0xa55c('0x3d')]({'message':_0xa55c('0x55')});});}catch(_0x77d623){_0x22f6b6(_0x77d623);}}else if(_0x1c9f6b){_0x22f6b6();}else{return _0x1377b0[_0xa55c('0x3a')](0x193)[_0xa55c('0x3d')]({'message':_0xa55c('0x56')});}})['use'](function(_0x386e34,_0x5ee63d,_0x57a972){if(_0x386e34[_0xa55c('0x37')]){db[_0xa55c('0x43')]['find']({'where':{'id':_0x386e34[_0xa55c('0x37')]['id']},'attributes':userAttributes})['then'](function(_0x5f25f7){if(!_0x5f25f7){return _0x5ee63d[_0xa55c('0x3a')](0x194)[_0xa55c('0x3d')]({'message':_0xa55c('0x57')});}_0x386e34['user']=_0x5f25f7;_0x57a972();})[_0xa55c('0x49')](function(_0xd5a006){_0x57a972(_0xd5a006);});}else if(_0x1c9f6b){_0x57a972();}else{return _0x5ee63d['status'](0x194)[_0xa55c('0x3d')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0xa55c('0x58')]=function canUpdate(){return compose()[_0xa55c('0x36')](function(_0x5be43f,_0x66d1de,_0x1dae70){return licenseUtil['getLicense']()[_0xa55c('0x39')](function(_0x187e09){if(_0x187e09[_0xa55c('0x59')]){_0x1dae70();}else{return _0x66d1de['status'](0x193)[_0xa55c('0x3d')]({'message':'Forbidden'});}})[_0xa55c('0x49')](function(_0x3a8af4){_0x1dae70(_0x3a8af4);});});};exports[_0xa55c('0x5a')]=function isWebrtcLicence(){return compose()['use'](function(_0x41eab1,_0x106adb,_0x592429){return licenseUtil[_0xa55c('0x5b')]()[_0xa55c('0x39')](function(_0x5d5cf6){if(_0x5d5cf6[_0xa55c('0x5c')]){_0x592429();}else{return _0x106adb[_0xa55c('0x3a')](0x193)['json']({'message':_0xa55c('0x5d')});}})[_0xa55c('0x49')](function(_0x219a68){_0x592429(_0x219a68);});});};exports[_0xa55c('0x5e')]=function(_0x564cb3,_0x143989,_0x58a7ea){_0x564cb3[_0xa55c('0x5e')]=!![];return _0x58a7ea();};exports[_0xa55c('0x5f')]=function signToken(_0x194a79){return signJwt(_0x194a79);};exports['setTokenCookie']=function(_0x39bd3d,_0x250b00){if(!_0x39bd3d['user']){return _0x250b00[_0xa55c('0x3a')](0x194)[_0xa55c('0x3d')]({'message':_0xa55c('0x60')});}var _0xcd78c5={'payload':{'id':_0x39bd3d[_0xa55c('0x37')]['id'],'role':_0x39bd3d[_0xa55c('0x37')][_0xa55c('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0xcd78c5)[_0xa55c('0x39')](function(_0x3c147b){_0x250b00[_0xa55c('0x61')]('motion.token',_0x3c147b);_0x250b00[_0xa55c('0x62')](_0xa55c('0x63'));})[_0xa55c('0x49')](function(_0x4f73b6){return _0x250b00[_0xa55c('0x3a')](0x1f4)[_0xa55c('0x64')](_0x4f73b6);});};exports['retrieveApiKey']=function(_0x21b760){if(_['isNil'](_0x21b760[_0xa55c('0x50')])||_[_0xa55c('0x65')](_0x21b760[_0xa55c('0x66')])){return null;}else{return createJwt(_0x21b760);}};exports[_0xa55c('0x67')]=function(_0x2ecf79){_0x2ecf79['apiKeyNonce']=generateNonce();_0x2ecf79[_0xa55c('0x66')]=generateIssuedAt();return createJwt(_0x2ecf79);};exports[_0xa55c('0x68')]=function(_0x4b85cc,_0x3929a6){var _0x2291e0=_0x4b85cc[_0xa55c('0x4a')][_0xa55c('0x4b')];if(_0x2291e0){var _0x50176b={'nonce':_0x3929a6['apiKeyNonce'],'iat':_0x3929a6[_0xa55c('0x66')],'audience':hardwareConf[_0xa55c('0x4c')](),'issuer':hardwareConf[_0xa55c('0x4c')]()};return verifyJwt(_0x2291e0,_0x50176b)[_0xa55c('0x39')](function(){return generateApiKey(_0x3929a6);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0xa55c('0x69')]=function(_0x5ce463){var _0x2742e4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x2742e4[_0xa55c('0x6a')](_0x5ce463))throw new db[(_0xa55c('0x6b'))][(_0xa55c('0x6c'))](_0xa55c('0x6d'));return;};exports['validatePasswordHistory']=function(_0x1cb73b,_0x54f776,_0x23f67f){var _0x157afe=encryptor[_0xa55c('0x6e')](_0x54f776)[_0xa55c('0x6f')](',');for(var _0x19aaf5=0x0;_0x19aaf5<_0x23f67f;_0x19aaf5++){if(!_0x157afe[_0x19aaf5])break;if(_0x1cb73b[_0xa55c('0x70')]()===_0x157afe[_0x19aaf5][_0xa55c('0x70')]()){var _0x53e2be=util[_0xa55c('0x71')](_0xa55c('0x72'),_0x23f67f);if(_0x23f67f===0x1){_0x53e2be=_0xa55c('0x73');}throw new db[(_0xa55c('0x6b'))][(_0xa55c('0x6c'))](_0x53e2be);}}return;};exports['updatePasswordsHistory']=function(_0xa72718,_0x3cd40d){var _0x28bac4=_0x3cd40d?encryptor[_0xa55c('0x6e')](_0x3cd40d)[_0xa55c('0x6f')](','):[];if(_0x28bac4['length']===0x5){_0x28bac4[_0xa55c('0x74')](-0x1,0x1);}_0x28bac4[_0xa55c('0x75')](_0xa72718);return encryptor[_0xa55c('0x76')](_0x28bac4[_0xa55c('0x77')](','));};function signJwt(_0x3ba56d){var _0x480dfc=BPromise[_0xa55c('0x78')](jwt['sign'],{'context':jwt});var _0x2e482a=_0x3ba56d['secret']||config[_0xa55c('0xa')]['session'];return new BPromise(function(_0x34edc5,_0x1333da){_0x480dfc(_0x3ba56d[_0xa55c('0x79')],_0x2e482a,_0x3ba56d[_0xa55c('0x7a')])[_0xa55c('0x39')](function(_0x3a5a52){_0x34edc5(_0x3a5a52);})[_0xa55c('0x49')](function(_0x2f2226){_0x1333da(_0x2f2226);});});}function verifyJwt(_0x14b515,_0x1acf50,_0x51c736){var _0x150a07=BPromise[_0xa55c('0x78')](jwt['verify'],{'context':jwt});var _0x18b928=_0x51c736||config[_0xa55c('0xa')][_0xa55c('0x7b')];return new BPromise(function(_0x9fe234,_0x1b8b06){_0x150a07(_0x14b515,_0x18b928,_0x1acf50)[_0xa55c('0x39')](function(_0x3cef1f){_0x9fe234(_0x3cef1f);})[_0xa55c('0x49')](function(_0x47de0a){_0x1b8b06(_0x47de0a);});});}function generateNonce(){return crypto[_0xa55c('0x7c')](0x10)[_0xa55c('0x7d')](_0xa55c('0x7e'));}function generateIssuedAt(){return Math[_0xa55c('0x7f')](Date[_0xa55c('0x80')]()/0x3e8)[_0xa55c('0x7d')]();}function createJwt(_0x2f1237){var _0x4249c1={'payload':{'iat':_0x2f1237[_0xa55c('0x66')],'nonce':_0x2f1237['apiKeyNonce']},'options':{'algorithm':_0xa55c('0x81'),'subject':_0x2f1237['id'][_0xa55c('0x7d')](),'issuer':hardwareConf[_0xa55c('0x4c')](),'audience':hardwareConf[_0xa55c('0x4c')]()}};return signJwt(_0x4249c1)[_0xa55c('0x39')](function(_0x10e711){return{'iat':_0x2f1237[_0xa55c('0x66')],'nonce':_0x2f1237[_0xa55c('0x50')],'token':_0x10e711};});} \ No newline at end of file +var _0x9bde=['whatsappAutoanswerDelay','isChatInteractionAuthorized','use','user','ChatInteraction','params','closed','disposition','then','status','unmanaged','Forbidden.','catch','isAuthenticated','headers','authorization','startsWith','User','find','authenticate','pass','json','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','findOne','blockDuration','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blocked','blockedAt','add','minutes','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','isWebrtcLicence','webrtc','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','redirect','send','isNil','generateApiKey','regenerateApiKey','apiKeyIat','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','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','unshift','encryptString','join','sign','secret','payload','options','promisify','verify','randomBytes','toString','hex','floor','now','HS512','../../config/environment','../../config/license/util','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','moment','secrets','session','role','fullname','name','internal','email','userpic','permissions','chatPause','mailPause','faxPause','openchannelPause','pauseType','showWebBar','lastLoginAt','crudPermissions','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','selectRecallMeCampaign','chatAutoanswerDelay','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9bde,0xe1));var _0xe9bd=function(_0x223dc1,_0x1c4eab){_0x223dc1=_0x223dc1-0x0;var _0x4e92ce=_0x9bde[_0x223dc1];return _0x4e92ce;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0xe9bd('0x0'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0xe9bd('0x1'));var encryptor=require('../encryptor');var _=require(_0xe9bd('0x2'));var jwt=require(_0xe9bd('0x3'));var expressJwt=require(_0xe9bd('0x4'));var compose=require(_0xe9bd('0x5'));var basicAuth=require(_0xe9bd('0x6'));var crypto=require(_0xe9bd('0x7'));var BPromise=require(_0xe9bd('0x8'));var util=require('util');var moment=require(_0xe9bd('0x9'));var validateJwt=expressJwt({'secret':config[_0xe9bd('0xa')][_0xe9bd('0xb')]});var userAttributes=['id',_0xe9bd('0xc'),_0xe9bd('0xd'),_0xe9bd('0xe'),_0xe9bd('0xf'),_0xe9bd('0x10'),_0xe9bd('0x11'),_0xe9bd('0x12'),'md5secret','voicePause',_0xe9bd('0x13'),_0xe9bd('0x14'),_0xe9bd('0x15'),'smsPause',_0xe9bd('0x16'),_0xe9bd('0x17'),_0xe9bd('0x18'),_0xe9bd('0x19'),'lastPauseAt',_0xe9bd('0x1a'),'allowmessenger',_0xe9bd('0x1b'),_0xe9bd('0x1c'),_0xe9bd('0x1d'),'phoneBarAutoAnswerDelay','phoneBarDnd',_0xe9bd('0x1e'),_0xe9bd('0x1f'),_0xe9bd('0x20'),_0xe9bd('0x21'),_0xe9bd('0x22'),_0xe9bd('0x23'),_0xe9bd('0x24'),'hotdesk',_0xe9bd('0x25'),_0xe9bd('0x26'),_0xe9bd('0x27'),'settingsEnabled',_0xe9bd('0x28'),_0xe9bd('0x29'),_0xe9bd('0x2a'),_0xe9bd('0x2b'),'ignorePauseForPreviewCalls',_0xe9bd('0x2c'),'chatAutoanswer',_0xe9bd('0x2d'),'emailAutoanswer',_0xe9bd('0x2e'),_0xe9bd('0x2f'),_0xe9bd('0x30'),_0xe9bd('0x31'),_0xe9bd('0x32'),_0xe9bd('0x33'),_0xe9bd('0x34'),'whatsappAutoanswer',_0xe9bd('0x35')];exports[_0xe9bd('0x36')]=function(){return this['isAuthenticated'](!![])[_0xe9bd('0x37')](function(_0x505c23,_0x238ab1,_0x1b9cc9){if(_0x505c23[_0xe9bd('0x38')]){_0x1b9cc9();}else{return db[_0xe9bd('0x39')]['findOne']({'where':{'id':_0x505c23[_0xe9bd('0x3a')]['id']},'attributes':['id',_0xe9bd('0x3b'),_0xe9bd('0x3c')],'raw':!![]})[_0xe9bd('0x3d')](function(_0x2641be){if(_0x2641be&&_0x2641be[_0xe9bd('0x3b')]){return _0x238ab1[_0xe9bd('0x3e')](_0x2641be[_0xe9bd('0x3c')]===_0xe9bd('0x3f')?0x195:0x193)['json']({'message':_0x2641be[_0xe9bd('0x3c')]===_0xe9bd('0x3f')?'Unmanaged.':_0xe9bd('0x40')});}else{_0x1b9cc9();}})[_0xe9bd('0x41')](function(_0x119672){_0x1b9cc9(_0x119672);});}});};exports[_0xe9bd('0x42')]=function isAuthenticated(_0x141b95){return compose()[_0xe9bd('0x37')](function(_0x519f48,_0x5b7f1d,_0x1de54c){var _0x56e409;if(_0x519f48[_0xe9bd('0x43')][_0xe9bd('0x44')]){if(_[_0xe9bd('0x45')](_0x519f48[_0xe9bd('0x43')][_0xe9bd('0x44')],'Basic')){var _0x4b7bc2=basicAuth(_0x519f48);db[_0xe9bd('0x46')][_0xe9bd('0x47')]({'where':{'name':_0x4b7bc2[_0xe9bd('0xe')]}})[_0xe9bd('0x3d')](function(_0xe2436){if(!_0xe2436||!_0xe2436[_0xe9bd('0x48')](_0x4b7bc2[_0xe9bd('0x49')])){return _0x5b7f1d[_0xe9bd('0x3e')](0x191)[_0xe9bd('0x4a')]({'message':'Wrong\x20credentials.'});}_0x519f48[_0xe9bd('0x38')]={'id':_0xe2436['id']};_0x1de54c();})[_0xe9bd('0x41')](function(_0x390a43){_0x1de54c(_0x390a43);});}else if(_['startsWith'](_0x519f48['headers'][_0xe9bd('0x44')],_0xe9bd('0x4b'))){validateJwt(_0x519f48,_0x5b7f1d,_0x1de54c);}else{if(_0x141b95){_0x1de54c();}else{return _0x5b7f1d[_0xe9bd('0x3e')](0x193)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x4c')});}}}else if(_0x519f48[_0xe9bd('0x4d')][_0xe9bd('0x4e')]){try{var _0x1c6173={'audience':hardwareConf[_0xe9bd('0x4f')](),'issuer':hardwareConf[_0xe9bd('0x4f')]()};verifyJwt(_0x519f48[_0xe9bd('0x4d')][_0xe9bd('0x4e')],_0x1c6173)[_0xe9bd('0x3d')](function(_0x199477){return db[_0xe9bd('0x46')][_0xe9bd('0x47')]({'where':{'id':_0x199477[_0xe9bd('0x50')]}})[_0xe9bd('0x3d')](function(_0x4c689d){_0x56e409=_0x4c689d;return db[_0xe9bd('0x51')][_0xe9bd('0x52')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xe9bd('0x53')],'raw':!![]});})[_0xe9bd('0x3d')](function(_0x4c7d47){if(!_0x56e409||!_['isEqual'](_0x56e409[_0xe9bd('0x54')],_0x199477[_0xe9bd('0x55')])){return _0x5b7f1d['status'](0x191)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x56')});}if(_0x56e409[_0xe9bd('0x57')]){return _0x5b7f1d['status'](0x191)[_0xe9bd('0x4a')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x56e409[_0xe9bd('0x58')]){if(_0x4c7d47[_0xe9bd('0x53')]>0x0){if(moment(_0x56e409[_0xe9bd('0x59')])[_0xe9bd('0x5a')](_0x4c7d47['blockDuration'],_0xe9bd('0x5b'))>moment()){return _0x5b7f1d[_0xe9bd('0x3e')](0x191)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x5c')});}}else{return _0x5b7f1d[_0xe9bd('0x3e')](0x191)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x5c')});}}_0x519f48[_0xe9bd('0x38')]={'id':_0x56e409['id']};_0x1de54c();});})[_0xe9bd('0x41')](function(){return _0x5b7f1d[_0xe9bd('0x3e')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0xcf9a0c){_0x1de54c(_0xcf9a0c);}}else if(_0x141b95){_0x1de54c();}else{return _0x5b7f1d['status'](0x193)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x4c')});}})[_0xe9bd('0x37')](function(_0x480797,_0x1ba613,_0x2923cf){if(_0x480797[_0xe9bd('0x38')]){db['User'][_0xe9bd('0x47')]({'where':{'id':_0x480797[_0xe9bd('0x38')]['id']},'attributes':userAttributes})[_0xe9bd('0x3d')](function(_0x388132){if(!_0x388132){return _0x1ba613[_0xe9bd('0x3e')](0x194)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x5d')});}_0x480797[_0xe9bd('0x38')]=_0x388132;_0x2923cf();})[_0xe9bd('0x41')](function(_0x300e07){_0x2923cf(_0x300e07);});}else if(_0x141b95){_0x2923cf();}else{return _0x1ba613[_0xe9bd('0x3e')](0x194)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x5e')});}});};exports[_0xe9bd('0x5f')]=function canUpdate(){return compose()[_0xe9bd('0x37')](function(_0x5b70d3,_0x5a86fd,_0x283e67){return licenseUtil[_0xe9bd('0x60')]()[_0xe9bd('0x3d')](function(_0x58828b){if(_0x58828b['update']){_0x283e67();}else{return _0x5a86fd[_0xe9bd('0x3e')](0x193)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x61')});}})[_0xe9bd('0x41')](function(_0x39fb61){_0x283e67(_0x39fb61);});});};exports[_0xe9bd('0x62')]=function isWebrtcLicence(){return compose()[_0xe9bd('0x37')](function(_0x512899,_0x1e45fc,_0x4cc146){return licenseUtil[_0xe9bd('0x60')]()[_0xe9bd('0x3d')](function(_0x33ba69){if(_0x33ba69[_0xe9bd('0x63')]){_0x4cc146();}else{return _0x1e45fc[_0xe9bd('0x3e')](0x193)['json']({'message':_0xe9bd('0x61')});}})[_0xe9bd('0x41')](function(_0xe14fa4){_0x4cc146(_0xe14fa4);});});};exports['isMiddleware']=function(_0xff4e14,_0x476f23,_0x34f787){_0xff4e14['isMiddleware']=!![];return _0x34f787();};exports[_0xe9bd('0x64')]=function signToken(_0x27e7b0){return signJwt(_0x27e7b0);};exports[_0xe9bd('0x65')]=function(_0x10ec29,_0x1ee09c){if(!_0x10ec29['user']){return _0x1ee09c[_0xe9bd('0x3e')](0x194)['json']({'message':_0xe9bd('0x66')});}var _0x239be9={'payload':{'id':_0x10ec29[_0xe9bd('0x38')]['id'],'role':_0x10ec29[_0xe9bd('0x38')][_0xe9bd('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x239be9)['then'](function(_0x15d1d0){_0x1ee09c['cookie'](_0xe9bd('0x67'),_0x15d1d0);_0x1ee09c[_0xe9bd('0x68')]('/dashboards/general');})['catch'](function(_0x1ce539){return _0x1ee09c['status'](0x1f4)[_0xe9bd('0x69')](_0x1ce539);});};exports['retrieveApiKey']=function(_0x26b25a){if(_[_0xe9bd('0x6a')](_0x26b25a['apiKeyNonce'])||_[_0xe9bd('0x6a')](_0x26b25a['apiKeyIat'])){return null;}else{return createJwt(_0x26b25a);}};exports[_0xe9bd('0x6b')]=function(_0x2d9a94){_0x2d9a94[_0xe9bd('0x54')]=generateNonce();_0x2d9a94['apiKeyIat']=generateIssuedAt();return createJwt(_0x2d9a94);};exports[_0xe9bd('0x6c')]=function(_0x1d703f,_0x45b69e){var _0x232a36=_0x1d703f['query']['apikey'];if(_0x232a36){var _0x441f89={'nonce':_0x45b69e['apiKeyNonce'],'iat':_0x45b69e[_0xe9bd('0x6d')],'audience':hardwareConf[_0xe9bd('0x4f')](),'issuer':hardwareConf[_0xe9bd('0x4f')]()};return verifyJwt(_0x232a36,_0x441f89)[_0xe9bd('0x3d')](function(){return generateApiKey(_0x45b69e);});}else{throw{'message':_0xe9bd('0x6e')};}};exports[_0xe9bd('0x6f')]=function(_0x373057){var _0x3381ee=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3381ee[_0xe9bd('0x70')](_0x373057))throw new db[(_0xe9bd('0x71'))][(_0xe9bd('0x72'))](_0xe9bd('0x73'));return;};exports['validatePasswordHistory']=function(_0x596a7d,_0x566dd8,_0x10e685){var _0x5a516e=encryptor[_0xe9bd('0x74')](_0x566dd8)[_0xe9bd('0x75')](',');for(var _0x90db01=0x0;_0x90db01<_0x10e685;_0x90db01++){if(!_0x5a516e[_0x90db01])break;if(_0x596a7d[_0xe9bd('0x76')]()===_0x5a516e[_0x90db01][_0xe9bd('0x76')]()){var _0xaf6ffd=util[_0xe9bd('0x77')](_0xe9bd('0x78'),_0x10e685);if(_0x10e685===0x1){_0xaf6ffd=_0xe9bd('0x79');}throw new db['Sequelize'][(_0xe9bd('0x72'))](_0xaf6ffd);}}return;};exports[_0xe9bd('0x7a')]=function(_0x3d3e74,_0x3f848d){var _0x4d58c1=_0x3f848d?encryptor[_0xe9bd('0x74')](_0x3f848d)[_0xe9bd('0x75')](','):[];if(_0x4d58c1[_0xe9bd('0x7b')]===0x5){_0x4d58c1['splice'](-0x1,0x1);}_0x4d58c1[_0xe9bd('0x7c')](_0x3d3e74);return encryptor[_0xe9bd('0x7d')](_0x4d58c1[_0xe9bd('0x7e')](','));};function signJwt(_0xfe82f7){var _0x4ee26a=BPromise['promisify'](jwt[_0xe9bd('0x7f')],{'context':jwt});var _0x188891=_0xfe82f7[_0xe9bd('0x80')]||config[_0xe9bd('0xa')]['session'];return new BPromise(function(_0x49add9,_0x305efa){_0x4ee26a(_0xfe82f7[_0xe9bd('0x81')],_0x188891,_0xfe82f7[_0xe9bd('0x82')])[_0xe9bd('0x3d')](function(_0x1fd2b5){_0x49add9(_0x1fd2b5);})[_0xe9bd('0x41')](function(_0x4870f8){_0x305efa(_0x4870f8);});});}function verifyJwt(_0x179c8d,_0x5681ab,_0x27e07c){var _0x28dd03=BPromise[_0xe9bd('0x83')](jwt[_0xe9bd('0x84')],{'context':jwt});var _0x5bc1f8=_0x27e07c||config[_0xe9bd('0xa')][_0xe9bd('0xb')];return new BPromise(function(_0x3b0190,_0x4f35c4){_0x28dd03(_0x179c8d,_0x5bc1f8,_0x5681ab)[_0xe9bd('0x3d')](function(_0x1a9d0c){_0x3b0190(_0x1a9d0c);})[_0xe9bd('0x41')](function(_0x3e3e05){_0x4f35c4(_0x3e3e05);});});}function generateNonce(){return crypto[_0xe9bd('0x85')](0x10)[_0xe9bd('0x86')](_0xe9bd('0x87'));}function generateIssuedAt(){return Math[_0xe9bd('0x88')](Date[_0xe9bd('0x89')]()/0x3e8)[_0xe9bd('0x86')]();}function createJwt(_0x14c599){var _0x37d07a={'payload':{'iat':_0x14c599['apiKeyIat'],'nonce':_0x14c599[_0xe9bd('0x54')]},'options':{'algorithm':_0xe9bd('0x8a'),'subject':_0x14c599['id']['toString'](),'issuer':hardwareConf[_0xe9bd('0x4f')](),'audience':hardwareConf[_0xe9bd('0x4f')]()}};return signJwt(_0x37d07a)['then'](function(_0x561165){return{'iat':_0x14c599[_0xe9bd('0x6d')],'nonce':_0x14c599[_0xe9bd('0x54')],'token':_0x561165};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 2770e87..19083a4 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 _0x9271=['encryptFile','createReadStream','createWriteStream','createCipher','data','update','end','binary','write','close','unlink','decryptFile','createDecipher','final','encryptString','secret','utf8','base64','decryptString','crypto','bluebird','lodash','../../config/environment','../../config/logger','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','test','filter','indexOf','hasOwnProperty'];(function(_0x211fef,_0x4ab716){var _0x5447bf=function(_0x306ea3){while(--_0x306ea3){_0x211fef['push'](_0x211fef['shift']());}};_0x5447bf(++_0x4ab716);}(_0x9271,0x14e));var _0x1927=function(_0x72605a,_0x38e7af){_0x72605a=_0x72605a-0x0;var _0xa36beb=_0x9271[_0x72605a];return _0xa36beb;};'use strict';var crypto=require(_0x1927('0x0'));var fs=require('fs');var BPromise=require(_0x1927('0x1'));var _=require(_0x1927('0x2'));var config=require(_0x1927('0x3'));var logger=require(_0x1927('0x4'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0x1927('0x5')],'algorithm':_0x1927('0x6')};const fileOptions={'algorithm':_0x1927('0x7')};if(config[_0x1927('0x8')]&&config['encrypt'][_0x1927('0x9')]){var isSupported=isAlgorithmSupported(config[_0x1927('0x8')][_0x1927('0x9')]);if(isSupported){fileOptions[_0x1927('0x9')]=config[_0x1927('0x8')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0x1927('0xa')](',\x20');logger[_0x1927('0xb')](config[_0x1927('0x8')]['algorithm'],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x3155da){return AES_SUPPORTED_RX[_0x1927('0xc')](_0x3155da);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x1927('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x534944){return getSupportedCiphers()[_0x1927('0xe')](_0x534944)>-0x1;}function combineOptions(_0x22aca4){var _0x5599fb={};for(var _0x3df1a9 in fileOptions){if(fileOptions[_0x1927('0xf')](_0x3df1a9)){_0x5599fb[_0x3df1a9]=fileOptions[_0x3df1a9];}}if(_0x22aca4){for(var _0x4c1e31 in _0x22aca4){if(_0x22aca4[_0x1927('0xf')](_0x4c1e31)){_0x5599fb[_0x4c1e31]=_0x22aca4[_0x4c1e31];}}}return _0x5599fb;}exports[_0x1927('0x10')]=function(_0x39ebbf,_0x2db2c0,_0x235fb8,_0x2acea7){return new BPromise(function(_0x6478f5,_0x206b8b){_0x2acea7=combineOptions(_0x2acea7);var _0x4d785d=new Buffer(_0x235fb8);var _0x3e510c=fs[_0x1927('0x11')](_0x39ebbf);var _0xdcb89b=fs[_0x1927('0x12')](_0x2db2c0);var _0x1c3080=crypto[_0x1927('0x13')](_0x2acea7[_0x1927('0x9')],_0x4d785d);_0x3e510c['on'](_0x1927('0x14'),function(_0x1f851e){var _0x144d88=new Buffer(_0x1c3080[_0x1927('0x15')](_0x1f851e),'binary');_0xdcb89b['write'](_0x144d88);});_0x3e510c['on'](_0x1927('0x16'),function(){try{var _0x133fb7=new Buffer(_0x1c3080['final'](_0x1927('0x17')),_0x1927('0x17'));_0xdcb89b[_0x1927('0x18')](_0x133fb7);_0xdcb89b['end']();_0xdcb89b['on'](_0x1927('0x19'),function(){return _0x6478f5(_0x2db2c0);});}catch(_0xc39359){fs[_0x1927('0x1a')](_0x2db2c0);return _0x206b8b(_0xc39359);}});});};exports[_0x1927('0x1b')]=function(_0x340455,_0x5462a2,_0x26e643,_0x5a3ea1){return new BPromise(function(_0x1607b8,_0x52198d){_0x5a3ea1=combineOptions(_0x5a3ea1);var _0x14a79f=new Buffer(_0x26e643);var _0x4cb2c5=fs['createReadStream'](_0x340455);var _0x45da77=fs[_0x1927('0x12')](_0x5462a2);var _0x32628b=crypto[_0x1927('0x1c')](_0x5a3ea1[_0x1927('0x9')],_0x14a79f);_0x4cb2c5['on'](_0x1927('0x14'),function(_0xcb8695){var _0xbe72a8=new Buffer(_0x32628b['update'](_0xcb8695),_0x1927('0x17'));_0x45da77[_0x1927('0x18')](_0xbe72a8);});_0x4cb2c5['on'](_0x1927('0x16'),function(){try{var _0x542761=new Buffer(_0x32628b[_0x1927('0x1d')](_0x1927('0x17')),_0x1927('0x17'));_0x45da77[_0x1927('0x18')](_0x542761);_0x45da77[_0x1927('0x16')]();_0x45da77['on'](_0x1927('0x19'),function(){return _0x1607b8(_0x5462a2);});}catch(_0x56c1e9){fs[_0x1927('0x1a')](_0x5462a2);return _0x52198d(_0x56c1e9);}});});};exports[_0x1927('0x1e')]=function(_0x3f9a8e,_0x28df40,_0x23c5e4){var _0x2eab68=_0x23c5e4||stringOptions[_0x1927('0x9')];var _0x4379f1=_0x28df40||stringOptions[_0x1927('0x1f')];var _0x2eb25b=crypto[_0x1927('0x13')](_0x2eab68,_0x4379f1);var _0x5162a2=_0x2eb25b[_0x1927('0x15')](_0x3f9a8e,_0x1927('0x20'),_0x1927('0x21'));_0x5162a2+=_0x2eb25b[_0x1927('0x1d')]('base64');return _0x5162a2;};exports[_0x1927('0x22')]=function(_0x13adeb,_0x3fd5cb,_0x18f0ef){var _0x31e9c6=_0x18f0ef||stringOptions[_0x1927('0x9')];var _0x5c698b=_0x3fd5cb||stringOptions['secret'];var _0x4bae19=crypto[_0x1927('0x1c')](_0x31e9c6,_0x5c698b);var _0x32c44d=_0x4bae19['update'](_0x13adeb,_0x1927('0x21'),_0x1927('0x20'));_0x32c44d+=_0x4bae19[_0x1927('0x1d')]('utf8');return _0x32c44d;}; \ No newline at end of file +var _0xd198=['unlink','decryptFile','write','encryptString','secret','base64','decryptString','createDecipher','utf8','crypto','bluebird','../../config/logger','app','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','binary','final','end','close'];(function(_0x15a05a,_0x454528){var _0x47fb02=function(_0x3d73c4){while(--_0x3d73c4){_0x15a05a['push'](_0x15a05a['shift']());}};_0x47fb02(++_0x454528);}(_0xd198,0xae));var _0x8d19=function(_0x2fd2cb,_0x437c0){_0x2fd2cb=_0x2fd2cb-0x0;var _0x3fc2b9=_0xd198[_0x2fd2cb];return _0x3fc2b9;};'use strict';var crypto=require(_0x8d19('0x0'));var fs=require('fs');var BPromise=require(_0x8d19('0x1'));var _=require('lodash');var config=require('../../config/environment');var logger=require(_0x8d19('0x2'))(_0x8d19('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0x8d19('0x4')],'algorithm':_0x8d19('0x5')};const fileOptions={'algorithm':_0x8d19('0x6')};if(config[_0x8d19('0x7')]&&config[_0x8d19('0x7')][_0x8d19('0x8')]){var isSupported=isAlgorithmSupported(config[_0x8d19('0x7')][_0x8d19('0x8')]);if(isSupported){fileOptions[_0x8d19('0x8')]=config['encrypt'][_0x8d19('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x8d19('0x9')](',\x20');logger[_0x8d19('0xa')](config[_0x8d19('0x7')]['algorithm'],_0x8d19('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x5bc161){return AES_SUPPORTED_RX[_0x8d19('0xc')](_0x5bc161);}function getSupportedCiphers(){return crypto['getCiphers']()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x14e9e2){return getSupportedCiphers()['indexOf'](_0x14e9e2)>-0x1;}function combineOptions(_0x407ba0){var _0x3de857={};for(var _0x2e14c8 in fileOptions){if(fileOptions['hasOwnProperty'](_0x2e14c8)){_0x3de857[_0x2e14c8]=fileOptions[_0x2e14c8];}}if(_0x407ba0){for(var _0x2b7de0 in _0x407ba0){if(_0x407ba0[_0x8d19('0xd')](_0x2b7de0)){_0x3de857[_0x2b7de0]=_0x407ba0[_0x2b7de0];}}}return _0x3de857;}exports[_0x8d19('0xe')]=function(_0x50bd45,_0x5d9cef,_0x18801a,_0x2540c2){return new BPromise(function(_0x1f2d61,_0x4e7e78){_0x2540c2=combineOptions(_0x2540c2);var _0x5a09e7=new Buffer(_0x18801a);var _0x2e7418=fs[_0x8d19('0xf')](_0x50bd45);var _0x1a5ae2=fs[_0x8d19('0x10')](_0x5d9cef);var _0x56f1a8=crypto[_0x8d19('0x11')](_0x2540c2['algorithm'],_0x5a09e7);_0x2e7418['on'](_0x8d19('0x12'),function(_0x98a5c6){var _0x1adc8e=new Buffer(_0x56f1a8[_0x8d19('0x13')](_0x98a5c6),_0x8d19('0x14'));_0x1a5ae2['write'](_0x1adc8e);});_0x2e7418['on']('end',function(){try{var _0x4fd0e0=new Buffer(_0x56f1a8[_0x8d19('0x15')](_0x8d19('0x14')),_0x8d19('0x14'));_0x1a5ae2['write'](_0x4fd0e0);_0x1a5ae2[_0x8d19('0x16')]();_0x1a5ae2['on'](_0x8d19('0x17'),function(){return _0x1f2d61(_0x5d9cef);});}catch(_0xd48cf){fs[_0x8d19('0x18')](_0x5d9cef);return _0x4e7e78(_0xd48cf);}});});};exports[_0x8d19('0x19')]=function(_0x417551,_0x51dee8,_0x4c5a01,_0x3a9fc0){return new BPromise(function(_0x2c36ac,_0x5f318d){_0x3a9fc0=combineOptions(_0x3a9fc0);var _0x5db72b=new Buffer(_0x4c5a01);var _0x24bddf=fs[_0x8d19('0xf')](_0x417551);var _0x51f03c=fs['createWriteStream'](_0x51dee8);var _0x86747b=crypto['createDecipher'](_0x3a9fc0[_0x8d19('0x8')],_0x5db72b);_0x24bddf['on'](_0x8d19('0x12'),function(_0x1cd3cc){var _0x403bc7=new Buffer(_0x86747b[_0x8d19('0x13')](_0x1cd3cc),'binary');_0x51f03c[_0x8d19('0x1a')](_0x403bc7);});_0x24bddf['on'](_0x8d19('0x16'),function(){try{var _0x445a1f=new Buffer(_0x86747b['final'](_0x8d19('0x14')),_0x8d19('0x14'));_0x51f03c[_0x8d19('0x1a')](_0x445a1f);_0x51f03c['end']();_0x51f03c['on'](_0x8d19('0x17'),function(){return _0x2c36ac(_0x51dee8);});}catch(_0x17d293){fs[_0x8d19('0x18')](_0x51dee8);return _0x5f318d(_0x17d293);}});});};exports[_0x8d19('0x1b')]=function(_0x5bf744,_0x4df22e,_0x3a17d5){var _0x7eea94=_0x3a17d5||stringOptions['algorithm'];var _0x30b03a=_0x4df22e||stringOptions[_0x8d19('0x1c')];var _0x599e66=crypto[_0x8d19('0x11')](_0x7eea94,_0x30b03a);var _0x590fe9=_0x599e66[_0x8d19('0x13')](_0x5bf744,'utf8','base64');_0x590fe9+=_0x599e66['final'](_0x8d19('0x1d'));return _0x590fe9;};exports[_0x8d19('0x1e')]=function(_0x4fc9e1,_0x4440ff,_0x4ad766){var _0x280219=_0x4ad766||stringOptions[_0x8d19('0x8')];var _0x1a693e=_0x4440ff||stringOptions[_0x8d19('0x1c')];var _0x520fab=crypto[_0x8d19('0x1f')](_0x280219,_0x1a693e);var _0x57c16b=_0x520fab[_0x8d19('0x13')](_0x4fc9e1,'base64',_0x8d19('0x20'));_0x57c16b+=_0x520fab[_0x8d19('0x15')](_0x8d19('0x20'));return _0x57c16b;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index dc06028..6f7d3e2 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 _0xc55d=['SELECT','num','Empty','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','existsSync','join','%s%d.%s','csv','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','info','finally','exit','util','path','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes'];(function(_0x46399a,_0x448ba7){var _0x1daf7d=function(_0x5dd66e){while(--_0x5dd66e){_0x46399a['push'](_0x46399a['shift']());}};_0x1daf7d(++_0x448ba7);}(_0xc55d,0x134));var _0xdc55=function(_0x2e2324,_0x1c58a5){_0x2e2324=_0x2e2324-0x0;var _0x3cf481=_0xc55d[_0x2e2324];return _0x3cf481;};'use strict';var util=require(_0xdc55('0x0'));var path=require(_0xdc55('0x1'));var _=require('lodash');var csv=require('to-csv');var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0xdc55('0x2'));var rimraf=require(_0xdc55('0x3'));var db=require('../../mysqldb')['db'];var dbH=require(_0xdc55('0x4'))[_0xdc55('0x5')];var logger=require(_0xdc55('0x6'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xdc55('0x7')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4f4122,_0xde0a90){var _0x462db6={'status':_0x4f4122};var _0x524ef4={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xde0a90){_0x462db6[_0xdc55('0x8')]=_0xde0a90;}return db[_0xdc55('0x9')]['update'](_0x462db6,_0x524ef4);}function main(){var _0x5b5c61=0x1388;var _0xcbd4e0;logger['info'](util[_0xdc55('0xa')](_0xdc55('0xb'),EXTRACTED_REPORT_ID,_0xdc55('0xc')));return db[_0xdc55('0xd')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xdc55('0xe'),_0xdc55('0xf')]})[_0xdc55('0x10')](function(_0x5f627d){if(_0x5f627d){_0xcbd4e0=_0x5f627d;_0x5b5c61=_0xcbd4e0[_0xdc55('0xf')]||0x1388;}})[_0xdc55('0x10')](function(){return dbH[_0xdc55('0x11')][_0xdc55('0x12')](util['format'](_0xdc55('0x13'),QUERY),{'type':dbH['sequelize'][_0xdc55('0x14')][_0xdc55('0x15')]});})[_0xdc55('0x10')](function(_0x5f0b06){if(!_0x5f0b06[0x0][_0xdc55('0x16')]){return analyticExtractedReport(_0xdc55('0x17'));}var _0x289d15=[];var _0x97a740=0x0;if(_0xcbd4e0[_0xdc55('0xe')]){if(_0x5f0b06&&_0x5f0b06[_0xdc55('0x18')]){var _0x4ee9cd=_[_0xdc55('0x19')](_0x5f0b06[0x0]['num']/_0x5b5c61);var _0x3f93cc=Number[_0xdc55('0x1a')](_0x5f0b06[0x0][_0xdc55('0x16')]/_0x5b5c61)?_0x5f0b06[0x0][_0xdc55('0x16')]%_0x5b5c61:0x0;_0x4ee9cd[_0xdc55('0x1b')](function(_0x4ae759){if(_0x4ae759>0x0){_0x97a740+=_0x5b5c61;}_0x289d15[_0xdc55('0x1c')](dbH[_0xdc55('0x11')][_0xdc55('0x12')](util['format'](_0xdc55('0x1d'),QUERY,_0x5b5c61,_0x97a740),{'type':dbH['sequelize']['QueryTypes'][_0xdc55('0x15')]}));});if(_0x3f93cc>0x0){_0x97a740+=_0x5b5c61;_0x289d15[_0xdc55('0x1c')](dbH[_0xdc55('0x11')][_0xdc55('0x12')](util['format'](_0xdc55('0x1d'),QUERY,_0x3f93cc,_0x97a740),{'type':dbH[_0xdc55('0x11')][_0xdc55('0x14')]['SELECT']}));}}}else{_0x289d15['push'](dbH['sequelize'][_0xdc55('0x12')](QUERY,{'type':dbH[_0xdc55('0x11')][_0xdc55('0x14')][_0xdc55('0x15')]}));}var _0x552fd3=path[_0xdc55('0x1e')](PATH);var _0x2888a7=path[_0xdc55('0x1f')](PATH,_0xdc55('0x20'));var _0x43d2ce=_0xcbd4e0[_0xdc55('0xe')]&&_0x289d15[_0xdc55('0x18')]>0x1;var _0x7a5883=[];if(!fs[_0xdc55('0x21')](path['join'](_0x552fd3,_0x2888a7))&&_0x43d2ce){fs['mkdirSync'](path['join'](_0x552fd3,_0x2888a7));}return BPromise['each'](_0x289d15,function(_0x4cb71f){_0x7a5883['push'](_0x4cb71f);})[_0xdc55('0x10')](function(){for(var _0x2dd8cd=0x0;_0x2dd8cd<_0x7a5883['length'];_0x2dd8cd+=0x1){var _0x559be5;var _0x431dee=_0x7a5883[_0x2dd8cd];if(_0x43d2ce){_0x559be5=path[_0xdc55('0x22')](_0x552fd3,_0x2888a7,util['format'](_0xdc55('0x23'),_0x2888a7,_0x2dd8cd,_0xdc55('0x24')));}else{_0x559be5=path[_0xdc55('0x22')](_0x552fd3,util[_0xdc55('0xa')](_0xdc55('0x25'),_0x2888a7,'csv'));}fs[_0xdc55('0x26')](_0x559be5,csv(_0x431dee));}})[_0xdc55('0x10')](function(){if(_0x43d2ce){return new Promise(function(_0x493d0a){zipdir(path[_0xdc55('0x22')](_0x552fd3,_0x2888a7),{'saveTo':path[_0xdc55('0x22')](_0x552fd3,util['format'](_0xdc55('0x25'),_0x2888a7,_0xdc55('0x27')))},function(_0x2c3c5a,_0x577fd5){rimraf(path[_0xdc55('0x22')](_0x552fd3,_0x2888a7),function(){});_0x493d0a(_0xdc55('0x28'));});});}})[_0xdc55('0x10')](function(){logger['info'](util[_0xdc55('0xa')](_0xdc55('0x29'),EXTRACTED_REPORT_ID,_0xdc55('0xc')));return analyticExtractedReport(_0xdc55('0x2a'),_0x43d2ce?util[_0xdc55('0xa')](_0xdc55('0x25'),_0x2888a7,_0x43d2ce?_0xdc55('0x27'):_0xdc55('0x24')):null);});})[_0xdc55('0x2b')](function(_0x1a3327){logger[_0xdc55('0x2c')](util[_0xdc55('0xa')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xdc55('0xc')),util['inspect'](_0x1a3327,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xdc55('0x2d')](function(){process[_0xdc55('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xef4d=['dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','splitSizeCsv','then','sequelize','query','QueryTypes','SELECT','num','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','split','existsSync','join','mkdirSync','each','%s%d.%s','%s.%s','csv','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','util','path','lodash','to-csv'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0xef4d,0x18c));var _0xdef4=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xef4d[_0x2f3848];return _0x102668;};'use strict';var util=require(_0xdef4('0x0'));var path=require(_0xdef4('0x1'));var _=require(_0xdef4('0x2'));var csv=require(_0xdef4('0x3'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xdef4('0x4')];var logger=require(_0xdef4('0x5'))(_0xdef4('0x6'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xdef4('0x7')][0x3];var PATH=process[_0xdef4('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x415731,_0x282843){var _0x414ea2={'status':_0x415731};var _0x4dbb1d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x282843){_0x414ea2[_0xdef4('0x8')]=_0x282843;}return db[_0xdef4('0x9')]['update'](_0x414ea2,_0x4dbb1d);}function main(){var _0x51693a=0x1388;var _0x29c9d4;logger[_0xdef4('0xa')](util[_0xdef4('0xb')](_0xdef4('0xc'),EXTRACTED_REPORT_ID,_0xdef4('0xd')));return db[_0xdef4('0xe')][_0xdef4('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xdef4('0x10')]})[_0xdef4('0x11')](function(_0x12ad61){if(_0x12ad61){_0x29c9d4=_0x12ad61;_0x51693a=_0x29c9d4['splitSizeCsv']||0x1388;}})[_0xdef4('0x11')](function(){return dbH[_0xdef4('0x12')][_0xdef4('0x13')](util[_0xdef4('0xb')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xdef4('0x12')][_0xdef4('0x14')][_0xdef4('0x15')]});})[_0xdef4('0x11')](function(_0x1d679d){if(!_0x1d679d[0x0][_0xdef4('0x16')]){return analyticExtractedReport('Empty');}var _0x538b99=[];var _0x3640b9=0x0;if(_0x29c9d4['split']){if(_0x1d679d&&_0x1d679d[_0xdef4('0x17')]){var _0x2b204b=_[_0xdef4('0x18')](_0x1d679d[0x0]['num']/_0x51693a);var _0xaa6d95=Number[_0xdef4('0x19')](_0x1d679d[0x0][_0xdef4('0x16')]/_0x51693a)?_0x1d679d[0x0][_0xdef4('0x16')]%_0x51693a:0x0;_0x2b204b[_0xdef4('0x1a')](function(_0x14d4a6){if(_0x14d4a6>0x0){_0x3640b9+=_0x51693a;}_0x538b99[_0xdef4('0x1b')](dbH['sequelize'][_0xdef4('0x13')](util['format'](_0xdef4('0x1c'),QUERY,_0x51693a,_0x3640b9),{'type':dbH['sequelize'][_0xdef4('0x14')]['SELECT']}));});if(_0xaa6d95>0x0){_0x3640b9+=_0x51693a;_0x538b99['push'](dbH['sequelize'][_0xdef4('0x13')](util[_0xdef4('0xb')](_0xdef4('0x1c'),QUERY,_0xaa6d95,_0x3640b9),{'type':dbH[_0xdef4('0x12')][_0xdef4('0x14')][_0xdef4('0x15')]}));}}}else{_0x538b99['push'](dbH[_0xdef4('0x12')]['query'](QUERY,{'type':dbH[_0xdef4('0x12')][_0xdef4('0x14')][_0xdef4('0x15')]}));}var _0xc8c78f=path[_0xdef4('0x1d')](PATH);var _0x4bdb63=path[_0xdef4('0x1e')](PATH,_0xdef4('0x1f'));var _0x51ade4=_0x29c9d4[_0xdef4('0x20')]&&_0x538b99[_0xdef4('0x17')]>0x1;var _0x22f22b=[];if(!fs[_0xdef4('0x21')](path[_0xdef4('0x22')](_0xc8c78f,_0x4bdb63))&&_0x51ade4){fs[_0xdef4('0x23')](path[_0xdef4('0x22')](_0xc8c78f,_0x4bdb63));}return BPromise[_0xdef4('0x24')](_0x538b99,function(_0x8cb5ab){_0x22f22b[_0xdef4('0x1b')](_0x8cb5ab);})[_0xdef4('0x11')](function(){for(var _0x31ab15=0x0;_0x31ab15<_0x22f22b[_0xdef4('0x17')];_0x31ab15+=0x1){var _0x561138;var _0x2fad81=_0x22f22b[_0x31ab15];if(_0x51ade4){_0x561138=path[_0xdef4('0x22')](_0xc8c78f,_0x4bdb63,util[_0xdef4('0xb')](_0xdef4('0x25'),_0x4bdb63,_0x31ab15,'csv'));}else{_0x561138=path['join'](_0xc8c78f,util['format'](_0xdef4('0x26'),_0x4bdb63,_0xdef4('0x27')));}fs[_0xdef4('0x28')](_0x561138,csv(_0x2fad81));}})[_0xdef4('0x11')](function(){if(_0x51ade4){return new Promise(function(_0x2c1935){zipdir(path[_0xdef4('0x22')](_0xc8c78f,_0x4bdb63),{'saveTo':path[_0xdef4('0x22')](_0xc8c78f,util[_0xdef4('0xb')](_0xdef4('0x26'),_0x4bdb63,_0xdef4('0x29')))},function(_0x5bd3dc,_0x8ec7){rimraf(path[_0xdef4('0x22')](_0xc8c78f,_0x4bdb63),function(){});_0x2c1935(_0xdef4('0x2a'));});});}})[_0xdef4('0x11')](function(){logger[_0xdef4('0xa')](util['format'](_0xdef4('0x2b'),EXTRACTED_REPORT_ID,_0xdef4('0xd')));return analyticExtractedReport(_0xdef4('0x2c'),_0x51ade4?util[_0xdef4('0xb')]('%s.%s',_0x4bdb63,_0x51ade4?_0xdef4('0x29'):'csv'):null);});})[_0xdef4('0x2d')](function(_0x5ba98d){logger[_0xdef4('0xa')](util[_0xdef4('0xb')](_0xdef4('0x2e'),EXTRACTED_REPORT_ID,_0xdef4('0xd')),util[_0xdef4('0x2f')](_0x5ba98d,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xdef4('0x30'));})['finally'](function(){process[_0xdef4('0x31')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 98f1ea7..f187cbf 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 _0x446f=['catch','lodash','util','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','map','tableHeader','pick','toString','value','fill','auto','body','push','concat','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','length','header','pageBreak','before','margin','landscape','\x20/\x20','footer','Arial','black','right','Empty','Setting','find','splitSizePdf','then','split','range','num','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','existsSync','mkdirSync','flatten','createPdfKitDocument','join','%s%d.%s','pdf','%s.%s','all','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','createWriteStream','finish','end','createPdfFromHTML','path'];(function(_0xec1289,_0x4fa82b){var _0x3e223c=function(_0x9752ec){while(--_0x9752ec){_0xec1289['push'](_0xec1289['shift']());}};_0x3e223c(++_0x4fa82b);}(_0x446f,0xbb));var _0xf446=function(_0x2f5b77,_0x523c41){_0x2f5b77=_0x2f5b77-0x0;var _0x47a79b=_0x446f[_0x2f5b77];return _0x47a79b;};'use strict';var _=require(_0xf446('0x0'));var fs=require('fs');var util=require(_0xf446('0x1'));var path=require('path');var moment=require('moment');var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0xf446('0x2'));var zipdir=require(_0xf446('0x3'));var rimraf=require(_0xf446('0x4'));var JSDOM=require(_0xf446('0x5'))[_0xf446('0x6')];var window=new JSDOM('')['window'];var BPromise=require(_0xf446('0x7'));var db=require('../../mysqldb')['db'];var dbH=require(_0xf446('0x8'))[_0xf446('0x9')];var logger=require(_0xf446('0xa'))(_0xf446('0xb'));var EXTRACTED_REPORT_ID=Number(process[_0xf446('0xc')][0x2]);var QUERY=process[_0xf446('0xc')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xf446('0xc')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x55e1a1,_0xec0fe0){var _0x29b4f1={'status':_0x55e1a1};var _0x41ee54={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xec0fe0){_0x29b4f1[_0xf446('0xd')]=_0xec0fe0;}return db[_0xf446('0xe')]['update'](_0x29b4f1,_0x41ee54);}function getHeaders(_0x2bcdc7){return _[_0xf446('0xf')](_0x2bcdc7,function(_0x36e672){return{'text':_0x36e672,'style':_0xf446('0x10')};});}function getRows(_0x5f31df,_0x488719){return _[_0xf446('0xf')](_0x488719,function(_0x316457){return _(_0x316457)[_0xf446('0x11')](_0x5f31df)[_0xf446('0xf')](function(_0x1b86bf){return _0x1b86bf?_[_0xf446('0x12')](_0x1b86bf):'';})[_0xf446('0x13')]();});}function createTable(_0x587740,_0x522a14){var _0x3fc9f1={'widths':_[_0xf446('0x14')](Array(_0x587740['length']),0x91),'heights':function(_0x52cf2f){return _0x52cf2f===0x0?_0xf446('0x15'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x19ce4b=getHeaders(_0x587740);_0x3fc9f1[_0xf446('0x16')][_0xf446('0x17')](_0x19ce4b);var _0x4bca93=getRows(_0x587740,_0x522a14);_0x3fc9f1['body']=_0x3fc9f1[_0xf446('0x16')][_0xf446('0x18')](_0x4bca93);return _0x3fc9f1;}function createTables(_0x37a386){var _0xb4cf3f=[];var _0x58af05=_['chunk'](Object['keys'](_0x37a386[0x0]),0x5);_0x58af05[_0xf446('0x19')](function(_0x2d5e0d){_0xb4cf3f[_0xf446('0x17')](createTable(_0x2d5e0d,_0x37a386));});return _0xb4cf3f;}function getPDFDocDefinition(_0x39abd5){var _0x727f37=util[_0xf446('0x1a')](_0xf446('0x1b'),NAME,EXTRACTED_REPORT[_0xf446('0x1c')],moment(EXTRACTED_REPORT[_0xf446('0x1d')])[_0xf446('0x1a')](FORMAT),moment(EXTRACTED_REPORT[_0xf446('0x1e')])['format'](FORMAT));var _0x5dfd9f=[];for(var _0x3f2edb=0x0;_0x3f2edb<_0x39abd5[_0xf446('0x1f')];_0x3f2edb++){var _0x10a68e=[];if(_0x3f2edb===0x0){_0x10a68e[_0xf446('0x17')]({'text':_0x727f37,'style':_0xf446('0x20')});}var _0x4dcbfc={'table':_0x39abd5[_0x3f2edb]};if(_0x3f2edb>0x0){_0x4dcbfc[_0xf446('0x21')]=_0xf446('0x22');_0x4dcbfc[_0xf446('0x23')]=[0x0,0x46,0x0,0x0];}_0x10a68e[_0xf446('0x17')](_0x4dcbfc);_0x5dfd9f['push'](_0x10a68e);}return{'pageSize':'A4','pageOrientation':_0xf446('0x24'),'content':_0x5dfd9f,'footer':function(_0x960035,_0x558fe8){return{'text':_0x960035['toString']()+_0xf446('0x25')+_0x558fe8,'style':_0xf446('0x26')};},'defaultStyle':{'font':_0xf446('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xf446('0x28')},'footer':{'alignment':_0xf446('0x29'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x4ca4f2){var _0x6d4028=0x1388;var _0x498202;if(!_0x4ca4f2[0x0]['num']){return analyticExtractedReport(_0xf446('0x2a'));}return db[_0xf446('0x2b')][_0xf446('0x2c')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xf446('0x2d')]})[_0xf446('0x2e')](function(_0x5ee549){if(_0x5ee549){_0x498202=_0x5ee549;_0x6d4028=_0x498202[_0xf446('0x2d')]||0x3e8;}})['then'](function(){var _0x22a7e4=[];var _0x59c03b=0x0;if(_0x498202[_0xf446('0x2f')]){if(_0x4ca4f2&&_0x4ca4f2[_0xf446('0x1f')]){var _0x21bc72=_[_0xf446('0x30')](_0x4ca4f2[0x0][_0xf446('0x31')]/_0x6d4028);var _0x35f373=Number[_0xf446('0x32')](_0x4ca4f2[0x0][_0xf446('0x31')]/_0x6d4028)?_0x4ca4f2[0x0]['num']%_0x6d4028:0x0;_0x21bc72[_0xf446('0x19')](function(_0x25bee8){if(_0x25bee8>0x0){_0x59c03b+=_0x6d4028;}_0x22a7e4['push'](dbH[_0xf446('0x33')][_0xf446('0x34')](util[_0xf446('0x1a')](_0xf446('0x35'),QUERY,_0x6d4028,_0x59c03b),{'type':dbH[_0xf446('0x33')][_0xf446('0x36')][_0xf446('0x37')]}));});if(_0x35f373>0x0){_0x59c03b+=_0x6d4028;_0x22a7e4[_0xf446('0x17')](dbH['sequelize']['query'](util[_0xf446('0x1a')](_0xf446('0x35'),QUERY,_0x35f373,_0x59c03b),{'type':dbH[_0xf446('0x33')][_0xf446('0x36')]['SELECT']}));}}}else{_0x22a7e4[_0xf446('0x17')](dbH[_0xf446('0x33')]['query'](QUERY,{'type':dbH[_0xf446('0x33')][_0xf446('0x36')][_0xf446('0x37')]}));}var _0x1c8438=path[_0xf446('0x38')](PATH);var _0x200b88=path[_0xf446('0x39')](PATH,'.pdf');var _0x1f8eac=_0x498202['split']&&_0x22a7e4[_0xf446('0x1f')]>0x1;var _0x7a94cc=[];if(!fs[_0xf446('0x3a')](path['join'](_0x1c8438,_0x200b88))&&_0x1f8eac){fs[_0xf446('0x3b')](path['join'](_0x1c8438,_0x200b88));}return BPromise['each'](_0x22a7e4,function(_0x3a5e6d){_0x7a94cc['push'](_0x3a5e6d);})[_0xf446('0x2e')](function(){var _0x2468a4=[];for(var _0x15ad26=0x0;_0x15ad26<_0x7a94cc[_0xf446('0x1f')];_0x15ad26+=0x1){var _0x2459ec=_0x7a94cc[_0x15ad26];var _0x47cadb=createTables(_[_0xf446('0x3c')](_0x2459ec));var _0xe88da6;var _0x356b3a=getPDFDocDefinition(_0x47cadb);var _0x2d574f=getPDFPrinter();var _0x279c02=_0x2d574f[_0xf446('0x3d')](_0x356b3a);if(_0x1f8eac){_0xe88da6=path[_0xf446('0x3e')](_0x1c8438,_0x200b88,util[_0xf446('0x1a')](_0xf446('0x3f'),_0x200b88,_0x15ad26,_0xf446('0x40')));}else{_0xe88da6=path['join'](_0x1c8438,util[_0xf446('0x1a')](_0xf446('0x41'),_0x200b88,'pdf'));}_0x2468a4[_0xf446('0x17')](writePDFDocument(_0x279c02,_0xe88da6));}return Promise[_0xf446('0x42')](_0x2468a4);})[_0xf446('0x2e')](function(){if(_0x1f8eac){return new Promise(function(_0x4dd941){zipdir(path[_0xf446('0x3e')](_0x1c8438,_0x200b88),{'saveTo':path['join'](_0x1c8438,util[_0xf446('0x1a')](_0xf446('0x41'),_0x200b88,_0xf446('0x43')))},function(){rimraf(path[_0xf446('0x3e')](_0x1c8438,_0x200b88),function(){});_0x4dd941(_0xf446('0x44'));});});}})[_0xf446('0x2e')](function(){if(!_0x1f8eac)return;rimraf(path['join'](_0x1c8438,_0x200b88),function(){});})['then'](function(){logger[_0xf446('0x45')](util[_0xf446('0x1a')](_0xf446('0x46'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0xf446('0x47'),_0x1f8eac?util[_0xf446('0x1a')](_0xf446('0x41'),_0x200b88,_0x1f8eac?_0xf446('0x43'):_0xf446('0x40')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xf446('0x45')](util[_0xf446('0x1a')](_0xf446('0x48'),EXTRACTED_REPORT_ID,_0xf446('0x49')));return db['AnalyticExtractedReport']['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0xf9dacf){EXTRACTED_REPORT=_0xf9dacf;return dbH[_0xf446('0x33')][_0xf446('0x34')](util[_0xf446('0x1a')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xf446('0x33')][_0xf446('0x36')][_0xf446('0x37')]});})[_0xf446('0x2e')](extractReport)['catch'](function(_0x2b34c4){logger['info'](util[_0xf446('0x1a')](_0xf446('0x4a'),EXTRACTED_REPORT_ID,_0xf446('0x49')),util[_0xf446('0x4b')](_0x2b34c4,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xf446('0x4c'));})['finally'](function(){process[_0xf446('0x4d')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x284b4c=new PdfPrinter({'Arial':{'normal':__dirname+_0xf446('0x4e'),'bold':__dirname+_0xf446('0x4f'),'italics':__dirname+_0xf446('0x50'),'bolditalics':__dirname+_0xf446('0x51')}});return _0x284b4c;}function getPDFDocDefinitionFromHTML(_0x4777e2,_0x2d2a1b){var _0x41d971=util[_0xf446('0x1a')](_0xf446('0x52'),_0x2d2a1b[_0xf446('0x53')],_0x2d2a1b[_0xf446('0x54')]);var _0x5300a3=moment()['format'](_0xf446('0x55'))[_0xf446('0x12')]();var _0x25b182=htmlToPdfmake(_0x4777e2,{'window':window,'tableAutoSize':!![]});return{'content':[_0x25b182],'defaultStyle':{'font':_0xf446('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xf446('0x56'),'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':'center'}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0xf446('0x20')}];},'footer':function(_0x5abf47,_0x16891f){return[{'text':util[_0xf446('0x1a')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x41d971,_0x5abf47,_0x16891f,_0x5300a3),'style':_0xf446('0x26')}];}};}function writePDFDocument(_0xe95a15,_0x4158aa){return new Promise(function(_0x375ae7,_0x23065e){var _0x1f4ae6=_0xe95a15['pipe'](fs[_0xf446('0x57')](_0x4158aa));_0x1f4ae6['on'](_0xf446('0x58'),function(){_0x375ae7('finish');});_0x1f4ae6['on']('error',function(_0x4ea95c){_0x23065e(_0x4ea95c);});_0xe95a15[_0xf446('0x59')]();});}exports[_0xf446('0x5a')]=function(_0x53419c,_0xeb2b92){var _0x1935de=getPDFPrinter();var _0x5cae05=getPDFDocDefinitionFromHTML(_0x53419c,_0xeb2b92);var _0x5dae43=_0x1935de[_0xf446('0x3d')](_0x5cae05);return writePDFDocument(_0x5dae43,_0xeb2b92[_0xf446('0x5b')])[_0xf446('0x5c')](function(_0x2778e2){throw _0x2778e2;});}; \ No newline at end of file +var _0xa3b9=['path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','jsdom','JSDOM','window','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','map','pick','toString','value','fill','length','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','landscape','\x20/\x20','Arial','black','num','Empty','Setting','find','split','splitSizePdf','then','range','isInteger','query','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','QueryTypes','SELECT','dirname','basename','.pdf','existsSync','join','mkdirSync','flatten','createPdfKitDocument','%s%d.%s','%s.%s','pdf','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','zip','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','exit','/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','footer','createWriteStream','finish','error','createPdfFromHTML','lodash'];(function(_0x18b818,_0x34d655){var _0x4fcce6=function(_0x503fee){while(--_0x503fee){_0x18b818['push'](_0x18b818['shift']());}};_0x4fcce6(++_0x34d655);}(_0xa3b9,0x1b7));var _0x9a3b=function(_0x26f5e5,_0x7c6beb){_0x26f5e5=_0x26f5e5-0x0;var _0x4aff4a=_0xa3b9[_0x26f5e5];return _0x4aff4a;};'use strict';var _=require(_0x9a3b('0x0'));var fs=require('fs');var util=require('util');var path=require(_0x9a3b('0x1'));var moment=require(_0x9a3b('0x2'));var htmlToPdfmake=require(_0x9a3b('0x3'));var PdfPrinter=require(_0x9a3b('0x4'));var zipdir=require(_0x9a3b('0x5'));var rimraf=require('rimraf');var JSDOM=require(_0x9a3b('0x6'))[_0x9a3b('0x7')];var window=new JSDOM('')[_0x9a3b('0x8')];var BPromise=require('bluebird');var db=require(_0x9a3b('0x9'))['db'];var dbH=require(_0x9a3b('0x9'))[_0x9a3b('0xa')];var logger=require(_0x9a3b('0xb'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x9a3b('0xc')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x9a3b('0xc')][0x4];var NAME=process[_0x9a3b('0xc')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x4a7d85,_0x1f86d7){var _0x5a3fc4={'status':_0x4a7d85};var _0x140e87={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1f86d7){_0x5a3fc4[_0x9a3b('0xd')]=_0x1f86d7;}return db[_0x9a3b('0xe')][_0x9a3b('0xf')](_0x5a3fc4,_0x140e87);}function getHeaders(_0x454927){return _[_0x9a3b('0x10')](_0x454927,function(_0x14ea4d){return{'text':_0x14ea4d,'style':'tableHeader'};});}function getRows(_0x8b6a4c,_0xb762bd){return _[_0x9a3b('0x10')](_0xb762bd,function(_0x2d7e46){return _(_0x2d7e46)[_0x9a3b('0x11')](_0x8b6a4c)['map'](function(_0x3092be){return _0x3092be?_[_0x9a3b('0x12')](_0x3092be):'';})[_0x9a3b('0x13')]();});}function createTable(_0x5493c8,_0x544c93){var _0x30839b={'widths':_[_0x9a3b('0x14')](Array(_0x5493c8[_0x9a3b('0x15')]),0x91),'heights':function(_0x4437e0){return _0x4437e0===0x0?_0x9a3b('0x16'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x38d43b=getHeaders(_0x5493c8);_0x30839b[_0x9a3b('0x17')][_0x9a3b('0x18')](_0x38d43b);var _0x12a954=getRows(_0x5493c8,_0x544c93);_0x30839b['body']=_0x30839b[_0x9a3b('0x17')]['concat'](_0x12a954);return _0x30839b;}function createTables(_0x399385){var _0x78f9b1=[];var _0x14885b=_[_0x9a3b('0x19')](Object[_0x9a3b('0x1a')](_0x399385[0x0]),0x5);_0x14885b[_0x9a3b('0x1b')](function(_0x50491e){_0x78f9b1[_0x9a3b('0x18')](createTable(_0x50491e,_0x399385));});return _0x78f9b1;}function getPDFDocDefinition(_0x3a68ff){var _0x43d2ec=util[_0x9a3b('0x1c')](_0x9a3b('0x1d'),NAME,EXTRACTED_REPORT[_0x9a3b('0x1e')],moment(EXTRACTED_REPORT[_0x9a3b('0x1f')])[_0x9a3b('0x1c')](FORMAT),moment(EXTRACTED_REPORT[_0x9a3b('0x20')])[_0x9a3b('0x1c')](FORMAT));var _0x55017f=[];for(var _0x1c9712=0x0;_0x1c9712<_0x3a68ff[_0x9a3b('0x15')];_0x1c9712++){var _0x5cdf6a=[];if(_0x1c9712===0x0){_0x5cdf6a['push']({'text':_0x43d2ec,'style':_0x9a3b('0x21')});}var _0x4c882e={'table':_0x3a68ff[_0x1c9712]};if(_0x1c9712>0x0){_0x4c882e[_0x9a3b('0x22')]=_0x9a3b('0x23');_0x4c882e['margin']=[0x0,0x46,0x0,0x0];}_0x5cdf6a[_0x9a3b('0x18')](_0x4c882e);_0x55017f[_0x9a3b('0x18')](_0x5cdf6a);}return{'pageSize':'A4','pageOrientation':_0x9a3b('0x24'),'content':_0x55017f,'footer':function(_0x121530,_0x5b8cce){return{'text':_0x121530['toString']()+_0x9a3b('0x25')+_0x5b8cce,'style':'footer'};},'defaultStyle':{'font':_0x9a3b('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x9a3b('0x27')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x4e17f5){var _0x1dfdbc=0x1388;var _0x2dfa8c;if(!_0x4e17f5[0x0][_0x9a3b('0x28')]){return analyticExtractedReport(_0x9a3b('0x29'));}return db[_0x9a3b('0x2a')][_0x9a3b('0x2b')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x9a3b('0x2c'),_0x9a3b('0x2d')]})[_0x9a3b('0x2e')](function(_0x209eb1){if(_0x209eb1){_0x2dfa8c=_0x209eb1;_0x1dfdbc=_0x2dfa8c['splitSizePdf']||0x3e8;}})[_0x9a3b('0x2e')](function(){var _0x526579=[];var _0x412009=0x0;if(_0x2dfa8c[_0x9a3b('0x2c')]){if(_0x4e17f5&&_0x4e17f5['length']){var _0x5c77fd=_[_0x9a3b('0x2f')](_0x4e17f5[0x0]['num']/_0x1dfdbc);var _0x54cad1=Number[_0x9a3b('0x30')](_0x4e17f5[0x0][_0x9a3b('0x28')]/_0x1dfdbc)?_0x4e17f5[0x0][_0x9a3b('0x28')]%_0x1dfdbc:0x0;_0x5c77fd['forEach'](function(_0x81abc8){if(_0x81abc8>0x0){_0x412009+=_0x1dfdbc;}_0x526579['push'](dbH['sequelize'][_0x9a3b('0x31')](util['format'](_0x9a3b('0x32'),QUERY,_0x1dfdbc,_0x412009),{'type':dbH[_0x9a3b('0x33')][_0x9a3b('0x34')][_0x9a3b('0x35')]}));});if(_0x54cad1>0x0){_0x412009+=_0x1dfdbc;_0x526579[_0x9a3b('0x18')](dbH['sequelize']['query'](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x54cad1,_0x412009),{'type':dbH[_0x9a3b('0x33')][_0x9a3b('0x34')][_0x9a3b('0x35')]}));}}}else{_0x526579[_0x9a3b('0x18')](dbH[_0x9a3b('0x33')][_0x9a3b('0x31')](QUERY,{'type':dbH[_0x9a3b('0x33')]['QueryTypes'][_0x9a3b('0x35')]}));}var _0x4a0928=path[_0x9a3b('0x36')](PATH);var _0x1ab876=path[_0x9a3b('0x37')](PATH,_0x9a3b('0x38'));var _0x5c865e=_0x2dfa8c[_0x9a3b('0x2c')]&&_0x526579[_0x9a3b('0x15')]>0x1;var _0x3bcbf7=[];if(!fs[_0x9a3b('0x39')](path[_0x9a3b('0x3a')](_0x4a0928,_0x1ab876))&&_0x5c865e){fs[_0x9a3b('0x3b')](path[_0x9a3b('0x3a')](_0x4a0928,_0x1ab876));}return BPromise['each'](_0x526579,function(_0x5897cd){_0x3bcbf7[_0x9a3b('0x18')](_0x5897cd);})[_0x9a3b('0x2e')](function(){var _0x3db4c0=[];for(var _0x11b1ff=0x0;_0x11b1ff<_0x3bcbf7[_0x9a3b('0x15')];_0x11b1ff+=0x1){var _0x476cb3=_0x3bcbf7[_0x11b1ff];var _0x245374=createTables(_[_0x9a3b('0x3c')](_0x476cb3));var _0xe01614;var _0x26a8a6=getPDFDocDefinition(_0x245374);var _0x322158=getPDFPrinter();var _0x1a1ad9=_0x322158[_0x9a3b('0x3d')](_0x26a8a6);if(_0x5c865e){_0xe01614=path[_0x9a3b('0x3a')](_0x4a0928,_0x1ab876,util[_0x9a3b('0x1c')](_0x9a3b('0x3e'),_0x1ab876,_0x11b1ff,'pdf'));}else{_0xe01614=path[_0x9a3b('0x3a')](_0x4a0928,util[_0x9a3b('0x1c')](_0x9a3b('0x3f'),_0x1ab876,_0x9a3b('0x40')));}_0x3db4c0[_0x9a3b('0x18')](writePDFDocument(_0x1a1ad9,_0xe01614));}return Promise['all'](_0x3db4c0);})[_0x9a3b('0x2e')](function(){if(_0x5c865e){return new Promise(function(_0x4a2893){zipdir(path[_0x9a3b('0x3a')](_0x4a0928,_0x1ab876),{'saveTo':path[_0x9a3b('0x3a')](_0x4a0928,util[_0x9a3b('0x1c')]('%s.%s',_0x1ab876,'zip'))},function(){rimraf(path[_0x9a3b('0x3a')](_0x4a0928,_0x1ab876),function(){});_0x4a2893('zip\x20finished');});});}})[_0x9a3b('0x2e')](function(){if(!_0x5c865e)return;rimraf(path[_0x9a3b('0x3a')](_0x4a0928,_0x1ab876),function(){});})[_0x9a3b('0x2e')](function(){logger[_0x9a3b('0x41')](util[_0x9a3b('0x1c')](_0x9a3b('0x42'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport('Completed',_0x5c865e?util[_0x9a3b('0x1c')](_0x9a3b('0x3f'),_0x1ab876,_0x5c865e?_0x9a3b('0x43'):'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x9a3b('0x41')](util[_0x9a3b('0x1c')](_0x9a3b('0x44'),EXTRACTED_REPORT_ID,_0x9a3b('0x45')));return db[_0x9a3b('0xe')][_0x9a3b('0x46')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x9a3b('0x2e')](function(_0x586992){EXTRACTED_REPORT=_0x586992;return dbH[_0x9a3b('0x33')][_0x9a3b('0x31')](util[_0x9a3b('0x1c')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x9a3b('0x33')][_0x9a3b('0x34')][_0x9a3b('0x35')]});})[_0x9a3b('0x2e')](extractReport)[_0x9a3b('0x47')](function(_0x2c9baa){logger['info'](util['format'](_0x9a3b('0x48'),EXTRACTED_REPORT_ID,_0x9a3b('0x45')),util['inspect'](_0x2c9baa,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x9a3b('0x49'));})['finally'](function(){process[_0x9a3b('0x4a')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x3d865e=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0x9a3b('0x4b')}});return _0x3d865e;}function getPDFDocDefinitionFromHTML(_0x139d2c,_0x2d168c){var _0x3eed66=util[_0x9a3b('0x1c')](_0x9a3b('0x4c'),_0x2d168c[_0x9a3b('0x4d')],_0x2d168c[_0x9a3b('0x4e')]);var _0x5c6da0=moment()['format'](_0x9a3b('0x4f'))[_0x9a3b('0x12')]();var _0x35194d=htmlToPdfmake(_0x139d2c,{'window':window,'tableAutoSize':!![]});return{'content':[_0x35194d],'defaultStyle':{'font':_0x9a3b('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x9a3b('0x50'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x9a3b('0x50'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x9a3b('0x50')}},'header':function(){return[{'text':_0x9a3b('0x51'),'style':_0x9a3b('0x21')}];},'footer':function(_0x1a3a16,_0x1118a0){return[{'text':util[_0x9a3b('0x1c')](_0x9a3b('0x52'),_0x3eed66,_0x1a3a16,_0x1118a0,_0x5c6da0),'style':_0x9a3b('0x53')}];}};}function writePDFDocument(_0x35519e,_0x53e434){return new Promise(function(_0x3eb583,_0x458cc5){var _0x5dfe33=_0x35519e['pipe'](fs[_0x9a3b('0x54')](_0x53e434));_0x5dfe33['on'](_0x9a3b('0x55'),function(){_0x3eb583(_0x9a3b('0x55'));});_0x5dfe33['on'](_0x9a3b('0x56'),function(_0x45a03e){_0x458cc5(_0x45a03e);});_0x35519e['end']();});}exports[_0x9a3b('0x57')]=function(_0x46583b,_0x2c776a){var _0xe4740d=getPDFPrinter();var _0x490b14=getPDFDocDefinitionFromHTML(_0x46583b,_0x2c776a);var _0x84e97f=_0xe4740d[_0x9a3b('0x3d')](_0x490b14);return writePDFDocument(_0x84e97f,_0x2c776a[_0x9a3b('0x1')])[_0x9a3b('0x47')](function(_0x18a78d){throw _0x18a78d;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 35dd9e3..661fc85 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 _0x25b7=['zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','util','lodash','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','XLSX','Setting','find','split','splitSizeXlsx','then','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','length','isInteger','forEach','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','basename','.xlsx','existsSync','join','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary'];(function(_0x70fe29,_0x1e8b1c){var _0x59c3e3=function(_0x2793d1){while(--_0x2793d1){_0x70fe29['push'](_0x70fe29['shift']());}};_0x59c3e3(++_0x1e8b1c);}(_0x25b7,0x1d4));var _0x725b=function(_0x487261,_0x56f2ba){_0x487261=_0x487261-0x0;var _0x45cc48=_0x25b7[_0x487261];return _0x45cc48;};'use strict';var util=require(_0x725b('0x0'));var path=require('path');var _=require(_0x725b('0x1'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require('bluebird');var zipdir=require(_0x725b('0x2'));var rimraf=require(_0x725b('0x3'));var db=require(_0x725b('0x4'))['db'];var dbH=require(_0x725b('0x4'))[_0x725b('0x5')];var logger=require(_0x725b('0x6'))(_0x725b('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x725b('0x8')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x725b('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xcd7a40,_0x1dffa2){var _0x19280e={'status':_0xcd7a40};var _0x408c2b={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1dffa2){_0x19280e[_0x725b('0x9')]=_0x1dffa2;}return db[_0x725b('0xa')][_0x725b('0xb')](_0x19280e,_0x408c2b);}function main(){var _0x19acc2=0x1388;var _0x203417;logger[_0x725b('0xc')](util[_0x725b('0xd')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x725b('0xe')));return db[_0x725b('0xf')][_0x725b('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x725b('0x11'),_0x725b('0x12')]})[_0x725b('0x13')](function(_0x5b4f43){if(_0x5b4f43){_0x203417=_0x5b4f43;_0x19acc2=_0x203417[_0x725b('0x12')]||0x1388;}})[_0x725b('0x13')](function(){return dbH['sequelize']['query'](util[_0x725b('0xd')](_0x725b('0x14'),QUERY),{'type':dbH['sequelize'][_0x725b('0x15')][_0x725b('0x16')]});})[_0x725b('0x13')](function(_0x35defd){if(!_0x35defd[0x0][_0x725b('0x17')]){return analyticExtractedReport('Empty');}var _0x510c00=[];var _0x33f64b=0x0;if(_0x203417[_0x725b('0x11')]){if(_0x35defd&&_0x35defd[_0x725b('0x18')]){var _0x391c1e=_['range'](_0x35defd[0x0][_0x725b('0x17')]/_0x19acc2);var _0x194a02=Number[_0x725b('0x19')](_0x35defd[0x0][_0x725b('0x17')]/_0x19acc2)?_0x35defd[0x0][_0x725b('0x17')]%_0x19acc2:0x0;_0x391c1e[_0x725b('0x1a')](function(_0x394191){if(_0x394191>0x0){_0x33f64b+=_0x19acc2;}_0x510c00['push'](dbH[_0x725b('0x1b')][_0x725b('0x1c')](util[_0x725b('0xd')](_0x725b('0x1d'),QUERY,_0x19acc2,_0x33f64b),{'type':dbH[_0x725b('0x1b')][_0x725b('0x15')][_0x725b('0x16')]}));});if(_0x194a02>0x0){_0x33f64b+=_0x19acc2;_0x510c00[_0x725b('0x1e')](dbH['sequelize'][_0x725b('0x1c')](util[_0x725b('0xd')](_0x725b('0x1d'),QUERY,_0x194a02,_0x33f64b),{'type':dbH['sequelize']['QueryTypes'][_0x725b('0x16')]}));}}}else{_0x510c00[_0x725b('0x1e')](dbH[_0x725b('0x1b')]['query'](QUERY,{'type':dbH[_0x725b('0x1b')][_0x725b('0x15')][_0x725b('0x16')]}));}var _0x227191=path[_0x725b('0x1f')](PATH);var _0x5d32b0=path[_0x725b('0x20')](PATH,_0x725b('0x21'));var _0xe176b3=_0x203417[_0x725b('0x11')]&&_0x510c00['length']>0x1;var _0x2a6dff=[];if(!fs[_0x725b('0x22')](path['join'](_0x227191,_0x5d32b0))&&_0xe176b3){fs['mkdirSync'](path[_0x725b('0x23')](_0x227191,_0x5d32b0));}return BPromise[_0x725b('0x24')](_0x510c00,function(_0x5683ca){_0x2a6dff[_0x725b('0x1e')](_0x5683ca);})['then'](function(){for(var _0x2e73ee=0x0;_0x2e73ee<_0x2a6dff[_0x725b('0x18')];_0x2e73ee+=0x1){var _0x577cc5;var _0x54a8db=_0x2a6dff[_0x2e73ee];if(_0xe176b3){_0x577cc5=path[_0x725b('0x23')](_0x227191,_0x5d32b0,util[_0x725b('0xd')](_0x725b('0x25'),_0x5d32b0,_0x2e73ee,_0x725b('0x26')));}else{_0x577cc5=path[_0x725b('0x23')](_0x227191,util[_0x725b('0xd')](_0x725b('0x27'),_0x5d32b0,_0x725b('0x26')));}fs[_0x725b('0x28')](_0x577cc5,json2xls(_0x54a8db),_0x725b('0x29'));}})[_0x725b('0x13')](function(){if(_0xe176b3){return new Promise(function(_0x12b405){zipdir(path[_0x725b('0x23')](_0x227191,_0x5d32b0),{'saveTo':path[_0x725b('0x23')](_0x227191,util[_0x725b('0xd')]('%s.%s',_0x5d32b0,_0x725b('0x2a')))},function(_0xbcbca3,_0xd14c2d){rimraf(path[_0x725b('0x23')](_0x227191,_0x5d32b0),function(){});_0x12b405(_0x725b('0x2b'));});});}})[_0x725b('0x13')](function(){logger[_0x725b('0xc')](util[_0x725b('0xd')](_0x725b('0x2c'),EXTRACTED_REPORT_ID,_0x725b('0xe')));return analyticExtractedReport(_0x725b('0x2d'),_0xe176b3?util['format'](_0x725b('0x27'),_0x5d32b0,_0xe176b3?_0x725b('0x2a'):_0x725b('0x26')):null);});})[_0x725b('0x2e')](function(_0x1bd2c9){logger[_0x725b('0xc')](util[_0x725b('0xd')](_0x725b('0x2f'),EXTRACTED_REPORT_ID,_0x725b('0xe')),util[_0x725b('0x30')](_0x1bd2c9,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x725b('0x31')](function(){process[_0x725b('0x32')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x5919=['util','lodash','json2xls','bluebird','zip-dir','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty','length','range','num','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','existsSync','mkdirSync','join','each','%s%d.%s','xlsx','writeFileSync','binary','%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','inspect','Failed','finally','exit'];(function(_0x527824,_0xc824a9){var _0xc8b8ed=function(_0x1b0e19){while(--_0x1b0e19){_0x527824['push'](_0x527824['shift']());}};_0xc8b8ed(++_0xc824a9);}(_0x5919,0x198));var _0x9591=function(_0x20edcb,_0x4d49a8){_0x20edcb=_0x20edcb-0x0;var _0x1ced78=_0x5919[_0x20edcb];return _0x1ced78;};'use strict';var util=require(_0x9591('0x0'));var path=require('path');var _=require(_0x9591('0x1'));var fs=require('fs');var json2xls=require(_0x9591('0x2'));var BPromise=require(_0x9591('0x3'));var zipdir=require(_0x9591('0x4'));var rimraf=require('rimraf');var db=require(_0x9591('0x5'))['db'];var dbH=require(_0x9591('0x5'))[_0x9591('0x6')];var logger=require('../../config/logger')(_0x9591('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x9591('0x8')][0x2]);var QUERY=process[_0x9591('0x8')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3239e2,_0x360d03){var _0x26d1a8={'status':_0x3239e2};var _0x5deaa9={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x360d03){_0x26d1a8[_0x9591('0x9')]=_0x360d03;}return db[_0x9591('0xa')]['update'](_0x26d1a8,_0x5deaa9);}function main(){var _0x29ca95=0x1388;var _0x1de35d;logger[_0x9591('0xb')](util[_0x9591('0xc')](_0x9591('0xd'),EXTRACTED_REPORT_ID,_0x9591('0xe')));return db['Setting'][_0x9591('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x9591('0x10'),_0x9591('0x11')]})[_0x9591('0x12')](function(_0x311ce1){if(_0x311ce1){_0x1de35d=_0x311ce1;_0x29ca95=_0x1de35d[_0x9591('0x11')]||0x1388;}})[_0x9591('0x12')](function(){return dbH[_0x9591('0x13')][_0x9591('0x14')](util[_0x9591('0xc')](_0x9591('0x15'),QUERY),{'type':dbH[_0x9591('0x13')][_0x9591('0x16')][_0x9591('0x17')]});})[_0x9591('0x12')](function(_0x5677a5){if(!_0x5677a5[0x0]['num']){return analyticExtractedReport(_0x9591('0x18'));}var _0x58af1e=[];var _0x522fff=0x0;if(_0x1de35d[_0x9591('0x10')]){if(_0x5677a5&&_0x5677a5[_0x9591('0x19')]){var _0xaa543=_[_0x9591('0x1a')](_0x5677a5[0x0][_0x9591('0x1b')]/_0x29ca95);var _0x1d7613=Number[_0x9591('0x1c')](_0x5677a5[0x0][_0x9591('0x1b')]/_0x29ca95)?_0x5677a5[0x0][_0x9591('0x1b')]%_0x29ca95:0x0;_0xaa543['forEach'](function(_0x538dac){if(_0x538dac>0x0){_0x522fff+=_0x29ca95;}_0x58af1e[_0x9591('0x1d')](dbH[_0x9591('0x13')][_0x9591('0x14')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x29ca95,_0x522fff),{'type':dbH[_0x9591('0x13')][_0x9591('0x16')]['SELECT']}));});if(_0x1d7613>0x0){_0x522fff+=_0x29ca95;_0x58af1e[_0x9591('0x1d')](dbH[_0x9591('0x13')][_0x9591('0x14')](util[_0x9591('0xc')](_0x9591('0x1e'),QUERY,_0x1d7613,_0x522fff),{'type':dbH[_0x9591('0x13')][_0x9591('0x16')][_0x9591('0x17')]}));}}}else{_0x58af1e[_0x9591('0x1d')](dbH['sequelize'][_0x9591('0x14')](QUERY,{'type':dbH[_0x9591('0x13')][_0x9591('0x16')]['SELECT']}));}var _0x235735=path[_0x9591('0x1f')](PATH);var _0x4f95b2=path[_0x9591('0x20')](PATH,'.xlsx');var _0x4d6444=_0x1de35d['split']&&_0x58af1e[_0x9591('0x19')]>0x1;var _0xfa9dab=[];if(!fs[_0x9591('0x21')](path['join'](_0x235735,_0x4f95b2))&&_0x4d6444){fs[_0x9591('0x22')](path[_0x9591('0x23')](_0x235735,_0x4f95b2));}return BPromise[_0x9591('0x24')](_0x58af1e,function(_0x49357f){_0xfa9dab['push'](_0x49357f);})['then'](function(){for(var _0x9e463d=0x0;_0x9e463d<_0xfa9dab[_0x9591('0x19')];_0x9e463d+=0x1){var _0xe6d7d6;var _0x493bc5=_0xfa9dab[_0x9e463d];if(_0x4d6444){_0xe6d7d6=path[_0x9591('0x23')](_0x235735,_0x4f95b2,util['format'](_0x9591('0x25'),_0x4f95b2,_0x9e463d,'xlsx'));}else{_0xe6d7d6=path[_0x9591('0x23')](_0x235735,util[_0x9591('0xc')]('%s.%s',_0x4f95b2,_0x9591('0x26')));}fs[_0x9591('0x27')](_0xe6d7d6,json2xls(_0x493bc5),_0x9591('0x28'));}})['then'](function(){if(_0x4d6444){return new Promise(function(_0x3d47d9){zipdir(path[_0x9591('0x23')](_0x235735,_0x4f95b2),{'saveTo':path[_0x9591('0x23')](_0x235735,util['format'](_0x9591('0x29'),_0x4f95b2,_0x9591('0x2a')))},function(_0x5aeb2c,_0x1407e5){rimraf(path['join'](_0x235735,_0x4f95b2),function(){});_0x3d47d9('zip\x20finished');});});}})[_0x9591('0x12')](function(){logger[_0x9591('0xb')](util[_0x9591('0xc')](_0x9591('0x2b'),EXTRACTED_REPORT_ID,_0x9591('0xe')));return analyticExtractedReport(_0x9591('0x2c'),_0x4d6444?util[_0x9591('0xc')](_0x9591('0x29'),_0x4f95b2,_0x4d6444?_0x9591('0x2a'):_0x9591('0x26')):null);});})[_0x9591('0x2d')](function(_0x5aab71){logger[_0x9591('0xb')](util[_0x9591('0xc')](_0x9591('0x2e'),EXTRACTED_REPORT_ID,_0x9591('0xe')),util[_0x9591('0x2f')](_0x5aab71,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x9591('0x30'));})[_0x9591('0x31')](function(){process[_0x9591('0x32')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 2068beb..c6aeee4 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 _0xe8cd=['lodash','findAll','intervals','models','VoiceExtension','IntervalId','then','uniq','map','exten','filter','groupBy','queue','playback','hasOwnProperty','extensions','find','push','Set','format','CDR(type)=%s','context','VoiceExtensionId','type','inbound','priority','outbound','extension','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','length','toLowerCase','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','Hangup','concat','transaction','bulkCreate','sortBy','catch','error'];(function(_0x2ff127,_0x3d6e2b){var _0x53af48=function(_0x4a0c47){while(--_0x4a0c47){_0x2ff127['push'](_0x2ff127['shift']());}};_0x53af48(++_0x3d6e2b);}(_0xe8cd,0x120));var _0xde8c=function(_0x4ed32d,_0x327695){_0x4ed32d=_0x4ed32d-0x0;var _0xf624df=_0xe8cd[_0x4ed32d];return _0xf624df;};'use strict';var _=require(_0xde8c('0x0'));var util=require('util');function rewrite(_0x1a4aad,_0x274414){var _0x144bb8=this;return _0x1a4aad['models']['Interval'][_0xde8c('0x1')]({'raw':!![]})['then'](function(_0x5dc321){_0x144bb8[_0xde8c('0x2')]=_0x5dc321;return _0x1a4aad[_0xde8c('0x3')][_0xde8c('0x4')][_0xde8c('0x1')]({'where':{'IntervalId':_0x274414[_0xde8c('0x5')]},'raw':!![]});})[_0xde8c('0x6')](function(_0x2da507){return _0x1a4aad[_0xde8c('0x3')][_0xde8c('0x4')]['findAll']({'where':{'exten':{'$in':_[_0xde8c('0x7')](_[_0xde8c('0x8')](_0x2da507,_0xde8c('0x9')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0xde8c('0x6')](function(_0x1f5636){var _0x1681a2=_['filter'](_0x1f5636,{'priority':'1'});var _0x15d0da=_[_0xde8c('0xa')](_0x1f5636,{'isApp':0x1});var _0x1a7952=_[_0xde8c('0xb')](_0x15d0da,'exten');var _0x2dd6e3=[_0xde8c('0xc'),_0xde8c('0xd')];var _0x596aa6=[];var _0x5423a5=[];for(var _0x1283db in _0x1a7952){if(_0x1a7952[_0xde8c('0xe')](_0x1283db)){_0x144bb8['priority']=0x2;_0x144bb8[_0xde8c('0xf')]=[];_0x144bb8['extension']=_[_0xde8c('0x10')](_0x1681a2,{'exten':_0x1a7952[_0x1283db][0x0][_0xde8c('0x9')]});_0x144bb8[_0xde8c('0xf')][_0xde8c('0x11')]({'type':_0x1a7952[_0x1283db][0x0]['type'],'app':_0xde8c('0x12'),'appdata':util[_0xde8c('0x13')](_0xde8c('0x14'),_0x1a7952[_0x1283db][0x0]['type']),'context':_0x1a7952[_0x1283db][0x0][_0xde8c('0x15')],'exten':_0x1a7952[_0x1283db][0x0][_0xde8c('0x9')],'priority':_0x144bb8['priority']++,'VoiceExtensionId':_0x1a7952[_0x1283db][0x0][_0xde8c('0x16')]});if(_0x1a7952[_0x1283db][0x0][_0xde8c('0x17')]===_0xde8c('0x18')){_0x144bb8[_0xde8c('0xf')][_0xde8c('0x11')]({'type':_0x1a7952[_0x1283db][0x0][_0xde8c('0x17')],'app':'Set','appdata':'CDR(routeid)='+_0x1a7952[_0x1283db][0x0][_0xde8c('0x16')],'context':_0x1a7952[_0x1283db][0x0][_0xde8c('0x15')],'exten':_0x1a7952[_0x1283db][0x0][_0xde8c('0x9')],'priority':_0x144bb8[_0xde8c('0x19')]++,'VoiceExtensionId':_0x1a7952[_0x1283db][0x0][_0xde8c('0x16')]});}else if(_0x1a7952[_0x1283db][0x0]['type']===_0xde8c('0x1a')){if(_0x144bb8[_0xde8c('0x1b')]){_0x144bb8[_0xde8c('0xf')][_0xde8c('0x11')]({'type':_0x1a7952[_0x1283db][0x0][_0xde8c('0x17')],'app':_0xde8c('0x12'),'appdata':_0xde8c('0x1c')+(_0x144bb8[_0xde8c('0x1b')][_0xde8c('0x1d')]?_0xde8c('0x1e')+_0x144bb8[_0xde8c('0x1b')][_0xde8c('0x1d')]+'}':_0xde8c('0x1f')),'context':_0x1a7952[_0x1283db][0x0][_0xde8c('0x15')],'exten':_0x1a7952[_0x1283db][0x0][_0xde8c('0x9')],'priority':_0x144bb8[_0xde8c('0x19')]++,'VoiceExtensionId':_0x1a7952[_0x1283db][0x0][_0xde8c('0x16')]});}_0x144bb8[_0xde8c('0xf')][_0xde8c('0x11')]({'type':_0x1a7952[_0x1283db][0x0][_0xde8c('0x17')],'app':_0xde8c('0x12'),'appdata':_0xde8c('0x20')+_0x1a7952[_0x1283db][0x0][_0xde8c('0x16')],'context':_0x1a7952[_0x1283db][0x0]['context'],'exten':_0x1a7952[_0x1283db][0x0][_0xde8c('0x9')],'priority':_0x144bb8[_0xde8c('0x19')]++,'VoiceExtensionId':_0x1a7952[_0x1283db][0x0][_0xde8c('0x16')]});var _0x216462=_0x144bb8[_0xde8c('0x19')]++;_0x144bb8[_0xde8c('0xf')]['push']({'type':_0x1a7952[_0x1283db][0x0][_0xde8c('0x17')],'app':'ExecIf','appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x216462+0x2)+_0xde8c('0x21')+(_0x216462+0x1)+')','context':_0x1a7952[_0x1283db][0x0]['context'],'exten':_0x1a7952[_0x1283db][0x0][_0xde8c('0x9')],'priority':_0x216462,'VoiceExtensionId':_0x1a7952[_0x1283db][0x0][_0xde8c('0x16')]});if(_0x144bb8[_0xde8c('0x1b')]){_0x144bb8[_0xde8c('0xf')][_0xde8c('0x11')]({'type':_0x1a7952[_0x1283db][0x0][_0xde8c('0x17')],'app':_0xde8c('0x12'),'appdata':_0x144bb8[_0xde8c('0x1b')][_0xde8c('0x1d')]?'CDR(prefix)=${EXTEN:0:'+_0x144bb8['extension'][_0xde8c('0x1d')]+'}':_0xde8c('0x22'),'context':_0x1a7952[_0x1283db][0x0][_0xde8c('0x15')],'exten':_0x1a7952[_0x1283db][0x0][_0xde8c('0x9')],'priority':_0x144bb8['priority']++,'VoiceExtensionId':_0x1a7952[_0x1283db][0x0][_0xde8c('0x16')]});}_0x144bb8[_0xde8c('0xf')][_0xde8c('0x11')]({'type':_0x1a7952[_0x1283db][0x0]['type'],'app':_0xde8c('0x12'),'appdata':_0xde8c('0x23')+_0x1a7952[_0x1283db][0x0][_0xde8c('0x16')],'context':_0x1a7952[_0x1283db][0x0]['context'],'exten':_0x1a7952[_0x1283db][0x0]['exten'],'priority':_0x144bb8['priority']++,'VoiceExtensionId':_0x1a7952[_0x1283db][0x0][_0xde8c('0x16')]});if(_0x144bb8[_0xde8c('0x1b')]&&_0x144bb8[_0xde8c('0x1b')]['hasOwnProperty'](_0xde8c('0x24'))&&_0x144bb8[_0xde8c('0x1b')][_0xde8c('0x24')]!==_0xde8c('0x25')){_0x144bb8[_0xde8c('0xf')][_0xde8c('0x11')]({'type':_0x1a7952[_0x1283db][0x0][_0xde8c('0x17')],'app':_0xde8c('0x12'),'appdata':_0xde8c('0x26'),'context':_0x1a7952[_0x1283db][0x0]['context'],'exten':_0x1a7952[_0x1283db][0x0]['exten'],'priority':_0x144bb8[_0xde8c('0x19')]++,'VoiceExtensionId':_0x1a7952[_0x1283db][0x0]['VoiceExtensionId']});_0x144bb8[_0xde8c('0xf')][_0xde8c('0x11')]({'type':_0x1a7952[_0x1283db][0x0][_0xde8c('0x17')],'app':_0xde8c('0x12'),'appdata':_0xde8c('0x27')+_0x144bb8[_0xde8c('0x1b')]['recordingFormat']||_0xde8c('0x28'),'context':_0x1a7952[_0x1283db][0x0][_0xde8c('0x15')],'exten':_0x1a7952[_0x1283db][0x0][_0xde8c('0x9')],'priority':_0x144bb8['priority']++,'VoiceExtensionId':_0x1a7952[_0x1283db][0x0][_0xde8c('0x16')]});}}_0x144bb8['extensions'][_0xde8c('0x11')]({'type':_0x1a7952[_0x1283db][0x0][_0xde8c('0x17')],'app':_0xde8c('0x12'),'appdata':_0xde8c('0x29'),'context':_0x1a7952[_0x1283db][0x0][_0xde8c('0x15')],'exten':_0x1a7952[_0x1283db][0x0][_0xde8c('0x9')],'priority':_0x144bb8[_0xde8c('0x19')]++,'VoiceExtensionId':_0x1a7952[_0x1283db][0x0]['VoiceExtensionId']});_0x144bb8[_0xde8c('0xf')][_0xde8c('0x11')]({'type':_0x1a7952[_0x1283db][0x0]['type'],'app':_0xde8c('0x12'),'appdata':_0xde8c('0x2a'),'context':_0x1a7952[_0x1283db][0x0][_0xde8c('0x15')],'exten':_0x1a7952[_0x1283db][0x0][_0xde8c('0x9')],'priority':_0x144bb8[_0xde8c('0x19')]++,'VoiceExtensionId':_0x1a7952[_0x1283db][0x0]['VoiceExtensionId']});_0x144bb8[_0xde8c('0xf')][_0xde8c('0x11')]({'type':_0x1a7952[_0x1283db][0x0]['type'],'app':_0xde8c('0x12'),'appdata':'MONITOR_OPTIONS=ab','context':_0x1a7952[_0x1283db][0x0][_0xde8c('0x15')],'exten':_0x1a7952[_0x1283db][0x0][_0xde8c('0x9')],'priority':_0x144bb8[_0xde8c('0x19')]++,'VoiceExtensionId':_0x1a7952[_0x1283db][0x0][_0xde8c('0x16')]});for(var _0x5411a1=0x0,_0x5ab5de=0x0;_0x5411a1<_0x1a7952[_0x1283db][_0xde8c('0x2b')];_0x5411a1+=0x1,_0x5ab5de=0x0){var _0x2ff68c=_0x1a7952[_0x1283db][_0x5411a1];if(_0x2ff68c[_0xde8c('0x17')]){_0x2ff68c[_0xde8c('0x17')]=_0x2ff68c[_0xde8c('0x17')][_0xde8c('0x2c')]();}var _0x44a394=[];var _0x34fd4b=[];delete _0x2ff68c['id'];delete _0x2ff68c['createdAt'];delete _0x2ff68c[_0xde8c('0x2d')];var _0x15bbe6=_0x2ff68c[_0xde8c('0x2e')]!==_0xde8c('0x2f')?[_0x2ff68c[_0xde8c('0x2e')]]:_0x2ff68c[_0xde8c('0x5')]?_[_0xde8c('0x8')](_['filter'](_0x144bb8[_0xde8c('0x2')],{'IntervalId':_0x2ff68c[_0xde8c('0x5')]}),_0xde8c('0x2e')):[];if(_0x2ff68c[_0xde8c('0xe')](_0xde8c('0x30'))){if(_0x2ff68c[_0xde8c('0x30')]&&_0x2ff68c['tag']!=='--'){_0x44a394['push']({'type':_0x2ff68c[_0xde8c('0x17')],'app':_0xde8c('0x12'),'appdata':_0xde8c('0x31')+_0x2ff68c[_0xde8c('0x30')],'context':_0x2ff68c[_0xde8c('0x15')],'exten':_0x2ff68c[_0xde8c('0x9')],'priority':_0x15bbe6[_0xde8c('0x2b')]+_0x144bb8['priority']+_0x5ab5de++,'VoiceExtensionId':_0x2ff68c[_0xde8c('0x16')]});}}if(_0x2ff68c[_0xde8c('0x17')]===_0xde8c('0x1a')&&_0x2ff68c[_0xde8c('0xe')](_0xde8c('0x32'))){if(_0x2ff68c['callerID']){_0x44a394[_0xde8c('0x11')]({'type':_0x2ff68c['type'],'app':_0xde8c('0x33'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x2ff68c['callerID']+')','context':_0x2ff68c[_0xde8c('0x15')],'exten':_0x2ff68c[_0xde8c('0x9')],'priority':_0x15bbe6['length']+_0x144bb8['priority']+_0x5ab5de++,'VoiceExtensionId':_0x2ff68c[_0xde8c('0x16')]});}else{_0x44a394[_0xde8c('0x11')]({'type':_0x2ff68c[_0xde8c('0x17')],'app':_0xde8c('0x33'),'appdata':_0xde8c('0x34'),'context':_0x2ff68c['context'],'exten':_0x2ff68c[_0xde8c('0x9')],'priority':_0x15bbe6[_0xde8c('0x2b')]+_0x144bb8[_0xde8c('0x19')]+_0x5ab5de++,'VoiceExtensionId':_0x2ff68c[_0xde8c('0x16')]});}}if(_0x2ff68c[_0xde8c('0xe')](_0xde8c('0x35'))){if(_0x2dd6e3['indexOf'](_0x2ff68c[_0xde8c('0x36')][_0xde8c('0x2c')]())>=0x0&&_0x2ff68c[_0xde8c('0x37')]!==_0xde8c('0x38')){if(_0x2ff68c[_0xde8c('0x35')]){_0x44a394[_0xde8c('0x11')]({'type':_0x2ff68c['type'],'app':_0xde8c('0x33'),'appdata':_0xde8c('0x39'),'context':_0x2ff68c[_0xde8c('0x15')],'exten':_0x2ff68c['exten'],'priority':_0x15bbe6[_0xde8c('0x2b')]+_0x144bb8[_0xde8c('0x19')]+_0x5ab5de++,'VoiceExtensionId':_0x2ff68c[_0xde8c('0x16')]});_0x44a394[_0xde8c('0x11')]({'type':_0x2ff68c['type'],'app':_0xde8c('0x12'),'appdata':_0xde8c('0x3a'),'context':_0x2ff68c[_0xde8c('0x15')],'exten':_0x2ff68c[_0xde8c('0x9')],'priority':_0x15bbe6['length']+_0x144bb8[_0xde8c('0x19')]+_0x5ab5de++,'VoiceExtensionId':_0x2ff68c[_0xde8c('0x16')]});}else{_0x44a394[_0xde8c('0x11')]({'type':_0x2ff68c[_0xde8c('0x17')],'app':_0xde8c('0x33'),'appdata':_0xde8c('0x3b'),'context':_0x2ff68c[_0xde8c('0x15')],'exten':_0x2ff68c[_0xde8c('0x9')],'priority':_0x15bbe6['length']+_0x144bb8[_0xde8c('0x19')]+_0x5ab5de++,'VoiceExtensionId':_0x2ff68c['VoiceExtensionId']});_0x44a394['push']({'type':_0x2ff68c[_0xde8c('0x17')],'app':_0xde8c('0x12'),'appdata':_0xde8c('0x3c'),'context':_0x2ff68c[_0xde8c('0x15')],'exten':_0x2ff68c['exten'],'priority':_0x15bbe6['length']+_0x144bb8[_0xde8c('0x19')]+_0x5ab5de++,'VoiceExtensionId':_0x2ff68c[_0xde8c('0x16')]});}}}for(var _0x1b0d4e=0x0;_0x1b0d4e<_0x15bbe6[_0xde8c('0x2b')];_0x1b0d4e+=0x1){var _0x4901e3=_0x144bb8[_0xde8c('0x19')]+_0x15bbe6['length'];var _0x339054=_0x1b0d4e===_0x15bbe6[_0xde8c('0x2b')]-0x1?_0x144bb8['priority']+_0x44a394[_0xde8c('0x2b')]+_0x34fd4b['length']+0x2:_0x144bb8['priority']+_0x1b0d4e+0x1;_0x44a394[_0xde8c('0x3d')](_0x1b0d4e,0x0,{'type':_0x2ff68c[_0xde8c('0x17')],'app':_0xde8c('0x3e'),'appdata':_0x15bbe6[_0x1b0d4e]+'?'+_0x2ff68c[_0xde8c('0x15')]+',${EXTEN},'+_0x4901e3+':'+_0x2ff68c[_0xde8c('0x15')]+_0xde8c('0x3f')+_0x339054,'exten':_0x2ff68c[_0xde8c('0x9')],'context':_0x2ff68c['context'],'priority':_0x144bb8['priority']+_0x1b0d4e,'VoiceExtensionId':_0x1a7952[_0x1283db][0x0][_0xde8c('0x16')]});}_0x2ff68c['priority']=_0x44a394[_0xde8c('0x2b')]?_[_0xde8c('0x40')](_0x44a394)[_0xde8c('0x19')]+0x1:_0x144bb8[_0xde8c('0x19')];_0x144bb8[_0xde8c('0x19')]=(_0x34fd4b['length']?_[_0xde8c('0x40')](_0x34fd4b)[_0xde8c('0x19')]:_0x2ff68c['priority'])+0x1;_0x144bb8[_0xde8c('0xf')]=_['concat'](_0x144bb8['extensions'],_0x44a394,[_0x2ff68c],_0x34fd4b);}_0x144bb8[_0xde8c('0xf')][_0xde8c('0x11')]({'type':_0x1a7952[_0x1283db][0x0][_0xde8c('0x17')],'app':_0xde8c('0x41'),'exten':_0x1a7952[_0x1283db][0x0][_0xde8c('0x9')],'context':_0x1a7952[_0x1283db][0x0]['context'],'priority':_0x144bb8[_0xde8c('0x19')],'VoiceExtensionId':_0x1a7952[_0x1283db][0x0]['VoiceExtensionId']});_0x596aa6[_0xde8c('0x11')](_0x1a7952[_0x1283db][0x0]['VoiceExtensionId']);_0x5423a5=_[_0xde8c('0x42')](_0x5423a5,_0x144bb8[_0xde8c('0xf')]);}}return _0x1a4aad[_0xde8c('0x43')](function(_0x17eef0){return _0x1a4aad[_0xde8c('0x3')]['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':{'$in':_0x596aa6}},'transaction':_0x17eef0})[_0xde8c('0x6')](function(_0x286585){return _0x1a4aad[_0xde8c('0x3')][_0xde8c('0x4')][_0xde8c('0x44')](_[_0xde8c('0x45')](_0x5423a5,_0xde8c('0x19')),{'transaction':_0x17eef0});});});})[_0xde8c('0x46')](function(_0x28b6e3){console[_0xde8c('0x47')](_0x28b6e3);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0x9238=['lodash','util','Interval','findAll','then','models','VoiceExtension','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','queue','playback','hasOwnProperty','extensions','extension','find','push','type','Set','format','CDR(type)=%s','priority','VoiceExtensionId','inbound','CDR(routeid)=','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','context','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0','length','toLowerCase','updatedAt','interval','IntervalId','intervals','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)','appType','custom','answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite'];(function(_0x126cdc,_0x3fc6b2){var _0x5d2512=function(_0x1eb5e0){while(--_0x1eb5e0){_0x126cdc['push'](_0x126cdc['shift']());}};_0x5d2512(++_0x3fc6b2);}(_0x9238,0x1e3));var _0x8923=function(_0x1d311d,_0xaee192){_0x1d311d=_0x1d311d-0x0;var _0x10d68d=_0x9238[_0x1d311d];return _0x10d68d;};'use strict';var _=require(_0x8923('0x0'));var util=require(_0x8923('0x1'));function rewrite(_0x4de061,_0x1e931e){var _0x45ad65=this;return _0x4de061['models'][_0x8923('0x2')][_0x8923('0x3')]({'raw':!![]})[_0x8923('0x4')](function(_0xa3b1d7){_0x45ad65['intervals']=_0xa3b1d7;return _0x4de061[_0x8923('0x5')][_0x8923('0x6')][_0x8923('0x3')]({'where':{'IntervalId':_0x1e931e['IntervalId']},'raw':!![]});})[_0x8923('0x4')](function(_0x4517f8){return _0x4de061[_0x8923('0x5')][_0x8923('0x6')][_0x8923('0x3')]({'where':{'exten':{'$in':_[_0x8923('0x7')](_[_0x8923('0x8')](_0x4517f8,_0x8923('0x9')))}},'order':[{'raw':_0x8923('0xa')}],'raw':!![]});})[_0x8923('0x4')](function(_0x5495fc){var _0x3f6e2c=_[_0x8923('0xb')](_0x5495fc,{'priority':'1'});var _0x2cd180=_['filter'](_0x5495fc,{'isApp':0x1});var _0x10bdbf=_['groupBy'](_0x2cd180,_0x8923('0x9'));var _0x294196=[_0x8923('0xc'),_0x8923('0xd')];var _0x15eb69=[];var _0x53b423=[];for(var _0x417921 in _0x10bdbf){if(_0x10bdbf[_0x8923('0xe')](_0x417921)){_0x45ad65['priority']=0x2;_0x45ad65[_0x8923('0xf')]=[];_0x45ad65[_0x8923('0x10')]=_[_0x8923('0x11')](_0x3f6e2c,{'exten':_0x10bdbf[_0x417921][0x0][_0x8923('0x9')]});_0x45ad65[_0x8923('0xf')][_0x8923('0x12')]({'type':_0x10bdbf[_0x417921][0x0][_0x8923('0x13')],'app':_0x8923('0x14'),'appdata':util[_0x8923('0x15')](_0x8923('0x16'),_0x10bdbf[_0x417921][0x0][_0x8923('0x13')]),'context':_0x10bdbf[_0x417921][0x0]['context'],'exten':_0x10bdbf[_0x417921][0x0][_0x8923('0x9')],'priority':_0x45ad65[_0x8923('0x17')]++,'VoiceExtensionId':_0x10bdbf[_0x417921][0x0][_0x8923('0x18')]});if(_0x10bdbf[_0x417921][0x0]['type']===_0x8923('0x19')){_0x45ad65[_0x8923('0xf')][_0x8923('0x12')]({'type':_0x10bdbf[_0x417921][0x0][_0x8923('0x13')],'app':_0x8923('0x14'),'appdata':_0x8923('0x1a')+_0x10bdbf[_0x417921][0x0][_0x8923('0x18')],'context':_0x10bdbf[_0x417921][0x0]['context'],'exten':_0x10bdbf[_0x417921][0x0][_0x8923('0x9')],'priority':_0x45ad65['priority']++,'VoiceExtensionId':_0x10bdbf[_0x417921][0x0][_0x8923('0x18')]});}else if(_0x10bdbf[_0x417921][0x0][_0x8923('0x13')]===_0x8923('0x1b')){if(_0x45ad65[_0x8923('0x10')]){_0x45ad65['extensions'][_0x8923('0x12')]({'type':_0x10bdbf[_0x417921][0x0][_0x8923('0x13')],'app':'Set','appdata':_0x8923('0x1c')+(_0x45ad65[_0x8923('0x10')][_0x8923('0x1d')]?_0x8923('0x1e')+_0x45ad65[_0x8923('0x10')][_0x8923('0x1d')]+'}':_0x8923('0x1f')),'context':_0x10bdbf[_0x417921][0x0]['context'],'exten':_0x10bdbf[_0x417921][0x0]['exten'],'priority':_0x45ad65[_0x8923('0x17')]++,'VoiceExtensionId':_0x10bdbf[_0x417921][0x0][_0x8923('0x18')]});}_0x45ad65[_0x8923('0xf')][_0x8923('0x12')]({'type':_0x10bdbf[_0x417921][0x0][_0x8923('0x13')],'app':_0x8923('0x14'),'appdata':'CDR(routeid)='+_0x10bdbf[_0x417921][0x0]['VoiceExtensionId'],'context':_0x10bdbf[_0x417921][0x0]['context'],'exten':_0x10bdbf[_0x417921][0x0][_0x8923('0x9')],'priority':_0x45ad65['priority']++,'VoiceExtensionId':_0x10bdbf[_0x417921][0x0][_0x8923('0x18')]});var _0x5b3705=_0x45ad65[_0x8923('0x17')]++;_0x45ad65['extensions'][_0x8923('0x12')]({'type':_0x10bdbf[_0x417921][0x0][_0x8923('0x13')],'app':_0x8923('0x20'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x5b3705+0x2)+'):Goto('+(_0x5b3705+0x1)+')','context':_0x10bdbf[_0x417921][0x0][_0x8923('0x21')],'exten':_0x10bdbf[_0x417921][0x0]['exten'],'priority':_0x5b3705,'VoiceExtensionId':_0x10bdbf[_0x417921][0x0][_0x8923('0x18')]});if(_0x45ad65[_0x8923('0x10')]){_0x45ad65[_0x8923('0xf')][_0x8923('0x12')]({'type':_0x10bdbf[_0x417921][0x0][_0x8923('0x13')],'app':_0x8923('0x14'),'appdata':_0x45ad65[_0x8923('0x10')][_0x8923('0x1d')]?_0x8923('0x22')+_0x45ad65[_0x8923('0x10')]['cutdigits']+'}':_0x8923('0x23'),'context':_0x10bdbf[_0x417921][0x0]['context'],'exten':_0x10bdbf[_0x417921][0x0][_0x8923('0x9')],'priority':_0x45ad65[_0x8923('0x17')]++,'VoiceExtensionId':_0x10bdbf[_0x417921][0x0][_0x8923('0x18')]});}_0x45ad65[_0x8923('0xf')][_0x8923('0x12')]({'type':_0x10bdbf[_0x417921][0x0][_0x8923('0x13')],'app':_0x8923('0x14'),'appdata':'outboundrouteid='+_0x10bdbf[_0x417921][0x0]['VoiceExtensionId'],'context':_0x10bdbf[_0x417921][0x0][_0x8923('0x21')],'exten':_0x10bdbf[_0x417921][0x0]['exten'],'priority':_0x45ad65[_0x8923('0x17')]++,'VoiceExtensionId':_0x10bdbf[_0x417921][0x0][_0x8923('0x18')]});if(_0x45ad65[_0x8923('0x10')]&&_0x45ad65[_0x8923('0x10')][_0x8923('0xe')](_0x8923('0x24'))&&_0x45ad65[_0x8923('0x10')][_0x8923('0x24')]!==_0x8923('0x25')){_0x45ad65[_0x8923('0xf')][_0x8923('0x12')]({'type':_0x10bdbf[_0x417921][0x0][_0x8923('0x13')],'app':_0x8923('0x14'),'appdata':_0x8923('0x26'),'context':_0x10bdbf[_0x417921][0x0][_0x8923('0x21')],'exten':_0x10bdbf[_0x417921][0x0][_0x8923('0x9')],'priority':_0x45ad65[_0x8923('0x17')]++,'VoiceExtensionId':_0x10bdbf[_0x417921][0x0]['VoiceExtensionId']});_0x45ad65['extensions'][_0x8923('0x12')]({'type':_0x10bdbf[_0x417921][0x0][_0x8923('0x13')],'app':_0x8923('0x14'),'appdata':_0x8923('0x27')+_0x45ad65['extension'][_0x8923('0x24')]||'wav','context':_0x10bdbf[_0x417921][0x0]['context'],'exten':_0x10bdbf[_0x417921][0x0][_0x8923('0x9')],'priority':_0x45ad65['priority']++,'VoiceExtensionId':_0x10bdbf[_0x417921][0x0]['VoiceExtensionId']});}}_0x45ad65['extensions'][_0x8923('0x12')]({'type':_0x10bdbf[_0x417921][0x0][_0x8923('0x13')],'app':'Set','appdata':_0x8923('0x28'),'context':_0x10bdbf[_0x417921][0x0][_0x8923('0x21')],'exten':_0x10bdbf[_0x417921][0x0][_0x8923('0x9')],'priority':_0x45ad65[_0x8923('0x17')]++,'VoiceExtensionId':_0x10bdbf[_0x417921][0x0]['VoiceExtensionId']});_0x45ad65[_0x8923('0xf')][_0x8923('0x12')]({'type':_0x10bdbf[_0x417921][0x0]['type'],'app':_0x8923('0x14'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x10bdbf[_0x417921][0x0][_0x8923('0x21')],'exten':_0x10bdbf[_0x417921][0x0][_0x8923('0x9')],'priority':_0x45ad65[_0x8923('0x17')]++,'VoiceExtensionId':_0x10bdbf[_0x417921][0x0][_0x8923('0x18')]});_0x45ad65[_0x8923('0xf')][_0x8923('0x12')]({'type':_0x10bdbf[_0x417921][0x0][_0x8923('0x13')],'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x10bdbf[_0x417921][0x0][_0x8923('0x21')],'exten':_0x10bdbf[_0x417921][0x0][_0x8923('0x9')],'priority':_0x45ad65['priority']++,'VoiceExtensionId':_0x10bdbf[_0x417921][0x0]['VoiceExtensionId']});for(var _0x4f9af2=0x0,_0x359656=0x0;_0x4f9af2<_0x10bdbf[_0x417921][_0x8923('0x29')];_0x4f9af2+=0x1,_0x359656=0x0){var _0x572f40=_0x10bdbf[_0x417921][_0x4f9af2];if(_0x572f40[_0x8923('0x13')]){_0x572f40[_0x8923('0x13')]=_0x572f40[_0x8923('0x13')][_0x8923('0x2a')]();}var _0x1b223d=[];var _0x220595=[];delete _0x572f40['id'];delete _0x572f40['createdAt'];delete _0x572f40[_0x8923('0x2b')];var _0x27c750=_0x572f40['interval']!=='*,*,*,*'?[_0x572f40[_0x8923('0x2c')]]:_0x572f40[_0x8923('0x2d')]?_[_0x8923('0x8')](_[_0x8923('0xb')](_0x45ad65[_0x8923('0x2e')],{'IntervalId':_0x572f40[_0x8923('0x2d')]}),_0x8923('0x2c')):[];if(_0x572f40[_0x8923('0xe')](_0x8923('0x2f'))){if(_0x572f40['tag']&&_0x572f40['tag']!=='--'){_0x1b223d[_0x8923('0x12')]({'type':_0x572f40[_0x8923('0x13')],'app':_0x8923('0x14'),'appdata':'CDR(tag)='+_0x572f40[_0x8923('0x2f')],'context':_0x572f40[_0x8923('0x21')],'exten':_0x572f40['exten'],'priority':_0x27c750[_0x8923('0x29')]+_0x45ad65[_0x8923('0x17')]+_0x359656++,'VoiceExtensionId':_0x572f40[_0x8923('0x18')]});}}if(_0x572f40[_0x8923('0x13')]===_0x8923('0x1b')&&_0x572f40[_0x8923('0xe')]('callerID')){if(_0x572f40[_0x8923('0x30')]){_0x1b223d['push']({'type':_0x572f40[_0x8923('0x13')],'app':_0x8923('0x20'),'appdata':_0x8923('0x31')+_0x572f40['callerID']+')','context':_0x572f40[_0x8923('0x21')],'exten':_0x572f40[_0x8923('0x9')],'priority':_0x27c750[_0x8923('0x29')]+_0x45ad65['priority']+_0x359656++,'VoiceExtensionId':_0x572f40[_0x8923('0x18')]});}else{_0x1b223d[_0x8923('0x12')]({'type':_0x572f40[_0x8923('0x13')],'app':'ExecIf','appdata':_0x8923('0x32'),'context':_0x572f40[_0x8923('0x21')],'exten':_0x572f40[_0x8923('0x9')],'priority':_0x27c750[_0x8923('0x29')]+_0x45ad65[_0x8923('0x17')]+_0x359656++,'VoiceExtensionId':_0x572f40['VoiceExtensionId']});}}if(_0x572f40['hasOwnProperty']('answer')){if(_0x294196['indexOf'](_0x572f40['app'][_0x8923('0x2a')]())>=0x0&&_0x572f40[_0x8923('0x33')]!==_0x8923('0x34')){if(_0x572f40[_0x8923('0x35')]){_0x1b223d[_0x8923('0x12')]({'type':_0x572f40[_0x8923('0x13')],'app':_0x8923('0x20'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x572f40[_0x8923('0x21')],'exten':_0x572f40['exten'],'priority':_0x27c750['length']+_0x45ad65['priority']+_0x359656++,'VoiceExtensionId':_0x572f40['VoiceExtensionId']});_0x1b223d['push']({'type':_0x572f40['type'],'app':_0x8923('0x14'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x572f40[_0x8923('0x21')],'exten':_0x572f40[_0x8923('0x9')],'priority':_0x27c750['length']+_0x45ad65[_0x8923('0x17')]+_0x359656++,'VoiceExtensionId':_0x572f40[_0x8923('0x18')]});}else{_0x1b223d[_0x8923('0x12')]({'type':_0x572f40['type'],'app':_0x8923('0x20'),'appdata':_0x8923('0x36'),'context':_0x572f40['context'],'exten':_0x572f40['exten'],'priority':_0x27c750[_0x8923('0x29')]+_0x45ad65[_0x8923('0x17')]+_0x359656++,'VoiceExtensionId':_0x572f40[_0x8923('0x18')]});_0x1b223d[_0x8923('0x12')]({'type':_0x572f40[_0x8923('0x13')],'app':_0x8923('0x14'),'appdata':_0x8923('0x37'),'context':_0x572f40[_0x8923('0x21')],'exten':_0x572f40[_0x8923('0x9')],'priority':_0x27c750[_0x8923('0x29')]+_0x45ad65[_0x8923('0x17')]+_0x359656++,'VoiceExtensionId':_0x572f40[_0x8923('0x18')]});}}}for(var _0x2f700e=0x0;_0x2f700e<_0x27c750[_0x8923('0x29')];_0x2f700e+=0x1){var _0x24e097=_0x45ad65[_0x8923('0x17')]+_0x27c750[_0x8923('0x29')];var _0x21454c=_0x2f700e===_0x27c750[_0x8923('0x29')]-0x1?_0x45ad65[_0x8923('0x17')]+_0x1b223d[_0x8923('0x29')]+_0x220595[_0x8923('0x29')]+0x2:_0x45ad65[_0x8923('0x17')]+_0x2f700e+0x1;_0x1b223d[_0x8923('0x38')](_0x2f700e,0x0,{'type':_0x572f40[_0x8923('0x13')],'app':_0x8923('0x39'),'appdata':_0x27c750[_0x2f700e]+'?'+_0x572f40[_0x8923('0x21')]+',${EXTEN},'+_0x24e097+':'+_0x572f40[_0x8923('0x21')]+_0x8923('0x3a')+_0x21454c,'exten':_0x572f40[_0x8923('0x9')],'context':_0x572f40[_0x8923('0x21')],'priority':_0x45ad65[_0x8923('0x17')]+_0x2f700e,'VoiceExtensionId':_0x10bdbf[_0x417921][0x0][_0x8923('0x18')]});}_0x572f40[_0x8923('0x17')]=_0x1b223d['length']?_[_0x8923('0x3b')](_0x1b223d)[_0x8923('0x17')]+0x1:_0x45ad65['priority'];_0x45ad65[_0x8923('0x17')]=(_0x220595[_0x8923('0x29')]?_[_0x8923('0x3b')](_0x220595)[_0x8923('0x17')]:_0x572f40[_0x8923('0x17')])+0x1;_0x45ad65[_0x8923('0xf')]=_[_0x8923('0x3c')](_0x45ad65[_0x8923('0xf')],_0x1b223d,[_0x572f40],_0x220595);}_0x45ad65[_0x8923('0xf')]['push']({'type':_0x10bdbf[_0x417921][0x0][_0x8923('0x13')],'app':_0x8923('0x3d'),'exten':_0x10bdbf[_0x417921][0x0]['exten'],'context':_0x10bdbf[_0x417921][0x0][_0x8923('0x21')],'priority':_0x45ad65['priority'],'VoiceExtensionId':_0x10bdbf[_0x417921][0x0]['VoiceExtensionId']});_0x15eb69[_0x8923('0x12')](_0x10bdbf[_0x417921][0x0]['VoiceExtensionId']);_0x53b423=_[_0x8923('0x3c')](_0x53b423,_0x45ad65['extensions']);}}return _0x4de061[_0x8923('0x3e')](function(_0x1b4aeb){return _0x4de061[_0x8923('0x5')][_0x8923('0x6')][_0x8923('0x3f')]({'where':{'VoiceExtensionId':{'$in':_0x15eb69}},'transaction':_0x1b4aeb})[_0x8923('0x4')](function(_0x365f4c){return _0x4de061['models'][_0x8923('0x6')][_0x8923('0x40')](_[_0x8923('0x41')](_0x53b423,'priority'),{'transaction':_0x1b4aeb});});});})[_0x8923('0x42')](function(_0x3cfb87){console[_0x8923('0x43')](_0x3cfb87);});}exports[_0x8923('0x44')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 512a203..111d6cd 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 _0xdc50=['BlackLists','CampaignId','Campaign','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','map','message','join','hasOwnProperty','data','phone','phone\x20not\x20specified!','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','CompanyId','length','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','createdAt','updatedAt','select','field','NOW()','toString','from','cm_contacts','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','into','deletedAt\x20IS\x20NULL','id\x20IN\x20?','str','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','Lists','get','always','sequelize','query','VoiceQueueId','onlyIfOpen','all','CmList'];(function(_0x2c96f6,_0x877207){var _0x6d4808=function(_0x567e0c){while(--_0x567e0c){_0x2c96f6['push'](_0x2c96f6['shift']());}};_0x6d4808(++_0x877207);}(_0xdc50,0x158));var _0x0dc5=function(_0x22b2a7,_0x4a44af){_0x22b2a7=_0x22b2a7-0x0;var _0x45bc49=_0xdc50[_0x22b2a7];return _0x45bc49;};'use strict';var BPromise=require(_0x0dc5('0x0'));var util=require(_0x0dc5('0x1'));var _=require(_0x0dc5('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require(_0x0dc5('0x3'));var Redis=require(_0x0dc5('0x4'));var db=require(_0x0dc5('0x5'))['db'];var config=require(_0x0dc5('0x6'));var logger=require(_0x0dc5('0x7'))(_0x0dc5('0x8'));config[_0x0dc5('0x9')]=_['defaults'](config[_0x0dc5('0x9')],{'host':_0x0dc5('0xa'),'port':0x18eb});var socket=require(_0x0dc5('0xb'))(new Redis(config[_0x0dc5('0x9')]));require(_0x0dc5('0xc'))['register'](socket);try{if(!process[_0x0dc5('0xd')][0x2]||process['argv'][0x2]===_0x0dc5('0xe')||process['argv'][0x2]===_0x0dc5('0xf')){throw new Error(_0x0dc5('0x10'));}var FILEPATH=process[_0x0dc5('0xd')][0x2];if(!process[_0x0dc5('0xd')][0x3]||process[_0x0dc5('0xd')][0x3]==='undefined'||process[_0x0dc5('0xd')][0x3]==='null'||!process[_0x0dc5('0xd')][0x4]||process['argv'][0x4]===_0x0dc5('0xe')||process[_0x0dc5('0xd')][0x4]===_0x0dc5('0xf')){throw new Error(_0x0dc5('0x11'));}var FIELDS=_[_0x0dc5('0x12')](process[_0x0dc5('0xd')][0x3]['split'](','),process[_0x0dc5('0xd')][0x4][_0x0dc5('0x13')](','));if(!process[_0x0dc5('0xd')][0x5]||process[_0x0dc5('0xd')][0x5]===_0x0dc5('0xe')||process[_0x0dc5('0xd')][0x5]===_0x0dc5('0xf')){throw new Error(_0x0dc5('0x14'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x0dc5('0xd')][0x6]&&process['argv'][0x6]!==_0x0dc5('0xe')&&process[_0x0dc5('0xd')][0x6]!=='null'?process[_0x0dc5('0xd')][0x6]:null;var DUPLICATES=process[_0x0dc5('0xd')][0x7]&&process[_0x0dc5('0xd')][0x7]!==_0x0dc5('0xe')&&process[_0x0dc5('0xd')][0x7]!==_0x0dc5('0xf')?process['argv'][0x7]:null;if(!process[_0x0dc5('0xd')][0x8]||process[_0x0dc5('0xd')][0x8]==='undefined'||process[_0x0dc5('0xd')][0x8]===_0x0dc5('0xf')){throw new Error(_0x0dc5('0x15'));}var SOCKET_TIMESTAMP=process[_0x0dc5('0xd')][0x8];}catch(_0x3c15c8){logger[_0x0dc5('0x16')](_0x3c15c8);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(_0x550557,_0x10116a,_0x4f6095,_0x336a5e){var _0x285852={'message':_0x10116a};_0x285852[_0x550557]=!![];if(_0x4f6095){_0x285852[_0x0dc5('0x17')]=_0x4f6095;}if(_0x336a5e){_0x285852['index']=_0x336a5e;}return _0x285852;}function isEmail(_0x542cbc){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))*$/[_0x0dc5('0x18')](_0x542cbc);}function checkRow(_0x3dc1f4,_0x42f5ac,_0x1d4e99){return new BPromise(function(_0x3e2493,_0xbe8890){if(_[_0x0dc5('0x19')](_0x3dc1f4)){return _0xbe8890(handleCheckRowError(_0x0dc5('0x16'),_0x0dc5('0x1a'),null,_0x1d4e99));}if(_0x3dc1f4[_0x0dc5('0x1b')]&&_0x3dc1f4[_0x0dc5('0x1b')]['length']){var _0x54de47=_[_0x0dc5('0x1c')](_0x3dc1f4[_0x0dc5('0x1b')],_0x0dc5('0x1d'))[_0x0dc5('0x1e')](';');return _0xbe8890(handleCheckRowError(_0x0dc5('0x16'),_0x54de47,null,_0x1d4e99));}var _0x14fad3={};for(var _0x455522 in FIELDS){if(FIELDS[_0x0dc5('0x1f')](_0x455522)&&FIELDS[_0x455522]){_0x14fad3[_0x455522]=_0x3dc1f4[_0x0dc5('0x20')][0x0][FIELDS[_0x455522]]||_0x3dc1f4['data'][0x0]['\ufeff'+FIELDS[_0x455522]];}}if(!_0x14fad3['firstName']){return _0xbe8890(handleCheckRowError('error','firstName\x20not\x20specified!',null,_0x1d4e99));}if(!_0x14fad3[_0x0dc5('0x21')]){return _0xbe8890(handleCheckRowError(_0x0dc5('0x16'),_0x0dc5('0x22'),null,_0x1d4e99));}if(_0x14fad3['birthDate']){var _0x26a070=moment(_0x14fad3['birthDate'],_0x0dc5('0x23'));if(!_0x26a070['isValid']()){return _0xbe8890(handleCheckRowError(_0x0dc5('0x16'),_0x0dc5('0x24'),null,_0x1d4e99));}}if(_0x14fad3[_0x0dc5('0x25')]){if(!isEmail(_0x14fad3[_0x0dc5('0x25')])){return _0xbe8890(handleCheckRowError(_0x0dc5('0x16'),_0x0dc5('0x26'),null,_0x1d4e99));}}_0x14fad3['ListId']=LISTID;_0x14fad3[_0x0dc5('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x0dc5('0x28')]&&_0x42f5ac){var _0x168fb7={};for(var _0x1fcbea=0x0,_0x41ee19=DUPLICATES[_0x0dc5('0x28')];_0x1fcbea<_0x41ee19;_0x1fcbea+=0x1){_0x168fb7[DUPLICATES[_0x1fcbea]]=_0x14fad3[DUPLICATES[_0x1fcbea]];}var _0x14efd6=_['find'](_0x42f5ac,_0x168fb7);if(_0x14efd6){return _0xbe8890(handleCheckRowError(_0x0dc5('0x29'),_0x0dc5('0x2a'),_0x14efd6,_0x1d4e99));}}return db[_0x0dc5('0x2b')][_0x0dc5('0x2c')](_0x14fad3,{'raw':!![],'hooks':![],'fields':_[_0x0dc5('0x2d')](_0x14fad3)})[_0x0dc5('0x2e')](function(_0x2dc888){if(DUPLICATES&&DUPLICATES[_0x0dc5('0x28')]&&_0x42f5ac){_0x42f5ac[_0x0dc5('0x2f')](_[_0x0dc5('0x30')](_0x14fad3,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x2dc888['id'];return _0x3e2493();})[_0x0dc5('0x31')](function(_0x27e56a){return _0xbe8890(handleCheckRowError('error',_0x0dc5('0x32')+(_0x27e56a[_0x0dc5('0x1d')]||JSON[_0x0dc5('0x33')](_0x27e56a)),null,_0x1d4e99));});});}function checkHopper(){function _0x3e73b8(){return function(_0x3fecd7){logger[_0x0dc5('0x16')](_0x0dc5('0x34'),_0x0dc5('0x35'),util[_0x0dc5('0x36')](_0x3fecd7,{'showHidden':![],'depth':null}));};}var _0x2a3d50=function(_0x1540bc,_0xb9dda8){var _0x558132=squel[_0x0dc5('0x37')]()['into'](_0x0dc5('0x38'))[_0x0dc5('0x39')]([_0x0dc5('0x21'),_0x0dc5('0x3a'),_0x0dc5('0x3b'),_0x0dc5('0x3c'),_0xb9dda8,_0x0dc5('0x3d'),_0x0dc5('0x3e')],squel[_0x0dc5('0x3f')]()['field'](_0x0dc5('0x21'),_0x0dc5('0x21'))[_0x0dc5('0x40')](_0x0dc5('0x41'),'scheduledAt')[_0x0dc5('0x40')]('id',_0x0dc5('0x3b'))[_0x0dc5('0x40')](LISTID[_0x0dc5('0x42')](),'ListId')['field'](_0x1540bc['id']['toString'](),_0xb9dda8)[_0x0dc5('0x40')](_0x0dc5('0x41'),_0x0dc5('0x3d'))[_0x0dc5('0x40')](_0x0dc5('0x41'),'updatedAt')[_0x0dc5('0x43')](_0x0dc5('0x44'))[_0x0dc5('0x45')]('deletedAt\x20IS\x20NULL')[_0x0dc5('0x45')](_0x0dc5('0x46'),LISTID[_0x0dc5('0x42')]())[_0x0dc5('0x45')](_0x0dc5('0x47'))[_0x0dc5('0x45')](_0x0dc5('0x48'),squel[_0x0dc5('0x3f')]()[_0x0dc5('0x40')]('phone')[_0x0dc5('0x43')](_0x0dc5('0x38'))['where'](_0xb9dda8+_0x0dc5('0x49'),_0x1540bc['id'][_0x0dc5('0x42')]())))[_0x0dc5('0x42')]();return _0x558132;};var _0x2a98e2=function(_0x974ff1,_0xfd7ac6){var _0x1c3836=squel[_0x0dc5('0x37')]()[_0x0dc5('0x4a')]('cm_hopper')[_0x0dc5('0x39')]([_0x0dc5('0x21'),_0x0dc5('0x3a'),_0x0dc5('0x3b'),_0x0dc5('0x3c'),_0xfd7ac6,_0x0dc5('0x3d'),_0x0dc5('0x3e')],squel[_0x0dc5('0x3f')]()['field'](_0x0dc5('0x21'),_0x0dc5('0x21'))[_0x0dc5('0x40')](_0x0dc5('0x41'),_0x0dc5('0x3a'))[_0x0dc5('0x40')]('id',_0x0dc5('0x3b'))[_0x0dc5('0x40')](LISTID[_0x0dc5('0x42')](),_0x0dc5('0x3c'))[_0x0dc5('0x40')](_0x974ff1['id'][_0x0dc5('0x42')](),_0xfd7ac6)[_0x0dc5('0x40')](_0x0dc5('0x41'),_0x0dc5('0x3d'))['field'](_0x0dc5('0x41'),_0x0dc5('0x3e'))[_0x0dc5('0x43')](_0x0dc5('0x44'))['where'](_0x0dc5('0x4b'))[_0x0dc5('0x45')](_0x0dc5('0x46'),LISTID[_0x0dc5('0x42')]())[_0x0dc5('0x45')](_0x0dc5('0x4c'),squel[_0x0dc5('0x4d')](hopperContacts))[_0x0dc5('0x45')](_0x0dc5('0x47'))[_0x0dc5('0x45')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x0dc5('0x40')]('calleridnum')['from']('cm_hopper_final')[_0x0dc5('0x45')](_0xfd7ac6+_0x0dc5('0x49'),_0x974ff1['id']['toString']()))['where'](_0x0dc5('0x48'),squel[_0x0dc5('0x3f')]()[_0x0dc5('0x40')](_0x0dc5('0x21'))['from'](_0x0dc5('0x38'))[_0x0dc5('0x45')](_0xfd7ac6+'\x20=\x20?',_0x974ff1['id'][_0x0dc5('0x42')]())))[_0x0dc5('0x42')]();return _0x1c3836;};function _0x2310e6(_0x534314,_0x3dbdee){var _0x583bab=squel['insert']()[_0x0dc5('0x4a')](_0x0dc5('0x38'))['fromQuery']([_0x0dc5('0x21'),'scheduledAt',_0x0dc5('0x3b'),_0x0dc5('0x3c'),_0x3dbdee,_0x0dc5('0x3d'),_0x0dc5('0x3e')],squel['select']()[_0x0dc5('0x40')]('phone',_0x0dc5('0x21'))[_0x0dc5('0x40')]('NOW()',_0x0dc5('0x3a'))[_0x0dc5('0x40')]('id','ContactId')['field'](LISTID[_0x0dc5('0x42')](),'ListId')[_0x0dc5('0x40')](_0x534314['id']['toString'](),_0x3dbdee)[_0x0dc5('0x40')]('NOW()','createdAt')['field'](_0x0dc5('0x41'),_0x0dc5('0x3e'))[_0x0dc5('0x43')](_0x0dc5('0x44'))[_0x0dc5('0x45')]('deletedAt\x20IS\x20NULL')['where'](_0x0dc5('0x46'),LISTID[_0x0dc5('0x42')]())['where'](_0x0dc5('0x4c'),squel[_0x0dc5('0x4d')](hopperContacts))[_0x0dc5('0x45')](_0x0dc5('0x47')))['toString']();return _0x583bab;}function _0x1b0af4(_0x37f056,_0x1fd3f8){var _0x4d2838=squel[_0x0dc5('0x37')]()['into'](_0x0dc5('0x4e'))[_0x0dc5('0x39')](['phone',_0x0dc5('0x3b'),'ListId',_0x1fd3f8,_0x0dc5('0x3d'),_0x0dc5('0x3e')],squel[_0x0dc5('0x3f')]()[_0x0dc5('0x40')]('phone',_0x0dc5('0x21'))[_0x0dc5('0x40')]('id',_0x0dc5('0x3b'))[_0x0dc5('0x40')](LISTID[_0x0dc5('0x42')](),_0x0dc5('0x3c'))['field'](_0x37f056['id'][_0x0dc5('0x42')](),_0x1fd3f8)[_0x0dc5('0x40')](_0x0dc5('0x41'),_0x0dc5('0x3d'))[_0x0dc5('0x40')]('NOW()',_0x0dc5('0x3e'))[_0x0dc5('0x43')]('cm_contacts')[_0x0dc5('0x45')](_0x0dc5('0x4b'))[_0x0dc5('0x45')](_0x0dc5('0x46'),LISTID[_0x0dc5('0x42')]())[_0x0dc5('0x45')]('id\x20IN\x20?',squel[_0x0dc5('0x4d')](hopperContacts))[_0x0dc5('0x45')](_0x0dc5('0x47')))['toString']();return _0x4d2838;}return db[_0x0dc5('0x4f')][_0x0dc5('0x50')]({'where':{'type':_0x0dc5('0x51')},'attributes':['id',_0x0dc5('0x52')],'include':[{'model':db['CmList'],'as':_0x0dc5('0x53'),'where':{'id':LISTID}}]})[_0x0dc5('0x2e')](function(_0x18520b){var _0x538a40=[];if(_0x18520b){var _0x468f53;for(var _0x2eef00=0x0,_0x4cc639;_0x2eef00<_0x18520b[_0x0dc5('0x28')];_0x2eef00+=0x1){_0x4cc639=_0x18520b[_0x2eef00][_0x0dc5('0x54')]({'plain':!![]});switch(_0x4cc639[_0x0dc5('0x52')]){case _0x0dc5('0x55'):_0x538a40[_0x0dc5('0x2f')](db[_0x0dc5('0x56')][_0x0dc5('0x57')](_0x2a98e2(_0x4cc639,_0x0dc5('0x58')))[_0x0dc5('0x2e')](function(){})[_0x0dc5('0x31')](_0x3e73b8()));break;case _0x0dc5('0x59'):_0x538a40[_0x0dc5('0x2f')](db['sequelize']['query'](_0x2a3d50(_0x4cc639,_0x0dc5('0x58')))['then'](function(){})[_0x0dc5('0x31')](_0x3e73b8()));break;default:_0x538a40['push'](db[_0x0dc5('0x56')][_0x0dc5('0x57')](_0x2310e6(_0x4cc639,_0x0dc5('0x58')))['then'](function(){})['catch'](_0x3e73b8()));}}}return _0x538a40;})[_0x0dc5('0x5a')]()[_0x0dc5('0x2e')](function(){return db['VoiceQueue'][_0x0dc5('0x50')]({'where':{'type':_0x0dc5('0x51')},'attributes':['id'],'include':[{'model':db[_0x0dc5('0x5b')],'as':_0x0dc5('0x5c'),'where':{'id':LISTID}}]})['then'](function(_0x517e59){var _0x47d10a=[];if(_0x517e59){var _0x2c9efa;for(var _0x4396fd=0x0,_0x43a0ab;_0x4396fd<_0x517e59[_0x0dc5('0x28')];_0x4396fd+=0x1){_0x43a0ab=_0x517e59[_0x4396fd]['get']({'plain':!![]});_0x47d10a['push'](db[_0x0dc5('0x56')][_0x0dc5('0x57')](_0x1b0af4(_0x43a0ab,_0x0dc5('0x58')))[_0x0dc5('0x2e')](function(){})[_0x0dc5('0x31')](_0x3e73b8()));}}return _0x47d10a;})['all']();})[_0x0dc5('0x2e')](function(){return db['Campaign'][_0x0dc5('0x50')]({'attributes':['id',_0x0dc5('0x52')],'include':[{'model':db[_0x0dc5('0x5b')],'as':'Lists','where':{'id':LISTID}}]})['then'](function(_0x1c5ede){var _0x404df1=[];if(_0x1c5ede){for(var _0x8d73b9=0x0,_0x110e87;_0x8d73b9<_0x1c5ede[_0x0dc5('0x28')];_0x8d73b9+=0x1){_0x110e87=_0x1c5ede[_0x8d73b9]['get']({'plain':!![]});switch(_0x110e87[_0x0dc5('0x52')]){case _0x0dc5('0x55'):_0x404df1[_0x0dc5('0x2f')](db[_0x0dc5('0x56')][_0x0dc5('0x57')](_0x2a98e2(_0x110e87,_0x0dc5('0x5d')))['then'](function(){})[_0x0dc5('0x31')](_0x3e73b8()));break;case _0x0dc5('0x59'):_0x404df1[_0x0dc5('0x2f')](db[_0x0dc5('0x56')][_0x0dc5('0x57')](_0x2a3d50(_0x110e87,'CampaignId'))[_0x0dc5('0x2e')](function(){})[_0x0dc5('0x31')](_0x3e73b8()));break;default:_0x404df1[_0x0dc5('0x2f')](db[_0x0dc5('0x56')][_0x0dc5('0x57')](_0x2310e6(_0x110e87,_0x0dc5('0x5d')))[_0x0dc5('0x2e')](function(){})[_0x0dc5('0x31')](_0x3e73b8()));}}}return _0x404df1;})['all']();})[_0x0dc5('0x2e')](function(){return db[_0x0dc5('0x5e')][_0x0dc5('0x50')]({'attributes':['id'],'include':[{'model':db[_0x0dc5('0x5b')],'as':_0x0dc5('0x5c'),'where':{'id':LISTID}}]})[_0x0dc5('0x2e')](function(_0x4228d0){var _0x23038b=[];if(_0x4228d0){for(var _0xdc4436=0x0,_0x5180ce;_0xdc4436<_0x4228d0['length'];_0xdc4436+=0x1){_0x5180ce=_0x4228d0[_0xdc4436]['get']({'plain':!![]});_0x23038b[_0x0dc5('0x2f')](db[_0x0dc5('0x56')][_0x0dc5('0x57')](_0x1b0af4(_0x5180ce,_0x0dc5('0x5d')))[_0x0dc5('0x2e')](function(){})[_0x0dc5('0x31')](_0x3e73b8()));}}return _0x23038b;})['all']();})[_0x0dc5('0x31')](function(_0x38899c){logger[_0x0dc5('0x16')]('cmContact,\x20%s,\x20%s','generalCheckHopper',_0x38899c[_0x0dc5('0x1d')]);});}var processPromises=function(_0x23bfa8){return BPromise[_0x0dc5('0x5a')](promises)[_0x0dc5('0x2e')](function(_0xde976f){})[_0x0dc5('0x31')](function(_0x17bc65){logger[_0x0dc5('0x16')](_0x0dc5('0x5f'),JSON[_0x0dc5('0x33')](_0x17bc65));})[_0x0dc5('0x60')](function(){socket[_0x0dc5('0x61')](_0x0dc5('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x23bfa8){return _0x23bfa8[_0x0dc5('0x63')]();}});};var endCsv=function(){return BPromise[_0x0dc5('0x64')]()[_0x0dc5('0x2e')](function(){if(hopperContacts){return checkHopper();}})[_0x0dc5('0x2e')](function(){socket[_0x0dc5('0x61')](_0x0dc5('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x962885){logger['error'](_0x0dc5('0x65'),JSON[_0x0dc5('0x33')](_0x962885));}finally{process[_0x0dc5('0x66')](0x0);}});};process['on'](_0x0dc5('0x67'),function(){logger[_0x0dc5('0x68')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x0dc5('0x64')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x0dc5('0x13')](',');return db['CmContact'][_0x0dc5('0x50')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x0dc5('0x2e')](function(_0x4d18b6){var _0x199b02=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x199b02,{'header':!![],'skipEmptyLines':!![],'step':function(_0x76cc50,_0xa3dd78){total+=0x1;var _0x40dd47=total;promises['push'](checkRow(_0x76cc50,_0x4d18b6,_0x40dd47)['then'](function(){success+=0x1;})[_0x0dc5('0x31')](function(_0x1b582a){if(_0x1b582a[_0x0dc5('0x16')]){errors+=0x1;delete _0x1b582a[_0x0dc5('0x16')];}else if(_0x1b582a[_0x0dc5('0x29')]){duplicates+=0x1;delete _0x1b582a[_0x0dc5('0x29')];}rows['push'](_0x1b582a);}));if(total%0xc8===0x0){_0xa3dd78[_0x0dc5('0x69')]();return processPromises(_0xa3dd78);}},'complete':function(){return processPromises()[_0x0dc5('0x2e')](function(){logger['info'](_0x0dc5('0x6a'));endCsv();});},'error':function(_0x205ec1,_0x40eeb5){logger[_0x0dc5('0x68')](_0x0dc5('0x6b'),JSON[_0x0dc5('0x33')](_0x205ec1));endCsv();}});})[_0x0dc5('0x31')](function(_0x20eb87){logger[_0x0dc5('0x16')](_0x0dc5('0x6c'),JSON['stringify'](_0x20eb87));});}main(); \ No newline at end of file +var _0x9485=['birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','CompanyId','duplicate','Duplicate\x20Contact','keys','then','push','catch','Error\x20while\x20creating\x20contact:\x20','message','cmContact','checkHopper','insert','into','cm_hopper','ContactId','ListId','createdAt','updatedAt','select','field','phone','scheduledAt','toString','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','where','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','fromQuery','id\x20IN\x20?','str','calleridnum','cm_hopper_final','ListId\x20=\x20?','cm_hopper_black','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','onlyIfOpen','VoiceQueueId','query','all','VoiceQueue','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','stringify','finally','emit','contact:csv_','resume','resolve','exit','SIGINT','info','CmContact','parse','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','join','data','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid'];(function(_0x5ad88d,_0xfa76a3){var _0x103675=function(_0xdae36b){while(--_0xdae36b){_0x5ad88d['push'](_0x5ad88d['shift']());}};_0x103675(++_0xfa76a3);}(_0x9485,0xb5));var _0x5948=function(_0x23b761,_0xb04661){_0x23b761=_0x23b761-0x0;var _0xb38ec2=_0x9485[_0x23b761];return _0xb38ec2;};'use strict';var BPromise=require(_0x5948('0x0'));var util=require(_0x5948('0x1'));var _=require(_0x5948('0x2'));var fs=require('fs');var squel=require(_0x5948('0x3'));var Papa=require('papaparse');var Redis=require(_0x5948('0x4'));var db=require(_0x5948('0x5'))['db'];var config=require(_0x5948('0x6'));var logger=require(_0x5948('0x7'))(_0x5948('0x8'));config[_0x5948('0x9')]=_[_0x5948('0xa')](config[_0x5948('0x9')],{'host':_0x5948('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5948('0x9')]));require('../../../api/cmContact/cmContact.socket')[_0x5948('0xc')](socket);try{if(!process[_0x5948('0xd')][0x2]||process[_0x5948('0xd')][0x2]===_0x5948('0xe')||process[_0x5948('0xd')][0x2]===_0x5948('0xf')){throw new Error(_0x5948('0x10'));}var FILEPATH=process[_0x5948('0xd')][0x2];if(!process['argv'][0x3]||process['argv'][0x3]===_0x5948('0xe')||process[_0x5948('0xd')][0x3]==='null'||!process[_0x5948('0xd')][0x4]||process[_0x5948('0xd')][0x4]===_0x5948('0xe')||process[_0x5948('0xd')][0x4]===_0x5948('0xf')){throw new Error(_0x5948('0x11'));}var FIELDS=_[_0x5948('0x12')](process[_0x5948('0xd')][0x3][_0x5948('0x13')](','),process[_0x5948('0xd')][0x4][_0x5948('0x13')](','));if(!process[_0x5948('0xd')][0x5]||process[_0x5948('0xd')][0x5]===_0x5948('0xe')||process[_0x5948('0xd')][0x5]===_0x5948('0xf')){throw new Error(_0x5948('0x14'));}var LISTID=process[_0x5948('0xd')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x5948('0xd')][0x6]!==_0x5948('0xe')&&process[_0x5948('0xd')][0x6]!==_0x5948('0xf')?process[_0x5948('0xd')][0x6]:null;var DUPLICATES=process[_0x5948('0xd')][0x7]&&process[_0x5948('0xd')][0x7]!==_0x5948('0xe')&&process['argv'][0x7]!==_0x5948('0xf')?process[_0x5948('0xd')][0x7]:null;if(!process['argv'][0x8]||process[_0x5948('0xd')][0x8]===_0x5948('0xe')||process['argv'][0x8]===_0x5948('0xf')){throw new Error(_0x5948('0x15'));}var SOCKET_TIMESTAMP=process[_0x5948('0xd')][0x8];}catch(_0x162d2d){logger[_0x5948('0x16')](_0x162d2d);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(_0x12af99,_0xc21a4d,_0x5d203d,_0x424e46){var _0x38de1c={'message':_0xc21a4d};_0x38de1c[_0x12af99]=!![];if(_0x5d203d){_0x38de1c[_0x5948('0x17')]=_0x5d203d;}if(_0x424e46){_0x38de1c[_0x5948('0x18')]=_0x424e46;}return _0x38de1c;}function isEmail(_0x666668){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))*$/[_0x5948('0x19')](_0x666668);}function checkRow(_0x3b6dc2,_0x3b8e80,_0x752373){return new BPromise(function(_0x354292,_0x4d3a38){if(_[_0x5948('0x1a')](_0x3b6dc2)){return _0x4d3a38(handleCheckRowError(_0x5948('0x16'),_0x5948('0x1b'),null,_0x752373));}if(_0x3b6dc2[_0x5948('0x1c')]&&_0x3b6dc2[_0x5948('0x1c')][_0x5948('0x1d')]){var _0x4034f6=_[_0x5948('0x1e')](_0x3b6dc2[_0x5948('0x1c')],'message')[_0x5948('0x1f')](';');return _0x4d3a38(handleCheckRowError(_0x5948('0x16'),_0x4034f6,null,_0x752373));}var _0x576513={};for(var _0x31d272 in FIELDS){if(FIELDS['hasOwnProperty'](_0x31d272)&&FIELDS[_0x31d272]){_0x576513[_0x31d272]=_0x3b6dc2[_0x5948('0x20')][0x0][FIELDS[_0x31d272]]||_0x3b6dc2['data'][0x0]['\ufeff'+FIELDS[_0x31d272]];}}if(!_0x576513['firstName']){return _0x4d3a38(handleCheckRowError('error','firstName\x20not\x20specified!',null,_0x752373));}if(!_0x576513['phone']){return _0x4d3a38(handleCheckRowError(_0x5948('0x16'),_0x5948('0x21'),null,_0x752373));}if(_0x576513[_0x5948('0x22')]){var _0x5360d2=moment(_0x576513[_0x5948('0x22')],_0x5948('0x23'));if(!_0x5360d2[_0x5948('0x24')]()){return _0x4d3a38(handleCheckRowError(_0x5948('0x16'),_0x5948('0x25'),null,_0x752373));}}if(_0x576513['email']){if(!isEmail(_0x576513[_0x5948('0x26')])){return _0x4d3a38(handleCheckRowError('error',_0x5948('0x27'),null,_0x752373));}}_0x576513['ListId']=LISTID;_0x576513[_0x5948('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x5948('0x1d')]&&_0x3b8e80){var _0xb1533c={};for(var _0x137102=0x0,_0x4366ee=DUPLICATES[_0x5948('0x1d')];_0x137102<_0x4366ee;_0x137102+=0x1){_0xb1533c[DUPLICATES[_0x137102]]=_0x576513[DUPLICATES[_0x137102]];}var _0x1eed56=_['find'](_0x3b8e80,_0xb1533c);if(_0x1eed56){return _0x4d3a38(handleCheckRowError(_0x5948('0x29'),_0x5948('0x2a'),_0x1eed56,_0x752373));}}return db['CmContact']['create'](_0x576513,{'raw':!![],'hooks':![],'fields':_[_0x5948('0x2b')](_0x576513)})[_0x5948('0x2c')](function(_0xa49109){if(DUPLICATES&&DUPLICATES['length']&&_0x3b8e80){_0x3b8e80[_0x5948('0x2d')](_['pick'](_0x576513,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0xa49109['id'];return _0x354292();})[_0x5948('0x2e')](function(_0x1fea02){return _0x4d3a38(handleCheckRowError(_0x5948('0x16'),_0x5948('0x2f')+(_0x1fea02[_0x5948('0x30')]||JSON['stringify'](_0x1fea02)),null,_0x752373));});});}function checkHopper(){function _0x5a7a2e(){return function(_0x32001b){logger[_0x5948('0x16')](_0x5948('0x31'),_0x5948('0x32'),util['inspect'](_0x32001b,{'showHidden':![],'depth':null}));};}var _0xc25771=function(_0x171a9b,_0x1e1a8a){var _0x2342c5=squel[_0x5948('0x33')]()[_0x5948('0x34')](_0x5948('0x35'))['fromQuery'](['phone','scheduledAt',_0x5948('0x36'),_0x5948('0x37'),_0x1e1a8a,_0x5948('0x38'),_0x5948('0x39')],squel[_0x5948('0x3a')]()[_0x5948('0x3b')](_0x5948('0x3c'),_0x5948('0x3c'))[_0x5948('0x3b')]('NOW()',_0x5948('0x3d'))['field']('id',_0x5948('0x36'))['field'](LISTID['toString'](),_0x5948('0x37'))[_0x5948('0x3b')](_0x171a9b['id'][_0x5948('0x3e')](),_0x1e1a8a)[_0x5948('0x3b')]('NOW()',_0x5948('0x38'))[_0x5948('0x3b')](_0x5948('0x3f'),'updatedAt')[_0x5948('0x40')](_0x5948('0x41'))['where'](_0x5948('0x42'))[_0x5948('0x43')]('ListId\x20=\x20?',LISTID[_0x5948('0x3e')]())[_0x5948('0x43')](_0x5948('0x44'))[_0x5948('0x43')](_0x5948('0x45'),squel['select']()[_0x5948('0x3b')](_0x5948('0x3c'))[_0x5948('0x40')](_0x5948('0x35'))[_0x5948('0x43')](_0x1e1a8a+_0x5948('0x46'),_0x171a9b['id']['toString']())))['toString']();return _0x2342c5;};var _0x560616=function(_0x10f7bd,_0x23f1ab){var _0xf3c719=squel[_0x5948('0x33')]()[_0x5948('0x34')](_0x5948('0x35'))[_0x5948('0x47')]([_0x5948('0x3c'),_0x5948('0x3d'),_0x5948('0x36'),_0x5948('0x37'),_0x23f1ab,_0x5948('0x38'),_0x5948('0x39')],squel[_0x5948('0x3a')]()[_0x5948('0x3b')](_0x5948('0x3c'),_0x5948('0x3c'))['field']('NOW()','scheduledAt')[_0x5948('0x3b')]('id','ContactId')[_0x5948('0x3b')](LISTID[_0x5948('0x3e')](),_0x5948('0x37'))[_0x5948('0x3b')](_0x10f7bd['id'][_0x5948('0x3e')](),_0x23f1ab)[_0x5948('0x3b')](_0x5948('0x3f'),_0x5948('0x38'))[_0x5948('0x3b')]('NOW()',_0x5948('0x39'))[_0x5948('0x40')](_0x5948('0x41'))['where']('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',LISTID[_0x5948('0x3e')]())['where'](_0x5948('0x48'),squel[_0x5948('0x49')](hopperContacts))[_0x5948('0x43')](_0x5948('0x44'))['where'](_0x5948('0x45'),squel[_0x5948('0x3a')]()[_0x5948('0x3b')](_0x5948('0x4a'))[_0x5948('0x40')](_0x5948('0x4b'))['where'](_0x23f1ab+_0x5948('0x46'),_0x10f7bd['id'][_0x5948('0x3e')]()))[_0x5948('0x43')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0x5948('0x3c'))['from'](_0x5948('0x35'))[_0x5948('0x43')](_0x23f1ab+_0x5948('0x46'),_0x10f7bd['id']['toString']())))[_0x5948('0x3e')]();return _0xf3c719;};function _0x4707c9(_0x4458f3,_0x4ef6fa){var _0x66d814=squel[_0x5948('0x33')]()[_0x5948('0x34')](_0x5948('0x35'))['fromQuery']([_0x5948('0x3c'),_0x5948('0x3d'),_0x5948('0x36'),_0x5948('0x37'),_0x4ef6fa,_0x5948('0x38'),_0x5948('0x39')],squel[_0x5948('0x3a')]()[_0x5948('0x3b')](_0x5948('0x3c'),_0x5948('0x3c'))[_0x5948('0x3b')](_0x5948('0x3f'),_0x5948('0x3d'))['field']('id',_0x5948('0x36'))[_0x5948('0x3b')](LISTID[_0x5948('0x3e')](),_0x5948('0x37'))['field'](_0x4458f3['id'][_0x5948('0x3e')](),_0x4ef6fa)[_0x5948('0x3b')]('NOW()',_0x5948('0x38'))[_0x5948('0x3b')]('NOW()',_0x5948('0x39'))[_0x5948('0x40')](_0x5948('0x41'))['where'](_0x5948('0x42'))['where'](_0x5948('0x4c'),LISTID[_0x5948('0x3e')]())['where'](_0x5948('0x48'),squel[_0x5948('0x49')](hopperContacts))[_0x5948('0x43')](_0x5948('0x44')))[_0x5948('0x3e')]();return _0x66d814;}function _0x6a6b6d(_0x1fabec,_0x174a17){var _0x21d9c9=squel[_0x5948('0x33')]()['into'](_0x5948('0x4d'))[_0x5948('0x47')](['phone',_0x5948('0x36'),_0x5948('0x37'),_0x174a17,_0x5948('0x38'),_0x5948('0x39')],squel[_0x5948('0x3a')]()[_0x5948('0x3b')](_0x5948('0x3c'),_0x5948('0x3c'))[_0x5948('0x3b')]('id','ContactId')[_0x5948('0x3b')](LISTID[_0x5948('0x3e')](),_0x5948('0x37'))['field'](_0x1fabec['id']['toString'](),_0x174a17)[_0x5948('0x3b')]('NOW()',_0x5948('0x38'))['field']('NOW()',_0x5948('0x39'))[_0x5948('0x40')]('cm_contacts')[_0x5948('0x43')]('deletedAt\x20IS\x20NULL')[_0x5948('0x43')](_0x5948('0x4c'),LISTID[_0x5948('0x3e')]())[_0x5948('0x43')]('id\x20IN\x20?',squel[_0x5948('0x49')](hopperContacts))[_0x5948('0x43')]('phone\x20IS\x20NOT\x20NULL'))[_0x5948('0x3e')]();return _0x21d9c9;}return db['VoiceQueue'][_0x5948('0x4e')]({'where':{'type':_0x5948('0x4f')},'attributes':['id',_0x5948('0x50')],'include':[{'model':db[_0x5948('0x51')],'as':_0x5948('0x52'),'where':{'id':LISTID}}]})[_0x5948('0x2c')](function(_0x42211d){var _0x5b6ed6=[];if(_0x42211d){var _0x4e54f1;for(var _0x2cfc7a=0x0,_0x5bea76;_0x2cfc7a<_0x42211d['length'];_0x2cfc7a+=0x1){_0x5bea76=_0x42211d[_0x2cfc7a][_0x5948('0x53')]({'plain':!![]});switch(_0x5bea76['dialCheckDuplicateType']){case _0x5948('0x54'):_0x5b6ed6['push'](db[_0x5948('0x55')]['query'](_0x560616(_0x5bea76,'VoiceQueueId'))[_0x5948('0x2c')](function(){})[_0x5948('0x2e')](_0x5a7a2e()));break;case _0x5948('0x56'):_0x5b6ed6[_0x5948('0x2d')](db['sequelize']['query'](_0xc25771(_0x5bea76,_0x5948('0x57')))[_0x5948('0x2c')](function(){})['catch'](_0x5a7a2e()));break;default:_0x5b6ed6['push'](db['sequelize'][_0x5948('0x58')](_0x4707c9(_0x5bea76,'VoiceQueueId'))[_0x5948('0x2c')](function(){})['catch'](_0x5a7a2e()));}}}return _0x5b6ed6;})[_0x5948('0x59')]()[_0x5948('0x2c')](function(){return db[_0x5948('0x5a')][_0x5948('0x4e')]({'where':{'type':_0x5948('0x4f')},'attributes':['id'],'include':[{'model':db[_0x5948('0x51')],'as':_0x5948('0x5b'),'where':{'id':LISTID}}]})[_0x5948('0x2c')](function(_0xe01ef0){var _0x1d8ffe=[];if(_0xe01ef0){var _0x2b346b;for(var _0x122f7e=0x0,_0x5efee2;_0x122f7e<_0xe01ef0[_0x5948('0x1d')];_0x122f7e+=0x1){_0x5efee2=_0xe01ef0[_0x122f7e][_0x5948('0x53')]({'plain':!![]});_0x1d8ffe[_0x5948('0x2d')](db[_0x5948('0x55')][_0x5948('0x58')](_0x6a6b6d(_0x5efee2,_0x5948('0x57')))[_0x5948('0x2c')](function(){})[_0x5948('0x2e')](_0x5a7a2e()));}}return _0x1d8ffe;})[_0x5948('0x59')]();})['then'](function(){return db[_0x5948('0x5c')]['findAll']({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x5948('0x51')],'as':_0x5948('0x52'),'where':{'id':LISTID}}]})[_0x5948('0x2c')](function(_0x4f822d){var _0x2280aa=[];if(_0x4f822d){for(var _0x29947c=0x0,_0x12554f;_0x29947c<_0x4f822d['length'];_0x29947c+=0x1){_0x12554f=_0x4f822d[_0x29947c][_0x5948('0x53')]({'plain':!![]});switch(_0x12554f[_0x5948('0x50')]){case _0x5948('0x54'):_0x2280aa[_0x5948('0x2d')](db['sequelize'][_0x5948('0x58')](_0x560616(_0x12554f,_0x5948('0x5d')))[_0x5948('0x2c')](function(){})[_0x5948('0x2e')](_0x5a7a2e()));break;case'onlyIfOpen':_0x2280aa[_0x5948('0x2d')](db['sequelize'][_0x5948('0x58')](_0xc25771(_0x12554f,_0x5948('0x5d')))['then'](function(){})[_0x5948('0x2e')](_0x5a7a2e()));break;default:_0x2280aa[_0x5948('0x2d')](db[_0x5948('0x55')][_0x5948('0x58')](_0x4707c9(_0x12554f,_0x5948('0x5d')))[_0x5948('0x2c')](function(){})[_0x5948('0x2e')](_0x5a7a2e()));}}}return _0x2280aa;})['all']();})[_0x5948('0x2c')](function(){return db['Campaign']['findAll']({'attributes':['id'],'include':[{'model':db[_0x5948('0x51')],'as':_0x5948('0x5b'),'where':{'id':LISTID}}]})[_0x5948('0x2c')](function(_0x4766fd){var _0x523fcb=[];if(_0x4766fd){for(var _0x50b3c8=0x0,_0x42800e;_0x50b3c8<_0x4766fd[_0x5948('0x1d')];_0x50b3c8+=0x1){_0x42800e=_0x4766fd[_0x50b3c8][_0x5948('0x53')]({'plain':!![]});_0x523fcb[_0x5948('0x2d')](db[_0x5948('0x55')][_0x5948('0x58')](_0x6a6b6d(_0x42800e,_0x5948('0x5d')))[_0x5948('0x2c')](function(){})[_0x5948('0x2e')](_0x5a7a2e()));}}return _0x523fcb;})[_0x5948('0x59')]();})[_0x5948('0x2e')](function(_0x1a3656){logger[_0x5948('0x16')](_0x5948('0x5e'),_0x5948('0x5f'),_0x1a3656[_0x5948('0x30')]);});}var processPromises=function(_0x5b9f3b){return BPromise['all'](promises)[_0x5948('0x2c')](function(_0x311e6c){})[_0x5948('0x2e')](function(_0x4f2817){logger['error']('Error\x20processing\x20rows\x20block:',JSON[_0x5948('0x60')](_0x4f2817));})[_0x5948('0x61')](function(){socket[_0x5948('0x62')](_0x5948('0x63')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x5b9f3b){return _0x5b9f3b[_0x5948('0x64')]();}});};var endCsv=function(){return BPromise[_0x5948('0x65')]()[_0x5948('0x2c')](function(){if(hopperContacts){return checkHopper();}})[_0x5948('0x2c')](function(){socket[_0x5948('0x62')](_0x5948('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x46726d){logger[_0x5948('0x16')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x5948('0x60')](_0x46726d));}finally{process[_0x5948('0x66')](0x0);}});};process['on'](_0x5948('0x67'),function(){logger[_0x5948('0x68')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x5948('0x65')]()[_0x5948('0x2c')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x5948('0x13')](',');return db[_0x5948('0x69')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x371f91){var _0x28e9d0=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x5948('0x6a')](_0x28e9d0,{'header':!![],'skipEmptyLines':!![],'step':function(_0x570ef1,_0x35850c){total+=0x1;var _0x268379=total;promises[_0x5948('0x2d')](checkRow(_0x570ef1,_0x371f91,_0x268379)[_0x5948('0x2c')](function(){success+=0x1;})[_0x5948('0x2e')](function(_0x285e36){if(_0x285e36[_0x5948('0x16')]){errors+=0x1;delete _0x285e36[_0x5948('0x16')];}else if(_0x285e36[_0x5948('0x29')]){duplicates+=0x1;delete _0x285e36[_0x5948('0x29')];}rows[_0x5948('0x2d')](_0x285e36);}));if(total%0xc8===0x0){_0x35850c['pause']();return processPromises(_0x35850c);}},'complete':function(){return processPromises()[_0x5948('0x2c')](function(){logger[_0x5948('0x68')](_0x5948('0x6b'));endCsv();});},'error':function(_0x10735c,_0x15151f){logger['info']('CSV\x20parse\x20error',JSON[_0x5948('0x60')](_0x10735c));endCsv();}});})[_0x5948('0x2e')](function(_0x563d5b){logger[_0x5948('0x16')](_0x5948('0x6c'),JSON[_0x5948('0x60')](_0x563d5b));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 2a8866f..39827a3 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 _0xb796=['LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','each','contactTypeId','orderBy','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns','CampaignId','campaigns_has_cm_blacklists','campaigns_has_cm_lists','finish','affectedRows','emit','unlink','argv','arguments\x20\x20\x20','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','firstName\x20is\x20mandatory','map','SIGINT','uncaughtException','path','lodash','papaparse','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','defaults','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','from','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','join','then','length','all','AdditionalPhones','split','push','isNil','findOne','CmContactHasItem','update','updated','create','PHONE','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','phone','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','toString','cm_hopper_black','fromQuery','cm_contacts.phone\x20NOT\x20IN\x20(?)','ListId\x20=\x20?','cm_contacts.phone','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','scheduledat','\x22onlyIfOpen\x22','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_hopper.ListId\x20=\x20?','concat','keys','deletedAt\x20IS\x20NULL','min_id','group','Received\x20SIGINT','message','exit','errors','code','sequelize','query','spread','catch','error','campaigns.id','campaigns.dialTimezone','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues_has_cm_lists.CmListId=','dialTimezone','utcOffset','set','offset','info','main','send','start','binding','clone','socket_timestamp','root','.csv','includes','ContactItemType','findAll','name','_description','header','writeFileSync','parse','createReadStream','data','find','trim','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','timezones','\x20not\x20specified','itemTypeId','description','replace','SystemRow','appendFileSync','rows','contact:import:','abort','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);'];(function(_0x476545,_0x5c7a14){var _0x5148ba=function(_0x21b0a4){while(--_0x21b0a4){_0x476545['push'](_0x476545['shift']());}};_0x5148ba(++_0x5c7a14);}(_0xb796,0xd2));var _0x6b79=function(_0xd7d31b,_0xd8651c){_0xd7d31b=_0xd7d31b-0x0;var _0x2d578f=_0xb796[_0xd7d31b];return _0x2d578f;};'use strict';var fs=require('fs');var path=require(_0x6b79('0x0'));var _=require(_0x6b79('0x1'));var Papa=require(_0x6b79('0x2'));var util=require('util');var BPromise=require('bluebird');var moment=require(_0x6b79('0x3'));var squel=require(_0x6b79('0x4'));var Redis=require(_0x6b79('0x5'));var db=require(_0x6b79('0x6'))['db'];var config=require(_0x6b79('0x7'));var shared=require(_0x6b79('0x8'));var logger=require(_0x6b79('0x9'))('import');config['redis']=_[_0x6b79('0xa')](config[_0x6b79('0xb')],{'host':_0x6b79('0xc'),'port':0x18eb});var socket=require(_0x6b79('0xd'))(new Redis(config[_0x6b79('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x6b79('0xe')](_0x6b79('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x6b79('0xe')](_0x6b79('0xf'));function isEmail(_0x3263ce){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))*$/[_0x6b79('0x10')](_0x3263ce);}function selectNotIn(_0x11f6c7,_0x327611,_0x51ba30,_0x6b990c,_0x23ba37){return squel[_0x6b79('0x11')]()[_0x6b79('0x12')]('phone')[_0x6b79('0x13')](_0x6b990c)['join'](_0x327611,null,_0x327611+_0x6b79('0x14')+_0x6b990c+'.'+_0x51ba30)[_0x6b79('0x15')](_0x6b990c+'.'+_0x51ba30+_0x6b79('0x16')+_0x11f6c7+'.'+_0x51ba30)[_0x6b79('0x15')](_0x327611+_0x6b79('0x17')+_0x23ba37[_0x6b79('0x18')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x103d66,_0x306947){promisesAdditionalPhones=[];return db['CmContact']['findAll']({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x6b79('0x19')](function(_0x4b3b4a){if(_0x4b3b4a!==null){var _0x10af17=[];for(var _0x20ba53=0x0;_0x20ba53<_0x4b3b4a[_0x6b79('0x1a')];_0x20ba53++){var _0x515404=_0x4b3b4a[_0x20ba53];_0x10af17['push'](insertAdditionalPhones(_0x515404));}}Promise[_0x6b79('0x1b')](_0x10af17)[_0x6b79('0x19')](function(){_0x103d66({'val':0x1});});});});}function insertAdditionalPhones(_0x415f23){return new Promise(function(_0xa06de1,_0x26fa67){var _0x36a4ac=_0x415f23[_0x6b79('0x1c')];var _0x17e7b8=_0x36a4ac[_0x6b79('0x1d')](';');var _0x16e432=[];orderBy=0x0;for(var _0x346a8a=0x0;_0x346a8a<_0x17e7b8[_0x6b79('0x1a')];_0x346a8a++){_0x16e432[_0x6b79('0x1e')](splitAdditionalPhone(_0x415f23['id'],_0x17e7b8[_0x346a8a]));}Promise[_0x6b79('0x1b')](_0x16e432)[_0x6b79('0x19')](function(){_0xa06de1({'val':_0x17e7b8['length']});});});}function splitAdditionalPhone(_0x529aa9,_0x381456){return new Promise(function(_0xaa11ec,_0x7d61d5){var _0x3d32c2=_0x381456[_0x6b79('0x1d')](':');var _0x435342=_0x3d32c2[0x0];var _0x51a14a=_0x3d32c2[0x1];if(!_[_0x6b79('0x1f')](_0x51a14a)){var _0x728db6=_0x51a14a[_0x6b79('0x1d')]('|');var _0x5b2b6e=[];for(var _0x54e135=0x0;_0x54e135<_0x728db6[_0x6b79('0x1a')];_0x54e135++){if(_0x728db6[_0x54e135]!==''){var _0x76c509=_['filter'](promisesAdditionalPhones,{'contactId':_0x529aa9,'phone':_0x728db6[_0x54e135]});if(_0x76c509[_0x6b79('0x1a')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x529aa9,'contactTypeId':_0x435342,'phone':_0x728db6[_0x54e135],'orderBy':orderBy});}}}_0xaa11ec({'ok':0x1});}else _0xaa11ec({'res':0x0});});}function createAdditionalPhone(_0x573883,_0x438c34,_0x3d1b0d,_0x18d0fd){var _0x308368='';var _0x36d5d4='';var _0x2f5993=_0x3d1b0d[_0x6b79('0x1d')]('§');_0x308368=_0x2f5993[0x0];if(_0x2f5993[_0x6b79('0x1a')]==0x2)_0x36d5d4=_0x2f5993[0x1];return new Promise(function(_0x17c937,_0x17aafe){return db['CmContactHasItem'][_0x6b79('0x20')]({'where':{'CmContactId':_0x573883,'item':_0x308368}})[_0x6b79('0x19')](function(_0x5d7565){if(_0x5d7565){return db[_0x6b79('0x21')][_0x6b79('0x22')]({'ItemTypeId':_0x438c34,'description':_0x36d5d4,'OrderBy':_0x18d0fd},{'where':{'CmContactId':_0x573883,'item':_0x308368}})['then'](function(_0x24f8a5){_0x17c937({'res':_0x6b79('0x23')});});}else{return db[_0x6b79('0x21')][_0x6b79('0x24')]({'CmContactId':_0x573883,'item':_0x308368,'description':_0x36d5d4,'ItemTypeId':_0x438c34,'OrderBy':_0x18d0fd,'ItemClass':_0x6b79('0x25')})[_0x6b79('0x19')](function(_0x2503e4){_0x17c937({'res':'inserted'});});}});});}function insertCmHopper(_0x3eccb6,_0x20a790,_0x5174e2,_0x259fdb,_0x23bd30){var _0xdad1c3=['cm_contacts.phone',_0x6b79('0x26'),_0x6b79('0x27'),_0x6b79('0x28'),_0x20a790+'.'+_0x259fdb,_0x6b79('0x29'),_0x6b79('0x2a'),_0x6b79('0x2b'),_0x6b79('0x2c'),'\x22'+_0x23bd30+'\x22'];return squel[_0x6b79('0x2d')]()[_0x6b79('0x2e')](_0x6b79('0x2f'))['fromQuery']([_0x6b79('0x30'),'scheduledat',_0x6b79('0x31'),_0x6b79('0x32'),_0x259fdb,_0x6b79('0x33'),_0x6b79('0x34'),_0x6b79('0x35'),_0x6b79('0x36'),_0x6b79('0x37')],squel[_0x6b79('0x11')]()[_0x6b79('0x38')](_0xdad1c3)[_0x6b79('0x13')](_0x20a790)[_0x6b79('0x18')](_0x6b79('0x39'),null,_0x6b79('0x3a')+_0x20a790+_0x6b79('0x3b'))[_0x6b79('0x18')](_0x5174e2,null,_0x5174e2+_0x6b79('0x14')+_0x20a790+'.'+_0x259fdb)[_0x6b79('0x15')](_0x20a790+_0x6b79('0x3c'),_0x3eccb6)[_0x6b79('0x15')](_0x6b79('0x3d'),NOW)[_0x6b79('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x20a790,_0x5174e2,_0x259fdb,_0x6b79('0x2f'),[_0x6b79('0x3e'),'\x22onlyIfOpen\x22']))[_0x6b79('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x20a790,_0x5174e2,_0x259fdb,_0x6b79('0x2f'),['\x22always\x22'])))[_0x6b79('0x3f')]();}function insertCmHopperBlack(_0x35ddf7,_0xe0490f,_0x19b49c,_0x24c936){var _0x115812=['cm_contacts.phone','cm_contacts.id',_0x6b79('0x28'),_0xe0490f+'.'+_0x24c936,_0x6b79('0x29'),_0x6b79('0x2a')];return squel[_0x6b79('0x2d')]()[_0x6b79('0x2e')](_0x6b79('0x40'))[_0x6b79('0x41')]([_0x6b79('0x30'),_0x6b79('0x31'),'ListId',_0x24c936,_0x6b79('0x33'),_0x6b79('0x34')],squel[_0x6b79('0x11')]()[_0x6b79('0x38')](_0x115812)['from'](_0xe0490f)[_0x6b79('0x18')](_0x6b79('0x39'),null,_0x6b79('0x3a')+_0xe0490f+_0x6b79('0x3b'))[_0x6b79('0x18')](_0x19b49c,null,_0x19b49c+_0x6b79('0x14')+_0xe0490f+'.'+_0x24c936)[_0x6b79('0x15')](_0xe0490f+_0x6b79('0x3c'),_0x35ddf7)['where'](_0x6b79('0x3d'),NOW)[_0x6b79('0x15')](_0x6b79('0x42'),squel[_0x6b79('0x11')]()['field'](_0x6b79('0x30'))[_0x6b79('0x13')](_0x6b79('0x40'))[_0x6b79('0x15')](_0x6b79('0x43'),_0x35ddf7)['where'](_0x24c936+_0x6b79('0x16')+_0xe0490f+'.'+_0x24c936)))[_0x6b79('0x3f')]();}function insertTzCmHopper(_0x1230af,_0x34ed8b,_0x33f838,_0x39f3e4,_0x36bddc,_0x1b5873){var _0x8c7c70=[_0x6b79('0x44'),_0x6b79('0x45')+_0x1b5873+_0x6b79('0x46'),_0x6b79('0x27'),_0x6b79('0x28'),_0x34ed8b+'.'+_0x39f3e4,'cm_contacts.createdAt',_0x6b79('0x2a'),_0x6b79('0x2b'),'cm_contacts.UserId','\x22'+_0x36bddc+'\x22'];var _0x531f36=squel[_0x6b79('0x2d')]()[_0x6b79('0x2e')]('cm_hopper')[_0x6b79('0x41')]([_0x6b79('0x30'),_0x6b79('0x47'),_0x6b79('0x31'),_0x6b79('0x32'),_0x39f3e4,'createdAt',_0x6b79('0x34'),_0x6b79('0x35'),_0x6b79('0x36'),'recallme'],squel[_0x6b79('0x11')]()[_0x6b79('0x38')](_0x8c7c70)['from'](_0x34ed8b)[_0x6b79('0x18')]('cm_contacts',null,_0x6b79('0x3a')+_0x34ed8b+_0x6b79('0x3b'))[_0x6b79('0x18')](_0x33f838,null,_0x33f838+_0x6b79('0x14')+_0x34ed8b+'.'+_0x39f3e4)['join'](_0x1b5873,null,_0x1b5873+'.id\x20=\x20'+_0x34ed8b+'.'+_0x39f3e4)[_0x6b79('0x15')](_0x34ed8b+_0x6b79('0x3c'),_0x1230af)[_0x6b79('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x6b79('0x42'),selectNotIn(_0x34ed8b,_0x33f838,_0x39f3e4,'cm_hopper',[_0x6b79('0x3e'),_0x6b79('0x48')]))['where'](_0x6b79('0x42'),selectNotIn(_0x34ed8b,_0x33f838,_0x39f3e4,_0x6b79('0x2f'),[_0x6b79('0x3e')])))['toString']();return _0x531f36;}function insertTzCmHopperBlack(_0x413934,_0x50ea8e,_0x5a7234,_0xb95274){var _0x30c17f=[_0x6b79('0x44'),_0x6b79('0x27'),_0x6b79('0x28'),_0x50ea8e+'.'+_0xb95274,_0x6b79('0x29'),'cm_contacts.updatedAt'];return squel[_0x6b79('0x2d')]()[_0x6b79('0x2e')]('cm_hopper_black')[_0x6b79('0x41')]([_0x6b79('0x30'),_0x6b79('0x31'),'ListId',_0xb95274,_0x6b79('0x33'),_0x6b79('0x34')],squel[_0x6b79('0x11')]()[_0x6b79('0x38')](_0x30c17f)['from'](_0x50ea8e)[_0x6b79('0x18')](_0x6b79('0x39'),null,_0x6b79('0x3a')+_0x50ea8e+_0x6b79('0x3b'))['join'](_0x5a7234,null,_0x5a7234+_0x6b79('0x14')+_0x50ea8e+'.'+_0xb95274)['where'](_0x50ea8e+_0x6b79('0x3c'),_0x413934)[_0x6b79('0x15')](_0x6b79('0x3d'),NOW)[_0x6b79('0x15')](_0x6b79('0x42'),squel['select']()['field'](_0x6b79('0x30'))[_0x6b79('0x13')]('cm_hopper_black')['where'](_0x6b79('0x43'),_0x413934)[_0x6b79('0x15')](_0xb95274+'\x20=\x20'+_0x50ea8e+'.'+_0xb95274)))[_0x6b79('0x3f')]();}function insertCmHopperAdditionalPhones(_0x483d23){var _0x83f2c1=[_0x6b79('0x49'),_0x6b79('0x4a'),_0x6b79('0x4b'),_0x6b79('0x4c'),_0x6b79('0x4d')];return squel[_0x6b79('0x2d')]()[_0x6b79('0x2e')](_0x6b79('0x4e'))[_0x6b79('0x41')](['CmHopperId',_0x6b79('0x30'),_0x6b79('0x4f'),_0x6b79('0x33'),'updatedAt'],squel['select']()[_0x6b79('0x38')](_0x83f2c1)['from'](_0x6b79('0x2f'))[_0x6b79('0x18')](_0x6b79('0x39'),null,_0x6b79('0x50'))[_0x6b79('0x18')]('cm_contact_has_items',null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0x6b79('0x15')](_0x6b79('0x51'),_0x483d23)['where'](_0x6b79('0x3d'),NOW))['toString']();}function insertCmContact(_0x8ffa8b,_0x4ae709,_0x1ff63d,_0x47e32d){var _0x12658f=_[_0x6b79('0x52')](_[_0x6b79('0x53')](_0x47e32d),[_0x6b79('0x32'),'CompanyId',_0x6b79('0x33'),_0x6b79('0x34')]);return squel[_0x6b79('0x2d')]()[_0x6b79('0x2e')](_0x6b79('0x39'))[_0x6b79('0x41')](_0x12658f,squel['select']()['fields'](_0x12658f)[_0x6b79('0x13')](_0x4ae709)[_0x6b79('0x15')]('('+_0x1ff63d['join'](',')+')\x20NOT\x20IN\x20?',squel[_0x6b79('0x11')]()[_0x6b79('0x38')](_0x1ff63d)[_0x6b79('0x13')](_0x6b79('0x39'))[_0x6b79('0x15')]('ListId\x20=\x20?',_0x8ffa8b)[_0x6b79('0x15')](_0x6b79('0x54')))['where']('id\x20IN\x20?',squel[_0x6b79('0x11')]()[_0x6b79('0x12')]('MIN(id)',_0x6b79('0x55'))[_0x6b79('0x13')](_0x4ae709)[_0x6b79('0x56')](_0x1ff63d[_0x6b79('0x18')](','))))['toString']();}function handleStop(){logger['info'](_0x6b79('0x57'));stopped=!![];}function handleUncaughtException(_0x2b8ec7){logger['error'](_0x2b8ec7[_0x6b79('0x58')]);process[_0x6b79('0x59')](0x1);}function handleError(_0x5f2454,_0x4fd18d){stats[_0x6b79('0x5a')][_0x6b79('0x1e')]({'name':_0x4fd18d[_0x6b79('0x5b')],'message':_0x4fd18d['message'],'row':_0x5f2454});}function handleQuery(_0x306591){logger['info'](_0x306591);return db[_0x6b79('0x5c')][_0x6b79('0x5d')](_0x306591)[_0x6b79('0x5e')](function(_0x1b0b58){results[_0x6b79('0x1e')](_0x1b0b58);})[_0x6b79('0x5f')](function(_0x5e28b7){logger[_0x6b79('0x60')](_0x5e28b7[_0x6b79('0x58')]);});}function updateTzCampaigns(_0x1d1e3c){return new Promise(function(_0x402833,_0x1498e1){var _0x5b2f4b=squel[_0x6b79('0x11')]()[_0x6b79('0x38')]([_0x6b79('0x61'),_0x6b79('0x62')])['from']('campaigns')[_0x6b79('0x18')]('campaigns_has_cm_lists',null,_0x6b79('0x63'))['where']('campaigns_has_cm_lists.CmListId='+_0x1d1e3c);db['sequelize'][_0x6b79('0x5d')](_0x5b2f4b['toString']())['spread'](function(_0x5b9abf){var _0x4bdaa3=[];for(var _0x519efd=0x0;_0x519efd<_0x5b9abf[_0x6b79('0x1a')];_0x519efd++){_0x4bdaa3['push'](getTimezoneData(_0x5b9abf[_0x519efd],tmp_campaigns));}BPromise[_0x6b79('0x1b')](_0x4bdaa3)[_0x6b79('0x19')](function(){_0x402833({'val':0x1});});})[_0x6b79('0x5f')](function(_0x14f40b){logger['error'](_0x14f40b['message']);_0x402833({'val':0x0});});});}function updateTzVoiceQueues(_0x3a9028){return new Promise(function(_0x4b28f9,_0x1720b4){var _0x58f669=squel[_0x6b79('0x11')]()[_0x6b79('0x38')]([_0x6b79('0x64'),_0x6b79('0x65')])[_0x6b79('0x13')](_0x6b79('0x66'))[_0x6b79('0x18')](_0x6b79('0x67'),null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')[_0x6b79('0x15')](_0x6b79('0x68')+_0x3a9028);db['sequelize'][_0x6b79('0x5d')](_0x58f669['toString']())['spread'](function(_0x378c1f){var _0x2b4799=[];for(var _0x3379c9=0x0;_0x3379c9<_0x378c1f['length'];_0x3379c9++){_0x2b4799[_0x6b79('0x1e')](getTimezoneData(_0x378c1f[_0x3379c9],tmp_voice_queues));}BPromise[_0x6b79('0x1b')](_0x2b4799)[_0x6b79('0x19')](function(){_0x4b28f9({'val':0x1});});})[_0x6b79('0x5f')](function(_0x470498){logger[_0x6b79('0x60')](_0x470498[_0x6b79('0x58')]);_0x4b28f9({'val':0x0});});});}function getTimezoneData(_0x53f84e,_0x3bf0ab){return new Promise(function(_0x46d550,_0x29b98e){var _0x24b734=shared['timezones'];var _0x1a9677=_0x24b734[_0x53f84e[_0x6b79('0x69')]];if(_[_0x6b79('0x1f')](_0x1a9677)){_0x46d550({'ret':0x1});}else{var _0xa99278=_0x1a9677[_0x6b79('0x6a')];var _0x46f4c6=squel[_0x6b79('0x2d')]()['into'](_0x3bf0ab)[_0x6b79('0x6b')]('id',_0x53f84e['id'])[_0x6b79('0x6b')](_0x6b79('0x6c'),_0xa99278)['set'](_0x6b79('0x69'),_0x53f84e['dialTimezone'])[_0x6b79('0x3f')]();return db[_0x6b79('0x5c')][_0x6b79('0x5d')](_0x46f4c6)[_0x6b79('0x5e')](function(_0x1cfac0){_0x46d550({'ret':0x1});})['catch'](function(_0x67eabf){logger[_0x6b79('0x60')](_0x67eabf[_0x6b79('0x58')]);_0x29b98e({'ret':0x1});});}});}function handleTZQuery(_0x167e8f){logger[_0x6b79('0x6d')](_0x167e8f);return db[_0x6b79('0x5c')][_0x6b79('0x5d')](_0x167e8f)[_0x6b79('0x5e')](function(_0x7db4f){})['catch'](function(_0x468f9d){logger[_0x6b79('0x60')](_0x468f9d[_0x6b79('0x58')]);});}function main(_0x4758f4,_0x26d56c,_0x46d29b,_0x3aad90){logger[_0x6b79('0x6d')](_0x6b79('0x6e'),_0x4758f4,JSON['stringify'](_0x26d56c));process[_0x6b79('0x6f')](_0x6b79('0x70'));var _0x5cf05e=_0x26d56c[_0x6b79('0x71')];var _0x4ed4b9=_[_0x6b79('0x72')](_0x5cf05e);var _0x827fb6=_0x26d56c[_0x6b79('0x73')];var _0x312584=path[_0x6b79('0x18')](config[_0x6b79('0x74')],'server/files/tmp',_0x827fb6+_0x6b79('0x75'));hasTZ=_[_0x6b79('0x53')](_0x5cf05e)[_0x6b79('0x76')](_0x6b79('0x69'));var _0x15602d=_[_0x6b79('0x53')](_0x5cf05e)[_0x6b79('0x18')]();logger['info']('header',_0x15602d);db[_0x6b79('0x77')][_0x6b79('0x78')]({'raw':!![],'attributes':['id',_0x6b79('0x79')]})[_0x6b79('0x19')](function(_0xdb14a9){for(var _0x238ec5=0x0;_0x238ec5<_0xdb14a9[_0x6b79('0x1a')];_0x238ec5++){if(_0xdb14a9[_0x238ec5]['name']in _0x5cf05e){contactItemTypes[_0x6b79('0x1e')](_0xdb14a9[_0x238ec5]);delete _0x4ed4b9[_0xdb14a9[_0x238ec5][_0x6b79('0x79')]];hasAdditionalPhones=!![];}for(var _0x26d604 in _0x5cf05e){if(_0xdb14a9[_0x238ec5][_0x6b79('0x79')]+_0x6b79('0x7a')===_0x26d604){phoneDescriptions[_0x6b79('0x1e')]({'itemTypeId':_0xdb14a9[_0x238ec5]['id'],'description':_0x26d604});delete _0x4ed4b9[_0x26d604];}}}if(hasAdditionalPhones)_0x4ed4b9[_0x6b79('0x1c')]='';var _0x1e750f=_[_0x6b79('0x53')](_0x4ed4b9)['join']();logger[_0x6b79('0x6d')](_0x6b79('0x7b'),_0x1e750f);fs[_0x6b79('0x7c')](_0x312584,_0x1e750f+'\x0a');Papa[_0x6b79('0x7d')](fs[_0x6b79('0x7e')](_0x4758f4),{'header':!![],'skipEmptyLines':!![],'step':function(_0x4d207b,_0x48ea52){try{for(var _0x373cff=0x0,_0x35f35b=[];_0x373cff<_0x4d207b[_0x6b79('0x7f')][_0x6b79('0x1a')];_0x373cff++){stats['rows']+=0x1;if(_0x4d207b[_0x6b79('0x5a')][_0x373cff]){handleError(_0x4d207b['data'][_0x373cff],_0x4d207b['errors'][_0x373cff]);}else{var _0x258519=[];var _0x317416=[];var _0x321e2c={};for(var _0x528f37 in _0x5cf05e){let _0x103c02=contactItemTypes[_0x6b79('0x80')](_0x223eba=>_0x223eba[_0x6b79('0x79')]===_0x528f37);let _0x18fdb4=contactItemTypes['find'](_0x2a901a=>_0x2a901a[_0x6b79('0x79')]+_0x6b79('0x7a')===_0x528f37);if(_[_0x6b79('0x1f')](_0x103c02)&&_['isNil'](_0x18fdb4)){if(_0x5cf05e['hasOwnProperty'](_0x528f37)){if(_0x4d207b[_0x6b79('0x7f')][_0x373cff][_0x5cf05e[_0x528f37]]){var _0x1c3b3e=_[_0x6b79('0x81')](_0x4d207b[_0x6b79('0x7f')][_0x373cff][_0x5cf05e[_0x528f37]]['replace'](/"/g,'\x27'));switch(_0x528f37){case _0x6b79('0x47'):var _0x4ad967=moment(_0x1c3b3e,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x4ad967[_0x6b79('0x82')]()){_0x35f35b[_0x6b79('0x1e')]('\x22'+_0x1c3b3e+'\x22');}else{_0x258519[_0x6b79('0x1e')](_0x6b79('0x83'));}break;case'priority':var _0x2c8b7a=parseInt(_0x1c3b3e);_0x1c3b3e=_[_0x6b79('0x84')](_0x2c8b7a)||_0x2c8b7a<0x0||_0x2c8b7a>0x4?_0x3aad90?0x3:0x2:_0x2c8b7a;_0x35f35b[_0x6b79('0x1e')]('\x22'+_0x1c3b3e+'\x22');break;case'UserId':var _0x3e414a=parseInt(_0x1c3b3e);if(_['isNumber'](_0x3e414a)&&_[_0x6b79('0x76')](_0x46d29b,_0x3e414a)){_0x35f35b['push']('\x22'+_0x3e414a+'\x22');}else{_0x258519[_0x6b79('0x1e')](_0x6b79('0x85'));}break;case'email':if(isEmail(_0x1c3b3e)){_0x35f35b['push']('\x22'+_0x1c3b3e+'\x22');}else{_0x258519[_0x6b79('0x1e')](_0x6b79('0x86'));}break;case _0x6b79('0x87'):var _0x415c5c=moment(_0x1c3b3e,'YYYY-MM-DD',!![]);if(_0x415c5c[_0x6b79('0x82')]()){_0x35f35b[_0x6b79('0x1e')]('\x22'+_0x1c3b3e+'\x22');}else{_0x258519[_0x6b79('0x1e')](_0x6b79('0x88'));}break;case _0x6b79('0x69'):var _0x4a1481=shared[_0x6b79('0x89')];var _0x3f2f17=_0x4a1481[_0x1c3b3e];if(!_[_0x6b79('0x1f')](_0x3f2f17)){var _0x1e9973=_0x3f2f17[_0x6b79('0x6a')];_0x35f35b[_0x6b79('0x1e')]('\x22'+_0x1c3b3e+'\x22');_0x35f35b[_0x6b79('0x1e')]('\x22'+_0x1e9973+'\x22');}break;default:_0x35f35b[_0x6b79('0x1e')]('\x22'+_0x1c3b3e+'\x22');}}else{switch(_0x528f37){case'firstName':case _0x6b79('0x30'):_0x258519[_0x6b79('0x1e')](_0x528f37+_0x6b79('0x8a'));break;default:_0x35f35b['push']('\x22\x22');}}}}else{var _0x158d44='';if(!_[_0x6b79('0x1f')](_0x103c02)){if(!_0x321e2c['hasOwnProperty'](_0x103c02['id'])){if(!_[_0x6b79('0x1f')](_0x4d207b[_0x6b79('0x7f')][_0x373cff][_0x5cf05e[_0x528f37]])){var _0x1c3b3e=_[_0x6b79('0x81')](_0x4d207b['data'][_0x373cff][_0x5cf05e[_0x528f37]]['replace'](/"/g,'\x27'));var _0x5b82cc=phoneDescriptions['find'](_0x4d3549=>_0x4d3549[_0x6b79('0x8b')]===_0x103c02['id']);if(!_[_0x6b79('0x1f')](_0x5b82cc)){var _0x274370=_[_0x6b79('0x81')](_0x4d207b[_0x6b79('0x7f')][_0x373cff][_0x5cf05e[_0x5b82cc[_0x6b79('0x8c')]]][_0x6b79('0x8d')](/"/g,'\x27'));if(!_[_0x6b79('0x1f')](_0x274370))_0x1c3b3e=_0x1c3b3e+'§'+_0x274370;}if(_0x158d44=='')_0x158d44=_0x1c3b3e;else _0x158d44+='|'+_0x1c3b3e;}_0x317416[_0x6b79('0x1e')](_0x103c02['id']+':'+_0x158d44);_0x321e2c[_0x103c02['id']]=0x1;}}}}if(hasAdditionalPhones){_0x35f35b[_0x6b79('0x1e')]('\x22'+_0x317416[_0x6b79('0x18')](';')+'\x22');}if(_0x258519[_0x6b79('0x1a')]){handleError(_0x4d207b[_0x6b79('0x7f')][_0x373cff],{'code':_0x6b79('0x8e'),'message':_0x258519[_0x6b79('0x18')]()});}else{fs[_0x6b79('0x8f')](_0x312584,_0x35f35b[_0x6b79('0x18')]()+'\x0a');}_0x35f35b=[];}if(!(stats[_0x6b79('0x90')]%0xc8)){socket['emit'](_0x6b79('0x91')+_0x827fb6,stats);stats[_0x6b79('0x5a')]=[];}}if(stopped){logger[_0x6b79('0x6d')]('Abort\x20parser');_0x48ea52[_0x6b79('0x92')]();}}catch(_0x294daa){handleError(_0x4d207b['data'][_0x373cff],{'code':'SystemError','message':_0x294daa['message']});logger[_0x6b79('0x60')](_0x6b79('0x93'),_0x294daa[_0x6b79('0x58')]);}},'complete':function(){try{var _0x2405be=[];var _0x1c5caf=[];var _0x1cc41a=_0x6b79('0x39');if(_0x26d56c['duplicates']&&_0x26d56c[_0x6b79('0x94')][_0x6b79('0x1a')]){_0x1cc41a=_0x6b79('0x95')+_0x827fb6;_0x2405be['push'](_0x6b79('0x96')+_0x1cc41a+'\x20LIKE\x20cm_contacts;');}tmp_campaigns='campaigns_'+_0x827fb6;tmp_voice_queues='voice_queues_'+_0x827fb6;_0x1c5caf[_0x6b79('0x1e')](_0x6b79('0x96')+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x1c5caf[_0x6b79('0x1e')](_0x6b79('0x96')+tmp_voice_queues+_0x6b79('0x97'));BPromise['each'](_0x1c5caf,handleTZQuery)[_0x6b79('0x19')](function(_0x1dfeb2){updateTzCampaigns(_0x26d56c[_0x6b79('0x32')])[_0x6b79('0x19')](function(_0x2256f3){updateTzVoiceQueues(_0x26d56c[_0x6b79('0x32')])[_0x6b79('0x19')](function(_0x5e31c3){if(hasTZ)_0x1e750f=_0x1e750f[_0x6b79('0x8d')](_0x6b79('0x69'),'dialTimezone,utcOffset');var _0x22d84a=util[_0x6b79('0xe')](_0x6b79('0x98'),_0x312584,_0x1cc41a,_0x1e750f,_0x26d56c['ListId'],_0x26d56c[_0x6b79('0x99')]||null,NOW,NOW);if(_['isNil'](_0x5cf05e[_0x6b79('0x47')])){_0x22d84a+=_0x6b79('0x9a');}_0x2405be[_0x6b79('0x1e')](_0x22d84a);if(_0x26d56c[_0x6b79('0x94')]&&_0x26d56c['duplicates'][_0x6b79('0x1a')]){_0x2405be['push'](insertCmContact(_0x26d56c[_0x6b79('0x32')],_0x1cc41a,_0x26d56c[_0x6b79('0x94')],_0x5cf05e));_0x2405be[_0x6b79('0x1e')](_0x6b79('0x9b')+_0x1cc41a+';');}BPromise[_0x6b79('0x9c')](_0x2405be,handleQuery)[_0x6b79('0x19')](function(_0x2323eb){BPromise[_0x6b79('0x1b')]([handleAdditionalPhones()])['then'](function(){_0x2405be=[];for(var _0x2de0ab=0x0;_0x2de0ab\x20\x20','binding','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path'];(function(_0x594d09,_0x302fb9){var _0xd07832=function(_0x2b6c14){while(--_0x2b6c14){_0x594d09['push'](_0x594d09['shift']());}};_0xd07832(++_0x302fb9);}(_0x079b,0x165));var _0xb079=function(_0x4d1ce8,_0x1a778e){_0x4d1ce8=_0x4d1ce8-0x0;var _0x129384=_0x079b[_0x4d1ce8];return _0x129384;};'use strict';var fs=require('fs');var path=require(_0xb079('0x0'));var _=require(_0xb079('0x1'));var Papa=require(_0xb079('0x2'));var util=require(_0xb079('0x3'));var BPromise=require(_0xb079('0x4'));var moment=require('moment');var squel=require('squel');var Redis=require(_0xb079('0x5'));var db=require(_0xb079('0x6'))['db'];var config=require('../../../config/environment');var shared=require(_0xb079('0x7'));var logger=require(_0xb079('0x8'))('import');config[_0xb079('0x9')]=_[_0xb079('0xa')](config[_0xb079('0x9')],{'host':_0xb079('0xb'),'port':0x18eb});var socket=require(_0xb079('0xc'))(new Redis(config[_0xb079('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xb079('0xd')](_0xb079('0xe'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xb079('0xd')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x2e7330){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))*$/[_0xb079('0xf')](_0x2e7330);}function selectNotIn(_0x8ec67,_0x4e9838,_0x3d0131,_0x444ff1,_0x5e2839){return squel['select']()[_0xb079('0x10')]('phone')[_0xb079('0x11')](_0x444ff1)[_0xb079('0x12')](_0x4e9838,null,_0x4e9838+'.id\x20=\x20'+_0x444ff1+'.'+_0x3d0131)[_0xb079('0x13')](_0x444ff1+'.'+_0x3d0131+'\x20=\x20'+_0x8ec67+'.'+_0x3d0131)[_0xb079('0x13')](_0x4e9838+'.dialCheckDuplicateType\x20IN\x20('+_0x5e2839[_0xb079('0x12')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x3428a4,_0x117ec5){promisesAdditionalPhones=[];return db[_0xb079('0x14')]['findAll']({'raw':!![],'attributes':['id',_0xb079('0x15')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0xb079('0x16')](function(_0x1a14e0){if(_0x1a14e0!==null){var _0x5d9c39=[];for(var _0x54cf7d=0x0;_0x54cf7d<_0x1a14e0['length'];_0x54cf7d++){var _0x342d02=_0x1a14e0[_0x54cf7d];_0x5d9c39[_0xb079('0x17')](insertAdditionalPhones(_0x342d02));}}Promise[_0xb079('0x18')](_0x5d9c39)[_0xb079('0x16')](function(){_0x3428a4({'val':0x1});});});});}function insertAdditionalPhones(_0x582096){return new Promise(function(_0x1f101d,_0x170723){var _0x336629=_0x582096[_0xb079('0x15')];var _0x6acb0=_0x336629[_0xb079('0x19')](';');var _0x4e5310=[];orderBy=0x0;for(var _0xd55d08=0x0;_0xd55d08<_0x6acb0[_0xb079('0x1a')];_0xd55d08++){_0x4e5310['push'](splitAdditionalPhone(_0x582096['id'],_0x6acb0[_0xd55d08]));}Promise[_0xb079('0x18')](_0x4e5310)['then'](function(){_0x1f101d({'val':_0x6acb0[_0xb079('0x1a')]});});});}function splitAdditionalPhone(_0x42cb57,_0x250244){return new Promise(function(_0x32d541,_0x42d0dd){var _0x3d93ac=_0x250244[_0xb079('0x19')](':');var _0x309b26=_0x3d93ac[0x0];var _0x3a8ad7=_0x3d93ac[0x1];if(!_[_0xb079('0x1b')](_0x3a8ad7)){var _0x27d885=_0x3a8ad7[_0xb079('0x19')]('|');var _0x1e5b95=[];for(var _0x136b22=0x0;_0x136b22<_0x27d885[_0xb079('0x1a')];_0x136b22++){if(_0x27d885[_0x136b22]!==''){var _0x32116d=_[_0xb079('0x1c')](promisesAdditionalPhones,{'contactId':_0x42cb57,'phone':_0x27d885[_0x136b22]});if(_0x32116d[_0xb079('0x1a')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x42cb57,'contactTypeId':_0x309b26,'phone':_0x27d885[_0x136b22],'orderBy':orderBy});}}}_0x32d541({'ok':0x1});}else _0x32d541({'res':0x0});});}function createAdditionalPhone(_0x13f0cf,_0x3041e5,_0x5ef466,_0x43eae2){var _0x57f45a='';var _0x4d627c='';var _0x2e749d=_0x5ef466[_0xb079('0x19')]('§');_0x57f45a=_0x2e749d[0x0];if(_0x2e749d[_0xb079('0x1a')]==0x2)_0x4d627c=_0x2e749d[0x1];return new Promise(function(_0xd68eda,_0x412bb2){return db['CmContactHasItem'][_0xb079('0x1d')]({'where':{'CmContactId':_0x13f0cf,'item':_0x57f45a}})['then'](function(_0x177fb6){if(_0x177fb6){return db[_0xb079('0x1e')][_0xb079('0x1f')]({'ItemTypeId':_0x3041e5,'description':_0x4d627c,'OrderBy':_0x43eae2},{'where':{'CmContactId':_0x13f0cf,'item':_0x57f45a}})[_0xb079('0x16')](function(_0x591575){_0xd68eda({'res':_0xb079('0x20')});});}else{return db['CmContactHasItem'][_0xb079('0x21')]({'CmContactId':_0x13f0cf,'item':_0x57f45a,'description':_0x4d627c,'ItemTypeId':_0x3041e5,'OrderBy':_0x43eae2,'ItemClass':_0xb079('0x22')})[_0xb079('0x16')](function(_0x17ce18){_0xd68eda({'res':_0xb079('0x23')});});}});});}function insertCmHopper(_0x3c1d47,_0x12207b,_0x2e9b01,_0x5038ca,_0x5e853c){var _0x1a0fb1=[_0xb079('0x24'),_0xb079('0x25'),_0xb079('0x26'),_0xb079('0x27'),_0x12207b+'.'+_0x5038ca,'cm_contacts.createdAt','cm_contacts.updatedAt',_0xb079('0x28'),_0xb079('0x29'),'\x22'+_0x5e853c+'\x22'];return squel['insert']()[_0xb079('0x2a')](_0xb079('0x2b'))['fromQuery'](['phone',_0xb079('0x2c'),_0xb079('0x2d'),_0xb079('0x2e'),_0x5038ca,_0xb079('0x2f'),'updatedAt',_0xb079('0x30'),_0xb079('0x31'),_0xb079('0x32')],squel[_0xb079('0x33')]()[_0xb079('0x34')](_0x1a0fb1)['from'](_0x12207b)['join'](_0xb079('0x35'),null,_0xb079('0x36')+_0x12207b+_0xb079('0x37'))[_0xb079('0x12')](_0x2e9b01,null,_0x2e9b01+_0xb079('0x38')+_0x12207b+'.'+_0x5038ca)[_0xb079('0x13')](_0x12207b+_0xb079('0x39'),_0x3c1d47)[_0xb079('0x13')](_0xb079('0x3a'),NOW)[_0xb079('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x12207b,_0x2e9b01,_0x5038ca,_0xb079('0x2b'),[_0xb079('0x3b'),_0xb079('0x3c')]))[_0xb079('0x13')](_0xb079('0x3d'),selectNotIn(_0x12207b,_0x2e9b01,_0x5038ca,_0xb079('0x2b'),[_0xb079('0x3b')])))[_0xb079('0x3e')]();}function insertCmHopperBlack(_0x3c9792,_0x1cdafa,_0x31ad19,_0x3f735e){var _0x19bdc1=[_0xb079('0x24'),_0xb079('0x26'),_0xb079('0x27'),_0x1cdafa+'.'+_0x3f735e,_0xb079('0x3f'),_0xb079('0x40')];return squel[_0xb079('0x41')]()[_0xb079('0x2a')](_0xb079('0x42'))[_0xb079('0x43')]([_0xb079('0x44'),_0xb079('0x2d'),_0xb079('0x2e'),_0x3f735e,_0xb079('0x2f'),_0xb079('0x45')],squel[_0xb079('0x33')]()[_0xb079('0x34')](_0x19bdc1)['from'](_0x1cdafa)['join'](_0xb079('0x35'),null,_0xb079('0x36')+_0x1cdafa+'.CmListId')[_0xb079('0x12')](_0x31ad19,null,_0x31ad19+_0xb079('0x38')+_0x1cdafa+'.'+_0x3f735e)['where'](_0x1cdafa+_0xb079('0x39'),_0x3c9792)[_0xb079('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0xb079('0x3d'),squel['select']()[_0xb079('0x10')](_0xb079('0x44'))[_0xb079('0x11')](_0xb079('0x42'))['where'](_0xb079('0x46'),_0x3c9792)[_0xb079('0x13')](_0x3f735e+_0xb079('0x47')+_0x1cdafa+'.'+_0x3f735e)))[_0xb079('0x3e')]();}function insertTzCmHopper(_0x1dab3a,_0x502aa9,_0x127c74,_0x109dc6,_0x5bd2ee,_0x214489){var _0x432e1d=['cm_contacts.phone',_0xb079('0x48')+_0x214489+_0xb079('0x49'),_0xb079('0x26'),'cm_contacts.ListId',_0x502aa9+'.'+_0x109dc6,_0xb079('0x3f'),'cm_contacts.updatedAt',_0xb079('0x28'),'cm_contacts.UserId','\x22'+_0x5bd2ee+'\x22'];var _0x3bb50f=squel[_0xb079('0x41')]()['into'](_0xb079('0x2b'))[_0xb079('0x43')](['phone',_0xb079('0x2c'),'ContactId',_0xb079('0x2e'),_0x109dc6,'createdAt','updatedAt','priority',_0xb079('0x31'),_0xb079('0x32')],squel[_0xb079('0x33')]()[_0xb079('0x34')](_0x432e1d)[_0xb079('0x11')](_0x502aa9)[_0xb079('0x12')]('cm_contacts',null,_0xb079('0x36')+_0x502aa9+_0xb079('0x37'))[_0xb079('0x12')](_0x127c74,null,_0x127c74+_0xb079('0x38')+_0x502aa9+'.'+_0x109dc6)[_0xb079('0x12')](_0x214489,null,_0x214489+_0xb079('0x38')+_0x502aa9+'.'+_0x109dc6)[_0xb079('0x13')](_0x502aa9+_0xb079('0x39'),_0x1dab3a)[_0xb079('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xb079('0x13')](_0xb079('0x3d'),selectNotIn(_0x502aa9,_0x127c74,_0x109dc6,_0xb079('0x2b'),[_0xb079('0x3b'),'\x22onlyIfOpen\x22']))[_0xb079('0x13')](_0xb079('0x3d'),selectNotIn(_0x502aa9,_0x127c74,_0x109dc6,_0xb079('0x2b'),[_0xb079('0x3b')])))['toString']();return _0x3bb50f;}function insertTzCmHopperBlack(_0x2cfc67,_0x252b3f,_0x7647a7,_0x303e56){var _0x175c71=[_0xb079('0x24'),_0xb079('0x26'),_0xb079('0x27'),_0x252b3f+'.'+_0x303e56,_0xb079('0x3f'),'cm_contacts.updatedAt'];return squel[_0xb079('0x41')]()[_0xb079('0x2a')](_0xb079('0x42'))['fromQuery']([_0xb079('0x44'),_0xb079('0x2d'),_0xb079('0x2e'),_0x303e56,'createdAt','updatedAt'],squel[_0xb079('0x33')]()[_0xb079('0x34')](_0x175c71)[_0xb079('0x11')](_0x252b3f)[_0xb079('0x12')](_0xb079('0x35'),null,_0xb079('0x36')+_0x252b3f+_0xb079('0x37'))[_0xb079('0x12')](_0x7647a7,null,_0x7647a7+'.id\x20=\x20'+_0x252b3f+'.'+_0x303e56)[_0xb079('0x13')](_0x252b3f+_0xb079('0x39'),_0x2cfc67)[_0xb079('0x13')](_0xb079('0x3a'),NOW)[_0xb079('0x13')](_0xb079('0x3d'),squel[_0xb079('0x33')]()[_0xb079('0x10')]('phone')[_0xb079('0x11')](_0xb079('0x42'))[_0xb079('0x13')](_0xb079('0x46'),_0x2cfc67)[_0xb079('0x13')](_0x303e56+_0xb079('0x47')+_0x252b3f+'.'+_0x303e56)))[_0xb079('0x3e')]();}function insertCmHopperAdditionalPhones(_0x411814){var _0x5eb434=[_0xb079('0x4a'),_0xb079('0x4b'),'cm_contact_has_items.OrderBy',_0xb079('0x4c'),_0xb079('0x4d')];return squel['insert']()[_0xb079('0x2a')]('cm_hopper_additional_phones')[_0xb079('0x43')](['CmHopperId',_0xb079('0x44'),_0xb079('0x4e'),_0xb079('0x2f'),_0xb079('0x45')],squel[_0xb079('0x33')]()[_0xb079('0x34')](_0x5eb434)[_0xb079('0x11')](_0xb079('0x2b'))[_0xb079('0x12')](_0xb079('0x35'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0xb079('0x12')](_0xb079('0x4f'),null,_0xb079('0x50'))[_0xb079('0x13')]('cm_hopper.ListId\x20=\x20?',_0x411814)[_0xb079('0x13')](_0xb079('0x3a'),NOW))[_0xb079('0x3e')]();}function insertCmContact(_0x2766c8,_0x4b8def,_0xab49f8,_0xd0ca2e){var _0x335089=_['concat'](_['keys'](_0xd0ca2e),[_0xb079('0x2e'),_0xb079('0x51'),_0xb079('0x2f'),_0xb079('0x45')]);return squel[_0xb079('0x41')]()[_0xb079('0x2a')](_0xb079('0x35'))[_0xb079('0x43')](_0x335089,squel[_0xb079('0x33')]()['fields'](_0x335089)[_0xb079('0x11')](_0x4b8def)[_0xb079('0x13')]('('+_0xab49f8[_0xb079('0x12')](',')+_0xb079('0x52'),squel['select']()['fields'](_0xab49f8)[_0xb079('0x11')](_0xb079('0x35'))[_0xb079('0x13')](_0xb079('0x46'),_0x2766c8)[_0xb079('0x13')](_0xb079('0x53')))[_0xb079('0x13')]('id\x20IN\x20?',squel['select']()[_0xb079('0x10')](_0xb079('0x54'),'min_id')[_0xb079('0x11')](_0x4b8def)[_0xb079('0x55')](_0xab49f8['join'](','))))[_0xb079('0x3e')]();}function handleStop(){logger['info'](_0xb079('0x56'));stopped=!![];}function handleUncaughtException(_0x593765){logger[_0xb079('0x57')](_0x593765[_0xb079('0x58')]);process[_0xb079('0x59')](0x1);}function handleError(_0x1a5edc,_0x53372b){stats[_0xb079('0x5a')]['push']({'name':_0x53372b[_0xb079('0x5b')],'message':_0x53372b[_0xb079('0x58')],'row':_0x1a5edc});}function handleQuery(_0x564c90){logger['info'](_0x564c90);return db[_0xb079('0x5c')][_0xb079('0x5d')](_0x564c90)[_0xb079('0x5e')](function(_0x297563){results[_0xb079('0x17')](_0x297563);})[_0xb079('0x5f')](function(_0x4c0285){logger[_0xb079('0x57')](_0x4c0285[_0xb079('0x58')]);});}function updateTzCampaigns(_0x118675){return new Promise(function(_0x1e1b06,_0x49f008){var _0x2eff26=squel[_0xb079('0x33')]()[_0xb079('0x34')](['campaigns.id','campaigns.dialTimezone'])[_0xb079('0x11')]('campaigns')[_0xb079('0x12')](_0xb079('0x60'),null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')['where'](_0xb079('0x61')+_0x118675);db['sequelize'][_0xb079('0x5d')](_0x2eff26['toString']())[_0xb079('0x5e')](function(_0x354196){var _0x544e94=[];for(var _0x46cd39=0x0;_0x46cd39<_0x354196[_0xb079('0x1a')];_0x46cd39++){_0x544e94[_0xb079('0x17')](getTimezoneData(_0x354196[_0x46cd39],tmp_campaigns));}BPromise[_0xb079('0x18')](_0x544e94)[_0xb079('0x16')](function(){_0x1e1b06({'val':0x1});});})[_0xb079('0x5f')](function(_0x124a2e){logger[_0xb079('0x57')](_0x124a2e[_0xb079('0x58')]);_0x1e1b06({'val':0x0});});});}function updateTzVoiceQueues(_0x145a1f){return new Promise(function(_0x40a858,_0xdb7cde){var _0x1c3c73=squel['select']()[_0xb079('0x34')]([_0xb079('0x62'),_0xb079('0x63')])[_0xb079('0x11')](_0xb079('0x64'))['join']('voice_queues_has_cm_lists',null,_0xb079('0x65'))['where'](_0xb079('0x66')+_0x145a1f);db['sequelize'][_0xb079('0x5d')](_0x1c3c73[_0xb079('0x3e')]())[_0xb079('0x5e')](function(_0x5e6bca){var _0x10fb41=[];for(var _0x4265a7=0x0;_0x4265a7<_0x5e6bca[_0xb079('0x1a')];_0x4265a7++){_0x10fb41[_0xb079('0x17')](getTimezoneData(_0x5e6bca[_0x4265a7],tmp_voice_queues));}BPromise[_0xb079('0x18')](_0x10fb41)[_0xb079('0x16')](function(){_0x40a858({'val':0x1});});})[_0xb079('0x5f')](function(_0x3f4d81){logger[_0xb079('0x57')](_0x3f4d81['message']);_0x40a858({'val':0x0});});});}function getTimezoneData(_0x5a6b4b,_0x3c0aed){return new Promise(function(_0x19c759,_0x484973){var _0x2f11c8=shared[_0xb079('0x67')];var _0x3d7933=_0x2f11c8[_0x5a6b4b['dialTimezone']];if(_[_0xb079('0x1b')](_0x3d7933)){_0x19c759({'ret':0x1});}else{var _0x479038=_0x3d7933['utcOffset'];var _0x2d2da9=squel[_0xb079('0x41')]()[_0xb079('0x2a')](_0x3c0aed)[_0xb079('0x68')]('id',_0x5a6b4b['id'])['set']('offset',_0x479038)['set'](_0xb079('0x69'),_0x5a6b4b[_0xb079('0x69')])[_0xb079('0x3e')]();return db[_0xb079('0x5c')][_0xb079('0x5d')](_0x2d2da9)[_0xb079('0x5e')](function(_0x20cc47){_0x19c759({'ret':0x1});})['catch'](function(_0x2a63c4){logger[_0xb079('0x57')](_0x2a63c4[_0xb079('0x58')]);_0x484973({'ret':0x1});});}});}function handleTZQuery(_0x2a50fc){logger[_0xb079('0x6a')](_0x2a50fc);return db[_0xb079('0x5c')]['query'](_0x2a50fc)['spread'](function(_0x3399ac){})[_0xb079('0x5f')](function(_0x43a056){logger[_0xb079('0x57')](_0x43a056[_0xb079('0x58')]);});}function main(_0x284082,_0x6e8ce,_0x26a70d,_0x562cff){logger[_0xb079('0x6a')](_0xb079('0x6b'),_0x284082,JSON[_0xb079('0x6c')](_0x6e8ce));process['send'](_0xb079('0x6d'));var _0x1e029f=_0x6e8ce['binding'];var _0x126e13=_['clone'](_0x1e029f);var _0x3f5c8a=_0x6e8ce[_0xb079('0x6e')];var _0x14dd99=path[_0xb079('0x12')](config[_0xb079('0x6f')],_0xb079('0x70'),_0x3f5c8a+_0xb079('0x71'));hasTZ=_['keys'](_0x1e029f)['includes'](_0xb079('0x69'));var _0x2969b2=_[_0xb079('0x72')](_0x1e029f)[_0xb079('0x12')]();logger[_0xb079('0x6a')](_0xb079('0x73'),_0x2969b2);db[_0xb079('0x74')]['findAll']({'raw':!![],'attributes':['id',_0xb079('0x75')]})[_0xb079('0x16')](function(_0x12d0d1){for(var _0x936ec0=0x0;_0x936ec0<_0x12d0d1[_0xb079('0x1a')];_0x936ec0++){if(_0x12d0d1[_0x936ec0][_0xb079('0x75')]in _0x1e029f){contactItemTypes[_0xb079('0x17')](_0x12d0d1[_0x936ec0]);delete _0x126e13[_0x12d0d1[_0x936ec0]['name']];hasAdditionalPhones=!![];}for(var _0x229ec5 in _0x1e029f){if(_0x12d0d1[_0x936ec0]['name']+'_description'===_0x229ec5){phoneDescriptions[_0xb079('0x17')]({'itemTypeId':_0x12d0d1[_0x936ec0]['id'],'description':_0x229ec5});delete _0x126e13[_0x229ec5];}}}if(hasAdditionalPhones)_0x126e13[_0xb079('0x15')]='';var _0x2d1c15=_[_0xb079('0x72')](_0x126e13)['join']();logger['info'](_0xb079('0x73'),_0x2d1c15);fs[_0xb079('0x76')](_0x14dd99,_0x2d1c15+'\x0a');Papa[_0xb079('0x77')](fs['createReadStream'](_0x284082),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2414d3,_0x297958){try{for(var _0x5e905a=0x0,_0x36ca2a=[];_0x5e905a<_0x2414d3[_0xb079('0x78')]['length'];_0x5e905a++){stats[_0xb079('0x79')]+=0x1;if(_0x2414d3[_0xb079('0x5a')][_0x5e905a]){handleError(_0x2414d3[_0xb079('0x78')][_0x5e905a],_0x2414d3[_0xb079('0x5a')][_0x5e905a]);}else{var _0xf2493=[];var _0x2c648a=[];var _0x1460b8={};for(var _0x375c43 in _0x1e029f){let _0x434eed=contactItemTypes[_0xb079('0x7a')](_0x3825=>_0x3825['name']===_0x375c43);let _0x3d8afb=contactItemTypes[_0xb079('0x7a')](_0x3d3d63=>_0x3d3d63['name']+_0xb079('0x7b')===_0x375c43);if(_[_0xb079('0x1b')](_0x434eed)&&_['isNil'](_0x3d8afb)){if(_0x1e029f[_0xb079('0x7c')](_0x375c43)){if(_0x2414d3['data'][_0x5e905a][_0x1e029f[_0x375c43]]){var _0x1b9c1e=_[_0xb079('0x7d')](_0x2414d3[_0xb079('0x78')][_0x5e905a][_0x1e029f[_0x375c43]][_0xb079('0x7e')](/"/g,'\x27'));switch(_0x375c43){case _0xb079('0x2c'):var _0x300a7a=moment(_0x1b9c1e,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x300a7a[_0xb079('0x7f')]()){_0x36ca2a[_0xb079('0x17')]('\x22'+_0x1b9c1e+'\x22');}else{_0xf2493[_0xb079('0x17')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0x47ff50=parseInt(_0x1b9c1e);_0x1b9c1e=_[_0xb079('0x80')](_0x47ff50)||_0x47ff50<0x0||_0x47ff50>0x4?_0x562cff?0x3:0x2:_0x47ff50;_0x36ca2a[_0xb079('0x17')]('\x22'+_0x1b9c1e+'\x22');break;case'UserId':var _0x2cc200=parseInt(_0x1b9c1e);if(_[_0xb079('0x81')](_0x2cc200)&&_[_0xb079('0x82')](_0x26a70d,_0x2cc200)){_0x36ca2a[_0xb079('0x17')]('\x22'+_0x2cc200+'\x22');}else{_0xf2493[_0xb079('0x17')]('agent\x20not\x20exists');}break;case _0xb079('0x83'):if(isEmail(_0x1b9c1e)){_0x36ca2a[_0xb079('0x17')]('\x22'+_0x1b9c1e+'\x22');}else{_0xf2493[_0xb079('0x17')](_0xb079('0x84'));}break;case _0xb079('0x85'):var _0x4e0756=moment(_0x1b9c1e,_0xb079('0x86'),!![]);if(_0x4e0756[_0xb079('0x7f')]()){_0x36ca2a['push']('\x22'+_0x1b9c1e+'\x22');}else{_0xf2493[_0xb079('0x17')](_0xb079('0x87'));}break;case _0xb079('0x69'):var _0x3493ad=shared[_0xb079('0x67')];var _0x19b99a=_0x3493ad[_0x1b9c1e];if(!_[_0xb079('0x1b')](_0x19b99a)){var _0x1fa7a0=_0x19b99a[_0xb079('0x88')];_0x36ca2a[_0xb079('0x17')]('\x22'+_0x1b9c1e+'\x22');_0x36ca2a['push']('\x22'+_0x1fa7a0+'\x22');}break;default:_0x36ca2a[_0xb079('0x17')]('\x22'+_0x1b9c1e+'\x22');}}else{switch(_0x375c43){case _0xb079('0x89'):case _0xb079('0x44'):_0xf2493[_0xb079('0x17')](_0x375c43+'\x20not\x20specified');break;default:_0x36ca2a['push']('\x22\x22');}}}}else{var _0x427890='';if(!_[_0xb079('0x1b')](_0x434eed)){if(!_0x1460b8[_0xb079('0x7c')](_0x434eed['id'])){if(!_[_0xb079('0x1b')](_0x2414d3[_0xb079('0x78')][_0x5e905a][_0x1e029f[_0x375c43]])){var _0x1b9c1e=_['trim'](_0x2414d3[_0xb079('0x78')][_0x5e905a][_0x1e029f[_0x375c43]][_0xb079('0x7e')](/"/g,'\x27'));var _0x534d72=phoneDescriptions[_0xb079('0x7a')](_0x50cec3=>_0x50cec3[_0xb079('0x8a')]===_0x434eed['id']);if(!_[_0xb079('0x1b')](_0x534d72)){var _0x3fe171=_[_0xb079('0x7d')](_0x2414d3[_0xb079('0x78')][_0x5e905a][_0x1e029f[_0x534d72[_0xb079('0x8b')]]]['replace'](/"/g,'\x27'));if(!_[_0xb079('0x1b')](_0x3fe171))_0x1b9c1e=_0x1b9c1e+'§'+_0x3fe171;}if(_0x427890=='')_0x427890=_0x1b9c1e;else _0x427890+='|'+_0x1b9c1e;}_0x2c648a[_0xb079('0x17')](_0x434eed['id']+':'+_0x427890);_0x1460b8[_0x434eed['id']]=0x1;}}}}if(hasAdditionalPhones){_0x36ca2a['push']('\x22'+_0x2c648a[_0xb079('0x12')](';')+'\x22');}if(_0xf2493[_0xb079('0x1a')]){handleError(_0x2414d3[_0xb079('0x78')][_0x5e905a],{'code':_0xb079('0x8c'),'message':_0xf2493[_0xb079('0x12')]()});}else{fs[_0xb079('0x8d')](_0x14dd99,_0x36ca2a[_0xb079('0x12')]()+'\x0a');}_0x36ca2a=[];}if(!(stats[_0xb079('0x79')]%0xc8)){socket[_0xb079('0x8e')]('contact:import:'+_0x3f5c8a,stats);stats[_0xb079('0x5a')]=[];}}if(stopped){logger[_0xb079('0x6a')](_0xb079('0x8f'));_0x297958[_0xb079('0x90')]();}}catch(_0x14211f){handleError(_0x2414d3['data'][_0x5e905a],{'code':'SystemError','message':_0x14211f['message']});logger[_0xb079('0x57')](_0xb079('0x91'),_0x14211f[_0xb079('0x58')]);}},'complete':function(){try{var _0x249928=[];var _0xf5360e=[];var _0x42e595=_0xb079('0x35');if(_0x6e8ce['duplicates']&&_0x6e8ce[_0xb079('0x92')][_0xb079('0x1a')]){_0x42e595=_0xb079('0x93')+_0x3f5c8a;_0x249928['push'](_0xb079('0x94')+_0x42e595+_0xb079('0x95'));}tmp_campaigns='campaigns_'+_0x3f5c8a;tmp_voice_queues=_0xb079('0x96')+_0x3f5c8a;_0xf5360e[_0xb079('0x17')](_0xb079('0x94')+tmp_campaigns+_0xb079('0x97'));_0xf5360e[_0xb079('0x17')](_0xb079('0x94')+tmp_voice_queues+_0xb079('0x97'));BPromise[_0xb079('0x98')](_0xf5360e,handleTZQuery)[_0xb079('0x16')](function(_0x1adb2a){updateTzCampaigns(_0x6e8ce[_0xb079('0x2e')])[_0xb079('0x16')](function(_0x33d4ff){updateTzVoiceQueues(_0x6e8ce[_0xb079('0x2e')])[_0xb079('0x16')](function(_0x5a60d4){if(hasTZ)_0x2d1c15=_0x2d1c15[_0xb079('0x7e')](_0xb079('0x69'),'dialTimezone,utcOffset');var _0x19d082=util[_0xb079('0xd')]('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',_0x14dd99,_0x42e595,_0x2d1c15,_0x6e8ce[_0xb079('0x2e')],_0x6e8ce['CompanyId']||null,NOW,NOW);if(_[_0xb079('0x1b')](_0x1e029f['scheduledat'])){_0x19d082+=_0xb079('0x99');}_0x249928[_0xb079('0x17')](_0x19d082);if(_0x6e8ce['duplicates']&&_0x6e8ce['duplicates'][_0xb079('0x1a')]){_0x249928[_0xb079('0x17')](insertCmContact(_0x6e8ce['ListId'],_0x42e595,_0x6e8ce['duplicates'],_0x1e029f));_0x249928[_0xb079('0x17')](_0xb079('0x9a')+_0x42e595+';');}BPromise['each'](_0x249928,handleQuery)[_0xb079('0x16')](function(_0x57586f){BPromise[_0xb079('0x18')]([handleAdditionalPhones()])[_0xb079('0x16')](function(){_0x249928=[];for(var _0x54db2e=0x0;_0x54db2e\x20\x20','existsSync','ListId\x20is\x20mandatory','SIGINT','uncaughtException','lodash','papaparse','moment','ioredis','../../../mysqldb','../../../config/environment','import','redis','defaults','localhost','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','format','YYYYMMDDHHmmss','test','select','from','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','join','query','select\x20*\x20from\x20','spread','isNil','phone','AdditionalPhones','push','all','catch','error','message','split','length','filter','CmContactHasItem','findOne','then','update','PHONE','CmContact','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','ListId','updatedAt','priority','UserId','recallme','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.createdAt','cm_hopper_black','createdAt','fields','.CmListId\x20=\x20?','ListId\x20=\x20?','\x20=\x20?','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','fromQuery','CmHopperId','OrderBy','cm_contacts','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','field','MIN(id)','min_id','info','Received\x20SIGINT','exit','errors','code','sequelize','main','stringify','send','start','binding','clone','root','server/files/tmp','.csv','body','findAll','name','header','writeFileSync','parse','createReadStream','data','rows','find','replace','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','trim','SystemRow','appendFileSync'];(function(_0x128a79,_0x19f331){var _0x2ff426=function(_0x57ffc1){while(--_0x57ffc1){_0x128a79['push'](_0x128a79['shift']());}};_0x2ff426(++_0x19f331);}(_0xc584,0xa8));var _0x4c58=function(_0x26f1b2,_0x33d843){_0x26f1b2=_0x26f1b2-0x0;var _0x1624a4=_0xc584[_0x26f1b2];return _0x1624a4;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x4c58('0x0'));var Papa=require(_0x4c58('0x1'));var util=require('util');var BPromise=require('bluebird');var moment=require(_0x4c58('0x2'));var squel=require('squel');var Redis=require(_0x4c58('0x3'));var db=require(_0x4c58('0x4'))['db'];var config=require(_0x4c58('0x5'));var logger=require('../../../config/logger')(_0x4c58('0x6'));config[_0x4c58('0x7')]=_[_0x4c58('0x8')](config[_0x4c58('0x7')],{'host':_0x4c58('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()['format'](_0x4c58('0xa'));var tempTableName=_0x4c58('0xb')+moment()[_0x4c58('0xc')](_0x4c58('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0xb89ef4){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))*$/[_0x4c58('0xe')](_0xb89ef4);}function selectNotIn(_0x85e280,_0xd08c65,_0x2b1088,_0x416fa7,_0x2b21da){return squel[_0x4c58('0xf')]()['field']('phone')[_0x4c58('0x10')](_0x416fa7)['join'](_0xd08c65,null,_0xd08c65+_0x4c58('0x11')+_0x416fa7+'.'+_0x2b1088)[_0x4c58('0x12')](_0x416fa7+'.'+_0x2b1088+_0x4c58('0x13')+_0x85e280+'.'+_0x2b1088)[_0x4c58('0x12')](_0xd08c65+_0x4c58('0x14')+_0x2b21da[_0x4c58('0x15')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x5a9e76,_0x1acffd){promisesAdditionalPhones=[];promisesContact=[];return db['sequelize'][_0x4c58('0x16')](_0x4c58('0x17')+tempTableName)[_0x4c58('0x18')](function(_0x14af92){if(_0x14af92!==null){var _0x38bbcc=[];for(var _0x2fbd2e=0x0;_0x2fbd2e<_0x14af92['length'];_0x2fbd2e++){var _0x3db388=_0x14af92[_0x2fbd2e];if(!_[_0x4c58('0x19')](_0x3db388[_0x4c58('0x1a')])){if(!_[_0x4c58('0x19')](_0x3db388[_0x4c58('0x1b')]))_0x38bbcc['push'](insertAdditionalPhones(_0x3db388));promisesContact[_0x4c58('0x1c')]({'contact':_0x3db388});}}}Promise[_0x4c58('0x1d')](_0x38bbcc)['then'](function(){_0x5a9e76({'val':0x1});});})[_0x4c58('0x1e')](function(_0x76df98){logger[_0x4c58('0x1f')](_0x76df98[_0x4c58('0x20')]);});});}function insertAdditionalPhones(_0x227931){return new Promise(function(_0x46876f,_0x5793d2){var _0x40171e=_0x227931[_0x4c58('0x1b')];if(_[_0x4c58('0x19')](_0x40171e))_0x5793d2({'val':0x0});else{var _0xd8ffa4=_0x40171e[_0x4c58('0x21')](';');var _0x4f189f=[];orderBy=0x0;for(var _0x101d23=0x0;_0x101d23<_0xd8ffa4['length'];_0x101d23++){_0x4f189f[_0x4c58('0x1c')](splitAdditionalPhone(_0x227931['id'],_0xd8ffa4[_0x101d23]));}Promise[_0x4c58('0x1d')](_0x4f189f)['then'](function(){_0x46876f({'val':_0xd8ffa4[_0x4c58('0x22')]});});}});}function splitAdditionalPhone(_0x386c98,_0x369fc4){return new Promise(function(_0x55592f,_0x159bf8){var _0x229f85=_0x369fc4[_0x4c58('0x21')](':');var _0x236d0d=_0x229f85[0x0];var _0x41bc70=_0x229f85[0x1];if(_0x41bc70!==''){var _0x4ffaf0=_0x41bc70[_0x4c58('0x21')]('|');var _0x44edde=[];for(var _0x30e4fa=0x0;_0x30e4fa<_0x4ffaf0[_0x4c58('0x22')];_0x30e4fa++){if(_0x4ffaf0[_0x30e4fa]!==''){var _0x317409=_[_0x4c58('0x23')](promisesAdditionalPhones,{'contactId':_0x386c98,'phone':_0x4ffaf0[_0x30e4fa]});if(_0x317409[_0x4c58('0x22')]==0x0){orderBy++;promisesAdditionalPhones[_0x4c58('0x1c')]({'contactId':_0x386c98,'contactTypeId':_0x236d0d,'phone':_0x4ffaf0[_0x30e4fa],'orderBy':orderBy});}}}_0x55592f({'ok':0x1});}else _0x55592f({'res':0x0});});}function createAdditionalPhone(_0x5b5b4e,_0x33a731,_0x10b72c,_0x2390a6){var _0x3f0192='';var _0x395ac6='';var _0x19ed6e=_0x10b72c[_0x4c58('0x21')]('§');_0x3f0192=_0x19ed6e[0x0];if(_0x19ed6e[_0x4c58('0x22')]==0x2)_0x395ac6=_0x19ed6e[0x1];return new Promise(function(_0x186f25,_0x437975){return db[_0x4c58('0x24')][_0x4c58('0x25')]({'where':{'CmContactId':_0x5b5b4e,'item':_0x3f0192}})[_0x4c58('0x26')](function(_0x440ee4){if(_0x440ee4){return db[_0x4c58('0x24')][_0x4c58('0x27')]({'ItemTypeId':_0x33a731,'description':_0x395ac6,'OrderBy':_0x2390a6},{'where':{'CmContactId':_0x5b5b4e,'item':_0x3f0192}})[_0x4c58('0x26')](function(_0x29c3e0){_0x186f25({'res':'updated'});});}else{return db['CmContactHasItem']['create']({'CmContactId':_0x5b5b4e,'item':_0x3f0192,'ItemTypeId':_0x33a731,'description':_0x395ac6,'OrderBy':_0x2390a6,'ItemClass':_0x4c58('0x28')})['then'](function(_0x1f7927){_0x186f25({'res':'inserted'});});}});});}function updateContact(_0x237b9d){return new Promise(function(_0x328554,_0x459642){var _0x522868=_0x237b9d['id'];delete _0x237b9d['id'];return db[_0x4c58('0x29')][_0x4c58('0x27')](_0x237b9d,{'where':{'id':_0x522868}})[_0x4c58('0x26')](function(_0x1c38c2){updatedRows+=0x1;return db[_0x4c58('0x2a')][_0x4c58('0x27')]({'phone':_0x237b9d[_0x4c58('0x1a')]},{'where':{'ContactId':_0x522868}})[_0x4c58('0x26')](function(_0x5dec00){_0x328554({'ret':'OK'});});});});}function insertCmHopper(_0x532e13,_0x4f7a72,_0x284335,_0x10ce89,_0x3b15f4){var _0x4a7f8a=[_0x4c58('0x2b'),_0x4c58('0x2c'),_0x4c58('0x2d'),_0x4c58('0x2e'),_0x4f7a72+'.'+_0x10ce89,'cm_contacts.createdAt',_0x4c58('0x2f'),_0x4c58('0x30'),_0x4c58('0x31'),'\x22'+_0x3b15f4+'\x22'];return squel[_0x4c58('0x32')]()[_0x4c58('0x33')](_0x4c58('0x34'))['fromQuery']([_0x4c58('0x1a'),'scheduledat','ContactId',_0x4c58('0x35'),_0x10ce89,'createdAt',_0x4c58('0x36'),_0x4c58('0x37'),_0x4c58('0x38'),_0x4c58('0x39')],squel[_0x4c58('0xf')]()['fields'](_0x4a7f8a)[_0x4c58('0x10')](_0x4f7a72)[_0x4c58('0x15')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x4f7a72+_0x4c58('0x3a'))[_0x4c58('0x15')](_0x284335,null,_0x284335+_0x4c58('0x11')+_0x4f7a72+'.'+_0x10ce89)['where'](_0x4f7a72+'.CmListId\x20=\x20?',_0x532e13)['where'](_0x4c58('0x3b'),NOW)[_0x4c58('0x12')](_0x4c58('0x3c'),selectNotIn(_0x4f7a72,_0x284335,_0x10ce89,'cm_hopper',[_0x4c58('0x3d'),_0x4c58('0x3e')]))[_0x4c58('0x12')](_0x4c58('0x3c'),selectNotIn(_0x4f7a72,_0x284335,_0x10ce89,_0x4c58('0x34'),[_0x4c58('0x3d')])))[_0x4c58('0x3f')]();}function insertCmHopperBlack(_0x10be94,_0x3cd733,_0x3851b3,_0x1f8d23){var _0x2f50cc=[_0x4c58('0x2b'),_0x4c58('0x2d'),_0x4c58('0x2e'),_0x3cd733+'.'+_0x1f8d23,_0x4c58('0x40'),'cm_contacts.updatedAt'];return squel['insert']()['into'](_0x4c58('0x41'))['fromQuery'](['phone','ContactId',_0x4c58('0x35'),_0x1f8d23,_0x4c58('0x42'),_0x4c58('0x36')],squel[_0x4c58('0xf')]()[_0x4c58('0x43')](_0x2f50cc)['from'](_0x3cd733)[_0x4c58('0x15')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x3cd733+_0x4c58('0x3a'))['join'](_0x3851b3,null,_0x3851b3+_0x4c58('0x11')+_0x3cd733+'.'+_0x1f8d23)[_0x4c58('0x12')](_0x3cd733+_0x4c58('0x44'),_0x10be94)['where']('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x4c58('0x3c'),squel['select']()['field'](_0x4c58('0x1a'))['from'](_0x4c58('0x41'))['where'](_0x4c58('0x45'),_0x10be94)['where'](_0x1f8d23+_0x4c58('0x46'),_0x3cd733+'.'+_0x1f8d23)))['toString']();}function insertCmHopperAdditionalPhones(_0x40daae){var _0x43c7ac=['cm_hopper.id',_0x4c58('0x47'),_0x4c58('0x48'),'cm_contact_has_items.createdAt',_0x4c58('0x49')];return squel[_0x4c58('0x32')]()[_0x4c58('0x33')](_0x4c58('0x4a'))[_0x4c58('0x4b')]([_0x4c58('0x4c'),'phone',_0x4c58('0x4d'),_0x4c58('0x42'),_0x4c58('0x36')],squel[_0x4c58('0xf')]()[_0x4c58('0x43')](_0x43c7ac)['from'](_0x4c58('0x34'))[_0x4c58('0x15')](_0x4c58('0x4e'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')['join'](_0x4c58('0x4f'),null,_0x4c58('0x50'))[_0x4c58('0x12')]('cm_hopper.ListId\x20=\x20?',_0x40daae)[_0x4c58('0x12')](_0x4c58('0x3b'),NOW))['toString']();}function insertCmContact(_0x5e89f6,_0x599756,_0xe6aba4,_0x43cfe0){var _0xd55cba=_[_0x4c58('0x51')](_[_0x4c58('0x52')](_0x43cfe0),[_0x4c58('0x35'),_0x4c58('0x53'),_0x4c58('0x42'),'updatedAt']);return squel[_0x4c58('0x32')]()[_0x4c58('0x33')](_0x4c58('0x4e'))[_0x4c58('0x4b')](_0xd55cba,squel['select']()['fields'](_0xd55cba)[_0x4c58('0x10')](_0x599756)[_0x4c58('0x12')]('('+_0xe6aba4['join'](',')+_0x4c58('0x54'),squel[_0x4c58('0xf')]()['fields'](_0xe6aba4)[_0x4c58('0x10')]('cm_contacts')[_0x4c58('0x12')](_0x4c58('0x45'),_0x5e89f6))[_0x4c58('0x12')](_0x4c58('0x55'),squel[_0x4c58('0xf')]()[_0x4c58('0x56')](_0x4c58('0x57'),_0x4c58('0x58'))['from'](_0x599756)['group'](_0xe6aba4['join'](','))))['toString']();}function handleStop(){logger[_0x4c58('0x59')](_0x4c58('0x5a'));stopped=!![];}function handleUncaughtException(_0x578177){logger[_0x4c58('0x1f')](_0x578177['message']);process[_0x4c58('0x5b')](0x1);}function handleError(_0x36778b,_0x36622a){stats[_0x4c58('0x5c')]['push']({'name':_0x36622a[_0x4c58('0x5d')],'message':_0x36622a[_0x4c58('0x20')],'row':_0x36778b});}function handleQuery(_0x24748b){logger[_0x4c58('0x59')](_0x24748b);return db[_0x4c58('0x5e')][_0x4c58('0x16')](_0x24748b)[_0x4c58('0x18')](function(_0x312bfd){results[_0x4c58('0x1c')](_0x312bfd);})['catch'](function(_0x335de6){logger[_0x4c58('0x1f')](_0x335de6[_0x4c58('0x20')]);});}function main(_0x537054,_0x44d2f8,_0x3bce6e,_0x3c5903){logger[_0x4c58('0x59')](_0x4c58('0x5f'),_0x537054,JSON[_0x4c58('0x60')](_0x44d2f8));process[_0x4c58('0x61')](_0x4c58('0x62'));var _0x244977=_0x44d2f8[_0x4c58('0x63')];var _0x4377e2=_[_0x4c58('0x64')](_0x244977);var _0x31bc86=_0x44d2f8['socket_timestamp'];var _0x2413fd=path[_0x4c58('0x15')](config[_0x4c58('0x65')],_0x4c58('0x66'),_0x31bc86+_0x4c58('0x67'));logger[_0x4c58('0x59')](_0x4c58('0x68'),_0x44d2f8);db['ContactItemType'][_0x4c58('0x69')]({'raw':!![],'attributes':['id',_0x4c58('0x6a')]})[_0x4c58('0x26')](function(_0x58c796){for(var _0x9d9ff6=0x0;_0x9d9ff6<_0x58c796[_0x4c58('0x22')];_0x9d9ff6++){if(_0x58c796[_0x9d9ff6][_0x4c58('0x6a')]in _0x244977){contactItemTypes[_0x4c58('0x1c')](_0x58c796[_0x9d9ff6]);delete _0x4377e2[_0x58c796[_0x9d9ff6][_0x4c58('0x6a')]];hasAdditionalPhones=!![];}for(var _0x105513 in _0x244977){if(_0x58c796[_0x9d9ff6]['name']+'_description'===_0x105513){phoneDescriptions[_0x4c58('0x1c')]({'itemTypeId':_0x58c796[_0x9d9ff6]['id'],'description':_0x105513});delete _0x4377e2[_0x105513];}}}if(hasAdditionalPhones)_0x4377e2['AdditionalPhones']='';var _0x1fb86f=_['keys'](_0x4377e2)[_0x4c58('0x15')]();logger[_0x4c58('0x59')](_0x4c58('0x6b'),_0x1fb86f);fs[_0x4c58('0x6c')](_0x2413fd,_0x1fb86f+'\x0a');Papa[_0x4c58('0x6d')](fs[_0x4c58('0x6e')](_0x537054),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2cf937,_0x21f92e){try{for(var _0x151b3a=0x0,_0x1ba8ba=[];_0x151b3a<_0x2cf937[_0x4c58('0x6f')][_0x4c58('0x22')];_0x151b3a++){stats[_0x4c58('0x70')]+=0x1;if(_0x2cf937[_0x4c58('0x5c')][_0x151b3a]){handleError(_0x2cf937[_0x4c58('0x6f')][_0x151b3a],_0x2cf937['errors'][_0x151b3a]);}else{var _0x9b38fd=[];var _0x3bb249=[];var _0x1c19a7={};for(var _0x374313 in _0x244977){let _0x44bc13=contactItemTypes[_0x4c58('0x71')](_0x5ab350=>_0x5ab350['name']===_0x374313);let _0x7e6c2=contactItemTypes[_0x4c58('0x71')](_0x30468c=>_0x30468c[_0x4c58('0x6a')]+'_description'===_0x374313);if(_['isNil'](_0x44bc13)&&_[_0x4c58('0x19')](_0x7e6c2)){if(_0x244977['hasOwnProperty'](_0x374313)){if(_0x2cf937[_0x4c58('0x6f')][_0x151b3a][_0x244977[_0x374313]]){var _0x3ec8fc=_['trim'](_0x2cf937[_0x4c58('0x6f')][_0x151b3a][_0x244977[_0x374313]][_0x4c58('0x72')](/"/g,'\x27'));switch(_0x374313){case'scheduledat':var _0x5e25cb=moment(_0x3ec8fc,_0x4c58('0xa'),!![]);if(_0x5e25cb['isValid']()){_0x1ba8ba[_0x4c58('0x1c')]('\x22'+_0x3ec8fc+'\x22');}else{_0x9b38fd['push'](_0x4c58('0x73'));}break;case'priority':var _0x437839=parseInt(_0x3ec8fc);_0x3ec8fc=_[_0x4c58('0x74')](_0x437839)||_0x437839<0x0||_0x437839>0x4?_0x3c5903?0x3:0x2:_0x437839;_0x1ba8ba[_0x4c58('0x1c')]('\x22'+_0x3ec8fc+'\x22');break;case _0x4c58('0x38'):var _0xd92cc8=parseInt(_0x3ec8fc);if(_[_0x4c58('0x75')](_0xd92cc8)&&_[_0x4c58('0x76')](_0x3bce6e,_0xd92cc8)){_0x1ba8ba[_0x4c58('0x1c')]('\x22'+_0xd92cc8+'\x22');}else{_0x9b38fd[_0x4c58('0x1c')](_0x4c58('0x77'));}break;case'email':if(isEmail(_0x3ec8fc)){_0x1ba8ba['push']('\x22'+_0x3ec8fc+'\x22');}else{_0x9b38fd[_0x4c58('0x1c')](_0x4c58('0x78'));}break;case _0x4c58('0x79'):var _0x86b8b1=moment(_0x3ec8fc,'YYYY-MM-DD',!![]);if(_0x86b8b1[_0x4c58('0x7a')]()){_0x1ba8ba['push']('\x22'+_0x3ec8fc+'\x22');}else{_0x9b38fd[_0x4c58('0x1c')](_0x4c58('0x7b'));}break;default:_0x1ba8ba['push']('\x22'+_0x3ec8fc+'\x22');}}else{switch(_0x374313){case _0x4c58('0x7c'):case _0x4c58('0x1a'):_0x9b38fd[_0x4c58('0x1c')](_0x374313+'\x20not\x20specified');break;default:_0x1ba8ba[_0x4c58('0x1c')]('\x22\x22');}}}}else{var _0x115336='';if(!_[_0x4c58('0x19')](_0x44bc13)){if(!_0x1c19a7['hasOwnProperty'](_0x44bc13['id'])){for(var _0x12dd4a=0x0;_0x12dd4a<_0x244977[_0x374313][_0x4c58('0x22')];_0x12dd4a++){var _0x3ec8fc=_[_0x4c58('0x7d')](_0x2cf937[_0x4c58('0x6f')][_0x151b3a][_0x244977[_0x374313][_0x12dd4a]][_0x4c58('0x72')](/"/g,'\x27'));var _0x44517b=phoneDescriptions[_0x4c58('0x71')](_0x825a49=>_0x825a49['itemTypeId']===_0x44bc13['id']);if(!_[_0x4c58('0x19')](_0x44517b)){var _0x36ed27=_[_0x4c58('0x7d')](_0x2cf937[_0x4c58('0x6f')][_0x151b3a][_0x244977[_0x44517b['description']][0x0]][_0x4c58('0x72')](/"/g,'\x27'));if(!_[_0x4c58('0x19')](_0x36ed27))_0x3ec8fc=_0x3ec8fc+'§'+_0x36ed27;}if(_0x115336=='')_0x115336=_0x3ec8fc;else _0x115336+='|'+_0x3ec8fc;}_0x3bb249[_0x4c58('0x1c')](_0x44bc13['id']+':'+_0x115336);_0x1c19a7[_0x44bc13['id']]=0x1;}}}}if(hasAdditionalPhones){_0x1ba8ba[_0x4c58('0x1c')]('\x22'+_0x3bb249[_0x4c58('0x15')](';')+'\x22');}if(_0x9b38fd['length']){handleError(_0x2cf937[_0x4c58('0x6f')][_0x151b3a],{'code':_0x4c58('0x7e'),'message':_0x9b38fd['join']()});}else{fs[_0x4c58('0x7f')](_0x2413fd,_0x1ba8ba[_0x4c58('0x15')]()+'\x0a');}_0x1ba8ba=[];}if(!(stats[_0x4c58('0x70')]%0xc8)){socket[_0x4c58('0x80')](_0x4c58('0x81')+_0x31bc86,stats);stats[_0x4c58('0x5c')]=[];}}if(stopped){logger[_0x4c58('0x59')](_0x4c58('0x82'));_0x21f92e[_0x4c58('0x83')]();}}catch(_0x429817){handleError(_0x2cf937[_0x4c58('0x6f')][_0x151b3a],{'code':_0x4c58('0x84'),'message':_0x429817[_0x4c58('0x20')]});logger[_0x4c58('0x1f')]('step',_0x429817[_0x4c58('0x20')]);}},'complete':function(){try{var _0x5ccab5=[];var _0x43f757=tempTableName;_0x5ccab5['push']('CREATE\x20TABLE\x20'+_0x43f757+_0x4c58('0x85'));logger[_0x4c58('0x59')](_0x4c58('0x86'),contactItemTypes['length']);var _0x2868bf=util[_0x4c58('0xc')](_0x4c58('0x87'),_0x2413fd,_0x43f757,_0x1fb86f,_0x44d2f8['ListId'],_0x44d2f8[_0x4c58('0x53')]||null,NOW,NOW);if(_['isNil'](_0x244977['scheduledat'])){_0x2868bf+=',\x20scheduledAt\x20=\x20NOW()';}_0x5ccab5[_0x4c58('0x1c')](_0x2868bf);BPromise[_0x4c58('0x88')](_0x5ccab5,handleQuery)[_0x4c58('0x26')](function(_0x4229d9){BPromise['all']([handleAdditionalPhones()])['then'](function(){_0x5ccab5=[];for(var _0x36b85b=0x0;_0x36b85b\x20\x20','argv','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','map','SIGINT','uncaughtException','path','lodash','util','bluebird','moment','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','query','spread','isNil','AdditionalPhones','error','message','split','length','push','all','filter','CmContactHasItem','findOne','update','then','updated'];(function(_0x12c54d,_0x547c4){var _0x3082ff=function(_0xcb50b7){while(--_0xcb50b7){_0x12c54d['push'](_0x12c54d['shift']());}};_0x3082ff(++_0x547c4);}(_0xfe36,0x1b6));var _0x6fe3=function(_0x54f546,_0x9dcb01){_0x54f546=_0x54f546-0x0;var _0x5a8924=_0xfe36[_0x54f546];return _0x5a8924;};'use strict';var fs=require('fs');var path=require(_0x6fe3('0x0'));var _=require(_0x6fe3('0x1'));var Papa=require('papaparse');var util=require(_0x6fe3('0x2'));var BPromise=require(_0x6fe3('0x3'));var moment=require(_0x6fe3('0x4'));var squel=require('squel');var Redis=require(_0x6fe3('0x5'));var db=require(_0x6fe3('0x6'))['db'];var config=require(_0x6fe3('0x7'));var logger=require(_0x6fe3('0x8'))(_0x6fe3('0x9'));config[_0x6fe3('0xa')]=_['defaults'](config['redis'],{'host':_0x6fe3('0xb'),'port':0x18eb});var socket=require(_0x6fe3('0xc'))(new Redis(config[_0x6fe3('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()['format'](_0x6fe3('0xd'));var tempTableName=_0x6fe3('0xe')+moment()['format'](_0x6fe3('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x30cb6d){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))*$/[_0x6fe3('0x10')](_0x30cb6d);}function selectNotIn(_0x167ca5,_0x5ae712,_0x165b73,_0x16f433,_0x486809){return squel[_0x6fe3('0x11')]()[_0x6fe3('0x12')](_0x6fe3('0x13'))[_0x6fe3('0x14')](_0x16f433)[_0x6fe3('0x15')](_0x5ae712,null,_0x5ae712+_0x6fe3('0x16')+_0x16f433+'.'+_0x165b73)[_0x6fe3('0x17')](_0x16f433+'.'+_0x165b73+_0x6fe3('0x18')+_0x167ca5+'.'+_0x165b73)[_0x6fe3('0x17')](_0x5ae712+_0x6fe3('0x19')+_0x486809[_0x6fe3('0x15')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x4632bf,_0x52a08e){promisesAdditionalPhones=[];promisesContact=[];return db['sequelize'][_0x6fe3('0x1a')]('select\x20*\x20from\x20'+tempTableName)[_0x6fe3('0x1b')](function(_0x2a4323){if(_0x2a4323!==null){var _0x439c4a=[];for(var _0x20cee1=0x0;_0x20cee1<_0x2a4323['length'];_0x20cee1++){var _0x278f3a=_0x2a4323[_0x20cee1];if(!_[_0x6fe3('0x1c')](_0x278f3a[_0x6fe3('0x13')])){if(!_[_0x6fe3('0x1c')](_0x278f3a[_0x6fe3('0x1d')]))_0x439c4a['push'](insertAdditionalPhones(_0x278f3a));promisesContact['push']({'contact':_0x278f3a});}}}Promise['all'](_0x439c4a)['then'](function(){_0x4632bf({'val':0x1});});})['catch'](function(_0x317c65){logger[_0x6fe3('0x1e')](_0x317c65[_0x6fe3('0x1f')]);});});}function insertAdditionalPhones(_0x50e40c){return new Promise(function(_0x3acbfb,_0x3bc4b9){var _0xa506ef=_0x50e40c[_0x6fe3('0x1d')];if(_['isNil'](_0xa506ef))_0x3bc4b9({'val':0x0});else{var _0x35dd67=_0xa506ef[_0x6fe3('0x20')](';');var _0x48311c=[];orderBy=0x0;for(var _0xc8dc47=0x0;_0xc8dc47<_0x35dd67[_0x6fe3('0x21')];_0xc8dc47++){_0x48311c[_0x6fe3('0x22')](splitAdditionalPhone(_0x50e40c['id'],_0x35dd67[_0xc8dc47]));}Promise[_0x6fe3('0x23')](_0x48311c)['then'](function(){_0x3acbfb({'val':_0x35dd67['length']});});}});}function splitAdditionalPhone(_0x30de73,_0x1daffc){return new Promise(function(_0x4f75ab,_0x5dca04){var _0x433669=_0x1daffc[_0x6fe3('0x20')](':');var _0x4510df=_0x433669[0x0];var _0x1433d0=_0x433669[0x1];if(_0x1433d0!==''){var _0x3aace4=_0x1433d0[_0x6fe3('0x20')]('|');var _0x5027d9=[];for(var _0x4952e5=0x0;_0x4952e5<_0x3aace4[_0x6fe3('0x21')];_0x4952e5++){if(_0x3aace4[_0x4952e5]!==''){var _0x31add8=_[_0x6fe3('0x24')](promisesAdditionalPhones,{'contactId':_0x30de73,'phone':_0x3aace4[_0x4952e5]});if(_0x31add8['length']==0x0){orderBy++;promisesAdditionalPhones[_0x6fe3('0x22')]({'contactId':_0x30de73,'contactTypeId':_0x4510df,'phone':_0x3aace4[_0x4952e5],'orderBy':orderBy});}}}_0x4f75ab({'ok':0x1});}else _0x4f75ab({'res':0x0});});}function createAdditionalPhone(_0x46eb3e,_0x42c19b,_0x2dc377,_0x5c85ec){var _0x1a0cf5='';var _0x1325ca='';var _0x2d0b63=_0x2dc377[_0x6fe3('0x20')]('§');_0x1a0cf5=_0x2d0b63[0x0];if(_0x2d0b63[_0x6fe3('0x21')]==0x2)_0x1325ca=_0x2d0b63[0x1];return new Promise(function(_0x1c3c40,_0x2348a0){return db[_0x6fe3('0x25')][_0x6fe3('0x26')]({'where':{'CmContactId':_0x46eb3e,'item':_0x1a0cf5}})['then'](function(_0x399267){if(_0x399267){return db[_0x6fe3('0x25')][_0x6fe3('0x27')]({'ItemTypeId':_0x42c19b,'description':_0x1325ca,'OrderBy':_0x5c85ec},{'where':{'CmContactId':_0x46eb3e,'item':_0x1a0cf5}})[_0x6fe3('0x28')](function(_0x7e3dbf){_0x1c3c40({'res':_0x6fe3('0x29')});});}else{return db[_0x6fe3('0x25')]['create']({'CmContactId':_0x46eb3e,'item':_0x1a0cf5,'ItemTypeId':_0x42c19b,'description':_0x1325ca,'OrderBy':_0x5c85ec,'ItemClass':_0x6fe3('0x2a')})[_0x6fe3('0x28')](function(_0x57b7e1){_0x1c3c40({'res':_0x6fe3('0x2b')});});}});});}function updateContact(_0x263ea3){return new Promise(function(_0x40e70e,_0x543b64){var _0x49b512=_0x263ea3['id'];delete _0x263ea3['id'];return db[_0x6fe3('0x2c')][_0x6fe3('0x27')](_0x263ea3,{'where':{'id':_0x49b512}})[_0x6fe3('0x28')](function(_0x5e0377){updatedRows+=0x1;return db[_0x6fe3('0x2d')][_0x6fe3('0x27')]({'phone':_0x263ea3[_0x6fe3('0x13')]},{'where':{'ContactId':_0x49b512}})[_0x6fe3('0x28')](function(_0x24f19a){_0x40e70e({'ret':'OK'});});});});}function insertCmHopper(_0x623558,_0x55fc9d,_0x483fc8,_0x46f9a9,_0x199508){var _0x5d88ff=[_0x6fe3('0x2e'),_0x6fe3('0x2f'),_0x6fe3('0x30'),_0x6fe3('0x31'),_0x55fc9d+'.'+_0x46f9a9,'cm_contacts.createdAt',_0x6fe3('0x32'),'cm_contacts.priority',_0x6fe3('0x33'),'\x22'+_0x199508+'\x22'];return squel['insert']()[_0x6fe3('0x34')](_0x6fe3('0x35'))[_0x6fe3('0x36')](['phone','scheduledat',_0x6fe3('0x37'),_0x6fe3('0x38'),_0x46f9a9,_0x6fe3('0x39'),_0x6fe3('0x3a'),'priority','UserId',_0x6fe3('0x3b')],squel['select']()[_0x6fe3('0x3c')](_0x5d88ff)[_0x6fe3('0x14')](_0x55fc9d)[_0x6fe3('0x15')](_0x6fe3('0x3d'),null,_0x6fe3('0x3e')+_0x55fc9d+_0x6fe3('0x3f'))['join'](_0x483fc8,null,_0x483fc8+_0x6fe3('0x16')+_0x55fc9d+'.'+_0x46f9a9)['where'](_0x55fc9d+_0x6fe3('0x40'),_0x623558)[_0x6fe3('0x17')](_0x6fe3('0x41'),NOW)['where'](_0x6fe3('0x42'),selectNotIn(_0x55fc9d,_0x483fc8,_0x46f9a9,_0x6fe3('0x35'),['\x22always\x22',_0x6fe3('0x43')]))[_0x6fe3('0x17')](_0x6fe3('0x42'),selectNotIn(_0x55fc9d,_0x483fc8,_0x46f9a9,_0x6fe3('0x35'),['\x22always\x22'])))[_0x6fe3('0x44')]();}function insertCmHopperBlack(_0x30162a,_0x306077,_0x303719,_0x4ca50a){var _0x4f112c=['cm_contacts.phone','cm_contacts.id',_0x6fe3('0x31'),_0x306077+'.'+_0x4ca50a,_0x6fe3('0x45'),_0x6fe3('0x32')];return squel[_0x6fe3('0x46')]()[_0x6fe3('0x34')](_0x6fe3('0x47'))['fromQuery']([_0x6fe3('0x13'),_0x6fe3('0x37'),_0x6fe3('0x38'),_0x4ca50a,_0x6fe3('0x39'),_0x6fe3('0x3a')],squel[_0x6fe3('0x11')]()[_0x6fe3('0x3c')](_0x4f112c)[_0x6fe3('0x14')](_0x306077)[_0x6fe3('0x15')](_0x6fe3('0x3d'),null,'cm_contacts.ListId\x20=\x20'+_0x306077+_0x6fe3('0x3f'))[_0x6fe3('0x15')](_0x303719,null,_0x303719+_0x6fe3('0x16')+_0x306077+'.'+_0x4ca50a)[_0x6fe3('0x17')](_0x306077+_0x6fe3('0x40'),_0x30162a)[_0x6fe3('0x17')](_0x6fe3('0x41'),NOW)[_0x6fe3('0x17')](_0x6fe3('0x42'),squel['select']()[_0x6fe3('0x12')](_0x6fe3('0x13'))['from'](_0x6fe3('0x47'))[_0x6fe3('0x17')](_0x6fe3('0x48'),_0x30162a)[_0x6fe3('0x17')](_0x4ca50a+_0x6fe3('0x49'),_0x306077+'.'+_0x4ca50a)))['toString']();}function insertCmHopperAdditionalPhones(_0x43c70e){var _0x5e0ce4=['cm_hopper.id','cm_contact_has_items.item',_0x6fe3('0x4a'),_0x6fe3('0x4b'),'cm_contact_has_items.updatedAt'];return squel[_0x6fe3('0x46')]()[_0x6fe3('0x34')](_0x6fe3('0x4c'))[_0x6fe3('0x36')]([_0x6fe3('0x4d'),_0x6fe3('0x13'),_0x6fe3('0x4e'),_0x6fe3('0x39'),_0x6fe3('0x3a')],squel[_0x6fe3('0x11')]()[_0x6fe3('0x3c')](_0x5e0ce4)[_0x6fe3('0x14')]('cm_hopper')['join'](_0x6fe3('0x3d'),null,_0x6fe3('0x4f'))[_0x6fe3('0x15')](_0x6fe3('0x50'),null,_0x6fe3('0x51'))['where'](_0x6fe3('0x52'),_0x43c70e)[_0x6fe3('0x17')](_0x6fe3('0x41'),NOW))[_0x6fe3('0x44')]();}function insertCmContact(_0xe3188a,_0x31a63a,_0x202338,_0x2fb461){var _0x4609fa=_[_0x6fe3('0x53')](_[_0x6fe3('0x54')](_0x2fb461),[_0x6fe3('0x38'),'CompanyId','createdAt',_0x6fe3('0x3a')]);return squel[_0x6fe3('0x46')]()[_0x6fe3('0x34')](_0x6fe3('0x3d'))['fromQuery'](_0x4609fa,squel['select']()[_0x6fe3('0x3c')](_0x4609fa)['from'](_0x31a63a)[_0x6fe3('0x17')]('('+_0x202338[_0x6fe3('0x15')](',')+_0x6fe3('0x55'),squel[_0x6fe3('0x11')]()[_0x6fe3('0x3c')](_0x202338)['from'](_0x6fe3('0x3d'))[_0x6fe3('0x17')](_0x6fe3('0x48'),_0xe3188a))[_0x6fe3('0x17')]('id\x20IN\x20?',squel[_0x6fe3('0x11')]()[_0x6fe3('0x12')](_0x6fe3('0x56'),_0x6fe3('0x57'))['from'](_0x31a63a)[_0x6fe3('0x58')](_0x202338[_0x6fe3('0x15')](','))))['toString']();}function handleStop(){logger[_0x6fe3('0x59')](_0x6fe3('0x5a'));stopped=!![];}function handleUncaughtException(_0x524760){logger[_0x6fe3('0x1e')](_0x524760['message']);process[_0x6fe3('0x5b')](0x1);}function handleError(_0x346825,_0x4d9924){stats['errors']['push']({'name':_0x4d9924['code'],'message':_0x4d9924[_0x6fe3('0x1f')],'row':_0x346825});}function handleQuery(_0x25bd0b){logger[_0x6fe3('0x59')](_0x25bd0b);return db['sequelize']['query'](_0x25bd0b)[_0x6fe3('0x1b')](function(_0x1f18e2){results['push'](_0x1f18e2);})[_0x6fe3('0x5c')](function(_0xdc62f4){logger[_0x6fe3('0x1e')](_0xdc62f4['message']);});}function main(_0x54e9e6,_0x2e8d2c,_0x4c18eb,_0x9869bc){logger[_0x6fe3('0x59')](_0x6fe3('0x5d'),_0x54e9e6,JSON[_0x6fe3('0x5e')](_0x2e8d2c));process[_0x6fe3('0x5f')](_0x6fe3('0x60'));var _0xac9e3f=_0x2e8d2c[_0x6fe3('0x61')];var _0x2f35f5=_[_0x6fe3('0x62')](_0xac9e3f);var _0xfc68bc=_0x2e8d2c[_0x6fe3('0x63')];var _0xf7e825=path[_0x6fe3('0x15')](config[_0x6fe3('0x64')],'server/files/tmp',_0xfc68bc+_0x6fe3('0x65'));logger[_0x6fe3('0x59')]('body',_0x2e8d2c);db[_0x6fe3('0x66')]['findAll']({'raw':!![],'attributes':['id',_0x6fe3('0x67')]})['then'](function(_0x1024dd){for(var _0x343add=0x0;_0x343add<_0x1024dd[_0x6fe3('0x21')];_0x343add++){if(_0x1024dd[_0x343add][_0x6fe3('0x67')]in _0xac9e3f){contactItemTypes[_0x6fe3('0x22')](_0x1024dd[_0x343add]);delete _0x2f35f5[_0x1024dd[_0x343add][_0x6fe3('0x67')]];hasAdditionalPhones=!![];}for(var _0x207c77 in _0xac9e3f){if(_0x1024dd[_0x343add][_0x6fe3('0x67')]+_0x6fe3('0x68')===_0x207c77){phoneDescriptions['push']({'itemTypeId':_0x1024dd[_0x343add]['id'],'description':_0x207c77});delete _0x2f35f5[_0x207c77];}}}if(hasAdditionalPhones)_0x2f35f5[_0x6fe3('0x1d')]='';var _0x289bf4=_[_0x6fe3('0x54')](_0x2f35f5)[_0x6fe3('0x15')]();logger[_0x6fe3('0x59')](_0x6fe3('0x69'),_0x289bf4);fs[_0x6fe3('0x6a')](_0xf7e825,_0x289bf4+'\x0a');Papa[_0x6fe3('0x6b')](fs[_0x6fe3('0x6c')](_0x54e9e6),{'header':!![],'skipEmptyLines':!![],'step':function(_0x7d7f00,_0x4a9b91){try{for(var _0xda2c3c=0x0,_0x199591=[];_0xda2c3c<_0x7d7f00[_0x6fe3('0x6d')][_0x6fe3('0x21')];_0xda2c3c++){stats[_0x6fe3('0x6e')]+=0x1;if(_0x7d7f00[_0x6fe3('0x6f')][_0xda2c3c]){handleError(_0x7d7f00[_0x6fe3('0x6d')][_0xda2c3c],_0x7d7f00['errors'][_0xda2c3c]);}else{var _0x26a6a9=[];var _0x344e51=[];var _0x391aae={};for(var _0x52ef3c in _0xac9e3f){let _0x575b06=contactItemTypes[_0x6fe3('0x70')](_0x2d690b=>_0x2d690b[_0x6fe3('0x67')]===_0x52ef3c);let _0x47bf01=contactItemTypes['find'](_0x4dbad5=>_0x4dbad5[_0x6fe3('0x67')]+_0x6fe3('0x68')===_0x52ef3c);if(_[_0x6fe3('0x1c')](_0x575b06)&&_[_0x6fe3('0x1c')](_0x47bf01)){if(_0xac9e3f['hasOwnProperty'](_0x52ef3c)){if(_0x7d7f00[_0x6fe3('0x6d')][_0xda2c3c][_0xac9e3f[_0x52ef3c]]){var _0x1e9ae5=_[_0x6fe3('0x71')](_0x7d7f00[_0x6fe3('0x6d')][_0xda2c3c][_0xac9e3f[_0x52ef3c]][_0x6fe3('0x72')](/"/g,'\x27'));switch(_0x52ef3c){case _0x6fe3('0x73'):var _0x16d015=moment(_0x1e9ae5,_0x6fe3('0xd'),!![]);if(_0x16d015[_0x6fe3('0x74')]()){_0x199591[_0x6fe3('0x22')]('\x22'+_0x1e9ae5+'\x22');}else{_0x26a6a9[_0x6fe3('0x22')](_0x6fe3('0x75'));}break;case _0x6fe3('0x76'):var _0x555887=parseInt(_0x1e9ae5);_0x1e9ae5=_['isNaN'](_0x555887)||_0x555887<0x0||_0x555887>0x4?_0x9869bc?0x3:0x2:_0x555887;_0x199591['push']('\x22'+_0x1e9ae5+'\x22');break;case _0x6fe3('0x77'):var _0x5be114=parseInt(_0x1e9ae5);if(_[_0x6fe3('0x78')](_0x5be114)&&_[_0x6fe3('0x79')](_0x4c18eb,_0x5be114)){_0x199591[_0x6fe3('0x22')]('\x22'+_0x5be114+'\x22');}else{_0x26a6a9[_0x6fe3('0x22')](_0x6fe3('0x7a'));}break;case _0x6fe3('0x7b'):if(isEmail(_0x1e9ae5)){_0x199591[_0x6fe3('0x22')]('\x22'+_0x1e9ae5+'\x22');}else{_0x26a6a9[_0x6fe3('0x22')](_0x6fe3('0x7c'));}break;case _0x6fe3('0x7d'):var _0x4303e5=moment(_0x1e9ae5,_0x6fe3('0x7e'),!![]);if(_0x4303e5[_0x6fe3('0x74')]()){_0x199591[_0x6fe3('0x22')]('\x22'+_0x1e9ae5+'\x22');}else{_0x26a6a9[_0x6fe3('0x22')](_0x6fe3('0x7f'));}break;default:_0x199591[_0x6fe3('0x22')]('\x22'+_0x1e9ae5+'\x22');}}else{switch(_0x52ef3c){case _0x6fe3('0x80'):case _0x6fe3('0x13'):_0x26a6a9['push'](_0x52ef3c+_0x6fe3('0x81'));break;default:_0x199591[_0x6fe3('0x22')]('\x22\x22');}}}}else{var _0x411317='';if(!_['isNil'](_0x575b06)){if(!_0x391aae[_0x6fe3('0x82')](_0x575b06['id'])){for(var _0x5499a4=0x0;_0x5499a4<_0xac9e3f[_0x52ef3c][_0x6fe3('0x21')];_0x5499a4++){var _0x1e9ae5=_[_0x6fe3('0x71')](_0x7d7f00['data'][_0xda2c3c][_0xac9e3f[_0x52ef3c][_0x5499a4]][_0x6fe3('0x72')](/"/g,'\x27'));var _0x385107=phoneDescriptions[_0x6fe3('0x70')](_0x201fc0=>_0x201fc0[_0x6fe3('0x83')]===_0x575b06['id']);if(!_[_0x6fe3('0x1c')](_0x385107)){var _0x705009=_[_0x6fe3('0x71')](_0x7d7f00[_0x6fe3('0x6d')][_0xda2c3c][_0xac9e3f[_0x385107['description']][0x0]]['replace'](/"/g,'\x27'));if(!_[_0x6fe3('0x1c')](_0x705009))_0x1e9ae5=_0x1e9ae5+'§'+_0x705009;}if(_0x411317=='')_0x411317=_0x1e9ae5;else _0x411317+='|'+_0x1e9ae5;}_0x344e51['push'](_0x575b06['id']+':'+_0x411317);_0x391aae[_0x575b06['id']]=0x1;}}}}if(hasAdditionalPhones){_0x199591[_0x6fe3('0x22')]('\x22'+_0x344e51['join'](';')+'\x22');}if(_0x26a6a9[_0x6fe3('0x21')]){handleError(_0x7d7f00['data'][_0xda2c3c],{'code':_0x6fe3('0x84'),'message':_0x26a6a9[_0x6fe3('0x15')]()});}else{fs[_0x6fe3('0x85')](_0xf7e825,_0x199591[_0x6fe3('0x15')]()+'\x0a');}_0x199591=[];}if(!(stats[_0x6fe3('0x6e')]%0xc8)){socket[_0x6fe3('0x86')](_0x6fe3('0x87')+_0xfc68bc,stats);stats[_0x6fe3('0x6f')]=[];}}if(stopped){logger[_0x6fe3('0x59')](_0x6fe3('0x88'));_0x4a9b91[_0x6fe3('0x89')]();}}catch(_0x1de121){handleError(_0x7d7f00['data'][_0xda2c3c],{'code':'SystemError','message':_0x1de121['message']});logger[_0x6fe3('0x1e')]('step',_0x1de121[_0x6fe3('0x1f')]);}},'complete':function(){try{var _0x2ab861=[];var _0x2aa625=tempTableName;_0x2ab861[_0x6fe3('0x22')](_0x6fe3('0x8a')+_0x2aa625+'\x20LIKE\x20cm_contacts;');logger[_0x6fe3('0x59')](_0x6fe3('0x8b'),contactItemTypes[_0x6fe3('0x21')]);var _0x5d3891=util[_0x6fe3('0x8c')](_0x6fe3('0x8d'),_0xf7e825,_0x2aa625,_0x289bf4,_0x2e8d2c[_0x6fe3('0x38')],_0x2e8d2c[_0x6fe3('0x8e')]||null,NOW,NOW);if(_[_0x6fe3('0x1c')](_0xac9e3f['scheduledat'])){_0x5d3891+=_0x6fe3('0x8f');}_0x2ab861['push'](_0x5d3891);BPromise[_0x6fe3('0x90')](_0x2ab861,handleQuery)[_0x6fe3('0x28')](function(_0x39b6b3){BPromise['all']([handleAdditionalPhones()])[_0x6fe3('0x28')](function(){_0x2ab861=[];for(var _0x49ecb4=0x0;_0x49ecb4=_0x672f33){return _0x54a11f[_0xefb0('0x13')](0x193)['json']({'message':util['format'](_0xefb0('0x14'),_0x371f80)});}_0x2ec3b2();})['catch'](function(_0x3f8a05){_0x2ec3b2(_0x3f8a05);});});}function isUserLimit(){return isLimit(_0xefb0('0x15'),0x1,db[_0xefb0('0x16')],{'where':{'$or':[{'role':_0xefb0('0x17')},{'role':_0xefb0('0x18')}]}});}exports[_0xefb0('0x19')]=isUserLimit; \ No newline at end of file +var _0x7cbf=['then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','User','user','isUserLimit','crypto','util','composable-middleware','license','data1','split','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty','use','License','findOne'];(function(_0x228c19,_0x3bc38e){var _0x1b11bc=function(_0x5bb1b0){while(--_0x5bb1b0){_0x228c19['push'](_0x228c19['shift']());}};_0x1b11bc(++_0x3bc38e);}(_0x7cbf,0xbe));var _0xf7cb=function(_0x2456cf,_0x47e2c){_0x2456cf=_0x2456cf-0x0;var _0x1b6013=_0x7cbf[_0x2456cf];return _0x1b6013;};'use strict';var crypto=require(_0xf7cb('0x0'));var util=require(_0xf7cb('0x1'));var compose=require(_0xf7cb('0x2'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');function getValueFromLicense(_0x247c5d,_0x4ca399){if(_0x247c5d&&_0x4ca399){if(_0x4ca399['data1']&&_0x4ca399[_0xf7cb('0x3')]){var _0x99d03c=_0x4ca399[_0xf7cb('0x4')];var _0x217600=_0x4ca399[_0xf7cb('0x3')];var _0x2eb4f5=_0x99d03c[_0xf7cb('0x5')]('-')[0x4];var _0x489d8b=_0x99d03c[_0xf7cb('0x5')]('-')[0x0];var _0x5cb697=crypto['createDecipher'](_0xf7cb('0x6'),util[_0xf7cb('0x7')](_0xf7cb('0x8'),_0x2eb4f5,_0x99d03c,_0x489d8b));var _0xbb4ae7=_0x5cb697[_0xf7cb('0x9')](_0x217600,_0xf7cb('0xa'),_0xf7cb('0xb'));_0xbb4ae7+=_0x5cb697[_0xf7cb('0xc')](_0xf7cb('0xb'));var _0x3fbe44=JSON[_0xf7cb('0xd')](_0xbb4ae7);return _0x3fbe44[_0xf7cb('0xe')](_0x247c5d)?_0x3fbe44[_0x247c5d]:null;}}return null;}function isLimit(_0x11c30f,_0x3b6182,_0x210a82,_0x34049c){var _0x41c751=_0x3b6182;return compose()[_0xf7cb('0xf')](function(_0x5667a3,_0x1b13fe,_0x2a4e3a){return db[_0xf7cb('0x10')][_0xf7cb('0x11')]({'where':{'id':0x1},'raw':!![]})[_0xf7cb('0x12')](function(_0x39aa27){var _0x4ada14=getValueFromLicense(_0x11c30f,_0x39aa27);return _0x4ada14?_0x4ada14:_0x41c751;})['then'](function(_0x446509){_0x41c751=_0x446509;return _0x210a82[_0xf7cb('0x13')](_0x34049c);})['then'](function(_0x578b84){if(_0x578b84>=_0x41c751){return _0x1b13fe[_0xf7cb('0x14')](0x193)[_0xf7cb('0x15')]({'message':util[_0xf7cb('0x7')](_0xf7cb('0x16'),_0x11c30f)});}_0x2a4e3a();})['catch'](function(_0x24f361){_0x2a4e3a(_0x24f361);});});}function isUserLimit(){return isLimit('users',0x1,db[_0xf7cb('0x17')],{'where':{'$or':[{'role':'admin'},{'role':_0xf7cb('0x18')}]}});}exports[_0xf7cb('0x19')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index f2a1ca1..b897cce 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 _0xbd40=['YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','NOT\x20IN\x20?','$eq','=\x20?','<>\x20?','$substring','$endsWith','LIKE\x20?','$lt','<\x20?','$gt','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$startsWith','pop','utcOffset','hours','minutes','seconds','moment','parseSearch','sqlOperator','[$or]','and','replace','[$and]','length','split','slice','forEach','shift','filter','indexOf','map','push','buildExpression','DATE','operator','$between','value','includes','$lte','add','days','format'];(function(_0x3a814f,_0x553e5b){var _0x150de1=function(_0x162bed){while(--_0x162bed){_0x3a814f['push'](_0x3a814f['shift']());}};_0x150de1(++_0x553e5b);}(_0xbd40,0x183));var _0x0bd4=function(_0xa3b7db,_0x59bfbd){_0xa3b7db=_0xa3b7db-0x0;var _0x21d264=_0xbd40[_0xa3b7db];return _0x21d264;};'use strict';var _=require('lodash');var moment=require(_0x0bd4('0x0'));exports[_0x0bd4('0x1')]=function(_0x586f21){var _0x38e07b={'conditions':[]};_0x38e07b[_0x0bd4('0x2')]=_['startsWith'](_0x586f21,_0x0bd4('0x3'))?'or':_0x0bd4('0x4');var _0xb9ca6c=_0x586f21[_0x0bd4('0x5')](_0x0bd4('0x6'),'')['replace']('[$or]','')['split']('||');for(var _0x1e5e1a=0x0;_0x1e5e1a<_0xb9ca6c[_0x0bd4('0x7')];_0x1e5e1a++){var _0x24b87f=_0xb9ca6c[_0x1e5e1a][_0x0bd4('0x8')](':=');var _0x149606=_0x24b87f[0x0];var _0x1986c8=_0x24b87f[_0x0bd4('0x9')](0x1);_0x1986c8[_0x0bd4('0xa')](function(_0x2df299){var _0x4daa87=_0x2df299[_0x0bd4('0x8')]('[')[_0x0bd4('0xb')]();var _0x2f2bac=_0x2df299['match'](/\[(.*?)\]/g);_0x2f2bac[_0x0bd4('0xa')](function(_0x3d65e5){var _0x5e84b6=_0x3d65e5['split']('[')[_0x0bd4('0xc')](function(_0x13f862){return _0x13f862[_0x0bd4('0xd')](']')>-0x1;})[_0x0bd4('0xe')](function(_0xc81499){return _0xc81499[_0x0bd4('0x8')](']')[0x0];})[0x0];_0x38e07b['conditions'][_0x0bd4('0xf')]({'field':_0x149606,'operator':_0x4daa87,'value':_0x5e84b6});});});}return _0x38e07b;};exports[_0x0bd4('0x10')]=function(_0x4e723e,_0x462112,_0x51188b){var _0xab2c92={};if(_0x462112===_0x0bd4('0x11')){if(_0x51188b[_0x0bd4('0x12')]==='$eq'){_0x51188b[_0x0bd4('0x12')]=_0x0bd4('0x13');_0x51188b[_0x0bd4('0x14')]+=','+_0x51188b[_0x0bd4('0x14')];}else if(_[_0x0bd4('0x15')](['$gt',_0x0bd4('0x16')],_0x51188b[_0x0bd4('0x12')])){_0x51188b[_0x0bd4('0x14')]=moment(_0x51188b[_0x0bd4('0x14')])[_0x0bd4('0x17')](0x1,_0x0bd4('0x18'))[_0x0bd4('0x19')](_0x0bd4('0x1a'));}}if(_0x51188b[_0x0bd4('0x1b')]){_0x462112=_0x51188b[_0x0bd4('0x1b')];_0xab2c92[_0x0bd4('0x1c')]=_0x0bd4('0x1d')+_0x4e723e+'.'+_0x51188b[_0x0bd4('0x1e')]+_0x0bd4('0x1f')+_0x51188b[_0x0bd4('0x1b')]+')\x20'+parseOperator(_0x51188b[_0x0bd4('0x12')]);}else{_0xab2c92[_0x0bd4('0x1c')]=_0x4e723e+'.'+_0x51188b['field']+'\x20'+parseOperator(_0x51188b[_0x0bd4('0x12')]);}if(_['includes']([_0x0bd4('0x20'),_0x0bd4('0x21')],_0x51188b[_0x0bd4('0x12')]))_0xab2c92['text']='('+_0xab2c92[_0x0bd4('0x1c')]+_0x0bd4('0x22')+_0x4e723e+'.'+_0x51188b['field']+_0x0bd4('0x23');_0xab2c92[_0x0bd4('0x14')]=parseValue(_0x462112,_0x51188b['operator'],_0x51188b[_0x0bd4('0x14')]);return _0xab2c92;};function parseOperator(_0x4e7260){var _0x261d63;switch(_0x4e7260){case _0x0bd4('0x24'):_0x261d63='IN\x20?';break;case'$notIn':_0x261d63=_0x0bd4('0x25');break;case _0x0bd4('0x26'):_0x261d63=_0x0bd4('0x27');break;case _0x0bd4('0x20'):_0x261d63=_0x0bd4('0x28');break;case _0x0bd4('0x29'):case'$startsWith':case _0x0bd4('0x2a'):_0x261d63=_0x0bd4('0x2b');break;case _0x0bd4('0x2c'):_0x261d63=_0x0bd4('0x2d');break;case _0x0bd4('0x2e'):_0x261d63=_0x0bd4('0x2f');break;case _0x0bd4('0x16'):_0x261d63=_0x0bd4('0x30');break;case _0x0bd4('0x31'):_0x261d63=_0x0bd4('0x32');break;case'$between':_0x261d63=_0x0bd4('0x33');break;}return _0x261d63;}function parseValue(_0x49ca7a,_0x539c9a,_0x33d278){var _0x55f191={'start':undefined,'end':undefined};switch(_0x539c9a){case _0x0bd4('0x24'):case'$notIn':_0x55f191[_0x0bd4('0x34')]=_0x33d278[_0x0bd4('0x8')](',');break;case _0x0bd4('0x29'):_0x55f191['start']='%'+_0x33d278+'%';break;case _0x0bd4('0x35'):_0x55f191[_0x0bd4('0x34')]=_0x33d278+'%';break;case _0x0bd4('0x2a'):_0x55f191[_0x0bd4('0x34')]='%'+_0x33d278;break;case'$between':var _0xe7e332=_0x33d278[_0x0bd4('0x8')](',');var _0x33d278=_0xe7e332[_0x0bd4('0xb')]();var _0x4caddb=_0xe7e332[_0x0bd4('0x36')]();if(_0x49ca7a==='DATE'){_0x33d278=moment(_0x33d278)['utcOffset'](0x0,!![])[_0x0bd4('0x19')]();_0x4caddb=moment(_0x4caddb)[_0x0bd4('0x37')](0x0,!![])[_0x0bd4('0x17')](0x17,_0x0bd4('0x38'))[_0x0bd4('0x17')](0x3b,_0x0bd4('0x39'))['add'](0x3b,_0x0bd4('0x3a'))['format']();}_0x55f191={'start':_0x33d278,'end':_0x4caddb};break;default:_0x55f191[_0x0bd4('0x34')]=_0x33d278;break;}return _0x55f191;} \ No newline at end of file +var _0x88e4=['<\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$startsWith','shift','pop','DATE','utcOffset','hours','add','seconds','lodash','moment','sqlOperator','startsWith','[$or]','[$and]','replace','split','length','forEach','match','filter','conditions','buildExpression','operator','$eq','$between','value','includes','$gt','$lte','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$notIn','\x20OR\x20','IN\x20?','=\x20?','$ne','<>\x20?','$substring','$endsWith','LIKE\x20?'];(function(_0x488e73,_0x458efe){var _0x51d2d2=function(_0x115f5d){while(--_0x115f5d){_0x488e73['push'](_0x488e73['shift']());}};_0x51d2d2(++_0x458efe);}(_0x88e4,0xaa));var _0x488e=function(_0x5c1345,_0x40116e){_0x5c1345=_0x5c1345-0x0;var _0x1c070d=_0x88e4[_0x5c1345];return _0x1c070d;};'use strict';var _=require(_0x488e('0x0'));var moment=require(_0x488e('0x1'));exports['parseSearch']=function(_0x27a2d4){var _0x198d19={'conditions':[]};_0x198d19[_0x488e('0x2')]=_[_0x488e('0x3')](_0x27a2d4,_0x488e('0x4'))?'or':'and';var _0x47be3d=_0x27a2d4['replace'](_0x488e('0x5'),'')[_0x488e('0x6')](_0x488e('0x4'),'')[_0x488e('0x7')]('||');for(var _0x59e59a=0x0;_0x59e59a<_0x47be3d[_0x488e('0x8')];_0x59e59a++){var _0x560903=_0x47be3d[_0x59e59a][_0x488e('0x7')](':=');var _0x6552db=_0x560903[0x0];var _0x3d380c=_0x560903['slice'](0x1);_0x3d380c[_0x488e('0x9')](function(_0x4d5fc4){var _0x2cf901=_0x4d5fc4[_0x488e('0x7')]('[')['shift']();var _0x2f5592=_0x4d5fc4[_0x488e('0xa')](/\[(.*?)\]/g);_0x2f5592[_0x488e('0x9')](function(_0x1e5a24){var _0x12a4b7=_0x1e5a24[_0x488e('0x7')]('[')[_0x488e('0xb')](function(_0x87438a){return _0x87438a['indexOf'](']')>-0x1;})['map'](function(_0x237a2c){return _0x237a2c[_0x488e('0x7')](']')[0x0];})[0x0];_0x198d19[_0x488e('0xc')]['push']({'field':_0x6552db,'operator':_0x2cf901,'value':_0x12a4b7});});});}return _0x198d19;};exports[_0x488e('0xd')]=function(_0x23bbd9,_0x2790ec,_0x5df19f){var _0xc25ae6={};if(_0x2790ec==='DATE'){if(_0x5df19f[_0x488e('0xe')]===_0x488e('0xf')){_0x5df19f[_0x488e('0xe')]=_0x488e('0x10');_0x5df19f[_0x488e('0x11')]+=','+_0x5df19f[_0x488e('0x11')];}else if(_[_0x488e('0x12')]([_0x488e('0x13'),_0x488e('0x14')],_0x5df19f[_0x488e('0xe')])){_0x5df19f[_0x488e('0x11')]=moment(_0x5df19f['value'])['add'](0x1,_0x488e('0x15'))[_0x488e('0x16')](_0x488e('0x17'));}}if(_0x5df19f[_0x488e('0x18')]){_0x2790ec=_0x5df19f[_0x488e('0x18')];_0xc25ae6[_0x488e('0x19')]=_0x488e('0x1a')+_0x23bbd9+'.'+_0x5df19f[_0x488e('0x1b')]+_0x488e('0x1c')+_0x5df19f[_0x488e('0x18')]+')\x20'+parseOperator(_0x5df19f[_0x488e('0xe')]);}else{_0xc25ae6[_0x488e('0x19')]=_0x23bbd9+'.'+_0x5df19f['field']+'\x20'+parseOperator(_0x5df19f[_0x488e('0xe')]);}if(_['includes'](['$ne',_0x488e('0x1d')],_0x5df19f[_0x488e('0xe')]))_0xc25ae6['text']='('+_0xc25ae6[_0x488e('0x19')]+_0x488e('0x1e')+_0x23bbd9+'.'+_0x5df19f['field']+'\x20IS\x20NULL)';_0xc25ae6[_0x488e('0x11')]=parseValue(_0x2790ec,_0x5df19f[_0x488e('0xe')],_0x5df19f['value']);return _0xc25ae6;};function parseOperator(_0x3879f7){var _0x4fb56c;switch(_0x3879f7){case'$in':_0x4fb56c=_0x488e('0x1f');break;case _0x488e('0x1d'):_0x4fb56c='NOT\x20IN\x20?';break;case _0x488e('0xf'):_0x4fb56c=_0x488e('0x20');break;case _0x488e('0x21'):_0x4fb56c=_0x488e('0x22');break;case _0x488e('0x23'):case'$startsWith':case _0x488e('0x24'):_0x4fb56c=_0x488e('0x25');break;case'$lt':_0x4fb56c=_0x488e('0x26');break;case'$gt':_0x4fb56c='>\x20?';break;case _0x488e('0x14'):_0x4fb56c=_0x488e('0x27');break;case _0x488e('0x28'):_0x4fb56c=_0x488e('0x29');break;case _0x488e('0x10'):_0x4fb56c=_0x488e('0x2a');break;}return _0x4fb56c;}function parseValue(_0x594bbe,_0x4587e5,_0x1bbc14){var _0x4f72b2={'start':undefined,'end':undefined};switch(_0x4587e5){case'$in':case _0x488e('0x1d'):_0x4f72b2['start']=_0x1bbc14[_0x488e('0x7')](',');break;case _0x488e('0x23'):_0x4f72b2[_0x488e('0x2b')]='%'+_0x1bbc14+'%';break;case _0x488e('0x2c'):_0x4f72b2[_0x488e('0x2b')]=_0x1bbc14+'%';break;case _0x488e('0x24'):_0x4f72b2[_0x488e('0x2b')]='%'+_0x1bbc14;break;case _0x488e('0x10'):var _0x1d38f1=_0x1bbc14[_0x488e('0x7')](',');var _0x1bbc14=_0x1d38f1[_0x488e('0x2d')]();var _0x11d2a3=_0x1d38f1[_0x488e('0x2e')]();if(_0x594bbe===_0x488e('0x2f')){_0x1bbc14=moment(_0x1bbc14)[_0x488e('0x30')](0x0,!![])['format']();_0x11d2a3=moment(_0x11d2a3)[_0x488e('0x30')](0x0,!![])['add'](0x17,_0x488e('0x31'))[_0x488e('0x32')](0x3b,'minutes')['add'](0x3b,_0x488e('0x33'))[_0x488e('0x16')]();}_0x4f72b2={'start':_0x1bbc14,'end':_0x11d2a3};break;default:_0x4f72b2[_0x488e('0x2b')]=_0x1bbc14;break;}return _0x4f72b2;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 4c0ea24..da4fcb7 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 _0xf69d=['sequelize','moment','parse','keys','includes','fields','split','filters','isEmpty','forOwn','$gte','format','YYYY-MM-DD','$lte','subtract','name','uniqueid','isArray','offset','sort','map','priority','cast','col','DESC','omit','length','isString','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','push','getOptions','query','model','attributes','intersection','nolimit','limit','where','pick','filter','object','columns','value','type','lower','lodash'];(function(_0x186d17,_0x9fa8ef){var _0x5d4b89=function(_0x57bd70){while(--_0x57bd70){_0x186d17['push'](_0x186d17['shift']());}};_0x5d4b89(++_0x9fa8ef);}(_0xf69d,0xd3));var _0xdf69=function(_0x245df0,_0x22df52){_0x245df0=_0x245df0-0x0;var _0x30a05a=_0xf69d[_0x245df0];return _0x30a05a;};'use strict';var _=require(_0xdf69('0x0'));var sequelize=require(_0xdf69('0x1'));var moment=require(_0xdf69('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0xe063fc){var _0xf89475=['ne'];try{var _0x4e4bdd=JSON[_0xdf69('0x3')](_0xe063fc);var _0x342114=Object[_0xdf69('0x4')](_0x4e4bdd)[0x0];return _0xf89475[_0xdf69('0x5')](_0x342114);}catch(_0x177ff7){return![];}}function getOperatorValue(_0x18ce2b){var _0x2d456f=JSON[_0xdf69('0x3')](_0x18ce2b);var _0x1d2501=Object[_0xdf69('0x4')](_0x2d456f)[0x0];var _0x18a08e=_0x2d456f[_0x1d2501];return{['$'+_0x1d2501]:_0x18a08e};}exports[_0xdf69('0x6')]=function(_0x38909e){var _0x466c26=null;if(_0x38909e){_0x466c26=_0x38909e[_0xdf69('0x7')](',');}return _0x466c26;};exports[_0xdf69('0x8')]=function(_0x1e0e8d,_0x4fcc93){var _0x305726={};if(!_[_0xdf69('0x9')](_0x1e0e8d)){_[_0xdf69('0xa')](_0x1e0e8d,function(_0x21d8e0,_0x43ce3d){try{if(_0x4fcc93){var _0x1b86d4=_['find'](_0x4fcc93,{'name':_0x43ce3d})||{};if(hasSequelizeOperator(_0x21d8e0)){_0x305726[_0x43ce3d]=getOperatorValue(_0x21d8e0);}else if(_0x1b86d4['type']==='DATE'&&_['isPlainObject'](_0x21d8e0)){var _0x3dcda8=JSON[_0xdf69('0x3')](_0x21d8e0);var _0x3b557c={'$gte':moment(moment(_0x3dcda8[_0xdf69('0xb')])[_0xdf69('0xc')](_0xdf69('0xd')))['utc']()[_0xdf69('0xc')](),'$lte':moment(moment(_0x3dcda8[_0xdf69('0xe')])[_0xdf69('0xc')](_0xdf69('0xd')))['utc']()[_0xdf69('0xf')](0x1,'s')['format']()};_0x305726[_0x43ce3d]=_0x3b557c;}else if(_0x1b86d4[_0xdf69('0x10')]===_0xdf69('0x11')){_0x305726[_0x43ce3d]=_0x21d8e0;}else{_0x305726[_0x43ce3d]=_['isArray'](_0x21d8e0)?_0x21d8e0:JSON[_0xdf69('0x3')](_0x21d8e0);}}else{_0x305726[_0x43ce3d]=_[_0xdf69('0x12')](_0x21d8e0)?_0x21d8e0:JSON[_0xdf69('0x3')](_0x21d8e0);}}catch(_0x85d1d){_0x305726[_0x43ce3d]=_0x21d8e0['split'](',');}});}return _0x305726;};exports['limit']=function(_0x352400){_0x352400=parseInt(_0x352400,0xa);if(!_0x352400||_0x352400<0x0){_0x352400=LIMIT_VALUE;}return _0x352400;};exports[_0xdf69('0x13')]=function(_0x54df73){_0x54df73=parseInt(_0x54df73,0xa);if(!_0x54df73||_0x54df73<0x0){_0x54df73=0x0;}return _0x54df73;};exports[_0xdf69('0x14')]=function(_0x259e90){var _0x68fa80,_0x526cbc=null;if(_0x259e90){_0x68fa80=_0x259e90[_0xdf69('0x7')](',');_0x526cbc=_[_0xdf69('0x15')](_0x68fa80,function(_0x4d09d5){if(_0x4d09d5['indexOf']('-')===0x0){return[_0x4d09d5===_0xdf69('0x16')?sequelize[_0xdf69('0x17')](sequelize[_0xdf69('0x18')]('priority'),'unsigned'):_0x4d09d5['substr'](0x1),_0xdf69('0x19')];}else{return[_0x4d09d5==='priority'?sequelize[_0xdf69('0x17')](sequelize[_0xdf69('0x18')](_0xdf69('0x16')),'unsigned'):_0x4d09d5,'ASC'];}});}return _0x526cbc;};exports[_0xdf69('0x1a')]=function(_0x1437f6,_0x6da296){if(_[_0xdf69('0x9')](_0x1437f6)){return _0x1437f6;}if(_['isArray'](_0x1437f6)){for(var _0x3b727c=0x0;_0x3b727c<_0x1437f6[_0xdf69('0x1b')];_0x3b727c+=0x1){_0x1437f6[_0x3b727c]=this[_0xdf69('0x1a')](_0x1437f6[_0x3b727c],_0x6da296);}return _0x1437f6;}if(!_['isObject'](_0x1437f6)){return _0x1437f6;}if(_[_0xdf69('0x1c')](_0x6da296)){_0x6da296=[_0x6da296];}if(!_['isArray'](_0x6da296)){return _0x1437f6;}for(var _0x5dcabd=0x0;_0x5dcabd<_0x6da296['length'];_0x5dcabd+=0x1){_['unset'](_0x1437f6,_0x6da296[_0x5dcabd]);}for(var _0x146b6a in _0x1437f6){if(_0x1437f6[_0xdf69('0x1d')](_0x146b6a)){_0x1437f6[_0x146b6a]=this['omit'](_0x1437f6[_0x146b6a],_0x6da296);}}return _0x1437f6;};exports[_0xdf69('0x1e')]=function(_0xd81d0a){return _0xd81d0a[_0xdf69('0x1f')](RegExp(_0xdf69('0x20')))?!![]:![];};exports[_0xdf69('0x21')]=function(_0x1b57b3){return _0x1b57b3[_0xdf69('0x1f')](/^\S+@\S+$/)?!![]:![];};exports[_0xdf69('0x22')]=function(_0x1f67fe){var _0x3b97df=[];_0x1f67fe[_0xdf69('0x7')](/[ ,]+/)[_0xdf69('0x23')](function(_0x38f848){_0x38f848=_0x38f848[_0xdf69('0x24')](/([^:]")"+/g,'$1');_0x38f848='+'+_0x38f848+'*';var _0x1b145b=/[ `!@#$%^&*()_\-?~]/;if(_0x38f848[_0xdf69('0x1f')](_0x1b145b))_0x38f848='\x22'+_0x38f848+'\x22';_0x3b97df[_0xdf69('0x25')](_0x38f848);});return _0x3b97df['join']('\x20');};exports[_0xdf69('0x26')]=function(_0x2aab76,_0x20fd6e,_0x321040){var _0x1a23d1={},_0x51ee4c={};if(_0x20fd6e[_0xdf69('0x27')]['$id']){_0x20fd6e[_0xdf69('0x27')]['id']=_0x20fd6e[_0xdf69('0x27')]['$id'];delete _0x20fd6e[_0xdf69('0x27')]['$id'];}_0x1a23d1[_0xdf69('0x28')]=_[_0xdf69('0x15')](_0x2aab76,_0xdf69('0x10'));_0x1a23d1[_0xdf69('0x27')]=_[_0xdf69('0x4')](_0x20fd6e['query']);_0x1a23d1[_0xdf69('0x8')]=_['intersection'](_0x1a23d1[_0xdf69('0x28')],_0x1a23d1[_0xdf69('0x27')]);_0x51ee4c[_0xdf69('0x29')]=_[_0xdf69('0x2a')](_0x1a23d1['model'],this[_0xdf69('0x6')](_0x20fd6e['query'][_0xdf69('0x6')]));_0x51ee4c['attributes']=_0x51ee4c[_0xdf69('0x29')]['length']?_0x51ee4c[_0xdf69('0x29')]:_0x1a23d1[_0xdf69('0x28')];if(!_0x20fd6e[_0xdf69('0x27')][_0xdf69('0x1d')](_0xdf69('0x2b'))){_0x51ee4c['limit']=this[_0xdf69('0x2c')](_0x20fd6e[_0xdf69('0x27')]['limit']);_0x51ee4c['offset']=this['offset'](_0x20fd6e['query'][_0xdf69('0x13')]);}_0x51ee4c['order']=this[_0xdf69('0x14')](_0x20fd6e[_0xdf69('0x27')][_0xdf69('0x14')]);_0x51ee4c[_0xdf69('0x2d')]=this['filters'](_[_0xdf69('0x2e')](_0x20fd6e[_0xdf69('0x27')],_0x1a23d1[_0xdf69('0x8')]),_0x2aab76);if(_0x20fd6e['query'][_0xdf69('0x2f')]){var _0xdd919d=_0x2aab76;var _0x34ab67=_0x20fd6e[_0xdf69('0x27')][_0xdf69('0x2f')];if(typeof _0x34ab67===_0xdf69('0x30')){_0xdd919d=_[_0xdf69('0x2f')](_0x2aab76,function(_0x4fd313){return _['includes'](_0x34ab67[_0xdf69('0x31')],_0x4fd313[_0xdf69('0x10')]);});_0x34ab67=_0x34ab67[_0xdf69('0x32')];}_0x51ee4c[_0xdf69('0x2d')]=_['merge'](_0x51ee4c['where'],{'$or':_['map'](_0xdd919d,function(_0x5454e1){if(_0x5454e1[_0xdf69('0x33')]!=='VIRTUAL'){if(_0x321040){return sequelize[_0xdf69('0x2d')](sequelize['fn']('lower',sequelize[_0xdf69('0x18')](_0x5454e1[_0xdf69('0x10')])),{'$like':sequelize['fn'](_0xdf69('0x34'),'%'+_0x20fd6e[_0xdf69('0x27')][_0xdf69('0x2f')]+'%')});}else{var _0x2a7c7d={};_0x2a7c7d[_0x5454e1[_0xdf69('0x10')]]={'$like':'%'+_0x20fd6e[_0xdf69('0x27')][_0xdf69('0x2f')]+'%'};return _0x2a7c7d;}}})});}_0x51ee4c=_['merge']({},_0x51ee4c,_0x20fd6e['options']);return _0x51ee4c;}; \ No newline at end of file +var _0x56e7=['options','sequelize','moment','parse','keys','includes','fields','split','filters','isEmpty','forOwn','find','isPlainObject','$gte','format','YYYY-MM-DD','$lte','name','uniqueid','isArray','sort','map','indexOf','priority','cast','col','unsigned','substr','DESC','ASC','omit','isObject','isString','length','hasOwnProperty','match','isEmail','getFullTextValue','forEach','replace','push','getOptions','query','$id','intersection','model','attributes','nolimit','limit','offset','order','where','pick','filter','object','columns','value','type','VIRTUAL','lower','merge'];(function(_0x20f5bb,_0x4538ed){var _0x22c379=function(_0x3f19ed){while(--_0x3f19ed){_0x20f5bb['push'](_0x20f5bb['shift']());}};_0x22c379(++_0x4538ed);}(_0x56e7,0x7b));var _0x756e=function(_0xc74312,_0x3d8ef0){_0xc74312=_0xc74312-0x0;var _0x3a9838=_0x56e7[_0xc74312];return _0x3a9838;};'use strict';var _=require('lodash');var sequelize=require(_0x756e('0x0'));var moment=require(_0x756e('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x590286){var _0x2eadee=['ne'];try{var _0x3efe5c=JSON[_0x756e('0x2')](_0x590286);var _0xb850c9=Object[_0x756e('0x3')](_0x3efe5c)[0x0];return _0x2eadee[_0x756e('0x4')](_0xb850c9);}catch(_0x446fff){return![];}}function getOperatorValue(_0x538050){var _0x3b3b8f=JSON[_0x756e('0x2')](_0x538050);var _0x26519d=Object[_0x756e('0x3')](_0x3b3b8f)[0x0];var _0x5c8589=_0x3b3b8f[_0x26519d];return{['$'+_0x26519d]:_0x5c8589};}exports[_0x756e('0x5')]=function(_0x5c2db4){var _0x4460c7=null;if(_0x5c2db4){_0x4460c7=_0x5c2db4[_0x756e('0x6')](',');}return _0x4460c7;};exports[_0x756e('0x7')]=function(_0x4738dc,_0x4adf8f){var _0x5d5b90={};if(!_[_0x756e('0x8')](_0x4738dc)){_[_0x756e('0x9')](_0x4738dc,function(_0x13bea7,_0x4c4d7c){try{if(_0x4adf8f){var _0x330076=_[_0x756e('0xa')](_0x4adf8f,{'name':_0x4c4d7c})||{};if(hasSequelizeOperator(_0x13bea7)){_0x5d5b90[_0x4c4d7c]=getOperatorValue(_0x13bea7);}else if(_0x330076['type']==='DATE'&&_[_0x756e('0xb')](_0x13bea7)){var _0x569e8f=JSON[_0x756e('0x2')](_0x13bea7);var _0x21701a={'$gte':moment(moment(_0x569e8f[_0x756e('0xc')])[_0x756e('0xd')](_0x756e('0xe')))['utc']()['format'](),'$lte':moment(moment(_0x569e8f[_0x756e('0xf')])[_0x756e('0xd')](_0x756e('0xe')))['utc']()['subtract'](0x1,'s')[_0x756e('0xd')]()};_0x5d5b90[_0x4c4d7c]=_0x21701a;}else if(_0x330076[_0x756e('0x10')]===_0x756e('0x11')){_0x5d5b90[_0x4c4d7c]=_0x13bea7;}else{_0x5d5b90[_0x4c4d7c]=_[_0x756e('0x12')](_0x13bea7)?_0x13bea7:JSON[_0x756e('0x2')](_0x13bea7);}}else{_0x5d5b90[_0x4c4d7c]=_[_0x756e('0x12')](_0x13bea7)?_0x13bea7:JSON[_0x756e('0x2')](_0x13bea7);}}catch(_0x1a8614){_0x5d5b90[_0x4c4d7c]=_0x13bea7[_0x756e('0x6')](',');}});}return _0x5d5b90;};exports['limit']=function(_0x216ffd){_0x216ffd=parseInt(_0x216ffd,0xa);if(!_0x216ffd||_0x216ffd<0x0){_0x216ffd=LIMIT_VALUE;}return _0x216ffd;};exports['offset']=function(_0x4d7581){_0x4d7581=parseInt(_0x4d7581,0xa);if(!_0x4d7581||_0x4d7581<0x0){_0x4d7581=0x0;}return _0x4d7581;};exports[_0x756e('0x13')]=function(_0x28872e){var _0x30bc11,_0xe26ae=null;if(_0x28872e){_0x30bc11=_0x28872e[_0x756e('0x6')](',');_0xe26ae=_[_0x756e('0x14')](_0x30bc11,function(_0xb00195){if(_0xb00195[_0x756e('0x15')]('-')===0x0){return[_0xb00195===_0x756e('0x16')?sequelize[_0x756e('0x17')](sequelize[_0x756e('0x18')](_0x756e('0x16')),_0x756e('0x19')):_0xb00195[_0x756e('0x1a')](0x1),_0x756e('0x1b')];}else{return[_0xb00195===_0x756e('0x16')?sequelize['cast'](sequelize[_0x756e('0x18')]('priority'),_0x756e('0x19')):_0xb00195,_0x756e('0x1c')];}});}return _0xe26ae;};exports[_0x756e('0x1d')]=function(_0x2722eb,_0x506986){if(_[_0x756e('0x8')](_0x2722eb)){return _0x2722eb;}if(_[_0x756e('0x12')](_0x2722eb)){for(var _0x2f4db8=0x0;_0x2f4db8<_0x2722eb['length'];_0x2f4db8+=0x1){_0x2722eb[_0x2f4db8]=this[_0x756e('0x1d')](_0x2722eb[_0x2f4db8],_0x506986);}return _0x2722eb;}if(!_[_0x756e('0x1e')](_0x2722eb)){return _0x2722eb;}if(_[_0x756e('0x1f')](_0x506986)){_0x506986=[_0x506986];}if(!_['isArray'](_0x506986)){return _0x2722eb;}for(var _0xf09ae3=0x0;_0xf09ae3<_0x506986[_0x756e('0x20')];_0xf09ae3+=0x1){_['unset'](_0x2722eb,_0x506986[_0xf09ae3]);}for(var _0x39befb in _0x2722eb){if(_0x2722eb[_0x756e('0x21')](_0x39befb)){_0x2722eb[_0x39befb]=this[_0x756e('0x1d')](_0x2722eb[_0x39befb],_0x506986);}}return _0x2722eb;};exports['isNumeric']=function(_0x3c332e){return _0x3c332e[_0x756e('0x22')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0x756e('0x23')]=function(_0x2a7fdb){return _0x2a7fdb['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x756e('0x24')]=function(_0x422a53){var _0x39acd7=[];_0x422a53[_0x756e('0x6')](/[ ,]+/)[_0x756e('0x25')](function(_0x4fdb97){_0x4fdb97=_0x4fdb97[_0x756e('0x26')](/([^:]")"+/g,'$1');_0x4fdb97='+'+_0x4fdb97+'*';var _0x5c7947=/[ `!@#$%^&*()_\-?~]/;if(_0x4fdb97['match'](_0x5c7947))_0x4fdb97='\x22'+_0x4fdb97+'\x22';_0x39acd7[_0x756e('0x27')](_0x4fdb97);});return _0x39acd7['join']('\x20');};exports[_0x756e('0x28')]=function(_0x6a3661,_0x6aaf10,_0xccf702){var _0x4529aa={},_0x17d9d1={};if(_0x6aaf10[_0x756e('0x29')][_0x756e('0x2a')]){_0x6aaf10[_0x756e('0x29')]['id']=_0x6aaf10[_0x756e('0x29')][_0x756e('0x2a')];delete _0x6aaf10[_0x756e('0x29')]['$id'];}_0x4529aa['model']=_[_0x756e('0x14')](_0x6a3661,_0x756e('0x10'));_0x4529aa[_0x756e('0x29')]=_[_0x756e('0x3')](_0x6aaf10[_0x756e('0x29')]);_0x4529aa[_0x756e('0x7')]=_[_0x756e('0x2b')](_0x4529aa['model'],_0x4529aa['query']);_0x17d9d1['attributes']=_[_0x756e('0x2b')](_0x4529aa[_0x756e('0x2c')],this[_0x756e('0x5')](_0x6aaf10['query'][_0x756e('0x5')]));_0x17d9d1[_0x756e('0x2d')]=_0x17d9d1['attributes'][_0x756e('0x20')]?_0x17d9d1[_0x756e('0x2d')]:_0x4529aa[_0x756e('0x2c')];if(!_0x6aaf10[_0x756e('0x29')][_0x756e('0x21')](_0x756e('0x2e'))){_0x17d9d1[_0x756e('0x2f')]=this[_0x756e('0x2f')](_0x6aaf10['query'][_0x756e('0x2f')]);_0x17d9d1[_0x756e('0x30')]=this[_0x756e('0x30')](_0x6aaf10[_0x756e('0x29')][_0x756e('0x30')]);}_0x17d9d1[_0x756e('0x31')]=this[_0x756e('0x13')](_0x6aaf10[_0x756e('0x29')][_0x756e('0x13')]);_0x17d9d1[_0x756e('0x32')]=this['filters'](_[_0x756e('0x33')](_0x6aaf10[_0x756e('0x29')],_0x4529aa['filters']),_0x6a3661);if(_0x6aaf10[_0x756e('0x29')][_0x756e('0x34')]){var _0x2b4fc3=_0x6a3661;var _0x57a93f=_0x6aaf10[_0x756e('0x29')][_0x756e('0x34')];if(typeof _0x57a93f===_0x756e('0x35')){_0x2b4fc3=_['filter'](_0x6a3661,function(_0x5a8dfb){return _[_0x756e('0x4')](_0x57a93f[_0x756e('0x36')],_0x5a8dfb[_0x756e('0x10')]);});_0x57a93f=_0x57a93f[_0x756e('0x37')];}_0x17d9d1[_0x756e('0x32')]=_['merge'](_0x17d9d1[_0x756e('0x32')],{'$or':_[_0x756e('0x14')](_0x2b4fc3,function(_0x5c471e){if(_0x5c471e[_0x756e('0x38')]!==_0x756e('0x39')){if(_0xccf702){return sequelize[_0x756e('0x32')](sequelize['fn'](_0x756e('0x3a'),sequelize[_0x756e('0x18')](_0x5c471e[_0x756e('0x10')])),{'$like':sequelize['fn'](_0x756e('0x3a'),'%'+_0x6aaf10[_0x756e('0x29')][_0x756e('0x34')]+'%')});}else{var _0x52d21e={};_0x52d21e[_0x5c471e[_0x756e('0x10')]]={'$like':'%'+_0x6aaf10['query'][_0x756e('0x34')]+'%'};return _0x52d21e;}}})});}_0x17d9d1=_[_0x756e('0x3b')]({},_0x17d9d1,_0x6aaf10[_0x756e('0x3c')]);return _0x17d9d1;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index d0adaa1..3b73129 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x34a087,_0x4bd68e){var _0x5c15d7=function(_0x152823){while(--_0x152823){_0x34a087['push'](_0x34a087['shift']());}};_0x5c15d7(++_0x4bd68e);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file +var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x3a914e,_0x4bfedb){var _0x3450da=function(_0x35878e){while(--_0x35878e){_0x3a914e['push'](_0x3a914e['shift']());}};_0x3450da(++_0x4bfedb);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 8ab93e9..5e5b9d5 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 _0xcb4b=['win32','utf8','replace','hostname','macAddress','ipAddress','update','substring','lodash','../environment','networkInterfaces','orderBy','keys','length','filter','family','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','cpus','map','join','createHash','md5','digest','hex','getUuid','platform','licenseToken'];(function(_0x469a3c,_0x5ebc10){var _0x968f4=function(_0x22403b){while(--_0x22403b){_0x469a3c['push'](_0x469a3c['shift']());}};_0x968f4(++_0x5ebc10);}(_0xcb4b,0x1c2));var _0xbcb4=function(_0x166740,_0x27abae){_0x166740=_0x166740-0x0;var _0x22cd33=_0xcb4b[_0x166740];return _0x22cd33;};'use strict';var _=require(_0xbcb4('0x0'));var os=require('os');var crypto=require('crypto');var machine=require('bimedia-machine-uuid');var exec=require('child_process')['execSync'];var config=require(_0xbcb4('0x1'));function getInterfaces(){var _0x2bf172=[];var _0x10c881=os[_0xbcb4('0x2')]();var _0x5ac523=_[_0xbcb4('0x3')](_[_0xbcb4('0x4')](_0x10c881));for(var _0x479daa=0x0;_0x479daa<_0x5ac523[_0xbcb4('0x5')];_0x479daa++){var _0x1c1e97=_0x10c881[_0x5ac523[_0x479daa]][_0xbcb4('0x6')](function(_0x126f79){return _0x126f79[_0xbcb4('0x7')]===_0xbcb4('0x8')&&_0x126f79[_0xbcb4('0x9')]===![];});_0x2bf172=_0x2bf172[_0xbcb4('0xa')](_0x1c1e97);}return _0x2bf172;}function getFirstInterface(){var _0x1b3b48=_[_0xbcb4('0xb')](getInterfaces());return{'macAddress':_0x1b3b48&&_0x1b3b48['mac']?_0x1b3b48[_0xbcb4('0xc')]:_0xbcb4('0xd'),'ipAddress':_0x1b3b48&&_0x1b3b48[_0xbcb4('0xe')]?_0x1b3b48[_0xbcb4('0xe')]:_0xbcb4('0xf')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x454a4c=_[_0xbcb4('0x3')](os[_0xbcb4('0x10')]()[_0xbcb4('0x11')](function(_0x124c9b){return _0x124c9b['model'];}))[_0xbcb4('0x12')](':');return crypto[_0xbcb4('0x13')](_0xbcb4('0x14'))['update'](_0x454a4c)[_0xbcb4('0x15')](_0xbcb4('0x16'));}exports[_0xbcb4('0x17')]=function(){var _0x51b5d6=os[_0xbcb4('0x18')]();var _0x1f1758=/[0-9a-f-]{36}/;if(config[_0xbcb4('0x19')]&&_0x1f1758['test'](config[_0xbcb4('0x19')])){return config['licenseToken'];}else if(_0x51b5d6===_0xbcb4('0x1a')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0xbcb4('0x1b')})[_0xbcb4('0x1c')]('\x0d\x0a','');}else{var _0x1905f4=getFirstInterface();var _0x2f2368=getCPUhash();var _0x449103=_0x2f2368+'|'+os[_0xbcb4('0x1d')]()+'|'+_0x1905f4[_0xbcb4('0x1e')]+'|'+_0x1905f4[_0xbcb4('0x1f')];var _0x3745d8=crypto[_0xbcb4('0x13')]('md5')[_0xbcb4('0x20')](_0x449103)[_0xbcb4('0x15')](_0xbcb4('0x16'));return _0x3745d8[_0xbcb4('0x21')](0x0,0x8)+'-'+_0x3745d8[_0xbcb4('0x21')](0x8,0xc)+'-'+_0x3745d8[_0xbcb4('0x21')](0xc,0x10)+'-'+_0x3745d8[_0xbcb4('0x21')](0x10,0x14)+'-'+_0x3745d8[_0xbcb4('0x21')](0x14);}}; \ No newline at end of file +var _0x5c24=['internal','concat','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','orderBy','cpus','map','model','join','md5','update','digest','hex','getUuid','platform','licenseToken','test','dmidecode\x20--string\x20system-uuid','utf8','hostname','createHash','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','keys','length','filter','family','IPv4'];(function(_0x201ed2,_0x1042cc){var _0x138582=function(_0x682b4a){while(--_0x682b4a){_0x201ed2['push'](_0x201ed2['shift']());}};_0x138582(++_0x1042cc);}(_0x5c24,0x115));var _0x45c2=function(_0x2f9467,_0x40576f){_0x2f9467=_0x2f9467-0x0;var _0x39894c=_0x5c24[_0x2f9467];return _0x39894c;};'use strict';var _=require(_0x45c2('0x0'));var os=require('os');var crypto=require(_0x45c2('0x1'));var machine=require(_0x45c2('0x2'));var exec=require(_0x45c2('0x3'))[_0x45c2('0x4')];var config=require(_0x45c2('0x5'));function getInterfaces(){var _0x49199b=[];var _0x562cc2=os['networkInterfaces']();var _0xb859dd=_['orderBy'](_[_0x45c2('0x6')](_0x562cc2));for(var _0x5242fb=0x0;_0x5242fb<_0xb859dd[_0x45c2('0x7')];_0x5242fb++){var _0x2ef7bc=_0x562cc2[_0xb859dd[_0x5242fb]][_0x45c2('0x8')](function(_0x45254f){return _0x45254f[_0x45c2('0x9')]===_0x45c2('0xa')&&_0x45254f[_0x45c2('0xb')]===![];});_0x49199b=_0x49199b[_0x45c2('0xc')](_0x2ef7bc);}return _0x49199b;}function getFirstInterface(){var _0x4e332e=_['head'](getInterfaces());return{'macAddress':_0x4e332e&&_0x4e332e['mac']?_0x4e332e[_0x45c2('0xd')]:_0x45c2('0xe'),'ipAddress':_0x4e332e&&_0x4e332e[_0x45c2('0xf')]?_0x4e332e[_0x45c2('0xf')]:_0x45c2('0x10')};}exports[_0x45c2('0x11')]=getFirstInterface;function getCPUhash(){var _0x20133b=_[_0x45c2('0x12')](os[_0x45c2('0x13')]()[_0x45c2('0x14')](function(_0x3f875e){return _0x3f875e[_0x45c2('0x15')];}))[_0x45c2('0x16')](':');return crypto['createHash'](_0x45c2('0x17'))[_0x45c2('0x18')](_0x20133b)[_0x45c2('0x19')](_0x45c2('0x1a'));}exports[_0x45c2('0x1b')]=function(){var _0x59c9de=os[_0x45c2('0x1c')]();var _0x2187f9=/[0-9a-f-]{36}/;if(config[_0x45c2('0x1d')]&&_0x2187f9[_0x45c2('0x1e')](config[_0x45c2('0x1d')])){return config['licenseToken'];}else if(_0x59c9de==='win32'){return exec(_0x45c2('0x1f'),{'encoding':_0x45c2('0x20')})['replace']('\x0d\x0a','');}else{var _0x1fa8f0=getFirstInterface();var _0x1a4c9f=getCPUhash();var _0x3a9ee8=_0x1a4c9f+'|'+os[_0x45c2('0x21')]()+'|'+_0x1fa8f0['macAddress']+'|'+_0x1fa8f0['ipAddress'];var _0x118ed9=crypto[_0x45c2('0x22')](_0x45c2('0x17'))[_0x45c2('0x18')](_0x3a9ee8)[_0x45c2('0x19')](_0x45c2('0x1a'));return _0x118ed9[_0x45c2('0x23')](0x0,0x8)+'-'+_0x118ed9[_0x45c2('0x23')](0x8,0xc)+'-'+_0x118ed9['substring'](0xc,0x10)+'-'+_0x118ed9[_0x45c2('0x23')](0x10,0x14)+'-'+_0x118ed9['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 438bf09..0720a8f 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 _0x2aa7=['GET','catch','get','data1','active','license','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','then','error','getUuid','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','message','pkginfo','version','../../components/encryptor','./hardware','../logger','format','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s'];(function(_0x2c53aa,_0x2f8db2){var _0x11ee98=function(_0x4311a9){while(--_0x4311a9){_0x2c53aa['push'](_0x2c53aa['shift']());}};_0x11ee98(++_0x2f8db2);}(_0x2aa7,0x110));var _0x72aa=function(_0x25d662,_0x379b70){_0x25d662=_0x25d662-0x0;var _0x17f85b=_0x2aa7[_0x25d662];return _0x17f85b;};'use strict';var util=require('util');var moment=require('moment');var rp=require('request-promise');var BPromise=require('bluebird');var pkginfo=require(_0x72aa('0x0'))(module,_0x72aa('0x1'));var db=require('../../mysqldb')['db'];var encryptor=require(_0x72aa('0x2'));var hardware=require(_0x72aa('0x3'));var logger=require(_0x72aa('0x4'))('license');var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x424d6b){return new BPromise(function(_0x2b8b6b,_0x6c6bae){var _0x1f7e89=util[_0x72aa('0x5')]('%s/api/servers/%s/check?version=%s',HOST,_0x424d6b,module[_0x72aa('0x6')][_0x72aa('0x1')]);if(oldToken){_0x1f7e89=util[_0x72aa('0x5')](_0x72aa('0x7'),HOST,_0x424d6b,module['exports'][_0x72aa('0x1')],oldToken);}var _0x119e07={'uri':_0x1f7e89,'method':_0x72aa('0x8'),'timeout':0xea60,'json':!![]};return rp(_0x119e07)['then'](function(_0x266abe){_0x2b8b6b(_0x266abe);})[_0x72aa('0x9')](function(_0x570fb7){_0x6c6bae(_0x570fb7);});});}function manageLicense(_0x57fd9e,_0x43c4fb){var _0xb5cdad=_0x43c4fb[_0x72aa('0xa')]({'plain':!![]});if(!isOldTokenSent&&_0xb5cdad[_0x72aa('0xb')]!==_0x57fd9e&&!_0xb5cdad['data2']){oldToken=_0xb5cdad[_0x72aa('0xb')];}httpRequest(_0x57fd9e)['then'](function(_0x18b6c3){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x18b6c3[_0x72aa('0xc')]){isOldTokenSent=![];if(!_0xb5cdad[_0x72aa('0xd')]&&_0xb5cdad[_0x72aa('0xd')]!=_0x18b6c3[_0x72aa('0xd')]||_0xb5cdad[_0x72aa('0xd')]&&_0xb5cdad[_0x72aa('0xe')]){logger[_0x72aa('0xf')](_0x72aa('0x10'));}if(_0xb5cdad[_0x72aa('0xd')]&&!_0xb5cdad[_0x72aa('0xe')]&&_0xb5cdad['license']!=_0x18b6c3[_0x72aa('0xd')]){logger[_0x72aa('0xf')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0xb5cdad['license']&&!_0xb5cdad[_0x72aa('0xe')]&&_0xb5cdad[_0x72aa('0xd')]==_0x18b6c3['license']){return _0x43c4fb;}return _0x43c4fb[_0x72aa('0x11')]({'data1':_0x57fd9e,'data2':null,'license':_0x18b6c3[_0x72aa('0xd')]});}else{if(_0x18b6c3[_0x72aa('0xd')]||_0xb5cdad[_0x72aa('0xd')]){if(!_0xb5cdad[_0x72aa('0xe')]){if(_0xb5cdad[_0x72aa('0xb')]==_0x57fd9e){GRAY_PERIOD_REASON=_0x72aa('0x12');logger[_0x72aa('0xf')](_0x72aa('0x13'));}else{GRAY_PERIOD_REASON=_0x72aa('0x14');logger[_0x72aa('0xf')](_0x72aa('0x15'),_0xb5cdad['data1'],_0x57fd9e);}logger[_0x72aa('0xf')](_0x72aa('0x16'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x72aa('0x5')](_0x72aa('0x17')));return _0x43c4fb[_0x72aa('0x11')]({'data2':encryptor[_0x72aa('0x18')](moment()[_0x72aa('0x5')](_0x72aa('0x17')))});}else{if(moment()[_0x72aa('0x19')](encryptor[_0x72aa('0x1a')](_0xb5cdad[_0x72aa('0xe')]),_0x72aa('0x1b'))>DAYS){logger[_0x72aa('0xf')]('DEMO\x20START\x20AT\x20%s',moment()[_0x72aa('0x5')](_0x72aa('0x17')));isOldTokenSent=![];return _0x43c4fb[_0x72aa('0x11')]({'data1':_0x57fd9e,'data2':null,'license':null});}}}else{if(_0xb5cdad[_0x72aa('0xb')]!=_0x57fd9e){logger[_0x72aa('0xf')](_0x72aa('0x15'),_0xb5cdad[_0x72aa('0xb')],_0x57fd9e);return _0x43c4fb[_0x72aa('0x11')]({'data1':_0x57fd9e,'data2':null,'license':null});}}}return _0x43c4fb;})[_0x72aa('0x1c')](function(_0x1b6d32){_0x43c4fb=_0x1b6d32;})[_0x72aa('0x9')](function(_0x354997){logger[_0x72aa('0x1d')](_0x354997['message']);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x72aa('0x1e')](),_0x43c4fb);},TIME);});}function defaultLicense(){var _0x4f29ff=hardware['getUuid']();if(_0x4f29ff){return db['License'][_0x72aa('0x1f')]({'where':{'id':0x1},'defaults':{'data1':_0x4f29ff}})[_0x72aa('0x20')](function(_0x51e97c,_0x1e7bb2){logger['info'](_0x72aa('0x21'),_0x4f29ff);manageLicense(_0x4f29ff,_0x51e97c);})[_0x72aa('0x9')](function(_0x47a3cb){logger['error'](_0x47a3cb[_0x72aa('0x22')]);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0x94a3=['../../mysqldb','./hardware','../logger','license','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','exports','version','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','catch','data1','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','toUpperCase','YYYY-MM-DD\x20HH:mm','update','encryptString','diff','days','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','then','message','finally','getUuid','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','error','util','moment','bluebird'];(function(_0x3ed44b,_0x30217d){var _0x97cd51=function(_0x49d484){while(--_0x49d484){_0x3ed44b['push'](_0x3ed44b['shift']());}};_0x97cd51(++_0x30217d);}(_0x94a3,0x85));var _0x394a=function(_0x339be1,_0xf3d0a9){_0x339be1=_0x339be1-0x0;var _0x2cd9f6=_0x94a3[_0x339be1];return _0x2cd9f6;};'use strict';var util=require(_0x394a('0x0'));var moment=require(_0x394a('0x1'));var rp=require('request-promise');var BPromise=require(_0x394a('0x2'));var pkginfo=require('pkginfo')(module,'version');var db=require(_0x394a('0x3'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x394a('0x4'));var logger=require(_0x394a('0x5'))(_0x394a('0x6'));var HOST=_0x394a('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x224775){return new BPromise(function(_0x4f50e5,_0x26fc83){var _0x488aa8=util['format'](_0x394a('0x8'),HOST,_0x224775,module[_0x394a('0x9')][_0x394a('0xa')]);if(oldToken){_0x488aa8=util[_0x394a('0xb')](_0x394a('0xc'),HOST,_0x224775,module[_0x394a('0x9')][_0x394a('0xa')],oldToken);}var _0x307d6b={'uri':_0x488aa8,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x307d6b)['then'](function(_0x14902e){_0x4f50e5(_0x14902e);})[_0x394a('0xd')](function(_0xe95d66){_0x26fc83(_0xe95d66);});});}function manageLicense(_0x4ea6c0,_0x54d58b){var _0x508ae5=_0x54d58b['get']({'plain':!![]});if(!isOldTokenSent&&_0x508ae5['data1']!==_0x4ea6c0&&!_0x508ae5['data2']){oldToken=_0x508ae5[_0x394a('0xe')];}httpRequest(_0x4ea6c0)['then'](function(_0x2f6e2f){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x2f6e2f[_0x394a('0xf')]){isOldTokenSent=![];if(!_0x508ae5[_0x394a('0x6')]&&_0x508ae5[_0x394a('0x6')]!=_0x2f6e2f[_0x394a('0x6')]||_0x508ae5[_0x394a('0x6')]&&_0x508ae5[_0x394a('0x10')]){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x508ae5[_0x394a('0x6')]&&!_0x508ae5['data2']&&_0x508ae5[_0x394a('0x6')]!=_0x2f6e2f[_0x394a('0x6')]){logger[_0x394a('0x11')](_0x394a('0x12'));}if(_0x508ae5['license']&&!_0x508ae5[_0x394a('0x10')]&&_0x508ae5[_0x394a('0x6')]==_0x2f6e2f[_0x394a('0x6')]){return _0x54d58b;}return _0x54d58b['update']({'data1':_0x4ea6c0,'data2':null,'license':_0x2f6e2f['license']});}else{if(_0x2f6e2f['license']||_0x508ae5[_0x394a('0x6')]){if(!_0x508ae5[_0x394a('0x10')]){if(_0x508ae5[_0x394a('0xe')]==_0x4ea6c0){GRAY_PERIOD_REASON='Disabled';logger[_0x394a('0x11')](_0x394a('0x13'));}else{GRAY_PERIOD_REASON='Changed';logger[_0x394a('0x11')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x508ae5['data1'],_0x4ea6c0);}logger[_0x394a('0x11')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x394a('0x14')](),moment()[_0x394a('0xb')](_0x394a('0x15')));return _0x54d58b[_0x394a('0x16')]({'data2':encryptor[_0x394a('0x17')](moment()[_0x394a('0xb')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x394a('0x18')](encryptor['decryptString'](_0x508ae5[_0x394a('0x10')]),_0x394a('0x19'))>DAYS){logger['info']('DEMO\x20START\x20AT\x20%s',moment()[_0x394a('0xb')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x54d58b[_0x394a('0x16')]({'data1':_0x4ea6c0,'data2':null,'license':null});}}}else{if(_0x508ae5[_0x394a('0xe')]!=_0x4ea6c0){logger[_0x394a('0x11')](_0x394a('0x1a'),_0x508ae5[_0x394a('0xe')],_0x4ea6c0);return _0x54d58b[_0x394a('0x16')]({'data1':_0x4ea6c0,'data2':null,'license':null});}}}return _0x54d58b;})[_0x394a('0x1b')](function(_0x2109f6){_0x54d58b=_0x2109f6;})['catch'](function(_0x886d49){logger['error'](_0x886d49[_0x394a('0x1c')]);})[_0x394a('0x1d')](function(){setTimeout(function(){manageLicense(hardware[_0x394a('0x1e')](),_0x54d58b);},TIME);});}function defaultLicense(){var _0x3a90c3=hardware['getUuid']();if(_0x3a90c3){return db['License'][_0x394a('0x1f')]({'where':{'id':0x1},'defaults':{'data1':_0x3a90c3}})['spread'](function(_0x45d2ad,_0x38d2ba){logger[_0x394a('0x11')](_0x394a('0x20'),_0x3a90c3);manageLicense(_0x3a90c3,_0x45d2ad);})['catch'](function(_0x37ca15){logger[_0x394a('0x21')](_0x37ca15[_0x394a('0x1c')]);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index c62c75e..f74bfb3 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 _0x959c=['data1','message','User','findAll','sequelize','COUNT','count','user','users','forEach','admin','role','pick','telephone','exports','util','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','Demo\x20license','getUuid','2027-01-01T00:00:00.000Z','Breaking\x20license','License','find','defaults','then','catch','license','isEmpty','split','decryptString','format','%s:%s:%s','demo','uuid','machineUuid','gray','deadline','add','days','changed','disabled'];(function(_0x56e2a0,_0x13b891){var _0x1b3b78=function(_0x79e8b1){while(--_0x79e8b1){_0x56e2a0['push'](_0x56e2a0['shift']());}};_0x1b3b78(++_0x13b891);}(_0x959c,0x123));var _0xc959=function(_0x21fde5,_0x450a80){_0x21fde5=_0x21fde5-0x0;var _0x36f209=_0x959c[_0x21fde5];return _0x36f209;};'use strict';var util=require(_0xc959('0x0'));var _=require(_0xc959('0x1'));var moment=require(_0xc959('0x2'));var BPromise=require(_0xc959('0x3'));var hardware=require(_0xc959('0x4'));var encryptor=require(_0xc959('0x5'));var db=require(_0xc959('0x6'))['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':_0xc959('0x7'),'machineUuid':hardware[_0xc959('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xc959('0x9'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xc959('0xa'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x5e803f){return new BPromise(function(_0x480a19,_0x3b73d2){return db[_0xc959('0xb')][_0xc959('0xc')](_[_0xc959('0xd')](_0x5e803f,{'raw':!![],'where':{'id':0x1}}))[_0xc959('0xe')](function(_0x2a4aa0){return checkLicense(_0x2a4aa0,null);})['then'](function(_0x3f092e){_0x480a19(_0x3f092e);return;})[_0xc959('0xf')](function(_0x291d56){_0x3b73d2(_0x291d56);});});}function checkLicense(_0x393636,_0x5b1150){if(!_0x393636){demoLicense['uuid']=_0x393636['data1'];return demoLicense;}try{var _0x588281=_0x5b1150||_0x393636[_0xc959('0x10')];if(_[_0xc959('0x11')](_0x588281)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x3110e3=_0x393636['data1'];var _0x171f5d=_0x393636['data2'];var _0x3b98a2=_0x3110e3['split']('-')[0x4];var _0x118c78=_0x3110e3[_0xc959('0x12')]('-')[0x0];var _0xa4417e=encryptor[_0xc959('0x13')](_0x588281,util[_0xc959('0x14')](_0xc959('0x15'),_0x3b98a2,_0x3110e3,_0x118c78));var _0x252062=JSON['parse'](_0xa4417e);_0x252062[_0xc959('0x16')]=![];_0x252062[_0xc959('0x17')]=_0x3110e3;_0x252062[_0xc959('0x18')]=hardware['getUuid']();if(_0x171f5d){var _0x44cd84=encryptor[_0xc959('0x13')](_0x171f5d);_0x252062[_0xc959('0x19')]=_0x44cd84;_0x252062[_0xc959('0x1a')]=moment(_0x44cd84)[_0xc959('0x1b')](0x7,_0xc959('0x1c'))[_0xc959('0x14')]();_0x252062['grayReason']=_0x252062['uuid']!=_0x252062['machineUuid']?_0xc959('0x1d'):_0xc959('0x1e');}return _0x252062;}catch(_0xbf96b2){breakingLicense[_0xc959('0x17')]=_0x393636[_0xc959('0x1f')];breakingLicense[_0xc959('0x20')]=_0xbf96b2['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x599327,_0x502f5a){getLicense()['then'](function(_0x3e67dc){return db[_0xc959('0x21')][_0xc959('0x22')]({'attributes':['role',[db[_0xc959('0x23')]['fn'](_0xc959('0x24'),db[_0xc959('0x23')]['col']('role')),_0xc959('0x25')]],'group':'role','where':{'role':{'$or':['admin',_0xc959('0x26'),'telephone']}},'raw':!![]})[_0xc959('0xe')](function(_0xdce30){var _0x5cfdb1={'user':_0x3e67dc[_0xc959('0x27')]||0x0,'telephone':_0x3e67dc['telephones']||0x0};_0xdce30[_0xc959('0x28')](function(_0x4eb5c1){var _0x1ac66b=_0x4eb5c1['role']===_0xc959('0x29')?_0xc959('0x26'):_0x4eb5c1[_0xc959('0x2a')];_0x5cfdb1[_0x1ac66b]-=_0x4eb5c1['count'];if(_0x5cfdb1[_0x1ac66b]<0x0)_0x5cfdb1[_0x1ac66b]=0x0;});_0x599327(_0x5cfdb1);return;});})[_0xc959('0xf')](function(_0x86c276){_0x502f5a(_0x86c276);});});}function checkUserLimits(_0x1518c2){return new BPromise(function(_0x3747c2,_0x378fce){getLimits()[_0xc959('0xe')](function(_0x1f155d){var _0x334b5e=_[_0xc959('0x2b')](_['countBy'](_0x1518c2,_0xc959('0x2a')),['admin',_0xc959('0x26'),_0xc959('0x2c')]);var _0x1a0a47=(_0x334b5e[_0xc959('0x29')]||0x0)+(_0x334b5e[_0xc959('0x26')]||0x0);var _0x39f0d1=_0x334b5e['telephone']||0x0;if(_0x1a0a47>_0x1f155d[_0xc959('0x26')])return _0x378fce('License\x20limit\x20reached\x20for\x20users');if(_0x39f0d1>_0x1f155d['telephone'])return _0x378fce('License\x20limit\x20reached\x20for\x20telephones');return _0x3747c2();})['catch'](function(_0x1ac1ff){_0x378fce(_0x1ac1ff);});});}module[_0xc959('0x2d')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x00bb=['%s:%s:%s','parse','demo','uuid','machineUuid','gray','days','grayReason','changed','message','role','sequelize','col','count','admin','telephone','users','telephones','countBy','user','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','License','find','defaults','then','catch','data1','license','License\x20key\x20value\x20not\x20found','split','decryptString','format'];(function(_0x1adaaa,_0x278d58){var _0xb89940=function(_0x17b30f){while(--_0x17b30f){_0x1adaaa['push'](_0x1adaaa['shift']());}};_0xb89940(++_0x278d58);}(_0x00bb,0x1c5));var _0xb00b=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x00bb[_0xbca1b1];return _0x4e1686;};'use strict';var util=require(_0xb00b('0x0'));var _=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require(_0xb00b('0x3'));var hardware=require('./hardware');var encryptor=require(_0xb00b('0x4'));var db=require(_0xb00b('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xb00b('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xb00b('0x7'),'machineUuid':hardware[_0xb00b('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xb00b('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0xb00b('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0xd7bd0a){return new BPromise(function(_0x158b35,_0x330a1a){return db[_0xb00b('0x9')][_0xb00b('0xa')](_[_0xb00b('0xb')](_0xd7bd0a,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x204186){return checkLicense(_0x204186,null);})[_0xb00b('0xc')](function(_0xca867e){_0x158b35(_0xca867e);return;})[_0xb00b('0xd')](function(_0x4927b7){_0x330a1a(_0x4927b7);});});}function checkLicense(_0x4c32d7,_0x27fdc4){if(!_0x4c32d7){demoLicense['uuid']=_0x4c32d7[_0xb00b('0xe')];return demoLicense;}try{var _0x5184ba=_0x27fdc4||_0x4c32d7[_0xb00b('0xf')];if(_['isEmpty'](_0x5184ba)){throw new Error(_0xb00b('0x10'));}var _0x4fb2ab=_0x4c32d7[_0xb00b('0xe')];var _0x1f8e88=_0x4c32d7['data2'];var _0x4e6d55=_0x4fb2ab[_0xb00b('0x11')]('-')[0x4];var _0x467a5b=_0x4fb2ab[_0xb00b('0x11')]('-')[0x0];var _0x254d8d=encryptor[_0xb00b('0x12')](_0x5184ba,util[_0xb00b('0x13')](_0xb00b('0x14'),_0x4e6d55,_0x4fb2ab,_0x467a5b));var _0x268ddf=JSON[_0xb00b('0x15')](_0x254d8d);_0x268ddf[_0xb00b('0x16')]=![];_0x268ddf[_0xb00b('0x17')]=_0x4fb2ab;_0x268ddf[_0xb00b('0x18')]=hardware['getUuid']();if(_0x1f8e88){var _0x2673b1=encryptor[_0xb00b('0x12')](_0x1f8e88);_0x268ddf[_0xb00b('0x19')]=_0x2673b1;_0x268ddf['deadline']=moment(_0x2673b1)['add'](0x7,_0xb00b('0x1a'))[_0xb00b('0x13')]();_0x268ddf[_0xb00b('0x1b')]=_0x268ddf[_0xb00b('0x17')]!=_0x268ddf[_0xb00b('0x18')]?_0xb00b('0x1c'):'disabled';}return _0x268ddf;}catch(_0x2f22d6){breakingLicense[_0xb00b('0x17')]=_0x4c32d7[_0xb00b('0xe')];breakingLicense[_0xb00b('0x1d')]=_0x2f22d6[_0xb00b('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x25ae32,_0xd1afea){getLicense()[_0xb00b('0xc')](function(_0x5f35a7){return db['User']['findAll']({'attributes':[_0xb00b('0x1e'),[db[_0xb00b('0x1f')]['fn']('COUNT',db[_0xb00b('0x1f')][_0xb00b('0x20')]('role')),_0xb00b('0x21')]],'group':_0xb00b('0x1e'),'where':{'role':{'$or':[_0xb00b('0x22'),'user',_0xb00b('0x23')]}},'raw':!![]})['then'](function(_0x2a61df){var _0xbfe5ae={'user':_0x5f35a7[_0xb00b('0x24')]||0x0,'telephone':_0x5f35a7[_0xb00b('0x25')]||0x0};_0x2a61df['forEach'](function(_0xe6d6fd){var _0x4d5824=_0xe6d6fd[_0xb00b('0x1e')]===_0xb00b('0x22')?'user':_0xe6d6fd[_0xb00b('0x1e')];_0xbfe5ae[_0x4d5824]-=_0xe6d6fd[_0xb00b('0x21')];if(_0xbfe5ae[_0x4d5824]<0x0)_0xbfe5ae[_0x4d5824]=0x0;});_0x25ae32(_0xbfe5ae);return;});})[_0xb00b('0xd')](function(_0x18ec34){_0xd1afea(_0x18ec34);});});}function checkUserLimits(_0x5c78d5){return new BPromise(function(_0x1f2395,_0x3d31b4){getLimits()[_0xb00b('0xc')](function(_0x56e079){var _0x127e78=_['pick'](_[_0xb00b('0x26')](_0x5c78d5,'role'),['admin',_0xb00b('0x27'),_0xb00b('0x23')]);var _0xc1dde=(_0x127e78[_0xb00b('0x22')]||0x0)+(_0x127e78[_0xb00b('0x27')]||0x0);var _0x57db60=_0x127e78[_0xb00b('0x23')]||0x0;if(_0xc1dde>_0x56e079[_0xb00b('0x27')])return _0x3d31b4(_0xb00b('0x28'));if(_0x57db60>_0x56e079[_0xb00b('0x23')])return _0x3d31b4(_0xb00b('0x29'));return _0x1f2395();})[_0xb00b('0xd')](function(_0x38d285){_0x3d31b4(_0x38d285);});});}module[_0xb00b('0x2a')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 76d63d7..37b3adf 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 _0xef0f=['exports','myappanuglar-secret','app-id','secret'];(function(_0x2d2fea,_0x3d8184){var _0x3d838a=function(_0x248487){while(--_0x248487){_0x2d2fea['push'](_0x2d2fea['shift']());}};_0x3d838a(++_0x3d8184);}(_0xef0f,0x168));var _0xfef0=function(_0x8b6b0c,_0x2e259f){_0x8b6b0c=_0x8b6b0c-0x0;var _0x45b7c3=_0xef0f[_0x8b6b0c];return _0x45b7c3;};'use strict';module[_0xfef0('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0xfef0('0x1'),'GOOGLE_ID':_0xfef0('0x2'),'GOOGLE_SECRET':_0xfef0('0x3'),'DEBUG':''}; \ No newline at end of file +var _0x4213=['http://localhost:9000','myappanuglar-secret','app-id','secret','exports'];(function(_0x1064bc,_0x206f12){var _0x5edc45=function(_0x5087bd){while(--_0x5087bd){_0x1064bc['push'](_0x1064bc['shift']());}};_0x5edc45(++_0x206f12);}(_0x4213,0x77));var _0x3421=function(_0x523f62,_0x1e4e62){_0x523f62=_0x523f62-0x0;var _0x1e4fbf=_0x4213[_0x523f62];return _0x1e4fbf;};'use strict';module[_0x3421('0x0')]={'DOMAIN':_0x3421('0x1'),'SESSION_SECRET':_0x3421('0x2'),'GOOGLE_ID':_0x3421('0x3'),'GOOGLE_SECRET':_0x3421('0x4'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index ac2d72a..72b6bd6 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa18f=['../utils/loggers','exports'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa18f,0x15c));var _0xfa18=function(_0x36bf0f,_0x55a20c){_0x36bf0f=_0x36bf0f-0x0;var _0x48fbab=_0xa18f[_0x36bf0f];return _0x48fbab;};'use strict';var fileLogger=require(_0xfa18('0x0'))['fileLogger'];module[_0xfa18('0x1')]=fileLogger; \ No newline at end of file +var _0xd36d=['../utils/loggers','exports'];(function(_0x4eec00,_0x3c6e76){var _0x1bb9cd=function(_0x3a40ac){while(--_0x3a40ac){_0x4eec00['push'](_0x4eec00['shift']());}};_0x1bb9cd(++_0x3c6e76);}(_0xd36d,0x74));var _0xdd36=function(_0x78fa1b,_0x4b85c1){_0x78fa1b=_0x78fa1b-0x0;var _0x1e4cde=_0xd36d[_0x78fa1b];return _0x1e4cde;};'use strict';var fileLogger=require(_0xdd36('0x0'))['fileLogger'];module[_0xdd36('0x1')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index dcca57b..c91110e 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 _0xc6b0=['../../services/ami/index.js','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/xdr/index.js','exports','join','../../services/express/index.js','ami'];(function(_0x2aa91e,_0x74f2ec){var _0x393bc9=function(_0x547b7a){while(--_0x547b7a){_0x2aa91e['push'](_0x2aa91e['shift']());}};_0x393bc9(++_0x74f2ec);}(_0xc6b0,0x10b));var _0x0c6b=function(_0x5acaa0,_0x280fdc){_0x5acaa0=_0x5acaa0-0x0;var _0x11aac6=_0xc6b0[_0x5acaa0];return _0x11aac6;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':'express','script':path[_0x0c6b('0x0')](__dirname,_0x0c6b('0x1'))},{'name':_0x0c6b('0x2'),'script':path[_0x0c6b('0x0')](__dirname,_0x0c6b('0x3'))},{'name':'agi','script':path[_0x0c6b('0x0')](__dirname,_0x0c6b('0x4'))},{'name':_0x0c6b('0x5'),'script':path[_0x0c6b('0x0')](__dirname,_0x0c6b('0x6'))},{'name':_0x0c6b('0x7'),'script':path[_0x0c6b('0x0')](__dirname,'../../services/routing/index.js')},{'name':'xdr','script':path[_0x0c6b('0x0')](__dirname,_0x0c6b('0x8'))}]};module[_0x0c6b('0x9')]=config; \ No newline at end of file +var _0x403c=['../../services/ami/index.js','agi','email','../../services/email/index.js','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','express','join','../../services/express/index.js','ami'];(function(_0x3d609d,_0x2fc891){var _0x2949ca=function(_0x2b5d78){while(--_0x2b5d78){_0x3d609d['push'](_0x3d609d['shift']());}};_0x2949ca(++_0x2fc891);}(_0x403c,0xb0));var _0xc403=function(_0xfc47b,_0x5b510a){_0xfc47b=_0xfc47b-0x0;var _0x4f7871=_0x403c[_0xfc47b];return _0x4f7871;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0xc403('0x0'),'script':path[_0xc403('0x1')](__dirname,_0xc403('0x2'))},{'name':_0xc403('0x3'),'script':path[_0xc403('0x1')](__dirname,_0xc403('0x4'))},{'name':_0xc403('0x5'),'script':path[_0xc403('0x1')](__dirname,'../../services/agi/index.js')},{'name':_0xc403('0x6'),'script':path['join'](__dirname,_0xc403('0x7'))},{'name':'routing','script':path[_0xc403('0x1')](__dirname,_0xc403('0x8'))},{'name':_0xc403('0x9'),'script':path[_0xc403('0x1')](__dirname,_0xc403('0xa'))}]};module[_0xc403('0xb')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 83ebb11..8313af4 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 _0xed70=['disconnect','describe','delete','dump','saved','pm2','bluebird','./config','connect','connected','start','then','stop','restart','list'];(function(_0x20fae0,_0x241159){var _0x17e157=function(_0x3d83cb){while(--_0x3d83cb){_0x20fae0['push'](_0x20fae0['shift']());}};_0x17e157(++_0x241159);}(_0xed70,0x1d6));var _0x0ed7=function(_0x480ca6,_0x56e122){_0x480ca6=_0x480ca6-0x0;var _0x4d192f=_0xed70[_0x480ca6];return _0x4d192f;};'use strict';var pm2=require(_0x0ed7('0x0'));var BPromise=require(_0x0ed7('0x1'));var config=require(_0x0ed7('0x2'));function connect(){return new BPromise(function(_0x35c4da,_0x12a5c7){return pm2[_0x0ed7('0x3')](function(_0xd737a0){if(_0xd737a0){return _0x12a5c7(_0xd737a0);}return _0x35c4da(_0x0ed7('0x4'));});});};exports[_0x0ed7('0x5')]=function(_0xcef2da){return connect()[_0x0ed7('0x6')](function(){return new BPromise(function(_0x41317a,_0x4bfb7e){return pm2['start'](_0xcef2da,function(_0x28faf7,_0x16434d){if(_0x28faf7){return _0x4bfb7e(_0x28faf7);}pm2['disconnect']();return _0x41317a(_0x16434d);});});});};exports[_0x0ed7('0x7')]=function(_0x22bcae){return connect()[_0x0ed7('0x6')](function(){return new BPromise(function(_0x14919e,_0x4f303c){return pm2[_0x0ed7('0x7')](_0x22bcae,function(_0x1be044,_0x17e809){if(_0x1be044){return _0x4f303c(_0x1be044);}pm2['disconnect']();return _0x14919e(_0x17e809);});});});};exports[_0x0ed7('0x8')]=function(_0x140a34){return connect()[_0x0ed7('0x6')](function(){return new BPromise(function(_0x1259c0,_0x5b69fe){return pm2[_0x0ed7('0x8')](_0x140a34,function(_0xcfd819,_0x4d32b6){if(_0xcfd819){return _0x5b69fe(_0xcfd819);}pm2['disconnect']();return _0x1259c0(_0x4d32b6);});});});};exports[_0x0ed7('0x9')]=function(){return connect()[_0x0ed7('0x6')](function(){return new BPromise(function(_0x558b57,_0x2e2452){return pm2[_0x0ed7('0x9')](function(_0x1aa85a,_0x511a73){if(_0x1aa85a){return _0x2e2452(_0x1aa85a);}pm2[_0x0ed7('0xa')]();return _0x558b57(_0x511a73);});});});};exports[_0x0ed7('0xb')]=function(_0x4d1bb7){return connect()['then'](function(){return new BPromise(function(_0x384d63,_0x1ed82a){return pm2[_0x0ed7('0xb')](_0x4d1bb7,function(_0x8ae8e1,_0x47bf81){if(_0x8ae8e1){return _0x1ed82a(_0x8ae8e1);}pm2[_0x0ed7('0xa')]();return _0x384d63(_0x47bf81);});});});};exports[_0x0ed7('0xc')]=function(_0x772a3c){return connect()[_0x0ed7('0x6')](function(){return new BPromise(function(_0xad5a36,_0x2ddf26){return pm2[_0x0ed7('0xc')](_0x772a3c,function(_0x2a0bff,_0x3bbded){if(_0x2a0bff){return _0x2ddf26(_0x2a0bff);}pm2[_0x0ed7('0xa')]();return _0xad5a36(_0x3bbded);});});});};exports[_0x0ed7('0xd')]=function(){return connect()['then'](function(){return new BPromise(function(_0x372396,_0x420a7c){return pm2[_0x0ed7('0xd')](function(_0x5c8c41){if(_0x5c8c41){return _0x420a7c(_0x5c8c41);}return _0x372396(_0x0ed7('0xe'));});});});}; \ No newline at end of file +var _0x2667=['then','restart','disconnect','list','describe','delete','dump','saved','pm2','bluebird','./config','connect','connected','start'];(function(_0x5589db,_0x457992){var _0x22d4e3=function(_0x9b2a36){while(--_0x9b2a36){_0x5589db['push'](_0x5589db['shift']());}};_0x22d4e3(++_0x457992);}(_0x2667,0x12e));var _0x7266=function(_0x9cc420,_0x1eeda9){_0x9cc420=_0x9cc420-0x0;var _0x2fd049=_0x2667[_0x9cc420];return _0x2fd049;};'use strict';var pm2=require(_0x7266('0x0'));var BPromise=require(_0x7266('0x1'));var config=require(_0x7266('0x2'));function connect(){return new BPromise(function(_0x5b6923,_0x42ef26){return pm2[_0x7266('0x3')](function(_0x2d8d7d){if(_0x2d8d7d){return _0x42ef26(_0x2d8d7d);}return _0x5b6923(_0x7266('0x4'));});});};exports[_0x7266('0x5')]=function(_0x154820){return connect()[_0x7266('0x6')](function(){return new BPromise(function(_0x520fa4,_0x94c7e8){return pm2[_0x7266('0x5')](_0x154820,function(_0x410148,_0x33b68b){if(_0x410148){return _0x94c7e8(_0x410148);}pm2['disconnect']();return _0x520fa4(_0x33b68b);});});});};exports['stop']=function(_0x58d44a){return connect()['then'](function(){return new BPromise(function(_0x37b284,_0x35ca0c){return pm2['stop'](_0x58d44a,function(_0x1f73c6,_0x1c4f0e){if(_0x1f73c6){return _0x35ca0c(_0x1f73c6);}pm2['disconnect']();return _0x37b284(_0x1c4f0e);});});});};exports[_0x7266('0x7')]=function(_0x535d05){return connect()[_0x7266('0x6')](function(){return new BPromise(function(_0x258aa9,_0xcca3b1){return pm2[_0x7266('0x7')](_0x535d05,function(_0x3ed7b9,_0x2f9382){if(_0x3ed7b9){return _0xcca3b1(_0x3ed7b9);}pm2[_0x7266('0x8')]();return _0x258aa9(_0x2f9382);});});});};exports[_0x7266('0x9')]=function(){return connect()[_0x7266('0x6')](function(){return new BPromise(function(_0x94c822,_0x46a90d){return pm2[_0x7266('0x9')](function(_0x1dde83,_0x2ac7a5){if(_0x1dde83){return _0x46a90d(_0x1dde83);}pm2['disconnect']();return _0x94c822(_0x2ac7a5);});});});};exports[_0x7266('0xa')]=function(_0x417973){return connect()[_0x7266('0x6')](function(){return new BPromise(function(_0x2f15a8,_0x2966d1){return pm2['describe'](_0x417973,function(_0x3c0d44,_0xdc9c14){if(_0x3c0d44){return _0x2966d1(_0x3c0d44);}pm2['disconnect']();return _0x2f15a8(_0xdc9c14);});});});};exports[_0x7266('0xb')]=function(_0x104427){return connect()[_0x7266('0x6')](function(){return new BPromise(function(_0x6648bb,_0x3a2c91){return pm2[_0x7266('0xb')](_0x104427,function(_0x54a550,_0x2f73a0){if(_0x54a550){return _0x3a2c91(_0x54a550);}pm2[_0x7266('0x8')]();return _0x6648bb(_0x2f73a0);});});});};exports['dump']=function(){return connect()[_0x7266('0x6')](function(){return new BPromise(function(_0x1eb543,_0x4b5489){return pm2[_0x7266('0xc')](function(_0x50c446){if(_0x50c446){return _0x4b5489(_0x50c446);}return _0x1eb543(_0x7266('0xd'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 04526cb..fb9ad38 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 _0x9815=['subtract','chatTimeout','minutes','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','[CHAT]\x20Error\x20closing\x20interactions','start','lodash','moment','ioredis','util','../../config/environment','../logger','schedule','redis','defaults','localhost','socket.io-emitter','Setting','find','then','ChatInteraction','findAll','lastMsgAt'];(function(_0x13f0c3,_0x2e1c6e){var _0x11bfd9=function(_0x4b9b54){while(--_0x4b9b54){_0x13f0c3['push'](_0x13f0c3['shift']());}};_0x11bfd9(++_0x2e1c6e);}(_0x9815,0x1ed));var _0x5981=function(_0x17b048,_0x286876){_0x17b048=_0x17b048-0x0;var _0x2b077f=_0x9815[_0x17b048];return _0x2b077f;};'use strict';var _=require(_0x5981('0x0'));var moment=require(_0x5981('0x1'));var Redis=require(_0x5981('0x2'));var util=require(_0x5981('0x3'));var config=require(_0x5981('0x4'));var db=require('../../mysqldb')['db'];var logger=require(_0x5981('0x5'))(_0x5981('0x6'));config[_0x5981('0x7')]=_[_0x5981('0x8')](config[_0x5981('0x7')],{'host':_0x5981('0x9'),'port':0x18eb});var io=require(_0x5981('0xa'))(new Redis(config[_0x5981('0x7')]));function closeInteractions(){var _0xfa9059=0x0;var _0x2b2e8a=[];return db[_0x5981('0xb')][_0x5981('0xc')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x5981('0xd')](function(_0x3f90e0){_0xfa9059=_0x3f90e0['chatTimeout'];if(_0xfa9059){return db[_0x5981('0xe')][_0x5981('0xf')]({'raw':!![],'attributes':['id',_0x5981('0x10')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x5981('0x11')](_0x3f90e0[_0x5981('0x12')],_0x5981('0x13'))}}});}else{return[];}})['then'](function(_0x1d18f9){if(_0x1d18f9&&_0x1d18f9['length']){_0x2b2e8a=_['map'](_0x1d18f9||[],'id');logger[_0x5981('0x14')](_0x5981('0x15'),_0x2b2e8a[_0x5981('0x16')]());return db[_0x5981('0xe')][_0x5981('0x17')]({'closeReason':'system','disposition':_0x5981('0x18'),'closed':!![],'closedAt':moment()[_0x5981('0x19')](_0x5981('0x1a'))},{'where':{'id':_0x2b2e8a}});}})['then'](function(){if(_0x2b2e8a&&_0x2b2e8a[_0x5981('0x1b')]){logger[_0x5981('0x14')](_0x5981('0x1c'),_0x2b2e8a[_0x5981('0x16')]());for(var _0x3de902=0x0;_0x3de902<_0x2b2e8a['length'];_0x3de902++){io[_0x5981('0x1d')](_0x5981('0x1e'),{'id':_0x2b2e8a[_0x3de902],'closed':!![]});}}})[_0x5981('0x1f')](function(_0x4daa1c){logger['error'](_0x5981('0x20'),_0x4daa1c?util['inspect'](_0x4daa1c,{'showHidden':![],'depth':null}):'');});}exports[_0x5981('0x21')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x4910=['catch','[CHAT]\x20Error\x20closing\x20interactions','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','socket.io-emitter','Setting','find','chatTimeout','findAll','lastMsgAt','minutes','then','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','length','emit'];(function(_0x4c1c6e,_0x381dd5){var _0x342234=function(_0x427031){while(--_0x427031){_0x4c1c6e['push'](_0x4c1c6e['shift']());}};_0x342234(++_0x381dd5);}(_0x4910,0x73));var _0x0491=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x4910[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x0491('0x0'));var moment=require(_0x0491('0x1'));var Redis=require(_0x0491('0x2'));var util=require(_0x0491('0x3'));var config=require(_0x0491('0x4'));var db=require(_0x0491('0x5'))['db'];var logger=require(_0x0491('0x6'))(_0x0491('0x7'));config[_0x0491('0x8')]=_[_0x0491('0x9')](config[_0x0491('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x0491('0xa'))(new Redis(config[_0x0491('0x8')]));function closeInteractions(){var _0x50bd09=0x0;var _0x2ce99b=[];return db[_0x0491('0xb')][_0x0491('0xc')]({'raw':!![],'attributes':['id',_0x0491('0xd')],'where':{'id':0x1}})['then'](function(_0x9d31de){_0x50bd09=_0x9d31de[_0x0491('0xd')];if(_0x50bd09){return db['ChatInteraction'][_0x0491('0xe')]({'raw':!![],'attributes':['id',_0x0491('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x9d31de[_0x0491('0xd')],_0x0491('0x10'))}}});}else{return[];}})[_0x0491('0x11')](function(_0x46acce){if(_0x46acce&&_0x46acce['length']){_0x2ce99b=_['map'](_0x46acce||[],'id');logger[_0x0491('0x12')](_0x0491('0x13'),_0x2ce99b[_0x0491('0x14')]());return db['ChatInteraction'][_0x0491('0x15')]({'closeReason':_0x0491('0x16'),'disposition':'timeout','closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x2ce99b}});}})[_0x0491('0x11')](function(){if(_0x2ce99b&&_0x2ce99b[_0x0491('0x17')]){logger['info']('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x2ce99b[_0x0491('0x14')]());for(var _0xd4d17=0x0;_0xd4d17<_0x2ce99b[_0x0491('0x17')];_0xd4d17++){io[_0x0491('0x18')]('chatInteraction:update',{'id':_0x2ce99b[_0xd4d17],'closed':!![]});}}})[_0x0491('0x19')](function(_0xe795db){logger['error'](_0x0491('0x1a'),_0xe795db?util['inspect'](_0xe795db,{'showHidden':![],'depth':null}):'');});}exports[_0x0491('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index 610eb4e..d3f614e 100644 --- a/server/config/schedule/cloud-provider.js +++ b/server/config/schedule/cloud-provider.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1dc1=['startAllRefreshIntervals'];(function(_0xa3d1a6,_0x5040cb){var _0x1682ad=function(_0x2bceca){while(--_0x2bceca){_0xa3d1a6['push'](_0xa3d1a6['shift']());}};_0x1682ad(++_0x5040cb);}(_0x1dc1,0x120));var _0x11dc=function(_0x5361cb,_0x38ce4c){_0x5361cb=_0x5361cb-0x0;var _0x4efe57=_0x1dc1[_0x5361cb];return _0x4efe57;};'use strict';function start(){var _0x34d12b=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x34d12b[_0x11dc('0x0')]();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file +var _0xfe38=['startAllRefreshIntervals','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x3d2c5e,_0x178ef8){var _0xc99fa0=function(_0x4bdffe){while(--_0x4bdffe){_0x3d2c5e['push'](_0x3d2c5e['shift']());}};_0xc99fa0(++_0x178ef8);}(_0xfe38,0x1af));var _0x8fe3=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xfe38[_0x138adb];return _0x1b27f2;};'use strict';function start(){var _0x457d5c=require(_0x8fe3('0x0'));return _0x457d5c[_0x8fe3('0x1')]();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 4bfd7a2..430deba 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 _0x5001=['exists','stop','deleteJob','toRun','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','add','start','add\x20cron','stop\x20cron','endAt','update\x20cron','run','util','lodash','moment','jayson/promise','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','Smtp','bcc','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','subtractUnit','join','../../files/reports','savename','basename','zip','existsSync','status','Sent','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','request','SendMail','then','error','error\x20mail','email\x20sent','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','CustomReportId','exec\x20custom\x20report\x20id:%s','runReport','catch','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','keys','map','toString','difference','length'];(function(_0x577a1f,_0x4088b2){var _0x2a5088=function(_0x3f0cc2){while(--_0x3f0cc2){_0x577a1f['push'](_0x577a1f['shift']());}};_0x2a5088(++_0x4088b2);}(_0x5001,0x15a));var _0x1500=function(_0x5dba4f,_0x5a8011){_0x5dba4f=_0x5dba4f-0x0;var _0x48af00=_0x5001[_0x5dba4f];return _0x48af00;};'use strict';var fs=require('fs');var util=require(_0x1500('0x0'));var path=require('path');var _=require(_0x1500('0x1'));var moment=require(_0x1500('0x2'));var CronJobManager=require('cron-job-manager');var jayson=require(_0x1500('0x3'));var BPromise=require('bluebird');var logger=require(_0x1500('0x4'))(_0x1500('0x5'));var db=require(_0x1500('0x6'))['db'];var analyticCustomReportController=require(_0x1500('0x7'));var analyticDefaultReportController=require(_0x1500('0x8'));var client=jayson[_0x1500('0x9')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x472b77,_0x31507c){return function(){logger[_0x1500('0xa')](_0x1500('0xb'),_0x472b77[_0x1500('0xc')]);var _0x33a3c1=!![];var _0x5e113d=_0x472b77[_0x1500('0xd')][_0x1500('0xe')]();var _0x5807b3={'account':_0x5e113d,'message':{'from':util[_0x1500('0xf')](_0x1500('0x10'),_0x472b77['MailAccount']['name'],_0x472b77['MailAccount'][_0x1500('0xc')]||_0x472b77['MailAccount'][_0x1500('0x11')]['user']),'to':_0x472b77[_0x1500('0xc')],'cc':_0x472b77['cc'],'bcc':_0x472b77[_0x1500('0x12')],'subject':util['format'](_0x1500('0x13'),_0x31507c[_0x1500('0x14')],_0x472b77[_0x1500('0x15')],_0x472b77[_0x1500('0x16')])}};var _0x39af2a=path[_0x1500('0x17')](__dirname,_0x1500('0x18'));var _0x3c4b82=_0x31507c[_0x1500('0x19')];var _0x39d92d=util[_0x1500('0xf')]('%s.%s',path[_0x1500('0x1a')](_0x31507c[_0x1500('0x19')],path['extname'](_0x31507c[_0x1500('0x19')])),_0x1500('0x1b'));var _0x2fb32d=path[_0x1500('0x17')](_0x39af2a,_0x3c4b82);var _0x57430f=path['join'](_0x39af2a,_0x39d92d);if(fs[_0x1500('0x1c')](_0x2fb32d)){_0x31507c[_0x1500('0x1d')]=_0x1500('0x1e');_0x5807b3[_0x1500('0x1f')]['attachments']=[{'filename':_0x3c4b82,'path':_0x2fb32d}];_0x5807b3['message'][_0x1500('0x20')]=util['format'](_0x1500('0x21'),JSON[_0x1500('0x22')](_0x31507c,null,0x2));}else if(fs['existsSync'](_0x57430f)){_0x31507c['status']=_0x1500('0x1e');_0x5807b3['message']['attachments']=[{'filename':_0x39d92d,'path':_0x57430f}];}else{_0x5807b3[_0x1500('0x1f')][_0x1500('0x20')]=_0x1500('0x23');if(!_0x472b77[_0x1500('0x24')]){_0x33a3c1=![];logger['info']('empty\x20file,\x20email\x20not\x20sent');}}if(_0x33a3c1){return client[_0x1500('0x25')](_0x1500('0x26'),_0x5807b3)[_0x1500('0x27')](function(_0x2cea74){if(_0x2cea74['error']){return logger[_0x1500('0x28')](_0x1500('0x29'),JSON['stringify'](_0x2cea74));}return logger[_0x1500('0xa')](_0x1500('0x2a'));})['catch'](function(_0x125a88){return logger[_0x1500('0x28')]('error\x20mail',JSON['stringify'](_0x125a88));});}};}function handleError(){return function(_0x55058e){return logger[_0x1500('0x28')](JSON[_0x1500('0x22')](_0x55058e));};}function handleResult(_0x36f52a){return function(_0x4abc5a){logger['info']('data',JSON['stringify'](_0x4abc5a));if(_0x36f52a[_0x1500('0xd')]&&_0x36f52a[_0x1500('0xd')]['Smtp']&&!_[_0x1500('0x2b')](_0x36f52a[_0x1500('0xc')])){setTimeout(handleSendEmail(_0x36f52a,_0x4abc5a),0x3c*0x3e8);}};}function handleJob(_0x3b10ec){return function(){try{if(_[_0x1500('0x2b')](_0x3b10ec[_0x1500('0x15')])){return logger[_0x1500('0xa')](_0x1500('0x2c'));}if(_[_0x1500('0x2b')](_0x3b10ec[_0x1500('0x16')])){return logger[_0x1500('0xa')](_0x1500('0x2d'));}var _0x425859={'startDate':moment()[_0x1500('0x2e')](_0x3b10ec[_0x1500('0x15')],_0x3b10ec[_0x1500('0x16')])[_0x1500('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x1500('0xf')](_0x1500('0x2f')),'type':'scheduled','output':_0x3b10ec[_0x1500('0x30')],'name':_0x3b10ec['name']};if(!_[_0x1500('0x2b')](_0x3b10ec[_0x1500('0x31')])){logger['info']('exec\x20defaul\x20report\x20id:%s',_0x3b10ec['DefaultReportId']);return analyticDefaultReportController['runReport']({'id':_0x3b10ec[_0x1500('0x31')]},_0x425859)['then'](handleResult(_0x3b10ec))['catch'](handleError());}if(!_[_0x1500('0x2b')](_0x3b10ec[_0x1500('0x32')])){logger['info'](_0x1500('0x33'),_0x3b10ec[_0x1500('0x32')]);return analyticCustomReportController[_0x1500('0x34')]({'id':_0x3b10ec[_0x1500('0x32')]},_0x425859)[_0x1500('0x27')](handleResult(_0x3b10ec))[_0x1500('0x35')](handleError());}}catch(_0x2ff107){logger['error'](JSON[_0x1500('0x22')](_0x2ff107));}return logger[_0x1500('0xa')](_0x1500('0x36'));};}function getJobs(_0x471486){var _0x16d8e7={};if(_0x471486){_0x16d8e7['id']=_0x471486;}return db[_0x1500('0x37')][_0x1500('0x38')]({'where':_0x16d8e7,'include':[{'model':db[_0x1500('0xd')],'attributes':['id','name',_0x1500('0xc')],'include':[{'model':db[_0x1500('0x39')],'as':_0x1500('0x11'),'include':[{'model':db[_0x1500('0x3a')],'as':_0x1500('0x3a')}]}]}]})[_0x1500('0x27')](function(_0x307245){var _0x191e21=_[_0x1500('0x3b')](manager['jobs']);var _0x42c424=_[_0x1500('0x3c')](_0x307245,function(_0x398fa2){return _0x398fa2['id'][_0x1500('0x3d')]();});var _0x2b9546=_['keyBy'](_0x307245,function(_0x42aad4){return _0x42aad4['id']['toString']();});var _0x48f3ee=_0x471486?_0x42c424:_['difference'](_0x42c424,_0x191e21);var _0x3b9ab2=_['intersection'](_0x42c424,_0x191e21);var _0x4c3179=_[_0x1500('0x3e')](_0x191e21,_0x42c424);var _0x53621d;var _0x7f7448;for(_0x53621d=0x0;_0x53621d<_0x4c3179[_0x1500('0x3f')]&&!_0x471486;_0x53621d+=0x1){_0x7f7448=_0x4c3179[_0x53621d]['toString']();if(manager[_0x1500('0x40')](_0x7f7448)){manager[_0x1500('0x41')](_0x7f7448);manager[_0x1500('0x42')](_0x7f7448);logger[_0x1500('0xa')]('delete\x20cron',_0x7f7448);}}logger[_0x1500('0xa')](_0x1500('0x43'),JSON[_0x1500('0x22')](_0x48f3ee));for(_0x53621d=0x0;_0x53621d<_0x48f3ee[_0x1500('0x3f')];_0x53621d+=0x1){_0x7f7448=_0x48f3ee[_0x53621d]['toString']();logger[_0x1500('0xa')]('index',_0x7f7448);if(_0x471486){logger[_0x1500('0xa')](_0x1500('0x44'),_0x471486);logger[_0x1500('0xa')](JSON['stringify'](_0x2b9546[_0x7f7448]));BPromise[_0x1500('0x45')]()[_0x1500('0x27')](handleJob(_0x2b9546[_0x7f7448]));logger[_0x1500('0xa')](_0x1500('0x46'),_0x2b9546[_0x7f7448][_0x1500('0x14')],_0x2b9546[_0x7f7448][_0x1500('0x47')]);}else if(_0x2b9546[_0x7f7448][_0x1500('0x47')]&&_0x2b9546[_0x7f7448][_0x1500('0x48')]&&moment()[_0x1500('0x49')](_0x2b9546[_0x7f7448][_0x1500('0x4a')],_0x2b9546[_0x7f7448]['endAt'])){manager[_0x1500('0x4b')](_0x7f7448,_0x2b9546[_0x7f7448][_0x1500('0x47')],handleJob(_0x2b9546[_0x7f7448]));manager[_0x1500('0x4c')](_0x7f7448);logger[_0x1500('0xa')](_0x1500('0x4d'),_0x2b9546[_0x7f7448]['name'],_0x2b9546[_0x7f7448][_0x1500('0x47')]);}else if(manager[_0x1500('0x40')](_0x7f7448)){manager[_0x1500('0x41')](_0x7f7448);manager['deleteJob'](_0x7f7448);logger[_0x1500('0xa')](_0x1500('0x4e'),_0x2b9546[_0x7f7448][_0x1500('0x14')],_0x2b9546[_0x7f7448][_0x1500('0x47')]);}}for(_0x53621d=0x0,_0x7f7448;_0x53621d<_0x3b9ab2[_0x1500('0x3f')]&&!_0x471486;_0x53621d+=0x1){_0x7f7448=_0x3b9ab2[_0x53621d][_0x1500('0x3d')]();if(manager[_0x1500('0x40')](_0x7f7448)){if(_0x2b9546[_0x7f7448]['cron']&&_0x2b9546[_0x7f7448][_0x1500('0x48')]&&moment()['isBetween'](_0x2b9546[_0x7f7448]['startAt'],_0x2b9546[_0x7f7448][_0x1500('0x4f')])){manager['update'](_0x7f7448,_0x2b9546[_0x7f7448][_0x1500('0x47')],handleJob(_0x2b9546[_0x7f7448]));logger[_0x1500('0xa')](_0x1500('0x50'),_0x2b9546[_0x7f7448][_0x1500('0x14')],_0x2b9546[_0x7f7448][_0x1500('0x47')]);}else{manager['stop'](_0x7f7448);manager[_0x1500('0x42')](_0x7f7448);logger[_0x1500('0xa')](_0x1500('0x4e'),_0x2b9546[_0x7f7448][_0x1500('0x14')],_0x2b9546[_0x7f7448][_0x1500('0x47')]);}}}})['catch'](function(_0x33a616){logger[_0x1500('0x28')](JSON[_0x1500('0x22')](_0x33a616));});}exports[_0x1500('0x51')]=function(_0x33d064){return getJobs(_0x33d064);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x8ea3=['user','bcc','format','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','zip','existsSync','status','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','stringify','Sent','attachments','sendIfEmpty','SendMail','then','error','error\x20mail','email\x20sent','catch','data','Smtp','isNil','subtract','YYYY-MM-DD\x20HH:mm:ss','DefaultReportId','CustomReportId','exec\x20custom\x20report\x20id:%s','runReport','no\x20report\x20id','Schedule','findAll','CloudProvider','jobs','map','keyBy','toString','difference','intersection','exists','deleteJob','delete\x20cron','toRun','length','index','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','start','stop','stop\x20cron','update','update\x20cron','path','lodash','../logger','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','email','MailAccount','getSmtpOptions','\x22%s\x22\x20<%s>','name'];(function(_0x50ac63,_0x53ccff){var _0x33babf=function(_0x5b2cd9){while(--_0x5b2cd9){_0x50ac63['push'](_0x50ac63['shift']());}};_0x33babf(++_0x53ccff);}(_0x8ea3,0x12a));var _0x38ea=function(_0xb98100,_0x32632d){_0xb98100=_0xb98100-0x0;var _0x16ee1d=_0x8ea3[_0xb98100];return _0x16ee1d;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x38ea('0x0'));var _=require(_0x38ea('0x1'));var moment=require('moment');var CronJobManager=require('cron-job-manager');var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x38ea('0x2'))(_0x38ea('0x3'));var db=require(_0x38ea('0x4'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x38ea('0x5'));var client=jayson[_0x38ea('0x6')][_0x38ea('0x7')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x4bf9d1,_0x17efe0){return function(){logger[_0x38ea('0x8')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x4bf9d1[_0x38ea('0x9')]);var _0x35c681=!![];var _0x3b424a=_0x4bf9d1[_0x38ea('0xa')][_0x38ea('0xb')]();var _0x27410f={'account':_0x3b424a,'message':{'from':util['format'](_0x38ea('0xc'),_0x4bf9d1[_0x38ea('0xa')][_0x38ea('0xd')],_0x4bf9d1[_0x38ea('0xa')]['email']||_0x4bf9d1['MailAccount']['Smtp'][_0x38ea('0xe')]),'to':_0x4bf9d1['email'],'cc':_0x4bf9d1['cc'],'bcc':_0x4bf9d1[_0x38ea('0xf')],'subject':util[_0x38ea('0x10')](_0x38ea('0x11'),_0x17efe0[_0x38ea('0xd')],_0x4bf9d1[_0x38ea('0x12')],_0x4bf9d1[_0x38ea('0x13')])}};var _0x2fc35b=path[_0x38ea('0x14')](__dirname,_0x38ea('0x15'));var _0x15a36f=_0x17efe0[_0x38ea('0x16')];var _0x1761fe=util['format'](_0x38ea('0x17'),path['basename'](_0x17efe0[_0x38ea('0x16')],path['extname'](_0x17efe0[_0x38ea('0x16')])),_0x38ea('0x18'));var _0xd7ae1d=path[_0x38ea('0x14')](_0x2fc35b,_0x15a36f);var _0x1c2881=path[_0x38ea('0x14')](_0x2fc35b,_0x1761fe);if(fs[_0x38ea('0x19')](_0xd7ae1d)){_0x17efe0[_0x38ea('0x1a')]='Sent';_0x27410f[_0x38ea('0x1b')]['attachments']=[{'filename':_0x15a36f,'path':_0xd7ae1d}];_0x27410f['message'][_0x38ea('0x1c')]=util[_0x38ea('0x10')](_0x38ea('0x1d'),JSON[_0x38ea('0x1e')](_0x17efe0,null,0x2));}else if(fs[_0x38ea('0x19')](_0x1c2881)){_0x17efe0['status']=_0x38ea('0x1f');_0x27410f['message'][_0x38ea('0x20')]=[{'filename':_0x1761fe,'path':_0x1c2881}];}else{_0x27410f['message'][_0x38ea('0x1c')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x4bf9d1[_0x38ea('0x21')]){_0x35c681=![];logger[_0x38ea('0x8')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x35c681){return client['request'](_0x38ea('0x22'),_0x27410f)[_0x38ea('0x23')](function(_0x57dbb1){if(_0x57dbb1[_0x38ea('0x24')]){return logger[_0x38ea('0x24')](_0x38ea('0x25'),JSON['stringify'](_0x57dbb1));}return logger[_0x38ea('0x8')](_0x38ea('0x26'));})[_0x38ea('0x27')](function(_0x19b517){return logger[_0x38ea('0x24')]('error\x20mail',JSON[_0x38ea('0x1e')](_0x19b517));});}};}function handleError(){return function(_0x5e9bf5){return logger[_0x38ea('0x24')](JSON[_0x38ea('0x1e')](_0x5e9bf5));};}function handleResult(_0x3c93e6){return function(_0x55e4fc){logger[_0x38ea('0x8')](_0x38ea('0x28'),JSON[_0x38ea('0x1e')](_0x55e4fc));if(_0x3c93e6[_0x38ea('0xa')]&&_0x3c93e6[_0x38ea('0xa')][_0x38ea('0x29')]&&!_[_0x38ea('0x2a')](_0x3c93e6[_0x38ea('0x9')])){setTimeout(handleSendEmail(_0x3c93e6,_0x55e4fc),0x3c*0x3e8);}};}function handleJob(_0x156503){return function(){try{if(_[_0x38ea('0x2a')](_0x156503[_0x38ea('0x12')])){return logger['info']('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x38ea('0x2a')](_0x156503['subtractUnit'])){return logger[_0x38ea('0x8')]('subtractUnit\x20null\x20or\x20undefined');}var _0x15788f={'startDate':moment()[_0x38ea('0x2b')](_0x156503['subtractNumber'],_0x156503[_0x38ea('0x13')])[_0x38ea('0x10')](_0x38ea('0x2c')),'endDate':moment()[_0x38ea('0x10')](_0x38ea('0x2c')),'type':'scheduled','output':_0x156503['output'],'name':_0x156503[_0x38ea('0xd')]};if(!_['isNil'](_0x156503[_0x38ea('0x2d')])){logger['info']('exec\x20defaul\x20report\x20id:%s',_0x156503[_0x38ea('0x2d')]);return analyticDefaultReportController['runReport']({'id':_0x156503[_0x38ea('0x2d')]},_0x15788f)[_0x38ea('0x23')](handleResult(_0x156503))[_0x38ea('0x27')](handleError());}if(!_['isNil'](_0x156503[_0x38ea('0x2e')])){logger[_0x38ea('0x8')](_0x38ea('0x2f'),_0x156503[_0x38ea('0x2e')]);return analyticCustomReportController[_0x38ea('0x30')]({'id':_0x156503[_0x38ea('0x2e')]},_0x15788f)[_0x38ea('0x23')](handleResult(_0x156503))[_0x38ea('0x27')](handleError());}}catch(_0x42cffa){logger['error'](JSON['stringify'](_0x42cffa));}return logger[_0x38ea('0x8')](_0x38ea('0x31'));};}function getJobs(_0x5c3576){var _0x286288={};if(_0x5c3576){_0x286288['id']=_0x5c3576;}return db[_0x38ea('0x32')][_0x38ea('0x33')]({'where':_0x286288,'include':[{'model':db[_0x38ea('0xa')],'attributes':['id',_0x38ea('0xd'),_0x38ea('0x9')],'include':[{'model':db['MailServerOut'],'as':_0x38ea('0x29'),'include':[{'model':db[_0x38ea('0x34')],'as':_0x38ea('0x34')}]}]}]})['then'](function(_0x433fee){var _0x51db0f=_['keys'](manager[_0x38ea('0x35')]);var _0x53dbef=_[_0x38ea('0x36')](_0x433fee,function(_0x59fd87){return _0x59fd87['id']['toString']();});var _0x469e45=_[_0x38ea('0x37')](_0x433fee,function(_0x3fdd4b){return _0x3fdd4b['id'][_0x38ea('0x38')]();});var _0x521ef1=_0x5c3576?_0x53dbef:_[_0x38ea('0x39')](_0x53dbef,_0x51db0f);var _0x4546d5=_[_0x38ea('0x3a')](_0x53dbef,_0x51db0f);var _0x2e6b80=_[_0x38ea('0x39')](_0x51db0f,_0x53dbef);var _0x509321;var _0x547a8d;for(_0x509321=0x0;_0x509321<_0x2e6b80['length']&&!_0x5c3576;_0x509321+=0x1){_0x547a8d=_0x2e6b80[_0x509321]['toString']();if(manager[_0x38ea('0x3b')](_0x547a8d)){manager['stop'](_0x547a8d);manager[_0x38ea('0x3c')](_0x547a8d);logger['info'](_0x38ea('0x3d'),_0x547a8d);}}logger[_0x38ea('0x8')](_0x38ea('0x3e'),JSON['stringify'](_0x521ef1));for(_0x509321=0x0;_0x509321<_0x521ef1[_0x38ea('0x3f')];_0x509321+=0x1){_0x547a8d=_0x521ef1[_0x509321]['toString']();logger[_0x38ea('0x8')](_0x38ea('0x40'),_0x547a8d);if(_0x5c3576){logger['info']('my\x20id',_0x5c3576);logger[_0x38ea('0x8')](JSON['stringify'](_0x469e45[_0x547a8d]));BPromise[_0x38ea('0x41')]()[_0x38ea('0x23')](handleJob(_0x469e45[_0x547a8d]));logger['info'](_0x38ea('0x42'),_0x469e45[_0x547a8d][_0x38ea('0xd')],_0x469e45[_0x547a8d][_0x38ea('0x43')]);}else if(_0x469e45[_0x547a8d][_0x38ea('0x43')]&&_0x469e45[_0x547a8d][_0x38ea('0x44')]&&moment()[_0x38ea('0x45')](_0x469e45[_0x547a8d][_0x38ea('0x46')],_0x469e45[_0x547a8d][_0x38ea('0x47')])){manager[_0x38ea('0x48')](_0x547a8d,_0x469e45[_0x547a8d]['cron'],handleJob(_0x469e45[_0x547a8d]));manager[_0x38ea('0x49')](_0x547a8d);logger[_0x38ea('0x8')]('add\x20cron',_0x469e45[_0x547a8d][_0x38ea('0xd')],_0x469e45[_0x547a8d]['cron']);}else if(manager[_0x38ea('0x3b')](_0x547a8d)){manager[_0x38ea('0x4a')](_0x547a8d);manager[_0x38ea('0x3c')](_0x547a8d);logger[_0x38ea('0x8')](_0x38ea('0x4b'),_0x469e45[_0x547a8d][_0x38ea('0xd')],_0x469e45[_0x547a8d][_0x38ea('0x43')]);}}for(_0x509321=0x0,_0x547a8d;_0x509321<_0x4546d5[_0x38ea('0x3f')]&&!_0x5c3576;_0x509321+=0x1){_0x547a8d=_0x4546d5[_0x509321][_0x38ea('0x38')]();if(manager[_0x38ea('0x3b')](_0x547a8d)){if(_0x469e45[_0x547a8d]['cron']&&_0x469e45[_0x547a8d]['active']&&moment()[_0x38ea('0x45')](_0x469e45[_0x547a8d][_0x38ea('0x46')],_0x469e45[_0x547a8d][_0x38ea('0x47')])){manager[_0x38ea('0x4c')](_0x547a8d,_0x469e45[_0x547a8d]['cron'],handleJob(_0x469e45[_0x547a8d]));logger[_0x38ea('0x8')](_0x38ea('0x4d'),_0x469e45[_0x547a8d][_0x38ea('0xd')],_0x469e45[_0x547a8d][_0x38ea('0x43')]);}else{manager[_0x38ea('0x4a')](_0x547a8d);manager['deleteJob'](_0x547a8d);logger[_0x38ea('0x8')](_0x38ea('0x4b'),_0x469e45[_0x547a8d]['name'],_0x469e45[_0x547a8d]['cron']);}}}})[_0x38ea('0x27')](function(_0xa0296a){logger[_0x38ea('0x24')](JSON[_0x38ea('0x1e')](_0xa0296a));});}exports['run']=function(_0xff3deb){return getJobs(_0xff3deb);};exports[_0x38ea('0x49')]=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 d0ab3cf..9c39a99 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 _0xac4a=['Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','sentiment','Transcript\x20not\x20available','name','SequelizeValidationError','error','inspect','findAll','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribe','Transcribe\x20not\x20configured','transcribeAccountId','forEach','push','all','catch','start','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','getTranscriptionJob','Comprehend','detectSentiment','substring','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','TranscriptionJob','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','language','bucket','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available'];(function(_0x6ab824,_0x4a7788){var _0x1c932c=function(_0x1e4f3b){while(--_0x1e4f3b){_0x6ab824['push'](_0x6ab824['shift']());}};_0x1c932c(++_0x4a7788);}(_0xac4a,0x13f));var _0xaac4=function(_0xdbe0dd,_0xcfbb5){_0xdbe0dd=_0xdbe0dd-0x0;var _0x5c312c=_0xac4a[_0xdbe0dd];return _0x5c312c;};var _=require(_0xaac4('0x0'));var AWS=require(_0xaac4('0x1'));var rp=require(_0xaac4('0x2'));var util=require(_0xaac4('0x3'));var BPromise=require(_0xaac4('0x4'));var db=require(_0xaac4('0x5'))['db'];var logger=require('../../config/logger')('transcribe');function getTranscriptionJob(_0x2af0f6,_0x2a5762,_0x32d34c,_0x58ae95){return new Promise(function(_0x1283a5,_0x53d03a){var _0x1cdfc5=new AWS['TranscribeService']({'accessKeyId':_0x2a5762,'secretAccessKey':_0x2af0f6,'region':_0x32d34c});_0x1cdfc5[_0xaac4('0x6')]({'TranscriptionJobName':_0x58ae95},function(_0x27354c,_0x567295){if(_0x27354c){return _0x53d03a(_0x27354c);}else{return _0x1283a5(_0x567295);}});});}function sentiment(_0x5cfc1b,_0x349671,_0x50d114,_0x452573,_0x59b992){return new Promise(function(_0x4f4c84,_0xeb6b9a){var _0x22cea4=new AWS[(_0xaac4('0x7'))]({'accessKeyId':_0x349671,'secretAccessKey':_0x5cfc1b,'region':_0x50d114});_0x22cea4[_0xaac4('0x8')]({'Text':_0x452573,'LanguageCode':_0x59b992[_0xaac4('0x9')](0x0,0x2)},function(_0x4e0f72,_0x508e14){if(_0x4e0f72){return _0xeb6b9a(_0x4e0f72);}else{return _0x4f4c84(_0x508e14);}});});}function checkTranscribeJob(_0x2348c2,_0x2e2d02,_0x45e512){var _0x5a4801;return new BPromise(function(_0x6a808d,_0x45c129){logger['info'](util[_0xaac4('0xa')](_0xaac4('0xb'),_0x2348c2['id'],_0x2348c2[_0xaac4('0xc')]));return getTranscriptionJob(_0x45e512[_0xaac4('0xd')],_0x45e512[_0xaac4('0xe')],_0x2e2d02[_0xaac4('0xf')],_0x2348c2[_0xaac4('0xc')])[_0xaac4('0x10')](function(_0x233278){logger[_0xaac4('0x11')](util[_0xaac4('0xa')](_0xaac4('0x12'),_0x2348c2['id'],_0x2348c2[_0xaac4('0xc')],_0x233278['TranscriptionJob'][_0xaac4('0x13')]));if(!_0x2348c2['fileText']){switch(_0x233278[_0xaac4('0x14')]['TranscriptionJobStatus']){case _0xaac4('0x15'):var _0x27fe7b={'transcribeStatus':_0x233278[_0xaac4('0x14')][_0xaac4('0x13')],'fileUri':_0x233278[_0xaac4('0x14')][_0xaac4('0x16')][_0xaac4('0x17')]};logger[_0xaac4('0x11')](util[_0xaac4('0xa')]('[RECORDING:%d]\x20Get\x20transcript',_0x2348c2['id']));return rp({'uri':_0x233278[_0xaac4('0x14')]['Transcript'][_0xaac4('0x17')],'json':!![]})[_0xaac4('0x10')](function(_0x43625c){logger[_0xaac4('0x11')](util[_0xaac4('0xa')](_0xaac4('0x18'),_0x2348c2['id']));if(_0x43625c&&_0x43625c['results']&&_0x43625c[_0xaac4('0x19')][_0xaac4('0x1a')]&&_0x43625c[_0xaac4('0x19')][_0xaac4('0x1a')][_0xaac4('0x1b')]){_0x27fe7b[_0xaac4('0x1c')]='';for(var _0xb2577b=0x0;_0xb2577b<_0x43625c['results'][_0xaac4('0x1a')]['length'];_0xb2577b++){_0x27fe7b['fileText']+=_0x43625c['results']['transcripts'][_0xb2577b][_0xaac4('0x1d')]+'';}}return _0x2348c2[_0xaac4('0x1e')](_0x27fe7b);})[_0xaac4('0x10')](function(){logger[_0xaac4('0x11')](util[_0xaac4('0xa')](_0xaac4('0x1f'),_0x2348c2['id']));if(!_0x2348c2[_0xaac4('0x20')]){throw new db[(_0xaac4('0x21'))][(_0xaac4('0x22'))](_0xaac4('0x23'));}if(!_0x2e2d02['sentiment']||!_0x2e2d02[_0xaac4('0x24')]||!_0x2e2d02[_0xaac4('0x25')]||!_0x2e2d02[_0xaac4('0x26')]||!_0x2e2d02[_0xaac4('0x27')]){throw new db[(_0xaac4('0x21'))][(_0xaac4('0x22'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x27fe7b[_0xaac4('0x1c')]){throw new Error('Transcript\x20not\x20available');}if(_0x2e2d02[_0xaac4('0x24')]===_0x45e512['id']){return _0x45e512;}else{return db[_0xaac4('0x28')][_0xaac4('0x29')]({'where':{'id':_settings[_0xaac4('0x24')]}});}})['then'](function(_0x5000e1){if(!_0x5000e1){throw new db['Sequelize'][(_0xaac4('0x22'))](_0xaac4('0x2a'));}if(!_0x5000e1[_0xaac4('0xd')]||!_0x5000e1[_0xaac4('0xe')]){throw new db[(_0xaac4('0x21'))][(_0xaac4('0x22'))](_0xaac4('0x2b'));}_0x5a4801=_0x5000e1;logger[_0xaac4('0x11')](util[_0xaac4('0xa')](_0xaac4('0x2c'),_0x2348c2['id']));return sentiment(_0x5a4801[_0xaac4('0xd')],_0x5a4801[_0xaac4('0xe')],_0x2e2d02[_0xaac4('0x25')],_0x27fe7b[_0xaac4('0x1c')],_0x2e2d02[_0xaac4('0x26')]);})['then'](function(_0x5bad9f){logger[_0xaac4('0x11')](util[_0xaac4('0xa')](_0xaac4('0x2d'),_0x2348c2['id']));return _0x2348c2['update']({'sentiment':_0x5bad9f[_0xaac4('0x2e')],'sPositive':_0x5bad9f[_0xaac4('0x2f')][_0xaac4('0x30')],'sNegative':_0x5bad9f[_0xaac4('0x2f')][_0xaac4('0x31')],'sMixed':_0x5bad9f[_0xaac4('0x2f')][_0xaac4('0x32')],'sNeutral':_0x5bad9f['SentimentScore'][_0xaac4('0x33')]});})[_0xaac4('0x10')](function(){logger[_0xaac4('0x11')](util['format'](_0xaac4('0x1f'),_0x2348c2['id']));_0x6a808d();});case'FAILED':return _0x2348c2['update']({'transcribeStatus':_0xaac4('0x34'),'failureReason':_0x233278[_0xaac4('0x14')][_0xaac4('0x35')]})['then'](function(){logger['info'](util[_0xaac4('0xa')](_0xaac4('0x1f'),_0x2348c2['id']));_0x6a808d();});default:logger[_0xaac4('0x11')](util[_0xaac4('0xa')](_0xaac4('0x36'),_0x2348c2['id']));break;}}else{return BPromise[_0xaac4('0x37')]()['then'](function(){if(!_0x2348c2['tempSentiment']){throw new db[(_0xaac4('0x21'))][(_0xaac4('0x22'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x2e2d02[_0xaac4('0x38')]||!_0x2e2d02[_0xaac4('0x24')]||!_0x2e2d02[_0xaac4('0x25')]||!_0x2e2d02['language']||!_0x2e2d02[_0xaac4('0x27')]){throw new db[(_0xaac4('0x21'))][(_0xaac4('0x22'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x2348c2[_0xaac4('0x1c')]){throw new Error(_0xaac4('0x39'));}if(_0x2e2d02[_0xaac4('0x24')]===_0x45e512['id']){return _0x45e512;}else{return db[_0xaac4('0x28')]['findOne']({'where':{'id':_settings[_0xaac4('0x24')]}});}})['then'](function(_0x50f410){if(!_0x50f410){throw new db[(_0xaac4('0x21'))][(_0xaac4('0x22'))](_0xaac4('0x2a'));}if(!_0x50f410[_0xaac4('0xd')]||!_0x50f410[_0xaac4('0xe')]){throw new db[(_0xaac4('0x21'))][(_0xaac4('0x22'))](_0xaac4('0x2b'));}_0x5a4801=_0x50f410;logger['info'](util[_0xaac4('0xa')](_0xaac4('0x2c'),_0x2348c2['id']));return sentiment(_0x5a4801[_0xaac4('0xd')],_0x5a4801[_0xaac4('0xe')],_0x2e2d02['sentimentRegion'],_0x2348c2[_0xaac4('0x1c')],_0x2e2d02[_0xaac4('0x26')]);})[_0xaac4('0x10')](function(_0x48faff){logger[_0xaac4('0x11')](util[_0xaac4('0xa')](_0xaac4('0x2d'),_0x2348c2['id']));return _0x2348c2[_0xaac4('0x1e')]({'sentiment':_0x48faff['Sentiment'],'sPositive':_0x48faff[_0xaac4('0x2f')][_0xaac4('0x30')],'sNegative':_0x48faff[_0xaac4('0x2f')]['Negative'],'sMixed':_0x48faff[_0xaac4('0x2f')][_0xaac4('0x32')],'sNeutral':_0x48faff[_0xaac4('0x2f')][_0xaac4('0x33')],'transcribeStatus':_0xaac4('0x15')});})[_0xaac4('0x10')](function(){logger[_0xaac4('0x11')](util[_0xaac4('0xa')](_0xaac4('0x1f'),_0x2348c2['id']));_0x6a808d();});}})['catch'](function(_0x10223a){if(_0x10223a){if(!_0x10223a[_0xaac4('0x3a')]||_0x10223a[_0xaac4('0x3a')]!==_0xaac4('0x3b')){logger[_0xaac4('0x3c')](util['format']('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x2348c2['id']),util[_0xaac4('0x3d')](_0x10223a,{'showHidden':![],'depth':null}));}}_0x6a808d();});});}function checkTranscribe(){var _0x130324;var _0x4a445f;var _0x16c7f4;return db['VoiceRecording'][_0xaac4('0x3e')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0xaac4('0x10')](function(_0x43ca24){if(!_0x43ca24||!_0x43ca24['length']){throw new db[(_0xaac4('0x21'))][(_0xaac4('0x22'))](_0xaac4('0x3f'));}_0x130324=_0x43ca24;return db['Setting']['findOne']({'where':{'id':0x1}});})[_0xaac4('0x10')](function(_0x2c1751){if(!_0x2c1751){throw new db[(_0xaac4('0x21'))][(_0xaac4('0x22'))](_0xaac4('0x40'));}_0x4a445f=_0x2c1751;if(!_0x4a445f[_0xaac4('0x41')]||!_0x4a445f['transcribeAccountId']||!_0x4a445f[_0xaac4('0xf')]||!_0x4a445f[_0xaac4('0x26')]||!_0x4a445f[_0xaac4('0x27')]){throw new db[(_0xaac4('0x21'))]['ValidationError'](_0xaac4('0x42'));}return db['CloudProvider'][_0xaac4('0x29')]({'where':{'id':_0x4a445f[_0xaac4('0x43')]}});})[_0xaac4('0x10')](function(_0x3922a0){if(!_0x3922a0){throw new db[(_0xaac4('0x21'))][(_0xaac4('0x22'))](_0xaac4('0x2a'));}if(!_0x3922a0[_0xaac4('0xd')]||!_0x3922a0[_0xaac4('0xe')]){throw new db[(_0xaac4('0x21'))][(_0xaac4('0x22'))](_0xaac4('0x2b'));}_0x16c7f4=_0x3922a0;var _0x3ce31f=[];_0x130324[_0xaac4('0x44')](function(_0x4ede1e){_0x3ce31f[_0xaac4('0x45')](checkTranscribeJob(_0x4ede1e,_0x4a445f,_0x16c7f4));});return BPromise[_0xaac4('0x46')](_0x3ce31f);})[_0xaac4('0x47')](function(_0x1e6e0e){if(_0x1e6e0e){if(!_0x1e6e0e[_0xaac4('0x3a')]||_0x1e6e0e[_0xaac4('0x3a')]!==_0xaac4('0x3b')){logger[_0xaac4('0x3c')](util['inspect'](_0x1e6e0e,{'showHidden':![],'depth':null}));}}});}exports[_0xaac4('0x48')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x38fd=['transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','findOne','Cloud\x20Provider\x20not\x20configured','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','Cloud\x20Provider\x20not\x20available','data1','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','catch','name','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','CloudProvider','forEach','push','all','SequelizeValidationError','start','lodash','aws-sdk','request-promise','bluebird','../../mysqldb','../../config/logger','transcribe','getTranscriptionJob','Comprehend','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data2','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results'];(function(_0x45943c,_0x292e90){var _0xe1cf98=function(_0x4ba1ae){while(--_0x4ba1ae){_0x45943c['push'](_0x45943c['shift']());}};_0xe1cf98(++_0x292e90);}(_0x38fd,0x117));var _0xd38f=function(_0x461aab,_0x158f6a){_0x461aab=_0x461aab-0x0;var _0x75610b=_0x38fd[_0x461aab];return _0x75610b;};var _=require(_0xd38f('0x0'));var AWS=require(_0xd38f('0x1'));var rp=require(_0xd38f('0x2'));var util=require('util');var BPromise=require(_0xd38f('0x3'));var db=require(_0xd38f('0x4'))['db'];var logger=require(_0xd38f('0x5'))(_0xd38f('0x6'));function getTranscriptionJob(_0x4f7185,_0x523821,_0x46586f,_0x2ff59f){return new Promise(function(_0x52868c,_0x3e0d55){var _0xe1c84a=new AWS['TranscribeService']({'accessKeyId':_0x523821,'secretAccessKey':_0x4f7185,'region':_0x46586f});_0xe1c84a[_0xd38f('0x7')]({'TranscriptionJobName':_0x2ff59f},function(_0x54cc56,_0xdce551){if(_0x54cc56){return _0x3e0d55(_0x54cc56);}else{return _0x52868c(_0xdce551);}});});}function sentiment(_0x23976c,_0x5ba653,_0x466a89,_0x191f06,_0x4bbf6d){return new Promise(function(_0x587607,_0x1415e2){var _0xba64f=new AWS[(_0xd38f('0x8'))]({'accessKeyId':_0x5ba653,'secretAccessKey':_0x23976c,'region':_0x466a89});_0xba64f['detectSentiment']({'Text':_0x191f06,'LanguageCode':_0x4bbf6d[_0xd38f('0x9')](0x0,0x2)},function(_0x13644b,_0x5e4253){if(_0x13644b){return _0x1415e2(_0x13644b);}else{return _0x587607(_0x5e4253);}});});}function checkTranscribeJob(_0x2e450e,_0x1b2381,_0x58c1ea){var _0x7012eb;return new BPromise(function(_0x43a043,_0x528bd5){logger[_0xd38f('0xa')](util[_0xd38f('0xb')](_0xd38f('0xc'),_0x2e450e['id'],_0x2e450e[_0xd38f('0xd')]));return getTranscriptionJob(_0x58c1ea['data1'],_0x58c1ea[_0xd38f('0xe')],_0x1b2381['transcribeRegion'],_0x2e450e[_0xd38f('0xd')])[_0xd38f('0xf')](function(_0x4192be){logger[_0xd38f('0xa')](util['format'](_0xd38f('0x10'),_0x2e450e['id'],_0x2e450e['transcribeName'],_0x4192be[_0xd38f('0x11')][_0xd38f('0x12')]));if(!_0x2e450e[_0xd38f('0x13')]){switch(_0x4192be[_0xd38f('0x11')][_0xd38f('0x12')]){case _0xd38f('0x14'):var _0x35159d={'transcribeStatus':_0x4192be[_0xd38f('0x11')][_0xd38f('0x12')],'fileUri':_0x4192be[_0xd38f('0x11')]['Transcript'][_0xd38f('0x15')]};logger[_0xd38f('0xa')](util['format'](_0xd38f('0x16'),_0x2e450e['id']));return rp({'uri':_0x4192be[_0xd38f('0x11')]['Transcript'][_0xd38f('0x15')],'json':!![]})['then'](function(_0x1ea6a1){logger[_0xd38f('0xa')](util[_0xd38f('0xb')](_0xd38f('0x17'),_0x2e450e['id']));if(_0x1ea6a1&&_0x1ea6a1[_0xd38f('0x18')]&&_0x1ea6a1[_0xd38f('0x18')]['transcripts']&&_0x1ea6a1['results'][_0xd38f('0x19')][_0xd38f('0x1a')]){_0x35159d['fileText']='';for(var _0x1109bd=0x0;_0x1109bd<_0x1ea6a1[_0xd38f('0x18')][_0xd38f('0x19')]['length'];_0x1109bd++){_0x35159d[_0xd38f('0x13')]+=_0x1ea6a1['results']['transcripts'][_0x1109bd][_0xd38f('0x1b')]+'';}}return _0x2e450e[_0xd38f('0x1c')](_0x35159d);})['then'](function(){logger['info'](util[_0xd38f('0xb')](_0xd38f('0x1d'),_0x2e450e['id']));if(!_0x2e450e[_0xd38f('0x1e')]){throw new db['Sequelize']['ValidationError'](_0xd38f('0x1f'));}if(!_0x1b2381[_0xd38f('0x20')]||!_0x1b2381[_0xd38f('0x21')]||!_0x1b2381[_0xd38f('0x22')]||!_0x1b2381[_0xd38f('0x23')]||!_0x1b2381[_0xd38f('0x24')]){throw new db[(_0xd38f('0x25'))][(_0xd38f('0x26'))](_0xd38f('0x27'));}if(!_0x35159d['fileText']){throw new Error(_0xd38f('0x28'));}if(_0x1b2381[_0xd38f('0x21')]===_0x58c1ea['id']){return _0x58c1ea;}else{return db['CloudProvider'][_0xd38f('0x29')]({'where':{'id':_settings[_0xd38f('0x21')]}});}})['then'](function(_0x231341){if(!_0x231341){throw new db['Sequelize'][(_0xd38f('0x26'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x231341['data1']||!_0x231341[_0xd38f('0xe')]){throw new db[(_0xd38f('0x25'))][(_0xd38f('0x26'))](_0xd38f('0x2a'));}_0x7012eb=_0x231341;logger[_0xd38f('0xa')](util[_0xd38f('0xb')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x2e450e['id']));return sentiment(_0x7012eb['data1'],_0x7012eb[_0xd38f('0xe')],_0x1b2381['sentimentRegion'],_0x35159d[_0xd38f('0x13')],_0x1b2381[_0xd38f('0x23')]);})['then'](function(_0x1b8747){logger[_0xd38f('0xa')](util[_0xd38f('0xb')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x2e450e['id']));return _0x2e450e[_0xd38f('0x1c')]({'sentiment':_0x1b8747[_0xd38f('0x2b')],'sPositive':_0x1b8747[_0xd38f('0x2c')][_0xd38f('0x2d')],'sNegative':_0x1b8747[_0xd38f('0x2c')][_0xd38f('0x2e')],'sMixed':_0x1b8747[_0xd38f('0x2c')][_0xd38f('0x2f')],'sNeutral':_0x1b8747[_0xd38f('0x2c')][_0xd38f('0x30')]});})['then'](function(){logger[_0xd38f('0xa')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x2e450e['id']));_0x43a043();});case _0xd38f('0x31'):return _0x2e450e[_0xd38f('0x1c')]({'transcribeStatus':_0xd38f('0x31'),'failureReason':_0x4192be[_0xd38f('0x11')][_0xd38f('0x32')]})[_0xd38f('0xf')](function(){logger['info'](util[_0xd38f('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x2e450e['id']));_0x43a043();});default:logger[_0xd38f('0xa')](util['format'](_0xd38f('0x33'),_0x2e450e['id']));break;}}else{return BPromise['resolve']()[_0xd38f('0xf')](function(){if(!_0x2e450e[_0xd38f('0x1e')]){throw new db['Sequelize'][(_0xd38f('0x26'))](_0xd38f('0x1f'));}if(!_0x1b2381[_0xd38f('0x20')]||!_0x1b2381[_0xd38f('0x21')]||!_0x1b2381[_0xd38f('0x22')]||!_0x1b2381[_0xd38f('0x23')]||!_0x1b2381[_0xd38f('0x24')]){throw new db[(_0xd38f('0x25'))][(_0xd38f('0x26'))](_0xd38f('0x27'));}if(!_0x2e450e[_0xd38f('0x13')]){throw new Error(_0xd38f('0x28'));}if(_0x1b2381['sentimentAccountId']===_0x58c1ea['id']){return _0x58c1ea;}else{return db['CloudProvider'][_0xd38f('0x29')]({'where':{'id':_settings[_0xd38f('0x21')]}});}})[_0xd38f('0xf')](function(_0x469eee){if(!_0x469eee){throw new db['Sequelize'][(_0xd38f('0x26'))](_0xd38f('0x34'));}if(!_0x469eee[_0xd38f('0x35')]||!_0x469eee[_0xd38f('0xe')]){throw new db[(_0xd38f('0x25'))][(_0xd38f('0x26'))](_0xd38f('0x2a'));}_0x7012eb=_0x469eee;logger[_0xd38f('0xa')](util[_0xd38f('0xb')](_0xd38f('0x36'),_0x2e450e['id']));return sentiment(_0x7012eb[_0xd38f('0x35')],_0x7012eb[_0xd38f('0xe')],_0x1b2381['sentimentRegion'],_0x2e450e[_0xd38f('0x13')],_0x1b2381[_0xd38f('0x23')]);})['then'](function(_0x3f7865){logger[_0xd38f('0xa')](util['format'](_0xd38f('0x37'),_0x2e450e['id']));return _0x2e450e[_0xd38f('0x1c')]({'sentiment':_0x3f7865['Sentiment'],'sPositive':_0x3f7865['SentimentScore'][_0xd38f('0x2d')],'sNegative':_0x3f7865[_0xd38f('0x2c')][_0xd38f('0x2e')],'sMixed':_0x3f7865[_0xd38f('0x2c')]['Mixed'],'sNeutral':_0x3f7865[_0xd38f('0x2c')][_0xd38f('0x30')],'transcribeStatus':_0xd38f('0x14')});})[_0xd38f('0xf')](function(){logger[_0xd38f('0xa')](util['format'](_0xd38f('0x1d'),_0x2e450e['id']));_0x43a043();});}})[_0xd38f('0x38')](function(_0x25f622){if(_0x25f622){if(!_0x25f622['name']||_0x25f622[_0xd38f('0x39')]!=='SequelizeValidationError'){logger[_0xd38f('0x3a')](util[_0xd38f('0xb')](_0xd38f('0x3b'),_0x2e450e['id']),util[_0xd38f('0x3c')](_0x25f622,{'showHidden':![],'depth':null}));}}_0x43a043();});});}function checkTranscribe(){var _0x40e1e7;var _0x3d874a;var _0x2f3d49;return db[_0xd38f('0x3d')][_0xd38f('0x3e')]({'where':{'transcribeStatus':_0xd38f('0x3f')}})['then'](function(_0x3bd93){if(!_0x3bd93||!_0x3bd93['length']){throw new db[(_0xd38f('0x25'))]['ValidationError'](_0xd38f('0x40'));}_0x40e1e7=_0x3bd93;return db[_0xd38f('0x41')]['findOne']({'where':{'id':0x1}});})['then'](function(_0x5447ec){if(!_0x5447ec){throw new db[(_0xd38f('0x25'))][(_0xd38f('0x26'))](_0xd38f('0x42'));}_0x3d874a=_0x5447ec;if(!_0x3d874a[_0xd38f('0x6')]||!_0x3d874a[_0xd38f('0x43')]||!_0x3d874a[_0xd38f('0x44')]||!_0x3d874a['language']||!_0x3d874a[_0xd38f('0x24')]){throw new db[(_0xd38f('0x25'))][(_0xd38f('0x26'))](_0xd38f('0x45'));}return db[_0xd38f('0x46')][_0xd38f('0x29')]({'where':{'id':_0x3d874a['transcribeAccountId']}});})['then'](function(_0x1f2e0e){if(!_0x1f2e0e){throw new db[(_0xd38f('0x25'))]['ValidationError'](_0xd38f('0x34'));}if(!_0x1f2e0e[_0xd38f('0x35')]||!_0x1f2e0e[_0xd38f('0xe')]){throw new db['Sequelize'][(_0xd38f('0x26'))](_0xd38f('0x2a'));}_0x2f3d49=_0x1f2e0e;var _0x1b7ec6=[];_0x40e1e7[_0xd38f('0x47')](function(_0x269ccd){_0x1b7ec6[_0xd38f('0x48')](checkTranscribeJob(_0x269ccd,_0x3d874a,_0x2f3d49));});return BPromise[_0xd38f('0x49')](_0x1b7ec6);})['catch'](function(_0x10d019){if(_0x10d019){if(!_0x10d019[_0xd38f('0x39')]||_0x10d019[_0xd38f('0x39')]!==_0xd38f('0x4a')){logger[_0xd38f('0x3a')](util[_0xd38f('0x3c')](_0x10d019,{'showHidden':![],'depth':null}));}}});}exports[_0xd38f('0x4b')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index 6b82d63..2201ac0 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 _0xc066=['ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','subtract','hours','length','map','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','info','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','start','moment'];(function(_0x355ce8,_0x5f1d0a){var _0x1db8b8=function(_0x277eb2){while(--_0x277eb2){_0x355ce8['push'](_0x355ce8['shift']());}};_0x1db8b8(++_0x5f1d0a);}(_0xc066,0x19f));var _0x6c06=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xc066[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var moment=require(_0x6c06('0x0'));var Redis=require(_0x6c06('0x1'));var util=require(_0x6c06('0x2'));var config=require(_0x6c06('0x3'));var db=require(_0x6c06('0x4'))['db'];var logger=require(_0x6c06('0x5'))(_0x6c06('0x6'));config[_0x6c06('0x7')]=_['defaults'](config[_0x6c06('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6c06('0x7')]));function closeInteractions(){var _0x7ad747=[];return db['WhatsappInteraction']['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x6c06('0x8')](0x18,_0x6c06('0x9'))}}})['then'](function(_0x1dbc4b){if(_0x1dbc4b&&_0x1dbc4b[_0x6c06('0xa')]){_0x7ad747=_[_0x6c06('0xb')](_0x1dbc4b||[],'id');logger['info'](_0x6c06('0xc'),_0x7ad747[_0x6c06('0xd')]());return db['WhatsappInteraction'][_0x6c06('0xe')]({'closeReason':_0x6c06('0xf'),'disposition':_0x6c06('0x10'),'closed':!![],'closedAt':moment()[_0x6c06('0x11')](_0x6c06('0x12'))},{'where':{'id':_0x7ad747}});}})['then'](function(){if(_0x7ad747&&_0x7ad747[_0x6c06('0xa')]){logger[_0x6c06('0x13')](_0x6c06('0x14'),_0x7ad747['join']());for(var _0x584207=0x0;_0x584207<_0x7ad747[_0x6c06('0xa')];_0x584207++){io['emit'](_0x6c06('0x15'),{'id':_0x7ad747[_0x584207],'closed':!![]});}}})[_0x6c06('0x16')](function(_0x2994b4){logger[_0x6c06('0x17')](_0x6c06('0x18'),_0x2994b4?util['inspect'](_0x2994b4,{'showHidden':![],'depth':null}):'');});}exports[_0x6c06('0x19')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x0216=['WhatsappInteraction','lastMsgAt','subtract','hours','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','then','emit','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','lodash','moment','util','../../config/environment','../../mysqldb','../logger','redis','defaults','socket.io-emitter'];(function(_0x3e4b55,_0x6632f7){var _0x3a51ba=function(_0x3158e5){while(--_0x3158e5){_0x3e4b55['push'](_0x3e4b55['shift']());}};_0x3a51ba(++_0x6632f7);}(_0x0216,0x149));var _0x6021=function(_0x257415,_0x1f0947){_0x257415=_0x257415-0x0;var _0x244495=_0x0216[_0x257415];return _0x244495;};'use strict';var _=require(_0x6021('0x0'));var moment=require(_0x6021('0x1'));var Redis=require('ioredis');var util=require(_0x6021('0x2'));var config=require(_0x6021('0x3'));var db=require(_0x6021('0x4'))['db'];var logger=require(_0x6021('0x5'))('schedule');config[_0x6021('0x6')]=_[_0x6021('0x7')](config[_0x6021('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x6021('0x8'))(new Redis(config[_0x6021('0x6')]));function closeInteractions(){var _0x5d6160=[];return db[_0x6021('0x9')]['findAll']({'raw':!![],'attributes':['id',_0x6021('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x6021('0xb')](0x18,_0x6021('0xc'))}}})['then'](function(_0x463871){if(_0x463871&&_0x463871[_0x6021('0xd')]){_0x5d6160=_[_0x6021('0xe')](_0x463871||[],'id');logger[_0x6021('0xf')](_0x6021('0x10'),_0x5d6160['join']());return db['WhatsappInteraction'][_0x6021('0x11')]({'closeReason':_0x6021('0x12'),'disposition':_0x6021('0x13'),'closed':!![],'closedAt':moment()['format'](_0x6021('0x14'))},{'where':{'id':_0x5d6160}});}})[_0x6021('0x15')](function(){if(_0x5d6160&&_0x5d6160[_0x6021('0xd')]){logger[_0x6021('0xf')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x5d6160['join']());for(var _0x2bf5d8=0x0;_0x2bf5d8<_0x5d6160[_0x6021('0xd')];_0x2bf5d8++){io[_0x6021('0x16')]('whatsappInteraction:update',{'id':_0x5d6160[_0x2bf5d8],'closed':!![]});}}})[_0x6021('0x17')](function(_0x4d489f){logger[_0x6021('0x18')](_0x6021('0x19'),_0x4d489f?util['inspect'](_0x4d489f,{'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 55f9575..8fbc870 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc827=['bulkCreate','then','log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2','hopper2','catch','util','push','innocenzo.biondo','@xcally.com','now','Innocenzo','Biondo','CmContact','destroy'];(function(_0x245161,_0xa4ba26){var _0x1f1942=function(_0x766f1a){while(--_0x766f1a){_0x245161['push'](_0x245161['shift']());}};_0x1f1942(++_0xa4ba26);}(_0xc827,0x1e5));var _0x7c82=function(_0x1e3721,_0x2142ba){_0x1e3721=_0x1e3721-0x0;var _0xcd6849=_0xc827[_0x1e3721];return _0xcd6849;};'use strict';var util=require(_0x7c82('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x7c82('0x1')]({'id':i,'firstName':'Innocenzo'+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x7c82('0x2')+i+_0x7c82('0x3')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x7c82('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x7c82('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x7c82('0x4')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x7c82('0x5')+i,'lastName':_0x7c82('0x6')+i,'phone':0xf879fb460+i,'email':_0x7c82('0x2')+i+_0x7c82('0x3')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x7c82('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x7c82('0x4')](),'updatedAt':Date[_0x7c82('0x4')]()});}db[_0x7c82('0x7')][_0x7c82('0x8')]({'where':{}})['then'](function(){return db['CmContact'][_0x7c82('0x9')](contacts);})[_0x7c82('0xa')](function(){console[_0x7c82('0xb')](_0x7c82('0xc'),_0x7c82('0xd'));return db['CmHopper'][_0x7c82('0x8')]({'where':{}});})[_0x7c82('0xa')](function(){return db[_0x7c82('0xe')][_0x7c82('0x9')](hopper);})['then'](function(){console[_0x7c82('0xb')](_0x7c82('0xc'),_0x7c82('0xf'));return db['CmContact'][_0x7c82('0x9')](contacts2);})['then'](function(){console[_0x7c82('0xb')]('finished\x20populating',_0x7c82('0x10'));return db['CmHopper'][_0x7c82('0x9')](hopper2);})[_0x7c82('0xa')](function(){console['log'](_0x7c82('0xc'),_0x7c82('0x11'));})[_0x7c82('0x12')](function(_0x4bada8){console['log'](_0x4bada8);}); \ No newline at end of file +var _0x7167=['destroy','bulkCreate','log','contacts1','then','CmHopper','finished\x20populating','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact'];(function(_0x3e4675,_0x502eb8){var _0x327176=function(_0x39ff9b){while(--_0x39ff9b){_0x3e4675['push'](_0x3e4675['shift']());}};_0x327176(++_0x502eb8);}(_0x7167,0x157));var _0x7716=function(_0x1d5714,_0x2fa5f4){_0x1d5714=_0x1d5714-0x0;var _0x1b620e=_0x7167[_0x1d5714];return _0x1b620e;};'use strict';var util=require(_0x7716('0x0'));var db=require(_0x7716('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x7716('0x2')]({'id':i,'firstName':_0x7716('0x3')+i,'lastName':_0x7716('0x4')+i,'phone':0xf879fb460+i,'email':_0x7716('0x5')+i+_0x7716('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x7716('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x7716('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x7716('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x7716('0x2')]({'id':i,'firstName':_0x7716('0x3')+i,'lastName':_0x7716('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x7716('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x7716('0x7')]()});}db[_0x7716('0x8')][_0x7716('0x9')]({'where':{}})['then'](function(){return db[_0x7716('0x8')][_0x7716('0xa')](contacts);})['then'](function(){console[_0x7716('0xb')]('finished\x20populating',_0x7716('0xc'));return db['CmHopper']['destroy']({'where':{}});})[_0x7716('0xd')](function(){return db[_0x7716('0xe')][_0x7716('0xa')](hopper);})[_0x7716('0xd')](function(){console[_0x7716('0xb')]('finished\x20populating','hopper1');return db[_0x7716('0x8')]['bulkCreate'](contacts2);})[_0x7716('0xd')](function(){console[_0x7716('0xb')](_0x7716('0xf'),'contacts2');return db['CmHopper'][_0x7716('0xa')](hopper2);})[_0x7716('0xd')](function(){console[_0x7716('0xb')](_0x7716('0xf'),'hopper2');})['catch'](function(_0x5e03e7){console[_0x7716('0xb')](_0x5e03e7);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index e6e99ee..e0145e8 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x888d=['password','friend','wss','all','ulaw','yes','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','bulkCreate','log','add\x20user','catch','util','push','format','%s%s','agent','%s%s@xcally.com'];(function(_0x209ec9,_0x30378c){var _0x129b1b=function(_0x2f2b9e){while(--_0x2f2b9e){_0x209ec9['push'](_0x209ec9['shift']());}};_0x129b1b(++_0x30378c);}(_0x888d,0x104));var _0xd888=function(_0x439c55,_0x2fd415){_0x439c55=_0x439c55-0x0;var _0x5d76a0=_0x888d[_0x439c55];return _0x5d76a0;};'use strict';var util=require(_0xd888('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xd888('0x1')]({'name':util[_0xd888('0x2')](_0xd888('0x3'),_0xd888('0x4'),i),'fullname':util['format']('%s%s',_0xd888('0x4'),i),'email':util[_0xd888('0x2')](_0xd888('0x5'),'agent',i),'role':_0xd888('0x4'),'password':_0xd888('0x6'),'internal':0xfa0+i,'type':_0xd888('0x7'),'transport':['udp','ws',_0xd888('0x8')],'disallow':[_0xd888('0x9')],'allow':[_0xd888('0xa')],'defaultuser':util[_0xd888('0x2')](_0xd888('0x3'),_0xd888('0x4'),i),'encryption':_0xd888('0xb'),'avpf':_0xd888('0xb'),'force_avp':_0xd888('0xb'),'icesupport':_0xd888('0xb'),'dtlsenable':_0xd888('0xb'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0xd888('0xc'),'dtlssetup':'actpass','callerid':util[_0xd888('0x2')](_0xd888('0xd'),util[_0xd888('0x2')]('%s%s',_0xd888('0x4'),i),0xfa0+i)});}db[_0xd888('0xe')][_0xd888('0xf')](users)['then'](function(){console[_0xd888('0x10')](_0xd888('0x11'));})[_0xd888('0x12')](function(_0x4d525b){console[_0xd888('0x10')](_0x4d525b);}); \ No newline at end of file +var _0x9d62=['yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','catch','../mysqldb','push','format','agent','%s%s','%s%s@xcally.com','password','friend','udp','wss','all','ulaw'];(function(_0xa11108,_0x1cbaf1){var _0x108bd3=function(_0x3c0ee3){while(--_0x3c0ee3){_0xa11108['push'](_0xa11108['shift']());}};_0x108bd3(++_0x1cbaf1);}(_0x9d62,0xdb));var _0x29d6=function(_0x29f594,_0x258902){_0x29f594=_0x29f594-0x0;var _0x2e12da=_0x9d62[_0x29f594];return _0x2e12da;};'use strict';var util=require('util');var db=require(_0x29d6('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x29d6('0x1')]({'name':util[_0x29d6('0x2')]('%s%s',_0x29d6('0x3'),i),'fullname':util[_0x29d6('0x2')](_0x29d6('0x4'),'agent',i),'email':util['format'](_0x29d6('0x5'),'agent',i),'role':_0x29d6('0x3'),'password':_0x29d6('0x6'),'internal':0xfa0+i,'type':_0x29d6('0x7'),'transport':[_0x29d6('0x8'),'ws',_0x29d6('0x9')],'disallow':[_0x29d6('0xa')],'allow':[_0x29d6('0xb')],'defaultuser':util[_0x29d6('0x2')]('%s%s',_0x29d6('0x3'),i),'encryption':_0x29d6('0xc'),'avpf':_0x29d6('0xc'),'force_avp':_0x29d6('0xc'),'icesupport':'yes','dtlsenable':_0x29d6('0xc'),'dtlsverify':'no','dtlscertfile':_0x29d6('0xd'),'dtlsprivatekey':_0x29d6('0xe'),'dtlssetup':_0x29d6('0xf'),'callerid':util[_0x29d6('0x2')](_0x29d6('0x10'),util[_0x29d6('0x2')](_0x29d6('0x4'),_0x29d6('0x3'),i),0xfa0+i)});}db[_0x29d6('0x11')][_0x29d6('0x12')](users)[_0x29d6('0x13')](function(){console['log']('add\x20user');})[_0x29d6('0x14')](function(_0x4d4ab1){console['log'](_0x4d4ab1);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 84f8bbc..842f7e6 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x14c5=['role','agent','telephone','type','ivr','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Trunks','UserProfileResource','resourceId','map','where','Campaign','format','%s:queue:%s','user:%s','handshake','userProfileId','query','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','admin','hasOwnProperty','include','push','VoiceQueue','ChatQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','voice:inbound','FaxQueue','WhatsappQueues','IvrCampaigns','voice:outbound','getVoiceQueues','getChatQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','length','chat','openchannel','whatsapp','telephone:%s','campaign:%s:%s','leave','emit','removeMailInteractions','FaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','removeWhatsappInteractions','catch','log','join','setMaxListeners','address','request','connection','remoteAddress','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','./environment','name','Agents','User'];(function(_0x7b68cc,_0x3f522e){var _0x36470e=function(_0x3b80ad){while(--_0x3b80ad){_0x7b68cc['push'](_0x7b68cc['shift']());}};_0x36470e(++_0x3f522e);}(_0x14c5,0x1de));var _0x514c=function(_0x280142,_0x5f0b15){_0x280142=_0x280142-0x0;var _0x381327=_0x14c5[_0x280142];return _0x381327;};'use strict';var _=require(_0x514c('0x0'));var util=require(_0x514c('0x1'));var BPromise=require(_0x514c('0x2'));var db=require('../mysqldb')['db'];var config=require(_0x514c('0x3'));var queryQueues={'attributes':['id',_0x514c('0x4')],'include':[{'as':_0x514c('0x5'),'model':db[_0x514c('0x6')],'attributes':['id',_0x514c('0x4'),_0x514c('0x7')],'raw':!![],'where':{'role':_0x514c('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x514c('0x4')],'where':{'role':_0x514c('0x9')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x514c('0x4')],'where':{'role':_0x514c('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x514c('0x4'),_0x514c('0xa')],'where':{'type':_0x514c('0xb')}};function getAssociatedResources(_0xfe0593,_0x3a5b1d,_0x11895f){return db['UserProfileSection'][_0x514c('0xc')]({'where':{'name':_0xfe0593,'userProfileId':_0x3a5b1d},'raw':!![]})[_0x514c('0xd')](function(_0x1a84e5){if(_0x1a84e5){if(_0x1a84e5[_0x514c('0xe')]){switch(_0xfe0593){case _0x514c('0xf'):case _0x514c('0x10'):case _0x514c('0x11'):case _0x514c('0x12'):case _0x514c('0x13'):case _0x514c('0x14'):case'WhatsappQueues':return db[_0x11895f][_0x514c('0x15')](queryQueues);case'Telephones':return db[_0x11895f][_0x514c('0x15')](queryTelephones);case _0x514c('0x16'):return db[_0x11895f][_0x514c('0x15')](queryTrunks);case'IvrCampaigns':return db[_0x11895f][_0x514c('0x15')](queryCampaigns);}}else{return db[_0x514c('0x17')][_0x514c('0x15')]({'attributes':[_0x514c('0x18')],'where':{'sectionId':_0x1a84e5['id']},'raw':!![]})['then'](function(_0x306b5b){if(_0x306b5b){var _0x28d9ff={'where':{'id':_[_0x514c('0x19')](_0x306b5b,_0x514c('0x18'))},'raw':!![]};switch(_0x11895f){case _0x514c('0x6'):_0x28d9ff[_0x514c('0x1a')][_0x514c('0x7')]='telephone';break;case _0x514c('0x1b'):_0x28d9ff[_0x514c('0x1a')][_0x514c('0xa')]='ivr';break;}return db[_0x11895f][_0x514c('0x15')](_0x28d9ff);}else{return[];}});}}else{return[];}})[_0x514c('0xd')](function(_0x560703){return _0x560703;});}function joinOrLeaveQueues(_0x52ba4f,_0x281622,_0x461d55,_0x2848d8){_0x52ba4f[_0x281622](util[_0x514c('0x1c')](_0x514c('0x1d'),_0x461d55,_0x2848d8[_0x514c('0x4')]));if(_0x2848d8[_0x514c('0x5')]){for(var _0x554cd0=0x0;_0x554cd0<_0x2848d8[_0x514c('0x5')]['length'];_0x554cd0+=0x1){_0x52ba4f[_0x281622](util['format'](_0x514c('0x1e'),_0x2848d8['Agents'][_0x554cd0][_0x514c('0x4')]));}}}function joinOrLeave(_0x1a7a55,_0x2f3863,_0x1be1fe){var _0x39f5d4;if(_0x1a7a55[_0x514c('0x1f')]['query']['id']){db[_0x514c('0x6')]['find']({'attributes':['id',_0x514c('0x4'),_0x514c('0x7'),_0x514c('0x20')],'where':{'id':_0x1a7a55[_0x514c('0x1f')][_0x514c('0x21')]['id']},'include':[{'model':db[_0x514c('0x22')],'as':_0x514c('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x514c('0x24')],'as':_0x514c('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x514c('0x26')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x514c('0x27')],'as':_0x514c('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x514c('0x29')],'as':_0x514c('0x2a'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x514c('0x2b'),'attributes':['id'],'raw':!![]}]})[_0x514c('0xd')](function(_0x2e2bec){if(_0x2e2bec){_0x39f5d4=_0x2e2bec;_0x1a7a55[_0x2f3863](util[_0x514c('0x1c')](_0x514c('0x1e'),_0x2e2bec['name']));var _0x22994a=[];switch(_0x2e2bec[_0x514c('0x7')]){case _0x514c('0x2c'):_0x1a7a55[_0x2f3863]('voice:inbound');_0x1a7a55[_0x2f3863]('voice:outbound');if(queryQueues[_0x514c('0x2d')](_0x514c('0x2e'))){delete queryQueues[_0x514c('0x2e')];}_0x22994a[_0x514c('0x2f')](db[_0x514c('0x30')]['findAll'](queryQueues));_0x22994a[_0x514c('0x2f')](db[_0x514c('0x31')]['findAll'](queryQueues));_0x22994a['push'](db['FaxQueue'][_0x514c('0x15')](queryQueues));_0x22994a[_0x514c('0x2f')](db[_0x514c('0x32')][_0x514c('0x15')](queryQueues));_0x22994a[_0x514c('0x2f')](db[_0x514c('0x33')]['findAll'](queryQueues));_0x22994a[_0x514c('0x2f')](db[_0x514c('0x34')][_0x514c('0x15')](queryQueues));_0x22994a[_0x514c('0x2f')](db[_0x514c('0x35')][_0x514c('0x15')](queryQueues));_0x22994a['push'](db[_0x514c('0x6')][_0x514c('0x15')](queryTelephones));_0x22994a['push'](db[_0x514c('0x36')]['findAll'](queryTrunks));_0x22994a[_0x514c('0x2f')](db[_0x514c('0x1b')][_0x514c('0x15')](queryCampaigns));_0x22994a[_0x514c('0x2f')](db[_0x514c('0x6')][_0x514c('0x15')](queryAgents));break;case _0x514c('0x37'):_0x1a7a55[_0x2f3863](_0x514c('0x38'));_0x1a7a55[_0x2f3863]('voice:outbound');_0x22994a['push'](getAssociatedResources(_0x514c('0xf'),_0x2e2bec[_0x514c('0x20')],_0x514c('0x30')));_0x22994a['push'](getAssociatedResources('ChatQueues',_0x2e2bec[_0x514c('0x20')],_0x514c('0x31')));_0x22994a['push'](getAssociatedResources(_0x514c('0x11'),_0x2e2bec[_0x514c('0x20')],_0x514c('0x39')));_0x22994a[_0x514c('0x2f')](getAssociatedResources(_0x514c('0x12'),_0x2e2bec['userProfileId'],'SmsQueue'));_0x22994a['push'](getAssociatedResources(_0x514c('0x13'),_0x2e2bec[_0x514c('0x20')],_0x514c('0x33')));_0x22994a[_0x514c('0x2f')](getAssociatedResources(_0x514c('0x14'),_0x2e2bec[_0x514c('0x20')],'OpenchannelQueue'));_0x22994a[_0x514c('0x2f')](getAssociatedResources(_0x514c('0x3a'),_0x2e2bec['userProfileId'],'WhatsappQueue'));_0x22994a[_0x514c('0x2f')](getAssociatedResources('Telephones',_0x2e2bec[_0x514c('0x20')],_0x514c('0x6')));_0x22994a[_0x514c('0x2f')](getAssociatedResources(_0x514c('0x16'),_0x2e2bec['userProfileId'],_0x514c('0x36')));_0x22994a[_0x514c('0x2f')](getAssociatedResources(_0x514c('0x3b'),_0x2e2bec[_0x514c('0x20')],_0x514c('0x1b')));_0x22994a[_0x514c('0x2f')](db['User'][_0x514c('0x15')](queryAgents));break;case _0x514c('0x8'):_0x1a7a55[_0x2f3863](_0x514c('0x38'));_0x1a7a55[_0x2f3863](_0x514c('0x3c'));_0x22994a[_0x514c('0x2f')](_0x2e2bec[_0x514c('0x3d')]({'attributes':['id','name']}));_0x22994a[_0x514c('0x2f')](_0x2e2bec[_0x514c('0x3e')]({'attributes':['id','name']}));_0x22994a[_0x514c('0x2f')](_0x2e2bec['getFaxQueues']({'attributes':['id','name']}));_0x22994a['push'](_0x2e2bec[_0x514c('0x3f')]({'attributes':['id','name']}));_0x22994a['push'](_0x2e2bec[_0x514c('0x40')]({'attributes':['id',_0x514c('0x4')]}));_0x22994a[_0x514c('0x2f')](_0x2e2bec[_0x514c('0x41')]({'attributes':['id',_0x514c('0x4')]}));_0x22994a[_0x514c('0x2f')](_0x2e2bec[_0x514c('0x42')]({'attributes':['id','name']}));break;}return BPromise[_0x514c('0x43')](_0x22994a);}})[_0x514c('0xd')](function(_0x3971a3){if(_0x3971a3&&_0x3971a3[_0x514c('0x44')]){for(var _0x5c688c=0x0;_0x5c688c<_0x3971a3[_0x514c('0x44')];_0x5c688c+=0x1){for(var _0x39fe9b=0x0;_0x39fe9b<_0x3971a3[_0x5c688c][_0x514c('0x44')];_0x39fe9b+=0x1){switch(_0x5c688c){case 0x0:joinOrLeaveQueues(_0x1a7a55,_0x2f3863,'voice',_0x3971a3[_0x5c688c][_0x39fe9b]);break;case 0x1:joinOrLeaveQueues(_0x1a7a55,_0x2f3863,_0x514c('0x45'),_0x3971a3[_0x5c688c][_0x39fe9b]);break;case 0x2:joinOrLeaveQueues(_0x1a7a55,_0x2f3863,'fax',_0x3971a3[_0x5c688c][_0x39fe9b]);break;case 0x3:joinOrLeaveQueues(_0x1a7a55,_0x2f3863,'sms',_0x3971a3[_0x5c688c][_0x39fe9b]);break;case 0x4:joinOrLeaveQueues(_0x1a7a55,_0x2f3863,'mail',_0x3971a3[_0x5c688c][_0x39fe9b]);break;case 0x5:joinOrLeaveQueues(_0x1a7a55,_0x2f3863,_0x514c('0x46'),_0x3971a3[_0x5c688c][_0x39fe9b]);break;case 0x6:joinOrLeaveQueues(_0x1a7a55,_0x2f3863,_0x514c('0x47'),_0x3971a3[_0x5c688c][_0x39fe9b]);break;case 0x7:if(_0x39f5d4[_0x514c('0x7')]!==_0x514c('0x8'))_0x1a7a55[_0x2f3863](util[_0x514c('0x1c')](_0x514c('0x48'),_0x3971a3[_0x5c688c][_0x39fe9b][_0x514c('0x4')]));break;case 0x8:if(_0x39f5d4[_0x514c('0x7')]!==_0x514c('0x8'))_0x1a7a55[_0x2f3863](util[_0x514c('0x1c')]('trunk:%s',_0x3971a3[_0x5c688c][_0x39fe9b][_0x514c('0x4')]));break;case 0x9:if(_0x39f5d4[_0x514c('0x7')]!=='agent')_0x1a7a55[_0x2f3863](util['format'](_0x514c('0x49'),_0x3971a3[_0x5c688c][_0x39fe9b][_0x514c('0xa')],_0x3971a3[_0x5c688c][_0x39fe9b][_0x514c('0x4')]));break;case 0xa:_0x1a7a55[_0x2f3863](util[_0x514c('0x1c')](_0x514c('0x1e'),_0x3971a3[_0x5c688c][_0x39fe9b][_0x514c('0x4')]));break;}}}}})[_0x514c('0xd')](function(){if(_0x2f3863===_0x514c('0x4a')){var _0x466c80=_[_0x514c('0x19')](_0x39f5d4['ChatInteractions'],'id');return _0x39f5d4['removeChatInteractions'](_0x466c80)['then'](function(){for(var _0x17ee89=0x0;_0x17ee89<_0x466c80[_0x514c('0x44')];_0x17ee89+=0x1){_0x1be1fe[_0x514c('0x4b')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x466c80[_0x17ee89]),'UserId':Number(_0x39f5d4['id'])});}});}})['then'](function(){if(_0x2f3863===_0x514c('0x4a')){var _0x53bc47=_['map'](_0x39f5d4[_0x514c('0x25')],'id');return _0x39f5d4[_0x514c('0x4c')](_0x53bc47)[_0x514c('0xd')](function(){for(var _0xd162b2=0x0;_0xd162b2<_0x53bc47[_0x514c('0x44')];_0xd162b2+=0x1){_0x1be1fe['emit']('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x53bc47[_0xd162b2]),'UserId':Number(_0x39f5d4['id'])});}});}})[_0x514c('0xd')](function(){if(_0x2f3863===_0x514c('0x4a')){var _0x59c3d7=_[_0x514c('0x19')](_0x39f5d4[_0x514c('0x4d')],'id');return _0x39f5d4[_0x514c('0x4e')](_0x59c3d7)[_0x514c('0xd')](function(){for(var _0x379532=0x0;_0x379532<_0x59c3d7[_0x514c('0x44')];_0x379532+=0x1){_0x1be1fe[_0x514c('0x4b')](_0x514c('0x4f'),{'FaxInteractionId':Number(_0x59c3d7[_0x379532]),'UserId':Number(_0x39f5d4['id'])});}});}})[_0x514c('0xd')](function(){if(_0x2f3863===_0x514c('0x4a')){var _0x47eb09=_[_0x514c('0x19')](_0x39f5d4[_0x514c('0x28')],'id');return _0x39f5d4[_0x514c('0x50')](_0x47eb09)[_0x514c('0xd')](function(){for(var _0x1e83b6=0x0;_0x1e83b6<_0x47eb09[_0x514c('0x44')];_0x1e83b6+=0x1){_0x1be1fe['emit'](_0x514c('0x51'),{'SmsInteractionId':Number(_0x47eb09[_0x1e83b6]),'UserId':Number(_0x39f5d4['id'])});}});}})[_0x514c('0xd')](function(){if(_0x2f3863===_0x514c('0x4a')){var _0x1b758e=_[_0x514c('0x19')](_0x39f5d4[_0x514c('0x2a')],'id');return _0x39f5d4[_0x514c('0x52')](_0x1b758e)[_0x514c('0xd')](function(){for(var _0x40b1ff=0x0;_0x40b1ff<_0x1b758e[_0x514c('0x44')];_0x40b1ff+=0x1){_0x1be1fe['emit']('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x1b758e[_0x40b1ff]),'UserId':Number(_0x39f5d4['id'])});}});}})['then'](function(){if(_0x2f3863===_0x514c('0x4a')){var _0x351fe2=_['map'](_0x39f5d4[_0x514c('0x2b')],'id');return _0x39f5d4[_0x514c('0x53')](_0x351fe2)[_0x514c('0xd')](function(){for(var _0x455134=0x0;_0x455134<_0x351fe2[_0x514c('0x44')];_0x455134+=0x1){_0x1be1fe[_0x514c('0x4b')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x351fe2[_0x455134]),'UserId':Number(_0x39f5d4['id'])});}});}})[_0x514c('0x54')](function(_0xe1ec7b){_0x1a7a55[_0x514c('0x55')](_0xe1ec7b);});}}function onDisconnect(_0x882ac7,_0x3a8853){joinOrLeave(_0x882ac7,_0x514c('0x4a'),_0x3a8853);}function onConnect(_0x2b19be){joinOrLeave(_0x2b19be,_0x514c('0x56'));}exports['default']=function(_0x3ff5a9){_0x3ff5a9['on']('connection',function(_0xf5875){_0xf5875[_0x514c('0x57')](0x0);_0xf5875[_0x514c('0x58')]=_0xf5875[_0x514c('0x59')][_0x514c('0x5a')][_0x514c('0x5b')]+':'+_0xf5875[_0x514c('0x59')][_0x514c('0x5a')]['remotePort'];_0xf5875['connectedAt']=new Date();_0xf5875['log']=function(_0x408da4){console[_0x514c('0x55')](_0x514c('0x5c')+_0xf5875[_0x514c('0x5d')][_0x514c('0x4')]+'['+_0xf5875[_0x514c('0x58')]+']',_0x408da4);};_0xf5875['on'](_0x514c('0x5e'),function(){onDisconnect(_0xf5875,_0x3ff5a9);_0xf5875['log'](_0x514c('0x5f'));});onConnect(_0xf5875);_0xf5875[_0x514c('0x55')](_0x514c('0x60'));});}; \ No newline at end of file +var _0x930b=['SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','user:%s','admin','voice:inbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','WhatsappQueue','Trunk','voice:outbound','OpenchannelQueue','WhatsappQueues','IvrCampaigns','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','length','voice','chat','fax','sms','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','removeChatInteractions','emit','removeMailInteractions','user_has_mail_interactions:remove','leave','removeFaxInteractions','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','removeWhatsappInteractions','log','join','default','connection','setMaxListeners','address','request','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','lodash','util','../mysqldb','./environment','name','role','agent','telephone','type','ivr','findOne','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','Telephones','Trunks','findAll','UserProfileResource','resourceId','map','User','Campaign','where','then','%s:queue:%s','Agents','format','handshake','query','userProfileId','ChatInteraction','MailInteractions','FaxInteraction','FaxInteractions'];(function(_0x18d6b7,_0x19ba00){var _0x5a6027=function(_0x30c89e){while(--_0x30c89e){_0x18d6b7['push'](_0x18d6b7['shift']());}};_0x5a6027(++_0x19ba00);}(_0x930b,0x106));var _0xb930=function(_0x2053f7,_0x35473a){_0x2053f7=_0x2053f7-0x0;var _0x438ff0=_0x930b[_0x2053f7];return _0x438ff0;};'use strict';var _=require(_0xb930('0x0'));var util=require(_0xb930('0x1'));var BPromise=require('bluebird');var db=require(_0xb930('0x2'))['db'];var config=require(_0xb930('0x3'));var queryQueues={'attributes':['id',_0xb930('0x4')],'include':[{'as':'Agents','model':db['User'],'attributes':['id',_0xb930('0x4'),_0xb930('0x5')],'raw':!![],'where':{'role':_0xb930('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0xb930('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0xb930('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0xb930('0x4')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0xb930('0x4'),_0xb930('0x8')],'where':{'type':_0xb930('0x9')}};function getAssociatedResources(_0xb5f26f,_0x1614d3,_0x48a7e1){return db['UserProfileSection'][_0xb930('0xa')]({'where':{'name':_0xb5f26f,'userProfileId':_0x1614d3},'raw':!![]})['then'](function(_0x400032){if(_0x400032){if(_0x400032[_0xb930('0xb')]){switch(_0xb5f26f){case _0xb930('0xc'):case _0xb930('0xd'):case _0xb930('0xe'):case _0xb930('0xf'):case _0xb930('0x10'):case _0xb930('0x11'):case'WhatsappQueues':return db[_0x48a7e1]['findAll'](queryQueues);case _0xb930('0x12'):return db[_0x48a7e1]['findAll'](queryTelephones);case _0xb930('0x13'):return db[_0x48a7e1][_0xb930('0x14')](queryTrunks);case'IvrCampaigns':return db[_0x48a7e1][_0xb930('0x14')](queryCampaigns);}}else{return db[_0xb930('0x15')][_0xb930('0x14')]({'attributes':[_0xb930('0x16')],'where':{'sectionId':_0x400032['id']},'raw':!![]})['then'](function(_0x465c2c){if(_0x465c2c){var _0x2631c9={'where':{'id':_[_0xb930('0x17')](_0x465c2c,_0xb930('0x16'))},'raw':!![]};switch(_0x48a7e1){case _0xb930('0x18'):_0x2631c9['where'][_0xb930('0x5')]=_0xb930('0x7');break;case _0xb930('0x19'):_0x2631c9[_0xb930('0x1a')][_0xb930('0x8')]=_0xb930('0x9');break;}return db[_0x48a7e1][_0xb930('0x14')](_0x2631c9);}else{return[];}});}}else{return[];}})[_0xb930('0x1b')](function(_0x343068){return _0x343068;});}function joinOrLeaveQueues(_0x1fcc73,_0x4771ec,_0x56281b,_0x134c7f){_0x1fcc73[_0x4771ec](util['format'](_0xb930('0x1c'),_0x56281b,_0x134c7f[_0xb930('0x4')]));if(_0x134c7f[_0xb930('0x1d')]){for(var _0x1b7a77=0x0;_0x1b7a77<_0x134c7f[_0xb930('0x1d')]['length'];_0x1b7a77+=0x1){_0x1fcc73[_0x4771ec](util[_0xb930('0x1e')]('user:%s',_0x134c7f[_0xb930('0x1d')][_0x1b7a77]['name']));}}}function joinOrLeave(_0x46df92,_0x20f8df,_0x231517){var _0x17b135;if(_0x46df92[_0xb930('0x1f')][_0xb930('0x20')]['id']){db[_0xb930('0x18')]['find']({'attributes':['id',_0xb930('0x4'),_0xb930('0x5'),_0xb930('0x21')],'where':{'id':_0x46df92[_0xb930('0x1f')]['query']['id']},'include':[{'model':db[_0xb930('0x22')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0xb930('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0xb930('0x24')],'as':_0xb930('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xb930('0x26')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xb930('0x27')],'as':_0xb930('0x28'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0xb930('0x29'),'attributes':['id'],'raw':!![]}]})[_0xb930('0x1b')](function(_0x3d45c2){if(_0x3d45c2){_0x17b135=_0x3d45c2;_0x46df92[_0x20f8df](util[_0xb930('0x1e')](_0xb930('0x2a'),_0x3d45c2[_0xb930('0x4')]));var _0x36a00e=[];switch(_0x3d45c2[_0xb930('0x5')]){case _0xb930('0x2b'):_0x46df92[_0x20f8df](_0xb930('0x2c'));_0x46df92[_0x20f8df]('voice:outbound');if(queryQueues[_0xb930('0x2d')](_0xb930('0x2e'))){delete queryQueues[_0xb930('0x2e')];}_0x36a00e[_0xb930('0x2f')](db[_0xb930('0x30')]['findAll'](queryQueues));_0x36a00e['push'](db[_0xb930('0x31')]['findAll'](queryQueues));_0x36a00e[_0xb930('0x2f')](db[_0xb930('0x32')][_0xb930('0x14')](queryQueues));_0x36a00e[_0xb930('0x2f')](db[_0xb930('0x33')][_0xb930('0x14')](queryQueues));_0x36a00e[_0xb930('0x2f')](db[_0xb930('0x34')][_0xb930('0x14')](queryQueues));_0x36a00e[_0xb930('0x2f')](db['OpenchannelQueue'][_0xb930('0x14')](queryQueues));_0x36a00e['push'](db[_0xb930('0x35')][_0xb930('0x14')](queryQueues));_0x36a00e[_0xb930('0x2f')](db[_0xb930('0x18')][_0xb930('0x14')](queryTelephones));_0x36a00e[_0xb930('0x2f')](db[_0xb930('0x36')][_0xb930('0x14')](queryTrunks));_0x36a00e[_0xb930('0x2f')](db['Campaign']['findAll'](queryCampaigns));_0x36a00e[_0xb930('0x2f')](db[_0xb930('0x18')][_0xb930('0x14')](queryAgents));break;case'user':_0x46df92[_0x20f8df](_0xb930('0x2c'));_0x46df92[_0x20f8df](_0xb930('0x37'));_0x36a00e['push'](getAssociatedResources(_0xb930('0xc'),_0x3d45c2['userProfileId'],'VoiceQueue'));_0x36a00e[_0xb930('0x2f')](getAssociatedResources(_0xb930('0xd'),_0x3d45c2[_0xb930('0x21')],'ChatQueue'));_0x36a00e['push'](getAssociatedResources(_0xb930('0xe'),_0x3d45c2[_0xb930('0x21')],_0xb930('0x32')));_0x36a00e[_0xb930('0x2f')](getAssociatedResources(_0xb930('0xf'),_0x3d45c2['userProfileId'],_0xb930('0x33')));_0x36a00e[_0xb930('0x2f')](getAssociatedResources(_0xb930('0x10'),_0x3d45c2[_0xb930('0x21')],'MailQueue'));_0x36a00e[_0xb930('0x2f')](getAssociatedResources(_0xb930('0x11'),_0x3d45c2[_0xb930('0x21')],_0xb930('0x38')));_0x36a00e[_0xb930('0x2f')](getAssociatedResources(_0xb930('0x39'),_0x3d45c2['userProfileId'],_0xb930('0x35')));_0x36a00e[_0xb930('0x2f')](getAssociatedResources('Telephones',_0x3d45c2[_0xb930('0x21')],_0xb930('0x18')));_0x36a00e[_0xb930('0x2f')](getAssociatedResources(_0xb930('0x13'),_0x3d45c2[_0xb930('0x21')],_0xb930('0x36')));_0x36a00e[_0xb930('0x2f')](getAssociatedResources(_0xb930('0x3a'),_0x3d45c2[_0xb930('0x21')],_0xb930('0x19')));_0x36a00e[_0xb930('0x2f')](db[_0xb930('0x18')][_0xb930('0x14')](queryAgents));break;case'agent':_0x46df92[_0x20f8df](_0xb930('0x2c'));_0x46df92[_0x20f8df](_0xb930('0x37'));_0x36a00e[_0xb930('0x2f')](_0x3d45c2[_0xb930('0x3b')]({'attributes':['id','name']}));_0x36a00e[_0xb930('0x2f')](_0x3d45c2[_0xb930('0x3c')]({'attributes':['id',_0xb930('0x4')]}));_0x36a00e[_0xb930('0x2f')](_0x3d45c2[_0xb930('0x3d')]({'attributes':['id','name']}));_0x36a00e[_0xb930('0x2f')](_0x3d45c2[_0xb930('0x3e')]({'attributes':['id',_0xb930('0x4')]}));_0x36a00e[_0xb930('0x2f')](_0x3d45c2[_0xb930('0x3f')]({'attributes':['id','name']}));_0x36a00e[_0xb930('0x2f')](_0x3d45c2[_0xb930('0x40')]({'attributes':['id',_0xb930('0x4')]}));_0x36a00e['push'](_0x3d45c2[_0xb930('0x41')]({'attributes':['id',_0xb930('0x4')]}));break;}return BPromise['all'](_0x36a00e);}})[_0xb930('0x1b')](function(_0xa83bf7){if(_0xa83bf7&&_0xa83bf7[_0xb930('0x42')]){for(var _0x83ec8f=0x0;_0x83ec8f<_0xa83bf7['length'];_0x83ec8f+=0x1){for(var _0x2c6034=0x0;_0x2c6034<_0xa83bf7[_0x83ec8f][_0xb930('0x42')];_0x2c6034+=0x1){switch(_0x83ec8f){case 0x0:joinOrLeaveQueues(_0x46df92,_0x20f8df,_0xb930('0x43'),_0xa83bf7[_0x83ec8f][_0x2c6034]);break;case 0x1:joinOrLeaveQueues(_0x46df92,_0x20f8df,_0xb930('0x44'),_0xa83bf7[_0x83ec8f][_0x2c6034]);break;case 0x2:joinOrLeaveQueues(_0x46df92,_0x20f8df,_0xb930('0x45'),_0xa83bf7[_0x83ec8f][_0x2c6034]);break;case 0x3:joinOrLeaveQueues(_0x46df92,_0x20f8df,_0xb930('0x46'),_0xa83bf7[_0x83ec8f][_0x2c6034]);break;case 0x4:joinOrLeaveQueues(_0x46df92,_0x20f8df,'mail',_0xa83bf7[_0x83ec8f][_0x2c6034]);break;case 0x5:joinOrLeaveQueues(_0x46df92,_0x20f8df,_0xb930('0x47'),_0xa83bf7[_0x83ec8f][_0x2c6034]);break;case 0x6:joinOrLeaveQueues(_0x46df92,_0x20f8df,_0xb930('0x48'),_0xa83bf7[_0x83ec8f][_0x2c6034]);break;case 0x7:if(_0x17b135[_0xb930('0x5')]!==_0xb930('0x6'))_0x46df92[_0x20f8df](util[_0xb930('0x1e')](_0xb930('0x49'),_0xa83bf7[_0x83ec8f][_0x2c6034][_0xb930('0x4')]));break;case 0x8:if(_0x17b135[_0xb930('0x5')]!==_0xb930('0x6'))_0x46df92[_0x20f8df](util[_0xb930('0x1e')](_0xb930('0x4a'),_0xa83bf7[_0x83ec8f][_0x2c6034]['name']));break;case 0x9:if(_0x17b135[_0xb930('0x5')]!==_0xb930('0x6'))_0x46df92[_0x20f8df](util['format'](_0xb930('0x4b'),_0xa83bf7[_0x83ec8f][_0x2c6034][_0xb930('0x8')],_0xa83bf7[_0x83ec8f][_0x2c6034]['name']));break;case 0xa:_0x46df92[_0x20f8df](util[_0xb930('0x1e')](_0xb930('0x2a'),_0xa83bf7[_0x83ec8f][_0x2c6034]['name']));break;}}}}})['then'](function(){if(_0x20f8df==='leave'){var _0x1de39d=_[_0xb930('0x17')](_0x17b135['ChatInteractions'],'id');return _0x17b135[_0xb930('0x4c')](_0x1de39d)[_0xb930('0x1b')](function(){for(var _0x3f60d6=0x0;_0x3f60d6<_0x1de39d[_0xb930('0x42')];_0x3f60d6+=0x1){_0x231517[_0xb930('0x4d')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x1de39d[_0x3f60d6]),'UserId':Number(_0x17b135['id'])});}});}})[_0xb930('0x1b')](function(){if(_0x20f8df==='leave'){var _0x1e813d=_[_0xb930('0x17')](_0x17b135['MailInteractions'],'id');return _0x17b135[_0xb930('0x4e')](_0x1e813d)[_0xb930('0x1b')](function(){for(var _0x2f3f76=0x0;_0x2f3f76<_0x1e813d[_0xb930('0x42')];_0x2f3f76+=0x1){_0x231517[_0xb930('0x4d')](_0xb930('0x4f'),{'MailInteractionId':Number(_0x1e813d[_0x2f3f76]),'UserId':Number(_0x17b135['id'])});}});}})['then'](function(){if(_0x20f8df===_0xb930('0x50')){var _0x54f527=_[_0xb930('0x17')](_0x17b135['FaxInteractions'],'id');return _0x17b135[_0xb930('0x51')](_0x54f527)['then'](function(){for(var _0x552a97=0x0;_0x552a97<_0x54f527[_0xb930('0x42')];_0x552a97+=0x1){_0x231517[_0xb930('0x4d')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x54f527[_0x552a97]),'UserId':Number(_0x17b135['id'])});}});}})[_0xb930('0x1b')](function(){if(_0x20f8df===_0xb930('0x50')){var _0x59d4ea=_['map'](_0x17b135[_0xb930('0x52')],'id');return _0x17b135[_0xb930('0x53')](_0x59d4ea)[_0xb930('0x1b')](function(){for(var _0x55a929=0x0;_0x55a929<_0x59d4ea[_0xb930('0x42')];_0x55a929+=0x1){_0x231517['emit'](_0xb930('0x54'),{'SmsInteractionId':Number(_0x59d4ea[_0x55a929]),'UserId':Number(_0x17b135['id'])});}});}})['then'](function(){if(_0x20f8df===_0xb930('0x50')){var _0x54fcde=_[_0xb930('0x17')](_0x17b135[_0xb930('0x28')],'id');return _0x17b135[_0xb930('0x55')](_0x54fcde)[_0xb930('0x1b')](function(){for(var _0x2ac4fc=0x0;_0x2ac4fc<_0x54fcde[_0xb930('0x42')];_0x2ac4fc+=0x1){_0x231517[_0xb930('0x4d')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x54fcde[_0x2ac4fc]),'UserId':Number(_0x17b135['id'])});}});}})['then'](function(){if(_0x20f8df===_0xb930('0x50')){var _0x263b8e=_[_0xb930('0x17')](_0x17b135[_0xb930('0x29')],'id');return _0x17b135[_0xb930('0x56')](_0x263b8e)[_0xb930('0x1b')](function(){for(var _0x77800c=0x0;_0x77800c<_0x263b8e['length'];_0x77800c+=0x1){_0x231517[_0xb930('0x4d')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x263b8e[_0x77800c]),'UserId':Number(_0x17b135['id'])});}});}})['catch'](function(_0x4c7779){_0x46df92[_0xb930('0x57')](_0x4c7779);});}}function onDisconnect(_0x47b7bf,_0x6dbe76){joinOrLeave(_0x47b7bf,_0xb930('0x50'),_0x6dbe76);}function onConnect(_0x114be2){joinOrLeave(_0x114be2,_0xb930('0x58'));}exports[_0xb930('0x59')]=function(_0x2091fb){_0x2091fb['on'](_0xb930('0x5a'),function(_0x54fc1d){_0x54fc1d[_0xb930('0x5b')](0x0);_0x54fc1d[_0xb930('0x5c')]=_0x54fc1d[_0xb930('0x5d')]['connection']['remoteAddress']+':'+_0x54fc1d[_0xb930('0x5d')][_0xb930('0x5a')][_0xb930('0x5e')];_0x54fc1d[_0xb930('0x5f')]=new Date();_0x54fc1d[_0xb930('0x57')]=function(_0x4c1de6){console[_0xb930('0x57')](_0xb930('0x60')+_0x54fc1d[_0xb930('0x61')][_0xb930('0x4')]+'['+_0x54fc1d[_0xb930('0x5c')]+']',_0x4c1de6);};_0x54fc1d['on'](_0xb930('0x62'),function(){onDisconnect(_0x54fc1d,_0x2091fb);_0x54fc1d[_0xb930('0x57')](_0xb930('0x63'));});onConnect(_0x54fc1d);_0x54fc1d[_0xb930('0x57')]('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index de1394f..7ac582f 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 _0x97bf=['UserId','interface','name','agent','outgoingmessage','catch','AfterCreateMessage','channel','motionChannel','event','offlineMessage','contact','format','SIP/%s','AfterCreate','changed','closed','substatus','AfterUpdate','fullname','email','internal','default','hasOwnProperty','model','callback','condition','util','../../mysqldb','jayson/promise','triggers','client','http','Chat','ChatInteraction','newinteraction','afterUpdate','ChatMessage','newmessage','ChatOfflineMessage','afterCreate','Sms','SmsMessage','WhatsappInteraction','Whatsapp','closedinteraction','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','EventManager','info','Trigger,\x20%s','error','code','get','direction','resolve','then','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','query','Sequelize','QueryTypes','SELECT'];(function(_0x44d2a8,_0x337c45){var _0x53b4bf=function(_0x2b872b){while(--_0x2b872b){_0x44d2a8['push'](_0x44d2a8['shift']());}};_0x53b4bf(++_0x337c45);}(_0x97bf,0x13b));var _0xf97b=function(_0x48bd13,_0x2e9625){_0x48bd13=_0x48bd13-0x0;var _0x3b9ee5=_0x97bf[_0x48bd13];return _0x3b9ee5;};'use strict';var util=require(_0xf97b('0x0'));var db=require(_0xf97b('0x1'))['db'];var jayson=require(_0xf97b('0x2'));var logger=require('../logger')(_0xf97b('0x3'));var client=jayson[_0xf97b('0x4')][_0xf97b('0x5')]({'port':0x232a});var triggers=[{'channel':_0xf97b('0x6'),'model':_0xf97b('0x7'),'event':'afterCreate','condition':_0xf97b('0x8'),'callback':afterCreate},{'channel':_0xf97b('0x6'),'model':_0xf97b('0x7'),'event':_0xf97b('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xf97b('0x6'),'model':_0xf97b('0xa'),'event':'afterCreate','condition':_0xf97b('0xb'),'callback':afterCreateMessage},{'channel':_0xf97b('0x6'),'model':_0xf97b('0xc'),'event':_0xf97b('0xd'),'condition':_0xf97b('0xb'),'callback':afterCreateOfflineMessage},{'channel':_0xf97b('0xe'),'model':'SmsInteraction','event':_0xf97b('0xd'),'condition':'newinteraction','callback':afterCreate},{'channel':'Sms','model':'SmsInteraction','event':_0xf97b('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xf97b('0xe'),'model':_0xf97b('0xf'),'event':'afterCreate','condition':_0xf97b('0xb'),'callback':afterCreateMessage},{'channel':'Whatsapp','model':_0xf97b('0x10'),'event':_0xf97b('0xd'),'condition':_0xf97b('0x8'),'callback':afterCreate},{'channel':_0xf97b('0x11'),'model':_0xf97b('0x10'),'event':_0xf97b('0x9'),'condition':_0xf97b('0x12'),'callback':afterUpdate},{'channel':'Whatsapp','model':'WhatsappMessage','event':_0xf97b('0xd'),'condition':_0xf97b('0xb'),'callback':afterCreateMessage},{'channel':_0xf97b('0x13'),'model':_0xf97b('0x14'),'event':_0xf97b('0xd'),'condition':_0xf97b('0x8'),'callback':afterCreate},{'channel':'Fax','model':_0xf97b('0x14'),'event':_0xf97b('0x9'),'condition':_0xf97b('0x12'),'callback':afterUpdate},{'channel':_0xf97b('0x13'),'model':_0xf97b('0x15'),'event':_0xf97b('0xd'),'condition':_0xf97b('0xb'),'callback':afterCreateMessage},{'channel':_0xf97b('0x16'),'model':_0xf97b('0x17'),'event':_0xf97b('0xd'),'condition':_0xf97b('0x8'),'callback':afterCreate},{'channel':_0xf97b('0x16'),'model':'MailInteraction','event':_0xf97b('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xf97b('0x16'),'model':_0xf97b('0x18'),'event':_0xf97b('0xd'),'condition':_0xf97b('0xb'),'callback':afterCreateMessage},{'channel':_0xf97b('0x19'),'model':_0xf97b('0x1a'),'event':_0xf97b('0xd'),'condition':_0xf97b('0x8'),'callback':afterCreate},{'channel':_0xf97b('0x19'),'model':_0xf97b('0x1a'),'event':_0xf97b('0x9'),'condition':_0xf97b('0x12'),'callback':afterUpdate},{'channel':_0xf97b('0x19'),'model':_0xf97b('0x1b'),'event':_0xf97b('0xd'),'condition':_0xf97b('0xb'),'callback':afterCreateMessage}];function request(_0xd3120b){return client['request'](_0xf97b('0x1c'),_0xd3120b)['then'](function(_0x3b31ce){logger[_0xf97b('0x1d')](_0xf97b('0x1e'),_0xf97b('0x1c'),_0x3b31ce);if(_0x3b31ce[_0xf97b('0x1f')]){if(_0x3b31ce[_0xf97b('0x1f')][_0xf97b('0x20')]===0x1f4){logger[_0xf97b('0x1f')](_0xf97b('0x1e'),_0xf97b('0x1c'),_0x3b31ce[_0xf97b('0x1f')]);}}})['catch'](function(_0x3d1537){logger[_0xf97b('0x1f')](_0xf97b('0x1e'),_0xf97b('0x1c'),_0x3d1537);});}function afterCreateMessage(_0x4b1c33){return function(_0x10b2b2){_0x10b2b2=_0x10b2b2[_0xf97b('0x21')]({'plain':!![]});_0x10b2b2['channel']=_0x4b1c33;_0x10b2b2['motionChannel']=_0x4b1c33;_0x10b2b2['event']=_0x10b2b2[_0xf97b('0x22')];Promise[_0xf97b('0x23')]()[_0xf97b('0x24')](function(){if(typeof _0x10b2b2['ContactId']===_0xf97b('0x25'))return null;var _0x1f9015=_0xf97b('0x26')+_0x10b2b2[_0xf97b('0x27')];return db[_0xf97b('0x28')][_0xf97b('0x29')](_0x1f9015,{'type':db[_0xf97b('0x2a')][_0xf97b('0x2b')][_0xf97b('0x2c')],'raw':!![]});})[_0xf97b('0x24')](function(_0xdc958c){if(_0xdc958c){_0x10b2b2['contact']=_0xdc958c[0x0];}if(typeof _0x10b2b2[_0xf97b('0x2d')]===_0xf97b('0x25'))return;return getAgent(_0x10b2b2[_0xf97b('0x2d')]);})[_0xf97b('0x24')](function(_0x558de2){if(_0x558de2){_0x10b2b2[_0xf97b('0x2e')]=util['format']('SIP/%s',_0x558de2[_0xf97b('0x2f')]);_0x10b2b2[_0xf97b('0x30')]=_0x558de2;_0x10b2b2['channel']=_0x4b1c33;return request({'event':'incomingmessage','message':_0x10b2b2});}else{return request({'event':_0xf97b('0x31'),'message':_0x10b2b2});}})[_0xf97b('0x32')](function(_0x4aaa6f){logger[_0xf97b('0x1f')](_0xf97b('0x1e'),_0xf97b('0x33'),_0x4aaa6f);});};}function afterCreateOfflineMessage(_0x36e2e0){return function(_0x5543c0){_0x5543c0=_0x5543c0[_0xf97b('0x21')]({'plain':!![]});_0x5543c0[_0xf97b('0x34')]=_0x36e2e0;_0x5543c0[_0xf97b('0x35')]=_0x36e2e0;_0x5543c0[_0xf97b('0x36')]=_0xf97b('0x37');return request({'event':_0x5543c0[_0xf97b('0x36')],'message':_0x5543c0});};}function afterCreate(_0x3bda2d,_0x16a72a){return function(_0xe276ff){_0xe276ff=_0xe276ff[_0xf97b('0x21')]({'plain':!![]});_0xe276ff['channel']=_0x3bda2d;_0xe276ff[_0xf97b('0x35')]=_0x3bda2d;_0xe276ff[_0xf97b('0x36')]='opened';Promise[_0xf97b('0x23')]()['then'](function(){var _0x1340c7='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xe276ff['ContactId'];return db['sequelize'][_0xf97b('0x29')](_0x1340c7,{'type':db[_0xf97b('0x2a')]['QueryTypes'][_0xf97b('0x2c')],'raw':!![]});})['then'](function(_0x129f2b){if(_0x129f2b){_0xe276ff[_0xf97b('0x38')]=_0x129f2b[0x0];}if(typeof _0xe276ff[_0xf97b('0x2d')]==='undefined')return;return getAgent(_0xe276ff[_0xf97b('0x2d')]);})[_0xf97b('0x24')](function(_0x326565){if(_0x326565){_0xe276ff[_0xf97b('0x2e')]=util[_0xf97b('0x39')](_0xf97b('0x3a'),_0x326565[_0xf97b('0x2f')]);_0xe276ff[_0xf97b('0x30')]=_0x326565;}return request({'event':_0x16a72a,'message':_0xe276ff});})[_0xf97b('0x32')](function(_0x33fc3e){logger['error']('Trigger,\x20%s',_0xf97b('0x3b'),_0x33fc3e);});};}function afterUpdate(_0x12caed){return function(_0x36c8fd){var _0x3bc1f=_0x36c8fd[_0xf97b('0x3c')](_0xf97b('0x3d'))&&_0x36c8fd[_0xf97b('0x3d')];var _0xf6830f=_0x36c8fd['changed'](_0xf97b('0x3e'));if(_0x3bc1f||_0xf6830f){var _0x273e4f=_0x3bc1f?'closedinteraction':_0xf97b('0x3e');var _0x1f3702=_0x36c8fd[_0xf97b('0x21')]({'plain':!![]});_0x1f3702['channel']=_0x12caed;_0x1f3702[_0xf97b('0x35')]=_0x12caed;_0x1f3702[_0xf97b('0x36')]=_0x3bc1f?_0xf97b('0x3d'):_0xf97b('0x3e');var _0x5c7214='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1f3702['ContactId'];return db['sequelize'][_0xf97b('0x29')](_0x5c7214,{'type':db[_0xf97b('0x2a')][_0xf97b('0x2b')][_0xf97b('0x2c')],'raw':!![]})[_0xf97b('0x24')](function(_0x30847d){if(_0x30847d){_0x1f3702['contact']=_0x30847d[0x0];}if(typeof _0x1f3702['UserId']==='undefined')return;return getAgent(_0x1f3702['UserId']);})[_0xf97b('0x24')](function(_0x51ec81){if(_0x51ec81){_0x1f3702[_0xf97b('0x2e')]=util[_0xf97b('0x39')](_0xf97b('0x3a'),_0x51ec81[_0xf97b('0x2f')]);_0x1f3702[_0xf97b('0x30')]=_0x51ec81;}return request({'event':_0x273e4f,'message':_0x1f3702});})[_0xf97b('0x32')](function(_0x5e8259){logger[_0xf97b('0x1f')](_0xf97b('0x1e'),_0xf97b('0x3f'),_0x5e8259);});}};}function getAgent(_0x4dca2a){return db['User']['find']({'where':{'id':_0x4dca2a},'attributes':['id',_0xf97b('0x2f'),_0xf97b('0x40'),_0xf97b('0x41'),_0xf97b('0x42')],'raw':!![]})['then'](function(_0x550ea0){return _0x550ea0;});}exports[_0xf97b('0x43')]=function(){for(var _0x5aec63=0x0;_0x5aec63=_0x125d23[_0x45fb('0x12')]){throw Error(_0x45fb('0x13'));}_0xa3e678(_0x453f67);})[_0x45fb('0x14')](function(_0x3fab2d){_0xd6a12a(_0x3fab2d);});});}; \ No newline at end of file +var _0xd7e8=['whatsapp','getChannels','isValidChannel','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','agent','User','then','agents','catch','lodash','bluebird','../mysqldb','./license/util','voice','chat','fax'];(function(_0x42f4a4,_0x1cf55b){var _0x3b0fc4=function(_0x2792ca){while(--_0x2792ca){_0x42f4a4['push'](_0x42f4a4['shift']());}};_0x3b0fc4(++_0x1cf55b);}(_0xd7e8,0x1b2));var _0x8d7e=function(_0x23f70f,_0xe1d8b7){_0x23f70f=_0x23f70f-0x0;var _0x6ff872=_0xd7e8[_0x23f70f];return _0x6ff872;};'use strict';var _=require(_0x8d7e('0x0'));var BPromise=require(_0x8d7e('0x1'));var db=require(_0x8d7e('0x2'))['db'];var util=require(_0x8d7e('0x3'));var channels=[_0x8d7e('0x4'),'mail',_0x8d7e('0x5'),_0x8d7e('0x6'),'sms',_0x8d7e('0x7'),'openchannel'];exports[_0x8d7e('0x8')]=function(){return channels;};exports[_0x8d7e('0x9')]=function(_0x36f483){_0x36f483=_0x36f483['toLowerCase']();return _[_0x8d7e('0xa')](channels,_0x36f483);};exports[_0x8d7e('0xb')]=function(_0x26d770,_0x16a4d3,_0x147084,_0x581408){var _0x195d8a={'loginAttempts':_0x16a4d3,'blocked':_0x147084};if(!_[_0x8d7e('0xc')](_0x581408)){_0x195d8a[_0x8d7e('0xd')]=_0x581408;}return _0x26d770[_0x8d7e('0xe')](_0x195d8a);};exports[_0x8d7e('0xf')]=function(_0x474be7){return new BPromise(function(_0x3b25d6,_0x442d7a){var _0x2fd377=0x0;if(_0x474be7['role']!==_0x8d7e('0x10')){_0x3b25d6(_0x474be7);}db[_0x8d7e('0x11')]['count']({'where':{'role':_0x8d7e('0x10'),'online':!![],'id':{'$ne':_0x474be7['id']}}})[_0x8d7e('0x12')](function(_0x3efa26){_0x2fd377=_0x3efa26;return util['getLicense']();})[_0x8d7e('0x12')](function(_0x176771){if(_0x176771&&_0x176771[_0x8d7e('0x13')]&&_0x2fd377>=_0x176771[_0x8d7e('0x13')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x3b25d6(_0x474be7);})[_0x8d7e('0x14')](function(_0x53b77f){_0x442d7a(_0x53b77f);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 4ce6868..5cc5416 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9bde=['exports','../config/logger','message','Internal\x20Server\x20Error','name','Error','inherits','Bad\x20Request','Entity\x20not\x20found','Not\x20Found','OutOfInterval','error','stack','send'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x9bde,0xe1));var _0xe9bd=function(_0x2015f2,_0x54ce9b){_0x2015f2=_0x2015f2-0x0;var _0x4320c3=_0x9bde[_0x2015f2];return _0x4320c3;};'use strict';var util=require('util');var logger=require(_0xe9bd('0x0'))('api');var APIError=function(_0xc79e0b,_0x4c63ca){this[_0xe9bd('0x1')]=_0xc79e0b||_0xe9bd('0x2');this[_0xe9bd('0x3')]=_0x4c63ca||_0xe9bd('0x4');util[_0xe9bd('0x5')](APIError,Error);};var APIBadRequestError=function(_0x1a4d14){this[_0xe9bd('0x1')]=_0x1a4d14||'Bad\x20Request';this[_0xe9bd('0x3')]=_0xe9bd('0x6');util[_0xe9bd('0x5')](APIBadRequestError,APIError);};var APINotFoundError=function(_0xa66ae2){this[_0xe9bd('0x1')]=_0xa66ae2||_0xe9bd('0x7');this[_0xe9bd('0x3')]=_0xe9bd('0x8');util[_0xe9bd('0x5')](APINotFoundError,APIError);};function getStatusCode(_0x45c7ba){switch(_0x45c7ba){case'Bad\x20Request':return 0x190;case'Forbidden',_0xe9bd('0x9'):return 0x193;case _0xe9bd('0x8'):return 0x194;default:return 0x1f4;}}function handleError(_0x2601ac){return function(_0x581ab9){logger[_0xe9bd('0xa')](_0x581ab9[_0xe9bd('0xb')]);var _0x3339f9=getStatusCode(_0x581ab9[_0xe9bd('0x3')]);if(_0x581ab9['name'])delete _0x581ab9[_0xe9bd('0x3')];return _0x2601ac['status'](_0x3339f9)[_0xe9bd('0xc')](_0x581ab9);};}module[_0xe9bd('0xd')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0x878f=['Bad\x20Request','Forbidden','Not\x20Found','error','status','send','exports','../config/logger','api','message','Internal\x20Server\x20Error','name','Error','inherits'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x878f,0x173));var _0xf878=function(_0x558381,_0x281148){_0x558381=_0x558381-0x0;var _0x2cde12=_0x878f[_0x558381];return _0x2cde12;};'use strict';var util=require('util');var logger=require(_0xf878('0x0'))(_0xf878('0x1'));var APIError=function(_0x2e1d23,_0x12df2b){this[_0xf878('0x2')]=_0x2e1d23||_0xf878('0x3');this[_0xf878('0x4')]=_0x12df2b||_0xf878('0x5');util[_0xf878('0x6')](APIError,Error);};var APIBadRequestError=function(_0xcf1927){this[_0xf878('0x2')]=_0xcf1927||'Bad\x20Request';this['name']=_0xf878('0x7');util[_0xf878('0x6')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x59e564){this['message']=_0x59e564||'Entity\x20not\x20found';this[_0xf878('0x4')]='Not\x20Found';util['inherits'](APINotFoundError,APIError);};function getStatusCode(_0x307653){switch(_0x307653){case _0xf878('0x7'):return 0x190;case _0xf878('0x8'),'OutOfInterval':return 0x193;case _0xf878('0x9'):return 0x194;default:return 0x1f4;}}function handleError(_0x1399a3){return function(_0x531b9c){logger[_0xf878('0xa')](_0x531b9c['stack']);var _0x31d3d2=getStatusCode(_0x531b9c[_0xf878('0x4')]);if(_0x531b9c[_0xf878('0x4')])delete _0x531b9c['name'];return _0x1399a3[_0xf878('0xb')](_0x31d3d2)[_0xf878('0xc')](_0x531b9c);};}module[_0xf878('0xd')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 37138f3..01d6eed 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x01f8=['exports','status','render'];(function(_0x3a226c,_0x3609c7){var _0x332b5e=function(_0x5c23fb){while(--_0x5c23fb){_0x3a226c['push'](_0x3a226c['shift']());}};_0x332b5e(++_0x3609c7);}(_0x01f8,0x1a7));var _0x801f=function(_0x2eaaf5,_0x51b661){_0x2eaaf5=_0x2eaaf5-0x0;var _0x1a60eb=_0x01f8[_0x2eaaf5];return _0x1a60eb;};'use strict';module[_0x801f('0x0')][0x194]=function pageNotFound(_0xb11714,_0x110708){var _0x55dbad='404';var _0x5d1561=0x194;var _0xf753cc={'status':_0x5d1561};_0x110708[_0x801f('0x1')](_0xf753cc[_0x801f('0x1')]);_0x110708[_0x801f('0x2')](_0x55dbad,{},function(_0x386362,_0xd73dbb){if(_0x386362){return _0x110708[_0x801f('0x1')](_0xf753cc[_0x801f('0x1')])['json'](_0xf753cc);}_0x110708['send'](_0xd73dbb);});}; \ No newline at end of file +var _0xdcc1=['status','json','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdcc1,0x170));var _0x1dcc=function(_0xb4cc9b,_0x5015a8){_0xb4cc9b=_0xb4cc9b-0x0;var _0x198fe2=_0xdcc1[_0xb4cc9b];return _0x198fe2;};'use strict';module[_0x1dcc('0x0')][0x194]=function pageNotFound(_0x4342cf,_0x1282f6){var _0x119822='404';var _0x17b64d=0x194;var _0x1b471c={'status':_0x17b64d};_0x1282f6[_0x1dcc('0x1')](_0x1b471c[_0x1dcc('0x1')]);_0x1282f6['render'](_0x119822,{},function(_0x15d376,_0x59c910){if(_0x15d376){return _0x1282f6['status'](_0x1b471c[_0x1dcc('0x1')])[_0x1dcc('0x2')](_0x1b471c);}_0x1282f6['send'](_0x59c910);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 8e152e5..a555c4e 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x57aa=['JscriptySessions','TrunkBackup','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Agents','Teams','BlackLists','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','ContactId','MailAccountId','CloudProvider','restrict','CloudProviderId','Imap','Dispositions','Answers','MailMessage','Interactions','List','ListId','TemplateId','team_has_mail_queues','Account','Tag','Tags','mail_interaction_has_tags','ThroughTags','Users','user_has_mail_interactions','MailInteractionId','Attachment','Attachments','Interaction','ChatWebsiteId','TagId','DashboardItem','Items','FaxAccountId','FaxApplication','FaxInteractionId','Owner','fax_interaction_has_tags','UserFaxQueue','SmsAccountId','SmsMessage','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','AttachmentId','team_has_openchannel_queues','ChatApplication','user_has_chat_websites','Agent','Queue','chat_interaction_has_tags','ChatInteractionId','team_has_chat_queues','ChatGroupId','Members','Website','CompanyId','Phones','CmContactId','HopperHistories','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','CampaignId','OwnerId','Condition','All','OneAll','AutomationAllId','Any','ParentId','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','ItemTypeId','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Actions','AnalyticFieldReport','Fields','MetricId','Configurations','AccountId','SalesforceField','Subjects','FieldId','Subject','SubjectId','Description','DescriptionId','Field','VariableId','Descriptions','int_zendesk_configuration_has_tags','FreshdeskField','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowConfiguration','Dynamics365Field','FreshsalesAccount','FreshsalesField','FromId','ToId','SessionId','JscriptyAnswerReport','ProjectId','SquareProject','ChatQueues','team_has_whatsapp_queues','TrunkId','TrunkBackupId','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToQueue','ToMailAccountId','ChatTransferReport','ToChatQueueId','ToChatWebsiteId','ToAccount','FaxTransferReport','FromFaxAccountId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','Queues','voice_queues_has_cm_lists','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','whatsapp_interaction_has_tags','user_has_whatsapp_interactions','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','UserSetting','user','Smtp','exports','../config/environment','sequelize','lodash','determine','defaultsDeep','motion2','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','database','username','password','options','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','UserWhatsappQueue','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','FaxAccount','../api/faxAccount/faxAccount.model','../api/faxApplication/faxApplication.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','OpenchannelQueueReport','../api/chatApplication/chatApplication.model','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','../api/condition/condition.model','Interval','Pause','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','Schedule','Sound','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticMetric','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','ZohoConfiguration','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','ZendeskConfiguration','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','Integration','../api/integration/integration.model','Network','../api/network/network.model','ChatQueueReport','ChatInternalMessage','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareRecording','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','Plugin','MailTransferReport','../api/chatTransferReport/chatTransferReport.model','OpenchannelTransferReport','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','../api/user-setting/user-setting.model','cascade','UserId','hasOne','userSetting','hasMany','Recordings','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteraction','OpenchannelInteractions','ChatInteraction','ChatInteractions','FaxInteraction','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotification','UserNotifications','SenderId','belongsTo','userProfileId','Groups','chat_group_has_users','belongsToMany','Contacts','Lists','cm_user_has_lists','user_has_teams','user_has_chat_interactions','user_has_fax_interactions','SmsInteractions','user_has_sms_interactions','VoiceQueue','VoiceQueues','VoicePrefixes','MailQueues','ChatQueue','FaxQueues','OpenchannelQueues','ChatWebsites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','user_has_sms_accounts','SquareProjects','user_has_square_projects','VoiceChanSpy','SpiedAgents','ChanSpyId','Applications','Sounds','moh_has_sounds','Hoppers','VoiceQueueId','HopperBlacks'];(function(_0x310793,_0x26e9ee){var _0x59c37e=function(_0x471ef7){while(--_0x471ef7){_0x310793['push'](_0x310793['shift']());}};_0x59c37e(++_0x26e9ee);}(_0x57aa,0xb0));var _0xa57a=function(_0x81e39d,_0x4c3934){_0x81e39d=_0x81e39d-0x0;var _0x548fbb=_0x57aa[_0x81e39d];return _0x548fbb;};'use strict';var config=require(_0xa57a('0x0'));var Sequelize=require(_0xa57a('0x1'));var _=require(_0xa57a('0x2'));var jstz=require('jstz');var timezone=jstz[_0xa57a('0x3')]();config[_0xa57a('0x1')]=_[_0xa57a('0x4')](config[_0xa57a('0x1')],{'database':_0xa57a('0x5'),'username':'xcall','password':_0xa57a('0x6'),'options':{'host':_0xa57a('0x7'),'port':0xcea,'dialect':_0xa57a('0x8'),'dialectOptions':{'charset':_0xa57a('0x9')},'logging':![],'timezone':timezone[_0xa57a('0xa')](),'define':{'charset':_0xa57a('0xb'),'collate':_0xa57a('0xc')}}});config[_0xa57a('0xd')]=_[_0xa57a('0x4')](config[_0xa57a('0xd')],{'database':'motion2','username':'xcall','password':'xC@LL1234','options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xa57a('0x8'),'dialectOptions':{'charset':_0xa57a('0x9')},'logging':![],'timezone':timezone[_0xa57a('0xa')](),'define':{'charset':_0xa57a('0xb'),'collate':_0xa57a('0xc')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0xa57a('0xe')],config[_0xa57a('0x1')][_0xa57a('0xf')],config[_0xa57a('0x1')][_0xa57a('0x10')],config[_0xa57a('0x1')][_0xa57a('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xa57a('0xd')]['database'],config[_0xa57a('0xd')][_0xa57a('0xf')],config[_0xa57a('0xd')][_0xa57a('0x10')],config['sequelizeHistory']['options'])};db[_0xa57a('0x12')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0x14'));db['VoiceChanSpy']=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0x15'));db[_0xa57a('0x16')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0x17'));db[_0xa57a('0x18')]=db['sequelize'][_0xa57a('0x13')](_0xa57a('0x19'));db[_0xa57a('0x1a')]=db['sequelize'][_0xa57a('0x13')](_0xa57a('0x1b'));db['VoiceQueue']=db[_0xa57a('0x1')]['import'](_0xa57a('0x1c'));db[_0xa57a('0x1d')]=db[_0xa57a('0x1')]['import'](_0xa57a('0x1e'));db[_0xa57a('0x1f')]=db[_0xa57a('0x1')]['import']('../api/screenRecording/screenRecording.model');db[_0xa57a('0x20')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0x21'));db['VoiceMailMessage']=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0x22'));db[_0xa57a('0x23')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0x24'));db['VoiceDialReport']=db['sequelize']['import'](_0xa57a('0x25'));db['VoiceAgentReport']=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0x26'));db[_0xa57a('0x27')]=db['sequelize'][_0xa57a('0x13')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0xa57a('0x28')]=db['sequelize']['import'](_0xa57a('0x29'));db[_0xa57a('0x2a')]=db['sequelize'][_0xa57a('0x13')](_0xa57a('0x2b'));db['VoiceTransferReport']=db['sequelize']['import']('../api/voiceTransferReport/voiceTransferReport.model');db[_0xa57a('0x2c')]=db[_0xa57a('0x1')]['import'](_0xa57a('0x2d'));db[_0xa57a('0x2e')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0x2f'));db[_0xa57a('0x30')]=db[_0xa57a('0x1')]['import'](_0xa57a('0x31'));db[_0xa57a('0x32')]=db[_0xa57a('0x1')][_0xa57a('0x13')]('../api/userMailQueue/userMailQueue.model');db['UserFaxQueue']=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0x33'));db[_0xa57a('0x34')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0x35'));db[_0xa57a('0x36')]=db[_0xa57a('0x1')][_0xa57a('0x13')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0xa57a('0x37')]=db['sequelize'][_0xa57a('0x13')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0xa57a('0x38')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0x39'));db[_0xa57a('0x3a')]=db['sequelize'][_0xa57a('0x13')](_0xa57a('0x3b'));db[_0xa57a('0x3c')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0x3d'));db[_0xa57a('0x3e')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0x3f'));db[_0xa57a('0x40')]=db['sequelize'][_0xa57a('0x13')](_0xa57a('0x41'));db[_0xa57a('0x42')]=db['sequelize'][_0xa57a('0x13')](_0xa57a('0x43'));db['MailMessage']=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0x44'));db[_0xa57a('0x45')]=db[_0xa57a('0x1')]['import'](_0xa57a('0x46'));db[_0xa57a('0x47')]=db[_0xa57a('0x1')]['import'](_0xa57a('0x48'));db[_0xa57a('0x49')]=db['sequelize'][_0xa57a('0x13')](_0xa57a('0x4a'));db['DashboardItem']=db[_0xa57a('0x1')][_0xa57a('0x13')]('../api/dashboardItem/dashboardItem.model');db[_0xa57a('0x4b')]=db[_0xa57a('0x1')]['import'](_0xa57a('0x4c'));db['FaxApplication']=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0x4d'));db['FaxInteraction']=db[_0xa57a('0x1')][_0xa57a('0x13')]('../api/faxInteraction/faxInteraction.model');db[_0xa57a('0x4e')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0x4f'));db[_0xa57a('0x50')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0x51'));db[_0xa57a('0x52')]=db[_0xa57a('0x1')][_0xa57a('0x13')]('../api/faxQueueReport/faxQueueReport.model');db[_0xa57a('0x53')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0x54'));db[_0xa57a('0x55')]=db['sequelize'][_0xa57a('0x13')](_0xa57a('0x56'));db[_0xa57a('0x57')]=db[_0xa57a('0x1')][_0xa57a('0x13')]('../api/smsInteraction/smsInteraction.model');db['SmsMessage']=db[_0xa57a('0x1')]['import'](_0xa57a('0x58'));db[_0xa57a('0x59')]=db[_0xa57a('0x1')]['import'](_0xa57a('0x5a'));db[_0xa57a('0x5b')]=db['sequelize'][_0xa57a('0x13')](_0xa57a('0x5c'));db[_0xa57a('0x5d')]=db['sequelize']['import'](_0xa57a('0x5e'));db['OpenchannelInteraction']=db[_0xa57a('0x1')]['import'](_0xa57a('0x5f'));db[_0xa57a('0x60')]=db['sequelize'][_0xa57a('0x13')](_0xa57a('0x61'));db[_0xa57a('0x62')]=db['sequelize'][_0xa57a('0x13')](_0xa57a('0x63'));db[_0xa57a('0x64')]=db[_0xa57a('0x1')][_0xa57a('0x13')]('../api/chatWebsite/chatWebsite.model');db[_0xa57a('0x65')]=db[_0xa57a('0x1')][_0xa57a('0x13')]('../api/openchannelQueueReport/openchannelQueueReport.model');db['ChatApplication']=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0x66'));db['ChatInteraction']=db[_0xa57a('0x1')][_0xa57a('0x13')]('../api/chatInteraction/chatInteraction.model');db[_0xa57a('0x67')]=db[_0xa57a('0x1')][_0xa57a('0x13')]('../api/chatMessage/chatMessage.model');db[_0xa57a('0x68')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0x69'));db['ChatQueue']=db[_0xa57a('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0xa57a('0x6a')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0x6b'));db[_0xa57a('0x6c')]=db[_0xa57a('0x1')][_0xa57a('0x13')]('../api/chatProactiveAction/chatProactiveAction.model');db[_0xa57a('0x6d')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0x6e'));db[_0xa57a('0x6f')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0x70'));db[_0xa57a('0x71')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0x72'));db[_0xa57a('0x73')]=db[_0xa57a('0x1')][_0xa57a('0x13')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0xa57a('0x74')]=db[_0xa57a('0x1')][_0xa57a('0x13')]('../api/cmHopperFinal/cmHopperFinal.model');db['CmHopperHistory']=db[_0xa57a('0x1')]['import'](_0xa57a('0x75'));db[_0xa57a('0x76')]=db[_0xa57a('0x1')][_0xa57a('0x13')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0xa57a('0x77')]=db['sequelize'][_0xa57a('0x13')](_0xa57a('0x78'));db[_0xa57a('0x79')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0x7a'));db[_0xa57a('0x7b')]=db['sequelize'][_0xa57a('0x13')](_0xa57a('0x7c'));db[_0xa57a('0x7d')]=db['sequelize'][_0xa57a('0x13')](_0xa57a('0x7e'));db[_0xa57a('0x7f')]=db['sequelize'][_0xa57a('0x13')](_0xa57a('0x80'));db['Condition']=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0x81'));db[_0xa57a('0x82')]=db[_0xa57a('0x1')][_0xa57a('0x13')]('../api/interval/interval.model');db[_0xa57a('0x83')]=db[_0xa57a('0x1')]['import']('../api/pause/pause.model');db[_0xa57a('0x84')]=db['sequelize'][_0xa57a('0x13')](_0xa57a('0x85'));db[_0xa57a('0x86')]=db[_0xa57a('0x1')][_0xa57a('0x13')]('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0xa57a('0x87')]=db[_0xa57a('0x1')][_0xa57a('0x13')]('../api/schedule/schedule.model');db[_0xa57a('0x88')]=db[_0xa57a('0x1')]['import']('../api/sound/sound.model');db['Tag']=db[_0xa57a('0x1')][_0xa57a('0x13')]('../api/tag/tag.model');db[_0xa57a('0x89')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0x8a'));db[_0xa57a('0x8b')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0x8c'));db['CmHopperAdditionalPhone']=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0x8d'));db[_0xa57a('0x8e')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0x8f'));db[_0xa57a('0x90')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0x91'));db[_0xa57a('0x92')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0x93'));db['Integration']=db[_0xa57a('0x1')][_0xa57a('0x13')]('../api/integration/integration.model');db['IntegrationReport']=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0x94'));db[_0xa57a('0x95')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0x96'));db[_0xa57a('0x97')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0x98'));db[_0xa57a('0x99')]=db['sequelize'][_0xa57a('0x13')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0xa57a('0x9a')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0x9b'));db['AnalyticFieldReport']=db[_0xa57a('0x1')]['import'](_0xa57a('0x9c'));db[_0xa57a('0x9d')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0x9e'));db[_0xa57a('0x9f')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0xa0'));db[_0xa57a('0xa1')]=db[_0xa57a('0x1')][_0xa57a('0x13')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db['SalesforceField']=db[_0xa57a('0x1')]['import']('../api/intSalesforceField/intSalesforceField.model');db[_0xa57a('0xa2')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0xa3'));db[_0xa57a('0xa4')]=db[_0xa57a('0x1')]['import'](_0xa57a('0xa5'));db[_0xa57a('0xa6')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0xa7'));db[_0xa57a('0xa8')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0xa9'));db[_0xa57a('0xaa')]=db['sequelize'][_0xa57a('0x13')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0xa57a('0xab')]=db[_0xa57a('0x1')]['import'](_0xa57a('0xac'));db[_0xa57a('0xad')]=db['sequelize'][_0xa57a('0x13')]('../api/intZohoAccount/intZohoAccount.model');db[_0xa57a('0xae')]=db[_0xa57a('0x1')][_0xa57a('0x13')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0xa57a('0xaf')]=db[_0xa57a('0x1')]['import'](_0xa57a('0xb0'));db[_0xa57a('0xb1')]=db[_0xa57a('0x1')]['import']('../api/intZendeskAccount/intZendeskAccount.model');db[_0xa57a('0xb2')]=db[_0xa57a('0x1')][_0xa57a('0x13')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0xa57a('0xb3')]=db['sequelize'][_0xa57a('0x13')](_0xa57a('0xb4'));db[_0xa57a('0xb5')]=db[_0xa57a('0x1')]['import'](_0xa57a('0xb6'));db[_0xa57a('0xb7')]=db[_0xa57a('0x1')]['import'](_0xa57a('0xb8'));db['FreshdeskField']=db[_0xa57a('0x1')]['import']('../api/intFreshdeskField/intFreshdeskField.model');db['VtigerAccount']=db[_0xa57a('0x1')]['import'](_0xa57a('0xb9'));db[_0xa57a('0xba')]=db[_0xa57a('0x1')][_0xa57a('0x13')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0xa57a('0xbb')]=db[_0xa57a('0x1')][_0xa57a('0x13')]('../api/intVtigerField/intVtigerField.model');db[_0xa57a('0xbc')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0xbd'));db['ServicenowConfiguration']=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0xbe'));db[_0xa57a('0xbf')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0xc0'));db[_0xa57a('0xc1')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0xc2'));db[_0xa57a('0xc3')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0xc4'));db['Dynamics365Field']=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0xc5'));db['FreshsalesAccount']=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0xc6'));db[_0xa57a('0xc7')]=db[_0xa57a('0x1')]['import'](_0xa57a('0xc8'));db['FreshsalesField']=db['sequelize'][_0xa57a('0x13')](_0xa57a('0xc9'));db[_0xa57a('0xca')]=db[_0xa57a('0x1')]['import'](_0xa57a('0xcb'));db[_0xa57a('0xcc')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0xcd'));db[_0xa57a('0xce')]=db['sequelize']['import']('../api/chatQueueReport/chatQueueReport.model');db[_0xa57a('0xcf')]=db[_0xa57a('0x1')][_0xa57a('0x13')]('../api/chatInternalMessage/chatInternalMessage.model');db['JscriptyAnswerReport']=db[_0xa57a('0x1')]['import'](_0xa57a('0xd0'));db[_0xa57a('0xd1')]=db[_0xa57a('0x1')][_0xa57a('0x13')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0xa57a('0xd2')]=db['sequelize']['import'](_0xa57a('0xd3'));db[_0xa57a('0xd4')]=db['sequelize'][_0xa57a('0x13')](_0xa57a('0xd5'));db[_0xa57a('0xd6')]=db[_0xa57a('0x1')]['import'](_0xa57a('0xd7'));db[_0xa57a('0xd8')]=db[_0xa57a('0x1')]['import'](_0xa57a('0xd9'));db[_0xa57a('0xda')]=db[_0xa57a('0x1')][_0xa57a('0x13')]('../api/jscriptyProject/jscriptyProject.model');db['Setting']=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0xdb'));db['SquareOdbc']=db[_0xa57a('0x1')]['import'](_0xa57a('0xdc'));db['SquareProject']=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0xdd'));db[_0xa57a('0xde')]=db[_0xa57a('0x1')][_0xa57a('0x13')]('../api/squareRecording/squareRecording.model');db[_0xa57a('0xdf')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0xe0'));db[_0xa57a('0xe1')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0xe2'));db[_0xa57a('0xe3')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0xe4'));db[_0xa57a('0xe5')]=db[_0xa57a('0x1')][_0xa57a('0x13')]('../api/campaign/campaign.model');db['Migration']=db['sequelize'][_0xa57a('0x13')]('../api/migration/migration.model');db['Attachment']=db['sequelize']['import']('../api/attachment/attachment.model');db[_0xa57a('0xe6')]=db[_0xa57a('0x1')][_0xa57a('0x13')]('../api/plugin/plugin.model');db[_0xa57a('0xe7')]=db[_0xa57a('0x1')][_0xa57a('0x13')]('../api/mailTransferReport/mailTransferReport.model');db['ChatTransferReport']=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0xe8'));db['FaxTransferReport']=db[_0xa57a('0x1')]['import']('../api/faxTransferReport/faxTransferReport.model');db[_0xa57a('0xe9')]=db[_0xa57a('0x1')][_0xa57a('0x13')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0xa57a('0xea')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0xeb'));db[_0xa57a('0xec')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0xed'));db[_0xa57a('0xee')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0xef'));db[_0xa57a('0xf0')]=db['sequelize'][_0xa57a('0x13')](_0xa57a('0xf1'));db[_0xa57a('0xf2')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0xf3'));db[_0xa57a('0xf4')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0xf5'));db['UserNotification']=db[_0xa57a('0x1')]['import'](_0xa57a('0xf6'));db[_0xa57a('0xf7')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0xf8'));db['WhatsappApplication']=db[_0xa57a('0x1')]['import'](_0xa57a('0xf9'));db[_0xa57a('0xfa')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0xfb'));db[_0xa57a('0xfc')]=db[_0xa57a('0x1')]['import']('../api/whatsappMessage/whatsappMessage.model');db[_0xa57a('0xfd')]=db[_0xa57a('0x1')][_0xa57a('0x13')]('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0xa57a('0xfe')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0xff'));db[_0xa57a('0x100')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0x101'));db['CloudProvider']=db['sequelize'][_0xa57a('0x13')](_0xa57a('0x102'));db[_0xa57a('0x103')]=db[_0xa57a('0x1')]['import'](_0xa57a('0x104'));db[_0xa57a('0x105')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0x106'));db[_0xa57a('0x107')]=db[_0xa57a('0x1')][_0xa57a('0x13')](_0xa57a('0x108'));db['UserSetting']=db['sequelize']['import'](_0xa57a('0x109'));db['User']['hasOne'](db['VoiceMail'],{'as':_0xa57a('0x20'),'onDelete':_0xa57a('0x10a'),'foreignKey':_0xa57a('0x10b')});db[_0xa57a('0x12')][_0xa57a('0x10c')](db['UserSetting'],{'as':_0xa57a('0x10d'),'onDelete':_0xa57a('0x10a'),'foreignKey':_0xa57a('0x10b')});db[_0xa57a('0x12')][_0xa57a('0x10e')](db['VoiceRecording'],{'as':_0xa57a('0x10f'),'foreignKey':'UserId'});db['User'][_0xa57a('0x10e')](db[_0xa57a('0x2c')],{'as':'VoiceQueuesRt','foreignKey':_0xa57a('0x10b')});db[_0xa57a('0x12')][_0xa57a('0x10e')](db[_0xa57a('0x18')],{'as':_0xa57a('0x110'),'onDelete':'cascade','hooks':!![]});db['User'][_0xa57a('0x10e')](db['CmHopperFinal'],{'as':_0xa57a('0x111'),'foreignKey':_0xa57a('0x10b')});db[_0xa57a('0x12')][_0xa57a('0x10e')](db[_0xa57a('0x112')],{'as':_0xa57a('0x113'),'foreignKey':_0xa57a('0x10b')});db[_0xa57a('0x12')][_0xa57a('0x10e')](db[_0xa57a('0x76')],{'as':_0xa57a('0x76'),'foreignKey':_0xa57a('0x10b')});db[_0xa57a('0x12')]['hasMany'](db[_0xa57a('0x114')],{'as':_0xa57a('0x115'),'foreignKey':_0xa57a('0x10b')});db[_0xa57a('0x12')][_0xa57a('0x10e')](db[_0xa57a('0x116')],{'as':_0xa57a('0x117'),'foreignKey':_0xa57a('0x10b')});db[_0xa57a('0x12')]['hasMany'](db[_0xa57a('0x57')],{'as':'SmsInteractions','foreignKey':_0xa57a('0x10b')});db[_0xa57a('0x12')]['hasMany'](db[_0xa57a('0x118')],{'as':_0xa57a('0x119'),'foreignKey':'UserId'});db['User']['hasMany'](db[_0xa57a('0x42')],{'as':_0xa57a('0x11a'),'foreignKey':'UserId'});db[_0xa57a('0x12')][_0xa57a('0x10e')](db['WhatsappInteraction'],{'as':_0xa57a('0x11b'),'foreignKey':_0xa57a('0x10b')});db['User'][_0xa57a('0x10e')](db[_0xa57a('0x11c')],{'as':_0xa57a('0x11d'),'foreignKey':_0xa57a('0x11e')});db[_0xa57a('0x12')][_0xa57a('0x11f')](db[_0xa57a('0xf0')],{'as':_0xa57a('0xf0'),'foreignKey':_0xa57a('0x120')});db[_0xa57a('0x12')]['belongsToMany'](db[_0xa57a('0x6a')],{'as':_0xa57a('0x121'),'through':_0xa57a('0x122')});db[_0xa57a('0x12')][_0xa57a('0x123')](db[_0xa57a('0x6f')],{'as':_0xa57a('0x124'),'through':'cm_user_has_contacts'});db[_0xa57a('0x12')][_0xa57a('0x123')](db[_0xa57a('0xec')],{'as':_0xa57a('0x125'),'through':_0xa57a('0x126')});db[_0xa57a('0x12')][_0xa57a('0x123')](db[_0xa57a('0xe1')],{'through':_0xa57a('0x127')});db[_0xa57a('0x12')][_0xa57a('0x123')](db['MailInteraction'],{'as':_0xa57a('0x11a'),'through':'user_has_mail_interactions'});db[_0xa57a('0x12')]['belongsToMany'](db[_0xa57a('0x116')],{'as':_0xa57a('0x117'),'through':_0xa57a('0x128')});db[_0xa57a('0x12')][_0xa57a('0x123')](db[_0xa57a('0x118')],{'as':_0xa57a('0x119'),'through':_0xa57a('0x129')});db[_0xa57a('0x12')]['belongsToMany'](db[_0xa57a('0x57')],{'as':_0xa57a('0x12a'),'through':_0xa57a('0x12b')});db[_0xa57a('0x12')][_0xa57a('0x123')](db['OpenchannelInteraction'],{'as':_0xa57a('0x115'),'through':'user_has_openchannel_interactions'});db[_0xa57a('0x12')][_0xa57a('0x123')](db[_0xa57a('0xfa')],{'as':'WhatsappInteractions','through':'user_has_whatsapp_interactions'});db[_0xa57a('0x12')]['belongsToMany'](db[_0xa57a('0x12c')],{'as':_0xa57a('0x12d'),'through':_0xa57a('0x2e'),'required':![]});db[_0xa57a('0x12')][_0xa57a('0x123')](db['VoicePrefix'],{'as':_0xa57a('0x12e'),'through':_0xa57a('0x107'),'required':![]});db['User'][_0xa57a('0x123')](db[_0xa57a('0x3e')],{'as':_0xa57a('0x12f'),'through':_0xa57a('0x32'),'required':![]});db[_0xa57a('0x12')][_0xa57a('0x123')](db[_0xa57a('0x130')],{'as':'ChatQueues','through':_0xa57a('0x30'),'required':![],'hooks':!![]});db[_0xa57a('0x12')][_0xa57a('0x123')](db[_0xa57a('0x50')],{'as':_0xa57a('0x131'),'through':'UserFaxQueue','required':![]});db[_0xa57a('0x12')][_0xa57a('0x123')](db[_0xa57a('0x59')],{'as':'SmsQueues','through':_0xa57a('0x34'),'required':![]});db[_0xa57a('0x12')]['belongsToMany'](db['OpenchannelQueue'],{'as':_0xa57a('0x132'),'through':'UserOpenchannelQueue','required':![]});db[_0xa57a('0x12')][_0xa57a('0x123')](db[_0xa57a('0x100')],{'as':'WhatsappQueues','through':_0xa57a('0x37'),'required':![]});db[_0xa57a('0x12')]['belongsToMany'](db['CmList'],{'through':_0xa57a('0x126')});db[_0xa57a('0x12')]['belongsToMany'](db['ChatWebsite'],{'as':_0xa57a('0x133'),'through':'user_has_chat_websites'});db['User'][_0xa57a('0x123')](db[_0xa57a('0x4b')],{'as':_0xa57a('0x134'),'through':_0xa57a('0x135')});db[_0xa57a('0x12')][_0xa57a('0x123')](db[_0xa57a('0x3c')],{'as':_0xa57a('0x136'),'through':_0xa57a('0x137')});db[_0xa57a('0x12')]['belongsToMany'](db[_0xa57a('0x5b')],{'as':_0xa57a('0x138'),'through':_0xa57a('0x139')});db[_0xa57a('0x12')][_0xa57a('0x123')](db['SmsAccount'],{'as':'SmsAccounts','through':_0xa57a('0x13a')});db['User']['belongsToMany'](db[_0xa57a('0xf7')],{'as':'WhatsappAccounts','through':'user_has_whatsapp_accounts'});db['User'][_0xa57a('0x123')](db['SquareProject'],{'as':_0xa57a('0x13b'),'through':_0xa57a('0x13c')});db[_0xa57a('0x13d')]['hasMany'](db['VoiceExtension'],{'as':_0xa57a('0x13e'),'onDelete':_0xa57a('0x10a'),'foreignKey':_0xa57a('0x13f')});db[_0xa57a('0x16')][_0xa57a('0x10e')](db[_0xa57a('0x18')],{'onDelete':_0xa57a('0x10a')});db[_0xa57a('0x18')][_0xa57a('0x10e')](db[_0xa57a('0x18')],{'as':_0xa57a('0x140'),'onDelete':'cascade'});db['VoiceMusicOnHold']['belongsToMany'](db[_0xa57a('0x88')],{'as':_0xa57a('0x141'),'through':_0xa57a('0x142')});db[_0xa57a('0x12c')]['hasMany'](db[_0xa57a('0x2c')],{'as':'Members','foreignKey':'VoiceQueueId'});db[_0xa57a('0x12c')][_0xa57a('0x10e')](db[_0xa57a('0x71')],{'as':_0xa57a('0x143'),'foreignKey':_0xa57a('0x144')});db[_0xa57a('0x12c')][_0xa57a('0x10e')](db[_0xa57a('0x74')],{'as':_0xa57a('0x111'),'foreignKey':_0xa57a('0x144')});db['VoiceQueue'][_0xa57a('0x10e')](db[_0xa57a('0x112')],{'as':'HopperHistories','foreignKey':_0xa57a('0x144')});db[_0xa57a('0x12c')][_0xa57a('0x10e')](db[_0xa57a('0x76')],{'as':'ReportAgentPreview','foreignKey':_0xa57a('0x144')});db[_0xa57a('0x12c')][_0xa57a('0x10e')](db[_0xa57a('0x73')],{'as':_0xa57a('0x145'),'foreignKey':_0xa57a('0x144')});db[_0xa57a('0x12c')][_0xa57a('0x10e')](db[_0xa57a('0xd2')],{'as':_0xa57a('0x146'),'foreignKey':_0xa57a('0x144')});db[_0xa57a('0x12c')][_0xa57a('0x11f')](db[_0xa57a('0x2a')],{'as':_0xa57a('0x2a'),'foreignKey':'TrunkId'});db[_0xa57a('0x12c')][_0xa57a('0x11f')](db['Trunk'],{'as':_0xa57a('0x147'),'foreignKey':'TrunkBackupId'});db[_0xa57a('0x12c')][_0xa57a('0x11f')](db[_0xa57a('0x82')],{'as':_0xa57a('0x82'),'foreignKey':_0xa57a('0x148')});db[_0xa57a('0x12c')]['belongsTo'](db['Pause'],{'as':_0xa57a('0x149'),'foreignKey':_0xa57a('0x14a')});db[_0xa57a('0x12c')]['belongsToMany'](db[_0xa57a('0xec')],{'as':_0xa57a('0x125'),'through':'voice_queues_has_cm_lists'});db[_0xa57a('0x12c')][_0xa57a('0x123')](db[_0xa57a('0x12')],{'as':_0xa57a('0x14b'),'through':_0xa57a('0x2e')});db[_0xa57a('0x12c')]['belongsToMany'](db[_0xa57a('0xe1')],{'as':_0xa57a('0x14c'),'through':_0xa57a('0x103')});db[_0xa57a('0x12c')][_0xa57a('0x123')](db[_0xa57a('0xec')],{'as':_0xa57a('0x14d'),'through':'voice_queues_has_cm_blacklists'});db[_0xa57a('0x1d')]['belongsTo'](db['User'],{'as':_0xa57a('0x12'),'foreignKey':_0xa57a('0x10b')});db['ScreenRecording'][_0xa57a('0x11f')](db['User'],{'as':_0xa57a('0x12'),'foreignKey':'UserId'});db[_0xa57a('0x20')]['hasMany'](db['VoiceMailMessage'],{'as':_0xa57a('0x14e'),'onDelete':_0xa57a('0x10a'),'foreignKey':_0xa57a('0x14f'),'sourceKey':_0xa57a('0x150')});db['VoiceMailMessage'][_0xa57a('0x11f')](db[_0xa57a('0x20')],{'foreignKey':_0xa57a('0x14f'),'targetKey':_0xa57a('0x150')});db[_0xa57a('0x23')][_0xa57a('0x10e')](db[_0xa57a('0x27')],{'as':_0xa57a('0x151'),'foreignKey':_0xa57a('0x152'),'constraints':![]});db['VoiceCallReport'][_0xa57a('0x10e')](db[_0xa57a('0x153')],{'as':_0xa57a('0x154'),'foreignKey':_0xa57a('0x152'),'constraints':![]});db[_0xa57a('0x23')]['belongsTo'](db['User'],{'as':'User','foreignKey':_0xa57a('0x10b')});db[_0xa57a('0x23')][_0xa57a('0x11f')](db[_0xa57a('0x6f')],{'as':_0xa57a('0x155'),'foreignKey':_0xa57a('0x156')});db['MailServerIn'][_0xa57a('0x11f')](db['MailAccount'],{'as':_0xa57a('0x3c'),'foreignKey':_0xa57a('0x157')});db[_0xa57a('0x38')][_0xa57a('0x11f')](db[_0xa57a('0x158')],{'as':_0xa57a('0x158'),'foreignKey':'CloudProviderId','onDelete':_0xa57a('0x159')});db[_0xa57a('0x3a')]['belongsTo'](db[_0xa57a('0x3c')],{'as':_0xa57a('0x3c'),'foreignKey':_0xa57a('0x157')});db[_0xa57a('0x3a')][_0xa57a('0x11f')](db['CloudProvider'],{'as':'CloudProvider','foreignKey':_0xa57a('0x15a'),'onDelete':'restrict'});db[_0xa57a('0x3c')][_0xa57a('0x10c')](db[_0xa57a('0x38')],{'as':_0xa57a('0x15b'),'onDelete':_0xa57a('0x10a')});db['MailAccount'][_0xa57a('0x10c')](db['MailServerOut'],{'as':'Smtp','onDelete':_0xa57a('0x10a')});db[_0xa57a('0x3c')][_0xa57a('0x10e')](db['Disposition'],{'as':_0xa57a('0x15c'),'foreignKey':'MailAccountId','onDelete':'cascade'});db[_0xa57a('0x3c')][_0xa57a('0x10e')](db[_0xa57a('0x7d')],{'as':_0xa57a('0x15d'),'foreignKey':_0xa57a('0x157')});db['MailAccount'][_0xa57a('0x10e')](db[_0xa57a('0x15e')],{'as':_0xa57a('0x14e'),'foreignKey':_0xa57a('0x157')});db[_0xa57a('0x3c')][_0xa57a('0x10e')](db['MailInteraction'],{'as':_0xa57a('0x15f')});db[_0xa57a('0x3c')][_0xa57a('0x10e')](db[_0xa57a('0x45')],{'as':_0xa57a('0x140')});db['MailAccount']['belongsTo'](db[_0xa57a('0xec')],{'as':_0xa57a('0x160'),'foreignKey':_0xa57a('0x161')});db[_0xa57a('0x3c')][_0xa57a('0x11f')](db[_0xa57a('0x8e')],{'as':_0xa57a('0x8e'),'foreignKey':_0xa57a('0x162')});db[_0xa57a('0x3c')][_0xa57a('0x11f')](db[_0xa57a('0x83')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db['MailAccount'][_0xa57a('0x123')](db['User'],{'as':_0xa57a('0x14b'),'through':_0xa57a('0x137')});db['MailQueue'][_0xa57a('0x123')](db[_0xa57a('0x12')],{'as':'Agents','through':_0xa57a('0x32')});db[_0xa57a('0x3e')][_0xa57a('0x123')](db[_0xa57a('0xe1')],{'through':_0xa57a('0x163'),'as':_0xa57a('0x14c')});db[_0xa57a('0x42')][_0xa57a('0x10e')](db[_0xa57a('0x15e')],{'as':_0xa57a('0x14e'),'onDelete':_0xa57a('0x10a'),'foreignKey':'MailInteractionId'});db[_0xa57a('0x42')]['belongsTo'](db['MailAccount'],{'as':_0xa57a('0x164'),'foreignKey':_0xa57a('0x157')});db[_0xa57a('0x42')][_0xa57a('0x11f')](db[_0xa57a('0x6f')],{'as':_0xa57a('0x155'),'foreignKey':'ContactId'});db[_0xa57a('0x42')][_0xa57a('0x11f')](db[_0xa57a('0x12')],{'as':'Owner','foreignKey':_0xa57a('0x10b')});db[_0xa57a('0x42')][_0xa57a('0x123')](db[_0xa57a('0x165')],{'through':'mail_interaction_has_tags','as':_0xa57a('0x166')});db[_0xa57a('0x42')][_0xa57a('0x123')](db[_0xa57a('0x165')],{'through':_0xa57a('0x167'),'as':_0xa57a('0x168')});db['MailInteraction']['belongsToMany'](db[_0xa57a('0x12')],{'as':_0xa57a('0x169'),'through':_0xa57a('0x16a'),'foreignKey':_0xa57a('0x16b')});db[_0xa57a('0x15e')]['hasMany'](db[_0xa57a('0x16c')],{'as':_0xa57a('0x16d'),'onDelete':'cascade'});db[_0xa57a('0x15e')][_0xa57a('0x11f')](db[_0xa57a('0x12')],{'as':_0xa57a('0x12')});db[_0xa57a('0x15e')][_0xa57a('0x11f')](db['CmContact'],{'onDelete':_0xa57a('0x10a'),'as':_0xa57a('0x155')});db[_0xa57a('0x15e')][_0xa57a('0x11f')](db['MailInteraction'],{'as':_0xa57a('0x16e'),'foreignKey':'MailInteractionId'});db[_0xa57a('0x15e')][_0xa57a('0x11f')](db[_0xa57a('0x3c')],{'as':_0xa57a('0x164'),'foreignKey':_0xa57a('0x157')});db[_0xa57a('0x15e')]['belongsTo'](db[_0xa57a('0x64')],{'as':'ChatWebsite','foreignKey':_0xa57a('0x16f')});db[_0xa57a('0x15e')]['belongsTo'](db[_0xa57a('0x68')],{'as':_0xa57a('0x68'),'foreignKey':'ChatOfflineMessageId'});db[_0xa57a('0x45')]['belongsTo'](db['User'],{'onDelete':'restrict'});db[_0xa57a('0x45')][_0xa57a('0x11f')](db[_0xa57a('0x3e')],{'onDelete':_0xa57a('0x159')});db[_0xa57a('0x45')][_0xa57a('0x11f')](db[_0xa57a('0x3c')],{'onDelete':'restrict'});db[_0xa57a('0x45')]['belongsTo'](db['Interval'],{'onDelete':_0xa57a('0x159'),'foreignKey':_0xa57a('0x148')});db[_0xa57a('0x45')][_0xa57a('0x11f')](db[_0xa57a('0x165')],{'onDelete':_0xa57a('0x159'),'foreignKey':_0xa57a('0x170')});db[_0xa57a('0x47')][_0xa57a('0x11f')](db['MailAccount'],{});db[_0xa57a('0x47')][_0xa57a('0x11f')](db[_0xa57a('0xec')],{'as':'List','foreignKey':_0xa57a('0x161')});db[_0xa57a('0x47')]['belongsTo'](db[_0xa57a('0x6f')],{'as':_0xa57a('0x155'),'foreignKey':'ContactId'});db[_0xa57a('0x47')][_0xa57a('0x11f')](db[_0xa57a('0x42')],{});db['MailQueueReport'][_0xa57a('0x11f')](db[_0xa57a('0x15e')],{});db[_0xa57a('0x47')][_0xa57a('0x11f')](db[_0xa57a('0x12')],{});db['MailQueueReport'][_0xa57a('0x11f')](db[_0xa57a('0x3e')],{});db[_0xa57a('0x49')][_0xa57a('0x10e')](db[_0xa57a('0x171')],{'as':_0xa57a('0x172'),'onDelete':_0xa57a('0x10a')});db[_0xa57a('0x4b')][_0xa57a('0x10e')](db[_0xa57a('0x7f')],{'as':_0xa57a('0x15c'),'foreignKey':_0xa57a('0x173'),'onDelete':_0xa57a('0x10a')});db[_0xa57a('0x4b')][_0xa57a('0x10e')](db[_0xa57a('0x7d')],{'as':'Answers','foreignKey':_0xa57a('0x173')});db[_0xa57a('0x4b')][_0xa57a('0x10e')](db[_0xa57a('0x118')],{'as':_0xa57a('0x15f')});db['FaxAccount'][_0xa57a('0x10e')](db[_0xa57a('0x174')],{'as':_0xa57a('0x140')});db[_0xa57a('0x4b')][_0xa57a('0x10e')](db[_0xa57a('0x18')],{'as':'Exntensions','onDelete':_0xa57a('0x10a')});db[_0xa57a('0x4b')][_0xa57a('0x10e')](db[_0xa57a('0x4e')],{'as':_0xa57a('0x14e')});db[_0xa57a('0x4b')][_0xa57a('0x11f')](db['Trunk'],{'as':_0xa57a('0x2a')});db[_0xa57a('0x4b')]['belongsTo'](db[_0xa57a('0xec')],{'as':_0xa57a('0x160'),'foreignKey':_0xa57a('0x161')});db[_0xa57a('0x4b')][_0xa57a('0x11f')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xa57a('0x14a')});db[_0xa57a('0x4b')]['belongsToMany'](db['User'],{'as':'Agents','through':_0xa57a('0x135')});db[_0xa57a('0x174')][_0xa57a('0x11f')](db[_0xa57a('0x12')],{'onDelete':_0xa57a('0x159')});db['FaxApplication'][_0xa57a('0x11f')](db[_0xa57a('0x50')],{'onDelete':'restrict'});db[_0xa57a('0x174')][_0xa57a('0x11f')](db['FaxAccount'],{'onDelete':_0xa57a('0x159')});db[_0xa57a('0x174')][_0xa57a('0x11f')](db[_0xa57a('0x165')],{'onDelete':_0xa57a('0x159'),'foreignKey':_0xa57a('0x170')});db[_0xa57a('0x118')][_0xa57a('0x10e')](db[_0xa57a('0x4e')],{'as':_0xa57a('0x14e'),'onDelete':'cascade','foreignKey':_0xa57a('0x175')});db['FaxInteraction'][_0xa57a('0x11f')](db['FaxAccount'],{'as':_0xa57a('0x164'),'foreignKey':_0xa57a('0x173')});db[_0xa57a('0x118')]['belongsTo'](db['CmContact'],{'as':_0xa57a('0x155'),'foreignKey':_0xa57a('0x156')});db['FaxInteraction'][_0xa57a('0x11f')](db[_0xa57a('0x12')],{'as':_0xa57a('0x176'),'foreignKey':_0xa57a('0x10b')});db[_0xa57a('0x118')][_0xa57a('0x123')](db[_0xa57a('0x165')],{'through':_0xa57a('0x177'),'as':'Tags'});db[_0xa57a('0x118')][_0xa57a('0x123')](db[_0xa57a('0x165')],{'through':_0xa57a('0x177'),'as':'ThroughTags'});db[_0xa57a('0x118')]['belongsToMany'](db[_0xa57a('0x12')],{'as':_0xa57a('0x169'),'through':_0xa57a('0x129'),'foreignKey':_0xa57a('0x175')});db[_0xa57a('0x4e')][_0xa57a('0x11f')](db[_0xa57a('0x12')],{'onDelete':'cascade','as':_0xa57a('0x12')});db[_0xa57a('0x4e')]['belongsTo'](db[_0xa57a('0x118')],{'as':'Interaction','foreignKey':'FaxInteractionId'});db['FaxMessage']['belongsTo'](db['CmContact'],{'onDelete':'cascade','as':_0xa57a('0x155')});db[_0xa57a('0x4e')]['belongsTo'](db[_0xa57a('0x16c')],{'as':_0xa57a('0x16c'),'foreignKey':'AttachmentId'});db['FaxMessage'][_0xa57a('0x11f')](db[_0xa57a('0x4b')],{'as':'Account','foreignKey':_0xa57a('0x173')});db['FaxQueue'][_0xa57a('0x123')](db[_0xa57a('0x12')],{'as':'Agents','through':_0xa57a('0x178')});db[_0xa57a('0x50')][_0xa57a('0x123')](db[_0xa57a('0xe1')],{'through':'team_has_fax_queues','as':_0xa57a('0x14c')});db[_0xa57a('0x52')][_0xa57a('0x11f')](db[_0xa57a('0x4b')],{});db['FaxQueueReport']['belongsTo'](db[_0xa57a('0xec')],{'as':_0xa57a('0x160'),'foreignKey':'ListId'});db[_0xa57a('0x52')][_0xa57a('0x11f')](db[_0xa57a('0x6f')],{'as':_0xa57a('0x155'),'foreignKey':_0xa57a('0x156')});db[_0xa57a('0x52')][_0xa57a('0x11f')](db[_0xa57a('0x118')],{});db[_0xa57a('0x52')][_0xa57a('0x11f')](db['FaxMessage'],{});db[_0xa57a('0x52')][_0xa57a('0x11f')](db[_0xa57a('0x12')],{});db[_0xa57a('0x52')][_0xa57a('0x11f')](db[_0xa57a('0x50')],{});db[_0xa57a('0x53')][_0xa57a('0x10e')](db[_0xa57a('0x7f')],{'as':'Dispositions','foreignKey':_0xa57a('0x179'),'onDelete':_0xa57a('0x10a')});db[_0xa57a('0x53')]['hasMany'](db[_0xa57a('0x7d')],{'as':'Answers','foreignKey':_0xa57a('0x179')});db[_0xa57a('0x53')]['hasMany'](db[_0xa57a('0x17a')],{'as':_0xa57a('0x14e'),'foreignKey':_0xa57a('0x179')});db[_0xa57a('0x53')]['hasMany'](db['SmsInteraction'],{'as':_0xa57a('0x15f')});db[_0xa57a('0x53')][_0xa57a('0x10e')](db[_0xa57a('0x55')],{'as':_0xa57a('0x140')});db[_0xa57a('0x53')][_0xa57a('0x11f')](db[_0xa57a('0xec')],{'as':_0xa57a('0x160'),'foreignKey':_0xa57a('0x161')});db[_0xa57a('0x53')][_0xa57a('0x11f')](db[_0xa57a('0x83')],{'as':_0xa57a('0x149'),'foreignKey':_0xa57a('0x14a')});db[_0xa57a('0x53')][_0xa57a('0x123')](db['User'],{'as':'Agents','through':_0xa57a('0x13a')});db[_0xa57a('0x55')]['belongsTo'](db[_0xa57a('0x12')],{'onDelete':_0xa57a('0x159')});db[_0xa57a('0x55')][_0xa57a('0x11f')](db[_0xa57a('0x59')],{'onDelete':_0xa57a('0x159')});db[_0xa57a('0x55')]['belongsTo'](db['SmsAccount'],{'onDelete':_0xa57a('0x159')});db[_0xa57a('0x55')][_0xa57a('0x11f')](db['Interval'],{'onDelete':_0xa57a('0x159'),'foreignKey':_0xa57a('0x148')});db[_0xa57a('0x55')][_0xa57a('0x11f')](db[_0xa57a('0x165')],{'onDelete':_0xa57a('0x159'),'foreignKey':'TagId'});db[_0xa57a('0x57')][_0xa57a('0x10e')](db['SmsMessage'],{'as':_0xa57a('0x14e'),'onDelete':_0xa57a('0x10a'),'foreignKey':_0xa57a('0x17b')});db[_0xa57a('0x57')][_0xa57a('0x11f')](db[_0xa57a('0x53')],{'as':_0xa57a('0x164'),'foreignKey':'SmsAccountId'});db['SmsInteraction'][_0xa57a('0x11f')](db['CmContact'],{'as':_0xa57a('0x155'),'foreignKey':_0xa57a('0x156')});db[_0xa57a('0x57')][_0xa57a('0x11f')](db[_0xa57a('0x12')],{'as':_0xa57a('0x176'),'foreignKey':'UserId'});db['SmsInteraction']['belongsToMany'](db['Tag'],{'through':_0xa57a('0x17c'),'as':_0xa57a('0x166')});db[_0xa57a('0x57')][_0xa57a('0x123')](db['Tag'],{'through':_0xa57a('0x17c'),'as':_0xa57a('0x168')});db['SmsInteraction']['belongsToMany'](db[_0xa57a('0x12')],{'as':_0xa57a('0x169'),'through':'user_has_sms_interactions','foreignKey':_0xa57a('0x17b')});db[_0xa57a('0x17a')]['belongsTo'](db['User'],{'as':_0xa57a('0x12')});db['SmsMessage'][_0xa57a('0x11f')](db[_0xa57a('0x6f')],{'onDelete':_0xa57a('0x10a'),'as':_0xa57a('0x155')});db[_0xa57a('0x17a')]['belongsTo'](db[_0xa57a('0x57')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0xa57a('0x17b')});db[_0xa57a('0x17a')]['belongsTo'](db[_0xa57a('0x53')],{'as':_0xa57a('0x164'),'foreignKey':_0xa57a('0x179')});db['SmsQueue'][_0xa57a('0x123')](db[_0xa57a('0x12')],{'as':_0xa57a('0x14b'),'through':_0xa57a('0x34'),'foreignKey':_0xa57a('0x17d')});db[_0xa57a('0x59')][_0xa57a('0x123')](db['Team'],{'through':_0xa57a('0x17e'),'as':_0xa57a('0x14c')});db['OpenchannelAccount'][_0xa57a('0x10e')](db[_0xa57a('0x7f')],{'as':'Dispositions','foreignKey':_0xa57a('0x17f'),'onDelete':_0xa57a('0x10a')});db['OpenchannelAccount']['hasMany'](db['CannedAnswer'],{'as':_0xa57a('0x15d'),'foreignKey':_0xa57a('0x17f')});db[_0xa57a('0x5b')][_0xa57a('0x10e')](db[_0xa57a('0x114')],{'as':_0xa57a('0x15f'),'foreignKey':'OpenchannelAccountId'});db[_0xa57a('0x5b')][_0xa57a('0x10e')](db['OpenchannelMessage'],{'as':'Messages','foreignKey':_0xa57a('0x17f')});db[_0xa57a('0x5b')][_0xa57a('0x10e')](db[_0xa57a('0x5d')],{'as':_0xa57a('0x140'),'foreignKey':_0xa57a('0x17f')});db[_0xa57a('0x5b')][_0xa57a('0x11f')](db['CmList'],{'as':_0xa57a('0x160'),'foreignKey':_0xa57a('0x161')});db[_0xa57a('0x5b')][_0xa57a('0x11f')](db[_0xa57a('0x83')],{'as':_0xa57a('0x149'),'foreignKey':_0xa57a('0x14a')});db[_0xa57a('0x5b')][_0xa57a('0x123')](db['User'],{'as':_0xa57a('0x14b'),'through':_0xa57a('0x139')});db[_0xa57a('0x5d')][_0xa57a('0x11f')](db[_0xa57a('0x12')],{'onDelete':_0xa57a('0x159')});db[_0xa57a('0x5d')][_0xa57a('0x11f')](db[_0xa57a('0x62')],{'onDelete':'restrict','foreignKey':_0xa57a('0x180')});db['OpenchannelApplication'][_0xa57a('0x11f')](db[_0xa57a('0x5b')],{'onDelete':_0xa57a('0x159'),'foreignKey':_0xa57a('0x17f')});db[_0xa57a('0x5d')][_0xa57a('0x11f')](db[_0xa57a('0x82')],{'onDelete':_0xa57a('0x159'),'foreignKey':_0xa57a('0x148')});db['OpenchannelApplication']['belongsTo'](db[_0xa57a('0x165')],{'onDelete':_0xa57a('0x159'),'foreignKey':_0xa57a('0x170')});db['OpenchannelInteraction'][_0xa57a('0x10e')](db['OpenchannelMessage'],{'as':'Messages','onDelete':_0xa57a('0x10a'),'foreignKey':_0xa57a('0x181')});db[_0xa57a('0x114')][_0xa57a('0x11f')](db['OpenchannelAccount'],{'as':'Account','foreignKey':_0xa57a('0x17f')});db[_0xa57a('0x114')][_0xa57a('0x11f')](db['CmContact'],{'as':'Contact','foreignKey':_0xa57a('0x156')});db[_0xa57a('0x114')]['belongsTo'](db['User'],{'as':_0xa57a('0x176'),'foreignKey':_0xa57a('0x10b')});db[_0xa57a('0x114')][_0xa57a('0x123')](db['Tag'],{'through':_0xa57a('0x182'),'as':_0xa57a('0x166')});db[_0xa57a('0x114')][_0xa57a('0x123')](db['Tag'],{'through':_0xa57a('0x182'),'as':_0xa57a('0x168')});db[_0xa57a('0x114')][_0xa57a('0x123')](db[_0xa57a('0x12')],{'as':_0xa57a('0x169'),'through':_0xa57a('0x183'),'foreignKey':_0xa57a('0x181')});db[_0xa57a('0x60')][_0xa57a('0x11f')](db['User'],{'onDelete':_0xa57a('0x10a'),'as':_0xa57a('0x12')});db[_0xa57a('0x60')][_0xa57a('0x11f')](db[_0xa57a('0x6f')],{'onDelete':'cascade','as':_0xa57a('0x155')});db[_0xa57a('0x60')][_0xa57a('0x11f')](db[_0xa57a('0x114')],{'onDelete':_0xa57a('0x10a'),'as':_0xa57a('0x16e'),'foreignKey':'OpenchannelInteractionId'});db[_0xa57a('0x60')][_0xa57a('0x11f')](db[_0xa57a('0x16c')],{'as':_0xa57a('0x16c'),'foreignKey':_0xa57a('0x184')});db[_0xa57a('0x60')]['belongsTo'](db[_0xa57a('0x5b')],{'as':_0xa57a('0x164'),'foreignKey':_0xa57a('0x17f')});db['OpenchannelQueue'][_0xa57a('0x123')](db['User'],{'as':'Agents','through':_0xa57a('0x36'),'foreignKey':_0xa57a('0x180')});db['OpenchannelQueue']['belongsToMany'](db[_0xa57a('0xe1')],{'through':_0xa57a('0x185'),'as':_0xa57a('0x14c')});db[_0xa57a('0x64')][_0xa57a('0x10e')](db[_0xa57a('0x7f')],{'as':_0xa57a('0x15c'),'foreignKey':'ChatWebsiteId','onDelete':_0xa57a('0x10a')});db[_0xa57a('0x64')][_0xa57a('0x10e')](db[_0xa57a('0x7d')],{'as':'Answers','foreignKey':'ChatWebsiteId'});db['ChatWebsite'][_0xa57a('0x10e')](db[_0xa57a('0x6c')],{'as':'ProactiveActions'});db[_0xa57a('0x64')][_0xa57a('0x10e')](db[_0xa57a('0x116')],{'as':'Interactions'});db[_0xa57a('0x64')]['hasMany'](db[_0xa57a('0x186')],{'as':'Applications'});db[_0xa57a('0x64')][_0xa57a('0x10e')](db[_0xa57a('0x67')],{'as':'Messages'});db[_0xa57a('0x64')][_0xa57a('0x11f')](db[_0xa57a('0xec')],{'as':_0xa57a('0x160'),'foreignKey':_0xa57a('0x161')});db[_0xa57a('0x64')][_0xa57a('0x11f')](db[_0xa57a('0x82')],{'as':'Interval','foreignKey':_0xa57a('0x148')});db[_0xa57a('0x64')]['belongsTo'](db[_0xa57a('0x3c')],{'as':'MailAccount','foreignKey':_0xa57a('0x157')});db[_0xa57a('0x64')]['belongsTo'](db[_0xa57a('0x83')],{'as':_0xa57a('0x149'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xa57a('0x64')][_0xa57a('0x123')](db[_0xa57a('0x12')],{'as':_0xa57a('0x14b'),'through':_0xa57a('0x187')});db[_0xa57a('0x65')][_0xa57a('0x11f')](db[_0xa57a('0x5b')],{});db[_0xa57a('0x65')][_0xa57a('0x11f')](db[_0xa57a('0xec')],{'as':_0xa57a('0x160'),'foreignKey':_0xa57a('0x161')});db['OpenchannelQueueReport'][_0xa57a('0x11f')](db[_0xa57a('0x6f')],{'as':_0xa57a('0x155'),'foreignKey':'ContactId'});db[_0xa57a('0x65')][_0xa57a('0x11f')](db[_0xa57a('0x114')],{});db[_0xa57a('0x65')][_0xa57a('0x11f')](db[_0xa57a('0x60')],{});db[_0xa57a('0x65')][_0xa57a('0x11f')](db[_0xa57a('0x12')],{});db[_0xa57a('0x65')][_0xa57a('0x11f')](db[_0xa57a('0x62')],{});db[_0xa57a('0x186')][_0xa57a('0x11f')](db[_0xa57a('0x12')],{'as':_0xa57a('0x188'),'foreignKey':_0xa57a('0x10b'),'onDelete':_0xa57a('0x159')});db['ChatApplication']['belongsTo'](db['ChatQueue'],{'as':_0xa57a('0x189'),'foreignKey':'ChatQueueId','onDelete':_0xa57a('0x159')});db[_0xa57a('0x186')][_0xa57a('0x11f')](db[_0xa57a('0x64')],{'as':'Website','foreignKey':_0xa57a('0x16f'),'onDelete':'restrict'});db[_0xa57a('0x186')]['belongsTo'](db['Tag'],{'onDelete':_0xa57a('0x159'),'foreignKey':'TagId'});db[_0xa57a('0x116')][_0xa57a('0x10e')](db[_0xa57a('0x67')],{'as':_0xa57a('0x14e'),'onDelete':_0xa57a('0x10a'),'foreignKey':'ChatInteractionId'});db[_0xa57a('0x116')][_0xa57a('0x11f')](db[_0xa57a('0x64')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0xa57a('0x116')][_0xa57a('0x11f')](db[_0xa57a('0x6f')],{'as':_0xa57a('0x155'),'foreignKey':_0xa57a('0x156')});db[_0xa57a('0x116')]['belongsTo'](db[_0xa57a('0x12')],{'as':_0xa57a('0x176'),'foreignKey':_0xa57a('0x10b')});db[_0xa57a('0x116')][_0xa57a('0x123')](db[_0xa57a('0x165')],{'through':_0xa57a('0x18a'),'as':_0xa57a('0x166')});db['ChatInteraction'][_0xa57a('0x123')](db[_0xa57a('0x165')],{'through':'chat_interaction_has_tags','as':_0xa57a('0x168')});db[_0xa57a('0x116')][_0xa57a('0x123')](db['User'],{'as':_0xa57a('0x169'),'through':_0xa57a('0x128'),'foreignKey':_0xa57a('0x18b')});db[_0xa57a('0x67')]['belongsTo'](db[_0xa57a('0x12')],{'onDelete':_0xa57a('0x10a'),'as':'User'});db[_0xa57a('0x67')][_0xa57a('0x11f')](db[_0xa57a('0x6f')],{'onDelete':_0xa57a('0x10a'),'as':'Contact','foreignKey':'ContactId'});db['ChatMessage'][_0xa57a('0x11f')](db['ChatInteraction'],{'onDelete':'cascade','as':'Interaction','foreignKey':_0xa57a('0x18b')});db[_0xa57a('0x67')]['belongsTo'](db['Attachment'],{'as':_0xa57a('0x16c'),'foreignKey':_0xa57a('0x184')});db[_0xa57a('0x67')][_0xa57a('0x11f')](db[_0xa57a('0x64')],{'as':_0xa57a('0x164'),'foreignKey':'ChatWebsiteId'});db[_0xa57a('0x68')][_0xa57a('0x10e')](db[_0xa57a('0x16c')],{'as':_0xa57a('0x16d'),'foreignKey':'ChatOfflineMessageId','onDelete':_0xa57a('0x10a'),'hooks':!![]});db['ChatOfflineMessage'][_0xa57a('0x11f')](db['CmContact'],{'onDelete':_0xa57a('0x10a'),'as':'Contact','foreignKey':_0xa57a('0x156')});db[_0xa57a('0x68')]['belongsTo'](db[_0xa57a('0x64')],{'as':_0xa57a('0x164'),'foreignKey':'ChatWebsiteId'});db[_0xa57a('0x130')]['belongsToMany'](db['User'],{'as':_0xa57a('0x14b'),'through':_0xa57a('0x30'),'hooks':!![]});db['ChatQueue'][_0xa57a('0x123')](db[_0xa57a('0xe1')],{'through':_0xa57a('0x18c'),'as':'Teams'});db[_0xa57a('0x6a')][_0xa57a('0x10e')](db[_0xa57a('0xcf')],{'as':_0xa57a('0x14e'),'foreignKey':_0xa57a('0x18d'),'onDelete':_0xa57a('0x10a')});db[_0xa57a('0x6a')][_0xa57a('0x123')](db[_0xa57a('0x12')],{'as':_0xa57a('0x18e'),'through':'chat_group_has_users'});db['ChatProactiveAction'][_0xa57a('0x11f')](db[_0xa57a('0x64')],{'as':_0xa57a('0x18f'),'foreignKey':_0xa57a('0x16f')});db['CmCompany'][_0xa57a('0x10e')](db[_0xa57a('0x6f')],{'as':_0xa57a('0x124'),'foreignKey':_0xa57a('0x190')});db[_0xa57a('0x6f')]['hasMany'](db[_0xa57a('0x8b')],{'as':_0xa57a('0x191'),'foreignKey':_0xa57a('0x192')});db['CmContact'][_0xa57a('0x10e')](db['CmHopper'],{'as':'Hoppers','foreignKey':'ContactId'});db[_0xa57a('0x6f')][_0xa57a('0x10e')](db[_0xa57a('0x74')],{'as':_0xa57a('0x111'),'foreignKey':'ContactId'});db[_0xa57a('0x6f')][_0xa57a('0x10e')](db['CmHopperHistory'],{'as':_0xa57a('0x193'),'foreignKey':_0xa57a('0x156')});db[_0xa57a('0x6f')][_0xa57a('0x10e')](db[_0xa57a('0x76')],{'as':'ReportAgentPreview','foreignKey':_0xa57a('0x156')});db['CmContact'][_0xa57a('0x10e')](db[_0xa57a('0xd2')],{'as':_0xa57a('0x146'),'foreignKey':_0xa57a('0x156')});db[_0xa57a('0x6f')][_0xa57a('0x10e')](db['OpenchannelInteraction'],{'as':_0xa57a('0x115'),'foreignKey':_0xa57a('0x156'),'onDelete':_0xa57a('0x159')});db[_0xa57a('0x6f')]['hasMany'](db[_0xa57a('0x116')],{'as':_0xa57a('0x117'),'foreignKey':_0xa57a('0x156'),'onDelete':_0xa57a('0x159')});db[_0xa57a('0x6f')][_0xa57a('0x10e')](db[_0xa57a('0x57')],{'as':'SmsInteractions','foreignKey':_0xa57a('0x156'),'onDelete':_0xa57a('0x159')});db['CmContact'][_0xa57a('0x10e')](db[_0xa57a('0x118')],{'as':_0xa57a('0x119'),'foreignKey':_0xa57a('0x156'),'onDelete':_0xa57a('0x159')});db['CmContact']['hasMany'](db[_0xa57a('0x42')],{'as':_0xa57a('0x11a'),'foreignKey':'ContactId','onDelete':_0xa57a('0x159')});db[_0xa57a('0x6f')]['belongsTo'](db[_0xa57a('0x6d')],{'as':_0xa57a('0x194'),'foreignKey':'CompanyId'});db['CmContact'][_0xa57a('0x11f')](db[_0xa57a('0xec')],{'as':_0xa57a('0x160'),'foreignKey':'ListId','onDelete':_0xa57a('0x10a')});db[_0xa57a('0x6f')][_0xa57a('0x123')](db[_0xa57a('0x12')],{'as':_0xa57a('0x169'),'through':'cm_user_has_contacts'});db[_0xa57a('0x6f')]['belongsToMany'](db[_0xa57a('0x165')],{'as':'Tags','through':_0xa57a('0x195')});db[_0xa57a('0x6f')][_0xa57a('0x123')](db[_0xa57a('0x165')],{'through':_0xa57a('0x195'),'as':_0xa57a('0x168')});db[_0xa57a('0x71')]['hasMany'](db[_0xa57a('0x196')],{'as':_0xa57a('0x197'),'foreignKey':_0xa57a('0x198')});db[_0xa57a('0x71')][_0xa57a('0x11f')](db['CmContact'],{'as':'Contact','foreignKey':_0xa57a('0x156'),'onDelete':_0xa57a('0x10a')});db['CmHopper'][_0xa57a('0x11f')](db[_0xa57a('0xec')],{'as':_0xa57a('0x160'),'foreignKey':_0xa57a('0x161'),'onDelete':_0xa57a('0x10a')});db[_0xa57a('0x71')][_0xa57a('0x11f')](db[_0xa57a('0x12')],{'as':_0xa57a('0x188'),'foreignKey':'UserId'});db[_0xa57a('0x71')][_0xa57a('0x11f')](db[_0xa57a('0x12c')],{'as':_0xa57a('0x189'),'foreignKey':_0xa57a('0x144'),'onDelete':'cascade'});db[_0xa57a('0x71')][_0xa57a('0x11f')](db['Campaign'],{'as':_0xa57a('0xe5'),'foreignKey':_0xa57a('0x199'),'onDelete':_0xa57a('0x10a')});db[_0xa57a('0x71')]['belongsTo'](db[_0xa57a('0x12')],{'as':_0xa57a('0x176'),'foreignKey':_0xa57a('0x19a')});db[_0xa57a('0x73')][_0xa57a('0x11f')](db['CmContact'],{'as':'Contact','foreignKey':_0xa57a('0x156'),'onDelete':_0xa57a('0x10a')});db[_0xa57a('0x73')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0xa57a('0x161'),'onDelete':'cascade'});db[_0xa57a('0x73')]['belongsTo'](db[_0xa57a('0x12c')],{'as':_0xa57a('0x189'),'foreignKey':'VoiceQueueId','onDelete':_0xa57a('0x10a')});db[_0xa57a('0x73')]['belongsTo'](db[_0xa57a('0xe5')],{'as':_0xa57a('0xe5'),'foreignKey':_0xa57a('0x199'),'onDelete':_0xa57a('0x10a')});db[_0xa57a('0x7b')][_0xa57a('0x10e')](db[_0xa57a('0x19b')],{'as':{'plural':_0xa57a('0x19c'),'singular':_0xa57a('0x19d')},'foreignKey':_0xa57a('0x19e'),'onDelete':_0xa57a('0x10a'),'hooks':!![]});db[_0xa57a('0x7b')][_0xa57a('0x10e')](db['Condition'],{'as':{'plural':_0xa57a('0x19f'),'singular':'OneAny'},'foreignKey':'AutomationAnyId','onDelete':_0xa57a('0x10a'),'hooks':!![]});db[_0xa57a('0x7b')][_0xa57a('0x10e')](db[_0xa57a('0x79')],{'as':'Actions','foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0xa57a('0x7f')][_0xa57a('0x10e')](db[_0xa57a('0x7f')],{'as':_0xa57a('0x15c'),'foreignKey':_0xa57a('0x1a0'),'onDelete':_0xa57a('0x10a')});db[_0xa57a('0x82')][_0xa57a('0x10e')](db[_0xa57a('0x82')],{'as':'Intervals','foreignKey':_0xa57a('0x148'),'onDelete':_0xa57a('0x10a'),'hooks':!![],'required':![]});db['Interval'][_0xa57a('0x10e')](db[_0xa57a('0x18')],{'as':_0xa57a('0x110'),'foreignKey':_0xa57a('0x148'),'onDelete':_0xa57a('0x159')});db[_0xa57a('0x82')][_0xa57a('0x10e')](db['MailApplication'],{'as':_0xa57a('0x1a1'),'foreignKey':_0xa57a('0x148')});db[_0xa57a('0x82')]['hasMany'](db[_0xa57a('0x186')],{'as':_0xa57a('0x1a2'),'foreignKey':_0xa57a('0x148')});db[_0xa57a('0x82')][_0xa57a('0x10e')](db['FaxApplication'],{'as':_0xa57a('0x1a3'),'foreignKey':_0xa57a('0x148')});db[_0xa57a('0x82')][_0xa57a('0x10e')](db[_0xa57a('0x55')],{'as':_0xa57a('0x1a4'),'foreignKey':_0xa57a('0x148')});db[_0xa57a('0x87')][_0xa57a('0x11f')](db['MailAccount'],{});db[_0xa57a('0x87')][_0xa57a('0x11f')](db[_0xa57a('0x97')],{'foreignKey':_0xa57a('0x1a5')});db['Schedule']['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0xa57a('0x1a6')});db[_0xa57a('0x88')][_0xa57a('0x123')](db['VoiceMusicOnHold'],{'as':'Mohs','through':'moh_has_sounds','onDelete':'restrict'});db[_0xa57a('0x165')][_0xa57a('0x123')](db[_0xa57a('0x6f')],{'through':_0xa57a('0x195')});db[_0xa57a('0x165')]['belongsToMany'](db[_0xa57a('0x116')],{'through':_0xa57a('0x18a')});db[_0xa57a('0x165')][_0xa57a('0x123')](db[_0xa57a('0x42')],{'through':_0xa57a('0x167')});db[_0xa57a('0x165')][_0xa57a('0x123')](db['SmsInteraction'],{'through':_0xa57a('0x17c')});db[_0xa57a('0x165')][_0xa57a('0x123')](db[_0xa57a('0x118')],{'through':_0xa57a('0x177')});db[_0xa57a('0x165')][_0xa57a('0x123')](db[_0xa57a('0x114')],{'through':'openchannel_interaction_has_tags'});db[_0xa57a('0x165')]['belongsToMany'](db[_0xa57a('0xfa')],{'through':'whatsapp_interaction_has_tags'});db[_0xa57a('0x8b')]['belongsTo'](db[_0xa57a('0x89')],{'as':'ItemType','foreignKey':_0xa57a('0x1a7')});db[_0xa57a('0x196')]['belongsTo'](db[_0xa57a('0x71')],{'as':'Hopper','foreignKey':_0xa57a('0x198')});db[_0xa57a('0x8b')]['belongsTo'](db[_0xa57a('0x6f')],{'as':_0xa57a('0x155'),'foreignKey':_0xa57a('0x192')});db[_0xa57a('0x90')][_0xa57a('0x10e')](db[_0xa57a('0x19b')],{'as':{'plural':'AllConditions','singular':_0xa57a('0x1a8')},'foreignKey':_0xa57a('0x1a9'),'onDelete':'cascade','hooks':!![]});db[_0xa57a('0x90')]['hasMany'](db['Condition'],{'as':{'plural':_0xa57a('0x1aa'),'singular':_0xa57a('0x1ab')},'foreignKey':_0xa57a('0x1ac'),'onDelete':_0xa57a('0x10a'),'hooks':!![]});db['Trigger'][_0xa57a('0x10e')](db[_0xa57a('0x79')],{'as':_0xa57a('0x1ad'),'foreignKey':'TriggerId','onDelete':'cascade','hooks':!![]});db[_0xa57a('0x95')][_0xa57a('0x10e')](db[_0xa57a('0x1ae')],{'as':_0xa57a('0x1af'),'onDelete':_0xa57a('0x10a'),'foreignKey':_0xa57a('0x1a6'),'hooks':!![]});db['AnalyticDefaultReport']['hasMany'](db[_0xa57a('0x1ae')],{'as':_0xa57a('0x1af'),'onDelete':'cascade','foreignKey':_0xa57a('0x1a5')});db[_0xa57a('0x9a')][_0xa57a('0x10e')](db[_0xa57a('0x1ae')],{'as':'Fields','onDelete':_0xa57a('0x10a'),'foreignKey':_0xa57a('0x1b0')});db[_0xa57a('0x1ae')][_0xa57a('0x11f')](db['AnalyticMetric'],{'foreignKey':'MetricId'});db['SalesforceAccount'][_0xa57a('0x10e')](db[_0xa57a('0xa1')],{'as':_0xa57a('0x1b1'),'onDelete':_0xa57a('0x10a'),'foreignKey':_0xa57a('0x1b2')});db['SalesforceConfiguration'][_0xa57a('0x10e')](db[_0xa57a('0x1b3')],{'as':_0xa57a('0x1b4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0xa57a('0xa1')][_0xa57a('0x10e')](db[_0xa57a('0x1b3')],{'as':'Descriptions','onDelete':_0xa57a('0x10a'),'foreignKey':'DescriptionId'});db[_0xa57a('0xa1')]['hasMany'](db[_0xa57a('0x1b3')],{'as':'Fields','onDelete':_0xa57a('0x10a'),'foreignKey':_0xa57a('0x1b5')});db[_0xa57a('0xa1')][_0xa57a('0x11f')](db['SalesforceAccount'],{'as':'Account','foreignKey':'AccountId'});db[_0xa57a('0x1b3')][_0xa57a('0x10e')](db[_0xa57a('0x1b3')],{'as':_0xa57a('0x1b6'),'foreignKey':_0xa57a('0x1b7')});db['SalesforceField'][_0xa57a('0x10e')](db[_0xa57a('0x1b3')],{'as':_0xa57a('0x1b8'),'foreignKey':_0xa57a('0x1b9')});db[_0xa57a('0x1b3')][_0xa57a('0x10e')](db[_0xa57a('0x1b3')],{'as':_0xa57a('0x1ba'),'foreignKey':_0xa57a('0x1b5')});db['SalesforceField'][_0xa57a('0x11f')](db[_0xa57a('0x92')],{'as':'Variable','foreignKey':_0xa57a('0x1bb')});db[_0xa57a('0xa2')][_0xa57a('0x10e')](db[_0xa57a('0xa4')],{'as':_0xa57a('0x1b1'),'onDelete':'cascade','foreignKey':_0xa57a('0x1b2')});db[_0xa57a('0xa4')][_0xa57a('0x10e')](db[_0xa57a('0xa6')],{'as':_0xa57a('0x1b4'),'onDelete':_0xa57a('0x10a'),'foreignKey':_0xa57a('0x1b7')});db[_0xa57a('0xa4')][_0xa57a('0x10e')](db['SugarcrmField'],{'as':'Descriptions','onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xa57a('0xa4')][_0xa57a('0x10e')](db[_0xa57a('0xa6')],{'as':_0xa57a('0x1af'),'onDelete':_0xa57a('0x10a'),'foreignKey':_0xa57a('0x1b5')});db[_0xa57a('0xa4')][_0xa57a('0x11f')](db[_0xa57a('0xa2')],{'as':_0xa57a('0x164'),'foreignKey':_0xa57a('0x1b2')});db[_0xa57a('0xa6')][_0xa57a('0x10e')](db['SugarcrmField'],{'as':_0xa57a('0x1b6'),'foreignKey':_0xa57a('0x1b7')});db['SugarcrmField'][_0xa57a('0x10e')](db['SugarcrmField'],{'as':_0xa57a('0x1b8'),'foreignKey':_0xa57a('0x1b9')});db[_0xa57a('0xa6')][_0xa57a('0x10e')](db['SugarcrmField'],{'as':_0xa57a('0x1ba'),'foreignKey':_0xa57a('0x1b5')});db[_0xa57a('0xa6')][_0xa57a('0x11f')](db[_0xa57a('0x92')],{'as':'Variable','foreignKey':_0xa57a('0x1bb')});db[_0xa57a('0xa8')][_0xa57a('0x10e')](db['DeskConfiguration'],{'as':_0xa57a('0x1b1'),'onDelete':'cascade','foreignKey':_0xa57a('0x1b2')});db['DeskConfiguration'][_0xa57a('0x10e')](db['DeskField'],{'as':_0xa57a('0x1b4'),'onDelete':_0xa57a('0x10a'),'foreignKey':_0xa57a('0x1b7')});db[_0xa57a('0xaa')][_0xa57a('0x10e')](db['DeskField'],{'as':_0xa57a('0x1bc'),'onDelete':_0xa57a('0x10a'),'foreignKey':_0xa57a('0x1b9')});db[_0xa57a('0xaa')][_0xa57a('0x10e')](db[_0xa57a('0xab')],{'as':'Fields','onDelete':_0xa57a('0x10a'),'foreignKey':_0xa57a('0x1b5')});db[_0xa57a('0xaa')][_0xa57a('0x11f')](db[_0xa57a('0xa8')],{'as':_0xa57a('0x164'),'foreignKey':'AccountId'});db['DeskConfiguration'][_0xa57a('0x123')](db[_0xa57a('0x165')],{'through':'int_desk_configuration_has_tags'});db[_0xa57a('0xab')][_0xa57a('0x10e')](db[_0xa57a('0xab')],{'as':'Subject','foreignKey':_0xa57a('0x1b7')});db[_0xa57a('0xab')]['hasMany'](db['DeskField'],{'as':_0xa57a('0x1b8'),'foreignKey':_0xa57a('0x1b9')});db[_0xa57a('0xab')][_0xa57a('0x10e')](db[_0xa57a('0xab')],{'as':_0xa57a('0x1ba'),'foreignKey':_0xa57a('0x1b5')});db[_0xa57a('0xab')][_0xa57a('0x11f')](db[_0xa57a('0x92')],{'as':_0xa57a('0x92'),'foreignKey':'VariableId'});db['ZohoAccount']['hasMany'](db['ZohoConfiguration'],{'as':_0xa57a('0x1b1'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xa57a('0xae')][_0xa57a('0x10e')](db[_0xa57a('0xaf')],{'as':_0xa57a('0x1b4'),'onDelete':'cascade','foreignKey':_0xa57a('0x1b7')});db[_0xa57a('0xae')]['hasMany'](db[_0xa57a('0xaf')],{'as':_0xa57a('0x1bc'),'onDelete':_0xa57a('0x10a'),'foreignKey':_0xa57a('0x1b9')});db['ZohoConfiguration']['hasMany'](db[_0xa57a('0xaf')],{'as':_0xa57a('0x1af'),'onDelete':_0xa57a('0x10a'),'foreignKey':_0xa57a('0x1b5')});db[_0xa57a('0xae')]['belongsTo'](db[_0xa57a('0xad')],{'as':_0xa57a('0x164'),'foreignKey':_0xa57a('0x1b2')});db[_0xa57a('0xaf')]['hasMany'](db[_0xa57a('0xaf')],{'as':_0xa57a('0x1b6'),'foreignKey':_0xa57a('0x1b7')});db['ZohoField']['hasMany'](db['ZohoField'],{'as':_0xa57a('0x1b8'),'foreignKey':'DescriptionId'});db[_0xa57a('0xaf')][_0xa57a('0x10e')](db[_0xa57a('0xaf')],{'as':_0xa57a('0x1ba'),'foreignKey':_0xa57a('0x1b5')});db[_0xa57a('0xaf')][_0xa57a('0x11f')](db[_0xa57a('0x92')],{'as':_0xa57a('0x92'),'foreignKey':'VariableId'});db[_0xa57a('0xb1')][_0xa57a('0x10e')](db[_0xa57a('0xb2')],{'as':_0xa57a('0x1b1'),'onDelete':_0xa57a('0x10a'),'foreignKey':_0xa57a('0x1b2')});db['ZendeskConfiguration'][_0xa57a('0x10e')](db[_0xa57a('0xb3')],{'as':_0xa57a('0x1b4'),'foreignKey':_0xa57a('0x1b7')});db['ZendeskConfiguration'][_0xa57a('0x10e')](db['ZendeskField'],{'as':_0xa57a('0x1bc'),'foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0xa57a('0x10e')](db[_0xa57a('0xb3')],{'as':_0xa57a('0x1af'),'foreignKey':_0xa57a('0x1b5')});db[_0xa57a('0xb2')]['belongsTo'](db[_0xa57a('0xb1')],{'as':_0xa57a('0x164'),'foreignKey':_0xa57a('0x1b2')});db[_0xa57a('0xb2')][_0xa57a('0x123')](db[_0xa57a('0x165')],{'through':_0xa57a('0x1bd')});db[_0xa57a('0xb3')][_0xa57a('0x10e')](db[_0xa57a('0xb3')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xa57a('0xb3')]['hasMany'](db[_0xa57a('0xb3')],{'as':'Description','foreignKey':_0xa57a('0x1b9')});db[_0xa57a('0xb3')]['hasMany'](db['ZendeskField'],{'as':_0xa57a('0x1ba'),'foreignKey':_0xa57a('0x1b5')});db[_0xa57a('0xb3')][_0xa57a('0x11f')](db[_0xa57a('0x92')],{'as':_0xa57a('0x92'),'foreignKey':_0xa57a('0x1bb')});db[_0xa57a('0xb5')]['hasMany'](db[_0xa57a('0xb7')],{'as':_0xa57a('0x1b1'),'onDelete':_0xa57a('0x10a'),'foreignKey':_0xa57a('0x1b2')});db[_0xa57a('0xb7')][_0xa57a('0x10e')](db['FreshdeskField'],{'as':_0xa57a('0x1b4'),'onDelete':_0xa57a('0x10a'),'foreignKey':_0xa57a('0x1b7')});db['FreshdeskConfiguration']['hasMany'](db[_0xa57a('0x1be')],{'as':_0xa57a('0x1bc'),'onDelete':_0xa57a('0x10a'),'foreignKey':_0xa57a('0x1b9')});db['FreshdeskConfiguration'][_0xa57a('0x10e')](db[_0xa57a('0x1be')],{'as':_0xa57a('0x1af'),'onDelete':'cascade','foreignKey':_0xa57a('0x1b5')});db['FreshdeskConfiguration'][_0xa57a('0x11f')](db[_0xa57a('0xb5')],{'as':_0xa57a('0x164'),'foreignKey':_0xa57a('0x1b2')});db[_0xa57a('0xb7')]['belongsToMany'](db[_0xa57a('0x165')],{'through':_0xa57a('0x1bf')});db['FreshdeskField'][_0xa57a('0x10e')](db[_0xa57a('0x1be')],{'as':_0xa57a('0x1b6'),'foreignKey':_0xa57a('0x1b7')});db[_0xa57a('0x1be')][_0xa57a('0x10e')](db[_0xa57a('0x1be')],{'as':_0xa57a('0x1b8'),'foreignKey':_0xa57a('0x1b9')});db[_0xa57a('0x1be')][_0xa57a('0x10e')](db[_0xa57a('0x1be')],{'as':_0xa57a('0x1ba'),'foreignKey':_0xa57a('0x1b5')});db[_0xa57a('0x1be')][_0xa57a('0x11f')](db[_0xa57a('0x92')],{'as':_0xa57a('0x92'),'foreignKey':'VariableId'});db[_0xa57a('0x1c0')][_0xa57a('0x10e')](db[_0xa57a('0xba')],{'as':'Configurations','onDelete':_0xa57a('0x10a'),'foreignKey':'AccountId'});db['VtigerConfiguration']['hasMany'](db[_0xa57a('0xbb')],{'as':_0xa57a('0x1b4'),'foreignKey':'SubjectId'});db[_0xa57a('0xba')][_0xa57a('0x10e')](db[_0xa57a('0xbb')],{'as':'Descriptions','foreignKey':_0xa57a('0x1b9')});db[_0xa57a('0xba')][_0xa57a('0x10e')](db[_0xa57a('0xbb')],{'as':'Fields','foreignKey':_0xa57a('0x1b5')});db[_0xa57a('0xba')][_0xa57a('0x11f')](db[_0xa57a('0x1c0')],{'as':_0xa57a('0x164'),'foreignKey':_0xa57a('0x1b2')});db[_0xa57a('0xbb')][_0xa57a('0x10e')](db['VtigerField'],{'as':'Subject','foreignKey':_0xa57a('0x1b7')});db[_0xa57a('0xbb')][_0xa57a('0x10e')](db[_0xa57a('0xbb')],{'as':_0xa57a('0x1b8'),'foreignKey':_0xa57a('0x1b9')});db[_0xa57a('0xbb')][_0xa57a('0x10e')](db[_0xa57a('0xbb')],{'as':_0xa57a('0x1ba'),'foreignKey':_0xa57a('0x1b5')});db[_0xa57a('0xbb')][_0xa57a('0x11f')](db['Variable'],{'as':'Variable','foreignKey':_0xa57a('0x1bb')});db['ServicenowAccount'][_0xa57a('0x10e')](db['ServicenowConfiguration'],{'as':_0xa57a('0x1b1'),'onDelete':_0xa57a('0x10a'),'foreignKey':_0xa57a('0x1b2')});db[_0xa57a('0x1c1')]['hasMany'](db[_0xa57a('0xbf')],{'as':_0xa57a('0x1b4'),'foreignKey':_0xa57a('0x1b7')});db[_0xa57a('0x1c1')][_0xa57a('0x10e')](db[_0xa57a('0xbf')],{'as':'Descriptions','foreignKey':_0xa57a('0x1b9')});db[_0xa57a('0x1c1')][_0xa57a('0x10e')](db[_0xa57a('0xbf')],{'as':_0xa57a('0x1af'),'foreignKey':'FieldId'});db[_0xa57a('0x1c1')][_0xa57a('0x11f')](db[_0xa57a('0xbc')],{'as':'Account','foreignKey':_0xa57a('0x1b2')});db[_0xa57a('0xbf')][_0xa57a('0x10e')](db[_0xa57a('0xbf')],{'as':_0xa57a('0x1b6'),'foreignKey':_0xa57a('0x1b7')});db['ServicenowField'][_0xa57a('0x10e')](db['ServicenowField'],{'as':'Description','foreignKey':_0xa57a('0x1b9')});db['ServicenowField']['hasMany'](db[_0xa57a('0xbf')],{'as':_0xa57a('0x1ba'),'foreignKey':'FieldId'});db[_0xa57a('0xbf')][_0xa57a('0x11f')](db['Variable'],{'as':_0xa57a('0x92'),'foreignKey':_0xa57a('0x1bb')});db[_0xa57a('0xc1')][_0xa57a('0x10e')](db['Dynamics365Configuration'],{'as':_0xa57a('0x1b1'),'onDelete':_0xa57a('0x10a'),'foreignKey':_0xa57a('0x1b2')});db[_0xa57a('0xc1')]['belongsTo'](db[_0xa57a('0x158')],{'as':_0xa57a('0x158'),'foreignKey':_0xa57a('0x15a')});db[_0xa57a('0xc3')][_0xa57a('0x10e')](db[_0xa57a('0x1c2')],{'as':_0xa57a('0x1b4'),'onDelete':'cascade','foreignKey':_0xa57a('0x1b7')});db[_0xa57a('0xc3')][_0xa57a('0x10e')](db['Dynamics365Field'],{'as':'Descriptions','onDelete':_0xa57a('0x10a'),'foreignKey':_0xa57a('0x1b9')});db['Dynamics365Configuration'][_0xa57a('0x10e')](db[_0xa57a('0x1c2')],{'as':_0xa57a('0x1af'),'onDelete':_0xa57a('0x10a'),'foreignKey':'FieldId'});db[_0xa57a('0xc3')]['belongsTo'](db[_0xa57a('0xc1')],{'as':_0xa57a('0x164'),'foreignKey':_0xa57a('0x1b2')});db[_0xa57a('0x1c2')][_0xa57a('0x10e')](db[_0xa57a('0x1c2')],{'as':_0xa57a('0x1b6'),'foreignKey':_0xa57a('0x1b7')});db[_0xa57a('0x1c2')][_0xa57a('0x10e')](db[_0xa57a('0x1c2')],{'as':_0xa57a('0x1b8'),'foreignKey':_0xa57a('0x1b9')});db[_0xa57a('0x1c2')]['hasMany'](db[_0xa57a('0x1c2')],{'as':_0xa57a('0x1ba'),'foreignKey':'FieldId'});db['Dynamics365Field']['belongsTo'](db[_0xa57a('0x92')],{'as':_0xa57a('0x92'),'foreignKey':_0xa57a('0x1bb')});db[_0xa57a('0x1c3')][_0xa57a('0x10e')](db[_0xa57a('0xc7')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xa57a('0x1b2')});db['FreshsalesConfiguration'][_0xa57a('0x10e')](db['FreshsalesField'],{'as':_0xa57a('0x1b4'),'foreignKey':_0xa57a('0x1b7')});db[_0xa57a('0xc7')][_0xa57a('0x10e')](db[_0xa57a('0x1c4')],{'as':_0xa57a('0x1bc'),'foreignKey':_0xa57a('0x1b9')});db[_0xa57a('0xc7')][_0xa57a('0x10e')](db['FreshsalesField'],{'as':'Fields','foreignKey':'FieldId'});db['FreshsalesConfiguration'][_0xa57a('0x11f')](db[_0xa57a('0x1c3')],{'as':_0xa57a('0x164'),'foreignKey':_0xa57a('0x1b2')});db[_0xa57a('0x1c4')][_0xa57a('0x10e')](db[_0xa57a('0x1c4')],{'as':'Subject','foreignKey':_0xa57a('0x1b7')});db[_0xa57a('0x1c4')][_0xa57a('0x10e')](db[_0xa57a('0x1c4')],{'as':'Description','foreignKey':'DescriptionId'});db[_0xa57a('0x1c4')][_0xa57a('0x10e')](db[_0xa57a('0x1c4')],{'as':_0xa57a('0x1ba'),'foreignKey':'FieldId'});db[_0xa57a('0x1c4')][_0xa57a('0x11f')](db[_0xa57a('0x92')],{'as':_0xa57a('0x92'),'foreignKey':'VariableId'});db[_0xa57a('0xce')]['belongsTo'](db['ChatWebsite'],{});db[_0xa57a('0xce')][_0xa57a('0x11f')](db[_0xa57a('0xec')],{'as':_0xa57a('0x160'),'foreignKey':_0xa57a('0x161')});db[_0xa57a('0xce')][_0xa57a('0x11f')](db[_0xa57a('0x6f')],{'as':_0xa57a('0x155'),'foreignKey':_0xa57a('0x156')});db[_0xa57a('0xce')][_0xa57a('0x11f')](db[_0xa57a('0x116')],{});db[_0xa57a('0xce')][_0xa57a('0x11f')](db['ChatMessage'],{});db['ChatQueueReport'][_0xa57a('0x11f')](db[_0xa57a('0x12')],{});db['ChatQueueReport'][_0xa57a('0x11f')](db['ChatQueue'],{});db[_0xa57a('0xcf')][_0xa57a('0x11f')](db[_0xa57a('0x12')],{'onDelete':_0xa57a('0x10a'),'foreignKey':_0xa57a('0x1c5')});db[_0xa57a('0xcf')][_0xa57a('0x11f')](db['User'],{'onDelete':_0xa57a('0x10a'),'foreignKey':_0xa57a('0x1c6')});db[_0xa57a('0xd2')][_0xa57a('0x10e')](db[_0xa57a('0xd1')],{'foreignKey':_0xa57a('0x1c7'),'onDelete':_0xa57a('0x10a')});db[_0xa57a('0xd2')]['hasMany'](db[_0xa57a('0x1c8')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0xa57a('0xd4')][_0xa57a('0x11f')](db[_0xa57a('0x53')],{});db[_0xa57a('0xd4')][_0xa57a('0x11f')](db['CmList'],{'as':'List','foreignKey':_0xa57a('0x161')});db[_0xa57a('0xd4')][_0xa57a('0x11f')](db['CmContact'],{'as':_0xa57a('0x155'),'foreignKey':_0xa57a('0x156')});db[_0xa57a('0xd4')][_0xa57a('0x11f')](db[_0xa57a('0x57')],{});db[_0xa57a('0xd4')][_0xa57a('0x11f')](db[_0xa57a('0x17a')],{});db[_0xa57a('0xd4')]['belongsTo'](db[_0xa57a('0x12')],{});db['SmsQueueReport'][_0xa57a('0x11f')](db['SmsQueue'],{});db[_0xa57a('0xda')][_0xa57a('0x10e')](db[_0xa57a('0xd2')],{'foreignKey':_0xa57a('0x1c9')});db[_0xa57a('0xda')]['hasMany'](db[_0xa57a('0xd1')],{'foreignKey':'ProjectId'});db['JscriptyProject'][_0xa57a('0x10e')](db[_0xa57a('0x1c8')],{'foreignKey':'ProjectId'});db[_0xa57a('0x1ca')][_0xa57a('0x123')](db[_0xa57a('0x12')],{'as':_0xa57a('0x169'),'through':_0xa57a('0x13c')});db[_0xa57a('0xe1')][_0xa57a('0x123')](db[_0xa57a('0x12')],{'as':_0xa57a('0x14b'),'through':'user_has_teams'});db[_0xa57a('0xe1')][_0xa57a('0x123')](db['VoiceQueue'],{'through':_0xa57a('0x103'),'as':_0xa57a('0x12d')});db[_0xa57a('0xe1')][_0xa57a('0x123')](db['MailQueue'],{'through':_0xa57a('0x163'),'as':_0xa57a('0x12f')});db['Team'][_0xa57a('0x123')](db[_0xa57a('0x130')],{'through':_0xa57a('0x18c'),'as':_0xa57a('0x1cb')});db[_0xa57a('0xe1')][_0xa57a('0x123')](db[_0xa57a('0x50')],{'through':'team_has_fax_queues','as':_0xa57a('0x131')});db[_0xa57a('0xe1')][_0xa57a('0x123')](db[_0xa57a('0x59')],{'through':_0xa57a('0x17e'),'as':'SmsQueues'});db[_0xa57a('0xe1')][_0xa57a('0x123')](db[_0xa57a('0x62')],{'through':_0xa57a('0x185'),'as':'OpenchannelQueues'});db[_0xa57a('0xe1')][_0xa57a('0x123')](db[_0xa57a('0x100')],{'through':_0xa57a('0x1cc'),'as':'WhatsappQueues'});db['Team'][_0xa57a('0x123')](db[_0xa57a('0xee')],{'through':_0xa57a('0x105'),'as':_0xa57a('0x12e')});db['Campaign']['hasMany'](db[_0xa57a('0x71')],{'as':_0xa57a('0x143'),'foreignKey':_0xa57a('0x199')});db[_0xa57a('0xe5')][_0xa57a('0x10e')](db[_0xa57a('0x74')],{'as':_0xa57a('0x111'),'foreignKey':_0xa57a('0x199')});db[_0xa57a('0xe5')][_0xa57a('0x10e')](db['CmHopperHistory'],{'as':_0xa57a('0x193'),'foreignKey':_0xa57a('0x199')});db['Campaign'][_0xa57a('0x10e')](db[_0xa57a('0x73')],{'as':'HopperBlacks','foreignKey':_0xa57a('0x199')});db['Campaign'][_0xa57a('0x11f')](db[_0xa57a('0x2a')],{'as':_0xa57a('0x2a'),'foreignKey':_0xa57a('0x1cd')});db[_0xa57a('0xe5')]['belongsTo'](db[_0xa57a('0x2a')],{'as':_0xa57a('0x147'),'foreignKey':_0xa57a('0x1ce')});db[_0xa57a('0xe5')][_0xa57a('0x11f')](db[_0xa57a('0x82')],{'as':_0xa57a('0x82'),'foreignKey':_0xa57a('0x148')});db['Campaign'][_0xa57a('0x11f')](db['SquareProject'],{'as':'SquareProject','foreignKey':_0xa57a('0x1cf')});db['Campaign'][_0xa57a('0x123')](db[_0xa57a('0xec')],{'as':_0xa57a('0x125'),'through':_0xa57a('0x1d0')});db['Campaign']['belongsToMany'](db[_0xa57a('0xec')],{'as':'BlackLists','through':_0xa57a('0x1d1')});db[_0xa57a('0x16c')][_0xa57a('0x11f')](db[_0xa57a('0x68')],{'as':'ChatOfflineMessage','foreignKey':'ChatOfflineMessageId'});db[_0xa57a('0xe7')]['belongsTo'](db[_0xa57a('0x15e')],{});db['MailTransferReport'][_0xa57a('0x11f')](db[_0xa57a('0x42')],{});db['MailTransferReport'][_0xa57a('0x11f')](db['MailAccount'],{'foreignKey':_0xa57a('0x1d2'),'as':_0xa57a('0x1d3')});db[_0xa57a('0xe7')]['belongsTo'](db['User'],{'foreignKey':_0xa57a('0x1d4'),'as':_0xa57a('0x1d5')});db[_0xa57a('0xe7')][_0xa57a('0x11f')](db[_0xa57a('0x12')],{'foreignKey':_0xa57a('0x1d6'),'as':_0xa57a('0x1d7')});db[_0xa57a('0xe7')][_0xa57a('0x11f')](db[_0xa57a('0x3e')],{'foreignKey':'ToMailQueueId','as':_0xa57a('0x1d8')});db[_0xa57a('0xe7')][_0xa57a('0x11f')](db['MailAccount'],{'foreignKey':_0xa57a('0x1d9'),'as':'ToAccount'});db[_0xa57a('0x1da')][_0xa57a('0x11f')](db[_0xa57a('0x67')],{});db[_0xa57a('0x1da')]['belongsTo'](db[_0xa57a('0x116')],{});db[_0xa57a('0x1da')][_0xa57a('0x11f')](db[_0xa57a('0x64')],{'foreignKey':'FromChatWebsiteId','as':_0xa57a('0x1d3')});db[_0xa57a('0x1da')][_0xa57a('0x11f')](db[_0xa57a('0x12')],{'foreignKey':_0xa57a('0x1d4'),'as':_0xa57a('0x1d5')});db[_0xa57a('0x1da')][_0xa57a('0x11f')](db[_0xa57a('0x12')],{'foreignKey':_0xa57a('0x1d6'),'as':_0xa57a('0x1d7')});db[_0xa57a('0x1da')][_0xa57a('0x11f')](db['ChatQueue'],{'foreignKey':_0xa57a('0x1db'),'as':_0xa57a('0x1d8')});db[_0xa57a('0x1da')][_0xa57a('0x11f')](db[_0xa57a('0x64')],{'foreignKey':_0xa57a('0x1dc'),'as':_0xa57a('0x1dd')});db[_0xa57a('0x1de')][_0xa57a('0x11f')](db[_0xa57a('0x4e')],{});db['FaxTransferReport'][_0xa57a('0x11f')](db[_0xa57a('0x118')],{});db[_0xa57a('0x1de')][_0xa57a('0x11f')](db[_0xa57a('0x4b')],{'foreignKey':_0xa57a('0x1df'),'as':_0xa57a('0x1d3')});db[_0xa57a('0x1de')]['belongsTo'](db[_0xa57a('0x12')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xa57a('0x1de')]['belongsTo'](db[_0xa57a('0x12')],{'foreignKey':_0xa57a('0x1d6'),'as':'ToAgent'});db[_0xa57a('0x1de')]['belongsTo'](db['FaxQueue'],{'foreignKey':'ToFaxQueueId','as':'ToQueue'});db['FaxTransferReport'][_0xa57a('0x11f')](db[_0xa57a('0x4b')],{'foreignKey':_0xa57a('0x1e0'),'as':'ToAccount'});db[_0xa57a('0xe9')][_0xa57a('0x11f')](db['OpenchannelMessage'],{});db[_0xa57a('0xe9')][_0xa57a('0x11f')](db['OpenchannelInteraction'],{});db[_0xa57a('0xe9')][_0xa57a('0x11f')](db[_0xa57a('0x5b')],{'foreignKey':_0xa57a('0x1e1'),'as':_0xa57a('0x1d3')});db['OpenchannelTransferReport'][_0xa57a('0x11f')](db[_0xa57a('0x12')],{'foreignKey':_0xa57a('0x1d4'),'as':'FromAgent'});db[_0xa57a('0xe9')][_0xa57a('0x11f')](db[_0xa57a('0x12')],{'foreignKey':_0xa57a('0x1d6'),'as':_0xa57a('0x1d7')});db[_0xa57a('0xe9')][_0xa57a('0x11f')](db[_0xa57a('0x62')],{'foreignKey':_0xa57a('0x1e2'),'as':_0xa57a('0x1d8')});db[_0xa57a('0xe9')]['belongsTo'](db[_0xa57a('0x5b')],{'foreignKey':_0xa57a('0x1e3'),'as':_0xa57a('0x1dd')});db[_0xa57a('0xea')][_0xa57a('0x11f')](db[_0xa57a('0x17a')],{});db[_0xa57a('0xea')][_0xa57a('0x11f')](db[_0xa57a('0x57')],{});db[_0xa57a('0xea')][_0xa57a('0x11f')](db[_0xa57a('0x53')],{'foreignKey':_0xa57a('0x1e4'),'as':_0xa57a('0x1d3')});db[_0xa57a('0xea')][_0xa57a('0x11f')](db[_0xa57a('0x12')],{'foreignKey':_0xa57a('0x1d4'),'as':_0xa57a('0x1d5')});db[_0xa57a('0xea')]['belongsTo'](db['User'],{'foreignKey':_0xa57a('0x1d6'),'as':_0xa57a('0x1d7')});db[_0xa57a('0xea')][_0xa57a('0x11f')](db[_0xa57a('0x59')],{'foreignKey':'ToSmsQueueId','as':_0xa57a('0x1d8')});db[_0xa57a('0xea')]['belongsTo'](db[_0xa57a('0x53')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList'][_0xa57a('0x10e')](db['Disposition'],{'as':_0xa57a('0x15c'),'foreignKey':_0xa57a('0x161'),'onDelete':_0xa57a('0x10a')});db[_0xa57a('0xec')][_0xa57a('0x10e')](db[_0xa57a('0x77')],{'as':'CustomFields','foreignKey':_0xa57a('0x161')});db[_0xa57a('0xec')][_0xa57a('0x10e')](db['CmContact'],{'as':_0xa57a('0x124'),'onDelete':'cascade','foreignKey':_0xa57a('0x161')});db[_0xa57a('0xec')]['hasMany'](db['CmHopperFinal'],{'as':_0xa57a('0x111'),'foreignKey':_0xa57a('0x161')});db[_0xa57a('0xec')]['hasMany'](db[_0xa57a('0x112')],{'as':_0xa57a('0x113'),'foreignKey':_0xa57a('0x161')});db['CmList'][_0xa57a('0x10e')](db['ReportAgentPreview'],{'as':_0xa57a('0x76'),'foreignKey':_0xa57a('0x161')});db[_0xa57a('0xec')][_0xa57a('0x123')](db[_0xa57a('0x12c')],{'as':_0xa57a('0x1e5'),'through':_0xa57a('0x1e6')});db[_0xa57a('0xec')][_0xa57a('0x123')](db[_0xa57a('0x12')],{'as':_0xa57a('0x14b'),'through':_0xa57a('0x126')});db[_0xa57a('0xee')][_0xa57a('0x10e')](db[_0xa57a('0x18')],{'as':'Extensions','onDelete':_0xa57a('0x10a')});db[_0xa57a('0xee')]['belongsToMany'](db[_0xa57a('0x12')],{'as':_0xa57a('0x14b'),'through':'UserVoicePrefix'});db['VoicePrefix'][_0xa57a('0x123')](db[_0xa57a('0xe1')],{'through':_0xa57a('0x105'),'as':_0xa57a('0x14c')});db[_0xa57a('0xf0')][_0xa57a('0x10e')](db[_0xa57a('0x12')],{'as':_0xa57a('0x169'),'foreignKey':_0xa57a('0x120')});db[_0xa57a('0xf0')][_0xa57a('0x10e')](db[_0xa57a('0xf2')],{'as':_0xa57a('0x1e7'),'foreignKey':_0xa57a('0x120'),'onDelete':_0xa57a('0x10a')});db[_0xa57a('0xf2')][_0xa57a('0x10e')](db[_0xa57a('0xf4')],{'as':_0xa57a('0x1e8'),'foreignKey':_0xa57a('0x1e9'),'onDelete':'cascade'});db[_0xa57a('0xf7')][_0xa57a('0x10e')](db['Disposition'],{'as':_0xa57a('0x15c'),'foreignKey':_0xa57a('0x1ea'),'onDelete':'cascade'});db['WhatsappAccount'][_0xa57a('0x10e')](db[_0xa57a('0x7d')],{'as':_0xa57a('0x15d'),'foreignKey':'WhatsappAccountId'});db[_0xa57a('0xf7')][_0xa57a('0x10e')](db[_0xa57a('0xfc')],{'as':_0xa57a('0x14e'),'foreignKey':'WhatsappAccountId'});db[_0xa57a('0xf7')][_0xa57a('0x10e')](db[_0xa57a('0xfa')],{'as':_0xa57a('0x15f')});db[_0xa57a('0xf7')][_0xa57a('0x10e')](db[_0xa57a('0x1eb')],{'as':'Applications'});db[_0xa57a('0xf7')][_0xa57a('0x11f')](db[_0xa57a('0xec')],{'as':_0xa57a('0x160'),'foreignKey':'ListId'});db[_0xa57a('0xf7')][_0xa57a('0x11f')](db[_0xa57a('0x83')],{'as':'mandatoryDispositionPause','foreignKey':_0xa57a('0x14a')});db[_0xa57a('0xf7')]['belongsToMany'](db[_0xa57a('0x12')],{'as':_0xa57a('0x14b'),'through':'user_has_whatsapp_accounts'});db[_0xa57a('0x1eb')][_0xa57a('0x11f')](db[_0xa57a('0x12')],{'onDelete':_0xa57a('0x159')});db[_0xa57a('0x1eb')][_0xa57a('0x11f')](db['WhatsappQueue'],{'onDelete':_0xa57a('0x159')});db[_0xa57a('0x1eb')][_0xa57a('0x11f')](db[_0xa57a('0xf7')],{'onDelete':'restrict'});db[_0xa57a('0x1eb')][_0xa57a('0x11f')](db[_0xa57a('0x82')],{'onDelete':_0xa57a('0x159'),'foreignKey':'IntervalId'});db['WhatsappApplication'][_0xa57a('0x11f')](db[_0xa57a('0x165')],{'onDelete':'restrict','foreignKey':_0xa57a('0x170')});db[_0xa57a('0xfa')][_0xa57a('0x10e')](db[_0xa57a('0xfc')],{'as':'Messages','onDelete':_0xa57a('0x10a'),'foreignKey':_0xa57a('0x1ec')});db['WhatsappInteraction'][_0xa57a('0x11f')](db['WhatsappAccount'],{'as':_0xa57a('0x164'),'foreignKey':_0xa57a('0x1ea')});db[_0xa57a('0xfa')]['belongsTo'](db['CmContact'],{'as':_0xa57a('0x155'),'foreignKey':_0xa57a('0x156')});db[_0xa57a('0xfa')][_0xa57a('0x11f')](db['User'],{'as':'Owner','foreignKey':_0xa57a('0x10b')});db['WhatsappInteraction'][_0xa57a('0x123')](db[_0xa57a('0x165')],{'through':_0xa57a('0x1ed'),'as':_0xa57a('0x166')});db[_0xa57a('0xfa')][_0xa57a('0x123')](db[_0xa57a('0x165')],{'through':'whatsapp_interaction_has_tags','as':_0xa57a('0x168')});db['WhatsappInteraction'][_0xa57a('0x123')](db[_0xa57a('0x12')],{'as':_0xa57a('0x169'),'through':_0xa57a('0x1ee'),'foreignKey':_0xa57a('0x1ec')});db[_0xa57a('0xfc')]['belongsTo'](db[_0xa57a('0x12')],{'as':_0xa57a('0x12')});db[_0xa57a('0xfc')][_0xa57a('0x11f')](db['CmContact'],{'onDelete':_0xa57a('0x10a'),'as':'Contact'});db[_0xa57a('0xfc')][_0xa57a('0x11f')](db['WhatsappInteraction'],{'onDelete':_0xa57a('0x10a'),'as':'Interaction','foreignKey':'WhatsappInteractionId'});db[_0xa57a('0xfc')]['belongsTo'](db[_0xa57a('0xf7')],{'as':_0xa57a('0x164'),'foreignKey':_0xa57a('0x1ea')});db[_0xa57a('0xfd')][_0xa57a('0x11f')](db[_0xa57a('0xf7')],{});db[_0xa57a('0xfd')][_0xa57a('0x11f')](db[_0xa57a('0xec')],{'as':_0xa57a('0x160'),'foreignKey':_0xa57a('0x161')});db['WhatsappQueueReport']['belongsTo'](db[_0xa57a('0x6f')],{'as':_0xa57a('0x155'),'foreignKey':_0xa57a('0x156')});db[_0xa57a('0xfd')][_0xa57a('0x11f')](db['WhatsappInteraction'],{});db[_0xa57a('0xfd')][_0xa57a('0x11f')](db[_0xa57a('0x100')],{});db[_0xa57a('0xfd')]['belongsTo'](db[_0xa57a('0xfc')],{});db[_0xa57a('0xfd')][_0xa57a('0x11f')](db[_0xa57a('0x12')],{});db['WhatsappTransferReport'][_0xa57a('0x11f')](db[_0xa57a('0xfc')],{});db[_0xa57a('0xfe')][_0xa57a('0x11f')](db[_0xa57a('0xfa')],{});db[_0xa57a('0xfe')][_0xa57a('0x11f')](db[_0xa57a('0xf7')],{'foreignKey':_0xa57a('0x1ef'),'as':_0xa57a('0x1d3')});db[_0xa57a('0xfe')]['belongsTo'](db[_0xa57a('0xf7')],{'foreignKey':_0xa57a('0x1f0'),'as':_0xa57a('0x1dd')});db[_0xa57a('0xfe')]['belongsTo'](db[_0xa57a('0x100')],{'foreignKey':_0xa57a('0x1f1'),'as':_0xa57a('0x1d8')});db[_0xa57a('0xfe')][_0xa57a('0x11f')](db['User'],{'foreignKey':_0xa57a('0x1d4'),'as':_0xa57a('0x1d5')});db[_0xa57a('0xfe')][_0xa57a('0x11f')](db['User'],{'foreignKey':_0xa57a('0x1d6'),'as':'ToAgent'});db[_0xa57a('0x100')][_0xa57a('0x123')](db[_0xa57a('0x12')],{'as':_0xa57a('0x14b'),'through':_0xa57a('0x37'),'foreignKey':'WhatsappQueueId'});db[_0xa57a('0x100')]['belongsToMany'](db[_0xa57a('0xe1')],{'through':_0xa57a('0x1cc'),'as':'Teams'});db[_0xa57a('0x1f2')][_0xa57a('0x11f')](db[_0xa57a('0x12')],{'as':_0xa57a('0x1f3'),'foreignKey':_0xa57a('0x10b'),'onDelete':_0xa57a('0x10a'),'hooks':!![]});db[_0xa57a('0x158')][_0xa57a('0x10c')](db[_0xa57a('0xc1')],{'as':_0xa57a('0xc1'),'onDelete':'restrict'});db[_0xa57a('0x158')][_0xa57a('0x10c')](db[_0xa57a('0x38')],{'as':_0xa57a('0x15b'),'onDelete':'restrict'});db[_0xa57a('0x158')][_0xa57a('0x10c')](db[_0xa57a('0x3a')],{'as':_0xa57a('0x1f4'),'onDelete':_0xa57a('0x159')});module[_0xa57a('0x1f5')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x14da=['Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','ZohoAccount','ZohoConfiguration','ZohoField','../api/intZohoField/intZohoField.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','FreshdeskAccount','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','CmList','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','WhatsappAccount','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/user-setting/user-setting.model','hasOne','cascade','UserId','UserSetting','userSetting','hasMany','Recordings','VoiceQueuesRt','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteraction','WhatsappInteractions','UserNotification','UserNotifications','SenderId','belongsTo','UserProfile','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','Lists','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueue','VoiceQueues','VoicePrefixes','ChatQueues','SmsQueues','WhatsappQueues','cm_user_has_lists','ChatWebsites','user_has_chat_websites','FaxAccount','MailAccount','MailAccounts','user_has_mail_accounts','user_has_openchannel_accounts','SmsAccount','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','VoiceContext','Applications','Sounds','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','TrunkId','TrunkBackupId','IntervalId','mandatoryDispositionPause','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','VoiceMailMessage','mailboxuser','mailbox','QueueCalls','AgentReports','uniqueid','Contact','ContactId','MailAccountId','CloudProviderId','restrict','Imap','Answers','Interactions','mandatoryDispositionPauseId','team_has_mail_queues','Messages','MailInteractionId','Account','mail_interaction_has_tags','Tags','Users','Interaction','ChatOfflineMessageId','MailApplication','List','ListId','Items','Dispositions','FaxAccountId','FaxApplication','Exntensions','user_has_fax_accounts','TagId','FaxInteractionId','fax_interaction_has_tags','ThroughTags','AttachmentId','team_has_fax_queues','SmsAccountId','Interval','SmsInteractionId','Owner','sms_interaction_has_tags','team_has_sms_queues','OpenchannelAccount','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatWebsiteId','ChatApplication','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','Attachments','team_has_chat_queues','Members','CompanyId','Phones','CmContactId','HopperHistories','Company','cm_contact_has_tags','AdditionalPhones','CmHopperId','CampaignId','OwnerId','AutomationAllId','Any','OneAny','AutomationAnyId','AutomationId','ParentId','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','whatsapp_interaction_has_tags','ItemType','ItemTypeId','Hopper','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','AnalyticDefaultReport','AnalyticMetric','AnalyticFieldReport','MetricId','SubjectId','Descriptions','FieldId','Subject','Description','Configurations','Subjects','DescriptionId','AccountId','VariableId','DeskConfiguration','int_desk_configuration_has_tags','Field','ZendeskAccount','int_zendesk_configuration_has_tags','FreshdeskConfiguration','ServicenowField','Dynamics365Account','Dynamics365Configuration','SessionId','ProjectId','MailQueues','FaxQueues','team_has_whatsapp_queues','TrunkBackup','SquareProjectId','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToMailAccountId','FromChatWebsiteId','FromUserId','ToChatQueueId','ToQueue','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','ToAccount','ToOpenchannelQueueId','SmsTransferReport','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','Extensions','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','Smtp','exports','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','mysql','name','utf8','utf8_general_ci','sequelizeHistory','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','database','password','options','username','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceExtension','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','../api/voiceQueue/voiceQueue.model','VoiceRecording','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','VoiceQueueReport','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','ChatQueue','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','Action','../api/action/action.model','Automation','CannedAnswer'];(function(_0x8c287a,_0x482978){var _0x4e6f7d=function(_0x176f00){while(--_0x176f00){_0x8c287a['push'](_0x8c287a['shift']());}};_0x4e6f7d(++_0x482978);}(_0x14da,0x182));var _0xa14d=function(_0x2da45d,_0x35397b){_0x2da45d=_0x2da45d-0x0;var _0x1012a0=_0x14da[_0x2da45d];return _0x1012a0;};'use strict';var config=require(_0xa14d('0x0'));var Sequelize=require(_0xa14d('0x1'));var _=require(_0xa14d('0x2'));var jstz=require(_0xa14d('0x3'));var timezone=jstz[_0xa14d('0x4')]();config[_0xa14d('0x1')]=_[_0xa14d('0x5')](config[_0xa14d('0x1')],{'database':'motion2','username':'xcall','password':'xC@LL1234','options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xa14d('0x6'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xa14d('0x7')](),'define':{'charset':_0xa14d('0x8'),'collate':_0xa14d('0x9')}}});config[_0xa14d('0xa')]=_[_0xa14d('0x5')](config[_0xa14d('0xa')],{'database':_0xa14d('0xb'),'username':_0xa14d('0xc'),'password':_0xa14d('0xd'),'options':{'host':_0xa14d('0xe'),'port':0xcea,'dialect':_0xa14d('0x6'),'dialectOptions':{'charset':_0xa14d('0xf')},'logging':![],'timezone':timezone[_0xa14d('0x7')](),'define':{'charset':_0xa14d('0x8'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xa14d('0x1')][_0xa14d('0x10')],config[_0xa14d('0x1')]['username'],config[_0xa14d('0x1')][_0xa14d('0x11')],config[_0xa14d('0x1')][_0xa14d('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xa14d('0xa')][_0xa14d('0x10')],config[_0xa14d('0xa')][_0xa14d('0x13')],config[_0xa14d('0xa')][_0xa14d('0x11')],config['sequelizeHistory']['options'])};db[_0xa14d('0x14')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x16'));db[_0xa14d('0x17')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x18'));db['VoiceContext']=db['sequelize'][_0xa14d('0x15')]('../api/voiceContext/voiceContext.model');db[_0xa14d('0x19')]=db[_0xa14d('0x1')][_0xa14d('0x15')]('../api/voiceExtension/voiceExtension.model');db[_0xa14d('0x1a')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x1b'));db['VoiceQueue']=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x1c'));db[_0xa14d('0x1d')]=db[_0xa14d('0x1')][_0xa14d('0x15')]('../api/voiceRecording/voiceRecording.model');db[_0xa14d('0x1e')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x1f'));db[_0xa14d('0x20')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x21'));db['VoiceMailMessage']=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x22'));db[_0xa14d('0x23')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x24'));db[_0xa14d('0x25')]=db[_0xa14d('0x1')]['import'](_0xa14d('0x26'));db[_0xa14d('0x27')]=db[_0xa14d('0x1')]['import']('../api/voiceAgentReport/voiceAgentReport.model');db[_0xa14d('0x28')]=db['sequelize']['import']('../api/voiceQueueReport/voiceQueueReport.model');db[_0xa14d('0x29')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x2a'));db[_0xa14d('0x2b')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x2c'));db[_0xa14d('0x2d')]=db['sequelize']['import'](_0xa14d('0x2e'));db[_0xa14d('0x2f')]=db['sequelize']['import'](_0xa14d('0x30'));db[_0xa14d('0x31')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x32'));db[_0xa14d('0x33')]=db[_0xa14d('0x1')]['import'](_0xa14d('0x34'));db[_0xa14d('0x35')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x36'));db[_0xa14d('0x37')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x38'));db[_0xa14d('0x39')]=db[_0xa14d('0x1')]['import'](_0xa14d('0x3a'));db[_0xa14d('0x3b')]=db[_0xa14d('0x1')]['import'](_0xa14d('0x3c'));db[_0xa14d('0x3d')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x3e'));db[_0xa14d('0x3f')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x40'));db[_0xa14d('0x41')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x42'));db['MailAccount']=db['sequelize'][_0xa14d('0x15')](_0xa14d('0x43'));db[_0xa14d('0x44')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x45'));db[_0xa14d('0x46')]=db[_0xa14d('0x1')]['import'](_0xa14d('0x47'));db[_0xa14d('0x48')]=db[_0xa14d('0x1')][_0xa14d('0x15')]('../api/mailInteraction/mailInteraction.model');db[_0xa14d('0x49')]=db[_0xa14d('0x1')][_0xa14d('0x15')]('../api/mailMessage/mailMessage.model');db['MailApplication']=db[_0xa14d('0x1')]['import'](_0xa14d('0x4a'));db[_0xa14d('0x4b')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x4c'));db[_0xa14d('0x4d')]=db['sequelize'][_0xa14d('0x15')](_0xa14d('0x4e'));db[_0xa14d('0x4f')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x50'));db['FaxAccount']=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x51'));db['FaxApplication']=db[_0xa14d('0x1')][_0xa14d('0x15')]('../api/faxApplication/faxApplication.model');db[_0xa14d('0x52')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x53'));db[_0xa14d('0x54')]=db[_0xa14d('0x1')]['import']('../api/faxMessage/faxMessage.model');db[_0xa14d('0x55')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x56'));db[_0xa14d('0x57')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x58'));db['SmsAccount']=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x59'));db[_0xa14d('0x5a')]=db['sequelize'][_0xa14d('0x15')](_0xa14d('0x5b'));db[_0xa14d('0x5c')]=db[_0xa14d('0x1')]['import'](_0xa14d('0x5d'));db[_0xa14d('0x5e')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x5f'));db[_0xa14d('0x60')]=db[_0xa14d('0x1')]['import'](_0xa14d('0x61'));db['OpenchannelAccount']=db[_0xa14d('0x1')]['import'](_0xa14d('0x62'));db[_0xa14d('0x63')]=db['sequelize'][_0xa14d('0x15')](_0xa14d('0x64'));db[_0xa14d('0x65')]=db['sequelize'][_0xa14d('0x15')](_0xa14d('0x66'));db[_0xa14d('0x67')]=db[_0xa14d('0x1')][_0xa14d('0x15')]('../api/openchannelMessage/openchannelMessage.model');db[_0xa14d('0x68')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x69'));db[_0xa14d('0x6a')]=db['sequelize'][_0xa14d('0x15')](_0xa14d('0x6b'));db[_0xa14d('0x6c')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db['ChatApplication']=db['sequelize'][_0xa14d('0x15')]('../api/chatApplication/chatApplication.model');db[_0xa14d('0x6d')]=db[_0xa14d('0x1')][_0xa14d('0x15')]('../api/chatInteraction/chatInteraction.model');db[_0xa14d('0x6e')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x6f'));db[_0xa14d('0x70')]=db[_0xa14d('0x1')][_0xa14d('0x15')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0xa14d('0x71')]=db[_0xa14d('0x1')][_0xa14d('0x15')]('../api/chatQueue/chatQueue.model');db[_0xa14d('0x72')]=db[_0xa14d('0x1')][_0xa14d('0x15')]('../api/chatGroup/chatGroup.model');db[_0xa14d('0x73')]=db['sequelize'][_0xa14d('0x15')](_0xa14d('0x74'));db[_0xa14d('0x75')]=db['sequelize']['import']('../api/cmCompany/cmCompany.model');db[_0xa14d('0x76')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x77'));db[_0xa14d('0x78')]=db['sequelize'][_0xa14d('0x15')](_0xa14d('0x79'));db[_0xa14d('0x7a')]=db['sequelize']['import']('../api/cmHopperBlack/cmHopperBlack.model');db[_0xa14d('0x7b')]=db[_0xa14d('0x1')]['import'](_0xa14d('0x7c'));db[_0xa14d('0x7d')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x7e'));db[_0xa14d('0x7f')]=db['sequelize'][_0xa14d('0x15')](_0xa14d('0x80'));db[_0xa14d('0x81')]=db[_0xa14d('0x1')]['import']('../api/cmCustomField/cmCustomField.model');db[_0xa14d('0x82')]=db['sequelize'][_0xa14d('0x15')](_0xa14d('0x83'));db[_0xa14d('0x84')]=db[_0xa14d('0x1')][_0xa14d('0x15')]('../api/automation/automation.model');db[_0xa14d('0x85')]=db[_0xa14d('0x1')][_0xa14d('0x15')]('../api/cannedAnswer/cannedAnswer.model');db[_0xa14d('0x86')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x87'));db[_0xa14d('0x88')]=db['sequelize'][_0xa14d('0x15')](_0xa14d('0x89'));db['Interval']=db[_0xa14d('0x1')]['import'](_0xa14d('0x8a'));db[_0xa14d('0x8b')]=db[_0xa14d('0x1')]['import'](_0xa14d('0x8c'));db[_0xa14d('0x8d')]=db['sequelize'][_0xa14d('0x15')]('../api/cdr/cdr.model');db[_0xa14d('0x8e')]=db['sequelize'][_0xa14d('0x15')](_0xa14d('0x8f'));db[_0xa14d('0x90')]=db[_0xa14d('0x1')][_0xa14d('0x15')]('../api/schedule/schedule.model');db[_0xa14d('0x91')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x92'));db[_0xa14d('0x93')]=db['sequelize'][_0xa14d('0x15')](_0xa14d('0x94'));db[_0xa14d('0x95')]=db[_0xa14d('0x1')][_0xa14d('0x15')]('../api/contactItemType/contactItemType.model');db[_0xa14d('0x96')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x97'));db[_0xa14d('0x98')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x99'));db[_0xa14d('0x9a')]=db['sequelize'][_0xa14d('0x15')](_0xa14d('0x9b'));db[_0xa14d('0x9c')]=db[_0xa14d('0x1')]['import']('../api/trigger/trigger.model');db[_0xa14d('0x9d')]=db['sequelize'][_0xa14d('0x15')](_0xa14d('0x9e'));db[_0xa14d('0x9f')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0xa0'));db[_0xa14d('0xa1')]=db['sequelize'][_0xa14d('0x15')](_0xa14d('0xa2'));db[_0xa14d('0xa3')]=db[_0xa14d('0x1')]['import'](_0xa14d('0xa4'));db['AnalyticDefaultReport']=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0xa5'));db[_0xa14d('0xa6')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0xa7'));db['AnalyticMetric']=db[_0xa14d('0x1')][_0xa14d('0x15')]('../api/analyticMetric/analyticMetric.model');db['AnalyticFieldReport']=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0xa8'));db[_0xa14d('0xa9')]=db[_0xa14d('0x1')][_0xa14d('0x15')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0xa14d('0xaa')]=db[_0xa14d('0x1')]['import'](_0xa14d('0xab'));db[_0xa14d('0xac')]=db[_0xa14d('0x1')][_0xa14d('0x15')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0xa14d('0xad')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0xae'));db[_0xa14d('0xaf')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0xb0'));db[_0xa14d('0xb1')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0xb2'));db[_0xa14d('0xb3')]=db[_0xa14d('0x1')]['import'](_0xa14d('0xb4'));db[_0xa14d('0xb5')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0xb6'));db['DeskConfiguration']=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0xb7'));db[_0xa14d('0xb8')]=db[_0xa14d('0x1')]['import']('../api/intDeskField/intDeskField.model');db[_0xa14d('0xb9')]=db[_0xa14d('0x1')][_0xa14d('0x15')]('../api/intZohoAccount/intZohoAccount.model');db[_0xa14d('0xba')]=db['sequelize'][_0xa14d('0x15')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0xa14d('0xbb')]=db['sequelize'][_0xa14d('0x15')](_0xa14d('0xbc'));db['ZendeskAccount']=db[_0xa14d('0x1')][_0xa14d('0x15')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0xa14d('0xbd')]=db['sequelize'][_0xa14d('0x15')](_0xa14d('0xbe'));db[_0xa14d('0xbf')]=db[_0xa14d('0x1')][_0xa14d('0x15')]('../api/intZendeskField/intZendeskField.model');db[_0xa14d('0xc0')]=db[_0xa14d('0x1')][_0xa14d('0x15')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0xa14d('0x15')](_0xa14d('0xc1'));db[_0xa14d('0xc2')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0xc3'));db[_0xa14d('0xc4')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0xc5'));db[_0xa14d('0xc6')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0xc7'));db[_0xa14d('0xc8')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0xc9'));db[_0xa14d('0xca')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0xcb'));db[_0xa14d('0xcc')]=db[_0xa14d('0x1')]['import']('../api/intServicenowConfiguration/intServicenowConfiguration.model');db['ServicenowField']=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0xcd'));db['Dynamics365Account']=db[_0xa14d('0x1')]['import'](_0xa14d('0xce'));db['Dynamics365Configuration']=db[_0xa14d('0x1')]['import'](_0xa14d('0xcf'));db[_0xa14d('0xd0')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0xd1'));db[_0xa14d('0xd2')]=db['sequelize'][_0xa14d('0x15')](_0xa14d('0xd3'));db[_0xa14d('0xd4')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0xd5'));db[_0xa14d('0xd6')]=db['sequelize'][_0xa14d('0x15')](_0xa14d('0xd7'));db[_0xa14d('0x9f')]=db['sequelize'][_0xa14d('0x15')](_0xa14d('0xa0'));db[_0xa14d('0xd8')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0xd9'));db[_0xa14d('0xda')]=db['sequelize']['import'](_0xa14d('0xdb'));db[_0xa14d('0xdc')]=db[_0xa14d('0x1')]['import'](_0xa14d('0xdd'));db[_0xa14d('0xde')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0xdf'));db[_0xa14d('0xe0')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0xe1'));db[_0xa14d('0xe2')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0xe3'));db[_0xa14d('0xe4')]=db[_0xa14d('0x1')][_0xa14d('0x15')]('../api/smsQueueReport/smsQueueReport.model');db[_0xa14d('0xe5')]=db[_0xa14d('0x1')]['import'](_0xa14d('0xe6'));db[_0xa14d('0xe7')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0xe8'));db[_0xa14d('0xe9')]=db[_0xa14d('0x1')][_0xa14d('0x15')]('../api/jscriptyProject/jscriptyProject.model');db[_0xa14d('0xea')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0xeb'));db[_0xa14d('0xec')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0xed'));db[_0xa14d('0xee')]=db['sequelize'][_0xa14d('0x15')](_0xa14d('0xef'));db[_0xa14d('0xf0')]=db['sequelize'][_0xa14d('0x15')]('../api/squareRecording/squareRecording.model');db['SquareMessage']=db['sequelize']['import'](_0xa14d('0xf1'));db[_0xa14d('0xf2')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0xf3'));db['License']=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0xf4'));db[_0xa14d('0xf5')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0xf6'));db[_0xa14d('0xf7')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0xf8'));db[_0xa14d('0xf9')]=db['sequelize']['import'](_0xa14d('0xfa'));db[_0xa14d('0xfb')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0xfc'));db[_0xa14d('0xfd')]=db['sequelize']['import']('../api/mailTransferReport/mailTransferReport.model');db[_0xa14d('0xfe')]=db[_0xa14d('0x1')]['import'](_0xa14d('0xff'));db[_0xa14d('0x100')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x101'));db[_0xa14d('0x102')]=db[_0xa14d('0x1')]['import'](_0xa14d('0x103'));db['SmsTransferReport']=db[_0xa14d('0x1')][_0xa14d('0x15')]('../api/smsTransferReport/smsTransferReport.model');db[_0xa14d('0x104')]=db[_0xa14d('0x1')]['import']('../api/cmList/cmList.model');db[_0xa14d('0x105')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x106'));db['UserProfile']=db['sequelize'][_0xa14d('0x15')]('../api/userProfile/userProfile.model');db[_0xa14d('0x107')]=db[_0xa14d('0x1')]['import'](_0xa14d('0x108'));db[_0xa14d('0x109')]=db['sequelize']['import'](_0xa14d('0x10a'));db['UserNotification']=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x10b'));db[_0xa14d('0x10c')]=db[_0xa14d('0x1')]['import']('../api/whatsappAccount/whatsappAccount.model');db[_0xa14d('0x10d')]=db['sequelize'][_0xa14d('0x15')](_0xa14d('0x10e'));db['WhatsappInteraction']=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x10f'));db[_0xa14d('0x110')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x111'));db[_0xa14d('0x112')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x113'));db[_0xa14d('0x114')]=db['sequelize'][_0xa14d('0x15')](_0xa14d('0x115'));db[_0xa14d('0x116')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x117'));db[_0xa14d('0x118')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x119'));db[_0xa14d('0x11a')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x11b'));db[_0xa14d('0x11c')]=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x11d'));db[_0xa14d('0x11e')]=db[_0xa14d('0x1')][_0xa14d('0x15')]('../api/userVoicePrefix/userVoicePrefix.model');db['UserSetting']=db[_0xa14d('0x1')][_0xa14d('0x15')](_0xa14d('0x11f'));db['User'][_0xa14d('0x120')](db[_0xa14d('0x20')],{'as':'VoiceMail','onDelete':_0xa14d('0x121'),'foreignKey':_0xa14d('0x122')});db[_0xa14d('0x14')]['hasOne'](db[_0xa14d('0x123')],{'as':_0xa14d('0x124'),'onDelete':_0xa14d('0x121'),'foreignKey':_0xa14d('0x122')});db[_0xa14d('0x14')][_0xa14d('0x125')](db['VoiceRecording'],{'as':_0xa14d('0x126'),'foreignKey':'UserId'});db[_0xa14d('0x14')][_0xa14d('0x125')](db[_0xa14d('0x2f')],{'as':_0xa14d('0x127'),'foreignKey':_0xa14d('0x122')});db[_0xa14d('0x14')][_0xa14d('0x125')](db[_0xa14d('0x19')],{'as':'Extensions','onDelete':'cascade','hooks':!![]});db['User'][_0xa14d('0x125')](db[_0xa14d('0x7b')],{'as':_0xa14d('0x128'),'foreignKey':_0xa14d('0x122')});db[_0xa14d('0x14')][_0xa14d('0x125')](db[_0xa14d('0x7d')],{'as':_0xa14d('0x129'),'foreignKey':_0xa14d('0x122')});db[_0xa14d('0x14')][_0xa14d('0x125')](db[_0xa14d('0x7f')],{'as':_0xa14d('0x7f'),'foreignKey':_0xa14d('0x122')});db[_0xa14d('0x14')]['hasMany'](db[_0xa14d('0x65')],{'as':_0xa14d('0x12a'),'foreignKey':_0xa14d('0x122')});db[_0xa14d('0x14')][_0xa14d('0x125')](db['ChatInteraction'],{'as':_0xa14d('0x12b'),'foreignKey':'UserId'});db['User'][_0xa14d('0x125')](db[_0xa14d('0x5c')],{'as':_0xa14d('0x12c'),'foreignKey':'UserId'});db[_0xa14d('0x14')][_0xa14d('0x125')](db['FaxInteraction'],{'as':_0xa14d('0x12d'),'foreignKey':_0xa14d('0x122')});db['User']['hasMany'](db[_0xa14d('0x48')],{'as':_0xa14d('0x12e'),'foreignKey':_0xa14d('0x122')});db[_0xa14d('0x14')][_0xa14d('0x125')](db[_0xa14d('0x12f')],{'as':_0xa14d('0x130'),'foreignKey':_0xa14d('0x122')});db[_0xa14d('0x14')]['hasMany'](db[_0xa14d('0x131')],{'as':_0xa14d('0x132'),'foreignKey':_0xa14d('0x133')});db[_0xa14d('0x14')][_0xa14d('0x134')](db[_0xa14d('0x135')],{'as':_0xa14d('0x135'),'foreignKey':_0xa14d('0x136')});db[_0xa14d('0x14')][_0xa14d('0x137')](db[_0xa14d('0x72')],{'as':_0xa14d('0x138'),'through':_0xa14d('0x139')});db[_0xa14d('0x14')][_0xa14d('0x137')](db[_0xa14d('0x76')],{'as':_0xa14d('0x13a'),'through':'cm_user_has_contacts'});db[_0xa14d('0x14')][_0xa14d('0x137')](db[_0xa14d('0x104')],{'as':_0xa14d('0x13b'),'through':'cm_user_has_lists'});db[_0xa14d('0x14')][_0xa14d('0x137')](db['Team'],{'through':'user_has_teams'});db[_0xa14d('0x14')]['belongsToMany'](db[_0xa14d('0x48')],{'as':_0xa14d('0x12e'),'through':_0xa14d('0x13c')});db['User'][_0xa14d('0x137')](db[_0xa14d('0x6d')],{'as':_0xa14d('0x12b'),'through':_0xa14d('0x13d')});db[_0xa14d('0x14')]['belongsToMany'](db[_0xa14d('0x52')],{'as':'FaxInteractions','through':_0xa14d('0x13e')});db['User'][_0xa14d('0x137')](db[_0xa14d('0x5c')],{'as':_0xa14d('0x12c'),'through':_0xa14d('0x13f')});db[_0xa14d('0x14')]['belongsToMany'](db['OpenchannelInteraction'],{'as':_0xa14d('0x12a'),'through':_0xa14d('0x140')});db['User'][_0xa14d('0x137')](db[_0xa14d('0x12f')],{'as':_0xa14d('0x130'),'through':_0xa14d('0x141')});db[_0xa14d('0x14')][_0xa14d('0x137')](db[_0xa14d('0x142')],{'as':_0xa14d('0x143'),'through':_0xa14d('0x31'),'required':![]});db['User'][_0xa14d('0x137')](db[_0xa14d('0x105')],{'as':_0xa14d('0x144'),'through':'UserVoicePrefix','required':![]});db[_0xa14d('0x14')][_0xa14d('0x137')](db[_0xa14d('0x44')],{'as':'MailQueues','through':_0xa14d('0x35'),'required':![]});db[_0xa14d('0x14')][_0xa14d('0x137')](db[_0xa14d('0x71')],{'as':_0xa14d('0x145'),'through':_0xa14d('0x33'),'required':![],'hooks':!![]});db[_0xa14d('0x14')]['belongsToMany'](db['FaxQueue'],{'as':'FaxQueues','through':'UserFaxQueue','required':![]});db[_0xa14d('0x14')][_0xa14d('0x137')](db[_0xa14d('0x60')],{'as':_0xa14d('0x146'),'through':'UserSmsQueue','required':![]});db[_0xa14d('0x14')]['belongsToMany'](db[_0xa14d('0x68')],{'as':'OpenchannelQueues','through':_0xa14d('0x3b'),'required':![]});db['User'][_0xa14d('0x137')](db[_0xa14d('0x116')],{'as':_0xa14d('0x147'),'through':_0xa14d('0x3d'),'required':![]});db['User']['belongsToMany'](db[_0xa14d('0x104')],{'through':_0xa14d('0x148')});db[_0xa14d('0x14')][_0xa14d('0x137')](db[_0xa14d('0x6a')],{'as':_0xa14d('0x149'),'through':_0xa14d('0x14a')});db[_0xa14d('0x14')][_0xa14d('0x137')](db[_0xa14d('0x14b')],{'as':'FaxAccounts','through':'user_has_fax_accounts'});db[_0xa14d('0x14')]['belongsToMany'](db[_0xa14d('0x14c')],{'as':_0xa14d('0x14d'),'through':_0xa14d('0x14e')});db[_0xa14d('0x14')][_0xa14d('0x137')](db['OpenchannelAccount'],{'as':'OpenchannelAccounts','through':_0xa14d('0x14f')});db[_0xa14d('0x14')][_0xa14d('0x137')](db[_0xa14d('0x150')],{'as':'SmsAccounts','through':_0xa14d('0x151')});db['User'][_0xa14d('0x137')](db[_0xa14d('0x10c')],{'as':_0xa14d('0x152'),'through':_0xa14d('0x153')});db[_0xa14d('0x14')][_0xa14d('0x137')](db[_0xa14d('0xee')],{'as':_0xa14d('0x154'),'through':_0xa14d('0x155')});db[_0xa14d('0x17')][_0xa14d('0x125')](db[_0xa14d('0x19')],{'as':_0xa14d('0x156'),'onDelete':'cascade','foreignKey':_0xa14d('0x157')});db[_0xa14d('0x158')][_0xa14d('0x125')](db[_0xa14d('0x19')],{'onDelete':_0xa14d('0x121')});db['VoiceExtension'][_0xa14d('0x125')](db['VoiceExtension'],{'as':_0xa14d('0x159'),'onDelete':_0xa14d('0x121')});db['VoiceMusicOnHold'][_0xa14d('0x137')](db[_0xa14d('0x91')],{'as':_0xa14d('0x15a'),'through':'moh_has_sounds'});db['VoiceQueue']['hasMany'](db[_0xa14d('0x2f')],{'as':'Members','foreignKey':_0xa14d('0x15b')});db[_0xa14d('0x142')]['hasMany'](db[_0xa14d('0x78')],{'as':_0xa14d('0x15c'),'foreignKey':'VoiceQueueId'});db[_0xa14d('0x142')][_0xa14d('0x125')](db['CmHopperFinal'],{'as':_0xa14d('0x128'),'foreignKey':_0xa14d('0x15b')});db['VoiceQueue'][_0xa14d('0x125')](db[_0xa14d('0x7d')],{'as':'HopperHistories','foreignKey':_0xa14d('0x15b')});db[_0xa14d('0x142')][_0xa14d('0x125')](db[_0xa14d('0x7f')],{'as':_0xa14d('0x7f'),'foreignKey':'VoiceQueueId'});db[_0xa14d('0x142')][_0xa14d('0x125')](db[_0xa14d('0x7a')],{'as':_0xa14d('0x15d'),'foreignKey':'VoiceQueueId'});db[_0xa14d('0x142')]['hasMany'](db['JscriptySessionReport'],{'as':_0xa14d('0x15e'),'foreignKey':'VoiceQueueId'});db[_0xa14d('0x142')]['belongsTo'](db[_0xa14d('0x2b')],{'as':_0xa14d('0x2b'),'foreignKey':_0xa14d('0x15f')});db[_0xa14d('0x142')]['belongsTo'](db['Trunk'],{'as':'TrunkBackup','foreignKey':_0xa14d('0x160')});db[_0xa14d('0x142')][_0xa14d('0x134')](db['Interval'],{'as':'Interval','foreignKey':_0xa14d('0x161')});db[_0xa14d('0x142')][_0xa14d('0x134')](db['Pause'],{'as':_0xa14d('0x162'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xa14d('0x142')][_0xa14d('0x137')](db[_0xa14d('0x104')],{'as':_0xa14d('0x13b'),'through':_0xa14d('0x163')});db['VoiceQueue']['belongsToMany'](db[_0xa14d('0x14')],{'as':_0xa14d('0x164'),'through':_0xa14d('0x31')});db[_0xa14d('0x142')][_0xa14d('0x137')](db[_0xa14d('0xf2')],{'as':_0xa14d('0x165'),'through':_0xa14d('0x11a')});db['VoiceQueue'][_0xa14d('0x137')](db[_0xa14d('0x104')],{'as':_0xa14d('0x166'),'through':_0xa14d('0x167')});db[_0xa14d('0x1d')][_0xa14d('0x134')](db[_0xa14d('0x14')],{'as':_0xa14d('0x14'),'foreignKey':_0xa14d('0x122')});db[_0xa14d('0x1e')][_0xa14d('0x134')](db[_0xa14d('0x14')],{'as':_0xa14d('0x14'),'foreignKey':_0xa14d('0x122')});db[_0xa14d('0x20')][_0xa14d('0x125')](db[_0xa14d('0x168')],{'as':'Messages','onDelete':_0xa14d('0x121'),'foreignKey':_0xa14d('0x169'),'sourceKey':'mailbox'});db[_0xa14d('0x168')][_0xa14d('0x134')](db['VoiceMail'],{'foreignKey':_0xa14d('0x169'),'targetKey':_0xa14d('0x16a')});db[_0xa14d('0x23')][_0xa14d('0x125')](db[_0xa14d('0x28')],{'as':_0xa14d('0x16b'),'foreignKey':'uniqueid','constraints':![]});db['VoiceCallReport']['hasMany'](db[_0xa14d('0x27')],{'as':_0xa14d('0x16c'),'foreignKey':_0xa14d('0x16d'),'constraints':![]});db[_0xa14d('0x23')][_0xa14d('0x134')](db[_0xa14d('0x14')],{'as':_0xa14d('0x14'),'foreignKey':_0xa14d('0x122')});db['VoiceCallReport']['belongsTo'](db['CmContact'],{'as':_0xa14d('0x16e'),'foreignKey':_0xa14d('0x16f')});db[_0xa14d('0x3f')][_0xa14d('0x134')](db[_0xa14d('0x14c')],{'as':_0xa14d('0x14c'),'foreignKey':_0xa14d('0x170')});db[_0xa14d('0x3f')][_0xa14d('0x134')](db[_0xa14d('0x118')],{'as':_0xa14d('0x118'),'foreignKey':_0xa14d('0x171'),'onDelete':_0xa14d('0x172')});db[_0xa14d('0x41')][_0xa14d('0x134')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0xa14d('0x170')});db['MailServerOut'][_0xa14d('0x134')](db[_0xa14d('0x118')],{'as':'CloudProvider','foreignKey':'CloudProviderId','onDelete':_0xa14d('0x172')});db['MailAccount'][_0xa14d('0x120')](db['MailServerIn'],{'as':_0xa14d('0x173'),'onDelete':_0xa14d('0x121')});db['MailAccount'][_0xa14d('0x120')](db[_0xa14d('0x41')],{'as':'Smtp','onDelete':_0xa14d('0x121')});db[_0xa14d('0x14c')][_0xa14d('0x125')](db[_0xa14d('0x86')],{'as':'Dispositions','foreignKey':'MailAccountId','onDelete':'cascade'});db[_0xa14d('0x14c')][_0xa14d('0x125')](db[_0xa14d('0x85')],{'as':_0xa14d('0x174'),'foreignKey':_0xa14d('0x170')});db[_0xa14d('0x14c')]['hasMany'](db['MailMessage'],{'as':'Messages','foreignKey':_0xa14d('0x170')});db[_0xa14d('0x14c')]['hasMany'](db['MailInteraction'],{'as':_0xa14d('0x175')});db[_0xa14d('0x14c')]['hasMany'](db['MailApplication'],{'as':_0xa14d('0x159')});db[_0xa14d('0x14c')]['belongsTo'](db[_0xa14d('0x104')],{'as':'List','foreignKey':'ListId'});db[_0xa14d('0x14c')][_0xa14d('0x134')](db[_0xa14d('0x9a')],{'as':_0xa14d('0x9a'),'foreignKey':'TemplateId'});db[_0xa14d('0x14c')]['belongsTo'](db['Pause'],{'as':_0xa14d('0x162'),'foreignKey':_0xa14d('0x176')});db[_0xa14d('0x14c')][_0xa14d('0x137')](db[_0xa14d('0x14')],{'as':_0xa14d('0x164'),'through':'user_has_mail_accounts'});db[_0xa14d('0x44')][_0xa14d('0x137')](db['User'],{'as':_0xa14d('0x164'),'through':_0xa14d('0x35')});db[_0xa14d('0x44')][_0xa14d('0x137')](db['Team'],{'through':_0xa14d('0x177'),'as':_0xa14d('0x165')});db[_0xa14d('0x48')][_0xa14d('0x125')](db[_0xa14d('0x49')],{'as':_0xa14d('0x178'),'onDelete':_0xa14d('0x121'),'foreignKey':_0xa14d('0x179')});db[_0xa14d('0x48')][_0xa14d('0x134')](db['MailAccount'],{'as':_0xa14d('0x17a'),'foreignKey':_0xa14d('0x170')});db[_0xa14d('0x48')][_0xa14d('0x134')](db[_0xa14d('0x76')],{'as':'Contact','foreignKey':_0xa14d('0x16f')});db[_0xa14d('0x48')][_0xa14d('0x134')](db[_0xa14d('0x14')],{'as':'Owner','foreignKey':_0xa14d('0x122')});db[_0xa14d('0x48')][_0xa14d('0x137')](db[_0xa14d('0x93')],{'through':_0xa14d('0x17b'),'as':_0xa14d('0x17c')});db['MailInteraction'][_0xa14d('0x137')](db[_0xa14d('0x93')],{'through':_0xa14d('0x17b'),'as':'ThroughTags'});db[_0xa14d('0x48')]['belongsToMany'](db['User'],{'as':_0xa14d('0x17d'),'through':'user_has_mail_interactions','foreignKey':'MailInteractionId'});db[_0xa14d('0x49')][_0xa14d('0x125')](db['Attachment'],{'as':'Attachments','onDelete':_0xa14d('0x121')});db[_0xa14d('0x49')][_0xa14d('0x134')](db['User'],{'as':_0xa14d('0x14')});db[_0xa14d('0x49')]['belongsTo'](db[_0xa14d('0x76')],{'onDelete':_0xa14d('0x121'),'as':_0xa14d('0x16e')});db[_0xa14d('0x49')][_0xa14d('0x134')](db[_0xa14d('0x48')],{'as':_0xa14d('0x17e'),'foreignKey':_0xa14d('0x179')});db[_0xa14d('0x49')][_0xa14d('0x134')](db[_0xa14d('0x14c')],{'as':_0xa14d('0x17a'),'foreignKey':_0xa14d('0x170')});db[_0xa14d('0x49')][_0xa14d('0x134')](db['ChatWebsite'],{'as':_0xa14d('0x6a'),'foreignKey':'ChatWebsiteId'});db[_0xa14d('0x49')][_0xa14d('0x134')](db[_0xa14d('0x70')],{'as':_0xa14d('0x70'),'foreignKey':_0xa14d('0x17f')});db[_0xa14d('0x180')][_0xa14d('0x134')](db[_0xa14d('0x14')],{'onDelete':_0xa14d('0x172')});db[_0xa14d('0x180')][_0xa14d('0x134')](db[_0xa14d('0x44')],{'onDelete':'restrict'});db[_0xa14d('0x180')][_0xa14d('0x134')](db['MailAccount'],{'onDelete':_0xa14d('0x172')});db['MailApplication'][_0xa14d('0x134')](db['Interval'],{'onDelete':'restrict','foreignKey':_0xa14d('0x161')});db['MailApplication']['belongsTo'](db[_0xa14d('0x93')],{'onDelete':_0xa14d('0x172'),'foreignKey':'TagId'});db[_0xa14d('0x4b')][_0xa14d('0x134')](db[_0xa14d('0x14c')],{});db['MailQueueReport'][_0xa14d('0x134')](db['CmList'],{'as':_0xa14d('0x181'),'foreignKey':_0xa14d('0x182')});db['MailQueueReport'][_0xa14d('0x134')](db[_0xa14d('0x76')],{'as':_0xa14d('0x16e'),'foreignKey':_0xa14d('0x16f')});db[_0xa14d('0x4b')][_0xa14d('0x134')](db[_0xa14d('0x48')],{});db[_0xa14d('0x4b')]['belongsTo'](db[_0xa14d('0x49')],{});db['MailQueueReport'][_0xa14d('0x134')](db['User'],{});db[_0xa14d('0x4b')]['belongsTo'](db['MailQueue'],{});db[_0xa14d('0x4d')][_0xa14d('0x125')](db[_0xa14d('0x4f')],{'as':_0xa14d('0x183'),'onDelete':'cascade'});db['FaxAccount'][_0xa14d('0x125')](db[_0xa14d('0x86')],{'as':_0xa14d('0x184'),'foreignKey':'FaxAccountId','onDelete':'cascade'});db[_0xa14d('0x14b')]['hasMany'](db[_0xa14d('0x85')],{'as':_0xa14d('0x174'),'foreignKey':_0xa14d('0x185')});db['FaxAccount']['hasMany'](db[_0xa14d('0x52')],{'as':'Interactions'});db[_0xa14d('0x14b')][_0xa14d('0x125')](db[_0xa14d('0x186')],{'as':_0xa14d('0x159')});db[_0xa14d('0x14b')][_0xa14d('0x125')](db[_0xa14d('0x19')],{'as':_0xa14d('0x187'),'onDelete':'cascade'});db[_0xa14d('0x14b')][_0xa14d('0x125')](db[_0xa14d('0x54')],{'as':'Messages'});db[_0xa14d('0x14b')][_0xa14d('0x134')](db[_0xa14d('0x2b')],{'as':_0xa14d('0x2b')});db[_0xa14d('0x14b')]['belongsTo'](db['CmList'],{'as':_0xa14d('0x181'),'foreignKey':_0xa14d('0x182')});db[_0xa14d('0x14b')][_0xa14d('0x134')](db['Pause'],{'as':_0xa14d('0x162'),'foreignKey':_0xa14d('0x176')});db[_0xa14d('0x14b')]['belongsToMany'](db[_0xa14d('0x14')],{'as':'Agents','through':_0xa14d('0x188')});db['FaxApplication'][_0xa14d('0x134')](db['User'],{'onDelete':_0xa14d('0x172')});db['FaxApplication'][_0xa14d('0x134')](db[_0xa14d('0x55')],{'onDelete':_0xa14d('0x172')});db[_0xa14d('0x186')][_0xa14d('0x134')](db[_0xa14d('0x14b')],{'onDelete':'restrict'});db[_0xa14d('0x186')][_0xa14d('0x134')](db[_0xa14d('0x93')],{'onDelete':'restrict','foreignKey':_0xa14d('0x189')});db[_0xa14d('0x52')][_0xa14d('0x125')](db['FaxMessage'],{'as':_0xa14d('0x178'),'onDelete':'cascade','foreignKey':_0xa14d('0x18a')});db['FaxInteraction'][_0xa14d('0x134')](db[_0xa14d('0x14b')],{'as':'Account','foreignKey':_0xa14d('0x185')});db[_0xa14d('0x52')]['belongsTo'](db['CmContact'],{'as':_0xa14d('0x16e'),'foreignKey':'ContactId'});db[_0xa14d('0x52')][_0xa14d('0x134')](db['User'],{'as':'Owner','foreignKey':_0xa14d('0x122')});db[_0xa14d('0x52')][_0xa14d('0x137')](db['Tag'],{'through':_0xa14d('0x18b'),'as':_0xa14d('0x17c')});db['FaxInteraction'][_0xa14d('0x137')](db['Tag'],{'through':'fax_interaction_has_tags','as':_0xa14d('0x18c')});db['FaxInteraction'][_0xa14d('0x137')](db['User'],{'as':_0xa14d('0x17d'),'through':_0xa14d('0x13e'),'foreignKey':_0xa14d('0x18a')});db['FaxMessage'][_0xa14d('0x134')](db[_0xa14d('0x14')],{'onDelete':_0xa14d('0x121'),'as':_0xa14d('0x14')});db['FaxMessage']['belongsTo'](db['FaxInteraction'],{'as':_0xa14d('0x17e'),'foreignKey':_0xa14d('0x18a')});db[_0xa14d('0x54')][_0xa14d('0x134')](db[_0xa14d('0x76')],{'onDelete':'cascade','as':'Contact'});db[_0xa14d('0x54')]['belongsTo'](db['Attachment'],{'as':_0xa14d('0xf9'),'foreignKey':_0xa14d('0x18d')});db[_0xa14d('0x54')][_0xa14d('0x134')](db[_0xa14d('0x14b')],{'as':_0xa14d('0x17a'),'foreignKey':_0xa14d('0x185')});db[_0xa14d('0x55')][_0xa14d('0x137')](db[_0xa14d('0x14')],{'as':_0xa14d('0x164'),'through':'UserFaxQueue'});db['FaxQueue'][_0xa14d('0x137')](db[_0xa14d('0xf2')],{'through':_0xa14d('0x18e'),'as':'Teams'});db[_0xa14d('0x57')][_0xa14d('0x134')](db['FaxAccount'],{});db['FaxQueueReport'][_0xa14d('0x134')](db[_0xa14d('0x104')],{'as':_0xa14d('0x181'),'foreignKey':'ListId'});db[_0xa14d('0x57')][_0xa14d('0x134')](db['CmContact'],{'as':_0xa14d('0x16e'),'foreignKey':_0xa14d('0x16f')});db[_0xa14d('0x57')][_0xa14d('0x134')](db[_0xa14d('0x52')],{});db[_0xa14d('0x57')][_0xa14d('0x134')](db[_0xa14d('0x54')],{});db[_0xa14d('0x57')]['belongsTo'](db['User'],{});db[_0xa14d('0x57')][_0xa14d('0x134')](db[_0xa14d('0x55')],{});db[_0xa14d('0x150')][_0xa14d('0x125')](db[_0xa14d('0x86')],{'as':_0xa14d('0x184'),'foreignKey':_0xa14d('0x18f'),'onDelete':_0xa14d('0x121')});db[_0xa14d('0x150')][_0xa14d('0x125')](db['CannedAnswer'],{'as':_0xa14d('0x174'),'foreignKey':'SmsAccountId'});db[_0xa14d('0x150')][_0xa14d('0x125')](db[_0xa14d('0x5e')],{'as':_0xa14d('0x178'),'foreignKey':'SmsAccountId'});db['SmsAccount'][_0xa14d('0x125')](db['SmsInteraction'],{'as':_0xa14d('0x175')});db[_0xa14d('0x150')]['hasMany'](db[_0xa14d('0x5a')],{'as':_0xa14d('0x159')});db[_0xa14d('0x150')][_0xa14d('0x134')](db['CmList'],{'as':_0xa14d('0x181'),'foreignKey':_0xa14d('0x182')});db[_0xa14d('0x150')][_0xa14d('0x134')](db[_0xa14d('0x8b')],{'as':_0xa14d('0x162'),'foreignKey':_0xa14d('0x176')});db[_0xa14d('0x150')]['belongsToMany'](db[_0xa14d('0x14')],{'as':_0xa14d('0x164'),'through':_0xa14d('0x151')});db[_0xa14d('0x5a')]['belongsTo'](db[_0xa14d('0x14')],{'onDelete':_0xa14d('0x172')});db[_0xa14d('0x5a')][_0xa14d('0x134')](db[_0xa14d('0x60')],{'onDelete':_0xa14d('0x172')});db[_0xa14d('0x5a')]['belongsTo'](db[_0xa14d('0x150')],{'onDelete':'restrict'});db[_0xa14d('0x5a')][_0xa14d('0x134')](db[_0xa14d('0x190')],{'onDelete':'restrict','foreignKey':_0xa14d('0x161')});db[_0xa14d('0x5a')][_0xa14d('0x134')](db[_0xa14d('0x93')],{'onDelete':_0xa14d('0x172'),'foreignKey':_0xa14d('0x189')});db['SmsInteraction']['hasMany'](db[_0xa14d('0x5e')],{'as':_0xa14d('0x178'),'onDelete':_0xa14d('0x121'),'foreignKey':_0xa14d('0x191')});db[_0xa14d('0x5c')][_0xa14d('0x134')](db[_0xa14d('0x150')],{'as':_0xa14d('0x17a'),'foreignKey':_0xa14d('0x18f')});db['SmsInteraction'][_0xa14d('0x134')](db['CmContact'],{'as':'Contact','foreignKey':_0xa14d('0x16f')});db[_0xa14d('0x5c')][_0xa14d('0x134')](db['User'],{'as':_0xa14d('0x192'),'foreignKey':_0xa14d('0x122')});db['SmsInteraction'][_0xa14d('0x137')](db[_0xa14d('0x93')],{'through':_0xa14d('0x193'),'as':'Tags'});db[_0xa14d('0x5c')][_0xa14d('0x137')](db[_0xa14d('0x93')],{'through':'sms_interaction_has_tags','as':_0xa14d('0x18c')});db['SmsInteraction'][_0xa14d('0x137')](db[_0xa14d('0x14')],{'as':_0xa14d('0x17d'),'through':_0xa14d('0x13f'),'foreignKey':_0xa14d('0x191')});db['SmsMessage'][_0xa14d('0x134')](db[_0xa14d('0x14')],{'as':_0xa14d('0x14')});db['SmsMessage'][_0xa14d('0x134')](db['CmContact'],{'onDelete':_0xa14d('0x121'),'as':_0xa14d('0x16e')});db[_0xa14d('0x5e')][_0xa14d('0x134')](db[_0xa14d('0x5c')],{'onDelete':_0xa14d('0x121'),'as':'Interaction','foreignKey':_0xa14d('0x191')});db[_0xa14d('0x5e')][_0xa14d('0x134')](db[_0xa14d('0x150')],{'as':_0xa14d('0x17a'),'foreignKey':'SmsAccountId'});db['SmsQueue'][_0xa14d('0x137')](db[_0xa14d('0x14')],{'as':_0xa14d('0x164'),'through':'UserSmsQueue','foreignKey':'SmsQueueId'});db[_0xa14d('0x60')][_0xa14d('0x137')](db[_0xa14d('0xf2')],{'through':_0xa14d('0x194'),'as':_0xa14d('0x165')});db[_0xa14d('0x195')]['hasMany'](db[_0xa14d('0x86')],{'as':'Dispositions','foreignKey':_0xa14d('0x196'),'onDelete':'cascade'});db[_0xa14d('0x195')][_0xa14d('0x125')](db[_0xa14d('0x85')],{'as':_0xa14d('0x174'),'foreignKey':_0xa14d('0x196')});db[_0xa14d('0x195')][_0xa14d('0x125')](db[_0xa14d('0x65')],{'as':_0xa14d('0x175'),'foreignKey':_0xa14d('0x196')});db[_0xa14d('0x195')][_0xa14d('0x125')](db[_0xa14d('0x67')],{'as':_0xa14d('0x178'),'foreignKey':_0xa14d('0x196')});db[_0xa14d('0x195')]['hasMany'](db['OpenchannelApplication'],{'as':_0xa14d('0x159'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount']['belongsTo'](db[_0xa14d('0x104')],{'as':_0xa14d('0x181'),'foreignKey':'ListId'});db[_0xa14d('0x195')]['belongsTo'](db['Pause'],{'as':_0xa14d('0x162'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xa14d('0x195')]['belongsToMany'](db[_0xa14d('0x14')],{'as':_0xa14d('0x164'),'through':'user_has_openchannel_accounts'});db[_0xa14d('0x63')][_0xa14d('0x134')](db[_0xa14d('0x14')],{'onDelete':'restrict'});db['OpenchannelApplication']['belongsTo'](db[_0xa14d('0x68')],{'onDelete':_0xa14d('0x172'),'foreignKey':_0xa14d('0x197')});db[_0xa14d('0x63')][_0xa14d('0x134')](db[_0xa14d('0x195')],{'onDelete':_0xa14d('0x172'),'foreignKey':'OpenchannelAccountId'});db[_0xa14d('0x63')][_0xa14d('0x134')](db[_0xa14d('0x190')],{'onDelete':'restrict','foreignKey':_0xa14d('0x161')});db[_0xa14d('0x63')]['belongsTo'](db[_0xa14d('0x93')],{'onDelete':_0xa14d('0x172'),'foreignKey':'TagId'});db['OpenchannelInteraction'][_0xa14d('0x125')](db['OpenchannelMessage'],{'as':_0xa14d('0x178'),'onDelete':_0xa14d('0x121'),'foreignKey':_0xa14d('0x198')});db['OpenchannelInteraction'][_0xa14d('0x134')](db[_0xa14d('0x195')],{'as':_0xa14d('0x17a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelInteraction'][_0xa14d('0x134')](db[_0xa14d('0x76')],{'as':_0xa14d('0x16e'),'foreignKey':_0xa14d('0x16f')});db[_0xa14d('0x65')][_0xa14d('0x134')](db[_0xa14d('0x14')],{'as':_0xa14d('0x192'),'foreignKey':'UserId'});db[_0xa14d('0x65')][_0xa14d('0x137')](db[_0xa14d('0x93')],{'through':_0xa14d('0x199'),'as':_0xa14d('0x17c')});db[_0xa14d('0x65')][_0xa14d('0x137')](db[_0xa14d('0x93')],{'through':_0xa14d('0x199'),'as':_0xa14d('0x18c')});db['OpenchannelInteraction'][_0xa14d('0x137')](db[_0xa14d('0x14')],{'as':_0xa14d('0x17d'),'through':_0xa14d('0x140'),'foreignKey':_0xa14d('0x198')});db['OpenchannelMessage'][_0xa14d('0x134')](db[_0xa14d('0x14')],{'onDelete':_0xa14d('0x121'),'as':_0xa14d('0x14')});db['OpenchannelMessage']['belongsTo'](db['CmContact'],{'onDelete':'cascade','as':_0xa14d('0x16e')});db[_0xa14d('0x67')][_0xa14d('0x134')](db['OpenchannelInteraction'],{'onDelete':_0xa14d('0x121'),'as':'Interaction','foreignKey':_0xa14d('0x198')});db[_0xa14d('0x67')][_0xa14d('0x134')](db[_0xa14d('0xf9')],{'as':'Attachment','foreignKey':_0xa14d('0x18d')});db[_0xa14d('0x67')][_0xa14d('0x134')](db[_0xa14d('0x195')],{'as':_0xa14d('0x17a'),'foreignKey':_0xa14d('0x196')});db[_0xa14d('0x68')][_0xa14d('0x137')](db[_0xa14d('0x14')],{'as':_0xa14d('0x164'),'through':'UserOpenchannelQueue','foreignKey':_0xa14d('0x197')});db['OpenchannelQueue'][_0xa14d('0x137')](db[_0xa14d('0xf2')],{'through':_0xa14d('0x19a'),'as':_0xa14d('0x165')});db[_0xa14d('0x6a')][_0xa14d('0x125')](db[_0xa14d('0x86')],{'as':_0xa14d('0x184'),'foreignKey':_0xa14d('0x19b'),'onDelete':_0xa14d('0x121')});db[_0xa14d('0x6a')][_0xa14d('0x125')](db[_0xa14d('0x85')],{'as':'Answers','foreignKey':_0xa14d('0x19b')});db['ChatWebsite'][_0xa14d('0x125')](db[_0xa14d('0x73')],{'as':'ProactiveActions'});db[_0xa14d('0x6a')][_0xa14d('0x125')](db[_0xa14d('0x6d')],{'as':_0xa14d('0x175')});db[_0xa14d('0x6a')]['hasMany'](db[_0xa14d('0x19c')],{'as':_0xa14d('0x159')});db['ChatWebsite'][_0xa14d('0x125')](db['ChatMessage'],{'as':'Messages'});db[_0xa14d('0x6a')][_0xa14d('0x134')](db[_0xa14d('0x104')],{'as':'List','foreignKey':_0xa14d('0x182')});db[_0xa14d('0x6a')]['belongsTo'](db[_0xa14d('0x190')],{'as':_0xa14d('0x190'),'foreignKey':_0xa14d('0x161')});db[_0xa14d('0x6a')][_0xa14d('0x134')](db[_0xa14d('0x14c')],{'as':_0xa14d('0x14c'),'foreignKey':_0xa14d('0x170')});db['ChatWebsite'][_0xa14d('0x134')](db[_0xa14d('0x8b')],{'as':_0xa14d('0x162'),'foreignKey':_0xa14d('0x176')});db['ChatWebsite']['belongsToMany'](db[_0xa14d('0x14')],{'as':_0xa14d('0x164'),'through':_0xa14d('0x14a')});db[_0xa14d('0x6c')]['belongsTo'](db['OpenchannelAccount'],{});db[_0xa14d('0x6c')][_0xa14d('0x134')](db[_0xa14d('0x104')],{'as':'List','foreignKey':_0xa14d('0x182')});db[_0xa14d('0x6c')][_0xa14d('0x134')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db['OpenchannelQueueReport']['belongsTo'](db[_0xa14d('0x65')],{});db[_0xa14d('0x6c')]['belongsTo'](db[_0xa14d('0x67')],{});db[_0xa14d('0x6c')][_0xa14d('0x134')](db[_0xa14d('0x14')],{});db[_0xa14d('0x6c')][_0xa14d('0x134')](db['OpenchannelQueue'],{});db[_0xa14d('0x19c')][_0xa14d('0x134')](db[_0xa14d('0x14')],{'as':_0xa14d('0x19d'),'foreignKey':'UserId','onDelete':_0xa14d('0x172')});db[_0xa14d('0x19c')][_0xa14d('0x134')](db[_0xa14d('0x71')],{'as':_0xa14d('0x19e'),'foreignKey':_0xa14d('0x19f'),'onDelete':_0xa14d('0x172')});db[_0xa14d('0x19c')][_0xa14d('0x134')](db[_0xa14d('0x6a')],{'as':_0xa14d('0x1a0'),'foreignKey':_0xa14d('0x19b'),'onDelete':'restrict'});db['ChatApplication'][_0xa14d('0x134')](db['Tag'],{'onDelete':_0xa14d('0x172'),'foreignKey':_0xa14d('0x189')});db[_0xa14d('0x6d')][_0xa14d('0x125')](db[_0xa14d('0x6e')],{'as':_0xa14d('0x178'),'onDelete':_0xa14d('0x121'),'foreignKey':_0xa14d('0x1a1')});db[_0xa14d('0x6d')][_0xa14d('0x134')](db[_0xa14d('0x6a')],{'as':_0xa14d('0x17a'),'foreignKey':'ChatWebsiteId'});db['ChatInteraction'][_0xa14d('0x134')](db[_0xa14d('0x76')],{'as':_0xa14d('0x16e'),'foreignKey':_0xa14d('0x16f')});db[_0xa14d('0x6d')][_0xa14d('0x134')](db[_0xa14d('0x14')],{'as':_0xa14d('0x192'),'foreignKey':_0xa14d('0x122')});db['ChatInteraction'][_0xa14d('0x137')](db[_0xa14d('0x93')],{'through':'chat_interaction_has_tags','as':'Tags'});db[_0xa14d('0x6d')][_0xa14d('0x137')](db[_0xa14d('0x93')],{'through':_0xa14d('0x1a2'),'as':'ThroughTags'});db['ChatInteraction'][_0xa14d('0x137')](db['User'],{'as':_0xa14d('0x17d'),'through':_0xa14d('0x13d'),'foreignKey':'ChatInteractionId'});db[_0xa14d('0x6e')]['belongsTo'](db[_0xa14d('0x14')],{'onDelete':'cascade','as':_0xa14d('0x14')});db[_0xa14d('0x6e')]['belongsTo'](db[_0xa14d('0x76')],{'onDelete':'cascade','as':_0xa14d('0x16e'),'foreignKey':'ContactId'});db[_0xa14d('0x6e')][_0xa14d('0x134')](db[_0xa14d('0x6d')],{'onDelete':'cascade','as':_0xa14d('0x17e'),'foreignKey':_0xa14d('0x1a1')});db[_0xa14d('0x6e')][_0xa14d('0x134')](db[_0xa14d('0xf9')],{'as':_0xa14d('0xf9'),'foreignKey':_0xa14d('0x18d')});db[_0xa14d('0x6e')][_0xa14d('0x134')](db[_0xa14d('0x6a')],{'as':_0xa14d('0x17a'),'foreignKey':_0xa14d('0x19b')});db[_0xa14d('0x70')][_0xa14d('0x125')](db[_0xa14d('0xf9')],{'as':_0xa14d('0x1a3'),'foreignKey':_0xa14d('0x17f'),'onDelete':_0xa14d('0x121'),'hooks':!![]});db['ChatOfflineMessage'][_0xa14d('0x134')](db[_0xa14d('0x76')],{'onDelete':_0xa14d('0x121'),'as':_0xa14d('0x16e'),'foreignKey':_0xa14d('0x16f')});db[_0xa14d('0x70')]['belongsTo'](db[_0xa14d('0x6a')],{'as':_0xa14d('0x17a'),'foreignKey':'ChatWebsiteId'});db['ChatQueue']['belongsToMany'](db['User'],{'as':_0xa14d('0x164'),'through':'UserChatQueue','hooks':!![]});db['ChatQueue'][_0xa14d('0x137')](db[_0xa14d('0xf2')],{'through':_0xa14d('0x1a4'),'as':_0xa14d('0x165')});db[_0xa14d('0x72')]['hasMany'](db[_0xa14d('0xdc')],{'as':'Messages','foreignKey':'ChatGroupId','onDelete':'cascade'});db[_0xa14d('0x72')][_0xa14d('0x137')](db['User'],{'as':_0xa14d('0x1a5'),'through':_0xa14d('0x139')});db['ChatProactiveAction'][_0xa14d('0x134')](db[_0xa14d('0x6a')],{'as':'Website','foreignKey':_0xa14d('0x19b')});db[_0xa14d('0x75')][_0xa14d('0x125')](db[_0xa14d('0x76')],{'as':_0xa14d('0x13a'),'foreignKey':_0xa14d('0x1a6')});db[_0xa14d('0x76')][_0xa14d('0x125')](db[_0xa14d('0x96')],{'as':_0xa14d('0x1a7'),'foreignKey':_0xa14d('0x1a8')});db[_0xa14d('0x76')][_0xa14d('0x125')](db[_0xa14d('0x78')],{'as':_0xa14d('0x15c'),'foreignKey':_0xa14d('0x16f')});db[_0xa14d('0x76')]['hasMany'](db[_0xa14d('0x7b')],{'as':'HopperFinals','foreignKey':'ContactId'});db[_0xa14d('0x76')][_0xa14d('0x125')](db['CmHopperHistory'],{'as':_0xa14d('0x1a9'),'foreignKey':'ContactId'});db[_0xa14d('0x76')]['hasMany'](db[_0xa14d('0x7f')],{'as':'ReportAgentPreview','foreignKey':_0xa14d('0x16f')});db[_0xa14d('0x76')][_0xa14d('0x125')](db['JscriptySessionReport'],{'as':_0xa14d('0x15e'),'foreignKey':_0xa14d('0x16f')});db[_0xa14d('0x76')][_0xa14d('0x125')](db[_0xa14d('0x65')],{'as':_0xa14d('0x12a'),'foreignKey':_0xa14d('0x16f'),'onDelete':'restrict'});db[_0xa14d('0x76')][_0xa14d('0x125')](db[_0xa14d('0x6d')],{'as':_0xa14d('0x12b'),'foreignKey':_0xa14d('0x16f'),'onDelete':_0xa14d('0x172')});db[_0xa14d('0x76')][_0xa14d('0x125')](db[_0xa14d('0x5c')],{'as':_0xa14d('0x12c'),'foreignKey':'ContactId','onDelete':_0xa14d('0x172')});db['CmContact']['hasMany'](db['FaxInteraction'],{'as':_0xa14d('0x12d'),'foreignKey':_0xa14d('0x16f'),'onDelete':_0xa14d('0x172')});db[_0xa14d('0x76')]['hasMany'](db[_0xa14d('0x48')],{'as':'MailInteractions','foreignKey':_0xa14d('0x16f'),'onDelete':_0xa14d('0x172')});db[_0xa14d('0x76')][_0xa14d('0x134')](db[_0xa14d('0x75')],{'as':_0xa14d('0x1aa'),'foreignKey':_0xa14d('0x1a6')});db['CmContact'][_0xa14d('0x134')](db[_0xa14d('0x104')],{'as':_0xa14d('0x181'),'foreignKey':'ListId','onDelete':'cascade'});db[_0xa14d('0x76')][_0xa14d('0x137')](db['User'],{'as':_0xa14d('0x17d'),'through':'cm_user_has_contacts'});db[_0xa14d('0x76')]['belongsToMany'](db[_0xa14d('0x93')],{'as':_0xa14d('0x17c'),'through':_0xa14d('0x1ab')});db[_0xa14d('0x76')][_0xa14d('0x137')](db[_0xa14d('0x93')],{'through':_0xa14d('0x1ab'),'as':_0xa14d('0x18c')});db['CmHopper'][_0xa14d('0x125')](db['CmHopperAdditionalPhone'],{'as':_0xa14d('0x1ac'),'foreignKey':_0xa14d('0x1ad')});db[_0xa14d('0x78')][_0xa14d('0x134')](db[_0xa14d('0x76')],{'as':_0xa14d('0x16e'),'foreignKey':_0xa14d('0x16f'),'onDelete':_0xa14d('0x121')});db[_0xa14d('0x78')][_0xa14d('0x134')](db[_0xa14d('0x104')],{'as':_0xa14d('0x181'),'foreignKey':_0xa14d('0x182'),'onDelete':_0xa14d('0x121')});db['CmHopper'][_0xa14d('0x134')](db[_0xa14d('0x14')],{'as':_0xa14d('0x19d'),'foreignKey':_0xa14d('0x122')});db[_0xa14d('0x78')][_0xa14d('0x134')](db[_0xa14d('0x142')],{'as':'Queue','foreignKey':_0xa14d('0x15b'),'onDelete':'cascade'});db[_0xa14d('0x78')][_0xa14d('0x134')](db[_0xa14d('0xf5')],{'as':_0xa14d('0xf5'),'foreignKey':_0xa14d('0x1ae'),'onDelete':_0xa14d('0x121')});db[_0xa14d('0x78')][_0xa14d('0x134')](db[_0xa14d('0x14')],{'as':'Owner','foreignKey':_0xa14d('0x1af')});db[_0xa14d('0x7a')][_0xa14d('0x134')](db[_0xa14d('0x76')],{'as':_0xa14d('0x16e'),'foreignKey':_0xa14d('0x16f'),'onDelete':_0xa14d('0x121')});db[_0xa14d('0x7a')][_0xa14d('0x134')](db[_0xa14d('0x104')],{'as':'List','foreignKey':_0xa14d('0x182'),'onDelete':'cascade'});db[_0xa14d('0x7a')][_0xa14d('0x134')](db[_0xa14d('0x142')],{'as':_0xa14d('0x19e'),'foreignKey':_0xa14d('0x15b'),'onDelete':_0xa14d('0x121')});db[_0xa14d('0x7a')]['belongsTo'](db['Campaign'],{'as':_0xa14d('0xf5'),'foreignKey':_0xa14d('0x1ae'),'onDelete':'cascade'});db[_0xa14d('0x84')][_0xa14d('0x125')](db[_0xa14d('0x88')],{'as':{'plural':'All','singular':'OneAll'},'foreignKey':_0xa14d('0x1b0'),'onDelete':_0xa14d('0x121'),'hooks':!![]});db[_0xa14d('0x84')][_0xa14d('0x125')](db[_0xa14d('0x88')],{'as':{'plural':_0xa14d('0x1b1'),'singular':_0xa14d('0x1b2')},'foreignKey':_0xa14d('0x1b3'),'onDelete':_0xa14d('0x121'),'hooks':!![]});db[_0xa14d('0x84')][_0xa14d('0x125')](db['Action'],{'as':'Actions','foreignKey':_0xa14d('0x1b4'),'onDelete':_0xa14d('0x121'),'hooks':!![]});db[_0xa14d('0x86')][_0xa14d('0x125')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xa14d('0x1b5'),'onDelete':_0xa14d('0x121')});db['Interval']['hasMany'](db[_0xa14d('0x190')],{'as':'Intervals','foreignKey':'IntervalId','onDelete':_0xa14d('0x121'),'hooks':!![],'required':![]});db[_0xa14d('0x190')][_0xa14d('0x125')](db['VoiceExtension'],{'as':'Extensions','foreignKey':_0xa14d('0x161'),'onDelete':'restrict'});db['Interval'][_0xa14d('0x125')](db[_0xa14d('0x180')],{'as':_0xa14d('0x1b6'),'foreignKey':_0xa14d('0x161')});db[_0xa14d('0x190')][_0xa14d('0x125')](db['ChatApplication'],{'as':_0xa14d('0x1b7'),'foreignKey':_0xa14d('0x161')});db[_0xa14d('0x190')][_0xa14d('0x125')](db['FaxApplication'],{'as':_0xa14d('0x1b8'),'foreignKey':_0xa14d('0x161')});db[_0xa14d('0x190')][_0xa14d('0x125')](db[_0xa14d('0x5a')],{'as':_0xa14d('0x1b9'),'foreignKey':_0xa14d('0x161')});db[_0xa14d('0x90')][_0xa14d('0x134')](db['MailAccount'],{});db[_0xa14d('0x90')][_0xa14d('0x134')](db['AnalyticDefaultReport'],{'foreignKey':_0xa14d('0x1ba')});db[_0xa14d('0x90')][_0xa14d('0x134')](db['AnalyticCustomReport'],{'foreignKey':_0xa14d('0x1bb')});db[_0xa14d('0x91')]['belongsToMany'](db[_0xa14d('0x1a')],{'as':'Mohs','through':'moh_has_sounds','onDelete':_0xa14d('0x172')});db[_0xa14d('0x93')][_0xa14d('0x137')](db[_0xa14d('0x76')],{'through':_0xa14d('0x1ab')});db[_0xa14d('0x93')][_0xa14d('0x137')](db[_0xa14d('0x6d')],{'through':_0xa14d('0x1a2')});db['Tag'][_0xa14d('0x137')](db[_0xa14d('0x48')],{'through':_0xa14d('0x17b')});db[_0xa14d('0x93')][_0xa14d('0x137')](db['SmsInteraction'],{'through':'sms_interaction_has_tags'});db['Tag'][_0xa14d('0x137')](db[_0xa14d('0x52')],{'through':'fax_interaction_has_tags'});db['Tag'][_0xa14d('0x137')](db['OpenchannelInteraction'],{'through':_0xa14d('0x199')});db[_0xa14d('0x93')][_0xa14d('0x137')](db[_0xa14d('0x12f')],{'through':_0xa14d('0x1bc')});db['CmContactHasItem'][_0xa14d('0x134')](db[_0xa14d('0x95')],{'as':_0xa14d('0x1bd'),'foreignKey':_0xa14d('0x1be')});db['CmHopperAdditionalPhone'][_0xa14d('0x134')](db[_0xa14d('0x78')],{'as':_0xa14d('0x1bf'),'foreignKey':_0xa14d('0x1ad')});db[_0xa14d('0x96')][_0xa14d('0x134')](db[_0xa14d('0x76')],{'as':_0xa14d('0x16e'),'foreignKey':_0xa14d('0x1a8')});db[_0xa14d('0x9c')]['hasMany'](db[_0xa14d('0x88')],{'as':{'plural':'AllConditions','singular':'AllCondition'},'foreignKey':_0xa14d('0x1c0'),'onDelete':_0xa14d('0x121'),'hooks':!![]});db['Trigger'][_0xa14d('0x125')](db[_0xa14d('0x88')],{'as':{'plural':_0xa14d('0x1c1'),'singular':_0xa14d('0x1c2')},'foreignKey':_0xa14d('0x1c3'),'onDelete':'cascade','hooks':!![]});db['Trigger']['hasMany'](db['Action'],{'as':'Actions','foreignKey':_0xa14d('0x1c4'),'onDelete':'cascade','hooks':!![]});db[_0xa14d('0xa3')][_0xa14d('0x125')](db['AnalyticFieldReport'],{'as':_0xa14d('0x1c5'),'onDelete':_0xa14d('0x121'),'foreignKey':_0xa14d('0x1bb'),'hooks':!![]});db[_0xa14d('0x1c6')][_0xa14d('0x125')](db['AnalyticFieldReport'],{'as':_0xa14d('0x1c5'),'onDelete':_0xa14d('0x121'),'foreignKey':_0xa14d('0x1ba')});db[_0xa14d('0x1c7')][_0xa14d('0x125')](db[_0xa14d('0x1c8')],{'as':_0xa14d('0x1c5'),'onDelete':_0xa14d('0x121'),'foreignKey':_0xa14d('0x1c9')});db[_0xa14d('0x1c8')]['belongsTo'](db[_0xa14d('0x1c7')],{'foreignKey':'MetricId'});db['SalesforceAccount']['hasMany'](db['SalesforceConfiguration'],{'as':'Configurations','onDelete':_0xa14d('0x121'),'foreignKey':'AccountId'});db[_0xa14d('0xac')][_0xa14d('0x125')](db[_0xa14d('0xad')],{'as':'Subjects','onDelete':_0xa14d('0x121'),'foreignKey':_0xa14d('0x1ca')});db['SalesforceConfiguration'][_0xa14d('0x125')](db[_0xa14d('0xad')],{'as':_0xa14d('0x1cb'),'onDelete':_0xa14d('0x121'),'foreignKey':'DescriptionId'});db[_0xa14d('0xac')]['hasMany'](db[_0xa14d('0xad')],{'as':_0xa14d('0x1c5'),'onDelete':_0xa14d('0x121'),'foreignKey':_0xa14d('0x1cc')});db[_0xa14d('0xac')][_0xa14d('0x134')](db[_0xa14d('0xaa')],{'as':_0xa14d('0x17a'),'foreignKey':'AccountId'});db['SalesforceField'][_0xa14d('0x125')](db[_0xa14d('0xad')],{'as':_0xa14d('0x1cd'),'foreignKey':_0xa14d('0x1ca')});db[_0xa14d('0xad')][_0xa14d('0x125')](db['SalesforceField'],{'as':_0xa14d('0x1ce'),'foreignKey':'DescriptionId'});db['SalesforceField'][_0xa14d('0x125')](db[_0xa14d('0xad')],{'as':'Field','foreignKey':_0xa14d('0x1cc')});db['SalesforceField'][_0xa14d('0x134')](db['Variable'],{'as':_0xa14d('0x9d'),'foreignKey':'VariableId'});db[_0xa14d('0xaf')][_0xa14d('0x125')](db['SugarcrmConfiguration'],{'as':_0xa14d('0x1cf'),'onDelete':'cascade','foreignKey':'AccountId'});db['SugarcrmConfiguration']['hasMany'](db['SugarcrmField'],{'as':_0xa14d('0x1d0'),'onDelete':_0xa14d('0x121'),'foreignKey':_0xa14d('0x1ca')});db[_0xa14d('0xb1')][_0xa14d('0x125')](db['SugarcrmField'],{'as':_0xa14d('0x1cb'),'onDelete':_0xa14d('0x121'),'foreignKey':_0xa14d('0x1d1')});db[_0xa14d('0xb1')][_0xa14d('0x125')](db[_0xa14d('0xb3')],{'as':_0xa14d('0x1c5'),'onDelete':'cascade','foreignKey':_0xa14d('0x1cc')});db['SugarcrmConfiguration'][_0xa14d('0x134')](db[_0xa14d('0xaf')],{'as':_0xa14d('0x17a'),'foreignKey':_0xa14d('0x1d2')});db[_0xa14d('0xb3')]['hasMany'](db[_0xa14d('0xb3')],{'as':'Subject','foreignKey':'SubjectId'});db['SugarcrmField'][_0xa14d('0x125')](db[_0xa14d('0xb3')],{'as':_0xa14d('0x1ce'),'foreignKey':_0xa14d('0x1d1')});db[_0xa14d('0xb3')][_0xa14d('0x125')](db[_0xa14d('0xb3')],{'as':'Field','foreignKey':'FieldId'});db[_0xa14d('0xb3')][_0xa14d('0x134')](db['Variable'],{'as':_0xa14d('0x9d'),'foreignKey':_0xa14d('0x1d3')});db[_0xa14d('0xb5')][_0xa14d('0x125')](db[_0xa14d('0x1d4')],{'as':_0xa14d('0x1cf'),'onDelete':_0xa14d('0x121'),'foreignKey':'AccountId'});db[_0xa14d('0x1d4')][_0xa14d('0x125')](db[_0xa14d('0xb8')],{'as':_0xa14d('0x1d0'),'onDelete':_0xa14d('0x121'),'foreignKey':_0xa14d('0x1ca')});db[_0xa14d('0x1d4')]['hasMany'](db[_0xa14d('0xb8')],{'as':_0xa14d('0x1cb'),'onDelete':_0xa14d('0x121'),'foreignKey':_0xa14d('0x1d1')});db[_0xa14d('0x1d4')][_0xa14d('0x125')](db[_0xa14d('0xb8')],{'as':_0xa14d('0x1c5'),'onDelete':_0xa14d('0x121'),'foreignKey':_0xa14d('0x1cc')});db[_0xa14d('0x1d4')][_0xa14d('0x134')](db[_0xa14d('0xb5')],{'as':_0xa14d('0x17a'),'foreignKey':_0xa14d('0x1d2')});db[_0xa14d('0x1d4')]['belongsToMany'](db[_0xa14d('0x93')],{'through':_0xa14d('0x1d5')});db[_0xa14d('0xb8')][_0xa14d('0x125')](db[_0xa14d('0xb8')],{'as':_0xa14d('0x1cd'),'foreignKey':_0xa14d('0x1ca')});db[_0xa14d('0xb8')][_0xa14d('0x125')](db['DeskField'],{'as':'Description','foreignKey':_0xa14d('0x1d1')});db['DeskField'][_0xa14d('0x125')](db['DeskField'],{'as':_0xa14d('0x1d6'),'foreignKey':_0xa14d('0x1cc')});db[_0xa14d('0xb8')][_0xa14d('0x134')](db[_0xa14d('0x9d')],{'as':'Variable','foreignKey':_0xa14d('0x1d3')});db[_0xa14d('0xb9')]['hasMany'](db[_0xa14d('0xba')],{'as':_0xa14d('0x1cf'),'onDelete':'cascade','foreignKey':_0xa14d('0x1d2')});db['ZohoConfiguration'][_0xa14d('0x125')](db[_0xa14d('0xbb')],{'as':_0xa14d('0x1d0'),'onDelete':'cascade','foreignKey':_0xa14d('0x1ca')});db['ZohoConfiguration'][_0xa14d('0x125')](db[_0xa14d('0xbb')],{'as':'Descriptions','onDelete':_0xa14d('0x121'),'foreignKey':_0xa14d('0x1d1')});db[_0xa14d('0xba')][_0xa14d('0x125')](db['ZohoField'],{'as':_0xa14d('0x1c5'),'onDelete':_0xa14d('0x121'),'foreignKey':_0xa14d('0x1cc')});db[_0xa14d('0xba')][_0xa14d('0x134')](db[_0xa14d('0xb9')],{'as':_0xa14d('0x17a'),'foreignKey':_0xa14d('0x1d2')});db[_0xa14d('0xbb')][_0xa14d('0x125')](db[_0xa14d('0xbb')],{'as':_0xa14d('0x1cd'),'foreignKey':_0xa14d('0x1ca')});db[_0xa14d('0xbb')][_0xa14d('0x125')](db[_0xa14d('0xbb')],{'as':_0xa14d('0x1ce'),'foreignKey':_0xa14d('0x1d1')});db[_0xa14d('0xbb')][_0xa14d('0x125')](db[_0xa14d('0xbb')],{'as':_0xa14d('0x1d6'),'foreignKey':_0xa14d('0x1cc')});db['ZohoField']['belongsTo'](db[_0xa14d('0x9d')],{'as':_0xa14d('0x9d'),'foreignKey':_0xa14d('0x1d3')});db['ZendeskAccount'][_0xa14d('0x125')](db['ZendeskConfiguration'],{'as':_0xa14d('0x1cf'),'onDelete':_0xa14d('0x121'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0xa14d('0x125')](db[_0xa14d('0xbf')],{'as':'Subjects','foreignKey':_0xa14d('0x1ca')});db[_0xa14d('0xbd')][_0xa14d('0x125')](db[_0xa14d('0xbf')],{'as':'Descriptions','foreignKey':_0xa14d('0x1d1')});db[_0xa14d('0xbd')][_0xa14d('0x125')](db[_0xa14d('0xbf')],{'as':_0xa14d('0x1c5'),'foreignKey':'FieldId'});db['ZendeskConfiguration']['belongsTo'](db[_0xa14d('0x1d7')],{'as':_0xa14d('0x17a'),'foreignKey':_0xa14d('0x1d2')});db[_0xa14d('0xbd')][_0xa14d('0x137')](db[_0xa14d('0x93')],{'through':_0xa14d('0x1d8')});db[_0xa14d('0xbf')][_0xa14d('0x125')](db[_0xa14d('0xbf')],{'as':_0xa14d('0x1cd'),'foreignKey':_0xa14d('0x1ca')});db['ZendeskField']['hasMany'](db[_0xa14d('0xbf')],{'as':'Description','foreignKey':_0xa14d('0x1d1')});db[_0xa14d('0xbf')]['hasMany'](db[_0xa14d('0xbf')],{'as':_0xa14d('0x1d6'),'foreignKey':_0xa14d('0x1cc')});db[_0xa14d('0xbf')][_0xa14d('0x134')](db[_0xa14d('0x9d')],{'as':'Variable','foreignKey':'VariableId'});db[_0xa14d('0xc0')][_0xa14d('0x125')](db[_0xa14d('0x1d9')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xa14d('0x1d2')});db[_0xa14d('0x1d9')]['hasMany'](db[_0xa14d('0xc2')],{'as':_0xa14d('0x1d0'),'onDelete':_0xa14d('0x121'),'foreignKey':_0xa14d('0x1ca')});db[_0xa14d('0x1d9')]['hasMany'](db['FreshdeskField'],{'as':_0xa14d('0x1cb'),'onDelete':_0xa14d('0x121'),'foreignKey':_0xa14d('0x1d1')});db[_0xa14d('0x1d9')][_0xa14d('0x125')](db[_0xa14d('0xc2')],{'as':'Fields','onDelete':_0xa14d('0x121'),'foreignKey':_0xa14d('0x1cc')});db[_0xa14d('0x1d9')][_0xa14d('0x134')](db['FreshdeskAccount'],{'as':'Account','foreignKey':_0xa14d('0x1d2')});db[_0xa14d('0x1d9')]['belongsToMany'](db[_0xa14d('0x93')],{'through':'int_freshdesk_configuration_has_tags'});db['FreshdeskField'][_0xa14d('0x125')](db['FreshdeskField'],{'as':_0xa14d('0x1cd'),'foreignKey':_0xa14d('0x1ca')});db[_0xa14d('0xc2')][_0xa14d('0x125')](db[_0xa14d('0xc2')],{'as':_0xa14d('0x1ce'),'foreignKey':_0xa14d('0x1d1')});db['FreshdeskField'][_0xa14d('0x125')](db[_0xa14d('0xc2')],{'as':_0xa14d('0x1d6'),'foreignKey':_0xa14d('0x1cc')});db[_0xa14d('0xc2')]['belongsTo'](db[_0xa14d('0x9d')],{'as':'Variable','foreignKey':_0xa14d('0x1d3')});db[_0xa14d('0xc4')][_0xa14d('0x125')](db['VtigerConfiguration'],{'as':_0xa14d('0x1cf'),'onDelete':_0xa14d('0x121'),'foreignKey':_0xa14d('0x1d2')});db[_0xa14d('0xc6')]['hasMany'](db[_0xa14d('0xc8')],{'as':_0xa14d('0x1d0'),'foreignKey':_0xa14d('0x1ca')});db[_0xa14d('0xc6')]['hasMany'](db[_0xa14d('0xc8')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0xa14d('0xc6')]['hasMany'](db[_0xa14d('0xc8')],{'as':'Fields','foreignKey':_0xa14d('0x1cc')});db[_0xa14d('0xc6')]['belongsTo'](db[_0xa14d('0xc4')],{'as':_0xa14d('0x17a'),'foreignKey':_0xa14d('0x1d2')});db[_0xa14d('0xc8')][_0xa14d('0x125')](db['VtigerField'],{'as':_0xa14d('0x1cd'),'foreignKey':'SubjectId'});db[_0xa14d('0xc8')][_0xa14d('0x125')](db[_0xa14d('0xc8')],{'as':_0xa14d('0x1ce'),'foreignKey':_0xa14d('0x1d1')});db['VtigerField']['hasMany'](db[_0xa14d('0xc8')],{'as':_0xa14d('0x1d6'),'foreignKey':_0xa14d('0x1cc')});db[_0xa14d('0xc8')][_0xa14d('0x134')](db['Variable'],{'as':_0xa14d('0x9d'),'foreignKey':_0xa14d('0x1d3')});db[_0xa14d('0xca')][_0xa14d('0x125')](db[_0xa14d('0xcc')],{'as':_0xa14d('0x1cf'),'onDelete':_0xa14d('0x121'),'foreignKey':_0xa14d('0x1d2')});db['ServicenowConfiguration']['hasMany'](db[_0xa14d('0x1da')],{'as':_0xa14d('0x1d0'),'foreignKey':_0xa14d('0x1ca')});db['ServicenowConfiguration'][_0xa14d('0x125')](db[_0xa14d('0x1da')],{'as':_0xa14d('0x1cb'),'foreignKey':_0xa14d('0x1d1')});db[_0xa14d('0xcc')][_0xa14d('0x125')](db[_0xa14d('0x1da')],{'as':_0xa14d('0x1c5'),'foreignKey':_0xa14d('0x1cc')});db[_0xa14d('0xcc')]['belongsTo'](db[_0xa14d('0xca')],{'as':_0xa14d('0x17a'),'foreignKey':_0xa14d('0x1d2')});db['ServicenowField'][_0xa14d('0x125')](db[_0xa14d('0x1da')],{'as':_0xa14d('0x1cd'),'foreignKey':_0xa14d('0x1ca')});db[_0xa14d('0x1da')][_0xa14d('0x125')](db[_0xa14d('0x1da')],{'as':_0xa14d('0x1ce'),'foreignKey':_0xa14d('0x1d1')});db[_0xa14d('0x1da')]['hasMany'](db['ServicenowField'],{'as':_0xa14d('0x1d6'),'foreignKey':'FieldId'});db[_0xa14d('0x1da')][_0xa14d('0x134')](db[_0xa14d('0x9d')],{'as':_0xa14d('0x9d'),'foreignKey':'VariableId'});db[_0xa14d('0x1db')][_0xa14d('0x125')](db[_0xa14d('0x1dc')],{'as':_0xa14d('0x1cf'),'onDelete':'cascade','foreignKey':_0xa14d('0x1d2')});db[_0xa14d('0x1db')]['belongsTo'](db[_0xa14d('0x118')],{'as':_0xa14d('0x118'),'foreignKey':_0xa14d('0x171')});db[_0xa14d('0x1dc')][_0xa14d('0x125')](db[_0xa14d('0xd0')],{'as':_0xa14d('0x1d0'),'onDelete':_0xa14d('0x121'),'foreignKey':_0xa14d('0x1ca')});db[_0xa14d('0x1dc')][_0xa14d('0x125')](db[_0xa14d('0xd0')],{'as':_0xa14d('0x1cb'),'onDelete':_0xa14d('0x121'),'foreignKey':_0xa14d('0x1d1')});db[_0xa14d('0x1dc')][_0xa14d('0x125')](db['Dynamics365Field'],{'as':'Fields','onDelete':_0xa14d('0x121'),'foreignKey':_0xa14d('0x1cc')});db[_0xa14d('0x1dc')][_0xa14d('0x134')](db[_0xa14d('0x1db')],{'as':_0xa14d('0x17a'),'foreignKey':'AccountId'});db[_0xa14d('0xd0')]['hasMany'](db[_0xa14d('0xd0')],{'as':_0xa14d('0x1cd'),'foreignKey':'SubjectId'});db[_0xa14d('0xd0')]['hasMany'](db['Dynamics365Field'],{'as':_0xa14d('0x1ce'),'foreignKey':'DescriptionId'});db[_0xa14d('0xd0')][_0xa14d('0x125')](db[_0xa14d('0xd0')],{'as':'Field','foreignKey':_0xa14d('0x1cc')});db[_0xa14d('0xd0')]['belongsTo'](db['Variable'],{'as':_0xa14d('0x9d'),'foreignKey':_0xa14d('0x1d3')});db[_0xa14d('0xd2')][_0xa14d('0x125')](db[_0xa14d('0xd4')],{'as':_0xa14d('0x1cf'),'onDelete':_0xa14d('0x121'),'foreignKey':_0xa14d('0x1d2')});db[_0xa14d('0xd4')]['hasMany'](db[_0xa14d('0xd6')],{'as':_0xa14d('0x1d0'),'foreignKey':'SubjectId'});db[_0xa14d('0xd4')][_0xa14d('0x125')](db[_0xa14d('0xd6')],{'as':_0xa14d('0x1cb'),'foreignKey':'DescriptionId'});db['FreshsalesConfiguration'][_0xa14d('0x125')](db[_0xa14d('0xd6')],{'as':_0xa14d('0x1c5'),'foreignKey':_0xa14d('0x1cc')});db['FreshsalesConfiguration'][_0xa14d('0x134')](db['FreshsalesAccount'],{'as':_0xa14d('0x17a'),'foreignKey':_0xa14d('0x1d2')});db[_0xa14d('0xd6')][_0xa14d('0x125')](db[_0xa14d('0xd6')],{'as':_0xa14d('0x1cd'),'foreignKey':_0xa14d('0x1ca')});db['FreshsalesField'][_0xa14d('0x125')](db[_0xa14d('0xd6')],{'as':'Description','foreignKey':_0xa14d('0x1d1')});db[_0xa14d('0xd6')]['hasMany'](db['FreshsalesField'],{'as':_0xa14d('0x1d6'),'foreignKey':_0xa14d('0x1cc')});db['FreshsalesField'][_0xa14d('0x134')](db[_0xa14d('0x9d')],{'as':_0xa14d('0x9d'),'foreignKey':_0xa14d('0x1d3')});db[_0xa14d('0xda')][_0xa14d('0x134')](db['ChatWebsite'],{});db[_0xa14d('0xda')][_0xa14d('0x134')](db[_0xa14d('0x104')],{'as':_0xa14d('0x181'),'foreignKey':_0xa14d('0x182')});db[_0xa14d('0xda')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0xa14d('0x16f')});db[_0xa14d('0xda')][_0xa14d('0x134')](db[_0xa14d('0x6d')],{});db[_0xa14d('0xda')][_0xa14d('0x134')](db['ChatMessage'],{});db[_0xa14d('0xda')]['belongsTo'](db[_0xa14d('0x14')],{});db['ChatQueueReport'][_0xa14d('0x134')](db[_0xa14d('0x71')],{});db[_0xa14d('0xdc')][_0xa14d('0x134')](db['User'],{'onDelete':_0xa14d('0x121'),'foreignKey':'FromId'});db[_0xa14d('0xdc')][_0xa14d('0x134')](db['User'],{'onDelete':'cascade','foreignKey':'ToId'});db[_0xa14d('0xe2')]['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':_0xa14d('0x1dd'),'onDelete':'cascade'});db[_0xa14d('0xe2')][_0xa14d('0x125')](db[_0xa14d('0xde')],{'foreignKey':_0xa14d('0x1dd'),'onDelete':'cascade'});db[_0xa14d('0xe4')][_0xa14d('0x134')](db['SmsAccount'],{});db[_0xa14d('0xe4')][_0xa14d('0x134')](db[_0xa14d('0x104')],{'as':'List','foreignKey':'ListId'});db[_0xa14d('0xe4')][_0xa14d('0x134')](db['CmContact'],{'as':_0xa14d('0x16e'),'foreignKey':_0xa14d('0x16f')});db[_0xa14d('0xe4')][_0xa14d('0x134')](db[_0xa14d('0x5c')],{});db['SmsQueueReport'][_0xa14d('0x134')](db[_0xa14d('0x5e')],{});db['SmsQueueReport'][_0xa14d('0x134')](db['User'],{});db[_0xa14d('0xe4')][_0xa14d('0x134')](db[_0xa14d('0x60')],{});db['JscriptyProject'][_0xa14d('0x125')](db[_0xa14d('0xe2')],{'foreignKey':_0xa14d('0x1de')});db[_0xa14d('0xe9')][_0xa14d('0x125')](db['JscriptyQuestionReport'],{'foreignKey':_0xa14d('0x1de')});db[_0xa14d('0xe9')][_0xa14d('0x125')](db[_0xa14d('0xde')],{'foreignKey':'ProjectId'});db[_0xa14d('0xee')][_0xa14d('0x137')](db[_0xa14d('0x14')],{'as':_0xa14d('0x17d'),'through':_0xa14d('0x155')});db[_0xa14d('0xf2')][_0xa14d('0x137')](db['User'],{'as':_0xa14d('0x164'),'through':'user_has_teams'});db[_0xa14d('0xf2')][_0xa14d('0x137')](db[_0xa14d('0x142')],{'through':_0xa14d('0x11a'),'as':'VoiceQueues'});db[_0xa14d('0xf2')][_0xa14d('0x137')](db['MailQueue'],{'through':'team_has_mail_queues','as':_0xa14d('0x1df')});db['Team']['belongsToMany'](db['ChatQueue'],{'through':_0xa14d('0x1a4'),'as':_0xa14d('0x145')});db[_0xa14d('0xf2')][_0xa14d('0x137')](db[_0xa14d('0x55')],{'through':'team_has_fax_queues','as':_0xa14d('0x1e0')});db[_0xa14d('0xf2')][_0xa14d('0x137')](db[_0xa14d('0x60')],{'through':'team_has_sms_queues','as':_0xa14d('0x146')});db[_0xa14d('0xf2')]['belongsToMany'](db['OpenchannelQueue'],{'through':_0xa14d('0x19a'),'as':'OpenchannelQueues'});db[_0xa14d('0xf2')][_0xa14d('0x137')](db[_0xa14d('0x116')],{'through':_0xa14d('0x1e1'),'as':_0xa14d('0x147')});db['Team']['belongsToMany'](db['VoicePrefix'],{'through':_0xa14d('0x11c'),'as':_0xa14d('0x144')});db[_0xa14d('0xf5')][_0xa14d('0x125')](db[_0xa14d('0x78')],{'as':_0xa14d('0x15c'),'foreignKey':_0xa14d('0x1ae')});db[_0xa14d('0xf5')][_0xa14d('0x125')](db[_0xa14d('0x7b')],{'as':_0xa14d('0x128'),'foreignKey':'CampaignId'});db[_0xa14d('0xf5')][_0xa14d('0x125')](db[_0xa14d('0x7d')],{'as':_0xa14d('0x1a9'),'foreignKey':_0xa14d('0x1ae')});db[_0xa14d('0xf5')][_0xa14d('0x125')](db[_0xa14d('0x7a')],{'as':_0xa14d('0x15d'),'foreignKey':_0xa14d('0x1ae')});db[_0xa14d('0xf5')][_0xa14d('0x134')](db[_0xa14d('0x2b')],{'as':_0xa14d('0x2b'),'foreignKey':_0xa14d('0x15f')});db['Campaign']['belongsTo'](db[_0xa14d('0x2b')],{'as':_0xa14d('0x1e2'),'foreignKey':_0xa14d('0x160')});db[_0xa14d('0xf5')][_0xa14d('0x134')](db[_0xa14d('0x190')],{'as':'Interval','foreignKey':_0xa14d('0x161')});db[_0xa14d('0xf5')][_0xa14d('0x134')](db[_0xa14d('0xee')],{'as':_0xa14d('0xee'),'foreignKey':_0xa14d('0x1e3')});db['Campaign'][_0xa14d('0x137')](db[_0xa14d('0x104')],{'as':_0xa14d('0x13b'),'through':'campaigns_has_cm_lists'});db[_0xa14d('0xf5')][_0xa14d('0x137')](db[_0xa14d('0x104')],{'as':_0xa14d('0x166'),'through':_0xa14d('0x1e4')});db['Attachment'][_0xa14d('0x134')](db[_0xa14d('0x70')],{'as':_0xa14d('0x70'),'foreignKey':_0xa14d('0x17f')});db[_0xa14d('0xfd')][_0xa14d('0x134')](db[_0xa14d('0x49')],{});db[_0xa14d('0xfd')][_0xa14d('0x134')](db[_0xa14d('0x48')],{});db[_0xa14d('0xfd')][_0xa14d('0x134')](db[_0xa14d('0x14c')],{'foreignKey':_0xa14d('0x1e5'),'as':_0xa14d('0x1e6')});db[_0xa14d('0xfd')][_0xa14d('0x134')](db[_0xa14d('0x14')],{'foreignKey':'FromUserId','as':_0xa14d('0x1e7')});db[_0xa14d('0xfd')]['belongsTo'](db[_0xa14d('0x14')],{'foreignKey':_0xa14d('0x1e8'),'as':_0xa14d('0x1e9')});db[_0xa14d('0xfd')][_0xa14d('0x134')](db['MailQueue'],{'foreignKey':_0xa14d('0x1ea'),'as':'ToQueue'});db[_0xa14d('0xfd')][_0xa14d('0x134')](db[_0xa14d('0x14c')],{'foreignKey':_0xa14d('0x1eb'),'as':'ToAccount'});db[_0xa14d('0xfe')]['belongsTo'](db[_0xa14d('0x6e')],{});db['ChatTransferReport'][_0xa14d('0x134')](db[_0xa14d('0x6d')],{});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0xa14d('0x1ec'),'as':_0xa14d('0x1e6')});db['ChatTransferReport']['belongsTo'](db['User'],{'foreignKey':_0xa14d('0x1ed'),'as':'FromAgent'});db[_0xa14d('0xfe')][_0xa14d('0x134')](db[_0xa14d('0x14')],{'foreignKey':_0xa14d('0x1e8'),'as':_0xa14d('0x1e9')});db[_0xa14d('0xfe')]['belongsTo'](db[_0xa14d('0x71')],{'foreignKey':_0xa14d('0x1ee'),'as':_0xa14d('0x1ef')});db[_0xa14d('0xfe')][_0xa14d('0x134')](db[_0xa14d('0x6a')],{'foreignKey':_0xa14d('0x1f0'),'as':'ToAccount'});db[_0xa14d('0x100')][_0xa14d('0x134')](db['FaxMessage'],{});db[_0xa14d('0x100')][_0xa14d('0x134')](db[_0xa14d('0x52')],{});db[_0xa14d('0x100')][_0xa14d('0x134')](db[_0xa14d('0x14b')],{'foreignKey':_0xa14d('0x1f1'),'as':_0xa14d('0x1e6')});db[_0xa14d('0x100')][_0xa14d('0x134')](db['User'],{'foreignKey':_0xa14d('0x1ed'),'as':_0xa14d('0x1e7')});db[_0xa14d('0x100')][_0xa14d('0x134')](db[_0xa14d('0x14')],{'foreignKey':_0xa14d('0x1e8'),'as':_0xa14d('0x1e9')});db[_0xa14d('0x100')][_0xa14d('0x134')](db[_0xa14d('0x55')],{'foreignKey':_0xa14d('0x1f2'),'as':_0xa14d('0x1ef')});db[_0xa14d('0x100')]['belongsTo'](db[_0xa14d('0x14b')],{'foreignKey':_0xa14d('0x1f3'),'as':_0xa14d('0x1f4')});db[_0xa14d('0x102')][_0xa14d('0x134')](db[_0xa14d('0x67')],{});db['OpenchannelTransferReport']['belongsTo'](db[_0xa14d('0x65')],{});db[_0xa14d('0x102')][_0xa14d('0x134')](db[_0xa14d('0x195')],{'foreignKey':'FromOpenchannelAccountId','as':_0xa14d('0x1e6')});db['OpenchannelTransferReport']['belongsTo'](db[_0xa14d('0x14')],{'foreignKey':'FromUserId','as':_0xa14d('0x1e7')});db['OpenchannelTransferReport'][_0xa14d('0x134')](db[_0xa14d('0x14')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xa14d('0x102')][_0xa14d('0x134')](db['OpenchannelQueue'],{'foreignKey':_0xa14d('0x1f5'),'as':_0xa14d('0x1ef')});db[_0xa14d('0x102')][_0xa14d('0x134')](db[_0xa14d('0x195')],{'foreignKey':'ToOpenchannelAccountId','as':_0xa14d('0x1f4')});db[_0xa14d('0x1f6')][_0xa14d('0x134')](db[_0xa14d('0x5e')],{});db[_0xa14d('0x1f6')]['belongsTo'](db[_0xa14d('0x5c')],{});db[_0xa14d('0x1f6')][_0xa14d('0x134')](db[_0xa14d('0x150')],{'foreignKey':'FromSmsAccountId','as':_0xa14d('0x1e6')});db['SmsTransferReport']['belongsTo'](db[_0xa14d('0x14')],{'foreignKey':_0xa14d('0x1ed'),'as':_0xa14d('0x1e7')});db[_0xa14d('0x1f6')]['belongsTo'](db[_0xa14d('0x14')],{'foreignKey':_0xa14d('0x1e8'),'as':_0xa14d('0x1e9')});db['SmsTransferReport'][_0xa14d('0x134')](db[_0xa14d('0x60')],{'foreignKey':_0xa14d('0x1f7'),'as':_0xa14d('0x1ef')});db[_0xa14d('0x1f6')]['belongsTo'](db['SmsAccount'],{'foreignKey':_0xa14d('0x1f8'),'as':_0xa14d('0x1f4')});db[_0xa14d('0x104')][_0xa14d('0x125')](db['Disposition'],{'as':_0xa14d('0x184'),'foreignKey':_0xa14d('0x182'),'onDelete':_0xa14d('0x121')});db[_0xa14d('0x104')][_0xa14d('0x125')](db[_0xa14d('0x81')],{'as':_0xa14d('0x1f9'),'foreignKey':_0xa14d('0x182')});db[_0xa14d('0x104')][_0xa14d('0x125')](db[_0xa14d('0x76')],{'as':_0xa14d('0x13a'),'onDelete':_0xa14d('0x121'),'foreignKey':_0xa14d('0x182')});db[_0xa14d('0x104')][_0xa14d('0x125')](db[_0xa14d('0x7b')],{'as':_0xa14d('0x128'),'foreignKey':_0xa14d('0x182')});db[_0xa14d('0x104')][_0xa14d('0x125')](db[_0xa14d('0x7d')],{'as':_0xa14d('0x129'),'foreignKey':_0xa14d('0x182')});db[_0xa14d('0x104')]['hasMany'](db['ReportAgentPreview'],{'as':_0xa14d('0x7f'),'foreignKey':_0xa14d('0x182')});db[_0xa14d('0x104')][_0xa14d('0x137')](db['VoiceQueue'],{'as':_0xa14d('0x1fa'),'through':_0xa14d('0x163')});db['CmList'][_0xa14d('0x137')](db[_0xa14d('0x14')],{'as':'Agents','through':_0xa14d('0x148')});db[_0xa14d('0x105')]['hasMany'](db['VoiceExtension'],{'as':_0xa14d('0x1fb'),'onDelete':_0xa14d('0x121')});db['VoicePrefix'][_0xa14d('0x137')](db[_0xa14d('0x14')],{'as':_0xa14d('0x164'),'through':_0xa14d('0x11e')});db[_0xa14d('0x105')][_0xa14d('0x137')](db[_0xa14d('0xf2')],{'through':_0xa14d('0x11c'),'as':_0xa14d('0x165')});db['UserProfile'][_0xa14d('0x125')](db[_0xa14d('0x14')],{'as':_0xa14d('0x17d'),'foreignKey':_0xa14d('0x136')});db['UserProfile'][_0xa14d('0x125')](db[_0xa14d('0x107')],{'as':_0xa14d('0x1fc'),'foreignKey':'userProfileId','onDelete':_0xa14d('0x121')});db[_0xa14d('0x107')][_0xa14d('0x125')](db[_0xa14d('0x109')],{'as':_0xa14d('0x1fd'),'foreignKey':_0xa14d('0x1fe'),'onDelete':_0xa14d('0x121')});db[_0xa14d('0x10c')][_0xa14d('0x125')](db[_0xa14d('0x86')],{'as':_0xa14d('0x184'),'foreignKey':_0xa14d('0x1ff'),'onDelete':'cascade'});db[_0xa14d('0x10c')][_0xa14d('0x125')](db['CannedAnswer'],{'as':_0xa14d('0x174'),'foreignKey':_0xa14d('0x1ff')});db[_0xa14d('0x10c')][_0xa14d('0x125')](db[_0xa14d('0x110')],{'as':'Messages','foreignKey':_0xa14d('0x1ff')});db[_0xa14d('0x10c')][_0xa14d('0x125')](db[_0xa14d('0x12f')],{'as':_0xa14d('0x175')});db[_0xa14d('0x10c')][_0xa14d('0x125')](db[_0xa14d('0x10d')],{'as':_0xa14d('0x159')});db[_0xa14d('0x10c')]['belongsTo'](db[_0xa14d('0x104')],{'as':_0xa14d('0x181'),'foreignKey':_0xa14d('0x182')});db[_0xa14d('0x10c')][_0xa14d('0x134')](db[_0xa14d('0x8b')],{'as':'mandatoryDispositionPause','foreignKey':_0xa14d('0x176')});db[_0xa14d('0x10c')][_0xa14d('0x137')](db['User'],{'as':_0xa14d('0x164'),'through':_0xa14d('0x153')});db[_0xa14d('0x10d')][_0xa14d('0x134')](db['User'],{'onDelete':'restrict'});db[_0xa14d('0x10d')][_0xa14d('0x134')](db[_0xa14d('0x116')],{'onDelete':'restrict'});db[_0xa14d('0x10d')][_0xa14d('0x134')](db[_0xa14d('0x10c')],{'onDelete':_0xa14d('0x172')});db['WhatsappApplication'][_0xa14d('0x134')](db[_0xa14d('0x190')],{'onDelete':_0xa14d('0x172'),'foreignKey':_0xa14d('0x161')});db[_0xa14d('0x10d')]['belongsTo'](db[_0xa14d('0x93')],{'onDelete':_0xa14d('0x172'),'foreignKey':'TagId'});db[_0xa14d('0x12f')][_0xa14d('0x125')](db[_0xa14d('0x110')],{'as':'Messages','onDelete':'cascade','foreignKey':_0xa14d('0x200')});db[_0xa14d('0x12f')][_0xa14d('0x134')](db[_0xa14d('0x10c')],{'as':_0xa14d('0x17a'),'foreignKey':_0xa14d('0x1ff')});db['WhatsappInteraction']['belongsTo'](db['CmContact'],{'as':_0xa14d('0x16e'),'foreignKey':_0xa14d('0x16f')});db[_0xa14d('0x12f')][_0xa14d('0x134')](db['User'],{'as':_0xa14d('0x192'),'foreignKey':_0xa14d('0x122')});db[_0xa14d('0x12f')]['belongsToMany'](db[_0xa14d('0x93')],{'through':'whatsapp_interaction_has_tags','as':_0xa14d('0x17c')});db['WhatsappInteraction']['belongsToMany'](db[_0xa14d('0x93')],{'through':_0xa14d('0x1bc'),'as':_0xa14d('0x18c')});db[_0xa14d('0x12f')][_0xa14d('0x137')](db[_0xa14d('0x14')],{'as':_0xa14d('0x17d'),'through':_0xa14d('0x141'),'foreignKey':'WhatsappInteractionId'});db[_0xa14d('0x110')][_0xa14d('0x134')](db[_0xa14d('0x14')],{'as':'User'});db['WhatsappMessage'][_0xa14d('0x134')](db[_0xa14d('0x76')],{'onDelete':_0xa14d('0x121'),'as':_0xa14d('0x16e')});db[_0xa14d('0x110')][_0xa14d('0x134')](db[_0xa14d('0x12f')],{'onDelete':_0xa14d('0x121'),'as':_0xa14d('0x17e'),'foreignKey':_0xa14d('0x200')});db[_0xa14d('0x110')]['belongsTo'](db[_0xa14d('0x10c')],{'as':_0xa14d('0x17a'),'foreignKey':_0xa14d('0x1ff')});db[_0xa14d('0x112')]['belongsTo'](db[_0xa14d('0x10c')],{});db[_0xa14d('0x112')]['belongsTo'](db[_0xa14d('0x104')],{'as':_0xa14d('0x181'),'foreignKey':_0xa14d('0x182')});db[_0xa14d('0x112')]['belongsTo'](db[_0xa14d('0x76')],{'as':_0xa14d('0x16e'),'foreignKey':_0xa14d('0x16f')});db['WhatsappQueueReport'][_0xa14d('0x134')](db[_0xa14d('0x12f')],{});db['WhatsappQueueReport'][_0xa14d('0x134')](db[_0xa14d('0x116')],{});db[_0xa14d('0x112')][_0xa14d('0x134')](db['WhatsappMessage'],{});db[_0xa14d('0x112')]['belongsTo'](db[_0xa14d('0x14')],{});db[_0xa14d('0x114')][_0xa14d('0x134')](db['WhatsappMessage'],{});db['WhatsappTransferReport'][_0xa14d('0x134')](db[_0xa14d('0x12f')],{});db['WhatsappTransferReport'][_0xa14d('0x134')](db[_0xa14d('0x10c')],{'foreignKey':_0xa14d('0x201'),'as':_0xa14d('0x1e6')});db[_0xa14d('0x114')][_0xa14d('0x134')](db['WhatsappAccount'],{'foreignKey':_0xa14d('0x202'),'as':_0xa14d('0x1f4')});db[_0xa14d('0x114')]['belongsTo'](db[_0xa14d('0x116')],{'foreignKey':_0xa14d('0x203'),'as':_0xa14d('0x1ef')});db['WhatsappTransferReport'][_0xa14d('0x134')](db[_0xa14d('0x14')],{'foreignKey':'FromUserId','as':_0xa14d('0x1e7')});db[_0xa14d('0x114')][_0xa14d('0x134')](db[_0xa14d('0x14')],{'foreignKey':_0xa14d('0x1e8'),'as':'ToAgent'});db['WhatsappQueue'][_0xa14d('0x137')](db[_0xa14d('0x14')],{'as':'Agents','through':'UserWhatsappQueue','foreignKey':_0xa14d('0x204')});db[_0xa14d('0x116')][_0xa14d('0x137')](db[_0xa14d('0xf2')],{'through':_0xa14d('0x1e1'),'as':'Teams'});db[_0xa14d('0x123')][_0xa14d('0x134')](db[_0xa14d('0x14')],{'as':_0xa14d('0x205'),'foreignKey':'UserId','onDelete':_0xa14d('0x121'),'hooks':!![]});db[_0xa14d('0x118')]['hasOne'](db[_0xa14d('0x1db')],{'as':_0xa14d('0x1db'),'onDelete':_0xa14d('0x172')});db[_0xa14d('0x118')][_0xa14d('0x120')](db[_0xa14d('0x3f')],{'as':'Imap','onDelete':_0xa14d('0x172')});db[_0xa14d('0x118')][_0xa14d('0x120')](db['MailServerOut'],{'as':_0xa14d('0x206'),'onDelete':'restrict'});module[_0xa14d('0x207')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 601b05e..f2abe22 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x85ec=['/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMailMessage','/api/voice/calls/reports','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/fax/accounts','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','/api/sms/messages','/api/sms/queues','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./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/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','./api/action','/api/automations','./api/automation','./api/cannedAnswer','/api/dispositions','./api/disposition','./api/condition','/api/intervals','./api/interval','./api/pause','./api/cdr','./api/voiceQueuesLog','/api/schedules','/api/sounds','./api/sound','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','/api/square/reports','./api/squareReport','/api/square/details/reports','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','/api/plugins','/api/mail/reports/transfer','/api/chat/reports/transfer','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','/api/cm/lists','./api/cmList','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','/api/whatsapp/queues','/api/cloudProviders','/api/realtime','./api/user-setting','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','/api/rpc','./api/rpc','./api/system','/api/pm2','./api/pm2','./api/webbar','/api/logs','/apidoc','static','join','root','/www','/demo','/snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','express','./errors','./config/environment','setupLoggers','./api/client-side-logs','default','then','use'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x85ec,0x113));var _0xc85e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x85ec[_0x3dd15e];return _0x231fd0;};'use strict';var path=require('path');var express=require(_0xc85e('0x0'));var errors=require(_0xc85e('0x1'));var config=require(_0xc85e('0x2'));var setupLoggers=require('./utils/client-side-logger')[_0xc85e('0x3')];var clientSideLogs=require(_0xc85e('0x4'));exports[_0xc85e('0x5')]=function(_0x2725a8){return setupLoggers(_0x2725a8)[_0xc85e('0x6')](function(){_0x2725a8[_0xc85e('0x7')](_0xc85e('0x8'),require(_0xc85e('0x9')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xa'),require(_0xc85e('0xb')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xc'),require(_0xc85e('0xd')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xe'),require(_0xc85e('0xf')));_0x2725a8[_0xc85e('0x7')]('/api/voice/mohs',require(_0xc85e('0x10')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x11'),require(_0xc85e('0x12')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x13'),require('./api/voiceRecording'));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x14'),require(_0xc85e('0x15')));_0x2725a8['use'](_0xc85e('0x16'),require('./api/voiceMail'));_0x2725a8['use']('/api/voice/mails/messages',require(_0xc85e('0x17')));_0x2725a8['use'](_0xc85e('0x18'),require('./api/voiceCallReport'));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x19'),require(_0xc85e('0x1a')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x1b'),require(_0xc85e('0x1c')));_0x2725a8[_0xc85e('0x7')]('/api/voice/queues/reports',require(_0xc85e('0x1d')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x1e'),require('./api/memberReport'));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x1f'),require(_0xc85e('0x20')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x21'),require(_0xc85e('0x22')));_0x2725a8['use'](_0xc85e('0x23'),require(_0xc85e('0x24')));_0x2725a8[_0xc85e('0x7')]('/api/mail/accounts',require(_0xc85e('0x25')));_0x2725a8['use'](_0xc85e('0x26'),require(_0xc85e('0x27')));_0x2725a8['use'](_0xc85e('0x28'),require(_0xc85e('0x29')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x2a'),require(_0xc85e('0x2b')));_0x2725a8['use'](_0xc85e('0x2c'),require('./api/mailMessage'));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x2d'),require(_0xc85e('0x2e')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x2f'),require(_0xc85e('0x30')));_0x2725a8['use'](_0xc85e('0x31'),require(_0xc85e('0x32')));_0x2725a8['use']('/api/dashboards/items',require('./api/dashboardItem'));_0x2725a8['use'](_0xc85e('0x33'),require('./api/faxAccount'));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x34'),require(_0xc85e('0x35')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x36'),require(_0xc85e('0x37')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x38'),require(_0xc85e('0x39')));_0x2725a8['use'](_0xc85e('0x3a'),require(_0xc85e('0x3b')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x3c'),require(_0xc85e('0x3d')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x3e'),require(_0xc85e('0x3f')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x40'),require(_0xc85e('0x41')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x42'),require('./api/smsInteraction'));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x43'),require('./api/smsMessage'));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x44'),require(_0xc85e('0x45')));_0x2725a8[_0xc85e('0x7')]('/api/openchannel/accounts',require(_0xc85e('0x46')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x47'),require('./api/openchannelApplication'));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x48'),require('./api/openchannelInteraction'));_0x2725a8['use'](_0xc85e('0x49'),require(_0xc85e('0x4a')));_0x2725a8['use'](_0xc85e('0x4b'),require(_0xc85e('0x4c')));_0x2725a8['use'](_0xc85e('0x4d'),require(_0xc85e('0x4e')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x4f'),require(_0xc85e('0x50')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x51'),require('./api/chatApplication'));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x52'),require(_0xc85e('0x53')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x54'),require(_0xc85e('0x55')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x56'),require(_0xc85e('0x57')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x58'),require(_0xc85e('0x59')));_0x2725a8['use'](_0xc85e('0x5a'),require(_0xc85e('0x5b')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x5c'),require(_0xc85e('0x5d')));_0x2725a8['use']('/api/cm/companies',require(_0xc85e('0x5e')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x5f'),require(_0xc85e('0x60')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x61'),require(_0xc85e('0x62')));_0x2725a8[_0xc85e('0x7')]('/api/cm/hopper_black',require('./api/cmHopperBlack'));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x63'),require('./api/cmHopperFinal'));_0x2725a8['use'](_0xc85e('0x64'),require(_0xc85e('0x65')));_0x2725a8['use'](_0xc85e('0x66'),require('./api/cmCustomField'));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x67'),require(_0xc85e('0x68')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x69'),require(_0xc85e('0x6a')));_0x2725a8['use']('/api/canned_answers',require(_0xc85e('0x6b')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x6c'),require(_0xc85e('0x6d')));_0x2725a8[_0xc85e('0x7')]('/api/conditions',require(_0xc85e('0x6e')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x6f'),require(_0xc85e('0x70')));_0x2725a8[_0xc85e('0x7')]('/api/pauses',require(_0xc85e('0x71')));_0x2725a8[_0xc85e('0x7')]('/api/cdr',require(_0xc85e('0x72')));_0x2725a8[_0xc85e('0x7')]('/api/voiceQueuesLog',require(_0xc85e('0x73')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x74'),require('./api/schedule'));_0x2725a8['use'](_0xc85e('0x75'),require(_0xc85e('0x76')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x77'),require(_0xc85e('0x78')));_0x2725a8['use'](_0xc85e('0x79'),require(_0xc85e('0x7a')));_0x2725a8['use'](_0xc85e('0x7b'),require(_0xc85e('0x7c')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x7d'),require('./api/cmHopperAdditionalPhone'));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x7e'),require(_0xc85e('0x7f')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x80'),require(_0xc85e('0x81')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x82'),require(_0xc85e('0x83')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x84'),require('./api/integration'));_0x2725a8[_0xc85e('0x7')]('/api/integrations/reports',require(_0xc85e('0x85')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x86'),require(_0xc85e('0x87')));_0x2725a8[_0xc85e('0x7')]('/api/analytics/default_reports',require(_0xc85e('0x88')));_0x2725a8['use']('/api/analytics/extracted_reports',require(_0xc85e('0x89')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x8a'),require(_0xc85e('0x8b')));_0x2725a8['use'](_0xc85e('0x8c'),require(_0xc85e('0x8d')));_0x2725a8['use'](_0xc85e('0x8e'),require(_0xc85e('0x8f')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x90'),require(_0xc85e('0x91')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x92'),require(_0xc85e('0x93')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x94'),require('./api/intSalesforceField'));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x95'),require('./api/intSugarcrmAccount'));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x96'),require('./api/intSugarcrmConfiguration'));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x97'),require(_0xc85e('0x98')));_0x2725a8['use'](_0xc85e('0x99'),require('./api/intDeskAccount'));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x9a'),require('./api/intDeskConfiguration'));_0x2725a8['use'](_0xc85e('0x9b'),require(_0xc85e('0x9c')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x9d'),require('./api/intZohoAccount'));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x9e'),require(_0xc85e('0x9f')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xa0'),require(_0xc85e('0xa1')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xa2'),require('./api/intZendeskAccount'));_0x2725a8['use']('/api/integrations/zendesk/configurations',require(_0xc85e('0xa3')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xa4'),require(_0xc85e('0xa5')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xa6'),require(_0xc85e('0xa7')));_0x2725a8['use'](_0xc85e('0xa8'),require(_0xc85e('0xa9')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xaa'),require(_0xc85e('0xab')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xac'),require(_0xc85e('0xad')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xae'),require(_0xc85e('0xaf')));_0x2725a8['use'](_0xc85e('0xb0'),require(_0xc85e('0xb1')));_0x2725a8['use']('/api/integrations/servicenow/accounts',require(_0xc85e('0xb2')));_0x2725a8[_0xc85e('0x7')]('/api/integrations/servicenow/configurations',require(_0xc85e('0xb3')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xb4'),require(_0xc85e('0xb5')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xb6'),require(_0xc85e('0xb7')));_0x2725a8[_0xc85e('0x7')]('/api/integrations/dynamics365/configurations',require('./api/intDynamics365Configuration'));_0x2725a8['use'](_0xc85e('0xb8'),require(_0xc85e('0xb9')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xba'),require(_0xc85e('0xbb')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xbc'),require(_0xc85e('0xbd')));_0x2725a8['use'](_0xc85e('0xbe'),require(_0xc85e('0xbf')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xc0'),require(_0xc85e('0xc1')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xc2'),require(_0xc85e('0xc3')));_0x2725a8['use'](_0xc85e('0xc4'),require(_0xc85e('0xc5')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xc6'),require(_0xc85e('0xc7')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xc8'),require('./api/jscriptyQuestionReport'));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xc9'),require(_0xc85e('0xca')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xcb'),require('./api/smsQueueReport'));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xcc'),require(_0xc85e('0xcd')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xce'),require('./api/squareReportDetail'));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xcf'),require(_0xc85e('0xd0')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xd1'),require(_0xc85e('0xd2')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xd3'),require(_0xc85e('0xd4')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xd5'),require(_0xc85e('0xd6')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xd7'),require(_0xc85e('0xd8')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xd9'),require('./api/squareMessage'));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xda'),require(_0xc85e('0xdb')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xdc'),require(_0xc85e('0xdd')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xde'),require(_0xc85e('0xdf')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xe0'),require('./api/migration'));_0x2725a8['use']('/api/attachments',require('./api/attachment'));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xe1'),require('./api/plugin'));_0x2725a8['use'](_0xc85e('0xe2'),require('./api/mailTransferReport'));_0x2725a8['use'](_0xc85e('0xe3'),require('./api/chatTransferReport'));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xe4'),require(_0xc85e('0xe5')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xe6'),require('./api/openchannelTransferReport'));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xe7'),require('./api/smsTransferReport'));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xe8'),require(_0xc85e('0xe9')));_0x2725a8[_0xc85e('0x7')]('/api/voice/prefixes',require(_0xc85e('0xea')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xeb'),require('./api/userProfile'));_0x2725a8['use'](_0xc85e('0xec'),require(_0xc85e('0xed')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xee'),require('./api/userProfileResource'));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xef'),require(_0xc85e('0xf0')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xf1'),require(_0xc85e('0xf2')));_0x2725a8['use'](_0xc85e('0xf3'),require(_0xc85e('0xf4')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xf5'),require(_0xc85e('0xf6')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xf7'),require('./api/whatsappMessage'));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xf8'),require('./api/whatsappQueueReport'));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xf9'),require('./api/whatsappTransferReport'));_0x2725a8['use'](_0xc85e('0xfa'),require('./api/whatsappQueue'));_0x2725a8['use'](_0xc85e('0xfb'),require('./api/cloudProvider'));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xfc'),require('./api/realtime'));_0x2725a8[_0xc85e('0x7')]('/api/user-settings',require(_0xc85e('0xfd')));_0x2725a8[_0xc85e('0x7')]('/api/auth/local',require(_0xc85e('0xfe')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0xff'),require(_0xc85e('0x100')));_0x2725a8['use'](_0xc85e('0x101'),require(_0xc85e('0x102')));_0x2725a8['use'](_0xc85e('0x103'),require('./api/jira'));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x104'),require(_0xc85e('0x105')));_0x2725a8[_0xc85e('0x7')]('/api/version',require('./api/version'));_0x2725a8[_0xc85e('0x7')]('/api/system',require(_0xc85e('0x106')));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x107'),require(_0xc85e('0x108')));_0x2725a8[_0xc85e('0x7')]('/api/webbar',require(_0xc85e('0x109')));_0x2725a8['use'](_0xc85e('0x10a'),clientSideLogs);_0x2725a8['use'](_0xc85e('0x10b'),express[_0xc85e('0x10c')](path[_0xc85e('0x10d')](config[_0xc85e('0x10e')],_0xc85e('0x10b'))));_0x2725a8['use'](_0xc85e('0x10f'),express[_0xc85e('0x10c')](path[_0xc85e('0x10d')](config[_0xc85e('0x10e')],_0xc85e('0x10f'))));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x110'),express[_0xc85e('0x10c')](path[_0xc85e('0x10d')](config[_0xc85e('0x10e')],_0xc85e('0x110'))));_0x2725a8[_0xc85e('0x7')](_0xc85e('0x111'),express[_0xc85e('0x10c')](path[_0xc85e('0x10d')](config['root'],'snippet',_0xc85e('0x112'))));_0x2725a8['use'](_0xc85e('0x113'),express[_0xc85e('0x10c')](path[_0xc85e('0x10d')](config[_0xc85e('0x10e')],_0xc85e('0x114'))));_0x2725a8[_0xc85e('0x115')](_0xc85e('0x116'))[_0xc85e('0x117')](errors[0x194]);_0x2725a8['route']('/*')[_0xc85e('0x117')](function(_0x553a62,_0x3d24ba){_0x3d24ba[_0xc85e('0x118')](path[_0xc85e('0x119')](_0x2725a8[_0xc85e('0x117')](_0xc85e('0x11a'))+'/index.html'));});return _0x2725a8;});}; \ No newline at end of file +var _0xa829=['/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/desk/accounts','./api/intDeskAccount','./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/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','./api/jscriptyProject','/api/settings','./api/squareOdbc','/api/square/projects','./api/squareProject','./api/squareRecording','./api/squareMessage','/api/teams','./api/team','/api/license','./api/campaign','./api/migration','/api/attachments','/api/plugins','/api/mail/reports/transfer','./api/mailTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/user-settings','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','./api/rpc','/api/version','/api/system','/api/pm2','./api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','snippet','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','then','use','/api/users','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceDialReport','./api/voiceAgentReport','/api/voice/queues/reports','/api/members/reports','./api/memberReport','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','/api/mail/interactions','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','/api/dashboards','./api/dashboard','./api/dashboardItem','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','/api/openchannel/reports/queue','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','/api/tags','./api/tag','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','/api/templates','./api/template','./api/trigger','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa829,0x1a6));var _0x9a82=function(_0x1ffcfb,_0x20ab7e){_0x1ffcfb=_0x1ffcfb-0x0;var _0x277206=_0xa829[_0x1ffcfb];return _0x277206;};'use strict';var path=require(_0x9a82('0x0'));var express=require(_0x9a82('0x1'));var errors=require(_0x9a82('0x2'));var config=require(_0x9a82('0x3'));var setupLoggers=require(_0x9a82('0x4'))[_0x9a82('0x5')];var clientSideLogs=require(_0x9a82('0x6'));exports['default']=function(_0x56de09){return setupLoggers(_0x56de09)[_0x9a82('0x7')](function(){_0x56de09[_0x9a82('0x8')](_0x9a82('0x9'),require('./api/user'));_0x56de09[_0x9a82('0x8')](_0x9a82('0xa'),require(_0x9a82('0xb')));_0x56de09[_0x9a82('0x8')]('/api/voice/contexts',require(_0x9a82('0xc')));_0x56de09[_0x9a82('0x8')](_0x9a82('0xd'),require(_0x9a82('0xe')));_0x56de09[_0x9a82('0x8')](_0x9a82('0xf'),require(_0x9a82('0x10')));_0x56de09[_0x9a82('0x8')](_0x9a82('0x11'),require(_0x9a82('0x12')));_0x56de09[_0x9a82('0x8')](_0x9a82('0x13'),require(_0x9a82('0x14')));_0x56de09['use']('/api/screen/recordings',require(_0x9a82('0x15')));_0x56de09['use'](_0x9a82('0x16'),require(_0x9a82('0x17')));_0x56de09[_0x9a82('0x8')](_0x9a82('0x18'),require(_0x9a82('0x19')));_0x56de09['use'](_0x9a82('0x1a'),require(_0x9a82('0x1b')));_0x56de09[_0x9a82('0x8')]('/api/voice/dials/reports',require(_0x9a82('0x1c')));_0x56de09[_0x9a82('0x8')]('/api/voice/agents/reports',require(_0x9a82('0x1d')));_0x56de09['use'](_0x9a82('0x1e'),require('./api/voiceQueueReport'));_0x56de09[_0x9a82('0x8')](_0x9a82('0x1f'),require(_0x9a82('0x20')));_0x56de09['use']('/api/trunks',require(_0x9a82('0x21')));_0x56de09[_0x9a82('0x8')](_0x9a82('0x22'),require(_0x9a82('0x23')));_0x56de09['use']('/api/mail/out_servers',require(_0x9a82('0x24')));_0x56de09[_0x9a82('0x8')]('/api/mail/accounts',require(_0x9a82('0x25')));_0x56de09[_0x9a82('0x8')](_0x9a82('0x26'),require(_0x9a82('0x27')));_0x56de09['use'](_0x9a82('0x28'),require('./api/mailSubstatus'));_0x56de09[_0x9a82('0x8')](_0x9a82('0x29'),require('./api/mailInteraction'));_0x56de09['use'](_0x9a82('0x2a'),require(_0x9a82('0x2b')));_0x56de09[_0x9a82('0x8')](_0x9a82('0x2c'),require(_0x9a82('0x2d')));_0x56de09[_0x9a82('0x8')](_0x9a82('0x2e'),require('./api/mailQueueReport'));_0x56de09[_0x9a82('0x8')](_0x9a82('0x2f'),require(_0x9a82('0x30')));_0x56de09[_0x9a82('0x8')]('/api/dashboards/items',require(_0x9a82('0x31')));_0x56de09['use']('/api/fax/accounts',require('./api/faxAccount'));_0x56de09[_0x9a82('0x8')](_0x9a82('0x32'),require(_0x9a82('0x33')));_0x56de09[_0x9a82('0x8')](_0x9a82('0x34'),require(_0x9a82('0x35')));_0x56de09[_0x9a82('0x8')](_0x9a82('0x36'),require(_0x9a82('0x37')));_0x56de09['use']('/api/fax/queues',require(_0x9a82('0x38')));_0x56de09[_0x9a82('0x8')]('/api/fax/reports/queue',require(_0x9a82('0x39')));_0x56de09['use'](_0x9a82('0x3a'),require(_0x9a82('0x3b')));_0x56de09[_0x9a82('0x8')](_0x9a82('0x3c'),require(_0x9a82('0x3d')));_0x56de09[_0x9a82('0x8')](_0x9a82('0x3e'),require(_0x9a82('0x3f')));_0x56de09['use']('/api/sms/messages',require(_0x9a82('0x40')));_0x56de09['use'](_0x9a82('0x41'),require(_0x9a82('0x42')));_0x56de09[_0x9a82('0x8')](_0x9a82('0x43'),require(_0x9a82('0x44')));_0x56de09[_0x9a82('0x8')](_0x9a82('0x45'),require(_0x9a82('0x46')));_0x56de09['use'](_0x9a82('0x47'),require(_0x9a82('0x48')));_0x56de09[_0x9a82('0x8')]('/api/openchannel/messages',require(_0x9a82('0x49')));_0x56de09[_0x9a82('0x8')](_0x9a82('0x4a'),require(_0x9a82('0x4b')));_0x56de09['use']('/api/chat/websites',require(_0x9a82('0x4c')));_0x56de09[_0x9a82('0x8')](_0x9a82('0x4d'),require('./api/openchannelQueueReport'));_0x56de09[_0x9a82('0x8')](_0x9a82('0x4e'),require(_0x9a82('0x4f')));_0x56de09['use'](_0x9a82('0x50'),require(_0x9a82('0x51')));_0x56de09[_0x9a82('0x8')](_0x9a82('0x52'),require(_0x9a82('0x53')));_0x56de09[_0x9a82('0x8')](_0x9a82('0x54'),require('./api/chatOfflineMessage'));_0x56de09['use'](_0x9a82('0x55'),require(_0x9a82('0x56')));_0x56de09[_0x9a82('0x8')](_0x9a82('0x57'),require(_0x9a82('0x58')));_0x56de09[_0x9a82('0x8')](_0x9a82('0x59'),require(_0x9a82('0x5a')));_0x56de09['use'](_0x9a82('0x5b'),require(_0x9a82('0x5c')));_0x56de09['use'](_0x9a82('0x5d'),require(_0x9a82('0x5e')));_0x56de09[_0x9a82('0x8')](_0x9a82('0x5f'),require(_0x9a82('0x60')));_0x56de09[_0x9a82('0x8')](_0x9a82('0x61'),require(_0x9a82('0x62')));_0x56de09['use'](_0x9a82('0x63'),require(_0x9a82('0x64')));_0x56de09['use']('/api/cm/hopper_history',require(_0x9a82('0x65')));_0x56de09[_0x9a82('0x8')](_0x9a82('0x66'),require(_0x9a82('0x67')));_0x56de09[_0x9a82('0x8')](_0x9a82('0x68'),require(_0x9a82('0x69')));_0x56de09[_0x9a82('0x8')]('/api/automations',require(_0x9a82('0x6a')));_0x56de09[_0x9a82('0x8')](_0x9a82('0x6b'),require(_0x9a82('0x6c')));_0x56de09['use'](_0x9a82('0x6d'),require(_0x9a82('0x6e')));_0x56de09[_0x9a82('0x8')](_0x9a82('0x6f'),require('./api/condition'));_0x56de09['use']('/api/intervals',require(_0x9a82('0x70')));_0x56de09[_0x9a82('0x8')](_0x9a82('0x71'),require(_0x9a82('0x72')));_0x56de09[_0x9a82('0x8')](_0x9a82('0x73'),require(_0x9a82('0x74')));_0x56de09[_0x9a82('0x8')](_0x9a82('0x75'),require(_0x9a82('0x76')));_0x56de09[_0x9a82('0x8')](_0x9a82('0x77'),require(_0x9a82('0x78')));_0x56de09[_0x9a82('0x8')](_0x9a82('0x79'),require('./api/sound'));_0x56de09[_0x9a82('0x8')](_0x9a82('0x7a'),require(_0x9a82('0x7b')));_0x56de09[_0x9a82('0x8')]('/api/contact_item_types',require(_0x9a82('0x7c')));_0x56de09['use'](_0x9a82('0x7d'),require(_0x9a82('0x7e')));_0x56de09['use'](_0x9a82('0x7f'),require('./api/cmHopperAdditionalPhone'));_0x56de09[_0x9a82('0x8')](_0x9a82('0x80'),require(_0x9a82('0x81')));_0x56de09[_0x9a82('0x8')]('/api/triggers',require(_0x9a82('0x82')));_0x56de09['use']('/api/variables',require('./api/variable'));_0x56de09[_0x9a82('0x8')]('/api/integrations',require('./api/integration'));_0x56de09[_0x9a82('0x8')](_0x9a82('0x83'),require(_0x9a82('0x84')));_0x56de09[_0x9a82('0x8')]('/api/analytics/custom_reports',require(_0x9a82('0x85')));_0x56de09[_0x9a82('0x8')](_0x9a82('0x86'),require(_0x9a82('0x87')));_0x56de09[_0x9a82('0x8')](_0x9a82('0x88'),require(_0x9a82('0x89')));_0x56de09['use'](_0x9a82('0x8a'),require(_0x9a82('0x8b')));_0x56de09[_0x9a82('0x8')](_0x9a82('0x8c'),require(_0x9a82('0x8d')));_0x56de09[_0x9a82('0x8')]('/api/analytics/tree_reports',require(_0x9a82('0x8e')));_0x56de09['use'](_0x9a82('0x8f'),require(_0x9a82('0x90')));_0x56de09[_0x9a82('0x8')](_0x9a82('0x91'),require(_0x9a82('0x92')));_0x56de09[_0x9a82('0x8')]('/api/integrations/salesforce/fields',require(_0x9a82('0x93')));_0x56de09[_0x9a82('0x8')]('/api/integrations/sugarcrm/accounts',require(_0x9a82('0x94')));_0x56de09[_0x9a82('0x8')](_0x9a82('0x95'),require(_0x9a82('0x96')));_0x56de09['use']('/api/integrations/sugarcrm/fields',require('./api/intSugarcrmField'));_0x56de09[_0x9a82('0x8')](_0x9a82('0x97'),require(_0x9a82('0x98')));_0x56de09['use']('/api/integrations/desk/configurations',require(_0x9a82('0x99')));_0x56de09[_0x9a82('0x8')](_0x9a82('0x9a'),require(_0x9a82('0x9b')));_0x56de09['use'](_0x9a82('0x9c'),require(_0x9a82('0x9d')));_0x56de09['use'](_0x9a82('0x9e'),require(_0x9a82('0x9f')));_0x56de09[_0x9a82('0x8')](_0x9a82('0xa0'),require(_0x9a82('0xa1')));_0x56de09[_0x9a82('0x8')]('/api/integrations/zendesk/accounts',require(_0x9a82('0xa2')));_0x56de09[_0x9a82('0x8')](_0x9a82('0xa3'),require(_0x9a82('0xa4')));_0x56de09[_0x9a82('0x8')](_0x9a82('0xa5'),require(_0x9a82('0xa6')));_0x56de09[_0x9a82('0x8')](_0x9a82('0xa7'),require(_0x9a82('0xa8')));_0x56de09['use'](_0x9a82('0xa9'),require(_0x9a82('0xaa')));_0x56de09[_0x9a82('0x8')](_0x9a82('0xab'),require(_0x9a82('0xac')));_0x56de09[_0x9a82('0x8')](_0x9a82('0xad'),require(_0x9a82('0xae')));_0x56de09[_0x9a82('0x8')]('/api/integrations/vtiger/configurations',require(_0x9a82('0xaf')));_0x56de09['use'](_0x9a82('0xb0'),require(_0x9a82('0xb1')));_0x56de09[_0x9a82('0x8')](_0x9a82('0xb2'),require(_0x9a82('0xb3')));_0x56de09[_0x9a82('0x8')](_0x9a82('0xb4'),require(_0x9a82('0xb5')));_0x56de09['use'](_0x9a82('0xb6'),require('./api/intServicenowField'));_0x56de09[_0x9a82('0x8')]('/api/integrations/dynamics365/accounts',require(_0x9a82('0xb7')));_0x56de09[_0x9a82('0x8')](_0x9a82('0xb8'),require('./api/intDynamics365Configuration'));_0x56de09[_0x9a82('0x8')]('/api/integrations/dynamics365/fields',require(_0x9a82('0xb9')));_0x56de09[_0x9a82('0x8')](_0x9a82('0xba'),require(_0x9a82('0xbb')));_0x56de09[_0x9a82('0x8')](_0x9a82('0xbc'),require(_0x9a82('0xbd')));_0x56de09[_0x9a82('0x8')](_0x9a82('0xbe'),require('./api/intFreshsalesField'));_0x56de09[_0x9a82('0x8')](_0x9a82('0xbf'),require(_0x9a82('0xc0')));_0x56de09[_0x9a82('0x8')](_0x9a82('0xc1'),require(_0x9a82('0xc2')));_0x56de09['use'](_0x9a82('0xc3'),require('./api/chatInternalMessage'));_0x56de09['use']('/api/jscripty/answers/reports',require(_0x9a82('0xc4')));_0x56de09[_0x9a82('0x8')](_0x9a82('0xc5'),require(_0x9a82('0xc6')));_0x56de09['use']('/api/jscripty/sessions/reports',require('./api/jscriptySessionReport'));_0x56de09['use'](_0x9a82('0xc7'),require(_0x9a82('0xc8')));_0x56de09['use'](_0x9a82('0xc9'),require(_0x9a82('0xca')));_0x56de09[_0x9a82('0x8')](_0x9a82('0xcb'),require(_0x9a82('0xcc')));_0x56de09['use']('/api/jscripty/projects',require(_0x9a82('0xcd')));_0x56de09['use'](_0x9a82('0xce'),require('./api/setting'));_0x56de09[_0x9a82('0x8')]('/api/square/odbc',require(_0x9a82('0xcf')));_0x56de09[_0x9a82('0x8')](_0x9a82('0xd0'),require(_0x9a82('0xd1')));_0x56de09[_0x9a82('0x8')]('/api/square/recordings',require(_0x9a82('0xd2')));_0x56de09['use']('/api/square/messages',require(_0x9a82('0xd3')));_0x56de09[_0x9a82('0x8')](_0x9a82('0xd4'),require(_0x9a82('0xd5')));_0x56de09[_0x9a82('0x8')](_0x9a82('0xd6'),require('./api/license'));_0x56de09[_0x9a82('0x8')]('/api/campaigns',require(_0x9a82('0xd7')));_0x56de09[_0x9a82('0x8')]('/api/migrations',require(_0x9a82('0xd8')));_0x56de09['use'](_0x9a82('0xd9'),require('./api/attachment'));_0x56de09[_0x9a82('0x8')](_0x9a82('0xda'),require('./api/plugin'));_0x56de09['use'](_0x9a82('0xdb'),require(_0x9a82('0xdc')));_0x56de09[_0x9a82('0x8')]('/api/chat/reports/transfer',require('./api/chatTransferReport'));_0x56de09[_0x9a82('0x8')](_0x9a82('0xdd'),require(_0x9a82('0xde')));_0x56de09['use'](_0x9a82('0xdf'),require(_0x9a82('0xe0')));_0x56de09['use'](_0x9a82('0xe1'),require(_0x9a82('0xe2')));_0x56de09[_0x9a82('0x8')](_0x9a82('0xe3'),require('./api/cmList'));_0x56de09[_0x9a82('0x8')](_0x9a82('0xe4'),require(_0x9a82('0xe5')));_0x56de09[_0x9a82('0x8')](_0x9a82('0xe6'),require('./api/userProfile'));_0x56de09[_0x9a82('0x8')](_0x9a82('0xe7'),require('./api/userProfileSection'));_0x56de09[_0x9a82('0x8')](_0x9a82('0xe8'),require(_0x9a82('0xe9')));_0x56de09['use'](_0x9a82('0xea'),require(_0x9a82('0xeb')));_0x56de09['use'](_0x9a82('0xec'),require('./api/whatsappAccount'));_0x56de09[_0x9a82('0x8')]('/api/whatsapp/applications',require(_0x9a82('0xed')));_0x56de09['use'](_0x9a82('0xee'),require(_0x9a82('0xef')));_0x56de09[_0x9a82('0x8')]('/api/whatsapp/messages',require(_0x9a82('0xf0')));_0x56de09[_0x9a82('0x8')](_0x9a82('0xf1'),require(_0x9a82('0xf2')));_0x56de09[_0x9a82('0x8')](_0x9a82('0xf3'),require('./api/whatsappTransferReport'));_0x56de09[_0x9a82('0x8')](_0x9a82('0xf4'),require(_0x9a82('0xf5')));_0x56de09[_0x9a82('0x8')](_0x9a82('0xf6'),require(_0x9a82('0xf7')));_0x56de09['use']('/api/realtime',require('./api/realtime'));_0x56de09[_0x9a82('0x8')](_0x9a82('0xf8'),require('./api/user-setting'));_0x56de09[_0x9a82('0x8')](_0x9a82('0xf9'),require(_0x9a82('0xfa')));_0x56de09[_0x9a82('0x8')](_0x9a82('0xfb'),require(_0x9a82('0xfc')));_0x56de09[_0x9a82('0x8')](_0x9a82('0xfd'),require(_0x9a82('0xfe')));_0x56de09[_0x9a82('0x8')](_0x9a82('0xff'),require(_0x9a82('0x100')));_0x56de09[_0x9a82('0x8')]('/api/rpc',require(_0x9a82('0x101')));_0x56de09[_0x9a82('0x8')](_0x9a82('0x102'),require('./api/version'));_0x56de09[_0x9a82('0x8')](_0x9a82('0x103'),require('./api/system'));_0x56de09[_0x9a82('0x8')](_0x9a82('0x104'),require('./api/pm2'));_0x56de09[_0x9a82('0x8')]('/api/webbar',require(_0x9a82('0x105')));_0x56de09[_0x9a82('0x8')]('/api/logs',clientSideLogs);_0x56de09[_0x9a82('0x8')](_0x9a82('0x106'),express[_0x9a82('0x107')](path[_0x9a82('0x108')](config[_0x9a82('0x109')],_0x9a82('0x106'))));_0x56de09[_0x9a82('0x8')](_0x9a82('0x10a'),express[_0x9a82('0x107')](path[_0x9a82('0x108')](config[_0x9a82('0x109')],_0x9a82('0x10a'))));_0x56de09[_0x9a82('0x8')](_0x9a82('0x10b'),express[_0x9a82('0x107')](path[_0x9a82('0x108')](config[_0x9a82('0x109')],_0x9a82('0x10b'))));_0x56de09[_0x9a82('0x8')](_0x9a82('0x10c'),express['static'](path[_0x9a82('0x108')](config[_0x9a82('0x109')],_0x9a82('0x10d'),'3.0.0')));_0x56de09[_0x9a82('0x8')](_0x9a82('0x10e'),express[_0x9a82('0x107')](path[_0x9a82('0x108')](config[_0x9a82('0x109')],_0x9a82('0x10f'))));_0x56de09[_0x9a82('0x110')](_0x9a82('0x111'))[_0x9a82('0x112')](errors[0x194]);_0x56de09[_0x9a82('0x110')]('/*')[_0x9a82('0x112')](function(_0x12f317,_0x4a28c5){_0x4a28c5[_0x9a82('0x113')](path[_0x9a82('0x114')](_0x56de09['get'](_0x9a82('0x115'))+_0x9a82('0x116')));});return _0x56de09;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 81925a6..0037582 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xace9=['../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','http','rpc','port','localhost','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default','jayson/promise','../config/environment','listen','../api/user/user.rpc','merge','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc'];(function(_0x4d1e79,_0x417ccf){var _0x27f3e3=function(_0x388e59){while(--_0x388e59){_0x4d1e79['push'](_0x4d1e79['shift']());}};_0x27f3e3(++_0x417ccf);}(_0xace9,0x148));var _0x9ace=function(_0x276167,_0x21086e){_0x276167=_0x276167-0x0;var _0x27a866=_0xace9[_0x276167];return _0x27a866;};'use strict';var jayson=require(_0x9ace('0x0'));var _=require('lodash');var config=require(_0x9ace('0x1'));exports[_0x9ace('0x2')]=function(){return new Promise(function(_0x12f024,_0x3bf24a){var _0x29716a={};_0x29716a=_['merge'](_0x29716a,require(_0x9ace('0x3')));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require('../api/voiceExtension/voiceExtension.rpc'));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0x5')));_0x29716a=_['merge'](_0x29716a,require(_0x9ace('0x6')));_0x29716a=_['merge'](_0x29716a,require(_0x9ace('0x7')));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0x8')));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x29716a=_['merge'](_0x29716a,require(_0x9ace('0x9')));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0xa')));_0x29716a=_['merge'](_0x29716a,require('../api/trunk/trunk.rpc'));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0xb')));_0x29716a=_['merge'](_0x29716a,require(_0x9ace('0xc')));_0x29716a=_['merge'](_0x29716a,require(_0x9ace('0xd')));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0xe')));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0xf')));_0x29716a=_['merge'](_0x29716a,require('../api/mailInteraction/mailInteraction.rpc'));_0x29716a=_['merge'](_0x29716a,require(_0x9ace('0x10')));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require('../api/mailApplication/mailApplication.rpc'));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0x11')));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0x12')));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0x13')));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0x14')));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0x15')));_0x29716a=_['merge'](_0x29716a,require(_0x9ace('0x16')));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0x17')));_0x29716a=_['merge'](_0x29716a,require(_0x9ace('0x18')));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0x19')));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0x1a')));_0x29716a=_['merge'](_0x29716a,require(_0x9ace('0x1b')));_0x29716a=_['merge'](_0x29716a,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0x1c')));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0x1d')));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0x1e')));_0x29716a=_['merge'](_0x29716a,require(_0x9ace('0x1f')));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require('../api/chatInteraction/chatInteraction.rpc'));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0x20')));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0x21')));_0x29716a=_['merge'](_0x29716a,require('../api/cmContact/cmContact.rpc'));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require('../api/cmHopper/cmHopper.rpc'));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0x22')));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0x23')));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0x24')));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0x25')));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0x26')));_0x29716a=_['merge'](_0x29716a,require(_0x9ace('0x27')));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0x28')));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0x29')));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0x2a')));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require('../api/trigger/trigger.rpc'));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0x2b')));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0x2c')));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0x2d')));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0x2e')));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0x2f')));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0x30')));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0x31')));_0x29716a=_['merge'](_0x29716a,require(_0x9ace('0x32')));_0x29716a=_['merge'](_0x29716a,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x29716a=_['merge'](_0x29716a,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0x33')));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require('../api/squareReport/squareReport.rpc'));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0x34')));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0x35')));_0x29716a=_['merge'](_0x29716a,require('../api/squareOdbc/squareOdbc.rpc'));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0x36')));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0x37')));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0x38')));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0x39')));_0x29716a=_['merge'](_0x29716a,require('../api/attachment/attachment.rpc'));_0x29716a=_['merge'](_0x29716a,require('../api/plugin/plugin.rpc'));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0x3a')));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0x3b')));_0x29716a=_[_0x9ace('0x4')](_0x29716a,require(_0x9ace('0x3c')));_0x29716a=_['merge'](_0x29716a,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x36ef59=jayson['server'](_0x29716a)[_0x9ace('0x3d')]();var _0x4acff9=config[_0x9ace('0x3e')][_0x9ace('0x3f')]||config[_0x9ace('0x3f')]+0x1;var _0x2d3dfd=config[_0x9ace('0x3e')]['ip']||_0x9ace('0x40');_0x36ef59['on']('error',function(_0x598df9){return _0x3bf24a(_0x598df9);});_0x36ef59[_0x9ace('0x2')](_0x4acff9,_0x2d3dfd,function(){console[_0x9ace('0x41')](_0x9ace('0x42'),_0x2d3dfd,_0x4acff9);require('../config/triggers')[_0x9ace('0x43')]();return _0x12f024('RPC\x20listening\x20on\x20'+_0x2d3dfd+':'+_0x4acff9);});});}; \ No newline at end of file +var _0x2876=['../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/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','merge'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2876,0x91));var _0x6287=function(_0xaa7629,_0x219723){_0xaa7629=_0xaa7629-0x0;var _0x487c07=_0x2876[_0xaa7629];return _0x487c07;};'use strict';var jayson=require(_0x6287('0x0'));var _=require(_0x6287('0x1'));var config=require(_0x6287('0x2'));exports[_0x6287('0x3')]=function(){return new Promise(function(_0x59b254,_0x480a6f){var _0x548d92={};_0x548d92=_[_0x6287('0x4')](_0x548d92,require(_0x6287('0x5')));_0x548d92=_[_0x6287('0x4')](_0x548d92,require(_0x6287('0x6')));_0x548d92=_['merge'](_0x548d92,require(_0x6287('0x7')));_0x548d92=_['merge'](_0x548d92,require(_0x6287('0x8')));_0x548d92=_[_0x6287('0x4')](_0x548d92,require(_0x6287('0x9')));_0x548d92=_[_0x6287('0x4')](_0x548d92,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x548d92=_[_0x6287('0x4')](_0x548d92,require(_0x6287('0xa')));_0x548d92=_[_0x6287('0x4')](_0x548d92,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x548d92=_[_0x6287('0x4')](_0x548d92,require(_0x6287('0xb')));_0x548d92=_[_0x6287('0x4')](_0x548d92,require(_0x6287('0xc')));_0x548d92=_['merge'](_0x548d92,require(_0x6287('0xd')));_0x548d92=_['merge'](_0x548d92,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x548d92=_[_0x6287('0x4')](_0x548d92,require('../api/mailServerIn/mailServerIn.rpc'));_0x548d92=_[_0x6287('0x4')](_0x548d92,require('../api/mailAccount/mailAccount.rpc'));_0x548d92=_[_0x6287('0x4')](_0x548d92,require(_0x6287('0xe')));_0x548d92=_[_0x6287('0x4')](_0x548d92,require(_0x6287('0xf')));_0x548d92=_[_0x6287('0x4')](_0x548d92,require(_0x6287('0x10')));_0x548d92=_[_0x6287('0x4')](_0x548d92,require(_0x6287('0x11')));_0x548d92=_[_0x6287('0x4')](_0x548d92,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x548d92=_['merge'](_0x548d92,require('../api/faxAccount/faxAccount.rpc'));_0x548d92=_[_0x6287('0x4')](_0x548d92,require('../api/faxApplication/faxApplication.rpc'));_0x548d92=_[_0x6287('0x4')](_0x548d92,require(_0x6287('0x12')));_0x548d92=_['merge'](_0x548d92,require(_0x6287('0x13')));_0x548d92=_['merge'](_0x548d92,require(_0x6287('0x14')));_0x548d92=_[_0x6287('0x4')](_0x548d92,require(_0x6287('0x15')));_0x548d92=_[_0x6287('0x4')](_0x548d92,require(_0x6287('0x16')));_0x548d92=_[_0x6287('0x4')](_0x548d92,require(_0x6287('0x17')));_0x548d92=_[_0x6287('0x4')](_0x548d92,require(_0x6287('0x18')));_0x548d92=_[_0x6287('0x4')](_0x548d92,require(_0x6287('0x19')));_0x548d92=_[_0x6287('0x4')](_0x548d92,require(_0x6287('0x1a')));_0x548d92=_[_0x6287('0x4')](_0x548d92,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x548d92=_[_0x6287('0x4')](_0x548d92,require(_0x6287('0x1b')));_0x548d92=_['merge'](_0x548d92,require(_0x6287('0x1c')));_0x548d92=_['merge'](_0x548d92,require(_0x6287('0x1d')));_0x548d92=_['merge'](_0x548d92,require(_0x6287('0x1e')));_0x548d92=_['merge'](_0x548d92,require(_0x6287('0x1f')));_0x548d92=_[_0x6287('0x4')](_0x548d92,require('../api/chatQueue/chatQueue.rpc'));_0x548d92=_[_0x6287('0x4')](_0x548d92,require(_0x6287('0x20')));_0x548d92=_[_0x6287('0x4')](_0x548d92,require('../api/cmHopper/cmHopper.rpc'));_0x548d92=_[_0x6287('0x4')](_0x548d92,require(_0x6287('0x21')));_0x548d92=_[_0x6287('0x4')](_0x548d92,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x548d92=_['merge'](_0x548d92,require(_0x6287('0x22')));_0x548d92=_[_0x6287('0x4')](_0x548d92,require(_0x6287('0x23')));_0x548d92=_[_0x6287('0x4')](_0x548d92,require(_0x6287('0x24')));_0x548d92=_['merge'](_0x548d92,require(_0x6287('0x25')));_0x548d92=_['merge'](_0x548d92,require(_0x6287('0x26')));_0x548d92=_[_0x6287('0x4')](_0x548d92,require(_0x6287('0x27')));_0x548d92=_['merge'](_0x548d92,require(_0x6287('0x28')));_0x548d92=_[_0x6287('0x4')](_0x548d92,require('../api/trigger/trigger.rpc'));_0x548d92=_[_0x6287('0x4')](_0x548d92,require(_0x6287('0x29')));_0x548d92=_['merge'](_0x548d92,require(_0x6287('0x2a')));_0x548d92=_[_0x6287('0x4')](_0x548d92,require(_0x6287('0x2b')));_0x548d92=_[_0x6287('0x4')](_0x548d92,require(_0x6287('0x2c')));_0x548d92=_[_0x6287('0x4')](_0x548d92,require(_0x6287('0x2d')));_0x548d92=_['merge'](_0x548d92,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x548d92=_[_0x6287('0x4')](_0x548d92,require(_0x6287('0x2e')));_0x548d92=_[_0x6287('0x4')](_0x548d92,require(_0x6287('0x2f')));_0x548d92=_[_0x6287('0x4')](_0x548d92,require(_0x6287('0x30')));_0x548d92=_[_0x6287('0x4')](_0x548d92,require(_0x6287('0x31')));_0x548d92=_['merge'](_0x548d92,require(_0x6287('0x32')));_0x548d92=_[_0x6287('0x4')](_0x548d92,require(_0x6287('0x33')));_0x548d92=_['merge'](_0x548d92,require(_0x6287('0x34')));_0x548d92=_['merge'](_0x548d92,require(_0x6287('0x35')));_0x548d92=_[_0x6287('0x4')](_0x548d92,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x548d92=_['merge'](_0x548d92,require('../api/setting/setting.rpc'));_0x548d92=_[_0x6287('0x4')](_0x548d92,require('../api/squareOdbc/squareOdbc.rpc'));_0x548d92=_[_0x6287('0x4')](_0x548d92,require(_0x6287('0x36')));_0x548d92=_[_0x6287('0x4')](_0x548d92,require(_0x6287('0x37')));_0x548d92=_['merge'](_0x548d92,require(_0x6287('0x38')));_0x548d92=_['merge'](_0x548d92,require(_0x6287('0x39')));_0x548d92=_[_0x6287('0x4')](_0x548d92,require(_0x6287('0x3a')));_0x548d92=_[_0x6287('0x4')](_0x548d92,require(_0x6287('0x3b')));_0x548d92=_[_0x6287('0x4')](_0x548d92,require(_0x6287('0x3c')));_0x548d92=_['merge'](_0x548d92,require(_0x6287('0x3d')));_0x548d92=_['merge'](_0x548d92,require(_0x6287('0x3e')));_0x548d92=_['merge'](_0x548d92,require(_0x6287('0x3f')));_0x548d92=_[_0x6287('0x4')](_0x548d92,require(_0x6287('0x40')));var _0x4f3799=jayson[_0x6287('0x41')](_0x548d92)['http']();var _0x80e73e=config[_0x6287('0x42')][_0x6287('0x43')]||config[_0x6287('0x43')]+0x1;var _0x12aef8=config[_0x6287('0x42')]['ip']||_0x6287('0x44');_0x4f3799['on'](_0x6287('0x45'),function(_0x27549e){return _0x480a6f(_0x27549e);});_0x4f3799['listen'](_0x80e73e,_0x12aef8,function(){console[_0x6287('0x46')](_0x6287('0x47'),_0x12aef8,_0x80e73e);require(_0x6287('0x48'))[_0x6287('0x49')]();return _0x59b254(_0x6287('0x4a')+_0x12aef8+':'+_0x80e73e);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 652cfa8..11c1b1f 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 _0x421f=['getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','join','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','HANGUP','setVariable','isBoolean','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','util','lodash','events','EventEmitter','./reply','./error','call','setEncoding','setTimeout','utf8','headers','emit','ready','line','toLowerCase','hangup','substring','520\x20End\x20of\x20proper','function','no\x20code','result=','indexOf','substr','length','match','error','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','prototype','sendRequest','sync','answer','ANSWER'];(function(_0x31cbfa,_0x2bacd5){var _0x1c413f=function(_0x2b03cc){while(--_0x2b03cc){_0x31cbfa['push'](_0x31cbfa['shift']());}};_0x1c413f(++_0x2bacd5);}(_0x421f,0x160));var _0xf421=function(_0x3cba80,_0x3024e7){_0x3cba80=_0x3cba80-0x0;var _0x11cb67=_0x421f[_0x3cba80];return _0x11cb67;};'use strict';var util=require(_0xf421('0x0'));var _=require(_0xf421('0x1'));var EventEmitter=require(_0xf421('0x2'))[_0xf421('0x3')];var AGIReply=require(_0xf421('0x4'));var AGIError=require(_0xf421('0x5'));function AGIChannel(_0x4f5951){var _0x5bd42b=this,_0x507168=new AGIReply(),_0xe92454=![],_0x1c71b3={};EventEmitter[_0xf421('0x6')](_0x5bd42b);_0x4f5951[_0xf421('0x7')]('utf8');_0x4f5951[_0xf421('0x8')](0x8*0x3c*0x3c*0x3e8);_0x507168[_0xf421('0x7')](_0xf421('0x9'));_0x507168['on'](_0xf421('0xa'),function(_0xa3a871){for(var _0x2a7187 in _0xa3a871){_0x5bd42b[_0x2a7187]=_0xa3a871[_0x2a7187];}_0x5bd42b[_0xf421('0xb')](_0xf421('0xc'));});_0x507168['on'](_0xf421('0xd'),function(_0x4e9ecd){if(_0x4e9ecd[_0xf421('0xe')]()==_0xf421('0xf')){_0x5bd42b[_0xf421('0xb')](_0xf421('0xf'));return;}if(_0x4e9ecd[_0xf421('0x10')](0x0,0xb)=='520-Invalid'){_0xe92454=!![];}if(_0xe92454){_0x1c71b3['rx']+=_0x4e9ecd+'\x0a';if(_0x4e9ecd['search'](_0xf421('0x11'))!=-0x1){_0xe92454=![];}}else{_0x1c71b3['rx']=_0x4e9ecd;}if(_0xe92454){return;}if(typeof _0x1c71b3['cb']==_0xf421('0x12')){var _0x5dafef=_0x1c71b3['rx'][_0xf421('0x10')](0x0,0x3),_0x2b53da=null,_0x85831e=null;_0x5dafef=parseInt(_0x5dafef);if(isNaN(_0x5dafef)){_0x1c71b3['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xf421('0x13')});return;}if(_0x5dafef!=0xc8){_0x1c71b3['cb'](null,{'code':_0x5dafef,'result':-0x1,'extra':'KO'});return;}_0x2b53da=_0x1c71b3['rx'][_0xf421('0x10')](0x4)['replace'](_0xf421('0x14'),'');if(_0x2b53da[_0xf421('0x15')]('\x20')!=-0x1){_0x2b53da=_0x2b53da[_0xf421('0x16')](0x0,_0x2b53da[_0xf421('0x15')]('\x20'));}if(_['startsWith'](_0x2b53da,'-1')){_0x2b53da=parseInt(_0x2b53da);}_0x85831e=_0x1c71b3['rx']['split']('\x20');if(_0x85831e[_0xf421('0x17')]==0x3){_0x85831e=_0x85831e[0x2][_0xf421('0x10')](0x1,_0x85831e[0x2][_0xf421('0x17')]-0x1);}else if(_0x85831e['length']>0x3){var _0x48b985=/\((.+)\)/;var _0x13c3ce=_0x1c71b3['rx'][_0xf421('0x18')](_0x48b985);if(_0x13c3ce){_0x85831e=_0x13c3ce[0x1];}else{_0x85831e=null;}}else{_0x85831e=null;}_0x1c71b3['cb'](null,{'code':_0x5dafef,'result':_0x2b53da,'extra':_0x85831e});}});_0x4f5951['on'](_0xf421('0x19'),function(_0x4cb5c0){_0x5bd42b[_0xf421('0xb')](_0xf421('0x19'),new AGIError('E_AGI_SOCKET_ERROR',_0x4cb5c0[_0xf421('0x1a')]));});_0x4f5951['on']('close',function(){_0x5bd42b[_0xf421('0xb')](_0xf421('0x1b'),new AGIError(_0xf421('0x1c')));});_0x4f5951['on'](_0xf421('0x1d'),function(){_0x5bd42b['emit'](_0xf421('0x1d'),new AGIError(_0xf421('0x1e')));_0x4f5951[_0xf421('0x1f')]();});_0x4f5951[_0xf421('0x20')](_0x507168);this['command']=function(_0x14bdce,_0x51d69e){var _0x14bdce=_0x14bdce||'',_0x51d69e=typeof _0x51d69e=='function'?_0x51d69e:new Function();_0x1c71b3={'tx':_0x14bdce,'rx':'','cb':_0x51d69e};_0x4f5951['write'](_0x14bdce+'\x0a');},this[_0xf421('0x1b')]=function(){_0x4f5951[_0xf421('0x1f')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0xf421('0x21')][_0xf421('0x22')]=function(_0x359ef1){return this['command'][_0xf421('0x23')](this,_0x359ef1);};AGIChannel['prototype'][_0xf421('0x24')]=function(){return this[_0xf421('0x22')](_0xf421('0x25'));};AGIChannel[_0xf421('0x21')][_0xf421('0x26')]=function(_0x4f1b45,_0x13ef33,_0x94bc91){_0x4f1b45=_0x4f1b45===undefined?_0xf421('0x27'):_0x4f1b45;_0x13ef33=_0x13ef33===undefined?'5':_0x13ef33;_0x94bc91=_0x94bc91===undefined?'1':_0x94bc91;return this[_0xf421('0x22')](util[_0xf421('0x28')](_0xf421('0x29'),_0x4f1b45,_0x13ef33*0x3e8,_0x94bc91));};AGIChannel[_0xf421('0x21')][_0xf421('0x2a')]=function(_0x47f060){_0x47f060=_0x47f060||_0xf421('0x2b');return this[_0xf421('0x22')](util[_0xf421('0x28')](_0xf421('0x2c'),_0x47f060));};AGIChannel[_0xf421('0x21')][_0xf421('0x2d')]=function(_0x50a03f,_0x26aecb){if(_[_0xf421('0x2e')](_0x26aecb)){return this['sendRequest'](util[_0xf421('0x28')]('EXEC\x20%s\x20%s',_0x50a03f,_0x26aecb[_0xf421('0x2f')](',')));}return this[_0xf421('0x22')](util[_0xf421('0x28')](_0xf421('0x30'),_0x50a03f,_0x26aecb));};AGIChannel['prototype'][_0xf421('0x31')]=function(_0x598fc6){return this[_0xf421('0x22')](util['format'](_0xf421('0x32'),_0x598fc6));};AGIChannel[_0xf421('0x21')][_0xf421('0x33')]=function(_0x5cf933){return this[_0xf421('0x22')](util['format'](_0xf421('0x34'),_0x5cf933));};AGIChannel[_0xf421('0x21')][_0xf421('0x35')]=function(_0x4791cc){return this[_0xf421('0x22')](util['format']('SET\x20PRIORITY\x20%s',_0x4791cc));};AGIChannel['prototype'][_0xf421('0xf')]=function(){return this[_0xf421('0x22')](_0xf421('0x36'));};AGIChannel[_0xf421('0x21')][_0xf421('0x37')]=function(_0x4efcb9,_0x1bb456){var _0x1170c8=_[_0xf421('0x38')](_0x1bb456)||_[_0xf421('0x39')](_0x1bb456)?_0x1bb456['toString']():_0x1bb456;return this[_0xf421('0x22')](util[_0xf421('0x28')](_0xf421('0x3a'),_0x4efcb9,_0x1170c8?_0x1170c8[_0xf421('0x3b')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xf421('0x21')][_0xf421('0x3c')]=function(_0x23b846,_0x4f51c3){return this[_0xf421('0x22')](util[_0xf421('0x28')](_0xf421('0x3d'),_0x23b846,_0x4f51c3));};AGIChannel[_0xf421('0x21')][_0xf421('0x3e')]=function(_0x17a649,_0x576f0d){return this[_0xf421('0x22')](util[_0xf421('0x28')]('SAY\x20DIGITS\x20%s\x20%s',_0x17a649,_0x576f0d));};AGIChannel['prototype'][_0xf421('0x3f')]=function(_0x3827ec,_0x5d2281){return this[_0xf421('0x22')](util['format'](_0xf421('0x40'),_0x3827ec,_0x5d2281));};AGIChannel[_0xf421('0x21')][_0xf421('0x41')]=function(_0x4aba38,_0x1d6d3c,_0x529e4c){_0x1d6d3c=_0x1d6d3c||this['extension'];_0x529e4c=_0x529e4c||0x1;this['setContext'](_0x4aba38);this[_0xf421('0x33')](_0x1d6d3c);this[_0xf421('0x35')](_0x529e4c);return this['noop'](util[_0xf421('0x28')]('GOTO\x20%s\x20%s\x20%s',_0x4aba38,_0x1d6d3c,_0x529e4c));};AGIChannel[_0xf421('0x21')][_0xf421('0x42')]=function(_0x8b1af0){return this[_0xf421('0x22')](util['format'](_0xf421('0x43'),_0x8b1af0));};AGIChannel['prototype'][_0xf421('0x44')]=function(_0x493529,_0x113b59,_0x538359,_0x1aaddd,_0x3eb265,_0x5d2d61){_0x113b59=_0x113b59||_0xf421('0x45');_0x538359=_0x538359||'';_0x1aaddd=_0x1aaddd===undefined?-0x1:_0x1aaddd==='-1'?-0x1:_0x1aaddd*0x3e8;_0x3eb265=_0x3eb265===undefined?'':'s='+_0x3eb265;_0x5d2d61=_0x5d2d61?'BEEP':'';return this[_0xf421('0x22')](util[_0xf421('0x28')](_0xf421('0x46'),_0x493529,_0x113b59,_0x538359,_0x1aaddd,_0x5d2d61,_0x3eb265));};AGIChannel[_0xf421('0x21')][_0xf421('0x47')]=function(_0x34bd9f,_0xd911a){_0xd911a=_0xd911a||'';return this[_0xf421('0x22')](util[_0xf421('0x28')](_0xf421('0x48'),_0x34bd9f,_0xd911a));};AGIChannel['prototype']['agi']=function(_0x31b0d9){return this[_0xf421('0x2d')](_0xf421('0x49'),_0x31b0d9);};AGIChannel['prototype'][_0xf421('0x4a')]=function(_0x592299){return this[_0xf421('0x2d')](_0xf421('0x4b'),_0x592299);};AGIChannel[_0xf421('0x21')][_0xf421('0x19')]=function(_0x28ca49,_0x2260a5){this['noop'](util[_0xf421('0x28')](_0xf421('0x4c'),_0x28ca49['id'],_0x28ca49['label'],_0x2260a5));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xf421('0x4d')]=AGIChannel; \ No newline at end of file +var _0x61b5=['substr','length','match','error','emit','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','pipe','command','write','destroy','sendRequest','sync','prototype','answer','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','join','setContext','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./reply','./error','call','setEncoding','setTimeout','utf8','headers','line','toLowerCase','hangup','520-Invalid','search','520\x20End\x20of\x20proper','function','substring','no\x20code','replace','result=','indexOf'];(function(_0xfb53a4,_0x477204){var _0x4c77b1=function(_0x1cdfdf){while(--_0x1cdfdf){_0xfb53a4['push'](_0xfb53a4['shift']());}};_0x4c77b1(++_0x477204);}(_0x61b5,0x81));var _0x561b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x61b5[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x561b('0x0'));var _=require(_0x561b('0x1'));var EventEmitter=require(_0x561b('0x2'))[_0x561b('0x3')];var AGIReply=require(_0x561b('0x4'));var AGIError=require(_0x561b('0x5'));function AGIChannel(_0x3de070){var _0x2b8bd4=this,_0x2b6572=new AGIReply(),_0x3e4775=![],_0xaee7dc={};EventEmitter[_0x561b('0x6')](_0x2b8bd4);_0x3de070[_0x561b('0x7')]('utf8');_0x3de070[_0x561b('0x8')](0x8*0x3c*0x3c*0x3e8);_0x2b6572['setEncoding'](_0x561b('0x9'));_0x2b6572['on'](_0x561b('0xa'),function(_0x3dc272){for(var _0xc92a20 in _0x3dc272){_0x2b8bd4[_0xc92a20]=_0x3dc272[_0xc92a20];}_0x2b8bd4['emit']('ready');});_0x2b6572['on'](_0x561b('0xb'),function(_0x2be04b){if(_0x2be04b[_0x561b('0xc')]()==_0x561b('0xd')){_0x2b8bd4['emit'](_0x561b('0xd'));return;}if(_0x2be04b['substring'](0x0,0xb)==_0x561b('0xe')){_0x3e4775=!![];}if(_0x3e4775){_0xaee7dc['rx']+=_0x2be04b+'\x0a';if(_0x2be04b[_0x561b('0xf')](_0x561b('0x10'))!=-0x1){_0x3e4775=![];}}else{_0xaee7dc['rx']=_0x2be04b;}if(_0x3e4775){return;}if(typeof _0xaee7dc['cb']==_0x561b('0x11')){var _0x1b2999=_0xaee7dc['rx'][_0x561b('0x12')](0x0,0x3),_0x22935a=null,_0x577e09=null;_0x1b2999=parseInt(_0x1b2999);if(isNaN(_0x1b2999)){_0xaee7dc['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x561b('0x13')});return;}if(_0x1b2999!=0xc8){_0xaee7dc['cb'](null,{'code':_0x1b2999,'result':-0x1,'extra':'KO'});return;}_0x22935a=_0xaee7dc['rx'][_0x561b('0x12')](0x4)[_0x561b('0x14')](_0x561b('0x15'),'');if(_0x22935a[_0x561b('0x16')]('\x20')!=-0x1){_0x22935a=_0x22935a[_0x561b('0x17')](0x0,_0x22935a['indexOf']('\x20'));}if(_['startsWith'](_0x22935a,'-1')){_0x22935a=parseInt(_0x22935a);}_0x577e09=_0xaee7dc['rx']['split']('\x20');if(_0x577e09[_0x561b('0x18')]==0x3){_0x577e09=_0x577e09[0x2][_0x561b('0x12')](0x1,_0x577e09[0x2][_0x561b('0x18')]-0x1);}else if(_0x577e09[_0x561b('0x18')]>0x3){var _0x5bf1a6=/\((.+)\)/;var _0x6cd3ab=_0xaee7dc['rx'][_0x561b('0x19')](_0x5bf1a6);if(_0x6cd3ab){_0x577e09=_0x6cd3ab[0x1];}else{_0x577e09=null;}}else{_0x577e09=null;}_0xaee7dc['cb'](null,{'code':_0x1b2999,'result':_0x22935a,'extra':_0x577e09});}});_0x3de070['on'](_0x561b('0x1a'),function(_0x47b795){_0x2b8bd4[_0x561b('0x1b')](_0x561b('0x1a'),new AGIError(_0x561b('0x1c'),_0x47b795[_0x561b('0x1d')]));});_0x3de070['on'](_0x561b('0x1e'),function(){_0x2b8bd4[_0x561b('0x1b')](_0x561b('0x1e'),new AGIError(_0x561b('0x1f')));});_0x3de070['on'](_0x561b('0x20'),function(){_0x2b8bd4['emit'](_0x561b('0x20'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x3de070['destroy']();});_0x3de070[_0x561b('0x21')](_0x2b6572);this[_0x561b('0x22')]=function(_0x414d74,_0x15cf3c){var _0x414d74=_0x414d74||'',_0x15cf3c=typeof _0x15cf3c==_0x561b('0x11')?_0x15cf3c:new Function();_0xaee7dc={'tx':_0x414d74,'rx':'','cb':_0x15cf3c};_0x3de070[_0x561b('0x23')](_0x414d74+'\x0a');},this['close']=function(){_0x3de070[_0x561b('0x24')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x561b('0x25')]=function(_0x2c6c1a){return this[_0x561b('0x22')][_0x561b('0x26')](this,_0x2c6c1a);};AGIChannel[_0x561b('0x27')][_0x561b('0x28')]=function(){return this[_0x561b('0x25')]('ANSWER');};AGIChannel[_0x561b('0x27')]['getData']=function(_0x5a55bd,_0x1bb6cd,_0x33b08c){_0x5a55bd=_0x5a55bd===undefined?'beep':_0x5a55bd;_0x1bb6cd=_0x1bb6cd===undefined?'5':_0x1bb6cd;_0x33b08c=_0x33b08c===undefined?'1':_0x33b08c;return this['sendRequest'](util[_0x561b('0x29')](_0x561b('0x2a'),_0x5a55bd,_0x1bb6cd*0x3e8,_0x33b08c));};AGIChannel[_0x561b('0x27')][_0x561b('0x2b')]=function(_0x4bd7bb){_0x4bd7bb=_0x4bd7bb||'NO\x20MESSAGE';return this[_0x561b('0x25')](util[_0x561b('0x29')](_0x561b('0x2c'),_0x4bd7bb));};AGIChannel[_0x561b('0x27')][_0x561b('0x2d')]=function(_0x4b4b86,_0x35cbfa){if(_['isArray'](_0x35cbfa)){return this['sendRequest'](util[_0x561b('0x29')](_0x561b('0x2e'),_0x4b4b86,_0x35cbfa[_0x561b('0x2f')](',')));}return this[_0x561b('0x25')](util[_0x561b('0x29')](_0x561b('0x2e'),_0x4b4b86,_0x35cbfa));};AGIChannel[_0x561b('0x27')][_0x561b('0x30')]=function(_0x274253){return this['sendRequest'](util['format']('SET\x20CONTEXT\x20%s',_0x274253));};AGIChannel['prototype'][_0x561b('0x31')]=function(_0x2fa4f1){return this[_0x561b('0x25')](util[_0x561b('0x29')](_0x561b('0x32'),_0x2fa4f1));};AGIChannel[_0x561b('0x27')][_0x561b('0x33')]=function(_0x3c8a9e){return this[_0x561b('0x25')](util[_0x561b('0x29')](_0x561b('0x34'),_0x3c8a9e));};AGIChannel[_0x561b('0x27')][_0x561b('0xd')]=function(){return this[_0x561b('0x25')](_0x561b('0x35'));};AGIChannel[_0x561b('0x27')][_0x561b('0x36')]=function(_0x585fe5,_0x3c8c02){var _0x3c3267=_[_0x561b('0x37')](_0x3c8c02)||_[_0x561b('0x38')](_0x3c8c02)?_0x3c8c02[_0x561b('0x39')]():_0x3c8c02;return this[_0x561b('0x25')](util[_0x561b('0x29')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x585fe5,_0x3c3267?_0x3c3267[_0x561b('0x39')]()[_0x561b('0x14')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x561b('0x3a')]=function(_0x149440,_0x132759){return this['sendRequest'](util['format'](_0x561b('0x3b'),_0x149440,_0x132759));};AGIChannel[_0x561b('0x27')]['sayDigits']=function(_0x228318,_0x3ef2fe){return this[_0x561b('0x25')](util[_0x561b('0x29')](_0x561b('0x3c'),_0x228318,_0x3ef2fe));};AGIChannel[_0x561b('0x27')][_0x561b('0x3d')]=function(_0x16be2b,_0x1132fc){return this[_0x561b('0x25')](util[_0x561b('0x29')](_0x561b('0x3e'),_0x16be2b,_0x1132fc));};AGIChannel['prototype'][_0x561b('0x3f')]=function(_0x2e039f,_0x1e94f2,_0x2932f9){_0x1e94f2=_0x1e94f2||this[_0x561b('0x40')];_0x2932f9=_0x2932f9||0x1;this[_0x561b('0x30')](_0x2e039f);this['setExtension'](_0x1e94f2);this[_0x561b('0x33')](_0x2932f9);return this[_0x561b('0x2b')](util[_0x561b('0x29')]('GOTO\x20%s\x20%s\x20%s',_0x2e039f,_0x1e94f2,_0x2932f9));};AGIChannel['prototype'][_0x561b('0x41')]=function(_0x292752){return this[_0x561b('0x25')](util[_0x561b('0x29')](_0x561b('0x42'),_0x292752));};AGIChannel[_0x561b('0x27')][_0x561b('0x43')]=function(_0x52a7da,_0x12b65d,_0x2c4da7,_0x34eb99,_0x113228,_0xab163e){_0x12b65d=_0x12b65d||'wav';_0x2c4da7=_0x2c4da7||'';_0x34eb99=_0x34eb99===undefined?-0x1:_0x34eb99==='-1'?-0x1:_0x34eb99*0x3e8;_0x113228=_0x113228===undefined?'':'s='+_0x113228;_0xab163e=_0xab163e?'BEEP':'';return this[_0x561b('0x25')](util[_0x561b('0x29')](_0x561b('0x44'),_0x52a7da,_0x12b65d,_0x2c4da7,_0x34eb99,_0xab163e,_0x113228));};AGIChannel['prototype'][_0x561b('0x45')]=function(_0x362f5e,_0x35e020){_0x35e020=_0x35e020||'';return this[_0x561b('0x25')](util[_0x561b('0x29')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x362f5e,_0x35e020));};AGIChannel[_0x561b('0x27')]['agi']=function(_0x121d61){return this[_0x561b('0x2d')](_0x561b('0x46'),_0x121d61);};AGIChannel[_0x561b('0x27')][_0x561b('0x47')]=function(_0x405f3e){return this['exec'](_0x561b('0x48'),_0x405f3e);};AGIChannel[_0x561b('0x27')][_0x561b('0x1a')]=function(_0x1859cc,_0x28f4f3){this[_0x561b('0x2b')](util[_0x561b('0x29')](_0x561b('0x49'),_0x1859cc['id'],_0x1859cc[_0x561b('0x4a')],_0x28f4f3));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x561b('0x4b')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index df2a423..569057e 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 _0xb7c9=['message','name','exports','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','E_AGI_UNDEFINED','format'];(function(_0x5ab5a3,_0x5ada4a){var _0x14f3e1=function(_0x510928){while(--_0x510928){_0x5ab5a3['push'](_0x5ab5a3['shift']());}};_0x14f3e1(++_0x5ada4a);}(_0xb7c9,0xcf));var _0x9b7c=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0xb7c9[_0x62c958];return _0x57ec61;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x9b7c('0x0'),'E_AGI_SERVER_CLOSE':_0x9b7c('0x1'),'E_AGI_SERVER_MAXCONNECTION':_0x9b7c('0x2'),'E_AGI_SERVER_VOICE_DISABLED':_0x9b7c('0x3'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x9b7c('0x4'),'E_AGI_SOCKET_TIMEOUT':_0x9b7c('0x5'),'E_AGI_COMMAND_EMPTY':_0x9b7c('0x6'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x3ddb4d){var _0x3ddb4d=_0x3ddb4d||null,_0x2a24b0=_0x2a24b0||[],_0x4b1927=0x1,_0x3d3b16='';if(!error[_0x3ddb4d]){_0x3ddb4d=_0x9b7c('0x7');}_0x2a24b0['push'](error[_0x3ddb4d]);while(arguments[_0x4b1927]){_0x2a24b0['push'](arguments[_0x4b1927]);_0x4b1927++;}_0x3d3b16=util[_0x9b7c('0x8')]['apply'](util,_0x2a24b0);this[_0x9b7c('0x9')]=_0x3d3b16;this[_0x9b7c('0xa')]=_0x3ddb4d;}module[_0x9b7c('0xb')]=AGIError; \ No newline at end of file +var _0x194d=['push','message','name','exports','util','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.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED'];(function(_0x562809,_0x1990dc){var _0x45e4ae=function(_0x1f2ee5){while(--_0x1f2ee5){_0x562809['push'](_0x562809['shift']());}};_0x45e4ae(++_0x1990dc);}(_0x194d,0x1be));var _0xd194=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x194d[_0x50a0c2];return _0x5ebadd;};'use strict';var util=require(_0xd194('0x0'));var error={'E_AGI_UNDEFINED':_0xd194('0x1'),'E_AGI_ARGUMENT_PORT':_0xd194('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0xd194('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0xd194('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0xd194('0x5'),'E_AGI_SOCKET_ERROR':_0xd194('0x6'),'E_AGI_SOCKET_CLOSE':_0xd194('0x7'),'E_AGI_SOCKET_TIMEOUT':_0xd194('0x8'),'E_AGI_COMMAND_EMPTY':_0xd194('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xd194('0xa'),'E_AGI_IVR_ENTRY':_0xd194('0xb')};function AGIError(_0x34ffe3){var _0x34ffe3=_0x34ffe3||null,_0x17df99=_0x17df99||[],_0x1a2b3e=0x1,_0x47bfa6='';if(!error[_0x34ffe3]){_0x34ffe3=_0xd194('0xc');}_0x17df99[_0xd194('0xd')](error[_0x34ffe3]);while(arguments[_0x1a2b3e]){_0x17df99[_0xd194('0xd')](arguments[_0x1a2b3e]);_0x1a2b3e++;}_0x47bfa6=util['format']['apply'](util,_0x17df99);this[_0xd194('0xe')]=_0x47bfa6;this[_0xd194('0xf')]=_0x34ffe3;}module[_0xd194('0x10')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index 9b0b3ba..e525c98 100644 --- a/server/services/agi/events.js +++ b/server/services/agi/events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2201=['exports','lodash','events','EventEmitter','./error','../../config/environment','defaults','subscribe','agi','emit','E_AGI_SERVER_ERROR','projectUpdate'];(function(_0x2f0939,_0x1bd6fe){var _0x317e69=function(_0x2ca863){while(--_0x2ca863){_0x2f0939['push'](_0x2f0939['shift']());}};_0x317e69(++_0x1bd6fe);}(_0x2201,0xcd));var _0x1220=function(_0xf69725,_0x2fbd80){_0xf69725=_0xf69725-0x0;var _0x391e56=_0x2201[_0xf69725];return _0x391e56;};'use strict';var _=require(_0x1220('0x0'));var EventEmitter=require(_0x1220('0x1'))[_0x1220('0x2')];var Redis=require('ioredis');var AGIError=require(_0x1220('0x3'));var config=require(_0x1220('0x4'));config['redis']=_[_0x1220('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config['redis']);sub[_0x1220('0x6')](_0x1220('0x7'),function(_0x6fa0cb){if(_0x6fa0cb)return eventEmitter[_0x1220('0x8')]('error',new AGIError(_0x1220('0x9'),_0x6fa0cb));});sub['on']('message',function(_0x4caad0,_0x34902e){if(_0x4caad0!==_0x1220('0x7'))return;try{var _0x11bcda=JSON['parse'](_0x34902e);eventEmitter[_0x1220('0x8')](_0x1220('0xa'),_0x11bcda);}catch(_0x526805){eventEmitter[_0x1220('0x8')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x526805));}});module[_0x1220('0xb')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0x2d3c=['localhost','subscribe','agi','emit','error','E_AGI_SERVER_ERROR','parse','projectUpdate','exports','lodash','events','EventEmitter','ioredis','./error','redis','defaults'];(function(_0x51cbc7,_0x70e604){var _0x1ec150=function(_0x5e9d32){while(--_0x5e9d32){_0x51cbc7['push'](_0x51cbc7['shift']());}};_0x1ec150(++_0x70e604);}(_0x2d3c,0x119));var _0xc2d3=function(_0x4285cb,_0x3a8933){_0x4285cb=_0x4285cb-0x0;var _0x326c55=_0x2d3c[_0x4285cb];return _0x326c55;};'use strict';var _=require(_0xc2d3('0x0'));var EventEmitter=require(_0xc2d3('0x1'))[_0xc2d3('0x2')];var Redis=require(_0xc2d3('0x3'));var AGIError=require(_0xc2d3('0x4'));var config=require('../../config/environment');config[_0xc2d3('0x5')]=_[_0xc2d3('0x6')](config[_0xc2d3('0x5')],{'host':_0xc2d3('0x7'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xc2d3('0x5')]);sub[_0xc2d3('0x8')](_0xc2d3('0x9'),function(_0x2358ca){if(_0x2358ca)return eventEmitter[_0xc2d3('0xa')](_0xc2d3('0xb'),new AGIError(_0xc2d3('0xc'),_0x2358ca));});sub['on']('message',function(_0x2bf147,_0x57d8f9){if(_0x2bf147!==_0xc2d3('0x9'))return;try{var _0x4a6ff1=JSON[_0xc2d3('0xd')](_0x57d8f9);eventEmitter['emit'](_0xc2d3('0xe'),_0x4a6ff1);}catch(_0x9c09f4){eventEmitter[_0xc2d3('0xa')](_0xc2d3('0xb'),new AGIError(_0xc2d3('0xc'),_0x9c09f4));}});module[_0xc2d3('0xf')]={'EventEmitter':eventEmitter}; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index df7e528..386995c 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 _0x6612=['relations','getVertex','traverseBFS','info','no\x20vertex\x20found','no\x20edge/s\x20available','length','condition','split','vswitch','target','default','agicommand','menu','invalid','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','agi','getdigits','getsecretdigits','vertices','edges','addVertex','prototype','addEdge','numberOfEdges','size'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0x6612,0xcd));var _0x2661=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x6612[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0x2661('0x0'));var logger=require(_0x2661('0x1'))(_0x2661('0x2'));var verticesWithRetry=['menu',_0x2661('0x3'),_0x2661('0x4')];var Graph=function(){this[_0x2661('0x5')]={};this[_0x2661('0x6')]={};this['numberOfEdges']=0x0;};Graph['prototype'][_0x2661('0x7')]=function(_0x3b1933){this['vertices'][_0x3b1933['id']]=_0x3b1933;this['edges'][_0x3b1933['id']]=[];};Graph[_0x2661('0x8')][_0x2661('0x9')]=function(_0x3d2ce1,_0x5741b5,_0x565be2){this[_0x2661('0x6')][_0x3d2ce1]['push']({'target':_0x5741b5,'condition':_0x565be2});this[_0x2661('0xa')]+=0x1;};Graph['prototype']['size']=function(){return _[_0x2661('0xb')](this['vertices']);};Graph[_0x2661('0x8')][_0x2661('0xc')]=function(){return this['numberOfEdges'];};Graph[_0x2661('0x8')][_0x2661('0xd')]=function(_0x56ca48){return this['vertices'][_0x56ca48];};Graph[_0x2661('0x8')][_0x2661('0xe')]=function(_0x3a39fd,_0xb37718){if(!this[_0x2661('0x5')][_0x3a39fd]){return logger[_0x2661('0xf')](_0x2661('0x10'));}var _0x409340=_0xb37718(this[_0x2661('0x5')][_0x3a39fd]);if(!_0x409340){return logger['info']('stop\x20traverse');}if(this[_0x2661('0x6')][_0x3a39fd]['length']===0x0){return logger[_0x2661('0xf')](_0x2661('0x11'));}for(var _0x1fe9fd=0x0,_0x1781db=[],_0x149364=![];_0x1fe9fd\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','evtHangup','then','catch','hasOwnProperty','agi_','debug','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','find','name','handleNotFound','initialize','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','./server','listening','connection','close','lodash'];(function(_0x479192,_0xa5f8e0){var _0x2012ee=function(_0x27d5a1){while(--_0x27d5a1){_0x479192['push'](_0x479192['shift']());}};_0x2012ee(++_0xa5f8e0);}(_0x8a1d,0xdf));var _0xd8a1=function(_0x5831b,_0x3226fb){_0x5831b=_0x5831b-0x0;var _0x5a46a=_0x8a1d[_0x5831b];return _0x5a46a;};'use strict';var _=require(_0xd8a1('0x0'));var syncho=require('syncho');var util=require(_0xd8a1('0x1'));var config=require(_0xd8a1('0x2'));var logger=require(_0xd8a1('0x3'))('agi');var utilLicense=require('../../config/license/util');var rpc=require('./rpc');var Project=require(_0xd8a1('0x4'));var AGIEmitter=require('./events')[_0xd8a1('0x5')];var projects=[];config[_0xd8a1('0x6')]=_[_0xd8a1('0x7')](config[_0xd8a1('0x6')],{'ip':_0xd8a1('0x8'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x1fb993){process[_0xd8a1('0x9')](function(){syncho(function(){try{setChannelVariables(_0x1fb993);agiHandler(_0x1fb993);}catch(_0x3ac537){logger['error'](_0x3ac537['stack']);}});});}function projectUpdateHandler(_0x577f9f){try{var _0x2a53cc=_['findIndex'](projects,['id',_0x577f9f['id']]);if(_0x2a53cc>-0x1){if(_0x577f9f[_0xd8a1('0xa')]===!![]){projects[_0xd8a1('0xb')](_0x2a53cc,0x1);}else{projects[_0x2a53cc]=_0x577f9f;}}else{projects[_0xd8a1('0xc')](_0x577f9f);}}catch(_0xa065eb){logger[_0xd8a1('0xd')](_0xa065eb[_0xd8a1('0xe')]);}}function listeningHandler(){console[_0xd8a1('0xf')](_0xd8a1('0x10'),config[_0xd8a1('0x6')][_0xd8a1('0x11')]);logger[_0xd8a1('0x12')](util[_0xd8a1('0x13')](_0xd8a1('0x14'),config[_0xd8a1('0x6')]['ip'],config[_0xd8a1('0x6')][_0xd8a1('0x11')]));}function errorHandler(_0x1d3a24){if(_0x1d3a24&&_0x1d3a24['name']&&_0x1d3a24['message']){logger[_0xd8a1('0xd')](util[_0xd8a1('0x13')](_0xd8a1('0x15'),_0x1d3a24['name'],_0x1d3a24[_0xd8a1('0x16')]));}else{logger[_0xd8a1('0xd')](util['format'](_0xd8a1('0x17'),_0x1d3a24[_0xd8a1('0xe')]));}}function closeHandler(){logger[_0xd8a1('0x12')](util[_0xd8a1('0x13')](_0xd8a1('0x18'),this[_0xd8a1('0x19')],this[_0xd8a1('0x1a')],this[_0xd8a1('0x1b')],this[_0xd8a1('0x1c')],this['uniqueid']));try{createSquareReport(this);}catch(_0x2c480f){logger[_0xd8a1('0xd')](_0x2c480f['stack']);}}function timeoutHandler(){logger[_0xd8a1('0x12')](util[_0xd8a1('0x13')](_0xd8a1('0x1d'),this[_0xd8a1('0x19')],this[_0xd8a1('0x1a')],this[_0xd8a1('0x1b')],this['dnid'],this['uniqueid']));}function hangupHandler(){logger[_0xd8a1('0x12')](util[_0xd8a1('0x13')](_0xd8a1('0x1e'),this[_0xd8a1('0x19')],this['calleridname'],this['callerid'],this[_0xd8a1('0x1c')],this[_0xd8a1('0x1f')]));this[_0xd8a1('0x20')]=!![];}function createSquareReport(_0x2f424d,_0x36305e){rpc['createSquareReport'](_0x2f424d)[_0xd8a1('0x21')](function(_0xf24e1b){if(_0x36305e){_0x36305e(null,_0xf24e1b);}})[_0xd8a1('0x22')](function(_0x51eac1){if(_0x36305e){_0x36305e(null,_0x51eac1);}});}function setChannelVariables(_0x5c9573){for(var _0x134180 in _0x5c9573){if(_0x5c9573[_0xd8a1('0x23')](_0x134180)){if(_0x134180['indexOf'](_0xd8a1('0x24'))===0x0){_0x5c9573[_0x134180['substring'](0x4)]=_0x5c9573[_0x134180];delete _0x5c9573[_0x134180];}}}}function agiHandler(_0x1e926e){logger[_0xd8a1('0x25')]('variables',JSON[_0xd8a1('0x26')](_0x1e926e,null,0x2));logger[_0xd8a1('0x12')](util[_0xd8a1('0x13')](_0xd8a1('0x27'),_0x1e926e[_0xd8a1('0x19')],_0x1e926e[_0xd8a1('0x1a')],_0x1e926e[_0xd8a1('0x1b')],_0x1e926e[_0xd8a1('0x1c')],_0x1e926e['uniqueid']));_0x1e926e['on']('error',errorHandler);_0x1e926e['on']('close',closeHandler);_0x1e926e['on'](_0xd8a1('0x28'),timeoutHandler);_0x1e926e['evtHangup']=![];_0x1e926e['on']('hangup',hangupHandler);var _0x169ce4=_[_0xd8a1('0x29')](projects,[_0xd8a1('0x2a'),_0x1e926e[_0xd8a1('0x19')]]);if(!_0x169ce4)return Project[_0xd8a1('0x2b')](_0x1e926e);if(!_0x169ce4['production'])return Project['handleUnpublished'](_0x1e926e);return Project[_0xd8a1('0x2c')](_0x169ce4,_0x1e926e);}function main(){var _0x52b1b0;return utilLicense[_0xd8a1('0x2d')]()[_0xd8a1('0x21')](function(_0xcfb98f){if(!_0xcfb98f)return;if(_0xcfb98f[_0xd8a1('0x2e')]){if(_0xcfb98f[_0xd8a1('0x2f')]&&_0xcfb98f[_0xd8a1('0x2f')]>0x0){logger[_0xd8a1('0x12')](util[_0xd8a1('0x13')](_0xd8a1('0x30'),_0xcfb98f['callysquare']));_0x52b1b0=_0xcfb98f[_0xd8a1('0x2f')];}else{logger['info']('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0xd8a1('0x12')](_0xd8a1('0x31'));_0x52b1b0=-0x1;}})[_0xd8a1('0x21')](function(){return Project[_0xd8a1('0x32')]();})[_0xd8a1('0x21')](function(_0x38e24b){projects=_0x38e24b;return;})[_0xd8a1('0x22')](function(_0x3fa01d){logger[_0xd8a1('0xd')](_0xd8a1('0x33'),_0x3fa01d[_0xd8a1('0xe')]);})['finally'](function(){var _0x2ca240=require(_0xd8a1('0x34'))(config[_0xd8a1('0x6')][_0xd8a1('0x11')],config[_0xd8a1('0x6')]['ip'],_0x52b1b0);_0x2ca240['on'](_0xd8a1('0xd'),errorHandler);_0x2ca240['on'](_0xd8a1('0x35'),listeningHandler);_0x2ca240['on'](_0xd8a1('0x36'),connectionHandler);_0x2ca240['on'](_0xd8a1('0x37'),closeHandler);});}main(); \ No newline at end of file +var _0x2de8=['syncho','util','../../config/environment','agi','../../config/license/util','./rpc','EventEmitter','127.0.0.1','projectUpdate','error','stack','findIndex','deleted','splice','push','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[ERROR]\x20%s','info','arg_1','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','catch','hasOwnProperty','debug','variables','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','hangup','find','handleNotFound','production','handleUnpublished','initialize','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','then','[LICENSE]','finally','./server','connection','close','lodash'];(function(_0x2c8849,_0x37616e){var _0x15a938=function(_0x3fe918){while(--_0x3fe918){_0x2c8849['push'](_0x2c8849['shift']());}};_0x15a938(++_0x37616e);}(_0x2de8,0xeb));var _0x82de=function(_0x337aea,_0x50e5c2){_0x337aea=_0x337aea-0x0;var _0x1cd6c1=_0x2de8[_0x337aea];return _0x1cd6c1;};'use strict';var _=require(_0x82de('0x0'));var syncho=require(_0x82de('0x1'));var util=require(_0x82de('0x2'));var config=require(_0x82de('0x3'));var logger=require('../../config/logger')(_0x82de('0x4'));var utilLicense=require(_0x82de('0x5'));var rpc=require(_0x82de('0x6'));var Project=require('./project');var AGIEmitter=require('./events')[_0x82de('0x7')];var projects=[];config[_0x82de('0x4')]=_['defaults'](config['agi'],{'ip':_0x82de('0x8'),'port':0x11dd});AGIEmitter['on'](_0x82de('0x9'),projectUpdateHandler);function connectionHandler(_0x4ae502){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x4ae502);agiHandler(_0x4ae502);}catch(_0x555f49){logger[_0x82de('0xa')](_0x555f49[_0x82de('0xb')]);}});});}function projectUpdateHandler(_0x3d7ea8){try{var _0x8fbc31=_[_0x82de('0xc')](projects,['id',_0x3d7ea8['id']]);if(_0x8fbc31>-0x1){if(_0x3d7ea8[_0x82de('0xd')]===!![]){projects[_0x82de('0xe')](_0x8fbc31,0x1);}else{projects[_0x8fbc31]=_0x3d7ea8;}}else{projects[_0x82de('0xf')](_0x3d7ea8);}}catch(_0x58196e){logger[_0x82de('0xa')](_0x58196e['stack']);}}function listeningHandler(){console[_0x82de('0x10')](_0x82de('0x11'),config[_0x82de('0x4')][_0x82de('0x12')]);logger['info'](util[_0x82de('0x13')](_0x82de('0x14'),config[_0x82de('0x4')]['ip'],config['agi'][_0x82de('0x12')]));}function errorHandler(_0x1d7ec7){if(_0x1d7ec7&&_0x1d7ec7[_0x82de('0x15')]&&_0x1d7ec7[_0x82de('0x16')]){logger[_0x82de('0xa')](util['format'](_0x82de('0x17'),_0x1d7ec7['name'],_0x1d7ec7['message']));}else{logger[_0x82de('0xa')](util[_0x82de('0x13')](_0x82de('0x18'),_0x1d7ec7[_0x82de('0xb')]));}}function closeHandler(){logger[_0x82de('0x19')](util['format']('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x82de('0x1a')],this[_0x82de('0x1b')],this[_0x82de('0x1c')],this[_0x82de('0x1d')],this[_0x82de('0x1e')]));try{createSquareReport(this);}catch(_0x257b47){logger['error'](_0x257b47['stack']);}}function timeoutHandler(){logger[_0x82de('0x19')](util[_0x82de('0x13')](_0x82de('0x1f'),this[_0x82de('0x1a')],this[_0x82de('0x1b')],this[_0x82de('0x1c')],this[_0x82de('0x1d')],this[_0x82de('0x1e')]));}function hangupHandler(){logger[_0x82de('0x19')](util['format'](_0x82de('0x20'),this[_0x82de('0x1a')],this[_0x82de('0x1b')],this[_0x82de('0x1c')],this[_0x82de('0x1d')],this['uniqueid']));this[_0x82de('0x21')]=!![];}function createSquareReport(_0x59e156,_0x554bd5){rpc[_0x82de('0x22')](_0x59e156)['then'](function(_0x5b4477){if(_0x554bd5){_0x554bd5(null,_0x5b4477);}})[_0x82de('0x23')](function(_0x1e7edf){if(_0x554bd5){_0x554bd5(null,_0x1e7edf);}});}function setChannelVariables(_0x39ef2d){for(var _0x12d5c4 in _0x39ef2d){if(_0x39ef2d[_0x82de('0x24')](_0x12d5c4)){if(_0x12d5c4['indexOf']('agi_')===0x0){_0x39ef2d[_0x12d5c4['substring'](0x4)]=_0x39ef2d[_0x12d5c4];delete _0x39ef2d[_0x12d5c4];}}}}function agiHandler(_0xc85b3b){logger[_0x82de('0x25')](_0x82de('0x26'),JSON['stringify'](_0xc85b3b,null,0x2));logger[_0x82de('0x19')](util[_0x82de('0x13')](_0x82de('0x27'),_0xc85b3b[_0x82de('0x1a')],_0xc85b3b['calleridname'],_0xc85b3b[_0x82de('0x1c')],_0xc85b3b['dnid'],_0xc85b3b[_0x82de('0x1e')]));_0xc85b3b['on'](_0x82de('0xa'),errorHandler);_0xc85b3b['on']('close',closeHandler);_0xc85b3b['on'](_0x82de('0x28'),timeoutHandler);_0xc85b3b[_0x82de('0x21')]=![];_0xc85b3b['on'](_0x82de('0x29'),hangupHandler);var _0x3feda5=_[_0x82de('0x2a')](projects,[_0x82de('0x15'),_0xc85b3b[_0x82de('0x1a')]]);if(!_0x3feda5)return Project[_0x82de('0x2b')](_0xc85b3b);if(!_0x3feda5[_0x82de('0x2c')])return Project[_0x82de('0x2d')](_0xc85b3b);return Project[_0x82de('0x2e')](_0x3feda5,_0xc85b3b);}function main(){var _0x532465;return utilLicense[_0x82de('0x2f')]()['then'](function(_0x35d88f){if(!_0x35d88f)return;if(_0x35d88f[_0x82de('0x30')]){if(_0x35d88f['callysquare']&&_0x35d88f[_0x82de('0x31')]>0x0){logger[_0x82de('0x19')](util['format'](_0x82de('0x32'),_0x35d88f[_0x82de('0x31')]));_0x532465=_0x35d88f[_0x82de('0x31')];}else{logger[_0x82de('0x19')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0x82de('0x19')](_0x82de('0x33'));_0x532465=-0x1;}})['then'](function(){return Project[_0x82de('0x34')]();})[_0x82de('0x35')](function(_0x43d5ea){projects=_0x43d5ea;return;})['catch'](function(_0x205d66){logger[_0x82de('0xa')](_0x82de('0x36'),_0x205d66[_0x82de('0xb')]);})[_0x82de('0x37')](function(){var _0x29cfca=require(_0x82de('0x38'))(config[_0x82de('0x4')][_0x82de('0x12')],config[_0x82de('0x4')]['ip'],_0x532465);_0x29cfca['on'](_0x82de('0xa'),errorHandler);_0x29cfca['on']('listening',listeningHandler);_0x29cfca['on'](_0x82de('0x39'),connectionHandler);_0x29cfca['on'](_0x82de('0x3a'),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 346efd3..ada4bd9 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 _0xd0d4=['client','request','error','result','SendMail','jayson/promise'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xd0d4,0x8f));var _0x4d0d=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0xd0d4[_0x4fbfd9];return _0x31dc94;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x4d0d('0x0'));var client=jayson[_0x4d0d('0x1')]['http']({'port':0x232b});function request(_0x2b0722,_0x45da1d){return new BPromise(function(_0x795fa1,_0x5c413a){return client[_0x4d0d('0x2')](_0x2b0722,_0x45da1d)['then'](function(_0x2dc482){if(_0x2dc482[_0x4d0d('0x3')]){return _0x5c413a(_0x2dc482[_0x4d0d('0x3')]['message']);}else{return _0x795fa1(_0x2dc482[_0x4d0d('0x4')]);}})['catch'](function(_0x389bc5){return _0x5c413a(_0x389bc5);});});}exports['sendMailMessage']=function(_0xfdb5ad,_0xccacbe){return request(_0x4d0d('0x5'),{'account':_0xfdb5ad,'message':_0xccacbe});}; \ No newline at end of file +var _0x146e=['error','message','bluebird','client','http','then'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x146e,0x15e));var _0xe146=function(_0x32ebb2,_0x5760fd){_0x32ebb2=_0x32ebb2-0x0;var _0x3ec997=_0x146e[_0x32ebb2];return _0x3ec997;};'use strict';var BPromise=require(_0xe146('0x0'));var jayson=require('jayson/promise');var client=jayson[_0xe146('0x1')][_0xe146('0x2')]({'port':0x232b});function request(_0x16cd82,_0x3f3c29){return new BPromise(function(_0x5d3bb7,_0x2755c1){return client['request'](_0x16cd82,_0x3f3c29)[_0xe146('0x3')](function(_0x3caef7){if(_0x3caef7['error']){return _0x2755c1(_0x3caef7[_0xe146('0x4')][_0xe146('0x5')]);}else{return _0x5d3bb7(_0x3caef7['result']);}})['catch'](function(_0x210d7c){return _0x2755c1(_0x210d7c);});});}exports['sendMailMessage']=function(_0x383477,_0x4d47a1){return request('SendMail',{'account':_0x383477,'message':_0x4d47a1});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index e733ca1..17eb9bd 100644 --- a/server/services/agi/project.js +++ b/server/services/agi/project.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5132=['[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','exports','lodash','xml2json','util','agi','./rpc','./mailRpc','./vertices','getSquareProjects','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','retry','maxRetry','omit','length','target','source','value','mxGraphModel','root','inspect','start','debug','stringify','joinAt','YYYY-MM-DD\x20HH:mm:ss','mxCell','format','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','traverseBFS','gotoc','info','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','evtHangup','result','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','clear','vertex','isUndefined'];(function(_0x55417,_0x7fc5be){var _0x565cad=function(_0xbae8ed){while(--_0xbae8ed){_0x55417['push'](_0x55417['shift']());}};_0x565cad(++_0x7fc5be);}(_0x5132,0xbb));var _0x2513=function(_0x1a1f0f,_0x51f531){_0x1a1f0f=_0x1a1f0f-0x0;var _0x59c564=_0x5132[_0x1a1f0f];return _0x59c564;};'use strict';var _=require(_0x2513('0x0'));var moment=require('moment');var parser=require(_0x2513('0x1'));var util=require(_0x2513('0x2'));var logger=require('../../config/logger')(_0x2513('0x3'));var rpc=require(_0x2513('0x4'));var mailRpc=require(_0x2513('0x5'));var Graph=require('./graph');var Vertices=require(_0x2513('0x6'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x2513('0x7')]()['catch'](function(_0x435bd1){logger[_0x2513('0x8')](_0x2513('0x9'),_0x435bd1[_0x2513('0xa')]);return[];});}function addVertex(_0x191758,_0x3252d9,_0x31ff36){_0x3252d9[_0x2513('0xb')]=_0x31ff36;if(_0x3252d9[_0x2513('0xc')](_0x2513('0xd'))){_0x3252d9[_0x2513('0xe')]=parseInt(_0x3252d9[_0x2513('0xd')],0xa);}_0x191758['addVertex'](_[_0x2513('0xf')](_0x3252d9,'mxCell'));}function initGraph(_0x5b7d67,_0x3c3bb0){var _0x2a0a90=new Graph();for(var _0x501c38 in _0x5b7d67){if(_0x5b7d67[_0x2513('0xc')](_0x501c38)){if(_['isArray'](_0x5b7d67[_0x501c38])){for(var _0x41f1b2=0x0;_0x41f1b2<_0x5b7d67[_0x501c38][_0x2513('0x10')];_0x41f1b2+=0x1){addVertex(_0x2a0a90,_0x5b7d67[_0x501c38][_0x41f1b2],_0x501c38);}}else{addVertex(_0x2a0a90,_0x5b7d67[_0x501c38],_0x501c38);}}}for(var _0x2ba338=0x0;_0x2ba338<_0x3c3bb0[_0x2513('0x10')];_0x2ba338+=0x1){if(_0x3c3bb0[_0x2ba338]['source']&&_0x3c3bb0[_0x2ba338][_0x2513('0x11')]){_0x2a0a90['addEdge'](_0x3c3bb0[_0x2ba338][_0x2513('0x12')],_0x3c3bb0[_0x2ba338]['target'],_0x3c3bb0[_0x2ba338][_0x2513('0x13')]);}}return _0x2a0a90;}function getRoot(_0x4f0085){return parser['toJson'](_0x4f0085,{'object':!![]})[_0x2513('0x14')][_0x2513('0x15')];}function inspect(_0x4ca03b){return util[_0x2513('0x16')](_0x4ca03b,{'showHidden':![],'depth':null});}function initialize(_0x5d10da,_0x3eb17b){var _0x5ee58d=getRoot(_0x5d10da['production']);if(!_0x5ee58d||!_0x5ee58d[_0x2513('0x17')])return;var _0x1f43be,_0x133532,_0x5e1d97;logger[_0x2513('0x18')](_0x2513('0x15'),JSON[_0x2513('0x19')](_0x5ee58d,null,0x2));_0x3eb17b[_0x2513('0x1a')]=moment()['format'](_0x2513('0x1b'));_0x1f43be=initGraph(_[_0x2513('0xf')](_0x5ee58d,_0x2513('0x1c')),_0x5ee58d[_0x2513('0x1c')]);_0x133532=new Vertices(_0x3eb17b,rpc,mailRpc);logger['info'](util[_0x2513('0x1d')](_0x2513('0x1e'),_0x3eb17b[_0x2513('0x1f')],_0x3eb17b[_0x2513('0x20')],_0x3eb17b[_0x2513('0x21')],_0x3eb17b[_0x2513('0x22')],_0x3eb17b[_0x2513('0x23')]));_0x1f43be[_0x2513('0x24')](_0x5ee58d['start']['id'],function(_0x621781){try{_0x621781=_0x133532['clear'](_0x621781);logger['debug']('vertex',JSON[_0x2513('0x19')](_0x621781,null,0x2));if(_0x621781[_0x2513('0xb')]===_0x2513('0x25')){logger[_0x2513('0x26')](_0x2513('0x27'));_0x3eb17b[_0x2513('0x28')]=_0x621781[_0x2513('0x28')]||_0x3eb17b[_0x2513('0x28')];_0x3eb17b[_0x2513('0x29')]=_0x621781[_0x2513('0x29')];_0x3eb17b[_0x2513('0x2a')]=_0x621781[_0x2513('0x2a')]?_0x621781[_0x2513('0x2a')]-0x1:0x1;return null;}else if(_0x621781&&_0x133532[_0x621781[_0x2513('0xb')]]){_0x5e1d97=_0x133532[_0x621781['agicommand']](_0x621781);logger[_0x2513('0x26')](_0x2513('0x2b'),JSON[_0x2513('0x19')](_0x5e1d97,null,0x2));if(_0x5e1d97&&_0x5e1d97[_0x2513('0x2c')]===AGI_CODE_SUCCESS&&_0x5e1d97['result']!==AGI_RESULT_ERROR&&!_0x3eb17b[_0x2513('0x2d')]){logger[_0x2513('0x18')](_0x2513('0x2b'),inspect(_0x5e1d97));return _['isUndefined'](_0x5e1d97[_0x2513('0x2e')])?null:_0x5e1d97[_0x2513('0x2e')]['toString']();}else{logger[_0x2513('0x8')]('response',inspect(_0x5e1d97));return null;}}else{logger[_0x2513('0x8')](_0x2513('0x2f'));return null;}}catch(_0x543182){logger[_0x2513('0x8')](_0x543182[_0x2513('0xa')]);return null;}});if(_0x5ee58d[_0x2513('0x30')]){logger[_0x2513('0x26')](util[_0x2513('0x1d')](_0x2513('0x31'),_0x3eb17b[_0x2513('0x1f')],_0x3eb17b[_0x2513('0x20')],_0x3eb17b[_0x2513('0x21')],_0x3eb17b[_0x2513('0x22')],_0x3eb17b['uniqueid']));_0x1f43be[_0x2513('0x24')](_0x5ee58d[_0x2513('0x30')]['id'],function(_0xb13f8e){try{_0xb13f8e=_0x133532[_0x2513('0x32')](_0xb13f8e);logger['debug'](_0x2513('0x33'),JSON[_0x2513('0x19')](_0xb13f8e,null,0x2));if(_0xb13f8e&&_0x133532[_0xb13f8e[_0x2513('0xb')]]){_0x5e1d97=_0x133532[_0xb13f8e[_0x2513('0xb')]](_0xb13f8e);if(_0x5e1d97){logger['debug'](_0x2513('0x2b'),inspect(_0x5e1d97));return _[_0x2513('0x34')](_0x5e1d97[_0x2513('0x2e')])?null:_0x5e1d97[_0x2513('0x2e')]['toString']();}else{logger[_0x2513('0x8')](_0x2513('0x2b'),inspect(_0x5e1d97));return null;}}else{logger['error'](_0x2513('0x2f'));return null;}}catch(_0x54864c){logger[_0x2513('0x8')](_0x54864c[_0x2513('0xa')]);return null;}});}logger[_0x2513('0x26')](util['format'](_0x2513('0x35'),_0x3eb17b[_0x2513('0x1f')],_0x3eb17b[_0x2513('0x20')],_0x3eb17b[_0x2513('0x21')],_0x3eb17b[_0x2513('0x22')],_0x3eb17b['uniqueid']));logger[_0x2513('0x26')](util[_0x2513('0x1d')](_0x2513('0x36'),_0x3eb17b[_0x2513('0x28')],_0x3eb17b[_0x2513('0x29')],parseInt(_0x3eb17b[_0x2513('0x2a')],0xa)+0x1));_0x3eb17b[_0x2513('0x37')](_0x3eb17b[_0x2513('0x28')],_0x3eb17b['extension'],parseInt(_0x3eb17b[_0x2513('0x2a')],0xa)+0x1);_0x3eb17b[_0x2513('0x38')]();}function handleNotFound(_0x42172b){logger[_0x2513('0x8')](util[_0x2513('0x1d')](_0x2513('0x39'),_0x42172b[_0x2513('0x1f')]));_0x42172b[_0x2513('0x37')](_0x42172b[_0x2513('0x28')],_0x42172b[_0x2513('0x29')],parseInt(_0x42172b[_0x2513('0x2a')],0xa)+0x1);_0x42172b[_0x2513('0x38')]();}function handleUnpublished(_0x2380b3){logger[_0x2513('0x8')](util[_0x2513('0x1d')](_0x2513('0x3a'),_0x2380b3[_0x2513('0x1f')]));_0x2380b3[_0x2513('0x37')](_0x2380b3[_0x2513('0x28')],_0x2380b3['extension'],parseInt(_0x2380b3['priority'],0xa)+0x1);_0x2380b3['close']();}module[_0x2513('0x3b')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x1d1e=['error','stack','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','source','addEdge','target','value','toJson','mxGraphModel','root','production','start','debug','stringify','format','YYYY-MM-DD\x20HH:mm:ss','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','dnid','uniqueid','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','evtHangup','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','isUndefined','toString','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20published','exports','lodash','moment','xml2json','../../config/logger','agi','./rpc','./graph','catch'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x1d1e,0x74));var _0xe1d1=function(_0x11ee99,_0xa743ed){_0x11ee99=_0x11ee99-0x0;var _0x469072=_0x1d1e[_0x11ee99];return _0x469072;};'use strict';var _=require(_0xe1d1('0x0'));var moment=require(_0xe1d1('0x1'));var parser=require(_0xe1d1('0x2'));var util=require('util');var logger=require(_0xe1d1('0x3'))(_0xe1d1('0x4'));var rpc=require(_0xe1d1('0x5'));var mailRpc=require('./mailRpc');var Graph=require(_0xe1d1('0x6'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()[_0xe1d1('0x7')](function(_0x43a676){logger[_0xe1d1('0x8')]('Unable\x20to\x20download\x20CallySquare\x20projects',_0x43a676[_0xe1d1('0x9')]);return[];});}function addVertex(_0xd8e393,_0x15568b,_0x5e95a1){_0x15568b[_0xe1d1('0xa')]=_0x5e95a1;if(_0x15568b[_0xe1d1('0xb')](_0xe1d1('0xc'))){_0x15568b[_0xe1d1('0xd')]=parseInt(_0x15568b[_0xe1d1('0xc')],0xa);}_0xd8e393[_0xe1d1('0xe')](_[_0xe1d1('0xf')](_0x15568b,_0xe1d1('0x10')));}function initGraph(_0x3782b0,_0xcc7a2e){var _0x49e486=new Graph();for(var _0x15cf48 in _0x3782b0){if(_0x3782b0[_0xe1d1('0xb')](_0x15cf48)){if(_[_0xe1d1('0x11')](_0x3782b0[_0x15cf48])){for(var _0x45c79c=0x0;_0x45c79c<_0x3782b0[_0x15cf48]['length'];_0x45c79c+=0x1){addVertex(_0x49e486,_0x3782b0[_0x15cf48][_0x45c79c],_0x15cf48);}}else{addVertex(_0x49e486,_0x3782b0[_0x15cf48],_0x15cf48);}}}for(var _0x42e54a=0x0;_0x42e54a<_0xcc7a2e[_0xe1d1('0x12')];_0x42e54a+=0x1){if(_0xcc7a2e[_0x42e54a][_0xe1d1('0x13')]&&_0xcc7a2e[_0x42e54a]['target']){_0x49e486[_0xe1d1('0x14')](_0xcc7a2e[_0x42e54a]['source'],_0xcc7a2e[_0x42e54a][_0xe1d1('0x15')],_0xcc7a2e[_0x42e54a][_0xe1d1('0x16')]);}}return _0x49e486;}function getRoot(_0x2e7546){return parser[_0xe1d1('0x17')](_0x2e7546,{'object':!![]})[_0xe1d1('0x18')][_0xe1d1('0x19')];}function inspect(_0x24cb2f){return util['inspect'](_0x24cb2f,{'showHidden':![],'depth':null});}function initialize(_0x55377e,_0xddae6f){var _0x1abc67=getRoot(_0x55377e[_0xe1d1('0x1a')]);if(!_0x1abc67||!_0x1abc67[_0xe1d1('0x1b')])return;var _0x2c6cf3,_0x719b22,_0x4c4e39;logger[_0xe1d1('0x1c')](_0xe1d1('0x19'),JSON[_0xe1d1('0x1d')](_0x1abc67,null,0x2));_0xddae6f['joinAt']=moment()[_0xe1d1('0x1e')](_0xe1d1('0x1f'));_0x2c6cf3=initGraph(_['omit'](_0x1abc67,'mxCell'),_0x1abc67[_0xe1d1('0x10')]);_0x719b22=new Vertices(_0xddae6f,rpc,mailRpc);logger[_0xe1d1('0x20')](util[_0xe1d1('0x1e')](_0xe1d1('0x21'),_0xddae6f[_0xe1d1('0x22')],_0xddae6f['calleridname'],_0xddae6f[_0xe1d1('0x23')],_0xddae6f[_0xe1d1('0x24')],_0xddae6f[_0xe1d1('0x25')]));_0x2c6cf3['traverseBFS'](_0x1abc67[_0xe1d1('0x1b')]['id'],function(_0x2d66a7){try{_0x2d66a7=_0x719b22[_0xe1d1('0x26')](_0x2d66a7);logger[_0xe1d1('0x1c')](_0xe1d1('0x27'),JSON[_0xe1d1('0x1d')](_0x2d66a7,null,0x2));if(_0x2d66a7[_0xe1d1('0xa')]===_0xe1d1('0x28')){logger[_0xe1d1('0x20')](_0xe1d1('0x29'));_0xddae6f[_0xe1d1('0x2a')]=_0x2d66a7['context']||_0xddae6f[_0xe1d1('0x2a')];_0xddae6f[_0xe1d1('0x2b')]=_0x2d66a7[_0xe1d1('0x2b')];_0xddae6f[_0xe1d1('0x2c')]=_0x2d66a7[_0xe1d1('0x2c')]?_0x2d66a7[_0xe1d1('0x2c')]-0x1:0x1;return null;}else if(_0x2d66a7&&_0x719b22[_0x2d66a7[_0xe1d1('0xa')]]){_0x4c4e39=_0x719b22[_0x2d66a7[_0xe1d1('0xa')]](_0x2d66a7);logger[_0xe1d1('0x20')](_0xe1d1('0x2d'),JSON['stringify'](_0x4c4e39,null,0x2));if(_0x4c4e39&&_0x4c4e39[_0xe1d1('0x2e')]===AGI_CODE_SUCCESS&&_0x4c4e39[_0xe1d1('0x2f')]!==AGI_RESULT_ERROR&&!_0xddae6f[_0xe1d1('0x30')]){logger[_0xe1d1('0x1c')](_0xe1d1('0x2d'),inspect(_0x4c4e39));return _['isUndefined'](_0x4c4e39[_0xe1d1('0x2f')])?null:_0x4c4e39[_0xe1d1('0x2f')]['toString']();}else{logger[_0xe1d1('0x8')](_0xe1d1('0x2d'),inspect(_0x4c4e39));return null;}}else{logger['error'](_0xe1d1('0x31'));return null;}}catch(_0x2dda62){logger[_0xe1d1('0x8')](_0x2dda62['stack']);return null;}});if(_0x1abc67[_0xe1d1('0x32')]){logger[_0xe1d1('0x20')](util[_0xe1d1('0x1e')](_0xe1d1('0x33'),_0xddae6f[_0xe1d1('0x22')],_0xddae6f['calleridname'],_0xddae6f[_0xe1d1('0x23')],_0xddae6f['dnid'],_0xddae6f[_0xe1d1('0x25')]));_0x2c6cf3[_0xe1d1('0x34')](_0x1abc67['finally']['id'],function(_0x2d062a){try{_0x2d062a=_0x719b22['clear'](_0x2d062a);logger[_0xe1d1('0x1c')](_0xe1d1('0x27'),JSON[_0xe1d1('0x1d')](_0x2d062a,null,0x2));if(_0x2d062a&&_0x719b22[_0x2d062a[_0xe1d1('0xa')]]){_0x4c4e39=_0x719b22[_0x2d062a['agicommand']](_0x2d062a);if(_0x4c4e39){logger[_0xe1d1('0x1c')](_0xe1d1('0x2d'),inspect(_0x4c4e39));return _[_0xe1d1('0x35')](_0x4c4e39[_0xe1d1('0x2f')])?null:_0x4c4e39[_0xe1d1('0x2f')][_0xe1d1('0x36')]();}else{logger['error']('response',inspect(_0x4c4e39));return null;}}else{logger[_0xe1d1('0x8')](_0xe1d1('0x31'));return null;}}catch(_0x58c488){logger[_0xe1d1('0x8')](_0x58c488['stack']);return null;}});}logger[_0xe1d1('0x20')](util[_0xe1d1('0x1e')](_0xe1d1('0x37'),_0xddae6f[_0xe1d1('0x22')],_0xddae6f[_0xe1d1('0x38')],_0xddae6f[_0xe1d1('0x23')],_0xddae6f[_0xe1d1('0x24')],_0xddae6f[_0xe1d1('0x25')]));logger['info'](util[_0xe1d1('0x1e')](_0xe1d1('0x39'),_0xddae6f['context'],_0xddae6f['extension'],parseInt(_0xddae6f[_0xe1d1('0x2c')],0xa)+0x1));_0xddae6f[_0xe1d1('0x3a')](_0xddae6f[_0xe1d1('0x2a')],_0xddae6f[_0xe1d1('0x2b')],parseInt(_0xddae6f['priority'],0xa)+0x1);_0xddae6f[_0xe1d1('0x3b')]();}function handleNotFound(_0x527557){logger[_0xe1d1('0x8')](util[_0xe1d1('0x1e')]('Project\x20%s\x20not\x20found',_0x527557[_0xe1d1('0x22')]));_0x527557[_0xe1d1('0x3a')](_0x527557[_0xe1d1('0x2a')],_0x527557[_0xe1d1('0x2b')],parseInt(_0x527557[_0xe1d1('0x2c')],0xa)+0x1);_0x527557[_0xe1d1('0x3b')]();}function handleUnpublished(_0x4ba3ea){logger[_0xe1d1('0x8')](util[_0xe1d1('0x1e')](_0xe1d1('0x3c'),_0x4ba3ea[_0xe1d1('0x22')]));_0x4ba3ea[_0xe1d1('0x3a')](_0x4ba3ea['context'],_0x4ba3ea[_0xe1d1('0x2b')],parseInt(_0x4ba3ea[_0xe1d1('0x2c')],0xa)+0x1);_0x4ba3ea[_0xe1d1('0x3b')]();}module[_0xe1d1('0x3d')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 0eb3629..08189df 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 _0xefad=['inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','split','slice','trim','headers','line','exports','util','Transform','call','_localBuffer','_inBody'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xefad,0x1d6));var _0xdefa=function(_0x52495f,_0x5184df){_0x52495f=_0x52495f-0x0;var _0x2cae8d=_0xefad[_0x52495f];return _0x2cae8d;};'use strict';var util=require(_0xdefa('0x0'));var Transform=require('stream')[_0xdefa('0x1')];function AGIReply(_0x19ebcc){Transform[_0xdefa('0x2')](this,_0x19ebcc);this[_0xdefa('0x3')]='';this[_0xdefa('0x4')]=![];}util[_0xdefa('0x5')](AGIReply,Transform);AGIReply[_0xdefa('0x6')][_0xdefa('0x7')]=function(_0x1a6d6d,_0x5ec461,_0x35fa01){var _0x305f9f='\x0a',_0x5c0fcd=['\x0a\x0a',_0xdefa('0x8')],_0x7cbdb1=-0x1,_0xfe80f7=-0x1,_0x31382d='',_0x5a8897=0x0,_0x5d759c='',_0x4a862c='';this[_0xdefa('0x3')]+=_0x1a6d6d[_0xdefa('0x9')]();_0x5d759c=this[_0xdefa('0x3')];if(!this[_0xdefa('0x4')]){_0x5a8897=0x0;while(_0x5c0fcd[_0x5a8897]){while((_0xfe80f7=_0x5d759c[_0xdefa('0xa')](_0x5c0fcd[_0x5a8897]))!=-0x1){_0x31382d=_0x5c0fcd[_0x5a8897];_0x4a862c=_0x5d759c[_0xdefa('0xb')](0x0,_0xfe80f7);_0x5d759c=_0x5d759c[_0xdefa('0xb')](_0xfe80f7+_0x31382d[_0xdefa('0xc')]);var _0x17d4c7=_0x4a862c[_0xdefa('0xd')](_0x305f9f),_0x2f2998=0x0,_0x184e07={},_0x3c2e8a='',_0x53acde='',_0x1b0316=-0x1;while(_0x17d4c7[_0x2f2998]){_0x1b0316=_0x17d4c7[_0x2f2998][_0xdefa('0xa')](':');if(_0x1b0316!=-0x1){_0x3c2e8a=_0x17d4c7[_0x2f2998][_0xdefa('0xe')](0x0,_0x1b0316)['trim']();_0x53acde=_0x17d4c7[_0x2f2998][_0xdefa('0xe')](_0x1b0316+0x1)[_0xdefa('0xf')]();if(_0x3c2e8a[_0xdefa('0xc')]>0x0){_0x184e07[_0x3c2e8a]=_0x53acde;}}else{}_0x2f2998++;}this['emit'](_0xdefa('0x10'),_0x184e07);this[_0xdefa('0x4')]=!![];}_0x5a8897++;}this[_0xdefa('0x3')]=_0x5d759c;}else{while((_0x7cbdb1=_0x5d759c[_0xdefa('0xa')](_0x305f9f))!=-0x1){_0x4a862c=_0x5d759c[_0xdefa('0xb')](0x0,_0x7cbdb1);this['emit'](_0xdefa('0x11'),_0x4a862c);_0x5d759c=_0x5d759c[_0xdefa('0xb')](_0x7cbdb1+_0x305f9f[_0xdefa('0xc')]);}this[_0xdefa('0x3')]=_0x5d759c;}_0x35fa01();};module[_0xdefa('0x12')]=AGIReply; \ No newline at end of file +var _0x609a=['stream','Transform','call','_localBuffer','inherits','_transform','_inBody','indexOf','substring','length','split','slice','trim','emit','line','exports','util'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x609a,0x1ec));var _0xa609=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x609a[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0xa609('0x0'));var Transform=require(_0xa609('0x1'))[_0xa609('0x2')];function AGIReply(_0x45ae05){Transform[_0xa609('0x3')](this,_0x45ae05);this[_0xa609('0x4')]='';this['_inBody']=![];}util[_0xa609('0x5')](AGIReply,Transform);AGIReply['prototype'][_0xa609('0x6')]=function(_0x1c5977,_0x15c6de,_0x317946){var _0x31a510='\x0a',_0x409f8d=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x394cde=-0x1,_0x269447=-0x1,_0x29f23a='',_0x3b5da3=0x0,_0x40257e='',_0x3d702b='';this[_0xa609('0x4')]+=_0x1c5977['toString']();_0x40257e=this[_0xa609('0x4')];if(!this[_0xa609('0x7')]){_0x3b5da3=0x0;while(_0x409f8d[_0x3b5da3]){while((_0x269447=_0x40257e[_0xa609('0x8')](_0x409f8d[_0x3b5da3]))!=-0x1){_0x29f23a=_0x409f8d[_0x3b5da3];_0x3d702b=_0x40257e[_0xa609('0x9')](0x0,_0x269447);_0x40257e=_0x40257e['substring'](_0x269447+_0x29f23a[_0xa609('0xa')]);var _0x1cc0a5=_0x3d702b[_0xa609('0xb')](_0x31a510),_0xa7c9d3=0x0,_0x49e8df={},_0x2b8729='',_0x28312c='',_0x190509=-0x1;while(_0x1cc0a5[_0xa7c9d3]){_0x190509=_0x1cc0a5[_0xa7c9d3][_0xa609('0x8')](':');if(_0x190509!=-0x1){_0x2b8729=_0x1cc0a5[_0xa7c9d3][_0xa609('0xc')](0x0,_0x190509)[_0xa609('0xd')]();_0x28312c=_0x1cc0a5[_0xa7c9d3][_0xa609('0xc')](_0x190509+0x1)[_0xa609('0xd')]();if(_0x2b8729[_0xa609('0xa')]>0x0){_0x49e8df[_0x2b8729]=_0x28312c;}}else{}_0xa7c9d3++;}this[_0xa609('0xe')]('headers',_0x49e8df);this[_0xa609('0x7')]=!![];}_0x3b5da3++;}this[_0xa609('0x4')]=_0x40257e;}else{while((_0x394cde=_0x40257e[_0xa609('0x8')](_0x31a510))!=-0x1){_0x3d702b=_0x40257e[_0xa609('0x9')](0x0,_0x394cde);this[_0xa609('0xe')](_0xa609('0xf'),_0x3d702b);_0x40257e=_0x40257e[_0xa609('0x9')](_0x394cde+_0x31a510[_0xa609('0xa')]);}this[_0xa609('0x4')]=_0x40257e;}_0x317946();};module[_0xa609('0x10')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index af297db..35afb6a 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 _0xe186=['agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','moment','client','http','request','error','catch','getSquareProjects','GetSquareProjects','name','production','getSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','CloudProvider','email','getSquareProjectById','ShowSquareProject','ShowVoiceQueue','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','ShowUser','phone','getTrunkById','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Intervals','getSmsAccountById','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','then','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser'];(function(_0x1d0499,_0x23e22f){var _0x153fb3=function(_0x40c19c){while(--_0x40c19c){_0x1d0499['push'](_0x1d0499['shift']());}};_0x153fb3(++_0x23e22f);}(_0xe186,0x146));var _0x6e18=function(_0x312c71,_0x56e1c9){_0x312c71=_0x312c71-0x0;var _0x20990c=_0xe186[_0x312c71];return _0x20990c;};'use strict';var _=require(_0x6e18('0x0'));var moment=require(_0x6e18('0x1'));var jayson=require('jayson/promise');var client=jayson[_0x6e18('0x2')][_0x6e18('0x3')]({'port':0x2329});function request(_0xf8a6e3,_0xadd322){return new Promise(function(_0x2b6009,_0x4b7198){return client[_0x6e18('0x4')](_0xf8a6e3,_0xadd322)['then'](function(_0x29c23c){if(_0x29c23c[_0x6e18('0x5')]){return _0x4b7198(_0x29c23c[_0x6e18('0x5')]['message']);}else{return _0x2b6009(_0x29c23c['result']);}})[_0x6e18('0x6')](function(_0x508982){return _0x4b7198(_0x508982);});});}exports[_0x6e18('0x7')]=function(){return request(_0x6e18('0x8'),{'options':{'raw':![],'attributes':['id',_0x6e18('0x9'),_0x6e18('0xa')]}});};exports[_0x6e18('0xb')]=function(_0xfdb6dc){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0xfdb6dc},'attributes':[_0x6e18('0xa')]}});};exports[_0x6e18('0xc')]=function(_0x36bdcd){return request(_0x6e18('0xd'),{'options':{'raw':![],'where':{'id':_0x36bdcd},'include':[{'model':_0x6e18('0xe'),'as':'Smtp','include':[{'model':_0x6e18('0xf'),'as':'CloudProvider'}]}],'attributes':['id',_0x6e18('0x9'),_0x6e18('0x10')],'smtp':!![]}});};exports[_0x6e18('0x11')]=function(_0x37a1de){return request(_0x6e18('0x12'),{'options':{'where':{'id':_0x37a1de},'attributes':[_0x6e18('0x9')]}});};exports['getVoiceQueueById']=function(_0x795515){return request(_0x6e18('0x13'),{'options':{'where':{'id':_0x795515},'attributes':[_0x6e18('0x9')]}});};exports['getVariableById']=function(_0xef7033){return request(_0x6e18('0x14'),{'options':{'where':{'id':_0xef7033},'attributes':[_0x6e18('0x9')]}});};exports[_0x6e18('0x15')]=function(_0x430a28){return request(_0x6e18('0x16'),{'options':{'where':{'id':_0x430a28},'attributes':[_0x6e18('0x17')]}});};exports['getUserById']=function(_0x498542){return request(_0x6e18('0x18'),{'options':{'where':{'id':_0x498542},'attributes':['name']}});};exports['getContactByPhone']=function(_0x12ad28){return request('GetContactByPhone',{'options':{'where':{'phone':_0x12ad28[_0x6e18('0x19')]},'attributes':['id']}});};exports[_0x6e18('0x1a')]=function(_0x26fadf){return request('ShowTrunk',{'options':{'where':{'id':_0x26fadf},'attributes':['name']}});};exports[_0x6e18('0x1b')]=function(_0x2daf6c){return request(_0x6e18('0x1c'),{'options':{'where':{'id':_0x2daf6c},'attributes':[_0x6e18('0x1d')]}});};exports[_0x6e18('0x1e')]=function(_0x344bb8){return request(_0x6e18('0x1f'),{'options':{'raw':![],'where':{'id':_0x344bb8},'include':[{'model':'Interval','as':_0x6e18('0x20')}]}});};exports[_0x6e18('0x21')]=function(_0x5a3291){return request('ShowSmsAccount',{'options':{'where':{'id':_0x5a3291},'attributes':['id',_0x6e18('0x9')]}});};exports[_0x6e18('0x22')]=function(_0x24b3af){return request(_0x6e18('0x23'),{'body':_0x24b3af});};exports[_0x6e18('0x24')]=function(_0x1104f6){return request(_0x6e18('0x25'),{'body':_0x1104f6});};exports[_0x6e18('0x26')]=function(_0x39159e){return request(_0x6e18('0x27'),{'body':_[_0x6e18('0x28')](_0x39159e,{'project_name':_0x39159e[_0x6e18('0x29')],'prev_project_name':_0x39159e[_0x6e18('0x2a')]||'','is_subproject':_0x39159e[_0x6e18('0x2a')]?!![]:![],'leaveAt':moment()[_0x6e18('0x2b')](_0x6e18('0x2c'))})});};exports[_0x6e18('0x2d')]=function(_0x4a56b1){return request(_0x6e18('0x2e'),{'body':_0x4a56b1});};exports[_0x6e18('0x2f')]=function(_0x4dc894){return request(_0x6e18('0x30'),{'body':_0x4dc894});};exports[_0x6e18('0x31')]=function(_0x176ad5){return request(_0x6e18('0x32'),{'options':{'raw':![],'where':{'phone':_0x176ad5['phone'],'ListId':_0x176ad5[_0x6e18('0x33')]}}})[_0x6e18('0x34')](function(_0x189aa2){if(_0x189aa2){return _0x189aa2;}return request(_0x6e18('0x35'),{'body':_0x176ad5});});};exports[_0x6e18('0x36')]=function(_0x39279a){return request(_0x6e18('0x37'),{'options':{'where':{'id':_0x39279a},'attributes':[_0x6e18('0x9')]}});};exports[_0x6e18('0x38')]=function(_0x9acdc,_0x8bfa59){return request(_0x6e18('0x39'),{'body':{'interface':_0x8bfa59},'options':{'where':_0x9acdc}});};exports[_0x6e18('0x3a')]=function(_0x739a56,_0x301920,_0x2610b1){return request(_0x6e18('0x3b'),{'body':{'type':_0x301920,'uniqueid':_0x2610b1},'options':{'where':_0x739a56}});};exports[_0x6e18('0x3c')]=function(_0x916f68){return request(_0x6e18('0x3d'),{'body':{},'options':{'where':_0x916f68}});};exports[_0x6e18('0x3e')]=function(_0x415a93){return request(_0x6e18('0x3f'),{'body':{},'options':{'where':_0x415a93}});}; \ No newline at end of file +var _0xf3cd=['error','message','result','catch','getSquareProjects','production','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','name','email','getSquareProjectById','getVoiceQueueById','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById','ShowSound','Interval','Intervals','getSmsAccountById','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','createSquareRecording','CreateSquareMessage','ShowCmHopper','ListId','then','CreateCmContact','getPauseById','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','moment','jayson/promise','client','http','request'];(function(_0x289030,_0x3744b5){var _0x24ddc1=function(_0x354d77){while(--_0x354d77){_0x289030['push'](_0x289030['shift']());}};_0x24ddc1(++_0x3744b5);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x597eb2,_0x165f5c){_0x597eb2=_0x597eb2-0x0;var _0x56875f=_0xf3cd[_0x597eb2];return _0x56875f;};'use strict';var _=require(_0xdf3c('0x0'));var moment=require(_0xdf3c('0x1'));var jayson=require(_0xdf3c('0x2'));var client=jayson[_0xdf3c('0x3')][_0xdf3c('0x4')]({'port':0x2329});function request(_0x433a7f,_0x54db05){return new Promise(function(_0x401518,_0x71b446){return client[_0xdf3c('0x5')](_0x433a7f,_0x54db05)['then'](function(_0x111a2e){if(_0x111a2e[_0xdf3c('0x6')]){return _0x71b446(_0x111a2e[_0xdf3c('0x6')][_0xdf3c('0x7')]);}else{return _0x401518(_0x111a2e[_0xdf3c('0x8')]);}})[_0xdf3c('0x9')](function(_0x52c073){return _0x71b446(_0x52c073);});});}exports[_0xdf3c('0xa')]=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id','name',_0xdf3c('0xb')]}});};exports[_0xdf3c('0xc')]=function(_0x5ef936){return request(_0xdf3c('0xd'),{'options':{'raw':![],'where':{'name':_0x5ef936},'attributes':[_0xdf3c('0xb')]}});};exports[_0xdf3c('0xe')]=function(_0x21a6e5){return request(_0xdf3c('0xf'),{'options':{'raw':![],'where':{'id':_0x21a6e5},'include':[{'model':_0xdf3c('0x10'),'as':_0xdf3c('0x11'),'include':[{'model':_0xdf3c('0x12'),'as':'CloudProvider'}]}],'attributes':['id',_0xdf3c('0x13'),_0xdf3c('0x14')],'smtp':!![]}});};exports[_0xdf3c('0x15')]=function(_0x17319c){return request('ShowSquareProject',{'options':{'where':{'id':_0x17319c},'attributes':[_0xdf3c('0x13')]}});};exports[_0xdf3c('0x16')]=function(_0x13ea5f){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x13ea5f},'attributes':[_0xdf3c('0x13')]}});};exports[_0xdf3c('0x17')]=function(_0x173041){return request(_0xdf3c('0x18'),{'options':{'where':{'id':_0x173041},'attributes':[_0xdf3c('0x13')]}});};exports[_0xdf3c('0x19')]=function(_0x305ea5){return request(_0xdf3c('0x1a'),{'options':{'where':{'id':_0x305ea5},'attributes':[_0xdf3c('0x1b')]}});};exports[_0xdf3c('0x1c')]=function(_0x54cdd4){return request(_0xdf3c('0x1d'),{'options':{'where':{'id':_0x54cdd4},'attributes':[_0xdf3c('0x13')]}});};exports[_0xdf3c('0x1e')]=function(_0x18d4ec){return request(_0xdf3c('0x1f'),{'options':{'where':{'phone':_0x18d4ec[_0xdf3c('0x20')]},'attributes':['id']}});};exports[_0xdf3c('0x21')]=function(_0x3ee0af){return request(_0xdf3c('0x22'),{'options':{'where':{'id':_0x3ee0af},'attributes':[_0xdf3c('0x13')]}});};exports[_0xdf3c('0x23')]=function(_0x3d14cc){return request(_0xdf3c('0x24'),{'options':{'where':{'id':_0x3d14cc},'attributes':['save_name']}});};exports['getIntervalById']=function(_0x3aa254){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x3aa254},'include':[{'model':_0xdf3c('0x25'),'as':_0xdf3c('0x26')}]}});};exports[_0xdf3c('0x27')]=function(_0x38b319){return request(_0xdf3c('0x28'),{'options':{'where':{'id':_0x38b319},'attributes':['id',_0xdf3c('0x13')]}});};exports['createSmsMessage']=function(_0x22a164){return request(_0xdf3c('0x29'),{'body':_0x22a164});};exports[_0xdf3c('0x2a')]=function(_0x24754a){return request(_0xdf3c('0x2b'),{'body':_0x24754a});};exports[_0xdf3c('0x2c')]=function(_0xef54cb){return request(_0xdf3c('0x2d'),{'body':_[_0xdf3c('0x2e')](_0xef54cb,{'project_name':_0xef54cb[_0xdf3c('0x2f')],'prev_project_name':_0xef54cb['arg_2']||'','is_subproject':_0xef54cb[_0xdf3c('0x30')]?!![]:![],'leaveAt':moment()[_0xdf3c('0x31')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0xdf3c('0x32')]=function(_0x59659e){return request('CreateSquareRecording',{'body':_0x59659e});};exports['createSquareMessage']=function(_0x14aac9){return request(_0xdf3c('0x33'),{'body':_0x14aac9});};exports['createCmContact']=function(_0x5c3b5a){return request(_0xdf3c('0x34'),{'options':{'raw':![],'where':{'phone':_0x5c3b5a[_0xdf3c('0x20')],'ListId':_0x5c3b5a[_0xdf3c('0x35')]}}})[_0xdf3c('0x36')](function(_0x5c98a2){if(_0x5c98a2){return _0x5c98a2;}return request(_0xdf3c('0x37'),{'body':_0x5c3b5a});});};exports[_0xdf3c('0x38')]=function(_0x5386bf){return request('ShowPause',{'options':{'where':{'id':_0x5386bf},'attributes':[_0xdf3c('0x13')]}});};exports[_0xdf3c('0x39')]=function(_0x36937e,_0x540f3a){return request(_0xdf3c('0x3a'),{'body':{'interface':_0x540f3a},'options':{'where':_0x36937e}});};exports[_0xdf3c('0x3b')]=function(_0x21e7b8,_0x10099e,_0x575ae1){return request(_0xdf3c('0x3c'),{'body':{'type':_0x10099e,'uniqueid':_0x575ae1},'options':{'where':_0x21e7b8}});};exports[_0xdf3c('0x3d')]=function(_0x522e5f){return request(_0xdf3c('0x3e'),{'body':{},'options':{'where':_0x522e5f}});};exports[_0xdf3c('0x3f')]=function(_0x217a65){return request(_0xdf3c('0x40'),{'body':{},'options':{'where':_0x217a65}});}; \ 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 d5af239..5729680 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 _0x4d49=['./lex'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x4d49,0x141));var _0x94d4=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x4d49[_0x3947c9];return _0x2e7871;};var polly=require('./polly');var lex=require(_0x94d4('0x0'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x1574=['exports','./polly','./lex'];(function(_0x5d63ec,_0x18894d){var _0xc025b7=function(_0x39b494){while(--_0x39b494){_0x5d63ec['push'](_0x5d63ec['shift']());}};_0xc025b7(++_0x18894d);}(_0x1574,0x148));var _0x4157=function(_0x423e02,_0x1168e0){_0x423e02=_0x423e02-0x0;var _0x3f18fa=_0x1574[_0x423e02];return _0x3f18fa;};var polly=require(_0x4157('0x0'));var lex=require(_0x4157('0x1'));module[_0x4157('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 e255316..fe52276 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 _0x91a7=['exports'];(function(_0x3897ed,_0x19d57f){var _0x4f738f=function(_0x1244f0){while(--_0x1244f0){_0x3897ed['push'](_0x3897ed['shift']());}};_0x4f738f(++_0x19d57f);}(_0x91a7,0xe7));var _0x791a=function(_0x1c1ba1,_0x381530){_0x1c1ba1=_0x1c1ba1-0x0;var _0x168935=_0x91a7[_0x1c1ba1];return _0x168935;};'use strict';var lex=require('./lib/api');module[_0x791a('0x0')]=function(_0x3d6eab,_0x268862,_0x5d2796,_0x415994,_0x5b6f78,_0x2f6392){return lex(_0x3d6eab,_0x268862,_0x5d2796,_0x415994,_0x5b6f78,_0x2f6392);}; \ No newline at end of file +var _0x9354=['exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9354,0x96));var _0x4935=function(_0x4cf0b7,_0x560029){_0x4cf0b7=_0x4cf0b7-0x0;var _0x545f10=_0x9354[_0x4cf0b7];return _0x545f10;};'use strict';var lex=require('./lib/api');module[_0x4935('0x0')]=function(_0xc3c1f3,_0x4896da,_0x263dd5,_0x2a4993,_0x29d1eb,_0x280bbc){return lex(_0xc3c1f3,_0x4896da,_0x263dd5,_0x2a4993,_0x29d1eb,_0x280bbc);}; \ 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 0135ec8..1410303 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(_0x39b2cd,_0x388098){var _0x2e9a0e=function(_0x1ce84a){while(--_0x1ce84a){_0x39b2cd['push'](_0x39b2cd['shift']());}};_0x2e9a0e(++_0x388098);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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(_0x1b9721,_0x14bca5){var _0x288bb1=function(_0x1fa311){while(--_0x1fa311){_0x1b9721['push'](_0x1b9721['shift']());}};_0x288bb1(++_0x14bca5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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 78e7d76..418da98 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 _0xcb2d=['exports'];(function(_0x10852d,_0x4cdcc6){var _0x13a8d6=function(_0x2ece16){while(--_0x2ece16){_0x10852d['push'](_0x10852d['shift']());}};_0x13a8d6(++_0x4cdcc6);}(_0xcb2d,0x174));var _0xdcb2=function(_0x59654e,_0x4369f7){_0x59654e=_0x59654e-0x0;var _0x5958cc=_0xcb2d[_0x59654e];return _0x5958cc;};'use strict';var polly=require('./lib/api');module[_0xdcb2('0x0')]=function(_0x3b0187,_0x59741d,_0x2aa919,_0x253a21,_0xe36d37,_0xaf04e1,_0x3e1171){return polly(_0x3b0187,_0x59741d,_0x2aa919,_0x253a21,_0xe36d37,_0xaf04e1,_0x3e1171);}; \ No newline at end of file +var _0xe134=['./lib/api','exports'];(function(_0x10b317,_0x2adf32){var _0x1e3054=function(_0x38ed3e){while(--_0x38ed3e){_0x10b317['push'](_0x10b317['shift']());}};_0x1e3054(++_0x2adf32);}(_0xe134,0x1c8));var _0x4e13=function(_0x489109,_0x5a7020){_0x489109=_0x489109-0x0;var _0x22e079=_0xe134[_0x489109];return _0x22e079;};'use strict';var polly=require(_0x4e13('0x0'));module[_0x4e13('0x1')]=function(_0xe84c09,_0x77bdac,_0x3babce,_0x5b161b,_0x5f4d00,_0x5a3565,_0x58a6fa){return polly(_0xe84c09,_0x77bdac,_0x3babce,_0x5b161b,_0x5f4d00,_0x5a3565,_0x58a6fa);}; \ 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 77627e7..07d7fd4 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 _0x729f=['synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','randomstring'];(function(_0x950278,_0x203762){var _0x3a016d=function(_0x2f0dcf){while(--_0x2f0dcf){_0x950278['push'](_0x950278['shift']());}};_0x3a016d(++_0x203762);}(_0x729f,0x77));var _0xf729=function(_0x36ccd0,_0x4d6767){_0x36ccd0=_0x36ccd0-0x0;var _0xf50b90=_0x729f[_0x36ccd0];return _0xf50b90;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require('bluebird');var rs=require(_0xf729('0x0'));var AWS=require('aws-sdk');function pollyResult(_0x2e7f1c,_0x27d96f,_0x192006){return new BPromise(function(_0x52a563,_0x361b27){_0x2e7f1c[_0xf729('0x1')](_0x27d96f,function(_0xeb3e27,_0x208f49){if(_0xeb3e27){_0x361b27(_0xeb3e27);}else if(_0x208f49){if(_0x208f49[_0xf729('0x2')]instanceof Buffer){fs[_0xf729('0x3')](_0x192006,_0x208f49[_0xf729('0x2')],function(_0x548012){if(_0x548012){_0x361b27(_0x548012);}else{_0x52a563();}});}else{_0x361b27(new Error(_0xf729('0x4')));}}else{_0x361b27(new Error(_0xf729('0x5')));}});});}module[_0xf729('0x6')]=function(_0x5a60f9,_0x5ca8e5,_0x46abb4,_0x43bf4d,_0x4ba9c8,_0x41e4b0,_0x1381a3){var _0x4ed0d8=new AWS[(_0xf729('0x7'))]({'accessKeyId':_0x5a60f9,'secretAccessKey':_0x5ca8e5,'region':_0x46abb4});var _0x57f33c={'Text':_0x4ba9c8,'TextType':_0x41e4b0||_0xf729('0x8'),'OutputFormat':_0xf729('0x9'),'VoiceId':_0x43bf4d};return pollyResult(_0x4ed0d8,_0x57f33c,_0x1381a3);}; \ No newline at end of file +var _0x6ecc=['Polly','text','path','aws-sdk','synthesizeSpeech','writeFile','AudioStream','No\x20data\x20response\x20from\x20aws\x20Polly!','exports'];(function(_0x4b505a,_0x1bffc6){var _0x4a09f7=function(_0x56215a){while(--_0x56215a){_0x4b505a['push'](_0x4b505a['shift']());}};_0x4a09f7(++_0x1bffc6);}(_0x6ecc,0x1cd));var _0xc6ec=function(_0x4f139c,_0x818247){_0x4f139c=_0x4f139c-0x0;var _0x551ad3=_0x6ecc[_0x4f139c];return _0x551ad3;};'use strict';var fs=require('fs');var path=require(_0xc6ec('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var AWS=require(_0xc6ec('0x1'));function pollyResult(_0x3189f8,_0xed95fe,_0x4ae52e){return new BPromise(function(_0x54c481,_0x130aaf){_0x3189f8[_0xc6ec('0x2')](_0xed95fe,function(_0x2af818,_0x1d1c10){if(_0x2af818){_0x130aaf(_0x2af818);}else if(_0x1d1c10){if(_0x1d1c10['AudioStream']instanceof Buffer){fs[_0xc6ec('0x3')](_0x4ae52e,_0x1d1c10[_0xc6ec('0x4')],function(_0x23a35c){if(_0x23a35c){_0x130aaf(_0x23a35c);}else{_0x54c481();}});}else{_0x130aaf(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x130aaf(new Error(_0xc6ec('0x5')));}});});}module[_0xc6ec('0x6')]=function(_0xb6061c,_0x91103,_0x1c3006,_0x22cdfc,_0x42ea64,_0x58fdcf,_0x25572a){var _0xcce580=new AWS[(_0xc6ec('0x7'))]({'accessKeyId':_0xb6061c,'secretAccessKey':_0x91103,'region':_0x1c3006});var _0x26c489={'Text':_0x42ea64,'TextType':_0x58fdcf||_0xc6ec('0x8'),'OutputFormat':'mp3','VoiceId':_0x22cdfc};return pollyResult(_0xcce580,_0x26c489,_0x25572a);}; \ 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 c6d2372..6cf73ba 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 _0xa1b6=['./lib/api'];(function(_0x35dcca,_0x14e01d){var _0x4d843c=function(_0x535477){while(--_0x535477){_0x35dcca['push'](_0x35dcca['shift']());}};_0x4d843c(++_0x14e01d);}(_0xa1b6,0x16a));var _0x6a1b=function(_0x155eb5,_0x4eb613){_0x155eb5=_0x155eb5-0x0;var _0x43c254=_0xa1b6[_0x155eb5];return _0x43c254;};'use strict';var asr=require(_0x6a1b('0x0'));module['exports']=function(_0x2f0a01,_0x581d76,_0x25ec6e,_0x350196){return asr(_0x2f0a01,_0x581d76,_0x25ec6e);}; \ No newline at end of file +var _0x23ce=['exports','./lib/api'];(function(_0x189a8e,_0x8facae){var _0x37fb00=function(_0x42860b){while(--_0x42860b){_0x189a8e['push'](_0x189a8e['shift']());}};_0x37fb00(++_0x8facae);}(_0x23ce,0x1af));var _0xe23c=function(_0x4b14b8,_0x559743){_0x4b14b8=_0x4b14b8-0x0;var _0x578f75=_0x23ce[_0x4b14b8];return _0x578f75;};'use strict';var asr=require(_0xe23c('0x0'));module[_0xe23c('0x1')]=function(_0x3d4324,_0x1db2d6,_0x2c8242,_0x1f5858){return asr(_0x3d4324,_0x1db2d6,_0x2c8242);}; \ 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 5d0fced..71239e6 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 _0x44a3=['toString','base64','POST','/v1/speech:recognize?key=','8000','url','bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync'];(function(_0x2a0942,_0x3cfa76){var _0x3b1f7c=function(_0x5d6c30){while(--_0x5d6c30){_0x2a0942['push'](_0x2a0942['shift']());}};_0x3b1f7c(++_0x3cfa76);}(_0x44a3,0x1a9));var _0x344a=function(_0x5bff9e,_0x39ea3a){_0x5bff9e=_0x5bff9e-0x0;var _0x7f42ef=_0x44a3[_0x5bff9e];return _0x7f42ef;};'use strict';var url=require(_0x344a('0x0'));var BPromise=require(_0x344a('0x1'));var fs=require('fs');var host=_0x344a('0x2');module[_0x344a('0x3')]=function(_0xdffe0b,_0x42b3a6,_0x3bb844){return new BPromise(function(_0x212a39,_0x528a13){var _0x23004c;if(typeof _0xdffe0b!==_0x344a('0x4')||_0xdffe0b[_0x344a('0x5')]===0x0){return _0x528a13(_0x344a('0x6'));}if(typeof _0x42b3a6!==_0x344a('0x4')||_0x42b3a6['length']===0x0){return _0x528a13('key\x20should\x20be\x20a\x20string');}if(typeof _0x3bb844!=='undefined'&&(typeof _0x3bb844!=='string'||_0x3bb844[_0x344a('0x5')]===0x0)){return _0x528a13(_0x344a('0x7'));}try{_0x23004c=fs[_0x344a('0x8')](_0xdffe0b)[_0x344a('0x9')](_0x344a('0xa'));}catch(_0x54288d){return _0x528a13(_0x54288d);}return _0x212a39({'method':_0x344a('0xb'),'uri':host+_0x344a('0xc')+_0x42b3a6,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0x344a('0xd'),'languageCode':_0x3bb844},'audio':{'content':_0x23004c}},'json':!![]});});}; \ No newline at end of file +var _0xee5b=['filepath\x20should\x20be\x20a\x20string','string','readFileSync','toString','base64','/v1/speech:recognize?key=','LINEAR16','8000','url','https://speech.googleapis.com','exports','length'];(function(_0x3d8e8b,_0x4bd612){var _0x11a2a9=function(_0x537a06){while(--_0x537a06){_0x3d8e8b['push'](_0x3d8e8b['shift']());}};_0x11a2a9(++_0x4bd612);}(_0xee5b,0x1f4));var _0xbee5=function(_0x50ffdb,_0x373a7b){_0x50ffdb=_0x50ffdb-0x0;var _0x5cc0e2=_0xee5b[_0x50ffdb];return _0x5cc0e2;};'use strict';var url=require(_0xbee5('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0xbee5('0x1');module[_0xbee5('0x2')]=function(_0x4f850a,_0x1893e4,_0x2b93c2){return new BPromise(function(_0x2eb857,_0x210159){var _0x4bd202;if(typeof _0x4f850a!=='string'||_0x4f850a[_0xbee5('0x3')]===0x0){return _0x210159(_0xbee5('0x4'));}if(typeof _0x1893e4!==_0xbee5('0x5')||_0x1893e4[_0xbee5('0x3')]===0x0){return _0x210159('key\x20should\x20be\x20a\x20string');}if(typeof _0x2b93c2!=='undefined'&&(typeof _0x2b93c2!=='string'||_0x2b93c2['length']===0x0)){return _0x210159('lang\x20should\x20be\x20a\x20string');}try{_0x4bd202=fs[_0xbee5('0x6')](_0x4f850a)[_0xbee5('0x7')](_0xbee5('0x8'));}catch(_0x20f717){return _0x210159(_0x20f717);}return _0x2eb857({'method':'POST','uri':host+_0xbee5('0x9')+_0x1893e4,'body':{'config':{'encoding':_0xbee5('0xa'),'sampleRateHertz':_0xbee5('0xb'),'languageCode':_0x2b93c2},'audio':{'content':_0x4bd202}},'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 10cb4be..d9998a8 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 asr=require('./asr');module['exports']={'asr':asr}; \ No newline at end of file +var _0xe6df=['exports','./asr'];(function(_0x373dc6,_0x5c62cc){var _0x2931cc=function(_0x3711db){while(--_0x3711db){_0x373dc6['push'](_0x373dc6['shift']());}};_0x2931cc(++_0x5c62cc);}(_0xe6df,0x151));var _0xfe6d=function(_0x228629,_0x375950){_0x228629=_0x228629-0x0;var _0x593cb8=_0xe6df[_0x228629];return _0x593cb8;};var asr=require(_0xfe6d('0x0'));module[_0xfe6d('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 7936b46..a60920e 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 _0x3e39=['queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','sestekNDA','nda','text','channelData','CustomActionData','AudioFromTts','Data','dirName','apiai-promise','bluebird','http','https','md5','path','querystring','randomstring','sox','google-tts-api','url','parse','util','./aws','./sestek','./tilde','../../../config/logger','https://api.ispeech.org/api/rest','protocol','https:','WHAT_EVER','get','request\x20to\x20','statusCode','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','error','unlink','download\x20error','pipe','host','\x20failed,\x20status\x20code\x20=\x20','data','end','transcode','wav','error\x20convert','finish\x20to\x20convert','resolve','tmp','generate','.wav','writeFileSync','base64','then','chmodSync','readFileSync','googleCloudTTS','https://texttospeech.googleapis.com/v1/','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','.mp3','from','audioContent','777','googleCloudTTS\x20path','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','application/x-www-form-urlencoded','f.req=','stringify','null','generic','slice','parse\x20response\x20failed:\x0a','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','asr','uri','results','alternatives','transcript','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','result','source','actionIncomplete','speech','score','status','code','metadata','isFallbackIntent','googleDialogflowV2','sessionPath','length','Dialogflow\x20V2\x20response:','action'];(function(_0x3d93d5,_0x272b2e){var _0x363846=function(_0x2ba598){while(--_0x2ba598){_0x3d93d5['push'](_0x3d93d5['shift']());}};_0x363846(++_0x272b2e);}(_0x3e39,0xab));var _0x93e3=function(_0x34b2b5,_0x1f4799){_0x34b2b5=_0x34b2b5-0x0;var _0x263deb=_0x3e39[_0x34b2b5];return _0x263deb;};'use strict';var apiai=require(_0x93e3('0x0'));var BPromise=require(_0x93e3('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0x93e3('0x2'));var https=require(_0x93e3('0x3'));var md5=require(_0x93e3('0x4'));var path=require(_0x93e3('0x5'));var querystring=require(_0x93e3('0x6'));var rp=require('request-promise');var rs=require(_0x93e3('0x7'));var sox=require(_0x93e3('0x8'));var tts=require(_0x93e3('0x9'));var urlParse=require(_0x93e3('0xa'))[_0x93e3('0xb')];var util=require(_0x93e3('0xc'));var aws=require(_0x93e3('0xd'));var google=require('./google');var sestek=require(_0x93e3('0xe'));var tilde=require(_0x93e3('0xf'));var logger=require(_0x93e3('0x10'))('agi');var ISPEECH_API=_0x93e3('0x11');function downloadFile(_0x2d0ddc,_0x109216){return new BPromise(function(_0x4e4d3f,_0xd1a304){var _0x38cb5b=urlParse(_0x2d0ddc);var _0x45b5dc=_0x38cb5b[_0x93e3('0x12')]===_0x93e3('0x13')?https:http;var _0x3ea686={'host':_0x38cb5b['host'],'path':_0x38cb5b[_0x93e3('0x5')],'headers':{'user-agent':_0x93e3('0x14')}};_0x45b5dc[_0x93e3('0x15')](_0x3ea686,function(_0x1088d6){if(_0x1088d6['statusCode']!==0xc8){logger['error'](_0x93e3('0x16')+_0x2d0ddc+'\x20failed,\x20status\x20code\x20=\x20'+_0x1088d6[_0x93e3('0x17')]+'\x20('+_0x1088d6[_0x93e3('0x18')]+')');_0xd1a304(new Error('request\x20to\x20'+_0x2d0ddc+'\x20failed,\x20status\x20code\x20=\x20'+_0x1088d6[_0x93e3('0x17')]+'\x20('+_0x1088d6[_0x93e3('0x18')]+')'));return;}var _0x45671d=fs[_0x93e3('0x19')](_0x109216);_0x45671d['on'](_0x93e3('0x1a'),function(){logger[_0x93e3('0x1b')](_0x93e3('0x1c'));_0x45671d[_0x93e3('0x1d')](_0x4e4d3f);});_0x45671d['on'](_0x93e3('0x1e'),function(_0x4dd72f){fs[_0x93e3('0x1f')](_0x109216);logger[_0x93e3('0x1e')](_0x93e3('0x20'),_0x4dd72f);_0xd1a304(_0x4dd72f);});_0x1088d6[_0x93e3('0x21')](_0x45671d);})['on'](_0x93e3('0x1e'),function(_0x24c99c){logger['error'](_0x24c99c);_0xd1a304(_0x24c99c);})['end']();});}function uploadFile(_0x4717ce){return new BPromise(function(_0x418939,_0xd990d7){var _0x249735=urlParse(_0x4717ce);var _0x1f42b1=_0x249735[_0x93e3('0x12')]===_0x93e3('0x13')?https:http;var _0x12d65a={'host':_0x249735[_0x93e3('0x22')],'path':_0x249735[_0x93e3('0x5')],'headers':{'user-agent':_0x93e3('0x14')}};_0x1f42b1['get'](_0x12d65a,function(_0x177e37){if(_0x177e37[_0x93e3('0x17')]!==0xc8){_0xd990d7(new Error(_0x93e3('0x16')+_0x4717ce+_0x93e3('0x23')+_0x177e37[_0x93e3('0x17')]+'\x20('+_0x177e37[_0x93e3('0x18')]+')'));return;}var _0x3da6b6='';_0x177e37['on'](_0x93e3('0x24'),function(_0x43de39){_0x3da6b6+=_0x43de39;});_0x177e37['on'](_0x93e3('0x25'),function(){_0x418939(_0x3da6b6);});})['on']('error',function(_0x5dfee5){_0xd990d7(_0x5dfee5);})[_0x93e3('0x25')]();});}function convertFile(_0x1867a1,_0x25be8a){return new BPromise(function(_0x4a3e97,_0x3c2a76){var _0x1b4c44=sox[_0x93e3('0x26')](_0x1867a1,_0x25be8a,{'sampleRate':0x1f40,'format':_0x93e3('0x27'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1b4c44['on'](_0x93e3('0x1e'),function(_0x503350){logger[_0x93e3('0x1e')](_0x93e3('0x28'),_0x503350);_0x3c2a76(_0x503350);});_0x1b4c44['on'](_0x93e3('0x25'),function(){logger[_0x93e3('0x1b')](_0x93e3('0x29'));_0x4a3e97();});_0x1b4c44['start']();});}function base64Decode(_0x35dc54,_0x2b8c15){var _0x1b86d0=path[_0x93e3('0x2a')](__dirname,_0x93e3('0x2b'),rs[_0x93e3('0x2c')](0x4)+_0x93e3('0x2d'));fs[_0x93e3('0x2e')](_0x1b86d0,_0x35dc54,_0x93e3('0x2f'));return convertFile(_0x1b86d0,_0x2b8c15)[_0x93e3('0x30')](function(){try{fs[_0x93e3('0x1f')](_0x1b86d0);fs[_0x93e3('0x31')](_0x2b8c15,'777');}catch(_0x497a42){logger['error'](_0x497a42);}return _0x2b8c15['split']('.')[0x0];});}function base64Encode(_0x5a2f46){var _0xc4181b=fs[_0x93e3('0x32')](_0x5a2f46);return new Buffer(_0xc4181b)['toString'](_0x93e3('0x2f'));}exports[_0x93e3('0x33')]=function(_0x5a25bc,_0x4ef0e3,_0x1296de,_0x3a8804,_0x45e381,_0x30144d){var _0x44680e,_0xbaf618;var _0x4890e6=_0x93e3('0x34');var _0x28aa55='?key='+_0x5a25bc;var _0x526808={};if(_0x4ef0e3===_0x93e3('0x35')){_0x526808[_0x93e3('0x36')]={'ssml':_0x1296de};}else{_0x526808['input']={'text':_0x1296de};};_0x526808[_0x93e3('0x37')]={'languageCode':_0x3a8804,'ssmlGender':_0x45e381};_0x526808[_0x93e3('0x38')]={'audioEncoding':_0x93e3('0x39'),'sampleRateHertz':0x1f40};var _0x17091e={'url':_0x4890e6+_0x93e3('0x3a')+_0x28aa55,'method':_0x93e3('0x3b'),'json':!![],'body':_0x526808};return rp(_0x17091e)[_0x93e3('0x30')](function(_0xcf12c7){return new BPromise(function(_0x5a3952,_0x16c322){_0x44680e=path['resolve'](__dirname,'tmp',rs[_0x93e3('0x2c')](0x4)+_0x93e3('0x3c'));var _0x51aac7=Buffer[_0x93e3('0x3d')](_0xcf12c7[_0x93e3('0x3e')],_0x93e3('0x2f'));return fs['writeFile'](_0x44680e,_0x51aac7,function(_0x3cdc65){_0x16c322(_0x3cdc65);},function(_0x54ddf1){fs[_0x93e3('0x31')](_0x44680e,'777');_0x5a3952(_0x54ddf1);});});})['then'](function(_0x406ecb){_0xbaf618=path[_0x93e3('0x2a')](__dirname,_0x93e3('0x2b'),rs[_0x93e3('0x2c')](0x4)+_0x93e3('0x2d'));return convertFile(_0x44680e,_0xbaf618);})[_0x93e3('0x30')](function(){try{fs[_0x93e3('0x1f')](_0x44680e);fs[_0x93e3('0x31')](_0xbaf618,_0x93e3('0x3f'));}catch(_0x1fb7b0){logger[_0x93e3('0x1e')](_0x1fb7b0);}logger[_0x93e3('0x1b')](_0x93e3('0x40'),_0xbaf618[_0x93e3('0x41')]('.')[0x0]);return _0xbaf618[_0x93e3('0x41')]('.')[0x0];});};exports[_0x93e3('0x42')]=function(_0x1ac635,_0x158945){var _0x3c93b2=_0x93e3('0x43');var _0x152bc1,_0x4e89b5;var _0x3778bf;var _0x18f793={'encoding':'utf8','method':'POST','timeout':0x2710,'url':_0x3c93b2,'headers':{'Content-Type':_0x93e3('0x44')},'body':_0x93e3('0x45')+encodeURIComponent(JSON['stringify']([[['jQ1olc',JSON[_0x93e3('0x46')]([_0x1ac635,_0x158945||'en',![],_0x93e3('0x47')]),null,_0x93e3('0x48')]]]))};return rp(_0x18f793)[_0x93e3('0x30')](function(_0x2b62be){try{_0x3778bf=eval(_0x2b62be[_0x93e3('0x49')](0x5))[0x0][0x2];}catch(_0x571d9f){throw new Error(_0x93e3('0x4a')+_0x2b62be[_0x93e3('0x24')]);}if(!_0x3778bf){if(_0x1ac635['length']>0xc8){throw new Error(_0x93e3('0x4b'));}else{throw new Error(_0x93e3('0x4c')+_0x158945+_0x93e3('0x4d'));}}try{_0x3778bf=eval(_0x3778bf)[0x0];}catch(_0x17a998){throw new Error(_0x93e3('0x4a')+res[_0x93e3('0x24')]);}const _0x4ecfbc=_0x3778bf;_0x152bc1=path[_0x93e3('0x2a')](__dirname,_0x93e3('0x2b'),rs[_0x93e3('0x2c')](0x4)+_0x93e3('0x3c'));fs[_0x93e3('0x2e')](_0x152bc1,_0x3778bf,{'encoding':_0x93e3('0x2f')});_0x4e89b5=path[_0x93e3('0x2a')](__dirname,_0x93e3('0x2b'),rs['generate'](0x4)+'.wav');return convertFile(_0x152bc1,_0x4e89b5);})['then'](function(){try{fs['unlink'](_0x152bc1);fs['chmodSync'](_0x4e89b5,'777');}catch(_0x1eb0ac){logger[_0x93e3('0x1e')](_0x1eb0ac);}logger[_0x93e3('0x1b')](_0x93e3('0x4e'),_0x4e89b5[_0x93e3('0x41')]('.')[0x0]);return _0x4e89b5['split']('.')[0x0];});};exports[_0x93e3('0x4f')]=function(_0x3e5d07,_0x4c2b90,_0x1dd72e){return google[_0x93e3('0x50')](_0x3e5d07,_0x4c2b90,_0x1dd72e)[_0x93e3('0x30')](function(_0x2c0b44){logger[_0x93e3('0x1b')](_0x2c0b44[_0x93e3('0x51')]);return rp(_0x2c0b44);})[_0x93e3('0x30')](function(_0x4268da){var _0x4d5bdc='';var _0x377578=0x0;try{fs[_0x93e3('0x1f')](_0x3e5d07);}catch(_0x1faf92){logger[_0x93e3('0x1e')](_0x1faf92);}if(_0x4268da&&_0x4268da[_0x93e3('0x52')]){_0x4d5bdc=_0x4268da['results']['map'](function(_0x2bde58){return _0x2bde58&&_0x2bde58[_0x93e3('0x53')][0x0]&&_0x2bde58[_0x93e3('0x53')][0x0]['transcript']?_0x2bde58[_0x93e3('0x53')][0x0][_0x93e3('0x54')]:'';})['join']('\x0a');_0x377578=_0x4268da[_0x93e3('0x52')]['map'](function(_0x56f134){return _0x56f134&&_0x56f134[_0x93e3('0x53')][0x0]&&_0x56f134['alternatives'][0x0]['confidence']?_0x56f134[_0x93e3('0x53')][0x0][_0x93e3('0x55')]:0x0;})['join']('\x0a');}logger['info'](_0x93e3('0x56'),_0x4d5bdc);logger[_0x93e3('0x1b')](_0x93e3('0x57'),_0x377578);return{'transcript':_0x4d5bdc,'confidence':_0x377578};})[_0x93e3('0x58')](function(_0x3c0a00){logger['error'](_0x93e3('0x59'),_0x3c0a00[_0x93e3('0x17')],_0x3c0a00[_0x93e3('0x5a')],_0x3c0a00[_0x93e3('0x5b')]);});};exports[_0x93e3('0x5c')]=function(_0x3a00a4,_0x1dab79,_0x269d87,_0x86ab6d){var _0x4952b3=apiai(_0x1dab79,{'language':_0x86ab6d||'en'});return _0x4952b3['textRequest'](_0x269d87,{'sessionId':md5(_0x3a00a4)})[_0x93e3('0x30')](function(_0x174707){logger[_0x93e3('0x1b')](JSON[_0x93e3('0x46')](_0x174707));return{'source':_0x174707[_0x93e3('0x5d')][_0x93e3('0x5e')],'resolvedQuery':_0x174707[_0x93e3('0x5d')]['resolvedQuery'],'action':_0x174707['result']['action'],'actionIncomplete':_0x174707[_0x93e3('0x5d')][_0x93e3('0x5f')],'speech':_0x174707[_0x93e3('0x5d')]['fulfillment'][_0x93e3('0x60')],'score':_0x174707[_0x93e3('0x5d')][_0x93e3('0x61')],'statusCode':_0x174707[_0x93e3('0x62')][_0x93e3('0x63')],'endConversation':_0x174707[_0x93e3('0x5d')]['metadata']['endConversation']||![],'isFallbackIntent':_0x174707[_0x93e3('0x5d')][_0x93e3('0x64')][_0x93e3('0x65')]};});};exports[_0x93e3('0x66')]=function(_0x3194a,_0x2d4052,_0x52b073,_0x82b7a1,_0x503e0d,_0x2eeecf){var _0x353125=_0x82b7a1['replace'](/\\n/g,'\x0a');var _0x36aac5={'credentials':{'private_key':_0x353125,'client_email':_0x52b073}};var _0xe39928=new dialogflow['SessionsClient'](_0x36aac5);var _0xd4369e=_0xe39928[_0x93e3('0x67')](_0x2d4052,md5(_0x3194a));var _0x50ef69={'session':_0xd4369e,'queryInput':{'text':{'text':_0x503e0d,'languageCode':_0x2eeecf}}};return _0xe39928['detectIntent'](_0x50ef69)[_0x93e3('0x30')](function(_0x122062){if(_0x122062&&_0x122062[_0x93e3('0x68')]){logger[_0x93e3('0x1b')](_0x93e3('0x69'),JSON[_0x93e3('0x46')](_0x122062));var _0x41102f=_0x122062[0x0];if(_0x41102f){var _0xf5f650={'action':_0x41102f['queryResult'][_0x93e3('0x6a')],'allRequiredParamsPresent':_0x41102f[_0x93e3('0x6b')][_0x93e3('0x6c')],'endConversation':_0x41102f[_0x93e3('0x6b')][_0x93e3('0x6d')]&&_0x41102f[_0x93e3('0x6b')][_0x93e3('0x6d')][_0x93e3('0x6e')]?_0x41102f[_0x93e3('0x6b')][_0x93e3('0x6d')]['fields'][_0x93e3('0x6f')][_0x93e3('0x70')]:![],'fulfillmentText':_0x41102f[_0x93e3('0x6b')][_0x93e3('0x71')],'intentName':_0x41102f[_0x93e3('0x6b')][_0x93e3('0x72')][_0x93e3('0x5a')],'intentDisplayName':_0x41102f[_0x93e3('0x6b')][_0x93e3('0x72')][_0x93e3('0x73')],'isFallbackIntent':_0x41102f[_0x93e3('0x6b')][_0x93e3('0x72')][_0x93e3('0x74')],'languageCode':_0x41102f[_0x93e3('0x6b')][_0x93e3('0x75')],'queryText':_0x41102f['queryResult'][_0x93e3('0x76')],'responseId':_0x41102f[_0x93e3('0x77')],'score':_0x41102f[_0x93e3('0x6b')][_0x93e3('0x78')],'speech':_0x41102f[_0x93e3('0x6b')][_0x93e3('0x71')],'providerResponse':JSON[_0x93e3('0x46')](_0x122062)};return _0xf5f650;}}});};exports[_0x93e3('0x79')]=function(_0x4a3336,_0x533809,_0x15a12a,_0x453b9a){return tilde[_0x93e3('0x50')](_0x4a3336,_0x533809,_0x15a12a,_0x453b9a)[_0x93e3('0x30')](function(_0x15ae0b){try{fs[_0x93e3('0x1f')](_0x4a3336);}catch(_0x28528b){logger[_0x93e3('0x1e')](_0x28528b);}logger[_0x93e3('0x1b')](_0x93e3('0x7a'),_0x15ae0b[_0x93e3('0x54')]);logger[_0x93e3('0x1b')](_0x93e3('0x7b'),_0x15ae0b[_0x93e3('0x55')]);return _0x15ae0b;});};exports[_0x93e3('0x7c')]=function(_0x19eee3,_0x48aaf9,_0x530532,_0x45adbe,_0x3f8ecc,_0x1e39d1){var _0x35131e=path['resolve'](__dirname,_0x93e3('0x2b'),rs['generate'](0x4)+_0x93e3('0x3c'));var _0x84d801;return aws['polly'](_0x19eee3,_0x48aaf9,_0x530532,_0x45adbe,_0x3f8ecc,_0x1e39d1,_0x35131e)[_0x93e3('0x30')](function(){_0x84d801=path[_0x93e3('0x2a')](__dirname,_0x93e3('0x2b'),rs[_0x93e3('0x2c')](0x4)+_0x93e3('0x2d'));return convertFile(_0x35131e,_0x84d801);})[_0x93e3('0x30')](function(){try{fs[_0x93e3('0x1f')](_0x35131e);fs[_0x93e3('0x31')](_0x84d801,_0x93e3('0x3f'));}catch(_0x51304b){logger[_0x93e3('0x1e')](_0x51304b);}return _0x84d801[_0x93e3('0x41')]('.')[0x0];});};exports['awsLex']=function(_0x27573d,_0x3f75b6,_0x3750bf,_0x4a8687,_0x978231,_0x13ab64){return aws[_0x93e3('0x7d')](_0x27573d,_0x3f75b6,_0x3750bf,_0x4a8687,_0x978231,_0x13ab64)[_0x93e3('0x30')](function(_0x42c098){logger[_0x93e3('0x1b')](JSON[_0x93e3('0x46')](_0x42c098));return _0x42c098;});};exports[_0x93e3('0x7e')]=function(_0x30e253,_0x239b52,_0x37258e,_0x5ec540){var _0x372e94=util[_0x93e3('0x7f')](_0x93e3('0x80'),ISPEECH_API,_0x30e253,encodeURIComponent(_0x239b52),_0x37258e,_0x5ec540);var _0xddac2b=path[_0x93e3('0x2a')](__dirname,_0x93e3('0x2b'),rs[_0x93e3('0x2c')](0x4)+_0x93e3('0x3c'));var _0x59071b;return downloadFile(_0x372e94,_0xddac2b)['then'](function(){_0x59071b=path[_0x93e3('0x2a')](__dirname,_0x93e3('0x2b'),rs[_0x93e3('0x2c')](0x4)+_0x93e3('0x2d'));return convertFile(_0xddac2b,_0x59071b);})[_0x93e3('0x30')](function(){try{fs[_0x93e3('0x1f')](_0xddac2b);fs[_0x93e3('0x31')](_0x59071b,_0x93e3('0x3f'));}catch(_0x35eac4){logger[_0x93e3('0x1e')](_0x35eac4);}return _0x59071b[_0x93e3('0x41')]('.')[0x0];});};exports[_0x93e3('0x81')]=function(_0x3c3ce7,_0x51afa9,_0x3f1f58,_0x423e27){var _0x261f42=util['format'](_0x93e3('0x82'),ISPEECH_API,_0x51afa9,_0x3f1f58,base64Encode(_0x3c3ce7),_0x423e27?util[_0x93e3('0x7f')]('model=%s',encodeURIComponent(_0x423e27)):'freeform=3');return uploadFile(_0x261f42)[_0x93e3('0x30')](function(_0x21f69c){return querystring[_0x93e3('0xb')](_0x21f69c);});};exports[_0x93e3('0x83')]=function(_0xc0e324,_0x445819){return sestek[_0x93e3('0x84')](_0xc0e324,_0x445819)[_0x93e3('0x30')](function(_0x5b70e8){logger[_0x93e3('0x1b')](JSON[_0x93e3('0x46')](_0x5b70e8));var _0x423672={'speech':_0x5b70e8[_0x93e3('0x85')],'action':_0x5b70e8[_0x93e3('0x86')]?_0x5b70e8[_0x93e3('0x86')]['CustomAction']:undefined,'actiondata':_0x5b70e8[_0x93e3('0x86')]?_0x5b70e8['channelData'][_0x93e3('0x87')]:undefined};if(_0x5b70e8['channelData']&&_0x5b70e8[_0x93e3('0x86')]['AudioFromTts']){return base64Decode(_0x5b70e8['channelData'][_0x93e3('0x88')][_0x93e3('0x89')],path[_0x93e3('0x2a')](__dirname,'tmp',rs[_0x93e3('0x2c')](0x4)+_0x93e3('0x2d')))[_0x93e3('0x30')](function(_0x30c5c9){_0x423672['audiofile']=_0x30c5c9;return _0x423672;});}return _0x423672;});};exports[_0x93e3('0x8a')]=function(){return __dirname;}; \ No newline at end of file +var _0xbac3=['./aws','./google','./sestek','agi','https://api.ispeech.org/api/rest','protocol','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','finish','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','host','WHAT_EVER','data','wav','info','finish\x20to\x20convert','start','resolve','base64','then','chmodSync','777','split','readFileSync','toString','googleCloudTTS','?key=','ssml','input','audioConfig','MP3','text:synthesize','POST','generate','.mp3','from','audioContent','writeFile','tmp','.wav','googleCloudTTS\x20path','googleTTS','utf8','application/x-www-form-urlencoded','f.req=','jQ1olc','null','slice','parse\x20response\x20failed:\x0a','lang\x20\x22','\x22\x20might\x20not\x20exist','writeFileSync','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','googleASR\x20transcription','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','stringify','source','resolvedQuery','result','action','actionIncomplete','fulfillment','speech','status','code','metadata','endConversation','isFallbackIntent','replace','SessionsClient','sessionPath','length','queryResult','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','queryText','responseId','tildeASR','Tilde\x20ASR\x20confidence','confidence','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','sestekNDA','text','channelData','CustomAction','CustomActionData','AudioFromTts','audiofile','bluebird','dialogflow','http','https','path','querystring','request-promise','randomstring','google-tts-api','url','parse','util'];(function(_0x94b3c6,_0x2ff46e){var _0x1e2c76=function(_0x2f9d86){while(--_0x2f9d86){_0x94b3c6['push'](_0x94b3c6['shift']());}};_0x1e2c76(++_0x2ff46e);}(_0xbac3,0xfe));var _0x3bac=function(_0x44c09c,_0x225ba3){_0x44c09c=_0x44c09c-0x0;var _0x4da5c8=_0xbac3[_0x44c09c];return _0x4da5c8;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0x3bac('0x0'));var dialogflow=require(_0x3bac('0x1'));var fs=require('fs');var http=require(_0x3bac('0x2'));var https=require(_0x3bac('0x3'));var md5=require('md5');var path=require(_0x3bac('0x4'));var querystring=require(_0x3bac('0x5'));var rp=require(_0x3bac('0x6'));var rs=require(_0x3bac('0x7'));var sox=require('sox');var tts=require(_0x3bac('0x8'));var urlParse=require(_0x3bac('0x9'))[_0x3bac('0xa')];var util=require(_0x3bac('0xb'));var aws=require(_0x3bac('0xc'));var google=require(_0x3bac('0xd'));var sestek=require(_0x3bac('0xe'));var tilde=require('./tilde');var logger=require('../../../config/logger')(_0x3bac('0xf'));var ISPEECH_API=_0x3bac('0x10');function downloadFile(_0x54bd5d,_0x595896){return new BPromise(function(_0x23a183,_0x201a78){var _0x59c9c4=urlParse(_0x54bd5d);var _0x51f585=_0x59c9c4[_0x3bac('0x11')]==='https:'?https:http;var _0x1e05b9={'host':_0x59c9c4['host'],'path':_0x59c9c4[_0x3bac('0x4')],'headers':{'user-agent':'WHAT_EVER'}};_0x51f585['get'](_0x1e05b9,function(_0x25de15){if(_0x25de15[_0x3bac('0x12')]!==0xc8){logger[_0x3bac('0x13')](_0x3bac('0x14')+_0x54bd5d+_0x3bac('0x15')+_0x25de15['statusCode']+'\x20('+_0x25de15[_0x3bac('0x16')]+')');_0x201a78(new Error(_0x3bac('0x14')+_0x54bd5d+_0x3bac('0x15')+_0x25de15[_0x3bac('0x12')]+'\x20('+_0x25de15['statusMessage']+')'));return;}var _0x116dc0=fs['createWriteStream'](_0x595896);_0x116dc0['on'](_0x3bac('0x17'),function(){logger['info'](_0x3bac('0x18'));_0x116dc0[_0x3bac('0x19')](_0x23a183);});_0x116dc0['on'](_0x3bac('0x13'),function(_0x100c0d){fs[_0x3bac('0x1a')](_0x595896);logger[_0x3bac('0x13')](_0x3bac('0x1b'),_0x100c0d);_0x201a78(_0x100c0d);});_0x25de15[_0x3bac('0x1c')](_0x116dc0);})['on']('error',function(_0x28ddd8){logger[_0x3bac('0x13')](_0x28ddd8);_0x201a78(_0x28ddd8);})[_0x3bac('0x1d')]();});}function uploadFile(_0x3b1866){return new BPromise(function(_0xdd02fe,_0xa3ef67){var _0x57b610=urlParse(_0x3b1866);var _0x2d5547=_0x57b610['protocol']==='https:'?https:http;var _0x83d38d={'host':_0x57b610[_0x3bac('0x1e')],'path':_0x57b610[_0x3bac('0x4')],'headers':{'user-agent':_0x3bac('0x1f')}};_0x2d5547['get'](_0x83d38d,function(_0x4c5a3d){if(_0x4c5a3d[_0x3bac('0x12')]!==0xc8){_0xa3ef67(new Error(_0x3bac('0x14')+_0x3b1866+_0x3bac('0x15')+_0x4c5a3d['statusCode']+'\x20('+_0x4c5a3d[_0x3bac('0x16')]+')'));return;}var _0x5da6f2='';_0x4c5a3d['on'](_0x3bac('0x20'),function(_0x45f1ec){_0x5da6f2+=_0x45f1ec;});_0x4c5a3d['on'](_0x3bac('0x1d'),function(){_0xdd02fe(_0x5da6f2);});})['on'](_0x3bac('0x13'),function(_0x1bdda7){_0xa3ef67(_0x1bdda7);})['end']();});}function convertFile(_0x21540c,_0x42323f){return new BPromise(function(_0xe4ef98,_0x54deaa){var _0x44bd7f=sox['transcode'](_0x21540c,_0x42323f,{'sampleRate':0x1f40,'format':_0x3bac('0x21'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x44bd7f['on'](_0x3bac('0x13'),function(_0x25cdf8){logger[_0x3bac('0x13')]('error\x20convert',_0x25cdf8);_0x54deaa(_0x25cdf8);});_0x44bd7f['on'](_0x3bac('0x1d'),function(){logger[_0x3bac('0x22')](_0x3bac('0x23'));_0xe4ef98();});_0x44bd7f[_0x3bac('0x24')]();});}function base64Decode(_0x18f7e5,_0xf9717e){var _0x5dbbee=path[_0x3bac('0x25')](__dirname,'tmp',rs['generate'](0x4)+'.wav');fs['writeFileSync'](_0x5dbbee,_0x18f7e5,_0x3bac('0x26'));return convertFile(_0x5dbbee,_0xf9717e)[_0x3bac('0x27')](function(){try{fs[_0x3bac('0x1a')](_0x5dbbee);fs[_0x3bac('0x28')](_0xf9717e,_0x3bac('0x29'));}catch(_0x24c1c6){logger['error'](_0x24c1c6);}return _0xf9717e[_0x3bac('0x2a')]('.')[0x0];});}function base64Encode(_0x3b1775){var _0x1ef864=fs[_0x3bac('0x2b')](_0x3b1775);return new Buffer(_0x1ef864)[_0x3bac('0x2c')]('base64');}exports[_0x3bac('0x2d')]=function(_0x2792e2,_0x22c9c9,_0x427e34,_0x37d84c,_0x4ceba2,_0x53936a){var _0x588df7,_0x6c35e7;var _0x3613fb='https://texttospeech.googleapis.com/v1/';var _0x16fb75=_0x3bac('0x2e')+_0x2792e2;var _0x285bc8={};if(_0x22c9c9===_0x3bac('0x2f')){_0x285bc8[_0x3bac('0x30')]={'ssml':_0x427e34};}else{_0x285bc8[_0x3bac('0x30')]={'text':_0x427e34};};_0x285bc8['voice']={'languageCode':_0x37d84c,'ssmlGender':_0x4ceba2};_0x285bc8[_0x3bac('0x31')]={'audioEncoding':_0x3bac('0x32'),'sampleRateHertz':0x1f40};var _0x52bcbe={'url':_0x3613fb+_0x3bac('0x33')+_0x16fb75,'method':_0x3bac('0x34'),'json':!![],'body':_0x285bc8};return rp(_0x52bcbe)['then'](function(_0xa0078){return new BPromise(function(_0x7c01eb,_0x110be4){_0x588df7=path['resolve'](__dirname,'tmp',rs[_0x3bac('0x35')](0x4)+_0x3bac('0x36'));var _0x22d45d=Buffer[_0x3bac('0x37')](_0xa0078[_0x3bac('0x38')],_0x3bac('0x26'));return fs[_0x3bac('0x39')](_0x588df7,_0x22d45d,function(_0x2afead){_0x110be4(_0x2afead);},function(_0x11018c){fs[_0x3bac('0x28')](_0x588df7,'777');_0x7c01eb(_0x11018c);});});})[_0x3bac('0x27')](function(_0x32dced){_0x6c35e7=path[_0x3bac('0x25')](__dirname,_0x3bac('0x3a'),rs[_0x3bac('0x35')](0x4)+_0x3bac('0x3b'));return convertFile(_0x588df7,_0x6c35e7);})[_0x3bac('0x27')](function(){try{fs['unlink'](_0x588df7);fs['chmodSync'](_0x6c35e7,_0x3bac('0x29'));}catch(_0x521066){logger['error'](_0x521066);}logger[_0x3bac('0x22')](_0x3bac('0x3c'),_0x6c35e7[_0x3bac('0x2a')]('.')[0x0]);return _0x6c35e7[_0x3bac('0x2a')]('.')[0x0];});};exports[_0x3bac('0x3d')]=function(_0x579eb7,_0x1d24ce){var _0x436096='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x141c23,_0x7919dc;var _0x43fd28;var _0x1bb4e2={'encoding':_0x3bac('0x3e'),'method':_0x3bac('0x34'),'timeout':0x2710,'url':_0x436096,'headers':{'Content-Type':_0x3bac('0x3f')},'body':_0x3bac('0x40')+encodeURIComponent(JSON['stringify']([[[_0x3bac('0x41'),JSON['stringify']([_0x579eb7,_0x1d24ce||'en',![],_0x3bac('0x42')]),null,'generic']]]))};return rp(_0x1bb4e2)[_0x3bac('0x27')](function(_0x3f5eb1){try{_0x43fd28=eval(_0x3f5eb1[_0x3bac('0x43')](0x5))[0x0][0x2];}catch(_0x1d4060){throw new Error(_0x3bac('0x44')+_0x3f5eb1['data']);}if(!_0x43fd28){if(_0x579eb7['length']>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0x3bac('0x45')+_0x1d24ce+_0x3bac('0x46'));}}try{_0x43fd28=eval(_0x43fd28)[0x0];}catch(_0x54a935){throw new Error(_0x3bac('0x44')+res[_0x3bac('0x20')]);}const _0x1bba03=_0x43fd28;_0x141c23=path['resolve'](__dirname,_0x3bac('0x3a'),rs[_0x3bac('0x35')](0x4)+'.mp3');fs[_0x3bac('0x47')](_0x141c23,_0x43fd28,{'encoding':'base64'});_0x7919dc=path['resolve'](__dirname,'tmp',rs[_0x3bac('0x35')](0x4)+_0x3bac('0x3b'));return convertFile(_0x141c23,_0x7919dc);})[_0x3bac('0x27')](function(){try{fs[_0x3bac('0x1a')](_0x141c23);fs[_0x3bac('0x28')](_0x7919dc,_0x3bac('0x29'));}catch(_0x356585){logger[_0x3bac('0x13')](_0x356585);}logger['info'](_0x3bac('0x48'),_0x7919dc[_0x3bac('0x2a')]('.')[0x0]);return _0x7919dc[_0x3bac('0x2a')]('.')[0x0];});};exports[_0x3bac('0x49')]=function(_0x531798,_0x7bf8f,_0xc4b258){return google[_0x3bac('0x4a')](_0x531798,_0x7bf8f,_0xc4b258)[_0x3bac('0x27')](function(_0x249aa3){logger['info'](_0x249aa3[_0x3bac('0x4b')]);return rp(_0x249aa3);})[_0x3bac('0x27')](function(_0x4a3522){var _0x5dbd49='';var _0x3b0db7=0x0;try{fs[_0x3bac('0x1a')](_0x531798);}catch(_0x7b1c8c){logger['error'](_0x7b1c8c);}if(_0x4a3522&&_0x4a3522[_0x3bac('0x4c')]){_0x5dbd49=_0x4a3522[_0x3bac('0x4c')][_0x3bac('0x4d')](function(_0x4e0d3f){return _0x4e0d3f&&_0x4e0d3f['alternatives'][0x0]&&_0x4e0d3f[_0x3bac('0x4e')][0x0][_0x3bac('0x4f')]?_0x4e0d3f[_0x3bac('0x4e')][0x0][_0x3bac('0x4f')]:'';})['join']('\x0a');_0x3b0db7=_0x4a3522['results'][_0x3bac('0x4d')](function(_0x1851f2){return _0x1851f2&&_0x1851f2[_0x3bac('0x4e')][0x0]&&_0x1851f2['alternatives'][0x0]['confidence']?_0x1851f2['alternatives'][0x0]['confidence']:0x0;})['join']('\x0a');}logger[_0x3bac('0x22')](_0x3bac('0x50'),_0x5dbd49);logger['info']('googleASR\x20confidence',_0x3b0db7);return{'transcript':_0x5dbd49,'confidence':_0x3b0db7};})[_0x3bac('0x51')](function(_0x5178c7){logger[_0x3bac('0x13')](_0x3bac('0x52'),_0x5178c7[_0x3bac('0x12')],_0x5178c7[_0x3bac('0x53')],_0x5178c7[_0x3bac('0x54')]);});};exports[_0x3bac('0x55')]=function(_0x393b75,_0x53deb8,_0x2ea0c4,_0x47ebe0){var _0x37a09b=apiai(_0x53deb8,{'language':_0x47ebe0||'en'});return _0x37a09b[_0x3bac('0x56')](_0x2ea0c4,{'sessionId':md5(_0x393b75)})[_0x3bac('0x27')](function(_0x26e9d1){logger[_0x3bac('0x22')](JSON[_0x3bac('0x57')](_0x26e9d1));return{'source':_0x26e9d1['result'][_0x3bac('0x58')],'resolvedQuery':_0x26e9d1['result'][_0x3bac('0x59')],'action':_0x26e9d1[_0x3bac('0x5a')][_0x3bac('0x5b')],'actionIncomplete':_0x26e9d1['result'][_0x3bac('0x5c')],'speech':_0x26e9d1['result'][_0x3bac('0x5d')][_0x3bac('0x5e')],'score':_0x26e9d1[_0x3bac('0x5a')]['score'],'statusCode':_0x26e9d1[_0x3bac('0x5f')][_0x3bac('0x60')],'endConversation':_0x26e9d1[_0x3bac('0x5a')][_0x3bac('0x61')][_0x3bac('0x62')]||![],'isFallbackIntent':_0x26e9d1[_0x3bac('0x5a')]['metadata'][_0x3bac('0x63')]};});};exports['googleDialogflowV2']=function(_0x3277db,_0x378fd2,_0x511b43,_0x5f5abc,_0x379a3d,_0x574c9c){var _0x222bf1=_0x5f5abc[_0x3bac('0x64')](/\\n/g,'\x0a');var _0x56582d={'credentials':{'private_key':_0x222bf1,'client_email':_0x511b43}};var _0xd04779=new dialogflow[(_0x3bac('0x65'))](_0x56582d);var _0x2eca90=_0xd04779[_0x3bac('0x66')](_0x378fd2,md5(_0x3277db));var _0x5cee5d={'session':_0x2eca90,'queryInput':{'text':{'text':_0x379a3d,'languageCode':_0x574c9c}}};return _0xd04779['detectIntent'](_0x5cee5d)[_0x3bac('0x27')](function(_0x47590f){if(_0x47590f&&_0x47590f[_0x3bac('0x67')]){logger['info']('Dialogflow\x20V2\x20response:',JSON[_0x3bac('0x57')](_0x47590f));var _0x59a383=_0x47590f[0x0];if(_0x59a383){var _0x22d5f9={'action':_0x59a383[_0x3bac('0x68')][_0x3bac('0x5b')],'allRequiredParamsPresent':_0x59a383[_0x3bac('0x68')]['allRequiredParamsPresent'],'endConversation':_0x59a383[_0x3bac('0x68')]['diagnosticInfo']&&_0x59a383[_0x3bac('0x68')][_0x3bac('0x69')][_0x3bac('0x6a')]?_0x59a383[_0x3bac('0x68')][_0x3bac('0x69')]['fields'][_0x3bac('0x6b')][_0x3bac('0x6c')]:![],'fulfillmentText':_0x59a383[_0x3bac('0x68')][_0x3bac('0x6d')],'intentName':_0x59a383[_0x3bac('0x68')][_0x3bac('0x6e')]['name'],'intentDisplayName':_0x59a383[_0x3bac('0x68')][_0x3bac('0x6e')][_0x3bac('0x6f')],'isFallbackIntent':_0x59a383[_0x3bac('0x68')][_0x3bac('0x6e')][_0x3bac('0x70')],'languageCode':_0x59a383[_0x3bac('0x68')]['languageCode'],'queryText':_0x59a383[_0x3bac('0x68')][_0x3bac('0x71')],'responseId':_0x59a383[_0x3bac('0x72')],'score':_0x59a383[_0x3bac('0x68')]['intentDetectionConfidence'],'speech':_0x59a383[_0x3bac('0x68')][_0x3bac('0x6d')],'providerResponse':JSON['stringify'](_0x47590f)};return _0x22d5f9;}}});};exports[_0x3bac('0x73')]=function(_0x3c3c78,_0x2acaae,_0x1c1077,_0x520ecb){return tilde[_0x3bac('0x4a')](_0x3c3c78,_0x2acaae,_0x1c1077,_0x520ecb)[_0x3bac('0x27')](function(_0xe04078){try{fs[_0x3bac('0x1a')](_0x3c3c78);}catch(_0xa39392){logger[_0x3bac('0x13')](_0xa39392);}logger['info']('Tilde\x20ASR\x20transcription',_0xe04078[_0x3bac('0x4f')]);logger[_0x3bac('0x22')](_0x3bac('0x74'),_0xe04078[_0x3bac('0x75')]);return _0xe04078;});};exports['awsPolly']=function(_0x5e98b5,_0x5bb405,_0x598077,_0x3726d0,_0x1a2422,_0xe7f3b1){var _0x2ad089=path[_0x3bac('0x25')](__dirname,_0x3bac('0x3a'),rs[_0x3bac('0x35')](0x4)+'.mp3');var _0x3b6d7a;return aws['polly'](_0x5e98b5,_0x5bb405,_0x598077,_0x3726d0,_0x1a2422,_0xe7f3b1,_0x2ad089)['then'](function(){_0x3b6d7a=path[_0x3bac('0x25')](__dirname,_0x3bac('0x3a'),rs['generate'](0x4)+_0x3bac('0x3b'));return convertFile(_0x2ad089,_0x3b6d7a);})[_0x3bac('0x27')](function(){try{fs[_0x3bac('0x1a')](_0x2ad089);fs[_0x3bac('0x28')](_0x3b6d7a,_0x3bac('0x29'));}catch(_0x395505){logger[_0x3bac('0x13')](_0x395505);}return _0x3b6d7a['split']('.')[0x0];});};exports[_0x3bac('0x76')]=function(_0x16257e,_0x409002,_0x2f4586,_0x5e7ace,_0x1a11f7,_0x4a338c){return aws[_0x3bac('0x77')](_0x16257e,_0x409002,_0x2f4586,_0x5e7ace,_0x1a11f7,_0x4a338c)[_0x3bac('0x27')](function(_0x2605f9){logger['info'](JSON[_0x3bac('0x57')](_0x2605f9));return _0x2605f9;});};exports[_0x3bac('0x78')]=function(_0x182af0,_0x3d9e43,_0x353485,_0x12957c){var _0x1ea54c=util[_0x3bac('0x79')](_0x3bac('0x7a'),ISPEECH_API,_0x182af0,encodeURIComponent(_0x3d9e43),_0x353485,_0x12957c);var _0x351745=path[_0x3bac('0x25')](__dirname,'tmp',rs[_0x3bac('0x35')](0x4)+_0x3bac('0x36'));var _0x4c5f21;return downloadFile(_0x1ea54c,_0x351745)[_0x3bac('0x27')](function(){_0x4c5f21=path[_0x3bac('0x25')](__dirname,_0x3bac('0x3a'),rs['generate'](0x4)+_0x3bac('0x3b'));return convertFile(_0x351745,_0x4c5f21);})[_0x3bac('0x27')](function(){try{fs[_0x3bac('0x1a')](_0x351745);fs[_0x3bac('0x28')](_0x4c5f21,_0x3bac('0x29'));}catch(_0xc343e4){logger['error'](_0xc343e4);}return _0x4c5f21[_0x3bac('0x2a')]('.')[0x0];});};exports[_0x3bac('0x7b')]=function(_0xe555f2,_0x675be6,_0xf0a6d4,_0xc641d){var _0x4f0320=util[_0x3bac('0x79')](_0x3bac('0x7c'),ISPEECH_API,_0x675be6,_0xf0a6d4,base64Encode(_0xe555f2),_0xc641d?util[_0x3bac('0x79')](_0x3bac('0x7d'),encodeURIComponent(_0xc641d)):'freeform=3');return uploadFile(_0x4f0320)[_0x3bac('0x27')](function(_0x1535da){return querystring[_0x3bac('0xa')](_0x1535da);});};exports[_0x3bac('0x7e')]=function(_0x393f43,_0x40103c){return sestek['nda'](_0x393f43,_0x40103c)[_0x3bac('0x27')](function(_0x5a0dfc){logger['info'](JSON[_0x3bac('0x57')](_0x5a0dfc));var _0x17c244={'speech':_0x5a0dfc[_0x3bac('0x7f')],'action':_0x5a0dfc[_0x3bac('0x80')]?_0x5a0dfc[_0x3bac('0x80')][_0x3bac('0x81')]:undefined,'actiondata':_0x5a0dfc[_0x3bac('0x80')]?_0x5a0dfc['channelData'][_0x3bac('0x82')]:undefined};if(_0x5a0dfc['channelData']&&_0x5a0dfc[_0x3bac('0x80')][_0x3bac('0x83')]){return base64Decode(_0x5a0dfc[_0x3bac('0x80')]['AudioFromTts']['Data'],path[_0x3bac('0x25')](__dirname,'tmp',rs[_0x3bac('0x35')](0x4)+'.wav'))['then'](function(_0xad2051){_0x17c244[_0x3bac('0x84')]=_0xad2051;return _0x17c244;});}return _0x17c244;});};exports['dirName']=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 d288b29..9e65e98 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 _0x10db=['./nda','exports'];(function(_0x45a09a,_0x57fb22){var _0xe92b4c=function(_0x485b78){while(--_0x485b78){_0x45a09a['push'](_0x45a09a['shift']());}};_0xe92b4c(++_0x57fb22);}(_0x10db,0xac));var _0xb10d=function(_0x5cf4f2,_0x1bb4ed){_0x5cf4f2=_0x5cf4f2-0x0;var _0x53fc54=_0x10db[_0x5cf4f2];return _0x53fc54;};var nda=require(_0xb10d('0x0'));module[_0xb10d('0x1')]={'nda':nda}; \ No newline at end of file +var _0xebb4=['./nda','exports'];(function(_0x27c3f0,_0x198aa2){var _0x11e51c=function(_0x2a48ec){while(--_0x2a48ec){_0x27c3f0['push'](_0x27c3f0['shift']());}};_0x11e51c(++_0x198aa2);}(_0xebb4,0x16c));var _0x4ebb=function(_0x337bed,_0x5c4d22){_0x337bed=_0x337bed-0x0;var _0x25dd6c=_0xebb4[_0x337bed];return _0x25dd6c;};var nda=require(_0x4ebb('0x0'));module[_0x4ebb('0x1')]={'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 4cde180..cbe7d7a 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 _0x7427=['uniqueid','callerid','dnid','Bearer\x20','access_token','body','channelData','ndagenerate_audio','custom_action','CustomAction','custom_action_data','CustomActionData','info','request-promise','url','../../../../../config/logger','agi','POST','resolve','ndauth_url','/token','password','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type'];(function(_0x5abc1e,_0x8715e7){var _0x3423d1=function(_0x34055b){while(--_0x34055b){_0x5abc1e['push'](_0x5abc1e['shift']());}};_0x3423d1(++_0x8715e7);}(_0x7427,0x111));var _0x7742=function(_0x333767,_0x3e6f9c){_0x333767=_0x333767-0x0;var _0x51661b=_0x7427[_0x333767];return _0x51661b;};'use strict';var rp=require(_0x7742('0x0'));var url=require(_0x7742('0x1'));var logger=require(_0x7742('0x2'))(_0x7742('0x3'));module['exports']=function(_0x3b6268,_0x1bfe63){var _0x49ff50={'method':_0x7742('0x4'),'uri':url[_0x7742('0x5')](_0x1bfe63[_0x7742('0x6')],_0x7742('0x7')),'form':{'grant_type':_0x7742('0x8'),'username':_0x1bfe63['username'],'password':_0x1bfe63['password']},'json':!![]};return rp(_0x49ff50)[_0x7742('0x9')](function(_0xd21f94){var _0x3c6ceb={'method':_0x7742('0x4'),'uri':url[_0x7742('0x5')](_0x1bfe63[_0x7742('0xa')],_0x7742('0xb')),'body':{'type':_0x1bfe63[_0x7742('0xc')]||'message','channelId':'Nda','conversation':{'id':_0x3b6268[_0x7742('0xd')]},'from':{'id':_0x3b6268[_0x7742('0xe')],'name':_0x3b6268['calleridname']},'recipient':{'id':_0x3b6268[_0x7742('0xf')],'name':_0x3b6268['extension']},'text':_0x1bfe63['text'],'channelData':{}},'headers':{'Authorization':_0x7742('0x10')+_0xd21f94[_0x7742('0x11')]},'json':!![]};if(_0x1bfe63['project']){_0x3c6ceb[_0x7742('0x12')][_0x7742('0x13')]['ProjectName']=_0x1bfe63['project'];}if(_0x1bfe63[_0x7742('0x14')]=='1'){_0x3c6ceb['body']['channelData']['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x1bfe63[_0x7742('0x15')]){_0x3c6ceb['body']['channelData'][_0x7742('0x16')]=_0x1bfe63['custom_action'];if(_0x1bfe63[_0x7742('0x17')]){_0x3c6ceb[_0x7742('0x12')][_0x7742('0x13')][_0x7742('0x18')]=_0x1bfe63[_0x7742('0x17')];}}logger[_0x7742('0x19')](JSON['stringify'](_0x3c6ceb));return rp(_0x3c6ceb);});}; \ No newline at end of file +var _0xc678=['username','password','ndassistant_url','ndaactivity_type','Nda','uniqueid','callerid','dnid','extension','text','Bearer\x20','project','ndagenerate_audio','channelData','audio/wav','custom_action','body','custom_action_data','info','stringify','../../../../../config/logger','agi','exports','POST','resolve','/token'];(function(_0x35aad0,_0x18d47b){var _0x48994e=function(_0x47c44d){while(--_0x47c44d){_0x35aad0['push'](_0x35aad0['shift']());}};_0x48994e(++_0x18d47b);}(_0xc678,0x1b4));var _0x8c67=function(_0x1355fb,_0x4523f5){_0x1355fb=_0x1355fb-0x0;var _0x43e1ae=_0xc678[_0x1355fb];return _0x43e1ae;};'use strict';var rp=require('request-promise');var url=require('url');var logger=require(_0x8c67('0x0'))(_0x8c67('0x1'));module[_0x8c67('0x2')]=function(_0x4e359d,_0x3053ff){var _0x3b01cc={'method':_0x8c67('0x3'),'uri':url[_0x8c67('0x4')](_0x3053ff['ndauth_url'],_0x8c67('0x5')),'form':{'grant_type':'password','username':_0x3053ff[_0x8c67('0x6')],'password':_0x3053ff[_0x8c67('0x7')]},'json':!![]};return rp(_0x3b01cc)['then'](function(_0x207de1){var _0x22d7e4={'method':_0x8c67('0x3'),'uri':url[_0x8c67('0x4')](_0x3053ff[_0x8c67('0x8')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x3053ff[_0x8c67('0x9')]||'message','channelId':_0x8c67('0xa'),'conversation':{'id':_0x4e359d[_0x8c67('0xb')]},'from':{'id':_0x4e359d[_0x8c67('0xc')],'name':_0x4e359d['calleridname']},'recipient':{'id':_0x4e359d[_0x8c67('0xd')],'name':_0x4e359d[_0x8c67('0xe')]},'text':_0x3053ff[_0x8c67('0xf')],'channelData':{}},'headers':{'Authorization':_0x8c67('0x10')+_0x207de1['access_token']},'json':!![]};if(_0x3053ff[_0x8c67('0x11')]){_0x22d7e4['body']['channelData']['ProjectName']=_0x3053ff['project'];}if(_0x3053ff[_0x8c67('0x12')]=='1'){_0x22d7e4['body'][_0x8c67('0x13')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x8c67('0x14')};}if(_0x3053ff[_0x8c67('0x15')]){_0x22d7e4[_0x8c67('0x16')][_0x8c67('0x13')]['CustomAction']=_0x3053ff[_0x8c67('0x15')];if(_0x3053ff[_0x8c67('0x17')]){_0x22d7e4[_0x8c67('0x16')][_0x8c67('0x13')]['CustomActionData']=_0x3053ff['custom_action_data'];}}logger[_0x8c67('0x18')](JSON[_0x8c67('0x19')](_0x22d7e4));return rp(_0x22d7e4);});}; \ 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 c2c7ba7..21e493b 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 _0x9865=['./lib/api'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x9865,0x1b1));var _0x5986=function(_0x4ca91f,_0x399dc6){_0x4ca91f=_0x4ca91f-0x0;var _0xf593f6=_0x9865[_0x4ca91f];return _0xf593f6;};'use strict';var asr=require(_0x5986('0x0'));module['exports']=function(_0x196ec9,_0x5210ed,_0x2ac580,_0x1ec2ae){return asr(_0x196ec9,_0x5210ed,_0x2ac580,_0x1ec2ae);}; \ No newline at end of file +var _0x4d1c=['./lib/api'];(function(_0x2652ef,_0x234230){var _0x2db578=function(_0x56b137){while(--_0x56b137){_0x2652ef['push'](_0x2652ef['shift']());}};_0x2db578(++_0x234230);}(_0x4d1c,0xfa));var _0xc4d1=function(_0x5aacdd,_0x5a6fcc){_0x5aacdd=_0x5aacdd-0x0;var _0x27aeff=_0x4d1c[_0x5aacdd];return _0x27aeff;};'use strict';var asr=require(_0xc4d1('0x0'));module['exports']=function(_0x2a5ec7,_0x6435fc,_0x559bda,_0x425bac){return asr(_0x2a5ec7,_0x6435fc,_0x559bda,_0x425bac);}; \ 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 3514099..5f21a7c 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 _0x384c=['hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','stringify','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','open','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','hex','info','unix','send','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','Tilde\x20ASR\x20hypoteses'];(function(_0x22ea66,_0x30123a){var _0x529757=function(_0x2340e){while(--_0x2340e){_0x22ea66['push'](_0x22ea66['shift']());}};_0x529757(++_0x30123a);}(_0x384c,0x16e));var _0xc384=function(_0x2ba66d,_0x395d45){_0x2ba66d=_0x2ba66d-0x0;var _0x5caeb4=_0x384c[_0x2ba66d];return _0x5caeb4;};'use strict';var BPromise=require(_0xc384('0x0'));var _=require(_0xc384('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xc384('0x2'));var crypto=require(_0xc384('0x3'));var logger=require(_0xc384('0x4'))(_0xc384('0x5'));module['exports']=function(_0x26fd0d,_0x2a43a8,_0xca92fa,_0x30bcc6){return new BPromise(function(_0x2659e9,_0x54e113){logger['info'](_0xc384('0x6'),_0x30bcc6||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0xf22ba9=new WebSocket(_0x30bcc6||_0xc384('0x7'),{'perMessageDeflate':![]});var _0x5bcf96='';var _0x4bad22='0';var _0x5ec97f='1';var _0xf8c682=_0xc384('0x8');function _0x16be8f(_0x5db7bc){var _0x33a699=crypto['createHash']('sha1');_0x33a699['update'](_0x5db7bc);return _0x33a699['digest'](_0xc384('0x9'));}function _0x348e13(){try{logger[_0xc384('0xa')]('Open\x20Tilde\x20ASR\x20socket');var _0x1ed592=moment()[_0xc384('0xb')]();var _0x58404e=_0x16be8f(_0x1ed592+_0x2a43a8+_0xca92fa);_0xf22ba9[_0xc384('0xc')](JSON['stringify']({'appID':_0x2a43a8,'timestamp':_0x1ed592,'appKey':_0x58404e}));var _0x56876a=fs[_0xc384('0xd')](_0x26fd0d);_0x56876a['on'](_0xc384('0xe'),function(_0x4fb127){_0xf22ba9[_0xc384('0xc')](_0x4fb127);});_0x56876a['on'](_0xc384('0xf'),function(){_0xf22ba9[_0xc384('0xc')](_0xc384('0x10'));});}catch(_0x47f77a){logger[_0xc384('0x11')](_0xc384('0x12'),JSON['stringify'](_0x47f77a));_0xf22ba9[_0xc384('0x13')]();}}function _0x3f1ea9(_0x37e1f2){try{if(_0x37e1f2){var _0x492efd=JSON[_0xc384('0x14')](_0x37e1f2);switch(_0x492efd[_0xc384('0x15')]){case 0x0:if(_0x492efd['result']){if(_0x492efd[_0xc384('0x16')]['final']){logger[_0xc384('0xa')](_0xc384('0x17'),JSON['stringify'](_0x492efd[_0xc384('0x16')][_0xc384('0x18')]));_0x5bcf96=_0x492efd['result'][_0xc384('0x18')][0x0][_0xc384('0x19')];_0x4bad22=_0x492efd[_0xc384('0x16')]['hypotheses'][0x0][_0xc384('0x1a')];_0x5ec97f='0';_0xf8c682=_0xc384('0x1b');_0xf22ba9[_0xc384('0x13')]();}}break;case 0x1:logger[_0xc384('0xa')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x5ec97f='1';_0xf8c682=_0xc384('0x8');break;case 0x2:logger[_0xc384('0xa')](_0xc384('0x1c'));_0x5ec97f='2';_0xf8c682='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0xc384('0xa')](_0xc384('0x1d'));_0x5ec97f='9';_0xf8c682='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0xc384('0xa')](_0xc384('0x1e'));_0x5ec97f='10';_0xf8c682=_0xc384('0x1e');break;case 0xb:logger['info'](_0xc384('0x1f'));_0x5ec97f='11';_0xf8c682='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x2831f6){logger[_0xc384('0x11')](_0xc384('0x20'),JSON[_0xc384('0x21')](_0x2831f6));_0xf22ba9['terminate']();}}function _0x434710(){logger['info'](_0xc384('0x22'));_0x2659e9({'transcript':_0x5bcf96,'confidence':_0x4bad22,'status':_0x5ec97f,'status_message':_0xf8c682});}function _0x5776bd(_0x480bb6){logger[_0xc384('0x11')](_0xc384('0x23'));if(!_[_0xc384('0x24')](_0x480bb6)){logger[_0xc384('0x11')](_['isObject'](_0x480bb6)?JSON[_0xc384('0x21')](_0x480bb6):_0x480bb6);}}_0xf22ba9['on'](_0xc384('0x25'),_0x348e13);_0xf22ba9['on'](_0xc384('0x26'),_0x3f1ea9);_0xf22ba9['on'](_0xc384('0xf'),_0x434710);_0xf22ba9['on'](_0xc384('0x11'),_0x5776bd);});}; \ No newline at end of file +var _0x4c79=['stringify','createReadStream','data','send','close','EOS','error','terminate','parse','status','Tilde\x20ASR\x20hypoteses','result','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','message','bluebird','moment','crypto','../../../../../../config/logger','agi','exports','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','sha1','update','digest','hex','info','Open\x20Tilde\x20ASR\x20socket'];(function(_0x2cacef,_0xba1573){var _0x289ba6=function(_0x4ac8b9){while(--_0x4ac8b9){_0x2cacef['push'](_0x2cacef['shift']());}};_0x289ba6(++_0xba1573);}(_0x4c79,0x6a));var _0x94c7=function(_0x1caa6f,_0x2fa708){_0x1caa6f=_0x1caa6f-0x0;var _0x1d12ec=_0x4c79[_0x1caa6f];return _0x1d12ec;};'use strict';var BPromise=require(_0x94c7('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x94c7('0x1'));var crypto=require(_0x94c7('0x2'));var logger=require(_0x94c7('0x3'))(_0x94c7('0x4'));module[_0x94c7('0x5')]=function(_0x5bceb0,_0x598e1f,_0x42e025,_0xed01){return new BPromise(function(_0x1daabb,_0xb7bb1){logger['info'](_0x94c7('0x6'),_0xed01||_0x94c7('0x7'));var _0x4d19af=new WebSocket(_0xed01||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x1842fa='';var _0x5ab2dd='0';var _0x31d907='1';var _0x8267bb='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x572d73(_0x5d0bd2){var _0x2de837=crypto['createHash'](_0x94c7('0x8'));_0x2de837[_0x94c7('0x9')](_0x5d0bd2);return _0x2de837[_0x94c7('0xa')](_0x94c7('0xb'));}function _0x1f36cb(){try{logger[_0x94c7('0xc')](_0x94c7('0xd'));var _0x13ddd8=moment()['unix']();var _0x58309d=_0x572d73(_0x13ddd8+_0x598e1f+_0x42e025);_0x4d19af['send'](JSON[_0x94c7('0xe')]({'appID':_0x598e1f,'timestamp':_0x13ddd8,'appKey':_0x58309d}));var _0x2564ad=fs[_0x94c7('0xf')](_0x5bceb0);_0x2564ad['on'](_0x94c7('0x10'),function(_0x29018b){_0x4d19af[_0x94c7('0x11')](_0x29018b);});_0x2564ad['on'](_0x94c7('0x12'),function(){_0x4d19af['send'](_0x94c7('0x13'));});}catch(_0x481a76){logger[_0x94c7('0x14')]('Tilde\x20ASR\x20send\x20error',JSON[_0x94c7('0xe')](_0x481a76));_0x4d19af[_0x94c7('0x15')]();}}function _0x1c355f(_0x49268f){try{if(_0x49268f){var _0x3b016d=JSON[_0x94c7('0x16')](_0x49268f);switch(_0x3b016d[_0x94c7('0x17')]){case 0x0:if(_0x3b016d['result']){if(_0x3b016d['result']['final']){logger[_0x94c7('0xc')](_0x94c7('0x18'),JSON[_0x94c7('0xe')](_0x3b016d[_0x94c7('0x19')][_0x94c7('0x1a')]));_0x1842fa=_0x3b016d[_0x94c7('0x19')]['hypotheses'][0x0][_0x94c7('0x1b')];_0x5ab2dd=_0x3b016d[_0x94c7('0x19')][_0x94c7('0x1a')][0x0][_0x94c7('0x1c')];_0x31d907='0';_0x8267bb=_0x94c7('0x1d');_0x4d19af[_0x94c7('0x15')]();}}break;case 0x1:logger[_0x94c7('0xc')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x31d907='1';_0x8267bb='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger['info'](_0x94c7('0x1e'));_0x31d907='2';_0x8267bb=_0x94c7('0x1e');break;case 0x9:logger[_0x94c7('0xc')](_0x94c7('0x1f'));_0x31d907='9';_0x8267bb=_0x94c7('0x1f');break;case 0xa:logger[_0x94c7('0xc')](_0x94c7('0x20'));_0x31d907='10';_0x8267bb=_0x94c7('0x20');break;case 0xb:logger[_0x94c7('0xc')](_0x94c7('0x21'));_0x31d907='11';_0x8267bb=_0x94c7('0x21');}}}catch(_0x2e04aa){logger[_0x94c7('0x14')](_0x94c7('0x22'),JSON[_0x94c7('0xe')](_0x2e04aa));_0x4d19af[_0x94c7('0x15')]();}}function _0x3ec235(){logger[_0x94c7('0xc')](_0x94c7('0x23'));_0x1daabb({'transcript':_0x1842fa,'confidence':_0x5ab2dd,'status':_0x31d907,'status_message':_0x8267bb});}function _0x403dec(_0x232ce1){logger[_0x94c7('0x14')](_0x94c7('0x24'));if(!_[_0x94c7('0x25')](_0x232ce1)){logger[_0x94c7('0x14')](_[_0x94c7('0x26')](_0x232ce1)?JSON[_0x94c7('0xe')](_0x232ce1):_0x232ce1);}}_0x4d19af['on']('open',_0x1f36cb);_0x4d19af['on'](_0x94c7('0x27'),_0x1c355f);_0x4d19af['on'](_0x94c7('0x12'),_0x3ec235);_0x4d19af['on'](_0x94c7('0x14'),_0x403dec);});}; \ 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 2ddb234..add995e 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 _0xa62d=['exports','./asr'];(function(_0x21c6b8,_0x16d6f6){var _0x39d474=function(_0x27dbf5){while(--_0x27dbf5){_0x21c6b8['push'](_0x21c6b8['shift']());}};_0x39d474(++_0x16d6f6);}(_0xa62d,0xe3));var _0xda62=function(_0x2ff74d,_0x5900c9){_0x2ff74d=_0x2ff74d-0x0;var _0x367945=_0xa62d[_0x2ff74d];return _0x367945;};var asr=require(_0xda62('0x0'));module[_0xda62('0x1')]={'asr':asr}; \ No newline at end of file +var _0x2638=['exports','./asr'];(function(_0x246422,_0x4367e5){var _0xe86ae7=function(_0x5750b1){while(--_0x5750b1){_0x246422['push'](_0x246422['shift']());}};_0xe86ae7(++_0x4367e5);}(_0x2638,0x159));var _0x8263=function(_0x1a84fc,_0x32fb6f){_0x1a84fc=_0x1a84fc-0x0;var _0x178d3a=_0x2638[_0x1a84fc];return _0x178d3a;};var asr=require(_0x8263('0x0'));module[_0x8263('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index f6c33c3..033763e 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 _0x34e8=['E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','inherits','exports','util','net','events','EventEmitter','./channel','call','emit','error'];(function(_0x3b8ac3,_0x4bbda7){var _0x2f93ff=function(_0x5396ac){while(--_0x5396ac){_0x3b8ac3['push'](_0x3b8ac3['shift']());}};_0x2f93ff(++_0x4bbda7);}(_0x34e8,0x12c));var _0x834e=function(_0x3ac66d,_0x4fcdfe){_0x3ac66d=_0x3ac66d-0x0;var _0x7db578=_0x34e8[_0x3ac66d];return _0x7db578;};'use strict';var util=require(_0x834e('0x0'));var net=require(_0x834e('0x1'));var EventEmitter=require(_0x834e('0x2'))[_0x834e('0x3')];var AGIError=require('./error');var AGIChannel=require(_0x834e('0x4'));var AGIServer=function(_0x21e2e0,_0x472111,_0x31bf20){var _0x289ef2=this;var _0x19a3e0=null;var _0x398bee=0x0;if(!_0x21e2e0)_0x21e2e0=0x11dd;if(!_0x472111)_0x472111='127.0.0.1';EventEmitter[_0x834e('0x5')](_0x289ef2);function _0x52056d(){if(!_0x21e2e0){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0x8')));return![];}_0x19a3e0=net[_0x834e('0x9')]();_0x19a3e0[_0x834e('0xa')](_0x21e2e0,_0x472111);_0x19a3e0['on'](_0x834e('0xb'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xb'));});_0x19a3e0['on'](_0x834e('0xc'),function(_0x186b3b){_0x19a3e0[_0x834e('0xd')](function(_0x36e124,_0x14038b){if(_0x36e124){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x36e124));}else if(_0x31bf20&&_0x31bf20<0x0){_0x289ef2[_0x834e('0x6')]('error',new AGIError(_0x834e('0xf')));_0x186b3b[_0x834e('0x10')]();}else if(_0x31bf20&&_0x31bf20>0x0&&_0x31bf20<_0x14038b){_0x398bee+=0x1;_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0x11'),_0x398bee));_0x186b3b[_0x834e('0x10')]();}else{var _0x21cc0a=new AGIChannel(_0x186b3b);_0x21cc0a['on']('ready',function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xc'),_0x21cc0a);});}});});_0x19a3e0['on']('error',function(_0x316205){_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x316205['code']));});_0x19a3e0['on'](_0x834e('0x12'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0x12'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x834e('0x13')](function(){_0x52056d();});};util[_0x834e('0x14')](AGIServer,EventEmitter);module[_0x834e('0x15')]=function(_0xb993a1,_0x237947,_0x254677){return new AGIServer(_0xb993a1,_0x237947,_0x254677);}; \ No newline at end of file +var _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x9c44[_0x255d5b];return _0x3e141a;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 0385e17..8599c44 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 _0xcbde=['ispeechASR','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','clear','agicommand','clone','hasOwnProperty','isString','recursiveNodeIndex','isArray','length','saveRestApiResult','isPlainObject','%s.%s','replaceObjectAllVariables','replaceAllVariables','split','replaceAll','getVariable','extra','toString','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','retry','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','isConfigured','noop','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','label','grammar','no\x20grammar\x20configured','MRCPRecog','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','add','minutes','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','sestekasr','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','variable_id','no\x20variable\x20found','forEach','keys','%s_ROWS_COUNT','dial','debug','no\x20user\x20selected','sip_id','no\x20user\x20found','SIP/%s','opts','Executed\x20command\x20%s','DIAL','dialogflow','bot','Trying\x20Dialogflow:\x20%s','toUpperCase','speech','out','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','private_key','dialogflowV2_language','Trying\x20DialogflowV2:\x20%s','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','username','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','Sestek\x20NDA\x20%s\x20file\x20created','unlink','audiofile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','getTrunk','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','maxdigit','test','mindigit','hiddendigitsnum','hiddendigitspos','first','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20is\x20unreachable','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','message','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','no\x20appid\x20configured','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','extension','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','%s[%s]','variable\x20%s[key]\x20set','no\x20file\x20audio\x20selected','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_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','macro','gosub','position','QUEUE','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s/recordings/%s.%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','no\x20mail\x20account\x20configured','Smtp','email','subject','template_id','account_id','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','set','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','AGI','system','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','streamFile','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','shelljs','odbc','randomstring','moment','mustache','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','menu','getdigits','getsecretdigits','rpc','prototype','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','dsn','getUser','getTrunkById','getSound','getSoundById','getSoundPath','getMailAccount','getMailAccountById','sendMailMessage','mailRpc','getIntervals','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','arg_1','callerid','createSquareRecording','context','priority','dnid','file','createSquareMessage','uniqueid','createCmContact','isEmpty','isNil','random','lastName','phone','list_id','scheduledAt','callback','callback_priority','getPauseById','agentPause','agentUnpause','agent','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','ssmlGender','MALE','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','includes','POST','PUT','body','rawBody','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','sestekNDA','ispeechTTS','ispeech_tts_language','en-US'];(function(_0x2aba05,_0x448974){var _0x37573c=function(_0xb40d67){while(--_0xb40d67){_0x2aba05['push'](_0x2aba05['shift']());}};_0x37573c(++_0x448974);}(_0xcbde,0x141));var _0xecbd=function(_0x364ac4,_0x1d1b94){_0x364ac4=_0x364ac4-0x0;var _0x2b01d1=_0xcbde[_0x364ac4];return _0x2b01d1;};'use strict';var fs=require('fs');var util=require(_0xecbd('0x0'));var _=require('lodash');var sh=require(_0xecbd('0x1'));var odbc=require(_0xecbd('0x2'))();var rs=require(_0xecbd('0x3'));var moment=require(_0xecbd('0x4'));var Mustache=require(_0xecbd('0x5'));var rp=require('request-promise');var logger=require('../../config/logger')(_0xecbd('0x6'));var config=require(_0xecbd('0x7'));var shared=require('../../config/environment/shared');var scripts=require(_0xecbd('0x8'));var FILES_PATH=_0xecbd('0x9');var recursiveMapAttributes=['rawHeaders','rawBody'];var verticesWithRetry=[_0xecbd('0xa'),_0xecbd('0xb'),_0xecbd('0xc')];var AGIVertices=function(_0xe7ccdd,_0x3007bc,_0x43a04e){this['channel']=_0xe7ccdd;this[_0xecbd('0xd')]=_0x3007bc;this['mailRpc']=_0x43a04e;};AGIVertices[_0xecbd('0xe')]['getVariable']=function(_0x5712d1,_0x3ddb13){this['rpc'][_0xecbd('0xf')](_0x5712d1)[_0xecbd('0x10')](function(_0x4cd06f){_0x3ddb13(null,_0x4cd06f?_0x4cd06f[_0xecbd('0x11')]:![]);})[_0xecbd('0x12')](function(_0x447856){_0x3ddb13(_0x447856);});};AGIVertices[_0xecbd('0xe')][_0xecbd('0x13')]=function(_0x2ba71e,_0x1f4122){this[_0xecbd('0xd')][_0xecbd('0x14')](_0x2ba71e)['then'](function(_0xc7bb2b){_0x1f4122(null,_0xc7bb2b?_0xc7bb2b[_0xecbd('0x11')]:![]);})[_0xecbd('0x12')](function(_0x3805a){_0x1f4122(_0x3805a);});};AGIVertices[_0xecbd('0xe')][_0xecbd('0x15')]=function(_0x26d4c4,_0x1af064){this[_0xecbd('0xd')][_0xecbd('0x16')](_0x26d4c4)['then'](function(_0x200782){_0x1af064(null,_0x200782?_0x200782['name']:![]);})[_0xecbd('0x12')](function(_0x3cd3fa){_0x1af064(_0x3cd3fa);});};AGIVertices[_0xecbd('0xe')][_0xecbd('0x17')]=function(_0x3131b2,_0x24051a){this[_0xecbd('0xd')]['getSquareOdbcById'](_0x3131b2)[_0xecbd('0x10')](function(_0x2a3166){_0x24051a(null,_0x2a3166?_0x2a3166[_0xecbd('0x18')]:![]);})[_0xecbd('0x12')](function(_0x342c41){_0x24051a(_0x342c41);});};AGIVertices['prototype'][_0xecbd('0x19')]=function(_0x3ab72d,_0x11b003){this[_0xecbd('0xd')]['getUserById'](_0x3ab72d)[_0xecbd('0x10')](function(_0x47b0cc){_0x11b003(null,_0x47b0cc?_0x47b0cc[_0xecbd('0x11')]:![]);})[_0xecbd('0x12')](function(_0x292cce){_0x11b003(_0x292cce);});};AGIVertices[_0xecbd('0xe')]['getTrunk']=function(_0x493b02,_0x922ff4){this[_0xecbd('0xd')][_0xecbd('0x1a')](_0x493b02)[_0xecbd('0x10')](function(_0x5166e4){_0x922ff4(null,_0x5166e4?_0x5166e4[_0xecbd('0x11')]:![]);})[_0xecbd('0x12')](function(_0x1c05d9){_0x922ff4(_0x1c05d9);});};AGIVertices[_0xecbd('0xe')][_0xecbd('0x1b')]=function(_0x119a5e,_0x3dfed3){var _0x11dfdc=this;this[_0xecbd('0xd')][_0xecbd('0x1c')](_0x119a5e)[_0xecbd('0x10')](function(_0x3641d6){_0x3dfed3(null,_0x3641d6?_0x11dfdc[_0xecbd('0x1d')](_0x3641d6['save_name']):![]);})['catch'](function(_0x549988){_0x3dfed3(_0x549988);});};AGIVertices['prototype'][_0xecbd('0x1e')]=function(_0x26fbe2,_0x58682d){this[_0xecbd('0xd')][_0xecbd('0x1f')](_0x26fbe2)['then'](function(_0xeca49c){_0x58682d(null,_0xeca49c?_0xeca49c:![]);})[_0xecbd('0x12')](function(_0x2621b4){_0x58682d(_0x2621b4);});};AGIVertices['prototype'][_0xecbd('0x20')]=function(_0x389fb9,_0x130226,_0x289ab3){this[_0xecbd('0x21')][_0xecbd('0x20')](_0x389fb9,_0x130226)[_0xecbd('0x10')](function(){_0x289ab3(null);})[_0xecbd('0x12')](function(_0x203400){_0x289ab3(_0x203400);});};AGIVertices[_0xecbd('0xe')][_0xecbd('0x22')]=function(_0x49d7df,_0x337d77){this[_0xecbd('0xd')]['getIntervalById'](_0x49d7df)['then'](function(_0x30c7e3){if(_0x30c7e3){if(_0x30c7e3[_0xecbd('0x23')]){_0x337d77(null,[_0x30c7e3[_0xecbd('0x24')]]);}else{_0x337d77(null,_[_0xecbd('0x25')](_0x30c7e3[_0xecbd('0x26')],'interval'));}}else{_0x337d77(null,![]);}})[_0xecbd('0x12')](function(_0x32b1a2){_0x337d77(_0x32b1a2);});};AGIVertices['prototype'][_0xecbd('0x1d')]=function(_0x26341d){return util[_0xecbd('0x27')](_0xecbd('0x28'),FILES_PATH,_0x26341d);};AGIVertices[_0xecbd('0xe')][_0xecbd('0x29')]=function(_0xd21abd,_0x289c78,_0x5b7bf5){odbc['open'](_0xd21abd,function(_0x2bcf91){if(_0x2bcf91){logger[_0xecbd('0x2a')](_0xecbd('0x2b'),_0x2bcf91);_0x5b7bf5(_0x2bcf91);}else{logger[_0xecbd('0x2c')](_0xecbd('0x2d'));odbc[_0xecbd('0x2e')](_0x289c78,function(_0x1732f1,_0xa352ed){if(_0x1732f1){logger[_0xecbd('0x2c')](_0xecbd('0x2f'),_0x289c78);_0x5b7bf5(_0x1732f1);}else{logger[_0xecbd('0x2c')]('Query\x20executed\x20correctly\x20%s',_0x289c78);odbc[_0xecbd('0x30')](function(_0x4ace42){if(_0x4ace42){logger[_0xecbd('0x2a')](_0xecbd('0x31'),_0x4ace42);}_0x5b7bf5(null,_0xa352ed);});}});}});};AGIVertices['prototype'][_0xecbd('0x32')]=function(_0x34a757,_0x271e39){this[_0xecbd('0xd')][_0xecbd('0x33')](_0x34a757)['then'](function(_0x1770eb){_0x271e39(null,_0x1770eb?_0x1770eb:![]);})[_0xecbd('0x12')](function(_0x3bdfda){_0x271e39(_0x3bdfda);});};AGIVertices[_0xecbd('0xe')][_0xecbd('0x34')]=function(_0x9ecaac,_0x3a3845){this[_0xecbd('0xd')][_0xecbd('0x34')](_0x9ecaac)[_0xecbd('0x10')](function(_0x2188f2){_0x3a3845(null,_0x2188f2);})[_0xecbd('0x12')](function(_0x111b89){_0x3a3845(_0x111b89);});};AGIVertices[_0xecbd('0xe')][_0xecbd('0x35')]=function(_0x3ba0cc,_0xb09f76,_0x3b5c61){this[_0xecbd('0xd')][_0xecbd('0x35')]({'uniqueid':this[_0xecbd('0x36')]['uniqueid'],'node':_0x3ba0cc['label'],'application':_0x3ba0cc['agicommand'],'data':_0xb09f76||null,'project_name':this[_0xecbd('0x36')][_0xecbd('0x37')],'callerid':this[_0xecbd('0x36')][_0xecbd('0x38')]})[_0xecbd('0x10')](function(_0x274ca9){if(_0x3b5c61){_0x3b5c61(null,_0x274ca9);}})['catch'](function(_0xd3e2dc){if(_0x3b5c61){_0x3b5c61(_0xd3e2dc);}});};AGIVertices[_0xecbd('0xe')][_0xecbd('0x39')]=function(_0x42d0bf,_0x5eb423,_0x521917,_0x3e1a36){this[_0xecbd('0xd')][_0xecbd('0x39')]({'uniqueid':this[_0xecbd('0x36')]['uniqueid'],'callerid':this[_0xecbd('0x36')][_0xecbd('0x38')],'calleridname':this['channel']['calleridname'],'context':this[_0xecbd('0x36')][_0xecbd('0x3a')],'extension':this['channel']['extension'],'priority':this[_0xecbd('0x36')][_0xecbd('0x3b')],'accountcode':this[_0xecbd('0x36')]['accountcode'],'dnid':this['channel'][_0xecbd('0x3c')],'projectName':this[_0xecbd('0x36')][_0xecbd('0x37')],'saveName':_0x5eb423,'filename':_0x42d0bf[_0xecbd('0x3d')]||_0x5eb423,'savePath':_0x521917})[_0xecbd('0x10')](function(_0x50ab7e){_0x3e1a36(null,_0x50ab7e);})['catch'](function(_0x1d9606){_0x3e1a36(_0x1d9606);});};AGIVertices[_0xecbd('0xe')][_0xecbd('0x3e')]=function(_0xa4e33f,_0x1177cb,_0x17adf0,_0x33c88d,_0x221c55){this[_0xecbd('0xd')]['createSquareMessage']({'uniqueid':this['channel'][_0xecbd('0x3f')],'body':_0xa4e33f,'direction':_0x1177cb,'providerName':_0x17adf0,'providerResponse':_0x33c88d})[_0xecbd('0x10')](function(_0x24f065){if(_0x221c55){_0x221c55(null,_0x24f065);}})['catch'](function(_0x24bf2e){if(_0x221c55){_0x221c55(_0x24bf2e);}});};AGIVertices[_0xecbd('0xe')][_0xecbd('0x40')]=function(_0x3a1df7,_0x735f87){this['rpc'][_0xecbd('0x40')]({'firstName':_[_0xecbd('0x41')](_0x3a1df7[_0xecbd('0x11')])||_[_0xecbd('0x42')](_0x3a1df7[_0xecbd('0x11')])?'callback_'+Math[_0xecbd('0x43')]():_0x3a1df7[_0xecbd('0x11')],'lastName':_[_0xecbd('0x41')](_0x3a1df7['lastName'])||_['isNil'](_0x3a1df7['lastName'])?null:_0x3a1df7[_0xecbd('0x44')],'phone':_0x3a1df7[_0xecbd('0x45')],'ListId':_0x3a1df7[_0xecbd('0x46')],'scheduledat':_0x3a1df7[_0xecbd('0x47')],'callbackUniqueid':this[_0xecbd('0x36')][_0xecbd('0x3f')],'tags':_0xecbd('0x48'),'description':'Callback\x20scheduled\x20at\x20'+_0x3a1df7['scheduledAt']['toString'](),'priority':_0x3a1df7[_0xecbd('0x49')]})[_0xecbd('0x10')](function(_0x5ceb05){_0x735f87(null,_0x5ceb05);})[_0xecbd('0x12')](function(_0x35a6ca){_0x735f87(_0x35a6ca);});};AGIVertices[_0xecbd('0xe')]['getPause']=function(_0x5094a4,_0x10628e){this[_0xecbd('0xd')][_0xecbd('0x4a')](_0x5094a4)[_0xecbd('0x10')](function(_0x28bf83){_0x10628e(null,_0x28bf83?_0x28bf83[_0xecbd('0x11')]:![]);})['catch'](function(_0x2e4a96){_0x10628e(_0x2e4a96);});};AGIVertices[_0xecbd('0xe')][_0xecbd('0x4b')]=function(_0x383945,_0x4d7ee9,_0x3c5a08){var _0x2938f9={'role':'agent'};_0x2938f9[_0x383945]=this[_0xecbd('0x36')][_0xecbd('0x38')];this[_0xecbd('0xd')][_0xecbd('0x4b')](_0x2938f9,_0x4d7ee9,this['channel'][_0xecbd('0x3f')])['then'](function(_0x23b937){_0x3c5a08(null,_[_0xecbd('0x42')](_0x23b937)?![]:!![]);})[_0xecbd('0x12')](function(_0x41d355){logger[_0xecbd('0x2a')](_0x41d355);_0x3c5a08(null,![]);});};AGIVertices[_0xecbd('0xe')][_0xecbd('0x4c')]=function(_0x198b68,_0x48c534){var _0x12cfbe={'role':_0xecbd('0x4d')};_0x12cfbe[_0x198b68]=this[_0xecbd('0x36')][_0xecbd('0x38')];this['rpc'][_0xecbd('0x4c')](_0x12cfbe)[_0xecbd('0x10')](function(_0x1ec04e){_0x48c534(null,_[_0xecbd('0x42')](_0x1ec04e)?![]:!![]);})[_0xecbd('0x12')](function(_0x2a3451){logger[_0xecbd('0x2a')](_0x2a3451);_0x48c534(null,![]);});};AGIVertices[_0xecbd('0xe')][_0xecbd('0x4e')]=function(_0x37738f,_0x45e691){var _0x13e3bc={'role':_0xecbd('0x4d')};_0x13e3bc[_0x37738f]=this['channel'][_0xecbd('0x38')];this['rpc'][_0xecbd('0x4e')](_0x13e3bc)[_0xecbd('0x10')](function(_0x269071){_0x45e691(null,_['isNil'](_0x269071)?![]:!![]);})[_0xecbd('0x12')](function(_0x48e387){logger[_0xecbd('0x2a')](_0x48e387);_0x45e691(null,![]);});};AGIVertices['prototype'][_0xecbd('0x4f')]=function(_0x3d338f,_0x2d4cc2){var _0x267783={'role':_0xecbd('0x4d')};_0x267783[_0x3d338f]=this['channel'][_0xecbd('0x38')];var _0x3522ba=_0x3d338f!=_0xecbd('0x50')?util[_0xecbd('0x27')](_0xecbd('0x51'),_0xecbd('0x52'),this[_0xecbd('0x36')][_0xecbd('0x38')]):undefined;this[_0xecbd('0xd')][_0xecbd('0x4f')](_0x267783,_0x3522ba)[_0xecbd('0x10')](function(_0x26242c){_0x2d4cc2(null,_[_0xecbd('0x42')](_0x26242c)?![]:!![]);})[_0xecbd('0x12')](function(_0x2bafaa){logger[_0xecbd('0x2a')](_0x2bafaa);_0x2d4cc2(null,![]);});};AGIVertices[_0xecbd('0xe')][_0xecbd('0x53')]=function(_0x521601,_0x484556){sh[_0xecbd('0x54')](_[_0xecbd('0x55')](_0x521601),function(_0x23f58f,_0x3a0970){var _0x144ee8=_0x3a0970[_0xecbd('0x56')](/(\r\n|\n|\r)/gm,'');_0x484556(null,_0x144ee8);});};AGIVertices[_0xecbd('0xe')]['googleCloudTTS']=function(_0x35c024,_0x99f7d2){scripts[_0xecbd('0x57')](_0x35c024[_0xecbd('0x58')],_0x35c024[_0xecbd('0x59')]||_0xecbd('0x5a'),_0x35c024[_0xecbd('0x5a')],_0x35c024[_0xecbd('0x5b')]||'en-US',_0x35c024[_0xecbd('0x5c')]||_0xecbd('0x5d'),_0x35c024['audioEncoding']||_0xecbd('0x5e'))[_0xecbd('0x10')](function(_0x477774){_0x99f7d2(null,_0x477774);})[_0xecbd('0x12')](function(_0x42f29e){_0x99f7d2(_0x42f29e);});};AGIVertices[_0xecbd('0xe')][_0xecbd('0x5f')]=function(_0x31731a,_0x170afc){scripts['googleTTS'](_0x31731a[_0xecbd('0x5a')],_0x31731a[_0xecbd('0x60')]||'en',0x1)[_0xecbd('0x10')](function(_0x3d2267){_0x170afc(null,_0x3d2267);})['catch'](function(_0x3c9aa3){_0x170afc(_0x3c9aa3);});};AGIVertices[_0xecbd('0xe')][_0xecbd('0x61')]=function(_0x6a3ddd,_0x128fb3){var _0x2fc4d5={'uri':_0x6a3ddd[_0xecbd('0x62')],'method':_0x6a3ddd[_0xecbd('0x63')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x6a3ddd[_0xecbd('0x64')])==='number'&&parseInt(_0x6a3ddd[_0xecbd('0x64')])>=0x1?parseInt(_0x6a3ddd['timeout'])*0x3e8:0x5*0x3e8};if(_[_0xecbd('0x65')]([_0xecbd('0x66'),_0xecbd('0x67')],_0x2fc4d5['method']['toUpperCase']())){try{_0x2fc4d5[_0xecbd('0x68')]=_0x6a3ddd[_0xecbd('0x69')]?JSON[_0xecbd('0x6a')](_0x6a3ddd[_0xecbd('0x69')]):{};}catch(_0x19ba76){logger['error'](_0xecbd('0x6b'),_0x19ba76);}}try{_0x2fc4d5[_0xecbd('0x6c')]=_0x6a3ddd[_0xecbd('0x6d')]?JSON[_0xecbd('0x6a')](_0x6a3ddd[_0xecbd('0x6d')]):{};}catch(_0x10c249){logger[_0xecbd('0x2a')](_0xecbd('0x6e'),_0x10c249);}if(_0x6a3ddd['computedVariables']){try{var _0x2ea6f1=require(_0x6a3ddd[_0xecbd('0x6f')])[_0xecbd('0x70')](this,_0x2fc4d5);_0x2fc4d5['uri']=Mustache['render'](_0x6a3ddd[_0xecbd('0x62')],_0x2ea6f1,{},['$$','$$']);if(_0x2fc4d5[_0xecbd('0x6c')]){_0x2fc4d5[_0xecbd('0x6c')]=JSON[_0xecbd('0x6a')](Mustache[_0xecbd('0x71')](JSON['stringify'](_0x2fc4d5[_0xecbd('0x6c')]),_0x2ea6f1,{},['$$','$$']));}if(_0x2fc4d5[_0xecbd('0x68')]){_0x2fc4d5[_0xecbd('0x68')]=JSON[_0xecbd('0x6a')](Mustache['render'](JSON[_0xecbd('0x72')](_0x2fc4d5['body']),_0x2ea6f1,{},['$$','$$']));}}catch(_0xd3080c){logger[_0xecbd('0x2a')](_0xecbd('0x73'),_0xd3080c);}}rp(_0x2fc4d5)[_0xecbd('0x10')](function(_0x33b215){var _0xf81314={'statusCode':_0x33b215[_0xecbd('0x74')]||0xc8,'statusMessage':_0x33b215[_0xecbd('0x75')]||'OK','headers':_0x33b215[_0xecbd('0x6c')]||{},'body':_0x33b215[_0xecbd('0x68')]||{}};_0x128fb3(null,_0xf81314);})[_0xecbd('0x12')](function(_0x229fa4){var _0x4405ff={'statusCode':_0x229fa4[_0xecbd('0x74')]||0x1f4,'statusMessage':_0x229fa4['message']||_0xecbd('0x76'),'headers':_0x229fa4[_0xecbd('0x77')]['headers']||{},'body':_0x229fa4[_0xecbd('0x77')][_0xecbd('0x68')]||{}};_0x128fb3(null,_0x4405ff);});};AGIVertices[_0xecbd('0xe')][_0xecbd('0x78')]=function(_0x67e9ca,_0x29d95b){scripts['googleDialogflow'](this[_0xecbd('0x36')][_0xecbd('0x3f')],_0x67e9ca[_0xecbd('0x79')],_0x67e9ca[_0xecbd('0x5a')],_0x67e9ca[_0xecbd('0x7a')]||'en')[_0xecbd('0x10')](function(_0x4c30d6){_0x29d95b(null,_0x4c30d6);})['catch'](function(_0xa8131a){_0x29d95b(_0xa8131a);});};AGIVertices[_0xecbd('0xe')][_0xecbd('0x7b')]=function(_0x41de4e,_0x3857e4){scripts[_0xecbd('0x7b')](this[_0xecbd('0x36')][_0xecbd('0x3f')],_0x41de4e[_0xecbd('0x7c')],_0x41de4e[_0xecbd('0x7d')],_0x41de4e['private_key'],_0x41de4e[_0xecbd('0x5a')],_0x41de4e['dialogflowV2_language']||'en')[_0xecbd('0x10')](function(_0x2ed978){_0x3857e4(null,_0x2ed978);})[_0xecbd('0x12')](function(_0x5329c7){_0x3857e4(_0x5329c7);});};AGIVertices[_0xecbd('0xe')][_0xecbd('0x7e')]=function(_0x4b1c24,_0x10ba5d){scripts[_0xecbd('0x7e')](this['channel'],_0x4b1c24)[_0xecbd('0x10')](function(_0x24fd1b){_0x10ba5d(null,_0x24fd1b);})[_0xecbd('0x12')](function(_0x2e45a4){_0x10ba5d(_0x2e45a4);});};AGIVertices[_0xecbd('0xe')]['ispeechTTS']=function(_0x20689c,_0x4ed65a){scripts[_0xecbd('0x7f')](_0x20689c[_0xecbd('0x79')],_0x20689c[_0xecbd('0x5a')],_0x20689c[_0xecbd('0x80')]||_0xecbd('0x81'),_0x20689c['speed'])[_0xecbd('0x10')](function(_0x3db7fe){_0x4ed65a(null,_0x3db7fe);})[_0xecbd('0x12')](function(_0x5476da){_0x4ed65a(_0x5476da);});};AGIVertices[_0xecbd('0xe')]['ispeechASR']=function(_0x35cd84,_0x5cf765,_0x15dd08){scripts[_0xecbd('0x82')](_0x5cf765,_0x35cd84['key'],_0x35cd84['ispeech_asr_language']||_0xecbd('0x81'),this['isConfigured'](_0x35cd84['model'])?_0x35cd84['model']:undefined)[_0xecbd('0x10')](function(_0x2f63f7){_0x15dd08(null,_0x2f63f7);})[_0xecbd('0x12')](function(_0x5d7094){_0x15dd08(_0x5d7094);});};AGIVertices[_0xecbd('0xe')]['awsPolly']=function(_0x362ffd,_0x399c24){scripts[_0xecbd('0x83')](_0x362ffd[_0xecbd('0x84')],_0x362ffd[_0xecbd('0x85')],_0x362ffd[_0xecbd('0x86')],_0x362ffd[_0xecbd('0x87')]||'Amy',_0x362ffd[_0xecbd('0x5a')],_0x362ffd[_0xecbd('0x88')]||_0xecbd('0x5a'))[_0xecbd('0x10')](function(_0x5a1780){_0x399c24(null,_0x5a1780);})[_0xecbd('0x12')](function(_0x51bf71){_0x399c24(_0x51bf71);});};AGIVertices[_0xecbd('0xe')][_0xecbd('0x89')]=function(_0x4253aa,_0xd771ae){scripts['awsLex'](this[_0xecbd('0x36')][_0xecbd('0x3f')],_0x4253aa[_0xecbd('0x84')],_0x4253aa[_0xecbd('0x85')],_0x4253aa['aws_lex_region'],_0x4253aa[_0xecbd('0x5a')],_0x4253aa[_0xecbd('0x8a')])[_0xecbd('0x10')](function(_0x50f8e9){_0xd771ae(null,_0x50f8e9);})[_0xecbd('0x12')](function(_0x28fe6e){_0xd771ae(_0x28fe6e);});};AGIVertices['prototype'][_0xecbd('0x8b')]=function(_0x5bfe6d,_0x134ef1,_0x4f5c35){scripts[_0xecbd('0x8b')](_0x134ef1,_0x5bfe6d[_0xecbd('0x79')],_0x5bfe6d[_0xecbd('0x8c')]||_0xecbd('0x81'))[_0xecbd('0x10')](function(_0x2f004a){_0x4f5c35(null,_0x2f004a);})['catch'](function(_0x18262a){_0x4f5c35(_0x18262a);});};AGIVertices['prototype'][_0xecbd('0x8d')]=function(_0x1129cd,_0x4ae037,_0x20a887){scripts[_0xecbd('0x8d')](_0x4ae037,_0x1129cd[_0xecbd('0x8e')],_0x1129cd[_0xecbd('0x8f')],_0x1129cd[_0xecbd('0x90')])[_0xecbd('0x10')](function(_0x1db13b){_0x20a887(null,_0x1db13b);})[_0xecbd('0x12')](function(_0x279a2e){_0x20a887(_0x279a2e);});};AGIVertices[_0xecbd('0xe')][_0xecbd('0x91')]=function(_0x12f64e){var _0x51e472=_[_0xecbd('0x65')](verticesWithRetry,_0x12f64e[_0xecbd('0x92')])?_0x12f64e:_[_0xecbd('0x93')](_0x12f64e);for(var _0x11d7dc in _0x51e472){if(_0x51e472[_0xecbd('0x94')](_0x11d7dc)){if(_0x51e472[_0x11d7dc]&&_[_0xecbd('0x95')](_0x51e472[_0x11d7dc])){if(_[_0xecbd('0x65')](recursiveMapAttributes,_0x11d7dc)){_0x51e472[_0x11d7dc]=this['replaceObjectAllVariables'](_0x51e472[_0x11d7dc]);}else{_0x51e472[_0x11d7dc]=this['replaceAllVariables'](_0x51e472[_0x11d7dc]);}}}}return _0x51e472;};AGIVertices[_0xecbd('0xe')][_0xecbd('0x96')]=function(_0x683e60){for(var _0x562fd4 in _0x683e60){if(_0x683e60['hasOwnProperty'](_0x562fd4)){if(_['isPlainObject'](_0x683e60[_0x562fd4])){this[_0xecbd('0x96')](_0x683e60[_0x562fd4]);}else if(_[_0xecbd('0x97')](_0x683e60[_0x562fd4])){for(var _0x53702d=0x0;_0x53702d<_0x683e60[_0x562fd4][_0xecbd('0x98')];_0x53702d++){this['recursiveNodeIndex'](_0x683e60[_0x562fd4][_0x53702d]);}}else if(_[_0xecbd('0x95')](_0x683e60[_0x562fd4])){_0x683e60[_0x562fd4]=this['replaceAllVariables'](_0x683e60[_0x562fd4]);}}}};AGIVertices[_0xecbd('0xe')][_0xecbd('0x99')]=function(_0x390ef4,_0x2a11dc){for(var _0x1c5510 in _0x390ef4){if(_0x390ef4['hasOwnProperty'](_0x1c5510)){if(_[_0xecbd('0x9a')](_0x390ef4[_0x1c5510])){if(!_[_0xecbd('0x41')](_0x390ef4[_0x1c5510])){this[_0xecbd('0x99')](_0x390ef4[_0x1c5510],util['format'](_0xecbd('0x9b'),_0x2a11dc,_0x1c5510));}}else if(_[_0xecbd('0x97')](_0x390ef4[_0x1c5510])){for(var _0x2dadb2=0x0;_0x2dadb2<_0x390ef4[_0x1c5510][_0xecbd('0x98')];_0x2dadb2++){this['saveRestApiResult'](_0x390ef4[_0x1c5510][_0x2dadb2],util['format'](_0xecbd('0x9b'),_0x2a11dc,_0x1c5510+'['+_0x2dadb2+']'));}}else{if(!_[_0xecbd('0x42')](_0x390ef4[_0x1c5510])){this[_0xecbd('0x36')]['setVariable'](util[_0xecbd('0x27')](_0xecbd('0x9b'),_0x2a11dc,_0x1c5510),_0x390ef4[_0x1c5510]);}}}}};AGIVertices[_0xecbd('0xe')][_0xecbd('0x9c')]=function(_0x45655e){try{var _0x55a643=JSON[_0xecbd('0x6a')](_0x45655e);this['recursiveNodeIndex'](_0x55a643);return JSON[_0xecbd('0x72')](_0x55a643);}catch(_0x2a680a){return this['replaceAllVariables'](_0x45655e);}};AGIVertices[_0xecbd('0xe')][_0xecbd('0x9d')]=function(_0x343e2c){var _0x5077d8=_0x343e2c[_0xecbd('0x9e')]('{');for(var _0x35eb8e=0x1;_0x35eb8e<_0x5077d8[_0xecbd('0x98')];_0x35eb8e+=0x1){var _0x230a83=_0x5077d8[_0x35eb8e][_0xecbd('0x9e')]('}');if(_0x230a83[_0xecbd('0x98')]>0x1){_0x343e2c=_0x343e2c[_0xecbd('0x9f')]('{'+_0x230a83[0x0]+'}',this[_0xecbd('0x36')][_0xecbd('0xa0')](_0x230a83[0x0])[_0xecbd('0xa1')]||_0x230a83[0x0]);}}if(_0x5077d8[_0xecbd('0x98')]===0x1){return _0x343e2c[_0xecbd('0xa2')]();}return this[_0xecbd('0x9d')](_0x343e2c);};AGIVertices[_0xecbd('0xe')][_0xecbd('0xa3')]=function(_0x10f58b,_0x2cacbe){var _0x1241e=this['channel'][_0xecbd('0xa0')](_0x10f58b);if(_0x1241e[_0xecbd('0xa4')]===-0x1){return _0x1241e;}logger[_0xecbd('0x2c')](util[_0xecbd('0x27')](_0xecbd('0xa5'),_0x2cacbe,_0x1241e[_0xecbd('0xa1')]));return this[_0xecbd('0x36')][_0xecbd('0xa6')](_0x2cacbe,_0x1241e[_0xecbd('0xa1')]);};AGIVertices[_0xecbd('0xe')]['isConfigured']=function(_0x37c984){return _0x37c984&&_0x37c984!=='0'&&_0x37c984!=='-1'&&_0x37c984!=='';};AGIVertices[_0xecbd('0xe')]['maxRetry']=function(_0x341895){this[_0xecbd('0x35')][_0xecbd('0x70')](this,_0x341895,'-');_0x341895[_0xecbd('0xa7')]=_0x341895[_0xecbd('0xa8')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xecbd('0xe')][_0xecbd('0xa9')]=function(_0x3ff051){logger['info'](util[_0xecbd('0x27')](_0xecbd('0xaa'),_0x3ff051['label']));if(!this[_0xecbd('0xab')](_0x3ff051[_0xecbd('0x5a')])){return this[_0xecbd('0x36')][_0xecbd('0xac')]('no\x20text\x20configured');}var _0x1c5a79='\x22'+_0x3ff051[_0xecbd('0x5a')]+'\x22';if(this[_0xecbd('0xab')](_0x3ff051[_0xecbd('0x77')])){_0x1c5a79+=','+_0x3ff051[_0xecbd('0x77')];}var _0x4b45f0=this[_0xecbd('0x36')][_0xecbd('0x54')]('MRCPSynth',_0x1c5a79);if(_0x4b45f0[_0xecbd('0xa4')]===-0x1){return _0x4b45f0;}return this[_0xecbd('0x36')][_0xecbd('0xac')](util[_0xecbd('0x27')](_0xecbd('0xad'),_0x1c5a79));};AGIVertices[_0xecbd('0xe')][_0xecbd('0xae')]=function(_0x1c69af){logger['info'](util[_0xecbd('0x27')](_0xecbd('0xaf'),_0x1c69af[_0xecbd('0xb0')]));if(!this[_0xecbd('0xab')](_0x1c69af[_0xecbd('0xb1')])){return this[_0xecbd('0x36')]['noop'](_0xecbd('0xb2'));}var _0x205b96=_0x1c69af[_0xecbd('0xb1')];if(this[_0xecbd('0xab')](_0x1c69af['options'])){_0x205b96+=','+_0x1c69af['options'];}var _0x55f053=this['channel']['exec'](_0xecbd('0xb3'),_0x205b96);if(_0x55f053[_0xecbd('0xa4')]===-0x1){return _0x55f053;}var _0x15fe8c=this[_0xecbd('0xa3')]('RECOG_CONFIDENCE()',_0xecbd('0xb4'));if(_0x15fe8c[_0xecbd('0xa4')]===-0x1){return _0x15fe8c;}var _0x1967ac=this[_0xecbd('0xa3')](_0xecbd('0xb5'),_0xecbd('0xb6'));if(_0x1967ac['result']===-0x1){return _0x1967ac;}var _0x1882e9=this[_0xecbd('0xa3')]('RECOG_INSTANCE()',_0xecbd('0xb7'));if(_0x1882e9[_0xecbd('0xa4')]===-0x1){return _0x1882e9;}return this['channel'][_0xecbd('0xac')](util[_0xecbd('0x27')](_0xecbd('0xb8'),_0x205b96));};AGIVertices[_0xecbd('0xe')][_0xecbd('0x6')]=function(_0x34b936){logger[_0xecbd('0x2c')](util[_0xecbd('0x27')](_0xecbd('0xb9'),_0x34b936[_0xecbd('0xb0')]));return this[_0xecbd('0x36')]['agi']([_0x34b936[_0xecbd('0xba')],_0x34b936[_0xecbd('0xbb')]]);};AGIVertices['prototype'][_0xecbd('0xbc')]=function(_0x5b11b1){logger[_0xecbd('0x2c')](util['format'](_0xecbd('0xbd'),_0x5b11b1[_0xecbd('0xb0')]));if(this['isConfigured'](_0x5b11b1[_0xecbd('0x64')])){logger[_0xecbd('0x2c')](util['format'](_0xecbd('0xbe'),_0x5b11b1[_0xecbd('0x64')]));var _0x515b6a=this[_0xecbd('0x36')]['wait'](_0x5b11b1[_0xecbd('0x64')]);if(_0x515b6a[_0xecbd('0xa4')]===-0x1){return _0x515b6a;}}return this[_0xecbd('0x36')][_0xecbd('0xbc')]();};AGIVertices[_0xecbd('0xe')][_0xecbd('0x48')]=function(_0x240b44){logger[_0xecbd('0x2c')](util[_0xecbd('0x27')](_0xecbd('0xbf'),_0x240b44[_0xecbd('0xb0')]));if(!this[_0xecbd('0xab')](_0x240b44[_0xecbd('0x46')])){return this[_0xecbd('0x36')][_0xecbd('0x2a')](_0x240b44,'no\x20list\x20selected');}_0x240b44['scheduledAt']=moment();if(this['isConfigured'](_0x240b44[_0xecbd('0xc0')])){_0x240b44[_0xecbd('0x47')]=moment()[_0xecbd('0xc1')](_0x240b44[_0xecbd('0xc0')],_0xecbd('0xc2'));}if(!this[_0xecbd('0xab')](_0x240b44[_0xecbd('0x49')])){_0x240b44[_0xecbd('0x49')]=0x2;}this[_0xecbd('0x40')][_0xecbd('0x70')](this,_0x240b44);return this[_0xecbd('0x36')][_0xecbd('0xac')](util[_0xecbd('0x27')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x240b44[_0xecbd('0x45')],_0x240b44['list_id'],_0x240b44[_0xecbd('0x47')]));};AGIVertices[_0xecbd('0xe')][_0xecbd('0xc3')]=function(_0x2e420b){logger[_0xecbd('0x2c')](util[_0xecbd('0x27')](_0xecbd('0xc4'),_0x2e420b[_0xecbd('0xb0')]));var _0x361b11=this[_0xecbd('0x36')]['exec'](_0x2e420b[_0xecbd('0xc5')],_0x2e420b[_0xecbd('0x77')]);if(_0x361b11['result']===-0x1){return _0x361b11;}return this[_0xecbd('0x36')][_0xecbd('0xac')](util[_0xecbd('0x27')](_0xecbd('0xc6'),_0x2e420b[_0xecbd('0xc5')],_0x2e420b['options']));};AGIVertices['prototype'][_0xecbd('0xc7')]=function(_0x225f58){logger[_0xecbd('0x2c')](util[_0xecbd('0x27')](_0xecbd('0xc8'),_0x225f58['label']));if(!this['isConfigured'](_0x225f58['text'])){return this[_0xecbd('0x36')][_0xecbd('0xac')](_0xecbd('0xc9'));}var _0x40a3b3='\x22'+_0x225f58['text']+'\x22';if(this[_0xecbd('0xab')](_0x225f58['options'])){_0x40a3b3+=','+_0x225f58[_0xecbd('0x77')];}var _0x283718=this[_0xecbd('0x36')][_0xecbd('0x54')](_0xecbd('0xca'),_0x40a3b3);if(_0x283718[_0xecbd('0xa4')]===-0x1){return _0x283718;}return this[_0xecbd('0x36')][_0xecbd('0xac')](util[_0xecbd('0x27')](_0xecbd('0xad'),_0x40a3b3));};AGIVertices[_0xecbd('0xe')]['sestektts']=function(_0x5d3ea2){logger[_0xecbd('0x2c')](util[_0xecbd('0x27')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x5d3ea2['label']));if(!this['isConfigured'](_0x5d3ea2[_0xecbd('0x5a')])){return this['channel']['noop'](_0xecbd('0xc9'));}var _0x5ddf17='\x22'+_0x5d3ea2[_0xecbd('0x5a')]+'\x22';if(this['isConfigured'](_0x5d3ea2[_0xecbd('0x77')])){_0x5ddf17+=','+_0x5d3ea2[_0xecbd('0x77')];}var _0x480994=this['channel'][_0xecbd('0x54')]('MRCPSynth',_0x5ddf17);if(_0x480994['result']===-0x1){return _0x480994;}return this[_0xecbd('0x36')][_0xecbd('0xac')](util[_0xecbd('0x27')](_0xecbd('0xad'),_0x5ddf17));};AGIVertices[_0xecbd('0xe')]['lumenvoxasr']=function(_0x3f1f74){logger[_0xecbd('0x2c')](util[_0xecbd('0x27')](_0xecbd('0xcb'),_0x3f1f74[_0xecbd('0xb0')]));if(!this[_0xecbd('0xab')](_0x3f1f74[_0xecbd('0xb1')])){return this[_0xecbd('0x36')][_0xecbd('0xac')](_0xecbd('0xb2'));}var _0x134006=_0x3f1f74[_0xecbd('0xb1')];if(this[_0xecbd('0xab')](_0x3f1f74[_0xecbd('0x77')])){_0x134006+=','+_0x3f1f74['options'];}var _0x420bbc=this['channel'][_0xecbd('0x54')]('MRCPRecog',_0x134006);if(_0x420bbc[_0xecbd('0xa4')]===-0x1){return _0x420bbc;}var _0x2439d6=this[_0xecbd('0xa3')]('RECOG_CONFIDENCE()',_0xecbd('0xcc'));if(_0x2439d6[_0xecbd('0xa4')]===-0x1){return _0x2439d6;}var _0x237d30=this[_0xecbd('0xa3')](_0xecbd('0xb5'),_0xecbd('0xcd'));if(_0x237d30['result']===-0x1){return _0x237d30;}var _0x3ceb1c=this[_0xecbd('0xa3')](_0xecbd('0xce'),_0xecbd('0xcf'));if(_0x3ceb1c['result']===-0x1){return _0x3ceb1c;}return this[_0xecbd('0x36')][_0xecbd('0xac')](util[_0xecbd('0x27')](_0xecbd('0xb8'),_0x134006));};AGIVertices[_0xecbd('0xe')][_0xecbd('0xd0')]=function(_0xeb55b2){logger[_0xecbd('0x2c')](util[_0xecbd('0x27')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0xeb55b2[_0xecbd('0xb0')]));if(!this[_0xecbd('0xab')](_0xeb55b2['grammar'])){return this['channel'][_0xecbd('0xac')](_0xecbd('0xb2'));}var _0x1cf7ea=_0xeb55b2['grammar'];if(this[_0xecbd('0xab')](_0xeb55b2['options'])){_0x1cf7ea+=','+_0xeb55b2['options'];}var _0x2fbd4d=this[_0xecbd('0x36')][_0xecbd('0x54')]('MRCPRecog',_0x1cf7ea);if(_0x2fbd4d['result']===-0x1){return _0x2fbd4d;}var _0x498585=this[_0xecbd('0xa3')]('RECOG_CONFIDENCE()',_0xecbd('0xd1'));if(_0x498585[_0xecbd('0xa4')]===-0x1){return _0x498585;}var _0x33e0ee=this['getAndSetVariable']('RECOG_INPUT()',_0xecbd('0xd2'));if(_0x33e0ee[_0xecbd('0xa4')]===-0x1){return _0x33e0ee;}var _0x949829=this[_0xecbd('0xa3')](_0xecbd('0xce'),_0xecbd('0xd3'));if(_0x949829[_0xecbd('0xa4')]===-0x1){return _0x949829;}return this[_0xecbd('0x36')][_0xecbd('0xac')](util[_0xecbd('0x27')](_0xecbd('0xb8'),_0x1cf7ea));};AGIVertices[_0xecbd('0xe')][_0xecbd('0xd4')]=function(_0x524f47){logger[_0xecbd('0x2c')](util[_0xecbd('0x27')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x524f47['label']));if(!this['isConfigured'](_0x524f47[_0xecbd('0xd5')])){return this[_0xecbd('0x36')][_0xecbd('0x2a')](_0x524f47,_0xecbd('0xd6'));}var _0x348eb1=this[_0xecbd('0x17')][_0xecbd('0x70')](this,_0x524f47['odbc_id']);if(!_0x348eb1){return this[_0xecbd('0x36')][_0xecbd('0x2a')](_0x524f47,_0xecbd('0xd7'));}if(!this[_0xecbd('0xab')](_0x524f47[_0xecbd('0x2e')])){return this[_0xecbd('0x36')][_0xecbd('0x2a')](_0x524f47,'no\x20query\x20configured');}var _0x1344e4=_0x524f47[_0xecbd('0x2e')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0xecbd('0x36')][_0xecbd('0xac')](util[_0xecbd('0x27')]('query:\x20%s',_0x1344e4));var _0x27b9d2=this['getQueryOdbc'][_0xecbd('0x70')](this,_0x348eb1,_0x1344e4);this[_0xecbd('0x35')][_0xecbd('0x70')](this,_0x524f47,_0x1344e4);if(!this[_0xecbd('0xab')](_0x524f47[_0xecbd('0xd8')])){return this['channel'][_0xecbd('0xac')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x29f039=this[_0xecbd('0xa0')][_0xecbd('0x70')](this,_0x524f47[_0xecbd('0xd8')]);if(!_0x29f039){return this[_0xecbd('0x36')][_0xecbd('0x2a')](_0x524f47,_0xecbd('0xd9'));}var _0x386c77=this;_0x27b9d2[_0xecbd('0xda')](function(_0x189588,_0x446486){Object[_0xecbd('0xdb')](_0x189588)['forEach'](function(_0x4b0e37){_0x386c77[_0xecbd('0x36')][_0xecbd('0xa6')](util[_0xecbd('0x27')]('%s[%s][%s]',_0x29f039,_0x446486,_0x4b0e37),_0x189588[_0x4b0e37]);});});this['channel'][_0xecbd('0xa6')](util[_0xecbd('0x27')](_0xecbd('0xdc'),_0x29f039),_0x27b9d2['length']);return this[_0xecbd('0x36')][_0xecbd('0xac')](util[_0xecbd('0x27')]('variable\x20%s\x20set',_0x29f039));};AGIVertices['prototype'][_0xecbd('0xdd')]=function(_0x2bf97d){logger[_0xecbd('0xde')](util[_0xecbd('0x27')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x2bf97d[_0xecbd('0xb0')]));if(!this['isConfigured'](_0x2bf97d['sip_id'])){return this[_0xecbd('0x36')][_0xecbd('0x2a')](_0x2bf97d,_0xecbd('0xdf'));}var _0x18c1c9=this['getUser'][_0xecbd('0x70')](this,_0x2bf97d[_0xecbd('0xe0')]);if(!_0x18c1c9){return this[_0xecbd('0x36')][_0xecbd('0x2a')](_0x2bf97d,_0xecbd('0xe1'));}var _0x1342e2=this[_0xecbd('0x36')][_0xecbd('0x54')]('DIAL',[util[_0xecbd('0x27')](_0xecbd('0xe2'),_0x18c1c9),_0x2bf97d[_0xecbd('0x64')],_0x2bf97d[_0xecbd('0xe3')],_0x2bf97d[_0xecbd('0x62')]]);if(_0x1342e2[_0xecbd('0xa4')]===-0x1){return _0x1342e2;}return this[_0xecbd('0x36')]['noop'](util[_0xecbd('0x27')](_0xecbd('0xe4'),_0xecbd('0xe5')));};AGIVertices['prototype'][_0xecbd('0xe6')]=function(_0x44598e){logger[_0xecbd('0x2c')](util['format']('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x44598e[_0xecbd('0xb0')]));if(!this[_0xecbd('0xab')](_0x44598e[_0xecbd('0x79')])){return this['channel'][_0xecbd('0xac')]('no\x20key\x20configured');}if(!this[_0xecbd('0xab')](_0x44598e[_0xecbd('0x5a')])){return this['channel'][_0xecbd('0xac')](_0xecbd('0xc9'));}this['channel'][_0xecbd('0xe7')]=!![];this[_0xecbd('0x35')](_0x44598e);this[_0xecbd('0x3e')](_0x44598e[_0xecbd('0x5a')],'in','','');this[_0xecbd('0x36')][_0xecbd('0xac')](util['format'](_0xecbd('0xe8'),_0x44598e['text']));var _0x37d95d=this['googleDialogflow'][_0xecbd('0x70')](this,_0x44598e);if(_0x37d95d){for(var _0x2f6929 in _0x37d95d){if(_0x37d95d['hasOwnProperty'](_0x2f6929)){this[_0xecbd('0x36')][_0xecbd('0xa6')](util[_0xecbd('0x27')]('DIALOGFLOW_%s',_0x2f6929[_0xecbd('0xe9')]()),_0x37d95d[_0x2f6929]);}}this[_0xecbd('0x3e')](_0x37d95d[_0xecbd('0xea')],_0xecbd('0xeb'),_0xecbd('0xe6'),'');return this['channel']['noop'](util[_0xecbd('0x27')]('Dialogflow\x20Result\x20%s',_0x37d95d['speech']));}return this['channel']['error'](_0x44598e,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0xecbd('0xe')][_0xecbd('0xec')]=function(_0x140298){logger['info'](util[_0xecbd('0x27')](_0xecbd('0xed'),_0x140298[_0xecbd('0xb0')]));if(!this['isConfigured'](_0x140298[_0xecbd('0x7c')])){return this[_0xecbd('0x36')]['noop'](_0xecbd('0xee'));}if(!this[_0xecbd('0xab')](_0x140298[_0xecbd('0x7d')])){return this['channel']['noop'](_0xecbd('0xef'));}if(!this[_0xecbd('0xab')](_0x140298[_0xecbd('0xf0')])){return this[_0xecbd('0x36')]['noop']('no\x20private_key\x20configured');}if(!this[_0xecbd('0xab')](_0x140298[_0xecbd('0xf1')])){return this[_0xecbd('0x36')]['noop']('no\x20anguage\x20configured');}if(!this[_0xecbd('0xab')](_0x140298['text'])){return this['channel'][_0xecbd('0xac')](_0xecbd('0xc9'));}this[_0xecbd('0x36')]['bot']=!![];this[_0xecbd('0x35')](_0x140298);this[_0xecbd('0x3e')](_0x140298[_0xecbd('0x5a')],'in','','');this[_0xecbd('0x36')]['noop'](util[_0xecbd('0x27')](_0xecbd('0xf2'),_0x140298[_0xecbd('0x5a')]));var _0x5f27a4=this['googleDialogflowV2'][_0xecbd('0x70')](this,_0x140298);if(_0x5f27a4){for(var _0x2f1892 in _0x5f27a4){if(_0x5f27a4['hasOwnProperty'](_0x2f1892)){if(_0x2f1892!=='providerResponse'){this['channel']['setVariable'](util[_0xecbd('0x27')]('DIALOGFLOW_%s',_0x2f1892['toUpperCase']()),_0x5f27a4[_0x2f1892]);}}}this[_0xecbd('0x3e')](_0x5f27a4['speech'],_0xecbd('0xeb'),'dialogflowV2',_0x5f27a4['providerResponse']);return this[_0xecbd('0x36')][_0xecbd('0xac')](util[_0xecbd('0x27')](_0xecbd('0xf3'),_0x5f27a4['speech']));}return this[_0xecbd('0x36')][_0xecbd('0x2a')](_0x140298,_0xecbd('0xf4'));};AGIVertices[_0xecbd('0xe')][_0xecbd('0xf5')]=function(_0x552f14){logger[_0xecbd('0x2c')](util['format'](_0xecbd('0xf6'),_0x552f14['label']));if(!this[_0xecbd('0xab')](_0x552f14['ndauth_url'])){return this[_0xecbd('0x36')][_0xecbd('0xac')]('no\x20ndauth\x20url\x20configured');}if(!this[_0xecbd('0xab')](_0x552f14[_0xecbd('0xf7')])){return this['channel'][_0xecbd('0xac')](_0xecbd('0xf8'));}if(!this[_0xecbd('0xab')](_0x552f14['password'])){return this[_0xecbd('0x36')][_0xecbd('0xac')](_0xecbd('0xf9'));}if(!this[_0xecbd('0xab')](_0x552f14[_0xecbd('0xfa')])){return this[_0xecbd('0x36')][_0xecbd('0xac')](_0xecbd('0xc9'));}this[_0xecbd('0x36')][_0xecbd('0xe7')]=!![];this[_0xecbd('0x35')](_0x552f14);this[_0xecbd('0x3e')](_0x552f14['text'],'in','','');this[_0xecbd('0x36')][_0xecbd('0xac')](util['format'](_0xecbd('0xfb'),_0x552f14[_0xecbd('0x5a')]));var _0x21f422=this['sestekNDA']['sync'](this,_0x552f14);if(_0x21f422){for(var _0x2d8bfa in _0x21f422){if(_0x21f422[_0xecbd('0x94')](_0x2d8bfa)){this[_0xecbd('0x36')][_0xecbd('0xa6')](util[_0xecbd('0x27')](_0xecbd('0xfc'),_0x2d8bfa[_0xecbd('0xe9')]()),_0x21f422[_0x2d8bfa]);}}this[_0xecbd('0x3e')](_0x21f422['speech'],_0xecbd('0xeb'),_0xecbd('0xf5'),'');if(_0x21f422['audiofile']){this[_0xecbd('0x36')][_0xecbd('0xac')](util[_0xecbd('0x27')](_0xecbd('0xfd'),_0x21f422['audiofile']));var _0x389717=this[_0xecbd('0x36')]['streamFile'](_0x21f422['audiofile']);try{fs[_0xecbd('0xfe')](_0x21f422[_0xecbd('0xff')]+_0xecbd('0x100'));}catch(_0x57d5ba){logger[_0xecbd('0x2a')](_0x57d5ba);}return _0x389717;}else{return this[_0xecbd('0x36')][_0xecbd('0xac')](util['format'](_0xecbd('0x101'),_0x21f422[_0xecbd('0xea')]));}}return this[_0xecbd('0x36')][_0xecbd('0x2a')](_0x552f14,_0xecbd('0x102'));};AGIVertices[_0xecbd('0xe')][_0xecbd('0x103')]=function(_0xd2deb7){logger[_0xecbd('0x2c')](util['format']('Enter\x20in\x20END\x20(%s)\x20block',_0xd2deb7[_0xecbd('0xb0')]));return this[_0xecbd('0x36')][_0xecbd('0xac')](_0xecbd('0x103'));};AGIVertices[_0xecbd('0xe')][_0xecbd('0x104')]=function(_0x486a24){logger['info'](util[_0xecbd('0x27')](_0xecbd('0x105'),_0x486a24['label']));var _0x457768='';if(_0x486a24[_0xecbd('0x106')]){if(!this['isConfigured'](_0x486a24[_0xecbd('0x106')])){return this[_0xecbd('0x36')][_0xecbd('0x2a')](_0x486a24,_0xecbd('0x107'));}else{var _0xaa0fa8=parseInt(_0x486a24[_0xecbd('0x106')],0xa);if(isNaN(_0xaa0fa8)){_0x457768=_0x486a24['trunk_id'];}else{_0x457768=this[_0xecbd('0x108')][_0xecbd('0x70')](this,_0x486a24['trunk_id']);if(!_0x457768){return this['channel'][_0xecbd('0x2a')](_0x486a24,_0xecbd('0x109'));}}}}else if(_0x486a24[_0xecbd('0x10a')]){_0x457768=_0x486a24[_0xecbd('0x10a')];}else{return this['channel'][_0xecbd('0x2a')](_0x486a24,_0xecbd('0x107'));}var _0x50fda6=this['channel'][_0xecbd('0x54')]('DIAL',[util['format'](_0xecbd('0x10b'),_0x457768,_0x486a24[_0xecbd('0x45')]),_0x486a24[_0xecbd('0x64')],_0x486a24[_0xecbd('0xe3')],_0x486a24[_0xecbd('0x62')]]);if(_0x50fda6['result']===-0x1){return _0x50fda6;}return this[_0xecbd('0x36')][_0xecbd('0xac')](util[_0xecbd('0x27')](_0xecbd('0xe4'),_0xecbd('0xe5')));};AGIVertices[_0xecbd('0xe')][_0xecbd('0x10c')]=function(_0x1c5c1f){logger[_0xecbd('0x2c')](util['format']('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x1c5c1f['label']));return this[_0xecbd('0x36')][_0xecbd('0xac')](_0xecbd('0x10c'));};AGIVertices['prototype'][_0xecbd('0xb')]=function(_0x42fbcf){logger[_0xecbd('0x2c')](util[_0xecbd('0x27')](_0xecbd('0x10d'),_0x42fbcf['label']));if(_0x42fbcf[_0xecbd('0xa7')]===0x0){return this[_0xecbd('0xa8')](_0x42fbcf);}_0x42fbcf[_0xecbd('0xa7')]-=0x1;if(!this['isConfigured'](_0x42fbcf[_0xecbd('0x10e')])){return this[_0xecbd('0x36')][_0xecbd('0x2a')](_0x42fbcf,'no\x20file\x20audio\x20selected');}var _0x2837ac=this[_0xecbd('0x1b')][_0xecbd('0x70')](this,_0x42fbcf[_0xecbd('0x10e')]);if(!_0x2837ac){return this[_0xecbd('0x36')]['error'](_0x42fbcf,_0xecbd('0x10f'));}if(!this[_0xecbd('0xab')](_0x42fbcf[_0xecbd('0xd8')])){return this[_0xecbd('0x36')][_0xecbd('0x2a')](_0xecbd('0x110'));}var _0x52fbe3=this['channel'][_0xecbd('0x111')](_0x2837ac,_0x42fbcf[_0xecbd('0x112')],_0x42fbcf[_0xecbd('0x113')]);var _0x4abcc7=_0x52fbe3[_0xecbd('0xa4')]?_0x52fbe3[_0xecbd('0xa4')][_0xecbd('0xa2')]():'';logger[_0xecbd('0x2c')](_0xecbd('0x114'),JSON[_0xecbd('0x72')](_0x52fbe3));if(_0x52fbe3[_0xecbd('0xa4')]===-0x1){this[_0xecbd('0x35')][_0xecbd('0x70')](this,_0x42fbcf,_0x4abcc7);return _0x52fbe3;}else if(_0x52fbe3[_0xecbd('0xa1')]==='timeout'){_0x52fbe3[_0xecbd('0xa4')]=_0x4abcc7['length']>=parseInt(_0x42fbcf[_0xecbd('0x115')])?'x':'i';}else{_0x52fbe3['result']=_0x4abcc7['length']>=parseInt(_0x42fbcf[_0xecbd('0x115')])&&_0x4abcc7[_0xecbd('0x98')]<=parseInt(_0x42fbcf['maxdigit'])?'x':'i';}var _0x4bcf30=this['getVariable']['sync'](this,_0x42fbcf['variable_id']);if(!_0x4bcf30){return this[_0xecbd('0x36')][_0xecbd('0x2a')](_0x42fbcf,_0xecbd('0xd9'));}this[_0xecbd('0x36')][_0xecbd('0xa6')](_0x4bcf30,_0x4abcc7);if(this[_0xecbd('0xab')](_0x42fbcf[_0xecbd('0x116')])){var _0x5e7128=parseInt(_0x42fbcf[_0xecbd('0x116')],0xa);var _0x368175=rs['generate']({'charset':'*','length':_0x5e7128});var _0x5de5f0=_0x4abcc7[_0xecbd('0x98')];if(_0x5de5f0>0x0){if(_0x5de5f0>_0x5e7128){this[_0xecbd('0x35')][_0xecbd('0x70')](this,_0x42fbcf,_0x42fbcf[_0xecbd('0x117')]===_0xecbd('0x118')?_0x368175+_0x4abcc7['substr'](_0x5e7128):_0x4abcc7['substr'](0x0,_0x5de5f0-_0x5e7128)+_0x368175);}else{this['createSquareDetailsReport'][_0xecbd('0x70')](this,_0x42fbcf,rs[_0xecbd('0x119')]({'charset':'*','length':_0x5de5f0}));}}else{this[_0xecbd('0x35')][_0xecbd('0x70')](this,_0x42fbcf,'');}}else{this[_0xecbd('0x35')]['sync'](this,_0x42fbcf,_0x4abcc7);}return _0x52fbe3;};AGIVertices[_0xecbd('0xe')][_0xecbd('0xc')]=function(_0x1bf1bf){logger[_0xecbd('0x2c')](util[_0xecbd('0x27')](_0xecbd('0x11a'),_0x1bf1bf[_0xecbd('0xb0')]));return this['getdigits'](_0x1bf1bf);};AGIVertices['prototype']['goal']=function(_0x108b1e){logger[_0xecbd('0x2c')](util[_0xecbd('0x27')](_0xecbd('0x11b'),_0x108b1e['label']));this[_0xecbd('0x35')][_0xecbd('0x70')](this,_0x108b1e,_0x108b1e['goalname']);return this[_0xecbd('0x36')][_0xecbd('0xac')](util[_0xecbd('0x27')]('GOAL\x20%s',_0x108b1e[_0xecbd('0x11c')]));};AGIVertices[_0xecbd('0xe')][_0xecbd('0x11d')]=function(_0x16f561){logger['info'](util[_0xecbd('0x27')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x16f561['label']));if(!this[_0xecbd('0xab')](_0x16f561[_0xecbd('0x84')])||!this['isConfigured'](_0x16f561[_0xecbd('0x85')])){return this['channel'][_0xecbd('0xac')](_0xecbd('0x11e'));}if(!this[_0xecbd('0xab')](_0x16f561['text'])){return this['channel'][_0xecbd('0xac')](_0xecbd('0xc9'));}this['channel'][_0xecbd('0xac')](util[_0xecbd('0x27')](_0xecbd('0x11f'),_0x16f561['text']));var _0x2f0cf5=this[_0xecbd('0x83')][_0xecbd('0x70')](this,_0x16f561);if(_0x2f0cf5){this[_0xecbd('0x36')][_0xecbd('0xac')](util[_0xecbd('0x27')]('aws\x20Polly\x20%s\x20file\x20created',_0x2f0cf5));var _0x146ce5=this['channel']['streamFile'](_0x2f0cf5);try{fs[_0xecbd('0xfe')](_0x2f0cf5+_0xecbd('0x100'));}catch(_0x240106){logger[_0xecbd('0x2a')](_0x240106);}return _0x146ce5;}return this['channel'][_0xecbd('0x2a')](_0x16f561,_0xecbd('0x120'));};AGIVertices['prototype']['awslex']=function(_0x4e6e16){logger[_0xecbd('0x2c')](util[_0xecbd('0x27')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x4e6e16['label']));if(!this['isConfigured'](_0x4e6e16[_0xecbd('0x84')])||!this[_0xecbd('0xab')](_0x4e6e16[_0xecbd('0x85')])){return this[_0xecbd('0x36')][_0xecbd('0xac')](_0xecbd('0x11e'));}if(!this[_0xecbd('0xab')](_0x4e6e16['aws_bot_name'])){return this['channel']['noop'](_0xecbd('0x121'));}if(!this[_0xecbd('0xab')](_0x4e6e16[_0xecbd('0x5a')])){return this[_0xecbd('0x36')][_0xecbd('0xac')]('no\x20text\x20configured');}this[_0xecbd('0x36')]['bot']=!![];this[_0xecbd('0x35')](_0x4e6e16);this['createSquareMessage'](_0x4e6e16[_0xecbd('0x5a')],'in','','');this['channel'][_0xecbd('0xac')](util['format'](_0xecbd('0x122'),_0x4e6e16['text']));var _0x47450f=this['awsLex'][_0xecbd('0x70')](this,_0x4e6e16);if(_0x47450f){for(var _0x269188 in _0x47450f){if(_0x47450f[_0xecbd('0x94')](_0x269188)&&_[_0xecbd('0x95')](_0x47450f[_0x269188])){this[_0xecbd('0x36')][_0xecbd('0xa6')](util[_0xecbd('0x27')]('AWS_LEX_%s',_0x269188[_0xecbd('0xe9')]()),_0x47450f[_0x269188]);}}if(_[_0xecbd('0x42')](_0x47450f['message'])){return this[_0xecbd('0x36')]['noop'](_0xecbd('0x123'));}else{this[_0xecbd('0x3e')](_0x47450f[_0xecbd('0x124')],_0xecbd('0xeb'),_0xecbd('0x125'),'');return this[_0xecbd('0x36')]['noop'](util[_0xecbd('0x27')](_0xecbd('0x126'),_0x47450f['message']));}}return this[_0xecbd('0x36')]['error'](_0x4e6e16,_0xecbd('0x127'));};AGIVertices[_0xecbd('0xe')][_0xecbd('0x128')]=function(_0x335920){logger[_0xecbd('0x2c')](util[_0xecbd('0x27')](_0xecbd('0x129'),_0x335920[_0xecbd('0xb0')],_0x335920[_0xecbd('0x64')]));if(!this[_0xecbd('0xab')](_0x335920[_0xecbd('0x79')])){return this[_0xecbd('0x36')][_0xecbd('0xac')](_0xecbd('0x12a'));}var _0x2da6fe=_0xecbd('0x12b');var _0x3029d5=util[_0xecbd('0x27')](_0xecbd('0x12c'),FILES_PATH,rs['generate'](0x4));var _0xc3c7e=util[_0xecbd('0x27')](_0xecbd('0x9b'),_0x3029d5,_0x2da6fe);var _0x299835=!![];if(_0x335920[_0xecbd('0x12d')]===_0xecbd('0x12e')){_0x299835=![];}var _0x37add0=this[_0xecbd('0x36')][_0xecbd('0x12f')](_0x3029d5,_0x2da6fe,_0x335920[_0xecbd('0x130')],_0x335920[_0xecbd('0x64')],undefined,_0x299835);if(_0x37add0[_0xecbd('0xa4')]!==-0x1){this[_0xecbd('0x36')][_0xecbd('0xac')](util[_0xecbd('0x27')](_0xecbd('0x131'),_0xc3c7e));var _0x520c8a=this['googleASR'][_0xecbd('0x70')](this,_0x335920,_0xc3c7e);if(_0x520c8a){for(var _0x43f868 in _0x520c8a){if(_0x520c8a['hasOwnProperty'](_0x43f868)){this[_0xecbd('0x36')]['setVariable'](util[_0xecbd('0x27')](_0xecbd('0x132'),_0x43f868['toUpperCase']()),_0x520c8a[_0x43f868]);}}return this[_0xecbd('0x36')]['noop'](util[_0xecbd('0x27')](_0xecbd('0x133'),JSON[_0xecbd('0x72')](_0x520c8a)));}}return _0x37add0;};AGIVertices[_0xecbd('0xe')][_0xecbd('0x134')]=function(_0x122eb5){logger[_0xecbd('0x2c')](util[_0xecbd('0x27')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x122eb5['label']));if(!this[_0xecbd('0xab')](_0x122eb5[_0xecbd('0x8e')])){return this[_0xecbd('0x36')][_0xecbd('0xac')](_0xecbd('0x135'));}if(!this[_0xecbd('0xab')](_0x122eb5['appsecret'])){return this[_0xecbd('0x36')][_0xecbd('0xac')](_0xecbd('0x136'));}var _0x3095c9=_0xecbd('0x12b');var _0x315249=util[_0xecbd('0x27')]('%s/recordings/%s',FILES_PATH,rs[_0xecbd('0x119')](0x4));var _0x31cb07=util['format'](_0xecbd('0x9b'),_0x315249,_0x3095c9);var _0x331d19=!![];if(_0x122eb5[_0xecbd('0x12d')]===_0xecbd('0x12e')){_0x331d19=![];}var _0x45665c=this[_0xecbd('0x36')][_0xecbd('0x12f')](_0x315249,_0x3095c9,_0x122eb5[_0xecbd('0x130')],_0x122eb5['timeout'],undefined,_0x331d19);if(_0x45665c[_0xecbd('0xa4')]!==-0x1){this[_0xecbd('0x36')][_0xecbd('0xac')](util[_0xecbd('0x27')](_0xecbd('0x137'),_0x31cb07));var _0x1c3695=this[_0xecbd('0x8d')][_0xecbd('0x70')](this,_0x122eb5,_0x31cb07);if(_0x1c3695){for(var _0x18ea74 in _0x1c3695){if(_0x1c3695['hasOwnProperty'](_0x18ea74)){this['channel'][_0xecbd('0xa6')](util[_0xecbd('0x27')](_0xecbd('0x138'),_0x18ea74[_0xecbd('0xe9')]()),_0x1c3695[_0x18ea74]);}}return this['channel']['noop'](util[_0xecbd('0x27')](_0xecbd('0x139'),JSON[_0xecbd('0x72')](_0x1c3695)));}}return _0x45665c;};AGIVertices[_0xecbd('0xe')]['gotoc']=function(_0x3ec1d1){logger['info'](util[_0xecbd('0x27')](_0xecbd('0x13a'),_0x3ec1d1['label']));return this['channel'][_0xecbd('0x13b')](_0x3ec1d1['context'],_0x3ec1d1[_0xecbd('0x13c')],_0x3ec1d1[_0xecbd('0x3b')]);};AGIVertices[_0xecbd('0xe')][_0xecbd('0x13d')]=function(_0x4292c5){logger[_0xecbd('0x2c')](util['format'](_0xecbd('0x13e'),_0x4292c5['label']));if(!this[_0xecbd('0xab')](_0x4292c5[_0xecbd('0x13f')])){return this[_0xecbd('0x36')]['error'](_0x4292c5,_0xecbd('0x140'));}try{var _0x366177=eval(_0x4292c5[_0xecbd('0x13f')])?_0xecbd('0x141'):_0xecbd('0x142');this[_0xecbd('0x36')][_0xecbd('0xac')](util[_0xecbd('0x27')](_0xecbd('0x143'),_0x4292c5[_0xecbd('0x13f')],_0x366177));return{'code':0xc8,'result':_0x366177};}catch(_0x1dd84e){return{'code':0xc8,'result':_0xecbd('0x142')};}};AGIVertices[_0xecbd('0xe')]['gotoiftime']=function(_0x2fcf19){logger[_0xecbd('0x2c')](util[_0xecbd('0x27')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x2fcf19[_0xecbd('0xb0')]));if(!this[_0xecbd('0xab')](_0x2fcf19[_0xecbd('0x144')])){return this['channel'][_0xecbd('0x2a')](_0x2fcf19,_0xecbd('0x145'));}var _0x2adc52=this[_0xecbd('0x22')][_0xecbd('0x70')](this,_0x2fcf19['interval_id']);if(!_0x2adc52){return this[_0xecbd('0x36')]['error'](_0x2fcf19,_0xecbd('0x146'));}for(var _0x5518a7=0x0;_0x5518a7<_0x2adc52['length'];_0x5518a7+=0x1){var _0x1b2b2b=this[_0xecbd('0x36')]['getVariable'](util['format'](_0xecbd('0x147'),_0x2adc52[_0x5518a7]));if(_0x1b2b2b['result']===-0x1){return _0x1b2b2b;}logger[_0xecbd('0x2c')](util[_0xecbd('0x27')]('IFTIME\x20%s\x20%s',_0x2adc52[_0x5518a7],_0x1b2b2b['extra']));if(_0x1b2b2b[_0xecbd('0xa1')]===_0xecbd('0x141')){logger['info'](util[_0xecbd('0x27')](_0xecbd('0x148'),_0x2adc52[_0x5518a7],_0xecbd('0x141')));this[_0xecbd('0x36')][_0xecbd('0xac')](util[_0xecbd('0x27')](_0xecbd('0x148'),_0x2adc52[_0x5518a7],_0xecbd('0x141')));return{'code':0xc8,'result':_0xecbd('0x141')};}else{logger['info'](util[_0xecbd('0x27')](_0xecbd('0x148'),_0x2adc52[_0x5518a7],_0xecbd('0x142')));this['channel'][_0xecbd('0xac')](util[_0xecbd('0x27')]('IFTIME\x20%s\x20%s',_0x2adc52[_0x5518a7],_0xecbd('0x142')));}}return{'code':0xc8,'result':_0xecbd('0x142')};};AGIVertices[_0xecbd('0xe')]['hangup']=function(_0x193476){logger[_0xecbd('0x2c')](util[_0xecbd('0x27')](_0xecbd('0x149'),_0x193476[_0xecbd('0xb0')]));return this[_0xecbd('0x36')][_0xecbd('0x14a')]();};AGIVertices['prototype']['ispeechasr']=function(_0x58fb0b){logger[_0xecbd('0x2c')](util[_0xecbd('0x27')](_0xecbd('0x14b'),_0x58fb0b[_0xecbd('0xb0')]));if(!this[_0xecbd('0xab')](_0x58fb0b[_0xecbd('0x79')])){return this[_0xecbd('0x36')][_0xecbd('0xac')](_0xecbd('0x12a'));}var _0x5e35c1=_0xecbd('0x12b');var _0x41380f=util[_0xecbd('0x27')](_0xecbd('0x12c'),FILES_PATH,rs[_0xecbd('0x119')](0x4));var _0x665c7a=util['format'](_0xecbd('0x9b'),_0x41380f,_0x5e35c1);var _0x3753f0=!![];if(_0x58fb0b[_0xecbd('0x12d')]===_0xecbd('0x12e')){_0x3753f0=![];}var _0x7730ce=this[_0xecbd('0x36')][_0xecbd('0x12f')](_0x41380f,_0x5e35c1,_0x58fb0b[_0xecbd('0x130')],_0x58fb0b[_0xecbd('0x64')],undefined,_0x3753f0);if(_0x7730ce[_0xecbd('0xa4')]!==-0x1){this[_0xecbd('0x36')][_0xecbd('0xac')](util[_0xecbd('0x27')](_0xecbd('0x14c'),_0x665c7a));var _0x41ca43=this[_0xecbd('0x82')][_0xecbd('0x70')](this,_0x58fb0b,_0x665c7a);if(_0x41ca43){for(var _0x30958d in _0x41ca43){if(_0x41ca43[_0xecbd('0x94')](_0x30958d)){this[_0xecbd('0x36')][_0xecbd('0xa6')](util['format']('ISPEECH_ASR_%s',_0x30958d[_0xecbd('0xe9')]()),_0x41ca43[_0x30958d]);}}return this[_0xecbd('0x36')][_0xecbd('0xac')](util[_0xecbd('0x27')]('IspeechASR\x20Result\x20%s',JSON[_0xecbd('0x72')](_0x41ca43)));}}return _0x7730ce;};AGIVertices[_0xecbd('0xe')][_0xecbd('0x14d')]=function(_0x45a283){logger[_0xecbd('0x2c')](util[_0xecbd('0x27')](_0xecbd('0x14e'),_0x45a283[_0xecbd('0xb0')]));if(!this['isConfigured'](_0x45a283[_0xecbd('0x79')])){return this['channel'][_0xecbd('0xac')](_0xecbd('0x12a'));}if(!this[_0xecbd('0xab')](_0x45a283[_0xecbd('0x5a')])){return this[_0xecbd('0x36')][_0xecbd('0xac')](_0xecbd('0xc9'));}this[_0xecbd('0x36')][_0xecbd('0xac')](util[_0xecbd('0x27')](_0xecbd('0x14f'),_0x45a283[_0xecbd('0x5a')]));var _0x563abb=this[_0xecbd('0x7f')][_0xecbd('0x70')](this,_0x45a283);if(_0x563abb){this[_0xecbd('0x36')][_0xecbd('0xac')](util[_0xecbd('0x27')](_0xecbd('0x14c'),_0x563abb));var _0x4e8033=this[_0xecbd('0x36')]['streamFile'](_0x563abb,_0x45a283[_0xecbd('0x130')]);try{fs[_0xecbd('0xfe')](_0x563abb+'.wav');}catch(_0x321d8f){logger['error'](_0x321d8f);}return _0x4e8033;}return this['channel'][_0xecbd('0x2a')](_0x45a283,_0xecbd('0x150'));};AGIVertices[_0xecbd('0xe')][_0xecbd('0x151')]=function(_0x308817){logger[_0xecbd('0x2c')](util[_0xecbd('0x27')](_0xecbd('0x152'),_0x308817[_0xecbd('0xb0')]));if(!this[_0xecbd('0xab')](_0x308817[_0xecbd('0x153')])){return this['channel'][_0xecbd('0x2a')](_0x308817,_0xecbd('0x154'));}logger[_0xecbd('0x2c')](util[_0xecbd('0x27')](_0xecbd('0x155'),this['channel'][_0xecbd('0x38')],_0x308817[_0xecbd('0x153')]));var _0x103368=this[_0xecbd('0x4f')][_0xecbd('0x70')](this,_0x308817[_0xecbd('0x153')]);if(_0x103368){logger[_0xecbd('0x2c')](util[_0xecbd('0x27')](_0xecbd('0x156'),this[_0xecbd('0x36')][_0xecbd('0x38')],_0x308817[_0xecbd('0x153')]));this[_0xecbd('0x36')][_0xecbd('0xac')](util[_0xecbd('0x27')](_0xecbd('0x156'),this[_0xecbd('0x36')][_0xecbd('0x38')],_0x308817['findBy']));return{'code':0xc8,'result':_0xecbd('0x157')};}else{logger['info'](util['format'](_0xecbd('0x158'),this[_0xecbd('0x36')][_0xecbd('0x38')],_0x308817[_0xecbd('0x153')]));this[_0xecbd('0x36')][_0xecbd('0xac')](util[_0xecbd('0x27')](_0xecbd('0x158'),this[_0xecbd('0x36')][_0xecbd('0x38')],_0x308817['findBy']));return{'code':0xc8,'result':_0xecbd('0x159')};}};AGIVertices['prototype']['logout']=function(_0x19851d){logger[_0xecbd('0x2c')](util[_0xecbd('0x27')](_0xecbd('0x15a'),_0x19851d['label']));if(!this[_0xecbd('0xab')](_0x19851d[_0xecbd('0x153')])){return this[_0xecbd('0x36')][_0xecbd('0x2a')](_0x19851d,_0xecbd('0x154'));}logger['info'](util[_0xecbd('0x27')](_0xecbd('0x155'),this[_0xecbd('0x36')][_0xecbd('0x38')],_0x19851d[_0xecbd('0x153')]));var _0x52005d=this[_0xecbd('0x4e')][_0xecbd('0x70')](this,_0x19851d[_0xecbd('0x153')]);if(_0x52005d){logger[_0xecbd('0x2c')](util[_0xecbd('0x27')](_0xecbd('0x156'),this[_0xecbd('0x36')][_0xecbd('0x38')],_0x19851d[_0xecbd('0x153')]));this['channel'][_0xecbd('0xac')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xecbd('0x36')][_0xecbd('0x38')],_0x19851d[_0xecbd('0x153')]));return{'code':0xc8,'result':_0xecbd('0x157')};}else{logger[_0xecbd('0x2c')](util[_0xecbd('0x27')](_0xecbd('0x158'),this['channel'][_0xecbd('0x38')],_0x19851d[_0xecbd('0x153')]));this[_0xecbd('0x36')][_0xecbd('0xac')](util[_0xecbd('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xecbd('0x36')][_0xecbd('0x38')],_0x19851d[_0xecbd('0x153')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xecbd('0xe')]['math']=function(_0x2710c8){logger[_0xecbd('0x2c')](util[_0xecbd('0x27')](_0xecbd('0x15b'),_0x2710c8[_0xecbd('0xb0')]));if(!this[_0xecbd('0xab')](_0x2710c8[_0xecbd('0x15c')])){return this[_0xecbd('0x36')]['error'](_0x2710c8,_0xecbd('0x15d'));}this['channel'][_0xecbd('0xac')](util[_0xecbd('0x27')]('math\x20%s',_0x2710c8[_0xecbd('0x15c')]));var _0x144def=eval(_0x2710c8['operation']);if(!this[_0xecbd('0xab')](_0x2710c8[_0xecbd('0xd8')])){return this[_0xecbd('0x36')][_0xecbd('0xac')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x8e78bb=this[_0xecbd('0xa0')][_0xecbd('0x70')](this,_0x2710c8['variable_id']);if(!_0x8e78bb){return this[_0xecbd('0x36')][_0xecbd('0x2a')](_0x2710c8,_0xecbd('0xd9'));}if(_[_0xecbd('0x97')](_0x144def)){var _0x3babc0=this;_0x144def[_0xecbd('0xda')](function(_0x2d4765,_0x36e20d){_0x3babc0[_0xecbd('0x36')][_0xecbd('0xa6')](util[_0xecbd('0x27')](_0xecbd('0x15e'),_0x8e78bb,_0x36e20d),_0x2d4765);});return this[_0xecbd('0x36')][_0xecbd('0xac')](util[_0xecbd('0x27')](_0xecbd('0x15f'),_0x8e78bb));}else{return this[_0xecbd('0x36')][_0xecbd('0xa6')](_0x8e78bb,_0x144def);}};AGIVertices[_0xecbd('0xe')][_0xecbd('0xa')]=function(_0x51396f){logger['info'](util[_0xecbd('0x27')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x51396f[_0xecbd('0xb0')]));if(_0x51396f['retry']===0x0){return this[_0xecbd('0xa8')](_0x51396f);}_0x51396f[_0xecbd('0xa7')]-=0x1;if(!this[_0xecbd('0xab')](_0x51396f['file_id'])){return this[_0xecbd('0x36')][_0xecbd('0x2a')](_0x51396f,_0xecbd('0x160'));}var _0x1eafaa=this[_0xecbd('0x1b')][_0xecbd('0x70')](this,_0x51396f[_0xecbd('0x10e')]);if(!_0x1eafaa){return this[_0xecbd('0x36')]['error'](_0x51396f,_0xecbd('0x10f'));}var _0x54fe96=this[_0xecbd('0x36')][_0xecbd('0x111')](_0x1eafaa,_0x51396f[_0xecbd('0x112')],_0x51396f[_0xecbd('0x161')]);var _0xfb8ce0=_0x54fe96[_0xecbd('0xa4')];if(_0x54fe96[_0xecbd('0xa4')]===-0x1){this[_0xecbd('0x35')][_0xecbd('0x70')](this,_0x51396f,'-1');return _0x54fe96;}else if(_0x54fe96[_0xecbd('0xa1')]===_0xecbd('0x64')){_0x54fe96[_0xecbd('0xa4')]=_0x54fe96[_0xecbd('0xa4')][_0xecbd('0x98')]>0x0?_0x54fe96[_0xecbd('0xa4')]:'t';}else if(_[_0xecbd('0x41')](_0x54fe96[_0xecbd('0xa4')])){_0x54fe96[_0xecbd('0xa4')]='#';_0xfb8ce0='#';}if(!this[_0xecbd('0xab')](_0x51396f[_0xecbd('0xd8')])){this[_0xecbd('0x36')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x612388=this[_0xecbd('0xa0')]['sync'](this,_0x51396f['variable_id']);if(!_0x612388){return this['channel'][_0xecbd('0x2a')](_0x51396f,_0xecbd('0xd9'));}this[_0xecbd('0x36')][_0xecbd('0xa6')](_0x612388,_0xfb8ce0);}this[_0xecbd('0x35')][_0xecbd('0x70')](this,_0x51396f,_0xfb8ce0);return _0x54fe96;};AGIVertices[_0xecbd('0xe')][_0xecbd('0xac')]=function(_0x31dc91){logger[_0xecbd('0x2c')](util[_0xecbd('0x27')](_0xecbd('0x162'),_0x31dc91[_0xecbd('0xb0')]));return this[_0xecbd('0x36')][_0xecbd('0xac')](_0x31dc91['output']||_0x31dc91[_0xecbd('0xb0')]);};AGIVertices[_0xecbd('0xe')][_0xecbd('0x163')]=function(_0x275f7f){logger['info'](util[_0xecbd('0x27')](_0xecbd('0x164'),_0x275f7f[_0xecbd('0xb0')]));if(!this[_0xecbd('0xab')](_0x275f7f[_0xecbd('0x153')])){return this[_0xecbd('0x36')]['error'](_0x275f7f,_0xecbd('0x154'));}logger[_0xecbd('0x2c')](util[_0xecbd('0x27')](_0xecbd('0x155'),this[_0xecbd('0x36')]['callerid'],_0x275f7f['findBy']));var _0x4788c5=this[_0xecbd('0x165')][_0xecbd('0x70')](this,_0x275f7f[_0xecbd('0x166')]);var _0x435a36=this['agentPause'][_0xecbd('0x70')](this,_0x275f7f['findBy'],_0x4788c5);if(_0x435a36){logger[_0xecbd('0x2c')](util[_0xecbd('0x27')](_0xecbd('0x156'),this[_0xecbd('0x36')][_0xecbd('0x38')],_0x275f7f['findBy']));this[_0xecbd('0x36')][_0xecbd('0xac')](util[_0xecbd('0x27')](_0xecbd('0x156'),this[_0xecbd('0x36')][_0xecbd('0x38')],_0x275f7f['findBy']));return{'code':0xc8,'result':_0xecbd('0x157')};}else{logger[_0xecbd('0x2c')](util[_0xecbd('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xecbd('0x36')]['callerid'],_0x275f7f[_0xecbd('0x153')]));this[_0xecbd('0x36')][_0xecbd('0xac')](util[_0xecbd('0x27')](_0xecbd('0x156'),this[_0xecbd('0x36')]['callerid'],_0x275f7f[_0xecbd('0x153')]));return{'code':0xc8,'result':_0xecbd('0x159')};}};AGIVertices[_0xecbd('0xe')][_0xecbd('0x167')]=function(_0x4c60b8){logger[_0xecbd('0x2c')](util[_0xecbd('0x27')](_0xecbd('0x168'),_0x4c60b8[_0xecbd('0xb0')]));if(!this['isConfigured'](_0x4c60b8[_0xecbd('0x10e')])){return this[_0xecbd('0x36')]['error'](_0x4c60b8,_0xecbd('0x160'));}var _0x526eaf=this[_0xecbd('0x1b')][_0xecbd('0x70')](this,_0x4c60b8[_0xecbd('0x10e')]);if(!_0x526eaf){return this[_0xecbd('0x36')][_0xecbd('0x2a')](_0x4c60b8,'no\x20file\x20audio\x20found');}var _0x3c9e55=this[_0xecbd('0x36')][_0xecbd('0x54')](_0xecbd('0x169'),[_0x526eaf,_0x4c60b8['opts']]);if(_0x3c9e55[_0xecbd('0xa4')]===-0x1){return _0x3c9e55;}return this[_0xecbd('0x36')][_0xecbd('0xac')](util['format'](_0xecbd('0xc6'),_0xecbd('0x169'),_0x526eaf));};AGIVertices['prototype']['queue']=function(_0x1ba968){logger[_0xecbd('0x2c')](util['format']('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x1ba968[_0xecbd('0xb0')]));if(!this[_0xecbd('0xab')](_0x1ba968[_0xecbd('0x16a')])){return this[_0xecbd('0x36')][_0xecbd('0x2a')](_0x1ba968,_0xecbd('0x16b'));}var _0x4b6d06='';var _0x29fe66=parseInt(_0x1ba968[_0xecbd('0x16a')],0xa);if(isNaN(_0x29fe66)){_0x4b6d06=_0x1ba968[_0xecbd('0x16a')];}else{_0x4b6d06=this[_0xecbd('0x13')]['sync'](this,_0x1ba968[_0xecbd('0x16a')]);if(!_0x4b6d06){return this[_0xecbd('0x36')]['error'](_0x1ba968,_0xecbd('0x16c'));}}var _0x411ddd='';if(this[_0xecbd('0xab')](_0x1ba968[_0xecbd('0x10e')])){var _0x397062=this[_0xecbd('0x1b')][_0xecbd('0x70')](this,_0x1ba968['file_id']);if(_0x397062){_0x411ddd=_0x397062;}}this['createSquareDetailsReport'][_0xecbd('0x70')](this,_0x1ba968,_0x4b6d06);if(_0x1ba968[_0xecbd('0xe3')][_0xecbd('0x16d')]('x')<0x0){_0x1ba968[_0xecbd('0xe3')]+='x';}if(_0x1ba968['opts'][_0xecbd('0x16d')]('X')<0x0){_0x1ba968[_0xecbd('0xe3')]+='X';}this[_0xecbd('0x36')][_0xecbd('0xa6')](_0xecbd('0x16e'),_0x4b6d06?_0x4b6d06[_0xecbd('0x16f')]():'');var _0x13c484=this['channel'][_0xecbd('0x54')]('QUEUE',[_0x4b6d06,_0x1ba968[_0xecbd('0xe3')],_0x1ba968['url'],_0x411ddd,_0x1ba968[_0xecbd('0x64')],_0x1ba968['agi'],_0x1ba968[_0xecbd('0x170')],_0x1ba968[_0xecbd('0x171')],'',_0x1ba968[_0xecbd('0x172')]]);if(_0x13c484[_0xecbd('0xa4')]===-0x1){return _0x13c484;}return this[_0xecbd('0x36')]['noop'](util[_0xecbd('0x27')](_0xecbd('0xc6'),_0xecbd('0x173'),_0x4b6d06));};AGIVertices[_0xecbd('0xe')][_0xecbd('0x174')]=function(_0x30edc1){logger[_0xecbd('0x2c')](util[_0xecbd('0x27')](_0xecbd('0x175'),_0x30edc1[_0xecbd('0xb0')]));var _0x106324=_0x30edc1['recordingFormat']||'wav';var _0x4cbad9=util[_0xecbd('0x27')]('%s_%s',this[_0xecbd('0x36')][_0xecbd('0x3f')],rs[_0xecbd('0x119')](0x5));var _0xd95018=util[_0xecbd('0x27')](_0xecbd('0x176'),FILES_PATH,_0x4cbad9,_0x106324);var _0x4b8fd6=util[_0xecbd('0x27')]('%s/recordings/%s',FILES_PATH,_0x4cbad9);this['createSquareRecording'][_0xecbd('0x70')](this,_0x30edc1,_0x4cbad9,_0xd95018);this[_0xecbd('0x36')][_0xecbd('0xa6')]('RECORDING_SAVENAME',_0x4cbad9);logger['info'](_0xecbd('0x177'),_0x4b8fd6,_0x106324,_0x30edc1['escape_digits'],_0x30edc1[_0xecbd('0x64')]);return this[_0xecbd('0x36')][_0xecbd('0x12f')](_0x4b8fd6,_0x106324,_0x30edc1[_0xecbd('0x178')],_0x30edc1['timeout'],undefined,!![]);};AGIVertices['prototype'][_0xecbd('0x179')]=function(_0x2eae98){logger['info'](util[_0xecbd('0x27')](_0xecbd('0x17a'),_0x2eae98[_0xecbd('0xb0')]));if(!this[_0xecbd('0xab')](_0x2eae98[_0xecbd('0x62')])){return this['channel'][_0xecbd('0xac')](_0xecbd('0x17b'));}var _0x5c01f8=this[_0xecbd('0x61')][_0xecbd('0x70')](this,_0x2eae98);logger[_0xecbd('0x2c')](util[_0xecbd('0x27')](_0xecbd('0x17c'),util[_0xecbd('0x17d')](_0x5c01f8,{'showHidden':![],'depth':null})));if(!this[_0xecbd('0xab')](_0x2eae98[_0xecbd('0xd8')])){return this[_0xecbd('0x36')][_0xecbd('0xac')](_0xecbd('0x17e'));}var _0x4f897b=this[_0xecbd('0xa0')]['sync'](this,_0x2eae98[_0xecbd('0xd8')]);if(!_0x4f897b){return this['channel']['error'](_0x2eae98,_0xecbd('0xd9'));}this[_0xecbd('0x36')][_0xecbd('0xa6')](util[_0xecbd('0x27')](_0xecbd('0x17f'),_0x4f897b),_0x5c01f8[_0xecbd('0x74')]?_0x5c01f8['statusCode']:_0xecbd('0x180'));this['channel']['setVariable'](util[_0xecbd('0x27')](_0xecbd('0x181'),_0x4f897b),_0x5c01f8[_0xecbd('0x75')]?_0x5c01f8[_0xecbd('0x75')]:'OK');if(_0x5c01f8[_0xecbd('0x68')]){try{this[_0xecbd('0x99')](_0x5c01f8[_0xecbd('0x68')],_0x4f897b);}catch(_0x914208){logger[_0xecbd('0x2a')](util[_0xecbd('0x27')](_0xecbd('0x182'),_0x4f897b));}}return this[_0xecbd('0x36')][_0xecbd('0xac')](util[_0xecbd('0x27')](_0xecbd('0x183'),_0x4f897b));};AGIVertices[_0xecbd('0xe')][_0xecbd('0x184')]=function(_0x52423c){logger[_0xecbd('0x2c')](util['format'](_0xecbd('0x185'),_0x52423c[_0xecbd('0xb0')]));return this['channel']['sayDigits'](_0x52423c[_0xecbd('0x186')][_0xecbd('0x56')](/\s+/g,''),_0x52423c[_0xecbd('0x178')]);};AGIVertices[_0xecbd('0xe')]['saynumber']=function(_0x5615b8){logger[_0xecbd('0x2c')](util[_0xecbd('0x27')](_0xecbd('0x187'),_0x5615b8[_0xecbd('0xb0')]));return this[_0xecbd('0x36')][_0xecbd('0x188')](_0x5615b8[_0xecbd('0x189')]['replace'](/\s+/g,''),_0x5615b8[_0xecbd('0x178')]);};AGIVertices[_0xecbd('0xe')]['sayphonetic']=function(_0x5a7444){logger[_0xecbd('0x2c')](util['format'](_0xecbd('0x18a'),_0x5a7444[_0xecbd('0xb0')]));return this[_0xecbd('0x36')]['sayPhonetic'](_0x5a7444[_0xecbd('0x5a')],_0x5a7444[_0xecbd('0x178')]);};AGIVertices[_0xecbd('0xe')]['sendMail']=function(_0x2e792c){logger[_0xecbd('0x2c')](util[_0xecbd('0x27')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x2e792c[_0xecbd('0xb0')]));if(!this[_0xecbd('0xab')](_0x2e792c['account_id'])){return this[_0xecbd('0x36')][_0xecbd('0xac')](_0xecbd('0x18b'));}var _0x43ec4e=this[_0xecbd('0x1e')][_0xecbd('0x70')](this,_0x2e792c['account_id']);if(!_0x43ec4e||!_0x43ec4e[_0xecbd('0x18c')]){return this[_0xecbd('0x36')]['error'](_0x2e792c,'no\x20mail\x20account\x20found');}var _0x64dbfe={'from':util[_0xecbd('0x27')]('\x22%s\x22\x20<%s>',_0x43ec4e[_0xecbd('0x11')],_0x43ec4e[_0xecbd('0x18d')]||_0x43ec4e[_0xecbd('0x18c')]['user']),'to':_0x2e792c['to']||'','cc':_0x2e792c['cc']||'','bcc':_0x2e792c['bcc']||'','subject':_0x2e792c[_0xecbd('0x18e')],'html':_0x2e792c[_0xecbd('0x5a')],'text':_0x2e792c['text']};if(this[_0xecbd('0xab')](_0x2e792c[_0xecbd('0x18f')])){}logger[_0xecbd('0xde')]('sendMail\x20message',JSON[_0xecbd('0x72')](_0x64dbfe));this['createSquareDetailsReport'][_0xecbd('0x70')](this,_0x2e792c,_0x2e792c[_0xecbd('0x190')]);this[_0xecbd('0x36')][_0xecbd('0xac')](util[_0xecbd('0x27')](_0xecbd('0x191'),_0x43ec4e[_0xecbd('0x11')]));this[_0xecbd('0x20')][_0xecbd('0x70')](this,_0x43ec4e[_0xecbd('0x192')],_0x64dbfe);return this[_0xecbd('0x36')]['noop'](_0xecbd('0x193'));};AGIVertices[_0xecbd('0xe')][_0xecbd('0x194')]=function(_0x532249){logger[_0xecbd('0x2c')](util[_0xecbd('0x27')](_0xecbd('0x195'),_0x532249[_0xecbd('0xb0')]));return this[_0xecbd('0x36')][_0xecbd('0xac')](_0xecbd('0x196'));};AGIVertices[_0xecbd('0xe')][_0xecbd('0x197')]=function(_0x20f3b){logger[_0xecbd('0x2c')](util['format'](_0xecbd('0x198'),_0x20f3b[_0xecbd('0xb0')]));if(!this[_0xecbd('0xab')](_0x20f3b[_0xecbd('0x199')])){return this[_0xecbd('0x36')]['noop']('no\x20sms\x20account\x20configured');}var _0x22e95d=this['getSmsAccount'][_0xecbd('0x70')](this,_0x20f3b[_0xecbd('0x199')]);if(!_0x22e95d){return this[_0xecbd('0x36')]['error'](_0x20f3b,_0xecbd('0x19a'));}var _0x28f77b={'body':_0x20f3b[_0xecbd('0x19b')],'phone':_0x20f3b['to']||'','SmsAccountId':_0x22e95d['id']};logger['debug'](_0xecbd('0x19c'),JSON[_0xecbd('0x72')](_0x28f77b));this['createSquareDetailsReport']['sync'](this,_0x20f3b,_0x20f3b[_0xecbd('0x199')]);this[_0xecbd('0x36')][_0xecbd('0xac')](util[_0xecbd('0x27')](_0xecbd('0x19d'),_0x22e95d[_0xecbd('0x11')]));this[_0xecbd('0x34')][_0xecbd('0x70')](this,_0x28f77b);return this['channel']['noop']('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xecbd('0xe')][_0xecbd('0x19e')]=function(_0x423c87){logger['info'](util[_0xecbd('0x27')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x423c87[_0xecbd('0xb0')]));if(!this[_0xecbd('0xab')](_0x423c87[_0xecbd('0xd8')])){return this[_0xecbd('0x36')][_0xecbd('0x2a')](_0x423c87,_0xecbd('0x19f'));}var _0x20ef47=this[_0xecbd('0xa0')][_0xecbd('0x70')](this,_0x423c87['variable_id']);if(!_0x20ef47){return this[_0xecbd('0x36')][_0xecbd('0x2a')](_0x423c87,_0xecbd('0xd9'));}return this['channel'][_0xecbd('0xa6')](_0x20ef47,_0x423c87[_0xecbd('0x1a0')]);};AGIVertices[_0xecbd('0xe')][_0xecbd('0x1a1')]=function(_0x125bc6){logger[_0xecbd('0x2c')](util[_0xecbd('0x27')](_0xecbd('0x1a2'),_0x125bc6[_0xecbd('0xb0')]));this[_0xecbd('0x36')][_0xecbd('0xac')](_0xecbd('0x1a3'));if(_0x125bc6[_0xecbd('0xbc')]==='yes'){this['channel'][_0xecbd('0xac')]('Answer');return this[_0xecbd('0x36')][_0xecbd('0xbc')]();}return this[_0xecbd('0x36')][_0xecbd('0xac')](_0xecbd('0x1a4'));};AGIVertices['prototype']['subproject']=function(_0xf1c872){logger['info'](util[_0xecbd('0x27')](_0xecbd('0x1a5'),_0xf1c872[_0xecbd('0xb0')]));if(!this[_0xecbd('0xab')](_0xf1c872[_0xecbd('0x1a6')])){return this[_0xecbd('0x36')][_0xecbd('0x2a')](_0xf1c872,_0xecbd('0x1a7'));}var _0x388747=this[_0xecbd('0x15')]['sync'](this,_0xf1c872[_0xecbd('0x1a6')]);if(!this['isConfigured'](_0x388747)){return this[_0xecbd('0x36')][_0xecbd('0x2a')](_0xf1c872,util['format']('no\x20subproject\x20found\x20with\x20id\x20%d',_0xf1c872[_0xecbd('0x1a6')]));}if(_0x388747===this[_0xecbd('0x36')][_0xecbd('0x37')]){return this[_0xecbd('0x36')]['error'](_0xf1c872,_0xecbd('0x1a8'));}this[_0xecbd('0x35')]['sync'](this,_0xf1c872,_0x388747);var _0x13790b=this['channel']['exec']('AGI',util[_0xecbd('0x27')](_0xecbd('0x1a9'),config['agi']['host']||_0xecbd('0x1aa'),_0x388747,this[_0xecbd('0x36')][_0xecbd('0x37')]));if(_0x13790b[_0xecbd('0xa4')]===-0x1){return _0x13790b;}return this['channel'][_0xecbd('0xac')](util[_0xecbd('0x27')](_0xecbd('0xc6'),_0xecbd('0x1ab'),_0x388747));};AGIVertices[_0xecbd('0xe')][_0xecbd('0x1ac')]=function(_0x1b396b){logger[_0xecbd('0x2c')](util[_0xecbd('0x27')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x1b396b[_0xecbd('0xb0')]));var _0x5e0be0=this[_0xecbd('0x53')][_0xecbd('0x70')](this,_0x1b396b[_0xecbd('0xba')]);this[_0xecbd('0x35')][_0xecbd('0x70')](this,_0x1b396b,_0x1b396b[_0xecbd('0xba')]);if(this[_0xecbd('0xab')](_0x1b396b[_0xecbd('0xd8')])){var _0x45ca69=this['getVariable'][_0xecbd('0x70')](this,_0x1b396b[_0xecbd('0xd8')]);if(_0x45ca69){this[_0xecbd('0x36')]['setVariable'](_0x45ca69,_0x5e0be0);return this[_0xecbd('0x36')][_0xecbd('0xac')](util[_0xecbd('0x27')](_0xecbd('0x1ad'),_0x1b396b['command'],_0x45ca69));}}return this[_0xecbd('0x36')][_0xecbd('0xac')](util[_0xecbd('0x27')](_0xecbd('0x1ae'),_0x1b396b['command']));};AGIVertices[_0xecbd('0xe')][_0xecbd('0x1af')]=function(_0xcb9957){logger[_0xecbd('0x2c')](util[_0xecbd('0x27')](_0xecbd('0x1b0'),_0xcb9957['label']));_0xcb9957[_0xecbd('0x5a')]=_0xcb9957['text'][_0xecbd('0x56')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0xcb9957[_0xecbd('0x58')])){return this['channel']['noop'](_0xecbd('0x1b1'));}if(!this['isConfigured'](_0xcb9957[_0xecbd('0x5a')])){return this[_0xecbd('0x36')]['noop'](_0xecbd('0xc9'));}this[_0xecbd('0x36')][_0xecbd('0xac')](util['format'](_0xecbd('0x1b2'),_0xcb9957['text']));var _0x554f8a=this[_0xecbd('0x57')][_0xecbd('0x70')](this,_0xcb9957);if(_0x554f8a){this[_0xecbd('0x36')][_0xecbd('0xac')](util['format'](_0xecbd('0x1b3'),_0x554f8a));var _0x4a2dab=this[_0xecbd('0x36')]['streamFile'](_0x554f8a);try{fs[_0xecbd('0xfe')](_0x554f8a+_0xecbd('0x100'));}catch(_0x40a522){logger[_0xecbd('0x2a')](_0x40a522);}return _0x4a2dab;}return this[_0xecbd('0x36')][_0xecbd('0x2a')](_0xcb9957,_0xecbd('0x1b4'));};AGIVertices[_0xecbd('0xe')][_0xecbd('0x1b5')]=function(_0xb8c054){logger['info'](util['format']('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0xb8c054[_0xecbd('0xb0')]));_0xb8c054[_0xecbd('0x5a')]=_0xb8c054[_0xecbd('0x5a')][_0xecbd('0x56')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xecbd('0xab')](_0xb8c054['text'])){return this[_0xecbd('0x36')][_0xecbd('0xac')](_0xecbd('0xc9'));}this[_0xecbd('0x36')][_0xecbd('0xac')](util['format'](_0xecbd('0x1b6'),_0xb8c054['text']));var _0x47250e=this[_0xecbd('0x5f')][_0xecbd('0x70')](this,_0xb8c054);if(_0x47250e){this[_0xecbd('0x36')][_0xecbd('0xac')](util['format'](_0xecbd('0x1b7'),_0x47250e));var _0x59cf1b=this[_0xecbd('0x36')][_0xecbd('0x1b8')](_0x47250e);try{fs[_0xecbd('0xfe')](_0x47250e+_0xecbd('0x100'));}catch(_0x540f66){logger[_0xecbd('0x2a')](_0x540f66);}return _0x59cf1b;}return this[_0xecbd('0x36')]['error'](_0xb8c054,_0xecbd('0x1b9'));};AGIVertices[_0xecbd('0xe')][_0xecbd('0x1ba')]=function(_0x193890){logger[_0xecbd('0x2c')](util[_0xecbd('0x27')](_0xecbd('0x1bb'),_0x193890['label']));if(!this[_0xecbd('0xab')](_0x193890[_0xecbd('0x153')])){return this['channel']['error'](_0x193890,'no\x20find\x20by\x20configured');}logger[_0xecbd('0x2c')](util[_0xecbd('0x27')](_0xecbd('0x155'),this['channel'][_0xecbd('0x38')],_0x193890[_0xecbd('0x153')]));var _0x155ccb=this[_0xecbd('0x4c')]['sync'](this,_0x193890['findBy']);if(_0x155ccb){logger[_0xecbd('0x2c')](util['format'](_0xecbd('0x156'),this[_0xecbd('0x36')]['callerid'],_0x193890['findBy']));this[_0xecbd('0x36')][_0xecbd('0xac')](util[_0xecbd('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xecbd('0x36')][_0xecbd('0x38')],_0x193890[_0xecbd('0x153')]));return{'code':0xc8,'result':_0xecbd('0x157')};}else{logger[_0xecbd('0x2c')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xecbd('0x38')],_0x193890[_0xecbd('0x153')]));this[_0xecbd('0x36')]['noop'](util[_0xecbd('0x27')](_0xecbd('0x158'),this[_0xecbd('0x36')][_0xecbd('0x38')],_0x193890[_0xecbd('0x153')]));return{'code':0xc8,'result':_0xecbd('0x159')};}};AGIVertices[_0xecbd('0xe')][_0xecbd('0x1bc')]=function(_0x268e90){logger['info'](util[_0xecbd('0x27')](_0xecbd('0x1bd'),_0x268e90[_0xecbd('0xb0')]));var _0x4ce130=this[_0xecbd('0x36')][_0xecbd('0x54')](_0xecbd('0x1be'),[_0x268e90['mailbox'],_0x268e90[_0xecbd('0x77')]]);if(_0x4ce130[_0xecbd('0xa4')]===-0x1){return _0x4ce130;}return this[_0xecbd('0x36')]['noop'](util[_0xecbd('0x27')](_0xecbd('0xc6'),_0xecbd('0x1be'),_0x268e90[_0xecbd('0x1bf')]));};AGIVertices['prototype']['vswitch']=function(_0x3baa1d){logger['info'](util[_0xecbd('0x27')](_0xecbd('0x1c0'),_0x3baa1d[_0xecbd('0xb0')]));if(!this['isConfigured'](_0x3baa1d[_0xecbd('0xd8')])){return this[_0xecbd('0x36')][_0xecbd('0x2a')](_0x3baa1d,_0xecbd('0x19f'));}var _0x94132f=this[_0xecbd('0xa0')][_0xecbd('0x70')](this,_0x3baa1d[_0xecbd('0xd8')]);if(!_0x94132f){return this[_0xecbd('0x36')][_0xecbd('0x2a')](_0x3baa1d,_0xecbd('0xd9'));}var _0x5f488a=this[_0xecbd('0x36')][_0xecbd('0xa0')](_0x94132f);return{'code':0xc8,'result':_0x5f488a[_0xecbd('0xa1')]?_0x5f488a[_0xecbd('0xa1')]:'-'};};String[_0xecbd('0xe')][_0xecbd('0x9f')]=function(_0x4e5e26,_0x2d9e3c){return this['split'](_0x4e5e26)[_0xecbd('0x1c1')](_0x2d9e3c);};module[_0xecbd('0x1c2')]=AGIVertices; \ No newline at end of file +var _0x8caf=['getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunkById','getSound','getSoundPath','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','%s/sounds/converted/%s','getQueryOdbc','open','query','Error\x20executing\x20query\x20%s','info','Query\x20executed\x20correctly\x20%s','close','error','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','label','agicommand','arg_1','createSquareRecording','uniqueid','callerid','context','extension','priority','dnid','file','createSquareMessage','createCmContact','isEmpty','callback_','random','isNil','lastName','phone','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPauseById','agentPause','agentUnpause','agent','agentLogout','internal','format','LOCAL','agentLogin','shellCommand','exec','replace','googleCloudTTS','text','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','method','timeout','includes','POST','toUpperCase','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','url','stringify','body','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','googleDialogflowV2','dialogflowV2_project_id','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','saveRestApiResult','%s.%s','setVariable','split','length','extra','getAndSetVariable','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','isConfigured','noop','no\x20text\x20configured','MRCPSynth','mrcprecog','grammar','MRCPRecog','result','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','sestektts','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','keys','forEach','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','Trying\x20Dialogflow:\x20%s','out','speech','Dialogflow\x20is\x20unreachable','no\x20project_id\x20configured','private_key','bot','Trying\x20DialogflowV2:\x20%s','dialogflowV2','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','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','getTrunk','no\x20trunk\x20found','trunk_name','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','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','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','amazonlex','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','no\x20appid\x20configured','no\x20appsecret\x20configured','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','false','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','wav','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','login','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','failure','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','no\x20variable\x20found','variable\x20%s[key]\x20set','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','getPause','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','QUEUE','macro','gosub','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','%s/recordings/%s.%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','Response:','no\x20variable\x20selected\x20for\x20the\x20response','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','sayDigits','digits','sayNumber','number','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','no\x20mail\x20account\x20configured','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','user','subject','template_id','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20found','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','set','no\x20variable\x20selected','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','host','127.0.0.1','system','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','join','exports','lodash','shelljs','odbc','randomstring','moment','mustache','../../config/logger','agi','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawBody','menu','getdigits','getsecretdigits','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById'];(function(_0xc83a01,_0x4dfcb5){var _0x2a162c=function(_0x14f528){while(--_0x14f528){_0xc83a01['push'](_0xc83a01['shift']());}};_0x2a162c(++_0x4dfcb5);}(_0x8caf,0x1ab));var _0xf8ca=function(_0x3f22e8,_0x37732a){_0x3f22e8=_0x3f22e8-0x0;var _0x368a7e=_0x8caf[_0x3f22e8];return _0x368a7e;};'use strict';var fs=require('fs');var util=require('util');var _=require(_0xf8ca('0x0'));var sh=require(_0xf8ca('0x1'));var odbc=require(_0xf8ca('0x2'))();var rs=require(_0xf8ca('0x3'));var moment=require(_0xf8ca('0x4'));var Mustache=require(_0xf8ca('0x5'));var rp=require('request-promise');var logger=require(_0xf8ca('0x6'))(_0xf8ca('0x7'));var config=require(_0xf8ca('0x8'));var shared=require(_0xf8ca('0x9'));var scripts=require(_0xf8ca('0xa'));var FILES_PATH=_0xf8ca('0xb');var recursiveMapAttributes=['rawHeaders',_0xf8ca('0xc')];var verticesWithRetry=[_0xf8ca('0xd'),_0xf8ca('0xe'),_0xf8ca('0xf')];var AGIVertices=function(_0x5b7eb8,_0x49f05d,_0x3a9674){this['channel']=_0x5b7eb8;this[_0xf8ca('0x10')]=_0x49f05d;this[_0xf8ca('0x11')]=_0x3a9674;};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x13')]=function(_0x5c6c83,_0x1db40d){this[_0xf8ca('0x10')][_0xf8ca('0x14')](_0x5c6c83)[_0xf8ca('0x15')](function(_0x5b9325){_0x1db40d(null,_0x5b9325?_0x5b9325[_0xf8ca('0x16')]:![]);})[_0xf8ca('0x17')](function(_0x485cab){_0x1db40d(_0x485cab);});};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x18')]=function(_0x41ae82,_0x25169f){this[_0xf8ca('0x10')][_0xf8ca('0x19')](_0x41ae82)[_0xf8ca('0x15')](function(_0x424749){_0x25169f(null,_0x424749?_0x424749[_0xf8ca('0x16')]:![]);})[_0xf8ca('0x17')](function(_0x59402b){_0x25169f(_0x59402b);});};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x1a')]=function(_0x7d545c,_0x12e8f0){this[_0xf8ca('0x10')][_0xf8ca('0x1b')](_0x7d545c)[_0xf8ca('0x15')](function(_0x127119){_0x12e8f0(null,_0x127119?_0x127119['name']:![]);})[_0xf8ca('0x17')](function(_0x3b5400){_0x12e8f0(_0x3b5400);});};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x1c')]=function(_0x4a9b00,_0x1b6cf4){this[_0xf8ca('0x10')][_0xf8ca('0x1d')](_0x4a9b00)[_0xf8ca('0x15')](function(_0x18e8da){_0x1b6cf4(null,_0x18e8da?_0x18e8da[_0xf8ca('0x1e')]:![]);})['catch'](function(_0x1ef24b){_0x1b6cf4(_0x1ef24b);});};AGIVertices['prototype'][_0xf8ca('0x1f')]=function(_0x3d834e,_0x179a48){this[_0xf8ca('0x10')][_0xf8ca('0x20')](_0x3d834e)[_0xf8ca('0x15')](function(_0x593619){_0x179a48(null,_0x593619?_0x593619['name']:![]);})[_0xf8ca('0x17')](function(_0x1d746a){_0x179a48(_0x1d746a);});};AGIVertices['prototype']['getTrunk']=function(_0x4357a2,_0x45fc0d){this[_0xf8ca('0x10')][_0xf8ca('0x21')](_0x4357a2)[_0xf8ca('0x15')](function(_0xe36dce){_0x45fc0d(null,_0xe36dce?_0xe36dce['name']:![]);})[_0xf8ca('0x17')](function(_0x19dfda){_0x45fc0d(_0x19dfda);});};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x22')]=function(_0x17a0c2,_0x2f2519){var _0x815050=this;this['rpc']['getSoundById'](_0x17a0c2)[_0xf8ca('0x15')](function(_0x873e43){_0x2f2519(null,_0x873e43?_0x815050[_0xf8ca('0x23')](_0x873e43['save_name']):![]);})[_0xf8ca('0x17')](function(_0x58a837){_0x2f2519(_0x58a837);});};AGIVertices['prototype'][_0xf8ca('0x24')]=function(_0x22b4a9,_0x1076c4){this['rpc'][_0xf8ca('0x25')](_0x22b4a9)[_0xf8ca('0x15')](function(_0x48bbc5){_0x1076c4(null,_0x48bbc5?_0x48bbc5:![]);})[_0xf8ca('0x17')](function(_0x5ab3a6){_0x1076c4(_0x5ab3a6);});};AGIVertices[_0xf8ca('0x12')]['sendMailMessage']=function(_0x4ed354,_0x42197a,_0x1eb442){this[_0xf8ca('0x11')][_0xf8ca('0x26')](_0x4ed354,_0x42197a)[_0xf8ca('0x15')](function(){_0x1eb442(null);})[_0xf8ca('0x17')](function(_0x427850){_0x1eb442(_0x427850);});};AGIVertices['prototype'][_0xf8ca('0x27')]=function(_0x3d434b,_0x176a58){this[_0xf8ca('0x10')][_0xf8ca('0x28')](_0x3d434b)['then'](function(_0x371b32){if(_0x371b32){if(_0x371b32[_0xf8ca('0x29')]){_0x176a58(null,[_0x371b32[_0xf8ca('0x2a')]]);}else{_0x176a58(null,_[_0xf8ca('0x2b')](_0x371b32[_0xf8ca('0x2c')],_0xf8ca('0x2a')));}}else{_0x176a58(null,![]);}})[_0xf8ca('0x17')](function(_0x3df3ec){_0x176a58(_0x3df3ec);});};AGIVertices['prototype'][_0xf8ca('0x23')]=function(_0x3fcb7f){return util['format'](_0xf8ca('0x2d'),FILES_PATH,_0x3fcb7f);};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x2e')]=function(_0x41523c,_0x5bf2b0,_0x54b8a0){odbc[_0xf8ca('0x2f')](_0x41523c,function(_0x1645e2){if(_0x1645e2){logger['error']('Error\x20getting\x20ODBC\x20connection\x20%s',_0x1645e2);_0x54b8a0(_0x1645e2);}else{logger['info']('ODBC\x20connection\x20successfully');odbc[_0xf8ca('0x30')](_0x5bf2b0,function(_0x21bc0f,_0x4a47ac){if(_0x21bc0f){logger['info'](_0xf8ca('0x31'),_0x5bf2b0);_0x54b8a0(_0x21bc0f);}else{logger[_0xf8ca('0x32')](_0xf8ca('0x33'),_0x5bf2b0);odbc[_0xf8ca('0x34')](function(_0x53ae43){if(_0x53ae43){logger[_0xf8ca('0x35')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x53ae43);}_0x54b8a0(null,_0x4a47ac);});}});}});};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x36')]=function(_0x4cc29e,_0x5d2693){this[_0xf8ca('0x10')][_0xf8ca('0x37')](_0x4cc29e)[_0xf8ca('0x15')](function(_0x33a2bb){_0x5d2693(null,_0x33a2bb?_0x33a2bb:![]);})['catch'](function(_0x360059){_0x5d2693(_0x360059);});};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x38')]=function(_0x81fd6b,_0x4dee45){this[_0xf8ca('0x10')][_0xf8ca('0x38')](_0x81fd6b)[_0xf8ca('0x15')](function(_0x2c0919){_0x4dee45(null,_0x2c0919);})[_0xf8ca('0x17')](function(_0x3089ae){_0x4dee45(_0x3089ae);});};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x39')]=function(_0x118271,_0x3c3ab8,_0x303559){this[_0xf8ca('0x10')][_0xf8ca('0x39')]({'uniqueid':this[_0xf8ca('0x3a')]['uniqueid'],'node':_0x118271[_0xf8ca('0x3b')],'application':_0x118271[_0xf8ca('0x3c')],'data':_0x3c3ab8||null,'project_name':this['channel'][_0xf8ca('0x3d')],'callerid':this[_0xf8ca('0x3a')]['callerid']})[_0xf8ca('0x15')](function(_0x5da0b6){if(_0x303559){_0x303559(null,_0x5da0b6);}})['catch'](function(_0x4a3542){if(_0x303559){_0x303559(_0x4a3542);}});};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x3e')]=function(_0x1998f6,_0xd3aa4f,_0x11ff65,_0x322ccb){this['rpc'][_0xf8ca('0x3e')]({'uniqueid':this[_0xf8ca('0x3a')][_0xf8ca('0x3f')],'callerid':this['channel'][_0xf8ca('0x40')],'calleridname':this[_0xf8ca('0x3a')]['calleridname'],'context':this[_0xf8ca('0x3a')][_0xf8ca('0x41')],'extension':this[_0xf8ca('0x3a')][_0xf8ca('0x42')],'priority':this[_0xf8ca('0x3a')][_0xf8ca('0x43')],'accountcode':this[_0xf8ca('0x3a')]['accountcode'],'dnid':this[_0xf8ca('0x3a')][_0xf8ca('0x44')],'projectName':this['channel'][_0xf8ca('0x3d')],'saveName':_0xd3aa4f,'filename':_0x1998f6[_0xf8ca('0x45')]||_0xd3aa4f,'savePath':_0x11ff65})[_0xf8ca('0x15')](function(_0x18dfc8){_0x322ccb(null,_0x18dfc8);})[_0xf8ca('0x17')](function(_0x15631b){_0x322ccb(_0x15631b);});};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x46')]=function(_0x3957b5,_0x5811a8,_0x801698,_0x5becfd,_0xbbf989){this[_0xf8ca('0x10')][_0xf8ca('0x46')]({'uniqueid':this[_0xf8ca('0x3a')]['uniqueid'],'body':_0x3957b5,'direction':_0x5811a8,'providerName':_0x801698,'providerResponse':_0x5becfd})[_0xf8ca('0x15')](function(_0x208bfb){if(_0xbbf989){_0xbbf989(null,_0x208bfb);}})[_0xf8ca('0x17')](function(_0x31685d){if(_0xbbf989){_0xbbf989(_0x31685d);}});};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x47')]=function(_0xd7381a,_0x2dbd3b){this[_0xf8ca('0x10')][_0xf8ca('0x47')]({'firstName':_[_0xf8ca('0x48')](_0xd7381a[_0xf8ca('0x16')])||_['isNil'](_0xd7381a['name'])?_0xf8ca('0x49')+Math[_0xf8ca('0x4a')]():_0xd7381a[_0xf8ca('0x16')],'lastName':_[_0xf8ca('0x48')](_0xd7381a['lastName'])||_[_0xf8ca('0x4b')](_0xd7381a[_0xf8ca('0x4c')])?null:_0xd7381a[_0xf8ca('0x4c')],'phone':_0xd7381a[_0xf8ca('0x4d')],'ListId':_0xd7381a[_0xf8ca('0x4e')],'scheduledat':_0xd7381a[_0xf8ca('0x4f')],'callbackUniqueid':this[_0xf8ca('0x3a')][_0xf8ca('0x3f')],'tags':'callback','description':_0xf8ca('0x50')+_0xd7381a[_0xf8ca('0x4f')][_0xf8ca('0x51')](),'priority':_0xd7381a[_0xf8ca('0x52')]})['then'](function(_0x239a08){_0x2dbd3b(null,_0x239a08);})[_0xf8ca('0x17')](function(_0x6c5bd3){_0x2dbd3b(_0x6c5bd3);});};AGIVertices[_0xf8ca('0x12')]['getPause']=function(_0x4132f3,_0x59fef0){this[_0xf8ca('0x10')][_0xf8ca('0x53')](_0x4132f3)[_0xf8ca('0x15')](function(_0x5b1f39){_0x59fef0(null,_0x5b1f39?_0x5b1f39[_0xf8ca('0x16')]:![]);})[_0xf8ca('0x17')](function(_0x469edd){_0x59fef0(_0x469edd);});};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x54')]=function(_0x381476,_0x31972d,_0x3d97aa){var _0x30cc68={'role':'agent'};_0x30cc68[_0x381476]=this[_0xf8ca('0x3a')][_0xf8ca('0x40')];this[_0xf8ca('0x10')][_0xf8ca('0x54')](_0x30cc68,_0x31972d,this[_0xf8ca('0x3a')][_0xf8ca('0x3f')])[_0xf8ca('0x15')](function(_0xc56d25){_0x3d97aa(null,_[_0xf8ca('0x4b')](_0xc56d25)?![]:!![]);})[_0xf8ca('0x17')](function(_0x42589a){logger['error'](_0x42589a);_0x3d97aa(null,![]);});};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x55')]=function(_0x2f4bc3,_0x3ac9e7){var _0x358435={'role':_0xf8ca('0x56')};_0x358435[_0x2f4bc3]=this[_0xf8ca('0x3a')][_0xf8ca('0x40')];this['rpc'][_0xf8ca('0x55')](_0x358435)[_0xf8ca('0x15')](function(_0x479a18){_0x3ac9e7(null,_[_0xf8ca('0x4b')](_0x479a18)?![]:!![]);})[_0xf8ca('0x17')](function(_0x369e4c){logger['error'](_0x369e4c);_0x3ac9e7(null,![]);});};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x57')]=function(_0x3ac321,_0x1df9db){var _0x43f6aa={'role':'agent'};_0x43f6aa[_0x3ac321]=this[_0xf8ca('0x3a')][_0xf8ca('0x40')];this[_0xf8ca('0x10')][_0xf8ca('0x57')](_0x43f6aa)['then'](function(_0x3ccb6b){_0x1df9db(null,_['isNil'](_0x3ccb6b)?![]:!![]);})[_0xf8ca('0x17')](function(_0x338950){logger[_0xf8ca('0x35')](_0x338950);_0x1df9db(null,![]);});};AGIVertices[_0xf8ca('0x12')]['agentLogin']=function(_0x4e5393,_0x59a7c7){var _0x1eabf1={'role':_0xf8ca('0x56')};_0x1eabf1[_0x4e5393]=this[_0xf8ca('0x3a')][_0xf8ca('0x40')];var _0x2d6a78=_0x4e5393!=_0xf8ca('0x58')?util[_0xf8ca('0x59')]('%s/%s@from-sip/n',_0xf8ca('0x5a'),this[_0xf8ca('0x3a')][_0xf8ca('0x40')]):undefined;this[_0xf8ca('0x10')][_0xf8ca('0x5b')](_0x1eabf1,_0x2d6a78)[_0xf8ca('0x15')](function(_0x3e0dbe){_0x59a7c7(null,_['isNil'](_0x3e0dbe)?![]:!![]);})[_0xf8ca('0x17')](function(_0x417707){logger[_0xf8ca('0x35')](_0x417707);_0x59a7c7(null,![]);});};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x5c')]=function(_0x2ffdeb,_0x3779f2){sh[_0xf8ca('0x5d')](_['trim'](_0x2ffdeb),function(_0x8a79cf,_0x4a6247){var _0x1dee6e=_0x4a6247[_0xf8ca('0x5e')](/(\r\n|\n|\r)/gm,'');_0x3779f2(null,_0x1dee6e);});};AGIVertices['prototype'][_0xf8ca('0x5f')]=function(_0xa00768,_0x4c514f){scripts[_0xf8ca('0x5f')](_0xa00768['apiKey'],_0xa00768['google_cloud_tts_text_type']||_0xf8ca('0x60'),_0xa00768['text'],_0xa00768['languageCode']||_0xf8ca('0x61'),_0xa00768[_0xf8ca('0x62')]||_0xf8ca('0x63'),_0xa00768[_0xf8ca('0x64')]||_0xf8ca('0x65'))[_0xf8ca('0x15')](function(_0xeeb5ae){_0x4c514f(null,_0xeeb5ae);})[_0xf8ca('0x17')](function(_0x5e9598){_0x4c514f(_0x5e9598);});};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x66')]=function(_0x411c3d,_0x3b6433){scripts[_0xf8ca('0x66')](_0x411c3d[_0xf8ca('0x60')],_0x411c3d[_0xf8ca('0x67')]||'en',0x1)['then'](function(_0x15cf7d){_0x3b6433(null,_0x15cf7d);})[_0xf8ca('0x17')](function(_0x28e3d0){_0x3b6433(_0x28e3d0);});};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x68')]=function(_0x180141,_0x2aebb4){var _0x5aff25={'uri':_0x180141['url'],'method':_0x180141[_0xf8ca('0x69')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x180141[_0xf8ca('0x6a')])==='number'&&parseInt(_0x180141['timeout'])>=0x1?parseInt(_0x180141[_0xf8ca('0x6a')])*0x3e8:0x5*0x3e8};if(_[_0xf8ca('0x6b')]([_0xf8ca('0x6c'),'PUT'],_0x5aff25['method'][_0xf8ca('0x6d')]())){try{_0x5aff25['body']=_0x180141[_0xf8ca('0xc')]?JSON[_0xf8ca('0x6e')](_0x180141[_0xf8ca('0xc')]):{};}catch(_0xb66b73){logger[_0xf8ca('0x35')](_0xf8ca('0x6f'),_0xb66b73);}}try{_0x5aff25[_0xf8ca('0x70')]=_0x180141[_0xf8ca('0x71')]?JSON[_0xf8ca('0x6e')](_0x180141[_0xf8ca('0x71')]):{};}catch(_0x4eb918){logger[_0xf8ca('0x35')](_0xf8ca('0x72'),_0x4eb918);}if(_0x180141[_0xf8ca('0x73')]){try{var _0x393076=require(_0x180141['computedVariables'])[_0xf8ca('0x74')](this,_0x5aff25);_0x5aff25[_0xf8ca('0x75')]=Mustache[_0xf8ca('0x76')](_0x180141[_0xf8ca('0x77')],_0x393076,{},['$$','$$']);if(_0x5aff25[_0xf8ca('0x70')]){_0x5aff25[_0xf8ca('0x70')]=JSON[_0xf8ca('0x6e')](Mustache[_0xf8ca('0x76')](JSON[_0xf8ca('0x78')](_0x5aff25[_0xf8ca('0x70')]),_0x393076,{},['$$','$$']));}if(_0x5aff25[_0xf8ca('0x79')]){_0x5aff25['body']=JSON[_0xf8ca('0x6e')](Mustache[_0xf8ca('0x76')](JSON[_0xf8ca('0x78')](_0x5aff25[_0xf8ca('0x79')]),_0x393076,{},['$$','$$']));}}catch(_0x32c7ab){logger['error']('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x32c7ab);}}rp(_0x5aff25)['then'](function(_0x194a1f){var _0xf28d6c={'statusCode':_0x194a1f[_0xf8ca('0x7a')]||0xc8,'statusMessage':_0x194a1f['statusMessage']||'OK','headers':_0x194a1f[_0xf8ca('0x70')]||{},'body':_0x194a1f[_0xf8ca('0x79')]||{}};_0x2aebb4(null,_0xf28d6c);})[_0xf8ca('0x17')](function(_0x2f79fc){var _0x184459={'statusCode':_0x2f79fc['statusCode']||0x1f4,'statusMessage':_0x2f79fc[_0xf8ca('0x7b')]||_0xf8ca('0x7c'),'headers':_0x2f79fc['options']['headers']||{},'body':_0x2f79fc[_0xf8ca('0x7d')][_0xf8ca('0x79')]||{}};_0x2aebb4(null,_0x184459);});};AGIVertices[_0xf8ca('0x12')]['googleDialogflow']=function(_0x4615e7,_0x30470e){scripts[_0xf8ca('0x7e')](this['channel']['uniqueid'],_0x4615e7[_0xf8ca('0x7f')],_0x4615e7[_0xf8ca('0x60')],_0x4615e7['dialogflow_language']||'en')[_0xf8ca('0x15')](function(_0x41507e){_0x30470e(null,_0x41507e);})[_0xf8ca('0x17')](function(_0x4b087f){_0x30470e(_0x4b087f);});};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x80')]=function(_0x1c3fc9,_0x3b8cf8){scripts[_0xf8ca('0x80')](this[_0xf8ca('0x3a')][_0xf8ca('0x3f')],_0x1c3fc9[_0xf8ca('0x81')],_0x1c3fc9[_0xf8ca('0x82')],_0x1c3fc9['private_key'],_0x1c3fc9[_0xf8ca('0x60')],_0x1c3fc9[_0xf8ca('0x83')]||'en')['then'](function(_0x5cef15){_0x3b8cf8(null,_0x5cef15);})[_0xf8ca('0x17')](function(_0x58d0a3){_0x3b8cf8(_0x58d0a3);});};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x84')]=function(_0x5d6699,_0x35177b){scripts[_0xf8ca('0x84')](this[_0xf8ca('0x3a')],_0x5d6699)[_0xf8ca('0x15')](function(_0x3023e1){_0x35177b(null,_0x3023e1);})[_0xf8ca('0x17')](function(_0xadfabe){_0x35177b(_0xadfabe);});};AGIVertices['prototype'][_0xf8ca('0x85')]=function(_0x4f9c65,_0x25f510){scripts['ispeechTTS'](_0x4f9c65[_0xf8ca('0x7f')],_0x4f9c65['text'],_0x4f9c65[_0xf8ca('0x86')]||_0xf8ca('0x61'),_0x4f9c65[_0xf8ca('0x87')])[_0xf8ca('0x15')](function(_0x27226d){_0x25f510(null,_0x27226d);})[_0xf8ca('0x17')](function(_0x1d75f5){_0x25f510(_0x1d75f5);});};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x88')]=function(_0x2361d0,_0x198fc5,_0x3fd626){scripts[_0xf8ca('0x88')](_0x198fc5,_0x2361d0[_0xf8ca('0x7f')],_0x2361d0[_0xf8ca('0x89')]||_0xf8ca('0x61'),this['isConfigured'](_0x2361d0[_0xf8ca('0x8a')])?_0x2361d0[_0xf8ca('0x8a')]:undefined)[_0xf8ca('0x15')](function(_0x2a5319){_0x3fd626(null,_0x2a5319);})[_0xf8ca('0x17')](function(_0x4eb2f2){_0x3fd626(_0x4eb2f2);});};AGIVertices['prototype'][_0xf8ca('0x8b')]=function(_0x4bbb8d,_0x42a43d){scripts[_0xf8ca('0x8b')](_0x4bbb8d[_0xf8ca('0x8c')],_0x4bbb8d[_0xf8ca('0x8d')],_0x4bbb8d[_0xf8ca('0x8e')],_0x4bbb8d['aws_polly_voice']||_0xf8ca('0x8f'),_0x4bbb8d[_0xf8ca('0x60')],_0x4bbb8d[_0xf8ca('0x90')]||_0xf8ca('0x60'))[_0xf8ca('0x15')](function(_0x5863ae){_0x42a43d(null,_0x5863ae);})[_0xf8ca('0x17')](function(_0x31a4b){_0x42a43d(_0x31a4b);});};AGIVertices[_0xf8ca('0x12')]['awsLex']=function(_0x51a70e,_0x5c7aad){scripts[_0xf8ca('0x91')](this[_0xf8ca('0x3a')][_0xf8ca('0x3f')],_0x51a70e[_0xf8ca('0x8c')],_0x51a70e['aws_secret_access_key'],_0x51a70e[_0xf8ca('0x92')],_0x51a70e[_0xf8ca('0x60')],_0x51a70e[_0xf8ca('0x93')])[_0xf8ca('0x15')](function(_0x5cf12c){_0x5c7aad(null,_0x5cf12c);})[_0xf8ca('0x17')](function(_0x26b466){_0x5c7aad(_0x26b466);});};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x94')]=function(_0x9e80c1,_0x2c6bdb,_0x2e563a){scripts[_0xf8ca('0x94')](_0x2c6bdb,_0x9e80c1['key'],_0x9e80c1[_0xf8ca('0x95')]||'en-US')[_0xf8ca('0x15')](function(_0x18002){_0x2e563a(null,_0x18002);})[_0xf8ca('0x17')](function(_0x20b4de){_0x2e563a(_0x20b4de);});};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x96')]=function(_0x1c13b0,_0x502b8b,_0x93744c){scripts[_0xf8ca('0x96')](_0x502b8b,_0x1c13b0[_0xf8ca('0x97')],_0x1c13b0[_0xf8ca('0x98')],_0x1c13b0[_0xf8ca('0x75')])['then'](function(_0x10f5ad){_0x93744c(null,_0x10f5ad);})[_0xf8ca('0x17')](function(_0x27e6fe){_0x93744c(_0x27e6fe);});};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x99')]=function(_0x1c94d1){var _0x5d7374=_[_0xf8ca('0x6b')](verticesWithRetry,_0x1c94d1[_0xf8ca('0x3c')])?_0x1c94d1:_[_0xf8ca('0x9a')](_0x1c94d1);for(var _0x510f92 in _0x5d7374){if(_0x5d7374[_0xf8ca('0x9b')](_0x510f92)){if(_0x5d7374[_0x510f92]&&_[_0xf8ca('0x9c')](_0x5d7374[_0x510f92])){if(_[_0xf8ca('0x6b')](recursiveMapAttributes,_0x510f92)){_0x5d7374[_0x510f92]=this[_0xf8ca('0x9d')](_0x5d7374[_0x510f92]);}else{_0x5d7374[_0x510f92]=this[_0xf8ca('0x9e')](_0x5d7374[_0x510f92]);}}}}return _0x5d7374;};AGIVertices['prototype'][_0xf8ca('0x9f')]=function(_0x2bd2a2){for(var _0x305b16 in _0x2bd2a2){if(_0x2bd2a2['hasOwnProperty'](_0x305b16)){if(_[_0xf8ca('0xa0')](_0x2bd2a2[_0x305b16])){this[_0xf8ca('0x9f')](_0x2bd2a2[_0x305b16]);}else if(_[_0xf8ca('0xa1')](_0x2bd2a2[_0x305b16])){for(var _0x56a100=0x0;_0x56a100<_0x2bd2a2[_0x305b16]['length'];_0x56a100++){this[_0xf8ca('0x9f')](_0x2bd2a2[_0x305b16][_0x56a100]);}}else if(_[_0xf8ca('0x9c')](_0x2bd2a2[_0x305b16])){_0x2bd2a2[_0x305b16]=this['replaceAllVariables'](_0x2bd2a2[_0x305b16]);}}}};AGIVertices[_0xf8ca('0x12')]['saveRestApiResult']=function(_0x4087d0,_0x3372d1){for(var _0x5e7ea1 in _0x4087d0){if(_0x4087d0[_0xf8ca('0x9b')](_0x5e7ea1)){if(_[_0xf8ca('0xa0')](_0x4087d0[_0x5e7ea1])){if(!_['isEmpty'](_0x4087d0[_0x5e7ea1])){this[_0xf8ca('0xa2')](_0x4087d0[_0x5e7ea1],util[_0xf8ca('0x59')](_0xf8ca('0xa3'),_0x3372d1,_0x5e7ea1));}}else if(_[_0xf8ca('0xa1')](_0x4087d0[_0x5e7ea1])){for(var _0x520021=0x0;_0x520021<_0x4087d0[_0x5e7ea1]['length'];_0x520021++){this['saveRestApiResult'](_0x4087d0[_0x5e7ea1][_0x520021],util['format'](_0xf8ca('0xa3'),_0x3372d1,_0x5e7ea1+'['+_0x520021+']'));}}else{if(!_[_0xf8ca('0x4b')](_0x4087d0[_0x5e7ea1])){this[_0xf8ca('0x3a')][_0xf8ca('0xa4')](util[_0xf8ca('0x59')](_0xf8ca('0xa3'),_0x3372d1,_0x5e7ea1),_0x4087d0[_0x5e7ea1]);}}}}};AGIVertices['prototype'][_0xf8ca('0x9d')]=function(_0x367115){try{var _0x3fe3d4=JSON[_0xf8ca('0x6e')](_0x367115);this[_0xf8ca('0x9f')](_0x3fe3d4);return JSON[_0xf8ca('0x78')](_0x3fe3d4);}catch(_0x56cb47){return this[_0xf8ca('0x9e')](_0x367115);}};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x9e')]=function(_0x125e22){var _0x97e984=_0x125e22[_0xf8ca('0xa5')]('{');for(var _0x5a19e0=0x1;_0x5a19e0<_0x97e984['length'];_0x5a19e0+=0x1){var _0x5c8c18=_0x97e984[_0x5a19e0]['split']('}');if(_0x5c8c18[_0xf8ca('0xa6')]>0x1){_0x125e22=_0x125e22['replaceAll']('{'+_0x5c8c18[0x0]+'}',this['channel']['getVariable'](_0x5c8c18[0x0])[_0xf8ca('0xa7')]||_0x5c8c18[0x0]);}}if(_0x97e984[_0xf8ca('0xa6')]===0x1){return _0x125e22[_0xf8ca('0x51')]();}return this[_0xf8ca('0x9e')](_0x125e22);};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0xa8')]=function(_0x22a9dc,_0x3e8397){var _0x379611=this[_0xf8ca('0x3a')][_0xf8ca('0x13')](_0x22a9dc);if(_0x379611['result']===-0x1){return _0x379611;}logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x3e8397,_0x379611['extra']));return this[_0xf8ca('0x3a')][_0xf8ca('0xa4')](_0x3e8397,_0x379611[_0xf8ca('0xa7')]);};AGIVertices[_0xf8ca('0x12')]['isConfigured']=function(_0x1b069){return _0x1b069&&_0x1b069!=='0'&&_0x1b069!=='-1'&&_0x1b069!=='';};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0xa9')]=function(_0x4aabb1){this[_0xf8ca('0x39')][_0xf8ca('0x74')](this,_0x4aabb1,'-');_0x4aabb1[_0xf8ca('0xaa')]=_0x4aabb1[_0xf8ca('0xa9')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0xf8ca('0xab')]=function(_0x539aa9){logger['info'](util[_0xf8ca('0x59')](_0xf8ca('0xac'),_0x539aa9[_0xf8ca('0x3b')]));if(!this[_0xf8ca('0xad')](_0x539aa9[_0xf8ca('0x60')])){return this[_0xf8ca('0x3a')][_0xf8ca('0xae')](_0xf8ca('0xaf'));}var _0x475277='\x22'+_0x539aa9[_0xf8ca('0x60')]+'\x22';if(this[_0xf8ca('0xad')](_0x539aa9[_0xf8ca('0x7d')])){_0x475277+=','+_0x539aa9['options'];}var _0x5bbdae=this[_0xf8ca('0x3a')][_0xf8ca('0x5d')](_0xf8ca('0xb0'),_0x475277);if(_0x5bbdae['result']===-0x1){return _0x5bbdae;}return this[_0xf8ca('0x3a')]['noop'](util[_0xf8ca('0x59')]('Executed\x20command\x20MRCPSynth\x20%s',_0x475277));};AGIVertices['prototype'][_0xf8ca('0xb1')]=function(_0xfb8e12){logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0xfb8e12[_0xf8ca('0x3b')]));if(!this['isConfigured'](_0xfb8e12['grammar'])){return this[_0xf8ca('0x3a')][_0xf8ca('0xae')]('no\x20grammar\x20configured');}var _0x4cd282=_0xfb8e12[_0xf8ca('0xb2')];if(this[_0xf8ca('0xad')](_0xfb8e12['options'])){_0x4cd282+=','+_0xfb8e12[_0xf8ca('0x7d')];}var _0x946936=this['channel'][_0xf8ca('0x5d')](_0xf8ca('0xb3'),_0x4cd282);if(_0x946936[_0xf8ca('0xb4')]===-0x1){return _0x946936;}var _0x193df4=this['getAndSetVariable'](_0xf8ca('0xb5'),_0xf8ca('0xb6'));if(_0x193df4[_0xf8ca('0xb4')]===-0x1){return _0x193df4;}var _0x1305ec=this[_0xf8ca('0xa8')](_0xf8ca('0xb7'),'MRCP_RECOG_TRANSCRIPT');if(_0x1305ec[_0xf8ca('0xb4')]===-0x1){return _0x1305ec;}var _0x1d6141=this[_0xf8ca('0xa8')](_0xf8ca('0xb8'),_0xf8ca('0xb9'));if(_0x1d6141[_0xf8ca('0xb4')]===-0x1){return _0x1d6141;}return this[_0xf8ca('0x3a')][_0xf8ca('0xae')](util[_0xf8ca('0x59')](_0xf8ca('0xba'),_0x4cd282));};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x7')]=function(_0xb7d83f){logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')](_0xf8ca('0xbb'),_0xb7d83f[_0xf8ca('0x3b')]));return this[_0xf8ca('0x3a')][_0xf8ca('0x7')]([_0xb7d83f['command'],_0xb7d83f['args']]);};AGIVertices['prototype'][_0xf8ca('0xbc')]=function(_0x2ac3dc){logger[_0xf8ca('0x32')](util['format'](_0xf8ca('0xbd'),_0x2ac3dc[_0xf8ca('0x3b')]));if(this['isConfigured'](_0x2ac3dc[_0xf8ca('0x6a')])){logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')](_0xf8ca('0xbe'),_0x2ac3dc[_0xf8ca('0x6a')]));var _0x314af4=this[_0xf8ca('0x3a')]['wait'](_0x2ac3dc[_0xf8ca('0x6a')]);if(_0x314af4[_0xf8ca('0xb4')]===-0x1){return _0x314af4;}}return this['channel']['answer']();};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0xbf')]=function(_0x16a169){logger['info'](util['format'](_0xf8ca('0xc0'),_0x16a169[_0xf8ca('0x3b')]));if(!this[_0xf8ca('0xad')](_0x16a169[_0xf8ca('0x4e')])){return this[_0xf8ca('0x3a')][_0xf8ca('0x35')](_0x16a169,_0xf8ca('0xc1'));}_0x16a169[_0xf8ca('0x4f')]=moment();if(this['isConfigured'](_0x16a169[_0xf8ca('0xc2')])){_0x16a169[_0xf8ca('0x4f')]=moment()[_0xf8ca('0xc3')](_0x16a169[_0xf8ca('0xc2')],_0xf8ca('0xc4'));}if(!this['isConfigured'](_0x16a169[_0xf8ca('0x52')])){_0x16a169[_0xf8ca('0x52')]=0x2;}this[_0xf8ca('0x47')][_0xf8ca('0x74')](this,_0x16a169);return this['channel'][_0xf8ca('0xae')](util[_0xf8ca('0x59')](_0xf8ca('0xc5'),_0x16a169[_0xf8ca('0x4d')],_0x16a169[_0xf8ca('0x4e')],_0x16a169['scheduledAt']));};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0xc6')]=function(_0x5e9e2b){logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')](_0xf8ca('0xc7'),_0x5e9e2b['label']));var _0x4c5845=this['channel'][_0xf8ca('0x5d')](_0x5e9e2b['application'],_0x5e9e2b[_0xf8ca('0x7d')]);if(_0x4c5845[_0xf8ca('0xb4')]===-0x1){return _0x4c5845;}return this[_0xf8ca('0x3a')][_0xf8ca('0xae')](util[_0xf8ca('0x59')](_0xf8ca('0xc8'),_0x5e9e2b[_0xf8ca('0xc9')],_0x5e9e2b[_0xf8ca('0x7d')]));};AGIVertices['prototype'][_0xf8ca('0xca')]=function(_0x23f589){logger[_0xf8ca('0x32')](util['format']('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x23f589[_0xf8ca('0x3b')]));if(!this[_0xf8ca('0xad')](_0x23f589[_0xf8ca('0x60')])){return this[_0xf8ca('0x3a')]['noop'](_0xf8ca('0xaf'));}var _0x4f54e0='\x22'+_0x23f589['text']+'\x22';if(this[_0xf8ca('0xad')](_0x23f589[_0xf8ca('0x7d')])){_0x4f54e0+=','+_0x23f589['options'];}var _0x53f9ae=this['channel'][_0xf8ca('0x5d')]('MRCPSynth',_0x4f54e0);if(_0x53f9ae[_0xf8ca('0xb4')]===-0x1){return _0x53f9ae;}return this['channel'][_0xf8ca('0xae')](util[_0xf8ca('0x59')]('Executed\x20command\x20MRCPSynth\x20%s',_0x4f54e0));};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0xcb')]=function(_0x4c6d8f){logger[_0xf8ca('0x32')](util['format']('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x4c6d8f['label']));if(!this['isConfigured'](_0x4c6d8f['text'])){return this[_0xf8ca('0x3a')][_0xf8ca('0xae')](_0xf8ca('0xaf'));}var _0x2eeded='\x22'+_0x4c6d8f[_0xf8ca('0x60')]+'\x22';if(this[_0xf8ca('0xad')](_0x4c6d8f[_0xf8ca('0x7d')])){_0x2eeded+=','+_0x4c6d8f[_0xf8ca('0x7d')];}var _0x3e76ac=this[_0xf8ca('0x3a')][_0xf8ca('0x5d')](_0xf8ca('0xb0'),_0x2eeded);if(_0x3e76ac[_0xf8ca('0xb4')]===-0x1){return _0x3e76ac;}return this[_0xf8ca('0x3a')][_0xf8ca('0xae')](util[_0xf8ca('0x59')]('Executed\x20command\x20MRCPSynth\x20%s',_0x2eeded));};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0xcc')]=function(_0x5d85f7){logger[_0xf8ca('0x32')](util['format'](_0xf8ca('0xcd'),_0x5d85f7[_0xf8ca('0x3b')]));if(!this['isConfigured'](_0x5d85f7[_0xf8ca('0xb2')])){return this[_0xf8ca('0x3a')]['noop'](_0xf8ca('0xce'));}var _0x169a2b=_0x5d85f7[_0xf8ca('0xb2')];if(this['isConfigured'](_0x5d85f7['options'])){_0x169a2b+=','+_0x5d85f7[_0xf8ca('0x7d')];}var _0xebe130=this['channel'][_0xf8ca('0x5d')](_0xf8ca('0xb3'),_0x169a2b);if(_0xebe130[_0xf8ca('0xb4')]===-0x1){return _0xebe130;}var _0x4085e5=this[_0xf8ca('0xa8')]('RECOG_CONFIDENCE()',_0xf8ca('0xcf'));if(_0x4085e5['result']===-0x1){return _0x4085e5;}var _0x1887e6=this[_0xf8ca('0xa8')]('RECOG_INPUT()',_0xf8ca('0xd0'));if(_0x1887e6[_0xf8ca('0xb4')]===-0x1){return _0x1887e6;}var _0x37f865=this[_0xf8ca('0xa8')]('RECOG_INSTANCE()',_0xf8ca('0xd1'));if(_0x37f865['result']===-0x1){return _0x37f865;}return this[_0xf8ca('0x3a')]['noop'](util[_0xf8ca('0x59')](_0xf8ca('0xba'),_0x169a2b));};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0xd2')]=function(_0x3bb48b){logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')](_0xf8ca('0xd3'),_0x3bb48b[_0xf8ca('0x3b')]));if(!this[_0xf8ca('0xad')](_0x3bb48b[_0xf8ca('0xb2')])){return this['channel'][_0xf8ca('0xae')]('no\x20grammar\x20configured');}var _0x107a8a=_0x3bb48b['grammar'];if(this[_0xf8ca('0xad')](_0x3bb48b[_0xf8ca('0x7d')])){_0x107a8a+=','+_0x3bb48b['options'];}var _0x2b9958=this[_0xf8ca('0x3a')][_0xf8ca('0x5d')]('MRCPRecog',_0x107a8a);if(_0x2b9958[_0xf8ca('0xb4')]===-0x1){return _0x2b9958;}var _0x100a7a=this['getAndSetVariable']('RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE');if(_0x100a7a[_0xf8ca('0xb4')]===-0x1){return _0x100a7a;}var _0x24de5c=this[_0xf8ca('0xa8')](_0xf8ca('0xb7'),_0xf8ca('0xd4'));if(_0x24de5c[_0xf8ca('0xb4')]===-0x1){return _0x24de5c;}var _0x4ec7a6=this[_0xf8ca('0xa8')]('RECOG_INSTANCE()','SESTEK_ASR_INSTANCE');if(_0x4ec7a6['result']===-0x1){return _0x4ec7a6;}return this['channel']['noop'](util[_0xf8ca('0x59')](_0xf8ca('0xba'),_0x107a8a));};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0xd5')]=function(_0xaf54b7){logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')](_0xf8ca('0xd6'),_0xaf54b7['label']));if(!this[_0xf8ca('0xad')](_0xaf54b7[_0xf8ca('0xd7')])){return this[_0xf8ca('0x3a')][_0xf8ca('0x35')](_0xaf54b7,_0xf8ca('0xd8'));}var _0x3b6f0b=this[_0xf8ca('0x1c')][_0xf8ca('0x74')](this,_0xaf54b7[_0xf8ca('0xd7')]);if(!_0x3b6f0b){return this['channel'][_0xf8ca('0x35')](_0xaf54b7,_0xf8ca('0xd9'));}if(!this[_0xf8ca('0xad')](_0xaf54b7[_0xf8ca('0x30')])){return this[_0xf8ca('0x3a')]['error'](_0xaf54b7,_0xf8ca('0xda'));}var _0x188a4f=_0xaf54b7[_0xf8ca('0x30')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0xf8ca('0x3a')][_0xf8ca('0xae')](util[_0xf8ca('0x59')](_0xf8ca('0xdb'),_0x188a4f));var _0x543a90=this[_0xf8ca('0x2e')]['sync'](this,_0x3b6f0b,_0x188a4f);this[_0xf8ca('0x39')][_0xf8ca('0x74')](this,_0xaf54b7,_0x188a4f);if(!this[_0xf8ca('0xad')](_0xaf54b7['variable_id'])){return this[_0xf8ca('0x3a')][_0xf8ca('0xae')](_0xf8ca('0xdc'));}var _0x29f882=this[_0xf8ca('0x13')][_0xf8ca('0x74')](this,_0xaf54b7[_0xf8ca('0xdd')]);if(!_0x29f882){return this[_0xf8ca('0x3a')][_0xf8ca('0x35')](_0xaf54b7,'no\x20variable\x20found');}var _0xfbe326=this;_0x543a90['forEach'](function(_0x1a9af1,_0x488bab){Object[_0xf8ca('0xde')](_0x1a9af1)[_0xf8ca('0xdf')](function(_0x1b86a7){_0xfbe326[_0xf8ca('0x3a')]['setVariable'](util['format']('%s[%s][%s]',_0x29f882,_0x488bab,_0x1b86a7),_0x1a9af1[_0x1b86a7]);});});this['channel'][_0xf8ca('0xa4')](util[_0xf8ca('0x59')](_0xf8ca('0xe0'),_0x29f882),_0x543a90['length']);return this['channel']['noop'](util['format'](_0xf8ca('0xe1'),_0x29f882));};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0xe2')]=function(_0x4d98e2){logger[_0xf8ca('0xe3')](util[_0xf8ca('0x59')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x4d98e2['label']));if(!this['isConfigured'](_0x4d98e2['sip_id'])){return this[_0xf8ca('0x3a')][_0xf8ca('0x35')](_0x4d98e2,_0xf8ca('0xe4'));}var _0x4e2123=this[_0xf8ca('0x1f')]['sync'](this,_0x4d98e2['sip_id']);if(!_0x4e2123){return this[_0xf8ca('0x3a')][_0xf8ca('0x35')](_0x4d98e2,_0xf8ca('0xe5'));}var _0x15d5ed=this['channel']['exec'](_0xf8ca('0xe6'),[util[_0xf8ca('0x59')](_0xf8ca('0xe7'),_0x4e2123),_0x4d98e2[_0xf8ca('0x6a')],_0x4d98e2[_0xf8ca('0xe8')],_0x4d98e2[_0xf8ca('0x77')]]);if(_0x15d5ed[_0xf8ca('0xb4')]===-0x1){return _0x15d5ed;}return this['channel'][_0xf8ca('0xae')](util[_0xf8ca('0x59')]('Executed\x20command\x20%s',_0xf8ca('0xe6')));};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0xe9')]=function(_0x5cb6a0){logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')](_0xf8ca('0xea'),_0x5cb6a0[_0xf8ca('0x3b')]));if(!this['isConfigured'](_0x5cb6a0['key'])){return this['channel'][_0xf8ca('0xae')](_0xf8ca('0xeb'));}if(!this[_0xf8ca('0xad')](_0x5cb6a0[_0xf8ca('0x60')])){return this['channel']['noop'](_0xf8ca('0xaf'));}this[_0xf8ca('0x3a')]['bot']=!![];this[_0xf8ca('0x39')](_0x5cb6a0);this[_0xf8ca('0x46')](_0x5cb6a0[_0xf8ca('0x60')],'in','','');this[_0xf8ca('0x3a')][_0xf8ca('0xae')](util[_0xf8ca('0x59')](_0xf8ca('0xec'),_0x5cb6a0[_0xf8ca('0x60')]));var _0x3fe092=this['googleDialogflow'][_0xf8ca('0x74')](this,_0x5cb6a0);if(_0x3fe092){for(var _0x186992 in _0x3fe092){if(_0x3fe092[_0xf8ca('0x9b')](_0x186992)){this[_0xf8ca('0x3a')][_0xf8ca('0xa4')](util[_0xf8ca('0x59')]('DIALOGFLOW_%s',_0x186992[_0xf8ca('0x6d')]()),_0x3fe092[_0x186992]);}}this['createSquareMessage'](_0x3fe092['speech'],_0xf8ca('0xed'),_0xf8ca('0xe9'),'');return this[_0xf8ca('0x3a')]['noop'](util[_0xf8ca('0x59')]('Dialogflow\x20Result\x20%s',_0x3fe092[_0xf8ca('0xee')]));}return this[_0xf8ca('0x3a')][_0xf8ca('0x35')](_0x5cb6a0,_0xf8ca('0xef'));};AGIVertices[_0xf8ca('0x12')]['dialogflowV2']=function(_0x4a6e5d){logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x4a6e5d['label']));if(!this[_0xf8ca('0xad')](_0x4a6e5d[_0xf8ca('0x81')])){return this[_0xf8ca('0x3a')][_0xf8ca('0xae')](_0xf8ca('0xf0'));}if(!this['isConfigured'](_0x4a6e5d[_0xf8ca('0x82')])){return this[_0xf8ca('0x3a')][_0xf8ca('0xae')]('no\x20client_email\x20configured');}if(!this['isConfigured'](_0x4a6e5d[_0xf8ca('0xf1')])){return this[_0xf8ca('0x3a')][_0xf8ca('0xae')]('no\x20private_key\x20configured');}if(!this[_0xf8ca('0xad')](_0x4a6e5d['dialogflowV2_language'])){return this[_0xf8ca('0x3a')][_0xf8ca('0xae')]('no\x20anguage\x20configured');}if(!this['isConfigured'](_0x4a6e5d[_0xf8ca('0x60')])){return this['channel'][_0xf8ca('0xae')](_0xf8ca('0xaf'));}this[_0xf8ca('0x3a')][_0xf8ca('0xf2')]=!![];this['createSquareDetailsReport'](_0x4a6e5d);this['createSquareMessage'](_0x4a6e5d[_0xf8ca('0x60')],'in','','');this[_0xf8ca('0x3a')][_0xf8ca('0xae')](util['format'](_0xf8ca('0xf3'),_0x4a6e5d[_0xf8ca('0x60')]));var _0x5c081b=this[_0xf8ca('0x80')][_0xf8ca('0x74')](this,_0x4a6e5d);if(_0x5c081b){for(var _0x407ad9 in _0x5c081b){if(_0x5c081b[_0xf8ca('0x9b')](_0x407ad9)){if(_0x407ad9!=='providerResponse'){this[_0xf8ca('0x3a')][_0xf8ca('0xa4')](util[_0xf8ca('0x59')]('DIALOGFLOW_%s',_0x407ad9[_0xf8ca('0x6d')]()),_0x5c081b[_0x407ad9]);}}}this[_0xf8ca('0x46')](_0x5c081b['speech'],'out',_0xf8ca('0xf4'),_0x5c081b[_0xf8ca('0xf5')]);return this[_0xf8ca('0x3a')]['noop'](util[_0xf8ca('0x59')](_0xf8ca('0xf6'),_0x5c081b['speech']));}return this[_0xf8ca('0x3a')]['error'](_0x4a6e5d,_0xf8ca('0xf7'));};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0xf8')]=function(_0x381277){logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')](_0xf8ca('0xf9'),_0x381277[_0xf8ca('0x3b')]));if(!this[_0xf8ca('0xad')](_0x381277[_0xf8ca('0xfa')])){return this[_0xf8ca('0x3a')][_0xf8ca('0xae')]('no\x20ndauth\x20url\x20configured');}if(!this[_0xf8ca('0xad')](_0x381277['username'])){return this[_0xf8ca('0x3a')][_0xf8ca('0xae')](_0xf8ca('0xfb'));}if(!this[_0xf8ca('0xad')](_0x381277[_0xf8ca('0xfc')])){return this[_0xf8ca('0x3a')][_0xf8ca('0xae')](_0xf8ca('0xfd'));}if(!this[_0xf8ca('0xad')](_0x381277[_0xf8ca('0xfe')])){return this[_0xf8ca('0x3a')][_0xf8ca('0xae')](_0xf8ca('0xaf'));}this[_0xf8ca('0x3a')][_0xf8ca('0xf2')]=!![];this[_0xf8ca('0x39')](_0x381277);this['createSquareMessage'](_0x381277['text'],'in','','');this[_0xf8ca('0x3a')][_0xf8ca('0xae')](util['format'](_0xf8ca('0xff'),_0x381277['text']));var _0x2d791a=this['sestekNDA']['sync'](this,_0x381277);if(_0x2d791a){for(var _0x20134d in _0x2d791a){if(_0x2d791a['hasOwnProperty'](_0x20134d)){this['channel'][_0xf8ca('0xa4')](util['format'](_0xf8ca('0x100'),_0x20134d[_0xf8ca('0x6d')]()),_0x2d791a[_0x20134d]);}}this['createSquareMessage'](_0x2d791a[_0xf8ca('0xee')],_0xf8ca('0xed'),'sesteknda','');if(_0x2d791a[_0xf8ca('0x101')]){this[_0xf8ca('0x3a')][_0xf8ca('0xae')](util[_0xf8ca('0x59')](_0xf8ca('0x102'),_0x2d791a[_0xf8ca('0x101')]));var _0x5ab1f0=this[_0xf8ca('0x3a')][_0xf8ca('0x103')](_0x2d791a[_0xf8ca('0x101')]);try{fs[_0xf8ca('0x104')](_0x2d791a[_0xf8ca('0x101')]+_0xf8ca('0x105'));}catch(_0xc11bd3){logger[_0xf8ca('0x35')](_0xc11bd3);}return _0x5ab1f0;}else{return this['channel'][_0xf8ca('0xae')](util[_0xf8ca('0x59')](_0xf8ca('0x106'),_0x2d791a[_0xf8ca('0xee')]));}}return this[_0xf8ca('0x3a')][_0xf8ca('0x35')](_0x381277,_0xf8ca('0x107'));};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x108')]=function(_0x4f46bd){logger['info'](util[_0xf8ca('0x59')](_0xf8ca('0x109'),_0x4f46bd[_0xf8ca('0x3b')]));return this['channel'][_0xf8ca('0xae')](_0xf8ca('0x108'));};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x10a')]=function(_0x100fef){logger[_0xf8ca('0x32')](util['format'](_0xf8ca('0x10b'),_0x100fef['label']));var _0x172b61='';if(_0x100fef[_0xf8ca('0x10c')]){if(!this[_0xf8ca('0xad')](_0x100fef[_0xf8ca('0x10c')])){return this[_0xf8ca('0x3a')][_0xf8ca('0x35')](_0x100fef,_0xf8ca('0x10d'));}else{var _0x3ad287=parseInt(_0x100fef[_0xf8ca('0x10c')],0xa);if(isNaN(_0x3ad287)){_0x172b61=_0x100fef[_0xf8ca('0x10c')];}else{_0x172b61=this[_0xf8ca('0x10e')][_0xf8ca('0x74')](this,_0x100fef[_0xf8ca('0x10c')]);if(!_0x172b61){return this[_0xf8ca('0x3a')][_0xf8ca('0x35')](_0x100fef,_0xf8ca('0x10f'));}}}}else if(_0x100fef['trunk_name']){_0x172b61=_0x100fef[_0xf8ca('0x110')];}else{return this[_0xf8ca('0x3a')][_0xf8ca('0x35')](_0x100fef,_0xf8ca('0x10d'));}var _0x7b940a=this[_0xf8ca('0x3a')][_0xf8ca('0x5d')](_0xf8ca('0xe6'),[util[_0xf8ca('0x59')]('SIP/%s/%s',_0x172b61,_0x100fef[_0xf8ca('0x4d')]),_0x100fef['timeout'],_0x100fef[_0xf8ca('0xe8')],_0x100fef['url']]);if(_0x7b940a['result']===-0x1){return _0x7b940a;}return this[_0xf8ca('0x3a')][_0xf8ca('0xae')](util[_0xf8ca('0x59')]('Executed\x20command\x20%s',_0xf8ca('0xe6')));};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x111')]=function(_0x59a40f){logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')](_0xf8ca('0x112'),_0x59a40f[_0xf8ca('0x3b')]));return this['channel']['noop'](_0xf8ca('0x111'));};AGIVertices['prototype'][_0xf8ca('0xe')]=function(_0xd2548d){logger['info'](util[_0xf8ca('0x59')](_0xf8ca('0x113'),_0xd2548d[_0xf8ca('0x3b')]));if(_0xd2548d[_0xf8ca('0xaa')]===0x0){return this[_0xf8ca('0xa9')](_0xd2548d);}_0xd2548d[_0xf8ca('0xaa')]-=0x1;if(!this[_0xf8ca('0xad')](_0xd2548d[_0xf8ca('0x114')])){return this[_0xf8ca('0x3a')][_0xf8ca('0x35')](_0xd2548d,_0xf8ca('0x115'));}var _0x572522=this['getSound']['sync'](this,_0xd2548d[_0xf8ca('0x114')]);if(!_0x572522){return this[_0xf8ca('0x3a')][_0xf8ca('0x35')](_0xd2548d,_0xf8ca('0x116'));}if(!this[_0xf8ca('0xad')](_0xd2548d[_0xf8ca('0xdd')])){return this[_0xf8ca('0x3a')][_0xf8ca('0x35')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x13980e=this['channel'][_0xf8ca('0x117')](_0x572522,_0xd2548d[_0xf8ca('0x118')],_0xd2548d[_0xf8ca('0x119')]);var _0x3039fd=_0x13980e[_0xf8ca('0xb4')]?_0x13980e[_0xf8ca('0xb4')][_0xf8ca('0x51')]():'';logger[_0xf8ca('0x32')](_0xf8ca('0x11a'),JSON['stringify'](_0x13980e));if(_0x13980e[_0xf8ca('0xb4')]===-0x1){this[_0xf8ca('0x39')]['sync'](this,_0xd2548d,_0x3039fd);return _0x13980e;}else if(_0x13980e[_0xf8ca('0xa7')]===_0xf8ca('0x6a')){_0x13980e[_0xf8ca('0xb4')]=_0x3039fd[_0xf8ca('0xa6')]>=parseInt(_0xd2548d[_0xf8ca('0x11b')])?'x':'i';}else{_0x13980e[_0xf8ca('0xb4')]=_0x3039fd[_0xf8ca('0xa6')]>=parseInt(_0xd2548d[_0xf8ca('0x11b')])&&_0x3039fd[_0xf8ca('0xa6')]<=parseInt(_0xd2548d[_0xf8ca('0x119')])?'x':'i';}var _0x40000=this['getVariable'][_0xf8ca('0x74')](this,_0xd2548d[_0xf8ca('0xdd')]);if(!_0x40000){return this['channel']['error'](_0xd2548d,'no\x20variable\x20found');}this[_0xf8ca('0x3a')][_0xf8ca('0xa4')](_0x40000,_0x3039fd);if(this[_0xf8ca('0xad')](_0xd2548d[_0xf8ca('0x11c')])){var _0x5bee60=parseInt(_0xd2548d['hiddendigitsnum'],0xa);var _0x177af2=rs[_0xf8ca('0x11d')]({'charset':'*','length':_0x5bee60});var _0x51aa1f=_0x3039fd[_0xf8ca('0xa6')];if(_0x51aa1f>0x0){if(_0x51aa1f>_0x5bee60){this[_0xf8ca('0x39')][_0xf8ca('0x74')](this,_0xd2548d,_0xd2548d[_0xf8ca('0x11e')]===_0xf8ca('0x11f')?_0x177af2+_0x3039fd[_0xf8ca('0x120')](_0x5bee60):_0x3039fd[_0xf8ca('0x120')](0x0,_0x51aa1f-_0x5bee60)+_0x177af2);}else{this[_0xf8ca('0x39')][_0xf8ca('0x74')](this,_0xd2548d,rs['generate']({'charset':'*','length':_0x51aa1f}));}}else{this[_0xf8ca('0x39')]['sync'](this,_0xd2548d,'');}}else{this[_0xf8ca('0x39')]['sync'](this,_0xd2548d,_0x3039fd);}return _0x13980e;};AGIVertices[_0xf8ca('0x12')]['getsecretdigits']=function(_0x66faff){logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')](_0xf8ca('0x121'),_0x66faff[_0xf8ca('0x3b')]));return this[_0xf8ca('0xe')](_0x66faff);};AGIVertices['prototype'][_0xf8ca('0x122')]=function(_0x12e5e6){logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')](_0xf8ca('0x123'),_0x12e5e6[_0xf8ca('0x3b')]));this['createSquareDetailsReport'][_0xf8ca('0x74')](this,_0x12e5e6,_0x12e5e6[_0xf8ca('0x124')]);return this['channel'][_0xf8ca('0xae')](util[_0xf8ca('0x59')](_0xf8ca('0x125'),_0x12e5e6[_0xf8ca('0x124')]));};AGIVertices[_0xf8ca('0x12')]['awspolly']=function(_0x12d2ca){logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')](_0xf8ca('0x126'),_0x12d2ca[_0xf8ca('0x3b')]));if(!this[_0xf8ca('0xad')](_0x12d2ca[_0xf8ca('0x8c')])||!this[_0xf8ca('0xad')](_0x12d2ca['aws_secret_access_key'])){return this[_0xf8ca('0x3a')][_0xf8ca('0xae')]('no\x20valid\x20credentials\x20configured');}if(!this[_0xf8ca('0xad')](_0x12d2ca['text'])){return this[_0xf8ca('0x3a')][_0xf8ca('0xae')](_0xf8ca('0xaf'));}this[_0xf8ca('0x3a')][_0xf8ca('0xae')](util[_0xf8ca('0x59')](_0xf8ca('0x127'),_0x12d2ca[_0xf8ca('0x60')]));var _0x87ac22=this[_0xf8ca('0x8b')][_0xf8ca('0x74')](this,_0x12d2ca);if(_0x87ac22){this[_0xf8ca('0x3a')]['noop'](util[_0xf8ca('0x59')](_0xf8ca('0x128'),_0x87ac22));var _0xe28e94=this[_0xf8ca('0x3a')][_0xf8ca('0x103')](_0x87ac22);try{fs[_0xf8ca('0x104')](_0x87ac22+'.wav');}catch(_0x2a633d){logger[_0xf8ca('0x35')](_0x2a633d);}return _0xe28e94;}return this[_0xf8ca('0x3a')][_0xf8ca('0x35')](_0x12d2ca,_0xf8ca('0x129'));};AGIVertices[_0xf8ca('0x12')]['awslex']=function(_0x6defad){logger['info'](util[_0xf8ca('0x59')](_0xf8ca('0x12a'),_0x6defad[_0xf8ca('0x3b')]));if(!this[_0xf8ca('0xad')](_0x6defad[_0xf8ca('0x8c')])||!this[_0xf8ca('0xad')](_0x6defad[_0xf8ca('0x8d')])){return this['channel'][_0xf8ca('0xae')](_0xf8ca('0x12b'));}if(!this['isConfigured'](_0x6defad[_0xf8ca('0x93')])){return this[_0xf8ca('0x3a')]['noop']('no\x20bot\x20name\x20configured');}if(!this[_0xf8ca('0xad')](_0x6defad[_0xf8ca('0x60')])){return this[_0xf8ca('0x3a')][_0xf8ca('0xae')]('no\x20text\x20configured');}this['channel'][_0xf8ca('0xf2')]=!![];this[_0xf8ca('0x39')](_0x6defad);this[_0xf8ca('0x46')](_0x6defad[_0xf8ca('0x60')],'in','','');this['channel'][_0xf8ca('0xae')](util['format'](_0xf8ca('0x12c'),_0x6defad[_0xf8ca('0x60')]));var _0x24c32e=this['awsLex'][_0xf8ca('0x74')](this,_0x6defad);if(_0x24c32e){for(var _0x144613 in _0x24c32e){if(_0x24c32e[_0xf8ca('0x9b')](_0x144613)&&_['isString'](_0x24c32e[_0x144613])){this[_0xf8ca('0x3a')]['setVariable'](util[_0xf8ca('0x59')](_0xf8ca('0x12d'),_0x144613[_0xf8ca('0x6d')]()),_0x24c32e[_0x144613]);}}if(_[_0xf8ca('0x4b')](_0x24c32e[_0xf8ca('0x7b')])){return this[_0xf8ca('0x3a')][_0xf8ca('0xae')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0xf8ca('0x46')](_0x24c32e[_0xf8ca('0x7b')],_0xf8ca('0xed'),_0xf8ca('0x12e'),'');return this[_0xf8ca('0x3a')][_0xf8ca('0xae')](util[_0xf8ca('0x59')]('Amazon\x20Lex\x20Result\x20%s',_0x24c32e[_0xf8ca('0x7b')]));}}return this[_0xf8ca('0x3a')][_0xf8ca('0x35')](_0x6defad,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x12f')]=function(_0x381522){logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')](_0xf8ca('0x130'),_0x381522['label'],_0x381522[_0xf8ca('0x6a')]));if(!this[_0xf8ca('0xad')](_0x381522[_0xf8ca('0x7f')])){return this[_0xf8ca('0x3a')][_0xf8ca('0xae')]('no\x20key\x20configured');}var _0x59b347='wav';var _0x12ae12=util[_0xf8ca('0x59')](_0xf8ca('0x131'),FILES_PATH,rs[_0xf8ca('0x11d')](0x4));var _0x80441=util[_0xf8ca('0x59')](_0xf8ca('0xa3'),_0x12ae12,_0x59b347);var _0x428650=!![];if(_0x381522[_0xf8ca('0x132')]===_0xf8ca('0x133')){_0x428650=![];}var _0x4522c8=this['channel'][_0xf8ca('0x134')](_0x12ae12,_0x59b347,_0x381522[_0xf8ca('0x135')],_0x381522[_0xf8ca('0x6a')],undefined,_0x428650);if(_0x4522c8[_0xf8ca('0xb4')]!==-0x1){this[_0xf8ca('0x3a')][_0xf8ca('0xae')](util['format']('google\x20%s\x20file\x20created',_0x80441));var _0x1d227e=this[_0xf8ca('0x94')][_0xf8ca('0x74')](this,_0x381522,_0x80441);if(_0x1d227e){for(var _0x30be8f in _0x1d227e){if(_0x1d227e[_0xf8ca('0x9b')](_0x30be8f)){this[_0xf8ca('0x3a')][_0xf8ca('0xa4')](util[_0xf8ca('0x59')](_0xf8ca('0x136'),_0x30be8f['toUpperCase']()),_0x1d227e[_0x30be8f]);}}return this[_0xf8ca('0x3a')]['noop'](util[_0xf8ca('0x59')](_0xf8ca('0x137'),JSON[_0xf8ca('0x78')](_0x1d227e)));}}return _0x4522c8;};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x138')]=function(_0x3e067d){logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x3e067d[_0xf8ca('0x3b')]));if(!this[_0xf8ca('0xad')](_0x3e067d[_0xf8ca('0x97')])){return this[_0xf8ca('0x3a')]['noop'](_0xf8ca('0x139'));}if(!this[_0xf8ca('0xad')](_0x3e067d[_0xf8ca('0x98')])){return this['channel'][_0xf8ca('0xae')](_0xf8ca('0x13a'));}var _0xe8fca1='wav';var _0x1f0ba9=util[_0xf8ca('0x59')]('%s/recordings/%s',FILES_PATH,rs[_0xf8ca('0x11d')](0x4));var _0x5cf0e5=util[_0xf8ca('0x59')]('%s.%s',_0x1f0ba9,_0xe8fca1);var _0x436881=!![];if(_0x3e067d[_0xf8ca('0x132')]==='NOBEEP'){_0x436881=![];}var _0x13b2d5=this['channel'][_0xf8ca('0x134')](_0x1f0ba9,_0xe8fca1,_0x3e067d[_0xf8ca('0x135')],_0x3e067d[_0xf8ca('0x6a')],undefined,_0x436881);if(_0x13b2d5[_0xf8ca('0xb4')]!==-0x1){this[_0xf8ca('0x3a')][_0xf8ca('0xae')](util['format']('tilde\x20%s\x20file\x20created',_0x5cf0e5));var _0x5b2ab2=this[_0xf8ca('0x96')][_0xf8ca('0x74')](this,_0x3e067d,_0x5cf0e5);if(_0x5b2ab2){for(var _0x18947d in _0x5b2ab2){if(_0x5b2ab2[_0xf8ca('0x9b')](_0x18947d)){this[_0xf8ca('0x3a')][_0xf8ca('0xa4')](util[_0xf8ca('0x59')](_0xf8ca('0x13b'),_0x18947d['toUpperCase']()),_0x5b2ab2[_0x18947d]);}}return this['channel'][_0xf8ca('0xae')](util[_0xf8ca('0x59')](_0xf8ca('0x13c'),JSON['stringify'](_0x5b2ab2)));}}return _0x13b2d5;};AGIVertices['prototype'][_0xf8ca('0x13d')]=function(_0x4384dd){logger[_0xf8ca('0x32')](util['format'](_0xf8ca('0x13e'),_0x4384dd[_0xf8ca('0x3b')]));return this['channel']['continueAt'](_0x4384dd['context'],_0x4384dd['extension'],_0x4384dd[_0xf8ca('0x43')]);};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x13f')]=function(_0x4b2f46){logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')](_0xf8ca('0x140'),_0x4b2f46[_0xf8ca('0x3b')]));if(!this[_0xf8ca('0xad')](_0x4b2f46[_0xf8ca('0x141')])){return this[_0xf8ca('0x3a')]['error'](_0x4b2f46,_0xf8ca('0x142'));}try{var _0x47a9e3=eval(_0x4b2f46['condition'])?_0xf8ca('0x143'):'false';this[_0xf8ca('0x3a')][_0xf8ca('0xae')](util[_0xf8ca('0x59')]('EVAL\x20CONDITION\x20%s\x20%s',_0x4b2f46[_0xf8ca('0x141')],_0x47a9e3));return{'code':0xc8,'result':_0x47a9e3};}catch(_0x191ef0){return{'code':0xc8,'result':'false'};}};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x144')]=function(_0x5cf93c){logger[_0xf8ca('0x32')](util['format'](_0xf8ca('0x145'),_0x5cf93c['label']));if(!this['isConfigured'](_0x5cf93c[_0xf8ca('0x146')])){return this['channel'][_0xf8ca('0x35')](_0x5cf93c,'no\x20interval\x20configured');}var _0x4ba8b2=this['getIntervals']['sync'](this,_0x5cf93c[_0xf8ca('0x146')]);if(!_0x4ba8b2){return this['channel']['error'](_0x5cf93c,_0xf8ca('0x147'));}for(var _0x1e5a35=0x0;_0x1e5a35<_0x4ba8b2[_0xf8ca('0xa6')];_0x1e5a35+=0x1){var _0x396fca=this['channel']['getVariable'](util['format'](_0xf8ca('0x148'),_0x4ba8b2[_0x1e5a35]));if(_0x396fca[_0xf8ca('0xb4')]===-0x1){return _0x396fca;}logger['info'](util['format']('IFTIME\x20%s\x20%s',_0x4ba8b2[_0x1e5a35],_0x396fca[_0xf8ca('0xa7')]));if(_0x396fca['extra']===_0xf8ca('0x143')){logger['info'](util[_0xf8ca('0x59')](_0xf8ca('0x149'),_0x4ba8b2[_0x1e5a35],_0xf8ca('0x143')));this[_0xf8ca('0x3a')][_0xf8ca('0xae')](util[_0xf8ca('0x59')]('IFTIME\x20%s\x20%s',_0x4ba8b2[_0x1e5a35],'true'));return{'code':0xc8,'result':_0xf8ca('0x143')};}else{logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')](_0xf8ca('0x149'),_0x4ba8b2[_0x1e5a35],_0xf8ca('0x14a')));this[_0xf8ca('0x3a')][_0xf8ca('0xae')](util[_0xf8ca('0x59')]('IFTIME\x20%s\x20%s',_0x4ba8b2[_0x1e5a35],'false'));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0xf8ca('0x12')]['hangup']=function(_0x3131ee){logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')](_0xf8ca('0x14b'),_0x3131ee[_0xf8ca('0x3b')]));return this[_0xf8ca('0x3a')][_0xf8ca('0x14c')]();};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x14d')]=function(_0x16f854){logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')](_0xf8ca('0x14e'),_0x16f854[_0xf8ca('0x3b')]));if(!this[_0xf8ca('0xad')](_0x16f854[_0xf8ca('0x7f')])){return this[_0xf8ca('0x3a')][_0xf8ca('0xae')](_0xf8ca('0xeb'));}var _0x3d1e3e=_0xf8ca('0x14f');var _0x1b2b91=util[_0xf8ca('0x59')](_0xf8ca('0x131'),FILES_PATH,rs[_0xf8ca('0x11d')](0x4));var _0x1baa06=util[_0xf8ca('0x59')]('%s.%s',_0x1b2b91,_0x3d1e3e);var _0x1d491a=!![];if(_0x16f854[_0xf8ca('0x132')]===_0xf8ca('0x133')){_0x1d491a=![];}var _0x1374f9=this[_0xf8ca('0x3a')][_0xf8ca('0x134')](_0x1b2b91,_0x3d1e3e,_0x16f854[_0xf8ca('0x135')],_0x16f854[_0xf8ca('0x6a')],undefined,_0x1d491a);if(_0x1374f9[_0xf8ca('0xb4')]!==-0x1){this['channel']['noop'](util[_0xf8ca('0x59')](_0xf8ca('0x150'),_0x1baa06));var _0x19a657=this['ispeechASR']['sync'](this,_0x16f854,_0x1baa06);if(_0x19a657){for(var _0x506b24 in _0x19a657){if(_0x19a657[_0xf8ca('0x9b')](_0x506b24)){this['channel']['setVariable'](util[_0xf8ca('0x59')](_0xf8ca('0x151'),_0x506b24[_0xf8ca('0x6d')]()),_0x19a657[_0x506b24]);}}return this[_0xf8ca('0x3a')][_0xf8ca('0xae')](util[_0xf8ca('0x59')](_0xf8ca('0x152'),JSON[_0xf8ca('0x78')](_0x19a657)));}}return _0x1374f9;};AGIVertices['prototype']['ispeechtts']=function(_0x428918){logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')](_0xf8ca('0x153'),_0x428918[_0xf8ca('0x3b')]));if(!this[_0xf8ca('0xad')](_0x428918[_0xf8ca('0x7f')])){return this['channel'][_0xf8ca('0xae')](_0xf8ca('0xeb'));}if(!this[_0xf8ca('0xad')](_0x428918[_0xf8ca('0x60')])){return this['channel']['noop']('no\x20text\x20configured');}this[_0xf8ca('0x3a')][_0xf8ca('0xae')](util['format']('Trying\x20ispeech\x20TTS\x20%s',_0x428918[_0xf8ca('0x60')]));var _0x27c96d=this[_0xf8ca('0x85')]['sync'](this,_0x428918);if(_0x27c96d){this[_0xf8ca('0x3a')]['noop'](util['format'](_0xf8ca('0x150'),_0x27c96d));var _0x22aa52=this[_0xf8ca('0x3a')][_0xf8ca('0x103')](_0x27c96d,_0x428918[_0xf8ca('0x135')]);try{fs[_0xf8ca('0x104')](_0x27c96d+_0xf8ca('0x105'));}catch(_0x245c0d){logger[_0xf8ca('0x35')](_0x245c0d);}return _0x22aa52;}return this[_0xf8ca('0x3a')][_0xf8ca('0x35')](_0x428918,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x154')]=function(_0x1800ad){logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x1800ad[_0xf8ca('0x3b')]));if(!this['isConfigured'](_0x1800ad['findBy'])){return this[_0xf8ca('0x3a')][_0xf8ca('0x35')](_0x1800ad,'no\x20find\x20by\x20configured');}logger['info'](util[_0xf8ca('0x59')](_0xf8ca('0x155'),this[_0xf8ca('0x3a')][_0xf8ca('0x40')],_0x1800ad[_0xf8ca('0x156')]));var _0xf3ad4=this[_0xf8ca('0x5b')]['sync'](this,_0x1800ad[_0xf8ca('0x156')]);if(_0xf3ad4){logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xf8ca('0x3a')][_0xf8ca('0x40')],_0x1800ad[_0xf8ca('0x156')]));this[_0xf8ca('0x3a')][_0xf8ca('0xae')](util[_0xf8ca('0x59')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xf8ca('0x3a')][_0xf8ca('0x40')],_0x1800ad[_0xf8ca('0x156')]));return{'code':0xc8,'result':_0xf8ca('0x157')};}else{logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')](_0xf8ca('0x158'),this[_0xf8ca('0x3a')][_0xf8ca('0x40')],_0x1800ad[_0xf8ca('0x156')]));this[_0xf8ca('0x3a')]['noop'](util[_0xf8ca('0x59')](_0xf8ca('0x158'),this[_0xf8ca('0x3a')][_0xf8ca('0x40')],_0x1800ad['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x159')]=function(_0x45c9af){logger[_0xf8ca('0x32')](util['format'](_0xf8ca('0x15a'),_0x45c9af[_0xf8ca('0x3b')]));if(!this[_0xf8ca('0xad')](_0x45c9af[_0xf8ca('0x156')])){return this[_0xf8ca('0x3a')]['error'](_0x45c9af,_0xf8ca('0x15b'));}logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')](_0xf8ca('0x155'),this[_0xf8ca('0x3a')][_0xf8ca('0x40')],_0x45c9af['findBy']));var _0x599fee=this[_0xf8ca('0x57')]['sync'](this,_0x45c9af[_0xf8ca('0x156')]);if(_0x599fee){logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')](_0xf8ca('0x15c'),this[_0xf8ca('0x3a')][_0xf8ca('0x40')],_0x45c9af['findBy']));this['channel'][_0xf8ca('0xae')](util[_0xf8ca('0x59')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xf8ca('0x40')],_0x45c9af[_0xf8ca('0x156')]));return{'code':0xc8,'result':_0xf8ca('0x157')};}else{logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')](_0xf8ca('0x158'),this[_0xf8ca('0x3a')][_0xf8ca('0x40')],_0x45c9af[_0xf8ca('0x156')]));this[_0xf8ca('0x3a')][_0xf8ca('0xae')](util[_0xf8ca('0x59')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xf8ca('0x3a')]['callerid'],_0x45c9af[_0xf8ca('0x156')]));return{'code':0xc8,'result':_0xf8ca('0x15d')};}};AGIVertices['prototype'][_0xf8ca('0x15e')]=function(_0x1e040e){logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')](_0xf8ca('0x15f'),_0x1e040e['label']));if(!this[_0xf8ca('0xad')](_0x1e040e[_0xf8ca('0x160')])){return this['channel'][_0xf8ca('0x35')](_0x1e040e,_0xf8ca('0x161'));}this['channel'][_0xf8ca('0xae')](util[_0xf8ca('0x59')](_0xf8ca('0x162'),_0x1e040e[_0xf8ca('0x160')]));var _0x47805d=eval(_0x1e040e[_0xf8ca('0x160')]);if(!this['isConfigured'](_0x1e040e['variable_id'])){return this['channel'][_0xf8ca('0xae')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x365178=this[_0xf8ca('0x13')][_0xf8ca('0x74')](this,_0x1e040e[_0xf8ca('0xdd')]);if(!_0x365178){return this[_0xf8ca('0x3a')]['error'](_0x1e040e,_0xf8ca('0x163'));}if(_[_0xf8ca('0xa1')](_0x47805d)){var _0x3cfa5e=this;_0x47805d[_0xf8ca('0xdf')](function(_0x304454,_0x40089f){_0x3cfa5e[_0xf8ca('0x3a')]['setVariable'](util[_0xf8ca('0x59')]('%s[%s]',_0x365178,_0x40089f),_0x304454);});return this[_0xf8ca('0x3a')][_0xf8ca('0xae')](util['format'](_0xf8ca('0x164'),_0x365178));}else{return this['channel']['setVariable'](_0x365178,_0x47805d);}};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0xd')]=function(_0x494bf3){logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x494bf3[_0xf8ca('0x3b')]));if(_0x494bf3[_0xf8ca('0xaa')]===0x0){return this[_0xf8ca('0xa9')](_0x494bf3);}_0x494bf3[_0xf8ca('0xaa')]-=0x1;if(!this[_0xf8ca('0xad')](_0x494bf3['file_id'])){return this['channel']['error'](_0x494bf3,_0xf8ca('0x115'));}var _0x293161=this['getSound'][_0xf8ca('0x74')](this,_0x494bf3['file_id']);if(!_0x293161){return this['channel']['error'](_0x494bf3,_0xf8ca('0x116'));}var _0x57b92=this[_0xf8ca('0x3a')][_0xf8ca('0x117')](_0x293161,_0x494bf3[_0xf8ca('0x118')],_0x494bf3[_0xf8ca('0x165')]);var _0x2d5da4=_0x57b92[_0xf8ca('0xb4')];if(_0x57b92['result']===-0x1){this['createSquareDetailsReport']['sync'](this,_0x494bf3,'-1');return _0x57b92;}else if(_0x57b92[_0xf8ca('0xa7')]===_0xf8ca('0x6a')){_0x57b92['result']=_0x57b92[_0xf8ca('0xb4')][_0xf8ca('0xa6')]>0x0?_0x57b92[_0xf8ca('0xb4')]:'t';}else if(_[_0xf8ca('0x48')](_0x57b92[_0xf8ca('0xb4')])){_0x57b92[_0xf8ca('0xb4')]='#';_0x2d5da4='#';}if(!this[_0xf8ca('0xad')](_0x494bf3[_0xf8ca('0xdd')])){this[_0xf8ca('0x3a')]['noop'](_0xf8ca('0xdc'));}else{var _0x169847=this[_0xf8ca('0x13')][_0xf8ca('0x74')](this,_0x494bf3[_0xf8ca('0xdd')]);if(!_0x169847){return this[_0xf8ca('0x3a')]['error'](_0x494bf3,_0xf8ca('0x163'));}this[_0xf8ca('0x3a')][_0xf8ca('0xa4')](_0x169847,_0x2d5da4);}this[_0xf8ca('0x39')][_0xf8ca('0x74')](this,_0x494bf3,_0x2d5da4);return _0x57b92;};AGIVertices[_0xf8ca('0x12')]['noop']=function(_0x200e1e){logger['info'](util[_0xf8ca('0x59')](_0xf8ca('0x166'),_0x200e1e['label']));return this[_0xf8ca('0x3a')][_0xf8ca('0xae')](_0x200e1e[_0xf8ca('0x167')]||_0x200e1e['label']);};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x168')]=function(_0x5e0cd4){logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x5e0cd4['label']));if(!this[_0xf8ca('0xad')](_0x5e0cd4[_0xf8ca('0x156')])){return this[_0xf8ca('0x3a')]['error'](_0x5e0cd4,_0xf8ca('0x15b'));}logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')](_0xf8ca('0x155'),this[_0xf8ca('0x3a')][_0xf8ca('0x40')],_0x5e0cd4['findBy']));var _0x8147da=this[_0xf8ca('0x169')][_0xf8ca('0x74')](this,_0x5e0cd4['pause_id']);var _0x39a495=this['agentPause'][_0xf8ca('0x74')](this,_0x5e0cd4[_0xf8ca('0x156')],_0x8147da);if(_0x39a495){logger['info'](util[_0xf8ca('0x59')](_0xf8ca('0x15c'),this[_0xf8ca('0x3a')][_0xf8ca('0x40')],_0x5e0cd4['findBy']));this[_0xf8ca('0x3a')]['noop'](util[_0xf8ca('0x59')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xf8ca('0x3a')][_0xf8ca('0x40')],_0x5e0cd4[_0xf8ca('0x156')]));return{'code':0xc8,'result':_0xf8ca('0x157')};}else{logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')](_0xf8ca('0x158'),this[_0xf8ca('0x3a')]['callerid'],_0x5e0cd4[_0xf8ca('0x156')]));this[_0xf8ca('0x3a')][_0xf8ca('0xae')](util[_0xf8ca('0x59')](_0xf8ca('0x15c'),this['channel'][_0xf8ca('0x40')],_0x5e0cd4['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x16a')]=function(_0x21f581){logger['info'](util[_0xf8ca('0x59')](_0xf8ca('0x16b'),_0x21f581[_0xf8ca('0x3b')]));if(!this[_0xf8ca('0xad')](_0x21f581['file_id'])){return this[_0xf8ca('0x3a')][_0xf8ca('0x35')](_0x21f581,'no\x20file\x20audio\x20selected');}var _0x4b825d=this[_0xf8ca('0x22')][_0xf8ca('0x74')](this,_0x21f581['file_id']);if(!_0x4b825d){return this[_0xf8ca('0x3a')]['error'](_0x21f581,_0xf8ca('0x116'));}var _0x1e50c5=this['channel']['exec'](_0xf8ca('0x16c'),[_0x4b825d,_0x21f581[_0xf8ca('0xe8')]]);if(_0x1e50c5[_0xf8ca('0xb4')]===-0x1){return _0x1e50c5;}return this[_0xf8ca('0x3a')][_0xf8ca('0xae')](util[_0xf8ca('0x59')]('Executed\x20command\x20%s\x20%s',_0xf8ca('0x16c'),_0x4b825d));};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x16d')]=function(_0xfa12aa){logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')](_0xf8ca('0x16e'),_0xfa12aa[_0xf8ca('0x3b')]));if(!this[_0xf8ca('0xad')](_0xfa12aa[_0xf8ca('0x16f')])){return this[_0xf8ca('0x3a')]['error'](_0xfa12aa,_0xf8ca('0x170'));}var _0x158fbf='';var _0x49e9ed=parseInt(_0xfa12aa[_0xf8ca('0x16f')],0xa);if(isNaN(_0x49e9ed)){_0x158fbf=_0xfa12aa[_0xf8ca('0x16f')];}else{_0x158fbf=this['getVoiceQueue'][_0xf8ca('0x74')](this,_0xfa12aa[_0xf8ca('0x16f')]);if(!_0x158fbf){return this[_0xf8ca('0x3a')]['error'](_0xfa12aa,_0xf8ca('0x171'));}}var _0x21bc95='';if(this[_0xf8ca('0xad')](_0xfa12aa['file_id'])){var _0x10064e=this[_0xf8ca('0x22')]['sync'](this,_0xfa12aa[_0xf8ca('0x114')]);if(_0x10064e){_0x21bc95=_0x10064e;}}this['createSquareDetailsReport'][_0xf8ca('0x74')](this,_0xfa12aa,_0x158fbf);if(_0xfa12aa[_0xf8ca('0xe8')][_0xf8ca('0x172')]('x')<0x0){_0xfa12aa['opts']+='x';}if(_0xfa12aa[_0xf8ca('0xe8')]['indexOf']('X')<0x0){_0xfa12aa[_0xf8ca('0xe8')]+='X';}this[_0xf8ca('0x3a')][_0xf8ca('0xa4')]('XMCS-QUEUE',_0x158fbf?_0x158fbf['toLowerCase']():'');var _0x1ee7da=this[_0xf8ca('0x3a')][_0xf8ca('0x5d')](_0xf8ca('0x173'),[_0x158fbf,_0xfa12aa[_0xf8ca('0xe8')],_0xfa12aa[_0xf8ca('0x77')],_0x21bc95,_0xfa12aa[_0xf8ca('0x6a')],_0xfa12aa[_0xf8ca('0x7')],_0xfa12aa[_0xf8ca('0x174')],_0xfa12aa[_0xf8ca('0x175')],'',_0xfa12aa['position']]);if(_0x1ee7da[_0xf8ca('0xb4')]===-0x1){return _0x1ee7da;}return this['channel'][_0xf8ca('0xae')](util[_0xf8ca('0x59')]('Executed\x20command\x20%s\x20%s',_0xf8ca('0x173'),_0x158fbf));};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x176')]=function(_0x2c8883){logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')](_0xf8ca('0x177'),_0x2c8883[_0xf8ca('0x3b')]));var _0x408cd9=_0x2c8883['recordingFormat']||_0xf8ca('0x14f');var _0x5dd54e=util['format'](_0xf8ca('0x178'),this[_0xf8ca('0x3a')][_0xf8ca('0x3f')],rs['generate'](0x5));var _0x1feff5=util[_0xf8ca('0x59')](_0xf8ca('0x179'),FILES_PATH,_0x5dd54e,_0x408cd9);var _0x5c558e=util[_0xf8ca('0x59')](_0xf8ca('0x131'),FILES_PATH,_0x5dd54e);this[_0xf8ca('0x3e')][_0xf8ca('0x74')](this,_0x2c8883,_0x5dd54e,_0x1feff5);this[_0xf8ca('0x3a')][_0xf8ca('0xa4')]('RECORDING_SAVENAME',_0x5dd54e);logger['info'](_0xf8ca('0x17a'),_0x5c558e,_0x408cd9,_0x2c8883[_0xf8ca('0x17b')],_0x2c8883[_0xf8ca('0x6a')]);return this[_0xf8ca('0x3a')]['recordFile'](_0x5c558e,_0x408cd9,_0x2c8883[_0xf8ca('0x17b')],_0x2c8883[_0xf8ca('0x6a')],undefined,!![]);};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x17c')]=function(_0x39aecb){logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')](_0xf8ca('0x17d'),_0x39aecb[_0xf8ca('0x3b')]));if(!this[_0xf8ca('0xad')](_0x39aecb[_0xf8ca('0x77')])){return this[_0xf8ca('0x3a')][_0xf8ca('0xae')]('no\x20url\x20configured');}var _0xf40d36=this['restAPI'][_0xf8ca('0x74')](this,_0x39aecb);logger['info'](util[_0xf8ca('0x59')](_0xf8ca('0x17e'),util['inspect'](_0xf40d36,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x39aecb[_0xf8ca('0xdd')])){return this[_0xf8ca('0x3a')][_0xf8ca('0xae')](_0xf8ca('0x17f'));}var _0x2d67d0=this[_0xf8ca('0x13')][_0xf8ca('0x74')](this,_0x39aecb['variable_id']);if(!_0x2d67d0){return this[_0xf8ca('0x3a')]['error'](_0x39aecb,'no\x20variable\x20found');}this[_0xf8ca('0x3a')]['setVariable'](util['format']('%s_STATUS_CODE',_0x2d67d0),_0xf40d36[_0xf8ca('0x7a')]?_0xf40d36[_0xf8ca('0x7a')]:'200');this['channel'][_0xf8ca('0xa4')](util[_0xf8ca('0x59')]('%s_STATUS_MESSAGE',_0x2d67d0),_0xf40d36[_0xf8ca('0x180')]?_0xf40d36[_0xf8ca('0x180')]:'OK');if(_0xf40d36['body']){try{this['saveRestApiResult'](_0xf40d36['body'],_0x2d67d0);}catch(_0x2aec49){logger[_0xf8ca('0x35')](util[_0xf8ca('0x59')](_0xf8ca('0x181'),_0x2d67d0));}}return this[_0xf8ca('0x3a')]['noop'](util[_0xf8ca('0x59')](_0xf8ca('0xe1'),_0x2d67d0));};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x182')]=function(_0x1477b2){logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x1477b2[_0xf8ca('0x3b')]));return this[_0xf8ca('0x3a')][_0xf8ca('0x183')](_0x1477b2[_0xf8ca('0x184')]['replace'](/\s+/g,''),_0x1477b2[_0xf8ca('0x17b')]);};AGIVertices[_0xf8ca('0x12')]['saynumber']=function(_0x4c2c1f){logger[_0xf8ca('0x32')](util['format']('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x4c2c1f[_0xf8ca('0x3b')]));return this[_0xf8ca('0x3a')][_0xf8ca('0x185')](_0x4c2c1f[_0xf8ca('0x186')][_0xf8ca('0x5e')](/\s+/g,''),_0x4c2c1f[_0xf8ca('0x17b')]);};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x187')]=function(_0x4fb9a2){logger['info'](util[_0xf8ca('0x59')](_0xf8ca('0x188'),_0x4fb9a2[_0xf8ca('0x3b')]));return this[_0xf8ca('0x3a')][_0xf8ca('0x189')](_0x4fb9a2[_0xf8ca('0x60')],_0x4fb9a2['escape_digits']);};AGIVertices[_0xf8ca('0x12')]['sendMail']=function(_0x74a84){logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x74a84[_0xf8ca('0x3b')]));if(!this['isConfigured'](_0x74a84['account_id'])){return this[_0xf8ca('0x3a')][_0xf8ca('0xae')](_0xf8ca('0x18a'));}var _0x96cd3c=this[_0xf8ca('0x24')][_0xf8ca('0x74')](this,_0x74a84[_0xf8ca('0x18b')]);if(!_0x96cd3c||!_0x96cd3c[_0xf8ca('0x18c')]){return this['channel'][_0xf8ca('0x35')](_0x74a84,_0xf8ca('0x18d'));}var _0x940ae6={'from':util[_0xf8ca('0x59')](_0xf8ca('0x18e'),_0x96cd3c[_0xf8ca('0x16')],_0x96cd3c['email']||_0x96cd3c['Smtp'][_0xf8ca('0x18f')]),'to':_0x74a84['to']||'','cc':_0x74a84['cc']||'','bcc':_0x74a84['bcc']||'','subject':_0x74a84[_0xf8ca('0x190')],'html':_0x74a84[_0xf8ca('0x60')],'text':_0x74a84[_0xf8ca('0x60')]};if(this[_0xf8ca('0xad')](_0x74a84[_0xf8ca('0x191')])){}logger[_0xf8ca('0xe3')]('sendMail\x20message',JSON[_0xf8ca('0x78')](_0x940ae6));this['createSquareDetailsReport']['sync'](this,_0x74a84,_0x74a84['account_id']);this[_0xf8ca('0x3a')]['noop'](util[_0xf8ca('0x59')](_0xf8ca('0x192'),_0x96cd3c['name']));this[_0xf8ca('0x26')][_0xf8ca('0x74')](this,_0x96cd3c[_0xf8ca('0x193')],_0x940ae6);return this[_0xf8ca('0x3a')]['noop'](_0xf8ca('0x194'));};AGIVertices['prototype']['sendFax']=function(_0x3a2545){logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')](_0xf8ca('0x195'),_0x3a2545['label']));return this[_0xf8ca('0x3a')][_0xf8ca('0xae')](_0xf8ca('0x196'));};AGIVertices['prototype'][_0xf8ca('0x197')]=function(_0x4e3d64){logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')](_0xf8ca('0x198'),_0x4e3d64[_0xf8ca('0x3b')]));if(!this[_0xf8ca('0xad')](_0x4e3d64['sms_account_id'])){return this[_0xf8ca('0x3a')][_0xf8ca('0xae')]('no\x20sms\x20account\x20configured');}var _0x2cd5c1=this[_0xf8ca('0x36')][_0xf8ca('0x74')](this,_0x4e3d64[_0xf8ca('0x199')]);if(!_0x2cd5c1){return this[_0xf8ca('0x3a')][_0xf8ca('0x35')](_0x4e3d64,_0xf8ca('0x19a'));}var _0x598d09={'body':_0x4e3d64['sms_text'],'phone':_0x4e3d64['to']||'','SmsAccountId':_0x2cd5c1['id']};logger[_0xf8ca('0xe3')](_0xf8ca('0x19b'),JSON[_0xf8ca('0x78')](_0x598d09));this['createSquareDetailsReport']['sync'](this,_0x4e3d64,_0x4e3d64[_0xf8ca('0x199')]);this['channel']['noop'](util[_0xf8ca('0x59')](_0xf8ca('0x19c'),_0x2cd5c1['name']));this[_0xf8ca('0x38')][_0xf8ca('0x74')](this,_0x598d09);return this[_0xf8ca('0x3a')][_0xf8ca('0xae')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x19d')]=function(_0x51e372){logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x51e372[_0xf8ca('0x3b')]));if(!this[_0xf8ca('0xad')](_0x51e372[_0xf8ca('0xdd')])){return this[_0xf8ca('0x3a')]['error'](_0x51e372,_0xf8ca('0x19e'));}var _0x382f9d=this[_0xf8ca('0x13')][_0xf8ca('0x74')](this,_0x51e372[_0xf8ca('0xdd')]);if(!_0x382f9d){return this[_0xf8ca('0x3a')]['error'](_0x51e372,_0xf8ca('0x163'));}return this[_0xf8ca('0x3a')]['setVariable'](_0x382f9d,_0x51e372['variable_value']);};AGIVertices['prototype'][_0xf8ca('0x19f')]=function(_0x1c4260){logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')]('Enter\x20in\x20START\x20(%s)\x20block',_0x1c4260['label']));this['channel'][_0xf8ca('0xae')](_0xf8ca('0x1a0'));if(_0x1c4260[_0xf8ca('0xbc')]==='yes'){this[_0xf8ca('0x3a')][_0xf8ca('0xae')](_0xf8ca('0x1a1'));return this[_0xf8ca('0x3a')][_0xf8ca('0xbc')]();}return this[_0xf8ca('0x3a')][_0xf8ca('0xae')](_0xf8ca('0x1a2'));};AGIVertices['prototype'][_0xf8ca('0x1a3')]=function(_0x3ee62b){logger[_0xf8ca('0x32')](util['format'](_0xf8ca('0x1a4'),_0x3ee62b['label']));if(!this[_0xf8ca('0xad')](_0x3ee62b[_0xf8ca('0x1a5')])){return this[_0xf8ca('0x3a')][_0xf8ca('0x35')](_0x3ee62b,_0xf8ca('0x1a6'));}var _0x2ff6=this['getSquareProject']['sync'](this,_0x3ee62b['project_id']);if(!this[_0xf8ca('0xad')](_0x2ff6)){return this[_0xf8ca('0x3a')][_0xf8ca('0x35')](_0x3ee62b,util[_0xf8ca('0x59')](_0xf8ca('0x1a7'),_0x3ee62b[_0xf8ca('0x1a5')]));}if(_0x2ff6===this[_0xf8ca('0x3a')][_0xf8ca('0x3d')]){return this[_0xf8ca('0x3a')][_0xf8ca('0x35')](_0x3ee62b,_0xf8ca('0x1a8'));}this[_0xf8ca('0x39')][_0xf8ca('0x74')](this,_0x3ee62b,_0x2ff6);var _0x4cbc73=this[_0xf8ca('0x3a')][_0xf8ca('0x5d')](_0xf8ca('0x1a9'),util['format'](_0xf8ca('0x1aa'),config[_0xf8ca('0x7')][_0xf8ca('0x1ab')]||_0xf8ca('0x1ac'),_0x2ff6,this['channel'][_0xf8ca('0x3d')]));if(_0x4cbc73[_0xf8ca('0xb4')]===-0x1){return _0x4cbc73;}return this[_0xf8ca('0x3a')][_0xf8ca('0xae')](util['format'](_0xf8ca('0xc8'),_0xf8ca('0x1a9'),_0x2ff6));};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x1ad')]=function(_0x2378d1){logger[_0xf8ca('0x32')](util['format']('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x2378d1['label']));var _0x3f2c8b=this[_0xf8ca('0x5c')][_0xf8ca('0x74')](this,_0x2378d1[_0xf8ca('0x1ae')]);this[_0xf8ca('0x39')][_0xf8ca('0x74')](this,_0x2378d1,_0x2378d1[_0xf8ca('0x1ae')]);if(this[_0xf8ca('0xad')](_0x2378d1[_0xf8ca('0xdd')])){var _0x188ddb=this[_0xf8ca('0x13')]['sync'](this,_0x2378d1[_0xf8ca('0xdd')]);if(_0x188ddb){this[_0xf8ca('0x3a')][_0xf8ca('0xa4')](_0x188ddb,_0x3f2c8b);return this[_0xf8ca('0x3a')][_0xf8ca('0xae')](util[_0xf8ca('0x59')](_0xf8ca('0x1af'),_0x2378d1[_0xf8ca('0x1ae')],_0x188ddb));}}return this[_0xf8ca('0x3a')]['noop'](util[_0xf8ca('0x59')](_0xf8ca('0x1b0'),_0x2378d1[_0xf8ca('0x1ae')]));};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x1b1')]=function(_0x2dfda1){logger['info'](util[_0xf8ca('0x59')](_0xf8ca('0x1b2'),_0x2dfda1[_0xf8ca('0x3b')]));_0x2dfda1['text']=_0x2dfda1[_0xf8ca('0x60')][_0xf8ca('0x5e')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xf8ca('0xad')](_0x2dfda1['apiKey'])){return this[_0xf8ca('0x3a')][_0xf8ca('0xae')](_0xf8ca('0x1b3'));}if(!this[_0xf8ca('0xad')](_0x2dfda1['text'])){return this[_0xf8ca('0x3a')]['noop'](_0xf8ca('0xaf'));}this[_0xf8ca('0x3a')]['noop'](util[_0xf8ca('0x59')](_0xf8ca('0x1b4'),_0x2dfda1[_0xf8ca('0x60')]));var _0x112fb4=this[_0xf8ca('0x5f')][_0xf8ca('0x74')](this,_0x2dfda1);if(_0x112fb4){this[_0xf8ca('0x3a')]['noop'](util[_0xf8ca('0x59')](_0xf8ca('0x1b5'),_0x112fb4));var _0xf67cf6=this[_0xf8ca('0x3a')][_0xf8ca('0x103')](_0x112fb4);try{fs[_0xf8ca('0x104')](_0x112fb4+_0xf8ca('0x105'));}catch(_0x1116dd){logger[_0xf8ca('0x35')](_0x1116dd);}return _0xf67cf6;}return this['channel'][_0xf8ca('0x35')](_0x2dfda1,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x1b6')]=function(_0x4335bf){logger[_0xf8ca('0x32')](util['format'](_0xf8ca('0x1b7'),_0x4335bf[_0xf8ca('0x3b')]));_0x4335bf['text']=_0x4335bf[_0xf8ca('0x60')][_0xf8ca('0x5e')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xf8ca('0xad')](_0x4335bf[_0xf8ca('0x60')])){return this['channel']['noop'](_0xf8ca('0xaf'));}this[_0xf8ca('0x3a')]['noop'](util[_0xf8ca('0x59')](_0xf8ca('0x1b8'),_0x4335bf[_0xf8ca('0x60')]));var _0x277d54=this[_0xf8ca('0x66')]['sync'](this,_0x4335bf);if(_0x277d54){this[_0xf8ca('0x3a')][_0xf8ca('0xae')](util[_0xf8ca('0x59')](_0xf8ca('0x1b9'),_0x277d54));var _0x1a5445=this[_0xf8ca('0x3a')][_0xf8ca('0x103')](_0x277d54);try{fs[_0xf8ca('0x104')](_0x277d54+_0xf8ca('0x105'));}catch(_0x277c4b){logger['error'](_0x277c4b);}return _0x1a5445;}return this['channel'][_0xf8ca('0x35')](_0x4335bf,_0xf8ca('0x1ba'));};AGIVertices['prototype'][_0xf8ca('0x1bb')]=function(_0x53adad){logger[_0xf8ca('0x32')](util['format'](_0xf8ca('0x1bc'),_0x53adad['label']));if(!this[_0xf8ca('0xad')](_0x53adad[_0xf8ca('0x156')])){return this[_0xf8ca('0x3a')][_0xf8ca('0x35')](_0x53adad,_0xf8ca('0x15b'));}logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')](_0xf8ca('0x155'),this[_0xf8ca('0x3a')][_0xf8ca('0x40')],_0x53adad[_0xf8ca('0x156')]));var _0x4297e1=this['agentUnpause'][_0xf8ca('0x74')](this,_0x53adad[_0xf8ca('0x156')]);if(_0x4297e1){logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')](_0xf8ca('0x15c'),this[_0xf8ca('0x3a')][_0xf8ca('0x40')],_0x53adad[_0xf8ca('0x156')]));this['channel'][_0xf8ca('0xae')](util[_0xf8ca('0x59')](_0xf8ca('0x15c'),this[_0xf8ca('0x3a')]['callerid'],_0x53adad[_0xf8ca('0x156')]));return{'code':0xc8,'result':_0xf8ca('0x157')};}else{logger[_0xf8ca('0x32')](util['format'](_0xf8ca('0x158'),this['channel'][_0xf8ca('0x40')],_0x53adad[_0xf8ca('0x156')]));this[_0xf8ca('0x3a')][_0xf8ca('0xae')](util[_0xf8ca('0x59')](_0xf8ca('0x158'),this[_0xf8ca('0x3a')][_0xf8ca('0x40')],_0x53adad[_0xf8ca('0x156')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype']['voicemail']=function(_0x102efb){logger[_0xf8ca('0x32')](util['format'](_0xf8ca('0x1bd'),_0x102efb['label']));var _0x72d0a4=this['channel']['exec'](_0xf8ca('0x1be'),[_0x102efb[_0xf8ca('0x1bf')],_0x102efb[_0xf8ca('0x7d')]]);if(_0x72d0a4[_0xf8ca('0xb4')]===-0x1){return _0x72d0a4;}return this[_0xf8ca('0x3a')][_0xf8ca('0xae')](util['format'](_0xf8ca('0xc8'),_0xf8ca('0x1be'),_0x102efb[_0xf8ca('0x1bf')]));};AGIVertices[_0xf8ca('0x12')][_0xf8ca('0x1c0')]=function(_0x3a70e5){logger[_0xf8ca('0x32')](util[_0xf8ca('0x59')](_0xf8ca('0x1c1'),_0x3a70e5[_0xf8ca('0x3b')]));if(!this[_0xf8ca('0xad')](_0x3a70e5[_0xf8ca('0xdd')])){return this[_0xf8ca('0x3a')][_0xf8ca('0x35')](_0x3a70e5,_0xf8ca('0x19e'));}var _0x4556c5=this[_0xf8ca('0x13')][_0xf8ca('0x74')](this,_0x3a70e5[_0xf8ca('0xdd')]);if(!_0x4556c5){return this[_0xf8ca('0x3a')][_0xf8ca('0x35')](_0x3a70e5,_0xf8ca('0x163'));}var _0x3b1c7e=this[_0xf8ca('0x3a')][_0xf8ca('0x13')](_0x4556c5);return{'code':0xc8,'result':_0x3b1c7e[_0xf8ca('0xa7')]?_0x3b1c7e[_0xf8ca('0xa7')]:'-'};};String[_0xf8ca('0x12')][_0xf8ca('0x1c2')]=function(_0x556039,_0x14db72){return this[_0xf8ca('0xa5')](_0x556039)[_0xf8ca('0x1c3')](_0x14db72);};module[_0xf8ca('0x1c4')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index e07abfe..e259834 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 _0xce6b=['[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','syncHangup','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','hangup','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','prototype','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','then','getAgent','voicePause','attended','destlinkedid','savePause','info','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xce6b,0x11b));var _0xbce6=function(_0x1a775d,_0x497a66){_0x1a775d=_0x1a775d-0x0;var _0x27ef4e=_0xce6b[_0x1a775d];return _0x27ef4e;};'use strict';var util=require(_0xbce6('0x0'));var _=require(_0xbce6('0x1'));var moment=require(_0xbce6('0x2'));var ami=require(_0xbce6('0x3'));var logger=require('../../../config/logger')(_0xbce6('0x4'));var RpcUser=require(_0xbce6('0x5'));var RpcVoiceAgentReport=require(_0xbce6('0x6'));function Acw(_0x590925){this[_0xbce6('0x7')]=_0x590925[_0xbce6('0x7')];this[_0xbce6('0x8')]=_0x590925[_0xbce6('0x8')];this[_0xbce6('0x9')]=_0x590925[_0xbce6('0x9')];this[_0xbce6('0xa')]={};ami['on'](_0xbce6('0xb'),this[_0xbce6('0xc')][_0xbce6('0xd')](this));ami['on'](_0xbce6('0xe'),this['syncHangupRequest'][_0xbce6('0xd')](this));ami['on'](_0xbce6('0xf'),this['syncHangup']['bind'](this));ami['on']('agentringnoanswer',this[_0xbce6('0x10')][_0xbce6('0xd')](this));ami['on']('attendedtransfer',this[_0xbce6('0x11')]['bind'](this));ami['on'](_0xbce6('0x12'),this[_0xbce6('0x13')][_0xbce6('0xd')](this));ami['on'](_0xbce6('0x14'),this['syncAgentConnectPreview']['bind'](this));}function getDiff(_0x2fb8ce){var _0x1302ff=moment()['milliseconds'](0x0);var _0x451eec=moment(_0x2fb8ce)[_0xbce6('0x15')](0x0);return _0x1302ff[_0xbce6('0x16')](_0x451eec,'seconds');}Acw[_0xbce6('0x17')][_0xbce6('0x18')]=function(_0x1c66e8){try{var _0x51151=this;var _0x42ab34=this[_0xbce6('0xa')][_0x1c66e8][_0xbce6('0x19')];var _0x3aea9f=this[_0xbce6('0xa')][_0x1c66e8][_0xbce6('0x1a')];var _0x59300e=this[_0xbce6('0x7')][_0x3aea9f];var _0x31e7e2=![];var _0x22b591=_0xbce6('0x1b');if(_0x59300e[_0xbce6('0x1c')]){if(_0x59300e[_0xbce6('0x1d')][_0xbce6('0x1e')]){_0x31e7e2=!![];_0x22b591=_0x59300e[_0xbce6('0x1d')][_0xbce6('0x1e')];}}ami['Action']({'action':_0xbce6('0x1f'),'interface':_0x42ab34,'paused':!![],'reason':_0x22b591})[_0xbce6('0x20')](function(_0x377f90){if(_0x51151[_0xbce6('0x8')][_0x42ab34]){return RpcUser[_0xbce6('0x21')](_0x51151['agents'][_0x42ab34]['id'])[_0xbce6('0x20')](function(_0x1a2b9f){if(_0x1a2b9f&&!_0x1a2b9f[_0xbce6('0x22')]){logger['info']('[%s][START][AGENT:%s][QUEUE:%s]',_0x1c66e8,_0x42ab34,_0x3aea9f);var _0x188523=_0x51151['channels'][_0x1c66e8][_0xbce6('0x23')]&&_0x51151[_0xbce6('0xa')][_0x1c66e8][_0xbce6('0x24')]?_0x51151[_0xbce6('0xa')][_0x1c66e8]['destlinkedid']:_0x1c66e8;return RpcUser[_0xbce6('0x25')](_0x51151[_0xbce6('0x8')][_0x42ab34],_0x22b591,_0x188523)[_0xbce6('0x20')](function(_0x340858){if(!_0x31e7e2){_0x51151[_0xbce6('0x9')][_0x42ab34]={};logger[_0xbce6('0x26')](_0xbce6('0x27'),_0x1c66e8,_0x51151[_0xbce6('0x7')][_0x3aea9f][_0xbce6('0x28')],_0x42ab34,_0x3aea9f);_0x51151[_0xbce6('0x9')][_0x42ab34][_0xbce6('0x29')]=setTimeout(_0x51151[_0xbce6('0x2a')][_0xbce6('0xd')](_0x51151,_0x42ab34),_0x51151[_0xbce6('0x7')][_0x3aea9f]['acwTimeout']*0x3e8);_0x51151[_0xbce6('0x9')][_0x42ab34][_0xbce6('0x2b')]=moment()[_0xbce6('0x2c')](_0xbce6('0x2d'));_0x51151[_0xbce6('0x9')][_0x42ab34][_0xbce6('0x2e')]=_0x1c66e8;_0x51151[_0xbce6('0x9')][_0x42ab34][_0xbce6('0x1a')]=_0x3aea9f;_0x51151[_0xbce6('0x9')][_0x42ab34]['updateAcw']=function(){var _0x3b333d=getDiff(_0x51151[_0xbce6('0x9')][_0x42ab34][_0xbce6('0x2b')]);clearTimeout(_0x51151[_0xbce6('0x9')][_0x42ab34][_0xbce6('0x29')]);_0x51151[_0xbce6('0x9')][_0x42ab34]['timer']=![];RpcVoiceAgentReport[_0xbce6('0x2f')]({'acwtime':_0x3b333d},_0x51151['timers'][_0x42ab34][_0xbce6('0x2e')],_0x42ab34)[_0xbce6('0x20')](function(_0x24547d){logger['info'](_0xbce6('0x30'),_0x1c66e8,_0x3b333d,_0x24547d);})[_0xbce6('0x31')](function(_0xfc8ff0){logger[_0xbce6('0x32')]('[%s][UPDATE][ERRORS:%s]',_0x1c66e8,_0xfc8ff0);});delete _0x51151[_0xbce6('0x9')][_0x42ab34];};}});}else{logger['info'](_0xbce6('0x33'),_0x1c66e8,_0x42ab34,_0x3aea9f);}});}})['catch'](function(_0x13cbd5){logger[_0xbce6('0x32')](_0xbce6('0x27'),_0x1c66e8,_0x51151[_0xbce6('0x7')][_0x3aea9f]['acwTimeout'],_0x42ab34,_0x3aea9f);})[_0xbce6('0x34')](function(){delete _0x51151[_0xbce6('0xa')][_0x1c66e8];});}catch(_0x271ae6){logger['error'](_0xbce6('0x35'),_0x271ae6[_0xbce6('0x36')]);}};Acw[_0xbce6('0x17')][_0xbce6('0x2a')]=function(_0xd35015){try{var _0x30e097=this;if(_0x30e097[_0xbce6('0x9')][_0xd35015]){_0x30e097[_0xbce6('0x9')][_0xd35015][_0xbce6('0x29')]=![];var _0x3b588a=_0x30e097[_0xbce6('0x9')][_0xd35015][_0xbce6('0x2e')];var _0x4a239d=_0x30e097['timers'][_0xd35015][_0xbce6('0x1a')];var _0x3efdce=_0x30e097[_0xbce6('0x7')][_0x4a239d][_0xbce6('0x28')];logger['info'](_0xbce6('0x37'),_0x3b588a,_0xd35015);RpcUser[_0xbce6('0x38')](this['agents'][_0xd35015]);RpcVoiceAgentReport[_0xbce6('0x2f')]({'acwtime':_0x3efdce,'agentacw':!![]},_0x3b588a,_0xd35015)[_0xbce6('0x20')](function(_0x19cac1){logger[_0xbce6('0x26')]('[%s][UPDATE][ACWTIME:%s]',_0x3b588a,_0x3efdce,_0x19cac1);})[_0xbce6('0x31')](function(_0x198b63){logger[_0xbce6('0x32')](_0xbce6('0x39'),_0x3b588a,_0x198b63);});}else{logger['error']('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0xd35015);if(_0x30e097['timers']){logger['info'](_0xbce6('0x3a'),JSON[_0xbce6('0x3b')](_0x30e097[_0xbce6('0x9')]));}}}catch(_0x4234d1){logger[_0xbce6('0x32')](_0xbce6('0x3c'),_0x4234d1[_0xbce6('0x36')]);}};Acw['prototype'][_0xbce6('0xc')]=function(_0x156d3c){try{if(this['voiceQueues'][_0x156d3c['queue']]&&(this[_0xbce6('0x7')][_0x156d3c[_0xbce6('0x1a')]][_0xbce6('0x4')]||this[_0xbce6('0x7')][_0x156d3c[_0xbce6('0x1a')]][_0xbce6('0x1c')])){if(this[_0xbce6('0x8')][_0x156d3c[_0xbce6('0x19')]]){this['channels'][_0x156d3c[_0xbce6('0x2e')]]={'queue':_0x156d3c[_0xbce6('0x1a')],'interface':_0x156d3c[_0xbce6('0x19')],'destlinkedid':_0x156d3c[_0xbce6('0x24')]};}}}catch(_0x4a59b7){logger[_0xbce6('0x32')](_0xbce6('0x3d'),_0x4a59b7[_0xbce6('0x36')]);}};Acw[_0xbce6('0x17')][_0xbce6('0x3e')]=function(_0x78f66a){try{if(this[_0xbce6('0x7')][_0x78f66a[_0xbce6('0x1a')]]&&(this[_0xbce6('0x7')][_0x78f66a[_0xbce6('0x1a')]][_0xbce6('0x4')]||this[_0xbce6('0x7')][_0x78f66a[_0xbce6('0x1a')]][_0xbce6('0x1c')])){if(this[_0xbce6('0x8')][_0x78f66a[_0xbce6('0x19')]]){this[_0xbce6('0xa')][_0x78f66a['uniqueid']]={'queue':_0x78f66a[_0xbce6('0x1a')],'interface':_0x78f66a[_0xbce6('0x19')]};}}}catch(_0x33256b){logger[_0xbce6('0x32')](_0xbce6('0x3f'),_0x33256b[_0xbce6('0x36')]);}};Acw[_0xbce6('0x17')]['syncHangupRequest']=function(_0x3eaa07){try{if(this[_0xbce6('0xa')][_0x3eaa07[_0xbce6('0x2e')]]&&_[_0xbce6('0x40')](this[_0xbce6('0xa')][_0x3eaa07[_0xbce6('0x2e')]][_0xbce6('0x23')])){logger[_0xbce6('0x26')](_0xbce6('0x41'),_0x3eaa07[_0xbce6('0x2e')]);this[_0xbce6('0x18')](_0x3eaa07[_0xbce6('0x2e')]);}else if(this[_0xbce6('0xa')][_0x3eaa07[_0xbce6('0x42')]]&&_[_0xbce6('0x40')](this[_0xbce6('0xa')][_0x3eaa07[_0xbce6('0x42')]]['attended'])){logger[_0xbce6('0x26')](_0xbce6('0x43'),_0x3eaa07[_0xbce6('0x42')]);this[_0xbce6('0x18')](_0x3eaa07[_0xbce6('0x42')]);}}catch(_0x4f1c8a){logger['error']('[ACW][syncHangupRequest]\x20%s',_0x4f1c8a[_0xbce6('0x36')]);}};Acw[_0xbce6('0x17')][_0xbce6('0x44')]=function(_0x23ceb5){try{if(this[_0xbce6('0xa')][_0x23ceb5[_0xbce6('0x2e')]]&&this[_0xbce6('0xa')][_0x23ceb5[_0xbce6('0x2e')]][_0xbce6('0x23')]){logger['info']('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x23ceb5[_0xbce6('0x2e')]);this['startAcw'](_0x23ceb5[_0xbce6('0x2e')]);}else if(this[_0xbce6('0xa')][_0x23ceb5[_0xbce6('0x42')]]&&this[_0xbce6('0xa')][_0x23ceb5[_0xbce6('0x42')]]['attended']){logger[_0xbce6('0x26')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x23ceb5[_0xbce6('0x42')]);this['startAcw'](_0x23ceb5[_0xbce6('0x42')]);}}catch(_0x2c1613){logger[_0xbce6('0x32')](_0xbce6('0x45'),_0x2c1613[_0xbce6('0x36')]);}};Acw['prototype'][_0xbce6('0x11')]=function(_0x5f481b){try{if(!_[_0xbce6('0x46')](this['channels'][_0x5f481b['transfereeuniqueid']])){this[_0xbce6('0x18')](_0x5f481b[_0xbce6('0x47')]);if(this[_0xbce6('0xa')][_0x5f481b[_0xbce6('0x48')]]){this[_0xbce6('0xa')][_0x5f481b[_0xbce6('0x48')]]['attended']=!![];this[_0xbce6('0xa')][_0x5f481b['transfertargetuniqueid']]=this[_0xbce6('0xa')][_0x5f481b[_0xbce6('0x48')]];delete this['channels'][_0x5f481b[_0xbce6('0x48')]];}}else if(!_[_0xbce6('0x46')](this[_0xbce6('0xa')][_0x5f481b['transfertargetuniqueid']])){this['startAcw'](_0x5f481b['transfertargetuniqueid']);if(this[_0xbce6('0xa')][_0x5f481b['origtransfereruniqueid']]){this['channels'][_0x5f481b[_0xbce6('0x49')]][_0xbce6('0x23')]=!![];this[_0xbce6('0xa')][_0x5f481b['transfereeuniqueid']]=this[_0xbce6('0xa')][_0x5f481b['origtransfereruniqueid']];delete this[_0xbce6('0xa')][_0x5f481b['origtransfereruniqueid']];}}}catch(_0x1d4a9e){logger['error'](_0xbce6('0x4a'),_0x1d4a9e['message']);}};Acw[_0xbce6('0x17')][_0xbce6('0x13')]=function(_0x443e74){try{if(this['channels'][_0x443e74[_0xbce6('0x4b')]]){logger['info'](_0xbce6('0x4c'),JSON[_0xbce6('0x3b')](_0x443e74['transfereruniqueid']));this[_0xbce6('0x18')](_0x443e74[_0xbce6('0x4b')]);}else if(this[_0xbce6('0xa')][_0x443e74[_0xbce6('0x4d')]]){logger[_0xbce6('0x26')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0xbce6('0x3b')](_0x443e74[_0xbce6('0x4d')]));this['startAcw'](_0x443e74['transfererlinkedid']);}}catch(_0x321015){logger[_0xbce6('0x32')](_0xbce6('0x4e'),_0x321015[_0xbce6('0x36')]);}};Acw[_0xbce6('0x17')]['syncAgentRingNoAnswer']=function(_0x3b63f1){try{if(this[_0xbce6('0x7')][_0x3b63f1[_0xbce6('0x1a')]]&&this[_0xbce6('0x7')][_0x3b63f1['queue']]['autopause']===_0xbce6('0x4f')){if(this[_0xbce6('0x8')][_0x3b63f1['interface']]){logger['info'](_0xbce6('0x50'),_0x3b63f1[_0xbce6('0x2e')],_0x3b63f1[_0xbce6('0x19')],_0x3b63f1[_0xbce6('0x1a')]);return RpcUser[_0xbce6('0x25')](this[_0xbce6('0x8')][_0x3b63f1[_0xbce6('0x19')]],_0xbce6('0x51'),_0x3b63f1['uniqueid']);}}}catch(_0x5ed528){logger['error'](_0xbce6('0x52'),_0x5ed528['message']);}};module[_0xbce6('0x53')]=Acw; \ No newline at end of file +var _0xf632=['lastPauseAt','format','uniqueid','updateAcw','update','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','autopause','all','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','prototype','startAcw','interface','queue','mandatoryDisposition','name','mandatoryDispositionPause','then','getAgent','voicePause','info','attended','destlinkedid','savePause','timer','stopAcw','acwTimeout'];(function(_0x4a33c4,_0x2828e3){var _0x2265b0=function(_0x200b0c){while(--_0x200b0c){_0x4a33c4['push'](_0x4a33c4['shift']());}};_0x2265b0(++_0x2828e3);}(_0xf632,0x172));var _0x2f63=function(_0x47f412,_0x3962b9){_0x47f412=_0x47f412-0x0;var _0x1c5f1c=_0xf632[_0x47f412];return _0x1c5f1c;};'use strict';var util=require(_0x2f63('0x0'));var _=require(_0x2f63('0x1'));var moment=require(_0x2f63('0x2'));var ami=require('../ami');var logger=require('../../../config/logger')(_0x2f63('0x3'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x2f63('0x4'));function Acw(_0xfa0c6d){this[_0x2f63('0x5')]=_0xfa0c6d[_0x2f63('0x5')];this[_0x2f63('0x6')]=_0xfa0c6d[_0x2f63('0x6')];this['timers']=_0xfa0c6d[_0x2f63('0x7')];this[_0x2f63('0x8')]={};ami['on'](_0x2f63('0x9'),this[_0x2f63('0xa')][_0x2f63('0xb')](this));ami['on'](_0x2f63('0xc'),this[_0x2f63('0xd')][_0x2f63('0xb')](this));ami['on']('hangup',this[_0x2f63('0xe')][_0x2f63('0xb')](this));ami['on'](_0x2f63('0xf'),this[_0x2f63('0x10')][_0x2f63('0xb')](this));ami['on'](_0x2f63('0x11'),this['syncAttendedTransfer'][_0x2f63('0xb')](this));ami['on']('blindtransfer',this[_0x2f63('0x12')][_0x2f63('0xb')](this));ami['on'](_0x2f63('0x13'),this[_0x2f63('0x14')][_0x2f63('0xb')](this));}function getDiff(_0x558d8c){var _0x51d3df=moment()[_0x2f63('0x15')](0x0);var _0x564bb5=moment(_0x558d8c)[_0x2f63('0x15')](0x0);return _0x51d3df[_0x2f63('0x16')](_0x564bb5,'seconds');}Acw[_0x2f63('0x17')][_0x2f63('0x18')]=function(_0x234c86){try{var _0x1f971e=this;var _0x345b44=this['channels'][_0x234c86][_0x2f63('0x19')];var _0xf604d8=this[_0x2f63('0x8')][_0x234c86][_0x2f63('0x1a')];var _0x26efd7=this[_0x2f63('0x5')][_0xf604d8];var _0x3fd2c9=![];var _0x37bd5b='ACW';if(_0x26efd7[_0x2f63('0x1b')]){if(_0x26efd7['mandatoryDispositionPause'][_0x2f63('0x1c')]){_0x3fd2c9=!![];_0x37bd5b=_0x26efd7[_0x2f63('0x1d')][_0x2f63('0x1c')];}}ami['Action']({'action':'QueuePause','interface':_0x345b44,'paused':!![],'reason':_0x37bd5b})[_0x2f63('0x1e')](function(_0x58e61f){if(_0x1f971e['agents'][_0x345b44]){return RpcUser[_0x2f63('0x1f')](_0x1f971e[_0x2f63('0x6')][_0x345b44]['id'])['then'](function(_0x4e8e9f){if(_0x4e8e9f&&!_0x4e8e9f[_0x2f63('0x20')]){logger[_0x2f63('0x21')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x234c86,_0x345b44,_0xf604d8);var _0x4e7f41=_0x1f971e['channels'][_0x234c86][_0x2f63('0x22')]&&_0x1f971e['channels'][_0x234c86][_0x2f63('0x23')]?_0x1f971e[_0x2f63('0x8')][_0x234c86][_0x2f63('0x23')]:_0x234c86;return RpcUser[_0x2f63('0x24')](_0x1f971e[_0x2f63('0x6')][_0x345b44],_0x37bd5b,_0x4e7f41)['then'](function(_0x21d95d){if(!_0x3fd2c9){_0x1f971e[_0x2f63('0x7')][_0x345b44]={};logger[_0x2f63('0x21')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x234c86,_0x1f971e[_0x2f63('0x5')][_0xf604d8]['acwTimeout'],_0x345b44,_0xf604d8);_0x1f971e[_0x2f63('0x7')][_0x345b44][_0x2f63('0x25')]=setTimeout(_0x1f971e[_0x2f63('0x26')]['bind'](_0x1f971e,_0x345b44),_0x1f971e[_0x2f63('0x5')][_0xf604d8][_0x2f63('0x27')]*0x3e8);_0x1f971e[_0x2f63('0x7')][_0x345b44][_0x2f63('0x28')]=moment()[_0x2f63('0x29')]('YYYY-MM-DD\x20HH:mm:ss');_0x1f971e[_0x2f63('0x7')][_0x345b44][_0x2f63('0x2a')]=_0x234c86;_0x1f971e['timers'][_0x345b44]['queue']=_0xf604d8;_0x1f971e[_0x2f63('0x7')][_0x345b44][_0x2f63('0x2b')]=function(){var _0x5523fe=getDiff(_0x1f971e[_0x2f63('0x7')][_0x345b44][_0x2f63('0x28')]);clearTimeout(_0x1f971e[_0x2f63('0x7')][_0x345b44][_0x2f63('0x25')]);_0x1f971e[_0x2f63('0x7')][_0x345b44]['timer']=![];RpcVoiceAgentReport[_0x2f63('0x2c')]({'acwtime':_0x5523fe},_0x1f971e[_0x2f63('0x7')][_0x345b44][_0x2f63('0x2a')],_0x345b44)[_0x2f63('0x1e')](function(_0x541b23){logger[_0x2f63('0x21')]('[%s][UPDATE][ACWTIME:%s]',_0x234c86,_0x5523fe,_0x541b23);})[_0x2f63('0x2d')](function(_0x38930a){logger[_0x2f63('0x2e')](_0x2f63('0x2f'),_0x234c86,_0x38930a);});delete _0x1f971e['timers'][_0x345b44];};}});}else{logger[_0x2f63('0x21')](_0x2f63('0x30'),_0x234c86,_0x345b44,_0xf604d8);}});}})[_0x2f63('0x2d')](function(_0x14529a){logger[_0x2f63('0x2e')](_0x2f63('0x31'),_0x234c86,_0x1f971e[_0x2f63('0x5')][_0xf604d8][_0x2f63('0x27')],_0x345b44,_0xf604d8);})[_0x2f63('0x32')](function(){delete _0x1f971e[_0x2f63('0x8')][_0x234c86];});}catch(_0x27eee9){logger[_0x2f63('0x2e')](_0x2f63('0x33'),_0x27eee9[_0x2f63('0x34')]);}};Acw[_0x2f63('0x17')]['stopAcw']=function(_0x3d4615){try{var _0x45e9ee=this;if(_0x45e9ee['timers'][_0x3d4615]){_0x45e9ee[_0x2f63('0x7')][_0x3d4615][_0x2f63('0x25')]=![];var _0x3d2748=_0x45e9ee[_0x2f63('0x7')][_0x3d4615][_0x2f63('0x2a')];var _0x48558e=_0x45e9ee['timers'][_0x3d4615]['queue'];var _0x354930=_0x45e9ee['voiceQueues'][_0x48558e][_0x2f63('0x27')];logger[_0x2f63('0x21')](_0x2f63('0x35'),_0x3d2748,_0x3d4615);RpcUser['saveUnpause'](this[_0x2f63('0x6')][_0x3d4615]);RpcVoiceAgentReport[_0x2f63('0x2c')]({'acwtime':_0x354930,'agentacw':!![]},_0x3d2748,_0x3d4615)[_0x2f63('0x1e')](function(_0x27b8ee){logger[_0x2f63('0x21')](_0x2f63('0x36'),_0x3d2748,_0x354930,_0x27b8ee);})[_0x2f63('0x2d')](function(_0x1be33e){logger[_0x2f63('0x2e')](_0x2f63('0x2f'),_0x3d2748,_0x1be33e);});}else{logger[_0x2f63('0x2e')](_0x2f63('0x37'),_0x3d4615);if(_0x45e9ee['timers']){logger[_0x2f63('0x21')](_0x2f63('0x38'),JSON[_0x2f63('0x39')](_0x45e9ee[_0x2f63('0x7')]));}}}catch(_0x316db9){logger['error'](_0x2f63('0x3a'),_0x316db9[_0x2f63('0x34')]);}};Acw[_0x2f63('0x17')][_0x2f63('0xa')]=function(_0x2dc378){try{if(this[_0x2f63('0x5')][_0x2dc378[_0x2f63('0x1a')]]&&(this[_0x2f63('0x5')][_0x2dc378[_0x2f63('0x1a')]][_0x2f63('0x3')]||this[_0x2f63('0x5')][_0x2dc378['queue']][_0x2f63('0x1b')])){if(this['agents'][_0x2dc378[_0x2f63('0x19')]]){this[_0x2f63('0x8')][_0x2dc378[_0x2f63('0x2a')]]={'queue':_0x2dc378['queue'],'interface':_0x2dc378['interface'],'destlinkedid':_0x2dc378['destlinkedid']};}}}catch(_0x22a419){logger[_0x2f63('0x2e')](_0x2f63('0x3b'),_0x22a419[_0x2f63('0x34')]);}};Acw[_0x2f63('0x17')][_0x2f63('0x14')]=function(_0x5b3810){try{if(this[_0x2f63('0x5')][_0x5b3810[_0x2f63('0x1a')]]&&(this[_0x2f63('0x5')][_0x5b3810[_0x2f63('0x1a')]][_0x2f63('0x3')]||this['voiceQueues'][_0x5b3810[_0x2f63('0x1a')]][_0x2f63('0x1b')])){if(this[_0x2f63('0x6')][_0x5b3810[_0x2f63('0x19')]]){this[_0x2f63('0x8')][_0x5b3810[_0x2f63('0x2a')]]={'queue':_0x5b3810['queue'],'interface':_0x5b3810[_0x2f63('0x19')]};}}}catch(_0x5315a3){logger[_0x2f63('0x2e')](_0x2f63('0x3c'),_0x5315a3[_0x2f63('0x34')]);}};Acw[_0x2f63('0x17')]['syncHangupRequest']=function(_0x247337){try{if(this[_0x2f63('0x8')][_0x247337[_0x2f63('0x2a')]]&&_[_0x2f63('0x3d')](this[_0x2f63('0x8')][_0x247337[_0x2f63('0x2a')]][_0x2f63('0x22')])){logger[_0x2f63('0x21')](_0x2f63('0x3e'),_0x247337[_0x2f63('0x2a')]);this['startAcw'](_0x247337[_0x2f63('0x2a')]);}else if(this[_0x2f63('0x8')][_0x247337[_0x2f63('0x3f')]]&&_[_0x2f63('0x3d')](this[_0x2f63('0x8')][_0x247337[_0x2f63('0x3f')]][_0x2f63('0x22')])){logger[_0x2f63('0x21')]('[%s][HANGUP:LINKEDID]',_0x247337[_0x2f63('0x3f')]);this[_0x2f63('0x18')](_0x247337[_0x2f63('0x3f')]);}}catch(_0x54afbd){logger[_0x2f63('0x2e')]('[ACW][syncHangupRequest]\x20%s',_0x54afbd['message']);}};Acw[_0x2f63('0x17')]['syncHangup']=function(_0x54d2e1){try{if(this['channels'][_0x54d2e1[_0x2f63('0x2a')]]&&this['channels'][_0x54d2e1['uniqueid']][_0x2f63('0x22')]){logger['info'](_0x2f63('0x40'),_0x54d2e1[_0x2f63('0x2a')]);this[_0x2f63('0x18')](_0x54d2e1[_0x2f63('0x2a')]);}else if(this[_0x2f63('0x8')][_0x54d2e1[_0x2f63('0x3f')]]&&this[_0x2f63('0x8')][_0x54d2e1[_0x2f63('0x3f')]][_0x2f63('0x22')]){logger['info'](_0x2f63('0x41'),_0x54d2e1[_0x2f63('0x3f')]);this[_0x2f63('0x18')](_0x54d2e1[_0x2f63('0x3f')]);}}catch(_0x2f5315){logger[_0x2f63('0x2e')](_0x2f63('0x42'),_0x2f5315[_0x2f63('0x34')]);}};Acw['prototype']['syncAttendedTransfer']=function(_0x10c769){try{if(!_['isNil'](this[_0x2f63('0x8')][_0x10c769[_0x2f63('0x43')]])){this['startAcw'](_0x10c769[_0x2f63('0x43')]);if(this[_0x2f63('0x8')][_0x10c769['secondtransfereruniqueid']]){this[_0x2f63('0x8')][_0x10c769[_0x2f63('0x44')]][_0x2f63('0x22')]=!![];this[_0x2f63('0x8')][_0x10c769[_0x2f63('0x45')]]=this[_0x2f63('0x8')][_0x10c769[_0x2f63('0x44')]];delete this[_0x2f63('0x8')][_0x10c769['secondtransfereruniqueid']];}}else if(!_[_0x2f63('0x46')](this[_0x2f63('0x8')][_0x10c769[_0x2f63('0x45')]])){this[_0x2f63('0x18')](_0x10c769[_0x2f63('0x45')]);if(this['channels'][_0x10c769[_0x2f63('0x47')]]){this[_0x2f63('0x8')][_0x10c769[_0x2f63('0x47')]]['attended']=!![];this[_0x2f63('0x8')][_0x10c769['transfereeuniqueid']]=this['channels'][_0x10c769[_0x2f63('0x47')]];delete this[_0x2f63('0x8')][_0x10c769[_0x2f63('0x47')]];}}}catch(_0x28152b){logger[_0x2f63('0x2e')](_0x2f63('0x48'),_0x28152b[_0x2f63('0x34')]);}};Acw[_0x2f63('0x17')][_0x2f63('0x12')]=function(_0x2be750){try{if(this[_0x2f63('0x8')][_0x2be750[_0x2f63('0x49')]]){logger[_0x2f63('0x21')](_0x2f63('0x4a'),JSON['stringify'](_0x2be750['transfereruniqueid']));this[_0x2f63('0x18')](_0x2be750['transfereruniqueid']);}else if(this[_0x2f63('0x8')][_0x2be750[_0x2f63('0x4b')]]){logger['info'](_0x2f63('0x4c'),JSON[_0x2f63('0x39')](_0x2be750['transfererlinkedid']));this[_0x2f63('0x18')](_0x2be750[_0x2f63('0x4b')]);}}catch(_0x2055aa){logger['error']('[ACW][syncBlindTransfer]\x20%s',_0x2055aa['message']);}};Acw[_0x2f63('0x17')][_0x2f63('0x10')]=function(_0x252b1b){try{if(this[_0x2f63('0x5')][_0x252b1b[_0x2f63('0x1a')]]&&this[_0x2f63('0x5')][_0x252b1b[_0x2f63('0x1a')]][_0x2f63('0x4d')]===_0x2f63('0x4e')){if(this[_0x2f63('0x6')][_0x252b1b[_0x2f63('0x19')]]){logger[_0x2f63('0x21')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x252b1b[_0x2f63('0x2a')],_0x252b1b[_0x2f63('0x19')],_0x252b1b[_0x2f63('0x1a')]);return RpcUser['savePause'](this['agents'][_0x252b1b[_0x2f63('0x19')]],_0x2f63('0x4f'),_0x252b1b[_0x2f63('0x2a')]);}}}catch(_0x420f1b){logger[_0x2f63('0x2e')](_0x2f63('0x50'),_0x420f1b['message']);}};module[_0x2f63('0x51')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 2838202..3828f47 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 _0x757a=['devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','once','connect','shutdown','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','[ami.js][fullybooted]','close','exports','bluebird','moment','ami','../../config/environment','asterisk','port','password','Action','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect','actionSipShowRegistry','actionDeviceStateList'];(function(_0x2d4fba,_0x398fa1){var _0x224af0=function(_0x1703db){while(--_0x1703db){_0x2d4fba['push'](_0x2d4fba['shift']());}};_0x224af0(++_0x398fa1);}(_0x757a,0xde));var _0xa757=function(_0x2817b9,_0x2ca51a){_0x2817b9=_0x2817b9-0x0;var _0x3bf1bb=_0x757a[_0x2817b9];return _0x3bf1bb;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0xa757('0x0'));var moment=require(_0xa757('0x1'));var util=require('util');var _=require('lodash');var logger=require('../../config/logger')(_0xa757('0x2'));var config=require(_0xa757('0x3'));var ami=new Manager(config[_0xa757('0x4')][_0xa757('0x5')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')]['username'],config[_0xa757('0x4')][_0xa757('0x6')],!![]);ami['keepConnected']();ami[_0xa757('0x7')]=BPromise[_0xa757('0x8')](ami[_0xa757('0x9')]);function error(_0x1a95ee){logger[_0xa757('0xa')](util['format'](_0xa757('0xb'),config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')],util[_0xa757('0xd')](_0x1a95ee,![],null)));}function close(){logger['error'](util['format']('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk']['username'],config[_0xa757('0x4')]['ip'],config['asterisk']['port']));}ami[_0xa757('0xe')]=function(){return function(){return ami['Action']({'action':'sipshowregistry'});};};ami[_0xa757('0xf')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x10')});};};ami[_0xa757('0x11')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x12')});};};ami[_0xa757('0x13')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x14')});};};ami[_0xa757('0x15')]=function(){return function(){return ami['Action']({'action':_0xa757('0x16')});};};function connect(_0x44eab8){logger[_0xa757('0x17')](util['format']('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')]));ami[_0xa757('0x18')]('error',error);ami[_0xa757('0x18')]('close',close);}ami['on'](_0xa757('0x19'),connect);ami['on'](_0xa757('0x1a'),function(_0x14014c){logger[_0xa757('0x17')](util['format']('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')],util[_0xa757('0xd')](_0x14014c,![],null)));});ami['on'](_0xa757('0x1b'),function(_0x21f1af){logger[_0xa757('0x17')](util['format'](_0xa757('0x1c'),config['asterisk'][_0xa757('0xc')],config['asterisk']['ip'],config[_0xa757('0x4')][_0xa757('0x5')]));return BPromise[_0xa757('0x1d')]()['then'](ami[_0xa757('0xe')]())[_0xa757('0x1e')](ami[_0xa757('0xf')]())[_0xa757('0x1e')](ami['actionSipPeerStatus']())[_0xa757('0x1e')](ami['actionQueueSummary']())['then'](ami['actionCoreShowChannels']())['catch'](function(_0xfdf69d){logger['error'](_0xa757('0x1f'),util[_0xa757('0xd')](_0xfdf69d,{'showHidden':![],'depth':null}));});});ami['once'](_0xa757('0xa'),error);ami['once'](_0xa757('0x20'),close);module[_0xa757('0x21')]=ami; \ No newline at end of file +var _0xb7e7=['username','Action','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionDeviceStateList','catch','[ami.js][fullybooted]','exports','asterisk-manager','moment','lodash','ami','asterisk','port','password','keepConnected','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s'];(function(_0x1d8721,_0x1c668f){var _0x4230d5=function(_0x2e0afe){while(--_0x2e0afe){_0x1d8721['push'](_0x1d8721['shift']());}};_0x4230d5(++_0x1c668f);}(_0xb7e7,0x121));var _0x7b7e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xb7e7[_0x38a7ac];return _0x53061a;};'use strict';var Manager=require(_0x7b7e('0x0'));var BPromise=require('bluebird');var moment=require(_0x7b7e('0x1'));var util=require('util');var _=require(_0x7b7e('0x2'));var logger=require('../../config/logger')(_0x7b7e('0x3'));var config=require('../../config/environment');var ami=new Manager(config[_0x7b7e('0x4')][_0x7b7e('0x5')],config[_0x7b7e('0x4')]['ip'],config['asterisk']['username'],config[_0x7b7e('0x4')][_0x7b7e('0x6')],!![]);ami[_0x7b7e('0x7')]();ami['Action']=BPromise[_0x7b7e('0x8')](ami[_0x7b7e('0x9')]);function error(_0x2917f9){logger[_0x7b7e('0xa')](util[_0x7b7e('0xb')](_0x7b7e('0xc'),config[_0x7b7e('0x4')]['username'],config[_0x7b7e('0x4')]['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')],util[_0x7b7e('0xd')](_0x2917f9,![],null)));}function close(){logger[_0x7b7e('0xa')](util[_0x7b7e('0xb')](_0x7b7e('0xe'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config['asterisk']['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x7b7e('0x10')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x7b7e('0x10')]({'action':_0x7b7e('0x11')});};};ami[_0x7b7e('0x12')]=function(){return function(){return ami[_0x7b7e('0x10')]({'action':_0x7b7e('0x13')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':_0x7b7e('0x14')});};};ami[_0x7b7e('0x15')]=function(){return function(){return ami[_0x7b7e('0x10')]({'action':_0x7b7e('0x16')});};};function connect(_0x2cc400){logger[_0x7b7e('0x17')](util[_0x7b7e('0xb')](_0x7b7e('0x18'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config[_0x7b7e('0x4')]['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')]));ami[_0x7b7e('0x19')](_0x7b7e('0xa'),error);ami[_0x7b7e('0x19')](_0x7b7e('0x1a'),close);}ami['on']('connect',connect);ami['on'](_0x7b7e('0x1b'),function(_0x43db4f){logger[_0x7b7e('0x17')](util['format'](_0x7b7e('0x1c'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config[_0x7b7e('0x4')]['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')],util[_0x7b7e('0xd')](_0x43db4f,![],null)));});ami['on'](_0x7b7e('0x1d'),function(_0x53bbb3){logger['info'](util['format'](_0x7b7e('0x1e'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config['asterisk']['ip'],config['asterisk']['port']));return BPromise[_0x7b7e('0x1f')]()[_0x7b7e('0x20')](ami[_0x7b7e('0x21')]())[_0x7b7e('0x20')](ami[_0x7b7e('0x22')]())['then'](ami[_0x7b7e('0x12')]())[_0x7b7e('0x20')](ami['actionQueueSummary']())['then'](ami['actionCoreShowChannels']())[_0x7b7e('0x23')](function(_0x423832){logger['error'](_0x7b7e('0x24'),util['inspect'](_0x423832,{'showHidden':![],'depth':null}));});});ami[_0x7b7e('0x19')](_0x7b7e('0xa'),error);ami[_0x7b7e('0x19')]('close',close);module[_0x7b7e('0x25')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 88a6b7b..dc7be66 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 _0xd8b0=['message','result','catch','exports','jayson/promise','bluebird','http','Request','then','debug','memberReport','error','rpc'];(function(_0x496ca4,_0x7cc3fa){var _0x5e1e22=function(_0x5f03a1){while(--_0x5f03a1){_0x496ca4['push'](_0x496ca4['shift']());}};_0x5e1e22(++_0x7cc3fa);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var jayson=require(_0x0d8b('0x0'));var BPromise=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('ami');var client=jayson['client'][_0x0d8b('0x2')]({'port':0x2329});client[_0x0d8b('0x3')]=function(_0x43bca1,_0x364286){return new BPromise(function(_0x8196ed,_0x577834){return client['request'](_0x43bca1,_0x364286)[_0x0d8b('0x4')](function(_0x227c63){logger[_0x0d8b('0x5')]('rpc',_0x0d8b('0x6'),_0x43bca1,_0x364286,_0x227c63);if(_0x227c63[_0x0d8b('0x7')]){logger['error'](_0x0d8b('0x8'),_0x0d8b('0x6'),_0x43bca1,_0x227c63[_0x0d8b('0x7')][_0x0d8b('0x9')],_0x364286);return _0x577834(_0x227c63[_0x0d8b('0x7')][_0x0d8b('0x9')]);}else{return _0x8196ed(_0x227c63[_0x0d8b('0xa')]);}})[_0x0d8b('0xb')](function(_0x48fa16){logger[_0x0d8b('0x7')]('rpc',_0x0d8b('0x6'),_0x43bca1,_0x48fa16,_0x364286);return _0x577834(_0x48fa16);});});};module[_0x0d8b('0xc')]=client; \ No newline at end of file +var _0xb7e7=['exports','jayson/promise','../../config/logger','client','Request','debug','rpc','error','memberReport','message','result','catch'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xb7e7,0x121));var _0x7b7e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xb7e7[_0x4ea69d];return _0x5318e0;};'use strict';var jayson=require(_0x7b7e('0x0'));var BPromise=require('bluebird');var logger=require(_0x7b7e('0x1'))('ami');var client=jayson[_0x7b7e('0x2')]['http']({'port':0x2329});client[_0x7b7e('0x3')]=function(_0x556d68,_0x31d0ed){return new BPromise(function(_0x118577,_0x1d9384){return client['request'](_0x556d68,_0x31d0ed)['then'](function(_0x333fa4){logger[_0x7b7e('0x4')](_0x7b7e('0x5'),'memberReport',_0x556d68,_0x31d0ed,_0x333fa4);if(_0x333fa4[_0x7b7e('0x6')]){logger[_0x7b7e('0x6')](_0x7b7e('0x5'),_0x7b7e('0x7'),_0x556d68,_0x333fa4[_0x7b7e('0x6')][_0x7b7e('0x8')],_0x31d0ed);return _0x1d9384(_0x333fa4[_0x7b7e('0x6')]['message']);}else{return _0x118577(_0x333fa4[_0x7b7e('0x9')]);}})[_0x7b7e('0xa')](function(_0x10a666){logger[_0x7b7e('0x6')](_0x7b7e('0x5'),_0x7b7e('0x7'),_0x556d68,_0x10a666,_0x31d0ed);return _0x1d9384(_0x10a666);});});};module[_0x7b7e('0xb')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 61290c0..a89577b 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 _0x0c53=['countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','firstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','recallme','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','util','lodash','moment','isNil','string','voiceQueue','name','Contact','phone','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry'];(function(_0x4c0622,_0x5dacaf){var _0x1799d8=function(_0x2ba801){while(--_0x2ba801){_0x4c0622['push'](_0x4c0622['shift']());}};_0x1799d8(++_0x5dacaf);}(_0x0c53,0x1c4));var _0x30c5=function(_0x39ca63,_0x1e31c1){_0x39ca63=_0x39ca63-0x0;var _0x5aa294=_0x0c53[_0x39ca63];return _0x5aa294;};'use strict';var util=require(_0x30c5('0x0'));var _=require(_0x30c5('0x1'));var moment=require(_0x30c5('0x2'));function checkNameSurname(_0x5f124f,_0x3efb1e,_0x3a675b){var _0x44f455='';if(!_[_0x30c5('0x3')](_0x3efb1e)&&_0x30c5('0x4')===typeof _0x3efb1e){_0x44f455+=_0x3efb1e;}if(!_[_0x30c5('0x3')](_0x3a675b)&&_0x30c5('0x4')===typeof _0x3a675b){_0x44f455+='\x20'+_0x3a675b;}if(_0x44f455!==''){return _0x44f455;}return _0x5f124f;}function Action(_0x3a81ff,_0x528bde,_0x4a1d5d){this[_0x30c5('0x5')]=_0x3a81ff;this['uniqueid']=_0x4a1d5d||undefined;this[_0x30c5('0x6')]=checkNameSurname(_0x528bde[_0x30c5('0x7')][_0x30c5('0x8')],_0x528bde['Contact']['firstName'],_0x528bde[_0x30c5('0x7')]['lastName']);this[_0x30c5('0x9')]=_0x528bde[_0x30c5('0x8')];this[_0x30c5('0xa')]=_0x3a81ff[_0x30c5('0x6')];this[_0x30c5('0xb')]=_0x528bde[_0x30c5('0xb')]||![];this[_0x30c5('0xc')]=_0x3a81ff['type'];this[_0x30c5('0xd')]=_0x3a81ff[_0x30c5('0xd')]||0x3;this[_0x30c5('0xe')]=_0x528bde[_0x30c5('0xe')];this[_0x30c5('0xf')]=_0x528bde[_0x30c5('0xf')];this[_0x30c5('0x10')]=_0x528bde[_0x30c5('0x10')];this['countnoanswerretry']=_0x528bde[_0x30c5('0x11')];this[_0x30c5('0x12')]=_0x528bde[_0x30c5('0x12')];this[_0x30c5('0x13')]=_0x528bde[_0x30c5('0x13')];this[_0x30c5('0x14')]=_0x528bde[_0x30c5('0x14')];this['countmachineretry']=_0x528bde[_0x30c5('0x15')];this[_0x30c5('0x16')]=_0x528bde[_0x30c5('0x16')];this[_0x30c5('0x17')]=_0x528bde[_0x30c5('0x17')];this['ListId']=_0x528bde[_0x30c5('0x18')];this[_0x30c5('0x19')]=_0x528bde[_0x30c5('0x19')];this[_0x30c5('0x1a')]=_0x528bde[_0x30c5('0x1a')];this[_0x30c5('0x1b')]=_0x528bde[_0x30c5('0x1b')];this['idHopper']=_0x528bde['id'];this[_0x30c5('0x1c')]=_0x528bde[_0x30c5('0x7')][_0x30c5('0x1d')]||'';this[_0x30c5('0x1e')]=moment()[_0x30c5('0x1f')](_0x30c5('0x20'));this['callback']=_0x528bde[_0x30c5('0x21')];this[_0x30c5('0x22')]=_0x528bde[_0x30c5('0x22')];this['callbackat']=_0x528bde['callbackat'];this[_0x30c5('0x23')]=_0x528bde[_0x30c5('0x23')];this[_0x30c5('0x24')]='';this['originatecalleridname']='';}Action[_0x30c5('0x25')][_0x30c5('0x26')]=function(){return util[_0x30c5('0x1f')](_0x30c5('0x27'),this['name'],this[_0x30c5('0x5')][_0x30c5('0x28')]>0x0?this[_0x30c5('0x9')][_0x30c5('0x29')](this[_0x30c5('0x5')][_0x30c5('0x28')]):this['number']);};Action[_0x30c5('0x25')][_0x30c5('0x2a')]=function(){return this[_0x30c5('0xa')];};module['exports']=Action; \ No newline at end of file +var _0x3ff4=['string','voiceQueue','Contact','phone','lastName','queue','name','active','type','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','number','substring','getQueue','exports','lodash','moment','isNil'];(function(_0x3f2b3e,_0x4c7578){var _0x277cfa=function(_0x4aad30){while(--_0x4aad30){_0x3f2b3e['push'](_0x3f2b3e['shift']());}};_0x277cfa(++_0x4c7578);}(_0x3ff4,0x105));var _0x43ff=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x3ff4[_0x45d3f0];return _0x314b79;};'use strict';var util=require('util');var _=require(_0x43ff('0x0'));var moment=require(_0x43ff('0x1'));function checkNameSurname(_0x2e0c2c,_0x49d8eb,_0x22e05a){var _0x438eea='';if(!_[_0x43ff('0x2')](_0x49d8eb)&&_0x43ff('0x3')===typeof _0x49d8eb){_0x438eea+=_0x49d8eb;}if(!_[_0x43ff('0x2')](_0x22e05a)&&'string'===typeof _0x22e05a){_0x438eea+='\x20'+_0x22e05a;}if(_0x438eea!==''){return _0x438eea;}return _0x2e0c2c;}function Action(_0xcf4527,_0x15f1cc,_0x181c0c){this[_0x43ff('0x4')]=_0xcf4527;this['uniqueid']=_0x181c0c||undefined;this['name']=checkNameSurname(_0x15f1cc[_0x43ff('0x5')][_0x43ff('0x6')],_0x15f1cc[_0x43ff('0x5')]['firstName'],_0x15f1cc['Contact'][_0x43ff('0x7')]);this['number']=_0x15f1cc[_0x43ff('0x6')];this[_0x43ff('0x8')]=_0xcf4527[_0x43ff('0x9')];this['active']=_0x15f1cc[_0x43ff('0xa')]||![];this[_0x43ff('0xb')]=_0xcf4527[_0x43ff('0xb')];this['dialQueueTimeout']=_0xcf4527['dialQueueTimeout']||0x3;this[_0x43ff('0xc')]=_0x15f1cc[_0x43ff('0xc')];this[_0x43ff('0xd')]=_0x15f1cc[_0x43ff('0xd')];this[_0x43ff('0xe')]=_0x15f1cc[_0x43ff('0xe')];this['countnoanswerretry']=_0x15f1cc[_0x43ff('0xf')];this[_0x43ff('0x10')]=_0x15f1cc['countnosuchnumberretry'];this['countdropretry']=_0x15f1cc['countdropretry'];this[_0x43ff('0x11')]=_0x15f1cc[_0x43ff('0x11')];this[_0x43ff('0x12')]=_0x15f1cc[_0x43ff('0x12')];this[_0x43ff('0x13')]=_0x15f1cc['countagentrejectretry'];this[_0x43ff('0x14')]=_0x15f1cc[_0x43ff('0x14')];this[_0x43ff('0x15')]=_0x15f1cc[_0x43ff('0x15')];this[_0x43ff('0x16')]=_0x15f1cc[_0x43ff('0x16')];this[_0x43ff('0x17')]=_0x15f1cc['VoiceQueueId'];this[_0x43ff('0x18')]=_0x15f1cc[_0x43ff('0x18')];this[_0x43ff('0x19')]=_0x15f1cc['id'];this[_0x43ff('0x1a')]=_0x15f1cc[_0x43ff('0x5')]['firstName']||'';this[_0x43ff('0x1b')]=moment()[_0x43ff('0x1c')](_0x43ff('0x1d'));this[_0x43ff('0x1e')]=_0x15f1cc['callback'];this[_0x43ff('0x1f')]=_0x15f1cc[_0x43ff('0x1f')];this[_0x43ff('0x20')]=_0x15f1cc[_0x43ff('0x20')];this[_0x43ff('0x21')]=_0x15f1cc[_0x43ff('0x21')];this[_0x43ff('0x22')]='';this[_0x43ff('0x23')]='';}Action[_0x43ff('0x24')][_0x43ff('0x25')]=function(){return util[_0x43ff('0x1c')](_0x43ff('0x26'),this['name'],this[_0x43ff('0x4')][_0x43ff('0x27')]>0x0?this[_0x43ff('0x28')][_0x43ff('0x29')](this['voiceQueue']['dialCutDigit']):this[_0x43ff('0x28')]);};Action[_0x43ff('0x24')][_0x43ff('0x2a')]=function(){return this[_0x43ff('0x8')];};module[_0x43ff('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 7fc7ff1..b2b163d 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 _0x23a6=['type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','endtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridname','exports','util','lodash','milliseconds','seconds','state','statedesc','scheduledat'];(function(_0x5ef0ea,_0x3ee440){var _0x1510a8=function(_0x3d0c2e){while(--_0x3d0c2e){_0x5ef0ea['push'](_0x5ef0ea['shift']());}};_0x1510a8(++_0x3ee440);}(_0x23a6,0x12d));var _0x623a=function(_0x4d85f7,_0x250c47){_0x4d85f7=_0x4d85f7-0x0;var _0x3bc237=_0x23a6[_0x4d85f7];return _0x3bc237;};'use strict';var util=require(_0x623a('0x0'));var _=require(_0x623a('0x1'));var moment=require('moment');function getSeconds(_0x53d2b7,_0x5c9862){var _0x5f0493=moment(_0x53d2b7)[_0x623a('0x2')](0x0);var _0x4f0cf9=moment(_0x5c9862)[_0x623a('0x2')](0x0);return _0x5f0493['diff'](_0x4f0cf9,_0x623a('0x3'));}function AgentComplete(_0xb0bb49,_0x2c17bc){this[_0x623a('0x4')]=0x4;this[_0x623a('0x5')]='Answer';this[_0x623a('0x6')]=_0xb0bb49['scheduledat'];this[_0x623a('0x7')]=_0xb0bb49[_0x623a('0x7')];this[_0x623a('0x8')]=_0xb0bb49[_0x623a('0x7')]===_0x623a('0x9')?_0x623a('0xa'):_0xb0bb49[_0x623a('0x7')];this[_0x623a('0xb')]=_0xb0bb49[_0x623a('0xb')];this[_0x623a('0xc')]=_0xb0bb49[_0x623a('0xc')];this[_0x623a('0xd')]=_0xb0bb49['countnoanswerretry'];this['countglobal']=_0xb0bb49['countbusyretry']+_0xb0bb49['countcongestionretry']+_0xb0bb49[_0x623a('0xd')]+_0xb0bb49[_0x623a('0xe')]+_0xb0bb49[_0x623a('0xf')]+_0xb0bb49[_0x623a('0x10')]+_0xb0bb49[_0x623a('0x11')]+_0xb0bb49[_0x623a('0x12')];this[_0x623a('0xe')]=_0xb0bb49[_0x623a('0xe')];this[_0x623a('0xf')]=_0xb0bb49[_0x623a('0xf')];this[_0x623a('0x10')]=_0xb0bb49['countabandonedretry'];this[_0x623a('0x11')]=_0xb0bb49['countmachineretry'];this[_0x623a('0x12')]=_0xb0bb49[_0x623a('0x12')];this['uniqueid']=_0x2c17bc[_0x623a('0x13')];this['calleridname']=_0xb0bb49[_0x623a('0x14')];this[_0x623a('0x15')]=_0xb0bb49[_0x623a('0x16')];this['starttime']=_0xb0bb49[_0x623a('0x17')];this[_0x623a('0x18')]=_0xb0bb49['responsetime'];this[_0x623a('0x19')]=_0xb0bb49[_0x623a('0x19')];this['endtime']=moment()[_0x623a('0x1a')](_0x623a('0x1b'));this[_0x623a('0x1c')]=getSeconds(_0xb0bb49[_0x623a('0x18')],_0xb0bb49['starttime']);this[_0x623a('0x1d')]=getSeconds(_0xb0bb49['answertime'],_0xb0bb49[_0x623a('0x18')]);this[_0x623a('0x1e')]=getSeconds(this[_0x623a('0x1f')],_0xb0bb49[_0x623a('0x19')]);this[_0x623a('0xa')]=_0x2c17bc['queue'];this[_0x623a('0x20')]=_0x2c17bc[_0x623a('0x20')];this['reason']=_0x2c17bc[_0x623a('0x21')];this[_0x623a('0x22')]=_0xb0bb49[_0x623a('0x22')];this[_0x623a('0x23')]=_0xb0bb49[_0x623a('0x23')];this[_0x623a('0x24')]=_0xb0bb49[_0x623a('0x24')];this[_0x623a('0x25')]=_0xb0bb49[_0x623a('0x25')];this[_0x623a('0x26')]=_0xb0bb49['ContactId'];this['ListId']=_0xb0bb49['ListId'];this[_0x623a('0x27')]=_0xb0bb49[_0x623a('0x27')];this[_0x623a('0x28')]=_0xb0bb49[_0x623a('0x28')];this['CampaignId']=_0xb0bb49[_0x623a('0x29')];this['originatecalleridnum']=_0xb0bb49['originatecalleridnum']||'';this[_0x623a('0x2a')]=_0xb0bb49[_0x623a('0x2a')]||'';}module[_0x623a('0x2b')]=AgentComplete; \ No newline at end of file +var _0x9a59=['countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','queue','countbusyretry','countcongestionretry'];(function(_0x4ecabe,_0x1f6ad0){var _0x908224=function(_0x541ebd){while(--_0x541ebd){_0x4ecabe['push'](_0x4ecabe['shift']());}};_0x908224(++_0x1f6ad0);}(_0x9a59,0x7e));var _0x99a5=function(_0xc1be7,_0x11bc26){_0xc1be7=_0xc1be7-0x0;var _0x4913ea=_0x9a59[_0xc1be7];return _0x4913ea;};'use strict';var util=require(_0x99a5('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x2dfd62,_0x2ff497){var _0x117d7c=moment(_0x2dfd62)[_0x99a5('0x1')](0x0);var _0x9d93c5=moment(_0x2ff497)['milliseconds'](0x0);return _0x117d7c[_0x99a5('0x2')](_0x9d93c5,_0x99a5('0x3'));}function AgentComplete(_0x31fece,_0x161d05){this[_0x99a5('0x4')]=0x4;this[_0x99a5('0x5')]=_0x99a5('0x6');this[_0x99a5('0x7')]=_0x31fece['scheduledat'];this[_0x99a5('0x8')]=_0x31fece['type'];this['campaigntype']=_0x31fece[_0x99a5('0x8')]==='outbound'?_0x99a5('0x9'):_0x31fece[_0x99a5('0x8')];this[_0x99a5('0xa')]=_0x31fece[_0x99a5('0xa')];this['countcongestionretry']=_0x31fece[_0x99a5('0xb')];this[_0x99a5('0xc')]=_0x31fece['countnoanswerretry'];this[_0x99a5('0xd')]=_0x31fece['countbusyretry']+_0x31fece[_0x99a5('0xb')]+_0x31fece[_0x99a5('0xc')]+_0x31fece[_0x99a5('0xe')]+_0x31fece[_0x99a5('0xf')]+_0x31fece[_0x99a5('0x10')]+_0x31fece[_0x99a5('0x11')]+_0x31fece[_0x99a5('0x12')];this[_0x99a5('0xe')]=_0x31fece[_0x99a5('0xe')];this['countdropretry']=_0x31fece[_0x99a5('0xf')];this[_0x99a5('0x10')]=_0x31fece['countabandonedretry'];this[_0x99a5('0x11')]=_0x31fece[_0x99a5('0x11')];this[_0x99a5('0x12')]=_0x31fece[_0x99a5('0x12')];this[_0x99a5('0x13')]=_0x161d05[_0x99a5('0x13')];this[_0x99a5('0x14')]=_0x31fece[_0x99a5('0x15')];this[_0x99a5('0x16')]=_0x31fece[_0x99a5('0x17')];this[_0x99a5('0x18')]=_0x31fece[_0x99a5('0x18')];this[_0x99a5('0x19')]=_0x31fece[_0x99a5('0x19')];this['answertime']=_0x31fece[_0x99a5('0x1a')];this[_0x99a5('0x1b')]=moment()[_0x99a5('0x1c')](_0x99a5('0x1d'));this[_0x99a5('0x1e')]=getSeconds(_0x31fece[_0x99a5('0x19')],_0x31fece[_0x99a5('0x18')]);this[_0x99a5('0x1f')]=getSeconds(_0x31fece[_0x99a5('0x1a')],_0x31fece['responsetime']);this[_0x99a5('0x20')]=getSeconds(this[_0x99a5('0x1b')],_0x31fece[_0x99a5('0x1a')]);this[_0x99a5('0x9')]=_0x161d05[_0x99a5('0x9')];this[_0x99a5('0x21')]=_0x161d05[_0x99a5('0x21')];this[_0x99a5('0x22')]=_0x161d05['reason'];this['callback']=_0x31fece[_0x99a5('0x23')];this['callbackuniqueid']=_0x31fece[_0x99a5('0x24')];this[_0x99a5('0x25')]=_0x31fece['callbackat'];this['recallme']=_0x31fece[_0x99a5('0x26')];this[_0x99a5('0x27')]=_0x31fece[_0x99a5('0x27')];this[_0x99a5('0x28')]=_0x31fece[_0x99a5('0x28')];this[_0x99a5('0x29')]=_0x31fece[_0x99a5('0x29')];this[_0x99a5('0x2a')]=_0x31fece['VoiceQueueId'];this[_0x99a5('0x2b')]=_0x31fece[_0x99a5('0x2b')];this[_0x99a5('0x2c')]=_0x31fece[_0x99a5('0x2c')]||'';this['originatecalleridname']=_0x31fece['originatecalleridname']||'';}module[_0x99a5('0x2d')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index bd0d5d7..c7defd1 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 _0x8ef6=['countabandonedretry','countmachineretry','countagentrejectretry','calleridname','starttime','endtime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry'];(function(_0x3dd290,_0x80a3dc){var _0x164210=function(_0x54ce68){while(--_0x54ce68){_0x3dd290['push'](_0x3dd290['shift']());}};_0x164210(++_0x80a3dc);}(_0x8ef6,0xf2));var _0x68ef=function(_0x5c7e99,_0x314460){_0x5c7e99=_0x5c7e99-0x0;var _0xc8dade=_0x8ef6[_0x5c7e99];return _0xc8dade;};'use strict';var util=require(_0x68ef('0x0'));var _=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));function getSeconds(_0x279e08,_0x2cc97b){var _0x44e0d3=moment(_0x279e08)[_0x68ef('0x3')](0x0);var _0x4a72b8=moment(_0x2cc97b)[_0x68ef('0x3')](0x0);return _0x44e0d3[_0x68ef('0x4')](_0x4a72b8,_0x68ef('0x5'));}function Final(_0x2ac782){this['uniqueid']=_0x2ac782['uniqueid'];this[_0x68ef('0x6')]=_0x2ac782[_0x68ef('0x6')];this[_0x68ef('0x7')]=_0x2ac782['type'];this[_0x68ef('0x8')]=_0x2ac782[_0x68ef('0x7')]===_0x68ef('0x9')?_0x68ef('0xa'):_0x2ac782[_0x68ef('0x7')];this[_0x68ef('0xb')]=_0x2ac782[_0x68ef('0xb')];this[_0x68ef('0xc')]=_0x2ac782[_0x68ef('0xc')];this[_0x68ef('0xd')]=_0x2ac782[_0x68ef('0xd')];this[_0x68ef('0xe')]=_0x2ac782['countbusyretry']+_0x2ac782[_0x68ef('0xc')]+_0x2ac782[_0x68ef('0xd')]+_0x2ac782[_0x68ef('0xf')]+_0x2ac782[_0x68ef('0x10')]+_0x2ac782[_0x68ef('0x11')]+_0x2ac782[_0x68ef('0x12')]+_0x2ac782['countagentrejectretry'];this[_0x68ef('0xf')]=_0x2ac782[_0x68ef('0xf')];this[_0x68ef('0x10')]=_0x2ac782['countdropretry'];this[_0x68ef('0x11')]=_0x2ac782[_0x68ef('0x11')];this[_0x68ef('0x12')]=_0x2ac782['countmachineretry'];this[_0x68ef('0x13')]=_0x2ac782[_0x68ef('0x13')];this[_0x68ef('0xa')]=_0x2ac782[_0x68ef('0xa')];this['calleridname']=_0x2ac782[_0x68ef('0x14')];this['calleridnum']=_0x2ac782['calleridnum'];this[_0x68ef('0x15')]=_0x2ac782[_0x68ef('0x15')];this['responsetime']=_0x2ac782['responsetime'];this[_0x68ef('0x16')]=_0x2ac782[_0x68ef('0x17')];this[_0x68ef('0x18')]=_0x2ac782['ringtime']||0x0;this[_0x68ef('0x19')]=_0x2ac782[_0x68ef('0x19')]||0x0;this[_0x68ef('0x1a')]=_0x2ac782['talktime']||0x0;this[_0x68ef('0x1b')]=_0x2ac782[_0x68ef('0x1b')];this['callbackuniqueid']=_0x2ac782[_0x68ef('0x1c')];this[_0x68ef('0x1d')]=_0x2ac782[_0x68ef('0x1d')];this['recallme']=_0x2ac782['recallme'];this['ContactId']=_0x2ac782[_0x68ef('0x1e')];this[_0x68ef('0x1f')]=_0x2ac782[_0x68ef('0x1f')];this[_0x68ef('0x20')]=_0x2ac782[_0x68ef('0x20')];this[_0x68ef('0x21')]=_0x2ac782[_0x68ef('0x21')];this[_0x68ef('0x22')]=_0x2ac782[_0x68ef('0x22')];this[_0x68ef('0x23')]=_0x2ac782['originatecalleridnum']||'';this[_0x68ef('0x24')]=_0x2ac782['originatecalleridname']||'';}module['exports']=Final; \ No newline at end of file +var _0x4074=['util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports'];(function(_0x273dc5,_0x268a81){var _0x46dae7=function(_0x263d62){while(--_0x263d62){_0x273dc5['push'](_0x273dc5['shift']());}};_0x46dae7(++_0x268a81);}(_0x4074,0xf0));var _0x4407=function(_0x4b91f3,_0x330145){_0x4b91f3=_0x4b91f3-0x0;var _0x27ddf1=_0x4074[_0x4b91f3];return _0x27ddf1;};'use strict';var util=require(_0x4407('0x0'));var _=require(_0x4407('0x1'));var moment=require(_0x4407('0x2'));function getSeconds(_0x52977e,_0x1021e6){var _0x2a756=moment(_0x52977e)[_0x4407('0x3')](0x0);var _0x35ad38=moment(_0x1021e6)[_0x4407('0x3')](0x0);return _0x2a756[_0x4407('0x4')](_0x35ad38,_0x4407('0x5'));}function Final(_0x2495d2){this[_0x4407('0x6')]=_0x2495d2[_0x4407('0x6')];this['scheduledat']=_0x2495d2[_0x4407('0x7')];this['type']=_0x2495d2[_0x4407('0x8')];this[_0x4407('0x9')]=_0x2495d2[_0x4407('0x8')]==='outbound'?'queue':_0x2495d2['type'];this[_0x4407('0xa')]=_0x2495d2[_0x4407('0xa')];this[_0x4407('0xb')]=_0x2495d2[_0x4407('0xb')];this[_0x4407('0xc')]=_0x2495d2[_0x4407('0xc')];this[_0x4407('0xd')]=_0x2495d2[_0x4407('0xa')]+_0x2495d2[_0x4407('0xb')]+_0x2495d2[_0x4407('0xc')]+_0x2495d2[_0x4407('0xe')]+_0x2495d2['countdropretry']+_0x2495d2[_0x4407('0xf')]+_0x2495d2[_0x4407('0x10')]+_0x2495d2['countagentrejectretry'];this[_0x4407('0xe')]=_0x2495d2['countnosuchnumberretry'];this[_0x4407('0x11')]=_0x2495d2[_0x4407('0x11')];this[_0x4407('0xf')]=_0x2495d2[_0x4407('0xf')];this[_0x4407('0x10')]=_0x2495d2[_0x4407('0x10')];this[_0x4407('0x12')]=_0x2495d2[_0x4407('0x12')];this['queue']=_0x2495d2[_0x4407('0x13')];this[_0x4407('0x14')]=_0x2495d2[_0x4407('0x14')];this[_0x4407('0x15')]=_0x2495d2[_0x4407('0x15')];this['starttime']=_0x2495d2[_0x4407('0x16')];this['responsetime']=_0x2495d2[_0x4407('0x17')];this[_0x4407('0x18')]=_0x2495d2[_0x4407('0x17')];this[_0x4407('0x19')]=_0x2495d2[_0x4407('0x19')]||0x0;this['holdtime']=_0x2495d2[_0x4407('0x1a')]||0x0;this['talktime']=_0x2495d2[_0x4407('0x1b')]||0x0;this[_0x4407('0x1c')]=_0x2495d2[_0x4407('0x1c')];this[_0x4407('0x1d')]=_0x2495d2['callbackuniqueid'];this[_0x4407('0x1e')]=_0x2495d2[_0x4407('0x1e')];this[_0x4407('0x1f')]=_0x2495d2[_0x4407('0x1f')];this[_0x4407('0x20')]=_0x2495d2['ContactId'];this[_0x4407('0x21')]=_0x2495d2[_0x4407('0x21')];this[_0x4407('0x22')]=_0x2495d2[_0x4407('0x22')];this[_0x4407('0x23')]=_0x2495d2['VoiceQueueId'];this[_0x4407('0x24')]=_0x2495d2['CampaignId'];this[_0x4407('0x25')]=_0x2495d2['originatecalleridnum']||'';this[_0x4407('0x26')]=_0x2495d2['originatecalleridname']||'';}module[_0x4407('0x27')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index a2ebfed..387ef41 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 _0x208b=['YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','IVR','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','queue','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format'];(function(_0x55a629,_0x39ab88){var _0x48f9f0=function(_0x3fdbcd){while(--_0x3fdbcd){_0x55a629['push'](_0x55a629['shift']());}};_0x48f9f0(++_0x39ab88);}(_0x208b,0xeb));var _0xb208=function(_0x45f3e0,_0x1ed252){_0x45f3e0=_0x45f3e0-0x0;var _0x52a5a3=_0x208b[_0x45f3e0];return _0x52a5a3;};'use strict';var util=require(_0xb208('0x0'));var _=require(_0xb208('0x1'));var moment=require(_0xb208('0x2'));function getSeconds(_0x5f48c9,_0x2b8d17){var _0x4fd89b=moment(_0x5f48c9)[_0xb208('0x3')](0x0);var _0x3864cc=moment(_0x2b8d17)[_0xb208('0x3')](0x0);return _0x4fd89b[_0xb208('0x4')](_0x3864cc,_0xb208('0x5'));}function Hangup(_0x11c2f5,_0x4f27aa){this[_0xb208('0x6')]=0x4;this[_0xb208('0x7')]=_0xb208('0x8');this[_0xb208('0x9')]=_0x11c2f5[_0xb208('0x9')];this[_0xb208('0xa')]=_0x11c2f5[_0xb208('0xa')];this[_0xb208('0xb')]=_0x11c2f5[_0xb208('0xa')]==='outbound'?_0xb208('0xc'):_0x11c2f5[_0xb208('0xa')];this[_0xb208('0xd')]=_0x11c2f5[_0xb208('0xd')];this['countcongestionretry']=_0x11c2f5['countcongestionretry'];this[_0xb208('0xe')]=_0x11c2f5[_0xb208('0xe')];this['countglobal']=_0x11c2f5[_0xb208('0xd')]+_0x11c2f5['countcongestionretry']+_0x11c2f5['countnoanswerretry']+_0x11c2f5[_0xb208('0xf')]+_0x11c2f5[_0xb208('0x10')]+_0x11c2f5[_0xb208('0x11')]+_0x11c2f5[_0xb208('0x12')]+_0x11c2f5[_0xb208('0x13')];this[_0xb208('0xf')]=_0x11c2f5[_0xb208('0xf')];this['countdropretry']=_0x11c2f5[_0xb208('0x10')];this[_0xb208('0x11')]=_0x11c2f5['countabandonedretry'];this[_0xb208('0x12')]=_0x11c2f5[_0xb208('0x12')];this[_0xb208('0x13')]=_0x11c2f5[_0xb208('0x13')];this['uniqueid']=_0x4f27aa[_0xb208('0x14')];this[_0xb208('0x15')]=_0x11c2f5[_0xb208('0x16')];this[_0xb208('0x17')]=_0x11c2f5[_0xb208('0x18')];this[_0xb208('0x19')]=_0x11c2f5[_0xb208('0x19')];this[_0xb208('0x1a')]=_0x11c2f5[_0xb208('0x1a')];this[_0xb208('0x1b')]=moment()[_0xb208('0x1c')](_0xb208('0x1d'));this[_0xb208('0x1e')]=getSeconds(_0x11c2f5[_0xb208('0x1a')],_0x11c2f5[_0xb208('0x19')]);this['holdtime']=0x0;this[_0xb208('0x1f')]=getSeconds(this['endtime'],_0x11c2f5[_0xb208('0x1a')]);this[_0xb208('0xc')]=_0x11c2f5[_0xb208('0xc')];this['membername']=_0xb208('0x20');this[_0xb208('0x21')]=_0x4f27aa['cause-txt'];this[_0xb208('0x22')]=_0x11c2f5[_0xb208('0x22')];this[_0xb208('0x23')]=_0x11c2f5[_0xb208('0x23')];this[_0xb208('0x24')]=_0x11c2f5[_0xb208('0x24')];this[_0xb208('0x25')]=_0x11c2f5[_0xb208('0x25')];this['ContactId']=_0x11c2f5[_0xb208('0x26')];this[_0xb208('0x27')]=_0x11c2f5[_0xb208('0x27')];this[_0xb208('0x28')]=_0x11c2f5[_0xb208('0x28')];this['VoiceQueueId']=_0x11c2f5[_0xb208('0x29')];this[_0xb208('0x2a')]=_0x11c2f5[_0xb208('0x2a')];}module[_0xb208('0x2b')]=Hangup; \ No newline at end of file +var _0x6b45=['VoiceQueueId','CampaignId','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','calleridname','name','calleridnum','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','endtime','membername','IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId'];(function(_0x2a86b6,_0x2217db){var _0x20d349=function(_0x24f294){while(--_0x24f294){_0x2a86b6['push'](_0x2a86b6['shift']());}};_0x20d349(++_0x2217db);}(_0x6b45,0x136));var _0x56b4=function(_0x15cdcb,_0x4340e9){_0x15cdcb=_0x15cdcb-0x0;var _0x37b069=_0x6b45[_0x15cdcb];return _0x37b069;};'use strict';var util=require('util');var _=require(_0x56b4('0x0'));var moment=require(_0x56b4('0x1'));function getSeconds(_0x5e68d4,_0x1db097){var _0x1a389c=moment(_0x5e68d4)[_0x56b4('0x2')](0x0);var _0x2babc7=moment(_0x1db097)[_0x56b4('0x2')](0x0);return _0x1a389c[_0x56b4('0x3')](_0x2babc7,_0x56b4('0x4'));}function Hangup(_0xf12c4f,_0x29de30){this[_0x56b4('0x5')]=0x4;this[_0x56b4('0x6')]=_0x56b4('0x7');this[_0x56b4('0x8')]=_0xf12c4f[_0x56b4('0x8')];this[_0x56b4('0x9')]=_0xf12c4f[_0x56b4('0x9')];this[_0x56b4('0xa')]=_0xf12c4f[_0x56b4('0x9')]===_0x56b4('0xb')?_0x56b4('0xc'):_0xf12c4f[_0x56b4('0x9')];this[_0x56b4('0xd')]=_0xf12c4f[_0x56b4('0xd')];this[_0x56b4('0xe')]=_0xf12c4f[_0x56b4('0xe')];this[_0x56b4('0xf')]=_0xf12c4f[_0x56b4('0xf')];this[_0x56b4('0x10')]=_0xf12c4f['countbusyretry']+_0xf12c4f['countcongestionretry']+_0xf12c4f[_0x56b4('0xf')]+_0xf12c4f[_0x56b4('0x11')]+_0xf12c4f[_0x56b4('0x12')]+_0xf12c4f[_0x56b4('0x13')]+_0xf12c4f['countmachineretry']+_0xf12c4f[_0x56b4('0x14')];this[_0x56b4('0x11')]=_0xf12c4f[_0x56b4('0x11')];this['countdropretry']=_0xf12c4f[_0x56b4('0x12')];this[_0x56b4('0x13')]=_0xf12c4f[_0x56b4('0x13')];this[_0x56b4('0x15')]=_0xf12c4f['countmachineretry'];this[_0x56b4('0x14')]=_0xf12c4f['countagentrejectretry'];this['uniqueid']=_0x29de30['uniqueid'];this[_0x56b4('0x16')]=_0xf12c4f[_0x56b4('0x17')];this[_0x56b4('0x18')]=_0xf12c4f['number'];this[_0x56b4('0x19')]=_0xf12c4f[_0x56b4('0x19')];this['responsetime']=_0xf12c4f[_0x56b4('0x1a')];this['endtime']=moment()[_0x56b4('0x1b')](_0x56b4('0x1c'));this['ringtime']=getSeconds(_0xf12c4f['responsetime'],_0xf12c4f[_0x56b4('0x19')]);this[_0x56b4('0x1d')]=0x0;this[_0x56b4('0x1e')]=getSeconds(this[_0x56b4('0x1f')],_0xf12c4f[_0x56b4('0x1a')]);this['queue']=_0xf12c4f[_0x56b4('0xc')];this[_0x56b4('0x20')]=_0x56b4('0x21');this['reason']=_0x29de30[_0x56b4('0x22')];this[_0x56b4('0x23')]=_0xf12c4f[_0x56b4('0x23')];this[_0x56b4('0x24')]=_0xf12c4f['callbackuniqueid'];this[_0x56b4('0x25')]=_0xf12c4f[_0x56b4('0x25')];this[_0x56b4('0x26')]=_0xf12c4f['recallme'];this[_0x56b4('0x27')]=_0xf12c4f[_0x56b4('0x27')];this[_0x56b4('0x28')]=_0xf12c4f[_0x56b4('0x28')];this[_0x56b4('0x29')]=_0xf12c4f[_0x56b4('0x29')];this[_0x56b4('0x2a')]=_0xf12c4f[_0x56b4('0x2a')];this['CampaignId']=_0xf12c4f[_0x56b4('0x2b')];}module['exports']=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 5a00e54..2367923 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 _0xdff4=['VoiceQueueId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','type','campaigntype','queue','countbusyretry','countcongestionretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridname','name','calleridnum','number','starttime','responsetime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId'];(function(_0x31e70a,_0x44f681){var _0xfeabd7=function(_0x662fe8){while(--_0x662fe8){_0x31e70a['push'](_0x31e70a['shift']());}};_0xfeabd7(++_0x44f681);}(_0xdff4,0xe2));var _0x4dff=function(_0x8426a0,_0x183ad8){_0x8426a0=_0x8426a0-0x0;var _0x4f71e3=_0xdff4[_0x8426a0];return _0x4f71e3;};'use strict';var util=require(_0x4dff('0x0'));var _=require(_0x4dff('0x1'));var moment=require(_0x4dff('0x2'));function getSeconds(_0x344361,_0x482bf2){var _0xe05712=moment(_0x344361)[_0x4dff('0x3')](0x0);var _0x2c707c=moment(_0x482bf2)[_0x4dff('0x3')](0x0);return _0xe05712[_0x4dff('0x4')](_0x2c707c,_0x4dff('0x5'));}function History(_0x3b583f){this[_0x4dff('0x6')]=_0x3b583f[_0x4dff('0x6')];this['scheduledat']=_0x3b583f['scheduledat']||undefined;this[_0x4dff('0x7')]=_0x3b583f['type'];this[_0x4dff('0x8')]=_0x3b583f[_0x4dff('0x7')]==='outbound'?_0x4dff('0x9'):_0x3b583f['type'];this[_0x4dff('0xa')]=_0x3b583f[_0x4dff('0xa')];this[_0x4dff('0xb')]=_0x3b583f[_0x4dff('0xb')];this['countnoanswerretry']=_0x3b583f['countnoanswerretry'];this[_0x4dff('0xc')]=_0x3b583f[_0x4dff('0xa')]+_0x3b583f[_0x4dff('0xb')]+_0x3b583f['countnoanswerretry']+_0x3b583f[_0x4dff('0xd')]+_0x3b583f[_0x4dff('0xe')]+_0x3b583f['countabandonedretry']+_0x3b583f[_0x4dff('0xf')]+_0x3b583f[_0x4dff('0x10')];this['countnosuchnumberretry']=_0x3b583f[_0x4dff('0xd')];this['countdropretry']=_0x3b583f[_0x4dff('0xe')];this['countabandonedretry']=_0x3b583f[_0x4dff('0x11')];this[_0x4dff('0xf')]=_0x3b583f[_0x4dff('0xf')];this[_0x4dff('0x10')]=_0x3b583f[_0x4dff('0x10')];this[_0x4dff('0x9')]=_0x3b583f['queue'];this[_0x4dff('0x12')]=_0x3b583f[_0x4dff('0x13')];this[_0x4dff('0x14')]=_0x3b583f[_0x4dff('0x15')];this[_0x4dff('0x16')]=_0x3b583f[_0x4dff('0x16')];this['responsetime']=_0x3b583f[_0x4dff('0x17')];this['endtime']=_0x3b583f[_0x4dff('0x17')];this[_0x4dff('0x18')]=getSeconds(_0x3b583f['responsetime'],_0x3b583f[_0x4dff('0x16')]);this[_0x4dff('0x19')]=0x0;this['talktime']=0x0;this[_0x4dff('0x1a')]=_0x3b583f['callback'];this[_0x4dff('0x1b')]=_0x3b583f[_0x4dff('0x1b')];this[_0x4dff('0x1c')]=_0x3b583f[_0x4dff('0x1c')];this[_0x4dff('0x1d')]=_0x3b583f[_0x4dff('0x1d')];this[_0x4dff('0x1e')]=_0x3b583f['ContactId'];this['ListId']=_0x3b583f[_0x4dff('0x1f')];this[_0x4dff('0x20')]=_0x3b583f[_0x4dff('0x20')];this[_0x4dff('0x21')]=_0x3b583f[_0x4dff('0x21')];this['CampaignId']=_0x3b583f['CampaignId'];this[_0x4dff('0x22')]=_0x3b583f[_0x4dff('0x22')]||'';this[_0x4dff('0x23')]=_0x3b583f[_0x4dff('0x23')]||'';}module[_0x4dff('0x24')]=History; \ No newline at end of file +var _0xf66c=['lodash','moment','milliseconds','diff','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','starttime','responsetime','endtime','ringtime','talktime','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','exports','util'];(function(_0x5ed56d,_0x418af5){var _0x2b3ef9=function(_0x3277ae){while(--_0x3277ae){_0x5ed56d['push'](_0x5ed56d['shift']());}};_0x2b3ef9(++_0x418af5);}(_0xf66c,0xdd));var _0xcf66=function(_0x5a4cef,_0x63014f){_0x5a4cef=_0x5a4cef-0x0;var _0x41a703=_0xf66c[_0x5a4cef];return _0x41a703;};'use strict';var util=require(_0xcf66('0x0'));var _=require(_0xcf66('0x1'));var moment=require(_0xcf66('0x2'));function getSeconds(_0x249e38,_0x3fe4ac){var _0x191916=moment(_0x249e38)[_0xcf66('0x3')](0x0);var _0x2b26de=moment(_0x3fe4ac)[_0xcf66('0x3')](0x0);return _0x191916[_0xcf66('0x4')](_0x2b26de,'seconds');}function History(_0x5de13e){this[_0xcf66('0x5')]=_0x5de13e[_0xcf66('0x5')];this[_0xcf66('0x6')]=_0x5de13e[_0xcf66('0x6')]||undefined;this[_0xcf66('0x7')]=_0x5de13e['type'];this[_0xcf66('0x8')]=_0x5de13e['type']==='outbound'?_0xcf66('0x9'):_0x5de13e[_0xcf66('0x7')];this[_0xcf66('0xa')]=_0x5de13e[_0xcf66('0xa')];this['countcongestionretry']=_0x5de13e[_0xcf66('0xb')];this[_0xcf66('0xc')]=_0x5de13e[_0xcf66('0xc')];this[_0xcf66('0xd')]=_0x5de13e[_0xcf66('0xa')]+_0x5de13e[_0xcf66('0xb')]+_0x5de13e[_0xcf66('0xc')]+_0x5de13e[_0xcf66('0xe')]+_0x5de13e[_0xcf66('0xf')]+_0x5de13e[_0xcf66('0x10')]+_0x5de13e[_0xcf66('0x11')]+_0x5de13e['countagentrejectretry'];this['countnosuchnumberretry']=_0x5de13e[_0xcf66('0xe')];this['countdropretry']=_0x5de13e[_0xcf66('0xf')];this[_0xcf66('0x10')]=_0x5de13e[_0xcf66('0x10')];this[_0xcf66('0x11')]=_0x5de13e[_0xcf66('0x11')];this['countagentrejectretry']=_0x5de13e[_0xcf66('0x12')];this[_0xcf66('0x9')]=_0x5de13e[_0xcf66('0x9')];this[_0xcf66('0x13')]=_0x5de13e[_0xcf66('0x14')];this[_0xcf66('0x15')]=_0x5de13e['number'];this[_0xcf66('0x16')]=_0x5de13e['starttime'];this[_0xcf66('0x17')]=_0x5de13e['responsetime'];this[_0xcf66('0x18')]=_0x5de13e[_0xcf66('0x17')];this[_0xcf66('0x19')]=getSeconds(_0x5de13e[_0xcf66('0x17')],_0x5de13e[_0xcf66('0x16')]);this['holdtime']=0x0;this[_0xcf66('0x1a')]=0x0;this['callback']=_0x5de13e['callback'];this['callbackuniqueid']=_0x5de13e[_0xcf66('0x1b')];this['callbackat']=_0x5de13e[_0xcf66('0x1c')];this['recallme']=_0x5de13e[_0xcf66('0x1d')];this[_0xcf66('0x1e')]=_0x5de13e[_0xcf66('0x1e')];this['ListId']=_0x5de13e[_0xcf66('0x1f')];this[_0xcf66('0x20')]=_0x5de13e[_0xcf66('0x20')];this[_0xcf66('0x21')]=_0x5de13e[_0xcf66('0x21')];this['CampaignId']=_0x5de13e[_0xcf66('0x22')];this['originatecalleridnum']=_0x5de13e['originatecalleridnum']||'';this['originatecalleridname']=_0x5de13e[_0xcf66('0x23')]||'';}module[_0xcf66('0x24')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 16dd025..40d1d75 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 _0x6a24=['some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','progressive','predictive','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialMethod','dialGlobalInterval','checkIfTimeIntervals','dialTimezone','checkDialMethod','[syncQueueSummary]','throttle','filter','dialPreviewRecallmeReminder','online','handlePreviewRecallNotifications','map','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','\x5cw{0,','pow','match','object','originate','voiceQueue\x20is\x20undefine','phone','getCaller','NONE','dialAgiAfterHangupAgent','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','Contact','tags','updatedAt','%s%s','toUpper','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','substring','dialCutDigit','trim','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAbandonedMaxRetry','[rescheduleContact][Machine]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','callProgressDetecting','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','custom:agentreject','agentreject','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','floor','erlangCalls','[startMethodPredictive][StartProgressive]','collection\x20data\x20in\x20progressive\x20at','handlePower','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','averageHandleTime','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(','getDataPredictive','abandonmentRate','agentBusyFactor','dialPredictiveOptimizationPercentage','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','actionOriginate','scheduledat','dialRecallMeTimeout','Agent','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','emptyContact','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','dialOrderByScheduledAt','ACTIVE','[actionOriginate]\x20','[getContactDialer2]','tryOriginatePredictive','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Error','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','[busyFactor]','Umin\x20=\x20','exports','util','lodash','uuid','moment','md5','ioredis','../preview/util/util','../../../config/logger','dialer','booked','predictiveCalls','../ami','defaults','localhost','socket.io-emitter','redis','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperFinal','../rpc/cmHopperAdditionalPhone','../rpc/cmHopperBlack','./action','./history','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','ivrOriginated','queueBookedRR','agentconnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummary','custom:queuesummarycomplete','syncQueueSummaryComplete','syncHangup','newexten','syncNewExten','varset','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','message','\x20INTERVAL_IS_NULL','Intervals','INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','stringify','milliseconds','diff','seconds','type','outbound','strategy','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','active','callerid','format','voice:queue:%s','ivr','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','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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\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','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\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','preview','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','debug','inspect','error','stack','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','clearZombieChannels','[uniqueid]','prototype','enqueue','Action','status','catch','No\x20such\x20channel','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','[countReScheduled]\x20','resolve','checkIsBlackList','[checkIsBlackList]\x20','verifyAdditionalPhones','[verifyAdditionalPhone]\x20','swapAdditionalPhones','[swapAdditionalPhone]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','[averageHandleTime]\x20','rescheduleContact','[unlockContact]\x20','getContactDialer','temp','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','updateOriginated','pick','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','syncVarSet','uniqueid','isNil','variable','exten','xcally-motion-dialer','dialAMDActive','value','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','emit','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD][createHistory]','MACHINE','Machine','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','HANGUP','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countnoanswerretry','createStateFinal','ContactId','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AGI','cause-txt','Unknow','reason','agiafterat','dialQueueProject2','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','dialDropRetryFrequency','callAdditionalPhoneAfterMin','voiceQueue','dialDropMaxRetry','[rescheduleContact][Drop]','starttime','calleridname','predictiveIntervalDroppedCallsCallersExit','Abandoned','dialAbandonedRetryFrequency','additional','[rescheduleContact][Abandoned]','calleridnum','channel','actionid','paused','stateinterface','locked','queueBooked','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','run','[booked][RR][finaly]','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','Failure','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','push','interval','indexOf','true','iftime\x20%s,%s','content','all'];(function(_0x3adf50,_0x4d92f0){var _0x243b39=function(_0x17464f){while(--_0x17464f){_0x3adf50['push'](_0x3adf50['shift']());}};_0x243b39(++_0x4d92f0);}(_0x6a24,0xd1));var _0x46a2=function(_0x2ee14f,_0x52f755){_0x2ee14f=_0x2ee14f-0x0;var _0x293edb=_0x6a24[_0x2ee14f];return _0x293edb;};'use strict';var util=require(_0x46a2('0x0'));var _=require(_0x46a2('0x1'));var BPromise=require('bluebird');var uuid=require(_0x46a2('0x2'));var moment=require(_0x46a2('0x3'));var rr=require('rr');var md5=require(_0x46a2('0x4'));var Redis=require(_0x46a2('0x5'));var ut=require(_0x46a2('0x6'));var config=require('../../../config/environment/');var logger=require(_0x46a2('0x7'))(_0x46a2('0x8'));var loggerBooked=require('../../../config/logger')(_0x46a2('0x9'));var loggerPredictive=require(_0x46a2('0x7'))('predictive');var loggerPredictiveCalls=require('../../../config/logger')(_0x46a2('0xa'));var loggerSyncQueueSummary=require(_0x46a2('0x7'))('syncQueueSummary');var ami=require(_0x46a2('0xb'));config['redis']=_[_0x46a2('0xc')](config['redis'],{'host':_0x46a2('0xd'),'port':0x18eb});var io=require(_0x46a2('0xe'))(new Redis(config[_0x46a2('0xf')]));var cmHopper=require(_0x46a2('0x10'));var cmHopperHistory=require(_0x46a2('0x11'));var cmHopperFinal=require(_0x46a2('0x12'));var cmHopperAdditionalPhone=require(_0x46a2('0x13'));var cmHopperBlack=require(_0x46a2('0x14'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require('../rpc/setting');var Action=require(_0x46a2('0x15'));var History=require(_0x46a2('0x16'));var Final=require('./final');var AgentComplete=require(_0x46a2('0x17'));var QueueCallerAbandon=require(_0x46a2('0x18'));var Hangup=require(_0x46a2('0x19'));var ipAgi=process[_0x46a2('0x1a')][_0x46a2('0x1b')]||_0x46a2('0x1c');var strategy={'rrmemory':_0x46a2('0x1d'),'roundrobin':_0x46a2('0x1e')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x3c81e8){this[_0x46a2('0x1f')]=this['tail']?this[_0x46a2('0x1f')][_0x46a2('0x20')](_0x3c81e8):_0x3c81e8();};function Dialer(_0x5b7c65,_0xa2eb96){this[_0x46a2('0x21')]=new Sequence();this['preview']=_0xa2eb96;this[_0x46a2('0x22')]=_0x5b7c65[_0x46a2('0x22')];this['campaigns']=_0x5b7c65[_0x46a2('0x23')];this[_0x46a2('0x24')]=_0x5b7c65[_0x46a2('0x24')];this[_0x46a2('0x25')]=_0x5b7c65[_0x46a2('0x25')];this[_0x46a2('0x26')]=config[_0x46a2('0x26')]||0x2;this[_0x46a2('0x27')]={};this[_0x46a2('0x28')]={};this[_0x46a2('0x29')]={};this[_0x46a2('0x2a')]={};this[_0x46a2('0x2b')]={};this[_0x46a2('0x2c')]={};this['startProgressive']={};this[_0x46a2('0x2d')]={};this['queueBooked']={};this[_0x46a2('0x2e')]={};ami['on'](_0x46a2('0x2f'),this['syncAgentConnect'][_0x46a2('0x30')](this));ami['on'](_0x46a2('0x31'),this[_0x46a2('0x32')][_0x46a2('0x30')](this));ami['on']('originateresponse',this[_0x46a2('0x33')][_0x46a2('0x30')](this));ami['on'](_0x46a2('0x34'),this[_0x46a2('0x35')][_0x46a2('0x30')](this));ami['on'](_0x46a2('0x36'),this[_0x46a2('0x37')][_0x46a2('0x30')](this));ami['on'](_0x46a2('0x38'),this[_0x46a2('0x39')][_0x46a2('0x30')](this));ami['on']('hangup',this[_0x46a2('0x3a')][_0x46a2('0x30')](this));ami['on'](_0x46a2('0x3b'),this[_0x46a2('0x3c')][_0x46a2('0x30')](this));ami['on'](_0x46a2('0x3d'),this['syncVarSet'][_0x46a2('0x30')](this));ami['on'](_0x46a2('0x3e'),this[_0x46a2('0x3f')][_0x46a2('0x30')](this));ami['on'](_0x46a2('0x40'),this[_0x46a2('0x41')][_0x46a2('0x30')](this));this['loopCampaigns']();this[_0x46a2('0x42')]();RpcSetting[_0x46a2('0x43')]()[_0x46a2('0x44')](function(_0x3bc0db){previewRecallmeReminderInterval=_0x3bc0db[_0x46a2('0x45')];});}function isNotNull(_0x1910c9){return _0x1910c9!==null&&!_[_0x46a2('0x46')](_0x1910c9);}function checkIsLoggedIn(_0x28a524,_0x1d8146){return function(){if(_0x1d8146<=0x0){_0x28a524['message']=_0x46a2('0x47');throw _0x28a524[_0x46a2('0x48')]+_0x46a2('0x49');}};}function isActive(_0x26864c){return _0x26864c;}function checkIsActive(_0x4f13da,_0x59e84a){return function(){if(!isActive(_0x59e84a)){_0x4f13da['message']=_0x46a2('0x4a');throw _0x4f13da[_0x46a2('0x48')]+_0x46a2('0x4b');}};}function checkInterval(_0xeb213e){return function(){if(!isNotNull(_0xeb213e[_0x46a2('0x4c')])){_0xeb213e[_0x46a2('0x4d')]='INTERVAL_IS_NULL';throw _0xeb213e['name']+_0x46a2('0x4e');}if(!isNotNull(_0xeb213e['Interval'][_0x46a2('0x4f')])){_0xeb213e[_0x46a2('0x4d')]=_0x46a2('0x50');throw _0xeb213e[_0x46a2('0x48')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x46a2('0x51')](_0xeb213e[_0x46a2('0x4c')][_0x46a2('0x4f')]))){_0xeb213e[_0x46a2('0x4d')]='INTERVAL_IS_NULL';throw _0xeb213e[_0x46a2('0x48')]+_0x46a2('0x4e');}};}function msgResponse(_0x244c4b,_0x1cff82,_0x4fa161){return{'action':_0x244c4b,'response':_0x1cff82,'message':_0x4fa161,'stack':_0x4fa161};}function myreject(_0x356c98){return function(_0x5bddad){return _0x356c98(msgResponse(_0x46a2('0x52'),'Error',JSON[_0x46a2('0x53')](_0x5bddad)));};}function getSeconds(_0x32be94,_0x53e1fb){var _0x316b3d=moment(_0x32be94)['milliseconds'](0x0);var _0x50aa8b=moment(_0x53e1fb)[_0x46a2('0x54')](0x0);return _0x316b3d[_0x46a2('0x55')](_0x50aa8b,_0x46a2('0x56'));}function emit(_0x160efd,_0x118f23,_0x3b2c96){io['to'](_0x160efd)['emit'](_0x118f23,_0x3b2c96);}function emitVoiceQueueSummary(_0x2a5301){if(_0x2a5301[_0x46a2('0x57')]===_0x46a2('0x58')){var _0x4449c5={'id':_0x2a5301['id'],'name':_0x2a5301[_0x46a2('0x48')],'strategy':_0x2a5301[_0x46a2('0x59')],'answered':_0x2a5301[_0x46a2('0x5a')],'available':_0x2a5301[_0x46a2('0x5b')],'loggedIn':_0x2a5301[_0x46a2('0x5c')],'pTalking':_0x2a5301[_0x46a2('0x5d')],'sumBillable':_0x2a5301['sumBillable'],'sumDuration':_0x2a5301[_0x46a2('0x5e')],'sumHoldTime':_0x2a5301[_0x46a2('0x5f')]||0x0,'talking':_0x2a5301[_0x46a2('0x60')],'total':_0x2a5301[_0x46a2('0x61')],'type':_0x2a5301['type'],'unmanaged':_0x2a5301[_0x46a2('0x62')],'abandoned':_0x2a5301[_0x46a2('0x63')],'waiting':_0x2a5301[_0x46a2('0x64')],'loggedInDb':_0x2a5301[_0x46a2('0x65')],'dialActive':_0x2a5301[_0x46a2('0x66')],'dialMethod':_0x2a5301['dialMethod'],'dialOriginateCallerIdName':_0x2a5301[_0x46a2('0x67')],'dialOriginateCallerIdNumber':_0x2a5301['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x2a5301[_0x46a2('0x68')],'dialPrefix':_0x2a5301[_0x46a2('0x69')],'outboundAnswerAgiCallsDay':_0x2a5301['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x2a5301[_0x46a2('0x6a')],'outboundBlacklistCallsDay':_0x2a5301[_0x46a2('0x6b')],'outboundBusyCallsDay':_0x2a5301[_0x46a2('0x6c')],'outboundCongestionCallsDay':_0x2a5301[_0x46a2('0x6d')],'outboundDropCallsDayACS':_0x2a5301[_0x46a2('0x6e')],'outboundDropCallsDayCallersExit':_0x2a5301[_0x46a2('0x6f')],'outboundDropCallsDayTimeout':_0x2a5301[_0x46a2('0x70')],'outboundNoAnswerCallsDay':_0x2a5301[_0x46a2('0x71')],'outboundNoSuchCallsDay':_0x2a5301[_0x46a2('0x72')],'outboundOriginateFailureCallsDay':_0x2a5301[_0x46a2('0x73')],'outboundReCallsDay':_0x2a5301['outboundReCallsDay'],'outboundRejectCallsDay':_0x2a5301[_0x46a2('0x74')],'outboundUnknownCallsDay':_0x2a5301[_0x46a2('0x75')],'predictiveIntervalAnsweredCalls':_0x2a5301[_0x46a2('0x76')],'predictiveIntervalAvgHoldtime':_0x2a5301[_0x46a2('0x77')],'predictiveIntervalAvgTalktime':_0x2a5301[_0x46a2('0x78')],'predictiveIntervalDroppedCallsCallersExit':_0x2a5301['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x2a5301[_0x46a2('0x79')],'predictiveIntervalErlangCalls':_0x2a5301[_0x46a2('0x7a')],'predictiveIntervalErlangCallsDroppedCalls':_0x2a5301[_0x46a2('0x7b')],'predictiveIntervalHitRate':_0x2a5301[_0x46a2('0x7c')],'predictiveIntervalMultiplicativeFactor':_0x2a5301[_0x46a2('0x7d')],'predictiveIntervalPauses':_0x2a5301['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x2a5301[_0x46a2('0x7e')],'predictiveIntervalTotalCalls':_0x2a5301['predictiveIntervalTotalCalls'],'message':_0x2a5301[_0x46a2('0x4d')],'originated':_0x2a5301[_0x46a2('0x7f')],'erlangCalls':_0x2a5301['erlangCalls'],'erlangCallToSecond':_0x2a5301[_0x46a2('0x80')],'erlangAbandonmentRate':_0x2a5301[_0x46a2('0x81')],'erlangBusyFactor':_0x2a5301[_0x46a2('0x82')],'startPredictive':_0x2a5301[_0x46a2('0x2c')],'startProgressive':_0x2a5301[_0x46a2('0x83')]};if(_0x2a5301[_0x46a2('0x84')]){_0x4449c5[_0x46a2('0x84')]={'id':_0x2a5301['Trunk']['id'],'name':_0x2a5301[_0x46a2('0x84')][_0x46a2('0x48')],'active':_0x2a5301[_0x46a2('0x84')][_0x46a2('0x85')],'callerid':_0x2a5301['Trunk'][_0x46a2('0x86')]};}if(_0x2a5301['Interval']){_0x4449c5[_0x46a2('0x4c')]={'id':_0x2a5301[_0x46a2('0x4c')]['id'],'name':_0x2a5301['Interval'][_0x46a2('0x48')]};}var _0x490715=md5(JSON[_0x46a2('0x53')](_0x4449c5));if(_0x2a5301[_0x46a2('0x4')]!==_0x490715){_0x2a5301[_0x46a2('0x4')]=_0x490715;emit(util[_0x46a2('0x87')](_0x46a2('0x88'),_0x4449c5[_0x46a2('0x48')]),'voice_queue:save',_0x4449c5);}}}function emitCampaignSummary(_0x4b9be7){if(_0x4b9be7[_0x46a2('0x57')]===_0x46a2('0x89')){emit(util[_0x46a2('0x87')](_0x46a2('0x8a'),_0x4b9be7[_0x46a2('0x48')]),_0x46a2('0x8b'),_0x4b9be7);}}function checkGetDataPredictive(_0x2786d5){if(isNotNull(_0x2786d5)&&!_['isEmpty'](_0x2786d5)){loggerPredictive[_0x46a2('0x8c')](_0x46a2('0x8d'));loggerPredictive[_0x46a2('0x8c')](_0x46a2('0x8e'),_0x2786d5[_0x46a2('0x8f')]);loggerPredictive[_0x46a2('0x8c')](_0x46a2('0x90'),_0x2786d5['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x46a2('0x8c')](_0x46a2('0x91'),_0x2786d5['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x46a2('0x8c')](_0x46a2('0x92'),_0x2786d5['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x46a2('0x8c')](_0x46a2('0x93'),_0x2786d5['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x46a2('0x8c')](_0x46a2('0x94'),_0x2786d5['predictiveIntervalAvgTalktime']);loggerPredictive['info']('---------------------------');if(_0x2786d5['predictiveIntervalTotalCalls']>0x0){if(!_[_0x46a2('0x46')](_0x2786d5['predictiveIntervalAvgTalktime'])&&_0x2786d5['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0x46a2('0x8c')](_0x46a2('0x95'));if(!_[_0x46a2('0x46')](_0x2786d5[_0x46a2('0x77')])&&_0x2786d5[_0x46a2('0x77')]>0x0){return!![];}loggerPredictive[_0x46a2('0x8c')](_0x46a2('0x96'));}else{loggerPredictive[_0x46a2('0x8c')](_0x46a2('0x97'));}}else{loggerPredictive[_0x46a2('0x8c')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x5070a6){return function(_0x3a6dc1){loggerPredictive[_0x46a2('0x8c')](_0x46a2('0x98'));loggerPredictive['info'](_0x46a2('0x99'),_0x3a6dc1['erlangCalls']);loggerPredictive[_0x46a2('0x8c')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3a6dc1['erlangCallToSecond']);loggerPredictive[_0x46a2('0x8c')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3a6dc1[_0x46a2('0x81')]);loggerPredictive['info'](_0x46a2('0x9a'),_0x3a6dc1['erlangBusyFactor']);loggerPredictive[_0x46a2('0x8c')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3a6dc1[_0x46a2('0x81')]);loggerPredictive[_0x46a2('0x8c')]('---------------------------');_[_0x46a2('0x9b')](_0x5070a6,_0x3a6dc1);};}function getDiff(_0x3827af){var _0x5d0e93=moment()[_0x46a2('0x54')](0x0);var _0x2926d7=moment(_0x3827af)[_0x46a2('0x54')](0x0);return _0x5d0e93[_0x46a2('0x55')](_0x2926d7,_0x46a2('0x56'));}function ifInterval(_0x2e987a,_0x14d61c){if(_[_0x46a2('0x46')](_0x14d61c)){return![];}return getDiff(_0x14d61c)<_0x2e987a*0x3c;}function freeVariablesPredictive(_0x4a89cc){if(isNotNull(_0x4a89cc)){if(!_[_0x46a2('0x46')](_0x4a89cc[_0x46a2('0x83')])){_0x4a89cc[_0x46a2('0x83')]=undefined;loggerPredictive[_0x46a2('0x8c')](_0x4a89cc[_0x46a2('0x48')],_0x46a2('0x9c'));}if(!_[_0x46a2('0x46')](_0x4a89cc[_0x46a2('0x2c')])){_0x4a89cc[_0x46a2('0x2c')]=undefined;loggerPredictive[_0x46a2('0x8c')](_0x4a89cc[_0x46a2('0x48')],_0x46a2('0x9d'));}if(!_['isUndefined'](_0x4a89cc['handlePredictive'])){clearInterval(_0x4a89cc['handlePredictive']);_0x4a89cc[_0x46a2('0x9e')]=undefined;loggerPredictive[_0x46a2('0x8c')](_0x4a89cc[_0x46a2('0x48')],_0x46a2('0x9f'));}}}function erlangb(_0x190bc3,_0x359151){if(_0x359151===0x0){return 0x0;}var _0x4240db=0x1;for(var _0x560aa6=0x1;_0x560aa6<=_0x359151;_0x560aa6+=0x1){_0x4240db=0x1+_0x4240db*_0x560aa6/_0x190bc3;}return 0x1/_0x4240db;}function isVoiceQueueOutbound(_0x254618){return _0x254618==='outbound';}function isNotPreview(_0x5c205b){return _0x5c205b!==_0x46a2('0xa0');}function isCampaignIvr(_0x44f112){return _0x44f112===_0x46a2('0x89');}function getCallerId(_0x5ebe07,_0x198f1c,_0x3dc724){if(!_[_0x46a2('0x46')](_0x3dc724)&&typeof _0x3dc724===_0x46a2('0xa1')&&!_[_0x46a2('0x51')](_0x3dc724)){if(!_[_0x46a2('0x46')](_0x198f1c)&&typeof _0x198f1c===_0x46a2('0xa1')&&!_[_0x46a2('0x51')](_0x198f1c)){return util[_0x46a2('0x87')](_0x46a2('0xa2'),_0x198f1c,_0x3dc724);}return util['format'](_0x46a2('0xa2'),_0x3dc724,_0x3dc724);}if(!_[_0x46a2('0x46')](_0x5ebe07)&&typeof _0x5ebe07===_0x46a2('0xa1')&&!_[_0x46a2('0x51')](_0x5ebe07)){return _0x5ebe07;}return _0x46a2('0xa3');}function loggerCatchQueueSummary(_0x2e1d5b,_0x3cbe9d){return function(_0x4c2bc3){freeVariablesPredictive(_0x3cbe9d);emitVoiceQueueSummary(_0x3cbe9d);emitCampaignSummary(_0x3cbe9d);loggerSyncQueueSummary[_0x46a2('0xa4')](_0x2e1d5b,util[_0x46a2('0xa5')](_0x4c2bc3,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x3541e1,_0x1d54e6){return function(_0x55236c){loggerPredictive[_0x46a2('0xa6')](_0x1d54e6[_0x46a2('0x48')],_0x3541e1);loggerPredictive[_0x46a2('0xa6')](_0x55236c[_0x46a2('0xa7')]);freeVariablesPredictive(_0x1d54e6);};}function loggerCatch(_0x561d2b){return function(_0x3279fa){logger[_0x46a2('0xa6')](_0x561d2b,util[_0x46a2('0xa5')](_0x3279fa,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x1c17b6){return _0x1c17b6&&!_[_0x46a2('0x46')](_0x1c17b6)&&_0x1c17b6[_0x46a2('0xa8')]>0x0;}function decremetOriginate(_0x397042){if(!_['isUndefined'](_0x397042)&&_0x397042!==null){if(typeof _0x397042['originated']!==_0x46a2('0xa9')){if(_0x397042[_0x46a2('0x7f')]>0x0){_0x397042['originated']-=0x1;}else{logger[_0x46a2('0xa6')](_0x46a2('0xaa'));}}}else{logger['error'](_0x46a2('0xab'));}}function checkContactLowerLimitOriginate(_0x34b8ec,_0x5b90b8,_0x353a6e){if(_0x5b90b8>_0x353a6e){for(var _0x2e4298=0x0;_0x2e4298<_0x5b90b8-_0x353a6e;_0x2e4298+=0x1){decremetOriginate(_0x34b8ec);}}}function loggerGetContactDialer(_0x468431,_0x530928,_0x393abd){return function(_0x204088){checkContactLowerLimitOriginate(_0x530928,_0x393abd,0x0);logger[_0x46a2('0xa6')](_0x468431,util[_0x46a2('0xa5')](_0x204088,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x5bfa1b){return function(_0x3f09ff){if(isNotNull(_0x3f09ff)&&isNotNull(_0x3f09ff[0x0])){if(_0x3f09ff[0x0][_0x46a2('0xac')]>0x0){_0x5bfa1b['message']='RESCHEDULED_CONTACTS';logger[_0x46a2('0x8c')](_0x46a2('0xad')+_0x5bfa1b['name'],_0x3f09ff[0x0]['contactsRescheduled'],_0x46a2('0xae'));}else{_0x5bfa1b['message']=_0x46a2('0xaf');logger[_0x46a2('0x8c')](_0x46a2('0xb0')+_0x5bfa1b[_0x46a2('0x48')]);}}};}function notSendMessagesQueue(_0x4a96fa){if(_0x4a96fa['sendMessageOneNotActive']){freeVariablesPredictive(_0x4a96fa);if(_0x4a96fa[_0x46a2('0x7f')]===0x0&&_0x4a96fa[_0x46a2('0x60')]===0x0&&_0x4a96fa[_0x46a2('0x64')]===0x0&&(_0x4a96fa[_0x46a2('0x5d')]||0x0)===0x0){_0x4a96fa[_0x46a2('0xb1')]=![];_0x4a96fa[_0x46a2('0x5b')]=0x0;_0x4a96fa[_0x46a2('0x4d')]=_0x46a2('0x4a');loggerSyncQueueSummary[_0x46a2('0xa4')](_0x46a2('0xb2'),_0x4a96fa['name'],'is\x20not\x20active');}else{_0x4a96fa[_0x46a2('0x4d')]=_0x46a2('0xb3');loggerSyncQueueSummary['debug'](_0x46a2('0xb2'),_0x4a96fa[_0x46a2('0x48')],_0x46a2('0xb4'));}emitVoiceQueueSummary(_0x4a96fa);}}function notSendMessagesCampaign(_0x49c264){if(_0x49c264[_0x46a2('0xb1')]){if(_0x49c264[_0x46a2('0x7f')]===0x0){_0x49c264[_0x46a2('0xb1')]=![];_0x49c264[_0x46a2('0x4d')]=_0x46a2('0x4a');loggerSyncQueueSummary[_0x46a2('0xa4')](_0x46a2('0xb5'),_0x49c264[_0x46a2('0x48')],'is\x20not\x20active');}else{_0x49c264[_0x46a2('0x4d')]=_0x46a2('0xb3');loggerSyncQueueSummary['debug']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x49c264[_0x46a2('0x48')],_0x46a2('0xb4'));}emitCampaignSummary(_0x49c264);}}function createObjHistory(_0x998894,_0x314236,_0x539993,_0xd55ba1,_0x53d7e9){_0x998894[_0x46a2('0x4d')]=_0x539993;var _0x134ef7=new Action(_0x998894,_0x314236);var _0x46801a=new History(_0x134ef7);_0x46801a[_0x46a2('0xb6')]=_0xd55ba1;_0x46801a[_0x46a2('0xb7')]=_0x53d7e9;_0x46801a[_0x46a2('0xb8')]=_0x134ef7['starttime'];return _0x46801a;}Dialer['prototype']['loopClearZombieChannels']=function(){var _0x4a49cb=this;setInterval(function(){_0x4a49cb[_0x46a2('0xb9')](_0x4a49cb[_0x46a2('0x2a')],_0x46a2('0xba'));_0x4a49cb[_0x46a2('0xb9')](_0x4a49cb['actions'],'[actions]');},0x32c8);};Dialer[_0x46a2('0xbb')]['clearZombieChannels']=function(_0x2bc910,_0x1bc646){var _0x2de4dc=this;for(var _0x5a8b6c in _0x2bc910){if(typeof _0x2bc910[_0x5a8b6c]!==_0x46a2('0xa9')){this[_0x46a2('0x21')][_0x46a2('0xbc')](function(){if(!_['isNil'](_0x2bc910[_0x5a8b6c])){return ami[_0x46a2('0xbd')]({'action':_0x46a2('0xbe'),'channel':_0x2bc910[_0x5a8b6c]['channel']})[_0x46a2('0xbf')](function(_0x4507ec){if(_0x4507ec[_0x46a2('0x4d')]===_0x46a2('0xc0')){setTimeout(function(){if(_0x2bc910[_0x5a8b6c]&&_0x2bc910[_0x5a8b6c]['type']!=='ivr'){_0x2de4dc['updateOriginated'](_0x2de4dc[_0x46a2('0x22')][_0x2bc910[_0x5a8b6c][_0x46a2('0xc1')]]);logger[_0x46a2('0xa6')](_0x46a2('0xc2'),_0x1bc646,_0x5a8b6c,_0x2bc910[_0x5a8b6c]['queue']);delete _0x2bc910[_0x5a8b6c];}if(_0x2bc910[_0x5a8b6c]&&_0x2bc910[_0x5a8b6c][_0x46a2('0x57')]===_0x46a2('0x89')){_0x2de4dc['updateOriginated'](_0x2de4dc[_0x46a2('0x23')][_0x2bc910[_0x5a8b6c][_0x46a2('0xc1')]]);logger[_0x46a2('0xa6')](_0x46a2('0xc3'),_0x1bc646,_0x5a8b6c,_0x2bc910[_0x5a8b6c]['queue']);delete _0x2bc910[_0x5a8b6c];}},0x2328);}});}});}}};Dialer['prototype'][_0x46a2('0xc4')]=function(_0x2e3d9a){return BPromise['resolve']()[_0x46a2('0x44')](cmHopper[_0x46a2('0xc4')](_0x2e3d9a))[_0x46a2('0xbf')](loggerCatch(_0x46a2('0xc5')));};Dialer[_0x46a2('0xbb')]['checkIsBlackList']=function(_0x3fcee1){return BPromise[_0x46a2('0xc6')]()[_0x46a2('0x44')](cmHopperBlack[_0x46a2('0xc7')](_0x3fcee1))[_0x46a2('0xbf')](loggerCatch(_0x46a2('0xc8')));};Dialer['prototype'][_0x46a2('0xc9')]=function(_0x15828f,_0x175566,_0x4aacae){return BPromise[_0x46a2('0xc6')]()[_0x46a2('0x44')](cmHopperAdditionalPhone[_0x46a2('0xc9')](_0x15828f,_0x175566,_0x4aacae))[_0x46a2('0xbf')](loggerCatch(_0x46a2('0xca')));};Dialer['prototype'][_0x46a2('0xcb')]=function(_0x39dadb,_0x7159ea,_0x57f730){return BPromise[_0x46a2('0xc6')]()[_0x46a2('0x44')](cmHopperAdditionalPhone[_0x46a2('0xcb')](_0x39dadb,_0x7159ea,_0x57f730))[_0x46a2('0xbf')](loggerCatch(_0x46a2('0xcc')));};Dialer[_0x46a2('0xbb')]['checkIsBlackListIvr']=function(_0x32e168){return BPromise[_0x46a2('0xc6')]()[_0x46a2('0x44')](cmHopperBlack[_0x46a2('0xcd')](_0x32e168))[_0x46a2('0xbf')](loggerCatch(_0x46a2('0xce')));};Dialer[_0x46a2('0xbb')]['averageHandleTime']=function(_0x5c8702){return BPromise[_0x46a2('0xc6')]()['then'](cmHopperHistory['avgHandleTime'](_0x5c8702))['catch'](loggerCatch(_0x46a2('0xcf')));};Dialer['prototype'][_0x46a2('0xd0')]=function(_0x35a665){return BPromise['resolve']()['then'](cmHopper[_0x46a2('0xd0')](_0x35a665))['catch'](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0x46a2('0xbb')]['unlockContact']=function(_0x5e98eb,_0x3aa8aa,_0x3c86d5){return BPromise[_0x46a2('0xc6')]()[_0x46a2('0x44')](cmHopper['unlockContact'](_0x5e98eb,_0x3aa8aa,_0x3c86d5))[_0x46a2('0xbf')](loggerCatch(_0x46a2('0xd1')));};Dialer[_0x46a2('0xbb')][_0x46a2('0xd2')]=function(_0xb3135b,_0x344803,_0x2f88c4,_0x4b8570,_0x3d6b9f){return BPromise['resolve']()[_0x46a2('0x44')](cmHopper[_0x46a2('0xd2')](_0xb3135b,_0x344803,_0x2f88c4,_0x4b8570))['catch'](function(_0xe75910){_0x3d6b9f[_0x46a2('0xd3')]-=_0x2f88c4;_0x3d6b9f[_0x46a2('0xd3')]=_0x3d6b9f[_0x46a2('0xd3')]>0x0?_0x3d6b9f['temp']:0x0;loggerCatch('[getContactDialer]\x20')(_0xe75910);});};Dialer[_0x46a2('0xbb')][_0x46a2('0xd4')]=function(_0x1b06e7,_0x5ac9fe,_0x22b07f,_0x3f82f4){return BPromise[_0x46a2('0xc6')]()[_0x46a2('0x44')](cmHopper[_0x46a2('0xd4')](_0x1b06e7,_0x5ac9fe,_0x22b07f))['catch'](function(_0x160dea){_0x3f82f4[_0x46a2('0xd3')]-=_0x5ac9fe;_0x3f82f4[_0x46a2('0xd3')]=_0x3f82f4[_0x46a2('0xd3')]>0x0?_0x3f82f4[_0x46a2('0xd3')]:0x0;loggerCatch(_0x46a2('0xd5'))(_0x160dea);});};Dialer[_0x46a2('0xbb')][_0x46a2('0xd6')]=function(_0x201528){return BPromise[_0x46a2('0xc6')]()['then'](voiceQueueRt[_0x46a2('0xd6')](_0x201528))[_0x46a2('0xbf')](loggerCatch(_0x46a2('0xd7')));};Dialer['prototype'][_0x46a2('0xd8')]=function(_0xb6eb7e){return BPromise[_0x46a2('0xc6')]()[_0x46a2('0x44')](cmHopper[_0x46a2('0xd8')](_0xb6eb7e))[_0x46a2('0xbf')](loggerCatch(_0x46a2('0xd9')));};Dialer[_0x46a2('0xbb')][_0x46a2('0xda')]=function(_0x57f70e){return BPromise['resolve']()['then'](cmHopperHistory[_0x46a2('0xda')](_0x57f70e))[_0x46a2('0xbf')](loggerCatch(_0x46a2('0xdb')));};Dialer[_0x46a2('0xbb')]['updateOriginated']=function(_0x5d6a7f){if(!_['isUndefined'](_0x5d6a7f)&&_0x5d6a7f!==null){if(typeof _0x5d6a7f[_0x46a2('0x7f')]!=='undefined'){if(_0x5d6a7f['originated']>0x0){_0x5d6a7f[_0x46a2('0x7f')]-=0x1;}else{logger['error'](_0x46a2('0xdc'));}}}else{logger['error'](_0x46a2('0xdd'));}};Dialer[_0x46a2('0xbb')][_0x46a2('0xde')]=function(_0x3ac2a4,_0x20e45f){var _0x43cc00=this;return function(_0x1bfd64){_0x43cc00['updateOriginated'](_0x20e45f);logger[_0x46a2('0xa6')](_0x3ac2a4,util[_0x46a2('0xa5')](_0x1bfd64,{'showHidden':![],'depth':null}));};};Dialer[_0x46a2('0xbb')]['emptyContact']=function(_0xb091e5,_0x4d848c,_0xb15ab8){var _0x7089f5={'state':0x19,'statedesc':_0x46a2('0xdf')};this[_0x46a2('0xe0')](_0x4d848c);this['saveInDb'](_['merge'](_0x7089f5,_[_0x46a2('0xe1')](_0xb15ab8,['ContactId',_0x46a2('0xe2'),_0x46a2('0xe3'),_0x46a2('0xe4'),_0x46a2('0xe5')])),_0x46a2('0xe6'),_0x46a2('0xe7'));logger[_0x46a2('0xa6')](_0xb091e5);};Dialer[_0x46a2('0xbb')][_0x46a2('0xe8')]=function(_0x18ed3e){return _0x18ed3e===_0x46a2('0xe9');};Dialer[_0x46a2('0xbb')][_0x46a2('0xea')]=function(_0x51b354){return!_[_0x46a2('0x46')](_0x51b354)&&_0x51b354&&!_[_0x46a2('0x46')](_0x51b354['name'])&&!_[_0x46a2('0x46')](_0x51b354[_0x46a2('0x85')])&&_0x51b354[_0x46a2('0x85')]&&(this[_0x46a2('0x25')][util[_0x46a2('0x87')](_0x46a2('0xeb'),_0x51b354[_0x46a2('0x48')])][_0x46a2('0xbe')]===_0x46a2('0xec')||this['trunks'][util['format'](_0x46a2('0xeb'),_0x51b354[_0x46a2('0x48')])][_0x46a2('0xbe')]==='unmonitored');};Dialer[_0x46a2('0xbb')]['saveInDb']=function(_0x30990d,_0x32f4d1,_0x3e3d53){this[_0x46a2('0xda')](_0x30990d)['catch'](loggerCatch(_0x32f4d1));this[_0x46a2('0xd8')](_0x30990d)[_0x46a2('0xbf')](loggerCatch(_0x3e3d53));};Dialer[_0x46a2('0xbb')][_0x46a2('0xed')]=function(_0x5674f8){var _0x356327=this[_0x46a2('0x2a')][_0x5674f8[_0x46a2('0xee')]];var _0x340e11;if(!_['isNil'](_0x5674f8)&&!_[_0x46a2('0xef')](_0x5674f8[_0x46a2('0xf0')])&&!_[_0x46a2('0xef')](_0x5674f8[_0x46a2('0xf0')]['amdstatus'])&&_0x5674f8[_0x46a2('0xf1')]===_0x46a2('0xf2')&&_0x356327){if(_0x356327[_0x46a2('0x57')]!=='ivr'&&this[_0x46a2('0x22')][_0x356327[_0x46a2('0xc1')]][_0x46a2('0xf3')]&&_0x5674f8[_0x46a2('0xf4')]==='HANGUP'){delete this[_0x46a2('0x2a')][_0x5674f8[_0x46a2('0xee')]];this[_0x46a2('0xe0')](this[_0x46a2('0x22')][_0x356327[_0x46a2('0xc1')]]);this[_0x46a2('0x22')][_0x356327['queue']][_0x46a2('0x6a')]+=0x1;this['voiceQueues'][_0x356327[_0x46a2('0xc1')]][_0x46a2('0xf5')]+=0x1;_0x340e11=new Hangup(_0x356327,_0x5674f8);_0x340e11[_0x46a2('0xb6')]=0x12;_0x340e11[_0x46a2('0xb7')]=_0x46a2('0xf6');_0x340e11[_0x46a2('0xf7')]=_0x46a2('0xf8');ami[_0x46a2('0xf9')](_0x46a2('0xfa'),ut[_0x46a2('0xfb')](_0x340e11,_0x46a2('0xfc')));this[_0x46a2('0xfd')](_0x340e11,_0x46a2('0xfe'),'[syncHangupInAMD]');}if(_0x356327[_0x46a2('0x57')]!==_0x46a2('0x89')&&this[_0x46a2('0x22')][_0x356327[_0x46a2('0xc1')]][_0x46a2('0xf3')]&&_0x5674f8[_0x46a2('0xf4')]===_0x46a2('0xff')){var _0x3435ed=this;return new BPromise(function(_0x4e2ed1,_0x380d24){delete _0x3435ed[_0x46a2('0x2a')][_0x5674f8[_0x46a2('0xee')]];_0x3435ed[_0x46a2('0xe0')](_0x3435ed[_0x46a2('0x22')][_0x356327['queue']]);_0x3435ed[_0x46a2('0x22')][_0x356327[_0x46a2('0xc1')]][_0x46a2('0x6a')]+=0x1;_0x3435ed['voiceQueues'][_0x356327[_0x46a2('0xc1')]][_0x46a2('0xf5')]+=0x1;var _0x54429c=_0x3435ed['voiceQueues'][_0x356327[_0x46a2('0xc1')]];var _0xb8385c=new Hangup(_0x356327,_0x5674f8);_0xb8385c[_0x46a2('0xb6')]=0x13;_0xb8385c[_0x46a2('0xb7')]=_0x46a2('0x100');_0xb8385c['membername']=_0x46a2('0xf8');_0xb8385c[_0x46a2('0x101')]+=0x1;_0xb8385c[_0x46a2('0x102')]+=0x1;_0xb8385c[_0x46a2('0xfc')]=!![];ami[_0x46a2('0xf9')](_0x46a2('0xfa'),ut[_0x46a2('0xfb')](_0xb8385c,'amd'));_0x3435ed['createHistory'](_0xb8385c)[_0x46a2('0xbf')](loggerCatch(_0x46a2('0x103')));if(_0xb8385c[_0x46a2('0x104')]+_0xb8385c[_0x46a2('0x105')]+_0xb8385c['countnoanswerretry']+_0xb8385c[_0x46a2('0x106')]+_0xb8385c[_0x46a2('0x107')]+_0xb8385c[_0x46a2('0x108')]+_0xb8385c[_0x46a2('0x101')]+_0xb8385c[_0x46a2('0x109')]>=_0x54429c[_0x46a2('0x10a')]){_0x3435ed[_0x46a2('0x10b')](_0xb8385c,_0x4e2ed1,_0x380d24,_0x46a2('0x10c'));}else{if(_0xb8385c['countmachineretry']>=_0x54429c[_0x46a2('0x10d')]){_0x3435ed['createStateFinal'](_0xb8385c,_0x4e2ed1,_0x380d24,_0x46a2('0x10e'));}else{_0x3435ed[_0x46a2('0xd0')]({'active':![],'countmachineretry':_0xb8385c[_0x46a2('0x101')],'scheduledat':moment()[_0x46a2('0x10f')](_0x54429c[_0x46a2('0x110')],_0x46a2('0x111'))[_0x46a2('0x87')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xb8385c['ContactId'],'ListId':_0xb8385c[_0x46a2('0xe2')],'VoiceQueueId':_0xb8385c['VoiceQueueId']||undefined,'CampaignId':_0xb8385c['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x4e2ed1({'reschedule':0x1});}}});}if(_0x356327[_0x46a2('0x57')]==='ivr'&&this[_0x46a2('0x23')][_0x356327['queue']][_0x46a2('0xf3')]&&_0x5674f8[_0x46a2('0xf4')]===_0x46a2('0x112')){delete this['uniqueId'][_0x5674f8['uniqueid']];this[_0x46a2('0xe0')](this[_0x46a2('0x23')][_0x356327[_0x46a2('0xc1')]]);_0x340e11=new Hangup(_0x356327,_0x5674f8);_0x340e11[_0x46a2('0xb6')]=0x12;_0x340e11['statedesc']='HangupInAMD';_0x340e11['membername']=_0x46a2('0xf8');ami[_0x46a2('0xf9')](_0x46a2('0xfa'),ut[_0x46a2('0xfb')](_0x340e11,_0x46a2('0xfc')));this[_0x46a2('0xfd')](_0x340e11,_0x46a2('0x113'),_0x46a2('0x114'));}if(_0x356327[_0x46a2('0x57')]===_0x46a2('0x89')&&this[_0x46a2('0x23')][_0x356327[_0x46a2('0xc1')]][_0x46a2('0xf3')]&&_0x5674f8[_0x46a2('0xf4')]===_0x46a2('0xff')){var _0x3435ed=this;return new BPromise(function(_0x16bc13,_0x572af2){delete _0x3435ed[_0x46a2('0x2a')][_0x5674f8[_0x46a2('0xee')]];_0x3435ed['updateOriginated'](_0x3435ed[_0x46a2('0x23')][_0x356327['queue']]);_0x3435ed['campaigns'][_0x356327[_0x46a2('0xc1')]][_0x46a2('0x6a')]+=0x1;_0x3435ed['campaigns'][_0x356327['queue']][_0x46a2('0xf5')]+=0x1;var _0x1dde22=_0x3435ed[_0x46a2('0x23')][_0x356327[_0x46a2('0xc1')]];var _0x4c75d4=new Hangup(_0x356327,_0x5674f8);_0x4c75d4[_0x46a2('0xb6')]=0x13;_0x4c75d4['statedesc']=_0x46a2('0x100');_0x4c75d4[_0x46a2('0xf7')]=_0x46a2('0xf8');_0x4c75d4['countmachineretry']+=0x1;_0x4c75d4['countglobal']+=0x1;_0x4c75d4['amd']=!![];ami[_0x46a2('0xf9')](_0x46a2('0xfa'),ut[_0x46a2('0xfb')](_0x4c75d4,_0x46a2('0xfc')));_0x3435ed[_0x46a2('0xda')](_0x4c75d4)[_0x46a2('0xbf')](loggerCatch(_0x46a2('0x103')));if(_0x4c75d4['countbusyretry']+_0x4c75d4[_0x46a2('0x105')]+_0x4c75d4[_0x46a2('0x115')]+_0x4c75d4[_0x46a2('0x106')]+_0x4c75d4[_0x46a2('0x107')]+_0x4c75d4[_0x46a2('0x108')]+_0x4c75d4[_0x46a2('0x101')]+_0x4c75d4[_0x46a2('0x109')]>=_0x1dde22['dialGlobalMaxRetry']){_0x3435ed[_0x46a2('0x10b')](_0x4c75d4,_0x16bc13,_0x572af2,_0x46a2('0x10c'));}else{if(_0x4c75d4[_0x46a2('0x101')]>=_0x1dde22['dialMachineMaxRetry']){_0x3435ed[_0x46a2('0x116')](_0x4c75d4,_0x16bc13,_0x572af2,_0x46a2('0x10e'));}else{_0x3435ed[_0x46a2('0xd0')]({'active':![],'countmachineretry':_0x4c75d4[_0x46a2('0x101')],'scheduledat':moment()[_0x46a2('0x10f')](_0x1dde22[_0x46a2('0x110')],_0x46a2('0x111'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4c75d4[_0x46a2('0x117')],'ListId':_0x4c75d4[_0x46a2('0xe2')],'VoiceQueueId':_0x4c75d4[_0x46a2('0xe4')]||undefined,'CampaignId':_0x4c75d4['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x16bc13({'reschedule':0x1});}}});}}};Dialer['prototype']['syncHangup']=function(_0x30b5ad){var _0x35fff1=this[_0x46a2('0x2a')][_0x30b5ad['uniqueid']];var _0x17c58b=this;var _0x4e4e75;if(_0x35fff1&&_0x35fff1['type']===_0x46a2('0x89')){delete this[_0x46a2('0x2a')][_0x30b5ad['uniqueid']];this[_0x46a2('0xe0')](this[_0x46a2('0x23')][_0x35fff1[_0x46a2('0xc1')]]);this['campaigns'][_0x35fff1[_0x46a2('0xc1')]][_0x46a2('0x118')]+=0x1;_0x4e4e75=new Hangup(_0x35fff1,_0x30b5ad);this['createHistory'](_0x4e4e75)[_0x46a2('0xbf')](loggerCatch(_0x46a2('0x119')));this['moveContactManagedDialer'](_0x4e4e75)[_0x46a2('0xbf')](loggerCatch(_0x46a2('0x11a')));}if(_0x35fff1&&_0x35fff1['type']!==_0x46a2('0x89')&&isNotNull(this[_0x46a2('0x22')][_0x35fff1[_0x46a2('0xc1')]][_0x46a2('0x11b')])){delete this['uniqueId'][_0x30b5ad[_0x46a2('0xee')]];this['updateOriginated'](this[_0x46a2('0x22')][_0x35fff1[_0x46a2('0xc1')]]);this['voiceQueues'][_0x35fff1[_0x46a2('0xc1')]]['outboundAnswerCallsDay']+=0x1;this[_0x46a2('0x22')][_0x35fff1[_0x46a2('0xc1')]][_0x46a2('0xf5')]+=0x1;_0x4e4e75=new Hangup(_0x35fff1,_0x30b5ad);_0x4e4e75[_0x46a2('0xb6')]=0x10;_0x4e4e75[_0x46a2('0xb7')]='AnswerAGI';_0x4e4e75['membername']=_0x46a2('0x11c');this['createHistory'](_0x4e4e75)[_0x46a2('0xbf')](loggerCatch(_0x46a2('0x119')));this[_0x46a2('0xd8')](_0x4e4e75)[_0x46a2('0xbf')](loggerCatch('[syncHangupIvr]'));}if(_0x35fff1&&_0x35fff1['type']!==_0x46a2('0x89')&&!isNotNull(this['voiceQueues'][_0x35fff1[_0x46a2('0xc1')]][_0x46a2('0x11b')])){delete this[_0x46a2('0x2a')][_0x30b5ad[_0x46a2('0xee')]];this['updateOriginated'](this[_0x46a2('0x22')][_0x35fff1['queue']]);this[_0x46a2('0x22')][_0x35fff1['queue']]['outboundUnknownCallsDay']+=0x1;_0x4e4e75=new Hangup(_0x35fff1,_0x30b5ad);_0x4e4e75[_0x46a2('0xb6')]=0xc;_0x4e4e75[_0x46a2('0xb7')]=_0x30b5ad[_0x46a2('0x11d')];_0x4e4e75['membername']=_0x46a2('0x11e');this['createHistory'](_0x4e4e75)[_0x46a2('0xbf')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x46a2('0xd8')](_0x4e4e75)[_0x46a2('0xbf')](loggerCatch(_0x46a2('0x11a')));}};Dialer[_0x46a2('0xbb')]['syncAgentComplete']=function(_0x3446bb){var _0x237579=this[_0x46a2('0x2a')][_0x3446bb[_0x46a2('0xee')]];var _0x174507=this;if(this[_0x46a2('0x22')][_0x3446bb[_0x46a2('0xc1')]]){if(_0x237579&&_0x237579[_0x46a2('0x57')]!==_0x46a2('0x89')){delete this[_0x46a2('0x2a')][_0x3446bb['uniqueid']];this[_0x46a2('0x22')][_0x3446bb['queue']]['outboundAnswerCallsDay']+=0x1;var _0x319fc8=new AgentComplete(_0x237579,_0x3446bb);if(_0x3446bb[_0x46a2('0x11f')]==='agent'){_0x319fc8[_0x46a2('0x120')]=this[_0x46a2('0x22')][_0x3446bb[_0x46a2('0xc1')]][_0x46a2('0x121')]&&this['voiceQueues'][_0x3446bb[_0x46a2('0xc1')]]['dialAgiAfterHangupAgent']?moment()[_0x46a2('0x87')](_0x46a2('0x122')):undefined;}this[_0x46a2('0xda')](_0x319fc8)[_0x46a2('0xbf')](loggerCatch(_0x46a2('0x123')));this[_0x46a2('0xd8')](_0x319fc8)['catch'](loggerCatch(_0x46a2('0x124')));}}};Dialer['prototype']['syncAgentConnect']=function(_0x48c785){if(this[_0x46a2('0x22')][_0x48c785[_0x46a2('0xc1')]]){if(this[_0x46a2('0x2a')][_0x48c785[_0x46a2('0xee')]]&&this[_0x46a2('0x2a')][_0x48c785['uniqueid']]['type']!=='ivr'){this['updateOriginated'](this[_0x46a2('0x22')][_0x48c785[_0x46a2('0xc1')]]);this[_0x46a2('0x2a')][_0x48c785[_0x46a2('0xee')]][_0x46a2('0x125')]=moment()[_0x46a2('0x87')](_0x46a2('0x122'));}}};Dialer[_0x46a2('0xbb')][_0x46a2('0x126')]=function(_0x5d1e88,_0x102f07){this[_0x46a2('0xda')](_0x5d1e88)[_0x46a2('0xbf')](loggerCatch(_0x46a2('0x123')));if(_0x102f07==0x0){this[_0x46a2('0xd8')](_0x5d1e88)[_0x46a2('0xbf')](loggerCatch(_0x46a2('0x127')));}};Dialer[_0x46a2('0xbb')][_0x46a2('0x32')]=function(_0x715fd0){var _0x589c6d=this[_0x46a2('0x2a')][_0x715fd0[_0x46a2('0xee')]];var _0x152a9f=this;var _0xd59e07=![];var _0x345858;var _0x262ab8;if(this['voiceQueues'][_0x715fd0[_0x46a2('0xc1')]]){if(_0x589c6d&&_0x589c6d[_0x46a2('0x57')]!=='ivr'){delete this[_0x46a2('0x2a')][_0x715fd0[_0x46a2('0xee')]];this[_0x46a2('0xe0')](this['voiceQueues'][_0x715fd0[_0x46a2('0xc1')]]);_0x589c6d[_0x46a2('0x128')]=moment()['format'](_0x46a2('0x122'));var _0x2492dd=new QueueCallerAbandon(_0x589c6d,_0x715fd0);if(getSeconds(_0x589c6d[_0x46a2('0x128')],_0x589c6d[_0x46a2('0x129')])>=_0x589c6d[_0x46a2('0x12a')]){this[_0x46a2('0x22')][_0x715fd0[_0x46a2('0xc1')]][_0x46a2('0x79')]+=0x1;this[_0x46a2('0x22')][_0x715fd0[_0x46a2('0xc1')]][_0x46a2('0x70')]+=0x1;this[_0x46a2('0x22')][_0x715fd0[_0x46a2('0xc1')]][_0x46a2('0x7b')]+=0x1;_0x2492dd[_0x46a2('0xb6')]=0xa;_0x2492dd[_0x46a2('0xb7')]=_0x46a2('0x12b');_0x2492dd[_0x46a2('0x12c')]=_0x46a2('0x12d');_0x2492dd[_0x46a2('0x120')]=this[_0x46a2('0x22')][_0x715fd0[_0x46a2('0xc1')]][_0x46a2('0x121')]?moment()[_0x46a2('0x87')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x2492dd[_0x46a2('0x107')]+=0x1;_0x2492dd[_0x46a2('0x102')]+=0x1;_0x345858=this[_0x46a2('0x22')][_0x715fd0['queue']][_0x46a2('0x12e')];_0x262ab8=this['voiceQueues'][_0x715fd0[_0x46a2('0xc1')]][_0x46a2('0x12f')];_0x152a9f[_0x46a2('0xc9')](_0x2492dd,_0x2492dd[_0x46a2('0xb6')],_0x589c6d[_0x46a2('0x130')])[_0x46a2('0x44')](function(_0x3b9642){_0xd59e07=_0x3b9642['additional']==0x1;if(_0x2492dd[_0x46a2('0x107')]>=_0x152a9f['voiceQueues'][_0x715fd0[_0x46a2('0xc1')]][_0x46a2('0x131')]){_0x152a9f[_0x46a2('0x126')](_0x2492dd,_0x3b9642['additional']);}else{_0x152a9f[_0x46a2('0xd0')]({'active':![],'countdropretry':_0x2492dd['countdropretry'],'scheduledat':moment()['add'](_0x152a9f[_0x46a2('0x22')][_0x715fd0[_0x46a2('0xc1')]][_0x46a2('0x12e')],'minutes')[_0x46a2('0x87')](_0x46a2('0x122')),'ContactId':_0x589c6d[_0x46a2('0x117')],'ListId':_0x589c6d[_0x46a2('0xe2')],'VoiceQueueId':_0x589c6d[_0x46a2('0xe4')]||undefined,'CampaignId':_0x589c6d['CampaignId']||undefined})[_0x46a2('0xbf')](loggerCatch(_0x46a2('0x132')));var _0x5ab287=new History(_0x2492dd);_0x5ab287[_0x46a2('0xb6')]=0xa;_0x5ab287['statedesc']=_0x46a2('0x12b');_0x5ab287[_0x46a2('0x133')]=moment()[_0x46a2('0x87')](_0x46a2('0x122'));_0x5ab287[_0x46a2('0xb8')]=_0x5ab287[_0x46a2('0x133')];_0x5ab287[_0x46a2('0x134')]=_0x2492dd['calleridname'];_0x5ab287['calleridnum']=_0x2492dd['calleridnum'];_0x152a9f['createHistory'](_0x5ab287)[_0x46a2('0xbf')](loggerCatch('[syncAgentComplete][createHistory][10]'));}})['then'](function(_0x5c665c){if(_0xd59e07)_0x152a9f[_0x46a2('0xcb')](_0x2492dd,_0x345858,_0x262ab8)[_0x46a2('0x44')](function(_0x438bad){return 0x1;});});}else{this[_0x46a2('0x22')][_0x715fd0[_0x46a2('0xc1')]][_0x46a2('0x135')]+=0x1;this[_0x46a2('0x22')][_0x715fd0[_0x46a2('0xc1')]][_0x46a2('0x6f')]+=0x1;_0x2492dd[_0x46a2('0xb6')]=0xb;_0x2492dd[_0x46a2('0xb7')]=_0x46a2('0x136');_0x2492dd[_0x46a2('0x12c')]='CALLEREXIT';_0x2492dd['countabandonedretry']+=0x1;_0x2492dd[_0x46a2('0x102')]+=0x1;_0x345858=this[_0x46a2('0x22')][_0x715fd0[_0x46a2('0xc1')]][_0x46a2('0x137')];_0x262ab8=this[_0x46a2('0x22')][_0x715fd0['queue']][_0x46a2('0x12f')];_0x152a9f[_0x46a2('0xc9')](_0x2492dd,_0x2492dd[_0x46a2('0xb6')],_0x589c6d[_0x46a2('0x130')])['then'](function(_0x38e20a){if(_0x2492dd[_0x46a2('0x108')]>=_0x152a9f[_0x46a2('0x22')][_0x715fd0[_0x46a2('0xc1')]]['dialAbandonedMaxRetry']){_0x152a9f[_0x46a2('0x126')](_0x2492dd,_0x38e20a[_0x46a2('0x138')]);}else{_0x152a9f['rescheduleContact']({'active':![],'countabandonedretry':_0x2492dd[_0x46a2('0x108')],'scheduledat':moment()[_0x46a2('0x10f')](_0x152a9f[_0x46a2('0x22')][_0x715fd0['queue']][_0x46a2('0x137')],'minutes')[_0x46a2('0x87')](_0x46a2('0x122')),'ContactId':_0x589c6d['ContactId'],'ListId':_0x589c6d[_0x46a2('0xe2')],'VoiceQueueId':_0x589c6d[_0x46a2('0xe4')]||undefined,'CampaignId':_0x589c6d[_0x46a2('0xe5')]||undefined})['catch'](loggerCatch(_0x46a2('0x139')));var _0x4583ed=new History(_0x2492dd);_0x4583ed[_0x46a2('0xb6')]=0xb;_0x4583ed[_0x46a2('0xb7')]=_0x46a2('0x136');_0x4583ed['starttime']=moment()[_0x46a2('0x87')]('YYYY-MM-DD\x20HH:mm:ss');_0x4583ed[_0x46a2('0xb8')]=_0x4583ed[_0x46a2('0x133')];_0x4583ed[_0x46a2('0x134')]=_0x2492dd[_0x46a2('0x134')];_0x4583ed[_0x46a2('0x13a')]=_0x2492dd[_0x46a2('0x13a')];_0x152a9f[_0x46a2('0xda')](_0x4583ed)[_0x46a2('0xbf')](loggerCatch('[syncAgentComplete][createHistory][11]'));}})['then'](function(_0x26b584){if(_0xd59e07)_0x152a9f[_0x46a2('0xcb')](_0x2492dd,_0x345858,_0x262ab8)[_0x46a2('0x44')](function(_0x531372){return 0x1;});});}}}};Dialer[_0x46a2('0xbb')]['syncNewExten']=function(_0xf8596d){if(this[_0x46a2('0x28')][_0xf8596d[_0x46a2('0xee')]]){this[_0x46a2('0x28')][_0xf8596d[_0x46a2('0xee')]]['channel']=_0xf8596d[_0x46a2('0x13b')];}if(this['uniqueId'][_0xf8596d[_0x46a2('0xee')]]){this[_0x46a2('0x2a')][_0xf8596d[_0x46a2('0xee')]]['channel']=_0xf8596d[_0x46a2('0x13b')];}};Dialer[_0x46a2('0xbb')][_0x46a2('0x3f')]=function(_0x4dc3bf){if(strategy[this['voiceQueues'][this[_0x46a2('0x28')][_0x4dc3bf[_0x46a2('0x13c')]][_0x46a2('0xc1')]]['strategy']]===_0x46a2('0x1e')){if(this[_0x46a2('0x28')][_0x4dc3bf[_0x46a2('0x13c')]]&&_[_0x46a2('0xef')](this[_0x46a2('0x28')][_0x4dc3bf[_0x46a2('0x13c')]]['locked'])&&_0x4dc3bf['status']==='1'&&_0x4dc3bf[_0x46a2('0x13d')]==='0'){if(this[_0x46a2('0x24')][_0x4dc3bf[_0x46a2('0x13e')]]){if(!this['agents'][_0x4dc3bf[_0x46a2('0x13e')]]['locked']){this[_0x46a2('0x24')][_0x4dc3bf[_0x46a2('0x13e')]][_0x46a2('0x13f')]=!![];this['actions'][_0x4dc3bf[_0x46a2('0x13c')]][_0x46a2('0x13f')]=!![];this[_0x46a2('0x28')][_0x4dc3bf[_0x46a2('0x13c')]][_0x46a2('0x13e')]=_0x4dc3bf[_0x46a2('0x13e')];}}}}else if((strategy[this[_0x46a2('0x22')][this['actions'][_0x4dc3bf[_0x46a2('0x13c')]]['queue']][_0x46a2('0x59')]]||_0x46a2('0x1d'))===_0x46a2('0x1d')){if(this[_0x46a2('0x28')][_0x4dc3bf['actionid']]){if(this['agents'][_0x4dc3bf[_0x46a2('0x13e')]]){this[_0x46a2('0x28')][_0x4dc3bf[_0x46a2('0x13c')]][_0x46a2('0x13e')]=_0x4dc3bf['stateinterface'];if(_[_0x46a2('0xef')](this[_0x46a2('0x140')][this[_0x46a2('0x28')][_0x4dc3bf[_0x46a2('0x13c')]][_0x46a2('0xc1')]])){this[_0x46a2('0x140')][this[_0x46a2('0x28')][_0x4dc3bf['actionid']][_0x46a2('0xc1')]]=[];}this[_0x46a2('0x140')][this[_0x46a2('0x28')][_0x4dc3bf[_0x46a2('0x13c')]][_0x46a2('0xc1')]]['push'](_[_0x46a2('0x9b')](_[_0x46a2('0xe1')](this[_0x46a2('0x28')][_0x4dc3bf['actionid']],[_0x46a2('0x141'),'stateinterface']),{'status':_0x4dc3bf[_0x46a2('0xbe')],'paused':_0x4dc3bf[_0x46a2('0x13d')]}));}}}};function unlockQueueStatus(_0x579d57,_0x3ed286){setTimeout(function(){if(_[_0x46a2('0x46')](_0x579d57[_0x46a2('0x142')])){loggerBooked['error'](_0x46a2('0x143'),_0x3ed286);}_0x579d57[_0x46a2('0x142')]=!![];loggerBooked['info'](_0x46a2('0x144'),_0x3ed286,JSON[_0x46a2('0x53')](_['pick'](_0x579d57,['name',_0x46a2('0x142')])));},0x1f3);}Dialer[_0x46a2('0xbb')]['syncQueueStatusComplete']=function(_0x38fc70){var _0x35fade=this;var _0x42cd2b=_0x35fade[_0x46a2('0x22')][_0x35fade[_0x46a2('0x28')][_0x38fc70[_0x46a2('0x13c')]]['queue']];if(strategy[this[_0x46a2('0x22')][this[_0x46a2('0x28')][_0x38fc70[_0x46a2('0x13c')]][_0x46a2('0xc1')]][_0x46a2('0x59')]]==='roundrobin'){if(this[_0x46a2('0x28')][_0x38fc70['actionid']]&&this[_0x46a2('0x28')][_0x38fc70[_0x46a2('0x13c')]][_0x46a2('0x13e')]){this[_0x46a2('0xa0')]['run'](this[_0x46a2('0x28')][_0x38fc70['actionid']][_0x46a2('0x141')],this[_0x46a2('0x28')][_0x38fc70['actionid']][_0x46a2('0x13e')])[_0x46a2('0xbf')](function(_0x3cbba9){logger[_0x46a2('0xa6')](_0x46a2('0x145'),util['inspect'](_0x3cbba9,{'showHidden':![],'depth':null}));})['finally'](function(){_0x35fade[_0x46a2('0xe0')](_0x35fade[_0x46a2('0x22')][_0x35fade['actions'][_0x38fc70['actionid']]['queue']]);_0x35fade['agents'][_0x35fade[_0x46a2('0x28')][_0x38fc70['actionid']]['stateinterface']][_0x46a2('0x13f')]=![];delete _0x35fade['actions'][_0x38fc70[_0x46a2('0x13c')]];unlockQueueStatus(_0x42cd2b);});}else{this[_0x46a2('0xe0')](this[_0x46a2('0x22')][this[_0x46a2('0x28')][_0x38fc70['actionid']][_0x46a2('0xc1')]]);this[_0x46a2('0xd0')]({'active':![],'ContactId':this[_0x46a2('0x28')][_0x38fc70[_0x46a2('0x13c')]][_0x46a2('0x117')],'ListId':this[_0x46a2('0x28')][_0x38fc70[_0x46a2('0x13c')]][_0x46a2('0xe2')],'VoiceQueueId':this[_0x46a2('0x28')][_0x38fc70['actionid']][_0x46a2('0xe4')]||undefined,'CampaignId':this[_0x46a2('0x28')][_0x38fc70['actionid']]['CampaignId']||undefined})[_0x46a2('0xbf')](loggerCatch(_0x46a2('0x146')));delete this['actions'][_0x38fc70[_0x46a2('0x13c')]];unlockQueueStatus(_0x42cd2b);}}else if((strategy[this[_0x46a2('0x22')][this[_0x46a2('0x28')][_0x38fc70[_0x46a2('0x13c')]][_0x46a2('0xc1')]][_0x46a2('0x59')]]||_0x46a2('0x1d'))===_0x46a2('0x1d')){var _0x45952f;if(this[_0x46a2('0x28')][_0x38fc70[_0x46a2('0x13c')]]&&!_[_0x46a2('0x51')](this[_0x46a2('0x140')][this[_0x46a2('0x28')][_0x38fc70[_0x46a2('0x13c')]]['queue']])){if(this[_0x46a2('0x2e')][_0x35fade[_0x46a2('0x28')][_0x38fc70[_0x46a2('0x13c')]][_0x46a2('0xc1')]]){this[_0x46a2('0x2e')][_0x35fade[_0x46a2('0x28')][_0x38fc70[_0x46a2('0x13c')]]['queue']]=this[_0x46a2('0x2e')][this[_0x46a2('0x28')][_0x38fc70[_0x46a2('0x13c')]][_0x46a2('0xc1')]]?this[_0x46a2('0x2e')][this[_0x46a2('0x28')][_0x38fc70['actionid']][_0x46a2('0xc1')]]:this[_0x46a2('0x140')][this[_0x46a2('0x28')][_0x38fc70[_0x46a2('0x13c')]][_0x46a2('0xc1')]]?this[_0x46a2('0x140')][this['actions'][_0x38fc70[_0x46a2('0x13c')]]['queue']][_0x46a2('0x147')]||0x0:0x0;}this[_0x46a2('0x140')][this['actions'][_0x38fc70[_0x46a2('0x13c')]][_0x46a2('0xc1')]][_0x46a2('0x147')]=this[_0x46a2('0x2e')][this['actions'][_0x38fc70['actionid']][_0x46a2('0xc1')]];for(var _0x82720c=0x0;_0x82720c=0x0;})[_0x46a2('0xbf')](myreject(_0x19bde8)));}}else{_0x2ef3e0['push'](ami[_0x46a2('0xbd')]({'action':'command','command':util[_0x46a2('0x87')](_0x46a2('0x162'),_0x33285b,!_[_0x46a2('0x46')](config['timezones'][_0x29998c])?_0x29998c:'')})[_0x46a2('0x44')](function(_0x1cade2){return _0x1cade2[_0x46a2('0x163')][_0x46a2('0x160')](_0x46a2('0x161'))>=0x0;})[_0x46a2('0xbf')](myreject(_0x19bde8)));}BPromise[_0x46a2('0x164')](_0x2ef3e0)['then'](function(_0x181be5){var _0x4d6e22=_[_0x46a2('0x165')](_0x181be5);if(_0x4d6e22){return _0x4569cc(_0x4d6e22);}else{_0xc08313[_0x46a2('0x4d')]=_0x24c297?_0x46a2('0x166'):_0x46a2('0x167');return _0x19bde8(msgResponse('[ifTime][promiseAll]',_0x46a2('0x159'),_0x46a2('0x168')+_0x24c297+'\x20'+_0x6de86a+_0x46a2('0x169')+util[_0x46a2('0xa5')](_0x33285b,{'showHidden':![],'depth':null})+_0x46a2('0x16a')+_0x29998c));}})[_0x46a2('0xbf')](function(_0x186d26){return _0x19bde8(msgResponse(_0x46a2('0x158'),_0x46a2('0x159'),JSON[_0x46a2('0x53')](_0x186d26)));});});};Dialer[_0x46a2('0xbb')]['checkDialMethod']=function(_0x561842){var _0x324ab0=this;return function(){switch(_0x561842['dialMethod']){case _0x46a2('0x16b'):freeVariablesPredictive(_0x561842);_0x324ab0['handlePower'](_0x561842,0x1);break;case'power':freeVariablesPredictive(_0x561842);_0x324ab0['handlePower'](_0x561842,_0x561842['dialPowerLevel']);break;case _0x46a2('0x16c'):_0x324ab0[_0x46a2('0x16c')](_0x561842);break;case _0x46a2('0x9'):freeVariablesPredictive(_0x561842);_0x324ab0['handlePower'](_0x561842,0x1);break;default:freeVariablesPredictive(_0x561842);logger[_0x46a2('0xa6')](_0x46a2('0x16d'),_0x561842[_0x46a2('0x48')],_0x46a2('0x16e'));}};};Dialer[_0x46a2('0xbb')][_0x46a2('0x16f')]=function(_0x4283b2){var _0x61ae6b=this;return function(){_0x61ae6b[_0x46a2('0x170')](_0x4283b2);};};Dialer[_0x46a2('0xbb')][_0x46a2('0x37')]=function(_0x2d160c){var _0x3dd4aa=this;if(isNotPreview(_0x2d160c[_0x46a2('0x171')])){if(isVoiceQueueOutbound(_0x2d160c[_0x46a2('0x57')])&&isActive(_0x2d160c[_0x46a2('0x66')])){_0x2d160c[_0x46a2('0xb1')]=!![];BPromise[_0x46a2('0xc6')]()[_0x46a2('0x44')](checkIsLoggedIn(_0x2d160c,_0x2d160c[_0x46a2('0x5c')]))[_0x46a2('0x44')](checkIsActive(_0x2d160c,_0x2d160c['dialActive']))[_0x46a2('0x44')](checkInterval(_0x2d160c))[_0x46a2('0x44')](_0x3dd4aa[_0x46a2('0x153')](_0x2d160c))[_0x46a2('0x44')](_0x3dd4aa[_0x46a2('0x157')](_0x2d160c[_0x46a2('0x172')],_0x2d160c['dialTimezone'],_0x2d160c[_0x46a2('0x48')],_0x2d160c))[_0x46a2('0x44')](_0x3dd4aa[_0x46a2('0x173')](_0x2d160c['Interval'],_0x2d160c[_0x46a2('0x174')],_0x2d160c[_0x46a2('0x48')],_0x2d160c))[_0x46a2('0x44')](_0x3dd4aa[_0x46a2('0x175')](_0x2d160c))[_0x46a2('0xbf')](loggerCatchQueueSummary(_0x46a2('0x176'),_0x2d160c));}else{notSendMessagesQueue(_0x2d160c);}}else{freeVariablesPredictive(_0x2d160c);}};Dialer['prototype']['syncQueueSummaryComplete']=_[_0x46a2('0x177')](function(){var _0x29510e=_[_0x46a2('0x178')](this[_0x46a2('0x22')],function(_0x1c83b6){return _0x1c83b6[_0x46a2('0x179')];});var _0x185055=_[_0x46a2('0x178')](this[_0x46a2('0x24')],function(_0x1e1037){return _0x1e1037[_0x46a2('0x17a')]&&_0x1e1037[_0x46a2('0xbe')]===_0x46a2('0xec');});if(_0x29510e[_0x46a2('0xa8')]>0x0&&_0x185055[_0x46a2('0xa8')]>0x0){return BPromise[_0x46a2('0xc6')]()['then'](cmHopper[_0x46a2('0x17b')](_[_0x46a2('0x17c')](_0x29510e,'id'),previewRecallmeReminderInterval,_[_0x46a2('0x17c')](_0x185055,'id')))['then'](function(_0xf5947c){for(var _0x3e42d2=0x0;_0x3e42d2<_0xf5947c[_0x46a2('0xa8')];_0x3e42d2++){var _0x17f4be=_0xf5947c[_0x3e42d2]['Agent'][_0x46a2('0x48')];if(_0x17f4be)io['to'](util[_0x46a2('0x87')](_0x46a2('0x17d'),_0x17f4be))['emit'](_0x46a2('0x17e'),{'hopper':_0xf5947c[_0x3e42d2]});}})[_0x46a2('0xbf')](function(_0xbe6b36){logger[_0x46a2('0xa6')](_0x46a2('0x17f'),_0xbe6b36);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x46a2('0xbb')]['syncCampaigns']=function(){var _0xc60280=this;var _0x12f9b3;for(var _0x886763 in this[_0x46a2('0x23')]){if(typeof this[_0x46a2('0x23')][_0x886763]!==_0x46a2('0xa9')){_0x12f9b3=this['campaigns'][_0x886763];if(isCampaignIvr(_0x12f9b3[_0x46a2('0x57')])&&isActive(_0x12f9b3[_0x46a2('0x85')])){_0x12f9b3['sendMessageOneNotActive']=!![];BPromise[_0x46a2('0xc6')]()[_0x46a2('0x44')](checkIsActive(_0x12f9b3,_0x12f9b3['active']))['then'](checkInterval(_0x12f9b3))[_0x46a2('0x44')](_0xc60280[_0x46a2('0x153')](_0x12f9b3))['then'](_0xc60280[_0x46a2('0x157')](_0x12f9b3[_0x46a2('0x172')],_0x12f9b3[_0x46a2('0x174')],_0x12f9b3[_0x46a2('0x48')],_0x12f9b3))[_0x46a2('0x44')](_0xc60280['checkIfTimeIntervals'](_0x12f9b3[_0x46a2('0x4c')],_0x12f9b3[_0x46a2('0x174')],_0x12f9b3[_0x46a2('0x48')],_0x12f9b3))[_0x46a2('0x44')](_0xc60280[_0x46a2('0x16f')](_0x12f9b3))['catch'](loggerCatchQueueSummary('[syncCampaigns]',_0x12f9b3));}else{notSendMessagesCampaign(_0x12f9b3);}}}};function getCallerIdRandom(_0x26ce39,_0x53e13d){var _0x6d0be1;var _0x22dc65;var _0x11518a;if(_0x53e13d<=0x0){_0x53e13d=0x1;}_0x6d0be1=new RegExp(_0x46a2('0x180')+_0x53e13d+'}$');_0x22dc65=Math['pow'](0xa,_0x53e13d-0x1);_0x11518a=Math[_0x46a2('0x181')](0xa,_0x53e13d)-0x1;return util[_0x46a2('0x87')]('%s',_['replace'](_0x26ce39,_0x6d0be1,_['random'](_0x22dc65,_0x11518a)));}function extractCalleridName(_0xbb7d0d){var _0x320820=_0xbb7d0d['match'](/"(.*?)"/);return _0x320820?_0x320820[0x1]:_0xbb7d0d;}function extractCalleridNumber(_0x3025b5){var _0x5f16a8=_0x3025b5[_0x46a2('0x182')](/<(.*?)>/);return _0x5f16a8?_0x5f16a8[0x1]:_0x3025b5;}Dialer[_0x46a2('0xbb')]['actionOriginate']=function(_0x31d474,_0x1c1f6c){var _0x5b9849=this;var _0x20a93f=uuid['v4']();this[_0x46a2('0x28')][_0x20a93f]=new Action(_0x31d474,_0x1c1f6c,_0x20a93f);return new BPromise(function(_0x4a05dc,_0x2500ed){if(_[_0x46a2('0x46')](_0x31d474)&&typeof _0x31d474!==_0x46a2('0x183')){return _0x2500ed(msgResponse(_0x46a2('0x184'),_0x46a2('0x159'),_0x46a2('0x185')));}if(_['isUndefined'](_0x1c1f6c[_0x46a2('0x186')])||_0x1c1f6c[_0x46a2('0x186')]===null){return _0x2500ed(msgResponse(_0x46a2('0x184'),_0x46a2('0x159'),'contact\x20is\x20undefine'));}var _0x58e797={'XMD-CALLERID':_0x5b9849[_0x46a2('0x28')][_0x20a93f][_0x46a2('0x187')](),'XMD-AGI':_0x31d474[_0x46a2('0x11b')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x31d474['dialQueueProject']):_0x46a2('0x188'),'XMD-AGIAFTER':_0x31d474[_0x46a2('0x121')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x31d474['dialQueueProject2']):'NONE','XMD-QUEUE':_0x31d474[_0x46a2('0x57')]==='outbound'?util[_0x46a2('0x87')]('\x22%s,%s%s,,,%s\x22',_0x31d474['name'],_0x31d474['dialQueueOptions']||'',_0x31d474[_0x46a2('0x189')]?'c':'',_0x31d474[_0x46a2('0x12a')]||0x3):_0x46a2('0x188'),'XMD-CONTACTID':_0x1c1f6c[_0x46a2('0x117')],'XMD-CDRTYPE':_0x46a2('0x8'),'CALLERID(all)':_0x5b9849['actions'][_0x20a93f][_0x46a2('0x187')](),'XMD-AMD':_0x31d474[_0x46a2('0xf3')]?'ACTIVE':'NONE','XMD-DESTINATION':'xcally-motion-dialer'};if(_0x31d474[_0x46a2('0xf3')]){_0x58e797[_0x46a2('0x18a')]=_0x31d474[_0x46a2('0x18b')]||0x9c4;_0x58e797['XMD-AMDGREETING']=_0x31d474['dialAMDGreeting']||0x5dc;_0x58e797[_0x46a2('0x18c')]=_0x31d474[_0x46a2('0x18d')]||0x320;_0x58e797[_0x46a2('0x18e')]=_0x31d474[_0x46a2('0x18f')]||0x1388;_0x58e797[_0x46a2('0x190')]=_0x31d474[_0x46a2('0x191')]||0x64;_0x58e797['XMD-AMDBETWEENWORDSSILENCE']=_0x31d474[_0x46a2('0x192')]||0x32;_0x58e797[_0x46a2('0x193')]=_0x31d474[_0x46a2('0x194')]||0x3;_0x58e797[_0x46a2('0x195')]=_0x31d474['dialAMDSilenceThreshold']||0x100;_0x58e797[_0x46a2('0x196')]=_0x31d474[_0x46a2('0x197')]||0x1388;}if(_0x31d474[_0x46a2('0x57')]===_0x46a2('0x58')){_0x58e797[_0x46a2('0x198')]=_0x1c1f6c[_0x46a2('0xe4')];}else{_0x58e797['XMD-CAMPAIGNID']=_0x1c1f6c['CampaignId'];}for(var _0x5a1982 in _0x1c1f6c['Contact']){if(typeof _0x1c1f6c[_0x46a2('0x199')][_0x5a1982]!==_0x46a2('0xa9')){if(isNotNull(_0x1c1f6c['Contact'][_0x5a1982])&&_0x5a1982!=='id'&&_0x5a1982!==_0x46a2('0x19a')&&_0x5a1982!=='createdAt'&&_0x5a1982!==_0x46a2('0x19b')){_0x58e797[util[_0x46a2('0x87')](_0x46a2('0x19c'),'XMD-',_[_0x46a2('0x19d')](_0x5a1982))]=_0x1c1f6c[_0x46a2('0x199')][_0x5a1982];}}}var _0x4eadea=_0x5b9849[_0x46a2('0xea')](_0x31d474[_0x46a2('0x84')])?getCallerId(_0x31d474[_0x46a2('0x84')][_0x46a2('0x86')],_0x31d474['dialOriginateCallerIdName'],_0x31d474['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x31d474[_0x46a2('0x19e')],_0x31d474[_0x46a2('0x19f')]):_0x31d474[_0x46a2('0x19e')]):getCallerId(_['isNil'](_0x31d474['TrunkBackup'])?_0x31d474[_0x46a2('0x84')]['callerid']:_0x31d474['TrunkBackup'][_0x46a2('0x86')],_0x31d474['dialOriginateCallerIdName'],_0x31d474[_0x46a2('0x19f')]>0x0?getCallerIdRandom(_0x31d474[_0x46a2('0x19e')],_0x31d474[_0x46a2('0x19f')]):_0x31d474[_0x46a2('0x19e')]);if(_0x4eadea){_0x58e797[_0x46a2('0x1a0')]=_0x5b9849[_0x46a2('0x28')][_0x20a93f][_0x46a2('0x1a1')]=extractCalleridName(_0x4eadea);_0x58e797[_0x46a2('0x1a2')]=_0x1c1f6c[_0x46a2('0x186')];}return ami[_0x46a2('0xbd')]({'actionid':_0x20a93f,'action':_0x46a2('0x184'),'channel':_0x5b9849[_0x46a2('0xea')](_0x31d474[_0x46a2('0x84')])?util[_0x46a2('0x87')](_0x46a2('0x1a3'),_0x31d474[_0x46a2('0x84')]['name'],isNotNull(_0x31d474[_0x46a2('0x69')])?_0x31d474['dialPrefix']['trim']()||'':'',_0x31d474['dialCutDigit']>0x0?_0x1c1f6c[_0x46a2('0x186')][_0x46a2('0x1a4')](_0x31d474[_0x46a2('0x1a5')]):_0x1c1f6c[_0x46a2('0x186')]):util[_0x46a2('0x87')](_0x46a2('0x1a3'),_['isNil'](_0x31d474[_0x46a2('0x154')])?_0x31d474[_0x46a2('0x84')][_0x46a2('0x48')]:_0x31d474['TrunkBackup'][_0x46a2('0x48')],isNotNull(_0x31d474[_0x46a2('0x69')])?_0x31d474[_0x46a2('0x69')][_0x46a2('0x1a6')]()||'':'',_0x31d474[_0x46a2('0x1a5')]>0x0?_0x1c1f6c[_0x46a2('0x186')][_0x46a2('0x1a4')](_0x31d474[_0x46a2('0x1a5')]):_0x1c1f6c[_0x46a2('0x186')]),'callerid':_0x4eadea,'Exten':_0x46a2('0xf2'),'Context':'from-sip','Priority':'1','variable':_0x58e797,'timeout':(_0x31d474['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x20a93f})[_0x46a2('0x44')](function(_0x4f91c7){return _0x4a05dc(_0x4f91c7);})['catch'](function(_0x33d315){_0x31d474['outboundOriginateFailureCallsDay']+=0x1;var _0x4ec583=new History(_0x5b9849[_0x46a2('0x28')][_0x20a93f]);logger[_0x46a2('0xa6')](util[_0x46a2('0x87')](_0x46a2('0x1a7'),JSON[_0x46a2('0x53')](_0x33d315)));_0x4ec583[_0x46a2('0xb6')]=0xe;_0x4ec583[_0x46a2('0xb7')]=_0x46a2('0x1a8');_0x4ec583['starttime']=moment()[_0x46a2('0x87')]('YYYY-MM-DD\x20HH:mm:ss');_0x4ec583[_0x46a2('0xb8')]=_0x4ec583[_0x46a2('0x133')];_0x5b9849[_0x46a2('0xda')](_0x4ec583)[_0x46a2('0xbf')](loggerCatch(_0x46a2('0x1a9')));_0x5b9849['moveContactManagedDialer'](_0x4ec583)[_0x46a2('0xbf')](loggerCatch('[originate][error]'))[_0x46a2('0x20')](function(){delete _0x5b9849[_0x46a2('0x28')][_0x20a93f];return _0x2500ed(msgResponse(_0x46a2('0x184'),'Error',_0x46a2('0x1aa')));});});});};Dialer[_0x46a2('0xbb')][_0x46a2('0x33')]=function(_0x1d362a){var _0x21b93f=this[_0x46a2('0x28')][_0x1d362a['actionid']];if(_0x21b93f){delete this['actions'][_0x1d362a[_0x46a2('0x13c')]];_0x21b93f[_0x46a2('0x129')]=moment()['format'](_0x46a2('0x122'));var _0x474f88=_0x21b93f[_0x46a2('0x57')]===_0x46a2('0x89')?this[_0x46a2('0x23')][_0x21b93f[_0x46a2('0xc1')]]:this[_0x46a2('0x22')][_0x21b93f['getQueue']()];if(!this[_0x46a2('0xe8')](_0x1d362a['response'])){this[_0x46a2('0xe0')](_0x474f88);return this['callProgressDetecting'](_0x21b93f,_0x474f88,_0x1d362a)['catch'](loggerCatch(_0x46a2('0x1ab')));}this[_0x46a2('0x2a')][_0x1d362a['uniqueid']]=_0x21b93f;}};Dialer[_0x46a2('0xbb')][_0x46a2('0x1ac')]=function(_0x2879cf,_0x4501d9,_0xda3a18){var _0x274b71=new History(_0x4501d9);if(_0x274b71['countbusyretry']+_0x274b71[_0x46a2('0x105')]+_0x274b71[_0x46a2('0x115')]+_0x274b71[_0x46a2('0x106')]+_0x274b71['countdropretry']+_0x274b71[_0x46a2('0x108')]+_0x274b71['countmachineretry']+_0x274b71[_0x46a2('0x109')]>=_0xda3a18[_0x46a2('0x10a')]-0x1){return!![];}switch(_0x2879cf){case 0x3:if(_0x274b71[_0x46a2('0x115')]>=_0xda3a18[_0x46a2('0x1ad')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x274b71[_0x46a2('0x115')]+=0x1,'scheduledat':moment()[_0x46a2('0x10f')](_0xda3a18[_0x46a2('0x1ae')],_0x46a2('0x111'))['format'](_0x46a2('0x122')),'ContactId':_0x274b71[_0x46a2('0x117')],'ListId':_0x274b71[_0x46a2('0xe2')],'VoiceQueueId':_0x274b71[_0x46a2('0xe4')]||undefined,'CampaignId':_0x274b71[_0x46a2('0xe5')]||undefined})['catch'](loggerCatch(_0x46a2('0x1af')));break;case 0x5:if(_0x274b71[_0x46a2('0x104')]>=_0xda3a18[_0x46a2('0x1b0')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x274b71[_0x46a2('0x104')]+=0x1,'scheduledat':moment()[_0x46a2('0x10f')](_0xda3a18[_0x46a2('0x1b1')],'minutes')[_0x46a2('0x87')](_0x46a2('0x122')),'ContactId':_0x274b71[_0x46a2('0x117')],'ListId':_0x274b71[_0x46a2('0xe2')],'VoiceQueueId':_0x274b71[_0x46a2('0xe4')]||undefined,'CampaignId':_0x274b71[_0x46a2('0xe5')]||undefined})[_0x46a2('0xbf')](loggerCatch(_0x46a2('0x1b2')));break;case 0x8:if(_0x274b71[_0x46a2('0x105')]>=_0xda3a18['dialCongestionMaxRetry']-0x1){return!![];}this[_0x46a2('0xd0')]({'active':![],'countcongestionretry':_0x274b71[_0x46a2('0x105')]+=0x1,'scheduledat':moment()[_0x46a2('0x10f')](_0xda3a18[_0x46a2('0x1b3')],_0x46a2('0x111'))[_0x46a2('0x87')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x274b71['ContactId'],'ListId':_0x274b71[_0x46a2('0xe2')],'VoiceQueueId':_0x274b71[_0x46a2('0xe4')]||undefined,'CampaignId':_0x274b71[_0x46a2('0xe5')]||undefined})['catch'](loggerCatch(_0x46a2('0x1b4')));break;case 0x0:if(_0x274b71['countnosuchnumberretry']>=_0xda3a18['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0x46a2('0xd0')]({'active':![],'countnosuchnumberretry':_0x274b71['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x46a2('0x10f')](_0xda3a18[_0x46a2('0x1b5')],_0x46a2('0x111'))[_0x46a2('0x87')](_0x46a2('0x122')),'ContactId':_0x274b71['ContactId'],'ListId':_0x274b71[_0x46a2('0xe2')],'VoiceQueueId':_0x274b71[_0x46a2('0xe4')]||undefined,'CampaignId':_0x274b71[_0x46a2('0xe5')]||undefined})[_0x46a2('0xbf')](loggerCatch(_0x46a2('0x1b6')));}break;case 0xa:if(_0x274b71[_0x46a2('0x107')]>=_0xda3a18[_0x46a2('0x131')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x274b71[_0x46a2('0x107')]+=0x1,'scheduledat':moment()[_0x46a2('0x10f')](_0xda3a18[_0x46a2('0x12e')],_0x46a2('0x111'))['format'](_0x46a2('0x122')),'ContactId':_0x274b71['ContactId'],'ListId':_0x274b71[_0x46a2('0xe2')],'VoiceQueueId':_0x274b71[_0x46a2('0xe4')]||undefined,'CampaignId':_0x274b71['CampaignId']||undefined})[_0x46a2('0xbf')](loggerCatch(_0x46a2('0x132')));break;case 0xb:if(_0x274b71[_0x46a2('0x108')]>=_0xda3a18[_0x46a2('0x1b7')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x274b71[_0x46a2('0x108')]+=0x1,'scheduledat':moment()[_0x46a2('0x10f')](_0xda3a18[_0x46a2('0x137')],_0x46a2('0x111'))[_0x46a2('0x87')](_0x46a2('0x122')),'ContactId':_0x274b71['ContactId'],'ListId':_0x274b71[_0x46a2('0xe2')],'VoiceQueueId':_0x274b71[_0x46a2('0xe4')]||undefined,'CampaignId':_0x274b71[_0x46a2('0xe5')]||undefined})[_0x46a2('0xbf')](loggerCatch(_0x46a2('0x139')));break;case 0x13:if(_0x274b71[_0x46a2('0x101')]>=_0xda3a18[_0x46a2('0x10d')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x274b71[_0x46a2('0x101')]+=0x1,'scheduledat':moment()[_0x46a2('0x10f')](_0xda3a18[_0x46a2('0x110')],_0x46a2('0x111'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x274b71[_0x46a2('0x117')],'ListId':_0x274b71['ListId'],'VoiceQueueId':_0x274b71['VoiceQueueId']||undefined,'CampaignId':_0x274b71['CampaignId']||undefined})[_0x46a2('0xbf')](loggerCatch(_0x46a2('0x1b8')));break;case 0x14:if(_0x274b71['countagentrejectretry']>=_0xda3a18[_0x46a2('0x1b9')]-0x1){return!![];}this[_0x46a2('0xd0')]({'active':![],'countagentrejectretry':_0x274b71[_0x46a2('0x109')]+=0x1,'scheduledat':moment()['add'](_0xda3a18[_0x46a2('0x1ba')],_0x46a2('0x111'))[_0x46a2('0x87')](_0x46a2('0x122')),'ContactId':_0x274b71[_0x46a2('0x117')],'ListId':_0x274b71[_0x46a2('0xe2')],'VoiceQueueId':_0x274b71[_0x46a2('0xe4')]||undefined,'CampaignId':_0x274b71['CampaignId']||undefined})['catch'](loggerCatch(_0x46a2('0x1bb')));break;default:return!![];}};Dialer[_0x46a2('0xbb')][_0x46a2('0x1bc')]=function(_0x40910a,_0x28dfca,_0x321eeb){var _0x55af35=this;var _0x50a403=new History(_0x40910a);var _0xcfa236=![];var _0x58f14c;var _0x440362;return new BPromise(function(_0x2d30f1,_0x4b5db6){if(_[_0x46a2('0x46')](_0x28dfca)&&typeof _0x28dfca!=='object'){return _0x4b5db6(msgResponse(_0x46a2('0x1bd'),_0x46a2('0x159'),_0x46a2('0x1be')));}if(_['isUndefined'](_0x321eeb)&&typeof _0x321eeb!==_0x46a2('0x183')){return _0x4b5db6(msgResponse(_0x46a2('0x1bd'),_0x46a2('0x159'),_0x46a2('0x1bf')));}_0x55af35[_0x46a2('0xc9')](_0x50a403,_0x321eeb[_0x46a2('0x11f')],_0x28dfca)[_0x46a2('0x44')](function(_0x1a2731){if(_0x1a2731['additional']==0x1)_0xcfa236=!![];switch(_0x321eeb[_0x46a2('0x11f')]){case'0':_0x28dfca[_0x46a2('0x72')]+=0x1;_0x50a403[_0x46a2('0xb6')]=0x0;_0x50a403[_0x46a2('0xb7')]=_0x46a2('0x1c0');_0x50a403[_0x46a2('0x106')]+=0x1;_0x50a403[_0x46a2('0x102')]+=0x1;ami['emit'](_0x46a2('0x1c1'),ut[_0x46a2('0xfb')](_0x40910a,_0x46a2('0x1c2')));_0x58f14c=_0x28dfca[_0x46a2('0x1b5')];_0x440362=_0x28dfca['callAdditionalPhoneAfterMin'];_0x55af35['createHistory'](_0x50a403)[_0x46a2('0xbf')](loggerCatch(_0x46a2('0x103')));if(_0x55af35[_0x46a2('0x1ac')](0x0,_0x40910a,_0x28dfca)&&!_0xcfa236){if(_0x50a403[_0x46a2('0x106')]>=_0x28dfca[_0x46a2('0x1c3')]){_0x55af35[_0x46a2('0x116')](_0x50a403,_0x2d30f1,_0x4b5db6,_0x46a2('0x1c4'));}else{_0x55af35['stateGlobal'](_0x50a403,_0x2d30f1,_0x4b5db6,_0x46a2('0x1c4'));}}break;case'3':_0x28dfca[_0x46a2('0x71')]+=0x1;_0x50a403[_0x46a2('0xb6')]=0x3;_0x50a403[_0x46a2('0xb7')]=_0x46a2('0x1c5');_0x50a403[_0x46a2('0x115')]+=0x1;_0x50a403[_0x46a2('0x102')]+=0x1;ami[_0x46a2('0xf9')](_0x46a2('0x1c6'),ut[_0x46a2('0xfb')](_0x40910a,_0x46a2('0x1c7')));_0x58f14c=_0x28dfca[_0x46a2('0x1ae')];_0x440362=_0x28dfca[_0x46a2('0x12f')];_0x55af35['createHistory'](_0x50a403)[_0x46a2('0xbf')](loggerCatch(_0x46a2('0x1c8')));if(_0x55af35[_0x46a2('0x1ac')](0x3,_0x40910a,_0x28dfca)&&!_0xcfa236){if(_0x50a403['countnoanswerretry']>=_0x28dfca[_0x46a2('0x1ad')]){_0x55af35['createStateFinal'](_0x50a403,_0x2d30f1,_0x4b5db6,'reason\x203\x20ringing\x20no\x20answer');}else{_0x55af35[_0x46a2('0x10b')](_0x50a403,_0x2d30f1,_0x4b5db6,_0x46a2('0x1c9'));}}break;case'5':_0x28dfca[_0x46a2('0x6c')]+=0x1;_0x50a403['state']=0x5;_0x50a403[_0x46a2('0xb7')]=_0x46a2('0x1ca');_0x50a403[_0x46a2('0x104')]+=0x1;_0x50a403['countglobal']+=0x1;ami[_0x46a2('0xf9')](_0x46a2('0x1cb'),ut[_0x46a2('0xfb')](_0x40910a,_0x46a2('0x1cc')));_0x58f14c=_0x28dfca[_0x46a2('0x1b1')];_0x440362=_0x28dfca[_0x46a2('0x12f')];_0x55af35['createHistory'](_0x50a403)[_0x46a2('0xbf')](loggerCatch(_0x46a2('0x1cd')));if(_0x55af35['checkRetriveMax'](0x5,_0x40910a,_0x28dfca)&&!_0xcfa236){if(_0x50a403[_0x46a2('0x104')]>=_0x28dfca[_0x46a2('0x1b0')]){_0x55af35['createStateFinal'](_0x50a403,_0x2d30f1,_0x4b5db6,_0x46a2('0x1ce'));}else{_0x55af35[_0x46a2('0x10b')](_0x50a403,_0x2d30f1,_0x4b5db6,_0x46a2('0x1ce'));}}break;case'8':_0x28dfca['outboundCongestionCallsDay']+=0x1;_0x50a403[_0x46a2('0xb6')]=0x8;_0x50a403[_0x46a2('0xb7')]=_0x46a2('0x1cf');_0x50a403[_0x46a2('0x105')]+=0x1;_0x50a403[_0x46a2('0x102')]+=0x1;_0x58f14c=_0x28dfca[_0x46a2('0x1b3')];_0x440362=_0x28dfca[_0x46a2('0x12f')];ami[_0x46a2('0xf9')](_0x46a2('0x1d0'),ut[_0x46a2('0xfb')](_0x40910a,'congestion'));_0x55af35[_0x46a2('0xda')](_0x50a403)[_0x46a2('0xbf')](loggerCatch(_0x46a2('0x1d1')));if(_0x55af35[_0x46a2('0x1ac')](0x8,_0x40910a,_0x28dfca)&&!_0xcfa236){if(_0x50a403[_0x46a2('0x105')]>=_0x28dfca['dialCongestionMaxRetry']){_0x55af35[_0x46a2('0x116')](_0x50a403,_0x2d30f1,_0x4b5db6,'reason\x208\x20congestion');}else{_0x55af35[_0x46a2('0x10b')](_0x50a403,_0x2d30f1,_0x4b5db6,_0x46a2('0x1d2'));}}break;case'11':_0x28dfca['outboundAbandonedCallsDay']+=0x1;_0x50a403['state']=0xb;_0x50a403[_0x46a2('0xb7')]=_0x46a2('0x136');_0x50a403[_0x46a2('0x108')]+=0x1;_0x50a403[_0x46a2('0x102')]+=0x1;_0x58f14c=_0x28dfca[_0x46a2('0x137')];_0x440362=_0x28dfca[_0x46a2('0x12f')];_0x55af35['createHistory'](_0x50a403)['catch'](loggerCatch(_0x46a2('0x1d3')));if(_0x55af35[_0x46a2('0x1ac')](0xb,_0x40910a,_0x28dfca)&&!_0xcfa236){if(_0x50a403[_0x46a2('0x108')]>=_0x28dfca[_0x46a2('0x1b7')]){_0x55af35[_0x46a2('0x116')](_0x50a403,_0x2d30f1,_0x4b5db6,'reason\x2011\x20abandoned');}else{_0x55af35['stateGlobal'](_0x50a403,_0x2d30f1,_0x4b5db6,_0x46a2('0x1d4'));}}break;case'20':_0x28dfca['outboundRejectCallsDay']+=0x1;_0x50a403[_0x46a2('0xb6')]=0x14;_0x50a403['statedesc']='AgentReject';_0x50a403['countagentrejectretry']+=0x1;_0x50a403['countglobal']+=0x1;_0x58f14c=_0x28dfca[_0x46a2('0x1ba')];_0x440362=_0x28dfca[_0x46a2('0x12f')];ami['emit'](_0x46a2('0x1d5'),ut['buildObj'](_0x40910a,_0x46a2('0x1d6')));_0x55af35[_0x46a2('0xda')](_0x50a403)['catch'](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x55af35[_0x46a2('0x1ac')](0x14,_0x40910a,_0x28dfca)&&!_0xcfa236){if(_0x50a403['countagentrejectretry']>=_0x28dfca[_0x46a2('0x1b9')]){_0x55af35[_0x46a2('0x116')](_0x50a403,_0x2d30f1,_0x4b5db6,_0x46a2('0x1d7'));}else{_0x55af35['stateGlobal'](_0x50a403,_0x2d30f1,_0x4b5db6,'reason\x2020\x20agentreject');}}break;default:_0x28dfca['outboundUnknownCallsDay']+=0x1;_0x50a403['state']=0xc;_0x50a403['statedesc']=_0x321eeb[_0x46a2('0x11f')];_0x58f14c=_0x28dfca['dialAgentRejectRetryFrequency'];_0x440362=_0x28dfca['callAdditionalPhoneAfterMin'];_0x55af35[_0x46a2('0xda')](_0x50a403)[_0x46a2('0xbf')](loggerCatch(_0x46a2('0x1d8')));if(_0x55af35['checkRetriveMax'](_0x321eeb['reason'],_0x40910a,_0x28dfca)&&!_0xcfa236){if(_0x50a403[_0x46a2('0x104')]+_0x50a403['countcongestionretry']+_0x50a403[_0x46a2('0x115')]+_0x50a403[_0x46a2('0x106')]+_0x50a403[_0x46a2('0x107')]+_0x50a403[_0x46a2('0x108')]+_0x50a403['countmachineretry']+_0x50a403[_0x46a2('0x109')]>=_0x28dfca[_0x46a2('0x10a')]){_0x55af35[_0x46a2('0x10b')](_0x50a403,_0x2d30f1,_0x4b5db6,_0x321eeb[_0x46a2('0x11f')]);}else{_0x55af35[_0x46a2('0x116')](_0x50a403,_0x2d30f1,_0x4b5db6,_0x321eeb[_0x46a2('0x11f')]);}}}})[_0x46a2('0x44')](function(_0x42b5c1){if(_0xcfa236){_0x55af35['swapAdditionalPhones'](_0x50a403,_0x58f14c,_0x440362)[_0x46a2('0x44')](function(_0xf6d147){return _0x2d30f1(0x1);});}});});};Dialer[_0x46a2('0xbb')][_0x46a2('0x10b')]=function(_0x6e675d,_0x477c21,_0x2e0547,_0x2a5fe5){var _0x5d84ed=new Final(_0x6e675d);_0x5d84ed[_0x46a2('0xb6')]=0xf;_0x5d84ed[_0x46a2('0xb7')]=_0x46a2('0x1d9');this[_0x46a2('0x116')](_0x5d84ed,_0x477c21,_0x2e0547,_0x2a5fe5);};Dialer[_0x46a2('0xbb')][_0x46a2('0x116')]=function(_0x2f8d45,_0x4b8622,_0xff0868,_0x3816ad){this[_0x46a2('0xd8')](_0x2f8d45)[_0x46a2('0x44')](function(){return _0x4b8622(msgResponse(_0x46a2('0x1bd'),_0x46a2('0xe9'),_0x3816ad));})[_0x46a2('0xbf')](function(){return _0xff0868(msgResponse(_0x46a2('0x1da'),_0x46a2('0x159'),_0x46a2('0x1db')));});};Dialer[_0x46a2('0xbb')][_0x46a2('0x16c')]=function(_0x3e93fa){var _0x387023=_0x3e93fa['dialPredictiveOptimizationPercentage']/0x64;var _0x21997c=_0x3e93fa[_0x46a2('0x70')]/(_0x3e93fa['outboundDropCallsDayTimeout']+_0x3e93fa['outboundAnswerCallsDay']);var _0x2aa6a7=Math[_0x46a2('0x1dc')](_0x3e93fa[_0x46a2('0x7e')]*(_0x3e93fa['predictiveIntervalMaxThreshold']/0x64));var _0x49a625=Math[_0x46a2('0x1dc')](_0x3e93fa[_0x46a2('0x7e')]*(_0x3e93fa['predictiveIntervalMinThreshold']/0x64));var _0x4d37af=_0x3e93fa['available']+_0x3e93fa[_0x46a2('0x60')];var _0x919d16=Math[_0x46a2('0x1dd')](_0x3e93fa[_0x46a2('0x1de')]*_0x3e93fa[_0x46a2('0x81')]*_0x3e93fa[_0x46a2('0x7c')]*_0x3e93fa[_0x46a2('0x7d')]);if(_[_0x46a2('0x46')](_0x3e93fa['startProgressive'])){if(!_[_0x46a2('0x46')](_0x3e93fa['startPredictive'])){_0x3e93fa[_0x46a2('0x2c')]=undefined;loggerPredictive[_0x46a2('0xa6')]('[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine');}if(!_['isUndefined'](_0x3e93fa[_0x46a2('0x9e')])){loggerPredictive[_0x46a2('0xa6')](_0x46a2('0x1df'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x3e93fa[_0x46a2('0x9e')]);_0x3e93fa[_0x46a2('0x9e')]=undefined;}_0x3e93fa[_0x46a2('0x83')]=moment()[_0x46a2('0x87')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x46a2('0x8c')](_0x3e93fa['name'],_0x46a2('0x1e0'),_0x3e93fa[_0x46a2('0x83')]);this[_0x46a2('0x1e1')](_0x3e93fa,0x1);}else if(ifInterval(_0x3e93fa[_0x46a2('0x1e2')],_0x3e93fa['startProgressive'])){this[_0x46a2('0x1e1')](_0x3e93fa,0x1);loggerPredictiveCalls[_0x46a2('0x8c')](_0x46a2('0x1e3'),_0x3e93fa[_0x46a2('0x83')],_0x3e93fa[_0x46a2('0x48')]);_0x3e93fa[_0x46a2('0x1de')]=0x0;_0x3e93fa[_0x46a2('0x7b')]=0x0;}else if(_0x387023<_0x21997c&&_0x3e93fa['dialPredictiveOptimization']===_0x46a2('0x1e4')){freeVariablesPredictive(_0x3e93fa);loggerPredictive[_0x46a2('0x8c')](_0x46a2('0x1e5'),_0x46a2('0x1e6'),_0x21997c,_0x46a2('0x83'),_0x3e93fa[_0x46a2('0x48')]);}else if(_0x919d16<_0x3e93fa[_0x46a2('0x7b')]&&_0x3e93fa[_0x46a2('0x1e7')]===_0x46a2('0x1e4')){freeVariablesPredictive(_0x3e93fa);loggerPredictive[_0x46a2('0x8c')](_0x46a2('0x1e8'),'Max\x20Drop\x20',_0x919d16,_0x46a2('0x1e9'),_0x3e93fa[_0x46a2('0x7b')],_0x46a2('0x83'),_0x3e93fa[_0x46a2('0x48')]);}else if(!ifInterval(_0x3e93fa[_0x46a2('0x1e2')],_0x3e93fa[_0x46a2('0x83')])&&_[_0x46a2('0x46')](_0x3e93fa[_0x46a2('0x2c')])&&!_['isUndefined'](_0x3e93fa[_0x46a2('0x83')])){_0x3e93fa['startPredictive']=moment()[_0x46a2('0x87')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x46a2('0x8c')](_0x3e93fa[_0x46a2('0x48')],_0x46a2('0x1ea'),_0x3e93fa['startPredictive']);this[_0x46a2('0x1eb')](_0x3e93fa[_0x46a2('0x1e2')])[_0x46a2('0x44')](this['getDataPredictive'](_0x3e93fa))[_0x46a2('0x44')](mergeDataErlangB(_0x3e93fa))['then'](this[_0x46a2('0x1ec')](_0x3e93fa))['catch'](loggerCatchPredictive(_0x46a2('0x1ed'),_0x3e93fa));}else if(!ifInterval(_0x3e93fa[_0x46a2('0x1e2')],_0x3e93fa[_0x46a2('0x2c')])){_0x3e93fa['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x3e93fa[_0x46a2('0x2c')]=moment()[_0x46a2('0x87')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x3e93fa[_0x46a2('0x48')],_0x46a2('0x1ee'),_0x3e93fa[_0x46a2('0x2c')]);clearInterval(_0x3e93fa['handlePredictive']);_0x3e93fa[_0x46a2('0x9e')]=undefined;this[_0x46a2('0x1eb')](_0x3e93fa[_0x46a2('0x1e2')])['then'](this['getDataPredictive'](_0x3e93fa))['then'](mergeDataErlangB(_0x3e93fa))['then'](this['startMethodPredictive'](_0x3e93fa))[_0x46a2('0xbf')](loggerCatchPredictive(_0x46a2('0x1ef'),_0x3e93fa));}else if(_0x3e93fa[_0x46a2('0x7e')]&&_0x4d37af<_0x3e93fa[_0x46a2('0x7e')]-_0x49a625){freeVariablesPredictive(_0x3e93fa);loggerPredictive[_0x46a2('0x8c')](_0x3e93fa[_0x46a2('0x48')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x4d37af,_0x46a2('0x1f0'),_0x3e93fa[_0x46a2('0x7e')],'-',_0x49a625,'=',_0x3e93fa[_0x46a2('0x7e')]-_0x49a625,')');}else if(_0x3e93fa[_0x46a2('0x7e')]&&_0x4d37af>_0x3e93fa[_0x46a2('0x7e')]+_0x2aa6a7){freeVariablesPredictive(_0x3e93fa);loggerPredictive[_0x46a2('0x8c')](_0x3e93fa[_0x46a2('0x48')],_0x46a2('0x1f1'),_0x4d37af,')\x20are\x20more\x20than\x20threshold\x20(',_0x3e93fa['predictiveIntervalAvailable'],'+',_0x2aa6a7,'=',_0x3e93fa['predictiveIntervalAvailable']+_0x2aa6a7,')');}};Dialer[_0x46a2('0xbb')][_0x46a2('0x1f2')]=function(_0x23c84c){var _0x3b2c91=this;return function(_0x463f34){return new BPromise(function(_0x1825f0,_0x43f332){_[_0x46a2('0x9b')](_0x23c84c,_0x463f34[0x0]);if(checkGetDataPredictive(_0x463f34[0x0])){var _0x421555=_0x23c84c['predictiveIntervalAvailable']=_0x23c84c[_0x46a2('0x60')]+_0x23c84c[_0x46a2('0x5b')];var _0x24dd99=_0x23c84c[_0x46a2('0x1e2')]*0x3c;var _0x29e822=_0x463f34[0x0][_0x46a2('0x78')]+_0x463f34[0x0][_0x46a2('0x77')];var _0x2a89d8=(_0x463f34[0x0][_0x46a2('0x76')]+_0x463f34[0x0][_0x46a2('0x79')]+_0x463f34[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x463f34[0x0][_0x46a2('0x8f')];_0x23c84c[_0x46a2('0x7c')]=_0x2a89d8>0x0?_0x2a89d8:0x1;switch(_0x23c84c[_0x46a2('0x1e7')]){case _0x46a2('0x1e4'):var _0x57005c=_0x23c84c['dialPredictiveOptimizationPercentage']/0x64;return _0x3b2c91[_0x46a2('0x1f3')](_0x421555,_0x24dd99,_0x29e822,_0x2a89d8,_0x57005c)['then'](function(_0x51e136){return _0x1825f0(_0x51e136);});case _0x46a2('0x1f4'):var _0x44a601=_0x23c84c[_0x46a2('0x1f5')]/0x64;return _0x3b2c91[_0x46a2('0x1f6')](_0x421555,_0x24dd99,_0x29e822,_0x2a89d8,_0x44a601)[_0x46a2('0x44')](function(_0x139982){return _0x1825f0(_0x139982);});default:return _0x43f332(msgResponse(_0x46a2('0x1f7'),'Failure',_0x46a2('0x1f8')));}}else{return _0x43f332(msgResponse(_0x46a2('0x1f7'),'Failure',_0x46a2('0x1f9')));}});};};Dialer[_0x46a2('0xbb')][_0x46a2('0x1fa')]=function(_0x21dd4a){var _0x356e9c=this;return function(_0x69e7f3){return new BPromise(function(_0x2c9508,_0x2f1165){_[_0x46a2('0x9b')](_0x21dd4a,_0x69e7f3[0x0]);if(checkGetDataPredictive(_0x69e7f3[0x0])){loggerPredictive[_0x46a2('0x8c')](JSON[_0x46a2('0x53')](_0x69e7f3[0x0]));if(_0x21dd4a[_0x46a2('0x1e7')]==='dropRate'){return _0x356e9c[_0x46a2('0xd6')](_0x21dd4a['id'])[_0x46a2('0x44')](function(_0x58456c){var _0x580b59=_0x21dd4a['loggedIn']-_0x58456c[0x0][_0x46a2('0x1fb')];var _0x5cb05d=_0x21dd4a['dialPredictiveInterval']*0x3c;var _0x373fbf=_0x69e7f3[0x0][_0x46a2('0x78')]+_0x69e7f3[0x0]['predictiveIntervalAvgHoldtime'];var _0x1f699f=(_0x69e7f3[0x0][_0x46a2('0x76')]+_0x69e7f3[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x69e7f3[0x0][_0x46a2('0x135')])/_0x69e7f3[0x0][_0x46a2('0x8f')];var _0x5d9867=_0x21dd4a[_0x46a2('0x1f5')]/0x64;_0x21dd4a[_0x46a2('0x1fc')]=_0x58456c[0x0]['outboundQueuePauses']||0x0;_0x21dd4a['predictiveIntervalHitRate']=_0x1f699f>0x0?_0x1f699f:0x1;return _0x356e9c[_0x46a2('0x1f3')](_0x580b59,_0x5cb05d,_0x373fbf,_0x1f699f,_0x5d9867);})[_0x46a2('0x44')](function(_0x1bc908){return _0x2c9508(_0x1bc908);})[_0x46a2('0xbf')](function(_0x337ce0){return _0x2f1165(msgResponse(_0x46a2('0x1fd'),_0x46a2('0x159'),JSON[_0x46a2('0x53')](_0x337ce0)));});}if(_0x21dd4a['dialPredictiveOptimization']===_0x46a2('0x1f4')){return _0x356e9c[_0x46a2('0xd6')](_0x21dd4a['id'])['then'](function(_0xfa1be4){var _0x30e63e=_0x21dd4a[_0x46a2('0x5c')]-_0xfa1be4[0x0][_0x46a2('0x1fb')];var _0x313168=_0x21dd4a[_0x46a2('0x1e2')]*0x3c;var _0x337929=_0x69e7f3[0x0][_0x46a2('0x78')]+_0x69e7f3[0x0][_0x46a2('0x77')];var _0x4bbf58=(_0x69e7f3[0x0][_0x46a2('0x76')]+_0x69e7f3[0x0][_0x46a2('0x79')]+_0x69e7f3[0x0][_0x46a2('0x135')])/_0x69e7f3[0x0]['predictiveIntervalTotalCalls'];var _0x220559=_0x21dd4a[_0x46a2('0x1f5')]/0x64;_0x21dd4a[_0x46a2('0x1fc')]=_0xfa1be4[0x0][_0x46a2('0x1fb')]||0x0;_0x21dd4a[_0x46a2('0x7c')]=_0x4bbf58>0x0?_0x4bbf58:0x1;return _0x356e9c['busyFactor'](_0x30e63e,_0x313168,_0x337929,_0x4bbf58,_0x220559);})[_0x46a2('0x44')](function(_0x3210a0){return _0x2c9508(_0x3210a0);})[_0x46a2('0xbf')](function(_0x541d4e){return _0x2f1165(msgResponse(_0x46a2('0x1fd'),_0x46a2('0x159'),JSON[_0x46a2('0x53')](_0x541d4e)));});}}else{return _0x2f1165(msgResponse('[getDataPredictive]',_0x46a2('0x159'),_0x46a2('0x1f9')));}});};};Dialer['prototype'][_0x46a2('0x1ec')]=function(_0x42d278){var _0x1fb14d=this;return function(){var _0x276e8c=0x0;var _0x4a7aa8=Math[_0x46a2('0x1dd')](_0x42d278['erlangCallToSecond']*0x3e8);if(_0x4a7aa8>0x0){_0x4a7aa8=_0x4a7aa8<0x64?0x64:_0x4a7aa8;loggerPredictive[_0x46a2('0x8c')](_0x42d278[_0x46a2('0x48')],'one\x20call\x20every:',_0x4a7aa8,'milliseconds');_0x42d278[_0x46a2('0x9e')]=setInterval(function(){_0x1fb14d['handlePredictive'](_0x42d278);loggerPredictiveCalls[_0x46a2('0x8c')](_0x46a2('0x1fe'),_0x276e8c+=0x1);},_0x4a7aa8);}else{loggerPredictive[_0x46a2('0x8c')](_0x42d278[_0x46a2('0x48')],_0x46a2('0x1ff'));}};};Dialer[_0x46a2('0xbb')][_0x46a2('0x200')]=function(_0x35ce70,_0x9dfc54){var _0x2e906a=this;return function(_0x47a01a){if(_['isEmpty'](_0x47a01a)){if(_['isNil'](_0x9dfc54[_0x46a2('0xe3')])||!_0x9dfc54['recallme']){if(_0x35ce70[_0x46a2('0x171')]===_0x46a2('0x9')){_0x35ce70[_0x46a2('0x142')]=_[_0x46a2('0x46')](_0x35ce70[_0x46a2('0x142')])?!![]:_0x35ce70[_0x46a2('0x142')];var _0xea7302=uuid['v4']();_0x2e906a[_0x46a2('0x28')][_0xea7302]=new Action(_0x35ce70,_0x9dfc54,_0xea7302);loggerBooked[_0x46a2('0x8c')](_0x46a2('0x201'),_0xea7302,_0x46a2('0x202'),JSON['stringify'](_0x35ce70[_0x46a2('0x142')]),'Queue:\x20',_0x35ce70[_0x46a2('0x48')]);if(_0x35ce70[_0x46a2('0x142')]){_0x35ce70[_0x46a2('0x142')]=![];_0x2e906a[_0x46a2('0x140')][_0x2e906a['actions'][_0xea7302]['queue']]=[];ami[_0x46a2('0xbd')]({'actionid':_0xea7302,'action':_0x46a2('0x203'),'queue':_0x35ce70['name']})[_0x46a2('0xbf')](function(){_0x2e906a['updateOriginated'](_0x35ce70);_0x2e906a[_0x46a2('0xd0')]({'active':![],'ContactId':_0x2e906a[_0x46a2('0x28')][_0xea7302][_0x46a2('0x117')],'ListId':_0x2e906a[_0x46a2('0x28')][_0xea7302][_0x46a2('0xe2')],'VoiceQueueId':_0x2e906a['actions'][_0xea7302][_0x46a2('0xe4')]||undefined,'CampaignId':_0x2e906a[_0x46a2('0x28')][_0xea7302][_0x46a2('0xe5')]||undefined})['catch'](loggerCatch(_0x46a2('0x204')));delete _0x2e906a[_0x46a2('0x28')][_0xea7302];});}else{loggerBooked[_0x46a2('0x8c')](_0x46a2('0x205'),JSON['stringify'](_0x35ce70['queueStatusComplete']),'Queue:\x20',_0x35ce70['name']);_0x2e906a[_0x46a2('0xe0')](_0x35ce70);_0x2e906a[_0x46a2('0xd0')]({'active':![],'ContactId':_0x2e906a['actions'][_0xea7302][_0x46a2('0x117')],'ListId':_0x2e906a['actions'][_0xea7302][_0x46a2('0xe2')],'VoiceQueueId':_0x2e906a['actions'][_0xea7302][_0x46a2('0xe4')]||undefined,'CampaignId':_0x2e906a[_0x46a2('0x28')][_0xea7302][_0x46a2('0xe5')]||undefined})[_0x46a2('0xbf')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x2e906a[_0x46a2('0x28')][_0xea7302];}}else{return _0x2e906a[_0x46a2('0x206')](_0x35ce70,_0x9dfc54);}}else{if(getDiff(_0x9dfc54[_0x46a2('0x207')])<_0x35ce70[_0x46a2('0x208')]*0x3c){if(_0x9dfc54[_0x46a2('0x209')]&&!_0x9dfc54['Agent'][_0x46a2('0x20a')]){_0x2e906a[_0x46a2('0xa0')][_0x46a2('0x14b')](_0x9dfc54['id'])[_0x46a2('0x20')](function(){_0x2e906a[_0x46a2('0xe0')](_0x35ce70);});}else{_0x2e906a[_0x46a2('0x20b')]({'active':![]},_0x9dfc54['id'],0x1)[_0x46a2('0x20')](function(){_0x2e906a['updateOriginated'](_0x35ce70);});}}else{_0x35ce70[_0x46a2('0x20c')]+=0x1;_0x2e906a[_0x46a2('0xe0')](_0x35ce70);if(_0x35ce70[_0x46a2('0x20d')]){_0x2e906a['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x9dfc54['ContactId'],'ListId':_0x9dfc54[_0x46a2('0xe2')],'VoiceQueueId':_0x9dfc54[_0x46a2('0xe4')]||undefined,'CampaignId':_0x9dfc54[_0x46a2('0xe5')]||undefined})[_0x46a2('0xbf')](loggerCatch(_0x46a2('0x20e')));_0x2e906a['createHistory'](createObjHistory(_0x35ce70,_0x9dfc54,'RECALLINQUEUE',0x17,_0x46a2('0x20f')))['catch'](loggerCatch(_0x46a2('0x210')));}else{_0x2e906a['saveInDb'](createObjHistory(_0x35ce70,_0x9dfc54,'RECALLFAILEDTIMEOUT',0x16,'RecallFailedTimeout'),_0x46a2('0x211'),_0x46a2('0x212'));}}}}else{_0x35ce70[_0x46a2('0x6b')]+=0x1;_0x2e906a[_0x46a2('0xfd')](createObjHistory(_0x35ce70,_0x9dfc54,'BLACKLIST',0xd,_0x46a2('0x213')),_0x46a2('0x214'),_0x46a2('0x215'));throw _0x46a2('0x216');}};};Dialer['prototype'][_0x46a2('0x170')]=function(_0x33e55d){var _0x2ffc88=this;var _0x37149f=_0x33e55d[_0x46a2('0x217')]-_0x33e55d[_0x46a2('0x7f')]-_0x33e55d[_0x46a2('0xd3')];emitCampaignSummary(_0x33e55d);if(_0x37149f>0x0){if(_0x37149f>this[_0x46a2('0x26')]){_0x37149f=this[_0x46a2('0x26')];}_0x33e55d[_0x46a2('0xd3')]+=_0x37149f;this['getContactDialerIvr'](_0x33e55d['id'],_0x37149f,_0x33e55d['dialOrderByScheduledAt'],_0x33e55d)[_0x46a2('0x44')](function(_0x2fdcc1){_0x33e55d[_0x46a2('0xd3')]-=_0x37149f;_0x33e55d[_0x46a2('0xd3')]=_0x33e55d[_0x46a2('0xd3')]>0x0?_0x33e55d['temp']:0x0;if(!checkContactEmpty(_0x2fdcc1)){_0x33e55d[_0x46a2('0x4d')]=_0x46a2('0xaf');logger[_0x46a2('0x8c')](_0x46a2('0x218')+_0x33e55d['name']);}else{_0x33e55d[_0x46a2('0x7f')]+=_0x2fdcc1['length'];_0x33e55d[_0x46a2('0x4d')]=_0x46a2('0x219');for(var _0x556297=0x0;_0x556297<_0x2fdcc1[_0x46a2('0xa8')];_0x556297+=0x1){_0x33e55d[_0x46a2('0x21a')]+=0x1;if(_[_0x46a2('0xef')](_0x2fdcc1[_0x556297])||_[_0x46a2('0xef')](_0x2fdcc1[_0x556297][_0x46a2('0x199')])||_[_0x46a2('0xef')](_0x2fdcc1[_0x556297][_0x46a2('0x186')])){_0x2ffc88[_0x46a2('0x21b')]('[actionOriginate]\x20',_0x33e55d,_0x2fdcc1[_0x556297]);}else{_0x2ffc88[_0x46a2('0xcd')](_[_0x46a2('0xe1')](_0x2fdcc1[_0x556297],[_0x46a2('0xe5'),_0x46a2('0x21c')]))[_0x46a2('0x44')](_0x2ffc88[_0x46a2('0x200')](_0x33e55d,_0x2fdcc1[_0x556297]))[_0x46a2('0xbf')](_0x2ffc88['loggerHandler'](_0x46a2('0x21d'),_0x33e55d));}}}})[_0x46a2('0xbf')](loggerGetContactDialer(_0x46a2('0x21e'),_0x33e55d,_0x37149f));}};Dialer[_0x46a2('0xbb')]['handlePower']=function(_0x320a66,_0x3dc8e2){var _0x3ad277=this;var _0x17ac51=[];var _0x210d5b=_0x3dc8e2>=0x1?_0x3dc8e2:0x1;if(_0x320a66[_0x46a2('0x171')]===_0x46a2('0x9')){_0x210d5b=0x1;}var _0x225ea7=Math[_0x46a2('0x1dd')](_0x320a66[_0x46a2('0x5b')]*_0x210d5b)-_0x320a66[_0x46a2('0x7f')]-_0x320a66[_0x46a2('0xd3')];emitVoiceQueueSummary(_0x320a66);if(_0x320a66[_0x46a2('0x21f')]>0x0){var _0x57ae97=_0x320a66[_0x46a2('0x21f')]-_0x320a66[_0x46a2('0x7f')]-_0x320a66['talking']-_0x320a66[_0x46a2('0xd3')]-_0x320a66['pTalking'];if(_0x225ea7>_0x57ae97){_0x225ea7=_0x57ae97;}}if(_0x225ea7>0x0){if(_0x320a66[_0x46a2('0x171')]===_0x46a2('0x9')){_0x225ea7=0x1;}if(_0x225ea7>this[_0x46a2('0x26')]){_0x225ea7=this['maxNumberOriginate'];}_0x320a66[_0x46a2('0xd3')]+=_0x225ea7;for(var _0x77a334 in this['agents']){if(typeof this['agents'][_0x77a334]!==_0x46a2('0xa9')){if(this[_0x46a2('0x24')][_0x77a334][_0x46a2('0xb6')]==='not_inuse'&&this[_0x46a2('0x24')][_0x77a334][_0x46a2('0xbe')]===_0x46a2('0xec')){_0x17ac51[_0x46a2('0x15e')](this[_0x46a2('0x24')][_0x77a334]['id']);}}}this['getContactDialer'](_0x320a66['id'],_0x17ac51,_0x225ea7,_0x320a66[_0x46a2('0x220')],_0x320a66)[_0x46a2('0x44')](function(_0x418fe5){_0x320a66[_0x46a2('0xd3')]-=_0x225ea7;_0x320a66[_0x46a2('0xd3')]=_0x320a66['temp']>0x0?_0x320a66['temp']:0x0;if(!checkContactEmpty(_0x418fe5)){_0x3ad277['countReScheduled'](_0x320a66)[_0x46a2('0x44')](sendMessageReschedule(_0x320a66))['catch'](loggerCatch(_0x46a2('0xc5')));}else{_0x320a66[_0x46a2('0x7f')]+=_0x418fe5['length'];_0x320a66[_0x46a2('0x4d')]=_0x320a66['dialMethod']===_0x46a2('0x9')?_0x46a2('0x221'):_0x46a2('0x219');for(var _0x1e5969=0x0;_0x1e5969<_0x418fe5[_0x46a2('0xa8')];_0x1e5969+=0x1){if(_['isNil'](_0x418fe5[_0x1e5969])||_[_0x46a2('0xef')](_0x418fe5[_0x1e5969][_0x46a2('0x199')])||_[_0x46a2('0xef')](_0x418fe5[_0x1e5969][_0x46a2('0x186')])){_0x3ad277[_0x46a2('0x21b')]('[actionOriginate]\x20',_0x320a66,_0x418fe5[_0x1e5969]);}else{_0x3ad277['checkIsBlackList'](_[_0x46a2('0xe1')](_0x418fe5[_0x1e5969],[_0x46a2('0xe4'),_0x46a2('0x21c')]))[_0x46a2('0x44')](_0x3ad277[_0x46a2('0x200')](_0x320a66,_0x418fe5[_0x1e5969]))[_0x46a2('0xbf')](_0x3ad277['loggerHandler'](_0x46a2('0x222'),_0x320a66));}}}})['catch'](loggerGetContactDialer(_0x46a2('0x223'),_0x320a66,_0x225ea7));}};Dialer[_0x46a2('0xbb')][_0x46a2('0x9e')]=function(_0x5cace8){if(_0x5cace8[_0x46a2('0x21f')]>0x0){var _0x2dd383=_0x5cace8[_0x46a2('0x21f')]-_0x5cace8['originated']-_0x5cace8[_0x46a2('0x60')];if(_0x2dd383>0x0){this[_0x46a2('0x224')](_0x5cace8);}else{loggerPredictiveCalls[_0x46a2('0x8c')]('[handlePredictive][limitChannel]');}}else{this[_0x46a2('0x224')](_0x5cace8);}};Dialer[_0x46a2('0xbb')][_0x46a2('0x224')]=function(_0x1f8146){var _0x42a043=this;var _0x466d9c=[];_0x1f8146['originated']+=0x1;for(var _0x5a7dc1 in this[_0x46a2('0x24')]){if(typeof this[_0x46a2('0x24')][_0x5a7dc1]!=='undefined'){if(this['agents'][_0x5a7dc1][_0x46a2('0xb6')]==='not_inuse'&&this[_0x46a2('0x24')][_0x5a7dc1][_0x46a2('0xbe')]===_0x46a2('0xec')){_0x466d9c['push'](this[_0x46a2('0x24')][_0x5a7dc1]['id']);}}}this[_0x46a2('0xd2')](_0x1f8146['id'],_0x466d9c,0x1,_0x1f8146[_0x46a2('0x220')],_0x1f8146)['then'](function(_0x2f5144){if(!checkContactEmpty(_0x2f5144)){checkContactLowerLimitOriginate(_0x1f8146,0x1,0x0);_0x42a043[_0x46a2('0xc4')](_0x1f8146)[_0x46a2('0x44')](sendMessageReschedule(_0x1f8146))[_0x46a2('0xbf')](loggerCatch(_0x46a2('0xc5')));}else{_0x1f8146[_0x46a2('0x4d')]=_0x46a2('0x219');if(_[_0x46a2('0xef')](_0x2f5144[0x0])||_['isNil'](_0x2f5144[0x0][_0x46a2('0x199')])||_[_0x46a2('0xef')](_0x2f5144[0x0]['phone'])){_0x42a043[_0x46a2('0x21b')](_0x46a2('0x222'),_0x1f8146,_0x2f5144[0x0]);}else{_0x42a043[_0x46a2('0xc7')](_['pick'](_0x2f5144[0x0],[_0x46a2('0xe4'),_0x46a2('0x21c')]))[_0x46a2('0x44')](_0x42a043[_0x46a2('0x200')](_0x1f8146,_0x2f5144[0x0]))[_0x46a2('0xbf')](_0x42a043[_0x46a2('0xde')]('[actionOriginatePredictive]\x20',_0x1f8146));}}})[_0x46a2('0xbf')](loggerGetContactDialer(_0x46a2('0x225'),_0x1f8146,0x1));emitVoiceQueueSummary(_0x1f8146);};Dialer[_0x46a2('0xbb')]['abandonmentRate']=function(_0xd1c187,_0x479545,_0x1083c0,_0x4f63b2,_0xcb855f,_0x6b4745){loggerPredictive[_0x46a2('0x8c')](_0x46a2('0x226'));loggerPredictive[_0x46a2('0x8c')]('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',_0xd1c187);loggerPredictive[_0x46a2('0x8c')](_0x46a2('0x227'),_0x479545);loggerPredictive[_0x46a2('0x8c')](_0x46a2('0x228'),_0x1083c0);loggerPredictive['info'](_0x46a2('0x229'),_0x4f63b2);loggerPredictive[_0x46a2('0x8c')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xcb855f);loggerPredictive[_0x46a2('0x8c')]('---------------------------');return new BPromise(function(_0x1fee78,_0x2682c5){if(_0xd1c187<=0x0||isNaN(_0xd1c187)){return _0x2682c5(msgResponse(_0x46a2('0x22a'),_0x46a2('0x22b'),_0x46a2('0x22c')+_0xd1c187));}if(_0x1083c0<=0x0||isNaN(_0x1083c0)){return _0x2682c5(msgResponse(_0x46a2('0x22a'),_0x46a2('0x22b'),_0x46a2('0x22d')+_0x1083c0));}if(_0x4f63b2<=0x0||isNaN(_0x4f63b2)){return _0x2682c5(msgResponse(_0x46a2('0x22a'),'Error',_0x46a2('0x22e')+_0x4f63b2));}if(_0x479545<=0x0||isNaN(_0x479545)){return _0x2682c5(msgResponse(_0x46a2('0x22a'),_0x46a2('0x22b'),_0x46a2('0x22f')+_0x479545));}if(_0xcb855f<=0x0||isNaN(_0xcb855f)){return _0x2682c5(msgResponse(_0x46a2('0x22a'),'Error','Amax\x20=\x20'+_0xcb855f));}_0x6b4745=_0x6b4745||0x0;var _0x279136=0x1/_0x1083c0;var _0x3fa1ef=0x0;var _0x6494d0=0x0;var _0x4fd559=0x0;var _0x1edd6e=0x0;for(var _0x39d8a6=0x0;_0x4fd559<_0xcb855f;_0x39d8a6+=0x1){_0x6494d0=_0x39d8a6/_0x479545;_0x3fa1ef=(_0x4f63b2*_0x6494d0+_0x6b4745)/_0x279136;_0x4fd559=erlangb(_0x3fa1ef,_0xd1c187);_0x1edd6e=_0x3fa1ef/_0xd1c187*(0x1-erlangb(_0x3fa1ef,_0xd1c187));}return _0x1fee78({'erlangCalls':_0x39d8a6,'erlangCallToSecond':_0x479545/_0x39d8a6,'erlangAbandonmentRate':_0x4fd559,'erlangBusyFactor':_0x1edd6e});});};Dialer['prototype'][_0x46a2('0x1f6')]=function(_0x4cbcd2,_0x5231f3,_0x3c5a88,_0x237639,_0x1ffd46,_0x421754){loggerPredictive['info'](_0x46a2('0x230'));loggerPredictive['info']('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4cbcd2);loggerPredictive[_0x46a2('0x8c')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5231f3);loggerPredictive['info'](_0x46a2('0x228'),_0x3c5a88);loggerPredictive[_0x46a2('0x8c')](_0x46a2('0x229'),_0x237639);loggerPredictive[_0x46a2('0x8c')](_0x46a2('0x231'),_0x1ffd46);loggerPredictive[_0x46a2('0x8c')](_0x46a2('0x232'));return new BPromise(function(_0x3883c5,_0x262f0a){if(_0x4cbcd2<=0x0||isNaN(_0x4cbcd2)){return _0x262f0a(msgResponse(_0x46a2('0x233'),_0x46a2('0x22b'),_0x46a2('0x22c')+_0x4cbcd2));}if(_0x3c5a88<=0x0||isNaN(_0x3c5a88)){return _0x262f0a(msgResponse(_0x46a2('0x233'),'Error',_0x46a2('0x22d')+_0x3c5a88));}if(_0x237639<=0x0||isNaN(_0x237639)){return _0x262f0a(msgResponse('[busyFactor]','Error','p\x20=\x20'+_0x237639));}if(_0x5231f3<=0x0||isNaN(_0x5231f3)){return _0x262f0a(msgResponse(_0x46a2('0x233'),_0x46a2('0x22b'),_0x46a2('0x22f')+_0x5231f3));}if(_0x1ffd46<=0x0||isNaN(_0x1ffd46)){return _0x262f0a(msgResponse(_0x46a2('0x233'),_0x46a2('0x22b'),_0x46a2('0x234')+_0x1ffd46));}_0x421754=_0x421754||0x0;var _0x25aff7=0x1/_0x3c5a88;var _0xd30b21=0x0;var _0x5b285b=0x0;var _0x2725ea=0x0;var _0x4085cd=0x0;for(var _0x4a82f9=0x0;_0x4085cd<_0x1ffd46;_0x4a82f9+=0x1){_0x5b285b=_0x4a82f9/_0x5231f3;_0xd30b21=(_0x237639*_0x5b285b+_0x421754)/_0x25aff7;_0x2725ea=erlangb(_0xd30b21,_0x4cbcd2);_0x4085cd=_0xd30b21/_0x4cbcd2*(0x1-erlangb(_0xd30b21,_0x4cbcd2));}return _0x3883c5({'erlangCalls':_0x4a82f9,'erlangCallToSecond':_0x5231f3/_0x4a82f9,'erlangAbandonmentRate':_0x2725ea,'erlangBusyFactor':_0x4085cd});});};module[_0x46a2('0x235')]=Dialer; \ No newline at end of file +var _0x9c44=['status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','countReScheduled','[countReScheduled]\x20','checkIsBlackList','resolve','then','[checkIsBlackList]\x20','[swapAdditionalPhone]\x20','averageHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','pick','ContactId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','isTrunkReachable','SIP/%s','reachable','unmonitored','saveInDb','uniqueid','variable','amdstatus','exten','dialAMDActive','value','statedesc','HangupInAMD','membername','AMD','buildObj','amd','[syncHangupInAMD]','MACHINE','countglobal','custom:amd','[syncAgentComplete][createHistory][0]','countcongestionretry','countdropretry','countabandonedretry','countmachineretry','dialGlobalMaxRetry','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','HANGUP','[syncHangupInAMDIvr]','Machine','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','stateGlobal','ListId','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','AGI','dialQueueProject','outboundUnknownCallsDay','cause-txt','Unknow','syncAgentComplete','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','Drop','dropreason','TIMEOUT','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','additional','dialDropMaxRetry','add','[rescheduleContact][Drop]','endtime','calleridname','swapAdditionalPhones','Abandoned','CALLEREXIT','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','calleridnum','[syncAgentComplete][createHistory][11]','actionid','paused','stateinterface','locked','queueBooked','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','[booked][RR][finaly]','Agent:\x20','[booked][unlock]','[unlock2][syncQueueStatusComplete]','resetActiveCalls','syncCampaigns','TRUNK_IS_NOT_REACHABLE','ifTime','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','Failure','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','push','command','iftime\x20%s,%s','interval','content','indexOf','true','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','method\x20not\x20recognized','launchHandleIvr','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','[syncQueueSummary]','syncQueueSummaryComplete','throttle','dialPreviewRecallmeReminder','filter','map','Agent','user:%s','user:dialPreviewRecallReminder','checkIfTime','[syncCampaigns]','pow','random','match','actionOriginate','object','voiceQueue\x20is\x20undefine','phone','originate','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueTimeout','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','Contact','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','TrunkBackup','callerid','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','[originateError]:\x20%s','[originate][error]','originate\x20action\x20Error','syncOriginateResponse','response','[callProgressDetecting]\x20','checkRetriveMax','countbusyretry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][AgentReject]','callProgressDetecting','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','dialNoAnswerRetryFrequency','reason\x203\x20ringing\x20no\x20answer','Busy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','dialAgentRejectRetryFrequency','agentreject','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','[callProgressDetecting]','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','handlePredictive','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','Max\x20Drop\x20','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','voicePause','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','handleIvr','limitCalls','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','Contact.phone','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','p\x20=\x20','Amax\x20=\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Ts\x20=\x20','interval\x20=\x20','Umin\x20=\x20','exports','bluebird','uuid','moment','md5','ioredis','../preview/util/util','dialer','booked','../../../config/logger','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','socket.io-emitter','../rpc/cmHopperHistory','../rpc/cmHopperFinal','../rpc/voiceQueueRt','../rpc/setting','./history','./final','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','queueBookedRR','bind','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','custom:queuesummary','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','previewRecallmeReminderInterval','isUndefined','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','message','NOT_ACTIVE','\x20NOT\x20Active','INTERVAL_IS_NULL','Intervals','\x20INTERVAL_IS_NULL','isEmpty','Interval','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangAbandonmentRate','startProgressive','Trunk','active','format','voice:queue:%s','voice_queue:save','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','Answered\x20Calls:\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','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','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','erlangBusyFactor','merge','clearing\x20variable\x20start\x20predictive','clearing\x20variable\x20handle\x20predictive','preview','ivr','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','debug','inspect','error','stack','length','undefined','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','state','starttime','clearZombieChannels','[actions]','enqueue','isNil','Action'];(function(_0x2e9d2c,_0x2e97ad){var _0x233caa=function(_0x44a814){while(--_0x44a814){_0x2e9d2c['push'](_0x2e9d2c['shift']());}};_0x233caa(++_0x2e97ad);}(_0x9c44,0x178));var _0x49c4=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x9c44[_0x1969a7];return _0x3d665f;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0x49c4('0x0'));var uuid=require(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var rr=require('rr');var md5=require(_0x49c4('0x3'));var Redis=require(_0x49c4('0x4'));var ut=require(_0x49c4('0x5'));var config=require('../../../config/environment/');var logger=require('../../../config/logger')(_0x49c4('0x6'));var loggerBooked=require('../../../config/logger')(_0x49c4('0x7'));var loggerPredictive=require(_0x49c4('0x8'))(_0x49c4('0x9'));var loggerPredictiveCalls=require(_0x49c4('0x8'))(_0x49c4('0xa'));var loggerSyncQueueSummary=require('../../../config/logger')(_0x49c4('0xb'));var ami=require(_0x49c4('0xc'));config[_0x49c4('0xd')]=_[_0x49c4('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x49c4('0xf'))(new Redis(config[_0x49c4('0xd')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x49c4('0x10'));var cmHopperFinal=require(_0x49c4('0x11'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x49c4('0x12'));var RpcSetting=require(_0x49c4('0x13'));var Action=require('./action');var History=require(_0x49c4('0x14'));var Final=require(_0x49c4('0x15'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0x49c4('0x16'));var Hangup=require(_0x49c4('0x17'));var ipAgi=process[_0x49c4('0x18')][_0x49c4('0x19')]||_0x49c4('0x1a');var strategy={'rrmemory':_0x49c4('0x1b'),'roundrobin':_0x49c4('0x1c')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x49c4('0x1d')]['enqueue']=function(_0x3acd06){this[_0x49c4('0x1e')]=this[_0x49c4('0x1e')]?this[_0x49c4('0x1e')][_0x49c4('0x1f')](_0x3acd06):_0x3acd06();};function Dialer(_0x53e3a2,_0x44e607){this[_0x49c4('0x20')]=new Sequence();this['preview']=_0x44e607;this['voiceQueues']=_0x53e3a2[_0x49c4('0x21')];this[_0x49c4('0x22')]=_0x53e3a2[_0x49c4('0x22')];this['agents']=_0x53e3a2[_0x49c4('0x23')];this['trunks']=_0x53e3a2[_0x49c4('0x24')];this[_0x49c4('0x25')]=config[_0x49c4('0x25')]||0x2;this[_0x49c4('0x26')]={};this[_0x49c4('0x27')]={};this[_0x49c4('0x28')]={};this[_0x49c4('0x29')]={};this[_0x49c4('0x2a')]={};this[_0x49c4('0x2b')]={};this['startProgressive']={};this['ivrOriginated']={};this['queueBooked']={};this[_0x49c4('0x2c')]={};ami['on']('agentconnect',this['syncAgentConnect'][_0x49c4('0x2d')](this));ami['on'](_0x49c4('0x2e'),this[_0x49c4('0x2f')][_0x49c4('0x2d')](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0x49c4('0x2d')](this));ami['on'](_0x49c4('0x30'),this['syncAgentComplete'][_0x49c4('0x2d')](this));ami['on'](_0x49c4('0x31'),this[_0x49c4('0xb')][_0x49c4('0x2d')](this));ami['on']('custom:queuesummarycomplete',this['syncQueueSummaryComplete'][_0x49c4('0x2d')](this));ami['on']('hangup',this[_0x49c4('0x32')][_0x49c4('0x2d')](this));ami['on'](_0x49c4('0x33'),this[_0x49c4('0x34')]['bind'](this));ami['on'](_0x49c4('0x35'),this[_0x49c4('0x36')][_0x49c4('0x2d')](this));ami['on'](_0x49c4('0x37'),this[_0x49c4('0x38')][_0x49c4('0x2d')](this));ami['on'](_0x49c4('0x39'),this[_0x49c4('0x3a')][_0x49c4('0x2d')](this));this[_0x49c4('0x3b')]();this[_0x49c4('0x3c')]();RpcSetting['getSettings']()['then'](function(_0x59eb84){previewRecallmeReminderInterval=_0x59eb84[_0x49c4('0x3d')];});}function isNotNull(_0x7ee704){return _0x7ee704!==null&&!_[_0x49c4('0x3e')](_0x7ee704);}function checkIsLoggedIn(_0x27e467,_0x28eb47){return function(){if(_0x28eb47<=0x0){_0x27e467['message']=_0x49c4('0x3f');throw _0x27e467[_0x49c4('0x40')]+_0x49c4('0x41');}};}function isActive(_0x24bba9){return _0x24bba9;}function checkIsActive(_0x58e252,_0x57a29c){return function(){if(!isActive(_0x57a29c)){_0x58e252[_0x49c4('0x42')]=_0x49c4('0x43');throw _0x58e252[_0x49c4('0x40')]+_0x49c4('0x44');}};}function checkInterval(_0xd38540){return function(){if(!isNotNull(_0xd38540['Interval'])){_0xd38540[_0x49c4('0x42')]=_0x49c4('0x45');throw _0xd38540[_0x49c4('0x40')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0xd38540['Interval'][_0x49c4('0x46')])){_0xd38540[_0x49c4('0x42')]=_0x49c4('0x45');throw _0xd38540[_0x49c4('0x40')]+_0x49c4('0x47');}if(!isNotNull(_[_0x49c4('0x48')](_0xd38540[_0x49c4('0x49')][_0x49c4('0x46')]))){_0xd38540[_0x49c4('0x42')]='INTERVAL_IS_NULL';throw _0xd38540[_0x49c4('0x40')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0xdda586,_0x349791,_0x2625a6){return{'action':_0xdda586,'response':_0x349791,'message':_0x2625a6,'stack':_0x2625a6};}function myreject(_0x1c2830){return function(_0x4ed4f8){return _0x1c2830(msgResponse(_0x49c4('0x4a'),_0x49c4('0x4b'),JSON[_0x49c4('0x4c')](_0x4ed4f8)));};}function getSeconds(_0x4e913a,_0x3b4feb){var _0x21d8c7=moment(_0x4e913a)[_0x49c4('0x4d')](0x0);var _0x5e5366=moment(_0x3b4feb)[_0x49c4('0x4d')](0x0);return _0x21d8c7[_0x49c4('0x4e')](_0x5e5366,_0x49c4('0x4f'));}function emit(_0x2ba76a,_0x70e552,_0x2f1105){io['to'](_0x2ba76a)[_0x49c4('0x50')](_0x70e552,_0x2f1105);}function emitVoiceQueueSummary(_0x4e0663){if(_0x4e0663[_0x49c4('0x51')]===_0x49c4('0x52')){var _0x32b172={'id':_0x4e0663['id'],'name':_0x4e0663[_0x49c4('0x40')],'strategy':_0x4e0663[_0x49c4('0x53')],'answered':_0x4e0663[_0x49c4('0x54')],'available':_0x4e0663[_0x49c4('0x55')],'loggedIn':_0x4e0663[_0x49c4('0x56')],'pTalking':_0x4e0663[_0x49c4('0x57')],'sumBillable':_0x4e0663[_0x49c4('0x58')],'sumDuration':_0x4e0663[_0x49c4('0x59')],'sumHoldTime':_0x4e0663[_0x49c4('0x5a')]||0x0,'talking':_0x4e0663[_0x49c4('0x5b')],'total':_0x4e0663['total'],'type':_0x4e0663[_0x49c4('0x51')],'unmanaged':_0x4e0663['unmanaged'],'abandoned':_0x4e0663[_0x49c4('0x5c')],'waiting':_0x4e0663[_0x49c4('0x5d')],'loggedInDb':_0x4e0663[_0x49c4('0x5e')],'dialActive':_0x4e0663[_0x49c4('0x5f')],'dialMethod':_0x4e0663[_0x49c4('0x60')],'dialOriginateCallerIdName':_0x4e0663[_0x49c4('0x61')],'dialOriginateCallerIdNumber':_0x4e0663['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x4e0663['dialOriginateTimeout'],'dialPrefix':_0x4e0663[_0x49c4('0x62')],'outboundAnswerAgiCallsDay':_0x4e0663[_0x49c4('0x63')],'outboundAnswerCallsDay':_0x4e0663[_0x49c4('0x64')],'outboundBlacklistCallsDay':_0x4e0663[_0x49c4('0x65')],'outboundBusyCallsDay':_0x4e0663['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x4e0663[_0x49c4('0x66')],'outboundDropCallsDayACS':_0x4e0663[_0x49c4('0x67')],'outboundDropCallsDayCallersExit':_0x4e0663[_0x49c4('0x68')],'outboundDropCallsDayTimeout':_0x4e0663[_0x49c4('0x69')],'outboundNoAnswerCallsDay':_0x4e0663[_0x49c4('0x6a')],'outboundNoSuchCallsDay':_0x4e0663[_0x49c4('0x6b')],'outboundOriginateFailureCallsDay':_0x4e0663[_0x49c4('0x6c')],'outboundReCallsDay':_0x4e0663[_0x49c4('0x6d')],'outboundRejectCallsDay':_0x4e0663[_0x49c4('0x6e')],'outboundUnknownCallsDay':_0x4e0663['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x4e0663[_0x49c4('0x6f')],'predictiveIntervalAvgHoldtime':_0x4e0663['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x4e0663[_0x49c4('0x70')],'predictiveIntervalDroppedCallsCallersExit':_0x4e0663[_0x49c4('0x71')],'predictiveIntervalDroppedCallsTimeout':_0x4e0663[_0x49c4('0x72')],'predictiveIntervalErlangCalls':_0x4e0663[_0x49c4('0x73')],'predictiveIntervalErlangCallsDroppedCalls':_0x4e0663[_0x49c4('0x74')],'predictiveIntervalHitRate':_0x4e0663['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x4e0663[_0x49c4('0x75')],'predictiveIntervalPauses':_0x4e0663[_0x49c4('0x76')],'predictiveIntervalAvailable':_0x4e0663[_0x49c4('0x77')],'predictiveIntervalTotalCalls':_0x4e0663[_0x49c4('0x78')],'message':_0x4e0663[_0x49c4('0x42')],'originated':_0x4e0663[_0x49c4('0x79')],'erlangCalls':_0x4e0663[_0x49c4('0x7a')],'erlangCallToSecond':_0x4e0663['erlangCallToSecond'],'erlangAbandonmentRate':_0x4e0663[_0x49c4('0x7b')],'erlangBusyFactor':_0x4e0663['erlangBusyFactor'],'startPredictive':_0x4e0663[_0x49c4('0x2b')],'startProgressive':_0x4e0663[_0x49c4('0x7c')]};if(_0x4e0663[_0x49c4('0x7d')]){_0x32b172[_0x49c4('0x7d')]={'id':_0x4e0663[_0x49c4('0x7d')]['id'],'name':_0x4e0663[_0x49c4('0x7d')][_0x49c4('0x40')],'active':_0x4e0663['Trunk'][_0x49c4('0x7e')],'callerid':_0x4e0663[_0x49c4('0x7d')]['callerid']};}if(_0x4e0663[_0x49c4('0x49')]){_0x32b172[_0x49c4('0x49')]={'id':_0x4e0663[_0x49c4('0x49')]['id'],'name':_0x4e0663[_0x49c4('0x49')]['name']};}var _0x5d8bf0=md5(JSON[_0x49c4('0x4c')](_0x32b172));if(_0x4e0663['md5']!==_0x5d8bf0){_0x4e0663[_0x49c4('0x3')]=_0x5d8bf0;emit(util[_0x49c4('0x7f')](_0x49c4('0x80'),_0x32b172[_0x49c4('0x40')]),_0x49c4('0x81'),_0x32b172);}}}function emitCampaignSummary(_0x286651){if(_0x286651[_0x49c4('0x51')]==='ivr'){emit(util[_0x49c4('0x7f')](_0x49c4('0x82'),_0x286651[_0x49c4('0x40')]),_0x49c4('0x83'),_0x286651);}}function checkGetDataPredictive(_0x17ef75){if(isNotNull(_0x17ef75)&&!_[_0x49c4('0x48')](_0x17ef75)){loggerPredictive[_0x49c4('0x84')](_0x49c4('0x85'));loggerPredictive[_0x49c4('0x84')](_0x49c4('0x86'),_0x17ef75['predictiveIntervalTotalCalls']);loggerPredictive['info'](_0x49c4('0x87'),_0x17ef75[_0x49c4('0x6f')]);loggerPredictive['info']('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x17ef75[_0x49c4('0x72')]);loggerPredictive['info']('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x17ef75[_0x49c4('0x71')]);loggerPredictive[_0x49c4('0x84')](_0x49c4('0x88'),_0x17ef75[_0x49c4('0x89')]);loggerPredictive[_0x49c4('0x84')](_0x49c4('0x8a'),_0x17ef75[_0x49c4('0x70')]);loggerPredictive['info'](_0x49c4('0x8b'));if(_0x17ef75[_0x49c4('0x78')]>0x0){if(!_[_0x49c4('0x3e')](_0x17ef75[_0x49c4('0x70')])&&_0x17ef75[_0x49c4('0x70')]>0x0){return!![];}loggerPredictive[_0x49c4('0x84')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_['isUndefined'](_0x17ef75[_0x49c4('0x89')])&&_0x17ef75[_0x49c4('0x89')]>0x0){return!![];}loggerPredictive[_0x49c4('0x84')](_0x49c4('0x8c'));}else{loggerPredictive[_0x49c4('0x84')](_0x49c4('0x8d'));}}else{loggerPredictive[_0x49c4('0x84')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x45d715){return function(_0x33c9a6){loggerPredictive['info'](_0x49c4('0x8e'));loggerPredictive['info'](_0x49c4('0x8f'),_0x33c9a6[_0x49c4('0x7a')]);loggerPredictive[_0x49c4('0x84')](_0x49c4('0x90'),_0x33c9a6[_0x49c4('0x91')]);loggerPredictive[_0x49c4('0x84')](_0x49c4('0x92'),_0x33c9a6[_0x49c4('0x7b')]);loggerPredictive['info'](_0x49c4('0x93'),_0x33c9a6[_0x49c4('0x94')]);loggerPredictive['info'](_0x49c4('0x92'),_0x33c9a6[_0x49c4('0x7b')]);loggerPredictive['info'](_0x49c4('0x8b'));_[_0x49c4('0x95')](_0x45d715,_0x33c9a6);};}function getDiff(_0x4f50bf){var _0x4dc54d=moment()['milliseconds'](0x0);var _0x513879=moment(_0x4f50bf)[_0x49c4('0x4d')](0x0);return _0x4dc54d['diff'](_0x513879,_0x49c4('0x4f'));}function ifInterval(_0x32f344,_0x515240){if(_[_0x49c4('0x3e')](_0x515240)){return![];}return getDiff(_0x515240)<_0x32f344*0x3c;}function freeVariablesPredictive(_0xdb2b33){if(isNotNull(_0xdb2b33)){if(!_['isUndefined'](_0xdb2b33[_0x49c4('0x7c')])){_0xdb2b33[_0x49c4('0x7c')]=undefined;loggerPredictive[_0x49c4('0x84')](_0xdb2b33[_0x49c4('0x40')],'clearing\x20variable\x20start\x20progressive');}if(!_[_0x49c4('0x3e')](_0xdb2b33[_0x49c4('0x2b')])){_0xdb2b33[_0x49c4('0x2b')]=undefined;loggerPredictive[_0x49c4('0x84')](_0xdb2b33['name'],_0x49c4('0x96'));}if(!_['isUndefined'](_0xdb2b33['handlePredictive'])){clearInterval(_0xdb2b33['handlePredictive']);_0xdb2b33['handlePredictive']=undefined;loggerPredictive[_0x49c4('0x84')](_0xdb2b33[_0x49c4('0x40')],_0x49c4('0x97'));}}}function erlangb(_0x28bbf3,_0x5b056e){if(_0x5b056e===0x0){return 0x0;}var _0x4daa6d=0x1;for(var _0x340523=0x1;_0x340523<=_0x5b056e;_0x340523+=0x1){_0x4daa6d=0x1+_0x4daa6d*_0x340523/_0x28bbf3;}return 0x1/_0x4daa6d;}function isVoiceQueueOutbound(_0x109b81){return _0x109b81===_0x49c4('0x52');}function isNotPreview(_0x295ad0){return _0x295ad0!==_0x49c4('0x98');}function isCampaignIvr(_0x404f98){return _0x404f98===_0x49c4('0x99');}function getCallerId(_0x3b949d,_0x4d49e0,_0x2276db){if(!_['isUndefined'](_0x2276db)&&typeof _0x2276db===_0x49c4('0x9a')&&!_[_0x49c4('0x48')](_0x2276db)){if(!_[_0x49c4('0x3e')](_0x4d49e0)&&typeof _0x4d49e0===_0x49c4('0x9a')&&!_[_0x49c4('0x48')](_0x4d49e0)){return util[_0x49c4('0x7f')](_0x49c4('0x9b'),_0x4d49e0,_0x2276db);}return util[_0x49c4('0x7f')](_0x49c4('0x9b'),_0x2276db,_0x2276db);}if(!_[_0x49c4('0x3e')](_0x3b949d)&&typeof _0x3b949d===_0x49c4('0x9a')&&!_[_0x49c4('0x48')](_0x3b949d)){return _0x3b949d;}return _0x49c4('0x9c');}function loggerCatchQueueSummary(_0x14bd09,_0x2d5f63){return function(_0x453cf2){freeVariablesPredictive(_0x2d5f63);emitVoiceQueueSummary(_0x2d5f63);emitCampaignSummary(_0x2d5f63);loggerSyncQueueSummary[_0x49c4('0x9d')](_0x14bd09,util[_0x49c4('0x9e')](_0x453cf2,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x4e1544,_0x5ec201){return function(_0x10f2ec){loggerPredictive[_0x49c4('0x9f')](_0x5ec201['name'],_0x4e1544);loggerPredictive[_0x49c4('0x9f')](_0x10f2ec[_0x49c4('0xa0')]);freeVariablesPredictive(_0x5ec201);};}function loggerCatch(_0x2939fd){return function(_0x16e7b1){logger['error'](_0x2939fd,util['inspect'](_0x16e7b1,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x4a85d4){return _0x4a85d4&&!_[_0x49c4('0x3e')](_0x4a85d4)&&_0x4a85d4[_0x49c4('0xa1')]>0x0;}function decremetOriginate(_0x1b912a){if(!_[_0x49c4('0x3e')](_0x1b912a)&&_0x1b912a!==null){if(typeof _0x1b912a[_0x49c4('0x79')]!==_0x49c4('0xa2')){if(_0x1b912a[_0x49c4('0x79')]>0x0){_0x1b912a[_0x49c4('0x79')]-=0x1;}else{logger[_0x49c4('0x9f')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x49c4('0x9f')](_0x49c4('0xa3'));}}function checkContactLowerLimitOriginate(_0x342f8f,_0x4b759b,_0x4448b9){if(_0x4b759b>_0x4448b9){for(var _0x46d94a=0x0;_0x46d94a<_0x4b759b-_0x4448b9;_0x46d94a+=0x1){decremetOriginate(_0x342f8f);}}}function loggerGetContactDialer(_0x1fa0a6,_0xb6031b,_0x1f25be){return function(_0x2fd749){checkContactLowerLimitOriginate(_0xb6031b,_0x1f25be,0x0);logger[_0x49c4('0x9f')](_0x1fa0a6,util[_0x49c4('0x9e')](_0x2fd749,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x4ba198){return function(_0x1bc683){if(isNotNull(_0x1bc683)&&isNotNull(_0x1bc683[0x0])){if(_0x1bc683[0x0][_0x49c4('0xa4')]>0x0){_0x4ba198[_0x49c4('0x42')]=_0x49c4('0xa5');logger[_0x49c4('0x84')]('[getContactDialer2][ReScheduled]'+_0x4ba198['name'],_0x1bc683[0x0][_0x49c4('0xa4')],'contacts');}else{_0x4ba198[_0x49c4('0x42')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x49c4('0x84')](_0x49c4('0xa6')+_0x4ba198[_0x49c4('0x40')]);}}};}function notSendMessagesQueue(_0x34870e){if(_0x34870e['sendMessageOneNotActive']){freeVariablesPredictive(_0x34870e);if(_0x34870e[_0x49c4('0x79')]===0x0&&_0x34870e[_0x49c4('0x5b')]===0x0&&_0x34870e[_0x49c4('0x5d')]===0x0&&(_0x34870e[_0x49c4('0x57')]||0x0)===0x0){_0x34870e[_0x49c4('0xa7')]=![];_0x34870e[_0x49c4('0x55')]=0x0;_0x34870e[_0x49c4('0x42')]=_0x49c4('0x43');loggerSyncQueueSummary[_0x49c4('0x9d')](_0x49c4('0xa8'),_0x34870e['name'],_0x49c4('0xa9'));}else{_0x34870e[_0x49c4('0x42')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x49c4('0x9d')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x34870e[_0x49c4('0x40')],_0x49c4('0xaa'));}emitVoiceQueueSummary(_0x34870e);}}function notSendMessagesCampaign(_0x1f14a6){if(_0x1f14a6[_0x49c4('0xa7')]){if(_0x1f14a6[_0x49c4('0x79')]===0x0){_0x1f14a6['sendMessageOneNotActive']=![];_0x1f14a6[_0x49c4('0x42')]=_0x49c4('0x43');loggerSyncQueueSummary['debug'](_0x49c4('0xab'),_0x1f14a6[_0x49c4('0x40')],'is\x20not\x20active');}else{_0x1f14a6[_0x49c4('0x42')]=_0x49c4('0xac');loggerSyncQueueSummary['debug'](_0x49c4('0xab'),_0x1f14a6[_0x49c4('0x40')],_0x49c4('0xaa'));}emitCampaignSummary(_0x1f14a6);}}function createObjHistory(_0x33dc39,_0x4e1364,_0x999ae2,_0x7212ce,_0x4c2fed){_0x33dc39[_0x49c4('0x42')]=_0x999ae2;var _0x5f0188=new Action(_0x33dc39,_0x4e1364);var _0x4a4cb7=new History(_0x5f0188);_0x4a4cb7[_0x49c4('0xad')]=_0x7212ce;_0x4a4cb7['statedesc']=_0x4c2fed;_0x4a4cb7['endtime']=_0x5f0188[_0x49c4('0xae')];return _0x4a4cb7;}Dialer[_0x49c4('0x1d')]['loopClearZombieChannels']=function(){var _0x23e684=this;setInterval(function(){_0x23e684['clearZombieChannels'](_0x23e684['uniqueId'],'[uniqueid]');_0x23e684[_0x49c4('0xaf')](_0x23e684[_0x49c4('0x27')],_0x49c4('0xb0'));},0x32c8);};Dialer[_0x49c4('0x1d')]['clearZombieChannels']=function(_0x5b751a,_0x348693){var _0x48705c=this;for(var _0x2c560e in _0x5b751a){if(typeof _0x5b751a[_0x2c560e]!=='undefined'){this[_0x49c4('0x20')][_0x49c4('0xb1')](function(){if(!_[_0x49c4('0xb2')](_0x5b751a[_0x2c560e])){return ami[_0x49c4('0xb3')]({'action':_0x49c4('0xb4'),'channel':_0x5b751a[_0x2c560e][_0x49c4('0xb5')]})[_0x49c4('0xb6')](function(_0x5bb0e9){if(_0x5bb0e9[_0x49c4('0x42')]===_0x49c4('0xb7')){setTimeout(function(){if(_0x5b751a[_0x2c560e]&&_0x5b751a[_0x2c560e][_0x49c4('0x51')]!==_0x49c4('0x99')){_0x48705c[_0x49c4('0xb8')](_0x48705c['voiceQueues'][_0x5b751a[_0x2c560e][_0x49c4('0xb9')]]);logger[_0x49c4('0x9f')](_0x49c4('0xba'),_0x348693,_0x2c560e,_0x5b751a[_0x2c560e]['queue']);delete _0x5b751a[_0x2c560e];}if(_0x5b751a[_0x2c560e]&&_0x5b751a[_0x2c560e]['type']===_0x49c4('0x99')){_0x48705c[_0x49c4('0xb8')](_0x48705c[_0x49c4('0x22')][_0x5b751a[_0x2c560e][_0x49c4('0xb9')]]);logger[_0x49c4('0x9f')]('[Dialer][checkChannel][ivr]',_0x348693,_0x2c560e,_0x5b751a[_0x2c560e][_0x49c4('0xb9')]);delete _0x5b751a[_0x2c560e];}},0x2328);}});}});}}};Dialer[_0x49c4('0x1d')][_0x49c4('0xbb')]=function(_0x2aae0f){return BPromise['resolve']()['then'](cmHopper[_0x49c4('0xbb')](_0x2aae0f))[_0x49c4('0xb6')](loggerCatch(_0x49c4('0xbc')));};Dialer[_0x49c4('0x1d')][_0x49c4('0xbd')]=function(_0x5413d8){return BPromise[_0x49c4('0xbe')]()[_0x49c4('0xbf')](cmHopperBlack[_0x49c4('0xbd')](_0x5413d8))[_0x49c4('0xb6')](loggerCatch(_0x49c4('0xc0')));};Dialer[_0x49c4('0x1d')]['verifyAdditionalPhones']=function(_0x21a4fb,_0x1c90ba,_0x2ed90e){return BPromise[_0x49c4('0xbe')]()['then'](cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x21a4fb,_0x1c90ba,_0x2ed90e))[_0x49c4('0xb6')](loggerCatch('[verifyAdditionalPhone]\x20'));};Dialer[_0x49c4('0x1d')]['swapAdditionalPhones']=function(_0x303d49,_0xc77d25,_0x25afc3){return BPromise[_0x49c4('0xbe')]()['then'](cmHopperAdditionalPhone['swapAdditionalPhones'](_0x303d49,_0xc77d25,_0x25afc3))[_0x49c4('0xb6')](loggerCatch(_0x49c4('0xc1')));};Dialer[_0x49c4('0x1d')]['checkIsBlackListIvr']=function(_0x4c0e9c){return BPromise[_0x49c4('0xbe')]()['then'](cmHopperBlack['checkIsBlackListIvr'](_0x4c0e9c))[_0x49c4('0xb6')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0x49c4('0x1d')][_0x49c4('0xc2')]=function(_0x4fc419){return BPromise[_0x49c4('0xbe')]()[_0x49c4('0xbf')](cmHopperHistory['avgHandleTime'](_0x4fc419))['catch'](loggerCatch(_0x49c4('0xc3')));};Dialer['prototype'][_0x49c4('0xc4')]=function(_0x3b577b){return BPromise[_0x49c4('0xbe')]()[_0x49c4('0xbf')](cmHopper[_0x49c4('0xc4')](_0x3b577b))[_0x49c4('0xb6')](loggerCatch(_0x49c4('0xc5')));};Dialer['prototype'][_0x49c4('0xc6')]=function(_0x12afa1,_0x85418e,_0xcc42bf){return BPromise[_0x49c4('0xbe')]()['then'](cmHopper[_0x49c4('0xc6')](_0x12afa1,_0x85418e,_0xcc42bf))['catch'](loggerCatch(_0x49c4('0xc7')));};Dialer[_0x49c4('0x1d')][_0x49c4('0xc8')]=function(_0x3d662c,_0x5acbf7,_0x293e47,_0x139696,_0x312b02){return BPromise[_0x49c4('0xbe')]()[_0x49c4('0xbf')](cmHopper[_0x49c4('0xc8')](_0x3d662c,_0x5acbf7,_0x293e47,_0x139696))['catch'](function(_0x8c5de0){_0x312b02['temp']-=_0x293e47;_0x312b02[_0x49c4('0xc9')]=_0x312b02[_0x49c4('0xc9')]>0x0?_0x312b02[_0x49c4('0xc9')]:0x0;loggerCatch(_0x49c4('0xca'))(_0x8c5de0);});};Dialer['prototype'][_0x49c4('0xcb')]=function(_0x17e7c6,_0x5829bc,_0x1e0b7d,_0x3c321f){return BPromise['resolve']()['then'](cmHopper[_0x49c4('0xcb')](_0x17e7c6,_0x5829bc,_0x1e0b7d))[_0x49c4('0xb6')](function(_0x35b7e6){_0x3c321f[_0x49c4('0xc9')]-=_0x5829bc;_0x3c321f[_0x49c4('0xc9')]=_0x3c321f[_0x49c4('0xc9')]>0x0?_0x3c321f[_0x49c4('0xc9')]:0x0;loggerCatch(_0x49c4('0xcc'))(_0x35b7e6);});};Dialer[_0x49c4('0x1d')][_0x49c4('0xcd')]=function(_0x269613){return BPromise['resolve']()['then'](voiceQueueRt[_0x49c4('0xcd')](_0x269613))[_0x49c4('0xb6')](loggerCatch(_0x49c4('0xce')));};Dialer['prototype'][_0x49c4('0xcf')]=function(_0x326ca8){return BPromise['resolve']()[_0x49c4('0xbf')](cmHopper['moveContactManagedDialer'](_0x326ca8))[_0x49c4('0xb6')](loggerCatch(_0x49c4('0xd0')));};Dialer[_0x49c4('0x1d')][_0x49c4('0xd1')]=function(_0x572433){return BPromise[_0x49c4('0xbe')]()[_0x49c4('0xbf')](cmHopperHistory[_0x49c4('0xd1')](_0x572433))[_0x49c4('0xb6')](loggerCatch(_0x49c4('0xd2')));};Dialer['prototype']['updateOriginated']=function(_0x5f4d82){if(!_[_0x49c4('0x3e')](_0x5f4d82)&&_0x5f4d82!==null){if(typeof _0x5f4d82[_0x49c4('0x79')]!==_0x49c4('0xa2')){if(_0x5f4d82[_0x49c4('0x79')]>0x0){_0x5f4d82[_0x49c4('0x79')]-=0x1;}else{logger['error'](_0x49c4('0xd3'));}}}else{logger[_0x49c4('0x9f')](_0x49c4('0xd4'));}};Dialer[_0x49c4('0x1d')]['loggerHandler']=function(_0x26ddfc,_0x5bfccd){var _0x10fa42=this;return function(_0x27d17b){_0x10fa42[_0x49c4('0xb8')](_0x5bfccd);logger['error'](_0x26ddfc,util[_0x49c4('0x9e')](_0x27d17b,{'showHidden':![],'depth':null}));};};Dialer[_0x49c4('0x1d')][_0x49c4('0xd5')]=function(_0x494c7f,_0x182d2f,_0x11f47f){var _0xa1954a={'state':0x19,'statedesc':'notFound'};this[_0x49c4('0xb8')](_0x182d2f);this['saveInDb'](_['merge'](_0xa1954a,_[_0x49c4('0xd6')](_0x11f47f,[_0x49c4('0xd7'),'ListId',_0x49c4('0xd8'),_0x49c4('0xd9'),_0x49c4('0xda')])),_0x49c4('0xdb'),_0x49c4('0xdc'));logger[_0x49c4('0x9f')](_0x494c7f);};Dialer[_0x49c4('0x1d')][_0x49c4('0xdd')]=function(_0x59dbef){return _0x59dbef==='Success';};Dialer[_0x49c4('0x1d')][_0x49c4('0xde')]=function(_0x42f2db){return!_['isUndefined'](_0x42f2db)&&_0x42f2db&&!_['isUndefined'](_0x42f2db[_0x49c4('0x40')])&&!_[_0x49c4('0x3e')](_0x42f2db[_0x49c4('0x7e')])&&_0x42f2db[_0x49c4('0x7e')]&&(this[_0x49c4('0x24')][util[_0x49c4('0x7f')](_0x49c4('0xdf'),_0x42f2db[_0x49c4('0x40')])][_0x49c4('0xb4')]===_0x49c4('0xe0')||this[_0x49c4('0x24')][util[_0x49c4('0x7f')](_0x49c4('0xdf'),_0x42f2db[_0x49c4('0x40')])]['status']===_0x49c4('0xe1'));};Dialer[_0x49c4('0x1d')][_0x49c4('0xe2')]=function(_0x318aaf,_0x4fc4c9,_0x53b6c3){this[_0x49c4('0xd1')](_0x318aaf)['catch'](loggerCatch(_0x4fc4c9));this[_0x49c4('0xcf')](_0x318aaf)[_0x49c4('0xb6')](loggerCatch(_0x53b6c3));};Dialer[_0x49c4('0x1d')][_0x49c4('0x36')]=function(_0x2bcc8c){var _0x45a2ef=this[_0x49c4('0x29')][_0x2bcc8c[_0x49c4('0xe3')]];var _0x31ba95;if(!_[_0x49c4('0xb2')](_0x2bcc8c)&&!_[_0x49c4('0xb2')](_0x2bcc8c[_0x49c4('0xe4')])&&!_['isNil'](_0x2bcc8c[_0x49c4('0xe4')][_0x49c4('0xe5')])&&_0x2bcc8c[_0x49c4('0xe6')]==='xcally-motion-dialer'&&_0x45a2ef){if(_0x45a2ef[_0x49c4('0x51')]!=='ivr'&&this[_0x49c4('0x21')][_0x45a2ef[_0x49c4('0xb9')]][_0x49c4('0xe7')]&&_0x2bcc8c[_0x49c4('0xe8')]==='HANGUP'){delete this[_0x49c4('0x29')][_0x2bcc8c['uniqueid']];this['updateOriginated'](this[_0x49c4('0x21')][_0x45a2ef[_0x49c4('0xb9')]]);this[_0x49c4('0x21')][_0x45a2ef['queue']]['outboundAnswerCallsDay']+=0x1;this[_0x49c4('0x21')][_0x45a2ef[_0x49c4('0xb9')]][_0x49c4('0x63')]+=0x1;_0x31ba95=new Hangup(_0x45a2ef,_0x2bcc8c);_0x31ba95[_0x49c4('0xad')]=0x12;_0x31ba95[_0x49c4('0xe9')]=_0x49c4('0xea');_0x31ba95[_0x49c4('0xeb')]=_0x49c4('0xec');ami[_0x49c4('0x50')]('custom:amd',ut[_0x49c4('0xed')](_0x31ba95,_0x49c4('0xee')));this['saveInDb'](_0x31ba95,'[syncHangupInAMD][createHistory]',_0x49c4('0xef'));}if(_0x45a2ef['type']!==_0x49c4('0x99')&&this['voiceQueues'][_0x45a2ef[_0x49c4('0xb9')]]['dialAMDActive']&&_0x2bcc8c[_0x49c4('0xe8')]===_0x49c4('0xf0')){var _0x55da39=this;return new BPromise(function(_0x1ab574,_0x5b1e3d){delete _0x55da39['uniqueId'][_0x2bcc8c[_0x49c4('0xe3')]];_0x55da39[_0x49c4('0xb8')](_0x55da39[_0x49c4('0x21')][_0x45a2ef['queue']]);_0x55da39[_0x49c4('0x21')][_0x45a2ef[_0x49c4('0xb9')]]['outboundAnswerCallsDay']+=0x1;_0x55da39['voiceQueues'][_0x45a2ef[_0x49c4('0xb9')]][_0x49c4('0x63')]+=0x1;var _0xa0698d=_0x55da39['voiceQueues'][_0x45a2ef[_0x49c4('0xb9')]];var _0x3da1a3=new Hangup(_0x45a2ef,_0x2bcc8c);_0x3da1a3[_0x49c4('0xad')]=0x13;_0x3da1a3[_0x49c4('0xe9')]='Machine';_0x3da1a3[_0x49c4('0xeb')]='AMD';_0x3da1a3['countmachineretry']+=0x1;_0x3da1a3[_0x49c4('0xf1')]+=0x1;_0x3da1a3[_0x49c4('0xee')]=!![];ami[_0x49c4('0x50')](_0x49c4('0xf2'),ut['buildObj'](_0x3da1a3,_0x49c4('0xee')));_0x55da39[_0x49c4('0xd1')](_0x3da1a3)[_0x49c4('0xb6')](loggerCatch(_0x49c4('0xf3')));if(_0x3da1a3['countbusyretry']+_0x3da1a3[_0x49c4('0xf4')]+_0x3da1a3['countnoanswerretry']+_0x3da1a3['countnosuchnumberretry']+_0x3da1a3[_0x49c4('0xf5')]+_0x3da1a3[_0x49c4('0xf6')]+_0x3da1a3[_0x49c4('0xf7')]+_0x3da1a3['countagentrejectretry']>=_0xa0698d[_0x49c4('0xf8')]){_0x55da39['stateGlobal'](_0x3da1a3,_0x1ab574,_0x5b1e3d,_0x49c4('0xf9'));}else{if(_0x3da1a3[_0x49c4('0xf7')]>=_0xa0698d[_0x49c4('0xfa')]){_0x55da39[_0x49c4('0xfb')](_0x3da1a3,_0x1ab574,_0x5b1e3d,_0x49c4('0xfc'));}else{_0x55da39[_0x49c4('0xc4')]({'active':![],'countmachineretry':_0x3da1a3[_0x49c4('0xf7')],'scheduledat':moment()['add'](_0xa0698d[_0x49c4('0xfd')],_0x49c4('0xfe'))[_0x49c4('0x7f')](_0x49c4('0xff')),'ContactId':_0x3da1a3['ContactId'],'ListId':_0x3da1a3['ListId'],'VoiceQueueId':_0x3da1a3['VoiceQueueId']||undefined,'CampaignId':_0x3da1a3[_0x49c4('0xda')]||undefined})[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x100')));_0x1ab574({'reschedule':0x1});}}});}if(_0x45a2ef[_0x49c4('0x51')]===_0x49c4('0x99')&&this[_0x49c4('0x22')][_0x45a2ef[_0x49c4('0xb9')]]['dialAMDActive']&&_0x2bcc8c[_0x49c4('0xe8')]===_0x49c4('0x101')){delete this['uniqueId'][_0x2bcc8c['uniqueid']];this['updateOriginated'](this[_0x49c4('0x22')][_0x45a2ef[_0x49c4('0xb9')]]);_0x31ba95=new Hangup(_0x45a2ef,_0x2bcc8c);_0x31ba95[_0x49c4('0xad')]=0x12;_0x31ba95[_0x49c4('0xe9')]=_0x49c4('0xea');_0x31ba95[_0x49c4('0xeb')]=_0x49c4('0xec');ami['emit'](_0x49c4('0xf2'),ut[_0x49c4('0xed')](_0x31ba95,_0x49c4('0xee')));this[_0x49c4('0xe2')](_0x31ba95,'[syncHangupInAMDIvr][createHistory]',_0x49c4('0x102'));}if(_0x45a2ef[_0x49c4('0x51')]===_0x49c4('0x99')&&this[_0x49c4('0x22')][_0x45a2ef[_0x49c4('0xb9')]]['dialAMDActive']&&_0x2bcc8c[_0x49c4('0xe8')]==='MACHINE'){var _0x55da39=this;return new BPromise(function(_0x306faf,_0x1eeaed){delete _0x55da39[_0x49c4('0x29')][_0x2bcc8c[_0x49c4('0xe3')]];_0x55da39[_0x49c4('0xb8')](_0x55da39['campaigns'][_0x45a2ef[_0x49c4('0xb9')]]);_0x55da39[_0x49c4('0x22')][_0x45a2ef[_0x49c4('0xb9')]]['outboundAnswerCallsDay']+=0x1;_0x55da39[_0x49c4('0x22')][_0x45a2ef[_0x49c4('0xb9')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x369304=_0x55da39[_0x49c4('0x22')][_0x45a2ef[_0x49c4('0xb9')]];var _0x600420=new Hangup(_0x45a2ef,_0x2bcc8c);_0x600420[_0x49c4('0xad')]=0x13;_0x600420[_0x49c4('0xe9')]=_0x49c4('0x103');_0x600420['membername']=_0x49c4('0xec');_0x600420[_0x49c4('0xf7')]+=0x1;_0x600420[_0x49c4('0xf1')]+=0x1;_0x600420[_0x49c4('0xee')]=!![];ami[_0x49c4('0x50')]('custom:amd',ut[_0x49c4('0xed')](_0x600420,_0x49c4('0xee')));_0x55da39[_0x49c4('0xd1')](_0x600420)[_0x49c4('0xb6')](loggerCatch(_0x49c4('0xf3')));if(_0x600420['countbusyretry']+_0x600420[_0x49c4('0xf4')]+_0x600420[_0x49c4('0x104')]+_0x600420[_0x49c4('0x105')]+_0x600420[_0x49c4('0xf5')]+_0x600420[_0x49c4('0xf6')]+_0x600420[_0x49c4('0xf7')]+_0x600420[_0x49c4('0x106')]>=_0x369304[_0x49c4('0xf8')]){_0x55da39[_0x49c4('0x107')](_0x600420,_0x306faf,_0x1eeaed,_0x49c4('0xf9'));}else{if(_0x600420['countmachineretry']>=_0x369304[_0x49c4('0xfa')]){_0x55da39[_0x49c4('0xfb')](_0x600420,_0x306faf,_0x1eeaed,_0x49c4('0xfc'));}else{_0x55da39[_0x49c4('0xc4')]({'active':![],'countmachineretry':_0x600420[_0x49c4('0xf7')],'scheduledat':moment()['add'](_0x369304['dialMachineRetryFrequency'],_0x49c4('0xfe'))[_0x49c4('0x7f')](_0x49c4('0xff')),'ContactId':_0x600420[_0x49c4('0xd7')],'ListId':_0x600420[_0x49c4('0x108')],'VoiceQueueId':_0x600420[_0x49c4('0xd9')]||undefined,'CampaignId':_0x600420['CampaignId']||undefined})[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x100')));_0x306faf({'reschedule':0x1});}}});}}};Dialer['prototype'][_0x49c4('0x32')]=function(_0x55d0ac){var _0x30d99a=this[_0x49c4('0x29')][_0x55d0ac[_0x49c4('0xe3')]];var _0x5db4a1=this;var _0x1e30d7;if(_0x30d99a&&_0x30d99a['type']===_0x49c4('0x99')){delete this['uniqueId'][_0x55d0ac['uniqueid']];this[_0x49c4('0xb8')](this[_0x49c4('0x22')][_0x30d99a[_0x49c4('0xb9')]]);this[_0x49c4('0x22')][_0x30d99a[_0x49c4('0xb9')]][_0x49c4('0x109')]+=0x1;_0x1e30d7=new Hangup(_0x30d99a,_0x55d0ac);this['createHistory'](_0x1e30d7)['catch'](loggerCatch(_0x49c4('0x10a')));this[_0x49c4('0xcf')](_0x1e30d7)[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x10b')));}if(_0x30d99a&&_0x30d99a[_0x49c4('0x51')]!==_0x49c4('0x99')&&isNotNull(this[_0x49c4('0x21')][_0x30d99a['queue']]['dialQueueProject'])){delete this['uniqueId'][_0x55d0ac['uniqueid']];this[_0x49c4('0xb8')](this['voiceQueues'][_0x30d99a[_0x49c4('0xb9')]]);this[_0x49c4('0x21')][_0x30d99a[_0x49c4('0xb9')]]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x30d99a[_0x49c4('0xb9')]][_0x49c4('0x63')]+=0x1;_0x1e30d7=new Hangup(_0x30d99a,_0x55d0ac);_0x1e30d7['state']=0x10;_0x1e30d7[_0x49c4('0xe9')]=_0x49c4('0x10c');_0x1e30d7[_0x49c4('0xeb')]=_0x49c4('0x10d');this[_0x49c4('0xd1')](_0x1e30d7)[_0x49c4('0xb6')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x49c4('0xcf')](_0x1e30d7)[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x10b')));}if(_0x30d99a&&_0x30d99a['type']!==_0x49c4('0x99')&&!isNotNull(this[_0x49c4('0x21')][_0x30d99a[_0x49c4('0xb9')]][_0x49c4('0x10e')])){delete this[_0x49c4('0x29')][_0x55d0ac[_0x49c4('0xe3')]];this[_0x49c4('0xb8')](this[_0x49c4('0x21')][_0x30d99a['queue']]);this[_0x49c4('0x21')][_0x30d99a[_0x49c4('0xb9')]][_0x49c4('0x10f')]+=0x1;_0x1e30d7=new Hangup(_0x30d99a,_0x55d0ac);_0x1e30d7[_0x49c4('0xad')]=0xc;_0x1e30d7[_0x49c4('0xe9')]=_0x55d0ac[_0x49c4('0x110')];_0x1e30d7['membername']=_0x49c4('0x111');this[_0x49c4('0xd1')](_0x1e30d7)[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x10a')));this[_0x49c4('0xcf')](_0x1e30d7)[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x10b')));}};Dialer[_0x49c4('0x1d')][_0x49c4('0x112')]=function(_0xc641bc){var _0xcec186=this[_0x49c4('0x29')][_0xc641bc[_0x49c4('0xe3')]];var _0x43bd6e=this;if(this['voiceQueues'][_0xc641bc['queue']]){if(_0xcec186&&_0xcec186[_0x49c4('0x51')]!==_0x49c4('0x99')){delete this['uniqueId'][_0xc641bc['uniqueid']];this[_0x49c4('0x21')][_0xc641bc['queue']][_0x49c4('0x64')]+=0x1;var _0x8a4230=new AgentComplete(_0xcec186,_0xc641bc);if(_0xc641bc[_0x49c4('0x113')]===_0x49c4('0x114')){_0x8a4230[_0x49c4('0x115')]=this[_0x49c4('0x21')][_0xc641bc[_0x49c4('0xb9')]][_0x49c4('0x116')]&&this['voiceQueues'][_0xc641bc[_0x49c4('0xb9')]][_0x49c4('0x117')]?moment()[_0x49c4('0x7f')](_0x49c4('0xff')):undefined;}this[_0x49c4('0xd1')](_0x8a4230)['catch'](loggerCatch(_0x49c4('0x118')));this[_0x49c4('0xcf')](_0x8a4230)['catch'](loggerCatch(_0x49c4('0x119')));}}};Dialer[_0x49c4('0x1d')]['syncAgentConnect']=function(_0x3ff81c){if(this[_0x49c4('0x21')][_0x3ff81c[_0x49c4('0xb9')]]){if(this['uniqueId'][_0x3ff81c[_0x49c4('0xe3')]]&&this[_0x49c4('0x29')][_0x3ff81c[_0x49c4('0xe3')]][_0x49c4('0x51')]!=='ivr'){this[_0x49c4('0xb8')](this['voiceQueues'][_0x3ff81c[_0x49c4('0xb9')]]);this[_0x49c4('0x29')][_0x3ff81c[_0x49c4('0xe3')]][_0x49c4('0x11a')]=moment()['format'](_0x49c4('0xff'));}}};Dialer[_0x49c4('0x1d')][_0x49c4('0x11b')]=function(_0x114519,_0x4fb101){this[_0x49c4('0xd1')](_0x114519)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x4fb101==0x0){this[_0x49c4('0xcf')](_0x114519)[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x11c')));}};Dialer[_0x49c4('0x1d')][_0x49c4('0x2f')]=function(_0x131384){var _0x21916c=this[_0x49c4('0x29')][_0x131384[_0x49c4('0xe3')]];var _0x37dbbf=this;var _0x300bea=![];var _0x32501e;var _0x527c76;if(this[_0x49c4('0x21')][_0x131384[_0x49c4('0xb9')]]){if(_0x21916c&&_0x21916c['type']!==_0x49c4('0x99')){delete this['uniqueId'][_0x131384[_0x49c4('0xe3')]];this[_0x49c4('0xb8')](this['voiceQueues'][_0x131384[_0x49c4('0xb9')]]);_0x21916c[_0x49c4('0x11d')]=moment()[_0x49c4('0x7f')](_0x49c4('0xff'));var _0x29ae49=new QueueCallerAbandon(_0x21916c,_0x131384);if(getSeconds(_0x21916c['droptime'],_0x21916c[_0x49c4('0x11e')])>=_0x21916c['dialQueueTimeout']){this[_0x49c4('0x21')][_0x131384[_0x49c4('0xb9')]][_0x49c4('0x72')]+=0x1;this['voiceQueues'][_0x131384[_0x49c4('0xb9')]][_0x49c4('0x69')]+=0x1;this[_0x49c4('0x21')][_0x131384['queue']]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x29ae49[_0x49c4('0xad')]=0xa;_0x29ae49[_0x49c4('0xe9')]=_0x49c4('0x11f');_0x29ae49[_0x49c4('0x120')]=_0x49c4('0x121');_0x29ae49[_0x49c4('0x115')]=this['voiceQueues'][_0x131384['queue']]['dialQueueProject2']?moment()[_0x49c4('0x7f')](_0x49c4('0xff')):undefined;_0x29ae49[_0x49c4('0xf5')]+=0x1;_0x29ae49[_0x49c4('0xf1')]+=0x1;_0x32501e=this['voiceQueues'][_0x131384[_0x49c4('0xb9')]][_0x49c4('0x122')];_0x527c76=this[_0x49c4('0x21')][_0x131384[_0x49c4('0xb9')]][_0x49c4('0x123')];_0x37dbbf[_0x49c4('0x124')](_0x29ae49,_0x29ae49[_0x49c4('0xad')],_0x21916c[_0x49c4('0x125')])[_0x49c4('0xbf')](function(_0x39e6f5){_0x300bea=_0x39e6f5[_0x49c4('0x126')]==0x1;if(_0x29ae49['countdropretry']>=_0x37dbbf[_0x49c4('0x21')][_0x131384['queue']][_0x49c4('0x127')]){_0x37dbbf[_0x49c4('0x11b')](_0x29ae49,_0x39e6f5[_0x49c4('0x126')]);}else{_0x37dbbf[_0x49c4('0xc4')]({'active':![],'countdropretry':_0x29ae49['countdropretry'],'scheduledat':moment()[_0x49c4('0x128')](_0x37dbbf['voiceQueues'][_0x131384['queue']]['dialDropRetryFrequency'],_0x49c4('0xfe'))[_0x49c4('0x7f')](_0x49c4('0xff')),'ContactId':_0x21916c['ContactId'],'ListId':_0x21916c[_0x49c4('0x108')],'VoiceQueueId':_0x21916c['VoiceQueueId']||undefined,'CampaignId':_0x21916c[_0x49c4('0xda')]||undefined})[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x129')));var _0x54cf88=new History(_0x29ae49);_0x54cf88[_0x49c4('0xad')]=0xa;_0x54cf88[_0x49c4('0xe9')]=_0x49c4('0x11f');_0x54cf88[_0x49c4('0xae')]=moment()[_0x49c4('0x7f')]('YYYY-MM-DD\x20HH:mm:ss');_0x54cf88[_0x49c4('0x12a')]=_0x54cf88[_0x49c4('0xae')];_0x54cf88[_0x49c4('0x12b')]=_0x29ae49[_0x49c4('0x12b')];_0x54cf88['calleridnum']=_0x29ae49['calleridnum'];_0x37dbbf[_0x49c4('0xd1')](_0x54cf88)[_0x49c4('0xb6')](loggerCatch('[syncAgentComplete][createHistory][10]'));}})[_0x49c4('0xbf')](function(_0x2fd09b){if(_0x300bea)_0x37dbbf[_0x49c4('0x12c')](_0x29ae49,_0x32501e,_0x527c76)[_0x49c4('0xbf')](function(_0x512d87){return 0x1;});});}else{this[_0x49c4('0x21')][_0x131384[_0x49c4('0xb9')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this['voiceQueues'][_0x131384[_0x49c4('0xb9')]][_0x49c4('0x68')]+=0x1;_0x29ae49[_0x49c4('0xad')]=0xb;_0x29ae49[_0x49c4('0xe9')]=_0x49c4('0x12d');_0x29ae49['dropreason']=_0x49c4('0x12e');_0x29ae49['countabandonedretry']+=0x1;_0x29ae49[_0x49c4('0xf1')]+=0x1;_0x32501e=this[_0x49c4('0x21')][_0x131384[_0x49c4('0xb9')]][_0x49c4('0x12f')];_0x527c76=this['voiceQueues'][_0x131384['queue']]['callAdditionalPhoneAfterMin'];_0x37dbbf[_0x49c4('0x124')](_0x29ae49,_0x29ae49[_0x49c4('0xad')],_0x21916c[_0x49c4('0x125')])[_0x49c4('0xbf')](function(_0x4e38ed){if(_0x29ae49['countabandonedretry']>=_0x37dbbf[_0x49c4('0x21')][_0x131384['queue']][_0x49c4('0x130')]){_0x37dbbf[_0x49c4('0x11b')](_0x29ae49,_0x4e38ed['additional']);}else{_0x37dbbf[_0x49c4('0xc4')]({'active':![],'countabandonedretry':_0x29ae49[_0x49c4('0xf6')],'scheduledat':moment()[_0x49c4('0x128')](_0x37dbbf['voiceQueues'][_0x131384[_0x49c4('0xb9')]][_0x49c4('0x12f')],_0x49c4('0xfe'))['format'](_0x49c4('0xff')),'ContactId':_0x21916c[_0x49c4('0xd7')],'ListId':_0x21916c['ListId'],'VoiceQueueId':_0x21916c[_0x49c4('0xd9')]||undefined,'CampaignId':_0x21916c[_0x49c4('0xda')]||undefined})['catch'](loggerCatch(_0x49c4('0x131')));var _0x37bb11=new History(_0x29ae49);_0x37bb11[_0x49c4('0xad')]=0xb;_0x37bb11[_0x49c4('0xe9')]=_0x49c4('0x12d');_0x37bb11['starttime']=moment()[_0x49c4('0x7f')](_0x49c4('0xff'));_0x37bb11['endtime']=_0x37bb11[_0x49c4('0xae')];_0x37bb11[_0x49c4('0x12b')]=_0x29ae49[_0x49c4('0x12b')];_0x37bb11['calleridnum']=_0x29ae49[_0x49c4('0x132')];_0x37dbbf['createHistory'](_0x37bb11)[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x133')));}})['then'](function(_0x3811f6){if(_0x300bea)_0x37dbbf['swapAdditionalPhones'](_0x29ae49,_0x32501e,_0x527c76)[_0x49c4('0xbf')](function(_0x17ab2c){return 0x1;});});}}}};Dialer['prototype'][_0x49c4('0x34')]=function(_0x122024){if(this['actions'][_0x122024['uniqueid']]){this[_0x49c4('0x27')][_0x122024[_0x49c4('0xe3')]][_0x49c4('0xb5')]=_0x122024[_0x49c4('0xb5')];}if(this[_0x49c4('0x29')][_0x122024['uniqueid']]){this[_0x49c4('0x29')][_0x122024[_0x49c4('0xe3')]][_0x49c4('0xb5')]=_0x122024[_0x49c4('0xb5')];}};Dialer[_0x49c4('0x1d')]['syncQueueMember']=function(_0x5617c9){if(strategy[this[_0x49c4('0x21')][this[_0x49c4('0x27')][_0x5617c9[_0x49c4('0x134')]][_0x49c4('0xb9')]][_0x49c4('0x53')]]===_0x49c4('0x1c')){if(this[_0x49c4('0x27')][_0x5617c9['actionid']]&&_[_0x49c4('0xb2')](this[_0x49c4('0x27')][_0x5617c9[_0x49c4('0x134')]]['locked'])&&_0x5617c9['status']==='1'&&_0x5617c9[_0x49c4('0x135')]==='0'){if(this['agents'][_0x5617c9[_0x49c4('0x136')]]){if(!this[_0x49c4('0x23')][_0x5617c9[_0x49c4('0x136')]][_0x49c4('0x137')]){this['agents'][_0x5617c9[_0x49c4('0x136')]][_0x49c4('0x137')]=!![];this[_0x49c4('0x27')][_0x5617c9[_0x49c4('0x134')]]['locked']=!![];this[_0x49c4('0x27')][_0x5617c9[_0x49c4('0x134')]]['stateinterface']=_0x5617c9[_0x49c4('0x136')];}}}}else if((strategy[this[_0x49c4('0x21')][this[_0x49c4('0x27')][_0x5617c9[_0x49c4('0x134')]][_0x49c4('0xb9')]][_0x49c4('0x53')]]||_0x49c4('0x1b'))===_0x49c4('0x1b')){if(this['actions'][_0x5617c9['actionid']]){if(this['agents'][_0x5617c9[_0x49c4('0x136')]]){this[_0x49c4('0x27')][_0x5617c9[_0x49c4('0x134')]][_0x49c4('0x136')]=_0x5617c9[_0x49c4('0x136')];if(_['isNil'](this[_0x49c4('0x138')][this[_0x49c4('0x27')][_0x5617c9[_0x49c4('0x134')]][_0x49c4('0xb9')]])){this['queueBooked'][this['actions'][_0x5617c9[_0x49c4('0x134')]][_0x49c4('0xb9')]]=[];}this[_0x49c4('0x138')][this[_0x49c4('0x27')][_0x5617c9[_0x49c4('0x134')]][_0x49c4('0xb9')]]['push'](_['merge'](_[_0x49c4('0xd6')](this[_0x49c4('0x27')][_0x5617c9[_0x49c4('0x134')]],[_0x49c4('0x139'),_0x49c4('0x136')]),{'status':_0x5617c9['status'],'paused':_0x5617c9[_0x49c4('0x135')]}));}}}};function unlockQueueStatus(_0x2b6617,_0x3e1e48){setTimeout(function(){if(_[_0x49c4('0x3e')](_0x2b6617[_0x49c4('0x13a')])){loggerBooked[_0x49c4('0x9f')](_0x49c4('0x13b'),_0x3e1e48);}_0x2b6617[_0x49c4('0x13a')]=!![];loggerBooked[_0x49c4('0x84')]('[booked][unlockQueueStatus]',_0x3e1e48,JSON[_0x49c4('0x4c')](_[_0x49c4('0xd6')](_0x2b6617,[_0x49c4('0x40'),_0x49c4('0x13a')])));},0x1f3);}Dialer[_0x49c4('0x1d')]['syncQueueStatusComplete']=function(_0xbd96eb){var _0x2122e0=this;var _0x485c2d=_0x2122e0[_0x49c4('0x21')][_0x2122e0['actions'][_0xbd96eb[_0x49c4('0x134')]]['queue']];if(strategy[this[_0x49c4('0x21')][this[_0x49c4('0x27')][_0xbd96eb['actionid']][_0x49c4('0xb9')]]['strategy']]===_0x49c4('0x1c')){if(this[_0x49c4('0x27')][_0xbd96eb[_0x49c4('0x134')]]&&this[_0x49c4('0x27')][_0xbd96eb[_0x49c4('0x134')]]['stateinterface']){this[_0x49c4('0x98')][_0x49c4('0x13c')](this[_0x49c4('0x27')][_0xbd96eb[_0x49c4('0x134')]][_0x49c4('0x139')],this[_0x49c4('0x27')][_0xbd96eb[_0x49c4('0x134')]][_0x49c4('0x136')])['catch'](function(_0x428b20){logger[_0x49c4('0x9f')](_0x49c4('0x13d'),util[_0x49c4('0x9e')](_0x428b20,{'showHidden':![],'depth':null}));})[_0x49c4('0x1f')](function(){_0x2122e0[_0x49c4('0xb8')](_0x2122e0[_0x49c4('0x21')][_0x2122e0[_0x49c4('0x27')][_0xbd96eb[_0x49c4('0x134')]][_0x49c4('0xb9')]]);_0x2122e0[_0x49c4('0x23')][_0x2122e0[_0x49c4('0x27')][_0xbd96eb['actionid']][_0x49c4('0x136')]]['locked']=![];delete _0x2122e0[_0x49c4('0x27')][_0xbd96eb[_0x49c4('0x134')]];unlockQueueStatus(_0x485c2d);});}else{this[_0x49c4('0xb8')](this[_0x49c4('0x21')][this[_0x49c4('0x27')][_0xbd96eb[_0x49c4('0x134')]][_0x49c4('0xb9')]]);this[_0x49c4('0xc4')]({'active':![],'ContactId':this[_0x49c4('0x27')][_0xbd96eb[_0x49c4('0x134')]][_0x49c4('0xd7')],'ListId':this[_0x49c4('0x27')][_0xbd96eb[_0x49c4('0x134')]][_0x49c4('0x108')],'VoiceQueueId':this[_0x49c4('0x27')][_0xbd96eb['actionid']][_0x49c4('0xd9')]||undefined,'CampaignId':this[_0x49c4('0x27')][_0xbd96eb['actionid']][_0x49c4('0xda')]||undefined})['catch'](loggerCatch(_0x49c4('0x13e')));delete this[_0x49c4('0x27')][_0xbd96eb[_0x49c4('0x134')]];unlockQueueStatus(_0x485c2d);}}else if((strategy[this[_0x49c4('0x21')][this[_0x49c4('0x27')][_0xbd96eb['actionid']]['queue']][_0x49c4('0x53')]]||_0x49c4('0x1b'))===_0x49c4('0x1b')){var _0x54659b;if(this[_0x49c4('0x27')][_0xbd96eb[_0x49c4('0x134')]]&&!_['isEmpty'](this[_0x49c4('0x138')][this['actions'][_0xbd96eb['actionid']]['queue']])){if(this[_0x49c4('0x2c')][_0x2122e0[_0x49c4('0x27')][_0xbd96eb[_0x49c4('0x134')]][_0x49c4('0xb9')]]){this[_0x49c4('0x2c')][_0x2122e0['actions'][_0xbd96eb[_0x49c4('0x134')]][_0x49c4('0xb9')]]=this[_0x49c4('0x2c')][this['actions'][_0xbd96eb[_0x49c4('0x134')]][_0x49c4('0xb9')]]?this[_0x49c4('0x2c')][this[_0x49c4('0x27')][_0xbd96eb[_0x49c4('0x134')]][_0x49c4('0xb9')]]:this[_0x49c4('0x138')][this[_0x49c4('0x27')][_0xbd96eb[_0x49c4('0x134')]][_0x49c4('0xb9')]]?this[_0x49c4('0x138')][this['actions'][_0xbd96eb[_0x49c4('0x134')]][_0x49c4('0xb9')]][_0x49c4('0x13f')]||0x0:0x0;}this[_0x49c4('0x138')][this[_0x49c4('0x27')][_0xbd96eb[_0x49c4('0x134')]][_0x49c4('0xb9')]]['_rr']=this[_0x49c4('0x2c')][this['actions'][_0xbd96eb[_0x49c4('0x134')]]['queue']];for(var _0x4a35a3=0x0;_0x4a35a3=0x0;})[_0x49c4('0xb6')](myreject(_0x5684ce)));}}else{_0xfcf36d[_0x49c4('0x152')](ami['Action']({'action':_0x49c4('0x153'),'command':util[_0x49c4('0x7f')]('iftime\x20%s,%s',_0x5b1985,!_[_0x49c4('0x3e')](config[_0x49c4('0x14f')][_0x4ac47c])?_0x4ac47c:'')})[_0x49c4('0xbf')](function(_0x6dd9ca){return _0x6dd9ca['content'][_0x49c4('0x157')]('true')>=0x0;})[_0x49c4('0xb6')](myreject(_0x5684ce)));}BPromise['all'](_0xfcf36d)[_0x49c4('0xbf')](function(_0x12f947){var _0x467370=_[_0x49c4('0x159')](_0x12f947);if(_0x467370){return _0x1b8dfb(_0x467370);}else{_0x27eeda[_0x49c4('0x42')]=_0x456307?_0x49c4('0x15a'):_0x49c4('0x15b');return _0x5684ce(msgResponse(_0x49c4('0x15c'),_0x49c4('0x14d'),_0x49c4('0x15d')+_0x456307+'\x20'+_0x21dd6d+_0x49c4('0x15e')+util['inspect'](_0x5b1985,{'showHidden':![],'depth':null})+_0x49c4('0x15f')+_0x4ac47c));}})['catch'](function(_0x377592){return _0x5684ce(msgResponse(_0x49c4('0x14a'),_0x49c4('0x14d'),JSON[_0x49c4('0x4c')](_0x377592)));});});};Dialer[_0x49c4('0x1d')][_0x49c4('0x160')]=function(_0x1fc936){var _0x3827c1=this;return function(){switch(_0x1fc936[_0x49c4('0x60')]){case _0x49c4('0x161'):freeVariablesPredictive(_0x1fc936);_0x3827c1[_0x49c4('0x162')](_0x1fc936,0x1);break;case _0x49c4('0x163'):freeVariablesPredictive(_0x1fc936);_0x3827c1[_0x49c4('0x162')](_0x1fc936,_0x1fc936[_0x49c4('0x164')]);break;case _0x49c4('0x9'):_0x3827c1['predictive'](_0x1fc936);break;case _0x49c4('0x7'):freeVariablesPredictive(_0x1fc936);_0x3827c1['handlePower'](_0x1fc936,0x1);break;default:freeVariablesPredictive(_0x1fc936);logger['error']('Queue',_0x1fc936[_0x49c4('0x40')],_0x49c4('0x165'));}};};Dialer[_0x49c4('0x1d')][_0x49c4('0x166')]=function(_0x3ec261){var _0x55ed90=this;return function(){_0x55ed90['handleIvr'](_0x3ec261);};};Dialer[_0x49c4('0x1d')][_0x49c4('0xb')]=function(_0x558304){var _0x17e278=this;if(isNotPreview(_0x558304[_0x49c4('0x60')])){if(isVoiceQueueOutbound(_0x558304[_0x49c4('0x51')])&&isActive(_0x558304[_0x49c4('0x5f')])){_0x558304[_0x49c4('0xa7')]=!![];BPromise[_0x49c4('0xbe')]()[_0x49c4('0xbf')](checkIsLoggedIn(_0x558304,_0x558304[_0x49c4('0x56')]))[_0x49c4('0xbf')](checkIsActive(_0x558304,_0x558304[_0x49c4('0x5f')]))[_0x49c4('0xbf')](checkInterval(_0x558304))['then'](_0x17e278[_0x49c4('0x167')](_0x558304))[_0x49c4('0xbf')](_0x17e278['checkIfTime'](_0x558304[_0x49c4('0x168')],_0x558304[_0x49c4('0x169')],_0x558304[_0x49c4('0x40')],_0x558304))[_0x49c4('0xbf')](_0x17e278[_0x49c4('0x16a')](_0x558304[_0x49c4('0x49')],_0x558304[_0x49c4('0x169')],_0x558304[_0x49c4('0x40')],_0x558304))[_0x49c4('0xbf')](_0x17e278[_0x49c4('0x160')](_0x558304))[_0x49c4('0xb6')](loggerCatchQueueSummary(_0x49c4('0x16b'),_0x558304));}else{notSendMessagesQueue(_0x558304);}}else{freeVariablesPredictive(_0x558304);}};Dialer[_0x49c4('0x1d')][_0x49c4('0x16c')]=_[_0x49c4('0x16d')](function(){var _0x17a1be=_['filter'](this[_0x49c4('0x21')],function(_0x47b50c){return _0x47b50c[_0x49c4('0x16e')];});var _0x49dd6d=_[_0x49c4('0x16f')](this[_0x49c4('0x23')],function(_0x4d86ba){return _0x4d86ba['online']&&_0x4d86ba[_0x49c4('0xb4')]===_0x49c4('0xe0');});if(_0x17a1be['length']>0x0&&_0x49dd6d[_0x49c4('0xa1')]>0x0){return BPromise[_0x49c4('0xbe')]()[_0x49c4('0xbf')](cmHopper['handlePreviewRecallNotifications'](_[_0x49c4('0x170')](_0x17a1be,'id'),previewRecallmeReminderInterval,_[_0x49c4('0x170')](_0x49dd6d,'id')))[_0x49c4('0xbf')](function(_0x4add25){for(var _0x116f71=0x0;_0x116f71<_0x4add25['length'];_0x116f71++){var _0x1526d7=_0x4add25[_0x116f71][_0x49c4('0x171')][_0x49c4('0x40')];if(_0x1526d7)io['to'](util[_0x49c4('0x7f')](_0x49c4('0x172'),_0x1526d7))[_0x49c4('0x50')](_0x49c4('0x173'),{'hopper':_0x4add25[_0x116f71]});}})[_0x49c4('0xb6')](function(_0x46eba5){logger[_0x49c4('0x9f')]('checkPreviewRecallReminder',_0x46eba5);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype'][_0x49c4('0x148')]=function(){var _0x3bbfc4=this;var _0x1ac600;for(var _0x1dfddf in this[_0x49c4('0x22')]){if(typeof this[_0x49c4('0x22')][_0x1dfddf]!=='undefined'){_0x1ac600=this[_0x49c4('0x22')][_0x1dfddf];if(isCampaignIvr(_0x1ac600['type'])&&isActive(_0x1ac600[_0x49c4('0x7e')])){_0x1ac600[_0x49c4('0xa7')]=!![];BPromise[_0x49c4('0xbe')]()[_0x49c4('0xbf')](checkIsActive(_0x1ac600,_0x1ac600['active']))[_0x49c4('0xbf')](checkInterval(_0x1ac600))[_0x49c4('0xbf')](_0x3bbfc4['checkIsTrunkReachable'](_0x1ac600))[_0x49c4('0xbf')](_0x3bbfc4[_0x49c4('0x174')](_0x1ac600['dialGlobalInterval'],_0x1ac600['dialTimezone'],_0x1ac600['name'],_0x1ac600))[_0x49c4('0xbf')](_0x3bbfc4[_0x49c4('0x16a')](_0x1ac600[_0x49c4('0x49')],_0x1ac600[_0x49c4('0x169')],_0x1ac600['name'],_0x1ac600))[_0x49c4('0xbf')](_0x3bbfc4[_0x49c4('0x166')](_0x1ac600))[_0x49c4('0xb6')](loggerCatchQueueSummary(_0x49c4('0x175'),_0x1ac600));}else{notSendMessagesCampaign(_0x1ac600);}}}};function getCallerIdRandom(_0x3593df,_0x3c3150){var _0x3a9a51;var _0xa14085;var _0x4d9c7d;if(_0x3c3150<=0x0){_0x3c3150=0x1;}_0x3a9a51=new RegExp('\x5cw{0,'+_0x3c3150+'}$');_0xa14085=Math[_0x49c4('0x176')](0xa,_0x3c3150-0x1);_0x4d9c7d=Math[_0x49c4('0x176')](0xa,_0x3c3150)-0x1;return util['format']('%s',_['replace'](_0x3593df,_0x3a9a51,_[_0x49c4('0x177')](_0xa14085,_0x4d9c7d)));}function extractCalleridName(_0x38c9c5){var _0x2d5b14=_0x38c9c5[_0x49c4('0x178')](/"(.*?)"/);return _0x2d5b14?_0x2d5b14[0x1]:_0x38c9c5;}function extractCalleridNumber(_0x33a5f9){var _0x299d2d=_0x33a5f9['match'](/<(.*?)>/);return _0x299d2d?_0x299d2d[0x1]:_0x33a5f9;}Dialer[_0x49c4('0x1d')][_0x49c4('0x179')]=function(_0x4f5bbb,_0x3c0d96){var _0xe880b3=this;var _0x4cd867=uuid['v4']();this[_0x49c4('0x27')][_0x4cd867]=new Action(_0x4f5bbb,_0x3c0d96,_0x4cd867);return new BPromise(function(_0x1c352f,_0x5c6df3){if(_[_0x49c4('0x3e')](_0x4f5bbb)&&typeof _0x4f5bbb!==_0x49c4('0x17a')){return _0x5c6df3(msgResponse('originate',_0x49c4('0x14d'),_0x49c4('0x17b')));}if(_['isUndefined'](_0x3c0d96[_0x49c4('0x17c')])||_0x3c0d96[_0x49c4('0x17c')]===null){return _0x5c6df3(msgResponse(_0x49c4('0x17d'),_0x49c4('0x14d'),'contact\x20is\x20undefine'));}var _0x3d28a3={'XMD-CALLERID':_0xe880b3[_0x49c4('0x27')][_0x4cd867][_0x49c4('0x17e')](),'XMD-AGI':_0x4f5bbb[_0x49c4('0x10e')]?util[_0x49c4('0x7f')]('\x22agi://%s/square,%s\x22',ipAgi,_0x4f5bbb['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x4f5bbb[_0x49c4('0x116')]?util[_0x49c4('0x7f')](_0x49c4('0x17f'),ipAgi,_0x4f5bbb[_0x49c4('0x116')]):_0x49c4('0x180'),'XMD-QUEUE':_0x4f5bbb[_0x49c4('0x51')]===_0x49c4('0x52')?util[_0x49c4('0x7f')](_0x49c4('0x181'),_0x4f5bbb[_0x49c4('0x40')],_0x4f5bbb['dialQueueOptions']||'',_0x4f5bbb[_0x49c4('0x117')]?'c':'',_0x4f5bbb[_0x49c4('0x182')]||0x3):_0x49c4('0x180'),'XMD-CONTACTID':_0x3c0d96[_0x49c4('0xd7')],'XMD-CDRTYPE':_0x49c4('0x6'),'CALLERID(all)':_0xe880b3[_0x49c4('0x27')][_0x4cd867][_0x49c4('0x17e')](),'XMD-AMD':_0x4f5bbb[_0x49c4('0xe7')]?_0x49c4('0x183'):_0x49c4('0x180'),'XMD-DESTINATION':_0x49c4('0x184')};if(_0x4f5bbb['dialAMDActive']){_0x3d28a3[_0x49c4('0x185')]=_0x4f5bbb[_0x49c4('0x186')]||0x9c4;_0x3d28a3['XMD-AMDGREETING']=_0x4f5bbb['dialAMDGreeting']||0x5dc;_0x3d28a3[_0x49c4('0x187')]=_0x4f5bbb[_0x49c4('0x188')]||0x320;_0x3d28a3[_0x49c4('0x189')]=_0x4f5bbb[_0x49c4('0x18a')]||0x1388;_0x3d28a3['XMD-AMDMINWORDLENGTH']=_0x4f5bbb[_0x49c4('0x18b')]||0x64;_0x3d28a3['XMD-AMDBETWEENWORDSSILENCE']=_0x4f5bbb[_0x49c4('0x18c')]||0x32;_0x3d28a3[_0x49c4('0x18d')]=_0x4f5bbb[_0x49c4('0x18e')]||0x3;_0x3d28a3[_0x49c4('0x18f')]=_0x4f5bbb[_0x49c4('0x190')]||0x100;_0x3d28a3['XMD-AMDMAXIMUMWORDLENGTH']=_0x4f5bbb['dialAMDMaximumWordLength']||0x1388;}if(_0x4f5bbb[_0x49c4('0x51')]===_0x49c4('0x52')){_0x3d28a3['XMD-VOICEQUEUEID']=_0x3c0d96['VoiceQueueId'];}else{_0x3d28a3['XMD-CAMPAIGNID']=_0x3c0d96[_0x49c4('0xda')];}for(var _0x249170 in _0x3c0d96[_0x49c4('0x191')]){if(typeof _0x3c0d96['Contact'][_0x249170]!==_0x49c4('0xa2')){if(isNotNull(_0x3c0d96[_0x49c4('0x191')][_0x249170])&&_0x249170!=='id'&&_0x249170!==_0x49c4('0x192')&&_0x249170!==_0x49c4('0x193')&&_0x249170!==_0x49c4('0x194')){_0x3d28a3[util['format'](_0x49c4('0x195'),_0x49c4('0x196'),_[_0x49c4('0x197')](_0x249170))]=_0x3c0d96['Contact'][_0x249170];}}}var _0x3880ad=_0xe880b3[_0x49c4('0xde')](_0x4f5bbb[_0x49c4('0x7d')])?getCallerId(_0x4f5bbb[_0x49c4('0x7d')]['callerid'],_0x4f5bbb[_0x49c4('0x61')],_0x4f5bbb[_0x49c4('0x198')]>0x0?getCallerIdRandom(_0x4f5bbb[_0x49c4('0x199')],_0x4f5bbb['dialRandomLastDigitCallerIdNumber']):_0x4f5bbb[_0x49c4('0x199')]):getCallerId(_['isNil'](_0x4f5bbb[_0x49c4('0x19a')])?_0x4f5bbb['Trunk'][_0x49c4('0x19b')]:_0x4f5bbb[_0x49c4('0x19a')][_0x49c4('0x19b')],_0x4f5bbb['dialOriginateCallerIdName'],_0x4f5bbb[_0x49c4('0x198')]>0x0?getCallerIdRandom(_0x4f5bbb[_0x49c4('0x199')],_0x4f5bbb['dialRandomLastDigitCallerIdNumber']):_0x4f5bbb['dialOriginateCallerIdNumber']);if(_0x3880ad){_0x3d28a3[_0x49c4('0x19c')]=_0xe880b3[_0x49c4('0x27')][_0x4cd867]['originatecalleridname']=extractCalleridName(_0x3880ad);_0x3d28a3[_0x49c4('0x19d')]=_0x3c0d96[_0x49c4('0x17c')];}return ami['Action']({'actionid':_0x4cd867,'action':_0x49c4('0x17d'),'channel':_0xe880b3[_0x49c4('0xde')](_0x4f5bbb[_0x49c4('0x7d')])?util[_0x49c4('0x7f')](_0x49c4('0x19e'),_0x4f5bbb[_0x49c4('0x7d')][_0x49c4('0x40')],isNotNull(_0x4f5bbb[_0x49c4('0x62')])?_0x4f5bbb[_0x49c4('0x62')][_0x49c4('0x19f')]()||'':'',_0x4f5bbb[_0x49c4('0x1a0')]>0x0?_0x3c0d96[_0x49c4('0x17c')][_0x49c4('0x1a1')](_0x4f5bbb['dialCutDigit']):_0x3c0d96[_0x49c4('0x17c')]):util['format']('SIP/%s/%s%s',_[_0x49c4('0xb2')](_0x4f5bbb[_0x49c4('0x19a')])?_0x4f5bbb['Trunk'][_0x49c4('0x40')]:_0x4f5bbb[_0x49c4('0x19a')][_0x49c4('0x40')],isNotNull(_0x4f5bbb[_0x49c4('0x62')])?_0x4f5bbb[_0x49c4('0x62')][_0x49c4('0x19f')]()||'':'',_0x4f5bbb[_0x49c4('0x1a0')]>0x0?_0x3c0d96['phone'][_0x49c4('0x1a1')](_0x4f5bbb[_0x49c4('0x1a0')]):_0x3c0d96[_0x49c4('0x17c')]),'callerid':_0x3880ad,'Exten':_0x49c4('0x184'),'Context':_0x49c4('0x1a2'),'Priority':'1','variable':_0x3d28a3,'timeout':(_0x4f5bbb[_0x49c4('0x1a3')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4cd867})[_0x49c4('0xbf')](function(_0x2d1f54){return _0x1c352f(_0x2d1f54);})[_0x49c4('0xb6')](function(_0x5c166e){_0x4f5bbb[_0x49c4('0x6c')]+=0x1;var _0xcb1169=new History(_0xe880b3[_0x49c4('0x27')][_0x4cd867]);logger[_0x49c4('0x9f')](util[_0x49c4('0x7f')](_0x49c4('0x1a4'),JSON[_0x49c4('0x4c')](_0x5c166e)));_0xcb1169['state']=0xe;_0xcb1169[_0x49c4('0xe9')]='OriginateError';_0xcb1169[_0x49c4('0xae')]=moment()[_0x49c4('0x7f')](_0x49c4('0xff'));_0xcb1169[_0x49c4('0x12a')]=_0xcb1169[_0x49c4('0xae')];_0xe880b3[_0x49c4('0xd1')](_0xcb1169)['catch'](loggerCatch('[originate][error]'));_0xe880b3['moveContactManagedDialer'](_0xcb1169)[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x1a5')))[_0x49c4('0x1f')](function(){delete _0xe880b3[_0x49c4('0x27')][_0x4cd867];return _0x5c6df3(msgResponse('originate','Error',_0x49c4('0x1a6')));});});});};Dialer['prototype'][_0x49c4('0x1a7')]=function(_0xdb57b7){var _0x5ea0e0=this[_0x49c4('0x27')][_0xdb57b7[_0x49c4('0x134')]];if(_0x5ea0e0){delete this['actions'][_0xdb57b7['actionid']];_0x5ea0e0[_0x49c4('0x11e')]=moment()['format'](_0x49c4('0xff'));var _0x5a7815=_0x5ea0e0[_0x49c4('0x51')]===_0x49c4('0x99')?this[_0x49c4('0x22')][_0x5ea0e0[_0x49c4('0xb9')]]:this[_0x49c4('0x21')][_0x5ea0e0['getQueue']()];if(!this[_0x49c4('0xdd')](_0xdb57b7[_0x49c4('0x1a8')])){this[_0x49c4('0xb8')](_0x5a7815);return this['callProgressDetecting'](_0x5ea0e0,_0x5a7815,_0xdb57b7)[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x1a9')));}this['uniqueId'][_0xdb57b7[_0x49c4('0xe3')]]=_0x5ea0e0;}};Dialer[_0x49c4('0x1d')][_0x49c4('0x1aa')]=function(_0x490963,_0x42e852,_0x3e4764){var _0x1d49c8=new History(_0x42e852);if(_0x1d49c8[_0x49c4('0x1ab')]+_0x1d49c8['countcongestionretry']+_0x1d49c8[_0x49c4('0x104')]+_0x1d49c8[_0x49c4('0x105')]+_0x1d49c8[_0x49c4('0xf5')]+_0x1d49c8['countabandonedretry']+_0x1d49c8[_0x49c4('0xf7')]+_0x1d49c8['countagentrejectretry']>=_0x3e4764[_0x49c4('0xf8')]-0x1){return!![];}switch(_0x490963){case 0x3:if(_0x1d49c8[_0x49c4('0x104')]>=_0x3e4764['dialNoAnswerMaxRetry']-0x1){return!![];}this[_0x49c4('0xc4')]({'active':![],'countnoanswerretry':_0x1d49c8[_0x49c4('0x104')]+=0x1,'scheduledat':moment()[_0x49c4('0x128')](_0x3e4764['dialNoAnswerRetryFrequency'],_0x49c4('0xfe'))[_0x49c4('0x7f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1d49c8[_0x49c4('0xd7')],'ListId':_0x1d49c8[_0x49c4('0x108')],'VoiceQueueId':_0x1d49c8['VoiceQueueId']||undefined,'CampaignId':_0x1d49c8[_0x49c4('0xda')]||undefined})[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x1ac')));break;case 0x5:if(_0x1d49c8[_0x49c4('0x1ab')]>=_0x3e4764[_0x49c4('0x1ad')]-0x1){return!![];}this[_0x49c4('0xc4')]({'active':![],'countbusyretry':_0x1d49c8[_0x49c4('0x1ab')]+=0x1,'scheduledat':moment()[_0x49c4('0x128')](_0x3e4764['dialBusyRetryFrequency'],'minutes')[_0x49c4('0x7f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1d49c8[_0x49c4('0xd7')],'ListId':_0x1d49c8[_0x49c4('0x108')],'VoiceQueueId':_0x1d49c8[_0x49c4('0xd9')]||undefined,'CampaignId':_0x1d49c8[_0x49c4('0xda')]||undefined})['catch'](loggerCatch(_0x49c4('0x1ae')));break;case 0x8:if(_0x1d49c8[_0x49c4('0xf4')]>=_0x3e4764[_0x49c4('0x1af')]-0x1){return!![];}this[_0x49c4('0xc4')]({'active':![],'countcongestionretry':_0x1d49c8[_0x49c4('0xf4')]+=0x1,'scheduledat':moment()[_0x49c4('0x128')](_0x3e4764[_0x49c4('0x1b0')],'minutes')['format'](_0x49c4('0xff')),'ContactId':_0x1d49c8[_0x49c4('0xd7')],'ListId':_0x1d49c8[_0x49c4('0x108')],'VoiceQueueId':_0x1d49c8[_0x49c4('0xd9')]||undefined,'CampaignId':_0x1d49c8[_0x49c4('0xda')]||undefined})[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x1b1')));break;case 0x0:if(_0x1d49c8[_0x49c4('0x105')]>=_0x3e4764[_0x49c4('0x1b2')]-0x1){return!![];}else{this[_0x49c4('0xc4')]({'active':![],'countnosuchnumberretry':_0x1d49c8[_0x49c4('0x105')]+=0x1,'scheduledat':moment()[_0x49c4('0x128')](_0x3e4764[_0x49c4('0x1b3')],'minutes')[_0x49c4('0x7f')](_0x49c4('0xff')),'ContactId':_0x1d49c8[_0x49c4('0xd7')],'ListId':_0x1d49c8[_0x49c4('0x108')],'VoiceQueueId':_0x1d49c8[_0x49c4('0xd9')]||undefined,'CampaignId':_0x1d49c8[_0x49c4('0xda')]||undefined})[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x1b4')));}break;case 0xa:if(_0x1d49c8[_0x49c4('0xf5')]>=_0x3e4764[_0x49c4('0x127')]-0x1){return!![];}this[_0x49c4('0xc4')]({'active':![],'countdropretry':_0x1d49c8[_0x49c4('0xf5')]+=0x1,'scheduledat':moment()[_0x49c4('0x128')](_0x3e4764[_0x49c4('0x122')],_0x49c4('0xfe'))[_0x49c4('0x7f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1d49c8[_0x49c4('0xd7')],'ListId':_0x1d49c8[_0x49c4('0x108')],'VoiceQueueId':_0x1d49c8[_0x49c4('0xd9')]||undefined,'CampaignId':_0x1d49c8[_0x49c4('0xda')]||undefined})[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x129')));break;case 0xb:if(_0x1d49c8['countabandonedretry']>=_0x3e4764['dialAbandonedMaxRetry']-0x1){return!![];}this[_0x49c4('0xc4')]({'active':![],'countabandonedretry':_0x1d49c8[_0x49c4('0xf6')]+=0x1,'scheduledat':moment()[_0x49c4('0x128')](_0x3e4764[_0x49c4('0x12f')],_0x49c4('0xfe'))[_0x49c4('0x7f')](_0x49c4('0xff')),'ContactId':_0x1d49c8[_0x49c4('0xd7')],'ListId':_0x1d49c8['ListId'],'VoiceQueueId':_0x1d49c8['VoiceQueueId']||undefined,'CampaignId':_0x1d49c8[_0x49c4('0xda')]||undefined})['catch'](loggerCatch(_0x49c4('0x131')));break;case 0x13:if(_0x1d49c8[_0x49c4('0xf7')]>=_0x3e4764[_0x49c4('0xfa')]-0x1){return!![];}this[_0x49c4('0xc4')]({'active':![],'countmachineretry':_0x1d49c8['countmachineretry']+=0x1,'scheduledat':moment()[_0x49c4('0x128')](_0x3e4764[_0x49c4('0xfd')],_0x49c4('0xfe'))['format'](_0x49c4('0xff')),'ContactId':_0x1d49c8[_0x49c4('0xd7')],'ListId':_0x1d49c8[_0x49c4('0x108')],'VoiceQueueId':_0x1d49c8[_0x49c4('0xd9')]||undefined,'CampaignId':_0x1d49c8[_0x49c4('0xda')]||undefined})[_0x49c4('0xb6')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x1d49c8[_0x49c4('0x106')]>=_0x3e4764['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0x49c4('0xc4')]({'active':![],'countagentrejectretry':_0x1d49c8[_0x49c4('0x106')]+=0x1,'scheduledat':moment()['add'](_0x3e4764['dialAgentRejectRetryFrequency'],_0x49c4('0xfe'))['format'](_0x49c4('0xff')),'ContactId':_0x1d49c8[_0x49c4('0xd7')],'ListId':_0x1d49c8[_0x49c4('0x108')],'VoiceQueueId':_0x1d49c8[_0x49c4('0xd9')]||undefined,'CampaignId':_0x1d49c8[_0x49c4('0xda')]||undefined})[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x1b5')));break;default:return!![];}};Dialer[_0x49c4('0x1d')][_0x49c4('0x1b6')]=function(_0x3d605c,_0x410df1,_0x58cc6d){var _0x23e4ff=this;var _0x3733ed=new History(_0x3d605c);var _0x34792d=![];var _0x4c8afb;var _0x231fbf;return new BPromise(function(_0x229b49,_0x3c68bc){if(_['isUndefined'](_0x410df1)&&typeof _0x410df1!=='object'){return _0x3c68bc(msgResponse('[callProgressDetecting]',_0x49c4('0x14d'),_0x49c4('0x1b7')));}if(_[_0x49c4('0x3e')](_0x58cc6d)&&typeof _0x58cc6d!==_0x49c4('0x17a')){return _0x3c68bc(msgResponse('[callProgressDetecting]',_0x49c4('0x14d'),_0x49c4('0x1b8')));}_0x23e4ff[_0x49c4('0x124')](_0x3733ed,_0x58cc6d[_0x49c4('0x113')],_0x410df1)[_0x49c4('0xbf')](function(_0x436020){if(_0x436020[_0x49c4('0x126')]==0x1)_0x34792d=!![];switch(_0x58cc6d['reason']){case'0':_0x410df1[_0x49c4('0x6b')]+=0x1;_0x3733ed[_0x49c4('0xad')]=0x0;_0x3733ed['statedesc']=_0x49c4('0x1b9');_0x3733ed['countnosuchnumberretry']+=0x1;_0x3733ed[_0x49c4('0xf1')]+=0x1;ami[_0x49c4('0x50')](_0x49c4('0x1ba'),ut[_0x49c4('0xed')](_0x3d605c,'nosuchnumber'));_0x4c8afb=_0x410df1['dialNoSuchNumberRetryFrequency'];_0x231fbf=_0x410df1[_0x49c4('0x123')];_0x23e4ff['createHistory'](_0x3733ed)['catch'](loggerCatch(_0x49c4('0xf3')));if(_0x23e4ff[_0x49c4('0x1aa')](0x0,_0x3d605c,_0x410df1)&&!_0x34792d){if(_0x3733ed[_0x49c4('0x105')]>=_0x410df1[_0x49c4('0x1b2')]){_0x23e4ff[_0x49c4('0xfb')](_0x3733ed,_0x229b49,_0x3c68bc,'reason\x200\x20no\x20such\x20number....');}else{_0x23e4ff['stateGlobal'](_0x3733ed,_0x229b49,_0x3c68bc,_0x49c4('0x1bb'));}}break;case'3':_0x410df1[_0x49c4('0x6a')]+=0x1;_0x3733ed[_0x49c4('0xad')]=0x3;_0x3733ed['statedesc']=_0x49c4('0x1bc');_0x3733ed[_0x49c4('0x104')]+=0x1;_0x3733ed['countglobal']+=0x1;ami[_0x49c4('0x50')](_0x49c4('0x1bd'),ut['buildObj'](_0x3d605c,_0x49c4('0x1be')));_0x4c8afb=_0x410df1[_0x49c4('0x1bf')];_0x231fbf=_0x410df1[_0x49c4('0x123')];_0x23e4ff['createHistory'](_0x3733ed)[_0x49c4('0xb6')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x23e4ff[_0x49c4('0x1aa')](0x3,_0x3d605c,_0x410df1)&&!_0x34792d){if(_0x3733ed[_0x49c4('0x104')]>=_0x410df1['dialNoAnswerMaxRetry']){_0x23e4ff[_0x49c4('0xfb')](_0x3733ed,_0x229b49,_0x3c68bc,_0x49c4('0x1c0'));}else{_0x23e4ff[_0x49c4('0x107')](_0x3733ed,_0x229b49,_0x3c68bc,_0x49c4('0x1c0'));}}break;case'5':_0x410df1['outboundBusyCallsDay']+=0x1;_0x3733ed[_0x49c4('0xad')]=0x5;_0x3733ed['statedesc']=_0x49c4('0x1c1');_0x3733ed[_0x49c4('0x1ab')]+=0x1;_0x3733ed[_0x49c4('0xf1')]+=0x1;ami['emit']('custom:agentbusy',ut[_0x49c4('0xed')](_0x3d605c,_0x49c4('0x1c2')));_0x4c8afb=_0x410df1['dialBusyRetryFrequency'];_0x231fbf=_0x410df1[_0x49c4('0x123')];_0x23e4ff[_0x49c4('0xd1')](_0x3733ed)[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x1c3')));if(_0x23e4ff['checkRetriveMax'](0x5,_0x3d605c,_0x410df1)&&!_0x34792d){if(_0x3733ed['countbusyretry']>=_0x410df1['dialBusyMaxRetry']){_0x23e4ff[_0x49c4('0xfb')](_0x3733ed,_0x229b49,_0x3c68bc,_0x49c4('0x1c4'));}else{_0x23e4ff[_0x49c4('0x107')](_0x3733ed,_0x229b49,_0x3c68bc,_0x49c4('0x1c4'));}}break;case'8':_0x410df1[_0x49c4('0x66')]+=0x1;_0x3733ed[_0x49c4('0xad')]=0x8;_0x3733ed[_0x49c4('0xe9')]=_0x49c4('0x1c5');_0x3733ed[_0x49c4('0xf4')]+=0x1;_0x3733ed[_0x49c4('0xf1')]+=0x1;_0x4c8afb=_0x410df1[_0x49c4('0x1b0')];_0x231fbf=_0x410df1[_0x49c4('0x123')];ami[_0x49c4('0x50')](_0x49c4('0x1c6'),ut[_0x49c4('0xed')](_0x3d605c,_0x49c4('0x1c7')));_0x23e4ff[_0x49c4('0xd1')](_0x3733ed)['catch'](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x23e4ff[_0x49c4('0x1aa')](0x8,_0x3d605c,_0x410df1)&&!_0x34792d){if(_0x3733ed[_0x49c4('0xf4')]>=_0x410df1['dialCongestionMaxRetry']){_0x23e4ff[_0x49c4('0xfb')](_0x3733ed,_0x229b49,_0x3c68bc,_0x49c4('0x1c8'));}else{_0x23e4ff[_0x49c4('0x107')](_0x3733ed,_0x229b49,_0x3c68bc,_0x49c4('0x1c8'));}}break;case'11':_0x410df1[_0x49c4('0x1c9')]+=0x1;_0x3733ed[_0x49c4('0xad')]=0xb;_0x3733ed[_0x49c4('0xe9')]=_0x49c4('0x12d');_0x3733ed['countabandonedretry']+=0x1;_0x3733ed[_0x49c4('0xf1')]+=0x1;_0x4c8afb=_0x410df1[_0x49c4('0x12f')];_0x231fbf=_0x410df1['callAdditionalPhoneAfterMin'];_0x23e4ff[_0x49c4('0xd1')](_0x3733ed)['catch'](loggerCatch(_0x49c4('0x133')));if(_0x23e4ff[_0x49c4('0x1aa')](0xb,_0x3d605c,_0x410df1)&&!_0x34792d){if(_0x3733ed[_0x49c4('0xf6')]>=_0x410df1[_0x49c4('0x130')]){_0x23e4ff[_0x49c4('0xfb')](_0x3733ed,_0x229b49,_0x3c68bc,_0x49c4('0x1ca'));}else{_0x23e4ff['stateGlobal'](_0x3733ed,_0x229b49,_0x3c68bc,_0x49c4('0x1ca'));}}break;case'20':_0x410df1[_0x49c4('0x6e')]+=0x1;_0x3733ed['state']=0x14;_0x3733ed['statedesc']=_0x49c4('0x1cb');_0x3733ed[_0x49c4('0x106')]+=0x1;_0x3733ed[_0x49c4('0xf1')]+=0x1;_0x4c8afb=_0x410df1[_0x49c4('0x1cc')];_0x231fbf=_0x410df1[_0x49c4('0x123')];ami[_0x49c4('0x50')]('custom:agentreject',ut[_0x49c4('0xed')](_0x3d605c,_0x49c4('0x1cd')));_0x23e4ff['createHistory'](_0x3733ed)[_0x49c4('0xb6')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x23e4ff[_0x49c4('0x1aa')](0x14,_0x3d605c,_0x410df1)&&!_0x34792d){if(_0x3733ed[_0x49c4('0x106')]>=_0x410df1[_0x49c4('0x1ce')]){_0x23e4ff['createStateFinal'](_0x3733ed,_0x229b49,_0x3c68bc,_0x49c4('0x1cf'));}else{_0x23e4ff[_0x49c4('0x107')](_0x3733ed,_0x229b49,_0x3c68bc,_0x49c4('0x1cf'));}}break;default:_0x410df1[_0x49c4('0x10f')]+=0x1;_0x3733ed[_0x49c4('0xad')]=0xc;_0x3733ed[_0x49c4('0xe9')]=_0x58cc6d[_0x49c4('0x113')];_0x4c8afb=_0x410df1['dialAgentRejectRetryFrequency'];_0x231fbf=_0x410df1[_0x49c4('0x123')];_0x23e4ff['createHistory'](_0x3733ed)[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x1d0')));if(_0x23e4ff[_0x49c4('0x1aa')](_0x58cc6d[_0x49c4('0x113')],_0x3d605c,_0x410df1)&&!_0x34792d){if(_0x3733ed[_0x49c4('0x1ab')]+_0x3733ed[_0x49c4('0xf4')]+_0x3733ed['countnoanswerretry']+_0x3733ed[_0x49c4('0x105')]+_0x3733ed['countdropretry']+_0x3733ed[_0x49c4('0xf6')]+_0x3733ed[_0x49c4('0xf7')]+_0x3733ed[_0x49c4('0x106')]>=_0x410df1['dialGlobalMaxRetry']){_0x23e4ff[_0x49c4('0x107')](_0x3733ed,_0x229b49,_0x3c68bc,_0x58cc6d['reason']);}else{_0x23e4ff[_0x49c4('0xfb')](_0x3733ed,_0x229b49,_0x3c68bc,_0x58cc6d[_0x49c4('0x113')]);}}}})['then'](function(_0x2a4dfa){if(_0x34792d){_0x23e4ff[_0x49c4('0x12c')](_0x3733ed,_0x4c8afb,_0x231fbf)['then'](function(_0x35a39c){return _0x229b49(0x1);});}});});};Dialer[_0x49c4('0x1d')][_0x49c4('0x107')]=function(_0x3a3125,_0x3bf3a8,_0x2ad95f,_0xdd02ca){var _0x4ed899=new Final(_0x3a3125);_0x4ed899[_0x49c4('0xad')]=0xf;_0x4ed899[_0x49c4('0xe9')]='Global';this['createStateFinal'](_0x4ed899,_0x3bf3a8,_0x2ad95f,_0xdd02ca);};Dialer['prototype']['createStateFinal']=function(_0x424223,_0x114808,_0x291c51,_0x2841db){this[_0x49c4('0xcf')](_0x424223)['then'](function(){return _0x114808(msgResponse(_0x49c4('0x1d1'),'Success',_0x2841db));})[_0x49c4('0xb6')](function(){return _0x291c51(msgResponse(_0x49c4('0x1d2'),_0x49c4('0x14d'),'contact\x20not\x20moved'));});};Dialer[_0x49c4('0x1d')][_0x49c4('0x9')]=function(_0xa14512){var _0xe8849a=_0xa14512[_0x49c4('0x1d3')]/0x64;var _0x24dd7c=_0xa14512[_0x49c4('0x69')]/(_0xa14512[_0x49c4('0x69')]+_0xa14512['outboundAnswerCallsDay']);var _0x215003=Math[_0x49c4('0x1d4')](_0xa14512['predictiveIntervalAvailable']*(_0xa14512[_0x49c4('0x1d5')]/0x64));var _0x5585e8=Math['round'](_0xa14512[_0x49c4('0x77')]*(_0xa14512[_0x49c4('0x1d6')]/0x64));var _0x4a83fe=_0xa14512[_0x49c4('0x55')]+_0xa14512[_0x49c4('0x5b')];var _0x15f7a5=Math[_0x49c4('0x1d7')](_0xa14512[_0x49c4('0x7a')]*_0xa14512['erlangAbandonmentRate']*_0xa14512[_0x49c4('0x1d8')]*_0xa14512[_0x49c4('0x75')]);if(_[_0x49c4('0x3e')](_0xa14512['startProgressive'])){if(!_['isUndefined'](_0xa14512['startPredictive'])){_0xa14512[_0x49c4('0x2b')]=undefined;loggerPredictive['error']('[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x49c4('0x3e')](_0xa14512[_0x49c4('0x1d9')])){loggerPredictive[_0x49c4('0x9f')](_0x49c4('0x1da'),_0x49c4('0x1db'));clearInterval(_0xa14512['handlePredictive']);_0xa14512[_0x49c4('0x1d9')]=undefined;}_0xa14512[_0x49c4('0x7c')]=moment()[_0x49c4('0x7f')](_0x49c4('0xff'));loggerPredictive[_0x49c4('0x84')](_0xa14512[_0x49c4('0x40')],_0x49c4('0x1dc'),_0xa14512[_0x49c4('0x7c')]);this['handlePower'](_0xa14512,0x1);}else if(ifInterval(_0xa14512[_0x49c4('0x1dd')],_0xa14512[_0x49c4('0x7c')])){this[_0x49c4('0x162')](_0xa14512,0x1);loggerPredictiveCalls[_0x49c4('0x84')](_0x49c4('0x1de'),_0xa14512['startProgressive'],_0xa14512[_0x49c4('0x40')]);_0xa14512[_0x49c4('0x7a')]=0x0;_0xa14512[_0x49c4('0x74')]=0x0;}else if(_0xe8849a<_0x24dd7c&&_0xa14512['dialPredictiveOptimization']===_0x49c4('0x1df')){freeVariablesPredictive(_0xa14512);loggerPredictive[_0x49c4('0x84')](_0x49c4('0x1e0'),_0x49c4('0x1e1'),_0x24dd7c,_0x49c4('0x7c'),_0xa14512[_0x49c4('0x40')]);}else if(_0x15f7a5<_0xa14512[_0x49c4('0x74')]&&_0xa14512[_0x49c4('0x1e2')]===_0x49c4('0x1df')){freeVariablesPredictive(_0xa14512);loggerPredictive[_0x49c4('0x84')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x49c4('0x1e3'),_0x15f7a5,'Drop\x20in\x20this\x20interval',_0xa14512['predictiveIntervalErlangCallsDroppedCalls'],_0x49c4('0x7c'),_0xa14512[_0x49c4('0x40')]);}else if(!ifInterval(_0xa14512[_0x49c4('0x1dd')],_0xa14512[_0x49c4('0x7c')])&&_[_0x49c4('0x3e')](_0xa14512['startPredictive'])&&!_[_0x49c4('0x3e')](_0xa14512['startProgressive'])){_0xa14512[_0x49c4('0x2b')]=moment()['format'](_0x49c4('0xff'));loggerPredictive['info'](_0xa14512[_0x49c4('0x40')],'started\x20in\x20predictive\x20at',_0xa14512[_0x49c4('0x2b')]);this[_0x49c4('0xc2')](_0xa14512[_0x49c4('0x1dd')])[_0x49c4('0xbf')](this[_0x49c4('0x1e4')](_0xa14512))[_0x49c4('0xbf')](mergeDataErlangB(_0xa14512))['then'](this[_0x49c4('0x1e5')](_0xa14512))[_0x49c4('0xb6')](loggerCatchPredictive(_0x49c4('0x1e6'),_0xa14512));}else if(!ifInterval(_0xa14512['dialPredictiveInterval'],_0xa14512[_0x49c4('0x2b')])){_0xa14512[_0x49c4('0x74')]=0x0;_0xa14512['startPredictive']=moment()[_0x49c4('0x7f')](_0x49c4('0xff'));loggerPredictive[_0x49c4('0x84')](_0xa14512[_0x49c4('0x40')],_0x49c4('0x1e7'),_0xa14512[_0x49c4('0x2b')]);clearInterval(_0xa14512[_0x49c4('0x1d9')]);_0xa14512[_0x49c4('0x1d9')]=undefined;this['averageHandleTime'](_0xa14512['dialPredictiveInterval'])['then'](this[_0x49c4('0x1e4')](_0xa14512))[_0x49c4('0xbf')](mergeDataErlangB(_0xa14512))[_0x49c4('0xbf')](this[_0x49c4('0x1e5')](_0xa14512))[_0x49c4('0xb6')](loggerCatchPredictive(_0x49c4('0x1e8'),_0xa14512));}else if(_0xa14512['predictiveIntervalAvailable']&&_0x4a83fe<_0xa14512[_0x49c4('0x77')]-_0x5585e8){freeVariablesPredictive(_0xa14512);loggerPredictive['info'](_0xa14512['name'],_0x49c4('0x1e9'),_0x4a83fe,_0x49c4('0x1ea'),_0xa14512[_0x49c4('0x77')],'-',_0x5585e8,'=',_0xa14512[_0x49c4('0x77')]-_0x5585e8,')');}else if(_0xa14512[_0x49c4('0x77')]&&_0x4a83fe>_0xa14512['predictiveIntervalAvailable']+_0x215003){freeVariablesPredictive(_0xa14512);loggerPredictive[_0x49c4('0x84')](_0xa14512['name'],_0x49c4('0x1e9'),_0x4a83fe,_0x49c4('0x1eb'),_0xa14512[_0x49c4('0x77')],'+',_0x215003,'=',_0xa14512[_0x49c4('0x77')]+_0x215003,')');}};Dialer[_0x49c4('0x1d')][_0x49c4('0x1e4')]=function(_0x254d98){var _0x1e75a0=this;return function(_0x1b30fb){return new BPromise(function(_0x13a7bf,_0x37f980){_[_0x49c4('0x95')](_0x254d98,_0x1b30fb[0x0]);if(checkGetDataPredictive(_0x1b30fb[0x0])){var _0x5004b3=_0x254d98['predictiveIntervalAvailable']=_0x254d98[_0x49c4('0x5b')]+_0x254d98['available'];var _0x4c44cd=_0x254d98[_0x49c4('0x1dd')]*0x3c;var _0x3cd20d=_0x1b30fb[0x0][_0x49c4('0x70')]+_0x1b30fb[0x0][_0x49c4('0x89')];var _0xdcffa8=(_0x1b30fb[0x0][_0x49c4('0x6f')]+_0x1b30fb[0x0][_0x49c4('0x72')]+_0x1b30fb[0x0][_0x49c4('0x71')])/_0x1b30fb[0x0][_0x49c4('0x78')];_0x254d98['predictiveIntervalHitRate']=_0xdcffa8>0x0?_0xdcffa8:0x1;switch(_0x254d98['dialPredictiveOptimization']){case _0x49c4('0x1df'):var _0x365c1a=_0x254d98[_0x49c4('0x1d3')]/0x64;return _0x1e75a0[_0x49c4('0x1ec')](_0x5004b3,_0x4c44cd,_0x3cd20d,_0xdcffa8,_0x365c1a)[_0x49c4('0xbf')](function(_0xd41e54){return _0x13a7bf(_0xd41e54);});case _0x49c4('0x1ed'):var _0xe2bd2d=_0x254d98['dialPredictiveOptimizationPercentage']/0x64;return _0x1e75a0[_0x49c4('0x1ee')](_0x5004b3,_0x4c44cd,_0x3cd20d,_0xdcffa8,_0xe2bd2d)[_0x49c4('0xbf')](function(_0x321575){return _0x13a7bf(_0x321575);});default:return _0x37f980(msgResponse('[getDataPredictive]',_0x49c4('0x14d'),'Unknown\x20Predictive'));}}else{return _0x37f980(msgResponse(_0x49c4('0x1ef'),_0x49c4('0x14d'),_0x49c4('0x1f0')));}});};};Dialer[_0x49c4('0x1d')][_0x49c4('0x1f1')]=function(_0x938728){var _0x41b759=this;return function(_0x3382c4){return new BPromise(function(_0x30a351,_0x31d60a){_[_0x49c4('0x95')](_0x938728,_0x3382c4[0x0]);if(checkGetDataPredictive(_0x3382c4[0x0])){loggerPredictive[_0x49c4('0x84')](JSON[_0x49c4('0x4c')](_0x3382c4[0x0]));if(_0x938728['dialPredictiveOptimization']===_0x49c4('0x1df')){return _0x41b759[_0x49c4('0xcd')](_0x938728['id'])[_0x49c4('0xbf')](function(_0x5f42a6){var _0x522ed0=_0x938728[_0x49c4('0x56')]-_0x5f42a6[0x0][_0x49c4('0x1f2')];var _0x274a1e=_0x938728[_0x49c4('0x1dd')]*0x3c;var _0x4daf5d=_0x3382c4[0x0][_0x49c4('0x70')]+_0x3382c4[0x0]['predictiveIntervalAvgHoldtime'];var _0x29e866=(_0x3382c4[0x0][_0x49c4('0x6f')]+_0x3382c4[0x0][_0x49c4('0x72')]+_0x3382c4[0x0][_0x49c4('0x71')])/_0x3382c4[0x0][_0x49c4('0x78')];var _0x2b5d7d=_0x938728[_0x49c4('0x1d3')]/0x64;_0x938728[_0x49c4('0x76')]=_0x5f42a6[0x0][_0x49c4('0x1f2')]||0x0;_0x938728[_0x49c4('0x1d8')]=_0x29e866>0x0?_0x29e866:0x1;return _0x41b759[_0x49c4('0x1ec')](_0x522ed0,_0x274a1e,_0x4daf5d,_0x29e866,_0x2b5d7d);})[_0x49c4('0xbf')](function(_0x2dc805){return _0x30a351(_0x2dc805);})[_0x49c4('0xb6')](function(_0x1b18ea){return _0x31d60a(msgResponse(_0x49c4('0x1f3'),_0x49c4('0x14d'),JSON[_0x49c4('0x4c')](_0x1b18ea)));});}if(_0x938728[_0x49c4('0x1e2')]===_0x49c4('0x1ed')){return _0x41b759['getVoiceQueueRtPauses'](_0x938728['id'])[_0x49c4('0xbf')](function(_0x10c43a){var _0x388f69=_0x938728[_0x49c4('0x56')]-_0x10c43a[0x0][_0x49c4('0x1f2')];var _0x386863=_0x938728[_0x49c4('0x1dd')]*0x3c;var _0x27e9d4=_0x3382c4[0x0][_0x49c4('0x70')]+_0x3382c4[0x0][_0x49c4('0x89')];var _0x3c9770=(_0x3382c4[0x0]['predictiveIntervalAnsweredCalls']+_0x3382c4[0x0][_0x49c4('0x72')]+_0x3382c4[0x0][_0x49c4('0x71')])/_0x3382c4[0x0]['predictiveIntervalTotalCalls'];var _0x2c9cf7=_0x938728[_0x49c4('0x1d3')]/0x64;_0x938728[_0x49c4('0x76')]=_0x10c43a[0x0][_0x49c4('0x1f2')]||0x0;_0x938728[_0x49c4('0x1d8')]=_0x3c9770>0x0?_0x3c9770:0x1;return _0x41b759[_0x49c4('0x1ee')](_0x388f69,_0x386863,_0x27e9d4,_0x3c9770,_0x2c9cf7);})['then'](function(_0x58d166){return _0x30a351(_0x58d166);})[_0x49c4('0xb6')](function(_0x33624f){return _0x31d60a(msgResponse(_0x49c4('0x1f3'),'Failure',JSON[_0x49c4('0x4c')](_0x33624f)));});}}else{return _0x31d60a(msgResponse(_0x49c4('0x1ef'),'Failure','check\x20failure'));}});};};Dialer[_0x49c4('0x1d')][_0x49c4('0x1e5')]=function(_0x1c5c95){var _0x5c15ff=this;return function(){var _0x43207c=0x0;var _0xd69438=Math[_0x49c4('0x1d7')](_0x1c5c95['erlangCallToSecond']*0x3e8);if(_0xd69438>0x0){_0xd69438=_0xd69438<0x64?0x64:_0xd69438;loggerPredictive[_0x49c4('0x84')](_0x1c5c95[_0x49c4('0x40')],_0x49c4('0x1f4'),_0xd69438,_0x49c4('0x4d'));_0x1c5c95[_0x49c4('0x1d9')]=setInterval(function(){_0x5c15ff[_0x49c4('0x1d9')](_0x1c5c95);loggerPredictiveCalls[_0x49c4('0x84')]('[handlePredictive]',_0x43207c+=0x1);},_0xd69438);}else{loggerPredictive[_0x49c4('0x84')](_0x1c5c95['name'],_0x49c4('0x1f5'));}};};Dialer[_0x49c4('0x1d')][_0x49c4('0x1f6')]=function(_0x3d8453,_0x54e3ea){var _0x22afcd=this;return function(_0x5f575f){if(_[_0x49c4('0x48')](_0x5f575f)){if(_[_0x49c4('0xb2')](_0x54e3ea[_0x49c4('0xd8')])||!_0x54e3ea[_0x49c4('0x1f7')]){if(_0x3d8453[_0x49c4('0x60')]===_0x49c4('0x7')){_0x3d8453['queueStatusComplete']=_[_0x49c4('0x3e')](_0x3d8453[_0x49c4('0x13a')])?!![]:_0x3d8453[_0x49c4('0x13a')];var _0x9bd48b=uuid['v4']();_0x22afcd[_0x49c4('0x27')][_0x9bd48b]=new Action(_0x3d8453,_0x54e3ea,_0x9bd48b);loggerBooked['info'](_0x49c4('0x1f8'),_0x9bd48b,_0x49c4('0x1f9'),JSON[_0x49c4('0x4c')](_0x3d8453[_0x49c4('0x13a')]),_0x49c4('0x1fa'),_0x3d8453[_0x49c4('0x40')]);if(_0x3d8453[_0x49c4('0x13a')]){_0x3d8453[_0x49c4('0x13a')]=![];_0x22afcd['queueBooked'][_0x22afcd[_0x49c4('0x27')][_0x9bd48b][_0x49c4('0xb9')]]=[];ami[_0x49c4('0xb3')]({'actionid':_0x9bd48b,'action':_0x49c4('0x1fb'),'queue':_0x3d8453[_0x49c4('0x40')]})[_0x49c4('0xb6')](function(){_0x22afcd[_0x49c4('0xb8')](_0x3d8453);_0x22afcd[_0x49c4('0xc4')]({'active':![],'ContactId':_0x22afcd[_0x49c4('0x27')][_0x9bd48b][_0x49c4('0xd7')],'ListId':_0x22afcd[_0x49c4('0x27')][_0x9bd48b][_0x49c4('0x108')],'VoiceQueueId':_0x22afcd[_0x49c4('0x27')][_0x9bd48b]['VoiceQueueId']||undefined,'CampaignId':_0x22afcd[_0x49c4('0x27')][_0x9bd48b]['CampaignId']||undefined})[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x1fc')));delete _0x22afcd[_0x49c4('0x27')][_0x9bd48b];});}else{loggerBooked[_0x49c4('0x84')](_0x49c4('0x1fd'),JSON['stringify'](_0x3d8453[_0x49c4('0x13a')]),_0x49c4('0x1fa'),_0x3d8453[_0x49c4('0x40')]);_0x22afcd['updateOriginated'](_0x3d8453);_0x22afcd[_0x49c4('0xc4')]({'active':![],'ContactId':_0x22afcd['actions'][_0x9bd48b][_0x49c4('0xd7')],'ListId':_0x22afcd[_0x49c4('0x27')][_0x9bd48b]['ListId'],'VoiceQueueId':_0x22afcd[_0x49c4('0x27')][_0x9bd48b][_0x49c4('0xd9')]||undefined,'CampaignId':_0x22afcd[_0x49c4('0x27')][_0x9bd48b][_0x49c4('0xda')]||undefined})[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x1fc')));delete _0x22afcd['actions'][_0x9bd48b];}}else{return _0x22afcd[_0x49c4('0x179')](_0x3d8453,_0x54e3ea);}}else{if(getDiff(_0x54e3ea[_0x49c4('0x1fe')])<_0x3d8453['dialRecallMeTimeout']*0x3c){if(_0x54e3ea[_0x49c4('0x171')]&&!_0x54e3ea[_0x49c4('0x171')][_0x49c4('0x1ff')]){_0x22afcd[_0x49c4('0x98')][_0x49c4('0x13c')](_0x54e3ea['id'])[_0x49c4('0x1f')](function(){_0x22afcd['updateOriginated'](_0x3d8453);});}else{_0x22afcd[_0x49c4('0xc6')]({'active':![]},_0x54e3ea['id'],0x1)[_0x49c4('0x1f')](function(){_0x22afcd[_0x49c4('0xb8')](_0x3d8453);});}}else{_0x3d8453[_0x49c4('0x6d')]+=0x1;_0x22afcd[_0x49c4('0xb8')](_0x3d8453);if(_0x3d8453['dialRecallInQueue']){_0x22afcd['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x54e3ea[_0x49c4('0xd7')],'ListId':_0x54e3ea['ListId'],'VoiceQueueId':_0x54e3ea[_0x49c4('0xd9')]||undefined,'CampaignId':_0x54e3ea[_0x49c4('0xda')]||undefined})[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x200')));_0x22afcd[_0x49c4('0xd1')](createObjHistory(_0x3d8453,_0x54e3ea,_0x49c4('0x201'),0x17,_0x49c4('0x202')))['catch'](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x22afcd[_0x49c4('0xe2')](createObjHistory(_0x3d8453,_0x54e3ea,_0x49c4('0x203'),0x16,_0x49c4('0x204')),_0x49c4('0x205'),'[Originate][HistoryRecallClose]');}}}}else{_0x3d8453[_0x49c4('0x65')]+=0x1;_0x22afcd[_0x49c4('0xe2')](createObjHistory(_0x3d8453,_0x54e3ea,_0x49c4('0x206'),0xd,_0x49c4('0x207')),_0x49c4('0x208'),_0x49c4('0x209'));throw'inBlackList';}};};Dialer[_0x49c4('0x1d')][_0x49c4('0x20a')]=function(_0x73e425){var _0x7d7708=this;var _0x23ec6e=_0x73e425[_0x49c4('0x20b')]-_0x73e425[_0x49c4('0x79')]-_0x73e425['temp'];emitCampaignSummary(_0x73e425);if(_0x23ec6e>0x0){if(_0x23ec6e>this[_0x49c4('0x25')]){_0x23ec6e=this[_0x49c4('0x25')];}_0x73e425[_0x49c4('0xc9')]+=_0x23ec6e;this[_0x49c4('0xcb')](_0x73e425['id'],_0x23ec6e,_0x73e425[_0x49c4('0x20c')],_0x73e425)[_0x49c4('0xbf')](function(_0x5f26a2){_0x73e425[_0x49c4('0xc9')]-=_0x23ec6e;_0x73e425[_0x49c4('0xc9')]=_0x73e425[_0x49c4('0xc9')]>0x0?_0x73e425[_0x49c4('0xc9')]:0x0;if(!checkContactEmpty(_0x5f26a2)){_0x73e425['message']=_0x49c4('0x20d');logger[_0x49c4('0x84')](_0x49c4('0x20e')+_0x73e425[_0x49c4('0x40')]);}else{_0x73e425['originated']+=_0x5f26a2['length'];_0x73e425[_0x49c4('0x42')]=_0x49c4('0x20f');for(var _0x53723f=0x0;_0x53723f<_0x5f26a2[_0x49c4('0xa1')];_0x53723f+=0x1){_0x73e425[_0x49c4('0x210')]+=0x1;if(_[_0x49c4('0xb2')](_0x5f26a2[_0x53723f])||_[_0x49c4('0xb2')](_0x5f26a2[_0x53723f][_0x49c4('0x191')])||_[_0x49c4('0xb2')](_0x5f26a2[_0x53723f][_0x49c4('0x17c')])){_0x7d7708['emptyContact'](_0x49c4('0x211'),_0x73e425,_0x5f26a2[_0x53723f]);}else{_0x7d7708[_0x49c4('0x212')](_[_0x49c4('0xd6')](_0x5f26a2[_0x53723f],[_0x49c4('0xda'),_0x49c4('0x213')]))[_0x49c4('0xbf')](_0x7d7708['checkContactBlack'](_0x73e425,_0x5f26a2[_0x53723f]))[_0x49c4('0xb6')](_0x7d7708[_0x49c4('0x214')](_0x49c4('0x215'),_0x73e425));}}}})['catch'](loggerGetContactDialer(_0x49c4('0x216'),_0x73e425,_0x23ec6e));}};Dialer['prototype'][_0x49c4('0x162')]=function(_0x31d896,_0x1f207d){var _0x5bb062=this;var _0x15d8d0=[];var _0x4b8401=_0x1f207d>=0x1?_0x1f207d:0x1;if(_0x31d896[_0x49c4('0x60')]===_0x49c4('0x7')){_0x4b8401=0x1;}var _0x5cf229=Math[_0x49c4('0x1d7')](_0x31d896[_0x49c4('0x55')]*_0x4b8401)-_0x31d896[_0x49c4('0x79')]-_0x31d896[_0x49c4('0xc9')];emitVoiceQueueSummary(_0x31d896);if(_0x31d896['dialLimitQueue']>0x0){var _0x8cc12c=_0x31d896[_0x49c4('0x217')]-_0x31d896[_0x49c4('0x79')]-_0x31d896['talking']-_0x31d896[_0x49c4('0xc9')]-_0x31d896[_0x49c4('0x57')];if(_0x5cf229>_0x8cc12c){_0x5cf229=_0x8cc12c;}}if(_0x5cf229>0x0){if(_0x31d896[_0x49c4('0x60')]==='booked'){_0x5cf229=0x1;}if(_0x5cf229>this[_0x49c4('0x25')]){_0x5cf229=this['maxNumberOriginate'];}_0x31d896['temp']+=_0x5cf229;for(var _0xc88ee5 in this[_0x49c4('0x23')]){if(typeof this[_0x49c4('0x23')][_0xc88ee5]!==_0x49c4('0xa2')){if(this[_0x49c4('0x23')][_0xc88ee5]['state']===_0x49c4('0x218')&&this[_0x49c4('0x23')][_0xc88ee5]['status']===_0x49c4('0xe0')){_0x15d8d0[_0x49c4('0x152')](this[_0x49c4('0x23')][_0xc88ee5]['id']);}}}this['getContactDialer'](_0x31d896['id'],_0x15d8d0,_0x5cf229,_0x31d896[_0x49c4('0x20c')],_0x31d896)[_0x49c4('0xbf')](function(_0x17fe83){_0x31d896[_0x49c4('0xc9')]-=_0x5cf229;_0x31d896[_0x49c4('0xc9')]=_0x31d896[_0x49c4('0xc9')]>0x0?_0x31d896[_0x49c4('0xc9')]:0x0;if(!checkContactEmpty(_0x17fe83)){_0x5bb062[_0x49c4('0xbb')](_0x31d896)['then'](sendMessageReschedule(_0x31d896))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x31d896[_0x49c4('0x79')]+=_0x17fe83[_0x49c4('0xa1')];_0x31d896[_0x49c4('0x42')]=_0x31d896[_0x49c4('0x60')]===_0x49c4('0x7')?_0x49c4('0x183'):_0x49c4('0x20f');for(var _0x35ed46=0x0;_0x35ed46<_0x17fe83['length'];_0x35ed46+=0x1){if(_[_0x49c4('0xb2')](_0x17fe83[_0x35ed46])||_[_0x49c4('0xb2')](_0x17fe83[_0x35ed46]['Contact'])||_['isNil'](_0x17fe83[_0x35ed46][_0x49c4('0x17c')])){_0x5bb062['emptyContact'](_0x49c4('0x211'),_0x31d896,_0x17fe83[_0x35ed46]);}else{_0x5bb062[_0x49c4('0xbd')](_['pick'](_0x17fe83[_0x35ed46],['VoiceQueueId',_0x49c4('0x213')]))['then'](_0x5bb062[_0x49c4('0x1f6')](_0x31d896,_0x17fe83[_0x35ed46]))[_0x49c4('0xb6')](_0x5bb062[_0x49c4('0x214')](_0x49c4('0x211'),_0x31d896));}}}})['catch'](loggerGetContactDialer('[getContactDialer2]',_0x31d896,_0x5cf229));}};Dialer[_0x49c4('0x1d')][_0x49c4('0x1d9')]=function(_0x305854){if(_0x305854[_0x49c4('0x217')]>0x0){var _0x4af897=_0x305854[_0x49c4('0x217')]-_0x305854[_0x49c4('0x79')]-_0x305854[_0x49c4('0x5b')];if(_0x4af897>0x0){this[_0x49c4('0x219')](_0x305854);}else{loggerPredictiveCalls[_0x49c4('0x84')](_0x49c4('0x21a'));}}else{this[_0x49c4('0x219')](_0x305854);}};Dialer[_0x49c4('0x1d')]['tryOriginatePredictive']=function(_0x7f7b69){var _0x331875=this;var _0x45d437=[];_0x7f7b69['originated']+=0x1;for(var _0x1237f1 in this[_0x49c4('0x23')]){if(typeof this[_0x49c4('0x23')][_0x1237f1]!==_0x49c4('0xa2')){if(this['agents'][_0x1237f1]['state']===_0x49c4('0x218')&&this[_0x49c4('0x23')][_0x1237f1]['status']==='reachable'){_0x45d437[_0x49c4('0x152')](this[_0x49c4('0x23')][_0x1237f1]['id']);}}}this[_0x49c4('0xc8')](_0x7f7b69['id'],_0x45d437,0x1,_0x7f7b69[_0x49c4('0x20c')],_0x7f7b69)['then'](function(_0xb97665){if(!checkContactEmpty(_0xb97665)){checkContactLowerLimitOriginate(_0x7f7b69,0x1,0x0);_0x331875[_0x49c4('0xbb')](_0x7f7b69)[_0x49c4('0xbf')](sendMessageReschedule(_0x7f7b69))[_0x49c4('0xb6')](loggerCatch(_0x49c4('0xbc')));}else{_0x7f7b69[_0x49c4('0x42')]='RUNNING';if(_[_0x49c4('0xb2')](_0xb97665[0x0])||_[_0x49c4('0xb2')](_0xb97665[0x0][_0x49c4('0x191')])||_[_0x49c4('0xb2')](_0xb97665[0x0]['phone'])){_0x331875[_0x49c4('0xd5')](_0x49c4('0x211'),_0x7f7b69,_0xb97665[0x0]);}else{_0x331875[_0x49c4('0xbd')](_[_0x49c4('0xd6')](_0xb97665[0x0],[_0x49c4('0xd9'),_0x49c4('0x213')]))[_0x49c4('0xbf')](_0x331875[_0x49c4('0x1f6')](_0x7f7b69,_0xb97665[0x0]))[_0x49c4('0xb6')](_0x331875['loggerHandler'](_0x49c4('0x21b'),_0x7f7b69));}}})[_0x49c4('0xb6')](loggerGetContactDialer(_0x49c4('0x21c'),_0x7f7b69,0x1));emitVoiceQueueSummary(_0x7f7b69);};Dialer['prototype']['abandonmentRate']=function(_0xb3de93,_0xf69075,_0x442918,_0x4c68b7,_0x5e8198,_0x3a0fd2){loggerPredictive[_0x49c4('0x84')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive['info'](_0x49c4('0x21d'),_0xb3de93);loggerPredictive[_0x49c4('0x84')](_0x49c4('0x21e'),_0xf69075);loggerPredictive[_0x49c4('0x84')](_0x49c4('0x21f'),_0x442918);loggerPredictive[_0x49c4('0x84')](_0x49c4('0x220'),_0x4c68b7);loggerPredictive[_0x49c4('0x84')](_0x49c4('0x221'),_0x5e8198);loggerPredictive[_0x49c4('0x84')]('---------------------------');return new BPromise(function(_0x3b8f18,_0x2eba0b){if(_0xb3de93<=0x0||isNaN(_0xb3de93)){return _0x2eba0b(msgResponse(_0x49c4('0x222'),_0x49c4('0x4b'),_0x49c4('0x223')+_0xb3de93));}if(_0x442918<=0x0||isNaN(_0x442918)){return _0x2eba0b(msgResponse(_0x49c4('0x222'),_0x49c4('0x4b'),'Ts\x20=\x20'+_0x442918));}if(_0x4c68b7<=0x0||isNaN(_0x4c68b7)){return _0x2eba0b(msgResponse(_0x49c4('0x222'),_0x49c4('0x4b'),_0x49c4('0x224')+_0x4c68b7));}if(_0xf69075<=0x0||isNaN(_0xf69075)){return _0x2eba0b(msgResponse(_0x49c4('0x222'),_0x49c4('0x4b'),'interval\x20=\x20'+_0xf69075));}if(_0x5e8198<=0x0||isNaN(_0x5e8198)){return _0x2eba0b(msgResponse(_0x49c4('0x222'),'Error',_0x49c4('0x225')+_0x5e8198));}_0x3a0fd2=_0x3a0fd2||0x0;var _0x175cbe=0x1/_0x442918;var _0x57f6f0=0x0;var _0x3239f1=0x0;var _0x471d22=0x0;var _0x2a8994=0x0;for(var _0x25a2dc=0x0;_0x471d22<_0x5e8198;_0x25a2dc+=0x1){_0x3239f1=_0x25a2dc/_0xf69075;_0x57f6f0=(_0x4c68b7*_0x3239f1+_0x3a0fd2)/_0x175cbe;_0x471d22=erlangb(_0x57f6f0,_0xb3de93);_0x2a8994=_0x57f6f0/_0xb3de93*(0x1-erlangb(_0x57f6f0,_0xb3de93));}return _0x3b8f18({'erlangCalls':_0x25a2dc,'erlangCallToSecond':_0xf69075/_0x25a2dc,'erlangAbandonmentRate':_0x471d22,'erlangBusyFactor':_0x2a8994});});};Dialer['prototype'][_0x49c4('0x1ee')]=function(_0x377a61,_0x2c367d,_0x25ea2e,_0x24ec44,_0x28b74b,_0xc8608b){loggerPredictive[_0x49c4('0x84')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x49c4('0x84')]('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',_0x377a61);loggerPredictive[_0x49c4('0x84')](_0x49c4('0x21e'),_0x2c367d);loggerPredictive[_0x49c4('0x84')](_0x49c4('0x21f'),_0x25ea2e);loggerPredictive[_0x49c4('0x84')](_0x49c4('0x220'),_0x24ec44);loggerPredictive[_0x49c4('0x84')](_0x49c4('0x226'),_0x28b74b);loggerPredictive[_0x49c4('0x84')]('---------------------------');return new BPromise(function(_0x503148,_0x441721){if(_0x377a61<=0x0||isNaN(_0x377a61)){return _0x441721(msgResponse(_0x49c4('0x227'),_0x49c4('0x4b'),_0x49c4('0x223')+_0x377a61));}if(_0x25ea2e<=0x0||isNaN(_0x25ea2e)){return _0x441721(msgResponse('[busyFactor]',_0x49c4('0x4b'),_0x49c4('0x228')+_0x25ea2e));}if(_0x24ec44<=0x0||isNaN(_0x24ec44)){return _0x441721(msgResponse(_0x49c4('0x227'),'Error',_0x49c4('0x224')+_0x24ec44));}if(_0x2c367d<=0x0||isNaN(_0x2c367d)){return _0x441721(msgResponse(_0x49c4('0x227'),'Error',_0x49c4('0x229')+_0x2c367d));}if(_0x28b74b<=0x0||isNaN(_0x28b74b)){return _0x441721(msgResponse(_0x49c4('0x227'),_0x49c4('0x4b'),_0x49c4('0x22a')+_0x28b74b));}_0xc8608b=_0xc8608b||0x0;var _0x5cad70=0x1/_0x25ea2e;var _0x4bec9f=0x0;var _0x11f563=0x0;var _0x2a8255=0x0;var _0x4e2872=0x0;for(var _0x101243=0x0;_0x4e2872<_0x28b74b;_0x101243+=0x1){_0x11f563=_0x101243/_0x2c367d;_0x4bec9f=(_0x24ec44*_0x11f563+_0xc8608b)/_0x5cad70;_0x2a8255=erlangb(_0x4bec9f,_0x377a61);_0x4e2872=_0x4bec9f/_0x377a61*(0x1-erlangb(_0x4bec9f,_0x377a61));}return _0x503148({'erlangCalls':_0x101243,'erlangCallToSecond':_0x2c367d/_0x101243,'erlangAbandonmentRate':_0x2a8255,'erlangBusyFactor':_0x4e2872});});};module[_0x49c4('0x22b')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 20b338b..496891a 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 _0x74d3=['talktime','queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','scheduledat','type','campaigntype','countbusyretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','name','calleridnum','starttime','responsetime','droptime','endtime','holdtime'];(function(_0x577077,_0x52f056){var _0x370769=function(_0x34d109){while(--_0x34d109){_0x577077['push'](_0x577077['shift']());}};_0x370769(++_0x52f056);}(_0x74d3,0x159));var _0x374d=function(_0x4cca27,_0x18e06f){_0x4cca27=_0x4cca27-0x0;var _0x3d8219=_0x74d3[_0x4cca27];return _0x3d8219;};'use strict';var util=require(_0x374d('0x0'));var _=require(_0x374d('0x1'));var moment=require(_0x374d('0x2'));function getSeconds(_0x5e0916,_0x12b00c){var _0x5f4b2e=moment(_0x5e0916)[_0x374d('0x3')](0x0);var _0x9f6268=moment(_0x12b00c)[_0x374d('0x3')](0x0);return _0x5f4b2e['diff'](_0x9f6268,_0x374d('0x4'));}function QueueCallerAbandon(_0x501ce8,_0x2d6346){this[_0x374d('0x5')]=_0x501ce8[_0x374d('0x5')];this['type']=_0x501ce8[_0x374d('0x6')];this[_0x374d('0x7')]=_0x501ce8[_0x374d('0x6')]==='outbound'?'queue':_0x501ce8[_0x374d('0x6')];this[_0x374d('0x8')]=_0x501ce8[_0x374d('0x8')];this['countcongestionretry']=_0x501ce8['countcongestionretry'];this['countnoanswerretry']=_0x501ce8[_0x374d('0x9')];this[_0x374d('0xa')]=_0x501ce8[_0x374d('0x8')]+_0x501ce8['countcongestionretry']+_0x501ce8['countnoanswerretry']+_0x501ce8['countnosuchnumberretry']+_0x501ce8[_0x374d('0xb')]+_0x501ce8[_0x374d('0xc')]+_0x501ce8[_0x374d('0xd')]+_0x501ce8[_0x374d('0xe')];this[_0x374d('0xf')]=_0x501ce8[_0x374d('0xf')];this[_0x374d('0xb')]=_0x501ce8['countdropretry'];this['countabandonedretry']=_0x501ce8[_0x374d('0xc')];this['countmachineretry']=_0x501ce8[_0x374d('0xd')];this[_0x374d('0xe')]=_0x501ce8[_0x374d('0xe')];this[_0x374d('0x10')]=_0x2d6346[_0x374d('0x10')];this['calleridname']=_0x501ce8[_0x374d('0x11')];this[_0x374d('0x12')]=_0x501ce8['number'];this[_0x374d('0x13')]=_0x501ce8[_0x374d('0x13')];this[_0x374d('0x14')]=_0x501ce8[_0x374d('0x14')];this[_0x374d('0x15')]=_0x501ce8[_0x374d('0x15')];this[_0x374d('0x16')]=this['droptime'];this['ringtime']=getSeconds(_0x501ce8['responsetime'],_0x501ce8[_0x374d('0x13')]);this[_0x374d('0x17')]=getSeconds(this['droptime'],_0x501ce8[_0x374d('0x14')]);this[_0x374d('0x18')]=0x0;this[_0x374d('0x19')]=_0x2d6346[_0x374d('0x19')];this[_0x374d('0x1a')]=_0x2d6346[_0x374d('0x1b')];this[_0x374d('0x1c')]=_0x2d6346[_0x374d('0x1c')];this[_0x374d('0x1d')]=_0x501ce8[_0x374d('0x1d')];this[_0x374d('0x1e')]=_0x501ce8['callbackuniqueid'];this[_0x374d('0x1f')]=_0x501ce8[_0x374d('0x1f')];this[_0x374d('0x20')]=_0x501ce8['recallme'];this[_0x374d('0x21')]=_0x501ce8[_0x374d('0x21')];this[_0x374d('0x22')]=_0x501ce8[_0x374d('0x22')];this[_0x374d('0x23')]=_0x501ce8['UserId'];this[_0x374d('0x24')]=_0x501ce8['VoiceQueueId'];this[_0x374d('0x25')]=_0x501ce8['CampaignId'];this[_0x374d('0x26')]=_0x501ce8['originatecalleridnum']||'';this[_0x374d('0x27')]=_0x501ce8[_0x374d('0x27')]||'';}module[_0x374d('0x28')]=QueueCallerAbandon; \ No newline at end of file +var _0xc19a=['diff','seconds','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','number','starttime','responsetime','droptime','ringtime','holdtime','talktime','connectedlinename','reason','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds'];(function(_0x28798a,_0x1f3968){var _0x25b422=function(_0x387a9c){while(--_0x387a9c){_0x28798a['push'](_0x28798a['shift']());}};_0x25b422(++_0x1f3968);}(_0xc19a,0x135));var _0xac19=function(_0x3f5937,_0x10b93a){_0x3f5937=_0x3f5937-0x0;var _0x1ef2be=_0xc19a[_0x3f5937];return _0x1ef2be;};'use strict';var util=require(_0xac19('0x0'));var _=require('lodash');var moment=require(_0xac19('0x1'));function getSeconds(_0x3f696f,_0x2435d4){var _0x3ae8bf=moment(_0x3f696f)[_0xac19('0x2')](0x0);var _0x5d76bd=moment(_0x2435d4)[_0xac19('0x2')](0x0);return _0x3ae8bf[_0xac19('0x3')](_0x5d76bd,_0xac19('0x4'));}function QueueCallerAbandon(_0xda46ca,_0x5cc246){this[_0xac19('0x5')]=_0xda46ca[_0xac19('0x5')];this['type']=_0xda46ca[_0xac19('0x6')];this[_0xac19('0x7')]=_0xda46ca[_0xac19('0x6')]==='outbound'?_0xac19('0x8'):_0xda46ca[_0xac19('0x6')];this[_0xac19('0x9')]=_0xda46ca[_0xac19('0x9')];this[_0xac19('0xa')]=_0xda46ca[_0xac19('0xa')];this[_0xac19('0xb')]=_0xda46ca[_0xac19('0xb')];this[_0xac19('0xc')]=_0xda46ca[_0xac19('0x9')]+_0xda46ca[_0xac19('0xa')]+_0xda46ca[_0xac19('0xb')]+_0xda46ca[_0xac19('0xd')]+_0xda46ca[_0xac19('0xe')]+_0xda46ca[_0xac19('0xf')]+_0xda46ca[_0xac19('0x10')]+_0xda46ca[_0xac19('0x11')];this['countnosuchnumberretry']=_0xda46ca[_0xac19('0xd')];this[_0xac19('0xe')]=_0xda46ca['countdropretry'];this['countabandonedretry']=_0xda46ca['countabandonedretry'];this[_0xac19('0x10')]=_0xda46ca['countmachineretry'];this[_0xac19('0x11')]=_0xda46ca[_0xac19('0x11')];this['uniqueid']=_0x5cc246['uniqueid'];this[_0xac19('0x12')]=_0xda46ca['name'];this['calleridnum']=_0xda46ca[_0xac19('0x13')];this['starttime']=_0xda46ca[_0xac19('0x14')];this[_0xac19('0x15')]=_0xda46ca[_0xac19('0x15')];this[_0xac19('0x16')]=_0xda46ca[_0xac19('0x16')];this['endtime']=this[_0xac19('0x16')];this[_0xac19('0x17')]=getSeconds(_0xda46ca[_0xac19('0x15')],_0xda46ca[_0xac19('0x14')]);this[_0xac19('0x18')]=getSeconds(this['droptime'],_0xda46ca[_0xac19('0x15')]);this[_0xac19('0x19')]=0x0;this[_0xac19('0x8')]=_0x5cc246['queue'];this['membername']=_0x5cc246[_0xac19('0x1a')];this['reason']=_0x5cc246[_0xac19('0x1b')];this[_0xac19('0x1c')]=_0xda46ca[_0xac19('0x1c')];this['callbackuniqueid']=_0xda46ca['callbackuniqueid'];this[_0xac19('0x1d')]=_0xda46ca[_0xac19('0x1d')];this[_0xac19('0x1e')]=_0xda46ca[_0xac19('0x1e')];this[_0xac19('0x1f')]=_0xda46ca[_0xac19('0x1f')];this[_0xac19('0x20')]=_0xda46ca['ListId'];this[_0xac19('0x21')]=_0xda46ca[_0xac19('0x21')];this[_0xac19('0x22')]=_0xda46ca['VoiceQueueId'];this[_0xac19('0x23')]=_0xda46ca['CampaignId'];this[_0xac19('0x24')]=_0xda46ca['originatecalleridnum']||'';this['originatecalleridname']=_0xda46ca[_0xac19('0x25')]||'';}module[_0xac19('0x26')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 8ba8755..0968ed8 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(_0xea706b,_0x3ce5b5){var _0x5318af=function(_0x3f6ecd){while(--_0x3f6ecd){_0xea706b['push'](_0xea706b['shift']());}};_0x5318af(++_0x3ce5b5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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(_0x458c89,_0x2b09d7){var _0x3989ca=function(_0x3ec381){while(--_0x3ec381){_0x458c89['push'](_0x458c89['shift']());}};_0x3989ca(++_0x2b09d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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 4586cfe..8ed78bf 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 _0x93c7=['fax','../ami','./rpcDb','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','varset','syncVarSet','bind','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','localstationid','\x20syncFaxStatus\x20','remotestationid','resolution','transferrate','filename','calleridnum','pagestransferred','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','notify','catch','\x20notify\x20','stringify','error','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','FaxAccountId','Trunk','isValid','Trunk\x20Reachable','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','format','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','ext','isTrunkReachable','isNil','active','SIP/%s','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','lodash','uuid','moment','path','tiff2pdf'];(function(_0x507ac5,_0x33aaee){var _0x12c1bc=function(_0x5c953c){while(--_0x5c953c){_0x507ac5['push'](_0x507ac5['shift']());}};_0x12c1bc(++_0x33aaee);}(_0x93c7,0xfd));var _0x793c=function(_0x5cd39c,_0xffaa7f){_0x5cd39c=_0x5cd39c-0x0;var _0x484221=_0x93c7[_0x5cd39c];return _0x484221;};'use strict';var util=require('util');var _=require(_0x793c('0x0'));var BPromise=require('bluebird');var uuid=require(_0x793c('0x1'));var moment=require(_0x793c('0x2'));var path=require(_0x793c('0x3'));var tiff2pdf=require(_0x793c('0x4'));var gs=require('./util/gs');var logger=require('../../../config/logger')(_0x793c('0x5'));var ami=require(_0x793c('0x6'));var rpcDb=require(_0x793c('0x7'));var Channel=require('./channel');var ut=require(_0x793c('0x8'));var Action=require(_0x793c('0x9'));var faxAccount=require(_0x793c('0xa'));var attachment=require(_0x793c('0xb'));var faxMessage=require(_0x793c('0xc'));function Fax(_0x4c14d2){this[_0x793c('0xd')]={};this[_0x793c('0xe')]=_0x4c14d2[_0x793c('0xe')];this[_0x793c('0xf')]=_0x4c14d2[_0x793c('0xf')];this[_0x793c('0x10')]={};ami['on'](_0x793c('0x11'),this[_0x793c('0x12')]['bind'](this));ami['on'](_0x793c('0x13'),this[_0x793c('0x14')][_0x793c('0x15')](this));ami['on'](_0x793c('0x16'),this[_0x793c('0x17')]['bind'](this));ami['on'](_0x793c('0x18'),this[_0x793c('0x19')][_0x793c('0x15')](this));ami['on'](_0x793c('0x1a'),this[_0x793c('0x1b')][_0x793c('0x15')](this));ami['on'](_0x793c('0x1c'),this[_0x793c('0x1d')][_0x793c('0x15')](this));ami['on'](_0x793c('0x1e'),this['syncHangup'][_0x793c('0x15')](this));ami['on']('originateresponse',this[_0x793c('0x1f')][_0x793c('0x15')](this));}Fax[_0x793c('0x20')][_0x793c('0x12')]=function(_0x17d769){if(_0x17d769[_0x793c('0x21')]===_0x793c('0x22')){for(var _0x9e2679 in this[_0x793c('0xe')]){if(this[_0x793c('0xe')][_0x793c('0x23')](_0x9e2679)){if(_0x17d769[_0x793c('0x24')]===this['faxAccounts'][_0x9e2679]['localstationid']){this[_0x793c('0xd')][_0x17d769[_0x793c('0x25')]]={};this[_0x793c('0xd')][_0x17d769[_0x793c('0x25')]][_0x793c('0x26')]=_0x17d769[_0x793c('0x26')];this[_0x793c('0xd')][_0x17d769[_0x793c('0x25')]]['id']=this[_0x793c('0xe')][_0x9e2679]['id'];this[_0x793c('0xd')][_0x17d769['uniqueid']][_0x793c('0x27')]=this[_0x793c('0xe')][_0x9e2679][_0x793c('0x27')];logger[_0x793c('0x28')](_0x17d769[_0x793c('0x25')],_0x793c('0x29'));}}}}if(this[_0x793c('0x10')][_0x17d769[_0x793c('0x25')]]){this[_0x793c('0xd')][_0x17d769[_0x793c('0x25')]]={};this[_0x793c('0xd')][_0x17d769[_0x793c('0x25')]][_0x793c('0x26')]=_0x17d769[_0x793c('0x26')];logger[_0x793c('0x28')](_0x17d769[_0x793c('0x25')],'\x20syncNewchannel\x20');}};Fax[_0x793c('0x20')][_0x793c('0x14')]=function(_0x36e0b2){if(this['channels'][_0x36e0b2[_0x793c('0x25')]]){for(var _0x1c17db in _0x36e0b2[_0x793c('0x2a')]){if(_0x36e0b2[_0x793c('0x2a')]['hasOwnProperty'](_0x1c17db)){this['channels'][_0x36e0b2['uniqueid']][_0x1c17db]=_0x36e0b2[_0x793c('0x2b')];}}}};Fax[_0x793c('0x20')]['syncNewState']=function(_0x3bda43){if(this[_0x793c('0xd')][_0x3bda43[_0x793c('0x25')]]){this[_0x793c('0xd')][_0x3bda43['uniqueid']][_0x793c('0x2c')]=_0x3bda43['channelstate'];this[_0x793c('0xd')][_0x3bda43[_0x793c('0x25')]][_0x793c('0x2d')]=_0x3bda43['channelstatedesc'];}};Fax[_0x793c('0x20')][_0x793c('0x19')]=function(_0x47a6ce){if(this[_0x793c('0xd')][_0x47a6ce[_0x793c('0x25')]]){for(var _0xb88f7f in _0x47a6ce[_0x793c('0x2a')]){if(_0x47a6ce['variable'][_0x793c('0x23')](_0xb88f7f)){this[_0x793c('0xd')][_0x47a6ce[_0x793c('0x25')]][_0xb88f7f]=_0x47a6ce['value'];}}}};Fax[_0x793c('0x20')][_0x793c('0x1b')]=function(_0x2fed58){if(this['channels'][_0x2fed58[_0x793c('0x25')]]){this[_0x793c('0xd')][_0x2fed58[_0x793c('0x25')]][_0x793c('0x2e')]=_0x2fed58[_0x793c('0x2e')];this[_0x793c('0xd')][_0x2fed58[_0x793c('0x25')]][_0x793c('0x2f')]=_0x2fed58['status'];this[_0x793c('0xd')][_0x2fed58[_0x793c('0x25')]][_0x793c('0x30')]=_0x2fed58[_0x793c('0x30')];this['channels'][_0x2fed58[_0x793c('0x25')]]['filename']=_0x2fed58['filename'];logger['info'](_0x2fed58[_0x793c('0x25')],_0x793c('0x31'));}};Fax[_0x793c('0x20')][_0x793c('0x1d')]=function(_0x4c8f95){var _0x599915=this;if(this[_0x793c('0xd')][_0x4c8f95['uniqueid']]){var _0x784a75=this[_0x793c('0xd')][_0x4c8f95[_0x793c('0x25')]]['id'];this['channels'][_0x4c8f95[_0x793c('0x25')]][_0x793c('0x32')]=_0x4c8f95[_0x793c('0x32')];this[_0x793c('0xd')][_0x4c8f95[_0x793c('0x25')]]['pagestransferred']=_0x4c8f95['pagestransferred'];this['channels'][_0x4c8f95[_0x793c('0x25')]]['localstationid']=_0x4c8f95[_0x793c('0x30')];this[_0x793c('0xd')][_0x4c8f95[_0x793c('0x25')]][_0x793c('0x33')]=_0x4c8f95[_0x793c('0x33')];this[_0x793c('0xd')][_0x4c8f95['uniqueid']][_0x793c('0x34')]=_0x4c8f95['transferrate'];this[_0x793c('0xd')][_0x4c8f95[_0x793c('0x25')]][_0x793c('0x35')]=_0x4c8f95['filename'];this['channels'][_0x4c8f95[_0x793c('0x25')]][_0x793c('0x36')]=_0x4c8f95[_0x793c('0x36')];if(this[_0x793c('0xd')][_0x4c8f95[_0x793c('0x25')]][_0x793c('0x37')]>0x0){tiff2pdf(_0x4c8f95[_0x793c('0x35')],_0x793c('0x38'),function(_0x14b60b){logger[_0x793c('0x28')](_0x4c8f95[_0x793c('0x25')],_0x793c('0x39'),_0x14b60b[_0x793c('0x3a')]);attachment[_0x793c('0x3b')]({'name':path[_0x793c('0x3c')](_0x4c8f95[_0x793c('0x35')])[_0x793c('0x27')],'basename':path[_0x793c('0x3c')](_0x4c8f95[_0x793c('0x35')])[_0x793c('0x27')]+_0x793c('0x3d'),'type':_0x793c('0x3e')})[_0x793c('0x3f')](function(_0x28c5d7){faxAccount[_0x793c('0x40')](_0x784a75,{'from':_0x4c8f95[_0x793c('0x36')],'mapKey':_0x793c('0x5'),'body':path['parse'](_0x4c8f95[_0x793c('0x35')])['name']+'.pdf','AttachmentId':_0x28c5d7['id']})[_0x793c('0x41')](function(_0xcac913){logger['error'](_0x4c8f95[_0x793c('0x25')],_0x793c('0x42'),JSON[_0x793c('0x43')](_0xcac913));});})[_0x793c('0x41')](function(_0x35144b){logger[_0x793c('0x44')](_0x4c8f95[_0x793c('0x25')],_0x793c('0x45'),JSON[_0x793c('0x43')](_0x35144b));});});}logger[_0x793c('0x28')](_0x4c8f95[_0x793c('0x25')],_0x793c('0x45'));}};Fax['prototype']['syncOriginateResponse']=function(_0x532534){if(this[_0x793c('0x10')][_0x532534[_0x793c('0x25')]]){_[_0x793c('0x46')](this[_0x793c('0xd')][_0x532534[_0x793c('0x25')]],_[_0x793c('0x47')](_0x532534,[_0x793c('0x48'),_0x793c('0x49')]));}};function updateStatus(_0x209885){if(_0x209885[_0x793c('0x4a')]){faxMessage[_0x793c('0x4b')](_0x209885[_0x793c('0x4a')],{'failMessage':_0x793c('0x4c')})[_0x793c('0x3f')](function(_0xe3d21c){ut['logger'](_0x793c('0x4d'),_0xe3d21c);})['catch'](function(_0x20bd02){ut[_0x793c('0x4e')](_0x793c('0x4f'),_0x20bd02);});}else{ut[_0x793c('0x4e')](_0x793c('0x50'));}}Fax['prototype']['updateStatus']=function(_0x2c9064,_0x4a5d19,_0x84bace){var _0x47f829=this;var _0x2f82c7={};if(_0x4a5d19){_0x2f82c7={'read':_0x4a5d19};}else{_0x2f82c7={'failMessage':_0x84bace};}if(this[_0x793c('0x10')][_0x2c9064][_0x793c('0x4a')]){faxMessage[_0x793c('0x4b')](this[_0x793c('0x10')][_0x2c9064][_0x793c('0x4a')],_0x2f82c7)['then'](function(_0x56be69){ut[_0x793c('0x4e')](_0x793c('0x51'),_0x56be69);})[_0x793c('0x41')](function(_0x2963dc){ut[_0x793c('0x4e')](_0x793c('0x52'),_0x2963dc);})[_0x793c('0x53')](function(){delete _0x47f829['channels'][_0x2c9064];delete _0x47f829[_0x793c('0x10')][_0x2c9064];});}else{ut[_0x793c('0x4e')](_0x793c('0x54'));delete this['channels'][_0x2c9064];delete this[_0x793c('0x10')][_0x2c9064];}};Fax[_0x793c('0x20')][_0x793c('0x55')]=function(_0x4d88ca){var _0x9520de=this;if(this[_0x793c('0xd')][_0x4d88ca[_0x793c('0x25')]]){if(this[_0x793c('0x10')][_0x4d88ca[_0x793c('0x25')]]){this[_0x793c('0xd')][_0x4d88ca[_0x793c('0x25')]]['id']=this[_0x793c('0x10')][_0x4d88ca[_0x793c('0x25')]]['id'];this[_0x793c('0xd')][_0x4d88ca[_0x793c('0x25')]][_0x793c('0x27')]=this[_0x793c('0x10')][_0x4d88ca['uniqueid']]['name'];}logger[_0x793c('0x28')](_0x4d88ca[_0x793c('0x25')],this[_0x793c('0x10')][_0x4d88ca['uniqueid']]?_0x793c('0x56'):_0x793c('0x57'),JSON[_0x793c('0x43')](this[_0x793c('0xd')][_0x4d88ca[_0x793c('0x25')]]));if(this[_0x793c('0x10')][_0x4d88ca[_0x793c('0x25')]]){if(this['channels'][_0x4d88ca[_0x793c('0x25')]][_0x793c('0x58')]>0x0&&this[_0x793c('0xd')][_0x4d88ca[_0x793c('0x25')]]['faxstatus']===_0x793c('0x59')){this[_0x793c('0x5a')](_0x4d88ca[_0x793c('0x25')],!![]);}else{this[_0x793c('0x5a')](_0x4d88ca['uniqueid'],![],this[_0x793c('0xd')][_0x4d88ca['uniqueid']][_0x793c('0x5b')]?_0x793c('0x5c')+this['channels'][_0x4d88ca['uniqueid']][_0x793c('0x5b')]:_0x793c('0x5d'));}}}};Fax['prototype'][_0x793c('0x5e')]=function(_0x48dc93){var _0x4f2587=this;return new BPromise(function(_0xb64ad9,_0x22754c){_0x4f2587[_0x793c('0x5f')](_0x48dc93,_0x4f2587[_0x793c('0xe')][_0x48dc93['FaxAccountId']])[_0x793c('0x3f')](function(_0x30a827){ut['logger'](_0x793c('0x60'),_0x30a827);_0xb64ad9(ut[_0x793c('0x3a')](_0x793c('0x61')));})[_0x793c('0x41')](function(_0x3fdbce){ut[_0x793c('0x4e')](_0x793c('0x62'),_0x3fdbce);updateStatus(_0x48dc93);_0x22754c(ut[_0x793c('0x3a')](_0x793c('0x63')));});});};Fax[_0x793c('0x20')][_0x793c('0x64')]=function(_0x49e7c5){var _0x1a4e15=this;return new BPromise(function(_0x13af33,_0x277046){var _0x1780a5=_0x1a4e15[_0x793c('0x65')](_0x1a4e15['faxAccounts'][_0x49e7c5[_0x793c('0x66')]][_0x793c('0x67')],_0x49e7c5);if(_0x1780a5[_0x793c('0x68')]){_0x13af33(ut[_0x793c('0x3a')](_0x793c('0x69')));}else{_0x277046(ut[_0x793c('0x3a')](_0x1780a5['message']));}});};function originate(_0x2a7b3e,_0x2ab2cb,_0x3096d4){return new BPromise(function(_0x4b4f8f,_0x4f9ac4){if(_0x3096d4){var _0x3a15b3=util['format'](_0x793c('0x6a'),path[_0x793c('0x3c')](_0x2a7b3e['path'])['name'],_0x2a7b3e[_0x793c('0x3')]);gs[_0x793c('0x6b')](_0x3a15b3)['then'](function(){_0x2a7b3e[_0x793c('0x3')]=util[_0x793c('0x6c')](_0x793c('0x6d'),path[_0x793c('0x3c')](_0x2a7b3e[_0x793c('0x3')])[_0x793c('0x6e')],path['parse'](_0x2a7b3e['path'])[_0x793c('0x27')]);_0x2ab2cb[_0x793c('0x6f')]=_0x2a7b3e[_0x793c('0x3')];ut[_0x793c('0x4e')](_0x793c('0x70'),'');ami['Action'](ut['variablesAction'](_0x2a7b3e,_0x2ab2cb))[_0x793c('0x3f')](function(_0x1c1357){_0x4b4f8f(_0x1c1357);})[_0x793c('0x41')](function(_0x27c6cb){_0x4f9ac4(_0x27c6cb);});})[_0x793c('0x41')](function(_0x2297b8){_0x4f9ac4(_0x2297b8);});}else{ami[_0x793c('0x71')](ut[_0x793c('0x72')](_0x2a7b3e,_0x2ab2cb))[_0x793c('0x3f')](function(_0x1a202d){_0x4b4f8f(_0x1a202d);})[_0x793c('0x41')](function(_0x59e538){_0x4f9ac4(_0x59e538);});}});}Fax[_0x793c('0x20')][_0x793c('0x5f')]=function(_0x5d44a8,_0x1cd7aa){var _0x2c8af8=this;return new BPromise(function(_0x1542b0,_0x36522e){var _0x44f1f5=uuid['v4']();var _0x41a2c9=ut['addVariables'](_0x5d44a8,_0x1cd7aa);_0x2c8af8[_0x793c('0x10')][_0x44f1f5]=new Action(_0x44f1f5,_0x1cd7aa,_0x5d44a8);var _0x9143cc=_0x2c8af8[_0x793c('0x10')][_0x44f1f5];if(path[_0x793c('0x3c')](_0x5d44a8[_0x793c('0x3')])[_0x793c('0x73')]==='.pdf'){originate(_0x9143cc,_0x41a2c9,!![])['then'](function(_0x160d97){_0x1542b0(_0x160d97);})[_0x793c('0x41')](function(_0x3ef106){_0x36522e(_0x3ef106);});}else{originate(_0x9143cc,_0x41a2c9,![])[_0x793c('0x3f')](function(_0x4f6695){_0x1542b0(_0x4f6695);})[_0x793c('0x41')](function(_0x1a94ae){_0x36522e(_0x1a94ae);});}});};Fax[_0x793c('0x20')][_0x793c('0x74')]=function(_0x25930f){return!_['isNil'](_0x25930f)&&!_[_0x793c('0x75')](_0x25930f[_0x793c('0x27')])&&!_[_0x793c('0x75')](_0x25930f['active'])&&_0x25930f[_0x793c('0x76')]&&!_[_0x793c('0x75')](this[_0x793c('0xf')][util[_0x793c('0x6c')](_0x793c('0x77'),_0x25930f[_0x793c('0x27')])])&&!_[_0x793c('0x75')](this[_0x793c('0xf')][util['format'](_0x793c('0x77'),_0x25930f[_0x793c('0x27')])][_0x793c('0x2f')])&&(this[_0x793c('0xf')][util[_0x793c('0x6c')]('SIP/%s',_0x25930f[_0x793c('0x27')])][_0x793c('0x2f')]==='reachable'||this[_0x793c('0xf')][util[_0x793c('0x6c')]('SIP/%s',_0x25930f[_0x793c('0x27')])][_0x793c('0x2f')]===_0x793c('0x78'));};Fax[_0x793c('0x20')]['checkTrunk']=function(_0x218595,_0x4be2e8){if(!this[_0x793c('0x74')](_0x218595)){ut['logger'](_0x793c('0x79'),_[_0x793c('0x75')](_0x218595)?'':_0x218595['name']+_0x793c('0x7a'));return{'isValid':![],'message':_0x793c('0x7b')};}if(_[_0x793c('0x75')](_0x4be2e8['fax'])){ut[_0x793c('0x4e')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0x793c('0x43')](_0x4be2e8));return{'isValid':![],'message':_0x793c('0x7c')};}if(_[_0x793c('0x75')](_0x4be2e8[_0x793c('0x3')])){ut['logger'](_0x793c('0x7d'),JSON[_0x793c('0x43')](_0x4be2e8));return{'isValid':![],'message':_0x793c('0x7e')};}return{'isValid':!![],'message':_0x793c('0x7f')};};module[_0x793c('0x80')]=Fax; \ No newline at end of file +var _0x6207=['updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','SENDING\x20FAILED:\x20','faxstatusstring','SENDING\x20FAILED','send','execOriginate','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','checkAfterSend','checkTrunk','Trunk','isValid','message','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','path','execute','dir','XMF-PATH','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','util','lodash','bluebird','uuid','moment','tiff2pdf','./util/gs','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','newexten','syncNewExten','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','context','from-voip-provider','exten','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','hasOwnProperty','value','prototype','syncNewState','channelstate','channelstatedesc','operation','status','localstationid','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','create','parse','.pdf','application/pdf','then','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','syncOriginateResponse','merge','pick','response','reason','AttachmentId','update','logger','[Fax][Message][Error][NoUpdate1]'];(function(_0x3a1925,_0x370ae6){var _0x393a3c=function(_0x39304f){while(--_0x39304f){_0x3a1925['push'](_0x3a1925['shift']());}};_0x393a3c(++_0x370ae6);}(_0x6207,0xa7));var _0x7620=function(_0x4eedec,_0x5303d3){_0x4eedec=_0x4eedec-0x0;var _0x484ca1=_0x6207[_0x4eedec];return _0x484ca1;};'use strict';var util=require(_0x7620('0x0'));var _=require(_0x7620('0x1'));var BPromise=require(_0x7620('0x2'));var uuid=require(_0x7620('0x3'));var moment=require(_0x7620('0x4'));var path=require('path');var tiff2pdf=require(_0x7620('0x5'));var gs=require(_0x7620('0x6'));var logger=require('../../../config/logger')(_0x7620('0x7'));var ami=require(_0x7620('0x8'));var rpcDb=require(_0x7620('0x9'));var Channel=require(_0x7620('0xa'));var ut=require(_0x7620('0xb'));var Action=require(_0x7620('0xc'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x7620('0xd'));var faxMessage=require(_0x7620('0xe'));function Fax(_0x50c5ce){this[_0x7620('0xf')]={};this[_0x7620('0x10')]=_0x50c5ce['faxAccounts'];this[_0x7620('0x11')]=_0x50c5ce[_0x7620('0x11')];this[_0x7620('0x12')]={};ami['on'](_0x7620('0x13'),this[_0x7620('0x14')][_0x7620('0x15')](this));ami['on'](_0x7620('0x16'),this[_0x7620('0x17')]['bind'](this));ami['on'](_0x7620('0x18'),this['syncNewState'][_0x7620('0x15')](this));ami['on'](_0x7620('0x19'),this[_0x7620('0x1a')][_0x7620('0x15')](this));ami['on']('faxstatus',this[_0x7620('0x1b')]['bind'](this));ami['on'](_0x7620('0x1c'),this[_0x7620('0x1d')][_0x7620('0x15')](this));ami['on'](_0x7620('0x1e'),this[_0x7620('0x1f')][_0x7620('0x15')](this));ami['on'](_0x7620('0x20'),this['syncOriginateResponse']['bind'](this));}Fax['prototype'][_0x7620('0x14')]=function(_0xcfa702){if(_0xcfa702[_0x7620('0x21')]===_0x7620('0x22')){for(var _0x2a3e5e in this[_0x7620('0x10')]){if(this[_0x7620('0x10')]['hasOwnProperty'](_0x2a3e5e)){if(_0xcfa702[_0x7620('0x23')]===this[_0x7620('0x10')][_0x2a3e5e]['localstationid']){this[_0x7620('0xf')][_0xcfa702[_0x7620('0x24')]]={};this[_0x7620('0xf')][_0xcfa702[_0x7620('0x24')]][_0x7620('0x25')]=_0xcfa702[_0x7620('0x25')];this['channels'][_0xcfa702[_0x7620('0x24')]]['id']=this[_0x7620('0x10')][_0x2a3e5e]['id'];this['channels'][_0xcfa702['uniqueid']][_0x7620('0x26')]=this['faxAccounts'][_0x2a3e5e][_0x7620('0x26')];logger[_0x7620('0x27')](_0xcfa702[_0x7620('0x24')],_0x7620('0x28'));}}}}if(this[_0x7620('0x12')][_0xcfa702['uniqueid']]){this[_0x7620('0xf')][_0xcfa702[_0x7620('0x24')]]={};this[_0x7620('0xf')][_0xcfa702[_0x7620('0x24')]][_0x7620('0x25')]=_0xcfa702['channel'];logger[_0x7620('0x27')](_0xcfa702[_0x7620('0x24')],'\x20syncNewchannel\x20');}};Fax['prototype']['syncVarSet']=function(_0x161955){if(this[_0x7620('0xf')][_0x161955[_0x7620('0x24')]]){for(var _0x1f0eb3 in _0x161955[_0x7620('0x29')]){if(_0x161955[_0x7620('0x29')][_0x7620('0x2a')](_0x1f0eb3)){this[_0x7620('0xf')][_0x161955[_0x7620('0x24')]][_0x1f0eb3]=_0x161955[_0x7620('0x2b')];}}}};Fax[_0x7620('0x2c')][_0x7620('0x2d')]=function(_0x547d0c){if(this[_0x7620('0xf')][_0x547d0c[_0x7620('0x24')]]){this['channels'][_0x547d0c['uniqueid']]['channelstate']=_0x547d0c[_0x7620('0x2e')];this[_0x7620('0xf')][_0x547d0c[_0x7620('0x24')]]['channelstatedesc']=_0x547d0c[_0x7620('0x2f')];}};Fax[_0x7620('0x2c')][_0x7620('0x1a')]=function(_0xb83bf4){if(this['channels'][_0xb83bf4['uniqueid']]){for(var _0x1449a6 in _0xb83bf4[_0x7620('0x29')]){if(_0xb83bf4['variable'][_0x7620('0x2a')](_0x1449a6)){this[_0x7620('0xf')][_0xb83bf4[_0x7620('0x24')]][_0x1449a6]=_0xb83bf4['value'];}}}};Fax[_0x7620('0x2c')]['syncFaxStatus']=function(_0x566a19){if(this[_0x7620('0xf')][_0x566a19[_0x7620('0x24')]]){this[_0x7620('0xf')][_0x566a19[_0x7620('0x24')]][_0x7620('0x30')]=_0x566a19[_0x7620('0x30')];this[_0x7620('0xf')][_0x566a19[_0x7620('0x24')]][_0x7620('0x31')]=_0x566a19['status'];this[_0x7620('0xf')][_0x566a19[_0x7620('0x24')]][_0x7620('0x32')]=_0x566a19[_0x7620('0x32')];this[_0x7620('0xf')][_0x566a19['uniqueid']][_0x7620('0x33')]=_0x566a19[_0x7620('0x33')];logger['info'](_0x566a19[_0x7620('0x24')],'\x20syncFaxStatus\x20');}};Fax[_0x7620('0x2c')]['syncReceiveFax']=function(_0x323092){var _0x16339c=this;if(this[_0x7620('0xf')][_0x323092[_0x7620('0x24')]]){var _0x229cf2=this[_0x7620('0xf')][_0x323092[_0x7620('0x24')]]['id'];this[_0x7620('0xf')][_0x323092[_0x7620('0x24')]][_0x7620('0x34')]=_0x323092[_0x7620('0x34')];this[_0x7620('0xf')][_0x323092[_0x7620('0x24')]][_0x7620('0x35')]=_0x323092[_0x7620('0x35')];this['channels'][_0x323092['uniqueid']][_0x7620('0x32')]=_0x323092['localstationid'];this[_0x7620('0xf')][_0x323092['uniqueid']][_0x7620('0x36')]=_0x323092[_0x7620('0x36')];this[_0x7620('0xf')][_0x323092['uniqueid']][_0x7620('0x37')]=_0x323092['transferrate'];this[_0x7620('0xf')][_0x323092[_0x7620('0x24')]]['filename']=_0x323092[_0x7620('0x33')];this[_0x7620('0xf')][_0x323092[_0x7620('0x24')]][_0x7620('0x38')]=_0x323092[_0x7620('0x38')];if(this[_0x7620('0xf')][_0x323092[_0x7620('0x24')]][_0x7620('0x35')]>0x0){tiff2pdf(_0x323092[_0x7620('0x33')],_0x7620('0x39'),function(_0x46e701){logger[_0x7620('0x27')](_0x323092[_0x7620('0x24')],_0x7620('0x3a'),_0x46e701['message']);attachment[_0x7620('0x3b')]({'name':path['parse'](_0x323092[_0x7620('0x33')])['name'],'basename':path[_0x7620('0x3c')](_0x323092[_0x7620('0x33')])[_0x7620('0x26')]+_0x7620('0x3d'),'type':_0x7620('0x3e')})[_0x7620('0x3f')](function(_0x2f447f){faxAccount[_0x7620('0x40')](_0x229cf2,{'from':_0x323092[_0x7620('0x38')],'mapKey':_0x7620('0x7'),'body':path[_0x7620('0x3c')](_0x323092[_0x7620('0x33')])[_0x7620('0x26')]+_0x7620('0x3d'),'AttachmentId':_0x2f447f['id']})[_0x7620('0x41')](function(_0x5513b1){logger[_0x7620('0x42')](_0x323092[_0x7620('0x24')],_0x7620('0x43'),JSON[_0x7620('0x44')](_0x5513b1));});})[_0x7620('0x41')](function(_0x27aded){logger[_0x7620('0x42')](_0x323092[_0x7620('0x24')],'\x20receiveFax\x20',JSON[_0x7620('0x44')](_0x27aded));});});}logger[_0x7620('0x27')](_0x323092['uniqueid'],_0x7620('0x45'));}};Fax[_0x7620('0x2c')][_0x7620('0x46')]=function(_0x4daca1){if(this[_0x7620('0x12')][_0x4daca1[_0x7620('0x24')]]){_[_0x7620('0x47')](this['channels'][_0x4daca1[_0x7620('0x24')]],_[_0x7620('0x48')](_0x4daca1,[_0x7620('0x49'),_0x7620('0x4a')]));}};function updateStatus(_0x5e03d9){if(_0x5e03d9[_0x7620('0x4b')]){faxMessage[_0x7620('0x4c')](_0x5e03d9[_0x7620('0x4b')],{'failMessage':'SENDING\x20FAILED\x20'})[_0x7620('0x3f')](function(_0x22cff9){ut[_0x7620('0x4d')]('[Fax][Message][Error][Updated]',_0x22cff9);})[_0x7620('0x41')](function(_0x5c529f){ut[_0x7620('0x4d')](_0x7620('0x4e'),_0x5c529f);});}else{ut['logger']('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x7620('0x2c')][_0x7620('0x4f')]=function(_0x288816,_0x4865a1,_0x5321ec){var _0x44ef0e=this;var _0x46da4e={};if(_0x4865a1){_0x46da4e={'read':_0x4865a1};}else{_0x46da4e={'failMessage':_0x5321ec};}if(this[_0x7620('0x12')][_0x288816][_0x7620('0x4b')]){faxMessage['update'](this[_0x7620('0x12')][_0x288816][_0x7620('0x4b')],_0x46da4e)['then'](function(_0x4717f8){ut[_0x7620('0x4d')](_0x7620('0x50'),_0x4717f8);})[_0x7620('0x41')](function(_0x1cf13c){ut['logger'](_0x7620('0x51'),_0x1cf13c);})[_0x7620('0x52')](function(){delete _0x44ef0e[_0x7620('0xf')][_0x288816];delete _0x44ef0e[_0x7620('0x12')][_0x288816];});}else{ut[_0x7620('0x4d')]('[Fax][Message][NoUpdate2]');delete this[_0x7620('0xf')][_0x288816];delete this['actions'][_0x288816];}};Fax[_0x7620('0x2c')][_0x7620('0x1f')]=function(_0x558da4){var _0x29c369=this;if(this[_0x7620('0xf')][_0x558da4[_0x7620('0x24')]]){if(this[_0x7620('0x12')][_0x558da4[_0x7620('0x24')]]){this[_0x7620('0xf')][_0x558da4[_0x7620('0x24')]]['id']=this[_0x7620('0x12')][_0x558da4[_0x7620('0x24')]]['id'];this[_0x7620('0xf')][_0x558da4[_0x7620('0x24')]][_0x7620('0x26')]=this[_0x7620('0x12')][_0x558da4['uniqueid']][_0x7620('0x26')];}logger[_0x7620('0x27')](_0x558da4[_0x7620('0x24')],this[_0x7620('0x12')][_0x558da4[_0x7620('0x24')]]?_0x7620('0x53'):_0x7620('0x54'),JSON['stringify'](this[_0x7620('0xf')][_0x558da4['uniqueid']]));if(this[_0x7620('0x12')][_0x558da4[_0x7620('0x24')]]){if(this['channels'][_0x558da4[_0x7620('0x24')]][_0x7620('0x55')]>0x0&&this[_0x7620('0xf')][_0x558da4[_0x7620('0x24')]][_0x7620('0x56')]==='SUCCESS'){this[_0x7620('0x4f')](_0x558da4[_0x7620('0x24')],!![]);}else{this['updateStatus'](_0x558da4[_0x7620('0x24')],![],this[_0x7620('0xf')][_0x558da4[_0x7620('0x24')]]['faxstatusstring']?_0x7620('0x57')+this['channels'][_0x558da4['uniqueid']][_0x7620('0x58')]:_0x7620('0x59'));}}}};Fax[_0x7620('0x2c')][_0x7620('0x5a')]=function(_0x54af64){var _0x373a52=this;return new BPromise(function(_0x14d21e,_0x1cd490){_0x373a52[_0x7620('0x5b')](_0x54af64,_0x373a52[_0x7620('0x10')][_0x54af64['FaxAccountId']])[_0x7620('0x3f')](function(_0x65f367){ut[_0x7620('0x4d')](_0x7620('0x5c'),_0x65f367);_0x14d21e(ut['message'](_0x7620('0x5d')));})[_0x7620('0x41')](function(_0x438073){ut[_0x7620('0x4d')](_0x7620('0x5e'),_0x438073);updateStatus(_0x54af64);_0x1cd490(ut['message']('Fax\x20failed'));});});};Fax[_0x7620('0x2c')][_0x7620('0x5f')]=function(_0x5d056c){var _0x2c39e3=this;return new BPromise(function(_0x14adfd,_0x250ead){var _0x509e95=_0x2c39e3[_0x7620('0x60')](_0x2c39e3[_0x7620('0x10')][_0x5d056c['FaxAccountId']][_0x7620('0x61')],_0x5d056c);if(_0x509e95[_0x7620('0x62')]){_0x14adfd(ut[_0x7620('0x63')](_0x7620('0x64')));}else{_0x250ead(ut[_0x7620('0x63')](_0x509e95[_0x7620('0x63')]));}});};function originate(_0x27d41a,_0x4dd460,_0xb070bc){return new BPromise(function(_0xa9282b,_0x27461a){if(_0xb070bc){var _0x5d85c0=util[_0x7620('0x65')](_0x7620('0x66'),path[_0x7620('0x3c')](_0x27d41a[_0x7620('0x67')])[_0x7620('0x26')],_0x27d41a[_0x7620('0x67')]);gs[_0x7620('0x68')](_0x5d85c0)['then'](function(){_0x27d41a[_0x7620('0x67')]=util[_0x7620('0x65')]('%s/%s.tif',path['parse'](_0x27d41a[_0x7620('0x67')])[_0x7620('0x69')],path[_0x7620('0x3c')](_0x27d41a[_0x7620('0x67')])[_0x7620('0x26')]);_0x4dd460[_0x7620('0x6a')]=_0x27d41a[_0x7620('0x67')];ut['logger']('Convert\x20pdf\x20to\x20tif','');ami[_0x7620('0x6b')](ut[_0x7620('0x6c')](_0x27d41a,_0x4dd460))[_0x7620('0x3f')](function(_0x2484bf){_0xa9282b(_0x2484bf);})[_0x7620('0x41')](function(_0x2a8c82){_0x27461a(_0x2a8c82);});})[_0x7620('0x41')](function(_0x194aaf){_0x27461a(_0x194aaf);});}else{ami['Action'](ut[_0x7620('0x6c')](_0x27d41a,_0x4dd460))[_0x7620('0x3f')](function(_0x4caa3d){_0xa9282b(_0x4caa3d);})[_0x7620('0x41')](function(_0x294d0f){_0x27461a(_0x294d0f);});}});}Fax[_0x7620('0x2c')][_0x7620('0x5b')]=function(_0xec0f61,_0x35060a){var _0x38e51d=this;return new BPromise(function(_0x10b03c,_0x10082f){var _0x69fa2f=uuid['v4']();var _0x172bab=ut[_0x7620('0x6d')](_0xec0f61,_0x35060a);_0x38e51d['actions'][_0x69fa2f]=new Action(_0x69fa2f,_0x35060a,_0xec0f61);var _0xdd870b=_0x38e51d[_0x7620('0x12')][_0x69fa2f];if(path[_0x7620('0x3c')](_0xec0f61['path'])[_0x7620('0x6e')]===_0x7620('0x3d')){originate(_0xdd870b,_0x172bab,!![])[_0x7620('0x3f')](function(_0x19bcdf){_0x10b03c(_0x19bcdf);})[_0x7620('0x41')](function(_0xcec50f){_0x10082f(_0xcec50f);});}else{originate(_0xdd870b,_0x172bab,![])[_0x7620('0x3f')](function(_0x5815d6){_0x10b03c(_0x5815d6);})[_0x7620('0x41')](function(_0x3b81c2){_0x10082f(_0x3b81c2);});}});};Fax['prototype'][_0x7620('0x6f')]=function(_0x1a9ca2){return!_['isNil'](_0x1a9ca2)&&!_[_0x7620('0x70')](_0x1a9ca2[_0x7620('0x26')])&&!_[_0x7620('0x70')](_0x1a9ca2[_0x7620('0x71')])&&_0x1a9ca2[_0x7620('0x71')]&&!_[_0x7620('0x70')](this[_0x7620('0x11')][util[_0x7620('0x65')](_0x7620('0x72'),_0x1a9ca2[_0x7620('0x26')])])&&!_['isNil'](this[_0x7620('0x11')][util['format']('SIP/%s',_0x1a9ca2[_0x7620('0x26')])][_0x7620('0x31')])&&(this[_0x7620('0x11')][util[_0x7620('0x65')](_0x7620('0x72'),_0x1a9ca2[_0x7620('0x26')])]['status']===_0x7620('0x73')||this['trunks'][util[_0x7620('0x65')](_0x7620('0x72'),_0x1a9ca2[_0x7620('0x26')])][_0x7620('0x31')]===_0x7620('0x74'));};Fax[_0x7620('0x2c')]['checkTrunk']=function(_0x2d4a83,_0x24456b){if(!this['isTrunkReachable'](_0x2d4a83)){ut[_0x7620('0x4d')](_0x7620('0x75'),_[_0x7620('0x70')](_0x2d4a83)?'':_0x2d4a83[_0x7620('0x26')]+_0x7620('0x76'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_[_0x7620('0x70')](_0x24456b['fax'])){ut[_0x7620('0x4d')](_0x7620('0x77'),JSON['stringify'](_0x24456b));return{'isValid':![],'message':_0x7620('0x78')};}if(_['isNil'](_0x24456b[_0x7620('0x67')])){ut[_0x7620('0x4d')](_0x7620('0x79'),JSON['stringify'](_0x24456b));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x7620('0x7a')};};module['exports']=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 92f7a17..9dedf29 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 _0x4c2c=['resolve','catch','[Notify]\x20','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','inspect','notify'];(function(_0x28d1ea,_0x426311){var _0x1667b6=function(_0x136219){while(--_0x136219){_0x28d1ea['push'](_0x28d1ea['shift']());}};_0x1667b6(++_0x426311);}(_0x4c2c,0xa3));var _0xc4c2=function(_0x5ee0ee,_0x3ce413){_0x5ee0ee=_0x5ee0ee-0x0;var _0x198093=_0x4c2c[_0x5ee0ee];return _0x198093;};'use strict';var util=require('util');var BPromise=require(_0xc4c2('0x0'));var logger=require(_0xc4c2('0x1'))(_0xc4c2('0x2'));var _=require(_0xc4c2('0x3'));var faxAccount=require(_0xc4c2('0x4'));function loggerCatch(_0x1f91b6){return function(_0x1a12dc){logger['error'](_0x1f91b6,util[_0xc4c2('0x5')](_0x1a12dc,{'showHidden':![],'depth':null}));};}exports[_0xc4c2('0x6')]=function(_0x2435b8,_0xe0aafb){return BPromise[_0xc4c2('0x7')]()['then'](faxAccount[_0xc4c2('0x6')](_0x2435b8,_0xe0aafb))[_0xc4c2('0x8')](loggerCatch(_0xc4c2('0x9')));}; \ No newline at end of file +var _0x91c1=['bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','resolve','then','catch'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x91c1,0x154));var _0x191c=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x91c1[_0x55f8b4];return _0x2475f9;};'use strict';var util=require('util');var BPromise=require(_0x191c('0x0'));var logger=require(_0x191c('0x1'))(_0x191c('0x2'));var _=require(_0x191c('0x3'));var faxAccount=require(_0x191c('0x4'));function loggerCatch(_0x2a4cf1){return function(_0x14fa14){logger[_0x191c('0x5')](_0x2a4cf1,util[_0x191c('0x6')](_0x14fa14,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0xe3f372,_0x20d28e){return BPromise[_0x191c('0x7')]()[_0x191c('0x8')](faxAccount['notify'](_0xe3f372,_0x20d28e))[_0x191c('0x9')](loggerCatch('[Notify]\x20'));}; \ 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 a935da0..a09eff7 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 _0x6644=['execute','info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','fax','child_process','exec'];(function(_0x59685b,_0x396a9e){var _0x22c79b=function(_0x27bc19){while(--_0x27bc19){_0x59685b['push'](_0x59685b['shift']());}};_0x22c79b(++_0x396a9e);}(_0x6644,0xd7));var _0x4664=function(_0x43f95e,_0x1a48ea){_0x43f95e=_0x43f95e-0x0;var _0x4c56d0=_0x6644[_0x43f95e];return _0x4c56d0;};'use strict';var util=require(_0x4664('0x0'));var logger=require(_0x4664('0x1'))(_0x4664('0x2'));var BPromise=require('bluebird');var exec=require(_0x4664('0x3'))[_0x4664('0x4')];exports[_0x4664('0x5')]=function(_0x23f790){return new BPromise(function(_0x2deea9,_0x1575f4){exec(_0x23f790,function(_0xe4cfe,_0x3ad1d7,_0xcf91f1){logger[_0x4664('0x6')](_0x4664('0x7'),_0x3ad1d7);if(_0xe4cfe){logger[_0x4664('0x6')](_0x4664('0x7'),_0x4664('0x8'),util[_0x4664('0x9')](_0xe4cfe,{'showHidden':![],'depth':null}),_0x3ad1d7,_0xcf91f1);_0x1575f4(_0xe4cfe);}_0x2deea9(_0x3ad1d7);});});}; \ No newline at end of file +var _0x8e3c=['util','../../../../config/logger','fax','bluebird','child_process','execute','info','Exec\x20gs','inspect'];(function(_0x424ad9,_0xf2f4ad){var _0x4d2429=function(_0x56110b){while(--_0x56110b){_0x424ad9['push'](_0x424ad9['shift']());}};_0x4d2429(++_0xf2f4ad);}(_0x8e3c,0x105));var _0xc8e3=function(_0x3c5175,_0x4deae6){_0x3c5175=_0x3c5175-0x0;var _0x5cebfc=_0x8e3c[_0x3c5175];return _0x5cebfc;};'use strict';var util=require(_0xc8e3('0x0'));var logger=require(_0xc8e3('0x1'))(_0xc8e3('0x2'));var BPromise=require(_0xc8e3('0x3'));var exec=require(_0xc8e3('0x4'))['exec'];exports[_0xc8e3('0x5')]=function(_0x3c7aef){return new BPromise(function(_0x2f058a,_0x246ebc){exec(_0x3c7aef,function(_0x150a1a,_0x4a310b,_0x1fd15d){logger[_0xc8e3('0x6')](_0xc8e3('0x7'),_0x4a310b);if(_0x150a1a){logger[_0xc8e3('0x6')](_0xc8e3('0x7'),'\x20Error\x20:',util[_0xc8e3('0x8')](_0x150a1a,{'showHidden':![],'depth':null}),_0x4a310b,_0x1fd15d);_0x246ebc(_0x150a1a);}_0x2f058a(_0x4a310b);});});}; \ 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 8fea936..474ad0c 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 _0xe411=['maxrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','path','originate','channel','from-sip','\x22%s\x22\x20<%s>','localstationid','util','lodash','moment','fax','message','logger','inspect','addVariables','ecm','headerinfo','minrate'];(function(_0x35ee93,_0x307320){var _0x3cdd31=function(_0x8c183f){while(--_0x8c183f){_0x35ee93['push'](_0x35ee93['shift']());}};_0x3cdd31(++_0x307320);}(_0xe411,0x175));var _0x1e41=function(_0x16362c,_0xa9bbf6){_0x16362c=_0x16362c-0x0;var _0xa361be=_0xe411[_0x16362c];return _0xa361be;};'use strict';var util=require(_0x1e41('0x0'));var _=require(_0x1e41('0x1'));var moment=require(_0x1e41('0x2'));var logger=require('../../../../config/logger')(_0x1e41('0x3'));exports[_0x1e41('0x4')]=function(_0x42c3c7){return{'message':_0x42c3c7};};exports[_0x1e41('0x5')]=function(_0x4f6df8,_0x41b98f){logger['info'](_0x4f6df8,util[_0x1e41('0x6')](_0x41b98f,{'showHidden':![],'depth':null}));};exports[_0x1e41('0x7')]=function(_0xa441d6,_0x58e75d){var _0x5b3035={'XMF-ECM':_0x58e75d[_0x1e41('0x8')],'XMF-HEADERINFO':_0x58e75d[_0x1e41('0x9')],'XMF-MINRATE':_0x58e75d[_0x1e41('0xa')],'XMF-MAXRATE':_0x58e75d[_0x1e41('0xb')],'XMF-MODEM':util[_0x1e41('0xc')](_0x1e41('0xd'),_0x58e75d[_0x1e41('0xe')]),'XMF-GATEWAY':_0x58e75d[_0x1e41('0xf')],'XMF-FAXDETECT':_0x58e75d[_0x1e41('0x10')],'XMF-T38TIMEOUT':_0x58e75d[_0x1e41('0x11')],'XMF-LOCALSTATIONID':_0x58e75d['localstationid'],'XMF-PATH':_0xa441d6[_0x1e41('0x12')]};return _0x5b3035;};exports['variablesAction']=function(_0x2d8a49,_0x1401bd){return{'actionid':_0x2d8a49['uniqueid'],'action':_0x1e41('0x13'),'channel':_0x2d8a49[_0x1e41('0x14')],'Exten':'xcally-motion-fax','Context':_0x1e41('0x15'),'Priority':'1','callerid':util[_0x1e41('0xc')](_0x1e41('0x16'),_0x2d8a49[_0x1e41('0x9')]?_0x2d8a49[_0x1e41('0x9')]:'',_0x2d8a49[_0x1e41('0x17')]),'variable':_0x1401bd,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x2d8a49['uniqueid']};}; \ No newline at end of file +var _0xa312=['ecm','minrate','maxrate','format','\x22%s\x22','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','originate','channel','from-sip','headerinfo','lodash','moment','../../../../config/logger','fax','logger','inspect','addVariables'];(function(_0x125398,_0x34e686){var _0x24181c=function(_0x5d3ef3){while(--_0x5d3ef3){_0x125398['push'](_0x125398['shift']());}};_0x24181c(++_0x34e686);}(_0xa312,0x180));var _0x2a31=function(_0x3e25c1,_0x1d15f9){_0x3e25c1=_0x3e25c1-0x0;var _0x52e7f2=_0xa312[_0x3e25c1];return _0x52e7f2;};'use strict';var util=require('util');var _=require(_0x2a31('0x0'));var moment=require(_0x2a31('0x1'));var logger=require(_0x2a31('0x2'))(_0x2a31('0x3'));exports['message']=function(_0x81d152){return{'message':_0x81d152};};exports[_0x2a31('0x4')]=function(_0x4b227d,_0x254532){logger['info'](_0x4b227d,util[_0x2a31('0x5')](_0x254532,{'showHidden':![],'depth':null}));};exports[_0x2a31('0x6')]=function(_0x232076,_0x44a831){var _0x30e6af={'XMF-ECM':_0x44a831[_0x2a31('0x7')],'XMF-HEADERINFO':_0x44a831['headerinfo'],'XMF-MINRATE':_0x44a831[_0x2a31('0x8')],'XMF-MAXRATE':_0x44a831[_0x2a31('0x9')],'XMF-MODEM':util[_0x2a31('0xa')](_0x2a31('0xb'),_0x44a831['modem']),'XMF-GATEWAY':_0x44a831[_0x2a31('0xc')],'XMF-FAXDETECT':_0x44a831[_0x2a31('0xd')],'XMF-T38TIMEOUT':_0x44a831[_0x2a31('0xe')],'XMF-LOCALSTATIONID':_0x44a831[_0x2a31('0xf')],'XMF-PATH':_0x232076[_0x2a31('0x10')]};return _0x30e6af;};exports[_0x2a31('0x11')]=function(_0x4f578b,_0x48400d){return{'actionid':_0x4f578b[_0x2a31('0x12')],'action':_0x2a31('0x13'),'channel':_0x4f578b[_0x2a31('0x14')],'Exten':'xcally-motion-fax','Context':_0x2a31('0x15'),'Priority':'1','callerid':util['format']('\x22%s\x22\x20<%s>',_0x4f578b['headerinfo']?_0x4f578b[_0x2a31('0x16')]:'',_0x4f578b[_0x2a31('0xf')]),'variable':_0x48400d,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x4f578b[_0x2a31('0x12')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 32ae59c..a6ce7dc 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 _0xc5f3=['./rpc/integrations/freshsales','../../config/logger','get','hour','then','getAgents','initAgents','getTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueReports','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','[index.js][main]','bluebird','util','moment','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./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(_0x170ee9,_0x4d2682){var _0x1ea093=function(_0x1ab3bf){while(--_0x1ab3bf){_0x170ee9['push'](_0x170ee9['shift']());}};_0x1ea093(++_0x4d2682);}(_0xc5f3,0x1df));var _0x3c5f=function(_0x7da12d,_0x5d1d84){_0x7da12d=_0x7da12d-0x0;var _0x5719b4=_0xc5f3[_0x7da12d];return _0x5719b4;};'use strict';var BPromise=require(_0x3c5f('0x0'));var util=require(_0x3c5f('0x1'));var moment=require(_0x3c5f('0x2'));var server=require('./server');var Realtime=require(_0x3c5f('0x3'));var Report=require(_0x3c5f('0x4'));var Acw=require(_0x3c5f('0x5'));var Trigger=require(_0x3c5f('0x6'));var Dialer=require(_0x3c5f('0x7'));var Preview=require(_0x3c5f('0x8'));var Fax=require(_0x3c5f('0x9'));var user=require(_0x3c5f('0xa'));var voiceQueue=require(_0x3c5f('0xb'));var voiceQueueReport=require(_0x3c5f('0xc'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x3c5f('0xd'));var trigger=require('./rpc/trigger');var template=require(_0x3c5f('0xe'));var cmHopperHistory=require(_0x3c5f('0xf'));var campaign=require(_0x3c5f('0x10'));var voiceExtension=require(_0x3c5f('0x11'));var faxAccount=require(_0x3c5f('0x12'));var zendesk=require(_0x3c5f('0x13'));var salesforce=require(_0x3c5f('0x14'));var sugarcrm=require(_0x3c5f('0x15'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x3c5f('0x16'));var zoho=require(_0x3c5f('0x17'));var vtiger=require(_0x3c5f('0x18'));var freshsales=require(_0x3c5f('0x19'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x3c5f('0x1a'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x3c5f('0x1b')](_0x3c5f('0x1c'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x3c5f('0x1b')](_0x3c5f('0x1c'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x3c5f('0x1d')](user[_0x3c5f('0x1e')]())[_0x3c5f('0x1d')](realtime[_0x3c5f('0x1f')]())[_0x3c5f('0x1d')](user[_0x3c5f('0x20')]())[_0x3c5f('0x1d')](realtime['initTelephones']())[_0x3c5f('0x1d')](trunk[_0x3c5f('0x21')]())[_0x3c5f('0x1d')](realtime[_0x3c5f('0x22')]())[_0x3c5f('0x1d')](voiceQueue[_0x3c5f('0x23')]())[_0x3c5f('0x1d')](realtime[_0x3c5f('0x24')]())['then'](trigger[_0x3c5f('0x25')]())[_0x3c5f('0x1d')](realtime[_0x3c5f('0x26')]())['then'](template['getTemplates']())['then'](realtime['initTemplates']())[_0x3c5f('0x1d')](zendesk['getZendeskAccounts']())[_0x3c5f('0x1d')](realtime[_0x3c5f('0x27')]())['then'](salesforce[_0x3c5f('0x28')]())[_0x3c5f('0x1d')](realtime['initSalesforceAccounts']())['then'](sugarcrm[_0x3c5f('0x29')]())[_0x3c5f('0x1d')](realtime[_0x3c5f('0x2a')]())[_0x3c5f('0x1d')](freshdesk['getFreshdeskAccounts']())['then'](realtime[_0x3c5f('0x2b')]())['then'](desk[_0x3c5f('0x2c')]())['then'](realtime[_0x3c5f('0x2d')]())[_0x3c5f('0x1d')](zoho['getZohoAccounts']())[_0x3c5f('0x1d')](realtime[_0x3c5f('0x2e')]())[_0x3c5f('0x1d')](vtiger[_0x3c5f('0x2f')]())[_0x3c5f('0x1d')](realtime[_0x3c5f('0x30')]())[_0x3c5f('0x1d')](freshsales[_0x3c5f('0x31')]())[_0x3c5f('0x1d')](realtime[_0x3c5f('0x32')]())[_0x3c5f('0x1d')](servicenow[_0x3c5f('0x33')]())['then'](realtime[_0x3c5f('0x34')]())[_0x3c5f('0x1d')](dynamics365[_0x3c5f('0x35')]())[_0x3c5f('0x1d')](realtime[_0x3c5f('0x36')]())[_0x3c5f('0x1d')](campaign[_0x3c5f('0x37')]())[_0x3c5f('0x1d')](realtime[_0x3c5f('0x38')]())[_0x3c5f('0x1d')](voiceExtension[_0x3c5f('0x39')]())['then'](realtime[_0x3c5f('0x3a')]())[_0x3c5f('0x1d')](faxAccount[_0x3c5f('0x3b')]())['then'](realtime[_0x3c5f('0x3c')]())[_0x3c5f('0x1d')](function(){return realtime;});}function initParams(){return BPromise[_0x3c5f('0x3d')]()['then'](voiceQueueReport[_0x3c5f('0x3e')]())['then'](realtime[_0x3c5f('0x3f')]())[_0x3c5f('0x1d')](cmHopperHistory['getVoiceQueueHopperHistory']())['then'](realtime['initVoiceQueueHopperHistory']())[_0x3c5f('0x1d')](cmHopperHistory['getCampaignHopperHistory']())['then'](realtime['initCampaignHopperHistory']())['then'](voiceCallReport[_0x3c5f('0x40')]())[_0x3c5f('0x1d')](realtime[_0x3c5f('0x41')]())[_0x3c5f('0x42')](function(_0x84f836){logger[_0x3c5f('0x43')](_0x3c5f('0x44'),util[_0x3c5f('0x45')](_0x84f836,{'showHidden':![],'depth':null}));});}function main(){return server[_0x3c5f('0x46')](realtime,preview,fax)[_0x3c5f('0x1d')](function(_0x9732e7){return initRealtime();})[_0x3c5f('0x1d')](function(){return initParams();})[_0x3c5f('0x1d')](function(){report['sync']();setInterval(initRealtime,0x1388);})['catch'](function(_0x3e41fe){logger['error'](_0x3c5f('0x47'),util['inspect'](_0x3e41fe,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x4b03=['initVoiceExtensions','getFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','bluebird','util','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/freshsales','./rpc/integrations/servicenow','hour','then','getTelephones','getTrunks','initTrunks','getVoiceQueues','getTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','initCampaigns'];(function(_0x89d79e,_0x3b5ddf){var _0x1a01c7=function(_0xdca183){while(--_0xdca183){_0x89d79e['push'](_0x89d79e['shift']());}};_0x1a01c7(++_0x3b5ddf);}(_0x4b03,0x11f));var _0x34b0=function(_0x12e655,_0x129ebe){_0x12e655=_0x12e655-0x0;var _0x94e25c=_0x4b03[_0x12e655];return _0x94e25c;};'use strict';var BPromise=require(_0x34b0('0x0'));var util=require(_0x34b0('0x1'));var moment=require(_0x34b0('0x2'));var server=require(_0x34b0('0x3'));var Realtime=require(_0x34b0('0x4'));var Report=require(_0x34b0('0x5'));var Acw=require(_0x34b0('0x6'));var Trigger=require(_0x34b0('0x7'));var Dialer=require(_0x34b0('0x8'));var Preview=require(_0x34b0('0x9'));var Fax=require(_0x34b0('0xa'));var user=require(_0x34b0('0xb'));var voiceQueue=require(_0x34b0('0xc'));var voiceQueueReport=require(_0x34b0('0xd'));var voiceCallReport=require(_0x34b0('0xe'));var trunk=require(_0x34b0('0xf'));var trigger=require('./rpc/trigger');var template=require('./rpc/template');var cmHopperHistory=require(_0x34b0('0x10'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x34b0('0x11'));var faxAccount=require(_0x34b0('0x12'));var zendesk=require(_0x34b0('0x13'));var salesforce=require(_0x34b0('0x14'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0x34b0('0x15'));var desk=require(_0x34b0('0x16'));var zoho=require('./rpc/integrations/zoho');var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0x34b0('0x17'));var servicenow=require(_0x34b0('0x18'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x34b0('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x34b0('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x34b0('0x1a')](user['getAgents']())[_0x34b0('0x1a')](realtime['initAgents']())[_0x34b0('0x1a')](user[_0x34b0('0x1b')]())[_0x34b0('0x1a')](realtime['initTelephones']())[_0x34b0('0x1a')](trunk[_0x34b0('0x1c')]())[_0x34b0('0x1a')](realtime[_0x34b0('0x1d')]())[_0x34b0('0x1a')](voiceQueue[_0x34b0('0x1e')]())[_0x34b0('0x1a')](realtime['initVoiceQueues']())['then'](trigger[_0x34b0('0x1f')]())[_0x34b0('0x1a')](realtime['initTriggers']())[_0x34b0('0x1a')](template[_0x34b0('0x20')]())[_0x34b0('0x1a')](realtime[_0x34b0('0x21')]())[_0x34b0('0x1a')](zendesk[_0x34b0('0x22')]())[_0x34b0('0x1a')](realtime[_0x34b0('0x23')]())[_0x34b0('0x1a')](salesforce['getSalesforceAccounts']())[_0x34b0('0x1a')](realtime[_0x34b0('0x24')]())[_0x34b0('0x1a')](sugarcrm[_0x34b0('0x25')]())[_0x34b0('0x1a')](realtime[_0x34b0('0x26')]())[_0x34b0('0x1a')](freshdesk[_0x34b0('0x27')]())[_0x34b0('0x1a')](realtime[_0x34b0('0x28')]())['then'](desk[_0x34b0('0x29')]())['then'](realtime[_0x34b0('0x2a')]())[_0x34b0('0x1a')](zoho[_0x34b0('0x2b')]())[_0x34b0('0x1a')](realtime[_0x34b0('0x2c')]())['then'](vtiger[_0x34b0('0x2d')]())[_0x34b0('0x1a')](realtime[_0x34b0('0x2e')]())[_0x34b0('0x1a')](freshsales[_0x34b0('0x2f')]())[_0x34b0('0x1a')](realtime['initFreshsalesAccounts']())[_0x34b0('0x1a')](servicenow[_0x34b0('0x30')]())[_0x34b0('0x1a')](realtime[_0x34b0('0x31')]())['then'](dynamics365[_0x34b0('0x32')]())['then'](realtime['initDynamics365Accounts']())[_0x34b0('0x1a')](campaign[_0x34b0('0x33')]())['then'](realtime[_0x34b0('0x34')]())['then'](voiceExtension['getVoiceExtensions']())[_0x34b0('0x1a')](realtime[_0x34b0('0x35')]())[_0x34b0('0x1a')](faxAccount[_0x34b0('0x36')]())[_0x34b0('0x1a')](realtime['initFaxAccounts']())[_0x34b0('0x1a')](function(){return realtime;});}function initParams(){return BPromise['resolve']()['then'](voiceQueueReport[_0x34b0('0x37')]())[_0x34b0('0x1a')](realtime[_0x34b0('0x38')]())[_0x34b0('0x1a')](cmHopperHistory[_0x34b0('0x39')]())[_0x34b0('0x1a')](realtime[_0x34b0('0x3a')]())['then'](cmHopperHistory[_0x34b0('0x3b')]())['then'](realtime[_0x34b0('0x3c')]())['then'](voiceCallReport[_0x34b0('0x3d')]())[_0x34b0('0x1a')](realtime[_0x34b0('0x3e')]())[_0x34b0('0x3f')](function(_0x508d7d){logger[_0x34b0('0x40')](_0x34b0('0x41'),util[_0x34b0('0x42')](_0x508d7d,{'showHidden':![],'depth':null}));});}function main(){return server[_0x34b0('0x43')](realtime,preview,fax)[_0x34b0('0x1a')](function(_0x3b39cf){return initRealtime();})[_0x34b0('0x1a')](function(){return initParams();})[_0x34b0('0x1a')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x34b0('0x3f')](function(_0x301d18){logger[_0x34b0('0x40')]('[index.js][main]',util['inspect'](_0x301d18,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index b765e66..b607086 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 _0xe706=['address','phone','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','updateStatusRealtime','not_inuse','inuse','talking','format','interface','stringify','md5','user:%s','emit','user:presence','lodash','util','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status'];(function(_0x454609,_0x92d29c){var _0x34b461=function(_0x8ff9fc){while(--_0x8ff9fc){_0x454609['push'](_0x454609['shift']());}};_0x34b461(++_0x92d29c);}(_0xe706,0xa3));var _0x6e70=function(_0x546ab6,_0x357f23){_0x546ab6=_0x546ab6-0x0;var _0x3952ca=_0xe706[_0x546ab6];return _0x3952ca;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var md5=require('md5');var Redis=require(_0x6e70('0x3'));var config=require(_0x6e70('0x4'));config[_0x6e70('0x5')]=_[_0x6e70('0x6')](config[_0x6e70('0x5')],{'host':_0x6e70('0x7'),'port':0x18eb});var io=require(_0x6e70('0x8'))(new Redis(config[_0x6e70('0x5')]));function Agent(_0x1b0389){this['id']=_0x1b0389['id']||0x0;this[_0x6e70('0x9')]=_0x1b0389[_0x6e70('0x9')]||'';this[_0x6e70('0xa')]=_0x1b0389[_0x6e70('0xa')]||'';this[_0x6e70('0xb')]=_0x1b0389[_0x6e70('0xb')]||'';this[_0x6e70('0xc')]=_0x1b0389[_0x6e70('0xc')]||'';this[_0x6e70('0xd')]=_0x6e70('0xe');this[_0x6e70('0xf')]=0x0;this[_0x6e70('0x10')]=_0x6e70('0xe');this[_0x6e70('0x11')]='';this[_0x6e70('0x12')]='';this['mobile']='';this['interface']='';this[_0x6e70('0x13')]=_0x1b0389[_0x6e70('0x13')]||![];this[_0x6e70('0x14')]=_0x6e70('0xe');this[_0x6e70('0x15')]=0x0;this[_0x6e70('0x16')]='';this[_0x6e70('0x17')]='';this[_0x6e70('0x18')]=![];this['local']=![];this['md5']='';}Agent['prototype'][_0x6e70('0x19')]=function(_0x5a37a6){var _0x53aed0;if(_0x5a37a6&&_0x5a37a6[_0x6e70('0xd')]){_0x53aed0=_0x5a37a6[_0x6e70('0xd')]['toLowerCase']();switch(_0x53aed0){case _0x6e70('0x1a'):_0x53aed0='idle';break;case _0x6e70('0x1b'):_0x53aed0=_0x6e70('0x1c');break;}}if(_0x53aed0&&this['voiceStatus']!==_0x53aed0||_0x5a37a6['statePause']){this[_0x6e70('0x15')]=_['toNumber'](moment()[_0x6e70('0x1d')]('x'));}if(_0x53aed0){this[_0x6e70('0x14')]=_0x53aed0;}var _0x53acdc={'id':this['id'],'name':this['name'],'email':this[_0x6e70('0xa')],'accountcode':this[_0x6e70('0xb')],'fullname':this[_0x6e70('0xc')],'state':this[_0x6e70('0xd')],'stateTime':this[_0x6e70('0xf')],'status':this[_0x6e70('0x10')],'address':this[_0x6e70('0x11')],'online':this[_0x6e70('0x13')],'voiceStatus':this[_0x6e70('0x14')],'voiceStatusTime':this[_0x6e70('0x15')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x6e70('0x17')],'interface':this[_0x6e70('0x1e')],'onhold':this[_0x6e70('0x18')]};var _0x502b2d=md5(JSON[_0x6e70('0x1f')](_0x53acdc));if(this[_0x6e70('0x20')]!==_0x502b2d){this[_0x6e70('0x20')]=_0x502b2d;io['to'](util['format'](_0x6e70('0x21'),_0x53acdc['name']))['emit']('user:save',_0x53acdc);io[_0x6e70('0x22')](_0x6e70('0x23'),_0x53acdc);}};module['exports']=Agent; \ No newline at end of file +var _0xcb91=['name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusQueue','onhold','local','updateStatusRealtime','state','idle','inuse','talking','statePause','voiceStatusTime','toNumber','voiceStatusCallerIdNumber','stringify','format','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','defaults','redis','socket.io-emitter'];(function(_0x2d6a23,_0x2443b7){var _0x1d2a01=function(_0x105aea){while(--_0x105aea){_0x2d6a23['push'](_0x2d6a23['shift']());}};_0x1d2a01(++_0x2443b7);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1f530d,_0x18a19e){_0x1f530d=_0x1f530d-0x0;var _0x22103f=_0xcb91[_0x1f530d];return _0x22103f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var md5=require(_0x1cb9('0x1'));var Redis=require(_0x1cb9('0x2'));var config=require(_0x1cb9('0x3'));config['redis']=_[_0x1cb9('0x4')](config[_0x1cb9('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x1cb9('0x6'))(new Redis(config[_0x1cb9('0x5')]));function Agent(_0x53ffbd){this['id']=_0x53ffbd['id']||0x0;this[_0x1cb9('0x7')]=_0x53ffbd[_0x1cb9('0x7')]||'';this['email']=_0x53ffbd[_0x1cb9('0x8')]||'';this[_0x1cb9('0x9')]=_0x53ffbd['accountcode']||'';this[_0x1cb9('0xa')]=_0x53ffbd['fullname']||'';this['state']=_0x1cb9('0xb');this[_0x1cb9('0xc')]=0x0;this[_0x1cb9('0xd')]=_0x1cb9('0xb');this[_0x1cb9('0xe')]='';this['phone']='';this[_0x1cb9('0xf')]='';this[_0x1cb9('0x10')]='';this[_0x1cb9('0x11')]=_0x53ffbd[_0x1cb9('0x11')]||![];this[_0x1cb9('0x12')]='unknown';this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this[_0x1cb9('0x13')]='';this[_0x1cb9('0x14')]=![];this[_0x1cb9('0x15')]=![];this[_0x1cb9('0x1')]='';}Agent['prototype'][_0x1cb9('0x16')]=function(_0x6ef389){var _0x1b3cd7;if(_0x6ef389&&_0x6ef389[_0x1cb9('0x17')]){_0x1b3cd7=_0x6ef389[_0x1cb9('0x17')]['toLowerCase']();switch(_0x1b3cd7){case'not_inuse':_0x1b3cd7=_0x1cb9('0x18');break;case _0x1cb9('0x19'):_0x1b3cd7=_0x1cb9('0x1a');break;}}if(_0x1b3cd7&&this[_0x1cb9('0x12')]!==_0x1b3cd7||_0x6ef389[_0x1cb9('0x1b')]){this[_0x1cb9('0x1c')]=_[_0x1cb9('0x1d')](moment()['format']('x'));}if(_0x1b3cd7){this['voiceStatus']=_0x1b3cd7;}var _0x1b2fa6={'id':this['id'],'name':this[_0x1cb9('0x7')],'email':this[_0x1cb9('0x8')],'accountcode':this[_0x1cb9('0x9')],'fullname':this[_0x1cb9('0xa')],'state':this[_0x1cb9('0x17')],'stateTime':this[_0x1cb9('0xc')],'status':this['status'],'address':this['address'],'online':this[_0x1cb9('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x1cb9('0x1c')],'voiceStatusCallerIdNumber':this[_0x1cb9('0x1e')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this['interface'],'onhold':this[_0x1cb9('0x14')]};var _0x325637=md5(JSON[_0x1cb9('0x1f')](_0x1b2fa6));if(this[_0x1cb9('0x1')]!==_0x325637){this[_0x1cb9('0x1')]=_0x325637;io['to'](util[_0x1cb9('0x20')]('user:%s',_0x1b2fa6['name']))[_0x1cb9('0x21')]('user:save',_0x1b2fa6);io[_0x1cb9('0x21')](_0x1cb9('0x22'),_0x1b2fa6);}};module[_0x1cb9('0x23')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 088ce6c..66fbfbd 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 _0x3420=['dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence'];(function(_0x9807ed,_0x1f0103){var _0x27ad3f=function(_0x54a728){while(--_0x54a728){_0x9807ed['push'](_0x9807ed['shift']());}};_0x27ad3f(++_0x1f0103);}(_0x3420,0x19f));var _0x0342=function(_0x15af3a,_0x533393){_0x15af3a=_0x15af3a-0x0;var _0x346d4=_0x3420[_0x15af3a];return _0x346d4;};'use strict';function Campaign(_0x39dbe2){this['id']=_0x39dbe2['id']||0x0;this['name']=_0x39dbe2[_0x0342('0x0')]||'';this[_0x0342('0x1')]=_0x39dbe2['type']||_0x0342('0x2');this[_0x0342('0x3')]=0x0;this[_0x0342('0x4')]=0x0;this[_0x0342('0x5')]=0x0;this[_0x0342('0x6')]=0x0;this[_0x0342('0x7')]='';this[_0x0342('0x8')]=!![];this[_0x0342('0x9')]=_0x39dbe2[_0x0342('0x9')];this[_0x0342('0xa')]=_0x39dbe2['limitCalls'];this[_0x0342('0xb')]=_0x39dbe2[_0x0342('0xb')]||null;this['dialGlobalInterval']=_0x39dbe2['dialGlobalInterval']?_0x39dbe2[_0x0342('0xc')]:null;this[_0x0342('0xd')]=_0x39dbe2[_0x0342('0xd')];this[_0x0342('0xe')]=_0x39dbe2[_0x0342('0xe')];this['dialOriginateTimeout']=_0x39dbe2[_0x0342('0xf')]||0x1e;this[_0x0342('0x10')]=_0x39dbe2[_0x0342('0x10')];this[_0x0342('0x11')]=_0x39dbe2['dialCongestionRetryFrequency'];this['dialBusyMaxRetry']=_0x39dbe2[_0x0342('0x12')];this[_0x0342('0x13')]=_0x39dbe2[_0x0342('0x13')];this[_0x0342('0x14')]=_0x39dbe2[_0x0342('0x14')];this[_0x0342('0x15')]=_0x39dbe2['dialNoAnswerRetryFrequency'];this[_0x0342('0x16')]=_0x39dbe2[_0x0342('0x16')];this[_0x0342('0x17')]=_0x39dbe2['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x39dbe2[_0x0342('0x18')]||0x96;this[_0x0342('0x19')]=_0x39dbe2[_0x0342('0x19')]||0x3;this[_0x0342('0x1a')]=_0x39dbe2[_0x0342('0x1a')]||0x96;this[_0x0342('0x1b')]=_0x39dbe2[_0x0342('0x1b')]||0x3;this['dialAbandonedRetryFrequency']=_0x39dbe2[_0x0342('0x1c')]||0x96;this[_0x0342('0x1d')]=_0x39dbe2[_0x0342('0x1d')]||0x3;this[_0x0342('0x1e')]=_0x39dbe2[_0x0342('0x1e')]||0x96;this['dialAgentRejectMaxRetry']=_0x39dbe2['dialAgentRejectMaxRetry']||0x3;this['dialAgentRejectRetryFrequency']=_0x39dbe2[_0x0342('0x1f')]||0x96;this['dialOrderByScheduledAt']=_0x39dbe2[_0x0342('0x20')]||_0x0342('0x21');this[_0x0342('0x22')]=_0x39dbe2[_0x0342('0x22')]||undefined;this[_0x0342('0x23')]=_0x39dbe2[_0x0342('0x23')]||undefined;this[_0x0342('0x24')]=_0x39dbe2[_0x0342('0x24')]||undefined;this[_0x0342('0x25')]=_0x39dbe2[_0x0342('0x25')]?_0x39dbe2[_0x0342('0x25')]:undefined;this[_0x0342('0x26')]=_0x39dbe2['Trunk']?_0x39dbe2['Trunk']:undefined;this['Interval']=_0x39dbe2['Interval']?_0x39dbe2['Interval']:undefined;this['SquareProject']=_0x39dbe2[_0x0342('0x27')]?_0x39dbe2[_0x0342('0x27')]:undefined;this['dialQueueProject']=_0x39dbe2['SquareProject']?_0x39dbe2[_0x0342('0x27')][_0x0342('0x0')]:undefined;this[_0x0342('0x28')]=_0x39dbe2[_0x0342('0x28')]||![];this['dialAMDInitialSilence']=_0x39dbe2[_0x0342('0x29')];this[_0x0342('0x2a')]=_0x39dbe2[_0x0342('0x2a')];this['dialAMDAfterGreetingSilence']=_0x39dbe2[_0x0342('0x2b')];this[_0x0342('0x2c')]=_0x39dbe2['dialAMDTotalAnalysisTime'];this[_0x0342('0x2d')]=_0x39dbe2[_0x0342('0x2d')];this[_0x0342('0x2e')]=_0x39dbe2['dialAMDBetweenWordsSilence'];this[_0x0342('0x2f')]=_0x39dbe2[_0x0342('0x2f')];this[_0x0342('0x30')]=_0x39dbe2[_0x0342('0x30')];this[_0x0342('0x31')]=_0x39dbe2[_0x0342('0x31')];}module[_0x0342('0x32')]=Campaign; \ No newline at end of file +var _0x9508=['dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC'];(function(_0x42932d,_0x4749fb){var _0x4f6f2c=function(_0x12ea2e){while(--_0x12ea2e){_0x42932d['push'](_0x42932d['shift']());}};_0x4f6f2c(++_0x4749fb);}(_0x9508,0xa8));var _0x8950=function(_0x1e3612,_0x21c35c){_0x1e3612=_0x1e3612-0x0;var _0x11113b=_0x9508[_0x1e3612];return _0x11113b;};'use strict';function Campaign(_0x17f990){this['id']=_0x17f990['id']||0x0;this['name']=_0x17f990[_0x8950('0x0')]||'';this[_0x8950('0x1')]=_0x17f990['type']||_0x8950('0x2');this[_0x8950('0x3')]=0x0;this[_0x8950('0x4')]=0x0;this[_0x8950('0x5')]=0x0;this[_0x8950('0x6')]=0x0;this[_0x8950('0x7')]='';this[_0x8950('0x8')]=!![];this[_0x8950('0x9')]=_0x17f990[_0x8950('0x9')];this['limitCalls']=_0x17f990[_0x8950('0xa')];this['dialTimezone']=_0x17f990['dialTimezone']||null;this[_0x8950('0xb')]=_0x17f990[_0x8950('0xb')]?_0x17f990[_0x8950('0xb')]:null;this['dialOriginateCallerIdName']=_0x17f990[_0x8950('0xc')];this['dialOriginateCallerIdNumber']=_0x17f990[_0x8950('0xd')];this[_0x8950('0xe')]=_0x17f990[_0x8950('0xe')]||0x1e;this[_0x8950('0xf')]=_0x17f990['dialCongestionMaxRetry'];this['dialCongestionRetryFrequency']=_0x17f990[_0x8950('0x10')];this[_0x8950('0x11')]=_0x17f990[_0x8950('0x11')];this['dialBusyRetryFrequency']=_0x17f990[_0x8950('0x12')];this[_0x8950('0x13')]=_0x17f990[_0x8950('0x13')];this['dialNoAnswerRetryFrequency']=_0x17f990['dialNoAnswerRetryFrequency'];this[_0x8950('0x14')]=_0x17f990['dialGlobalMaxRetry'];this['dialNoSuchNumberMaxRetry']=_0x17f990['dialNoSuchNumberMaxRetry']||0x3;this[_0x8950('0x15')]=_0x17f990[_0x8950('0x15')]||0x96;this[_0x8950('0x16')]=_0x17f990[_0x8950('0x16')]||0x3;this[_0x8950('0x17')]=_0x17f990[_0x8950('0x17')]||0x96;this[_0x8950('0x18')]=_0x17f990[_0x8950('0x18')]||0x3;this[_0x8950('0x19')]=_0x17f990[_0x8950('0x19')]||0x96;this[_0x8950('0x1a')]=_0x17f990[_0x8950('0x1a')]||0x3;this[_0x8950('0x1b')]=_0x17f990[_0x8950('0x1b')]||0x96;this[_0x8950('0x1c')]=_0x17f990[_0x8950('0x1c')]||0x3;this[_0x8950('0x1d')]=_0x17f990[_0x8950('0x1d')]||0x96;this[_0x8950('0x1e')]=_0x17f990[_0x8950('0x1e')]||_0x8950('0x1f');this[_0x8950('0x20')]=_0x17f990[_0x8950('0x20')]||undefined;this[_0x8950('0x21')]=_0x17f990['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x8950('0x22')]=_0x17f990[_0x8950('0x22')]||undefined;this[_0x8950('0x23')]=_0x17f990['TrunkBackup']?_0x17f990[_0x8950('0x23')]:undefined;this[_0x8950('0x24')]=_0x17f990['Trunk']?_0x17f990[_0x8950('0x24')]:undefined;this[_0x8950('0x25')]=_0x17f990[_0x8950('0x25')]?_0x17f990[_0x8950('0x25')]:undefined;this[_0x8950('0x26')]=_0x17f990[_0x8950('0x26')]?_0x17f990[_0x8950('0x26')]:undefined;this[_0x8950('0x27')]=_0x17f990[_0x8950('0x26')]?_0x17f990[_0x8950('0x26')][_0x8950('0x0')]:undefined;this[_0x8950('0x28')]=_0x17f990[_0x8950('0x28')]||![];this['dialAMDInitialSilence']=_0x17f990[_0x8950('0x29')];this[_0x8950('0x2a')]=_0x17f990['dialAMDGreeting'];this[_0x8950('0x2b')]=_0x17f990[_0x8950('0x2b')];this[_0x8950('0x2c')]=_0x17f990[_0x8950('0x2c')];this[_0x8950('0x2d')]=_0x17f990[_0x8950('0x2d')];this[_0x8950('0x2e')]=_0x17f990[_0x8950('0x2e')];this[_0x8950('0x2f')]=_0x17f990[_0x8950('0x2f')];this[_0x8950('0x30')]=_0x17f990[_0x8950('0x30')];this[_0x8950('0x31')]=_0x17f990['dialAMDMaximumWordLength'];}module['exports']=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index be4f01c..00f49bf 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 _0x288a=['type','tag','disposition','monitors','transfercalleridnum','transferType','mohtime','exports','channel','destinationchannel','calleridnum','calleridname','accountcode','uniqueid','linkedid','exten','answertime','endtime','unmanaged','lastapplication','lastdata','duration','billableseconds','holdtime'];(function(_0xc694ff,_0x1498ad){var _0x59dba2=function(_0x4c3ccd){while(--_0x4c3ccd){_0xc694ff['push'](_0xc694ff['shift']());}};_0x59dba2(++_0x1498ad);}(_0x288a,0x188));var _0xa288=function(_0x201ab0,_0x51d002){_0x201ab0=_0x201ab0-0x0;var _0x1b2343=_0x288a[_0x201ab0];return _0x1b2343;};'use strict';function Channel(){this['starttime']=null;this[_0xa288('0x0')]='';this[_0xa288('0x1')]='';this[_0xa288('0x2')]=0x0;this[_0xa288('0x3')]='';this['connectedlinenum']=undefined;this['connectedlinename']=undefined;this[_0xa288('0x4')]=0x0;this['context']='';this[_0xa288('0x5')]=0x0;this[_0xa288('0x6')]=0x0;this[_0xa288('0x7')]=0x0;this['answered']=![];this[_0xa288('0x8')]=null;this[_0xa288('0x9')]=null;this[_0xa288('0xa')]=![];this['abandoned']=![];this[_0xa288('0xb')]='';this[_0xa288('0xc')]='';this[_0xa288('0xd')]=0x0;this[_0xa288('0xe')]=0x0;this[_0xa288('0xf')]=0x0;this[_0xa288('0x10')]=null;this[_0xa288('0x11')]=null;this[_0xa288('0x12')]=null;this['monitor']=![];this['monitorFilename']=null;this['queue']=null;this[_0xa288('0x13')]=[];this[_0xa288('0x14')]=undefined;this['transferconnectedlinenum']=undefined;this[_0xa288('0x15')]=undefined;this[_0xa288('0x16')]=0x0;}module[_0xa288('0x17')]=Channel; \ No newline at end of file +var _0xd868=['lastapplication','lastdata','duration','billableseconds','holdtime','type','tag','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferType','mohtime','exports','starttime','destinationchannel','connectedlinenum','connectedlinename','accountcode','uniqueid','linkedid','answered','answertime','endtime','unmanaged','abandoned'];(function(_0x327e97,_0x423787){var _0x450e5d=function(_0x10eeb4){while(--_0x10eeb4){_0x327e97['push'](_0x327e97['shift']());}};_0x450e5d(++_0x423787);}(_0xd868,0x1ec));var _0x8d86=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0xd868[_0x40bffc];return _0x3007e9;};'use strict';function Channel(){this[_0x8d86('0x0')]=null;this['channel']='';this[_0x8d86('0x1')]='';this['calleridnum']=0x0;this['calleridname']='';this[_0x8d86('0x2')]=undefined;this[_0x8d86('0x3')]=undefined;this[_0x8d86('0x4')]=0x0;this['context']='';this[_0x8d86('0x5')]=0x0;this[_0x8d86('0x6')]=0x0;this['exten']=0x0;this[_0x8d86('0x7')]=![];this[_0x8d86('0x8')]=null;this[_0x8d86('0x9')]=null;this[_0x8d86('0xa')]=![];this[_0x8d86('0xb')]=![];this[_0x8d86('0xc')]='';this[_0x8d86('0xd')]='';this[_0x8d86('0xe')]=0x0;this[_0x8d86('0xf')]=0x0;this[_0x8d86('0x10')]=0x0;this[_0x8d86('0x11')]=null;this[_0x8d86('0x12')]=null;this[_0x8d86('0x13')]=null;this[_0x8d86('0x14')]=![];this[_0x8d86('0x15')]=null;this[_0x8d86('0x16')]=null;this[_0x8d86('0x17')]=[];this[_0x8d86('0x18')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x8d86('0x19')]=undefined;this[_0x8d86('0x1a')]=0x0;}module[_0x8d86('0x1b')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index b19b460..2f471e8 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 _0xc72e=['consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password'];(function(_0x3cb0c9,_0x5a2d1f){var _0x47e24f=function(_0x592769){while(--_0x592769){_0x3cb0c9['push'](_0x3cb0c9['shift']());}};_0x47e24f(++_0x5a2d1f);}(_0xc72e,0x119));var _0xec72=function(_0x1ff8d6,_0x2a39cf){_0x1ff8d6=_0x1ff8d6-0x0;var _0x221346=_0xc72e[_0x1ff8d6];return _0x221346;};'use strict';function DeskAccount(_0x69fb4a){this['id']=_0x69fb4a['id']||0x0;this['name']=_0x69fb4a[_0xec72('0x0')]||'';this['username']=_0x69fb4a[_0xec72('0x1')]||'';this[_0xec72('0x2')]=_0x69fb4a['remoteUri']||'';this[_0xec72('0x3')]=_0x69fb4a[_0xec72('0x3')]||'';this[_0xec72('0x4')]=_0x69fb4a[_0xec72('0x4')]||'';this[_0xec72('0x5')]=_0x69fb4a[_0xec72('0x5')]||'';this[_0xec72('0x6')]=_0x69fb4a[_0xec72('0x6')]||'';this[_0xec72('0x7')]=_0x69fb4a['token']||'';this[_0xec72('0x8')]=_0x69fb4a[_0xec72('0x8')]||'';this[_0xec72('0x9')]=_0x69fb4a[_0xec72('0x9')]||'';this[_0xec72('0xa')]=_0x69fb4a['serverUrl']||'';this[_0xec72('0xb')]=_0x69fb4a['Configurations']||{};}module[_0xec72('0xc')]=DeskAccount; \ No newline at end of file +var _0x0716=['consumerSecret','token','tokenSecret','type','serverUrl','exports','name','username','remoteUri','authType','password'];(function(_0x1f60de,_0x12b650){var _0x65cc45=function(_0x55b58b){while(--_0x55b58b){_0x1f60de['push'](_0x1f60de['shift']());}};_0x65cc45(++_0x12b650);}(_0x0716,0x1d4));var _0x6071=function(_0x25f8e8,_0x519d8e){_0x25f8e8=_0x25f8e8-0x0;var _0x1df02c=_0x0716[_0x25f8e8];return _0x1df02c;};'use strict';function DeskAccount(_0x30ec90){this['id']=_0x30ec90['id']||0x0;this[_0x6071('0x0')]=_0x30ec90['name']||'';this[_0x6071('0x1')]=_0x30ec90[_0x6071('0x1')]||'';this[_0x6071('0x2')]=_0x30ec90[_0x6071('0x2')]||'';this[_0x6071('0x3')]=_0x30ec90[_0x6071('0x3')]||'';this[_0x6071('0x4')]=_0x30ec90['password']||'';this['consumerKey']=_0x30ec90['consumerKey']||'';this['consumerSecret']=_0x30ec90[_0x6071('0x5')]||'';this[_0x6071('0x6')]=_0x30ec90[_0x6071('0x6')]||'';this[_0x6071('0x7')]=_0x30ec90['tokenSecret']||'';this[_0x6071('0x8')]=_0x30ec90[_0x6071('0x8')]||'';this[_0x6071('0x9')]=_0x30ec90['serverUrl']||'';this['Configurations']=_0x30ec90['Configurations']||{};}module[_0x6071('0xa')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 1653bd6..6d88083 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 _0xb31a=['clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','name','username','password','remoteUri','tenantId','clientId'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb31a,0x94));var _0xab31=function(_0x1d8a60,_0x581ee6){_0x1d8a60=_0x1d8a60-0x0;var _0x2c2a96=_0xb31a[_0x1d8a60];return _0x2c2a96;};'use strict';function Dynamics365Account(_0x3b17b1){this['id']=_0x3b17b1['id']||0x0;this[_0xab31('0x0')]=_0x3b17b1[_0xab31('0x0')]||'';this[_0xab31('0x1')]=_0x3b17b1[_0xab31('0x1')]||'';this[_0xab31('0x2')]=_0x3b17b1[_0xab31('0x2')]||'';this[_0xab31('0x3')]=_0x3b17b1[_0xab31('0x3')]||'';this[_0xab31('0x4')]=_0x3b17b1['tenantId']||'';this[_0xab31('0x5')]=_0x3b17b1[_0xab31('0x5')]||'';this[_0xab31('0x6')]=_0x3b17b1[_0xab31('0x6')]||{};this['serverUrl']=_0x3b17b1[_0xab31('0x7')]||'';this[_0xab31('0x8')]=_0x3b17b1[_0xab31('0x8')]||![];this[_0xab31('0x9')]=_0x3b17b1[_0xab31('0x9')]||{};this[_0xab31('0xa')]=_0x3b17b1['CloudProvider']||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0x275e=['tenantId','clientId','clientSecret','serverUrl','modernAuthentication','CloudProvider','name','username','password','remoteUri'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x275e,0x164));var _0xe275=function(_0x3bcc31,_0x331645){_0x3bcc31=_0x3bcc31-0x0;var _0x59f119=_0x275e[_0x3bcc31];return _0x59f119;};'use strict';function Dynamics365Account(_0x5cc7f4){this['id']=_0x5cc7f4['id']||0x0;this[_0xe275('0x0')]=_0x5cc7f4['name']||'';this[_0xe275('0x1')]=_0x5cc7f4[_0xe275('0x1')]||'';this[_0xe275('0x2')]=_0x5cc7f4[_0xe275('0x2')]||'';this[_0xe275('0x3')]=_0x5cc7f4['remoteUri']||'';this[_0xe275('0x4')]=_0x5cc7f4[_0xe275('0x4')]||'';this[_0xe275('0x5')]=_0x5cc7f4[_0xe275('0x5')]||'';this[_0xe275('0x6')]=_0x5cc7f4[_0xe275('0x6')]||{};this[_0xe275('0x7')]=_0x5cc7f4['serverUrl']||'';this['modernAuthentication']=_0x5cc7f4[_0xe275('0x8')]||![];this['Configurations']=_0x5cc7f4['Configurations']||{};this[_0xe275('0x9')]=_0x5cc7f4[_0xe275('0x9')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index fd725f1..000b4a8 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 _0x2c2c=['v17,v27,v29','gateway','faxdetect','t38timeout','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','minrate','maxrate','modem'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0x2c2c,0x159));var _0xc2c2=function(_0x56ca33,_0x4f0bff){_0x56ca33=_0x56ca33-0x0;var _0x5f1c06=_0x2c2c[_0x56ca33];return _0x5f1c06;};'use strict';function FaxAccount(_0xe296ba){this['id']=_0xe296ba['id']||0x0;this[_0xc2c2('0x0')]=_0xe296ba[_0xc2c2('0x0')]||'';this[_0xc2c2('0x1')]=_0xe296ba[_0xc2c2('0x1')];this[_0xc2c2('0x2')]=_0xe296ba['ecm'];this[_0xc2c2('0x3')]=_0xe296ba[_0xc2c2('0x3')];this['localstationid']=_0xe296ba['localstationid'];this['minrate']=_0xe296ba[_0xc2c2('0x4')]||0x960;this[_0xc2c2('0x5')]=_0xe296ba[_0xc2c2('0x5')]||0x3840;this[_0xc2c2('0x6')]=_0xe296ba[_0xc2c2('0x6')]||_0xc2c2('0x7');this[_0xc2c2('0x8')]=_0xe296ba[_0xc2c2('0x8')]||'no';this[_0xc2c2('0x9')]=_0xe296ba[_0xc2c2('0x9')]||'no';this[_0xc2c2('0xa')]=_0xe296ba[_0xc2c2('0xa')]||0x1388;this['tech']=_0xe296ba['tech']||_0xc2c2('0xb');this[_0xc2c2('0xc')]=_0xe296ba[_0xc2c2('0xc')]?_0xe296ba[_0xc2c2('0xc')]:undefined;this[_0xc2c2('0xd')]=_0xe296ba['ListId'];this['key']=_0xe296ba[_0xc2c2('0xe')];}module[_0xc2c2('0xf')]=FaxAccount; \ No newline at end of file +var _0x6c96=['SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6c96,0x1d9));var _0x66c9=function(_0x4d908b,_0x1b44b6){_0x4d908b=_0x4d908b-0x0;var _0x254ea7=_0x6c96[_0x4d908b];return _0x254ea7;};'use strict';function FaxAccount(_0x4826bb){this['id']=_0x4826bb['id']||0x0;this[_0x66c9('0x0')]=_0x4826bb['name']||'';this[_0x66c9('0x1')]=_0x4826bb[_0x66c9('0x1')];this[_0x66c9('0x2')]=_0x4826bb[_0x66c9('0x2')];this[_0x66c9('0x3')]=_0x4826bb[_0x66c9('0x3')];this['localstationid']=_0x4826bb[_0x66c9('0x4')];this[_0x66c9('0x5')]=_0x4826bb[_0x66c9('0x5')]||0x960;this['maxrate']=_0x4826bb[_0x66c9('0x6')]||0x3840;this['modem']=_0x4826bb[_0x66c9('0x7')]||_0x66c9('0x8');this[_0x66c9('0x9')]=_0x4826bb[_0x66c9('0x9')]||'no';this[_0x66c9('0xa')]=_0x4826bb[_0x66c9('0xa')]||'no';this[_0x66c9('0xb')]=_0x4826bb[_0x66c9('0xb')]||0x1388;this[_0x66c9('0xc')]=_0x4826bb[_0x66c9('0xc')]||_0x66c9('0xd');this[_0x66c9('0xe')]=_0x4826bb['Trunk']?_0x4826bb['Trunk']:undefined;this[_0x66c9('0xf')]=_0x4826bb[_0x66c9('0xf')];this[_0x66c9('0x10')]=_0x4826bb[_0x66c9('0x10')];}module[_0x66c9('0x11')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index aa8a6eb..fe3575f 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 _0x53cc=['exports','name','username','apiKey','remoteUri','serverUrl','Configurations'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x53cc,0xef));var _0xc53c=function(_0x37756b,_0x24db76){_0x37756b=_0x37756b-0x0;var _0x46efec=_0x53cc[_0x37756b];return _0x46efec;};'use strict';function FreshdeskAccount(_0x3f1a3d){this['id']=_0x3f1a3d['id']||0x0;this[_0xc53c('0x0')]=_0x3f1a3d[_0xc53c('0x0')]||'';this[_0xc53c('0x1')]=_0x3f1a3d['username']||'';this[_0xc53c('0x2')]=_0x3f1a3d['token']||'';this['remoteUri']=_0x3f1a3d[_0xc53c('0x3')]||'';this[_0xc53c('0x4')]=_0x3f1a3d['serverUrl']||'';this[_0xc53c('0x5')]=_0x3f1a3d[_0xc53c('0x5')]||{};}module[_0xc53c('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0xa3e5=['remoteUri','serverUrl','Configurations','exports','name','username','apiKey','token'];(function(_0x4bd9bd,_0x2fd047){var _0x1ebbd5=function(_0x1b8304){while(--_0x1b8304){_0x4bd9bd['push'](_0x4bd9bd['shift']());}};_0x1ebbd5(++_0x2fd047);}(_0xa3e5,0x12c));var _0x5a3e=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xa3e5[_0x432682];return _0x463d05;};'use strict';function FreshdeskAccount(_0x341297){this['id']=_0x341297['id']||0x0;this[_0x5a3e('0x0')]=_0x341297[_0x5a3e('0x0')]||'';this[_0x5a3e('0x1')]=_0x341297[_0x5a3e('0x1')]||'';this[_0x5a3e('0x2')]=_0x341297[_0x5a3e('0x3')]||'';this['remoteUri']=_0x341297[_0x5a3e('0x4')]||'';this[_0x5a3e('0x5')]=_0x341297[_0x5a3e('0x5')]||'';this['Configurations']=_0x341297[_0x5a3e('0x6')]||{};}module[_0x5a3e('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 5cc6ab8..e714f23 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 _0xff2a=['name','username','apiKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x4dff34,_0x49f98a){var _0x395029=function(_0x4031ee){while(--_0x4031ee){_0x4dff34['push'](_0x4dff34['shift']());}};_0x395029(++_0x49f98a);}(_0xff2a,0x93));var _0xaff2=function(_0x4a3e73,_0x4fea7c){_0x4a3e73=_0x4a3e73-0x0;var _0x2d8eb9=_0xff2a[_0x4a3e73];return _0x2d8eb9;};'use strict';function FreshsalesAccount(_0x582b60){this['id']=_0x582b60['id']||0x0;this[_0xaff2('0x0')]=_0x582b60[_0xaff2('0x0')]||'';this['username']=_0x582b60[_0xaff2('0x1')]||'';this[_0xaff2('0x2')]=_0x582b60['token']||'';this[_0xaff2('0x3')]=_0x582b60['remoteUri']||'';this[_0xaff2('0x4')]=_0x582b60[_0xaff2('0x4')]||'';this['Configurations']=_0x582b60[_0xaff2('0x5')]||{};}module[_0xaff2('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0xb182=['Configurations','exports','name','username','token','remoteUri','serverUrl'];(function(_0x49930c,_0x271f73){var _0x2c2edf=function(_0x4fca10){while(--_0x4fca10){_0x49930c['push'](_0x49930c['shift']());}};_0x2c2edf(++_0x271f73);}(_0xb182,0x121));var _0x2b18=function(_0x45518f,_0x475a6b){_0x45518f=_0x45518f-0x0;var _0x198175=_0xb182[_0x45518f];return _0x198175;};'use strict';function FreshsalesAccount(_0xd418ae){this['id']=_0xd418ae['id']||0x0;this[_0x2b18('0x0')]=_0xd418ae[_0x2b18('0x0')]||'';this[_0x2b18('0x1')]=_0xd418ae['username']||'';this['apiKey']=_0xd418ae[_0x2b18('0x2')]||'';this[_0x2b18('0x3')]=_0xd418ae[_0x2b18('0x3')]||'';this['serverUrl']=_0xd418ae[_0x2b18('0x4')]||'';this[_0x2b18('0x5')]=_0xd418ae[_0x2b18('0x5')]||{};}module[_0x2b18('0x6')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 389d976..fc79861 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 _0x6468=['queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','connectedlinenum','accountcode','context','exten','priority','holdtime','assigned','lastAssignedTo','voice','mohtime','variables','exports','type','inbound','uniqueid','calleridname','queue','queuecallerleaveAt','count','queuecallerabandon','queuecallerabandonAt'];(function(_0x751a4d,_0x33c318){var _0x10dc64=function(_0x489636){while(--_0x489636){_0x751a4d['push'](_0x751a4d['shift']());}};_0x10dc64(++_0x33c318);}(_0x6468,0x10a));var _0x8646=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x6468[_0x1035c1];return _0x308d67;};'use strict';function QueueReport(){this[_0x8646('0x0')]=_0x8646('0x1');this[_0x8646('0x2')]='';this['calleridnum']='';this[_0x8646('0x3')]='';this[_0x8646('0x4')]='';this['queuecallerjoinAt']=null;this[_0x8646('0x5')]=null;this['position']=0x1;this[_0x8646('0x6')]=0x1;this[_0x8646('0x7')]=![];this[_0x8646('0x8')]=null;this[_0x8646('0x9')]=![];this[_0x8646('0xa')]=null;this[_0x8646('0xb')]=![];this[_0x8646('0xc')]=null;this['originalposition']=0x1;this['channel']='';this[_0x8646('0xd')]='';this['connectedlinename']='';this[_0x8646('0xe')]='';this[_0x8646('0xf')]='';this[_0x8646('0x10')]='';this[_0x8646('0x11')]='';this[_0x8646('0x12')]=0x0;this[_0x8646('0x13')]=![];this[_0x8646('0x14')]='';this['motionChannel']=_0x8646('0x15');this[_0x8646('0x16')]=0x0;this[_0x8646('0x17')]={};}module[_0x8646('0x18')]=QueueReport; \ No newline at end of file +var _0x1f67=['assigned','motionChannel','voice','mohtime','variables','exports','type','inbound','uniqueid','calleridname','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexit','queuecallerexitAt','originalposition','connectedlinenum','connectedlinename','accountcode','context','exten','priority','holdtime'];(function(_0x21dab5,_0x459837){var _0x559a6d=function(_0x89a40b){while(--_0x89a40b){_0x21dab5['push'](_0x21dab5['shift']());}};_0x559a6d(++_0x459837);}(_0x1f67,0x124));var _0x71f6=function(_0x63ad80,_0x524d8e){_0x63ad80=_0x63ad80-0x0;var _0x5cf236=_0x1f67[_0x63ad80];return _0x5cf236;};'use strict';function QueueReport(){this[_0x71f6('0x0')]=_0x71f6('0x1');this[_0x71f6('0x2')]='';this['calleridnum']='';this[_0x71f6('0x3')]='';this['queue']='';this['queuecallerjoinAt']=null;this[_0x71f6('0x4')]=null;this[_0x71f6('0x5')]=0x1;this[_0x71f6('0x6')]=0x1;this[_0x71f6('0x7')]=![];this[_0x71f6('0x8')]=null;this[_0x71f6('0x9')]=![];this['queuecallercompleteAt']=null;this[_0x71f6('0xa')]=![];this[_0x71f6('0xb')]=null;this[_0x71f6('0xc')]=0x1;this['channel']='';this[_0x71f6('0xd')]='';this[_0x71f6('0xe')]='';this[_0x71f6('0xf')]='';this[_0x71f6('0x10')]='';this[_0x71f6('0x11')]='';this[_0x71f6('0x12')]='';this[_0x71f6('0x13')]=0x0;this[_0x71f6('0x14')]=![];this['lastAssignedTo']='';this[_0x71f6('0x15')]=_0x71f6('0x16');this[_0x71f6('0x17')]=0x0;this[_0x71f6('0x18')]={};}module[_0x71f6('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 4185254..7a884a6 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 _0x5b93=['serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab'];(function(_0x159b94,_0x3e9b13){var _0x1af141=function(_0x319f5d){while(--_0x319f5d){_0x159b94['push'](_0x159b94['shift']());}};_0x1af141(++_0x3e9b13);}(_0x5b93,0x13b));var _0x35b9=function(_0x46aa15,_0x2e476e){_0x46aa15=_0x46aa15-0x0;var _0x2d5e57=_0x5b93[_0x46aa15];return _0x2d5e57;};'use strict';function SalesforceAccount(_0x2a3635){this['id']=_0x2a3635['id']||0x0;this['name']=_0x2a3635[_0x35b9('0x0')]||'';this[_0x35b9('0x1')]=_0x2a3635['username']||'';this['remoteUri']=_0x2a3635[_0x35b9('0x2')]||'';this[_0x35b9('0x3')]=_0x2a3635[_0x35b9('0x3')]||'';this[_0x35b9('0x4')]=_0x2a3635[_0x35b9('0x4')]||'';this[_0x35b9('0x5')]=_0x2a3635[_0x35b9('0x5')]||'';this['securityToken']=_0x2a3635[_0x35b9('0x6')]||'';this[_0x35b9('0x7')]=_0x2a3635[_0x35b9('0x7')]||_0x35b9('0x8');this[_0x35b9('0x9')]=_0x2a3635[_0x35b9('0x9')]||'';this[_0x35b9('0xa')]=_0x2a3635['Configurations']||{};}module[_0x35b9('0xb')]=SalesforceAccount; \ No newline at end of file +var _0x143a=['Configurations','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl'];(function(_0x34c899,_0x2b0ccc){var _0x579a74=function(_0x24541c){while(--_0x24541c){_0x34c899['push'](_0x34c899['shift']());}};_0x579a74(++_0x2b0ccc);}(_0x143a,0x1b9));var _0xa143=function(_0x1193eb,_0x2a1969){_0x1193eb=_0x1193eb-0x0;var _0x5507f2=_0x143a[_0x1193eb];return _0x5507f2;};'use strict';function SalesforceAccount(_0x52a793){this['id']=_0x52a793['id']||0x0;this[_0xa143('0x0')]=_0x52a793[_0xa143('0x0')]||'';this[_0xa143('0x1')]=_0x52a793[_0xa143('0x1')]||'';this['remoteUri']=_0x52a793[_0xa143('0x2')]||'';this['password']=_0x52a793[_0xa143('0x3')]||'';this['clientId']=_0x52a793[_0xa143('0x4')]||'';this[_0xa143('0x5')]=_0x52a793[_0xa143('0x5')]||'';this[_0xa143('0x6')]=_0x52a793[_0xa143('0x6')]||'';this[_0xa143('0x7')]=_0x52a793[_0xa143('0x7')]||_0xa143('0x8');this[_0xa143('0x9')]=_0x52a793[_0xa143('0x9')]||'';this[_0xa143('0xa')]=_0x52a793[_0xa143('0xa')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 053d9d9..806fb97 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 _0x4d9b=['serverUrl','Configurations','name','username','password','remoteUri'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x4d9b,0xc8));var _0xb4d9=function(_0x490726,_0x4728a6){_0x490726=_0x490726-0x0;var _0x55d52e=_0x4d9b[_0x490726];return _0x55d52e;};'use strict';function ServicenowAccount(_0x1fb9f6){this['id']=_0x1fb9f6['id']||0x0;this[_0xb4d9('0x0')]=_0x1fb9f6['name']||'';this[_0xb4d9('0x1')]=_0x1fb9f6[_0xb4d9('0x1')]||'';this[_0xb4d9('0x2')]=_0x1fb9f6[_0xb4d9('0x2')]||'';this['remoteUri']=_0x1fb9f6[_0xb4d9('0x3')]||'';this[_0xb4d9('0x4')]=_0x1fb9f6[_0xb4d9('0x4')]||'';this[_0xb4d9('0x5')]=_0x1fb9f6[_0xb4d9('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0x9a0d=['serverUrl','name','username','password','remoteUri'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x9a0d,0x6f));var _0xd9a0=function(_0x483102,_0x54e93d){_0x483102=_0x483102-0x0;var _0x5cc885=_0x9a0d[_0x483102];return _0x5cc885;};'use strict';function ServicenowAccount(_0x51df12){this['id']=_0x51df12['id']||0x0;this[_0xd9a0('0x0')]=_0x51df12[_0xd9a0('0x0')]||'';this['username']=_0x51df12[_0xd9a0('0x1')]||'';this[_0xd9a0('0x2')]=_0x51df12[_0xd9a0('0x2')]||'';this[_0xd9a0('0x3')]=_0x51df12[_0xd9a0('0x3')]||'';this[_0xd9a0('0x4')]=_0x51df12['serverUrl']||'';this['Configurations']=_0x51df12['Configurations']||{};}module['exports']=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index e4b3b6d..1fc21f8 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 _0x1522=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x47159c,_0x1c8216){var _0x454dbe=function(_0x2b54f7){while(--_0x2b54f7){_0x47159c['push'](_0x47159c['shift']());}};_0x454dbe(++_0x1c8216);}(_0x1522,0x95));var _0x2152=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1522[_0x3dd15e];return _0x231fd0;};'use strict';function SugarcrmAccount(_0x2216ff){this['id']=_0x2216ff['id']||0x0;this[_0x2152('0x0')]=_0x2216ff[_0x2152('0x0')]||'';this[_0x2152('0x1')]=_0x2216ff[_0x2152('0x1')]||'';this[_0x2152('0x2')]=_0x2216ff['password']||'';this[_0x2152('0x3')]=_0x2216ff[_0x2152('0x3')]||'';this[_0x2152('0x4')]=_0x2216ff['serverUrl']||'';this[_0x2152('0x5')]=_0x2216ff[_0x2152('0x5')]||{};}module[_0x2152('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x1332=['remoteUri','serverUrl','Configurations','name','password'];(function(_0x37f85a,_0x240e20){var _0x190eeb=function(_0x2ae374){while(--_0x2ae374){_0x37f85a['push'](_0x37f85a['shift']());}};_0x190eeb(++_0x240e20);}(_0x1332,0x76));var _0x2133=function(_0x80b9f6,_0x200b66){_0x80b9f6=_0x80b9f6-0x0;var _0x22cd01=_0x1332[_0x80b9f6];return _0x22cd01;};'use strict';function SugarcrmAccount(_0x5434b9){this['id']=_0x5434b9['id']||0x0;this[_0x2133('0x0')]=_0x5434b9[_0x2133('0x0')]||'';this['username']=_0x5434b9['username']||'';this[_0x2133('0x1')]=_0x5434b9[_0x2133('0x1')]||'';this[_0x2133('0x2')]=_0x5434b9['remoteUri']||'';this[_0x2133('0x3')]=_0x5434b9[_0x2133('0x3')]||'';this['Configurations']=_0x5434b9[_0x2133('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 0cd17f1..4c1d29b 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 _0x3eeb=['accountcode','state','unknown','stateTime','status','exports','name'];(function(_0x3f9d5d,_0x4ee8dd){var _0x1b2cd7=function(_0x380e51){while(--_0x380e51){_0x3f9d5d['push'](_0x3f9d5d['shift']());}};_0x1b2cd7(++_0x4ee8dd);}(_0x3eeb,0x172));var _0xb3ee=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x3eeb[_0x618414];return _0x21c19a;};'use strict';function Telephone(_0x3b4c9c){this['id']=_0x3b4c9c['id']||0x0;this[_0xb3ee('0x0')]=_0x3b4c9c[_0xb3ee('0x0')]||'';this['accountcode']=_0x3b4c9c[_0xb3ee('0x1')]||'';this[_0xb3ee('0x2')]=_0xb3ee('0x3');this[_0xb3ee('0x4')]=0x0;this[_0xb3ee('0x5')]=_0xb3ee('0x3');this['address']='';}module[_0xb3ee('0x6')]=Telephone; \ No newline at end of file +var _0x83cd=['exports','name','accountcode','unknown','stateTime','status'];(function(_0x3375e0,_0x5b6b18){var _0x1fc8f9=function(_0x211b6a){while(--_0x211b6a){_0x3375e0['push'](_0x3375e0['shift']());}};_0x1fc8f9(++_0x5b6b18);}(_0x83cd,0x17b));var _0xd83c=function(_0x4944b7,_0x2b8525){_0x4944b7=_0x4944b7-0x0;var _0x4c387d=_0x83cd[_0x4944b7];return _0x4c387d;};'use strict';function Telephone(_0x49c37a){this['id']=_0x49c37a['id']||0x0;this[_0xd83c('0x0')]=_0x49c37a[_0xd83c('0x0')]||'';this[_0xd83c('0x1')]=_0x49c37a[_0xd83c('0x1')]||'';this['state']=_0xd83c('0x2');this[_0xd83c('0x3')]=0x0;this[_0xd83c('0x4')]=_0xd83c('0x2');this['address']='';}module[_0xd83c('0x5')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index bcd1f5b..75b6ae7 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(_0x286d62,_0x3268c1){var _0x5bca7e=function(_0x197af6){while(--_0x197af6){_0x286d62['push'](_0x286d62['shift']());}};_0x5bca7e(++_0x3268c1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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(_0x2f5d9e,_0x5e37){var _0x5060e1=function(_0x157b5a){while(--_0x157b5a){_0x2f5d9e['push'](_0x2f5d9e['shift']());}};_0x5060e1(++_0x5e37);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index ebb6738..c7e5ac4 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 _0xb7e7=['Actions','exports','name','channel','status','AllConditions','AnyConditions'];(function(_0x47cd7b,_0x5630af){var _0x3e6dbf=function(_0x2c28e1){while(--_0x2c28e1){_0x47cd7b['push'](_0x47cd7b['shift']());}};_0x3e6dbf(++_0x5630af);}(_0xb7e7,0x121));var _0x7b7e=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0xb7e7[_0x47a349];return _0x18ab75;};'use strict';function Trigger(_0x2e5e07){this['id']=_0x2e5e07['id']||0x0;this['name']=_0x2e5e07[_0x7b7e('0x0')]||'';this['channel']=_0x2e5e07[_0x7b7e('0x1')]||'voice';this[_0x7b7e('0x2')]=_0x2e5e07['status']||![];this[_0x7b7e('0x3')]=_0x2e5e07[_0x7b7e('0x3')]||[];this[_0x7b7e('0x4')]=_0x2e5e07['AnyConditions']||[];this['Actions']=_0x2e5e07[_0x7b7e('0x5')]||[];}module[_0x7b7e('0x6')]=Trigger; \ No newline at end of file +var _0x8603=['exports','name','channel','status','AllConditions','AnyConditions','Actions'];(function(_0x266cf2,_0x29092a){var _0x507a0d=function(_0x1e1273){while(--_0x1e1273){_0x266cf2['push'](_0x266cf2['shift']());}};_0x507a0d(++_0x29092a);}(_0x8603,0x190));var _0x3860=function(_0x135059,_0x14f413){_0x135059=_0x135059-0x0;var _0x38030e=_0x8603[_0x135059];return _0x38030e;};'use strict';function Trigger(_0xba4b79){this['id']=_0xba4b79['id']||0x0;this[_0x3860('0x0')]=_0xba4b79[_0x3860('0x0')]||'';this[_0x3860('0x1')]=_0xba4b79['channel']||'voice';this[_0x3860('0x2')]=_0xba4b79[_0x3860('0x2')]||![];this[_0x3860('0x3')]=_0xba4b79['AllConditions']||[];this[_0x3860('0x4')]=_0xba4b79['AnyConditions']||[];this[_0x3860('0x5')]=_0xba4b79[_0x3860('0x5')]||[];}module[_0x3860('0x6')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 1499b8c..05b7eea 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 _0x58a0=['domainport','refresh','stateRegistry','address','defaultuser','exports','active','name','state','unknown','stateTime','registry','indexOf','split','host','domain'];(function(_0x1b5b44,_0x18275a){var _0x2bb5ff=function(_0x36045b){while(--_0x36045b){_0x1b5b44['push'](_0x1b5b44['shift']());}};_0x2bb5ff(++_0x18275a);}(_0x58a0,0x76));var _0x058a=function(_0x47623f,_0x148f3a){_0x47623f=_0x47623f-0x0;var _0x282ce8=_0x58a0[_0x47623f];return _0x282ce8;};'use strict';function Trunk(_0x4cfab8){this['id']=_0x4cfab8['id']||0x0;this[_0x058a('0x0')]=_0x4cfab8[_0x058a('0x0')]||![];this[_0x058a('0x1')]=_0x4cfab8['name']||'';this[_0x058a('0x2')]=_0x058a('0x3');this[_0x058a('0x4')]=0x0;this['status']=_0x058a('0x3');this[_0x058a('0x5')]=_0x4cfab8[_0x058a('0x5')]&&_0x4cfab8[_0x058a('0x5')][_0x058a('0x6')](':')?_0x4cfab8[_0x058a('0x5')][_0x058a('0x7')](':')[0x0]:'';this[_0x058a('0x8')]='';this['port']='';this[_0x058a('0x9')]='';this[_0x058a('0xa')]='';this[_0x058a('0xb')]='';this[_0x058a('0xc')]='unknown';this['registrationtime']='';this[_0x058a('0xd')]='';this[_0x058a('0xe')]=_0x4cfab8[_0x058a('0xe')]||'';}module[_0x058a('0xf')]=Trunk; \ No newline at end of file +var _0xfa0b=['exports','active','name','state','unknown','status','registry','indexOf','split','host','port','domain','domainport','refresh','stateRegistry','registrationtime','address','defaultuser'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xfa0b,0xa3));var _0xbfa0=function(_0x553c2a,_0x592c23){_0x553c2a=_0x553c2a-0x0;var _0x37988b=_0xfa0b[_0x553c2a];return _0x37988b;};'use strict';function Trunk(_0x2b524f){this['id']=_0x2b524f['id']||0x0;this[_0xbfa0('0x0')]=_0x2b524f['active']||![];this[_0xbfa0('0x1')]=_0x2b524f[_0xbfa0('0x1')]||'';this[_0xbfa0('0x2')]=_0xbfa0('0x3');this['stateTime']=0x0;this[_0xbfa0('0x4')]=_0xbfa0('0x3');this[_0xbfa0('0x5')]=_0x2b524f[_0xbfa0('0x5')]&&_0x2b524f[_0xbfa0('0x5')][_0xbfa0('0x6')](':')?_0x2b524f[_0xbfa0('0x5')][_0xbfa0('0x7')](':')[0x0]:'';this[_0xbfa0('0x8')]='';this[_0xbfa0('0x9')]='';this[_0xbfa0('0xa')]='';this[_0xbfa0('0xb')]='';this[_0xbfa0('0xc')]='';this[_0xbfa0('0xd')]='unknown';this[_0xbfa0('0xe')]='';this[_0xbfa0('0xf')]='';this['defaultuser']=_0x2b524f[_0xbfa0('0x10')]||'';}module[_0xbfa0('0x11')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 8b62086..e9609a8 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 _0x1284=['recordingFormat','none','mandatoryDisposition','exports','exten'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x1284,0x13f));var _0x4128=function(_0x266ddc,_0x45aa52){_0x266ddc=_0x266ddc-0x0;var _0x39c1d7=_0x1284[_0x266ddc];return _0x39c1d7;};'use strict';function voiceExtension(_0x1cd4c3){this['id']=_0x1cd4c3['id']||0x0;this[_0x4128('0x0')]=_0x1cd4c3[_0x4128('0x0')]||'';this[_0x4128('0x1')]=_0x1cd4c3[_0x4128('0x1')]||_0x4128('0x2');this[_0x4128('0x3')]=_0x1cd4c3[_0x4128('0x3')]||![];}module[_0x4128('0x4')]=voiceExtension; \ No newline at end of file +var _0xc9bc=['none','mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x3da1de,_0x11c237){var _0x1f0c86=function(_0x52ccf7){while(--_0x52ccf7){_0x3da1de['push'](_0x3da1de['shift']());}};_0x1f0c86(++_0x11c237);}(_0xc9bc,0xd0));var _0xcc9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc9bc[_0x3dd15e];return _0x231fd0;};'use strict';function voiceExtension(_0x49e7f9){this['id']=_0x49e7f9['id']||0x0;this[_0xcc9b('0x0')]=_0x49e7f9[_0xcc9b('0x0')]||'';this[_0xcc9b('0x1')]=_0x49e7f9[_0xcc9b('0x1')]||_0xcc9b('0x2');this[_0xcc9b('0x3')]=_0x49e7f9[_0xcc9b('0x3')]||![];}module[_0xcc9b('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index c4f86b5..202e840 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 _0x405c=['message','originated','temp','dialTimezone','dialGlobalInterval','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','invalid','unavailable','ringing','ringinuse','onhold','wav','wav49','gsm','rrmemory','name','monitor_format','type','inbound','waiting','talking','total','answered','sumDuration','sumHoldTime','unmanaged','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x405c,0x154));var _0xc405=function(_0x1d1e9c,_0x468647){_0x1d1e9c=_0x1d1e9c-0x0;var _0x2e6723=_0x405c[_0x1d1e9c];return _0x2e6723;};'use strict';var statusDesc=[_0xc405('0x0'),_0xc405('0x1'),_0xc405('0x2'),'busy',_0xc405('0x3'),_0xc405('0x4'),_0xc405('0x5'),_0xc405('0x6'),_0xc405('0x7')];var monitorFormat={'wav':_0xc405('0x8'),'wav49':_0xc405('0x9'),'gsm':_0xc405('0xa')};var strategy={'rrmemory':_0xc405('0xb'),'roundrobin':'roundrobin'};function VoiceQueue(_0x372f2c){this['id']=_0x372f2c['id']||0x0;this[_0xc405('0xc')]=_0x372f2c[_0xc405('0xc')]||'';this['monitor_format']=_0x372f2c[_0xc405('0xd')]||'';this[_0xc405('0xe')]=_0x372f2c['type']||_0xc405('0xf');this[_0xc405('0x10')]=0x0;this[_0xc405('0x11')]=0x0;this[_0xc405('0x12')]=0x0;this[_0xc405('0x13')]=0x0;this[_0xc405('0x14')]=0x0;this[_0xc405('0x15')]=0x0;this['sumBillable']=0x0;this[_0xc405('0x16')]=0x0;this['abandoned']=0x0;this[_0xc405('0x17')]=0x0;this[_0xc405('0x18')]=0x0;this['acw']=_0x372f2c[_0xc405('0x19')]||![];this[_0xc405('0x1a')]=_0x372f2c[_0xc405('0x1a')]||0xa;this[_0xc405('0x1b')]=_0x372f2c[_0xc405('0x1b')]||'no';this[_0xc405('0x1c')]=!![];this[_0xc405('0x1d')]='';this[_0xc405('0x1e')]=0x0;this[_0xc405('0x1f')]=0x0;this[_0xc405('0x20')]=_0x372f2c[_0xc405('0x20')]||null;this['dialGlobalInterval']=_0x372f2c[_0xc405('0x21')]?_0x372f2c[_0xc405('0x21')]:null;this['dialActive']=_0x372f2c['dialActive'];this[_0xc405('0x22')]=_0x372f2c[_0xc405('0x22')]||_0xc405('0x23');this[_0xc405('0x24')]=_0x372f2c['dialLimitChannel']||0x0;this[_0xc405('0x25')]=_0x372f2c['dialLimitQueue']||0x0;this[_0xc405('0x26')]=_0x372f2c['dialPowerLevel']||0x1;this[_0xc405('0x27')]=_0x372f2c['dialPredictiveOptimization']||_0xc405('0x28');this['dialPredictiveOptimizationPercentage']=_0x372f2c[_0xc405('0x29')]||0.03;this[_0xc405('0x2a')]=_0x372f2c[_0xc405('0x2a')]||0x258;this[_0xc405('0x2b')]=_0x372f2c[_0xc405('0x2b')]||_0xc405('0x2c');this['dialOriginateCallerIdNumber']=_0x372f2c[_0xc405('0x2d')]||_0xc405('0x2c');this[_0xc405('0x2e')]=_0x372f2c[_0xc405('0x2e')]||0x1e;this[_0xc405('0x2f')]=_0x372f2c[_0xc405('0x2f')]||'tTxX';this[_0xc405('0x30')]=_0x372f2c[_0xc405('0x30')]||0x3;this[_0xc405('0x31')]=_0x372f2c[_0xc405('0x31')]||undefined;this[_0xc405('0x32')]=_0x372f2c['dialCongestionMaxRetry']||0x3;this[_0xc405('0x33')]=_0x372f2c[_0xc405('0x33')]||0x96;this[_0xc405('0x34')]=_0x372f2c[_0xc405('0x34')]||0x3;this[_0xc405('0x35')]=_0x372f2c[_0xc405('0x35')]||0x96;this['dialNoAnswerMaxRetry']=_0x372f2c['dialNoAnswerMaxRetry']||0x3;this['dialNoAnswerRetryFrequency']=_0x372f2c[_0xc405('0x36')]||0x96;this[_0xc405('0x37')]=_0x372f2c[_0xc405('0x37')]||0x3;this[_0xc405('0x38')]=_0x372f2c[_0xc405('0x38')]||0x96;this['dialDropMaxRetry']=_0x372f2c['dialDropMaxRetry']||0x3;this[_0xc405('0x39')]=_0x372f2c['dialDropRetryFrequency']||0x96;this['dialAbandonedMaxRetry']=_0x372f2c['dialAbandonedMaxRetry']||0x3;this[_0xc405('0x3a')]=_0x372f2c[_0xc405('0x3a')]||0x96;this[_0xc405('0x3b')]=_0x372f2c['dialMachineMaxRetry']||0x3;this[_0xc405('0x3c')]=_0x372f2c[_0xc405('0x3c')]||0x96;this[_0xc405('0x3d')]=_0x372f2c['dialAgentRejectMaxRetry']||0x3;this[_0xc405('0x3e')]=_0x372f2c['dialAgentRejectRetryFrequency']||0x96;this[_0xc405('0x3f')]=_0x372f2c[_0xc405('0x3f')]||0x3;this['dialGlobalMaxRetry']=_0x372f2c['dialGlobalMaxRetry']||0x4;this[_0xc405('0x40')]=_0x372f2c['Trunk']?_0x372f2c[_0xc405('0x40')]:undefined;this[_0xc405('0x41')]=_0x372f2c[_0xc405('0x41')]?_0x372f2c['TrunkBackup']:undefined;this[_0xc405('0x42')]=_0x372f2c[_0xc405('0x42')]||undefined;this['Interval']=_0x372f2c[_0xc405('0x43')]?_0x372f2c[_0xc405('0x43')]:undefined;this[_0xc405('0x44')]=_0x372f2c[_0xc405('0x44')]||_0xc405('0x45');this[_0xc405('0x46')]=_0x372f2c[_0xc405('0x46')]||undefined;this[_0xc405('0x47')]=_0x372f2c[_0xc405('0x47')]||undefined;this[_0xc405('0x48')]=strategy[_0x372f2c['strategy']]||_0xc405('0xb');this[_0xc405('0x49')]=!![];this[_0xc405('0x4a')]=_0x372f2c[_0xc405('0x4a')]||![];this[_0xc405('0x4b')]=_0x372f2c[_0xc405('0x4b')];this[_0xc405('0x4c')]=_0x372f2c[_0xc405('0x4c')];this[_0xc405('0x4d')]=_0x372f2c[_0xc405('0x4d')];this[_0xc405('0x4e')]=_0x372f2c['dialAMDTotalAnalysisTime'];this[_0xc405('0x4f')]=_0x372f2c['dialAMDMinWordLength'];this[_0xc405('0x50')]=_0x372f2c[_0xc405('0x50')];this[_0xc405('0x51')]=_0x372f2c[_0xc405('0x51')];this[_0xc405('0x52')]=_0x372f2c[_0xc405('0x52')];this[_0xc405('0x53')]=_0x372f2c[_0xc405('0x53')];this['outboundRejectCallsDay']=0x0;this[_0xc405('0x54')]=0x0;this[_0xc405('0x55')]=_0x372f2c[_0xc405('0x55')];this['outboundAnswerCallsDay']=0x0;this[_0xc405('0x56')]=0x0;this[_0xc405('0x57')]=0x0;this[_0xc405('0x58')]=0x0;this[_0xc405('0x59')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0xc405('0x5a')]=0x0;this[_0xc405('0x5b')]=0x0;this[_0xc405('0x5c')]=0x0;this[_0xc405('0x5d')]=0x0;this[_0xc405('0x5e')]=0x0;this[_0xc405('0x5f')]=0x0;this[_0xc405('0x60')]=0x0;this[_0xc405('0x61')]=0x0;this[_0xc405('0x62')]=undefined;this[_0xc405('0x63')]=undefined;this[_0xc405('0x64')]=undefined;this[_0xc405('0x65')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0xc405('0x66')]=0x0;this[_0xc405('0x67')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0xc405('0x68')]=0x0;this[_0xc405('0x69')]=0x0;this[_0xc405('0x6a')]=0x0;this[_0xc405('0x6b')]=0x0;this['predictiveIntervalMaxThreshold']=_0x372f2c[_0xc405('0x6c')]||0x14;this['predictiveIntervalMinThreshold']=_0x372f2c['dialPredictiveIntervalMaxThreshold']||0xa;this[_0xc405('0x6d')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0xc405('0x6e')]=0x1;this[_0xc405('0x6f')]=0x0;this[_0xc405('0x70')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0xc405('0x71')]=0x0;this[_0xc405('0x72')]=_0x372f2c[_0xc405('0x72')]||0x1e;this[_0xc405('0x73')]=_0x372f2c[_0xc405('0x73')]||![];this[_0xc405('0x74')]=!!_0x372f2c[_0xc405('0x74')]||![];this['dialPreviewRecallmeReminder']=!!_0x372f2c['dialPreviewRecallmeReminder']||![];this[_0xc405('0x75')]=_0x372f2c[_0xc405('0x75')]||undefined;this['dialAgiAfterHangupClient']=_0x372f2c[_0xc405('0x76')]||![];this[_0xc405('0x77')]=_0x372f2c['dialAgiAfterHangupAgent']||![];this['monitor_format']=monitorFormat[_0x372f2c[_0xc405('0xd')]]?monitorFormat[_0x372f2c[_0xc405('0xd')]]:undefined;this[_0xc405('0x78')]=_0x372f2c[_0xc405('0x78')]||![];this[_0xc405('0x79')]=_0x372f2c['mandatoryDispositionPause']?_0x372f2c[_0xc405('0x79')]:undefined;}module[_0xc405('0x7a')]=VoiceQueue; \ No newline at end of file +var _0x62c2=['outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','startProgressive','startPredictive','handlePredictive','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','wav','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','sumDuration','sumHoldTime','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay'];(function(_0x4d0df6,_0x4634f3){var _0x4e2615=function(_0x5285e2){while(--_0x5285e2){_0x4d0df6['push'](_0x4d0df6['shift']());}};_0x4e2615(++_0x4634f3);}(_0x62c2,0x117));var _0x262c=function(_0x11f9fa,_0x53d711){_0x11f9fa=_0x11f9fa-0x0;var _0x48feb0=_0x62c2[_0x11f9fa];return _0x48feb0;};'use strict';var statusDesc=['unknown',_0x262c('0x0'),_0x262c('0x1'),_0x262c('0x2'),_0x262c('0x3'),_0x262c('0x4'),_0x262c('0x5'),_0x262c('0x6'),'onhold'];var monitorFormat={'wav':_0x262c('0x7'),'wav49':'wav49','gsm':_0x262c('0x8')};var strategy={'rrmemory':_0x262c('0x9'),'roundrobin':_0x262c('0xa')};function VoiceQueue(_0x3074f0){this['id']=_0x3074f0['id']||0x0;this[_0x262c('0xb')]=_0x3074f0[_0x262c('0xb')]||'';this[_0x262c('0xc')]=_0x3074f0[_0x262c('0xc')]||'';this[_0x262c('0xd')]=_0x3074f0[_0x262c('0xd')]||_0x262c('0xe');this[_0x262c('0xf')]=0x0;this[_0x262c('0x10')]=0x0;this[_0x262c('0x11')]=0x0;this['answered']=0x0;this[_0x262c('0x12')]=0x0;this[_0x262c('0x13')]=0x0;this['sumBillable']=0x0;this[_0x262c('0x14')]=0x0;this[_0x262c('0x15')]=0x0;this[_0x262c('0x16')]=0x0;this[_0x262c('0x17')]=0x0;this[_0x262c('0x18')]=_0x3074f0[_0x262c('0x18')]||![];this[_0x262c('0x19')]=_0x3074f0['acwTimeout']||0xa;this['autopause']=_0x3074f0[_0x262c('0x1a')]||'no';this[_0x262c('0x1b')]=!![];this[_0x262c('0x1c')]='';this[_0x262c('0x1d')]=0x0;this[_0x262c('0x1e')]=0x0;this['dialTimezone']=_0x3074f0[_0x262c('0x1f')]||null;this[_0x262c('0x20')]=_0x3074f0['dialGlobalInterval']?_0x3074f0[_0x262c('0x20')]:null;this['dialActive']=_0x3074f0['dialActive'];this[_0x262c('0x21')]=_0x3074f0['dialMethod']||_0x262c('0x22');this[_0x262c('0x23')]=_0x3074f0['dialLimitChannel']||0x0;this[_0x262c('0x24')]=_0x3074f0[_0x262c('0x24')]||0x0;this[_0x262c('0x25')]=_0x3074f0[_0x262c('0x25')]||0x1;this['dialPredictiveOptimization']=_0x3074f0[_0x262c('0x26')]||_0x262c('0x27');this[_0x262c('0x28')]=_0x3074f0[_0x262c('0x28')]||0.03;this[_0x262c('0x29')]=_0x3074f0[_0x262c('0x29')]||0x258;this['dialOriginateCallerIdName']=_0x3074f0[_0x262c('0x2a')]||_0x262c('0x2b');this['dialOriginateCallerIdNumber']=_0x3074f0['dialOriginateCallerIdNumber']||_0x262c('0x2b');this[_0x262c('0x2c')]=_0x3074f0[_0x262c('0x2c')]||0x1e;this[_0x262c('0x2d')]=_0x3074f0[_0x262c('0x2d')]||'tTxX';this[_0x262c('0x2e')]=_0x3074f0['dialQueueTimeout']||0x3;this['dialQueueProject']=_0x3074f0['dialQueueProject']||undefined;this['dialCongestionMaxRetry']=_0x3074f0[_0x262c('0x2f')]||0x3;this[_0x262c('0x30')]=_0x3074f0[_0x262c('0x30')]||0x96;this[_0x262c('0x31')]=_0x3074f0['dialBusyMaxRetry']||0x3;this[_0x262c('0x32')]=_0x3074f0[_0x262c('0x32')]||0x96;this['dialNoAnswerMaxRetry']=_0x3074f0[_0x262c('0x33')]||0x3;this['dialNoAnswerRetryFrequency']=_0x3074f0[_0x262c('0x34')]||0x96;this[_0x262c('0x35')]=_0x3074f0[_0x262c('0x35')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x3074f0[_0x262c('0x36')]||0x96;this['dialDropMaxRetry']=_0x3074f0[_0x262c('0x37')]||0x3;this['dialDropRetryFrequency']=_0x3074f0[_0x262c('0x38')]||0x96;this[_0x262c('0x39')]=_0x3074f0[_0x262c('0x39')]||0x3;this[_0x262c('0x3a')]=_0x3074f0[_0x262c('0x3a')]||0x96;this[_0x262c('0x3b')]=_0x3074f0[_0x262c('0x3b')]||0x3;this[_0x262c('0x3c')]=_0x3074f0[_0x262c('0x3c')]||0x96;this[_0x262c('0x3d')]=_0x3074f0['dialAgentRejectMaxRetry']||0x3;this[_0x262c('0x3e')]=_0x3074f0[_0x262c('0x3e')]||0x96;this[_0x262c('0x3f')]=_0x3074f0[_0x262c('0x3f')]||0x3;this['dialGlobalMaxRetry']=_0x3074f0['dialGlobalMaxRetry']||0x4;this[_0x262c('0x40')]=_0x3074f0['Trunk']?_0x3074f0['Trunk']:undefined;this[_0x262c('0x41')]=_0x3074f0[_0x262c('0x41')]?_0x3074f0[_0x262c('0x41')]:undefined;this[_0x262c('0x42')]=_0x3074f0['dialPrefix']||undefined;this['Interval']=_0x3074f0[_0x262c('0x43')]?_0x3074f0[_0x262c('0x43')]:undefined;this[_0x262c('0x44')]=_0x3074f0[_0x262c('0x44')]||_0x262c('0x45');this[_0x262c('0x46')]=_0x3074f0[_0x262c('0x46')]||undefined;this['dialCutDigit']=_0x3074f0[_0x262c('0x47')]||undefined;this[_0x262c('0x48')]=strategy[_0x3074f0[_0x262c('0x48')]]||_0x262c('0x9');this[_0x262c('0x49')]=!![];this[_0x262c('0x4a')]=_0x3074f0[_0x262c('0x4a')]||![];this[_0x262c('0x4b')]=_0x3074f0['dialAMDInitialSilence'];this[_0x262c('0x4c')]=_0x3074f0[_0x262c('0x4c')];this[_0x262c('0x4d')]=_0x3074f0['dialAMDAfterGreetingSilence'];this[_0x262c('0x4e')]=_0x3074f0[_0x262c('0x4e')];this[_0x262c('0x4f')]=_0x3074f0[_0x262c('0x4f')];this[_0x262c('0x50')]=_0x3074f0[_0x262c('0x50')];this['dialAMDMaximumNumberOfWords']=_0x3074f0[_0x262c('0x51')];this[_0x262c('0x52')]=_0x3074f0[_0x262c('0x52')];this['dialAMDMaximumWordLength']=_0x3074f0[_0x262c('0x53')];this['outboundRejectCallsDay']=0x0;this[_0x262c('0x54')]=0x0;this['timeout']=_0x3074f0[_0x262c('0x55')];this[_0x262c('0x56')]=0x0;this[_0x262c('0x57')]=0x0;this[_0x262c('0x58')]=0x0;this[_0x262c('0x59')]=0x0;this['outboundCongestionCallsDay']=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x262c('0x5a')]=0x0;this[_0x262c('0x5b')]=0x0;this[_0x262c('0x5c')]=0x0;this[_0x262c('0x5d')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0x262c('0x5e')]=0x0;this['outboundReCallsDay']=0x0;this['outboundAbandonedDay']=0x0;this[_0x262c('0x5f')]=undefined;this[_0x262c('0x60')]=undefined;this[_0x262c('0x61')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this['predictiveIntervalTotalCalls']=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x262c('0x62')]=0x0;this[_0x262c('0x63')]=0x0;this[_0x262c('0x64')]=0x0;this[_0x262c('0x65')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x262c('0x66')]=0x0;this[_0x262c('0x67')]=_0x3074f0[_0x262c('0x68')]||0x14;this[_0x262c('0x69')]=_0x3074f0[_0x262c('0x68')]||0xa;this[_0x262c('0x6a')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x262c('0x6b')]=0x1;this[_0x262c('0x6c')]=0x0;this[_0x262c('0x6d')]=0x0;this[_0x262c('0x6e')]=0x0;this[_0x262c('0x6f')]=0x0;this[_0x262c('0x70')]=_0x3074f0['dialRecallMeTimeout']||0x1e;this[_0x262c('0x71')]=_0x3074f0['dialRecallInQueue']||![];this['dialPreviewAutoRecallMe']=!!_0x3074f0[_0x262c('0x72')]||![];this['dialPreviewRecallmeReminder']=!!_0x3074f0[_0x262c('0x73')]||![];this[_0x262c('0x74')]=_0x3074f0['dialQueueProject2']||undefined;this[_0x262c('0x75')]=_0x3074f0[_0x262c('0x75')]||![];this[_0x262c('0x76')]=_0x3074f0[_0x262c('0x76')]||![];this['monitor_format']=monitorFormat[_0x3074f0[_0x262c('0xc')]]?monitorFormat[_0x3074f0[_0x262c('0xc')]]:undefined;this[_0x262c('0x77')]=_0x3074f0[_0x262c('0x77')]||![];this[_0x262c('0x78')]=_0x3074f0['mandatoryDispositionPause']?_0x3074f0[_0x262c('0x78')]:undefined;}module[_0x262c('0x79')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 9ef0814..80240e5 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 _0x2b67=['accessKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x33a963,_0x5203a9){var _0x5448f3=function(_0x4f37bb){while(--_0x4f37bb){_0x33a963['push'](_0x33a963['shift']());}};_0x5448f3(++_0x5203a9);}(_0x2b67,0x67));var _0x72b6=function(_0x1edac5,_0x38651d){_0x1edac5=_0x1edac5-0x0;var _0x314ff1=_0x2b67[_0x1edac5];return _0x314ff1;};'use strict';function VtigerAccount(_0x56eafd){this['id']=_0x56eafd['id']||0x0;this['name']=_0x56eafd[_0x72b6('0x0')]||'';this[_0x72b6('0x1')]=_0x56eafd['username']||'';this[_0x72b6('0x2')]=_0x56eafd['accessKey']||'';this['remoteUri']=_0x56eafd[_0x72b6('0x3')]||'';this[_0x72b6('0x4')]=_0x56eafd[_0x72b6('0x4')]||'';this[_0x72b6('0x5')]=_0x56eafd['Configurations']||{};}module[_0x72b6('0x6')]=VtigerAccount; \ No newline at end of file +var _0xfed3=['username','accessKey','serverUrl','Configurations','name'];(function(_0x523c75,_0x493877){var _0x5db164=function(_0x16474b){while(--_0x16474b){_0x523c75['push'](_0x523c75['shift']());}};_0x5db164(++_0x493877);}(_0xfed3,0x18f));var _0x3fed=function(_0x1a0daa,_0x2a4634){_0x1a0daa=_0x1a0daa-0x0;var _0x1dbe15=_0xfed3[_0x1a0daa];return _0x1dbe15;};'use strict';function VtigerAccount(_0x3907ea){this['id']=_0x3907ea['id']||0x0;this['name']=_0x3907ea[_0x3fed('0x0')]||'';this[_0x3fed('0x1')]=_0x3907ea[_0x3fed('0x1')]||'';this[_0x3fed('0x2')]=_0x3907ea[_0x3fed('0x2')]||'';this['remoteUri']=_0x3907ea['remoteUri']||'';this[_0x3fed('0x3')]=_0x3907ea[_0x3fed('0x3')]||'';this[_0x3fed('0x4')]=_0x3907ea[_0x3fed('0x4')]||{};}module['exports']=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index d672da7..415fdda 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 _0x94e9=['remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name','username','password','token'];(function(_0x496ff0,_0x1dc464){var _0x3f124e=function(_0x16e9ff){while(--_0x16e9ff){_0x496ff0['push'](_0x496ff0['shift']());}};_0x3f124e(++_0x1dc464);}(_0x94e9,0x151));var _0x994e=function(_0x160248,_0x2a57e6){_0x160248=_0x160248-0x0;var _0x4e589d=_0x94e9[_0x160248];return _0x4e589d;};'use strict';function ZendeskAccount(_0x4a9e67){this['id']=_0x4a9e67['id']||0x0;this[_0x994e('0x0')]=_0x4a9e67[_0x994e('0x0')]||'';this[_0x994e('0x1')]=_0x4a9e67[_0x994e('0x1')]||'';this[_0x994e('0x2')]=_0x4a9e67[_0x994e('0x2')]||'';this[_0x994e('0x3')]=_0x4a9e67[_0x994e('0x3')]||'';this['remoteUri']=_0x4a9e67[_0x994e('0x4')]||'';this['authType']=_0x4a9e67[_0x994e('0x5')]||'';this[_0x994e('0x6')]=_0x4a9e67['type']||_0x994e('0x7');this[_0x994e('0x8')]=_0x4a9e67['serverUrl']||'';this[_0x994e('0x9')]=_0x4a9e67['Configurations']||{};}module[_0x994e('0xa')]=ZendeskAccount; \ No newline at end of file +var _0x7a20=['token','remoteUri','authType','type','serverUrl','Configurations','exports','name','username','password'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0x7a20,0x16f));var _0x07a2=function(_0x1dee86,_0x2b42b3){_0x1dee86=_0x1dee86-0x0;var _0x5f57aa=_0x7a20[_0x1dee86];return _0x5f57aa;};'use strict';function ZendeskAccount(_0x417912){this['id']=_0x417912['id']||0x0;this[_0x07a2('0x0')]=_0x417912[_0x07a2('0x0')]||'';this[_0x07a2('0x1')]=_0x417912[_0x07a2('0x1')]||'';this['password']=_0x417912[_0x07a2('0x2')]||'';this[_0x07a2('0x3')]=_0x417912[_0x07a2('0x3')]||'';this[_0x07a2('0x4')]=_0x417912['remoteUri']||'';this[_0x07a2('0x5')]=_0x417912['authType']||'';this[_0x07a2('0x6')]=_0x417912[_0x07a2('0x6')]||'integrationTab';this[_0x07a2('0x7')]=_0x417912['serverUrl']||'';this['Configurations']=_0x417912[_0x07a2('0x8')]||{};}module[_0x07a2('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 eed9a6c..c6fc040 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 _0xe786=['clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description','host','clientId'];(function(_0x415b61,_0x3bb12f){var _0x5017d5=function(_0x5f3a5d){while(--_0x5f3a5d){_0x415b61['push'](_0x415b61['shift']());}};_0x5017d5(++_0x3bb12f);}(_0xe786,0xce));var _0x6e78=function(_0x4327fe,_0x4f8040){_0x4327fe=_0x4327fe-0x0;var _0x138651=_0xe786[_0x4327fe];return _0x138651;};'use strict';function ZohoAccount(_0x284dd6){this['id']=_0x284dd6['id']||0x0;this[_0x6e78('0x0')]=_0x284dd6[_0x6e78('0x0')]||'';this[_0x6e78('0x1')]=_0x284dd6[_0x6e78('0x1')]||'';this[_0x6e78('0x2')]=_0x284dd6[_0x6e78('0x2')]||'';this['zone']=_0x284dd6['zone']||'';this[_0x6e78('0x3')]=_0x284dd6['clientId']||'';this['clientSecret']=_0x284dd6[_0x6e78('0x4')]||'';this[_0x6e78('0x5')]=_0x284dd6[_0x6e78('0x5')]||'';this['code']=_0x284dd6[_0x6e78('0x6')]||'';this['refreshToken']=_0x284dd6[_0x6e78('0x7')]||'';this['Configurations']=_0x284dd6[_0x6e78('0x8')]||{};}module[_0x6e78('0x9')]=ZohoAccount; \ No newline at end of file +var _0xf831=['serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret'];(function(_0x225ed5,_0x17b2b2){var _0x3288f4=function(_0x4865e1){while(--_0x4865e1){_0x225ed5['push'](_0x225ed5['shift']());}};_0x3288f4(++_0x17b2b2);}(_0xf831,0x123));var _0x1f83=function(_0x3caa07,_0x14822f){_0x3caa07=_0x3caa07-0x0;var _0xa9c357=_0xf831[_0x3caa07];return _0xa9c357;};'use strict';function ZohoAccount(_0x5e8384){this['id']=_0x5e8384['id']||0x0;this[_0x1f83('0x0')]=_0x5e8384[_0x1f83('0x0')]||'';this['description']=_0x5e8384[_0x1f83('0x1')]||'';this['host']=_0x5e8384[_0x1f83('0x2')]||'';this[_0x1f83('0x3')]=_0x5e8384['zone']||'';this[_0x1f83('0x4')]=_0x5e8384[_0x1f83('0x4')]||'';this[_0x1f83('0x5')]=_0x5e8384['clientSecret']||'';this[_0x1f83('0x6')]=_0x5e8384[_0x1f83('0x6')]||'';this[_0x1f83('0x7')]=_0x5e8384[_0x1f83('0x7')]||'';this['refreshToken']=_0x5e8384[_0x1f83('0x8')]||'';this[_0x1f83('0x9')]=_0x5e8384[_0x1f83('0x9')]||{};}module[_0x1f83('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 cc37b4c..0759e56 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 _0x5464=['membername','Agent','channelAgent','format','calleridname','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','exports','util','lodash','moment','string','isNil','uniqueid','idContact','queue','name','type','campaigntype'];(function(_0x397418,_0x35fb2f){var _0x50e1c0=function(_0x116380){while(--_0x116380){_0x397418['push'](_0x397418['shift']());}};_0x50e1c0(++_0x35fb2f);}(_0x5464,0x15d));var _0x4546=function(_0x3419fc,_0x23d776){_0x3419fc=_0x3419fc-0x0;var _0x27f77a=_0x5464[_0x3419fc];return _0x27f77a;};'use strict';var util=require(_0x4546('0x0'));var _=require(_0x4546('0x1'));var moment=require(_0x4546('0x2'));function checkNameSurname(_0x4f33fd,_0x3add1b,_0x5b51d3){var _0x11ba33='';if(!_['isNil'](_0x3add1b)&&_0x4546('0x3')===typeof _0x3add1b){_0x11ba33+=_0x3add1b;}if(!_[_0x4546('0x4')](_0x5b51d3)&&_0x4546('0x3')===typeof _0x5b51d3){_0x11ba33+='\x20'+_0x5b51d3;}if(_0x11ba33!==''){return _0x11ba33;}return _0x4f33fd;}function Action(_0x2b1a9b,_0x54228a,_0x57391f,_0x5c5e09,_0x224c7c){this[_0x4546('0x5')]=_0x57391f||undefined;this[_0x4546('0x6')]=_0x2b1a9b['id'];this[_0x4546('0x7')]=_0x54228a[_0x4546('0x8')];this[_0x4546('0x9')]=_0x54228a[_0x4546('0x9')];this[_0x4546('0xa')]=_0x4546('0x7');this['dialAnswer']=![];this[_0x4546('0xb')]=_[_0x4546('0x4')](_0x2b1a9b[_0x4546('0xc')])?undefined:_0x2b1a9b['Agent'][_0x4546('0x8')];this[_0x4546('0xd')]=this[_0x4546('0xb')]?util[_0x4546('0xe')]('SIP/%s',this['membername']):_0x5c5e09||undefined;this[_0x4546('0xf')]=checkNameSurname(_0x2b1a9b['Contact']['phone'],_0x2b1a9b['Contact']['firstName'],_0x2b1a9b['Contact']['lastName']);this[_0x4546('0x10')]=_0x2b1a9b['active']||![];this[_0x4546('0x11')]=_0x2b1a9b['phone'];this[_0x4546('0x12')]=_0x2b1a9b['scheduledat'];this[_0x4546('0x13')]=_0x2b1a9b[_0x4546('0x13')]||0x0;this[_0x4546('0x14')]=_0x2b1a9b[_0x4546('0x14')]||0x0;this[_0x4546('0x15')]=_0x2b1a9b[_0x4546('0x15')]||0x0;this['countglobal']=(_0x2b1a9b['countbusyretry']||0x0)+(_0x2b1a9b['countcongestionretry']||0x0)+(_0x2b1a9b[_0x4546('0x15')]||0x0)+(_0x2b1a9b[_0x4546('0x16')]||0x0)+(_0x2b1a9b[_0x4546('0x17')]||0x0)+(_0x2b1a9b[_0x4546('0x18')]||0x0)+(_0x2b1a9b[_0x4546('0x19')]||0x0)+(_0x2b1a9b[_0x4546('0x1a')]||0x0);this[_0x4546('0x16')]=_0x2b1a9b[_0x4546('0x16')]||0x0;this[_0x4546('0x17')]=_0x2b1a9b[_0x4546('0x17')]||0x0;this['countabandonedretry']=_0x2b1a9b[_0x4546('0x18')]||0x0;this[_0x4546('0x19')]=_0x2b1a9b['countmachineretry']||0x0;this[_0x4546('0x1a')]=_0x2b1a9b[_0x4546('0x1a')]||0x0;this[_0x4546('0x1b')]=_0x2b1a9b[_0x4546('0x1b')];this[_0x4546('0x1c')]=_0x2b1a9b[_0x4546('0x1c')];this['callbackat']=_0x2b1a9b[_0x4546('0x1d')];this[_0x4546('0x1e')]=_0x2b1a9b['recallme'];this[_0x4546('0x1f')]=_0x2b1a9b[_0x4546('0x1f')];this[_0x4546('0x20')]=_0x2b1a9b[_0x4546('0x20')];this[_0x4546('0x21')]=_['isNil'](_0x2b1a9b[_0x4546('0xc')])?_0x2b1a9b[_0x4546('0x21')]:_0x2b1a9b[_0x4546('0xc')]['id'];this['VoiceQueueId']=_0x2b1a9b['VoiceQueueId'];this[_0x4546('0x22')]='';this[_0x4546('0x23')]='';}Action[_0x4546('0x24')][_0x4546('0x25')]=function(){return util[_0x4546('0xe')](_0x4546('0x26'),this[_0x4546('0xf')],this['number']);};module[_0x4546('0x27')]=Action; \ No newline at end of file +var _0xb574=['prototype','\x22%s\x22\x20<%s>','number','exports','util','lodash','isNil','string','queue','name','type','campaigntype','dialAnswer','membername','Agent','format','SIP/%s','calleridname','Contact','phone','firstName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname'];(function(_0x119021,_0x5bc6dd){var _0x2f1e9e=function(_0x12a002){while(--_0x12a002){_0x119021['push'](_0x119021['shift']());}};_0x2f1e9e(++_0x5bc6dd);}(_0xb574,0x106));var _0x4b57=function(_0x3df95c,_0x34729f){_0x3df95c=_0x3df95c-0x0;var _0x26e37a=_0xb574[_0x3df95c];return _0x26e37a;};'use strict';var util=require(_0x4b57('0x0'));var _=require(_0x4b57('0x1'));var moment=require('moment');function checkNameSurname(_0x213dde,_0x3d351b,_0x5a4911){var _0x413f1d='';if(!_[_0x4b57('0x2')](_0x3d351b)&&_0x4b57('0x3')===typeof _0x3d351b){_0x413f1d+=_0x3d351b;}if(!_[_0x4b57('0x2')](_0x5a4911)&&_0x4b57('0x3')===typeof _0x5a4911){_0x413f1d+='\x20'+_0x5a4911;}if(_0x413f1d!==''){return _0x413f1d;}return _0x213dde;}function Action(_0x4a3efa,_0x4eb019,_0x1c97e5,_0x4a4a0f,_0x585d86){this['uniqueid']=_0x1c97e5||undefined;this['idContact']=_0x4a3efa['id'];this[_0x4b57('0x4')]=_0x4eb019[_0x4b57('0x5')];this[_0x4b57('0x6')]=_0x4eb019[_0x4b57('0x6')];this[_0x4b57('0x7')]=_0x4b57('0x4');this[_0x4b57('0x8')]=![];this[_0x4b57('0x9')]=_['isNil'](_0x4a3efa[_0x4b57('0xa')])?undefined:_0x4a3efa[_0x4b57('0xa')][_0x4b57('0x5')];this['channelAgent']=this['membername']?util[_0x4b57('0xb')](_0x4b57('0xc'),this[_0x4b57('0x9')]):_0x4a4a0f||undefined;this[_0x4b57('0xd')]=checkNameSurname(_0x4a3efa[_0x4b57('0xe')][_0x4b57('0xf')],_0x4a3efa[_0x4b57('0xe')][_0x4b57('0x10')],_0x4a3efa[_0x4b57('0xe')]['lastName']);this['active']=_0x4a3efa[_0x4b57('0x11')]||![];this[_0x4b57('0x12')]=_0x4a3efa[_0x4b57('0xf')];this['scheduledat']=_0x4a3efa[_0x4b57('0x13')];this['countbusyretry']=_0x4a3efa[_0x4b57('0x14')]||0x0;this[_0x4b57('0x15')]=_0x4a3efa[_0x4b57('0x15')]||0x0;this[_0x4b57('0x16')]=_0x4a3efa[_0x4b57('0x16')]||0x0;this[_0x4b57('0x17')]=(_0x4a3efa['countbusyretry']||0x0)+(_0x4a3efa[_0x4b57('0x15')]||0x0)+(_0x4a3efa[_0x4b57('0x16')]||0x0)+(_0x4a3efa[_0x4b57('0x18')]||0x0)+(_0x4a3efa[_0x4b57('0x19')]||0x0)+(_0x4a3efa['countabandonedretry']||0x0)+(_0x4a3efa[_0x4b57('0x1a')]||0x0)+(_0x4a3efa[_0x4b57('0x1b')]||0x0);this[_0x4b57('0x18')]=_0x4a3efa[_0x4b57('0x18')]||0x0;this[_0x4b57('0x19')]=_0x4a3efa[_0x4b57('0x19')]||0x0;this['countabandonedretry']=_0x4a3efa[_0x4b57('0x1c')]||0x0;this[_0x4b57('0x1a')]=_0x4a3efa[_0x4b57('0x1a')]||0x0;this['countagentrejectretry']=_0x4a3efa[_0x4b57('0x1b')]||0x0;this[_0x4b57('0x1d')]=_0x4a3efa[_0x4b57('0x1d')];this[_0x4b57('0x1e')]=_0x4a3efa['callbackuniqueid'];this[_0x4b57('0x1f')]=_0x4a3efa[_0x4b57('0x1f')];this['recallme']=_0x4a3efa[_0x4b57('0x20')];this[_0x4b57('0x21')]=_0x4a3efa[_0x4b57('0x21')];this[_0x4b57('0x22')]=_0x4a3efa['ListId'];this[_0x4b57('0x23')]=_['isNil'](_0x4a3efa[_0x4b57('0xa')])?_0x4a3efa['UserId']:_0x4a3efa[_0x4b57('0xa')]['id'];this[_0x4b57('0x24')]=_0x4a3efa[_0x4b57('0x24')];this[_0x4b57('0x25')]='';this[_0x4b57('0x26')]='';}Action[_0x4b57('0x27')]['getCaller']=function(){return util['format'](_0x4b57('0x28'),this['calleridname'],this[_0x4b57('0x29')]);};module[_0x4b57('0x2a')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 1150c4a..cb77e22 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 _0x6334=['predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','name','active','callerid','Interval','stringify','format','voice:queue:%s','voice_queue:save','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_presence:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','DEACTIVATED','[CampaignPreview]\x20Campaign\x20Queue:\x20','loopCampaigns','syncCampaigns','prototype','booked','clearZombieChannels','hasOwnProperty','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','sequence','actions','queue','pTalking:\x20','dialAnswer','contactId','UserId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','info','size','getContactRecallMe','agentReadyId','then','isNil','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','NoSuchNumber','buildObj','createCustomerHistory','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','scheduledAt','countnosuchnumberretry','unlockAgent','activeContact','actioncountonusuch','idContact','incrementPreviewCounters','ANSWER','answertime','[syncHangup][talking][increment]','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','decrementTalkink','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','uniqueid','linkedid','BUSY','dialBusyRetryFrequency','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','verifyAdditionalPhones','additional','[callProgressDetectingCustomer][logBusyGlobal]','countbusyretry','dialBusyMaxRetry','rescheduleContact','swapAdditionalPhones','NOANSWER','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency','noanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','CONGESTION','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','cause-txt','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','callProgressDetectingAgent','isUndefined','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','resolve','[swapAdditionalPhone]\x20','checkInBlack','Contact','VoiceQueueId','Contact\x20is\x20undefined','lookAgent','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','Calling','[Preview][execCall][failure]','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','run','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','checkIsBlackList','pick','phone','[Preview][checkIsBlackList]','[Preview][getContactPreview]','isEmpty','[Preview][validateContact][Empty\x20Contact]','Queue','Empty\x20Campaign','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20Backup\x20is\x20not\x20active','\x20Not\x20Active','SIP/%s/%s%s','dialCutDigit','substring','trim','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','toLowerVariables','variablesAction','OriginateError','syncOriginateResponse','actionid','clone','responsetime','isFailure','[syncHangup][talking]','cause','statedesc','dialQueueProject','[syncHangup][talking][cause]','destlinkedid','destuniqueid','addVariable','variables','filterKey','keys','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfer','transfererlinkedid','util','lodash','bluebird','uuid','moment','md5','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','redis','defaults','localhost','socket.io-emitter','enqueue','tail','finally','campaignsPreview','voiceQueues','trunks','agents','clockClearZombieChannels','bind','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','syncNewExten','varset','syncVarSet','syncAttendedTransfer','emit','type','outbound','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime'];(function(_0x50e5f6,_0x4fe637){var _0x23e514=function(_0x3e37a9){while(--_0x3e37a9){_0x50e5f6['push'](_0x50e5f6['shift']());}};_0x23e514(++_0x4fe637);}(_0x6334,0x119));var _0x4633=function(_0x39ffd1,_0x299703){_0x39ffd1=_0x39ffd1-0x0;var _0x31267e=_0x6334[_0x39ffd1];return _0x31267e;};'use strict';var util=require(_0x4633('0x0'));var _=require(_0x4633('0x1'));var BPromise=require(_0x4633('0x2'));var uuid=require(_0x4633('0x3'));var moment=require(_0x4633('0x4'));var md5=require(_0x4633('0x5'));var Redis=require('ioredis');var config=require(_0x4633('0x6'));var logger=require(_0x4633('0x7'))(_0x4633('0x8'));var loggerAction=require(_0x4633('0x7'))(_0x4633('0x9'));var ami=require(_0x4633('0xa'));var rpcDb=require(_0x4633('0xb'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x4633('0xc'));var ut=require('./util/util');config[_0x4633('0xd')]=_[_0x4633('0xe')](config['redis'],{'host':_0x4633('0xf'),'port':0x18eb});var io=require(_0x4633('0x10'))(new Redis(config[_0x4633('0xd')]));var Sequence=function(){};Sequence['prototype'][_0x4633('0x11')]=function(_0x2f07fa){this['tail']=this[_0x4633('0x12')]?this[_0x4633('0x12')][_0x4633('0x13')](_0x2f07fa):_0x2f07fa();};function Preview(_0x224384){this['sequence']=new Sequence();this[_0x4633('0x14')]=_0x224384[_0x4633('0x15')];this[_0x4633('0x16')]=_0x224384['trunks'];this['actions']={};this['agents']=_0x224384[_0x4633('0x17')];this[_0x4633('0x18')]=0x0;ami['on']('originateresponse',this['syncOriginateResponse'][_0x4633('0x19')](this));ami['on']('hangup',this[_0x4633('0x1a')][_0x4633('0x19')](this));ami['on'](_0x4633('0x1b'),this[_0x4633('0x1c')]['bind'](this));ami['on'](_0x4633('0x1d'),this[_0x4633('0x1e')][_0x4633('0x19')](this));ami['on']('newexten',this[_0x4633('0x1f')][_0x4633('0x19')](this));ami['on'](_0x4633('0x20'),this[_0x4633('0x21')][_0x4633('0x19')](this));ami['on']('attendedtransfer',this[_0x4633('0x22')][_0x4633('0x19')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x4633('0x19')](this));this['loopCampaigns'](this[_0x4633('0x14')]);}function emit(_0x5b5011,_0x57dfb8,_0x109472){io['to'](_0x5b5011)[_0x4633('0x23')](_0x57dfb8,_0x109472);}function emitCampaignPreview(_0x23bc5e){if(_0x23bc5e[_0x4633('0x24')]===_0x4633('0x25')){var _0x2d46f7={'id':_0x23bc5e['id'],'name':_0x23bc5e['name'],'strategy':_0x23bc5e[_0x4633('0x26')],'answered':_0x23bc5e['answered'],'available':_0x23bc5e[_0x4633('0x27')],'loggedIn':_0x23bc5e[_0x4633('0x28')],'pTalking':_0x23bc5e[_0x4633('0x29')],'sumBillable':_0x23bc5e[_0x4633('0x2a')],'sumDuration':_0x23bc5e[_0x4633('0x2b')],'sumHoldTime':_0x23bc5e['sumHoldTime']||0x0,'talking':_0x23bc5e[_0x4633('0x2c')],'total':_0x23bc5e[_0x4633('0x2d')],'type':_0x23bc5e[_0x4633('0x24')],'unmanaged':_0x23bc5e[_0x4633('0x2e')],'abandoned':_0x23bc5e[_0x4633('0x2f')],'waiting':_0x23bc5e[_0x4633('0x30')],'loggedInDb':_0x23bc5e[_0x4633('0x31')],'dialActive':_0x23bc5e[_0x4633('0x32')],'dialMethod':_0x23bc5e[_0x4633('0x33')],'dialOriginateCallerIdName':_0x23bc5e[_0x4633('0x34')],'dialOriginateCallerIdNumber':_0x23bc5e[_0x4633('0x35')],'dialOriginateTimeout':_0x23bc5e[_0x4633('0x36')],'dialPrefix':_0x23bc5e[_0x4633('0x37')],'outboundAnswerAgiCallsDay':_0x23bc5e[_0x4633('0x38')],'outboundAnswerCallsDay':_0x23bc5e[_0x4633('0x39')],'outboundBlacklistCallsDay':_0x23bc5e[_0x4633('0x3a')],'outboundBusyCallsDay':_0x23bc5e[_0x4633('0x3b')],'outboundCongestionCallsDay':_0x23bc5e[_0x4633('0x3c')],'outboundDropCallsDayACS':_0x23bc5e['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x23bc5e[_0x4633('0x3d')],'outboundDropCallsDayTimeout':_0x23bc5e[_0x4633('0x3e')],'outboundNoAnswerCallsDay':_0x23bc5e[_0x4633('0x3f')],'outboundNoSuchCallsDay':_0x23bc5e[_0x4633('0x40')],'outboundOriginateFailureCallsDay':_0x23bc5e[_0x4633('0x41')],'outboundReCallsDay':_0x23bc5e[_0x4633('0x42')],'outboundRejectCallsDay':_0x23bc5e['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x23bc5e[_0x4633('0x43')],'outboundAbandonedCallsDay':_0x23bc5e['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x23bc5e[_0x4633('0x44')],'predictiveIntervalAvgHoldtime':_0x23bc5e[_0x4633('0x45')],'predictiveIntervalAvgTalktime':_0x23bc5e[_0x4633('0x46')],'predictiveIntervalDroppedCallsCallersExit':_0x23bc5e[_0x4633('0x47')],'predictiveIntervalDroppedCallsTimeout':_0x23bc5e[_0x4633('0x48')],'predictiveIntervalErlangCalls':_0x23bc5e[_0x4633('0x49')],'predictiveIntervalErlangCallsDroppedCalls':_0x23bc5e[_0x4633('0x4a')],'predictiveIntervalHitRate':_0x23bc5e[_0x4633('0x4b')],'predictiveIntervalMultiplicativeFactor':_0x23bc5e[_0x4633('0x4c')],'predictiveIntervalPauses':_0x23bc5e[_0x4633('0x4d')],'predictiveIntervalAvailable':_0x23bc5e[_0x4633('0x4e')],'predictiveIntervalTotalCalls':_0x23bc5e[_0x4633('0x4f')],'message':_0x23bc5e[_0x4633('0x50')],'originated':_0x23bc5e[_0x4633('0x51')],'erlangCalls':_0x23bc5e['erlangCalls'],'erlangCallToSecond':_0x23bc5e['erlangCallToSecond'],'erlangAbandonmentRate':_0x23bc5e[_0x4633('0x52')],'erlangBusyFactor':_0x23bc5e[_0x4633('0x53')],'startPredictive':_0x23bc5e['startPredictive'],'startProgressive':_0x23bc5e[_0x4633('0x54')]};if(_0x23bc5e[_0x4633('0x55')]){_0x2d46f7[_0x4633('0x55')]={'id':_0x23bc5e[_0x4633('0x55')]['id'],'name':_0x23bc5e['Trunk'][_0x4633('0x56')],'active':_0x23bc5e['Trunk'][_0x4633('0x57')],'callerid':_0x23bc5e[_0x4633('0x55')][_0x4633('0x58')]};}if(_0x23bc5e[_0x4633('0x59')]){_0x2d46f7[_0x4633('0x59')]={'id':_0x23bc5e[_0x4633('0x59')]['id'],'name':_0x23bc5e[_0x4633('0x59')][_0x4633('0x56')]};}var _0x546390=md5(JSON[_0x4633('0x5a')](_0x2d46f7));if(_0x23bc5e[_0x4633('0x5')]!==_0x546390){_0x23bc5e['md5']=_0x546390;emit(util[_0x4633('0x5b')](_0x4633('0x5c'),_0x2d46f7[_0x4633('0x56')]),_0x4633('0x5d'),_0x2d46f7);}}}function emitVoiceQueueChannelRemove(_0x47d574){logger['info'](_0x4633('0x5e'),JSON['stringify'](_0x47d574));emit(util['format'](_0x4633('0x5c'),_0x47d574['name']),'voice_queue_channel:remove',_0x47d574);io[_0x4633('0x23')](_0x4633('0x5f'),_0x47d574);}function notSendMessagesQueue(_0x129f3c){if(_0x129f3c[_0x4633('0x60')]){if(_0x129f3c[_0x4633('0x51')]===0x0&&_0x129f3c['pTalking']===0x0){_0x129f3c[_0x4633('0x60')]=![];_0x129f3c['available']=0x0;_0x129f3c[_0x4633('0x61')]=0x0;_0x129f3c[_0x4633('0x50')]=_0x4633('0x62');ut[_0x4633('0x63')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x129f3c[_0x4633('0x56')]+'\x20is\x20not\x20active');}else{_0x129f3c[_0x4633('0x50')]=_0x4633('0x64');ut[_0x4633('0x63')](_0x4633('0x65'),_0x129f3c[_0x4633('0x56')]+'\x20is\x20deactivated');}emitCampaignPreview(_0x129f3c);}}Preview['prototype'][_0x4633('0x66')]=function(){var _0x43f5ab=this;setInterval(function(){_0x43f5ab[_0x4633('0x67')]();},0x7cf);};Preview[_0x4633('0x68')][_0x4633('0x67')]=function(){var _0x53669c=this[_0x4633('0x14')];this['clockClearZombieChannels']+=0x1;for(var _0x2eef89 in _0x53669c){if(_0x53669c['hasOwnProperty'](_0x2eef89)&&(_0x53669c[_0x2eef89][_0x4633('0x33')]==='preview'||_0x53669c[_0x2eef89][_0x4633('0x33')]===_0x4633('0x69'))&&_0x53669c[_0x2eef89][_0x4633('0x24')]===_0x4633('0x25')){if(this[_0x4633('0x18')]>0x7){this[_0x4633('0x18')]=0x0;this[_0x4633('0x6a')]();}}if(_0x53669c[_0x4633('0x6b')](_0x2eef89)&&_0x53669c[_0x2eef89][_0x4633('0x33')]===_0x4633('0x8')&&_0x53669c[_0x2eef89][_0x4633('0x24')]===_0x4633('0x25')){if(_0x53669c[_0x2eef89][_0x4633('0x32')]){this[_0x4633('0x6c')](_0x53669c[_0x2eef89]);if(_0x53669c[_0x2eef89][_0x4633('0x6d')])this[_0x4633('0x6e')](_0x53669c[_0x2eef89]);}else{notSendMessagesQueue(_0x53669c[_0x2eef89]);}}}};Preview[_0x4633('0x68')][_0x4633('0x6f')]=function(_0x185647){var _0x102b01=this;this[_0x4633('0x70')]['enqueue'](function(){if(!_['isNil'](_0x102b01[_0x4633('0x71')][_0x185647])){loggerAction['info']('[clearZombieChannels][talking]',_0x185647,'Queue',_0x102b01[_0x4633('0x71')][_0x185647][_0x4633('0x72')],'originated:\x20',JSON[_0x4633('0x5a')](_0x102b01[_0x4633('0x14')][_0x102b01[_0x4633('0x71')][_0x185647][_0x4633('0x72')]][_0x4633('0x51')]),_0x4633('0x73'),JSON['stringify'](_0x102b01['campaignsPreview'][_0x102b01['actions'][_0x185647][_0x4633('0x72')]][_0x4633('0x29')]),JSON[_0x4633('0x5a')](_0x102b01['actions'][_0x185647][_0x4633('0x74')]),JSON[_0x4633('0x5a')](_['pick'](_0x102b01[_0x4633('0x71')][_0x185647],[_0x4633('0x75'),_0x4633('0x76'),'VoiceQueueId','ListId'])));return ami[_0x4633('0x77')]({'action':_0x4633('0x78'),'channel':_0x102b01[_0x4633('0x71')][_0x185647][_0x4633('0x79')]})[_0x4633('0x7a')](function(_0x58be1d){if(_0x58be1d[_0x4633('0x50')]===_0x4633('0x7b')){setTimeout(function(){if(_0x102b01[_0x4633('0x71')][_0x185647]){ut[_0x4633('0x7c')](_0x102b01[_0x4633('0x14')][_0x102b01[_0x4633('0x71')][_0x185647]['queue']],_0x4633('0x7d'));if(_0x102b01['actions'][_0x185647]['dialAnswer']===!![]){ut['decrementTalkink'](_0x102b01[_0x4633('0x14')][_0x102b01[_0x4633('0x71')][_0x185647][_0x4633('0x72')]],_0x4633('0x7d'));ut['loggerError'](_0x4633('0x7e')+_0x185647,_0x102b01['actions'][_0x185647][_0x4633('0x72')]);}ut[_0x4633('0x7f')](_0x4633('0x80')+_0x185647,_0x102b01[_0x4633('0x71')][_0x185647][_0x4633('0x72')]);delete _0x102b01[_0x4633('0x71')][_0x185647];}},0x2328);}});}});};Preview[_0x4633('0x68')][_0x4633('0x6a')]=function(){var _0x5b84d2=this;loggerAction[_0x4633('0x81')]('[action]',_[_0x4633('0x82')](this[_0x4633('0x71')]));for(var _0x4b23a1 in this[_0x4633('0x71')]){if(_0x5b84d2[_0x4633('0x71')][_0x4633('0x6b')](_0x4b23a1)){_0x5b84d2[_0x4633('0x6f')](_0x4b23a1);}}};Preview[_0x4633('0x68')][_0x4633('0x6e')]=function(_0x1e4c32){var _0x27608f=this;rpcDb[_0x4633('0x83')](_0x1e4c32['id'],ut[_0x4633('0x84')](this['agents']))[_0x4633('0x85')](function(_0x82beee){if(!_[_0x4633('0x86')](_0x82beee)){for(var _0x2bee59=0x0;_0x2bee59<_0x82beee[_0x4633('0x87')];_0x2bee59+=0x1){if(ut[_0x4633('0x88')](_0x82beee[_0x2bee59][_0x4633('0x89')])<_0x1e4c32[_0x4633('0x8a')]*0x3c){if(_0x82beee[_0x2bee59][_0x4633('0x8b')]&&!_0x82beee[_0x2bee59][_0x4633('0x8b')][_0x4633('0x8c')]){_0x27608f['run'](_0x82beee[_0x2bee59]['id'])['then'](ut[_0x4633('0x8d')]('[RecallMe]'))[_0x4633('0x7a')](ut[_0x4633('0x8d')]('[RecallMe]'));}else{rpcDb[_0x4633('0x8e')](_0x82beee[_0x2bee59]['id']);}}else{var _0x344536=new Action(_0x82beee[_0x2bee59],_0x1e4c32);_0x344536[_0x4633('0x8f')]=moment()[_0x4633('0x5b')](_0x4633('0x90'));_0x1e4c32['outboundReCallsDay']+=0x1;ut[_0x4633('0x91')](_0x344536,0x17,_0x4633('0x92'));if(_0x1e4c32[_0x4633('0x93')]){rpcDb[_0x4633('0x94')](ut[_0x4633('0x95')](_0x82beee[_0x2bee59]));rpcDb['createCustomerHistory'](_0x344536,_0x4633('0x96'));}else{ut[_0x4633('0x91')](_0x344536,0x16,_0x4633('0x97'));rpcDb['createCustomerHistory'](_0x344536,_0x4633('0x98'));rpcDb[_0x4633('0x99')](_0x344536,_0x4633('0x98'));}}}}})[_0x4633('0x7a')](ut[_0x4633('0x8d')](_0x4633('0x9a')));};Preview[_0x4633('0x68')][_0x4633('0x6c')]=function(_0x40fa6a){_0x40fa6a[_0x4633('0x60')]=!![];if(ut[_0x4633('0x9b')](_0x40fa6a['loggedIn'])){_0x40fa6a['message']=_0x4633('0x9c');}else if(!ut[_0x4633('0x9d')](_0x40fa6a[_0x4633('0x32')])){_0x40fa6a['message']='NOT_ACTIVE';}else if(!this[_0x4633('0x9e')](_0x40fa6a[_0x4633('0x55')])){if(!this[_0x4633('0x9e')](_0x40fa6a['TrunkBackup'])){_0x40fa6a[_0x4633('0x50')]=_0x4633('0x9f');}else{_0x40fa6a[_0x4633('0x50')]='ACTIVE';}}else{_0x40fa6a['message']=_0x4633('0xa0');}emitCampaignPreview(_0x40fa6a);};Preview['prototype'][_0x4633('0xa1')]=function(_0x89146e,_0x4bcb5c,_0x158078){var _0x47108f=this;var _0x6302e6=this[_0x4633('0x71')][_0x4bcb5c];var _0x4f338c=this[_0x4633('0x14')][_0x6302e6[_0x4633('0x72')]];var _0x2fb553;var _0x36b0c2=![];var _0x2ea1a5=0x2;var _0x1677f9=0x3;if(_0x4f338c){switch(_0x158078){case'1':_0x4f338c[_0x4633('0x40')]+=0x1;_0x6302e6['countnosuchnumberretry']+=0x1;_0x6302e6[_0x4633('0xa2')]=ut[_0x4633('0xa3')](_0x6302e6);ut[_0x4633('0x91')](_0x6302e6,0x0,_0x4633('0xa4'));ami['emit']('custom:agentnosuchnumber',ut[_0x4633('0xa5')](_0x6302e6,'nosuchnumber'));rpcDb[_0x4633('0xa6')](_0x6302e6,'[callProgressDetectingCustomer][logNoSuch]');_0x47108f['verifyAdditionalPhones'](_0x6302e6,'0',_0x4f338c)[_0x4633('0x85')](function(_0x8e02c4){_0x36b0c2=_0x8e02c4['additional']==0x1;_0x2ea1a5=_0x4f338c[_0x4633('0xa7')];_0x1677f9=_0x4f338c[_0x4633('0xa8')];if(!_0x36b0c2){if(ut[_0x4633('0xa3')](_0x6302e6)>=_0x4f338c[_0x4633('0xa9')]){_0x2fb553=ut[_0x4633('0xaa')](_0x6302e6,0xf,_0x4633('0xab'));rpcDb[_0x4633('0x99')](_0x2fb553,_0x4633('0xac'));}else{if(_0x6302e6['countnosuchnumberretry']>=_0x4f338c[_0x4633('0xad')]){rpcDb['createCustomerFinal'](_0x6302e6,_0x4633('0xac'));}else{rpcDb['rescheduleContact'](ut[_0x4633('0xae')](_0x6302e6,_0x4633('0xaf'),_0x4f338c[_0x4633('0xa7')]),_0x6302e6[_0x4633('0xb0')],_0x6302e6[_0x4633('0xb1')]);}}delete this[_0x4633('0x71')][_0x89146e['linkedid']];}else{_0x6302e6[_0x4633('0xaf')]++;logger[_0x4633('0x81')](_0x4633('0xb2'),_0x6302e6['countnosuchnumberretry']);logger[_0x4633('0x81')]('id',_0x6302e6[_0x4633('0xb3')]);_0x47108f[_0x4633('0xb4')]({'id':_0x6302e6[_0x4633('0xb3')],'field':{'countnosuchnumberretry':_0x6302e6[_0x4633('0xaf')]}})[_0x4633('0x85')](function(){_0x47108f['swapAdditionalPhones'](_0x6302e6,_0x2ea1a5,_0x1677f9)['then'](function(){});});}});break;case _0x4633('0xb5'):var _0x539a19=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x6302e6['responsetime']=_0x539a19;_0x6302e6[_0x4633('0xb6')]=_0x539a19;_0x6302e6[_0x4633('0x74')]=!![];_0x4f338c[_0x4633('0x29')]+=0x1;logger[_0x4633('0x81')](_0x4633('0xb7'),_0x6302e6['uniqueid'],_0x4633('0xb8'),_0x4f338c[_0x4633('0x56')],_0x4633('0x73'),_0x4f338c[_0x4633('0x29')]);ami[_0x4633('0x23')](_0x4633('0xb9'),ut['buildObj'](_0x6302e6,_0x4633('0xba'),this['campaignsPreview'][_0x6302e6[_0x4633('0x72')]]));if(_0x4f338c[_0x4633('0xbb')]){ami['emit'](_0x4633('0xbc'),ut[_0x4633('0xbd')](_0x6302e6));}break;case'16':ami['emit'](_0x4633('0xbe'),ut[_0x4633('0xa5')](_0x6302e6,_0x4633('0xbf'),this['campaignsPreview'][_0x6302e6['queue']]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x6302e6,_0x4633('0xbf')));_0x4f338c['outboundAnswerCallsDay']+=0x1;_0x4f338c[_0x4633('0x2d')]+=0x1;_0x4f338c['answered']+=0x1;ut[_0x4633('0xc0')](_0x4f338c,_0x4633('0xc1'));_0x6302e6[_0x4633('0xa2')]=ut[_0x4633('0xa3')](_0x6302e6);ut[_0x4633('0x91')](_0x6302e6,0x4,_0x4633('0xc2'));rpcDb[_0x4633('0xa6')](_0x6302e6,_0x4633('0xc3'));rpcDb[_0x4633('0x99')](_0x6302e6,_0x4633('0xc4'));rpcDb[_0x4633('0xc5')](_0x6302e6);_0x4f338c['sumDuration']+=_0x6302e6[_0x4633('0xc6')];_0x4f338c[_0x4633('0x2a')]+=_0x6302e6[_0x4633('0xc6')];logger[_0x4633('0x81')](_0x4633('0xc7'),_0x6302e6[_0x4633('0xc8')],'\x20Queue',_0x4f338c[_0x4633('0x56')],_0x4633('0x73'),_0x4f338c[_0x4633('0x29')]);delete this[_0x4633('0x71')][_0x89146e[_0x4633('0xc9')]];break;case _0x4633('0xca'):_0x4f338c[_0x4633('0x3b')]+=0x1;_0x6302e6['countbusyretry']+=0x1;_0x6302e6['countglobal']=ut[_0x4633('0xa3')](_0x6302e6);ut['logCustomer'](_0x6302e6,0x5,'Busy');_0x2ea1a5=_0x4f338c[_0x4633('0xcb')];_0x1677f9=_0x4f338c['callAdditionalPhoneAfterMin'];ami['emit'](_0x4633('0xcc'),ut[_0x4633('0xa5')](_0x6302e6,_0x4633('0xcd')));rpcDb[_0x4633('0xa6')](_0x6302e6,_0x4633('0xce'));_0x47108f[_0x4633('0xcf')](_0x6302e6,'5',_0x4f338c)['then'](function(_0xc9ad19){_0x36b0c2=_0xc9ad19[_0x4633('0xd0')]==0x1;if(!_0x36b0c2){if(ut['totalGlobal'](_0x6302e6)>=_0x4f338c[_0x4633('0xa9')]){_0x2fb553=ut[_0x4633('0xaa')](_0x6302e6,0xf,_0x4633('0xab'));rpcDb[_0x4633('0x99')](_0x2fb553,_0x4633('0xd1'));}else{if(_0x6302e6[_0x4633('0xd2')]>=_0x4f338c[_0x4633('0xd3')]){rpcDb['createCustomerFinal'](_0x6302e6,_0x4633('0xce'));}else{rpcDb[_0x4633('0xd4')](ut['scheduledAt'](_0x6302e6,_0x4633('0xd2'),_0x4f338c[_0x4633('0xcb')]),_0x6302e6[_0x4633('0xb0')],_0x6302e6[_0x4633('0xb1')]);}}}else{_0x6302e6['countbusyretry']++;_0x47108f[_0x4633('0xb4')]({'id':_0x6302e6[_0x4633('0xb3')],'field':{'countbusyretry':_0x6302e6[_0x4633('0xd2')]}})[_0x4633('0x85')](function(){_0x47108f[_0x4633('0xd5')](_0x6302e6,_0x2ea1a5,_0x1677f9)[_0x4633('0x85')](function(){});});}});break;case _0x4633('0xd6'):_0x4f338c['outboundNoAnswerCallsDay']+=0x1;_0x6302e6[_0x4633('0xd7')]+=0x1;_0x6302e6[_0x4633('0xa2')]=ut[_0x4633('0xa3')](_0x6302e6);ut[_0x4633('0x91')](_0x6302e6,0x3,_0x4633('0xd8'));_0x2ea1a5=_0x4f338c[_0x4633('0xd9')];_0x1677f9=_0x4f338c[_0x4633('0xa8')];ami[_0x4633('0x23')]('custom:agentnoanswer',ut['buildObj'](_0x6302e6,_0x4633('0xda')));rpcDb[_0x4633('0xa6')](_0x6302e6,'[callProgressDetectingCustomer][logNoAnswer]');_0x47108f[_0x4633('0xcf')](_0x6302e6,'3',_0x4f338c)[_0x4633('0x85')](function(_0x24d05c){_0x36b0c2=_0x24d05c[_0x4633('0xd0')]==0x1;if(!_0x36b0c2){if(ut[_0x4633('0xa3')](_0x6302e6)>=_0x4f338c[_0x4633('0xa9')]){_0x2fb553=ut[_0x4633('0xaa')](_0x6302e6,0xf,_0x4633('0xab'));rpcDb[_0x4633('0x99')](_0x2fb553,_0x4633('0xdb'));}else{if(_0x6302e6[_0x4633('0xd7')]>=_0x4f338c[_0x4633('0xdc')]){rpcDb['createCustomerFinal'](_0x6302e6,_0x4633('0xdd'));}else{rpcDb['rescheduleContact'](ut[_0x4633('0xae')](_0x6302e6,_0x4633('0xd7'),_0x4f338c[_0x4633('0xd9')]),_0x6302e6[_0x4633('0xb0')],_0x6302e6[_0x4633('0xb1')]);}}}else{_0x6302e6[_0x4633('0xd7')]++;_0x47108f[_0x4633('0xb4')]({'id':_0x6302e6['idContact'],'field':{'countnoanswerretry':_0x6302e6[_0x4633('0xd7')]}})[_0x4633('0x85')](function(){_0x47108f['swapAdditionalPhones'](_0x6302e6,_0x2ea1a5,_0x1677f9)[_0x4633('0x85')](function(){});});}});break;case _0x4633('0xde'):_0x4f338c[_0x4633('0x3c')]+=0x1;_0x6302e6[_0x4633('0xdf')]+=0x1;_0x6302e6[_0x4633('0xa2')]=ut[_0x4633('0xa3')](_0x6302e6);ut['logCustomer'](_0x6302e6,0x8,_0x4633('0xe0'));_0x2ea1a5=_0x4f338c['dialCongestionRetryFrequency'];_0x1677f9=_0x4f338c['callAdditionalPhoneAfterMin'];ami[_0x4633('0x23')](_0x4633('0xe1'),ut[_0x4633('0xa5')](_0x6302e6,_0x4633('0xe2')));rpcDb[_0x4633('0xa6')](_0x6302e6,_0x4633('0xe3'));_0x47108f[_0x4633('0xcf')](_0x6302e6,'8',_0x4f338c)[_0x4633('0x85')](function(_0x1a1de7){_0x36b0c2=_0x1a1de7[_0x4633('0xd0')]==0x1;if(!_0x36b0c2){if(ut['totalGlobal'](_0x6302e6)>=_0x4f338c[_0x4633('0xa9')]){_0x2fb553=ut['cloneAction'](_0x6302e6,0xf,_0x4633('0xab'));rpcDb[_0x4633('0x99')](_0x2fb553,_0x4633('0xe4'));}else{if(_0x6302e6['countcongestionretry']>=_0x4f338c[_0x4633('0xe5')]){rpcDb[_0x4633('0x99')](_0x6302e6,_0x4633('0xe3'));}else{rpcDb[_0x4633('0xd4')](ut[_0x4633('0xae')](_0x6302e6,_0x4633('0xdf'),_0x4f338c['dialBusyRetryFrequency']),_0x6302e6[_0x4633('0xb0')],_0x6302e6[_0x4633('0xb1')]);}}}else{_0x6302e6[_0x4633('0xdf')]++;_0x47108f['incrementPreviewCounters']({'id':_0x6302e6['idContact'],'field':{'countcongestionretry':_0x6302e6[_0x4633('0xdf')]}})[_0x4633('0x85')](function(){_0x47108f['swapAdditionalPhones'](_0x6302e6,_0x2ea1a5,_0x1677f9)['then'](function(){});});}});break;case _0x4633('0xe6'):_0x4f338c[_0x4633('0xe7')]+=0x1;_0x6302e6[_0x4633('0xe8')]+=0x1;_0x6302e6[_0x4633('0xa2')]=ut['totalGlobal'](_0x6302e6);ut[_0x4633('0x91')](_0x6302e6,0x14,_0x4633('0xe9'));_0x2ea1a5=_0x4f338c[_0x4633('0xea')];_0x1677f9=_0x4f338c['callAdditionalPhoneAfterMin'];ami[_0x4633('0x23')](_0x4633('0xeb'),ut['buildObj'](_0x6302e6,_0x4633('0xec')));rpcDb[_0x4633('0xa6')](_0x6302e6,_0x4633('0xed'));_0x47108f[_0x4633('0xcf')](_0x6302e6,'20',_0x4f338c)[_0x4633('0x85')](function(_0x3aec01){_0x36b0c2=_0x3aec01[_0x4633('0xd0')]==0x1;if(!_0x36b0c2){if(ut[_0x4633('0xa3')](_0x6302e6)>=_0x4f338c[_0x4633('0xa9')]){_0x2fb553=ut[_0x4633('0xaa')](_0x6302e6,0x14,_0x4633('0xe9'));rpcDb[_0x4633('0x99')](_0x2fb553,_0x4633('0xee'));}else{if(_0x6302e6[_0x4633('0xe8')]>=_0x4f338c[_0x4633('0xef')]){rpcDb['createCustomerFinal'](_0x6302e6,_0x4633('0xee'));}else{rpcDb[_0x4633('0xd4')](ut[_0x4633('0xae')](_0x6302e6,_0x4633('0xe8'),_0x4f338c[_0x4633('0xea')]),_0x6302e6[_0x4633('0xb0')],_0x6302e6['activeContact']);}}}else{_0x6302e6['countnoanswerretry']++;_0x47108f[_0x4633('0xb4')]({'id':_0x6302e6[_0x4633('0xb3')],'field':{'countnoanswerretry':_0x6302e6['countnoanswerretry']}})['then'](function(){_0x47108f['swapAdditionalPhones'](_0x6302e6,_0x2ea1a5,_0x1677f9)[_0x4633('0x85')](function(){});});}});break;case _0x4633('0xf0'):_0x4f338c['outboundAbandonedCallsDay']+=0x1;_0x6302e6[_0x4633('0xf1')]+=0x1;_0x6302e6[_0x4633('0xa2')]=ut['totalGlobal'](_0x6302e6);ut[_0x4633('0x91')](_0x6302e6,0xb,_0x4633('0xf2'));rpcDb['createCustomerHistory'](_0x6302e6,'[callProgressDetectingCustomer][logAbandoned]');_0x47108f[_0x4633('0xcf')](_0x6302e6,'11',_0x4f338c)[_0x4633('0x85')](function(_0x520c3c){_0x36b0c2=_0x520c3c[_0x4633('0xd0')]==0x1;if(!_0x36b0c2){if(ut[_0x4633('0xa3')](_0x6302e6)>=_0x4f338c[_0x4633('0xa9')]){_0x2fb553=ut['cloneAction'](_0x6302e6,0xf,'Global');rpcDb['createCustomerFinal'](_0x2fb553,_0x4633('0xf3'));}else{if(_0x6302e6[_0x4633('0xf4')]>=_0x4f338c[_0x4633('0xf5')]){rpcDb[_0x4633('0x99')](_0x6302e6,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x6302e6,'countabandonedretry',_0x4f338c[_0x4633('0xf6')]),_0x6302e6['unlockAgent'],_0x6302e6[_0x4633('0xb1')]);}}}else{_0x6302e6[_0x4633('0xd7')]++;_0x47108f[_0x4633('0xb4')]({'id':_0x6302e6['idContact'],'field':{'countnoanswerretry':_0x6302e6[_0x4633('0xd7')]}})[_0x4633('0x85')](function(){_0x47108f[_0x4633('0xd5')](_0x6302e6,_0x2ea1a5,_0x1677f9)[_0x4633('0x85')](function(){});});}});break;case'18':_0x4f338c['outboundUnknownCallsDay']+=0x1;_0x6302e6[_0x4633('0xf7')]+=0x1;_0x6302e6['countglobal']=ut[_0x4633('0xa3')](_0x6302e6);ut[_0x4633('0x91')](_0x6302e6,0x12,_0x89146e[_0x4633('0xf8')]||_0x89146e['dialstatus']);ami['emit'](_0x4633('0xf9'),ut[_0x4633('0xa5')](_0x6302e6,_0x4633('0xfa')));rpcDb['createCustomerHistory'](_0x6302e6,'[callProgressDetectingCustomer][hangupInAMD]');_0x47108f[_0x4633('0xcf')](_0x6302e6,'18',_0x4f338c)[_0x4633('0x85')](function(_0x297ff9){_0x36b0c2=_0x297ff9[_0x4633('0xd0')]==0x1;if(!_0x36b0c2){if(ut[_0x4633('0xa3')](_0x6302e6)>=_0x4f338c['dialGlobalMaxRetry']){_0x2fb553=ut[_0x4633('0xaa')](_0x6302e6,0x12,'Global');rpcDb[_0x4633('0x99')](_0x2fb553,_0x4633('0xfb'));}else{rpcDb['createCustomerFinal'](_0x6302e6,'[callProgressDetectingCustomer][hangupInAMD]');}}else{_0x6302e6[_0x4633('0xd7')]++;_0x47108f[_0x4633('0xb4')]({'id':_0x6302e6['idContact'],'field':{'countnoanswerretry':_0x6302e6[_0x4633('0xd7')]}})['then'](function(){_0x47108f['swapAdditionalPhones'](_0x6302e6,_0x2ea1a5,_0x1677f9)['then'](function(){});});}});delete this[_0x4633('0x71')][_0x89146e[_0x4633('0xc9')]];break;case'19':_0x4f338c[_0x4633('0x43')]+=0x1;_0x6302e6[_0x4633('0xa2')]=ut[_0x4633('0xa3')](_0x6302e6);ut['logCustomer'](_0x6302e6,0x13,_0x89146e[_0x4633('0xf8')]||_0x89146e[_0x4633('0xfc')]);ami[_0x4633('0x23')](_0x4633('0xf9'),ut[_0x4633('0xa5')](_0x6302e6,'amd'));rpcDb['createCustomerHistory'](_0x6302e6,'[callProgressDetectingCustomer][machine]');_0x47108f[_0x4633('0xcf')](_0x6302e6,'18',_0x4f338c)['then'](function(_0x7357e1){_0x36b0c2=_0x7357e1[_0x4633('0xd0')]==0x1;if(!_0x36b0c2){if(ut[_0x4633('0xa3')](_0x6302e6)>=_0x4f338c['dialGlobalMaxRetry']){_0x2fb553=ut[_0x4633('0xaa')](_0x6302e6,0xf,_0x4633('0xab'));rpcDb[_0x4633('0x99')](_0x2fb553,_0x4633('0xfd'));}else{rpcDb['createCustomerFinal'](_0x6302e6,_0x4633('0xfd'));}}else{_0x6302e6['countnoanswerretry']++;_0x47108f['incrementPreviewCounters']({'id':_0x6302e6[_0x4633('0xb3')],'field':{'countnoanswerretry':_0x6302e6['countnoanswerretry']}})[_0x4633('0x85')](function(){_0x47108f['swapAdditionalPhones'](_0x6302e6,_0x2ea1a5,_0x1677f9)['then'](function(){});});}});delete this['actions'][_0x89146e[_0x4633('0xc9')]];break;default:if(_0x6302e6[_0x4633('0x74')]){ut[_0x4633('0xc0')](_0x4f338c,_0x4633('0xfe'));ut[_0x4633('0x7f')](_0x4633('0xff')+_0x4f338c[_0x4633('0x56')],_0x89146e);}_0x4f338c[_0x4633('0x43')]+=0x1;_0x6302e6[_0x4633('0xa2')]=ut[_0x4633('0xa3')](_0x6302e6);ut[_0x4633('0x91')](_0x6302e6,0xc,_0x89146e[_0x4633('0xf8')]||_0x89146e['dialstatus']);_0x2ea1a5=_0x4f338c[_0x4633('0xea')];_0x1677f9=_0x4f338c[_0x4633('0xa8')];rpcDb[_0x4633('0xa6')](_0x6302e6,_0x4633('0x100'));_0x47108f[_0x4633('0xcf')](_0x6302e6,'20',_0x4f338c)[_0x4633('0x85')](function(_0x28cf4a){_0x36b0c2=_0x28cf4a['additional']==0x1;if(!_0x36b0c2){if(ut[_0x4633('0xa3')](_0x6302e6)>=_0x4f338c['dialGlobalMaxRetry']){_0x2fb553=ut[_0x4633('0xaa')](_0x6302e6,0xf,_0x4633('0xab'));rpcDb[_0x4633('0x99')](_0x2fb553,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb['createCustomerFinal'](_0x6302e6,_0x4633('0x101'));}delete this['actions'][_0x89146e['linkedid']];}else{_0x47108f[_0x4633('0xd5')](_0x6302e6,_0x2ea1a5,_0x1677f9)['then'](function(_0x52a1a5){});}});}if(!(_0x6302e6[_0x4633('0x74')]&&_0x158078==='16')){ut[_0x4633('0x7c')](_0x4f338c,_0x4633('0x102'));logger[_0x4633('0x81')](_0x4633('0x103'),_0x6302e6[_0x4633('0xc8')],'\x20Queue',_0x4f338c[_0x4633('0x56')],_0x4633('0x104'),_0x4f338c[_0x4633('0x51')]);}if(_0x158078!==_0x4633('0xb5')){delete this['actions'][_0x89146e[_0x4633('0xc9')]];delete this[_0x4633('0x71')][_0x89146e['destlinkedid']];}}};Preview[_0x4633('0x68')][_0x4633('0x105')]=function(_0x57add0,_0x4d337,_0x3f7605){if(_[_0x4633('0x106')](_0x4d337)&&'object'!==typeof _0x4d337){return;}if(_[_0x4633('0x106')](_0x3f7605)&&'object'!==typeof _0x3f7605){return;}switch(_0x3f7605[_0x4633('0x107')]){case'0':ut[_0x4633('0x108')](_0x57add0,0x0,_0x4633('0xa4'));rpcDb[_0x4633('0x109')](_0x57add0,_0x4633('0x10a'));break;case'3':ut['logAgent'](_0x57add0,0x3,'NoAnswer');rpcDb[_0x4633('0x109')](_0x57add0,_0x4633('0x10b'));break;case'5':ut[_0x4633('0x108')](_0x57add0,0x5,_0x4633('0x10c'));rpcDb[_0x4633('0x109')](_0x57add0,_0x4633('0x10d'));break;case'8':ut[_0x4633('0x108')](_0x57add0,0x8,'Congestion');rpcDb[_0x4633('0x109')](_0x57add0,_0x4633('0x10e'));break;case'22':ut[_0x4633('0x108')](_0x57add0,0x16,'AnswerAGI');rpcDb[_0x4633('0x109')](_0x57add0,_0x4633('0x10f'));break;default:ut['logAgent'](_0x57add0,0xc,_0x3f7605[_0x4633('0x107')]);rpcDb[_0x4633('0x109')](_0x57add0,_0x4633('0x10e'));}ut['updateOriginated'](_0x4d337,_0x4633('0x110'));logger[_0x4633('0x81')](_0x4633('0x111'),_0x57add0['uniqueid'],_0x4633('0xb8'),_0x4d337['name'],_0x4633('0x104'),_0x4d337['originated']);delete this[_0x4633('0x71')][_0x57add0[_0x4633('0xc8')]];};Preview['prototype']['verifyAdditionalPhones']=function(_0x1abe6d,_0x41ab0e,_0xd89306){return BPromise[_0x4633('0x112')]()[_0x4633('0x85')](cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x1abe6d,_0x41ab0e,_0xd89306))['catch'](logger[_0x4633('0x81')]('[verifyAdditionalPhone]\x20'));};Preview[_0x4633('0x68')]['swapAdditionalPhones']=function(_0x555dfc,_0x9e24fe,_0x5e34b8){return BPromise[_0x4633('0x112')]()[_0x4633('0x85')](cmHopperAdditionalPhone[_0x4633('0xd5')](_0x555dfc,_0x9e24fe,_0x5e34b8))['catch'](logger[_0x4633('0x81')](_0x4633('0x113')));};Preview['prototype'][_0x4633('0xb4')]=function(_0x3fe347){return BPromise[_0x4633('0x112')]()[_0x4633('0x85')](cmHopperAdditionalPhone['incrementPreviewCounters'](_0x3fe347))[_0x4633('0x7a')](logger['info']('[incrementPreviewCounters]\x20'));};Preview['prototype'][_0x4633('0x114')]=function(_0x389a0c,_0x1317ae,_0x2fb79f,_0x53d2d8,_0x478538){var _0x1303c4=this;return new BPromise(function(_0xfab118,_0x8907f8){if(_[_0x4633('0x86')](_0x1317ae)||_['isNil'](_0x1317ae[_0x4633('0x115')])||_[_0x4633('0x86')](_0x1317ae['phone'])||_[_0x4633('0x86')](_0x1317ae[_0x4633('0x116')])){_0x8907f8(ut[_0x4633('0x50')](_0x4633('0x117'),_0x53d2d8,_0x478538));return;}var _0xb80547=uuid['v4']();var _0x584adc=_0x1303c4[_0x4633('0x14')][_0x1317ae['Queue'][_0x4633('0x56')]];var _0x2cf5a3=_0x2fb79f?_0x1303c4[_0x4633('0x17')][_0x2fb79f]['id']:undefined;_0x1303c4['actions'][_0xb80547]=new Action(_0x1317ae,_0x584adc,_0xb80547,_0x2fb79f,_0x2cf5a3);var _0x2857c7=_0x1303c4[_0x4633('0x71')][_0xb80547];_0x2857c7[_0x4633('0xb0')]=_0x53d2d8;_0x2857c7[_0x4633('0xb1')]=_0x478538;_0x2857c7[_0x4633('0x118')]=_0x2fb79f;if(_['isEmpty'](_0x389a0c)){_0x1303c4[_0x4633('0x119')](_0x2857c7,_0x584adc,_0x1317ae,_0x2fb79f)['then'](function(_0x14ad3f){logger[_0x4633('0x81')](_0x4633('0x11a'),_0x4633('0x11b')+_0x2857c7[_0x4633('0x72')]+_0x4633('0x11c')+_0x2857c7[_0x4633('0xb3')],JSON[_0x4633('0x5a')](_0x14ad3f));ami[_0x4633('0x23')](_0x4633('0x11d'),ut[_0x4633('0xa5')](_0x2857c7,'called',_0x1303c4['campaignsPreview'][_0x2857c7[_0x4633('0x72')]]));_0xfab118(ut[_0x4633('0x50')](_0x4633('0x11e')));})['catch'](function(_0x1302a5){ut[_0x4633('0x63')](_0x4633('0x11f'),_0x1302a5);_0x8907f8(ut['message']('Call\x20failed',_0x53d2d8,_0x478538));});}else{_0x584adc[_0x4633('0x3a')]+=0x1;ut[_0x4633('0x120')](_0x2857c7);rpcDb['createHistory'](_0x2857c7,_0x4633('0x121'));delete _0x1303c4['actions'][_0xb80547];_0x8907f8(ut[_0x4633('0x50')](_0x4633('0x122'),_0x53d2d8,_0x478538));}});};Preview['prototype'][_0x4633('0x9e')]=function(_0x3af592){return!_[_0x4633('0x86')](_0x3af592)&&!_[_0x4633('0x86')](_0x3af592[_0x4633('0x56')])&&!_[_0x4633('0x86')](_0x3af592[_0x4633('0x57')])&&_0x3af592[_0x4633('0x57')]&&!_[_0x4633('0x86')](this[_0x4633('0x16')][util['format'](_0x4633('0x123'),_0x3af592[_0x4633('0x56')])])&&!_[_0x4633('0x86')](this[_0x4633('0x16')][util[_0x4633('0x5b')]('SIP/%s',_0x3af592[_0x4633('0x56')])][_0x4633('0x78')])&&(this[_0x4633('0x16')][util[_0x4633('0x5b')](_0x4633('0x123'),_0x3af592[_0x4633('0x56')])]['status']==='reachable'||this[_0x4633('0x16')][util[_0x4633('0x5b')](_0x4633('0x123'),_0x3af592['name'])][_0x4633('0x78')]==='unmonitored');};Preview[_0x4633('0x68')][_0x4633('0x124')]=function(_0x1725b6,_0x2027d7){var _0x2a500e=this;return new BPromise(function(_0x47c767,_0x116a6b){_0x2a500e[_0x4633('0x125')](_0x1725b6,_0x2027d7)['then'](function(_0x1a4bdb){_0x47c767(_['pick'](_0x1a4bdb,['message']));})[_0x4633('0x7a')](function(_0x27c777){if(_0x27c777[_0x4633('0x126')]){rpcDb[_0x4633('0x127')](_0x1725b6);}if(_0x27c777['active']){rpcDb[_0x4633('0x8e')](_0x1725b6);}_0x116a6b(_['pick'](_0x27c777,[_0x4633('0x50')]));});});};Preview['prototype'][_0x4633('0x125')]=function(_0x149aae,_0x56f8ee){var _0x2c25fe=this;return new BPromise(function(_0x4126bb,_0x41605c){var _0x46f774,_0x98428d;rpcDb[_0x4633('0x128')](_0x149aae)[_0x4633('0x85')](function(_0x89eebd){if(!_['isNil'](_0x89eebd[0x0])){_0x98428d=_0x89eebd[0x0]['recallme']?![]:!![];_0x46f774=_0x89eebd[0x0][_0x4633('0x129')]?!![]:![];_0x46f774=_0x56f8ee?!![]:_0x46f774;}var _0x4a7f71=_0x2c25fe[_0x4633('0x12a')](_0x89eebd);if(_0x4a7f71['isValid']){rpcDb[_0x4633('0x12b')](_[_0x4633('0x12c')](_0x89eebd[0x0],[_0x4633('0x116'),_0x4633('0x12d')]))[_0x4633('0x85')](function(_0x5e1423){_0x2c25fe[_0x4633('0x114')](_0x5e1423,_0x89eebd[0x0],_0x56f8ee,_0x98428d,_0x46f774)[_0x4633('0x85')](function(_0x3a88a3){_0x4126bb(_0x3a88a3);})['catch'](function(_0x1dec09){_0x41605c(_0x1dec09);});})[_0x4633('0x7a')](function(_0x1c6348){ut[_0x4633('0x63')](_0x4633('0x12e'),_0x1c6348);_0x41605c(ut['message']('Call\x20unsuccessful',_0x98428d,_0x46f774));});}else{_0x41605c(ut[_0x4633('0x50')](_0x4a7f71[_0x4633('0x50')],_0x98428d,_0x46f774));}})['catch'](function(_0x13e25d){ut[_0x4633('0x63')](_0x4633('0x12f'),_0x13e25d);_0x41605c(ut[_0x4633('0x50')]('Call\x20unsuccessful',![],!![]));});});};Preview[_0x4633('0x68')][_0x4633('0x12a')]=function(_0x190bc3){if(_['isNil'](_0x190bc3)||_[_0x4633('0x130')](_0x190bc3)||!_['isNil'](_0x190bc3[0x0][_0x4633('0x8b')])&&_['isNil'](_0x190bc3[0x0]['Agent']['name'])){ut[_0x4633('0x63')](_0x4633('0x131'),_0x190bc3);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x166e32=this['campaignsPreview'][_0x190bc3[0x0][_0x4633('0x132')][_0x4633('0x56')]];_0x166e32['message']=_0x4633('0xa0');if(_[_0x4633('0x86')](_0x166e32)){ut[_0x4633('0x63')]('[Preview][validateContact][Empty\x20Campaign]',_0x166e32);return{'isValid':![],'message':_0x4633('0x133')};}if(!this[_0x4633('0x9e')](_0x166e32[_0x4633('0x55')])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4633('0x134')+_0x166e32['name']+_0x4633('0x135'));if(!this[_0x4633('0x9e')](_0x166e32[_0x4633('0x136')])){ut[_0x4633('0x63')](_0x4633('0x137'),_0x166e32[_0x4633('0x56')]+_0x4633('0x138'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut['isActive'](_0x166e32[_0x4633('0x32')])){ut[_0x4633('0x63')]('[Preview][validateContact][Campaign\x20Active]',_0x166e32['name']+_0x4633('0x139'));return{'isValid':![],'message':_0x4633('0x134')+_0x166e32[_0x4633('0x56')]+_0x4633('0x139')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x4633('0x68')][_0x4633('0x119')]=function(_0x33671d,_0x5cfbc5,_0x73f8d5,_0x11a45d){var _0x17b29c=this;return new BPromise(function(_0x1258f4,_0x609fd3){var _0x812def=_0x33671d['uniqueid'];var _0x216737=_0x17b29c[_0x4633('0x9e')](_0x5cfbc5['Trunk'])?util['format'](_0x4633('0x13a'),_0x5cfbc5[_0x4633('0x55')]['name'],_[_0x4633('0x86')](_0x5cfbc5['dialPrefix'])?'':_0x5cfbc5[_0x4633('0x37')]['trim']()||'',_0x5cfbc5[_0x4633('0x13b')]>0x0?_0x73f8d5[_0x4633('0x12d')][_0x4633('0x13c')](_0x5cfbc5[_0x4633('0x13b')]):_0x73f8d5[_0x4633('0x12d')]):util[_0x4633('0x5b')]('SIP/%s/%s%s',_[_0x4633('0x86')](_0x5cfbc5['TrunkBackup'])?_0x5cfbc5[_0x4633('0x55')][_0x4633('0x56')]:_0x5cfbc5[_0x4633('0x136')]['name'],_[_0x4633('0x86')](_0x5cfbc5[_0x4633('0x37')])?'':_0x5cfbc5[_0x4633('0x37')][_0x4633('0x13d')]()||'',_0x5cfbc5[_0x4633('0x13b')]>0x0?_0x73f8d5[_0x4633('0x12d')][_0x4633('0x13c')](_0x5cfbc5[_0x4633('0x13b')]):_0x73f8d5[_0x4633('0x12d')]);var _0x13411c=_0x17b29c[_0x4633('0x9e')](_0x5cfbc5[_0x4633('0x55')])?ut[_0x4633('0x13e')](_0x5cfbc5[_0x4633('0x55')][_0x4633('0x58')],_0x5cfbc5[_0x4633('0x34')],_0x5cfbc5[_0x4633('0x13f')]>0x0?ut[_0x4633('0x140')](_0x5cfbc5[_0x4633('0x35')],_0x5cfbc5[_0x4633('0x13f')]):_0x5cfbc5[_0x4633('0x35')]):ut[_0x4633('0x13e')](_[_0x4633('0x86')](_0x5cfbc5[_0x4633('0x136')])?_0x5cfbc5[_0x4633('0x55')]['callerid']:_0x5cfbc5[_0x4633('0x136')][_0x4633('0x58')],_0x5cfbc5[_0x4633('0x34')],_0x5cfbc5['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x4633('0x140')](_0x5cfbc5[_0x4633('0x35')],_0x5cfbc5[_0x4633('0x13f')]):_0x5cfbc5['dialOriginateCallerIdNumber']);if(_0x13411c){_0x33671d[_0x4633('0x141')]=ut[_0x4633('0x142')](_0x13411c);_0x33671d[_0x4633('0x143')]=ut[_0x4633('0x144')](_0x13411c);}var _0x23c305=ut[_0x4633('0x145')](_0x5cfbc5,_0x73f8d5,_0x216737,_0x13411c,_0x812def,_0x33671d);_['merge'](_0x33671d,ut[_0x4633('0x146')](_0x23c305));_0x33671d[_0x4633('0x8f')]=moment()[_0x4633('0x5b')](_0x4633('0x90'));ami[_0x4633('0x77')](ut[_0x4633('0x147')](_0x33671d,_0x5cfbc5,_0x23c305,_0x33671d[_0x4633('0xb1')],_0x11a45d))['then'](function(_0x4c1cbb){_0x5cfbc5[_0x4633('0x51')]+=0x1;logger['info']('[originated][increment]',_0x812def,_0x4633('0xb8'),_0x5cfbc5['name'],'originated:\x20',_0x5cfbc5[_0x4633('0x51')]);_0x1258f4(_0x4c1cbb);})[_0x4633('0x7a')](function(_0x2bef70){ut[_0x4633('0x108')](_0x33671d,0xe,_0x4633('0x148'));rpcDb[_0x4633('0x109')](_0x33671d,'[originateFailure][logOriginateFailure]');_0x609fd3(_0x2bef70);});});};Preview['prototype']['syncNewExten']=function(_0x1f48da){if(this[_0x4633('0x71')][_0x1f48da[_0x4633('0xc9')]]){this[_0x4633('0x71')][_0x1f48da[_0x4633('0xc9')]][_0x4633('0x79')]=_0x1f48da[_0x4633('0x79')];}};Preview[_0x4633('0x68')][_0x4633('0x149')]=function(_0x445b1a){var _0x4df426=this;var _0x4803ae=this['actions'][_0x445b1a[_0x4633('0x14a')]];if(_0x4803ae){if(_0x4803ae[_0x4633('0x118')]&&this[_0x4633('0x17')][_0x4803ae[_0x4633('0x118')]]){ut['logLookAgent'](_0x4803ae,this[_0x4633('0x17')][_0x4803ae[_0x4633('0x118')]][_0x4633('0x56')],this['agents'][_0x4803ae[_0x4633('0x118')]]['id']);}var _0x441b40=_[_0x4633('0x14b')](_0x4803ae);_0x441b40[_0x4633('0x14c')]=moment()[_0x4633('0x5b')](_0x4633('0x90'));var _0x4733bd=_0x4df426[_0x4633('0x14')][_0x4803ae[_0x4633('0x72')]];if(ut[_0x4633('0x14d')](_0x445b1a['response'])){if(_0x4803ae[_0x4633('0xb0')]){rpcDb[_0x4633('0x127')](_0x4803ae[_0x4633('0xb3')]);}if(_0x4803ae[_0x4633('0xb1')]){rpcDb['disableContact'](_0x4803ae[_0x4633('0xb3')]);}ami['emit']('custom:agentringnoanswer',ut[_0x4633('0xa5')](_0x4803ae,'rejected',this[_0x4633('0x14')][_0x4803ae[_0x4633('0x72')]]));this[_0x4633('0x105')](_0x441b40,_0x4733bd,_0x445b1a);}else{_0x4803ae['starttime']=moment()[_0x4633('0x5b')](_0x4633('0x90'));ut['logAgent'](_0x441b40,0x4,_0x4633('0xc2'));rpcDb[_0x4633('0x109')](_0x441b40,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x4633('0x68')][_0x4633('0x1a')]=function(_0x1cdd84){var _0x436252=this;var _0x2c4017=this[_0x4633('0x71')][_0x1cdd84[_0x4633('0xc9')]];var _0x173bda;if(_0x2c4017){_0x173bda=this[_0x4633('0x14')][_0x2c4017[_0x4633('0x72')]];logger['info'](_0x4633('0x14e'),_0x1cdd84['linkedid'],'\x20Queue',_0x173bda[_0x4633('0x56')],_0x4633('0x73'),_0x173bda[_0x4633('0x29')]);}if(this[_0x4633('0x71')][_0x1cdd84[_0x4633('0xc9')]]&&_0x1cdd84[_0x4633('0xc9')]!==_0x1cdd84['uniqueid']){if(_0x1cdd84[_0x4633('0x14f')]==='16'&&this['actions'][_0x1cdd84['linkedid']][_0x4633('0x74')]){this[_0x4633('0xa1')](_0x1cdd84,_0x1cdd84[_0x4633('0xc9')],_0x1cdd84[_0x4633('0x14f')]);}else if(this['actions'][_0x1cdd84[_0x4633('0xc9')]]['dialAnswer']){logger[_0x4633('0x81')]('[syncHangup][talking][cause]',_0x1cdd84[_0x4633('0xc9')],_0x1cdd84[_0x4633('0x14f')],_0x4633('0xb8'),_0x173bda['name'],'pTalking:\x20',_0x173bda['pTalking']);this[_0x4633('0xa1')](_0x1cdd84,_0x1cdd84[_0x4633('0xc9')],_0x1cdd84['cause']);}}else if(_0x2c4017&&_[_0x4633('0x86')](_0x2c4017[_0x4633('0x150')])&&_0x173bda[_0x4633('0x151')]&&_0x1cdd84[_0x4633('0xc9')]===_0x1cdd84[_0x4633('0xc8')]&&_['isNil'](_0x1cdd84['reason'])&&_0x1cdd84[_0x4633('0x14f')]==='16'&&_0x1cdd84['channelstate']==='6'&&_[_0x4633('0x106')](_0x2c4017['transfer'])){if(_0x2c4017[_0x4633('0xb0')]){rpcDb[_0x4633('0x127')](_0x2c4017[_0x4633('0xb3')]);}if(_0x2c4017[_0x4633('0xb1')]){rpcDb['disableContact'](_0x2c4017[_0x4633('0xb3')]);}_0x1cdd84[_0x4633('0x107')]='22';this['callProgressDetectingAgent'](_0x2c4017,_0x173bda,_0x1cdd84);}else if(_0x2c4017&&_0x2c4017['transfer']){if(_0x1cdd84[_0x4633('0x14f')]==='16'&&this['actions'][_0x1cdd84[_0x4633('0xc9')]][_0x4633('0x74')]){logger[_0x4633('0x81')]('[syncHangup][talking][transfer]',_0x1cdd84[_0x4633('0xc9')],_0x1cdd84[_0x4633('0x14f')],'\x20Queue',_0x173bda[_0x4633('0x56')],_0x4633('0x73'),_0x173bda[_0x4633('0x29')]);this[_0x4633('0xa1')](_0x1cdd84,_0x1cdd84[_0x4633('0xc9')],_0x1cdd84[_0x4633('0x14f')]);}else if(this['actions'][_0x1cdd84['linkedid']][_0x4633('0x74')]){logger['info'](_0x4633('0x152'),_0x1cdd84[_0x4633('0xc9')],_0x1cdd84[_0x4633('0x14f')],_0x4633('0xb8'),_0x173bda[_0x4633('0x56')],_0x4633('0x73'),_0x173bda[_0x4633('0x29')]);this['callProgressDetectingCustomer'](_0x1cdd84,_0x1cdd84['linkedid'],_0x1cdd84['cause']);}}};Preview[_0x4633('0x68')][_0x4633('0x1e')]=function(_0xf1f77a){if(this[_0x4633('0x71')][_0xf1f77a[_0x4633('0x153')]]&&_0xf1f77a['destlinkedid']!==_0xf1f77a[_0x4633('0x154')]){this[_0x4633('0xa1')](_0xf1f77a,_0xf1f77a[_0x4633('0x153')],_0xf1f77a[_0x4633('0xfc')]);}};Preview[_0x4633('0x68')][_0x4633('0x1c')]=function(_0xaf13c3){if(this['actions'][_0xaf13c3[_0x4633('0xc9')]]&&_0xaf13c3[_0x4633('0xc9')]!==_0xaf13c3[_0x4633('0xc8')]&&!this[_0x4633('0x71')][_0xaf13c3[_0x4633('0xc9')]][_0x4633('0x74')]){if(_0xaf13c3['cause']==='1'){this[_0x4633('0xa1')](_0xaf13c3,_0xaf13c3[_0x4633('0xc9')],_0xaf13c3[_0x4633('0x14f')]);}}};Preview['prototype'][_0x4633('0x155')]=function(_0x3cb77f,_0x118da7,_0x29310c){if(this[_0x4633('0x71')][_0x3cb77f]){if(_['isNil'](this[_0x4633('0x71')][_0x3cb77f]['variables'])){this[_0x4633('0x71')][_0x3cb77f][_0x4633('0x156')]={};}this[_0x4633('0x71')][_0x3cb77f][_0x4633('0x156')][_0x118da7]=_0x29310c;}};Preview[_0x4633('0x68')][_0x4633('0x21')]=function(_0x5abfe9){try{if(!_['isNil'](_0x5abfe9)){if(ut[_0x4633('0x157')](_['keys'](_0x5abfe9['variable'])[0x0])){this[_0x4633('0x155')](_0x5abfe9[_0x4633('0xc8')],_[_0x4633('0x158')](_0x5abfe9['variable'])[0x0],_0x5abfe9[_0x4633('0x159')]);}}}catch(_0x39ed50){logger[_0x4633('0x15a')](_0x4633('0x15b'),util[_0x4633('0x15c')](_0x39ed50,{'showHidden':![],'depth':null}));}};Preview[_0x4633('0x68')][_0x4633('0x22')]=function(_0x65521){if(_0x65521){if(this['actions'][_0x65521[_0x4633('0x15d')]]){this['actions'][_0x65521['transfertargetlinkedid']][_0x4633('0x15e')]=!![];}}};Preview[_0x4633('0x68')]['syncBlindTransfer']=function(_0x5a1665){if(_0x5a1665){if(this[_0x4633('0x71')][_0x5a1665[_0x4633('0x15f')]]){this[_0x4633('0x71')][_0x5a1665[_0x4633('0x15f')]][_0x4633('0x15e')]=!![];}}};module['exports']=Preview; \ No newline at end of file +var _0xcca7=['Contact\x20is\x20undefined','lookAgent','isEmpty','[Preview][execCall][success]','\x20IdHopper:\x20','custom:agentcalled','called','Call\x20failed','createHistory','[Blacklist][error]','SIP/%s','reachable','execRun','unlock','recallme','validateContact','isValid','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Agent','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','Queue','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','campaign\x20Name:\x20','Is\x20Valid','execCall','trim','dialCutDigit','substring','getCallerId','getCallerIdRandom','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','variablesAction','OriginateError','logLookAgent','clone','isFailure','response','unlockContact','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','cause','callProgressDetectingCustomer','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','destlinkedid','destuniqueid','syncHangupRequest','addVariable','variables','keys','variable','value','[syncVarSet][Preview]','inspect','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','uuid','ioredis','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','voiceQueues','trunks','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','newexten','syncNewExten','syncVarSet','blindtransfer','syncBlindTransfer','loopCampaigns','campaignsPreview','emit','type','outbound','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','Trunk','active','callerid','Interval','md5','format','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','voice:queue:%s','voice_queue_channel:remove','sendMessageOneNotActive','originated','paused','NOT_ACTIVE','logger','DEACTIVATED','syncCampaigns','hasOwnProperty','dialMethod','booked','clearZombieChannels','setMessage','recallMe','clearZombieChannel','isNil','actions','[clearZombieChannels][talking]','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','then','length','getDiff','scheduledat','dialRecallMeTimeout','voicePause','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','AGENTS_NOT_LOGGED','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','actioncountonusuch','idContact','incrementPreviewCounters','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','buildObj','connect','acw','custom:agentConnectPreview','custom:agentcomplete','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','\x20Queue','linkedid','outboundBusyCallsDay','countbusyretry','dialBusyRetryFrequency','[callProgressDetectingCustomer][logBusy]','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','activeContact','swapAdditionalPhones','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','Congestion','dialCongestionRetryFrequency','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','countcongestionretry','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','decrementTalkink','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','resolve','[incrementPreviewCounters]\x20','checkInBlack','phone'];(function(_0x2a318a,_0x3f8006){var _0x346cf3=function(_0x314595){while(--_0x314595){_0x2a318a['push'](_0x2a318a['shift']());}};_0x346cf3(++_0x3f8006);}(_0xcca7,0x1aa));var _0x7cca=function(_0x5d22ad,_0x116bb3){_0x5d22ad=_0x5d22ad-0x0;var _0x3e7cba=_0xcca7[_0x5d22ad];return _0x3e7cba;};'use strict';var util=require(_0x7cca('0x0'));var _=require(_0x7cca('0x1'));var BPromise=require(_0x7cca('0x2'));var uuid=require(_0x7cca('0x3'));var moment=require('moment');var md5=require('md5');var Redis=require(_0x7cca('0x4'));var config=require('../../../config/environment');var logger=require(_0x7cca('0x5'))(_0x7cca('0x6'));var loggerAction=require(_0x7cca('0x5'))(_0x7cca('0x7'));var ami=require(_0x7cca('0x8'));var rpcDb=require(_0x7cca('0x9'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require('./action');var ut=require(_0x7cca('0xa'));config[_0x7cca('0xb')]=_[_0x7cca('0xc')](config[_0x7cca('0xb')],{'host':_0x7cca('0xd'),'port':0x18eb});var io=require(_0x7cca('0xe'))(new Redis(config[_0x7cca('0xb')]));var Sequence=function(){};Sequence[_0x7cca('0xf')][_0x7cca('0x10')]=function(_0x1a773e){this['tail']=this[_0x7cca('0x11')]?this[_0x7cca('0x11')][_0x7cca('0x12')](_0x1a773e):_0x1a773e();};function Preview(_0x34e14f){this[_0x7cca('0x13')]=new Sequence();this['campaignsPreview']=_0x34e14f[_0x7cca('0x14')];this[_0x7cca('0x15')]=_0x34e14f[_0x7cca('0x15')];this['actions']={};this['agents']=_0x34e14f[_0x7cca('0x16')];this[_0x7cca('0x17')]=0x0;ami['on'](_0x7cca('0x18'),this[_0x7cca('0x19')][_0x7cca('0x1a')](this));ami['on'](_0x7cca('0x1b'),this[_0x7cca('0x1c')]['bind'](this));ami['on'](_0x7cca('0x1d'),this['syncHangupRequest']['bind'](this));ami['on']('dialend',this[_0x7cca('0x1e')][_0x7cca('0x1a')](this));ami['on'](_0x7cca('0x1f'),this[_0x7cca('0x20')][_0x7cca('0x1a')](this));ami['on']('varset',this[_0x7cca('0x21')]['bind'](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x7cca('0x1a')](this));ami['on'](_0x7cca('0x22'),this[_0x7cca('0x23')][_0x7cca('0x1a')](this));this[_0x7cca('0x24')](this[_0x7cca('0x25')]);}function emit(_0x2e023c,_0x1e183f,_0x4d7804){io['to'](_0x2e023c)[_0x7cca('0x26')](_0x1e183f,_0x4d7804);}function emitCampaignPreview(_0x3154b0){if(_0x3154b0[_0x7cca('0x27')]===_0x7cca('0x28')){var _0x55b689={'id':_0x3154b0['id'],'name':_0x3154b0[_0x7cca('0x29')],'strategy':_0x3154b0[_0x7cca('0x2a')],'answered':_0x3154b0[_0x7cca('0x2b')],'available':_0x3154b0[_0x7cca('0x2c')],'loggedIn':_0x3154b0[_0x7cca('0x2d')],'pTalking':_0x3154b0[_0x7cca('0x2e')],'sumBillable':_0x3154b0[_0x7cca('0x2f')],'sumDuration':_0x3154b0[_0x7cca('0x30')],'sumHoldTime':_0x3154b0['sumHoldTime']||0x0,'talking':_0x3154b0[_0x7cca('0x31')],'total':_0x3154b0[_0x7cca('0x32')],'type':_0x3154b0[_0x7cca('0x27')],'unmanaged':_0x3154b0[_0x7cca('0x33')],'abandoned':_0x3154b0[_0x7cca('0x34')],'waiting':_0x3154b0[_0x7cca('0x35')],'loggedInDb':_0x3154b0[_0x7cca('0x36')],'dialActive':_0x3154b0[_0x7cca('0x37')],'dialMethod':_0x3154b0['dialMethod'],'dialOriginateCallerIdName':_0x3154b0[_0x7cca('0x38')],'dialOriginateCallerIdNumber':_0x3154b0['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x3154b0[_0x7cca('0x39')],'dialPrefix':_0x3154b0[_0x7cca('0x3a')],'outboundAnswerAgiCallsDay':_0x3154b0['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x3154b0[_0x7cca('0x3b')],'outboundBlacklistCallsDay':_0x3154b0[_0x7cca('0x3c')],'outboundBusyCallsDay':_0x3154b0['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x3154b0[_0x7cca('0x3d')],'outboundDropCallsDayACS':_0x3154b0[_0x7cca('0x3e')],'outboundDropCallsDayCallersExit':_0x3154b0[_0x7cca('0x3f')],'outboundDropCallsDayTimeout':_0x3154b0['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x3154b0['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x3154b0[_0x7cca('0x40')],'outboundOriginateFailureCallsDay':_0x3154b0[_0x7cca('0x41')],'outboundReCallsDay':_0x3154b0[_0x7cca('0x42')],'outboundRejectCallsDay':_0x3154b0[_0x7cca('0x43')],'outboundUnknownCallsDay':_0x3154b0[_0x7cca('0x44')],'outboundAbandonedCallsDay':_0x3154b0[_0x7cca('0x45')],'predictiveIntervalAnsweredCalls':_0x3154b0[_0x7cca('0x46')],'predictiveIntervalAvgHoldtime':_0x3154b0['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x3154b0['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x3154b0[_0x7cca('0x47')],'predictiveIntervalDroppedCallsTimeout':_0x3154b0[_0x7cca('0x48')],'predictiveIntervalErlangCalls':_0x3154b0[_0x7cca('0x49')],'predictiveIntervalErlangCallsDroppedCalls':_0x3154b0['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x3154b0[_0x7cca('0x4a')],'predictiveIntervalMultiplicativeFactor':_0x3154b0['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x3154b0[_0x7cca('0x4b')],'predictiveIntervalAvailable':_0x3154b0[_0x7cca('0x4c')],'predictiveIntervalTotalCalls':_0x3154b0[_0x7cca('0x4d')],'message':_0x3154b0[_0x7cca('0x4e')],'originated':_0x3154b0['originated'],'erlangCalls':_0x3154b0[_0x7cca('0x4f')],'erlangCallToSecond':_0x3154b0[_0x7cca('0x50')],'erlangAbandonmentRate':_0x3154b0[_0x7cca('0x51')],'erlangBusyFactor':_0x3154b0['erlangBusyFactor'],'startPredictive':_0x3154b0['startPredictive'],'startProgressive':_0x3154b0['startProgressive']};if(_0x3154b0[_0x7cca('0x52')]){_0x55b689[_0x7cca('0x52')]={'id':_0x3154b0['Trunk']['id'],'name':_0x3154b0[_0x7cca('0x52')][_0x7cca('0x29')],'active':_0x3154b0[_0x7cca('0x52')][_0x7cca('0x53')],'callerid':_0x3154b0[_0x7cca('0x52')][_0x7cca('0x54')]};}if(_0x3154b0[_0x7cca('0x55')]){_0x55b689['Interval']={'id':_0x3154b0[_0x7cca('0x55')]['id'],'name':_0x3154b0[_0x7cca('0x55')][_0x7cca('0x29')]};}var _0x147cf8=md5(JSON['stringify'](_0x55b689));if(_0x3154b0[_0x7cca('0x56')]!==_0x147cf8){_0x3154b0[_0x7cca('0x56')]=_0x147cf8;emit(util[_0x7cca('0x57')]('voice:queue:%s',_0x55b689[_0x7cca('0x29')]),'voice_queue:save',_0x55b689);}}}function emitVoiceQueueChannelRemove(_0x36ad6a){logger[_0x7cca('0x58')](_0x7cca('0x59'),JSON[_0x7cca('0x5a')](_0x36ad6a));emit(util[_0x7cca('0x57')](_0x7cca('0x5b'),_0x36ad6a[_0x7cca('0x29')]),_0x7cca('0x5c'),_0x36ad6a);io[_0x7cca('0x26')]('voice_queue_presence:remove',_0x36ad6a);}function notSendMessagesQueue(_0x5b0cc0){if(_0x5b0cc0[_0x7cca('0x5d')]){if(_0x5b0cc0[_0x7cca('0x5e')]===0x0&&_0x5b0cc0['pTalking']===0x0){_0x5b0cc0['sendMessageOneNotActive']=![];_0x5b0cc0[_0x7cca('0x2c')]=0x0;_0x5b0cc0[_0x7cca('0x5f')]=0x0;_0x5b0cc0[_0x7cca('0x4e')]=_0x7cca('0x60');ut[_0x7cca('0x61')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x5b0cc0[_0x7cca('0x29')]+'\x20is\x20not\x20active');}else{_0x5b0cc0['message']=_0x7cca('0x62');ut[_0x7cca('0x61')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x5b0cc0[_0x7cca('0x29')]+'\x20is\x20deactivated');}emitCampaignPreview(_0x5b0cc0);}}Preview[_0x7cca('0xf')][_0x7cca('0x24')]=function(){var _0x38cc6c=this;setInterval(function(){_0x38cc6c['syncCampaigns']();},0x7cf);};Preview[_0x7cca('0xf')][_0x7cca('0x63')]=function(){var _0x2e8d97=this[_0x7cca('0x25')];this['clockClearZombieChannels']+=0x1;for(var _0x92e3d5 in _0x2e8d97){if(_0x2e8d97[_0x7cca('0x64')](_0x92e3d5)&&(_0x2e8d97[_0x92e3d5][_0x7cca('0x65')]===_0x7cca('0x6')||_0x2e8d97[_0x92e3d5][_0x7cca('0x65')]===_0x7cca('0x66'))&&_0x2e8d97[_0x92e3d5]['type']==='outbound'){if(this['clockClearZombieChannels']>0x7){this['clockClearZombieChannels']=0x0;this[_0x7cca('0x67')]();}}if(_0x2e8d97['hasOwnProperty'](_0x92e3d5)&&_0x2e8d97[_0x92e3d5]['dialMethod']===_0x7cca('0x6')&&_0x2e8d97[_0x92e3d5][_0x7cca('0x27')]===_0x7cca('0x28')){if(_0x2e8d97[_0x92e3d5][_0x7cca('0x37')]){this[_0x7cca('0x68')](_0x2e8d97[_0x92e3d5]);if(_0x2e8d97[_0x92e3d5]['dialPreviewAutoRecallMe'])this[_0x7cca('0x69')](_0x2e8d97[_0x92e3d5]);}else{notSendMessagesQueue(_0x2e8d97[_0x92e3d5]);}}}};Preview[_0x7cca('0xf')][_0x7cca('0x6a')]=function(_0x4919b4){var _0x4e2083=this;this[_0x7cca('0x13')][_0x7cca('0x10')](function(){if(!_[_0x7cca('0x6b')](_0x4e2083[_0x7cca('0x6c')][_0x4919b4])){loggerAction[_0x7cca('0x58')](_0x7cca('0x6d'),_0x4919b4,'Queue',_0x4e2083['actions'][_0x4919b4][_0x7cca('0x6e')],_0x7cca('0x6f'),JSON[_0x7cca('0x5a')](_0x4e2083[_0x7cca('0x25')][_0x4e2083[_0x7cca('0x6c')][_0x4919b4][_0x7cca('0x6e')]][_0x7cca('0x5e')]),_0x7cca('0x70'),JSON[_0x7cca('0x5a')](_0x4e2083[_0x7cca('0x25')][_0x4e2083[_0x7cca('0x6c')][_0x4919b4][_0x7cca('0x6e')]]['pTalking']),JSON[_0x7cca('0x5a')](_0x4e2083[_0x7cca('0x6c')][_0x4919b4][_0x7cca('0x71')]),JSON[_0x7cca('0x5a')](_[_0x7cca('0x72')](_0x4e2083[_0x7cca('0x6c')][_0x4919b4],[_0x7cca('0x73'),_0x7cca('0x74'),_0x7cca('0x75'),_0x7cca('0x76')])));return ami[_0x7cca('0x77')]({'action':_0x7cca('0x78'),'channel':_0x4e2083[_0x7cca('0x6c')][_0x4919b4][_0x7cca('0x79')]})[_0x7cca('0x7a')](function(_0x123727){if(_0x123727[_0x7cca('0x4e')]===_0x7cca('0x7b')){setTimeout(function(){if(_0x4e2083[_0x7cca('0x6c')][_0x4919b4]){ut[_0x7cca('0x7c')](_0x4e2083[_0x7cca('0x25')][_0x4e2083[_0x7cca('0x6c')][_0x4919b4][_0x7cca('0x6e')]],_0x7cca('0x7d'));if(_0x4e2083[_0x7cca('0x6c')][_0x4919b4][_0x7cca('0x71')]===!![]){ut['decrementTalkink'](_0x4e2083[_0x7cca('0x25')][_0x4e2083[_0x7cca('0x6c')][_0x4919b4]['queue']],'[clearZombieChannel]');ut['loggerError'](_0x7cca('0x7e')+_0x4919b4,_0x4e2083[_0x7cca('0x6c')][_0x4919b4]['queue']);}ut[_0x7cca('0x7f')](_0x7cca('0x80')+_0x4919b4,_0x4e2083['actions'][_0x4919b4][_0x7cca('0x6e')]);delete _0x4e2083['actions'][_0x4919b4];}},0x2328);}});}});};Preview[_0x7cca('0xf')][_0x7cca('0x67')]=function(){var _0x33300a=this;loggerAction[_0x7cca('0x58')](_0x7cca('0x81'),_[_0x7cca('0x82')](this[_0x7cca('0x6c')]));for(var _0x470826 in this[_0x7cca('0x6c')]){if(_0x33300a[_0x7cca('0x6c')][_0x7cca('0x64')](_0x470826)){_0x33300a[_0x7cca('0x6a')](_0x470826);}}};Preview[_0x7cca('0xf')]['recallMe']=function(_0x22b378){var _0x51e215=this;rpcDb[_0x7cca('0x83')](_0x22b378['id'],ut['agentReadyId'](this[_0x7cca('0x16')]))[_0x7cca('0x84')](function(_0x33402f){if(!_['isNil'](_0x33402f)){for(var _0x33b7e1=0x0;_0x33b7e1<_0x33402f[_0x7cca('0x85')];_0x33b7e1+=0x1){if(ut[_0x7cca('0x86')](_0x33402f[_0x33b7e1][_0x7cca('0x87')])<_0x22b378[_0x7cca('0x88')]*0x3c){if(_0x33402f[_0x33b7e1]['Agent']&&!_0x33402f[_0x33b7e1]['Agent'][_0x7cca('0x89')]){_0x51e215[_0x7cca('0x8a')](_0x33402f[_0x33b7e1]['id'])[_0x7cca('0x84')](ut[_0x7cca('0x8b')](_0x7cca('0x8c')))[_0x7cca('0x7a')](ut[_0x7cca('0x8b')](_0x7cca('0x8c')));}else{rpcDb[_0x7cca('0x8d')](_0x33402f[_0x33b7e1]['id']);}}else{var _0x35eca7=new Action(_0x33402f[_0x33b7e1],_0x22b378);_0x35eca7[_0x7cca('0x8e')]=moment()[_0x7cca('0x57')](_0x7cca('0x8f'));_0x22b378['outboundReCallsDay']+=0x1;ut[_0x7cca('0x90')](_0x35eca7,0x17,_0x7cca('0x91'));if(_0x22b378['dialRecallInQueue']){rpcDb[_0x7cca('0x92')](ut[_0x7cca('0x93')](_0x33402f[_0x33b7e1]));rpcDb[_0x7cca('0x94')](_0x35eca7,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0x7cca('0x90')](_0x35eca7,0x16,_0x7cca('0x95'));rpcDb[_0x7cca('0x94')](_0x35eca7,_0x7cca('0x96'));rpcDb[_0x7cca('0x97')](_0x35eca7,'[HistoryRecallClose]');}}}}})[_0x7cca('0x7a')](ut[_0x7cca('0x8b')](_0x7cca('0x98')));};Preview[_0x7cca('0xf')]['setMessage']=function(_0x399d14){_0x399d14[_0x7cca('0x5d')]=!![];if(ut['IsNotLoggedIn'](_0x399d14[_0x7cca('0x2d')])){_0x399d14['message']=_0x7cca('0x99');}else if(!ut['isActive'](_0x399d14[_0x7cca('0x37')])){_0x399d14[_0x7cca('0x4e')]=_0x7cca('0x60');}else if(!this[_0x7cca('0x9a')](_0x399d14[_0x7cca('0x52')])){if(!this[_0x7cca('0x9a')](_0x399d14[_0x7cca('0x9b')])){_0x399d14[_0x7cca('0x4e')]=_0x7cca('0x9c');}else{_0x399d14[_0x7cca('0x4e')]=_0x7cca('0x9d');}}else{_0x399d14[_0x7cca('0x4e')]=_0x7cca('0x9d');}emitCampaignPreview(_0x399d14);};Preview[_0x7cca('0xf')]['callProgressDetectingCustomer']=function(_0x418168,_0x451f2d,_0x61c76){var _0x4e4fc4=this;var _0x34eb20=this['actions'][_0x451f2d];var _0x10c470=this[_0x7cca('0x25')][_0x34eb20[_0x7cca('0x6e')]];var _0x4aea47;var _0x17e718=![];var _0x1bc52c=0x2;var _0xb6832=0x3;if(_0x10c470){switch(_0x61c76){case'1':_0x10c470[_0x7cca('0x40')]+=0x1;_0x34eb20[_0x7cca('0x9e')]+=0x1;_0x34eb20[_0x7cca('0x9f')]=ut[_0x7cca('0xa0')](_0x34eb20);ut[_0x7cca('0x90')](_0x34eb20,0x0,_0x7cca('0xa1'));ami['emit'](_0x7cca('0xa2'),ut['buildObj'](_0x34eb20,_0x7cca('0xa3')));rpcDb[_0x7cca('0x94')](_0x34eb20,_0x7cca('0xa4'));_0x4e4fc4[_0x7cca('0xa5')](_0x34eb20,'0',_0x10c470)['then'](function(_0x319a03){_0x17e718=_0x319a03[_0x7cca('0xa6')]==0x1;_0x1bc52c=_0x10c470[_0x7cca('0xa7')];_0xb6832=_0x10c470[_0x7cca('0xa8')];if(!_0x17e718){if(ut[_0x7cca('0xa0')](_0x34eb20)>=_0x10c470[_0x7cca('0xa9')]){_0x4aea47=ut['cloneAction'](_0x34eb20,0xf,_0x7cca('0xaa'));rpcDb[_0x7cca('0x97')](_0x4aea47,_0x7cca('0xab'));}else{if(_0x34eb20[_0x7cca('0x9e')]>=_0x10c470[_0x7cca('0xac')]){rpcDb[_0x7cca('0x97')](_0x34eb20,_0x7cca('0xab'));}else{rpcDb[_0x7cca('0xad')](ut[_0x7cca('0xae')](_0x34eb20,'countnosuchnumberretry',_0x10c470[_0x7cca('0xa7')]),_0x34eb20[_0x7cca('0xaf')],_0x34eb20['activeContact']);}}delete this[_0x7cca('0x6c')][_0x418168['linkedid']];}else{_0x34eb20[_0x7cca('0x9e')]++;logger[_0x7cca('0x58')](_0x7cca('0xb0'),_0x34eb20[_0x7cca('0x9e')]);logger[_0x7cca('0x58')]('id',_0x34eb20[_0x7cca('0xb1')]);_0x4e4fc4[_0x7cca('0xb2')]({'id':_0x34eb20[_0x7cca('0xb1')],'field':{'countnosuchnumberretry':_0x34eb20[_0x7cca('0x9e')]}})[_0x7cca('0x84')](function(){_0x4e4fc4['swapAdditionalPhones'](_0x34eb20,_0x1bc52c,_0xb6832)[_0x7cca('0x84')](function(){});});}});break;case _0x7cca('0xb3'):var _0x3c347c=moment()[_0x7cca('0x57')](_0x7cca('0x8f'));_0x34eb20[_0x7cca('0xb4')]=_0x3c347c;_0x34eb20[_0x7cca('0xb5')]=_0x3c347c;_0x34eb20[_0x7cca('0x71')]=!![];_0x10c470['pTalking']+=0x1;logger[_0x7cca('0x58')](_0x7cca('0xb6'),_0x34eb20[_0x7cca('0xb7')],'\x20Queue',_0x10c470[_0x7cca('0x29')],_0x7cca('0x70'),_0x10c470[_0x7cca('0x2e')]);ami[_0x7cca('0x26')]('custom:agentconnect',ut[_0x7cca('0xb8')](_0x34eb20,_0x7cca('0xb9'),this[_0x7cca('0x25')][_0x34eb20[_0x7cca('0x6e')]]));if(_0x10c470[_0x7cca('0xba')]){ami[_0x7cca('0x26')](_0x7cca('0xbb'),ut['buildAcw'](_0x34eb20));}break;case'16':ami[_0x7cca('0x26')](_0x7cca('0xbc'),ut[_0x7cca('0xb8')](_0x34eb20,_0x7cca('0xbd'),this[_0x7cca('0x25')][_0x34eb20['queue']]));emitVoiceQueueChannelRemove(ut[_0x7cca('0xb8')](_0x34eb20,_0x7cca('0xbd')));_0x10c470['outboundAnswerCallsDay']+=0x1;_0x10c470[_0x7cca('0x32')]+=0x1;_0x10c470[_0x7cca('0x2b')]+=0x1;ut['decrementTalkink'](_0x10c470,_0x7cca('0xbe'));_0x34eb20[_0x7cca('0x9f')]=ut[_0x7cca('0xa0')](_0x34eb20);ut[_0x7cca('0x90')](_0x34eb20,0x4,_0x7cca('0xbf'));rpcDb[_0x7cca('0x94')](_0x34eb20,_0x7cca('0xc0'));rpcDb[_0x7cca('0x97')](_0x34eb20,_0x7cca('0xc1'));rpcDb[_0x7cca('0xc2')](_0x34eb20);_0x10c470[_0x7cca('0x30')]+=_0x34eb20[_0x7cca('0xc3')];_0x10c470['sumBillable']+=_0x34eb20[_0x7cca('0xc3')];logger[_0x7cca('0x58')](_0x7cca('0xc4'),_0x34eb20[_0x7cca('0xb7')],_0x7cca('0xc5'),_0x10c470[_0x7cca('0x29')],'pTalking:\x20',_0x10c470[_0x7cca('0x2e')]);delete this[_0x7cca('0x6c')][_0x418168[_0x7cca('0xc6')]];break;case'BUSY':_0x10c470[_0x7cca('0xc7')]+=0x1;_0x34eb20[_0x7cca('0xc8')]+=0x1;_0x34eb20[_0x7cca('0x9f')]=ut['totalGlobal'](_0x34eb20);ut[_0x7cca('0x90')](_0x34eb20,0x5,'Busy');_0x1bc52c=_0x10c470[_0x7cca('0xc9')];_0xb6832=_0x10c470[_0x7cca('0xa8')];ami[_0x7cca('0x26')]('custom:agentbusy',ut[_0x7cca('0xb8')](_0x34eb20,'busy'));rpcDb['createCustomerHistory'](_0x34eb20,_0x7cca('0xca'));_0x4e4fc4[_0x7cca('0xa5')](_0x34eb20,'5',_0x10c470)['then'](function(_0x2bcaf5){_0x17e718=_0x2bcaf5[_0x7cca('0xa6')]==0x1;if(!_0x17e718){if(ut[_0x7cca('0xa0')](_0x34eb20)>=_0x10c470['dialGlobalMaxRetry']){_0x4aea47=ut[_0x7cca('0xcb')](_0x34eb20,0xf,_0x7cca('0xaa'));rpcDb[_0x7cca('0x97')](_0x4aea47,_0x7cca('0xcc'));}else{if(_0x34eb20[_0x7cca('0xc8')]>=_0x10c470[_0x7cca('0xcd')]){rpcDb[_0x7cca('0x97')](_0x34eb20,_0x7cca('0xca'));}else{rpcDb[_0x7cca('0xad')](ut[_0x7cca('0xae')](_0x34eb20,_0x7cca('0xc8'),_0x10c470[_0x7cca('0xc9')]),_0x34eb20[_0x7cca('0xaf')],_0x34eb20[_0x7cca('0xce')]);}}}else{_0x34eb20[_0x7cca('0xc8')]++;_0x4e4fc4[_0x7cca('0xb2')]({'id':_0x34eb20['idContact'],'field':{'countbusyretry':_0x34eb20[_0x7cca('0xc8')]}})[_0x7cca('0x84')](function(){_0x4e4fc4[_0x7cca('0xcf')](_0x34eb20,_0x1bc52c,_0xb6832)['then'](function(){});});}});break;case _0x7cca('0xd0'):_0x10c470[_0x7cca('0xd1')]+=0x1;_0x34eb20[_0x7cca('0xd2')]+=0x1;_0x34eb20[_0x7cca('0x9f')]=ut[_0x7cca('0xa0')](_0x34eb20);ut[_0x7cca('0x90')](_0x34eb20,0x3,_0x7cca('0xd3'));_0x1bc52c=_0x10c470['dialNoAnswerRetryFrequency'];_0xb6832=_0x10c470[_0x7cca('0xa8')];ami[_0x7cca('0x26')](_0x7cca('0xd4'),ut['buildObj'](_0x34eb20,'noanswer'));rpcDb['createCustomerHistory'](_0x34eb20,_0x7cca('0xd5'));_0x4e4fc4[_0x7cca('0xa5')](_0x34eb20,'3',_0x10c470)[_0x7cca('0x84')](function(_0x18bc8c){_0x17e718=_0x18bc8c['additional']==0x1;if(!_0x17e718){if(ut[_0x7cca('0xa0')](_0x34eb20)>=_0x10c470[_0x7cca('0xa9')]){_0x4aea47=ut[_0x7cca('0xcb')](_0x34eb20,0xf,'Global');rpcDb[_0x7cca('0x97')](_0x4aea47,_0x7cca('0xd6'));}else{if(_0x34eb20['countnoanswerretry']>=_0x10c470[_0x7cca('0xd7')]){rpcDb[_0x7cca('0x97')](_0x34eb20,_0x7cca('0xd5'));}else{rpcDb[_0x7cca('0xad')](ut[_0x7cca('0xae')](_0x34eb20,_0x7cca('0xd2'),_0x10c470[_0x7cca('0xd8')]),_0x34eb20[_0x7cca('0xaf')],_0x34eb20[_0x7cca('0xce')]);}}}else{_0x34eb20[_0x7cca('0xd2')]++;_0x4e4fc4[_0x7cca('0xb2')]({'id':_0x34eb20[_0x7cca('0xb1')],'field':{'countnoanswerretry':_0x34eb20[_0x7cca('0xd2')]}})[_0x7cca('0x84')](function(){_0x4e4fc4[_0x7cca('0xcf')](_0x34eb20,_0x1bc52c,_0xb6832)[_0x7cca('0x84')](function(){});});}});break;case'CONGESTION':_0x10c470[_0x7cca('0x3d')]+=0x1;_0x34eb20['countcongestionretry']+=0x1;_0x34eb20[_0x7cca('0x9f')]=ut[_0x7cca('0xa0')](_0x34eb20);ut[_0x7cca('0x90')](_0x34eb20,0x8,_0x7cca('0xd9'));_0x1bc52c=_0x10c470[_0x7cca('0xda')];_0xb6832=_0x10c470[_0x7cca('0xa8')];ami['emit']('custom:agentcongestion',ut[_0x7cca('0xb8')](_0x34eb20,_0x7cca('0xdb')));rpcDb[_0x7cca('0x94')](_0x34eb20,_0x7cca('0xdc'));_0x4e4fc4[_0x7cca('0xa5')](_0x34eb20,'8',_0x10c470)[_0x7cca('0x84')](function(_0x14c7f8){_0x17e718=_0x14c7f8['additional']==0x1;if(!_0x17e718){if(ut['totalGlobal'](_0x34eb20)>=_0x10c470[_0x7cca('0xa9')]){_0x4aea47=ut[_0x7cca('0xcb')](_0x34eb20,0xf,'Global');rpcDb[_0x7cca('0x97')](_0x4aea47,_0x7cca('0xdd'));}else{if(_0x34eb20['countcongestionretry']>=_0x10c470[_0x7cca('0xde')]){rpcDb[_0x7cca('0x97')](_0x34eb20,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0x7cca('0xad')](ut[_0x7cca('0xae')](_0x34eb20,'countcongestionretry',_0x10c470['dialBusyRetryFrequency']),_0x34eb20[_0x7cca('0xaf')],_0x34eb20['activeContact']);}}}else{_0x34eb20[_0x7cca('0xdf')]++;_0x4e4fc4[_0x7cca('0xb2')]({'id':_0x34eb20[_0x7cca('0xb1')],'field':{'countcongestionretry':_0x34eb20[_0x7cca('0xdf')]}})[_0x7cca('0x84')](function(){_0x4e4fc4[_0x7cca('0xcf')](_0x34eb20,_0x1bc52c,_0xb6832)[_0x7cca('0x84')](function(){});});}});break;case'CANCEL':_0x10c470[_0x7cca('0x43')]+=0x1;_0x34eb20[_0x7cca('0xe0')]+=0x1;_0x34eb20['countglobal']=ut[_0x7cca('0xa0')](_0x34eb20);ut[_0x7cca('0x90')](_0x34eb20,0x14,_0x7cca('0xe1'));_0x1bc52c=_0x10c470[_0x7cca('0xe2')];_0xb6832=_0x10c470[_0x7cca('0xa8')];ami[_0x7cca('0x26')](_0x7cca('0xe3'),ut[_0x7cca('0xb8')](_0x34eb20,_0x7cca('0xe4')));rpcDb[_0x7cca('0x94')](_0x34eb20,_0x7cca('0xe5'));_0x4e4fc4[_0x7cca('0xa5')](_0x34eb20,'20',_0x10c470)[_0x7cca('0x84')](function(_0x355794){_0x17e718=_0x355794[_0x7cca('0xa6')]==0x1;if(!_0x17e718){if(ut[_0x7cca('0xa0')](_0x34eb20)>=_0x10c470[_0x7cca('0xa9')]){_0x4aea47=ut['cloneAction'](_0x34eb20,0x14,_0x7cca('0xe1'));rpcDb[_0x7cca('0x97')](_0x4aea47,_0x7cca('0xe6'));}else{if(_0x34eb20[_0x7cca('0xe0')]>=_0x10c470[_0x7cca('0xe7')]){rpcDb[_0x7cca('0x97')](_0x34eb20,_0x7cca('0xe6'));}else{rpcDb['rescheduleContact'](ut[_0x7cca('0xae')](_0x34eb20,'countagentrejectretry',_0x10c470[_0x7cca('0xe2')]),_0x34eb20[_0x7cca('0xaf')],_0x34eb20[_0x7cca('0xce')]);}}}else{_0x34eb20[_0x7cca('0xd2')]++;_0x4e4fc4['incrementPreviewCounters']({'id':_0x34eb20[_0x7cca('0xb1')],'field':{'countnoanswerretry':_0x34eb20[_0x7cca('0xd2')]}})[_0x7cca('0x84')](function(){_0x4e4fc4[_0x7cca('0xcf')](_0x34eb20,_0x1bc52c,_0xb6832)[_0x7cca('0x84')](function(){});});}});break;case _0x7cca('0xe8'):_0x10c470['outboundAbandonedCallsDay']+=0x1;_0x34eb20[_0x7cca('0xe9')]+=0x1;_0x34eb20[_0x7cca('0x9f')]=ut[_0x7cca('0xa0')](_0x34eb20);ut[_0x7cca('0x90')](_0x34eb20,0xb,_0x7cca('0xea'));rpcDb['createCustomerHistory'](_0x34eb20,_0x7cca('0xeb'));_0x4e4fc4[_0x7cca('0xa5')](_0x34eb20,'11',_0x10c470)['then'](function(_0x1d13ff){_0x17e718=_0x1d13ff[_0x7cca('0xa6')]==0x1;if(!_0x17e718){if(ut['totalGlobal'](_0x34eb20)>=_0x10c470['dialGlobalMaxRetry']){_0x4aea47=ut[_0x7cca('0xcb')](_0x34eb20,0xf,_0x7cca('0xaa'));rpcDb[_0x7cca('0x97')](_0x4aea47,_0x7cca('0xeb'));}else{if(_0x34eb20[_0x7cca('0xec')]>=_0x10c470[_0x7cca('0xed')]){rpcDb['createCustomerFinal'](_0x34eb20,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0x7cca('0xad')](ut['scheduledAt'](_0x34eb20,_0x7cca('0xe9'),_0x10c470['dialAbandonedRetryFrequency']),_0x34eb20[_0x7cca('0xaf')],_0x34eb20[_0x7cca('0xce')]);}}}else{_0x34eb20[_0x7cca('0xd2')]++;_0x4e4fc4[_0x7cca('0xb2')]({'id':_0x34eb20[_0x7cca('0xb1')],'field':{'countnoanswerretry':_0x34eb20[_0x7cca('0xd2')]}})[_0x7cca('0x84')](function(){_0x4e4fc4[_0x7cca('0xcf')](_0x34eb20,_0x1bc52c,_0xb6832)['then'](function(){});});}});break;case'18':_0x10c470[_0x7cca('0x44')]+=0x1;_0x34eb20['countmachineretry']+=0x1;_0x34eb20['countglobal']=ut[_0x7cca('0xa0')](_0x34eb20);ut[_0x7cca('0x90')](_0x34eb20,0x12,_0x418168[_0x7cca('0xee')]||_0x418168[_0x7cca('0xef')]);ami[_0x7cca('0x26')](_0x7cca('0xf0'),ut['buildObj'](_0x34eb20,_0x7cca('0xf1')));rpcDb[_0x7cca('0x94')](_0x34eb20,_0x7cca('0xf2'));_0x4e4fc4[_0x7cca('0xa5')](_0x34eb20,'18',_0x10c470)[_0x7cca('0x84')](function(_0x18ed10){_0x17e718=_0x18ed10[_0x7cca('0xa6')]==0x1;if(!_0x17e718){if(ut[_0x7cca('0xa0')](_0x34eb20)>=_0x10c470['dialGlobalMaxRetry']){_0x4aea47=ut[_0x7cca('0xcb')](_0x34eb20,0x12,_0x7cca('0xaa'));rpcDb[_0x7cca('0x97')](_0x4aea47,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0x7cca('0x97')](_0x34eb20,'[callProgressDetectingCustomer][hangupInAMD]');}}else{_0x34eb20[_0x7cca('0xd2')]++;_0x4e4fc4[_0x7cca('0xb2')]({'id':_0x34eb20['idContact'],'field':{'countnoanswerretry':_0x34eb20[_0x7cca('0xd2')]}})[_0x7cca('0x84')](function(){_0x4e4fc4[_0x7cca('0xcf')](_0x34eb20,_0x1bc52c,_0xb6832)[_0x7cca('0x84')](function(){});});}});delete this['actions'][_0x418168[_0x7cca('0xc6')]];break;case'19':_0x10c470[_0x7cca('0x44')]+=0x1;_0x34eb20['countglobal']=ut[_0x7cca('0xa0')](_0x34eb20);ut['logCustomer'](_0x34eb20,0x13,_0x418168[_0x7cca('0xee')]||_0x418168[_0x7cca('0xef')]);ami[_0x7cca('0x26')]('custom:amd',ut['buildObj'](_0x34eb20,_0x7cca('0xf1')));rpcDb[_0x7cca('0x94')](_0x34eb20,_0x7cca('0xf3'));_0x4e4fc4[_0x7cca('0xa5')](_0x34eb20,'18',_0x10c470)['then'](function(_0x4d1dfc){_0x17e718=_0x4d1dfc[_0x7cca('0xa6')]==0x1;if(!_0x17e718){if(ut['totalGlobal'](_0x34eb20)>=_0x10c470[_0x7cca('0xa9')]){_0x4aea47=ut[_0x7cca('0xcb')](_0x34eb20,0xf,_0x7cca('0xaa'));rpcDb[_0x7cca('0x97')](_0x4aea47,'[callProgressDetectingCustomer][machine]');}else{rpcDb[_0x7cca('0x97')](_0x34eb20,_0x7cca('0xf3'));}}else{_0x34eb20[_0x7cca('0xd2')]++;_0x4e4fc4[_0x7cca('0xb2')]({'id':_0x34eb20[_0x7cca('0xb1')],'field':{'countnoanswerretry':_0x34eb20[_0x7cca('0xd2')]}})[_0x7cca('0x84')](function(){_0x4e4fc4[_0x7cca('0xcf')](_0x34eb20,_0x1bc52c,_0xb6832)['then'](function(){});});}});delete this[_0x7cca('0x6c')][_0x418168['linkedid']];break;default:if(_0x34eb20[_0x7cca('0x71')]){ut[_0x7cca('0xf4')](_0x10c470,_0x7cca('0xf5'));ut[_0x7cca('0x7f')](_0x7cca('0xf6')+_0x10c470['name'],_0x418168);}_0x10c470[_0x7cca('0x44')]+=0x1;_0x34eb20[_0x7cca('0x9f')]=ut[_0x7cca('0xa0')](_0x34eb20);ut['logCustomer'](_0x34eb20,0xc,_0x418168[_0x7cca('0xee')]||_0x418168[_0x7cca('0xef')]);_0x1bc52c=_0x10c470[_0x7cca('0xe2')];_0xb6832=_0x10c470[_0x7cca('0xa8')];rpcDb[_0x7cca('0x94')](_0x34eb20,_0x7cca('0xf7'));_0x4e4fc4[_0x7cca('0xa5')](_0x34eb20,'20',_0x10c470)['then'](function(_0x40c6ca){_0x17e718=_0x40c6ca[_0x7cca('0xa6')]==0x1;if(!_0x17e718){if(ut[_0x7cca('0xa0')](_0x34eb20)>=_0x10c470['dialGlobalMaxRetry']){_0x4aea47=ut[_0x7cca('0xcb')](_0x34eb20,0xf,_0x7cca('0xaa'));rpcDb[_0x7cca('0x97')](_0x4aea47,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x7cca('0x97')](_0x34eb20,_0x7cca('0xf8'));}delete this[_0x7cca('0x6c')][_0x418168[_0x7cca('0xc6')]];}else{_0x4e4fc4[_0x7cca('0xcf')](_0x34eb20,_0x1bc52c,_0xb6832)['then'](function(_0xeeb453){});}});}if(!(_0x34eb20[_0x7cca('0x71')]&&_0x61c76==='16')){ut[_0x7cca('0x7c')](_0x10c470,'[callProgressDetectingCustomer]');logger['info']('[originated][decrement][callProgressDetectingCustomer]',_0x34eb20['uniqueid'],'\x20Queue',_0x10c470[_0x7cca('0x29')],_0x7cca('0x6f'),_0x10c470['originated']);}if(_0x61c76!==_0x7cca('0xb3')){delete this[_0x7cca('0x6c')][_0x418168[_0x7cca('0xc6')]];delete this[_0x7cca('0x6c')][_0x418168['destlinkedid']];}}};Preview[_0x7cca('0xf')][_0x7cca('0xf9')]=function(_0xca68f4,_0x306804,_0x501f7b){if(_[_0x7cca('0xfa')](_0x306804)&&_0x7cca('0xfb')!==typeof _0x306804){return;}if(_[_0x7cca('0xfa')](_0x501f7b)&&_0x7cca('0xfb')!==typeof _0x501f7b){return;}switch(_0x501f7b[_0x7cca('0xfc')]){case'0':ut[_0x7cca('0xfd')](_0xca68f4,0x0,_0x7cca('0xa1'));rpcDb[_0x7cca('0xfe')](_0xca68f4,_0x7cca('0xff'));break;case'3':ut[_0x7cca('0xfd')](_0xca68f4,0x3,'NoAnswer');rpcDb[_0x7cca('0xfe')](_0xca68f4,_0x7cca('0x100'));break;case'5':ut[_0x7cca('0xfd')](_0xca68f4,0x5,_0x7cca('0x101'));rpcDb['createAgentHistory'](_0xca68f4,_0x7cca('0x102'));break;case'8':ut[_0x7cca('0xfd')](_0xca68f4,0x8,_0x7cca('0xd9'));rpcDb[_0x7cca('0xfe')](_0xca68f4,_0x7cca('0x103'));break;case'22':ut[_0x7cca('0xfd')](_0xca68f4,0x16,'AnswerAGI');rpcDb[_0x7cca('0xfe')](_0xca68f4,_0x7cca('0x104'));break;default:ut[_0x7cca('0xfd')](_0xca68f4,0xc,_0x501f7b[_0x7cca('0xfc')]);rpcDb[_0x7cca('0xfe')](_0xca68f4,_0x7cca('0x103'));}ut[_0x7cca('0x7c')](_0x306804,_0x7cca('0x105'));logger['info'](_0x7cca('0x106'),_0xca68f4[_0x7cca('0xb7')],_0x7cca('0xc5'),_0x306804[_0x7cca('0x29')],_0x7cca('0x6f'),_0x306804[_0x7cca('0x5e')]);delete this[_0x7cca('0x6c')][_0xca68f4[_0x7cca('0xb7')]];};Preview[_0x7cca('0xf')][_0x7cca('0xa5')]=function(_0x91c062,_0x2d6e5b,_0x5507f6){return BPromise['resolve']()['then'](cmHopperAdditionalPhone[_0x7cca('0xa5')](_0x91c062,_0x2d6e5b,_0x5507f6))[_0x7cca('0x7a')](logger[_0x7cca('0x58')](_0x7cca('0x107')));};Preview[_0x7cca('0xf')][_0x7cca('0xcf')]=function(_0x2054ea,_0x5e45b0,_0x76bc17){return BPromise['resolve']()['then'](cmHopperAdditionalPhone['swapAdditionalPhones'](_0x2054ea,_0x5e45b0,_0x76bc17))[_0x7cca('0x7a')](logger['info']('[swapAdditionalPhone]\x20'));};Preview['prototype'][_0x7cca('0xb2')]=function(_0x469c72){return BPromise[_0x7cca('0x108')]()[_0x7cca('0x84')](cmHopperAdditionalPhone[_0x7cca('0xb2')](_0x469c72))[_0x7cca('0x7a')](logger[_0x7cca('0x58')](_0x7cca('0x109')));};Preview[_0x7cca('0xf')][_0x7cca('0x10a')]=function(_0x16ba22,_0x5ee4e5,_0x134d21,_0x49e85e,_0xb6b531){var _0x318162=this;return new BPromise(function(_0x1664b7,_0x1dca35){if(_[_0x7cca('0x6b')](_0x5ee4e5)||_[_0x7cca('0x6b')](_0x5ee4e5['Contact'])||_[_0x7cca('0x6b')](_0x5ee4e5[_0x7cca('0x10b')])||_[_0x7cca('0x6b')](_0x5ee4e5['VoiceQueueId'])){_0x1dca35(ut[_0x7cca('0x4e')](_0x7cca('0x10c'),_0x49e85e,_0xb6b531));return;}var _0xffde5c=uuid['v4']();var _0x412ad1=_0x318162[_0x7cca('0x25')][_0x5ee4e5['Queue'][_0x7cca('0x29')]];var _0xd8ea1c=_0x134d21?_0x318162[_0x7cca('0x16')][_0x134d21]['id']:undefined;_0x318162['actions'][_0xffde5c]=new Action(_0x5ee4e5,_0x412ad1,_0xffde5c,_0x134d21,_0xd8ea1c);var _0x3abdb5=_0x318162['actions'][_0xffde5c];_0x3abdb5[_0x7cca('0xaf')]=_0x49e85e;_0x3abdb5[_0x7cca('0xce')]=_0xb6b531;_0x3abdb5[_0x7cca('0x10d')]=_0x134d21;if(_[_0x7cca('0x10e')](_0x16ba22)){_0x318162['execCall'](_0x3abdb5,_0x412ad1,_0x5ee4e5,_0x134d21)[_0x7cca('0x84')](function(_0x2caa03){logger['info'](_0x7cca('0x10f'),'Queue:\x20'+_0x3abdb5['queue']+_0x7cca('0x110')+_0x3abdb5[_0x7cca('0xb1')],JSON[_0x7cca('0x5a')](_0x2caa03));ami[_0x7cca('0x26')](_0x7cca('0x111'),ut[_0x7cca('0xb8')](_0x3abdb5,_0x7cca('0x112'),_0x318162[_0x7cca('0x25')][_0x3abdb5['queue']]));_0x1664b7(ut['message']('Calling'));})[_0x7cca('0x7a')](function(_0xad2d7d){ut[_0x7cca('0x61')]('[Preview][execCall][failure]',_0xad2d7d);_0x1dca35(ut[_0x7cca('0x4e')](_0x7cca('0x113'),_0x49e85e,_0xb6b531));});}else{_0x412ad1[_0x7cca('0x3c')]+=0x1;ut['logBlacklist'](_0x3abdb5);rpcDb[_0x7cca('0x114')](_0x3abdb5,_0x7cca('0x115'));delete _0x318162[_0x7cca('0x6c')][_0xffde5c];_0x1dca35(ut[_0x7cca('0x4e')]('Contact\x20in\x20black\x20List',_0x49e85e,_0xb6b531));}});};Preview[_0x7cca('0xf')][_0x7cca('0x9a')]=function(_0x43f855){return!_[_0x7cca('0x6b')](_0x43f855)&&!_[_0x7cca('0x6b')](_0x43f855[_0x7cca('0x29')])&&!_[_0x7cca('0x6b')](_0x43f855[_0x7cca('0x53')])&&_0x43f855[_0x7cca('0x53')]&&!_[_0x7cca('0x6b')](this[_0x7cca('0x15')][util[_0x7cca('0x57')](_0x7cca('0x116'),_0x43f855[_0x7cca('0x29')])])&&!_['isNil'](this[_0x7cca('0x15')][util[_0x7cca('0x57')](_0x7cca('0x116'),_0x43f855[_0x7cca('0x29')])][_0x7cca('0x78')])&&(this[_0x7cca('0x15')][util[_0x7cca('0x57')](_0x7cca('0x116'),_0x43f855[_0x7cca('0x29')])]['status']===_0x7cca('0x117')||this[_0x7cca('0x15')][util[_0x7cca('0x57')](_0x7cca('0x116'),_0x43f855[_0x7cca('0x29')])][_0x7cca('0x78')]==='unmonitored');};Preview[_0x7cca('0xf')]['run']=function(_0x4878a5,_0x1ee727){var _0x4c21d4=this;return new BPromise(function(_0x5f0a38,_0x1111a9){_0x4c21d4[_0x7cca('0x118')](_0x4878a5,_0x1ee727)[_0x7cca('0x84')](function(_0xd1bb46){_0x5f0a38(_[_0x7cca('0x72')](_0xd1bb46,[_0x7cca('0x4e')]));})[_0x7cca('0x7a')](function(_0x1f7260){if(_0x1f7260[_0x7cca('0x119')]){rpcDb['unlockContact'](_0x4878a5);}if(_0x1f7260[_0x7cca('0x53')]){rpcDb[_0x7cca('0x8d')](_0x4878a5);}_0x1111a9(_[_0x7cca('0x72')](_0x1f7260,[_0x7cca('0x4e')]));});});};Preview[_0x7cca('0xf')][_0x7cca('0x118')]=function(_0x36316b,_0x1629c0){var _0x360223=this;return new BPromise(function(_0x14246b,_0x37903a){var _0x5cebc1,_0x1e5b6d;rpcDb['getContactPreview'](_0x36316b)[_0x7cca('0x84')](function(_0xd93029){if(!_['isNil'](_0xd93029[0x0])){_0x1e5b6d=_0xd93029[0x0]['recallme']?![]:!![];_0x5cebc1=_0xd93029[0x0][_0x7cca('0x11a')]?!![]:![];_0x5cebc1=_0x1629c0?!![]:_0x5cebc1;}var _0x272b48=_0x360223[_0x7cca('0x11b')](_0xd93029);if(_0x272b48[_0x7cca('0x11c')]){rpcDb[_0x7cca('0x11d')](_[_0x7cca('0x72')](_0xd93029[0x0],[_0x7cca('0x75'),_0x7cca('0x10b')]))[_0x7cca('0x84')](function(_0x153b40){_0x360223[_0x7cca('0x10a')](_0x153b40,_0xd93029[0x0],_0x1629c0,_0x1e5b6d,_0x5cebc1)['then'](function(_0x9cfecc){_0x14246b(_0x9cfecc);})[_0x7cca('0x7a')](function(_0x28d1e9){_0x37903a(_0x28d1e9);});})['catch'](function(_0x4a25f1){ut[_0x7cca('0x61')](_0x7cca('0x11e'),_0x4a25f1);_0x37903a(ut['message']('Call\x20unsuccessful',_0x1e5b6d,_0x5cebc1));});}else{_0x37903a(ut['message'](_0x272b48[_0x7cca('0x4e')],_0x1e5b6d,_0x5cebc1));}})['catch'](function(_0xb578d1){ut[_0x7cca('0x61')](_0x7cca('0x11f'),_0xb578d1);_0x37903a(ut[_0x7cca('0x4e')]('Call\x20unsuccessful',![],!![]));});});};Preview[_0x7cca('0xf')][_0x7cca('0x11b')]=function(_0x125589){if(_[_0x7cca('0x6b')](_0x125589)||_[_0x7cca('0x10e')](_0x125589)||!_['isNil'](_0x125589[0x0][_0x7cca('0x120')])&&_['isNil'](_0x125589[0x0]['Agent'][_0x7cca('0x29')])){ut[_0x7cca('0x61')](_0x7cca('0x121'),_0x125589);return{'isValid':![],'message':_0x7cca('0x122')};}var _0x54d7bb=this[_0x7cca('0x25')][_0x125589[0x0][_0x7cca('0x123')][_0x7cca('0x29')]];_0x54d7bb[_0x7cca('0x4e')]='ACTIVE';if(_[_0x7cca('0x6b')](_0x54d7bb)){ut[_0x7cca('0x61')](_0x7cca('0x124'),_0x54d7bb);return{'isValid':![],'message':_0x7cca('0x125')};}if(!this[_0x7cca('0x9a')](_0x54d7bb[_0x7cca('0x52')])){ut[_0x7cca('0x61')](_0x7cca('0x126'),'campaign\x20Name:\x20'+_0x54d7bb[_0x7cca('0x29')]+_0x7cca('0x127'));if(!this[_0x7cca('0x9a')](_0x54d7bb['TrunkBackup'])){ut['logger'](_0x7cca('0x126'),_0x54d7bb[_0x7cca('0x29')]+_0x7cca('0x128'));return{'isValid':![],'message':_0x7cca('0x129')};}}if(!ut[_0x7cca('0x12a')](_0x54d7bb[_0x7cca('0x37')])){ut['logger'](_0x7cca('0x12b'),_0x54d7bb[_0x7cca('0x29')]+_0x7cca('0x12c'));return{'isValid':![],'message':_0x7cca('0x12d')+_0x54d7bb[_0x7cca('0x29')]+_0x7cca('0x12c')};}return{'isValid':!![],'message':_0x7cca('0x12e')};};Preview['prototype'][_0x7cca('0x12f')]=function(_0x3fcadd,_0x4f00fd,_0x1d83d4,_0x44c065){var _0x2453fe=this;return new BPromise(function(_0x4ba3a0,_0x300aa4){var _0x2054ae=_0x3fcadd[_0x7cca('0xb7')];var _0x32dc2f=_0x2453fe['isTrunkReachable'](_0x4f00fd[_0x7cca('0x52')])?util['format']('SIP/%s/%s%s',_0x4f00fd[_0x7cca('0x52')][_0x7cca('0x29')],_['isNil'](_0x4f00fd[_0x7cca('0x3a')])?'':_0x4f00fd[_0x7cca('0x3a')][_0x7cca('0x130')]()||'',_0x4f00fd[_0x7cca('0x131')]>0x0?_0x1d83d4[_0x7cca('0x10b')][_0x7cca('0x132')](_0x4f00fd[_0x7cca('0x131')]):_0x1d83d4[_0x7cca('0x10b')]):util['format']('SIP/%s/%s%s',_[_0x7cca('0x6b')](_0x4f00fd[_0x7cca('0x9b')])?_0x4f00fd[_0x7cca('0x52')][_0x7cca('0x29')]:_0x4f00fd[_0x7cca('0x9b')][_0x7cca('0x29')],_[_0x7cca('0x6b')](_0x4f00fd[_0x7cca('0x3a')])?'':_0x4f00fd[_0x7cca('0x3a')][_0x7cca('0x130')]()||'',_0x4f00fd[_0x7cca('0x131')]>0x0?_0x1d83d4[_0x7cca('0x10b')][_0x7cca('0x132')](_0x4f00fd[_0x7cca('0x131')]):_0x1d83d4[_0x7cca('0x10b')]);var _0x15de8c=_0x2453fe['isTrunkReachable'](_0x4f00fd['Trunk'])?ut[_0x7cca('0x133')](_0x4f00fd[_0x7cca('0x52')][_0x7cca('0x54')],_0x4f00fd[_0x7cca('0x38')],_0x4f00fd['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x7cca('0x134')](_0x4f00fd[_0x7cca('0x135')],_0x4f00fd[_0x7cca('0x136')]):_0x4f00fd[_0x7cca('0x135')]):ut[_0x7cca('0x133')](_[_0x7cca('0x6b')](_0x4f00fd['TrunkBackup'])?_0x4f00fd[_0x7cca('0x52')][_0x7cca('0x54')]:_0x4f00fd[_0x7cca('0x9b')][_0x7cca('0x54')],_0x4f00fd['dialOriginateCallerIdName'],_0x4f00fd[_0x7cca('0x136')]>0x0?ut['getCallerIdRandom'](_0x4f00fd[_0x7cca('0x135')],_0x4f00fd[_0x7cca('0x136')]):_0x4f00fd['dialOriginateCallerIdNumber']);if(_0x15de8c){_0x3fcadd[_0x7cca('0x137')]=ut[_0x7cca('0x138')](_0x15de8c);_0x3fcadd[_0x7cca('0x139')]=ut[_0x7cca('0x13a')](_0x15de8c);}var _0x89991a=ut['addVariables'](_0x4f00fd,_0x1d83d4,_0x32dc2f,_0x15de8c,_0x2054ae,_0x3fcadd);_['merge'](_0x3fcadd,ut['toLowerVariables'](_0x89991a));_0x3fcadd[_0x7cca('0x8e')]=moment()[_0x7cca('0x57')](_0x7cca('0x8f'));ami[_0x7cca('0x77')](ut[_0x7cca('0x13b')](_0x3fcadd,_0x4f00fd,_0x89991a,_0x3fcadd[_0x7cca('0xce')],_0x44c065))[_0x7cca('0x84')](function(_0x45602d){_0x4f00fd[_0x7cca('0x5e')]+=0x1;logger[_0x7cca('0x58')]('[originated][increment]',_0x2054ae,_0x7cca('0xc5'),_0x4f00fd['name'],'originated:\x20',_0x4f00fd[_0x7cca('0x5e')]);_0x4ba3a0(_0x45602d);})[_0x7cca('0x7a')](function(_0x113be6){ut['logAgent'](_0x3fcadd,0xe,_0x7cca('0x13c'));rpcDb['createAgentHistory'](_0x3fcadd,'[originateFailure][logOriginateFailure]');_0x300aa4(_0x113be6);});});};Preview[_0x7cca('0xf')][_0x7cca('0x20')]=function(_0x41004e){if(this[_0x7cca('0x6c')][_0x41004e[_0x7cca('0xc6')]]){this[_0x7cca('0x6c')][_0x41004e[_0x7cca('0xc6')]][_0x7cca('0x79')]=_0x41004e['channel'];}};Preview[_0x7cca('0xf')][_0x7cca('0x19')]=function(_0x465404){var _0x5beb66=this;var _0x2eb48a=this[_0x7cca('0x6c')][_0x465404['actionid']];if(_0x2eb48a){if(_0x2eb48a[_0x7cca('0x10d')]&&this[_0x7cca('0x16')][_0x2eb48a[_0x7cca('0x10d')]]){ut[_0x7cca('0x13d')](_0x2eb48a,this['agents'][_0x2eb48a[_0x7cca('0x10d')]][_0x7cca('0x29')],this[_0x7cca('0x16')][_0x2eb48a[_0x7cca('0x10d')]]['id']);}var _0x29dc6d=_[_0x7cca('0x13e')](_0x2eb48a);_0x29dc6d[_0x7cca('0xb4')]=moment()[_0x7cca('0x57')](_0x7cca('0x8f'));var _0xc1f13e=_0x5beb66['campaignsPreview'][_0x2eb48a[_0x7cca('0x6e')]];if(ut[_0x7cca('0x13f')](_0x465404[_0x7cca('0x140')])){if(_0x2eb48a[_0x7cca('0xaf')]){rpcDb[_0x7cca('0x141')](_0x2eb48a[_0x7cca('0xb1')]);}if(_0x2eb48a['activeContact']){rpcDb[_0x7cca('0x8d')](_0x2eb48a[_0x7cca('0xb1')]);}ami[_0x7cca('0x26')](_0x7cca('0x142'),ut[_0x7cca('0xb8')](_0x2eb48a,_0x7cca('0x143'),this[_0x7cca('0x25')][_0x2eb48a[_0x7cca('0x6e')]]));this['callProgressDetectingAgent'](_0x29dc6d,_0xc1f13e,_0x465404);}else{_0x2eb48a['starttime']=moment()[_0x7cca('0x57')](_0x7cca('0x8f'));ut[_0x7cca('0xfd')](_0x29dc6d,0x4,'Answer');rpcDb[_0x7cca('0xfe')](_0x29dc6d,_0x7cca('0x144'));}}};Preview[_0x7cca('0xf')][_0x7cca('0x1c')]=function(_0x295997){var _0x3de23b=this;var _0x4731de=this['actions'][_0x295997[_0x7cca('0xc6')]];var _0x2ce5fb;if(_0x4731de){_0x2ce5fb=this[_0x7cca('0x25')][_0x4731de['queue']];logger[_0x7cca('0x58')]('[syncHangup][talking]',_0x295997[_0x7cca('0xc6')],_0x7cca('0xc5'),_0x2ce5fb[_0x7cca('0x29')],_0x7cca('0x70'),_0x2ce5fb['pTalking']);}if(this[_0x7cca('0x6c')][_0x295997['linkedid']]&&_0x295997['linkedid']!==_0x295997[_0x7cca('0xb7')]){if(_0x295997[_0x7cca('0x145')]==='16'&&this[_0x7cca('0x6c')][_0x295997[_0x7cca('0xc6')]][_0x7cca('0x71')]){this[_0x7cca('0x146')](_0x295997,_0x295997[_0x7cca('0xc6')],_0x295997['cause']);}else if(this['actions'][_0x295997['linkedid']][_0x7cca('0x71')]){logger[_0x7cca('0x58')]('[syncHangup][talking][cause]',_0x295997[_0x7cca('0xc6')],_0x295997[_0x7cca('0x145')],_0x7cca('0xc5'),_0x2ce5fb['name'],_0x7cca('0x70'),_0x2ce5fb[_0x7cca('0x2e')]);this[_0x7cca('0x146')](_0x295997,_0x295997[_0x7cca('0xc6')],_0x295997[_0x7cca('0x145')]);}}else if(_0x4731de&&_[_0x7cca('0x6b')](_0x4731de[_0x7cca('0x147')])&&_0x2ce5fb[_0x7cca('0x148')]&&_0x295997[_0x7cca('0xc6')]===_0x295997['uniqueid']&&_[_0x7cca('0x6b')](_0x295997[_0x7cca('0xfc')])&&_0x295997[_0x7cca('0x145')]==='16'&&_0x295997[_0x7cca('0x149')]==='6'&&_['isUndefined'](_0x4731de[_0x7cca('0x14a')])){if(_0x4731de['unlockAgent']){rpcDb['unlockContact'](_0x4731de[_0x7cca('0xb1')]);}if(_0x4731de[_0x7cca('0xce')]){rpcDb[_0x7cca('0x8d')](_0x4731de['idContact']);}_0x295997[_0x7cca('0xfc')]='22';this['callProgressDetectingAgent'](_0x4731de,_0x2ce5fb,_0x295997);}else if(_0x4731de&&_0x4731de[_0x7cca('0x14a')]){if(_0x295997[_0x7cca('0x145')]==='16'&&this['actions'][_0x295997[_0x7cca('0xc6')]]['dialAnswer']){logger[_0x7cca('0x58')](_0x7cca('0x14b'),_0x295997[_0x7cca('0xc6')],_0x295997['cause'],_0x7cca('0xc5'),_0x2ce5fb[_0x7cca('0x29')],'pTalking:\x20',_0x2ce5fb[_0x7cca('0x2e')]);this[_0x7cca('0x146')](_0x295997,_0x295997['linkedid'],_0x295997[_0x7cca('0x145')]);}else if(this[_0x7cca('0x6c')][_0x295997['linkedid']][_0x7cca('0x71')]){logger[_0x7cca('0x58')](_0x7cca('0x14c'),_0x295997['linkedid'],_0x295997[_0x7cca('0x145')],_0x7cca('0xc5'),_0x2ce5fb[_0x7cca('0x29')],_0x7cca('0x70'),_0x2ce5fb[_0x7cca('0x2e')]);this[_0x7cca('0x146')](_0x295997,_0x295997[_0x7cca('0xc6')],_0x295997[_0x7cca('0x145')]);}}};Preview['prototype'][_0x7cca('0x1e')]=function(_0x162e32){if(this[_0x7cca('0x6c')][_0x162e32[_0x7cca('0x14d')]]&&_0x162e32['destlinkedid']!==_0x162e32[_0x7cca('0x14e')]){this[_0x7cca('0x146')](_0x162e32,_0x162e32[_0x7cca('0x14d')],_0x162e32[_0x7cca('0xef')]);}};Preview[_0x7cca('0xf')][_0x7cca('0x14f')]=function(_0x3a8dcc){if(this[_0x7cca('0x6c')][_0x3a8dcc[_0x7cca('0xc6')]]&&_0x3a8dcc[_0x7cca('0xc6')]!==_0x3a8dcc['uniqueid']&&!this[_0x7cca('0x6c')][_0x3a8dcc['linkedid']]['dialAnswer']){if(_0x3a8dcc[_0x7cca('0x145')]==='1'){this[_0x7cca('0x146')](_0x3a8dcc,_0x3a8dcc[_0x7cca('0xc6')],_0x3a8dcc[_0x7cca('0x145')]);}}};Preview[_0x7cca('0xf')][_0x7cca('0x150')]=function(_0x5d46ed,_0x44d294,_0x5b5888){if(this[_0x7cca('0x6c')][_0x5d46ed]){if(_[_0x7cca('0x6b')](this[_0x7cca('0x6c')][_0x5d46ed][_0x7cca('0x151')])){this[_0x7cca('0x6c')][_0x5d46ed][_0x7cca('0x151')]={};}this['actions'][_0x5d46ed][_0x7cca('0x151')][_0x44d294]=_0x5b5888;}};Preview[_0x7cca('0xf')][_0x7cca('0x21')]=function(_0xcac915){try{if(!_[_0x7cca('0x6b')](_0xcac915)){if(ut['filterKey'](_[_0x7cca('0x152')](_0xcac915['variable'])[0x0])){this[_0x7cca('0x150')](_0xcac915[_0x7cca('0xb7')],_['keys'](_0xcac915[_0x7cca('0x153')])[0x0],_0xcac915[_0x7cca('0x154')]);}}}catch(_0x2a2cc7){logger['error'](_0x7cca('0x155'),util[_0x7cca('0x156')](_0x2a2cc7,{'showHidden':![],'depth':null}));}};Preview[_0x7cca('0xf')][_0x7cca('0x157')]=function(_0x1774c5){if(_0x1774c5){if(this[_0x7cca('0x6c')][_0x1774c5['transfertargetlinkedid']]){this[_0x7cca('0x6c')][_0x1774c5[_0x7cca('0x158')]][_0x7cca('0x14a')]=!![];}}};Preview[_0x7cca('0xf')][_0x7cca('0x23')]=function(_0x5e9734){if(_0x5e9734){if(this[_0x7cca('0x6c')][_0x5e9734[_0x7cca('0x159')]]){this[_0x7cca('0x6c')][_0x5e9734['transfererlinkedid']][_0x7cca('0x14a')]=!![];}}};module[_0x7cca('0x15a')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index d0b93e2..a0bdb8e 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 _0x6335=['holdtime','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','util','preview','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/voiceQueueReport','error','resolve','then','createHistory','catch','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercompleteAt','endtime','connectedlinename','membername','context','exten','xcally-motion-preview'];(function(_0x12480f,_0x47263a){var _0x355d85=function(_0x2e8ec1){while(--_0x2e8ec1){_0x12480f['push'](_0x12480f['shift']());}};_0x355d85(++_0x47263a);}(_0x6335,0x1f2));var _0x5633=function(_0x540cfe,_0x14f115){_0x540cfe=_0x540cfe-0x0;var _0x170686=_0x6335[_0x540cfe];return _0x170686;};'use strict';var util=require(_0x5633('0x0'));var BPromise=require('bluebird');var logger=require('../../../config/logger')(_0x5633('0x1'));var _=require('lodash');var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x5633('0x2'));var cmHopperBlack=require(_0x5633('0x3'));var voiceQueueRt=require(_0x5633('0x4'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x5633('0x5'));function loggerCatch(_0x1b3ef6){return function(_0x1f2589){logger[_0x5633('0x6')](_0x1b3ef6,util['inspect'](_0x1f2589,{'showHidden':![],'depth':null}));};}function create(_0x2fefbf){return BPromise[_0x5633('0x7')]()[_0x5633('0x8')](cmHopperHistory['createHistory'](_0x2fefbf))['catch'](loggerCatch('[createHistory]\x20'));}function createAgent(_0x154e81){return BPromise['resolve']()['then'](agentReportPreview[_0x5633('0x9')](_0x154e81))[_0x5633('0xa')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x53c2c7){return BPromise[_0x5633('0x7')]()[_0x5633('0x8')](cmHopper[_0x5633('0xb')](_0x53c2c7,!![]))[_0x5633('0xa')](loggerCatch(_0x5633('0xc')));}exports['checkIsBlackList']=function(_0x223df7){return BPromise[_0x5633('0x7')]()[_0x5633('0x8')](cmHopperBlack[_0x5633('0xd')](_0x223df7))['catch'](loggerCatch(_0x5633('0xe')));};exports[_0x5633('0xf')]=function(_0x11d032){return BPromise['resolve']()[_0x5633('0x8')](cmHopper[_0x5633('0xf')](_0x11d032))[_0x5633('0xa')](loggerCatch(_0x5633('0x10')));};exports['createHistory']=function(_0x570b75,_0x1c8215){create(_0x570b75)[_0x5633('0xa')](loggerCatch(_0x1c8215));moveContact(_0x570b75)[_0x5633('0xa')](loggerCatch(_0x1c8215));};exports[_0x5633('0x11')]=function(_0x580da2,_0xda710c){createAgent(_0x580da2)[_0x5633('0xa')](loggerCatch(_0xda710c));};exports[_0x5633('0x12')]=function(_0x140063,_0x499cf4){create(_0x140063)[_0x5633('0xa')](loggerCatch(_0x499cf4));};exports[_0x5633('0x13')]=function(_0x5cc6b9,_0x1168dc){moveContact(_0x5cc6b9)[_0x5633('0xa')](loggerCatch(_0x1168dc));};exports[_0x5633('0x14')]=function(_0x19a97c,_0xa3110,_0x327e5e){if(_0xa3110){_0x19a97c[_0x5633('0x15')]=null;}if(_0x327e5e){_0x19a97c['active']=![];}return BPromise[_0x5633('0x7')]()['then'](cmHopper[_0x5633('0x14')](_0x19a97c))[_0x5633('0xa')](loggerCatch(_0x5633('0x16')));};exports[_0x5633('0x17')]=function(_0x34cbae){return BPromise['resolve']()[_0x5633('0x8')](cmHopper[_0x5633('0x17')](_0x34cbae))['catch'](loggerCatch('[countReScheduled]\x20'));};exports[_0x5633('0x18')]=function(_0x4a216c){return BPromise[_0x5633('0x7')]()[_0x5633('0x8')](cmHopper[_0x5633('0x18')]({'UserId':null},_0x4a216c,0x1))[_0x5633('0xa')](loggerCatch(_0x5633('0x19')));};exports['disableContact']=function(_0x21b284){return BPromise['resolve']()[_0x5633('0x8')](cmHopper['unlockContact']({'active':![]},_0x21b284,0x1))[_0x5633('0xa')](loggerCatch('[activeContact]\x20'));};exports[_0x5633('0x1a')]=function(_0x1b95b4){var _0x37fabb={};_0x37fabb[_0x5633('0x1b')]=_0x1b95b4[_0x5633('0x1b')];_0x37fabb[_0x5633('0x1c')]=_0x1b95b4['uniqueid'];_0x37fabb[_0x5633('0x1d')]=_0x1b95b4[_0x5633('0x1d')];_0x37fabb[_0x5633('0x1e')]=_0x1b95b4[_0x5633('0x1e')];_0x37fabb[_0x5633('0x1f')]=_0x1b95b4[_0x5633('0x1f')];_0x37fabb[_0x5633('0x20')]=_0x1b95b4[_0x5633('0x21')];_0x37fabb['queuecallerleaveAt']=_0x1b95b4[_0x5633('0x21')];_0x37fabb['queuecallercomplete']=0x1;_0x37fabb[_0x5633('0x22')]=_0x1b95b4[_0x5633('0x23')];_0x37fabb[_0x5633('0x24')]=_0x1b95b4[_0x5633('0x25')];_0x37fabb[_0x5633('0x26')]='from-sip';_0x37fabb[_0x5633('0x27')]=_0x5633('0x28');_0x37fabb[_0x5633('0x29')]=0x0;_0x37fabb['assigned']=0x1;_0x37fabb['lastAssignedTo']=_0x1b95b4[_0x5633('0x25')];_0x37fabb[_0x5633('0x2a')]=_0x5633('0x2b');return BPromise[_0x5633('0x7')]()[_0x5633('0x8')](voiceQueueReport[_0x5633('0x2c')](_0x37fabb))['catch'](loggerCatch(_0x5633('0x2d')));};exports[_0x5633('0x2e')]=function(_0x4e1c90,_0x4a434a){return BPromise['resolve']()[_0x5633('0x8')](cmHopper['getContactRecallMe'](_0x4e1c90,_0x4a434a))[_0x5633('0xa')](loggerCatch(_0x5633('0x2f')));};exports['rescheduleContactInQueue']=function(_0x56f851){return BPromise[_0x5633('0x7')]()[_0x5633('0x8')](cmHopper[_0x5633('0x14')](_0x56f851,!![],!![]))['catch'](loggerCatch(_0x5633('0x30')));}; \ No newline at end of file +var _0x7ecd=['queuecallerexitreason','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','error','inspect','resolve','createHistory','catch','[createHistory]\x20','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned'];(function(_0x5ebbfc,_0x1596c2){var _0x5d6a32=function(_0x4351af){while(--_0x4351af){_0x5ebbfc['push'](_0x5ebbfc['shift']());}};_0x5d6a32(++_0x1596c2);}(_0x7ecd,0x1f3));var _0xd7ec=function(_0x399433,_0x468672){_0x399433=_0x399433-0x0;var _0x1eb1a8=_0x7ecd[_0x399433];return _0x1eb1a8;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0xd7ec('0x0'))(_0xd7ec('0x1'));var _=require(_0xd7ec('0x2'));var cmHopper=require(_0xd7ec('0x3'));var cmHopperFinal=require(_0xd7ec('0x4'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xd7ec('0x5'));var voiceQueueRt=require(_0xd7ec('0x6'));var agentReportPreview=require(_0xd7ec('0x7'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x2bd09d){return function(_0x4126cd){logger[_0xd7ec('0x8')](_0x2bd09d,util[_0xd7ec('0x9')](_0x4126cd,{'showHidden':![],'depth':null}));};}function create(_0x21039e){return BPromise[_0xd7ec('0xa')]()['then'](cmHopperHistory[_0xd7ec('0xb')](_0x21039e))[_0xd7ec('0xc')](loggerCatch(_0xd7ec('0xd')));}function createAgent(_0xecef96){return BPromise[_0xd7ec('0xa')]()[_0xd7ec('0xe')](agentReportPreview['createHistory'](_0xecef96))['catch'](loggerCatch(_0xd7ec('0xd')));}function moveContact(_0x5b3bb7){return BPromise[_0xd7ec('0xa')]()[_0xd7ec('0xe')](cmHopper[_0xd7ec('0xf')](_0x5b3bb7,!![]))[_0xd7ec('0xc')](loggerCatch(_0xd7ec('0x10')));}exports[_0xd7ec('0x11')]=function(_0x18b290){return BPromise[_0xd7ec('0xa')]()['then'](cmHopperBlack['checkIsBlackList'](_0x18b290))[_0xd7ec('0xc')](loggerCatch(_0xd7ec('0x12')));};exports[_0xd7ec('0x13')]=function(_0x2bef60){return BPromise[_0xd7ec('0xa')]()[_0xd7ec('0xe')](cmHopper['getContactPreview'](_0x2bef60))[_0xd7ec('0xc')](loggerCatch('[getContactPreview]\x20'));};exports[_0xd7ec('0xb')]=function(_0x4ea353,_0x25ff20){create(_0x4ea353)[_0xd7ec('0xc')](loggerCatch(_0x25ff20));moveContact(_0x4ea353)[_0xd7ec('0xc')](loggerCatch(_0x25ff20));};exports[_0xd7ec('0x14')]=function(_0x366c72,_0x235265){createAgent(_0x366c72)[_0xd7ec('0xc')](loggerCatch(_0x235265));};exports['createCustomerHistory']=function(_0x9624e3,_0x207543){create(_0x9624e3)[_0xd7ec('0xc')](loggerCatch(_0x207543));};exports[_0xd7ec('0x15')]=function(_0x35e133,_0x4c5fdd){moveContact(_0x35e133)[_0xd7ec('0xc')](loggerCatch(_0x4c5fdd));};exports[_0xd7ec('0x16')]=function(_0x54f5d5,_0x5986be,_0x1329e0){if(_0x5986be){_0x54f5d5[_0xd7ec('0x17')]=null;}if(_0x1329e0){_0x54f5d5[_0xd7ec('0x18')]=![];}return BPromise[_0xd7ec('0xa')]()[_0xd7ec('0xe')](cmHopper[_0xd7ec('0x16')](_0x54f5d5))[_0xd7ec('0xc')](loggerCatch(_0xd7ec('0x19')));};exports[_0xd7ec('0x1a')]=function(_0x8271e9){return BPromise[_0xd7ec('0xa')]()[_0xd7ec('0xe')](cmHopper[_0xd7ec('0x1a')](_0x8271e9))['catch'](loggerCatch(_0xd7ec('0x1b')));};exports[_0xd7ec('0x1c')]=function(_0x5b611b){return BPromise['resolve']()[_0xd7ec('0xe')](cmHopper[_0xd7ec('0x1c')]({'UserId':null},_0x5b611b,0x1))['catch'](loggerCatch(_0xd7ec('0x1d')));};exports['disableContact']=function(_0x127b38){return BPromise[_0xd7ec('0xa')]()[_0xd7ec('0xe')](cmHopper[_0xd7ec('0x1c')]({'active':![]},_0x127b38,0x1))[_0xd7ec('0xc')](loggerCatch(_0xd7ec('0x1e')));};exports[_0xd7ec('0x1f')]=function(_0x494b74){var _0x2a6c7d={};_0x2a6c7d['type']=_0x494b74[_0xd7ec('0x20')];_0x2a6c7d[_0xd7ec('0x21')]=_0x494b74[_0xd7ec('0x21')];_0x2a6c7d[_0xd7ec('0x22')]=_0x494b74[_0xd7ec('0x22')];_0x2a6c7d[_0xd7ec('0x23')]=_0x494b74['calleridname'];_0x2a6c7d['queue']=_0x494b74[_0xd7ec('0x24')];_0x2a6c7d[_0xd7ec('0x25')]=_0x494b74[_0xd7ec('0x26')];_0x2a6c7d[_0xd7ec('0x27')]=_0x494b74[_0xd7ec('0x26')];_0x2a6c7d[_0xd7ec('0x28')]=0x1;_0x2a6c7d[_0xd7ec('0x29')]=_0x494b74[_0xd7ec('0x2a')];_0x2a6c7d[_0xd7ec('0x2b')]=_0x494b74[_0xd7ec('0x2c')];_0x2a6c7d[_0xd7ec('0x2d')]=_0xd7ec('0x2e');_0x2a6c7d[_0xd7ec('0x2f')]=_0xd7ec('0x30');_0x2a6c7d[_0xd7ec('0x31')]=0x0;_0x2a6c7d[_0xd7ec('0x32')]=0x1;_0x2a6c7d['lastAssignedTo']=_0x494b74['membername'];_0x2a6c7d[_0xd7ec('0x33')]='COMPLETED';return BPromise['resolve']()[_0xd7ec('0xe')](voiceQueueReport['create'](_0x2a6c7d))[_0xd7ec('0xc')](loggerCatch(_0xd7ec('0x34')));};exports[_0xd7ec('0x35')]=function(_0x4ead68,_0x52cafa){return BPromise[_0xd7ec('0xa')]()[_0xd7ec('0xe')](cmHopper[_0xd7ec('0x35')](_0x4ead68,_0x52cafa))[_0xd7ec('0xc')](loggerCatch(_0xd7ec('0x36')));};exports['rescheduleContactInQueue']=function(_0x40e03d){return BPromise[_0xd7ec('0xa')]()[_0xd7ec('0xe')](cmHopper['rescheduleContact'](_0x40e03d,!![],!![]))['catch'](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index 1fd2193..bec5c45 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 _0x9497=['lastevent','queue','interface','channelAgent','motionChannel','mandatoryDisposition','buildAcw','agentReadyId','not_inuse','status','reachable','push','getDiff','createBody','ListId','CampaignId','type','campaigntype','dialAnswer','scheduledat','countglobal','callback','callbackat','UserId','sipcallid','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','extractCalleridName','match','lodash','moment','../../../../config/logger','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','loggerError','logger2','info','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','dialer','VoiceQueueId','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','createdAt','updatedAt','%s%s','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','logAgent','ringtime','membername','logCustomer','endtime','talktime','answertime','isFailure','BOOKED','uniqueid','originate','from-sip','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','cloneAction','clone','Global','add','minutes','ContactId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj'];(function(_0x28192b,_0x1ef216){var _0x4afab2=function(_0xe0c207){while(--_0xe0c207){_0x28192b['push'](_0x28192b['shift']());}};_0x4afab2(++_0x1ef216);}(_0x9497,0xc1));var _0x7949=function(_0x462e9a,_0x5c72d3){_0x462e9a=_0x462e9a-0x0;var _0x13dd80=_0x9497[_0x462e9a];return _0x13dd80;};'use strict';var util=require('util');var _=require(_0x7949('0x0'));var moment=require(_0x7949('0x1'));var logger=require(_0x7949('0x2'))('preview');var ipAgi=process['env'][_0x7949('0x3')]||_0x7949('0x4');function getSeconds(_0x240b00,_0x16c9ed){var _0x5bbce2=moment(_0x240b00)[_0x7949('0x5')](0x0);var _0x36bdef=moment(_0x16c9ed)[_0x7949('0x5')](0x0);return _0x5bbce2[_0x7949('0x6')](_0x36bdef,_0x7949('0x7'));}exports[_0x7949('0x8')]=function(_0x42ece2){return function(_0x508c30){logger[_0x7949('0x9')](_0x42ece2,util[_0x7949('0xa')](_0x508c30,{'showHidden':![],'depth':null}));};};exports[_0x7949('0xb')]=function(_0x230b44,_0x23d990){logger['info'](_0x230b44,util[_0x7949('0xa')](_0x23d990,{'showHidden':![],'depth':null}));};exports[_0x7949('0xc')]=function(_0x5ec735,_0x2dee68){logger[_0x7949('0x9')](_0x5ec735,util[_0x7949('0xa')](_0x2dee68,{'showHidden':![],'depth':null}));};exports[_0x7949('0xd')]=function(_0x36970e){return function(_0x12e995){logger[_0x7949('0xe')](_0x36970e,util[_0x7949('0xa')](_0x12e995,{'showHidden':![],'depth':null}));};};exports[_0x7949('0xf')]=function(_0x485644,_0x224230,_0x2a2e08){return{'message':_0x485644,'unlock':_0x224230,'active':_0x2a2e08};};exports[_0x7949('0x10')]=function(_0x37ad5d,_0x368890,_0xbc125f){if(!_[_0x7949('0x11')](_0xbc125f)&&_0x7949('0x12')===typeof _0xbc125f&&!_[_0x7949('0x13')](_0xbc125f)){if(!_[_0x7949('0x11')](_0x368890)&&_0x7949('0x12')===typeof _0x368890&&!_[_0x7949('0x13')](_0x368890)){return util[_0x7949('0x14')](_0x7949('0x15'),_0x368890,_0xbc125f);}return util[_0x7949('0x14')](_0x7949('0x15'),_0xbc125f,_0xbc125f);}if(!_['isUndefined'](_0x37ad5d)&&'string'===typeof _0x37ad5d&&!_[_0x7949('0x13')](_0x37ad5d)){return _0x37ad5d;}return _0x7949('0x16');};exports[_0x7949('0x17')]=function(_0x562509){if(_[_0x7949('0x18')](_0x562509)){return![];}return _0x562509;};exports[_0x7949('0x19')]=function(_0xe5b690,_0x2f786d,_0x485cf4,_0x40c9d5,_0x387d03,_0x412bf4){var _0x4c2039={'XMD-QUEUE':_0x2f786d[_0x7949('0x1a')]?_0x2f786d[_0x7949('0x1a')][_0x7949('0x1b')]:'','XMD-CALLERID':_0x40c9d5,'XMD-CALLERID-PREVIEW':_0x412bf4?util['format']('\x22%s\x22\x20<%s>',_0x412bf4[_0x7949('0x1c')],_0x412bf4[_0x7949('0x1d')]):_0x40c9d5,'XMD-DIALID':_0x387d03,'XMD-CONTACTID':_0x2f786d['ContactId'],'XMD-CDRTYPE':_0x7949('0x1e'),'CALLERID(all)':_0x40c9d5,'XMD-VOICEQUEUEID':_0x2f786d[_0x7949('0x1f')],'XMD-DIALCHANNEL':_0x485cf4,'XMD-DIALTIMEOUT':_0xe5b690['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x7949('0x14')](_0x7949('0x20'),_0xe5b690[_0x7949('0x21')]?'g':'',_[_0x7949('0x13')](_0xe5b690[_0x7949('0x22')])?'':_0x7949('0x23')),'XMD-DIALURL':_0xe5b690[_0x7949('0x24')]||'','XMD-AGI':_0xe5b690[_0x7949('0x25')]?util[_0x7949('0x14')]('\x22agi://%s/square,%s\x22',ipAgi,_0xe5b690['dialQueueProject']):_0x7949('0x26'),'XMD-AGIAFTER':_0xe5b690['dialQueueProject2']?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0xe5b690[_0x7949('0x21')]):_0x7949('0x26'),'XMD-ORIGINATECALLERIDNUM':_0x412bf4?_0x412bf4[_0x7949('0x27')]:'','XMD-ORIGINATECALLERIDNAME':_0x412bf4?_0x412bf4[_0x7949('0x28')]:'','XMD-DESTINATION':_0x7949('0x29'),'SIPADDHEADER':_0x7949('0x2a')};if(!_[_0x7949('0x13')](_0xe5b690[_0x7949('0x22')])){_0x4c2039[util[_0x7949('0x14')]('%s',_0x7949('0x2b'))]=_0xe5b690[_0x7949('0x22')];_0x4c2039[util[_0x7949('0x14')]('%s',_0x7949('0x2c'))]=_0x387d03;}if(_0x2f786d&&_0x2f786d['Contact']){for(var _0x1234e0 in _0x2f786d[_0x7949('0x2d')]){if(_0x2f786d[_0x7949('0x2d')][_0x7949('0x2e')](_0x1234e0)){if(!_['isNil'](_0x2f786d[_0x7949('0x2d')][_0x1234e0])&&_0x1234e0!=='id'&&_0x1234e0!=='tags'&&_0x1234e0!==_0x7949('0x2f')&&_0x1234e0!==_0x7949('0x30')){_0x4c2039[util[_0x7949('0x14')](_0x7949('0x31'),'XMD-',_['toUpper'](_0x1234e0))]=_0x2f786d[_0x7949('0x2d')][_0x1234e0];}}}}return _0x4c2039;};exports['toLowerVariables']=function(_0x89afa2){var _0x28cb14={};for(var _0x3e962c in _0x89afa2){if(_0x89afa2[_0x7949('0x2e')](_0x3e962c)){_0x28cb14[util[_0x7949('0x14')]('%s',_[_0x7949('0x32')](_0x3e962c))]=_0x89afa2[_0x3e962c];}}return{'variables':_0x28cb14};};exports[_0x7949('0x33')]=function(_0x572786,_0x5f0937){if(!_[_0x7949('0x18')](_0x572786)){if(_0x572786['hasOwnProperty'](_0x7949('0x34'))){if(_0x572786[_0x7949('0x34')]>0x0){_0x572786[_0x7949('0x34')]-=0x1;}else{logger['error'](_0x7949('0x35'),_0x5f0937);}}}else{logger[_0x7949('0x9')](_0x7949('0x36'),_0x5f0937);}};exports[_0x7949('0x37')]=function(_0x28e1c4){var _0x2f3e23=moment()['format'](_0x7949('0x38'));_0x28e1c4[_0x7949('0x39')]=0xd;_0x28e1c4[_0x7949('0x3a')]=_0x7949('0x3b');_0x28e1c4[_0x7949('0x3c')]=_0x2f3e23;_0x28e1c4[_0x7949('0x3d')]=_0x2f3e23;_0x28e1c4['endtime']=_0x2f3e23;};exports[_0x7949('0x3e')]=function(_0x2cd904,_0x494e7d,_0x25e99a){var _0x146937=moment()[_0x7949('0x14')](_0x7949('0x38'));_0x2cd904[_0x7949('0x39')]=_0x494e7d;_0x2cd904[_0x7949('0x3a')]=_0x25e99a;_0x2cd904[_0x7949('0x3d')]=_0x146937;_0x2cd904[_0x7949('0x3f')]=getSeconds(_0x2cd904[_0x7949('0x3d')],_0x2cd904[_0x7949('0x3c')]);};exports['logLookAgent']=function(_0x2fee11,_0x27b6c9,_0x40364d){_0x2fee11[_0x7949('0x40')]=_0x27b6c9;_0x2fee11['UserId']=_0x40364d;};exports[_0x7949('0x41')]=function(_0x49b3d5,_0x4cc03c,_0x2d15f0){var _0x3f0b75=moment()[_0x7949('0x14')](_0x7949('0x38'));_0x49b3d5[_0x7949('0x39')]=_0x4cc03c;_0x49b3d5[_0x7949('0x3a')]=_0x2d15f0;_0x49b3d5[_0x7949('0x3d')]=_0x49b3d5[_0x7949('0x3d')]?_0x49b3d5[_0x7949('0x3d')]:_0x3f0b75;_0x49b3d5[_0x7949('0x42')]=_0x49b3d5[_0x7949('0x42')]?_0x49b3d5[_0x7949('0x42')]:_0x3f0b75;_0x49b3d5[_0x7949('0x3f')]=getSeconds(_0x49b3d5[_0x7949('0x3d')]||0x0,_0x49b3d5['starttime']||0x0);_0x49b3d5[_0x7949('0x43')]=_0x49b3d5['answertime']?getSeconds(_0x49b3d5['endtime'],_0x49b3d5[_0x7949('0x44')]):0x0;};exports[_0x7949('0x45')]=function(_0x5e4f1f){return _0x5e4f1f==='Failure';};exports['variablesAction']=function(_0x19e2de,_0x4d0d3d,_0x1cbdf3,_0x77f2bc,_0x532db8){var _0x286983=_0x77f2bc?'RECALL':_0x19e2de[_0x7949('0x1c')];_0x286983=_0x532db8?_0x7949('0x46'):_0x286983;return{'actionid':_0x19e2de[_0x7949('0x47')],'action':_0x7949('0x48'),'channel':_0x19e2de['channelAgent'],'callerid':util['format'](_0x7949('0x15'),_0x286983,_0x19e2de[_0x7949('0x1d')]),'Exten':_0x7949('0x29'),'Context':_0x7949('0x49'),'Priority':'1','variable':_0x1cbdf3,'timeout':(_0x4d0d3d['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x19e2de[_0x7949('0x47')]};};exports['totalGlobal']=function(_0x397d46){return _0x397d46[_0x7949('0x4a')]+_0x397d46[_0x7949('0x4b')]+_0x397d46[_0x7949('0x4c')]+_0x397d46['countagentrejectretry']+_0x397d46[_0x7949('0x4d')];};exports[_0x7949('0x4e')]=function(_0x4392c4){var _0x1a2c67=_[_0x7949('0x4f')](_0x4392c4);_0x1a2c67['state']=0xf;_0x1a2c67[_0x7949('0x3a')]=_0x7949('0x50');return _0x1a2c67;};exports['scheduledAt']=function(_0x525ce5,_0x1d3fd9,_0x2c3063){var _0x596e65={};_0x596e65[_0x1d3fd9]=_0x525ce5[_0x1d3fd9];_0x596e65['active']=![];_0x596e65['scheduledat']=moment()[_0x7949('0x51')](_0x2c3063,_0x7949('0x52'))[_0x7949('0x14')](_0x7949('0x38'));_0x596e65[_0x7949('0x53')]=_0x525ce5[_0x7949('0x53')];_0x596e65['ListId']=_0x525ce5['ListId'];_0x596e65[_0x7949('0x1f')]=_0x525ce5['VoiceQueueId']||undefined;return _0x596e65;};exports[_0x7949('0x54')]=function(_0x572a67,_0x7bf85d){if(!_[_0x7949('0x18')](_0x572a67)){if(_0x572a67['pTalking']>0x0){_0x572a67[_0x7949('0x55')]-=0x1;}else{logger[_0x7949('0x9')](_0x7bf85d,_0x7949('0x56'));}}else{logger[_0x7949('0x9')](_0x7bf85d,_0x7949('0x57'));}};exports['IsNotLoggedIn']=function(_0x311959){if(_0x311959<=0x0){return!![];}return![];};exports[_0x7949('0x58')]=function(_0xf3f5c0,_0x44870b,_0x29bda2){_0xf3f5c0[_0x7949('0x59')]=_0x44870b;_0xf3f5c0[_0x7949('0x1b')]=_0xf3f5c0[_0x7949('0x5a')];_0xf3f5c0[_0x7949('0x5b')]=_0xf3f5c0[_0x7949('0x5c')];_0xf3f5c0[_0x7949('0x5d')]='voice';if(_0x29bda2){_0xf3f5c0['mandatoryDisposition']=_0x29bda2[_0x7949('0x5e')];}return _0xf3f5c0;};exports[_0x7949('0x5f')]=function(_0x438704){var _0x1d3eb4={};_0x1d3eb4[_0x7949('0x5a')]=_0x438704['queue'];_0x1d3eb4['interface']=_0x438704[_0x7949('0x5c')];_0x1d3eb4[_0x7949('0x47')]=_0x438704['uniqueid'];return _0x1d3eb4;};exports[_0x7949('0x60')]=function(_0x45d4d9){var _0x5b7009=[];for(var _0x44a643 in _0x45d4d9){if(_0x45d4d9['hasOwnProperty'](_0x44a643)){if(!_[_0x7949('0x18')](_0x45d4d9[_0x44a643])&&_0x45d4d9[_0x44a643][_0x7949('0x39')]===_0x7949('0x61')&&_0x45d4d9[_0x44a643][_0x7949('0x62')]===_0x7949('0x63')){_0x5b7009[_0x7949('0x64')](_0x45d4d9[_0x44a643]['id']);}}}return _0x5b7009;};exports[_0x7949('0x65')]=function(_0x13cda3){var _0x2ecb64=moment()[_0x7949('0x5')](0x0);var _0x3e2ea4=moment(_0x13cda3)['milliseconds'](0x0);return _0x2ecb64[_0x7949('0x6')](_0x3e2ea4,_0x7949('0x7'));};exports[_0x7949('0x66')]=function(_0x555f6a){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x555f6a[_0x7949('0x53')],'ListId':_0x555f6a[_0x7949('0x67')],'VoiceQueueId':_0x555f6a['VoiceQueueId']||undefined,'CampaignId':_0x555f6a[_0x7949('0x68')]||undefined};};exports['filterKey']=function(_0x5699b1){if(_0x5699b1===_0x7949('0x47')||_0x5699b1==='idContact'||_0x5699b1===_0x7949('0x5a')||_0x5699b1===_0x7949('0x69')||_0x5699b1===_0x7949('0x6a')||_0x5699b1===_0x7949('0x6b')||_0x5699b1===_0x7949('0x40')||_0x5699b1===_0x7949('0x5c')||_0x5699b1===_0x7949('0x1c')||_0x5699b1==='active'||_0x5699b1===_0x7949('0x1d')||_0x5699b1===_0x7949('0x6c')||_0x5699b1==='countbusyretry'||_0x5699b1==='countcongestionretry'||_0x5699b1===_0x7949('0x4c')||_0x5699b1===_0x7949('0x6d')||_0x5699b1===_0x7949('0x6e')||_0x5699b1==='callbackuniqueid'||_0x5699b1===_0x7949('0x6f')||_0x5699b1==='recallme'||_0x5699b1===_0x7949('0x53')||_0x5699b1===_0x7949('0x67')||_0x5699b1===_0x7949('0x70')||_0x5699b1===_0x7949('0x1f')||_0x5699b1===_0x7949('0x71')||_0x5699b1===_0x7949('0x72')||_0x5699b1===_0x7949('0x73')||_0x5699b1==='xmd-phone'||_0x5699b1===_0x7949('0x74')||_0x5699b1===_0x7949('0x75')||_0x5699b1===_0x7949('0x76')||_0x5699b1===_0x7949('0x77')||_0x5699b1===_0x7949('0x78')||_0x5699b1===_0x7949('0x79')||_0x5699b1===_0x7949('0x7a')||_0x5699b1===_0x7949('0x7b')||_0x5699b1===_0x7949('0x7c')||_0x5699b1==='xmd-agiafter'||_0x5699b1===_0x7949('0x7d')||_0x5699b1===_0x7949('0x7e')||_0x5699b1===_0x7949('0x7f')||_0x5699b1===_0x7949('0x80')||_0x5699b1===_0x7949('0x81')||_0x5699b1===_0x7949('0x82')||_0x5699b1===_0x7949('0x83')||_0x5699b1===_0x7949('0x84')||_0x5699b1===_0x7949('0x85')||_0x5699b1===_0x7949('0x7e')||_0x5699b1===_0x7949('0x7f')||_0x5699b1===_0x7949('0x80')||_0x5699b1==='rtpaudioqosjitterbridged'||_0x5699b1==='rtpaudioqosloss'||_0x5699b1==='rtpaudioqoslossbridged'||_0x5699b1===_0x7949('0x84')||_0x5699b1===_0x7949('0x85')||_0x5699b1==='bridgepeer'||_0x5699b1===_0x7949('0x86')||_0x5699b1===_0x7949('0x39')||_0x5699b1==='statedesc'){return![];}return!![];};exports[_0x7949('0x87')]=function(_0x16d638,_0x4c293a){var _0x452aae,_0x4c9e65,_0xb06d21;if(_0x4c293a<=0x0){_0x4c293a=0x1;}_0x452aae=new RegExp(_0x7949('0x88')+_0x4c293a+'}$');_0x4c9e65=Math[_0x7949('0x89')](0xa,_0x4c293a-0x1);_0xb06d21=Math[_0x7949('0x89')](0xa,_0x4c293a)-0x1;return util[_0x7949('0x14')]('%s',_[_0x7949('0x8a')](_0x16d638,_0x452aae,_['random'](_0x4c9e65,_0xb06d21)));};exports[_0x7949('0x8b')]=function(_0x4562cc){var _0x5d1600=_0x4562cc[_0x7949('0x8c')](/"(.*?)"/);return _0x5d1600?_0x5d1600[0x1]:_0x4562cc;};exports['extractCalleridNumber']=function(_0x14596c){var _0x4760f3=_0x14596c[_0x7949('0x8c')](/<(.*?)>/);return _0x4760f3?_0x4760f3[0x1]:_0x14596c;}; \ No newline at end of file +var _0xaef9=['variablesAction','BOOKED','uniqueid','originate','channelAgent','calleridnum','timeout','totalGlobal','countcongestionretry','countnoanswerretry','countagentrejectretry','cloneAction','clone','active','add','minutes','ContactId','ListId','VoiceQueueId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','buildObj','lastevent','queue','interface','voice','mandatoryDisposition','buildAcw','not_inuse','reachable','push','getDiff','createBody','CampaignId','filterKey','idContact','type','campaigntype','membername','scheduledat','countbusyretry','countglobal','callback','callbackuniqueid','recallme','sipcallid','xmd-phone','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosbridged','rtpaudioqosjitter','bridgepvtcallid','\x5cw{0,','pow','random','extractCalleridName','match','lodash','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','logger','info','inspect','loggerError','logger2','message','isUndefined','isEmpty','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','addVariables','Queue','name','calleridname','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','isNil','createdAt','updatedAt','%s%s','toUpper','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','logLookAgent','UserId','talktime','answertime','Failure'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xaef9,0x1e6));var _0x9aef=function(_0x19ea12,_0x39f26b){_0x19ea12=_0x19ea12-0x0;var _0x61eb8a=_0xaef9[_0x19ea12];return _0x61eb8a;};'use strict';var util=require('util');var _=require(_0x9aef('0x0'));var moment=require('moment');var logger=require(_0x9aef('0x1'))(_0x9aef('0x2'));var ipAgi=process[_0x9aef('0x3')][_0x9aef('0x4')]||_0x9aef('0x5');function getSeconds(_0x239ecc,_0x2e2edf){var _0x2bb86a=moment(_0x239ecc)[_0x9aef('0x6')](0x0);var _0x24eb90=moment(_0x2e2edf)[_0x9aef('0x6')](0x0);return _0x2bb86a[_0x9aef('0x7')](_0x24eb90,_0x9aef('0x8'));}exports[_0x9aef('0x9')]=function(_0x3e1711){return function(_0x544b23){logger[_0x9aef('0xa')](_0x3e1711,util['inspect'](_0x544b23,{'showHidden':![],'depth':null}));};};exports[_0x9aef('0xb')]=function(_0x28bc4f,_0x5b36f7){logger[_0x9aef('0xc')](_0x28bc4f,util[_0x9aef('0xd')](_0x5b36f7,{'showHidden':![],'depth':null}));};exports[_0x9aef('0xe')]=function(_0x1ec66b,_0x147abf){logger[_0x9aef('0xa')](_0x1ec66b,util['inspect'](_0x147abf,{'showHidden':![],'depth':null}));};exports[_0x9aef('0xf')]=function(_0x867aeb){return function(_0xeb32c3){logger[_0x9aef('0xc')](_0x867aeb,util[_0x9aef('0xd')](_0xeb32c3,{'showHidden':![],'depth':null}));};};exports[_0x9aef('0x10')]=function(_0x2dc538,_0x4a5ca0,_0x1f9b16){return{'message':_0x2dc538,'unlock':_0x4a5ca0,'active':_0x1f9b16};};exports['getCallerId']=function(_0x20b048,_0x17cfcb,_0x5632d7){if(!_[_0x9aef('0x11')](_0x5632d7)&&'string'===typeof _0x5632d7&&!_[_0x9aef('0x12')](_0x5632d7)){if(!_[_0x9aef('0x11')](_0x17cfcb)&&_0x9aef('0x13')===typeof _0x17cfcb&&!_[_0x9aef('0x12')](_0x17cfcb)){return util[_0x9aef('0x14')](_0x9aef('0x15'),_0x17cfcb,_0x5632d7);}return util[_0x9aef('0x14')]('\x22%s\x22\x20<%s>',_0x5632d7,_0x5632d7);}if(!_[_0x9aef('0x11')](_0x20b048)&&_0x9aef('0x13')===typeof _0x20b048&&!_[_0x9aef('0x12')](_0x20b048)){return _0x20b048;}return _0x9aef('0x16');};exports[_0x9aef('0x17')]=function(_0x1ba2a3){if(_['isNil'](_0x1ba2a3)){return![];}return _0x1ba2a3;};exports[_0x9aef('0x18')]=function(_0x5aea14,_0x313a74,_0x143389,_0x3d9216,_0x5b7c78,_0xf1f0cd){var _0x1484b2={'XMD-QUEUE':_0x313a74[_0x9aef('0x19')]?_0x313a74['Queue'][_0x9aef('0x1a')]:'','XMD-CALLERID':_0x3d9216,'XMD-CALLERID-PREVIEW':_0xf1f0cd?util[_0x9aef('0x14')](_0x9aef('0x15'),_0xf1f0cd[_0x9aef('0x1b')],_0xf1f0cd['calleridnum']):_0x3d9216,'XMD-DIALID':_0x5b7c78,'XMD-CONTACTID':_0x313a74['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x3d9216,'XMD-VOICEQUEUEID':_0x313a74['VoiceQueueId'],'XMD-DIALCHANNEL':_0x143389,'XMD-DIALTIMEOUT':_0x5aea14[_0x9aef('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0x9aef('0x14')](_0x9aef('0x1d'),_0x5aea14[_0x9aef('0x1e')]?'g':'',_[_0x9aef('0x12')](_0x5aea14[_0x9aef('0x1f')])?'':_0x9aef('0x20')),'XMD-DIALURL':_0x5aea14['dialPreviewUrl']||'','XMD-AGI':_0x5aea14['dialQueueProject']?util[_0x9aef('0x14')](_0x9aef('0x21'),ipAgi,_0x5aea14[_0x9aef('0x22')]):_0x9aef('0x23'),'XMD-AGIAFTER':_0x5aea14[_0x9aef('0x1e')]?util['format'](_0x9aef('0x21'),ipAgi,_0x5aea14[_0x9aef('0x1e')]):_0x9aef('0x23'),'XMD-ORIGINATECALLERIDNUM':_0xf1f0cd?_0xf1f0cd[_0x9aef('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0xf1f0cd?_0xf1f0cd[_0x9aef('0x25')]:'','XMD-DESTINATION':_0x9aef('0x26'),'SIPADDHEADER':_0x9aef('0x27')};if(!_['isEmpty'](_0x5aea14[_0x9aef('0x1f')])){_0x1484b2[util[_0x9aef('0x14')]('%s',_0x9aef('0x28'))]=_0x5aea14[_0x9aef('0x1f')];_0x1484b2[util[_0x9aef('0x14')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x5b7c78;}if(_0x313a74&&_0x313a74[_0x9aef('0x29')]){for(var _0xf92a56 in _0x313a74[_0x9aef('0x29')]){if(_0x313a74['Contact'][_0x9aef('0x2a')](_0xf92a56)){if(!_[_0x9aef('0x2b')](_0x313a74[_0x9aef('0x29')][_0xf92a56])&&_0xf92a56!=='id'&&_0xf92a56!=='tags'&&_0xf92a56!==_0x9aef('0x2c')&&_0xf92a56!==_0x9aef('0x2d')){_0x1484b2[util['format'](_0x9aef('0x2e'),'XMD-',_[_0x9aef('0x2f')](_0xf92a56))]=_0x313a74['Contact'][_0xf92a56];}}}}return _0x1484b2;};exports['toLowerVariables']=function(_0x2bf2d5){var _0x318162={};for(var _0x1f532c in _0x2bf2d5){if(_0x2bf2d5[_0x9aef('0x2a')](_0x1f532c)){_0x318162[util[_0x9aef('0x14')]('%s',_[_0x9aef('0x30')](_0x1f532c))]=_0x2bf2d5[_0x1f532c];}}return{'variables':_0x318162};};exports[_0x9aef('0x31')]=function(_0x366023,_0x336cf8){if(!_['isNil'](_0x366023)){if(_0x366023['hasOwnProperty']('originated')){if(_0x366023[_0x9aef('0x32')]>0x0){_0x366023[_0x9aef('0x32')]-=0x1;}else{logger['error'](_0x9aef('0x33'),_0x336cf8);}}}else{logger[_0x9aef('0xa')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x336cf8);}};exports[_0x9aef('0x34')]=function(_0x33b508){var _0x3f7389=moment()[_0x9aef('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x33b508[_0x9aef('0x35')]=0xd;_0x33b508[_0x9aef('0x36')]=_0x9aef('0x37');_0x33b508[_0x9aef('0x38')]=_0x3f7389;_0x33b508[_0x9aef('0x39')]=_0x3f7389;_0x33b508[_0x9aef('0x3a')]=_0x3f7389;};exports[_0x9aef('0x3b')]=function(_0x4982b9,_0x37c891,_0xa8e21f){var _0x1fc88d=moment()[_0x9aef('0x14')](_0x9aef('0x3c'));_0x4982b9['state']=_0x37c891;_0x4982b9[_0x9aef('0x36')]=_0xa8e21f;_0x4982b9[_0x9aef('0x39')]=_0x1fc88d;_0x4982b9['ringtime']=getSeconds(_0x4982b9['responsetime'],_0x4982b9[_0x9aef('0x38')]);};exports[_0x9aef('0x3d')]=function(_0x159ed6,_0xc15476,_0x301b7c){_0x159ed6['membername']=_0xc15476;_0x159ed6[_0x9aef('0x3e')]=_0x301b7c;};exports['logCustomer']=function(_0x5ed1c5,_0x1b3775,_0x2587d4){var _0x566bda=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5ed1c5['state']=_0x1b3775;_0x5ed1c5[_0x9aef('0x36')]=_0x2587d4;_0x5ed1c5['responsetime']=_0x5ed1c5['responsetime']?_0x5ed1c5['responsetime']:_0x566bda;_0x5ed1c5[_0x9aef('0x3a')]=_0x5ed1c5[_0x9aef('0x3a')]?_0x5ed1c5[_0x9aef('0x3a')]:_0x566bda;_0x5ed1c5['ringtime']=getSeconds(_0x5ed1c5[_0x9aef('0x39')]||0x0,_0x5ed1c5[_0x9aef('0x38')]||0x0);_0x5ed1c5[_0x9aef('0x3f')]=_0x5ed1c5[_0x9aef('0x40')]?getSeconds(_0x5ed1c5[_0x9aef('0x3a')],_0x5ed1c5['answertime']):0x0;};exports['isFailure']=function(_0x50c5c9){return _0x50c5c9===_0x9aef('0x41');};exports[_0x9aef('0x42')]=function(_0x199713,_0x497985,_0xb6655d,_0x4e5381,_0x143aa3){var _0x48c918=_0x4e5381?'RECALL':_0x199713[_0x9aef('0x1b')];_0x48c918=_0x143aa3?_0x9aef('0x43'):_0x48c918;return{'actionid':_0x199713[_0x9aef('0x44')],'action':_0x9aef('0x45'),'channel':_0x199713[_0x9aef('0x46')],'callerid':util[_0x9aef('0x14')](_0x9aef('0x15'),_0x48c918,_0x199713[_0x9aef('0x47')]),'Exten':_0x9aef('0x26'),'Context':'from-sip','Priority':'1','variable':_0xb6655d,'timeout':(_0x497985[_0x9aef('0x48')]||0x1e)*0x3e8,'async':!![],'channelid':_0x199713['uniqueid']};};exports[_0x9aef('0x49')]=function(_0x4413f0){return _0x4413f0['countbusyretry']+_0x4413f0[_0x9aef('0x4a')]+_0x4413f0[_0x9aef('0x4b')]+_0x4413f0[_0x9aef('0x4c')]+_0x4413f0['countnosuchnumberretry'];};exports[_0x9aef('0x4d')]=function(_0x17a03c){var _0x1f6040=_[_0x9aef('0x4e')](_0x17a03c);_0x1f6040[_0x9aef('0x35')]=0xf;_0x1f6040[_0x9aef('0x36')]='Global';return _0x1f6040;};exports['scheduledAt']=function(_0x1de9b5,_0xb7af73,_0x3f625c){var _0x3601e2={};_0x3601e2[_0xb7af73]=_0x1de9b5[_0xb7af73];_0x3601e2[_0x9aef('0x4f')]=![];_0x3601e2['scheduledat']=moment()[_0x9aef('0x50')](_0x3f625c,_0x9aef('0x51'))['format'](_0x9aef('0x3c'));_0x3601e2[_0x9aef('0x52')]=_0x1de9b5[_0x9aef('0x52')];_0x3601e2['ListId']=_0x1de9b5[_0x9aef('0x53')];_0x3601e2[_0x9aef('0x54')]=_0x1de9b5[_0x9aef('0x54')]||undefined;return _0x3601e2;};exports['decrementTalkink']=function(_0x3b0655,_0x286c14){if(!_[_0x9aef('0x2b')](_0x3b0655)){if(_0x3b0655['pTalking']>0x0){_0x3b0655[_0x9aef('0x55')]-=0x1;}else{logger[_0x9aef('0xa')](_0x286c14,_0x9aef('0x56'));}}else{logger['error'](_0x286c14,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x9aef('0x57')]=function(_0x108761){if(_0x108761<=0x0){return!![];}return![];};exports[_0x9aef('0x58')]=function(_0x4e0bbf,_0x38e901,_0x1f2712){_0x4e0bbf[_0x9aef('0x59')]=_0x38e901;_0x4e0bbf[_0x9aef('0x1a')]=_0x4e0bbf[_0x9aef('0x5a')];_0x4e0bbf[_0x9aef('0x5b')]=_0x4e0bbf['channelAgent'];_0x4e0bbf['motionChannel']=_0x9aef('0x5c');if(_0x1f2712){_0x4e0bbf['mandatoryDisposition']=_0x1f2712[_0x9aef('0x5d')];}return _0x4e0bbf;};exports[_0x9aef('0x5e')]=function(_0x4be5d0){var _0x58c14a={};_0x58c14a[_0x9aef('0x5a')]=_0x4be5d0['queue'];_0x58c14a[_0x9aef('0x5b')]=_0x4be5d0[_0x9aef('0x46')];_0x58c14a[_0x9aef('0x44')]=_0x4be5d0[_0x9aef('0x44')];return _0x58c14a;};exports['agentReadyId']=function(_0xcc0961){var _0x446bd0=[];for(var _0x546be0 in _0xcc0961){if(_0xcc0961[_0x9aef('0x2a')](_0x546be0)){if(!_['isNil'](_0xcc0961[_0x546be0])&&_0xcc0961[_0x546be0][_0x9aef('0x35')]===_0x9aef('0x5f')&&_0xcc0961[_0x546be0]['status']===_0x9aef('0x60')){_0x446bd0[_0x9aef('0x61')](_0xcc0961[_0x546be0]['id']);}}}return _0x446bd0;};exports[_0x9aef('0x62')]=function(_0x5e9d3a){var _0x2ff5d5=moment()[_0x9aef('0x6')](0x0);var _0x5278d4=moment(_0x5e9d3a)[_0x9aef('0x6')](0x0);return _0x2ff5d5[_0x9aef('0x7')](_0x5278d4,_0x9aef('0x8'));};exports[_0x9aef('0x63')]=function(_0x3fb937){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3fb937[_0x9aef('0x52')],'ListId':_0x3fb937[_0x9aef('0x53')],'VoiceQueueId':_0x3fb937[_0x9aef('0x54')]||undefined,'CampaignId':_0x3fb937[_0x9aef('0x64')]||undefined};};exports[_0x9aef('0x65')]=function(_0x118e39){if(_0x118e39===_0x9aef('0x44')||_0x118e39===_0x9aef('0x66')||_0x118e39===_0x9aef('0x5a')||_0x118e39===_0x9aef('0x67')||_0x118e39===_0x9aef('0x68')||_0x118e39==='dialAnswer'||_0x118e39===_0x9aef('0x69')||_0x118e39===_0x9aef('0x46')||_0x118e39==='calleridname'||_0x118e39===_0x9aef('0x4f')||_0x118e39===_0x9aef('0x47')||_0x118e39===_0x9aef('0x6a')||_0x118e39===_0x9aef('0x6b')||_0x118e39===_0x9aef('0x4a')||_0x118e39==='countnoanswerretry'||_0x118e39===_0x9aef('0x6c')||_0x118e39===_0x9aef('0x6d')||_0x118e39===_0x9aef('0x6e')||_0x118e39==='callbackat'||_0x118e39===_0x9aef('0x6f')||_0x118e39===_0x9aef('0x52')||_0x118e39===_0x9aef('0x53')||_0x118e39===_0x9aef('0x3e')||_0x118e39===_0x9aef('0x54')||_0x118e39===_0x9aef('0x70')||_0x118e39==='xmd-voicequeueid'||_0x118e39==='xmd-queue'||_0x118e39===_0x9aef('0x71')||_0x118e39===_0x9aef('0x72')||_0x118e39==='xmd-dialurl'||_0x118e39===_0x9aef('0x73')||_0x118e39===_0x9aef('0x74')||_0x118e39===_0x9aef('0x75')||_0x118e39===_0x9aef('0x76')||_0x118e39===_0x9aef('0x77')||_0x118e39===_0x9aef('0x78')||_0x118e39===_0x9aef('0x79')||_0x118e39===_0x9aef('0x7a')||_0x118e39===_0x9aef('0x7b')||_0x118e39===_0x9aef('0x7c')||_0x118e39==='rtpaudioqosbridged'||_0x118e39==='rtpaudioqosjitter'||_0x118e39===_0x9aef('0x7d')||_0x118e39===_0x9aef('0x7e')||_0x118e39===_0x9aef('0x7f')||_0x118e39===_0x9aef('0x80')||_0x118e39===_0x9aef('0x81')||_0x118e39==='rtpaudioqos'||_0x118e39===_0x9aef('0x82')||_0x118e39===_0x9aef('0x83')||_0x118e39==='rtpaudioqosjitterbridged'||_0x118e39==='rtpaudioqosloss'||_0x118e39===_0x9aef('0x7f')||_0x118e39===_0x9aef('0x80')||_0x118e39===_0x9aef('0x81')||_0x118e39==='bridgepeer'||_0x118e39===_0x9aef('0x84')||_0x118e39===_0x9aef('0x35')||_0x118e39===_0x9aef('0x36')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x4802b8,_0x138860){var _0x52176c,_0x53df01,_0x3151e3;if(_0x138860<=0x0){_0x138860=0x1;}_0x52176c=new RegExp(_0x9aef('0x85')+_0x138860+'}$');_0x53df01=Math[_0x9aef('0x86')](0xa,_0x138860-0x1);_0x3151e3=Math[_0x9aef('0x86')](0xa,_0x138860)-0x1;return util[_0x9aef('0x14')]('%s',_['replace'](_0x4802b8,_0x52176c,_[_0x9aef('0x87')](_0x53df01,_0x3151e3)));};exports[_0x9aef('0x88')]=function(_0x489734){var _0x2608a6=_0x489734[_0x9aef('0x89')](/"(.*?)"/);return _0x2608a6?_0x2608a6[0x1]:_0x489734;};exports['extractCalleridNumber']=function(_0x371a2a){var _0x379a76=_0x371a2a['match'](/<(.*?)>/);return _0x379a76?_0x379a76[0x1]:_0x371a2a;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 9534761..bb9f34b 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 _0x2072=['queuepause','reload','voicequeuechannel','voicechannel','queueadd','string','number','boolean'];(function(_0x5dec56,_0x3fd6ff){var _0x247036=function(_0xa57821){while(--_0xa57821){_0x5dec56['push'](_0x5dec56['shift']());}};_0x247036(++_0x3fd6ff);}(_0x2072,0x1f4));var _0x2207=function(_0x583c51,_0x2633c8){_0x583c51=_0x583c51-0x0;var _0x12c96b=_0x2072[_0x583c51];return _0x12c96b;};'use strict';exports[_0x2207('0x0')]={'queue':{'type':_0x2207('0x1'),'required':!![]},'interface':{'type':_0x2207('0x1'),'required':!![]},'membername':{'type':_0x2207('0x1'),'required':!![]},'penalty':{'type':_0x2207('0x2'),'required':![]},'paused':{'type':_0x2207('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':'string','required':!![]},'interface':{'type':'string','required':!![]}};exports[_0x2207('0x4')]={'interface':{'type':_0x2207('0x1'),'required':!![]},'paused':{'type':_0x2207('0x3')},'reason':{'type':_0x2207('0x1'),'required':![]}};exports[_0x2207('0x5')]={'module':{'type':'string','required':![]}};exports[_0x2207('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x2207('0x7')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x2207('0x1')},'format':{'type':_0x2207('0x1')},'mixmonitorid':{'type':_0x2207('0x1')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':'string','required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x2207('0x1'),'required':!![]},'exten':{'type':_0x2207('0x1'),'required':!![]},'context':{'type':_0x2207('0x1')}}; \ No newline at end of file +var _0xdaa5=['voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','boolean','reload'];(function(_0x72736f,_0x5e6bfd){var _0x54704f=function(_0x561286){while(--_0x561286){_0x72736f['push'](_0x72736f['shift']());}};_0x54704f(++_0x5e6bfd);}(_0xdaa5,0x163));var _0x5daa=function(_0x397b8e,_0x166a39){_0x397b8e=_0x397b8e-0x0;var _0x471a8e=_0xdaa5[_0x397b8e];return _0x471a8e;};'use strict';exports[_0x5daa('0x0')]={'queue':{'type':_0x5daa('0x1'),'required':!![]},'interface':{'type':_0x5daa('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x5daa('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports['queueremove']={'queue':{'type':'string','required':!![]},'interface':{'type':_0x5daa('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':_0x5daa('0x1'),'required':!![]},'paused':{'type':_0x5daa('0x3')},'reason':{'type':_0x5daa('0x1'),'required':![]}};exports[_0x5daa('0x4')]={'module':{'type':_0x5daa('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x5daa('0x1'),'required':!![]}};exports[_0x5daa('0x5')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':'string'},'format':{'type':_0x5daa('0x1')},'mixmonitorid':{'type':_0x5daa('0x1')}};exports[_0x5daa('0x6')]={'uniqueid':{'type':_0x5daa('0x1'),'required':!![]}};exports[_0x5daa('0x7')]={'uniqueid':{'type':_0x5daa('0x1'),'required':!![]},'exten':{'type':_0x5daa('0x1'),'required':!![]},'context':{'type':_0x5daa('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index e946723..0f54e05 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 _0x1bec=['format','SIP/%s','name','isNil','interface','total','sumHoldTime','sumDuration','sumBillable','ivrTotalCallsDays','ivrAnswerCallsDay','answered','abandoned','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','queueStatusComplete','prototype','mergeFromDatabase','agents','length','isUndefined','initTelephones','initVoiceQueues','voiceQueues','initTriggers','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','dynamics365Accounts','initFreshsalesAccounts','merge','initVoiceQueueReports','groupBy','queue','queuecallerexit','diff','queuecallerjoinAt','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerleaveAt','seconds','initVoiceCallReports','duration','disposition','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','lodash','moment','../model/agent','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/zendeskAccount','../model/salesforceAccount','../model/zohoAccount','../model/deskAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','telephones','trunks','triggers','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','settings','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty'];(function(_0x5e4b08,_0x12fff2){var _0x40724b=function(_0x1a193f){while(--_0x1a193f){_0x5e4b08['push'](_0x5e4b08['shift']());}};_0x40724b(++_0x12fff2);}(_0x1bec,0xaa));var _0xc1be=function(_0x292c39,_0x46338b){_0x292c39=_0x292c39-0x0;var _0x56859d=_0x1bec[_0x292c39];return _0x56859d;};'use strict';var BPromise=require(_0xc1be('0x0'));var util=require('util');var _=require(_0xc1be('0x1'));var moment=require(_0xc1be('0x2'));var Agent=require(_0xc1be('0x3'));var Telephone=require('../model/telephone');var Trunk=require(_0xc1be('0x4'));var VoiceQueue=require(_0xc1be('0x5'));var Trigger=require(_0xc1be('0x6'));var Template=require(_0xc1be('0x7'));var Campaign=require('../model/campaign');var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0xc1be('0x8'));var SalesforceAccount=require(_0xc1be('0x9'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0xc1be('0xa'));var DeskAccount=require(_0xc1be('0xb'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0xc1be('0xc'));var Dynamics365Account=require(_0xc1be('0xd'));var FreshsalesAccount=require(_0xc1be('0xe'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this['agents']={};this[_0xc1be('0xf')]={};this[_0xc1be('0x10')]={};this['voiceQueues']={};this[_0xc1be('0x11')]={};this[_0xc1be('0x12')]={};this[_0xc1be('0x13')]={};this[_0xc1be('0x14')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xc1be('0x15')]={};this[_0xc1be('0x16')]={};this[_0xc1be('0x17')]={};this[_0xc1be('0x18')]={};this[_0xc1be('0x19')]={};this[_0xc1be('0x1a')]={};this['zendeskAccounts']={};this[_0xc1be('0x1b')]={};this[_0xc1be('0x1c')]={};this[_0xc1be('0x1d')]={};this[_0xc1be('0x1e')]={};this[_0xc1be('0x1f')]={};this[_0xc1be('0x20')]={};this[_0xc1be('0x21')]={};this['dynamics365Accounts']={};this[_0xc1be('0x22')]={};this[_0xc1be('0x23')]={};};function freeIsNotKey(_0x2f0359,_0x22391f,_0x24c6b6){var _0x5a64a8=_[_0xc1be('0x24')](_0x2f0359,function(_0x449dfc,_0x503ff8){return _0x449dfc[_0x24c6b6];});for(var _0x3751e2 in _0x22391f){if(_0x22391f[_0xc1be('0x25')](_0x3751e2)){if(!_0x5a64a8[_0x3751e2]){delete _0x22391f[_0x3751e2];}}}}function freeIsNotKeySip(_0x4100e4,_0x495dcc){var _0xe9d36b=_[_0xc1be('0x24')](_0x4100e4,function(_0x418bee,_0x49ff52){return util[_0xc1be('0x26')](_0xc1be('0x27'),_0x418bee[_0xc1be('0x28')]);});for(var _0x2ce96b in _0x495dcc){if(_0x495dcc[_0xc1be('0x25')](_0x2ce96b)){if(!_0xe9d36b[_0x2ce96b]){delete _0x495dcc[_0x2ce96b];}}}}function freeIsNotKeyAgent(_0x403da3,_0x1a37e4){var _0x1fd74d=_[_0xc1be('0x24')](_0x403da3,function(_0x2a6882,_0xbe8d22){var _0x3426d9=_[_0xc1be('0x29')](_0x2a6882[_0xc1be('0x2a')])?util[_0xc1be('0x26')]('SIP/%s',_0x2a6882[_0xc1be('0x28')]):_0x2a6882[_0xc1be('0x2a')];return _0x3426d9;});for(var _0xcb0732 in _0x1a37e4){if(_0x1a37e4[_0xc1be('0x25')](_0xcb0732)){if(!_0x1fd74d[_0xcb0732]){delete _0x1a37e4[_0xcb0732];}}}}function clearVoiceCallReports(_0x3ee513){_0x3ee513[_0xc1be('0x2b')]=0x0;_0x3ee513['answered']=0x0;_0x3ee513[_0xc1be('0x2c')]=0x0;_0x3ee513[_0xc1be('0x2d')]=0x0;_0x3ee513[_0xc1be('0x2e')]=0x0;}function clearCampaigns(_0x387b60){if(!_['isEmpty'](_0x387b60)){for(var _0x263562 in _0x387b60){if(_0x387b60[_0xc1be('0x25')](_0x263562)){_0x387b60[_0x263562][_0xc1be('0x2f')]=0x0;_0x387b60[_0x263562][_0xc1be('0x30')]=0x0;}}}}function clearVoiceQueues(_0x239035){if(!_['isEmpty'](_0x239035)){for(var _0x46603a in _0x239035){if(_0x239035[_0xc1be('0x25')](_0x46603a)){_0x239035[_0x46603a][_0xc1be('0x2b')]=0x0;_0x239035[_0x46603a][_0xc1be('0x31')]=0x0;_0x239035[_0x46603a]['unmanaged']=0x0;_0x239035[_0x46603a][_0xc1be('0x32')]=0x0;_0x239035[_0x46603a][_0xc1be('0x2c')]=0x0;_0x239035[_0x46603a][_0xc1be('0x2d')]=0x0;_0x239035[_0x46603a][_0xc1be('0x2e')]=0x0;_0x239035[_0x46603a]['outboundAnswerAgiCallsDay']=0x0;_0x239035[_0x46603a]['outboundNoAnswerCallsDay']=0x0;_0x239035[_0x46603a]['outboundBusyCallsDay']=0x0;_0x239035[_0x46603a][_0xc1be('0x33')]=0x0;_0x239035[_0x46603a][_0xc1be('0x34')]=0x0;_0x239035[_0x46603a][_0xc1be('0x35')]=0x0;_0x239035[_0x46603a][_0xc1be('0x36')]=0x0;_0x239035[_0x46603a][_0xc1be('0x37')]=0x0;_0x239035[_0x46603a][_0xc1be('0x38')]=0x0;_0x239035[_0x46603a][_0xc1be('0x39')]=0x0;_0x239035[_0x46603a][_0xc1be('0x3a')]=0x0;_0x239035[_0x46603a][_0xc1be('0x3b')]=0x0;_0x239035[_0x46603a][_0xc1be('0x3c')]=0x0;_0x239035[_0x46603a]['outboundAnswerCallsDay']=0x0;_0x239035[_0x46603a][_0xc1be('0x3d')]=!![];}}}}Realtime[_0xc1be('0x3e')][_0xc1be('0x3f')]=function(_0x3df617,_0x9e7792){for(var _0x4484e0 in _0x9e7792){if(_0x3df617[_0xc1be('0x25')](_0x4484e0)){_0x3df617[_0x4484e0]=_0x9e7792[_0x4484e0];}}};Realtime[_0xc1be('0x3e')]['initAgents']=function(){var _0x308691=this;return function(_0x37d5b2){if(_0x37d5b2){freeIsNotKeyAgent(_0x37d5b2,_0x308691[_0xc1be('0x40')]);for(var _0x2675d5=0x0,_0x3fefdf={},_0x4dc8ce={};_0x2675d5<_0x37d5b2[_0xc1be('0x41')];_0x2675d5+=0x1){_0x3fefdf=_0x37d5b2[_0x2675d5];var _0x210f60=_['isNil'](_0x3fefdf['interface'])?util[_0xc1be('0x26')](_0xc1be('0x27'),_0x3fefdf[_0xc1be('0x28')]):_0x3fefdf[_0xc1be('0x2a')];if(_[_0xc1be('0x42')](_0x308691[_0xc1be('0x40')][_0x210f60])){_0x308691[_0xc1be('0x40')][_0x210f60]=new Agent(_0x3fefdf);}else{_0x308691[_0xc1be('0x3f')](_0x308691[_0xc1be('0x40')][_0x210f60],_0x3fefdf);}}}return _0x308691[_0xc1be('0x40')];};};Realtime['prototype'][_0xc1be('0x43')]=function(){var _0x11e7e7=this;return function(_0x226908){if(_0x226908){freeIsNotKeySip(_0x226908,_0x11e7e7[_0xc1be('0xf')]);for(var _0x14ff8e=0x0,_0x15d7f3={},_0x2d535f={};_0x14ff8e<_0x226908[_0xc1be('0x41')];_0x14ff8e+=0x1){_0x15d7f3=_0x226908[_0x14ff8e];if(_[_0xc1be('0x42')](_0x11e7e7[_0xc1be('0xf')][util[_0xc1be('0x26')]('SIP/%s',_0x15d7f3[_0xc1be('0x28')])])){_0x11e7e7[_0xc1be('0xf')][util[_0xc1be('0x26')](_0xc1be('0x27'),_0x15d7f3[_0xc1be('0x28')])]=new Telephone(_0x15d7f3);}else{_0x11e7e7[_0xc1be('0x3f')](_0x11e7e7['telephones'][util[_0xc1be('0x26')](_0xc1be('0x27'),_0x15d7f3['name'])],_0x15d7f3);}}}return _0x11e7e7[_0xc1be('0xf')];};};Realtime[_0xc1be('0x3e')]['initTrunks']=function(){var _0x5095ee=this;return function(_0x8045c2){if(_0x8045c2){freeIsNotKeySip(_0x8045c2,_0x5095ee[_0xc1be('0x10')]);for(var _0x2b1e6f=0x0,_0x32f331={},_0x370b23={};_0x2b1e6f<_0x8045c2[_0xc1be('0x41')];_0x2b1e6f+=0x1){_0x32f331=_0x8045c2[_0x2b1e6f];if(_[_0xc1be('0x42')](_0x5095ee[_0xc1be('0x10')][util['format'](_0xc1be('0x27'),_0x32f331[_0xc1be('0x28')])])){_0x5095ee[_0xc1be('0x10')][util[_0xc1be('0x26')](_0xc1be('0x27'),_0x32f331[_0xc1be('0x28')])]=new Trunk(_0x32f331);}else{_0x5095ee[_0xc1be('0x3f')](_0x5095ee[_0xc1be('0x10')][util[_0xc1be('0x26')]('SIP/%s',_0x32f331[_0xc1be('0x28')])],_0x32f331);}}}return _0x5095ee[_0xc1be('0x10')];};};Realtime[_0xc1be('0x3e')][_0xc1be('0x44')]=function(){var _0x20e683=this;return function(_0x2e23ad){if(_0x2e23ad){freeIsNotKey(_0x2e23ad,_0x20e683[_0xc1be('0x45')],_0xc1be('0x28'));for(var _0x5dbffe=0x0,_0x1b606c={},_0xeb2eaa={};_0x5dbffe<_0x2e23ad[_0xc1be('0x41')];_0x5dbffe+=0x1){_0x1b606c=_0x2e23ad[_0x5dbffe];if(_[_0xc1be('0x42')](_0x20e683['voiceQueues'][_0x1b606c['name']])){_0x20e683[_0xc1be('0x45')][_0x1b606c['name']]=new VoiceQueue(_0x1b606c);}else{_0x20e683['mergeFromDatabase'](_0x20e683['voiceQueues'][_0x1b606c[_0xc1be('0x28')]],_0x1b606c);}}}return _0x20e683['voiceQueues'];};};Realtime[_0xc1be('0x3e')][_0xc1be('0x46')]=function(){var _0x34e472=this;return function(_0x5de131){if(_0x5de131){freeIsNotKey(_0x5de131,_0x34e472[_0xc1be('0x11')],'id');for(var _0x42f68d=0x0,_0x1b2077={},_0x5d39d6={};_0x42f68d<_0x5de131[_0xc1be('0x41')];_0x42f68d+=0x1){_0x1b2077=_0x5de131[_0x42f68d];if(_['isUndefined'](_0x34e472['triggers'][_0x1b2077['id']])){_0x34e472[_0xc1be('0x11')][_0x1b2077['id']]=new Trigger(_0x1b2077);}else{_0x34e472[_0xc1be('0x3f')](_0x34e472[_0xc1be('0x11')][_0x1b2077['id']],_0x1b2077);}}}return _0x34e472['triggers'];};};Realtime[_0xc1be('0x3e')]['initTemplates']=function(){var _0x4857f0=this;return function(_0x5d5311){if(_0x5d5311){freeIsNotKey(_0x5d5311,_0x4857f0['templates'],'id');for(var _0x158529=0x0,_0x58a0b7={},_0x382320={};_0x158529<_0x5d5311[_0xc1be('0x41')];_0x158529+=0x1){_0x58a0b7=_0x5d5311[_0x158529];if(_[_0xc1be('0x42')](_0x4857f0[_0xc1be('0x13')][_0x58a0b7['id']])){_0x4857f0[_0xc1be('0x13')][_0x58a0b7['id']]=new Template(_0x58a0b7);}else{_0x4857f0['mergeFromDatabase'](_0x4857f0[_0xc1be('0x13')][_0x58a0b7['id']],_0x58a0b7);}}}return _0x4857f0[_0xc1be('0x13')];};};Realtime[_0xc1be('0x3e')][_0xc1be('0x47')]=function(){var _0x345145=this;return function(_0x2da202){if(_0x2da202){freeIsNotKey(_0x2da202,_0x345145[_0xc1be('0x48')],'id');for(var _0x31af21=0x0,_0x277362={},_0x49659f={};_0x31af21<_0x2da202[_0xc1be('0x41')];_0x31af21+=0x1){_0x277362=_0x2da202[_0x31af21];if(_['isUndefined'](_0x345145[_0xc1be('0x48')][_0x277362['id']])){_0x345145[_0xc1be('0x48')][_0x277362['id']]=new ZendeskAccount(_0x277362);}else{_0x345145[_0xc1be('0x3f')](_0x345145[_0xc1be('0x48')][_0x277362['id']],_0x277362);}}}return _0x345145[_0xc1be('0x48')];};};Realtime[_0xc1be('0x3e')][_0xc1be('0x49')]=function(){var _0x3febbe=this;return function(_0x142f6a){if(_0x142f6a){freeIsNotKey(_0x142f6a,_0x3febbe['salesforceAccounts'],'id');for(var _0x39214e=0x0,_0x575cb1={},_0x23ac30={};_0x39214e<_0x142f6a[_0xc1be('0x41')];_0x39214e+=0x1){_0x575cb1=_0x142f6a[_0x39214e];if(_[_0xc1be('0x42')](_0x3febbe[_0xc1be('0x1b')][_0x575cb1['id']])){_0x3febbe[_0xc1be('0x1b')][_0x575cb1['id']]=new SalesforceAccount(_0x575cb1);}else{_0x3febbe[_0xc1be('0x3f')](_0x3febbe[_0xc1be('0x1b')][_0x575cb1['id']],_0x575cb1);}}}return _0x3febbe[_0xc1be('0x1b')];};};Realtime[_0xc1be('0x3e')][_0xc1be('0x4a')]=function(){var _0x36504e=this;return function(_0x1504bf){if(_0x1504bf){freeIsNotKey(_0x1504bf,_0x36504e[_0xc1be('0x1d')],'id');for(var _0x407e79=0x0,_0x400595={},_0x5d1259={};_0x407e79<_0x1504bf[_0xc1be('0x41')];_0x407e79+=0x1){_0x400595=_0x1504bf[_0x407e79];if(_[_0xc1be('0x42')](_0x36504e[_0xc1be('0x1d')][_0x400595['id']])){_0x36504e[_0xc1be('0x1d')][_0x400595['id']]=new FreshdeskAccount(_0x400595);}else{_0x36504e[_0xc1be('0x3f')](_0x36504e[_0xc1be('0x1d')][_0x400595['id']],_0x400595);}}}return _0x36504e[_0xc1be('0x1d')];};};Realtime[_0xc1be('0x3e')][_0xc1be('0x4b')]=function(){var _0x5533af=this;return function(_0x18808f){if(_0x18808f){freeIsNotKey(_0x18808f,_0x5533af[_0xc1be('0x1e')],'id');for(var _0x47a296=0x0,_0x37c18f={},_0x51e31b={};_0x47a296<_0x18808f['length'];_0x47a296+=0x1){_0x37c18f=_0x18808f[_0x47a296];if(_[_0xc1be('0x42')](_0x5533af[_0xc1be('0x1e')][_0x37c18f['id']])){_0x5533af[_0xc1be('0x1e')][_0x37c18f['id']]=new ZohoAccount(_0x37c18f);}else{_0x5533af[_0xc1be('0x3f')](_0x5533af[_0xc1be('0x1e')][_0x37c18f['id']],_0x37c18f);}}}return _0x5533af['zohoAccounts'];};};Realtime[_0xc1be('0x3e')]['initDeskAccounts']=function(){var _0x631e2d=this;return function(_0x435718){if(_0x435718){freeIsNotKey(_0x435718,_0x631e2d[_0xc1be('0x1f')],'id');for(var _0x525361=0x0,_0x4b3bf4={},_0x1ba161={};_0x525361<_0x435718[_0xc1be('0x41')];_0x525361+=0x1){_0x4b3bf4=_0x435718[_0x525361];if(_[_0xc1be('0x42')](_0x631e2d['deskAccounts'][_0x4b3bf4['id']])){_0x631e2d[_0xc1be('0x1f')][_0x4b3bf4['id']]=new DeskAccount(_0x4b3bf4);}else{_0x631e2d['mergeFromDatabase'](_0x631e2d[_0xc1be('0x1f')][_0x4b3bf4['id']],_0x4b3bf4);}}}return _0x631e2d['deskAccounts'];};};Realtime[_0xc1be('0x3e')]['initSugarcrmAccounts']=function(){var _0x3264eb=this;return function(_0x16917c){if(_0x16917c){freeIsNotKey(_0x16917c,_0x3264eb[_0xc1be('0x1c')],'id');for(var _0x33d8b2=0x0,_0x2b0d71={},_0x3485b6={};_0x33d8b2<_0x16917c[_0xc1be('0x41')];_0x33d8b2+=0x1){_0x2b0d71=_0x16917c[_0x33d8b2];if(_[_0xc1be('0x42')](_0x3264eb[_0xc1be('0x1c')][_0x2b0d71['id']])){_0x3264eb[_0xc1be('0x1c')][_0x2b0d71['id']]=new SugarcrmAccount(_0x2b0d71);}else{_0x3264eb['mergeFromDatabase'](_0x3264eb[_0xc1be('0x1c')][_0x2b0d71['id']],_0x2b0d71);}}}return _0x3264eb['sugarcrmAccounts'];};};Realtime[_0xc1be('0x3e')][_0xc1be('0x4c')]=function(){var _0x2c05e2=this;return function(_0x439b94){if(_0x439b94){freeIsNotKey(_0x439b94,_0x2c05e2[_0xc1be('0x20')],'id');for(var _0x574b62=0x0,_0x24f51a={},_0x324c7e={};_0x574b62<_0x439b94['length'];_0x574b62+=0x1){_0x24f51a=_0x439b94[_0x574b62];if(_[_0xc1be('0x42')](_0x2c05e2[_0xc1be('0x20')][_0x24f51a['id']])){_0x2c05e2[_0xc1be('0x20')][_0x24f51a['id']]=new VtigerAccount(_0x24f51a);}else{_0x2c05e2[_0xc1be('0x3f')](_0x2c05e2[_0xc1be('0x20')][_0x24f51a['id']],_0x24f51a);}}}return _0x2c05e2[_0xc1be('0x20')];};};Realtime[_0xc1be('0x3e')][_0xc1be('0x4d')]=function(){var _0x14e574=this;return function(_0x13eb93){if(_0x13eb93){freeIsNotKey(_0x13eb93,_0x14e574[_0xc1be('0x21')],'id');for(var _0x27172b=0x0,_0x1f3d26={},_0xd0b649={};_0x27172b<_0x13eb93[_0xc1be('0x41')];_0x27172b+=0x1){_0x1f3d26=_0x13eb93[_0x27172b];if(_[_0xc1be('0x42')](_0x14e574[_0xc1be('0x21')][_0x1f3d26['id']])){_0x14e574[_0xc1be('0x21')][_0x1f3d26['id']]=new ServicenowAccount(_0x1f3d26);}else{_0x14e574[_0xc1be('0x3f')](_0x14e574['servicenowAccounts'][_0x1f3d26['id']],_0x1f3d26);}}}return _0x14e574[_0xc1be('0x21')];};};Realtime[_0xc1be('0x3e')][_0xc1be('0x4e')]=function(){var _0x367474=this;return function(_0x2cbaf8){if(_0x2cbaf8){freeIsNotKey(_0x2cbaf8,_0x367474[_0xc1be('0x4f')],'id');for(var _0x1334f7=0x0,_0x32fc69={},_0x4dd827={};_0x1334f7<_0x2cbaf8[_0xc1be('0x41')];_0x1334f7+=0x1){_0x32fc69=_0x2cbaf8[_0x1334f7];if(_[_0xc1be('0x42')](_0x367474[_0xc1be('0x4f')][_0x32fc69['id']])){_0x367474['dynamics365Accounts'][_0x32fc69['id']]=new Dynamics365Account(_0x32fc69);}else{_0x367474[_0xc1be('0x3f')](_0x367474['dynamics365Accounts'][_0x32fc69['id']],_0x32fc69);}}}return _0x367474[_0xc1be('0x4f')];};};Realtime[_0xc1be('0x3e')][_0xc1be('0x50')]=function(){var _0x352e53=this;return function(_0x125070){if(_0x125070){freeIsNotKey(_0x125070,_0x352e53[_0xc1be('0x22')],'id');for(var _0x5235ae=0x0,_0x3cbc1f={},_0x1c2f6d={};_0x5235ae<_0x125070[_0xc1be('0x41')];_0x5235ae+=0x1){_0x3cbc1f=_0x125070[_0x5235ae];if(_['isUndefined'](_0x352e53['freshsalesAccounts'][_0x3cbc1f['id']])){_0x352e53[_0xc1be('0x22')][_0x3cbc1f['id']]=new FreshsalesAccount(_0x3cbc1f);}else{_0x352e53[_0xc1be('0x3f')](_0x352e53[_0xc1be('0x22')][_0x3cbc1f['id']],_0x3cbc1f);}}}return _0x352e53[_0xc1be('0x22')];};};Realtime['prototype']['initVoiceQueueHopperHistory']=function(){var _0x4eeef0=this;return function(_0x5aa924){for(var _0x116cba=0x0;_0x116cba<_0x5aa924['length'];_0x116cba+=0x1){_[_0xc1be('0x51')](_0x4eeef0['voiceQueues'][_0x5aa924[_0x116cba][_0xc1be('0x28')]],_0x5aa924[_0x116cba]);}return _0x4eeef0['voiceQueues'];};};Realtime['prototype'][_0xc1be('0x52')]=function(){var _0x5ebc40=this;return function(_0x2f430e){clearVoiceQueues(_0x5ebc40[_0xc1be('0x45')]);if(_0x2f430e){_0x2f430e=_[_0xc1be('0x53')](_0x2f430e,'uniqueid');for(var _0x235135 in _0x2f430e){if(_0x2f430e[_0xc1be('0x25')](_0x235135)){var _0x1d0c49={};for(var _0x7b7863=0x0;_0x7b7863<_0x2f430e[_0x235135][_0xc1be('0x41')];_0x7b7863+=0x1){var _0x4fa058=_0x2f430e[_0x235135][_0x7b7863][_0xc1be('0x54')];if(_0x5ebc40[_0xc1be('0x45')][_0x4fa058]){if(_0x2f430e[_0x235135][_0x7b7863][_0xc1be('0x55')]){_0x5ebc40[_0xc1be('0x45')][_0x4fa058]['unmanaged']+=0x1;}if(_0x2f430e[_0x235135][_0x7b7863]['queuecallerabandon']){_0x5ebc40[_0xc1be('0x45')][_0x4fa058][_0xc1be('0x32')]+=0x1;}_0x5ebc40[_0xc1be('0x45')][_0x4fa058][_0xc1be('0x2c')]+=moment(_0x2f430e[_0x235135][_0x7b7863]['queuecallerleaveAt'])[_0xc1be('0x56')](moment(_0x2f430e[_0x235135][_0x7b7863][_0xc1be('0x57')]),'seconds')||0x0;if(_0x7b7863===_0x2f430e[_0x235135][_0xc1be('0x41')]-0x1){_0x5ebc40[_0xc1be('0x45')][_0x4fa058][_0xc1be('0x2d')]+=moment(_0x2f430e[_0x235135][_0x7b7863]['queuecallercompleteAt']||_0x2f430e[_0x235135][_0x7b7863][_0xc1be('0x58')]||_0x2f430e[_0x235135][_0x7b7863]['queuecallerexitAt'])['diff'](moment(_0x2f430e[_0x235135][_0x7b7863][_0xc1be('0x57')]),'seconds')||0x0;_0x5ebc40[_0xc1be('0x45')][_0x4fa058][_0xc1be('0x2b')]+=0x1;if(_0x2f430e[_0x235135][_0x7b7863][_0xc1be('0x59')]){_0x5ebc40[_0xc1be('0x45')][_0x4fa058]['answered']+=0x1;_0x5ebc40['voiceQueues'][_0x4fa058]['sumBillable']+=moment(_0x2f430e[_0x235135][_0x7b7863][_0xc1be('0x5a')])['diff'](moment(_0x2f430e[_0x235135][_0x7b7863][_0xc1be('0x5b')]),_0xc1be('0x5c'))||0x0;}}else{_0x5ebc40[_0xc1be('0x45')][_0x4fa058][_0xc1be('0x2d')]+=_0x5ebc40[_0xc1be('0x45')][_0x4fa058]['sumHoldTime']||0x0;}}}}}}return _0x5ebc40[_0xc1be('0x45')];};};Realtime[_0xc1be('0x3e')][_0xc1be('0x5d')]=function(){var _0x2f3cd4=this;return function(_0x489fbd){clearVoiceCallReports(_0x2f3cd4['outbound']);if(_0x489fbd){for(var _0x1985c0=0x0;_0x1985c0<_0x489fbd[_0xc1be('0x41')];_0x1985c0+=0x1){_0x2f3cd4['outbound'][_0xc1be('0x2b')]+=0x1;_0x2f3cd4[_0xc1be('0x14')][_0xc1be('0x2d')]+=_0x489fbd[_0x1985c0][_0xc1be('0x5e')];if(_0x489fbd[_0x1985c0][_0xc1be('0x5f')]==='ANSWERED'){_0x2f3cd4[_0xc1be('0x14')]['answered']+=0x1;_0x2f3cd4['outbound']['sumHoldTime']+=_0x489fbd[_0x1985c0][_0xc1be('0x5e')]-_0x489fbd[_0x1985c0][_0xc1be('0x60')]||0x0;_0x2f3cd4['outbound']['sumBillable']+=_0x489fbd[_0x1985c0][_0xc1be('0x60')];}}}return _0x2f3cd4['outbound'];};};Realtime[_0xc1be('0x3e')][_0xc1be('0x61')]=function(){var _0x24303e=this;return function(_0x4447c8){if(_0x4447c8){freeIsNotKey(_0x4447c8,_0x24303e[_0xc1be('0x12')],_0xc1be('0x28'));for(var _0x12b825=0x0,_0x1f9260={};_0x12b825<_0x4447c8[_0xc1be('0x41')];_0x12b825+=0x1){_0x1f9260=_0x4447c8[_0x12b825];if(_[_0xc1be('0x42')](_0x24303e['campaigns'][_0x1f9260['name']])){_0x24303e[_0xc1be('0x12')][_0x1f9260[_0xc1be('0x28')]]=new Campaign(_0x1f9260);}else{_0x24303e[_0xc1be('0x3f')](_0x24303e[_0xc1be('0x12')][_0x1f9260['name']],_0x1f9260);_0x24303e[_0xc1be('0x12')][_0x1f9260[_0xc1be('0x28')]][_0xc1be('0x62')]=_0x1f9260[_0xc1be('0x63')]?_0x1f9260[_0xc1be('0x63')][_0xc1be('0x28')]:undefined;}}}return _0x24303e['campaigns'];};};Realtime[_0xc1be('0x3e')][_0xc1be('0x64')]=function(){var _0x5002c6=this;return function(_0x5be1aa){if(_0x5be1aa){freeIsNotKey(_0x5be1aa,_0x5002c6['voiceExtensions'],'id');for(var _0x1b9196=0x0,_0x339efb={};_0x1b9196<_0x5be1aa['length'];_0x1b9196+=0x1){_0x339efb=_0x5be1aa[_0x1b9196];if(_['isUndefined'](_0x5002c6[_0xc1be('0x15')][_0x339efb['id']])){_0x5002c6[_0xc1be('0x15')][_0x339efb['id']]=new VoiceExtension(_0x339efb);}else{_0x5002c6[_0xc1be('0x3f')](_0x5002c6[_0xc1be('0x15')][_0x339efb['id']],_0x339efb);}}}return _0x5002c6[_0xc1be('0x15')];};};Realtime[_0xc1be('0x3e')][_0xc1be('0x65')]=function(){var _0x547fa4=this;return function(_0x126c36){clearCampaigns(_0x547fa4[_0xc1be('0x12')]);for(var _0x16c37f=0x0;_0x16c37f<_0x126c36[_0xc1be('0x41')];_0x16c37f+=0x1){_[_0xc1be('0x51')](_0x547fa4[_0xc1be('0x12')][_0x126c36[_0x16c37f]['name']],_0x126c36[_0x16c37f]);}return _0x547fa4['campaigns'];};};Realtime[_0xc1be('0x3e')][_0xc1be('0x66')]=function(){var _0x2d16e2=this;return function(_0xaf5dde){if(_0xaf5dde){freeIsNotKey(_0xaf5dde,_0x2d16e2[_0xc1be('0x23')],'id');for(var _0x2018b6=0x0,_0x1377f5={},_0x497186={};_0x2018b6<_0xaf5dde['length'];_0x2018b6+=0x1){_0x1377f5=_0xaf5dde[_0x2018b6];if(_[_0xc1be('0x42')](_0x2d16e2['faxAccounts'][_0x1377f5['id']])){_0x2d16e2[_0xc1be('0x23')][_0x1377f5['id']]=new FaxAccount(_0x1377f5);}else{_0x2d16e2[_0xc1be('0x3f')](_0x2d16e2['faxAccounts'][_0x1377f5['id']],_0x1377f5);}}}return _0x2d16e2[_0xc1be('0x23')];};};module[_0xc1be('0x67')]=Realtime; \ No newline at end of file +var _0x0eb1=['initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','outbound','duration','disposition','ANSWERED','billableseconds','initCampaigns','initFaxAccounts','exports','bluebird','util','lodash','moment','../model/agent','../model/telephone','../model/voiceQueue','../model/trigger','../model/template','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','triggers','campaigns','templates','voiceExtensions','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','zohoAccounts','vtigerAccounts','dynamics365Accounts','faxAccounts','mapKeys','format','SIP/%s','name','isNil','interface','hasOwnProperty','answered','sumHoldTime','sumDuration','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','total','unmanaged','abandoned','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','isUndefined','initTelephones','initVoiceQueues','voiceQueues','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','freshdeskAccounts','initZohoAccounts','initDeskAccounts','deskAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts'];(function(_0x38ec38,_0xaa8f00){var _0x22f158=function(_0x593811){while(--_0x593811){_0x38ec38['push'](_0x38ec38['shift']());}};_0x22f158(++_0xaa8f00);}(_0x0eb1,0x87));var _0x10eb=function(_0x63e61c,_0x20e29f){_0x63e61c=_0x63e61c-0x0;var _0x14da51=_0x0eb1[_0x63e61c];return _0x14da51;};'use strict';var BPromise=require(_0x10eb('0x0'));var util=require(_0x10eb('0x1'));var _=require(_0x10eb('0x2'));var moment=require(_0x10eb('0x3'));var Agent=require(_0x10eb('0x4'));var Telephone=require(_0x10eb('0x5'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0x10eb('0x6'));var Trigger=require(_0x10eb('0x7'));var Template=require(_0x10eb('0x8'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0x10eb('0x9'));var ZendeskAccount=require(_0x10eb('0xa'));var SalesforceAccount=require(_0x10eb('0xb'));var FreshdeskAccount=require(_0x10eb('0xc'));var SugarcrmAccount=require(_0x10eb('0xd'));var ZohoAccount=require(_0x10eb('0xe'));var DeskAccount=require(_0x10eb('0xf'));var VtigerAccount=require(_0x10eb('0x10'));var ServicenowAccount=require(_0x10eb('0x11'));var Dynamics365Account=require(_0x10eb('0x12'));var FreshsalesAccount=require(_0x10eb('0x13'));var FaxAccount=require(_0x10eb('0x14'));var Realtime=function(){this[_0x10eb('0x15')]={};this[_0x10eb('0x16')]={};this[_0x10eb('0x17')]={};this['voiceQueues']={};this[_0x10eb('0x18')]={};this[_0x10eb('0x19')]={};this[_0x10eb('0x1a')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x10eb('0x1b')]={};this['channels']={};this['queueChannels']={};this[_0x10eb('0x1c')]={};this[_0x10eb('0x1d')]={};this[_0x10eb('0x1e')]={};this[_0x10eb('0x1f')]={};this['salesforceAccounts']={};this[_0x10eb('0x20')]={};this['freshdeskAccounts']={};this[_0x10eb('0x21')]={};this['deskAccounts']={};this[_0x10eb('0x22')]={};this['servicenowAccounts']={};this[_0x10eb('0x23')]={};this['freshsalesAccounts']={};this[_0x10eb('0x24')]={};};function freeIsNotKey(_0x3c0681,_0x30c367,_0x49ac03){var _0x1539c5=_[_0x10eb('0x25')](_0x3c0681,function(_0x3bbc78,_0x735ff0){return _0x3bbc78[_0x49ac03];});for(var _0x57ae6c in _0x30c367){if(_0x30c367['hasOwnProperty'](_0x57ae6c)){if(!_0x1539c5[_0x57ae6c]){delete _0x30c367[_0x57ae6c];}}}}function freeIsNotKeySip(_0x437c50,_0x49c2e6){var _0x1fb23d=_['mapKeys'](_0x437c50,function(_0x1fb252,_0x24a3ef){return util[_0x10eb('0x26')](_0x10eb('0x27'),_0x1fb252[_0x10eb('0x28')]);});for(var _0x1d0bc2 in _0x49c2e6){if(_0x49c2e6['hasOwnProperty'](_0x1d0bc2)){if(!_0x1fb23d[_0x1d0bc2]){delete _0x49c2e6[_0x1d0bc2];}}}}function freeIsNotKeyAgent(_0x1e0d7a,_0x2476be){var _0x5c141b=_[_0x10eb('0x25')](_0x1e0d7a,function(_0x5cedd6,_0x139aee){var _0x1a2144=_[_0x10eb('0x29')](_0x5cedd6[_0x10eb('0x2a')])?util['format'](_0x10eb('0x27'),_0x5cedd6[_0x10eb('0x28')]):_0x5cedd6['interface'];return _0x1a2144;});for(var _0x3d54d2 in _0x2476be){if(_0x2476be[_0x10eb('0x2b')](_0x3d54d2)){if(!_0x5c141b[_0x3d54d2]){delete _0x2476be[_0x3d54d2];}}}}function clearVoiceCallReports(_0xdb9766){_0xdb9766['total']=0x0;_0xdb9766[_0x10eb('0x2c')]=0x0;_0xdb9766[_0x10eb('0x2d')]=0x0;_0xdb9766[_0x10eb('0x2e')]=0x0;_0xdb9766['sumBillable']=0x0;}function clearCampaigns(_0x1397f0){if(!_[_0x10eb('0x2f')](_0x1397f0)){for(var _0x149946 in _0x1397f0){if(_0x1397f0['hasOwnProperty'](_0x149946)){_0x1397f0[_0x149946][_0x10eb('0x30')]=0x0;_0x1397f0[_0x149946][_0x10eb('0x31')]=0x0;}}}}function clearVoiceQueues(_0x48c365){if(!_[_0x10eb('0x2f')](_0x48c365)){for(var _0xb59a78 in _0x48c365){if(_0x48c365[_0x10eb('0x2b')](_0xb59a78)){_0x48c365[_0xb59a78][_0x10eb('0x32')]=0x0;_0x48c365[_0xb59a78][_0x10eb('0x2c')]=0x0;_0x48c365[_0xb59a78][_0x10eb('0x33')]=0x0;_0x48c365[_0xb59a78][_0x10eb('0x34')]=0x0;_0x48c365[_0xb59a78][_0x10eb('0x2d')]=0x0;_0x48c365[_0xb59a78]['sumDuration']=0x0;_0x48c365[_0xb59a78][_0x10eb('0x35')]=0x0;_0x48c365[_0xb59a78][_0x10eb('0x36')]=0x0;_0x48c365[_0xb59a78][_0x10eb('0x37')]=0x0;_0x48c365[_0xb59a78][_0x10eb('0x38')]=0x0;_0x48c365[_0xb59a78][_0x10eb('0x39')]=0x0;_0x48c365[_0xb59a78][_0x10eb('0x3a')]=0x0;_0x48c365[_0xb59a78][_0x10eb('0x3b')]=0x0;_0x48c365[_0xb59a78][_0x10eb('0x3c')]=0x0;_0x48c365[_0xb59a78][_0x10eb('0x3d')]=0x0;_0x48c365[_0xb59a78][_0x10eb('0x3e')]=0x0;_0x48c365[_0xb59a78][_0x10eb('0x3f')]=0x0;_0x48c365[_0xb59a78][_0x10eb('0x40')]=0x0;_0x48c365[_0xb59a78][_0x10eb('0x41')]=0x0;_0x48c365[_0xb59a78][_0x10eb('0x36')]=0x0;_0x48c365[_0xb59a78][_0x10eb('0x42')]=0x0;_0x48c365[_0xb59a78][_0x10eb('0x43')]=!![];}}}}Realtime[_0x10eb('0x44')][_0x10eb('0x45')]=function(_0x216955,_0x431e71){for(var _0x261244 in _0x431e71){if(_0x216955[_0x10eb('0x2b')](_0x261244)){_0x216955[_0x261244]=_0x431e71[_0x261244];}}};Realtime[_0x10eb('0x44')][_0x10eb('0x46')]=function(){var _0x35ce28=this;return function(_0xec614c){if(_0xec614c){freeIsNotKeyAgent(_0xec614c,_0x35ce28[_0x10eb('0x15')]);for(var _0x37044e=0x0,_0x4e3865={},_0x37a50c={};_0x37044e<_0xec614c[_0x10eb('0x47')];_0x37044e+=0x1){_0x4e3865=_0xec614c[_0x37044e];var _0x235d74=_['isNil'](_0x4e3865[_0x10eb('0x2a')])?util[_0x10eb('0x26')]('SIP/%s',_0x4e3865[_0x10eb('0x28')]):_0x4e3865[_0x10eb('0x2a')];if(_[_0x10eb('0x48')](_0x35ce28['agents'][_0x235d74])){_0x35ce28['agents'][_0x235d74]=new Agent(_0x4e3865);}else{_0x35ce28[_0x10eb('0x45')](_0x35ce28[_0x10eb('0x15')][_0x235d74],_0x4e3865);}}}return _0x35ce28[_0x10eb('0x15')];};};Realtime[_0x10eb('0x44')][_0x10eb('0x49')]=function(){var _0x4cafcf=this;return function(_0x5c10cf){if(_0x5c10cf){freeIsNotKeySip(_0x5c10cf,_0x4cafcf['telephones']);for(var _0x475340=0x0,_0x1b14a5={},_0x21eaae={};_0x475340<_0x5c10cf[_0x10eb('0x47')];_0x475340+=0x1){_0x1b14a5=_0x5c10cf[_0x475340];if(_[_0x10eb('0x48')](_0x4cafcf[_0x10eb('0x16')][util[_0x10eb('0x26')]('SIP/%s',_0x1b14a5[_0x10eb('0x28')])])){_0x4cafcf[_0x10eb('0x16')][util[_0x10eb('0x26')](_0x10eb('0x27'),_0x1b14a5[_0x10eb('0x28')])]=new Telephone(_0x1b14a5);}else{_0x4cafcf['mergeFromDatabase'](_0x4cafcf['telephones'][util[_0x10eb('0x26')]('SIP/%s',_0x1b14a5[_0x10eb('0x28')])],_0x1b14a5);}}}return _0x4cafcf[_0x10eb('0x16')];};};Realtime[_0x10eb('0x44')]['initTrunks']=function(){var _0x5c4bfc=this;return function(_0x4e4bb5){if(_0x4e4bb5){freeIsNotKeySip(_0x4e4bb5,_0x5c4bfc[_0x10eb('0x17')]);for(var _0x1a1a84=0x0,_0xbe7e0f={},_0x121d01={};_0x1a1a84<_0x4e4bb5['length'];_0x1a1a84+=0x1){_0xbe7e0f=_0x4e4bb5[_0x1a1a84];if(_['isUndefined'](_0x5c4bfc['trunks'][util[_0x10eb('0x26')](_0x10eb('0x27'),_0xbe7e0f['name'])])){_0x5c4bfc[_0x10eb('0x17')][util[_0x10eb('0x26')](_0x10eb('0x27'),_0xbe7e0f[_0x10eb('0x28')])]=new Trunk(_0xbe7e0f);}else{_0x5c4bfc[_0x10eb('0x45')](_0x5c4bfc['trunks'][util[_0x10eb('0x26')]('SIP/%s',_0xbe7e0f[_0x10eb('0x28')])],_0xbe7e0f);}}}return _0x5c4bfc[_0x10eb('0x17')];};};Realtime[_0x10eb('0x44')][_0x10eb('0x4a')]=function(){var _0x38362c=this;return function(_0x488945){if(_0x488945){freeIsNotKey(_0x488945,_0x38362c[_0x10eb('0x4b')],'name');for(var _0x4ce764=0x0,_0x514ad2={},_0x54d543={};_0x4ce764<_0x488945[_0x10eb('0x47')];_0x4ce764+=0x1){_0x514ad2=_0x488945[_0x4ce764];if(_['isUndefined'](_0x38362c[_0x10eb('0x4b')][_0x514ad2['name']])){_0x38362c['voiceQueues'][_0x514ad2[_0x10eb('0x28')]]=new VoiceQueue(_0x514ad2);}else{_0x38362c['mergeFromDatabase'](_0x38362c[_0x10eb('0x4b')][_0x514ad2['name']],_0x514ad2);}}}return _0x38362c[_0x10eb('0x4b')];};};Realtime[_0x10eb('0x44')][_0x10eb('0x4c')]=function(){var _0x16fa43=this;return function(_0x269ded){if(_0x269ded){freeIsNotKey(_0x269ded,_0x16fa43[_0x10eb('0x18')],'id');for(var _0x12f31a=0x0,_0x135c1b={},_0x29ada4={};_0x12f31a<_0x269ded['length'];_0x12f31a+=0x1){_0x135c1b=_0x269ded[_0x12f31a];if(_[_0x10eb('0x48')](_0x16fa43['triggers'][_0x135c1b['id']])){_0x16fa43[_0x10eb('0x18')][_0x135c1b['id']]=new Trigger(_0x135c1b);}else{_0x16fa43[_0x10eb('0x45')](_0x16fa43['triggers'][_0x135c1b['id']],_0x135c1b);}}}return _0x16fa43[_0x10eb('0x18')];};};Realtime[_0x10eb('0x44')][_0x10eb('0x4d')]=function(){var _0x5386c9=this;return function(_0x84b4f2){if(_0x84b4f2){freeIsNotKey(_0x84b4f2,_0x5386c9[_0x10eb('0x1a')],'id');for(var _0x25d89d=0x0,_0x15489c={},_0x2baeb4={};_0x25d89d<_0x84b4f2[_0x10eb('0x47')];_0x25d89d+=0x1){_0x15489c=_0x84b4f2[_0x25d89d];if(_['isUndefined'](_0x5386c9[_0x10eb('0x1a')][_0x15489c['id']])){_0x5386c9[_0x10eb('0x1a')][_0x15489c['id']]=new Template(_0x15489c);}else{_0x5386c9['mergeFromDatabase'](_0x5386c9[_0x10eb('0x1a')][_0x15489c['id']],_0x15489c);}}}return _0x5386c9[_0x10eb('0x1a')];};};Realtime[_0x10eb('0x44')][_0x10eb('0x4e')]=function(){var _0x1fefad=this;return function(_0x1deac9){if(_0x1deac9){freeIsNotKey(_0x1deac9,_0x1fefad[_0x10eb('0x1f')],'id');for(var _0x247027=0x0,_0x118733={},_0x19f05f={};_0x247027<_0x1deac9['length'];_0x247027+=0x1){_0x118733=_0x1deac9[_0x247027];if(_[_0x10eb('0x48')](_0x1fefad[_0x10eb('0x1f')][_0x118733['id']])){_0x1fefad[_0x10eb('0x1f')][_0x118733['id']]=new ZendeskAccount(_0x118733);}else{_0x1fefad['mergeFromDatabase'](_0x1fefad[_0x10eb('0x1f')][_0x118733['id']],_0x118733);}}}return _0x1fefad['zendeskAccounts'];};};Realtime['prototype'][_0x10eb('0x4f')]=function(){var _0x4d8c93=this;return function(_0x47dcfd){if(_0x47dcfd){freeIsNotKey(_0x47dcfd,_0x4d8c93['salesforceAccounts'],'id');for(var _0x18d279=0x0,_0x3dab44={},_0x18c3c4={};_0x18d279<_0x47dcfd['length'];_0x18d279+=0x1){_0x3dab44=_0x47dcfd[_0x18d279];if(_[_0x10eb('0x48')](_0x4d8c93[_0x10eb('0x50')][_0x3dab44['id']])){_0x4d8c93[_0x10eb('0x50')][_0x3dab44['id']]=new SalesforceAccount(_0x3dab44);}else{_0x4d8c93['mergeFromDatabase'](_0x4d8c93[_0x10eb('0x50')][_0x3dab44['id']],_0x3dab44);}}}return _0x4d8c93[_0x10eb('0x50')];};};Realtime['prototype']['initFreshdeskAccounts']=function(){var _0x325107=this;return function(_0x199c66){if(_0x199c66){freeIsNotKey(_0x199c66,_0x325107[_0x10eb('0x51')],'id');for(var _0x2c33cf=0x0,_0x5e0f24={},_0x5d386b={};_0x2c33cf<_0x199c66[_0x10eb('0x47')];_0x2c33cf+=0x1){_0x5e0f24=_0x199c66[_0x2c33cf];if(_[_0x10eb('0x48')](_0x325107[_0x10eb('0x51')][_0x5e0f24['id']])){_0x325107[_0x10eb('0x51')][_0x5e0f24['id']]=new FreshdeskAccount(_0x5e0f24);}else{_0x325107[_0x10eb('0x45')](_0x325107['freshdeskAccounts'][_0x5e0f24['id']],_0x5e0f24);}}}return _0x325107[_0x10eb('0x51')];};};Realtime[_0x10eb('0x44')][_0x10eb('0x52')]=function(){var _0x20cddb=this;return function(_0xd9e4b1){if(_0xd9e4b1){freeIsNotKey(_0xd9e4b1,_0x20cddb['zohoAccounts'],'id');for(var _0x3ab53f=0x0,_0x52ca77={},_0x1555cd={};_0x3ab53f<_0xd9e4b1[_0x10eb('0x47')];_0x3ab53f+=0x1){_0x52ca77=_0xd9e4b1[_0x3ab53f];if(_[_0x10eb('0x48')](_0x20cddb['zohoAccounts'][_0x52ca77['id']])){_0x20cddb[_0x10eb('0x21')][_0x52ca77['id']]=new ZohoAccount(_0x52ca77);}else{_0x20cddb[_0x10eb('0x45')](_0x20cddb[_0x10eb('0x21')][_0x52ca77['id']],_0x52ca77);}}}return _0x20cddb[_0x10eb('0x21')];};};Realtime[_0x10eb('0x44')][_0x10eb('0x53')]=function(){var _0x4f6c76=this;return function(_0x454e5c){if(_0x454e5c){freeIsNotKey(_0x454e5c,_0x4f6c76[_0x10eb('0x54')],'id');for(var _0x535d3f=0x0,_0x32bd7b={},_0x78616b={};_0x535d3f<_0x454e5c['length'];_0x535d3f+=0x1){_0x32bd7b=_0x454e5c[_0x535d3f];if(_[_0x10eb('0x48')](_0x4f6c76['deskAccounts'][_0x32bd7b['id']])){_0x4f6c76[_0x10eb('0x54')][_0x32bd7b['id']]=new DeskAccount(_0x32bd7b);}else{_0x4f6c76[_0x10eb('0x45')](_0x4f6c76['deskAccounts'][_0x32bd7b['id']],_0x32bd7b);}}}return _0x4f6c76[_0x10eb('0x54')];};};Realtime['prototype']['initSugarcrmAccounts']=function(){var _0x3bb85a=this;return function(_0x540238){if(_0x540238){freeIsNotKey(_0x540238,_0x3bb85a[_0x10eb('0x20')],'id');for(var _0x8fe1e5=0x0,_0x5692f8={},_0x404c54={};_0x8fe1e5<_0x540238[_0x10eb('0x47')];_0x8fe1e5+=0x1){_0x5692f8=_0x540238[_0x8fe1e5];if(_['isUndefined'](_0x3bb85a[_0x10eb('0x20')][_0x5692f8['id']])){_0x3bb85a[_0x10eb('0x20')][_0x5692f8['id']]=new SugarcrmAccount(_0x5692f8);}else{_0x3bb85a['mergeFromDatabase'](_0x3bb85a[_0x10eb('0x20')][_0x5692f8['id']],_0x5692f8);}}}return _0x3bb85a[_0x10eb('0x20')];};};Realtime['prototype'][_0x10eb('0x55')]=function(){var _0x2d3cc8=this;return function(_0x27d1db){if(_0x27d1db){freeIsNotKey(_0x27d1db,_0x2d3cc8[_0x10eb('0x22')],'id');for(var _0x28647a=0x0,_0x4a247e={},_0x5d48f3={};_0x28647a<_0x27d1db[_0x10eb('0x47')];_0x28647a+=0x1){_0x4a247e=_0x27d1db[_0x28647a];if(_[_0x10eb('0x48')](_0x2d3cc8[_0x10eb('0x22')][_0x4a247e['id']])){_0x2d3cc8[_0x10eb('0x22')][_0x4a247e['id']]=new VtigerAccount(_0x4a247e);}else{_0x2d3cc8[_0x10eb('0x45')](_0x2d3cc8[_0x10eb('0x22')][_0x4a247e['id']],_0x4a247e);}}}return _0x2d3cc8[_0x10eb('0x22')];};};Realtime[_0x10eb('0x44')][_0x10eb('0x56')]=function(){var _0x2f16db=this;return function(_0x117a80){if(_0x117a80){freeIsNotKey(_0x117a80,_0x2f16db[_0x10eb('0x57')],'id');for(var _0x5a335a=0x0,_0x242cfb={},_0xb373d5={};_0x5a335a<_0x117a80[_0x10eb('0x47')];_0x5a335a+=0x1){_0x242cfb=_0x117a80[_0x5a335a];if(_[_0x10eb('0x48')](_0x2f16db[_0x10eb('0x57')][_0x242cfb['id']])){_0x2f16db[_0x10eb('0x57')][_0x242cfb['id']]=new ServicenowAccount(_0x242cfb);}else{_0x2f16db[_0x10eb('0x45')](_0x2f16db[_0x10eb('0x57')][_0x242cfb['id']],_0x242cfb);}}}return _0x2f16db[_0x10eb('0x57')];};};Realtime[_0x10eb('0x44')][_0x10eb('0x58')]=function(){var _0x206315=this;return function(_0xf1d91){if(_0xf1d91){freeIsNotKey(_0xf1d91,_0x206315[_0x10eb('0x23')],'id');for(var _0x1b79b6=0x0,_0x1a2e89={},_0x558c47={};_0x1b79b6<_0xf1d91[_0x10eb('0x47')];_0x1b79b6+=0x1){_0x1a2e89=_0xf1d91[_0x1b79b6];if(_[_0x10eb('0x48')](_0x206315[_0x10eb('0x23')][_0x1a2e89['id']])){_0x206315[_0x10eb('0x23')][_0x1a2e89['id']]=new Dynamics365Account(_0x1a2e89);}else{_0x206315['mergeFromDatabase'](_0x206315['dynamics365Accounts'][_0x1a2e89['id']],_0x1a2e89);}}}return _0x206315[_0x10eb('0x23')];};};Realtime[_0x10eb('0x44')][_0x10eb('0x59')]=function(){var _0x5b3ac7=this;return function(_0x42b047){if(_0x42b047){freeIsNotKey(_0x42b047,_0x5b3ac7[_0x10eb('0x5a')],'id');for(var _0x6527fa=0x0,_0x8df533={},_0x49ba9a={};_0x6527fa<_0x42b047['length'];_0x6527fa+=0x1){_0x8df533=_0x42b047[_0x6527fa];if(_[_0x10eb('0x48')](_0x5b3ac7[_0x10eb('0x5a')][_0x8df533['id']])){_0x5b3ac7['freshsalesAccounts'][_0x8df533['id']]=new FreshsalesAccount(_0x8df533);}else{_0x5b3ac7[_0x10eb('0x45')](_0x5b3ac7[_0x10eb('0x5a')][_0x8df533['id']],_0x8df533);}}}return _0x5b3ac7['freshsalesAccounts'];};};Realtime[_0x10eb('0x44')][_0x10eb('0x5b')]=function(){var _0x1d41ef=this;return function(_0x57e75b){for(var _0x436d3f=0x0;_0x436d3f<_0x57e75b['length'];_0x436d3f+=0x1){_[_0x10eb('0x5c')](_0x1d41ef[_0x10eb('0x4b')][_0x57e75b[_0x436d3f][_0x10eb('0x28')]],_0x57e75b[_0x436d3f]);}return _0x1d41ef[_0x10eb('0x4b')];};};Realtime[_0x10eb('0x44')]['initVoiceQueueReports']=function(){var _0x623321=this;return function(_0x2609f0){clearVoiceQueues(_0x623321[_0x10eb('0x4b')]);if(_0x2609f0){_0x2609f0=_['groupBy'](_0x2609f0,_0x10eb('0x5d'));for(var _0x498566 in _0x2609f0){if(_0x2609f0['hasOwnProperty'](_0x498566)){var _0xee8fc0={};for(var _0x322e72=0x0;_0x322e72<_0x2609f0[_0x498566][_0x10eb('0x47')];_0x322e72+=0x1){var _0xf0b4b8=_0x2609f0[_0x498566][_0x322e72][_0x10eb('0x5e')];if(_0x623321[_0x10eb('0x4b')][_0xf0b4b8]){if(_0x2609f0[_0x498566][_0x322e72][_0x10eb('0x5f')]){_0x623321['voiceQueues'][_0xf0b4b8][_0x10eb('0x33')]+=0x1;}if(_0x2609f0[_0x498566][_0x322e72][_0x10eb('0x60')]){_0x623321[_0x10eb('0x4b')][_0xf0b4b8][_0x10eb('0x34')]+=0x1;}_0x623321['voiceQueues'][_0xf0b4b8][_0x10eb('0x2d')]+=moment(_0x2609f0[_0x498566][_0x322e72][_0x10eb('0x61')])[_0x10eb('0x62')](moment(_0x2609f0[_0x498566][_0x322e72][_0x10eb('0x63')]),_0x10eb('0x64'))||0x0;if(_0x322e72===_0x2609f0[_0x498566][_0x10eb('0x47')]-0x1){_0x623321[_0x10eb('0x4b')][_0xf0b4b8][_0x10eb('0x2e')]+=moment(_0x2609f0[_0x498566][_0x322e72][_0x10eb('0x65')]||_0x2609f0[_0x498566][_0x322e72]['queuecallerabandonAt']||_0x2609f0[_0x498566][_0x322e72][_0x10eb('0x66')])['diff'](moment(_0x2609f0[_0x498566][_0x322e72][_0x10eb('0x63')]),_0x10eb('0x64'))||0x0;_0x623321[_0x10eb('0x4b')][_0xf0b4b8][_0x10eb('0x32')]+=0x1;if(_0x2609f0[_0x498566][_0x322e72][_0x10eb('0x67')]){_0x623321[_0x10eb('0x4b')][_0xf0b4b8][_0x10eb('0x2c')]+=0x1;_0x623321['voiceQueues'][_0xf0b4b8]['sumBillable']+=moment(_0x2609f0[_0x498566][_0x322e72][_0x10eb('0x65')])['diff'](moment(_0x2609f0[_0x498566][_0x322e72]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x623321[_0x10eb('0x4b')][_0xf0b4b8][_0x10eb('0x2e')]+=_0x623321[_0x10eb('0x4b')][_0xf0b4b8][_0x10eb('0x2d')]||0x0;}}}}}}return _0x623321[_0x10eb('0x4b')];};};Realtime[_0x10eb('0x44')]['initVoiceCallReports']=function(){var _0x497a7f=this;return function(_0x2cce63){clearVoiceCallReports(_0x497a7f[_0x10eb('0x68')]);if(_0x2cce63){for(var _0x132e9c=0x0;_0x132e9c<_0x2cce63[_0x10eb('0x47')];_0x132e9c+=0x1){_0x497a7f['outbound'][_0x10eb('0x32')]+=0x1;_0x497a7f[_0x10eb('0x68')][_0x10eb('0x2e')]+=_0x2cce63[_0x132e9c][_0x10eb('0x69')];if(_0x2cce63[_0x132e9c][_0x10eb('0x6a')]===_0x10eb('0x6b')){_0x497a7f[_0x10eb('0x68')]['answered']+=0x1;_0x497a7f[_0x10eb('0x68')][_0x10eb('0x2d')]+=_0x2cce63[_0x132e9c][_0x10eb('0x69')]-_0x2cce63[_0x132e9c][_0x10eb('0x6c')]||0x0;_0x497a7f[_0x10eb('0x68')][_0x10eb('0x35')]+=_0x2cce63[_0x132e9c][_0x10eb('0x6c')];}}}return _0x497a7f[_0x10eb('0x68')];};};Realtime[_0x10eb('0x44')][_0x10eb('0x6d')]=function(){var _0x2f0473=this;return function(_0x37f697){if(_0x37f697){freeIsNotKey(_0x37f697,_0x2f0473[_0x10eb('0x19')],_0x10eb('0x28'));for(var _0x2007bf=0x0,_0x209303={};_0x2007bf<_0x37f697['length'];_0x2007bf+=0x1){_0x209303=_0x37f697[_0x2007bf];if(_['isUndefined'](_0x2f0473['campaigns'][_0x209303[_0x10eb('0x28')]])){_0x2f0473['campaigns'][_0x209303[_0x10eb('0x28')]]=new Campaign(_0x209303);}else{_0x2f0473[_0x10eb('0x45')](_0x2f0473[_0x10eb('0x19')][_0x209303[_0x10eb('0x28')]],_0x209303);_0x2f0473['campaigns'][_0x209303[_0x10eb('0x28')]]['dialQueueProject']=_0x209303['SquareProject']?_0x209303['SquareProject']['name']:undefined;}}}return _0x2f0473[_0x10eb('0x19')];};};Realtime[_0x10eb('0x44')]['initVoiceExtensions']=function(){var _0xd2a89=this;return function(_0x40c350){if(_0x40c350){freeIsNotKey(_0x40c350,_0xd2a89[_0x10eb('0x1b')],'id');for(var _0x5ed3e5=0x0,_0x3f8de1={};_0x5ed3e5<_0x40c350[_0x10eb('0x47')];_0x5ed3e5+=0x1){_0x3f8de1=_0x40c350[_0x5ed3e5];if(_[_0x10eb('0x48')](_0xd2a89[_0x10eb('0x1b')][_0x3f8de1['id']])){_0xd2a89[_0x10eb('0x1b')][_0x3f8de1['id']]=new VoiceExtension(_0x3f8de1);}else{_0xd2a89['mergeFromDatabase'](_0xd2a89[_0x10eb('0x1b')][_0x3f8de1['id']],_0x3f8de1);}}}return _0xd2a89[_0x10eb('0x1b')];};};Realtime['prototype']['initCampaignHopperHistory']=function(){var _0x3bedf3=this;return function(_0x1b9d68){clearCampaigns(_0x3bedf3[_0x10eb('0x19')]);for(var _0x5f45e2=0x0;_0x5f45e2<_0x1b9d68[_0x10eb('0x47')];_0x5f45e2+=0x1){_['merge'](_0x3bedf3[_0x10eb('0x19')][_0x1b9d68[_0x5f45e2]['name']],_0x1b9d68[_0x5f45e2]);}return _0x3bedf3[_0x10eb('0x19')];};};Realtime[_0x10eb('0x44')][_0x10eb('0x6e')]=function(){var _0x45b512=this;return function(_0x5b4ba2){if(_0x5b4ba2){freeIsNotKey(_0x5b4ba2,_0x45b512[_0x10eb('0x24')],'id');for(var _0xdee30c=0x0,_0x5a8f54={},_0x5eae48={};_0xdee30c<_0x5b4ba2['length'];_0xdee30c+=0x1){_0x5a8f54=_0x5b4ba2[_0xdee30c];if(_[_0x10eb('0x48')](_0x45b512[_0x10eb('0x24')][_0x5a8f54['id']])){_0x45b512[_0x10eb('0x24')][_0x5a8f54['id']]=new FaxAccount(_0x5a8f54);}else{_0x45b512[_0x10eb('0x45')](_0x45b512[_0x10eb('0x24')][_0x5a8f54['id']],_0x5a8f54);}}}return _0x45b512[_0x10eb('0x24')];};};module[_0x10eb('0x6f')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index b789769..bd4b9b5 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 _0x32b9=['xcally-motion-preview','connectedlinename','xcally-motion-dialer','isArray','forEach','startsWith','Local','substring','indexOf','mobile','phone','blindTransfer','transfererlinkedid','attendedTransfer','exports','lodash','moment','util','../../../config/environment','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','findAgent','accountcode','name','isNil','find','format','SIP/%s','length','connectedlinenum','assigned','interface','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','match','keys','getCallType','channel','split','internal','voiceCallReport','destination','dialer','queue','lastdata','context','from-voip-provider','callerid','from-sip','calleridpreview','destinationchannel','calleridnum','originatecalleridnum','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','type','UserId','getAgentByInternal','membername','create','monitors','monitorFilename','filename','createdAt','exten'];(function(_0x37310f,_0xc8b8f){var _0xcb15e7=function(_0x55c8e5){while(--_0x55c8e5){_0x37310f['push'](_0x37310f['shift']());}};_0xcb15e7(++_0xc8b8f);}(_0x32b9,0xcb));var _0x932b=function(_0x5abe22,_0x4072f9){_0x5abe22=_0x5abe22-0x0;var _0x3a1467=_0x32b9[_0x5abe22];return _0x3a1467;};'use strict';var _=require(_0x932b('0x0'));var moment=require(_0x932b('0x1'));var util=require(_0x932b('0x2'));var config=require(_0x932b('0x3'));var ami=require('../ami');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0x932b('0x4'));var RpcVoiceRecording=require(_0x932b('0x5'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x932b('0x6'));var VoiceCallReport=require(_0x932b('0x7'));var VoiceAgentReport=require(_0x932b('0x8'));var VoiceDialReport=require(_0x932b('0x9'));var UserReport=require(_0x932b('0xa'));function Report(_0x4fe3cc){this[_0x932b('0xb')]=_0x4fe3cc;this[_0x932b('0xc')]=_0x4fe3cc[_0x932b('0xc')];this['telephones']=_0x4fe3cc[_0x932b('0xd')];}Report[_0x932b('0xe')][_0x932b('0xf')]=function(_0x2e5637){var _0x14b44f=new VoiceQueueReport(this[_0x932b('0xb')]);var _0x138f15=new VoiceAgentReport(this[_0x932b('0xb')]);var _0x2a84b1=new VoiceDialReport(this[_0x932b('0xb')]);var _0x5706d4=new VoiceCallReport(this[_0x932b('0xb')]);var _0x540bbb=new UserReport(this[_0x932b('0xb')]);if(config[_0x932b('0x10')]&&config[_0x932b('0x10')][_0x932b('0x11')]){ami['on'](_0x932b('0x12'),this[_0x932b('0x13')][_0x932b('0x14')](this));ami['on'](_0x932b('0x15'),this['voiceCallReport'][_0x932b('0x14')](this));ami['on'](_0x932b('0x16'),this[_0x932b('0x17')]['bind'](this));ami['on'](_0x932b('0x18'),this[_0x932b('0x19')][_0x932b('0x14')](this));ami['on'](_0x932b('0x1a'),this['blindTransfer'][_0x932b('0x14')](this));ami['on']('attendedtransfer',this['attendedTransfer']['bind'](this));}};Report['prototype'][_0x932b('0x1b')]=function(_0x14f461){var _0x401508;_0x401508=_['find'](this['agents'],function(_0x3e1289){return _0x3e1289[_0x932b('0x1c')]==_0x14f461||_0x3e1289[_0x932b('0x1d')]==_0x14f461;});if(_[_0x932b('0x1e')](_0x401508)){var _0x49601d=_['find'](this[_0x932b('0xd')],function(_0x2388c2){return _0x2388c2[_0x932b('0x1c')]==_0x14f461||_0x2388c2[_0x932b('0x1d')]==_0x14f461;});if(_0x49601d){_0x401508=_[_0x932b('0x1f')](this[_0x932b('0xc')],function(_0x10ed39){return _0x10ed39['interface']==util[_0x932b('0x20')](_0x932b('0x21'),_0x49601d['name']);});}}return _0x401508;};Report[_0x932b('0xe')][_0x932b('0x13')]=function(_0x3dc823){for(var _0x559966=0x0;_0x559966<_0x3dc823[_0x932b('0x22')];_0x559966+=0x1){var _0x4027bb=this['findAgent'](_0x3dc823[_0x559966][_0x932b('0x23')]);if(_0x4027bb){_0x3dc823[_0x559966]['accountcode']=_0x4027bb['accountcode'];_0x3dc823[_0x559966][_0x932b('0x24')]=!![];_0x3dc823[_0x559966]['lastAssignedTo']=_0x4027bb[_0x932b('0x1d')];_0x3dc823[_0x559966][_0x932b('0x25')]=_[_0x932b('0x1e')](_0x4027bb[_0x932b('0x25')])?util['format'](_0x932b('0x21'),_0x4027bb[_0x932b('0x1d')]):_0x4027bb['interface'];if(_0x3dc823[_0x559966][_0x932b('0x26')]){_0x3dc823[_0x559966][_0x932b('0x27')]=moment()[_0x932b('0x20')](_0x932b('0x28'));}if(_0x3dc823[_0x559966][_0x932b('0x29')]){_0x3dc823[_0x559966][_0x932b('0x2a')]=moment()['format'](_0x932b('0x28'));}RpcMemberReport[_0x932b('0x13')](_0x3dc823[_0x559966]);}RpcVoiceQueueReport['create'](_0x3dc823[_0x559966]);}};function extractCalleridNumber(_0xbfec68){var _0x1517c9=_0xbfec68[_0x932b('0x2b')](/<(.*?)>/);return _0x1517c9?_0x1517c9[0x1]:_0xbfec68;}Report['prototype']['getAgentByInternal']=function(_0x42ee0a){for(var _0x4a775d=0x0;_0x4a775d/);return _0x1bc986?_0x1bc986[0x1]:_0x4deb5c;}Report[_0xa85e('0x23')][_0xa85e('0x2f')]=function(_0x574839){for(var _0x2d5a00=0x0;_0x2d5a00',_0x3a5c1a['calleridname'],_0x3a5c1a[_0xa85e('0x33')]);}if(RpcVoiceTransferReport[_0xa85e('0x40')][_0x3a5c1a[_0xa85e('0x41')]]){var _0x26feb1=RpcVoiceTransferReport['transfers'][_0x3a5c1a['linkedid']];_0x26feb1[_0xa85e('0x42')]=_0x3a5c1a[_0xa85e('0x43')];RpcVoiceTransferReport[_0xa85e('0x1b')](_0x26feb1);delete RpcVoiceTransferReport[_0xa85e('0x40')][_0x3a5c1a[_0xa85e('0x41')]];}if(_[_0xa85e('0x27')](_0x3a5c1a[_0xa85e('0x44')])){_0x3a5c1a['type']=this[_0xa85e('0x31')](_0x3a5c1a);}if(_[_0xa85e('0x27')](_0x3a5c1a['UserId'])){var _0x1da014=_0x3a5c1a[_0xa85e('0x32')]['split']('-')[0x0];var _0xb6afe=this[_0xa85e('0xe')][_0x1da014];if(!_0xb6afe)_0xb6afe=this[_0xa85e('0x2f')](_0x3a5c1a[_0xa85e('0x1f')]);if(_0xb6afe){_0x3a5c1a[_0xa85e('0x45')]=_0xb6afe['id'];_0x3a5c1a[_0xa85e('0x46')]=_0xb6afe[_0xa85e('0x20')];}}RpcVoiceCallReport[_0xa85e('0x2d')](_0x3a5c1a);if(_0x3a5c1a[_0xa85e('0x47')]){for(var _0x4c50e7=0x0;_0x4c50e7<_0x3a5c1a['monitors'][_0xa85e('0x24')];_0x4c50e7+=0x1){_0x3a5c1a[_0xa85e('0x48')]=_0x3a5c1a['monitors'][_0x4c50e7][_0xa85e('0x49')];_0x3a5c1a[_0xa85e('0x4a')]=_0x3a5c1a[_0xa85e('0x4b')][_0x4c50e7]['createdAt'];if(_0x3a5c1a[_0xa85e('0x4c')]=='xcally-motion-preview'){_0x3a5c1a[_0xa85e('0x33')]=_0x3a5c1a[_0xa85e('0x25')];_0x3a5c1a[_0xa85e('0x4d')]=_0x3a5c1a[_0xa85e('0x4e')];_0x3a5c1a[_0xa85e('0x25')]=_0x3a5c1a['accountcode'];_0x3a5c1a['connectedlinename']=_0x3a5c1a[_0xa85e('0x46')];_0x3a5c1a[_0xa85e('0x4c')]=_0x3a5c1a['originatecalleridnum'];}else if(_0x3a5c1a[_0xa85e('0x4c')]==_0xa85e('0x4f')){_0x3a5c1a[_0xa85e('0x33')]=_0x3a5c1a[_0xa85e('0x34')];_0x3a5c1a[_0xa85e('0x4c')]=_0x3a5c1a[_0xa85e('0x3d')];}RpcVoiceRecording[_0xa85e('0x2d')](_0x3a5c1a);}}};Report['prototype'][_0xa85e('0x19')]=function(_0x3d5fdd){if(_['isArray'](_0x3d5fdd)){_0x3d5fdd[_0xa85e('0x50')](function(_0x3a7cb3){RpcVoiceAgentReport['create'](_0x3a7cb3);});}else{RpcVoiceAgentReport[_0xa85e('0x2d')](_0x3d5fdd);}};Report[_0xa85e('0x23')][_0xa85e('0x51')]=function(_0x46d644){RpcVoiceDialReport[_0xa85e('0x2d')](_0x46d644);var _0x32d9d1;var _0x33905c;var _0x2f2eb3=_0x46d644[_0xa85e('0x32')];if(_[_0xa85e('0x52')](_0x2f2eb3,_0xa85e('0x53'))){_0x33905c=_0x2f2eb3[_0xa85e('0x54')](_0x2f2eb3['indexOf']('/')+0x1,_0x2f2eb3[_0xa85e('0x55')]('@'));_0x32d9d1=_[_0xa85e('0x1e')](this[_0xa85e('0xe')],function(_0x4e4979){return _0x4e4979[_0xa85e('0x56')]==_0x33905c||_0x4e4979['phone']==_0x33905c||_0x4e4979['accountcode']==_0x33905c;});}else{_0x33905c=_0x2f2eb3[_0xa85e('0x54')](_0x2f2eb3[_0xa85e('0x55')]('/')+0x1,_0x2f2eb3['lastIndexOf']('-'));_0x32d9d1=this[_0xa85e('0x1d')](_0x33905c);}if(_0x32d9d1){_0x46d644[_0xa85e('0x21')]=_['isNil'](_0x32d9d1[_0xa85e('0x21')])?util['format'](_0xa85e('0x28'),_0x32d9d1['name']):_0x32d9d1[_0xa85e('0x21')];_0x46d644[_0xa85e('0x46')]=_0x32d9d1[_0xa85e('0x20')];_0x46d644['accountcode']=_0x32d9d1[_0xa85e('0x1f')];RpcMemberReport[_0xa85e('0x51')](_0x46d644);}};Report[_0xa85e('0x23')][_0xa85e('0x1b')]=function(_0x2ae123){RpcVoiceTransferReport[_0xa85e('0x40')][_0x2ae123['transfererlinkedid']]=_0x2ae123;};Report[_0xa85e('0x23')]['attendedTransfer']=function(_0x861aec){RpcVoiceTransferReport[_0xa85e('0x1c')](_0x861aec);};module[_0xa85e('0x57')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 69e6e7d..43043d9 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 _0x19cb=['isNotNull','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','state','find','username','stateRegistry','merge','omit','event','debug','format','trunk:%s','name','trunk:save','[userReport][registry]','syncDeviceState','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','toLowerCase','inuse','local','stateTime','updateStatusRealtime','telephones','toNumber','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','substring','indexOf','accountcode','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','[userReport][peerstatus]','peer','registered','status','address','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','moment','ioredis','bluebird','../../../config/environment','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','registryentry','bind','registry','syncRegistry','devicestatechange','peerstatus','syncPeerStatus','resolve','then','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','inspect','actionDeviceStateList','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','prototype'];(function(_0x319d1e,_0xffd4de){var _0x2ac009=function(_0x4c0650){while(--_0x4c0650){_0x319d1e['push'](_0x319d1e['shift']());}};_0x2ac009(++_0xffd4de);}(_0x19cb,0x7a));var _0xb19c=function(_0x53dd05,_0x33b390){_0x53dd05=_0x53dd05-0x0;var _0x4ae53b=_0x19cb[_0x53dd05];return _0x4ae53b;};'use strict';var _=require(_0xb19c('0x0'));var moment=require(_0xb19c('0x1'));var util=require('util');var Redis=require(_0xb19c('0x2'));var BPromise=require(_0xb19c('0x3'));var config=require(_0xb19c('0x4'));var logger=require('../../../config/logger')(_0xb19c('0x5'));var ami=require(_0xb19c('0x6'));config[_0xb19c('0x7')]=_[_0xb19c('0x8')](config[_0xb19c('0x7')],{'host':_0xb19c('0x9'),'port':0x18eb});var io=require(_0xb19c('0xa'))(new Redis(config['redis']));function UserReport(_0x1bb593){this[_0xb19c('0xb')]=_0x1bb593[_0xb19c('0xb')];this[_0xb19c('0xc')]=_0x1bb593['agents'];this['telephones']=_0x1bb593['telephones'];ami['on'](_0xb19c('0xd'),this['syncRegistry'][_0xb19c('0xe')](this));ami['on'](_0xb19c('0xf'),this[_0xb19c('0x10')]['bind'](this));ami['on'](_0xb19c('0x11'),this['syncDeviceState']['bind'](this));ami['on'](_0xb19c('0x12'),this[_0xb19c('0x13')][_0xb19c('0xe')](this));return this['syncRealtimeShow']();}function showSipRegistrations(){Promise[_0xb19c('0x14')]()[_0xb19c('0x15')](ami[_0xb19c('0x16')]())[_0xb19c('0x17')](function(_0x823537){logger[_0xb19c('0x18')](_0xb19c('0x19'),util[_0xb19c('0x1a')](_0x823537,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xb19c('0x14')]()['then'](ami[_0xb19c('0x1b')]())[_0xb19c('0x17')](function(_0x56d2e2){logger['error'](_0xb19c('0x1c'),util[_0xb19c('0x1a')](_0x56d2e2,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xb19c('0x14')]()[_0xb19c('0x15')](ami[_0xb19c('0x1d')]())[_0xb19c('0x17')](function(_0x103792){logger['error'](_0xb19c('0x1e'),util[_0xb19c('0x1a')](_0x103792,{'showHidden':![],'depth':null}));});}UserReport[_0xb19c('0x1f')]['syncRealtimeShow']=function(){setInterval(function(){BPromise[_0xb19c('0x14')]()[_0xb19c('0x15')](showSipRegistrations())[_0xb19c('0x15')](listDeviceStates())['then'](showPeersStatus());},0x32c8);};UserReport['prototype'][_0xb19c('0x20')]=function(_0x3ba57c){return _0x3ba57c!==null&&!_['isUndefined'](_0x3ba57c);};UserReport[_0xb19c('0x1f')][_0xb19c('0x21')]=function(_0x2d754b,_0x238e5a,_0x3e8030){io['to'](_0x2d754b)[_0xb19c('0x21')](_0x238e5a,_0x3e8030);};UserReport[_0xb19c('0x1f')][_0xb19c('0x10')]=function(_0x102fb2){try{if(this[_0xb19c('0x20')](_0x102fb2)){logger[_0xb19c('0x22')](_0xb19c('0x23'),_0x102fb2['username'],_0x102fb2[_0xb19c('0x24')]);logger['debug']('[userReport][registry]',util[_0xb19c('0x1a')](_0x102fb2,{'showHidden':![],'depth':null}));var _0x3ea2fe=_[_0xb19c('0x25')](this[_0xb19c('0xb')],{'defaultuser':_0x102fb2[_0xb19c('0x26')]});if(_0x3ea2fe){_0x102fb2[_0xb19c('0x27')]=_0x102fb2['state'];_[_0xb19c('0x28')](_0x3ea2fe,_[_0xb19c('0x29')](_0x102fb2,[_0xb19c('0x2a'),'actionid',_0xb19c('0x26'),_0xb19c('0x24')]));logger[_0xb19c('0x2b')]('[userReport][registry]\x20sending\x20trunk:save\x20event:',util[_0xb19c('0x1a')](_0x3ea2fe,{'showHidden':![],'depth':null}));this['emit'](util[_0xb19c('0x2c')](_0xb19c('0x2d'),_0x3ea2fe[_0xb19c('0x2e')]),_0xb19c('0x2f'),_0x3ea2fe);}}}catch(_0x20dc8b){logger[_0xb19c('0x18')](_0xb19c('0x30'),util[_0xb19c('0x1a')](_0x20dc8b,{'showHidden':![],'depth':null}));}};UserReport[_0xb19c('0x1f')][_0xb19c('0x31')]=function(_0x49866f){try{if(this[_0xb19c('0x20')](_0x49866f)){logger['info'](_0xb19c('0x32'),_0x49866f[_0xb19c('0x33')],_0x49866f[_0xb19c('0x24')]);logger[_0xb19c('0x2b')](_0xb19c('0x34'),util[_0xb19c('0x1a')](_0x49866f,{'showHidden':![],'depth':null}));if(this['agents'][_0x49866f['device']]){if(!this[_0xb19c('0xc')][_0x49866f[_0xb19c('0x33')]]['local']||_0x49866f[_0xb19c('0x24')][_0xb19c('0x35')]()==_0xb19c('0x36')){this[_0xb19c('0xc')][_0x49866f['device']][_0xb19c('0x37')]=![];if(this[_0xb19c('0xc')][_0x49866f[_0xb19c('0x33')]][_0xb19c('0x24')]!==_0x49866f[_0xb19c('0x24')][_0xb19c('0x35')]()){this[_0xb19c('0xc')][_0x49866f[_0xb19c('0x33')]][_0xb19c('0x38')]=_['toNumber'](moment()[_0xb19c('0x2c')]('x'));}this[_0xb19c('0xc')][_0x49866f[_0xb19c('0x33')]][_0xb19c('0x24')]=_0x49866f['state'][_0xb19c('0x35')]();this['agents'][_0x49866f[_0xb19c('0x33')]][_0xb19c('0x39')](_0x49866f);}}else if(this[_0xb19c('0x3a')][_0x49866f[_0xb19c('0x33')]]){if(this[_0xb19c('0x3a')][_0x49866f[_0xb19c('0x33')]]['state']!==_0x49866f[_0xb19c('0x24')][_0xb19c('0x35')]()){this[_0xb19c('0x3a')][_0x49866f[_0xb19c('0x33')]][_0xb19c('0x38')]=_[_0xb19c('0x3b')](moment()[_0xb19c('0x2c')]('x'));}this[_0xb19c('0x3a')][_0x49866f[_0xb19c('0x33')]][_0xb19c('0x24')]=_0x49866f['state']['toLowerCase']();logger[_0xb19c('0x2b')](_0xb19c('0x3c'),util['inspect'](this['telephones'][_0x49866f['device']],{'showHidden':![],'depth':null}));this[_0xb19c('0x21')](util[_0xb19c('0x2c')]('telephone:%s',this[_0xb19c('0x3a')][_0x49866f['device']]['name']),'telephone:save',this[_0xb19c('0x3a')][_0x49866f['device']]);}else if(this['trunks'][_0x49866f[_0xb19c('0x33')]]){if(this['trunks'][_0x49866f['device']][_0xb19c('0x24')]!==_0x49866f['state']['toLowerCase']()){this['trunks'][_0x49866f[_0xb19c('0x33')]][_0xb19c('0x38')]=_[_0xb19c('0x3b')](moment()[_0xb19c('0x2c')]('x'));}this['trunks'][_0x49866f['device']][_0xb19c('0x24')]=_0x49866f[_0xb19c('0x24')][_0xb19c('0x35')]();logger[_0xb19c('0x2b')](_0xb19c('0x3d'),util[_0xb19c('0x1a')](this[_0xb19c('0xb')][_0x49866f[_0xb19c('0x33')]],{'showHidden':![],'depth':null}));this[_0xb19c('0x21')](util['format']('trunk:%s',this[_0xb19c('0xb')][_0x49866f[_0xb19c('0x33')]][_0xb19c('0x2e')]),_0xb19c('0x2f'),this[_0xb19c('0xb')][_0x49866f[_0xb19c('0x33')]]);}else if(_[_0xb19c('0x3e')](_0x49866f[_0xb19c('0x33')],'Local')){var _0x490c8c=_0x49866f['device'];var _0x516f5d=_0x490c8c[_0xb19c('0x3f')](_0x490c8c[_0xb19c('0x40')]('/')+0x1,_0x490c8c[_0xb19c('0x40')]('@'));var _0x2085c0=_[_0xb19c('0x25')](this[_0xb19c('0xc')],function(_0x24cacd){return _0x24cacd['mobile']==_0x516f5d||_0x24cacd['phone']==_0x516f5d||_0x24cacd[_0xb19c('0x41')]==_0x516f5d;});if(_0x2085c0){if(_0x2085c0[_0xb19c('0x24')]!==_0x49866f['state'][_0xb19c('0x35')]()){_0x2085c0[_0xb19c('0x38')]=_[_0xb19c('0x3b')](moment()[_0xb19c('0x2c')]('x'));}_0x2085c0['state']=_0x49866f[_0xb19c('0x24')][_0xb19c('0x35')]();_0x2085c0[_0xb19c('0x37')]=!![];_0x2085c0[_0xb19c('0x39')](_0x49866f);}}}}catch(_0x3bae98){logger[_0xb19c('0x18')](_0xb19c('0x34'),util[_0xb19c('0x1a')](_0x3bae98,{'showHidden':![],'depth':null}));}};UserReport[_0xb19c('0x1f')][_0xb19c('0x13')]=function(_0x3c67c6){try{if(this['isNotNull'](_0x3c67c6)&&this[_0xb19c('0x20')](_0x3c67c6[_0xb19c('0x12')])){logger[_0xb19c('0x22')](_0xb19c('0x42'),_0x3c67c6['peer'],_0x3c67c6['address'],_0x3c67c6[_0xb19c('0x12')]);logger[_0xb19c('0x2b')](_0xb19c('0x43'),util[_0xb19c('0x1a')](_0x3c67c6,{'showHidden':![],'depth':null}));if(this[_0xb19c('0xc')][_0x3c67c6[_0xb19c('0x44')]]){if(!this[_0xb19c('0xc')][_0x3c67c6[_0xb19c('0x44')]][_0xb19c('0x37')]||_0x3c67c6[_0xb19c('0x12')]['toLowerCase']()==_0xb19c('0x45')){this[_0xb19c('0xc')][_0x3c67c6[_0xb19c('0x44')]]['local']=![];this['agents'][_0x3c67c6['peer']][_0xb19c('0x46')]=_0x3c67c6[_0xb19c('0x12')]['toLowerCase']();this[_0xb19c('0xc')][_0x3c67c6[_0xb19c('0x44')]][_0xb19c('0x47')]=_0x3c67c6[_0xb19c('0x47')];this['agents'][_0x3c67c6[_0xb19c('0x44')]][_0xb19c('0x39')](_0x3c67c6);}}else if(this[_0xb19c('0x3a')][_0x3c67c6[_0xb19c('0x44')]]){this[_0xb19c('0x3a')][_0x3c67c6[_0xb19c('0x44')]][_0xb19c('0x46')]=_0x3c67c6[_0xb19c('0x12')]['toLowerCase']();this[_0xb19c('0x3a')][_0x3c67c6['peer']][_0xb19c('0x47')]=_0x3c67c6[_0xb19c('0x47')];logger[_0xb19c('0x2b')](_0xb19c('0x48'),util[_0xb19c('0x1a')](this[_0xb19c('0x3a')][_0x3c67c6[_0xb19c('0x44')]],{'showHidden':![],'depth':null}));this[_0xb19c('0x21')](util[_0xb19c('0x2c')](_0xb19c('0x49'),this[_0xb19c('0x3a')][_0x3c67c6[_0xb19c('0x44')]][_0xb19c('0x2e')]),_0xb19c('0x4a'),this[_0xb19c('0x3a')][_0x3c67c6[_0xb19c('0x44')]]);}else if(this['trunks'][_0x3c67c6[_0xb19c('0x44')]]){this[_0xb19c('0xb')][_0x3c67c6[_0xb19c('0x44')]][_0xb19c('0x46')]=_0x3c67c6[_0xb19c('0x12')][_0xb19c('0x35')]();this[_0xb19c('0xb')][_0x3c67c6[_0xb19c('0x44')]]['address']=_0x3c67c6[_0xb19c('0x47')];logger['debug'](_0xb19c('0x4b'),util['inspect'](this['trunks'][_0x3c67c6['peer']],{'showHidden':![],'depth':null}));this[_0xb19c('0x21')](util[_0xb19c('0x2c')](_0xb19c('0x2d'),this[_0xb19c('0xb')][_0x3c67c6[_0xb19c('0x44')]]['name']),_0xb19c('0x2f'),this['trunks'][_0x3c67c6['peer']]);}}}catch(_0x4c979a){logger['error'](_0xb19c('0x43'),util[_0xb19c('0x1a')](_0x4c979a,{'showHidden':![],'depth':null}));}};module[_0xb19c('0x4c')]=UserReport; \ No newline at end of file +var _0x24dd=['../ami','redis','defaults','localhost','trunks','agents','telephones','registryentry','bind','syncRegistry','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','inspect','then','actionDeviceStateList','[userReport][devicestatelist]','[userReport][sippeerstatus]','prototype','emit','isNotNull','info','[userReport][registry]\x20registry:%s\x20state:%s','state','debug','[userReport][registry]','find','username','stateRegistry','merge','event','actionid','format','trunk:%s','name','trunk:save','[userReport][devicestatechange]','device','local','toLowerCase','inuse','stateTime','toNumber','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','substring','indexOf','mobile','phone','accountcode','updateStatusRealtime','[userReport][peerstatus]','peer','registered','status','address','telephone:save','exports','util','bluebird','../../../config/environment','../../../config/logger','ami'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x24dd,0x1ab));var _0xd24d=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0x24dd[_0x4bb66f];return _0xf2772f;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0xd24d('0x0'));var Redis=require('ioredis');var BPromise=require(_0xd24d('0x1'));var config=require(_0xd24d('0x2'));var logger=require(_0xd24d('0x3'))(_0xd24d('0x4'));var ami=require(_0xd24d('0x5'));config[_0xd24d('0x6')]=_[_0xd24d('0x7')](config[_0xd24d('0x6')],{'host':_0xd24d('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd24d('0x6')]));function UserReport(_0x258082){this['trunks']=_0x258082[_0xd24d('0x9')];this[_0xd24d('0xa')]=_0x258082[_0xd24d('0xa')];this[_0xd24d('0xb')]=_0x258082[_0xd24d('0xb')];ami['on'](_0xd24d('0xc'),this['syncRegistry'][_0xd24d('0xd')](this));ami['on']('registry',this[_0xd24d('0xe')][_0xd24d('0xd')](this));ami['on'](_0xd24d('0xf'),this[_0xd24d('0x10')][_0xd24d('0xd')](this));ami['on'](_0xd24d('0x11'),this[_0xd24d('0x12')][_0xd24d('0xd')](this));return this[_0xd24d('0x13')]();}function showSipRegistrations(){Promise[_0xd24d('0x14')]()['then'](ami[_0xd24d('0x15')]())[_0xd24d('0x16')](function(_0x19d2df){logger[_0xd24d('0x17')](_0xd24d('0x18'),util[_0xd24d('0x19')](_0x19d2df,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xd24d('0x14')]()[_0xd24d('0x1a')](ami[_0xd24d('0x1b')]())['catch'](function(_0x127f42){logger[_0xd24d('0x17')](_0xd24d('0x1c'),util[_0xd24d('0x19')](_0x127f42,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise['resolve']()[_0xd24d('0x1a')](ami['actionSipPeerStatus']())[_0xd24d('0x16')](function(_0x1c41f6){logger[_0xd24d('0x17')](_0xd24d('0x1d'),util[_0xd24d('0x19')](_0x1c41f6,{'showHidden':![],'depth':null}));});}UserReport[_0xd24d('0x1e')]['syncRealtimeShow']=function(){setInterval(function(){BPromise['resolve']()[_0xd24d('0x1a')](showSipRegistrations())[_0xd24d('0x1a')](listDeviceStates())[_0xd24d('0x1a')](showPeersStatus());},0x32c8);};UserReport[_0xd24d('0x1e')]['isNotNull']=function(_0x30e494){return _0x30e494!==null&&!_['isUndefined'](_0x30e494);};UserReport['prototype'][_0xd24d('0x1f')]=function(_0x145166,_0x184982,_0x533312){io['to'](_0x145166)[_0xd24d('0x1f')](_0x184982,_0x533312);};UserReport[_0xd24d('0x1e')]['syncRegistry']=function(_0xb72507){try{if(this[_0xd24d('0x20')](_0xb72507)){logger[_0xd24d('0x21')](_0xd24d('0x22'),_0xb72507['username'],_0xb72507[_0xd24d('0x23')]);logger[_0xd24d('0x24')](_0xd24d('0x25'),util['inspect'](_0xb72507,{'showHidden':![],'depth':null}));var _0x3a21f2=_[_0xd24d('0x26')](this[_0xd24d('0x9')],{'defaultuser':_0xb72507[_0xd24d('0x27')]});if(_0x3a21f2){_0xb72507[_0xd24d('0x28')]=_0xb72507[_0xd24d('0x23')];_[_0xd24d('0x29')](_0x3a21f2,_['omit'](_0xb72507,[_0xd24d('0x2a'),_0xd24d('0x2b'),'username',_0xd24d('0x23')]));logger[_0xd24d('0x24')]('[userReport][registry]\x20sending\x20trunk:save\x20event:',util[_0xd24d('0x19')](_0x3a21f2,{'showHidden':![],'depth':null}));this[_0xd24d('0x1f')](util[_0xd24d('0x2c')](_0xd24d('0x2d'),_0x3a21f2[_0xd24d('0x2e')]),_0xd24d('0x2f'),_0x3a21f2);}}}catch(_0x263197){logger[_0xd24d('0x17')](_0xd24d('0x25'),util['inspect'](_0x263197,{'showHidden':![],'depth':null}));}};UserReport[_0xd24d('0x1e')]['syncDeviceState']=function(_0x25f940){try{if(this[_0xd24d('0x20')](_0x25f940)){logger[_0xd24d('0x21')]('[userReport][devicestatechange]\x20device:%s\x20state:%s',_0x25f940['device'],_0x25f940[_0xd24d('0x23')]);logger['debug'](_0xd24d('0x30'),util[_0xd24d('0x19')](_0x25f940,{'showHidden':![],'depth':null}));if(this[_0xd24d('0xa')][_0x25f940['device']]){if(!this[_0xd24d('0xa')][_0x25f940[_0xd24d('0x31')]][_0xd24d('0x32')]||_0x25f940[_0xd24d('0x23')][_0xd24d('0x33')]()==_0xd24d('0x34')){this[_0xd24d('0xa')][_0x25f940[_0xd24d('0x31')]][_0xd24d('0x32')]=![];if(this['agents'][_0x25f940['device']][_0xd24d('0x23')]!==_0x25f940['state'][_0xd24d('0x33')]()){this[_0xd24d('0xa')][_0x25f940[_0xd24d('0x31')]][_0xd24d('0x35')]=_[_0xd24d('0x36')](moment()[_0xd24d('0x2c')]('x'));}this[_0xd24d('0xa')][_0x25f940[_0xd24d('0x31')]][_0xd24d('0x23')]=_0x25f940[_0xd24d('0x23')][_0xd24d('0x33')]();this[_0xd24d('0xa')][_0x25f940[_0xd24d('0x31')]]['updateStatusRealtime'](_0x25f940);}}else if(this[_0xd24d('0xb')][_0x25f940[_0xd24d('0x31')]]){if(this[_0xd24d('0xb')][_0x25f940[_0xd24d('0x31')]]['state']!==_0x25f940[_0xd24d('0x23')]['toLowerCase']()){this['telephones'][_0x25f940[_0xd24d('0x31')]][_0xd24d('0x35')]=_[_0xd24d('0x36')](moment()[_0xd24d('0x2c')]('x'));}this[_0xd24d('0xb')][_0x25f940[_0xd24d('0x31')]][_0xd24d('0x23')]=_0x25f940['state']['toLowerCase']();logger[_0xd24d('0x24')](_0xd24d('0x37'),util['inspect'](this[_0xd24d('0xb')][_0x25f940[_0xd24d('0x31')]],{'showHidden':![],'depth':null}));this[_0xd24d('0x1f')](util['format'](_0xd24d('0x38'),this[_0xd24d('0xb')][_0x25f940[_0xd24d('0x31')]][_0xd24d('0x2e')]),'telephone:save',this['telephones'][_0x25f940[_0xd24d('0x31')]]);}else if(this[_0xd24d('0x9')][_0x25f940[_0xd24d('0x31')]]){if(this[_0xd24d('0x9')][_0x25f940[_0xd24d('0x31')]][_0xd24d('0x23')]!==_0x25f940['state'][_0xd24d('0x33')]()){this[_0xd24d('0x9')][_0x25f940[_0xd24d('0x31')]][_0xd24d('0x35')]=_[_0xd24d('0x36')](moment()[_0xd24d('0x2c')]('x'));}this[_0xd24d('0x9')][_0x25f940[_0xd24d('0x31')]][_0xd24d('0x23')]=_0x25f940['state'][_0xd24d('0x33')]();logger[_0xd24d('0x24')](_0xd24d('0x39'),util[_0xd24d('0x19')](this['trunks'][_0x25f940['device']],{'showHidden':![],'depth':null}));this['emit'](util[_0xd24d('0x2c')](_0xd24d('0x2d'),this[_0xd24d('0x9')][_0x25f940[_0xd24d('0x31')]][_0xd24d('0x2e')]),_0xd24d('0x2f'),this[_0xd24d('0x9')][_0x25f940[_0xd24d('0x31')]]);}else if(_[_0xd24d('0x3a')](_0x25f940[_0xd24d('0x31')],'Local')){var _0x4b5393=_0x25f940[_0xd24d('0x31')];var _0xd5b735=_0x4b5393[_0xd24d('0x3b')](_0x4b5393[_0xd24d('0x3c')]('/')+0x1,_0x4b5393[_0xd24d('0x3c')]('@'));var _0x3167c6=_[_0xd24d('0x26')](this[_0xd24d('0xa')],function(_0x403594){return _0x403594[_0xd24d('0x3d')]==_0xd5b735||_0x403594[_0xd24d('0x3e')]==_0xd5b735||_0x403594[_0xd24d('0x3f')]==_0xd5b735;});if(_0x3167c6){if(_0x3167c6[_0xd24d('0x23')]!==_0x25f940[_0xd24d('0x23')][_0xd24d('0x33')]()){_0x3167c6['stateTime']=_[_0xd24d('0x36')](moment()['format']('x'));}_0x3167c6[_0xd24d('0x23')]=_0x25f940['state']['toLowerCase']();_0x3167c6[_0xd24d('0x32')]=!![];_0x3167c6[_0xd24d('0x40')](_0x25f940);}}}}catch(_0x48cf8f){logger[_0xd24d('0x17')](_0xd24d('0x30'),util[_0xd24d('0x19')](_0x48cf8f,{'showHidden':![],'depth':null}));}};UserReport[_0xd24d('0x1e')][_0xd24d('0x12')]=function(_0x338668){try{if(this[_0xd24d('0x20')](_0x338668)&&this[_0xd24d('0x20')](_0x338668[_0xd24d('0x11')])){logger[_0xd24d('0x21')]('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0x338668['peer'],_0x338668['address'],_0x338668[_0xd24d('0x11')]);logger[_0xd24d('0x24')](_0xd24d('0x41'),util[_0xd24d('0x19')](_0x338668,{'showHidden':![],'depth':null}));if(this[_0xd24d('0xa')][_0x338668[_0xd24d('0x42')]]){if(!this[_0xd24d('0xa')][_0x338668[_0xd24d('0x42')]][_0xd24d('0x32')]||_0x338668[_0xd24d('0x11')][_0xd24d('0x33')]()==_0xd24d('0x43')){this[_0xd24d('0xa')][_0x338668[_0xd24d('0x42')]][_0xd24d('0x32')]=![];this[_0xd24d('0xa')][_0x338668[_0xd24d('0x42')]][_0xd24d('0x44')]=_0x338668[_0xd24d('0x11')][_0xd24d('0x33')]();this['agents'][_0x338668[_0xd24d('0x42')]][_0xd24d('0x45')]=_0x338668[_0xd24d('0x45')];this[_0xd24d('0xa')][_0x338668[_0xd24d('0x42')]]['updateStatusRealtime'](_0x338668);}}else if(this['telephones'][_0x338668[_0xd24d('0x42')]]){this[_0xd24d('0xb')][_0x338668[_0xd24d('0x42')]][_0xd24d('0x44')]=_0x338668[_0xd24d('0x11')]['toLowerCase']();this[_0xd24d('0xb')][_0x338668[_0xd24d('0x42')]][_0xd24d('0x45')]=_0x338668[_0xd24d('0x45')];logger['debug']('[userReport][peerstatus]\x20sending\x20telephone:save\x20event:',util[_0xd24d('0x19')](this[_0xd24d('0xb')][_0x338668[_0xd24d('0x42')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xd24d('0x2c')](_0xd24d('0x38'),this['telephones'][_0x338668[_0xd24d('0x42')]][_0xd24d('0x2e')]),_0xd24d('0x46'),this[_0xd24d('0xb')][_0x338668['peer']]);}else if(this[_0xd24d('0x9')][_0x338668[_0xd24d('0x42')]]){this[_0xd24d('0x9')][_0x338668[_0xd24d('0x42')]]['status']=_0x338668['peerstatus'][_0xd24d('0x33')]();this[_0xd24d('0x9')][_0x338668[_0xd24d('0x42')]]['address']=_0x338668['address'];logger[_0xd24d('0x24')]('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util[_0xd24d('0x19')](this[_0xd24d('0x9')][_0x338668[_0xd24d('0x42')]],{'showHidden':![],'depth':null}));this[_0xd24d('0x1f')](util[_0xd24d('0x2c')](_0xd24d('0x2d'),this['trunks'][_0x338668[_0xd24d('0x42')]][_0xd24d('0x2e')]),_0xd24d('0x2f'),this[_0xd24d('0x9')][_0x338668[_0xd24d('0x42')]]);}}}catch(_0x16f42e){logger[_0xd24d('0x17')](_0xd24d('0x41'),util[_0xd24d('0x19')](_0x16f42e,{'showHidden':![],'depth':null}));}};module[_0xd24d('0x47')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index b01d418..323c42f 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 _0x43f1=['channel','substring','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','moment','ioredis','ami','../ami','redis','defaults','localhost','socket.io-emitter','voiceChannels','channels','voiceQueues','agents','variables','agentcalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentComplete','syncVarSet','hangup','musiconholdstart','syncMusicOnHoldStart','attendedtransfer','syncAttendedTransfer','blindtransfer','emit','prototype','isNotNull','isUndefined','syncAgentCalled','debug','[%s][voiceAgentReport][agentcalled]\x20event:','uniqueid','inspect','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','mandatoryDisposition','inbound','voice','destuniqueid','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','calleridnum','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','membername','error','[%s][voiceAgentReport][agentconnect]\x20event:','info','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','destchannelstate','destchannelstatedesc','holdtime','routealias','merge','interface','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','agentcomplete','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','lastevent','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','hasOwnProperty','agentconnectAt','complete','agent','talktime','acw','acwtime','acwTimeout','agentacw','omit','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','destaccountcode','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','transfer','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','agentcompleteAt','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','syncBlindTransfer','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:'];(function(_0x1a9101,_0x295dfe){var _0x204e32=function(_0x2ef1cc){while(--_0x2ef1cc){_0x1a9101['push'](_0x1a9101['shift']());}};_0x204e32(++_0x295dfe);}(_0x43f1,0xa7));var _0x143f=function(_0x479160,_0x3ab560){_0x479160=_0x479160-0x0;var _0x47ac6d=_0x43f1[_0x479160];return _0x47ac6d;};'use strict';var _=require(_0x143f('0x0'));var moment=require(_0x143f('0x1'));var util=require('util');var Redis=require(_0x143f('0x2'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x143f('0x3'));var ami=require(_0x143f('0x4'));config[_0x143f('0x5')]=_[_0x143f('0x6')](config[_0x143f('0x5')],{'host':_0x143f('0x7'),'port':0x18eb});var io=require(_0x143f('0x8'))(new Redis(config[_0x143f('0x5')]));function VoiceAgentReport(_0x556b84){this['channels']={};this[_0x143f('0x9')]=_0x556b84[_0x143f('0xa')];this[_0x143f('0xb')]=_0x556b84[_0x143f('0xb')];this[_0x143f('0xc')]=_0x556b84[_0x143f('0xc')];this[_0x143f('0xd')]={};ami['on'](_0x143f('0xe'),this['syncAgentCalled'][_0x143f('0xf')](this));ami['on'](_0x143f('0x10'),this[_0x143f('0x11')][_0x143f('0xf')](this));ami['on'](_0x143f('0x12'),this['syncAgentRingNoAnswer'][_0x143f('0xf')](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon']['bind'](this));ami['on']('agentcomplete',this[_0x143f('0x13')][_0x143f('0xf')](this));ami['on']('varset',this[_0x143f('0x14')]['bind'](this));ami['on'](_0x143f('0x15'),this['syncHangup']['bind'](this));ami['on'](_0x143f('0x16'),this[_0x143f('0x17')]['bind'](this));ami['on']('musiconholdstop',this['syncMusicOnHoldStop'][_0x143f('0xf')](this));ami['on'](_0x143f('0x18'),this[_0x143f('0x19')][_0x143f('0xf')](this));ami['on'](_0x143f('0x1a'),this['syncBlindTransfer'][_0x143f('0xf')](this));}VoiceAgentReport['prototype'][_0x143f('0x1b')]=function(_0x35595a,_0xaff055,_0xe2c5){io['to'](_0x35595a)['emit'](_0xaff055,_0xe2c5);};VoiceAgentReport[_0x143f('0x1c')][_0x143f('0x1d')]=function(_0xc9b3fd){return _0xc9b3fd!==null&&!_[_0x143f('0x1e')](_0xc9b3fd);};VoiceAgentReport[_0x143f('0x1c')][_0x143f('0x1f')]=function(_0x2b164d){try{if(this[_0x143f('0x1d')](_0x2b164d)){logger['info']('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x2b164d['uniqueid'],_0x2b164d['membername'],_0x2b164d['destuniqueid']);logger[_0x143f('0x20')](_0x143f('0x21'),_0x2b164d[_0x143f('0x22')],util[_0x143f('0x23')](_0x2b164d,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x143f('0xa')][_0x2b164d['uniqueid']])){this[_0x143f('0xa')][_0x2b164d[_0x143f('0x22')]]={};}if(_[_0x143f('0x1e')](this['channels'][_0x2b164d[_0x143f('0x22')]][_0x2b164d['destuniqueid']])){this['channels'][_0x2b164d[_0x143f('0x22')]][_0x2b164d['destuniqueid']]={'agentcalledAt':moment()[_0x143f('0x24')](_0x143f('0x25')),'lastevent':_0x143f('0x26'),'mandatoryDisposition':this[_0x143f('0xb')][_0x2b164d[_0x143f('0x27')]]?this[_0x143f('0xb')][_0x2b164d['queue']][_0x143f('0x28')]||![]:![],'type':this['voiceQueues'][_0x2b164d[_0x143f('0x27')]]?this[_0x143f('0xb')][_0x2b164d['queue']]['type']||_0x143f('0x29'):'inbound','variables':this['variables'][_0x2b164d['uniqueid']],'motionChannel':_0x143f('0x2a')};}_['merge'](this[_0x143f('0xa')][_0x2b164d[_0x143f('0x22')]][_0x2b164d[_0x143f('0x2b')]],_['omit'](_0x2b164d,['event',_0x143f('0x2c')]));logger[_0x143f('0x20')](_0x143f('0x2d'),_0x2b164d[_0x143f('0x22')],util[_0x143f('0x23')](this[_0x143f('0xa')][_0x2b164d[_0x143f('0x22')]][_0x2b164d[_0x143f('0x2b')]],{'showHidden':![],'depth':null}));ami[_0x143f('0x1b')](_0x143f('0x2e'),this[_0x143f('0xa')][_0x2b164d[_0x143f('0x22')]][_0x2b164d[_0x143f('0x2b')]]);var _0x4ec6db={'id':this['agents'][_0x2b164d['interface']]['id'],'calleridnum':this['channels'][_0x2b164d['uniqueid']][_0x2b164d[_0x143f('0x2b')]][_0x143f('0x2f')],'queue':this['channels'][_0x2b164d[_0x143f('0x22')]][_0x2b164d['destuniqueid']][_0x143f('0x27')],'variables':this[_0x143f('0xa')][_0x2b164d['uniqueid']][_0x2b164d[_0x143f('0x2b')]]['variables']};logger['debug'](_0x143f('0x30'),_0x2b164d[_0x143f('0x22')],util[_0x143f('0x23')](_0x4ec6db,{'showHidden':![],'depth':null}));this[_0x143f('0x1b')](util[_0x143f('0x24')](_0x143f('0x31'),_0x2b164d[_0x143f('0x32')]),'user:called',_0x4ec6db);}}catch(_0x4fb4d9){logger[_0x143f('0x33')]('[%s][voiceAgentReport][agentcalled]',_0x2b164d[_0x143f('0x22')],util[_0x143f('0x23')](_0x4fb4d9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x143f('0x1c')][_0x143f('0x11')]=function(_0x2d16ee){try{if(this[_0x143f('0x1d')](_0x2d16ee)){if(this[_0x143f('0xa')][_0x2d16ee[_0x143f('0x22')]]){logger[_0x143f('0x20')](_0x143f('0x34'),_0x2d16ee['uniqueid'],util['inspect'](_0x2d16ee,{'showHidden':![],'depth':null}));for(var _0x3c620b in this[_0x143f('0xa')][_0x2d16ee[_0x143f('0x22')]]){if(this['channels'][_0x2d16ee[_0x143f('0x22')]]['hasOwnProperty'](_0x3c620b)){if(_0x2d16ee[_0x143f('0x2b')]===_0x3c620b){logger[_0x143f('0x35')](_0x143f('0x36'),_0x2d16ee[_0x143f('0x22')],_0x2d16ee[_0x143f('0x32')],_0x2d16ee[_0x143f('0x2b')]);this['channels'][_0x2d16ee[_0x143f('0x22')]][_0x3c620b]['agentconnectAt']=moment()['format'](_0x143f('0x25'));this['channels'][_0x2d16ee[_0x143f('0x22')]][_0x3c620b][_0x143f('0x37')]=_0x2d16ee[_0x143f('0x37')];this[_0x143f('0xa')][_0x2d16ee[_0x143f('0x22')]][_0x3c620b]['connectedlinenum']=_0x2d16ee['connectedlinenum'];this['channels'][_0x2d16ee[_0x143f('0x22')]][_0x3c620b][_0x143f('0x38')]=_0x2d16ee['destchannelstate'];this[_0x143f('0xa')][_0x2d16ee[_0x143f('0x22')]][_0x3c620b]['destchannelstatedesc']=_0x2d16ee[_0x143f('0x39')];this['channels'][_0x2d16ee[_0x143f('0x22')]][_0x3c620b]['holdtime']=_0x2d16ee[_0x143f('0x3a')];this[_0x143f('0xa')][_0x2d16ee[_0x143f('0x22')]][_0x3c620b]['lastevent']='connect';if(this[_0x143f('0x9')][this['channels'][_0x2d16ee[_0x143f('0x22')]][_0x3c620b]['uniqueid']]){var _0x3a01a9=this[_0x143f('0x9')][this[_0x143f('0xa')][_0x2d16ee[_0x143f('0x22')]][_0x3c620b]['uniqueid']][_0x143f('0x3b')];this[_0x143f('0xa')][_0x2d16ee[_0x143f('0x22')]][_0x3c620b][_0x143f('0x3b')]=_0x3a01a9;_0x2d16ee[_0x143f('0x3b')]=_0x3a01a9;}_[_0x143f('0x3c')](this[_0x143f('0xc')][_0x2d16ee[_0x143f('0x3d')]],_['pick'](_0x2d16ee,[_0x143f('0x27'),_0x143f('0x3e'),_0x143f('0x3b')]));logger[_0x143f('0x20')](_0x143f('0x3f'),_0x2d16ee[_0x143f('0x22')],util['inspect'](this[_0x143f('0xa')][_0x2d16ee[_0x143f('0x22')]][_0x2d16ee[_0x143f('0x2b')]],{'showHidden':![],'depth':null}));ami[_0x143f('0x1b')](_0x143f('0x40'),this[_0x143f('0xa')][_0x2d16ee[_0x143f('0x22')]][_0x2d16ee[_0x143f('0x2b')]]);logger[_0x143f('0x20')](_0x143f('0x41'),_0x2d16ee[_0x143f('0x22')],util['inspect'](this[_0x143f('0xa')][_0x2d16ee['uniqueid']][_0x2d16ee[_0x143f('0x2b')]],{'showHidden':![],'depth':null}));this[_0x143f('0x1b')](util['format'](_0x143f('0x31'),_0x2d16ee[_0x143f('0x32')]),'user:agentconnect',this[_0x143f('0xa')][_0x2d16ee[_0x143f('0x22')]][_0x2d16ee['destuniqueid']]);}else if(!this[_0x143f('0xa')][_0x2d16ee[_0x143f('0x22')]][_0x3c620b][_0x143f('0x12')]&&!this['channels'][_0x2d16ee[_0x143f('0x22')]][_0x3c620b][_0x143f('0x42')]){logger[_0x143f('0x35')]('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x2d16ee[_0x143f('0x22')],this[_0x143f('0xa')][_0x2d16ee[_0x143f('0x22')]][_0x3c620b][_0x143f('0x32')],_0x3c620b);this[_0x143f('0xa')][_0x2d16ee['uniqueid']][_0x3c620b]['agentringnoanswer']=!![];this[_0x143f('0xa')][_0x2d16ee[_0x143f('0x22')]][_0x3c620b][_0x143f('0x43')]=moment()[_0x143f('0x24')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x2d16ee[_0x143f('0x22')]][_0x3c620b][_0x143f('0x44')]=_0x2d16ee[_0x143f('0x2b')];this[_0x143f('0xa')][_0x2d16ee[_0x143f('0x22')]][_0x3c620b][_0x143f('0x45')]=_0x2d16ee[_0x143f('0x32')];this[_0x143f('0xa')][_0x2d16ee[_0x143f('0x22')]][_0x3c620b][_0x143f('0x46')]=_0x143f('0x47');this[_0x143f('0xa')][_0x2d16ee['uniqueid']][_0x3c620b][_0x143f('0x48')]=_0x143f('0x47');logger[_0x143f('0x20')](_0x143f('0x49'),_0x2d16ee[_0x143f('0x22')],util['inspect'](this[_0x143f('0xa')][_0x2d16ee[_0x143f('0x22')]][_0x3c620b],{'showHidden':![],'depth':null}));ami['emit'](_0x143f('0x4a'),this[_0x143f('0xa')][_0x2d16ee[_0x143f('0x22')]][_0x3c620b]);}}}}}}catch(_0x108ff1){logger[_0x143f('0x33')](_0x143f('0x4b'),_0x2d16ee[_0x143f('0x22')],util[_0x143f('0x23')](_0x108ff1,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x143f('0x1c')]['syncAgentRingNoAnswer']=function(_0x3408c5){try{if(this[_0x143f('0x1d')](_0x3408c5)){logger['debug'](_0x143f('0x4c'),_0x3408c5[_0x143f('0x22')],util[_0x143f('0x23')](_0x3408c5,{'showHidden':![],'depth':null}));if(this[_0x143f('0xa')][_0x3408c5['uniqueid']]&&this[_0x143f('0xa')][_0x3408c5[_0x143f('0x22')]][_0x3408c5[_0x143f('0x2b')]]){logger[_0x143f('0x35')]('[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected',_0x3408c5[_0x143f('0x22')],_0x3408c5['membername'],_0x3408c5[_0x143f('0x2b')]);this[_0x143f('0xa')][_0x3408c5[_0x143f('0x22')]][_0x3408c5[_0x143f('0x2b')]][_0x143f('0x12')]=!![];this['channels'][_0x3408c5['uniqueid']][_0x3408c5[_0x143f('0x2b')]][_0x143f('0x43')]=moment()[_0x143f('0x24')](_0x143f('0x25'));this[_0x143f('0xa')][_0x3408c5['uniqueid']][_0x3408c5['destuniqueid']][_0x143f('0x46')]=_0x143f('0x4d');this[_0x143f('0xa')][_0x3408c5['uniqueid']][_0x3408c5[_0x143f('0x2b')]]['reason']=_0x143f('0x4d');logger['debug'](_0x143f('0x4e'),_0x3408c5[_0x143f('0x22')],util[_0x143f('0x23')](this[_0x143f('0xa')][_0x3408c5['uniqueid']][_0x3408c5['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x143f('0x1b')](_0x143f('0x4f'),this[_0x143f('0xa')][_0x3408c5[_0x143f('0x22')]][_0x3408c5['destuniqueid']]);}}}catch(_0x1628d4){logger['error']('[%s][voiceAgentReport][agentringnoanswer]',_0x3408c5[_0x143f('0x22')],util[_0x143f('0x23')](_0x1628d4,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x143f('0x1c')]['syncQueueCallerAbandon']=function(_0x5825ff){try{if(this[_0x143f('0x1d')](_0x5825ff)){logger['debug']('[%s][voiceAgentReport][queuecallerabandon]\x20event:',_0x5825ff['uniqueid'],util[_0x143f('0x23')](_0x5825ff,{'showHidden':![],'depth':null}));if(this[_0x143f('0xa')][_0x5825ff[_0x143f('0x22')]]){for(var _0x5a6067 in this[_0x143f('0xa')][_0x5825ff[_0x143f('0x22')]]){if(this[_0x143f('0xa')][_0x5825ff[_0x143f('0x22')]]['hasOwnProperty'](_0x5a6067)&&!this[_0x143f('0xa')][_0x5825ff[_0x143f('0x22')]][_0x5a6067][_0x143f('0x12')]&&!this['channels'][_0x5825ff[_0x143f('0x22')]][_0x5a6067][_0x143f('0x42')]){logger[_0x143f('0x35')](_0x143f('0x50'),_0x5825ff[_0x143f('0x22')],this[_0x143f('0xa')][_0x5825ff[_0x143f('0x22')]][_0x5a6067][_0x143f('0x32')],_0x5a6067);this[_0x143f('0xa')][_0x5825ff[_0x143f('0x22')]][_0x5a6067][_0x143f('0x12')]=!![];this['channels'][_0x5825ff['uniqueid']][_0x5a6067][_0x143f('0x43')]=moment()[_0x143f('0x24')](_0x143f('0x25'));this[_0x143f('0xa')][_0x5825ff['uniqueid']][_0x5a6067][_0x143f('0x46')]='abandoned';this['channels'][_0x5825ff['uniqueid']][_0x5a6067][_0x143f('0x48')]=_0x143f('0x51');logger[_0x143f('0x20')](_0x143f('0x52'),_0x5825ff[_0x143f('0x22')],util[_0x143f('0x23')](this[_0x143f('0xa')][_0x5825ff[_0x143f('0x22')]][_0x5a6067],{'showHidden':![],'depth':null}));ami[_0x143f('0x1b')](_0x143f('0x53'),this['channels'][_0x5825ff[_0x143f('0x22')]][_0x5a6067]);}}}}}catch(_0x20acae){logger[_0x143f('0x33')](_0x143f('0x54'),_0x5825ff[_0x143f('0x22')],util[_0x143f('0x23')](_0x20acae,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x143f('0x1c')][_0x143f('0x13')]=function(_0x4985aa){try{if(this[_0x143f('0x1d')](_0x4985aa)){logger[_0x143f('0x20')](_0x143f('0x55'),_0x4985aa[_0x143f('0x22')],util[_0x143f('0x23')](_0x4985aa,{'showHidden':![],'depth':null}));if(this[_0x143f('0xa')][_0x4985aa[_0x143f('0x22')]]){for(var _0xc1a53 in this[_0x143f('0xa')][_0x4985aa[_0x143f('0x22')]]){if(this[_0x143f('0xa')][_0x4985aa['uniqueid']][_0x143f('0x56')](_0xc1a53)){if(this[_0x143f('0xa')][_0x4985aa[_0x143f('0x22')]][_0xc1a53][_0x143f('0x57')]&&!this[_0x143f('0xa')][_0x4985aa[_0x143f('0x22')]][_0xc1a53]['agentcomplete']){logger[_0x143f('0x35')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x4985aa[_0x143f('0x22')],this[_0x143f('0xa')][_0x4985aa[_0x143f('0x22')]][_0xc1a53][_0x143f('0x32')],_0xc1a53);this[_0x143f('0xa')][_0x4985aa[_0x143f('0x22')]][_0xc1a53]['agentcomplete']=!![];this[_0x143f('0xa')][_0x4985aa[_0x143f('0x22')]][_0xc1a53]['agentcompleteAt']=moment()[_0x143f('0x24')](_0x143f('0x25'));this[_0x143f('0xa')][_0x4985aa[_0x143f('0x22')]][_0xc1a53]['lastevent']=_0x143f('0x58');this['channels'][_0x4985aa['uniqueid']][_0xc1a53][_0x143f('0x48')]=_0x4985aa['reason']=='transfer'?_0x143f('0x59'):_0x4985aa[_0x143f('0x48')];this[_0x143f('0xa')][_0x4985aa[_0x143f('0x22')]][_0xc1a53][_0x143f('0x5a')]=_0x4985aa['talktime'];if(this[_0x143f('0xb')][_0x4985aa['queue']]&&this[_0x143f('0xb')][_0x4985aa['queue']][_0x143f('0x5b')]){this[_0x143f('0xa')][_0x4985aa[_0x143f('0x22')]][_0xc1a53][_0x143f('0x5c')]=this['voiceQueues'][_0x4985aa['queue']][_0x143f('0x5d')];this[_0x143f('0xa')][_0x4985aa[_0x143f('0x22')]][_0xc1a53][_0x143f('0x5e')]=!![];}this['agents'][_0x4985aa['interface']]=_[_0x143f('0x5f')](this[_0x143f('0xc')][_0x4985aa['interface']],[_0x143f('0x27'),_0x143f('0x3e')]);logger['debug'](_0x143f('0x60'),_0x4985aa[_0x143f('0x22')],util[_0x143f('0x23')](this['channels'][_0x4985aa[_0x143f('0x22')]][_0xc1a53],{'showHidden':![],'depth':null}));ami[_0x143f('0x1b')](_0x143f('0x61'),this[_0x143f('0xa')][_0x4985aa[_0x143f('0x22')]][_0xc1a53]);logger[_0x143f('0x20')](_0x143f('0x62'),_0x4985aa[_0x143f('0x22')],util[_0x143f('0x23')]({'id':this['agents'][_0x4985aa[_0x143f('0x3d')]]['id'],'destaccountcode':_0x4985aa['destaccountcode']},{'showHidden':![],'depth':null}));this[_0x143f('0x1b')](util[_0x143f('0x24')](_0x143f('0x31'),_0x4985aa[_0x143f('0x32')]),_0x143f('0x63'),{'id':this['agents'][_0x4985aa[_0x143f('0x3d')]]['id'],'destaccountcode':_0x4985aa[_0x143f('0x64')]});}}}}}}catch(_0x3a0020){logger[_0x143f('0x33')](_0x143f('0x65'),_0x4985aa[_0x143f('0x22')],util[_0x143f('0x23')](_0x3a0020,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x143f('0x1c')]['syncVarSet']=function(_0x26e726){try{if(this[_0x143f('0x1d')](_0x26e726)){logger[_0x143f('0x20')](_0x143f('0x66'),_0x26e726[_0x143f('0x22')],util[_0x143f('0x23')](_0x26e726,{'showHidden':![],'depth':null}));this[_0x143f('0x67')](_0x26e726[_0x143f('0x22')],_[_0x143f('0x68')](_0x26e726[_0x143f('0x69')])[0x0],_0x26e726[_0x143f('0x6a')]);if(this[_0x143f('0xa')][_0x26e726[_0x143f('0x22')]]){for(var _0x45a58b in this[_0x143f('0xa')][_0x26e726[_0x143f('0x22')]]){if(this[_0x143f('0xa')][_0x26e726[_0x143f('0x22')]][_0x143f('0x56')](_0x45a58b)){logger[_0x143f('0x35')](_0x143f('0x6b'),_0x26e726[_0x143f('0x22')],_0x45a58b,_[_0x143f('0x68')](_0x26e726[_0x143f('0x69')])[0x0],_0x26e726[_0x143f('0x6a')]);if(_['isUndefined'](this[_0x143f('0xa')][_0x26e726[_0x143f('0x22')]][_0x45a58b]['variables'])){this[_0x143f('0xa')][_0x26e726[_0x143f('0x22')]][_0x45a58b]['variables']={};}this[_0x143f('0xa')][_0x26e726[_0x143f('0x22')]][_0x45a58b][_0x143f('0xd')]=this['variables'][_0x26e726[_0x143f('0x22')]];}}}}}catch(_0x272a2d){logger[_0x143f('0x33')](_0x143f('0x6c'),_0x26e726[_0x143f('0x22')],util[_0x143f('0x23')](_0x272a2d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x143f('0x1c')][_0x143f('0x67')]=function(_0x51565f,_0x21a84b,_0x40ad9f){var _0x16fd1f=[_0x143f('0x6d'),_0x143f('0x6e'),'rtpaudioqosjitter',_0x143f('0x6f'),_0x143f('0x70'),_0x143f('0x71'),_0x143f('0x72'),_0x143f('0x73'),_0x143f('0x74'),_0x143f('0x75'),_0x143f('0x76'),'bridgepvtcallid',_0x143f('0x77'),_0x143f('0x78'),_0x143f('0x79'),_0x143f('0x7a'),_0x143f('0x32'),_0x143f('0x7b'),_0x143f('0x7c')];if(!_[_0x143f('0x7d')](_0x21a84b)&&!_[_0x143f('0x7e')](_0x16fd1f,_0x21a84b)){if(_[_0x143f('0x1e')](this[_0x143f('0xd')][_0x51565f])){this['variables'][_0x51565f]={};}this[_0x143f('0xd')][_0x51565f][_0x21a84b]=_0x40ad9f;}};VoiceAgentReport[_0x143f('0x1c')]['syncHangup']=function(_0x1c123b){try{if(this['isNotNull'](_0x1c123b)){logger[_0x143f('0x20')]('[%s][voiceAgentReport][hangup]\x20event:',_0x1c123b[_0x143f('0x22')],util[_0x143f('0x23')](_0x1c123b,{'showHidden':![],'depth':null}));if(this[_0x143f('0xa')][_0x1c123b[_0x143f('0x22')]]){for(var _0x145810 in this[_0x143f('0xa')][_0x1c123b[_0x143f('0x22')]]){if(this[_0x143f('0xa')][_0x1c123b[_0x143f('0x22')]][_0x143f('0x56')](_0x145810)){if(this[_0x143f('0xa')][_0x1c123b[_0x143f('0x22')]][_0x145810][_0x143f('0x48')]==_0x143f('0x7f')&&this['channels'][_0x1c123b[_0x143f('0x22')]][_0x145810][_0x143f('0x42')]){logger[_0x143f('0x35')](_0x143f('0x80'),_0x1c123b[_0x143f('0x22')],_0x145810);this[_0x143f('0xa')][_0x1c123b[_0x143f('0x22')]][_0x145810][_0x143f('0x81')]=moment()[_0x143f('0x24')](_0x143f('0x25'));}}}logger[_0x143f('0x20')](_0x143f('0x82'),_0x1c123b[_0x143f('0x22')],util[_0x143f('0x23')](_[_0x143f('0x83')](this[_0x143f('0xa')][_0x1c123b[_0x143f('0x22')]]),{'showHidden':![],'depth':null}));ami[_0x143f('0x1b')](_0x143f('0x84'),_['values'](this[_0x143f('0xa')][_0x1c123b['uniqueid']]));delete this['channels'][_0x1c123b[_0x143f('0x22')]];}if(this[_0x143f('0xd')][_0x1c123b['uniqueid']]){delete this[_0x143f('0xd')][_0x1c123b['uniqueid']];}}}catch(_0x8fec22){logger['error'](_0x143f('0x85'),_0x1c123b['uniqueid'],util[_0x143f('0x23')](_0x8fec22,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x143f('0x1c')][_0x143f('0x19')]=function(_0x4d191b){try{if(this[_0x143f('0x1d')](_0x4d191b)){logger[_0x143f('0x20')](_0x143f('0x86'),_0x4d191b[_0x143f('0x22')],util[_0x143f('0x23')](_0x4d191b,{'showHidden':![],'depth':null}));if(this[_0x143f('0xa')][_0x4d191b['transfereeuniqueid']]){for(var _0x257cfe in this[_0x143f('0xa')][_0x4d191b[_0x143f('0x87')]]){if(this[_0x143f('0xa')][_0x4d191b[_0x143f('0x87')]][_0x143f('0x56')](_0x257cfe)){if(_0x4d191b[_0x143f('0x88')]===_0x257cfe){logger[_0x143f('0x35')](_0x143f('0x89'),_0x4d191b['uniqueid'],this[_0x143f('0xa')][_0x4d191b[_0x143f('0x87')]][_0x257cfe][_0x143f('0x32')],_0x257cfe);var _0x266fc6=moment();this[_0x143f('0xa')][_0x4d191b[_0x143f('0x87')]][_0x257cfe][_0x143f('0x42')]=!![];this[_0x143f('0xa')][_0x4d191b['transfereeuniqueid']][_0x257cfe][_0x143f('0x81')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x4d191b['transfereeuniqueid']][_0x257cfe][_0x143f('0x46')]=_0x143f('0x58');this[_0x143f('0xa')][_0x4d191b[_0x143f('0x87')]][_0x257cfe][_0x143f('0x48')]=_0x143f('0x7f');this[_0x143f('0xa')][_0x4d191b[_0x143f('0x87')]][_0x257cfe][_0x143f('0x5a')]=_0x266fc6[_0x143f('0x8a')](this[_0x143f('0xa')][_0x4d191b[_0x143f('0x87')]][_0x257cfe][_0x143f('0x57')],_0x143f('0x8b'));}}}}if(this[_0x143f('0xa')][_0x4d191b['secondtransfereruniqueid']]){var _0x4c708d=this[_0x143f('0xa')][_0x4d191b['secondtransfereruniqueid']];this[_0x143f('0xa')][_0x4d191b[_0x143f('0x8c')]]=this[_0x143f('0xa')][_0x4d191b[_0x143f('0x87')]];this[_0x143f('0xa')][_0x4d191b['transfereeuniqueid']]=_0x4c708d;}}}catch(_0xb8b0c3){logger['error'](_0x143f('0x8d'),_0x4d191b[_0x143f('0x22')],util[_0x143f('0x23')](_0xb8b0c3,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x143f('0x8e')]=function(_0x45a316){try{if(this[_0x143f('0x1d')](_0x45a316)){logger[_0x143f('0x20')]('[%s][voiceAgentReport][blindtransfer]\x20event:',_0x45a316[_0x143f('0x22')],util['inspect'](_0x45a316,{'showHidden':![],'depth':null}));if(this[_0x143f('0xa')][_0x45a316[_0x143f('0x87')]]){for(var _0x49687b in this[_0x143f('0xa')][_0x45a316[_0x143f('0x87')]]){if(this['channels'][_0x45a316[_0x143f('0x87')]][_0x143f('0x56')](_0x49687b)){if(_0x45a316[_0x143f('0x8f')]===_0x49687b){logger['info'](_0x143f('0x90'),_0x45a316[_0x143f('0x22')],this[_0x143f('0xa')][_0x45a316[_0x143f('0x87')]][_0x49687b][_0x143f('0x32')],_0x49687b);var _0x2381cf=moment();this['channels'][_0x45a316[_0x143f('0x87')]][_0x49687b][_0x143f('0x42')]=!![];this[_0x143f('0xa')][_0x45a316[_0x143f('0x87')]][_0x49687b][_0x143f('0x81')]=_0x2381cf;this['channels'][_0x45a316[_0x143f('0x87')]][_0x49687b][_0x143f('0x46')]=_0x143f('0x58');this['channels'][_0x45a316[_0x143f('0x87')]][_0x49687b][_0x143f('0x48')]='transfer';this[_0x143f('0xa')][_0x45a316['transfereeuniqueid']][_0x49687b][_0x143f('0x5a')]=_0x2381cf[_0x143f('0x8a')](this[_0x143f('0xa')][_0x45a316[_0x143f('0x87')]][_0x49687b][_0x143f('0x57')],_0x143f('0x8b'));}}}}}}catch(_0x1f7635){logger['error'](_0x143f('0x91'),_0x45a316['uniqueid'],util['inspect'](_0x1f7635,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x143f('0x17')]=function(_0x4777a3){var _0xa0a7a6='';try{if(this[_0x143f('0x1d')](_0x4777a3)){logger['debug'](_0x143f('0x92'),_0x4777a3['uniqueid'],util[_0x143f('0x23')](_0x4777a3,{'showHidden':![],'depth':null}));if(_0x4777a3[_0x143f('0x93')]){_0xa0a7a6=_0x4777a3[_0x143f('0x93')][_0x143f('0x94')](0x0,_0x4777a3[_0x143f('0x93')]['lastIndexOf']('-'));if(this['agents'][_0xa0a7a6]){logger[_0x143f('0x35')](_0x143f('0x95'),_0x4777a3[_0x143f('0x22')],_0xa0a7a6);this[_0x143f('0xc')][_0xa0a7a6][_0x143f('0x96')]=!![];}}}}catch(_0xc023e7){logger[_0x143f('0x33')](_0x143f('0x97'),_0x4777a3[_0x143f('0x22')],util[_0x143f('0x23')](_0xc023e7,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x143f('0x1c')]['syncMusicOnHoldStop']=function(_0x80cb7d){var _0x1c3648='';try{if(this[_0x143f('0x1d')](_0x80cb7d)){logger[_0x143f('0x20')](_0x143f('0x98'),_0x80cb7d[_0x143f('0x22')],util[_0x143f('0x23')](_0x80cb7d,{'showHidden':![],'depth':null}));if(_0x80cb7d[_0x143f('0x93')]){_0x1c3648=_0x80cb7d['channel']['substring'](0x0,_0x80cb7d[_0x143f('0x93')][_0x143f('0x99')]('-'));if(this['agents'][_0x1c3648]){logger[_0x143f('0x35')](_0x143f('0x9a'),_0x80cb7d['uniqueid'],_0x1c3648);this[_0x143f('0xc')][_0x1c3648][_0x143f('0x96')]=![];}}}}catch(_0x2d636b){logger[_0x143f('0x33')](_0x143f('0x9b'),_0x80cb7d[_0x143f('0x22')],util[_0x143f('0x23')](_0x2d636b,{'showHidden':![],'depth':null}));}};module[_0x143f('0x9c')]=VoiceAgentReport; \ No newline at end of file +var _0x276c=['[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','moment','ioredis','../../../config/environment','../../../config/logger','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceChannels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','syncAgentConnect','agentringnoanswer','queuecallerabandon','syncAgentComplete','varset','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','blindtransfer','syncBlindTransfer','prototype','emit','isUndefined','isNotNull','info','uniqueid','membername','destuniqueid','debug','inspect','YYYY-MM-DD\x20HH:mm:ss','called','queue','mandatoryDisposition','type','inbound','voice','merge','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','interface','format','user:%s','user:called','error','[%s][voiceAgentReport][agentcalled]','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','routealias','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','lastevent','answered_elsewhere','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','reason','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','[%s][voiceAgentReport][agentringnoanswer]','syncQueueCallerAbandon','[%s][voiceAgentReport][queuecallerabandon]\x20event:','agentcomplete','agentringnoanswerAt','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','talktime','acw','acwtime','acwTimeout','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','syncVarSet','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','variable','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','[%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]','transfereruniqueid','channel','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','syncMusicOnHoldStop'];(function(_0x34325b,_0x5e5afe){var _0x3da348=function(_0x3bf709){while(--_0x3bf709){_0x34325b['push'](_0x34325b['shift']());}};_0x3da348(++_0x5e5afe);}(_0x276c,0x1d8));var _0xc276=function(_0x156b7a,_0x59c664){_0x156b7a=_0x156b7a-0x0;var _0x289c70=_0x276c[_0x156b7a];return _0x289c70;};'use strict';var _=require('lodash');var moment=require(_0xc276('0x0'));var util=require('util');var Redis=require(_0xc276('0x1'));var config=require(_0xc276('0x2'));var logger=require(_0xc276('0x3'))('ami');var ami=require(_0xc276('0x4'));config[_0xc276('0x5')]=_[_0xc276('0x6')](config[_0xc276('0x5')],{'host':_0xc276('0x7'),'port':0x18eb});var io=require(_0xc276('0x8'))(new Redis(config['redis']));function VoiceAgentReport(_0x1152e5){this[_0xc276('0x9')]={};this[_0xc276('0xa')]=_0x1152e5[_0xc276('0x9')];this[_0xc276('0xb')]=_0x1152e5[_0xc276('0xb')];this[_0xc276('0xc')]=_0x1152e5[_0xc276('0xc')];this[_0xc276('0xd')]={};ami['on'](_0xc276('0xe'),this[_0xc276('0xf')][_0xc276('0x10')](this));ami['on']('agentconnect',this[_0xc276('0x11')][_0xc276('0x10')](this));ami['on'](_0xc276('0x12'),this['syncAgentRingNoAnswer']['bind'](this));ami['on'](_0xc276('0x13'),this['syncQueueCallerAbandon']['bind'](this));ami['on']('agentcomplete',this[_0xc276('0x14')][_0xc276('0x10')](this));ami['on'](_0xc276('0x15'),this['syncVarSet'][_0xc276('0x10')](this));ami['on'](_0xc276('0x16'),this[_0xc276('0x17')][_0xc276('0x10')](this));ami['on'](_0xc276('0x18'),this[_0xc276('0x19')][_0xc276('0x10')](this));ami['on'](_0xc276('0x1a'),this['syncMusicOnHoldStop']['bind'](this));ami['on'](_0xc276('0x1b'),this['syncAttendedTransfer'][_0xc276('0x10')](this));ami['on'](_0xc276('0x1c'),this[_0xc276('0x1d')][_0xc276('0x10')](this));}VoiceAgentReport[_0xc276('0x1e')][_0xc276('0x1f')]=function(_0x3aad31,_0x559cfe,_0x22a71c){io['to'](_0x3aad31)[_0xc276('0x1f')](_0x559cfe,_0x22a71c);};VoiceAgentReport['prototype']['isNotNull']=function(_0x99dd93){return _0x99dd93!==null&&!_[_0xc276('0x20')](_0x99dd93);};VoiceAgentReport[_0xc276('0x1e')]['syncAgentCalled']=function(_0x10d0e1){try{if(this[_0xc276('0x21')](_0x10d0e1)){logger[_0xc276('0x22')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x10d0e1[_0xc276('0x23')],_0x10d0e1[_0xc276('0x24')],_0x10d0e1[_0xc276('0x25')]);logger[_0xc276('0x26')]('[%s][voiceAgentReport][agentcalled]\x20event:',_0x10d0e1[_0xc276('0x23')],util[_0xc276('0x27')](_0x10d0e1,{'showHidden':![],'depth':null}));if(_[_0xc276('0x20')](this['channels'][_0x10d0e1[_0xc276('0x23')]])){this[_0xc276('0x9')][_0x10d0e1[_0xc276('0x23')]]={};}if(_[_0xc276('0x20')](this['channels'][_0x10d0e1['uniqueid']][_0x10d0e1[_0xc276('0x25')]])){this['channels'][_0x10d0e1[_0xc276('0x23')]][_0x10d0e1[_0xc276('0x25')]]={'agentcalledAt':moment()['format'](_0xc276('0x28')),'lastevent':_0xc276('0x29'),'mandatoryDisposition':this['voiceQueues'][_0x10d0e1[_0xc276('0x2a')]]?this['voiceQueues'][_0x10d0e1[_0xc276('0x2a')]][_0xc276('0x2b')]||![]:![],'type':this[_0xc276('0xb')][_0x10d0e1['queue']]?this[_0xc276('0xb')][_0x10d0e1[_0xc276('0x2a')]][_0xc276('0x2c')]||_0xc276('0x2d'):_0xc276('0x2d'),'variables':this[_0xc276('0xd')][_0x10d0e1[_0xc276('0x23')]],'motionChannel':_0xc276('0x2e')};}_[_0xc276('0x2f')](this['channels'][_0x10d0e1[_0xc276('0x23')]][_0x10d0e1['destuniqueid']],_[_0xc276('0x30')](_0x10d0e1,[_0xc276('0x31'),_0xc276('0x32')]));logger[_0xc276('0x26')](_0xc276('0x33'),_0x10d0e1[_0xc276('0x23')],util[_0xc276('0x27')](this[_0xc276('0x9')][_0x10d0e1['uniqueid']][_0x10d0e1[_0xc276('0x25')]],{'showHidden':![],'depth':null}));ami[_0xc276('0x1f')](_0xc276('0x34'),this['channels'][_0x10d0e1['uniqueid']][_0x10d0e1[_0xc276('0x25')]]);var _0x5c8690={'id':this['agents'][_0x10d0e1[_0xc276('0x35')]]['id'],'calleridnum':this['channels'][_0x10d0e1[_0xc276('0x23')]][_0x10d0e1['destuniqueid']]['calleridnum'],'queue':this[_0xc276('0x9')][_0x10d0e1[_0xc276('0x23')]][_0x10d0e1[_0xc276('0x25')]][_0xc276('0x2a')],'variables':this[_0xc276('0x9')][_0x10d0e1[_0xc276('0x23')]][_0x10d0e1[_0xc276('0x25')]][_0xc276('0xd')]};logger[_0xc276('0x26')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x10d0e1[_0xc276('0x23')],util[_0xc276('0x27')](_0x5c8690,{'showHidden':![],'depth':null}));this[_0xc276('0x1f')](util[_0xc276('0x36')](_0xc276('0x37'),_0x10d0e1[_0xc276('0x24')]),_0xc276('0x38'),_0x5c8690);}}catch(_0x8ce16c){logger[_0xc276('0x39')](_0xc276('0x3a'),_0x10d0e1[_0xc276('0x23')],util[_0xc276('0x27')](_0x8ce16c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc276('0x1e')][_0xc276('0x11')]=function(_0x19b063){try{if(this['isNotNull'](_0x19b063)){if(this[_0xc276('0x9')][_0x19b063[_0xc276('0x23')]]){logger[_0xc276('0x26')]('[%s][voiceAgentReport][agentconnect]\x20event:',_0x19b063[_0xc276('0x23')],util[_0xc276('0x27')](_0x19b063,{'showHidden':![],'depth':null}));for(var _0x445eaf in this[_0xc276('0x9')][_0x19b063[_0xc276('0x23')]]){if(this[_0xc276('0x9')][_0x19b063[_0xc276('0x23')]][_0xc276('0x3b')](_0x445eaf)){if(_0x19b063[_0xc276('0x25')]===_0x445eaf){logger[_0xc276('0x22')](_0xc276('0x3c'),_0x19b063[_0xc276('0x23')],_0x19b063[_0xc276('0x24')],_0x19b063[_0xc276('0x25')]);this[_0xc276('0x9')][_0x19b063[_0xc276('0x23')]][_0x445eaf][_0xc276('0x3d')]=moment()[_0xc276('0x36')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xc276('0x9')][_0x19b063['uniqueid']][_0x445eaf][_0xc276('0x3e')]=_0x19b063[_0xc276('0x3e')];this[_0xc276('0x9')][_0x19b063[_0xc276('0x23')]][_0x445eaf][_0xc276('0x3f')]=_0x19b063[_0xc276('0x3f')];this['channels'][_0x19b063['uniqueid']][_0x445eaf][_0xc276('0x40')]=_0x19b063[_0xc276('0x40')];this[_0xc276('0x9')][_0x19b063[_0xc276('0x23')]][_0x445eaf][_0xc276('0x41')]=_0x19b063[_0xc276('0x41')];this[_0xc276('0x9')][_0x19b063[_0xc276('0x23')]][_0x445eaf][_0xc276('0x42')]=_0x19b063[_0xc276('0x42')];this[_0xc276('0x9')][_0x19b063[_0xc276('0x23')]][_0x445eaf]['lastevent']='connect';if(this['voiceChannels'][this[_0xc276('0x9')][_0x19b063[_0xc276('0x23')]][_0x445eaf][_0xc276('0x23')]]){var _0x29f560=this['voiceChannels'][this[_0xc276('0x9')][_0x19b063[_0xc276('0x23')]][_0x445eaf][_0xc276('0x23')]][_0xc276('0x43')];this[_0xc276('0x9')][_0x19b063[_0xc276('0x23')]][_0x445eaf]['routealias']=_0x29f560;_0x19b063[_0xc276('0x43')]=_0x29f560;}_[_0xc276('0x2f')](this[_0xc276('0xc')][_0x19b063[_0xc276('0x35')]],_[_0xc276('0x44')](_0x19b063,[_0xc276('0x2a'),_0xc276('0x45'),_0xc276('0x43')]));logger[_0xc276('0x26')](_0xc276('0x46'),_0x19b063[_0xc276('0x23')],util['inspect'](this[_0xc276('0x9')][_0x19b063['uniqueid']][_0x19b063['destuniqueid']],{'showHidden':![],'depth':null}));ami['emit']('custom:agentconnect',this[_0xc276('0x9')][_0x19b063['uniqueid']][_0x19b063[_0xc276('0x25')]]);logger[_0xc276('0x26')](_0xc276('0x47'),_0x19b063[_0xc276('0x23')],util[_0xc276('0x27')](this['channels'][_0x19b063[_0xc276('0x23')]][_0x19b063[_0xc276('0x25')]],{'showHidden':![],'depth':null}));this[_0xc276('0x1f')](util[_0xc276('0x36')]('user:%s',_0x19b063[_0xc276('0x24')]),_0xc276('0x48'),this[_0xc276('0x9')][_0x19b063[_0xc276('0x23')]][_0x19b063['destuniqueid']]);}else if(!this[_0xc276('0x9')][_0x19b063['uniqueid']][_0x445eaf][_0xc276('0x12')]&&!this['channels'][_0x19b063[_0xc276('0x23')]][_0x445eaf]['agentcomplete']){logger[_0xc276('0x22')](_0xc276('0x49'),_0x19b063[_0xc276('0x23')],this[_0xc276('0x9')][_0x19b063[_0xc276('0x23')]][_0x445eaf][_0xc276('0x24')],_0x445eaf);this['channels'][_0x19b063[_0xc276('0x23')]][_0x445eaf][_0xc276('0x12')]=!![];this[_0xc276('0x9')][_0x19b063[_0xc276('0x23')]][_0x445eaf]['agentringnoanswerAt']=moment()[_0xc276('0x36')](_0xc276('0x28'));this[_0xc276('0x9')][_0x19b063[_0xc276('0x23')]][_0x445eaf]['answeredelsewheredestinationuniqueid']=_0x19b063['destuniqueid'];this[_0xc276('0x9')][_0x19b063['uniqueid']][_0x445eaf]['answeredelsewheremembername']=_0x19b063[_0xc276('0x24')];this[_0xc276('0x9')][_0x19b063[_0xc276('0x23')]][_0x445eaf][_0xc276('0x4a')]=_0xc276('0x4b');this[_0xc276('0x9')][_0x19b063[_0xc276('0x23')]][_0x445eaf]['reason']=_0xc276('0x4b');logger[_0xc276('0x26')](_0xc276('0x4c'),_0x19b063[_0xc276('0x23')],util[_0xc276('0x27')](this[_0xc276('0x9')][_0x19b063[_0xc276('0x23')]][_0x445eaf],{'showHidden':![],'depth':null}));ami[_0xc276('0x1f')](_0xc276('0x4d'),this[_0xc276('0x9')][_0x19b063[_0xc276('0x23')]][_0x445eaf]);}}}}}}catch(_0x371c74){logger['error'](_0xc276('0x4e'),_0x19b063[_0xc276('0x23')],util[_0xc276('0x27')](_0x371c74,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc276('0x1e')]['syncAgentRingNoAnswer']=function(_0x2b8a33){try{if(this[_0xc276('0x21')](_0x2b8a33)){logger[_0xc276('0x26')](_0xc276('0x4f'),_0x2b8a33['uniqueid'],util[_0xc276('0x27')](_0x2b8a33,{'showHidden':![],'depth':null}));if(this['channels'][_0x2b8a33['uniqueid']]&&this[_0xc276('0x9')][_0x2b8a33['uniqueid']][_0x2b8a33[_0xc276('0x25')]]){logger[_0xc276('0x22')](_0xc276('0x50'),_0x2b8a33[_0xc276('0x23')],_0x2b8a33[_0xc276('0x24')],_0x2b8a33['destuniqueid']);this[_0xc276('0x9')][_0x2b8a33['uniqueid']][_0x2b8a33[_0xc276('0x25')]][_0xc276('0x12')]=!![];this[_0xc276('0x9')][_0x2b8a33[_0xc276('0x23')]][_0x2b8a33[_0xc276('0x25')]]['agentringnoanswerAt']=moment()[_0xc276('0x36')](_0xc276('0x28'));this['channels'][_0x2b8a33[_0xc276('0x23')]][_0x2b8a33['destuniqueid']][_0xc276('0x4a')]=_0xc276('0x51');this[_0xc276('0x9')][_0x2b8a33[_0xc276('0x23')]][_0x2b8a33[_0xc276('0x25')]][_0xc276('0x52')]=_0xc276('0x51');logger[_0xc276('0x26')](_0xc276('0x53'),_0x2b8a33[_0xc276('0x23')],util['inspect'](this[_0xc276('0x9')][_0x2b8a33[_0xc276('0x23')]][_0x2b8a33[_0xc276('0x25')]],{'showHidden':![],'depth':null}));ami['emit']('custom:agentringnoanswer',this[_0xc276('0x9')][_0x2b8a33[_0xc276('0x23')]][_0x2b8a33[_0xc276('0x25')]]);}}}catch(_0x1c2a15){logger[_0xc276('0x39')](_0xc276('0x54'),_0x2b8a33[_0xc276('0x23')],util[_0xc276('0x27')](_0x1c2a15,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xc276('0x55')]=function(_0x1161dc){try{if(this[_0xc276('0x21')](_0x1161dc)){logger['debug'](_0xc276('0x56'),_0x1161dc[_0xc276('0x23')],util[_0xc276('0x27')](_0x1161dc,{'showHidden':![],'depth':null}));if(this[_0xc276('0x9')][_0x1161dc[_0xc276('0x23')]]){for(var _0x4c42d9 in this['channels'][_0x1161dc[_0xc276('0x23')]]){if(this['channels'][_0x1161dc['uniqueid']][_0xc276('0x3b')](_0x4c42d9)&&!this[_0xc276('0x9')][_0x1161dc[_0xc276('0x23')]][_0x4c42d9][_0xc276('0x12')]&&!this[_0xc276('0x9')][_0x1161dc[_0xc276('0x23')]][_0x4c42d9][_0xc276('0x57')]){logger[_0xc276('0x22')]('[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x1161dc[_0xc276('0x23')],this[_0xc276('0x9')][_0x1161dc[_0xc276('0x23')]][_0x4c42d9]['membername'],_0x4c42d9);this[_0xc276('0x9')][_0x1161dc[_0xc276('0x23')]][_0x4c42d9]['agentringnoanswer']=!![];this[_0xc276('0x9')][_0x1161dc[_0xc276('0x23')]][_0x4c42d9][_0xc276('0x58')]=moment()[_0xc276('0x36')](_0xc276('0x28'));this[_0xc276('0x9')][_0x1161dc[_0xc276('0x23')]][_0x4c42d9][_0xc276('0x4a')]='abandoned';this[_0xc276('0x9')][_0x1161dc[_0xc276('0x23')]][_0x4c42d9][_0xc276('0x52')]=_0xc276('0x59');logger['debug'](_0xc276('0x5a'),_0x1161dc[_0xc276('0x23')],util[_0xc276('0x27')](this['channels'][_0x1161dc['uniqueid']][_0x4c42d9],{'showHidden':![],'depth':null}));ami[_0xc276('0x1f')](_0xc276('0x5b'),this[_0xc276('0x9')][_0x1161dc[_0xc276('0x23')]][_0x4c42d9]);}}}}}catch(_0x195d59){logger['error'](_0xc276('0x5c'),_0x1161dc[_0xc276('0x23')],util[_0xc276('0x27')](_0x195d59,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc276('0x1e')]['syncAgentComplete']=function(_0x1aa8fe){try{if(this[_0xc276('0x21')](_0x1aa8fe)){logger[_0xc276('0x26')](_0xc276('0x5d'),_0x1aa8fe[_0xc276('0x23')],util[_0xc276('0x27')](_0x1aa8fe,{'showHidden':![],'depth':null}));if(this[_0xc276('0x9')][_0x1aa8fe[_0xc276('0x23')]]){for(var _0x39fcae in this[_0xc276('0x9')][_0x1aa8fe[_0xc276('0x23')]]){if(this['channels'][_0x1aa8fe[_0xc276('0x23')]][_0xc276('0x3b')](_0x39fcae)){if(this[_0xc276('0x9')][_0x1aa8fe[_0xc276('0x23')]][_0x39fcae][_0xc276('0x3d')]&&!this['channels'][_0x1aa8fe[_0xc276('0x23')]][_0x39fcae]['agentcomplete']){logger[_0xc276('0x22')](_0xc276('0x5e'),_0x1aa8fe[_0xc276('0x23')],this[_0xc276('0x9')][_0x1aa8fe[_0xc276('0x23')]][_0x39fcae][_0xc276('0x24')],_0x39fcae);this[_0xc276('0x9')][_0x1aa8fe[_0xc276('0x23')]][_0x39fcae][_0xc276('0x57')]=!![];this[_0xc276('0x9')][_0x1aa8fe['uniqueid']][_0x39fcae][_0xc276('0x5f')]=moment()[_0xc276('0x36')](_0xc276('0x28'));this[_0xc276('0x9')][_0x1aa8fe[_0xc276('0x23')]][_0x39fcae]['lastevent']=_0xc276('0x60');this[_0xc276('0x9')][_0x1aa8fe[_0xc276('0x23')]][_0x39fcae]['reason']=_0x1aa8fe[_0xc276('0x52')]==_0xc276('0x61')?'agent':_0x1aa8fe[_0xc276('0x52')];this['channels'][_0x1aa8fe['uniqueid']][_0x39fcae][_0xc276('0x62')]=_0x1aa8fe[_0xc276('0x62')];if(this['voiceQueues'][_0x1aa8fe[_0xc276('0x2a')]]&&this[_0xc276('0xb')][_0x1aa8fe[_0xc276('0x2a')]][_0xc276('0x63')]){this[_0xc276('0x9')][_0x1aa8fe['uniqueid']][_0x39fcae][_0xc276('0x64')]=this[_0xc276('0xb')][_0x1aa8fe[_0xc276('0x2a')]][_0xc276('0x65')];this[_0xc276('0x9')][_0x1aa8fe[_0xc276('0x23')]][_0x39fcae][_0xc276('0x66')]=!![];}this['agents'][_0x1aa8fe['interface']]=_['omit'](this[_0xc276('0xc')][_0x1aa8fe['interface']],[_0xc276('0x2a'),_0xc276('0x45')]);logger[_0xc276('0x26')](_0xc276('0x67'),_0x1aa8fe[_0xc276('0x23')],util['inspect'](this[_0xc276('0x9')][_0x1aa8fe[_0xc276('0x23')]][_0x39fcae],{'showHidden':![],'depth':null}));ami[_0xc276('0x1f')](_0xc276('0x68'),this[_0xc276('0x9')][_0x1aa8fe[_0xc276('0x23')]][_0x39fcae]);logger['debug']('[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:',_0x1aa8fe[_0xc276('0x23')],util[_0xc276('0x27')]({'id':this[_0xc276('0xc')][_0x1aa8fe[_0xc276('0x35')]]['id'],'destaccountcode':_0x1aa8fe[_0xc276('0x69')]},{'showHidden':![],'depth':null}));this[_0xc276('0x1f')](util['format'](_0xc276('0x37'),_0x1aa8fe[_0xc276('0x24')]),_0xc276('0x6a'),{'id':this[_0xc276('0xc')][_0x1aa8fe[_0xc276('0x35')]]['id'],'destaccountcode':_0x1aa8fe['destaccountcode']});}}}}}}catch(_0x67f181){logger['error'](_0xc276('0x6b'),_0x1aa8fe['uniqueid'],util[_0xc276('0x27')](_0x67f181,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xc276('0x6c')]=function(_0x3e9048){try{if(this[_0xc276('0x21')](_0x3e9048)){logger['debug'](_0xc276('0x6d'),_0x3e9048[_0xc276('0x23')],util[_0xc276('0x27')](_0x3e9048,{'showHidden':![],'depth':null}));this[_0xc276('0x6e')](_0x3e9048['uniqueid'],_[_0xc276('0x6f')](_0x3e9048['variable'])[0x0],_0x3e9048[_0xc276('0x70')]);if(this[_0xc276('0x9')][_0x3e9048[_0xc276('0x23')]]){for(var _0x79e58f in this['channels'][_0x3e9048[_0xc276('0x23')]]){if(this['channels'][_0x3e9048['uniqueid']]['hasOwnProperty'](_0x79e58f)){logger[_0xc276('0x22')](_0xc276('0x71'),_0x3e9048[_0xc276('0x23')],_0x79e58f,_[_0xc276('0x6f')](_0x3e9048[_0xc276('0x72')])[0x0],_0x3e9048['value']);if(_['isUndefined'](this[_0xc276('0x9')][_0x3e9048[_0xc276('0x23')]][_0x79e58f][_0xc276('0xd')])){this[_0xc276('0x9')][_0x3e9048[_0xc276('0x23')]][_0x79e58f][_0xc276('0xd')]={};}this[_0xc276('0x9')][_0x3e9048[_0xc276('0x23')]][_0x79e58f]['variables']=this['variables'][_0x3e9048[_0xc276('0x23')]];}}}}}catch(_0x22f176){logger[_0xc276('0x39')](_0xc276('0x73'),_0x3e9048[_0xc276('0x23')],util[_0xc276('0x27')](_0x22f176,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xc276('0x6e')]=function(_0x4a9890,_0x21a412,_0x50a1a7){var _0x57ac88=[_0xc276('0x74'),'rtpaudioqosbridged',_0xc276('0x75'),_0xc276('0x76'),_0xc276('0x77'),'rtpaudioqoslossbridged',_0xc276('0x78'),'rtpaudioqosrttbridged',_0xc276('0x79'),_0xc276('0x7a'),_0xc276('0x7b'),_0xc276('0x7c'),_0xc276('0x7d'),_0xc276('0x7e'),_0xc276('0x7f'),_0xc276('0x80'),_0xc276('0x24'),'memberpenalty','memberrealtime'];if(!_[_0xc276('0x81')](_0x21a412)&&!_[_0xc276('0x82')](_0x57ac88,_0x21a412)){if(_['isUndefined'](this[_0xc276('0xd')][_0x4a9890])){this[_0xc276('0xd')][_0x4a9890]={};}this['variables'][_0x4a9890][_0x21a412]=_0x50a1a7;}};VoiceAgentReport[_0xc276('0x1e')][_0xc276('0x17')]=function(_0x385f58){try{if(this[_0xc276('0x21')](_0x385f58)){logger[_0xc276('0x26')](_0xc276('0x83'),_0x385f58[_0xc276('0x23')],util[_0xc276('0x27')](_0x385f58,{'showHidden':![],'depth':null}));if(this[_0xc276('0x9')][_0x385f58['uniqueid']]){for(var _0x52fe5f in this[_0xc276('0x9')][_0x385f58[_0xc276('0x23')]]){if(this[_0xc276('0x9')][_0x385f58['uniqueid']][_0xc276('0x3b')](_0x52fe5f)){if(this[_0xc276('0x9')][_0x385f58[_0xc276('0x23')]][_0x52fe5f][_0xc276('0x52')]==_0xc276('0x61')&&this[_0xc276('0x9')][_0x385f58[_0xc276('0x23')]][_0x52fe5f]['agentcomplete']){logger[_0xc276('0x22')](_0xc276('0x84'),_0x385f58[_0xc276('0x23')],_0x52fe5f);this['channels'][_0x385f58[_0xc276('0x23')]][_0x52fe5f][_0xc276('0x5f')]=moment()['format'](_0xc276('0x28'));}}}logger['debug'](_0xc276('0x85'),_0x385f58[_0xc276('0x23')],util[_0xc276('0x27')](_[_0xc276('0x86')](this['channels'][_0x385f58[_0xc276('0x23')]]),{'showHidden':![],'depth':null}));ami[_0xc276('0x1f')]('custom:voiceAgentReport',_[_0xc276('0x86')](this[_0xc276('0x9')][_0x385f58[_0xc276('0x23')]]));delete this['channels'][_0x385f58[_0xc276('0x23')]];}if(this[_0xc276('0xd')][_0x385f58[_0xc276('0x23')]]){delete this[_0xc276('0xd')][_0x385f58['uniqueid']];}}}catch(_0x8bb006){logger['error'](_0xc276('0x87'),_0x385f58[_0xc276('0x23')],util[_0xc276('0x27')](_0x8bb006,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc276('0x1e')][_0xc276('0x88')]=function(_0x290c40){try{if(this[_0xc276('0x21')](_0x290c40)){logger[_0xc276('0x26')](_0xc276('0x89'),_0x290c40[_0xc276('0x23')],util[_0xc276('0x27')](_0x290c40,{'showHidden':![],'depth':null}));if(this[_0xc276('0x9')][_0x290c40[_0xc276('0x8a')]]){for(var _0x51588a in this[_0xc276('0x9')][_0x290c40[_0xc276('0x8a')]]){if(this['channels'][_0x290c40[_0xc276('0x8a')]][_0xc276('0x3b')](_0x51588a)){if(_0x290c40[_0xc276('0x8b')]===_0x51588a){logger[_0xc276('0x22')](_0xc276('0x8c'),_0x290c40[_0xc276('0x23')],this[_0xc276('0x9')][_0x290c40[_0xc276('0x8a')]][_0x51588a][_0xc276('0x24')],_0x51588a);var _0x413b65=moment();this['channels'][_0x290c40['transfereeuniqueid']][_0x51588a]['agentcomplete']=!![];this[_0xc276('0x9')][_0x290c40[_0xc276('0x8a')]][_0x51588a][_0xc276('0x5f')]=moment()['format'](_0xc276('0x28'));this['channels'][_0x290c40[_0xc276('0x8a')]][_0x51588a]['lastevent']='complete';this[_0xc276('0x9')][_0x290c40[_0xc276('0x8a')]][_0x51588a][_0xc276('0x52')]=_0xc276('0x61');this[_0xc276('0x9')][_0x290c40[_0xc276('0x8a')]][_0x51588a]['talktime']=_0x413b65[_0xc276('0x8d')](this['channels'][_0x290c40[_0xc276('0x8a')]][_0x51588a][_0xc276('0x3d')],_0xc276('0x8e'));}}}}if(this[_0xc276('0x9')][_0x290c40['secondtransfereruniqueid']]){var _0x186836=this[_0xc276('0x9')][_0x290c40[_0xc276('0x8f')]];this[_0xc276('0x9')][_0x290c40[_0xc276('0x8f')]]=this['channels'][_0x290c40['transfereeuniqueid']];this[_0xc276('0x9')][_0x290c40[_0xc276('0x8a')]]=_0x186836;}}}catch(_0x274182){logger[_0xc276('0x39')](_0xc276('0x90'),_0x290c40[_0xc276('0x23')],util[_0xc276('0x27')](_0x274182,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc276('0x1e')][_0xc276('0x1d')]=function(_0x15bf85){try{if(this[_0xc276('0x21')](_0x15bf85)){logger[_0xc276('0x26')]('[%s][voiceAgentReport][blindtransfer]\x20event:',_0x15bf85[_0xc276('0x23')],util['inspect'](_0x15bf85,{'showHidden':![],'depth':null}));if(this[_0xc276('0x9')][_0x15bf85[_0xc276('0x8a')]]){for(var _0x4872db in this[_0xc276('0x9')][_0x15bf85[_0xc276('0x8a')]]){if(this[_0xc276('0x9')][_0x15bf85[_0xc276('0x8a')]]['hasOwnProperty'](_0x4872db)){if(_0x15bf85[_0xc276('0x91')]===_0x4872db){logger[_0xc276('0x22')]('[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x15bf85[_0xc276('0x23')],this[_0xc276('0x9')][_0x15bf85[_0xc276('0x8a')]][_0x4872db][_0xc276('0x24')],_0x4872db);var _0x480d38=moment();this[_0xc276('0x9')][_0x15bf85[_0xc276('0x8a')]][_0x4872db]['agentcomplete']=!![];this['channels'][_0x15bf85['transfereeuniqueid']][_0x4872db][_0xc276('0x5f')]=_0x480d38;this[_0xc276('0x9')][_0x15bf85['transfereeuniqueid']][_0x4872db][_0xc276('0x4a')]='complete';this[_0xc276('0x9')][_0x15bf85['transfereeuniqueid']][_0x4872db][_0xc276('0x52')]=_0xc276('0x61');this[_0xc276('0x9')][_0x15bf85[_0xc276('0x8a')]][_0x4872db][_0xc276('0x62')]=_0x480d38[_0xc276('0x8d')](this['channels'][_0x15bf85[_0xc276('0x8a')]][_0x4872db][_0xc276('0x3d')],_0xc276('0x8e'));}}}}}}catch(_0x1e5beb){logger['error']('[%s][voiceAgentReport][blindtransfer]',_0x15bf85[_0xc276('0x23')],util[_0xc276('0x27')](_0x1e5beb,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc276('0x1e')]['syncMusicOnHoldStart']=function(_0x5dffec){var _0x4a3c08='';try{if(this[_0xc276('0x21')](_0x5dffec)){logger[_0xc276('0x26')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x5dffec['uniqueid'],util[_0xc276('0x27')](_0x5dffec,{'showHidden':![],'depth':null}));if(_0x5dffec['channel']){_0x4a3c08=_0x5dffec[_0xc276('0x92')]['substring'](0x0,_0x5dffec[_0xc276('0x92')][_0xc276('0x93')]('-'));if(this[_0xc276('0xc')][_0x4a3c08]){logger[_0xc276('0x22')](_0xc276('0x94'),_0x5dffec[_0xc276('0x23')],_0x4a3c08);this[_0xc276('0xc')][_0x4a3c08][_0xc276('0x95')]=!![];}}}}catch(_0x3a7d06){logger[_0xc276('0x39')](_0xc276('0x96'),_0x5dffec[_0xc276('0x23')],util[_0xc276('0x27')](_0x3a7d06,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xc276('0x97')]=function(_0x34b336){var _0x315c11='';try{if(this[_0xc276('0x21')](_0x34b336)){logger[_0xc276('0x26')](_0xc276('0x98'),_0x34b336[_0xc276('0x23')],util[_0xc276('0x27')](_0x34b336,{'showHidden':![],'depth':null}));if(_0x34b336['channel']){_0x315c11=_0x34b336[_0xc276('0x92')]['substring'](0x0,_0x34b336['channel'][_0xc276('0x93')]('-'));if(this[_0xc276('0xc')][_0x315c11]){logger[_0xc276('0x22')](_0xc276('0x99'),_0x34b336[_0xc276('0x23')],_0x315c11);this[_0xc276('0xc')][_0x315c11]['onhold']=![];}}}}catch(_0x4418c6){logger[_0xc276('0x39')](_0xc276('0x9a'),_0x34b336[_0xc276('0x23')],util[_0xc276('0x27')](_0x4418c6,{'showHidden':![],'depth':null}));}};module[_0xc276('0x9b')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index a7f1604..73d6387 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 _0x3e74=['agents','blindTransfers','coreshowchannel','newexten','syncNewExten','bind','newchannel','newstate','syncNewState','hangup','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','prototype','isNotNull','isUndefined','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','[%s][voiceCallReport][newcallerid]\x20event:','inspect','linkedid','merge','pick','keys','context','from-sip','channel','split','xcally-motion-preview','format','user:%s','name','syncNewChannel','debug','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','exten','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','destconnectedlinenum','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','accountcode','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','startsWith','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','includes','lastapplication','cdr(','match','type','isNil','[%s][voiceCallReport][newstate]\x20event:','diff','connectedlinename','destinationchannel','UserId','answered','membername','user:agentconnect','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','.wav49','find','monitors','push','rec','[%s][voiceCallReport][mixMonitorFilename]','syncVarSet','[%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','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','sipcalllinkedid','[%s][voiceCallReport][varset]','answertime','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','holdtime','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','connectedlinenum','user:agentcomplete','transferType','resolve','undefined','isEmpty','then','stopRecordingOnTransfer','StopMixMonitor','catch','Action','finally','webbar:stopmonitors','BlindTransfer','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','origtransfereruniqueid','some','origtransfererlinkedid','routeid','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfereruniqueid','transfererchannel','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','lodash','util','path','ioredis','ami','../model/channel','../rpc/setting','set','queue','agi','playback','voicemail','NO\x20ANSWER','FAILED','BUSY','defaults','redis','socket.io-emitter','channels'];(function(_0x64c6e3,_0x3b5371){var _0x69c52f=function(_0x573d04){while(--_0x573d04){_0x64c6e3['push'](_0x64c6e3['shift']());}};_0x69c52f(++_0x3b5371);}(_0x3e74,0x175));var _0x43e7=function(_0x2635b4,_0x2ac9c2){_0x2635b4=_0x2635b4-0x0;var _0x3adb39=_0x3e74[_0x2635b4];return _0x3adb39;};'use strict';var _=require(_0x43e7('0x0'));var moment=require('moment');var util=require(_0x43e7('0x1'));var path=require(_0x43e7('0x2'));var Redis=require(_0x43e7('0x3'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x43e7('0x4'));var ami=require('../ami');var Channel=require(_0x43e7('0x5'));var RpcSetting=require(_0x43e7('0x6'));var applications=[_0x43e7('0x7'),_0x43e7('0x8'),_0x43e7('0x9'),'dial',_0x43e7('0xa'),_0x43e7('0xb')];var dispositions=[_0x43e7('0xc'),_0x43e7('0xd'),_0x43e7('0xd'),'NO\x20ANSWER',_0x43e7('0xc'),'NO\x20ANSWER','ANSWERED',_0x43e7('0xe'),_0x43e7('0xd'),'FAILED',_0x43e7('0xd')];config['redis']=_[_0x43e7('0xf')](config[_0x43e7('0x10')],{'host':'localhost','port':0x18eb});var io=require(_0x43e7('0x11'))(new Redis(config[_0x43e7('0x10')]));function VoiceCallReport(_0x2718d3){this[_0x43e7('0x12')]=_0x2718d3['channels'];this['agents']=_0x2718d3[_0x43e7('0x13')];this[_0x43e7('0x14')]={};ami['on'](_0x43e7('0x15'),this['syncNewExten']['bind'](this));ami['on'](_0x43e7('0x16'),this[_0x43e7('0x17')][_0x43e7('0x18')](this));ami['on'](_0x43e7('0x19'),this['syncNewChannel']['bind'](this));ami['on'](_0x43e7('0x1a'),this[_0x43e7('0x1b')][_0x43e7('0x18')](this));ami['on']('varset',this['syncVarSet'][_0x43e7('0x18')](this));ami['on'](_0x43e7('0x1c'),this[_0x43e7('0x1d')][_0x43e7('0x18')](this));ami['on'](_0x43e7('0x1e'),this[_0x43e7('0x1f')][_0x43e7('0x18')](this));ami['on'](_0x43e7('0x20'),this[_0x43e7('0x21')][_0x43e7('0x18')](this));ami['on'](_0x43e7('0x22'),this[_0x43e7('0x23')]['bind'](this));ami['on'](_0x43e7('0x24'),this[_0x43e7('0x25')]['bind'](this));ami['on'](_0x43e7('0x26'),this[_0x43e7('0x27')][_0x43e7('0x18')](this));try{logger[_0x43e7('0x28')](_0x43e7('0x29'));ami[_0x43e7('0x2a')]();}catch(_0x54a9e7){logger[_0x43e7('0x2b')]('[voiceCallReport][coreshowchannels]',util['inspect'](_0x54a9e7,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x43e7('0x2c')][_0x43e7('0x2d')]=function(_0x4b2b9f){return _0x4b2b9f!==null&&!_[_0x43e7('0x2e')](_0x4b2b9f);};VoiceCallReport['prototype'][_0x43e7('0x2f')]=function(_0x5c5e67,_0x1af208,_0x1b5f50){io['to'](_0x5c5e67)[_0x43e7('0x2f')](_0x1af208,_0x1b5f50);};VoiceCallReport[_0x43e7('0x2c')]['syncNewCallerId']=function(_0x52b7b3){try{if(this[_0x43e7('0x2d')](_0x52b7b3)){logger['info'](_0x43e7('0x30'),_0x52b7b3[_0x43e7('0x31')],_0x52b7b3[_0x43e7('0x32')],_0x52b7b3[_0x43e7('0x33')]);logger['debug'](_0x43e7('0x34'),_0x52b7b3[_0x43e7('0x31')],util[_0x43e7('0x35')](_0x52b7b3,{'showHidden':![],'depth':null}));if(_0x52b7b3[_0x43e7('0x31')]===_0x52b7b3[_0x43e7('0x36')]){if(!_[_0x43e7('0x2e')](this[_0x43e7('0x12')][_0x52b7b3[_0x43e7('0x31')]])){_[_0x43e7('0x37')](this[_0x43e7('0x12')][_0x52b7b3[_0x43e7('0x31')]],_[_0x43e7('0x38')](_0x52b7b3,_[_0x43e7('0x39')](this[_0x43e7('0x12')][_0x52b7b3['uniqueid']])));}}if(_0x52b7b3[_0x43e7('0x3a')]===_0x43e7('0x3b')){if(this[_0x43e7('0x13')][_0x52b7b3[_0x43e7('0x3c')][_0x43e7('0x3d')]('-')[0x0]]){if(_0x52b7b3['exten']==_0x43e7('0x3e')){this[_0x43e7('0x13')][_0x52b7b3[_0x43e7('0x3c')][_0x43e7('0x3d')]('-')[0x0]]['destconnectedlinenum']=_0x52b7b3['connectedlinenum'];this['emit'](util[_0x43e7('0x3f')](_0x43e7('0x40'),this[_0x43e7('0x13')][_0x52b7b3[_0x43e7('0x3c')][_0x43e7('0x3d')]('-')[0x0]][_0x43e7('0x41')]),'user:agentconnect',{'destaccountcode':this['agents'][_0x52b7b3['channel']['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x52b7b3['connectedlinenum']});}}}}}catch(_0x5cb753){logger[_0x43e7('0x2b')]('[%s][voiceCallReport][newcallerid]',_0x52b7b3[_0x43e7('0x31')],util[_0x43e7('0x35')](_0x5cb753,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x43e7('0x2c')][_0x43e7('0x42')]=function(_0x40f72f){try{if(this[_0x43e7('0x2d')](_0x40f72f)){logger[_0x43e7('0x43')]('[%s][voiceCallReport][newchannel]\x20event:',_0x40f72f['uniqueid'],util['inspect'](_0x40f72f,{'showHidden':![],'depth':null}));if(this[_0x43e7('0x12')][_0x40f72f[_0x43e7('0x31')]])return;if(_0x40f72f[_0x43e7('0x3c')]===_0x43e7('0x44'))return;if(_0x40f72f[_0x43e7('0x31')]!==_0x40f72f[_0x43e7('0x36')]&&!this[_0x43e7('0x14')][_0x40f72f[_0x43e7('0x36')]])return;logger['info'](_0x43e7('0x45'),_0x40f72f[_0x43e7('0x31')],_0x40f72f['context'],_0x40f72f[_0x43e7('0x46')]);this['channels'][_0x40f72f[_0x43e7('0x31')]]=new Channel();this[_0x43e7('0x12')][_0x40f72f[_0x43e7('0x31')]][_0x43e7('0x47')]=moment()[_0x43e7('0x3f')](_0x43e7('0x48'));this['channels'][_0x40f72f['uniqueid']][_0x43e7('0x49')]=dispositions[_[_0x43e7('0x4a')](_0x40f72f[_0x43e7('0x4b')])];_[_0x43e7('0x37')](this[_0x43e7('0x12')][_0x40f72f['uniqueid']],_[_0x43e7('0x38')](_0x40f72f,_[_0x43e7('0x39')](this['channels'][_0x40f72f[_0x43e7('0x31')]])));if(_0x40f72f['context']===_0x43e7('0x3b')){if(this['agents'][_0x40f72f[_0x43e7('0x3c')][_0x43e7('0x3d')]('-')[0x0]]){if(_[_0x43e7('0x2e')](this[_0x43e7('0x13')][_0x40f72f['channel']['split']('-')[0x0]][_0x43e7('0x4c')])){this[_0x43e7('0x13')][_0x40f72f[_0x43e7('0x3c')][_0x43e7('0x3d')]('-')[0x0]]['destconnectedlinenum']=_0x40f72f['exten'];logger['debug'](_0x43e7('0x4d'),_0x40f72f['uniqueid'],util[_0x43e7('0x35')]({'id':this['agents'][_0x40f72f['channel'][_0x43e7('0x3d')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x40f72f[_0x43e7('0x3c')][_0x43e7('0x3d')]('-')[0x0]][_0x43e7('0x4e')],'destconnectedlinenum':_0x40f72f[_0x43e7('0x46')]},{'showHidden':![],'depth':null}));this['emit'](util[_0x43e7('0x3f')](_0x43e7('0x40'),this[_0x43e7('0x13')][_0x40f72f[_0x43e7('0x3c')][_0x43e7('0x3d')]('-')[0x0]][_0x43e7('0x41')]),'user:agentconnect',{'id':this['agents'][_0x40f72f[_0x43e7('0x3c')][_0x43e7('0x3d')]('-')[0x0]]['id'],'destaccountcode':this[_0x43e7('0x13')][_0x40f72f['channel']['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x40f72f[_0x43e7('0x46')]});}}}}}catch(_0x42ed10){logger['error'](_0x43e7('0x4f'),_0x40f72f[_0x43e7('0x31')],util[_0x43e7('0x35')](_0x42ed10,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncNewExten']=function(_0x4ec263){try{if(this['isNotNull'](_0x4ec263)){logger[_0x43e7('0x43')](_0x43e7('0x50'),_0x4ec263['uniqueid'],util[_0x43e7('0x35')](_0x4ec263,{'showHidden':![],'depth':null}));if(_0x4ec263[_0x43e7('0x3c')]===_0x43e7('0x44')||_0x4ec263[_0x43e7('0x46')]==='h')return;if(_0x4ec263['uniqueid']===_0x4ec263[_0x43e7('0x36')]||this['blindTransfers'][_0x4ec263['linkedid']]){_0x4ec263[_0x43e7('0x51')]=_0x4ec263[_0x43e7('0x51')][_0x43e7('0x52')]();_0x4ec263[_0x43e7('0x53')]=_0x4ec263[_0x43e7('0x54')]||_0x4ec263[_0x43e7('0x53')];if(_0x4ec263[_0x43e7('0x54')]&&!_0x4ec263[_0x43e7('0x54')][_0x43e7('0x55')](_0x43e7('0x56'))&&_0x4ec263['application']!==_0x43e7('0x8')){_0x4ec263[_0x43e7('0x53')]=_0x4ec263['applicationdata'][_0x43e7('0x52')]();}logger['info'](_0x43e7('0x57'),_0x4ec263[_0x43e7('0x31')],_0x4ec263[_0x43e7('0x51')],_0x4ec263[_0x43e7('0x53')]);if(_[_0x43e7('0x2e')](this['channels'][_0x4ec263['uniqueid']])){this[_0x43e7('0x12')][_0x4ec263[_0x43e7('0x31')]]=new Channel();this[_0x43e7('0x12')][_0x4ec263[_0x43e7('0x31')]][_0x43e7('0x47')]=_0x4ec263[_0x43e7('0x58')]?moment()[_0x43e7('0x59')](moment[_0x43e7('0x58')](_0x4ec263[_0x43e7('0x58')])[_0x43e7('0x5a')](),_0x43e7('0x5a'))['format'](_0x43e7('0x48')):moment()[_0x43e7('0x3f')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x43e7('0x12')][_0x4ec263[_0x43e7('0x31')]][_0x43e7('0x49')]='NO\x20ANSWER';}_['merge'](this[_0x43e7('0x12')][_0x4ec263[_0x43e7('0x31')]],_['pick'](_0x4ec263,_[_0x43e7('0x39')](this['channels'][_0x4ec263['uniqueid']])));if(_[_0x43e7('0x5b')](applications,_0x4ec263[_0x43e7('0x51')])){this[_0x43e7('0x12')][_0x4ec263[_0x43e7('0x31')]][_0x43e7('0x5c')]=_0x4ec263['application'];this[_0x43e7('0x12')][_0x4ec263[_0x43e7('0x31')]]['lastdata']=_0x4ec263[_0x43e7('0x53')];if(_0x4ec263[_0x43e7('0x51')]===_0x43e7('0x7')&&_['startsWith'](_0x4ec263['applicationdata']['toLowerCase'](),_0x43e7('0x5d'))){var _0x4058ce=_0x4ec263[_0x43e7('0x53')][_0x43e7('0x3d')]('=');var _0x52ea9c=_0x4058ce[0x0]['toLowerCase']()[_0x43e7('0x5e')](/cdr\((.*)\)/);if(_0x52ea9c){if(_0x52ea9c[0x1]===_0x43e7('0x5f')&&!_[_0x43e7('0x60')](this[_0x43e7('0x12')][_0x4ec263['uniqueid']][_0x52ea9c[0x1]]))return;this[_0x43e7('0x12')][_0x4ec263[_0x43e7('0x31')]][_0x52ea9c[0x1]]=_0x4058ce[0x1];}}else if(_0x4ec263[_0x43e7('0x51')]===_0x43e7('0x8')){this[_0x43e7('0x12')][_0x4ec263[_0x43e7('0x31')]][_0x43e7('0x8')]=_0x4ec263[_0x43e7('0x53')][_0x43e7('0x3d')](',')[0x0];}}}}}catch(_0x381208){logger[_0x43e7('0x2b')]('[%s][voiceCallReport][newexten]',_0x4ec263['uniqueid'],util[_0x43e7('0x35')](_0x381208,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncNewState']=function(_0x50edb2){try{if(this[_0x43e7('0x2d')](_0x50edb2)){logger[_0x43e7('0x28')]('[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s',_0x50edb2[_0x43e7('0x31')],_0x50edb2[_0x43e7('0x36')],_0x50edb2[_0x43e7('0x32')],_0x50edb2['calleridnum']);logger[_0x43e7('0x43')](_0x43e7('0x61'),_0x50edb2[_0x43e7('0x31')],util[_0x43e7('0x35')](_0x50edb2,{'showHidden':![],'depth':null}));if(_0x50edb2[_0x43e7('0x4b')]!=='6')return;if(_0x50edb2[_0x43e7('0x31')]!==_0x50edb2[_0x43e7('0x36')]){var _0x515f01=moment();if(this[_0x43e7('0x12')][_0x50edb2[_0x43e7('0x36')]]){if(!this[_0x43e7('0x12')][_0x50edb2['linkedid']]['answered']){this[_0x43e7('0x12')][_0x50edb2['linkedid']]['answered']=!![];this[_0x43e7('0x12')][_0x50edb2[_0x43e7('0x36')]]['answertime']=_0x515f01[_0x43e7('0x3f')](_0x43e7('0x48'));if(this[_0x43e7('0x12')][_0x50edb2[_0x43e7('0x36')]][_0x43e7('0x47')]){this[_0x43e7('0x12')][_0x50edb2[_0x43e7('0x36')]]['holdtime']=_0x515f01[_0x43e7('0x62')](this[_0x43e7('0x12')][_0x50edb2['linkedid']][_0x43e7('0x47')],'seconds');}}this[_0x43e7('0x12')][_0x50edb2[_0x43e7('0x36')]][_0x43e7('0x36')]=_0x50edb2[_0x43e7('0x31')];if(_0x50edb2['calleridnum']!==_0x43e7('0x3e')){this[_0x43e7('0x12')][_0x50edb2[_0x43e7('0x36')]]['connectedlinenum']=_0x50edb2[_0x43e7('0x33')];}this[_0x43e7('0x12')][_0x50edb2[_0x43e7('0x36')]][_0x43e7('0x63')]=_0x50edb2[_0x43e7('0x32')];this['channels'][_0x50edb2[_0x43e7('0x36')]][_0x43e7('0x64')]=_0x50edb2[_0x43e7('0x3c')];this[_0x43e7('0x12')][_0x50edb2[_0x43e7('0x36')]][_0x43e7('0x49')]=dispositions[_[_0x43e7('0x4a')](_0x50edb2['channelstate'])];if(this['agents'][_0x50edb2[_0x43e7('0x3c')]['split']('-')[0x0]]){this['channels'][_0x50edb2['linkedid']][_0x43e7('0x65')]=this[_0x43e7('0x13')][_0x50edb2[_0x43e7('0x3c')][_0x43e7('0x3d')]('-')[0x0]]['id'];this[_0x43e7('0x12')][_0x50edb2[_0x43e7('0x36')]]['membername']=this[_0x43e7('0x13')][_0x50edb2[_0x43e7('0x3c')][_0x43e7('0x3d')]('-')[0x0]]['name'];}}if(this[_0x43e7('0x12')][_0x50edb2[_0x43e7('0x31')]]){if(!this[_0x43e7('0x12')][_0x50edb2[_0x43e7('0x31')]][_0x43e7('0x66')]){this[_0x43e7('0x12')][_0x50edb2[_0x43e7('0x31')]][_0x43e7('0x66')]=!![];this['channels'][_0x50edb2['uniqueid']]['answertime']=_0x515f01[_0x43e7('0x3f')](_0x43e7('0x48'));if(this['channels'][_0x50edb2[_0x43e7('0x31')]][_0x43e7('0x47')]){this[_0x43e7('0x12')][_0x50edb2[_0x43e7('0x31')]]['holdtime']=_0x515f01['diff'](this['channels'][_0x50edb2[_0x43e7('0x31')]][_0x43e7('0x47')],'seconds');}}if(_0x50edb2['calleridnum']!==_0x43e7('0x3e')){this[_0x43e7('0x12')][_0x50edb2[_0x43e7('0x31')]]['connectedlinenum']=_0x50edb2[_0x43e7('0x33')];}this[_0x43e7('0x12')][_0x50edb2[_0x43e7('0x31')]][_0x43e7('0x63')]=_0x50edb2['calleridname'];this[_0x43e7('0x12')][_0x50edb2['uniqueid']][_0x43e7('0x64')]=_0x50edb2[_0x43e7('0x3c')];this[_0x43e7('0x12')][_0x50edb2[_0x43e7('0x31')]][_0x43e7('0x49')]=dispositions[_[_0x43e7('0x4a')](_0x50edb2[_0x43e7('0x4b')])];}}else{if(this['channels'][_0x50edb2[_0x43e7('0x31')]]){if(this[_0x43e7('0x13')][_0x50edb2[_0x43e7('0x3c')][_0x43e7('0x3d')]('-')[0x0]]){this['channels'][_0x50edb2['uniqueid']]['UserId']=this[_0x43e7('0x13')][_0x50edb2['channel'][_0x43e7('0x3d')]('-')[0x0]]['id'];this[_0x43e7('0x12')][_0x50edb2[_0x43e7('0x31')]][_0x43e7('0x67')]=this[_0x43e7('0x13')][_0x50edb2[_0x43e7('0x3c')][_0x43e7('0x3d')]('-')[0x0]][_0x43e7('0x41')];}}}if(_0x50edb2[_0x43e7('0x3a')]===_0x43e7('0x3b')){if(this[_0x43e7('0x13')][_0x50edb2['channel'][_0x43e7('0x3d')]('-')[0x0]]){this[_0x43e7('0x13')][_0x50edb2[_0x43e7('0x3c')][_0x43e7('0x3d')]('-')[0x0]][_0x43e7('0x4c')]=_0x50edb2['exten'];var _0x5e04ec,_0x162a27;if(this[_0x43e7('0x12')][_0x50edb2['uniqueid']]){_0x5e04ec=this[_0x43e7('0x12')][_0x50edb2[_0x43e7('0x31')]]['routealias'];_0x162a27=this['channels'][_0x50edb2[_0x43e7('0x31')]][_0x43e7('0x8')];}else if(this[_0x43e7('0x12')][_0x50edb2[_0x43e7('0x36')]]){_0x5e04ec=this[_0x43e7('0x12')][_0x50edb2['linkedid']]['routealias'];_0x162a27=this[_0x43e7('0x12')][_0x50edb2[_0x43e7('0x36')]][_0x43e7('0x8')];}logger[_0x43e7('0x43')]('[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:',_0x50edb2[_0x43e7('0x31')],util[_0x43e7('0x35')]({'id':this[_0x43e7('0x13')][_0x50edb2[_0x43e7('0x3c')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0x43e7('0x13')][_0x50edb2[_0x43e7('0x3c')][_0x43e7('0x3d')]('-')[0x0]][_0x43e7('0x4e')],'destconnectedlinenum':_0x50edb2[_0x43e7('0x46')],'routealias':_0x5e04ec,'queue':_0x162a27||undefined},{'showHidden':![],'depth':null}));this['emit'](util[_0x43e7('0x3f')](_0x43e7('0x40'),this['agents'][_0x50edb2[_0x43e7('0x3c')][_0x43e7('0x3d')]('-')[0x0]][_0x43e7('0x41')]),_0x43e7('0x68'),{'id':this['agents'][_0x50edb2[_0x43e7('0x3c')]['split']('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this[_0x43e7('0x13')][_0x50edb2[_0x43e7('0x3c')][_0x43e7('0x3d')]('-')[0x0]][_0x43e7('0x4e')],'destconnectedlinenum':_0x50edb2[_0x43e7('0x46')],'routealias':_0x5e04ec,'queue':_0x162a27||undefined});}}}}catch(_0x25bf03){logger[_0x43e7('0x2b')](_0x43e7('0x69'),_0x50edb2[_0x43e7('0x31')],util['inspect'](_0x25bf03,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x43e7('0x2c')][_0x43e7('0x6a')]=function(_0x376256,_0x438f41){try{if(this['channels'][_0x376256]){logger['info'](_0x43e7('0x6b'),_0x376256,_0x438f41);this[_0x43e7('0x12')][_0x376256][_0x43e7('0x6c')]=!![];if(_['endsWith'](_0x438f41,_0x43e7('0x6d'))){_0x438f41=_0x438f41['replace']('.wav49','.WAV');}this[_0x43e7('0x12')][_0x376256]['monitorFilename']=_0x438f41;var _0x28f15e=_[_0x43e7('0x6e')](this[_0x43e7('0x12')][_0x376256][_0x43e7('0x6f')],{'filename':_0x438f41});if(_[_0x43e7('0x60')](_0x28f15e)){this['channels'][_0x376256]['monitors'][_0x43e7('0x70')]({'filename':_0x438f41,'createdAt':moment()[_0x43e7('0x3f')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0x43e7('0x71')});}}}catch(_0x10fd28){logger[_0x43e7('0x2b')](_0x43e7('0x72'),_0x376256,util[_0x43e7('0x35')](_0x10fd28,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x43e7('0x2c')][_0x43e7('0x73')]=function(_0x32e698){try{if(this[_0x43e7('0x2d')](_0x32e698)){logger[_0x43e7('0x43')](_0x43e7('0x74'),_0x32e698[_0x43e7('0x31')],util[_0x43e7('0x35')](_0x32e698,{'showHidden':![],'depth':null}));if(this[_0x43e7('0x12')][_0x32e698[_0x43e7('0x31')]]&&_0x32e698[_0x43e7('0x3c')]!=_0x43e7('0x44')){if(this[_0x43e7('0x2d')](_0x32e698[_0x43e7('0x75')])){if(this[_0x43e7('0x2d')](_0x32e698[_0x43e7('0x75')][_0x43e7('0x76')])){logger['info'](_0x43e7('0x77'),_0x32e698[_0x43e7('0x31')],_0x32e698[_0x43e7('0x78')]);this[_0x43e7('0x6a')](_0x32e698['uniqueid'],_0x32e698[_0x43e7('0x78')]);}else if(this['isNotNull'](_0x32e698[_0x43e7('0x75')][_0x43e7('0x79')])){logger[_0x43e7('0x28')](_0x43e7('0x7a'),_0x32e698[_0x43e7('0x31')],_0x32e698[_0x43e7('0x78')]);this['channels'][_0x32e698[_0x43e7('0x31')]][_0x43e7('0x33')]=_0x32e698[_0x43e7('0x78')];}else if(this[_0x43e7('0x2d')](_0x32e698[_0x43e7('0x75')]['xmd-callerid'])){logger['info'](_0x43e7('0x7b'),_0x32e698['uniqueid'],_0x32e698[_0x43e7('0x78')]);this[_0x43e7('0x12')][_0x32e698[_0x43e7('0x31')]][_0x43e7('0x7c')]=_0x32e698['value'];}else if(this['isNotNull'](_0x32e698['variable'][_0x43e7('0x7d')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x32e698['uniqueid'],_0x32e698[_0x43e7('0x78')]);this[_0x43e7('0x12')][_0x32e698['uniqueid']][_0x43e7('0x5f')]=_0x32e698['value'];}else if(this[_0x43e7('0x2d')](_0x32e698[_0x43e7('0x75')][_0x43e7('0x7e')])){logger[_0x43e7('0x28')](_0x43e7('0x7f'),_0x32e698['uniqueid'],_0x32e698[_0x43e7('0x78')][_0x43e7('0x3d')](',')[0x0]);this[_0x43e7('0x12')][_0x32e698['uniqueid']]['queue']=_0x32e698[_0x43e7('0x78')][_0x43e7('0x3d')](',')[0x0];}else if(this[_0x43e7('0x2d')](_0x32e698[_0x43e7('0x75')]['xmd-originatecalleridnum'])){logger[_0x43e7('0x28')](_0x43e7('0x80'),_0x32e698[_0x43e7('0x31')],_0x32e698['value']);this[_0x43e7('0x12')][_0x32e698[_0x43e7('0x31')]][_0x43e7('0x81')]=_0x32e698[_0x43e7('0x78')];}else if(this['isNotNull'](_0x32e698[_0x43e7('0x75')]['xmd-destination'])){logger[_0x43e7('0x28')](_0x43e7('0x82'),_0x32e698['uniqueid'],_0x32e698['value']);this[_0x43e7('0x12')][_0x32e698[_0x43e7('0x31')]][_0x43e7('0x83')]=_0x32e698[_0x43e7('0x78')];}else if(this[_0x43e7('0x2d')](_0x32e698[_0x43e7('0x75')][_0x43e7('0x84')])){logger[_0x43e7('0x28')](_0x43e7('0x85'),_0x32e698[_0x43e7('0x31')],_0x32e698[_0x43e7('0x78')]);this['channels'][_0x32e698[_0x43e7('0x31')]]['calleridpreview']=_0x32e698[_0x43e7('0x78')];}else if(this[_0x43e7('0x2d')](_0x32e698[_0x43e7('0x75')]['xmcs-queue'])){logger[_0x43e7('0x28')](_0x43e7('0x86'),_0x32e698[_0x43e7('0x31')],_0x32e698[_0x43e7('0x78')]);this['channels'][_0x32e698[_0x43e7('0x31')]][_0x43e7('0x8')]=_0x32e698['value'];}else if(this['isNotNull'](_0x32e698['variable'][_0x43e7('0x87')])){logger[_0x43e7('0x28')](_0x43e7('0x88'),_0x32e698[_0x43e7('0x31')],_0x32e698[_0x43e7('0x78')]);this[_0x43e7('0x12')][_0x32e698[_0x43e7('0x31')]][_0x43e7('0x89')]=_0x32e698['value'];}}}else if(this[_0x43e7('0x2d')](_0x32e698[_0x43e7('0x75')][_0x43e7('0x76')])){if(_0x32e698[_0x43e7('0x78')]){var _0x4e4f4e=path['parse'](_0x32e698[_0x43e7('0x78')])[_0x43e7('0x41')];logger[_0x43e7('0x28')](_0x43e7('0x77'),_0x4e4f4e,_0x32e698['value']);this[_0x43e7('0x6a')](_0x4e4f4e,_0x32e698[_0x43e7('0x78')]);}}else if(this[_0x43e7('0x12')][_0x32e698[_0x43e7('0x36')]]){if(this[_0x43e7('0x2d')](_0x32e698[_0x43e7('0x75')])){if(this['isNotNull'](_0x32e698[_0x43e7('0x75')]['sipcallid'])){logger['info'](_0x43e7('0x88'),_0x32e698[_0x43e7('0x36')],_0x32e698['value']);this['channels'][_0x32e698[_0x43e7('0x36')]][_0x43e7('0x8a')]=_0x32e698['value'];}}}}}catch(_0x189c38){logger[_0x43e7('0x2b')](_0x43e7('0x8b'),_0x32e698[_0x43e7('0x31')],util['inspect'](_0x189c38,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x43e7('0x1d')]=function(_0x31354e){try{if(this[_0x43e7('0x2d')](_0x31354e)){logger['debug']('[%s][voiceCallReport][hangup]\x20event:',_0x31354e[_0x43e7('0x31')],util[_0x43e7('0x35')](_0x31354e,{'showHidden':![],'depth':null}));if(this[_0x43e7('0x14')][_0x31354e[_0x43e7('0x36')]]){if(this[_0x43e7('0x12')][this[_0x43e7('0x14')][_0x31354e[_0x43e7('0x36')]][_0x43e7('0x36')]]){this['channels'][this['blindTransfers'][_0x31354e['linkedid']][_0x43e7('0x36')]]['uniqueid']=_0x31354e[_0x43e7('0x31')];this[_0x43e7('0x12')][this[_0x43e7('0x14')][_0x31354e[_0x43e7('0x36')]][_0x43e7('0x36')]]['answered']=this[_0x43e7('0x12')][_0x31354e[_0x43e7('0x31')]][_0x43e7('0x66')];this[_0x43e7('0x12')][this['blindTransfers'][_0x31354e[_0x43e7('0x36')]][_0x43e7('0x36')]][_0x43e7('0x8c')]=this[_0x43e7('0x12')][_0x31354e[_0x43e7('0x31')]][_0x43e7('0x8c')];this[_0x43e7('0x12')][this['blindTransfers'][_0x31354e[_0x43e7('0x36')]][_0x43e7('0x36')]][_0x43e7('0x64')]=this[_0x43e7('0x12')][this[_0x43e7('0x14')][_0x31354e['linkedid']][_0x43e7('0x36')]][_0x43e7('0x3c')];this['channels'][this[_0x43e7('0x14')][_0x31354e[_0x43e7('0x36')]]['linkedid']][_0x43e7('0x49')]=this[_0x43e7('0x12')][_0x31354e[_0x43e7('0x31')]][_0x43e7('0x49')];this[_0x43e7('0x12')][_0x31354e['uniqueid']]=this[_0x43e7('0x12')][this[_0x43e7('0x14')][_0x31354e[_0x43e7('0x36')]]['linkedid']];delete this[_0x43e7('0x12')][this[_0x43e7('0x14')][_0x31354e['linkedid']][_0x43e7('0x36')]];}else if(this[_0x43e7('0x12')][this[_0x43e7('0x14')][_0x31354e[_0x43e7('0x36')]][_0x43e7('0x31')]]){this[_0x43e7('0x12')][this['blindTransfers'][_0x31354e[_0x43e7('0x36')]][_0x43e7('0x31')]][_0x43e7('0x31')]=[this['channels'][this[_0x43e7('0x14')][_0x31354e[_0x43e7('0x36')]][_0x43e7('0x31')]][_0x43e7('0x36')],this[_0x43e7('0x12')][this[_0x43e7('0x14')][_0x31354e[_0x43e7('0x36')]][_0x43e7('0x31')]][_0x43e7('0x36')]=this['channels'][this[_0x43e7('0x14')][_0x31354e[_0x43e7('0x36')]][_0x43e7('0x31')]][_0x43e7('0x31')]][0x0];this[_0x43e7('0x12')][this[_0x43e7('0x14')][_0x31354e[_0x43e7('0x36')]][_0x43e7('0x31')]]['answered']=this[_0x43e7('0x12')][_0x31354e[_0x43e7('0x31')]][_0x43e7('0x66')];this[_0x43e7('0x12')][this[_0x43e7('0x14')][_0x31354e['linkedid']][_0x43e7('0x31')]][_0x43e7('0x8c')]=this[_0x43e7('0x12')][_0x31354e[_0x43e7('0x31')]][_0x43e7('0x8c')];this['channels'][this[_0x43e7('0x14')][_0x31354e['linkedid']][_0x43e7('0x31')]][_0x43e7('0x64')]=this[_0x43e7('0x12')][this[_0x43e7('0x14')][_0x31354e['linkedid']][_0x43e7('0x31')]][_0x43e7('0x3c')];this[_0x43e7('0x12')][this[_0x43e7('0x14')][_0x31354e[_0x43e7('0x36')]][_0x43e7('0x31')]][_0x43e7('0x49')]=this[_0x43e7('0x12')][_0x31354e[_0x43e7('0x31')]][_0x43e7('0x49')];this[_0x43e7('0x12')][_0x31354e['uniqueid']]=this['channels'][this[_0x43e7('0x14')][_0x31354e['linkedid']]['uniqueid']];delete this[_0x43e7('0x12')][this[_0x43e7('0x14')][_0x31354e['linkedid']][_0x43e7('0x31')]];}}if(this['channels'][_0x31354e['uniqueid']]){logger['info'](_0x43e7('0x8d'),_0x31354e[_0x43e7('0x31')],_0x31354e[_0x43e7('0x8e')]);var _0xd6ebb0=moment();this[_0x43e7('0x12')][_0x31354e[_0x43e7('0x31')]][_0x43e7('0x8f')]=_0xd6ebb0[_0x43e7('0x3f')](_0x43e7('0x48'));this[_0x43e7('0x12')][_0x31354e[_0x43e7('0x31')]][_0x43e7('0x58')]=_0xd6ebb0[_0x43e7('0x62')](this[_0x43e7('0x12')][_0x31354e[_0x43e7('0x31')]][_0x43e7('0x47')],_0x43e7('0x5a'));if(this[_0x43e7('0x12')][_0x31354e[_0x43e7('0x31')]][_0x43e7('0x66')]){this['channels'][_0x31354e[_0x43e7('0x31')]][_0x43e7('0x90')]=_0xd6ebb0['diff'](this[_0x43e7('0x12')][_0x31354e[_0x43e7('0x31')]][_0x43e7('0x8c')],_0x43e7('0x5a'));this['channels'][_0x31354e[_0x43e7('0x31')]][_0x43e7('0x91')]=this['channels'][_0x31354e[_0x43e7('0x31')]][_0x43e7('0x58')]-this[_0x43e7('0x12')][_0x31354e['uniqueid']][_0x43e7('0x90')];}if(_0x31354e[_0x43e7('0x3a')]===_0x43e7('0x3b')){if(this[_0x43e7('0x13')][_0x31354e[_0x43e7('0x3c')]['split']('-')[0x0]]){this[_0x43e7('0x13')][_0x31354e[_0x43e7('0x3c')]['split']('-')[0x0]]=_[_0x43e7('0x92')](this['agents'][_0x31354e['channel']['split']('-')[0x0]],['destconnectedlinenum']);logger[_0x43e7('0x43')](_0x43e7('0x93'),_0x31354e[_0x43e7('0x31')],util[_0x43e7('0x35')]({'id':this['agents'][_0x31354e['channel'][_0x43e7('0x3d')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x31354e[_0x43e7('0x3c')]['split']('-')[0x0]][_0x43e7('0x4e')]},{'showHidden':![],'depth':null}));this['emit'](util['format']('user:%s',this['agents'][_0x31354e[_0x43e7('0x3c')][_0x43e7('0x3d')]('-')[0x0]][_0x43e7('0x41')]),'user:agentcomplete',{'id':this[_0x43e7('0x13')][_0x31354e[_0x43e7('0x3c')][_0x43e7('0x3d')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x31354e[_0x43e7('0x3c')][_0x43e7('0x3d')]('-')[0x0]][_0x43e7('0x4e')]});for(var _0x265125=0x0;_0x2651250x0?_0xcae264:0x0;this[_0x415c('0x11')][_0x199d88[_0x415c('0x64')]][_0x415c('0x2f')]=this[_0x415c('0x11')][_0x199d88[_0x415c('0x64')]]['talking']>_[_0x415c('0x68')](_0x199d88[_0x415c('0x69')])?_['toNumber'](_0x199d88[_0x415c('0x69')]):this[_0x415c('0x11')][_0x199d88[_0x415c('0x64')]][_0x415c('0x2f')];this[_0x415c('0x6a')](this[_0x415c('0x11')][_0x199d88['queue']],_0x415c('0x15'));}logger['debug'](_0x415c('0x6b'),util[_0x415c('0x3b')](this[_0x415c('0x11')][_0x199d88[_0x415c('0x64')]],{'showHidden':![],'depth':null}));ami[_0x415c('0x43')](_0x415c('0x6c'),this[_0x415c('0x11')][_0x199d88[_0x415c('0x64')]]);}}}catch(_0x4b3142){logger[_0x415c('0x39')]('[voiceQueueReport][queuesummary]',util['inspect'](_0x4b3142,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x415c('0xa')][_0x415c('0x18')]=function(_0x469b22){logger['debug'](_0x415c('0x6d'),util[_0x415c('0x3b')](_0x469b22,{'showHidden':![],'depth':null}));ami[_0x415c('0x43')](_0x415c('0x6e'),{});this[_0x415c('0x12')]=!![];};VoiceQueueReport[_0x415c('0xa')][_0x415c('0x1a')]=function(_0x33ca6e){try{if(this[_0x415c('0x60')](_0x33ca6e)){logger[_0x415c('0x4c')](_0x415c('0x6f'),_0x33ca6e[_0x415c('0x47')],util[_0x415c('0x3b')](_0x33ca6e,{'showHidden':![],'depth':null}));if(_[_0x415c('0x70')](this[_0x415c('0x40')][_0x33ca6e[_0x415c('0x47')]]))this[_0x415c('0x40')][_0x33ca6e[_0x415c('0x47')]]=[];if(_[_0x415c('0x70')](this['channels'][_0x33ca6e['uniqueid']]))this[_0x415c('0xf')][_0x33ca6e[_0x415c('0x47')]]={};var _0x2e8a59=new QueueReport();_0x2e8a59[_0x415c('0x4a')]=_0x33ca6e[_0x415c('0x64')];_0x2e8a59['type']=this[_0x415c('0x11')][_0x2e8a59['name']]&&this[_0x415c('0x11')][_0x2e8a59[_0x415c('0x4a')]]['type']?this['voiceQueues'][_0x2e8a59[_0x415c('0x4a')]][_0x415c('0x51')]||_0x415c('0x52'):_0x415c('0x52');_0x2e8a59[_0x415c('0x64')]=_0x33ca6e[_0x415c('0x64')];_0x2e8a59[_0x415c('0x71')]=moment()[_0x415c('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x2e8a59[_0x415c('0x72')]=_0x33ca6e[_0x415c('0x72')];_0x2e8a59[_0x415c('0x73')]=_0x33ca6e['count'];_0x2e8a59[_0x415c('0x47')]=_0x33ca6e['uniqueid'];_0x2e8a59[_0x415c('0x74')]=this[_0x415c('0xf')][_0x33ca6e['uniqueid']][_0x415c('0x74')];logger[_0x415c('0x65')](_0x415c('0x75'),_0x2e8a59[_0x415c('0x4a')],_0x2e8a59[_0x415c('0x51')]);_[_0x415c('0x76')](_0x2e8a59,_['pick'](_0x33ca6e,_[_0x415c('0x77')](_0x2e8a59)));this['queueReports'][_0x33ca6e[_0x415c('0x47')]][_0x415c('0x78')](_0x2e8a59);this[_0x415c('0xf')][_0x33ca6e[_0x415c('0x47')]]=_0x2e8a59;this['emitVoiceQueueChannelSave'](_0x2e8a59,'queuecallerjoin');}}catch(_0x36bcb5){logger['error']('[%s][voiceQueueReport][queuecallerjoin]',_0x33ca6e[_0x415c('0x47')],util[_0x415c('0x3b')](_0x36bcb5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x415c('0xa')][_0x415c('0x1c')]=function(_0x4f2a04){try{if(this[_0x415c('0x60')](_0x4f2a04)){logger[_0x415c('0x4c')](_0x415c('0x79'),_0x4f2a04[_0x415c('0x47')],util[_0x415c('0x3b')](_0x4f2a04,{'showHidden':![],'depth':null}));if(this[_0x415c('0x40')][_0x4f2a04['uniqueid']]){var _0x1a53b2=_[_0x415c('0x7a')](this['queueReports'][_0x4f2a04['uniqueid']]);_0x1a53b2['queuecallercomplete']=![];_0x1a53b2['queuecallercompleteAt']=null;_0x1a53b2[_0x415c('0x7b')]=_0x4f2a04[_0x415c('0x7b')];_0x1a53b2[_0x415c('0x7c')]=_0x4f2a04[_0x415c('0x7c')];_0x1a53b2[_0x415c('0x1b')]=!![];_0x1a53b2[_0x415c('0x7d')]=moment()[_0x415c('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x1a53b2['queuecallerexitreason']='ABANDONED';_0x1a53b2[_0x415c('0x7e')]=null;logger[_0x415c('0x65')](_0x415c('0x7f'),_0x1a53b2[_0x415c('0x4a')],_0x1a53b2[_0x415c('0x51')]);this[_0x415c('0xf')][_0x4f2a04[_0x415c('0x47')]]=_0x1a53b2;this[_0x415c('0x41')](_0x1a53b2,'queuecallerabandon');}}}catch(_0x1dfd9a){logger[_0x415c('0x39')](_0x415c('0x79'),_0x4f2a04[_0x415c('0x47')],util[_0x415c('0x3b')](_0x1dfd9a,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x415c('0x80')]=function(_0x32df2d){try{if(this[_0x415c('0x60')](_0x32df2d)){logger[_0x415c('0x4c')](_0x415c('0x81'),_0x32df2d[_0x415c('0x47')],util[_0x415c('0x3b')](_0x32df2d,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x32df2d[_0x415c('0x47')]]){var _0x50282d=_[_0x415c('0x7a')](this[_0x415c('0x40')][_0x32df2d[_0x415c('0x47')]]);_0x50282d['queuecallerleaveAt']=moment()['format'](_0x415c('0x82'));_0x50282d['connectedlinenum']=_0x32df2d['connectedlinenum'];_0x50282d[_0x415c('0x83')]=_0x32df2d['connectedlinename'];logger[_0x415c('0x65')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x50282d['name'],_0x50282d['type'],_0x32df2d[_0x415c('0x84')],_0x32df2d[_0x415c('0x83')]);this[_0x415c('0xf')][_0x32df2d[_0x415c('0x47')]]=_0x50282d;this['emitVoiceQueueChannelSave'](_0x50282d,'queuecallerleave');}}}catch(_0x58d94a){logger[_0x415c('0x39')]('[%s][voiceQueueReport][queuecallerleave]',_0x32df2d[_0x415c('0x47')],util[_0x415c('0x3b')](_0x58d94a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x415c('0xa')][_0x415c('0x85')]=function(_0x31be60){try{if(this[_0x415c('0x60')](_0x31be60)){logger[_0x415c('0x4c')](_0x415c('0x86'),_0x31be60[_0x415c('0x47')],util[_0x415c('0x3b')](_0x31be60,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x31be60['uniqueid']]){var _0x38a33d=_[_0x415c('0x7a')](this[_0x415c('0x40')][_0x31be60[_0x415c('0x47')]]);_0x38a33d[_0x415c('0x87')]=!![];_0x38a33d[_0x415c('0x88')]=_0x415c('0x89');logger[_0x415c('0x65')](_0x415c('0x8a'),_0x38a33d['name'],_0x38a33d['type']);}}}catch(_0x13074f){logger[_0x415c('0x39')]('[%s][voiceQueueReport][agentconnect]',_0x31be60['uniqueid'],util[_0x415c('0x3b')](_0x13074f,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x415c('0x8b')]=function(_0x24cc52){try{if(this['isNotNull'](_0x24cc52)){logger[_0x415c('0x4c')](_0x415c('0x8c'),_0x24cc52[_0x415c('0x47')],util[_0x415c('0x3b')](_0x24cc52,{'showHidden':![],'depth':null}));if(this[_0x415c('0x40')][_0x24cc52[_0x415c('0x47')]]){var _0x53e170=_[_0x415c('0x7a')](this[_0x415c('0x40')][_0x24cc52['uniqueid']]);_0x53e170[_0x415c('0x1b')]=![];_0x53e170[_0x415c('0x7d')]=null;_0x53e170[_0x415c('0x8d')]=!![];_0x53e170['lastAssignedTo']=_0x24cc52[_0x415c('0x8e')];_0x53e170['holdtime']=_0x24cc52[_0x415c('0x7b')];_0x53e170['queuecallercomplete']=!![];_0x53e170[_0x415c('0x8f')]=![];_0x53e170[_0x415c('0x90')]=null;if(!_0x53e170[_0x415c('0x91')]){if(_0x24cc52[_0x415c('0x92')]==_0x415c('0x91')){_0x53e170[_0x415c('0x88')]=_0x415c('0x93');logger[_0x415c('0x65')](_0x415c('0x94'),_0x53e170[_0x415c('0x4a')],_0x53e170['type']);}else{if(_[_0x415c('0x95')](_0x24cc52[_0x415c('0x35')][_0x415c('0x96')](),_0x415c('0x97'))){if(this['queueReports'][_0x24cc52[_0x415c('0x98')]]){var _0x778e82=_[_0x415c('0x7a')](this['queueReports'][_0x24cc52[_0x415c('0x98')]]);_0x778e82['queuecallercomplete']=![];_0x778e82['queuecallerexit']=!![];_0x778e82[_0x415c('0x90')]=moment(_0x53e170[_0x415c('0x71')])['add'](_0x24cc52[_0x415c('0x7b')],_0x415c('0x99'))[_0x415c('0x48')](_0x415c('0x82'));_0x778e82[_0x415c('0x88')]='FORWARDTRANSFER';_0x778e82[_0x415c('0x91')]=!![];_0x778e82[_0x415c('0x9a')]=_0x415c('0x9b');_0x778e82[_0x415c('0x9c')]=_0x24cc52['destexten'];_0x778e82['transferuniqueid']=_0x24cc52[_0x415c('0x47')];logger[_0x415c('0x65')](_0x415c('0x9d'),_0x778e82[_0x415c('0x4a')],_0x778e82[_0x415c('0x51')]);var _0x594ee4=this[_0x415c('0x40')][_0x24cc52[_0x415c('0x98')]];this['queueReports'][_0x24cc52[_0x415c('0x98')]]=this[_0x415c('0x40')][_0x24cc52[_0x415c('0x47')]];this[_0x415c('0x40')][_0x24cc52[_0x415c('0x47')]]=_0x594ee4;}}else{_0x53e170[_0x415c('0x88')]='COMPLETEDBY'+_0x24cc52[_0x415c('0x92')][_0x415c('0x9e')]();logger[_0x415c('0x65')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x53e170['name'],_0x53e170['type'],_0x53e170['queuecallerexitreason']);}}}this[_0x415c('0xf')][_0x24cc52['uniqueid']]=_0x53e170;this['emitVoiceQueueChannelRemove'](_0x53e170,_0x415c('0x1e'));}}}catch(_0x1c266c){logger[_0x415c('0x39')](_0x415c('0x8c'),_0x24cc52['uniqueid'],util[_0x415c('0x3b')](_0x1c266c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x415c('0xa')][_0x415c('0x20')]=function(_0x486b5a){try{if(this['isNotNull'](_0x486b5a)){logger['debug'](_0x415c('0x9f'),_0x486b5a[_0x415c('0x47')],util[_0x415c('0x3b')](_0x486b5a,{'showHidden':![],'depth':null}));this[_0x415c('0xa0')](_0x486b5a[_0x415c('0x47')],_[_0x415c('0x77')](_0x486b5a[_0x415c('0xa1')])[0x0],_0x486b5a[_0x415c('0xa2')]);if(this[_0x415c('0x40')][_0x486b5a[_0x415c('0x47')]]){var _0x382629=_['last'](this[_0x415c('0x40')][_0x486b5a[_0x415c('0x47')]]);if(_0x382629){if(this[_0x415c('0x60')](_0x486b5a['variable'])&&this[_0x415c('0x60')](_0x486b5a[_0x415c('0xa1')][_0x415c('0xa3')])){switch(_0x486b5a['value']){case _0x415c('0xa4'):_0x382629[_0x415c('0x8f')]=![];_0x382629['queuecallerexitAt']=null;break;case _0x415c('0xa5'):_0x382629[_0x415c('0xa6')]='timeout';_0x382629[_0x415c('0x8f')]=!![];_0x382629['queuecallerexitAt']=moment()[_0x415c('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x382629[_0x415c('0xa7')]=moment()[_0x415c('0x48')](_0x415c('0x82'));logger['debug'](_0x415c('0xa8'),_0x486b5a[_0x415c('0x47')],util[_0x415c('0x3b')](_0x382629,{'showHidden':![],'depth':null}));ami[_0x415c('0x43')]('custom:timeout',_0x382629);break;default:_0x382629[_0x415c('0x8f')]=!![];_0x382629[_0x415c('0x90')]=moment()['format'](_0x415c('0x82'));_0x382629['queuecallerleaveAt']=moment()['format'](_0x415c('0x82'));}_0x382629[_0x415c('0x1b')]=![];_0x382629[_0x415c('0x7d')]=null;_0x382629[_0x415c('0x88')]=_0x486b5a[_0x415c('0xa2')];this[_0x415c('0xf')][_0x486b5a['uniqueid']]=_0x382629;this[_0x415c('0x41')](_0x382629,_0x415c('0x1f'));}else if(this['isNotNull'](_0x486b5a[_0x415c('0xa1')])&&this['isNotNull'](_0x486b5a[_0x415c('0xa1')][_0x415c('0xa9')])){if(!_0x382629[_0x415c('0x1b')]){_0x382629[_0x415c('0x8f')]=!![];_0x382629['queuecallerexitAt']=moment()[_0x415c('0x48')](_0x415c('0x82'));_0x382629[_0x415c('0x88')]='EXITWITHKEY';_0x382629[_0x415c('0xa7')]=moment()[_0x415c('0x48')](_0x415c('0x82'));this[_0x415c('0xf')][_0x486b5a['uniqueid']]=_0x382629;}}logger[_0x415c('0x65')](_0x415c('0xaa'),_0x486b5a[_0x415c('0x47')],_0x382629['name'],_0x382629[_0x415c('0x51')],_[_0x415c('0x77')](_0x486b5a[_0x415c('0xa1')])[0x0],_0x486b5a[_0x415c('0xa2')]);_0x382629[_0x415c('0x14')]=this['variables'][_0x486b5a['uniqueid']];}}}}catch(_0x5114f9){logger[_0x415c('0x39')]('[%s][voiceQueueReport][varset]',_0x486b5a['uniqueid'],util[_0x415c('0x3b')](_0x5114f9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x415c('0xa')][_0x415c('0xa0')]=function(_0x27ac79,_0x4e7842,_0x170ab3){var _0x14ce36=['rtpaudioqos',_0x415c('0xab'),_0x415c('0xac'),_0x415c('0xad'),_0x415c('0xae'),_0x415c('0xaf'),_0x415c('0xb0'),_0x415c('0xb1'),_0x415c('0xb2'),_0x415c('0xb3'),'bridgepeer','bridgepvtcallid','membercalls',_0x415c('0xb4'),'memberinterface',_0x415c('0xb5'),_0x415c('0x8e'),_0x415c('0xb6'),_0x415c('0xb7')];if(!_['isNil'](_0x4e7842)&&!_[_0x415c('0xb8')](_0x14ce36,_0x4e7842)){if(_['isUndefined'](this[_0x415c('0x14')][_0x27ac79])){this[_0x415c('0x14')][_0x27ac79]={};}this[_0x415c('0x14')][_0x27ac79][_0x4e7842]=_0x170ab3;}};VoiceQueueReport[_0x415c('0xa')][_0x415c('0xb9')]=function(_0x3321cf,_0x99608a,_0x3094fb){var _0x1b0fc3={};for(var _0x231584=0x0;_0x2315840x0?_0x3c9fc2:0x0;this[_0xa6b0('0x13')][_0x5aa5f4[_0xa6b0('0x67')]][_0xa6b0('0x30')]=this['voiceQueues'][_0x5aa5f4[_0xa6b0('0x67')]][_0xa6b0('0x30')]>_[_0xa6b0('0x6d')](_0x5aa5f4[_0xa6b0('0x6f')])?_[_0xa6b0('0x6d')](_0x5aa5f4[_0xa6b0('0x6f')]):this[_0xa6b0('0x13')][_0x5aa5f4[_0xa6b0('0x67')]]['talking'];this[_0xa6b0('0x70')](this[_0xa6b0('0x13')][_0x5aa5f4[_0xa6b0('0x67')]],'queuesummary');}logger[_0xa6b0('0x45')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util['inspect'](this[_0xa6b0('0x13')][_0x5aa5f4[_0xa6b0('0x67')]],{'showHidden':![],'depth':null}));ami[_0xa6b0('0x43')]('custom:queuesummary',this[_0xa6b0('0x13')][_0x5aa5f4[_0xa6b0('0x67')]]);}}}catch(_0x2fa785){logger['error'](_0xa6b0('0x66'),util[_0xa6b0('0x3d')](_0x2fa785,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa6b0('0x33')]['syncQueueSummaryComplete']=function(_0x53e448){logger[_0xa6b0('0x45')](_0xa6b0('0x71'),util[_0xa6b0('0x3d')](_0x53e448,{'showHidden':![],'depth':null}));ami[_0xa6b0('0x43')](_0xa6b0('0x72'),{});this[_0xa6b0('0x14')]=!![];};VoiceQueueReport[_0xa6b0('0x33')][_0xa6b0('0x1b')]=function(_0xcf4a9e){try{if(this['isNotNull'](_0xcf4a9e)){logger['debug'](_0xa6b0('0x73'),_0xcf4a9e['uniqueid'],util[_0xa6b0('0x3d')](_0xcf4a9e,{'showHidden':![],'depth':null}));if(_[_0xa6b0('0x62')](this[_0xa6b0('0x10')][_0xcf4a9e[_0xa6b0('0x46')]]))this[_0xa6b0('0x10')][_0xcf4a9e[_0xa6b0('0x46')]]=[];if(_[_0xa6b0('0x62')](this['channels'][_0xcf4a9e[_0xa6b0('0x46')]]))this[_0xa6b0('0x35')][_0xcf4a9e[_0xa6b0('0x46')]]={};var _0xf4ef09=new QueueReport();_0xf4ef09[_0xa6b0('0x49')]=_0xcf4a9e[_0xa6b0('0x67')];_0xf4ef09[_0xa6b0('0x58')]=this['voiceQueues'][_0xf4ef09[_0xa6b0('0x49')]]&&this[_0xa6b0('0x13')][_0xf4ef09[_0xa6b0('0x49')]][_0xa6b0('0x58')]?this[_0xa6b0('0x13')][_0xf4ef09[_0xa6b0('0x49')]]['type']||'inbound':_0xa6b0('0x52');_0xf4ef09[_0xa6b0('0x67')]=_0xcf4a9e[_0xa6b0('0x67')];_0xf4ef09['queuecallerjoinAt']=moment()[_0xa6b0('0x47')](_0xa6b0('0x74'));_0xf4ef09[_0xa6b0('0x75')]=_0xcf4a9e[_0xa6b0('0x75')];_0xf4ef09[_0xa6b0('0x76')]=_0xcf4a9e[_0xa6b0('0x76')];_0xf4ef09[_0xa6b0('0x46')]=_0xcf4a9e[_0xa6b0('0x46')];_0xf4ef09['routealias']=this['channels'][_0xcf4a9e['uniqueid']][_0xa6b0('0x77')];logger[_0xa6b0('0x69')](_0xa6b0('0x78'),_0xf4ef09[_0xa6b0('0x49')],_0xf4ef09[_0xa6b0('0x58')]);_[_0xa6b0('0x79')](_0xf4ef09,_['pick'](_0xcf4a9e,_[_0xa6b0('0x7a')](_0xf4ef09)));this['queueReports'][_0xcf4a9e[_0xa6b0('0x46')]]['push'](_0xf4ef09);this[_0xa6b0('0x35')][_0xcf4a9e[_0xa6b0('0x46')]]=_0xf4ef09;this[_0xa6b0('0x44')](_0xf4ef09,_0xa6b0('0x7b'));}}catch(_0x2d2698){logger[_0xa6b0('0x3e')](_0xa6b0('0x73'),_0xcf4a9e[_0xa6b0('0x46')],util[_0xa6b0('0x3d')](_0x2d2698,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa6b0('0x33')]['syncQueueCallerAbandon']=function(_0x329161){try{if(this[_0xa6b0('0x61')](_0x329161)){logger[_0xa6b0('0x45')](_0xa6b0('0x7c'),_0x329161['uniqueid'],util['inspect'](_0x329161,{'showHidden':![],'depth':null}));if(this[_0xa6b0('0x10')][_0x329161[_0xa6b0('0x46')]]){var _0x5c2756=_['last'](this['queueReports'][_0x329161[_0xa6b0('0x46')]]);_0x5c2756['queuecallercomplete']=![];_0x5c2756[_0xa6b0('0x7d')]=null;_0x5c2756[_0xa6b0('0x7e')]=_0x329161[_0xa6b0('0x7e')];_0x5c2756[_0xa6b0('0x7f')]=_0x329161[_0xa6b0('0x7f')];_0x5c2756[_0xa6b0('0x1c')]=!![];_0x5c2756[_0xa6b0('0x80')]=moment()[_0xa6b0('0x47')](_0xa6b0('0x74'));_0x5c2756[_0xa6b0('0x4e')]='ABANDONED';_0x5c2756['lastAssignedTo']=null;logger[_0xa6b0('0x69')](_0xa6b0('0x81'),_0x5c2756[_0xa6b0('0x49')],_0x5c2756['type']);this[_0xa6b0('0x35')][_0x329161[_0xa6b0('0x46')]]=_0x5c2756;this['emitVoiceQueueChannelRemove'](_0x5c2756,_0xa6b0('0x1c'));}}}catch(_0x3e5e77){logger[_0xa6b0('0x3e')](_0xa6b0('0x7c'),_0x329161[_0xa6b0('0x46')],util[_0xa6b0('0x3d')](_0x3e5e77,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa6b0('0x33')][_0xa6b0('0x82')]=function(_0x27c1db){try{if(this['isNotNull'](_0x27c1db)){logger[_0xa6b0('0x45')](_0xa6b0('0x83'),_0x27c1db[_0xa6b0('0x46')],util[_0xa6b0('0x3d')](_0x27c1db,{'showHidden':![],'depth':null}));if(this[_0xa6b0('0x10')][_0x27c1db[_0xa6b0('0x46')]]){var _0x36deb9=_[_0xa6b0('0x84')](this[_0xa6b0('0x10')][_0x27c1db[_0xa6b0('0x46')]]);_0x36deb9[_0xa6b0('0x85')]=moment()['format'](_0xa6b0('0x74'));_0x36deb9[_0xa6b0('0x86')]=_0x27c1db[_0xa6b0('0x86')];_0x36deb9['connectedlinename']=_0x27c1db['connectedlinename'];logger[_0xa6b0('0x69')](_0xa6b0('0x87'),_0x36deb9[_0xa6b0('0x49')],_0x36deb9[_0xa6b0('0x58')],_0x27c1db[_0xa6b0('0x86')],_0x27c1db['connectedlinename']);this['channels'][_0x27c1db['uniqueid']]=_0x36deb9;this[_0xa6b0('0x44')](_0x36deb9,_0xa6b0('0x88'));}}}catch(_0x147eaf){logger[_0xa6b0('0x3e')](_0xa6b0('0x83'),_0x27c1db[_0xa6b0('0x46')],util[_0xa6b0('0x3d')](_0x147eaf,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa6b0('0x33')][_0xa6b0('0x89')]=function(_0xe2cd5f){try{if(this['isNotNull'](_0xe2cd5f)){logger[_0xa6b0('0x45')](_0xa6b0('0x8a'),_0xe2cd5f[_0xa6b0('0x46')],util[_0xa6b0('0x3d')](_0xe2cd5f,{'showHidden':![],'depth':null}));if(this[_0xa6b0('0x10')][_0xe2cd5f[_0xa6b0('0x46')]]){var _0x45882a=_['last'](this[_0xa6b0('0x10')][_0xe2cd5f['uniqueid']]);_0x45882a[_0xa6b0('0x8b')]=!![];_0x45882a['queuecallerexitreason']='COMPLETEDBYAGENT';logger[_0xa6b0('0x69')](_0xa6b0('0x8c'),_0x45882a[_0xa6b0('0x49')],_0x45882a[_0xa6b0('0x58')]);}}}catch(_0x1f0ad4){logger[_0xa6b0('0x3e')](_0xa6b0('0x8a'),_0xe2cd5f[_0xa6b0('0x46')],util[_0xa6b0('0x3d')](_0x1f0ad4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa6b0('0x33')][_0xa6b0('0x1f')]=function(_0x2cd934){try{if(this[_0xa6b0('0x61')](_0x2cd934)){logger[_0xa6b0('0x45')](_0xa6b0('0x8d'),_0x2cd934[_0xa6b0('0x46')],util[_0xa6b0('0x3d')](_0x2cd934,{'showHidden':![],'depth':null}));if(this[_0xa6b0('0x10')][_0x2cd934[_0xa6b0('0x46')]]){var _0x4231c8=_[_0xa6b0('0x84')](this[_0xa6b0('0x10')][_0x2cd934[_0xa6b0('0x46')]]);_0x4231c8['queuecallerabandon']=![];_0x4231c8[_0xa6b0('0x80')]=null;_0x4231c8[_0xa6b0('0x8e')]=!![];_0x4231c8[_0xa6b0('0x8f')]=_0x2cd934[_0xa6b0('0x90')];_0x4231c8[_0xa6b0('0x7e')]=_0x2cd934[_0xa6b0('0x7e')];_0x4231c8['queuecallercomplete']=!![];_0x4231c8[_0xa6b0('0x91')]=![];_0x4231c8[_0xa6b0('0x92')]=null;if(!_0x4231c8[_0xa6b0('0x93')]){if(_0x2cd934[_0xa6b0('0x94')]=='transfer'){_0x4231c8['queuecallerexitreason']=_0xa6b0('0x95');logger[_0xa6b0('0x69')](_0xa6b0('0x96'),_0x4231c8['name'],_0x4231c8[_0xa6b0('0x58')]);}else{if(_['startsWith'](_0x2cd934[_0xa6b0('0x39')][_0xa6b0('0x97')](),_0xa6b0('0x98'))){if(this[_0xa6b0('0x10')][_0x2cd934[_0xa6b0('0x99')]]){var _0x2a83ee=_['last'](this[_0xa6b0('0x10')][_0x2cd934['linkedid']]);_0x2a83ee[_0xa6b0('0x8b')]=![];_0x2a83ee[_0xa6b0('0x91')]=!![];_0x2a83ee[_0xa6b0('0x92')]=moment(_0x4231c8[_0xa6b0('0x9a')])[_0xa6b0('0x9b')](_0x2cd934[_0xa6b0('0x7e')],_0xa6b0('0x9c'))[_0xa6b0('0x47')](_0xa6b0('0x74'));_0x2a83ee[_0xa6b0('0x4e')]=_0xa6b0('0x9d');_0x2a83ee[_0xa6b0('0x93')]=!![];_0x2a83ee['transfertype']=_0xa6b0('0x9e');_0x2a83ee[_0xa6b0('0x9f')]=_0x2cd934[_0xa6b0('0xa0')];_0x2a83ee['transferuniqueid']=_0x2cd934[_0xa6b0('0x46')];logger[_0xa6b0('0x69')](_0xa6b0('0xa1'),_0x2a83ee[_0xa6b0('0x49')],_0x2a83ee['type']);var _0x21fecd=this[_0xa6b0('0x10')][_0x2cd934[_0xa6b0('0x99')]];this[_0xa6b0('0x10')][_0x2cd934[_0xa6b0('0x99')]]=this['queueReports'][_0x2cd934['uniqueid']];this[_0xa6b0('0x10')][_0x2cd934['uniqueid']]=_0x21fecd;}}else{_0x4231c8['queuecallerexitreason']=_0xa6b0('0xa2')+_0x2cd934[_0xa6b0('0x94')][_0xa6b0('0xa3')]();logger[_0xa6b0('0x69')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x4231c8[_0xa6b0('0x49')],_0x4231c8['type'],_0x4231c8[_0xa6b0('0x4e')]);}}}this[_0xa6b0('0x35')][_0x2cd934[_0xa6b0('0x46')]]=_0x4231c8;this[_0xa6b0('0x4b')](_0x4231c8,_0xa6b0('0x1e'));}}}catch(_0x23ebc4){logger[_0xa6b0('0x3e')](_0xa6b0('0x8d'),_0x2cd934[_0xa6b0('0x46')],util[_0xa6b0('0x3d')](_0x23ebc4,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncVarSet']=function(_0x43153c){try{if(this[_0xa6b0('0x61')](_0x43153c)){logger['debug'](_0xa6b0('0xa4'),_0x43153c[_0xa6b0('0x46')],util[_0xa6b0('0x3d')](_0x43153c,{'showHidden':![],'depth':null}));this[_0xa6b0('0xa5')](_0x43153c[_0xa6b0('0x46')],_[_0xa6b0('0x7a')](_0x43153c[_0xa6b0('0xa6')])[0x0],_0x43153c[_0xa6b0('0xa7')]);if(this['queueReports'][_0x43153c['uniqueid']]){var _0x9a4a53=_[_0xa6b0('0x84')](this[_0xa6b0('0x10')][_0x43153c['uniqueid']]);if(_0x9a4a53){if(this[_0xa6b0('0x61')](_0x43153c[_0xa6b0('0xa6')])&&this['isNotNull'](_0x43153c['variable'][_0xa6b0('0xa8')])){switch(_0x43153c[_0xa6b0('0xa7')]){case _0xa6b0('0xa9'):_0x9a4a53[_0xa6b0('0x91')]=![];_0x9a4a53['queuecallerexitAt']=null;break;case'TIMEOUT':_0x9a4a53[_0xa6b0('0xaa')]=_0xa6b0('0xab');_0x9a4a53[_0xa6b0('0x91')]=!![];_0x9a4a53[_0xa6b0('0x92')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x9a4a53[_0xa6b0('0x85')]=moment()[_0xa6b0('0x47')](_0xa6b0('0x74'));logger[_0xa6b0('0x45')](_0xa6b0('0xac'),_0x43153c['uniqueid'],util['inspect'](_0x9a4a53,{'showHidden':![],'depth':null}));ami['emit'](_0xa6b0('0xad'),_0x9a4a53);break;default:_0x9a4a53[_0xa6b0('0x91')]=!![];_0x9a4a53[_0xa6b0('0x92')]=moment()[_0xa6b0('0x47')](_0xa6b0('0x74'));_0x9a4a53[_0xa6b0('0x85')]=moment()[_0xa6b0('0x47')](_0xa6b0('0x74'));}_0x9a4a53['queuecallerabandon']=![];_0x9a4a53[_0xa6b0('0x80')]=null;_0x9a4a53['queuecallerexitreason']=_0x43153c[_0xa6b0('0xa7')];this[_0xa6b0('0x35')][_0x43153c['uniqueid']]=_0x9a4a53;this[_0xa6b0('0x4b')](_0x9a4a53,'varset');}else if(this['isNotNull'](_0x43153c['variable'])&&this[_0xa6b0('0x61')](_0x43153c[_0xa6b0('0xa6')][_0xa6b0('0xae')])){if(!_0x9a4a53['queuecallerabandon']){_0x9a4a53[_0xa6b0('0x91')]=!![];_0x9a4a53[_0xa6b0('0x92')]=moment()[_0xa6b0('0x47')](_0xa6b0('0x74'));_0x9a4a53[_0xa6b0('0x4e')]='EXITWITHKEY';_0x9a4a53[_0xa6b0('0x85')]=moment()[_0xa6b0('0x47')](_0xa6b0('0x74'));this['channels'][_0x43153c[_0xa6b0('0x46')]]=_0x9a4a53;}}logger[_0xa6b0('0x69')](_0xa6b0('0xaf'),_0x43153c['uniqueid'],_0x9a4a53[_0xa6b0('0x49')],_0x9a4a53['type'],_[_0xa6b0('0x7a')](_0x43153c[_0xa6b0('0xa6')])[0x0],_0x43153c['value']);_0x9a4a53[_0xa6b0('0x16')]=this[_0xa6b0('0x16')][_0x43153c[_0xa6b0('0x46')]];}}}}catch(_0x4aa203){logger[_0xa6b0('0x3e')](_0xa6b0('0xa4'),_0x43153c[_0xa6b0('0x46')],util[_0xa6b0('0x3d')](_0x4aa203,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xa6b0('0xa5')]=function(_0x465923,_0x1d0a15,_0x290873){var _0x228c5a=['rtpaudioqos',_0xa6b0('0xb0'),_0xa6b0('0xb1'),'rtpaudioqosjitterbridged','rtpaudioqosloss',_0xa6b0('0xb2'),_0xa6b0('0xb3'),_0xa6b0('0xb4'),_0xa6b0('0xb5'),'sipuri',_0xa6b0('0xb6'),_0xa6b0('0xb7'),'membercalls',_0xa6b0('0xb8'),_0xa6b0('0xb9'),_0xa6b0('0xba'),'membername',_0xa6b0('0xbb'),_0xa6b0('0xbc')];if(!_[_0xa6b0('0x37')](_0x1d0a15)&&!_[_0xa6b0('0xbd')](_0x228c5a,_0x1d0a15)){if(_[_0xa6b0('0x62')](this['variables'][_0x465923])){this[_0xa6b0('0x16')][_0x465923]={};}this[_0xa6b0('0x16')][_0x465923][_0x1d0a15]=_0x290873;}};VoiceQueueReport[_0xa6b0('0x33')][_0xa6b0('0xbe')]=function(_0x5c470c,_0x27dd5c,_0x66bdc5){var _0xcb3efe={};for(var _0x59cb91=0x0;_0x59cb91=0x0?moment(_0x2e042c['endtime'])[_0xb5dc('0x1a')](_0x2e042c[_0xb5dc('0x18')],_0xb5dc('0x11')):null,'data1':_0xb5dc('0x1b'),'data2':_0x2e042c[_0xb5dc('0x15')],'data3':_0x2e042c[_0xb5dc('0x13')],'data4':_0x2e042c['dialstring']||null,'role':_0xb5dc('0x14'),'internal':_0x2e042c[_0xb5dc('0x15')]?_[_0xb5dc('0x16')](_0x2e042c[_0xb5dc('0x15')]):undefined,'uniqueid':_0x2e042c[_0xb5dc('0x1c')]},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0x04ec=['uniqueid','voiceDialReport','membername','interface','starttime','endtime','outbound','exten','dialstring','moment','lodash','../client','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','TALKING','queuecallerleaveAt','diff','seconds','inbound','calleridnum','agent','accountcode','toNumber'];(function(_0x594fab,_0x59493c){var _0x198c2e=function(_0xa45cec){while(--_0xa45cec){_0x594fab['push'](_0x594fab['shift']());}};_0x198c2e(++_0x59493c);}(_0x04ec,0x15b));var _0xc04e=function(_0x14a0a0,_0x45d0cf){_0x14a0a0=_0x14a0a0-0x0;var _0x56b651=_0x04ec[_0x14a0a0];return _0x56b651;};'use strict';var moment=require(_0xc04e('0x0'));var _=require(_0xc04e('0x1'));var util=require('util');var client=require(_0xc04e('0x2'));exports['voiceQueueReport']=function(_0x4863bc){var _0x1ded1b=_0x4863bc[_0xc04e('0x3')]||_0x4863bc[_0xc04e('0x4')];return client[_0xc04e('0x5')](_0xc04e('0x6'),{'body':{'channel':_0xc04e('0x7'),'membername':_0x4863bc['lastAssignedTo'],'interface':_['isNil'](_0x4863bc['interface'])?util['format']('SIP/%s',_0x4863bc['lastAssignedTo']):_0x4863bc['interface'],'type':_0xc04e('0x8'),'enterAt':_0x4863bc[_0xc04e('0x9')],'exitAt':_0x1ded1b,'duration':moment(_0x1ded1b)[_0xc04e('0xa')](_0x4863bc['queuecallerleaveAt'],_0xc04e('0xb')),'data1':_0xc04e('0xc'),'data2':_0x4863bc[_0xc04e('0xd')],'data3':_0x4863bc['exten'],'data4':null,'data5':_0x4863bc['queue'],'role':_0xc04e('0xe'),'internal':_0x4863bc[_0xc04e('0xf')]?_[_0xc04e('0x10')](_0x4863bc['accountcode']):undefined,'uniqueid':_0x4863bc[_0xc04e('0x11')]},'log':_0xc04e('0x6')});};exports[_0xc04e('0x12')]=function(_0x4ee3e4){return client[_0xc04e('0x5')](_0xc04e('0x6'),{'body':{'channel':_0xc04e('0x7'),'membername':_0x4ee3e4[_0xc04e('0x13')],'interface':_0x4ee3e4[_0xc04e('0x14')],'type':_0xc04e('0x8'),'enterAt':_0x4ee3e4[_0xc04e('0x15')],'exitAt':_0x4ee3e4[_0xc04e('0x16')],'duration':moment(_0x4ee3e4['endtime'])['diff'](_0x4ee3e4[_0xc04e('0x15')],'seconds')>=0x0?moment(_0x4ee3e4['endtime'])[_0xc04e('0xa')](_0x4ee3e4[_0xc04e('0x15')],_0xc04e('0xb')):null,'data1':_0xc04e('0x17'),'data2':_0x4ee3e4[_0xc04e('0xf')],'data3':_0x4ee3e4[_0xc04e('0x18')],'data4':_0x4ee3e4[_0xc04e('0x19')]||null,'role':_0xc04e('0xe'),'internal':_0x4ee3e4[_0xc04e('0xf')]?_[_0xc04e('0x10')](_0x4ee3e4[_0xc04e('0xf')]):undefined,'uniqueid':_0x4ee3e4['uniqueid']},'log':_0xc04e('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 6a8da0e..b0daf90 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 _0x79ad=['GetSettings','../client','ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x79ad,0x16e));var _0xd79a=function(_0x54df11,_0x45d037){_0x54df11=_0x54df11-0x0;var _0xdacff5=_0x79ad[_0x54df11];return _0xdacff5;};'use strict';var client=require(_0xd79a('0x0'));exports['getSettings']=function(){return client['Request'](_0xd79a('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xd79a('0x2'),_0xd79a('0x3')]},'log':_0xd79a('0x4')});}; \ No newline at end of file +var _0x7275=['Request','stopRecordingOnTransfer','GetSettings','../client','getSettings'];(function(_0x37897a,_0x1a355a){var _0x2701fb=function(_0x545c7e){while(--_0x545c7e){_0x37897a['push'](_0x37897a['shift']());}};_0x2701fb(++_0x1a355a);}(_0x7275,0x143));var _0x5727=function(_0x4ec8ef,_0x3a7729){_0x4ec8ef=_0x4ec8ef-0x0;var _0x3bc0e8=_0x7275[_0x4ec8ef];return _0x3bc0e8;};'use strict';var client=require(_0x5727('0x0'));exports[_0x5727('0x1')]=function(){return client[_0x5727('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x5727('0x3'),'previewRecallmeReminderInterval']},'log':_0x5727('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index a579143..b81cff1 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 _0xb2af=['../client','getTemplates','GetTemplate','name','html'];(function(_0x190f83,_0x1dd650){var _0x524fe7=function(_0x437aca){while(--_0x437aca){_0x190f83['push'](_0x190f83['shift']());}};_0x524fe7(++_0x1dd650);}(_0xb2af,0xd2));var _0xfb2a=function(_0x415a4c,_0x8555a0){_0x415a4c=_0x415a4c-0x0;var _0x367e05=_0xb2af[_0x415a4c];return _0x367e05;};'use strict';var client=require(_0xfb2a('0x0'));exports[_0xfb2a('0x1')]=function(_0xf5c2e0){return function(_0x52856c){return client['Request'](_0xfb2a('0x2'),{'options':{'raw':!![],'attributes':['id',_0xfb2a('0x3'),_0xfb2a('0x4')]},'log':_0xfb2a('0x2')});};}; \ No newline at end of file +var _0x076b=['GetTemplate','../client','getTemplates','Request'];(function(_0x5d8ff1,_0x4f758a){var _0x388fd2=function(_0x4cb0d7){while(--_0x4cb0d7){_0x5d8ff1['push'](_0x5d8ff1['shift']());}};_0x388fd2(++_0x4f758a);}(_0x076b,0x1c1));var _0xb076=function(_0x1acc89,_0x39be70){_0x1acc89=_0x1acc89-0x0;var _0x13a6d8=_0x076b[_0x1acc89];return _0x13a6d8;};'use strict';var client=require(_0xb076('0x0'));exports[_0xb076('0x1')]=function(_0x418be2){return function(_0x1bac78){return client[_0xb076('0x2')](_0xb076('0x3'),{'options':{'raw':!![],'attributes':['id','name','html']},'log':_0xb076('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index c57591e..3abf23b 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 _0xe429=['value','AnyConditions','Action','Actions','action','data1','data2','data3','data4','data6','GetTrigger','getTriggers','Request','name','channel','status','Condition','field','operator'];(function(_0xf87885,_0x4b8b27){var _0x484eea=function(_0x12af03){while(--_0x12af03){_0xf87885['push'](_0xf87885['shift']());}};_0x484eea(++_0x4b8b27);}(_0xe429,0x128));var _0x9e42=function(_0x42ffff,_0x237b24){_0x42ffff=_0x42ffff-0x0;var _0x47dad5=_0xe429[_0x42ffff];return _0x47dad5;};'use strict';var client=require('../client');exports[_0x9e42('0x0')]=function(_0x1f29e1){return function(_0x29680d){return client[_0x9e42('0x1')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x9e42('0x2'),_0x9e42('0x3'),_0x9e42('0x4')],'include':[{'model':_0x9e42('0x5'),'as':'AllConditions','attributes':['id',_0x9e42('0x6'),_0x9e42('0x7'),_0x9e42('0x8')]},{'model':_0x9e42('0x5'),'as':_0x9e42('0x9'),'attributes':['id','field',_0x9e42('0x7'),_0x9e42('0x8')]},{'model':_0x9e42('0xa'),'as':_0x9e42('0xb'),'attributes':['id',_0x9e42('0xc'),_0x9e42('0xd'),_0x9e42('0xe'),_0x9e42('0xf'),_0x9e42('0x10'),'data5',_0x9e42('0x11'),'data7']}]},'log':_0x9e42('0x12')});};}; \ No newline at end of file +var _0xb2f7=['GetTrigger','channel','field','value','Condition','AnyConditions','operator','Action','Actions','data1','data2','data3','data4','data6','data7','../client','getTriggers','Request'];(function(_0x45bdf6,_0x5d749d){var _0x307dbd=function(_0x2d8666){while(--_0x2d8666){_0x45bdf6['push'](_0x45bdf6['shift']());}};_0x307dbd(++_0x5d749d);}(_0xb2f7,0x189));var _0x7b2f=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xb2f7[_0x3e112d];return _0x531c31;};'use strict';var client=require(_0x7b2f('0x0'));exports[_0x7b2f('0x1')]=function(_0x512d6d){return function(_0x2a10bc){return client[_0x7b2f('0x2')](_0x7b2f('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x7b2f('0x4'),'status'],'include':[{'model':'Condition','as':'AllConditions','attributes':['id',_0x7b2f('0x5'),'operator',_0x7b2f('0x6')]},{'model':_0x7b2f('0x7'),'as':_0x7b2f('0x8'),'attributes':['id','field',_0x7b2f('0x9'),_0x7b2f('0x6')]},{'model':_0x7b2f('0xa'),'as':_0x7b2f('0xb'),'attributes':['id','action',_0x7b2f('0xc'),_0x7b2f('0xd'),_0x7b2f('0xe'),_0x7b2f('0xf'),'data5',_0x7b2f('0x10'),_0x7b2f('0x11')]}]},'log':_0x7b2f('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index ac9638c..e83052d 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 _0x117d=['GetTrunk','name','registry','defaultuser','../client','getTrunks','Request'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x117d,0xac));var _0xd117=function(_0x631a3c,_0x1b61b6){_0x631a3c=_0x631a3c-0x0;var _0x2bdfa3=_0x117d[_0x631a3c];return _0x2bdfa3;};'use strict';var client=require(_0xd117('0x0'));exports[_0xd117('0x1')]=function(_0x16356f){return function(_0x4a02b2){return client[_0xd117('0x2')](_0xd117('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xd117('0x4'),_0xd117('0x5'),_0xd117('0x6')]},'log':'GetTrunk'});};}; \ No newline at end of file +var _0x5395=['../client','GetTrunk','name','registry'];(function(_0x4e089f,_0x3d8cd0){var _0x4428de=function(_0x44fd93){while(--_0x44fd93){_0x4e089f['push'](_0x4e089f['shift']());}};_0x4428de(++_0x3d8cd0);}(_0x5395,0x150));var _0x5539=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x5395[_0x199572];return _0x13cfa3;};'use strict';var client=require(_0x5539('0x0'));exports['getTrunks']=function(_0x3795fc){return function(_0x5a8176){return client['Request'](_0x5539('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x5539('0x2'),_0x5539('0x3'),'defaultuser']},'log':_0x5539('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index f42a6d8..8597ead 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(_0x19e669,_0x122c74){var _0x1263c9=function(_0x93e0d){while(--_0x93e0d){_0x19e669['push'](_0x19e669['shift']());}};_0x1263c9(++_0x122c74);}(_0xedd9,0xfc));var _0x9edd=function(_0x171b64,_0x1dc8e2){_0x171b64=_0x171b64-0x0;var _0x359757=_0xedd9[_0x171b64];return _0x359757;};'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 _0xedd9=['mobile','getTelephones','internal','PauseUser','savePause','saveUnpause','UnpauseUser','ShowUser','interface','getAgent','getAgents','Request','GetUser','agent','name','email','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','voicePause'];(function(_0x25ab85,_0x3c8ca3){var _0x4c47cc=function(_0x4b36dd){while(--_0x4b36dd){_0x25ab85['push'](_0x25ab85['shift']());}};_0x4c47cc(++_0x3c8ca3);}(_0xedd9,0xfc));var _0x9edd=function(_0x190a33,_0x1046de){_0x190a33=_0x190a33-0x0;var _0xcd67ed=_0xedd9[_0x190a33];return _0xcd67ed;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3')},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),_0x9edd('0xb'),'phone',_0x9edd('0xc'),'interface']},'log':_0x9edd('0x0')});};};exports[_0x9edd('0xd')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x9edd('0x4'),'accountcode',_0x9edd('0xe')]},'log':_0x9edd('0xd')});};};exports['savePause']=function(_0xbf9da6,_0x13dc4f,_0x5b6c00){return client[_0x9edd('0x1')](_0x9edd('0xf'),{'body':{'type':_0x13dc4f,'uniqueid':_0x5b6c00},'options':{'where':{'id':_0xbf9da6['id']}},'log':_0x9edd('0x10')});};exports[_0x9edd('0x11')]=function(_0x287ddd){return client[_0x9edd('0x1')](_0x9edd('0x12'),{'body':{},'options':{'where':{'id':_0x287ddd['id']}},'log':_0x9edd('0x10')});};exports['getAgent']=function(_0x176bfa){return client[_0x9edd('0x1')](_0x9edd('0x13'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3'),'id':_0x176bfa},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),'voicePause',_0x9edd('0x14')]},'log':_0x9edd('0x15')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index f030d12..59100d2 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 _0x13eb=['Request','UpdateVoiceAgentReport','../client','create','CreateVoiceAgentReport','update'];(function(_0x11df5a,_0xd0e0b7){var _0x492524=function(_0x845dbc){while(--_0x845dbc){_0x11df5a['push'](_0x11df5a['shift']());}};_0x492524(++_0xd0e0b7);}(_0x13eb,0xc8));var _0xb13e=function(_0x2abd62,_0x36911e){_0x2abd62=_0x2abd62-0x0;var _0x1c41af=_0x13eb[_0x2abd62];return _0x1c41af;};'use strict';var client=require(_0xb13e('0x0'));exports[_0xb13e('0x1')]=function(_0x51a92c){return client['Request'](_0xb13e('0x2'),{'body':_0x51a92c,'log':_0xb13e('0x2')});};exports[_0xb13e('0x3')]=function(_0x5a21ab,_0x3ab42a,_0x46f62f){return client[_0xb13e('0x4')](_0xb13e('0x5'),{'body':_0x5a21ab,'options':{'where':{'uniqueid':_0x3ab42a,'interface':_0x46f62f,'agentcomplete':!![]}},'log':_0xb13e('0x5')});}; \ No newline at end of file +var _0x34af=['UpdateVoiceAgentReport','create','CreateVoiceAgentReport','update','Request'];(function(_0xf49017,_0x2e78a2){var _0x5b6dd0=function(_0x400b37){while(--_0x400b37){_0xf49017['push'](_0xf49017['shift']());}};_0x5b6dd0(++_0x2e78a2);}(_0x34af,0x10a));var _0xf34a=function(_0x4a286a,_0x5354b7){_0x4a286a=_0x4a286a-0x0;var _0x576573=_0x34af[_0x4a286a];return _0x576573;};'use strict';var client=require('../client');exports[_0xf34a('0x0')]=function(_0x37aecd){return client['Request'](_0xf34a('0x1'),{'body':_0x37aecd,'log':_0xf34a('0x1')});};exports[_0xf34a('0x2')]=function(_0x1d55a7,_0x52d787,_0x35628e){return client[_0xf34a('0x3')](_0xf34a('0x4'),{'body':_0x1d55a7,'options':{'where':{'uniqueid':_0x52d787,'interface':_0x35628e,'agentcomplete':!![]}},'log':_0xf34a('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 133d013..5624f3b 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 _0x8e1e=['YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','billableseconds','GetVoiceCallReports','moment','util','lodash','../client','create','Request','CreateVoiceCallReport','callerid','day'];(function(_0x5223a6,_0x328a89){var _0x1e4ba7=function(_0x2a138e){while(--_0x2a138e){_0x5223a6['push'](_0x5223a6['shift']());}};_0x1e4ba7(++_0x328a89);}(_0x8e1e,0x1aa));var _0xe8e1=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0x8e1e[_0x51c819];return _0x15c5d2;};'use strict';var moment=require(_0xe8e1('0x0'));var util=require(_0xe8e1('0x1'));var _=require(_0xe8e1('0x2'));var client=require(_0xe8e1('0x3'));exports[_0xe8e1('0x4')]=function(_0x295d6f){return client[_0xe8e1('0x5')](_0xe8e1('0x6'),{'body':_['merge'](_0x295d6f,{'source':_0x295d6f['calleridnum'],'destinationcontext':_0x295d6f['context'],'callerid':_0x295d6f[_0xe8e1('0x7')],'amaflags':'DOCUMENTATION'}),'log':'CreateVoiceCallReport'});};exports['getVoiceCallReports']=function(){return function(){return client['Request']('GetVoiceCallReport',{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()['startOf'](_0xe8e1('0x8'))['format'](_0xe8e1('0x9')),moment()[_0xe8e1('0xa')](_0xe8e1('0x8'))['format'](_0xe8e1('0x9'))]}},'attributes':[_0xe8e1('0xb'),_0xe8e1('0xc'),'duration',_0xe8e1('0xd')]},'log':_0xe8e1('0xe')});};}; \ No newline at end of file +var _0x7789=['merge','calleridnum','callerid','DOCUMENTATION','GetVoiceCallReport','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration','../client','create','Request','CreateVoiceCallReport'];(function(_0x70c40f,_0xc8a309){var _0x267982=function(_0x1c10f6){while(--_0x1c10f6){_0x70c40f['push'](_0x70c40f['shift']());}};_0x267982(++_0xc8a309);}(_0x7789,0x1bc));var _0x9778=function(_0x194db0,_0x50c56a){_0x194db0=_0x194db0-0x0;var _0x5aca87=_0x7789[_0x194db0];return _0x5aca87;};'use strict';var moment=require('moment');var util=require('util');var _=require('lodash');var client=require(_0x9778('0x0'));exports[_0x9778('0x1')]=function(_0xc4da1d){return client[_0x9778('0x2')](_0x9778('0x3'),{'body':_[_0x9778('0x4')](_0xc4da1d,{'source':_0xc4da1d[_0x9778('0x5')],'destinationcontext':_0xc4da1d['context'],'callerid':_0xc4da1d[_0x9778('0x6')],'amaflags':_0x9778('0x7')}),'log':_0x9778('0x3')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x9778('0x2')](_0x9778('0x8'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()['startOf'](_0x9778('0x9'))[_0x9778('0xa')](_0x9778('0xb')),moment()[_0x9778('0xc')](_0x9778('0x9'))['format'](_0x9778('0xb'))]}},'attributes':[_0x9778('0xd'),_0x9778('0xe'),_0x9778('0xf'),'billableseconds']},'log':'GetVoiceCallReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index f8ee431..11a0ca6 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 _0x2231=['create','Request','CreateVoiceDialReport','../client'];(function(_0x453b69,_0x28964b){var _0x1c03ce=function(_0x31c725){while(--_0x31c725){_0x453b69['push'](_0x453b69['shift']());}};_0x1c03ce(++_0x28964b);}(_0x2231,0x8f));var _0x1223=function(_0x42fc8e,_0x26620d){_0x42fc8e=_0x42fc8e-0x0;var _0x4ad7b5=_0x2231[_0x42fc8e];return _0x4ad7b5;};'use strict';var client=require(_0x1223('0x0'));exports[_0x1223('0x1')]=function(_0x2d1036){return client[_0x1223('0x2')](_0x1223('0x3'),{'body':_0x2d1036,'log':_0x1223('0x3')});}; \ No newline at end of file +var _0xc1c9=['CreateVoiceDialReport','../client','create'];(function(_0x3cc9d9,_0x69ed38){var _0x1a425d=function(_0x44d109){while(--_0x44d109){_0x3cc9d9['push'](_0x3cc9d9['shift']());}};_0x1a425d(++_0x69ed38);}(_0xc1c9,0x154));var _0x9c1c=function(_0x3071ab,_0x574a59){_0x3071ab=_0x3071ab-0x0;var _0x2f458c=_0xc1c9[_0x3071ab];return _0x2f458c;};'use strict';var client=require(_0x9c1c('0x0'));exports[_0x9c1c('0x1')]=function(_0x38d766){return client['Request'](_0x9c1c('0x2'),{'body':_0x38d766,'log':_0x9c1c('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index ae7137e..71cf506 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 _0xdb76=['exten','../client','getVoiceExtensions','Request','GetVoiceExtension'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xdb76,0x1be));var _0x6db7=function(_0x54dc4f,_0x486906){_0x54dc4f=_0x54dc4f-0x0;var _0x46d936=_0xdb76[_0x54dc4f];return _0x46d936;};'use strict';var client=require(_0x6db7('0x0'));exports[_0x6db7('0x1')]=function(){return function(){return client[_0x6db7('0x2')](_0x6db7('0x3'),{'options':{'raw':!![],'attributes':['id',_0x6db7('0x4'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x6db7('0x1')});};}; \ No newline at end of file +var _0x25a3=['exten','../client','getVoiceExtensions','Request'];(function(_0x1b8a16,_0x1af710){var _0x3a73bb=function(_0x3600fb){while(--_0x3600fb){_0x1b8a16['push'](_0x1b8a16['shift']());}};_0x3a73bb(++_0x1af710);}(_0x25a3,0x121));var _0x325a=function(_0x24d551,_0x5c8c5){_0x24d551=_0x24d551-0x0;var _0x1e9499=_0x25a3[_0x24d551];return _0x1e9499;};'use strict';var client=require(_0x325a('0x0'));exports[_0x325a('0x1')]=function(){return function(){return client[_0x325a('0x2')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x325a('0x3'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x325a('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 88234c7..31978ff 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 _0x142c=['dialMachineMaxRetry','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active','Pause','mandatoryDispositionPause','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acwTimeout','autopause','monitor_format','type','dialLimitChannel','dialPowerLevel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency'];(function(_0x389d74,_0x56135a){var _0x56797b=function(_0x47ee80){while(--_0x47ee80){_0x389d74['push'](_0x389d74['shift']());}};_0x56797b(++_0x56135a);}(_0x142c,0x1df));var _0xc142=function(_0x5a7a34,_0x369a13){_0x5a7a34=_0x5a7a34-0x0;var _0x282a01=_0x142c[_0x5a7a34];return _0x282a01;};'use strict';var client=require(_0xc142('0x0'));exports[_0xc142('0x1')]=function(){return function(){return client[_0xc142('0x2')](_0xc142('0x3'),{'options':{'raw':![],'attributes':['id',_0xc142('0x4'),'acw',_0xc142('0x5'),_0xc142('0x6'),_0xc142('0x7'),_0xc142('0x8'),'dialActive','dialMethod',_0xc142('0x9'),'dialLimitQueue',_0xc142('0xa'),'dialPredictiveOptimization',_0xc142('0xb'),_0xc142('0xc'),'dialOriginateCallerIdName',_0xc142('0xd'),_0xc142('0xe'),'dialQueueOptions',_0xc142('0xf'),'dialQueueProject',_0xc142('0x10'),_0xc142('0x11'),'dialBusyMaxRetry','dialBusyRetryFrequency',_0xc142('0x12'),_0xc142('0x13'),_0xc142('0x14'),'dialTimezone',_0xc142('0x15'),_0xc142('0x16'),_0xc142('0x17'),'dialAMDActive','dialAMDInitialSilence','dialAMDGreeting',_0xc142('0x18'),_0xc142('0x19'),_0xc142('0x1a'),_0xc142('0x1b'),_0xc142('0x1c'),'dialAMDSilenceThreshold',_0xc142('0x1d'),_0xc142('0x1e'),_0xc142('0x1f'),_0xc142('0x20'),_0xc142('0x21'),_0xc142('0x22'),_0xc142('0x23'),_0xc142('0x24'),'monitor_format','strategy',_0xc142('0x25'),_0xc142('0x26'),_0xc142('0x27'),'dialNoSuchNumberRetryFrequency',_0xc142('0x28'),_0xc142('0x29'),'dialAbandonedMaxRetry',_0xc142('0x2a'),_0xc142('0x2b'),'dialMachineRetryFrequency',_0xc142('0x2c'),'dialAgentRejectRetryFrequency',_0xc142('0x2d'),_0xc142('0x2e'),_0xc142('0x2f'),_0xc142('0x30'),_0xc142('0x31'),'callAdditionalPhoneAfterMin'],'include':[{'model':_0xc142('0x32'),'as':_0xc142('0x32'),'attributes':['id','name',_0xc142('0x33'),_0xc142('0x34')]},{'model':_0xc142('0x35'),'as':_0xc142('0x36'),'attributes':['id',_0xc142('0x4')]},{'model':_0xc142('0x32'),'as':'TrunkBackup','attributes':['id',_0xc142('0x4'),_0xc142('0x33'),_0xc142('0x34')]},{'model':_0xc142('0x37'),'as':'Interval','attributes':['id',_0xc142('0x4')],'include':[{'model':_0xc142('0x37'),'as':_0xc142('0x38'),'attributes':['id','name',_0xc142('0x39')]}]}]},'log':_0xc142('0x1')});};}; \ No newline at end of file +var _0x3760=['interval','getVoiceQueues','Request','GetVoiceQueue','name','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','mandatoryDispositionPause','TrunkBackup','Interval','Intervals'];(function(_0x441d7d,_0x310908){var _0x2c058b=function(_0x31e491){while(--_0x31e491){_0x441d7d['push'](_0x441d7d['shift']());}};_0x2c058b(++_0x310908);}(_0x3760,0x1de));var _0x0376=function(_0x3cae69,_0x233c38){_0x3cae69=_0x3cae69-0x0;var _0x3128eb=_0x3760[_0x3cae69];return _0x3128eb;};'use strict';var client=require('../client');exports[_0x0376('0x0')]=function(){return function(){return client[_0x0376('0x1')](_0x0376('0x2'),{'options':{'raw':![],'attributes':['id',_0x0376('0x3'),'acw',_0x0376('0x4'),_0x0376('0x5'),_0x0376('0x6'),_0x0376('0x7'),_0x0376('0x8'),_0x0376('0x9'),_0x0376('0xa'),'dialLimitQueue',_0x0376('0xb'),_0x0376('0xc'),_0x0376('0xd'),_0x0376('0xe'),_0x0376('0xf'),_0x0376('0x10'),'dialOriginateTimeout',_0x0376('0x11'),_0x0376('0x12'),_0x0376('0x13'),_0x0376('0x14'),_0x0376('0x15'),_0x0376('0x16'),'dialBusyRetryFrequency',_0x0376('0x17'),_0x0376('0x18'),'dialGlobalMaxRetry',_0x0376('0x19'),_0x0376('0x1a'),'dialPrefix','dialCheckDuplicateType',_0x0376('0x1b'),'dialAMDInitialSilence',_0x0376('0x1c'),_0x0376('0x1d'),'dialAMDTotalAnalysisTime',_0x0376('0x1e'),'dialAMDBetweenWordsSilence',_0x0376('0x1f'),'dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout',_0x0376('0x20'),_0x0376('0x21'),_0x0376('0x22'),'dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2',_0x0376('0x6'),_0x0376('0x23'),_0x0376('0x24'),_0x0376('0x25'),_0x0376('0x26'),'dialNoSuchNumberRetryFrequency',_0x0376('0x27'),_0x0376('0x28'),'dialAbandonedMaxRetry',_0x0376('0x29'),'dialMachineMaxRetry','dialMachineRetryFrequency',_0x0376('0x2a'),'dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold',_0x0376('0x2b'),_0x0376('0x2c'),_0x0376('0x2d'),'callAdditionalPhoneAfterMin'],'include':[{'model':_0x0376('0x2e'),'as':_0x0376('0x2e'),'attributes':['id',_0x0376('0x3'),_0x0376('0x2f'),'active']},{'model':'Pause','as':_0x0376('0x30'),'attributes':['id',_0x0376('0x3')]},{'model':_0x0376('0x2e'),'as':_0x0376('0x31'),'attributes':['id',_0x0376('0x3'),_0x0376('0x2f'),'active']},{'model':_0x0376('0x32'),'as':_0x0376('0x32'),'attributes':['id',_0x0376('0x3')],'include':[{'model':_0x0376('0x32'),'as':_0x0376('0x33'),'attributes':['id',_0x0376('0x3'),_0x0376('0x34')]}]}]},'log':_0x0376('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 868fddf..e13949e 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(_0x44b4e3,_0x4cf45c){var _0x4c80a5=function(_0x31301e){while(--_0x31301e){_0x44b4e3['push'](_0x44b4e3['shift']());}};_0x4c80a5(++_0x4cf45c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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(_0x357c57,_0x139b6b){var _0x1551d2=function(_0x59b52b){while(--_0x59b52b){_0x357c57['push'](_0x357c57['shift']());}};_0x1551d2(++_0x139b6b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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 5b5a0f8..8e1b815 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 _0x9f7b=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses','../client'];(function(_0x3f4ae4,_0x25d56b){var _0x1544f9=function(_0x1ab190){while(--_0x1ab190){_0x3f4ae4['push'](_0x3f4ae4['shift']());}};_0x1544f9(++_0x25d56b);}(_0x9f7b,0x163));var _0xb9f7=function(_0xd4b195,_0x50b619){_0xd4b195=_0xd4b195-0x0;var _0x2fbb30=_0x9f7b[_0xd4b195];return _0x2fbb30;};'use strict';var client=require(_0xb9f7('0x0'));exports[_0xb9f7('0x1')]=function(_0x44a795){return function(){return client[_0xb9f7('0x2')](_0xb9f7('0x3'),{'options':{'where':{'VoiceQueueId':_0x44a795,'paused':!![]},'raw':!![]},'log':_0xb9f7('0x1')});};}; \ No newline at end of file +var _0x7c6a=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses','Request'];(function(_0x27703b,_0x47a868){var _0xb3dcbc=function(_0x4401a2){while(--_0x4401a2){_0x27703b['push'](_0x27703b['shift']());}};_0xb3dcbc(++_0x47a868);}(_0x7c6a,0x1c1));var _0xa7c6=function(_0x131837,_0x2f6d78){_0x131837=_0x131837-0x0;var _0x5544e3=_0x7c6a[_0x131837];return _0x5544e3;};'use strict';var client=require(_0xa7c6('0x0'));exports[_0xa7c6('0x1')]=function(_0x422288){return function(){return client[_0xa7c6('0x2')](_0xa7c6('0x3'),{'options':{'where':{'VoiceQueueId':_0x422288,'paused':!![]},'raw':!![]},'log':_0xa7c6('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 72afc30..6dbe1f9 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 _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x34c173,_0x2fbb24){var _0x2336b9=function(_0x449cb0){while(--_0x449cb0){_0x34c173['push'](_0x34c173['shift']());}};_0x2336b9(++_0x2fbb24);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x43ba49,_0x5468e3){var _0x395810=function(_0x311122){while(--_0x311122){_0x43ba49['push'](_0x43ba49['shift']());}};_0x395810(++_0x5468e3);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 17ccb57..bf20619 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 _0x8b32=['transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','isexternal','context','blind','attendedTransfer','CreateVoiceTransferReport','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','origtransferercontext','../client','transfers','blindTransfer','Request','transfererchannel'];(function(_0xda7df9,_0x23d42d){var _0x64ad22=function(_0x20331e){while(--_0x20331e){_0xda7df9['push'](_0xda7df9['shift']());}};_0x64ad22(++_0x23d42d);}(_0x8b32,0xaa));var _0x28b3=function(_0xb4bb4f,_0x389bde){_0xb4bb4f=_0xb4bb4f-0x0;var _0x13c43f=_0x8b32[_0xb4bb4f];return _0x13c43f;};'use strict';var client=require(_0x28b3('0x0'));exports[_0x28b3('0x1')]={};exports[_0x28b3('0x2')]=function(_0x12cc1c){return client[_0x28b3('0x3')]('CreateVoiceTransferReport',{'body':{'result':_0x12cc1c['result'],'transfererchannel':_0x12cc1c[_0x28b3('0x4')],'transferercalleridnum':_0x12cc1c[_0x28b3('0x5')],'transferercalleridname':_0x12cc1c[_0x28b3('0x6')],'transfererconnectedlinenum':_0x12cc1c[_0x28b3('0x7')],'transfererconnectedlinename':_0x12cc1c[_0x28b3('0x8')],'transfereraccountcode':_0x12cc1c[_0x28b3('0x9')],'transferercontext':_0x12cc1c['transferercontext'],'transfererexten':_0x12cc1c[_0x28b3('0xa')],'transfererlinkedid':_0x12cc1c[_0x28b3('0xb')],'transfereechannel':_0x12cc1c[_0x28b3('0xc')],'transfereecalleridnum':_0x12cc1c[_0x28b3('0xd')],'transfereecalleridname':_0x12cc1c[_0x28b3('0xe')],'transfereeconnectedlinenum':_0x12cc1c[_0x28b3('0xf')],'transfereeconnectedlinename':_0x12cc1c['transfereeconnectedlinename'],'transfereeaccountcode':_0x12cc1c[_0x28b3('0x10')],'transfereecontext':_0x12cc1c[_0x28b3('0x11')],'transfereeexten':_0x12cc1c['transfereeexten'],'transfereelinkedid':_0x12cc1c['transfereelinkedid'],'isexternal':_0x12cc1c[_0x28b3('0x12')],'context':_0x12cc1c[_0x28b3('0x13')],'extension':_0x12cc1c['extension'],'type':_0x28b3('0x14')},'log':'CreateVoiceTransferReport'});};exports[_0x28b3('0x15')]=function(_0x2f90ec){return client['Request'](_0x28b3('0x16'),{'body':{'result':_0x2f90ec['result'],'transfererchannel':_0x2f90ec[_0x28b3('0x17')],'transferercalleridnum':_0x2f90ec['origtransferercalleridnum'],'transferercalleridname':_0x2f90ec[_0x28b3('0x18')],'transfererconnectedlinenum':_0x2f90ec['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x2f90ec[_0x28b3('0x19')],'transfereraccountcode':_0x2f90ec[_0x28b3('0x1a')],'transferercontext':_0x2f90ec[_0x28b3('0x1b')],'transfererexten':_0x2f90ec['secondtransfererexten'],'transfererlinkedid':_0x2f90ec['origtransfererlinkedid'],'transfereechannel':_0x2f90ec[_0x28b3('0x1c')],'transfereecalleridnum':_0x2f90ec[_0x28b3('0x1d')],'transfereecalleridname':_0x2f90ec[_0x28b3('0x1e')],'transfereeconnectedlinenum':_0x2f90ec[_0x28b3('0x1f')],'transfereeconnectedlinename':_0x2f90ec['transfertargetconnectedlinename'],'transfereeaccountcode':_0x2f90ec[_0x28b3('0x20')],'transfereecontext':_0x2f90ec[_0x28b3('0x21')],'transfereeexten':_0x2f90ec['transfertargetexten'],'transfereelinkedid':_0x2f90ec['transfertargetlinkedid'],'isexternal':_0x2f90ec[_0x28b3('0x12')],'context':_0x2f90ec[_0x28b3('0x22')],'extension':_0x2f90ec['origtransfererexten'],'type':'attended'},'log':_0x28b3('0x16')});}; \ No newline at end of file +var _0x828b=['transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','attendedTransfer','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetexten','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transferercalleridnum','transfererconnectedlinenum','transfereraccountcode','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename'];(function(_0x10ef35,_0x562adf){var _0x32fe76=function(_0x3deea6){while(--_0x3deea6){_0x10ef35['push'](_0x10ef35['shift']());}};_0x32fe76(++_0x562adf);}(_0x828b,0x101));var _0xb828=function(_0x2cacef,_0xba1573){_0x2cacef=_0x2cacef-0x0;var _0x289ba6=_0x828b[_0x2cacef];return _0x289ba6;};'use strict';var client=require(_0xb828('0x0'));exports[_0xb828('0x1')]={};exports[_0xb828('0x2')]=function(_0x5ed90d){return client[_0xb828('0x3')](_0xb828('0x4'),{'body':{'result':_0x5ed90d[_0xb828('0x5')],'transfererchannel':_0x5ed90d['transfererchannel'],'transferercalleridnum':_0x5ed90d[_0xb828('0x6')],'transferercalleridname':_0x5ed90d['transferercalleridname'],'transfererconnectedlinenum':_0x5ed90d[_0xb828('0x7')],'transfererconnectedlinename':_0x5ed90d['transfererconnectedlinename'],'transfereraccountcode':_0x5ed90d[_0xb828('0x8')],'transferercontext':_0x5ed90d['transferercontext'],'transfererexten':_0x5ed90d[_0xb828('0x9')],'transfererlinkedid':_0x5ed90d[_0xb828('0xa')],'transfereechannel':_0x5ed90d[_0xb828('0xb')],'transfereecalleridnum':_0x5ed90d[_0xb828('0xc')],'transfereecalleridname':_0x5ed90d[_0xb828('0xd')],'transfereeconnectedlinenum':_0x5ed90d[_0xb828('0xe')],'transfereeconnectedlinename':_0x5ed90d[_0xb828('0xf')],'transfereeaccountcode':_0x5ed90d['transfereeaccountcode'],'transfereecontext':_0x5ed90d[_0xb828('0x10')],'transfereeexten':_0x5ed90d[_0xb828('0x11')],'transfereelinkedid':_0x5ed90d[_0xb828('0x12')],'isexternal':_0x5ed90d[_0xb828('0x13')],'context':_0x5ed90d[_0xb828('0x14')],'extension':_0x5ed90d[_0xb828('0x15')],'type':'blind'},'log':'CreateVoiceTransferReport'});};exports[_0xb828('0x16')]=function(_0x3c76ce){return client['Request'](_0xb828('0x4'),{'body':{'result':_0x3c76ce[_0xb828('0x5')],'transfererchannel':_0x3c76ce[_0xb828('0x17')],'transferercalleridnum':_0x3c76ce['origtransferercalleridnum'],'transferercalleridname':_0x3c76ce[_0xb828('0x18')],'transfererconnectedlinenum':_0x3c76ce[_0xb828('0x19')],'transfererconnectedlinename':_0x3c76ce[_0xb828('0x1a')],'transfereraccountcode':_0x3c76ce[_0xb828('0x1b')],'transferercontext':_0x3c76ce[_0xb828('0x1c')],'transfererexten':_0x3c76ce[_0xb828('0x1d')],'transfererlinkedid':_0x3c76ce[_0xb828('0x1e')],'transfereechannel':_0x3c76ce[_0xb828('0x1f')],'transfereecalleridnum':_0x3c76ce[_0xb828('0x20')],'transfereecalleridname':_0x3c76ce['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x3c76ce[_0xb828('0x21')],'transfereeconnectedlinename':_0x3c76ce[_0xb828('0x22')],'transfereeaccountcode':_0x3c76ce['transfertargetaccountcode'],'transfereecontext':_0x3c76ce['transfertargetcontext'],'transfereeexten':_0x3c76ce[_0xb828('0x23')],'transfereelinkedid':_0x3c76ce['transfertargetlinkedid'],'isexternal':_0x3c76ce[_0xb828('0x13')],'context':_0x3c76ce[_0xb828('0x24')],'extension':_0x3c76ce[_0xb828('0x25')],'type':_0xb828('0x26')},'log':_0xb828('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 84f9a36..0209be4 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 _0x7524=['outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','push','length','find','undefined','values','voicechannel','validate','map','channels','filename','uniqueid','wav','MixMonitor','channel','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','StopMixMonitor','destinationchannel','stop','%s.%s','StopMixMonitor\x20Success','queueChannels','Hangup','context','telephones','trunks','campaigns','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','checkAfterSend','server','listen','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','util','jayson/promise','bluebird','moment','../ami','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','asterisk','username','ami\x20disconnected','join','pick','keys','action','Reload','then','message','catch','error','command','Action','content','voiceQueues','strategy','answered','available','loggedIn','pTalking','sumBillable','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay'];(function(_0x5362e2,_0x166612){var _0x29e61b=function(_0x4dfb6c){while(--_0x4dfb6c){_0x5362e2['push'](_0x5362e2['shift']());}};_0x29e61b(++_0x166612);}(_0x7524,0xce));var _0x4752=function(_0xb6918e,_0x2d86d8){_0xb6918e=_0xb6918e-0x0;var _0x3a360f=_0x7524[_0xb6918e];return _0x3a360f;};'use strict';var _=require('lodash');var util=require(_0x4752('0x0'));var jayson=require(_0x4752('0x1'));var schema=require('validate');var BPromise=require(_0x4752('0x2'));var moment=require(_0x4752('0x3'));var config=require('../../../config/environment');var properties=require('../properties');var ami=require(_0x4752('0x4'));exports['listen']=function(_0x3884b9,_0x307267,_0x66a421){return new BPromise(function(_0x55b411,_0x104962){var _0x5b98c0={'QueuePause':function(_0x1e76cf){return new Promise(function(_0x1cbf34,_0x59477c){var _0x5db15c=util[_0x4752('0x5')](_0x4752('0x6'),_0x4752('0x7'),_0x1e76cf[_0x4752('0x8')]);if(_0x3884b9['timers']&&_0x3884b9[_0x4752('0x9')][_0x5db15c]&&_0x3884b9[_0x4752('0x9')][_0x5db15c][_0x4752('0xa')]){_0x3884b9[_0x4752('0x9')][_0x5db15c][_0x4752('0xb')]();}if(_0x3884b9['agents'][_0x5db15c]){_0x3884b9[_0x4752('0xc')][_0x5db15c][_0x4752('0xd')]({'statePause':_0x1e76cf[_0x4752('0xe')]?!![]:![]});}_0x1cbf34({'code':0xc8,'message':_0x4752('0xf')});});},'Reload':function(_0xe6023b){var _0x7c7890=this;return new Promise(function(_0xcee47,_0x505d48){if(ami[_0x4752('0x10')]()==![]){return _0x505d48(_0x7c7890['error'](0x1f4,[config[_0x4752('0x11')]['ip'],config[_0x4752('0x11')][_0x4752('0x12')],_0x4752('0x13')][_0x4752('0x14')]('\x20')));}_0xe6023b=_[_0x4752('0x15')](_0xe6023b,_[_0x4752('0x16')](properties['module']));_0xe6023b[_0x4752('0x17')]=_0x4752('0x18');return ami['Action'](_0xe6023b)[_0x4752('0x19')](function(_0x4b3088){_0xcee47({'code':0xc8,'message':_0x4b3088[_0x4752('0x1a')]});})[_0x4752('0x1b')](function(_0x516f3e){_0x505d48(_0x7c7890[_0x4752('0x1c')](0x1f5,_0x516f3e['message']));});});},'Command':function(_0x525176){var _0x285688=this;return new Promise(function(_0x4444e5,_0x3374d4){if(ami[_0x4752('0x10')]()==![]){return _0x3374d4(_0x285688[_0x4752('0x1c')](0x1f4,[config[_0x4752('0x11')]['ip'],config['asterisk'][_0x4752('0x12')],_0x4752('0x13')][_0x4752('0x14')]('\x20')));}_0x525176=_[_0x4752('0x15')](_0x525176,_0x4752('0x1d'));_0x525176[_0x4752('0x17')]='Command';return ami[_0x4752('0x1e')](_0x525176)[_0x4752('0x19')](function(_0x54a0bd){_0x4444e5({'code':0xc8,'message':_0x54a0bd[_0x4752('0x1f')]});})[_0x4752('0x1b')](function(_0x1e4e86){_0x3374d4(_0x285688[_0x4752('0x1c')](0x1f5,_0x1e4e86[_0x4752('0x1a')]));});});},'VoiceQueues':function(_0x26c332){return new Promise(function(_0x1135bf,_0x45c557){var _0xca8dd1=[];for(var _0x2c259a in _0x3884b9['voiceQueues']){if(_0x3884b9[_0x4752('0x20')]['hasOwnProperty'](_0x2c259a)){var _0x4b2635=_0x3884b9['voiceQueues'][_0x2c259a];var _0x1dcdcd={'id':_0x4b2635['id'],'name':_0x4b2635[_0x4752('0x8')],'strategy':_0x4b2635[_0x4752('0x21')],'answered':_0x4b2635[_0x4752('0x22')],'available':_0x4b2635[_0x4752('0x23')],'loggedIn':_0x4b2635[_0x4752('0x24')],'pTalking':_0x4b2635[_0x4752('0x25')],'sumBillable':_0x4b2635[_0x4752('0x26')],'sumDuration':_0x4b2635['sumDuration'],'sumHoldTime':_0x4b2635['sumHoldTime']||0x0,'talking':_0x4b2635[_0x4752('0x27')],'total':_0x4b2635[_0x4752('0x28')],'type':_0x4b2635[_0x4752('0x29')],'unmanaged':_0x4b2635[_0x4752('0x2a')],'abandoned':_0x4b2635[_0x4752('0x2b')],'waiting':_0x4b2635[_0x4752('0x2c')],'loggedInDb':_0x4b2635[_0x4752('0x2d')]};if(_0x4b2635[_0x4752('0x29')]===_0x4752('0x2e')){_0x1dcdcd[_0x4752('0x2f')]=_0x4b2635[_0x4752('0x2f')];_0x1dcdcd[_0x4752('0x30')]=_0x4b2635[_0x4752('0x30')];_0x1dcdcd[_0x4752('0x31')]=_0x4b2635[_0x4752('0x31')];_0x1dcdcd[_0x4752('0x32')]=_0x4b2635['dialOriginateCallerIdNumber'];_0x1dcdcd['dialOriginateTimeout']=_0x4b2635[_0x4752('0x33')];_0x1dcdcd[_0x4752('0x34')]=_0x4b2635[_0x4752('0x34')];_0x1dcdcd[_0x4752('0x35')]=_0x4b2635[_0x4752('0x35')];_0x1dcdcd[_0x4752('0x36')]=_0x4b2635[_0x4752('0x36')];_0x1dcdcd[_0x4752('0x37')]=_0x4b2635[_0x4752('0x37')];_0x1dcdcd[_0x4752('0x38')]=_0x4b2635['outboundBlacklistCallsDay'];_0x1dcdcd[_0x4752('0x39')]=_0x4b2635['outboundBusyCallsDay'];_0x1dcdcd[_0x4752('0x3a')]=_0x4b2635[_0x4752('0x3a')];_0x1dcdcd[_0x4752('0x3b')]=_0x4b2635[_0x4752('0x3b')];_0x1dcdcd[_0x4752('0x3c')]=_0x4b2635['outboundDropCallsDayCallersExit'];_0x1dcdcd[_0x4752('0x3d')]=_0x4b2635['outboundDropCallsDayTimeout'];_0x1dcdcd[_0x4752('0x3e')]=_0x4b2635[_0x4752('0x3e')];_0x1dcdcd[_0x4752('0x3f')]=_0x4b2635[_0x4752('0x3f')];_0x1dcdcd[_0x4752('0x40')]=_0x4b2635[_0x4752('0x40')];_0x1dcdcd[_0x4752('0x41')]=_0x4b2635[_0x4752('0x41')];_0x1dcdcd[_0x4752('0x42')]=_0x4b2635[_0x4752('0x42')];_0x1dcdcd['outboundUnknownCallsDay']=_0x4b2635[_0x4752('0x43')];_0x1dcdcd[_0x4752('0x44')]=_0x4b2635[_0x4752('0x44')];_0x1dcdcd[_0x4752('0x45')]=_0x4b2635[_0x4752('0x45')];_0x1dcdcd[_0x4752('0x46')]=_0x4b2635[_0x4752('0x46')];_0x1dcdcd[_0x4752('0x47')]=_0x4b2635['predictiveIntervalDroppedCallsCallersExit'];_0x1dcdcd[_0x4752('0x48')]=_0x4b2635['predictiveIntervalDroppedCallsTimeout'];_0x1dcdcd[_0x4752('0x49')]=_0x4b2635[_0x4752('0x49')];_0x1dcdcd[_0x4752('0x4a')]=_0x4b2635[_0x4752('0x4a')];_0x1dcdcd['predictiveIntervalHitRate']=_0x4b2635['predictiveIntervalHitRate'];_0x1dcdcd['predictiveIntervalMultiplicativeFactor']=_0x4b2635['predictiveIntervalMultiplicativeFactor'];_0x1dcdcd[_0x4752('0x4b')]=_0x4b2635[_0x4752('0x4b')];_0x1dcdcd['predictiveIntervalAvailable']=_0x4b2635[_0x4752('0x4c')];_0x1dcdcd[_0x4752('0x4d')]=_0x4b2635[_0x4752('0x4d')];_0x1dcdcd['message']=_0x4b2635[_0x4752('0x1a')];_0x1dcdcd[_0x4752('0x4e')]=_0x4b2635[_0x4752('0x4e')];_0x1dcdcd[_0x4752('0x4f')]=_0x4b2635[_0x4752('0x4f')];_0x1dcdcd['erlangCallToSecond']=_0x4b2635['erlangCallToSecond'];_0x1dcdcd[_0x4752('0x50')]=_0x4b2635[_0x4752('0x50')];_0x1dcdcd[_0x4752('0x51')]=_0x4b2635[_0x4752('0x51')];_0x1dcdcd[_0x4752('0x52')]=_0x4b2635[_0x4752('0x52')];_0x1dcdcd[_0x4752('0x53')]=_0x4b2635[_0x4752('0x53')];}if(_0x4b2635[_0x4752('0x54')]){_0x1dcdcd[_0x4752('0x54')]={'id':_0x4b2635[_0x4752('0x54')]['id'],'name':_0x4b2635[_0x4752('0x54')]['name'],'active':_0x4b2635[_0x4752('0x54')]['active'],'callerid':_0x4b2635[_0x4752('0x54')][_0x4752('0x55')]};}if(_0x4b2635['Interval']){_0x1dcdcd[_0x4752('0x56')]={'id':_0x4b2635[_0x4752('0x56')]['id'],'name':_0x4b2635[_0x4752('0x56')][_0x4752('0x8')]};}_0xca8dd1[_0x4752('0x57')](_0x1dcdcd);}}_0x1135bf({'count':_0xca8dd1[_0x4752('0x58')],'rows':_0xca8dd1});});},'UpdateVoiceQueue':function(_0x49afcc){return new Promise(function(_0x1a3092,_0x198f9d){var _0x3a78b2=_[_0x4752('0x59')](_0x3884b9[_0x4752('0x20')],{'id':parseInt(_0x49afcc['id'])});var _0xec3a1e=_['omit'](_0x49afcc,['id']);if(_0x3a78b2){for(var _0x1733ed in _0xec3a1e){if(typeof _0xec3a1e[_0x1733ed]!==_0x4752('0x5a')&&typeof _0x3a78b2[_0x1733ed]!==_0x4752('0x5a')){_0x3a78b2[_0x1733ed]=_0xec3a1e[_0x1733ed];}}_0x1a3092(_0x3a78b2);}else{_0x198f9d();}});},'VoiceChannels':function(_0x2b0dfb){return new Promise(function(_0x2aed07,_0x33fc2c){var _0x47d096=_[_0x4752('0x5b')](_0x3884b9['channels']);_0x2aed07({'count':_0x47d096['length'],'rows':_0x47d096});});},'VoiceChannelMixMonitor':function(_0x965429){var _0x234220=this;return new Promise(function(_0x424ca4,_0x4bcd96){if(ami[_0x4752('0x10')]()==![]){return _0x4bcd96(_0x234220[_0x4752('0x1c')](0x1f4,[config['asterisk']['ip'],config[_0x4752('0x11')][_0x4752('0x12')],_0x4752('0x13')]['join']('\x20')));}var _0x2ba24b=schema(properties[_0x4752('0x5c')])[_0x4752('0x5d')](_0x965429);if(_0x2ba24b[_0x4752('0x58')]>0x0){return _0x4bcd96(_0x234220[_0x4752('0x1c')](0x1f4,_[_0x4752('0x5e')](_0x2ba24b,'message')[_0x4752('0x14')](',\x20')));}var _0x5ac67f=_[_0x4752('0x59')](_0x3884b9[_0x4752('0x5f')],{'uniqueid':_0x965429['uniqueid']});if(_0x5ac67f&&_0x5ac67f['channel']){var _0x542e30=util['format']('%s.%s',_0x965429[_0x4752('0x60')]||_0x965429[_0x4752('0x61')],_0x965429[_0x4752('0x5')]||_0x4752('0x62'));return ami['Action']({'action':_0x4752('0x63'),'channel':_0x5ac67f[_0x4752('0x64')],'file':_0x542e30,'options':_0x4752('0x65')})[_0x4752('0x19')](function(_0x1f98a5){var _0x597d7c=_[_0x4752('0x59')](_0x5ac67f[_0x4752('0x66')],{'filename':_0x4752('0x67')+_0x542e30[_0x4752('0x68')]()});if(_[_0x4752('0x69')](_0x597d7c)){_0x5ac67f[_0x4752('0x66')]['push']({'filename':_0x4752('0x67')+_0x542e30[_0x4752('0x68')](),'createdAt':moment()['format'](_0x4752('0x6a')),'mixmonitorid':_0x1f98a5[_0x4752('0x6b')],'status':_0x4752('0x6c')});}else{_0x597d7c[_0x4752('0x6b')]=_0x1f98a5[_0x4752('0x6b')];_0x597d7c[_0x4752('0x6d')]=_0x4752('0x6c');}_0x424ca4({'code':0xc8,'message':[_0x965429[_0x4752('0x61')],_0x4752('0x6e'),_0x1f98a5[_0x4752('0x6b')]]['join']('\x20'),'mixmonitorid':_0x1f98a5['mixmonitorid']});})[_0x4752('0x1b')](function(_0x15bb22){_0x4bcd96(_0x234220[_0x4752('0x1c')](0x1f5,[_0x965429[_0x4752('0x61')],_0x15bb22[_0x4752('0x1a')][_0x4752('0x68')]()]['join']('\x20')));});}else{return _0x4bcd96(_0x234220[_0x4752('0x1c')](0x1f5,_0x4752('0x6f')));}});},'VoiceChannelStopMixMonitor':function(_0x3315eb){var _0x24d20d=this;return new Promise(function(_0x182fca,_0x17b34b){if(ami[_0x4752('0x10')]()==![]){return _0x17b34b(_0x24d20d[_0x4752('0x1c')](0x1f4,[config[_0x4752('0x11')]['ip'],config[_0x4752('0x11')]['username'],_0x4752('0x13')][_0x4752('0x14')]('\x20')));}var _0x3fffb4=schema(properties[_0x4752('0x5c')])[_0x4752('0x5d')](_0x3315eb);if(_0x3fffb4[_0x4752('0x58')]>0x0){return _0x17b34b(_0x24d20d[_0x4752('0x1c')](0x1f4,_[_0x4752('0x5e')](_0x3fffb4,'message')[_0x4752('0x14')](',\x20')));}var _0x164e8c=_['find'](_0x3884b9[_0x4752('0x5f')],{'uniqueid':_0x3315eb[_0x4752('0x61')]});if(_0x164e8c){return BPromise['resolve']()[_0x4752('0x19')](function(){if(_0x164e8c[_0x4752('0x64')]){return ami[_0x4752('0x1e')]({'action':'StopMixMonitor','channel':_0x164e8c[_0x4752('0x64')],'mixmonitorid':_0x3315eb[_0x4752('0x6b')]})[_0x4752('0x1b')](function(_0x379859){});}})['then'](function(){if(_0x164e8c['destinationchannel']){return ami[_0x4752('0x1e')]({'action':_0x4752('0x70'),'channel':_0x164e8c[_0x4752('0x71')],'mixmonitorid':_0x3315eb[_0x4752('0x6b')]})[_0x4752('0x1b')](function(_0x335e89){});}})[_0x4752('0x19')](function(_0x1470f2){var _0x13fafa=_[_0x4752('0x59')](_0x164e8c[_0x4752('0x66')],{'mixmonitorid':_0x3315eb[_0x4752('0x6b')]});if(_0x13fafa){_0x13fafa[_0x4752('0x6d')]=_0x4752('0x72');}})['then'](function(){var _0x1ac662=util[_0x4752('0x5')](_0x4752('0x73'),_0x3315eb[_0x4752('0x60')]||_0x3315eb['uniqueid'],_0x3315eb[_0x4752('0x5')]||'wav');var _0x2645e9=_[_0x4752('0x59')](_0x164e8c['monitors'],{'filename':_0x4752('0x67')+_0x1ac662[_0x4752('0x68')]()});if(_0x2645e9){_0x2645e9[_0x4752('0x6d')]=_0x4752('0x72');}})[_0x4752('0x19')](function(){_0x182fca({'code':0xc8,'message':[_0x3315eb[_0x4752('0x61')],_0x4752('0x74')][_0x4752('0x14')]('\x20')});})[_0x4752('0x1b')](function(_0x126210){_0x17b34b(_0x24d20d['error'](0x1f5,[_0x3315eb[_0x4752('0x61')],_0x126210[_0x4752('0x1a')][_0x4752('0x68')]()][_0x4752('0x14')]('\x20')));});}else{return _0x17b34b(_0x24d20d['error'](0x1f5,_0x4752('0x6f')));}});},'VoiceQueuesChannels':function(_0x566506){return new Promise(function(_0x19f7cb,_0x360ebf){var _0x52605d=_[_0x4752('0x5b')](_0x3884b9[_0x4752('0x75')]);_0x19f7cb({'count':_0x52605d[_0x4752('0x58')],'rows':_0x52605d});});},'VoiceQueuesChannel':function(_0x545c23){var _0x51d261=this;return new Promise(function(_0x4bd05d,_0x1f1aa8){var _0x26ed2d=schema(properties['voicequeuechannel'])['validate'](_0x545c23);if(_0x26ed2d[_0x4752('0x58')]>0x0){return _0x1f1aa8(_0x51d261[_0x4752('0x1c')](0x1f4,_[_0x4752('0x5e')](_0x26ed2d,_0x4752('0x1a'))[_0x4752('0x14')](',\x20')));}var _0x251d0e=_[_0x4752('0x59')](_0x3884b9[_0x4752('0x75')],{'uniqueid':_0x545c23[_0x4752('0x61')]});if(_0x251d0e){_0x4bd05d(_0x251d0e);}else{return _0x1f1aa8(_0x51d261[_0x4752('0x1c')](0x1f5,_0x4752('0x6f')));}});},'VoiceQueuesChannelHangup':function(_0x114ec6){var _0x21a5be=this;return new Promise(function(_0x16c348,_0x3f40a3){if(ami['isConnected']()==![]){return _0x3f40a3(_0x21a5be[_0x4752('0x1c')](0x1f4,[config[_0x4752('0x11')]['ip'],config[_0x4752('0x11')][_0x4752('0x12')],_0x4752('0x13')][_0x4752('0x14')]('\x20')));}var _0x5787b2=schema(properties['voicequeuechannelhangup'])[_0x4752('0x5d')](_0x114ec6);if(_0x5787b2[_0x4752('0x58')]>0x0){return _0x3f40a3(_0x21a5be[_0x4752('0x1c')](0x1f4,_[_0x4752('0x5e')](_0x5787b2,_0x4752('0x1a'))['join'](',\x20')));}var _0x10a7ee=_[_0x4752('0x59')](_0x3884b9[_0x4752('0x75')],{'uniqueid':_0x114ec6[_0x4752('0x61')]});if(_0x10a7ee&&_0x10a7ee[_0x4752('0x64')]){return ami[_0x4752('0x1e')]({'action':_0x4752('0x76'),'channel':_0x10a7ee[_0x4752('0x64')]})[_0x4752('0x19')](function(_0x30a8c5){_0x16c348({'code':0xc8,'message':[_0x114ec6[_0x4752('0x61')],_0x30a8c5['message']['toLowerCase']()][_0x4752('0x14')]('\x20')});})[_0x4752('0x1b')](function(_0x2abb9f){_0x3f40a3(_0x21a5be[_0x4752('0x1c')](0x1f5,[_0x114ec6[_0x4752('0x61')],_0x2abb9f[_0x4752('0x1a')]['toLowerCase']()][_0x4752('0x14')]('\x20')));});}else{return _0x3f40a3(_0x21a5be[_0x4752('0x1c')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x45291f){var _0x20869f=this;return new Promise(function(_0x5180bd,_0x35f1d8){if(ami[_0x4752('0x10')]()==![]){return _0x35f1d8(_0x20869f['error'](0x1f4,[config['asterisk']['ip'],config[_0x4752('0x11')][_0x4752('0x12')],'ami\x20disconnected'][_0x4752('0x14')]('\x20')));}var _0xb5d141=schema(properties['voicequeuechannelredirect'])['validate'](_0x45291f);if(_0xb5d141[_0x4752('0x58')]>0x0){return _0x35f1d8(_0x20869f['error'](0x1f4,_[_0x4752('0x5e')](_0xb5d141,_0x4752('0x1a'))[_0x4752('0x14')](',\x20')));}var _0x223de7=_['find'](_0x3884b9[_0x4752('0x75')],{'uniqueid':_0x45291f[_0x4752('0x61')]});if(_0x223de7&&_0x223de7['channel']){return ami['Action']({'action':'Redirect','channel':_0x223de7[_0x4752('0x64')],'exten':_0x45291f['exten'],'context':_0x45291f[_0x4752('0x77')]||_0x223de7[_0x4752('0x77')],'priority':0x1})[_0x4752('0x19')](function(_0x90f5cd){_0x5180bd({'code':0xc8,'message':[_0x45291f[_0x4752('0x61')],_0x90f5cd[_0x4752('0x1a')][_0x4752('0x68')]()][_0x4752('0x14')]('\x20')});})[_0x4752('0x1b')](function(_0xb5e3e9){_0x35f1d8(_0x20869f[_0x4752('0x1c')](0x1f5,[_0x45291f['uniqueid'],_0xb5e3e9[_0x4752('0x1a')][_0x4752('0x68')]()][_0x4752('0x14')]('\x20')));});}else{return _0x35f1d8(_0x20869f['error'](0x1f5,_0x4752('0x6f')));}});},'Agents':function(_0x476569){return new Promise(function(_0x20da9c,_0x57c7e1){var _0x17a03d=_['values'](_0x3884b9[_0x4752('0xc')]);_0x20da9c({'count':_0x17a03d[_0x4752('0x58')],'rows':_0x17a03d});});},'Telephones':function(_0x159724){return new Promise(function(_0x2aa5fd,_0x52c216){var _0x59f379=_[_0x4752('0x5b')](_0x3884b9[_0x4752('0x78')]);_0x2aa5fd({'count':_0x59f379[_0x4752('0x58')],'rows':_0x59f379});});},'Trunks':function(_0x1a2e13){return new Promise(function(_0x5428f3,_0x12d59c){var _0x124042=_[_0x4752('0x5b')](_0x3884b9[_0x4752('0x79')]);_0x5428f3({'count':_0x124042[_0x4752('0x58')],'rows':_0x124042});});},'OutboundChannels':function(_0xabd6bb){return new Promise(function(_0x58e755,_0x38596b){var _0x2384c7=_[_0x4752('0x5b')](_0x3884b9['outboundChannels']);_0x58e755({'count':_0x2384c7[_0x4752('0x58')],'rows':_0x2384c7});});},'Outbound':function(_0x537702){return new Promise(function(_0x41552c,_0x375360){_0x41552c(_0x3884b9[_0x4752('0x2e')]);});},'Campaigns':function(_0x32e20d){return new Promise(function(_0x5c165d,_0x4493b1){var _0x549b86=_['values'](_0x3884b9[_0x4752('0x7a')]);_0x5c165d({'count':_0x549b86[_0x4752('0x58')],'rows':_0x549b86});});},'VoiceQueuesPreview':function(_0x1e0804){var _0x48b1da=this;return new Promise(function(_0x369e81,_0x116022){_0x307267['run'](_0x1e0804['id'])['then'](function(_0x3aff09){_0x369e81({'code':0xc8,'message':_0x3aff09[_0x4752('0x1a')]});})[_0x4752('0x1b')](function(_0x389017){_0x116022(_0x48b1da[_0x4752('0x1c')](0x1f4,_0x389017['message']));});});},'EventManager':function(_0x128686){var _0x52022a=this;return new Promise(function(_0x386d4b,_0xa2de54){if(!_0x128686[_0x4752('0x7b')]){return _0xa2de54(_0x52022a[_0x4752('0x1c')](0x1f4,_0x4752('0x7c')));}ami[_0x4752('0x7d')](_0x4752('0x7e')+_0x128686[_0x4752('0x7b')],_0x128686[_0x4752('0x1a')]);_0x386d4b({'code':0xc8,'message':_0x128686});});},'FaxAccounts':function(_0x229132){return new Promise(function(_0x25cf3d,_0x2b1733){var _0x55e3fb=_[_0x4752('0x5b')](_0x3884b9[_0x4752('0x7f')]);_0x25cf3d({'count':_0x55e3fb[_0x4752('0x58')],'rows':_0x55e3fb});});},'SendFax':function(_0x24ad81){var _0x539b9b=this;return new Promise(function(_0xdb7ab0,_0xcc2c87){_0x66a421[_0x4752('0x80')](_0x24ad81)[_0x4752('0x19')](function(_0x39391d){_0xdb7ab0({'code':0xc8,'message':_0x39391d['message']});})[_0x4752('0x1b')](function(_0x3578f4){_0xcc2c87(_0x539b9b[_0x4752('0x1c')](0x1f4,_0x3578f4['message']));});});},'CheckAfterSend':function(_0x28098c){var _0x553eb6=this;return new Promise(function(_0x4bde22,_0x2cfdd5){_0x66a421[_0x4752('0x81')](_0x28098c)['then'](function(_0x2be73d){_0x4bde22({'code':0xc8,'message':_0x2be73d['message']});})[_0x4752('0x1b')](function(_0x48b39f){_0x2cfdd5(_0x553eb6[_0x4752('0x1c')](0x1f4,_0x48b39f[_0x4752('0x1a')]));});});}};var _0x189485=jayson[_0x4752('0x82')](_0x5b98c0)['http']();_0x189485['on']('error',function(_0x4ab6b9){return _0x104962(_0x4ab6b9);});_0x189485[_0x4752('0x83')](0x232a,_0x4752('0x84'),function(){console[_0x4752('0x85')](_0x4752('0x86'),0x232a);return _0x55b411('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file +var _0x11e5=['../properties','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','join','pick','keys','module','Reload','Action','then','message','ami\x20disconnected','command','action','Command','content','catch','voiceQueues','hasOwnProperty','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','total','abandoned','waiting','loggedInDb','type','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','find','omit','undefined','values','channels','voicechannel','map','channel','%s.%s','uniqueid','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','MixMonitor\x20Success','resolve','StopMixMonitor','destinationchannel','status','filename','stop','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','voicequeuechannel','queueChannels','Hangup','voicequeuechannelredirect','Redirect','exten','context','agents','telephones','trunks','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','send','server','http','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','moment','../../../config/environment'];(function(_0x483c1e,_0x1d99f0){var _0x210345=function(_0x188223){while(--_0x188223){_0x483c1e['push'](_0x483c1e['shift']());}};_0x210345(++_0x1d99f0);}(_0x11e5,0x8b));var _0x511e=function(_0x21ec08,_0x5a79f9){_0x21ec08=_0x21ec08-0x0;var _0x47c5fc=_0x11e5[_0x21ec08];return _0x47c5fc;};'use strict';var _=require(_0x511e('0x0'));var util=require('util');var jayson=require(_0x511e('0x1'));var schema=require(_0x511e('0x2'));var BPromise=require('bluebird');var moment=require(_0x511e('0x3'));var config=require(_0x511e('0x4'));var properties=require(_0x511e('0x5'));var ami=require('../ami');exports[_0x511e('0x6')]=function(_0x4fbd4f,_0x5923a7,_0x342539){return new BPromise(function(_0x323f8c,_0x466dec){var _0x57cac3={'QueuePause':function(_0x47cf56){return new Promise(function(_0x3ebc4b,_0xf0ba86){var _0x25deeb=util[_0x511e('0x7')](_0x511e('0x8'),_0x511e('0x9'),_0x47cf56[_0x511e('0xa')]);if(_0x4fbd4f[_0x511e('0xb')]&&_0x4fbd4f[_0x511e('0xb')][_0x25deeb]&&_0x4fbd4f[_0x511e('0xb')][_0x25deeb][_0x511e('0xc')]){_0x4fbd4f['timers'][_0x25deeb][_0x511e('0xd')]();}if(_0x4fbd4f['agents'][_0x25deeb]){_0x4fbd4f['agents'][_0x25deeb][_0x511e('0xe')]({'statePause':_0x47cf56[_0x511e('0xf')]?!![]:![]});}_0x3ebc4b({'code':0xc8,'message':_0x511e('0x10')});});},'Reload':function(_0x258e2f){var _0x464576=this;return new Promise(function(_0x7dc1bc,_0x4e72fd){if(ami[_0x511e('0x11')]()==![]){return _0x4e72fd(_0x464576[_0x511e('0x12')](0x1f4,[config['asterisk']['ip'],config[_0x511e('0x13')][_0x511e('0x14')],'ami\x20disconnected'][_0x511e('0x15')]('\x20')));}_0x258e2f=_[_0x511e('0x16')](_0x258e2f,_[_0x511e('0x17')](properties[_0x511e('0x18')]));_0x258e2f['action']=_0x511e('0x19');return ami[_0x511e('0x1a')](_0x258e2f)[_0x511e('0x1b')](function(_0x577616){_0x7dc1bc({'code':0xc8,'message':_0x577616[_0x511e('0x1c')]});})['catch'](function(_0x34e6cd){_0x4e72fd(_0x464576['error'](0x1f5,_0x34e6cd['message']));});});},'Command':function(_0x37ae92){var _0x5c4fb9=this;return new Promise(function(_0x33bef5,_0x325278){if(ami[_0x511e('0x11')]()==![]){return _0x325278(_0x5c4fb9[_0x511e('0x12')](0x1f4,[config[_0x511e('0x13')]['ip'],config[_0x511e('0x13')][_0x511e('0x14')],_0x511e('0x1d')]['join']('\x20')));}_0x37ae92=_[_0x511e('0x16')](_0x37ae92,_0x511e('0x1e'));_0x37ae92[_0x511e('0x1f')]=_0x511e('0x20');return ami[_0x511e('0x1a')](_0x37ae92)[_0x511e('0x1b')](function(_0x886b6){_0x33bef5({'code':0xc8,'message':_0x886b6[_0x511e('0x21')]});})[_0x511e('0x22')](function(_0x26618d){_0x325278(_0x5c4fb9['error'](0x1f5,_0x26618d['message']));});});},'VoiceQueues':function(_0x3e1711){return new Promise(function(_0x4d94a1,_0x1ff5c4){var _0x53017d=[];for(var _0x3fbd19 in _0x4fbd4f[_0x511e('0x23')]){if(_0x4fbd4f[_0x511e('0x23')][_0x511e('0x24')](_0x3fbd19)){var _0x1bb7f9=_0x4fbd4f[_0x511e('0x23')][_0x3fbd19];var _0x3c057c={'id':_0x1bb7f9['id'],'name':_0x1bb7f9[_0x511e('0xa')],'strategy':_0x1bb7f9[_0x511e('0x25')],'answered':_0x1bb7f9[_0x511e('0x26')],'available':_0x1bb7f9['available'],'loggedIn':_0x1bb7f9[_0x511e('0x27')],'pTalking':_0x1bb7f9[_0x511e('0x28')],'sumBillable':_0x1bb7f9[_0x511e('0x29')],'sumDuration':_0x1bb7f9[_0x511e('0x2a')],'sumHoldTime':_0x1bb7f9[_0x511e('0x2b')]||0x0,'talking':_0x1bb7f9['talking'],'total':_0x1bb7f9[_0x511e('0x2c')],'type':_0x1bb7f9['type'],'unmanaged':_0x1bb7f9['unmanaged'],'abandoned':_0x1bb7f9[_0x511e('0x2d')],'waiting':_0x1bb7f9[_0x511e('0x2e')],'loggedInDb':_0x1bb7f9[_0x511e('0x2f')]};if(_0x1bb7f9[_0x511e('0x30')]===_0x511e('0x31')){_0x3c057c['dialActive']=_0x1bb7f9[_0x511e('0x32')];_0x3c057c[_0x511e('0x33')]=_0x1bb7f9[_0x511e('0x33')];_0x3c057c[_0x511e('0x34')]=_0x1bb7f9[_0x511e('0x34')];_0x3c057c['dialOriginateCallerIdNumber']=_0x1bb7f9[_0x511e('0x35')];_0x3c057c[_0x511e('0x36')]=_0x1bb7f9[_0x511e('0x36')];_0x3c057c[_0x511e('0x37')]=_0x1bb7f9[_0x511e('0x37')];_0x3c057c[_0x511e('0x38')]=_0x1bb7f9[_0x511e('0x38')];_0x3c057c[_0x511e('0x39')]=_0x1bb7f9['outboundAnswerAgiCallsDay'];_0x3c057c[_0x511e('0x3a')]=_0x1bb7f9[_0x511e('0x3a')];_0x3c057c[_0x511e('0x3b')]=_0x1bb7f9[_0x511e('0x3b')];_0x3c057c['outboundBusyCallsDay']=_0x1bb7f9['outboundBusyCallsDay'];_0x3c057c[_0x511e('0x3c')]=_0x1bb7f9['outboundCongestionCallsDay'];_0x3c057c['outboundDropCallsDayACS']=_0x1bb7f9[_0x511e('0x3d')];_0x3c057c[_0x511e('0x3e')]=_0x1bb7f9[_0x511e('0x3e')];_0x3c057c[_0x511e('0x3f')]=_0x1bb7f9[_0x511e('0x3f')];_0x3c057c['outboundNoAnswerCallsDay']=_0x1bb7f9[_0x511e('0x40')];_0x3c057c[_0x511e('0x41')]=_0x1bb7f9[_0x511e('0x41')];_0x3c057c['outboundOriginateFailureCallsDay']=_0x1bb7f9[_0x511e('0x42')];_0x3c057c[_0x511e('0x43')]=_0x1bb7f9[_0x511e('0x43')];_0x3c057c['outboundRejectCallsDay']=_0x1bb7f9[_0x511e('0x44')];_0x3c057c[_0x511e('0x45')]=_0x1bb7f9['outboundUnknownCallsDay'];_0x3c057c[_0x511e('0x46')]=_0x1bb7f9[_0x511e('0x46')];_0x3c057c[_0x511e('0x47')]=_0x1bb7f9[_0x511e('0x47')];_0x3c057c[_0x511e('0x48')]=_0x1bb7f9[_0x511e('0x48')];_0x3c057c[_0x511e('0x49')]=_0x1bb7f9[_0x511e('0x49')];_0x3c057c[_0x511e('0x4a')]=_0x1bb7f9[_0x511e('0x4a')];_0x3c057c[_0x511e('0x4b')]=_0x1bb7f9['predictiveIntervalErlangCalls'];_0x3c057c[_0x511e('0x4c')]=_0x1bb7f9['predictiveIntervalErlangCallsDroppedCalls'];_0x3c057c['predictiveIntervalHitRate']=_0x1bb7f9[_0x511e('0x4d')];_0x3c057c['predictiveIntervalMultiplicativeFactor']=_0x1bb7f9['predictiveIntervalMultiplicativeFactor'];_0x3c057c[_0x511e('0x4e')]=_0x1bb7f9[_0x511e('0x4e')];_0x3c057c[_0x511e('0x4f')]=_0x1bb7f9[_0x511e('0x4f')];_0x3c057c[_0x511e('0x50')]=_0x1bb7f9[_0x511e('0x50')];_0x3c057c[_0x511e('0x1c')]=_0x1bb7f9[_0x511e('0x1c')];_0x3c057c[_0x511e('0x51')]=_0x1bb7f9[_0x511e('0x51')];_0x3c057c[_0x511e('0x52')]=_0x1bb7f9[_0x511e('0x52')];_0x3c057c[_0x511e('0x53')]=_0x1bb7f9[_0x511e('0x53')];_0x3c057c['erlangAbandonmentRate']=_0x1bb7f9['erlangAbandonmentRate'];_0x3c057c[_0x511e('0x54')]=_0x1bb7f9[_0x511e('0x54')];_0x3c057c[_0x511e('0x55')]=_0x1bb7f9[_0x511e('0x55')];_0x3c057c[_0x511e('0x56')]=_0x1bb7f9['startProgressive'];}if(_0x1bb7f9[_0x511e('0x57')]){_0x3c057c[_0x511e('0x57')]={'id':_0x1bb7f9[_0x511e('0x57')]['id'],'name':_0x1bb7f9['Trunk']['name'],'active':_0x1bb7f9['Trunk'][_0x511e('0x58')],'callerid':_0x1bb7f9[_0x511e('0x57')][_0x511e('0x59')]};}if(_0x1bb7f9['Interval']){_0x3c057c['Interval']={'id':_0x1bb7f9['Interval']['id'],'name':_0x1bb7f9[_0x511e('0x5a')][_0x511e('0xa')]};}_0x53017d[_0x511e('0x5b')](_0x3c057c);}}_0x4d94a1({'count':_0x53017d[_0x511e('0x5c')],'rows':_0x53017d});});},'UpdateVoiceQueue':function(_0x40e017){return new Promise(function(_0x393e36,_0x1d494f){var _0x1faf19=_[_0x511e('0x5d')](_0x4fbd4f[_0x511e('0x23')],{'id':parseInt(_0x40e017['id'])});var _0x1a2e4=_[_0x511e('0x5e')](_0x40e017,['id']);if(_0x1faf19){for(var _0x19a6c8 in _0x1a2e4){if(typeof _0x1a2e4[_0x19a6c8]!==_0x511e('0x5f')&&typeof _0x1faf19[_0x19a6c8]!==_0x511e('0x5f')){_0x1faf19[_0x19a6c8]=_0x1a2e4[_0x19a6c8];}}_0x393e36(_0x1faf19);}else{_0x1d494f();}});},'VoiceChannels':function(_0x17568d){return new Promise(function(_0x15e6e8,_0x30769b){var _0x3a8395=_[_0x511e('0x60')](_0x4fbd4f[_0x511e('0x61')]);_0x15e6e8({'count':_0x3a8395[_0x511e('0x5c')],'rows':_0x3a8395});});},'VoiceChannelMixMonitor':function(_0x204783){var _0x1cb4ba=this;return new Promise(function(_0x37bfdb,_0x4096c0){if(ami[_0x511e('0x11')]()==![]){return _0x4096c0(_0x1cb4ba[_0x511e('0x12')](0x1f4,[config[_0x511e('0x13')]['ip'],config[_0x511e('0x13')][_0x511e('0x14')],'ami\x20disconnected'][_0x511e('0x15')]('\x20')));}var _0x56bfd4=schema(properties[_0x511e('0x62')])[_0x511e('0x2')](_0x204783);if(_0x56bfd4[_0x511e('0x5c')]>0x0){return _0x4096c0(_0x1cb4ba['error'](0x1f4,_[_0x511e('0x63')](_0x56bfd4,_0x511e('0x1c'))[_0x511e('0x15')](',\x20')));}var _0x5cc04d=_[_0x511e('0x5d')](_0x4fbd4f[_0x511e('0x61')],{'uniqueid':_0x204783['uniqueid']});if(_0x5cc04d&&_0x5cc04d[_0x511e('0x64')]){var _0x4609dc=util[_0x511e('0x7')](_0x511e('0x65'),_0x204783['filename']||_0x204783[_0x511e('0x66')],_0x204783['format']||_0x511e('0x67'));return ami[_0x511e('0x1a')]({'action':_0x511e('0x68'),'channel':_0x5cc04d['channel'],'file':_0x4609dc,'options':_0x511e('0x69')})['then'](function(_0x4705e3){var _0x586449=_[_0x511e('0x5d')](_0x5cc04d[_0x511e('0x6a')],{'filename':_0x511e('0x6b')+_0x4609dc['toLowerCase']()});if(_[_0x511e('0x6c')](_0x586449)){_0x5cc04d[_0x511e('0x6a')][_0x511e('0x5b')]({'filename':_0x511e('0x6b')+_0x4609dc[_0x511e('0x6d')](),'createdAt':moment()[_0x511e('0x7')](_0x511e('0x6e')),'mixmonitorid':_0x4705e3[_0x511e('0x6f')],'status':'rec'});}else{_0x586449[_0x511e('0x6f')]=_0x4705e3[_0x511e('0x6f')];_0x586449['status']=_0x511e('0x70');}_0x37bfdb({'code':0xc8,'message':[_0x204783[_0x511e('0x66')],_0x511e('0x71'),_0x4705e3[_0x511e('0x6f')]][_0x511e('0x15')]('\x20'),'mixmonitorid':_0x4705e3[_0x511e('0x6f')]});})['catch'](function(_0x31777b){_0x4096c0(_0x1cb4ba[_0x511e('0x12')](0x1f5,[_0x204783['uniqueid'],_0x31777b[_0x511e('0x1c')]['toLowerCase']()][_0x511e('0x15')]('\x20')));});}else{return _0x4096c0(_0x1cb4ba[_0x511e('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x58f1e4){var _0x586931=this;return new Promise(function(_0x5a1511,_0x37c145){if(ami['isConnected']()==![]){return _0x37c145(_0x586931['error'](0x1f4,[config[_0x511e('0x13')]['ip'],config[_0x511e('0x13')]['username'],_0x511e('0x1d')]['join']('\x20')));}var _0x3a3744=schema(properties['voicechannel'])['validate'](_0x58f1e4);if(_0x3a3744['length']>0x0){return _0x37c145(_0x586931[_0x511e('0x12')](0x1f4,_[_0x511e('0x63')](_0x3a3744,'message')['join'](',\x20')));}var _0x51940a=_['find'](_0x4fbd4f[_0x511e('0x61')],{'uniqueid':_0x58f1e4['uniqueid']});if(_0x51940a){return BPromise[_0x511e('0x72')]()['then'](function(){if(_0x51940a[_0x511e('0x64')]){return ami[_0x511e('0x1a')]({'action':_0x511e('0x73'),'channel':_0x51940a[_0x511e('0x64')],'mixmonitorid':_0x58f1e4['mixmonitorid']})[_0x511e('0x22')](function(_0xc154b2){});}})[_0x511e('0x1b')](function(){if(_0x51940a[_0x511e('0x74')]){return ami[_0x511e('0x1a')]({'action':'StopMixMonitor','channel':_0x51940a['destinationchannel'],'mixmonitorid':_0x58f1e4[_0x511e('0x6f')]})[_0x511e('0x22')](function(_0x42cb48){});}})[_0x511e('0x1b')](function(_0x3d0a10){var _0x329aee=_[_0x511e('0x5d')](_0x51940a[_0x511e('0x6a')],{'mixmonitorid':_0x58f1e4[_0x511e('0x6f')]});if(_0x329aee){_0x329aee[_0x511e('0x75')]='stop';}})['then'](function(){var _0x55fcc9=util[_0x511e('0x7')]('%s.%s',_0x58f1e4[_0x511e('0x76')]||_0x58f1e4['uniqueid'],_0x58f1e4[_0x511e('0x7')]||'wav');var _0x434269=_[_0x511e('0x5d')](_0x51940a[_0x511e('0x6a')],{'filename':_0x511e('0x6b')+_0x55fcc9[_0x511e('0x6d')]()});if(_0x434269){_0x434269['status']=_0x511e('0x77');}})['then'](function(){_0x5a1511({'code':0xc8,'message':[_0x58f1e4[_0x511e('0x66')],_0x511e('0x78')][_0x511e('0x15')]('\x20')});})['catch'](function(_0x76b6b0){_0x37c145(_0x586931[_0x511e('0x12')](0x1f5,[_0x58f1e4[_0x511e('0x66')],_0x76b6b0[_0x511e('0x1c')]['toLowerCase']()]['join']('\x20')));});}else{return _0x37c145(_0x586931[_0x511e('0x12')](0x1f5,_0x511e('0x79')));}});},'VoiceQueuesChannels':function(_0x5b1ba8){return new Promise(function(_0x2545d2,_0x5cb3ea){var _0x45693d=_[_0x511e('0x60')](_0x4fbd4f['queueChannels']);_0x2545d2({'count':_0x45693d['length'],'rows':_0x45693d});});},'VoiceQueuesChannel':function(_0x317766){var _0x2b9aee=this;return new Promise(function(_0x2061d8,_0x5c2817){var _0xb7e7e4=schema(properties[_0x511e('0x7a')])[_0x511e('0x2')](_0x317766);if(_0xb7e7e4[_0x511e('0x5c')]>0x0){return _0x5c2817(_0x2b9aee[_0x511e('0x12')](0x1f4,_[_0x511e('0x63')](_0xb7e7e4,_0x511e('0x1c'))['join'](',\x20')));}var _0x23833a=_[_0x511e('0x5d')](_0x4fbd4f['queueChannels'],{'uniqueid':_0x317766['uniqueid']});if(_0x23833a){_0x2061d8(_0x23833a);}else{return _0x5c2817(_0x2b9aee[_0x511e('0x12')](0x1f5,_0x511e('0x79')));}});},'VoiceQueuesChannelHangup':function(_0x55c45d){var _0x36d05f=this;return new Promise(function(_0x5e65a2,_0x21cb81){if(ami['isConnected']()==![]){return _0x21cb81(_0x36d05f['error'](0x1f4,[config[_0x511e('0x13')]['ip'],config[_0x511e('0x13')][_0x511e('0x14')],_0x511e('0x1d')][_0x511e('0x15')]('\x20')));}var _0x4f16f5=schema(properties['voicequeuechannelhangup'])[_0x511e('0x2')](_0x55c45d);if(_0x4f16f5[_0x511e('0x5c')]>0x0){return _0x21cb81(_0x36d05f[_0x511e('0x12')](0x1f4,_['map'](_0x4f16f5,_0x511e('0x1c'))[_0x511e('0x15')](',\x20')));}var _0x493188=_['find'](_0x4fbd4f[_0x511e('0x7b')],{'uniqueid':_0x55c45d[_0x511e('0x66')]});if(_0x493188&&_0x493188[_0x511e('0x64')]){return ami[_0x511e('0x1a')]({'action':_0x511e('0x7c'),'channel':_0x493188[_0x511e('0x64')]})['then'](function(_0x33fd85){_0x5e65a2({'code':0xc8,'message':[_0x55c45d[_0x511e('0x66')],_0x33fd85['message']['toLowerCase']()][_0x511e('0x15')]('\x20')});})['catch'](function(_0x3341a0){_0x21cb81(_0x36d05f['error'](0x1f5,[_0x55c45d['uniqueid'],_0x3341a0[_0x511e('0x1c')][_0x511e('0x6d')]()][_0x511e('0x15')]('\x20')));});}else{return _0x21cb81(_0x36d05f[_0x511e('0x12')](0x1f5,_0x511e('0x79')));}});},'VoiceQueuesChannelRedirect':function(_0x1876d2){var _0x143277=this;return new Promise(function(_0x431d94,_0x325df2){if(ami[_0x511e('0x11')]()==![]){return _0x325df2(_0x143277[_0x511e('0x12')](0x1f4,[config[_0x511e('0x13')]['ip'],config[_0x511e('0x13')][_0x511e('0x14')],_0x511e('0x1d')][_0x511e('0x15')]('\x20')));}var _0x4a07b7=schema(properties[_0x511e('0x7d')])[_0x511e('0x2')](_0x1876d2);if(_0x4a07b7[_0x511e('0x5c')]>0x0){return _0x325df2(_0x143277[_0x511e('0x12')](0x1f4,_[_0x511e('0x63')](_0x4a07b7,_0x511e('0x1c'))[_0x511e('0x15')](',\x20')));}var _0x3e2e1d=_[_0x511e('0x5d')](_0x4fbd4f[_0x511e('0x7b')],{'uniqueid':_0x1876d2[_0x511e('0x66')]});if(_0x3e2e1d&&_0x3e2e1d['channel']){return ami[_0x511e('0x1a')]({'action':_0x511e('0x7e'),'channel':_0x3e2e1d[_0x511e('0x64')],'exten':_0x1876d2[_0x511e('0x7f')],'context':_0x1876d2['context']||_0x3e2e1d[_0x511e('0x80')],'priority':0x1})[_0x511e('0x1b')](function(_0x3a4db6){_0x431d94({'code':0xc8,'message':[_0x1876d2[_0x511e('0x66')],_0x3a4db6[_0x511e('0x1c')][_0x511e('0x6d')]()][_0x511e('0x15')]('\x20')});})[_0x511e('0x22')](function(_0x25e8cb){_0x325df2(_0x143277[_0x511e('0x12')](0x1f5,[_0x1876d2['uniqueid'],_0x25e8cb[_0x511e('0x1c')][_0x511e('0x6d')]()][_0x511e('0x15')]('\x20')));});}else{return _0x325df2(_0x143277[_0x511e('0x12')](0x1f5,_0x511e('0x79')));}});},'Agents':function(_0x3d807a){return new Promise(function(_0x436e65,_0x47c07d){var _0x4a43bf=_[_0x511e('0x60')](_0x4fbd4f[_0x511e('0x81')]);_0x436e65({'count':_0x4a43bf[_0x511e('0x5c')],'rows':_0x4a43bf});});},'Telephones':function(_0x32fd22){return new Promise(function(_0x11d601,_0x4316de){var _0x122d49=_[_0x511e('0x60')](_0x4fbd4f[_0x511e('0x82')]);_0x11d601({'count':_0x122d49[_0x511e('0x5c')],'rows':_0x122d49});});},'Trunks':function(_0x55e8cc){return new Promise(function(_0x15a553,_0x255aac){var _0x19671c=_[_0x511e('0x60')](_0x4fbd4f[_0x511e('0x83')]);_0x15a553({'count':_0x19671c['length'],'rows':_0x19671c});});},'OutboundChannels':function(_0x561a26){return new Promise(function(_0x1d408d,_0x26a9f0){var _0x588f24=_[_0x511e('0x60')](_0x4fbd4f['outboundChannels']);_0x1d408d({'count':_0x588f24[_0x511e('0x5c')],'rows':_0x588f24});});},'Outbound':function(_0x2ff676){return new Promise(function(_0x5c9f54,_0x68d14e){_0x5c9f54(_0x4fbd4f['outbound']);});},'Campaigns':function(_0xd74673){return new Promise(function(_0x2455da,_0x19a7ba){var _0x473867=_[_0x511e('0x60')](_0x4fbd4f[_0x511e('0x84')]);_0x2455da({'count':_0x473867[_0x511e('0x5c')],'rows':_0x473867});});},'VoiceQueuesPreview':function(_0x27004c){var _0x3289a9=this;return new Promise(function(_0x12e381,_0x37bb80){_0x5923a7[_0x511e('0x85')](_0x27004c['id'])[_0x511e('0x1b')](function(_0x28907e){_0x12e381({'code':0xc8,'message':_0x28907e[_0x511e('0x1c')]});})[_0x511e('0x22')](function(_0x45d846){_0x37bb80(_0x3289a9[_0x511e('0x12')](0x1f4,_0x45d846['message']));});});},'EventManager':function(_0x26065a){var _0x4377b4=this;return new Promise(function(_0x1e08dc,_0x4727b0){if(!_0x26065a[_0x511e('0x86')]){return _0x4727b0(_0x4377b4['error'](0x1f4,_0x511e('0x87')));}ami[_0x511e('0x88')](_0x511e('0x89')+_0x26065a['event'],_0x26065a[_0x511e('0x1c')]);_0x1e08dc({'code':0xc8,'message':_0x26065a});});},'FaxAccounts':function(_0x470f1e){return new Promise(function(_0x176941,_0x334374){var _0x513c38=_['values'](_0x4fbd4f['faxAccounts']);_0x176941({'count':_0x513c38[_0x511e('0x5c')],'rows':_0x513c38});});},'SendFax':function(_0x148871){var _0x48a735=this;return new Promise(function(_0x137568,_0x49e3c7){_0x342539[_0x511e('0x8a')](_0x148871)['then'](function(_0x19abb4){_0x137568({'code':0xc8,'message':_0x19abb4[_0x511e('0x1c')]});})['catch'](function(_0x222547){_0x49e3c7(_0x48a735[_0x511e('0x12')](0x1f4,_0x222547[_0x511e('0x1c')]));});});},'CheckAfterSend':function(_0x40d891){var _0x3debb7=this;return new Promise(function(_0x500557,_0x4a8843){_0x342539['checkAfterSend'](_0x40d891)['then'](function(_0x4adf6b){_0x500557({'code':0xc8,'message':_0x4adf6b[_0x511e('0x1c')]});})[_0x511e('0x22')](function(_0x43301c){_0x4a8843(_0x3debb7['error'](0x1f4,_0x43301c[_0x511e('0x1c')]));});});}};var _0x1eb2ce=jayson[_0x511e('0x8b')](_0x57cac3)[_0x511e('0x8c')]();_0x1eb2ce['on'](_0x511e('0x12'),function(_0x31cdb3){return _0x466dec(_0x31cdb3);});_0x1eb2ce[_0x511e('0x6')](0x232a,'127.0.0.1',function(){console[_0x511e('0x8d')](_0x511e('0x8e'),0x232a);return _0x323f8c(_0x511e('0x8f')+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 33ec139..e35f70f 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 _0xb7ea=['bluebird','ioredis','trigger','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','map','destcalleridnum','routeId','firstName','lastName','mobile','createdAt','scheduledAt','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridnum','calleridname','Unknown','destcalleridname','','resolve','createContact','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','push','format','user:%s','action'];(function(_0x31cc0e,_0x24ba4c){var _0x144862=function(_0x4d236e){while(--_0x4d236e){_0x31cc0e['push'](_0x31cc0e['shift']());}};_0x144862(++_0x24ba4c);}(_0xb7ea,0x6a));var _0xab7e=function(_0x502a32,_0x23d261){_0x502a32=_0x502a32-0x0;var _0x30191c=_0xb7ea[_0x502a32];return _0x30191c;};'use strict';var _=require('lodash');var BPromise=require(_0xab7e('0x0'));var Redis=require(_0xab7e('0x1'));var util=require('util');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xab7e('0x2'));var cmContactRpc=require('../../rpc/cmContact');config[_0xab7e('0x3')]=_[_0xab7e('0x4')](config[_0xab7e('0x3')],{'host':_0xab7e('0x5'),'port':0x18eb});var io=require(_0xab7e('0x6'))(new Redis(config[_0xab7e('0x3')]));function emit(_0x2b2deb,_0x5f4e4b,_0x4f928d,_0x21680f,_0x5e6408){logger[_0xab7e('0x7')](_0xab7e('0x8'),_0x2b2deb,_0x5f4e4b['id'],_0x4f928d,_0x21680f,JSON[_0xab7e('0x9')](_0x5e6408));io['to'](_0x4f928d)[_0xab7e('0xa')](_0x21680f,_0x5e6408);}exports[_0xab7e('0xb')]=function(_0x565204,_0x357603,_0x340269,_0x1053a6){var _0x52f260,_0x166739;var _0x4aa9bb={};var _0x3fd766;var _0x43fe2b=Number(_0x340269['data1']);var _0x3bf166=_0x340269[_0xab7e('0xc')]?Boolean(Number(_0x340269[_0xab7e('0xc')])):![];var _0x228d71;var _0x449760=![];if(!_[_0xab7e('0xd')](_0x340269['data5'])){if(_0x340269[_0xab7e('0xe')]=='1')_0x449760=!![];}if(!_0x449760){if(_0x1053a6[_0xab7e('0xf')]){_0x4aa9bb['id']=_0x1053a6[_0xab7e('0xf')];}}if(!_0x4aa9bb['id']){_0x4aa9bb[_0xab7e('0x10')]=_0x43fe2b;_0x228d71=_0x340269[_0xab7e('0x11')]&&_0x340269[_0xab7e('0x11')]!=='0'?_0x340269[_0xab7e('0x11')][_0xab7e('0x12')](','):[_0xab7e('0x13')];_0x4aa9bb[_0xab7e('0x14')]=_[_0xab7e('0x15')](_0x228d71,function(_0x5dbde3){var _0x17d29a={};_0x17d29a[_0x5dbde3]=_0x1053a6['routeId']?_0x1053a6[_0xab7e('0x16')]:_0x1053a6['calleridnum'];return _0x17d29a;});_0x3fd766=_0x1053a6[_0xab7e('0x17')]?_0x1053a6['destcalleridnum']:_0x1053a6['calleridnum'];}var _0x2f39ea=['id',_0xab7e('0x18'),_0xab7e('0x19'),_0xab7e('0x13'),_0xab7e('0x1a'),'fax',_0xab7e('0x10'),_0xab7e('0x1b'),_0xab7e('0x1c'),'updatedAt'];var _0x162ed3=_['union'](_0x2f39ea,_0x228d71);BPromise['resolve']()[_0xab7e('0x1d')](cmContactRpc[_0xab7e('0x1e')]({'attributes':_0x162ed3,'where':_0x4aa9bb,'phone':_0x3fd766}))[_0xab7e('0x1d')](function(_0x3e312d){_0x166739=_0x3e312d;if(!_[_0xab7e('0x1f')](_0x166739)){if(_0x166739[_0xab7e('0x20')]===0x1){_0x52f260=_0x166739[0x0];logger[_0xab7e('0x7')](_0xab7e('0x21'),_0x1053a6['uniqueid'],_0x357603['id'],_0x52f260['id']);}else{logger['info'](_0xab7e('0x22'),_0x1053a6[_0xab7e('0x23')],_0x357603['id'],_[_0xab7e('0x15')](_0x166739,'id')[_0xab7e('0x24')](','));}return;}else{logger[_0xab7e('0x7')](_0xab7e('0x25'),_0x1053a6['uniqueid'],_0x357603['id']);var _0x3475fd={'ListId':_0x43fe2b};var _0x4f7609=_0x340269[_0xab7e('0x26')]&&_0x340269[_0xab7e('0x26')]!=='0'?_0x340269[_0xab7e('0x26')]:'phone';if(_0x3bf166){logger[_0xab7e('0x7')](_0xab7e('0x27'),_0x1053a6[_0xab7e('0x23')],_0x357603['id']);_0x3475fd[_0x4f7609]=_['isNil'](_0x1053a6[_0xab7e('0x17')])?_0x1053a6[_0xab7e('0x28')]:_0x1053a6[_0xab7e('0x16')];if(_[_0xab7e('0xd')](_0x1053a6['routeId'])){_0x3475fd['firstName']=_0x1053a6[_0xab7e('0x29')]&&_0x1053a6[_0xab7e('0x29')]!==''?_0x1053a6['calleridname']:_0xab7e('0x2a');}else{_0x3475fd[_0xab7e('0x18')]=_0x1053a6['destcalleridname']&&_0x1053a6[_0xab7e('0x2b')]!==_0xab7e('0x2c')?_0x1053a6['destcalleridname']:_0xab7e('0x2a');}return BPromise[_0xab7e('0x2d')]()[_0xab7e('0x1d')](cmContactRpc[_0xab7e('0x2e')](_0x3475fd))[_0xab7e('0x1d')](function(_0x4fc4b0){_0x52f260=_0x4fc4b0;_0x166739['push'](_0x4fc4b0);if(_0x52f260){logger[_0xab7e('0x7')](_0xab7e('0x2f'),_0x1053a6[_0xab7e('0x23')],_0x357603['id'],_0x52f260['id']);}return;});}else{logger[_0xab7e('0x7')](_0xab7e('0x30'),_0x1053a6['uniqueid'],_0x357603['id']);_0x3475fd[_0x4f7609]=_[_0xab7e('0xd')](_0x1053a6[_0xab7e('0x17')])?_0x1053a6[_0xab7e('0x28')]:_0x1053a6[_0xab7e('0x16')];if(_[_0xab7e('0xd')](_0x1053a6[_0xab7e('0x17')])){_0x3475fd[_0xab7e('0x18')]=_0x1053a6[_0xab7e('0x29')]&&_0x1053a6[_0xab7e('0x29')]!==_0xab7e('0x2c')?_0x1053a6[_0xab7e('0x29')]:_0xab7e('0x2a');}else{_0x3475fd[_0xab7e('0x18')]=_0x1053a6[_0xab7e('0x2b')]&&_0x1053a6[_0xab7e('0x2b')]!==_0xab7e('0x2c')?_0x1053a6[_0xab7e('0x2b')]:_0xab7e('0x2a');}_0x52f260=_0x3475fd;_0x166739[_0xab7e('0x31')](_0x3475fd);return;}}})['then'](function(){if(_0x565204){emit(_0x1053a6[_0xab7e('0x23')],_0x357603,util[_0xab7e('0x32')](_0xab7e('0x33'),_0x565204['name']),util[_0xab7e('0x32')]('trigger:%s',_0x340269[_0xab7e('0x34')]['toLowerCase']()),{'evt':_['merge'](_0x1053a6,{'autoCreate':_0x3bf166}),'contact':_0x52f260===undefined?{}:_0x52f260,'contacts':_0x166739[_0xab7e('0x20')]===0x0?undefined:_0x166739});}});}; \ No newline at end of file +var _0xcf2f=['info','[CM][%s][%s]','stringify','emit','exec','data1','data2','data5','xmd-contactid','ListId','data3','phone','$or','map','calleridnum','routeId','destcalleridnum','firstName','lastName','mobile','fax','scheduledAt','updatedAt','union','resolve','getContacts','then','isEmpty','length','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','data4','isNil','','calleridname','destcalleridname','Unknown','createContact','[CM][%s][%s]\x20Autocreate\x20disabled','push','format','user:%s','name','trigger:%s','action','toLowerCase','merge','bluebird','ioredis','util','../../../../config/environment','trigger','../../rpc/cmContact','defaults','redis','localhost','socket.io-emitter'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xcf2f,0x1c6));var _0xfcf2=function(_0x50eb3f,_0x44231f){_0x50eb3f=_0x50eb3f-0x0;var _0xcad21c=_0xcf2f[_0x50eb3f];return _0xcad21c;};'use strict';var _=require('lodash');var BPromise=require(_0xfcf2('0x0'));var Redis=require(_0xfcf2('0x1'));var util=require(_0xfcf2('0x2'));var config=require(_0xfcf2('0x3'));var logger=require('../../../../config/logger')(_0xfcf2('0x4'));var cmContactRpc=require(_0xfcf2('0x5'));config['redis']=_[_0xfcf2('0x6')](config[_0xfcf2('0x7')],{'host':_0xfcf2('0x8'),'port':0x18eb});var io=require(_0xfcf2('0x9'))(new Redis(config[_0xfcf2('0x7')]));function emit(_0x1edaa6,_0x4813a4,_0x2c6864,_0x2a731a,_0xd5aa5f){logger[_0xfcf2('0xa')](_0xfcf2('0xb'),_0x1edaa6,_0x4813a4['id'],_0x2c6864,_0x2a731a,JSON[_0xfcf2('0xc')](_0xd5aa5f));io['to'](_0x2c6864)[_0xfcf2('0xd')](_0x2a731a,_0xd5aa5f);}exports[_0xfcf2('0xe')]=function(_0x52e89f,_0x56cdd4,_0x2ab73d,_0x8bdb88){var _0x65614,_0x40679b;var _0x5c7de0={};var _0x235a90;var _0x4dbb50=Number(_0x2ab73d[_0xfcf2('0xf')]);var _0x1ae0c4=_0x2ab73d[_0xfcf2('0x10')]?Boolean(Number(_0x2ab73d[_0xfcf2('0x10')])):![];var _0x2d55ce;var _0x51f0a4=![];if(!_['isNil'](_0x2ab73d[_0xfcf2('0x11')])){if(_0x2ab73d[_0xfcf2('0x11')]=='1')_0x51f0a4=!![];}if(!_0x51f0a4){if(_0x8bdb88[_0xfcf2('0x12')]){_0x5c7de0['id']=_0x8bdb88['xmd-contactid'];}}if(!_0x5c7de0['id']){_0x5c7de0[_0xfcf2('0x13')]=_0x4dbb50;_0x2d55ce=_0x2ab73d[_0xfcf2('0x14')]&&_0x2ab73d[_0xfcf2('0x14')]!=='0'?_0x2ab73d['data3']['split'](','):[_0xfcf2('0x15')];_0x5c7de0[_0xfcf2('0x16')]=_[_0xfcf2('0x17')](_0x2d55ce,function(_0x55df06){var _0x2983db={};_0x2983db[_0x55df06]=_0x8bdb88['routeId']?_0x8bdb88['destcalleridnum']:_0x8bdb88[_0xfcf2('0x18')];return _0x2983db;});_0x235a90=_0x8bdb88[_0xfcf2('0x19')]?_0x8bdb88[_0xfcf2('0x1a')]:_0x8bdb88[_0xfcf2('0x18')];}var _0x3e4aaa=['id',_0xfcf2('0x1b'),_0xfcf2('0x1c'),'phone',_0xfcf2('0x1d'),_0xfcf2('0x1e'),'ListId','createdAt',_0xfcf2('0x1f'),_0xfcf2('0x20')];var _0x289565=_[_0xfcf2('0x21')](_0x3e4aaa,_0x2d55ce);BPromise[_0xfcf2('0x22')]()['then'](cmContactRpc[_0xfcf2('0x23')]({'attributes':_0x289565,'where':_0x5c7de0,'phone':_0x235a90}))[_0xfcf2('0x24')](function(_0x3ad8fa){_0x40679b=_0x3ad8fa;if(!_[_0xfcf2('0x25')](_0x40679b)){if(_0x40679b[_0xfcf2('0x26')]===0x1){_0x65614=_0x40679b[0x0];logger['info']('[CM][%s][%s]\x20Contact\x20found:%s',_0x8bdb88[_0xfcf2('0x27')],_0x56cdd4['id'],_0x65614['id']);}else{logger['info'](_0xfcf2('0x28'),_0x8bdb88[_0xfcf2('0x27')],_0x56cdd4['id'],_[_0xfcf2('0x17')](_0x40679b,'id')[_0xfcf2('0x29')](','));}return;}else{logger[_0xfcf2('0xa')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x8bdb88['uniqueid'],_0x56cdd4['id']);var _0xbe6521={'ListId':_0x4dbb50};var _0x84796f=_0x2ab73d[_0xfcf2('0x2a')]&&_0x2ab73d[_0xfcf2('0x2a')]!=='0'?_0x2ab73d[_0xfcf2('0x2a')]:_0xfcf2('0x15');if(_0x1ae0c4){logger[_0xfcf2('0xa')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x8bdb88[_0xfcf2('0x27')],_0x56cdd4['id']);_0xbe6521[_0x84796f]=_[_0xfcf2('0x2b')](_0x8bdb88[_0xfcf2('0x19')])?_0x8bdb88['calleridnum']:_0x8bdb88['destcalleridnum'];if(_[_0xfcf2('0x2b')](_0x8bdb88['routeId'])){_0xbe6521[_0xfcf2('0x1b')]=_0x8bdb88['calleridname']&&_0x8bdb88['calleridname']!==_0xfcf2('0x2c')?_0x8bdb88[_0xfcf2('0x2d')]:'Unknown';}else{_0xbe6521[_0xfcf2('0x1b')]=_0x8bdb88[_0xfcf2('0x2e')]&&_0x8bdb88[_0xfcf2('0x2e')]!==_0xfcf2('0x2c')?_0x8bdb88[_0xfcf2('0x2e')]:_0xfcf2('0x2f');}return BPromise[_0xfcf2('0x22')]()[_0xfcf2('0x24')](cmContactRpc[_0xfcf2('0x30')](_0xbe6521))[_0xfcf2('0x24')](function(_0x3d4cab){_0x65614=_0x3d4cab;_0x40679b['push'](_0x3d4cab);if(_0x65614){logger[_0xfcf2('0xa')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x8bdb88['uniqueid'],_0x56cdd4['id'],_0x65614['id']);}return;});}else{logger[_0xfcf2('0xa')](_0xfcf2('0x31'),_0x8bdb88['uniqueid'],_0x56cdd4['id']);_0xbe6521[_0x84796f]=_['isNil'](_0x8bdb88['routeId'])?_0x8bdb88['calleridnum']:_0x8bdb88[_0xfcf2('0x1a')];if(_[_0xfcf2('0x2b')](_0x8bdb88[_0xfcf2('0x19')])){_0xbe6521['firstName']=_0x8bdb88[_0xfcf2('0x2d')]&&_0x8bdb88[_0xfcf2('0x2d')]!==''?_0x8bdb88[_0xfcf2('0x2d')]:_0xfcf2('0x2f');}else{_0xbe6521[_0xfcf2('0x1b')]=_0x8bdb88[_0xfcf2('0x2e')]&&_0x8bdb88[_0xfcf2('0x2e')]!==_0xfcf2('0x2c')?_0x8bdb88[_0xfcf2('0x2e')]:_0xfcf2('0x2f');}_0x65614=_0xbe6521;_0x40679b[_0xfcf2('0x32')](_0xbe6521);return;}}})[_0xfcf2('0x24')](function(){if(_0x52e89f){emit(_0x8bdb88[_0xfcf2('0x27')],_0x56cdd4,util[_0xfcf2('0x33')](_0xfcf2('0x34'),_0x52e89f[_0xfcf2('0x35')]),util[_0xfcf2('0x33')](_0xfcf2('0x36'),_0x2ab73d[_0xfcf2('0x37')][_0xfcf2('0x38')]()),{'evt':_[_0xfcf2('0x39')](_0x8bdb88,{'autoCreate':_0x1ae0c4}),'contact':_0x65614===undefined?{}:_0x65614,'contacts':_0x40679b[_0xfcf2('0x26')]===0x0?undefined:_0x40679b});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 841e4ec..5900394 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 _0xdfa0=['servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','bind','syncCustomEvent','custom:agentringnoanswer','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','info','stringify','prototype','clone','motionChannel','voice','checkTriggers','interface','hasOwnProperty','status','checkTrigger','merge','variables','length','action','contactmanager','motionbar','browser','data1','popup','TemplateId','data2','template\x20not\x20found','uri','buildUri','isNil','data3','data4','location','uriLocation','windowWidth','data5','800','windowHeight','600','data6','winapp','winApplication','winArguments','render','emit','format','name','trigger:%s:%s','jscripty','user:%s','toLowerCase','trigger:%s','exec','integration','queue','urlforward','script','parse','search','replace','channel','every','AllConditions','AnyConditions','some','checkConditions','field','chat','ChatWebsiteId','value','AccountId','operator','upperFirst','interaction','message','event','membername','lastevent','routeId','null','substatus','undefined','offlineMessage','created','exports','util','url','mustache','./urlforward','./integration','./cmContact','../../../config/environment','trigger','../ami','defaults','redis','localhost','socket.io-emitter','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts'];(function(_0x1786bb,_0x14e081){var _0x59d9e5=function(_0x299cda){while(--_0x299cda){_0x1786bb['push'](_0x1786bb['shift']());}};_0x59d9e5(++_0x14e081);}(_0xdfa0,0x69));var _0x0dfa=function(_0x248610,_0x6a7fd){_0x248610=_0x248610-0x0;var _0x44abbd=_0xdfa0[_0x248610];return _0x44abbd;};'use strict';var util=require(_0x0dfa('0x0'));var _=require('lodash');var url=require(_0x0dfa('0x1'));var Mustache=require(_0x0dfa('0x2'));var Redis=require('ioredis');var urlforward=require(_0x0dfa('0x3'));var integration=require(_0x0dfa('0x4'));var cmContact=require(_0x0dfa('0x5'));var script=require('./script');var config=require(_0x0dfa('0x6'));var logger=require('../../../config/logger')(_0x0dfa('0x7'));var ami=require(_0x0dfa('0x8'));config['redis']=_[_0x0dfa('0x9')](config[_0x0dfa('0xa')],{'host':_0x0dfa('0xb'),'port':0x18eb});var io=require(_0x0dfa('0xc'))(new Redis(config[_0x0dfa('0xa')]));var operators={'equals':function(_0x4c7be0,_0x2b85ed){return _0x4c7be0==_0x2b85ed;},'not_equals':function(_0x2f813e,_0x6c9373){return _0x2f813e!=_0x6c9373;}};var barAndWebActions=['popup',_0x0dfa('0x1'),'winapp'];function Trigger(_0x260ffb){this[_0x0dfa('0xd')]=_0x260ffb[_0x0dfa('0xd')];this['agents']=_0x260ffb[_0x0dfa('0xe')];this[_0x0dfa('0xf')]=_0x260ffb['voiceQueues'];this[_0x0dfa('0x10')]=_0x260ffb[_0x0dfa('0x10')];this['voiceExtensions']=_0x260ffb[_0x0dfa('0x11')];this[_0x0dfa('0x12')]=_0x260ffb[_0x0dfa('0x12')];this[_0x0dfa('0x13')]=_0x260ffb[_0x0dfa('0x13')];this[_0x0dfa('0x14')]=_0x260ffb['salesforceAccounts'];this[_0x0dfa('0x15')]=_0x260ffb[_0x0dfa('0x15')];this[_0x0dfa('0x16')]=_0x260ffb[_0x0dfa('0x16')];this[_0x0dfa('0x17')]=_0x260ffb[_0x0dfa('0x17')];this[_0x0dfa('0x18')]=_0x260ffb[_0x0dfa('0x18')];this[_0x0dfa('0x19')]=_0x260ffb[_0x0dfa('0x19')];this[_0x0dfa('0x1a')]=_0x260ffb[_0x0dfa('0x1a')];this[_0x0dfa('0x1b')]=_0x260ffb[_0x0dfa('0x1b')];this[_0x0dfa('0x1c')]={'zendesk':this['zendeskAccounts'],'salesforce':this[_0x0dfa('0x14')],'freshdesk':this[_0x0dfa('0x13')],'sugarcrm':this[_0x0dfa('0x15')],'zoho':this[_0x0dfa('0x16')],'desk':this[_0x0dfa('0x17')],'vtiger':this['vtigerAccounts'],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0x0dfa('0x1b')],'servicenow':this[_0x0dfa('0x19')]};ami['on'](_0x0dfa('0x1d'),this['syncCustomEvent'][_0x0dfa('0x1e')](this));ami['on']('custom:agentconnect',this[_0x0dfa('0x1f')]['bind'](this));ami['on'](_0x0dfa('0x20'),this[_0x0dfa('0x1f')][_0x0dfa('0x1e')](this));ami['on']('custom:agentcomplete',this[_0x0dfa('0x1f')][_0x0dfa('0x1e')](this));ami['on'](_0x0dfa('0x21'),this[_0x0dfa('0x1f')][_0x0dfa('0x1e')](this));ami['on'](_0x0dfa('0x22'),this[_0x0dfa('0x1f')][_0x0dfa('0x1e')](this));ami['on'](_0x0dfa('0x23'),this[_0x0dfa('0x1f')]['bind'](this));ami['on']('custom:agentcongestion',this[_0x0dfa('0x1f')][_0x0dfa('0x1e')](this));ami['on']('custom:agentreject',this[_0x0dfa('0x1f')][_0x0dfa('0x1e')](this));ami['on'](_0x0dfa('0x24'),this['syncCustomEvent'][_0x0dfa('0x1e')](this));ami['on'](_0x0dfa('0x25'),this[_0x0dfa('0x1f')][_0x0dfa('0x1e')](this));ami['on'](_0x0dfa('0x26'),this[_0x0dfa('0x1f')]['bind'](this));ami['on'](_0x0dfa('0x27'),this[_0x0dfa('0x28')]['bind'](this));ami['on'](_0x0dfa('0x29'),this[_0x0dfa('0x28')][_0x0dfa('0x1e')](this));ami['on'](_0x0dfa('0x2a'),this['syncAgentDial'][_0x0dfa('0x1e')](this));ami['on'](_0x0dfa('0x2b'),this[_0x0dfa('0x1f')]['bind'](this));ami['on']('custom:closedinteraction',this[_0x0dfa('0x1f')][_0x0dfa('0x1e')](this));ami['on']('custom:substatus',this['syncCustomEvent']['bind'](this));ami['on'](_0x0dfa('0x2c'),this[_0x0dfa('0x1f')][_0x0dfa('0x1e')](this));ami['on'](_0x0dfa('0x2d'),this['syncCustomEvent'][_0x0dfa('0x1e')](this));ami['on'](_0x0dfa('0x2e'),this[_0x0dfa('0x1f')][_0x0dfa('0x1e')](this));ami['on'](_0x0dfa('0x2f'),this[_0x0dfa('0x1f')][_0x0dfa('0x1e')](this));ami['on'](_0x0dfa('0x30'),this[_0x0dfa('0x1f')][_0x0dfa('0x1e')](this));}Trigger['prototype']['emit']=function(_0x1036fc,_0x17fe0d,_0xdb2edf){logger[_0x0dfa('0x31')](_0x1036fc,_0x17fe0d,JSON[_0x0dfa('0x32')](_0xdb2edf));io['to'](_0x1036fc)['emit'](_0x17fe0d,_0xdb2edf);};Trigger[_0x0dfa('0x33')]['syncCustomEvent']=function(_0x26aad2){var _0x20f2bc=_[_0x0dfa('0x34')](_0x26aad2);if(typeof _0x20f2bc['motionChannel']==='undefined'){_0x20f2bc[_0x0dfa('0x35')]=_0x0dfa('0x36');}this[_0x0dfa('0x37')](_0x20f2bc);};Trigger['prototype'][_0x0dfa('0x28')]=function(_0x540be2){if(this[_0x0dfa('0xe')][_0x540be2[_0x0dfa('0x38')]]){this['syncCustomEvent'](_0x540be2);}};Trigger[_0x0dfa('0x33')][_0x0dfa('0x37')]=function(_0x2c4864){var _0x4760b8;for(var _0xe53630 in this[_0x0dfa('0xd')]){if(this['triggers'][_0x0dfa('0x39')](_0xe53630)){if(this[_0x0dfa('0xd')][_0xe53630][_0x0dfa('0x3a')]){_0x4760b8=this[_0x0dfa('0x3b')](this[_0x0dfa('0xd')][_0xe53630],_0x2c4864);if(_0x4760b8){_[_0x0dfa('0x3c')](_0x2c4864,_0x2c4864[_0x0dfa('0x3d')]);for(var _0x973396=0x0,_0x34f7a9,_0x4078d9,_0x1ef461;_0x9733960x0){_0x11c1eb=_[_0x7995('0x2b')](_0xf16cc2,_0x132a42);}return _0x11c1eb;}function getCustomFields(_0x514445,_0x456a28){var _0x3250e0=[];var _0x4253e5={'custom_fields':{}};if(_0x514445['length']>0x0){_['forEach'](_0x514445,function(_0x48e573){if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x30')]&&!_0x48e573[_0x7995('0x31')]){_0x4253e5[_0x48e573['nameField']['toLowerCase']()]=_0x48e573[_0x7995('0x32')]['toString']();}else if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x48e573['content']['toString']();}else if(_0x48e573['type']===_0x7995('0x35')&&_0x48e573[_0x7995('0x36')]&&_0x48e573['idField']&&_0x48e573[_0x7995('0x31')]){_0x456a28[_0x48e573['variableName']]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573[_0x7995('0x36')]]['toString']());}else if(_0x48e573['type']===_0x7995('0x37')&&_0x48e573['Variable']&&_0x48e573['Variable'][_0x7995('0x38')]&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x456a28[_0x48e573[_0x7995('0x39')][_0x7995('0x38')][_0x7995('0x3a')]()]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573['Variable'][_0x7995('0x38')][_0x7995('0x3a')]()][_0x7995('0x22')]());}});}if(_0x4253e5[_0x7995('0x3b')]){_0x4253e5['priority']=Number(_0x4253e5[_0x7995('0x3b')]);}return _0x4253e5;}function getTicket(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee,_0x1035dc){logger['info'](_0x7995('0x3c'));var _0x3be298=_[_0x7995('0x3d')]({'subject':intUtil[_0x7995('0x3e')](_0x1f5bee[_0x7995('0x3f')],_0x1035dc,'\x20'),'type':_0x7995('0x40'),'status':_0x7995('0x41'),'labels':[_0x7995('0x42'),_0x7995('0x43'),_0x7995('0x44')][_0x7995('0x45')](getTags(_0x1f5bee[_0x7995('0x46')],_0x7995('0x38'))),'description':intUtil['getString'](_0x1f5bee['Descriptions'],_0x1035dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7995('0x11')](_0x7995('0x47'),_0x3eb04f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x1f5bee[_0x7995('0x48')],_0x1035dc,'\x0a')}},getCustomFields(_0x1f5bee['Fields'],_0x1035dc));return request({'uri':util['format'](_0x7995('0x49'),_0x235df7[_0x7995('0x12')],_0xe5ea43['id']),'method':_0x7995('0x29'),'body':_0x3be298});}exports['queue']=function(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881,_0x493066,_0x39c5b8){var _0x403f54,_0xc04e5;_0x39c5b8[_0x7995('0x12')]=intUtil['stripTrailingSlash'](_0x39c5b8[_0x7995('0x12')]);_0x39c5b8[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x39c5b8[_0x7995('0x4a')]);if(_0x493066&&_0x493066['monitor_format']){logger['info'](_0x7995('0x4c'),'Recording\x20is\x20enabled!');_0x5e85b9[_0x7995('0x4d')]=util['format'](_0x7995('0x4e'),_0x39c5b8['serverUrl'],_0x5e85b9[_0x7995('0x4f')],md5(_0x5e85b9[_0x7995('0x4f')]));}else{_0x5e85b9['recordingURL']='';}headers[_0x7995('0x50')]=getAuth(_0x39c5b8);return getUser(_0x39c5b8,_0x5a8881[_0x7995('0x51')])[_0x7995('0x13')](function(_0xb70a51){_0x403f54=_0xb70a51;logger['info'](_0x7995('0x52'),_0x403f54['id']);return getEndUser(_0x39c5b8,_0x5e85b9[_0x7995('0x53')],_0x5e85b9[_0x7995('0x54')]);})['then'](function(_0xe228a5){_0xc04e5=_0xe228a5;logger[_0x7995('0xf')](_0x7995('0x55'),_0xc04e5['id']);return getTicket(_0x39c5b8,_0x403f54,_0xc04e5,_0x3993b5,_0x5e85b9);})[_0x7995('0x13')](function(_0x255313){if(_0x255313){logger['info'](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x255313['id']);switch(_0x39c5b8[_0x7995('0x2f')]){case'integrationTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x255313['id']});break;case'newTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x5a'));emit(util['format'](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x5b'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x255313['id'])});break;default:logger['error'](_0x7995('0x4c'),_0x7995('0x5c'));}}})['catch'](function(_0x1cd85){console[_0x7995('0x5d')](_0x1cd85);logger[_0x7995('0x5d')](_0x7995('0x4c'),JSON[_0x7995('0x1c')](_0x1cd85));});};exports['outbound']=function(_0x29ee32,_0x4ab09f,_0x14fe7f,_0x33c801,_0x206d2a,_0x50c7b5,_0x5e1f34){var _0x54e2b1,_0x563f8e;_0x50c7b5[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x12')]);_0x50c7b5[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x4a')]);if(_0x5e1f34&&_0x5e1f34[_0x7995('0x5e')]&&_0x5e1f34[_0x7995('0x5e')]!==_0x7995('0x5f')){logger[_0x7995('0xf')](_0x7995('0x60'),_0x7995('0x61'));_0x4ab09f[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x50c7b5[_0x7995('0x4a')],_0x4ab09f[_0x7995('0x4f')],md5(_0x4ab09f[_0x7995('0x4f')]));}headers[_0x7995('0x50')]=getAuth(_0x50c7b5);return getUser(_0x50c7b5,_0x33c801['email'])[_0x7995('0x13')](function(_0x630737){_0x54e2b1=_0x630737;logger[_0x7995('0xf')](_0x7995('0x52'),_0x54e2b1['id']);return getEndUser(_0x50c7b5,_0x4ab09f['destcalleridname'],_0x4ab09f['destcalleridnum']);})[_0x7995('0x13')](function(_0x197b52){_0x563f8e=_0x197b52;logger[_0x7995('0xf')](_0x7995('0x55'),_0x563f8e['id']);return getTicket(_0x50c7b5,_0x54e2b1,_0x563f8e,_0x14fe7f,_0x4ab09f);})['then'](function(_0x13cd7b){if(_0x13cd7b){logger[_0x7995('0xf')](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x13cd7b['id']);switch(_0x50c7b5['type']){case _0x7995('0x62'):logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x13cd7b['id']});break;case _0x7995('0x63'):logger['info'](_0x7995('0x4c'),_0x7995('0x5a'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801['name']),'trigger:browser:url',{'uri':util[_0x7995('0x11')](_0x7995('0x64'),_0x50c7b5['remoteUri'],_0x13cd7b['id'])});break;default:logger[_0x7995('0x5d')](_0x7995('0x60'),_0x7995('0x5c'));}}})[_0x7995('0x65')](function(_0x32cb04){logger['error'](_0x7995('0x60'),JSON['stringify'](_0x32cb04));});};exports[_0x7995('0x66')]=function(_0xe31dcb,_0x1722e2,_0x25b534,_0x4388c1,_0xeb8920,_0x2b3c1d){var _0x44372a,_0x10f012;_0x2b3c1d[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x12')]);_0x2b3c1d['serverUrl']=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x4a')]);if(_0xeb8920&&_0xeb8920[_0x7995('0x67')]){logger[_0x7995('0xf')]('['+_0x1722e2[_0x7995('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1722e2[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x2b3c1d[_0x7995('0x4a')],_0x1722e2['uniqueid'],md5(_0x1722e2[_0x7995('0x4f')]));}else{_0x1722e2['recordingURL']='';}headers['Authorization']=getAuth(_0x2b3c1d);return getUser(_0x2b3c1d)[_0x7995('0x13')](function(_0x36d27d){_0x44372a=_0x36d27d;logger[_0x7995('0xf')](_0x7995('0x52'),_0x44372a['id']);return getEndUser(_0x2b3c1d,_0x1722e2[_0x7995('0x53')],_0x1722e2[_0x7995('0x54')]);})[_0x7995('0x13')](function(_0x13dc73){_0x10f012=_0x13dc73;logger[_0x7995('0xf')](_0x7995('0x55'),_0x10f012['id']);return getTicket(_0x2b3c1d,_0x44372a,_0x10f012,_0x25b534,_0x1722e2);})['then'](function(_0x2dc1f7){if(_0x2dc1f7){logger[_0x7995('0xf')](_0x7995('0x56'));logger['info'](_0x7995('0x69'),_0x2dc1f7['id']);}})[_0x7995('0x65')](function(_0x705f0){logger[_0x7995('0x5d')]('['+_0x1722e2[_0x7995('0x68')][_0x7995('0x6a')]()+']',JSON[_0x7995('0x1c')](_0x705f0));});}; \ No newline at end of file +var _0x7217=['format','%s/users','remoteUri','then','total_entries','find','entries','info','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','debug','stringify','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','_embedded','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','length','map','forEach','string','picklist','nameField','customField','content','toString','includes','idField','custom_fields','variable','variableName','type','customVariable','Variable','name','toLowerCase','priority','Creating\x20new\x20ticket...','merge','getString','new','xCALLY','Motion','CTI','Tags','Descriptions','user','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','integrationTab','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','catch','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','The\x20Ticket\x20ID\x20is:','%s/agent/tickets/%s','unmanaged','lastevent','toUpperCase','calleridname','lodash','md5','util','ioredis','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','emit','application/json','validateEmail','Getting\x20agent\x20with\x20email'];(function(_0x17902f,_0x49435f){var _0x470c3f=function(_0x55a252){while(--_0x55a252){_0x17902f['push'](_0x17902f['shift']());}};_0x470c3f(++_0x49435f);}(_0x7217,0x19e));var _0x7721=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0x7217[_0x934425];return _0x31d596;};'use strict';var _=require(_0x7721('0x0'));var rp=require('request-promise');var md5=require(_0x7721('0x1'));var util=require(_0x7721('0x2'));var Redis=require(_0x7721('0x3'));var intUtil=require(_0x7721('0x4'));var config=require(_0x7721('0x5'));var logger=require('../../../../config/logger')('desk');config[_0x7721('0x6')]=_[_0x7721('0x7')](config[_0x7721('0x6')],{'host':_0x7721('0x8'),'port':0x18eb});var io=require(_0x7721('0x9'))(new Redis(config[_0x7721('0x6')]));function emit(_0x18ab6b,_0x21f680,_0x225610){io['to'](_0x18ab6b)[_0x7721('0xa')](_0x21f680,_0x225610);}var headers={'Content-Type':_0x7721('0xb'),'Accept':_0x7721('0xb')};function getUser(_0xfa8835,_0x138740){if(intUtil[_0x7721('0xc')](_0x138740)===!![]){logger['info'](_0x7721('0xd'),_0x138740);return request({'uri':util[_0x7721('0xe')](_0x7721('0xf'),_0xfa8835[_0x7721('0x10')])})[_0x7721('0x11')](function(_0x409b37){if(_0x409b37[_0x7721('0x12')]){return _[_0x7721('0x13')](_0x409b37['_embedded'][_0x7721('0x14')],{'email':_0x138740});}})[_0x7721('0x11')](function(_0x57ff6d){if(_0x57ff6d){logger[_0x7721('0x15')](_0x7721('0x16'));return _0x57ff6d;}else{logger[_0x7721('0x15')](_0x7721('0x17'));return request({'uri':util['format'](_0x7721('0x18'),_0xfa8835[_0x7721('0x10')])});}});}else{logger['info']('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x7721('0x18'),_0xfa8835[_0x7721('0x10')])});}}function request(_0x3cc909){logger[_0x7721('0x19')]('[HTTP]',JSON[_0x7721('0x1a')](_0x3cc909));return rp(_['defaults'](_0x3cc909,{'method':_0x7721('0x1b'),'headers':headers,'json':!![]}));}function getAuth(_0x5cb0e6){var _0xfec626;if(_0x5cb0e6[_0x7721('0x1c')]===_0x7721('0x1d')){_0xfec626=util[_0x7721('0xe')](_0x7721('0x1e'),_0x5cb0e6[_0x7721('0x1f')],_0x5cb0e6[_0x7721('0x20')]);}else if(_0x5cb0e6[_0x7721('0x1c')]===_0x7721('0x21')){_0xfec626=util[_0x7721('0xe')]('%s/token:%s',_0x5cb0e6[_0x7721('0x1f')],_0x5cb0e6[_0x7721('0x21')]);}return util[_0x7721('0xe')](_0x7721('0x22'),new Buffer(_0xfec626)['toString'](_0x7721('0x23')));}function getEndUser(_0x512f31,_0xb9e9dd,_0x288e3a){logger[_0x7721('0x15')](_0x7721('0x24'),_0x288e3a);return request({'uri':util[_0x7721('0xe')](_0x7721('0x25'),_0x512f31[_0x7721('0x10')]),'qs':{'phone':_0x288e3a}})['then'](function(_0x216f20){if(_0x216f20[_0x7721('0x12')]){logger[_0x7721('0x15')](_0x7721('0x26'));return _0x216f20[_0x7721('0x27')][_0x7721('0x14')][0x0];}else{logger[_0x7721('0x15')](_0x7721('0x28'));return request({'uri':util[_0x7721('0xe')]('%s/customers',_0x512f31[_0x7721('0x10')]),'method':'POST','body':{'first_name':_0xb9e9dd,'title':_0xb9e9dd,'phone_numbers':[{'type':'work','value':_0x288e3a}]}});}});}function getTags(_0x315202,_0x343c19){var _0x53c904=[];if(_0x315202&&_0x315202[_0x7721('0x29')]>0x0){_0x53c904=_[_0x7721('0x2a')](_0x315202,_0x343c19);}return _0x53c904;}function getCustomFields(_0x37b9f0,_0xd7d703){var _0x1da2d8=[];var _0x5c54f0={'custom_fields':{}};if(_0x37b9f0[_0x7721('0x29')]>0x0){_[_0x7721('0x2b')](_0x37b9f0,function(_0x497f9f){if(_['includes']([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x2e')]&&!_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x497f9f[_0x7721('0x2e')]['toLowerCase']()]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_[_0x7721('0x32')]([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x7721('0x34')][_0x497f9f['idField']]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_0x497f9f['type']===_0x7721('0x35')&&_0x497f9f['variableName']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0xd7d703[_0x497f9f[_0x7721('0x36')]]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x36')]][_0x7721('0x31')]());}else if(_0x497f9f[_0x7721('0x37')]===_0x7721('0x38')&&_0x497f9f[_0x7721('0x39')]&&_0x497f9f[_0x7721('0x39')]['name']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f['customField']){_0xd7d703[_0x497f9f[_0x7721('0x39')][_0x7721('0x3a')][_0x7721('0x3b')]()]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x39')]['name']['toLowerCase']()]['toString']());}});}if(_0x5c54f0['priority']){_0x5c54f0[_0x7721('0x3c')]=Number(_0x5c54f0[_0x7721('0x3c')]);}return _0x5c54f0;}function getTicket(_0x1acc72,_0x22ef35,_0x4a90ce,_0xa389fa,_0x4cf659){logger[_0x7721('0x15')](_0x7721('0x3d'));var _0x5a278e=_[_0x7721('0x3e')]({'subject':intUtil[_0x7721('0x3f')](_0xa389fa['Subjects'],_0x4cf659,'\x20'),'type':'phone','status':_0x7721('0x40'),'labels':[_0x7721('0x41'),_0x7721('0x42'),_0x7721('0x43')]['concat'](getTags(_0xa389fa[_0x7721('0x44')],_0x7721('0x3a'))),'description':intUtil[_0x7721('0x3f')](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7721('0xe')]('/api/v2/users/%d',_0x22ef35['id']),'class':_0x7721('0x46')}},'message':{'direction':'in','body':intUtil['getString'](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a')}},getCustomFields(_0xa389fa['Fields'],_0x4cf659));return request({'uri':util[_0x7721('0xe')](_0x7721('0x47'),_0x1acc72[_0x7721('0x10')],_0x4a90ce['id']),'method':'POST','body':_0x5a278e});}exports[_0x7721('0x48')]=function(_0x11d853,_0x1ad315,_0x481fa8,_0x9f7b1d,_0x754071,_0xdb3033){var _0x2d5f35,_0x135dbc;_0xdb3033[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0xdb3033['remoteUri']);_0xdb3033['serverUrl']=intUtil[_0x7721('0x49')](_0xdb3033[_0x7721('0x4a')]);if(_0x754071&&_0x754071[_0x7721('0x4b')]){logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x4d'));_0x1ad315[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0xdb3033[_0x7721('0x4a')],_0x1ad315['uniqueid'],md5(_0x1ad315['uniqueid']));}else{_0x1ad315[_0x7721('0x4e')]='';}headers[_0x7721('0x50')]=getAuth(_0xdb3033);return getUser(_0xdb3033,_0x9f7b1d[_0x7721('0x51')])[_0x7721('0x11')](function(_0x589e95){_0x2d5f35=_0x589e95;logger[_0x7721('0x15')](_0x7721('0x52'),_0x2d5f35['id']);return getEndUser(_0xdb3033,_0x1ad315['calleridname'],_0x1ad315[_0x7721('0x53')]);})['then'](function(_0x2682b1){_0x135dbc=_0x2682b1;logger['info'](_0x7721('0x54'),_0x135dbc['id']);return getTicket(_0xdb3033,_0x2d5f35,_0x135dbc,_0x481fa8,_0x1ad315);})[_0x7721('0x11')](function(_0xf17c40){if(_0xf17c40){logger['info'](_0x7721('0x55'));logger[_0x7721('0x15')]('The\x20Ticket\x20ID\x20is:',_0xf17c40['id']);switch(_0xdb3033[_0x7721('0x37')]){case _0x7721('0x56'):logger[_0x7721('0x15')]('[QUEUE]',_0x7721('0x57'));emit(util['format'](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0xf17c40['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x5d'),_0xf17c40['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x4c'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2f6f30){console[_0x7721('0x5e')](_0x2f6f30);logger[_0x7721('0x5e')](_0x7721('0x4c'),JSON[_0x7721('0x1a')](_0x2f6f30));});};exports[_0x7721('0x60')]=function(_0x57484c,_0x234bee,_0x17036e,_0x134908,_0x3b7382,_0x1f1e84,_0x9c0d4){var _0x7fbd6c,_0x33287d;_0x1f1e84[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x10')]);_0x1f1e84['serverUrl']=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x4a')]);if(_0x9c0d4&&_0x9c0d4[_0x7721('0x61')]&&_0x9c0d4[_0x7721('0x61')]!==_0x7721('0x62')){logger[_0x7721('0x15')](_0x7721('0x63'),_0x7721('0x4d'));_0x234bee[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0x1f1e84[_0x7721('0x4a')],_0x234bee[_0x7721('0x64')],md5(_0x234bee[_0x7721('0x64')]));}headers[_0x7721('0x50')]=getAuth(_0x1f1e84);return getUser(_0x1f1e84,_0x134908['email'])['then'](function(_0x4e112e){_0x7fbd6c=_0x4e112e;logger[_0x7721('0x15')]('The\x20User\x20ID\x20is:',_0x7fbd6c['id']);return getEndUser(_0x1f1e84,_0x234bee['destcalleridname'],_0x234bee['destcalleridnum']);})['then'](function(_0x47925a){_0x33287d=_0x47925a;logger[_0x7721('0x15')](_0x7721('0x54'),_0x33287d['id']);return getTicket(_0x1f1e84,_0x7fbd6c,_0x33287d,_0x17036e,_0x234bee);})['then'](function(_0x5181d7){if(_0x5181d7){logger['info']('Ticket\x20created!');logger['info'](_0x7721('0x65'),_0x5181d7['id']);switch(_0x1f1e84['type']){case'integrationTab':logger['info'](_0x7721('0x4c'),_0x7721('0x57'));emit(util[_0x7721('0xe')]('user:%s',_0x134908[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0x5181d7['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x134908[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x66'),_0x1f1e84[_0x7721('0x10')],_0x5181d7['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x63'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2c93b0){logger[_0x7721('0x5e')](_0x7721('0x63'),JSON['stringify'](_0x2c93b0));});};exports[_0x7721('0x67')]=function(_0x104f05,_0x4c8284,_0x3e7df3,_0x5d37ad,_0x1f508d,_0x4bfb48){var _0x36a3a6,_0x3f9eaa;_0x4bfb48[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x4bfb48[_0x7721('0x10')]);_0x4bfb48[_0x7721('0x4a')]=intUtil[_0x7721('0x49')](_0x4bfb48['serverUrl']);if(_0x1f508d&&_0x1f508d[_0x7721('0x4b')]){logger[_0x7721('0x15')]('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',_0x7721('0x4d'));_0x4c8284[_0x7721('0x4e')]=util[_0x7721('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4bfb48[_0x7721('0x4a')],_0x4c8284[_0x7721('0x64')],md5(_0x4c8284['uniqueid']));}else{_0x4c8284[_0x7721('0x4e')]='';}headers['Authorization']=getAuth(_0x4bfb48);return getUser(_0x4bfb48)[_0x7721('0x11')](function(_0x382800){_0x36a3a6=_0x382800;logger[_0x7721('0x15')](_0x7721('0x52'),_0x36a3a6['id']);return getEndUser(_0x4bfb48,_0x4c8284[_0x7721('0x6a')],_0x4c8284[_0x7721('0x53')]);})[_0x7721('0x11')](function(_0x5dca04){_0x3f9eaa=_0x5dca04;logger[_0x7721('0x15')](_0x7721('0x54'),_0x3f9eaa['id']);return getTicket(_0x4bfb48,_0x36a3a6,_0x3f9eaa,_0x3e7df3,_0x4c8284);})[_0x7721('0x11')](function(_0x5f08cc){if(_0x5f08cc){logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x5f08cc['id']);}})[_0x7721('0x5f')](function(_0x2645dd){logger['error']('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',JSON[_0x7721('0x1a')](_0x2645dd));});}; \ 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 c6db683..1c76527 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 _0x990a=['odata-entityid','substring','lastIndexOf','enduserId','telephone1','GET','&$filter=','replace','4.0','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','info',']\x20Enduser\x20created!','forEach','string','picklist','type','nameField','customField','idField','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','/contacts(','Fields','phonecall','callDirection','queue','phonecalls','Descriptions','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','stripTrailingSlash','data7','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','request-promise','util','./util','md5','dynamics365','../../../../config/environment','redis','localhost','modernAuthentication','CloudProvider','tenantId','data2','resolve','data5','remoteUri','username','clientSecret','then','access_token','catch','error','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','value','isNil','email','userEmail','length','internalemailaddress','toUpperCase',']\x20Agent\x20found\x20','userId','systemuserid','toLowerCase','outbound','destcalleridnum','calleridnum','POST','contacts','/systemusers(','body','headers'];(function(_0x185238,_0xce913){var _0x2b1f10=function(_0x1133ce){while(--_0x1133ce){_0x185238['push'](_0x185238['shift']());}};_0x2b1f10(++_0xce913);}(_0x990a,0x17d));var _0xa990=function(_0x51c260,_0x12859d){_0x51c260=_0x51c260-0x0;var _0x300e8e=_0x990a[_0x51c260];return _0x300e8e;};'use strict';var _=require('lodash');var rp=require(_0xa990('0x0'));var util=require(_0xa990('0x1'));var intUtil=require(_0xa990('0x2'));var md5=require(_0xa990('0x3'));var Redis=require('ioredis');var logger=require('../../../../config/logger')(_0xa990('0x4'));var config=require(_0xa990('0x5'));config[_0xa990('0x6')]=_['defaults'](config['redis'],{'host':_0xa990('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa990('0x6')]));function getAuthToken(_0x46effb,_0x4b2c55,_0x5ec0e8){if(_0x46effb[_0xa990('0x8')]){_0x46effb['remoteUri']=_0x46effb[_0xa990('0x9')]['data7'];_0x46effb[_0xa990('0xa')]=_0x46effb['CloudProvider'][_0xa990('0xb')];return Promise[_0xa990('0xc')](_0x46effb['CloudProvider'][_0xa990('0xd')]);}var _0x144225={'method':'POST','uri':_0x4b2c55,'form':{'client_id':_0x46effb['clientId'],'resource':_0x46effb[_0xa990('0xe')],'username':_0x46effb[_0xa990('0xf')],'password':_0x46effb['password'],'grant_type':'password','client_secret':_0x46effb[_0xa990('0x10')]},'json':!![]};return rp(_0x144225)[_0xa990('0x11')](function(_0x328af0){return _0x328af0[_0xa990('0x12')];})[_0xa990('0x13')](function(_0x14eb91){logger[_0xa990('0x14')]('['+[_0x5ec0e8['toUpperCase']()]+']\x20Wrong\x20credentials!');return _0x14eb91[_0xa990('0x15')];});}function getUser(_0x277501,_0x554172,_0x4dfa74,_0x29d974,_0x258d95,_0x5c296e){return new Promise(function(_0x39c03f,_0xaebc48){return getAuthToken(_0x554172,_0x29d974,_0x5c296e)[_0xa990('0x11')](function(_0x4b14f4){var _0xd381f8={'method':'GET','uri':_0x258d95+_0xa990('0x16'),'headers':{'Authorization':_0xa990('0x17')+_0x4b14f4,'OData-Version':'4.0'},'json':!![]};return rp(_0xd381f8);})[_0xa990('0x11')](function(_0x4401ba){var _0x210958=_0x4401ba[_0xa990('0x18')];var _0x5509f4=![];var _0x2367df=null;if(!_[_0xa990('0x19')](_0x4dfa74)){if(intUtil['validateEmail'](_0x4dfa74[_0xa990('0x1a')])){_0x277501[_0xa990('0x1b')]=_0x4dfa74[_0xa990('0x1a')];for(_0x2367df=0x0;_0x2367df<_0x210958[_0xa990('0x1c')];_0x2367df++){if(_0x210958[_0x2367df][_0xa990('0x1d')]===_0x4dfa74[_0xa990('0x1a')]&&!_0x210958[_0x2367df]['isdisabled']){_0x5509f4=!![];logger['info']('['+[_0x5c296e[_0xa990('0x1e')]()]+_0xa990('0x1f')+_0x210958[_0x2367df]['systemuserid']+'!');_0x277501[_0xa990('0x20')]=_0x210958[_0x2367df][_0xa990('0x21')];}}}}if(!_0x5509f4){logger['info']('['+[_0x5c296e[_0xa990('0x1e')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x277501[_0xa990('0x1b')]=_0x554172[_0xa990('0xf')];for(_0x2367df=0x0;_0x2367df<_0x210958[_0xa990('0x1c')];_0x2367df++){if(_0x210958[_0x2367df][_0xa990('0x1d')]===_0x554172[_0xa990('0xf')]){_0x277501[_0xa990('0x20')]=_0x210958[_0x2367df][_0xa990('0x21')];}}}_0x39c03f(_0x277501);})[_0xa990('0x13')](function(_0x5a2726){_0xaebc48(_0x5a2726[_0xa990('0x15')]);});});}function createEndUser(_0xe00668,_0x1cc4f5,_0x19ae18,_0x5371d3,_0x5c3e25,_0x47a8eb,_0x42b764){return new Promise(function(_0x37a58c,_0x3b4324){return getAuthToken(_0x1cc4f5,_0x19ae18,_0x47a8eb)[_0xa990('0x11')](function(_0x188965){var _0x8e896f=_0x47a8eb[_0xa990('0x22')]()===_0xa990('0x23')?_0x5c3e25[_0xa990('0x24')]:_0x5c3e25[_0xa990('0x25')];var _0x21b033={'method':_0xa990('0x26'),'uri':_0x5371d3+_0xa990('0x27'),'body':{'fullname':_0x8e896f,'firstname':_0x8e896f,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xa990('0x28')+_0xe00668[_0xa990('0x20')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x188965,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x21b033[_0xa990('0x29')][_0x42b764]=_0x8e896f;return rp(_0x21b033);})[_0xa990('0x11')](function(_0x5e459f){var _0x1da802=_0x5e459f[_0xa990('0x2a')][_0xa990('0x2b')];var _0x263aee=_0x1da802[_0xa990('0x2c')](_0x1da802[_0xa990('0x2d')]('(')+0x1,_0x1da802['lastIndexOf'](')'));_0xe00668[_0xa990('0x2e')]=_0x263aee;_0x37a58c(_0xe00668);})['catch'](function(_0x1ec10e){_0x3b4324(_0x1ec10e[_0xa990('0x15')]);});});}function getEndUser(_0x13822,_0x4b050a,_0x4348d8,_0x2df777,_0x140840,_0x4ef5d6,_0x165d79,_0x346f9c){var _0x43c842=_0x4ef5d6[_0xa990('0x22')]()===_0xa990('0x23')?_0x140840['destcalleridnum']:_0x140840['calleridnum'];return getAuthToken(_0x4b050a,_0x4348d8,_0x4ef5d6)[_0xa990('0x11')](function(_0x170457){_0x346f9c=_0x346f9c?_0x346f9c:_0xa990('0x2f');var _0x4f0755={'method':_0xa990('0x30'),'uri':_0x2df777+'contacts?$select='+_0x346f9c+_0xa990('0x31')+_0x346f9c+'\x20eq\x20\x27'+_0x43c842[_0xa990('0x32')]('+','%2b')+'\x27','headers':{'Authorization':'Bearer\x20'+_0x170457,'If-None-Match':null,'OData-Version':_0xa990('0x33')},'json':!![]};return rp(_0x4f0755);})[_0xa990('0x11')](function(_0x4bb69e){var _0x38e0a9=![];if(!_0x4bb69e)return _0x38e0a9;var _0x40499b=_0x4bb69e[_0xa990('0x18')];for(var _0x594507=0x0;_0x594507<_0x40499b[_0xa990('0x1c')];_0x594507++){if(_0x40499b[_0x594507][_0x346f9c]===_0x43c842){_0x38e0a9=!![];_0x13822[_0xa990('0x2e')]=_0x40499b[_0x594507][_0xa990('0x34')];}}return _0x38e0a9;})['then'](function(_0xa37b6b){if(_0xa37b6b)return _0x13822;if(_0x165d79===_0xa990('0x35')){logger['info']('['+[_0x4ef5d6[_0xa990('0x1e')]()]+_0xa990('0x36'));return _0x13822;}return createEndUser(_0x13822,_0x4b050a,_0x4348d8,_0x2df777,_0x140840,_0x4ef5d6,_0x346f9c)[_0xa990('0x11')](function(_0x178cfe){logger[_0xa990('0x37')]('['+[_0x4ef5d6['toUpperCase']()]+_0xa990('0x38'),_0x178cfe[_0xa990('0x2e')]);return _0x178cfe;});});}function getCustomFields(_0x23916c,_0x496529,_0x4f9d7c){var _0x5c3874={};if(_0x23916c[_0xa990('0x1c')]>0x0){_[_0xa990('0x39')](_0x23916c,function(_0x534f3e){if(_['includes']([_0xa990('0x3a'),_0xa990('0x3b')],_0x534f3e[_0xa990('0x3c')])&&_0x534f3e[_0xa990('0x3d')]&&!_0x534f3e[_0xa990('0x3e')]){var _0x2c805e=_0x534f3e[_0xa990('0x3f')]['toLowerCase']();var _0xe2be8c=_0x2c805e['substring'](0x0,_0x2c805e[_0xa990('0x40')]('_'));var _0x3c6d01=_0x2c805e['substring'](_0x2c805e[_0xa990('0x40')]('_')+0x1);if(_0xe2be8c===_0x4f9d7c){_0x5c3874[_0x3c6d01]=_0x534f3e[_0xa990('0x41')];}}});}return _0x5c3874;}function getTicket(_0x18ff4e,_0x81f8f4,_0x133d22,_0x4ad12d,_0x3b3dde,_0x463a01,_0x3a9426){return new Promise(function(_0xb7e205,_0x35dfc8){var _0x107388;return getAuthToken(_0x81f8f4,_0x133d22,_0x3a9426)[_0xa990('0x11')](function(_0x31fe26){if(_0x463a01[_0xa990('0x42')]===_0xa990('0x43')){_0x107388={'method':_0xa990('0x26'),'uri':_0x4ad12d+_0xa990('0x44'),'body':Object[_0xa990('0x45')]({},{'title':intUtil[_0xa990('0x46')](_0x463a01[_0xa990('0x47')],_0x3b3dde,'\x20'),'description':intUtil['getString'](_0x463a01['Descriptions'],_0x3b3dde,'\x0a'),'customerid_contact@odata.bind':_0x18ff4e[_0xa990('0x2e')]?_0xa990('0x48')+_0x18ff4e['enduserId']+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x18ff4e[_0xa990('0x20')]+')','caseorigincode':'1'},getCustomFields(_0x463a01[_0xa990('0x49')],_0x3b3dde,_0x463a01[_0xa990('0x42')])),'headers':{'Authorization':_0xa990('0x17')+_0x31fe26,'OData-Version':_0xa990('0x33')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x463a01['ticketType']===_0xa990('0x4a')){var _0xad461=_0x18ff4e[_0xa990('0x2e')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x18ff4e[_0xa990('0x20')]+')','participationtypemask':_0x18ff4e[_0xa990('0x4b')]===_0xa990('0x4c')?0x2:0x1},{'partyid_contact@odata.bind':_0xa990('0x48')+_0x18ff4e[_0xa990('0x2e')]+')','participationtypemask':_0x18ff4e[_0xa990('0x4b')]===_0xa990('0x4c')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xa990('0x28')+_0x18ff4e['userId']+')','participationtypemask':_0x18ff4e[_0xa990('0x4b')]===_0xa990('0x4c')?0x2:0x1}];_0x107388={'method':_0xa990('0x26'),'uri':_0x4ad12d+_0xa990('0x4d'),'body':Object[_0xa990('0x45')]({},{'subject':intUtil['getString'](_0x463a01[_0xa990('0x47')],_0x3b3dde,'\x20'),'phonenumber':String(_0x3b3dde[_0xa990('0x25')]),'description':intUtil[_0xa990('0x46')](_0x463a01[_0xa990('0x4e')],_0x3b3dde,'\x0a'),'regardingobjectid_contact@odata.bind':_0x18ff4e[_0xa990('0x2e')]?_0xa990('0x48')+_0x18ff4e[_0xa990('0x2e')]+')':undefined,'ownerid@odata.bind':_0xa990('0x28')+_0x18ff4e['userId']+')','directioncode':_0x18ff4e[_0xa990('0x4b')]==='queue'?![]:!![],'phonecall_activity_parties':_0xad461},getCustomFields(_0x463a01[_0xa990('0x49')],_0x3b3dde,_0x463a01['ticketType'])),'headers':{'Authorization':_0xa990('0x17')+_0x31fe26,'OData-Version':_0xa990('0x33')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x107388);})[_0xa990('0x11')](function(_0x372825){var _0xde516e=_0x372825[_0xa990('0x2a')]['odata-entityid'];var _0x5b68ee=_0xde516e[_0xa990('0x2c')](_0xde516e['lastIndexOf']('(')+0x1,_0xde516e[_0xa990('0x2d')](')'));_0x18ff4e['ticketId']=_0x5b68ee;_0xb7e205(_0x18ff4e);})[_0xa990('0x13')](function(_0xc45ea6){_0x35dfc8(_0xc45ea6[_0xa990('0x15')]);});});}function emit(_0x56a95f,_0xcdc8aa,_0x223878,_0x505560){var _0x55a1c8={'uri':util[_0xa990('0x4f')](_0xa990('0x50'),_0x56a95f,_0x223878,_0x505560)};io['to'](util[_0xa990('0x4f')](_0xa990('0x51'),_0xcdc8aa))[_0xa990('0x52')]('trigger:browser:url',_0x55a1c8);}exports['cs']=function(_0x4e983b,_0x1e4bd6,_0x37a254,_0x409670,_0x51ae2e,_0x17fc6b,_0x4f4b0a,_0x292dae){var _0x55caa3={};_0x17fc6b[_0xa990('0xe')]=_0x17fc6b[_0xa990('0x8')]?intUtil[_0xa990('0x53')](_0x17fc6b[_0xa990('0x9')][_0xa990('0x54')]):intUtil[_0xa990('0x53')](_0x17fc6b[_0xa990('0xe')]);_0x17fc6b[_0xa990('0x55')]=intUtil[_0xa990('0x53')](_0x17fc6b['serverUrl']);_0x55caa3['callDirection']=_0x292dae==='queue'||_0x292dae===_0xa990('0x56')?_0xa990('0x4c'):'outbound';var _0x10c8ef=_0x17fc6b[_0xa990('0x8')]?util[_0xa990('0x4f')](_0xa990('0x57'),_0x17fc6b[_0xa990('0x9')]['data7']):util['format'](_0xa990('0x57'),_0x17fc6b[_0xa990('0xe')]);var _0x26fcdb=util[_0xa990('0x4f')](_0xa990('0x58'),_0x17fc6b[_0xa990('0xa')]);var _0xb93ab1=util[_0xa990('0x4f')](_0xa990('0x59'),_0x17fc6b[_0xa990('0x55')],_0x1e4bd6[_0xa990('0x5a')],md5(_0x1e4bd6[_0xa990('0x5a')]));if(_0x51ae2e&&_0x51ae2e['monitor_format']){logger[_0xa990('0x37')]('[QUEUE]','Recording\x20is\x20enabled!');_0x1e4bd6['recordingURL']=_0xb93ab1;}else if(_0x4f4b0a&&_0x4f4b0a[_0xa990('0x5b')]&&_0x4f4b0a[_0xa990('0x5b')]!=='none'){logger[_0xa990('0x37')](_0xa990('0x5c'),_0xa990('0x5d'));_0x1e4bd6[_0xa990('0x5e')]=_0xb93ab1;}else{_0x1e4bd6[_0xa990('0x5e')]='';}return getUser(_0x55caa3,_0x17fc6b,_0x409670,_0x26fcdb,_0x10c8ef,_0x292dae)[_0xa990('0x11')](function(_0x142df5){logger[_0xa990('0x37')]('['+_0x292dae[_0xa990('0x1e')]()+_0xa990('0x5f'),_0x142df5['userId']);logger['info']('['+_0x292dae[_0xa990('0x1e')]()+_0xa990('0x60'),_0x142df5[_0xa990('0x1b')]);return getEndUser(_0x142df5,_0x17fc6b,_0x26fcdb,_0x10c8ef,_0x1e4bd6,_0x292dae,_0x37a254[_0xa990('0x61')],_0x37a254['additionalSearchContact']);})[_0xa990('0x11')](function(_0x216b59){logger[_0xa990('0x37')]('['+_0x292dae[_0xa990('0x1e')]()+_0xa990('0x62'),_0x216b59[_0xa990('0x2e')]);logger['info']('['+_0x292dae['toUpperCase']()+_0xa990('0x63'),_0x1e4bd6['calleridnum']);return getTicket(_0x216b59,_0x17fc6b,_0x26fcdb,_0x10c8ef,_0x1e4bd6,_0x37a254,_0x292dae);})[_0xa990('0x11')](function(_0x34c467){logger['info'](util[_0xa990('0x4f')]('['+_0x292dae[_0xa990('0x1e')]()+_0xa990('0x64'),_0x37a254[_0xa990('0x42')],_0x34c467[_0xa990('0x65')]));logger['info'](util['format']('['+_0x292dae[_0xa990('0x1e')]()+_0xa990('0x66'),_0x292dae));if(_0x292dae!==_0xa990('0x56')){logger[_0xa990('0x37')]('['+_0x292dae['toUpperCase']()+']',_0xa990('0x67'));emit(_0x17fc6b[_0xa990('0xe')],_0x409670[_0xa990('0x68')],_0x37a254[_0xa990('0x42')],_0x34c467[_0xa990('0x65')]);}})[_0xa990('0x13')](function(_0xd6a58a){logger[_0xa990('0x14')]('['+_0x292dae[_0xa990('0x1e')]()+_0xa990('0x69'),_0xd6a58a['message']);});}; \ No newline at end of file +var _0x2fbc=['userId','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','username','internalemailaddress','toLowerCase','outbound','destcalleridnum','POST','contacts','/systemusers(','4.0','body','headers','odata-entityid','substring','lastIndexOf','calleridnum','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','%2b','enduserId','contactid','nothing','info',']\x20Enduser\x20created!','string','picklist','nameField','customField','idField','indexOf','content','ticketType','assign','getString','Subjects','Descriptions','/contacts(','phonecall','queue','callDirection','phonecalls','Fields','format','user:%s','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20phone\x20is:','ticketId',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','lodash','request-promise','util','./util','md5','ioredis','../../../../config/environment','defaults','redis','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','resolve','data5','password','clientSecret','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','value','isNil','validateEmail','email','length',']\x20Agent\x20found\x20'];(function(_0xdd4d72,_0x54d564){var _0x15d894=function(_0x47729e){while(--_0x47729e){_0xdd4d72['push'](_0xdd4d72['shift']());}};_0x15d894(++_0x54d564);}(_0x2fbc,0x121));var _0xc2fb=function(_0xa50c15,_0x3a9c38){_0xa50c15=_0xa50c15-0x0;var _0xfc5e20=_0x2fbc[_0xa50c15];return _0xfc5e20;};'use strict';var _=require(_0xc2fb('0x0'));var rp=require(_0xc2fb('0x1'));var util=require(_0xc2fb('0x2'));var intUtil=require(_0xc2fb('0x3'));var md5=require(_0xc2fb('0x4'));var Redis=require(_0xc2fb('0x5'));var logger=require('../../../../config/logger')('dynamics365');var config=require(_0xc2fb('0x6'));config['redis']=_[_0xc2fb('0x7')](config[_0xc2fb('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xc2fb('0x9'))(new Redis(config[_0xc2fb('0x8')]));function getAuthToken(_0x216043,_0x86a6d2,_0x7f471b){if(_0x216043[_0xc2fb('0xa')]){_0x216043[_0xc2fb('0xb')]=_0x216043[_0xc2fb('0xc')][_0xc2fb('0xd')];_0x216043[_0xc2fb('0xe')]=_0x216043['CloudProvider']['data2'];return Promise[_0xc2fb('0xf')](_0x216043[_0xc2fb('0xc')][_0xc2fb('0x10')]);}var _0x293f88={'method':'POST','uri':_0x86a6d2,'form':{'client_id':_0x216043['clientId'],'resource':_0x216043['remoteUri'],'username':_0x216043['username'],'password':_0x216043[_0xc2fb('0x11')],'grant_type':_0xc2fb('0x11'),'client_secret':_0x216043[_0xc2fb('0x12')]},'json':!![]};return rp(_0x293f88)['then'](function(_0x5cd739){return _0x5cd739[_0xc2fb('0x13')];})[_0xc2fb('0x14')](function(_0x57769d){logger[_0xc2fb('0x15')]('['+[_0x7f471b[_0xc2fb('0x16')]()]+_0xc2fb('0x17'));return _0x57769d[_0xc2fb('0x18')];});}function getUser(_0x15ff7d,_0x1313a0,_0x1c8ceb,_0x58ff10,_0x4c7d4a,_0x556372){return new Promise(function(_0x204eff,_0x363647){return getAuthToken(_0x1313a0,_0x58ff10,_0x556372)[_0xc2fb('0x19')](function(_0x202e97){var _0x29de6d={'method':_0xc2fb('0x1a'),'uri':_0x4c7d4a+_0xc2fb('0x1b'),'headers':{'Authorization':_0xc2fb('0x1c')+_0x202e97,'OData-Version':'4.0'},'json':!![]};return rp(_0x29de6d);})['then'](function(_0x1b7794){var _0xa6d02d=_0x1b7794[_0xc2fb('0x1d')];var _0x5a3c88=![];var _0x3e7f3d=null;if(!_[_0xc2fb('0x1e')](_0x1c8ceb)){if(intUtil[_0xc2fb('0x1f')](_0x1c8ceb[_0xc2fb('0x20')])){_0x15ff7d['userEmail']=_0x1c8ceb[_0xc2fb('0x20')];for(_0x3e7f3d=0x0;_0x3e7f3d<_0xa6d02d[_0xc2fb('0x21')];_0x3e7f3d++){if(_0xa6d02d[_0x3e7f3d]['internalemailaddress']===_0x1c8ceb['email']&&!_0xa6d02d[_0x3e7f3d]['isdisabled']){_0x5a3c88=!![];logger['info']('['+[_0x556372[_0xc2fb('0x16')]()]+_0xc2fb('0x22')+_0xa6d02d[_0x3e7f3d]['systemuserid']+'!');_0x15ff7d[_0xc2fb('0x23')]=_0xa6d02d[_0x3e7f3d][_0xc2fb('0x24')];}}}}if(!_0x5a3c88){logger['info']('['+[_0x556372[_0xc2fb('0x16')]()]+_0xc2fb('0x25'));_0x15ff7d[_0xc2fb('0x26')]=_0x1313a0[_0xc2fb('0x27')];for(_0x3e7f3d=0x0;_0x3e7f3d<_0xa6d02d[_0xc2fb('0x21')];_0x3e7f3d++){if(_0xa6d02d[_0x3e7f3d][_0xc2fb('0x28')]===_0x1313a0['username']){_0x15ff7d[_0xc2fb('0x23')]=_0xa6d02d[_0x3e7f3d]['systemuserid'];}}}_0x204eff(_0x15ff7d);})[_0xc2fb('0x14')](function(_0x106515){_0x363647(_0x106515[_0xc2fb('0x18')]);});});}function createEndUser(_0x4c6a63,_0x43c9bb,_0x492308,_0xcab8c,_0x326471,_0x54d80a,_0x48b8b4){return new Promise(function(_0x2bdb47,_0x5b55b1){return getAuthToken(_0x43c9bb,_0x492308,_0x54d80a)[_0xc2fb('0x19')](function(_0x182a06){var _0x3912a9=_0x54d80a[_0xc2fb('0x29')]()===_0xc2fb('0x2a')?_0x326471[_0xc2fb('0x2b')]:_0x326471['calleridnum'];var _0x42df15={'method':_0xc2fb('0x2c'),'uri':_0xcab8c+_0xc2fb('0x2d'),'body':{'fullname':_0x3912a9,'firstname':_0x3912a9,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xc2fb('0x2e')+_0x4c6a63[_0xc2fb('0x23')]+')'},'headers':{'Authorization':_0xc2fb('0x1c')+_0x182a06,'OData-Version':_0xc2fb('0x2f')},'json':!![],'resolveWithFullResponse':!![]};_0x42df15[_0xc2fb('0x30')][_0x48b8b4]=_0x3912a9;return rp(_0x42df15);})[_0xc2fb('0x19')](function(_0x2f7251){var _0x38b8d2=_0x2f7251[_0xc2fb('0x31')][_0xc2fb('0x32')];var _0x312585=_0x38b8d2[_0xc2fb('0x33')](_0x38b8d2[_0xc2fb('0x34')]('(')+0x1,_0x38b8d2[_0xc2fb('0x34')](')'));_0x4c6a63['enduserId']=_0x312585;_0x2bdb47(_0x4c6a63);})[_0xc2fb('0x14')](function(_0xe66a75){_0x5b55b1(_0xe66a75[_0xc2fb('0x18')]);});});}function getEndUser(_0x53249d,_0x1f57e3,_0x22485b,_0x1fa887,_0x109fde,_0xa50715,_0x2d3b9b,_0x183b04){var _0x4be4e6=_0xa50715[_0xc2fb('0x29')]()===_0xc2fb('0x2a')?_0x109fde['destcalleridnum']:_0x109fde[_0xc2fb('0x35')];return getAuthToken(_0x1f57e3,_0x22485b,_0xa50715)['then'](function(_0xb430d2){_0x183b04=_0x183b04?_0x183b04:_0xc2fb('0x36');var _0x44e19d={'method':_0xc2fb('0x1a'),'uri':_0x1fa887+_0xc2fb('0x37')+_0x183b04+_0xc2fb('0x38')+_0x183b04+_0xc2fb('0x39')+_0x4be4e6[_0xc2fb('0x3a')]('+',_0xc2fb('0x3b'))+'\x27','headers':{'Authorization':_0xc2fb('0x1c')+_0xb430d2,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x44e19d);})['then'](function(_0x437a23){var _0x310922=![];if(!_0x437a23)return _0x310922;var _0x1d2790=_0x437a23[_0xc2fb('0x1d')];for(var _0x26cf50=0x0;_0x26cf50<_0x1d2790[_0xc2fb('0x21')];_0x26cf50++){if(_0x1d2790[_0x26cf50][_0x183b04]===_0x4be4e6){_0x310922=!![];_0x53249d[_0xc2fb('0x3c')]=_0x1d2790[_0x26cf50][_0xc2fb('0x3d')];}}return _0x310922;})['then'](function(_0xcfb30e){if(_0xcfb30e)return _0x53249d;if(_0x2d3b9b===_0xc2fb('0x3e')){logger[_0xc2fb('0x3f')]('['+[_0xa50715[_0xc2fb('0x16')]()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x53249d;}return createEndUser(_0x53249d,_0x1f57e3,_0x22485b,_0x1fa887,_0x109fde,_0xa50715,_0x183b04)[_0xc2fb('0x19')](function(_0x379a08){logger[_0xc2fb('0x3f')]('['+[_0xa50715['toUpperCase']()]+_0xc2fb('0x40'),_0x379a08[_0xc2fb('0x3c')]);return _0x379a08;});});}function getCustomFields(_0x6904f5,_0x5c0131,_0x45fbbb){var _0x4daecc={};if(_0x6904f5[_0xc2fb('0x21')]>0x0){_['forEach'](_0x6904f5,function(_0x3244a5){if(_['includes']([_0xc2fb('0x41'),_0xc2fb('0x42')],_0x3244a5['type'])&&_0x3244a5[_0xc2fb('0x43')]&&!_0x3244a5[_0xc2fb('0x44')]){var _0x2fb99e=_0x3244a5[_0xc2fb('0x45')]['toLowerCase']();var _0x11728c=_0x2fb99e[_0xc2fb('0x33')](0x0,_0x2fb99e[_0xc2fb('0x46')]('_'));var _0x25c4a4=_0x2fb99e[_0xc2fb('0x33')](_0x2fb99e[_0xc2fb('0x46')]('_')+0x1);if(_0x11728c===_0x45fbbb){_0x4daecc[_0x25c4a4]=_0x3244a5[_0xc2fb('0x47')];}}});}return _0x4daecc;}function getTicket(_0x32c6f7,_0x39b95b,_0x42f466,_0x1921ea,_0x1d426c,_0x47493d,_0x3be93a){return new Promise(function(_0x4a0e26,_0x3f21a2){var _0x56865c;return getAuthToken(_0x39b95b,_0x42f466,_0x3be93a)[_0xc2fb('0x19')](function(_0x55625d){if(_0x47493d[_0xc2fb('0x48')]==='incident'){_0x56865c={'method':_0xc2fb('0x2c'),'uri':_0x1921ea+'incidents','body':Object[_0xc2fb('0x49')]({},{'title':intUtil[_0xc2fb('0x4a')](_0x47493d[_0xc2fb('0x4b')],_0x1d426c,'\x20'),'description':intUtil[_0xc2fb('0x4a')](_0x47493d[_0xc2fb('0x4c')],_0x1d426c,'\x0a'),'customerid_contact@odata.bind':_0x32c6f7['enduserId']?_0xc2fb('0x4d')+_0x32c6f7['enduserId']+')':undefined,'ownerid@odata.bind':_0xc2fb('0x2e')+_0x32c6f7[_0xc2fb('0x23')]+')','caseorigincode':'1'},getCustomFields(_0x47493d['Fields'],_0x1d426c,_0x47493d[_0xc2fb('0x48')])),'headers':{'Authorization':_0xc2fb('0x1c')+_0x55625d,'OData-Version':_0xc2fb('0x2f')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x47493d[_0xc2fb('0x48')]===_0xc2fb('0x4e')){var _0x230a96=_0x32c6f7[_0xc2fb('0x3c')]?[{'partyid_systemuser@odata.bind':_0xc2fb('0x2e')+_0x32c6f7['userId']+')','participationtypemask':_0x32c6f7['callDirection']===_0xc2fb('0x4f')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x32c6f7[_0xc2fb('0x3c')]+')','participationtypemask':_0x32c6f7['callDirection']==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xc2fb('0x2e')+_0x32c6f7['userId']+')','participationtypemask':_0x32c6f7[_0xc2fb('0x50')]===_0xc2fb('0x4f')?0x2:0x1}];_0x56865c={'method':_0xc2fb('0x2c'),'uri':_0x1921ea+_0xc2fb('0x51'),'body':Object['assign']({},{'subject':intUtil[_0xc2fb('0x4a')](_0x47493d[_0xc2fb('0x4b')],_0x1d426c,'\x20'),'phonenumber':String(_0x1d426c[_0xc2fb('0x35')]),'description':intUtil[_0xc2fb('0x4a')](_0x47493d[_0xc2fb('0x4c')],_0x1d426c,'\x0a'),'regardingobjectid_contact@odata.bind':_0x32c6f7['enduserId']?_0xc2fb('0x4d')+_0x32c6f7[_0xc2fb('0x3c')]+')':undefined,'ownerid@odata.bind':_0xc2fb('0x2e')+_0x32c6f7[_0xc2fb('0x23')]+')','directioncode':_0x32c6f7[_0xc2fb('0x50')]==='queue'?![]:!![],'phonecall_activity_parties':_0x230a96},getCustomFields(_0x47493d[_0xc2fb('0x52')],_0x1d426c,_0x47493d[_0xc2fb('0x48')])),'headers':{'Authorization':_0xc2fb('0x1c')+_0x55625d,'OData-Version':_0xc2fb('0x2f')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x56865c);})['then'](function(_0x3a06d2){var _0x364bd8=_0x3a06d2[_0xc2fb('0x31')][_0xc2fb('0x32')];var _0x123b4f=_0x364bd8[_0xc2fb('0x33')](_0x364bd8[_0xc2fb('0x34')]('(')+0x1,_0x364bd8[_0xc2fb('0x34')](')'));_0x32c6f7['ticketId']=_0x123b4f;_0x4a0e26(_0x32c6f7);})[_0xc2fb('0x14')](function(_0x3aae9a){_0x3f21a2(_0x3aae9a[_0xc2fb('0x18')]);});});}function emit(_0x371a69,_0x229f0e,_0x1afd15,_0x13c8e5){var _0x14dacb={'uri':util[_0xc2fb('0x53')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x371a69,_0x1afd15,_0x13c8e5)};io['to'](util[_0xc2fb('0x53')](_0xc2fb('0x54'),_0x229f0e))['emit']('trigger:browser:url',_0x14dacb);}exports['cs']=function(_0x20a19d,_0x1c50fa,_0x358200,_0xf6e0f4,_0x5e29de,_0x17b9b,_0x5000c4,_0xf474b1){var _0x360f66={};_0x17b9b[_0xc2fb('0xb')]=_0x17b9b['modernAuthentication']?intUtil[_0xc2fb('0x55')](_0x17b9b[_0xc2fb('0xc')][_0xc2fb('0xd')]):intUtil[_0xc2fb('0x55')](_0x17b9b['remoteUri']);_0x17b9b[_0xc2fb('0x56')]=intUtil[_0xc2fb('0x55')](_0x17b9b[_0xc2fb('0x56')]);_0x360f66[_0xc2fb('0x50')]=_0xf474b1===_0xc2fb('0x4f')||_0xf474b1===_0xc2fb('0x57')?_0xc2fb('0x4f'):_0xc2fb('0x2a');var _0x2f89c4=_0x17b9b[_0xc2fb('0xa')]?util[_0xc2fb('0x53')](_0xc2fb('0x58'),_0x17b9b[_0xc2fb('0xc')][_0xc2fb('0xd')]):util[_0xc2fb('0x53')](_0xc2fb('0x58'),_0x17b9b['remoteUri']);var _0x413221=util[_0xc2fb('0x53')](_0xc2fb('0x59'),_0x17b9b[_0xc2fb('0xe')]);var _0x33a677=util['format'](_0xc2fb('0x5a'),_0x17b9b[_0xc2fb('0x56')],_0x1c50fa['uniqueid'],md5(_0x1c50fa[_0xc2fb('0x5b')]));if(_0x5e29de&&_0x5e29de[_0xc2fb('0x5c')]){logger['info'](_0xc2fb('0x5d'),'Recording\x20is\x20enabled!');_0x1c50fa[_0xc2fb('0x5e')]=_0x33a677;}else if(_0x5000c4&&_0x5000c4[_0xc2fb('0x5f')]&&_0x5000c4[_0xc2fb('0x5f')]!==_0xc2fb('0x60')){logger[_0xc2fb('0x3f')](_0xc2fb('0x61'),_0xc2fb('0x62'));_0x1c50fa['recordingURL']=_0x33a677;}else{_0x1c50fa[_0xc2fb('0x5e')]='';}return getUser(_0x360f66,_0x17b9b,_0xf6e0f4,_0x413221,_0x2f89c4,_0xf474b1)[_0xc2fb('0x19')](function(_0x3f668c){logger[_0xc2fb('0x3f')]('['+_0xf474b1[_0xc2fb('0x16')]()+_0xc2fb('0x63'),_0x3f668c[_0xc2fb('0x23')]);logger[_0xc2fb('0x3f')]('['+_0xf474b1['toUpperCase']()+_0xc2fb('0x64'),_0x3f668c['userEmail']);return getEndUser(_0x3f668c,_0x17b9b,_0x413221,_0x2f89c4,_0x1c50fa,_0xf474b1,_0x358200[_0xc2fb('0x65')],_0x358200[_0xc2fb('0x66')]);})[_0xc2fb('0x19')](function(_0x548e9d){logger['info']('['+_0xf474b1[_0xc2fb('0x16')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x548e9d[_0xc2fb('0x3c')]);logger[_0xc2fb('0x3f')]('['+_0xf474b1[_0xc2fb('0x16')]()+_0xc2fb('0x67'),_0x1c50fa[_0xc2fb('0x35')]);return getTicket(_0x548e9d,_0x17b9b,_0x413221,_0x2f89c4,_0x1c50fa,_0x358200,_0xf474b1);})[_0xc2fb('0x19')](function(_0x996278){logger[_0xc2fb('0x3f')](util[_0xc2fb('0x53')]('['+_0xf474b1['toUpperCase']()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x358200[_0xc2fb('0x48')],_0x996278[_0xc2fb('0x68')]));logger[_0xc2fb('0x3f')](util[_0xc2fb('0x53')]('['+_0xf474b1[_0xc2fb('0x16')]()+_0xc2fb('0x69'),_0xf474b1));if(_0xf474b1!==_0xc2fb('0x57')){logger[_0xc2fb('0x3f')]('['+_0xf474b1[_0xc2fb('0x16')]()+']',_0xc2fb('0x6a'));emit(_0x17b9b[_0xc2fb('0xb')],_0xf6e0f4[_0xc2fb('0x6b')],_0x358200['ticketType'],_0x996278[_0xc2fb('0x68')]);}})[_0xc2fb('0x14')](function(_0x2442c5){logger[_0xc2fb('0x15')]('['+_0xf474b1[_0xc2fb('0x16')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x2442c5['message']);});}; \ 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 3e476c5..0aa472f 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 _0xc8c4=['recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','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','stringify','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridnum','unmanaged','lastevent','toUpperCase','lodash','request-promise','util','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','merge','format','calleridname','calleridnum','getString','Descriptions','Tags','name','Fields','custom_fields','mapValues','keyBy','value','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','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','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','toString','base64','[HTTP]','map','forEach','string','picklist','nameField','customField','toLowerCase','content','includes','idField','type','variable','variableName','push','customVariable','Variable','queue','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!'];(function(_0x5b083d,_0x5d5811){var _0x220c29=function(_0x5ce5fc){while(--_0x5ce5fc){_0x5b083d['push'](_0x5b083d['shift']());}};_0x220c29(++_0x5d5811);}(_0xc8c4,0xd4));var _0x4c8c=function(_0x5e5dac,_0xd06afc){_0x5e5dac=_0x5e5dac-0x0;var _0xc846b3=_0xc8c4[_0x5e5dac];return _0xc846b3;};'use strict';var _=require(_0x4c8c('0x0'));var rp=require(_0x4c8c('0x1'));var md5=require('md5');var util=require(_0x4c8c('0x2'));var Redis=require('ioredis');var intUtil=require(_0x4c8c('0x3'));var config=require(_0x4c8c('0x4'));var logger=require(_0x4c8c('0x5'))(_0x4c8c('0x6'));config[_0x4c8c('0x7')]=_[_0x4c8c('0x8')](config[_0x4c8c('0x7')],{'host':_0x4c8c('0x9'),'port':0x18eb});var io=require(_0x4c8c('0xa'))(new Redis(config[_0x4c8c('0x7')]));var headers={'Content-Type':_0x4c8c('0xb'),'Accept':_0x4c8c('0xb')};function emit(_0x215527,_0x2c94f2,_0x5738b8){io['to'](_0x215527)[_0x4c8c('0xc')](_0x2c94f2,_0x5738b8);}function getTicket(_0x457ada,_0x592f12,_0x4c32e3,_0x2c0c8f,_0x4816f2){logger[_0x4c8c('0xd')]('Creating\x20new\x20ticket...');var _0x4939c1=_[_0x4c8c('0xe')]({'responder_id':_0x592f12['id'],'requester_id':_0x4c32e3['id'],'name':util[_0x4c8c('0xf')]('Caller\x20-\x20%s',_0x4816f2[_0x4c8c('0x10')]),'phone':_0x4816f2[_0x4c8c('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x4c8c('0x12')](_0x2c0c8f['Subjects'],_0x4816f2,'\x20'),'description':intUtil[_0x4c8c('0x12')](_0x2c0c8f[_0x4c8c('0x13')],_0x4816f2,'
'),'tags':getTags(_0x2c0c8f[_0x4c8c('0x14')],_0x4c8c('0x15'))},getCustomFields(_0x2c0c8f[_0x4c8c('0x16')],_0x4816f2));_0x4939c1[_0x4c8c('0x17')]=_[_0x4c8c('0x18')](_[_0x4c8c('0x19')](_0x4939c1[_0x4c8c('0x17')],'id'),_0x4c8c('0x1a'));return request({'uri':util['format']('%s/api/v2/tickets',_0x457ada[_0x4c8c('0x1b')]),'method':_0x4c8c('0x1c'),'body':_0x4939c1})[_0x4c8c('0x1d')](function(_0x8cf57d){logger[_0x4c8c('0xd')](_0x4c8c('0x1e'));return _0x8cf57d;});}function getUser(_0x1ff1bf,_0x36bbb2){if(intUtil[_0x4c8c('0x1f')](_0x36bbb2)){return request({'uri':util[_0x4c8c('0xf')](_0x4c8c('0x20'),_0x1ff1bf['remoteUri']),'qs':{'email':_0x36bbb2}})[_0x4c8c('0x1d')](function(_0x4a4b06){if(_0x4a4b06[_0x4c8c('0x21')]){logger[_0x4c8c('0xd')](_0x4c8c('0x22'));return _[_0x4c8c('0x23')](_0x4a4b06,function(_0xc206c5){return _0xc206c5[_0x4c8c('0x24')][_0x4c8c('0x25')]===_0x36bbb2;});}else{logger['info'](_0x4c8c('0x26'));return request({'uri':util[_0x4c8c('0xf')](_0x4c8c('0x27'),_0x1ff1bf[_0x4c8c('0x1b')])})['then'](function(_0x21f695){logger[_0x4c8c('0xd')]('Admin\x20account\x20selected.');return _0x21f695;});}});}else{logger[_0x4c8c('0xd')](_0x4c8c('0x28'));return request({'uri':util['format']('%s/api/v2/agents/me',_0x1ff1bf[_0x4c8c('0x1b')])})[_0x4c8c('0x1d')](function(_0x33993a){logger[_0x4c8c('0xd')](_0x4c8c('0x29'));return _0x33993a;});}}function getEndUser(_0x5197d7,_0x233949,_0x3b81eb){logger['info'](_0x4c8c('0x2a'),_0x3b81eb);return request({'uri':util[_0x4c8c('0xf')](_0x4c8c('0x2b'),_0x5197d7[_0x4c8c('0x1b')]),'qs':{'phone':_0x3b81eb}})[_0x4c8c('0x1d')](function(_0x11cb4a){if(_0x11cb4a['length']){logger[_0x4c8c('0xd')](_0x4c8c('0x2c'));return _[_0x4c8c('0x23')](_0x11cb4a,{'phone':_0x3b81eb});}else{logger[_0x4c8c('0xd')](_0x4c8c('0x2d'));return request({'uri':util['format'](_0x4c8c('0x2b'),_0x5197d7[_0x4c8c('0x1b')]),'method':'POST','body':{'name':_0x233949,'phone':_0x3b81eb}})[_0x4c8c('0x1d')](function(_0x3234d8){logger[_0x4c8c('0xd')](_0x4c8c('0x2e'));return _0x3234d8;});}});}function getAuth(_0x1b7d83){return util[_0x4c8c('0xf')](_0x4c8c('0x2f'),new Buffer(_0x1b7d83[_0x4c8c('0x30')]+':X')[_0x4c8c('0x31')](_0x4c8c('0x32')));}function request(_0x4255b1){logger['debug'](_0x4c8c('0x33'),JSON['stringify'](_0x4255b1));return rp(_['defaults'](_0x4255b1,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x16b6e3,_0x1632d8){var _0x1e354a=[];if(_0x16b6e3&&_0x16b6e3[_0x4c8c('0x21')]>0x0){_0x1e354a=_[_0x4c8c('0x34')](_0x16b6e3,_0x1632d8);}return _0x1e354a;}function getCustomFields(_0x5c1562,_0x211a6d){var _0x42e522=[];var _0x479abf={'custom_fields':[]};if(_0x5c1562['length']>0x0){_[_0x4c8c('0x35')](_0x5c1562,function(_0x1086a1){if(_['includes']([_0x4c8c('0x36'),_0x4c8c('0x37')],_0x1086a1['type'])&&_0x1086a1[_0x4c8c('0x38')]&&!_0x1086a1[_0x4c8c('0x39')]){_0x479abf[_0x1086a1[_0x4c8c('0x38')][_0x4c8c('0x3a')]()]=_0x1086a1[_0x4c8c('0x3b')][_0x4c8c('0x31')]();}else if(_[_0x4c8c('0x3c')](['string',_0x4c8c('0x37')],_0x1086a1['type'])&&_0x1086a1[_0x4c8c('0x3d')]&&_0x1086a1[_0x4c8c('0x39')]){_0x479abf['custom_fields']['push']({'id':_0x1086a1[_0x4c8c('0x3d')],'value':_0x1086a1['content']['toString']()});}else if(_0x1086a1[_0x4c8c('0x3e')]===_0x4c8c('0x3f')&&_0x1086a1['variableName']&&_0x1086a1[_0x4c8c('0x3d')]&&_0x1086a1[_0x4c8c('0x39')]){_0x211a6d[_0x1086a1[_0x4c8c('0x40')]]&&_0x479abf['custom_fields'][_0x4c8c('0x41')]({'id':_0x1086a1[_0x4c8c('0x3d')],'value':_0x211a6d[_0x1086a1[_0x4c8c('0x40')]]['toString']()});}else if(_0x1086a1[_0x4c8c('0x3e')]===_0x4c8c('0x42')&&_0x1086a1[_0x4c8c('0x43')]&&_0x1086a1[_0x4c8c('0x43')][_0x4c8c('0x15')]&&_0x1086a1[_0x4c8c('0x3d')]&&_0x1086a1['customField']){_0x211a6d[_0x1086a1[_0x4c8c('0x43')][_0x4c8c('0x15')][_0x4c8c('0x3a')]()]&&_0x479abf[_0x4c8c('0x17')]['push']({'id':_0x1086a1[_0x4c8c('0x3d')],'value':_0x211a6d[_0x1086a1[_0x4c8c('0x43')][_0x4c8c('0x15')][_0x4c8c('0x3a')]()][_0x4c8c('0x31')]()});}});}return _0x479abf;}exports[_0x4c8c('0x44')]=function(_0x380da1,_0x4a6213,_0x2c24e0,_0xf35d2f,_0x579558,_0xb9aa91){var _0x2b5b6f,_0x1d43b4;_0xb9aa91['remoteUri']=intUtil['stripTrailingSlash'](_0xb9aa91[_0x4c8c('0x1b')]);_0xb9aa91['serverUrl']=intUtil['stripTrailingSlash'](_0xb9aa91[_0x4c8c('0x45')]);if(_0x579558&&_0x579558[_0x4c8c('0x46')]){logger[_0x4c8c('0xd')](_0x4c8c('0x47'),_0x4c8c('0x48'));_0x4a6213[_0x4c8c('0x49')]=util[_0x4c8c('0xf')](_0x4c8c('0x4a'),_0xb9aa91['serverUrl'],_0x4a6213[_0x4c8c('0x4b')],md5(_0x4a6213[_0x4c8c('0x4b')]));}else{_0x4a6213[_0x4c8c('0x49')]='';}headers['Authorization']=getAuth(_0xb9aa91);return getUser(_0xb9aa91,_0xf35d2f[_0x4c8c('0x25')])[_0x4c8c('0x1d')](function(_0x111303){_0x2b5b6f=_0x111303;logger[_0x4c8c('0xd')](_0x4c8c('0x4c'),_0x2b5b6f['id']);return getEndUser(_0xb9aa91,_0x4a6213['calleridname'],_0x4a6213[_0x4c8c('0x11')]);})[_0x4c8c('0x1d')](function(_0x18f1ff){_0x1d43b4=_0x18f1ff;logger[_0x4c8c('0xd')](_0x4c8c('0x4d'),_0x1d43b4['id']);return getTicket(_0xb9aa91,_0x2b5b6f,_0x1d43b4,_0x2c24e0,_0x4a6213);})['then'](function(_0x652586){if(_0x652586&&_0x652586['id']){logger[_0x4c8c('0xd')](_0x4c8c('0x1e'));logger[_0x4c8c('0xd')](_0x4c8c('0x4e'),_0x652586['id']);logger[_0x4c8c('0xd')](_0x4c8c('0x47'),_0x4c8c('0x4f'));emit(util[_0x4c8c('0xf')](_0x4c8c('0x50'),_0xf35d2f[_0x4c8c('0x15')]),_0x4c8c('0x51'),{'uri':util[_0x4c8c('0xf')](_0x4c8c('0x52'),_0xb9aa91['remoteUri'],_0x652586['id'])});}})[_0x4c8c('0x53')](function(_0xbcec00){logger['error'](_0x4c8c('0x47'),JSON[_0x4c8c('0x54')](_0xbcec00));});};exports[_0x4c8c('0x55')]=function(_0x1cdbbb,_0x2a0658,_0x2a3cfd,_0x3bb158,_0x4f8119,_0x417b63,_0x3bf69b){var _0x34593a,_0x1309e6;_0x417b63[_0x4c8c('0x1b')]=intUtil[_0x4c8c('0x56')](_0x417b63['remoteUri']);_0x417b63['serverUrl']=intUtil[_0x4c8c('0x56')](_0x417b63[_0x4c8c('0x45')]);if(_0x3bf69b&&_0x3bf69b[_0x4c8c('0x57')]&&_0x3bf69b[_0x4c8c('0x57')]!==_0x4c8c('0x58')){logger[_0x4c8c('0xd')](_0x4c8c('0x59'),'Recording\x20is\x20enabled!');_0x2a0658[_0x4c8c('0x49')]=util[_0x4c8c('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x417b63[_0x4c8c('0x45')],_0x2a0658[_0x4c8c('0x4b')],md5(_0x2a0658[_0x4c8c('0x4b')]));}headers[_0x4c8c('0x5a')]=getAuth(_0x417b63);return getUser(_0x417b63,_0x3bb158[_0x4c8c('0x25')])[_0x4c8c('0x1d')](function(_0x51fc48){_0x34593a=_0x51fc48;logger[_0x4c8c('0xd')](_0x4c8c('0x4c'),_0x34593a['id']);return getEndUser(_0x417b63,_0x2a0658['destcalleridname'],_0x2a0658[_0x4c8c('0x5b')]);})['then'](function(_0x371911){_0x1309e6=_0x371911;logger[_0x4c8c('0xd')](_0x4c8c('0x4d'),_0x1309e6['id']);return getTicket(_0x417b63,_0x34593a,_0x1309e6,_0x2a3cfd,_0x2a0658);})['then'](function(_0x95d873){if(_0x95d873&&_0x95d873['id']){logger['info'](_0x4c8c('0x1e'));logger[_0x4c8c('0xd')]('The\x20Ticket\x20ID\x20is:',_0x95d873['id']);logger['info'](_0x4c8c('0x59'),_0x4c8c('0x4f'));emit(util[_0x4c8c('0xf')]('user:%s',_0x3bb158['name']),_0x4c8c('0x51'),{'uri':util['format'](_0x4c8c('0x52'),_0x417b63[_0x4c8c('0x1b')],_0x95d873['id'])});}})[_0x4c8c('0x53')](function(_0x4fdf50){logger['error'](_0x4c8c('0x59'),JSON[_0x4c8c('0x54')](_0x4fdf50));});};exports[_0x4c8c('0x5c')]=function(_0xb5e5e7,_0xef9c4a,_0x2e2b6a,_0x3df539,_0x55c47a,_0x1b5173){var _0x37ecfa,_0x5f217d;_0x1b5173['remoteUri']=intUtil['stripTrailingSlash'](_0x1b5173[_0x4c8c('0x1b')]);_0x1b5173[_0x4c8c('0x45')]=intUtil[_0x4c8c('0x56')](_0x1b5173[_0x4c8c('0x45')]);if(_0x55c47a&&_0x55c47a[_0x4c8c('0x46')]){logger[_0x4c8c('0xd')]('['+_0xef9c4a[_0x4c8c('0x5d')][_0x4c8c('0x5e')]()+']',_0x4c8c('0x48'));_0xef9c4a[_0x4c8c('0x49')]=util[_0x4c8c('0xf')](_0x4c8c('0x4a'),_0x1b5173[_0x4c8c('0x45')],_0xef9c4a[_0x4c8c('0x4b')],md5(_0xef9c4a['uniqueid']));}else{_0xef9c4a[_0x4c8c('0x49')]='';}headers[_0x4c8c('0x5a')]=getAuth(_0x1b5173);return getUser(_0x1b5173,'')[_0x4c8c('0x1d')](function(_0x23e1a8){_0x37ecfa=_0x23e1a8;logger[_0x4c8c('0xd')](_0x4c8c('0x4c'),_0x37ecfa['id']);return getEndUser(_0x1b5173,_0xef9c4a[_0x4c8c('0x10')],_0xef9c4a[_0x4c8c('0x11')]);})[_0x4c8c('0x1d')](function(_0xcdc28c){_0x5f217d=_0xcdc28c;logger[_0x4c8c('0xd')](_0x4c8c('0x4d'),_0x5f217d['id']);return getTicket(_0x1b5173,_0x37ecfa,_0x5f217d,_0x2e2b6a,_0xef9c4a);})[_0x4c8c('0x1d')](function(_0x26cd88){if(_0x26cd88){logger[_0x4c8c('0xd')](_0x4c8c('0x1e'));logger[_0x4c8c('0xd')]('The\x20Ticket\x20ID\x20is:',_0x26cd88['id']);}})[_0x4c8c('0x53')](function(_0x28d081){logger['error']('['+_0xef9c4a['lastevent'][_0x4c8c('0x5e')]()+']',JSON[_0x4c8c('0x54')](_0x28d081));});}; \ No newline at end of file +var _0x588c=['Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','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','toString','debug','stringify','includes','picklist','type','nameField','string','customField','push','idField','content','variable','variableName','name','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','error','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridnum','The\x20Enduser\x20ID\x20is:','catch','unmanaged','lastevent','toUpperCase','Ticket\x20created!','lodash','util','../../../../config/logger','freshdesk','redis','defaults','socket.io-emitter','application/json','emit','format','calleridname','calleridnum','Subjects','getString','Descriptions','
','Tags','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','POST','then','info','validateEmail','remoteUri','length','Agent\x20found!','contact','email'];(function(_0x146319,_0x53530b){var _0x195685=function(_0x2d693f){while(--_0x2d693f){_0x146319['push'](_0x146319['shift']());}};_0x195685(++_0x53530b);}(_0x588c,0x13c));var _0xc588=function(_0x4415ea,_0x35a9f5){_0x4415ea=_0x4415ea-0x0;var _0xad3fbb=_0x588c[_0x4415ea];return _0xad3fbb;};'use strict';var _=require(_0xc588('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0xc588('0x1'));var Redis=require('ioredis');var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xc588('0x2'))(_0xc588('0x3'));config[_0xc588('0x4')]=_[_0xc588('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xc588('0x6'))(new Redis(config['redis']));var headers={'Content-Type':_0xc588('0x7'),'Accept':'application/json'};function emit(_0x309e9f,_0x2fc2a6,_0x18f04a){io['to'](_0x309e9f)[_0xc588('0x8')](_0x2fc2a6,_0x18f04a);}function getTicket(_0x39b1a7,_0x285002,_0x41c741,_0x34eaa6,_0x2868fb){logger['info']('Creating\x20new\x20ticket...');var _0x5e0129=_['merge']({'responder_id':_0x285002['id'],'requester_id':_0x41c741['id'],'name':util[_0xc588('0x9')]('Caller\x20-\x20%s',_0x2868fb[_0xc588('0xa')]),'phone':_0x2868fb[_0xc588('0xb')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x34eaa6[_0xc588('0xc')],_0x2868fb,'\x20'),'description':intUtil[_0xc588('0xd')](_0x34eaa6[_0xc588('0xe')],_0x2868fb,_0xc588('0xf')),'tags':getTags(_0x34eaa6[_0xc588('0x10')],'name')},getCustomFields(_0x34eaa6[_0xc588('0x11')],_0x2868fb));_0x5e0129[_0xc588('0x12')]=_[_0xc588('0x13')](_[_0xc588('0x14')](_0x5e0129[_0xc588('0x12')],'id'),_0xc588('0x15'));return request({'uri':util[_0xc588('0x9')](_0xc588('0x16'),_0x39b1a7['remoteUri']),'method':_0xc588('0x17'),'body':_0x5e0129})[_0xc588('0x18')](function(_0x2f01ad){logger[_0xc588('0x19')]('Ticket\x20created!');return _0x2f01ad;});}function getUser(_0x496c76,_0x51d2f7){if(intUtil[_0xc588('0x1a')](_0x51d2f7)){return request({'uri':util[_0xc588('0x9')]('%s/api/v2/agents',_0x496c76[_0xc588('0x1b')]),'qs':{'email':_0x51d2f7}})[_0xc588('0x18')](function(_0x488d5d){if(_0x488d5d[_0xc588('0x1c')]){logger['info'](_0xc588('0x1d'));return _['find'](_0x488d5d,function(_0x298c5c){return _0x298c5c[_0xc588('0x1e')][_0xc588('0x1f')]===_0x51d2f7;});}else{logger[_0xc588('0x19')](_0xc588('0x20'));return request({'uri':util[_0xc588('0x9')](_0xc588('0x21'),_0x496c76[_0xc588('0x1b')])})['then'](function(_0x4f5eab){logger['info']('Admin\x20account\x20selected.');return _0x4f5eab;});}});}else{logger['info'](_0xc588('0x22'));return request({'uri':util[_0xc588('0x9')](_0xc588('0x21'),_0x496c76[_0xc588('0x1b')])})[_0xc588('0x18')](function(_0x24e4d9){logger[_0xc588('0x19')](_0xc588('0x23'));return _0x24e4d9;});}}function getEndUser(_0x275aab,_0x15ba23,_0x1e1b19){logger[_0xc588('0x19')](_0xc588('0x24'),_0x1e1b19);return request({'uri':util['format'](_0xc588('0x25'),_0x275aab['remoteUri']),'qs':{'phone':_0x1e1b19}})[_0xc588('0x18')](function(_0x3a509d){if(_0x3a509d['length']){logger[_0xc588('0x19')](_0xc588('0x26'));return _['find'](_0x3a509d,{'phone':_0x1e1b19});}else{logger[_0xc588('0x19')](_0xc588('0x27'));return request({'uri':util['format'](_0xc588('0x25'),_0x275aab['remoteUri']),'method':'POST','body':{'name':_0x15ba23,'phone':_0x1e1b19}})[_0xc588('0x18')](function(_0x4bbb60){logger[_0xc588('0x19')](_0xc588('0x28'));return _0x4bbb60;});}});}function getAuth(_0x2c4748){return util[_0xc588('0x9')](_0xc588('0x29'),new Buffer(_0x2c4748[_0xc588('0x2a')]+':X')[_0xc588('0x2b')]('base64'));}function request(_0x3cd972){logger[_0xc588('0x2c')]('[HTTP]',JSON[_0xc588('0x2d')](_0x3cd972));return rp(_[_0xc588('0x5')](_0x3cd972,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x1ec09e,_0x1dd635){var _0x3c1bc0=[];if(_0x1ec09e&&_0x1ec09e[_0xc588('0x1c')]>0x0){_0x3c1bc0=_['map'](_0x1ec09e,_0x1dd635);}return _0x3c1bc0;}function getCustomFields(_0x3fec91,_0x47e3aa){var _0x5d848c=[];var _0x1032f2={'custom_fields':[]};if(_0x3fec91['length']>0x0){_['forEach'](_0x3fec91,function(_0xbdb4d9){if(_[_0xc588('0x2e')](['string',_0xc588('0x2f')],_0xbdb4d9[_0xc588('0x30')])&&_0xbdb4d9[_0xc588('0x31')]&&!_0xbdb4d9['customField']){_0x1032f2[_0xbdb4d9[_0xc588('0x31')]['toLowerCase']()]=_0xbdb4d9['content'][_0xc588('0x2b')]();}else if(_[_0xc588('0x2e')]([_0xc588('0x32'),'picklist'],_0xbdb4d9[_0xc588('0x30')])&&_0xbdb4d9['idField']&&_0xbdb4d9[_0xc588('0x33')]){_0x1032f2[_0xc588('0x12')][_0xc588('0x34')]({'id':_0xbdb4d9[_0xc588('0x35')],'value':_0xbdb4d9[_0xc588('0x36')]['toString']()});}else if(_0xbdb4d9['type']===_0xc588('0x37')&&_0xbdb4d9['variableName']&&_0xbdb4d9['idField']&&_0xbdb4d9[_0xc588('0x33')]){_0x47e3aa[_0xbdb4d9[_0xc588('0x38')]]&&_0x1032f2[_0xc588('0x12')][_0xc588('0x34')]({'id':_0xbdb4d9[_0xc588('0x35')],'value':_0x47e3aa[_0xbdb4d9['variableName']][_0xc588('0x2b')]()});}else if(_0xbdb4d9[_0xc588('0x30')]==='customVariable'&&_0xbdb4d9['Variable']&&_0xbdb4d9['Variable'][_0xc588('0x39')]&&_0xbdb4d9['idField']&&_0xbdb4d9['customField']){_0x47e3aa[_0xbdb4d9[_0xc588('0x3a')][_0xc588('0x39')][_0xc588('0x3b')]()]&&_0x1032f2[_0xc588('0x12')][_0xc588('0x34')]({'id':_0xbdb4d9[_0xc588('0x35')],'value':_0x47e3aa[_0xbdb4d9[_0xc588('0x3a')][_0xc588('0x39')][_0xc588('0x3b')]()][_0xc588('0x2b')]()});}});}return _0x1032f2;}exports[_0xc588('0x3c')]=function(_0x18ff31,_0x1e739e,_0x21d379,_0x2c5b53,_0x48bc17,_0xaf42ba){var _0x2dcc23,_0x25955f;_0xaf42ba['remoteUri']=intUtil[_0xc588('0x3d')](_0xaf42ba[_0xc588('0x1b')]);_0xaf42ba[_0xc588('0x3e')]=intUtil[_0xc588('0x3d')](_0xaf42ba[_0xc588('0x3e')]);if(_0x48bc17&&_0x48bc17[_0xc588('0x3f')]){logger['info']('[QUEUE]',_0xc588('0x40'));_0x1e739e[_0xc588('0x41')]=util[_0xc588('0x9')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xaf42ba[_0xc588('0x3e')],_0x1e739e[_0xc588('0x42')],md5(_0x1e739e[_0xc588('0x42')]));}else{_0x1e739e[_0xc588('0x41')]='';}headers[_0xc588('0x43')]=getAuth(_0xaf42ba);return getUser(_0xaf42ba,_0x2c5b53[_0xc588('0x1f')])[_0xc588('0x18')](function(_0x3dd16e){_0x2dcc23=_0x3dd16e;logger['info'](_0xc588('0x44'),_0x2dcc23['id']);return getEndUser(_0xaf42ba,_0x1e739e[_0xc588('0xa')],_0x1e739e[_0xc588('0xb')]);})['then'](function(_0x171f70){_0x25955f=_0x171f70;logger[_0xc588('0x19')]('The\x20Enduser\x20ID\x20is:',_0x25955f['id']);return getTicket(_0xaf42ba,_0x2dcc23,_0x25955f,_0x21d379,_0x1e739e);})['then'](function(_0x25e05a){if(_0x25e05a&&_0x25e05a['id']){logger[_0xc588('0x19')]('Ticket\x20created!');logger[_0xc588('0x19')](_0xc588('0x45'),_0x25e05a['id']);logger['info'](_0xc588('0x46'),_0xc588('0x47'));emit(util[_0xc588('0x9')](_0xc588('0x48'),_0x2c5b53[_0xc588('0x39')]),_0xc588('0x49'),{'uri':util[_0xc588('0x9')](_0xc588('0x4a'),_0xaf42ba[_0xc588('0x1b')],_0x25e05a['id'])});}})['catch'](function(_0x58cff1){logger[_0xc588('0x4b')](_0xc588('0x46'),JSON[_0xc588('0x2d')](_0x58cff1));});};exports['outbound']=function(_0x440ee1,_0x203fbb,_0x437afa,_0x33c047,_0x22de29,_0x4bcfd1,_0x26c230){var _0x2c08c3,_0x3bdf93;_0x4bcfd1[_0xc588('0x1b')]=intUtil['stripTrailingSlash'](_0x4bcfd1[_0xc588('0x1b')]);_0x4bcfd1[_0xc588('0x3e')]=intUtil[_0xc588('0x3d')](_0x4bcfd1[_0xc588('0x3e')]);if(_0x26c230&&_0x26c230['recordingFormat']&&_0x26c230[_0xc588('0x4c')]!==_0xc588('0x4d')){logger[_0xc588('0x19')](_0xc588('0x4e'),_0xc588('0x40'));_0x203fbb[_0xc588('0x41')]=util[_0xc588('0x9')](_0xc588('0x4f'),_0x4bcfd1['serverUrl'],_0x203fbb['uniqueid'],md5(_0x203fbb[_0xc588('0x42')]));}headers['Authorization']=getAuth(_0x4bcfd1);return getUser(_0x4bcfd1,_0x33c047[_0xc588('0x1f')])['then'](function(_0x4e05e0){_0x2c08c3=_0x4e05e0;logger['info']('The\x20User\x20ID\x20is:',_0x2c08c3['id']);return getEndUser(_0x4bcfd1,_0x203fbb['destcalleridname'],_0x203fbb[_0xc588('0x50')]);})[_0xc588('0x18')](function(_0x236b0d){_0x3bdf93=_0x236b0d;logger[_0xc588('0x19')](_0xc588('0x51'),_0x3bdf93['id']);return getTicket(_0x4bcfd1,_0x2c08c3,_0x3bdf93,_0x437afa,_0x203fbb);})[_0xc588('0x18')](function(_0x39e8ef){if(_0x39e8ef&&_0x39e8ef['id']){logger[_0xc588('0x19')]('Ticket\x20created!');logger[_0xc588('0x19')](_0xc588('0x45'),_0x39e8ef['id']);logger['info'](_0xc588('0x4e'),_0xc588('0x47'));emit(util[_0xc588('0x9')]('user:%s',_0x33c047[_0xc588('0x39')]),_0xc588('0x49'),{'uri':util[_0xc588('0x9')](_0xc588('0x4a'),_0x4bcfd1['remoteUri'],_0x39e8ef['id'])});}})[_0xc588('0x52')](function(_0x4907d3){logger[_0xc588('0x4b')](_0xc588('0x4e'),JSON[_0xc588('0x2d')](_0x4907d3));});};exports[_0xc588('0x53')]=function(_0x293f71,_0x1ea328,_0x6d0c0e,_0x14e1ef,_0x19b440,_0x474dc3){var _0x379997,_0x2a55b5;_0x474dc3[_0xc588('0x1b')]=intUtil['stripTrailingSlash'](_0x474dc3['remoteUri']);_0x474dc3[_0xc588('0x3e')]=intUtil[_0xc588('0x3d')](_0x474dc3[_0xc588('0x3e')]);if(_0x19b440&&_0x19b440['monitor_format']){logger[_0xc588('0x19')]('['+_0x1ea328[_0xc588('0x54')][_0xc588('0x55')]()+']',_0xc588('0x40'));_0x1ea328[_0xc588('0x41')]=util['format'](_0xc588('0x4f'),_0x474dc3[_0xc588('0x3e')],_0x1ea328['uniqueid'],md5(_0x1ea328['uniqueid']));}else{_0x1ea328[_0xc588('0x41')]='';}headers[_0xc588('0x43')]=getAuth(_0x474dc3);return getUser(_0x474dc3,'')['then'](function(_0x57113d){_0x379997=_0x57113d;logger['info']('The\x20User\x20ID\x20is:',_0x379997['id']);return getEndUser(_0x474dc3,_0x1ea328['calleridname'],_0x1ea328['calleridnum']);})[_0xc588('0x18')](function(_0x43fc28){_0x2a55b5=_0x43fc28;logger[_0xc588('0x19')](_0xc588('0x51'),_0x2a55b5['id']);return getTicket(_0x474dc3,_0x379997,_0x2a55b5,_0x6d0c0e,_0x1ea328);})[_0xc588('0x18')](function(_0x4b62ff){if(_0x4b62ff){logger[_0xc588('0x19')](_0xc588('0x56'));logger['info'](_0xc588('0x45'),_0x4b62ff['id']);}})[_0xc588('0x52')](function(_0xcdda0e){logger[_0xc588('0x4b')]('['+_0x1ea328[_0xc588('0x54')][_0xc588('0x55')]()+']',JSON[_0xc588('0x2d')](_0xcdda0e));});}; \ 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 8c4c75a..2586df0 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 _0x50d7=['Contact\x20found\x20work_number:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','Subjects','getString','Descriptions','Contact','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','[OUTBOUND]','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','md5','moment','bluebird','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','error','toUpperCase','message','Getting\x20user\x20list','users','Getting\x20user\x20with\x20email','agentEmail','userId','userEmail','catch','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','endUserId','Contact\x20found\x20mobile_number:'];(function(_0xa897a6,_0x585941){var _0x753ac=function(_0x5b774f){while(--_0x5b774f){_0xa897a6['push'](_0xa897a6['shift']());}};_0x753ac(++_0x585941);}(_0x50d7,0xc5));var _0x750d=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x50d7[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x750d('0x0'));var rp=require(_0x750d('0x1'));var md5=require(_0x750d('0x2'));var util=require('util');var moment=require(_0x750d('0x3'));var Promise=require(_0x750d('0x4'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x750d('0x5'));var logger=require(_0x750d('0x6'))(_0x750d('0x7'));config[_0x750d('0x8')]=_[_0x750d('0x9')](config[_0x750d('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x750d('0x8')]));function getAdminId(_0x5ab150,_0x35b3e3,_0xf5bff,_0x59be2d){return new Promise(function(_0x1a8682,_0x1e3728){var _0x2c9403=![];var _0x41f7c8={'method':_0x750d('0xa'),'uri':_0x59be2d+_0x750d('0xb'),'json':!![]};_0x41f7c8[_0x750d('0xc')]=_0xf5bff;logger[_0x750d('0xd')](_0x750d('0xe'));return rp(_0x41f7c8)[_0x750d('0xf')](function(_0x11cbd3){if(_0x11cbd3){var _0x261143=_0x11cbd3['users'];var _0x5147f6=null;for(_0x5147f6=0x0;_0x5147f6<_0x261143[_0x750d('0x10')];_0x5147f6++){if(_0x261143[_0x5147f6][_0x750d('0x11')]===_0x5ab150[_0x750d('0x12')]){_0x5ab150[_0x750d('0x13')]=_0x261143[_0x5147f6]['id'];_0x2c9403=!![];}}if(_0x2c9403){logger[_0x750d('0xd')](_0x750d('0x14'),_0x5ab150[_0x750d('0x13')]);_0x1a8682(_0x5ab150);}else{_0x1e3728({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x1e3728({'statusCode':0x194,'message':_0x750d('0x15')});}})['catch'](function(_0x52f02f){logger[_0x750d('0x16')]('['+[_0x35b3e3[_0x750d('0x17')]()]+']',_0x52f02f[_0x750d('0x18')]);_0x1e3728(_0x52f02f);});});}function getUser(_0x35d5ee,_0x2f6fd5,_0x5458cb){return function(_0x4e545a){return new Promise(function(_0x54469e,_0x3d24f6){var _0x4dd9bc={'method':_0x750d('0xa'),'uri':_0x5458cb+_0x750d('0xb'),'json':!![]};_0x4dd9bc[_0x750d('0xc')]=_0x2f6fd5;logger[_0x750d('0xd')](_0x750d('0x19'));return rp(_0x4dd9bc)[_0x750d('0xf')](function(_0x47fc52){if(_0x47fc52){var _0x38c299=_0x47fc52[_0x750d('0x1a')];var _0x5f065f=![];var _0x1d5428=null;if(_0x4e545a['agentEmail']!==null){logger[_0x750d('0xd')](_0x750d('0x1b'),_0x4e545a[_0x750d('0x1c')]);_0x4e545a['userEmail']=_0x4e545a['agentEmail'];for(_0x1d5428=0x0;_0x1d5428<_0x38c299[_0x750d('0x10')];_0x1d5428++){if(_0x38c299[_0x1d5428]['email']===_0x4e545a['agentEmail']){_0x5f065f=!![];_0x4e545a[_0x750d('0x1d')]=_0x38c299[_0x1d5428]['id'];logger[_0x750d('0xd')]('User\x20found:',_0x4e545a['userId']);}}}if(!_0x5f065f){logger['info']('Admin\x20selected');_0x4e545a[_0x750d('0x1e')]=_0x4e545a[_0x750d('0x12')];_0x4e545a['userId']=_0x4e545a[_0x750d('0x13')];_0x5f065f=!![];}if(_0x5f065f){_0x54469e(_0x4e545a);}else{_0x3d24f6({'statusCode':0x194,'message':_0x750d('0x15')});}}else{_0x3d24f6({'statusCode':0x194,'message':_0x750d('0x15')});}})[_0x750d('0x1f')](function(_0x4f658c){logger[_0x750d('0x16')]('['+[_0x35d5ee[_0x750d('0x17')]()]+']',_0x4f658c['message']);_0x3d24f6(_0x4f658c);});});};}function searchContact(_0x3af2f7,_0x2ca6eb,_0x524707,_0x3524ee){return new Promise(function(_0x820cff,_0x3b7107){var _0x1d981c={'method':_0x750d('0xa'),'headers':_0x2ca6eb,'uri':_0x3af2f7+'/api/lookup?q='+_0x3524ee+'&f='+_0x524707+_0x750d('0x20'),'json':!![]};rp(_0x1d981c)[_0x750d('0xf')](function(_0x58150a){var _0x1a4453=_[_0x750d('0x21')](_0x58150a[_0x750d('0x22')][_0x750d('0x22')],[_0x524707,_0x3524ee]);_0x820cff(_0x1a4453);})[_0x750d('0x1f')](function(_0x76536){_0x3b7107(_0x76536);});});}function getEndUser(_0x4972e7,_0x3ea767,_0x3aaa1f){return function(_0x49b3f2){return new Promise(function(_0x444bb6,_0x1a3cfe){logger[_0x750d('0xd')](util[_0x750d('0x23')](_0x750d('0x24'),_0x49b3f2[_0x750d('0x25')]));searchContact(_0x3aaa1f,_0x3ea767,'mobile_number',_0x49b3f2['contactNumber'])[_0x750d('0xf')](function(_0x3cd4be){if(_0x3cd4be){_0x49b3f2[_0x750d('0x26')]=_0x3cd4be['id'];logger['info'](_0x750d('0x27'),_0x49b3f2[_0x750d('0x26')]);return _0x444bb6(_0x49b3f2);}searchContact(_0x3aaa1f,_0x3ea767,'work_number',_0x49b3f2[_0x750d('0x25')])['then'](function(_0x572dcc){if(_0x572dcc){_0x49b3f2[_0x750d('0x26')]=_0x572dcc['id'];logger[_0x750d('0xd')](_0x750d('0x28'),_0x49b3f2['endUserId']);return _0x444bb6(_0x49b3f2);}createEndUser(_0x49b3f2,_0x4972e7,_0x3ea767,_0x3aaa1f)['then'](function(_0xfa79e8){logger['info']('Contact\x20created:',_0xfa79e8[_0x750d('0x26')]);return _0x444bb6(_0xfa79e8);});});})[_0x750d('0x1f')](function(_0x502b28){_0x1a3cfe(_0x502b28);});});};}function createEndUser(_0x332e10,_0x26bb1e,_0x39c6b3,_0x476ff0){return new Promise(function(_0x3e8612,_0x2e6264){var _0x1a0d77=moment();var _0x5ad916={'method':_0x750d('0x29'),'uri':_0x476ff0+_0x750d('0x2a'),'body':{'contact':{'last_name':_0x332e10[_0x750d('0x25')],'work_number':_0x332e10[_0x750d('0x25')],'mobile_number':_0x332e10[_0x750d('0x25')],'owner_id':_0x332e10[_0x750d('0x1d')],'created_at':_0x1a0d77[_0x750d('0x23')](_0x750d('0x2b'))}},'json':!![]};_0x5ad916[_0x750d('0xc')]=_0x39c6b3;logger[_0x750d('0xd')](_0x750d('0x2c'));return rp(_0x5ad916)[_0x750d('0xf')](function(_0x15f68e){_0x332e10['endUserId']=_0x15f68e[_0x750d('0x2d')]['id'];_0x3e8612(_0x332e10);})['catch'](function(_0x25446d){logger[_0x750d('0x16')]('['+[_0x26bb1e['toUpperCase']()]+']',_0x25446d[_0x750d('0x18')]);_0x2e6264(_0x25446d['message']);});});}function getTicket(_0xfd429c,_0x2fda13,_0x584d85,_0x50dae5,_0x29941f){return function(_0x2bc8e7){logger[_0x750d('0xd')](_0x750d('0x2e'));return new Promise(function(_0x2c9a6a,_0x417a8b){var _0x6fc4f9=moment();var _0x2da38e={'method':_0x750d('0x29'),'uri':_0x584d85+'/api/tasks','body':{'title':intUtil['getString'](_0x50dae5[_0x750d('0x2f')],_0x29941f,'\x20'),'description':intUtil[_0x750d('0x30')](_0x50dae5[_0x750d('0x31')],_0x29941f,'\x0a'),'owner_id':_0x2bc8e7[_0x750d('0x1d')],'creater_id':_0x2bc8e7['adminId'],'targetable_id':_0x2bc8e7[_0x750d('0x26')],'targetable_type':_0x750d('0x32'),'created_at':_0x6fc4f9['format'](_0x750d('0x2b')),'due_date':_0x6fc4f9['add'](0x1e,'m')[_0x750d('0x23')](_0x750d('0x2b'))},'json':!![]};_0x2da38e['headers']=_0x2fda13;return rp(_0x2da38e)[_0x750d('0xf')](function(_0x630e0f){_0x2bc8e7[_0x750d('0x33')]=_0x630e0f[_0x750d('0x34')]['id'];logger[_0x750d('0xd')](_0x750d('0x35'),_0x2bc8e7[_0x750d('0x33')]);_0x2c9a6a(_0x2bc8e7);})[_0x750d('0x1f')](function(_0x1d51b0){logger[_0x750d('0x16')]('['+[_0xfd429c['toUpperCase']()]+']',_0x1d51b0[_0x750d('0x18')]);_0x417a8b(_0x1d51b0['message']);});});};}function emit(_0x330291,_0x52328a,_0x266f94){var _0x3e6ef1={'uri':_0x330291+_0x750d('0x36')+_0x266f94};io['to'](util[_0x750d('0x23')](_0x750d('0x37'),_0x52328a))[_0x750d('0x38')](_0x750d('0x39'),_0x3e6ef1);}exports['cs']=function(_0x59dbe7,_0x45c89d,_0x576519,_0x2dff9d,_0x3c1c30,_0x4f8b68,_0x416e46,_0x47030c){var _0x2f3013={};var _0x466e08={'Authorization':'Token\x20token='+_0x4f8b68['apiKey']};_0x4f8b68[_0x750d('0x3a')]=intUtil[_0x750d('0x3b')](_0x4f8b68[_0x750d('0x3a')]);_0x4f8b68[_0x750d('0x3c')]=intUtil[_0x750d('0x3b')](_0x4f8b68[_0x750d('0x3c')]);var _0x1a568a=_0x4f8b68[_0x750d('0x3a')];_0x2f3013[_0x750d('0x12')]=_0x4f8b68[_0x750d('0x3d')];_0x2f3013['contactNumber']=_0x47030c[_0x750d('0x3e')]()===_0x750d('0x3f')?_0x45c89d[_0x750d('0x40')]:_0x45c89d[_0x750d('0x41')];_0x2f3013[_0x750d('0x42')]=_0x47030c===_0x750d('0x43')||_0x47030c===_0x750d('0x44')?_0x750d('0x43'):_0x750d('0x3f');if(_0x2dff9d){_0x2f3013[_0x750d('0x1c')]=_0x2dff9d[_0x750d('0x11')];}var _0x194ea3=util[_0x750d('0x23')](_0x750d('0x45'),_0x4f8b68[_0x750d('0x3c')],_0x45c89d[_0x750d('0x46')],md5(_0x45c89d[_0x750d('0x46')]));if(_0x3c1c30&&_0x3c1c30[_0x750d('0x47')]){logger[_0x750d('0xd')](_0x750d('0x48'),_0x750d('0x49'));_0x45c89d[_0x750d('0x4a')]=_0x194ea3;}else if(_0x416e46&&_0x416e46['recordingFormat']&&_0x416e46['recordingFormat']!=='none'){logger[_0x750d('0xd')](_0x750d('0x4b'),_0x750d('0x49'));_0x45c89d[_0x750d('0x4a')]=_0x194ea3;}else{_0x45c89d[_0x750d('0x4a')]='';}return getAdminId(_0x2f3013,_0x47030c,_0x466e08,_0x1a568a)['then'](getUser(_0x47030c,_0x466e08,_0x1a568a))[_0x750d('0xf')](getEndUser(_0x47030c,_0x466e08,_0x1a568a))['then'](getTicket(_0x47030c,_0x466e08,_0x1a568a,_0x576519,_0x45c89d))['then'](function(_0x50d98f){logger[_0x750d('0xd')](util[_0x750d('0x23')]('The\x20ticket\x20ID\x20is:\x20%s',_0x50d98f[_0x750d('0x33')]));if(_0x47030c!==_0x750d('0x44')){logger[_0x750d('0xd')]('['+[_0x47030c[_0x750d('0x17')]()]+']',_0x750d('0x4c'));emit(_0x1a568a,_0x2dff9d[_0x750d('0x4d')],_0x50d98f[_0x750d('0x26')]);}})[_0x750d('0x1f')](function(_0x2df5d9){logger[_0x750d('0x16')]('['+[_0x47030c[_0x750d('0x17')]()]+_0x750d('0x4e'),util['inspect'](_0x2df5d9,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x088c=['contact','/api/tasks','getString','Contact','add','ticketId','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','stripTrailingSlash','serverUrl','remoteUri','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','Displaying\x20task\x20in\x20a\x20new\x20tab...','inspect','md5','util','moment','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','Getting\x20user\x20list','Getting\x20user\x20with\x20email','agentEmail','userEmail','userId','User\x20found:','Admin\x20selected','/api/lookup?q=','find','contacts','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','endUserId','Contact\x20found\x20mobile_number:','work_number','POST','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact'];(function(_0x178856,_0x41f045){var _0x3c7fe7=function(_0x4d9ce4){while(--_0x4d9ce4){_0x178856['push'](_0x178856['shift']());}};_0x3c7fe7(++_0x41f045);}(_0x088c,0x6d));var _0xc088=function(_0x3bf53c,_0x236c79){_0x3bf53c=_0x3bf53c-0x0;var _0x37da15=_0x088c[_0x3bf53c];return _0x37da15;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0xc088('0x0'));var util=require(_0xc088('0x1'));var moment=require(_0xc088('0x2'));var Promise=require('bluebird');var Redis=require(_0xc088('0x3'));var intUtil=require('./util');var config=require(_0xc088('0x4'));var logger=require(_0xc088('0x5'))('freshsales');config[_0xc088('0x6')]=_[_0xc088('0x7')](config['redis'],{'host':_0xc088('0x8'),'port':0x18eb});var io=require(_0xc088('0x9'))(new Redis(config['redis']));function getAdminId(_0x57bd5f,_0x196464,_0x14402c,_0x403b30){return new Promise(function(_0x36b456,_0x2b65b6){var _0xcacb7f=![];var _0x1e4d1d={'method':_0xc088('0xa'),'uri':_0x403b30+_0xc088('0xb'),'json':!![]};_0x1e4d1d[_0xc088('0xc')]=_0x14402c;logger[_0xc088('0xd')](_0xc088('0xe'));return rp(_0x1e4d1d)[_0xc088('0xf')](function(_0x2d9436){if(_0x2d9436){var _0x21e023=_0x2d9436['users'];var _0x3e0d84=null;for(_0x3e0d84=0x0;_0x3e0d84<_0x21e023['length'];_0x3e0d84++){if(_0x21e023[_0x3e0d84][_0xc088('0x10')]===_0x57bd5f[_0xc088('0x11')]){_0x57bd5f[_0xc088('0x12')]=_0x21e023[_0x3e0d84]['id'];_0xcacb7f=!![];}}if(_0xcacb7f){logger[_0xc088('0xd')](_0xc088('0x13'),_0x57bd5f[_0xc088('0x12')]);_0x36b456(_0x57bd5f);}else{_0x2b65b6({'statusCode':0x194,'message':_0xc088('0x14')});}}else{_0x2b65b6({'statusCode':0x194,'message':_0xc088('0x14')});}})[_0xc088('0x15')](function(_0x1634ca){logger[_0xc088('0x16')]('['+[_0x196464[_0xc088('0x17')]()]+']',_0x1634ca[_0xc088('0x18')]);_0x2b65b6(_0x1634ca);});});}function getUser(_0x51fdea,_0x4acc18,_0x3f27b6){return function(_0x2bcd09){return new Promise(function(_0x27106a,_0x2fc1c8){var _0x3a5fb0={'method':_0xc088('0xa'),'uri':_0x3f27b6+'/api/selector/owners','json':!![]};_0x3a5fb0['headers']=_0x4acc18;logger[_0xc088('0xd')](_0xc088('0x19'));return rp(_0x3a5fb0)['then'](function(_0xc355c1){if(_0xc355c1){var _0x143744=_0xc355c1['users'];var _0x810230=![];var _0x3d70a8=null;if(_0x2bcd09['agentEmail']!==null){logger[_0xc088('0xd')](_0xc088('0x1a'),_0x2bcd09[_0xc088('0x1b')]);_0x2bcd09[_0xc088('0x1c')]=_0x2bcd09[_0xc088('0x1b')];for(_0x3d70a8=0x0;_0x3d70a8<_0x143744['length'];_0x3d70a8++){if(_0x143744[_0x3d70a8][_0xc088('0x10')]===_0x2bcd09[_0xc088('0x1b')]){_0x810230=!![];_0x2bcd09[_0xc088('0x1d')]=_0x143744[_0x3d70a8]['id'];logger[_0xc088('0xd')](_0xc088('0x1e'),_0x2bcd09[_0xc088('0x1d')]);}}}if(!_0x810230){logger[_0xc088('0xd')](_0xc088('0x1f'));_0x2bcd09['userEmail']=_0x2bcd09[_0xc088('0x11')];_0x2bcd09[_0xc088('0x1d')]=_0x2bcd09[_0xc088('0x12')];_0x810230=!![];}if(_0x810230){_0x27106a(_0x2bcd09);}else{_0x2fc1c8({'statusCode':0x194,'message':_0xc088('0x14')});}}else{_0x2fc1c8({'statusCode':0x194,'message':_0xc088('0x14')});}})[_0xc088('0x15')](function(_0x248c20){logger[_0xc088('0x16')]('['+[_0x51fdea['toUpperCase']()]+']',_0x248c20[_0xc088('0x18')]);_0x2fc1c8(_0x248c20);});});};}function searchContact(_0x19d74c,_0x1f4995,_0x1d2a06,_0x1bbda4){return new Promise(function(_0x12866f,_0xde5ea1){var _0x355dc1={'method':'GET','headers':_0x1f4995,'uri':_0x19d74c+_0xc088('0x20')+_0x1bbda4+'&f='+_0x1d2a06+'&entities=contact','json':!![]};rp(_0x355dc1)[_0xc088('0xf')](function(_0x552134){var _0x5911d9=_[_0xc088('0x21')](_0x552134['contacts'][_0xc088('0x22')],[_0x1d2a06,_0x1bbda4]);_0x12866f(_0x5911d9);})['catch'](function(_0x5a0439){_0xde5ea1(_0x5a0439);});});}function getEndUser(_0x487b08,_0x474f13,_0x4c0c8f){return function(_0x2a2e38){return new Promise(function(_0x13ac5c,_0x1b61f5){logger[_0xc088('0xd')](util['format'](_0xc088('0x23'),_0x2a2e38[_0xc088('0x24')]));searchContact(_0x4c0c8f,_0x474f13,'mobile_number',_0x2a2e38[_0xc088('0x24')])['then'](function(_0x142d07){if(_0x142d07){_0x2a2e38[_0xc088('0x25')]=_0x142d07['id'];logger['info'](_0xc088('0x26'),_0x2a2e38[_0xc088('0x25')]);return _0x13ac5c(_0x2a2e38);}searchContact(_0x4c0c8f,_0x474f13,_0xc088('0x27'),_0x2a2e38[_0xc088('0x24')])[_0xc088('0xf')](function(_0x2ad1a7){if(_0x2ad1a7){_0x2a2e38['endUserId']=_0x2ad1a7['id'];logger[_0xc088('0xd')]('Contact\x20found\x20work_number:',_0x2a2e38[_0xc088('0x25')]);return _0x13ac5c(_0x2a2e38);}createEndUser(_0x2a2e38,_0x487b08,_0x474f13,_0x4c0c8f)[_0xc088('0xf')](function(_0x530d5){logger['info']('Contact\x20created:',_0x530d5[_0xc088('0x25')]);return _0x13ac5c(_0x530d5);});});})[_0xc088('0x15')](function(_0x2780c7){_0x1b61f5(_0x2780c7);});});};}function createEndUser(_0x5b723f,_0x159f42,_0x5b88ad,_0x4377c6){return new Promise(function(_0x587fb2,_0x3eee40){var _0x42b6ec=moment();var _0x12fe50={'method':_0xc088('0x28'),'uri':_0x4377c6+_0xc088('0x29'),'body':{'contact':{'last_name':_0x5b723f[_0xc088('0x24')],'work_number':_0x5b723f[_0xc088('0x24')],'mobile_number':_0x5b723f[_0xc088('0x24')],'owner_id':_0x5b723f[_0xc088('0x1d')],'created_at':_0x42b6ec[_0xc088('0x2a')](_0xc088('0x2b'))}},'json':!![]};_0x12fe50[_0xc088('0xc')]=_0x5b88ad;logger[_0xc088('0xd')](_0xc088('0x2c'));return rp(_0x12fe50)['then'](function(_0xe793b){_0x5b723f['endUserId']=_0xe793b[_0xc088('0x2d')]['id'];_0x587fb2(_0x5b723f);})['catch'](function(_0x3a2f63){logger[_0xc088('0x16')]('['+[_0x159f42[_0xc088('0x17')]()]+']',_0x3a2f63['message']);_0x3eee40(_0x3a2f63[_0xc088('0x18')]);});});}function getTicket(_0x384ce6,_0x4af44c,_0x54ad28,_0x3a61b7,_0x391d84){return function(_0x2168b9){logger[_0xc088('0xd')]('Creating\x20new\x20task');return new Promise(function(_0x1c9263,_0x13faf4){var _0x11b629=moment();var _0x220aa2={'method':_0xc088('0x28'),'uri':_0x54ad28+_0xc088('0x2e'),'body':{'title':intUtil[_0xc088('0x2f')](_0x3a61b7['Subjects'],_0x391d84,'\x20'),'description':intUtil['getString'](_0x3a61b7['Descriptions'],_0x391d84,'\x0a'),'owner_id':_0x2168b9[_0xc088('0x1d')],'creater_id':_0x2168b9[_0xc088('0x12')],'targetable_id':_0x2168b9['endUserId'],'targetable_type':_0xc088('0x30'),'created_at':_0x11b629[_0xc088('0x2a')](_0xc088('0x2b')),'due_date':_0x11b629[_0xc088('0x31')](0x1e,'m')['format']('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x220aa2[_0xc088('0xc')]=_0x4af44c;return rp(_0x220aa2)['then'](function(_0x48a4b5){_0x2168b9[_0xc088('0x32')]=_0x48a4b5['task']['id'];logger[_0xc088('0xd')](_0xc088('0x33'),_0x2168b9[_0xc088('0x32')]);_0x1c9263(_0x2168b9);})['catch'](function(_0x4bbbb2){logger[_0xc088('0x16')]('['+[_0x384ce6[_0xc088('0x17')]()]+']',_0x4bbbb2[_0xc088('0x18')]);_0x13faf4(_0x4bbbb2[_0xc088('0x18')]);});});};}function emit(_0x4be2b5,_0x505d59,_0x33824b){var _0x3df3a4={'uri':_0x4be2b5+_0xc088('0x34')+_0x33824b};io['to'](util[_0xc088('0x2a')](_0xc088('0x35'),_0x505d59))[_0xc088('0x36')](_0xc088('0x37'),_0x3df3a4);}exports['cs']=function(_0x50e87d,_0x550f3b,_0x5d2e4a,_0x4cb268,_0x2052af,_0x12ea99,_0x21955b,_0x45c69c){var _0x16321d={};var _0x3fcd6e={'Authorization':_0xc088('0x38')+_0x12ea99[_0xc088('0x39')]};_0x12ea99['remoteUri']=intUtil[_0xc088('0x3a')](_0x12ea99['remoteUri']);_0x12ea99[_0xc088('0x3b')]=intUtil['stripTrailingSlash'](_0x12ea99['serverUrl']);var _0x5bdf35=_0x12ea99[_0xc088('0x3c')];_0x16321d[_0xc088('0x11')]=_0x12ea99[_0xc088('0x3d')];_0x16321d[_0xc088('0x24')]=_0x45c69c[_0xc088('0x3e')]()===_0xc088('0x3f')?_0x550f3b[_0xc088('0x40')]:_0x550f3b[_0xc088('0x41')];_0x16321d[_0xc088('0x42')]=_0x45c69c===_0xc088('0x43')||_0x45c69c===_0xc088('0x44')?_0xc088('0x43'):_0xc088('0x3f');if(_0x4cb268){_0x16321d[_0xc088('0x1b')]=_0x4cb268[_0xc088('0x10')];}var _0x5f0e0c=util[_0xc088('0x2a')](_0xc088('0x45'),_0x12ea99[_0xc088('0x3b')],_0x550f3b[_0xc088('0x46')],md5(_0x550f3b[_0xc088('0x46')]));if(_0x2052af&&_0x2052af[_0xc088('0x47')]){logger['info']('[QUEUE]',_0xc088('0x48'));_0x550f3b[_0xc088('0x49')]=_0x5f0e0c;}else if(_0x21955b&&_0x21955b[_0xc088('0x4a')]&&_0x21955b[_0xc088('0x4a')]!=='none'){logger[_0xc088('0xd')]('[OUTBOUND]',_0xc088('0x48'));_0x550f3b[_0xc088('0x49')]=_0x5f0e0c;}else{_0x550f3b[_0xc088('0x49')]='';}return getAdminId(_0x16321d,_0x45c69c,_0x3fcd6e,_0x5bdf35)[_0xc088('0xf')](getUser(_0x45c69c,_0x3fcd6e,_0x5bdf35))['then'](getEndUser(_0x45c69c,_0x3fcd6e,_0x5bdf35))[_0xc088('0xf')](getTicket(_0x45c69c,_0x3fcd6e,_0x5bdf35,_0x5d2e4a,_0x550f3b))[_0xc088('0xf')](function(_0x5e7acc){logger['info'](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x5e7acc[_0xc088('0x32')]));if(_0x45c69c!==_0xc088('0x44')){logger[_0xc088('0xd')]('['+[_0x45c69c[_0xc088('0x17')]()]+']',_0xc088('0x4b'));emit(_0x5bdf35,_0x4cb268['name'],_0x5e7acc[_0xc088('0x25')]);}})['catch'](function(_0x38b23d){logger[_0xc088('0x16')]('['+[_0x45c69c[_0xc088('0x17')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0xc088('0x4c')](_0x38b23d,{'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 4cf5ebd..8942ff1 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 _0x90ab=['./dynamics365','./freshsales','zendesk','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','exec','data1','data2','find','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','toLowerCase','salesforce','servicenow','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','util','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger'];(function(_0x256821,_0x495078){var _0x4a7fc8=function(_0xf0e528){while(--_0xf0e528){_0x256821['push'](_0x256821['shift']());}};_0x4a7fc8(++_0x495078);}(_0x90ab,0x65));var _0xb90a=function(_0x37c8ef,_0x334449){_0x37c8ef=_0x37c8ef-0x0;var _0x5eaee9=_0x90ab[_0x37c8ef];return _0x5eaee9;};'use strict';var _=require(_0xb90a('0x0'));var util=require(_0xb90a('0x1'));var zendesk=require('./zendesk');var salesforce=require('./salesforce');var sugarcrm=require(_0xb90a('0x2'));var freshdesk=require(_0xb90a('0x3'));var zoho=require(_0xb90a('0x4'));var desk=require(_0xb90a('0x5'));var vtiger=require(_0xb90a('0x6'));var servicenow=require('./servicenow');var dynamics365=require(_0xb90a('0x7'));var freshsales=require(_0xb90a('0x8'));var integrations=[_0xb90a('0x9'),'salesforce',_0xb90a('0xa'),_0xb90a('0xb'),_0xb90a('0xc'),_0xb90a('0xd'),_0xb90a('0xe'),_0xb90a('0xf'),_0xb90a('0x10'),'servicenow'];exports[_0xb90a('0x11')]=function(_0xa3ef3a,_0x399aa6,_0x1260d3,_0x542285,_0x170b90,_0x2cd23a){if(_0x1260d3){if(_['includes'](integrations,_0xa3ef3a[_0xb90a('0x12')]['toLowerCase']())){try{var _0x52145e=null;var _0x2e0f7c='';var _0xc47f7b=_0x1260d3[_0xa3ef3a[_0xb90a('0x12')]['toLowerCase']()];if(_0xc47f7b){var _0x1f928c=_0xc47f7b[_0xa3ef3a[_0xb90a('0x13')]];if(_0x1f928c){var _0x24a786=_[_0xb90a('0x14')](_0x1f928c['Configurations'],{'id':parseInt(_0xa3ef3a[_0xb90a('0x15')],0xa)});if(_0x24a786){if(_0x542285){if(_0x170b90&&_0x399aa6[_0xb90a('0x16')]){_0x2e0f7c=_0xb90a('0x16');}else if(_0x399aa6[_0xb90a('0x17')]){_0x2e0f7c=_0xb90a('0x18');}else{console[_0xb90a('0x19')](_0xb90a('0x1a'),_0x399aa6);}}else{_0x2e0f7c='unmanaged';}switch(_0xa3ef3a['data1'][_0xb90a('0x1b')]()){case'zendesk':zendesk[_0x2e0f7c](_0xa3ef3a,_0x399aa6,_0x24a786,_0x542285,_0x170b90,_0x1f928c,_0x2cd23a);break;case _0xb90a('0x1c'):salesforce[_0x2e0f7c](_0xa3ef3a,_0x399aa6,_0x24a786,_0x542285,_0x170b90,_0x1f928c,_0x2cd23a);break;case'sugarcrm':sugarcrm[_0x2e0f7c](_0xa3ef3a,_0x399aa6,_0x24a786,_0x542285,_0x170b90,_0x1f928c,_0x2cd23a);break;case _0xb90a('0xb'):freshdesk[_0x2e0f7c](_0xa3ef3a,_0x399aa6,_0x24a786,_0x542285,_0x170b90,_0x1f928c,_0x2cd23a);break;case'zoho':zoho[_0x2e0f7c](_0xa3ef3a,_0x399aa6,_0x24a786,_0x542285,_0x170b90,_0x1f928c,_0x2cd23a);break;case _0xb90a('0xd'):desk[_0x2e0f7c](_0xa3ef3a,_0x399aa6,_0x24a786,_0x542285,_0x170b90,_0x1f928c,_0x2cd23a);break;case _0xb90a('0xe'):vtiger[_0x2e0f7c](_0xa3ef3a,_0x399aa6,_0x24a786,_0x542285,_0x170b90,_0x1f928c,_0x2cd23a);break;case _0xb90a('0x10'):freshsales['cs'](_0xa3ef3a,_0x399aa6,_0x24a786,_0x542285,_0x170b90,_0x1f928c,_0x2cd23a,_0x2e0f7c);break;case _0xb90a('0x1d'):servicenow['cs'](_0xa3ef3a,_0x399aa6,_0x24a786,_0x542285,_0x170b90,_0x1f928c,_0x2cd23a,_0x2e0f7c);break;case _0xb90a('0xf'):dynamics365['cs'](_0xa3ef3a,_0x399aa6,_0x24a786,_0x542285,_0x170b90,_0x1f928c,_0x2cd23a,_0x2e0f7c);break;default:console[_0xb90a('0x19')]('unknown\x20integration');}}else{_0x52145e=require(_0xb90a('0x1e'))(_0xa3ef3a[_0xb90a('0x12')][_0xb90a('0x1b')]());_0x52145e[_0xb90a('0x1f')](_0xb90a('0x20'),util[_0xb90a('0x21')](_0xb90a('0x22'),_0xa3ef3a[_0xb90a('0x12')]['toLowerCase'](),_0xa3ef3a[_0xb90a('0x15')]));}}else{_0x52145e=require('../../../../config/logger')(_0xa3ef3a[_0xb90a('0x12')][_0xb90a('0x1b')]());_0x52145e[_0xb90a('0x1f')](_0xb90a('0x20'),util[_0xb90a('0x21')](_0xb90a('0x23'),_0xa3ef3a[_0xb90a('0x12')][_0xb90a('0x1b')](),_0xa3ef3a[_0xb90a('0x13')]));}}else{}}catch(_0x4937f2){console[_0xb90a('0x1f')](_0x4937f2);}}}}; \ No newline at end of file +var _0xc39c=['freshsales','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','error','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./dynamics365','./freshsales','salesforce','freshdesk','zoho','desk','vtiger','servicenow','exec','includes','data1','toLowerCase','data2','find','data3','queue','outbound','log','EVENT\x20UNKNOWN','unmanaged','sugarcrm'];(function(_0x597b3a,_0x140d66){var _0x744fa8=function(_0x1d78a4){while(--_0x1d78a4){_0x597b3a['push'](_0x597b3a['shift']());}};_0x744fa8(++_0x140d66);}(_0xc39c,0x1b6));var _0xcc39=function(_0x3109ee,_0x19584e){_0x3109ee=_0x3109ee-0x0;var _0x33cb6d=_0xc39c[_0x3109ee];return _0x33cb6d;};'use strict';var _=require(_0xcc39('0x0'));var util=require(_0xcc39('0x1'));var zendesk=require(_0xcc39('0x2'));var salesforce=require(_0xcc39('0x3'));var sugarcrm=require(_0xcc39('0x4'));var freshdesk=require(_0xcc39('0x5'));var zoho=require(_0xcc39('0x6'));var desk=require(_0xcc39('0x7'));var vtiger=require(_0xcc39('0x8'));var servicenow=require('./servicenow');var dynamics365=require(_0xcc39('0x9'));var freshsales=require(_0xcc39('0xa'));var integrations=['zendesk',_0xcc39('0xb'),'sugarcrm',_0xcc39('0xc'),_0xcc39('0xd'),_0xcc39('0xe'),_0xcc39('0xf'),'dynamics365','freshsales',_0xcc39('0x10')];exports[_0xcc39('0x11')]=function(_0x5a8398,_0x265867,_0x3cbbad,_0x2e5034,_0x2505c0,_0x1d0985){if(_0x3cbbad){if(_[_0xcc39('0x12')](integrations,_0x5a8398[_0xcc39('0x13')][_0xcc39('0x14')]())){try{var _0x54989c=null;var _0x3ba974='';var _0x399bc2=_0x3cbbad[_0x5a8398['data1'][_0xcc39('0x14')]()];if(_0x399bc2){var _0x1537a5=_0x399bc2[_0x5a8398[_0xcc39('0x15')]];if(_0x1537a5){var _0x27dcf1=_[_0xcc39('0x16')](_0x1537a5['Configurations'],{'id':parseInt(_0x5a8398[_0xcc39('0x17')],0xa)});if(_0x27dcf1){if(_0x2e5034){if(_0x2505c0&&_0x265867[_0xcc39('0x18')]){_0x3ba974='queue';}else if(_0x265867['routeId']){_0x3ba974=_0xcc39('0x19');}else{console[_0xcc39('0x1a')](_0xcc39('0x1b'),_0x265867);}}else{_0x3ba974=_0xcc39('0x1c');}switch(_0x5a8398[_0xcc39('0x13')][_0xcc39('0x14')]()){case'zendesk':zendesk[_0x3ba974](_0x5a8398,_0x265867,_0x27dcf1,_0x2e5034,_0x2505c0,_0x1537a5,_0x1d0985);break;case'salesforce':salesforce[_0x3ba974](_0x5a8398,_0x265867,_0x27dcf1,_0x2e5034,_0x2505c0,_0x1537a5,_0x1d0985);break;case _0xcc39('0x1d'):sugarcrm[_0x3ba974](_0x5a8398,_0x265867,_0x27dcf1,_0x2e5034,_0x2505c0,_0x1537a5,_0x1d0985);break;case _0xcc39('0xc'):freshdesk[_0x3ba974](_0x5a8398,_0x265867,_0x27dcf1,_0x2e5034,_0x2505c0,_0x1537a5,_0x1d0985);break;case _0xcc39('0xd'):zoho[_0x3ba974](_0x5a8398,_0x265867,_0x27dcf1,_0x2e5034,_0x2505c0,_0x1537a5,_0x1d0985);break;case _0xcc39('0xe'):desk[_0x3ba974](_0x5a8398,_0x265867,_0x27dcf1,_0x2e5034,_0x2505c0,_0x1537a5,_0x1d0985);break;case'vtiger':vtiger[_0x3ba974](_0x5a8398,_0x265867,_0x27dcf1,_0x2e5034,_0x2505c0,_0x1537a5,_0x1d0985);break;case _0xcc39('0x1e'):freshsales['cs'](_0x5a8398,_0x265867,_0x27dcf1,_0x2e5034,_0x2505c0,_0x1537a5,_0x1d0985,_0x3ba974);break;case _0xcc39('0x10'):servicenow['cs'](_0x5a8398,_0x265867,_0x27dcf1,_0x2e5034,_0x2505c0,_0x1537a5,_0x1d0985,_0x3ba974);break;case'dynamics365':dynamics365['cs'](_0x5a8398,_0x265867,_0x27dcf1,_0x2e5034,_0x2505c0,_0x1537a5,_0x1d0985,_0x3ba974);break;default:console[_0xcc39('0x1a')]('unknown\x20integration');}}else{_0x54989c=require('../../../../config/logger')(_0x5a8398[_0xcc39('0x13')][_0xcc39('0x14')]());_0x54989c['error'](_0xcc39('0x1f'),util[_0xcc39('0x20')](_0xcc39('0x21'),_0x5a8398[_0xcc39('0x13')][_0xcc39('0x14')](),_0x5a8398['data3']));}}else{_0x54989c=require('../../../../config/logger')(_0x5a8398[_0xcc39('0x13')][_0xcc39('0x14')]());_0x54989c[_0xcc39('0x22')]('[EXEC]',util['format'](_0xcc39('0x23'),_0x5a8398['data1']['toLowerCase'](),_0x5a8398[_0xcc39('0x15')]));}}else{}}catch(_0x22406f){console['error'](_0x22406f);}}}}; \ 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 fca787a..53ca9fb 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 _0xe0e2=['Subjects','Descriptions','ticketType','Task','utc','IsReminderSet','IsRecurrence','lead','WhoId','endUserType','account','Case','contact','ContactId','AccountId','leadId','info','sobject','create','validateEmail','User','find','execute','then','length','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','contact_lead','additionalSearchContact','merge','$or','Contact','cloneDeep','additionalSearchLead','account_contact_lead','additionalSearchAccount','Account','first','Phone','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','upperFirst','forEach','includes','string','type','idField','toString','variable','variableName','customVariable','Variable','name','password','concat','remoteUri','https://login.salesforce.com','clientId','clientSecret','username','Connection\x20established.','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','calleridname','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','catch','error','outbound','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','monitor_format','calleridnum','lastevent',']\x20Ticket\x20%s\x20created.','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','lodash','md5','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','emit','assign','getString'];(function(_0x3bfc9e,_0x2bd064){var _0x4568b4=function(_0x32fa99){while(--_0x32fa99){_0x3bfc9e['push'](_0x3bfc9e['shift']());}};_0x4568b4(++_0x2bd064);}(_0xe0e2,0xeb));var _0x2e0e=function(_0x137d80,_0x4ca815){_0x137d80=_0x137d80-0x0;var _0x406c15=_0xe0e2[_0x137d80];return _0x406c15;};'use strict';var _=require(_0x2e0e('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var md5=require(_0x2e0e('0x1'));var jsforce=require(_0x2e0e('0x2'));var util=require(_0x2e0e('0x3'));var Redis=require(_0x2e0e('0x4'));var intUtil=require(_0x2e0e('0x5'));var config=require(_0x2e0e('0x6'));var logger=require(_0x2e0e('0x7'))(_0x2e0e('0x8'));config[_0x2e0e('0x9')]=_[_0x2e0e('0xa')](config['redis'],{'host':_0x2e0e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2e0e('0x9')]));function emit(_0x14c3e0,_0xad62b6,_0x41fb7d){io['to'](_0x14c3e0)[_0x2e0e('0xc')](_0xad62b6,_0x41fb7d);}function getTicket(_0x2a7401,_0x47e624,_0x4af957,_0x34bb3b,_0x20688d,_0xb0789f,_0x2bc008,_0x1203a6){var _0x293dff=Object[_0x2e0e('0xd')]({},{'OwnerId':_0x47e624['id'],'Subject':intUtil[_0x2e0e('0xe')](_0x34bb3b[_0x2e0e('0xf')],_0x20688d,'\x20'),'Description':intUtil[_0x2e0e('0xe')](_0x34bb3b[_0x2e0e('0x10')],_0x20688d,'\x0a')},getCustomFields(_0xb0789f,_0x20688d));if(_0x4af957){if(_0x34bb3b[_0x2e0e('0x11')]===_0x2e0e('0x12')){_0x293dff['ActivityDate']=moment[_0x2e0e('0x13')]();_0x293dff[_0x2e0e('0x14')]=![];_0x293dff[_0x2e0e('0x15')]=![];if(_0x4af957['endUserType']==='contact'||_0x4af957['endUserType']===_0x2e0e('0x16')){_0x293dff[_0x2e0e('0x17')]=_0x4af957['id'];}else if(_0x4af957[_0x2e0e('0x18')]===_0x2e0e('0x19')){_0x293dff['WhatId']=_0x4af957['id'];}}else if(_0x34bb3b[_0x2e0e('0x11')]===_0x2e0e('0x1a')){if(_0x4af957['endUserType']===_0x2e0e('0x1b')){_0x293dff[_0x2e0e('0x1c')]=_0x4af957['id'];}else if(_0x4af957[_0x2e0e('0x18')]==='account'){_0x293dff[_0x2e0e('0x1d')]=_0x4af957['id'];}else if(_0x4af957[_0x2e0e('0x18')]===_0x2e0e('0x16')&&_0x34bb3b[_0x2e0e('0x1e')]){_0x293dff[_0x34bb3b[_0x2e0e('0x1e')]]=_0x4af957['id'];}else{logger[_0x2e0e('0x1f')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x2bc008[_0x2e0e('0x20')](_0x34bb3b[_0x2e0e('0x11')])[_0x2e0e('0x21')](_0x293dff);}function getUser(_0x38fe01,_0x3e1b1d,_0x19782e){if(!_['isNil'](_0x3e1b1d)&&intUtil[_0x2e0e('0x22')](_0x3e1b1d)){var _0x48231f={'Email':_0x3e1b1d};var _0x5b43cb={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x19782e[_0x2e0e('0x20')](_0x2e0e('0x23'))[_0x2e0e('0x24')](_0x48231f,_0x5b43cb)[_0x2e0e('0x25')]()[_0x2e0e('0x26')](function(_0x220795){if(_0x220795[_0x2e0e('0x27')]){var _0x314406=_[_0x2e0e('0x24')](_0x220795,function(_0x1ae113){return _0x1ae113['Email']===_0x3e1b1d;});if(_0x314406){logger[_0x2e0e('0x1f')](_0x2e0e('0x28'),_0x3e1b1d);return BPromise[_0x2e0e('0x29')]({'id':_0x314406['Id'],'name':_0x314406[_0x2e0e('0x2a')]});}}else{logger[_0x2e0e('0x1f')](_0x2e0e('0x2b'),_0x3e1b1d);return _0x19782e[_0x2e0e('0x2c')]()[_0x2e0e('0x26')](function(_0x3ee390){return BPromise[_0x2e0e('0x29')]({'id':_0x3ee390[_0x2e0e('0x2d')],'name':_0x3ee390[_0x2e0e('0x2e')]});});}});}else{logger['info'](_0x2e0e('0x2b'),_0x3e1b1d);return _0x19782e[_0x2e0e('0x2c')]()[_0x2e0e('0x26')](function(_0x43ec90){return BPromise[_0x2e0e('0x29')]({'id':_0x43ec90[_0x2e0e('0x2d')],'name':_0x43ec90[_0x2e0e('0x2e')]});});}}function getEndUser(_0x2907cb,_0x17b4ce,_0x40c11a,_0x278154,_0x14fd3b){var _0x2f83a2={'$or':{'Phone':_0x278154}};var _0x2092a7={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x2e0e('0x26')](function(){logger['info'](_0x2e0e('0x2f'),_0x278154,_0x17b4ce['moduleSearch']);switch(_0x17b4ce['moduleSearch']){case _0x2e0e('0x30'):var _0x344ea4=_['cloneDeep'](_0x2f83a2);if(_0x17b4ce[_0x2e0e('0x31')]){var _0x5c8139={};_0x5c8139[_0x17b4ce[_0x2e0e('0x31')]]=_0x278154;_[_0x2e0e('0x32')](_0x344ea4[_0x2e0e('0x33')],_0x5c8139);}return _0x14fd3b[_0x2e0e('0x20')](_0x2e0e('0x34'))[_0x2e0e('0x24')](_0x344ea4,_0x2092a7)[_0x2e0e('0x25')]()['then'](function(_0x11c820){if(_0x11c820&&_0x11c820[_0x2e0e('0x27')]){return _0x11c820;}else{var _0x1d2ab3=_[_0x2e0e('0x35')](_0x2f83a2);if(_0x17b4ce[_0x2e0e('0x36')]){var _0x295aac={};_0x295aac[_0x17b4ce[_0x2e0e('0x36')]]=_0x278154;_[_0x2e0e('0x32')](_0x1d2ab3[_0x2e0e('0x33')],_0x295aac);}return _0x14fd3b['sobject']('Lead')[_0x2e0e('0x24')](_0x1d2ab3,_0x2092a7);}});case _0x2e0e('0x37'):var _0x205509=_[_0x2e0e('0x35')](_0x2f83a2);if(_0x17b4ce[_0x2e0e('0x38')]){var _0x5c8139={};_0x5c8139[_0x17b4ce[_0x2e0e('0x38')]]=_0x278154;_[_0x2e0e('0x32')](_0x205509[_0x2e0e('0x33')],_0x5c8139);}return _0x14fd3b[_0x2e0e('0x20')](_0x2e0e('0x39'))['find'](_0x205509,_0x2092a7)[_0x2e0e('0x25')]()['then'](function(_0x253226){if(_0x253226&&_0x253226[_0x2e0e('0x27')]){return _0x253226;}else{var _0x15b8a4=_[_0x2e0e('0x35')](_0x2f83a2);if(_0x17b4ce[_0x2e0e('0x31')]){var _0x15a9b6={};_0x15a9b6[_0x17b4ce[_0x2e0e('0x31')]]=_0x278154;_['merge'](_0x15b8a4[_0x2e0e('0x33')],_0x15a9b6);}return _0x14fd3b[_0x2e0e('0x20')](_0x2e0e('0x34'))['find'](_0x15b8a4,_0x2092a7)[_0x2e0e('0x26')](function(_0x43dc9c){if(_0x43dc9c&&_0x43dc9c['length']){return _0x43dc9c;}else{var _0x1a5ded=_[_0x2e0e('0x35')](_0x2f83a2);if(_0x17b4ce[_0x2e0e('0x36')]){var _0x563757={};_0x563757[_0x17b4ce[_0x2e0e('0x36')]]=_0x278154;_[_0x2e0e('0x32')](_0x1a5ded[_0x2e0e('0x33')],_0x563757);}return _0x14fd3b[_0x2e0e('0x20')]('Lead')[_0x2e0e('0x24')](_0x1a5ded,_0x2092a7);}});}});case'contact':var _0x344ea4=_[_0x2e0e('0x35')](_0x2f83a2);if(_0x17b4ce['additionalSearchContact']){var _0x5c8139={};_0x5c8139[_0x17b4ce[_0x2e0e('0x31')]]=_0x278154;_[_0x2e0e('0x32')](_0x344ea4[_0x2e0e('0x33')],_0x5c8139);}return _0x14fd3b['sobject'](_0x2e0e('0x34'))[_0x2e0e('0x24')](_0x344ea4,_0x2092a7)[_0x2e0e('0x25')]();case _0x2e0e('0x16'):var _0x474284=_[_0x2e0e('0x35')](_0x2f83a2);if(_0x17b4ce[_0x2e0e('0x36')]){var _0x5c8139={};_0x5c8139[_0x17b4ce[_0x2e0e('0x36')]]=_0x278154;_['merge'](_0x474284[_0x2e0e('0x33')],_0x5c8139);}return _0x14fd3b[_0x2e0e('0x20')]('Lead')[_0x2e0e('0x24')](_0x474284,_0x2092a7);case _0x2e0e('0x19'):var _0x205509=_[_0x2e0e('0x35')](_0x2f83a2);if(_0x17b4ce[_0x2e0e('0x38')]){var _0x5c8139={};_0x5c8139[_0x17b4ce[_0x2e0e('0x38')]]=_0x278154;_['merge'](_0x205509['$or'],_0x5c8139);}return _0x14fd3b['sobject'](_0x2e0e('0x39'))['find'](_0x205509,_0x2092a7);default:return null;}})[_0x2e0e('0x26')](function(_0x4f3598){if(_0x4f3598&&_0x4f3598[_0x2e0e('0x27')]){var _0x5668b2=_[_0x2e0e('0x3a')](_0x4f3598);if(_0x5668b2){return BPromise[_0x2e0e('0x29')]({'id':_0x5668b2['Id'],'name':_0x5668b2[_0x2e0e('0x2a')],'phone':_0x5668b2[_0x2e0e('0x3b')],'endUserType':_0x5668b2['attributes']['type'][_0x2e0e('0x3c')]()});}}})[_0x2e0e('0x26')](function(_0x5373d6){if(_0x5373d6){logger['info']('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x5373d6['endUserType'],_0x278154);return BPromise['resolve'](_0x5373d6);}else{logger[_0x2e0e('0x1f')](_0x2e0e('0x3d'),_0x278154);var _0x14578a={'Phone':_0x278154};if(_0x17b4ce['moduleCreate']){if(_0x17b4ce[_0x2e0e('0x3e')]==='contact'){logger[_0x2e0e('0x1f')](_0x2e0e('0x3f'),_0x278154,_0x17b4ce[_0x2e0e('0x3e')]);_0x14578a[_0x2e0e('0x40')]=_0x40c11a!==_0x2e0e('0x41')?_0x40c11a:util['format']('Caller\x20-\x20%s',_0x278154);}else if(_0x17b4ce[_0x2e0e('0x3e')]===_0x2e0e('0x16')){logger[_0x2e0e('0x1f')](_0x2e0e('0x3f'),_0x278154,_0x17b4ce[_0x2e0e('0x3e')]);_0x14578a[_0x2e0e('0x40')]=_0x40c11a!==_0x2e0e('0x41')?_0x40c11a:util[_0x2e0e('0x42')](_0x2e0e('0x43'),_0x278154);_0x14578a['Company']='No\x20Company';}else if(_0x17b4ce['moduleCreate']===_0x2e0e('0x19')){logger[_0x2e0e('0x1f')](_0x2e0e('0x3f'),_0x278154,_0x17b4ce[_0x2e0e('0x3e')]);_0x14578a['Name']=_0x40c11a!==''?_0x40c11a:util[_0x2e0e('0x42')]('Caller\x20-\x20%s',_0x278154);}else{return null;}}return _0x14fd3b[_0x2e0e('0x20')](_[_0x2e0e('0x44')](_0x17b4ce[_0x2e0e('0x3e')]))[_0x2e0e('0x21')](_0x14578a)[_0x2e0e('0x26')](function(_0x35fb43){return BPromise[_0x2e0e('0x29')]({'id':_0x35fb43['id'],'endUserType':_0x17b4ce['moduleCreate']});});}});}function getCustomFields(_0x48c820,_0xd22d69){var _0x5dd108={};if(_0x48c820[_0x2e0e('0x27')]>0x0){_[_0x2e0e('0x45')](_0x48c820,function(_0x3d48e1){if(_[_0x2e0e('0x46')]([_0x2e0e('0x47'),'picklist'],_0x3d48e1[_0x2e0e('0x48')])&&_0x3d48e1[_0x2e0e('0x49')]){_0x5dd108[_0x3d48e1[_0x2e0e('0x49')]]=_0x3d48e1['content'][_0x2e0e('0x4a')]();}else if(_0x3d48e1[_0x2e0e('0x48')]===_0x2e0e('0x4b')&&_0x3d48e1[_0x2e0e('0x4c')]&&_0x3d48e1[_0x2e0e('0x49')]){_0xd22d69[_0x3d48e1[_0x2e0e('0x4c')]]&&(_0x5dd108[_0x3d48e1['idField']]=_0xd22d69[_0x3d48e1[_0x2e0e('0x4c')]][_0x2e0e('0x4a')]());}else if(_0x3d48e1[_0x2e0e('0x48')]===_0x2e0e('0x4d')&&_0x3d48e1[_0x2e0e('0x4e')]&&_0x3d48e1['Variable'][_0x2e0e('0x4f')]&&_0x3d48e1[_0x2e0e('0x49')]){_0xd22d69[_0x3d48e1[_0x2e0e('0x4e')][_0x2e0e('0x4f')]['toLowerCase']()]&&(_0x5dd108[_0x3d48e1[_0x2e0e('0x49')]]=_0xd22d69[_0x3d48e1['Variable'][_0x2e0e('0x4f')][_0x2e0e('0x3c')]()][_0x2e0e('0x4a')]());}});}return _0x5dd108;}function getConnection(_0x4685e9){var _0x253381=_0x4685e9[_0x2e0e('0x50')][_0x2e0e('0x51')](_0x4685e9['securityToken']);var _0x5894df=new jsforce['Connection']({'oauth2':{'loginUrl':_0x4685e9[_0x2e0e('0x52')]||_0x2e0e('0x53'),'clientId':_0x4685e9[_0x2e0e('0x54')],'clientSecret':_0x4685e9[_0x2e0e('0x55')]}});return _0x5894df['login'](_0x4685e9[_0x2e0e('0x56')],_0x253381)[_0x2e0e('0x26')](function(){logger[_0x2e0e('0x1f')](_0x2e0e('0x57'));return _0x5894df;});}exports[_0x2e0e('0x58')]=function(_0x16f602,_0x22c727,_0x12f2ae,_0x56d77a,_0x160923,_0x38a52c){var _0x369151,_0x4144de,_0x4748ac,_0x306bbc;_0x38a52c['serverUrl']=intUtil[_0x2e0e('0x59')](_0x38a52c[_0x2e0e('0x5a')]);_0x38a52c[_0x2e0e('0x52')]=intUtil[_0x2e0e('0x59')](_0x38a52c['remoteUri']);if(_0x160923&&_0x160923['monitor_format']){logger[_0x2e0e('0x1f')](_0x2e0e('0x5b'),_0x2e0e('0x5c'));_0x22c727[_0x2e0e('0x5d')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x38a52c[_0x2e0e('0x5a')],_0x22c727[_0x2e0e('0x5e')],md5(_0x22c727[_0x2e0e('0x5e')]));}else{_0x22c727[_0x2e0e('0x5d')]='';}return getConnection(_0x38a52c)[_0x2e0e('0x26')](function(_0x367164){_0x306bbc=_0x367164;return getUser(_0x38a52c,_0x56d77a[_0x2e0e('0x5f')],_0x306bbc);})['then'](function(_0x4f28ee){_0x369151=_0x4f28ee;return getEndUser(_0x38a52c,_0x12f2ae,_0x22c727[_0x2e0e('0x60')],_0x22c727['calleridnum'],_0x306bbc);})[_0x2e0e('0x26')](function(_0x271d19){_0x4144de=_0x271d19;return getTicket(_0x38a52c,_0x369151,_0x4144de,_0x12f2ae,_0x22c727,_0x12f2ae[_0x2e0e('0x61')],_0x306bbc,_0x2e0e('0x58'));})[_0x2e0e('0x26')](function(_0x5df7eb){_0x4748ac=_0x5df7eb;logger[_0x2e0e('0x1f')](_0x2e0e('0x62'),_0x4748ac['id']);logger[_0x2e0e('0x1f')](_0x2e0e('0x63'),_0x4748ac['id'],_0x56d77a[_0x2e0e('0x4f')],_0x38a52c[_0x2e0e('0x48')]);switch(_0x38a52c[_0x2e0e('0x48')]){case _0x2e0e('0x64'):emit(util[_0x2e0e('0x42')](_0x2e0e('0x65'),_0x56d77a['name']),_0x2e0e('0x66'),{'recordId':_0x4748ac['id']});break;case _0x2e0e('0x67'):emit(util[_0x2e0e('0x42')]('user:%s',_0x56d77a[_0x2e0e('0x4f')]),_0x2e0e('0x68'),{'uri':util[_0x2e0e('0x42')](_0x2e0e('0x69'),_0x306bbc[_0x2e0e('0x6a')],_0x4748ac['id'])});break;default:logger['error']('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x2e0e('0x6b')](function(_0x1b3844){logger[_0x2e0e('0x6c')](_0x2e0e('0x5b'),_0x1b3844);});};exports[_0x2e0e('0x6d')]=function(_0x1a3477,_0x4480fb,_0x51f52a,_0xc960fa,_0x28ae37,_0x224e01,_0xc499ef){var _0x3f02f4,_0x5c0d33,_0xfdd353,_0x1a6bc2;_0x224e01[_0x2e0e('0x5a')]=intUtil[_0x2e0e('0x59')](_0x224e01[_0x2e0e('0x5a')]);_0x224e01['remoteUri']=intUtil[_0x2e0e('0x59')](_0x224e01[_0x2e0e('0x52')]);if(_0xc499ef&&_0xc499ef['recordingFormat']&&_0xc499ef['recordingFormat']!==_0x2e0e('0x6e')){logger[_0x2e0e('0x1f')](_0x2e0e('0x6f'),'Recording\x20is\x20enabled!');_0x4480fb[_0x2e0e('0x5d')]=util[_0x2e0e('0x42')](_0x2e0e('0x70'),_0x224e01[_0x2e0e('0x5a')],_0x4480fb[_0x2e0e('0x5e')],md5(_0x4480fb[_0x2e0e('0x5e')]));}return getConnection(_0x224e01)[_0x2e0e('0x26')](function(_0x721bd0){_0x1a6bc2=_0x721bd0;return getUser(_0x224e01,_0xc960fa[_0x2e0e('0x5f')],_0x1a6bc2);})[_0x2e0e('0x26')](function(_0xb6b3cf){_0x3f02f4=_0xb6b3cf;return getEndUser(_0x224e01,_0x51f52a,_0x4480fb[_0x2e0e('0x71')],_0x4480fb[_0x2e0e('0x72')],_0x1a6bc2);})[_0x2e0e('0x26')](function(_0x5d836d){_0x5c0d33=_0x5d836d;return getTicket(_0x224e01,_0x3f02f4,_0x5c0d33,_0x51f52a,_0x4480fb,_0x51f52a['Fields'],_0x1a6bc2,_0x2e0e('0x6d'));})[_0x2e0e('0x26')](function(_0x58df77){_0xfdd353=_0x58df77;logger[_0x2e0e('0x1f')](_0x2e0e('0x73'),_0xfdd353['id']);logger[_0x2e0e('0x1f')](_0x2e0e('0x74'),_0xfdd353['id'],_0xc960fa[_0x2e0e('0x4f')],_0x224e01['type']);switch(_0x224e01['type']){case _0x2e0e('0x64'):emit(util['format']('user:%s',_0xc960fa[_0x2e0e('0x4f')]),_0x2e0e('0x66'),{'recordId':_0xfdd353['id']});break;case _0x2e0e('0x67'):emit(util[_0x2e0e('0x42')]('user:%s',_0xc960fa['name']),_0x2e0e('0x68'),{'uri':util[_0x2e0e('0x42')](_0x2e0e('0x69'),_0x1a6bc2[_0x2e0e('0x6a')],_0xfdd353['id'])});break;default:logger[_0x2e0e('0x6c')](_0x2e0e('0x6f'),_0x2e0e('0x75'));}})[_0x2e0e('0x6b')](function(_0xf1f9c6){logger[_0x2e0e('0x6c')](_0x2e0e('0x6f'),_0xf1f9c6);});};exports[_0x2e0e('0x76')]=function(_0x5371c4,_0x598267,_0x534627,_0x15d205,_0x57cc09,_0x592320){var _0x3f1796,_0x3b90c2,_0x57ac0a,_0x1c7e49;_0x592320[_0x2e0e('0x5a')]=intUtil['stripTrailingSlash'](_0x592320['serverUrl']);_0x592320['remoteUri']=intUtil['stripTrailingSlash'](_0x592320[_0x2e0e('0x52')]);if(_0x57cc09&&_0x57cc09[_0x2e0e('0x77')]){logger[_0x2e0e('0x1f')]('['+_0x598267['lastevent']['toUpperCase']()+']',_0x2e0e('0x5c'));_0x598267[_0x2e0e('0x5d')]=util[_0x2e0e('0x42')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x592320[_0x2e0e('0x5a')],_0x598267[_0x2e0e('0x5e')],md5(_0x598267[_0x2e0e('0x5e')]));}else{_0x598267[_0x2e0e('0x5d')]='';}return getConnection(_0x592320)[_0x2e0e('0x26')](function(_0x4698a1){_0x1c7e49=_0x4698a1;if(!_['isNil'](_0x15d205)){return getUser(_0x592320,_0x15d205[_0x2e0e('0x4f')],_0x1c7e49);}else{return getUser(_0x592320,null,_0x1c7e49);}})['then'](function(_0x2fbad0){_0x3f1796=_0x2fbad0;return getEndUser(_0x592320,_0x534627,_0x598267[_0x2e0e('0x60')],_0x598267[_0x2e0e('0x78')],_0x1c7e49);})['then'](function(_0x58a9e2){_0x3b90c2=_0x58a9e2;return getTicket(_0x592320,_0x3f1796,_0x3b90c2,_0x534627,_0x598267,_0x534627[_0x2e0e('0x61')],_0x1c7e49);})[_0x2e0e('0x26')](function(_0xa3e76b){_0x57ac0a=_0xa3e76b;logger['info']('['+_0x598267[_0x2e0e('0x79')]['toUpperCase']()+_0x2e0e('0x7a'),_0x57ac0a['id']);logger[_0x2e0e('0x1f')]('['+_0x598267[_0x2e0e('0x79')][_0x2e0e('0x7b')]()+_0x2e0e('0x7c'),_0x592320[_0x2e0e('0x48')]);})[_0x2e0e('0x6b')](function(_0x2f8331){logger[_0x2e0e('0x6c')]('['+_0x598267['lastevent'][_0x2e0e('0x7b')]()+']',_0x2f8331);});}; \ No newline at end of file +var _0xe032=['getString','Subjects','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','lead','account','WhatId','Case','contact','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','execute','find','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','resolve','display_name','then','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','additionalSearchContact','merge','$or','Contact','length','cloneDeep','additionalSearchLead','Lead','account_contact_lead','Account','additionalSearchAccount','first','Phone','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','','format','Caller\x20-\x20%s','LastName','Company','No\x20Company','upperFirst','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientSecret','login','Connection\x20established.','queue','serverUrl','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','[OUTBOUND]','destcalleridname','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','monitor_format','lastevent','toUpperCase','Recording\x20is\x20enabled!',']\x20Ticket\x20%s\x20created.','lodash','moment','bluebird','md5','jsforce','./util','../../../../config/environment','../../../../config/logger','salesforce','defaults','redis','localhost','socket.io-emitter','emit','assign'];(function(_0x3d6b40,_0xcc75c8){var _0x1ea187=function(_0x424d21){while(--_0x424d21){_0x3d6b40['push'](_0x3d6b40['shift']());}};_0x1ea187(++_0xcc75c8);}(_0xe032,0x73));var _0x2e03=function(_0x4cfa2e,_0x5752b5){_0x4cfa2e=_0x4cfa2e-0x0;var _0x279b50=_0xe032[_0x4cfa2e];return _0x279b50;};'use strict';var _=require(_0x2e03('0x0'));var rp=require('request-promise');var moment=require(_0x2e03('0x1'));var BPromise=require(_0x2e03('0x2'));var md5=require(_0x2e03('0x3'));var jsforce=require(_0x2e03('0x4'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x2e03('0x5'));var config=require(_0x2e03('0x6'));var logger=require(_0x2e03('0x7'))(_0x2e03('0x8'));config['redis']=_[_0x2e03('0x9')](config[_0x2e03('0xa')],{'host':_0x2e03('0xb'),'port':0x18eb});var io=require(_0x2e03('0xc'))(new Redis(config[_0x2e03('0xa')]));function emit(_0x3355e1,_0x17ba25,_0x4c2ee9){io['to'](_0x3355e1)[_0x2e03('0xd')](_0x17ba25,_0x4c2ee9);}function getTicket(_0x45bc9c,_0x4d78c1,_0x11c0f4,_0x3508c0,_0x23a13e,_0x4a0269,_0x1d49b9,_0xc6f4ac){var _0x2f4d09=Object[_0x2e03('0xe')]({},{'OwnerId':_0x4d78c1['id'],'Subject':intUtil[_0x2e03('0xf')](_0x3508c0[_0x2e03('0x10')],_0x23a13e,'\x20'),'Description':intUtil[_0x2e03('0xf')](_0x3508c0[_0x2e03('0x11')],_0x23a13e,'\x0a')},getCustomFields(_0x4a0269,_0x23a13e));if(_0x11c0f4){if(_0x3508c0[_0x2e03('0x12')]===_0x2e03('0x13')){_0x2f4d09[_0x2e03('0x14')]=moment[_0x2e03('0x15')]();_0x2f4d09[_0x2e03('0x16')]=![];_0x2f4d09[_0x2e03('0x17')]=![];if(_0x11c0f4[_0x2e03('0x18')]==='contact'||_0x11c0f4[_0x2e03('0x18')]===_0x2e03('0x19')){_0x2f4d09['WhoId']=_0x11c0f4['id'];}else if(_0x11c0f4[_0x2e03('0x18')]===_0x2e03('0x1a')){_0x2f4d09[_0x2e03('0x1b')]=_0x11c0f4['id'];}}else if(_0x3508c0['ticketType']===_0x2e03('0x1c')){if(_0x11c0f4[_0x2e03('0x18')]===_0x2e03('0x1d')){_0x2f4d09[_0x2e03('0x1e')]=_0x11c0f4['id'];}else if(_0x11c0f4[_0x2e03('0x18')]===_0x2e03('0x1a')){_0x2f4d09[_0x2e03('0x1f')]=_0x11c0f4['id'];}else if(_0x11c0f4[_0x2e03('0x18')]==='lead'&&_0x3508c0[_0x2e03('0x20')]){_0x2f4d09[_0x3508c0[_0x2e03('0x20')]]=_0x11c0f4['id'];}else{logger[_0x2e03('0x21')](_0x2e03('0x22'));}}}return _0x1d49b9[_0x2e03('0x23')](_0x3508c0['ticketType'])[_0x2e03('0x24')](_0x2f4d09);}function getUser(_0x4f0ea3,_0x29b0a8,_0x1a40bf){if(!_[_0x2e03('0x25')](_0x29b0a8)&&intUtil[_0x2e03('0x26')](_0x29b0a8)){var _0x204674={'Email':_0x29b0a8};var _0x5033e3={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x1a40bf[_0x2e03('0x23')](_0x2e03('0x27'))['find'](_0x204674,_0x5033e3)[_0x2e03('0x28')]()['then'](function(_0x24437b){if(_0x24437b['length']){var _0x1d852e=_[_0x2e03('0x29')](_0x24437b,function(_0x4492ae){return _0x4492ae['Email']===_0x29b0a8;});if(_0x1d852e){logger['info']('Agent\x20%s\x20found.',_0x29b0a8);return BPromise['resolve']({'id':_0x1d852e['Id'],'name':_0x1d852e[_0x2e03('0x2a')]});}}else{logger[_0x2e03('0x21')](_0x2e03('0x2b'),_0x29b0a8);return _0x1a40bf[_0x2e03('0x2c')]()['then'](function(_0x191b86){return BPromise[_0x2e03('0x2d')]({'id':_0x191b86['user_id'],'name':_0x191b86[_0x2e03('0x2e')]});});}});}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x29b0a8);return _0x1a40bf[_0x2e03('0x2c')]()[_0x2e03('0x2f')](function(_0x479906){return BPromise[_0x2e03('0x2d')]({'id':_0x479906['user_id'],'name':_0x479906[_0x2e03('0x2e')]});});}}function getEndUser(_0x1e7957,_0x1a9261,_0x4f3d21,_0x48dda4,_0x143e60){var _0x43621f={'$or':{'Phone':_0x48dda4}};var _0x8a6f83={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x2e03('0x2d')]()[_0x2e03('0x2f')](function(){logger['info'](_0x2e03('0x30'),_0x48dda4,_0x1a9261[_0x2e03('0x31')]);switch(_0x1a9261[_0x2e03('0x31')]){case _0x2e03('0x32'):var _0x5d212e=_['cloneDeep'](_0x43621f);if(_0x1a9261[_0x2e03('0x33')]){var _0x52462a={};_0x52462a[_0x1a9261['additionalSearchContact']]=_0x48dda4;_[_0x2e03('0x34')](_0x5d212e[_0x2e03('0x35')],_0x52462a);}return _0x143e60['sobject'](_0x2e03('0x36'))[_0x2e03('0x29')](_0x5d212e,_0x8a6f83)[_0x2e03('0x28')]()[_0x2e03('0x2f')](function(_0xa131e4){if(_0xa131e4&&_0xa131e4[_0x2e03('0x37')]){return _0xa131e4;}else{var _0x23ea11=_[_0x2e03('0x38')](_0x43621f);if(_0x1a9261[_0x2e03('0x39')]){var _0x16d337={};_0x16d337[_0x1a9261[_0x2e03('0x39')]]=_0x48dda4;_['merge'](_0x23ea11[_0x2e03('0x35')],_0x16d337);}return _0x143e60['sobject'](_0x2e03('0x3a'))[_0x2e03('0x29')](_0x23ea11,_0x8a6f83);}});case _0x2e03('0x3b'):var _0x387ae0=_['cloneDeep'](_0x43621f);if(_0x1a9261['additionalSearchAccount']){var _0x52462a={};_0x52462a[_0x1a9261['additionalSearchAccount']]=_0x48dda4;_[_0x2e03('0x34')](_0x387ae0[_0x2e03('0x35')],_0x52462a);}return _0x143e60[_0x2e03('0x23')](_0x2e03('0x3c'))[_0x2e03('0x29')](_0x387ae0,_0x8a6f83)[_0x2e03('0x28')]()[_0x2e03('0x2f')](function(_0x4fade1){if(_0x4fade1&&_0x4fade1[_0x2e03('0x37')]){return _0x4fade1;}else{var _0x56d321=_[_0x2e03('0x38')](_0x43621f);if(_0x1a9261[_0x2e03('0x33')]){var _0x2346b3={};_0x2346b3[_0x1a9261[_0x2e03('0x33')]]=_0x48dda4;_['merge'](_0x56d321[_0x2e03('0x35')],_0x2346b3);}return _0x143e60[_0x2e03('0x23')]('Contact')[_0x2e03('0x29')](_0x56d321,_0x8a6f83)[_0x2e03('0x2f')](function(_0x58bd68){if(_0x58bd68&&_0x58bd68[_0x2e03('0x37')]){return _0x58bd68;}else{var _0x424ab4=_[_0x2e03('0x38')](_0x43621f);if(_0x1a9261[_0x2e03('0x39')]){var _0x3ce057={};_0x3ce057[_0x1a9261[_0x2e03('0x39')]]=_0x48dda4;_[_0x2e03('0x34')](_0x424ab4[_0x2e03('0x35')],_0x3ce057);}return _0x143e60[_0x2e03('0x23')]('Lead')[_0x2e03('0x29')](_0x424ab4,_0x8a6f83);}});}});case'contact':var _0x5d212e=_[_0x2e03('0x38')](_0x43621f);if(_0x1a9261[_0x2e03('0x33')]){var _0x52462a={};_0x52462a[_0x1a9261[_0x2e03('0x33')]]=_0x48dda4;_[_0x2e03('0x34')](_0x5d212e[_0x2e03('0x35')],_0x52462a);}return _0x143e60[_0x2e03('0x23')](_0x2e03('0x36'))[_0x2e03('0x29')](_0x5d212e,_0x8a6f83)[_0x2e03('0x28')]();case _0x2e03('0x19'):var _0x25277a=_[_0x2e03('0x38')](_0x43621f);if(_0x1a9261[_0x2e03('0x39')]){var _0x52462a={};_0x52462a[_0x1a9261[_0x2e03('0x39')]]=_0x48dda4;_[_0x2e03('0x34')](_0x25277a[_0x2e03('0x35')],_0x52462a);}return _0x143e60[_0x2e03('0x23')](_0x2e03('0x3a'))[_0x2e03('0x29')](_0x25277a,_0x8a6f83);case _0x2e03('0x1a'):var _0x387ae0=_[_0x2e03('0x38')](_0x43621f);if(_0x1a9261[_0x2e03('0x3d')]){var _0x52462a={};_0x52462a[_0x1a9261['additionalSearchAccount']]=_0x48dda4;_[_0x2e03('0x34')](_0x387ae0[_0x2e03('0x35')],_0x52462a);}return _0x143e60[_0x2e03('0x23')](_0x2e03('0x3c'))['find'](_0x387ae0,_0x8a6f83);default:return null;}})['then'](function(_0x10a202){if(_0x10a202&&_0x10a202[_0x2e03('0x37')]){var _0x501f5d=_[_0x2e03('0x3e')](_0x10a202);if(_0x501f5d){return BPromise[_0x2e03('0x2d')]({'id':_0x501f5d['Id'],'name':_0x501f5d['Name'],'phone':_0x501f5d[_0x2e03('0x3f')],'endUserType':_0x501f5d['attributes'][_0x2e03('0x40')][_0x2e03('0x41')]()});}}})['then'](function(_0xdf9bcd){if(_0xdf9bcd){logger[_0x2e03('0x21')](_0x2e03('0x42'),_0xdf9bcd[_0x2e03('0x18')],_0x48dda4);return BPromise[_0x2e03('0x2d')](_0xdf9bcd);}else{logger[_0x2e03('0x21')](_0x2e03('0x43'),_0x48dda4);var _0x176297={'Phone':_0x48dda4};if(_0x1a9261['moduleCreate']){if(_0x1a9261[_0x2e03('0x44')]==='contact'){logger[_0x2e03('0x21')](_0x2e03('0x45'),_0x48dda4,_0x1a9261['moduleCreate']);_0x176297['LastName']=_0x4f3d21!==_0x2e03('0x46')?_0x4f3d21:util[_0x2e03('0x47')](_0x2e03('0x48'),_0x48dda4);}else if(_0x1a9261[_0x2e03('0x44')]===_0x2e03('0x19')){logger['info'](_0x2e03('0x45'),_0x48dda4,_0x1a9261[_0x2e03('0x44')]);_0x176297[_0x2e03('0x49')]=_0x4f3d21!==_0x2e03('0x46')?_0x4f3d21:util[_0x2e03('0x47')](_0x2e03('0x48'),_0x48dda4);_0x176297[_0x2e03('0x4a')]=_0x2e03('0x4b');}else if(_0x1a9261[_0x2e03('0x44')]===_0x2e03('0x1a')){logger[_0x2e03('0x21')](_0x2e03('0x45'),_0x48dda4,_0x1a9261[_0x2e03('0x44')]);_0x176297[_0x2e03('0x2a')]=_0x4f3d21!==_0x2e03('0x46')?_0x4f3d21:util[_0x2e03('0x47')](_0x2e03('0x48'),_0x48dda4);}else{return null;}}return _0x143e60[_0x2e03('0x23')](_[_0x2e03('0x4c')](_0x1a9261['moduleCreate']))[_0x2e03('0x24')](_0x176297)['then'](function(_0x215190){return BPromise[_0x2e03('0x2d')]({'id':_0x215190['id'],'endUserType':_0x1a9261[_0x2e03('0x44')]});});}});}function getCustomFields(_0x335c4d,_0x5a807b){var _0x2d4f00={};if(_0x335c4d[_0x2e03('0x37')]>0x0){_['forEach'](_0x335c4d,function(_0x5c6102){if(_['includes'](['string',_0x2e03('0x4d')],_0x5c6102[_0x2e03('0x40')])&&_0x5c6102['idField']){_0x2d4f00[_0x5c6102[_0x2e03('0x4e')]]=_0x5c6102[_0x2e03('0x4f')][_0x2e03('0x50')]();}else if(_0x5c6102[_0x2e03('0x40')]===_0x2e03('0x51')&&_0x5c6102[_0x2e03('0x52')]&&_0x5c6102[_0x2e03('0x4e')]){_0x5a807b[_0x5c6102[_0x2e03('0x52')]]&&(_0x2d4f00[_0x5c6102['idField']]=_0x5a807b[_0x5c6102[_0x2e03('0x52')]]['toString']());}else if(_0x5c6102[_0x2e03('0x40')]===_0x2e03('0x53')&&_0x5c6102['Variable']&&_0x5c6102[_0x2e03('0x54')]['name']&&_0x5c6102['idField']){_0x5a807b[_0x5c6102[_0x2e03('0x54')][_0x2e03('0x55')][_0x2e03('0x41')]()]&&(_0x2d4f00[_0x5c6102[_0x2e03('0x4e')]]=_0x5a807b[_0x5c6102[_0x2e03('0x54')][_0x2e03('0x55')][_0x2e03('0x41')]()][_0x2e03('0x50')]());}});}return _0x2d4f00;}function getConnection(_0x431687){var _0x40af00=_0x431687[_0x2e03('0x56')][_0x2e03('0x57')](_0x431687[_0x2e03('0x58')]);var _0x34eceb=new jsforce[(_0x2e03('0x59'))]({'oauth2':{'loginUrl':_0x431687[_0x2e03('0x5a')]||_0x2e03('0x5b'),'clientId':_0x431687['clientId'],'clientSecret':_0x431687[_0x2e03('0x5c')]}});return _0x34eceb[_0x2e03('0x5d')](_0x431687['username'],_0x40af00)['then'](function(){logger[_0x2e03('0x21')](_0x2e03('0x5e'));return _0x34eceb;});}exports[_0x2e03('0x5f')]=function(_0xa0733,_0x2d21ea,_0x1cec54,_0x1e1bc6,_0x333e7b,_0x122699){var _0x5db02c,_0x15d77b,_0x5ce0d4,_0x490645;_0x122699[_0x2e03('0x60')]=intUtil[_0x2e03('0x61')](_0x122699[_0x2e03('0x60')]);_0x122699['remoteUri']=intUtil[_0x2e03('0x61')](_0x122699[_0x2e03('0x5a')]);if(_0x333e7b&&_0x333e7b['monitor_format']){logger[_0x2e03('0x21')](_0x2e03('0x62'),'Recording\x20is\x20enabled!');_0x2d21ea[_0x2e03('0x63')]=util['format'](_0x2e03('0x64'),_0x122699['serverUrl'],_0x2d21ea[_0x2e03('0x65')],md5(_0x2d21ea[_0x2e03('0x65')]));}else{_0x2d21ea[_0x2e03('0x63')]='';}return getConnection(_0x122699)['then'](function(_0x32e5cb){_0x490645=_0x32e5cb;return getUser(_0x122699,_0x1e1bc6[_0x2e03('0x66')],_0x490645);})[_0x2e03('0x2f')](function(_0x4e3d5d){_0x5db02c=_0x4e3d5d;return getEndUser(_0x122699,_0x1cec54,_0x2d21ea[_0x2e03('0x67')],_0x2d21ea[_0x2e03('0x68')],_0x490645);})[_0x2e03('0x2f')](function(_0x18e12e){_0x15d77b=_0x18e12e;return getTicket(_0x122699,_0x5db02c,_0x15d77b,_0x1cec54,_0x2d21ea,_0x1cec54[_0x2e03('0x69')],_0x490645,_0x2e03('0x5f'));})[_0x2e03('0x2f')](function(_0x14ec5f){_0x5ce0d4=_0x14ec5f;logger[_0x2e03('0x21')](_0x2e03('0x6a'),_0x5ce0d4['id']);logger[_0x2e03('0x21')](_0x2e03('0x6b'),_0x5ce0d4['id'],_0x1e1bc6[_0x2e03('0x55')],_0x122699['type']);switch(_0x122699[_0x2e03('0x40')]){case'integrationTab':emit(util['format'](_0x2e03('0x6c'),_0x1e1bc6[_0x2e03('0x55')]),_0x2e03('0x6d'),{'recordId':_0x5ce0d4['id']});break;case _0x2e03('0x6e'):emit(util[_0x2e03('0x47')]('user:%s',_0x1e1bc6[_0x2e03('0x55')]),_0x2e03('0x6f'),{'uri':util[_0x2e03('0x47')](_0x2e03('0x70'),_0x490645[_0x2e03('0x71')],_0x5ce0d4['id'])});break;default:logger[_0x2e03('0x72')](_0x2e03('0x73'));}})[_0x2e03('0x74')](function(_0x3a11f7){logger[_0x2e03('0x72')](_0x2e03('0x62'),_0x3a11f7);});};exports[_0x2e03('0x75')]=function(_0x2b5e52,_0x13ab81,_0x4e26e6,_0x433b22,_0xdc9bcf,_0xb19fd7,_0x14d143){var _0x5d1891,_0x3f2a31,_0x4cc149,_0x4967b0;_0xb19fd7[_0x2e03('0x60')]=intUtil[_0x2e03('0x61')](_0xb19fd7[_0x2e03('0x60')]);_0xb19fd7[_0x2e03('0x5a')]=intUtil[_0x2e03('0x61')](_0xb19fd7['remoteUri']);if(_0x14d143&&_0x14d143[_0x2e03('0x76')]&&_0x14d143['recordingFormat']!=='none'){logger[_0x2e03('0x21')](_0x2e03('0x77'),'Recording\x20is\x20enabled!');_0x13ab81[_0x2e03('0x63')]=util[_0x2e03('0x47')](_0x2e03('0x64'),_0xb19fd7['serverUrl'],_0x13ab81[_0x2e03('0x65')],md5(_0x13ab81[_0x2e03('0x65')]));}return getConnection(_0xb19fd7)['then'](function(_0x37d436){_0x4967b0=_0x37d436;return getUser(_0xb19fd7,_0x433b22[_0x2e03('0x66')],_0x4967b0);})[_0x2e03('0x2f')](function(_0x1e3c17){_0x5d1891=_0x1e3c17;return getEndUser(_0xb19fd7,_0x4e26e6,_0x13ab81[_0x2e03('0x78')],_0x13ab81['destcalleridnum'],_0x4967b0);})[_0x2e03('0x2f')](function(_0x3052f6){_0x3f2a31=_0x3052f6;return getTicket(_0xb19fd7,_0x5d1891,_0x3f2a31,_0x4e26e6,_0x13ab81,_0x4e26e6[_0x2e03('0x69')],_0x4967b0,'outbound');})[_0x2e03('0x2f')](function(_0x3f2852){_0x4cc149=_0x3f2852;logger[_0x2e03('0x21')](_0x2e03('0x79'),_0x4cc149['id']);logger[_0x2e03('0x21')](_0x2e03('0x7a'),_0x4cc149['id'],_0x433b22[_0x2e03('0x55')],_0xb19fd7[_0x2e03('0x40')]);switch(_0xb19fd7[_0x2e03('0x40')]){case'integrationTab':emit(util[_0x2e03('0x47')](_0x2e03('0x6c'),_0x433b22['name']),_0x2e03('0x6d'),{'recordId':_0x4cc149['id']});break;case'newTab':emit(util[_0x2e03('0x47')](_0x2e03('0x6c'),_0x433b22['name']),_0x2e03('0x6f'),{'uri':util[_0x2e03('0x47')](_0x2e03('0x70'),_0x4967b0[_0x2e03('0x71')],_0x4cc149['id'])});break;default:logger[_0x2e03('0x72')](_0x2e03('0x77'),_0x2e03('0x7b'));}})['catch'](function(_0x53a578){logger[_0x2e03('0x72')](_0x2e03('0x77'),_0x53a578);});};exports[_0x2e03('0x7c')]=function(_0xa24c86,_0x475225,_0x1f0d65,_0x502298,_0x359f03,_0x137ebf){var _0x150f27,_0x474808,_0x28bcbe,_0xaddf32;_0x137ebf['serverUrl']=intUtil[_0x2e03('0x61')](_0x137ebf[_0x2e03('0x60')]);_0x137ebf[_0x2e03('0x5a')]=intUtil[_0x2e03('0x61')](_0x137ebf[_0x2e03('0x5a')]);if(_0x359f03&&_0x359f03[_0x2e03('0x7d')]){logger[_0x2e03('0x21')]('['+_0x475225[_0x2e03('0x7e')][_0x2e03('0x7f')]()+']',_0x2e03('0x80'));_0x475225['recordingURL']=util[_0x2e03('0x47')](_0x2e03('0x64'),_0x137ebf['serverUrl'],_0x475225[_0x2e03('0x65')],md5(_0x475225[_0x2e03('0x65')]));}else{_0x475225[_0x2e03('0x63')]='';}return getConnection(_0x137ebf)[_0x2e03('0x2f')](function(_0x32fa30){_0xaddf32=_0x32fa30;if(!_['isNil'](_0x502298)){return getUser(_0x137ebf,_0x502298[_0x2e03('0x55')],_0xaddf32);}else{return getUser(_0x137ebf,null,_0xaddf32);}})[_0x2e03('0x2f')](function(_0x56d3c9){_0x150f27=_0x56d3c9;return getEndUser(_0x137ebf,_0x1f0d65,_0x475225[_0x2e03('0x67')],_0x475225[_0x2e03('0x68')],_0xaddf32);})[_0x2e03('0x2f')](function(_0x25347e){_0x474808=_0x25347e;return getTicket(_0x137ebf,_0x150f27,_0x474808,_0x1f0d65,_0x475225,_0x1f0d65[_0x2e03('0x69')],_0xaddf32);})[_0x2e03('0x2f')](function(_0xddc28f){_0x28bcbe=_0xddc28f;logger['info']('['+_0x475225[_0x2e03('0x7e')][_0x2e03('0x7f')]()+_0x2e03('0x81'),_0x28bcbe['id']);logger[_0x2e03('0x21')]('['+_0x475225[_0x2e03('0x7e')][_0x2e03('0x7f')]()+']\x20Integration\x20account\x20type\x20%s.',_0x137ebf[_0x2e03('0x40')]);})[_0x2e03('0x74')](function(_0x3998bd){logger[_0x2e03('0x72')]('['+_0x475225['lastevent']['toUpperCase']()+']',_0x3998bd);});}; \ 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 b74afaa..47b142d 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 _0x3400=['callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','result','length','adminId','sys_id','toUpperCase','catch','error','message','info','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20entity','active','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','true','System','then','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','string','picklist','type','nameField','toLowerCase','content','includes','customField','idField','variable','variableName','toString','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','Subjects','getString','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber','number','label','?sysparm_query=name%3D','label_entry','ticketId','Incident\x20-\x20','forEach','push','all','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum'];(function(_0x12fa39,_0x3180ed){var _0x4c7029=function(_0x2771de){while(--_0x2771de){_0x12fa39['push'](_0x12fa39['shift']());}};_0x4c7029(++_0x3180ed);}(_0x3400,0xeb));var _0x0340=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x3400[_0x273c39];return _0x46d6b5;};'use strict';var _=require('lodash');var Promise=require(_0x0340('0x0'));var rp=require('request-promise');var util=require(_0x0340('0x1'));var md5=require('md5');var Redis=require(_0x0340('0x2'));var intUtil=require(_0x0340('0x3'));var config=require(_0x0340('0x4'));var logger=require(_0x0340('0x5'))(_0x0340('0x6'));config[_0x0340('0x7')]=_[_0x0340('0x8')](config['redis'],{'host':_0x0340('0x9'),'port':0x18eb});var io=require(_0x0340('0xa'))(new Redis(config[_0x0340('0x7')]));function getAdminUser(_0x29cd8c,_0x15c9ed,_0x37a11d,_0x4d0e46,_0x169e74,_0x393266){return new Promise(function(_0x399e6c,_0x376dfa){var _0x497c75={'method':_0x0340('0xb'),'uri':_0x4d0e46+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x169e74+'&'+_0x393266,'auth':_0x15c9ed,'json':!![]};return rp(_0x497c75)['then'](function(_0x210c7c){if(_0x210c7c[_0x0340('0xc')][_0x0340('0xd')]>0x0){_0x37a11d[_0x0340('0xe')]=_0x210c7c[_0x0340('0xc')][0x0][_0x0340('0xf')];}logger['info']('['+[_0x29cd8c[_0x0340('0x10')]()]+'],\x20getAdminUser\x20crm',_0x37a11d);_0x399e6c(_0x37a11d);})[_0x0340('0x11')](function(_0x4f9baf){logger[_0x0340('0x12')]('['+[_0x29cd8c[_0x0340('0x10')]()]+']',_0x4f9baf[_0x0340('0x13')]);_0x376dfa(_0x4f9baf[_0x0340('0x13')]);});});}function getUser(_0x983efe,_0x54598e,_0x596ef1,_0x40400f,_0xa8628a){return function(_0x41fed1){logger[_0x0340('0x14')]('['+[_0x983efe[_0x0340('0x10')]()]+_0x0340('0x15'),_0x41fed1);return new Promise(function(_0x3a67dd,_0x2172b6){if(intUtil[_0x0340('0x16')](_0x41fed1[_0x0340('0x17')])){var _0x3b09b8={'method':_0x0340('0xb'),'uri':_0x596ef1+_0x0340('0x18')+_0x41fed1[_0x0340('0x17')]+'&'+_0x40400f+'&'+_0xa8628a,'auth':_0x54598e,'json':!![]};logger[_0x0340('0x14')]('['+[_0x983efe[_0x0340('0x10')]()]+'],\x20getUser\x20rp\x20obj',_0x3b09b8);return rp(_0x3b09b8)['then'](function(_0x1d985a){logger['info']('['+[_0x983efe[_0x0340('0x10')]()]+_0x0340('0x19'),_0x1d985a);if(_0x1d985a[_0x0340('0xc')][_0x0340('0xd')]>0x0&&String(_0x1d985a[_0x0340('0xc')][0x0][_0x0340('0x1a')])==='true'){_0x41fed1[_0x0340('0x1b')]=_0x1d985a[_0x0340('0xc')][0x0]['sys_id'];}else{_0x41fed1['userId']=_0x41fed1[_0x0340('0xe')];_0x41fed1[_0x0340('0x17')]=_0x41fed1[_0x0340('0x1c')];}logger[_0x0340('0x14')]('['+[_0x983efe[_0x0340('0x10')]()]+_0x0340('0x1d'),_0x41fed1);_0x3a67dd(_0x41fed1);})[_0x0340('0x11')](function(_0x3c8f1d){logger[_0x0340('0x12')]('['+[_0x983efe[_0x0340('0x10')]()]+']',_0x3c8f1d[_0x0340('0x13')]);_0x2172b6(_0x3c8f1d['message']);});}else{logger['info']('['+[_0x983efe['toUpperCase']()]+_0x0340('0x1e'));_0x41fed1[_0x0340('0x1b')]=_0x41fed1[_0x0340('0xe')];_0x41fed1[_0x0340('0x17')]=_0x41fed1[_0x0340('0x1c')];_0x3a67dd(_0x41fed1);}});};}function createEndUser(_0x2f1f2c,_0x76eb09,_0x3f67be,_0x4ab30c,_0x1aceca){logger[_0x0340('0x14')]('['+[_0x2f1f2c[_0x0340('0x10')]()]+_0x0340('0x1f'),_0x3f67be);return new Promise(function(_0x280d7e,_0x9a3a90){var _0xcec509={'method':_0x0340('0x20'),'uri':_0x4ab30c+_0x0340('0x21')+_0x1aceca,'body':{'user_name':_0x3f67be[_0x0340('0x22')],'roles':'user','first_name':_0x3f67be[_0x0340('0x22')],'active':_0x0340('0x23'),'date_format':_0x0340('0x24'),'phone':_0x3f67be[_0x0340('0x22')]},'auth':_0x76eb09,'json':!![]};return rp(_0xcec509)[_0x0340('0x25')](function(_0x1aff96){logger[_0x0340('0x14')]('['+[_0x2f1f2c[_0x0340('0x10')]()]+_0x0340('0x26'),_0x1aff96[_0x0340('0xc')]);_0x3f67be[_0x0340('0x27')]=_0x1aff96[_0x0340('0xc')]['sys_id'];_0x280d7e(_0x3f67be);})[_0x0340('0x11')](function(_0x1aaae7){logger[_0x0340('0x12')]('['+[_0x2f1f2c[_0x0340('0x10')]()]+']',_0x1aaae7['message']);_0x9a3a90(_0x1aaae7[_0x0340('0x13')]);});});}function getEndUser(_0x2d3d60,_0x2d609c,_0x3d8856,_0x37ea5f,_0x416c38){return function(_0x160f99){logger[_0x0340('0x14')]('['+[_0x2d3d60[_0x0340('0x10')]()]+_0x0340('0x28'),_0x160f99);return new Promise(function(_0x1865e9,_0x3fbbea){var _0x4b60dd={'method':_0x0340('0xb'),'uri':_0x3d8856+'sys_user?sysparm_query=phone%3D'+_0x160f99[_0x0340('0x22')]+'&'+_0x37ea5f+'&'+_0x416c38,'auth':_0x2d609c,'json':!![]};return rp(_0x4b60dd)[_0x0340('0x25')](function(_0x2283db){if(_0x2283db[_0x0340('0xc')]['length']>0x0){_0x160f99[_0x0340('0x27')]=_0x2283db[_0x0340('0xc')][0x0]['sys_id'];logger['info']('['+[_0x2d3d60['toUpperCase']()]+_0x0340('0x29'),_0x160f99);_0x1865e9(_0x160f99);}else{return createEndUser(_0x2d3d60,_0x2d609c,_0x160f99,_0x3d8856,_0x37ea5f)[_0x0340('0x25')](function(_0x2728c7){logger[_0x0340('0x14')]('['+[_0x2d3d60['toUpperCase']()]+_0x0340('0x2a'),_0x2728c7);_0x1865e9(_0x2728c7);});}})[_0x0340('0x11')](function(_0xc97e8){logger[_0x0340('0x12')]('['+[_0x2d3d60[_0x0340('0x10')]()]+']',_0xc97e8[_0x0340('0x13')]);_0x3fbbea(_0xc97e8['message']);});});};}function getCustomFields(_0x306607,_0x48a9ac){var _0x127144={};if(_0x306607[_0x0340('0xd')]>0x0){_['forEach'](_0x306607,function(_0x12d3e8){if(_['includes']([_0x0340('0x2b'),_0x0340('0x2c')],_0x12d3e8[_0x0340('0x2d')])&&_0x12d3e8[_0x0340('0x2e')]&&!_0x12d3e8['customField']){_0x127144[_0x12d3e8['nameField'][_0x0340('0x2f')]()]=_0x12d3e8[_0x0340('0x30')]['toString']();}else if(_[_0x0340('0x31')]([_0x0340('0x2b'),_0x0340('0x2c')],_0x12d3e8[_0x0340('0x2d')])&&_0x12d3e8['idField']&&_0x12d3e8[_0x0340('0x32')]){_0x127144[_0x12d3e8[_0x0340('0x33')][_0x0340('0x2f')]()]=_0x12d3e8[_0x0340('0x30')]['toString']();}else if(_0x12d3e8[_0x0340('0x2d')]===_0x0340('0x34')&&_0x12d3e8[_0x0340('0x35')]&&_0x12d3e8[_0x0340('0x33')]&&_0x12d3e8[_0x0340('0x32')]){_0x127144[_0x12d3e8[_0x0340('0x33')][_0x0340('0x2f')]()]=_0x48a9ac[_0x12d3e8['variableName']][_0x0340('0x36')]();}else if(_0x12d3e8[_0x0340('0x2d')]===_0x0340('0x37')&&_0x12d3e8[_0x0340('0x38')]&&_0x12d3e8[_0x0340('0x38')][_0x0340('0x39')]&&_0x12d3e8['idField']&&_0x12d3e8[_0x0340('0x32')]){_0x127144[_0x12d3e8[_0x0340('0x33')][_0x0340('0x2f')]()]=_0x48a9ac[_0x12d3e8[_0x0340('0x38')]['name'][_0x0340('0x2f')]()][_0x0340('0x36')]();}});}return _0x127144;}function getTicket(_0x24327e,_0x5d9b8a,_0x5e820a,_0x1397ae,_0x425d9e,_0x5a4817){return function(_0x747bad){logger['info']('['+[_0x24327e[_0x0340('0x10')]()]+_0x0340('0x3a'),_0x747bad);return new Promise(function(_0x5f599f,_0x1b0c37){var _0x14400e=_0x24327e['toLowerCase']()===_0x0340('0x3b')?_0x747bad[_0x0340('0x1b')]:_0x747bad[_0x0340('0x27')];var _0x338afd={'method':_0x0340('0x20'),'uri':_0x5e820a+_0x0340('0x3c')+'?'+_0x5a4817,'body':Object[_0x0340('0x3d')]({},{'active':_0x0340('0x23'),'caller_id':_0x14400e,'assigned_to':_0x747bad[_0x0340('0x1b')],'short_description':intUtil['getString'](_0x1397ae[_0x0340('0x3e')],_0x425d9e,'\x20'),'description':intUtil[_0x0340('0x3f')](_0x1397ae['Descriptions'],_0x425d9e,'\x0a')},getCustomFields(_0x1397ae[_0x0340('0x40')],_0x425d9e)),'auth':_0x5d9b8a,'json':!![]};return rp(_0x338afd)['then'](function(_0x2653f2){logger['info']('['+[_0x24327e[_0x0340('0x10')]()]+_0x0340('0x41'),_0x2653f2['result']);_0x747bad['ticketId']=_0x2653f2[_0x0340('0xc')][_0x0340('0xf')];_0x747bad[_0x0340('0x42')]=_0x2653f2[_0x0340('0xc')][_0x0340('0x43')];logger[_0x0340('0x14')]('['+[_0x24327e[_0x0340('0x10')]()]+']\x20getTicket\x20crm',_0x747bad);_0x5f599f(_0x747bad);})[_0x0340('0x11')](function(_0x3a7f85){logger[_0x0340('0x12')]('['+[_0x24327e['toUpperCase']()]+']',_0x3a7f85[_0x0340('0x13')]);_0x1b0c37(_0x3a7f85[_0x0340('0x13')]);});});};}function createRemoteTag(_0x3f49cb,_0x2b419f,_0x2383b0,_0x2411ab){return new Promise(function(_0x59fd32,_0xbc6385){var _0x9a6d5a={'method':'POST','uri':_0x2383b0+_0x0340('0x44')+'?'+_0x2411ab,'body':{'short_description':_0x3f49cb,'global':!![],'active':!![],'name':_0x3f49cb},'auth':_0x2b419f,'json':!![]};return rp(_0x9a6d5a)[_0x0340('0x25')](function(_0x368b07){var _0x1c36a3=_0x368b07[_0x0340('0xc')][_0x0340('0xf')];_0x59fd32(_0x1c36a3);});});}function getRemoteTag(_0x3f138c,_0x377096,_0x5b93b2,_0x4e4079,_0x1c4364){return new Promise(function(_0x4c3be3,_0x4fdca5){var _0x8bd852={'method':'GET','uri':_0x5b93b2+_0x0340('0x44')+_0x0340('0x45')+_0x3f138c+'&'+_0x4e4079,'auth':_0x377096,'json':!![]};return rp(_0x8bd852)['then'](function(_0x2bb23c){if(_0x2bb23c[_0x0340('0xc')][_0x0340('0xd')]>0x0){var _0xf657f5=_0x2bb23c[_0x0340('0xc')][0x0][_0x0340('0xf')];_0x4c3be3(_0xf657f5);}else{return createRemoteTag(_0x3f138c,_0x377096,_0x5b93b2,_0x4e4079)[_0x0340('0x25')](function(_0x4de36e){_0x4c3be3(_0x4de36e);});}});});}function assignTagToIncident(_0x39615b,_0x366ff9,_0x431ca7,_0x477750,_0xb70f1c){return new Promise(function(_0x51ab68,_0x456b00){var _0x260ab8={'method':_0x0340('0x20'),'uri':_0x431ca7+_0x0340('0x46')+'?'+_0xb70f1c,'body':{'label':_0x39615b,'table':_0x0340('0x3c'),'id_type':'Incident','table_key':_0x477750[_0x0340('0x47')],'title':_0x0340('0x48')+_0x477750[_0x0340('0x42')],'id_display':_0x477750[_0x0340('0x42')]},'auth':_0x366ff9,'json':!![]};return rp(_0x260ab8)[_0x0340('0x25')](function(_0x2c73a2){_0x51ab68();})['catch'](function(){_0x51ab68();});});}function manageTags(_0x5b469b,_0x4896ce,_0x1ddcdf,_0x2b1e36,_0x195107,_0x490fbe,_0x4daf96){return new Promise(function(_0x594068,_0x83b808){var _0xbdfafb=[];_0x4896ce[_0x0340('0x49')](function(_0x313e19){_0xbdfafb[_0x0340('0x4a')](getRemoteTag(_0x313e19,_0x1ddcdf,_0x2b1e36,_0x490fbe,_0x4daf96));});return Promise[_0x0340('0x4b')](_0xbdfafb)[_0x0340('0x25')](function(_0x4c951e){if(_0x4c951e[_0x0340('0xd')]){logger[_0x0340('0x14')]('['+[_0x5b469b[_0x0340('0x10')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x4c951e);var _0x5ba53d=[];_0x4c951e[_0x0340('0x49')](function(_0x1b3261){_0x5ba53d[_0x0340('0x4a')](assignTagToIncident(_0x1b3261,_0x1ddcdf,_0x2b1e36,_0x195107,_0x490fbe));});return Promise['all'](_0x5ba53d)['then'](function(){_0x594068();})[_0x0340('0x11')](function(){_0x594068();});}else{_0x594068();}});});}function getTags(_0x457a43,_0x35f1ea,_0x282c26,_0x3dee75,_0x2ea79f,_0x3e7285){return function(_0x4cc809){return new Promise(function(_0x5a7de8,_0x11368b){var _0xce4a0d=[];var _0x28318d=_0x3dee75[_0x0340('0x4c')];if(_0x28318d&&_0x28318d[_0x0340('0xd')]>0x0){_0xce4a0d=_[_0x0340('0x4d')](_0x28318d,_0x0340('0x39'));}if(_0xce4a0d['length']>0x0){return manageTags(_0x457a43,_0xce4a0d,_0x35f1ea,_0x282c26,_0x4cc809,_0x2ea79f,_0x3e7285)[_0x0340('0x25')](function(){_0x5a7de8(_0x4cc809);});}else{_0x5a7de8(_0x4cc809);}});};}function emit(_0xa3c841,_0x5d3369,_0x4d7f4d){var _0x3463d4=_0x0340('0x4e')+_0x0340('0x4f')+_0x0340('0x50')+_0x0340('0x51');var _0x4f8d30={'uri':_0xa3c841+_0x0340('0x52')+_0x4d7f4d+_0x3463d4};io['to'](util[_0x0340('0x53')](_0x0340('0x54'),_0x5d3369))[_0x0340('0x55')](_0x0340('0x56'),_0x4f8d30);}exports['cs']=function(_0x3cae50,_0x5e9a29,_0x128ac1,_0x46bc1b,_0x5ee1e9,_0x391c6c,_0x252022,_0x43b4f9){var _0x51acd1={};var _0x2e4238={'user':_0x391c6c['username'],'pass':_0x391c6c[_0x0340('0x57')]};var _0x3243ce=_0x0340('0x58');var _0x2584d3=_0x0340('0x59');_0x391c6c[_0x0340('0x5a')]=intUtil[_0x0340('0x5b')](_0x391c6c[_0x0340('0x5a')]);_0x391c6c['serverUrl']=intUtil[_0x0340('0x5b')](_0x391c6c[_0x0340('0x5c')]);var _0x1ded2a=util[_0x0340('0x53')](_0x0340('0x5d'),_0x391c6c['remoteUri']);_0x51acd1[_0x0340('0x17')]=!_[_0x0340('0x5e')](_0x46bc1b)?_0x46bc1b['email']:null;_0x51acd1[_0x0340('0x1c')]=_0x391c6c[_0x0340('0x5f')];_0x51acd1['endUserNumber']=_0x43b4f9[_0x0340('0x2f')]()===_0x0340('0x3b')?_0x5e9a29[_0x0340('0x60')]:_0x5e9a29[_0x0340('0x61')];_0x51acd1[_0x0340('0x62')]=_0x43b4f9===_0x0340('0x63')||_0x43b4f9===_0x0340('0x64')?_0x0340('0x63'):'outbound';var _0x2f469a=util[_0x0340('0x53')](_0x0340('0x65'),_0x391c6c[_0x0340('0x5c')],_0x5e9a29['uniqueid'],md5(_0x5e9a29['uniqueid']));if(_0x5ee1e9&&_0x5ee1e9[_0x0340('0x66')]){logger[_0x0340('0x14')](_0x0340('0x67'),_0x0340('0x68'));_0x5e9a29[_0x0340('0x69')]=_0x2f469a;}else if(_0x252022&&_0x252022[_0x0340('0x6a')]&&_0x252022[_0x0340('0x6a')]!=='none'){logger[_0x0340('0x14')](_0x0340('0x6b'),_0x0340('0x68'));_0x5e9a29[_0x0340('0x69')]=_0x2f469a;}else{_0x5e9a29[_0x0340('0x69')]='';}return getAdminUser(_0x43b4f9,_0x2e4238,_0x51acd1,_0x1ded2a,_0x2584d3,_0x3243ce)[_0x0340('0x25')](getUser(_0x43b4f9,_0x2e4238,_0x1ded2a,_0x2584d3,_0x3243ce))['then'](getEndUser(_0x43b4f9,_0x2e4238,_0x1ded2a,_0x2584d3,_0x3243ce))['then'](getTicket(_0x43b4f9,_0x2e4238,_0x1ded2a,_0x128ac1,_0x5e9a29,_0x2584d3))['then'](function(_0x184df0){logger[_0x0340('0x14')](util[_0x0340('0x53')](_0x0340('0x6c'),_0x184df0['ticketId']));logger[_0x0340('0x14')](util[_0x0340('0x53')]('call\x20direction:\x20%s',_0x43b4f9));if(_0x43b4f9!==_0x0340('0x64')){logger[_0x0340('0x14')]('['+[_0x43b4f9[_0x0340('0x10')]()]+']',_0x0340('0x6d'));emit(_0x391c6c[_0x0340('0x5a')],_0x46bc1b[_0x0340('0x39')],_0x184df0[_0x0340('0x47')]);}})[_0x0340('0x11')](function(_0x2ef08c){logger[_0x0340('0x12')]('['+[_0x43b4f9[_0x0340('0x10')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0x0340('0x6e')](_0x2ef08c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x10b8=['destcalleridnum','calleridnum','callDirection','queue','unmanaged','uniqueid','recordingURL','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','lodash','bluebird','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','length','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','active','true','userId','adminEmail','message','sys_user?','endUserNumber','user','System','endUserId','sys_user?sysparm_query=phone%3D','forEach','includes','picklist','type','nameField','customField','content','toString','string','idField','toLowerCase','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','POST','incident','assign','getString','Descriptions','ticketId','ticketNumber','number','label','?sysparm_query=name%3D','label_entry','Incident','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','trigger:browser:url','username','sysparm_limit=1','sysparm_display_value=true','remoteUri','serverUrl','%s/api/now/table/','email'];(function(_0x31f063,_0x1e6dd8){var _0x42ca44=function(_0x2795a6){while(--_0x2795a6){_0x31f063['push'](_0x31f063['shift']());}};_0x42ca44(++_0x1e6dd8);}(_0x10b8,0xdb));var _0x810b=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x10b8[_0x11c573];return _0x6b72de;};'use strict';var _=require(_0x810b('0x0'));var Promise=require(_0x810b('0x1'));var rp=require(_0x810b('0x2'));var util=require('util');var md5=require(_0x810b('0x3'));var Redis=require(_0x810b('0x4'));var intUtil=require(_0x810b('0x5'));var config=require(_0x810b('0x6'));var logger=require(_0x810b('0x7'))(_0x810b('0x8'));config[_0x810b('0x9')]=_[_0x810b('0xa')](config[_0x810b('0x9')],{'host':_0x810b('0xb'),'port':0x18eb});var io=require(_0x810b('0xc'))(new Redis(config[_0x810b('0x9')]));function getAdminUser(_0x538acc,_0x57049d,_0x287536,_0x2c9f51,_0x164aad,_0x2b296e){return new Promise(function(_0x383288,_0x3d7bff){var _0x562eb5={'method':_0x810b('0xd'),'uri':_0x2c9f51+_0x810b('0xe')+'&'+_0x164aad+'&'+_0x2b296e,'auth':_0x57049d,'json':!![]};return rp(_0x562eb5)['then'](function(_0x41bad3){if(_0x41bad3['result'][_0x810b('0xf')]>0x0){_0x287536[_0x810b('0x10')]=_0x41bad3[_0x810b('0x11')][0x0][_0x810b('0x12')];}logger[_0x810b('0x13')]('['+[_0x538acc[_0x810b('0x14')]()]+_0x810b('0x15'),_0x287536);_0x383288(_0x287536);})[_0x810b('0x16')](function(_0x584893){logger[_0x810b('0x17')]('['+[_0x538acc[_0x810b('0x14')]()]+']',_0x584893['message']);_0x3d7bff(_0x584893['message']);});});}function getUser(_0x5df617,_0x636d50,_0x592101,_0x21947d,_0x554557){return function(_0x20576a){logger[_0x810b('0x13')]('['+[_0x5df617[_0x810b('0x14')]()]+_0x810b('0x18'),_0x20576a);return new Promise(function(_0x1d1f65,_0x330b3b){if(intUtil[_0x810b('0x19')](_0x20576a[_0x810b('0x1a')])){var _0x26e1af={'method':_0x810b('0xd'),'uri':_0x592101+_0x810b('0x1b')+_0x20576a[_0x810b('0x1a')]+'&'+_0x21947d+'&'+_0x554557,'auth':_0x636d50,'json':!![]};logger['info']('['+[_0x5df617['toUpperCase']()]+_0x810b('0x1c'),_0x26e1af);return rp(_0x26e1af)[_0x810b('0x1d')](function(_0x89dd5d){logger['info']('['+[_0x5df617[_0x810b('0x14')]()]+_0x810b('0x1e'),_0x89dd5d);if(_0x89dd5d[_0x810b('0x11')][_0x810b('0xf')]>0x0&&String(_0x89dd5d[_0x810b('0x11')][0x0][_0x810b('0x1f')])===_0x810b('0x20')){_0x20576a[_0x810b('0x21')]=_0x89dd5d[_0x810b('0x11')][0x0][_0x810b('0x12')];}else{_0x20576a[_0x810b('0x21')]=_0x20576a[_0x810b('0x10')];_0x20576a[_0x810b('0x1a')]=_0x20576a[_0x810b('0x22')];}logger[_0x810b('0x13')]('['+[_0x5df617[_0x810b('0x14')]()]+'],\x20getUser\x20crm',_0x20576a);_0x1d1f65(_0x20576a);})[_0x810b('0x16')](function(_0x12310c){logger[_0x810b('0x17')]('['+[_0x5df617[_0x810b('0x14')]()]+']',_0x12310c[_0x810b('0x23')]);_0x330b3b(_0x12310c[_0x810b('0x23')]);});}else{logger[_0x810b('0x13')]('['+[_0x5df617['toUpperCase']()]+']\x20using\x20admin\x20profile');_0x20576a[_0x810b('0x21')]=_0x20576a[_0x810b('0x10')];_0x20576a[_0x810b('0x1a')]=_0x20576a[_0x810b('0x22')];_0x1d1f65(_0x20576a);}});};}function createEndUser(_0x156afc,_0x2ff3da,_0x2ce7de,_0x4cd72d,_0x7dd984){logger[_0x810b('0x13')]('['+[_0x156afc['toUpperCase']()]+'],\x20createEndUser\x20input\x20crm',_0x2ce7de);return new Promise(function(_0x28c014,_0x1b0a74){var _0x46e072={'method':'POST','uri':_0x4cd72d+_0x810b('0x24')+_0x7dd984,'body':{'user_name':_0x2ce7de[_0x810b('0x25')],'roles':_0x810b('0x26'),'first_name':_0x2ce7de['endUserNumber'],'active':_0x810b('0x20'),'date_format':_0x810b('0x27'),'phone':_0x2ce7de[_0x810b('0x25')]},'auth':_0x2ff3da,'json':!![]};return rp(_0x46e072)[_0x810b('0x1d')](function(_0x3ad947){logger[_0x810b('0x13')]('['+[_0x156afc[_0x810b('0x14')]()]+'],\x20EndUser\x20schema',_0x3ad947[_0x810b('0x11')]);_0x2ce7de[_0x810b('0x28')]=_0x3ad947[_0x810b('0x11')]['sys_id'];_0x28c014(_0x2ce7de);})[_0x810b('0x16')](function(_0x1875a6){logger[_0x810b('0x17')]('['+[_0x156afc[_0x810b('0x14')]()]+']',_0x1875a6[_0x810b('0x23')]);_0x1b0a74(_0x1875a6[_0x810b('0x23')]);});});}function getEndUser(_0x3635fc,_0x525d04,_0x24fdd8,_0x4ffee4,_0x5f356b){return function(_0x55a36c){logger[_0x810b('0x13')]('['+[_0x3635fc[_0x810b('0x14')]()]+'],\x20getEndUser\x20input\x20crm',_0x55a36c);return new Promise(function(_0x1abf4e,_0xee2bcd){var _0x3cc53b={'method':'GET','uri':_0x24fdd8+_0x810b('0x29')+_0x55a36c['endUserNumber']+'&'+_0x4ffee4+'&'+_0x5f356b,'auth':_0x525d04,'json':!![]};return rp(_0x3cc53b)[_0x810b('0x1d')](function(_0x4b26e2){if(_0x4b26e2[_0x810b('0x11')][_0x810b('0xf')]>0x0){_0x55a36c[_0x810b('0x28')]=_0x4b26e2['result'][0x0]['sys_id'];logger[_0x810b('0x13')]('['+[_0x3635fc[_0x810b('0x14')]()]+'],\x20getEndUser\x20crm',_0x55a36c);_0x1abf4e(_0x55a36c);}else{return createEndUser(_0x3635fc,_0x525d04,_0x55a36c,_0x24fdd8,_0x4ffee4)[_0x810b('0x1d')](function(_0x56f8df){logger[_0x810b('0x13')]('['+[_0x3635fc[_0x810b('0x14')]()]+'],\x20createEndUser\x20crm',_0x56f8df);_0x1abf4e(_0x56f8df);});}})[_0x810b('0x16')](function(_0x299951){logger[_0x810b('0x17')]('['+[_0x3635fc[_0x810b('0x14')]()]+']',_0x299951['message']);_0xee2bcd(_0x299951[_0x810b('0x23')]);});});};}function getCustomFields(_0xf5adb6,_0x335763){var _0x1567e8={};if(_0xf5adb6[_0x810b('0xf')]>0x0){_[_0x810b('0x2a')](_0xf5adb6,function(_0x5e7170){if(_[_0x810b('0x2b')](['string',_0x810b('0x2c')],_0x5e7170[_0x810b('0x2d')])&&_0x5e7170[_0x810b('0x2e')]&&!_0x5e7170[_0x810b('0x2f')]){_0x1567e8[_0x5e7170['nameField']['toLowerCase']()]=_0x5e7170[_0x810b('0x30')][_0x810b('0x31')]();}else if(_[_0x810b('0x2b')]([_0x810b('0x32'),_0x810b('0x2c')],_0x5e7170['type'])&&_0x5e7170[_0x810b('0x33')]&&_0x5e7170[_0x810b('0x2f')]){_0x1567e8[_0x5e7170[_0x810b('0x33')][_0x810b('0x34')]()]=_0x5e7170[_0x810b('0x30')]['toString']();}else if(_0x5e7170['type']===_0x810b('0x35')&&_0x5e7170['variableName']&&_0x5e7170[_0x810b('0x33')]&&_0x5e7170[_0x810b('0x2f')]){_0x1567e8[_0x5e7170[_0x810b('0x33')][_0x810b('0x34')]()]=_0x335763[_0x5e7170[_0x810b('0x36')]][_0x810b('0x31')]();}else if(_0x5e7170[_0x810b('0x2d')]===_0x810b('0x37')&&_0x5e7170[_0x810b('0x38')]&&_0x5e7170[_0x810b('0x38')][_0x810b('0x39')]&&_0x5e7170[_0x810b('0x33')]&&_0x5e7170[_0x810b('0x2f')]){_0x1567e8[_0x5e7170['idField'][_0x810b('0x34')]()]=_0x335763[_0x5e7170[_0x810b('0x38')][_0x810b('0x39')][_0x810b('0x34')]()][_0x810b('0x31')]();}});}return _0x1567e8;}function getTicket(_0x159def,_0x26af80,_0x157a25,_0x3d72b8,_0x261f7b,_0x53a648){return function(_0x28b07c){logger[_0x810b('0x13')]('['+[_0x159def[_0x810b('0x14')]()]+_0x810b('0x3a'),_0x28b07c);return new Promise(function(_0x20871b,_0x1a5017){var _0x54afaf=_0x159def[_0x810b('0x34')]()===_0x810b('0x3b')?_0x28b07c[_0x810b('0x21')]:_0x28b07c[_0x810b('0x28')];var _0x1f8d9e={'method':_0x810b('0x3c'),'uri':_0x157a25+_0x810b('0x3d')+'?'+_0x53a648,'body':Object[_0x810b('0x3e')]({},{'active':_0x810b('0x20'),'caller_id':_0x54afaf,'assigned_to':_0x28b07c[_0x810b('0x21')],'short_description':intUtil['getString'](_0x3d72b8['Subjects'],_0x261f7b,'\x20'),'description':intUtil[_0x810b('0x3f')](_0x3d72b8[_0x810b('0x40')],_0x261f7b,'\x0a')},getCustomFields(_0x3d72b8['Fields'],_0x261f7b)),'auth':_0x26af80,'json':!![]};return rp(_0x1f8d9e)[_0x810b('0x1d')](function(_0x727222){logger[_0x810b('0x13')]('['+[_0x159def['toUpperCase']()]+']\x20POST\x20incident\x20entity\x20schema',_0x727222[_0x810b('0x11')]);_0x28b07c[_0x810b('0x41')]=_0x727222['result'][_0x810b('0x12')];_0x28b07c[_0x810b('0x42')]=_0x727222[_0x810b('0x11')][_0x810b('0x43')];logger[_0x810b('0x13')]('['+[_0x159def[_0x810b('0x14')]()]+']\x20getTicket\x20crm',_0x28b07c);_0x20871b(_0x28b07c);})[_0x810b('0x16')](function(_0x263e9f){logger[_0x810b('0x17')]('['+[_0x159def[_0x810b('0x14')]()]+']',_0x263e9f[_0x810b('0x23')]);_0x1a5017(_0x263e9f['message']);});});};}function createRemoteTag(_0x56a6d4,_0x37626e,_0x467ba0,_0x4cc26b){return new Promise(function(_0x3d664c,_0x2fe072){var _0x407c15={'method':'POST','uri':_0x467ba0+'label'+'?'+_0x4cc26b,'body':{'short_description':_0x56a6d4,'global':!![],'active':!![],'name':_0x56a6d4},'auth':_0x37626e,'json':!![]};return rp(_0x407c15)[_0x810b('0x1d')](function(_0x2460d0){var _0x36cd4b=_0x2460d0[_0x810b('0x11')]['sys_id'];_0x3d664c(_0x36cd4b);});});}function getRemoteTag(_0x42f7f2,_0x537ce8,_0x40c0cd,_0x23c84d,_0x410870){return new Promise(function(_0xee4ce0,_0x3ecf32){var _0x2cd896={'method':'GET','uri':_0x40c0cd+_0x810b('0x44')+_0x810b('0x45')+_0x42f7f2+'&'+_0x23c84d,'auth':_0x537ce8,'json':!![]};return rp(_0x2cd896)[_0x810b('0x1d')](function(_0x223f10){if(_0x223f10[_0x810b('0x11')][_0x810b('0xf')]>0x0){var _0x10dafb=_0x223f10[_0x810b('0x11')][0x0][_0x810b('0x12')];_0xee4ce0(_0x10dafb);}else{return createRemoteTag(_0x42f7f2,_0x537ce8,_0x40c0cd,_0x23c84d)['then'](function(_0x174e33){_0xee4ce0(_0x174e33);});}});});}function assignTagToIncident(_0x3d34e6,_0x32d683,_0x55e14b,_0x4b96d5,_0x186d54){return new Promise(function(_0x426624,_0x2b8d8b){var _0x591fe7={'method':'POST','uri':_0x55e14b+_0x810b('0x46')+'?'+_0x186d54,'body':{'label':_0x3d34e6,'table':_0x810b('0x3d'),'id_type':_0x810b('0x47'),'table_key':_0x4b96d5[_0x810b('0x41')],'title':'Incident\x20-\x20'+_0x4b96d5[_0x810b('0x42')],'id_display':_0x4b96d5[_0x810b('0x42')]},'auth':_0x32d683,'json':!![]};return rp(_0x591fe7)[_0x810b('0x1d')](function(_0x2fc2df){_0x426624();})['catch'](function(){_0x426624();});});}function manageTags(_0x14b2b0,_0x2a06b6,_0x2ca890,_0x17244d,_0x334515,_0x3d3e93,_0x1a2bab){return new Promise(function(_0x40829d,_0x972832){var _0x33b2ca=[];_0x2a06b6[_0x810b('0x2a')](function(_0x523276){_0x33b2ca[_0x810b('0x48')](getRemoteTag(_0x523276,_0x2ca890,_0x17244d,_0x3d3e93,_0x1a2bab));});return Promise[_0x810b('0x49')](_0x33b2ca)['then'](function(_0x2c94af){if(_0x2c94af[_0x810b('0xf')]){logger[_0x810b('0x13')]('['+[_0x14b2b0[_0x810b('0x14')]()]+_0x810b('0x4a'),_0x2c94af);var _0xa75871=[];_0x2c94af[_0x810b('0x2a')](function(_0xbc3ca9){_0xa75871[_0x810b('0x48')](assignTagToIncident(_0xbc3ca9,_0x2ca890,_0x17244d,_0x334515,_0x3d3e93));});return Promise[_0x810b('0x49')](_0xa75871)[_0x810b('0x1d')](function(){_0x40829d();})['catch'](function(){_0x40829d();});}else{_0x40829d();}});});}function getTags(_0x35306b,_0x977e99,_0x4d9f88,_0x2fb89e,_0x30f0c8,_0x8c3c8b){return function(_0x50cb97){return new Promise(function(_0xa7874f,_0x495b94){var _0x420932=[];var _0x2f321b=_0x2fb89e['Tags'];if(_0x2f321b&&_0x2f321b[_0x810b('0xf')]>0x0){_0x420932=_[_0x810b('0x4b')](_0x2f321b,_0x810b('0x39'));}if(_0x420932[_0x810b('0xf')]>0x0){return manageTags(_0x35306b,_0x420932,_0x977e99,_0x4d9f88,_0x50cb97,_0x30f0c8,_0x8c3c8b)[_0x810b('0x1d')](function(){_0xa7874f(_0x50cb97);});}else{_0xa7874f(_0x50cb97);}});};}function emit(_0x4b6ed1,_0x25db8d,_0x1d9573){var _0x2b916c=_0x810b('0x4c')+_0x810b('0x4d')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0x810b('0x4e');var _0x3a8919={'uri':_0x4b6ed1+_0x810b('0x4f')+_0x1d9573+_0x2b916c};io['to'](util[_0x810b('0x50')](_0x810b('0x51'),_0x25db8d))['emit'](_0x810b('0x52'),_0x3a8919);}exports['cs']=function(_0x4c458f,_0x55ef93,_0x3c8a3d,_0x1dda73,_0x546ad0,_0x3cdf6d,_0x48fbcd,_0x569c5c){var _0x4048fe={};var _0x573407={'user':_0x3cdf6d[_0x810b('0x53')],'pass':_0x3cdf6d['password']};var _0xf7685=_0x810b('0x54');var _0x241761=_0x810b('0x55');_0x3cdf6d[_0x810b('0x56')]=intUtil['stripTrailingSlash'](_0x3cdf6d['remoteUri']);_0x3cdf6d[_0x810b('0x57')]=intUtil['stripTrailingSlash'](_0x3cdf6d[_0x810b('0x57')]);var _0x4797c1=util['format'](_0x810b('0x58'),_0x3cdf6d[_0x810b('0x56')]);_0x4048fe['userEmail']=!_['isNil'](_0x1dda73)?_0x1dda73[_0x810b('0x59')]:null;_0x4048fe[_0x810b('0x22')]=_0x3cdf6d[_0x810b('0x59')];_0x4048fe[_0x810b('0x25')]=_0x569c5c[_0x810b('0x34')]()===_0x810b('0x3b')?_0x55ef93[_0x810b('0x5a')]:_0x55ef93[_0x810b('0x5b')];_0x4048fe[_0x810b('0x5c')]=_0x569c5c===_0x810b('0x5d')||_0x569c5c===_0x810b('0x5e')?'queue':_0x810b('0x3b');var _0x2daf0c=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3cdf6d['serverUrl'],_0x55ef93[_0x810b('0x5f')],md5(_0x55ef93[_0x810b('0x5f')]));if(_0x546ad0&&_0x546ad0['monitor_format']){logger[_0x810b('0x13')]('[QUEUE]','Recording\x20is\x20enabled!');_0x55ef93[_0x810b('0x60')]=_0x2daf0c;}else if(_0x48fbcd&&_0x48fbcd[_0x810b('0x61')]&&_0x48fbcd[_0x810b('0x61')]!=='none'){logger['info'](_0x810b('0x62'),_0x810b('0x63'));_0x55ef93[_0x810b('0x60')]=_0x2daf0c;}else{_0x55ef93[_0x810b('0x60')]='';}return getAdminUser(_0x569c5c,_0x573407,_0x4048fe,_0x4797c1,_0x241761,_0xf7685)[_0x810b('0x1d')](getUser(_0x569c5c,_0x573407,_0x4797c1,_0x241761,_0xf7685))[_0x810b('0x1d')](getEndUser(_0x569c5c,_0x573407,_0x4797c1,_0x241761,_0xf7685))[_0x810b('0x1d')](getTicket(_0x569c5c,_0x573407,_0x4797c1,_0x3c8a3d,_0x55ef93,_0x241761))['then'](function(_0xd28d8f){logger[_0x810b('0x13')](util[_0x810b('0x50')](_0x810b('0x64'),_0xd28d8f[_0x810b('0x41')]));logger[_0x810b('0x13')](util[_0x810b('0x50')]('call\x20direction:\x20%s',_0x569c5c));if(_0x569c5c!==_0x810b('0x5e')){logger[_0x810b('0x13')]('['+[_0x569c5c[_0x810b('0x14')]()]+']',_0x810b('0x65'));emit(_0x3cdf6d[_0x810b('0x56')],_0x1dda73['name'],_0xd28d8f[_0x810b('0x41')]);}})[_0x810b('0x16')](function(_0x5f02b8){logger['error']('['+[_0x569c5c['toUpperCase']()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0x810b('0x66')](_0x5f02b8,{'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 548bdc4..1c072f6 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 _0x37d4=['forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','format','toString','get_server_info','isNil','info','Getting\x20agent\x20with\x20name','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','find','entry_list','name_value_list','resolve','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','','Caller\x20-\x20%s','Enduser\x20created.','first_name','[HTTP]','merge','map','type','string','nameField','customField','toLowerCase','content','custom_fields','customVariable','Variable','login','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','[OUTBOUND]','destcalleridnum','Fields','Outbound','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','lastevent','toUpperCase','lodash','request-promise','util','../../../../config/logger','redis','localhost','POST','emit','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','Descriptions','toISOString','duration_hours','parent_type','Contacts','parent_name','direction','length'];(function(_0x2c0557,_0x4314fd){var _0x2878cd=function(_0x1f8a9f){while(--_0x1f8a9f){_0x2c0557['push'](_0x2c0557['shift']());}};_0x2878cd(++_0x4314fd);}(_0x37d4,0x1b1));var _0x437d=function(_0x57cb85,_0x1ef2b9){_0x57cb85=_0x57cb85-0x0;var _0x2a168b=_0x37d4[_0x57cb85];return _0x2a168b;};'use strict';var _=require(_0x437d('0x0'));var rp=require(_0x437d('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require(_0x437d('0x2'));var Redis=require('ioredis');var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x437d('0x3'))('sugarcrm');config['redis']=_['defaults'](config[_0x437d('0x4')],{'host':_0x437d('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x437d('0x4')]));var def={'method':_0x437d('0x6'),'json':!![]};function emit(_0x1969b1,_0x5b85a6,_0x5ef580){io['to'](_0x1969b1)[_0x437d('0x7')](_0x5b85a6,_0x5ef580);}function getTicket(_0x3a72b2,_0x4918d1,_0x4f1643,_0x15755b,_0xfa4481,_0x3176fe,_0x5a8aac,_0x53d06e){logger['info'](_0x437d('0x8'));var _0xc015fc=new Date();var _0x5e1386=[{'name':_0x437d('0x9'),'value':intUtil[_0x437d('0xa')](_0x15755b[_0x437d('0xb')],_0xfa4481,'\x20')},{'name':_0x437d('0xc'),'value':_0x4918d1['id']},{'name':_0x437d('0xd'),'value':_0x4918d1['id']},{'name':_0x437d('0xe'),'value':intUtil['getString'](_0x15755b[_0x437d('0xf')],_0xfa4481,'\x0a')},{'name':'date_start','value':_0xc015fc[_0x437d('0x10')]()['slice'](0x0,0x13)['replace']('T','\x20')},{'name':_0x437d('0x11'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':'parent_id','value':_0x4f1643['id']},{'name':_0x437d('0x12'),'value':_0x437d('0x13')},{'name':_0x437d('0x14'),'value':_0x4f1643[_0x437d('0x9')]},{'name':_0x437d('0x15'),'value':_0x53d06e}];if(_0x3176fe[_0x437d('0x16')]){_[_0x437d('0x17')](_0x3176fe,function(_0x217047){if(_0xfa4481[_0x217047[_0x437d('0x18')]]){_0x5e1386[_0x437d('0x19')]({'name':_0x217047[_0x437d('0x1a')],'value':_0xfa4481[_0x217047[_0x437d('0x18')]]});}});}return request({'form':{'method':_0x437d('0x1b'),'input_type':_0x437d('0x1c'),'response_type':_0x437d('0x1c'),'rest_data':JSON[_0x437d('0x1d')]({'session':_0x5a8aac['id'],'module_name':_0x437d('0x1e'),'name_value_list':_0x5e1386})}});}function getAuth(_0x5c44e5){return util[_0x437d('0x1f')]('Basic\x20%s',new Buffer(_0x5c44e5['apiKey']+':X')[_0x437d('0x20')]('base64'));}function getServerInfo(_0x15bbef){return request({'form':{'method':_0x437d('0x21'),'input_type':_0x437d('0x1c'),'response_type':_0x437d('0x1c'),'rest_data':JSON[_0x437d('0x1d')]({'session':_0x15bbef['id']})}});}function getUser(_0x2db375,_0x182872,_0x19ffa8){if(!_[_0x437d('0x22')](_0x182872)){logger[_0x437d('0x23')](_0x437d('0x24'),_0x182872);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0x437d('0x1c'),'rest_data':JSON[_0x437d('0x1d')]({'session':_0x19ffa8['id'],'module_name':_0x437d('0x25'),'query':util[_0x437d('0x1f')](_0x437d('0x26'),_0x182872),'order_by':'','offset':'0','select_fields':['id','name',_0x437d('0x27')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x437d('0x28')](function(_0x5968d7){if(_0x5968d7['entry_list'][_0x437d('0x16')]){var _0x5d44f5=_[_0x437d('0x29')](_0x5968d7[_0x437d('0x2a')],function(_0x5ec0ef){return _0x5ec0ef[_0x437d('0x2b')]['user_name']['value']===_0x182872;});if(_0x5d44f5){logger['info']('Agent\x20found!');return BPromise[_0x437d('0x2c')]({'id':_0x5d44f5['name_value_list']['id'][_0x437d('0x2d')],'name':_0x5d44f5[_0x437d('0x2b')]['name'][_0x437d('0x2d')]});}}logger['info'](_0x437d('0x2e'));return BPromise[_0x437d('0x2c')]({'id':_0x19ffa8['name_value_list'][_0x437d('0x2f')][_0x437d('0x2d')],'name':_0x19ffa8[_0x437d('0x2b')][_0x437d('0x27')][_0x437d('0x2d')]});});}else{logger[_0x437d('0x23')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x437d('0x2c')]({'id':_0x19ffa8[_0x437d('0x2b')][_0x437d('0x2f')][_0x437d('0x2d')],'name':_0x19ffa8['name_value_list'][_0x437d('0x27')][_0x437d('0x2d')]});}}function getEndUser(_0x21bdba,_0x35310a,_0x17d5cb,_0x2a9b9d){logger[_0x437d('0x23')](_0x437d('0x30'),_0x17d5cb);return request({'form':{'method':_0x437d('0x31'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x437d('0x1d')]({'session':_0x2a9b9d['id'],'module_name':_0x437d('0x13'),'query':util[_0x437d('0x1f')](_0x437d('0x32'),_0x17d5cb),'order_by':'','offset':'0','select_fields':['id',_0x437d('0x9'),_0x437d('0x33')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x285c4f){if(_0x285c4f['entry_list'][_0x437d('0x16')]){var _0x4eefed=_[_0x437d('0x29')](_0x285c4f[_0x437d('0x2a')],function(_0xc492d7){return _0xc492d7[_0x437d('0x2b')][_0x437d('0x33')][_0x437d('0x2d')]===_0x17d5cb;});if(_0x4eefed){logger[_0x437d('0x23')]('Enduser\x20found!');return BPromise[_0x437d('0x2c')]({'id':_0x4eefed[_0x437d('0x2b')]['id'][_0x437d('0x2d')],'name':_0x4eefed[_0x437d('0x2b')][_0x437d('0x9')][_0x437d('0x2d')],'phone':_0x4eefed[_0x437d('0x2b')][_0x437d('0x33')]['value']});}}else{logger[_0x437d('0x23')](_0x437d('0x34'));return request({'form':{'method':_0x437d('0x1b'),'input_type':'JSON','response_type':_0x437d('0x1c'),'rest_data':JSON[_0x437d('0x1d')]({'session':_0x2a9b9d['id'],'module_name':'Contacts','name_value_list':[{'name':'first_name','value':_0x35310a!==_0x437d('0x35')?_0x35310a:util[_0x437d('0x1f')](_0x437d('0x36'),_0x17d5cb)},{'name':_0x437d('0x33'),'value':_0x17d5cb}]})}})['then'](function(_0x4d870b){logger[_0x437d('0x23')](_0x437d('0x37'));return BPromise[_0x437d('0x2c')]({'id':_0x4d870b['id'],'name':_0x4d870b[_0x437d('0x2a')][_0x437d('0x38')][_0x437d('0x2d')],'phone':_0x4d870b[_0x437d('0x2a')][_0x437d('0x33')][_0x437d('0x2d')]});});}});}function request(_0x22eb2b){logger['debug'](_0x437d('0x39'),JSON[_0x437d('0x1d')](_0x22eb2b));return rp(_[_0x437d('0x3a')](def,_0x22eb2b));}function getTags(_0x450ffb,_0xc63a52){var _0x312d20=[];if(_0x450ffb&&_0x450ffb[_0x437d('0x16')]>0x0){_0x312d20=_[_0x437d('0x3b')](_0x450ffb,_0xc63a52);}return _0x312d20;}function getCustomFields(_0x450f30,_0x11b0b9){var _0x13fe2f=[];var _0x3d69cc={'custom_fields':[]};if(_0x450f30[_0x437d('0x16')]>0x0){_[_0x437d('0x17')](_0x450f30,function(_0x58c1c9){if(_0x58c1c9[_0x437d('0x3c')]===_0x437d('0x3d')&&_0x58c1c9[_0x437d('0x3e')]&&!_0x58c1c9[_0x437d('0x3f')]){_0x3d69cc[_0x58c1c9[_0x437d('0x3e')][_0x437d('0x40')]()]=_0x58c1c9[_0x437d('0x41')]['toString']();}else if(_0x58c1c9[_0x437d('0x3c')]===_0x437d('0x3d')&&_0x58c1c9[_0x437d('0x1a')]&&_0x58c1c9[_0x437d('0x3f')]){_0x3d69cc[_0x437d('0x42')]['push']({'id':_0x58c1c9[_0x437d('0x1a')],'value':_0x58c1c9[_0x437d('0x41')]['toString']()});}else if(_0x58c1c9[_0x437d('0x3c')]==='variable'&&_0x58c1c9[_0x437d('0x18')]&&_0x58c1c9[_0x437d('0x1a')]&&_0x58c1c9[_0x437d('0x3f')]){_0x11b0b9[_0x58c1c9['variableName']]&&_0x3d69cc[_0x437d('0x42')][_0x437d('0x19')]({'id':_0x58c1c9[_0x437d('0x1a')],'value':_0x11b0b9[_0x58c1c9['variableName']][_0x437d('0x20')]()});}else if(_0x58c1c9[_0x437d('0x3c')]===_0x437d('0x43')&&_0x58c1c9['Variable']&&_0x58c1c9[_0x437d('0x44')][_0x437d('0x9')]&&_0x58c1c9[_0x437d('0x1a')]&&_0x58c1c9['customField']){_0x11b0b9[_0x58c1c9[_0x437d('0x44')]['name'][_0x437d('0x40')]()]&&_0x3d69cc[_0x437d('0x42')][_0x437d('0x19')]({'id':_0x58c1c9[_0x437d('0x1a')],'value':_0x11b0b9[_0x58c1c9[_0x437d('0x44')][_0x437d('0x9')]['toLowerCase']()][_0x437d('0x20')]()});}});}return _0x3d69cc;}function getConnection(_0x5c7ce7){return request({'method':_0x437d('0x6'),'form':{'method':_0x437d('0x45'),'input_type':_0x437d('0x1c'),'response_type':_0x437d('0x1c'),'rest_data':JSON[_0x437d('0x1d')]({'user_auth':{'user_name':_0x5c7ce7['username'],'password':_0x5c7ce7[_0x437d('0x46')],'encryption':_0x437d('0x47')},'application':_0x437d('0x48')})}})[_0x437d('0x28')](function(_0x1f506c){var _0x5890c8=_0x1f506c;if(_0x5890c8['id']){def[_0x437d('0x49')]=_0x5890c8['id'];return BPromise['resolve'](_0x5890c8);}else{throw new Error(util[_0x437d('0x1f')](_0x437d('0x4a'),_0x5c7ce7['id']));}});}function setRelationship(_0x5a0bcb,_0x4e8e27,_0x468772,_0x4db2dc){return request({'form':{'method':_0x437d('0x4b'),'input_type':'JSON','response_type':_0x437d('0x1c'),'rest_data':JSON[_0x437d('0x1d')]({'session':_0x5a0bcb['id'],'module_name':_0x437d('0x1e'),'module_id':_0x468772['id'],'link_field_name':_0x4db2dc,'related_ids':[_0x4e8e27['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x437d('0x4c')]=function(_0x2dbd30,_0x34e168,_0xf4f90c,_0x4f6b35,_0x2577fe,_0x63f189){var _0x125cc9,_0x8f16bd,_0x4a92b2,_0x1abd4b;_0x63f189[_0x437d('0x4d')]=intUtil[_0x437d('0x4e')](_0x63f189[_0x437d('0x4d')]);_0x63f189[_0x437d('0x4f')]=intUtil[_0x437d('0x4e')](_0x63f189['serverUrl']);def[_0x437d('0x50')]=util[_0x437d('0x1f')](_0x437d('0x51'),_0x63f189[_0x437d('0x4d')]);if(_0x2577fe&&_0x2577fe[_0x437d('0x52')]){logger['info']('[QUEUE]',_0x437d('0x53'));_0x34e168[_0x437d('0x54')]=util[_0x437d('0x1f')](_0x437d('0x55'),_0x63f189[_0x437d('0x4f')],_0x34e168[_0x437d('0x56')],md5(_0x34e168[_0x437d('0x56')]));}else{_0x34e168[_0x437d('0x54')]='';}return getConnection(_0x63f189)[_0x437d('0x28')](function(_0x48f2e4){_0x1abd4b=_0x48f2e4;return getUser(_0x63f189,_0x4f6b35[_0x437d('0x9')],_0x1abd4b);})[_0x437d('0x28')](function(_0x2e7fec){_0x125cc9=_0x2e7fec;logger[_0x437d('0x23')](_0x437d('0x57'),_0x125cc9['id']);return getEndUser(_0x63f189,_0x34e168[_0x437d('0x58')],_0x34e168[_0x437d('0x59')],_0x1abd4b);})[_0x437d('0x28')](function(_0x514c24){_0x8f16bd=_0x514c24;logger[_0x437d('0x23')](_0x437d('0x5a'),_0x8f16bd['id']);return getTicket(_0x63f189,_0x125cc9,_0x8f16bd,_0xf4f90c,_0x34e168,_0xf4f90c['Fields'],_0x1abd4b,_0x437d('0x5b'));})[_0x437d('0x28')](function(_0x40fe72){_0x4a92b2=_0x40fe72;logger[_0x437d('0x23')](_0x437d('0x5c'));logger[_0x437d('0x23')](_0x437d('0x5d'),_0x4a92b2['id']);return setRelationship(_0x1abd4b,_0x125cc9,_0x4a92b2,_0x437d('0x5e'));})['then'](function(){return setRelationship(_0x1abd4b,_0x8f16bd,_0x4a92b2,_0x437d('0x5f'));})[_0x437d('0x28')](function(){return getServerInfo(_0x1abd4b);})[_0x437d('0x28')](function(_0x2b8159){var _0x4ee005=parseInt(_0x2b8159[_0x437d('0x60')][_0x437d('0x61')](0x0));var _0x21a808=util[_0x437d('0x1f')](_0x437d('0x62'),_0x63f189[_0x437d('0x4d')],_0x4a92b2['id']);if(_0x4ee005>0x6){_0x21a808=util[_0x437d('0x1f')](_0x437d('0x63'),_0x63f189[_0x437d('0x4d')],_0x4a92b2['id']);}logger[_0x437d('0x23')](_0x437d('0x64'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x437d('0x1f')](_0x437d('0x65'),_0x4f6b35[_0x437d('0x9')]),_0x437d('0x66'),{'uri':_0x21a808});})[_0x437d('0x67')](function(_0x35f231){logger[_0x437d('0x68')](_0x437d('0x64'),JSON['stringify'](_0x35f231));});};exports[_0x437d('0x69')]=function(_0x29f2db,_0x37ae14,_0x1a6d08,_0x14a0be,_0x215b9e,_0x1e76a1,_0x5b8e64){var _0x2c7c0a,_0x5d797c,_0x1b64f7,_0x1faeba;_0x1e76a1[_0x437d('0x4d')]=intUtil[_0x437d('0x4e')](_0x1e76a1['remoteUri']);_0x1e76a1['serverUrl']=intUtil[_0x437d('0x4e')](_0x1e76a1[_0x437d('0x4f')]);def['uri']=util[_0x437d('0x1f')]('%s/service/v4_1/rest.php',_0x1e76a1[_0x437d('0x4d')]);if(_0x5b8e64&&_0x5b8e64['recordingFormat']&&_0x5b8e64[_0x437d('0x6a')]!=='none'){logger['info'](_0x437d('0x6b'),_0x437d('0x53'));_0x37ae14['recordingURL']=util['format'](_0x437d('0x55'),_0x1e76a1[_0x437d('0x4f')],_0x37ae14['uniqueid'],md5(_0x37ae14[_0x437d('0x56')]));}return getConnection(_0x1e76a1)[_0x437d('0x28')](function(_0x23b719){_0x1faeba=_0x23b719;return getUser(_0x1e76a1,_0x14a0be[_0x437d('0x9')],_0x1faeba);})[_0x437d('0x28')](function(_0x3f5f8f){_0x2c7c0a=_0x3f5f8f;logger[_0x437d('0x23')]('The\x20User\x20ID\x20is:',_0x2c7c0a['id']);return getEndUser(_0x1e76a1,_0x37ae14['destcalleridname'],_0x37ae14[_0x437d('0x6c')],_0x1faeba);})[_0x437d('0x28')](function(_0x423551){_0x5d797c=_0x423551;logger[_0x437d('0x23')](_0x437d('0x5a'),_0x5d797c['id']);return getTicket(_0x1e76a1,_0x2c7c0a,_0x5d797c,_0x1a6d08,_0x37ae14,_0x1a6d08[_0x437d('0x6d')],_0x1faeba,_0x437d('0x6e'));})['then'](function(_0x3cc558){_0x1b64f7=_0x3cc558;logger['info']('Ticket\x20created!');logger[_0x437d('0x23')](_0x437d('0x5d'),_0x1b64f7['id']);return setRelationship(_0x1faeba,_0x2c7c0a,_0x1b64f7,_0x437d('0x5e'));})[_0x437d('0x28')](function(){return setRelationship(_0x1faeba,_0x5d797c,_0x1b64f7,_0x437d('0x5f'));})[_0x437d('0x28')](function(){return getServerInfo(_0x1faeba);})['then'](function(_0x22dcb7){var _0xfa00cb=parseInt(_0x22dcb7[_0x437d('0x60')][_0x437d('0x61')](0x0));var _0x35d1eb=util[_0x437d('0x1f')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x1e76a1[_0x437d('0x4d')],_0x1b64f7['id']);if(_0xfa00cb>0x6){_0x35d1eb=util[_0x437d('0x1f')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x1e76a1[_0x437d('0x4d')],_0x1b64f7['id']);}logger[_0x437d('0x23')](_0x437d('0x6b'),_0x437d('0x6f'));emit(util['format'](_0x437d('0x65'),_0x14a0be[_0x437d('0x9')]),_0x437d('0x66'),{'uri':_0x35d1eb});})[_0x437d('0x67')](function(_0xdd3b1e){logger['error']('[OUTBOUND]',JSON[_0x437d('0x1d')](_0xdd3b1e));});};exports['unmanaged']=function(_0x59d3f3,_0x4c2b6a,_0x409a4a,_0x3f7a70,_0x4310c7,_0x1de835){var _0x26d768,_0x1bf913,_0x3ef8ec,_0x23da41;_0x1de835[_0x437d('0x4d')]=intUtil[_0x437d('0x4e')](_0x1de835['remoteUri']);_0x1de835[_0x437d('0x4f')]=intUtil['stripTrailingSlash'](_0x1de835[_0x437d('0x4f')]);def[_0x437d('0x50')]=util[_0x437d('0x1f')](_0x437d('0x51'),_0x1de835[_0x437d('0x4d')]);if(_0x4310c7&&_0x4310c7[_0x437d('0x52')]){logger[_0x437d('0x23')]('['+_0x4c2b6a[_0x437d('0x70')][_0x437d('0x71')]()+']',_0x437d('0x53'));_0x4c2b6a[_0x437d('0x54')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1de835['serverUrl'],_0x4c2b6a[_0x437d('0x56')],md5(_0x4c2b6a[_0x437d('0x56')]));}else{_0x4c2b6a[_0x437d('0x54')]='';}return getConnection(_0x1de835)[_0x437d('0x28')](function(_0x4fce0a){_0x23da41=_0x4fce0a;if(!_[_0x437d('0x22')](_0x3f7a70)){return getUser(_0x1de835,_0x3f7a70[_0x437d('0x9')],_0x23da41);}else{return getUser(_0x1de835,null,_0x23da41);}})['then'](function(_0x2f8d1e){_0x26d768=_0x2f8d1e;logger[_0x437d('0x23')](_0x437d('0x57'),_0x26d768['id']);return getEndUser(_0x1de835,_0x4c2b6a[_0x437d('0x58')],_0x4c2b6a[_0x437d('0x59')],_0x23da41);})['then'](function(_0x123275){_0x1bf913=_0x123275;logger['info'](_0x437d('0x5a'),_0x1bf913['id']);return getTicket(_0x1de835,_0x26d768,_0x1bf913,_0x409a4a,_0x4c2b6a,_0x409a4a[_0x437d('0x6d')],_0x23da41,_0x437d('0x5b'));})[_0x437d('0x28')](function(_0x234c7a){_0x3ef8ec=_0x234c7a;logger[_0x437d('0x23')](_0x437d('0x5c'));logger[_0x437d('0x23')](_0x437d('0x5d'),_0x3ef8ec['id']);return setRelationship(_0x23da41,_0x26d768,_0x3ef8ec,_0x437d('0x5e'));})[_0x437d('0x28')](function(){return setRelationship(_0x23da41,_0x1bf913,_0x3ef8ec,_0x437d('0x5f'));})[_0x437d('0x28')](function(){return getServerInfo(_0x23da41);})[_0x437d('0x67')](function(_0xea9f4d){logger[_0x437d('0x68')]('['+_0x4c2b6a[_0x437d('0x70')][_0x437d('0x71')]()+']',JSON['stringify'](_0xea9f4d));});}; \ No newline at end of file +var _0xe835=['request-promise','md5','util','ioredis','./util','../../../../config/logger','sugarcrm','defaults','redis','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','assigned_user_id','created_by','description','getString','Descriptions','date_start','slice','replace','duration_hours','duration_minutes','parent_type','Contacts','length','forEach','push','variableName','set_entry','JSON','Calls','format','Basic\x20%s','apiKey','toString','get_server_info','stringify','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','first_name','Caller\x20-\x20%s','debug','merge','map','type','string','customField','nameField','idField','custom_fields','content','customVariable','Variable','toLowerCase','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','outbound','recordingFormat','none','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Outbound','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','[OUTBOUND]','catch','unmanaged','lastevent','toUpperCase','Inbound','lodash'];(function(_0x3abab3,_0x4aaebb){var _0x44a5c8=function(_0x25c9b9){while(--_0x25c9b9){_0x3abab3['push'](_0x3abab3['shift']());}};_0x44a5c8(++_0x4aaebb);}(_0xe835,0x16a));var _0x5e83=function(_0x54eab6,_0x5e262f){_0x54eab6=_0x54eab6-0x0;var _0x1e7435=_0xe835[_0x54eab6];return _0x1e7435;};'use strict';var _=require(_0x5e83('0x0'));var rp=require(_0x5e83('0x1'));var BPromise=require('bluebird');var md5=require(_0x5e83('0x2'));var util=require(_0x5e83('0x3'));var Redis=require(_0x5e83('0x4'));var intUtil=require(_0x5e83('0x5'));var config=require('../../../../config/environment');var logger=require(_0x5e83('0x6'))(_0x5e83('0x7'));config['redis']=_[_0x5e83('0x8')](config[_0x5e83('0x9')],{'host':_0x5e83('0xa'),'port':0x18eb});var io=require(_0x5e83('0xb'))(new Redis(config[_0x5e83('0x9')]));var def={'method':_0x5e83('0xc'),'json':!![]};function emit(_0x89aace,_0x59eaea,_0x2f8378){io['to'](_0x89aace)[_0x5e83('0xd')](_0x59eaea,_0x2f8378);}function getTicket(_0x2284c7,_0x1e36d3,_0x4ff941,_0x3f54f9,_0x152653,_0x3e7938,_0x1226be,_0xd9421c){logger[_0x5e83('0xe')](_0x5e83('0xf'));var _0x5cc2a2=new Date();var _0x5c1a05=[{'name':_0x5e83('0x10'),'value':intUtil['getString'](_0x3f54f9['Subjects'],_0x152653,'\x20')},{'name':_0x5e83('0x11'),'value':_0x1e36d3['id']},{'name':_0x5e83('0x12'),'value':_0x1e36d3['id']},{'name':_0x5e83('0x13'),'value':intUtil[_0x5e83('0x14')](_0x3f54f9[_0x5e83('0x15')],_0x152653,'\x0a')},{'name':_0x5e83('0x16'),'value':_0x5cc2a2['toISOString']()[_0x5e83('0x17')](0x0,0x13)[_0x5e83('0x18')]('T','\x20')},{'name':_0x5e83('0x19'),'value':'0'},{'name':_0x5e83('0x1a'),'value':'15'},{'name':'parent_id','value':_0x4ff941['id']},{'name':_0x5e83('0x1b'),'value':_0x5e83('0x1c')},{'name':'parent_name','value':_0x4ff941[_0x5e83('0x10')]},{'name':'direction','value':_0xd9421c}];if(_0x3e7938[_0x5e83('0x1d')]){_[_0x5e83('0x1e')](_0x3e7938,function(_0x102ba0){if(_0x152653[_0x102ba0['variableName']]){_0x5c1a05[_0x5e83('0x1f')]({'name':_0x102ba0['idField'],'value':_0x152653[_0x102ba0[_0x5e83('0x20')]]});}});}return request({'form':{'method':_0x5e83('0x21'),'input_type':'JSON','response_type':_0x5e83('0x22'),'rest_data':JSON['stringify']({'session':_0x1226be['id'],'module_name':_0x5e83('0x23'),'name_value_list':_0x5c1a05})}});}function getAuth(_0xb0f3ac){return util[_0x5e83('0x24')](_0x5e83('0x25'),new Buffer(_0xb0f3ac[_0x5e83('0x26')]+':X')[_0x5e83('0x27')]('base64'));}function getServerInfo(_0x38cfce){return request({'form':{'method':_0x5e83('0x28'),'input_type':'JSON','response_type':_0x5e83('0x22'),'rest_data':JSON[_0x5e83('0x29')]({'session':_0x38cfce['id']})}});}function getUser(_0x26c2c7,_0x346659,_0x198164){if(!_[_0x5e83('0x2a')](_0x346659)){logger[_0x5e83('0xe')](_0x5e83('0x2b'),_0x346659);return request({'form':{'method':_0x5e83('0x2c'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x5e83('0x29')]({'session':_0x198164['id'],'module_name':_0x5e83('0x2d'),'query':util[_0x5e83('0x24')](_0x5e83('0x2e'),_0x346659),'order_by':'','offset':'0','select_fields':['id',_0x5e83('0x10'),_0x5e83('0x2f')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x5e83('0x30')](function(_0x13762c){if(_0x13762c[_0x5e83('0x31')][_0x5e83('0x1d')]){var _0x180ad4=_[_0x5e83('0x32')](_0x13762c[_0x5e83('0x31')],function(_0x3012c3){return _0x3012c3[_0x5e83('0x33')][_0x5e83('0x2f')][_0x5e83('0x34')]===_0x346659;});if(_0x180ad4){logger['info']('Agent\x20found!');return BPromise[_0x5e83('0x35')]({'id':_0x180ad4[_0x5e83('0x33')]['id'][_0x5e83('0x34')],'name':_0x180ad4[_0x5e83('0x33')][_0x5e83('0x10')][_0x5e83('0x34')]});}}logger[_0x5e83('0xe')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x198164[_0x5e83('0x33')][_0x5e83('0x36')][_0x5e83('0x34')],'name':_0x198164[_0x5e83('0x33')][_0x5e83('0x2f')][_0x5e83('0x34')]});});}else{logger[_0x5e83('0xe')](_0x5e83('0x37'));return BPromise[_0x5e83('0x35')]({'id':_0x198164[_0x5e83('0x33')][_0x5e83('0x36')][_0x5e83('0x34')],'name':_0x198164[_0x5e83('0x33')][_0x5e83('0x2f')]['value']});}}function getEndUser(_0x53ec73,_0x9ab6eb,_0x14ff9a,_0x200779){logger[_0x5e83('0xe')](_0x5e83('0x38'),_0x14ff9a);return request({'form':{'method':_0x5e83('0x2c'),'input_type':'JSON','response_type':_0x5e83('0x22'),'rest_data':JSON[_0x5e83('0x29')]({'session':_0x200779['id'],'module_name':_0x5e83('0x1c'),'query':util[_0x5e83('0x24')](_0x5e83('0x39'),_0x14ff9a),'order_by':'','offset':'0','select_fields':['id',_0x5e83('0x10'),_0x5e83('0x3a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x5e83('0x30')](function(_0x4e867d){if(_0x4e867d[_0x5e83('0x31')]['length']){var _0x3b1c6d=_[_0x5e83('0x32')](_0x4e867d['entry_list'],function(_0x4f4d6d){return _0x4f4d6d[_0x5e83('0x33')]['phone_home'][_0x5e83('0x34')]===_0x14ff9a;});if(_0x3b1c6d){logger['info'](_0x5e83('0x3b'));return BPromise[_0x5e83('0x35')]({'id':_0x3b1c6d[_0x5e83('0x33')]['id'][_0x5e83('0x34')],'name':_0x3b1c6d[_0x5e83('0x33')]['name'][_0x5e83('0x34')],'phone':_0x3b1c6d[_0x5e83('0x33')][_0x5e83('0x3a')]['value']});}}else{logger[_0x5e83('0xe')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':'set_entry','input_type':_0x5e83('0x22'),'response_type':_0x5e83('0x22'),'rest_data':JSON[_0x5e83('0x29')]({'session':_0x200779['id'],'module_name':'Contacts','name_value_list':[{'name':_0x5e83('0x3c'),'value':_0x9ab6eb!==''?_0x9ab6eb:util[_0x5e83('0x24')](_0x5e83('0x3d'),_0x14ff9a)},{'name':_0x5e83('0x3a'),'value':_0x14ff9a}]})}})[_0x5e83('0x30')](function(_0x382128){logger[_0x5e83('0xe')]('Enduser\x20created.');return BPromise[_0x5e83('0x35')]({'id':_0x382128['id'],'name':_0x382128[_0x5e83('0x31')]['first_name'][_0x5e83('0x34')],'phone':_0x382128[_0x5e83('0x31')][_0x5e83('0x3a')]['value']});});}});}function request(_0x400417){logger[_0x5e83('0x3e')]('[HTTP]',JSON[_0x5e83('0x29')](_0x400417));return rp(_[_0x5e83('0x3f')](def,_0x400417));}function getTags(_0x3d89b1,_0x35b146){var _0x4effc6=[];if(_0x3d89b1&&_0x3d89b1[_0x5e83('0x1d')]>0x0){_0x4effc6=_[_0x5e83('0x40')](_0x3d89b1,_0x35b146);}return _0x4effc6;}function getCustomFields(_0x13f077,_0x71750d){var _0x5731b1=[];var _0x5cbbfb={'custom_fields':[]};if(_0x13f077[_0x5e83('0x1d')]>0x0){_[_0x5e83('0x1e')](_0x13f077,function(_0x531fb6){if(_0x531fb6[_0x5e83('0x41')]===_0x5e83('0x42')&&_0x531fb6['nameField']&&!_0x531fb6[_0x5e83('0x43')]){_0x5cbbfb[_0x531fb6[_0x5e83('0x44')]['toLowerCase']()]=_0x531fb6['content'][_0x5e83('0x27')]();}else if(_0x531fb6[_0x5e83('0x41')]==='string'&&_0x531fb6[_0x5e83('0x45')]&&_0x531fb6[_0x5e83('0x43')]){_0x5cbbfb[_0x5e83('0x46')][_0x5e83('0x1f')]({'id':_0x531fb6[_0x5e83('0x45')],'value':_0x531fb6[_0x5e83('0x47')][_0x5e83('0x27')]()});}else if(_0x531fb6['type']==='variable'&&_0x531fb6[_0x5e83('0x20')]&&_0x531fb6[_0x5e83('0x45')]&&_0x531fb6[_0x5e83('0x43')]){_0x71750d[_0x531fb6[_0x5e83('0x20')]]&&_0x5cbbfb[_0x5e83('0x46')][_0x5e83('0x1f')]({'id':_0x531fb6[_0x5e83('0x45')],'value':_0x71750d[_0x531fb6[_0x5e83('0x20')]]['toString']()});}else if(_0x531fb6[_0x5e83('0x41')]===_0x5e83('0x48')&&_0x531fb6['Variable']&&_0x531fb6[_0x5e83('0x49')][_0x5e83('0x10')]&&_0x531fb6['idField']&&_0x531fb6['customField']){_0x71750d[_0x531fb6[_0x5e83('0x49')][_0x5e83('0x10')][_0x5e83('0x4a')]()]&&_0x5cbbfb[_0x5e83('0x46')][_0x5e83('0x1f')]({'id':_0x531fb6[_0x5e83('0x45')],'value':_0x71750d[_0x531fb6[_0x5e83('0x49')][_0x5e83('0x10')][_0x5e83('0x4a')]()]['toString']()});}});}return _0x5cbbfb;}function getConnection(_0x34eefd){return request({'method':_0x5e83('0xc'),'form':{'method':_0x5e83('0x4b'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x5e83('0x29')]({'user_auth':{'user_name':_0x34eefd[_0x5e83('0x4c')],'password':_0x34eefd[_0x5e83('0x4d')],'encryption':_0x5e83('0x4e')},'application':_0x5e83('0x4f')})}})[_0x5e83('0x30')](function(_0x115e00){var _0x2005c7=_0x115e00;if(_0x2005c7['id']){def[_0x5e83('0x50')]=_0x2005c7['id'];return BPromise[_0x5e83('0x35')](_0x2005c7);}else{throw new Error(util[_0x5e83('0x24')](_0x5e83('0x51'),_0x34eefd['id']));}});}function setRelationship(_0x35f6f4,_0x21b82d,_0x382742,_0xed196a){return request({'form':{'method':_0x5e83('0x52'),'input_type':_0x5e83('0x22'),'response_type':'JSON','rest_data':JSON[_0x5e83('0x29')]({'session':_0x35f6f4['id'],'module_name':_0x5e83('0x23'),'module_id':_0x382742['id'],'link_field_name':_0xed196a,'related_ids':[_0x21b82d['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x5e83('0x53')]=function(_0x54233f,_0x19f599,_0x4075ed,_0x55adea,_0xf9f8ba,_0x44e07f){var _0x47033e,_0x39d0fd,_0x1c9c58,_0x1597f1;_0x44e07f[_0x5e83('0x54')]=intUtil[_0x5e83('0x55')](_0x44e07f['remoteUri']);_0x44e07f[_0x5e83('0x56')]=intUtil[_0x5e83('0x55')](_0x44e07f['serverUrl']);def[_0x5e83('0x57')]=util[_0x5e83('0x24')]('%s/service/v4_1/rest.php',_0x44e07f[_0x5e83('0x54')]);if(_0xf9f8ba&&_0xf9f8ba['monitor_format']){logger[_0x5e83('0xe')]('[QUEUE]','Recording\x20is\x20enabled!');_0x19f599[_0x5e83('0x58')]=util[_0x5e83('0x24')](_0x5e83('0x59'),_0x44e07f['serverUrl'],_0x19f599[_0x5e83('0x5a')],md5(_0x19f599[_0x5e83('0x5a')]));}else{_0x19f599['recordingURL']='';}return getConnection(_0x44e07f)[_0x5e83('0x30')](function(_0x445391){_0x1597f1=_0x445391;return getUser(_0x44e07f,_0x55adea['name'],_0x1597f1);})[_0x5e83('0x30')](function(_0x2c90f){_0x47033e=_0x2c90f;logger[_0x5e83('0xe')](_0x5e83('0x5b'),_0x47033e['id']);return getEndUser(_0x44e07f,_0x19f599[_0x5e83('0x5c')],_0x19f599[_0x5e83('0x5d')],_0x1597f1);})['then'](function(_0x5b29ac){_0x39d0fd=_0x5b29ac;logger['info'](_0x5e83('0x5e'),_0x39d0fd['id']);return getTicket(_0x44e07f,_0x47033e,_0x39d0fd,_0x4075ed,_0x19f599,_0x4075ed[_0x5e83('0x5f')],_0x1597f1,'Inbound');})[_0x5e83('0x30')](function(_0x5f020d){_0x1c9c58=_0x5f020d;logger['info'](_0x5e83('0x60'));logger[_0x5e83('0xe')](_0x5e83('0x61'),_0x1c9c58['id']);return setRelationship(_0x1597f1,_0x47033e,_0x1c9c58,_0x5e83('0x62'));})[_0x5e83('0x30')](function(){return setRelationship(_0x1597f1,_0x39d0fd,_0x1c9c58,_0x5e83('0x63'));})[_0x5e83('0x30')](function(){return getServerInfo(_0x1597f1);})[_0x5e83('0x30')](function(_0x4ecce0){var _0x5b8300=parseInt(_0x4ecce0[_0x5e83('0x64')][_0x5e83('0x65')](0x0));var _0x164318=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x44e07f[_0x5e83('0x54')],_0x1c9c58['id']);if(_0x5b8300>0x6){_0x164318=util['format']('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x44e07f[_0x5e83('0x54')],_0x1c9c58['id']);}logger[_0x5e83('0xe')](_0x5e83('0x66'),_0x5e83('0x67'));emit(util['format'](_0x5e83('0x68'),_0x55adea[_0x5e83('0x10')]),_0x5e83('0x69'),{'uri':_0x164318});})['catch'](function(_0x274e3c){logger[_0x5e83('0x6a')](_0x5e83('0x66'),JSON['stringify'](_0x274e3c));});};exports[_0x5e83('0x6b')]=function(_0x3b0892,_0x85738c,_0x10ecb9,_0x15a7db,_0x3dfc48,_0x388c42,_0x266b9a){var _0x3475dd,_0x4c6bee,_0x4881c8,_0xe6f44b;_0x388c42['remoteUri']=intUtil[_0x5e83('0x55')](_0x388c42[_0x5e83('0x54')]);_0x388c42[_0x5e83('0x56')]=intUtil[_0x5e83('0x55')](_0x388c42[_0x5e83('0x56')]);def[_0x5e83('0x57')]=util[_0x5e83('0x24')]('%s/service/v4_1/rest.php',_0x388c42[_0x5e83('0x54')]);if(_0x266b9a&&_0x266b9a[_0x5e83('0x6c')]&&_0x266b9a[_0x5e83('0x6c')]!==_0x5e83('0x6d')){logger[_0x5e83('0xe')]('[OUTBOUND]',_0x5e83('0x6e'));_0x85738c['recordingURL']=util[_0x5e83('0x24')](_0x5e83('0x59'),_0x388c42['serverUrl'],_0x85738c[_0x5e83('0x5a')],md5(_0x85738c[_0x5e83('0x5a')]));}return getConnection(_0x388c42)['then'](function(_0x204c90){_0xe6f44b=_0x204c90;return getUser(_0x388c42,_0x15a7db[_0x5e83('0x10')],_0xe6f44b);})[_0x5e83('0x30')](function(_0xbeae9f){_0x3475dd=_0xbeae9f;logger['info'](_0x5e83('0x5b'),_0x3475dd['id']);return getEndUser(_0x388c42,_0x85738c[_0x5e83('0x6f')],_0x85738c[_0x5e83('0x70')],_0xe6f44b);})[_0x5e83('0x30')](function(_0x1757c4){_0x4c6bee=_0x1757c4;logger[_0x5e83('0xe')]('The\x20Enduser\x20ID\x20is:',_0x4c6bee['id']);return getTicket(_0x388c42,_0x3475dd,_0x4c6bee,_0x10ecb9,_0x85738c,_0x10ecb9[_0x5e83('0x5f')],_0xe6f44b,_0x5e83('0x71'));})[_0x5e83('0x30')](function(_0x56f587){_0x4881c8=_0x56f587;logger[_0x5e83('0xe')](_0x5e83('0x60'));logger[_0x5e83('0xe')](_0x5e83('0x61'),_0x4881c8['id']);return setRelationship(_0xe6f44b,_0x3475dd,_0x4881c8,_0x5e83('0x62'));})[_0x5e83('0x30')](function(){return setRelationship(_0xe6f44b,_0x4c6bee,_0x4881c8,_0x5e83('0x63'));})[_0x5e83('0x30')](function(){return getServerInfo(_0xe6f44b);})[_0x5e83('0x30')](function(_0x5ba2e5){var _0x4fb396=parseInt(_0x5ba2e5[_0x5e83('0x64')][_0x5e83('0x65')](0x0));var _0x4cb1f5=util[_0x5e83('0x24')](_0x5e83('0x72'),_0x388c42[_0x5e83('0x54')],_0x4881c8['id']);if(_0x4fb396>0x6){_0x4cb1f5=util[_0x5e83('0x24')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x388c42[_0x5e83('0x54')],_0x4881c8['id']);}logger[_0x5e83('0xe')](_0x5e83('0x73'),_0x5e83('0x67'));emit(util[_0x5e83('0x24')](_0x5e83('0x68'),_0x15a7db['name']),_0x5e83('0x69'),{'uri':_0x4cb1f5});})[_0x5e83('0x74')](function(_0x4b9648){logger['error'](_0x5e83('0x73'),JSON[_0x5e83('0x29')](_0x4b9648));});};exports[_0x5e83('0x75')]=function(_0x960bd,_0x8b9636,_0x298b77,_0x1f6464,_0x15a7f6,_0x37e484){var _0x1cb5e8,_0x5119e9,_0xefa80c,_0x3e1f1e;_0x37e484[_0x5e83('0x54')]=intUtil[_0x5e83('0x55')](_0x37e484[_0x5e83('0x54')]);_0x37e484[_0x5e83('0x56')]=intUtil['stripTrailingSlash'](_0x37e484[_0x5e83('0x56')]);def[_0x5e83('0x57')]=util[_0x5e83('0x24')]('%s/service/v4_1/rest.php',_0x37e484[_0x5e83('0x54')]);if(_0x15a7f6&&_0x15a7f6['monitor_format']){logger[_0x5e83('0xe')]('['+_0x8b9636[_0x5e83('0x76')][_0x5e83('0x77')]()+']',_0x5e83('0x6e'));_0x8b9636['recordingURL']=util[_0x5e83('0x24')](_0x5e83('0x59'),_0x37e484[_0x5e83('0x56')],_0x8b9636[_0x5e83('0x5a')],md5(_0x8b9636[_0x5e83('0x5a')]));}else{_0x8b9636[_0x5e83('0x58')]='';}return getConnection(_0x37e484)[_0x5e83('0x30')](function(_0x217716){_0x3e1f1e=_0x217716;if(!_['isNil'](_0x1f6464)){return getUser(_0x37e484,_0x1f6464['name'],_0x3e1f1e);}else{return getUser(_0x37e484,null,_0x3e1f1e);}})[_0x5e83('0x30')](function(_0x29549a){_0x1cb5e8=_0x29549a;logger[_0x5e83('0xe')](_0x5e83('0x5b'),_0x1cb5e8['id']);return getEndUser(_0x37e484,_0x8b9636[_0x5e83('0x5c')],_0x8b9636[_0x5e83('0x5d')],_0x3e1f1e);})[_0x5e83('0x30')](function(_0x2dd8a1){_0x5119e9=_0x2dd8a1;logger[_0x5e83('0xe')](_0x5e83('0x5e'),_0x5119e9['id']);return getTicket(_0x37e484,_0x1cb5e8,_0x5119e9,_0x298b77,_0x8b9636,_0x298b77[_0x5e83('0x5f')],_0x3e1f1e,_0x5e83('0x78'));})['then'](function(_0x11d419){_0xefa80c=_0x11d419;logger['info'](_0x5e83('0x60'));logger[_0x5e83('0xe')](_0x5e83('0x61'),_0xefa80c['id']);return setRelationship(_0x3e1f1e,_0x1cb5e8,_0xefa80c,_0x5e83('0x62'));})[_0x5e83('0x30')](function(){return setRelationship(_0x3e1f1e,_0x5119e9,_0xefa80c,_0x5e83('0x63'));})[_0x5e83('0x30')](function(){return getServerInfo(_0x3e1f1e);})['catch'](function(_0x35f45d){logger[_0x5e83('0x6a')]('['+_0x8b9636[_0x5e83('0x76')]['toUpperCase']()+']',JSON[_0x5e83('0x29')](_0x35f45d));});}; \ 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 a180c12..12059d0 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 _0xc846=['variable','join','stripTrailingSlash','util','getString','length','type','string','push','content','variableName','toString','customVariable','Variable','toLowerCase','name','keyValue','key','format','%s:\x20%s','keyType'];(function(_0x49538b,_0x263730){var _0x2caab1=function(_0x31d2d2){while(--_0x31d2d2){_0x49538b['push'](_0x49538b['shift']());}};_0x2caab1(++_0x263730);}(_0xc846,0xab));var _0x6c84=function(_0x417790,_0x2ef4c3){_0x417790=_0x417790-0x0;var _0x2fc2b0=_0xc846[_0x417790];return _0x2fc2b0;};'use strict';var _=require('lodash');var util=require(_0x6c84('0x0'));exports[_0x6c84('0x1')]=function(_0x2e45da,_0x4826c3,_0x2c8f6f){var _0x265548=[];if(_0x2e45da['length']>0x0){var _0x29f1d8=_['sortBy'](_0x2e45da,['id']);for(var _0x33c1dc=0x0;_0x33c1dc<_0x29f1d8[_0x6c84('0x2')];_0x33c1dc++){var _0xf0edb9=_0x29f1d8[_0x33c1dc];if(_0xf0edb9[_0x6c84('0x3')]===_0x6c84('0x4')){_0x265548[_0x6c84('0x5')](_0xf0edb9[_0x6c84('0x6')]);}else if(_0xf0edb9['type']==='variable'&&_0xf0edb9[_0x6c84('0x7')]){_0x4826c3[_0xf0edb9[_0x6c84('0x7')]]&&_0x265548[_0x6c84('0x5')](_0x4826c3[_0xf0edb9[_0x6c84('0x7')]][_0x6c84('0x8')]());}else if(_0xf0edb9['type']===_0x6c84('0x9')&&_0xf0edb9['Variable']&&_0xf0edb9[_0x6c84('0xa')]['name']){_0x4826c3[_0xf0edb9[_0x6c84('0xa')]['name'][_0x6c84('0xb')]()]&&_0x265548[_0x6c84('0x5')](_0x4826c3[_0xf0edb9[_0x6c84('0xa')][_0x6c84('0xc')][_0x6c84('0xb')]()]['toString']());}else if(_0xf0edb9['type']===_0x6c84('0xd')){if(_0xf0edb9['keyType']===_0x6c84('0x4')&&_0xf0edb9[_0x6c84('0xe')]){_0x265548['push'](util[_0x6c84('0xf')](_0x6c84('0x10'),_0xf0edb9[_0x6c84('0xe')],_0xf0edb9['keyContent']));}else if(_0xf0edb9[_0x6c84('0x11')]===_0x6c84('0x12')&&_0xf0edb9[_0x6c84('0x7')]&&_0xf0edb9[_0x6c84('0xe')]){_0x4826c3[_0xf0edb9[_0x6c84('0x7')]]&&_0x265548[_0x6c84('0x5')](util[_0x6c84('0xf')](_0x6c84('0x10'),_0xf0edb9[_0x6c84('0xe')],_0x4826c3[_0xf0edb9[_0x6c84('0x7')]]));}else if(_0xf0edb9[_0x6c84('0x11')]===_0x6c84('0x9')&&_0xf0edb9[_0x6c84('0xa')]&&_0xf0edb9[_0x6c84('0xa')]['name']&&_0xf0edb9['key']){_0x4826c3[_0xf0edb9[_0x6c84('0xa')]['name']['toLowerCase']()]&&_0x265548['push'](util[_0x6c84('0xf')]('%s:\x20%s',_0xf0edb9[_0x6c84('0xe')],_0x4826c3[_0xf0edb9['Variable'][_0x6c84('0xc')][_0x6c84('0xb')]()]));}}}}return _0x265548[_0x6c84('0x13')](_0x2c8f6f);};exports[_0x6c84('0x14')]=function(_0x44f1ba){var _0x34149c=_0x44f1ba['slice'](-0x1);if(_0x34149c==='/'){_0x44f1ba=_0x44f1ba['substring'](0x0,_0x44f1ba['lastIndexOf'](_0x34149c));}return _0x44f1ba;};exports['validateEmail']=function(_0x1d55d2){if(!_['isNil'](_0x1d55d2)&&_0x1d55d2!==''){var _0x1788b6=/^(([^<>()\[\]\\.,;:\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 _0x1788b6['test'](String(_0x1d55d2)[_0x6c84('0xb')]());}else{return![];}}; \ No newline at end of file +var _0xc4f8=['length','sortBy','type','string','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','%s:\x20%s','keyContent','format','stripTrailingSlash','substring','isNil','lodash'];(function(_0x4b96f8,_0x370b4d){var _0x668322=function(_0x5b316b){while(--_0x5b316b){_0x4b96f8['push'](_0x4b96f8['shift']());}};_0x668322(++_0x370b4d);}(_0xc4f8,0xe5));var _0x8c4f=function(_0x4d91ea,_0x25aa52){_0x4d91ea=_0x4d91ea-0x0;var _0x3b2f0a=_0xc4f8[_0x4d91ea];return _0x3b2f0a;};'use strict';var _=require(_0x8c4f('0x0'));var util=require('util');exports['getString']=function(_0x38e71f,_0x23db8b,_0x23ab47){var _0x15048d=[];if(_0x38e71f[_0x8c4f('0x1')]>0x0){var _0x4e9683=_[_0x8c4f('0x2')](_0x38e71f,['id']);for(var _0x1a6941=0x0;_0x1a6941<_0x4e9683[_0x8c4f('0x1')];_0x1a6941++){var _0x153ba8=_0x4e9683[_0x1a6941];if(_0x153ba8[_0x8c4f('0x3')]===_0x8c4f('0x4')){_0x15048d[_0x8c4f('0x5')](_0x153ba8[_0x8c4f('0x6')]);}else if(_0x153ba8[_0x8c4f('0x3')]===_0x8c4f('0x7')&&_0x153ba8[_0x8c4f('0x8')]){_0x23db8b[_0x153ba8[_0x8c4f('0x8')]]&&_0x15048d[_0x8c4f('0x5')](_0x23db8b[_0x153ba8[_0x8c4f('0x8')]][_0x8c4f('0x9')]());}else if(_0x153ba8[_0x8c4f('0x3')]===_0x8c4f('0xa')&&_0x153ba8[_0x8c4f('0xb')]&&_0x153ba8[_0x8c4f('0xb')]['name']){_0x23db8b[_0x153ba8['Variable'][_0x8c4f('0xc')][_0x8c4f('0xd')]()]&&_0x15048d[_0x8c4f('0x5')](_0x23db8b[_0x153ba8[_0x8c4f('0xb')][_0x8c4f('0xc')][_0x8c4f('0xd')]()][_0x8c4f('0x9')]());}else if(_0x153ba8[_0x8c4f('0x3')]===_0x8c4f('0xe')){if(_0x153ba8[_0x8c4f('0xf')]==='string'&&_0x153ba8[_0x8c4f('0x10')]){_0x15048d[_0x8c4f('0x5')](util['format'](_0x8c4f('0x11'),_0x153ba8[_0x8c4f('0x10')],_0x153ba8[_0x8c4f('0x12')]));}else if(_0x153ba8['keyType']==='variable'&&_0x153ba8['variableName']&&_0x153ba8[_0x8c4f('0x10')]){_0x23db8b[_0x153ba8['variableName']]&&_0x15048d['push'](util[_0x8c4f('0x13')]('%s:\x20%s',_0x153ba8[_0x8c4f('0x10')],_0x23db8b[_0x153ba8[_0x8c4f('0x8')]]));}else if(_0x153ba8['keyType']===_0x8c4f('0xa')&&_0x153ba8['Variable']&&_0x153ba8[_0x8c4f('0xb')]['name']&&_0x153ba8[_0x8c4f('0x10')]){_0x23db8b[_0x153ba8['Variable'][_0x8c4f('0xc')][_0x8c4f('0xd')]()]&&_0x15048d[_0x8c4f('0x5')](util[_0x8c4f('0x13')]('%s:\x20%s',_0x153ba8[_0x8c4f('0x10')],_0x23db8b[_0x153ba8[_0x8c4f('0xb')][_0x8c4f('0xc')]['toLowerCase']()]));}}}}return _0x15048d['join'](_0x23ab47);};exports[_0x8c4f('0x14')]=function(_0x5d5ce7){var _0xe0e471=_0x5d5ce7['slice'](-0x1);if(_0xe0e471==='/'){_0x5d5ce7=_0x5d5ce7[_0x8c4f('0x15')](0x0,_0x5d5ce7['lastIndexOf'](_0xe0e471));}return _0x5d5ce7;};exports['validateEmail']=function(_0x20c3e3){if(!_[_0x8c4f('0x16')](_0x20c3e3)&&_0x20c3e3!==''){var _0x3b749c=/^(([^<>()\[\]\\.,;:\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 _0x3b749c['test'](String(_0x20c3e3)['toLowerCase']());}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 0b12103..9d7b131 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 _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x38599d,_0x1f66c0){var _0x36a48f=function(_0x1833eb){while(--_0x1833eb){_0x38599d['push'](_0x38599d['shift']());}};_0x36a48f(++_0x1f66c0);}(_0x9c44,0x178));var _0x49c4=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x9c44[_0x1694f5];return _0x5b4321;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file +var _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(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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 109435a..c7d2ef1 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 _0x5728=['The\x20User\x20ID\x20is:','calleridnum','The\x20Ticket\x20ID\x20is:','%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','inspect','outbound','recordingFormat','none','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent...','user:%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','toUpperCase','calleridname','lastevent','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','defaults','redis','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','format','POST','merge','getString','Subjects','Descriptions','Fields','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','then','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','results','length','filter','end-user','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Enduser\x20created.','authType','username','password','%s/token:%s','token','toString','base64','debug','[HTTP]','stringify','GET','forEach','includes','string','type','nameField','customField','content','picklist','idField','custom_fields','push','variable','variableName','Variable','name','toLowerCase','queue','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email'];(function(_0x367213,_0x573cf8){var _0x394c2e=function(_0x4babf2){while(--_0x4babf2){_0x367213['push'](_0x367213['shift']());}};_0x394c2e(++_0x573cf8);}(_0x5728,0x16d));var _0x8572=function(_0x3953ec,_0x5467b0){_0x3953ec=_0x3953ec-0x0;var _0x29f860=_0x5728[_0x3953ec];return _0x29f860;};'use strict';var _=require(_0x8572('0x0'));var rp=require(_0x8572('0x1'));var md5=require(_0x8572('0x2'));var util=require('util');var Redis=require(_0x8572('0x3'));var intUtil=require(_0x8572('0x4'));var config=require(_0x8572('0x5'));var logger=require(_0x8572('0x6'))(_0x8572('0x7'));config['redis']=_[_0x8572('0x8')](config[_0x8572('0x9')],{'host':_0x8572('0xa'),'port':0x18eb});var io=require(_0x8572('0xb'))(new Redis(config[_0x8572('0x9')]));function emit(_0x4b5745,_0x18f5f3,_0x1aba3f){io['to'](_0x4b5745)['emit'](_0x18f5f3,_0x1aba3f);}var headers={'Content-Type':_0x8572('0xc'),'Accept':'application/json'};function getTicket(_0x8e4507,_0x5ac952,_0x326759,_0x3ac457,_0x3def45){logger[_0x8572('0xd')](_0x8572('0xe'));return request({'uri':util[_0x8572('0xf')]('%s/tickets.json',_0x8e4507['remoteUri']),'method':_0x8572('0x10'),'body':{'ticket':_[_0x8572('0x11')]({'requester_id':_0x326759['id'],'submitter_id':_0x5ac952?_0x5ac952['id']:undefined,'assignee_id':_0x5ac952?_0x5ac952['id']:undefined,'tags':getTags(_0x3ac457['Tags'],'name'),'subject':intUtil[_0x8572('0x12')](_0x3ac457[_0x8572('0x13')],_0x3def45,'\x20'),'description':intUtil[_0x8572('0x12')](_0x3ac457[_0x8572('0x14')],_0x3def45,'\x0a'),'comment':{'public':![],'body':intUtil[_0x8572('0x12')](_0x3ac457[_0x8572('0x14')],_0x3def45,'\x0a')}},getCustomFields(_0x3ac457[_0x8572('0x15')],_0x3def45))}})['then'](function(_0x5db25a){logger[_0x8572('0xd')](_0x8572('0x16'));return _0x5db25a[_0x8572('0x17')];});}function getUser(_0x54ac26,_0x1071c9){if(intUtil[_0x8572('0x18')](_0x1071c9)){logger[_0x8572('0xd')](_0x8572('0x19'),_0x1071c9);return request({'uri':util['format'](_0x8572('0x1a'),_0x54ac26[_0x8572('0x1b')]),'qs':{'query':util['format'](_0x8572('0x1c'),_0x1071c9)}})[_0x8572('0x1d')](function(_0xa3506f){if(_0xa3506f['count']){logger[_0x8572('0xd')]('Agent\x20found!');return _[_0x8572('0x1e')](_0xa3506f['results'],{'email':_0x1071c9,'role':_0x8572('0x1f')});}else{logger[_0x8572('0xd')](_0x8572('0x20'));return request({'uri':util['format'](_0x8572('0x21'),_0x54ac26[_0x8572('0x1b')])})[_0x8572('0x1d')](function(_0x161935){logger[_0x8572('0xd')](_0x8572('0x22'));return _0x161935[_0x8572('0x23')];});}});}else{logger[_0x8572('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x8572('0xf')](_0x8572('0x21'),_0x54ac26[_0x8572('0x1b')])})[_0x8572('0x1d')](function(_0xd76d7d){logger['info'](_0x8572('0x22'));return _0xd76d7d['user'];});}}function getEndUser(_0x4e940f,_0x2a28d9,_0x35b688){logger[_0x8572('0xd')](_0x8572('0x24'),_0x35b688);return request({'uri':util[_0x8572('0xf')](_0x8572('0x1a'),_0x4e940f[_0x8572('0x1b')]),'qs':{'query':util[_0x8572('0xf')](_0x8572('0x25'),_0x35b688)}})[_0x8572('0x1d')](function(_0x462052){var _0x562739;if(_0x462052[_0x8572('0x26')][_0x8572('0x27')]){_0x462052[_0x8572('0x26')]=_[_0x8572('0x28')](_0x462052[_0x8572('0x26')],{'suspended':![],'role':_0x8572('0x29')});if(_0x462052[_0x8572('0x26')][_0x8572('0x27')]){_0x562739=_['first'](_0x462052[_0x8572('0x26')]);}}if(_0x562739){logger[_0x8572('0xd')](_0x8572('0x2a'));return _0x562739;}else{logger['info'](_0x8572('0x2b'));return request({'uri':util['format'](_0x8572('0x2c'),_0x4e940f['remoteUri']),'method':_0x8572('0x10'),'body':{'user':{'role':_0x8572('0x29'),'name':util[_0x8572('0xf')]('Caller\x20-\x20%s',_0x2a28d9||_0x35b688),'phone':_0x35b688}}})[_0x8572('0x1d')](function(_0x822247){logger[_0x8572('0xd')](_0x8572('0x2d'));return _0x822247[_0x8572('0x23')];});}});}function getAuth(_0x471717){var _0x540a45;if(_0x471717[_0x8572('0x2e')]==='password'){_0x540a45=util['format']('%s:%s',_0x471717[_0x8572('0x2f')],_0x471717[_0x8572('0x30')]);}else if(_0x471717['authType']==='token'){_0x540a45=util[_0x8572('0xf')](_0x8572('0x31'),_0x471717['username'],_0x471717[_0x8572('0x32')]);}return util[_0x8572('0xf')]('Basic\x20%s',new Buffer(_0x540a45)[_0x8572('0x33')](_0x8572('0x34')));}function request(_0xc28982){logger[_0x8572('0x35')](_0x8572('0x36'),JSON[_0x8572('0x37')](_0xc28982));return rp(_[_0x8572('0x8')](_0xc28982,{'method':_0x8572('0x38'),'headers':headers,'json':!![]}));}function getTags(_0x579a05,_0x254224){var _0x2b32bf=[];if(_0x579a05&&_0x579a05['length']>0x0){_0x2b32bf=_['map'](_0x579a05,_0x254224);}return _0x2b32bf;}function getCustomFields(_0x27e566,_0x16e4c9){var _0x5d308e=[];var _0x460054={'custom_fields':[]};if(_0x27e566[_0x8572('0x27')]>0x0){_[_0x8572('0x39')](_0x27e566,function(_0x3ab985){if(_[_0x8572('0x3a')]([_0x8572('0x3b'),'picklist'],_0x3ab985[_0x8572('0x3c')])&&_0x3ab985[_0x8572('0x3d')]&&!_0x3ab985[_0x8572('0x3e')]){_0x460054[_0x3ab985[_0x8572('0x3d')]['toLowerCase']()]=_0x3ab985[_0x8572('0x3f')]['toString']();}else if(_[_0x8572('0x3a')]([_0x8572('0x3b'),_0x8572('0x40')],_0x3ab985[_0x8572('0x3c')])&&_0x3ab985[_0x8572('0x41')]&&_0x3ab985['customField']){_0x460054[_0x8572('0x42')][_0x8572('0x43')]({'id':_0x3ab985[_0x8572('0x41')],'value':_0x3ab985[_0x8572('0x3f')][_0x8572('0x33')]()});}else if(_0x3ab985[_0x8572('0x3c')]===_0x8572('0x44')&&_0x3ab985[_0x8572('0x45')]&&_0x3ab985[_0x8572('0x41')]&&_0x3ab985[_0x8572('0x3e')]){_0x16e4c9[_0x3ab985[_0x8572('0x45')]]&&_0x460054[_0x8572('0x42')][_0x8572('0x43')]({'id':_0x3ab985[_0x8572('0x41')],'value':_0x16e4c9[_0x3ab985[_0x8572('0x45')]][_0x8572('0x33')]()});}else if(_0x3ab985[_0x8572('0x3c')]==='customVariable'&&_0x3ab985[_0x8572('0x46')]&&_0x3ab985['Variable'][_0x8572('0x47')]&&_0x3ab985[_0x8572('0x41')]&&_0x3ab985[_0x8572('0x3e')]){_0x16e4c9[_0x3ab985[_0x8572('0x46')][_0x8572('0x47')]['toLowerCase']()]&&_0x460054[_0x8572('0x42')][_0x8572('0x43')]({'id':_0x3ab985[_0x8572('0x41')],'value':_0x16e4c9[_0x3ab985[_0x8572('0x46')]['name'][_0x8572('0x48')]()][_0x8572('0x33')]()});}});}return _0x460054;}exports[_0x8572('0x49')]=function(_0x991c96,_0x53826a,_0x259c12,_0x14b577,_0x25f3b2,_0x3ec4da){var _0x4f5446,_0x5d84dc;_0x3ec4da['remoteUri']=intUtil['stripTrailingSlash'](_0x3ec4da[_0x8572('0x1b')]);_0x3ec4da[_0x8572('0x4a')]=intUtil[_0x8572('0x4b')](_0x3ec4da[_0x8572('0x4a')]);if(_0x25f3b2&&_0x25f3b2['monitor_format']){logger['info'](_0x8572('0x4c'),_0x8572('0x4d'));_0x53826a[_0x8572('0x4e')]=util[_0x8572('0xf')](_0x8572('0x4f'),_0x3ec4da[_0x8572('0x4a')],_0x53826a[_0x8572('0x50')],md5(_0x53826a[_0x8572('0x50')]));}else{_0x53826a[_0x8572('0x4e')]='';}headers[_0x8572('0x51')]=getAuth(_0x3ec4da);return getUser(_0x3ec4da,_0x14b577[_0x8572('0x52')])[_0x8572('0x1d')](function(_0x162f84){_0x4f5446=_0x162f84;logger[_0x8572('0xd')](_0x8572('0x53'),_0x4f5446['id']);return getEndUser(_0x3ec4da,_0x53826a['calleridname'],_0x53826a[_0x8572('0x54')]);})[_0x8572('0x1d')](function(_0x1778ff){_0x5d84dc=_0x1778ff;logger[_0x8572('0xd')]('The\x20Enduser\x20ID\x20is:',_0x5d84dc['id']);return getTicket(_0x3ec4da,_0x4f5446,_0x5d84dc,_0x259c12,_0x53826a);})[_0x8572('0x1d')](function(_0xfb7885){if(_0xfb7885){logger[_0x8572('0xd')](_0x8572('0x55'),_0xfb7885['id']);switch(_0x3ec4da[_0x8572('0x3c')]){case'integrationTab':logger[_0x8572('0xd')](_0x8572('0x4c'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x8572('0xf')](_0x8572('0x56'),_0x3ec4da[_0x8572('0x1b')],_0x4f5446['id'],_0xfb7885['id']),'method':_0x8572('0x10')});case _0x8572('0x57'):logger['info']('[QUEUE]',_0x8572('0x58'));emit(util[_0x8572('0xf')]('user:%s',_0x14b577['name']),_0x8572('0x59'),{'uri':util[_0x8572('0xf')](_0x8572('0x5a'),_0x3ec4da[_0x8572('0x1b')][_0x8572('0x5b')](_0x8572('0x5c'),''),_0xfb7885['id'])});break;default:logger[_0x8572('0x5d')](_0x8572('0x4c'),_0x8572('0x5e'));}}})[_0x8572('0x5f')](function(_0x1a9e4b){logger['error']('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0x8572('0x60')](_0x1a9e4b,{'showHidden':!![],'depth':null}));});};exports[_0x8572('0x61')]=function(_0x3dd415,_0x1c2d7e,_0x47312d,_0x59a8dc,_0x8eb4e3,_0x41833a,_0x439b5b){var _0x57de88,_0x24624e;_0x41833a[_0x8572('0x1b')]=intUtil[_0x8572('0x4b')](_0x41833a[_0x8572('0x1b')]);_0x41833a['serverUrl']=intUtil[_0x8572('0x4b')](_0x41833a[_0x8572('0x4a')]);if(_0x439b5b&&_0x439b5b[_0x8572('0x62')]&&_0x439b5b[_0x8572('0x62')]!==_0x8572('0x63')){logger[_0x8572('0xd')]('[OUTBOUND]',_0x8572('0x4d'));_0x1c2d7e['recordingURL']=util[_0x8572('0xf')](_0x8572('0x4f'),_0x41833a['serverUrl'],_0x1c2d7e['uniqueid'],md5(_0x1c2d7e[_0x8572('0x50')]));}headers[_0x8572('0x51')]=getAuth(_0x41833a);return getUser(_0x41833a,_0x59a8dc[_0x8572('0x52')])[_0x8572('0x1d')](function(_0x1e84ca){_0x57de88=_0x1e84ca;logger[_0x8572('0xd')](_0x8572('0x53'),_0x57de88['id']);return getEndUser(_0x41833a,_0x1c2d7e[_0x8572('0x64')],_0x1c2d7e[_0x8572('0x65')]);})[_0x8572('0x1d')](function(_0x506186){_0x24624e=_0x506186;logger['info'](_0x8572('0x66'),_0x24624e['id']);return getTicket(_0x41833a,_0x57de88,_0x24624e,_0x47312d,_0x1c2d7e);})['then'](function(_0x528123){if(_0x528123){logger[_0x8572('0xd')](_0x8572('0x55'),_0x528123['id']);switch(_0x41833a[_0x8572('0x3c')]){case'integrationTab':logger[_0x8572('0xd')](_0x8572('0x67'),_0x8572('0x68'));return request({'uri':util[_0x8572('0xf')](_0x8572('0x56'),_0x41833a['remoteUri'],_0x57de88['id'],_0x528123['id']),'method':_0x8572('0x10')});case _0x8572('0x57'):logger[_0x8572('0xd')]('[OUTBOUND]',_0x8572('0x58'));emit(util[_0x8572('0xf')](_0x8572('0x69'),_0x59a8dc['name']),_0x8572('0x59'),{'uri':util[_0x8572('0xf')]('%s/agent/tickets/%s',_0x41833a['remoteUri'][_0x8572('0x5b')](_0x8572('0x5c'),''),_0x528123['id'])});break;default:logger['error'](_0x8572('0x67'),_0x8572('0x5e'));}}})[_0x8572('0x5f')](function(_0x49cb11){logger[_0x8572('0x5d')](_0x8572('0x6a'),util['inspect'](_0x49cb11,{'showHidden':!![],'depth':null}));});};exports[_0x8572('0x6b')]=function(_0x3a0dae,_0x127f36,_0x342b14,_0x10bfee,_0x555b85,_0x33549d){var _0x233013,_0x1398d7;_0x33549d['remoteUri']=intUtil[_0x8572('0x4b')](_0x33549d[_0x8572('0x1b')]);_0x33549d[_0x8572('0x4a')]=intUtil[_0x8572('0x4b')](_0x33549d[_0x8572('0x4a')]);if(_0x555b85&&_0x555b85['monitor_format']){logger['info']('['+_0x127f36['lastevent'][_0x8572('0x6c')]()+']',_0x8572('0x4d'));_0x127f36[_0x8572('0x4e')]=util[_0x8572('0xf')](_0x8572('0x4f'),_0x33549d[_0x8572('0x4a')],_0x127f36[_0x8572('0x50')],md5(_0x127f36[_0x8572('0x50')]));}else{_0x127f36['recordingURL']='';}headers['Authorization']=getAuth(_0x33549d);return getUser(_0x33549d)[_0x8572('0x1d')](function(_0x2f2d43){_0x233013=_0x2f2d43;logger[_0x8572('0xd')](_0x8572('0x53'),_0x233013['id']);return getEndUser(_0x33549d,_0x127f36[_0x8572('0x6d')],_0x127f36[_0x8572('0x54')]);})[_0x8572('0x1d')](function(_0x2999b0){_0x1398d7=_0x2999b0;logger[_0x8572('0xd')](_0x8572('0x66'),_0x1398d7['id']);return getTicket(_0x33549d,_0x233013,_0x1398d7,_0x342b14,_0x127f36);})[_0x8572('0x1d')](function(_0x49fd3c){if(_0x49fd3c){logger[_0x8572('0xd')](_0x8572('0x55'),_0x49fd3c['id']);}})[_0x8572('0x5f')](function(_0x3b1fb7){logger[_0x8572('0x5d')]('['+_0x127f36[_0x8572('0x6e')][_0x8572('0x6c')]()+']'+_0x8572('0x6f'),util['inspect'](_0x3b1fb7,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xe1de=['The\x20User\x20ID\x20is:','destcalleridnum','The\x20Enduser\x20ID\x20is:','%s/channels/voice/agents/%d/tickets/%d/display.json','replace','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','monitor_format','lastevent','toUpperCase','lodash','md5','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','application/json','info','Creating\x20new\x20ticket...','format','POST','merge','Tags','name','getString','Descriptions','then','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','%s/search.json','Agent\x20found!','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','remoteUri','user','length','results','filter','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','end-user','Enduser\x20created.','authType','password','token','Basic\x20%s','toString','base64','[HTTP]','stringify','GET','map','forEach','string','picklist','type','customField','nameField','toLowerCase','content','custom_fields','push','idField','variable','variableName','Variable','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','inspect','outbound','recordingFormat','none','[OUTBOUND]','Authorization'];(function(_0x5414ef,_0x1ef708){var _0x4e26c9=function(_0x4e695e){while(--_0x4e695e){_0x5414ef['push'](_0x5414ef['shift']());}};_0x4e26c9(++_0x1ef708);}(_0xe1de,0xd3));var _0xee1d=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0xe1de[_0x4f9b18];return _0x29f20c;};'use strict';var _=require(_0xee1d('0x0'));var rp=require('request-promise');var md5=require(_0xee1d('0x1'));var util=require('util');var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0xee1d('0x2'));var logger=require(_0xee1d('0x3'))(_0xee1d('0x4'));config[_0xee1d('0x5')]=_[_0xee1d('0x6')](config[_0xee1d('0x5')],{'host':_0xee1d('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xee1d('0x5')]));function emit(_0x34842d,_0x1b4c3d,_0x17af7b){io['to'](_0x34842d)['emit'](_0x1b4c3d,_0x17af7b);}var headers={'Content-Type':_0xee1d('0x8'),'Accept':'application/json'};function getTicket(_0x221193,_0xf306f0,_0x620ade,_0x1f5758,_0x1a99e3){logger[_0xee1d('0x9')](_0xee1d('0xa'));return request({'uri':util[_0xee1d('0xb')]('%s/tickets.json',_0x221193['remoteUri']),'method':_0xee1d('0xc'),'body':{'ticket':_[_0xee1d('0xd')]({'requester_id':_0x620ade['id'],'submitter_id':_0xf306f0?_0xf306f0['id']:undefined,'assignee_id':_0xf306f0?_0xf306f0['id']:undefined,'tags':getTags(_0x1f5758[_0xee1d('0xe')],_0xee1d('0xf')),'subject':intUtil[_0xee1d('0x10')](_0x1f5758['Subjects'],_0x1a99e3,'\x20'),'description':intUtil['getString'](_0x1f5758[_0xee1d('0x11')],_0x1a99e3,'\x0a'),'comment':{'public':![],'body':intUtil[_0xee1d('0x10')](_0x1f5758[_0xee1d('0x11')],_0x1a99e3,'\x0a')}},getCustomFields(_0x1f5758['Fields'],_0x1a99e3))}})[_0xee1d('0x12')](function(_0xb005d2){logger[_0xee1d('0x9')](_0xee1d('0x13'));return _0xb005d2[_0xee1d('0x14')];});}function getUser(_0x292259,_0x360617){if(intUtil['validateEmail'](_0x360617)){logger[_0xee1d('0x9')](_0xee1d('0x15'),_0x360617);return request({'uri':util[_0xee1d('0xb')](_0xee1d('0x16'),_0x292259['remoteUri']),'qs':{'query':util[_0xee1d('0xb')]('type:user\x20role:agent\x20email:%s',_0x360617)}})[_0xee1d('0x12')](function(_0x4df95c){if(_0x4df95c['count']){logger[_0xee1d('0x9')](_0xee1d('0x17'));return _[_0xee1d('0x18')](_0x4df95c['results'],{'email':_0x360617,'role':_0xee1d('0x19')});}else{logger[_0xee1d('0x9')](_0xee1d('0x1a'));return request({'uri':util[_0xee1d('0xb')](_0xee1d('0x1b'),_0x292259['remoteUri'])})[_0xee1d('0x12')](function(_0x1260a8){logger[_0xee1d('0x9')](_0xee1d('0x1c'));return _0x1260a8['user'];});}});}else{logger[_0xee1d('0x9')](_0xee1d('0x1a'));return request({'uri':util[_0xee1d('0xb')](_0xee1d('0x1b'),_0x292259[_0xee1d('0x1d')])})['then'](function(_0x3090d2){logger[_0xee1d('0x9')](_0xee1d('0x1c'));return _0x3090d2[_0xee1d('0x1e')];});}}function getEndUser(_0x323553,_0x1727ec,_0x8dd3d7){logger[_0xee1d('0x9')]('Searching\x20enduser\x20with\x20phone',_0x8dd3d7);return request({'uri':util[_0xee1d('0xb')]('%s/search.json',_0x323553['remoteUri']),'qs':{'query':util[_0xee1d('0xb')]('type:user\x20role:end-user\x20phone:%s',_0x8dd3d7)}})[_0xee1d('0x12')](function(_0x2948bb){var _0x5c6c7f;if(_0x2948bb['results'][_0xee1d('0x1f')]){_0x2948bb[_0xee1d('0x20')]=_[_0xee1d('0x21')](_0x2948bb[_0xee1d('0x20')],{'suspended':![],'role':'end-user'});if(_0x2948bb['results']['length']){_0x5c6c7f=_[_0xee1d('0x22')](_0x2948bb[_0xee1d('0x20')]);}}if(_0x5c6c7f){logger[_0xee1d('0x9')](_0xee1d('0x23'));return _0x5c6c7f;}else{logger[_0xee1d('0x9')](_0xee1d('0x24'));return request({'uri':util[_0xee1d('0xb')](_0xee1d('0x25'),_0x323553['remoteUri']),'method':_0xee1d('0xc'),'body':{'user':{'role':_0xee1d('0x26'),'name':util[_0xee1d('0xb')]('Caller\x20-\x20%s',_0x1727ec||_0x8dd3d7),'phone':_0x8dd3d7}}})[_0xee1d('0x12')](function(_0x27177b){logger[_0xee1d('0x9')](_0xee1d('0x27'));return _0x27177b[_0xee1d('0x1e')];});}});}function getAuth(_0x58bb19){var _0x546778;if(_0x58bb19[_0xee1d('0x28')]===_0xee1d('0x29')){_0x546778=util[_0xee1d('0xb')]('%s:%s',_0x58bb19['username'],_0x58bb19[_0xee1d('0x29')]);}else if(_0x58bb19[_0xee1d('0x28')]===_0xee1d('0x2a')){_0x546778=util[_0xee1d('0xb')]('%s/token:%s',_0x58bb19['username'],_0x58bb19[_0xee1d('0x2a')]);}return util[_0xee1d('0xb')](_0xee1d('0x2b'),new Buffer(_0x546778)[_0xee1d('0x2c')](_0xee1d('0x2d')));}function request(_0x1b7e66){logger['debug'](_0xee1d('0x2e'),JSON[_0xee1d('0x2f')](_0x1b7e66));return rp(_[_0xee1d('0x6')](_0x1b7e66,{'method':_0xee1d('0x30'),'headers':headers,'json':!![]}));}function getTags(_0x5dd358,_0x1c6ab6){var _0x560aeb=[];if(_0x5dd358&&_0x5dd358[_0xee1d('0x1f')]>0x0){_0x560aeb=_[_0xee1d('0x31')](_0x5dd358,_0x1c6ab6);}return _0x560aeb;}function getCustomFields(_0x510004,_0x5b3231){var _0x5bc033=[];var _0x7d20db={'custom_fields':[]};if(_0x510004[_0xee1d('0x1f')]>0x0){_[_0xee1d('0x32')](_0x510004,function(_0x584e78){if(_['includes']([_0xee1d('0x33'),_0xee1d('0x34')],_0x584e78[_0xee1d('0x35')])&&_0x584e78['nameField']&&!_0x584e78[_0xee1d('0x36')]){_0x7d20db[_0x584e78[_0xee1d('0x37')][_0xee1d('0x38')]()]=_0x584e78[_0xee1d('0x39')][_0xee1d('0x2c')]();}else if(_['includes'](['string','picklist'],_0x584e78[_0xee1d('0x35')])&&_0x584e78['idField']&&_0x584e78[_0xee1d('0x36')]){_0x7d20db[_0xee1d('0x3a')][_0xee1d('0x3b')]({'id':_0x584e78[_0xee1d('0x3c')],'value':_0x584e78[_0xee1d('0x39')][_0xee1d('0x2c')]()});}else if(_0x584e78[_0xee1d('0x35')]===_0xee1d('0x3d')&&_0x584e78[_0xee1d('0x3e')]&&_0x584e78['idField']&&_0x584e78['customField']){_0x5b3231[_0x584e78[_0xee1d('0x3e')]]&&_0x7d20db[_0xee1d('0x3a')][_0xee1d('0x3b')]({'id':_0x584e78[_0xee1d('0x3c')],'value':_0x5b3231[_0x584e78[_0xee1d('0x3e')]]['toString']()});}else if(_0x584e78[_0xee1d('0x35')]==='customVariable'&&_0x584e78[_0xee1d('0x3f')]&&_0x584e78[_0xee1d('0x3f')][_0xee1d('0xf')]&&_0x584e78[_0xee1d('0x3c')]&&_0x584e78[_0xee1d('0x36')]){_0x5b3231[_0x584e78['Variable'][_0xee1d('0xf')][_0xee1d('0x38')]()]&&_0x7d20db['custom_fields'][_0xee1d('0x3b')]({'id':_0x584e78[_0xee1d('0x3c')],'value':_0x5b3231[_0x584e78[_0xee1d('0x3f')]['name'][_0xee1d('0x38')]()][_0xee1d('0x2c')]()});}});}return _0x7d20db;}exports[_0xee1d('0x40')]=function(_0xd9e38e,_0x39bd98,_0xc37ed9,_0xbcb1a7,_0x115aaf,_0x346f57){var _0x13bac6,_0x552d2d;_0x346f57[_0xee1d('0x1d')]=intUtil[_0xee1d('0x41')](_0x346f57[_0xee1d('0x1d')]);_0x346f57[_0xee1d('0x42')]=intUtil['stripTrailingSlash'](_0x346f57[_0xee1d('0x42')]);if(_0x115aaf&&_0x115aaf['monitor_format']){logger[_0xee1d('0x9')](_0xee1d('0x43'),_0xee1d('0x44'));_0x39bd98[_0xee1d('0x45')]=util[_0xee1d('0xb')](_0xee1d('0x46'),_0x346f57[_0xee1d('0x42')],_0x39bd98[_0xee1d('0x47')],md5(_0x39bd98[_0xee1d('0x47')]));}else{_0x39bd98[_0xee1d('0x45')]='';}headers['Authorization']=getAuth(_0x346f57);return getUser(_0x346f57,_0xbcb1a7[_0xee1d('0x48')])[_0xee1d('0x12')](function(_0x4188f0){_0x13bac6=_0x4188f0;logger['info']('The\x20User\x20ID\x20is:',_0x13bac6['id']);return getEndUser(_0x346f57,_0x39bd98[_0xee1d('0x49')],_0x39bd98[_0xee1d('0x4a')]);})[_0xee1d('0x12')](function(_0x3807ec){_0x552d2d=_0x3807ec;logger[_0xee1d('0x9')]('The\x20Enduser\x20ID\x20is:',_0x552d2d['id']);return getTicket(_0x346f57,_0x13bac6,_0x552d2d,_0xc37ed9,_0x39bd98);})['then'](function(_0x4bc9a3){if(_0x4bc9a3){logger[_0xee1d('0x9')](_0xee1d('0x4b'),_0x4bc9a3['id']);switch(_0x346f57[_0xee1d('0x35')]){case _0xee1d('0x4c'):logger[_0xee1d('0x9')](_0xee1d('0x43'),_0xee1d('0x4d'));return request({'uri':util[_0xee1d('0xb')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x346f57[_0xee1d('0x1d')],_0x13bac6['id'],_0x4bc9a3['id']),'method':_0xee1d('0xc')});case'newTab':logger[_0xee1d('0x9')](_0xee1d('0x43'),_0xee1d('0x4e'));emit(util[_0xee1d('0xb')](_0xee1d('0x4f'),_0xbcb1a7[_0xee1d('0xf')]),_0xee1d('0x50'),{'uri':util[_0xee1d('0xb')](_0xee1d('0x51'),_0x346f57[_0xee1d('0x1d')]['replace'](_0xee1d('0x52'),''),_0x4bc9a3['id'])});break;default:logger[_0xee1d('0x53')](_0xee1d('0x43'),_0xee1d('0x54'));}}})[_0xee1d('0x55')](function(_0x1797b1){logger[_0xee1d('0x53')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0xee1d('0x56')](_0x1797b1,{'showHidden':!![],'depth':null}));});};exports[_0xee1d('0x57')]=function(_0x3c7183,_0x13ec17,_0x3caa3e,_0x2953a3,_0x6ead28,_0x566557,_0x38f430){var _0x274e9a,_0x14e09b;_0x566557[_0xee1d('0x1d')]=intUtil['stripTrailingSlash'](_0x566557[_0xee1d('0x1d')]);_0x566557[_0xee1d('0x42')]=intUtil[_0xee1d('0x41')](_0x566557[_0xee1d('0x42')]);if(_0x38f430&&_0x38f430['recordingFormat']&&_0x38f430[_0xee1d('0x58')]!==_0xee1d('0x59')){logger[_0xee1d('0x9')](_0xee1d('0x5a'),'Recording\x20is\x20enabled!');_0x13ec17[_0xee1d('0x45')]=util['format'](_0xee1d('0x46'),_0x566557[_0xee1d('0x42')],_0x13ec17[_0xee1d('0x47')],md5(_0x13ec17[_0xee1d('0x47')]));}headers[_0xee1d('0x5b')]=getAuth(_0x566557);return getUser(_0x566557,_0x2953a3[_0xee1d('0x48')])[_0xee1d('0x12')](function(_0x25a827){_0x274e9a=_0x25a827;logger['info'](_0xee1d('0x5c'),_0x274e9a['id']);return getEndUser(_0x566557,_0x13ec17['destcalleridname'],_0x13ec17[_0xee1d('0x5d')]);})['then'](function(_0x46b460){_0x14e09b=_0x46b460;logger[_0xee1d('0x9')](_0xee1d('0x5e'),_0x14e09b['id']);return getTicket(_0x566557,_0x274e9a,_0x14e09b,_0x3caa3e,_0x13ec17);})[_0xee1d('0x12')](function(_0x114344){if(_0x114344){logger[_0xee1d('0x9')](_0xee1d('0x4b'),_0x114344['id']);switch(_0x566557[_0xee1d('0x35')]){case _0xee1d('0x4c'):logger['info'](_0xee1d('0x5a'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xee1d('0xb')](_0xee1d('0x5f'),_0x566557[_0xee1d('0x1d')],_0x274e9a['id'],_0x114344['id']),'method':_0xee1d('0xc')});case'newTab':logger[_0xee1d('0x9')](_0xee1d('0x5a'),_0xee1d('0x4e'));emit(util[_0xee1d('0xb')](_0xee1d('0x4f'),_0x2953a3[_0xee1d('0xf')]),'trigger:browser:url',{'uri':util[_0xee1d('0xb')](_0xee1d('0x51'),_0x566557[_0xee1d('0x1d')][_0xee1d('0x60')](_0xee1d('0x52'),''),_0x114344['id'])});break;default:logger['error'](_0xee1d('0x5a'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xee1d('0x55')](function(_0x4e703b){logger[_0xee1d('0x53')](_0xee1d('0x61'),util[_0xee1d('0x56')](_0x4e703b,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x58a879,_0x3592e2,_0x44e1cf,_0x52282f,_0x36dac4,_0x201f9d){var _0x1cf3e0,_0x4f2777;_0x201f9d[_0xee1d('0x1d')]=intUtil[_0xee1d('0x41')](_0x201f9d[_0xee1d('0x1d')]);_0x201f9d[_0xee1d('0x42')]=intUtil[_0xee1d('0x41')](_0x201f9d[_0xee1d('0x42')]);if(_0x36dac4&&_0x36dac4[_0xee1d('0x62')]){logger[_0xee1d('0x9')]('['+_0x3592e2['lastevent']['toUpperCase']()+']',_0xee1d('0x44'));_0x3592e2[_0xee1d('0x45')]=util[_0xee1d('0xb')](_0xee1d('0x46'),_0x201f9d[_0xee1d('0x42')],_0x3592e2[_0xee1d('0x47')],md5(_0x3592e2[_0xee1d('0x47')]));}else{_0x3592e2[_0xee1d('0x45')]='';}headers[_0xee1d('0x5b')]=getAuth(_0x201f9d);return getUser(_0x201f9d)['then'](function(_0x57e8f1){_0x1cf3e0=_0x57e8f1;logger[_0xee1d('0x9')]('The\x20User\x20ID\x20is:',_0x1cf3e0['id']);return getEndUser(_0x201f9d,_0x3592e2[_0xee1d('0x49')],_0x3592e2['calleridnum']);})[_0xee1d('0x12')](function(_0xdd3be7){_0x4f2777=_0xdd3be7;logger[_0xee1d('0x9')]('The\x20Enduser\x20ID\x20is:',_0x4f2777['id']);return getTicket(_0x201f9d,_0x1cf3e0,_0x4f2777,_0x44e1cf,_0x3592e2);})[_0xee1d('0x12')](function(_0x55bab0){if(_0x55bab0){logger[_0xee1d('0x9')](_0xee1d('0x4b'),_0x55bab0['id']);}})['catch'](function(_0xd9703a){logger[_0xee1d('0x53')]('['+_0x3592e2[_0xee1d('0x63')][_0xee1d('0x64')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0xee1d('0x56')](_0xd9703a,{'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 f28b876..6665636 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 _0x05cc=['First_Name','Last_Name','What_Id','$se_module','startCase','talktime','Call_Duration','utc','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Call_Result','complete','Answered','rejected','Rejected','abandoned','Abandoned','Call_Start_Time','outbound','agentcalledAt','merge','Fields','Call\x20created!','details','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','email','The\x20User\x20ID\x20is:','calleridname','Inbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','Outbound','https://crm.','/crm/EntityInfo.do?module=Calls&id=','unmanaged','toUpperCase','calleridnum','The\x20Call\x20ID\x20is:','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','debug','[HTTP]','stringify','length','forEach','includes','idField','content','type','variableName','customVariable','Variable','toLowerCase','name','toString','indexOf','split','isNil','access_token','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','clientId','clientSecret','refresh_token','then','seconds','catch','error','stack','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','info','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','user','profile','The\x20failing\x20result\x20is','enduserType','/crm/v2/','moduleCreate','role','first_name','last_name','data','code','SUCCESS','Error:\x20','log','CREATE\x20ERROR','contact_lead','uri','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','contact','lead','nothing','Creating\x20new\x20call...','Owner','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name'];(function(_0x1e77ed,_0x5720c1){var _0x32ed55=function(_0x282f65){while(--_0x282f65){_0x1e77ed['push'](_0x1e77ed['shift']());}};_0x32ed55(++_0x5720c1);}(_0x05cc,0xd9));var _0xc05c=function(_0x27c174,_0x2374e5){_0x27c174=_0x27c174-0x0;var _0x1d7cb6=_0x05cc[_0x27c174];return _0x1d7cb6;};'use strict';var _=require(_0xc05c('0x0'));var rp=require(_0xc05c('0x1'));var md5=require(_0xc05c('0x2'));var util=require(_0xc05c('0x3'));var intUtil=require(_0xc05c('0x4'));var moment=require(_0xc05c('0x5'));var Redis=require(_0xc05c('0x6'));var BPromise=require(_0xc05c('0x7'));var config=require(_0xc05c('0x8'));var logger=require(_0xc05c('0x9'))(_0xc05c('0xa'));config[_0xc05c('0xb')]=_[_0xc05c('0xc')](config[_0xc05c('0xb')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc05c('0xb')]));function emit(_0x36450,_0x31134a,_0x222148){io['to'](_0x36450)['emit'](_0x31134a,_0x222148);}function request(_0x1ca4d9){logger[_0xc05c('0xd')](_0xc05c('0xe'),JSON[_0xc05c('0xf')](_0x1ca4d9));return rp(_0x1ca4d9);}function getCustomFields(_0x1fcbb7,_0x5b4d20){var _0x347259={};if(_0x1fcbb7[_0xc05c('0x10')]>0x0){_[_0xc05c('0x11')](_0x1fcbb7,function(_0x2541f6){if(_[_0xc05c('0x12')](['string','picklist'],_0x2541f6['type'])&&_0x2541f6[_0xc05c('0x13')]){_0x347259[_0x2541f6[_0xc05c('0x13')]]=_0x2541f6[_0xc05c('0x14')]['toString']();}else if(_0x2541f6[_0xc05c('0x15')]==='variable'&&_0x2541f6[_0xc05c('0x16')]&&_0x2541f6[_0xc05c('0x13')]&&_0x5b4d20[_0x2541f6[_0xc05c('0x16')]]){_0x347259[_0x2541f6[_0xc05c('0x13')]]=_0x5b4d20[_0x2541f6[_0xc05c('0x16')]]['toString']();}else if(_0x2541f6[_0xc05c('0x15')]===_0xc05c('0x17')&&_0x2541f6[_0xc05c('0x18')]&&_0x2541f6['Variable']['name']&&_0x2541f6[_0xc05c('0x13')]&&_0x5b4d20[_0x2541f6[_0xc05c('0x18')]['name'][_0xc05c('0x19')]()]){_0x347259[_0x2541f6[_0xc05c('0x13')]]=_0x5b4d20[_0x2541f6[_0xc05c('0x18')][_0xc05c('0x1a')]['toLowerCase']()][_0xc05c('0x1b')]();}});}return _0x347259;}function getName(_0x4d9eec){if(_0x4d9eec[_0xc05c('0x1c')]('\x20')>0x0){var _0x422d61=_0x4d9eec[_0xc05c('0x1d')](/ (.+)/);if(_0x422d61[0x1]){return _0x422d61;}}return[_0x4d9eec,_0x4d9eec];}var accountsTokens={};function getAccessToken(_0x296925){return new Promise(function(_0x2d204a,_0x4b7da2){if(!_['isNil'](accountsTokens[_0x296925['id']])&&!_[_0xc05c('0x1e')](accountsTokens[_0x296925['id']][_0xc05c('0x1f')])){if(moment()['isBefore'](accountsTokens[_0x296925['id']][_0xc05c('0x20')])){_0x2d204a(accountsTokens[_0x296925['id']][_0xc05c('0x1f')]);}}var _0x3198eb;switch(_0x296925[_0xc05c('0x21')]){case'US':_0x3198eb=_0xc05c('0x22');break;case'AU':_0x3198eb=_0xc05c('0x23');break;case'EU':_0x3198eb='https://accounts.zoho.eu';break;case'IN':_0x3198eb=_0xc05c('0x24');break;case'CN':_0x3198eb=_0xc05c('0x25');break;default:_0x3198eb=_0xc05c('0x26');break;}var _0x62431b={'method':_0xc05c('0x27'),'uri':_0x3198eb+'/oauth/v2/token','qs':{'refresh_token':_0x296925['refreshToken'],'client_id':_0x296925[_0xc05c('0x28')],'client_secret':_0x296925[_0xc05c('0x29')],'grant_type':_0xc05c('0x2a')},'json':!![]};return rp(_0x62431b)[_0xc05c('0x2b')](function(_0x5a0606){accountsTokens[_0x296925['id']]={'access_token':_0x5a0606['access_token'],'expires_in':moment()['add'](_0x5a0606[_0xc05c('0x20')],_0xc05c('0x2c'))};_0x2d204a(_0x5a0606[_0xc05c('0x1f')]);})[_0xc05c('0x2d')](function(_0x4075fe){logger[_0xc05c('0x2e')]('Failing\x20creating\x20the\x20access_token',_0x4075fe[_0xc05c('0x2f')]);_0x4b7da2(_0x4075fe);});});}function getUser(_0x1715be,_0x34529b,_0x17beb6,_0x5a2d1c){logger['info'](_0xc05c('0x30'));return request({'method':_0xc05c('0x31'),'uri':util[_0xc05c('0x32')](_0xc05c('0x33'),_0x34529b),'qs':{'type':_0xc05c('0x34')},'headers':{'Authorization':_0xc05c('0x35')+_0x1715be},'json':!![]})[_0xc05c('0x2b')](function(_0x3bc689){if(_0x3bc689[_0xc05c('0x36')]){var _0x1b1a37=-0x1;if(_[_0xc05c('0x37')](_0x3bc689['users'])){if(!_[_0xc05c('0x1e')](_0x5a2d1c)){_0x1b1a37=_[_0xc05c('0x38')](_0x3bc689['users'],function(_0x3d4189){return _0x3d4189['email']===_0x5a2d1c;});}if(_0x1b1a37>=0x0){logger[_0xc05c('0x39')](_0xc05c('0x3a'));}else{logger[_0xc05c('0x39')](_0xc05c('0x3b'));_0x1b1a37=_['findIndex'](_0x3bc689[_0xc05c('0x36')],function(_0x45eb2c){return _0x45eb2c['profile'][_0xc05c('0x1a')]===_0xc05c('0x3c');});}return _0x3bc689[_0xc05c('0x36')][_0x1b1a37];}else{if(_0x3bc689[_0xc05c('0x3d')][_0xc05c('0x3e')][_0xc05c('0x1a')]===_0xc05c('0x3c')){logger[_0xc05c('0x39')](_0xc05c('0x3b'));user=_0x3bc689[_0xc05c('0x3d')];return user;}else{logger[_0xc05c('0x2e')]('The\x20failing\x20result\x20is',JSON[_0xc05c('0xf')](_0x3bc689));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xc05c('0xf')](_0x3bc689));}}}else{logger['error'](_0xc05c('0x3f'),JSON[_0xc05c('0xf')](_0x3bc689));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xc05c('0xf')](_0x3bc689));}})[_0xc05c('0x2d')](function(_0x19e4f3){console[_0xc05c('0x2e')](_0x19e4f3);});}function getZohoUser(_0x1a59b5,_0x398fa6){return new BPromise(function(_0xbef61,_0x9de44d){request(_0x1a59b5)[_0xc05c('0x2b')](function(_0x3213d5){var _0x3c5e4e=null;if(_0x3213d5){_0x3c5e4e=_0x3213d5['data'][0x0];_0x3c5e4e[_0xc05c('0x40')]=_0x398fa6;}_0xbef61(_0x3c5e4e);})[_0xc05c('0x2d')](function(_0x2a3578){_0x9de44d(_0x2a3578);});});}function createEndUser(_0x301633,_0x3d710b,_0x366f4d,_0x4750ac,_0x4a951e,_0x231674){var _0x366f4d=getName(_0x366f4d);return request({'method':_0xc05c('0x27'),'uri':'https://www.zohoapis.'+_0x3d710b+_0xc05c('0x41')+_['startCase'](_0x231674[_0xc05c('0x42')])+'s','body':{'data':[{'Last_Name':_0x366f4d[0x1],'First_Name':_0x366f4d[0x0],'Phone':_0x4750ac,'Owner':{'name':!_[_0xc05c('0x1e')](_0x4a951e[_0xc05c('0x43')]['name'])?_0x4a951e['role']['name']:!_[_0xc05c('0x1e')](_0x4a951e[_0xc05c('0x44')])?_0x4a951e[_0xc05c('0x44')]+'\x20'+_0x4a951e[_0xc05c('0x45')]:_0x4a951e[_0xc05c('0x45')],'id':_0x4a951e['id']}}]},'headers':{'Authorization':_0xc05c('0x35')+_0x301633},'json':!![]})[_0xc05c('0x2b')](function(_0x149dc7){if(_0x149dc7&&_0x149dc7[_0xc05c('0x46')][0x0][_0xc05c('0x47')]===_0xc05c('0x48')){var _0x36fd74=_0x149dc7['data'][0x0]['details'];_0x36fd74[_0xc05c('0x40')]=_['startCase'](_0x231674[_0xc05c('0x42')])+'s';return _0x36fd74;}logger[_0xc05c('0x2e')](_0xc05c('0x3f'),JSON[_0xc05c('0xf')](data));throw new Error(_0xc05c('0x49')+JSON[_0xc05c('0xf')](data));})['catch'](function(_0x13034e){console[_0xc05c('0x4a')](_0xc05c('0x4b'),_0x13034e);});}function getEndUser(_0x293607,_0x20df51,_0x28219b,_0x17858e,_0x58bb85,_0x883f0b,_0x55e9c4){var _0x598f90={'method':_0xc05c('0x31'),'uri':'','headers':{'Authorization':_0xc05c('0x35')+_0x293607},'json':!![]};switch(_0x55e9c4['moduleSearch']){case _0xc05c('0x4c'):_0x598f90[_0xc05c('0x4d')]=_0xc05c('0x4e')+_0x20df51+_0xc05c('0x4f')+_0x58bb85+'))';return getZohoUser(_0x598f90,_0xc05c('0x50'))[_0xc05c('0x2b')](function(_0x46e679){if(_0x46e679)return _0x46e679;_0x598f90['uri']=_0xc05c('0x4e')+_0x20df51+_0xc05c('0x51')+_0x58bb85+'))';return getZohoUser(_0x598f90,_0xc05c('0x52'))[_0xc05c('0x2b')](function(_0x2f5488){if(_0x2f5488)return _0x2f5488;if(_0x55e9c4['moduleCreate']!='nothing'){return createEndUser(_0x293607,_0x20df51,_0x17858e,_0x58bb85,_0x883f0b,_0x55e9c4);}else{return{};}});});break;case _0xc05c('0x53'):_0x598f90[_0xc05c('0x4d')]=_0xc05c('0x4e')+_0x20df51+_0xc05c('0x4f')+_0x58bb85+'))';return getZohoUser(_0x598f90,_0xc05c('0x50'))[_0xc05c('0x2b')](function(_0x2ffb92){if(_0x2ffb92)return _0x2ffb92;if(_0x55e9c4[_0xc05c('0x42')]!='nothing'){return createEndUser(_0x293607,_0x20df51,_0x17858e,_0x58bb85,_0x883f0b,_0x55e9c4);}else{return{};}});break;case _0xc05c('0x54'):_0x598f90['uri']=_0xc05c('0x4e')+_0x20df51+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x58bb85+'))';return getZohoUser(_0x598f90,'Leads')[_0xc05c('0x2b')](function(_0x38d9fd){if(_0x38d9fd)return _0x38d9fd;if(_0x55e9c4[_0xc05c('0x42')]!=_0xc05c('0x55')){return createEndUser(_0x293607,_0x20df51,_0x17858e,_0x58bb85,_0x883f0b,_0x55e9c4);}else{return{};}});break;}}function getCall(_0x1d15ab,_0x49638b,_0x2d9910,_0x3e5130,_0x5bf9a1,_0x2966b7,_0x248055,_0x4d8b07){logger[_0xc05c('0x39')](_0xc05c('0x56'));var _0x58f573={};_0x58f573[_0xc05c('0x57')]={'name':!_[_0xc05c('0x1e')](_0x3e5130[_0xc05c('0x43')][_0xc05c('0x1a')])&&!_[_0xc05c('0x1e')](_0x3e5130[_0xc05c('0x3e')][_0xc05c('0x1a')])&&_0x3e5130[_0xc05c('0x3e')][_0xc05c('0x1a')]==='administrator'?_0x3e5130[_0xc05c('0x43')][_0xc05c('0x1a')]:!_[_0xc05c('0x1e')](_0x3e5130['first_name'])?_0x3e5130[_0xc05c('0x44')]+'\x20'+_0x3e5130[_0xc05c('0x45')]:_0x3e5130[_0xc05c('0x45')],'id':_0x3e5130['id']};_0x58f573[_0xc05c('0x58')]=intUtil[_0xc05c('0x59')](_0x2966b7[_0xc05c('0x5a')],_0x248055,'\x20');_0x58f573[_0xc05c('0x5b')]=intUtil[_0xc05c('0x59')](_0x2966b7[_0xc05c('0x5c')],_0x248055,'\x0a');if(_0x5bf9a1[_0xc05c('0x40')]===_0xc05c('0x50')){_0x58f573[_0xc05c('0x5d')]={'name':!_[_0xc05c('0x1e')](_0x5bf9a1[_0xc05c('0x5e')])?_0x5bf9a1[_0xc05c('0x5e')]:!_[_0xc05c('0x1e')](_0x5bf9a1['First_Name'])?_0x5bf9a1[_0xc05c('0x5f')]+'\x20'+_0x5bf9a1[_0xc05c('0x60')]:_0x5bf9a1[_0xc05c('0x60')],'id':_0x5bf9a1['id']};}if(_0x5bf9a1[_0xc05c('0x40')]===_0xc05c('0x52')){_0x58f573[_0xc05c('0x61')]={'name':!_[_0xc05c('0x1e')](_0x5bf9a1[_0xc05c('0x5e')])?_0x5bf9a1[_0xc05c('0x5e')]:!_['isNil'](_0x5bf9a1['First_Name'])?_0x5bf9a1['First_Name']+'\x20'+_0x5bf9a1[_0xc05c('0x60')]:_0x5bf9a1[_0xc05c('0x60')],'id':_0x5bf9a1['id']};_0x58f573[_0xc05c('0x62')]=_[_0xc05c('0x63')](_0x5bf9a1[_0xc05c('0x40')]);}if(_0x248055[_0xc05c('0x64')]){_0x58f573[_0xc05c('0x65')]=moment[_0xc05c('0x66')](parseInt(_0x248055[_0xc05c('0x64')])*0x3e8)[_0xc05c('0x32')]('mm:ss');}else if(_0x248055[_0xc05c('0x67')]&&_0x248055[_0xc05c('0x68')]){_0x58f573['Call_Duration']=moment['utc'](moment(_0x248055['endtime'],_0xc05c('0x69'))[_0xc05c('0x6a')](moment(_0x248055[_0xc05c('0x6b')],_0xc05c('0x69'))))[_0xc05c('0x32')]('mm:ss');}switch(_0x248055[_0xc05c('0x6c')]){case _0xc05c('0x6d'):_0x58f573[_0xc05c('0x6e')]='Called';break;case _0xc05c('0x6f'):case'connect':_0x58f573[_0xc05c('0x6e')]=_0xc05c('0x70');break;case _0xc05c('0x71'):_0x58f573[_0xc05c('0x6e')]=_0xc05c('0x72');break;case _0xc05c('0x73'):_0x58f573[_0xc05c('0x6e')]=_0xc05c('0x74');break;case'timeout':_0x58f573[_0xc05c('0x6e')]='Timeout';default:}_0x58f573[_0xc05c('0x75')]=(_0x4d8b07===_0xc05c('0x76')?moment(_0x248055[_0xc05c('0x6b')])[_0xc05c('0x32')](_0xc05c('0x69')):moment(_0x248055[_0xc05c('0x77')])[_0xc05c('0x32')](_0xc05c('0x69')))||moment()['format']('YYYY-MM-DDTHH:mm:ss');_0x58f573['Call_Type']=_0x4d8b07||'Inbound';_0x58f573=_[_0xc05c('0x78')](_0x58f573,getCustomFields(_0x2966b7[_0xc05c('0x79')],_0x248055));return request({'method':_0xc05c('0x27'),'uri':_0xc05c('0x4e')+_0x49638b+'/crm/v2/Calls','headers':{'Authorization':_0xc05c('0x35')+_0x1d15ab},'body':{'data':[_0x58f573]},'json':!![]})[_0xc05c('0x2b')](function(_0xd04162){if(_0xd04162&&_0xd04162[_0xc05c('0x46')][0x0][_0xc05c('0x47')]===_0xc05c('0x48')){logger[_0xc05c('0x39')](_0xc05c('0x7a'));return{'id':_0xd04162[_0xc05c('0x46')][0x0][_0xc05c('0x7b')]['id']};}})[_0xc05c('0x2d')](function(_0x2f647c){logger['info']('err',_0x2f647c[_0xc05c('0x2f')]);console[_0xc05c('0x4a')](_0xc05c('0x7c'),_0x2f647c);});}exports[_0xc05c('0x7d')]=function(_0x38e0fd,_0x3a94d3,_0x445c07,_0x175bda,_0x359aba,_0x2975d3){var _0x6494e3,_0x376e74,_0x3455ce;_0x2975d3[_0xc05c('0x7e')]=intUtil[_0xc05c('0x7f')](_0x2975d3['host']);_0x2975d3['serverUrl']=intUtil[_0xc05c('0x7f')](_0x2975d3[_0xc05c('0x80')]);if(_0x359aba&&_0x359aba[_0xc05c('0x81')]){logger[_0xc05c('0x39')](_0xc05c('0x82'),'Recording\x20is\x20enabled!');_0x3a94d3[_0xc05c('0x83')]=_0x2975d3['serverUrl']+_0xc05c('0x84')+_0x3a94d3[_0xc05c('0x85')]+_0xc05c('0x86')+md5(_0x3a94d3[_0xc05c('0x85')]);}else{_0x3a94d3[_0xc05c('0x83')]='';}var _0xcb8f96=_0x2975d3[_0xc05c('0x7e')]===_0xc05c('0x87')?'eu':_0xc05c('0x88');return getAccessToken(_0x2975d3)[_0xc05c('0x2b')](function(_0x51ad45){_0x3455ce=_0x51ad45;return getUser(_0x3455ce,_0xcb8f96,_0x2975d3,_0x175bda[_0xc05c('0x89')]);})[_0xc05c('0x2b')](function(_0x1d60a9){_0x6494e3=_0x1d60a9;logger['info'](_0xc05c('0x8a'),_0x6494e3['id']);return getEndUser(_0x3455ce,_0xcb8f96,_0x2975d3,_0x3a94d3[_0xc05c('0x8b')],_0x3a94d3['calleridnum'],_0x6494e3,_0x445c07);})[_0xc05c('0x2b')](function(_0x456b47){_0x376e74=_0x456b47;return getCall(_0x3455ce,_0xcb8f96,_0x2975d3,_0x6494e3,_0x376e74,_0x445c07,_0x3a94d3,_0xc05c('0x8c'));})[_0xc05c('0x2b')](function(_0x33ce69){if(_0x33ce69){logger[_0xc05c('0x39')]('The\x20Call\x20ID\x20is:',_0x33ce69['id']);logger[_0xc05c('0x39')](_0xc05c('0x82'),_0xc05c('0x8d'));emit(util[_0xc05c('0x32')](_0xc05c('0x8e'),_0x175bda[_0xc05c('0x1a')]),_0xc05c('0x8f'),{'uri':'https://crm.'+_0x2975d3[_0xc05c('0x7e')]+'/crm/EntityInfo.do?module=Calls&id='+_0x33ce69['id']});}})[_0xc05c('0x2d')](function(_0x450eb0){logger[_0xc05c('0x2e')](_0xc05c('0x82'),JSON['stringify'](_0x450eb0));});};exports[_0xc05c('0x76')]=function(_0x3a192d,_0xcb2c78,_0x11b532,_0x3327ad,_0x25efc5,_0x103248,_0x56e683){var _0x42ca88,_0x4b2264,_0x3ee84b;_0x103248[_0xc05c('0x7e')]=intUtil['stripTrailingSlash'](_0x103248[_0xc05c('0x7e')]);_0x103248[_0xc05c('0x80')]=intUtil[_0xc05c('0x7f')](_0x103248[_0xc05c('0x80')]);if(_0x56e683&&_0x56e683[_0xc05c('0x90')]&&_0x56e683[_0xc05c('0x90')]!==_0xc05c('0x91')){logger[_0xc05c('0x39')](_0xc05c('0x92'),_0xc05c('0x93'));_0xcb2c78['recordingURL']=_0x103248[_0xc05c('0x80')]+_0xc05c('0x84')+_0xcb2c78[_0xc05c('0x85')]+_0xc05c('0x86')+md5(_0xcb2c78[_0xc05c('0x85')]);}var _0xde4e8e=_0x103248[_0xc05c('0x7e')]===_0xc05c('0x87')?'eu':_0xc05c('0x88');return getAccessToken(_0x103248)[_0xc05c('0x2b')](function(_0x26fa42){_0x3ee84b=_0x26fa42;return getUser(_0x3ee84b,_0xde4e8e,_0x103248,_0x3327ad['email']);})[_0xc05c('0x2b')](function(_0x409eb1){_0x42ca88=_0x409eb1;logger['info']('The\x20User\x20ID\x20is:',_0x42ca88['id']);return getEndUser(_0x3ee84b,_0xde4e8e,_0x103248,_0xcb2c78[_0xc05c('0x94')],_0xcb2c78['destcalleridnum'],_0x42ca88,_0x11b532);})[_0xc05c('0x2b')](function(_0x2bc9c9){_0x4b2264=_0x2bc9c9;return getCall(_0x3ee84b,_0xde4e8e,_0x103248,_0x42ca88,_0x4b2264,_0x11b532,_0xcb2c78,_0xc05c('0x95'));})[_0xc05c('0x2b')](function(_0xa7d473){if(_0xa7d473){logger[_0xc05c('0x39')]('The\x20Call\x20ID\x20is:',_0xa7d473['id']);logger['info'](_0xc05c('0x92'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xc05c('0x32')](_0xc05c('0x8e'),_0x3327ad[_0xc05c('0x1a')]),_0xc05c('0x8f'),{'uri':_0xc05c('0x96')+_0x103248[_0xc05c('0x7e')]+_0xc05c('0x97')+_0xa7d473['id']});}})[_0xc05c('0x2d')](function(_0x5eb26f){logger['error']('[OUTBOUND]',JSON['stringify'](_0x5eb26f));});};exports[_0xc05c('0x98')]=function(_0x30eafa,_0x1ebf1d,_0x5de3a9,_0x582f2d,_0x45732e,_0x29062f){var _0x441562,_0x58beea,_0x285f43;_0x29062f['host']=intUtil[_0xc05c('0x7f')](_0x29062f[_0xc05c('0x7e')]);_0x29062f[_0xc05c('0x80')]=intUtil[_0xc05c('0x7f')](_0x29062f[_0xc05c('0x80')]);if(_0x45732e&&_0x45732e[_0xc05c('0x81')]){logger[_0xc05c('0x39')]('['+_0x1ebf1d[_0xc05c('0x6c')][_0xc05c('0x99')]()+']',_0xc05c('0x93'));_0x1ebf1d[_0xc05c('0x83')]=_0x29062f['serverUrl']+_0xc05c('0x84')+_0x1ebf1d[_0xc05c('0x85')]+_0xc05c('0x86')+md5(_0x1ebf1d[_0xc05c('0x85')]);}else{_0x1ebf1d['recordingURL']='';}var _0x465168=_0x29062f[_0xc05c('0x7e')]===_0xc05c('0x87')?'eu':'com';return getAccessToken(_0x29062f)[_0xc05c('0x2b')](function(_0x252cf0){_0x285f43=_0x252cf0;return getUser(_0x285f43,_0x465168,_0x29062f);})[_0xc05c('0x2b')](function(_0x58fa84){_0x441562=_0x58fa84;logger['info'](_0xc05c('0x8a'),_0x441562['id']);return getEndUser(_0x285f43,_0x465168,_0x29062f,_0x1ebf1d[_0xc05c('0x8b')],_0x1ebf1d[_0xc05c('0x9a')],_0x441562,_0x5de3a9);})[_0xc05c('0x2b')](function(_0x44e89a){_0x58beea=_0x44e89a;return getCall(_0x285f43,_0x465168,_0x29062f,_0x441562,_0x58beea,_0x5de3a9,_0x1ebf1d,_0xc05c('0x8c'));})[_0xc05c('0x2b')](function(_0x9a1f1f){if(_0x9a1f1f){logger[_0xc05c('0x39')](_0xc05c('0x9b'),_0x9a1f1f['id']);}})[_0xc05c('0x2d')](function(_0x293fe6){logger[_0xc05c('0x2e')]('['+_0x1ebf1d[_0xc05c('0x6c')][_0xc05c('0x99')]()+']',JSON[_0xc05c('0xf')](_0x293fe6));});}; \ No newline at end of file +var _0xb945=['bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','localhost','socket.io-emitter','debug','[HTTP]','stringify','forEach','includes','string','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','isBefore','expires_in','access_token','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','refresh_token','then','add','catch','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','isArrayLikeObject','findIndex','users','Agent\x20found!','profile','error','The\x20failing\x20result\x20is','https://www.zohoapis.','/crm/v2/','startCase','role','last_name','data','SUCCESS','details','enduserType','Error:\x20','CREATE\x20ERROR','moduleSearch','contact_lead','uri','moduleCreate','nothing','contact','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Creating\x20new\x20call...','Owner','administrator','first_name','Subject','getString','Subjects','Description','Descriptions','Full_Name','Last_Name','Leads','What_Id','First_Name','$se_module','talktime','Call_Duration','mm:ss','endtime','utc','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Call_Result','Called','complete','connect','Answered','abandoned','Abandoned','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','Call\x20created!','err','queue','host','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','calleridname','calleridnum','The\x20Call\x20ID\x20is:','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','none','[OUTBOUND]','com','email','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','lodash','md5','./util'];(function(_0x2e5f9c,_0x134a52){var _0x538b44=function(_0x38ef13){while(--_0x38ef13){_0x2e5f9c['push'](_0x2e5f9c['shift']());}};_0x538b44(++_0x134a52);}(_0xb945,0x97));var _0x5b94=function(_0x27f616,_0xf48a6d){_0x27f616=_0x27f616-0x0;var _0x5ebae0=_0xb945[_0x27f616];return _0x5ebae0;};'use strict';var _=require(_0x5b94('0x0'));var rp=require('request-promise');var md5=require(_0x5b94('0x1'));var util=require('util');var intUtil=require(_0x5b94('0x2'));var moment=require('moment');var Redis=require('ioredis');var BPromise=require(_0x5b94('0x3'));var config=require(_0x5b94('0x4'));var logger=require(_0x5b94('0x5'))(_0x5b94('0x6'));config[_0x5b94('0x7')]=_['defaults'](config['redis'],{'host':_0x5b94('0x8'),'port':0x18eb});var io=require(_0x5b94('0x9'))(new Redis(config[_0x5b94('0x7')]));function emit(_0x186d22,_0x5d2448,_0x428211){io['to'](_0x186d22)['emit'](_0x5d2448,_0x428211);}function request(_0x3e7695){logger[_0x5b94('0xa')](_0x5b94('0xb'),JSON[_0x5b94('0xc')](_0x3e7695));return rp(_0x3e7695);}function getCustomFields(_0x2bcba0,_0x1dba61){var _0x1ef820={};if(_0x2bcba0['length']>0x0){_[_0x5b94('0xd')](_0x2bcba0,function(_0x54be80){if(_[_0x5b94('0xe')]([_0x5b94('0xf'),_0x5b94('0x10')],_0x54be80[_0x5b94('0x11')])&&_0x54be80[_0x5b94('0x12')]){_0x1ef820[_0x54be80['idField']]=_0x54be80[_0x5b94('0x13')][_0x5b94('0x14')]();}else if(_0x54be80[_0x5b94('0x11')]===_0x5b94('0x15')&&_0x54be80['variableName']&&_0x54be80[_0x5b94('0x12')]&&_0x1dba61[_0x54be80['variableName']]){_0x1ef820[_0x54be80[_0x5b94('0x12')]]=_0x1dba61[_0x54be80[_0x5b94('0x16')]]['toString']();}else if(_0x54be80[_0x5b94('0x11')]===_0x5b94('0x17')&&_0x54be80[_0x5b94('0x18')]&&_0x54be80['Variable'][_0x5b94('0x19')]&&_0x54be80[_0x5b94('0x12')]&&_0x1dba61[_0x54be80['Variable'][_0x5b94('0x19')][_0x5b94('0x1a')]()]){_0x1ef820[_0x54be80[_0x5b94('0x12')]]=_0x1dba61[_0x54be80['Variable'][_0x5b94('0x19')][_0x5b94('0x1a')]()]['toString']();}});}return _0x1ef820;}function getName(_0xba8499){if(_0xba8499[_0x5b94('0x1b')]('\x20')>0x0){var _0x265d5d=_0xba8499[_0x5b94('0x1c')](/ (.+)/);if(_0x265d5d[0x1]){return _0x265d5d;}}return[_0xba8499,_0xba8499];}var accountsTokens={};function getAccessToken(_0x1f2293){return new Promise(function(_0x5d1a5a,_0x2f6c7b){if(!_[_0x5b94('0x1d')](accountsTokens[_0x1f2293['id']])&&!_['isNil'](accountsTokens[_0x1f2293['id']]['access_token'])){if(moment()[_0x5b94('0x1e')](accountsTokens[_0x1f2293['id']][_0x5b94('0x1f')])){_0x5d1a5a(accountsTokens[_0x1f2293['id']][_0x5b94('0x20')]);}}var _0xe8a5d0;switch(_0x1f2293[_0x5b94('0x21')]){case'US':_0xe8a5d0=_0x5b94('0x22');break;case'AU':_0xe8a5d0=_0x5b94('0x23');break;case'EU':_0xe8a5d0=_0x5b94('0x24');break;case'IN':_0xe8a5d0=_0x5b94('0x25');break;case'CN':_0xe8a5d0=_0x5b94('0x26');break;default:_0xe8a5d0=_0x5b94('0x24');break;}var _0x29ad17={'method':_0x5b94('0x27'),'uri':_0xe8a5d0+_0x5b94('0x28'),'qs':{'refresh_token':_0x1f2293[_0x5b94('0x29')],'client_id':_0x1f2293[_0x5b94('0x2a')],'client_secret':_0x1f2293['clientSecret'],'grant_type':_0x5b94('0x2b')},'json':!![]};return rp(_0x29ad17)[_0x5b94('0x2c')](function(_0x344373){accountsTokens[_0x1f2293['id']]={'access_token':_0x344373[_0x5b94('0x20')],'expires_in':moment()[_0x5b94('0x2d')](_0x344373['expires_in'],'seconds')};_0x5d1a5a(_0x344373[_0x5b94('0x20')]);})[_0x5b94('0x2e')](function(_0x2fbb32){logger['error'](_0x5b94('0x2f'),_0x2fbb32[_0x5b94('0x30')]);_0x2f6c7b(_0x2fbb32);});});}function getUser(_0x594aca,_0x5dc969,_0x151c6c,_0xc2a8bd){logger[_0x5b94('0x31')](_0x5b94('0x32'));return request({'method':_0x5b94('0x33'),'uri':util[_0x5b94('0x34')](_0x5b94('0x35'),_0x5dc969),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0x5b94('0x36')+_0x594aca},'json':!![]})['then'](function(_0x5ba892){if(_0x5ba892['users']){var _0xc151f5=-0x1;if(_[_0x5b94('0x37')](_0x5ba892['users'])){if(!_[_0x5b94('0x1d')](_0xc2a8bd)){_0xc151f5=_[_0x5b94('0x38')](_0x5ba892[_0x5b94('0x39')],function(_0x31982d){return _0x31982d['email']===_0xc2a8bd;});}if(_0xc151f5>=0x0){logger['info'](_0x5b94('0x3a'));}else{logger[_0x5b94('0x31')]('Using\x20the\x20admin\x20account!');_0xc151f5=_[_0x5b94('0x38')](_0x5ba892[_0x5b94('0x39')],function(_0xde4f5){return _0xde4f5[_0x5b94('0x3b')][_0x5b94('0x19')]==='Administrator';});}return _0x5ba892['users'][_0xc151f5];}else{if(_0x5ba892['user'][_0x5b94('0x3b')][_0x5b94('0x19')]==='Administrator'){logger[_0x5b94('0x31')]('Using\x20the\x20admin\x20account!');user=_0x5ba892['user'];return user;}else{logger[_0x5b94('0x3c')](_0x5b94('0x3d'),JSON[_0x5b94('0xc')](_0x5ba892));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x5ba892));}}}else{logger[_0x5b94('0x3c')](_0x5b94('0x3d'),JSON['stringify'](_0x5ba892));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x5b94('0xc')](_0x5ba892));}})[_0x5b94('0x2e')](function(_0x1d387a){console[_0x5b94('0x3c')](_0x1d387a);});}function getZohoUser(_0x49b71d,_0x4aebb8){return new BPromise(function(_0x2693bb,_0x14cb0a){request(_0x49b71d)[_0x5b94('0x2c')](function(_0x1083d6){var _0x3e92c1=null;if(_0x1083d6){_0x3e92c1=_0x1083d6['data'][0x0];_0x3e92c1['enduserType']=_0x4aebb8;}_0x2693bb(_0x3e92c1);})['catch'](function(_0x46f8d4){_0x14cb0a(_0x46f8d4);});});}function createEndUser(_0x3ae0ed,_0x18acdf,_0x10f126,_0x10d1e0,_0x11b23b,_0x11c291){var _0x10f126=getName(_0x10f126);return request({'method':_0x5b94('0x27'),'uri':_0x5b94('0x3e')+_0x18acdf+_0x5b94('0x3f')+_[_0x5b94('0x40')](_0x11c291['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x10f126[0x1],'First_Name':_0x10f126[0x0],'Phone':_0x10d1e0,'Owner':{'name':!_[_0x5b94('0x1d')](_0x11b23b[_0x5b94('0x41')][_0x5b94('0x19')])?_0x11b23b[_0x5b94('0x41')][_0x5b94('0x19')]:!_[_0x5b94('0x1d')](_0x11b23b['first_name'])?_0x11b23b['first_name']+'\x20'+_0x11b23b[_0x5b94('0x42')]:_0x11b23b[_0x5b94('0x42')],'id':_0x11b23b['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x3ae0ed},'json':!![]})[_0x5b94('0x2c')](function(_0x22b8a8){if(_0x22b8a8&&_0x22b8a8[_0x5b94('0x43')][0x0]['code']===_0x5b94('0x44')){var _0x236278=_0x22b8a8['data'][0x0][_0x5b94('0x45')];_0x236278[_0x5b94('0x46')]=_[_0x5b94('0x40')](_0x11c291['moduleCreate'])+'s';return _0x236278;}logger[_0x5b94('0x3c')]('The\x20failing\x20result\x20is',JSON['stringify'](data));throw new Error(_0x5b94('0x47')+JSON[_0x5b94('0xc')](data));})[_0x5b94('0x2e')](function(_0x6ab7e2){console['log'](_0x5b94('0x48'),_0x6ab7e2);});}function getEndUser(_0x68b842,_0x51c278,_0x3f1fed,_0x21dfc4,_0x32bb12,_0x42ab9d,_0x4571bd){var _0xa0843e={'method':_0x5b94('0x33'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x68b842},'json':!![]};switch(_0x4571bd[_0x5b94('0x49')]){case _0x5b94('0x4a'):_0xa0843e[_0x5b94('0x4b')]='https://www.zohoapis.'+_0x51c278+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x32bb12+'))';return getZohoUser(_0xa0843e,'Contacts')[_0x5b94('0x2c')](function(_0x5c7c76){if(_0x5c7c76)return _0x5c7c76;_0xa0843e[_0x5b94('0x4b')]=_0x5b94('0x3e')+_0x51c278+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x32bb12+'))';return getZohoUser(_0xa0843e,'Leads')[_0x5b94('0x2c')](function(_0x389134){if(_0x389134)return _0x389134;if(_0x4571bd[_0x5b94('0x4c')]!=_0x5b94('0x4d')){return createEndUser(_0x68b842,_0x51c278,_0x21dfc4,_0x32bb12,_0x42ab9d,_0x4571bd);}else{return{};}});});break;case _0x5b94('0x4e'):_0xa0843e[_0x5b94('0x4b')]=_0x5b94('0x3e')+_0x51c278+_0x5b94('0x4f')+_0x32bb12+'))';return getZohoUser(_0xa0843e,_0x5b94('0x50'))['then'](function(_0x131323){if(_0x131323)return _0x131323;if(_0x4571bd[_0x5b94('0x4c')]!=_0x5b94('0x4d')){return createEndUser(_0x68b842,_0x51c278,_0x21dfc4,_0x32bb12,_0x42ab9d,_0x4571bd);}else{return{};}});break;case _0x5b94('0x51'):_0xa0843e[_0x5b94('0x4b')]='https://www.zohoapis.'+_0x51c278+_0x5b94('0x52')+_0x32bb12+'))';return getZohoUser(_0xa0843e,'Leads')[_0x5b94('0x2c')](function(_0x4d8c34){if(_0x4d8c34)return _0x4d8c34;if(_0x4571bd[_0x5b94('0x4c')]!=_0x5b94('0x4d')){return createEndUser(_0x68b842,_0x51c278,_0x21dfc4,_0x32bb12,_0x42ab9d,_0x4571bd);}else{return{};}});break;}}function getCall(_0x37d12a,_0x34a160,_0x54e838,_0x1e11d1,_0x2cef6e,_0x467f9f,_0x105cd2,_0x1539da){logger['info'](_0x5b94('0x53'));var _0x4aa64c={};_0x4aa64c[_0x5b94('0x54')]={'name':!_['isNil'](_0x1e11d1[_0x5b94('0x41')][_0x5b94('0x19')])&&!_[_0x5b94('0x1d')](_0x1e11d1['profile'][_0x5b94('0x19')])&&_0x1e11d1[_0x5b94('0x3b')][_0x5b94('0x19')]===_0x5b94('0x55')?_0x1e11d1[_0x5b94('0x41')][_0x5b94('0x19')]:!_[_0x5b94('0x1d')](_0x1e11d1[_0x5b94('0x56')])?_0x1e11d1[_0x5b94('0x56')]+'\x20'+_0x1e11d1[_0x5b94('0x42')]:_0x1e11d1[_0x5b94('0x42')],'id':_0x1e11d1['id']};_0x4aa64c[_0x5b94('0x57')]=intUtil[_0x5b94('0x58')](_0x467f9f[_0x5b94('0x59')],_0x105cd2,'\x20');_0x4aa64c[_0x5b94('0x5a')]=intUtil[_0x5b94('0x58')](_0x467f9f[_0x5b94('0x5b')],_0x105cd2,'\x0a');if(_0x2cef6e[_0x5b94('0x46')]===_0x5b94('0x50')){_0x4aa64c['Who_Id']={'name':!_['isNil'](_0x2cef6e[_0x5b94('0x5c')])?_0x2cef6e[_0x5b94('0x5c')]:!_[_0x5b94('0x1d')](_0x2cef6e['First_Name'])?_0x2cef6e['First_Name']+'\x20'+_0x2cef6e['Last_Name']:_0x2cef6e[_0x5b94('0x5d')],'id':_0x2cef6e['id']};}if(_0x2cef6e['enduserType']===_0x5b94('0x5e')){_0x4aa64c[_0x5b94('0x5f')]={'name':!_[_0x5b94('0x1d')](_0x2cef6e[_0x5b94('0x5c')])?_0x2cef6e[_0x5b94('0x5c')]:!_[_0x5b94('0x1d')](_0x2cef6e[_0x5b94('0x60')])?_0x2cef6e[_0x5b94('0x60')]+'\x20'+_0x2cef6e[_0x5b94('0x5d')]:_0x2cef6e['Last_Name'],'id':_0x2cef6e['id']};_0x4aa64c[_0x5b94('0x61')]=_[_0x5b94('0x40')](_0x2cef6e[_0x5b94('0x46')]);}if(_0x105cd2[_0x5b94('0x62')]){_0x4aa64c[_0x5b94('0x63')]=moment['utc'](parseInt(_0x105cd2[_0x5b94('0x62')])*0x3e8)['format'](_0x5b94('0x64'));}else if(_0x105cd2['answertime']&&_0x105cd2[_0x5b94('0x65')]){_0x4aa64c[_0x5b94('0x63')]=moment[_0x5b94('0x66')](moment(_0x105cd2[_0x5b94('0x65')],_0x5b94('0x67'))[_0x5b94('0x68')](moment(_0x105cd2[_0x5b94('0x69')],_0x5b94('0x67'))))[_0x5b94('0x34')](_0x5b94('0x64'));}switch(_0x105cd2[_0x5b94('0x6a')]){case _0x5b94('0x6b'):_0x4aa64c[_0x5b94('0x6c')]=_0x5b94('0x6d');break;case _0x5b94('0x6e'):case _0x5b94('0x6f'):_0x4aa64c[_0x5b94('0x6c')]=_0x5b94('0x70');break;case'rejected':_0x4aa64c[_0x5b94('0x6c')]='Rejected';break;case _0x5b94('0x71'):_0x4aa64c[_0x5b94('0x6c')]=_0x5b94('0x72');break;case'timeout':_0x4aa64c['Call_Result']=_0x5b94('0x73');default:}_0x4aa64c[_0x5b94('0x74')]=(_0x1539da===_0x5b94('0x75')?moment(_0x105cd2['starttime'])[_0x5b94('0x34')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x105cd2[_0x5b94('0x76')])[_0x5b94('0x34')](_0x5b94('0x67')))||moment()['format'](_0x5b94('0x67'));_0x4aa64c[_0x5b94('0x77')]=_0x1539da||_0x5b94('0x78');_0x4aa64c=_[_0x5b94('0x79')](_0x4aa64c,getCustomFields(_0x467f9f[_0x5b94('0x7a')],_0x105cd2));return request({'method':_0x5b94('0x27'),'uri':_0x5b94('0x3e')+_0x34a160+'/crm/v2/Calls','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x37d12a},'body':{'data':[_0x4aa64c]},'json':!![]})['then'](function(_0x187128){if(_0x187128&&_0x187128[_0x5b94('0x43')][0x0]['code']===_0x5b94('0x44')){logger[_0x5b94('0x31')](_0x5b94('0x7b'));return{'id':_0x187128[_0x5b94('0x43')][0x0][_0x5b94('0x45')]['id']};}})[_0x5b94('0x2e')](function(_0x105fd8){logger['info'](_0x5b94('0x7c'),_0x105fd8[_0x5b94('0x30')]);console['log'](_0x5b94('0x7c'),_0x105fd8);});}exports[_0x5b94('0x7d')]=function(_0x2cc4ac,_0x29e38c,_0x56fb61,_0x494bc4,_0x3534d1,_0x2b056e){var _0x5685b8,_0xbaf890,_0x5402e7;_0x2b056e['host']=intUtil['stripTrailingSlash'](_0x2b056e[_0x5b94('0x7e')]);_0x2b056e[_0x5b94('0x7f')]=intUtil[_0x5b94('0x80')](_0x2b056e[_0x5b94('0x7f')]);if(_0x3534d1&&_0x3534d1[_0x5b94('0x81')]){logger['info'](_0x5b94('0x82'),_0x5b94('0x83'));_0x29e38c[_0x5b94('0x84')]=_0x2b056e[_0x5b94('0x7f')]+_0x5b94('0x85')+_0x29e38c[_0x5b94('0x86')]+_0x5b94('0x87')+md5(_0x29e38c[_0x5b94('0x86')]);}else{_0x29e38c['recordingURL']='';}var _0x34553a=_0x2b056e[_0x5b94('0x7e')]===_0x5b94('0x88')?'eu':'com';return getAccessToken(_0x2b056e)[_0x5b94('0x2c')](function(_0x179cd0){_0x5402e7=_0x179cd0;return getUser(_0x5402e7,_0x34553a,_0x2b056e,_0x494bc4['email']);})[_0x5b94('0x2c')](function(_0x5de4b1){_0x5685b8=_0x5de4b1;logger[_0x5b94('0x31')]('The\x20User\x20ID\x20is:',_0x5685b8['id']);return getEndUser(_0x5402e7,_0x34553a,_0x2b056e,_0x29e38c[_0x5b94('0x89')],_0x29e38c[_0x5b94('0x8a')],_0x5685b8,_0x56fb61);})[_0x5b94('0x2c')](function(_0x31839c){_0xbaf890=_0x31839c;return getCall(_0x5402e7,_0x34553a,_0x2b056e,_0x5685b8,_0xbaf890,_0x56fb61,_0x29e38c,_0x5b94('0x78'));})[_0x5b94('0x2c')](function(_0x13a449){if(_0x13a449){logger[_0x5b94('0x31')](_0x5b94('0x8b'),_0x13a449['id']);logger[_0x5b94('0x31')](_0x5b94('0x82'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x5b94('0x34')](_0x5b94('0x8c'),_0x494bc4[_0x5b94('0x19')]),_0x5b94('0x8d'),{'uri':_0x5b94('0x8e')+_0x2b056e[_0x5b94('0x7e')]+_0x5b94('0x8f')+_0x13a449['id']});}})[_0x5b94('0x2e')](function(_0x339e81){logger[_0x5b94('0x3c')](_0x5b94('0x82'),JSON[_0x5b94('0xc')](_0x339e81));});};exports[_0x5b94('0x75')]=function(_0x4474a8,_0x2480ce,_0x5bb93a,_0x37871b,_0x20251e,_0x320382,_0xebee98){var _0x47da33,_0x31b257,_0x893055;_0x320382[_0x5b94('0x7e')]=intUtil['stripTrailingSlash'](_0x320382['host']);_0x320382[_0x5b94('0x7f')]=intUtil['stripTrailingSlash'](_0x320382[_0x5b94('0x7f')]);if(_0xebee98&&_0xebee98['recordingFormat']&&_0xebee98['recordingFormat']!==_0x5b94('0x90')){logger['info'](_0x5b94('0x91'),_0x5b94('0x83'));_0x2480ce[_0x5b94('0x84')]=_0x320382['serverUrl']+'/api/voice/recordings/'+_0x2480ce['uniqueid']+_0x5b94('0x87')+md5(_0x2480ce[_0x5b94('0x86')]);}var _0x15520b=_0x320382[_0x5b94('0x7e')]===_0x5b94('0x88')?'eu':_0x5b94('0x92');return getAccessToken(_0x320382)[_0x5b94('0x2c')](function(_0x2ff051){_0x893055=_0x2ff051;return getUser(_0x893055,_0x15520b,_0x320382,_0x37871b[_0x5b94('0x93')]);})['then'](function(_0x5a423b){_0x47da33=_0x5a423b;logger[_0x5b94('0x31')](_0x5b94('0x94'),_0x47da33['id']);return getEndUser(_0x893055,_0x15520b,_0x320382,_0x2480ce[_0x5b94('0x95')],_0x2480ce[_0x5b94('0x96')],_0x47da33,_0x5bb93a);})[_0x5b94('0x2c')](function(_0x214e7b){_0x31b257=_0x214e7b;return getCall(_0x893055,_0x15520b,_0x320382,_0x47da33,_0x31b257,_0x5bb93a,_0x2480ce,_0x5b94('0x97'));})[_0x5b94('0x2c')](function(_0x23f55c){if(_0x23f55c){logger['info'](_0x5b94('0x8b'),_0x23f55c['id']);logger[_0x5b94('0x31')](_0x5b94('0x91'),_0x5b94('0x98'));emit(util['format'](_0x5b94('0x8c'),_0x37871b['name']),_0x5b94('0x8d'),{'uri':_0x5b94('0x8e')+_0x320382[_0x5b94('0x7e')]+_0x5b94('0x8f')+_0x23f55c['id']});}})[_0x5b94('0x2e')](function(_0x12a490){logger['error']('[OUTBOUND]',JSON[_0x5b94('0xc')](_0x12a490));});};exports[_0x5b94('0x99')]=function(_0x47ffbf,_0x1a1c1c,_0x147f51,_0x3f9202,_0x3a2852,_0x172b86){var _0xd56c8c,_0x401ebf,_0x57b241;_0x172b86[_0x5b94('0x7e')]=intUtil[_0x5b94('0x80')](_0x172b86[_0x5b94('0x7e')]);_0x172b86[_0x5b94('0x7f')]=intUtil['stripTrailingSlash'](_0x172b86[_0x5b94('0x7f')]);if(_0x3a2852&&_0x3a2852[_0x5b94('0x81')]){logger[_0x5b94('0x31')]('['+_0x1a1c1c['lastevent']['toUpperCase']()+']',_0x5b94('0x83'));_0x1a1c1c[_0x5b94('0x84')]=_0x172b86['serverUrl']+_0x5b94('0x85')+_0x1a1c1c[_0x5b94('0x86')]+_0x5b94('0x87')+md5(_0x1a1c1c['uniqueid']);}else{_0x1a1c1c['recordingURL']='';}var _0x58b1f7=_0x172b86[_0x5b94('0x7e')]===_0x5b94('0x88')?'eu':_0x5b94('0x92');return getAccessToken(_0x172b86)[_0x5b94('0x2c')](function(_0x397391){_0x57b241=_0x397391;return getUser(_0x57b241,_0x58b1f7,_0x172b86);})[_0x5b94('0x2c')](function(_0x356299){_0xd56c8c=_0x356299;logger[_0x5b94('0x31')](_0x5b94('0x94'),_0xd56c8c['id']);return getEndUser(_0x57b241,_0x58b1f7,_0x172b86,_0x1a1c1c[_0x5b94('0x89')],_0x1a1c1c[_0x5b94('0x8a')],_0xd56c8c,_0x147f51);})['then'](function(_0x36fcfd){_0x401ebf=_0x36fcfd;return getCall(_0x57b241,_0x58b1f7,_0x172b86,_0xd56c8c,_0x401ebf,_0x147f51,_0x1a1c1c,_0x5b94('0x78'));})[_0x5b94('0x2c')](function(_0xa603cd){if(_0xa603cd){logger[_0x5b94('0x31')](_0x5b94('0x8b'),_0xa603cd['id']);}})['catch'](function(_0x19de2e){logger['error']('['+_0x1a1c1c['lastevent']['toUpperCase']()+']',JSON[_0x5b94('0xc')](_0x19de2e));});}; \ 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 fd6d8eb..7fdfe68 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 _0x8688=['error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','shelljs','mustache','../../../../config/logger','trigger','exec','data2'];(function(_0x200ca2,_0x117050){var _0x43910b=function(_0x1a60c8){while(--_0x1a60c8){_0x200ca2['push'](_0x200ca2['shift']());}};_0x43910b(++_0x117050);}(_0x8688,0x139));var _0x8868=function(_0x435dfc,_0xe29096){_0x435dfc=_0x435dfc-0x0;var _0x33305e=_0x8688[_0x435dfc];return _0x33305e;};'use strict';var util=require('util');var sh=require(_0x8868('0x0'));var Mustache=require(_0x8868('0x1'));var logger=require(_0x8868('0x2'))(_0x8868('0x3'));exports[_0x8868('0x4')]=function(_0xa33561,_0x3eca4e){var _0xf0422f=_0xa33561[_0x8868('0x5')]?_0xa33561[_0x8868('0x5')]:'Script';var _0x5e4b6f=_0xa33561['data3']?Mustache['render'](_0xa33561['data3'],_0x3eca4e):_0x3eca4e;sh[_0x8868('0x4')](_0x5e4b6f,function(_0x1ec1a3,_0x1a9624,_0x4cd7be){if(_0x1ec1a3!==0x0){logger[_0x8868('0x6')](util[_0x8868('0x7')](_0x8868('0x8'),_0xf0422f,_0x5e4b6f,_0x1ec1a3,_0x4cd7be));}else{logger[_0x8868('0x9')](util[_0x8868('0x7')](_0x8868('0xa'),_0xf0422f,_0x5e4b6f,_0x1a9624));}});}; \ No newline at end of file +var _0x563d=['mustache','../../../../config/logger','trigger','exec','data2','Script','render','data3','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util'];(function(_0x23e785,_0x66b427){var _0x3f0686=function(_0x1d5f41){while(--_0x1d5f41){_0x23e785['push'](_0x23e785['shift']());}};_0x3f0686(++_0x66b427);}(_0x563d,0x1bf));var _0xd563=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0x563d[_0x45b034];return _0x509cb0;};'use strict';var util=require(_0xd563('0x0'));var sh=require('shelljs');var Mustache=require(_0xd563('0x1'));var logger=require(_0xd563('0x2'))(_0xd563('0x3'));exports[_0xd563('0x4')]=function(_0x2a168f,_0x66f8e7){var _0x9ea4c1=_0x2a168f[_0xd563('0x5')]?_0x2a168f['data2']:_0xd563('0x6');var _0x557b80=_0x2a168f['data3']?Mustache[_0xd563('0x7')](_0x2a168f[_0xd563('0x8')],_0x66f8e7):_0x66f8e7;sh[_0xd563('0x4')](_0x557b80,function(_0x583264,_0x3b8f88,_0x50df8c){if(_0x583264!==0x0){logger[_0xd563('0x9')](util[_0xd563('0xa')](_0xd563('0xb'),_0x9ea4c1,_0x557b80,_0x583264,_0x50df8c));}else{logger[_0xd563('0xc')](util['format'](_0xd563('0xd'),_0x9ea4c1,_0x557b80,_0x3b8f88));}});}; \ 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 da5a14b..353b7e5 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 _0x4a0b=['stack','GET','DELETE','PUT','data7','parse','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','then',',\x20request\x20body:\x20','stringify','format','data2','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode','name','request-promise','util','lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data5','headers','data6','error'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x4a0b,0x109));var _0xb4a0=function(_0x21f9c2,_0x2b3d2a){_0x21f9c2=_0x21f9c2-0x0;var _0x3da17f=_0x4a0b[_0x21f9c2];return _0x3da17f;};'use strict';var rp=require(_0xb4a0('0x0'));var util=require(_0xb4a0('0x1'));var _=require(_0xb4a0('0x2'));var Mustache=require(_0xb4a0('0x3'));var logger=require(_0xb4a0('0x4'))(_0xb4a0('0x5'));exports[_0xb4a0('0x6')]=function(_0xb36734,_0x365f27){var _0x184a42,_0x12b8f2;var _0x465069={'method':_0xb36734[_0xb4a0('0x7')][_0xb4a0('0x8')](),'uri':Mustache[_0xb4a0('0x9')](_0xb36734['data2'],_0x365f27),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0xb36734['data5'])==='number'&&parseInt(_0xb36734[_0xb4a0('0xa')])>=0x1&&parseInt(_0xb36734[_0xb4a0('0xa')])<=0xa?parseInt(_0xb36734[_0xb4a0('0xa')])*0x3e8:0x5*0x3e8};try{_0x465069[_0xb4a0('0xb')]=_0xb36734[_0xb4a0('0xc')]?JSON['parse'](Mustache[_0xb4a0('0x9')](_0xb36734[_0xb4a0('0xc')],_0x365f27)):{};}catch(_0x250506){logger[_0xb4a0('0xd')](_0x250506[_0xb4a0('0xe')]);}switch(_0xb36734[_0xb4a0('0x7')][_0xb4a0('0x8')]()){case _0xb4a0('0xf'):case _0xb4a0('0x10'):_0x184a42=null;_0x465069['qs']=_0x365f27;break;case'POST':case _0xb4a0('0x11'):if(_0xb36734[_0xb4a0('0x12')]){try{_0x184a42=JSON[_0xb4a0('0x13')](Mustache[_0xb4a0('0x9')](_0xb36734['data7'],_0x365f27));_0x465069[_0xb4a0('0x14')]=_0x184a42;}catch(_0x287ca9){logger[_0xb4a0('0xd')](_0x287ca9[_0xb4a0('0xe')]);logger[_0xb4a0('0xd')](_0xb4a0('0x15'));}}else{_0x184a42=_0x365f27;_0x465069[_0xb4a0('0x14')]=_0x184a42;}break;}logger['info'](util['format']('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0xb36734['data1'],_0xb36734['data2'],JSON['stringify'](_0x465069)));rp(_0x465069)[_0xb4a0('0x16')](function(_0x4f6b30){_0x184a42=!_['isNil'](_0x184a42)?_0xb4a0('0x17')+_0x184a42:'';_0x12b8f2=typeof _0x4f6b30[_0xb4a0('0x14')]==='object'?JSON[_0xb4a0('0x18')](_0x4f6b30['body']):_0x4f6b30[_0xb4a0('0x14')];logger['info'](util[_0xb4a0('0x19')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0xb36734[_0xb4a0('0x7')],_0xb36734[_0xb4a0('0x1a')],_0x4f6b30['statusCode'],_0x12b8f2));})[_0xb4a0('0x1b')](function(_0x4a03cd){logger[_0xb4a0('0xd')](util[_0xb4a0('0x19')](_0xb4a0('0x1c'),_0xb36734[_0xb4a0('0x7')],_0xb36734[_0xb4a0('0x1a')],_0x4a03cd[_0xb4a0('0x1d')],_0x4a03cd[_0xb4a0('0x1e')],_0x4a03cd['message']));});}; \ No newline at end of file +var _0xe765=['error','body','info','format','stringify','then','isNil','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','name','message','request-promise','util','lodash','../../../../config/logger','trigger','exec','data1','toUpperCase','data2','number','data6','parse','stack','DELETE','POST','PUT','data7','render'];(function(_0x2965e5,_0x48397c){var _0x4b1139=function(_0x3ae07b){while(--_0x3ae07b){_0x2965e5['push'](_0x2965e5['shift']());}};_0x4b1139(++_0x48397c);}(_0xe765,0xc7));var _0x5e76=function(_0x6fcaa,_0x116f60){_0x6fcaa=_0x6fcaa-0x0;var _0x26269f=_0xe765[_0x6fcaa];return _0x26269f;};'use strict';var rp=require(_0x5e76('0x0'));var util=require(_0x5e76('0x1'));var _=require(_0x5e76('0x2'));var Mustache=require('mustache');var logger=require(_0x5e76('0x3'))(_0x5e76('0x4'));exports[_0x5e76('0x5')]=function(_0x120cb6,_0x2c00d2){var _0x3b318b,_0x58af15;var _0x7bb1b={'method':_0x120cb6[_0x5e76('0x6')][_0x5e76('0x7')](),'uri':Mustache['render'](_0x120cb6[_0x5e76('0x8')],_0x2c00d2),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x120cb6['data5'])===_0x5e76('0x9')&&parseInt(_0x120cb6['data5'])>=0x1&&parseInt(_0x120cb6['data5'])<=0xa?parseInt(_0x120cb6['data5'])*0x3e8:0x5*0x3e8};try{_0x7bb1b['headers']=_0x120cb6[_0x5e76('0xa')]?JSON[_0x5e76('0xb')](Mustache['render'](_0x120cb6[_0x5e76('0xa')],_0x2c00d2)):{};}catch(_0x10bbf4){logger['error'](_0x10bbf4[_0x5e76('0xc')]);}switch(_0x120cb6[_0x5e76('0x6')]['toUpperCase']()){case'GET':case _0x5e76('0xd'):_0x3b318b=null;_0x7bb1b['qs']=_0x2c00d2;break;case _0x5e76('0xe'):case _0x5e76('0xf'):if(_0x120cb6[_0x5e76('0x10')]){try{_0x3b318b=JSON[_0x5e76('0xb')](Mustache[_0x5e76('0x11')](_0x120cb6[_0x5e76('0x10')],_0x2c00d2));_0x7bb1b['body']=_0x3b318b;}catch(_0x52df46){logger[_0x5e76('0x12')](_0x52df46[_0x5e76('0xc')]);logger[_0x5e76('0x12')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x3b318b=_0x2c00d2;_0x7bb1b[_0x5e76('0x13')]=_0x3b318b;}break;}logger[_0x5e76('0x14')](util[_0x5e76('0x15')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x120cb6['data1'],_0x120cb6[_0x5e76('0x8')],JSON[_0x5e76('0x16')](_0x7bb1b)));rp(_0x7bb1b)[_0x5e76('0x17')](function(_0x253e6e){_0x3b318b=!_[_0x5e76('0x18')](_0x3b318b)?',\x20request\x20body:\x20'+_0x3b318b:'';_0x58af15=typeof _0x253e6e['body']===_0x5e76('0x19')?JSON['stringify'](_0x253e6e['body']):_0x253e6e['body'];logger[_0x5e76('0x14')](util[_0x5e76('0x15')](_0x5e76('0x1a'),_0x120cb6[_0x5e76('0x6')],_0x120cb6['data2'],_0x253e6e[_0x5e76('0x1b')],_0x58af15));})[_0x5e76('0x1c')](function(_0x50a89d){logger[_0x5e76('0x12')](util[_0x5e76('0x15')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x120cb6[_0x5e76('0x6')],_0x120cb6[_0x5e76('0x8')],_0x50a89d[_0x5e76('0x1b')],_0x50a89d[_0x5e76('0x1d')],_0x50a89d[_0x5e76('0x1e')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index d9b68ce..efc667c 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 _0x3948=['http','Request','then','debug','rpc','routing','error','message','catch','exports','jayson/promise','bluebird','../../config/logger','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3948,0x106));var _0x8394=function(_0x4fa126,_0x299500){_0x4fa126=_0x4fa126-0x0;var _0x2db74d=_0x3948[_0x4fa126];return _0x2db74d;};'use strict';var jayson=require(_0x8394('0x0'));var BPromise=require(_0x8394('0x1'));var logger=require(_0x8394('0x2'))('routing');var client=jayson[_0x8394('0x3')][_0x8394('0x4')]({'port':0x2329});client[_0x8394('0x5')]=function(_0x25f4a4,_0x5bcebd){return new BPromise(function(_0x54543c,_0x2551d6){return client['request'](_0x25f4a4,_0x5bcebd)[_0x8394('0x6')](function(_0xf05e7c){logger[_0x8394('0x7')](_0x8394('0x8'),_0x8394('0x9'),_0x25f4a4,_0x5bcebd,_0xf05e7c);if(_0xf05e7c[_0x8394('0xa')]){logger[_0x8394('0xa')]('rpc',_0x8394('0x9'),_0x25f4a4,_0xf05e7c[_0x8394('0xa')]['message'],_0x5bcebd);return _0x2551d6(_0xf05e7c['error'][_0x8394('0xb')]);}else{return _0x54543c(_0xf05e7c['result']);}})[_0x8394('0xc')](function(_0x22c0a2){logger['error']('rpc',_0x8394('0x9'),_0x25f4a4,_0x22c0a2,_0x5bcebd);return _0x2551d6(_0x22c0a2);});});};module[_0x8394('0xd')]=client; \ No newline at end of file +var _0x7028=['error','message','result','catch','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request','then','debug','rpc'];(function(_0x40c0a5,_0x4d5f6f){var _0x5b6a0d=function(_0x3f014c){while(--_0x3f014c){_0x40c0a5['push'](_0x40c0a5['shift']());}};_0x5b6a0d(++_0x4d5f6f);}(_0x7028,0x199));var _0x8702=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x7028[_0x47e7cb];return _0x2a8874;};'use strict';var jayson=require(_0x8702('0x0'));var BPromise=require(_0x8702('0x1'));var logger=require(_0x8702('0x2'))(_0x8702('0x3'));var client=jayson[_0x8702('0x4')][_0x8702('0x5')]({'port':0x2329});client[_0x8702('0x6')]=function(_0x280361,_0x364f1e){return new BPromise(function(_0x26feab,_0x12d2ca){return client[_0x8702('0x7')](_0x280361,_0x364f1e)[_0x8702('0x8')](function(_0x286db1){logger[_0x8702('0x9')](_0x8702('0xa'),_0x8702('0x3'),_0x280361,_0x364f1e,_0x286db1);if(_0x286db1[_0x8702('0xb')]){logger[_0x8702('0xb')](_0x8702('0xa'),_0x8702('0x3'),_0x280361,_0x286db1['error'][_0x8702('0xc')],_0x364f1e);return _0x12d2ca(_0x286db1['error'][_0x8702('0xc')]);}else{return _0x26feab(_0x286db1[_0x8702('0xd')]);}})[_0x8702('0xe')](function(_0x115afa){logger['error']('rpc',_0x8702('0x3'),_0x280361,_0x115afa,_0x364f1e);return _0x12d2ca(_0x115afa);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index a3b174a..e52a4d6 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 _0x9685=['./rpc/mailAccount','./rpc/setting','../../config/logger','email','getMailAccounts','then','refresh','mailAccounts','listen','getSettings','loginMailFrequency','Email\x20service\x20initialization','./server','./realtime','./lib/email'];(function(_0x5a43f7,_0x1f74e8){var _0x199021=function(_0x216d06){while(--_0x216d06){_0x5a43f7['push'](_0x5a43f7['shift']());}};_0x199021(++_0x1f74e8);}(_0x9685,0x84));var _0x5968=function(_0x324d0a,_0x56987a){_0x324d0a=_0x324d0a-0x0;var _0x18b0db=_0x9685[_0x324d0a];return _0x18b0db;};'use strict';var server=require(_0x5968('0x0'));var Realtime=require(_0x5968('0x1'));var EmailChannel=require(_0x5968('0x2'));var mailAccount=require(_0x5968('0x3'));var setting=require(_0x5968('0x4'));var logger=require(_0x5968('0x5'))(_0x5968('0x6'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()['then'](mailAccount[_0x5968('0x7')]())[_0x5968('0x8')](realtime['initMailAccounts']())[_0x5968('0x8')](function(){email[_0x5968('0x9')](realtime[_0x5968('0xa')]);return realtime;});}function main(){return server[_0x5968('0xb')](realtime,email)[_0x5968('0x8')](function(){return initRealtime();})['then'](function(){return setting[_0x5968('0xc')]();})[_0x5968('0x8')](function(_0x155700){return setInterval(initRealtime,_0x155700[_0x5968('0xd')]*0x3e8);})['catch'](function(_0x1a264b){logger['error'](_0x5968('0xe'),_0x1a264b);});}main(); \ No newline at end of file +var _0x37cf=['./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','resolve','then','getMailAccounts','refresh','mailAccounts','listen','getSettings','loginMailFrequency','catch','error','Email\x20service\x20initialization','./server'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x37cf,0x1af));var _0xf37c=function(_0x570f94,_0x4a4b9e){_0x570f94=_0x570f94-0x0;var _0xeddf9c=_0x37cf[_0x570f94];return _0xeddf9c;};'use strict';var server=require(_0xf37c('0x0'));var Realtime=require(_0xf37c('0x1'));var EmailChannel=require(_0xf37c('0x2'));var mailAccount=require(_0xf37c('0x3'));var setting=require(_0xf37c('0x4'));var logger=require(_0xf37c('0x5'))(_0xf37c('0x6'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xf37c('0x7')]()[_0xf37c('0x8')](mailAccount[_0xf37c('0x9')]())[_0xf37c('0x8')](realtime['initMailAccounts']())['then'](function(){email[_0xf37c('0xa')](realtime[_0xf37c('0xb')]);return realtime;});}function main(){return server[_0xf37c('0xc')](realtime,email)[_0xf37c('0x8')](function(){return initRealtime();})[_0xf37c('0x8')](function(){return setting[_0xf37c('0xd')]();})['then'](function(_0x545b5c){return setInterval(initRealtime,_0x545b5c[_0xf37c('0xe')]*0x3e8);})[_0xf37c('0xf')](function(_0xafc645){logger[_0xf37c('0x10')](_0xf37c('0x11'),_0xafc645);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 5d3c737..ff60ddc 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 _0xe890=['../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','prototype','name','active','Imap','status','messageStatus','total','md5','refresh','hasOwnProperty','service','provider','custom','box','handleImapBox','email','bind','end','handleImapEnd','error','isNil','disabled','emit','connected','handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','lastSync','handleImapError','sendMail','smtp','send','verifySmtp','Smtp','verified','verify','exports','lodash','moment','bluebird','ioredis','../../../config/environment','../../../config/logger','defaults','redis','./imap','./smtp'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xe890,0x152));var _0x0e89=function(_0xb85040,_0x2c43a6){_0xb85040=_0xb85040-0x0;var _0x1e7aae=_0xe890[_0xb85040];return _0x1e7aae;};'use strict';var _=require(_0x0e89('0x0'));var moment=require(_0x0e89('0x1'));var BPromise=require(_0x0e89('0x2'));var md5=require('md5');var Redis=require(_0x0e89('0x3'));var config=require(_0x0e89('0x4'));var logger=require(_0x0e89('0x5'))('email');config['redis']=_[_0x0e89('0x6')](config[_0x0e89('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0e89('0x7')]));var EmailImap=require(_0x0e89('0x8'));var EmailSmtp=require(_0x0e89('0x9'));var mailAccount=require(_0x0e89('0xa'));var md5Accounts={};function EmailChannel(_0x27892e){logger[_0x0e89('0xb')](_0x0e89('0xc'));this['mailAccounts']=_0x27892e[_0x0e89('0xd')];this[_0x0e89('0xe')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0x0e89('0xf')]['emit']=function(_0x230193){var _0x5a5eca=this[_0x0e89('0xd')][_0x230193];var _0x56ad7d={'id':_0x5a5eca['id'],'name':_0x5a5eca[_0x0e89('0x10')],'key':_0x5a5eca['key'],'active':_0x5a5eca[_0x0e89('0x11')],'Imap':{'status':_0x5a5eca[_0x0e89('0x12')][_0x0e89('0x13')],'messageStatus':_0x5a5eca[_0x0e89('0x12')][_0x0e89('0x14')],'total':_0x5a5eca[_0x0e89('0x12')][_0x0e89('0x15')]}};if(_['isNil'](md5Accounts[_0x230193])){md5Accounts[_0x230193]={};}var _0x14f518=md5(JSON['stringify'](_0x56ad7d));if(md5Accounts[_0x230193][_0x0e89('0x16')]!==_0x14f518){md5Accounts[_0x230193]['md5']=_0x14f518;io['emit']('mailAccount:update',_0x56ad7d);}};EmailChannel['prototype'][_0x0e89('0x17')]=function(_0x4b814f){for(var _0x48139d in _0x4b814f){if(_0x4b814f[_0x0e89('0x18')](_0x48139d)){if(_0x4b814f[_0x48139d][_0x0e89('0x12')]&&_0x4b814f[_0x48139d]['active']){var _0x20fd5d=_0x4b814f[_0x48139d][_0x0e89('0x12')];if(!_0x20fd5d[_0x0e89('0x19')]&&_0x4b814f[_0x48139d][_0x0e89('0x1a')]!==_0x0e89('0x1b'))_0x20fd5d[_0x0e89('0x19')]=_0x4b814f[_0x48139d][_0x0e89('0x1a')];if(!this[_0x0e89('0xe')][_0x0e89('0x18')](_0x20fd5d['id'])){this[_0x0e89('0xe')][_0x20fd5d['id']]=new EmailImap(_0x20fd5d,_0x4b814f[_0x48139d]['email']);this[_0x0e89('0xe')][_0x20fd5d['id']]['on'](_0x0e89('0x1c'),this[_0x0e89('0x1d')]['bind'](this,_0x48139d));this['imapAccounts'][_0x20fd5d['id']]['on'](_0x0e89('0x1e'),this['handleImapEmail'][_0x0e89('0x1f')](this,_0x48139d));this['imapAccounts'][_0x20fd5d['id']]['on'](_0x0e89('0x20'),this[_0x0e89('0x21')][_0x0e89('0x1f')](this,_0x48139d));this[_0x0e89('0xe')][_0x20fd5d['id']]['on'](_0x0e89('0x22'),this['handleImapError'][_0x0e89('0x1f')](this,_0x48139d));}}else{if(_[_0x0e89('0x23')](this[_0x0e89('0xd')][_0x48139d]['Imap'])){this[_0x0e89('0xd')][_0x48139d]['Imap']={};}this[_0x0e89('0xd')][_0x48139d][_0x0e89('0x12')][_0x0e89('0x13')]=_0x0e89('0x24');this[_0x0e89('0xd')][_0x48139d][_0x0e89('0x12')]['messageStatus']='';this[_0x0e89('0x25')](_0x48139d);}}}};EmailChannel['prototype'][_0x0e89('0x1d')]=function(_0x3e138c,_0x22c063){if(this[_0x0e89('0xd')][_0x3e138c]){this[_0x0e89('0xd')][_0x3e138c]['Imap'][_0x0e89('0x13')]=_0x0e89('0x26');this[_0x0e89('0xd')][_0x3e138c][_0x0e89('0x12')]['messageStatus']=_0x22c063['name'];if(_0x22c063['messages']){this[_0x0e89('0xd')][_0x3e138c][_0x0e89('0x12')][_0x0e89('0x15')]=_0x22c063['messages'][_0x0e89('0x15')];}return this[_0x0e89('0x25')](_0x3e138c);}};EmailChannel['prototype'][_0x0e89('0x27')]=function(_0x41f3a5,_0x11e6f2){logger[_0x0e89('0xb')](_0x0e89('0x28'),_0x11e6f2['firstName'],_0x11e6f2[_0x0e89('0x29')],_0x11e6f2[_0x0e89('0x2a')],_0x41f3a5);if(this['mailAccounts'][_0x41f3a5]){return mailAccount['notify'](_0x41f3a5,_0x11e6f2)[_0x0e89('0x2b')](function(_0x3a133f){if(_0x3a133f){logger[_0x0e89('0xb')](_0x0e89('0x2c'));}})[_0x0e89('0x2d')](function(_0x32f810){logger[_0x0e89('0x22')](_0x0e89('0x2e'),JSON[_0x0e89('0x2f')](_0x32f810));});}};EmailChannel[_0x0e89('0xf')]['handleImapEnd']=function(_0x58dc89){if(this['mailAccounts'][_0x58dc89]&&this[_0x0e89('0xd')][_0x58dc89][_0x0e89('0x12')]){if(this[_0x0e89('0xe')][this['mailAccounts'][_0x58dc89][_0x0e89('0x12')]['id']]){delete this['imapAccounts'][this['mailAccounts'][_0x58dc89][_0x0e89('0x12')]['id']];}this[_0x0e89('0xd')][_0x58dc89][_0x0e89('0x12')][_0x0e89('0x30')]=moment();this['emit'](_0x58dc89);}};EmailChannel['prototype'][_0x0e89('0x31')]=function(_0x3a2423,_0xd5c69b){if(this[_0x0e89('0xd')][_0x3a2423]){this['mailAccounts'][_0x3a2423][_0x0e89('0x12')][_0x0e89('0x13')]=_0x0e89('0x22');this[_0x0e89('0xd')][_0x3a2423][_0x0e89('0x12')][_0x0e89('0x14')]=_0xd5c69b;return this[_0x0e89('0x25')](_0x3a2423);}};EmailChannel[_0x0e89('0xf')][_0x0e89('0x32')]=function(_0x2d816f,_0x31ef47){return this[_0x0e89('0x33')][_0x0e89('0x34')](_0x2d816f,_0x31ef47);};EmailChannel['prototype'][_0x0e89('0x35')]=function(_0x37c7d8){var _0x48d6fc=this;if(this[_0x0e89('0xd')][_0x37c7d8['id']]){if(_[_0x0e89('0x23')](this['mailAccounts'][_0x37c7d8['id']]['Smtp'])){this[_0x0e89('0xd')][_0x37c7d8['id']][_0x0e89('0x36')]={};}this[_0x0e89('0xd')][_0x37c7d8['id']][_0x0e89('0x36')][_0x0e89('0x30')]=moment();return new BPromise(function(_0x2c8bae,_0x516a81){return _0x48d6fc['smtp']['verify'](_0x37c7d8)[_0x0e89('0x2b')](function(_0x5a36cf){_0x48d6fc[_0x0e89('0xd')][_0x37c7d8['id']][_0x0e89('0x36')][_0x0e89('0x13')]=_0x0e89('0x37');_0x48d6fc[_0x0e89('0xd')][_0x37c7d8['id']][_0x0e89('0x36')][_0x0e89('0x14')]='';_0x48d6fc[_0x0e89('0x25')](_0x37c7d8['id']);_0x2c8bae(_0x5a36cf);})[_0x0e89('0x2d')](function(_0x541bc8){_0x48d6fc[_0x0e89('0xd')][_0x37c7d8['id']][_0x0e89('0x36')][_0x0e89('0x13')]='error';_0x48d6fc[_0x0e89('0xd')][_0x37c7d8['id']][_0x0e89('0x36')][_0x0e89('0x14')]=_0x541bc8;_0x48d6fc[_0x0e89('0x25')](_0x37c7d8['id']);_0x516a81(_0x541bc8);});});}return this[_0x0e89('0x33')][_0x0e89('0x38')](_0x37c7d8);};module[_0x0e89('0x39')]=EmailChannel; \ No newline at end of file +var _0xd3c5=['status','messageStatus','total','isNil','stringify','mailAccount:update','prototype','refresh','hasOwnProperty','provider','custom','service','imapAccounts','email','box','bind','end','handleImapError','disabled','connected','messages','handleImapEmail','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','error','sendMail','send','verifySmtp','Smtp','verify','verified','lodash','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','localhost','socket.io-emitter','./imap','./smtp','start\x20email\x20channel','mailAccounts','smtp','emit','name','key','active','Imap'];(function(_0x2edb2a,_0x1b22e3){var _0xfd9b20=function(_0x5a2bbd){while(--_0x5a2bbd){_0x2edb2a['push'](_0x2edb2a['shift']());}};_0xfd9b20(++_0x1b22e3);}(_0xd3c5,0x184));var _0x5d3c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd3c5[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x5d3c('0x0'));var moment=require('moment');var BPromise=require(_0x5d3c('0x1'));var md5=require(_0x5d3c('0x2'));var Redis=require(_0x5d3c('0x3'));var config=require(_0x5d3c('0x4'));var logger=require(_0x5d3c('0x5'))('email');config['redis']=_['defaults'](config['redis'],{'host':_0x5d3c('0x6'),'port':0x18eb});var io=require(_0x5d3c('0x7'))(new Redis(config['redis']));var EmailImap=require(_0x5d3c('0x8'));var EmailSmtp=require(_0x5d3c('0x9'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x4c4e96){logger['info'](_0x5d3c('0xa'));this[_0x5d3c('0xb')]=_0x4c4e96[_0x5d3c('0xb')];this['imapAccounts']={};this[_0x5d3c('0xc')]=new EmailSmtp();}EmailChannel['prototype'][_0x5d3c('0xd')]=function(_0x53391d){var _0x3f1397=this['mailAccounts'][_0x53391d];var _0x3c0393={'id':_0x3f1397['id'],'name':_0x3f1397[_0x5d3c('0xe')],'key':_0x3f1397[_0x5d3c('0xf')],'active':_0x3f1397[_0x5d3c('0x10')],'Imap':{'status':_0x3f1397[_0x5d3c('0x11')][_0x5d3c('0x12')],'messageStatus':_0x3f1397[_0x5d3c('0x11')][_0x5d3c('0x13')],'total':_0x3f1397['Imap'][_0x5d3c('0x14')]}};if(_[_0x5d3c('0x15')](md5Accounts[_0x53391d])){md5Accounts[_0x53391d]={};}var _0x7fd062=md5(JSON[_0x5d3c('0x16')](_0x3c0393));if(md5Accounts[_0x53391d]['md5']!==_0x7fd062){md5Accounts[_0x53391d][_0x5d3c('0x2')]=_0x7fd062;io[_0x5d3c('0xd')](_0x5d3c('0x17'),_0x3c0393);}};EmailChannel[_0x5d3c('0x18')][_0x5d3c('0x19')]=function(_0x52e231){for(var _0x4516d6 in _0x52e231){if(_0x52e231[_0x5d3c('0x1a')](_0x4516d6)){if(_0x52e231[_0x4516d6][_0x5d3c('0x11')]&&_0x52e231[_0x4516d6][_0x5d3c('0x10')]){var _0x46e2b9=_0x52e231[_0x4516d6][_0x5d3c('0x11')];if(!_0x46e2b9['service']&&_0x52e231[_0x4516d6][_0x5d3c('0x1b')]!==_0x5d3c('0x1c'))_0x46e2b9[_0x5d3c('0x1d')]=_0x52e231[_0x4516d6][_0x5d3c('0x1b')];if(!this['imapAccounts'][_0x5d3c('0x1a')](_0x46e2b9['id'])){this[_0x5d3c('0x1e')][_0x46e2b9['id']]=new EmailImap(_0x46e2b9,_0x52e231[_0x4516d6][_0x5d3c('0x1f')]);this['imapAccounts'][_0x46e2b9['id']]['on'](_0x5d3c('0x20'),this['handleImapBox'][_0x5d3c('0x21')](this,_0x4516d6));this[_0x5d3c('0x1e')][_0x46e2b9['id']]['on'](_0x5d3c('0x1f'),this['handleImapEmail'][_0x5d3c('0x21')](this,_0x4516d6));this[_0x5d3c('0x1e')][_0x46e2b9['id']]['on'](_0x5d3c('0x22'),this['handleImapEnd'][_0x5d3c('0x21')](this,_0x4516d6));this[_0x5d3c('0x1e')][_0x46e2b9['id']]['on']('error',this[_0x5d3c('0x23')]['bind'](this,_0x4516d6));}}else{if(_[_0x5d3c('0x15')](this[_0x5d3c('0xb')][_0x4516d6]['Imap'])){this[_0x5d3c('0xb')][_0x4516d6][_0x5d3c('0x11')]={};}this[_0x5d3c('0xb')][_0x4516d6][_0x5d3c('0x11')]['status']=_0x5d3c('0x24');this['mailAccounts'][_0x4516d6][_0x5d3c('0x11')][_0x5d3c('0x13')]='';this[_0x5d3c('0xd')](_0x4516d6);}}}};EmailChannel[_0x5d3c('0x18')]['handleImapBox']=function(_0x4b8168,_0x463cc4){if(this[_0x5d3c('0xb')][_0x4b8168]){this[_0x5d3c('0xb')][_0x4b8168][_0x5d3c('0x11')]['status']=_0x5d3c('0x25');this[_0x5d3c('0xb')][_0x4b8168][_0x5d3c('0x11')][_0x5d3c('0x13')]=_0x463cc4['name'];if(_0x463cc4[_0x5d3c('0x26')]){this[_0x5d3c('0xb')][_0x4b8168]['Imap']['total']=_0x463cc4['messages']['total'];}return this['emit'](_0x4b8168);}};EmailChannel['prototype'][_0x5d3c('0x27')]=function(_0x188ca2,_0x194546){logger[_0x5d3c('0x28')](_0x5d3c('0x29'),_0x194546[_0x5d3c('0x2a')],_0x194546[_0x5d3c('0x2b')],_0x194546[_0x5d3c('0x2c')],_0x188ca2);if(this[_0x5d3c('0xb')][_0x188ca2]){return mailAccount[_0x5d3c('0x2d')](_0x188ca2,_0x194546)[_0x5d3c('0x2e')](function(_0x2bef57){if(_0x2bef57){logger['info'](_0x5d3c('0x2f'));}})[_0x5d3c('0x30')](function(_0x122d52){logger['error'](_0x5d3c('0x31'),JSON[_0x5d3c('0x16')](_0x122d52));});}};EmailChannel[_0x5d3c('0x18')]['handleImapEnd']=function(_0x4fd4d6){if(this['mailAccounts'][_0x4fd4d6]&&this[_0x5d3c('0xb')][_0x4fd4d6][_0x5d3c('0x11')]){if(this[_0x5d3c('0x1e')][this['mailAccounts'][_0x4fd4d6][_0x5d3c('0x11')]['id']]){delete this[_0x5d3c('0x1e')][this[_0x5d3c('0xb')][_0x4fd4d6][_0x5d3c('0x11')]['id']];}this['mailAccounts'][_0x4fd4d6][_0x5d3c('0x11')][_0x5d3c('0x32')]=moment();this['emit'](_0x4fd4d6);}};EmailChannel[_0x5d3c('0x18')]['handleImapError']=function(_0x219f6f,_0x2c5bd1){if(this[_0x5d3c('0xb')][_0x219f6f]){this[_0x5d3c('0xb')][_0x219f6f][_0x5d3c('0x11')]['status']=_0x5d3c('0x33');this[_0x5d3c('0xb')][_0x219f6f][_0x5d3c('0x11')]['messageStatus']=_0x2c5bd1;return this[_0x5d3c('0xd')](_0x219f6f);}};EmailChannel[_0x5d3c('0x18')][_0x5d3c('0x34')]=function(_0x47ef06,_0xa88c73){return this[_0x5d3c('0xc')][_0x5d3c('0x35')](_0x47ef06,_0xa88c73);};EmailChannel['prototype'][_0x5d3c('0x36')]=function(_0x46b9b7){var _0x35424e=this;if(this[_0x5d3c('0xb')][_0x46b9b7['id']]){if(_[_0x5d3c('0x15')](this['mailAccounts'][_0x46b9b7['id']]['Smtp'])){this[_0x5d3c('0xb')][_0x46b9b7['id']][_0x5d3c('0x37')]={};}this[_0x5d3c('0xb')][_0x46b9b7['id']]['Smtp'][_0x5d3c('0x32')]=moment();return new BPromise(function(_0x581ebe,_0xe6a653){return _0x35424e[_0x5d3c('0xc')][_0x5d3c('0x38')](_0x46b9b7)[_0x5d3c('0x2e')](function(_0x5a5a67){_0x35424e[_0x5d3c('0xb')][_0x46b9b7['id']][_0x5d3c('0x37')]['status']=_0x5d3c('0x39');_0x35424e[_0x5d3c('0xb')][_0x46b9b7['id']][_0x5d3c('0x37')][_0x5d3c('0x13')]='';_0x35424e[_0x5d3c('0xd')](_0x46b9b7['id']);_0x581ebe(_0x5a5a67);})[_0x5d3c('0x30')](function(_0x535dfe){_0x35424e[_0x5d3c('0xb')][_0x46b9b7['id']]['Smtp'][_0x5d3c('0x12')]=_0x5d3c('0x33');_0x35424e[_0x5d3c('0xb')][_0x46b9b7['id']][_0x5d3c('0x37')][_0x5d3c('0x13')]=_0x535dfe;_0x35424e['emit'](_0x46b9b7['id']);_0xe6a653(_0x535dfe);});});}return this[_0x5d3c('0xc')]['verify'](_0x46b9b7);};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 b8f9dc0..d00255c 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 _0x0adf=['body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','emit','stringify','textCode','upperFirst','exports','lodash','util','imap','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','mailbox','INBOX','account','getAccount','ready','bind','once','end','handleEnd','error','handleError','inherits','prototype','connTimeout','authTimeout','service','user','email','anonymous@xcally.com','modernAuthentication','CloudProvider','data5','password','authentication','host','port','tls','autotls','required','handleReady','openBox','handleOpenBox','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox'];(function(_0xee0fdb,_0x17db14){var _0x564095=function(_0x44ea8f){while(--_0x44ea8f){_0xee0fdb['push'](_0xee0fdb['shift']());}};_0x564095(++_0x17db14);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x449d74,_0x427c48){_0x449d74=_0x449d74-0x0;var _0x28862e=_0x0adf[_0x449d74];return _0x28862e;};'use strict';var _=require(_0xf0ad('0x0'));var util=require(_0xf0ad('0x1'));var Imap=require(_0xf0ad('0x2'));var simpleParser=require('mailparser')[_0xf0ad('0x3')];var Iconv=require(_0xf0ad('0x4'))[_0xf0ad('0x5')];var EventEmitter=require(_0xf0ad('0x6'))[_0xf0ad('0x7')];var utils=require(_0xf0ad('0x8'));var logger=require(_0xf0ad('0x9'))('email');function EmailImap(_0x3bbf85,_0x53221f){this[_0xf0ad('0xa')]=_0xf0ad('0xb');this[_0xf0ad('0xc')]=this[_0xf0ad('0xd')](_0x3bbf85,_0x53221f);this[_0xf0ad('0x2')]=new Imap(this[_0xf0ad('0xc')]);this[_0xf0ad('0x2')]['once'](_0xf0ad('0xe'),this['handleReady'][_0xf0ad('0xf')](this));this[_0xf0ad('0x2')][_0xf0ad('0x10')](_0xf0ad('0x11'),this[_0xf0ad('0x12')]['bind'](this));this['imap']['on'](_0xf0ad('0x13'),this[_0xf0ad('0x14')][_0xf0ad('0xf')](this));this[_0xf0ad('0x2')]['connect']();}util[_0xf0ad('0x15')](EmailImap,EventEmitter);EmailImap[_0xf0ad('0x16')]['getAccount']=function(_0x49df92,_0x5332e9){var _0x221d7b={'connTimeout':_0x49df92['connTimeout']?_0x49df92[_0xf0ad('0x17')]*0x3e8:0x2710,'authTimeout':_0x49df92[_0xf0ad('0x18')]?_0x49df92[_0xf0ad('0x18')]*0x3e8:0x1388};if(_0x49df92[_0xf0ad('0x19')]){_0x221d7b[_0xf0ad('0x1a')]=_0x49df92['user'];_0x221d7b[_0xf0ad('0x1b')]=_0x5332e9||_0x49df92[_0xf0ad('0x1a')]||_0xf0ad('0x1c');if(_0x49df92[_0xf0ad('0x1d')]){_0x221d7b['xoauth2']=utils['generateXOAuth2Token'](_0x49df92[_0xf0ad('0x1e')][_0xf0ad('0x1f')],_0x49df92['user']);}else{_0x221d7b[_0xf0ad('0x20')]=_0x49df92[_0xf0ad('0x20')];}}else{if(_0x49df92[_0xf0ad('0x21')]){_0x221d7b[_0xf0ad('0x1a')]=_0x49df92['user'];_0x221d7b['password']=_0x49df92[_0xf0ad('0x20')];}}_0x221d7b[_0xf0ad('0x22')]=_0x49df92[_0xf0ad('0x22')];_0x221d7b[_0xf0ad('0x23')]=_0x49df92[_0xf0ad('0x23')]||0x3e1;if(_0x49df92[_0xf0ad('0x24')]){_0x221d7b['tls']=!![];}else{_0x221d7b[_0xf0ad('0x24')]=![];_0x221d7b[_0xf0ad('0x25')]=_0xf0ad('0x26');}return _0x221d7b;};EmailImap[_0xf0ad('0x16')][_0xf0ad('0x27')]=function(){this[_0xf0ad('0x2')][_0xf0ad('0x28')](this[_0xf0ad('0xa')],![],this[_0xf0ad('0x29')][_0xf0ad('0xf')](this));};EmailImap[_0xf0ad('0x16')][_0xf0ad('0x29')]=function(_0xeae85c,_0x456f81){if(_0xeae85c){this[_0xf0ad('0x14')](_0xeae85c,!![]);}else{this['emit'](_0xf0ad('0x2a'),_0x456f81);this[_0xf0ad('0x2b')]();}};EmailImap[_0xf0ad('0x16')][_0xf0ad('0x2c')]=function(_0x28c280){if(_0x28c280){this[_0xf0ad('0x14')](_0x28c280,!![]);}else{this['imap'][_0xf0ad('0x11')]();}};EmailImap[_0xf0ad('0x16')][_0xf0ad('0x2b')]=function(){this[_0xf0ad('0x2')][_0xf0ad('0x2d')]([_0xf0ad('0x2e')],this[_0xf0ad('0x2f')][_0xf0ad('0xf')](this));};EmailImap[_0xf0ad('0x16')][_0xf0ad('0x2f')]=function(_0x2d1b2f,_0x4c839d){if(_0x2d1b2f){this[_0xf0ad('0x14')](_0x2d1b2f,!![]);}else{if(_0x4c839d['length']){try{var _0x83f211=this['imap'][_0xf0ad('0x30')](_0x4c839d,{'bodies':'','markSeen':!![]});_0x83f211['on'](_0xf0ad('0x31'),this[_0xf0ad('0x32')][_0xf0ad('0xf')](this));_0x83f211[_0xf0ad('0x10')](_0xf0ad('0x13'),this[_0xf0ad('0x33')][_0xf0ad('0xf')](this));_0x83f211['once']('end',this[_0xf0ad('0x34')][_0xf0ad('0xf')](this));}catch(_0xd608bf){logger[_0xf0ad('0x13')](_0xd608bf);}}else{this['imap'][_0xf0ad('0x35')](!![],this['handleCloseBox'][_0xf0ad('0xf')](this));}}};EmailImap['prototype'][_0xf0ad('0x32')]=function(_0x4846b1){_0x4846b1['on'](_0xf0ad('0x36'),this[_0xf0ad('0x37')][_0xf0ad('0xf')](this));_0x4846b1[_0xf0ad('0x10')](_0xf0ad('0x38'),this[_0xf0ad('0x39')][_0xf0ad('0xf')](this));_0x4846b1[_0xf0ad('0x10')]('end',this[_0xf0ad('0x3a')]['bind'](this));};EmailImap[_0xf0ad('0x16')]['handleMessageBody']=function(_0x3f7e2b){simpleParser(_0x3f7e2b,{'Iconv':Iconv},this[_0xf0ad('0x3b')][_0xf0ad('0xf')](this));};EmailImap[_0xf0ad('0x16')][_0xf0ad('0x39')]=function(){};EmailImap['prototype'][_0xf0ad('0x3a')]=function(){};EmailImap[_0xf0ad('0x16')][_0xf0ad('0x3b')]=function(_0x313c15,_0x18dd8e){if(_0x313c15){logger[_0xf0ad('0x13')](_0x313c15);}else{var _0x3553b0=this;utils['parser'](this[_0xf0ad('0xc')],_0x18dd8e,function(_0x28ba8e){_0x3553b0[_0xf0ad('0x3c')](_0xf0ad('0x1b'),_0x28ba8e);});}};EmailImap[_0xf0ad('0x16')][_0xf0ad('0x34')]=function(){this[_0xf0ad('0x2')][_0xf0ad('0x35')](!![],this[_0xf0ad('0x2c')]['bind'](this));};EmailImap[_0xf0ad('0x16')][_0xf0ad('0x33')]=function(_0x35eef9){this['handleError'](_0x35eef9);this['imap']['closeBox'](!![],this[_0xf0ad('0x2c')][_0xf0ad('0xf')](this));};EmailImap[_0xf0ad('0x16')][_0xf0ad('0x12')]=function(){this[_0xf0ad('0x3c')](_0xf0ad('0x11'));};EmailImap[_0xf0ad('0x16')][_0xf0ad('0x14')]=function(_0x3dfedd,_0x38d90c){logger[_0xf0ad('0x13')]('handleError',this['account']['email'],JSON[_0xf0ad('0x3d')](_0x3dfedd));var _0x1d97c5='';if(_0x3dfedd){if(_0x3dfedd['textCode']){_0x1d97c5=_0x3dfedd[_0xf0ad('0x3e')];}else{for(var _0x7dd257 in _0x3dfedd){if(_0x3dfedd['hasOwnProperty'](_0x7dd257)){_0x1d97c5+=_[_0xf0ad('0x3f')](_0x7dd257)+':\x20'+_0x3dfedd[_0x7dd257]+'\x0a';}}}}if(_0x38d90c){this[_0xf0ad('0x2')][_0xf0ad('0x11')]();}else{this[_0xf0ad('0x3c')]('error',_0x1d97c5);this[_0xf0ad('0x3c')](_0xf0ad('0x11'));}};module[_0xf0ad('0x40')]=EmailImap; \ No newline at end of file +var _0xee2c=['imap','mailparser','simpleParser','iconv','EventEmitter','./utils','email','mailbox','INBOX','account','once','ready','handleReady','bind','end','handleEnd','error','prototype','getAccount','connTimeout','authTimeout','service','user','modernAuthentication','generateXOAuth2Token','CloudProvider','data5','password','authentication','host','port','tls','autotls','openBox','handleOpenBox','emit','readUnseen','handleCloseBox','handleError','search','handleReadUnseen','length','message','handleFetchEnd','closeBox','body','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','parser','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xee2c,0x1c7));var _0xcee2=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xee2c[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0xcee2('0x0'));var util=require('util');var Imap=require(_0xcee2('0x1'));var simpleParser=require(_0xcee2('0x2'))[_0xcee2('0x3')];var Iconv=require(_0xcee2('0x4'))['Iconv'];var EventEmitter=require('events')[_0xcee2('0x5')];var utils=require(_0xcee2('0x6'));var logger=require('../../../config/logger')(_0xcee2('0x7'));function EmailImap(_0x409944,_0x12fa86){this[_0xcee2('0x8')]=_0xcee2('0x9');this['account']=this['getAccount'](_0x409944,_0x12fa86);this[_0xcee2('0x1')]=new Imap(this[_0xcee2('0xa')]);this[_0xcee2('0x1')][_0xcee2('0xb')](_0xcee2('0xc'),this[_0xcee2('0xd')][_0xcee2('0xe')](this));this[_0xcee2('0x1')]['once'](_0xcee2('0xf'),this[_0xcee2('0x10')][_0xcee2('0xe')](this));this[_0xcee2('0x1')]['on'](_0xcee2('0x11'),this['handleError'][_0xcee2('0xe')](this));this['imap']['connect']();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0xcee2('0x12')][_0xcee2('0x13')]=function(_0x2afc56,_0x347a97){var _0x54a718={'connTimeout':_0x2afc56[_0xcee2('0x14')]?_0x2afc56[_0xcee2('0x14')]*0x3e8:0x2710,'authTimeout':_0x2afc56[_0xcee2('0x15')]?_0x2afc56[_0xcee2('0x15')]*0x3e8:0x1388};if(_0x2afc56[_0xcee2('0x16')]){_0x54a718[_0xcee2('0x17')]=_0x2afc56[_0xcee2('0x17')];_0x54a718[_0xcee2('0x7')]=_0x347a97||_0x2afc56[_0xcee2('0x17')]||'anonymous@xcally.com';if(_0x2afc56[_0xcee2('0x18')]){_0x54a718['xoauth2']=utils[_0xcee2('0x19')](_0x2afc56[_0xcee2('0x1a')][_0xcee2('0x1b')],_0x2afc56[_0xcee2('0x17')]);}else{_0x54a718['password']=_0x2afc56[_0xcee2('0x1c')];}}else{if(_0x2afc56[_0xcee2('0x1d')]){_0x54a718[_0xcee2('0x17')]=_0x2afc56[_0xcee2('0x17')];_0x54a718[_0xcee2('0x1c')]=_0x2afc56[_0xcee2('0x1c')];}}_0x54a718[_0xcee2('0x1e')]=_0x2afc56[_0xcee2('0x1e')];_0x54a718[_0xcee2('0x1f')]=_0x2afc56[_0xcee2('0x1f')]||0x3e1;if(_0x2afc56[_0xcee2('0x20')]){_0x54a718['tls']=!![];}else{_0x54a718[_0xcee2('0x20')]=![];_0x54a718[_0xcee2('0x21')]='required';}return _0x54a718;};EmailImap['prototype'][_0xcee2('0xd')]=function(){this['imap'][_0xcee2('0x22')](this[_0xcee2('0x8')],![],this[_0xcee2('0x23')]['bind'](this));};EmailImap['prototype'][_0xcee2('0x23')]=function(_0x2ccc9c,_0x22789d){if(_0x2ccc9c){this['handleError'](_0x2ccc9c,!![]);}else{this[_0xcee2('0x24')]('box',_0x22789d);this[_0xcee2('0x25')]();}};EmailImap[_0xcee2('0x12')][_0xcee2('0x26')]=function(_0x21bc84){if(_0x21bc84){this[_0xcee2('0x27')](_0x21bc84,!![]);}else{this[_0xcee2('0x1')][_0xcee2('0xf')]();}};EmailImap[_0xcee2('0x12')][_0xcee2('0x25')]=function(){this[_0xcee2('0x1')][_0xcee2('0x28')](['UNSEEN'],this[_0xcee2('0x29')][_0xcee2('0xe')](this));};EmailImap[_0xcee2('0x12')]['handleReadUnseen']=function(_0x2f07e9,_0x117342){if(_0x2f07e9){this['handleError'](_0x2f07e9,!![]);}else{if(_0x117342[_0xcee2('0x2a')]){try{var _0x25ead9=this['imap']['fetch'](_0x117342,{'bodies':'','markSeen':!![]});_0x25ead9['on'](_0xcee2('0x2b'),this['handleFetchMessage']['bind'](this));_0x25ead9[_0xcee2('0xb')](_0xcee2('0x11'),this['handleFetchError'][_0xcee2('0xe')](this));_0x25ead9[_0xcee2('0xb')](_0xcee2('0xf'),this[_0xcee2('0x2c')][_0xcee2('0xe')](this));}catch(_0x150660){logger[_0xcee2('0x11')](_0x150660);}}else{this[_0xcee2('0x1')][_0xcee2('0x2d')](!![],this[_0xcee2('0x26')][_0xcee2('0xe')](this));}}};EmailImap[_0xcee2('0x12')]['handleFetchMessage']=function(_0x4775ba){_0x4775ba['on'](_0xcee2('0x2e'),this['handleMessageBody'][_0xcee2('0xe')](this));_0x4775ba[_0xcee2('0xb')]('attributes',this[_0xcee2('0x2f')][_0xcee2('0xe')](this));_0x4775ba[_0xcee2('0xb')]('end',this[_0xcee2('0x30')][_0xcee2('0xe')](this));};EmailImap[_0xcee2('0x12')][_0xcee2('0x31')]=function(_0x352df6){simpleParser(_0x352df6,{'Iconv':Iconv},this[_0xcee2('0x32')]['bind'](this));};EmailImap[_0xcee2('0x12')][_0xcee2('0x2f')]=function(){};EmailImap[_0xcee2('0x12')]['handleMessageEnd']=function(){};EmailImap[_0xcee2('0x12')]['handleSimpleParser']=function(_0x594eab,_0x42c307){if(_0x594eab){logger[_0xcee2('0x11')](_0x594eab);}else{var _0x16ae5c=this;utils[_0xcee2('0x33')](this[_0xcee2('0xa')],_0x42c307,function(_0x2eb529){_0x16ae5c['emit']('email',_0x2eb529);});}};EmailImap['prototype'][_0xcee2('0x2c')]=function(){this['imap'][_0xcee2('0x2d')](!![],this[_0xcee2('0x26')]['bind'](this));};EmailImap[_0xcee2('0x12')]['handleFetchError']=function(_0x54d75a){this[_0xcee2('0x27')](_0x54d75a);this[_0xcee2('0x1')]['closeBox'](!![],this['handleCloseBox'][_0xcee2('0xe')](this));};EmailImap[_0xcee2('0x12')][_0xcee2('0x10')]=function(){this[_0xcee2('0x24')](_0xcee2('0xf'));};EmailImap[_0xcee2('0x12')][_0xcee2('0x27')]=function(_0x4243d4,_0x377b2f){logger['error'](_0xcee2('0x27'),this[_0xcee2('0xa')][_0xcee2('0x7')],JSON[_0xcee2('0x34')](_0x4243d4));var _0x4bad7b='';if(_0x4243d4){if(_0x4243d4[_0xcee2('0x35')]){_0x4bad7b=_0x4243d4[_0xcee2('0x35')];}else{for(var _0x207764 in _0x4243d4){if(_0x4243d4[_0xcee2('0x36')](_0x207764)){_0x4bad7b+=_[_0xcee2('0x37')](_0x207764)+':\x20'+_0x4243d4[_0x207764]+'\x0a';}}}}if(_0x377b2f){this[_0xcee2('0x1')][_0xcee2('0xf')]();}else{this[_0xcee2('0x24')](_0xcee2('0x11'),_0x4bad7b);this['emit'](_0xcee2('0xf'));}};module[_0xcee2('0x38')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index d36cd0a..7ba6060 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 _0x3ca1=['nodemailer-plugin-inline-base64','prototype','send','use','sendMail','toString','verify','createTransport','nodemailer'];(function(_0x5afbd5,_0x48a693){var _0x298511=function(_0x2f4262){while(--_0x2f4262){_0x5afbd5['push'](_0x5afbd5['shift']());}};_0x298511(++_0x48a693);}(_0x3ca1,0x19d));var _0x13ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ca1[_0x3dd15e];return _0x231fd0;};'use strict';var nodemailer=require(_0x13ca('0x0'));var inlineBase64=require(_0x13ca('0x1'));function EmailSmtp(){}EmailSmtp[_0x13ca('0x2')][_0x13ca('0x3')]=function(_0xcf6deb,_0x48eca0){return new Promise(function(_0x1dd4ac,_0x4cdd40){var _0x1bf707=nodemailer['createTransport'](_0xcf6deb);_0x1bf707[_0x13ca('0x4')]('compile',inlineBase64());_0x1bf707[_0x13ca('0x5')](_0x48eca0,function(_0x45dc0a,_0x52a8bd){if(_0x45dc0a){_0x4cdd40(_0x45dc0a[_0x13ca('0x6')]());}else{_0x1dd4ac(_0x52a8bd);}});});};EmailSmtp['prototype'][_0x13ca('0x7')]=function(_0x50e1ba){return new Promise(function(_0x6bb93,_0x54164a){var _0x8d036e=nodemailer[_0x13ca('0x8')](_0x50e1ba);_0x8d036e[_0x13ca('0x7')](function(_0xa26e30,_0xf41c58){if(_0xa26e30){_0x54164a(_0xa26e30['toString']());}else{if(_0xf41c58){_0x6bb93(_0xf41c58);}else{_0x54164a('Not\x20verifired');}}});});};module['exports']=EmailSmtp; \ No newline at end of file +var _0x5b44=['nodemailer','prototype','send','createTransport','use','toString','verify','Not\x20verifired','exports'];(function(_0x4aadbc,_0x4afc4d){var _0x372f33=function(_0xc50454){while(--_0xc50454){_0x4aadbc['push'](_0x4aadbc['shift']());}};_0x372f33(++_0x4afc4d);}(_0x5b44,0xf3));var _0x45b4=function(_0x26b45b,_0x340965){_0x26b45b=_0x26b45b-0x0;var _0x1a240f=_0x5b44[_0x26b45b];return _0x1a240f;};'use strict';var nodemailer=require(_0x45b4('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x45b4('0x1')][_0x45b4('0x2')]=function(_0x4f7209,_0x1c9677){return new Promise(function(_0x3a8aeb,_0x265335){var _0x516068=nodemailer[_0x45b4('0x3')](_0x4f7209);_0x516068[_0x45b4('0x4')]('compile',inlineBase64());_0x516068['sendMail'](_0x1c9677,function(_0x59ad8f,_0x412c02){if(_0x59ad8f){_0x265335(_0x59ad8f[_0x45b4('0x5')]());}else{_0x3a8aeb(_0x412c02);}});});};EmailSmtp[_0x45b4('0x1')][_0x45b4('0x6')]=function(_0x28c510){return new Promise(function(_0x1d12ff,_0x123b55){var _0xcdb3d7=nodemailer[_0x45b4('0x3')](_0x28c510);_0xcdb3d7[_0x45b4('0x6')](function(_0x5ac27c,_0x172006){if(_0x5ac27c){_0x123b55(_0x5ac27c[_0x45b4('0x5')]());}else{if(_0x172006){_0x1d12ff(_0x172006);}else{_0x123b55(_0x45b4('0x7'));}}});});};module[_0x45b4('0x8')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index f06b33f..8327697 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 _0xb414=['pop','isEmpty','anonymous','generate','html','test','includes','\x20[Attachment:\x20','\x20]','body','Empty\x20message

','Attachments','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','base64','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','value','address','@xcally.com','head','name','substring','indexOf','length','slice','join','Anonymous'];(function(_0x4a8dfa,_0xd407c8){var _0xadad9c=function(_0x5c4bfe){while(--_0x5c4bfe){_0x4a8dfa['push'](_0x4a8dfa['shift']());}};_0xadad9c(++_0xd407c8);}(_0xb414,0x1bb));var _0x4b41=function(_0x1da988,_0x2acfae){_0x1da988=_0x1da988-0x0;var _0xaf122a=_0xb414[_0x1da988];return _0xaf122a;};'use strict';var _=require(_0x4b41('0x0'));var moment=require(_0x4b41('0x1'));var random=require(_0x4b41('0x2'));var fs=require('fs');var path=require(_0x4b41('0x3'));var util=require(_0x4b41('0x4'));var tnef=require(_0x4b41('0x5'));var logger=require(_0x4b41('0x6'))(_0x4b41('0x7'));var config=require('../../../config/environment');function getAddress(_0x20b868){var _0x3c8895=_['head'](_0x20b868[_0x4b41('0x8')]);return _0x3c8895&&_0x3c8895[_0x4b41('0x9')]?_0x3c8895[_0x4b41('0x9')]:'anonymous'+random['generate'](0x6)+_0x4b41('0xa');}function getFirstName(_0x580ba7){var _0x3d35db=_[_0x4b41('0xb')](_0x580ba7[_0x4b41('0x8')]);if(_0x3d35db&&_0x3d35db[_0x4b41('0xc')]){if(_0x3d35db['name']==_0x3d35db[_0x4b41('0x9')]){return _0x3d35db['name'][_0x4b41('0xd')](0x0,_0x3d35db[_0x4b41('0xc')][_0x4b41('0xe')]('@'));}var _0x113f64=_0x3d35db[_0x4b41('0xc')]['split'](/\s+/);return _0x113f64[_0x4b41('0xf')]>0x1?_0x113f64[_0x4b41('0x10')](0x0,-0x1)[_0x4b41('0x11')]('\x20'):_0x3d35db[_0x4b41('0xc')];}return _0x4b41('0x12');}function getLastName(_0xa443c7){var _0x5273e3=_[_0x4b41('0xb')](_0xa443c7[_0x4b41('0x8')]);if(_0x5273e3&&_0x5273e3[_0x4b41('0xc')]){var _0x381d17=_0x5273e3[_0x4b41('0xc')]['split'](/\s+/);return _0x381d17['length']>0x1?_0x381d17[_0x4b41('0x13')]():'';}return'';}function getMails(_0x35f957,_0x4232bc){var _0x60f271='';for(var _0x261b29=0x0;_0x261b29<_0x4232bc[_0x4b41('0x8')]['length'];_0x261b29+=0x1){if(_0x4232bc['value'][_0x261b29][_0x4b41('0x9')]!==_0x35f957){if(!_[_0x4b41('0x14')](_0x60f271)){_0x60f271+=',';}_0x60f271+=_0x4232bc[_0x4b41('0x8')][_0x261b29][_0x4b41('0xc')]||_0x4232bc['value'][_0x261b29][_0x4b41('0x9')]||'';_0x60f271+='\x20<';_0x60f271+=_0x4232bc['value'][_0x261b29][_0x4b41('0x9')]?_0x4232bc[_0x4b41('0x8')][_0x261b29][_0x4b41('0x9')]:_0x4b41('0x15')+random[_0x4b41('0x16')](0x6)+_0x4b41('0xa');_0x60f271+='>';}}return _0x60f271;}function parseEmail(_0x70b57d,_0x21ac07,_0x12dd49){if(_0x21ac07[_0x4b41('0x17')]){var _0x2de22d=/)<[^<]*)*<\/script>/gi;while(_0x2de22d[_0x4b41('0x18')](_0x21ac07['html'])){_0x21ac07[_0x4b41('0x17')]=_0x21ac07['html']['replace'](_0x2de22d,'');}if(_0x21ac07['html'][_0x4b41('0x19')](_0x4b41('0x1a'))){var _0x472cc2=[];_0x21ac07[_0x4b41('0x1b')]['forEach'](_0x4ce96a=>{_0x472cc2[_0x4b41('0x1c')](_0x4ce96a[_0x4b41('0x1d')]);});var _0x219943=/]+>/g;var _0x9731b9=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x3e522d=_0x21ac07[_0x4b41('0x17')][_0x4b41('0x1e')](_0x9731b9,_0x4b41('0x1f'));var _0x3dbdcb=_0x3e522d[_0x4b41('0x1e')](_0x219943,_0x4b41('0x20'));for(let _0x4da9ad=0x0;_0x4da9ad<_0x472cc2['length'];_0x4da9ad++){var _0x512744=_0x3dbdcb[_0x4b41('0x1e')]('_IMG',_0x4b41('0x21')+_0x472cc2[_0x4da9ad]+_0x4b41('0x22'));_0x3dbdcb=_0x512744;}_0x21ac07['html']=_0x3dbdcb;}_0x12dd49[_0x4b41('0x23')]=_0x21ac07['html'];}else{_0x12dd49[_0x4b41('0x23')]=_0x21ac07['textAsHtml'];}if(_0x12dd49[_0x4b41('0x23')]){_0x12dd49[_0x4b41('0x23')]=_0x12dd49[_0x4b41('0x23')]['replace'](/0x0){var _0x430217=[_0x4b41('0x34'),_0x4b41('0x35'),_0x4b41('0x36')];for(var _0x7cbbed=0x0;_0x7cbbed<_0x21ac07[_0x4b41('0x33')][_0x4b41('0xf')];_0x7cbbed++){var _0x5cf928=_['indexOf'](_0x430217,_0x21ac07[_0x4b41('0x33')][_0x7cbbed][_0x4b41('0x37')]);if(_0x5cf928>=0x0){_0x12dd49[_0x4b41('0x38')]=!![];}}}return _0x12dd49;}exports[_0x4b41('0x39')]=function(_0x5b85e9,_0x187d49,_0x3cdf0f){var _0x12491a={'from':getAddress(_0x187d49[_0x4b41('0x3a')]),'firstName':getFirstName(_0x187d49[_0x4b41('0x3a')]),'lastName':getLastName(_0x187d49[_0x4b41('0x3a')]),'mapKey':_0x4b41('0x7'),'message':{'from':getMails(_0x5b85e9[_0x4b41('0x7')],_0x187d49['from']),'to':_0x5b85e9[_0x4b41('0x7')],'cc':'','subject':_0x187d49['subject']||'','messageId':_0x187d49[_0x4b41('0x3b')],'inReplyTo':_0x187d49[_0x4b41('0x3c')],'sentAt':moment(_0x187d49[_0x4b41('0x3d')])['format'](_0x4b41('0x3e')),'attach':![],'attachments':[]}};if(!_0x187d49[_0x4b41('0x17')]&&!_0x187d49[_0x4b41('0x3f')]){var _0x3eddc3=_['filter'](_0x187d49[_0x4b41('0x1b')],{'contentType':_0x4b41('0x40')});if(_0x3eddc3['length']){logger['info'](util[_0x4b41('0x2c')](_0x4b41('0x41'),_0x187d49[_0x4b41('0x3b')]));tnef[_0x4b41('0x42')](_['first'](_0x3eddc3)[_0x4b41('0x32')],function(_0x4f48bd,_0x467686){if(_0x467686){_0x187d49[_0x4b41('0x17')]=_0x467686[_0x4b41('0x43')]||_0x4b41('0x44');if(_0x467686[_0x4b41('0x45')]){for(var _0x414ec8=0x0;_0x414ec8<_0x467686['Attachments'][_0x4b41('0xf')];_0x414ec8++){var _0x1a8030=_0x467686[_0x4b41('0x45')][_0x414ec8];_0x12491a[_0x4b41('0x25')][_0x4b41('0x1b')][_0x4b41('0x1c')]({'filename':_0x1a8030[_0x4b41('0x46')],'content':Buffer['from'](_0x1a8030[_0x4b41('0x47')])});}}}_0x3cdf0f(parseEmail(_0x5b85e9,_0x187d49,_0x12491a));});}else{_0x187d49[_0x4b41('0x17')]=_0x4b41('0x44');_0x3cdf0f(parseEmail(_0x5b85e9,_0x187d49,_0x12491a));}}else{_0x3cdf0f(parseEmail(_0x5b85e9,_0x187d49,_0x12491a));}};exports[_0x4b41('0x48')]=function(_0x4c6c2f,_0x546eeb){var _0x58693b=[_0x4b41('0x49')+(_0x546eeb||''),_0x4b41('0x4a')+_0x4c6c2f,'',''];return Buffer[_0x4b41('0x3a')](_0x58693b['join'](''),_0x4b41('0x4b'))['toString'](_0x4b41('0x4c'));}; \ No newline at end of file +var _0x1246=['\x20[Attachment:\x20','body','Empty\x20message

','Attachments','generateXOAuth2Token','user=','auth=Bearer\x20','toString','base64','lodash','moment','util','node-tnef','../../../config/logger','email','../../../config/environment','value','address','generate','@xcally.com','head','name','substring','indexOf','split','join','Anonymous','pop','length','isEmpty','anonymous','html','test','replace','includes','forEach','push','_IMG'];(function(_0x5bb72c,_0x2467c7){var _0x204a88=function(_0x250f01){while(--_0x250f01){_0x5bb72c['push'](_0x5bb72c['shift']());}};_0x204a88(++_0x2467c7);}(_0x1246,0x10b));var _0x6124=function(_0x515cf4,_0x2699f2){_0x515cf4=_0x515cf4-0x0;var _0x1bd646=_0x1246[_0x515cf4];return _0x1bd646;};'use strict';var _=require(_0x6124('0x0'));var moment=require(_0x6124('0x1'));var random=require('randomstring');var fs=require('fs');var path=require('path');var util=require(_0x6124('0x2'));var tnef=require(_0x6124('0x3'));var logger=require(_0x6124('0x4'))(_0x6124('0x5'));var config=require(_0x6124('0x6'));function getAddress(_0x4d34ba){var _0x1b5b1b=_['head'](_0x4d34ba[_0x6124('0x7')]);return _0x1b5b1b&&_0x1b5b1b['address']?_0x1b5b1b[_0x6124('0x8')]:'anonymous'+random[_0x6124('0x9')](0x6)+_0x6124('0xa');}function getFirstName(_0xe25bb4){var _0x294f1a=_[_0x6124('0xb')](_0xe25bb4[_0x6124('0x7')]);if(_0x294f1a&&_0x294f1a[_0x6124('0xc')]){if(_0x294f1a[_0x6124('0xc')]==_0x294f1a[_0x6124('0x8')]){return _0x294f1a[_0x6124('0xc')][_0x6124('0xd')](0x0,_0x294f1a[_0x6124('0xc')][_0x6124('0xe')]('@'));}var _0x43e96a=_0x294f1a[_0x6124('0xc')][_0x6124('0xf')](/\s+/);return _0x43e96a['length']>0x1?_0x43e96a['slice'](0x0,-0x1)[_0x6124('0x10')]('\x20'):_0x294f1a[_0x6124('0xc')];}return _0x6124('0x11');}function getLastName(_0x1fd9d1){var _0x42639e=_[_0x6124('0xb')](_0x1fd9d1['value']);if(_0x42639e&&_0x42639e[_0x6124('0xc')]){var _0x20e748=_0x42639e[_0x6124('0xc')][_0x6124('0xf')](/\s+/);return _0x20e748['length']>0x1?_0x20e748[_0x6124('0x12')]():'';}return'';}function getMails(_0x5782db,_0x266dcb){var _0x59f62d='';for(var _0x4d3151=0x0;_0x4d3151<_0x266dcb[_0x6124('0x7')][_0x6124('0x13')];_0x4d3151+=0x1){if(_0x266dcb[_0x6124('0x7')][_0x4d3151]['address']!==_0x5782db){if(!_[_0x6124('0x14')](_0x59f62d)){_0x59f62d+=',';}_0x59f62d+=_0x266dcb[_0x6124('0x7')][_0x4d3151][_0x6124('0xc')]||_0x266dcb[_0x6124('0x7')][_0x4d3151][_0x6124('0x8')]||'';_0x59f62d+='\x20<';_0x59f62d+=_0x266dcb[_0x6124('0x7')][_0x4d3151][_0x6124('0x8')]?_0x266dcb[_0x6124('0x7')][_0x4d3151]['address']:_0x6124('0x15')+random[_0x6124('0x9')](0x6)+_0x6124('0xa');_0x59f62d+='>';}}return _0x59f62d;}function parseEmail(_0x444589,_0x43bab2,_0x4e842f){if(_0x43bab2[_0x6124('0x16')]){var _0x2e6329=/)<[^<]*)*<\/script>/gi;while(_0x2e6329[_0x6124('0x17')](_0x43bab2[_0x6124('0x16')])){_0x43bab2[_0x6124('0x16')]=_0x43bab2[_0x6124('0x16')][_0x6124('0x18')](_0x2e6329,'');}if(_0x43bab2[_0x6124('0x16')][_0x6124('0x19')]('{_0x2722d2[_0x6124('0x1b')](_0x21f323['filename']);});var _0xf59b93=/]+>/g;var _0x40a0d3=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x7df4f3=_0x43bab2[_0x6124('0x16')][_0x6124('0x18')](_0x40a0d3,'_SRC');var _0x25b7a9=_0x7df4f3[_0x6124('0x18')](_0xf59b93,_0x6124('0x1c'));for(let _0xd1267a=0x0;_0xd1267a<_0x2722d2[_0x6124('0x13')];_0xd1267a++){var _0xbb8884=_0x25b7a9['replace'](_0x6124('0x1c'),_0x6124('0x1d')+_0x2722d2[_0xd1267a]+'\x20]');_0x25b7a9=_0xbb8884;}_0x43bab2[_0x6124('0x16')]=_0x25b7a9;}_0x4e842f[_0x6124('0x1e')]=_0x43bab2[_0x6124('0x16')];}else{_0x4e842f['body']=_0x43bab2['textAsHtml'];}if(_0x4e842f['body']){_0x4e842f[_0x6124('0x1e')]=_0x4e842f[_0x6124('0x1e')][_0x6124('0x18')](/0x0){var _0x580532=[_0x6124('0x31'),_0x6124('0x32'),_0x6124('0x33')];for(var _0x150ea1=0x0;_0x150ea1<_0x43bab2['headerLines']['length'];_0x150ea1++){var _0x2dab28=_[_0x6124('0xe')](_0x580532,_0x43bab2['headerLines'][_0x150ea1][_0x6124('0x34')]);if(_0x2dab28>=0x0){_0x4e842f[_0x6124('0x35')]=!![];}}}return _0x4e842f;}exports[_0x6124('0x36')]=function(_0x16aab8,_0x4f4dc1,_0x56c7c2){var _0x34c193={'from':getAddress(_0x4f4dc1['from']),'firstName':getFirstName(_0x4f4dc1[_0x6124('0x37')]),'lastName':getLastName(_0x4f4dc1['from']),'mapKey':_0x6124('0x5'),'message':{'from':getMails(_0x16aab8['email'],_0x4f4dc1[_0x6124('0x37')]),'to':_0x16aab8[_0x6124('0x5')],'cc':'','subject':_0x4f4dc1[_0x6124('0x38')]||'','messageId':_0x4f4dc1[_0x6124('0x39')],'inReplyTo':_0x4f4dc1['inReplyTo'],'sentAt':moment(_0x4f4dc1[_0x6124('0x3a')])[_0x6124('0x29')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x4f4dc1[_0x6124('0x16')]&&!_0x4f4dc1[_0x6124('0x3b')]){var _0x211e28=_[_0x6124('0x3c')](_0x4f4dc1['attachments'],{'contentType':_0x6124('0x3d')});if(_0x211e28['length']){logger[_0x6124('0x3e')](util['format'](_0x6124('0x3f'),_0x4f4dc1['messageId']));tnef[_0x6124('0x40')](_[_0x6124('0x41')](_0x211e28)[_0x6124('0x2e')],function(_0x141d69,_0x2cc51b){if(_0x2cc51b){_0x4f4dc1[_0x6124('0x16')]=_0x2cc51b[_0x6124('0x42')]||_0x6124('0x43');if(_0x2cc51b[_0x6124('0x44')]){for(var _0x591bd6=0x0;_0x591bd6<_0x2cc51b[_0x6124('0x44')][_0x6124('0x13')];_0x591bd6++){var _0x244259=_0x2cc51b[_0x6124('0x44')][_0x591bd6];_0x34c193[_0x6124('0x21')]['attachments'][_0x6124('0x1b')]({'filename':_0x244259['Title'],'content':Buffer['from'](_0x244259['Data'])});}}}_0x56c7c2(parseEmail(_0x16aab8,_0x4f4dc1,_0x34c193));});}else{_0x4f4dc1[_0x6124('0x16')]=_0x6124('0x43');_0x56c7c2(parseEmail(_0x16aab8,_0x4f4dc1,_0x34c193));}}else{_0x56c7c2(parseEmail(_0x16aab8,_0x4f4dc1,_0x34c193));}};exports[_0x6124('0x45')]=function(_0x595755,_0x5894b7){var _0x59ed77=[_0x6124('0x46')+(_0x5894b7||''),_0x6124('0x47')+_0x595755,'',''];return Buffer[_0x6124('0x37')](_0x59ed77[_0x6124('0x10')](''),'utf-8')[_0x6124('0x48')](_0x6124('0x49'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 6663e4e..4db94c1 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 _0x3cc7=['key','SERV','active','Imap','Smtp','exports','lodash','name','Service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3cc7,0x138));var _0x73cc=function(_0x13cd20,_0x1d9211){_0x13cd20=_0x13cd20-0x0;var _0x22b6de=_0x3cc7[_0x13cd20];return _0x22b6de;};'use strict';var _=require(_0x73cc('0x0'));function MailAccount(_0x443c89){this['id']=_0x443c89['id']||0x0;this[_0x73cc('0x1')]=_0x443c89[_0x73cc('0x1')]||_0x73cc('0x2');this[_0x73cc('0x3')]=_0x443c89[_0x73cc('0x3')]||_0x73cc('0x4');this[_0x73cc('0x5')]=_0x443c89['active']||![];this[_0x73cc('0x6')]=_0x443c89[_0x73cc('0x6')]||[];this['Smtp']=_0x443c89[_0x73cc('0x7')]||[];}module[_0x73cc('0x8')]=MailAccount; \ No newline at end of file +var _0x978e=['lodash','name','Service','key','SERV','active','Imap','Smtp','exports'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x978e,0xfc));var _0xe978=function(_0x428ad8,_0x4383b9){_0x428ad8=_0x428ad8-0x0;var _0x3281ba=_0x978e[_0x428ad8];return _0x3281ba;};'use strict';var _=require(_0xe978('0x0'));function MailAccount(_0x45ef1d){this['id']=_0x45ef1d['id']||0x0;this[_0xe978('0x1')]=_0x45ef1d['name']||_0xe978('0x2');this[_0xe978('0x3')]=_0x45ef1d['key']||_0xe978('0x4');this['active']=_0x45ef1d[_0xe978('0x5')]||![];this[_0xe978('0x6')]=_0x45ef1d[_0xe978('0x6')]||[];this[_0xe978('0x7')]=_0x45ef1d[_0xe978('0x7')]||[];}module[_0xe978('0x8')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 9554756..d60fdd7 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 _0x4993=['length','isUndefined','merge','exports','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','initMailAccounts'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4993,0x11c));var _0x3499=function(_0x5f01d2,_0x35a6cc){_0x5f01d2=_0x5f01d2-0x0;var _0x4bb018=_0x4993[_0x5f01d2];return _0x4bb018;};'use strict';var _=require('lodash');var MailAccount=require(_0x3499('0x0'));var Realtime=function(){this[_0x3499('0x1')]={};};function freeIsNotKey(_0x145fc9,_0x464240,_0x544f4c){var _0xdde5ae=_[_0x3499('0x2')](_0x145fc9,function(_0x50ab26,_0x187c7d){return _0x50ab26[_0x544f4c];});for(var _0x3278ee in _0x464240){if(_0x464240[_0x3499('0x3')](_0x3278ee)){if(!_0xdde5ae[_0x3278ee]){delete _0x464240[_0x3278ee];}}}}Realtime[_0x3499('0x4')]['mergeFromDatabase']=function(_0x146eb4,_0x2ef93d){for(var _0x56cf86 in _0x2ef93d){if(_0x146eb4[_0x3499('0x3')](_0x56cf86)){_0x146eb4[_0x56cf86]=_0x2ef93d[_0x56cf86];}}};Realtime[_0x3499('0x4')][_0x3499('0x5')]=function(){var _0x17b66a=this;return function(_0x3111cc){if(_0x3111cc){freeIsNotKey(_0x3111cc,_0x17b66a[_0x3499('0x1')],'id');for(var _0x18a5ae=0x0,_0x25a393={},_0x4eb5d0={};_0x18a5ae<_0x3111cc[_0x3499('0x6')];_0x18a5ae+=0x1){_0x25a393=_0x3111cc[_0x18a5ae];if(_[_0x3499('0x7')](_0x17b66a['mailAccounts'][_0x25a393['id']])){_0x17b66a['mailAccounts'][_0x25a393['id']]=new MailAccount(_0x25a393);}else{_[_0x3499('0x8')](_0x17b66a['mailAccounts'][_0x25a393['id']],_0x25a393);}}}return _0x17b66a[_0x3499('0x1')];};};module[_0x3499('0x9')]=Realtime; \ No newline at end of file +var _0x0361=['isUndefined','merge','mailAccounts','exports','lodash','../model/mailAccount','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x0361,0x190));var _0x1036=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x0361[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x1036('0x0'));var MailAccount=require(_0x1036('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x2c19f0,_0x307710,_0x8dc6b0){var _0x1cd2ec=_[_0x1036('0x2')](_0x2c19f0,function(_0x395afb,_0x2bcaa0){return _0x395afb[_0x8dc6b0];});for(var _0x116c3f in _0x307710){if(_0x307710[_0x1036('0x3')](_0x116c3f)){if(!_0x1cd2ec[_0x116c3f]){delete _0x307710[_0x116c3f];}}}}Realtime[_0x1036('0x4')][_0x1036('0x5')]=function(_0x205763,_0x921662){for(var _0x36d129 in _0x921662){if(_0x205763[_0x1036('0x3')](_0x36d129)){_0x205763[_0x36d129]=_0x921662[_0x36d129];}}};Realtime['prototype'][_0x1036('0x6')]=function(){var _0x2541cf=this;return function(_0x26c984){if(_0x26c984){freeIsNotKey(_0x26c984,_0x2541cf['mailAccounts'],'id');for(var _0x3254b2=0x0,_0x28346c={},_0x5a6cae={};_0x3254b2<_0x26c984[_0x1036('0x7')];_0x3254b2+=0x1){_0x28346c=_0x26c984[_0x3254b2];if(_[_0x1036('0x8')](_0x2541cf['mailAccounts'][_0x28346c['id']])){_0x2541cf['mailAccounts'][_0x28346c['id']]=new MailAccount(_0x28346c);}else{_[_0x1036('0x9')](_0x2541cf[_0x1036('0xa')][_0x28346c['id']],_0x28346c);}}}return _0x2541cf[_0x1036('0xa')];};};module[_0x1036('0xb')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 72dd587..510b28b 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 _0x8463=['name','provider','service','active','key','TemplateId','MailServerIn','Imap','CloudProvider','type','data5','MailServerOut','Smtp','notify','Request','NotifyMailAccount','../client','getMailAccounts','GetMailAccount'];(function(_0x25563d,_0x5c1eed){var _0xbb96e0=function(_0x576663){while(--_0x576663){_0x25563d['push'](_0x25563d['shift']());}};_0xbb96e0(++_0x5c1eed);}(_0x8463,0x140));var _0x3846=function(_0x3442ce,_0x19af56){_0x3442ce=_0x3442ce-0x0;var _0x1d9637=_0x8463[_0x3442ce];return _0x1d9637;};'use strict';var client=require(_0x3846('0x0'));exports[_0x3846('0x1')]=function(){return function(){return client['Request'](_0x3846('0x2'),{'options':{'attributes':['id',_0x3846('0x3'),_0x3846('0x4'),_0x3846('0x5'),'email',_0x3846('0x6'),_0x3846('0x7'),'ListId',_0x3846('0x8')],'raw':![],'include':[{'model':_0x3846('0x9'),'as':_0x3846('0xa'),'include':[{'model':_0x3846('0xb'),'attributes':['id',_0x3846('0x3'),'service',_0x3846('0xc'),_0x3846('0xd')],'as':_0x3846('0xb')}]},{'model':_0x3846('0xe'),'as':_0x3846('0xf'),'include':[{'model':_0x3846('0xb'),'attributes':['id',_0x3846('0x3'),_0x3846('0x5'),_0x3846('0xc'),_0x3846('0xd')],'as':'CloudProvider'}]}]},'log':'getMailAccount'});};};exports[_0x3846('0x10')]=function(_0x3badbe,_0x140d17){return client[_0x3846('0x11')](_0x3846('0x12'),{'account':{'id':_0x3badbe},'body':_0x140d17,'log':_0x3846('0x12')});}; \ No newline at end of file +var _0x00f0=['Request','GetMailAccount','service','active','ListId','TemplateId','Imap','CloudProvider','name','type','data5','MailServerOut','Smtp','notify','NotifyMailAccount','../client','getMailAccounts'];(function(_0x231ce3,_0x2fbc4a){var _0x32e800=function(_0x441291){while(--_0x441291){_0x231ce3['push'](_0x231ce3['shift']());}};_0x32e800(++_0x2fbc4a);}(_0x00f0,0xec));var _0x000f=function(_0x1ee08c,_0x5c3dff){_0x1ee08c=_0x1ee08c-0x0;var _0x1ca533=_0x00f0[_0x1ee08c];return _0x1ca533;};'use strict';var client=require(_0x000f('0x0'));exports[_0x000f('0x1')]=function(){return function(){return client[_0x000f('0x2')](_0x000f('0x3'),{'options':{'attributes':['id','name','provider',_0x000f('0x4'),'email',_0x000f('0x5'),'key',_0x000f('0x6'),_0x000f('0x7')],'raw':![],'include':[{'model':'MailServerIn','as':_0x000f('0x8'),'include':[{'model':_0x000f('0x9'),'attributes':['id',_0x000f('0xa'),_0x000f('0x4'),_0x000f('0xb'),_0x000f('0xc')],'as':_0x000f('0x9')}]},{'model':_0x000f('0xd'),'as':_0x000f('0xe'),'include':[{'model':_0x000f('0x9'),'attributes':['id',_0x000f('0xa'),'service','type',_0x000f('0xc')],'as':_0x000f('0x9')}]}]},'log':'getMailAccount'});};};exports[_0x000f('0xf')]=function(_0x1dc33f,_0x4d238e){return client['Request'](_0x000f('0x10'),{'account':{'id':_0x1dc33f},'body':_0x4d238e,'log':_0x000f('0x10')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 806a14b..1dcd246 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 _0xf2d1=['ShowSetting','loginMailFrequency','GetSettings','getSettings','Request'];(function(_0x59e4f7,_0x5027ba){var _0x37e712=function(_0x1bd03e){while(--_0x1bd03e){_0x59e4f7['push'](_0x59e4f7['shift']());}};_0x37e712(++_0x5027ba);}(_0xf2d1,0xf3));var _0x1f2d=function(_0x443459,_0x2d73c9){_0x443459=_0x443459-0x0;var _0x24f563=_0xf2d1[_0x443459];return _0x24f563;};'use strict';var client=require('../client');exports[_0x1f2d('0x0')]=function(){return client[_0x1f2d('0x1')](_0x1f2d('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x1f2d('0x3')]},'log':_0x1f2d('0x4')});}; \ No newline at end of file +var _0x3385=['getSettings','Request','ShowSetting','../client'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x3385,0xcf));var _0x5338=function(_0x2f227c,_0x360c3a){_0x2f227c=_0x2f227c-0x0;var _0x5032bc=_0x3385[_0x2f227c];return _0x5032bc;};'use strict';var client=require(_0x5338('0x0'));exports[_0x5338('0x1')]=function(){return client[_0x5338('0x2')](_0x5338('0x3'),{'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 abf53f4..6fa370c 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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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 5fe0e42..a4b78ae 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 _0xbab4=['express','../../config/environment','createServer','listen','port','socket.io','polling','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','../../config/socketio','default','../../routes','log','Express\x20server\x20listening\x20on\x20port\x20%d!','lodash'];(function(_0x4be646,_0x5cc6e1){var _0x29e8f8=function(_0x4f42dc){while(--_0x4f42dc){_0x4be646['push'](_0x4be646['shift']());}};_0x29e8f8(++_0x5cc6e1);}(_0xbab4,0xf6));var _0x4bab=function(_0x3018d3,_0x431efe){_0x3018d3=_0x3018d3-0x0;var _0x291a75=_0xbab4[_0x3018d3];return _0x291a75;};'use strict';var _=require(_0x4bab('0x0'));var http=require('http');var express=require(_0x4bab('0x1'));var sticky=require('sticky-session');var Redis=require('ioredis');var config=require(_0x4bab('0x2'));var app=express();var server=http[_0x4bab('0x3')](app);server['timeout']=0xdbba0;if(sticky[_0x4bab('0x4')](server,config[_0x4bab('0x5')])){var socketio=require(_0x4bab('0x6'))(server,{'transports':['websocket',_0x4bab('0x7')]});config[_0x4bab('0x8')]=_[_0x4bab('0x9')](config['redis'],{'host':_0x4bab('0xa'),'port':0x18eb});socketio[_0x4bab('0xb')](require(_0x4bab('0xc'))({'pubClient':new Redis(config[_0x4bab('0x8')]),'subClient':new Redis(config['redis'])}));require(_0x4bab('0xd'))['default']();require(_0x4bab('0xe'))[_0x4bab('0xf')](socketio);require('../../config/express')['default'](app);require(_0x4bab('0x10'))[_0x4bab('0xf')](app);}else{server['once']('listening',function(){console[_0x4bab('0x11')](_0x4bab('0x12'),config[_0x4bab('0x5')]);});}exports=module['exports']=app; \ No newline at end of file +var _0xfd1b=['http','express','../../config/environment','createServer','port','socket.io','websocket','redis','defaults','localhost','../../config/triggers','../../config/socketio','default','../../config/express','../../routes','once','log','Express\x20server\x20listening\x20on\x20port\x20%d!','lodash'];(function(_0x9c09f9,_0x59f7d1){var _0x1b9b59=function(_0x3c32c3){while(--_0x3c32c3){_0x9c09f9['push'](_0x9c09f9['shift']());}};_0x1b9b59(++_0x59f7d1);}(_0xfd1b,0x84));var _0xbfd1=function(_0x5071d9,_0x16a01d){_0x5071d9=_0x5071d9-0x0;var _0x3c9201=_0xfd1b[_0x5071d9];return _0x3c9201;};'use strict';var _=require(_0xbfd1('0x0'));var http=require(_0xbfd1('0x1'));var express=require(_0xbfd1('0x2'));var sticky=require('sticky-session');var Redis=require('ioredis');var config=require(_0xbfd1('0x3'));var app=express();var server=http[_0xbfd1('0x4')](app);server['timeout']=0xdbba0;if(sticky['listen'](server,config[_0xbfd1('0x5')])){var socketio=require(_0xbfd1('0x6'))(server,{'transports':[_0xbfd1('0x7'),'polling']});config[_0xbfd1('0x8')]=_[_0xbfd1('0x9')](config[_0xbfd1('0x8')],{'host':_0xbfd1('0xa'),'port':0x18eb});socketio['adapter'](require('socket.io-redis')({'pubClient':new Redis(config[_0xbfd1('0x8')]),'subClient':new Redis(config['redis'])}));require(_0xbfd1('0xb'))['default']();require(_0xbfd1('0xc'))[_0xbfd1('0xd')](socketio);require(_0xbfd1('0xe'))[_0xbfd1('0xd')](app);require(_0xbfd1('0xf'))[_0xbfd1('0xd')](app);}else{server[_0xbfd1('0x10')]('listening',function(){console[_0xbfd1('0x11')](_0xbfd1('0x12'),config[_0xbfd1('0x5')]);});}exports=module['exports']=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 83f9e3e..41ff9c6 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 _0x9f78=['http','request','then','rpc','error','message','result','exports','bluebird','../../config/logger','routing'];(function(_0x22f0e1,_0x34b648){var _0x5bda95=function(_0x4b8484){while(--_0x4b8484){_0x22f0e1['push'](_0x22f0e1['shift']());}};_0x5bda95(++_0x34b648);}(_0x9f78,0x173));var _0x89f7=function(_0x306095,_0x21cbce){_0x306095=_0x306095-0x0;var _0x3ac326=_0x9f78[_0x306095];return _0x3ac326;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x89f7('0x0'));var logger=require(_0x89f7('0x1'))(_0x89f7('0x2'));var client=jayson['client'][_0x89f7('0x3')]({'port':0x2329});client['Request']=function(_0x26ac37,_0x1cac98){return new BPromise(function(_0x102709,_0x2822ce){return client[_0x89f7('0x4')](_0x26ac37,_0x1cac98)[_0x89f7('0x5')](function(_0x4b4077){logger['debug'](_0x89f7('0x6'),_0x89f7('0x2'),_0x26ac37,_0x1cac98,_0x4b4077);if(_0x4b4077[_0x89f7('0x7')]){logger[_0x89f7('0x7')](_0x89f7('0x6'),_0x89f7('0x2'),_0x26ac37,_0x4b4077[_0x89f7('0x7')][_0x89f7('0x8')],_0x1cac98);return _0x2822ce(_0x4b4077[_0x89f7('0x7')]['message']);}else{return _0x102709(_0x4b4077[_0x89f7('0x9')]);}})['catch'](function(_0x5e2559){logger[_0x89f7('0x7')](_0x89f7('0x6'),_0x89f7('0x2'),_0x26ac37,_0x5e2559,_0x1cac98);return _0x2822ce(_0x5e2559);});});};module[_0x89f7('0xa')]=client; \ No newline at end of file +var _0xea21=['debug','rpc','error','message','result','catch','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request','then'];(function(_0x342a8f,_0x295cbe){var _0x496f0e=function(_0x1db74){while(--_0x1db74){_0x342a8f['push'](_0x342a8f['shift']());}};_0x496f0e(++_0x295cbe);}(_0xea21,0xab));var _0x1ea2=function(_0x186b65,_0xbb038a){_0x186b65=_0x186b65-0x0;var _0x3f0b31=_0xea21[_0x186b65];return _0x3f0b31;};'use strict';var jayson=require(_0x1ea2('0x0'));var BPromise=require(_0x1ea2('0x1'));var logger=require(_0x1ea2('0x2'))(_0x1ea2('0x3'));var client=jayson[_0x1ea2('0x4')][_0x1ea2('0x5')]({'port':0x2329});client[_0x1ea2('0x6')]=function(_0xa13e3,_0x55e795){return new BPromise(function(_0x1b8d02,_0x425eaa){return client[_0x1ea2('0x7')](_0xa13e3,_0x55e795)[_0x1ea2('0x8')](function(_0x4fe18b){logger[_0x1ea2('0x9')](_0x1ea2('0xa'),_0x1ea2('0x3'),_0xa13e3,_0x55e795,_0x4fe18b);if(_0x4fe18b[_0x1ea2('0xb')]){logger[_0x1ea2('0xb')](_0x1ea2('0xa'),_0x1ea2('0x3'),_0xa13e3,_0x4fe18b[_0x1ea2('0xb')][_0x1ea2('0xc')],_0x55e795);return _0x425eaa(_0x4fe18b['error']['message']);}else{return _0x1b8d02(_0x4fe18b[_0x1ea2('0xd')]);}})[_0x1ea2('0xe')](function(_0x2afcca){logger[_0x1ea2('0xb')]('rpc',_0x1ea2('0x3'),_0xa13e3,_0x2afcca,_0x55e795);return _0x425eaa(_0x2afcca);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 49e8414..7d690a6 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 _0x2d6b=['initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','getFaxQueues','getWhatsappQueues','listen','catch','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','getAgents','then','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues'];(function(_0xdf9bfe,_0x2815a6){var _0x54f927=function(_0x50563e){while(--_0x50563e){_0xdf9bfe['push'](_0xdf9bfe['shift']());}};_0x54f927(++_0x2815a6);}(_0x2d6b,0x1dc));var _0xb2d6=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0x2d6b[_0x35da42];return _0x370035;};'use strict';var BPromise=require(_0xb2d6('0x0'));var server=require(_0xb2d6('0x1'));var Realtime=require(_0xb2d6('0x2'));var user=require(_0xb2d6('0x3'));var interval=require(_0xb2d6('0x4'));var openchannelQueue=require(_0xb2d6('0x5'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0xb2d6('0x6'));var mailQueue=require(_0xb2d6('0x7'));var faxQueue=require(_0xb2d6('0x8'));var whatsappQueue=require(_0xb2d6('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xb2d6('0xa')]()['then'](user[_0xb2d6('0xb')]())[_0xb2d6('0xc')](realtime['initAgents']())[_0xb2d6('0xc')](interval[_0xb2d6('0xd')]())['then'](realtime[_0xb2d6('0xe')]())[_0xb2d6('0xc')](openchannelQueue[_0xb2d6('0xf')]())[_0xb2d6('0xc')](realtime[_0xb2d6('0x10')]())[_0xb2d6('0xc')](chatQueue[_0xb2d6('0x11')]())[_0xb2d6('0xc')](realtime[_0xb2d6('0x12')]())['then'](smsQueue[_0xb2d6('0x13')]())[_0xb2d6('0xc')](realtime[_0xb2d6('0x14')]())[_0xb2d6('0xc')](mailQueue[_0xb2d6('0x15')]())['then'](realtime['initMailQueues']())[_0xb2d6('0xc')](faxQueue[_0xb2d6('0x16')]())[_0xb2d6('0xc')](realtime['initFaxQueues']())['then'](whatsappQueue[_0xb2d6('0x17')]())[_0xb2d6('0xc')](realtime['initWhatsappQueues']())['then'](function(){return realtime;});}function main(){return server[_0xb2d6('0x18')](realtime)['then'](function(_0x4ff468){return initRealtime();})['then'](function(_0x8cc6a7){return setInterval(initRealtime,0x1388);})[_0xb2d6('0x19')](function(_0x1e0b51){console['log'](_0x1e0b51);});}main(); \ No newline at end of file +var _0xc6e0=['initFaxQueues','listen','log','bluebird','./server','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/whatsappQueue','resolve','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getFaxQueues'];(function(_0x10535c,_0x6d14c9){var _0x2c6219=function(_0xc31779){while(--_0xc31779){_0x10535c['push'](_0x10535c['shift']());}};_0x2c6219(++_0x6d14c9);}(_0xc6e0,0x117));var _0x0c6e=function(_0x2e9fb9,_0x538aa8){_0x2e9fb9=_0x2e9fb9-0x0;var _0x22572f=_0xc6e0[_0x2e9fb9];return _0x22572f;};'use strict';var BPromise=require(_0x0c6e('0x0'));var server=require(_0x0c6e('0x1'));var Realtime=require('./realtime');var user=require(_0x0c6e('0x2'));var interval=require(_0x0c6e('0x3'));var openchannelQueue=require(_0x0c6e('0x4'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0x0c6e('0x5'));var mailQueue=require(_0x0c6e('0x6'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0x0c6e('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x0c6e('0x8')]()[_0x0c6e('0x9')](user['getAgents']())['then'](realtime[_0x0c6e('0xa')]())[_0x0c6e('0x9')](interval[_0x0c6e('0xb')]())[_0x0c6e('0x9')](realtime[_0x0c6e('0xc')]())[_0x0c6e('0x9')](openchannelQueue[_0x0c6e('0xd')]())[_0x0c6e('0x9')](realtime[_0x0c6e('0xe')]())[_0x0c6e('0x9')](chatQueue[_0x0c6e('0xf')]())['then'](realtime[_0x0c6e('0x10')]())[_0x0c6e('0x9')](smsQueue[_0x0c6e('0x11')]())['then'](realtime[_0x0c6e('0x12')]())[_0x0c6e('0x9')](mailQueue['getMailQueues']())['then'](realtime['initMailQueues']())[_0x0c6e('0x9')](faxQueue[_0x0c6e('0x13')]())[_0x0c6e('0x9')](realtime[_0x0c6e('0x14')]())[_0x0c6e('0x9')](whatsappQueue['getWhatsappQueues']())[_0x0c6e('0x9')](realtime['initWhatsappQueues']())['then'](function(){return realtime;});}function main(){return server[_0x0c6e('0x15')](realtime)[_0x0c6e('0x9')](function(_0x39869d){return initRealtime();})[_0x0c6e('0x9')](function(_0xc1dba7){return setInterval(initRealtime,0x1388);})['catch'](function(_0x33b0d0){console[_0x0c6e('0x16')](_0x33b0d0);});}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 08d9642..ac88024 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 _0x814b=['init','parse','map','object','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','prototype','rules','isArray','concat','isObject','push','sync','filter','activeRules','orderBy','asc','execute','result','clone','name','ruleRef','call','next','isEqual','nextTick','restart','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','consequence','fromJSON'];(function(_0x5510a6,_0x4975b9){var _0x962a10=function(_0x5cca76){while(--_0x5cca76){_0x5510a6['push'](_0x5510a6['shift']());}};_0x962a10(++_0x4975b9);}(_0x814b,0x1a2));var _0xb814=function(_0x54da5b,_0x12fd71){_0x54da5b=_0x54da5b-0x0;var _0x285d3b=_0x814b[_0x54da5b];return _0x285d3b;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var EventEmitter=require(_0xb814('0x2'))[_0xb814('0x3')];function RuleEngine(_0xfbb64b,_0x477725){this['init']();if(!_[_0xb814('0x4')](_0xfbb64b)){this[_0xb814('0x5')](_0xfbb64b);}if(_0x477725){this[_0xb814('0x6')]=_0x477725[_0xb814('0x6')];}return this;}util[_0xb814('0x7')](RuleEngine,EventEmitter);RuleEngine[_0xb814('0x8')]['init']=function(_0x3b0829){this[_0xb814('0x9')]=[];this['activeRules']=[];};RuleEngine[_0xb814('0x8')][_0xb814('0x5')]=function(_0x186d5a){if(Array[_0xb814('0xa')](_0x186d5a)){this[_0xb814('0x9')]=this[_0xb814('0x9')][_0xb814('0xb')](_0x186d5a);}else if(_0x186d5a!==null&&_[_0xb814('0xc')](_0x186d5a)){this[_0xb814('0x9')][_0xb814('0xd')](_0x186d5a);}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0xe')]=function(){this['activeRules']=this[_0xb814('0x9')][_0xb814('0xf')](function(_0x35b10d){if(_[_0xb814('0x4')](_0x35b10d['on'])){_0x35b10d['on']=!![];}if(_0x35b10d['on']===!![]){return _0x35b10d;}});this[_0xb814('0x10')]=_[_0xb814('0x11')](this[_0xb814('0x10')],['p'],[_0xb814('0x12')]);};RuleEngine[_0xb814('0x8')][_0xb814('0x13')]=function(_0x3f4881,_0x44fb96){var _0x17f5bd=![];_0x3f4881[_0xb814('0x14')]=!![];var _0x303aca=_[_0xb814('0x15')](_0x3f4881);var _0x45e0d0=_[_0xb814('0x15')](_0x3f4881);var _0x125ce2=this[_0xb814('0x10')];var _0x7a21ef=[];var _0x48c9df=this[_0xb814('0x6')];(function FnRuleLoop(_0x55ba16){var _0x270598={'rules':function(){return _0x125ce2;},'rule':function(){return _0x125ce2[_0x55ba16];},'when':function(_0xfac75b){if(_0xfac75b){var _0x4c3007=_0x125ce2[_0x55ba16]['consequence'];_0x4c3007['ruleRef']=_0x125ce2[_0x55ba16]['id']||_0x125ce2[_0x55ba16][_0xb814('0x16')]||'index_'+_0x55ba16;process['nextTick'](function(){_0x7a21ef[_0xb814('0xd')](_0x4c3007[_0xb814('0x17')]);_0x4c3007[_0xb814('0x18')](_0x303aca,_0x270598);});}else{process['nextTick'](function(){_0x270598[_0xb814('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x17f5bd=!![];return FnRuleLoop(0x0);},'next':function(_0x531032){if(!_0x48c9df&&!_[_0xb814('0x1a')](_0x45e0d0,_0x303aca)){_0x45e0d0=_[_0xb814('0x15')](_0x303aca);process[_0xb814('0x1b')](function(){_0x270598[_0xb814('0x1c')]();});}else{process[_0xb814('0x1b')](function(){if(_[_0xb814('0x4')](_0x531032)){return FnRuleLoop(_0x55ba16+0x1);}else{return FnRuleLoop(_0x531032);}});}}};if(_0x55ba16<_0x125ce2[_0xb814('0x1d')]&&_0x17f5bd===![]){var _0x594470=_0x125ce2[_0x55ba16][_0xb814('0x1e')];_0x594470['call'](_0x303aca,_0x270598);}else{process[_0xb814('0x1b')](function(){_0x303aca[_0xb814('0x1f')]=_0x7a21ef;return _0x44fb96?_0x44fb96(_0x303aca):_[_0xb814('0x20')]();});}}(0x0));};RuleEngine[_0xb814('0x8')][_0xb814('0x21')]=function(_0xb9e57d){if(_[_0xb814('0x4')](_0xb9e57d)){return this['rules'];}else{var _0x392222=_[_0xb814('0x22')](_0xb9e57d);return _[_0xb814('0xf')](this[_0xb814('0x9')],_0x392222);}};RuleEngine[_0xb814('0x8')][_0xb814('0x23')]=function(_0x3f0150,_0x1e4e89){var _0x5a6291=_0x3f0150==='on'||_0x3f0150==='ON'?!![]:![];var _0x271aa8=this[_0xb814('0x21')](_0x1e4e89);for(var _0x52ed64=0x0,_0x9008b2=_0x271aa8[_0xb814('0x1d')];_0x52ed64<_0x9008b2;_0x52ed64+=0x1){_0x271aa8[_0x52ed64]['on']=_0x5a6291;}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0x24')]=function(_0x2051d0,_0x58c3ca){_0x2051d0=parseInt(_0x2051d0,0xa);var _0x338a28=this['findRules'](_0x58c3ca);for(var _0x6efe9a=0x0,_0x5f3e9b=_0x338a28['length'];_0x6efe9a<_0x5f3e9b;_0x6efe9a+=0x1){_0x338a28[_0x6efe9a][_0xb814('0x25')]=_0x2051d0;}this['sync']();};RuleEngine[_0xb814('0x8')][_0xb814('0x26')]=function(){var _0x2b91bd=this['rules'];if(_0x2b91bd instanceof Array){_0x2b91bd=_0x2b91bd['map'](function(_0x26d3a9){_0x26d3a9[_0xb814('0x1e')]=_0x26d3a9['condition'][_0xb814('0x27')]();_0x26d3a9[_0xb814('0x28')]=_0x26d3a9[_0xb814('0x28')][_0xb814('0x27')]();return _0x26d3a9;});}else if(!_[_0xb814('0x4')](_0x2b91bd)){_0x2b91bd[_0xb814('0x1e')]=_0x2b91bd[_0xb814('0x1e')]['toString']();_0x2b91bd[_0xb814('0x28')]=_0x2b91bd[_0xb814('0x28')][_0xb814('0x27')]();}return _0x2b91bd;};RuleEngine[_0xb814('0x8')][_0xb814('0x29')]=function(_0x4ff31a){this[_0xb814('0x2a')]();if(_['isString'](_0x4ff31a)){_0x4ff31a=JSON[_0xb814('0x2b')](_0x4ff31a);}if(_0x4ff31a instanceof Array){_0x4ff31a=_0x4ff31a[_0xb814('0x2c')](function(_0xe0f509){_0xe0f509['condition']=eval('('+_0xe0f509[_0xb814('0x1e')]+')');_0xe0f509[_0xb814('0x28')]=eval('('+_0xe0f509['consequence']+')');return _0xe0f509;});}else if(_0x4ff31a!==null&&typeof _0x4ff31a==_0xb814('0x2d')){_0x4ff31a[_0xb814('0x1e')]=eval('('+_0x4ff31a[_0xb814('0x1e')]+')');_0x4ff31a[_0xb814('0x28')]=eval('('+_0x4ff31a[_0xb814('0x28')]+')');}this[_0xb814('0x5')](_0x4ff31a);};module['exports']=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(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1261,0x144));var _0x1126=function(_0x4c0b23,_0x474c1c){_0x4c0b23=_0x4c0b23-0x0;var _0x3a06f0=_0x1261[_0x4c0b23];return _0x3a06f0;};'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 5ad34d9..64a8328 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 _0x08d0=['SendMail','bluebird','jayson/promise','client','http','then','error','message','result','catch','sendMailMessage'];(function(_0x2afd59,_0x1135e7){var _0x4a8271=function(_0x5a8082){while(--_0x5a8082){_0x2afd59['push'](_0x2afd59['shift']());}};_0x4a8271(++_0x1135e7);}(_0x08d0,0x1cf));var _0x008d=function(_0x44248f,_0x176efd){_0x44248f=_0x44248f-0x0;var _0x393b27=_0x08d0[_0x44248f];return _0x393b27;};'use strict';var BPromise=require(_0x008d('0x0'));var jayson=require(_0x008d('0x1'));var client=jayson[_0x008d('0x2')][_0x008d('0x3')]({'port':0x232b});function request(_0x43dbc0,_0x4f4dbb){return new BPromise(function(_0xf3bd89,_0x524d10){return client['request'](_0x43dbc0,_0x4f4dbb)[_0x008d('0x4')](function(_0x51f282){if(_0x51f282[_0x008d('0x5')]){return _0x524d10(_0x51f282[_0x008d('0x5')][_0x008d('0x6')]);}else{return _0xf3bd89(_0x51f282[_0x008d('0x7')]);}})[_0x008d('0x8')](function(_0x5bd457){return _0x524d10(_0x5bd457);});});}exports[_0x008d('0x9')]=function(_0x8b9b5e,_0xa5680b){return request(_0x008d('0xa'),{'account':_0x8b9b5e,'message':_0xa5680b});}; \ No newline at end of file +var _0x6086=['jayson/promise','client','http','request','error','message','catch','sendMailMessage','SendMail'];(function(_0x49e036,_0x50386a){var _0x20cf40=function(_0x2862f4){while(--_0x2862f4){_0x49e036['push'](_0x49e036['shift']());}};_0x20cf40(++_0x50386a);}(_0x6086,0xc6));var _0x6608=function(_0xf6aa76,_0x3c1978){_0xf6aa76=_0xf6aa76-0x0;var _0x3735d0=_0x6086[_0xf6aa76];return _0x3735d0;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x6608('0x0'));var client=jayson[_0x6608('0x1')][_0x6608('0x2')]({'port':0x232b});function request(_0x59f50c,_0x2308d2){return new BPromise(function(_0xf36e05,_0x510bc0){return client[_0x6608('0x3')](_0x59f50c,_0x2308d2)['then'](function(_0x2a1a15){if(_0x2a1a15['error']){return _0x510bc0(_0x2a1a15[_0x6608('0x4')][_0x6608('0x5')]);}else{return _0xf36e05(_0x2a1a15['result']);}})[_0x6608('0x6')](function(_0x292321){return _0x510bc0(_0x292321);});});}exports[_0x6608('0x7')]=function(_0x41c819,_0x2d18c1){return request(_0x6608('0x8'),{'account':_0x41c819,'message':_0x2d18c1});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 72c9f0c..a9e5312 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 _0x36f7=['openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','md5','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','working','mail','chat','openchannel','fax','sms','whatsapp','length','StatusTime','toNumber','format','online','chatPause','chatStatusTime','faxCapacity','smsStatus','whatsappStatus','stringify','user:save','exports','lodash','moment','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','voicePause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCurrentCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime'];(function(_0x1325bc,_0x493ad9){var _0x563646=function(_0x16e8d5){while(--_0x16e8d5){_0x1325bc['push'](_0x1325bc['shift']());}};_0x563646(++_0x493ad9);}(_0x36f7,0x154));var _0x736f=function(_0x5302bb,_0x1f530c){_0x5302bb=_0x5302bb-0x0;var _0x1a5103=_0x36f7[_0x5302bb];return _0x1a5103;};'use strict';var _=require(_0x736f('0x0'));var moment=require(_0x736f('0x1'));var md5=require('md5');var Redis=require(_0x736f('0x2'));var config=require(_0x736f('0x3'));config[_0x736f('0x4')]=_[_0x736f('0x5')](config[_0x736f('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x736f('0x6'))(new Redis(config[_0x736f('0x4')]));function Agent(_0x38c2cc){this['id']=_0x38c2cc['id']||0x0;this[_0x736f('0x7')]=_0x38c2cc[_0x736f('0x7')]||'';this['online']=_0x38c2cc['online']||!![];this[_0x736f('0x8')]=_0x38c2cc['voicePause']||![];this['chatPause']=_0x38c2cc['chatPause']||![];this[_0x736f('0x9')]=_0x38c2cc['mailPause']||![];this[_0x736f('0xa')]=_0x38c2cc[_0x736f('0xa')]||![];this[_0x736f('0xb')]=_0x38c2cc['smsPause']||![];this[_0x736f('0xc')]=_0x38c2cc[_0x736f('0xc')]||![];this[_0x736f('0xd')]=_0x736f('0xe');this['chatStatusTime']=0x0;this[_0x736f('0xf')]=_0x38c2cc['chatCapacity']||0x0;this[_0x736f('0x10')]=0x0;this[_0x736f('0x11')]='unknown';this[_0x736f('0x12')]=0x0;this[_0x736f('0x13')]=_0x38c2cc['mailCapacity']||0x0;this[_0x736f('0x14')]=0x0;this[_0x736f('0x15')]=_0x736f('0xe');this[_0x736f('0x16')]=0x0;this['faxCapacity']=_0x38c2cc['faxCapacity']||0x0;this[_0x736f('0x17')]=0x0;this['smsStatus']=_0x736f('0xe');this[_0x736f('0x18')]=0x0;this[_0x736f('0x19')]=_0x38c2cc[_0x736f('0x19')]||0x0;this[_0x736f('0x1a')]=0x0;this['whatsappStatus']=_0x736f('0xe');this[_0x736f('0x1b')]=0x0;this[_0x736f('0x1c')]=_0x38c2cc[_0x736f('0x1c')]||0x0;this[_0x736f('0x1d')]=0x0;this[_0x736f('0x1e')]=_0x736f('0xe');this[_0x736f('0x1f')]=0x0;this[_0x736f('0x20')]=_0x38c2cc[_0x736f('0x20')]||0x0;this[_0x736f('0x21')]=0x0;this[_0x736f('0x22')]=![];this[_0x736f('0x23')]=undefined;this[_0x736f('0x24')]='';this[_0x736f('0x25')]();}Agent[_0x736f('0x26')][_0x736f('0x27')]=function(_0x96be22){if(this[_0x96be22+_0x736f('0x28')]>0x0){if(this[_0x96be22+'Capacity']>0x0&&this[_0x96be22+_0x736f('0x28')]>=this[_0x96be22+_0x736f('0x29')]){return'maxcapacity';}else{return _0x736f('0x2a');}}else{return'idle';}};Agent['prototype']['updateRealtime']=function(){var _0x4142cb=[_0x736f('0x2b'),_0x736f('0x2c'),_0x736f('0x2d'),_0x736f('0x2e'),_0x736f('0x2f'),_0x736f('0x30')];for(var _0x4f8ede=0x0;_0x4f8ede<_0x4142cb[_0x736f('0x31')];_0x4f8ede+=0x1){var _0x3f3be2=this['getChannelStatus'](_0x4142cb[_0x4f8ede]);if(this[_0x4142cb[_0x4f8ede]+'Status']!==_0x3f3be2){this[_0x4142cb[_0x4f8ede]+_0x736f('0x32')]=_[_0x736f('0x33')](moment()[_0x736f('0x34')]('x'));}this[_0x4142cb[_0x4f8ede]+'Status']=_0x3f3be2;}var _0x5db3da={'id':this['id'],'name':this['name'],'online':this[_0x736f('0x35')],'voicePause':this['voicePause'],'chatPause':this[_0x736f('0x36')],'mailPause':this[_0x736f('0x9')],'smsPause':this['smsPause'],'faxPause':this[_0x736f('0xa')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x736f('0xd')],'chatStatusTime':this[_0x736f('0x37')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0x736f('0x10')],'mailStatus':this[_0x736f('0x11')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x736f('0x14')],'faxStatus':this[_0x736f('0x15')],'faxStatusTime':this[_0x736f('0x16')],'faxCapacity':this[_0x736f('0x38')],'faxCurrentCapacity':this[_0x736f('0x17')],'smsStatus':this[_0x736f('0x39')],'smsStatusTime':this[_0x736f('0x18')],'smsCapacity':this[_0x736f('0x19')],'smsCurrentCapacity':this[_0x736f('0x1a')],'whatsappStatus':this[_0x736f('0x3a')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0x736f('0x1c')],'whatsappCurrentCapacity':this[_0x736f('0x1d')],'openchannelStatus':this[_0x736f('0x1e')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x736f('0x21')],'busy':this[_0x736f('0x22')],'busyQueue':this[_0x736f('0x23')]};var _0xefd790=md5(JSON[_0x736f('0x3b')](_0x5db3da));if(this[_0x736f('0x24')]!==_0xefd790){this[_0x736f('0x24')]=_0xefd790;io['emit'](_0x736f('0x3c'),_0x5db3da);}};module[_0x736f('0x3d')]=Agent; \ No newline at end of file +var _0xb31c=['defaults','localhost','socket.io-emitter','name','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','mailStatus','mailStatusTime','mailCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busy','busyQueue','prototype','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','chat','openchannel','fax','sms','whatsapp','length','Status','StatusTime','toNumber','format','online','chatCurrentCapacity','mailCurrentCapacity','whatsappCurrentCapacity','openchannelCurrentCapacity','stringify','emit','user:save','exports','md5','../../../config/environment','redis'];(function(_0x4b26b5,_0x4f71fd){var _0x4dec71=function(_0x184329){while(--_0x184329){_0x4b26b5['push'](_0x4b26b5['shift']());}};_0x4dec71(++_0x4f71fd);}(_0xb31c,0x133));var _0xcb31=function(_0x5369c0,_0x4eed06){_0x5369c0=_0x5369c0-0x0;var _0x57016e=_0xb31c[_0x5369c0];return _0x57016e;};'use strict';var _=require('lodash');var moment=require('moment');var md5=require(_0xcb31('0x0'));var Redis=require('ioredis');var config=require(_0xcb31('0x1'));config[_0xcb31('0x2')]=_[_0xcb31('0x3')](config[_0xcb31('0x2')],{'host':_0xcb31('0x4'),'port':0x18eb});var io=require(_0xcb31('0x5'))(new Redis(config[_0xcb31('0x2')]));function Agent(_0x56a19d){this['id']=_0x56a19d['id']||0x0;this[_0xcb31('0x6')]=_0x56a19d[_0xcb31('0x6')]||'';this['online']=_0x56a19d['online']||!![];this[_0xcb31('0x7')]=_0x56a19d[_0xcb31('0x7')]||![];this[_0xcb31('0x8')]=_0x56a19d[_0xcb31('0x8')]||![];this[_0xcb31('0x9')]=_0x56a19d[_0xcb31('0x9')]||![];this['faxPause']=_0x56a19d[_0xcb31('0xa')]||![];this[_0xcb31('0xb')]=_0x56a19d[_0xcb31('0xb')]||![];this['openchannelPause']=_0x56a19d[_0xcb31('0xc')]||![];this[_0xcb31('0xd')]=_0xcb31('0xe');this[_0xcb31('0xf')]=0x0;this[_0xcb31('0x10')]=_0x56a19d['chatCapacity']||0x0;this['chatCurrentCapacity']=0x0;this[_0xcb31('0x11')]='unknown';this[_0xcb31('0x12')]=0x0;this['mailCapacity']=_0x56a19d[_0xcb31('0x13')]||0x0;this['mailCurrentCapacity']=0x0;this[_0xcb31('0x14')]='unknown';this[_0xcb31('0x15')]=0x0;this[_0xcb31('0x16')]=_0x56a19d[_0xcb31('0x16')]||0x0;this[_0xcb31('0x17')]=0x0;this[_0xcb31('0x18')]=_0xcb31('0xe');this[_0xcb31('0x19')]=0x0;this[_0xcb31('0x1a')]=_0x56a19d['smsCapacity']||0x0;this[_0xcb31('0x1b')]=0x0;this[_0xcb31('0x1c')]=_0xcb31('0xe');this[_0xcb31('0x1d')]=0x0;this[_0xcb31('0x1e')]=_0x56a19d['whatsappCapacity']||0x0;this['whatsappCurrentCapacity']=0x0;this[_0xcb31('0x1f')]=_0xcb31('0xe');this[_0xcb31('0x20')]=0x0;this[_0xcb31('0x21')]=_0x56a19d[_0xcb31('0x21')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0xcb31('0x22')]=![];this[_0xcb31('0x23')]=undefined;this[_0xcb31('0x0')]='';this['updateRealtime']();}Agent[_0xcb31('0x24')]['getChannelStatus']=function(_0x1fcdd3){if(this[_0x1fcdd3+_0xcb31('0x25')]>0x0){if(this[_0x1fcdd3+_0xcb31('0x26')]>0x0&&this[_0x1fcdd3+_0xcb31('0x25')]>=this[_0x1fcdd3+_0xcb31('0x26')]){return _0xcb31('0x27');}else{return _0xcb31('0x28');}}else{return _0xcb31('0x29');}};Agent[_0xcb31('0x24')]['updateRealtime']=function(){var _0xc893db=[_0xcb31('0x2a'),_0xcb31('0x2b'),_0xcb31('0x2c'),_0xcb31('0x2d'),_0xcb31('0x2e'),_0xcb31('0x2f')];for(var _0x24388e=0x0;_0x24388e<_0xc893db[_0xcb31('0x30')];_0x24388e+=0x1){var _0x312b3e=this['getChannelStatus'](_0xc893db[_0x24388e]);if(this[_0xc893db[_0x24388e]+_0xcb31('0x31')]!==_0x312b3e){this[_0xc893db[_0x24388e]+_0xcb31('0x32')]=_[_0xcb31('0x33')](moment()[_0xcb31('0x34')]('x'));}this[_0xc893db[_0x24388e]+_0xcb31('0x31')]=_0x312b3e;}var _0x286843={'id':this['id'],'name':this[_0xcb31('0x6')],'online':this[_0xcb31('0x35')],'voicePause':this[_0xcb31('0x7')],'chatPause':this[_0xcb31('0x8')],'mailPause':this[_0xcb31('0x9')],'smsPause':this[_0xcb31('0xb')],'faxPause':this[_0xcb31('0xa')],'openchannelPause':this[_0xcb31('0xc')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0xcb31('0xf')],'chatCapacity':this[_0xcb31('0x10')],'chatCurrentCapacity':this[_0xcb31('0x36')],'mailStatus':this[_0xcb31('0x11')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0xcb31('0x13')],'mailCurrentCapacity':this[_0xcb31('0x37')],'faxStatus':this[_0xcb31('0x14')],'faxStatusTime':this[_0xcb31('0x15')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0xcb31('0x17')],'smsStatus':this[_0xcb31('0x18')],'smsStatusTime':this[_0xcb31('0x19')],'smsCapacity':this[_0xcb31('0x1a')],'smsCurrentCapacity':this[_0xcb31('0x1b')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0xcb31('0x1e')],'whatsappCurrentCapacity':this[_0xcb31('0x38')],'openchannelStatus':this[_0xcb31('0x1f')],'openchannelStatusTime':this[_0xcb31('0x20')],'openchannelCapacity':this[_0xcb31('0x21')],'openchannelCurrentCapacity':this[_0xcb31('0x39')],'busy':this[_0xcb31('0x22')],'busyQueue':this[_0xcb31('0x23')]};var _0x3121c1=md5(JSON[_0xcb31('0x3a')](_0x286843));if(this[_0xcb31('0x0')]!==_0x3121c1){this[_0xcb31('0x0')]=_0x3121c1;io[_0xcb31('0x3b')](_0xcb31('0x3c'),_0x286843);}};module[_0xcb31('0x3d')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 89b4544..3cbedda 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 _0x78c4=['prototype','_rr','map','loggedIn','paused','length','online','chatPause','available','waiting','format','chat:queue:%s','chat_queue:save','exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','strategy','beepall','Agents','mapAgentsId','updateRealtime'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x78c4,0x142));var _0x478c=function(_0xc344b,_0x2d832d){_0xc344b=_0xc344b-0x0;var _0x3129a8=_0x78c4[_0xc344b];return _0x3129a8;};'use strict';var _=require(_0x478c('0x0'));var md5=require(_0x478c('0x1'));var util=require(_0x478c('0x2'));var Redis=require('ioredis');var config=require(_0x478c('0x3'));config[_0x478c('0x4')]=_[_0x478c('0x5')](config['redis'],{'host':_0x478c('0x6'),'port':0x18eb});var io=require(_0x478c('0x7'))(new Redis(config[_0x478c('0x4')]));function ChatQueue(_0x486868){this['id']=_0x486868['id']||0x0;this[_0x478c('0x8')]=_0x486868[_0x478c('0x8')]||'';this['timeout']=_0x486868['timeout']||0xa;this[_0x478c('0x9')]=_0x486868[_0x478c('0x9')]||_0x478c('0xa');this[_0x478c('0xb')]=_0x486868[_0x478c('0xb')];this[_0x478c('0xc')]={};this['waiting']=0x0;this[_0x478c('0x1')]='';this['updateRouting']();this[_0x478c('0xd')]();}ChatQueue[_0x478c('0xe')]['updateRouting']=function(){var _0x3300bd=this['mapAgentsId'][_0x478c('0xf')];this['mapAgentsId']=_[_0x478c('0x10')](this['Agents'],'id');this[_0x478c('0xc')]['_rr']=_0x3300bd;};ChatQueue[_0x478c('0xe')][_0x478c('0xd')]=function(){this[_0x478c('0x11')]=0x0;this[_0x478c('0x12')]=0x0;for(var _0x3d5ce8=0x0;_0x3d5ce8=0x0?this[_0x478c('0x16')]:0x0;var _0x4afd99={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x478c('0x8')],'paused':this[_0x478c('0x12')],'waiting':this[_0x478c('0x17')]};var _0x5254ee=md5(JSON['stringify'](_0x4afd99));if(this[_0x478c('0x1')]!==_0x5254ee){this[_0x478c('0x1')]=_0x5254ee;io['to'](util[_0x478c('0x18')](_0x478c('0x19'),_0x4afd99['name']))['emit'](_0x478c('0x1a'),_0x4afd99);}};module[_0x478c('0x1b')]=ChatQueue; \ No newline at end of file +var _0xe81f=['online','available','stringify','format','chat:queue:%s','emit','chat_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','paused','length'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xe81f,0xc1));var _0xfe81=function(_0x47387f,_0x2761b7){_0x47387f=_0x47387f-0x0;var _0x513692=_0xe81f[_0x47387f];return _0x513692;};'use strict';var _=require(_0xfe81('0x0'));var md5=require(_0xfe81('0x1'));var util=require(_0xfe81('0x2'));var Redis=require(_0xfe81('0x3'));var config=require(_0xfe81('0x4'));config[_0xfe81('0x5')]=_[_0xfe81('0x6')](config['redis'],{'host':_0xfe81('0x7'),'port':0x18eb});var io=require(_0xfe81('0x8'))(new Redis(config[_0xfe81('0x5')]));function ChatQueue(_0xb88cbd){this['id']=_0xb88cbd['id']||0x0;this[_0xfe81('0x9')]=_0xb88cbd['name']||'';this['timeout']=_0xb88cbd[_0xfe81('0xa')]||0xa;this[_0xfe81('0xb')]=_0xb88cbd['strategy']||_0xfe81('0xc');this[_0xfe81('0xd')]=_0xb88cbd[_0xfe81('0xd')];this[_0xfe81('0xe')]={};this[_0xfe81('0xf')]=0x0;this[_0xfe81('0x1')]='';this[_0xfe81('0x10')]();this[_0xfe81('0x11')]();}ChatQueue['prototype'][_0xfe81('0x10')]=function(){var _0xe8fb56=this['mapAgentsId'][_0xfe81('0x12')];this[_0xfe81('0xe')]=_[_0xfe81('0x13')](this['Agents'],'id');this[_0xfe81('0xe')]['_rr']=_0xe8fb56;};ChatQueue[_0xfe81('0x14')][_0xfe81('0x11')]=function(){this[_0xfe81('0x15')]=0x0;this[_0xfe81('0x16')]=0x0;for(var _0x1f5329=0x0;_0x1f5329=0x0?this[_0xfe81('0x19')]:0x0;var _0x54155a={'id':this['id'],'available':this[_0xfe81('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0xfe81('0x16')],'waiting':this['waiting']};var _0x3e2ab2=md5(JSON[_0xfe81('0x1a')](_0x54155a));if(this[_0xfe81('0x1')]!==_0x3e2ab2){this['md5']=_0x3e2ab2;io['to'](util[_0xfe81('0x1b')](_0xfe81('0x1c'),_0x54155a['name']))[_0xfe81('0x1d')](_0xfe81('0x1e'),_0x54155a);}};module['exports']=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 74c511c..1d423e6 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 _0x9c64=['updateRealtime','prototype','mapAgentsId','_rr','map','paused','online','loggedIn','available','stringify','fax:queue:%s','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','Agents','waiting','updateRouting'];(function(_0x51a7b0,_0x20b362){var _0x3c31d0=function(_0x396900){while(--_0x396900){_0x51a7b0['push'](_0x51a7b0['shift']());}};_0x3c31d0(++_0x20b362);}(_0x9c64,0x1e0));var _0x49c6=function(_0x5976c4,_0xde1e73){_0x5976c4=_0x5976c4-0x0;var _0x52846b=_0x9c64[_0x5976c4];return _0x52846b;};'use strict';var _=require(_0x49c6('0x0'));var md5=require(_0x49c6('0x1'));var util=require(_0x49c6('0x2'));var Redis=require(_0x49c6('0x3'));var config=require(_0x49c6('0x4'));config[_0x49c6('0x5')]=_[_0x49c6('0x6')](config[_0x49c6('0x5')],{'host':_0x49c6('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function FaxQueue(_0x25f5fa){this['id']=_0x25f5fa['id']||0x0;this['name']=_0x25f5fa[_0x49c6('0x8')]||'';this[_0x49c6('0x9')]=_0x25f5fa['timeout']||0xa;this['strategy']=_0x25f5fa[_0x49c6('0xa')]||'beepall';this['Agents']=_0x25f5fa[_0x49c6('0xb')];this['mapAgentsId']={};this[_0x49c6('0xc')]=0x0;this[_0x49c6('0x1')]='';this[_0x49c6('0xd')]();this[_0x49c6('0xe')]();}FaxQueue[_0x49c6('0xf')][_0x49c6('0xd')]=function(){var _0x3888aa=this[_0x49c6('0x10')][_0x49c6('0x11')];this[_0x49c6('0x10')]=_[_0x49c6('0x12')](this[_0x49c6('0xb')],'id');this[_0x49c6('0x10')]['_rr']=_0x3888aa;};FaxQueue['prototype'][_0x49c6('0xe')]=function(){this['loggedIn']=0x0;this[_0x49c6('0x13')]=0x0;for(var _0x1ebabb=0x0;_0x1ebabb=0x0?this[_0x49c6('0x16')]:0x0;var _0x1ba2f9={'id':this['id'],'available':this[_0x49c6('0x16')],'loggedIn':this[_0x49c6('0x15')],'name':this[_0x49c6('0x8')],'paused':this[_0x49c6('0x13')],'waiting':this['waiting']};var _0x196b33=md5(JSON[_0x49c6('0x17')](_0x1ba2f9));if(this[_0x49c6('0x1')]!==_0x196b33){this[_0x49c6('0x1')]=_0x196b33;io['to'](util['format'](_0x49c6('0x18'),_0x1ba2f9['name']))['emit']('fax_queue:save',_0x1ba2f9);}};module[_0x49c6('0x19')]=FaxQueue; \ No newline at end of file +var _0x7097=['online','faxPause','available','stringify','md5','format','fax:queue:%s','emit','fax_queue:save','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','loggedIn','paused'];(function(_0x5797da,_0x25123e){var _0x2fbb54=function(_0x2eb3fc){while(--_0x2eb3fc){_0x5797da['push'](_0x5797da['shift']());}};_0x2fbb54(++_0x25123e);}(_0x7097,0x1ad));var _0x7709=function(_0x441f16,_0x1849ae){_0x441f16=_0x441f16-0x0;var _0x1efcf0=_0x7097[_0x441f16];return _0x1efcf0;};'use strict';var _=require(_0x7709('0x0'));var md5=require('md5');var util=require(_0x7709('0x1'));var Redis=require(_0x7709('0x2'));var config=require(_0x7709('0x3'));config[_0x7709('0x4')]=_[_0x7709('0x5')](config[_0x7709('0x4')],{'host':_0x7709('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7709('0x4')]));function FaxQueue(_0x11393d){this['id']=_0x11393d['id']||0x0;this[_0x7709('0x7')]=_0x11393d['name']||'';this[_0x7709('0x8')]=_0x11393d[_0x7709('0x8')]||0xa;this[_0x7709('0x9')]=_0x11393d[_0x7709('0x9')]||_0x7709('0xa');this[_0x7709('0xb')]=_0x11393d[_0x7709('0xb')];this[_0x7709('0xc')]={};this[_0x7709('0xd')]=0x0;this['md5']='';this[_0x7709('0xe')]();this[_0x7709('0xf')]();}FaxQueue['prototype'][_0x7709('0xe')]=function(){var _0x1795f7=this[_0x7709('0xc')][_0x7709('0x10')];this[_0x7709('0xc')]=_['map'](this[_0x7709('0xb')],'id');this[_0x7709('0xc')][_0x7709('0x10')]=_0x1795f7;};FaxQueue['prototype'][_0x7709('0xf')]=function(){this[_0x7709('0x11')]=0x0;this[_0x7709('0x12')]=0x0;for(var _0x905ef5=0x0;_0x905ef5=0x0?this[_0x7709('0x15')]:0x0;var _0x4a6609={'id':this['id'],'available':this[_0x7709('0x15')],'loggedIn':this[_0x7709('0x11')],'name':this[_0x7709('0x7')],'paused':this[_0x7709('0x12')],'waiting':this[_0x7709('0xd')]};var _0x71d8a2=md5(JSON[_0x7709('0x16')](_0x4a6609));if(this[_0x7709('0x17')]!==_0x71d8a2){this[_0x7709('0x17')]=_0x71d8a2;io['to'](util[_0x7709('0x18')](_0x7709('0x19'),_0x4a6609[_0x7709('0x7')]))[_0x7709('0x1a')](_0x7709('0x1b'),_0x4a6609);}};module['exports']=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index b8f637f..78e39aa 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 _0x4d19=['Intervals','name'];(function(_0x488b4c,_0x58ea02){var _0x3b1b59=function(_0x335a3a){while(--_0x335a3a){_0x488b4c['push'](_0x488b4c['shift']());}};_0x3b1b59(++_0x58ea02);}(_0x4d19,0x103));var _0x94d1=function(_0x48021e,_0x3c0337){_0x48021e=_0x48021e-0x0;var _0x804901=_0x4d19[_0x48021e];return _0x804901;};'use strict';function Interval(_0x13cd84){this['id']=_0x13cd84['id']||0x0;this['name']=_0x13cd84[_0x94d1('0x0')]||'';this[_0x94d1('0x1')]=_0x13cd84[_0x94d1('0x1')]||{};}module['exports']=Interval; \ No newline at end of file +var _0x3a37=['name','Intervals','exports'];(function(_0x4d7a70,_0x2d3bfa){var _0x3aafbb=function(_0x43fbf2){while(--_0x43fbf2){_0x4d7a70['push'](_0x4d7a70['shift']());}};_0x3aafbb(++_0x2d3bfa);}(_0x3a37,0xe7));var _0x73a3=function(_0x21dc70,_0x287214){_0x21dc70=_0x21dc70-0x0;var _0x47e638=_0x3a37[_0x21dc70];return _0x47e638;};'use strict';function Interval(_0x3ee40a){this['id']=_0x3ee40a['id']||0x0;this[_0x73a3('0x0')]=_0x3ee40a[_0x73a3('0x0')]||'';this[_0x73a3('0x1')]=_0x3ee40a[_0x73a3('0x1')]||{};}module[_0x73a3('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 4045f13..0a19d80 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 _0x3c67=['redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','map','paused','length','loggedIn','mailPause','available','format','emit','mail_queue:save','exports','lodash','util','ioredis','../../../config/environment','defaults'];(function(_0xde7ce7,_0x334398){var _0x3af285=function(_0x30bb11){while(--_0x30bb11){_0xde7ce7['push'](_0xde7ce7['shift']());}};_0x3af285(++_0x334398);}(_0x3c67,0x163));var _0x73c6=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x3c67[_0x5a776b];return _0xbbef59;};'use strict';var _=require(_0x73c6('0x0'));var md5=require('md5');var util=require(_0x73c6('0x1'));var Redis=require(_0x73c6('0x2'));var config=require(_0x73c6('0x3'));config['redis']=_[_0x73c6('0x4')](config[_0x73c6('0x5')],{'host':_0x73c6('0x6'),'port':0x18eb});var io=require(_0x73c6('0x7'))(new Redis(config[_0x73c6('0x5')]));function MailQueue(_0x287d77){this['id']=_0x287d77['id']||0x0;this[_0x73c6('0x8')]=_0x287d77[_0x73c6('0x8')]||'';this[_0x73c6('0x9')]=_0x287d77[_0x73c6('0x9')]||0xa;this[_0x73c6('0xa')]=_0x287d77[_0x73c6('0xa')]||_0x73c6('0xb');this[_0x73c6('0xc')]=_0x287d77['Agents'];this[_0x73c6('0xd')]={};this[_0x73c6('0xe')]=0x0;this[_0x73c6('0xf')]='';this[_0x73c6('0x10')]();this[_0x73c6('0x11')]();}MailQueue[_0x73c6('0x12')][_0x73c6('0x10')]=function(){var _0x2bb585=this[_0x73c6('0xd')][_0x73c6('0x13')];this[_0x73c6('0xd')]=_[_0x73c6('0x14')](this[_0x73c6('0xc')],'id');this[_0x73c6('0xd')][_0x73c6('0x13')]=_0x2bb585;};MailQueue[_0x73c6('0x12')][_0x73c6('0x11')]=function(){this['loggedIn']=0x0;this[_0x73c6('0x15')]=0x0;for(var _0x15e119=0x0;_0x15e119=0x0?this['available']:0x0;var _0x16c487={'id':this['id'],'available':this[_0x73c6('0x19')],'loggedIn':this[_0x73c6('0x17')],'name':this[_0x73c6('0x8')],'paused':this['paused'],'waiting':this[_0x73c6('0xe')]};var _0x402d88=md5(JSON['stringify'](_0x16c487));if(this[_0x73c6('0xf')]!==_0x402d88){this[_0x73c6('0xf')]=_0x402d88;io['to'](util[_0x73c6('0x1a')]('mail:queue:%s',_0x16c487[_0x73c6('0x8')]))[_0x73c6('0x1b')](_0x73c6('0x1c'),_0x16c487);}};module[_0x73c6('0x1d')]=MailQueue; \ No newline at end of file +var _0x7976=['../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','map','mapAgentsId','_rr','prototype','loggedIn','paused','mailPause','available','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','ioredis'];(function(_0x2851ee,_0x4a7404){var _0x3c6dd4=function(_0x5075ec){while(--_0x5075ec){_0x2851ee['push'](_0x2851ee['shift']());}};_0x3c6dd4(++_0x4a7404);}(_0x7976,0x1dc));var _0x6797=function(_0xd1c550,_0x1f72e9){_0xd1c550=_0xd1c550-0x0;var _0x45fcd2=_0x7976[_0xd1c550];return _0x45fcd2;};'use strict';var _=require(_0x6797('0x0'));var md5=require(_0x6797('0x1'));var util=require(_0x6797('0x2'));var Redis=require(_0x6797('0x3'));var config=require(_0x6797('0x4'));config['redis']=_['defaults'](config[_0x6797('0x5')],{'host':_0x6797('0x6'),'port':0x18eb});var io=require(_0x6797('0x7'))(new Redis(config[_0x6797('0x5')]));function MailQueue(_0x37e498){this['id']=_0x37e498['id']||0x0;this[_0x6797('0x8')]=_0x37e498[_0x6797('0x8')]||'';this[_0x6797('0x9')]=_0x37e498[_0x6797('0x9')]||0xa;this['strategy']=_0x37e498[_0x6797('0xa')]||_0x6797('0xb');this[_0x6797('0xc')]=_0x37e498[_0x6797('0xc')];this['mapAgentsId']={};this[_0x6797('0xd')]=0x0;this[_0x6797('0x1')]='';this[_0x6797('0xe')]();this[_0x6797('0xf')]();}MailQueue['prototype']['updateRouting']=function(){var _0x77fff4=this['mapAgentsId']['_rr'];this['mapAgentsId']=_[_0x6797('0x10')](this[_0x6797('0xc')],'id');this[_0x6797('0x11')][_0x6797('0x12')]=_0x77fff4;};MailQueue[_0x6797('0x13')][_0x6797('0xf')]=function(){this[_0x6797('0x14')]=0x0;this[_0x6797('0x15')]=0x0;for(var _0x5d238c=0x0;_0x5d238c=0x0?this['available']:0x0;var _0x3df805={'id':this['id'],'available':this[_0x6797('0x17')],'loggedIn':this['loggedIn'],'name':this[_0x6797('0x8')],'paused':this[_0x6797('0x15')],'waiting':this[_0x6797('0xd')]};var _0xdf143a=md5(JSON[_0x6797('0x18')](_0x3df805));if(this['md5']!==_0xdf143a){this[_0x6797('0x1')]=_0xdf143a;io['to'](util[_0x6797('0x19')](_0x6797('0x1a'),_0x3df805['name']))[_0x6797('0x1b')](_0x6797('0x1c'),_0x3df805);}};module[_0x6797('0x1d')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 0cc7beb..3ddce51 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(_0x189cde,_0x457803){var _0xb066ed=function(_0x31a3be){while(--_0x31a3be){_0x189cde['push'](_0x189cde['shift']());}};_0xb066ed(++_0x457803);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3fd3a3,_0x36c863){_0x3fd3a3=_0x3fd3a3-0x0;var _0xa3e4d5=_0x5fc3[_0x3fd3a3];return _0xa3e4d5;};'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(_0x47b15f,_0x103e93){var _0x55bf25=function(_0x51fe7f){while(--_0x51fe7f){_0x47b15f['push'](_0x47b15f['shift']());}};_0x55bf25(++_0x103e93);}(_0x1261,0x144));var _0x1126=function(_0x5820df,_0x24240a){_0x5820df=_0x5820df-0x0;var _0x7a47f1=_0x1261[_0x5820df];return _0x7a47f1;};'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 726af14..69910f3 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 _0xa74d=['util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','smsPause','available','waiting','stringify','format','sms_queue:save','exports','md5'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xa74d,0x1cf));var _0xda74=function(_0x493bbb,_0x15f53b){_0x493bbb=_0x493bbb-0x0;var _0x3f8e0a=_0xa74d[_0x493bbb];return _0x3f8e0a;};'use strict';var _=require('lodash');var md5=require(_0xda74('0x0'));var util=require(_0xda74('0x1'));var Redis=require(_0xda74('0x2'));var config=require(_0xda74('0x3'));config[_0xda74('0x4')]=_[_0xda74('0x5')](config['redis'],{'host':_0xda74('0x6'),'port':0x18eb});var io=require(_0xda74('0x7'))(new Redis(config[_0xda74('0x4')]));function SmsQueue(_0x3f65e4){this['id']=_0x3f65e4['id']||0x0;this[_0xda74('0x8')]=_0x3f65e4[_0xda74('0x8')]||'';this[_0xda74('0x9')]=_0x3f65e4[_0xda74('0x9')]||0xa;this['strategy']=_0x3f65e4[_0xda74('0xa')]||'beepall';this['Agents']=_0x3f65e4[_0xda74('0xb')];this[_0xda74('0xc')]={};this['waiting']=0x0;this[_0xda74('0x0')]='';this[_0xda74('0xd')]();this[_0xda74('0xe')]();}SmsQueue[_0xda74('0xf')][_0xda74('0xd')]=function(){var _0x2bb855=this[_0xda74('0xc')][_0xda74('0x10')];this['mapAgentsId']=_[_0xda74('0x11')](this[_0xda74('0xb')],'id');this[_0xda74('0xc')]['_rr']=_0x2bb855;};SmsQueue[_0xda74('0xf')][_0xda74('0xe')]=function(){this[_0xda74('0x12')]=0x0;this[_0xda74('0x13')]=0x0;for(var _0x447135=0x0;_0x447135=0x0?this[_0xda74('0x17')]:0x0;var _0xd22576={'id':this['id'],'available':this[_0xda74('0x17')],'loggedIn':this['loggedIn'],'name':this[_0xda74('0x8')],'paused':this[_0xda74('0x13')],'waiting':this[_0xda74('0x18')]};var _0x2b6770=md5(JSON[_0xda74('0x19')](_0xd22576));if(this[_0xda74('0x0')]!==_0x2b6770){this[_0xda74('0x0')]=_0x2b6770;io['to'](util[_0xda74('0x1a')]('sms:queue:%s',_0xd22576['name']))['emit'](_0xda74('0x1b'),_0xd22576);}};module[_0xda74('0x1c')]=SmsQueue; \ No newline at end of file +var _0x2917=['util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','loggedIn','paused','length','smsPause','available','stringify','format','emit','lodash','md5'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x2917,0x142));var _0x7291=function(_0x8ba19a,_0x1d2b2b){_0x8ba19a=_0x8ba19a-0x0;var _0x2bd8b4=_0x2917[_0x8ba19a];return _0x2bd8b4;};'use strict';var _=require(_0x7291('0x0'));var md5=require(_0x7291('0x1'));var util=require(_0x7291('0x2'));var Redis=require(_0x7291('0x3'));var config=require(_0x7291('0x4'));config[_0x7291('0x5')]=_[_0x7291('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x7291('0x7'))(new Redis(config[_0x7291('0x5')]));function SmsQueue(_0x1b5e13){this['id']=_0x1b5e13['id']||0x0;this[_0x7291('0x8')]=_0x1b5e13[_0x7291('0x8')]||'';this[_0x7291('0x9')]=_0x1b5e13[_0x7291('0x9')]||0xa;this[_0x7291('0xa')]=_0x1b5e13[_0x7291('0xa')]||_0x7291('0xb');this[_0x7291('0xc')]=_0x1b5e13[_0x7291('0xc')];this[_0x7291('0xd')]={};this[_0x7291('0xe')]=0x0;this[_0x7291('0x1')]='';this['updateRouting']();this[_0x7291('0xf')]();}SmsQueue[_0x7291('0x10')][_0x7291('0x11')]=function(){var _0x463e52=this[_0x7291('0xd')][_0x7291('0x12')];this['mapAgentsId']=_['map'](this[_0x7291('0xc')],'id');this[_0x7291('0xd')][_0x7291('0x12')]=_0x463e52;};SmsQueue[_0x7291('0x10')][_0x7291('0xf')]=function(){this[_0x7291('0x13')]=0x0;this[_0x7291('0x14')]=0x0;for(var _0x54e3e6=0x0;_0x54e3e6=0x0?this[_0x7291('0x17')]:0x0;var _0x9c2228={'id':this['id'],'available':this[_0x7291('0x17')],'loggedIn':this[_0x7291('0x13')],'name':this['name'],'paused':this[_0x7291('0x14')],'waiting':this['waiting']};var _0x4258a1=md5(JSON[_0x7291('0x18')](_0x9c2228));if(this[_0x7291('0x1')]!==_0x4258a1){this['md5']=_0x4258a1;io['to'](util[_0x7291('0x19')]('sms:queue:%s',_0x9c2228[_0x7291('0x8')]))[_0x7291('0x1a')]('sms_queue:save',_0x9c2228);}};module['exports']=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 4d7411f..5f8821f 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 _0x4dec=['lodash','md5','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','length','online','whatsappPause','available','paused','stringify','format','emit','whatsapp_queue:save','exports'];(function(_0xcd8ef9,_0x23ad1e){var _0x5e148c=function(_0x21435a){while(--_0x21435a){_0xcd8ef9['push'](_0xcd8ef9['shift']());}};_0x5e148c(++_0x23ad1e);}(_0x4dec,0x1e0));var _0xc4de=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x4dec[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xc4de('0x0'));var md5=require(_0xc4de('0x1'));var util=require(_0xc4de('0x2'));var Redis=require(_0xc4de('0x3'));var config=require(_0xc4de('0x4'));config[_0xc4de('0x5')]=_[_0xc4de('0x6')](config[_0xc4de('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xc4de('0x7'))(new Redis(config['redis']));function WhatsappQueue(_0x2df969){this['id']=_0x2df969['id']||0x0;this[_0xc4de('0x8')]=_0x2df969[_0xc4de('0x8')]||'';this[_0xc4de('0x9')]=_0x2df969['timeout']||0xa;this[_0xc4de('0xa')]=_0x2df969[_0xc4de('0xa')]||'beepall';this['Agents']=_0x2df969[_0xc4de('0xb')];this['mapAgentsId']={};this[_0xc4de('0xc')]=0x0;this[_0xc4de('0x1')]='';this[_0xc4de('0xd')]();this[_0xc4de('0xe')]();}WhatsappQueue[_0xc4de('0xf')][_0xc4de('0xd')]=function(){var _0x58c551=this[_0xc4de('0x10')][_0xc4de('0x11')];this[_0xc4de('0x10')]=_[_0xc4de('0x12')](this[_0xc4de('0xb')],'id');this[_0xc4de('0x10')]['_rr']=_0x58c551;};WhatsappQueue['prototype'][_0xc4de('0xe')]=function(){this[_0xc4de('0x13')]=0x0;this['paused']=0x0;for(var _0x1c2782=0x0;_0x1c2782=0x0?this[_0xc4de('0x17')]:0x0;var _0x475aed={'id':this['id'],'available':this[_0xc4de('0x17')],'loggedIn':this[_0xc4de('0x13')],'name':this[_0xc4de('0x8')],'paused':this[_0xc4de('0x18')],'waiting':this[_0xc4de('0xc')]};var _0x18b48e=md5(JSON[_0xc4de('0x19')](_0x475aed));if(this[_0xc4de('0x1')]!==_0x18b48e){this[_0xc4de('0x1')]=_0x18b48e;io['to'](util[_0xc4de('0x1a')]('whatsapp:queue:%s',_0x475aed[_0xc4de('0x8')]))[_0xc4de('0x1b')](_0xc4de('0x1c'),_0x475aed);}};module[_0xc4de('0x1d')]=WhatsappQueue; \ No newline at end of file +var _0xcbe5=['strategy','Agents','mapAgentsId','waiting','updateRealtime','updateRouting','_rr','prototype','loggedIn','paused','length','online','whatsappPause','available','stringify','format','whatsapp_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xcbe5,0x1d2));var _0x5cbe=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xcbe5[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var md5=require(_0x5cbe('0x0'));var util=require(_0x5cbe('0x1'));var Redis=require(_0x5cbe('0x2'));var config=require(_0x5cbe('0x3'));config[_0x5cbe('0x4')]=_[_0x5cbe('0x5')](config['redis'],{'host':_0x5cbe('0x6'),'port':0x18eb});var io=require(_0x5cbe('0x7'))(new Redis(config[_0x5cbe('0x4')]));function WhatsappQueue(_0x1e77ce){this['id']=_0x1e77ce['id']||0x0;this['name']=_0x1e77ce[_0x5cbe('0x8')]||'';this['timeout']=_0x1e77ce[_0x5cbe('0x9')]||0xa;this[_0x5cbe('0xa')]=_0x1e77ce[_0x5cbe('0xa')]||'beepall';this['Agents']=_0x1e77ce[_0x5cbe('0xb')];this[_0x5cbe('0xc')]={};this[_0x5cbe('0xd')]=0x0;this[_0x5cbe('0x0')]='';this['updateRouting']();this[_0x5cbe('0xe')]();}WhatsappQueue['prototype'][_0x5cbe('0xf')]=function(){var _0x16935f=this[_0x5cbe('0xc')][_0x5cbe('0x10')];this[_0x5cbe('0xc')]=_['map'](this['Agents'],'id');this[_0x5cbe('0xc')][_0x5cbe('0x10')]=_0x16935f;};WhatsappQueue[_0x5cbe('0x11')][_0x5cbe('0xe')]=function(){this[_0x5cbe('0x12')]=0x0;this[_0x5cbe('0x13')]=0x0;for(var _0x41b187=0x0;_0x41b187=0x0?this[_0x5cbe('0x17')]:0x0;var _0x381ccc={'id':this['id'],'available':this[_0x5cbe('0x17')],'loggedIn':this[_0x5cbe('0x12')],'name':this[_0x5cbe('0x8')],'paused':this['paused'],'waiting':this[_0x5cbe('0xd')]};var _0x507ddd=md5(JSON[_0x5cbe('0x18')](_0x381ccc));if(this['md5']!==_0x507ddd){this[_0x5cbe('0x0')]=_0x507ddd;io['to'](util[_0x5cbe('0x19')]('whatsapp:queue:%s',_0x381ccc['name']))['emit'](_0x5cbe('0x1a'),_0x381ccc);}};module[_0x5cbe('0x1b')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 1405637..e16320e 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 _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(_0x137c20,_0x48945a){var _0x2630cf=function(_0x261d6b){while(--_0x261d6b){_0x137c20['push'](_0x137c20['shift']());}};_0x2630cf(++_0x48945a);}(_0xb10b,0x12a));var _0xbb10=function(_0x4291a2,_0x2ee2e5){_0x4291a2=_0x4291a2-0x0;var _0x235817=_0xb10b[_0x4291a2];return _0x235817;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 424e046..d3af8c9 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 _0x1c10=['addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','Request','UpdateChatInteraction','updateChatInteraction'];(function(_0x1d0fa7,_0x1ad70f){var _0x5b2d91=function(_0x4ff922){while(--_0x4ff922){_0x1d0fa7['push'](_0x1d0fa7['shift']());}};_0x5b2d91(++_0x1ad70f);}(_0x1c10,0x73));var _0x01c1=function(_0xdbafe4,_0x2a1c7a){_0xdbafe4=_0xdbafe4-0x0;var _0x5e95c1=_0x1c10[_0xdbafe4];return _0x5e95c1;};'use strict';var client=require(_0x01c1('0x0'));exports['update']=function(_0x4d46cc,_0x21be0e){return client[_0x01c1('0x1')](_0x01c1('0x2'),{'body':_0x21be0e,'options':{'where':{'id':_0x4d46cc}},'log':_0x01c1('0x3')});};exports[_0x01c1('0x4')]=function(_0x190e7a,_0x171183){return client[_0x01c1('0x1')](_0x01c1('0x5'),{'body':_0x171183,'options':{'where':{'id':_0x190e7a}},'log':_0x01c1('0x6')});}; \ No newline at end of file +var _0x6c3f=['addTags','addTagsToChatInteraction','update','Request','UpdateChatInteraction'];(function(_0x1a9bdf,_0x43130a){var _0x61a042=function(_0x13fdf5){while(--_0x13fdf5){_0x1a9bdf['push'](_0x1a9bdf['shift']());}};_0x61a042(++_0x43130a);}(_0x6c3f,0x142));var _0xf6c3=function(_0x17cdd2,_0x5255ae){_0x17cdd2=_0x17cdd2-0x0;var _0x4ef5fd=_0x6c3f[_0x17cdd2];return _0x4ef5fd;};'use strict';var client=require('../client');exports[_0xf6c3('0x0')]=function(_0xb347ac,_0x45d531){return client[_0xf6c3('0x1')](_0xf6c3('0x2'),{'body':_0x45d531,'options':{'where':{'id':_0xb347ac}},'log':'updateChatInteraction'});};exports[_0xf6c3('0x3')]=function(_0x54e848,_0x55057f){return client['Request']('AddTagsToChatInteraction',{'body':_0x55057f,'options':{'where':{'id':_0x54e848}},'log':_0xf6c3('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index f68d440..9bbb187 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 _0x46b9=['CreateChatMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x46b9,0xc9));var _0x946b=function(_0x8af1a1,_0x41d558){_0x8af1a1=_0x8af1a1-0x0;var _0x1a17eb=_0x46b9[_0x8af1a1];return _0x1a17eb;};'use strict';var client=require('../client');exports['create']=function(_0x43bdc5){return client['Request'](_0x946b('0x0'),{'body':_0x43bdc5,'log':'createChatMessage'});}; \ No newline at end of file +var _0xe4fe=['createChatMessage','../client','Request','CreateChatMessage'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xe4fe,0x1dd));var _0xee4f=function(_0x33007f,_0x4b38d2){_0x33007f=_0x33007f-0x0;var _0x10d38c=_0xe4fe[_0x33007f];return _0x10d38c;};'use strict';var client=require(_0xee4f('0x0'));exports['create']=function(_0xf5e1aa){return client[_0xee4f('0x1')](_0xee4f('0x2'),{'body':_0xf5e1aa,'log':_0xee4f('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index cceaf00..9a83817 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 _0x919e=['getChatQueues','Request','name','User','Agents','online','chatPause','../client'];(function(_0x5e37f6,_0x508bde){var _0x1a5c73=function(_0xac78e4){while(--_0xac78e4){_0x5e37f6['push'](_0x5e37f6['shift']());}};_0x1a5c73(++_0x508bde);}(_0x919e,0x1d7));var _0xe919=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x919e[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xe919('0x0'));exports[_0xe919('0x1')]=function(){return function(){return client[_0xe919('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0xe919('0x3'),'timeout','strategy'],'include':[{'model':_0xe919('0x4'),'as':_0xe919('0x5'),'attributes':['id',_0xe919('0x3'),_0xe919('0x6'),_0xe919('0x7')]}]},'log':_0xe919('0x1')});};}; \ No newline at end of file +var _0x9491=['Agents','chatPause','../client','getChatQueues','Request','GetChatQueue','name','timeout','strategy','User'];(function(_0x116314,_0x5d0f3a){var _0x19b95c=function(_0x3b6730){while(--_0x3b6730){_0x116314['push'](_0x116314['shift']());}};_0x19b95c(++_0x5d0f3a);}(_0x9491,0xb6));var _0x1949=function(_0x22332d,_0x34a4da){_0x22332d=_0x22332d-0x0;var _0x4cbd3d=_0x9491[_0x22332d];return _0x4cbd3d;};'use strict';var client=require(_0x1949('0x0'));exports[_0x1949('0x1')]=function(){return function(){return client[_0x1949('0x2')](_0x1949('0x3'),{'options':{'raw':![],'attributes':['id',_0x1949('0x4'),_0x1949('0x5'),_0x1949('0x6')],'include':[{'model':_0x1949('0x7'),'as':_0x1949('0x8'),'attributes':['id',_0x1949('0x4'),'online',_0x1949('0x9')]}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 4c36c27..ec6b84f 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 _0x3756=['Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC','../client','create'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0x3756,0x116));var _0x6375=function(_0x4520d2,_0x9dc12){_0x4520d2=_0x4520d2-0x0;var _0x2013b8=_0x3756[_0x4520d2];return _0x2013b8;};'use strict';var client=require(_0x6375('0x0'));exports[_0x6375('0x1')]=function(_0x2cc1ad){return client[_0x6375('0x2')](_0x6375('0x3'),{'body':_0x2cc1ad,'log':_0x6375('0x3')});};exports[_0x6375('0x4')]=function(_0x206284,_0x3f7d9a){return client[_0x6375('0x2')](_0x6375('0x5'),{'body':_0x3f7d9a,'options':{'where':{'uniqueid':_0x206284},'order':[['id',_0x6375('0x6')]],'limit':0x1},'log':_0x6375('0x5')});}; \ No newline at end of file +var _0x5d31=['CreateChatQueueReport','UpdateChatQueueReport','DESC','../client','create'];(function(_0x30250d,_0x2f0ab2){var _0x167084=function(_0x181213){while(--_0x181213){_0x30250d['push'](_0x30250d['shift']());}};_0x167084(++_0x2f0ab2);}(_0x5d31,0xb7));var _0x15d3=function(_0x55f549,_0x4f90ac){_0x55f549=_0x55f549-0x0;var _0x589a78=_0x5d31[_0x55f549];return _0x589a78;};'use strict';var client=require(_0x15d3('0x0'));exports[_0x15d3('0x1')]=function(_0x255280){return client['Request'](_0x15d3('0x2'),{'body':_0x255280,'log':_0x15d3('0x2')});};exports['update']=function(_0x19b9b6,_0x526c77){return client['Request'](_0x15d3('0x3'),{'body':_0x526c77,'options':{'where':{'uniqueid':_0x19b9b6},'order':[['id',_0x15d3('0x4')]],'limit':0x1},'log':_0x15d3('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 80fe4b9..cf3c7ae 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x5550b3,_0x2d0ee0){var _0x4b8fc4=function(_0x22393a){while(--_0x22393a){_0x5550b3['push'](_0x5550b3['shift']());}};_0x4b8fc4(++_0x2d0ee0);}(_0x7a54,0x106));var _0x47a5=function(_0x2da3c1,_0x270b81){_0x2da3c1=_0x2da3c1-0x0;var _0x25fd37=_0x7a54[_0x2da3c1];return _0x25fd37;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x56f7e2,_0x145392){var _0x36240b=function(_0x216ff7){while(--_0x216ff7){_0x56f7e2['push'](_0x56f7e2['shift']());}};_0x36240b(++_0x145392);}(_0x7a54,0x106));var _0x47a5=function(_0x57cf11,_0x27dc53){_0x57cf11=_0x57cf11-0x0;var _0xf66eb7=_0x7a54[_0x57cf11];return _0xf66eb7;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 657b7d8..7b9bf68 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 _0x56d4=['CreateFaxMessage','../client','create','Request'];(function(_0x43116e,_0x32cc41){var _0x95a606=function(_0x552e6a){while(--_0x552e6a){_0x43116e['push'](_0x43116e['shift']());}};_0x95a606(++_0x32cc41);}(_0x56d4,0x1a1));var _0x456d=function(_0x32d78a,_0x5529e3){_0x32d78a=_0x32d78a-0x0;var _0x3b37d0=_0x56d4[_0x32d78a];return _0x3b37d0;};'use strict';var client=require(_0x456d('0x0'));exports[_0x456d('0x1')]=function(_0x4dea36){return client[_0x456d('0x2')](_0x456d('0x3'),{'body':_0x4dea36,'log':'createFaxMessage'});}; \ No newline at end of file +var _0xbfae=['CreateFaxMessage','createFaxMessage','../client','create'];(function(_0x1a007a,_0x5f3509){var _0x1b3ea8=function(_0x26e958){while(--_0x26e958){_0x1a007a['push'](_0x1a007a['shift']());}};_0x1b3ea8(++_0x5f3509);}(_0xbfae,0x1ca));var _0xebfa=function(_0x506db4,_0x4e5bd2){_0x506db4=_0x506db4-0x0;var _0x5aef54=_0xbfae[_0x506db4];return _0x5aef54;};'use strict';var client=require(_0xebfa('0x0'));exports[_0xebfa('0x1')]=function(_0x57078b){return client['Request'](_0xebfa('0x2'),{'body':_0x57078b,'log':_0xebfa('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index c78ff85..80b5452 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 _0xd92b=['timeout','strategy','Agents','name','faxPause','getFaxQueues','Request','GetFaxQueue'];(function(_0x5c2397,_0xf8f068){var _0x589429=function(_0x3f8ae2){while(--_0x3f8ae2){_0x5c2397['push'](_0x5c2397['shift']());}};_0x589429(++_0xf8f068);}(_0xd92b,0x165));var _0xbd92=function(_0x45a27a,_0x4ff9e0){_0x45a27a=_0x45a27a-0x0;var _0x26dc1e=_0xd92b[_0x45a27a];return _0x26dc1e;};'use strict';var client=require('../client');exports[_0xbd92('0x0')]=function(){return function(){return client[_0xbd92('0x1')](_0xbd92('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xbd92('0x3'),_0xbd92('0x4')],'include':[{'model':'User','as':_0xbd92('0x5'),'attributes':['id',_0xbd92('0x6'),'online',_0xbd92('0x7')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0x3f96=['name','strategy','User','online','faxPause','getFaxQueues','../client','Request','GetFaxQueue'];(function(_0x15d18f,_0x126b0e){var _0xd12bf7=function(_0x19e661){while(--_0x19e661){_0x15d18f['push'](_0x15d18f['shift']());}};_0xd12bf7(++_0x126b0e);}(_0x3f96,0x1c8));var _0x63f9=function(_0x59bf88,_0x12c265){_0x59bf88=_0x59bf88-0x0;var _0x258807=_0x3f96[_0x59bf88];return _0x258807;};'use strict';var client=require(_0x63f9('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0x63f9('0x1')](_0x63f9('0x2'),{'options':{'raw':![],'attributes':['id',_0x63f9('0x3'),'timeout',_0x63f9('0x4')],'include':[{'model':_0x63f9('0x5'),'as':'Agents','attributes':['id',_0x63f9('0x3'),_0x63f9('0x6'),_0x63f9('0x7')]}]},'log':_0x63f9('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 12a42a3..7c097e6 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 _0xd817=['UpdateFaxQueueReport','DESC','../client','create','Request','CreateFaxQueueReport'];(function(_0x1790e9,_0x386921){var _0x179951=function(_0x348002){while(--_0x348002){_0x1790e9['push'](_0x1790e9['shift']());}};_0x179951(++_0x386921);}(_0xd817,0x12e));var _0x7d81=function(_0x48d6a3,_0x37c848){_0x48d6a3=_0x48d6a3-0x0;var _0x38bfa0=_0xd817[_0x48d6a3];return _0x38bfa0;};'use strict';var client=require(_0x7d81('0x0'));exports[_0x7d81('0x1')]=function(_0x13c573){return client[_0x7d81('0x2')](_0x7d81('0x3'),{'body':_0x13c573,'log':_0x7d81('0x3')});};exports['update']=function(_0x4d1afb,_0x4ece26){return client[_0x7d81('0x2')](_0x7d81('0x4'),{'body':_0x4ece26,'options':{'where':{'uniqueid':_0x4d1afb},'order':[['id',_0x7d81('0x5')]],'limit':0x1},'log':_0x7d81('0x4')});}; \ No newline at end of file +var _0x9947=['../client','create','Request','CreateFaxQueueReport','UpdateFaxQueueReport'];(function(_0x5a1d58,_0x42ab8d){var _0x5911a9=function(_0x3769a4){while(--_0x3769a4){_0x5a1d58['push'](_0x5a1d58['shift']());}};_0x5911a9(++_0x42ab8d);}(_0x9947,0x1a9));var _0x7994=function(_0x571339,_0x5bcafb){_0x571339=_0x571339-0x0;var _0x5af8a6=_0x9947[_0x571339];return _0x5af8a6;};'use strict';var client=require(_0x7994('0x0'));exports[_0x7994('0x1')]=function(_0x56b157){return client[_0x7994('0x2')]('CreateFaxQueueReport',{'body':_0x56b157,'log':_0x7994('0x3')});};exports['update']=function(_0xf6663e,_0x234a70){return client[_0x7994('0x2')](_0x7994('0x4'),{'body':_0x234a70,'options':{'where':{'uniqueid':_0xf6663e},'order':[['id','DESC']],'limit':0x1},'log':_0x7994('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 4995eae..56eea5d 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 _0x2b3e=['interval','getIntervals','Request','GetInterval','name','Interval','Intervals'];(function(_0x2728e3,_0x21f193){var _0x54edf6=function(_0xee78cb){while(--_0xee78cb){_0x2728e3['push'](_0x2728e3['shift']());}};_0x54edf6(++_0x21f193);}(_0x2b3e,0xb7));var _0xe2b3=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x2b3e[_0x55f8b4];return _0x2475f9;};'use strict';var client=require('../client');exports[_0xe2b3('0x0')]=function(){return function(){return client[_0xe2b3('0x1')](_0xe2b3('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xe2b3('0x3')],'include':[{'model':_0xe2b3('0x4'),'as':_0xe2b3('0x5'),'attributes':['id',_0xe2b3('0x3'),_0xe2b3('0x6')]}]},'log':_0xe2b3('0x0')});};}; \ No newline at end of file +var _0x931f=['../client','GetInterval','name','Interval','Intervals'];(function(_0x15c280,_0x1dbbc9){var _0x59cf4f=function(_0x2e63dc){while(--_0x2e63dc){_0x15c280['push'](_0x15c280['shift']());}};_0x59cf4f(++_0x1dbbc9);}(_0x931f,0x1ae));var _0xf931=function(_0x12ab9c,_0x1ad557){_0x12ab9c=_0x12ab9c-0x0;var _0x2a3e39=_0x931f[_0x12ab9c];return _0x2a3e39;};'use strict';var client=require(_0xf931('0x0'));exports['getIntervals']=function(){return function(){return client['Request'](_0xf931('0x1'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xf931('0x2')],'include':[{'model':_0xf931('0x3'),'as':_0xf931('0x4'),'attributes':['id',_0xf931('0x2'),'interval']}]},'log':'getIntervals'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index ce2e63c..54b6538 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 _0xb03e=['addTagsToChatInteraction','update','Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction'];(function(_0x30810d,_0x445aab){var _0x457edb=function(_0x2362ee){while(--_0x2362ee){_0x30810d['push'](_0x30810d['shift']());}};_0x457edb(++_0x445aab);}(_0xb03e,0x1eb));var _0xeb03=function(_0x4e8df9,_0x4a140d){_0x4e8df9=_0x4e8df9-0x0;var _0x293325=_0xb03e[_0x4e8df9];return _0x293325;};'use strict';var client=require('../client');exports[_0xeb03('0x0')]=function(_0x399504,_0x868905){return client[_0xeb03('0x1')](_0xeb03('0x2'),{'body':_0x868905,'options':{'where':{'id':_0x399504}},'log':_0xeb03('0x3')});};exports[_0xeb03('0x4')]=function(_0x1fe650,_0x474450){return client[_0xeb03('0x1')](_0xeb03('0x5'),{'body':_0x474450,'options':{'where':{'id':_0x1fe650}},'log':_0xeb03('0x6')});}; \ No newline at end of file +var _0x9582=['AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request','UpdateMailInteraction','addTags'];(function(_0x153dcd,_0x2c5435){var _0x15dce4=function(_0x362667){while(--_0x362667){_0x153dcd['push'](_0x153dcd['shift']());}};_0x15dce4(++_0x2c5435);}(_0x9582,0x95));var _0x2958=function(_0x4d3c55,_0x45aab1){_0x4d3c55=_0x4d3c55-0x0;var _0x1943b1=_0x9582[_0x4d3c55];return _0x1943b1;};'use strict';var client=require(_0x2958('0x0'));exports[_0x2958('0x1')]=function(_0xd87e37,_0x3d6d1f){return client[_0x2958('0x2')](_0x2958('0x3'),{'body':_0x3d6d1f,'options':{'where':{'id':_0xd87e37}},'log':'updateMailInteraction'});};exports[_0x2958('0x4')]=function(_0x3b907e,_0x136c77){return client[_0x2958('0x2')](_0x2958('0x5'),{'body':_0x136c77,'options':{'where':{'id':_0x3b907e}},'log':_0x2958('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 50c05ce..d062762 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 _0xaecb=['Request','CreateMailMessage','createMailMessage','../client','create'];(function(_0x20b49b,_0xa111ab){var _0x22b50a=function(_0x21952c){while(--_0x21952c){_0x20b49b['push'](_0x20b49b['shift']());}};_0x22b50a(++_0xa111ab);}(_0xaecb,0x80));var _0xbaec=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xaecb[_0xa464c9];return _0x3d73c4;};'use strict';var client=require(_0xbaec('0x0'));exports[_0xbaec('0x1')]=function(_0x37ff65){return client[_0xbaec('0x2')](_0xbaec('0x3'),{'body':_0x37ff65,'log':_0xbaec('0x4')});}; \ No newline at end of file +var _0x6a37=['Request','CreateMailMessage','createMailMessage','../client','create'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x6a37,0x1d4));var _0x76a3=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x6a37[_0x413feb];return _0x40ee88;};'use strict';var client=require(_0x76a3('0x0'));exports[_0x76a3('0x1')]=function(_0xd6f5a9){return client[_0x76a3('0x2')](_0x76a3('0x3'),{'body':_0xd6f5a9,'log':_0x76a3('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 5fea464..eb54537 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 _0x88f3=['getMailQueues','Request','name','timeout','strategy','User','online','mailPause'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x88f3,0x70));var _0x388f=function(_0x5b9130,_0x164824){_0x5b9130=_0x5b9130-0x0;var _0x2f8ecc=_0x88f3[_0x5b9130];return _0x2f8ecc;};'use strict';var client=require('../client');exports[_0x388f('0x0')]=function(){return function(){return client[_0x388f('0x1')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x388f('0x2'),_0x388f('0x3'),_0x388f('0x4')],'include':[{'model':_0x388f('0x5'),'as':'Agents','attributes':['id','name',_0x388f('0x6'),_0x388f('0x7')]}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0xdc8b=['name','online','mailPause','getMailQueues','Request','GetMailQueue','strategy','User','Agents'];(function(_0x34398,_0x1ab11c){var _0x32f7f6=function(_0x46004f){while(--_0x46004f){_0x34398['push'](_0x34398['shift']());}};_0x32f7f6(++_0x1ab11c);}(_0xdc8b,0xe4));var _0xbdc8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdc8b[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0xbdc8('0x0')]=function(){return function(){return client[_0xbdc8('0x1')](_0xbdc8('0x2'),{'options':{'raw':![],'attributes':['id','name','timeout',_0xbdc8('0x3')],'include':[{'model':_0xbdc8('0x4'),'as':_0xbdc8('0x5'),'attributes':['id',_0xbdc8('0x6'),_0xbdc8('0x7'),_0xbdc8('0x8')]}]},'log':_0xbdc8('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 2f183ae..9925096 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 _0xa572=['update','DESC','UpdateMailQueueReport','create','Request'];(function(_0x1ce2a9,_0x3ac2de){var _0x211fd8=function(_0x4d7640){while(--_0x4d7640){_0x1ce2a9['push'](_0x1ce2a9['shift']());}};_0x211fd8(++_0x3ac2de);}(_0xa572,0x120));var _0x2a57=function(_0x55ef8b,_0x5deb5e){_0x55ef8b=_0x55ef8b-0x0;var _0x359c84=_0xa572[_0x55ef8b];return _0x359c84;};'use strict';var client=require('../client');exports[_0x2a57('0x0')]=function(_0x59a220){return client[_0x2a57('0x1')]('CreateMailQueueReport',{'body':_0x59a220,'log':'CreateMailQueueReport'});};exports[_0x2a57('0x2')]=function(_0x35384e,_0x107457){return client[_0x2a57('0x1')]('UpdateMailQueueReport',{'body':_0x107457,'options':{'where':{'uniqueid':_0x35384e},'order':[['id',_0x2a57('0x3')]],'limit':0x1},'log':_0x2a57('0x4')});}; \ No newline at end of file +var _0x2937=['UpdateMailQueueReport','../client','create','Request','CreateMailQueueReport','update','DESC'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2937,0x1ba));var _0x7293=function(_0xa73646,_0x4bdb64){_0xa73646=_0xa73646-0x0;var _0xd263e5=_0x2937[_0xa73646];return _0xd263e5;};'use strict';var client=require(_0x7293('0x0'));exports[_0x7293('0x1')]=function(_0x168b68){return client[_0x7293('0x2')](_0x7293('0x3'),{'body':_0x168b68,'log':_0x7293('0x3')});};exports[_0x7293('0x4')]=function(_0x494b37,_0x231751){return client[_0x7293('0x2')]('UpdateMailQueueReport',{'body':_0x231751,'options':{'where':{'uniqueid':_0x494b37},'order':[['id',_0x7293('0x5')]],'limit':0x1},'log':_0x7293('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 55f5a4e..3a0321b 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 _0xcc67=['addTags','addTagsToChatInteraction','../client','update','Request'];(function(_0x2dbce7,_0x57cb8d){var _0x3a3ed0=function(_0x28c8c6){while(--_0x28c8c6){_0x2dbce7['push'](_0x2dbce7['shift']());}};_0x3a3ed0(++_0x57cb8d);}(_0xcc67,0x174));var _0x7cc6=function(_0x304295,_0x43d02f){_0x304295=_0x304295-0x0;var _0x16815e=_0xcc67[_0x304295];return _0x16815e;};'use strict';var client=require(_0x7cc6('0x0'));exports[_0x7cc6('0x1')]=function(_0x3fc7e1,_0x4ef54a){return client[_0x7cc6('0x2')]('UpdateOpenchannelInteraction',{'body':_0x4ef54a,'options':{'where':{'id':_0x3fc7e1}},'log':'updateOpenchannelInteraction'});};exports[_0x7cc6('0x3')]=function(_0x140eda,_0x32f0b3){return client['Request']('AddTagsToOpenchannelInteraction',{'body':_0x32f0b3,'options':{'where':{'id':_0x140eda}},'log':_0x7cc6('0x4')});}; \ No newline at end of file +var _0x558f=['AddTagsToOpenchannelInteraction','addTagsToChatInteraction','update','Request','UpdateOpenchannelInteraction','addTags'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x558f,0xa4));var _0xf558=function(_0x598785,_0x148a9e){_0x598785=_0x598785-0x0;var _0x2235ff=_0x558f[_0x598785];return _0x2235ff;};'use strict';var client=require('../client');exports[_0xf558('0x0')]=function(_0x44ff70,_0x422c7){return client[_0xf558('0x1')](_0xf558('0x2'),{'body':_0x422c7,'options':{'where':{'id':_0x44ff70}},'log':'updateOpenchannelInteraction'});};exports[_0xf558('0x3')]=function(_0x3a72e2,_0x430035){return client[_0xf558('0x1')](_0xf558('0x4'),{'body':_0x430035,'options':{'where':{'id':_0x3a72e2}},'log':_0xf558('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 7cfa11c..b592918 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 _0xe41f=['CreateOpenchannelMessage','create','Request'];(function(_0x1eab5a,_0x4a6605){var _0x3508a2=function(_0x22b69c){while(--_0x22b69c){_0x1eab5a['push'](_0x1eab5a['shift']());}};_0x3508a2(++_0x4a6605);}(_0xe41f,0xfa));var _0xfe41=function(_0x21bed6,_0x10b00f){_0x21bed6=_0x21bed6-0x0;var _0xfb1479=_0xe41f[_0x21bed6];return _0xfb1479;};'use strict';var client=require('../client');exports[_0xfe41('0x0')]=function(_0x1d5263){return client[_0xfe41('0x1')](_0xfe41('0x2'),{'body':_0x1d5263,'log':'createOpenchannelMessage'});}; \ No newline at end of file +var _0x0098=['CreateOpenchannelMessage','create','Request'];(function(_0x38812a,_0x28152e){var _0x2d8e2f=function(_0x50ebdd){while(--_0x50ebdd){_0x38812a['push'](_0x38812a['shift']());}};_0x2d8e2f(++_0x28152e);}(_0x0098,0x15a));var _0x8009=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x0098[_0x5d6456];return _0x4d66c1;};'use strict';var client=require('../client');exports[_0x8009('0x0')]=function(_0x5c6dbe){return client[_0x8009('0x1')](_0x8009('0x2'),{'body':_0x5c6dbe,'log':'createOpenchannelMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 6784d4a..d16bfd0 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 _0xfe69=['openchannelPause','getOpenchannelQueues','Request','name','timeout','strategy','User','Agents','online'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xfe69,0x9a));var _0x9fe6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xfe69[_0x14add3];return _0x4a174f;};'use strict';var client=require('../client');exports[_0x9fe6('0x0')]=function(){return function(){return client[_0x9fe6('0x1')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x9fe6('0x2'),_0x9fe6('0x3'),_0x9fe6('0x4')],'include':[{'model':_0x9fe6('0x5'),'as':_0x9fe6('0x6'),'attributes':['id',_0x9fe6('0x2'),_0x9fe6('0x7'),_0x9fe6('0x8')]}]},'log':_0x9fe6('0x0')});};}; \ No newline at end of file +var _0xe6ba=['strategy','User','Agents','name','openchannelPause','getOpenchannelQueues','GetOpenchannelQueue','timeout'];(function(_0x47abfb,_0x16b350){var _0x2b2238=function(_0x2659e0){while(--_0x2659e0){_0x47abfb['push'](_0x47abfb['shift']());}};_0x2b2238(++_0x16b350);}(_0xe6ba,0x1d5));var _0xae6b=function(_0x303feb,_0x91c03e){_0x303feb=_0x303feb-0x0;var _0x5e7ecb=_0xe6ba[_0x303feb];return _0x5e7ecb;};'use strict';var client=require('../client');exports[_0xae6b('0x0')]=function(){return function(){return client['Request'](_0xae6b('0x1'),{'options':{'raw':![],'attributes':['id','name',_0xae6b('0x2'),_0xae6b('0x3')],'include':[{'model':_0xae6b('0x4'),'as':_0xae6b('0x5'),'attributes':['id',_0xae6b('0x6'),'online',_0xae6b('0x7')]}]},'log':_0xae6b('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index b145226..b3d4ed5 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 _0x2116=['DESC','create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport'];(function(_0x290dda,_0x4e7442){var _0x34271e=function(_0xbf6a99){while(--_0xbf6a99){_0x290dda['push'](_0x290dda['shift']());}};_0x34271e(++_0x4e7442);}(_0x2116,0x67));var _0x6211=function(_0x1b321b,_0x461707){_0x1b321b=_0x1b321b-0x0;var _0x2e719c=_0x2116[_0x1b321b];return _0x2e719c;};'use strict';var client=require('../client');exports[_0x6211('0x0')]=function(_0x50692d){return client[_0x6211('0x1')](_0x6211('0x2'),{'body':_0x50692d,'log':_0x6211('0x2')});};exports[_0x6211('0x3')]=function(_0x508e6f,_0x3d23d1){return client[_0x6211('0x1')](_0x6211('0x4'),{'body':_0x3d23d1,'options':{'where':{'uniqueid':_0x508e6f},'order':[['id',_0x6211('0x5')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0x67c8=['../client','create','CreateOpenchannelQueueReport','update','Request','UpdateOpenchannelQueueReport','DESC'];(function(_0x39c7ac,_0x3f214d){var _0x3ee774=function(_0x3bf6e0){while(--_0x3bf6e0){_0x39c7ac['push'](_0x39c7ac['shift']());}};_0x3ee774(++_0x3f214d);}(_0x67c8,0x1c7));var _0x867c=function(_0xb5cd86,_0x40fee3){_0xb5cd86=_0xb5cd86-0x0;var _0xba6ed6=_0x67c8[_0xb5cd86];return _0xba6ed6;};'use strict';var client=require(_0x867c('0x0'));exports[_0x867c('0x1')]=function(_0xc6d4b9){return client['Request'](_0x867c('0x2'),{'body':_0xc6d4b9,'log':_0x867c('0x2')});};exports[_0x867c('0x3')]=function(_0x28bd62,_0x5448ea){return client[_0x867c('0x4')](_0x867c('0x5'),{'body':_0x5448ea,'options':{'where':{'uniqueid':_0x28bd62},'order':[['id',_0x867c('0x6')]],'limit':0x1},'log':_0x867c('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 47e2520..e7f67ac 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 _0xf725=['Request','UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf725,0x7e));var _0x5f72=function(_0x2f559e,_0x536d92){_0x2f559e=_0x2f559e-0x0;var _0x51816e=_0xf725[_0x2f559e];return _0x51816e;};'use strict';var client=require(_0x5f72('0x0'));exports[_0x5f72('0x1')]=function(_0x3fb132,_0x3ccab6){return client[_0x5f72('0x2')](_0x5f72('0x3'),{'body':_0x3ccab6,'options':{'where':{'id':_0x3fb132}},'log':_0x5f72('0x4')});};exports[_0x5f72('0x5')]=function(_0x4200ff,_0x17a5bc){return client['Request'](_0x5f72('0x6'),{'body':_0x17a5bc,'options':{'where':{'id':_0x4200ff}},'log':_0x5f72('0x7')});}; \ No newline at end of file +var _0xa73a=['update','Request','UpdateSmsInteraction','AddTagsToSmsInteraction','addTagsToSmsInteraction'];(function(_0x48cde9,_0x3169f9){var _0x58dc31=function(_0x2c44ad){while(--_0x2c44ad){_0x48cde9['push'](_0x48cde9['shift']());}};_0x58dc31(++_0x3169f9);}(_0xa73a,0x82));var _0xaa73=function(_0x40dd56,_0x726ca5){_0x40dd56=_0x40dd56-0x0;var _0x4f850f=_0xa73a[_0x40dd56];return _0x4f850f;};'use strict';var client=require('../client');exports[_0xaa73('0x0')]=function(_0x3d8fed,_0x230542){return client[_0xaa73('0x1')](_0xaa73('0x2'),{'body':_0x230542,'options':{'where':{'id':_0x3d8fed}},'log':'updateSmsInteraction'});};exports['addTags']=function(_0x512616,_0x35025d){return client[_0xaa73('0x1')](_0xaa73('0x3'),{'body':_0x35025d,'options':{'where':{'id':_0x512616}},'log':_0xaa73('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 75a0f89..9bf1fe7 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 _0xd301=['CreateSmsMessage','../client','create'];(function(_0x380605,_0x15bd61){var _0x1a32d7=function(_0x18b4e7){while(--_0x18b4e7){_0x380605['push'](_0x380605['shift']());}};_0x1a32d7(++_0x15bd61);}(_0xd301,0x10f));var _0x1d30=function(_0x8d5813,_0x3a8fdb){_0x8d5813=_0x8d5813-0x0;var _0x3817fb=_0xd301[_0x8d5813];return _0x3817fb;};'use strict';var client=require(_0x1d30('0x0'));exports[_0x1d30('0x1')]=function(_0x25b854){return client['Request'](_0x1d30('0x2'),{'body':_0x25b854,'log':'createSmsMessage'});}; \ No newline at end of file +var _0xf21c=['createSmsMessage','../client','create'];(function(_0x2d5fe0,_0x16b806){var _0x92a5a6=function(_0x24b801){while(--_0x24b801){_0x2d5fe0['push'](_0x2d5fe0['shift']());}};_0x92a5a6(++_0x16b806);}(_0xf21c,0x97));var _0xcf21=function(_0x256823,_0x2392df){_0x256823=_0x256823-0x0;var _0x5db66b=_0xf21c[_0x256823];return _0x5db66b;};'use strict';var client=require(_0xcf21('0x0'));exports[_0xcf21('0x1')]=function(_0x5bd81b){return client['Request']('CreateSmsMessage',{'body':_0x5bd81b,'log':_0xcf21('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index bcf5d07..9a5ab51 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(_0x1bfca8,_0x457ecd){var _0x39dde2=function(_0x2c713a){while(--_0x2c713a){_0x1bfca8['push'](_0x1bfca8['shift']());}};_0x39dde2(++_0x457ecd);}(_0xe706,0xa3));var _0x6e70=function(_0x33ac6b,_0x1ed895){_0x33ac6b=_0x33ac6b-0x0;var _0x34cffe=_0xe706[_0x33ac6b];return _0x34cffe;};'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 _0xcb91=['smsPause','Request','GetSmsQueue','name','timeout','User','Agents','online'];(function(_0x388eca,_0xce0525){var _0x4a3597=function(_0xd5b29d){while(--_0xd5b29d){_0x388eca['push'](_0x388eca['shift']());}};_0x4a3597(++_0xce0525);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3ff685,_0x304b9e){_0x3ff685=_0x3ff685-0x0;var _0x2046c9=_0xcb91[_0x3ff685];return _0x2046c9;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'attributes':['id',_0x1cb9('0x2'),_0x1cb9('0x3'),'strategy'],'include':[{'model':_0x1cb9('0x4'),'as':_0x1cb9('0x5'),'attributes':['id','name',_0x1cb9('0x6'),_0x1cb9('0x7')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 5531f2b..3c1b70f 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 _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x2007e6,_0x43b204){var _0x31a410=function(_0x3a0186){while(--_0x3a0186){_0x2007e6['push'](_0x2007e6['shift']());}};_0x31a410(++_0x43b204);}(_0x008c,0x188));var _0xc008=function(_0x11acac,_0x37d55f){_0x11acac=_0x11acac-0x0;var _0x1daa7e=_0x008c[_0x11acac];return _0x1daa7e;};'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 +var _0x3e74=['CreateSmsQueueReport','UpdateSmsQueueReport','DESC','../client','Request'];(function(_0x45890f,_0x3cd244){var _0x563d75=function(_0x4c9587){while(--_0x4c9587){_0x45890f['push'](_0x45890f['shift']());}};_0x563d75(++_0x3cd244);}(_0x3e74,0x175));var _0x43e7=function(_0x216b09,_0x53f0f2){_0x216b09=_0x216b09-0x0;var _0x2c7820=_0x3e74[_0x216b09];return _0x2c7820;};'use strict';var client=require(_0x43e7('0x0'));exports['create']=function(_0x349480){return client[_0x43e7('0x1')](_0x43e7('0x2'),{'body':_0x349480,'log':'CreateSmsQueueReport'});};exports['update']=function(_0xc58479,_0x4f9bbe){return client[_0x43e7('0x1')](_0x43e7('0x3'),{'body':_0x4f9bbe,'options':{'where':{'uniqueid':_0xc58479},'order':[['id',_0x43e7('0x4')]],'limit':0x1},'log':_0x43e7('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 55ef783..9ecb85f 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(_0x39efd3,_0x23211f){var _0x27588c=function(_0x2c3114){while(--_0x2c3114){_0x39efd3['push'](_0x39efd3['shift']());}};_0x27588c(++_0x23211f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'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(_0x2b618e,_0x2dd4f0){var _0x1b7f9f=function(_0x7144b9){while(--_0x7144b9){_0x2b618e['push'](_0x2b618e['shift']());}};_0x1b7f9f(++_0x2dd4f0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'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 241f379..d8c8f0d 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 _0xdf98=['addTags','Request','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x3d34b9,_0x17040d){var _0x39faa9=function(_0x2789cc){while(--_0x2789cc){_0x3d34b9['push'](_0x3d34b9['shift']());}};_0x39faa9(++_0x17040d);}(_0xdf98,0xcf));var _0x8df9=function(_0x3c9a89,_0x378778){_0x3c9a89=_0x3c9a89-0x0;var _0x1eb47b=_0xdf98[_0x3c9a89];return _0x1eb47b;};'use strict';var client=require(_0x8df9('0x0'));exports['update']=function(_0x1f9abd,_0x4bbb45){return client['Request'](_0x8df9('0x1'),{'body':_0x4bbb45,'options':{'where':{'id':_0x1f9abd}},'log':_0x8df9('0x2')});};exports[_0x8df9('0x3')]=function(_0xeec2ab,_0x3f2ade){return client[_0x8df9('0x4')](_0x8df9('0x5'),{'body':_0x3f2ade,'options':{'where':{'id':_0xeec2ab}},'log':_0x8df9('0x6')});}; \ No newline at end of file +var _0xf494=['Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update'];(function(_0x4daf3a,_0x19a478){var _0x4c0e7d=function(_0x2ce507){while(--_0x2ce507){_0x4daf3a['push'](_0x4daf3a['shift']());}};_0x4c0e7d(++_0x19a478);}(_0xf494,0x1c6));var _0x4f49=function(_0x1e2c37,_0x4dd529){_0x1e2c37=_0x1e2c37-0x0;var _0x3c6756=_0xf494[_0x1e2c37];return _0x3c6756;};'use strict';var client=require(_0x4f49('0x0'));exports[_0x4f49('0x1')]=function(_0x3063f3,_0x52d22c){return client[_0x4f49('0x2')](_0x4f49('0x3'),{'body':_0x52d22c,'options':{'where':{'id':_0x3063f3}},'log':_0x4f49('0x4')});};exports[_0x4f49('0x5')]=function(_0x20c0d7,_0x2a15fb){return client[_0x4f49('0x2')](_0x4f49('0x6'),{'body':_0x2a15fb,'options':{'where':{'id':_0x20c0d7}},'log':_0x4f49('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index d722feb..6e4c5be 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 _0xe9ef=['../client','create','CreateWhatsappMessage','createWhatsappMessage'];(function(_0x1635bc,_0x267448){var _0x562f91=function(_0x320c54){while(--_0x320c54){_0x1635bc['push'](_0x1635bc['shift']());}};_0x562f91(++_0x267448);}(_0xe9ef,0x1f0));var _0xfe9e=function(_0x2b31a8,_0x28b862){_0x2b31a8=_0x2b31a8-0x0;var _0x1175a5=_0xe9ef[_0x2b31a8];return _0x1175a5;};'use strict';var client=require(_0xfe9e('0x0'));exports[_0xfe9e('0x1')]=function(_0x2d1566){return client['Request'](_0xfe9e('0x2'),{'body':_0x2d1566,'log':_0xfe9e('0x3')});}; \ No newline at end of file +var _0x1aff=['create','CreateWhatsappMessage','createWhatsappMessage'];(function(_0x22342c,_0x218835){var _0xd3b434=function(_0x45b259){while(--_0x45b259){_0x22342c['push'](_0x22342c['shift']());}};_0xd3b434(++_0x218835);}(_0x1aff,0xcf));var _0xf1af=function(_0x203d69,_0x28d359){_0x203d69=_0x203d69-0x0;var _0x5e38de=_0x1aff[_0x203d69];return _0x5e38de;};'use strict';var client=require('../client');exports[_0xf1af('0x0')]=function(_0x412df3){return client['Request'](_0xf1af('0x1'),{'body':_0x412df3,'log':_0xf1af('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 1e73e16..0ada187 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 _0x8ed2=['online','whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue','name','strategy'];(function(_0x1d70db,_0x142b63){var _0x3060c6=function(_0x347866){while(--_0x347866){_0x1d70db['push'](_0x1d70db['shift']());}};_0x3060c6(++_0x142b63);}(_0x8ed2,0x122));var _0x28ed=function(_0x28c366,_0x357417){_0x28c366=_0x28c366-0x0;var _0x4413ba=_0x8ed2[_0x28c366];return _0x4413ba;};'use strict';var client=require(_0x28ed('0x0'));exports[_0x28ed('0x1')]=function(){return function(){return client[_0x28ed('0x2')](_0x28ed('0x3'),{'options':{'raw':![],'attributes':['id',_0x28ed('0x4'),'timeout',_0x28ed('0x5')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x28ed('0x4'),_0x28ed('0x6'),_0x28ed('0x7')]}]},'log':_0x28ed('0x1')});};}; \ No newline at end of file +var _0x562c=['whatsappPause','getWhatsappQueues','GetWhatsappQueue','name','timeout','strategy','Agents','online'];(function(_0x452ab3,_0x4d066f){var _0x251abe=function(_0x21ae0a){while(--_0x21ae0a){_0x452ab3['push'](_0x452ab3['shift']());}};_0x251abe(++_0x4d066f);}(_0x562c,0x121));var _0xc562=function(_0x3ba26e,_0x249c27){_0x3ba26e=_0x3ba26e-0x0;var _0x316468=_0x562c[_0x3ba26e];return _0x316468;};'use strict';var client=require('../client');exports[_0xc562('0x0')]=function(){return function(){return client['Request'](_0xc562('0x1'),{'options':{'raw':![],'attributes':['id',_0xc562('0x2'),_0xc562('0x3'),_0xc562('0x4')],'include':[{'model':'User','as':_0xc562('0x5'),'attributes':['id','name',_0xc562('0x6'),_0xc562('0x7')]}]},'log':_0xc562('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index e22c7de..340b264 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 _0xe166=['DESC','create','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport'];(function(_0x14761d,_0x204fcc){var _0x8f69ee=function(_0x1fd266){while(--_0x1fd266){_0x14761d['push'](_0x14761d['shift']());}};_0x8f69ee(++_0x204fcc);}(_0xe166,0xc1));var _0x6e16=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xe166[_0x4154a6];return _0x3b2786;};'use strict';var client=require('../client');exports[_0x6e16('0x0')]=function(_0x1d6080){return client[_0x6e16('0x1')](_0x6e16('0x2'),{'body':_0x1d6080,'log':'CreateWhatsappQueueReport'});};exports[_0x6e16('0x3')]=function(_0x2333b7,_0x8040bc){return client[_0x6e16('0x1')](_0x6e16('0x4'),{'body':_0x8040bc,'options':{'where':{'uniqueid':_0x2333b7},'order':[['id',_0x6e16('0x5')]],'limit':0x1},'log':_0x6e16('0x4')});}; \ No newline at end of file +var _0x2d22=['Request','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','DESC','../client','create'];(function(_0x23c698,_0xd1b961){var _0x2df0fc=function(_0x26a823){while(--_0x26a823){_0x23c698['push'](_0x23c698['shift']());}};_0x2df0fc(++_0xd1b961);}(_0x2d22,0x1d2));var _0x22d2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2d22[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x22d2('0x0'));exports[_0x22d2('0x1')]=function(_0x5c1c2e){return client[_0x22d2('0x2')](_0x22d2('0x3'),{'body':_0x5c1c2e,'log':_0x22d2('0x3')});};exports['update']=function(_0xab3d,_0x557696){return client[_0x22d2('0x2')](_0x22d2('0x4'),{'body':_0x557696,'options':{'where':{'uniqueid':_0xab3d},'order':[['id',_0x22d2('0x5')]],'limit':0x1},'log':_0x22d2('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 7e19310..ff8d9f6 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 _0xec14=['timeout','createQueue','channel','format','START:%s','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','stop','complete','[%s][AGENT]\x20ROUTING\x20END','next','[%s][AGENT]\x20agent\x20not\x20found\x20%s','name','log','stack','lodash','util','seq-queue','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','toLowerCase','error','map','message','join'];(function(_0x55e1d1,_0x3c9376){var _0x1165db=function(_0x5b0120){while(--_0x5b0120){_0x55e1d1['push'](_0x55e1d1['shift']());}};_0x1165db(++_0x3c9376);}(_0xec14,0x131));var _0x4ec1=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0xec14[_0x5317b5];return _0x3b7ce2;};'use strict';var schema=require('validate');var _=require(_0x4ec1('0x0'));var util=require(_0x4ec1('0x1'));var seqqueue=require(_0x4ec1('0x2'));var logger=require('../../../../config/logger')(_0x4ec1('0x3'));var strategy=require(_0x4ec1('0x4'));var queue=schema({'name':{'type':_0x4ec1('0x5'),'required':!![],'message':_0x4ec1('0x6')},'timeout':{'type':_0x4ec1('0x7'),'message':_0x4ec1('0x8')}});function writeLog(_0x136a9c,_0x1f8173,_0x5089b2){return logger[_0x4ec1('0x9')](util['format']('[%s][AGENT][NAME:%s][STATUS:%s]',_0x136a9c,_0x1f8173['name'],_0x5089b2));}function handleFindAgent(_0x310aa1){return function(_0x5e8a3b){return _0x5e8a3b['name']['toLowerCase']()===_0x310aa1[_0x4ec1('0xa')]();};}exports['consequence']=function(_0x205bb5,_0x543efa,_0x261d41,_0x395ddc){return function(_0x175a2a){try{var _0x57e63e={'name':_0x543efa[0x0],'timeout':_0x543efa[0x1]};var _0xf06a45=queue['validate'](_0x57e63e,{'typecast':!![]});if(_0xf06a45['length']){logger[_0x4ec1('0xb')]('[%s][AGENT]\x20%s',_0x205bb5,_[_0x4ec1('0xc')](_0xf06a45,_0x4ec1('0xd'))[_0x4ec1('0xe')](',\x20'));_0x175a2a['stop']();}else{var _0xbfa63a=_['find'](_0x261d41['agents'],handleFindAgent(_0x57e63e['name']));if(_0xbfa63a){var _0x19390c=(_0x57e63e[_0x4ec1('0xf')]||0xa)*0x3e8;var _0x53fd3e,_0x19431e;var _0x3c0bc6=seqqueue[_0x4ec1('0x10')](_0x19390c);_0x3c0bc6['id']=_0x205bb5;_0x3c0bc6['atimeout']=_0x19390c;_0x3c0bc6['channel']=_0x395ddc[_0x4ec1('0x11')];writeLog(_0x205bb5,_0xbfa63a,util[_0x4ec1('0x12')](_0x4ec1('0x13'),_0x19390c));_0x261d41['rules'][_0x205bb5]['on'](_0x4ec1('0x14'),function(){logger['info'](_0x4ec1('0x15'),_0x205bb5);clearTimeout(_0x19431e);_0x19431e=undefined;_0x3c0bc6[_0x4ec1('0x16')]();if(_0x261d41[_0x4ec1('0x17')][_0x205bb5]){delete _0x261d41['rules'][_0x205bb5];}_0x175a2a[_0x4ec1('0x18')]();});_0x261d41[_0x4ec1('0x17')][_0x205bb5]['on'](_0x4ec1('0x19'),function(){if(_0x261d41[_0x4ec1('0x17')][_0x205bb5]){delete _0x261d41['rules'][_0x205bb5];}});_0x19431e=setTimeout(function(){logger[_0x4ec1('0x9')](_0x4ec1('0x1a'),_0x205bb5);clearTimeout(_0x19431e);_0x3c0bc6['close']();_0x175a2a[_0x4ec1('0x1b')]();},_0x19390c);strategy['agent'](_0x3c0bc6,_0xbfa63a,_0x261d41,_0x395ddc);}else{logger['error'](_0x4ec1('0x1c'),_0x205bb5,_0x57e63e[_0x4ec1('0x1d')]);_0x175a2a[_0x4ec1('0x18')]();}}}catch(_0x15ef3a){console[_0x4ec1('0x1e')](_0x15ef3a);logger[_0x4ec1('0xb')]('[%s][QUEUE]\x20%s',_0x205bb5,_0x15ef3a[_0x4ec1('0x1f')]);_0x175a2a[_0x4ec1('0x18')]();}};}; \ No newline at end of file +var _0xf8cc=['complete','close','next','agent','error','log','[%s][QUEUE]\x20%s','stop','validate','lodash','util','seq-queue','../../../../config/logger','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','map','message','join','agents','timeout','createQueue','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED'];(function(_0x2c4527,_0x4d97d9){var _0x1eb0f0=function(_0x368323){while(--_0x368323){_0x2c4527['push'](_0x2c4527['shift']());}};_0x1eb0f0(++_0x4d97d9);}(_0xf8cc,0x189));var _0xcf8c=function(_0x5995f1,_0x5d8e95){_0x5995f1=_0x5995f1-0x0;var _0x47fc18=_0xf8cc[_0x5995f1];return _0x47fc18;};'use strict';var schema=require(_0xcf8c('0x0'));var _=require(_0xcf8c('0x1'));var util=require(_0xcf8c('0x2'));var seqqueue=require(_0xcf8c('0x3'));var logger=require(_0xcf8c('0x4'))('routing');var strategy=require('./strategy');var queue=schema({'name':{'type':_0xcf8c('0x5'),'required':!![],'message':_0xcf8c('0x6')},'timeout':{'type':_0xcf8c('0x7'),'message':_0xcf8c('0x8')}});function writeLog(_0x5149da,_0x45951a,_0x594991){return logger[_0xcf8c('0x9')](util[_0xcf8c('0xa')](_0xcf8c('0xb'),_0x5149da,_0x45951a[_0xcf8c('0xc')],_0x594991));}function handleFindAgent(_0x48545f){return function(_0x4c5f13){return _0x4c5f13[_0xcf8c('0xc')][_0xcf8c('0xd')]()===_0x48545f[_0xcf8c('0xd')]();};}exports[_0xcf8c('0xe')]=function(_0x56bb4e,_0x3b1744,_0x4c5257,_0xc74de2){return function(_0x57bf4f){try{var _0x20b250={'name':_0x3b1744[0x0],'timeout':_0x3b1744[0x1]};var _0x42b236=queue['validate'](_0x20b250,{'typecast':!![]});if(_0x42b236[_0xcf8c('0xf')]){logger['error']('[%s][AGENT]\x20%s',_0x56bb4e,_[_0xcf8c('0x10')](_0x42b236,_0xcf8c('0x11'))[_0xcf8c('0x12')](',\x20'));_0x57bf4f['stop']();}else{var _0x2b34c2=_['find'](_0x4c5257[_0xcf8c('0x13')],handleFindAgent(_0x20b250[_0xcf8c('0xc')]));if(_0x2b34c2){var _0x39c2c9=(_0x20b250[_0xcf8c('0x14')]||0xa)*0x3e8;var _0x25141b,_0x31e402;var _0x52d989=seqqueue[_0xcf8c('0x15')](_0x39c2c9);_0x52d989['id']=_0x56bb4e;_0x52d989['atimeout']=_0x39c2c9;_0x52d989[_0xcf8c('0x16')]=_0xc74de2['channel'];writeLog(_0x56bb4e,_0x2b34c2,util[_0xcf8c('0xa')](_0xcf8c('0x17'),_0x39c2c9));_0x4c5257[_0xcf8c('0x18')][_0x56bb4e]['on'](_0xcf8c('0x19'),function(){logger[_0xcf8c('0x9')](_0xcf8c('0x1a'),_0x56bb4e);clearTimeout(_0x31e402);_0x31e402=undefined;_0x52d989['close']();if(_0x4c5257[_0xcf8c('0x18')][_0x56bb4e]){delete _0x4c5257[_0xcf8c('0x18')][_0x56bb4e];}_0x57bf4f['stop']();});_0x4c5257['rules'][_0x56bb4e]['on'](_0xcf8c('0x1b'),function(){if(_0x4c5257[_0xcf8c('0x18')][_0x56bb4e]){delete _0x4c5257[_0xcf8c('0x18')][_0x56bb4e];}});_0x31e402=setTimeout(function(){logger['info']('[%s][AGENT]\x20ROUTING\x20END',_0x56bb4e);clearTimeout(_0x31e402);_0x52d989[_0xcf8c('0x1c')]();_0x57bf4f[_0xcf8c('0x1d')]();},_0x39c2c9);strategy[_0xcf8c('0x1e')](_0x52d989,_0x2b34c2,_0x4c5257,_0xc74de2);}else{logger[_0xcf8c('0x1f')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x56bb4e,_0x20b250[_0xcf8c('0xc')]);_0x57bf4f['stop']();}}}catch(_0x3cb6ca){console[_0xcf8c('0x20')](_0x3cb6ca);logger[_0xcf8c('0x1f')](_0xcf8c('0x21'),_0x56bb4e,_0x3cb6ca['stack']);_0x57bf4f[_0xcf8c('0x22')]();}};}; \ 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 33b64a3..ccada56 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 _0x311a=['created','isEmpty','body','Message','create','then','[%s][AMAZONLEX]\x20%s','catch','error','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','LexRuntime','$LATEST','message','next','amazonlex','providerName','dialogState','Failed','stop','lodash','./utils','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','format','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','InteractionId'];(function(_0x22b8ae,_0x228449){var _0x5bbf21=function(_0xe3ff26){while(--_0xe3ff26){_0x22b8ae['push'](_0x22b8ae['shift']());}};_0x5bbf21(++_0x228449);}(_0x311a,0x116));var _0xa311=function(_0x1973cd,_0x21d1b3){_0x1973cd=_0x1973cd-0x0;var _0x38f926=_0x311a[_0x1973cd];return _0x38f926;};'use strict';var _=require(_0xa311('0x0'));var moment=require('moment');var AWS=require('aws-sdk');var utils=require(_0xa311('0x1'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0xa311('0x2')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xa311('0x3')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xa311('0x4')),'whatsappMessage':require(_0xa311('0x5'))};exports[_0xa311('0x6')]=function(_0x4ed2e9,_0x1b3a13){return function(_0x3ed02e){try{if(!_[_0xa311('0x7')](this[_0xa311('0x8')][_0xa311('0x9')])){logger[_0xa311('0xa')]('[%s][AMAZONLEX]\x20%s',_0x4ed2e9,_0xa311('0xb'));return _0x3ed02e['next']();}var _0x54de38={'ContactId':this['contact']['id'],'sentAt':moment()[_0xa311('0xc')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xa311('0xd')};if(this[_0xa311('0xe')]===_0xa311('0xf')||this['channel']===_0xa311('0x10')){_0x54de38['phone']=this[_0xa311('0x8')][_0xa311('0x11')];}var _0x39d975=this[_0xa311('0xe')];if(_0x39d975===_0xa311('0x12')){_0x54de38[_0xa311('0x13')]=this[_0xa311('0x14')]['id'];}else{_0x54de38[_[_0xa311('0x15')](_0x39d975)+'AccountId']=this[_0xa311('0x14')]['id'];}_0x54de38[_[_0xa311('0x15')](_0x39d975)+_0xa311('0x16')]=this[_0xa311('0x8')]['id'];if(this[_0xa311('0x8')][_0xa311('0x17')]){var _0x2ef297=_0x1b3a13[0x4];if(!_[_0xa311('0x18')](_0x2ef297)){_0x54de38[_0xa311('0x19')]=utils['getMustacheRender'](_0x2ef297,this);return rpc[_0x39d975+_0xa311('0x1a')][_0xa311('0x1b')](_0x54de38)[_0xa311('0x1c')](function(_0x377d1e){logger[_0xa311('0xa')](_0xa311('0x1d'),_0x4ed2e9,_0x54de38[_0xa311('0x19')]);})[_0xa311('0x1e')](function(_0xc6469a){logger[_0xa311('0x1f')]('[%s][AMAZONLEX]\x20%s',_0x4ed2e9,JSON[_0xa311('0x20')](_0xc6469a));})['finally'](function(){logger[_0xa311('0xa')](_0xa311('0x21'),_0x4ed2e9);_0x3ed02e['stop']();});}else{logger[_0xa311('0xa')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x4ed2e9);_0x3ed02e['stop']();}}else{var _0x4ca735=this;var _0x5e7249=new AWS[(_0xa311('0x22'))]({'accessKeyId':_0x1b3a13[0x0],'secretAccessKey':_0x1b3a13[0x1],'region':_0x1b3a13[0x2]});var _0x141a94={'botAlias':_0xa311('0x23'),'botName':_0x1b3a13[0x3],'inputText':this[_0xa311('0x24')][_0xa311('0x19')],'userId':this[_0xa311('0xe')]+':'+this[_0xa311('0x8')]['id']['toString']()};_0x5e7249['postText'](_0x141a94,function(_0x4601c4,_0x22b145){if(_0x4601c4){logger['error'](_0xa311('0x1d'),_0x4ed2e9,_0x4601c4[_0xa311('0x24')]);_0x3ed02e[_0xa311('0x25')]();}else if(_0x22b145&&_0x22b145['message']){_0x4ca735[_0xa311('0x19')][_0xa311('0x26')]=_0x22b145;_0x54de38[_0xa311('0x19')]=_0x22b145[_0xa311('0x24')];_0x54de38[_0xa311('0x27')]=_0xa311('0x26');_0x54de38['providerResponse']=JSON[_0xa311('0x20')](_0x22b145);return rpc[_0x39d975+'Message'][_0xa311('0x1b')](_0x54de38)['then'](function(_0x39e9ce){logger[_0xa311('0xa')](_0xa311('0x1d'),_0x4ed2e9,_0x54de38[_0xa311('0x19')]);if(_0x22b145[_0xa311('0x28')]==_0xa311('0x29')){_0x3ed02e[_0xa311('0x25')]();}else{_0x3ed02e[_0xa311('0x2a')]();}})['catch'](function(_0x5b16fb){logger['error'](_0xa311('0x1d'),_0x4ed2e9,JSON[_0xa311('0x20')](_0x5b16fb));_0x3ed02e[_0xa311('0x25')]();});}else{_0x3ed02e[_0xa311('0x25')]();}});}}catch(_0x22f13d){logger[_0xa311('0x1f')]('[%s][AMAZONLEX]\x20%s',_0x4ed2e9,JSON[_0xa311('0x20')](_0x22f13d));_0x3ed02e[_0xa311('0x2a')]();}};}; \ No newline at end of file +var _0x577b=['stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','channel','toString','postText','amazonlex','providerName','providerResponse','stringify','Message','create','dialogState','Failed','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','out','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','then','error','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!'];(function(_0x927198,_0x42549a){var _0x30a1d1=function(_0x27f563){while(--_0x27f563){_0x927198['push'](_0x927198['shift']());}};_0x30a1d1(++_0x42549a);}(_0x577b,0x142));var _0xb577=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0x577b[_0xe66cf2];return _0x2d84e7;};'use strict';var _=require(_0xb577('0x0'));var moment=require(_0xb577('0x1'));var AWS=require(_0xb577('0x2'));var utils=require(_0xb577('0x3'));var logger=require(_0xb577('0x4'))(_0xb577('0x5'));var rpc={'chatMessage':require(_0xb577('0x6')),'openchannelMessage':require(_0xb577('0x7')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xb577('0x8')),'whatsappMessage':require(_0xb577('0x9'))};exports['consequence']=function(_0x44d9ce,_0x5431d1){return function(_0x3153c1){try{if(!_[_0xb577('0xa')](this[_0xb577('0xb')][_0xb577('0xc')])){logger[_0xb577('0xd')](_0xb577('0xe'),_0x44d9ce,_0xb577('0xf'));return _0x3153c1[_0xb577('0x10')]();}var _0x2fc048={'ContactId':this['contact']['id'],'sentAt':moment()[_0xb577('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xb577('0x12')};if(this['channel']===_0xb577('0x13')||this['channel']===_0xb577('0x14')){_0x2fc048[_0xb577('0x15')]=this[_0xb577('0xb')]['phone'];}var _0x2db366=this['channel'];if(_0x2db366===_0xb577('0x16')){_0x2fc048[_0xb577('0x17')]=this[_0xb577('0x18')]['id'];}else{_0x2fc048[_[_0xb577('0x19')](_0x2db366)+_0xb577('0x1a')]=this[_0xb577('0x18')]['id'];}_0x2fc048[_[_0xb577('0x19')](_0x2db366)+_0xb577('0x1b')]=this[_0xb577('0xb')]['id'];if(this[_0xb577('0xb')][_0xb577('0x1c')]){var _0x5168e8=_0x5431d1[0x4];if(!_[_0xb577('0x1d')](_0x5168e8)){_0x2fc048[_0xb577('0x1e')]=utils[_0xb577('0x1f')](_0x5168e8,this);return rpc[_0x2db366+'Message']['create'](_0x2fc048)[_0xb577('0x20')](function(_0x218897){logger['info']('[%s][AMAZONLEX]\x20%s',_0x44d9ce,_0x2fc048[_0xb577('0x1e')]);})['catch'](function(_0x454215){logger[_0xb577('0x21')](_0xb577('0xe'),_0x44d9ce,JSON['stringify'](_0x454215));})['finally'](function(){logger[_0xb577('0xd')](_0xb577('0x22'),_0x44d9ce);_0x3153c1[_0xb577('0x23')]();});}else{logger[_0xb577('0xd')](_0xb577('0x24'),_0x44d9ce);_0x3153c1[_0xb577('0x23')]();}}else{var _0x44d6d0=this;var _0x1b81a1=new AWS[(_0xb577('0x25'))]({'accessKeyId':_0x5431d1[0x0],'secretAccessKey':_0x5431d1[0x1],'region':_0x5431d1[0x2]});var _0x58c40a={'botAlias':_0xb577('0x26'),'botName':_0x5431d1[0x3],'inputText':this[_0xb577('0x27')][_0xb577('0x1e')],'userId':this[_0xb577('0x28')]+':'+this[_0xb577('0xb')]['id'][_0xb577('0x29')]()};_0x1b81a1[_0xb577('0x2a')](_0x58c40a,function(_0x52a686,_0x884536){if(_0x52a686){logger['error'](_0xb577('0xe'),_0x44d9ce,_0x52a686[_0xb577('0x27')]);_0x3153c1['next']();}else if(_0x884536&&_0x884536[_0xb577('0x27')]){_0x44d6d0[_0xb577('0x1e')][_0xb577('0x2b')]=_0x884536;_0x2fc048['body']=_0x884536[_0xb577('0x27')];_0x2fc048[_0xb577('0x2c')]='amazonlex';_0x2fc048[_0xb577('0x2d')]=JSON[_0xb577('0x2e')](_0x884536);return rpc[_0x2db366+_0xb577('0x2f')][_0xb577('0x30')](_0x2fc048)['then'](function(_0x5c2234){logger[_0xb577('0xd')](_0xb577('0xe'),_0x44d9ce,_0x2fc048[_0xb577('0x1e')]);if(_0x884536[_0xb577('0x31')]==_0xb577('0x32')){_0x3153c1[_0xb577('0x10')]();}else{_0x3153c1[_0xb577('0x23')]();}})['catch'](function(_0x36b9f8){logger[_0xb577('0x21')]('[%s][AMAZONLEX]\x20%s',_0x44d9ce,JSON[_0xb577('0x2e')](_0x36b9f8));_0x3153c1[_0xb577('0x10')]();});}else{_0x3153c1['next']();}});}}catch(_0x5d5a67){logger['error'](_0xb577('0xe'),_0x44d9ce,JSON[_0xb577('0x2e')](_0x5d5a67));_0x3153c1[_0xb577('0x23')]();}};}; \ 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 e2628e4..bb5be19 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 _0x403c=['../../mailRpc','channel','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','mail','getMustacheRender','message','from','phone','read','subject','startsWith','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','inReplyTo','messageId','html','','replace','','headers','auto-replied','All','auto_reply','then','stringify','finally','resolve','update','catch','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','create','error','Interaction','stop','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x403c,0xc2));var _0xc403=function(_0xabd469,_0x34a19c){_0xabd469=_0xabd469-0x0;var _0x121030=_0x403c[_0xabd469];return _0x121030;};'use strict';var _=require('lodash');var moment=require('moment');var utils=require('./utils');var logger=require(_0xc403('0x0'))(_0xc403('0x1'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xc403('0x2')),'mailMessage':require(_0xc403('0x3')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xc403('0x4')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0xc403('0x5')),'openchannelInteraction':require(_0xc403('0x6')),'mailInteraction':require(_0xc403('0x7')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0xc403('0x8')),'whatsappInteraction':require(_0xc403('0x9'))};var mailRpc=require(_0xc403('0xa'));exports['consequence']=function(_0x3dd6c1,_0x1a4a05,_0x179b4c,_0xcdc4fe){return function(_0x1970c0){try{var _0xf721d4=this[_0xc403('0xb')];if(_0xf721d4==='mail'&&_0xcdc4fe[_0xc403('0xc')][_0xc403('0xd')]){logger[_0xc403('0xe')](_0xc403('0xf'),_0x3dd6c1,_0xc403('0x10'));return _0x1970c0[_0xc403('0x11')]();}if(_0x1a4a05[0x0]==='1'&&(_[_0xc403('0x12')](this[_0xc403('0x13')][_0xc403('0x14')])||!this[_0xc403('0x13')][_0xc403('0x14')])){logger[_0xc403('0xe')](_0xc403('0xf'),_0x3dd6c1,_0xc403('0x15'));return _0x1970c0[_0xc403('0x11')]();}if(_0x1a4a05[0x0]==='2'&&this[_0xc403('0x13')][_0xc403('0x16')]){logger[_0xc403('0xe')](_0xc403('0x17'),_0x3dd6c1,_0xc403('0x18'));return _0x1970c0[_0xc403('0x11')]();}var _0x20c180={'ContactId':this[_0xc403('0x19')]['id'],'sentAt':moment()[_0xc403('0x1a')](_0xc403('0x1b')),'direction':_0xc403('0x1c')};if(this['channel']===_0xc403('0x1d')){_0x20c180[_0xc403('0xc')]=utils[_0xc403('0x1e')](_0x1a4a05[0x2],this);}else{_0x20c180[_0xc403('0xc')]=utils[_0xc403('0x1e')](_0x1a4a05[0x1],this);}if(this[_0xc403('0x1f')]){_0x20c180['to']=this[_0xc403('0x1f')][_0xc403('0x20')]||'';if(this[_0xc403('0xb')]===_0xc403('0x1d')&&_0x1a4a05[0x1]==='1'){_0x20c180['cc']=this[_0xc403('0x1f')]['cc']||'';}_0x20c180['from']=this[_0xc403('0x1f')]['to']||'';_0x20c180[_0xc403('0x21')]=this['message'][_0xc403('0x21')]||'';_0x20c180[_0xc403('0x22')]=!![];if(this[_0xc403('0x1f')][_0xc403('0x23')]){_0x20c180[_0xc403('0x23')]='';_0x20c180[_0xc403('0x23')]+=_[_0xc403('0x24')](this[_0xc403('0x1f')]['subject'],'Re:')?'':_0xc403('0x25');_0x20c180[_0xc403('0x23')]+=this[_0xc403('0x1f')]['subject'];}}if(this['channel']===_0xc403('0x26')){_0x20c180[_0xc403('0x27')]=this[_0xc403('0x28')]['id'];}else{_0x20c180[_[_0xc403('0x29')](this[_0xc403('0xb')])+_0xc403('0x2a')]=this['account']['id'];}_0x20c180[_[_0xc403('0x29')](this['channel'])+_0xc403('0x2b')]=this[_0xc403('0x13')]['id'];var _0x375f66=this[_0xc403('0x13')];if(rpc[this['channel']+_0xc403('0x2c')]){if(this[_0xc403('0xb')]===_0xc403('0x1d')){_0x20c180[_0xc403('0x2d')]=this[_0xc403('0x1f')][_0xc403('0x2e')];_0x20c180[_0xc403('0x2f')]=_0xc403('0x30')+_[_0xc403('0x31')](_0x20c180[_0xc403('0xc')],_0xc403('0x32'),_0xc403('0x33'))+_0xc403('0x34');_0x20c180[_0xc403('0x35')]={'Auto-Submitted':_0xc403('0x36'),'X-Auto-Response-Suppress':_0xc403('0x37'),'Precedence':_0xc403('0x38')};return mailRpc['sendMailMessage'](this[_0xc403('0x28')]['smtpOptions'],_0x20c180)['then'](function(_0x479fcf){logger[_0xc403('0xe')]('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x3dd6c1);_0x20c180[_0xc403('0x2e')]=_0x479fcf[_0xc403('0x1f')][_0xc403('0x2e')];return rpc[_0xf721d4+_0xc403('0x2c')]['create'](_0x20c180);})[_0xc403('0x39')](function(_0x22c424){logger[_0xc403('0xe')](_0xc403('0xf'),_0x3dd6c1,JSON[_0xc403('0x3a')](_0x22c424));})['catch'](function(_0x2ed720){logger['error']('[RPC][%s][AUTOREPLY]\x20%s',_0x3dd6c1,JSON[_0xc403('0x3a')](_0x2ed720));})[_0xc403('0x3b')](function(){Promise[_0xc403('0x3c')]()[_0xc403('0x39')](function(){if(_0x1a4a05[0x0]!=='2'||_0x375f66[_0xc403('0x16')])return;return rpc[_0xf721d4+'Interaction'][_0xc403('0x3d')](_0x375f66['id'],{'autoreplyExecuted':!![]})['then'](function(_0x42a9bb){logger[_0xc403('0xe')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x3dd6c1,JSON[_0xc403('0x3a')](_0x42a9bb));})[_0xc403('0x3e')](function(_0x4b50b5){logger['error'](_0xc403('0x3f'),_0x3dd6c1,JSON[_0xc403('0x3a')](_0x4b50b5));});})[_0xc403('0x39')](function(){_0x1970c0[_0xc403('0x11')]();});});}else{return rpc[this[_0xc403('0xb')]+_0xc403('0x2c')][_0xc403('0x40')](_0x20c180)['then'](function(){logger['info']('[%s][AUTOREPLY]\x20%s',_0x3dd6c1,_0x20c180[_0xc403('0xc')]);})[_0xc403('0x3e')](function(_0x36679f){logger[_0xc403('0x41')](_0xc403('0xf'),_0x3dd6c1,JSON[_0xc403('0x3a')](_0x36679f));})[_0xc403('0x3b')](function(){Promise[_0xc403('0x3c')]()[_0xc403('0x39')](function(){if(_0x1a4a05[0x0]!=='2'||_0x375f66['autoreplyExecuted'])return;return rpc[_0xf721d4+_0xc403('0x42')][_0xc403('0x3d')](_0x375f66['id'],{'autoreplyExecuted':!![]})['then'](function(_0x18b4cf){logger[_0xc403('0xe')](_0xc403('0x17'),_0x3dd6c1,JSON[_0xc403('0x3a')](_0x18b4cf));})[_0xc403('0x3e')](function(_0x1233fa){logger['error'](_0xc403('0x3f'),_0x3dd6c1,JSON[_0xc403('0x3a')](_0x1233fa));});})[_0xc403('0x39')](function(){_0x1970c0[_0xc403('0x11')]();});});}}}catch(_0x2489bd){logger[_0xc403('0x41')](_0xc403('0xf'),_0x3dd6c1,JSON[_0xc403('0x3a')](_0x2489bd));_0x1970c0[_0xc403('0x43')]();}};}; \ No newline at end of file +var _0x2b35=['Message','inReplyTo','html','','';_0x2f3d88[_0x52b3('0x33')]={'Auto-Submitted':_0x52b3('0x34'),'X-Auto-Response-Suppress':_0x52b3('0x35'),'Precedence':_0x52b3('0x36')};return mailRpc[_0x52b3('0x37')](this[_0x52b3('0x38')][_0x52b3('0x39')],_0x2f3d88)[_0x52b3('0x3a')](function(_0x2ad6d1){logger['info'](_0x52b3('0x3b'),_0x1fc482);_0x2f3d88['messageId']=_0x2ad6d1[_0x52b3('0x23')][_0x52b3('0x3c')];return rpc[_0x2783ce+_0x52b3('0x2e')][_0x52b3('0x3d')](_0x2f3d88);})[_0x52b3('0x3a')](function(_0x1f9197){logger[_0x52b3('0x14')](_0x52b3('0x15'),_0x1fc482,JSON[_0x52b3('0x3e')](_0x1f9197));})['catch'](function(_0x5d2e98){logger[_0x52b3('0x3f')](_0x52b3('0x40'),_0x1fc482,JSON[_0x52b3('0x3e')](_0x5d2e98));})[_0x52b3('0x41')](function(){Promise['resolve']()[_0x52b3('0x3a')](function(){if(_0x37088c[0x0]!=='2'||_0x467b33['autoreplyExecuted'])return;return rpc[_0x2783ce+_0x52b3('0x42')][_0x52b3('0x43')](_0x467b33['id'],{'autoreplyExecuted':!![]})[_0x52b3('0x3a')](function(_0x2ab9cd){logger['info'](_0x52b3('0x1d'),_0x1fc482,JSON[_0x52b3('0x3e')](_0x2ab9cd));})['catch'](function(_0x22f5e0){logger[_0x52b3('0x3f')](_0x52b3('0x44'),_0x1fc482,JSON[_0x52b3('0x3e')](_0x22f5e0));});})['then'](function(){_0x1fae62[_0x52b3('0x17')]();});});}else{return rpc[this[_0x52b3('0x10')]+_0x52b3('0x2e')]['create'](_0x2f3d88)['then'](function(){logger[_0x52b3('0x14')]('[%s][AUTOREPLY]\x20%s',_0x1fc482,_0x2f3d88[_0x52b3('0x12')]);})[_0x52b3('0x45')](function(_0x19a51a){logger[_0x52b3('0x3f')](_0x52b3('0x15'),_0x1fc482,JSON[_0x52b3('0x3e')](_0x19a51a));})[_0x52b3('0x41')](function(){Promise[_0x52b3('0x46')]()[_0x52b3('0x3a')](function(){if(_0x37088c[0x0]!=='2'||_0x467b33[_0x52b3('0x1c')])return;return rpc[_0x2783ce+_0x52b3('0x42')][_0x52b3('0x43')](_0x467b33['id'],{'autoreplyExecuted':!![]})[_0x52b3('0x3a')](function(_0x395bf6){logger[_0x52b3('0x14')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x1fc482,JSON['stringify'](_0x395bf6));})[_0x52b3('0x45')](function(_0x44e1e0){logger['error'](_0x52b3('0x44'),_0x1fc482,JSON[_0x52b3('0x3e')](_0x44e1e0));});})[_0x52b3('0x3a')](function(){_0x1fae62[_0x52b3('0x17')]();});});}}}catch(_0x5c7ca0){logger[_0x52b3('0x3f')](_0x52b3('0x15'),_0x1fc482,JSON[_0x52b3('0x3e')](_0x5c7ca0));_0x1fae62['stop']();}};}; \ 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 fcdc5f1..f3c8db9 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 _0xe839=['../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','consequence','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction','interaction','catch','error','[%s][CLOSE]\x20%s','stringify','finally','moment','../../../../config/logger','../../rpc/chatInteraction','../../rpc/openchannelInteraction'];(function(_0x2dd390,_0x1bc894){var _0x3afe47=function(_0x42d8d3){while(--_0x42d8d3){_0x2dd390['push'](_0x2dd390['shift']());}};_0x3afe47(++_0x1bc894);}(_0xe839,0xf8));var _0x9e83=function(_0x22cc16,_0x1f4fa2){_0x22cc16=_0x22cc16-0x0;var _0x399b70=_0xe839[_0x22cc16];return _0x399b70;};'use strict';var moment=require(_0x9e83('0x0'));var logger=require(_0x9e83('0x1'))('routing');var rpc={'chatInteraction':require(_0x9e83('0x2')),'openchannelInteraction':require(_0x9e83('0x3')),'smsInteraction':require(_0x9e83('0x4')),'mailInteraction':require(_0x9e83('0x5')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x9e83('0x6'))};exports[_0x9e83('0x7')]=function(_0x23154b,_0x2b81da,_0x1d55bb,_0x38fcdc){return function(_0x4cfd53){try{logger['info'](_0x9e83('0x8'),_0x23154b,_0x2b81da[0x0]);var _0x4e9d31={'closed':0x1,'closedAt':moment()['format'](_0x9e83('0x9')),'closeReason':'system','disposition':_0x2b81da[0x0]};if(rpc[_0x38fcdc[_0x9e83('0xa')]+_0x9e83('0xb')]){rpc[_0x38fcdc[_0x9e83('0xa')]+_0x9e83('0xb')]['update'](_0x38fcdc[_0x9e83('0xc')]['id'],_0x4e9d31)['then'](function(_0x62bfcf){logger['info']('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x23154b,_0x38fcdc['interaction']['id']);})[_0x9e83('0xd')](function(_0x30aaae){logger[_0x9e83('0xe')](_0x9e83('0xf'),_0x23154b,JSON[_0x9e83('0x10')](_0x30aaae));})[_0x9e83('0x11')](function(){_0x4cfd53['stop']();});}}catch(_0x583dae){logger[_0x9e83('0xe')]('[%s][CLOSE]\x20%s',_0x23154b,JSON[_0x9e83('0x10')](_0x583dae));_0x4cfd53['stop']();}};}; \ No newline at end of file +var _0x1271=['then','info','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update'];(function(_0x5c6db5,_0x6ef01b){var _0x2a9296=function(_0x377020){while(--_0x377020){_0x5c6db5['push'](_0x5c6db5['shift']());}};_0x2a9296(++_0x6ef01b);}(_0x1271,0xd6));var _0x1127=function(_0xb21889,_0x5ca32c){_0xb21889=_0xb21889-0x0;var _0xec8324=_0x1271[_0xb21889];return _0xec8324;};'use strict';var moment=require(_0x1127('0x0'));var logger=require(_0x1127('0x1'))(_0x1127('0x2'));var rpc={'chatInteraction':require(_0x1127('0x3')),'openchannelInteraction':require(_0x1127('0x4')),'smsInteraction':require(_0x1127('0x5')),'mailInteraction':require(_0x1127('0x6')),'faxInteraction':require(_0x1127('0x7')),'whatsappInteraction':require(_0x1127('0x8'))};exports['consequence']=function(_0x2ef82d,_0x224744,_0x4010ff,_0x26ad69){return function(_0x5e5c14){try{logger['info'](_0x1127('0x9'),_0x2ef82d,_0x224744[0x0]);var _0x2e61e1={'closed':0x1,'closedAt':moment()[_0x1127('0xa')](_0x1127('0xb')),'closeReason':_0x1127('0xc'),'disposition':_0x224744[0x0]};if(rpc[_0x26ad69[_0x1127('0xd')]+_0x1127('0xe')]){rpc[_0x26ad69[_0x1127('0xd')]+_0x1127('0xe')][_0x1127('0xf')](_0x26ad69['interaction']['id'],_0x2e61e1)[_0x1127('0x10')](function(_0x16908f){logger[_0x1127('0x11')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x2ef82d,_0x26ad69['interaction']['id']);})['catch'](function(_0x272f09){logger[_0x1127('0x12')](_0x1127('0x13'),_0x2ef82d,JSON[_0x1127('0x14')](_0x272f09));})[_0x1127('0x15')](function(){_0x5e5c14[_0x1127('0x16')]();});}}catch(_0x42eded){logger[_0x1127('0x12')](_0x1127('0x13'),_0x2ef82d,JSON[_0x1127('0x14')](_0x42eded));_0x5e5c14[_0x1127('0x16')]();}};}; \ 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 b8269b8..e216f35 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 _0x304b=['endConversation','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','[%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','body','create','then','info','catch','error','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','result','fulfillment','speech','stringify','metadata'];(function(_0x18aedf,_0x43748b){var _0x530056=function(_0x59b534){while(--_0x59b534){_0x18aedf['push'](_0x18aedf['shift']());}};_0x530056(++_0x43748b);}(_0x304b,0xfb));var _0xb304=function(_0x1d5f9a,_0x341298){_0x1d5f9a=_0x1d5f9a-0x0;var _0x1e4a40=_0x304b[_0x1d5f9a];return _0x1e4a40;};'use strict';var _=require('lodash');var moment=require(_0xb304('0x0'));var apiai=require(_0xb304('0x1'));var md5=require(_0xb304('0x2'));var utils=require(_0xb304('0x3'));var logger=require(_0xb304('0x4'))(_0xb304('0x5'));var rpc={'chatMessage':require(_0xb304('0x6')),'openchannelMessage':require(_0xb304('0x7')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xb304('0x8')),'whatsappMessage':require(_0xb304('0x9'))};exports[_0xb304('0xa')]=function(_0x3eb6e0,_0x177964){return function(_0xded429){try{if(!_[_0xb304('0xb')](this[_0xb304('0xc')][_0xb304('0xd')])){logger['info'](_0xb304('0xe'),_0x3eb6e0,_0xb304('0xf'));return _0xded429[_0xb304('0x10')]();}var _0x5509d2={'ContactId':this[_0xb304('0x11')]['id'],'sentAt':moment()[_0xb304('0x12')](_0xb304('0x13')),'direction':_0xb304('0x14')};if(this[_0xb304('0x15')]===_0xb304('0x16')||this['channel']===_0xb304('0x17')){_0x5509d2[_0xb304('0x18')]=this[_0xb304('0xc')][_0xb304('0x18')];}var _0x489a00=this[_0xb304('0x15')];if(_0x489a00===_0xb304('0x19')){_0x5509d2[_0xb304('0x1a')]=this[_0xb304('0x1b')]['id'];}else{_0x5509d2[_[_0xb304('0x1c')](_0x489a00)+_0xb304('0x1d')]=this[_0xb304('0x1b')]['id'];}_0x5509d2[_[_0xb304('0x1c')](_0x489a00)+_0xb304('0x1e')]=this[_0xb304('0xc')]['id'];if(this[_0xb304('0xc')][_0xb304('0x1f')]){var _0x1252cb=_0x177964[0x2];if(!_['isEmpty'](_0x1252cb)){_0x5509d2[_0xb304('0x20')]=utils['getMustacheRender'](_0x1252cb,this);return rpc[_0x489a00+'Message'][_0xb304('0x21')](_0x5509d2)[_0xb304('0x22')](function(_0x45f368){logger[_0xb304('0x23')](_0xb304('0xe'),_0x3eb6e0,_0x5509d2['body']);})[_0xb304('0x24')](function(_0x5133e8){logger[_0xb304('0x25')](_0xb304('0xe'),_0x3eb6e0,JSON['stringify'](_0x5133e8));})['finally'](function(){logger['info'](_0xb304('0x26'),_0x3eb6e0);_0xded429[_0xb304('0x27')]();});}else{logger[_0xb304('0x23')](_0xb304('0x28'),_0x3eb6e0);_0xded429['stop']();}}else{var _0x218b9d=this;var _0x3694c4=apiai(_0x177964[0x0],{'language':_0x177964[0x1]||'en'});return _0x3694c4[_0xb304('0x29')](this[_0xb304('0x2a')]['body'],{'sessionId':md5(this['interaction']['id'])})['then'](function(_0x2fd41b){_0x218b9d['body'][_0xb304('0x2b')]=_0x2fd41b;_0x5509d2['body']=_0x2fd41b[_0xb304('0x2c')][_0xb304('0x2d')][_0xb304('0x2e')];_0x5509d2['providerName']=_0xb304('0x2b');_0x5509d2['providerResponse']=JSON[_0xb304('0x2f')](_0x2fd41b);return rpc[_0x489a00+'Message'][_0xb304('0x21')](_0x5509d2)[_0xb304('0x22')](function(_0x58971a){logger['info'](_0xb304('0xe'),_0x3eb6e0,_0x5509d2[_0xb304('0x20')]);if(_0x2fd41b[_0xb304('0x2c')][_0xb304('0x30')][_0xb304('0x31')]){_0xded429[_0xb304('0x10')]();}else{_0xded429[_0xb304('0x27')]();}})[_0xb304('0x24')](function(_0x57bc7d){logger[_0xb304('0x25')]('[%s][DIALOGFLOW]\x20%s',_0x3eb6e0,JSON[_0xb304('0x2f')](_0x57bc7d));_0xded429[_0xb304('0x10')]();});})['catch'](function(_0x4d7241){logger[_0xb304('0x25')](_0xb304('0xe'),_0x3eb6e0,_0x4d7241[_0xb304('0x2a')]);_0xded429['next']();});}}catch(_0x2e61f6){logger[_0xb304('0x25')]('[%s][DIALOGFLOW]\x20%s',_0x3eb6e0,JSON[_0xb304('0x2f')](_0x2e61f6));_0xded429[_0xb304('0x27')]();}};}; \ No newline at end of file +var _0x7fd6=['contact','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','phone','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','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','message','dialogflow','speech','providerName','providerResponse','result','metadata','endConversation','catch','error','lodash','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','next'];(function(_0x1baa47,_0x48bf09){var _0x4db2f0=function(_0x38e10c){while(--_0x38e10c){_0x1baa47['push'](_0x1baa47['shift']());}};_0x4db2f0(++_0x48bf09);}(_0x7fd6,0x157));var _0x67fd=function(_0x3edf06,_0x28169a){_0x3edf06=_0x3edf06-0x0;var _0x37ddfb=_0x7fd6[_0x3edf06];return _0x37ddfb;};'use strict';var _=require(_0x67fd('0x0'));var moment=require('moment');var apiai=require(_0x67fd('0x1'));var md5=require(_0x67fd('0x2'));var utils=require(_0x67fd('0x3'));var logger=require(_0x67fd('0x4'))(_0x67fd('0x5'));var rpc={'chatMessage':require(_0x67fd('0x6')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x67fd('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x440518,_0x23e1d6){return function(_0x21d7b1){try{if(!_[_0x67fd('0x8')](this[_0x67fd('0x9')][_0x67fd('0xa')])){logger[_0x67fd('0xb')](_0x67fd('0xc'),_0x440518,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x21d7b1[_0x67fd('0xd')]();}var _0xf35a50={'ContactId':this[_0x67fd('0xe')]['id'],'sentAt':moment()[_0x67fd('0xf')](_0x67fd('0x10')),'direction':_0x67fd('0x11')};if(this['channel']===_0x67fd('0x12')||this[_0x67fd('0x13')]===_0x67fd('0x14')){_0xf35a50[_0x67fd('0x15')]=this[_0x67fd('0x9')][_0x67fd('0x15')];}var _0x1d52ee=this[_0x67fd('0x13')];if(_0x1d52ee===_0x67fd('0x16')){_0xf35a50[_0x67fd('0x17')]=this[_0x67fd('0x18')]['id'];}else{_0xf35a50[_['upperFirst'](_0x1d52ee)+_0x67fd('0x19')]=this[_0x67fd('0x18')]['id'];}_0xf35a50[_[_0x67fd('0x1a')](_0x1d52ee)+_0x67fd('0x1b')]=this['interaction']['id'];if(this[_0x67fd('0x9')][_0x67fd('0x1c')]){var _0x576b61=_0x23e1d6[0x2];if(!_[_0x67fd('0x1d')](_0x576b61)){_0xf35a50[_0x67fd('0x1e')]=utils[_0x67fd('0x1f')](_0x576b61,this);return rpc[_0x1d52ee+_0x67fd('0x20')][_0x67fd('0x21')](_0xf35a50)[_0x67fd('0x22')](function(_0x1f019e){logger[_0x67fd('0xb')]('[%s][DIALOGFLOW]\x20%s',_0x440518,_0xf35a50[_0x67fd('0x1e')]);})['catch'](function(_0x2955cf){logger['error'](_0x67fd('0xc'),_0x440518,JSON[_0x67fd('0x23')](_0x2955cf));})[_0x67fd('0x24')](function(){logger['info'](_0x67fd('0x25'),_0x440518);_0x21d7b1[_0x67fd('0x26')]();});}else{logger['info'](_0x67fd('0x27'),_0x440518);_0x21d7b1[_0x67fd('0x26')]();}}else{var _0x2cface=this;var _0x5faffc=apiai(_0x23e1d6[0x0],{'language':_0x23e1d6[0x1]||'en'});return _0x5faffc[_0x67fd('0x28')](this[_0x67fd('0x29')][_0x67fd('0x1e')],{'sessionId':md5(this[_0x67fd('0x9')]['id'])})[_0x67fd('0x22')](function(_0x424447){_0x2cface['body'][_0x67fd('0x2a')]=_0x424447;_0xf35a50[_0x67fd('0x1e')]=_0x424447['result']['fulfillment'][_0x67fd('0x2b')];_0xf35a50[_0x67fd('0x2c')]=_0x67fd('0x2a');_0xf35a50[_0x67fd('0x2d')]=JSON[_0x67fd('0x23')](_0x424447);return rpc[_0x1d52ee+_0x67fd('0x20')]['create'](_0xf35a50)[_0x67fd('0x22')](function(_0x1c930d){logger[_0x67fd('0xb')]('[%s][DIALOGFLOW]\x20%s',_0x440518,_0xf35a50['body']);if(_0x424447[_0x67fd('0x2e')][_0x67fd('0x2f')][_0x67fd('0x30')]){_0x21d7b1[_0x67fd('0xd')]();}else{_0x21d7b1[_0x67fd('0x26')]();}})[_0x67fd('0x31')](function(_0x5d24e2){logger[_0x67fd('0x32')]('[%s][DIALOGFLOW]\x20%s',_0x440518,JSON[_0x67fd('0x23')](_0x5d24e2));_0x21d7b1[_0x67fd('0xd')]();});})[_0x67fd('0x31')](function(_0x184629){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x440518,_0x184629[_0x67fd('0x29')]);_0x21d7b1['next']();});}}catch(_0x2f4918){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x440518,JSON[_0x67fd('0x23')](_0x2f4918));_0x21d7b1[_0x67fd('0x26')]();}};}; \ 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 0e7455e..4947854 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 _0xc698=['DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','DIALOGFLOWV2_SCORE','providerName','dialogflowV2','providerResponse','fulfillmentText','push','all','catch','error','lodash','dialogflow','md5','bluebird','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','clone','body','Message','create','then','[%s][DIALOGFLOWV2]\x20%s','stringify','isNil','UserId','info','next','format','sms','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','getMustacheRender','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','sessionPath','interaction','message','detectIntent','length','diagnosticInfo','queryResult','boolValue'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xc698,0x116));var _0x8c69=function(_0x12b683,_0x124186){_0x12b683=_0x12b683-0x0;var _0xfb150b=_0xc698[_0x12b683];return _0xfb150b;};'use strict';var _=require(_0x8c69('0x0'));var dialogflow=require(_0x8c69('0x1'));var md5=require(_0x8c69('0x2'));var moment=require('moment');var Promise=require(_0x8c69('0x3'));var logger=require(_0x8c69('0x4'))(_0x8c69('0x5'));var utils=require('./utils');var rpc={'chatMessage':require(_0x8c69('0x6')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x8c69('0x7')),'smsMessage':require(_0x8c69('0x8')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x468970,_0x2b5941,_0x128b7b,_0x14269f){return new Promise(function(_0x2902cd,_0x364420){var _0x2167ca=_[_0x8c69('0x9')](_0x128b7b);_0x2167ca[_0x8c69('0xa')]=_0x14269f;return rpc[_0x2b5941+_0x8c69('0xb')][_0x8c69('0xc')](_0x2167ca)[_0x8c69('0xd')](function(){logger['info'](_0x8c69('0xe'),_0x468970,_0x2167ca['body']);_0x2902cd();})['catch'](function(_0x220a3b){logger['error'](_0x8c69('0xe'),_0x468970,JSON[_0x8c69('0xf')](_0x220a3b));_0x364420(_0x220a3b);});});}exports['consequence']=function(_0x425255,_0xf601dd){return function(_0x512367){try{if(!_[_0x8c69('0x10')](this['interaction'][_0x8c69('0x11')])){logger[_0x8c69('0x12')]('[%s][DIALOGFLOWV2]\x20%s',_0x425255,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x512367[_0x8c69('0x13')]();}var _0x4f9ad8={'ContactId':this['contact']['id'],'sentAt':moment()[_0x8c69('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this['channel']===_0x8c69('0x15')||this[_0x8c69('0x16')]===_0x8c69('0x17')){_0x4f9ad8[_0x8c69('0x18')]=this['interaction'][_0x8c69('0x18')];}var _0x5b7997=this['channel'];if(_0x5b7997===_0x8c69('0x19')){_0x4f9ad8[_0x8c69('0x1a')]=this[_0x8c69('0x1b')]['id'];}else{_0x4f9ad8[_[_0x8c69('0x1c')](_0x5b7997)+_0x8c69('0x1d')]=this[_0x8c69('0x1b')]['id'];}_0x4f9ad8[_['upperFirst'](_0x5b7997)+'InteractionId']=this['interaction']['id'];if(this['interaction']['created']){var _0x579f56=_0xf601dd[0x4];if(!_['isEmpty'](_0x579f56)){_0x4f9ad8[_0x8c69('0xa')]=utils[_0x8c69('0x1e')](_0x579f56,this);return rpc[_0x5b7997+_0x8c69('0xb')][_0x8c69('0xc')](_0x4f9ad8)['then'](function(_0x5c1bd7){logger[_0x8c69('0x12')](_0x8c69('0xe'),_0x425255,_0x4f9ad8['body']);})['catch'](function(_0xdca55a){logger['error'](_0x8c69('0xe'),_0x425255,JSON[_0x8c69('0xf')](_0xdca55a));})[_0x8c69('0x1f')](function(){logger[_0x8c69('0x12')](_0x8c69('0x20'),_0x425255);_0x512367[_0x8c69('0x21')]();});}else{logger[_0x8c69('0x12')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x425255);_0x512367[_0x8c69('0x21')]();}}else{var _0x4faa35=this;var _0x74acea=_0xf601dd[0x2]['replace'](/\\n/g,'\x0a');var _0x3057d8={'credentials':{'private_key':_0x74acea,'client_email':_0xf601dd[0x1]}};var _0x2b8991=new dialogflow['SessionsClient'](_0x3057d8);var _0x33b845=_0x2b8991[_0x8c69('0x22')](_0xf601dd[0x0],md5(_0x4faa35[_0x8c69('0x23')]['id']));var _0x5d9eff={'session':_0x33b845,'queryInput':{'text':{'text':_0x4faa35[_0x8c69('0x24')][_0x8c69('0xa')],'languageCode':_0xf601dd[0x3]||'en'}}};return _0x2b8991[_0x8c69('0x25')](_0x5d9eff)['then'](function(_0x16b48b){if(_0x16b48b&&_0x16b48b[_0x8c69('0x26')]){_0x4faa35['body']['dialogflowV2']=_0x16b48b;var _0x238243=_0x16b48b[0x0];var _0x545468=_0x238243['queryResult'][_0x8c69('0x27')]&&_0x238243[_0x8c69('0x28')]['diagnosticInfo']['fields']?_0x238243[_0x8c69('0x28')][_0x8c69('0x27')]['fields']['end_conversation'][_0x8c69('0x29')]:![];_0x4faa35['body'][_0x8c69('0x2a')]=_0x238243[_0x8c69('0x28')][_0x8c69('0x2b')];_0x4faa35['body'][_0x8c69('0x2c')]=_0x238243[_0x8c69('0x28')][_0x8c69('0x2d')];_0x4faa35[_0x8c69('0xa')][_0x8c69('0x2e')]=_0x238243[_0x8c69('0x28')]['diagnosticInfo']&&_0x238243[_0x8c69('0x28')]['diagnosticInfo']['fields']?_0x238243['queryResult']['diagnosticInfo']['fields']['end_conversation'][_0x8c69('0x29')]:![];_0x4faa35[_0x8c69('0xa')]['DIALOGFLOWV2_INTENTNAME']=_0x238243[_0x8c69('0x28')][_0x8c69('0x2f')][_0x8c69('0x30')];_0x4faa35[_0x8c69('0xa')][_0x8c69('0x31')]=_0x238243['queryResult'][_0x8c69('0x2f')]['displayName'];_0x4faa35[_0x8c69('0xa')][_0x8c69('0x32')]=_0x238243[_0x8c69('0x28')][_0x8c69('0x2f')][_0x8c69('0x33')];_0x4faa35[_0x8c69('0xa')][_0x8c69('0x34')]=_0x238243['queryResult'][_0x8c69('0x35')];_0x4faa35[_0x8c69('0xa')][_0x8c69('0x36')]=_0x238243[_0x8c69('0x28')]['queryText'];_0x4faa35[_0x8c69('0xa')][_0x8c69('0x37')]=_0x238243['queryResult']['intentDetectionConfidence'];_0x4f9ad8[_0x8c69('0x38')]=_0x8c69('0x39');_0x4f9ad8[_0x8c69('0x3a')]=JSON['stringify'](_0x16b48b);var _0x29e3ac=[];for(var _0xe93dbf=0x0;_0xe93dbf<_0x16b48b[_0x8c69('0x26')];_0xe93dbf++){var _0x421f48=_0x16b48b[_0xe93dbf];if(_0x421f48&&_0x421f48[_0x8c69('0x28')]&&_0x421f48['queryResult'][_0x8c69('0x3b')]){_0x29e3ac[_0x8c69('0x3c')](createMessage(_0x425255,_0x5b7997,_0x4f9ad8,_0x421f48[_0x8c69('0x28')]['fulfillmentText']));}}return Promise[_0x8c69('0x3d')](_0x29e3ac)['then'](function(){if(_0x545468){_0x512367[_0x8c69('0x13')]();}else{_0x512367[_0x8c69('0x21')]();}})[_0x8c69('0x3e')](function(_0x268a97){logger[_0x8c69('0x3f')](_0x8c69('0xe'),_0x425255,JSON['stringify'](_0x268a97));_0x512367[_0x8c69('0x13')]();});}})[_0x8c69('0x3e')](function(_0x351763){logger[_0x8c69('0x3f')](_0x8c69('0xe'),_0x425255,_0x351763[_0x8c69('0x24')]);_0x512367[_0x8c69('0x13')]();});}}catch(_0x168d99){logger['error'](_0x8c69('0xe'),_0x425255,JSON[_0x8c69('0xf')](_0x168d99));_0x512367[_0x8c69('0x21')]();}};}; \ No newline at end of file +var _0x8645=['stringify','consequence','isNil','interaction','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','InteractionId','created','getMustacheRender','create','info','error','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','diagnosticInfo','queryResult','fields','end_conversation','boolValue','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','queryText','DIALOGFLOWV2_SCORE','providerName','providerResponse','fulfillmentText','push','lodash','md5','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','body','Message','then','[%s][DIALOGFLOWV2]\x20%s','catch'];(function(_0x47b6e1,_0x16d02b){var _0x36f3b9=function(_0x13a3ae){while(--_0x13a3ae){_0x47b6e1['push'](_0x47b6e1['shift']());}};_0x36f3b9(++_0x16d02b);}(_0x8645,0x145));var _0x5864=function(_0x5c1cdc,_0x322014){_0x5c1cdc=_0x5c1cdc-0x0;var _0x2e8317=_0x8645[_0x5c1cdc];return _0x2e8317;};'use strict';var _=require(_0x5864('0x0'));var dialogflow=require('dialogflow');var md5=require(_0x5864('0x1'));var moment=require('moment');var Promise=require('bluebird');var logger=require(_0x5864('0x2'))(_0x5864('0x3'));var utils=require(_0x5864('0x4'));var rpc={'chatMessage':require(_0x5864('0x5')),'openchannelMessage':require(_0x5864('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x5864('0x7')),'faxMessage':require(_0x5864('0x8')),'whatsappMessage':require(_0x5864('0x9'))};function createMessage(_0x498c75,_0xfe6382,_0x54fc05,_0x5e7c25){return new Promise(function(_0x3f795d,_0x20aa90){var _0x2652df=_['clone'](_0x54fc05);_0x2652df[_0x5864('0xa')]=_0x5e7c25;return rpc[_0xfe6382+_0x5864('0xb')]['create'](_0x2652df)[_0x5864('0xc')](function(){logger['info'](_0x5864('0xd'),_0x498c75,_0x2652df['body']);_0x3f795d();})[_0x5864('0xe')](function(_0x4947c5){logger['error'](_0x5864('0xd'),_0x498c75,JSON[_0x5864('0xf')](_0x4947c5));_0x20aa90(_0x4947c5);});});}exports[_0x5864('0x10')]=function(_0x36faa2,_0x1910c2){return function(_0x588bbc){try{if(!_[_0x5864('0x11')](this[_0x5864('0x12')]['UserId'])){logger['info'](_0x5864('0xd'),_0x36faa2,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x588bbc[_0x5864('0x13')]();}var _0x3d01e3={'ContactId':this[_0x5864('0x14')]['id'],'sentAt':moment()['format'](_0x5864('0x15')),'direction':_0x5864('0x16')};if(this[_0x5864('0x17')]===_0x5864('0x18')||this[_0x5864('0x17')]===_0x5864('0x19')){_0x3d01e3[_0x5864('0x1a')]=this[_0x5864('0x12')][_0x5864('0x1a')];}var _0x312066=this['channel'];if(_0x312066===_0x5864('0x1b')){_0x3d01e3[_0x5864('0x1c')]=this[_0x5864('0x1d')]['id'];}else{_0x3d01e3[_[_0x5864('0x1e')](_0x312066)+'AccountId']=this['account']['id'];}_0x3d01e3[_['upperFirst'](_0x312066)+_0x5864('0x1f')]=this[_0x5864('0x12')]['id'];if(this[_0x5864('0x12')][_0x5864('0x20')]){var _0x42f5c5=_0x1910c2[0x4];if(!_['isEmpty'](_0x42f5c5)){_0x3d01e3[_0x5864('0xa')]=utils[_0x5864('0x21')](_0x42f5c5,this);return rpc[_0x312066+_0x5864('0xb')][_0x5864('0x22')](_0x3d01e3)[_0x5864('0xc')](function(_0x521eee){logger[_0x5864('0x23')](_0x5864('0xd'),_0x36faa2,_0x3d01e3[_0x5864('0xa')]);})['catch'](function(_0x54d6e5){logger[_0x5864('0x24')](_0x5864('0xd'),_0x36faa2,JSON[_0x5864('0xf')](_0x54d6e5));})['finally'](function(){logger[_0x5864('0x23')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x36faa2);_0x588bbc[_0x5864('0x25')]();});}else{logger['info'](_0x5864('0x26'),_0x36faa2);_0x588bbc[_0x5864('0x25')]();}}else{var _0x2b9b30=this;var _0x2e9ea4=_0x1910c2[0x2][_0x5864('0x27')](/\\n/g,'\x0a');var _0x409120={'credentials':{'private_key':_0x2e9ea4,'client_email':_0x1910c2[0x1]}};var _0x111083=new dialogflow[(_0x5864('0x28'))](_0x409120);var _0x156d79=_0x111083[_0x5864('0x29')](_0x1910c2[0x0],md5(_0x2b9b30[_0x5864('0x12')]['id']));var _0x5a88cb={'session':_0x156d79,'queryInput':{'text':{'text':_0x2b9b30[_0x5864('0x2a')]['body'],'languageCode':_0x1910c2[0x3]||'en'}}};return _0x111083[_0x5864('0x2b')](_0x5a88cb)[_0x5864('0xc')](function(_0x42b607){if(_0x42b607&&_0x42b607[_0x5864('0x2c')]){_0x2b9b30[_0x5864('0xa')][_0x5864('0x2d')]=_0x42b607;var _0x322395=_0x42b607[0x0];var _0x27153b=_0x322395['queryResult'][_0x5864('0x2e')]&&_0x322395[_0x5864('0x2f')][_0x5864('0x2e')][_0x5864('0x30')]?_0x322395['queryResult'][_0x5864('0x2e')][_0x5864('0x30')][_0x5864('0x31')][_0x5864('0x32')]:![];_0x2b9b30[_0x5864('0xa')]['DIALOGFLOWV2_ACTION']=_0x322395[_0x5864('0x2f')]['action'];_0x2b9b30[_0x5864('0xa')][_0x5864('0x33')]=_0x322395['queryResult'][_0x5864('0x34')];_0x2b9b30[_0x5864('0xa')][_0x5864('0x35')]=_0x322395[_0x5864('0x2f')]['diagnosticInfo']&&_0x322395[_0x5864('0x2f')]['diagnosticInfo'][_0x5864('0x30')]?_0x322395[_0x5864('0x2f')][_0x5864('0x2e')][_0x5864('0x30')][_0x5864('0x31')][_0x5864('0x32')]:![];_0x2b9b30[_0x5864('0xa')][_0x5864('0x36')]=_0x322395['queryResult'][_0x5864('0x37')][_0x5864('0x38')];_0x2b9b30[_0x5864('0xa')][_0x5864('0x39')]=_0x322395['queryResult'][_0x5864('0x37')]['displayName'];_0x2b9b30[_0x5864('0xa')][_0x5864('0x3a')]=_0x322395['queryResult'][_0x5864('0x37')][_0x5864('0x3b')];_0x2b9b30[_0x5864('0xa')][_0x5864('0x3c')]=_0x322395[_0x5864('0x2f')][_0x5864('0x3d')];_0x2b9b30[_0x5864('0xa')]['DIALOGFLOWV2_QUERYTEXT']=_0x322395['queryResult'][_0x5864('0x3e')];_0x2b9b30[_0x5864('0xa')][_0x5864('0x3f')]=_0x322395[_0x5864('0x2f')]['intentDetectionConfidence'];_0x3d01e3[_0x5864('0x40')]=_0x5864('0x2d');_0x3d01e3[_0x5864('0x41')]=JSON[_0x5864('0xf')](_0x42b607);var _0x22b744=[];for(var _0x4b3fa1=0x0;_0x4b3fa1<_0x42b607[_0x5864('0x2c')];_0x4b3fa1++){var _0x2a0c3c=_0x42b607[_0x4b3fa1];if(_0x2a0c3c&&_0x2a0c3c[_0x5864('0x2f')]&&_0x2a0c3c['queryResult'][_0x5864('0x42')]){_0x22b744[_0x5864('0x43')](createMessage(_0x36faa2,_0x312066,_0x3d01e3,_0x2a0c3c[_0x5864('0x2f')][_0x5864('0x42')]));}}return Promise['all'](_0x22b744)[_0x5864('0xc')](function(){if(_0x27153b){_0x588bbc[_0x5864('0x13')]();}else{_0x588bbc[_0x5864('0x25')]();}})['catch'](function(_0x5aa280){logger[_0x5864('0x24')](_0x5864('0xd'),_0x36faa2,JSON['stringify'](_0x5aa280));_0x588bbc[_0x5864('0x13')]();});}})[_0x5864('0xe')](function(_0x5bb9e0){logger['error'](_0x5864('0xd'),_0x36faa2,_0x5bb9e0[_0x5864('0x2a')]);_0x588bbc['next']();});}}catch(_0x2d49da){logger[_0x5864('0x24')](_0x5864('0xd'),_0x36faa2,JSON[_0x5864('0xf')](_0x2d49da));_0x588bbc[_0x5864('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 e20b87a..449e08a 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 _0xf816=['join','priorityTrue','priorityFalse','info','condition','next','stop','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','map'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xf816,0x175));var _0x6f81=function(_0x3d4805,_0x5bdf6a){_0x3d4805=_0x3d4805-0x0;var _0x45bcba=_0xf816[_0x3d4805];return _0x45bcba;};'use strict';var schema=require(_0x6f81('0x0'));var _=require(_0x6f81('0x1'));var htmlToText=require(_0x6f81('0x2'));var utils=require('./utils');var logger=require(_0x6f81('0x3'))(_0x6f81('0x4'));var gotoif=schema({'condition':{'type':_0x6f81('0x5'),'required':!![],'message':_0x6f81('0x6')},'priorityTrue':{'type':'number','message':_0x6f81('0x7')},'priorityFalse':{'type':'number','message':_0x6f81('0x8')}});exports[_0x6f81('0x9')]=function(_0xb17d52,_0x583073){return function(_0x371bfc){try{var _0x47d598={'condition':htmlToText[_0x6f81('0xa')](utils[_0x6f81('0xb')](_0x583073[0x0],this),{'wordwrap':![]})[_0x6f81('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x583073[0x1],'priorityFalse':_0x583073[0x2]};var _0x3b17e2=gotoif[_0x6f81('0x0')](_0x47d598,{'typecast':!![]});if(_0x3b17e2[_0x6f81('0xd')]){logger[_0x6f81('0xe')](_0x6f81('0xf'),_0xb17d52,_[_0x6f81('0x10')](_0x3b17e2,'message')[_0x6f81('0x11')](',\x20'));_0x371bfc['stop']();}else{try{var _0x2431ad=eval('('+_0x47d598['condition']+')');var _0x4100b6=_0x2431ad?_0x47d598[_0x6f81('0x12')]:_0x47d598[_0x6f81('0x13')];logger[_0x6f81('0x14')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0xb17d52,_0x47d598[_0x6f81('0x15')],_0x2431ad,_0x4100b6||'next');if(_0x4100b6){var _0x1a3b5d=_['findIndex'](_0x371bfc['rules'](),{'p':_0x4100b6});if(_0x1a3b5d>=0x0){logger[_0x6f81('0x14')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0xb17d52,_0x4100b6||_0x6f81('0x16'),_0x1a3b5d);_0x371bfc['next'](_0x1a3b5d);}else{logger[_0x6f81('0x14')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0xb17d52,_0x4100b6||'next');_0x371bfc[_0x6f81('0x17')]();}}else{_0x371bfc[_0x6f81('0x16')]();}}catch(_0x3f93b6){logger[_0x6f81('0xe')](_0x6f81('0x18'),_0xb17d52,_0x3f93b6['message']);_0x371bfc[_0x6f81('0x17')]();}}}catch(_0x18eb02){logger[_0x6f81('0xe')]('[%s][GOTOIF]\x20%s',_0xb17d52,JSON[_0x6f81('0x19')](_0x18eb02));_0x371bfc[_0x6f81('0x17')]();}};}; \ No newline at end of file +var _0x34f1=['condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20false\x20is\x20a\x20number','consequence','getMustacheRender','length','[%s][GOTOIF]\x20%s','map','message','stop','priorityTrue','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','html-to-text','../../../../config/logger','routing','string'];(function(_0xb98187,_0x4736ae){var _0x540550=function(_0x180cfa){while(--_0x180cfa){_0xb98187['push'](_0xb98187['shift']());}};_0x540550(++_0x4736ae);}(_0x34f1,0x79));var _0x134f=function(_0x1e0945,_0x52dbce){_0x1e0945=_0x1e0945-0x0;var _0x4b804f=_0x34f1[_0x1e0945];return _0x4b804f;};'use strict';var schema=require('validate');var _=require('lodash');var htmlToText=require(_0x134f('0x0'));var utils=require('./utils');var logger=require(_0x134f('0x1'))(_0x134f('0x2'));var gotoif=schema({'condition':{'type':_0x134f('0x3'),'required':!![],'message':_0x134f('0x4')},'priorityTrue':{'type':_0x134f('0x5'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x134f('0x5'),'message':_0x134f('0x6')}});exports[_0x134f('0x7')]=function(_0x483c58,_0x36a866){return function(_0x869e55){try{var _0x25d3b0={'condition':htmlToText['fromString'](utils[_0x134f('0x8')](_0x36a866[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x36a866[0x1],'priorityFalse':_0x36a866[0x2]};var _0x3c8be6=gotoif['validate'](_0x25d3b0,{'typecast':!![]});if(_0x3c8be6[_0x134f('0x9')]){logger['error'](_0x134f('0xa'),_0x483c58,_[_0x134f('0xb')](_0x3c8be6,_0x134f('0xc'))['join'](',\x20'));_0x869e55[_0x134f('0xd')]();}else{try{var _0x2cfe58=eval('('+_0x25d3b0['condition']+')');var _0x2293f1=_0x2cfe58?_0x25d3b0[_0x134f('0xe')]:_0x25d3b0['priorityFalse'];logger[_0x134f('0xf')](_0x134f('0x10'),_0x483c58,_0x25d3b0[_0x134f('0x11')],_0x2cfe58,_0x2293f1||_0x134f('0x12'));if(_0x2293f1){var _0x13bee5=_[_0x134f('0x13')](_0x869e55['rules'](),{'p':_0x2293f1});if(_0x13bee5>=0x0){logger[_0x134f('0xf')](_0x134f('0x14'),_0x483c58,_0x2293f1||_0x134f('0x12'),_0x13bee5);_0x869e55[_0x134f('0x12')](_0x13bee5);}else{logger['info'](_0x134f('0x15'),_0x483c58,_0x2293f1||_0x134f('0x12'));_0x869e55[_0x134f('0xd')]();}}else{_0x869e55['next']();}}catch(_0x5b5e25){logger[_0x134f('0x16')](_0x134f('0x17'),_0x483c58,_0x5b5e25[_0x134f('0xc')]);_0x869e55['stop']();}}}catch(_0xc7daf){logger[_0x134f('0x16')](_0x134f('0xa'),_0x483c58,JSON[_0x134f('0x18')](_0xc7daf));_0x869e55['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index eeb093e..8220db4 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 _0xe719=['lodash','../../../../config/logger','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','validate'];(function(_0x5aaaa1,_0x7905bf){var _0x213174=function(_0x13c3a9){while(--_0x13c3a9){_0x5aaaa1['push'](_0x5aaaa1['shift']());}};_0x213174(++_0x7905bf);}(_0xe719,0x1df));var _0x9e71=function(_0x3d93bb,_0x56ef86){_0x3d93bb=_0x3d93bb-0x0;var _0x26ae84=_0xe719[_0x3d93bb];return _0x26ae84;};'use strict';var schema=require(_0x9e71('0x0'));var _=require(_0x9e71('0x1'));var logger=require(_0x9e71('0x2'))('routing');var gotop=schema({'priority':{'type':_0x9e71('0x3'),'required':!![],'message':_0x9e71('0x4')}});exports[_0x9e71('0x5')]=function(_0x5ce4ec,_0x49260c){return function(_0x5126d3){try{var _0x59d5aa={'priority':_0x49260c[0x0]};var _0x45f850=gotop[_0x9e71('0x0')](_0x59d5aa,{'typecast':!![]});if(_0x45f850[_0x9e71('0x6')]){logger[_0x9e71('0x7')](_0x9e71('0x8'),_0x5ce4ec,_[_0x9e71('0x9')](_0x45f850,_0x9e71('0xa'))[_0x9e71('0xb')](',\x20'));_0x5126d3[_0x9e71('0xc')]();}else{logger[_0x9e71('0xd')](_0x9e71('0xe'),_0x5ce4ec,_0x59d5aa[_0x9e71('0xf')]);if(_0x59d5aa[_0x9e71('0xf')]){var _0x556e6d=_[_0x9e71('0x10')](_0x5126d3[_0x9e71('0x11')](),{'p':_0x59d5aa[_0x9e71('0xf')]});if(_0x556e6d>=0x0){logger[_0x9e71('0xd')](_0x9e71('0x12'),_0x5ce4ec,_0x59d5aa[_0x9e71('0xf')]||'next',_0x556e6d);_0x5126d3['next'](_0x556e6d);}else{logger['info'](_0x9e71('0x13'),_0x5ce4ec,_0x59d5aa['priority']||'next');_0x5126d3[_0x9e71('0xc')]();}}else{_0x5126d3['next']();}}}catch(_0x34a18c){logger[_0x9e71('0x7')](_0x9e71('0x8'),_0x5ce4ec,JSON['stringify'](_0x34a18c));_0x5126d3[_0x9e71('0xc')]();}};}; \ No newline at end of file +var _0x1e56=['map','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s'];(function(_0x276c8d,_0x437fa6){var _0x51c99f=function(_0x474eb5){while(--_0x474eb5){_0x276c8d['push'](_0x276c8d['shift']());}};_0x51c99f(++_0x437fa6);}(_0x1e56,0x187));var _0x61e5=function(_0x4387af,_0x1de943){_0x4387af=_0x4387af-0x0;var _0x5ecbbc=_0x1e56[_0x4387af];return _0x5ecbbc;};'use strict';var schema=require(_0x61e5('0x0'));var _=require(_0x61e5('0x1'));var logger=require('../../../../config/logger')('routing');var gotop=schema({'priority':{'type':_0x61e5('0x2'),'required':!![],'message':_0x61e5('0x3')}});exports[_0x61e5('0x4')]=function(_0x537e53,_0x59c654){return function(_0x55dec6){try{var _0x168623={'priority':_0x59c654[0x0]};var _0x513ee0=gotop['validate'](_0x168623,{'typecast':!![]});if(_0x513ee0[_0x61e5('0x5')]){logger[_0x61e5('0x6')](_0x61e5('0x7'),_0x537e53,_[_0x61e5('0x8')](_0x513ee0,'message')[_0x61e5('0x9')](',\x20'));_0x55dec6[_0x61e5('0xa')]();}else{logger[_0x61e5('0xb')](_0x61e5('0xc'),_0x537e53,_0x168623['priority']);if(_0x168623[_0x61e5('0xd')]){var _0x51a16b=_[_0x61e5('0xe')](_0x55dec6['rules'](),{'p':_0x168623[_0x61e5('0xd')]});if(_0x51a16b>=0x0){logger['info'](_0x61e5('0xf'),_0x537e53,_0x168623[_0x61e5('0xd')]||_0x61e5('0x10'),_0x51a16b);_0x55dec6[_0x61e5('0x10')](_0x51a16b);}else{logger[_0x61e5('0xb')](_0x61e5('0x11'),_0x537e53,_0x168623[_0x61e5('0xd')]||_0x61e5('0x10'));_0x55dec6['stop']();}}else{_0x55dec6[_0x61e5('0x10')]();}}}catch(_0x5d3a47){logger[_0x61e5('0x6')](_0x61e5('0x7'),_0x537e53,JSON[_0x61e5('0x12')](_0x5d3a47));_0x55dec6[_0x61e5('0xa')]();}};}; \ 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 82ff905..cf710ad 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 _0xd557=['../../rpc/smsMessage','../../rpc/whatsappMessage','contact','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','Message','create','then','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage'];(function(_0x117896,_0x9be7a3){var _0x586b7e=function(_0x642fd6){while(--_0x642fd6){_0x117896['push'](_0x117896['shift']());}};_0x586b7e(++_0x9be7a3);}(_0xd557,0x18a));var _0x7d55=function(_0x528e73,_0x5b5dd2){_0x528e73=_0x528e73-0x0;var _0x1e0289=_0xd557[_0x528e73];return _0x1e0289;};'use strict';var _=require(_0x7d55('0x0'));var utils=require(_0x7d55('0x1'));var logger=require(_0x7d55('0x2'))(_0x7d55('0x3'));var rpc={'chatMessage':require(_0x7d55('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x7d55('0x5')),'smsMessage':require(_0x7d55('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x7d55('0x7'))};exports['consequence']=function(_0x204a5e,_0x47c5b6){return function(_0x5a6c36){try{var _0x353fd9={'body':utils['getMustacheRender'](_0x47c5b6[0x0],this),'ContactId':this[_0x7d55('0x8')]['id']};if(this[_0x7d55('0x9')]===_0x7d55('0xa')){_0x353fd9[_0x7d55('0xb')]=this[_0x7d55('0xc')]['id'];}else{_0x353fd9[_[_0x7d55('0xd')](this[_0x7d55('0x9')])+_0x7d55('0xe')]=this['account']['id'];}_0x353fd9[_[_0x7d55('0xd')](this[_0x7d55('0x9')])+'InteractionId']=this['interaction']['id'];if(rpc[this[_0x7d55('0x9')]+_0x7d55('0xf')]){return rpc[this[_0x7d55('0x9')]+'Message'][_0x7d55('0x10')](_0x353fd9)[_0x7d55('0x11')](function(_0x1b0540){logger['info'](_0x7d55('0x12'),_0x204a5e,_0x353fd9[_0x7d55('0x13')]);_0x5a6c36[_0x7d55('0x14')]();})[_0x7d55('0x15')](function(_0x5076b8){logger[_0x7d55('0x16')](_0x7d55('0x12'),_0x204a5e,JSON[_0x7d55('0x17')](_0x5076b8));_0x5a6c36[_0x7d55('0x18')]();});}}catch(_0x5b160f){logger[_0x7d55('0x16')](_0x7d55('0x12'),_0x204a5e,JSON[_0x7d55('0x17')](_0x5b160f));_0x5a6c36[_0x7d55('0x18')]();}};}; \ No newline at end of file +var _0xefda=['create','then','info','body','next','catch','[%s][MESSAGE]\x20%s','stringify','stop','error','lodash','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','chat','ChatWebsiteId','account','upperFirst','channel','InteractionId','interaction','Message'];(function(_0x576e2b,_0x328953){var _0x46461a=function(_0xce4d9e){while(--_0xce4d9e){_0x576e2b['push'](_0x576e2b['shift']());}};_0x46461a(++_0x328953);}(_0xefda,0x96));var _0xaefd=function(_0x2e4f17,_0x4734b2){_0x2e4f17=_0x2e4f17-0x0;var _0x25d2e0=_0xefda[_0x2e4f17];return _0x25d2e0;};'use strict';var _=require(_0xaefd('0x0'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0xaefd('0x1'));var rpc={'chatMessage':require(_0xaefd('0x2')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xaefd('0x3')),'smsMessage':require(_0xaefd('0x4')),'faxMessage':require(_0xaefd('0x5')),'whatsappMessage':require(_0xaefd('0x6'))};exports[_0xaefd('0x7')]=function(_0x3288f9,_0x497258){return function(_0x3677ea){try{var _0x3b9736={'body':utils[_0xaefd('0x8')](_0x497258[0x0],this),'ContactId':this[_0xaefd('0x9')]['id']};if(this['channel']===_0xaefd('0xa')){_0x3b9736[_0xaefd('0xb')]=this[_0xaefd('0xc')]['id'];}else{_0x3b9736[_['upperFirst'](this['channel'])+'AccountId']=this[_0xaefd('0xc')]['id'];}_0x3b9736[_[_0xaefd('0xd')](this[_0xaefd('0xe')])+_0xaefd('0xf')]=this[_0xaefd('0x10')]['id'];if(rpc[this[_0xaefd('0xe')]+_0xaefd('0x11')]){return rpc[this[_0xaefd('0xe')]+_0xaefd('0x11')][_0xaefd('0x12')](_0x3b9736)[_0xaefd('0x13')](function(_0x4b2b5c){logger[_0xaefd('0x14')]('[%s][MESSAGE]\x20%s',_0x3288f9,_0x3b9736[_0xaefd('0x15')]);_0x3677ea[_0xaefd('0x16')]();})[_0xaefd('0x17')](function(_0x43b82a){logger['error'](_0xaefd('0x18'),_0x3288f9,JSON[_0xaefd('0x19')](_0x43b82a));_0x3677ea[_0xaefd('0x1a')]();});}}catch(_0x411701){logger[_0xaefd('0x1b')](_0xaefd('0x18'),_0x3288f9,JSON[_0xaefd('0x19')](_0x411701));_0x3677ea[_0xaefd('0x1a')]();}};}; \ 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 7469385..25345b8 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 _0x1938=['./utils','../../../../config/logger','routing','[%s][NOOP]\x20%s','next','error','stringify','stop'];(function(_0x4970d6,_0x2e6b07){var _0x2857f3=function(_0x447128){while(--_0x447128){_0x4970d6['push'](_0x4970d6['shift']());}};_0x2857f3(++_0x2e6b07);}(_0x1938,0x178));var _0x8193=function(_0x420dcf,_0x5533df){_0x420dcf=_0x420dcf-0x0;var _0x1ca036=_0x1938[_0x420dcf];return _0x1ca036;};'use strict';var utils=require(_0x8193('0x0'));var logger=require(_0x8193('0x1'))(_0x8193('0x2'));exports['consequence']=function(_0x51862c,_0x4712ee){return function(_0x1598c0){try{logger['info'](_0x8193('0x3'),_0x51862c,utils['getMustacheRender'](_0x4712ee[0x0],this));_0x1598c0[_0x8193('0x4')]();}catch(_0x4ace2b){logger[_0x8193('0x5')](_0x8193('0x3'),_0x51862c,JSON[_0x8193('0x6')](_0x4ace2b));_0x1598c0[_0x8193('0x7')]();}};}; \ No newline at end of file +var _0x149e=['routing','consequence','getMustacheRender','next','error','stringify','../../../../config/logger'];(function(_0x171648,_0x2606c9){var _0x3fe962=function(_0x239fe2){while(--_0x239fe2){_0x171648['push'](_0x171648['shift']());}};_0x3fe962(++_0x2606c9);}(_0x149e,0xe6));var _0xe149=function(_0x53b953,_0x4fd4c7){_0x53b953=_0x53b953-0x0;var _0x227928=_0x149e[_0x53b953];return _0x227928;};'use strict';var utils=require('./utils');var logger=require(_0xe149('0x0'))(_0xe149('0x1'));exports[_0xe149('0x2')]=function(_0x48abea,_0x5cb934){return function(_0x339998){try{logger['info']('[%s][NOOP]\x20%s',_0x48abea,utils[_0xe149('0x3')](_0x5cb934[0x0],this));_0x339998[_0xe149('0x4')]();}catch(_0x5be4a7){logger[_0xe149('0x5')]('[%s][NOOP]\x20%s',_0x48abea,JSON[_0xe149('0x6')](_0x5be4a7));_0x339998['stop']();}};}; \ 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 d300ae3..c062791 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 _0xd3e7=['message','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update\x20queue\x20report','timeout','error','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','Queues','createQueue','atimeout','qtimeout','rules','end','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','strategy','rrmemory','beepall','log','stack','validate','util','ioredis','../../../../config/environment','../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','queue_id','account','queue','joinAt','emit','clone','format','%s:queue:%s','%s_queue_waiting_interaction:%s','save','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','QueueId','channel','InteractionId','interaction','MessageId'];(function(_0x440f36,_0x22f849){var _0x3d49cd=function(_0x28e35f){while(--_0x28e35f){_0x440f36['push'](_0x440f36['shift']());}};_0x3d49cd(++_0x22f849);}(_0xd3e7,0xb9));var _0x7d3e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd3e7[_0x122ef9];return _0x42fba0;};'use strict';var schema=require(_0x7d3e('0x0'));var _=require('lodash');var util=require(_0x7d3e('0x1'));var seqqueue=require('seq-queue');var moment=require('moment');var Redis=require(_0x7d3e('0x2'));var config=require(_0x7d3e('0x3'));var logger=require(_0x7d3e('0x4'))(_0x7d3e('0x5'));var strategy=require('./strategy');config[_0x7d3e('0x6')]=_[_0x7d3e('0x7')](config['redis'],{'host':_0x7d3e('0x8'),'port':0x18eb});var io=require(_0x7d3e('0x9'))(new Redis(config['redis']));var attributes=['id',_0x7d3e('0xa'),_0x7d3e('0xb'),_0x7d3e('0xc'),'from',_0x7d3e('0xd')];function emit(_0x5d9d6c,_0x1cb227,_0x1dd6d2){io['to'](_0x5d9d6c)[_0x7d3e('0xe')](_0x1cb227,_0x1dd6d2);}function emitChannelQueueInteraction(_0x5ea419,_0x5a6b57,_0x589971,_0x342ced,_0x2983d9,_0x48c6e9,_0x3b7bf0,_0x1063d7){var _0x3dd748=_[_0x7d3e('0xf')](_0x589971);_0x3dd748['queue_id']=_0x1063d7;_0x3dd748[_0x7d3e('0xc')]=_0x5a6b57;_0x3dd748['account']=_0x342ced;_0x3dd748['id']=_0x2983d9;if(_0x48c6e9){_0x3b7bf0[util['format']('%sQueuesWaitingInteractions',_0x5ea419)][_0x2983d9]=_['pick'](_0x3dd748,attributes);}else{delete _0x3b7bf0[util[_0x7d3e('0x10')]('%sQueuesWaitingInteractions',_0x5ea419)][_0x2983d9];}emit(util[_0x7d3e('0x10')](_0x7d3e('0x11'),_0x5ea419,_0x5a6b57),util[_0x7d3e('0x10')](_0x7d3e('0x12'),_0x5ea419,_0x48c6e9?_0x7d3e('0x13'):'remove'),_['pick'](_0x3dd748,attributes));}var rpc={'openchannelQueueReport':require(_0x7d3e('0x14')),'mailQueueReport':require(_0x7d3e('0x15')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x7d3e('0x16')),'faxQueueReport':require(_0x7d3e('0x17')),'whatsappQueueReport':require(_0x7d3e('0x18'))};var queue=schema({'name':{'type':_0x7d3e('0x19'),'required':!![],'message':_0x7d3e('0x1a')},'timeout':{'type':_0x7d3e('0x1b'),'message':_0x7d3e('0x1c')}});function startRouting(_0x12f191,_0x4af715,_0x324222,_0x7e1129){if(_0x12f191&&_0x4af715&&_0x324222){_0x4af715[_0x7d3e('0x1d')]+=0x1;var _0x1fe449={'uniqueid':_0x12f191,'from':_0x324222[_0x7d3e('0x1e')]?_0x324222[_0x7d3e('0x1e')]['from']:'','joinAt':moment()[_0x7d3e('0x10')](_0x7d3e('0x1f')),'ContactId':_0x324222[_0x7d3e('0x20')]?_0x324222['contact']['id']:null,'ListId':_0x324222[_0x7d3e('0x21')]?_0x324222[_0x7d3e('0x21')]['id']:null};_0x1fe449[_[_0x7d3e('0x22')](_0x324222['channel'])+_0x7d3e('0x23')]=_0x4af715['id']||null;_0x1fe449[_['upperFirst'](_0x324222[_0x7d3e('0x24')])+_0x7d3e('0x25')]=_0x324222[_0x7d3e('0x26')]?_0x324222[_0x7d3e('0x26')]['id']:null;_0x1fe449[_['upperFirst'](_0x324222['channel'])+_0x7d3e('0x27')]=_0x324222[_0x7d3e('0x28')]?_0x324222[_0x7d3e('0x28')]['id']:null;_0x1fe449[_[_0x7d3e('0x22')](_0x324222['channel'])+(_0x324222[_0x7d3e('0x24')]!=='chat'?_0x7d3e('0x29'):_0x7d3e('0x2a'))]=_0x324222[_0x7d3e('0xb')]?_0x324222['account']['id']:null;logger[_0x7d3e('0x2b')](util[_0x7d3e('0x10')](_0x7d3e('0x2c'),_0x12f191,_0x4af715[_0x7d3e('0x2d')]));emitChannelQueueInteraction(_0x324222[_0x7d3e('0x24')],_0x4af715[_0x7d3e('0x2d')],_0x1fe449,_0x324222['account'][_0x7d3e('0x2d')],_0x324222['message']['id'],!![],_0x7e1129,_0x4af715['id']);if(rpc[_0x324222[_0x7d3e('0x24')]+_0x7d3e('0x2e')]){return rpc[_0x324222[_0x7d3e('0x24')]+_0x7d3e('0x2e')][_0x7d3e('0x2f')](_0x1fe449)[_0x7d3e('0x30')](function(_0x425174){logger['error'](_0x7d3e('0x31'));});}}}function stopRouting(_0x2cecd0,_0x492986,_0x42192d,_0x2a8572){if(_0x2cecd0&&_0x492986){_0x492986['waiting']-=0x1;var _0x22b4e6={'leaveAt':moment()[_0x7d3e('0x10')](_0x7d3e('0x1f')),'acceptAt':moment()[_0x7d3e('0x10')](_0x7d3e('0x1f')),'reason':_0x7d3e('0x32')};logger[_0x7d3e('0x2b')](util['format'](_0x7d3e('0x33'),_0x2cecd0,_0x492986[_0x7d3e('0x2d')]));emitChannelQueueInteraction(_0x42192d[_0x7d3e('0x24')],_0x492986[_0x7d3e('0x2d')],_0x42192d[_0x7d3e('0x1e')],_0x42192d[_0x7d3e('0xb')][_0x7d3e('0x2d')],_0x42192d[_0x7d3e('0x28')]['id'],![],_0x2a8572,_0x492986['id']);if(rpc[_0x42192d[_0x7d3e('0x24')]+_0x7d3e('0x2e')]){return rpc[_0x42192d[_0x7d3e('0x24')]+_0x7d3e('0x2e')]['update'](_0x2cecd0,_0x22b4e6)['catch'](function(_0x73f96a){logger['error'](_0x7d3e('0x34'));});}}}function endRouting(_0x36afc8,_0x10ec8b,_0x56531e,_0x4ec01c){if(_0x36afc8&&_0x10ec8b){_0x10ec8b['waiting']-=0x1;var _0x22bc1f={'leaveAt':moment()[_0x7d3e('0x10')](_0x7d3e('0x1f')),'exitAt':moment()[_0x7d3e('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x7d3e('0x35')};logger[_0x7d3e('0x2b')](util[_0x7d3e('0x10')]('[%s][END:QUEUE][NAME:%s]',_0x36afc8,_0x10ec8b[_0x7d3e('0x2d')]));emitChannelQueueInteraction(_0x56531e[_0x7d3e('0x24')],_0x10ec8b['name'],_0x56531e[_0x7d3e('0x1e')],_0x56531e[_0x7d3e('0xb')][_0x7d3e('0x2d')],_0x56531e[_0x7d3e('0x28')]['id'],![],_0x4ec01c);if(rpc[_0x56531e[_0x7d3e('0x24')]+'QueueReport']){return rpc[_0x56531e[_0x7d3e('0x24')]+_0x7d3e('0x2e')]['update'](_0x36afc8,_0x22bc1f)[_0x7d3e('0x30')](function(_0x25c0d0){logger[_0x7d3e('0x36')]('update\x20queue\x20report');});}}}function handleFindQueue(_0xd583ec){return function(_0x3ccfd6){return _0x3ccfd6['name']['toLowerCase']()===_0xd583ec['toLowerCase']();};}exports[_0x7d3e('0x37')]=function(_0x410868,_0x45d0f0,_0x1afdd4,_0x4b6f12){return function(_0x2a23f1){try{var _0x574a6b={'name':_0x45d0f0[0x0],'timeout':_0x45d0f0[0x1]};var _0x2808e9=queue[_0x7d3e('0x0')](_0x574a6b,{'typecast':!![]});if(_0x2808e9[_0x7d3e('0x38')]){logger[_0x7d3e('0x36')](_0x7d3e('0x39'),_0x410868,_[_0x7d3e('0x3a')](_0x2808e9,_0x7d3e('0x28'))[_0x7d3e('0x3b')](',\x20'));_0x2a23f1[_0x7d3e('0x3c')]();}else{var _0x252a1d=_['find'](_0x1afdd4[_0x4b6f12[_0x7d3e('0x24')]+_0x7d3e('0x3d')],handleFindQueue(_0x574a6b['name']));if(_0x252a1d){startRouting(_0x410868,_0x252a1d,_0x4b6f12,_0x1afdd4);var _0x3c1d57=(_0x252a1d['timeout']||0xa)*0x3e8;var _0x3ae4cf=(_0x574a6b['timeout']||0x14)*0x3e8;var _0x466cd3,_0xe1187a;if(_0x3c1d57>_0x3ae4cf){_0x3ae4cf=_0x3c1d57;}var _0x3d2888=seqqueue[_0x7d3e('0x3e')](_0x3c1d57);_0x3d2888['id']=_0x410868;_0x3d2888[_0x7d3e('0x3f')]=_0x3c1d57;_0x3d2888[_0x7d3e('0x40')]=_0x3ae4cf;_0x3d2888[_0x7d3e('0x24')]=_0x4b6f12[_0x7d3e('0x24')];_0x1afdd4[_0x7d3e('0x41')][_0x410868]['on'](_0x7d3e('0x42'),function(){logger['info']('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x410868);stopRouting(_0x410868,_0x252a1d,_0x4b6f12,_0x1afdd4);clearTimeout(_0x466cd3);_0x466cd3=undefined;_0x3d2888[_0x7d3e('0x43')](!![]);if(_0x1afdd4[_0x7d3e('0x41')][_0x410868]){delete _0x1afdd4[_0x7d3e('0x41')][_0x410868];}_0x2a23f1[_0x7d3e('0x3c')]();});_0x1afdd4[_0x7d3e('0x41')][_0x410868]['on'](_0x7d3e('0x44'),function(){if(_0x1afdd4[_0x7d3e('0x41')][_0x410868]){delete _0x1afdd4['rules'][_0x410868];}});_0x466cd3=setTimeout(function(){logger['info'](_0x7d3e('0x45'),_0x410868);endRouting(_0x410868,_0x252a1d,_0x4b6f12,_0x1afdd4);clearTimeout(_0x466cd3);_0x3d2888[_0x7d3e('0x43')](!![]);_0x2a23f1['next']();},_0x3ae4cf);switch(_0x252a1d[_0x7d3e('0x46')]){case _0x7d3e('0x47'):strategy[_0x7d3e('0x47')](_0x3d2888,_0x252a1d,_0x1afdd4,_0x4b6f12);break;default:strategy[_0x7d3e('0x48')](_0x3d2888,_0x252a1d,_0x1afdd4,_0x4b6f12);}}else{logger[_0x7d3e('0x36')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x410868,_0x574a6b['name']);_0x2a23f1['stop']();}}}catch(_0x373cb4){console[_0x7d3e('0x49')](_0x373cb4);logger[_0x7d3e('0x36')](_0x7d3e('0x39'),_0x410868,_0x373cb4[_0x7d3e('0x4a')]);_0x2a23f1[_0x7d3e('0x3c')]();}};}; \ No newline at end of file +var _0xa3de=['WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','error','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','join','find','createQueue','atimeout','qtimeout','rules','end','close','stop','complete','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util','moment','../../../../config/logger','routing','./strategy','redis','localhost','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','clone','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','waiting','body','contact','list','upperFirst','QueueId','channel','InteractionId','MessageId','message','chat','AccountId'];(function(_0x433dcc,_0x2ac9a9){var _0x1ff237=function(_0xfe5399){while(--_0xfe5399){_0x433dcc['push'](_0x433dcc['shift']());}};_0x1ff237(++_0x2ac9a9);}(_0xa3de,0x199));var _0xea3d=function(_0x252328,_0x4c22f0){_0x252328=_0x252328-0x0;var _0xaa85b7=_0xa3de[_0x252328];return _0xaa85b7;};'use strict';var schema=require(_0xea3d('0x0'));var _=require(_0xea3d('0x1'));var util=require(_0xea3d('0x2'));var seqqueue=require('seq-queue');var moment=require(_0xea3d('0x3'));var Redis=require('ioredis');var config=require('../../../../config/environment');var logger=require(_0xea3d('0x4'))(_0xea3d('0x5'));var strategy=require(_0xea3d('0x6'));config[_0xea3d('0x7')]=_['defaults'](config['redis'],{'host':_0xea3d('0x8'),'port':0x18eb});var io=require(_0xea3d('0x9'))(new Redis(config[_0xea3d('0x7')]));var attributes=['id',_0xea3d('0xa'),_0xea3d('0xb'),_0xea3d('0xc'),_0xea3d('0xd'),_0xea3d('0xe')];function emit(_0xe92c6e,_0xa070d4,_0x4e9440){io['to'](_0xe92c6e)[_0xea3d('0xf')](_0xa070d4,_0x4e9440);}function emitChannelQueueInteraction(_0x36f456,_0x31ee59,_0x32233e,_0x32188a,_0x544a51,_0x3e62da,_0x5518be,_0x4609ad){var _0x242f80=_[_0xea3d('0x10')](_0x32233e);_0x242f80[_0xea3d('0xa')]=_0x4609ad;_0x242f80[_0xea3d('0xc')]=_0x31ee59;_0x242f80[_0xea3d('0xb')]=_0x32188a;_0x242f80['id']=_0x544a51;if(_0x3e62da){_0x5518be[util[_0xea3d('0x11')](_0xea3d('0x12'),_0x36f456)][_0x544a51]=_[_0xea3d('0x13')](_0x242f80,attributes);}else{delete _0x5518be[util[_0xea3d('0x11')]('%sQueuesWaitingInteractions',_0x36f456)][_0x544a51];}emit(util[_0xea3d('0x11')](_0xea3d('0x14'),_0x36f456,_0x31ee59),util[_0xea3d('0x11')](_0xea3d('0x15'),_0x36f456,_0x3e62da?_0xea3d('0x16'):_0xea3d('0x17')),_[_0xea3d('0x13')](_0x242f80,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0xea3d('0x18')),'smsQueueReport':require(_0xea3d('0x19')),'faxQueueReport':require(_0xea3d('0x1a')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':'string','required':!![],'message':_0xea3d('0x1b')},'timeout':{'type':'number','message':_0xea3d('0x1c')}});function startRouting(_0x2a18a7,_0x85bcc7,_0x51e053,_0x1af60b){if(_0x2a18a7&&_0x85bcc7&&_0x51e053){_0x85bcc7[_0xea3d('0x1d')]+=0x1;var _0x10fa96={'uniqueid':_0x2a18a7,'from':_0x51e053[_0xea3d('0x1e')]?_0x51e053[_0xea3d('0x1e')][_0xea3d('0xd')]:'','joinAt':moment()[_0xea3d('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x51e053[_0xea3d('0x1f')]?_0x51e053['contact']['id']:null,'ListId':_0x51e053[_0xea3d('0x20')]?_0x51e053[_0xea3d('0x20')]['id']:null};_0x10fa96[_[_0xea3d('0x21')](_0x51e053['channel'])+_0xea3d('0x22')]=_0x85bcc7['id']||null;_0x10fa96[_[_0xea3d('0x21')](_0x51e053[_0xea3d('0x23')])+_0xea3d('0x24')]=_0x51e053['interaction']?_0x51e053['interaction']['id']:null;_0x10fa96[_[_0xea3d('0x21')](_0x51e053['channel'])+_0xea3d('0x25')]=_0x51e053[_0xea3d('0x26')]?_0x51e053[_0xea3d('0x26')]['id']:null;_0x10fa96[_[_0xea3d('0x21')](_0x51e053[_0xea3d('0x23')])+(_0x51e053[_0xea3d('0x23')]!==_0xea3d('0x27')?_0xea3d('0x28'):_0xea3d('0x29'))]=_0x51e053['account']?_0x51e053[_0xea3d('0xb')]['id']:null;logger[_0xea3d('0x2a')](util[_0xea3d('0x11')](_0xea3d('0x2b'),_0x2a18a7,_0x85bcc7[_0xea3d('0x2c')]));emitChannelQueueInteraction(_0x51e053[_0xea3d('0x23')],_0x85bcc7[_0xea3d('0x2c')],_0x10fa96,_0x51e053[_0xea3d('0xb')][_0xea3d('0x2c')],_0x51e053[_0xea3d('0x26')]['id'],!![],_0x1af60b,_0x85bcc7['id']);if(rpc[_0x51e053[_0xea3d('0x23')]+_0xea3d('0x2d')]){return rpc[_0x51e053[_0xea3d('0x23')]+'QueueReport'][_0xea3d('0x2e')](_0x10fa96)[_0xea3d('0x2f')](function(_0x214482){logger['error'](_0xea3d('0x30'));});}}}function stopRouting(_0x66deed,_0x5d6811,_0xb245d5,_0x180bff){if(_0x66deed&&_0x5d6811){_0x5d6811[_0xea3d('0x1d')]-=0x1;var _0x41a140={'leaveAt':moment()[_0xea3d('0x11')](_0xea3d('0x31')),'acceptAt':moment()[_0xea3d('0x11')](_0xea3d('0x31')),'reason':_0xea3d('0x32')};logger[_0xea3d('0x2a')](util['format'](_0xea3d('0x33'),_0x66deed,_0x5d6811[_0xea3d('0x2c')]));emitChannelQueueInteraction(_0xb245d5['channel'],_0x5d6811[_0xea3d('0x2c')],_0xb245d5[_0xea3d('0x1e')],_0xb245d5[_0xea3d('0xb')][_0xea3d('0x2c')],_0xb245d5[_0xea3d('0x26')]['id'],![],_0x180bff,_0x5d6811['id']);if(rpc[_0xb245d5[_0xea3d('0x23')]+_0xea3d('0x2d')]){return rpc[_0xb245d5[_0xea3d('0x23')]+'QueueReport'][_0xea3d('0x34')](_0x66deed,_0x41a140)[_0xea3d('0x2f')](function(_0xbfa186){logger['error'](_0xea3d('0x35'));});}}}function endRouting(_0x1fb12,_0x1d63e8,_0x5602e8,_0x1585f7){if(_0x1fb12&&_0x1d63e8){_0x1d63e8['waiting']-=0x1;var _0x526fe9={'leaveAt':moment()['format'](_0xea3d('0x31')),'exitAt':moment()[_0xea3d('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xea3d('0x36')};logger[_0xea3d('0x2a')](util[_0xea3d('0x11')]('[%s][END:QUEUE][NAME:%s]',_0x1fb12,_0x1d63e8['name']));emitChannelQueueInteraction(_0x5602e8[_0xea3d('0x23')],_0x1d63e8[_0xea3d('0x2c')],_0x5602e8[_0xea3d('0x1e')],_0x5602e8['account'][_0xea3d('0x2c')],_0x5602e8['message']['id'],![],_0x1585f7);if(rpc[_0x5602e8[_0xea3d('0x23')]+_0xea3d('0x2d')]){return rpc[_0x5602e8[_0xea3d('0x23')]+_0xea3d('0x2d')]['update'](_0x1fb12,_0x526fe9)[_0xea3d('0x2f')](function(_0xc3d6f6){logger[_0xea3d('0x37')](_0xea3d('0x35'));});}}}function handleFindQueue(_0x432b8a){return function(_0x38ec53){return _0x38ec53[_0xea3d('0x2c')][_0xea3d('0x38')]()===_0x432b8a[_0xea3d('0x38')]();};}exports[_0xea3d('0x39')]=function(_0x45748e,_0x1a8eb2,_0x11ffaa,_0x17d2d2){return function(_0x53e7fb){try{var _0x2dcd53={'name':_0x1a8eb2[0x0],'timeout':_0x1a8eb2[0x1]};var _0x5d6203=queue[_0xea3d('0x0')](_0x2dcd53,{'typecast':!![]});if(_0x5d6203[_0xea3d('0x3a')]){logger['error'](_0xea3d('0x3b'),_0x45748e,_['map'](_0x5d6203,'message')[_0xea3d('0x3c')](',\x20'));_0x53e7fb['stop']();}else{var _0x4877ad=_[_0xea3d('0x3d')](_0x11ffaa[_0x17d2d2['channel']+'Queues'],handleFindQueue(_0x2dcd53[_0xea3d('0x2c')]));if(_0x4877ad){startRouting(_0x45748e,_0x4877ad,_0x17d2d2,_0x11ffaa);var _0x57ae8b=(_0x4877ad['timeout']||0xa)*0x3e8;var _0x121d72=(_0x2dcd53[_0xea3d('0x36')]||0x14)*0x3e8;var _0x38f64b,_0x2580f3;if(_0x57ae8b>_0x121d72){_0x121d72=_0x57ae8b;}var _0x540306=seqqueue[_0xea3d('0x3e')](_0x57ae8b);_0x540306['id']=_0x45748e;_0x540306[_0xea3d('0x3f')]=_0x57ae8b;_0x540306[_0xea3d('0x40')]=_0x121d72;_0x540306['channel']=_0x17d2d2['channel'];_0x11ffaa[_0xea3d('0x41')][_0x45748e]['on'](_0xea3d('0x42'),function(){logger[_0xea3d('0x2a')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x45748e);stopRouting(_0x45748e,_0x4877ad,_0x17d2d2,_0x11ffaa);clearTimeout(_0x38f64b);_0x38f64b=undefined;_0x540306[_0xea3d('0x43')](!![]);if(_0x11ffaa[_0xea3d('0x41')][_0x45748e]){delete _0x11ffaa[_0xea3d('0x41')][_0x45748e];}_0x53e7fb[_0xea3d('0x44')]();});_0x11ffaa[_0xea3d('0x41')][_0x45748e]['on'](_0xea3d('0x45'),function(){if(_0x11ffaa[_0xea3d('0x41')][_0x45748e]){delete _0x11ffaa[_0xea3d('0x41')][_0x45748e];}});_0x38f64b=setTimeout(function(){logger[_0xea3d('0x2a')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x45748e);endRouting(_0x45748e,_0x4877ad,_0x17d2d2,_0x11ffaa);clearTimeout(_0x38f64b);_0x540306[_0xea3d('0x43')](!![]);_0x53e7fb['next']();},_0x121d72);switch(_0x4877ad[_0xea3d('0x46')]){case _0xea3d('0x47'):strategy[_0xea3d('0x47')](_0x540306,_0x4877ad,_0x11ffaa,_0x17d2d2);break;default:strategy['beepall'](_0x540306,_0x4877ad,_0x11ffaa,_0x17d2d2);}}else{logger[_0xea3d('0x37')](_0xea3d('0x48'),_0x45748e,_0x2dcd53[_0xea3d('0x2c')]);_0x53e7fb['stop']();}}}catch(_0x48ef3f){console[_0xea3d('0x49')](_0x48ef3f);logger[_0xea3d('0x37')]('[%s][QUEUE]\x20%s',_0x45748e,_0x48ef3f[_0xea3d('0x4a')]);_0x53e7fb[_0xea3d('0x44')]();}};}; \ 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 33b6eda..58017ff 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 _0x5f09=['agents','forcedOwnership','isAgentAvailable','busy','busyQueue','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','prototype','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','STOP','TIMEOUT','exports','uuid','./util','routing','notificationId','squeue','agent','realtime','push','handleRun','bind','handleTimeout','drained','handleDrained','info','[%s][AGENT]\x20try\x20with\x20%s','isNil'];(function(_0x160539,_0x430d0){var _0x2cf39a=function(_0x2f7ba3){while(--_0x2f7ba3){_0x160539['push'](_0x160539['shift']());}};_0x2cf39a(++_0x430d0);}(_0x5f09,0x8b));var _0x95f0=function(_0x21e54a,_0xc8f99a){_0x21e54a=_0x21e54a-0x0;var _0xb00f81=_0x5f09[_0x21e54a];return _0xb00f81;};'use strict';var _=require('lodash');var uuid=require(_0x95f0('0x0'));var util=require(_0x95f0('0x1'));var logger=require('../../../../../config/logger')(_0x95f0('0x2'));var Agent=function(_0x4eba1c,_0x4f8e06,_0x5eb6b9,_0x1e7649){this[_0x95f0('0x3')]=uuid['v4']();this[_0x95f0('0x4')]=_0x4eba1c;this[_0x95f0('0x5')]=_0x4f8e06;this[_0x95f0('0x6')]=_0x5eb6b9;this['routing']=_0x1e7649;this[_0x95f0('0x4')][_0x95f0('0x7')](this[_0x95f0('0x8')][_0x95f0('0x9')](this),this[_0x95f0('0xa')][_0x95f0('0x9')](this));this[_0x95f0('0x4')]['on']('timeout',this[_0x95f0('0xa')][_0x95f0('0x9')](this));this[_0x95f0('0x4')]['on'](_0x95f0('0xb'),this[_0x95f0('0xc')][_0x95f0('0x9')](this));};Agent['prototype']['push']=function(){this['squeue'][_0x95f0('0x7')](this[_0x95f0('0x8')][_0x95f0('0x9')](this),this[_0x95f0('0xa')][_0x95f0('0x9')](this));};Agent['prototype'][_0x95f0('0xc')]=function(){this[_0x95f0('0xa')](!![]);};Agent['prototype'][_0x95f0('0x8')]=function(_0x3d2d8a){logger[_0x95f0('0xd')](_0x95f0('0xe'),this[_0x95f0('0x4')]['id'],this['agent']['id']);if(_[_0x95f0('0xf')](this[_0x95f0('0x6')][_0x95f0('0x10')][this['agent']['id']])){logger['info']('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x95f0('0x4')]['id'],this['agent']['id']);setTimeout(this['push'][_0x95f0('0x9')](this),0x3e8);}else{if(this[_0x95f0('0x2')][_0x95f0('0x11')]||util[_0x95f0('0x12')](this[_0x95f0('0x4')]['id'],this[_0x95f0('0x6')]['agents'][this[_0x95f0('0x5')]['id']],this['squeue']['channel'],![])){this['realtime'][_0x95f0('0x10')][this[_0x95f0('0x5')]['id']][_0x95f0('0x13')]=!![];this[_0x95f0('0x6')][_0x95f0('0x10')][this[_0x95f0('0x5')]['id']][_0x95f0('0x14')]=undefined;util['showNotification'](this[_0x95f0('0x3')],this['squeue']['id'],this['realtime'][_0x95f0('0x10')][this[_0x95f0('0x5')]['id']],null,this[_0x95f0('0x2')]);util[_0x95f0('0x15')](this[_0x95f0('0x4')]['id'],this['realtime'][_0x95f0('0x10')][this[_0x95f0('0x5')]['id']],_0x95f0('0x16')+(this[_0x95f0('0x2')][_0x95f0('0x11')]?_0x95f0('0x17'):''));}else{logger[_0x95f0('0xd')](_0x95f0('0x18'),this[_0x95f0('0x4')]['id'],this[_0x95f0('0x5')]['id']);setTimeout(this[_0x95f0('0x7')]['bind'](this),0x3e8);}}};Agent[_0x95f0('0x19')][_0x95f0('0xa')]=function(_0x7cbe14){if(_['isNil'](this[_0x95f0('0x6')][_0x95f0('0x10')][this[_0x95f0('0x5')]['id']])){return logger[_0x95f0('0xd')](_0x95f0('0x1a'),this[_0x95f0('0x4')]['id'],this[_0x95f0('0x5')]['id']);}else{logger[_0x95f0('0xd')](_0x95f0('0x1b'),this[_0x95f0('0x4')]['id'],this[_0x95f0('0x5')]['id']);util['hideNotification'](this[_0x95f0('0x3')],this[_0x95f0('0x4')]['id'],this[_0x95f0('0x6')][_0x95f0('0x10')][this[_0x95f0('0x5')]['id']],null,this['routing']);this[_0x95f0('0x6')][_0x95f0('0x10')][this[_0x95f0('0x5')]['id']][_0x95f0('0x13')]=![];this[_0x95f0('0x6')][_0x95f0('0x10')][this[_0x95f0('0x5')]['id']]['busyQueue']=undefined;util[_0x95f0('0x15')](this[_0x95f0('0x4')]['id'],this['realtime'][_0x95f0('0x10')][this['agent']['id']],_0x7cbe14?_0x95f0('0x1c'):_0x95f0('0x1d'));}if(!_0x7cbe14){setTimeout(this[_0x95f0('0x7')]['bind'](this),0x3e8);}};function agent(_0x1c18a8,_0x370867,_0x25917b,_0x221c36){return new Agent(_0x1c18a8,_0x370867,_0x25917b,_0x221c36);}module[_0x95f0('0x1e')]=agent; \ No newline at end of file +var _0xf5f6=['[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','push','bind','handleTimeout','drained','handleDrained','prototype','handleRun','debug','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','realtime','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','agents','channel','busy','busyQueue','showNotification','writeLog',':FORCED'];(function(_0x209040,_0xd89790){var _0x32f5b9=function(_0x310cab){while(--_0x310cab){_0x209040['push'](_0x209040['shift']());}};_0x32f5b9(++_0xd89790);}(_0xf5f6,0x84));var _0x6f5f=function(_0xa09a6a,_0x57c144){_0xa09a6a=_0xa09a6a-0x0;var _0x22a46d=_0xf5f6[_0xa09a6a];return _0x22a46d;};'use strict';var _=require(_0x6f5f('0x0'));var uuid=require(_0x6f5f('0x1'));var util=require(_0x6f5f('0x2'));var logger=require(_0x6f5f('0x3'))(_0x6f5f('0x4'));var Agent=function(_0x37e26f,_0x5da6fd,_0x1d4811,_0x2c9868){this[_0x6f5f('0x5')]=uuid['v4']();this[_0x6f5f('0x6')]=_0x37e26f;this['agent']=_0x5da6fd;this['realtime']=_0x1d4811;this['routing']=_0x2c9868;this[_0x6f5f('0x6')][_0x6f5f('0x7')](this['handleRun'][_0x6f5f('0x8')](this),this[_0x6f5f('0x9')]['bind'](this));this[_0x6f5f('0x6')]['on']('timeout',this['handleTimeout'][_0x6f5f('0x8')](this));this[_0x6f5f('0x6')]['on'](_0x6f5f('0xa'),this[_0x6f5f('0xb')][_0x6f5f('0x8')](this));};Agent[_0x6f5f('0xc')]['push']=function(){this[_0x6f5f('0x6')][_0x6f5f('0x7')](this[_0x6f5f('0xd')]['bind'](this),this['handleTimeout'][_0x6f5f('0x8')](this));};Agent[_0x6f5f('0xc')][_0x6f5f('0xb')]=function(){this[_0x6f5f('0x9')](!![]);};Agent[_0x6f5f('0xc')]['handleRun']=function(){logger[_0x6f5f('0xe')](_0x6f5f('0xf'),this[_0x6f5f('0x6')]['id'],this[_0x6f5f('0x10')]['id']);if(_[_0x6f5f('0x11')](this[_0x6f5f('0x12')]['agents'][this['agent']['id']])){logger[_0x6f5f('0xe')](_0x6f5f('0x13'),this[_0x6f5f('0x6')]['id'],this[_0x6f5f('0x10')]['id']);setTimeout(this[_0x6f5f('0x7')]['bind'](this),0x3e8);}else{if(this[_0x6f5f('0x4')]['forcedOwnership']||util[_0x6f5f('0x14')](this[_0x6f5f('0x6')]['id'],this['realtime'][_0x6f5f('0x15')][this[_0x6f5f('0x10')]['id']],this[_0x6f5f('0x6')][_0x6f5f('0x16')],![])){this[_0x6f5f('0x12')][_0x6f5f('0x15')][this[_0x6f5f('0x10')]['id']][_0x6f5f('0x17')]=!![];this[_0x6f5f('0x12')][_0x6f5f('0x15')][this[_0x6f5f('0x10')]['id']][_0x6f5f('0x18')]=undefined;util[_0x6f5f('0x19')](this['notificationId'],this['squeue']['id'],this['realtime'][_0x6f5f('0x15')][this[_0x6f5f('0x10')]['id']],null,this[_0x6f5f('0x4')]);util[_0x6f5f('0x1a')](this[_0x6f5f('0x6')]['id'],this[_0x6f5f('0x12')]['agents'][this[_0x6f5f('0x10')]['id']],'RINGING'+(this[_0x6f5f('0x4')]['forcedOwnership']?_0x6f5f('0x1b'):''));}else{logger[_0x6f5f('0xe')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x6f5f('0x6')]['id'],this[_0x6f5f('0x10')]['id']);setTimeout(this[_0x6f5f('0x7')][_0x6f5f('0x8')](this),0x3e8);}}};Agent['prototype'][_0x6f5f('0x9')]=function(_0x51fb2c){if(_[_0x6f5f('0x11')](this[_0x6f5f('0x12')][_0x6f5f('0x15')][this[_0x6f5f('0x10')]['id']])){return logger['debug'](_0x6f5f('0x13'),this['squeue']['id'],this['agent']['id']);}else{logger[_0x6f5f('0xe')](_0x6f5f('0x1c'),this['squeue']['id'],this['agent']['id']);util[_0x6f5f('0x1d')](this[_0x6f5f('0x5')],this[_0x6f5f('0x6')]['id'],this[_0x6f5f('0x12')][_0x6f5f('0x15')][this['agent']['id']],null,this['routing']);this[_0x6f5f('0x12')][_0x6f5f('0x15')][this['agent']['id']][_0x6f5f('0x17')]=![];this[_0x6f5f('0x12')][_0x6f5f('0x15')][this[_0x6f5f('0x10')]['id']][_0x6f5f('0x18')]=undefined;util[_0x6f5f('0x1a')](this[_0x6f5f('0x6')]['id'],this['realtime']['agents'][this[_0x6f5f('0x10')]['id']],_0x51fb2c?_0x6f5f('0x1e'):'TIMEOUT');}if(!_0x51fb2c){setTimeout(this['push'][_0x6f5f('0x8')](this),0x3e8);}};function agent(_0x4430af,_0x522e32,_0x223cf4,_0x4fb0e9){return new Agent(_0x4430af,_0x522e32,_0x223cf4,_0x4fb0e9);}module[_0x6f5f('0x1f')]=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index 0025c1d..ff7bedf 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 _0xa2c8=['handleDrained','prototype','push','isNil','Agents','length','agents','info','channel','writeLog','RINGING','busyQueue','name','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','notificationId','STOP','TIMEOUT','busy','lodash','uuid','./util','../../../../../config/logger','routing','queue','realtime','squeue','handleRun','bind','handleTimeout','drained'];(function(_0x350ca8,_0x5530a8){var _0x194742=function(_0x3277a9){while(--_0x3277a9){_0x350ca8['push'](_0x350ca8['shift']());}};_0x194742(++_0x5530a8);}(_0xa2c8,0x99));var _0x8a2c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa2c8[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x8a2c('0x0'));var uuid=require(_0x8a2c('0x1'));var util=require(_0x8a2c('0x2'));var logger=require(_0x8a2c('0x3'))(_0x8a2c('0x4'));var Beepall=function(_0x67da9d,_0x48d4f9,_0x1b1142,_0x590508){this['notificationId']=uuid['v4']();this['squeue']=_0x67da9d;this[_0x8a2c('0x5')]=_0x48d4f9;this[_0x8a2c('0x6')]=_0x1b1142;this[_0x8a2c('0x4')]=_0x590508;this[_0x8a2c('0x7')]['push'](this[_0x8a2c('0x8')][_0x8a2c('0x9')](this),this[_0x8a2c('0xa')]['bind'](this));this['squeue']['on']('timeout',this[_0x8a2c('0xa')][_0x8a2c('0x9')](this));this['squeue']['on'](_0x8a2c('0xb'),this[_0x8a2c('0xc')][_0x8a2c('0x9')](this));};Beepall[_0x8a2c('0xd')][_0x8a2c('0xe')]=function(){this[_0x8a2c('0x7')]['push'](this[_0x8a2c('0x8')][_0x8a2c('0x9')](this),this['handleTimeout'][_0x8a2c('0x9')](this));};Beepall[_0x8a2c('0xd')]['handleDrained']=function(_0x5a1fa7){this['handleTimeout'](!![]);};Beepall['prototype'][_0x8a2c('0x8')]=function(_0x16c114){var _0x30b3c2=!![];if(!_['isNil'](this['queue'])&&!_[_0x8a2c('0xf')](this[_0x8a2c('0x5')][_0x8a2c('0x10')])&&this[_0x8a2c('0x5')][_0x8a2c('0x10')][_0x8a2c('0x11')]>0x0){for(var _0x3d82a5=0x0,_0x3e18f1;_0x3d82a50x0){for(var _0x333868=0x0,_0x2365ea;_0x3338680x0&&_0x30734f[_0x50951f+_0x5b14('0x1e')]>=_0x30734f[_0x50951f+_0x5b14('0x1f')]){writeLog(_0x2d7b38,_0x30734f,_0x50951f[_0x5b14('0x20')]()+_0x5b14('0x21'));return![];}}return!![];};exports[_0x5b14('0x22')]=function(_0x296d65,_0x4e9609,_0xbe39bc,_0x1ab33f,_0x1c3c52){return sendNotification(!![],_0x296d65,_0x4e9609,_0xbe39bc,_0x1ab33f,_0x1c3c52);};exports[_0x5b14('0x23')]=function(_0x4cfd66,_0x370fcd,_0x18a76d,_0x53b13d,_0x4ecf7c){return sendNotification(![],_0x4cfd66,_0x370fcd,_0x18a76d,_0x53b13d,_0x4ecf7c);};exports[_0x5b14('0x24')]=writeLog; \ No newline at end of file +var _0x207c=['hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','writeLog','util','../utils','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','format','name','emit','user:save','split','account','notificationShake','body','queue','msg','getMustacheRender','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','user:%s','save','remove','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','online','OFFLINE','Pause','PAUSE'];(function(_0x355fdc,_0x1d9886){var _0x3fe99a=function(_0x34ee99){while(--_0x34ee99){_0x355fdc['push'](_0x355fdc['shift']());}};_0x3fe99a(++_0x1d9886);}(_0x207c,0x1e8));var _0xc207=function(_0x19a21c,_0x4e03f8){_0x19a21c=_0x19a21c-0x0;var _0x3e9b9f=_0x207c[_0x19a21c];return _0x3e9b9f;};'use strict';var _=require('lodash');var util=require(_0xc207('0x0'));var utils=require(_0xc207('0x1'));var Redis=require(_0xc207('0x2'));var config=require(_0xc207('0x3'));var logger=require(_0xc207('0x4'))(_0xc207('0x5'));config[_0xc207('0x6')]=_['defaults'](config[_0xc207('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function sendNotification(_0xc88789,_0x314561,_0x3395e4,_0x59ff6f,_0x25cb97,_0xad159b){io['to'](util[_0xc207('0x7')]('user:%s',_0x59ff6f[_0xc207('0x8')]))[_0xc207('0x9')](_0xc207('0xa'),_0x59ff6f);var _0x13ec41=_0xad159b||{};var _0x201162=_0x3395e4[_0xc207('0xb')]('.');var _0x487d95={'uniqueid':_0x314561,'channel':_0x201162[0x0],'id':_0x201162[0x1],'title':_0x201162[0x0]+'\x20interaction','interactionId':_0x201162[0x2],'queue':_0x25cb97?_0x25cb97['name']:null,'sound':_0x13ec41[_0xc207('0xc')]['notificationSound'],'shake':_0x13ec41[_0xc207('0xc')][_0xc207('0xd')]};try{if(!_0x13ec41['body']){_0x13ec41[_0xc207('0xe')]={};}if(_0x25cb97){_0x13ec41[_0xc207('0xe')][_0xc207('0xf')]=_0x25cb97;}else if(_0x13ec41[_0xc207('0xe')][_0xc207('0xf')]){delete _0x13ec41['body'][_0xc207('0xf')];}_0x487d95[_0xc207('0x10')]=utils[_0xc207('0x11')](_0x13ec41[_0xc207('0xc')]['notificationTemplate'],_0x13ec41);}catch(_0x564cef){_0x487d95['msg']=_0xc207('0x12');logger[_0xc207('0x13')](util[_0xc207('0x7')](_0xc207('0x14'),_0x314561,_0x564cef['message']));}io['to'](util[_0xc207('0x7')](_0xc207('0x15'),_0x59ff6f[_0xc207('0x8')]))['emit'](util[_0xc207('0x7')]('notification:%s',_0xc88789?_0xc207('0x16'):_0xc207('0x17')),_0x487d95);}function writeLog(_0x131dc8,_0x461f6a,_0xce0770){return logger[_0xc207('0x18')](util[_0xc207('0x7')](_0xc207('0x19'),_0x131dc8,_0x461f6a[_0xc207('0x8')],_0xce0770));}exports[_0xc207('0x1a')]=function(_0x3112ff,_0xe227a,_0x40de25,_0x4b52a7){if(_0xe227a[_0xc207('0x1b')]){writeLog(_0x3112ff,_0xe227a,'BUSY');return![];}if(!_0xe227a[_0xc207('0x1c')]){writeLog(_0x3112ff,_0xe227a,_0xc207('0x1d'));return![];}if(_0xe227a[_0x40de25+_0xc207('0x1e')]){writeLog(_0x3112ff,_0xe227a,_0xc207('0x1f'));return![];}if(_0x4b52a7&&_0xe227a[_0xc207('0x20')](_0x40de25+_0xc207('0x21'))&&_0xe227a[_0xc207('0x20')](_0x40de25+_0xc207('0x22'))){if(_0xe227a[_0x40de25+_0xc207('0x21')]>0x0&&_0xe227a[_0x40de25+_0xc207('0x22')]>=_0xe227a[_0x40de25+_0xc207('0x21')]){writeLog(_0x3112ff,_0xe227a,_0x40de25[_0xc207('0x23')]()+_0xc207('0x24'));return![];}}return!![];};exports[_0xc207('0x25')]=function(_0x1445d3,_0x56a066,_0x1e1440,_0x5e0bd1,_0x4cb3af){return sendNotification(!![],_0x1445d3,_0x56a066,_0x1e1440,_0x5e0bd1,_0x4cb3af);};exports[_0xc207('0x26')]=function(_0x3a05f3,_0x2e41b1,_0x2057ff,_0x6a653d,_0x478af7){return sendNotification(![],_0x3a05f3,_0x2e41b1,_0x2057ff,_0x6a653d,_0x478af7);};exports[_0xc207('0x27')]=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 85b51a9..dc4db5a 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 _0x57fa=['exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','next','[%s][SYSTEM]\x20%s','stringify','shelljs','./utils','../../../../config/logger','routing','consequence','validate','error','message','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','getMustacheRender','info','[%s][SYSTEM]\x20commnad:\x20%s'];(function(_0x556ebb,_0x20b2eb){var _0x11ba5d=function(_0x45a379){while(--_0x45a379){_0x556ebb['push'](_0x556ebb['shift']());}};_0x11ba5d(++_0x20b2eb);}(_0x57fa,0x7e));var _0xa57f=function(_0x3b1f3d,_0x323833){_0x3b1f3d=_0x3b1f3d-0x0;var _0x408aa2=_0x57fa[_0x3b1f3d];return _0x408aa2;};'use strict';var schema=require('validate');var sh=require(_0xa57f('0x0'));var _=require('lodash');var utils=require(_0xa57f('0x1'));var logger=require(_0xa57f('0x2'))(_0xa57f('0x3'));var system=schema({'command':{'type':'string','required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xa57f('0x4')]=function(_0x435090,_0x243f88){return function(_0x3c3a36){try{var _0x1e7bc8={'command':_0x243f88[0x0]};var _0x4d12eb=system[_0xa57f('0x5')](_0x1e7bc8,{'typecast':!![]});if(_0x4d12eb['length']){logger[_0xa57f('0x6')]('[%s][SYSTEM]\x20%s',_0x435090,_['map'](_0x4d12eb,_0xa57f('0x7'))['join'](',\x20'));logger['info'](_0xa57f('0x8'),_0x435090);_0x3c3a36['next']();}else{var _0x1bef1e=this;var _0xeb4622=utils[_0xa57f('0x9')](_0x243f88[0x0],this);logger[_0xa57f('0xa')](_0xa57f('0xb'),_0x435090,_0xeb4622);sh[_0xa57f('0xc')](_[_0xa57f('0xd')](_0xeb4622),function(_0x2c471c,_0x36f576){logger[_0xa57f('0xa')](_0xa57f('0xe'),_0x435090,_0x2c471c);if(_0x2c471c==0x0){var _0x5370ac=_0x36f576['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0xa57f('0xf')](_0x243f88[0x1])||_[_0xa57f('0x10')](_0x243f88[0x1])){logger[_0xa57f('0xa')](_0xa57f('0x11'),_0x435090);_0x1bef1e['body'][_0x243f88[0x1]]=_0x5370ac;}else{logger['info'](_0xa57f('0x12'),_0x435090,_0x243f88[0x1],_0x5370ac);_0x1bef1e[_0xa57f('0x13')][_0x243f88[0x1]]=_0x5370ac;}}_0x3c3a36[_0xa57f('0x14')]();});}}catch(_0x3b7ab1){logger[_0xa57f('0x6')](_0xa57f('0x15'),_0x435090,_['isObject'](_0x3b7ab1)?JSON[_0xa57f('0x16')](_0x3b7ab1):_0x3b7ab1);logger['info'](_0xa57f('0x8'),_0x435090);_0x3c3a36[_0xa57f('0x14')]();}};}; \ No newline at end of file +var _0x88ce=['[%s][SYSTEM]\x20no\x20variable','body','isObject','shelljs','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','error','[%s][SYSTEM]\x20%s','map','join','next','getMustacheRender','info','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isEmpty'];(function(_0x2543eb,_0x4d3fe3){var _0x1decae=function(_0x40c19d){while(--_0x40c19d){_0x2543eb['push'](_0x2543eb['shift']());}};_0x1decae(++_0x4d3fe3);}(_0x88ce,0xab));var _0xe88c=function(_0x14a281,_0x4501aa){_0x14a281=_0x14a281-0x0;var _0x33cec7=_0x88ce[_0x14a281];return _0x33cec7;};'use strict';var schema=require('validate');var sh=require(_0xe88c('0x0'));var _=require('lodash');var utils=require(_0xe88c('0x1'));var logger=require(_0xe88c('0x2'))(_0xe88c('0x3'));var system=schema({'command':{'type':_0xe88c('0x4'),'required':!![],'message':_0xe88c('0x5')}});exports[_0xe88c('0x6')]=function(_0x4ee32d,_0x18b2b2){return function(_0x2945d8){try{var _0x8af413={'command':_0x18b2b2[0x0]};var _0x422448=system[_0xe88c('0x7')](_0x8af413,{'typecast':!![]});if(_0x422448['length']){logger[_0xe88c('0x8')](_0xe88c('0x9'),_0x4ee32d,_[_0xe88c('0xa')](_0x422448,'message')[_0xe88c('0xb')](',\x20'));logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x4ee32d);_0x2945d8[_0xe88c('0xc')]();}else{var _0x47ebc5=this;var _0x161e2d=utils[_0xe88c('0xd')](_0x18b2b2[0x0],this);logger[_0xe88c('0xe')](_0xe88c('0xf'),_0x4ee32d,_0x161e2d);sh[_0xe88c('0x10')](_[_0xe88c('0x11')](_0x161e2d),function(_0x432db1,_0x1aae6f){logger[_0xe88c('0xe')](_0xe88c('0x12'),_0x4ee32d,_0x432db1);if(_0x432db1==0x0){var _0x5eec62=_0x1aae6f[_0xe88c('0x13')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x18b2b2[0x1])||_[_0xe88c('0x14')](_0x18b2b2[0x1])){logger['info'](_0xe88c('0x15'),_0x4ee32d);_0x47ebc5[_0xe88c('0x16')][_0x18b2b2[0x1]]=_0x5eec62;}else{logger[_0xe88c('0xe')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x4ee32d,_0x18b2b2[0x1],_0x5eec62);_0x47ebc5[_0xe88c('0x16')][_0x18b2b2[0x1]]=_0x5eec62;}}_0x2945d8[_0xe88c('0xc')]();});}}catch(_0x94ece4){logger[_0xe88c('0x8')]('[%s][SYSTEM]\x20%s',_0x4ee32d,_[_0xe88c('0x17')](_0x94ece4)?JSON['stringify'](_0x94ece4):_0x94ece4);logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x4ee32d);_0x2945d8['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 1c7e32a..e61d69b 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 _0x6eab=['number','consequence','length','error','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','then','catch','[%s][TAG]\x20%s','stringify','validate','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','routing'];(function(_0x38dbf1,_0x35dada){var _0xa01245=function(_0x447ecf){while(--_0x447ecf){_0x38dbf1['push'](_0x38dbf1['shift']());}};_0xa01245(++_0x35dada);}(_0x6eab,0x1af));var _0xb6ea=function(_0x2dea58,_0x59d6f0){_0x2dea58=_0x2dea58-0x0;var _0x2b23c2=_0x6eab[_0x2dea58];return _0x2b23c2;};'use strict';var schema=require(_0xb6ea('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0xb6ea('0x1')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xb6ea('0x2')),'faxInteraction':require(_0xb6ea('0x3')),'whatsappInteraction':require(_0xb6ea('0x4'))};var logger=require('../../../../config/logger')(_0xb6ea('0x5'));var tag=schema({'tag':{'type':_0xb6ea('0x6'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xb6ea('0x7')]=function(_0x4a41ad,_0x21d3f4,_0x2212cd,_0x575a2e){return function(_0x25e834){try{var _0x1834d1={'tag':_0x21d3f4[0x0]};var _0x661016=tag['validate'](_0x1834d1,{'typecast':!![]});if(_0x661016[_0xb6ea('0x8')]){logger[_0xb6ea('0x9')]('[%s][TAG]\x20%s',_0x4a41ad,_[_0xb6ea('0xa')](_0x661016,_0xb6ea('0xb'))[_0xb6ea('0xc')](',\x20'));logger[_0xb6ea('0xd')](_0xb6ea('0xe'),_0x4a41ad);_0x25e834[_0xb6ea('0xf')]();}else{var _0x234285={'ids':[_0x21d3f4[0x0]]};if(rpc[_0x575a2e[_0xb6ea('0x10')]+_0xb6ea('0x11')]){rpc[_0x575a2e[_0xb6ea('0x10')]+_0xb6ea('0x11')][_0xb6ea('0x12')](_0x575a2e['interaction']['id'],_0x234285)[_0xb6ea('0x13')](function(_0x1698a3){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x4a41ad,_0x21d3f4[0x1],_0x575a2e[_0xb6ea('0x10')],_0x575a2e['interaction']['id']);})[_0xb6ea('0x14')](function(_0x1eaf3e){logger[_0xb6ea('0x9')](_0xb6ea('0x15'),_0x4a41ad,JSON[_0xb6ea('0x16')](_0x1eaf3e));logger['info'](_0xb6ea('0xe'),_0x4a41ad);})['finally'](function(){_0x25e834[_0xb6ea('0xf')]();});}}}catch(_0x3d67ed){logger['error']('[%s][TAG]\x20%s',_0x4a41ad,_['isObject'](_0x3d67ed)?JSON['stringify'](_0x3d67ed):_0x3d67ed);logger[_0xb6ea('0xd')](_0xb6ea('0xe'),_0x4a41ad);_0x25e834[_0xb6ea('0xf')]();}};}; \ No newline at end of file +var _0x24c1=['[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','Interaction','channel','addTags','then','interaction','catch','stringify','finally','isObject','lodash','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','routing','consequence','validate','length','error','[%s][TAG]\x20%s','map','message','info'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x24c1,0xfb));var _0x124c=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x24c1[_0x3b380d];return _0x54502b;};'use strict';var schema=require('validate');var _=require(_0x124c('0x0'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x124c('0x1')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x124c('0x2')),'faxInteraction':require(_0x124c('0x3')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require('../../../../config/logger')(_0x124c('0x4'));var tag=schema({'tag':{'type':'number','required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x124c('0x5')]=function(_0x309d0d,_0x5bb931,_0x539c2e,_0xb19775){return function(_0x1c53d5){try{var _0x17e613={'tag':_0x5bb931[0x0]};var _0xd2314b=tag[_0x124c('0x6')](_0x17e613,{'typecast':!![]});if(_0xd2314b[_0x124c('0x7')]){logger[_0x124c('0x8')](_0x124c('0x9'),_0x309d0d,_[_0x124c('0xa')](_0xd2314b,_0x124c('0xb'))['join'](',\x20'));logger[_0x124c('0xc')](_0x124c('0xd'),_0x309d0d);_0x1c53d5[_0x124c('0xe')]();}else{var _0x762745={'ids':[_0x5bb931[0x0]]};if(rpc[_0xb19775['channel']+_0x124c('0xf')]){rpc[_0xb19775[_0x124c('0x10')]+_0x124c('0xf')][_0x124c('0x11')](_0xb19775['interaction']['id'],_0x762745)[_0x124c('0x12')](function(_0x14332d){logger[_0x124c('0xc')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x309d0d,_0x5bb931[0x1],_0xb19775[_0x124c('0x10')],_0xb19775[_0x124c('0x13')]['id']);})[_0x124c('0x14')](function(_0x21affc){logger[_0x124c('0x8')](_0x124c('0x9'),_0x309d0d,JSON[_0x124c('0x15')](_0x21affc));logger[_0x124c('0xc')](_0x124c('0xd'),_0x309d0d);})[_0x124c('0x16')](function(){_0x1c53d5[_0x124c('0xe')]();});}}}catch(_0x2e74d3){logger[_0x124c('0x8')](_0x124c('0x9'),_0x309d0d,_[_0x124c('0x17')](_0x2e74d3)?JSON[_0x124c('0x15')](_0x2e74d3):_0x2e74d3);logger['info'](_0x124c('0xd'),_0x309d0d);_0x1c53d5[_0x124c('0xe')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index 512d490..9e034ae 100644 --- a/server/services/routing/server/applications/tvox.js +++ b/server/services/routing/server/applications/tvox.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x87bd=['consequence','\x20-\x20','replace','includes','push','urlOnAnswer','?params=','title','2.0','method','stringify','utf8','application/json-rpc','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','&sessionId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','[%s][TVOX]\x20%s','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing'];(function(_0x36a217,_0x4a7a90){var _0x186433=function(_0x2d6151){while(--_0x2d6151){_0x36a217['push'](_0x36a217['shift']());}};_0x186433(++_0x4a7a90);}(_0x87bd,0x159));var _0xd87b=function(_0x1f8fee,_0x1a0bff){_0x1f8fee=_0x1f8fee-0x0;var _0x51643b=_0x87bd[_0x1f8fee];return _0x51643b;};'use strict';var rp=require(_0xd87b('0x0'));var logger=require(_0xd87b('0x1'))(_0xd87b('0x2'));var _=require('lodash');var arr=[];exports[_0xd87b('0x3')]=function(_0x43d4d1,_0x2006ec){return function(_0x3f13b3){var _0x22af1c=_0x2006ec[0xa];var _0x301593=_0x2006ec[0xb];var _0x6f7e28=_0x2006ec[0xc];var _0x30f0fe=_0x2006ec[0xd];var _0xc0445f=_0x2006ec[0xe];var _0x2f0ef8=_0x2006ec[0xf]['replace'](/\n/g,_0xd87b('0x4'));var _0x2dc9e3=_0x2006ec[0x10][_0xd87b('0x5')](/\n/g,'\x20');if(!arr[_0xd87b('0x6')](_0x301593)){arr[_0xd87b('0x7')](_0x301593);var _0x4dfd5a=_0x2006ec[0x3];var _0x2325fe=_0x2006ec[0x4];var _0x194e82=_0x2006ec[0x1];var _0x15750a=_0x2006ec[0x0];var _0x2786cd={};_0x2786cd[_0xd87b('0x8')]=_0x2006ec[0x8]+'?params='+_0x6f7e28+'|'+_0x22af1c+'|'+_0x30f0fe+'|'+_0x301593+'|'+_0xc0445f;_0x2786cd['urlOnRing']=_0x2006ec[0x7]+_0xd87b('0x9')+_0x6f7e28+'|'+_0x22af1c+'|'+_0x30f0fe+'|'+_0x301593+'|'+_0xc0445f+'|'+_0x2f0ef8+'|'+_0x2dc9e3;_0x2786cd[_0xd87b('0xa')]=_0x2006ec[0x9];var _0x513f9b={};_0x513f9b['jsonrpc']=_0xd87b('0xb');_0x513f9b[_0xd87b('0xc')]='login';var _0x221f3b=[];_0x221f3b[_0xd87b('0x7')](_0x2006ec[0x2]);_0x221f3b[_0xd87b('0x7')](_0x2006ec[0x5]);_0x221f3b[_0xd87b('0x7')](_0x2006ec[0x6]);_0x513f9b['params']=_0x221f3b;_0x513f9b['id']=0x1;var _0x1f0186=JSON[_0xd87b('0xd')](_0x513f9b);var _0x5a795d={'encoding':_0xd87b('0xe'),'method':'POST','timeout':0x2710,'url':_0x4dfd5a,'headers':{'Content-Type':_0xd87b('0xf')},'body':_0x1f0186};return rp(_0x5a795d)[_0xd87b('0x10')](function(_0x438bb6){const _0x203bd6=JSON[_0xd87b('0x11')](_0x438bb6);if(!_0x203bd6[_0xd87b('0x12')][_0xd87b('0x13')]){throw new Error(_0xd87b('0x14'));}var _0x5bbdc8=_0x301593;var _0x2edaa2='channelId='+_0x194e82+'&serviceId='+_0x15750a+_0xd87b('0x15')+_0x5bbdc8+_0xd87b('0x16')+JSON[_0xd87b('0xd')](_0x2786cd);var _0x4661f9=_0x2325fe+'?'+_0x2edaa2;return rp(_0x4661f9);})[_0xd87b('0x10')](function(_0x3e5845){logger[_0xd87b('0x17')](_0xd87b('0x18'),_0x43d4d1,_0x3e5845);_0x3f13b3[_0xd87b('0x19')]();})['catch'](function(_0x4d9b2b){logger['error'](_0xd87b('0x1a'),_0x43d4d1,_['isObject'](_0x4d9b2b)?JSON[_0xd87b('0xd')](_0x4d9b2b):_0x4d9b2b);_0x3f13b3[_0xd87b('0x19')]();});}else{logger[_0xd87b('0x17')](_0xd87b('0x1b'),_0x43d4d1);_0x3f13b3[_0xd87b('0x1c')]();}};}; \ No newline at end of file +var _0x671a=['replace','\x20-\x20','includes','urlOnRing','?params=','title','jsonrpc','2.0','push','params','stringify','utf8','application/json-rpc','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','[%s][TVOX]\x20%s','isObject','next','request-promise','../../../../config/logger','routing'];(function(_0x639d48,_0x9d49bc){var _0xde5ffb=function(_0x159fc3){while(--_0x159fc3){_0x639d48['push'](_0x639d48['shift']());}};_0xde5ffb(++_0x9d49bc);}(_0x671a,0x168));var _0xa671=function(_0x25c92b,_0x41b368){_0x25c92b=_0x25c92b-0x0;var _0xc59d85=_0x671a[_0x25c92b];return _0xc59d85;};'use strict';var rp=require(_0xa671('0x0'));var logger=require(_0xa671('0x1'))(_0xa671('0x2'));var _=require('lodash');var arr=[];exports['consequence']=function(_0x116a0f,_0x571a99){return function(_0x1710a3){var _0x57e7f8=_0x571a99[0xa];var _0x265659=_0x571a99[0xb];var _0x239a06=_0x571a99[0xc];var _0x5dbe2f=_0x571a99[0xd];var _0x70f69b=_0x571a99[0xe];var _0x338fbe=_0x571a99[0xf][_0xa671('0x3')](/\n/g,_0xa671('0x4'));var _0x3cda7d=_0x571a99[0x10][_0xa671('0x3')](/\n/g,'\x20');if(!arr[_0xa671('0x5')](_0x265659)){arr['push'](_0x265659);var _0x704805=_0x571a99[0x3];var _0x37eb9b=_0x571a99[0x4];var _0x10e261=_0x571a99[0x1];var _0x4da758=_0x571a99[0x0];var _0x43eaad={};_0x43eaad['urlOnAnswer']=_0x571a99[0x8]+'?params='+_0x239a06+'|'+_0x57e7f8+'|'+_0x5dbe2f+'|'+_0x265659+'|'+_0x70f69b;_0x43eaad[_0xa671('0x6')]=_0x571a99[0x7]+_0xa671('0x7')+_0x239a06+'|'+_0x57e7f8+'|'+_0x5dbe2f+'|'+_0x265659+'|'+_0x70f69b+'|'+_0x338fbe+'|'+_0x3cda7d;_0x43eaad[_0xa671('0x8')]=_0x571a99[0x9];var _0xaf924f={};_0xaf924f[_0xa671('0x9')]=_0xa671('0xa');_0xaf924f['method']='login';var _0x1914eb=[];_0x1914eb[_0xa671('0xb')](_0x571a99[0x2]);_0x1914eb[_0xa671('0xb')](_0x571a99[0x5]);_0x1914eb[_0xa671('0xb')](_0x571a99[0x6]);_0xaf924f[_0xa671('0xc')]=_0x1914eb;_0xaf924f['id']=0x1;var _0xf55d9f=JSON[_0xa671('0xd')](_0xaf924f);var _0x42a23a={'encoding':_0xa671('0xe'),'method':'POST','timeout':0x2710,'url':_0x704805,'headers':{'Content-Type':_0xa671('0xf')},'body':_0xf55d9f};return rp(_0x42a23a)[_0xa671('0x10')](function(_0x74c0db){const _0x214c1d=JSON[_0xa671('0x11')](_0x74c0db);if(!_0x214c1d[_0xa671('0x12')][_0xa671('0x13')]){throw new Error(_0xa671('0x14'));}var _0x57a84b=_0x265659;var _0x3f1018=_0xa671('0x15')+_0x10e261+_0xa671('0x16')+_0x4da758+_0xa671('0x17')+_0x57a84b+_0xa671('0x18')+JSON[_0xa671('0xd')](_0x43eaad);var _0x323189=_0x37eb9b+'?'+_0x3f1018;return rp(_0x323189);})['then'](function(_0x469ff1){logger[_0xa671('0x19')](_0xa671('0x1a'),_0x116a0f,_0x469ff1);_0x1710a3[_0xa671('0x1b')]();})[_0xa671('0x1c')](function(_0x3817e0){logger[_0xa671('0x1d')](_0xa671('0x1e'),_0x116a0f,_[_0xa671('0x1f')](_0x3817e0)?JSON[_0xa671('0xd')](_0x3817e0):_0x3817e0);_0x1710a3[_0xa671('0x1b')]();});}else{logger['info']('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x116a0f);_0x1710a3[_0xa671('0x20')]();}};}; \ 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 befc6d9..f6832cd 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(_0x4a192e,_0xe9c5e3){var _0x10ac16=function(_0x152465){while(--_0x152465){_0x4a192e['push'](_0x4a192e['shift']());}};_0x10ac16(++_0xe9c5e3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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(_0x2fcc81,_0x430648){var _0x3749cc=function(_0x496a38){while(--_0x496a38){_0x2fcc81['push'](_0x2fcc81['shift']());}};_0x3749cc(++_0x430648);}(_0xe706,0xa3));var _0x6e70=function(_0x42225e,_0x1164f2){_0x42225e=_0x42225e-0x0;var _0x2bf9e5=_0xe706[_0x42225e];return _0x2bf9e5;};'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 ab13d9f..ce94639 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 _0xb377=['app','.js','toLowerCase','autoreply','split','channel','push','join','slice','appdata','tag','account','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','stringify','matchPath','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','catch','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','waiting','mailQueues','paused','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','path','jayson/promise','bluebird','uuid','./applications/utils','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/faxQueueReport','format','%s.%s.%s','IntervalId','isNil','Intervals','map','interval','listen','rules','message','interaction','applications','isArray','length'];(function(_0x4cdc9f,_0x4e8ce0){var _0x2a6488=function(_0x131e0c){while(--_0x131e0c){_0x4cdc9f['push'](_0x4cdc9f['shift']());}};_0x2a6488(++_0x4e8ce0);}(_0xb377,0x1b6));var _0x7b37=function(_0x2e1591,_0x11276f){_0x2e1591=_0x2e1591-0x0;var _0x207887=_0xb377[_0x2e1591];return _0x207887;};'use strict';var _=require(_0x7b37('0x0'));var util=require(_0x7b37('0x1'));var path=require(_0x7b37('0x2'));var fs=require('fs');var jayson=require(_0x7b37('0x3'));var BPromise=require(_0x7b37('0x4'));var uuid=require(_0x7b37('0x5'));var utils=require(_0x7b37('0x6'));var config=require(_0x7b37('0x7'));var logger=require(_0x7b37('0x8'))(_0x7b37('0x9'));var rpc={'openchannelQueueReport':require(_0x7b37('0xa')),'mailQueueReport':require(_0x7b37('0xb')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x7b37('0xc')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require('../lib/rule-engine');function getId(_0x3de992,_0x3df40f,_0x62d37a){return util[_0x7b37('0xd')](_0x7b37('0xe'),_0x3de992,_0x3df40f||0x0,_0x62d37a||0x0);}function getIntervals(_0x2c8991,_0x4610cd){var _0x39c4ef=[];if(!_['isNil'](_0x4610cd[_0x7b37('0xf')])&&!_[_0x7b37('0x10')](_0x2c8991[_0x4610cd['IntervalId']])&&!_['isNil'](_0x2c8991[_0x4610cd[_0x7b37('0xf')]][_0x7b37('0x11')])){_0x39c4ef=_[_0x7b37('0x12')](_0x2c8991[_0x4610cd[_0x7b37('0xf')]][_0x7b37('0x11')],_0x7b37('0x13'));}else if(!_[_0x7b37('0x10')](_0x4610cd[_0x7b37('0x13')])){_0x39c4ef=[_0x4610cd[_0x7b37('0x13')]];}return _0x39c4ef;}exports[_0x7b37('0x14')]=function(_0x1a381a){_0x1a381a[_0x7b37('0x15')]={};return new BPromise(function(_0x35a61f,_0x330ee2){var _0xbfdc78={'Start':function(_0x17e9e4){var _0x456318=this;return new Promise(function(_0x4ee80c,_0x537c83){if(_0x17e9e4){try{var _0x176a4f=[];var _0x5b06f9=getId(_0x17e9e4['channel'],_0x17e9e4[_0x7b37('0x16')]?_0x17e9e4[_0x7b37('0x16')]['id']:0x0,_0x17e9e4[_0x7b37('0x17')]?_0x17e9e4['interaction']['id']:0x0);if(_0x17e9e4[_0x7b37('0x18')]&&_[_0x7b37('0x19')](_0x17e9e4[_0x7b37('0x18')])&&_0x17e9e4['applications']['length']){for(var _0x6905bb=0x0;_0x6905bb<_0x17e9e4[_0x7b37('0x18')][_0x7b37('0x1a')];_0x6905bb+=0x1){var _0x28c427=_0x17e9e4[_0x7b37('0x18')][_0x6905bb];if(fs['existsSync'](path['join'](__dirname,'applications',_0x28c427[_0x7b37('0x1b')]+_0x7b37('0x1c')))){var _0x73370a=[];switch(_0x28c427[_0x7b37('0x1b')][_0x7b37('0x1d')]()){case _0x7b37('0x1e'):var _0x11af8e=_0x28c427['appdata'][_0x7b37('0x1f')](',');if(_0x17e9e4[_0x7b37('0x20')]==='mail'){_0x73370a[_0x7b37('0x21')](_0x11af8e[0x0]);_0x73370a['push'](_0x11af8e[0x1]);_0x73370a[_0x7b37('0x21')](_0x11af8e['slice'](0x2,_0x11af8e['length'])[_0x7b37('0x22')](','));}else{_0x73370a[_0x7b37('0x21')](_0x11af8e[0x0]);_0x73370a[_0x7b37('0x21')](_0x11af8e[_0x7b37('0x23')](0x1,_0x11af8e[_0x7b37('0x1a')])[_0x7b37('0x22')](','));}break;case'dialogflow':var _0x20a3cc=_0x28c427[_0x7b37('0x24')][_0x7b37('0x1f')](',');_0x73370a[_0x7b37('0x21')](_0x20a3cc[0x0]);_0x73370a[_0x7b37('0x21')](_0x20a3cc[0x1]);_0x73370a[_0x7b37('0x21')](_0x20a3cc[_0x7b37('0x23')](0x2,_0x20a3cc[_0x7b37('0x1a')])[_0x7b37('0x22')](','));break;case'dialogflowv2':var _0x1482a1=_0x28c427[_0x7b37('0x24')][_0x7b37('0x1f')](',');_0x73370a[_0x7b37('0x21')](_0x1482a1[0x0]);_0x73370a['push'](_0x1482a1[0x1]);_0x73370a[_0x7b37('0x21')](_0x1482a1[0x2]);_0x73370a[_0x7b37('0x21')](_0x1482a1[0x3]);_0x73370a[_0x7b37('0x21')](_0x1482a1[_0x7b37('0x23')](0x4,_0x1482a1[_0x7b37('0x1a')])[_0x7b37('0x22')](','));break;case'amazonlex':var _0x29ec63=_0x28c427['appdata'][_0x7b37('0x1f')](',');_0x73370a['push'](_0x29ec63[0x0]);_0x73370a[_0x7b37('0x21')](_0x29ec63[0x1]);_0x73370a[_0x7b37('0x21')](_0x29ec63[0x2]);_0x73370a[_0x7b37('0x21')](_0x29ec63[0x3]);_0x73370a['push'](_0x29ec63[_0x7b37('0x23')](0x4,_0x29ec63['length'])['join'](','));break;case _0x7b37('0x16'):_0x73370a[_0x7b37('0x21')](_0x28c427['appdata']);break;case _0x7b37('0x25'):_0x73370a[_0x7b37('0x21')](_0x28c427['TagId']);_0x73370a['push'](_0x28c427[_0x7b37('0x24')]);break;case'tvox':var _0x54468f=utils['getMustacheRender'](_0x17e9e4[_0x7b37('0x26')]['notificationTemplate'],_0x17e9e4);var _0x52e7f2=_0x28c427[_0x7b37('0x24')][_0x7b37('0x1f')](',');_0x73370a[_0x7b37('0x21')](_0x52e7f2[0x0]);_0x73370a[_0x7b37('0x21')](_0x52e7f2[0x1]);_0x73370a[_0x7b37('0x21')](_0x52e7f2[0x2]);_0x73370a[_0x7b37('0x21')](_0x52e7f2[0x3]);_0x73370a[_0x7b37('0x21')](_0x52e7f2[0x4]);_0x73370a['push'](_0x52e7f2[0x5]);_0x73370a[_0x7b37('0x21')](_0x52e7f2[0x6]);_0x73370a[_0x7b37('0x21')](_0x52e7f2[0x7]);_0x73370a[_0x7b37('0x21')](_0x52e7f2[0x8]);_0x73370a[_0x7b37('0x21')](_0x52e7f2[0x9]);_0x73370a[_0x7b37('0x21')](_0x52e7f2[0xa]);_0x73370a[_0x7b37('0x21')](_0x17e9e4[_0x7b37('0x17')]['id']);_0x73370a[_0x7b37('0x21')](_0x17e9e4['message']['id']);_0x73370a[_0x7b37('0x21')](_0x28c427[_0x7b37('0x27')]);_0x73370a['push'](_0x17e9e4[_0x7b37('0x17')][_0x7b37('0x28')]);_0x73370a[_0x7b37('0x21')](_0x17e9e4[_0x7b37('0x29')][_0x7b37('0x29')]);_0x73370a[_0x7b37('0x21')](_0x54468f);break;default:_0x73370a=_[_0x7b37('0x10')](_0x28c427[_0x7b37('0x24')])?[]:_0x28c427[_0x7b37('0x24')][_0x7b37('0x1f')](',');}var _0x494f67={'id':util[_0x7b37('0xd')](_0x7b37('0x2a'),_0x5b06f9,_0x28c427['id'],_0x28c427[_0x7b37('0x1b')]),'condition':require(_0x7b37('0x2b'))[_0x7b37('0x2c')](_0x5b06f9,getIntervals(_0x1a381a[_0x7b37('0x2d')],_0x28c427),_0x1a381a),'consequence':require(_0x7b37('0x2e')+_0x28c427[_0x7b37('0x1b')])['consequence'](_0x5b06f9,_0x73370a,_0x1a381a,_0x17e9e4),'p':_0x28c427['priority']||0x0};logger[_0x7b37('0x2f')](_0x7b37('0x30'),_0x494f67['id'],_0x7b37('0x31'),getIntervals(_0x1a381a[_0x7b37('0x2d')],_0x28c427)[_0x7b37('0x22')](_0x7b37('0x32')));_0x176a4f[_0x7b37('0x21')](_0x494f67);}else{logger[_0x7b37('0x33')](_0x7b37('0x34'),path[_0x7b37('0x22')](__dirname,_0x7b37('0x18'),_0x28c427['app']+'.js'));}}_0x1a381a[_0x7b37('0x15')][_0x5b06f9]=new RuleEngine(_0x176a4f);_0x1a381a['rules'][_0x5b06f9][_0x7b37('0x35')](_0x17e9e4,function(_0x2e708e){logger['info']('Applications\x20executed',JSON[_0x7b37('0x36')](_0x2e708e[_0x7b37('0x37')]));if(_0x1a381a['rules'][_0x5b06f9]){_0x1a381a[_0x7b37('0x15')][_0x5b06f9]['emit'](_0x7b37('0x38'));}});return _0x4ee80c({'code':0xc8,'message':_0x17e9e4});}else{logger[_0x7b37('0x2f')](_0x7b37('0x39'));return _0x4ee80c({'code':0xc8,'message':_0x17e9e4});}}catch(_0x2c608e){logger[_0x7b37('0x33')](_0x2c608e[_0x7b37('0x3a')]);return _0x537c83(_0x456318[_0x7b37('0x33')](0x1f4,_0x2c608e));}}return _0x537c83(_0x7b37('0x3b'));});},'AcceptMessage':function(_0x21a5be){var _0x12d902=this;return new Promise(function(_0x1806fc,_0x36f457){if(_0x21a5be[_0x7b37('0x3c')]&&_0x21a5be[_0x7b37('0x3c')]['id']){if(_0x1a381a['agents'][_0x21a5be['agent']['id']]){_0x1a381a[_0x7b37('0x3d')][_0x21a5be[_0x7b37('0x3c')]['id']][_0x7b37('0x3e')]=![];_0x1a381a['agents'][_0x21a5be['agent']['id']][_0x7b37('0x3f')]=undefined;}}if(_0x21a5be[_0x7b37('0x16')]&&_0x21a5be[_0x7b37('0x16')]['id']){try{var _0x224449=getId(_0x21a5be[_0x7b37('0x20')],_0x21a5be[_0x7b37('0x16')]?_0x21a5be[_0x7b37('0x16')]['id']:0x0,_0x21a5be[_0x7b37('0x17')]?_0x21a5be[_0x7b37('0x17')]['id']:0x0);if(_0x1a381a['rules'][_0x224449]){_0x1a381a['rules'][_0x224449]['emit'](_0x7b37('0x40'));if(rpc[_0x21a5be['channel']+_0x7b37('0x41')]){rpc[_0x21a5be[_0x7b37('0x20')]+_0x7b37('0x41')][_0x7b37('0x42')](_0x224449,{'UserId':_0x21a5be['message'][_0x7b37('0x43')]})[_0x7b37('0x44')](function(_0x336b1b){logger[_0x7b37('0x33')]('error\x20update\x20queue\x20report');});}}return _0x1806fc({'code':0xc8,'message':_0x21a5be});}catch(_0x5064bf){logger[_0x7b37('0x33')](_0x5064bf[_0x7b37('0x3a')]);return _0x36f457(_0x12d902['error'](0x1f4,_0x5064bf));}}logger[_0x7b37('0x33')](_0x7b37('0x45'));return _0x36f457(_0x12d902['error'](0x1f4,_0x7b37('0x45')));});},'RejectMessage':function(_0x1ef5f6){var _0x3f9fb1=this;return new Promise(function(_0x4f79c3,_0x495af9){if(_0x1ef5f6[_0x7b37('0x3c')]&&_0x1ef5f6[_0x7b37('0x3c')]['id']){try{if(_0x1a381a[_0x7b37('0x3d')][_0x1ef5f6['agent']['id']]){_0x1a381a[_0x7b37('0x3d')][_0x1ef5f6[_0x7b37('0x3c')]['id']][_0x7b37('0x3e')]=![];_0x1a381a[_0x7b37('0x3d')][_0x1ef5f6[_0x7b37('0x3c')]['id']]['busyQueue']=undefined;}return _0x4f79c3({'code':0xc8,'message':_0x1ef5f6});}catch(_0x5500de){logger[_0x7b37('0x33')](_0x5500de[_0x7b37('0x3a')]);return _0x495af9(_0x3f9fb1[_0x7b37('0x33')](0x1f4,_0x5500de));}}logger['error'](_0x7b37('0x45'));return _0x495af9(_0x3f9fb1['error'](0x1f4,_0x7b37('0x45')));});},'AbandonInteraction':function(_0xff2e8b){var _0x26c1a0=this;return new Promise(function(_0x31af15,_0x2cca89){if(_0xff2e8b['channel']&&_0xff2e8b[_0x7b37('0x17')]&&_0xff2e8b[_0x7b37('0x17')]['id']){try{var _0x468d30=getId(_0xff2e8b[_0x7b37('0x20')],_0xff2e8b['message']?_0xff2e8b['message']['id']:0x0,_0xff2e8b[_0x7b37('0x17')]?_0xff2e8b[_0x7b37('0x17')]['id']:0x0);if(_0x1a381a[_0x7b37('0x15')][_0x468d30]){_0x1a381a[_0x7b37('0x15')][_0x468d30]['emit']('end');}return _0x31af15({'code':0xc8,'message':_0xff2e8b});}catch(_0x54167f){logger[_0x7b37('0x33')](_0x54167f['stack']);return _0x2cca89(_0x26c1a0[_0x7b37('0x33')](0x1f4,_0x54167f));}}logger[_0x7b37('0x33')](_0x7b37('0x45'));return _0x2cca89(_0x26c1a0[_0x7b37('0x33')](0x1f4,_0x7b37('0x45')));});},'AgentCapacity':function(_0x1b8f1e){var _0x569f9b=this;return new Promise(function(_0x16bb51,_0xaed964){if(_0x1a381a[_0x7b37('0x3d')][_0x7b37('0x46')](_0x1b8f1e['id'])){for(var _0x16b737 in _0x1b8f1e[_0x7b37('0x47')]){if(_0x1b8f1e[_0x7b37('0x47')][_0x7b37('0x46')](_0x16b737)){if(_0x1a381a[_0x7b37('0x3d')][_0x1b8f1e['id']][_0x7b37('0x46')](_0x16b737+_0x7b37('0x48'))){_0x1a381a[_0x7b37('0x3d')][_0x1b8f1e['id']][_0x16b737+_0x7b37('0x48')]=parseInt(_0x1b8f1e[_0x7b37('0x47')][_0x16b737],0xa);}}}_0x1a381a['agents'][_0x1b8f1e['id']][_0x7b37('0x49')]();return _0x16bb51({'code':0xc8,'message':_0x1a381a['agents'][_0x1b8f1e['id']]});}else{return _0xaed964(_0x569f9b[_0x7b37('0x33')](0x1f4,_0x7b37('0x4a')));}});},'Agents':function(_0x2d4c95){return new Promise(function(_0xe76f7d,_0x4440ff){var _0xf7af76=_[_0x7b37('0x4b')](_0x1a381a['agents']);_0xe76f7d({'count':_0xf7af76[_0x7b37('0x1a')],'rows':_0xf7af76});});},'ChatQueues':function(_0xb0b005){return new Promise(function(_0x4154ad,_0x316d3d){var _0x25cfe4=[];for(var _0x105d15 in _0x1a381a[_0x7b37('0x4c')]){if(_0x1a381a['chatQueues'][_0x7b37('0x46')](_0x105d15)){var _0x17d8be=_0x1a381a[_0x7b37('0x4c')][_0x105d15];var _0x10150a={'id':_0x17d8be['id'],'available':_0x17d8be[_0x7b37('0x4d')],'loggedIn':_0x17d8be[_0x7b37('0x4e')],'name':_0x17d8be[_0x7b37('0x4f')],'paused':_0x17d8be['paused'],'waiting':_0x17d8be[_0x7b37('0x50')]};_0x25cfe4[_0x7b37('0x21')](_0x10150a);}}_0x4154ad({'count':_0x25cfe4[_0x7b37('0x1a')],'rows':_0x25cfe4});});},'MailQueues':function(_0x2e9a92){return new Promise(function(_0x1d2b59,_0x47c396){var _0x2a4d85=[];for(var _0x3d710a in _0x1a381a[_0x7b37('0x51')]){if(_0x1a381a['mailQueues'][_0x7b37('0x46')](_0x3d710a)){var _0x444e9c=_0x1a381a[_0x7b37('0x51')][_0x3d710a];var _0x2fd9fa={'id':_0x444e9c['id'],'available':_0x444e9c['available'],'loggedIn':_0x444e9c[_0x7b37('0x4e')],'name':_0x444e9c[_0x7b37('0x4f')],'paused':_0x444e9c[_0x7b37('0x52')],'waiting':_0x444e9c[_0x7b37('0x50')]};_0x2a4d85['push'](_0x2fd9fa);}}_0x1d2b59({'count':_0x2a4d85[_0x7b37('0x1a')],'rows':_0x2a4d85});});},'OpenchannelQueues':function(_0x13779e){return new Promise(function(_0x2ed45e,_0x458201){var _0x5ed8a9=[];for(var _0x463cf5 in _0x1a381a[_0x7b37('0x53')]){if(_0x1a381a[_0x7b37('0x53')][_0x7b37('0x46')](_0x463cf5)){var _0x4f6a97=_0x1a381a[_0x7b37('0x53')][_0x463cf5];var _0x184724={'id':_0x4f6a97['id'],'available':_0x4f6a97['available'],'loggedIn':_0x4f6a97['loggedIn'],'name':_0x4f6a97[_0x7b37('0x4f')],'paused':_0x4f6a97[_0x7b37('0x52')],'waiting':_0x4f6a97[_0x7b37('0x50')]};_0x5ed8a9['push'](_0x184724);}}_0x2ed45e({'count':_0x5ed8a9[_0x7b37('0x1a')],'rows':_0x5ed8a9});});},'SmsQueues':function(_0x1a83df){return new Promise(function(_0x1012b9,_0x4b288f){var _0xc486a=[];for(var _0x3812d5 in _0x1a381a[_0x7b37('0x54')]){if(_0x1a381a[_0x7b37('0x54')]['hasOwnProperty'](_0x3812d5)){var _0x1beb26=_0x1a381a[_0x7b37('0x54')][_0x3812d5];var _0x3af07b={'id':_0x1beb26['id'],'available':_0x1beb26[_0x7b37('0x4d')],'loggedIn':_0x1beb26[_0x7b37('0x4e')],'name':_0x1beb26[_0x7b37('0x4f')],'paused':_0x1beb26[_0x7b37('0x52')],'waiting':_0x1beb26[_0x7b37('0x50')]};_0xc486a[_0x7b37('0x21')](_0x3af07b);}}_0x1012b9({'count':_0xc486a[_0x7b37('0x1a')],'rows':_0xc486a});});},'FaxQueues':function(_0x2d450f){return new Promise(function(_0x14e81b,_0x283845){var _0x14a8c2=[];for(var _0x1059db in _0x1a381a[_0x7b37('0x55')]){if(_0x1a381a[_0x7b37('0x55')]['hasOwnProperty'](_0x1059db)){var _0x4e5416=_0x1a381a[_0x7b37('0x55')][_0x1059db];var _0x4324ea={'id':_0x4e5416['id'],'available':_0x4e5416[_0x7b37('0x4d')],'loggedIn':_0x4e5416[_0x7b37('0x4e')],'name':_0x4e5416[_0x7b37('0x4f')],'paused':_0x4e5416[_0x7b37('0x52')],'waiting':_0x4e5416['waiting']};_0x14a8c2[_0x7b37('0x21')](_0x4324ea);}}_0x14e81b({'count':_0x14a8c2[_0x7b37('0x1a')],'rows':_0x14a8c2});});},'WhatsappQueues':function(_0x5c056b){return new Promise(function(_0x3a587a,_0x1148fe){var _0x5e8acb=[];for(var _0x292111 in _0x1a381a['whatsappQueues']){if(_0x1a381a[_0x7b37('0x56')][_0x7b37('0x46')](_0x292111)){var _0x5433c7=_0x1a381a[_0x7b37('0x56')][_0x292111];var _0x56ea85={'id':_0x5433c7['id'],'available':_0x5433c7[_0x7b37('0x4d')],'loggedIn':_0x5433c7['loggedIn'],'name':_0x5433c7[_0x7b37('0x4f')],'paused':_0x5433c7[_0x7b37('0x52')],'waiting':_0x5433c7[_0x7b37('0x50')]};_0x5e8acb[_0x7b37('0x21')](_0x56ea85);}}_0x3a587a({'count':_0x5e8acb[_0x7b37('0x1a')],'rows':_0x5e8acb});});},'ChatQueuesWaitingInteractions':function(_0x3b0f24){return new Promise(function(_0x16297d,_0x37ff5f){var _0x5db83f=_[_0x7b37('0x4b')](_0x1a381a[_0x7b37('0x57')]);_0x16297d({'count':_0x5db83f[_0x7b37('0x1a')],'rows':_0x5db83f});});},'MailQueuesWaitingInteractions':function(_0x30ca5a){return new Promise(function(_0x304484,_0x51ed95){var _0x153ef3=_[_0x7b37('0x4b')](_0x1a381a['mailQueuesWaitingInteractions']);_0x304484({'count':_0x153ef3[_0x7b37('0x1a')],'rows':_0x153ef3});});},'OpenchannelQueuesWaitingInteractions':function(_0x203ce2){return new Promise(function(_0x44d136,_0x461004){var _0x50fd76=_['values'](_0x1a381a[_0x7b37('0x58')]);_0x44d136({'count':_0x50fd76[_0x7b37('0x1a')],'rows':_0x50fd76});});},'SmsQueuesWaitingInteractions':function(_0x148cb9){return new Promise(function(_0x54c9e9,_0xf11c3e){var _0x2e3441=_[_0x7b37('0x4b')](_0x1a381a['smsQueuesWaitingInteractions']);_0x54c9e9({'count':_0x2e3441['length'],'rows':_0x2e3441});});},'FaxQueuesWaitingInteractions':function(_0x25e17f){return new Promise(function(_0xf112dd,_0x48de91){var _0x79375=_[_0x7b37('0x4b')](_0x1a381a['faxQueuesWaitingInteractions']);_0xf112dd({'count':_0x79375['length'],'rows':_0x79375});});},'WhatsappQueuesWaitingInteractions':function(_0x18411f){return new Promise(function(_0x416407,_0x277f2b){var _0x5d66cb=_[_0x7b37('0x4b')](_0x1a381a[_0x7b37('0x59')]);_0x416407({'count':_0x5d66cb[_0x7b37('0x1a')],'rows':_0x5d66cb});});}};var _0xfea81b=jayson[_0x7b37('0x5a')](_0xbfdc78)['http']();_0xfea81b['on']('error',function(_0x3980f1){logger[_0x7b37('0x33')](JSON[_0x7b37('0x36')](_0x3980f1));return _0x330ee2(_0x3980f1);});_0xfea81b[_0x7b37('0x14')](0x232c,'127.0.0.1',function(){console[_0x7b37('0x5b')](_0x7b37('0x5c'),0x232c);return _0x35a61f('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file +var _0x8b29=['../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','isNil','IntervalId','Intervals','interval','channel','message','interaction','isArray','applications','length','app','toLowerCase','appdata','split','mail','push','join','dialogflow','slice','dialogflowv2','amazonlex','tag','TagId','tvox','getMustacheRender','account','ChatWebsiteId','body','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','info','on\x20interval','\x20|\x20','error','.js','rules','execute','Applications\x20executed','stringify','emit','complete','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','agents','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','busy','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','listen','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','path','jayson/promise','./applications/utils','../../../config/environment','routing','../rpc/mailQueueReport','../rpc/chatQueueReport'];(function(_0x10a625,_0x5508a8){var _0x2d837b=function(_0x19dc65){while(--_0x19dc65){_0x10a625['push'](_0x10a625['shift']());}};_0x2d837b(++_0x5508a8);}(_0x8b29,0xbe));var _0x98b2=function(_0x101114,_0x4b1b05){_0x101114=_0x101114-0x0;var _0x92b6a2=_0x8b29[_0x101114];return _0x92b6a2;};'use strict';var _=require(_0x98b2('0x0'));var util=require('util');var path=require(_0x98b2('0x1'));var fs=require('fs');var jayson=require(_0x98b2('0x2'));var BPromise=require('bluebird');var uuid=require('uuid');var utils=require(_0x98b2('0x3'));var config=require(_0x98b2('0x4'));var logger=require('../../../config/logger')(_0x98b2('0x5'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x98b2('0x6')),'chatQueueReport':require(_0x98b2('0x7')),'smsQueueReport':require(_0x98b2('0x8')),'faxQueueReport':require(_0x98b2('0x9')),'whatsappQueueReport':require(_0x98b2('0xa'))};var RuleEngine=require(_0x98b2('0xb'));function getId(_0x417ca6,_0x388827,_0x74746d){return util[_0x98b2('0xc')]('%s.%s.%s',_0x417ca6,_0x388827||0x0,_0x74746d||0x0);}function getIntervals(_0x48a17e,_0x599bf5){var _0x14e049=[];if(!_[_0x98b2('0xd')](_0x599bf5[_0x98b2('0xe')])&&!_[_0x98b2('0xd')](_0x48a17e[_0x599bf5[_0x98b2('0xe')]])&&!_['isNil'](_0x48a17e[_0x599bf5[_0x98b2('0xe')]][_0x98b2('0xf')])){_0x14e049=_['map'](_0x48a17e[_0x599bf5[_0x98b2('0xe')]][_0x98b2('0xf')],_0x98b2('0x10'));}else if(!_['isNil'](_0x599bf5['interval'])){_0x14e049=[_0x599bf5[_0x98b2('0x10')]];}return _0x14e049;}exports['listen']=function(_0x2966e2){_0x2966e2['rules']={};return new BPromise(function(_0x5098db,_0x544e3c){var _0x831ee8={'Start':function(_0x413464){var _0xe49e9a=this;return new Promise(function(_0x5ecea1,_0x5bb60d){if(_0x413464){try{var _0x5dd057=[];var _0x389d22=getId(_0x413464[_0x98b2('0x11')],_0x413464[_0x98b2('0x12')]?_0x413464[_0x98b2('0x12')]['id']:0x0,_0x413464['interaction']?_0x413464[_0x98b2('0x13')]['id']:0x0);if(_0x413464['applications']&&_[_0x98b2('0x14')](_0x413464['applications'])&&_0x413464[_0x98b2('0x15')][_0x98b2('0x16')]){for(var _0x1928c8=0x0;_0x1928c8<_0x413464[_0x98b2('0x15')]['length'];_0x1928c8+=0x1){var _0x51835f=_0x413464[_0x98b2('0x15')][_0x1928c8];if(fs['existsSync'](path['join'](__dirname,_0x98b2('0x15'),_0x51835f[_0x98b2('0x17')]+'.js'))){var _0x4ddded=[];switch(_0x51835f[_0x98b2('0x17')][_0x98b2('0x18')]()){case'autoreply':var _0x32cdf8=_0x51835f[_0x98b2('0x19')][_0x98b2('0x1a')](',');if(_0x413464['channel']===_0x98b2('0x1b')){_0x4ddded['push'](_0x32cdf8[0x0]);_0x4ddded[_0x98b2('0x1c')](_0x32cdf8[0x1]);_0x4ddded['push'](_0x32cdf8['slice'](0x2,_0x32cdf8[_0x98b2('0x16')])[_0x98b2('0x1d')](','));}else{_0x4ddded[_0x98b2('0x1c')](_0x32cdf8[0x0]);_0x4ddded['push'](_0x32cdf8['slice'](0x1,_0x32cdf8['length'])[_0x98b2('0x1d')](','));}break;case _0x98b2('0x1e'):var _0x50aafb=_0x51835f[_0x98b2('0x19')][_0x98b2('0x1a')](',');_0x4ddded[_0x98b2('0x1c')](_0x50aafb[0x0]);_0x4ddded['push'](_0x50aafb[0x1]);_0x4ddded[_0x98b2('0x1c')](_0x50aafb[_0x98b2('0x1f')](0x2,_0x50aafb[_0x98b2('0x16')])[_0x98b2('0x1d')](','));break;case _0x98b2('0x20'):var _0x5dd95f=_0x51835f[_0x98b2('0x19')]['split'](',');_0x4ddded[_0x98b2('0x1c')](_0x5dd95f[0x0]);_0x4ddded[_0x98b2('0x1c')](_0x5dd95f[0x1]);_0x4ddded['push'](_0x5dd95f[0x2]);_0x4ddded[_0x98b2('0x1c')](_0x5dd95f[0x3]);_0x4ddded[_0x98b2('0x1c')](_0x5dd95f['slice'](0x4,_0x5dd95f[_0x98b2('0x16')])[_0x98b2('0x1d')](','));break;case _0x98b2('0x21'):var _0x16a93b=_0x51835f['appdata']['split'](',');_0x4ddded[_0x98b2('0x1c')](_0x16a93b[0x0]);_0x4ddded[_0x98b2('0x1c')](_0x16a93b[0x1]);_0x4ddded[_0x98b2('0x1c')](_0x16a93b[0x2]);_0x4ddded[_0x98b2('0x1c')](_0x16a93b[0x3]);_0x4ddded[_0x98b2('0x1c')](_0x16a93b[_0x98b2('0x1f')](0x4,_0x16a93b['length'])[_0x98b2('0x1d')](','));break;case _0x98b2('0x12'):_0x4ddded[_0x98b2('0x1c')](_0x51835f[_0x98b2('0x19')]);break;case _0x98b2('0x22'):_0x4ddded[_0x98b2('0x1c')](_0x51835f[_0x98b2('0x23')]);_0x4ddded[_0x98b2('0x1c')](_0x51835f[_0x98b2('0x19')]);break;case _0x98b2('0x24'):var _0x226b19=utils[_0x98b2('0x25')](_0x413464[_0x98b2('0x26')]['notificationTemplate'],_0x413464);var _0x50532e=_0x51835f[_0x98b2('0x19')][_0x98b2('0x1a')](',');_0x4ddded[_0x98b2('0x1c')](_0x50532e[0x0]);_0x4ddded[_0x98b2('0x1c')](_0x50532e[0x1]);_0x4ddded[_0x98b2('0x1c')](_0x50532e[0x2]);_0x4ddded[_0x98b2('0x1c')](_0x50532e[0x3]);_0x4ddded['push'](_0x50532e[0x4]);_0x4ddded[_0x98b2('0x1c')](_0x50532e[0x5]);_0x4ddded[_0x98b2('0x1c')](_0x50532e[0x6]);_0x4ddded[_0x98b2('0x1c')](_0x50532e[0x7]);_0x4ddded[_0x98b2('0x1c')](_0x50532e[0x8]);_0x4ddded['push'](_0x50532e[0x9]);_0x4ddded[_0x98b2('0x1c')](_0x50532e[0xa]);_0x4ddded[_0x98b2('0x1c')](_0x413464[_0x98b2('0x13')]['id']);_0x4ddded[_0x98b2('0x1c')](_0x413464[_0x98b2('0x12')]['id']);_0x4ddded[_0x98b2('0x1c')](_0x51835f[_0x98b2('0x27')]);_0x4ddded['push'](_0x413464[_0x98b2('0x13')]['ContactId']);_0x4ddded[_0x98b2('0x1c')](_0x413464[_0x98b2('0x28')][_0x98b2('0x28')]);_0x4ddded[_0x98b2('0x1c')](_0x226b19);break;default:_0x4ddded=_['isNil'](_0x51835f['appdata'])?[]:_0x51835f[_0x98b2('0x19')][_0x98b2('0x1a')](',');}var _0x42c69c={'id':util['format'](_0x98b2('0x29'),_0x389d22,_0x51835f['id'],_0x51835f[_0x98b2('0x17')]),'condition':require(_0x98b2('0x2a'))[_0x98b2('0x2b')](_0x389d22,getIntervals(_0x2966e2[_0x98b2('0x2c')],_0x51835f),_0x2966e2),'consequence':require(_0x98b2('0x2d')+_0x51835f['app'])[_0x98b2('0x2e')](_0x389d22,_0x4ddded,_0x2966e2,_0x413464),'p':_0x51835f[_0x98b2('0x2f')]||0x0};logger[_0x98b2('0x30')]('Push\x20new\x20rule',_0x42c69c['id'],_0x98b2('0x31'),getIntervals(_0x2966e2[_0x98b2('0x2c')],_0x51835f)[_0x98b2('0x1d')](_0x98b2('0x32')));_0x5dd057[_0x98b2('0x1c')](_0x42c69c);}else{logger[_0x98b2('0x33')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0x98b2('0x1d')](__dirname,'applications',_0x51835f[_0x98b2('0x17')]+_0x98b2('0x34')));}}_0x2966e2[_0x98b2('0x35')][_0x389d22]=new RuleEngine(_0x5dd057);_0x2966e2[_0x98b2('0x35')][_0x389d22][_0x98b2('0x36')](_0x413464,function(_0x32e14b){logger[_0x98b2('0x30')](_0x98b2('0x37'),JSON[_0x98b2('0x38')](_0x32e14b['matchPath']));if(_0x2966e2[_0x98b2('0x35')][_0x389d22]){_0x2966e2['rules'][_0x389d22][_0x98b2('0x39')](_0x98b2('0x3a'));}});return _0x5ecea1({'code':0xc8,'message':_0x413464});}else{logger[_0x98b2('0x30')](_0x98b2('0x3b'));return _0x5ecea1({'code':0xc8,'message':_0x413464});}}catch(_0x28234f){logger[_0x98b2('0x33')](_0x28234f['stack']);return _0x5bb60d(_0xe49e9a[_0x98b2('0x33')](0x1f4,_0x28234f));}}return _0x5bb60d(_0x98b2('0x3c'));});},'AcceptMessage':function(_0x3dd679){var _0x2bd1ca=this;return new Promise(function(_0xc8b7d7,_0x48009e){if(_0x3dd679['agent']&&_0x3dd679[_0x98b2('0x3d')]['id']){if(_0x2966e2[_0x98b2('0x3e')][_0x3dd679[_0x98b2('0x3d')]['id']]){_0x2966e2[_0x98b2('0x3e')][_0x3dd679['agent']['id']]['busy']=![];_0x2966e2['agents'][_0x3dd679[_0x98b2('0x3d')]['id']][_0x98b2('0x3f')]=undefined;}}if(_0x3dd679[_0x98b2('0x12')]&&_0x3dd679[_0x98b2('0x12')]['id']){try{var _0x28e7f7=getId(_0x3dd679[_0x98b2('0x11')],_0x3dd679[_0x98b2('0x12')]?_0x3dd679[_0x98b2('0x12')]['id']:0x0,_0x3dd679[_0x98b2('0x13')]?_0x3dd679['interaction']['id']:0x0);if(_0x2966e2[_0x98b2('0x35')][_0x28e7f7]){_0x2966e2['rules'][_0x28e7f7][_0x98b2('0x39')](_0x98b2('0x40'));if(rpc[_0x3dd679[_0x98b2('0x11')]+_0x98b2('0x41')]){rpc[_0x3dd679['channel']+_0x98b2('0x41')][_0x98b2('0x42')](_0x28e7f7,{'UserId':_0x3dd679[_0x98b2('0x12')][_0x98b2('0x43')]})[_0x98b2('0x44')](function(_0x54f7ba){logger[_0x98b2('0x33')](_0x98b2('0x45'));});}}return _0xc8b7d7({'code':0xc8,'message':_0x3dd679});}catch(_0x1986e1){logger[_0x98b2('0x33')](_0x1986e1[_0x98b2('0x46')]);return _0x48009e(_0x2bd1ca[_0x98b2('0x33')](0x1f4,_0x1986e1));}}logger[_0x98b2('0x33')](_0x98b2('0x47'));return _0x48009e(_0x2bd1ca[_0x98b2('0x33')](0x1f4,_0x98b2('0x47')));});},'RejectMessage':function(_0x236ca6){var _0x384fcf=this;return new Promise(function(_0x4d77d3,_0x3b083a){if(_0x236ca6[_0x98b2('0x3d')]&&_0x236ca6['agent']['id']){try{if(_0x2966e2['agents'][_0x236ca6[_0x98b2('0x3d')]['id']]){_0x2966e2['agents'][_0x236ca6[_0x98b2('0x3d')]['id']][_0x98b2('0x48')]=![];_0x2966e2[_0x98b2('0x3e')][_0x236ca6[_0x98b2('0x3d')]['id']][_0x98b2('0x3f')]=undefined;}return _0x4d77d3({'code':0xc8,'message':_0x236ca6});}catch(_0x2b2db5){logger['error'](_0x2b2db5[_0x98b2('0x46')]);return _0x3b083a(_0x384fcf['error'](0x1f4,_0x2b2db5));}}logger['error'](_0x98b2('0x47'));return _0x3b083a(_0x384fcf[_0x98b2('0x33')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x12a72e){var _0x1253e2=this;return new Promise(function(_0x47f99a,_0xcc5547){if(_0x12a72e[_0x98b2('0x11')]&&_0x12a72e[_0x98b2('0x13')]&&_0x12a72e[_0x98b2('0x13')]['id']){try{var _0x48ed1d=getId(_0x12a72e['channel'],_0x12a72e[_0x98b2('0x12')]?_0x12a72e[_0x98b2('0x12')]['id']:0x0,_0x12a72e[_0x98b2('0x13')]?_0x12a72e[_0x98b2('0x13')]['id']:0x0);if(_0x2966e2[_0x98b2('0x35')][_0x48ed1d]){_0x2966e2['rules'][_0x48ed1d]['emit'](_0x98b2('0x40'));}return _0x47f99a({'code':0xc8,'message':_0x12a72e});}catch(_0x53d054){logger[_0x98b2('0x33')](_0x53d054[_0x98b2('0x46')]);return _0xcc5547(_0x1253e2[_0x98b2('0x33')](0x1f4,_0x53d054));}}logger[_0x98b2('0x33')](_0x98b2('0x47'));return _0xcc5547(_0x1253e2[_0x98b2('0x33')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x3e7909){var _0x2663be=this;return new Promise(function(_0x2984ba,_0x2b2a25){if(_0x2966e2[_0x98b2('0x3e')][_0x98b2('0x49')](_0x3e7909['id'])){for(var _0x5bc714 in _0x3e7909['capacity']){if(_0x3e7909[_0x98b2('0x4a')][_0x98b2('0x49')](_0x5bc714)){if(_0x2966e2[_0x98b2('0x3e')][_0x3e7909['id']][_0x98b2('0x49')](_0x5bc714+_0x98b2('0x4b'))){_0x2966e2[_0x98b2('0x3e')][_0x3e7909['id']][_0x5bc714+_0x98b2('0x4b')]=parseInt(_0x3e7909[_0x98b2('0x4a')][_0x5bc714],0xa);}}}_0x2966e2['agents'][_0x3e7909['id']][_0x98b2('0x4c')]();return _0x2984ba({'code':0xc8,'message':_0x2966e2[_0x98b2('0x3e')][_0x3e7909['id']]});}else{return _0x2b2a25(_0x2663be[_0x98b2('0x33')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x24f7a3){return new Promise(function(_0x4a55e8,_0x2149a1){var _0x54b9c3=_[_0x98b2('0x4d')](_0x2966e2[_0x98b2('0x3e')]);_0x4a55e8({'count':_0x54b9c3['length'],'rows':_0x54b9c3});});},'ChatQueues':function(_0x3dc906){return new Promise(function(_0x51ecd4,_0x58d2ca){var _0x4d9973=[];for(var _0x5b59f8 in _0x2966e2[_0x98b2('0x4e')]){if(_0x2966e2[_0x98b2('0x4e')][_0x98b2('0x49')](_0x5b59f8)){var _0x4e3af5=_0x2966e2[_0x98b2('0x4e')][_0x5b59f8];var _0xe12247={'id':_0x4e3af5['id'],'available':_0x4e3af5[_0x98b2('0x4f')],'loggedIn':_0x4e3af5[_0x98b2('0x50')],'name':_0x4e3af5[_0x98b2('0x51')],'paused':_0x4e3af5[_0x98b2('0x52')],'waiting':_0x4e3af5[_0x98b2('0x53')]};_0x4d9973['push'](_0xe12247);}}_0x51ecd4({'count':_0x4d9973[_0x98b2('0x16')],'rows':_0x4d9973});});},'MailQueues':function(_0x5d60d9){return new Promise(function(_0x19c45e,_0x3877ae){var _0x2fea4f=[];for(var _0x30db52 in _0x2966e2[_0x98b2('0x54')]){if(_0x2966e2[_0x98b2('0x54')][_0x98b2('0x49')](_0x30db52)){var _0x548bc4=_0x2966e2['mailQueues'][_0x30db52];var _0xc89b4b={'id':_0x548bc4['id'],'available':_0x548bc4[_0x98b2('0x4f')],'loggedIn':_0x548bc4[_0x98b2('0x50')],'name':_0x548bc4[_0x98b2('0x51')],'paused':_0x548bc4['paused'],'waiting':_0x548bc4[_0x98b2('0x53')]};_0x2fea4f['push'](_0xc89b4b);}}_0x19c45e({'count':_0x2fea4f[_0x98b2('0x16')],'rows':_0x2fea4f});});},'OpenchannelQueues':function(_0x400c8d){return new Promise(function(_0x48ac14,_0x130f89){var _0x157abf=[];for(var _0x20a52a in _0x2966e2[_0x98b2('0x55')]){if(_0x2966e2[_0x98b2('0x55')][_0x98b2('0x49')](_0x20a52a)){var _0x4102a4=_0x2966e2[_0x98b2('0x55')][_0x20a52a];var _0xc90317={'id':_0x4102a4['id'],'available':_0x4102a4['available'],'loggedIn':_0x4102a4[_0x98b2('0x50')],'name':_0x4102a4[_0x98b2('0x51')],'paused':_0x4102a4[_0x98b2('0x52')],'waiting':_0x4102a4[_0x98b2('0x53')]};_0x157abf[_0x98b2('0x1c')](_0xc90317);}}_0x48ac14({'count':_0x157abf[_0x98b2('0x16')],'rows':_0x157abf});});},'SmsQueues':function(_0x381800){return new Promise(function(_0x57a39c,_0x2227d6){var _0xdbc224=[];for(var _0x31ea44 in _0x2966e2[_0x98b2('0x56')]){if(_0x2966e2[_0x98b2('0x56')]['hasOwnProperty'](_0x31ea44)){var _0x46942a=_0x2966e2['smsQueues'][_0x31ea44];var _0x45b9fb={'id':_0x46942a['id'],'available':_0x46942a[_0x98b2('0x4f')],'loggedIn':_0x46942a[_0x98b2('0x50')],'name':_0x46942a['name'],'paused':_0x46942a[_0x98b2('0x52')],'waiting':_0x46942a[_0x98b2('0x53')]};_0xdbc224['push'](_0x45b9fb);}}_0x57a39c({'count':_0xdbc224[_0x98b2('0x16')],'rows':_0xdbc224});});},'FaxQueues':function(_0x5b7446){return new Promise(function(_0xa2fbea,_0x5d78e4){var _0x87bd65=[];for(var _0x386c27 in _0x2966e2[_0x98b2('0x57')]){if(_0x2966e2[_0x98b2('0x57')][_0x98b2('0x49')](_0x386c27)){var _0x471194=_0x2966e2['faxQueues'][_0x386c27];var _0x736110={'id':_0x471194['id'],'available':_0x471194['available'],'loggedIn':_0x471194[_0x98b2('0x50')],'name':_0x471194[_0x98b2('0x51')],'paused':_0x471194[_0x98b2('0x52')],'waiting':_0x471194[_0x98b2('0x53')]};_0x87bd65['push'](_0x736110);}}_0xa2fbea({'count':_0x87bd65[_0x98b2('0x16')],'rows':_0x87bd65});});},'WhatsappQueues':function(_0x2f1561){return new Promise(function(_0x1864db,_0x371db6){var _0x2c5b75=[];for(var _0x2832eb in _0x2966e2[_0x98b2('0x58')]){if(_0x2966e2[_0x98b2('0x58')]['hasOwnProperty'](_0x2832eb)){var _0x342a1a=_0x2966e2['whatsappQueues'][_0x2832eb];var _0x228797={'id':_0x342a1a['id'],'available':_0x342a1a[_0x98b2('0x4f')],'loggedIn':_0x342a1a[_0x98b2('0x50')],'name':_0x342a1a['name'],'paused':_0x342a1a['paused'],'waiting':_0x342a1a[_0x98b2('0x53')]};_0x2c5b75[_0x98b2('0x1c')](_0x228797);}}_0x1864db({'count':_0x2c5b75['length'],'rows':_0x2c5b75});});},'ChatQueuesWaitingInteractions':function(_0x5d2fb4){return new Promise(function(_0x38d71b,_0x1e6c8f){var _0x8e9b98=_[_0x98b2('0x4d')](_0x2966e2[_0x98b2('0x59')]);_0x38d71b({'count':_0x8e9b98[_0x98b2('0x16')],'rows':_0x8e9b98});});},'MailQueuesWaitingInteractions':function(_0x4a6562){return new Promise(function(_0x7340eb,_0xe057ab){var _0x2747ed=_[_0x98b2('0x4d')](_0x2966e2['mailQueuesWaitingInteractions']);_0x7340eb({'count':_0x2747ed['length'],'rows':_0x2747ed});});},'OpenchannelQueuesWaitingInteractions':function(_0x3af9a2){return new Promise(function(_0x3038a5,_0x1f4b22){var _0x9c631f=_[_0x98b2('0x4d')](_0x2966e2[_0x98b2('0x5a')]);_0x3038a5({'count':_0x9c631f[_0x98b2('0x16')],'rows':_0x9c631f});});},'SmsQueuesWaitingInteractions':function(_0x416467){return new Promise(function(_0x1444f7,_0x27d9e5){var _0x1104ac=_[_0x98b2('0x4d')](_0x2966e2[_0x98b2('0x5b')]);_0x1444f7({'count':_0x1104ac[_0x98b2('0x16')],'rows':_0x1104ac});});},'FaxQueuesWaitingInteractions':function(_0x71dda){return new Promise(function(_0x66c9aa,_0x290177){var _0x444638=_['values'](_0x2966e2[_0x98b2('0x5c')]);_0x66c9aa({'count':_0x444638[_0x98b2('0x16')],'rows':_0x444638});});},'WhatsappQueuesWaitingInteractions':function(_0x241322){return new Promise(function(_0x5ec0cf,_0x4f4e39){var _0x5521cb=_[_0x98b2('0x4d')](_0x2966e2[_0x98b2('0x5d')]);_0x5ec0cf({'count':_0x5521cb[_0x98b2('0x16')],'rows':_0x5521cb});});}};var _0x177286=jayson[_0x98b2('0x5e')](_0x831ee8)[_0x98b2('0x5f')]();_0x177286['on']('error',function(_0x230015){logger['error'](JSON[_0x98b2('0x38')](_0x230015));return _0x544e3c(_0x230015);});_0x177286[_0x98b2('0x60')](0x232c,'127.0.0.1',function(){console[_0x98b2('0x61')](_0x98b2('0x62'),0x232c);return _0x5098db('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 01f0c82..15164c4 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 _0xb2e3=['some','join','\x20|\x20','log','bluebird','jayson/promise','lodash','../../../config/logger','client','http','request','then','error','message','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','all'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xb2e3,0xf7));var _0x3b2e=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0xb2e3[_0x334841];return _0x5beb4b;};'use strict';var util=require('util');var BPromise=require(_0x3b2e('0x0'));var jayson=require(_0x3b2e('0x1'));var _=require(_0x3b2e('0x2'));var logger=require(_0x3b2e('0x3'))('routing');var client=jayson[_0x3b2e('0x4')][_0x3b2e('0x5')]({'port':0x232a});function request(_0x4cc6b7,_0x585713){return new BPromise(function(_0x2c7b77,_0x374dd2){return client[_0x3b2e('0x6')](_0x4cc6b7,_0x585713)[_0x3b2e('0x7')](function(_0x49d50c){if(_0x49d50c[_0x3b2e('0x8')]){return _0x374dd2(_0x49d50c[_0x3b2e('0x8')][_0x3b2e('0x9')]);}else{return _0x2c7b77(_0x49d50c['result']);}})[_0x3b2e('0xa')](function(_0x483d9f){return _0x374dd2(_0x483d9f);});});}exports[_0x3b2e('0xb')]=function(_0x3da75b,_0x220f5d,_0x22f970){return function(_0x47e2a2){if(_0x22f970['rules']&&!_0x22f970[_0x3b2e('0xc')][_0x3da75b]){logger[_0x3b2e('0xd')](_0x3b2e('0xe'),_0x3da75b);return _0x47e2a2[_0x3b2e('0xf')]();}var _0xa73bbb=[];for(var _0x34d850=0x0;_0x34d850<_0x220f5d[_0x3b2e('0x10')];_0x34d850+=0x1){_0xa73bbb[_0x3b2e('0x11')](request('Command',{'command':util['format'](_0x3b2e('0x12'),_0x220f5d[_0x34d850])})[_0x3b2e('0x7')](function(_0x5f2b7c){return _0x5f2b7c&&_0x5f2b7c[_0x3b2e('0x9')]&&_0x5f2b7c[_0x3b2e('0x9')][_0x3b2e('0x13')](_0x3b2e('0x14'))>=0x0?!![]:![];})[_0x3b2e('0xa')](function(_0x5b9796){logger[_0x3b2e('0x8')](_0x3b2e('0x15'),_0x3da75b,_0x220f5d[_0x34d850]);}));}BPromise[_0x3b2e('0x16')](_0xa73bbb)[_0x3b2e('0x7')](function(_0x3a55b1){var _0x13c2f9=_[_0x3b2e('0x17')](_0x3a55b1);logger[_0x3b2e('0xd')]('[%s][INTERVAL]\x20%s\x20%s',_0x3da75b,_0x220f5d[_0x3b2e('0x18')](_0x3b2e('0x19')),_0x13c2f9);_0x47e2a2['when'](_0x13c2f9);})['catch'](function(_0x28d2e3){console[_0x3b2e('0x1a')](_0x28d2e3);logger[_0x3b2e('0x8')]('[%s][INTERVAL]\x20%s\x20%s',_0x3da75b,_0x220f5d[_0x3b2e('0x18')](_0x3b2e('0x19')),_0x28d2e3['stack']);_0x47e2a2[_0x3b2e('0xf')]();});};}; \ No newline at end of file +var _0xbe2a=['stop','push','Command','format','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','when','log','util','bluebird','lodash','../../../config/logger','routing','client','http','request','then','error','message','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED'];(function(_0x534cbc,_0xa58251){var _0x477c8c=function(_0x4362da){while(--_0x4362da){_0x534cbc['push'](_0x534cbc['shift']());}};_0x477c8c(++_0xa58251);}(_0xbe2a,0x8a));var _0xabe2=function(_0x15629e,_0x3f20fb){_0x15629e=_0x15629e-0x0;var _0x2f8e2e=_0xbe2a[_0x15629e];return _0x2f8e2e;};'use strict';var util=require(_0xabe2('0x0'));var BPromise=require(_0xabe2('0x1'));var jayson=require('jayson/promise');var _=require(_0xabe2('0x2'));var logger=require(_0xabe2('0x3'))(_0xabe2('0x4'));var client=jayson[_0xabe2('0x5')][_0xabe2('0x6')]({'port':0x232a});function request(_0x59a6b0,_0xeec5d7){return new BPromise(function(_0xb59964,_0xdffe93){return client[_0xabe2('0x7')](_0x59a6b0,_0xeec5d7)[_0xabe2('0x8')](function(_0x3253bd){if(_0x3253bd[_0xabe2('0x9')]){return _0xdffe93(_0x3253bd[_0xabe2('0x9')][_0xabe2('0xa')]);}else{return _0xb59964(_0x3253bd[_0xabe2('0xb')]);}})[_0xabe2('0xc')](function(_0x3cf5f2){return _0xdffe93(_0x3cf5f2);});});}exports[_0xabe2('0xd')]=function(_0xb2ad4a,_0x15dd21,_0x521d14){return function(_0x426a96){if(_0x521d14[_0xabe2('0xe')]&&!_0x521d14[_0xabe2('0xe')][_0xb2ad4a]){logger[_0xabe2('0xf')](_0xabe2('0x10'),_0xb2ad4a);return _0x426a96[_0xabe2('0x11')]();}var _0x30301a=[];for(var _0x117ec7=0x0;_0x117ec7<_0x15dd21['length'];_0x117ec7+=0x1){_0x30301a[_0xabe2('0x12')](request(_0xabe2('0x13'),{'command':util[_0xabe2('0x14')](_0xabe2('0x15'),_0x15dd21[_0x117ec7])})[_0xabe2('0x8')](function(_0x38b25c){return _0x38b25c&&_0x38b25c['message']&&_0x38b25c[_0xabe2('0xa')][_0xabe2('0x16')](_0xabe2('0x17'))>=0x0?!![]:![];})[_0xabe2('0xc')](function(_0x2b61db){logger[_0xabe2('0x9')](_0xabe2('0x18'),_0xb2ad4a,_0x15dd21[_0x117ec7]);}));}BPromise[_0xabe2('0x19')](_0x30301a)[_0xabe2('0x8')](function(_0xb6254a){var _0x501cf0=_[_0xabe2('0x1a')](_0xb6254a);logger[_0xabe2('0xf')](_0xabe2('0x1b'),_0xb2ad4a,_0x15dd21['join'](_0xabe2('0x1c')),_0x501cf0);_0x426a96[_0xabe2('0x1d')](_0x501cf0);})[_0xabe2('0xc')](function(_0x572500){console[_0xabe2('0x1e')](_0x572500);logger[_0xabe2('0x9')]('[%s][INTERVAL]\x20%s\x20%s',_0xb2ad4a,_0x15dd21['join']('\x20|\x20'),_0x572500['stack']);_0x426a96[_0xabe2('0x11')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 8ddea1f..86f93f5 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 _0x7072=['acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','format','[%s][agents][agentcalled]','now','connectedlinename','agentringnoanswer','isNil','debug','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','timeout','holdtime','ringtime','talktime','push','error','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswerAt','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connect','reason','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','agentconnectAt','[%s][agents][agentcomplete]','transfereruniqueid','[%s][agents][blindtransfer]','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','agentcalledAt','secondtransfererlinkedid','transfer','ATTENDED','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','complete','util','./utils','info','uniqueid','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x7072,0x138));var _0x2707=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x7072[_0x4fde08];return _0x12e725;};'use strict';var _=require('lodash');var util=require(_0x2707('0x0'));var utils=require(_0x2707('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x127e9c,_0x1bbc92){utils[_0x2707('0x2')](util['format']('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x127e9c[_0x2707('0x3')],_0x127e9c['channel'],_0x127e9c[_0x2707('0x4')],_0x127e9c[_0x2707('0x5')],_0x127e9c[_0x2707('0x6')],_0x127e9c[_0x2707('0x7')],_0x127e9c[_0x2707('0x8')],_0x127e9c[_0x2707('0x9')]));if(_0x127e9c[_0x2707('0x4')]){utils[_0x2707('0xa')](_0x127e9c[_0x2707('0x4')])[_0x2707('0xb')](function(_0x51ffc4){if(_0x51ffc4){_0x127e9c['type']=_0x51ffc4[_0x2707('0xc')];_0x127e9c[_0x2707('0xd')]=_0x127e9c[_0x2707('0xe')]?_0x51ffc4[_0x2707('0xf')]:![];_0x127e9c[_0x2707('0x10')]=_0x127e9c[_0x2707('0xd')]?_0x51ffc4[_0x2707('0x11')]:0x0;}utils[_0x2707('0x12')](_0x2707('0x13'),_0x127e9c);});}else{utils[_0x2707('0x12')](_0x2707('0x13'),_0x127e9c);}if(_0x1bbc92){delete transfers[_0x127e9c[_0x2707('0x3')]];}else{delete agents[_0x127e9c[_0x2707('0x14')]];}}exports['agentcalled']=function(_0x44c1d7){try{utils['debug'](util[_0x2707('0x15')](_0x2707('0x16'),_0x44c1d7[_0x2707('0x3')]),_0x44c1d7);agents[_0x44c1d7[_0x2707('0x14')]]=_0x44c1d7;agents[_0x44c1d7[_0x2707('0x14')]]['agentcalledAt']=utils[_0x2707('0x17')]();agents[_0x44c1d7[_0x2707('0x14')]][_0x2707('0x9')]='called';agents[_0x44c1d7[_0x2707('0x14')]][_0x2707('0x8')]=null;agents[_0x44c1d7[_0x2707('0x14')]][_0x2707('0x18')]=null;utils[_0x2707('0x2')](util[_0x2707('0x15')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x44c1d7[_0x2707('0x3')],agents[_0x44c1d7[_0x2707('0x14')]][_0x2707('0x5')],_0x44c1d7['destuniqueid']));}catch(_0x529936){utils['error'](util[_0x2707('0x15')](_0x2707('0x16'),_0x44c1d7[_0x2707('0x3')]),_0x529936);}};exports[_0x2707('0x19')]=function(_0x1a0e1a){try{if(!_[_0x2707('0x1a')](agents[_0x1a0e1a[_0x2707('0x14')]])){utils[_0x2707('0x1b')](util[_0x2707('0x15')](_0x2707('0x1c'),_0x1a0e1a[_0x2707('0x3')]),_0x1a0e1a);utils[_0x2707('0x2')](util[_0x2707('0x15')](_0x2707('0x1d'),_0x1a0e1a['uniqueid'],agents[_0x1a0e1a[_0x2707('0x14')]][_0x2707('0x5')],_0x1a0e1a[_0x2707('0x14')]));agents[_0x1a0e1a[_0x2707('0x14')]][_0x2707('0x19')]=!![];agents[_0x1a0e1a[_0x2707('0x14')]]['agentringnoanswerAt']=utils[_0x2707('0x17')]();agents[_0x1a0e1a[_0x2707('0x14')]][_0x2707('0x9')]=_0x2707('0x1e');agents[_0x1a0e1a[_0x2707('0x14')]]['reason']=_0x2707('0x1e');agents[_0x1a0e1a['destuniqueid']][_0x2707('0x1f')]=_0x1a0e1a[_0x2707('0x20')]?parseInt(_0x1a0e1a[_0x2707('0x20')])/0x3e8:0x0;agents[_0x1a0e1a['destuniqueid']][_0x2707('0x21')]=0x0;unanswered[_0x2707('0x22')](_0x1a0e1a[_0x2707('0x14')]);}}catch(_0x529be8){utils[_0x2707('0x23')](util[_0x2707('0x15')]('[%s][agents][agentringnoanswer]',_0x1a0e1a[_0x2707('0x3')]),_0x529be8);}};exports['queuecallerabandon']=function(_0x5aaffb){try{_[_0x2707('0x24')](agents,function(_0x4e0c93,_0x2a0d24){if(_0x4e0c93[_0x2707('0x3')]==_0x5aaffb[_0x2707('0x3')]&&!_[_0x2707('0x25')](unanswered,_0x4e0c93['destuniqueid'])){utils[_0x2707('0x1b')](util[_0x2707('0x15')](_0x2707('0x26'),_0x5aaffb[_0x2707('0x3')]),_0x5aaffb);utils[_0x2707('0x2')](util[_0x2707('0x15')](_0x2707('0x27'),_0x5aaffb[_0x2707('0x3')],_0x4e0c93[_0x2707('0x5')],_0x4e0c93['destuniqueid']));_0x4e0c93[_0x2707('0x19')]=!![];_0x4e0c93[_0x2707('0x28')]=utils['now']();_0x4e0c93['lastevent']='abandoned';_0x4e0c93['reason']='abandoned';_0x4e0c93[_0x2707('0x1f')]=_0x5aaffb['holdtime'];_0x4e0c93['talktime']=0x0;writeDB(_0x4e0c93);}});}catch(_0x4558bb){utils[_0x2707('0x23')](util['format'](_0x2707('0x26'),_0x5aaffb[_0x2707('0x3')]),_0x4558bb);}};exports['agentconnect']=function(_0x5e6b51){try{if(agents[_0x5e6b51[_0x2707('0x14')]]){utils[_0x2707('0x1b')](util['format']('[%s][agents][agentconnect]',_0x5e6b51[_0x2707('0x3')]),_0x5e6b51);utils[_0x2707('0x2')](util['format'](_0x2707('0x29'),_0x5e6b51[_0x2707('0x3')],agents[_0x5e6b51[_0x2707('0x14')]][_0x2707('0x5')],_0x5e6b51[_0x2707('0x14')]));agents[_0x5e6b51[_0x2707('0x14')]]['agentconnectAt']=utils[_0x2707('0x17')]();agents[_0x5e6b51[_0x2707('0x14')]][_0x2707('0x8')]=_0x5e6b51[_0x2707('0x8')];agents[_0x5e6b51[_0x2707('0x14')]][_0x2707('0x18')]=_0x5e6b51[_0x2707('0x18')];agents[_0x5e6b51['destuniqueid']][_0x2707('0x1f')]=_0x5e6b51[_0x2707('0x20')];agents[_0x5e6b51[_0x2707('0x14')]][_0x2707('0x9')]=_0x2707('0x2a');_[_0x2707('0x24')](agents,function(_0x3ed513,_0x39d9f6){if(_0x3ed513[_0x2707('0x14')]!=_0x5e6b51[_0x2707('0x14')]&&_0x3ed513[_0x2707('0x3')]==_0x5e6b51[_0x2707('0x3')]){_0x3ed513[_0x2707('0x21')]=0x0;_0x3ed513[_0x2707('0x1f')]=_0x5e6b51[_0x2707('0x20')];_0x3ed513[_0x2707('0x19')]=!![];_0x3ed513['agentringnoanswerAt']=utils[_0x2707('0x17')]();_0x3ed513[_0x2707('0x9')]='answered_elsewhere';_0x3ed513[_0x2707('0x2b')]='answered_elsewhere';_0x3ed513[_0x2707('0x2c')]=_0x5e6b51[_0x2707('0x14')];_0x3ed513[_0x2707('0x2d')]=_0x5e6b51[_0x2707('0x5')];writeDB(_0x3ed513);}});}}catch(_0x13e1c0){utils[_0x2707('0x23')](util[_0x2707('0x15')]('[%s][agents][agentconnect]',_0x5e6b51[_0x2707('0x3')]),_0x13e1c0);}};exports[_0x2707('0xe')]=function(_0x4c8dbf){try{if(!_[_0x2707('0x1a')](agents[_0x4c8dbf[_0x2707('0x14')]])){utils[_0x2707('0x1b')](util['format']('[%s][agents][agentcomplete]',_0x4c8dbf[_0x2707('0x3')]),_0x4c8dbf);utils[_0x2707('0x2')](util['format'](_0x2707('0x2e'),_0x4c8dbf['uniqueid'],agents[_0x4c8dbf[_0x2707('0x14')]][_0x2707('0x5')],_0x4c8dbf[_0x2707('0x14')]));agents[_0x4c8dbf[_0x2707('0x14')]]['agentcomplete']=!![];agents[_0x4c8dbf[_0x2707('0x14')]][_0x2707('0x2f')]=utils[_0x2707('0x17')]();agents[_0x4c8dbf[_0x2707('0x14')]][_0x2707('0x21')]=utils[_0x2707('0x30')](agents[_0x4c8dbf[_0x2707('0x14')]]['agentcompleteAt'],agents[_0x4c8dbf[_0x2707('0x14')]][_0x2707('0x31')]);agents[_0x4c8dbf[_0x2707('0x14')]][_0x2707('0x2b')]=_0x4c8dbf[_0x2707('0x2b')];agents[_0x4c8dbf['destuniqueid']][_0x2707('0x9')]='complete';writeDB(agents[_0x4c8dbf[_0x2707('0x14')]]);}}catch(_0x6ada76){utils['error'](util[_0x2707('0x15')](_0x2707('0x32'),_0x4c8dbf[_0x2707('0x3')]),_0x6ada76);}};exports['blindtransfer']=function(_0x1a8034){try{if(!_['isNil'](agents[_0x1a8034[_0x2707('0x33')]])){utils[_0x2707('0x1b')](util['format'](_0x2707('0x34'),_0x1a8034[_0x2707('0x3')]),_0x1a8034);utils[_0x2707('0x2')](util['format']('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x1a8034[_0x2707('0x3')],agents[_0x1a8034[_0x2707('0x33')]][_0x2707('0x5')],agents[_0x1a8034[_0x2707('0x33')]][_0x2707('0x3')]));agents[_0x1a8034['transfereruniqueid']]['transfer']=!![];agents[_0x1a8034['transfereruniqueid']][_0x2707('0x35')]=_0x2707('0x36');agents[_0x1a8034[_0x2707('0x33')]][_0x2707('0x37')]=_0x1a8034[_0x2707('0x38')];agents[_0x1a8034['transfereruniqueid']][_0x2707('0x39')]=agents[_0x1a8034[_0x2707('0x33')]]['uniqueid'];}}catch(_0x482ed1){utils[_0x2707('0x23')](util[_0x2707('0x15')](_0x2707('0x34'),_0x1a8034['uniqueid']),_0x482ed1);}};exports[_0x2707('0x3a')]=function(_0x40a1a8){try{utils[_0x2707('0x1b')](util[_0x2707('0x15')]('[%s][agents][attendedtransfer]',_0x40a1a8[_0x2707('0x3b')]),_0x40a1a8);if(_0x40a1a8[_0x2707('0x3b')]==_0x40a1a8[_0x2707('0x3c')]){if(!_[_0x2707('0x1a')](agents[_0x40a1a8[_0x2707('0x3d')]])){utils[_0x2707('0x2')](util[_0x2707('0x15')](_0x2707('0x3e'),_0x40a1a8[_0x2707('0x3b')],agents[_0x40a1a8[_0x2707('0x3d')]]['membername']));agents[_0x40a1a8[_0x2707('0x3d')]]['transfer']=!![];agents[_0x40a1a8['secondtransfereruniqueid']][_0x2707('0x35')]='ATTENDED';agents[_0x40a1a8['secondtransfereruniqueid']][_0x2707('0x37')]=_0x40a1a8[_0x2707('0x3f')];agents[_0x40a1a8[_0x2707('0x3d')]][_0x2707('0x39')]=_0x40a1a8[_0x2707('0x3b')];}if(_0x40a1a8[_0x2707('0x40')]&&agents[_0x40a1a8[_0x2707('0x40')]]){agents[_0x40a1a8[_0x2707('0x40')]][_0x2707('0x41')]=0x1;transfers[_0x40a1a8[_0x2707('0x40')]]=_[_0x2707('0x42')](agents[_0x40a1a8['transfereeuniqueid']]);transfers[_0x40a1a8['transfereeuniqueid']]['calleridnum']=agents[_0x40a1a8[_0x2707('0x3d')]][_0x2707('0x7')];transfers[_0x40a1a8[_0x2707('0x40')]]['calleridname']=agents[_0x40a1a8['secondtransfereruniqueid']][_0x2707('0x43')];transfers[_0x40a1a8[_0x2707('0x40')]][_0x2707('0x44')]=utils[_0x2707('0x17')]();transfers[_0x40a1a8[_0x2707('0x40')]]['agentconnectAt']=utils['now']();transfers[_0x40a1a8[_0x2707('0x40')]][_0x2707('0x1f')]=0x0;transfers[_0x40a1a8[_0x2707('0x40')]][_0x2707('0x41')]=0x2;}}else if(_0x40a1a8[_0x2707('0x3d')]==_0x40a1a8[_0x2707('0x45')]){if(!_[_0x2707('0x1a')](agents[_0x40a1a8[_0x2707('0x3b')]])){utils[_0x2707('0x2')](util['format'](_0x2707('0x3e'),_0x40a1a8[_0x2707('0x3b')],agents[_0x40a1a8[_0x2707('0x3b')]][_0x2707('0x5')]));agents[_0x40a1a8[_0x2707('0x3b')]][_0x2707('0x46')]=!![];agents[_0x40a1a8['origtransfereruniqueid']]['transfertype']=_0x2707('0x47');agents[_0x40a1a8[_0x2707('0x3b')]]['transferexten']=_0x40a1a8['secondtransfererexten'];agents[_0x40a1a8['origtransfereruniqueid']]['transferuniqueid']=_0x40a1a8[_0x2707('0x3d')];}if(_0x40a1a8[_0x2707('0x48')]&&agents[_0x40a1a8['transfertargetuniqueid']]){agents[_0x40a1a8[_0x2707('0x48')]][_0x2707('0x41')]=0x1;transfers[_0x40a1a8[_0x2707('0x48')]]=_['clone'](agents[_0x40a1a8['transfertargetuniqueid']]);transfers[_0x40a1a8[_0x2707('0x48')]][_0x2707('0x7')]=agents[_0x40a1a8[_0x2707('0x3b')]][_0x2707('0x7')];transfers[_0x40a1a8[_0x2707('0x48')]][_0x2707('0x43')]=agents[_0x40a1a8[_0x2707('0x3b')]]['calleridname'];transfers[_0x40a1a8[_0x2707('0x48')]][_0x2707('0x44')]=utils[_0x2707('0x17')]();transfers[_0x40a1a8[_0x2707('0x48')]][_0x2707('0x31')]=utils[_0x2707('0x17')]();transfers[_0x40a1a8['transfertargetuniqueid']][_0x2707('0x1f')]=0x0;transfers[_0x40a1a8[_0x2707('0x48')]][_0x2707('0x41')]=0x2;}}}catch(_0x142606){utils[_0x2707('0x23')](util[_0x2707('0x15')]('[%s][agents][attendedtransfer]',_0x40a1a8['origtransfereruniqueid']),_0x142606);}};exports[_0x2707('0x49')]=function(_0x2b0df0){try{utils[_0x2707('0x1b')](util[_0x2707('0x15')](_0x2707('0x4a'),_0x2b0df0[_0x2707('0x3')]),_0x2b0df0);if(agents[_0x2b0df0['uniqueid']]&&agents[_0x2b0df0['uniqueid']][_0x2707('0x2b')]==='timeout'){if(_0x2b0df0[_0x2707('0x4b')]==='21'){agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x2b')]=_0x2707('0x4c');agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x9')]='rejected';}utils[_0x2707('0x2')](util['format'](_0x2707('0x4d'),_0x2b0df0[_0x2707('0x3')],agents[_0x2b0df0['uniqueid']][_0x2707('0x5')],agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x2b')],agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x9')]));writeDB(agents[_0x2b0df0['uniqueid']]);var _0x3bfec3=unanswered[_0x2707('0x4e')](_0x2b0df0[_0x2707('0x3')]);if(_0x3bfec3>-0x1){unanswered[_0x2707('0x4f')](_0x3bfec3,0x1);}}if(transfers[_0x2b0df0[_0x2707('0x3')]]){transfers[_0x2b0df0[_0x2707('0x3')]][_0x2707('0xe')]=!![];transfers[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x2f')]=utils[_0x2707('0x17')]();transfers[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x21')]=utils[_0x2707('0x30')](transfers[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x2f')],transfers[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x31')]);transfers[_0x2b0df0[_0x2707('0x3')]]['reason']=_0x2707('0x50');transfers[_0x2b0df0['uniqueid']]['lastevent']=_0x2707('0x51');utils[_0x2707('0x2')](util[_0x2707('0x15')](_0x2707('0x4d'),_0x2b0df0[_0x2707('0x3')],transfers[_0x2b0df0[_0x2707('0x3')]]['membername'],transfers[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x2b')],transfers[_0x2b0df0[_0x2707('0x3')]]['lastevent']));writeDB(transfers[_0x2b0df0[_0x2707('0x3')]],!![]);}if(agents[_0x2b0df0[_0x2707('0x3')]]&&agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x31')]){agents[_0x2b0df0['uniqueid']][_0x2707('0xe')]=!![];agents[_0x2b0df0['uniqueid']][_0x2707('0x2f')]=utils[_0x2707('0x17')]();agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x21')]=utils[_0x2707('0x30')](agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x2f')],agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x31')]);agents[_0x2b0df0['uniqueid']][_0x2707('0x2b')]=agents[_0x2b0df0['uniqueid']][_0x2707('0x46')]?_0x2707('0x46'):_0x2707('0x50');agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x9')]=_0x2707('0x51');utils['info'](util['format'](_0x2707('0x4d'),_0x2b0df0['uniqueid'],agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x5')],agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x2b')],agents[_0x2b0df0['uniqueid']][_0x2707('0x9')]));writeDB(agents[_0x2b0df0[_0x2707('0x3')]]);}}catch(_0x17b7b7){utils['error'](util[_0x2707('0x15')](_0x2707('0x4a'),_0x2b0df0[_0x2707('0x3')]),_0x17b7b7);}}; \ No newline at end of file +var _0x9aea=['[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinename','error','agentringnoanswer','isNil','debug','agentringnoanswerAt','timeout','reason','holdtime','ringtime','[%s][agents][agentringnoanswer]','forIn','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','talktime','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','transfertype','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','transfer','origtransfererexten','transfereeuniqueid','clone','calleridname','agententerreason','transferexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','indexOf','splice','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','./utils','info','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','request','CreateVoiceAgentReport','destuniqueid','agentcalled','format'];(function(_0x25f4d3,_0xc41c85){var _0x3db1fd=function(_0x290cbd){while(--_0x290cbd){_0x25f4d3['push'](_0x25f4d3['shift']());}};_0x3db1fd(++_0xc41c85);}(_0x9aea,0xdd));var _0xa9ae=function(_0x59d17e,_0x54c673){_0x59d17e=_0x59d17e-0x0;var _0x47c55e=_0x9aea[_0x59d17e];return _0x47c55e;};'use strict';var _=require(_0xa9ae('0x0'));var util=require('util');var utils=require(_0xa9ae('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x5e1d51,_0x2b5e0c){utils[_0xa9ae('0x2')](util['format'](_0xa9ae('0x3'),_0x5e1d51[_0xa9ae('0x4')],_0x5e1d51[_0xa9ae('0x5')],_0x5e1d51[_0xa9ae('0x6')],_0x5e1d51[_0xa9ae('0x7')],_0x5e1d51['interface'],_0x5e1d51[_0xa9ae('0x8')],_0x5e1d51[_0xa9ae('0x9')],_0x5e1d51[_0xa9ae('0xa')]));if(_0x5e1d51['queue']){utils[_0xa9ae('0xb')](_0x5e1d51[_0xa9ae('0x6')])[_0xa9ae('0xc')](function(_0x44cf1b){if(_0x44cf1b){_0x5e1d51[_0xa9ae('0xd')]=_0x44cf1b[_0xa9ae('0xd')];_0x5e1d51[_0xa9ae('0xe')]=_0x5e1d51[_0xa9ae('0xf')]?_0x44cf1b[_0xa9ae('0x10')]:![];_0x5e1d51['acwtime']=_0x5e1d51[_0xa9ae('0xe')]?_0x44cf1b['acwTimeout']:0x0;}utils[_0xa9ae('0x11')](_0xa9ae('0x12'),_0x5e1d51);});}else{utils[_0xa9ae('0x11')](_0xa9ae('0x12'),_0x5e1d51);}if(_0x2b5e0c){delete transfers[_0x5e1d51[_0xa9ae('0x4')]];}else{delete agents[_0x5e1d51[_0xa9ae('0x13')]];}}exports[_0xa9ae('0x14')]=function(_0x2b511a){try{utils['debug'](util[_0xa9ae('0x15')](_0xa9ae('0x16'),_0x2b511a[_0xa9ae('0x4')]),_0x2b511a);agents[_0x2b511a[_0xa9ae('0x13')]]=_0x2b511a;agents[_0x2b511a['destuniqueid']][_0xa9ae('0x17')]=utils[_0xa9ae('0x18')]();agents[_0x2b511a[_0xa9ae('0x13')]][_0xa9ae('0xa')]=_0xa9ae('0x19');agents[_0x2b511a[_0xa9ae('0x13')]]['connectedlinenum']=null;agents[_0x2b511a[_0xa9ae('0x13')]][_0xa9ae('0x1a')]=null;utils[_0xa9ae('0x2')](util['format']('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x2b511a[_0xa9ae('0x4')],agents[_0x2b511a['destuniqueid']]['membername'],_0x2b511a[_0xa9ae('0x13')]));}catch(_0x3b8245){utils[_0xa9ae('0x1b')](util[_0xa9ae('0x15')]('[%s][agents][agentcalled]',_0x2b511a[_0xa9ae('0x4')]),_0x3b8245);}};exports[_0xa9ae('0x1c')]=function(_0x39f133){try{if(!_[_0xa9ae('0x1d')](agents[_0x39f133[_0xa9ae('0x13')]])){utils[_0xa9ae('0x1e')](util[_0xa9ae('0x15')]('[%s][agents][agentringnoanswer]',_0x39f133[_0xa9ae('0x4')]),_0x39f133);utils['info'](util['format']('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x39f133['uniqueid'],agents[_0x39f133[_0xa9ae('0x13')]]['membername'],_0x39f133[_0xa9ae('0x13')]));agents[_0x39f133['destuniqueid']][_0xa9ae('0x1c')]=!![];agents[_0x39f133[_0xa9ae('0x13')]][_0xa9ae('0x1f')]=utils[_0xa9ae('0x18')]();agents[_0x39f133[_0xa9ae('0x13')]][_0xa9ae('0xa')]=_0xa9ae('0x20');agents[_0x39f133['destuniqueid']][_0xa9ae('0x21')]=_0xa9ae('0x20');agents[_0x39f133[_0xa9ae('0x13')]][_0xa9ae('0x22')]=_0x39f133[_0xa9ae('0x23')]?parseInt(_0x39f133[_0xa9ae('0x23')])/0x3e8:0x0;agents[_0x39f133[_0xa9ae('0x13')]]['talktime']=0x0;unanswered['push'](_0x39f133[_0xa9ae('0x13')]);}}catch(_0x3c324e){utils[_0xa9ae('0x1b')](util[_0xa9ae('0x15')](_0xa9ae('0x24'),_0x39f133['uniqueid']),_0x3c324e);}};exports['queuecallerabandon']=function(_0x1892b5){try{_[_0xa9ae('0x25')](agents,function(_0x372ec7,_0x3a48b7){if(_0x372ec7[_0xa9ae('0x4')]==_0x1892b5[_0xa9ae('0x4')]&&!_['includes'](unanswered,_0x372ec7['destuniqueid'])){utils[_0xa9ae('0x1e')](util[_0xa9ae('0x15')](_0xa9ae('0x26'),_0x1892b5[_0xa9ae('0x4')]),_0x1892b5);utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')](_0xa9ae('0x27'),_0x1892b5[_0xa9ae('0x4')],_0x372ec7['membername'],_0x372ec7[_0xa9ae('0x13')]));_0x372ec7['agentringnoanswer']=!![];_0x372ec7[_0xa9ae('0x1f')]=utils[_0xa9ae('0x18')]();_0x372ec7[_0xa9ae('0xa')]='abandoned';_0x372ec7[_0xa9ae('0x21')]=_0xa9ae('0x28');_0x372ec7[_0xa9ae('0x22')]=_0x1892b5[_0xa9ae('0x22')];_0x372ec7[_0xa9ae('0x29')]=0x0;writeDB(_0x372ec7);}});}catch(_0x4cb3ae){utils[_0xa9ae('0x1b')](util[_0xa9ae('0x15')](_0xa9ae('0x26'),_0x1892b5['uniqueid']),_0x4cb3ae);}};exports['agentconnect']=function(_0x2155c8){try{if(agents[_0x2155c8[_0xa9ae('0x13')]]){utils[_0xa9ae('0x1e')](util[_0xa9ae('0x15')]('[%s][agents][agentconnect]',_0x2155c8[_0xa9ae('0x4')]),_0x2155c8);utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')](_0xa9ae('0x2a'),_0x2155c8[_0xa9ae('0x4')],agents[_0x2155c8['destuniqueid']][_0xa9ae('0x7')],_0x2155c8['destuniqueid']));agents[_0x2155c8[_0xa9ae('0x13')]][_0xa9ae('0x2b')]=utils[_0xa9ae('0x18')]();agents[_0x2155c8['destuniqueid']][_0xa9ae('0x9')]=_0x2155c8[_0xa9ae('0x9')];agents[_0x2155c8[_0xa9ae('0x13')]]['connectedlinename']=_0x2155c8[_0xa9ae('0x1a')];agents[_0x2155c8[_0xa9ae('0x13')]]['holdtime']=_0x2155c8[_0xa9ae('0x23')];agents[_0x2155c8['destuniqueid']][_0xa9ae('0xa')]=_0xa9ae('0x2c');_['forIn'](agents,function(_0x37da9b,_0x15ce12){if(_0x37da9b[_0xa9ae('0x13')]!=_0x2155c8[_0xa9ae('0x13')]&&_0x37da9b[_0xa9ae('0x4')]==_0x2155c8[_0xa9ae('0x4')]){_0x37da9b['talktime']=0x0;_0x37da9b[_0xa9ae('0x22')]=_0x2155c8[_0xa9ae('0x23')];_0x37da9b['agentringnoanswer']=!![];_0x37da9b['agentringnoanswerAt']=utils[_0xa9ae('0x18')]();_0x37da9b[_0xa9ae('0xa')]=_0xa9ae('0x2d');_0x37da9b[_0xa9ae('0x21')]='answered_elsewhere';_0x37da9b[_0xa9ae('0x2e')]=_0x2155c8[_0xa9ae('0x13')];_0x37da9b[_0xa9ae('0x2f')]=_0x2155c8[_0xa9ae('0x7')];writeDB(_0x37da9b);}});}}catch(_0x23c91d){utils[_0xa9ae('0x1b')](util[_0xa9ae('0x15')]('[%s][agents][agentconnect]',_0x2155c8[_0xa9ae('0x4')]),_0x23c91d);}};exports[_0xa9ae('0xf')]=function(_0x566cb0){try{if(!_[_0xa9ae('0x1d')](agents[_0x566cb0['destuniqueid']])){utils[_0xa9ae('0x1e')](util[_0xa9ae('0x15')](_0xa9ae('0x30'),_0x566cb0[_0xa9ae('0x4')]),_0x566cb0);utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')](_0xa9ae('0x31'),_0x566cb0['uniqueid'],agents[_0x566cb0[_0xa9ae('0x13')]][_0xa9ae('0x7')],_0x566cb0['destuniqueid']));agents[_0x566cb0[_0xa9ae('0x13')]][_0xa9ae('0xf')]=!![];agents[_0x566cb0[_0xa9ae('0x13')]][_0xa9ae('0x32')]=utils[_0xa9ae('0x18')]();agents[_0x566cb0[_0xa9ae('0x13')]]['talktime']=utils[_0xa9ae('0x33')](agents[_0x566cb0['destuniqueid']][_0xa9ae('0x32')],agents[_0x566cb0[_0xa9ae('0x13')]]['agentconnectAt']);agents[_0x566cb0['destuniqueid']][_0xa9ae('0x21')]=_0x566cb0[_0xa9ae('0x21')];agents[_0x566cb0[_0xa9ae('0x13')]][_0xa9ae('0xa')]=_0xa9ae('0x34');writeDB(agents[_0x566cb0[_0xa9ae('0x13')]]);}}catch(_0x2961e4){utils[_0xa9ae('0x1b')](util['format']('[%s][agents][agentcomplete]',_0x566cb0[_0xa9ae('0x4')]),_0x2961e4);}};exports[_0xa9ae('0x35')]=function(_0x4efe55){try{if(!_[_0xa9ae('0x1d')](agents[_0x4efe55[_0xa9ae('0x36')]])){utils[_0xa9ae('0x1e')](util[_0xa9ae('0x15')](_0xa9ae('0x37'),_0x4efe55[_0xa9ae('0x4')]),_0x4efe55);utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x4efe55[_0xa9ae('0x4')],agents[_0x4efe55[_0xa9ae('0x36')]]['membername'],agents[_0x4efe55[_0xa9ae('0x36')]]['uniqueid']));agents[_0x4efe55['transfereruniqueid']]['transfer']=!![];agents[_0x4efe55[_0xa9ae('0x36')]][_0xa9ae('0x38')]='blind';agents[_0x4efe55['transfereruniqueid']]['transferexten']=_0x4efe55[_0xa9ae('0x39')];agents[_0x4efe55['transfereruniqueid']][_0xa9ae('0x3a')]=agents[_0x4efe55[_0xa9ae('0x36')]]['uniqueid'];}}catch(_0x1be415){utils['error'](util[_0xa9ae('0x15')](_0xa9ae('0x37'),_0x4efe55[_0xa9ae('0x4')]),_0x1be415);}};exports[_0xa9ae('0x3b')]=function(_0x371760){try{utils[_0xa9ae('0x1e')](util[_0xa9ae('0x15')](_0xa9ae('0x3c'),_0x371760[_0xa9ae('0x3d')]),_0x371760);if(_0x371760[_0xa9ae('0x3d')]==_0x371760[_0xa9ae('0x3e')]){if(!_[_0xa9ae('0x1d')](agents[_0x371760['secondtransfereruniqueid']])){utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')](_0xa9ae('0x3f'),_0x371760[_0xa9ae('0x3d')],agents[_0x371760[_0xa9ae('0x40')]]['membername']));agents[_0x371760['secondtransfereruniqueid']][_0xa9ae('0x41')]=!![];agents[_0x371760[_0xa9ae('0x40')]]['transfertype']='ATTENDED';agents[_0x371760[_0xa9ae('0x40')]]['transferexten']=_0x371760[_0xa9ae('0x42')];agents[_0x371760[_0xa9ae('0x40')]][_0xa9ae('0x3a')]=_0x371760['origtransfereruniqueid'];}if(_0x371760[_0xa9ae('0x43')]&&agents[_0x371760['transfereeuniqueid']]){agents[_0x371760[_0xa9ae('0x43')]]['agententerreason']=0x1;transfers[_0x371760[_0xa9ae('0x43')]]=_[_0xa9ae('0x44')](agents[_0x371760[_0xa9ae('0x43')]]);transfers[_0x371760[_0xa9ae('0x43')]][_0xa9ae('0x8')]=agents[_0x371760[_0xa9ae('0x40')]]['calleridnum'];transfers[_0x371760[_0xa9ae('0x43')]][_0xa9ae('0x45')]=agents[_0x371760[_0xa9ae('0x40')]][_0xa9ae('0x45')];transfers[_0x371760['transfereeuniqueid']][_0xa9ae('0x17')]=utils[_0xa9ae('0x18')]();transfers[_0x371760[_0xa9ae('0x43')]][_0xa9ae('0x2b')]=utils[_0xa9ae('0x18')]();transfers[_0x371760[_0xa9ae('0x43')]][_0xa9ae('0x22')]=0x0;transfers[_0x371760[_0xa9ae('0x43')]][_0xa9ae('0x46')]=0x2;}}else if(_0x371760[_0xa9ae('0x40')]==_0x371760['secondtransfererlinkedid']){if(!_[_0xa9ae('0x1d')](agents[_0x371760[_0xa9ae('0x3d')]])){utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x371760[_0xa9ae('0x3d')],agents[_0x371760[_0xa9ae('0x3d')]]['membername']));agents[_0x371760[_0xa9ae('0x3d')]][_0xa9ae('0x41')]=!![];agents[_0x371760[_0xa9ae('0x3d')]]['transfertype']='ATTENDED';agents[_0x371760[_0xa9ae('0x3d')]][_0xa9ae('0x47')]=_0x371760['secondtransfererexten'];agents[_0x371760['origtransfereruniqueid']][_0xa9ae('0x3a')]=_0x371760[_0xa9ae('0x40')];}if(_0x371760[_0xa9ae('0x48')]&&agents[_0x371760['transfertargetuniqueid']]){agents[_0x371760[_0xa9ae('0x48')]][_0xa9ae('0x46')]=0x1;transfers[_0x371760[_0xa9ae('0x48')]]=_[_0xa9ae('0x44')](agents[_0x371760[_0xa9ae('0x48')]]);transfers[_0x371760[_0xa9ae('0x48')]][_0xa9ae('0x8')]=agents[_0x371760[_0xa9ae('0x3d')]][_0xa9ae('0x8')];transfers[_0x371760[_0xa9ae('0x48')]]['calleridname']=agents[_0x371760['origtransfereruniqueid']][_0xa9ae('0x45')];transfers[_0x371760[_0xa9ae('0x48')]][_0xa9ae('0x17')]=utils['now']();transfers[_0x371760[_0xa9ae('0x48')]][_0xa9ae('0x2b')]=utils[_0xa9ae('0x18')]();transfers[_0x371760['transfertargetuniqueid']]['holdtime']=0x0;transfers[_0x371760[_0xa9ae('0x48')]]['agententerreason']=0x2;}}}catch(_0x14a720){utils[_0xa9ae('0x1b')](util[_0xa9ae('0x15')](_0xa9ae('0x3c'),_0x371760[_0xa9ae('0x3d')]),_0x14a720);}};exports[_0xa9ae('0x49')]=function(_0x1bf8e3){try{utils[_0xa9ae('0x1e')](util[_0xa9ae('0x15')](_0xa9ae('0x4a'),_0x1bf8e3['uniqueid']),_0x1bf8e3);if(agents[_0x1bf8e3[_0xa9ae('0x4')]]&&agents[_0x1bf8e3['uniqueid']][_0xa9ae('0x21')]===_0xa9ae('0x20')){if(_0x1bf8e3[_0xa9ae('0x4b')]==='21'){agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x21')]='rejected';agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0xa')]=_0xa9ae('0x4c');}utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x1bf8e3[_0xa9ae('0x4')],agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x7')],agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x21')],agents[_0x1bf8e3['uniqueid']]['lastevent']));writeDB(agents[_0x1bf8e3[_0xa9ae('0x4')]]);var _0x2f4a73=unanswered[_0xa9ae('0x4d')](_0x1bf8e3[_0xa9ae('0x4')]);if(_0x2f4a73>-0x1){unanswered[_0xa9ae('0x4e')](_0x2f4a73,0x1);}}if(transfers[_0x1bf8e3['uniqueid']]){transfers[_0x1bf8e3['uniqueid']][_0xa9ae('0xf')]=!![];transfers[_0x1bf8e3[_0xa9ae('0x4')]]['agentcompleteAt']=utils['now']();transfers[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x29')]=utils[_0xa9ae('0x33')](transfers[_0x1bf8e3[_0xa9ae('0x4')]]['agentcompleteAt'],transfers[_0x1bf8e3['uniqueid']][_0xa9ae('0x2b')]);transfers[_0x1bf8e3['uniqueid']]['reason']='agent';transfers[_0x1bf8e3['uniqueid']][_0xa9ae('0xa')]=_0xa9ae('0x34');utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x1bf8e3[_0xa9ae('0x4')],transfers[_0x1bf8e3[_0xa9ae('0x4')]]['membername'],transfers[_0x1bf8e3[_0xa9ae('0x4')]]['reason'],transfers[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0xa')]));writeDB(transfers[_0x1bf8e3[_0xa9ae('0x4')]],!![]);}if(agents[_0x1bf8e3[_0xa9ae('0x4')]]&&agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x2b')]){agents[_0x1bf8e3['uniqueid']][_0xa9ae('0xf')]=!![];agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x32')]=utils[_0xa9ae('0x18')]();agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x29')]=utils[_0xa9ae('0x33')](agents[_0x1bf8e3[_0xa9ae('0x4')]]['agentcompleteAt'],agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x2b')]);agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x21')]=agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x41')]?_0xa9ae('0x41'):_0xa9ae('0x4f');agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0xa')]=_0xa9ae('0x34');utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')](_0xa9ae('0x50'),_0x1bf8e3[_0xa9ae('0x4')],agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x7')],agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x21')],agents[_0x1bf8e3['uniqueid']][_0xa9ae('0xa')]));writeDB(agents[_0x1bf8e3[_0xa9ae('0x4')]]);}}catch(_0x1f6465){utils[_0xa9ae('0x1b')](util[_0xa9ae('0x15')](_0xa9ae('0x4a'),_0x1bf8e3[_0xa9ae('0x4')]),_0x1f6465);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 1c7dfeb..b583270 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 _0x1883=['[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','billableseconds','localtwolinkedid','[%s][calls][attendedtransfer]','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','_attended','transfertargetchannel','origtransfereruniqueid','origtransfererchannel','userfield','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','mohtime','[%s][calls][musiconholdstop]','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','source','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','type','outboundrouteid','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','set','startsWith','split','substring','lastIndexOf','includes','noop','execif','gotoif','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','uniqueid','blinds','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','CreateVoiceCallReport','recording','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','now','DOCUMENTATION','error','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','hangup','[%s][calls][hangup]','callerid','calleridname'];(function(_0x38e95e,_0x4ea8fe){var _0x4f5693=function(_0x202e08){while(--_0x202e08){_0x38e95e['push'](_0x38e95e['shift']());}};_0x4f5693(++_0x4ea8fe);}(_0x1883,0xab));var _0x3188=function(_0x496ac7,_0x5bd8f5){_0x496ac7=_0x496ac7-0x0;var _0x13f8ea=_0x1883[_0x496ac7];return _0x13f8ea;};'use strict';var _=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var utils=require(_0x3188('0x2'));var transfers=require(_0x3188('0x3'));var dispositions=[_0x3188('0x4'),_0x3188('0x5'),_0x3188('0x5'),_0x3188('0x4'),_0x3188('0x4'),_0x3188('0x4'),_0x3188('0x6'),_0x3188('0x7'),_0x3188('0x5'),_0x3188('0x5'),_0x3188('0x5')];var channels={};function writeDB(_0x3ce7fd){var _0x3e3afb;if(transfers['blinds'][_0x3ce7fd[_0x3188('0x8')]]){_0x3e3afb=_0x3ce7fd[_0x3188('0x8')];_0x3ce7fd['uniqueid']=transfers[_0x3188('0x9')][_0x3ce7fd['uniqueid']][_0x3188('0xa')];}utils[_0x3188('0xb')](util[_0x3188('0xc')](_0x3188('0xd'),_0x3ce7fd['uniqueid'],_0x3ce7fd[_0x3188('0xe')],_0x3ce7fd[_0x3188('0xf')],_0x3ce7fd['membername'],_0x3ce7fd['interface'],_0x3ce7fd[_0x3188('0x10')],_0x3ce7fd[_0x3188('0x11')],_0x3ce7fd[_0x3188('0x12')]));if(_0x3ce7fd[_0x3188('0x13')]){utils[_0x3188('0x14')](_0x3ce7fd[_0x3188('0x13')])['then'](function(_0x276d69){if(_0x276d69){_0x3ce7fd['UserId']=_0x276d69['id'];}utils['request'](_0x3188('0x15'),_0x3ce7fd);});}else{utils['request']('CreateVoiceCallReport',_0x3ce7fd);}if(channels[_0x3ce7fd[_0x3188('0x8')]]){delete channels[_0x3ce7fd[_0x3188('0x8')]];}else if(_0x3e3afb&&channels[_0x3e3afb]){if(!transfers[_0x3188('0x9')][_0x3e3afb][_0x3188('0x16')])delete transfers[_0x3188('0x9')][_0x3e3afb];delete channels[_0x3e3afb];}}exports[_0x3188('0x17')]=function(_0x56e302){try{utils[_0x3188('0x18')](util[_0x3188('0xc')](_0x3188('0x19'),_0x56e302[_0x3188('0x8')]),_0x56e302);if(_0x56e302[_0x3188('0x8')]==_0x56e302[_0x3188('0x1a')]&&_0x56e302[_0x3188('0xe')]!=_0x3188('0x1b')){utils['info'](util[_0x3188('0xc')](_0x3188('0x1c'),_0x56e302['uniqueid'],_0x56e302['context'],_0x56e302['exten']));channels[_0x56e302[_0x3188('0x8')]]={'uniqueid':_0x56e302[_0x3188('0x8')],'accountcode':_0x56e302[_0x3188('0x13')],'source':_0x56e302['calleridnum'],'destination':_0x56e302['exten'],'destinationcontext':_0x56e302[_0x3188('0x1d')],'channel':_0x56e302[_0x3188('0xe')],'starttime':utils[_0x3188('0x1e')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x3188('0x4'),'amaflags':_0x3188('0x1f')};}}catch(_0x4bd5ee){utils[_0x3188('0x20')](util[_0x3188('0xc')]('[%s][calls][newchannel]',_0x56e302[_0x3188('0x8')]),_0x4bd5ee);}};exports['newstate']=function(_0x5c69be){try{utils[_0x3188('0x18')](util[_0x3188('0xc')](_0x3188('0x21'),_0x5c69be[_0x3188('0x8')]),_0x5c69be);if(!_[_0x3188('0x22')](channels[_0x5c69be[_0x3188('0x8')]])&&_0x5c69be[_0x3188('0x23')]==0x6){utils[_0x3188('0xb')](util['format'](_0x3188('0x24'),_0x5c69be[_0x3188('0x8')],_0x5c69be['context'],_0x5c69be[_0x3188('0xe')]));if(_[_0x3188('0x22')](channels[_0x5c69be[_0x3188('0x8')]][_0x3188('0x25')])){channels[_0x5c69be[_0x3188('0x8')]][_0x3188('0x25')]=utils[_0x3188('0x1e')]();}}else if(!_[_0x3188('0x22')](channels[_0x5c69be['linkedid']])&&_0x5c69be[_0x3188('0x23')]==0x6&&_0x5c69be['context']!=_0x3188('0x26')){utils['info'](util[_0x3188('0xc')](_0x3188('0x27'),_0x5c69be[_0x3188('0x8')],_0x5c69be[_0x3188('0x1a')],_0x5c69be[_0x3188('0x1d')],_0x5c69be[_0x3188('0xe')]));channels[_0x5c69be[_0x3188('0x1a')]][_0x3188('0x13')]=_0x5c69be[_0x3188('0x13')];channels[_0x5c69be[_0x3188('0x1a')]][_0x3188('0x28')]=_0x5c69be[_0x3188('0xe')];if(_[_0x3188('0x22')](channels[_0x5c69be[_0x3188('0x1a')]][_0x3188('0x29')])){channels[_0x5c69be[_0x3188('0x1a')]][_0x3188('0x29')]=utils[_0x3188('0x1e')]();}channels[_0x5c69be['linkedid']][_0x3188('0x2a')]=dispositions[_['toNumber'](_0x5c69be[_0x3188('0x23')])]||_0x3188('0x6');}}catch(_0x577b5a){utils[_0x3188('0x20')](util[_0x3188('0xc')](_0x3188('0x21'),_0x5c69be[_0x3188('0x8')]),_0x577b5a);}};exports[_0x3188('0x2b')]=function(_0x2c07c6){try{if(!_[_0x3188('0x22')](channels[_0x2c07c6['uniqueid']])){utils['debug'](util[_0x3188('0xc')](_0x3188('0x2c'),_0x2c07c6[_0x3188('0x8')]),_0x2c07c6);if(_[_0x3188('0x22')](channels[_0x2c07c6['uniqueid']][_0x3188('0x2d')])){channels[_0x2c07c6[_0x3188('0x8')]][_0x3188('0x2d')]=_0x2c07c6[_0x3188('0x2e')]+'\x20<'+_0x2c07c6['calleridnum']+'>';}utils[_0x3188('0xb')](util['format'](_0x3188('0x2f'),_0x2c07c6['uniqueid'],channels[_0x2c07c6[_0x3188('0x8')]][_0x3188('0x2d')],_0x2c07c6[_0x3188('0x30')]));channels[_0x2c07c6[_0x3188('0x8')]][_0x3188('0x31')]=utils[_0x3188('0x1e')]();channels[_0x2c07c6[_0x3188('0x8')]][_0x3188('0x32')]=utils[_0x3188('0x33')](channels[_0x2c07c6[_0x3188('0x8')]]['endtime'],channels[_0x2c07c6[_0x3188('0x8')]][_0x3188('0x34')]);channels[_0x2c07c6[_0x3188('0x8')]][_0x3188('0x35')]=channels[_0x2c07c6[_0x3188('0x8')]][_0x3188('0x29')]?utils['diffTime'](channels[_0x2c07c6[_0x3188('0x8')]]['endtime'],channels[_0x2c07c6[_0x3188('0x8')]][_0x3188('0x29')]):0x0;writeDB(channels[_0x2c07c6[_0x3188('0x8')]]);}}catch(_0x8f3756){utils[_0x3188('0x20')](util['format']('[%s][calls][hangup]',_0x2c07c6['uniqueid']),_0x8f3756);}};exports['attendedtransfer']=function(_0x4b9ed3){try{if(!_[_0x3188('0x22')](channels[_0x4b9ed3[_0x3188('0x36')]])){utils[_0x3188('0x18')](util[_0x3188('0xc')](_0x3188('0x37'),_0x4b9ed3['origtransfereruniqueid']),_0x4b9ed3);if(channels[_0x4b9ed3[_0x3188('0x36')]]['channel']==_0x4b9ed3[_0x3188('0x38')]){utils[_0x3188('0xb')](util[_0x3188('0xc')](_0x3188('0x39'),_0x4b9ed3['origtransfereruniqueid'],_0x4b9ed3[_0x3188('0x36')],_0x4b9ed3[_0x3188('0x3a')]));channels[_0x4b9ed3[_0x3188('0x36')]][_0x3188('0x28')]=_0x4b9ed3[_0x3188('0x3a')];channels[_0x4b9ed3['localtwolinkedid']]['userfield']=_0x3188('0x3b');}else if(channels[_0x4b9ed3[_0x3188('0x36')]]['channel']=_0x4b9ed3[_0x3188('0x3c')]){utils[_0x3188('0xb')](util['format'](_0x3188('0x39'),_0x4b9ed3[_0x3188('0x3d')],_0x4b9ed3[_0x3188('0x36')],_0x4b9ed3[_0x3188('0x3e')]));channels[_0x4b9ed3[_0x3188('0x36')]]['destinationchannel']=_0x4b9ed3[_0x3188('0x3e')];channels[_0x4b9ed3['localtwolinkedid']][_0x3188('0x3f')]=_0x3188('0x3b');}}}catch(_0x12ef8d){utils[_0x3188('0x20')](util[_0x3188('0xc')](_0x3188('0x37'),_0x4b9ed3[_0x3188('0x3d')]),_0x12ef8d);}};exports[_0x3188('0x40')]=function(_0x5f7205){try{if(!_[_0x3188('0x22')](channels[_0x5f7205[_0x3188('0x8')]])){utils['debug'](util['format'](_0x3188('0x41'),_0x5f7205['uniqueid']),_0x5f7205);channels[_0x5f7205[_0x3188('0x8')]][_0x3188('0x42')]=utils['now']();utils[_0x3188('0xb')](util[_0x3188('0xc')](_0x3188('0x43'),_0x5f7205[_0x3188('0x8')],channels[_0x5f7205[_0x3188('0x8')]][_0x3188('0x42')]));}}catch(_0xc557e2){utils[_0x3188('0x20')](util['format'](_0x3188('0x41'),_0x5f7205[_0x3188('0x8')]),_0xc557e2);}};exports['musiconholdstop']=function(_0x354192){try{if(!_['isNil'](channels[_0x354192[_0x3188('0x8')]])){utils[_0x3188('0x18')](util[_0x3188('0xc')]('[%s][calls][musiconholdstop]',_0x354192['uniqueid']),_0x354192);if(!_['isNil'](channels[_0x354192['uniqueid']]['musiconholdstartAt'])){channels[_0x354192[_0x3188('0x8')]][_0x3188('0x44')]+=utils['diffTime'](utils[_0x3188('0x1e')](),channels[_0x354192[_0x3188('0x8')]]['musiconholdstartAt']);utils['info'](util['format']('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x354192['uniqueid'],channels[_0x354192[_0x3188('0x8')]][_0x3188('0x44')]));delete channels[_0x354192[_0x3188('0x8')]][_0x3188('0x42')];}}}catch(_0x36bc59){utils['error'](util[_0x3188('0xc')](_0x3188('0x45'),_0x354192['uniqueid']),_0x36bc59);}};exports['varset']=function(_0x4ea5be){try{if(!_[_0x3188('0x22')](channels[_0x4ea5be[_0x3188('0x8')]])){utils[_0x3188('0x18')](util['format'](_0x3188('0x46'),_0x4ea5be[_0x3188('0x8')]),_0x4ea5be);if(!_[_0x3188('0x22')](_0x4ea5be[_0x3188('0x47')][_0x3188('0x48')])){utils['info'](util[_0x3188('0xc')](_0x3188('0x49'),_0x4ea5be[_0x3188('0x8')],_0x4ea5be['value']));channels[_0x4ea5be[_0x3188('0x8')]][_0x3188('0x4a')]=_0x4ea5be[_0x3188('0x4b')];}if(!_[_0x3188('0x22')](_0x4ea5be['variable'][_0x3188('0x4c')])){utils[_0x3188('0xb')](util[_0x3188('0xc')](_0x3188('0x4d'),_0x4ea5be[_0x3188('0x8')],_0x4ea5be[_0x3188('0x4b')]));channels[_0x4ea5be[_0x3188('0x8')]]['destination']=_0x4ea5be[_0x3188('0x4b')];channels[_0x4ea5be[_0x3188('0x8')]][_0x3188('0x2d')]='\x22'+_0x4ea5be[_0x3188('0x4b')]+_0x3188('0x4e')+_0x4ea5be[_0x3188('0x4b')]+'>';}if(!_[_0x3188('0x22')](_0x4ea5be['variable'][_0x3188('0x4f')])||!_[_0x3188('0x22')](_0x4ea5be[_0x3188('0x47')][_0x3188('0x50')])){utils[_0x3188('0xb')](util['format'](_0x3188('0x51'),_0x4ea5be[_0x3188('0x8')],!_['isNil'](_0x4ea5be['variable'][_0x3188('0x4f')])?_0x3188('0x4f'):_0x3188('0x50'),_0x4ea5be[_0x3188('0x4b')]));channels[_0x4ea5be[_0x3188('0x8')]][_0x3188('0x2d')]=_0x4ea5be[_0x3188('0x4b')];}if(!_[_0x3188('0x22')](_0x4ea5be[_0x3188('0x47')][_0x3188('0x52')])||!_['isNil'](_0x4ea5be[_0x3188('0x47')]['xmcs-queue'])){utils['info'](util[_0x3188('0xc')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x4ea5be[_0x3188('0x8')],!_[_0x3188('0x22')](_0x4ea5be[_0x3188('0x47')][_0x3188('0x52')])?_0x3188('0x52'):_0x3188('0x53'),_0x4ea5be['value']));channels[_0x4ea5be[_0x3188('0x8')]][_0x3188('0x54')]='Queue';channels[_0x4ea5be[_0x3188('0x8')]][_0x3188('0x55')]=_0x4ea5be[_0x3188('0x4b')];channels[_0x4ea5be[_0x3188('0x8')]][_0x3188('0xf')]=!![];}if(!_[_0x3188('0x22')](_0x4ea5be['variable'][_0x3188('0x56')])){utils[_0x3188('0xb')](util['format'](_0x3188('0x57'),_0x4ea5be[_0x3188('0x8')],_0x4ea5be[_0x3188('0x4b')]));channels[_0x4ea5be['uniqueid']][_0x3188('0x58')]=_0x4ea5be[_0x3188('0x4b')];}if(!_[_0x3188('0x22')](_0x4ea5be[_0x3188('0x47')][_0x3188('0x59')])){utils[_0x3188('0xb')](util[_0x3188('0xc')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x4ea5be['uniqueid'],_0x4ea5be['value']));channels[_0x4ea5be['uniqueid']][_0x3188('0x5a')]=_0x4ea5be[_0x3188('0x4b')];}if(!_[_0x3188('0x22')](_0x4ea5be[_0x3188('0x47')][_0x3188('0x5b')])){utils['info'](util[_0x3188('0xc')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x4ea5be[_0x3188('0x8')],_0x4ea5be[_0x3188('0x4b')]));channels[_0x4ea5be['uniqueid']][_0x3188('0x5c')]=_0x4ea5be['value'];}if(!_[_0x3188('0x22')](_0x4ea5be[_0x3188('0x47')]['sipcallid'])){utils[_0x3188('0xb')](util['format'](_0x3188('0x5d'),_0x4ea5be[_0x3188('0x8')],_0x4ea5be[_0x3188('0x4b')]));channels[_0x4ea5be[_0x3188('0x8')]][_0x3188('0x5e')]=_0x4ea5be['value'];}}}catch(_0x267523){utils[_0x3188('0x20')](util['format'](_0x3188('0x46'),_0x4ea5be[_0x3188('0x8')]),_0x267523);}};exports['newexten']=function(_0x47da9c){try{if(!_[_0x3188('0x22')](channels[_0x47da9c[_0x3188('0x8')]])){utils[_0x3188('0x18')](util[_0x3188('0xc')](_0x3188('0x5f'),_0x47da9c[_0x3188('0x8')]),_0x47da9c);utils['info'](util[_0x3188('0xc')](_0x3188('0x60'),_0x47da9c[_0x3188('0x8')],_0x47da9c['application'],_0x47da9c[_0x3188('0x61')]));if(_0x47da9c[_0x3188('0x62')][_0x3188('0x63')]()==_0x3188('0x64')&&_[_0x3188('0x65')](_0x47da9c[_0x3188('0x61')]['toLowerCase'](),'cdr')){var _0x4f3223=_0x47da9c[_0x3188('0x61')][_0x3188('0x66')]('=');var _0x52c0d5=_0x4f3223[0x0][_0x3188('0x67')](_0x4f3223[0x0][_0x3188('0x68')]('(')+0x1,_0x4f3223[0x0][_0x3188('0x68')](')'));var _0x16bdc2=_0x4f3223[0x1];channels[_0x47da9c[_0x3188('0x8')]][_0x52c0d5]=_0x16bdc2;}if(!_[_0x3188('0x69')](['hangup',_0x3188('0x6a'),_0x3188('0x6b'),_0x3188('0x64'),_0x3188('0x6c')],_0x47da9c[_0x3188('0x62')][_0x3188('0x63')]())){channels[_0x47da9c[_0x3188('0x8')]][_0x3188('0x54')]=_0x47da9c[_0x3188('0x62')];channels[_0x47da9c[_0x3188('0x8')]][_0x3188('0x55')]=_0x47da9c[_0x3188('0x61')];}}}catch(_0x37b128){utils[_0x3188('0x20')](util[_0x3188('0xc')](_0x3188('0x5f'),_0x47da9c[_0x3188('0x8')]),_0x37b128);}}; \ No newline at end of file +var _0xfc9b=['application','appdata','toLowerCase','set','startsWith','cdr','substring','lastIndexOf','includes','noop','execif','gotoif','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','uniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','interface','calleridnum','lastevent','getUserByInternal','accountcode','then','request','CreateVoiceCallReport','blinds','recording','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','destinationchannel','answertime','disposition','toNumber','hangup','[%s][calls][hangup]','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','starttime','billableseconds','diffTime','[%s][calls][attendedtransfer]','transfereechannel','localtwolinkedid','secondtransfererchannel','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','origtransfererchannel','userfield','_attended','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','ContactId','xmd-cdrtype','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][newexten]\x20application:%s\x20appdata:%s'];(function(_0x30ed87,_0x168cbd){var _0x40069d=function(_0x2e926e){while(--_0x2e926e){_0x30ed87['push'](_0x30ed87['shift']());}};_0x40069d(++_0x168cbd);}(_0xfc9b,0x74));var _0xbfc9=function(_0x43460f,_0x2d721f){_0x43460f=_0x43460f-0x0;var _0x445615=_0xfc9b[_0x43460f];return _0x445615;};'use strict';var _=require(_0xbfc9('0x0'));var util=require(_0xbfc9('0x1'));var utils=require(_0xbfc9('0x2'));var transfers=require(_0xbfc9('0x3'));var dispositions=[_0xbfc9('0x4'),_0xbfc9('0x5'),_0xbfc9('0x5'),'NO\x20ANSWER',_0xbfc9('0x4'),'NO\x20ANSWER',_0xbfc9('0x6'),_0xbfc9('0x7'),'FAILED',_0xbfc9('0x5'),_0xbfc9('0x5')];var channels={};function writeDB(_0xed6492){var _0xe288d1;if(transfers['blinds'][_0xed6492[_0xbfc9('0x8')]]){_0xe288d1=_0xed6492['uniqueid'];_0xed6492[_0xbfc9('0x8')]=transfers['blinds'][_0xed6492[_0xbfc9('0x8')]]['transfereeuniqueid'];}utils[_0xbfc9('0x9')](util[_0xbfc9('0xa')](_0xbfc9('0xb'),_0xed6492[_0xbfc9('0x8')],_0xed6492[_0xbfc9('0xc')],_0xed6492[_0xbfc9('0xd')],_0xed6492['membername'],_0xed6492[_0xbfc9('0xe')],_0xed6492[_0xbfc9('0xf')],_0xed6492['connectedlinenum'],_0xed6492[_0xbfc9('0x10')]));if(_0xed6492['accountcode']){utils[_0xbfc9('0x11')](_0xed6492[_0xbfc9('0x12')])[_0xbfc9('0x13')](function(_0x2a5c78){if(_0x2a5c78){_0xed6492['UserId']=_0x2a5c78['id'];}utils[_0xbfc9('0x14')](_0xbfc9('0x15'),_0xed6492);});}else{utils[_0xbfc9('0x14')](_0xbfc9('0x15'),_0xed6492);}if(channels[_0xed6492[_0xbfc9('0x8')]]){delete channels[_0xed6492[_0xbfc9('0x8')]];}else if(_0xe288d1&&channels[_0xe288d1]){if(!transfers[_0xbfc9('0x16')][_0xe288d1][_0xbfc9('0x17')])delete transfers[_0xbfc9('0x16')][_0xe288d1];delete channels[_0xe288d1];}}exports[_0xbfc9('0x18')]=function(_0x3dd866){try{utils[_0xbfc9('0x19')](util[_0xbfc9('0xa')](_0xbfc9('0x1a'),_0x3dd866[_0xbfc9('0x8')]),_0x3dd866);if(_0x3dd866[_0xbfc9('0x8')]==_0x3dd866[_0xbfc9('0x1b')]&&_0x3dd866[_0xbfc9('0xc')]!=_0xbfc9('0x1c')){utils[_0xbfc9('0x9')](util[_0xbfc9('0xa')](_0xbfc9('0x1d'),_0x3dd866['uniqueid'],_0x3dd866[_0xbfc9('0x1e')],_0x3dd866[_0xbfc9('0x1f')]));channels[_0x3dd866[_0xbfc9('0x8')]]={'uniqueid':_0x3dd866[_0xbfc9('0x8')],'accountcode':_0x3dd866[_0xbfc9('0x12')],'source':_0x3dd866[_0xbfc9('0xf')],'destination':_0x3dd866[_0xbfc9('0x1f')],'destinationcontext':_0x3dd866[_0xbfc9('0x1e')],'channel':_0x3dd866[_0xbfc9('0xc')],'starttime':utils[_0xbfc9('0x20')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xbfc9('0x4'),'amaflags':_0xbfc9('0x21')};}}catch(_0x39bc58){utils[_0xbfc9('0x22')](util['format'](_0xbfc9('0x1a'),_0x3dd866[_0xbfc9('0x8')]),_0x39bc58);}};exports[_0xbfc9('0x23')]=function(_0x2ba7d6){try{utils[_0xbfc9('0x19')](util['format'](_0xbfc9('0x24'),_0x2ba7d6[_0xbfc9('0x8')]),_0x2ba7d6);if(!_[_0xbfc9('0x25')](channels[_0x2ba7d6[_0xbfc9('0x8')]])&&_0x2ba7d6[_0xbfc9('0x26')]==0x6){utils[_0xbfc9('0x9')](util[_0xbfc9('0xa')](_0xbfc9('0x27'),_0x2ba7d6[_0xbfc9('0x8')],_0x2ba7d6['context'],_0x2ba7d6['channel']));if(_['isNil'](channels[_0x2ba7d6[_0xbfc9('0x8')]]['systemanswertime'])){channels[_0x2ba7d6['uniqueid']][_0xbfc9('0x28')]=utils[_0xbfc9('0x20')]();}}else if(!_[_0xbfc9('0x25')](channels[_0x2ba7d6[_0xbfc9('0x1b')]])&&_0x2ba7d6[_0xbfc9('0x26')]==0x6&&_0x2ba7d6[_0xbfc9('0x1e')]!=_0xbfc9('0x29')){utils[_0xbfc9('0x9')](util[_0xbfc9('0xa')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x2ba7d6[_0xbfc9('0x8')],_0x2ba7d6[_0xbfc9('0x1b')],_0x2ba7d6[_0xbfc9('0x1e')],_0x2ba7d6['channel']));channels[_0x2ba7d6[_0xbfc9('0x1b')]][_0xbfc9('0x12')]=_0x2ba7d6[_0xbfc9('0x12')];channels[_0x2ba7d6[_0xbfc9('0x1b')]][_0xbfc9('0x2a')]=_0x2ba7d6[_0xbfc9('0xc')];if(_[_0xbfc9('0x25')](channels[_0x2ba7d6[_0xbfc9('0x1b')]][_0xbfc9('0x2b')])){channels[_0x2ba7d6[_0xbfc9('0x1b')]]['answertime']=utils['now']();}channels[_0x2ba7d6[_0xbfc9('0x1b')]][_0xbfc9('0x2c')]=dispositions[_[_0xbfc9('0x2d')](_0x2ba7d6[_0xbfc9('0x26')])]||_0xbfc9('0x6');}}catch(_0x115c90){utils['error'](util[_0xbfc9('0xa')]('[%s][calls][newstate]',_0x2ba7d6['uniqueid']),_0x115c90);}};exports[_0xbfc9('0x2e')]=function(_0x4b6c8a){try{if(!_[_0xbfc9('0x25')](channels[_0x4b6c8a[_0xbfc9('0x8')]])){utils[_0xbfc9('0x19')](util['format'](_0xbfc9('0x2f'),_0x4b6c8a['uniqueid']),_0x4b6c8a);if(_['isNil'](channels[_0x4b6c8a[_0xbfc9('0x8')]][_0xbfc9('0x30')])){channels[_0x4b6c8a['uniqueid']][_0xbfc9('0x30')]=_0x4b6c8a['calleridname']+'\x20<'+_0x4b6c8a['calleridnum']+'>';}utils[_0xbfc9('0x9')](util[_0xbfc9('0xa')](_0xbfc9('0x31'),_0x4b6c8a[_0xbfc9('0x8')],channels[_0x4b6c8a[_0xbfc9('0x8')]][_0xbfc9('0x30')],_0x4b6c8a[_0xbfc9('0x32')]));channels[_0x4b6c8a[_0xbfc9('0x8')]]['endtime']=utils[_0xbfc9('0x20')]();channels[_0x4b6c8a[_0xbfc9('0x8')]]['duration']=utils['diffTime'](channels[_0x4b6c8a[_0xbfc9('0x8')]][_0xbfc9('0x33')],channels[_0x4b6c8a['uniqueid']][_0xbfc9('0x34')]);channels[_0x4b6c8a[_0xbfc9('0x8')]][_0xbfc9('0x35')]=channels[_0x4b6c8a[_0xbfc9('0x8')]][_0xbfc9('0x2b')]?utils[_0xbfc9('0x36')](channels[_0x4b6c8a[_0xbfc9('0x8')]][_0xbfc9('0x33')],channels[_0x4b6c8a[_0xbfc9('0x8')]][_0xbfc9('0x2b')]):0x0;writeDB(channels[_0x4b6c8a['uniqueid']]);}}catch(_0x92a5d0){utils['error'](util['format'](_0xbfc9('0x2f'),_0x4b6c8a[_0xbfc9('0x8')]),_0x92a5d0);}};exports['attendedtransfer']=function(_0x21d0ad){try{if(!_[_0xbfc9('0x25')](channels[_0x21d0ad['localtwolinkedid']])){utils[_0xbfc9('0x19')](util[_0xbfc9('0xa')](_0xbfc9('0x37'),_0x21d0ad['origtransfereruniqueid']),_0x21d0ad);if(channels[_0x21d0ad['localtwolinkedid']][_0xbfc9('0xc')]==_0x21d0ad[_0xbfc9('0x38')]){utils['info'](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x21d0ad['origtransfereruniqueid'],_0x21d0ad[_0xbfc9('0x39')],_0x21d0ad[_0xbfc9('0x3a')]));channels[_0x21d0ad['localtwolinkedid']][_0xbfc9('0x2a')]=_0x21d0ad[_0xbfc9('0x3a')];channels[_0x21d0ad['localtwolinkedid']]['userfield']='_attended';}else if(channels[_0x21d0ad[_0xbfc9('0x39')]][_0xbfc9('0xc')]=_0x21d0ad[_0xbfc9('0x3b')]){utils[_0xbfc9('0x9')](util[_0xbfc9('0xa')](_0xbfc9('0x3c'),_0x21d0ad[_0xbfc9('0x3d')],_0x21d0ad[_0xbfc9('0x39')],_0x21d0ad[_0xbfc9('0x3e')]));channels[_0x21d0ad[_0xbfc9('0x39')]]['destinationchannel']=_0x21d0ad[_0xbfc9('0x3e')];channels[_0x21d0ad['localtwolinkedid']][_0xbfc9('0x3f')]=_0xbfc9('0x40');}}}catch(_0x230b1f){utils['error'](util['format'](_0xbfc9('0x37'),_0x21d0ad[_0xbfc9('0x3d')]),_0x230b1f);}};exports[_0xbfc9('0x41')]=function(_0x593a1c){try{if(!_[_0xbfc9('0x25')](channels[_0x593a1c[_0xbfc9('0x8')]])){utils['debug'](util[_0xbfc9('0xa')](_0xbfc9('0x42'),_0x593a1c['uniqueid']),_0x593a1c);channels[_0x593a1c[_0xbfc9('0x8')]][_0xbfc9('0x43')]=utils['now']();utils[_0xbfc9('0x9')](util[_0xbfc9('0xa')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x593a1c[_0xbfc9('0x8')],channels[_0x593a1c[_0xbfc9('0x8')]]['musiconholdstartAt']));}}catch(_0x5e7c01){utils[_0xbfc9('0x22')](util[_0xbfc9('0xa')](_0xbfc9('0x42'),_0x593a1c['uniqueid']),_0x5e7c01);}};exports[_0xbfc9('0x44')]=function(_0x706e5e){try{if(!_[_0xbfc9('0x25')](channels[_0x706e5e['uniqueid']])){utils[_0xbfc9('0x19')](util[_0xbfc9('0xa')]('[%s][calls][musiconholdstop]',_0x706e5e[_0xbfc9('0x8')]),_0x706e5e);if(!_[_0xbfc9('0x25')](channels[_0x706e5e[_0xbfc9('0x8')]][_0xbfc9('0x43')])){channels[_0x706e5e['uniqueid']]['mohtime']+=utils['diffTime'](utils[_0xbfc9('0x20')](),channels[_0x706e5e[_0xbfc9('0x8')]]['musiconholdstartAt']);utils[_0xbfc9('0x9')](util[_0xbfc9('0xa')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x706e5e[_0xbfc9('0x8')],channels[_0x706e5e[_0xbfc9('0x8')]]['mohtime']));delete channels[_0x706e5e['uniqueid']][_0xbfc9('0x43')];}}}catch(_0x31ae23){utils['error'](util[_0xbfc9('0xa')]('[%s][calls][musiconholdstop]',_0x706e5e[_0xbfc9('0x8')]),_0x31ae23);}};exports['varset']=function(_0x55fe7f){try{if(!_[_0xbfc9('0x25')](channels[_0x55fe7f[_0xbfc9('0x8')]])){utils[_0xbfc9('0x19')](util[_0xbfc9('0xa')](_0xbfc9('0x45'),_0x55fe7f[_0xbfc9('0x8')]),_0x55fe7f);if(!_[_0xbfc9('0x25')](_0x55fe7f[_0xbfc9('0x46')][_0xbfc9('0x47')])){utils[_0xbfc9('0x9')](util['format'](_0xbfc9('0x48'),_0x55fe7f[_0xbfc9('0x8')],_0x55fe7f[_0xbfc9('0x49')]));channels[_0x55fe7f[_0xbfc9('0x8')]][_0xbfc9('0x4a')]=_0x55fe7f[_0xbfc9('0x49')];}if(!_[_0xbfc9('0x25')](_0x55fe7f['variable']['xmd-phone'])){utils[_0xbfc9('0x9')](util[_0xbfc9('0xa')](_0xbfc9('0x4b'),_0x55fe7f[_0xbfc9('0x8')],_0x55fe7f[_0xbfc9('0x49')]));channels[_0x55fe7f['uniqueid']]['destination']=_0x55fe7f['value'];channels[_0x55fe7f[_0xbfc9('0x8')]][_0xbfc9('0x30')]='\x22'+_0x55fe7f[_0xbfc9('0x49')]+'\x22\x20<'+_0x55fe7f['value']+'>';}if(!_['isNil'](_0x55fe7f[_0xbfc9('0x46')][_0xbfc9('0x4c')])||!_['isNil'](_0x55fe7f[_0xbfc9('0x46')][_0xbfc9('0x4d')])){utils[_0xbfc9('0x9')](util[_0xbfc9('0xa')](_0xbfc9('0x4e'),_0x55fe7f['uniqueid'],!_['isNil'](_0x55fe7f[_0xbfc9('0x46')][_0xbfc9('0x4c')])?'xmd-callerid-preview':_0xbfc9('0x4d'),_0x55fe7f[_0xbfc9('0x49')]));channels[_0x55fe7f[_0xbfc9('0x8')]][_0xbfc9('0x30')]=_0x55fe7f[_0xbfc9('0x49')];}if(!_['isNil'](_0x55fe7f[_0xbfc9('0x46')][_0xbfc9('0x4f')])||!_[_0xbfc9('0x25')](_0x55fe7f[_0xbfc9('0x46')][_0xbfc9('0x50')])){utils[_0xbfc9('0x9')](util[_0xbfc9('0xa')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x55fe7f['uniqueid'],!_['isNil'](_0x55fe7f[_0xbfc9('0x46')][_0xbfc9('0x4f')])?'xmd-queue':_0xbfc9('0x50'),_0x55fe7f['value']));channels[_0x55fe7f[_0xbfc9('0x8')]][_0xbfc9('0x51')]=_0xbfc9('0x52');channels[_0x55fe7f[_0xbfc9('0x8')]]['lastdata']=_0x55fe7f['value'];channels[_0x55fe7f[_0xbfc9('0x8')]][_0xbfc9('0xd')]=!![];}if(!_[_0xbfc9('0x25')](_0x55fe7f[_0xbfc9('0x46')]['xmd-contactid'])){utils[_0xbfc9('0x9')](util[_0xbfc9('0xa')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x55fe7f[_0xbfc9('0x8')],_0x55fe7f[_0xbfc9('0x49')]));channels[_0x55fe7f[_0xbfc9('0x8')]][_0xbfc9('0x53')]=_0x55fe7f['value'];}if(!_['isNil'](_0x55fe7f[_0xbfc9('0x46')][_0xbfc9('0x54')])){utils['info'](util[_0xbfc9('0xa')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x55fe7f[_0xbfc9('0x8')],_0x55fe7f[_0xbfc9('0x49')]));channels[_0x55fe7f[_0xbfc9('0x8')]][_0xbfc9('0x55')]=_0x55fe7f[_0xbfc9('0x49')];}if(!_[_0xbfc9('0x25')](_0x55fe7f[_0xbfc9('0x46')][_0xbfc9('0x56')])){utils['info'](util['format'](_0xbfc9('0x57'),_0x55fe7f['uniqueid'],_0x55fe7f[_0xbfc9('0x49')]));channels[_0x55fe7f['uniqueid']][_0xbfc9('0x58')]=_0x55fe7f[_0xbfc9('0x49')];}if(!_['isNil'](_0x55fe7f[_0xbfc9('0x46')][_0xbfc9('0x59')])){utils[_0xbfc9('0x9')](util[_0xbfc9('0xa')](_0xbfc9('0x5a'),_0x55fe7f[_0xbfc9('0x8')],_0x55fe7f['value']));channels[_0x55fe7f['uniqueid']][_0xbfc9('0x59')]=_0x55fe7f[_0xbfc9('0x49')];}}}catch(_0xd5145e){utils[_0xbfc9('0x22')](util[_0xbfc9('0xa')](_0xbfc9('0x45'),_0x55fe7f[_0xbfc9('0x8')]),_0xd5145e);}};exports['newexten']=function(_0x429c7f){try{if(!_[_0xbfc9('0x25')](channels[_0x429c7f[_0xbfc9('0x8')]])){utils[_0xbfc9('0x19')](util[_0xbfc9('0xa')]('[%s][calls][newexten]',_0x429c7f['uniqueid']),_0x429c7f);utils[_0xbfc9('0x9')](util[_0xbfc9('0xa')](_0xbfc9('0x5b'),_0x429c7f[_0xbfc9('0x8')],_0x429c7f[_0xbfc9('0x5c')],_0x429c7f[_0xbfc9('0x5d')]));if(_0x429c7f[_0xbfc9('0x5c')][_0xbfc9('0x5e')]()==_0xbfc9('0x5f')&&_[_0xbfc9('0x60')](_0x429c7f[_0xbfc9('0x5d')]['toLowerCase'](),_0xbfc9('0x61'))){var _0x21b35d=_0x429c7f[_0xbfc9('0x5d')]['split']('=');var _0x5407ae=_0x21b35d[0x0][_0xbfc9('0x62')](_0x21b35d[0x0][_0xbfc9('0x63')]('(')+0x1,_0x21b35d[0x0][_0xbfc9('0x63')](')'));var _0x38de63=_0x21b35d[0x1];channels[_0x429c7f[_0xbfc9('0x8')]][_0x5407ae]=_0x38de63;}if(!_[_0xbfc9('0x64')]([_0xbfc9('0x2e'),_0xbfc9('0x65'),_0xbfc9('0x66'),'set',_0xbfc9('0x67')],_0x429c7f['application'][_0xbfc9('0x5e')]())){channels[_0x429c7f[_0xbfc9('0x8')]][_0xbfc9('0x51')]=_0x429c7f[_0xbfc9('0x5c')];channels[_0x429c7f[_0xbfc9('0x8')]]['lastdata']=_0x429c7f[_0xbfc9('0x5d')];}}}catch(_0x2ae073){utils[_0xbfc9('0x22')](util[_0xbfc9('0xa')]('[%s][calls][newexten]',_0x429c7f['uniqueid']),_0x2ae073);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index a01abe4..c179c23 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 _0x91cb=['managerevent','./utils','connect','[core]\x20connected','[core]\x20shutdown','fullybooted','info','[core]\x20fullybooted','error','[core]\x20error','[core]\x20close'];(function(_0x5d1f6f,_0x23d653){var _0x5193f6=function(_0x302b62){while(--_0x302b62){_0x5d1f6f['push'](_0x5d1f6f['shift']());}};_0x5193f6(++_0x23d653);}(_0x91cb,0xbc));var _0xb91c=function(_0x14d08c,_0x5b7091){_0x14d08c=_0x14d08c-0x0;var _0x5f5bd9=_0x91cb[_0x14d08c];return _0x5f5bd9;};'use strict';var utils=require(_0xb91c('0x0'));exports[_0xb91c('0x1')]=function(){utils['info'](_0xb91c('0x2'));};exports['shutdown']=function(){utils['info'](_0xb91c('0x3'));};exports[_0xb91c('0x4')]=function(){utils[_0xb91c('0x5')](_0xb91c('0x6'));};exports[_0xb91c('0x7')]=function(_0x244d9b){utils['error'](_0xb91c('0x8'),_0x244d9b);};exports['close']=function(){utils['info'](_0xb91c('0x9'));};exports[_0xb91c('0xa')]=function(_0x1b79a0){}; \ No newline at end of file +var _0x4c7a=['error','[core]\x20error','close','[core]\x20close','managerevent','./utils','connect','info','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x4c7a,0x1e5));var _0xa4c7=function(_0x478942,_0x3c4b39){_0x478942=_0x478942-0x0;var _0x54b821=_0x4c7a[_0x478942];return _0x54b821;};'use strict';var utils=require(_0xa4c7('0x0'));exports[_0xa4c7('0x1')]=function(){utils[_0xa4c7('0x2')]('[core]\x20connected');};exports[_0xa4c7('0x3')]=function(){utils[_0xa4c7('0x2')](_0xa4c7('0x4'));};exports[_0xa4c7('0x5')]=function(){utils[_0xa4c7('0x2')](_0xa4c7('0x6'));};exports[_0xa4c7('0x7')]=function(_0x596c4c){utils[_0xa4c7('0x7')](_0xa4c7('0x8'),_0x596c4c);};exports[_0xa4c7('0x9')]=function(){utils['info'](_0xa4c7('0xa'));};exports[_0xa4c7('0xb')]=function(_0x66a817){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 393e9d5..9441f18 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 _0xd3f5=['connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','diffTime','holdtime','endtime','billableseconds','lodash','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','dialstatus','request','CreateVoiceDialReport','newexten','[%s][dials][newexten]','application','startsWith','cdr(routeid)','appdata','split','debug','[%s][dials][varset]','isNil','outboundrouteid','value','error','dialbegin','[%s][dials][dialbegin]','assign','starttime','lastevent','dialend','ANSWER','answertime','now'];(function(_0x589f37,_0x34aee3){var _0x2c4cbe=function(_0x37eac2){while(--_0x37eac2){_0x589f37['push'](_0x589f37['shift']());}};_0x2c4cbe(++_0x34aee3);}(_0xd3f5,0x1e2));var _0x5d3f=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xd3f5[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x5d3f('0x0'));var util=require('util');var utils=require(_0x5d3f('0x1'));var dials={};function writeDB(_0x4275a5){utils[_0x5d3f('0x2')](util[_0x5d3f('0x3')](_0x5d3f('0x4'),_0x4275a5[_0x5d3f('0x5')],_0x4275a5[_0x5d3f('0x6')],_0x4275a5[_0x5d3f('0x7')],_0x4275a5[_0x5d3f('0x8')],_0x4275a5['connectedlinenum'],_0x4275a5[_0x5d3f('0x9')]));utils[_0x5d3f('0xa')](_0x5d3f('0xb'),_0x4275a5);delete dials[_0x4275a5[_0x5d3f('0x5')]];}exports[_0x5d3f('0xc')]=function(_0x4d2141){try{utils['debug'](util[_0x5d3f('0x3')](_0x5d3f('0xd'),_0x4d2141['uniqueid']),_0x4d2141);utils['info'](util[_0x5d3f('0x3')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x4d2141[_0x5d3f('0x5')],_0x4d2141[_0x5d3f('0xe')],_0x4d2141['appdata']));if(_0x4d2141[_0x5d3f('0xe')]['toLowerCase']()=='set'&&_[_0x5d3f('0xf')](_0x4d2141['appdata']['toLowerCase'](),_0x5d3f('0x10'))){var _0x4150dc=_0x4d2141[_0x5d3f('0x11')][_0x5d3f('0x12')]('=');dials[_0x4d2141['uniqueid']]={'routeId':_0x4150dc[0x1]};}}catch(_0x232da0){utils['error'](util[_0x5d3f('0x3')](_0x5d3f('0xd'),_0x4d2141[_0x5d3f('0x5')]),_0x232da0);}};exports['varset']=function(_0xdebdd0){try{utils[_0x5d3f('0x13')](util[_0x5d3f('0x3')](_0x5d3f('0x14'),_0xdebdd0[_0x5d3f('0x5')]),_0xdebdd0);if(!_[_0x5d3f('0x15')](_0xdebdd0['variable'][_0x5d3f('0x16')])){utils[_0x5d3f('0x2')](util[_0x5d3f('0x3')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0xdebdd0['uniqueid'],_0xdebdd0[_0x5d3f('0x17')]));dials[_0xdebdd0[_0x5d3f('0x5')]]={'routeId':_0xdebdd0[_0x5d3f('0x17')]};}}catch(_0x420f6e){utils[_0x5d3f('0x18')](util[_0x5d3f('0x3')]('[%s][dials][varset]',_0xdebdd0[_0x5d3f('0x5')]),_0x420f6e);}};exports[_0x5d3f('0x19')]=function(_0x2a0a9b){try{if(!_[_0x5d3f('0x15')](dials[_0x2a0a9b['uniqueid']])){utils[_0x5d3f('0x13')](util[_0x5d3f('0x3')](_0x5d3f('0x1a'),_0x2a0a9b[_0x5d3f('0x5')]),_0x2a0a9b);dials[_0x2a0a9b[_0x5d3f('0x5')]]=_[_0x5d3f('0x1b')](dials[_0x2a0a9b[_0x5d3f('0x5')]],_0x2a0a9b);dials[_0x2a0a9b[_0x5d3f('0x5')]][_0x5d3f('0x1c')]=utils['now']();dials[_0x2a0a9b[_0x5d3f('0x5')]][_0x5d3f('0x1d')]='called';utils[_0x5d3f('0x2')](util[_0x5d3f('0x3')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x2a0a9b[_0x5d3f('0x5')],dials[_0x2a0a9b[_0x5d3f('0x5')]]['starttime']));}}catch(_0x1149fe){utils[_0x5d3f('0x18')](util['format'](_0x5d3f('0x1a'),_0x2a0a9b[_0x5d3f('0x5')]),_0x1149fe);}};exports[_0x5d3f('0x1e')]=function(_0x5dc7e8){try{if(!_[_0x5d3f('0x15')](dials[_0x5dc7e8[_0x5d3f('0x5')]])){utils[_0x5d3f('0x13')](util['format']('[%s][dials][dialend]',_0x5dc7e8['uniqueid']),_0x5dc7e8);dials[_0x5dc7e8[_0x5d3f('0x5')]][_0x5d3f('0x9')]=_0x5dc7e8[_0x5d3f('0x9')];if(_0x5dc7e8[_0x5d3f('0x9')]==_0x5d3f('0x1f')){dials[_0x5dc7e8[_0x5d3f('0x5')]]=_[_0x5d3f('0x1b')](dials[_0x5dc7e8[_0x5d3f('0x5')]],_0x5dc7e8);dials[_0x5dc7e8[_0x5d3f('0x5')]][_0x5d3f('0x20')]=utils[_0x5d3f('0x21')]();dials[_0x5dc7e8['uniqueid']][_0x5d3f('0x1d')]=_0x5d3f('0x22');utils[_0x5d3f('0x2')](util[_0x5d3f('0x3')](_0x5d3f('0x23'),_0x5dc7e8[_0x5d3f('0x5')],_0x5dc7e8[_0x5d3f('0x9')],dials[_0x5dc7e8[_0x5d3f('0x5')]][_0x5d3f('0x20')]));}else{utils['info'](util[_0x5d3f('0x3')]('[%s][dials][dialend]\x20dialstatus:%s',_0x5dc7e8['uniqueid'],_0x5dc7e8[_0x5d3f('0x9')]));}}}catch(_0x98be49){utils['error'](util[_0x5d3f('0x3')]('[%s][dials][dialend]',_0x5dc7e8[_0x5d3f('0x5')]),_0x98be49);}};exports[_0x5d3f('0x24')]=function(_0x17b4c7){try{if(!_[_0x5d3f('0x15')](dials[_0x17b4c7['uniqueid']])){utils['debug'](util[_0x5d3f('0x3')]('[%s][dials][hangup]',_0x17b4c7[_0x5d3f('0x5')]),_0x17b4c7);utils[_0x5d3f('0x2')](util[_0x5d3f('0x3')](_0x5d3f('0x25'),_0x17b4c7['uniqueid'],_0x17b4c7[_0x5d3f('0x8')],_0x17b4c7['calleridname'],_0x17b4c7[_0x5d3f('0x26')]));dials[_0x17b4c7[_0x5d3f('0x5')]]=_['assign'](dials[_0x17b4c7[_0x5d3f('0x5')]],{'endtime':utils[_0x5d3f('0x21')](),'lastevent':'complete'});dials[_0x17b4c7['uniqueid']]['duration']=utils[_0x5d3f('0x27')](dials[_0x17b4c7['uniqueid']]['endtime'],dials[_0x17b4c7[_0x5d3f('0x5')]]['starttime']);dials[_0x17b4c7[_0x5d3f('0x5')]][_0x5d3f('0x28')]=utils[_0x5d3f('0x27')](dials[_0x17b4c7[_0x5d3f('0x5')]]['answertime']||dials[_0x17b4c7[_0x5d3f('0x5')]][_0x5d3f('0x29')],dials[_0x17b4c7[_0x5d3f('0x5')]][_0x5d3f('0x1c')]);dials[_0x17b4c7['uniqueid']][_0x5d3f('0x2a')]=dials[_0x17b4c7['uniqueid']][_0x5d3f('0x20')]?utils[_0x5d3f('0x27')](dials[_0x17b4c7[_0x5d3f('0x5')]][_0x5d3f('0x29')],dials[_0x17b4c7[_0x5d3f('0x5')]][_0x5d3f('0x20')]):0x0;writeDB(dials[_0x17b4c7[_0x5d3f('0x5')]]);}}catch(_0x3d3676){utils['error'](util['format']('[%s][dials][hangup]',_0x17b4c7['uniqueid']),_0x3d3676);}}; \ No newline at end of file +var _0x0c19=['[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','endtime','billableseconds','diffTime','lodash','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','startsWith','appdata','cdr(routeid)','split','error','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]','dialend','[%s][dials][dialend]','ANSWER','answertime','connect'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0c19,0x14f));var _0x90c1=function(_0x696120,_0x24a606){_0x696120=_0x696120-0x0;var _0x1d0f6c=_0x0c19[_0x696120];return _0x1d0f6c;};'use strict';var _=require(_0x90c1('0x0'));var util=require('util');var utils=require(_0x90c1('0x1'));var dials={};function writeDB(_0x20c36c){utils[_0x90c1('0x2')](util[_0x90c1('0x3')](_0x90c1('0x4'),_0x20c36c[_0x90c1('0x5')],_0x20c36c[_0x90c1('0x6')],_0x20c36c[_0x90c1('0x7')],_0x20c36c['calleridnum'],_0x20c36c[_0x90c1('0x8')],_0x20c36c[_0x90c1('0x9')]));utils[_0x90c1('0xa')](_0x90c1('0xb'),_0x20c36c);delete dials[_0x20c36c['uniqueid']];}exports[_0x90c1('0xc')]=function(_0x3a6d46){try{utils[_0x90c1('0xd')](util[_0x90c1('0x3')](_0x90c1('0xe'),_0x3a6d46[_0x90c1('0x5')]),_0x3a6d46);utils[_0x90c1('0x2')](util[_0x90c1('0x3')](_0x90c1('0xf'),_0x3a6d46['uniqueid'],_0x3a6d46[_0x90c1('0x10')],_0x3a6d46['appdata']));if(_0x3a6d46[_0x90c1('0x10')][_0x90c1('0x11')]()=='set'&&_[_0x90c1('0x12')](_0x3a6d46[_0x90c1('0x13')][_0x90c1('0x11')](),_0x90c1('0x14'))){var _0x3c0b0e=_0x3a6d46[_0x90c1('0x13')][_0x90c1('0x15')]('=');dials[_0x3a6d46[_0x90c1('0x5')]]={'routeId':_0x3c0b0e[0x1]};}}catch(_0x32aa32){utils[_0x90c1('0x16')](util[_0x90c1('0x3')](_0x90c1('0xe'),_0x3a6d46['uniqueid']),_0x32aa32);}};exports[_0x90c1('0x17')]=function(_0x45f6cd){try{utils[_0x90c1('0xd')](util[_0x90c1('0x3')](_0x90c1('0x18'),_0x45f6cd[_0x90c1('0x5')]),_0x45f6cd);if(!_[_0x90c1('0x19')](_0x45f6cd[_0x90c1('0x1a')][_0x90c1('0x1b')])){utils[_0x90c1('0x2')](util['format'](_0x90c1('0x1c'),_0x45f6cd[_0x90c1('0x5')],_0x45f6cd[_0x90c1('0x1d')]));dials[_0x45f6cd[_0x90c1('0x5')]]={'routeId':_0x45f6cd['value']};}}catch(_0x5b0610){utils['error'](util[_0x90c1('0x3')](_0x90c1('0x18'),_0x45f6cd[_0x90c1('0x5')]),_0x5b0610);}};exports[_0x90c1('0x1e')]=function(_0x33dc84){try{if(!_[_0x90c1('0x19')](dials[_0x33dc84[_0x90c1('0x5')]])){utils['debug'](util['format']('[%s][dials][dialbegin]',_0x33dc84['uniqueid']),_0x33dc84);dials[_0x33dc84['uniqueid']]=_[_0x90c1('0x1f')](dials[_0x33dc84[_0x90c1('0x5')]],_0x33dc84);dials[_0x33dc84['uniqueid']][_0x90c1('0x20')]=utils[_0x90c1('0x21')]();dials[_0x33dc84[_0x90c1('0x5')]][_0x90c1('0x22')]=_0x90c1('0x23');utils[_0x90c1('0x2')](util[_0x90c1('0x3')](_0x90c1('0x24'),_0x33dc84['uniqueid'],dials[_0x33dc84[_0x90c1('0x5')]][_0x90c1('0x20')]));}}catch(_0x43d92c){utils['error'](util['format'](_0x90c1('0x25'),_0x33dc84[_0x90c1('0x5')]),_0x43d92c);}};exports[_0x90c1('0x26')]=function(_0x16cdd8){try{if(!_[_0x90c1('0x19')](dials[_0x16cdd8[_0x90c1('0x5')]])){utils[_0x90c1('0xd')](util['format'](_0x90c1('0x27'),_0x16cdd8[_0x90c1('0x5')]),_0x16cdd8);dials[_0x16cdd8[_0x90c1('0x5')]]['dialstatus']=_0x16cdd8['dialstatus'];if(_0x16cdd8[_0x90c1('0x9')]==_0x90c1('0x28')){dials[_0x16cdd8[_0x90c1('0x5')]]=_[_0x90c1('0x1f')](dials[_0x16cdd8[_0x90c1('0x5')]],_0x16cdd8);dials[_0x16cdd8['uniqueid']][_0x90c1('0x29')]=utils['now']();dials[_0x16cdd8[_0x90c1('0x5')]]['lastevent']=_0x90c1('0x2a');utils[_0x90c1('0x2')](util[_0x90c1('0x3')](_0x90c1('0x2b'),_0x16cdd8['uniqueid'],_0x16cdd8[_0x90c1('0x9')],dials[_0x16cdd8[_0x90c1('0x5')]][_0x90c1('0x29')]));}else{utils[_0x90c1('0x2')](util[_0x90c1('0x3')]('[%s][dials][dialend]\x20dialstatus:%s',_0x16cdd8['uniqueid'],_0x16cdd8[_0x90c1('0x9')]));}}}catch(_0x3cb310){utils[_0x90c1('0x16')](util['format'](_0x90c1('0x27'),_0x16cdd8[_0x90c1('0x5')]),_0x3cb310);}};exports[_0x90c1('0x2c')]=function(_0x1c5d75){try{if(!_['isNil'](dials[_0x1c5d75[_0x90c1('0x5')]])){utils[_0x90c1('0xd')](util[_0x90c1('0x3')](_0x90c1('0x2d'),_0x1c5d75[_0x90c1('0x5')]),_0x1c5d75);utils['info'](util[_0x90c1('0x3')](_0x90c1('0x2e'),_0x1c5d75['uniqueid'],_0x1c5d75['calleridnum'],_0x1c5d75[_0x90c1('0x2f')],_0x1c5d75[_0x90c1('0x30')]));dials[_0x1c5d75[_0x90c1('0x5')]]=_[_0x90c1('0x1f')](dials[_0x1c5d75[_0x90c1('0x5')]],{'endtime':utils['now'](),'lastevent':_0x90c1('0x31')});dials[_0x1c5d75[_0x90c1('0x5')]][_0x90c1('0x32')]=utils['diffTime'](dials[_0x1c5d75[_0x90c1('0x5')]][_0x90c1('0x33')],dials[_0x1c5d75[_0x90c1('0x5')]][_0x90c1('0x20')]);dials[_0x1c5d75[_0x90c1('0x5')]]['holdtime']=utils['diffTime'](dials[_0x1c5d75[_0x90c1('0x5')]]['answertime']||dials[_0x1c5d75[_0x90c1('0x5')]][_0x90c1('0x33')],dials[_0x1c5d75[_0x90c1('0x5')]][_0x90c1('0x20')]);dials[_0x1c5d75[_0x90c1('0x5')]][_0x90c1('0x34')]=dials[_0x1c5d75[_0x90c1('0x5')]]['answertime']?utils[_0x90c1('0x35')](dials[_0x1c5d75['uniqueid']]['endtime'],dials[_0x1c5d75[_0x90c1('0x5')]][_0x90c1('0x29')]):0x0;writeDB(dials[_0x1c5d75['uniqueid']]);}}catch(_0x5ccdbf){utils[_0x90c1('0x16')](util[_0x90c1('0x3')](_0x90c1('0x2d'),_0x1c5d75['uniqueid']),_0x5ccdbf);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index b969755..8405b84 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 _0x6386=['uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s]dialbegin','[%s][index][dialend]','dialend','asterisk-manager','../../config/environment','util','xdr','env','production','local','asterisk','port','username','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','[%s][index][devicestatechange]','device','devicestatechange','format','agentcalled','debug','[%s][index][agentcalled]'];(function(_0x1d930e,_0x20d8b8){var _0x5bbd66=function(_0x3c7488){while(--_0x3c7488){_0x1d930e['push'](_0x1d930e['shift']());}};_0x5bbd66(++_0x20d8b8);}(_0x6386,0x13c));var _0x6638=function(_0x4659b7,_0xace092){_0x4659b7=_0x4659b7-0x0;var _0x3c9997=_0x6386[_0x4659b7];return _0x3c9997;};var AsteriskManager=require(_0x6638('0x0'));var config=require(_0x6638('0x1'));var utils=require('./utils');var util=require(_0x6638('0x2'));var isXDREnabled=config[_0x6638('0x3')]&&config[_0x6638('0x3')]['disabled']?!config[_0x6638('0x3')]['disabled']:!![];var isProduction=config[_0x6638('0x4')]===_0x6638('0x5')||![];var isLocalAsterisk=config[_0x6638('0x3')]&&config[_0x6638('0x3')][_0x6638('0x6')]===!![]||![];var ami=new AsteriskManager(config[_0x6638('0x7')][_0x6638('0x8')],config[_0x6638('0x7')]['ip'],config[_0x6638('0x7')][_0x6638('0x9')],config[_0x6638('0x7')]['password'],!![]);ami[_0x6638('0xa')]();if(!isXDREnabled){utils[_0x6638('0xb')](_0x6638('0xc'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x6638('0xb')](_0x6638('0xd'));}else{var agents=require(_0x6638('0xe'));var calls=require('./calls.controller');var queues=require(_0x6638('0xf'));var recordings=require(_0x6638('0x10'));var members=require(_0x6638('0x11'));var dials=require(_0x6638('0x12'));var transfers=require(_0x6638('0x13'));var core=require(_0x6638('0x14'));ami['on'](_0x6638('0x15'),core[_0x6638('0x15')]);ami['on'](_0x6638('0x16'),core['shutdown']);ami['on']('fullybooted',core[_0x6638('0x17')]);ami['on'](_0x6638('0x18'),core['error']);ami['on']('close',core[_0x6638('0x19')]);ami['on'](_0x6638('0x1a'),core[_0x6638('0x1a')]);ami['on']('devicestatechange',function(_0x3f7db6){try{utils['debug'](util['format'](_0x6638('0x1b'),_0x3f7db6[_0x6638('0x1c')]),_0x3f7db6);members[_0x6638('0x1d')](_0x3f7db6);}catch(_0x4fa4b8){utils['error'](util[_0x6638('0x1e')](_0x6638('0x1b'),_0x3f7db6['device']),_0x4fa4b8);}});ami['on'](_0x6638('0x1f'),function(_0x1b8b65){try{utils[_0x6638('0x20')](util['format'](_0x6638('0x21'),_0x1b8b65[_0x6638('0x22')]),_0x1b8b65);agents[_0x6638('0x1f')](_0x1b8b65);}catch(_0x1d6f13){utils[_0x6638('0x18')](util[_0x6638('0x1e')](_0x6638('0x21'),_0x1b8b65[_0x6638('0x22')]),_0x1d6f13);}});ami['on'](_0x6638('0x23'),function(_0x3153d7){try{utils[_0x6638('0x20')](util[_0x6638('0x1e')](_0x6638('0x24'),_0x3153d7[_0x6638('0x22')]),_0x3153d7);agents[_0x6638('0x23')](_0x3153d7);}catch(_0x5deea8){utils['error'](util[_0x6638('0x1e')](_0x6638('0x24'),_0x3153d7[_0x6638('0x22')]),_0x5deea8);}});ami['on'](_0x6638('0x25'),function(_0x200f5d){try{utils[_0x6638('0x20')](util['format'](_0x6638('0x26'),_0x200f5d[_0x6638('0x22')]),_0x200f5d);agents[_0x6638('0x25')](_0x200f5d);queues[_0x6638('0x25')](_0x200f5d);}catch(_0x345c70){utils[_0x6638('0x18')](util[_0x6638('0x1e')]('[%s][index][agentconnect]',_0x200f5d['uniqueid']),_0x345c70);}});ami['on'](_0x6638('0x27'),function(_0x13d0b0){try{utils[_0x6638('0x20')](util[_0x6638('0x1e')](_0x6638('0x28'),_0x13d0b0[_0x6638('0x22')]),_0x13d0b0);agents[_0x6638('0x27')](_0x13d0b0);queues[_0x6638('0x27')](_0x13d0b0);members['agentcomplete'](_0x13d0b0);}catch(_0x3bdf33){utils[_0x6638('0x18')](util[_0x6638('0x1e')](_0x6638('0x28'),_0x13d0b0[_0x6638('0x22')]),_0x3bdf33);}});ami['on']('queuecallerabandon',function(_0x34a0d8){try{utils[_0x6638('0x20')](util['format'](_0x6638('0x29'),_0x34a0d8[_0x6638('0x22')]),_0x34a0d8);agents[_0x6638('0x2a')](_0x34a0d8);queues[_0x6638('0x2a')](_0x34a0d8);}catch(_0x1b9c68){utils[_0x6638('0x18')](util[_0x6638('0x1e')](_0x6638('0x29'),_0x34a0d8[_0x6638('0x22')]),_0x1b9c68);}});ami['on'](_0x6638('0x2b'),function(_0x5ce005){try{utils['debug'](util[_0x6638('0x1e')](_0x6638('0x2c'),_0x5ce005[_0x6638('0x22')]),_0x5ce005);queues['queuecallerjoin'](_0x5ce005);recordings[_0x6638('0x2b')](_0x5ce005);}catch(_0x2d85fa){utils['error'](util[_0x6638('0x1e')]('[%s][index][queuecallerjoin]',_0x5ce005[_0x6638('0x22')]),_0x2d85fa);}});ami['on'](_0x6638('0x2d'),function(_0x3461a6){try{utils[_0x6638('0x20')](util[_0x6638('0x1e')](_0x6638('0x2e'),_0x3461a6[_0x6638('0x22')]),_0x3461a6);queues[_0x6638('0x2d')](_0x3461a6);}catch(_0x48ca35){utils[_0x6638('0x18')](util['format'](_0x6638('0x2e'),_0x3461a6['uniqueid']),_0x48ca35);}});ami['on'](_0x6638('0x2f'),function(_0x245b9d){try{utils[_0x6638('0x20')](util[_0x6638('0x1e')](_0x6638('0x30'),_0x245b9d[_0x6638('0x22')]),_0x245b9d);queues[_0x6638('0x2f')](_0x245b9d);calls['musiconholdstart'](_0x245b9d);}catch(_0x21dc2f){utils[_0x6638('0x18')](util['format'](_0x6638('0x30'),_0x245b9d[_0x6638('0x22')]),_0x21dc2f);}});ami['on'](_0x6638('0x31'),function(_0x26b31d){try{utils[_0x6638('0x20')](util[_0x6638('0x1e')](_0x6638('0x32'),_0x26b31d[_0x6638('0x22')]),_0x26b31d);queues[_0x6638('0x31')](_0x26b31d);calls[_0x6638('0x31')](_0x26b31d);}catch(_0x564f6c){utils[_0x6638('0x18')](util[_0x6638('0x1e')](_0x6638('0x32'),_0x26b31d[_0x6638('0x22')]),_0x564f6c);}});ami['on'](_0x6638('0x33'),function(_0x13cc34){try{utils[_0x6638('0x20')](util[_0x6638('0x1e')](_0x6638('0x34'),_0x13cc34[_0x6638('0x22')]),_0x13cc34);calls[_0x6638('0x33')](_0x13cc34);recordings[_0x6638('0x33')](_0x13cc34);}catch(_0xfe9741){utils[_0x6638('0x18')](util[_0x6638('0x1e')](_0x6638('0x34'),_0x13cc34[_0x6638('0x22')]),_0xfe9741);}});ami['on'](_0x6638('0x35'),function(_0x1b32f7){try{utils[_0x6638('0x20')](util[_0x6638('0x1e')](_0x6638('0x36'),_0x1b32f7['uniqueid']),_0x1b32f7);calls['hangup'](_0x1b32f7);recordings[_0x6638('0x35')](_0x1b32f7);dials[_0x6638('0x35')](_0x1b32f7);agents[_0x6638('0x35')](_0x1b32f7);queues[_0x6638('0x35')](_0x1b32f7);}catch(_0x4c503e){utils['error'](util['format'](_0x6638('0x36'),_0x1b32f7['uniqueid']),_0x4c503e);}});ami['on']('cdr',function(_0x11b52c){try{utils[_0x6638('0x20')](util[_0x6638('0x1e')](_0x6638('0x37'),_0x11b52c[_0x6638('0x22')]),_0x11b52c);members['cdr'](_0x11b52c);}catch(_0x55e88b){utils[_0x6638('0x18')](util[_0x6638('0x1e')]('[%s][index][cdr]',_0x11b52c[_0x6638('0x22')]),_0x55e88b);}});ami['on'](_0x6638('0x38'),function(_0x5c59ea){try{utils[_0x6638('0x20')](util['format'](_0x6638('0x39'),_0x5c59ea[_0x6638('0x22')]),_0x5c59ea);queues[_0x6638('0x38')](_0x5c59ea);agents[_0x6638('0x38')](_0x5c59ea);transfers[_0x6638('0x38')](_0x5c59ea);recordings[_0x6638('0x38')](_0x5c59ea);}catch(_0x44a758){utils[_0x6638('0x18')](util[_0x6638('0x1e')]('[%s][index][blindtransfer]',_0x5c59ea['uniqueid']),_0x44a758);}});ami['on'](_0x6638('0x3a'),function(_0x340baa){try{utils['debug'](util[_0x6638('0x1e')]('[%s][index][attendedtransfer]',_0x340baa['origtransfereruniqueid']),_0x340baa);queues[_0x6638('0x3a')](_0x340baa);transfers[_0x6638('0x3a')](_0x340baa);agents[_0x6638('0x3a')](_0x340baa);calls['attendedtransfer'](_0x340baa);}catch(_0x27a244){utils[_0x6638('0x18')](util[_0x6638('0x1e')](_0x6638('0x3b'),_0x340baa[_0x6638('0x3c')]),_0x27a244);}});ami['on'](_0x6638('0x3d'),function(_0x3d4efa){try{utils['debug'](util['format'](_0x6638('0x3e'),_0x3d4efa[_0x6638('0x22')]),_0x3d4efa);queues[_0x6638('0x3d')](_0x3d4efa);recordings[_0x6638('0x3d')](_0x3d4efa);calls[_0x6638('0x3d')](_0x3d4efa);dials[_0x6638('0x3d')](_0x3d4efa);}catch(_0xcdb086){utils[_0x6638('0x18')](util[_0x6638('0x1e')](_0x6638('0x3e'),_0x3d4efa[_0x6638('0x22')]),_0xcdb086);}});ami['on']('newexten',function(_0x498849){try{utils['debug'](util['format']('[%s][index][newexten]',_0x498849['uniqueid']),_0x498849);calls['newexten'](_0x498849);recordings[_0x6638('0x3f')](_0x498849);dials[_0x6638('0x3f')](_0x498849);}catch(_0x4e1953){utils[_0x6638('0x18')](util[_0x6638('0x1e')]('[%s][index][newexten]',_0x498849[_0x6638('0x22')]),_0x4e1953);}});ami['on'](_0x6638('0x40'),function(_0x52959c){try{utils[_0x6638('0x20')](util['format']('[%s][index][newchannel]',_0x52959c[_0x6638('0x22')]),_0x52959c);calls[_0x6638('0x40')](_0x52959c);recordings[_0x6638('0x40')](_0x52959c);}catch(_0x1ba488){utils['error'](util[_0x6638('0x1e')](_0x6638('0x41'),_0x52959c['uniqueid']),_0x1ba488);}});ami['on'](_0x6638('0x42'),function(_0x3c064c){try{utils[_0x6638('0x20')](util[_0x6638('0x1e')]('[%s][index][dialbegin]',_0x3c064c[_0x6638('0x22')]),_0x3c064c);dials[_0x6638('0x42')](_0x3c064c);}catch(_0x98fdea){utils[_0x6638('0x18')](util[_0x6638('0x1e')](_0x6638('0x43'),_0x3c064c['uniqueid']),_0x98fdea);}});ami['on']('dialend',function(_0x5cbe63){try{utils[_0x6638('0x20')](util[_0x6638('0x1e')](_0x6638('0x44'),_0x5cbe63[_0x6638('0x22')]),_0x5cbe63);dials[_0x6638('0x45')](_0x5cbe63);}catch(_0x38e7a9){utils[_0x6638('0x18')](util[_0x6638('0x1e')](_0x6638('0x44'),_0x5cbe63[_0x6638('0x22')]),_0x38e7a9);}});} \ No newline at end of file +var _0x9ccd=['./dials.controller','./transfers.controller','connect','shutdown','fullybooted','error','managerevent','debug','format','[%s][index][devicestatechange]','device','devicestatechange','agentcalled','uniqueid','[%s][index][agentcalled]','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','[%s][index][dialbegin]','dialbegin','dialend','[%s][index][dialend]','asterisk-manager','util','xdr','disabled','env','production','local','asterisk','port','username','password','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./queues.controller','./members.controller'];(function(_0x1dd325,_0x2c3332){var _0x20cd46=function(_0x324b09){while(--_0x324b09){_0x1dd325['push'](_0x1dd325['shift']());}};_0x20cd46(++_0x2c3332);}(_0x9ccd,0x143));var _0xd9cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9ccd[_0x3dd15e];return _0x231fd0;};var AsteriskManager=require(_0xd9cc('0x0'));var config=require('../../config/environment');var utils=require('./utils');var util=require(_0xd9cc('0x1'));var isXDREnabled=config[_0xd9cc('0x2')]&&config[_0xd9cc('0x2')]['disabled']?!config[_0xd9cc('0x2')][_0xd9cc('0x3')]:!![];var isProduction=config[_0xd9cc('0x4')]===_0xd9cc('0x5')||![];var isLocalAsterisk=config[_0xd9cc('0x2')]&&config[_0xd9cc('0x2')][_0xd9cc('0x6')]===!![]||![];var ami=new AsteriskManager(config[_0xd9cc('0x7')][_0xd9cc('0x8')],config['asterisk']['ip'],config[_0xd9cc('0x7')][_0xd9cc('0x9')],config[_0xd9cc('0x7')][_0xd9cc('0xa')],!![]);ami[_0xd9cc('0xb')]();if(!isXDREnabled){utils[_0xd9cc('0xc')](_0xd9cc('0xd'));}else if(!isProduction&&!isLocalAsterisk){utils['info'](_0xd9cc('0xe'));}else{var agents=require('./agents.controller');var calls=require('./calls.controller');var queues=require(_0xd9cc('0xf'));var recordings=require('./recordings.controller');var members=require(_0xd9cc('0x10'));var dials=require(_0xd9cc('0x11'));var transfers=require(_0xd9cc('0x12'));var core=require('./core.controller');ami['on']('connect',core[_0xd9cc('0x13')]);ami['on'](_0xd9cc('0x14'),core[_0xd9cc('0x14')]);ami['on'](_0xd9cc('0x15'),core[_0xd9cc('0x15')]);ami['on']('error',core[_0xd9cc('0x16')]);ami['on']('close',core['close']);ami['on'](_0xd9cc('0x17'),core[_0xd9cc('0x17')]);ami['on']('devicestatechange',function(_0xe37cd){try{utils[_0xd9cc('0x18')](util[_0xd9cc('0x19')](_0xd9cc('0x1a'),_0xe37cd[_0xd9cc('0x1b')]),_0xe37cd);members[_0xd9cc('0x1c')](_0xe37cd);}catch(_0x38834b){utils[_0xd9cc('0x16')](util[_0xd9cc('0x19')](_0xd9cc('0x1a'),_0xe37cd['device']),_0x38834b);}});ami['on'](_0xd9cc('0x1d'),function(_0x19a35d){try{utils[_0xd9cc('0x18')](util[_0xd9cc('0x19')]('[%s][index][agentcalled]',_0x19a35d[_0xd9cc('0x1e')]),_0x19a35d);agents[_0xd9cc('0x1d')](_0x19a35d);}catch(_0x1545cf){utils[_0xd9cc('0x16')](util['format'](_0xd9cc('0x1f'),_0x19a35d[_0xd9cc('0x1e')]),_0x1545cf);}});ami['on'](_0xd9cc('0x20'),function(_0x532428){try{utils[_0xd9cc('0x18')](util[_0xd9cc('0x19')](_0xd9cc('0x21'),_0x532428['uniqueid']),_0x532428);agents[_0xd9cc('0x20')](_0x532428);}catch(_0x4cca02){utils[_0xd9cc('0x16')](util[_0xd9cc('0x19')]('[%s][index][agentringnoanswer]',_0x532428[_0xd9cc('0x1e')]),_0x4cca02);}});ami['on'](_0xd9cc('0x22'),function(_0x5141ed){try{utils[_0xd9cc('0x18')](util[_0xd9cc('0x19')]('[%s][index][agentconnect]',_0x5141ed[_0xd9cc('0x1e')]),_0x5141ed);agents[_0xd9cc('0x22')](_0x5141ed);queues[_0xd9cc('0x22')](_0x5141ed);}catch(_0x41cd1c){utils[_0xd9cc('0x16')](util[_0xd9cc('0x19')](_0xd9cc('0x23'),_0x5141ed[_0xd9cc('0x1e')]),_0x41cd1c);}});ami['on'](_0xd9cc('0x24'),function(_0x457627){try{utils[_0xd9cc('0x18')](util[_0xd9cc('0x19')](_0xd9cc('0x25'),_0x457627[_0xd9cc('0x1e')]),_0x457627);agents['agentcomplete'](_0x457627);queues[_0xd9cc('0x24')](_0x457627);members[_0xd9cc('0x24')](_0x457627);}catch(_0x45990e){utils['error'](util[_0xd9cc('0x19')](_0xd9cc('0x25'),_0x457627['uniqueid']),_0x45990e);}});ami['on'](_0xd9cc('0x26'),function(_0x245c35){try{utils[_0xd9cc('0x18')](util[_0xd9cc('0x19')](_0xd9cc('0x27'),_0x245c35['uniqueid']),_0x245c35);agents['queuecallerabandon'](_0x245c35);queues[_0xd9cc('0x26')](_0x245c35);}catch(_0x77a461){utils[_0xd9cc('0x16')](util[_0xd9cc('0x19')]('[%s][index][queuecallerabandon]',_0x245c35['uniqueid']),_0x77a461);}});ami['on'](_0xd9cc('0x28'),function(_0x14dbb1){try{utils[_0xd9cc('0x18')](util[_0xd9cc('0x19')](_0xd9cc('0x29'),_0x14dbb1[_0xd9cc('0x1e')]),_0x14dbb1);queues[_0xd9cc('0x28')](_0x14dbb1);recordings[_0xd9cc('0x28')](_0x14dbb1);}catch(_0x34068d){utils[_0xd9cc('0x16')](util[_0xd9cc('0x19')](_0xd9cc('0x29'),_0x14dbb1[_0xd9cc('0x1e')]),_0x34068d);}});ami['on'](_0xd9cc('0x2a'),function(_0x53b3fe){try{utils[_0xd9cc('0x18')](util['format'](_0xd9cc('0x2b'),_0x53b3fe[_0xd9cc('0x1e')]),_0x53b3fe);queues['queuecallerleave'](_0x53b3fe);}catch(_0xb5cd0d){utils[_0xd9cc('0x16')](util[_0xd9cc('0x19')](_0xd9cc('0x2b'),_0x53b3fe[_0xd9cc('0x1e')]),_0xb5cd0d);}});ami['on'](_0xd9cc('0x2c'),function(_0x3f8ee0){try{utils['debug'](util[_0xd9cc('0x19')](_0xd9cc('0x2d'),_0x3f8ee0[_0xd9cc('0x1e')]),_0x3f8ee0);queues[_0xd9cc('0x2c')](_0x3f8ee0);calls[_0xd9cc('0x2c')](_0x3f8ee0);}catch(_0x8aa78f){utils[_0xd9cc('0x16')](util[_0xd9cc('0x19')](_0xd9cc('0x2d'),_0x3f8ee0[_0xd9cc('0x1e')]),_0x8aa78f);}});ami['on'](_0xd9cc('0x2e'),function(_0x554a3e){try{utils[_0xd9cc('0x18')](util[_0xd9cc('0x19')](_0xd9cc('0x2f'),_0x554a3e[_0xd9cc('0x1e')]),_0x554a3e);queues[_0xd9cc('0x2e')](_0x554a3e);calls[_0xd9cc('0x2e')](_0x554a3e);}catch(_0x3fb7ff){utils[_0xd9cc('0x16')](util['format'](_0xd9cc('0x2f'),_0x554a3e[_0xd9cc('0x1e')]),_0x3fb7ff);}});ami['on'](_0xd9cc('0x30'),function(_0x360d7c){try{utils['debug'](util[_0xd9cc('0x19')](_0xd9cc('0x31'),_0x360d7c['uniqueid']),_0x360d7c);calls[_0xd9cc('0x30')](_0x360d7c);recordings['newstate'](_0x360d7c);}catch(_0x1faf07){utils[_0xd9cc('0x16')](util[_0xd9cc('0x19')](_0xd9cc('0x31'),_0x360d7c['uniqueid']),_0x1faf07);}});ami['on']('hangup',function(_0x27b991){try{utils[_0xd9cc('0x18')](util[_0xd9cc('0x19')]('[%s][index][hangup]',_0x27b991[_0xd9cc('0x1e')]),_0x27b991);calls[_0xd9cc('0x32')](_0x27b991);recordings[_0xd9cc('0x32')](_0x27b991);dials[_0xd9cc('0x32')](_0x27b991);agents['hangup'](_0x27b991);queues[_0xd9cc('0x32')](_0x27b991);}catch(_0x58e4a4){utils[_0xd9cc('0x16')](util[_0xd9cc('0x19')](_0xd9cc('0x33'),_0x27b991['uniqueid']),_0x58e4a4);}});ami['on']('cdr',function(_0x2572f4){try{utils[_0xd9cc('0x18')](util['format'](_0xd9cc('0x34'),_0x2572f4['uniqueid']),_0x2572f4);members['cdr'](_0x2572f4);}catch(_0x1203ac){utils[_0xd9cc('0x16')](util['format'](_0xd9cc('0x34'),_0x2572f4[_0xd9cc('0x1e')]),_0x1203ac);}});ami['on'](_0xd9cc('0x35'),function(_0x326d59){try{utils['debug'](util['format'](_0xd9cc('0x36'),_0x326d59[_0xd9cc('0x1e')]),_0x326d59);queues[_0xd9cc('0x35')](_0x326d59);agents[_0xd9cc('0x35')](_0x326d59);transfers[_0xd9cc('0x35')](_0x326d59);recordings[_0xd9cc('0x35')](_0x326d59);}catch(_0x5635f9){utils[_0xd9cc('0x16')](util[_0xd9cc('0x19')](_0xd9cc('0x36'),_0x326d59[_0xd9cc('0x1e')]),_0x5635f9);}});ami['on'](_0xd9cc('0x37'),function(_0x430a90){try{utils[_0xd9cc('0x18')](util[_0xd9cc('0x19')](_0xd9cc('0x38'),_0x430a90[_0xd9cc('0x39')]),_0x430a90);queues[_0xd9cc('0x37')](_0x430a90);transfers[_0xd9cc('0x37')](_0x430a90);agents[_0xd9cc('0x37')](_0x430a90);calls[_0xd9cc('0x37')](_0x430a90);}catch(_0x4dea72){utils['error'](util[_0xd9cc('0x19')](_0xd9cc('0x38'),_0x430a90[_0xd9cc('0x39')]),_0x4dea72);}});ami['on'](_0xd9cc('0x3a'),function(_0x13c7a0){try{utils[_0xd9cc('0x18')](util['format']('[%s][index][varset]',_0x13c7a0[_0xd9cc('0x1e')]),_0x13c7a0);queues[_0xd9cc('0x3a')](_0x13c7a0);recordings['varset'](_0x13c7a0);calls[_0xd9cc('0x3a')](_0x13c7a0);dials[_0xd9cc('0x3a')](_0x13c7a0);}catch(_0x18d46c){utils[_0xd9cc('0x16')](util[_0xd9cc('0x19')](_0xd9cc('0x3b'),_0x13c7a0[_0xd9cc('0x1e')]),_0x18d46c);}});ami['on'](_0xd9cc('0x3c'),function(_0x4fdf6b){try{utils[_0xd9cc('0x18')](util[_0xd9cc('0x19')]('[%s][index][newexten]',_0x4fdf6b['uniqueid']),_0x4fdf6b);calls['newexten'](_0x4fdf6b);recordings[_0xd9cc('0x3c')](_0x4fdf6b);dials[_0xd9cc('0x3c')](_0x4fdf6b);}catch(_0x52896a){utils[_0xd9cc('0x16')](util[_0xd9cc('0x19')](_0xd9cc('0x3d'),_0x4fdf6b['uniqueid']),_0x52896a);}});ami['on']('newchannel',function(_0x12b482){try{utils[_0xd9cc('0x18')](util[_0xd9cc('0x19')]('[%s][index][newchannel]',_0x12b482[_0xd9cc('0x1e')]),_0x12b482);calls[_0xd9cc('0x3e')](_0x12b482);recordings[_0xd9cc('0x3e')](_0x12b482);}catch(_0x262e13){utils[_0xd9cc('0x16')](util[_0xd9cc('0x19')](_0xd9cc('0x3f'),_0x12b482[_0xd9cc('0x1e')]),_0x262e13);}});ami['on']('dialbegin',function(_0x420a45){try{utils[_0xd9cc('0x18')](util[_0xd9cc('0x19')](_0xd9cc('0x40'),_0x420a45[_0xd9cc('0x1e')]),_0x420a45);dials[_0xd9cc('0x41')](_0x420a45);}catch(_0x2d8798){utils[_0xd9cc('0x16')](util[_0xd9cc('0x19')]('[%s]dialbegin',_0x420a45[_0xd9cc('0x1e')]),_0x2d8798);}});ami['on'](_0xd9cc('0x42'),function(_0x38a3c0){try{utils['debug'](util['format']('[%s][index][dialend]',_0x38a3c0[_0xd9cc('0x1e')]),_0x38a3c0);dials['dialend'](_0x38a3c0);}catch(_0x3ca51a){utils[_0xd9cc('0x16')](util[_0xd9cc('0x19')](_0xd9cc('0x43'),_0x38a3c0[_0xd9cc('0x1e')]),_0x3ca51a);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 2990264..1a07ec3 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 _0x2e78=['[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','info','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','[%s][members][agentcomplete]','cdr','source','data3','destination','data1','destinationchannel','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','[%s][members][cdr]','lodash','util','./utils','Queue:','format','uniqueid','interface','channel','data2','membername','type','then','name','internal','CreateMemberReport','split','error','some','startsWith','devicestatechange','debug'];(function(_0x235f95,_0x2bf647){var _0x2348cb=function(_0x4b10d8){while(--_0x4b10d8){_0x235f95['push'](_0x235f95['shift']());}};_0x2348cb(++_0x2bf647);}(_0x2e78,0xab));var _0x82e7=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x2e78[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x82e7('0x0'));var util=require(_0x82e7('0x1'));var utils=require(_0x82e7('0x2'));var members={};var exclude=['Local/_attended@transfer',_0x82e7('0x3')];function writeDB(_0xf7dd97){utils['info'](util[_0x82e7('0x4')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0xf7dd97[_0x82e7('0x5')],_0xf7dd97[_0x82e7('0x6')],_0xf7dd97[_0x82e7('0x7')],_0xf7dd97[_0x82e7('0x8')],_0xf7dd97[_0x82e7('0x9')],_0xf7dd97[_0x82e7('0xa')]));if(_0xf7dd97['interface']){utils['getUserByInterface'](_0xf7dd97['interface'])[_0x82e7('0xb')](function(_0xc78ae2){if(_0xc78ae2){_0xf7dd97[_0x82e7('0x9')]=_0xc78ae2[_0x82e7('0xc')];_0xf7dd97[_0x82e7('0xd')]=_0xc78ae2[_0x82e7('0xd')];utils['request'](_0x82e7('0xe'),_0xf7dd97);}else{utils['getUserByName'](_0xf7dd97[_0x82e7('0x6')][_0x82e7('0xf')]('/')[0x1])['then'](function(_0x478a87){if(_0x478a87){_0xf7dd97['membername']=_0x478a87['name'];_0xf7dd97[_0x82e7('0xd')]=_0x478a87[_0x82e7('0xd')];utils['request'](_0x82e7('0xe'),_0xf7dd97);}});}})['catch'](function(_0x74331d){utils[_0x82e7('0x10')](util[_0x82e7('0x4')]('[%s][members][writeDB]',_0xf7dd97[_0x82e7('0x5')]),_0x74331d);});}delete members[_0xf7dd97['interface']];}function startsWith(_0x4fb6a2,_0x2a3a34){return _[_0x82e7('0x11')](_0x4fb6a2,function(_0x5b1922){return _[_0x82e7('0x12')](_0x2a3a34,_0x5b1922);});}exports[_0x82e7('0x13')]=function(_0x36ca04){try{utils[_0x82e7('0x14')](util[_0x82e7('0x4')](_0x82e7('0x15'),members[_0x36ca04[_0x82e7('0x16')]]?members[_0x36ca04[_0x82e7('0x16')]][_0x82e7('0x5')]:_0x36ca04[_0x82e7('0x16')]),_0x36ca04);utils['info'](util[_0x82e7('0x4')](_0x82e7('0x17'),members[_0x36ca04[_0x82e7('0x16')]]?members[_0x36ca04['device']][_0x82e7('0x5')]:_0x36ca04[_0x82e7('0x16')],_0x36ca04[_0x82e7('0x18')],_0x36ca04['device']));switch(_0x36ca04['state']){case'INUSE':case'BUSY':if(!startsWith(exclude,_0x36ca04[_0x82e7('0x16')])){members[_0x36ca04[_0x82e7('0x16')]]={'channel':_0x82e7('0x19'),'interface':_0x36ca04['device'],'type':_0x82e7('0x1a'),'enterAt':utils[_0x82e7('0x1b')](),'role':_0x82e7('0x1c')};}break;case _0x82e7('0x1d'):if(!_[_0x82e7('0x1e')](members[_0x36ca04['device']])){members[_0x36ca04[_0x82e7('0x16')]][_0x82e7('0x1f')]=utils[_0x82e7('0x1b')]();members[_0x36ca04['device']][_0x82e7('0x20')]=utils[_0x82e7('0x21')](members[_0x36ca04[_0x82e7('0x16')]][_0x82e7('0x1f')],members[_0x36ca04[_0x82e7('0x16')]][_0x82e7('0x22')]);if(members[_0x36ca04[_0x82e7('0x16')]][_0x82e7('0x5')]){writeDB(members[_0x36ca04[_0x82e7('0x16')]]);}}break;default:break;}}catch(_0xfcb873){utils[_0x82e7('0x10')](util[_0x82e7('0x4')](_0x82e7('0x15'),members[_0x36ca04[_0x82e7('0x16')]]?members[_0x36ca04[_0x82e7('0x16')]][_0x82e7('0x5')]:_0x36ca04[_0x82e7('0x16')]),_0xfcb873);}};exports[_0x82e7('0x23')]=function(_0x22c2b9){try{if(!_[_0x82e7('0x1e')](members[_0x22c2b9['interface']])){utils[_0x82e7('0x14')](util[_0x82e7('0x4')]('[%s][members][agentcomplete]',_0x22c2b9['uniqueid']),_0x22c2b9);utils[_0x82e7('0x24')](util['format'](_0x82e7('0x25'),_0x22c2b9[_0x82e7('0x5')],_0x22c2b9['interface'],_0x22c2b9['queue']));members[_0x22c2b9[_0x82e7('0x6')]]=_[_0x82e7('0x26')](members[_0x22c2b9[_0x82e7('0x6')]],{'data4':_0x22c2b9['queue'],'uniqueid':_0x22c2b9['uniqueid']});}}catch(_0x381767){utils['error'](util[_0x82e7('0x4')](_0x82e7('0x27'),_0x22c2b9[_0x82e7('0x5')]),_0x381767);}};exports[_0x82e7('0x28')]=function(_0x49ab10){try{utils[_0x82e7('0x14')](util[_0x82e7('0x4')]('[%s][members][cdr]',_0x49ab10['uniqueid']),_0x49ab10);if(_0x49ab10[_0x82e7('0x7')]){var _0x2c916a=_0x49ab10['channel'][_0x82e7('0xf')]('-')[0x0];if(!_[_0x82e7('0x1e')](members[_0x2c916a])){members[_0x2c916a]=_[_0x82e7('0x26')](members[_0x2c916a],{'data1':members[_0x2c916a]['data1']||_0x49ab10['type'],'data2':members[_0x2c916a]['data2']||_0x49ab10[_0x82e7('0x29')],'data3':members[_0x2c916a][_0x82e7('0x2a')]||_0x49ab10[_0x82e7('0x2b')],'uniqueid':members[_0x2c916a][_0x82e7('0x5')]||_0x49ab10['uniqueid']});utils[_0x82e7('0x24')](util[_0x82e7('0x4')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x49ab10[_0x82e7('0x5')],members[_0x2c916a][_0x82e7('0x2c')],members[_0x2c916a][_0x82e7('0x8')],members[_0x2c916a][_0x82e7('0x2a')]));if(members[_0x2c916a][_0x82e7('0x1f')]){writeDB(members[_0x2c916a]);}}}if(_0x49ab10[_0x82e7('0x2d')]){var _0x527a33=_0x49ab10['destinationchannel']['split']('-')[0x0];if(!_['isNil'](members[_0x527a33])){members[_0x527a33]=_[_0x82e7('0x26')](members[_0x527a33],{'data1':members[_0x527a33][_0x82e7('0x2c')]||_0x49ab10[_0x82e7('0xa')],'data2':members[_0x527a33][_0x82e7('0x8')]||_0x49ab10[_0x82e7('0x29')],'data3':members[_0x527a33][_0x82e7('0x2a')]||_0x49ab10[_0x82e7('0x2b')],'uniqueid':members[_0x527a33][_0x82e7('0x5')]||_0x49ab10['uniqueid']});utils[_0x82e7('0x24')](util['format'](_0x82e7('0x2e'),_0x49ab10[_0x82e7('0x5')],members[_0x527a33][_0x82e7('0x2c')],members[_0x527a33][_0x82e7('0x8')],members[_0x527a33][_0x82e7('0x2a')]));if(members[_0x527a33][_0x82e7('0x1f')]){writeDB(members[_0x527a33]);}}}}catch(_0xa14405){utils[_0x82e7('0x10')](util[_0x82e7('0x4')](_0x82e7('0x2f'),_0x49ab10[_0x82e7('0x5')]),_0xa14405);}}; \ No newline at end of file +var _0xddf2=['startsWith','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','TALKING','now','agent','exitAt','duration','enterAt','agentcomplete','isNil','[%s][members][agentcomplete]','info','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','[%s][members][cdr]','data1','data2','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','source','./utils','Queue:','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','channel','membername','type','interface','then','name','internal','CreateMemberReport','getUserByName','split','catch','error','[%s][members][writeDB]'];(function(_0x5dc0de,_0x25bba4){var _0x54ba0e=function(_0xc95566){while(--_0xc95566){_0x5dc0de['push'](_0x5dc0de['shift']());}};_0x54ba0e(++_0x25bba4);}(_0xddf2,0x1dd));var _0x2ddf=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xddf2[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x2ddf('0x0'));var members={};var exclude=['Local/_attended@transfer',_0x2ddf('0x1')];function writeDB(_0x20d263){utils['info'](util[_0x2ddf('0x2')](_0x2ddf('0x3'),_0x20d263[_0x2ddf('0x4')],_0x20d263['interface'],_0x20d263[_0x2ddf('0x5')],_0x20d263['data2'],_0x20d263[_0x2ddf('0x6')],_0x20d263[_0x2ddf('0x7')]));if(_0x20d263[_0x2ddf('0x8')]){utils['getUserByInterface'](_0x20d263[_0x2ddf('0x8')])[_0x2ddf('0x9')](function(_0x3a6265){if(_0x3a6265){_0x20d263['membername']=_0x3a6265[_0x2ddf('0xa')];_0x20d263[_0x2ddf('0xb')]=_0x3a6265[_0x2ddf('0xb')];utils['request'](_0x2ddf('0xc'),_0x20d263);}else{utils[_0x2ddf('0xd')](_0x20d263[_0x2ddf('0x8')][_0x2ddf('0xe')]('/')[0x1])[_0x2ddf('0x9')](function(_0x4c0a1b){if(_0x4c0a1b){_0x20d263[_0x2ddf('0x6')]=_0x4c0a1b[_0x2ddf('0xa')];_0x20d263['internal']=_0x4c0a1b[_0x2ddf('0xb')];utils['request'](_0x2ddf('0xc'),_0x20d263);}});}})[_0x2ddf('0xf')](function(_0x3be39a){utils[_0x2ddf('0x10')](util[_0x2ddf('0x2')](_0x2ddf('0x11'),_0x20d263['uniqueid']),_0x3be39a);});}delete members[_0x20d263[_0x2ddf('0x8')]];}function startsWith(_0x3bed36,_0x148114){return _['some'](_0x3bed36,function(_0x2f29d5){return _[_0x2ddf('0x12')](_0x148114,_0x2f29d5);});}exports['devicestatechange']=function(_0x42b2fb){try{utils[_0x2ddf('0x13')](util[_0x2ddf('0x2')](_0x2ddf('0x14'),members[_0x42b2fb[_0x2ddf('0x15')]]?members[_0x42b2fb[_0x2ddf('0x15')]][_0x2ddf('0x4')]:_0x42b2fb[_0x2ddf('0x15')]),_0x42b2fb);utils['info'](util[_0x2ddf('0x2')](_0x2ddf('0x16'),members[_0x42b2fb[_0x2ddf('0x15')]]?members[_0x42b2fb[_0x2ddf('0x15')]][_0x2ddf('0x4')]:_0x42b2fb[_0x2ddf('0x15')],_0x42b2fb[_0x2ddf('0x17')],_0x42b2fb[_0x2ddf('0x15')]));switch(_0x42b2fb[_0x2ddf('0x17')]){case'INUSE':case'BUSY':if(!startsWith(exclude,_0x42b2fb[_0x2ddf('0x15')])){members[_0x42b2fb['device']]={'channel':'voice','interface':_0x42b2fb[_0x2ddf('0x15')],'type':_0x2ddf('0x18'),'enterAt':utils[_0x2ddf('0x19')](),'role':_0x2ddf('0x1a')};}break;case'NOT_INUSE':if(!_['isNil'](members[_0x42b2fb[_0x2ddf('0x15')]])){members[_0x42b2fb[_0x2ddf('0x15')]][_0x2ddf('0x1b')]=utils[_0x2ddf('0x19')]();members[_0x42b2fb[_0x2ddf('0x15')]][_0x2ddf('0x1c')]=utils['diffTime'](members[_0x42b2fb['device']][_0x2ddf('0x1b')],members[_0x42b2fb['device']][_0x2ddf('0x1d')]);if(members[_0x42b2fb[_0x2ddf('0x15')]]['uniqueid']){writeDB(members[_0x42b2fb[_0x2ddf('0x15')]]);}}break;default:break;}}catch(_0x214bb1){utils[_0x2ddf('0x10')](util['format'](_0x2ddf('0x14'),members[_0x42b2fb[_0x2ddf('0x15')]]?members[_0x42b2fb['device']][_0x2ddf('0x4')]:_0x42b2fb['device']),_0x214bb1);}};exports[_0x2ddf('0x1e')]=function(_0x445320){try{if(!_[_0x2ddf('0x1f')](members[_0x445320[_0x2ddf('0x8')]])){utils[_0x2ddf('0x13')](util[_0x2ddf('0x2')](_0x2ddf('0x20'),_0x445320['uniqueid']),_0x445320);utils[_0x2ddf('0x21')](util[_0x2ddf('0x2')](_0x2ddf('0x22'),_0x445320[_0x2ddf('0x4')],_0x445320[_0x2ddf('0x8')],_0x445320[_0x2ddf('0x23')]));members[_0x445320[_0x2ddf('0x8')]]=_[_0x2ddf('0x24')](members[_0x445320['interface']],{'data4':_0x445320[_0x2ddf('0x23')],'uniqueid':_0x445320[_0x2ddf('0x4')]});}}catch(_0x50d1c5){utils[_0x2ddf('0x10')](util[_0x2ddf('0x2')](_0x2ddf('0x20'),_0x445320[_0x2ddf('0x4')]),_0x50d1c5);}};exports['cdr']=function(_0x24c349){try{utils['debug'](util['format'](_0x2ddf('0x25'),_0x24c349[_0x2ddf('0x4')]),_0x24c349);if(_0x24c349[_0x2ddf('0x5')]){var _0x6cef6e=_0x24c349[_0x2ddf('0x5')][_0x2ddf('0xe')]('-')[0x0];if(!_[_0x2ddf('0x1f')](members[_0x6cef6e])){members[_0x6cef6e]=_[_0x2ddf('0x24')](members[_0x6cef6e],{'data1':members[_0x6cef6e][_0x2ddf('0x26')]||_0x24c349['type'],'data2':members[_0x6cef6e][_0x2ddf('0x27')]||_0x24c349['source'],'data3':members[_0x6cef6e][_0x2ddf('0x28')]||_0x24c349[_0x2ddf('0x29')],'uniqueid':members[_0x6cef6e][_0x2ddf('0x4')]||_0x24c349['uniqueid']});utils[_0x2ddf('0x21')](util['format'](_0x2ddf('0x2a'),_0x24c349[_0x2ddf('0x4')],members[_0x6cef6e]['data1'],members[_0x6cef6e][_0x2ddf('0x27')],members[_0x6cef6e][_0x2ddf('0x28')]));if(members[_0x6cef6e][_0x2ddf('0x1b')]){writeDB(members[_0x6cef6e]);}}}if(_0x24c349[_0x2ddf('0x2b')]){var _0x6ffd80=_0x24c349[_0x2ddf('0x2b')][_0x2ddf('0xe')]('-')[0x0];if(!_[_0x2ddf('0x1f')](members[_0x6ffd80])){members[_0x6ffd80]=_['assign'](members[_0x6ffd80],{'data1':members[_0x6ffd80][_0x2ddf('0x26')]||_0x24c349[_0x2ddf('0x7')],'data2':members[_0x6ffd80][_0x2ddf('0x27')]||_0x24c349[_0x2ddf('0x2c')],'data3':members[_0x6ffd80][_0x2ddf('0x28')]||_0x24c349['destination'],'uniqueid':members[_0x6ffd80]['uniqueid']||_0x24c349['uniqueid']});utils[_0x2ddf('0x21')](util[_0x2ddf('0x2')](_0x2ddf('0x2a'),_0x24c349['uniqueid'],members[_0x6ffd80][_0x2ddf('0x26')],members[_0x6ffd80]['data2'],members[_0x6ffd80][_0x2ddf('0x28')]));if(members[_0x6ffd80][_0x2ddf('0x1b')]){writeDB(members[_0x6ffd80]);}}}}catch(_0x2494c7){utils[_0x2ddf('0x10')](util[_0x2ddf('0x2')]('[%s][members][cdr]',_0x24c349['uniqueid']),_0x2494c7);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 18e0541..d7f07c5 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 _0xff4d=['connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','accountcode','[%s][queues][agentcomplete]','assigned','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','transferexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstop]','mohtime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','uniqueid','queue','lastAssignedTo','calleridnum','queuecallerexitreason','getVoiceQueueByName','type','request','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','[%s][queues][varset]','isNil','variable','queuestatus','value','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerexitAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerabandonAt','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]'];(function(_0x5908b8,_0x544699){var _0xe24a76=function(_0x2bd33f){while(--_0x2bd33f){_0x5908b8['push'](_0x5908b8['shift']());}};_0xe24a76(++_0x544699);}(_0xff4d,0x1d7));var _0xdff4=function(_0x2af47e,_0x1d2a86){_0x2af47e=_0x2af47e-0x0;var _0x5bca26=_0xff4d[_0x2af47e];return _0x5bca26;};'use strict';var _=require(_0xdff4('0x0'));var util=require(_0xdff4('0x1'));var utils=require(_0xdff4('0x2'));var queues={};function writeDB(_0x142790){utils[_0xdff4('0x3')](util[_0xdff4('0x4')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x142790[_0xdff4('0x5')],_0x142790['channel'],_0x142790[_0xdff4('0x6')],_0x142790[_0xdff4('0x7')],_0x142790[_0xdff4('0x8')],_0x142790['accountcode'],_0x142790[_0xdff4('0x9')]));if(_0x142790['queue']){utils[_0xdff4('0xa')](_0x142790[_0xdff4('0x6')])['then'](function(_0x5060a2){if(_0x5060a2){_0x142790['type']=_0x5060a2[_0xdff4('0xb')];}utils['request']('CreateVoiceQueueReport',_0x142790);});}else{utils[_0xdff4('0xc')]('CreateVoiceQueueReport',_0x142790);}if(_0x142790['transfereduniqueid']){delete queues[_0x142790[_0xdff4('0xd')]];}else{delete queues[_0x142790[_0xdff4('0x5')]];}}exports[_0xdff4('0xe')]=function(_0x47f260){try{utils[_0xdff4('0xf')](util[_0xdff4('0x4')](_0xdff4('0x10'),_0x47f260[_0xdff4('0x5')]),_0x47f260);utils[_0xdff4('0x3')](util[_0xdff4('0x4')](_0xdff4('0x11'),_0x47f260[_0xdff4('0x5')],_0x47f260[_0xdff4('0x6')],_0x47f260[_0xdff4('0x12')]));queues[_0x47f260[_0xdff4('0x5')]]=_[_0xdff4('0x13')](_0x47f260,{'originalposition':_0x47f260[_0xdff4('0x12')],'queuecallerjoinAt':utils[_0xdff4('0x14')](),'mohtime':0x0});}catch(_0x147fe1){utils[_0xdff4('0x15')](util[_0xdff4('0x4')](_0xdff4('0x10'),_0x47f260['uniqueid']),_0x147fe1);}};exports[_0xdff4('0x16')]=function(_0xe566ea){try{if(!_['isNil'](queues[_0xe566ea[_0xdff4('0x5')]])){utils[_0xdff4('0xf')](util[_0xdff4('0x4')](_0xdff4('0x17'),_0xe566ea[_0xdff4('0x5')]),_0xe566ea);if(queues[_0xe566ea['uniqueid']][_0xdff4('0x18')]){if(!queues[_0xe566ea[_0xdff4('0x5')]][_0xdff4('0x19')]&&!queues[_0xe566ea[_0xdff4('0x5')]][_0xdff4('0x1a')]){queues[_0xe566ea[_0xdff4('0x5')]][_0xdff4('0x1b')]=!![];queues[_0xe566ea['uniqueid']][_0xdff4('0x1c')]=utils[_0xdff4('0x14')]();queues[_0xe566ea[_0xdff4('0x5')]][_0xdff4('0x9')]='COMPLETEDBYAGENT';}utils[_0xdff4('0x3')](util[_0xdff4('0x4')](_0xdff4('0x1d'),_0xe566ea['uniqueid'],queues[_0xe566ea['uniqueid']][_0xdff4('0x1e')],queues[_0xe566ea[_0xdff4('0x5')]][_0xdff4('0x9')]));writeDB(queues[_0xe566ea[_0xdff4('0x5')]]);}else if(queues[_0xe566ea[_0xdff4('0x5')]][_0xdff4('0xd')]){utils[_0xdff4('0x3')](util[_0xdff4('0x4')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0xe566ea[_0xdff4('0x5')],queues[_0xe566ea[_0xdff4('0x5')]]['name'],queues[_0xe566ea[_0xdff4('0x5')]][_0xdff4('0xd')]));queues[queues[_0xe566ea['uniqueid']]['transfereduniqueid']]=queues[_0xe566ea[_0xdff4('0x5')]];queues[queues[_0xe566ea[_0xdff4('0x5')]][_0xdff4('0xd')]][_0xdff4('0x1f')]=0x2;delete queues[_0xe566ea[_0xdff4('0x5')]];}}}catch(_0x76beec){utils[_0xdff4('0x15')](util[_0xdff4('0x4')](_0xdff4('0x17'),_0xe566ea[_0xdff4('0x5')]),_0x76beec);}};exports['varset']=function(_0x374765){try{utils[_0xdff4('0xf')](util[_0xdff4('0x4')](_0xdff4('0x20'),_0x374765[_0xdff4('0x5')]),_0x374765);if(!_[_0xdff4('0x21')](_0x374765[_0xdff4('0x22')][_0xdff4('0x23')])&&_0x374765[_0xdff4('0x24')][_0xdff4('0x25')]()!=='CONTINUE'){if(!_['isNil'](queues[_0x374765[_0xdff4('0x5')]])){queues[_0x374765[_0xdff4('0x5')]]['queuecallerabandon']=![];queues[_0x374765['uniqueid']]['queuecallerabandonAt']=null;queues[_0x374765['uniqueid']][_0xdff4('0x1a')]=!![];queues[_0x374765[_0xdff4('0x5')]]['queuecallerexitAt']=utils[_0xdff4('0x14')]();queues[_0x374765[_0xdff4('0x5')]][_0xdff4('0x9')]=_0x374765[_0xdff4('0x24')][_0xdff4('0x25')]();utils['info'](util[_0xdff4('0x4')](_0xdff4('0x26'),_0x374765[_0xdff4('0x5')],queues[_0x374765[_0xdff4('0x5')]][_0xdff4('0x1e')],_0x374765['value'],queues[_0x374765[_0xdff4('0x5')]][_0xdff4('0x9')]));writeDB(queues[_0x374765[_0xdff4('0x5')]]);}}else if(!_[_0xdff4('0x21')](_0x374765['variable'][_0xdff4('0x27')])){if(!_[_0xdff4('0x21')](queues[_0x374765['uniqueid']])&&!queues[_0x374765[_0xdff4('0x5')]][_0xdff4('0x19')]){queues[_0x374765['uniqueid']]['queuecallerabandon']=![];queues[_0x374765[_0xdff4('0x5')]]['queuecallerabandonAt']=null;queues[_0x374765[_0xdff4('0x5')]][_0xdff4('0x1a')]=!![];queues[_0x374765[_0xdff4('0x5')]][_0xdff4('0x28')]=utils['now']();queues[_0x374765['uniqueid']][_0xdff4('0x9')]=_0xdff4('0x29');utils[_0xdff4('0x3')](util[_0xdff4('0x4')](_0xdff4('0x2a'),_0x374765[_0xdff4('0x5')],queues[_0x374765[_0xdff4('0x5')]]['name'],_0x374765['value'],queues[_0x374765[_0xdff4('0x5')]][_0xdff4('0x9')]));}}}catch(_0x342f6d){utils[_0xdff4('0x15')](util[_0xdff4('0x4')]('[%s][queues][varset]',_0x374765['uniqueid']),_0x342f6d);}};exports[_0xdff4('0x19')]=function(_0x3189ad){try{if(!_[_0xdff4('0x21')](queues[_0x3189ad[_0xdff4('0x5')]])){utils['debug'](util['format'](_0xdff4('0x2b'),_0x3189ad['uniqueid']),_0x3189ad);queues[_0x3189ad[_0xdff4('0x5')]]['queuecallerexit']=![];queues[_0x3189ad['uniqueid']][_0xdff4('0x28')]=null;queues[_0x3189ad[_0xdff4('0x5')]]['queuecallerabandon']=!![];queues[_0x3189ad['uniqueid']][_0xdff4('0x2c')]=utils[_0xdff4('0x14')]();queues[_0x3189ad[_0xdff4('0x5')]][_0xdff4('0x9')]=_0xdff4('0x2d');utils[_0xdff4('0x3')](util[_0xdff4('0x4')](_0xdff4('0x2e'),_0x3189ad[_0xdff4('0x5')],queues[_0x3189ad['uniqueid']]['name'],queues[_0x3189ad[_0xdff4('0x5')]]['queuecallerexitreason']));}}catch(_0x12441d){utils[_0xdff4('0x15')](util[_0xdff4('0x4')](_0xdff4('0x2b'),_0x3189ad[_0xdff4('0x5')]),_0x12441d);}};exports[_0xdff4('0x2f')]=function(_0x517a23){try{if(!_[_0xdff4('0x21')](queues[_0x517a23[_0xdff4('0x5')]])){utils['debug'](util[_0xdff4('0x4')](_0xdff4('0x30'),_0x517a23[_0xdff4('0x5')]),_0x517a23);utils[_0xdff4('0x3')](util[_0xdff4('0x4')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x517a23[_0xdff4('0x5')],queues[_0x517a23[_0xdff4('0x5')]][_0xdff4('0x1e')],_0x517a23[_0xdff4('0x31')],_0x517a23[_0xdff4('0x32')]));queues[_0x517a23[_0xdff4('0x5')]][_0xdff4('0x2f')]=!![];queues[_0x517a23[_0xdff4('0x5')]][_0xdff4('0x18')]=utils['now']();queues[_0x517a23[_0xdff4('0x5')]][_0xdff4('0x33')]=utils[_0xdff4('0x34')](queues[_0x517a23[_0xdff4('0x5')]][_0xdff4('0x18')],queues[_0x517a23[_0xdff4('0x5')]][_0xdff4('0x35')]);queues[_0x517a23[_0xdff4('0x5')]][_0xdff4('0x12')]=_0x517a23[_0xdff4('0x12')];queues[_0x517a23['uniqueid']]['count']=_0x517a23[_0xdff4('0x36')];queues[_0x517a23[_0xdff4('0x5')]][_0xdff4('0x31')]=_0x517a23['connectedlinenum'];queues[_0x517a23['uniqueid']]['connectedlinename']=_0x517a23[_0xdff4('0x32')];}}catch(_0x4051dc){utils[_0xdff4('0x15')](util[_0xdff4('0x4')](_0xdff4('0x30'),_0x517a23[_0xdff4('0x5')]),_0x4051dc);}};exports[_0xdff4('0x37')]=function(_0x3d6462){try{if(!_[_0xdff4('0x21')](queues[_0x3d6462[_0xdff4('0x5')]])){utils[_0xdff4('0xf')](util[_0xdff4('0x4')](_0xdff4('0x38'),_0x3d6462['uniqueid']),_0x3d6462);utils[_0xdff4('0x3')](util[_0xdff4('0x4')](_0xdff4('0x39'),_0x3d6462[_0xdff4('0x5')],queues[_0x3d6462['uniqueid']][_0xdff4('0x1e')],_0x3d6462[_0xdff4('0x3a')],_0x3d6462[_0xdff4('0x3b')]));queues[_0x3d6462[_0xdff4('0x5')]]['queuecallerabandon']=![];queues[_0x3d6462[_0xdff4('0x5')]][_0xdff4('0x19')]=![];queues[_0x3d6462['uniqueid']][_0xdff4('0x2c')]=null;queues[_0x3d6462[_0xdff4('0x5')]][_0xdff4('0x1a')]=![];queues[_0x3d6462[_0xdff4('0x5')]][_0xdff4('0x9')]=null;queues[_0x3d6462[_0xdff4('0x5')]]['queuecallerexitAt']=null;queues[_0x3d6462['uniqueid']]['assigned']=!![];queues[_0x3d6462[_0xdff4('0x5')]][_0xdff4('0x3c')]=_0x3d6462[_0xdff4('0x3b')];queues[_0x3d6462[_0xdff4('0x5')]][_0xdff4('0x7')]=_0x3d6462[_0xdff4('0x3a')];}}catch(_0x29a0b3){utils['error'](util[_0xdff4('0x4')](_0xdff4('0x38'),_0x3d6462[_0xdff4('0x5')]),_0x29a0b3);}};exports['agentcomplete']=function(_0x305a6e){try{if(!_[_0xdff4('0x21')](queues[_0x305a6e[_0xdff4('0x5')]])){if(queues[_0x305a6e['uniqueid']]['queuecallerleaveAt']){utils[_0xdff4('0xf')](util[_0xdff4('0x4')](_0xdff4('0x3d'),_0x305a6e[_0xdff4('0x5')]),_0x305a6e);queues[_0x305a6e[_0xdff4('0x5')]][_0xdff4('0x19')]=![];queues[_0x305a6e[_0xdff4('0x5')]]['queuecallerabandon']=![];queues[_0x305a6e[_0xdff4('0x5')]][_0xdff4('0x2c')]=null;queues[_0x305a6e['uniqueid']][_0xdff4('0x1a')]=![];queues[_0x305a6e[_0xdff4('0x5')]][_0xdff4('0x28')]=null;queues[_0x305a6e[_0xdff4('0x5')]][_0xdff4('0x3e')]=!![];queues[_0x305a6e[_0xdff4('0x5')]][_0xdff4('0x7')]=_0x305a6e[_0xdff4('0x3a')];queues[_0x305a6e[_0xdff4('0x5')]]['queuecallercomplete']=!![];queues[_0x305a6e['uniqueid']][_0xdff4('0x1c')]=utils[_0xdff4('0x14')]();if(_0x305a6e[_0xdff4('0x3f')]==_0xdff4('0x40')){if(!queues[_0x305a6e[_0xdff4('0x5')]][_0xdff4('0x40')]){queues[_0x305a6e[_0xdff4('0x5')]][_0xdff4('0x9')]=_0xdff4('0x41');}}else{queues[_0x305a6e['uniqueid']][_0xdff4('0x9')]=_0xdff4('0x42')+_0x305a6e[_0xdff4('0x3f')][_0xdff4('0x25')]();}utils['info'](util[_0xdff4('0x4')](_0xdff4('0x43'),_0x305a6e['uniqueid'],queues[_0x305a6e[_0xdff4('0x5')]]['name'],_0x305a6e[_0xdff4('0x3a')],queues[_0x305a6e[_0xdff4('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x305a6e[_0xdff4('0x5')]]);}}}catch(_0x5b1306){utils[_0xdff4('0x15')](util[_0xdff4('0x4')](_0xdff4('0x3d'),_0x305a6e[_0xdff4('0x5')]),_0x5b1306);}};exports[_0xdff4('0x44')]=function(_0x2ff2ad){try{if(!_[_0xdff4('0x21')](queues[_0x2ff2ad[_0xdff4('0x45')]])){utils[_0xdff4('0xf')](util[_0xdff4('0x4')](_0xdff4('0x46'),_0x2ff2ad[_0xdff4('0x5')]),_0x2ff2ad);queues[_0x2ff2ad[_0xdff4('0x45')]][_0xdff4('0x40')]=!![];queues[_0x2ff2ad[_0xdff4('0x45')]][_0xdff4('0x47')]=_0xdff4('0x48');queues[_0x2ff2ad[_0xdff4('0x45')]]['transferexten']=_0x2ff2ad['extension'];queues[_0x2ff2ad[_0xdff4('0x45')]][_0xdff4('0x49')]=_0x2ff2ad[_0xdff4('0x45')];queues[_0x2ff2ad[_0xdff4('0x45')]][_0xdff4('0x9')]=_0xdff4('0x4a');utils['info'](util[_0xdff4('0x4')](_0xdff4('0x4b'),_0x2ff2ad[_0xdff4('0x5')],queues[_0x2ff2ad['transfereeuniqueid']][_0xdff4('0x1e')],_0x2ff2ad['transfereeuniqueid'],_0x2ff2ad[_0xdff4('0x4c')]));}}catch(_0x4f2983){utils[_0xdff4('0x15')](util[_0xdff4('0x4')](_0xdff4('0x46'),_0x2ff2ad[_0xdff4('0x5')]),_0x4f2983);}};exports[_0xdff4('0x4d')]=function(_0x188f62){try{utils[_0xdff4('0xf')](util[_0xdff4('0x4')]('[%s][queues][attendedtransfer]',_0x188f62['origtransfereruniqueid']),_0x188f62);if(_0x188f62[_0xdff4('0x4e')]==_0x188f62[_0xdff4('0x4f')]){if(!_[_0xdff4('0x21')](queues[_0x188f62[_0xdff4('0x50')]])){utils[_0xdff4('0x3')](util[_0xdff4('0x4')](_0xdff4('0x51'),_0x188f62[_0xdff4('0x4e')],queues[_0x188f62[_0xdff4('0x50')]][_0xdff4('0x1e')],_0x188f62[_0xdff4('0x52')]));queues[_0x188f62[_0xdff4('0x50')]][_0xdff4('0x40')]=!![];queues[_0x188f62[_0xdff4('0x50')]][_0xdff4('0x47')]=_0xdff4('0x53');queues[_0x188f62['secondtransfererlinkedid']][_0xdff4('0x54')]=_0x188f62['origtransfererexten'];queues[_0x188f62[_0xdff4('0x50')]]['transferuniqueid']=_0x188f62[_0xdff4('0x4e')];queues[_0x188f62[_0xdff4('0x50')]][_0xdff4('0x9')]=_0xdff4('0x55');}if(!_[_0xdff4('0x21')](queues[_0x188f62[_0xdff4('0x4f')]])){if(_0x188f62['transfereelinkedid']&&queues[_0x188f62[_0xdff4('0x56')]]){queues[_0x188f62['transfereelinkedid']][_0xdff4('0x1f')]=0x1;queues[_0x188f62[_0xdff4('0x45')]]=_[_0xdff4('0x57')](queues[_0x188f62[_0xdff4('0x56')]]);queues[_0x188f62[_0xdff4('0x45')]][_0xdff4('0xd')]=_0x188f62[_0xdff4('0x58')];queues[_0x188f62[_0xdff4('0x45')]][_0xdff4('0x1f')]=0x2;queues[_0x188f62['transfereeuniqueid']][_0xdff4('0x8')]=queues[_0x188f62['secondtransfererlinkedid']][_0xdff4('0x8')];queues[_0x188f62[_0xdff4('0x45')]]['calleridname']=queues[_0x188f62[_0xdff4('0x50')]][_0xdff4('0x59')];queues[_0x188f62[_0xdff4('0x45')]][_0xdff4('0x35')]=utils[_0xdff4('0x14')]();queues[_0x188f62[_0xdff4('0x45')]][_0xdff4('0x18')]=utils[_0xdff4('0x14')]();queues[_0x188f62[_0xdff4('0x45')]][_0xdff4('0x33')]=0x0;queues[_0x188f62['transfereeuniqueid']]['mohtime']=0x0;utils[_0xdff4('0x3')](util[_0xdff4('0x4')](_0xdff4('0x5a'),_0x188f62[_0xdff4('0x4e')],queues[_0x188f62[_0xdff4('0x45')]][_0xdff4('0x1e')],queues[_0x188f62[_0xdff4('0x45')]]['calleridnum'],queues[_0x188f62['transfereeuniqueid']][_0xdff4('0x59')]));}else{utils[_0xdff4('0x3')](util[_0xdff4('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x188f62['origtransfereruniqueid'],queues[_0x188f62[_0xdff4('0x4f')]][_0xdff4('0x1e')],_0x188f62[_0xdff4('0x50')]));queues[_0x188f62[_0xdff4('0x4f')]]['transfereduniqueid']=_0x188f62[_0xdff4('0x50')];}}}else if(_0x188f62[_0xdff4('0x5b')]==_0x188f62[_0xdff4('0x50')]){if(!_[_0xdff4('0x21')](queues[_0x188f62[_0xdff4('0x4f')]])){utils['info'](util[_0xdff4('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x188f62[_0xdff4('0x4e')],queues[_0x188f62[_0xdff4('0x4f')]]['name'],_0x188f62[_0xdff4('0x5b')],_0x188f62[_0xdff4('0x5c')]));queues[_0x188f62['origtransfererlinkedid']][_0xdff4('0x40')]=!![];queues[_0x188f62[_0xdff4('0x4f')]]['transfertype']=_0xdff4('0x53');queues[_0x188f62[_0xdff4('0x4f')]][_0xdff4('0x54')]=_0x188f62[_0xdff4('0x5c')];queues[_0x188f62[_0xdff4('0x4f')]][_0xdff4('0x49')]=_0x188f62[_0xdff4('0x5b')];queues[_0x188f62['origtransfererlinkedid']][_0xdff4('0x9')]=_0xdff4('0x55');}if(!_[_0xdff4('0x21')](queues[_0x188f62[_0xdff4('0x50')]])){if(_0x188f62[_0xdff4('0x5d')]&&queues[_0x188f62[_0xdff4('0x5d')]]){queues[_0x188f62[_0xdff4('0x5d')]][_0xdff4('0x1f')]=0x1;queues[_0x188f62[_0xdff4('0x58')]]=_[_0xdff4('0x57')](queues[_0x188f62[_0xdff4('0x5d')]]);queues[_0x188f62[_0xdff4('0x58')]]['transfereduniqueid']=_0x188f62[_0xdff4('0x58')];queues[_0x188f62[_0xdff4('0x58')]]['queuecallerenterreason']=0x2;queues[_0x188f62[_0xdff4('0x58')]]['calleridnum']=queues[_0x188f62['origtransfererlinkedid']]['calleridnum'];queues[_0x188f62['transfertargetuniqueid']][_0xdff4('0x59')]=queues[_0x188f62[_0xdff4('0x4f')]][_0xdff4('0x59')];queues[_0x188f62[_0xdff4('0x58')]][_0xdff4('0x35')]=utils[_0xdff4('0x14')]();queues[_0x188f62[_0xdff4('0x58')]]['queuecallerleaveAt']=utils[_0xdff4('0x14')]();queues[_0x188f62[_0xdff4('0x58')]]['holdtime']=0x0;queues[_0x188f62[_0xdff4('0x58')]]['mohtime']=0x0;utils[_0xdff4('0x3')](util[_0xdff4('0x4')](_0xdff4('0x5e'),_0x188f62[_0xdff4('0x4e')],queues[_0x188f62['transfertargetuniqueid']]['name'],queues[_0x188f62[_0xdff4('0x58')]][_0xdff4('0xd')],queues[_0x188f62[_0xdff4('0x58')]][_0xdff4('0x8')],queues[_0x188f62['transfertargetuniqueid']][_0xdff4('0x59')]));}else{utils[_0xdff4('0x3')](util[_0xdff4('0x4')](_0xdff4('0x5f'),_0x188f62[_0xdff4('0x4e')],queues[_0x188f62[_0xdff4('0x50')]][_0xdff4('0x1e')],_0x188f62['origtransfererlinkedid']));queues[_0x188f62[_0xdff4('0x50')]][_0xdff4('0xd')]=_0x188f62[_0xdff4('0x4f')];}}}}catch(_0x48a9d2){utils['error'](util[_0xdff4('0x4')](_0xdff4('0x60'),_0x188f62[_0xdff4('0x4e')]),_0x48a9d2);}};exports[_0xdff4('0x61')]=function(_0x196ff4){try{if(!_[_0xdff4('0x21')](queues[_0x196ff4[_0xdff4('0x5')]])){utils[_0xdff4('0xf')](util[_0xdff4('0x4')](_0xdff4('0x62'),_0x196ff4[_0xdff4('0x5')]),_0x196ff4);queues[_0x196ff4[_0xdff4('0x5')]][_0xdff4('0x63')]=utils[_0xdff4('0x14')]();utils[_0xdff4('0x3')](util[_0xdff4('0x4')](_0xdff4('0x64'),_0x196ff4['uniqueid'],queues[_0x196ff4['uniqueid']][_0xdff4('0x1e')],queues[_0x196ff4['uniqueid']][_0xdff4('0x63')]));}}catch(_0x17d591){utils['error'](util[_0xdff4('0x4')]('[%s][queues][musiconholdstart]',_0x196ff4[_0xdff4('0x5')]),_0x17d591);}};exports['musiconholdstop']=function(_0x52d394){try{if(!_[_0xdff4('0x21')](queues[_0x52d394[_0xdff4('0x5')]])){if(!_[_0xdff4('0x21')](queues[_0x52d394[_0xdff4('0x5')]]['musiconholdstartAt'])){utils[_0xdff4('0xf')](util[_0xdff4('0x4')](_0xdff4('0x65'),_0x52d394[_0xdff4('0x5')]),_0x52d394);queues[_0x52d394[_0xdff4('0x5')]][_0xdff4('0x66')]+=utils[_0xdff4('0x34')](utils[_0xdff4('0x14')](),queues[_0x52d394[_0xdff4('0x5')]][_0xdff4('0x63')]);utils[_0xdff4('0x3')](util[_0xdff4('0x4')](_0xdff4('0x67'),_0x52d394[_0xdff4('0x5')],queues[_0x52d394[_0xdff4('0x5')]][_0xdff4('0x1e')],queues[_0x52d394[_0xdff4('0x5')]]['mohtime']));delete queues[_0x52d394['uniqueid']]['musiconholdstartAt'];}}}catch(_0x48326d){utils['error'](util[_0xdff4('0x4')](_0xdff4('0x65'),_0x52d394[_0xdff4('0x5')]),_0x48326d);}}; \ No newline at end of file +var _0xb4b0=['[%s][queues][queuecallerjoin]','format','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','queuecallerenterreason','error','varset','queuestatus','queuecallerabandonAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','name','value','variable','queuecallerexitAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][varset]','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','agentcomplete','[%s][queues][agentcomplete]','assigned','reason','transfer','TRANSFER','COMPLETEDBY','toUpperCase','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','extension','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfereruniqueid','origtransfererexten','transfertype','ATTENDED','transferexten','transfereelinkedid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transferuniqueid','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug'];(function(_0x484c68,_0x5066e2){var _0x591b9d=function(_0x1939d5){while(--_0x1939d5){_0x484c68['push'](_0x484c68['shift']());}};_0x591b9d(++_0x5066e2);}(_0xb4b0,0x1de));var _0x0b4b=function(_0x5424db,_0x14ce2b){_0x5424db=_0x5424db-0x0;var _0x31479d=_0xb4b0[_0x5424db];return _0x31479d;};'use strict';var _=require(_0x0b4b('0x0'));var util=require(_0x0b4b('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x1c0aa3){utils[_0x0b4b('0x2')](util['format'](_0x0b4b('0x3'),_0x1c0aa3[_0x0b4b('0x4')],_0x1c0aa3[_0x0b4b('0x5')],_0x1c0aa3['queue'],_0x1c0aa3[_0x0b4b('0x6')],_0x1c0aa3[_0x0b4b('0x7')],_0x1c0aa3[_0x0b4b('0x8')],_0x1c0aa3[_0x0b4b('0x9')]));if(_0x1c0aa3['queue']){utils[_0x0b4b('0xa')](_0x1c0aa3['queue'])[_0x0b4b('0xb')](function(_0x41a4ea){if(_0x41a4ea){_0x1c0aa3['type']=_0x41a4ea['type'];}utils[_0x0b4b('0xc')](_0x0b4b('0xd'),_0x1c0aa3);});}else{utils[_0x0b4b('0xc')](_0x0b4b('0xd'),_0x1c0aa3);}if(_0x1c0aa3['transfereduniqueid']){delete queues[_0x1c0aa3[_0x0b4b('0xe')]];}else{delete queues[_0x1c0aa3[_0x0b4b('0x4')]];}}exports[_0x0b4b('0xf')]=function(_0x24533a){try{utils[_0x0b4b('0x10')](util['format'](_0x0b4b('0x11'),_0x24533a[_0x0b4b('0x4')]),_0x24533a);utils['info'](util[_0x0b4b('0x12')](_0x0b4b('0x13'),_0x24533a[_0x0b4b('0x4')],_0x24533a['queue'],_0x24533a[_0x0b4b('0x14')]));queues[_0x24533a[_0x0b4b('0x4')]]=_[_0x0b4b('0x15')](_0x24533a,{'originalposition':_0x24533a[_0x0b4b('0x14')],'queuecallerjoinAt':utils[_0x0b4b('0x16')](),'mohtime':0x0});}catch(_0x5ea2f3){utils['error'](util[_0x0b4b('0x12')](_0x0b4b('0x11'),_0x24533a['uniqueid']),_0x5ea2f3);}};exports['hangup']=function(_0x2b8d39){try{if(!_[_0x0b4b('0x17')](queues[_0x2b8d39[_0x0b4b('0x4')]])){utils[_0x0b4b('0x10')](util['format'](_0x0b4b('0x18'),_0x2b8d39[_0x0b4b('0x4')]),_0x2b8d39);if(queues[_0x2b8d39[_0x0b4b('0x4')]][_0x0b4b('0x19')]){if(!queues[_0x2b8d39[_0x0b4b('0x4')]][_0x0b4b('0x1a')]&&!queues[_0x2b8d39[_0x0b4b('0x4')]][_0x0b4b('0x1b')]){queues[_0x2b8d39['uniqueid']][_0x0b4b('0x1c')]=!![];queues[_0x2b8d39[_0x0b4b('0x4')]][_0x0b4b('0x1d')]=utils['now']();queues[_0x2b8d39[_0x0b4b('0x4')]][_0x0b4b('0x9')]=_0x0b4b('0x1e');}utils[_0x0b4b('0x2')](util[_0x0b4b('0x12')](_0x0b4b('0x1f'),_0x2b8d39['uniqueid'],queues[_0x2b8d39[_0x0b4b('0x4')]]['name'],queues[_0x2b8d39['uniqueid']][_0x0b4b('0x9')]));writeDB(queues[_0x2b8d39[_0x0b4b('0x4')]]);}else if(queues[_0x2b8d39[_0x0b4b('0x4')]]['transfereduniqueid']){utils[_0x0b4b('0x2')](util[_0x0b4b('0x12')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x2b8d39[_0x0b4b('0x4')],queues[_0x2b8d39[_0x0b4b('0x4')]]['name'],queues[_0x2b8d39[_0x0b4b('0x4')]][_0x0b4b('0xe')]));queues[queues[_0x2b8d39[_0x0b4b('0x4')]]['transfereduniqueid']]=queues[_0x2b8d39[_0x0b4b('0x4')]];queues[queues[_0x2b8d39[_0x0b4b('0x4')]][_0x0b4b('0xe')]][_0x0b4b('0x20')]=0x2;delete queues[_0x2b8d39[_0x0b4b('0x4')]];}}}catch(_0x35d856){utils[_0x0b4b('0x21')](util[_0x0b4b('0x12')](_0x0b4b('0x18'),_0x2b8d39[_0x0b4b('0x4')]),_0x35d856);}};exports[_0x0b4b('0x22')]=function(_0x45cab2){try{utils[_0x0b4b('0x10')](util[_0x0b4b('0x12')]('[%s][queues][varset]',_0x45cab2['uniqueid']),_0x45cab2);if(!_[_0x0b4b('0x17')](_0x45cab2['variable'][_0x0b4b('0x23')])&&_0x45cab2['value']['toUpperCase']()!=='CONTINUE'){if(!_[_0x0b4b('0x17')](queues[_0x45cab2[_0x0b4b('0x4')]])){queues[_0x45cab2[_0x0b4b('0x4')]][_0x0b4b('0x1a')]=![];queues[_0x45cab2[_0x0b4b('0x4')]][_0x0b4b('0x24')]=null;queues[_0x45cab2['uniqueid']][_0x0b4b('0x1b')]=!![];queues[_0x45cab2['uniqueid']]['queuecallerexitAt']=utils[_0x0b4b('0x16')]();queues[_0x45cab2[_0x0b4b('0x4')]][_0x0b4b('0x9')]=_0x45cab2['value']['toUpperCase']();utils[_0x0b4b('0x2')](util[_0x0b4b('0x12')](_0x0b4b('0x25'),_0x45cab2[_0x0b4b('0x4')],queues[_0x45cab2['uniqueid']][_0x0b4b('0x26')],_0x45cab2[_0x0b4b('0x27')],queues[_0x45cab2[_0x0b4b('0x4')]][_0x0b4b('0x9')]));writeDB(queues[_0x45cab2[_0x0b4b('0x4')]]);}}else if(!_[_0x0b4b('0x17')](_0x45cab2[_0x0b4b('0x28')]['queueposition'])){if(!_[_0x0b4b('0x17')](queues[_0x45cab2[_0x0b4b('0x4')]])&&!queues[_0x45cab2[_0x0b4b('0x4')]][_0x0b4b('0x1a')]){queues[_0x45cab2[_0x0b4b('0x4')]][_0x0b4b('0x1a')]=![];queues[_0x45cab2['uniqueid']][_0x0b4b('0x24')]=null;queues[_0x45cab2[_0x0b4b('0x4')]][_0x0b4b('0x1b')]=!![];queues[_0x45cab2[_0x0b4b('0x4')]][_0x0b4b('0x29')]=utils['now']();queues[_0x45cab2[_0x0b4b('0x4')]][_0x0b4b('0x9')]=_0x0b4b('0x2a');utils[_0x0b4b('0x2')](util[_0x0b4b('0x12')](_0x0b4b('0x2b'),_0x45cab2[_0x0b4b('0x4')],queues[_0x45cab2['uniqueid']][_0x0b4b('0x26')],_0x45cab2['value'],queues[_0x45cab2[_0x0b4b('0x4')]][_0x0b4b('0x9')]));}}}catch(_0x5760d8){utils['error'](util[_0x0b4b('0x12')](_0x0b4b('0x2c'),_0x45cab2[_0x0b4b('0x4')]),_0x5760d8);}};exports[_0x0b4b('0x1a')]=function(_0x44431){try{if(!_[_0x0b4b('0x17')](queues[_0x44431[_0x0b4b('0x4')]])){utils[_0x0b4b('0x10')](util[_0x0b4b('0x12')](_0x0b4b('0x2d'),_0x44431['uniqueid']),_0x44431);queues[_0x44431['uniqueid']][_0x0b4b('0x1b')]=![];queues[_0x44431[_0x0b4b('0x4')]][_0x0b4b('0x29')]=null;queues[_0x44431[_0x0b4b('0x4')]][_0x0b4b('0x1a')]=!![];queues[_0x44431[_0x0b4b('0x4')]][_0x0b4b('0x24')]=utils['now']();queues[_0x44431[_0x0b4b('0x4')]][_0x0b4b('0x9')]='ABANDONED';utils['info'](util[_0x0b4b('0x12')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x44431[_0x0b4b('0x4')],queues[_0x44431[_0x0b4b('0x4')]][_0x0b4b('0x26')],queues[_0x44431[_0x0b4b('0x4')]][_0x0b4b('0x9')]));}}catch(_0x3c72ee){utils[_0x0b4b('0x21')](util[_0x0b4b('0x12')]('[%s][queues][queuecallerabandon]',_0x44431[_0x0b4b('0x4')]),_0x3c72ee);}};exports[_0x0b4b('0x2e')]=function(_0x14ea74){try{if(!_['isNil'](queues[_0x14ea74[_0x0b4b('0x4')]])){utils[_0x0b4b('0x10')](util['format'](_0x0b4b('0x2f'),_0x14ea74[_0x0b4b('0x4')]),_0x14ea74);utils['info'](util['format']('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x14ea74[_0x0b4b('0x4')],queues[_0x14ea74[_0x0b4b('0x4')]][_0x0b4b('0x26')],_0x14ea74[_0x0b4b('0x30')],_0x14ea74[_0x0b4b('0x31')]));queues[_0x14ea74[_0x0b4b('0x4')]][_0x0b4b('0x2e')]=!![];queues[_0x14ea74[_0x0b4b('0x4')]][_0x0b4b('0x19')]=utils[_0x0b4b('0x16')]();queues[_0x14ea74['uniqueid']][_0x0b4b('0x32')]=utils[_0x0b4b('0x33')](queues[_0x14ea74[_0x0b4b('0x4')]][_0x0b4b('0x19')],queues[_0x14ea74[_0x0b4b('0x4')]][_0x0b4b('0x34')]);queues[_0x14ea74[_0x0b4b('0x4')]][_0x0b4b('0x14')]=_0x14ea74[_0x0b4b('0x14')];queues[_0x14ea74[_0x0b4b('0x4')]][_0x0b4b('0x35')]=_0x14ea74[_0x0b4b('0x35')];queues[_0x14ea74[_0x0b4b('0x4')]][_0x0b4b('0x30')]=_0x14ea74[_0x0b4b('0x30')];queues[_0x14ea74[_0x0b4b('0x4')]][_0x0b4b('0x31')]=_0x14ea74[_0x0b4b('0x31')];}}catch(_0xd7c7a0){utils['error'](util[_0x0b4b('0x12')]('[%s][queues][queuecallerleave]',_0x14ea74[_0x0b4b('0x4')]),_0xd7c7a0);}};exports[_0x0b4b('0x36')]=function(_0x35bd3e){try{if(!_[_0x0b4b('0x17')](queues[_0x35bd3e[_0x0b4b('0x4')]])){utils['debug'](util[_0x0b4b('0x12')](_0x0b4b('0x37'),_0x35bd3e[_0x0b4b('0x4')]),_0x35bd3e);utils['info'](util['format'](_0x0b4b('0x38'),_0x35bd3e[_0x0b4b('0x4')],queues[_0x35bd3e['uniqueid']][_0x0b4b('0x26')],_0x35bd3e[_0x0b4b('0x39')],_0x35bd3e[_0x0b4b('0x3a')]));queues[_0x35bd3e[_0x0b4b('0x4')]][_0x0b4b('0x1a')]=![];queues[_0x35bd3e[_0x0b4b('0x4')]]['queuecallerabandon']=![];queues[_0x35bd3e[_0x0b4b('0x4')]][_0x0b4b('0x24')]=null;queues[_0x35bd3e[_0x0b4b('0x4')]]['queuecallerexit']=![];queues[_0x35bd3e['uniqueid']]['queuecallerexitreason']=null;queues[_0x35bd3e[_0x0b4b('0x4')]]['queuecallerexitAt']=null;queues[_0x35bd3e[_0x0b4b('0x4')]]['assigned']=!![];queues[_0x35bd3e[_0x0b4b('0x4')]]['accountcode']=_0x35bd3e[_0x0b4b('0x3a')];queues[_0x35bd3e['uniqueid']][_0x0b4b('0x6')]=_0x35bd3e[_0x0b4b('0x39')];}}catch(_0x2283c4){utils[_0x0b4b('0x21')](util['format'](_0x0b4b('0x37'),_0x35bd3e['uniqueid']),_0x2283c4);}};exports[_0x0b4b('0x3b')]=function(_0x437d90){try{if(!_[_0x0b4b('0x17')](queues[_0x437d90[_0x0b4b('0x4')]])){if(queues[_0x437d90[_0x0b4b('0x4')]][_0x0b4b('0x19')]){utils[_0x0b4b('0x10')](util[_0x0b4b('0x12')](_0x0b4b('0x3c'),_0x437d90['uniqueid']),_0x437d90);queues[_0x437d90[_0x0b4b('0x4')]][_0x0b4b('0x1a')]=![];queues[_0x437d90[_0x0b4b('0x4')]]['queuecallerabandon']=![];queues[_0x437d90['uniqueid']][_0x0b4b('0x24')]=null;queues[_0x437d90[_0x0b4b('0x4')]][_0x0b4b('0x1b')]=![];queues[_0x437d90[_0x0b4b('0x4')]][_0x0b4b('0x29')]=null;queues[_0x437d90[_0x0b4b('0x4')]][_0x0b4b('0x3d')]=!![];queues[_0x437d90[_0x0b4b('0x4')]]['lastAssignedTo']=_0x437d90[_0x0b4b('0x39')];queues[_0x437d90[_0x0b4b('0x4')]][_0x0b4b('0x1c')]=!![];queues[_0x437d90[_0x0b4b('0x4')]]['queuecallercompleteAt']=utils[_0x0b4b('0x16')]();if(_0x437d90[_0x0b4b('0x3e')]==_0x0b4b('0x3f')){if(!queues[_0x437d90[_0x0b4b('0x4')]][_0x0b4b('0x3f')]){queues[_0x437d90['uniqueid']]['queuecallerexitreason']=_0x0b4b('0x40');}}else{queues[_0x437d90[_0x0b4b('0x4')]][_0x0b4b('0x9')]=_0x0b4b('0x41')+_0x437d90[_0x0b4b('0x3e')][_0x0b4b('0x42')]();}utils[_0x0b4b('0x2')](util['format'](_0x0b4b('0x43'),_0x437d90['uniqueid'],queues[_0x437d90[_0x0b4b('0x4')]][_0x0b4b('0x26')],_0x437d90[_0x0b4b('0x39')],queues[_0x437d90[_0x0b4b('0x4')]][_0x0b4b('0x9')]));writeDB(queues[_0x437d90[_0x0b4b('0x4')]]);}}}catch(_0x2bc250){utils[_0x0b4b('0x21')](util[_0x0b4b('0x12')](_0x0b4b('0x3c'),_0x437d90[_0x0b4b('0x4')]),_0x2bc250);}};exports[_0x0b4b('0x44')]=function(_0x5afc57){try{if(!_[_0x0b4b('0x17')](queues[_0x5afc57[_0x0b4b('0x45')]])){utils[_0x0b4b('0x10')](util[_0x0b4b('0x12')](_0x0b4b('0x46'),_0x5afc57['uniqueid']),_0x5afc57);queues[_0x5afc57[_0x0b4b('0x45')]]['transfer']=!![];queues[_0x5afc57['transfereeuniqueid']]['transfertype']='BLIND';queues[_0x5afc57[_0x0b4b('0x45')]]['transferexten']=_0x5afc57[_0x0b4b('0x47')];queues[_0x5afc57[_0x0b4b('0x45')]]['transferuniqueid']=_0x5afc57[_0x0b4b('0x45')];queues[_0x5afc57['transfereeuniqueid']]['queuecallerexitreason']=_0x0b4b('0x48');utils['info'](util[_0x0b4b('0x12')](_0x0b4b('0x49'),_0x5afc57[_0x0b4b('0x4')],queues[_0x5afc57[_0x0b4b('0x45')]][_0x0b4b('0x26')],_0x5afc57[_0x0b4b('0x45')],_0x5afc57[_0x0b4b('0x47')]));}}catch(_0xa04171){utils[_0x0b4b('0x21')](util[_0x0b4b('0x12')](_0x0b4b('0x46'),_0x5afc57['uniqueid']),_0xa04171);}};exports[_0x0b4b('0x4a')]=function(_0x36f112){try{utils['debug'](util[_0x0b4b('0x12')](_0x0b4b('0x4b'),_0x36f112['origtransfereruniqueid']),_0x36f112);if(_0x36f112['origtransfereruniqueid']==_0x36f112[_0x0b4b('0x4c')]){if(!_[_0x0b4b('0x17')](queues[_0x36f112[_0x0b4b('0x4d')]])){utils[_0x0b4b('0x2')](util[_0x0b4b('0x12')](_0x0b4b('0x4e'),_0x36f112[_0x0b4b('0x4f')],queues[_0x36f112[_0x0b4b('0x4d')]][_0x0b4b('0x26')],_0x36f112[_0x0b4b('0x50')]));queues[_0x36f112[_0x0b4b('0x4d')]][_0x0b4b('0x3f')]=!![];queues[_0x36f112['secondtransfererlinkedid']][_0x0b4b('0x51')]=_0x0b4b('0x52');queues[_0x36f112[_0x0b4b('0x4d')]][_0x0b4b('0x53')]=_0x36f112[_0x0b4b('0x50')];queues[_0x36f112[_0x0b4b('0x4d')]]['transferuniqueid']=_0x36f112['origtransfereruniqueid'];queues[_0x36f112[_0x0b4b('0x4d')]][_0x0b4b('0x9')]='ATTENDEDTRANSFER';}if(!_[_0x0b4b('0x17')](queues[_0x36f112[_0x0b4b('0x4c')]])){if(_0x36f112[_0x0b4b('0x54')]&&queues[_0x36f112[_0x0b4b('0x54')]]){queues[_0x36f112[_0x0b4b('0x54')]]['queuecallerenterreason']=0x1;queues[_0x36f112[_0x0b4b('0x45')]]=_['clone'](queues[_0x36f112[_0x0b4b('0x54')]]);queues[_0x36f112[_0x0b4b('0x45')]]['transfereduniqueid']=_0x36f112['transfertargetuniqueid'];queues[_0x36f112['transfereeuniqueid']]['queuecallerenterreason']=0x2;queues[_0x36f112[_0x0b4b('0x45')]][_0x0b4b('0x7')]=queues[_0x36f112[_0x0b4b('0x4d')]][_0x0b4b('0x7')];queues[_0x36f112[_0x0b4b('0x45')]][_0x0b4b('0x55')]=queues[_0x36f112[_0x0b4b('0x4d')]][_0x0b4b('0x55')];queues[_0x36f112[_0x0b4b('0x45')]][_0x0b4b('0x34')]=utils[_0x0b4b('0x16')]();queues[_0x36f112[_0x0b4b('0x45')]][_0x0b4b('0x19')]=utils['now']();queues[_0x36f112[_0x0b4b('0x45')]][_0x0b4b('0x32')]=0x0;queues[_0x36f112[_0x0b4b('0x45')]][_0x0b4b('0x56')]=0x0;utils[_0x0b4b('0x2')](util[_0x0b4b('0x12')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x36f112[_0x0b4b('0x4f')],queues[_0x36f112[_0x0b4b('0x45')]][_0x0b4b('0x26')],queues[_0x36f112['transfereeuniqueid']]['calleridnum'],queues[_0x36f112['transfereeuniqueid']][_0x0b4b('0x55')]));}else{utils[_0x0b4b('0x2')](util[_0x0b4b('0x12')](_0x0b4b('0x57'),_0x36f112[_0x0b4b('0x4f')],queues[_0x36f112[_0x0b4b('0x4c')]][_0x0b4b('0x26')],_0x36f112[_0x0b4b('0x4d')]));queues[_0x36f112[_0x0b4b('0x4c')]][_0x0b4b('0xe')]=_0x36f112['secondtransfererlinkedid'];}}}else if(_0x36f112[_0x0b4b('0x58')]==_0x36f112[_0x0b4b('0x4d')]){if(!_['isNil'](queues[_0x36f112[_0x0b4b('0x4c')]])){utils[_0x0b4b('0x2')](util[_0x0b4b('0x12')](_0x0b4b('0x59'),_0x36f112[_0x0b4b('0x4f')],queues[_0x36f112[_0x0b4b('0x4c')]][_0x0b4b('0x26')],_0x36f112['secondtransfereruniqueid'],_0x36f112[_0x0b4b('0x5a')]));queues[_0x36f112[_0x0b4b('0x4c')]]['transfer']=!![];queues[_0x36f112[_0x0b4b('0x4c')]][_0x0b4b('0x51')]=_0x0b4b('0x52');queues[_0x36f112['origtransfererlinkedid']][_0x0b4b('0x53')]=_0x36f112[_0x0b4b('0x5a')];queues[_0x36f112['origtransfererlinkedid']][_0x0b4b('0x5b')]=_0x36f112['secondtransfereruniqueid'];queues[_0x36f112['origtransfererlinkedid']][_0x0b4b('0x9')]='ATTENDEDTRANSFER';}if(!_[_0x0b4b('0x17')](queues[_0x36f112[_0x0b4b('0x4d')]])){if(_0x36f112[_0x0b4b('0x5c')]&&queues[_0x36f112[_0x0b4b('0x5c')]]){queues[_0x36f112[_0x0b4b('0x5c')]]['queuecallerenterreason']=0x1;queues[_0x36f112[_0x0b4b('0x5d')]]=_['clone'](queues[_0x36f112['transfertargetlinkedid']]);queues[_0x36f112['transfertargetuniqueid']]['transfereduniqueid']=_0x36f112[_0x0b4b('0x5d')];queues[_0x36f112[_0x0b4b('0x5d')]][_0x0b4b('0x20')]=0x2;queues[_0x36f112['transfertargetuniqueid']][_0x0b4b('0x7')]=queues[_0x36f112[_0x0b4b('0x4c')]][_0x0b4b('0x7')];queues[_0x36f112[_0x0b4b('0x5d')]][_0x0b4b('0x55')]=queues[_0x36f112[_0x0b4b('0x4c')]][_0x0b4b('0x55')];queues[_0x36f112['transfertargetuniqueid']][_0x0b4b('0x34')]=utils[_0x0b4b('0x16')]();queues[_0x36f112['transfertargetuniqueid']]['queuecallerleaveAt']=utils['now']();queues[_0x36f112['transfertargetuniqueid']][_0x0b4b('0x32')]=0x0;queues[_0x36f112[_0x0b4b('0x5d')]][_0x0b4b('0x56')]=0x0;utils[_0x0b4b('0x2')](util[_0x0b4b('0x12')](_0x0b4b('0x5e'),_0x36f112[_0x0b4b('0x4f')],queues[_0x36f112['transfertargetuniqueid']][_0x0b4b('0x26')],queues[_0x36f112[_0x0b4b('0x5d')]][_0x0b4b('0xe')],queues[_0x36f112[_0x0b4b('0x5d')]][_0x0b4b('0x7')],queues[_0x36f112[_0x0b4b('0x5d')]][_0x0b4b('0x55')]));}else{utils['info'](util[_0x0b4b('0x12')](_0x0b4b('0x57'),_0x36f112[_0x0b4b('0x4f')],queues[_0x36f112[_0x0b4b('0x4d')]][_0x0b4b('0x26')],_0x36f112['origtransfererlinkedid']));queues[_0x36f112[_0x0b4b('0x4d')]][_0x0b4b('0xe')]=_0x36f112[_0x0b4b('0x4c')];}}}}catch(_0x30c958){utils[_0x0b4b('0x21')](util[_0x0b4b('0x12')](_0x0b4b('0x4b'),_0x36f112[_0x0b4b('0x4f')]),_0x30c958);}};exports['musiconholdstart']=function(_0x4489d0){try{if(!_[_0x0b4b('0x17')](queues[_0x4489d0[_0x0b4b('0x4')]])){utils[_0x0b4b('0x10')](util['format']('[%s][queues][musiconholdstart]',_0x4489d0[_0x0b4b('0x4')]),_0x4489d0);queues[_0x4489d0[_0x0b4b('0x4')]][_0x0b4b('0x5f')]=utils[_0x0b4b('0x16')]();utils['info'](util[_0x0b4b('0x12')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x4489d0[_0x0b4b('0x4')],queues[_0x4489d0[_0x0b4b('0x4')]][_0x0b4b('0x26')],queues[_0x4489d0['uniqueid']]['musiconholdstartAt']));}}catch(_0x4eaafc){utils[_0x0b4b('0x21')](util['format']('[%s][queues][musiconholdstart]',_0x4489d0['uniqueid']),_0x4eaafc);}};exports[_0x0b4b('0x60')]=function(_0x33cc9d){try{if(!_['isNil'](queues[_0x33cc9d['uniqueid']])){if(!_['isNil'](queues[_0x33cc9d[_0x0b4b('0x4')]][_0x0b4b('0x5f')])){utils['debug'](util[_0x0b4b('0x12')](_0x0b4b('0x61'),_0x33cc9d[_0x0b4b('0x4')]),_0x33cc9d);queues[_0x33cc9d[_0x0b4b('0x4')]][_0x0b4b('0x56')]+=utils[_0x0b4b('0x33')](utils[_0x0b4b('0x16')](),queues[_0x33cc9d[_0x0b4b('0x4')]]['musiconholdstartAt']);utils['info'](util[_0x0b4b('0x12')](_0x0b4b('0x62'),_0x33cc9d[_0x0b4b('0x4')],queues[_0x33cc9d[_0x0b4b('0x4')]][_0x0b4b('0x26')],queues[_0x33cc9d[_0x0b4b('0x4')]]['mohtime']));delete queues[_0x33cc9d[_0x0b4b('0x4')]][_0x0b4b('0x5f')];}}}catch(_0x120670){utils['error'](util[_0x0b4b('0x12')]('[%s][queues][musiconholdstop]',_0x33cc9d['uniqueid']),_0x120670);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 467dd2c..8d666d2 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 _0xa17e=['transferercalleridnum','transferercalleridname','transfereruniqueid','recording','./utils','./transfers.controller','info','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','[%s][recordings][newchannel]','[%s][recordings][newstate]','channelstate','isNil','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','mixmonitor_filename','[%s][recordings][varset]','value','endsWith','.wav49','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','cause-txt','calleridname','connectedlinenum','connectedlinename','type','outbound','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','startsWith','appdata','cdr','split','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][queuecallerjoin]','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s'];(function(_0x22862f,_0x56259d){var _0x51fe73=function(_0x5da56e){while(--_0x5da56e){_0x22862f['push'](_0x22862f['shift']());}};_0x51fe73(++_0x56259d);}(_0xa17e,0xdc));var _0xea17=function(_0x1df8af,_0x305739){_0x1df8af=_0x1df8af-0x0;var _0x41cbf2=_0xa17e[_0x1df8af];return _0x41cbf2;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xea17('0x0'));var transfers=require(_0xea17('0x1'));var recordings={};function writeDB(_0x489695){var _0x35739f;utils[_0xea17('0x2')](util[_0xea17('0x3')](_0xea17('0x4'),_0x489695[_0xea17('0x5')]));if(transfers[_0xea17('0x6')][_0x489695[_0xea17('0x5')]]){_0x35739f=_0x489695[_0xea17('0x5')];_0x489695[_0xea17('0x5')]=transfers['blinds'][_0x489695['uniqueid']][_0xea17('0x7')];}if(_0x489695[_0xea17('0x8')]){utils[_0xea17('0x9')](_0x489695[_0xea17('0x8')])[_0xea17('0xa')](function(_0x233025){if(_0x233025){_0x489695[_0xea17('0xb')]=_0x233025[_0xea17('0xc')];_0x489695[_0xea17('0xd')]=_0x233025['id'];}utils[_0xea17('0xe')](_0xea17('0xf'),_0x489695);});}else{utils[_0xea17('0xe')](_0xea17('0xf'),_0x489695);}if(_0x35739f)delete transfers[_0xea17('0x6')][_0x35739f];}exports[_0xea17('0x10')]=function(_0x302527){try{utils[_0xea17('0x11')](util[_0xea17('0x3')]('[%s][recordings][newchannel]',_0x302527[_0xea17('0x5')]),_0x302527);if(_0x302527['uniqueid']==_0x302527[_0xea17('0x12')]){utils[_0xea17('0x2')](util['format'](_0xea17('0x13'),_0x302527[_0xea17('0x5')],_0x302527[_0xea17('0x14')],_0x302527[_0xea17('0x15')]));recordings[_0x302527[_0xea17('0x5')]]={'uniqueid':_0x302527[_0xea17('0x5')],'accountcode':_0x302527[_0xea17('0x8')],'exten':_0x302527[_0xea17('0x15')],'context':_0x302527['context'],'channel':_0x302527[_0xea17('0x16')],'monitors':[]};}}catch(_0x4fea18){utils[_0xea17('0x17')](util[_0xea17('0x3')](_0xea17('0x18'),_0x302527[_0xea17('0x5')]),_0x4fea18);}};exports['newstate']=function(_0x578012){try{utils[_0xea17('0x11')](util[_0xea17('0x3')](_0xea17('0x19'),_0x578012[_0xea17('0x5')]),_0x578012);if(!_['isNil'](recordings[_0x578012['uniqueid']])&&_0x578012[_0xea17('0x1a')]==0x6){utils[_0xea17('0x2')](util[_0xea17('0x3')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x578012[_0xea17('0x5')],_0x578012[_0xea17('0x14')],_0x578012[_0xea17('0x16')]));}else if(!_[_0xea17('0x1b')](recordings[_0x578012[_0xea17('0x12')]])&&_0x578012['channelstate']==0x6&&_0x578012['context']!=_0xea17('0x1c')){utils[_0xea17('0x2')](util[_0xea17('0x3')](_0xea17('0x1d'),_0x578012[_0xea17('0x5')],_0x578012[_0xea17('0x12')],_0x578012[_0xea17('0x14')],_0x578012['channel']));recordings[_0x578012[_0xea17('0x12')]][_0xea17('0x8')]=_0x578012[_0xea17('0x8')];}}catch(_0x5926ae){utils[_0xea17('0x17')](util['format']('[%s][recordings][newstate]',_0x578012[_0xea17('0x5')]),_0x5926ae);}};exports['varset']=function(_0xf3cdb6){try{if(!_[_0xea17('0x1b')](_0xf3cdb6['variable'])&&!_[_0xea17('0x1b')](_0xf3cdb6['variable'][_0xea17('0x1e')])){utils[_0xea17('0x11')](util[_0xea17('0x3')](_0xea17('0x1f'),_0xf3cdb6['uniqueid']),_0xf3cdb6);utils[_0xea17('0x2')](util[_0xea17('0x3')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0xf3cdb6[_0xea17('0x5')],_0xf3cdb6['variable'],_0xf3cdb6[_0xea17('0x20')]));if(_[_0xea17('0x21')](_0xf3cdb6['value'],'.wav49')){_0xf3cdb6[_0xea17('0x20')]=_0xf3cdb6[_0xea17('0x20')]['replace'](_0xea17('0x22'),_0xea17('0x23'));}if(recordings[_0xf3cdb6[_0xea17('0x12')]]){var _0xbb373a=_[_0xea17('0x24')](recordings[_0xf3cdb6['linkedid']]['monitors'],{'value':_0xf3cdb6[_0xea17('0x20')]});if(_[_0xea17('0x1b')](_0xbb373a)){recordings[_0xf3cdb6[_0xea17('0x12')]][_0xea17('0x25')][_0xea17('0x26')]({'value':_0xf3cdb6[_0xea17('0x20')]});}}}}catch(_0xe50f9e){utils[_0xea17('0x17')](util[_0xea17('0x3')](_0xea17('0x1f'),_0xf3cdb6[_0xea17('0x5')]),_0xe50f9e);}};exports[_0xea17('0x27')]=function(_0x5edc94){try{if(!_[_0xea17('0x1b')](recordings[_0x5edc94['uniqueid']])){utils['debug'](util[_0xea17('0x3')](_0xea17('0x28'),_0x5edc94[_0xea17('0x5')]),_0x5edc94);utils[_0xea17('0x2')](util[_0xea17('0x3')](_0xea17('0x29'),_0x5edc94[_0xea17('0x5')],_0x5edc94[_0xea17('0x2a')],_0x5edc94['calleridname'],_0x5edc94[_0xea17('0x2b')]));recordings[_0x5edc94[_0xea17('0x5')]]['calleridnum']=_0x5edc94[_0xea17('0x2a')];recordings[_0x5edc94[_0xea17('0x5')]][_0xea17('0x2c')]=_0x5edc94[_0xea17('0x2c')];recordings[_0x5edc94[_0xea17('0x5')]]['connectedlinenum']=_0x5edc94[_0xea17('0x2d')];recordings[_0x5edc94[_0xea17('0x5')]][_0xea17('0x2e')]=_0x5edc94['connectedlinename'];if(recordings[_0x5edc94[_0xea17('0x5')]][_0xea17('0x2f')]==_0xea17('0x30')&&recordings[_0x5edc94[_0xea17('0x5')]][_0xea17('0x8')]){recordings[_0x5edc94[_0xea17('0x5')]]['connectedlinenum']=recordings[_0x5edc94['uniqueid']][_0xea17('0x8')];recordings[_0x5edc94[_0xea17('0x5')]][_0xea17('0x2e')]='';}recordings[_0x5edc94['uniqueid']]['monitors'][_0xea17('0x31')](function(_0x39e967){var _0x591bff=_[_0xea17('0x32')](recordings[_0x5edc94[_0xea17('0x5')]]);_0x591bff['value']=_0x39e967['value'];writeDB(_0x591bff);});delete recordings[_0x5edc94[_0xea17('0x5')]];}}catch(_0x4d1b60){utils[_0xea17('0x17')](util[_0xea17('0x3')](_0xea17('0x28'),_0x5edc94[_0xea17('0x5')]),_0x4d1b60);}};exports[_0xea17('0x33')]=function(_0x2fd65f){try{if(!_[_0xea17('0x1b')](recordings[_0x2fd65f['uniqueid']])){utils[_0xea17('0x11')](util['format'](_0xea17('0x34'),_0x2fd65f[_0xea17('0x5')]),_0x2fd65f);utils[_0xea17('0x2')](util[_0xea17('0x3')](_0xea17('0x35'),_0x2fd65f['uniqueid'],_0x2fd65f[_0xea17('0x36')],_0x2fd65f['appdata']));if(_0x2fd65f[_0xea17('0x36')][_0xea17('0x37')]()=='set'&&_[_0xea17('0x38')](_0x2fd65f[_0xea17('0x39')][_0xea17('0x37')](),_0xea17('0x3a'))){var _0x3baaeb=_0x2fd65f[_0xea17('0x39')][_0xea17('0x3b')]('=');var _0x1141b2=_0x3baaeb[0x0]['substring'](_0x3baaeb[0x0][_0xea17('0x3c')]('(')+0x1,_0x3baaeb[0x0][_0xea17('0x3c')](')'));var _0x1d61f0=_0x3baaeb[0x1];recordings[_0x2fd65f['uniqueid']][_0x1141b2]=_0x1d61f0;}}}catch(_0x8710f3){utils[_0xea17('0x17')](util['format'](_0xea17('0x34'),_0x2fd65f[_0xea17('0x5')]),_0x8710f3);}};exports[_0xea17('0x3d')]=function(_0x523ca4){try{if(!_[_0xea17('0x1b')](recordings[_0x523ca4['uniqueid']])){utils['debug'](util[_0xea17('0x3')]('[%s][recordings][queuecallerjoin]',_0x523ca4[_0xea17('0x5')]),_0x523ca4);utils['info'](util[_0xea17('0x3')](_0xea17('0x3e'),_0x523ca4[_0xea17('0x5')],_0x523ca4['queue']));recordings[_0x523ca4[_0xea17('0x5')]][_0xea17('0x3f')]=_0x523ca4[_0xea17('0x3f')];}}catch(_0x407a39){utils[_0xea17('0x17')](util[_0xea17('0x3')](_0xea17('0x40'),_0x523ca4[_0xea17('0x5')]),_0x407a39);}};exports[_0xea17('0x41')]=function(_0x559f7a){try{utils[_0xea17('0x11')](util[_0xea17('0x3')](_0xea17('0x42'),_0x559f7a['uniqueid']),_0x559f7a);utils['info'](util[_0xea17('0x3')](_0xea17('0x43'),_0x559f7a[_0xea17('0x5')],_0x559f7a[_0xea17('0x44')],_0x559f7a[_0xea17('0x45')],_0x559f7a['transfereecalleridnum'],_0x559f7a['transfereecalleridname']));if(recordings[_0x559f7a[_0xea17('0x46')]]&&transfers[_0xea17('0x6')][_0x559f7a[_0xea17('0x46')]]){transfers['blinds'][_0x559f7a[_0xea17('0x46')]][_0xea17('0x47')]=!![];}}catch(_0x29d765){utils[_0xea17('0x17')](util['format'](_0xea17('0x42'),_0x559f7a[_0xea17('0x5')]),_0x29d765);}}; \ No newline at end of file +var _0xea0e=['[%s][recordings][newstate]\x20context:%s\x20channel:%s','channelstate','transfer','[%s][recordings][newstate]','varset','variable','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinenum','connectedlinename','type','forEach','clone','newexten','[%s][recordings][newexten]','application','appdata','toLowerCase','set','startsWith','cdr','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][queuecallerjoin]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','[%s][recordings][blindtransfer]','lodash','util','./utils','./transfers.controller','info','[%s][recordings][writeDB]','uniqueid','blinds','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','format','[%s][recordings][newchannel]','linkedid','context','exten','channel','error','isNil'];(function(_0x56dbca,_0x59da2f){var _0x1379a0=function(_0x2d70df){while(--_0x2d70df){_0x56dbca['push'](_0x56dbca['shift']());}};_0x1379a0(++_0x59da2f);}(_0xea0e,0x153));var _0xeea0=function(_0x4e0ce1,_0x1f514c){_0x4e0ce1=_0x4e0ce1-0x0;var _0x455be7=_0xea0e[_0x4e0ce1];return _0x455be7;};'use strict';var _=require(_0xeea0('0x0'));var util=require(_0xeea0('0x1'));var utils=require(_0xeea0('0x2'));var transfers=require(_0xeea0('0x3'));var recordings={};function writeDB(_0x38d87a){var _0x56d01e;utils[_0xeea0('0x4')](util['format'](_0xeea0('0x5'),_0x38d87a[_0xeea0('0x6')]));if(transfers[_0xeea0('0x7')][_0x38d87a[_0xeea0('0x6')]]){_0x56d01e=_0x38d87a[_0xeea0('0x6')];_0x38d87a['uniqueid']=transfers[_0xeea0('0x7')][_0x38d87a['uniqueid']]['transfereeuniqueid'];}if(_0x38d87a[_0xeea0('0x8')]){utils[_0xeea0('0x9')](_0x38d87a[_0xeea0('0x8')])[_0xeea0('0xa')](function(_0x3e4e7f){if(_0x3e4e7f){_0x38d87a[_0xeea0('0xb')]=_0x3e4e7f[_0xeea0('0xc')];_0x38d87a[_0xeea0('0xd')]=_0x3e4e7f['id'];}utils[_0xeea0('0xe')](_0xeea0('0xf'),_0x38d87a);});}else{utils[_0xeea0('0xe')](_0xeea0('0xf'),_0x38d87a);}if(_0x56d01e)delete transfers['blinds'][_0x56d01e];}exports[_0xeea0('0x10')]=function(_0xb6d06d){try{utils[_0xeea0('0x11')](util[_0xeea0('0x12')](_0xeea0('0x13'),_0xb6d06d[_0xeea0('0x6')]),_0xb6d06d);if(_0xb6d06d[_0xeea0('0x6')]==_0xb6d06d[_0xeea0('0x14')]){utils[_0xeea0('0x4')](util[_0xeea0('0x12')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0xb6d06d['uniqueid'],_0xb6d06d[_0xeea0('0x15')],_0xb6d06d[_0xeea0('0x16')]));recordings[_0xb6d06d['uniqueid']]={'uniqueid':_0xb6d06d[_0xeea0('0x6')],'accountcode':_0xb6d06d[_0xeea0('0x8')],'exten':_0xb6d06d[_0xeea0('0x16')],'context':_0xb6d06d[_0xeea0('0x15')],'channel':_0xb6d06d[_0xeea0('0x17')],'monitors':[]};}}catch(_0x1dc9c8){utils[_0xeea0('0x18')](util['format']('[%s][recordings][newchannel]',_0xb6d06d[_0xeea0('0x6')]),_0x1dc9c8);}};exports['newstate']=function(_0x1bdf23){try{utils[_0xeea0('0x11')](util[_0xeea0('0x12')]('[%s][recordings][newstate]',_0x1bdf23[_0xeea0('0x6')]),_0x1bdf23);if(!_[_0xeea0('0x19')](recordings[_0x1bdf23[_0xeea0('0x6')]])&&_0x1bdf23['channelstate']==0x6){utils[_0xeea0('0x4')](util[_0xeea0('0x12')](_0xeea0('0x1a'),_0x1bdf23[_0xeea0('0x6')],_0x1bdf23[_0xeea0('0x15')],_0x1bdf23[_0xeea0('0x17')]));}else if(!_[_0xeea0('0x19')](recordings[_0x1bdf23[_0xeea0('0x14')]])&&_0x1bdf23[_0xeea0('0x1b')]==0x6&&_0x1bdf23[_0xeea0('0x15')]!=_0xeea0('0x1c')){utils[_0xeea0('0x4')](util[_0xeea0('0x12')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x1bdf23[_0xeea0('0x6')],_0x1bdf23[_0xeea0('0x14')],_0x1bdf23[_0xeea0('0x15')],_0x1bdf23[_0xeea0('0x17')]));recordings[_0x1bdf23[_0xeea0('0x14')]][_0xeea0('0x8')]=_0x1bdf23[_0xeea0('0x8')];}}catch(_0x5d05f3){utils[_0xeea0('0x18')](util['format'](_0xeea0('0x1d'),_0x1bdf23[_0xeea0('0x6')]),_0x5d05f3);}};exports[_0xeea0('0x1e')]=function(_0x909217){try{if(!_[_0xeea0('0x19')](_0x909217[_0xeea0('0x1f')])&&!_[_0xeea0('0x19')](_0x909217[_0xeea0('0x1f')]['mixmonitor_filename'])){utils['debug'](util['format'](_0xeea0('0x20'),_0x909217[_0xeea0('0x6')]),_0x909217);utils[_0xeea0('0x4')](util[_0xeea0('0x12')](_0xeea0('0x21'),_0x909217[_0xeea0('0x6')],_0x909217[_0xeea0('0x1f')],_0x909217[_0xeea0('0x22')]));if(_[_0xeea0('0x23')](_0x909217[_0xeea0('0x22')],_0xeea0('0x24'))){_0x909217[_0xeea0('0x22')]=_0x909217['value'][_0xeea0('0x25')]('.wav49',_0xeea0('0x26'));}if(recordings[_0x909217['linkedid']]){var _0x4afc83=_[_0xeea0('0x27')](recordings[_0x909217[_0xeea0('0x14')]][_0xeea0('0x28')],{'value':_0x909217[_0xeea0('0x22')]});if(_[_0xeea0('0x19')](_0x4afc83)){recordings[_0x909217[_0xeea0('0x14')]]['monitors'][_0xeea0('0x29')]({'value':_0x909217[_0xeea0('0x22')]});}}}}catch(_0x5946d6){utils['error'](util[_0xeea0('0x12')](_0xeea0('0x20'),_0x909217[_0xeea0('0x6')]),_0x5946d6);}};exports[_0xeea0('0x2a')]=function(_0x50730a){try{if(!_[_0xeea0('0x19')](recordings[_0x50730a[_0xeea0('0x6')]])){utils[_0xeea0('0x11')](util[_0xeea0('0x12')](_0xeea0('0x2b'),_0x50730a[_0xeea0('0x6')]),_0x50730a);utils[_0xeea0('0x4')](util[_0xeea0('0x12')](_0xeea0('0x2c'),_0x50730a[_0xeea0('0x6')],_0x50730a[_0xeea0('0x2d')],_0x50730a[_0xeea0('0x2e')],_0x50730a['cause-txt']));recordings[_0x50730a[_0xeea0('0x6')]][_0xeea0('0x2d')]=_0x50730a['calleridnum'];recordings[_0x50730a['uniqueid']][_0xeea0('0x2e')]=_0x50730a['calleridname'];recordings[_0x50730a[_0xeea0('0x6')]][_0xeea0('0x2f')]=_0x50730a[_0xeea0('0x2f')];recordings[_0x50730a[_0xeea0('0x6')]][_0xeea0('0x30')]=_0x50730a[_0xeea0('0x30')];if(recordings[_0x50730a[_0xeea0('0x6')]][_0xeea0('0x31')]=='outbound'&&recordings[_0x50730a[_0xeea0('0x6')]][_0xeea0('0x8')]){recordings[_0x50730a[_0xeea0('0x6')]][_0xeea0('0x2f')]=recordings[_0x50730a['uniqueid']][_0xeea0('0x8')];recordings[_0x50730a[_0xeea0('0x6')]]['connectedlinename']='';}recordings[_0x50730a[_0xeea0('0x6')]]['monitors'][_0xeea0('0x32')](function(_0xdf5ca6){var _0x4cf945=_[_0xeea0('0x33')](recordings[_0x50730a[_0xeea0('0x6')]]);_0x4cf945[_0xeea0('0x22')]=_0xdf5ca6[_0xeea0('0x22')];writeDB(_0x4cf945);});delete recordings[_0x50730a[_0xeea0('0x6')]];}}catch(_0x54521f){utils[_0xeea0('0x18')](util[_0xeea0('0x12')](_0xeea0('0x2b'),_0x50730a[_0xeea0('0x6')]),_0x54521f);}};exports[_0xeea0('0x34')]=function(_0x3e8573){try{if(!_[_0xeea0('0x19')](recordings[_0x3e8573[_0xeea0('0x6')]])){utils[_0xeea0('0x11')](util[_0xeea0('0x12')](_0xeea0('0x35'),_0x3e8573[_0xeea0('0x6')]),_0x3e8573);utils[_0xeea0('0x4')](util[_0xeea0('0x12')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x3e8573['uniqueid'],_0x3e8573[_0xeea0('0x36')],_0x3e8573[_0xeea0('0x37')]));if(_0x3e8573[_0xeea0('0x36')][_0xeea0('0x38')]()==_0xeea0('0x39')&&_[_0xeea0('0x3a')](_0x3e8573['appdata']['toLowerCase'](),_0xeea0('0x3b'))){var _0x629120=_0x3e8573[_0xeea0('0x37')]['split']('=');var _0x1b1354=_0x629120[0x0][_0xeea0('0x3c')](_0x629120[0x0]['lastIndexOf']('(')+0x1,_0x629120[0x0][_0xeea0('0x3d')](')'));var _0x105339=_0x629120[0x1];recordings[_0x3e8573[_0xeea0('0x6')]][_0x1b1354]=_0x105339;}}}catch(_0x304a2f){utils[_0xeea0('0x18')](util[_0xeea0('0x12')]('[%s][recordings][newexten]',_0x3e8573[_0xeea0('0x6')]),_0x304a2f);}};exports[_0xeea0('0x3e')]=function(_0x2a276d){try{if(!_[_0xeea0('0x19')](recordings[_0x2a276d['uniqueid']])){utils[_0xeea0('0x11')](util[_0xeea0('0x12')]('[%s][recordings][queuecallerjoin]',_0x2a276d[_0xeea0('0x6')]),_0x2a276d);utils[_0xeea0('0x4')](util[_0xeea0('0x12')](_0xeea0('0x3f'),_0x2a276d['uniqueid'],_0x2a276d[_0xeea0('0x40')]));recordings[_0x2a276d[_0xeea0('0x6')]][_0xeea0('0x40')]=_0x2a276d[_0xeea0('0x40')];}}catch(_0x579cd1){utils[_0xeea0('0x18')](util[_0xeea0('0x12')](_0xeea0('0x41'),_0x2a276d[_0xeea0('0x6')]),_0x579cd1);}};exports['blindtransfer']=function(_0xacffb1){try{utils[_0xeea0('0x11')](util[_0xeea0('0x12')]('[%s][recordings][blindtransfer]',_0xacffb1[_0xeea0('0x6')]),_0xacffb1);utils[_0xeea0('0x4')](util[_0xeea0('0x12')](_0xeea0('0x42'),_0xacffb1['uniqueid'],_0xacffb1['transferercalleridnum'],_0xacffb1[_0xeea0('0x43')],_0xacffb1[_0xeea0('0x44')],_0xacffb1[_0xeea0('0x45')]));if(recordings[_0xacffb1[_0xeea0('0x46')]]&&transfers[_0xeea0('0x7')][_0xacffb1[_0xeea0('0x46')]]){transfers['blinds'][_0xacffb1[_0xeea0('0x46')]][_0xeea0('0x47')]=!![];}}catch(_0x465196){utils[_0xeea0('0x18')](util[_0xeea0('0x12')](_0xeea0('0x48'),_0xacffb1[_0xeea0('0x6')]),_0x465196);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 90af9d5..0e0e0ee 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 _0xaf49=['secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','error','[%s][transfers][attendedtransfer]','lodash','util','info','format','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','[%s][transfers][blindtransfer]','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','attendedtransfer','debug','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext'];(function(_0x5e1dea,_0x4b73fb){var _0x774e84=function(_0x214f6a){while(--_0x214f6a){_0x5e1dea['push'](_0x5e1dea['shift']());}};_0x774e84(++_0x4b73fb);}(_0xaf49,0x1db));var _0x9af4=function(_0x347567,_0x25f60a){_0x347567=_0x347567-0x0;var _0x48e0ca=_0xaf49[_0x347567];return _0x48e0ca;};'use strict';var _=require(_0x9af4('0x0'));var util=require(_0x9af4('0x1'));var utils=require('./utils');function writeDB(_0x3dcfe2){utils[_0x9af4('0x2')](util[_0x9af4('0x3')]('[%s][transfers][writeDB]\x20type:%s',_0x3dcfe2[_0x9af4('0x4')]===_0x9af4('0x5')?_0x3dcfe2[_0x9af4('0x6')]:_0x3dcfe2[_0x9af4('0x7')],_0x3dcfe2[_0x9af4('0x4')]));utils[_0x9af4('0x8')](_0x9af4('0x9'),_0x3dcfe2);}exports[_0x9af4('0xa')]={};exports[_0x9af4('0xb')]=function(_0x58eecc){try{utils['debug'](util[_0x9af4('0x3')](_0x9af4('0xc'),_0x58eecc[_0x9af4('0x7')]),_0x58eecc);utils[_0x9af4('0x2')](util[_0x9af4('0x3')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x58eecc[_0x9af4('0x7')],_0x58eecc['transferercalleridnum'],_0x58eecc[_0x9af4('0xd')],_0x58eecc[_0x9af4('0xe')],_0x58eecc[_0x9af4('0xf')]));_0x58eecc[_0x9af4('0x4')]='blind';exports[_0x9af4('0xa')][_0x58eecc[_0x9af4('0x10')]]=_0x58eecc;writeDB(_0x58eecc);}catch(_0x14247e){utils['error'](util[_0x9af4('0x3')](_0x9af4('0xc'),_0x58eecc['uniqueid']),_0x14247e);}};exports[_0x9af4('0x11')]=function(_0x1c30b3){try{utils[_0x9af4('0x12')](util[_0x9af4('0x3')]('[%s][transfers][attendedtransfer]',_0x1c30b3['origtransfereruniqueid']),_0x1c30b3);utils[_0x9af4('0x2')](util[_0x9af4('0x3')](_0x9af4('0x13'),_0x1c30b3[_0x9af4('0x6')],_0x1c30b3[_0x9af4('0x14')],_0x1c30b3[_0x9af4('0x15')],_0x1c30b3[_0x9af4('0x16')],_0x1c30b3[_0x9af4('0x17')]));_0x1c30b3=_[_0x9af4('0x18')](_0x1c30b3,{'transfererchannel':_0x1c30b3[_0x9af4('0x19')],'transferercalleridnum':_0x1c30b3['origtransferercalleridnum'],'transferercalleridname':_0x1c30b3[_0x9af4('0x15')],'transfererconnectedlinenum':_0x1c30b3[_0x9af4('0x1a')],'transfererconnectedlinename':_0x1c30b3[_0x9af4('0x1b')],'transfereraccountcode':_0x1c30b3['origtransfereraccountcode'],'transferercontext':_0x1c30b3[_0x9af4('0x1c')],'transfererexten':_0x1c30b3[_0x9af4('0x1d')],'transfererlinkedid':_0x1c30b3[_0x9af4('0x1e')],'context':_0x1c30b3[_0x9af4('0x1f')],'extension':_0x1c30b3[_0x9af4('0x20')],'type':_0x9af4('0x5')});if(_[_0x9af4('0x21')](_0x1c30b3[_0x9af4('0x22')])){_0x1c30b3=_[_0x9af4('0x18')](_0x1c30b3,{'transfereechannel':_0x1c30b3[_0x9af4('0x23')],'transfereecalleridnum':_0x1c30b3[_0x9af4('0x16')],'transfereecalleridname':_0x1c30b3['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x1c30b3[_0x9af4('0x24')],'transfereeconnectedlinename':_0x1c30b3['transfertargetconnectedlinename'],'transfereeaccountcode':_0x1c30b3[_0x9af4('0x25')],'transfereecontext':_0x1c30b3[_0x9af4('0x26')],'transfereeexten':_0x1c30b3['transfertargetexten'],'transfereelinkedid':_0x1c30b3[_0x9af4('0x27')]});}writeDB(_0x1c30b3);}catch(_0xdeb7b4){utils[_0x9af4('0x28')](util[_0x9af4('0x3')](_0x9af4('0x29'),_0x1c30b3[_0x9af4('0x6')]),_0xdeb7b4);}}; \ No newline at end of file +var _0x7842=['info','format','[%s][transfers][writeDB]\x20type:%s','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','type','blind','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','transfertargetcalleridname','assign','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransferercontext','isNil','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','[%s][transfers][attendedtransfer]','lodash','util','./utils'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x7842,0x145));var _0x2784=function(_0x2f8530,_0x5cbd67){_0x2f8530=_0x2f8530-0x0;var _0x5e814e=_0x7842[_0x2f8530];return _0x5e814e;};'use strict';var _=require(_0x2784('0x0'));var util=require(_0x2784('0x1'));var utils=require(_0x2784('0x2'));function writeDB(_0x25c04b){utils[_0x2784('0x3')](util[_0x2784('0x4')](_0x2784('0x5'),_0x25c04b['type']===_0x2784('0x6')?_0x25c04b[_0x2784('0x7')]:_0x25c04b[_0x2784('0x8')],_0x25c04b['type']));utils[_0x2784('0x9')](_0x2784('0xa'),_0x25c04b);}exports[_0x2784('0xb')]={};exports[_0x2784('0xc')]=function(_0x34ae10){try{utils['debug'](util[_0x2784('0x4')](_0x2784('0xd'),_0x34ae10[_0x2784('0x8')]),_0x34ae10);utils[_0x2784('0x3')](util['format'](_0x2784('0xe'),_0x34ae10[_0x2784('0x8')],_0x34ae10['transferercalleridnum'],_0x34ae10[_0x2784('0xf')],_0x34ae10[_0x2784('0x10')],_0x34ae10['transfereecalleridname']));_0x34ae10[_0x2784('0x11')]=_0x2784('0x12');exports[_0x2784('0xb')][_0x34ae10[_0x2784('0x13')]]=_0x34ae10;writeDB(_0x34ae10);}catch(_0xb076a2){utils[_0x2784('0x14')](util['format']('[%s][transfers][blindtransfer]',_0x34ae10[_0x2784('0x8')]),_0xb076a2);}};exports[_0x2784('0x15')]=function(_0x1f3fc4){try{utils['debug'](util['format']('[%s][transfers][attendedtransfer]',_0x1f3fc4['origtransfereruniqueid']),_0x1f3fc4);utils[_0x2784('0x3')](util[_0x2784('0x4')](_0x2784('0x16'),_0x1f3fc4[_0x2784('0x7')],_0x1f3fc4[_0x2784('0x17')],_0x1f3fc4['origtransferercalleridname'],_0x1f3fc4['transfertargetcalleridnum'],_0x1f3fc4[_0x2784('0x18')]));_0x1f3fc4=_[_0x2784('0x19')](_0x1f3fc4,{'transfererchannel':_0x1f3fc4[_0x2784('0x1a')],'transferercalleridnum':_0x1f3fc4['origtransferercalleridnum'],'transferercalleridname':_0x1f3fc4[_0x2784('0x1b')],'transfererconnectedlinenum':_0x1f3fc4['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x1f3fc4[_0x2784('0x1c')],'transfereraccountcode':_0x1f3fc4[_0x2784('0x1d')],'transferercontext':_0x1f3fc4[_0x2784('0x1e')],'transfererexten':_0x1f3fc4[_0x2784('0x1f')],'transfererlinkedid':_0x1f3fc4['origtransfererlinkedid'],'context':_0x1f3fc4[_0x2784('0x20')],'extension':_0x1f3fc4['origtransfererexten'],'type':_0x2784('0x6')});if(_[_0x2784('0x21')](_0x1f3fc4['transfereechannel'])){_0x1f3fc4=_[_0x2784('0x19')](_0x1f3fc4,{'transfereechannel':_0x1f3fc4[_0x2784('0x22')],'transfereecalleridnum':_0x1f3fc4['transfertargetcalleridnum'],'transfereecalleridname':_0x1f3fc4[_0x2784('0x18')],'transfereeconnectedlinenum':_0x1f3fc4[_0x2784('0x23')],'transfereeconnectedlinename':_0x1f3fc4[_0x2784('0x24')],'transfereeaccountcode':_0x1f3fc4['transfertargetaccountcode'],'transfereecontext':_0x1f3fc4[_0x2784('0x25')],'transfereeexten':_0x1f3fc4[_0x2784('0x26')],'transfereelinkedid':_0x1f3fc4[_0x2784('0x27')]});}writeDB(_0x1f3fc4);}catch(_0x345488){utils[_0x2784('0x14')](util[_0x2784('0x4')](_0x2784('0x28'),_0x1f3fc4[_0x2784('0x7')]),_0x345488);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index ea66630..e559b34 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 _0x86da=['debug','error','request','then','[utils][request]\x20name:%s','GetUser','internal','interface','[utils][getUser]\x20where:%s','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','catch','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','name','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtract','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','client','http','xdr','info','inspect'];(function(_0x36176e,_0x3719b7){var _0xbe79bc=function(_0x2eea8f){while(--_0x2eea8f){_0x36176e['push'](_0x36176e['shift']());}};_0xbe79bc(++_0x3719b7);}(_0x86da,0xfb));var _0xa86d=function(_0x34f32c,_0x39fe66){_0x34f32c=_0x34f32c-0x0;var _0x54de91=_0x86da[_0x34f32c];return _0x54de91;};'use strict';var BPromise=require(_0xa86d('0x0'));var jayson=require(_0xa86d('0x1'));var moment=require('moment');var util=require('util');var client=jayson[_0xa86d('0x2')][_0xa86d('0x3')]({'port':0x2329});var logger=require('../../config/logger')(_0xa86d('0x4'));exports[_0xa86d('0x5')]=function(_0x2c1946,_0x3f9112){logger[_0xa86d('0x5')](_0x2c1946,_0x3f9112?util[_0xa86d('0x6')](_0x3f9112,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x17f64b,_0x453327){logger[_0xa86d('0x7')](_0x17f64b,_0x453327?util[_0xa86d('0x6')](_0x453327,{'showHidden':![],'depth':null}):'');};exports[_0xa86d('0x8')]=function(_0x545303,_0x32dc29){logger[_0xa86d('0x8')](_0x545303,_0x32dc29?util[_0xa86d('0x6')](_0x32dc29,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x4dd923,_0x2b7fd4){return client[_0xa86d('0x9')](_0x4dd923,{'body':_0x2b7fd4})[_0xa86d('0xa')](function(_0x57fbac){logger[_0xa86d('0x7')]('[utils][request]\x20name:%s',_0x4dd923,_0x57fbac?util['inspect'](_0x57fbac,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x17604c){logger['error'](_0xa86d('0xb'),_0x4dd923,_0x17604c?util[_0xa86d('0x6')](_0x17604c,{'showHidden':![],'depth':null}):'');});};function getUser(_0x4e6c5d){return client['request'](_0xa86d('0xc'),{'options':{'raw':!![],'attributes':['id',_0xa86d('0xd'),'name',_0xa86d('0xe')],'where':_0x4e6c5d,'limit':0x1}})['then'](function(_0x535ea7){logger[_0xa86d('0x7')](_0xa86d('0xf'),JSON['stringify'](_0x4e6c5d),_0x535ea7?util[_0xa86d('0x6')](_0x535ea7,{'showHidden':![],'depth':null}):'');return _0x535ea7[_0xa86d('0x10')][_0xa86d('0x11')]?_0x535ea7[_0xa86d('0x10')][0x0]:null;});}exports[_0xa86d('0x12')]=function(_0x203e36){return new BPromise(function(_0x49d18c,_0x2cc353){if(_0x203e36){return getUser({'internal':_0x203e36})[_0xa86d('0xa')](function(_0x3db21e){logger[_0xa86d('0x5')](_0xa86d('0x13'),_0x203e36,_0x3db21e?_0xa86d('0x14'):_0xa86d('0x15'));return _0x49d18c(_0x3db21e);})[_0xa86d('0x16')](function(_0x146da0){logger['error']('[utils][getUserByInternal]',_0x146da0?util[_0xa86d('0x6')](_0x146da0,{'showHidden':![],'depth':null}):'');return _0x49d18c(null);});}return _0x49d18c(null);});};exports['getUserByInterface']=function(_0x36f0b5){return new BPromise(function(_0x5b02d3,_0x3a816c){if(_0x36f0b5){return getUser({'interface':_0x36f0b5})[_0xa86d('0xa')](function(_0x4c85a8){logger[_0xa86d('0x5')](_0xa86d('0x17'),_0x36f0b5,_0x4c85a8?_0xa86d('0x14'):_0xa86d('0x15'));return _0x5b02d3(_0x4c85a8);})[_0xa86d('0x16')](function(_0x4566e1){logger['error'](_0xa86d('0x18'),_0x4566e1?util[_0xa86d('0x6')](_0x4566e1,{'showHidden':![],'depth':null}):'');return _0x5b02d3(null);});}return _0x5b02d3(null);});};exports['getUserByName']=function(_0x29d490){return new BPromise(function(_0x5fbb32,_0x22c945){if(_0x29d490){return getUser({'name':_0x29d490})['then'](function(_0x3682ed){logger[_0xa86d('0x5')]('[utils][getUserByName]\x20name:%s\x20%s',_0x29d490,_0x3682ed?'found':_0xa86d('0x15'));return _0x5fbb32(_0x3682ed);})[_0xa86d('0x16')](function(_0x430f03){logger['error'](_0xa86d('0x19'),_0x430f03?util[_0xa86d('0x6')](_0x430f03,{'showHidden':![],'depth':null}):'');return _0x5fbb32(null);});}return _0x5fbb32(null);});};exports[_0xa86d('0x1a')]=function(_0x320f43){return new BPromise(function(_0x2f47da,_0x256cf4){if(_0x320f43){return client[_0xa86d('0x9')](_0xa86d('0x1b'),{'options':{'raw':!![],'attributes':['id',_0xa86d('0x1c'),'type',_0xa86d('0x1d'),_0xa86d('0x1e')],'where':{'name':_0x320f43},'limit':0x1}})[_0xa86d('0xa')](function(_0x1e6dbd){logger[_0xa86d('0x7')](_0xa86d('0x1f'),_0x320f43,_0x1e6dbd?util['inspect'](_0x1e6dbd,{'showHidden':![],'depth':null}):'');logger[_0xa86d('0x5')](_0xa86d('0x20'),_0x320f43,_0x1e6dbd?_0xa86d('0x14'):_0xa86d('0x15'));return _0x2f47da(_0x1e6dbd['result']['length']?_0x1e6dbd[_0xa86d('0x10')][0x0]:null);})['catch'](function(_0x4cb64d){logger[_0xa86d('0x8')]('[utils][getVoiceQueueByName]',_0x4cb64d?util[_0xa86d('0x6')](_0x4cb64d,{'showHidden':![],'depth':null}):'');return _0x2f47da(null);});}return _0x2f47da(null);});};exports['addTime']=function(_0x37d5d6,_0xf27f2f){return moment(_0x37d5d6)[_0xa86d('0x21')](_0xf27f2f,_0xa86d('0x22'))[_0xa86d('0x23')](_0xa86d('0x24'));};exports['subtractTime']=function(_0x5cca4c,_0x19f0a8){return moment(_0x5cca4c)[_0xa86d('0x25')](_0x19f0a8,_0xa86d('0x22'))['format'](_0xa86d('0x24'));};exports['diffTime']=function(_0x39f482,_0x467450){return moment(_0x39f482)[_0xa86d('0x26')](moment(_0x467450),_0xa86d('0x22'));};exports[_0xa86d('0x27')]=function(_0x576918,_0x2151b1){return parseInt(_0x576918,0xa)+parseInt(_0x2151b1,0xa);};exports[_0xa86d('0x28')]=function(){return moment()[_0xa86d('0x23')](_0xa86d('0x24'));};exports[_0xa86d('0x29')]=function(_0x27870f,_0x48e6b7){if(_0x48e6b7){return moment(_0x27870f)['isAfter'](_0x48e6b7);}return!![];};exports[_0xa86d('0x2a')]=function(_0x52925f,_0x312e68){if(_0x312e68){return moment(_0x52925f)[_0xa86d('0x2a')](_0x312e68);}else if(_0x52925f){return!![];}return![];}; \ No newline at end of file +var _0xb7e9=['[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','addTime','add','format','YYYY-MM-DD\x20HH:mm:ss','subtract','seconds','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','client','http','../../config/logger','xdr','info','debug','inspect','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','[utils][getUser]\x20where:%s','stringify','length','result','getUserByInternal','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]','getUserByName','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout'];(function(_0x229c29,_0x378dc2){var _0x1ca9c6=function(_0x22a611){while(--_0x22a611){_0x229c29['push'](_0x229c29['shift']());}};_0x1ca9c6(++_0x378dc2);}(_0xb7e9,0x1b4));var _0x9b7e=function(_0x19dd32,_0x5b5417){_0x19dd32=_0x19dd32-0x0;var _0x501852=_0xb7e9[_0x19dd32];return _0x501852;};'use strict';var BPromise=require(_0x9b7e('0x0'));var jayson=require(_0x9b7e('0x1'));var moment=require(_0x9b7e('0x2'));var util=require('util');var client=jayson[_0x9b7e('0x3')][_0x9b7e('0x4')]({'port':0x2329});var logger=require(_0x9b7e('0x5'))(_0x9b7e('0x6'));exports['info']=function(_0x4d573e,_0x360264){logger[_0x9b7e('0x7')](_0x4d573e,_0x360264?util['inspect'](_0x360264,{'showHidden':![],'depth':null}):'');};exports[_0x9b7e('0x8')]=function(_0x3becad,_0x3d3ba0){logger[_0x9b7e('0x8')](_0x3becad,_0x3d3ba0?util[_0x9b7e('0x9')](_0x3d3ba0,{'showHidden':![],'depth':null}):'');};exports[_0x9b7e('0xa')]=function(_0x49e3a9,_0x443942){logger[_0x9b7e('0xa')](_0x49e3a9,_0x443942?util[_0x9b7e('0x9')](_0x443942,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x2ef4f8,_0x2a364e){return client[_0x9b7e('0xb')](_0x2ef4f8,{'body':_0x2a364e})[_0x9b7e('0xc')](function(_0x4ce163){logger[_0x9b7e('0x8')](_0x9b7e('0xd'),_0x2ef4f8,_0x4ce163?util[_0x9b7e('0x9')](_0x4ce163,{'showHidden':![],'depth':null}):'');})[_0x9b7e('0xe')](function(_0x40b5fa){logger[_0x9b7e('0xa')](_0x9b7e('0xd'),_0x2ef4f8,_0x40b5fa?util[_0x9b7e('0x9')](_0x40b5fa,{'showHidden':![],'depth':null}):'');});};function getUser(_0x474a78){return client[_0x9b7e('0xb')](_0x9b7e('0xf'),{'options':{'raw':!![],'attributes':['id',_0x9b7e('0x10'),_0x9b7e('0x11'),'interface'],'where':_0x474a78,'limit':0x1}})['then'](function(_0x44ac99){logger['debug'](_0x9b7e('0x12'),JSON[_0x9b7e('0x13')](_0x474a78),_0x44ac99?util[_0x9b7e('0x9')](_0x44ac99,{'showHidden':![],'depth':null}):'');return _0x44ac99['result'][_0x9b7e('0x14')]?_0x44ac99[_0x9b7e('0x15')][0x0]:null;});}exports[_0x9b7e('0x16')]=function(_0x1c861c){return new BPromise(function(_0x39c30a,_0x264c83){if(_0x1c861c){return getUser({'internal':_0x1c861c})[_0x9b7e('0xc')](function(_0x151490){logger[_0x9b7e('0x7')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x1c861c,_0x151490?_0x9b7e('0x17'):_0x9b7e('0x18'));return _0x39c30a(_0x151490);})[_0x9b7e('0xe')](function(_0x3884ca){logger[_0x9b7e('0xa')](_0x9b7e('0x19'),_0x3884ca?util['inspect'](_0x3884ca,{'showHidden':![],'depth':null}):'');return _0x39c30a(null);});}return _0x39c30a(null);});};exports[_0x9b7e('0x1a')]=function(_0x15abf5){return new BPromise(function(_0x2d9e82,_0x5db4e9){if(_0x15abf5){return getUser({'interface':_0x15abf5})[_0x9b7e('0xc')](function(_0x38b7fc){logger[_0x9b7e('0x7')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x15abf5,_0x38b7fc?_0x9b7e('0x17'):_0x9b7e('0x18'));return _0x2d9e82(_0x38b7fc);})[_0x9b7e('0xe')](function(_0xb0a010){logger[_0x9b7e('0xa')](_0x9b7e('0x1b'),_0xb0a010?util['inspect'](_0xb0a010,{'showHidden':![],'depth':null}):'');return _0x2d9e82(null);});}return _0x2d9e82(null);});};exports[_0x9b7e('0x1c')]=function(_0x529598){return new BPromise(function(_0x68f0c0,_0x407a83){if(_0x529598){return getUser({'name':_0x529598})[_0x9b7e('0xc')](function(_0x122411){logger[_0x9b7e('0x7')]('[utils][getUserByName]\x20name:%s\x20%s',_0x529598,_0x122411?'found':_0x9b7e('0x18'));return _0x68f0c0(_0x122411);})[_0x9b7e('0xe')](function(_0xbd5cd3){logger['error']('[utils][getUserByName]',_0xbd5cd3?util[_0x9b7e('0x9')](_0xbd5cd3,{'showHidden':![],'depth':null}):'');return _0x68f0c0(null);});}return _0x68f0c0(null);});};exports[_0x9b7e('0x1d')]=function(_0x83f776){return new BPromise(function(_0x303212,_0x5b8285){if(_0x83f776){return client[_0x9b7e('0xb')](_0x9b7e('0x1e'),{'options':{'raw':!![],'attributes':['id',_0x9b7e('0x11'),_0x9b7e('0x1f'),_0x9b7e('0x20'),_0x9b7e('0x21')],'where':{'name':_0x83f776},'limit':0x1}})[_0x9b7e('0xc')](function(_0x36a68b){logger[_0x9b7e('0x8')](_0x9b7e('0x22'),_0x83f776,_0x36a68b?util[_0x9b7e('0x9')](_0x36a68b,{'showHidden':![],'depth':null}):'');logger[_0x9b7e('0x7')](_0x9b7e('0x23'),_0x83f776,_0x36a68b?_0x9b7e('0x17'):_0x9b7e('0x18'));return _0x303212(_0x36a68b[_0x9b7e('0x15')][_0x9b7e('0x14')]?_0x36a68b[_0x9b7e('0x15')][0x0]:null);})[_0x9b7e('0xe')](function(_0x962fc3){logger[_0x9b7e('0xa')]('[utils][getVoiceQueueByName]',_0x962fc3?util[_0x9b7e('0x9')](_0x962fc3,{'showHidden':![],'depth':null}):'');return _0x303212(null);});}return _0x303212(null);});};exports[_0x9b7e('0x24')]=function(_0x7eed52,_0x447c2e){return moment(_0x7eed52)[_0x9b7e('0x25')](_0x447c2e,'seconds')[_0x9b7e('0x26')](_0x9b7e('0x27'));};exports['subtractTime']=function(_0x421483,_0xd98cc4){return moment(_0x421483)[_0x9b7e('0x28')](_0xd98cc4,_0x9b7e('0x29'))[_0x9b7e('0x26')](_0x9b7e('0x27'));};exports['diffTime']=function(_0x1eda2c,_0x396faf){return moment(_0x1eda2c)[_0x9b7e('0x2a')](moment(_0x396faf),'seconds');};exports[_0x9b7e('0x2b')]=function(_0xe14211,_0x75fa62){return parseInt(_0xe14211,0xa)+parseInt(_0x75fa62,0xa);};exports[_0x9b7e('0x2c')]=function(){return moment()[_0x9b7e('0x26')](_0x9b7e('0x27'));};exports[_0x9b7e('0x2d')]=function(_0x5e4e53,_0x2996f0){if(_0x2996f0){return moment(_0x5e4e53)[_0x9b7e('0x2d')](_0x2996f0);}return!![];};exports[_0x9b7e('0x2e')]=function(_0xa0f4cb,_0x2400d5){if(_0x2400d5){return moment(_0xa0f4cb)['isBefore'](_0x2400d5);}else if(_0xa0f4cb){return!![];}return![];}; \ No newline at end of file diff --git a/server/utils/client-side-logger.js b/server/utils/client-side-logger.js index 6044f6d..288423a 100644 --- a/server/utils/client-side-logger.js +++ b/server/utils/client-side-logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3527=['body','\x20body=%s','format','method','headers','x-forwarded-for','connection','url','statusCode','responseTime','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','remoteAddress','device','other','agent_id','agent_name','test','setupLoggers','fs-extra','lodash','util','./loggers','fileLogger','./mask-sensitive-data','join','/var','log','xcally','client','name','ensureDir','user','then','no-user','data','timestamp','catch','error','api','auth','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s'];(function(_0x4d79f9,_0x5e96bc){var _0x5bc6e0=function(_0x15fc16){while(--_0x15fc16){_0x4d79f9['push'](_0x4d79f9['shift']());}};_0x5bc6e0(++_0x5e96bc);}(_0x3527,0x12f));var _0x7352=function(_0x26b8b5,_0xf5c2c1){_0x26b8b5=_0x26b8b5-0x0;var _0x2150a9=_0x3527[_0x26b8b5];return _0x2150a9;};var fs=require(_0x7352('0x0'));var _=require(_0x7352('0x1'));var ewinston=require('express-winston');var path=require('path');var util=require(_0x7352('0x2'));var fileLogger=require(_0x7352('0x3'))[_0x7352('0x4')];var safeTemplate=require('./safe-template')['safeTemplate'];var maskSensitiveData=require(_0x7352('0x5'))['maskSensitiveData'];function ClientSideLogger(){function _0x50bf1c(_0x52f409){var _0x419424=path[_0x7352('0x6')](_0x7352('0x7'),_0x7352('0x8'),_0x7352('0x9'));var _0x311eec=path[_0x7352('0x6')](_0x7352('0xa'),_0x52f409['role']+'-'+_0x52f409[_0x7352('0xb')]);return fs[_0x7352('0xc')](path[_0x7352('0x6')](_0x419424,_0x311eec))['then'](function(){var _0x1da379=fileLogger(_0x7352('0xa'),path['join'](_0x419424,_0x311eec));return _0x1da379;})['catch'](function(_0x241a33){throw _0x241a33;});}this['log']=function(_0x22cfe7,_0x45527b,_0x2625f0,_0x5517ee){return _0x50bf1c(_0x22cfe7[_0x7352('0xd')])[_0x7352('0xe')](function(_0x296cef){var _0x3eb88e=_0x296cef[_0x45527b];return _0x3eb88e;})[_0x7352('0xe')](function(_0x4c37da){var _0x3f63f9=_0x22cfe7[_0x7352('0xd')]?_0x22cfe7[_0x7352('0xd')]['id']:_0x7352('0xf');var _0x29f9f1=_0x5517ee[_0x7352('0x10')];var _0x53a412=_0x5517ee[_0x7352('0x11')];var _0x206005=new Date(Number(_0x53a412));return _0x4c37da(_0x3f63f9,_0x206005,_0x2625f0,_0x29f9f1);})[_0x7352('0x12')](function(_0x2af3bf){fileLogger(_0x7352('0xa'))[_0x7352('0x13')](_0x2af3bf);});};}function setupLoggers(_0x5cc264){return new Promise(function(_0x39c95a){var _0x438fc6=new ClientSideLogger();var _0x45b25b=fileLogger(_0x7352('0x14'));var _0x3d548e=fileLogger(_0x7352('0x15'));_0x5cc264['set'](_0x7352('0x16'),_0x438fc6);_0x5cc264[_0x7352('0x17')](ewinston[_0x7352('0x18')]({'winstonInstance':_0x45b25b,'meta':![],'statusLevels':!![],'msg':function(_0x7842e2,_0xc64b11){var _0x2f3dc8=_0x7352('0x19');if(!_['isEmpty'](_0x7842e2[_0x7352('0x1a')])){_0x2f3dc8+=_0x7352('0x1b');var _0x3ac31b=_0x7842e2[_0x7352('0x1a')];maskSensitiveData(_0x3ac31b);}return safeTemplate(util[_0x7352('0x1c')](_0x2f3dc8,_0x7842e2[_0x7352('0x1d')],_0x7842e2[_0x7352('0x1e')][_0x7352('0x1f')]?_0x7842e2['headers'][_0x7352('0x1f')]:_0x7842e2[_0x7352('0x20')]['remoteAddress']||_0x7842e2['ip'],_0x7842e2[_0x7352('0x21')],_0xc64b11[_0x7352('0x22')],_0xc64b11[_0x7352('0x23')],_0x7842e2[_0x7352('0xd')]?_0x7842e2[_0x7352('0xd')]['id']:null,_0x7842e2['user']?_0x7842e2[_0x7352('0xd')]['name']:null,_0x7842e2[_0x7352('0xd')]?_0x7842e2[_0x7352('0xd')][_0x7352('0x24')]:null,_0x3ac31b?util[_0x7352('0x25')](_0x3ac31b,![],null):''));}}));_0x5cc264[_0x7352('0x17')](ewinston['logger']({'winstonInstance':_0x3d548e,'meta':![],'statusLevels':!![],'msg':function(_0x40d101,_0x3a8ba9){var _0x5a9088=_0x7352('0x26');if(_0x40d101['body']&&_0x40d101[_0x7352('0x1a')]['device']&&_0x40d101['body']['agent_id']){_0x5a9088=_0x7352('0x27');}return util[_0x7352('0x1c')](_0x5a9088,_0x40d101[_0x7352('0x1d')],_0x40d101['headers'][_0x7352('0x1f')]?_0x40d101[_0x7352('0x1e')][_0x7352('0x1f')]:_0x40d101[_0x7352('0x20')][_0x7352('0x28')]||_0x40d101['ip'],_0x40d101['url'],_0x3a8ba9['statusCode'],_0x3a8ba9['responseTime'],_0x40d101[_0x7352('0xd')]?_0x40d101[_0x7352('0xd')]['id']:null,_0x40d101['user']?_0x40d101['user'][_0x7352('0xb')]:null,_0x40d101[_0x7352('0xd')]?_0x40d101[_0x7352('0xd')][_0x7352('0x24')]:null,_0x40d101[_0x7352('0x1a')]&&_0x40d101[_0x7352('0x1a')][_0x7352('0x29')]?_0x40d101[_0x7352('0x1a')][_0x7352('0x29')]:_0x7352('0x2a'),_0x40d101[_0x7352('0x1a')]&&_0x40d101[_0x7352('0x1a')][_0x7352('0x2b')]?_0x40d101[_0x7352('0x1a')][_0x7352('0x2b')]:'',_0x40d101['body']&&_0x40d101[_0x7352('0x1a')][_0x7352('0x2c')]?_0x40d101[_0x7352('0x1a')][_0x7352('0x2c')]:'');},'ignoreRoute':function(_0x1cebcb){var _0x103612=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x103612[_0x7352('0x2d')](_0x1cebcb[_0x7352('0x21')]);}}));return _0x39c95a();});}exports[_0x7352('0x2e')]=setupLoggers; \ No newline at end of file +var _0x467e=['timestamp','error','api','auth','set','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','url','responseTime','name','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','statusCode','other','test','fs-extra','lodash','express-winston','path','util','./loggers','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','client','role','then','catch','user','data'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x467e,0x14f));var _0xe467=function(_0x141c05,_0x319076){_0x141c05=_0x141c05-0x0;var _0x25fa28=_0x467e[_0x141c05];return _0x25fa28;};var fs=require(_0xe467('0x0'));var _=require(_0xe467('0x1'));var ewinston=require(_0xe467('0x2'));var path=require(_0xe467('0x3'));var util=require(_0xe467('0x4'));var fileLogger=require(_0xe467('0x5'))['fileLogger'];var safeTemplate=require('./safe-template')[_0xe467('0x6')];var maskSensitiveData=require(_0xe467('0x7'))[_0xe467('0x8')];function ClientSideLogger(){function _0x5ebc7a(_0x4d2d4b){var _0x372f44=path[_0xe467('0x9')](_0xe467('0xa'),'log','xcally');var _0x1d7d36=path[_0xe467('0x9')](_0xe467('0xb'),_0x4d2d4b[_0xe467('0xc')]+'-'+_0x4d2d4b['name']);return fs['ensureDir'](path['join'](_0x372f44,_0x1d7d36))[_0xe467('0xd')](function(){var _0x14eed6=fileLogger(_0xe467('0xb'),path[_0xe467('0x9')](_0x372f44,_0x1d7d36));return _0x14eed6;})[_0xe467('0xe')](function(_0x4535e1){throw _0x4535e1;});}this['log']=function(_0x522b32,_0x2ff5e1,_0x118271,_0x3d5463){return _0x5ebc7a(_0x522b32[_0xe467('0xf')])[_0xe467('0xd')](function(_0x58335e){var _0x54e2bf=_0x58335e[_0x2ff5e1];return _0x54e2bf;})[_0xe467('0xd')](function(_0x130603){var _0x1baa70=_0x522b32['user']?_0x522b32[_0xe467('0xf')]['id']:'no-user';var _0x47ad5b=_0x3d5463[_0xe467('0x10')];var _0x48bcee=_0x3d5463[_0xe467('0x11')];var _0x49a689=new Date(Number(_0x48bcee));return _0x130603(_0x1baa70,_0x49a689,_0x118271,_0x47ad5b);})[_0xe467('0xe')](function(_0xdcf7dc){fileLogger(_0xe467('0xb'))[_0xe467('0x12')](_0xdcf7dc);});};}function setupLoggers(_0x3a1b8c){return new Promise(function(_0x553e64){var _0x1a2bdf=new ClientSideLogger();var _0xab56da=fileLogger(_0xe467('0x13'));var _0x5b60fb=fileLogger(_0xe467('0x14'));_0x3a1b8c[_0xe467('0x15')](_0xe467('0x16'),_0x1a2bdf);_0x3a1b8c[_0xe467('0x17')](ewinston[_0xe467('0x18')]({'winstonInstance':_0xab56da,'meta':![],'statusLevels':!![],'msg':function(_0x5ee037,_0x2ca6d5){var _0x2dcbab=_0xe467('0x19');if(!_['isEmpty'](_0x5ee037[_0xe467('0x1a')])){_0x2dcbab+=_0xe467('0x1b');var _0xb23739=_0x5ee037[_0xe467('0x1a')];maskSensitiveData(_0xb23739);}return safeTemplate(util[_0xe467('0x1c')](_0x2dcbab,_0x5ee037[_0xe467('0x1d')],_0x5ee037['headers']['x-forwarded-for']?_0x5ee037[_0xe467('0x1e')][_0xe467('0x1f')]:_0x5ee037[_0xe467('0x20')]['remoteAddress']||_0x5ee037['ip'],_0x5ee037[_0xe467('0x21')],_0x2ca6d5['statusCode'],_0x2ca6d5[_0xe467('0x22')],_0x5ee037[_0xe467('0xf')]?_0x5ee037[_0xe467('0xf')]['id']:null,_0x5ee037[_0xe467('0xf')]?_0x5ee037[_0xe467('0xf')][_0xe467('0x23')]:null,_0x5ee037[_0xe467('0xf')]?_0x5ee037[_0xe467('0xf')][_0xe467('0xc')]:null,_0xb23739?util[_0xe467('0x24')](_0xb23739,![],null):''));}}));_0x3a1b8c['use'](ewinston[_0xe467('0x18')]({'winstonInstance':_0x5b60fb,'meta':![],'statusLevels':!![],'msg':function(_0x33bfbe,_0x1c3b3b){var _0x562825=_0xe467('0x25');if(_0x33bfbe['body']&&_0x33bfbe[_0xe467('0x1a')][_0xe467('0x26')]&&_0x33bfbe['body'][_0xe467('0x27')]){_0x562825=_0xe467('0x28');}return util[_0xe467('0x1c')](_0x562825,_0x33bfbe[_0xe467('0x1d')],_0x33bfbe[_0xe467('0x1e')][_0xe467('0x1f')]?_0x33bfbe[_0xe467('0x1e')][_0xe467('0x1f')]:_0x33bfbe[_0xe467('0x20')]['remoteAddress']||_0x33bfbe['ip'],_0x33bfbe[_0xe467('0x21')],_0x1c3b3b[_0xe467('0x29')],_0x1c3b3b[_0xe467('0x22')],_0x33bfbe[_0xe467('0xf')]?_0x33bfbe[_0xe467('0xf')]['id']:null,_0x33bfbe['user']?_0x33bfbe[_0xe467('0xf')]['name']:null,_0x33bfbe[_0xe467('0xf')]?_0x33bfbe['user']['role']:null,_0x33bfbe['body']&&_0x33bfbe[_0xe467('0x1a')][_0xe467('0x26')]?_0x33bfbe['body'][_0xe467('0x26')]:_0xe467('0x2a'),_0x33bfbe['body']&&_0x33bfbe[_0xe467('0x1a')]['agent_id']?_0x33bfbe[_0xe467('0x1a')][_0xe467('0x27')]:'',_0x33bfbe[_0xe467('0x1a')]&&_0x33bfbe[_0xe467('0x1a')]['agent_name']?_0x33bfbe[_0xe467('0x1a')]['agent_name']:'');},'ignoreRoute':function(_0x147498){var _0x5f008c=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x5f008c[_0xe467('0x2b')](_0x147498[_0xe467('0x21')]);}}));return _0x553e64();});}exports['setupLoggers']=setupLoggers; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index c166275..744eec8 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe62f=['stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','Console','File','error','%s-%s','warn','consoleLogger','fileLogger','path','util','moment','winston','debugLevel','toLowerCase','info','redBG\x20white','red','bold\x20yellow','white','bold\x20green','gray','bold\x20magenta','bold\x20blue','addColors','/var/log/xcally','join','%s-%s.log','message','replace','{{{','}}}','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta','keys','length'];(function(_0x130d3b,_0x2b6918){var _0x3cba4d=function(_0x17316f){while(--_0x17316f){_0x130d3b['push'](_0x130d3b['shift']());}};_0x3cba4d(++_0x2b6918);}(_0xe62f,0x89));var _0xfe62=function(_0x954988,_0x4f11b5){_0x954988=_0x954988-0x0;var _0x3f084e=_0xe62f[_0x954988];return _0x3f084e;};'use strict';var path=require(_0xfe62('0x0'));var util=require(_0xfe62('0x1'));var moment=require(_0xfe62('0x2'));var winston=require(_0xfe62('0x3'));var config=require('../config/environment');var debugLevel=config['debugLevel']?config[_0xfe62('0x4')][_0xfe62('0x5')]():_0xfe62('0x6');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0xfe62('0x7'),'error':_0xfe62('0x8'),'warn':_0xfe62('0x9'),'info':_0xfe62('0xa'),'print':'bold\x20white','success':_0xfe62('0xb'),'http':_0xfe62('0xc'),'verbose':_0xfe62('0xd'),'debug':_0xfe62('0xe'),'silly':'bold\x20cyan'};winston[_0xfe62('0xf')](XC_LOG_COLORS);function getLogFileName(_0x4a81ba,_0xf3bd56,_0x58f53f){var _0x3dfe78=_0x4a81ba||_0xfe62('0x10');return path[_0xfe62('0x11')](_0x3dfe78,util['format'](_0xfe62('0x12'),_0xf3bd56,_0x58f53f));}function formatter(_0x27f831,_0x19e7d0){_0x19e7d0['message']=_0x19e7d0[_0xfe62('0x13')][_0xfe62('0x14')](/@@{/g,_0xfe62('0x15'))[_0xfe62('0x14')](/}@@/g,_0xfe62('0x16'))[_0xfe62('0x14')](/@{/g,'{{')[_0xfe62('0x14')](/}@/g,'}}');return util[_0xfe62('0x17')](_0xfe62('0x18'),moment()['format'](_0xfe62('0x19')),_0x19e7d0[_0xfe62('0x1a')][_0xfe62('0x1b')](),_0x27f831,_0x19e7d0[_0xfe62('0x13')]);}function fileFormat(_0x2e9ac6,_0x3dde87){_0x3dde87[_0xfe62('0x13')]=_0x3dde87[_0xfe62('0x13')][_0xfe62('0x14')](/@@{/g,'{{{')[_0xfe62('0x14')](/}@@/g,'}}}')[_0xfe62('0x14')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x329849=_0x3dde87[_0xfe62('0x1c')]&&Object[_0xfe62('0x1d')](_0x3dde87['meta'])[_0xfe62('0x1e')]?'\x0a\x09'+JSON[_0xfe62('0x1f')](_0x3dde87['meta']):'';return util[_0xfe62('0x17')](_0xfe62('0x20'),moment()[_0xfe62('0x17')](_0xfe62('0x19')),_0x3dde87[_0xfe62('0x1a')][_0xfe62('0x1b')](),_0x2e9ac6,_0x3dde87[_0xfe62('0x13')],_0x329849);}function consoleLogger(){var _0x4a6898=new winston[(_0xfe62('0x21'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xfe62('0x22'))][(_0xfe62('0x23'))]({'level':'warn','json':![],'formatter':function(_0x568646){return formatter('',_0x568646);}})]});return _0x4a6898;}function fileLogger(_0xb960d7,_0x114cfe){var _0x52d095=new winston[(_0xfe62('0x21'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xfe62('0x22'))][(_0xfe62('0x24'))]({'name':util[_0xfe62('0x17')]('%s-%s',_0xb960d7,_0xfe62('0x25')),'filename':getLogFileName(_0x114cfe,_0xb960d7,'error'),'level':_0xfe62('0x25'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x50e172){return fileFormat(_0xb960d7,_0x50e172);}}),new winston[(_0xfe62('0x22'))][(_0xfe62('0x24'))]({'name':util[_0xfe62('0x17')](_0xfe62('0x26'),_0xb960d7,debugLevel),'filename':getLogFileName(_0x114cfe,_0xb960d7,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1026f0){return fileFormat(_0xb960d7,_0x1026f0);}}),new winston['transports'][(_0xfe62('0x23'))]({'level':_0xfe62('0x27'),'json':![],'formatter':function(_0x8628df){return fileFormat(_0xb960d7,_0x8628df);}})]});return _0x52d095;}exports[_0xfe62('0x28')]=consoleLogger;exports[_0xfe62('0x29')]=fileLogger; \ No newline at end of file +var _0x20c8=['stringify','level','toUpperCase','Logger','transports','Console','warn','File','%s-%s','consoleLogger','fileLogger','path','util','moment','winston','debugLevel','toLowerCase','red','bold\x20yellow','white','bold\x20white','gray','bold\x20cyan','/var/log/xcally','join','format','%s-%s.log','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','message','meta','keys','length'];(function(_0x2de3bf,_0x21ba20){var _0x263b02=function(_0x2afc20){while(--_0x2afc20){_0x2de3bf['push'](_0x2de3bf['shift']());}};_0x263b02(++_0x21ba20);}(_0x20c8,0x107));var _0x820c=function(_0x560348,_0x169362){_0x560348=_0x560348-0x0;var _0x57258d=_0x20c8[_0x560348];return _0x57258d;};'use strict';var path=require(_0x820c('0x0'));var util=require(_0x820c('0x1'));var moment=require(_0x820c('0x2'));var winston=require(_0x820c('0x3'));var config=require('../config/environment');var debugLevel=config[_0x820c('0x4')]?config[_0x820c('0x4')][_0x820c('0x5')]():'info';var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':_0x820c('0x6'),'warn':_0x820c('0x7'),'info':_0x820c('0x8'),'print':_0x820c('0x9'),'success':'bold\x20green','http':_0x820c('0xa'),'verbose':'bold\x20magenta','debug':'bold\x20blue','silly':_0x820c('0xb')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x426cb6,_0xb3f974,_0xb339f1){var _0x3251e7=_0x426cb6||_0x820c('0xc');return path[_0x820c('0xd')](_0x3251e7,util[_0x820c('0xe')](_0x820c('0xf'),_0xb3f974,_0xb339f1));}function formatter(_0x2c4035,_0x1378d5){_0x1378d5['message']=_0x1378d5['message'][_0x820c('0x10')](/@@{/g,_0x820c('0x11'))[_0x820c('0x10')](/}@@/g,_0x820c('0x12'))['replace'](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x820c('0xe')](_0x820c('0x13'),moment()[_0x820c('0xe')](_0x820c('0x14')),_0x1378d5['level']['toUpperCase'](),_0x2c4035,_0x1378d5[_0x820c('0x15')]);}function fileFormat(_0x42c39f,_0x7c577b){_0x7c577b[_0x820c('0x15')]=_0x7c577b[_0x820c('0x15')]['replace'](/@@{/g,_0x820c('0x11'))[_0x820c('0x10')](/}@@/g,_0x820c('0x12'))['replace'](/@{/g,'{{')[_0x820c('0x10')](/}@/g,'}}');var _0xbf29bb=_0x7c577b[_0x820c('0x16')]&&Object[_0x820c('0x17')](_0x7c577b[_0x820c('0x16')])[_0x820c('0x18')]?'\x0a\x09'+JSON[_0x820c('0x19')](_0x7c577b[_0x820c('0x16')]):'';return util[_0x820c('0xe')]('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()[_0x820c('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),_0x7c577b[_0x820c('0x1a')][_0x820c('0x1b')](),_0x42c39f,_0x7c577b[_0x820c('0x15')],_0xbf29bb);}function consoleLogger(){var _0x2f2ff9=new winston[(_0x820c('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x820c('0x1d'))][(_0x820c('0x1e'))]({'level':_0x820c('0x1f'),'json':![],'formatter':function(_0x364d78){return formatter('',_0x364d78);}})]});return _0x2f2ff9;}function fileLogger(_0x5cda2d,_0x5dd472){var _0x5a6b39=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x820c('0x1d'))]['File']({'name':util[_0x820c('0xe')]('%s-%s',_0x5cda2d,'error'),'filename':getLogFileName(_0x5dd472,_0x5cda2d,'error'),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x29677e){return fileFormat(_0x5cda2d,_0x29677e);}}),new winston[(_0x820c('0x1d'))][(_0x820c('0x20'))]({'name':util[_0x820c('0xe')](_0x820c('0x21'),_0x5cda2d,debugLevel),'filename':getLogFileName(_0x5dd472,_0x5cda2d,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x20d606){return fileFormat(_0x5cda2d,_0x20d606);}}),new winston[(_0x820c('0x1d'))][(_0x820c('0x1e'))]({'level':_0x820c('0x1f'),'json':![],'formatter':function(_0x4f380e){return fileFormat(_0x5cda2d,_0x4f380e);}})]});return _0x5a6b39;}exports[_0x820c('0x22')]=consoleLogger;exports[_0x820c('0x23')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 41a2e75..429fdb4 100644 --- a/server/utils/mask-sensitive-data.js +++ b/server/utils/mask-sensitive-data.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['consumerSecret','membername','calleridname','exten','privateKey','secretaccesskey','user','pass','accountSid','localstationid','dsn','secret','registry','oldPassword','length','isPlainObject','isString','replace','@@{','}@@','username','newPassword','apiKey','firstName','lastName','street','mobile','email','clientId','code','accessKey','tenantId','token','channelSecret','accessToken','consumerKey'];(function(_0x55bf39,_0x37c4f7){var _0x64701b=function(_0x10de08){while(--_0x10de08){_0x55bf39['push'](_0x55bf39['shift']());}};_0x64701b(++_0x37c4f7);}(_0x5f66,0x1a0));var _0x65f6=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x5f66[_0x13d07a];return _0x5ee0ee;};var _=require('lodash');var sensitiveFields=[_0x65f6('0x0'),'password',_0x65f6('0x1'),_0x65f6('0x2'),_0x65f6('0x3'),_0x65f6('0x4'),_0x65f6('0x5'),'phone',_0x65f6('0x6'),'fax',_0x65f6('0x7'),_0x65f6('0x8'),'clientSecret','securityToken',_0x65f6('0x9'),_0x65f6('0xa'),_0x65f6('0xb'),_0x65f6('0xc'),_0x65f6('0xd'),_0x65f6('0xe'),'accessTokenSecret','authToken',_0x65f6('0xf'),_0x65f6('0x10'),_0x65f6('0x11'),_0x65f6('0x12'),'calleridnum',_0x65f6('0x13'),'vidaooApiKey','clientEmail',_0x65f6('0x14'),'accesskeyid',_0x65f6('0x15'),'key',_0x65f6('0x16'),_0x65f6('0x17'),_0x65f6('0x18'),_0x65f6('0x19'),_0x65f6('0x1a'),_0x65f6('0x1b'),_0x65f6('0x1c'),_0x65f6('0x1d')];function maskSensitiveData(_0x46dbc6){const _0x3440af=/(?!^)[\s\S](?!$)/g;if(_['isPlainObject'](_0x46dbc6)){for(const _0x19b9ff in _0x46dbc6){if(_['isArray'](_0x46dbc6[_0x19b9ff])){for(let _0x5dd324=0x0;_0x5dd324<_0x46dbc6[_0x19b9ff][_0x65f6('0x1e')];_0x5dd324++){maskSensitiveData(_0x46dbc6[_0x19b9ff][_0x5dd324]);}}else if(_[_0x65f6('0x1f')](_0x46dbc6[_0x19b9ff])){maskSensitiveData(_0x46dbc6[_0x19b9ff]);}else if(_[_0x65f6('0x20')](_0x46dbc6[_0x19b9ff])){_0x46dbc6[_0x19b9ff]=_0x46dbc6[_0x19b9ff][_0x65f6('0x21')](/{{{/g,_0x65f6('0x22'))[_0x65f6('0x21')](/}}}/g,_0x65f6('0x23'))[_0x65f6('0x21')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x19b9ff)){_0x46dbc6[_0x19b9ff]=_0x46dbc6[_0x19b9ff][_0x65f6('0x21')](_0x3440af,'*');}}}}}module['exports']['maskSensitiveData']=maskSensitiveData; \ No newline at end of file +var _0x66fa=['calleridnum','vidaooApiKey','privateKey','secretaccesskey','key','user','localstationid','oldPassword','isPlainObject','length','isString','replace','includes','exports','maskSensitiveData','lodash','username','newPassword','apiKey','firstName','lastName','street','phone','mobile','clientId','clientSecret','securityToken','code','accessKey','token','accessToken','authToken','calleridname'];(function(_0xf25ef3,_0x576204){var _0x4562ec=function(_0x2a325c){while(--_0x2a325c){_0xf25ef3['push'](_0xf25ef3['shift']());}};_0x4562ec(++_0x576204);}(_0x66fa,0x117));var _0xa66f=function(_0x38f0dc,_0x3b6fc0){_0x38f0dc=_0x38f0dc-0x0;var _0x26395a=_0x66fa[_0x38f0dc];return _0x26395a;};var _=require(_0xa66f('0x0'));var sensitiveFields=[_0xa66f('0x1'),'password',_0xa66f('0x2'),_0xa66f('0x3'),_0xa66f('0x4'),_0xa66f('0x5'),_0xa66f('0x6'),_0xa66f('0x7'),_0xa66f('0x8'),'fax','email',_0xa66f('0x9'),_0xa66f('0xa'),_0xa66f('0xb'),_0xa66f('0xc'),_0xa66f('0xd'),'tenantId',_0xa66f('0xe'),'channelSecret',_0xa66f('0xf'),'accessTokenSecret',_0xa66f('0x10'),'consumerKey','consumerSecret','membername',_0xa66f('0x11'),_0xa66f('0x12'),'exten',_0xa66f('0x13'),'clientEmail',_0xa66f('0x14'),'accesskeyid',_0xa66f('0x15'),_0xa66f('0x16'),_0xa66f('0x17'),'pass','accountSid',_0xa66f('0x18'),'dsn','secret','registry',_0xa66f('0x19')];function maskSensitiveData(_0x452c37){const _0x267129=/(?!^)[\s\S](?!$)/g;if(_[_0xa66f('0x1a')](_0x452c37)){for(const _0xd348f9 in _0x452c37){if(_['isArray'](_0x452c37[_0xd348f9])){for(let _0x5510dc=0x0;_0x5510dc<_0x452c37[_0xd348f9][_0xa66f('0x1b')];_0x5510dc++){maskSensitiveData(_0x452c37[_0xd348f9][_0x5510dc]);}}else if(_[_0xa66f('0x1a')](_0x452c37[_0xd348f9])){maskSensitiveData(_0x452c37[_0xd348f9]);}else if(_[_0xa66f('0x1c')](_0x452c37[_0xd348f9])){_0x452c37[_0xd348f9]=_0x452c37[_0xd348f9][_0xa66f('0x1d')](/{{{/g,'@@{')[_0xa66f('0x1d')](/}}}/g,'}@@')['replace'](/{{/g,'@{')[_0xa66f('0x1d')](/}}/g,'}@');if(_[_0xa66f('0x1e')](sensitiveFields,_0xd348f9)){_0x452c37[_0xd348f9]=_0x452c37[_0xd348f9][_0xa66f('0x1d')](_0x267129,'*');}}}}}module[_0xa66f('0x1f')][_0xa66f('0x20')]=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index d3f8b01..3e6cca6 100644 --- a/server/utils/safe-template.js +++ b/server/utils/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1eba=['\x20}\x20}','replace','isArray','map','isPlainObject','keys','reduce','exports','safeTemplate','lodash','{\x20{\x20'];(function(_0x1186ba,_0x421a86){var _0x13a347=function(_0x357acb){while(--_0x357acb){_0x1186ba['push'](_0x1186ba['shift']());}};_0x13a347(++_0x421a86);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x49c68e,_0x1c1673){_0x49c68e=_0x49c68e-0x0;var _0x33032b=_0x1eba[_0x49c68e];return _0x33032b;};var _=require(_0xa1eb('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x2b1355){return _0x2b1355==='{{'?_0xa1eb('0x1'):_0xa1eb('0x2');}function safeTemplate(_0x3ef7ee){var _0x5865fc=_0x3ef7ee;if(typeof _0x3ef7ee==='string'){_0x5865fc=_0x3ef7ee[_0xa1eb('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xa1eb('0x4')](_0x3ef7ee)){_0x5865fc=_0x3ef7ee[_0xa1eb('0x5')](function(_0xf9d704){return safeTemplate(_0xf9d704);});}else if(_[_0xa1eb('0x6')](_0x3ef7ee)){_0x5865fc=Object[_0xa1eb('0x7')](_0x3ef7ee)[_0xa1eb('0x8')](function(_0x2bfbb0,_0x39a5a3){_0x2bfbb0[_0x39a5a3]=safeTemplate(_0x3ef7ee[_0x39a5a3]);return _0x2bfbb0;},{});}return _0x5865fc;}module[_0xa1eb('0x9')][_0xa1eb('0xa')]=safeTemplate; \ No newline at end of file +var _0x3423=['isArray','map','isPlainObject','keys','reduce','exports','safeTemplate','{\x20{\x20','\x20}\x20}','string','replace'];(function(_0x2727ba,_0xa525a1){var _0x43c22c=function(_0x1b9990){while(--_0x1b9990){_0x2727ba['push'](_0x2727ba['shift']());}};_0x43c22c(++_0xa525a1);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x4a04c7){return _0x4a04c7==='{{'?_0x3342('0x0'):_0x3342('0x1');}function safeTemplate(_0x3477de){var _0x3b763d=_0x3477de;if(typeof _0x3477de===_0x3342('0x2')){_0x3b763d=_0x3477de[_0x3342('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x3342('0x4')](_0x3477de)){_0x3b763d=_0x3477de[_0x3342('0x5')](function(_0x3075f8){return safeTemplate(_0x3075f8);});}else if(_[_0x3342('0x6')](_0x3477de)){_0x3b763d=Object[_0x3342('0x7')](_0x3477de)[_0x3342('0x8')](function(_0x29c40c,_0x420d4b){_0x29c40c[_0x420d4b]=safeTemplate(_0x3477de[_0x420d4b]);return _0x29c40c;},{});}return _0x3b763d;}module[_0x3342('0x9')][_0x3342('0xa')]=safeTemplate; \ No newline at end of file